summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.cirrus.yml6
-rw-r--r--.clang-format6
-rw-r--r--.editorconfig2
-rw-r--r--.gitattributes22
-rw-r--r--.github/PULL_REQUEST_TEMPLATE.md3
-rw-r--r--.github/workflows/check-whitespace.yml63
-rw-r--r--.github/workflows/coverity.yml163
-rw-r--r--.github/workflows/l10n.yml16
-rw-r--r--.github/workflows/main.yml161
-rw-r--r--.gitignore15
-rw-r--r--.gitlab-ci.yml104
-rw-r--r--.mailmap10
-rw-r--r--CODE_OF_CONDUCT.md4
-rw-r--r--Documentation/.gitignore1
-rw-r--r--Documentation/CodingGuidelines262
-rw-r--r--Documentation/Makefile69
-rw-r--r--Documentation/MyFirstContribution.txt66
-rw-r--r--Documentation/MyFirstObjectWalk.txt67
-rw-r--r--Documentation/RelNotes/1.6.2.txt2
-rw-r--r--Documentation/RelNotes/1.6.3.txt2
-rw-r--r--Documentation/RelNotes/1.6.4.txt2
-rw-r--r--Documentation/RelNotes/1.6.5.txt2
-rw-r--r--Documentation/RelNotes/1.6.6.txt2
-rw-r--r--Documentation/RelNotes/2.30.6.txt60
-rw-r--r--Documentation/RelNotes/2.30.7.txt86
-rw-r--r--Documentation/RelNotes/2.30.8.txt51
-rw-r--r--Documentation/RelNotes/2.30.9.txt43
-rw-r--r--Documentation/RelNotes/2.31.5.txt5
-rw-r--r--Documentation/RelNotes/2.31.6.txt5
-rw-r--r--Documentation/RelNotes/2.31.7.txt6
-rw-r--r--Documentation/RelNotes/2.31.8.txt6
-rw-r--r--Documentation/RelNotes/2.32.4.txt5
-rw-r--r--Documentation/RelNotes/2.32.5.txt8
-rw-r--r--Documentation/RelNotes/2.32.6.txt6
-rw-r--r--Documentation/RelNotes/2.32.7.txt7
-rw-r--r--Documentation/RelNotes/2.33.5.txt5
-rw-r--r--Documentation/RelNotes/2.33.6.txt5
-rw-r--r--Documentation/RelNotes/2.33.7.txt7
-rw-r--r--Documentation/RelNotes/2.33.8.txt7
-rw-r--r--Documentation/RelNotes/2.34.5.txt5
-rw-r--r--Documentation/RelNotes/2.34.6.txt5
-rw-r--r--Documentation/RelNotes/2.34.7.txt7
-rw-r--r--Documentation/RelNotes/2.34.8.txt7
-rw-r--r--Documentation/RelNotes/2.35.5.txt5
-rw-r--r--Documentation/RelNotes/2.35.6.txt5
-rw-r--r--Documentation/RelNotes/2.35.7.txt7
-rw-r--r--Documentation/RelNotes/2.35.8.txt7
-rw-r--r--Documentation/RelNotes/2.36.3.txt5
-rw-r--r--Documentation/RelNotes/2.36.4.txt5
-rw-r--r--Documentation/RelNotes/2.36.5.txt7
-rw-r--r--Documentation/RelNotes/2.36.6.txt7
-rw-r--r--Documentation/RelNotes/2.37.3.txt46
-rw-r--r--Documentation/RelNotes/2.37.4.txt65
-rw-r--r--Documentation/RelNotes/2.37.5.txt5
-rw-r--r--Documentation/RelNotes/2.37.6.txt7
-rw-r--r--Documentation/RelNotes/2.37.7.txt7
-rw-r--r--Documentation/RelNotes/2.38.0.txt404
-rw-r--r--Documentation/RelNotes/2.38.1.txt5
-rw-r--r--Documentation/RelNotes/2.38.2.txt67
-rw-r--r--Documentation/RelNotes/2.38.3.txt5
-rw-r--r--Documentation/RelNotes/2.38.4.txt7
-rw-r--r--Documentation/RelNotes/2.38.5.txt8
-rw-r--r--Documentation/RelNotes/2.39.0.txt346
-rw-r--r--Documentation/RelNotes/2.39.1.txt5
-rw-r--r--Documentation/RelNotes/2.39.2.txt7
-rw-r--r--Documentation/RelNotes/2.39.3.txt64
-rw-r--r--Documentation/RelNotes/2.40.0.txt320
-rw-r--r--Documentation/RelNotes/2.40.1.txt8
-rw-r--r--Documentation/RelNotes/2.41.0.txt399
-rw-r--r--Documentation/RelNotes/2.42.0.txt329
-rw-r--r--Documentation/RelNotes/2.42.1.txt88
-rw-r--r--Documentation/RelNotes/2.43.0.txt323
-rw-r--r--Documentation/RelNotes/2.43.1.txt82
-rw-r--r--Documentation/RelNotes/2.43.2.txt37
-rw-r--r--Documentation/RelNotes/2.43.3.txt12
-rw-r--r--Documentation/RelNotes/2.44.0.txt334
-rw-r--r--Documentation/RelNotes/2.45.0.txt433
-rw-r--r--Documentation/ReviewingGuidelines.txt162
-rw-r--r--Documentation/SubmittingPatches204
-rw-r--r--Documentation/ToolsForGit.txt4
-rw-r--r--Documentation/asciidoc.conf19
-rw-r--r--Documentation/blame-options.txt8
-rwxr-xr-xDocumentation/build-docdep.perl5
-rwxr-xr-xDocumentation/cmd-list.perl2
-rw-r--r--Documentation/config.txt64
-rw-r--r--Documentation/config/add.txt7
-rw-r--r--Documentation/config/advice.txt192
-rw-r--r--Documentation/config/alias.txt2
-rw-r--r--Documentation/config/apply.txt4
-rw-r--r--Documentation/config/attr.txt7
-rw-r--r--Documentation/config/branch.txt6
-rw-r--r--Documentation/config/bundle.txt31
-rw-r--r--Documentation/config/checkout.txt4
-rw-r--r--Documentation/config/clean.txt4
-rw-r--r--Documentation/config/clone.txt22
-rw-r--r--Documentation/config/color.txt2
-rw-r--r--Documentation/config/column.txt4
-rw-r--r--Documentation/config/commit.txt4
-rw-r--r--Documentation/config/core.txt58
-rw-r--r--Documentation/config/credential.txt4
-rw-r--r--Documentation/config/diff.txt33
-rw-r--r--Documentation/config/difftool.txt35
-rw-r--r--Documentation/config/extensions.txt23
-rw-r--r--Documentation/config/fastimport.txt4
-rw-r--r--Documentation/config/feature.txt11
-rw-r--r--Documentation/config/fetch.txt34
-rw-r--r--Documentation/config/format.txt22
-rw-r--r--Documentation/config/fsck.txt24
-rw-r--r--Documentation/config/fsmonitor--daemon.txt11
-rw-r--r--Documentation/config/gc.txt53
-rw-r--r--Documentation/config/gpg.txt9
-rw-r--r--Documentation/config/grep.txt9
-rw-r--r--Documentation/config/gui.txt2
-rw-r--r--Documentation/config/http.txt9
-rw-r--r--Documentation/config/i18n.txt2
-rw-r--r--Documentation/config/imap.txt4
-rw-r--r--Documentation/config/index.txt13
-rw-r--r--Documentation/config/init.txt11
-rw-r--r--Documentation/config/interactive.txt4
-rw-r--r--Documentation/config/log.txt15
-rw-r--r--Documentation/config/lsrefs.txt2
-rw-r--r--Documentation/config/mailinfo.txt2
-rw-r--r--Documentation/config/maintenance.txt2
-rw-r--r--Documentation/config/man.txt2
-rw-r--r--Documentation/config/merge.txt2
-rw-r--r--Documentation/config/mergetool.txt38
-rw-r--r--Documentation/config/notes.txt45
-rw-r--r--Documentation/config/pack.txt59
-rw-r--r--Documentation/config/protocol.txt8
-rw-r--r--Documentation/config/push.txt23
-rw-r--r--Documentation/config/rebase.txt25
-rw-r--r--Documentation/config/receive.txt4
-rw-r--r--Documentation/config/rerere.txt2
-rw-r--r--Documentation/config/safe.txt25
-rw-r--r--Documentation/config/sendemail.txt55
-rw-r--r--Documentation/config/sequencer.txt2
-rw-r--r--Documentation/config/splitindex.txt6
-rw-r--r--Documentation/config/stash.txt8
-rw-r--r--Documentation/config/status.txt6
-rw-r--r--Documentation/config/submodule.txt4
-rw-r--r--Documentation/config/trace2.txt2
-rw-r--r--Documentation/config/transfer.txt18
-rw-r--r--Documentation/config/uploadpack.txt6
-rw-r--r--Documentation/config/user.txt10
-rw-r--r--Documentation/config/versionsort.txt6
-rw-r--r--Documentation/diff-generate-patch.txt27
-rw-r--r--Documentation/diff-options.txt143
-rwxr-xr-xDocumentation/doc-diff2
-rw-r--r--Documentation/fetch-options.txt18
-rw-r--r--Documentation/fsck-msgids.txt180
-rw-r--r--Documentation/git-add.txt40
-rw-r--r--Documentation/git-am.txt64
-rw-r--r--Documentation/git-annotate.txt2
-rw-r--r--Documentation/git-apply.txt26
-rw-r--r--Documentation/git-archive.txt42
-rw-r--r--Documentation/git-bisect-lk2009.txt4
-rw-r--r--Documentation/git-bisect.txt29
-rw-r--r--Documentation/git-blame.txt18
-rw-r--r--Documentation/git-branch.txt19
-rw-r--r--Documentation/git-bugreport.txt35
-rw-r--r--Documentation/git-bundle.txt41
-rw-r--r--Documentation/git-cat-file.txt114
-rw-r--r--Documentation/git-check-attr.txt13
-rw-r--r--Documentation/git-check-ignore.txt2
-rw-r--r--Documentation/git-check-ref-format.txt4
-rw-r--r--Documentation/git-checkout-index.txt10
-rw-r--r--Documentation/git-checkout.txt98
-rw-r--r--Documentation/git-cherry-pick.txt37
-rw-r--r--Documentation/git-clean.txt27
-rw-r--r--Documentation/git-clone.txt169
-rw-r--r--Documentation/git-column.txt7
-rw-r--r--Documentation/git-commit-graph.txt17
-rw-r--r--Documentation/git-commit.txt8
-rw-r--r--Documentation/git-config.txt128
-rw-r--r--Documentation/git-count-objects.txt6
-rw-r--r--Documentation/git-credential-cache--daemon.txt4
-rw-r--r--Documentation/git-credential-cache.txt15
-rw-r--r--Documentation/git-credential-store.txt2
-rw-r--r--Documentation/git-credential.txt37
-rw-r--r--Documentation/git-cvsimport.txt4
-rw-r--r--Documentation/git-cvsserver.txt6
-rw-r--r--Documentation/git-daemon.txt12
-rw-r--r--Documentation/git-describe.txt4
-rw-r--r--Documentation/git-diagnose.txt65
-rw-r--r--Documentation/git-diff-files.txt8
-rw-r--r--Documentation/git-diff-index.txt4
-rw-r--r--Documentation/git-diff-tree.txt12
-rw-r--r--Documentation/git-diff.txt24
-rw-r--r--Documentation/git-difftool.txt44
-rw-r--r--Documentation/git-fast-export.txt4
-rw-r--r--Documentation/git-fast-import.txt15
-rw-r--r--Documentation/git-fetch-pack.txt2
-rw-r--r--Documentation/git-fetch.txt28
-rw-r--r--Documentation/git-filter-branch.txt6
-rw-r--r--Documentation/git-for-each-ref.txt112
-rw-r--r--Documentation/git-format-patch.txt66
-rw-r--r--Documentation/git-fsck.txt20
-rw-r--r--Documentation/git-fsmonitor--daemon.txt37
-rw-r--r--Documentation/git-gc.txt22
-rw-r--r--Documentation/git-get-tar-commit-id.txt2
-rw-r--r--Documentation/git-grep.txt74
-rw-r--r--Documentation/git-hash-object.txt16
-rw-r--r--Documentation/git-help.txt41
-rw-r--r--Documentation/git-hook.txt9
-rw-r--r--Documentation/git-http-backend.txt10
-rw-r--r--Documentation/git-http-fetch.txt2
-rw-r--r--Documentation/git-http-push.txt10
-rw-r--r--Documentation/git-imap-send.txt4
-rw-r--r--Documentation/git-index-pack.txt36
-rw-r--r--Documentation/git-init.txt104
-rw-r--r--Documentation/git-interpret-trailers.txt365
-rw-r--r--Documentation/git-log.txt64
-rw-r--r--Documentation/git-ls-files.txt147
-rw-r--r--Documentation/git-ls-remote.txt65
-rw-r--r--Documentation/git-ls-tree.txt8
-rw-r--r--Documentation/git-mailinfo.txt7
-rw-r--r--Documentation/git-mailsplit.txt2
-rw-r--r--Documentation/git-maintenance.txt33
-rw-r--r--Documentation/git-merge-base.txt16
-rw-r--r--Documentation/git-merge-file.txt44
-rw-r--r--Documentation/git-merge-tree.txt314
-rw-r--r--Documentation/git-merge.txt96
-rw-r--r--Documentation/git-mergetool--lib.txt10
-rw-r--r--Documentation/git-mergetool.txt20
-rw-r--r--Documentation/git-mktag.txt8
-rw-r--r--Documentation/git-mktree.txt4
-rw-r--r--Documentation/git-multi-pack-index.txt11
-rw-r--r--Documentation/git-mv.txt8
-rw-r--r--Documentation/git-name-rev.txt13
-rw-r--r--Documentation/git-notes.txt95
-rw-r--r--Documentation/git-pack-objects.txt8
-rw-r--r--Documentation/git-pack-redundant.txt18
-rw-r--r--Documentation/git-pack-refs.txt42
-rw-r--r--Documentation/git-patch-id.txt24
-rw-r--r--Documentation/git-prune-packed.txt4
-rw-r--r--Documentation/git-prune.txt2
-rw-r--r--Documentation/git-pull.txt4
-rw-r--r--Documentation/git-push.txt22
-rw-r--r--Documentation/git-quiltimport.txt4
-rw-r--r--Documentation/git-range-diff.txt8
-rw-r--r--Documentation/git-read-tree.txt10
-rw-r--r--Documentation/git-rebase.txt236
-rw-r--r--Documentation/git-receive-pack.txt8
-rw-r--r--Documentation/git-reflog.txt22
-rw-r--r--Documentation/git-remote-ext.txt10
-rw-r--r--Documentation/git-remote-fd.txt10
-rw-r--r--Documentation/git-remote.txt2
-rw-r--r--Documentation/git-repack.txt51
-rw-r--r--Documentation/git-replace.txt10
-rw-r--r--Documentation/git-replay.txt127
-rw-r--r--Documentation/git-request-pull.txt4
-rw-r--r--Documentation/git-rerere.txt2
-rw-r--r--Documentation/git-reset.txt3
-rw-r--r--Documentation/git-restore.txt8
-rw-r--r--Documentation/git-rev-list.txt6
-rw-r--r--Documentation/git-rev-parse.txt63
-rw-r--r--Documentation/git-revert.txt26
-rw-r--r--Documentation/git-rm.txt2
-rw-r--r--Documentation/git-send-email.txt117
-rw-r--r--Documentation/git-send-pack.txt21
-rw-r--r--Documentation/git-sh-setup.txt2
-rw-r--r--Documentation/git-shortlog.txt8
-rw-r--r--Documentation/git-show-branch.txt39
-rw-r--r--Documentation/git-show-ref.txt62
-rw-r--r--Documentation/git-show.txt4
-rw-r--r--Documentation/git-sparse-checkout.txt27
-rw-r--r--Documentation/git-stash.txt26
-rw-r--r--Documentation/git-status.txt77
-rw-r--r--Documentation/git-stripspace.txt6
-rw-r--r--Documentation/git-submodule.txt35
-rw-r--r--Documentation/git-svn.txt18
-rw-r--r--Documentation/git-switch.txt18
-rw-r--r--Documentation/git-symbolic-ref.txt13
-rw-r--r--Documentation/git-tag.txt32
-rw-r--r--Documentation/git-update-index.txt34
-rw-r--r--Documentation/git-update-ref.txt60
-rw-r--r--Documentation/git-update-server-info.txt10
-rw-r--r--Documentation/git-upload-archive.txt4
-rw-r--r--Documentation/git-upload-pack.txt9
-rw-r--r--Documentation/git-var.txt38
-rw-r--r--Documentation/git-verify-commit.txt2
-rw-r--r--Documentation/git-verify-pack.txt8
-rw-r--r--Documentation/git-verify-tag.txt2
-rw-r--r--Documentation/git-whatchanged.txt8
-rw-r--r--Documentation/git-worktree.txt24
-rw-r--r--Documentation/git.txt147
-rw-r--r--Documentation/gitattributes.txt125
-rw-r--r--Documentation/gitcli.txt11
-rw-r--r--Documentation/gitcore-tutorial.txt2
-rw-r--r--Documentation/gitcredentials.txt31
-rw-r--r--Documentation/gitdiffcore.txt22
-rw-r--r--Documentation/giteveryday.txt4
-rw-r--r--Documentation/gitformat-bundle.txt (renamed from Documentation/technical/bundle-format.txt)48
-rw-r--r--Documentation/gitformat-chunk.txt (renamed from Documentation/technical/chunk-format.txt)33
-rw-r--r--Documentation/gitformat-commit-graph.txt (renamed from Documentation/technical/commit-graph-format.txt)53
-rw-r--r--Documentation/gitformat-index.txt (renamed from Documentation/technical/index-format.txt)30
-rw-r--r--Documentation/gitformat-pack.txt (renamed from Documentation/technical/pack-format.txt)225
-rw-r--r--Documentation/gitformat-signature.txt (renamed from Documentation/technical/signature-format.txt)45
-rw-r--r--Documentation/githooks.txt95
-rw-r--r--Documentation/gitignore.txt14
-rw-r--r--Documentation/gitk.txt6
-rw-r--r--Documentation/gitmodules.txt6
-rw-r--r--Documentation/gitprotocol-capabilities.txt (renamed from Documentation/technical/protocol-capabilities.txt)54
-rw-r--r--Documentation/gitprotocol-common.txt (renamed from Documentation/technical/protocol-common.txt)23
-rw-r--r--Documentation/gitprotocol-http.txt (renamed from Documentation/technical/http-protocol.txt)59
-rw-r--r--Documentation/gitprotocol-pack.txt (renamed from Documentation/technical/pack-protocol.txt)32
-rw-r--r--Documentation/gitprotocol-v2.txt (renamed from Documentation/technical/protocol-v2.txt)248
-rw-r--r--Documentation/gitremote-helpers.txt24
-rw-r--r--Documentation/gitrepository-layout.txt4
-rw-r--r--Documentation/gitsubmodules.txt10
-rw-r--r--Documentation/gittutorial.txt137
-rw-r--r--Documentation/gitweb.conf.txt16
-rw-r--r--Documentation/gitweb.txt22
-rw-r--r--Documentation/glossary-content.txt112
-rw-r--r--Documentation/howto/coordinate-embargoed-releases.txt165
-rw-r--r--Documentation/howto/keep-canonical-history-correct.txt2
-rw-r--r--Documentation/howto/maintain-git.txt17
-rw-r--r--Documentation/howto/new-command.txt4
-rw-r--r--Documentation/howto/recover-corrupted-object-harder.txt2
-rw-r--r--Documentation/howto/update-hook-example.txt4
-rw-r--r--Documentation/howto/use-git-daemon.txt2
-rw-r--r--Documentation/howto/using-merge-subtree.txt2
-rw-r--r--Documentation/i18n.txt4
-rw-r--r--Documentation/includes/cmd-config-section-all.txt3
-rw-r--r--Documentation/includes/cmd-config-section-rest.txt3
-rwxr-xr-xDocumentation/lint-fsck-msgids.perl70
-rwxr-xr-xDocumentation/lint-man-section-order.perl3
-rw-r--r--Documentation/manpage-base-url.xsl.in10
-rw-r--r--Documentation/manpage-normal.xsl16
-rw-r--r--Documentation/manpage-quote-apos.xsl16
-rw-r--r--Documentation/merge-options.txt2
-rw-r--r--Documentation/mergetools/vimdiff.txt9
-rw-r--r--Documentation/object-format-disclaimer.txt15
-rw-r--r--Documentation/pretty-formats.txt91
-rw-r--r--Documentation/pretty-options.txt8
-rw-r--r--Documentation/pull-fetch-param.txt6
-rw-r--r--Documentation/ref-storage-format.txt3
-rw-r--r--Documentation/rerere-options.txt9
-rw-r--r--Documentation/rev-list-options.txt120
-rw-r--r--Documentation/revisions.txt51
-rw-r--r--Documentation/scalar.txt (renamed from contrib/scalar/scalar.txt)21
-rw-r--r--Documentation/signoff-option.txt2
-rw-r--r--Documentation/technical/api-error-handling.txt2
-rw-r--r--Documentation/technical/api-index-skel.txt2
-rw-r--r--Documentation/technical/api-merge.txt4
-rw-r--r--Documentation/technical/api-parse-options.txt49
-rw-r--r--Documentation/technical/api-simple-ipc.txt12
-rw-r--r--Documentation/technical/api-trace2.txt230
-rw-r--r--Documentation/technical/bitmap-format.txt43
-rw-r--r--Documentation/technical/bundle-uri.txt572
-rw-r--r--Documentation/technical/commit-graph.txt14
-rw-r--r--Documentation/technical/cruft-packs.txt123
-rw-r--r--Documentation/technical/hash-function-transition.txt4
-rw-r--r--Documentation/technical/long-running-process-protocol.txt2
-rw-r--r--Documentation/technical/packfile-uri.txt2
-rw-r--r--Documentation/technical/parallel-checkout.txt12
-rw-r--r--Documentation/technical/partial-clone.txt10
-rw-r--r--Documentation/technical/racy-git.txt10
-rw-r--r--Documentation/technical/reftable.txt10
-rw-r--r--Documentation/technical/remembering-renames.txt6
-rw-r--r--Documentation/technical/repository-version.txt12
-rw-r--r--Documentation/technical/rerere.txt8
-rw-r--r--Documentation/technical/scalar.txt66
-rw-r--r--Documentation/technical/sparse-checkout.txt1103
-rw-r--r--Documentation/technical/unit-tests.txt240
-rw-r--r--Documentation/trace2-target-values.txt2
-rw-r--r--Documentation/urls-remotes.txt6
-rw-r--r--Documentation/urls.txt56
-rw-r--r--Documentation/user-manual.txt89
-rwxr-xr-xGIT-VERSION-GEN4
-rw-r--r--INSTALL13
-rw-r--r--Makefile790
-rw-r--r--README.md6
l---------RelNotes2
-rw-r--r--abspath.c47
-rw-r--r--abspath.h54
-rw-r--r--add-interactive.c42
-rw-r--r--add-patch.c116
-rw-r--r--advice.c151
-rw-r--r--advice.h23
-rw-r--r--alias.c35
-rw-r--r--alias.h3
-rw-r--r--alloc.c3
-rw-r--r--apply.c164
-rw-r--r--apply.h2
-rw-r--r--archive-tar.c99
-rw-r--r--archive-zip.c15
-rw-r--r--archive.c128
-rw-r--r--archive.h5
-rw-r--r--attr.c432
-rw-r--r--attr.h34
-rw-r--r--banned.h4
-rw-r--r--base85.c3
-rw-r--r--base85.h7
-rw-r--r--bisect.c102
-rw-r--r--blame.c110
-rw-r--r--blame.h5
-rw-r--r--blob.c6
-rw-r--r--blob.h3
-rw-r--r--block-sha1/sha1.c4
-rw-r--r--bloom.c40
-rw-r--r--branch.c180
-rw-r--r--branch.h29
-rw-r--r--builtin.h21
-rw-r--r--builtin/add.c253
-rw-r--r--builtin/am.c290
-rw-r--r--builtin/apply.c4
-rw-r--r--builtin/archive.c9
-rw-r--r--builtin/bisect.c (renamed from builtin/bisect--helper.c)472
-rw-r--r--builtin/blame.c61
-rw-r--r--builtin/branch.c383
-rw-r--r--builtin/bugreport.c56
-rw-r--r--builtin/bundle.c150
-rw-r--r--builtin/cat-file.c287
-rw-r--r--builtin/check-attr.c34
-rw-r--r--builtin/check-ignore.c8
-rw-r--r--builtin/check-mailmap.c4
-rw-r--r--builtin/check-ref-format.c17
-rw-r--r--builtin/checkout--worker.c2
-rw-r--r--builtin/checkout-index.c42
-rw-r--r--builtin/checkout.c413
-rw-r--r--builtin/clean.c49
-rw-r--r--builtin/clone.c268
-rw-r--r--builtin/column.c9
-rw-r--r--builtin/commit-graph.c104
-rw-r--r--builtin/commit-tree.c30
-rw-r--r--builtin/commit.c292
-rw-r--r--builtin/config.c186
-rw-r--r--builtin/count-objects.c16
-rw-r--r--builtin/credential-cache--daemon.c32
-rw-r--r--builtin/credential-cache.c9
-rw-r--r--builtin/credential-store.c37
-rw-r--r--builtin/credential.c2
-rw-r--r--builtin/describe.c67
-rw-r--r--builtin/diagnose.c65
-rw-r--r--builtin/diff-files.c24
-rw-r--r--builtin/diff-index.c23
-rw-r--r--builtin/diff-tree.c27
-rw-r--r--builtin/diff.c136
-rw-r--r--builtin/difftool.c81
-rw-r--r--builtin/fast-export.c143
-rw-r--r--builtin/fast-import.c67
-rw-r--r--builtin/fetch-pack.c10
-rw-r--r--builtin/fetch.c955
-rw-r--r--builtin/fmt-merge-msg.c1
-rw-r--r--builtin/for-each-ref.c75
-rw-r--r--builtin/for-each-repo.c27
-rw-r--r--builtin/fsck.c215
-rw-r--r--builtin/fsmonitor--daemon.c55
-rw-r--r--builtin/gc.c756
-rw-r--r--builtin/get-tar-commit-id.c10
-rw-r--r--builtin/grep.c122
-rw-r--r--builtin/hash-object.c16
-rw-r--r--builtin/help.c36
-rw-r--r--builtin/hook.c19
-rw-r--r--builtin/index-pack.c72
-rw-r--r--builtin/init-db.c497
-rw-r--r--builtin/interpret-trailers.c136
-rw-r--r--builtin/log.c371
-rw-r--r--builtin/ls-files.c252
-rw-r--r--builtin/ls-remote.c22
-rw-r--r--builtin/ls-tree.c349
-rw-r--r--builtin/mailinfo.c5
-rw-r--r--builtin/mailsplit.c4
-rw-r--r--builtin/merge-base.c35
-rw-r--r--builtin/merge-file.c122
-rw-r--r--builtin/merge-index.c26
-rw-r--r--builtin/merge-ours.c6
-rw-r--r--builtin/merge-recursive.c17
-rw-r--r--builtin/merge-tree.c322
-rw-r--r--builtin/merge.c337
-rw-r--r--builtin/mktag.c20
-rw-r--r--builtin/mktree.c5
-rw-r--r--builtin/multi-pack-index.c91
-rw-r--r--builtin/mv.c409
-rw-r--r--builtin/name-rev.c111
-rw-r--r--builtin/notes.c263
-rw-r--r--builtin/pack-objects.c400
-rw-r--r--builtin/pack-redundant.c9
-rw-r--r--builtin/pack-refs.c43
-rw-r--r--builtin/patch-id.c122
-rw-r--r--builtin/prune-packed.c1
-rw-r--r--builtin/prune.c27
-rw-r--r--builtin/pull.c210
-rw-r--r--builtin/push.c147
-rw-r--r--builtin/range-diff.c108
-rw-r--r--builtin/read-tree.c56
-rw-r--r--builtin/rebase.c706
-rw-r--r--builtin/receive-pack.c166
-rw-r--r--builtin/reflog.c112
-rw-r--r--builtin/remote-ext.c8
-rw-r--r--builtin/remote-fd.c4
-rw-r--r--builtin/remote.c248
-rw-r--r--builtin/repack.c951
-rw-r--r--builtin/replace.c43
-rw-r--r--builtin/replay.c446
-rw-r--r--builtin/rerere.c8
-rw-r--r--builtin/reset.c206
-rw-r--r--builtin/rev-list.c179
-rw-r--r--builtin/rev-parse.c102
-rw-r--r--builtin/revert.c75
-rw-r--r--builtin/rm.c52
-rw-r--r--builtin/send-pack.c48
-rw-r--r--builtin/shortlog.c105
-rw-r--r--builtin/show-branch.c69
-rw-r--r--builtin/show-index.c5
-rw-r--r--builtin/show-ref.c300
-rw-r--r--builtin/sparse-checkout.c211
-rw-r--r--builtin/stash.c304
-rw-r--r--builtin/stripspace.c10
-rw-r--r--builtin/submodule--helper.c1231
-rw-r--r--builtin/symbolic-ref.c26
-rw-r--r--builtin/tag.c174
-rw-r--r--builtin/unpack-file.c13
-rw-r--r--builtin/unpack-objects.c144
-rw-r--r--builtin/update-index.c216
-rw-r--r--builtin/update-ref.c56
-rw-r--r--builtin/update-server-info.c7
-rw-r--r--builtin/upload-archive.c7
-rw-r--r--builtin/upload-pack.c11
-rw-r--r--builtin/var.c200
-rw-r--r--builtin/verify-commit.c21
-rw-r--r--builtin/verify-pack.c5
-rw-r--r--builtin/verify-tag.c20
-rw-r--r--builtin/worktree.c464
-rw-r--r--builtin/write-tree.c13
-rw-r--r--bulk-checkin.c49
-rw-r--r--bulk-checkin.h8
-rw-r--r--bundle-uri.c934
-rw-r--r--bundle-uri.h168
-rw-r--r--bundle.c114
-rw-r--r--bundle.h17
-rw-r--r--cache-tree.c46
-rw-r--r--cache-tree.h16
-rw-r--r--cache.h1955
-rw-r--r--cbtree.c1
-rw-r--r--cbtree.h2
-rw-r--r--chdir-notify.c5
-rw-r--r--checkout.c7
-rw-r--r--checkout.h2
-rw-r--r--chunk-format.c29
-rw-r--r--chunk-format.h12
-rw-r--r--ci/config/README14
-rwxr-xr-xci/config/allow-ref.sample27
-rwxr-xr-xci/install-dependencies.sh24
-rwxr-xr-xci/install-docker-dependencies.sh28
-rwxr-xr-xci/lib.sh228
-rwxr-xr-xci/print-test-failures.sh8
-rwxr-xr-xci/run-build-and-minimal-fuzzers.sh19
-rwxr-xr-xci/run-build-and-tests.sh9
-rwxr-xr-xci/run-test-slice.sh5
-rw-r--r--color.c17
-rw-r--r--color.h6
-rw-r--r--column.c9
-rw-r--r--combine-diff.c22
-rw-r--r--command-list.txt40
-rw-r--r--commit-graph.c723
-rw-r--r--commit-graph.h32
-rw-r--r--commit-reach.c458
-rw-r--r--commit-reach.h75
-rw-r--r--commit-slab-impl.h2
-rw-r--r--commit.c421
-rw-r--r--commit.h54
-rw-r--r--common-main.c8
-rw-r--r--compat/compiler.h1
-rw-r--r--compat/disk.h57
-rw-r--r--compat/fsmonitor/fsm-darwin-gcc.h4
-rw-r--r--compat/fsmonitor/fsm-health-darwin.c12
-rw-r--r--compat/fsmonitor/fsm-health-win32.c6
-rw-r--r--compat/fsmonitor/fsm-ipc-darwin.c56
-rw-r--r--compat/fsmonitor/fsm-ipc-win32.c11
-rw-r--r--compat/fsmonitor/fsm-listen-darwin.c63
-rw-r--r--compat/fsmonitor/fsm-listen-win32.c31
-rw-r--r--compat/fsmonitor/fsm-path-utils-darwin.c138
-rw-r--r--compat/fsmonitor/fsm-path-utils-win32.c148
-rw-r--r--compat/fsmonitor/fsm-settings-darwin.c78
-rw-r--r--compat/fsmonitor/fsm-settings-win32.c108
-rw-r--r--compat/linux/procinfo.c2
-rw-r--r--compat/mingw.c184
-rw-r--r--compat/mingw.h15
-rw-r--r--compat/nonblock.c50
-rw-r--r--compat/nonblock.h9
-rw-r--r--compat/pread.c1
-rw-r--r--compat/precompose_utf8.c6
-rw-r--r--compat/regcomp_enhanced.c9
-rw-r--r--compat/sha1-chunked.c3
-rw-r--r--compat/simple-ipc/ipc-shared.c5
-rw-r--r--compat/simple-ipc/ipc-unix-socket.c5
-rw-r--r--compat/simple-ipc/ipc-win32.c6
-rw-r--r--compat/terminal.c15
-rw-r--r--compat/win32/headless.c115
-rw-r--r--compat/win32/pthread.c25
-rw-r--r--compat/win32/pthread.h2
-rw-r--r--compat/win32/trace2_win32_process_info.c8
-rw-r--r--compat/winansi.c2
-rw-r--r--config.c1228
-rw-r--r--config.h184
-rw-r--r--config.mak.dev29
-rw-r--r--config.mak.uname246
-rw-r--r--configure.ac16
-rw-r--r--connect.c116
-rw-r--r--connect.h9
-rw-r--r--connected.c19
-rw-r--r--connected.h7
-rw-r--r--contrib/README4
-rw-r--r--contrib/buildsystems/CMakeLists.txt82
-rw-r--r--contrib/buildsystems/Generators/Vcxproj.pm4
-rwxr-xr-xcontrib/buildsystems/engine.pl1
-rw-r--r--contrib/coccinelle/.gitignore2
-rw-r--r--contrib/coccinelle/README87
-rw-r--r--contrib/coccinelle/array.cocci89
-rw-r--r--contrib/coccinelle/config_fn_ctx.pending.cocci144
-rw-r--r--contrib/coccinelle/git_config_number.cocci27
-rw-r--r--contrib/coccinelle/hashmap.cocci2
-rw-r--r--contrib/coccinelle/index-compatibility.cocci157
-rw-r--r--contrib/coccinelle/preincr.cocci2
-rwxr-xr-xcontrib/coccinelle/spatchcache304
-rw-r--r--contrib/coccinelle/strbuf.cocci2
-rw-r--r--contrib/coccinelle/swap.cocci2
-rw-r--r--contrib/coccinelle/tests/free.c11
-rw-r--r--contrib/coccinelle/tests/free.res9
-rw-r--r--contrib/coccinelle/the_repository.cocci123
-rw-r--r--contrib/coccinelle/the_repository.pending.cocci129
-rw-r--r--contrib/coccinelle/xstrncmpz.cocci28
-rw-r--r--contrib/completion/git-completion.bash523
-rw-r--r--contrib/completion/git-prompt.sh66
-rwxr-xr-xcontrib/coverage-diff.sh9
-rw-r--r--contrib/credential/gnome-keyring/.gitignore1
-rw-r--r--contrib/credential/gnome-keyring/Makefile25
-rw-r--r--contrib/credential/gnome-keyring/git-credential-gnome-keyring.c470
-rw-r--r--contrib/credential/libsecret/.gitignore1
-rw-r--r--contrib/credential/libsecret/git-credential-libsecret.c113
-rwxr-xr-xcontrib/credential/netrc/git-credential-netrc.perl5
-rwxr-xr-xcontrib/credential/netrc/t-git-credential-netrc.sh18
-rw-r--r--contrib/credential/osxkeychain/Makefile3
-rw-r--r--contrib/credential/osxkeychain/git-credential-osxkeychain.c391
-rw-r--r--contrib/credential/wincred/git-credential-wincred.c178
-rw-r--r--contrib/diff-highlight/DiffHighlight.pm2
-rw-r--r--contrib/git-jump/README10
-rwxr-xr-xcontrib/git-jump/git-jump47
-rwxr-xr-xcontrib/hg-to-git/hg-to-git.py254
-rw-r--r--contrib/hg-to-git/hg-to-git.txt21
-rw-r--r--contrib/mw-to-git/Git/Mediawiki.pm2
-rwxr-xr-xcontrib/mw-to-git/t/t9363-mw-to-git-export-import.sh2
-rw-r--r--contrib/scalar/.gitignore2
-rw-r--r--contrib/scalar/Makefile35
-rw-r--r--contrib/scalar/README.md82
-rw-r--r--contrib/scalar/t/Makefile81
-rwxr-xr-xcontrib/scalar/t/t9099-scalar.sh123
-rwxr-xr-xcontrib/subtree/git-subtree.sh256
-rw-r--r--contrib/subtree/git-subtree.txt16
-rw-r--r--contrib/subtree/t/Makefile7
-rwxr-xr-xcontrib/subtree/t/t7900-subtree.sh102
-rwxr-xr-xcontrib/vscode/init.sh1
-rwxr-xr-xcontrib/workdir/git-new-workdir2
-rw-r--r--convert.c47
-rw-r--r--convert.h4
-rw-r--r--copy.c4
-rw-r--r--copy.h10
-rw-r--r--credential.c48
-rw-r--r--credential.h21
-rw-r--r--csum-file.c19
-rw-r--r--csum-file.h11
-rw-r--r--ctype.c36
-rw-r--r--daemon.c107
-rw-r--r--date.c112
-rw-r--r--date.h7
-rw-r--r--decorate.c17
-rw-r--r--decorate.h10
-rw-r--r--delta-islands.c105
-rw-r--r--delta-islands.h1
-rwxr-xr-xdetect-compiler10
-rw-r--r--diagnose.c280
-rw-r--r--diagnose.h18
-rw-r--r--diff-lib.c75
-rw-r--r--diff-merges.c45
-rw-r--r--diff-no-index.c150
-rw-r--r--diff.c663
-rw-r--r--diff.h43
-rw-r--r--diffcore-break.c7
-rw-r--r--diffcore-delta.c7
-rw-r--r--diffcore-order.c4
-rw-r--r--diffcore-pickaxe.c9
-rw-r--r--diffcore-rename.c12
-rw-r--r--diffcore-rotate.c3
-rw-r--r--diffcore.h5
-rw-r--r--dir-iterator.c122
-rw-r--r--dir-iterator.h16
-rw-r--r--dir.c225
-rw-r--r--dir.h158
-rw-r--r--editor.c37
-rw-r--r--editor.h34
-rw-r--r--entry.c31
-rw-r--r--entry.h16
-rw-r--r--environment.c66
-rw-r--r--environment.h223
-rw-r--r--ewah/bitmap.c11
-rw-r--r--ewah/ewah_bitmap.c1
-rw-r--r--ewah/ewok.h1
-rw-r--r--exec-cmd.c12
-rw-r--r--fetch-pack.c179
-rw-r--r--fetch-pack.h1
-rw-r--r--fmt-merge-msg.c45
-rw-r--r--fmt-merge-msg.h3
-rw-r--r--fsck.c431
-rw-r--r--fsck.h36
-rw-r--r--fsmonitor--daemon.h10
-rw-r--r--fsmonitor-ipc.c41
-rw-r--r--fsmonitor-ipc.h4
-rw-r--r--fsmonitor-ll.h52
-rw-r--r--fsmonitor-path-utils.h60
-rw-r--r--fsmonitor-settings.c86
-rw-r--r--fsmonitor-settings.h4
-rw-r--r--fsmonitor.c327
-rw-r--r--fsmonitor.h52
-rw-r--r--fuzz-commit-graph.c19
-rw-r--r--gettext.c12
-rw-r--r--gettext.h6
-rwxr-xr-xgit-add--interactive.perl1920
-rwxr-xr-xgit-archimport.perl2
-rwxr-xr-xgit-bisect.sh84
-rw-r--r--git-compat-util.h496
-rw-r--r--git-curl-compat.h17
-rwxr-xr-xgit-cvsexportcommit.perl2
-rwxr-xr-xgit-cvsimport.perl4
-rwxr-xr-xgit-cvsserver.perl2
-rwxr-xr-xgit-difftool--helper.sh18
-rw-r--r--git-gui/.gitattributes1
-rw-r--r--git-gui/Makefile39
-rw-r--r--git-gui/README.md2
-rwxr-xr-xgit-gui/git-gui.sh342
-rw-r--r--git-gui/lib/choose_repository.tcl27
-rw-r--r--git-gui/lib/encoding.tcl2
-rw-r--r--git-gui/lib/shortcut.tcl31
-rw-r--r--git-gui/po/README2
-rwxr-xr-xgit-instaweb.sh6
-rwxr-xr-xgit-merge-resolve.sh10
-rw-r--r--git-mergetool--lib.sh40
-rwxr-xr-xgit-mergetool.sh9
-rwxr-xr-xgit-p4.py42
-rwxr-xr-xgit-quiltimport.sh2
-rwxr-xr-xgit-request-pull.sh2
-rwxr-xr-xgit-send-email.perl437
-rw-r--r--git-sh-setup.sh16
-rwxr-xr-xgit-submodule.sh90
-rwxr-xr-xgit-svn.perl22
-rw-r--r--git-zlib.c (renamed from zlib.c)3
-rw-r--r--git-zlib.h28
-rw-r--r--git.c133
-rw-r--r--gitk-git/Makefile4
-rwxr-xr-xgitk-git/gitk40
-rw-r--r--gitweb/INSTALL4
-rw-r--r--gitweb/Makefile145
-rwxr-xr-xgitweb/gitweb.perl33
-rw-r--r--gitweb/static/gitweb.css2
-rw-r--r--gitweb/static/js/lib/common-lib.js10
-rw-r--r--gpg-interface.c109
-rw-r--r--gpg-interface.h11
-rw-r--r--graph.c4
-rw-r--r--graph.h4
-rw-r--r--grep.c122
-rw-r--r--grep.h10
-rw-r--r--hash-ll.h310
-rw-r--r--hash-lookup.c4
-rw-r--r--hash.h249
-rw-r--r--hashmap.c12
-rw-r--r--hashmap.h23
-rw-r--r--help.c70
-rw-r--r--help.h2
-rw-r--r--hex-ll.c49
-rw-r--r--hex-ll.h27
-rw-r--r--hex.c53
-rw-r--r--hex.h64
-rw-r--r--hook.c54
-rw-r--r--hook.h5
-rw-r--r--http-backend.c43
-rw-r--r--http-fetch.c10
-rw-r--r--http-push.c45
-rw-r--r--http-walker.c21
-rw-r--r--http.c311
-rw-r--r--http.h10
-rw-r--r--ident.c84
-rw-r--r--ident.h69
-rw-r--r--imap-send.c87
-rw-r--r--json-writer.c2
-rw-r--r--json-writer.h4
-rw-r--r--khash.h5
-rw-r--r--kwset.c40
-rw-r--r--kwset.h4
-rw-r--r--levenshtein.c2
-rw-r--r--line-log.c29
-rw-r--r--line-log.h5
-rw-r--r--line-range.c8
-rw-r--r--linear-assignment.c2
-rw-r--r--list-objects-filter-options.c101
-rw-r--r--list-objects-filter-options.h31
-rw-r--r--list-objects-filter.c55
-rw-r--r--list-objects.c79
-rw-r--r--list.h2
-rw-r--r--lockfile.c4
-rw-r--r--lockfile.h6
-rw-r--r--log-tree.c182
-rw-r--r--log-tree.h21
-rw-r--r--loose.c259
-rw-r--r--loose.h22
-rw-r--r--ls-refs.c64
-rw-r--r--mailinfo.c33
-rw-r--r--mailmap.c53
-rw-r--r--mailmap.h3
-rw-r--r--match-trees.c15
-rw-r--r--match-trees.h10
-rw-r--r--mem-pool.c53
-rw-r--r--mem-pool.h5
-rw-r--r--merge-blobs.c14
-rw-r--r--merge-ll.c (renamed from ll-merge.c)90
-rw-r--r--merge-ll.h (renamed from ll-merge.h)5
-rw-r--r--merge-ort-wrappers.c10
-rw-r--r--merge-ort.c965
-rw-r--r--merge-ort.h32
-rw-r--r--merge-recursive.c152
-rw-r--r--merge-recursive.h4
-rw-r--r--merge.c37
-rw-r--r--merge.h17
-rw-r--r--mergesort.c84
-rw-r--r--mergesort.h108
-rw-r--r--mergetools/vimdiff114
-rw-r--r--midx-write.c1525
-rw-r--r--midx.c1541
-rw-r--r--midx.h36
-rw-r--r--name-hash.c21
-rw-r--r--name-hash.h21
-rw-r--r--negotiator/default.c51
-rw-r--r--negotiator/noop.c15
-rw-r--r--negotiator/skipping.c48
-rw-r--r--notes-cache.c11
-rw-r--r--notes-merge.c25
-rw-r--r--notes-utils.c14
-rw-r--r--notes.c54
-rw-r--r--notes.h19
-rw-r--r--object-file-convert.c277
-rw-r--r--object-file-convert.h24
-rw-r--r--object-file.c714
-rw-r--r--object-file.h131
-rw-r--r--object-name.c140
-rw-r--r--object-name.h131
-rw-r--r--object-store-ll.h536
-rw-r--r--object-store.h533
-rw-r--r--object.c65
-rw-r--r--object.h96
-rw-r--r--oid-array.c14
-rw-r--r--oidmap.c5
-rw-r--r--oidmap.h2
-rw-r--r--oidset.c14
-rw-r--r--oidset.h6
-rw-r--r--oidtree.c2
-rw-r--r--oidtree.h2
-rw-r--r--oss-fuzz/.gitignore5
-rw-r--r--oss-fuzz/dummy-cmd-main.c14
-rw-r--r--oss-fuzz/fuzz-commit-graph.c28
-rw-r--r--oss-fuzz/fuzz-config.c33
-rw-r--r--oss-fuzz/fuzz-date.c49
-rw-r--r--oss-fuzz/fuzz-pack-headers.c (renamed from fuzz-pack-headers.c)1
-rw-r--r--oss-fuzz/fuzz-pack-idx.c (renamed from fuzz-pack-idx.c)3
-rw-r--r--pack-bitmap-write.c154
-rw-r--r--pack-bitmap.c1116
-rw-r--r--pack-bitmap.h41
-rw-r--r--pack-check.c8
-rw-r--r--pack-mtimes.c5
-rw-r--r--pack-mtimes.h2
-rw-r--r--pack-objects.c19
-rw-r--r--pack-objects.h3
-rw-r--r--pack-revindex.c128
-rw-r--r--pack-revindex.h27
-rw-r--r--pack-write.c25
-rw-r--r--pack.h2
-rw-r--r--packfile.c115
-rw-r--r--packfile.h19
-rw-r--r--pager.c14
-rw-r--r--pager.h17
-rw-r--r--parallel-checkout.c7
-rw-r--r--parse-options-cb.c42
-rw-r--r--parse-options.c505
-rw-r--r--parse-options.h371
-rw-r--r--parse.c182
-rw-r--r--parse.h20
-rw-r--r--patch-ids.c17
-rw-r--r--patch-ids.h2
-rw-r--r--path.c61
-rw-r--r--path.h76
-rw-r--r--pathspec.c174
-rw-r--r--pathspec.h25
-rw-r--r--perl/FromCPAN/Error.pm2
-rw-r--r--perl/Git.pm38
-rw-r--r--perl/Git/I18N.pm2
-rw-r--r--perl/Git/LoadCPAN.pm2
-rw-r--r--perl/Git/LoadCPAN/Error.pm2
-rw-r--r--perl/Git/LoadCPAN/Mail/Address.pm2
-rw-r--r--perl/Git/Packet.pm2
-rw-r--r--perl/Git/SVN.pm2
-rw-r--r--pkt-line.c61
-rw-r--r--pkt-line.h18
-rw-r--r--po/README.md2
-rw-r--r--po/TEAMS12
-rw-r--r--po/bg.po4768
-rw-r--r--po/ca.po5381
-rw-r--r--po/de.po4415
-rw-r--r--po/es.po2589
-rw-r--r--po/fr.po4540
-rw-r--r--po/id.po7322
-rw-r--r--po/ru.po2853
-rw-r--r--po/sv.po6980
-rw-r--r--po/tr.po4586
-rw-r--r--po/uk.po22978
-rw-r--r--po/zh_CN.po5340
-rw-r--r--po/zh_TW.po6982
-rw-r--r--ppc/sha1.c72
-rw-r--r--ppc/sha1.h25
-rw-r--r--ppc/sha1ppc.S224
-rw-r--r--preload-index.c16
-rw-r--r--preload-index.h15
-rw-r--r--pretty.c358
-rw-r--r--pretty.h21
-rw-r--r--prio-queue.c2
-rw-r--r--progress.c10
-rw-r--r--promisor-remote.c36
-rw-r--r--promisor-remote.h26
-rw-r--r--prompt.c5
-rw-r--r--protocol-caps.c9
-rw-r--r--protocol.c4
-rw-r--r--protocol.h21
-rw-r--r--prune-packed.c5
-rw-r--r--quote.c4
-rw-r--r--quote.h2
-rw-r--r--range-diff.c51
-rw-r--r--reachable.c157
-rw-r--r--read-cache-ll.h489
-rw-r--r--read-cache.c654
-rw-r--r--read-cache.h45
-rw-r--r--rebase-interactive.c39
-rw-r--r--rebase.c3
-rw-r--r--ref-filter.c1182
-rw-r--r--ref-filter.h75
-rw-r--r--reflog-walk.c9
-rw-r--r--reflog-walk.h6
-rw-r--r--reflog.c50
-rw-r--r--refs.c660
-rw-r--r--refs.h180
-rw-r--r--refs/debug.c36
-rw-r--r--refs/files-backend.c416
-rw-r--r--refs/iterator.c77
-rw-r--r--refs/packed-backend.c287
-rw-r--r--refs/ref-cache.c9
-rw-r--r--refs/ref-cache.h3
-rw-r--r--refs/refs-internal.h53
-rw-r--r--refs/reftable-backend.c2242
-rw-r--r--refspec.c6
-rw-r--r--refspec.h2
-rw-r--r--reftable/basics.c22
-rw-r--r--reftable/basics.h24
-rw-r--r--reftable/basics_test.c55
-rw-r--r--reftable/block.c177
-rw-r--r--reftable/block.h6
-rw-r--r--reftable/block_test.c10
-rw-r--r--reftable/blocksource.c41
-rw-r--r--reftable/dump.c4
-rw-r--r--reftable/error.c5
-rw-r--r--reftable/generic.c1
-rw-r--r--reftable/iter.c8
-rw-r--r--reftable/iter.h12
-rw-r--r--reftable/merged.c222
-rw-r--r--reftable/merged.h11
-rw-r--r--reftable/merged_test.c86
-rw-r--r--reftable/pq.c39
-rw-r--r--reftable/pq.h18
-rw-r--r--reftable/pq_test.c43
-rw-r--r--reftable/publicbasics.c5
-rw-r--r--reftable/reader.c82
-rw-r--r--reftable/readwrite_test.c247
-rw-r--r--reftable/record.c358
-rw-r--r--reftable/record.h49
-rw-r--r--reftable/record_test.c80
-rw-r--r--reftable/refname.c57
-rw-r--r--reftable/refname_test.c3
-rw-r--r--reftable/reftable-error.h5
-rw-r--r--reftable/reftable-merged.h2
-rw-r--r--reftable/reftable-record.h18
-rw-r--r--reftable/reftable-writer.h4
-rw-r--r--reftable/stack.c892
-rw-r--r--reftable/stack.h11
-rw-r--r--reftable/stack_test.c293
-rw-r--r--reftable/system.h4
-rw-r--r--reftable/test_framework.c6
-rw-r--r--reftable/test_framework.h60
-rw-r--r--reftable/tree.c6
-rw-r--r--reftable/tree_test.c3
-rw-r--r--reftable/writer.c92
-rw-r--r--reftable/writer.h1
-rw-r--r--remote-curl.c131
-rw-r--r--remote.c128
-rw-r--r--remote.h23
-rw-r--r--replace-object.c37
-rw-r--r--replace-object.h24
-rw-r--r--repo-settings.c31
-rw-r--r--repository.c47
-rw-r--r--repository.h39
-rw-r--r--rerere.c27
-rw-r--r--rerere.h4
-rw-r--r--reset.c14
-rw-r--r--reset.h2
-rw-r--r--resolve-undo.c106
-rw-r--r--resolve-undo.h12
-rw-r--r--revision.c650
-rw-r--r--revision.h108
-rw-r--r--run-command.c349
-rw-r--r--run-command.h109
-rw-r--r--sane-ctype.h66
-rw-r--r--scalar.c (renamed from contrib/scalar/scalar.c)629
-rw-r--r--send-pack.c29
-rw-r--r--send-pack.h3
-rw-r--r--sequencer.c1659
-rw-r--r--sequencer.h49
-rw-r--r--serve.c36
-rw-r--r--server-info.c12
-rw-r--r--server-info.h7
-rw-r--r--setup.c770
-rw-r--r--setup.h215
-rw-r--r--sh-i18n--envsubst.c4
-rw-r--r--sha1/openssl.h49
-rw-r--r--sha1dc/sha1.c2
-rw-r--r--sha1dc_git.c4
-rw-r--r--sha1dc_git.h1
-rw-r--r--sha256/gcrypt.h13
-rw-r--r--sha256/nettle.h31
-rw-r--r--sha256/openssl.h49
-rw-r--r--shallow.c63
-rw-r--r--shallow.h2
-rw-r--r--shared.mak19
-rw-r--r--shell.c54
-rw-r--r--shortlog.h5
-rw-r--r--sideband.c14
-rw-r--r--sigchain.c2
-rw-r--r--sparse-index.c59
-rw-r--r--sparse-index.h2
-rw-r--r--split-index.c10
-rw-r--r--split-index.h2
-rw-r--r--statinfo.c130
-rw-r--r--statinfo.h97
-rw-r--r--strbuf.c279
-rw-r--r--strbuf.h201
-rw-r--r--streaming.c24
-rw-r--r--streaming.h4
-rw-r--r--string-list.c17
-rw-r--r--string-list.h19
-rw-r--r--strmap.c4
-rw-r--r--strvec.c2
-rw-r--r--strvec.h8
-rw-r--r--sub-process.c5
-rw-r--r--sub-process.h1
-rw-r--r--submodule-config.c205
-rw-r--r--submodule-config.h9
-rw-r--r--submodule.c196
-rw-r--r--submodule.h10
-rw-r--r--symlinks.c5
-rw-r--r--symlinks.h28
-rw-r--r--t/.gitattributes1
-rw-r--r--t/Makefile71
-rw-r--r--t/README161
-rwxr-xr-xt/aggregate-results.sh2
-rw-r--r--t/annotate-tests.sh35
-rwxr-xr-xt/chainlint.pl832
-rw-r--r--t/chainlint.sed399
-rw-r--r--t/chainlint/blank-line-before-esac.expect18
-rw-r--r--t/chainlint/blank-line-before-esac.test19
-rw-r--r--t/chainlint/blank-line.expect4
-rw-r--r--t/chainlint/block-comment.expect2
-rw-r--r--t/chainlint/block.expect15
-rw-r--r--t/chainlint/block.test15
-rw-r--r--t/chainlint/case-comment.expect3
-rw-r--r--t/chainlint/chain-break-background.expect9
-rw-r--r--t/chainlint/chain-break-background.test10
-rw-r--r--t/chainlint/chain-break-continue.expect12
-rw-r--r--t/chainlint/chain-break-continue.test13
-rw-r--r--t/chainlint/chain-break-false.expect9
-rw-r--r--t/chainlint/chain-break-false.test10
-rw-r--r--t/chainlint/chain-break-return-exit.expect19
-rw-r--r--t/chainlint/chain-break-return-exit.test23
-rw-r--r--t/chainlint/chain-break-status.expect9
-rw-r--r--t/chainlint/chain-break-status.test11
-rw-r--r--t/chainlint/chained-block.expect9
-rw-r--r--t/chainlint/chained-block.test11
-rw-r--r--t/chainlint/chained-subshell.expect10
-rw-r--r--t/chainlint/chained-subshell.test13
-rw-r--r--t/chainlint/close-subshell.expect3
-rw-r--r--t/chainlint/command-substitution-subsubshell.expect2
-rw-r--r--t/chainlint/command-substitution-subsubshell.test3
-rw-r--r--t/chainlint/comment.expect4
-rw-r--r--t/chainlint/complex-if-in-cuddled-loop.expect2
-rw-r--r--t/chainlint/double-here-doc.expect12
-rw-r--r--t/chainlint/double-here-doc.test12
-rw-r--r--t/chainlint/dqstring-line-splice.expect5
-rw-r--r--t/chainlint/dqstring-line-splice.test7
-rw-r--r--t/chainlint/dqstring-no-interpolate.expect12
-rw-r--r--t/chainlint/dqstring-no-interpolate.test15
-rw-r--r--t/chainlint/empty-here-doc.expect4
-rw-r--r--t/chainlint/empty-here-doc.test5
-rw-r--r--t/chainlint/exclamation.expect4
-rw-r--r--t/chainlint/exclamation.test8
-rw-r--r--t/chainlint/for-loop-abbreviated.expect5
-rw-r--r--t/chainlint/for-loop-abbreviated.test6
-rw-r--r--t/chainlint/for-loop.expect7
-rw-r--r--t/chainlint/function.expect11
-rw-r--r--t/chainlint/function.test13
-rw-r--r--t/chainlint/here-doc-close-subshell.expect4
-rw-r--r--t/chainlint/here-doc-indent-operator.expect11
-rw-r--r--t/chainlint/here-doc-indent-operator.test13
-rw-r--r--t/chainlint/here-doc-multi-line-command-subst.expect5
-rw-r--r--t/chainlint/here-doc-multi-line-string.expect5
-rw-r--r--t/chainlint/here-doc.expect24
-rw-r--r--t/chainlint/if-condition-split.expect7
-rw-r--r--t/chainlint/if-condition-split.test8
-rw-r--r--t/chainlint/if-in-loop.expect2
-rw-r--r--t/chainlint/if-in-loop.test2
-rw-r--r--t/chainlint/if-then-else.expect4
-rw-r--r--t/chainlint/incomplete-line.expect10
-rw-r--r--t/chainlint/inline-comment.expect4
-rw-r--r--t/chainlint/loop-detect-failure.expect15
-rw-r--r--t/chainlint/loop-detect-failure.test17
-rw-r--r--t/chainlint/loop-detect-status.expect18
-rw-r--r--t/chainlint/loop-detect-status.test19
-rw-r--r--t/chainlint/loop-in-if.expect2
-rw-r--r--t/chainlint/loop-upstream-pipe.expect10
-rw-r--r--t/chainlint/loop-upstream-pipe.test11
-rw-r--r--t/chainlint/multi-line-string.expect11
-rw-r--r--t/chainlint/nested-cuddled-subshell.expect6
-rw-r--r--t/chainlint/nested-here-doc.expect27
-rw-r--r--t/chainlint/nested-loop-detect-failure.expect31
-rw-r--r--t/chainlint/nested-loop-detect-failure.test35
-rw-r--r--t/chainlint/nested-subshell-comment.expect2
-rw-r--r--t/chainlint/nested-subshell.expect3
-rw-r--r--t/chainlint/one-liner-for-loop.expect9
-rw-r--r--t/chainlint/one-liner-for-loop.test10
-rw-r--r--t/chainlint/pipe.expect2
-rw-r--r--t/chainlint/return-loop.expect5
-rw-r--r--t/chainlint/return-loop.test6
-rw-r--r--t/chainlint/semicolon.expect2
-rw-r--r--t/chainlint/sqstring-in-sqstring.expect4
-rw-r--r--t/chainlint/sqstring-in-sqstring.test5
-rw-r--r--t/chainlint/subshell-here-doc.expect28
-rw-r--r--t/chainlint/subshell-one-liner.expect5
-rw-r--r--t/chainlint/t7900-subtree.expect18
-rw-r--r--t/chainlint/token-pasting.expect27
-rw-r--r--t/chainlint/token-pasting.test32
-rw-r--r--t/chainlint/unclosed-here-doc-indent.expect4
-rw-r--r--t/chainlint/unclosed-here-doc-indent.test4
-rw-r--r--t/chainlint/unclosed-here-doc.expect7
-rw-r--r--t/chainlint/unclosed-here-doc.test7
-rw-r--r--t/chainlint/while-loop.expect7
-rwxr-xr-xt/check-non-portable-shell.pl3
-rw-r--r--t/helper/test-advise.c2
-rw-r--r--t/helper/test-bitmap.c3
-rw-r--r--t/helper/test-bloom.c9
-rw-r--r--t/helper/test-bundle-uri.c135
-rw-r--r--t/helper/test-cache-tree.c69
-rw-r--r--t/helper/test-chmtime.c2
-rw-r--r--t/helper/test-config.c67
-rw-r--r--t/helper/test-crontab.c24
-rw-r--r--t/helper/test-ctype.c43
-rw-r--r--t/helper/test-date.c10
-rw-r--r--t/helper/test-delete-gpgsig.c62
-rw-r--r--t/helper/test-delta.c22
-rw-r--r--t/helper/test-dir-iterator.c6
-rw-r--r--t/helper/test-drop-caches.c2
-rw-r--r--t/helper/test-dump-cache-tree.c19
-rw-r--r--t/helper/test-dump-fsmonitor.c6
-rw-r--r--t/helper/test-dump-split-index.c10
-rw-r--r--t/helper/test-dump-untracked-cache.c11
-rw-r--r--t/helper/test-env-helper.c (renamed from builtin/env--helper.c)28
-rw-r--r--t/helper/test-example-decorate.c7
-rw-r--r--t/helper/test-fake-ssh.c8
-rw-r--r--t/helper/test-fast-rebase.c234
-rw-r--r--t/helper/test-find-pack.c50
-rw-r--r--t/helper/test-fsmonitor-client.c6
-rw-r--r--t/helper/test-genzeros.c11
-rw-r--r--t/helper/test-hash-speed.c2
-rw-r--r--t/helper/test-hash.c3
-rw-r--r--t/helper/test-hashmap.c22
-rw-r--r--t/helper/test-hexdump.c2
-rw-r--r--t/helper/test-index-version.c15
-rw-r--r--t/helper/test-json-writer.c93
-rw-r--r--t/helper/test-lazy-init-name-hash.c28
-rw-r--r--t/helper/test-match-trees.c12
-rw-r--r--t/helper/test-mergesort.c77
-rw-r--r--t/helper/test-oid-array.c8
-rw-r--r--t/helper/test-oidmap.c33
-rw-r--r--t/helper/test-oidtree.c8
-rw-r--r--t/helper/test-online-cpus.c2
-rw-r--r--t/helper/test-pack-mtimes.c5
-rw-r--r--t/helper/test-parse-options.c148
-rw-r--r--t/helper/test-parse-pathspec-file.c4
-rw-r--r--t/helper/test-partial-clone.c5
-rw-r--r--t/helper/test-path-utils.c21
-rw-r--r--t/helper/test-pcre2-config.c1
-rw-r--r--t/helper/test-pkt-line.c63
-rw-r--r--t/helper/test-prio-queue.c52
-rw-r--r--t/helper/test-proc-receive.c7
-rw-r--r--t/helper/test-progress.c1
-rw-r--r--t/helper/test-reach.c24
-rw-r--r--t/helper/test-read-cache.c9
-rw-r--r--t/helper/test-read-graph.c6
-rw-r--r--t/helper/test-read-midx.c47
-rw-r--r--t/helper/test-ref-store.c73
-rw-r--r--t/helper/test-reftable.c1
-rw-r--r--t/helper/test-regex.c11
-rw-r--r--t/helper/test-repository.c6
-rw-r--r--t/helper/test-revision-walking.c6
-rw-r--r--t/helper/test-rot13-filter.c382
-rw-r--r--t/helper/test-run-command.c94
-rw-r--r--t/helper/test-scrap-cache-tree.c14
-rw-r--r--t/helper/test-serve-v2.c5
-rw-r--r--t/helper/test-sha1.c10
-rw-r--r--t/helper/test-sha256.c2
-rw-r--r--t/helper/test-sigchain.c3
-rw-r--r--t/helper/test-simple-ipc.c7
-rw-r--r--t/helper/test-strcmp-offset.c4
-rw-r--r--t/helper/test-string-list.c6
-rw-r--r--t/helper/test-submodule-config.c20
-rw-r--r--t/helper/test-submodule-nested-repo-config.c2
-rw-r--r--t/helper/test-submodule.c242
-rw-r--r--t/helper/test-subprocess.c2
-rw-r--r--t/helper/test-tool-utils.h9
-rw-r--r--t/helper/test-tool.c21
-rw-r--r--t/helper/test-tool.h16
-rw-r--r--t/helper/test-trace2.c261
-rw-r--r--t/helper/test-truncate.c25
-rw-r--r--t/helper/test-urlmatch-normalization.c11
-rw-r--r--t/helper/test-userdiff.c6
-rw-r--r--t/helper/test-wildmatch.c2
-rw-r--r--t/helper/test-write-cache.c10
-rw-r--r--t/helper/test-xml-encode.c2
-rw-r--r--t/interop/interop-lib.sh2
-rw-r--r--t/lib-bitmap.sh2
-rw-r--r--t/lib-bundle-uri-protocol.sh216
-rw-r--r--t/lib-chunk.sh17
-rw-r--r--t/lib-chunk/corrupt-chunk-file.pl90
-rwxr-xr-xt/lib-commit-graph.sh34
-rw-r--r--t/lib-credential.sh240
-rw-r--r--t/lib-cvs.sh4
-rw-r--r--t/lib-diff-alternative.sh59
-rw-r--r--t/lib-gpg.sh27
-rw-r--r--t/lib-httpd.sh87
-rw-r--r--t/lib-httpd/apache.conf77
-rw-r--r--t/lib-httpd/apply-one-time-perl.sh2
-rw-r--r--t/lib-httpd/nph-custom-auth.sh39
-rw-r--r--t/lib-httpd/passwd2
-rw-r--r--t/lib-httpd/proxy-passwd1
-rw-r--r--t/lib-httpd/ssl.cnf2
-rw-r--r--t/lib-parallel-checkout.sh2
-rw-r--r--t/lib-patch-mode.sh11
-rw-r--r--t/lib-perl.sh19
-rw-r--r--t/lib-rebase.sh46
-rw-r--r--t/lib-submodule-update.sh38
-rw-r--r--t/oid-info/hash-info12
-rw-r--r--t/perf/README4
-rw-r--r--t/perf/lib-bitmap.sh31
-rwxr-xr-xt/perf/p0004-lazy-init-name-hash.sh2
-rwxr-xr-xt/perf/p0006-read-tree-checkout.sh10
-rwxr-xr-xt/perf/p0071-sort.sh4
-rwxr-xr-xt/perf/p0090-cache-tree.sh36
-rwxr-xr-xt/perf/p1500-graph-walks.sh50
-rwxr-xr-xt/perf/p2000-sparse-operations.sh12
-rwxr-xr-xt/perf/p5310-pack-bitmaps.sh78
-rwxr-xr-xt/perf/p5311-pack-bitmaps-fetch.sh74
-rwxr-xr-xt/perf/p5312-pack-bitmaps-revs.sh34
-rwxr-xr-xt/perf/p5326-multi-pack-bitmaps.sh103
-rwxr-xr-xt/perf/p5332-multi-pack-reuse.sh81
-rwxr-xr-xt/perf/p6300-for-each-ref.sh87
-rwxr-xr-xt/perf/p7102-reset.sh21
-rwxr-xr-xt/perf/p7527-builtin-fsmonitor.sh2
-rwxr-xr-xt/perf/p7822-grep-perl-character.sh42
-rwxr-xr-xt/perf/p9210-scalar.sh39
-rw-r--r--t/perf/perf-lib.sh17
-rwxr-xr-xt/perf/repos/inflate-repo.sh2
-rwxr-xr-xt/perf/run16
-rwxr-xr-xt/t0000-basic.sh81
-rwxr-xr-xt/t0001-init.sh95
-rwxr-xr-xt/t0002-gitfile.sh12
-rwxr-xr-xt/t0003-attributes.sh273
-rwxr-xr-xt/t0004-unwritable.sh2
-rwxr-xr-xt/t0006-date.sh17
-rwxr-xr-xt/t0007-git-var.sh209
-rwxr-xr-xt/t0008-ignores.sh16
-rwxr-xr-xt/t0009-prio-queue.sh66
-rwxr-xr-xt/t0010-racy-git.sh31
-rwxr-xr-xt/t0011-hashmap.sh2
-rwxr-xr-xt/t0012-help.sh30
-rwxr-xr-xt/t0013-sha1dc.sh8
-rwxr-xr-xt/t0014-alias.sh8
-rwxr-xr-xt/t0015-hash.sh3
-rwxr-xr-xt/t0017-env-helper.sh62
-rwxr-xr-xt/t0018-advice.sh1
-rwxr-xr-xt/t0019-json-writer.sh2
-rwxr-xr-xt/t0020-crlf.sh38
-rwxr-xr-xt/t0021-conversion.sh81
-rw-r--r--t/t0021/rot13-filter.pl247
-rwxr-xr-xt/t0023-crlf-am.sh1
-rwxr-xr-xt/t0024-crlf-archive.sh13
-rwxr-xr-xt/t0027-auto-crlf.sh74
-rwxr-xr-xt/t0028-working-tree-encoding.sh39
-rwxr-xr-xt/t0030-stripspace.sh575
-rwxr-xr-xt/t0032-reftable-unittest.sh1
-rwxr-xr-xt/t0033-safe-directory.sh34
-rwxr-xr-xt/t0035-safe-bare-repository.sh107
-rwxr-xr-xt/t0040-parse-options.sh359
-rwxr-xr-xt/t0041-usage.sh33
-rwxr-xr-xt/t0050-filesystem.sh1
-rwxr-xr-xt/t0055-beyond-symlinks.sh14
-rwxr-xr-xt/t0060-path-utils.sh109
-rwxr-xr-xt/t0061-run-command.sh21
-rwxr-xr-xt/t0063-string-list.sh51
-rwxr-xr-xt/t0066-dir-iterator.sh23
-rwxr-xr-xt/t0068-for-each-repo.sh26
-rwxr-xr-xt/t0070-fundamental.sh67
-rwxr-xr-xt/t0071-sort.sh2
-rwxr-xr-xt/t0080-unit-test-output.sh59
-rwxr-xr-xt/t0081-find-pack.sh82
-rwxr-xr-xt/t0090-cache-tree.sh2
-rwxr-xr-xt/t0091-bugreport.sh124
-rwxr-xr-xt/t0092-diagnose.sh72
-rwxr-xr-xt/t0095-bloom.sh4
-rwxr-xr-xt/t0100-previous.sh8
-rwxr-xr-xt/t0110-urlmatch-normalization.sh2
-rwxr-xr-xt/t0202-gettext-perl.sh22
-rwxr-xr-xt/t0202/test.pl2
-rwxr-xr-xt/t0203-gettext-setlocale-sanity.sh1
-rwxr-xr-xt/t0204-gettext-reencode-sanity.sh2
-rwxr-xr-xt/t0210-trace2-normal.sh20
-rwxr-xr-xt/t0211-trace2-perf.sh347
-rw-r--r--t/t0211/scrub_perf.perl6
-rwxr-xr-xt/t0212-trace2-event.sh40
-rw-r--r--t/t0212/parse_events.perl19
-rwxr-xr-xt/t0300-credentials.sh116
-rwxr-xr-xt/t0301-credential-cache.sh10
-rwxr-xr-xt/t0303-credential-external.sh28
-rwxr-xr-xt/t0410-partial-clone.sh33
-rwxr-xr-xt/t0450-txt-doc-vs-help.sh174
-rw-r--r--t/t0450/txt-help-mismatches58
-rwxr-xr-xt/t0600-reffiles-backend.sh475
-rwxr-xr-xt/t0601-reffiles-pack-refs.sh383
-rwxr-xr-xt/t0610-reftable-basics.sh1032
-rwxr-xr-xt/t0611-reftable-httpd.sh26
-rwxr-xr-xt/t1001-read-tree-m-2way.sh4
-rwxr-xr-xt/t1002-read-tree-m-u-2way.sh589
-rwxr-xr-xt/t1005-read-tree-reset.sh15
-rwxr-xr-xt/t1006-cat-file.sh591
-rwxr-xr-xt/t1007-hash-object.sh35
-rwxr-xr-xt/t1010-mktree.sh4
-rwxr-xr-xt/t1011-read-tree-sparse-checkout.sh3
-rwxr-xr-xt/t1016-compatObjectFormat.sh281
-rwxr-xr-xt/t1016/gpg2
-rwxr-xr-xt/t1020-subdirectory.sh1
-rwxr-xr-xt/t1022-read-tree-partial-clone.sh4
-rwxr-xr-xt/t1050-large.sh6
-rwxr-xr-xt/t1051-large-conversion.sh2
-rwxr-xr-xt/t1060-object-corruption.sh9
-rwxr-xr-xt/t1090-sparse-checkout-scope.sh5
-rwxr-xr-xt/t1091-sparse-checkout-builtin.sh237
-rwxr-xr-xt/t1092-sparse-checkout-compatibility.sh527
-rwxr-xr-xt/t1300-config.sh364
-rwxr-xr-xt/t1301-shared-repo.sh49
-rwxr-xr-xt/t1302-repo-version.sh26
-rwxr-xr-xt/t1304-default-acl.sh5
-rwxr-xr-xt/t1307-config-blob.sh2
-rwxr-xr-xt/t1308-config-set.sh127
-rwxr-xr-xt/t1309-early-config.sh2
-rwxr-xr-xt/t1310-config-default.sh4
-rwxr-xr-xt/t1400-update-ref.sh196
-rwxr-xr-xt/t1401-symbolic-ref.sh66
-rwxr-xr-xt/t1402-check-ref-format.sh1
-rwxr-xr-xt/t1403-show-ref.sh90
-rwxr-xr-xt/t1404-update-ref-errors.sh279
-rwxr-xr-xt/t1405-main-ref-store.sh25
-rwxr-xr-xt/t1406-submodule-ref-store.sh8
-rwxr-xr-xt/t1407-worktree-ref-store.sh38
-rwxr-xr-xt/t1408-packed-refs.sh1
-rwxr-xr-xt/t1409-avoid-packing-refs.sh7
-rwxr-xr-xt/t1410-reflog.sh184
-rwxr-xr-xt/t1413-reflog-detach.sh1
-rwxr-xr-xt/t1414-reflog-walk.sh11
-rwxr-xr-xt/t1415-worktree-refs.sh11
-rwxr-xr-xt/t1416-ref-transaction-hooks.sh3
-rwxr-xr-xt/t1417-reflog-updateref.sh10
-rwxr-xr-xt/t1418-reflog-exists.sh1
-rwxr-xr-xt/t1419-exclude-refs.sh128
-rwxr-xr-xt/t1430-bad-ref-name.sh61
-rwxr-xr-xt/t1450-fsck.sh283
-rwxr-xr-xt/t1451-fsck-buffer.sh142
-rwxr-xr-xt/t1500-rev-parse.sh46
-rwxr-xr-xt/t1501-work-tree.sh2
-rwxr-xr-xt/t1502-rev-parse-parseopt.sh153
-rw-r--r--t/t1502/.gitattributes1
-rw-r--r--t/t1502/optionspec-neg8
-rw-r--r--t/t1502/optionspec-neg.help12
-rwxr-xr-xt/t1502/optionspec.help36
-rwxr-xr-xt/t1503-rev-parse-verify.sh7
-rwxr-xr-xt/t1504-ceiling-dirs.sh8
-rwxr-xr-xt/t1506-rev-parse-diagnosis.sh34
-rwxr-xr-xt/t1507-rev-parse-upstream.sh15
-rwxr-xr-xt/t1508-at-combinations.sh1
-rwxr-xr-xt/t1509-root-work-tree.sh10
-rwxr-xr-xt/t1509/prepare-chroot.sh2
-rwxr-xr-xt/t1512-rev-parse-disambiguation.sh6
-rwxr-xr-xt/t1514-rev-parse-push.sh1
-rwxr-xr-xt/t1600-index.sh33
-rwxr-xr-xt/t1700-split-index.sh2
-rwxr-xr-xt/t1701-racy-split-index.sh1
-rwxr-xr-xt/t1800-hook.sh36
-rwxr-xr-xt/t2004-checkout-cache-temp.sh22
-rwxr-xr-xt/t2005-checkout-index-symlinks.sh8
-rwxr-xr-xt/t2006-checkout-index-basic.sh15
-rwxr-xr-xt/t2010-checkout-ambiguous.sh4
-rwxr-xr-xt/t2011-checkout-invalid-head.sh9
-rwxr-xr-xt/t2012-checkout-last.sh1
-rwxr-xr-xt/t2015-checkout-unborn.sh11
-rwxr-xr-xt/t2016-checkout-patch.sh52
-rwxr-xr-xt/t2017-checkout-orphan.sh2
-rwxr-xr-xt/t2018-checkout-branch.sh9
-rwxr-xr-xt/t2019-checkout-ambiguous-ref.sh12
-rwxr-xr-xt/t2020-checkout-detach.sh26
-rwxr-xr-xt/t2021-checkout-overwrite.sh16
-rwxr-xr-xt/t2023-checkout-m.sh1
-rwxr-xr-xt/t2024-checkout-dwim.sh17
-rwxr-xr-xt/t2025-checkout-no-overlay.sh3
-rwxr-xr-xt/t2026-checkout-pathspec-file.sh8
-rwxr-xr-xt/t2027-checkout-track.sh3
-rwxr-xr-xt/t2030-unresolve-info.sh47
-rwxr-xr-xt/t2060-switch.sh31
-rwxr-xr-xt/t2070-restore.sh84
-rwxr-xr-xt/t2071-restore-patch.sh47
-rwxr-xr-xt/t2072-restore-pathspec-file.sh9
-rwxr-xr-xt/t2080-parallel-checkout-basics.sh10
-rwxr-xr-xt/t2082-parallel-checkout-attributes.sh7
-rwxr-xr-xt/t2104-update-index-skip-worktree.sh36
-rwxr-xr-xt/t2106-update-index-assume-unchanged.sh2
-rwxr-xr-xt/t2107-update-index-basic.sh37
-rwxr-xr-xt/t2200-add-update.sh21
-rwxr-xr-xt/t2203-add-intent.sh6
-rwxr-xr-xt/t2204-add-ignored.sh8
-rwxr-xr-xt/t2205-add-worktree-config.sh1
-rwxr-xr-xt/t2400-worktree-add.sh544
-rwxr-xr-xt/t2401-worktree-prune.sh11
-rwxr-xr-xt/t2402-worktree-list.sh7
-rwxr-xr-xt/t2403-worktree-move.sh10
-rwxr-xr-xt/t2405-worktree-submodule.sh1
-rwxr-xr-xt/t2406-worktree-repair.sh25
-rwxr-xr-xt/t2407-worktree-heads.sh180
-rwxr-xr-xt/t3001-ls-files-others-exclude.sh4
-rwxr-xr-xt/t3004-ls-files-basic.sh4
-rwxr-xr-xt/t3007-ls-files-recurse-submodules.sh37
-rwxr-xr-xt/t3009-ls-files-others-nonsubmodule.sh1
-rwxr-xr-xt/t3010-ls-files-killed-modified.sh2
-rwxr-xr-xt/t3012-ls-files-dedup.sh1
-rwxr-xr-xt/t3013-ls-files-format.sh146
-rwxr-xr-xt/t3050-subprojects-fetch.sh1
-rwxr-xr-xt/t3060-ls-files-with-tree.sh6
-rwxr-xr-xt/t3070-wildmatch.sh16
-rwxr-xr-xt/t3101-ls-tree-dirname.sh8
-rwxr-xr-xt/t3104-ls-tree-format.sh7
-rwxr-xr-xt/t3200-branch.sh421
-rwxr-xr-xt/t3202-show-branch.sh136
-rwxr-xr-xt/t3203-branch-output.sh54
-rwxr-xr-xt/t3204-branch-name-interpretation.sh35
-rwxr-xr-xt/t3206-range-diff.sh97
-rwxr-xr-xt/t3207-branch-submodule.sh1
-rwxr-xr-xt/t3210-pack-refs.sh259
-rwxr-xr-xt/t3301-notes.sh178
-rwxr-xr-xt/t3304-notes-mixed.sh1
-rwxr-xr-xt/t3305-notes-fanout.sh4
-rwxr-xr-xt/t3307-notes-man.sh1
-rwxr-xr-xt/t3309-notes-merge-auto-resolve.sh7
-rwxr-xr-xt/t3310-notes-merge-manual-resolve.sh22
-rwxr-xr-xt/t3320-notes-merge-worktrees.sh4
-rwxr-xr-xt/t3321-notes-stripspace.sh578
-rwxr-xr-xt/t3400-rebase.sh30
-rwxr-xr-xt/t3402-rebase-merge.sh24
-rwxr-xr-xt/t3403-rebase-skip.sh30
-rwxr-xr-xt/t3404-rebase-interactive.sh546
-rwxr-xr-xt/t3405-rebase-malformed.sh1
-rwxr-xr-xt/t3406-rebase-message.sh203
-rwxr-xr-xt/t3407-rebase-abort.sh17
-rwxr-xr-xt/t3409-rebase-environ.sh1
-rwxr-xr-xt/t3412-rebase-root.sh1
-rwxr-xr-xt/t3413-rebase-hook.sh1
-rwxr-xr-xt/t3415-rebase-autosquash.sh51
-rwxr-xr-xt/t3416-rebase-onto-threedots.sh63
-rwxr-xr-xt/t3418-rebase-continue.sh140
-rwxr-xr-xt/t3419-rebase-patch-id.sh64
-rwxr-xr-xt/t3420-rebase-autostash.sh12
-rwxr-xr-xt/t3422-rebase-incompatible-options.sh76
-rwxr-xr-xt/t3423-rebase-reword.sh1
-rwxr-xr-xt/t3424-rebase-empty.sh55
-rwxr-xr-xt/t3425-rebase-topology-merges.sh2
-rwxr-xr-xt/t3426-rebase-submodule.sh4
-rwxr-xr-xt/t3427-rebase-subtree.sh12
-rwxr-xr-xt/t3428-rebase-signoff.sh68
-rwxr-xr-xt/t3429-rebase-edit-todo.sh1
-rwxr-xr-xt/t3430-rebase-merges.sh110
-rwxr-xr-xt/t3431-rebase-fork-point.sh5
-rwxr-xr-xt/t3432-rebase-fast-forward.sh1
-rwxr-xr-xt/t3433-rebase-across-mode-change.sh1
-rwxr-xr-xt/t3435-rebase-gpg-sign.sh8
-rwxr-xr-xt/t3437-rebase-fixup-options.sh42
-rwxr-xr-xt/t3438-rebase-broken-files.sh70
-rwxr-xr-xt/t3500-cherry.sh69
-rwxr-xr-xt/t3501-revert-cherry-pick.sh63
-rwxr-xr-xt/t3502-cherry-pick-merge.sh1
-rwxr-xr-xt/t3503-cherry-pick-root.sh1
-rwxr-xr-xt/t3505-cherry-pick-empty.sh51
-rwxr-xr-xt/t3506-cherry-pick-ff.sh1
-rwxr-xr-xt/t3507-cherry-pick-conflict.sh12
-rwxr-xr-xt/t3510-cherry-pick-sequence.sh38
-rwxr-xr-xt/t3511-cherry-pick-x.sh1
-rwxr-xr-xt/t3512-cherry-pick-submodule.sh2
-rwxr-xr-xt/t3600-rm.sh11
-rwxr-xr-xt/t3601-rm-pathspec-file.sh6
-rwxr-xr-xt/t3650-replay-basics.sh198
-rwxr-xr-xt/t3700-add.sh107
-rwxr-xr-xt/t3701-add-interactive.sh170
-rwxr-xr-xt/t3702-add-edit.sh2
-rwxr-xr-xt/t3704-add-pathspec-file.sh12
-rwxr-xr-xt/t3800-mktag.sh1
-rwxr-xr-xt/t3900-i18n-commit.sh8
-rwxr-xr-xt/t3901-i18n-patch.sh2
-rwxr-xr-xt/t3903-stash.sh106
-rwxr-xr-xt/t3904-stash-patch.sh6
-rwxr-xr-xt/t3905-stash-include-untracked.sh2
-rwxr-xr-xt/t3906-stash-submodule.sh2
-rwxr-xr-xt/t3909-stash-pathspec-file.sh6
-rwxr-xr-xt/t3920-crlf-messages.sh8
-rwxr-xr-xt/t4000-diff-format.sh34
-rwxr-xr-xt/t4001-diff-rename.sh58
-rwxr-xr-xt/t4002-diff-basic.sh243
-rwxr-xr-xt/t4003-diff-rename-1.sh62
-rwxr-xr-xt/t4004-diff-rename-symlink.sh42
-rwxr-xr-xt/t4011-diff-symlink.sh4
-rwxr-xr-xt/t4012-diff-binary.sh14
-rwxr-xr-xt/t4013-diff-various.sh124
-rw-r--r--t/t4013/diff.log_--decorate=full_--all2
-rw-r--r--t/t4013/diff.log_--decorate=full_--clear-decorations_--all61
-rw-r--r--t/t4013/diff.log_--decorate=full_--decorate-all_--all61
-rw-r--r--t/t4013/diff.log_--decorate_--all2
-rw-r--r--t/t4013/diff.log_--decorate_--clear-decorations_--all61
-rw-r--r--t/t4013/diff.log_--decorate_--decorate-all_--all61
-rwxr-xr-xt/t4014-format-patch.sh214
-rwxr-xr-xt/t4015-diff-whitespace.sh63
-rwxr-xr-xt/t4017-diff-retval.sh6
-rwxr-xr-xt/t4018-diff-funcname.sh29
-rw-r--r--t/t4018/csharp-exclude-assignments20
-rw-r--r--t/t4018/csharp-exclude-control-statements34
-rw-r--r--t/t4018/csharp-exclude-exceptions29
-rw-r--r--t/t4018/csharp-exclude-generic-method-calls12
-rw-r--r--t/t4018/csharp-exclude-init-dispose22
-rw-r--r--t/t4018/csharp-exclude-iterations26
-rw-r--r--t/t4018/csharp-exclude-method-calls20
-rw-r--r--t/t4018/csharp-exclude-other18
-rw-r--r--t/t4018/csharp-method10
-rw-r--r--t/t4018/csharp-method-array10
-rw-r--r--t/t4018/csharp-method-explicit12
-rw-r--r--t/t4018/csharp-method-generics11
-rw-r--r--t/t4018/csharp-method-generics-alternate-spaces11
-rw-r--r--t/t4018/csharp-method-modifiers13
-rw-r--r--t/t4018/csharp-method-multiline10
-rw-r--r--t/t4018/csharp-method-params10
-rw-r--r--t/t4018/csharp-method-special-chars11
-rw-r--r--t/t4018/csharp-method-with-spacing10
-rw-r--r--t/t4018/csharp-property11
-rw-r--r--t/t4018/csharp-property-braces-same-line10
-rw-r--r--t/t4018/java-class-brace-on-separate-line6
-rw-r--r--t/t4018/java-class-space-before-type-parameters6
-rw-r--r--t/t4018/java-class-type-parameters6
-rw-r--r--t/t4018/java-class-type-parameters-implements6
-rw-r--r--t/t4018/java-interface-type-parameters6
-rw-r--r--t/t4018/java-interface-type-parameters-extends6
-rw-r--r--t/t4018/java-non-sealed8
-rw-r--r--t/t4018/java-record6
-rw-r--r--t/t4018/java-record-space-before-components6
-rw-r--r--t/t4018/java-record-type-parameters6
-rw-r--r--t/t4018/java-sealed7
-rw-r--r--t/t4018/java-sealed-permits6
-rw-r--r--t/t4018/java-sealed-type-parameters6
-rw-r--r--t/t4018/java-sealed-type-parameters-implements-permits6
-rw-r--r--t/t4018/java-sealed-type-parameters-permits6
-rwxr-xr-xt/t4020-diff-external.sh6
-rwxr-xr-xt/t4022-diff-rewrite.sh2
-rwxr-xr-xt/t4023-diff-rename-typechange.sh12
-rwxr-xr-xt/t4031-diff-rewrite-binary.sh2
-rwxr-xr-xt/t4034-diff-words.sh4
-rwxr-xr-xt/t4038-diff-combined.sh10
-rwxr-xr-xt/t4040-whitespace-status.sh3
-rwxr-xr-xt/t4042-diff-textconv-caching.sh22
-rwxr-xr-xt/t4044-diff-index-unique-abbrev.sh6
-rwxr-xr-xt/t4045-diff-relative.sh31
-rwxr-xr-xt/t4046-diff-unmerged.sh10
-rwxr-xr-xt/t4047-diff-dirstat.sh24
-rwxr-xr-xt/t4051-diff-function-context.sh1
-rwxr-xr-xt/t4052-stat-output.sh98
-rwxr-xr-xt/t4053-diff-no-index.sh94
-rwxr-xr-xt/t4054-diff-bogus-tree.sh2
-rwxr-xr-xt/t4055-diff-context.sh4
-rwxr-xr-xt/t4057-diff-combined-paths.sh1
-rwxr-xr-xt/t4058-diff-duplicates.sh2
-rwxr-xr-xt/t4059-diff-submodule-not-initialized.sh2
-rwxr-xr-xt/t4060-diff-submodule-option-diff-format.sh2
-rwxr-xr-xt/t4062-diff-pickaxe.sh2
-rwxr-xr-xt/t4067-diff-partial-clone.sh6
-rwxr-xr-xt/t4068-diff-symmetric-merge-base.sh37
-rwxr-xr-xt/t4069-remerge-diff.sh29
-rwxr-xr-xt/t4111-apply-subdir.sh1
-rwxr-xr-xt/t4114-apply-typechange.sh1
-rwxr-xr-xt/t4115-apply-symlink.sh96
-rwxr-xr-xt/t4120-apply-popt.sh4
-rwxr-xr-xt/t4122-apply-symlink-inside.sh14
-rwxr-xr-xt/t4126-apply-empty.sh24
-rwxr-xr-xt/t4129-apply-samemode.sh37
-rwxr-xr-xt/t4133-apply-filenames.sh8
-rwxr-xr-xt/t4135-apply-weird-filenames.sh1
-rwxr-xr-xt/t4140-apply-ita.sh1
-rwxr-xr-xt/t4141-apply-too-large.sh23
-rwxr-xr-xt/t4150-am.sh54
-rwxr-xr-xt/t4151-am-abort.sh2
-rwxr-xr-xt/t4152-am-subjects.sh2
-rwxr-xr-xt/t4153-am-resume-override-opts.sh2
-rwxr-xr-xt/t4200-rerere.sh4
-rwxr-xr-xt/t4201-shortlog.sh73
-rwxr-xr-xt/t4202-log.sh208
-rwxr-xr-xt/t4203-mailmap.sh130
-rwxr-xr-xt/t4204-patch-id.sh95
-rwxr-xr-xt/t4205-log-pretty-formats.sh220
-rwxr-xr-xt/t4206-log-follow-harder-copies.sh36
-rwxr-xr-xt/t4207-log-decoration-colors.sh102
-rwxr-xr-xt/t4208-log-magic-pathspec.sh7
-rwxr-xr-xt/t4209-log-pickaxe.sh4
-rwxr-xr-xt/t4210-log-i18n.sh4
-rwxr-xr-xt/t4211-line-log.sh26
-rwxr-xr-xt/t4212-log-corrupt.sh57
-rwxr-xr-xt/t4213-log-tabexpand.sh1
-rwxr-xr-xt/t4214-log-graph-octopus.sh1
-rwxr-xr-xt/t4215-log-skewed-merges.sh1
-rwxr-xr-xt/t4216-log-bloom.sh50
-rwxr-xr-xt/t4217-log-limit.sh1
-rwxr-xr-xt/t4254-am-corrupt.sh4
-rwxr-xr-xt/t4256-am-format-flowed.sh3
-rwxr-xr-xt/t4257-am-interactive.sh2
-rw-r--r--t/t4258/mbox2
-rwxr-xr-xt/t4300-merge-tree.sh45
-rwxr-xr-xt/t4301-merge-tree-write-tree.sh993
-rwxr-xr-xt/t5000-tar-tree.sh101
-rwxr-xr-xt/t5001-archive-attr.sh24
-rwxr-xr-xt/t5002-archive-attr-pattern.sh5
-rwxr-xr-xt/t5003-archive-zip.sh39
-rwxr-xr-xt/t5004-archive-corner-cases.sh2
-rwxr-xr-xt/t5100-mailinfo.sh28
-rw-r--r--t/t5100/comment.expect2
-rw-r--r--t/t5100/comment.in2
-rw-r--r--t/t5100/msg00022
-rw-r--r--t/t5100/msg00032
-rw-r--r--t/t5100/msg0012--message-id2
-rw-r--r--t/t5100/quoted-cr.mbox4
-rw-r--r--t/t5100/sample.mbox6
-rwxr-xr-xt/t5300-pack-object.sh364
-rwxr-xr-xt/t5301-sliding-window.sh100
-rwxr-xr-xt/t5302-pack-index.sh8
-rwxr-xr-xt/t5303-pack-corruption-resilience.sh586
-rwxr-xr-xt/t5304-prune.sh82
-rwxr-xr-xt/t5306-pack-nobase.sh96
-rwxr-xr-xt/t5308-pack-detect-duplicates.sh2
-rwxr-xr-xt/t5309-pack-delta-cycles.sh2
-rwxr-xr-xt/t5310-pack-bitmaps.sh836
-rwxr-xr-xt/t5311-pack-bitmaps-shallow.sh55
-rwxr-xr-xt/t5312-prune-corruption.sh27
-rwxr-xr-xt/t5313-pack-bounds-checks.sh2
-rwxr-xr-xt/t5314-pack-cycle-detection.sh21
-rwxr-xr-xt/t5315-pack-objects-compression.sh1
-rwxr-xr-xt/t5317-pack-objects-filter-objects.sh101
-rwxr-xr-xt/t5318-commit-graph.sh563
-rwxr-xr-xt/t5319-multi-pack-index.sh297
-rwxr-xr-xt/t5320-delta-islands.sh2
-rwxr-xr-xt/t5321-pack-large-objects.sh2
-rwxr-xr-xt/t5324-split-commit-graph.sh108
-rwxr-xr-xt/t5325-reverse-index.sh90
-rwxr-xr-xt/t5326-multi-pack-bitmaps.sh540
-rwxr-xr-xt/t5327-multi-pack-bitmaps-rev.sh24
-rwxr-xr-xt/t5328-commit-graph-64bit-time.sh65
-rwxr-xr-xt/t5329-pack-objects-cruft.sh234
-rwxr-xr-xt/t5330-no-lazy-fetch-with-commit-graph.sh1
-rwxr-xr-xt/t5331-pack-objects-stdin.sh240
-rwxr-xr-xt/t5332-multi-pack-reuse.sh207
-rwxr-xr-xt/t5351-unpack-large-objects.sh103
-rwxr-xr-xt/t5401-update-hooks.sh8
-rwxr-xr-xt/t5402-post-merge-hook.sh1
-rwxr-xr-xt/t5403-post-checkout-hook.sh1
-rwxr-xr-xt/t5404-tracking-branches.sh1
-rwxr-xr-xt/t5405-send-pack-rewind.sh1
-rwxr-xr-xt/t5406-remote-rejects.sh1
-rwxr-xr-xt/t5407-post-rewrite-hook.sh48
-rw-r--r--t/t5411/test-0026-push-options.sh2
-rw-r--r--t/t5411/test-0027-push-options--porcelain.sh2
-rwxr-xr-xt/t5500-fetch-pack.sh52
-rwxr-xr-xt/t5502-quickfetch.sh1
-rwxr-xr-xt/t5503-tagfollow.sh1
-rwxr-xr-xt/t5504-fetch-receive-strict.sh46
-rwxr-xr-xt/t5505-remote.sh105
-rwxr-xr-xt/t5506-remote-groups.sh9
-rwxr-xr-xt/t5507-remote-environment.sh2
-rwxr-xr-xt/t5510-fetch.sh123
-rwxr-xr-xt/t5512-ls-remote.sh158
-rwxr-xr-xt/t5514-fetch-multiple.sh177
-rwxr-xr-xt/t5516-fetch-push.sh107
-rwxr-xr-xt/t5517-push-mirror.sh1
-rwxr-xr-xt/t5520-pull.sh51
-rwxr-xr-xt/t5521-pull-options.sh7
-rwxr-xr-xt/t5522-pull-symlink.sh5
-rwxr-xr-xt/t5523-push-upstream.sh25
-rwxr-xr-xt/t5524-pull-msg.sh1
-rwxr-xr-xt/t5525-fetch-tagopt.sh1
-rwxr-xr-xt/t5526-fetch-submodules.sh45
-rwxr-xr-xt/t5527-fetch-odd-refs.sh1
-rwxr-xr-xt/t5528-push-default.sh2
-rwxr-xr-xt/t5529-push-errors.sh2
-rwxr-xr-xt/t5530-upload-pack-error.sh5
-rwxr-xr-xt/t5531-deep-submodule-push.sh52
-rwxr-xr-xt/t5534-push-signed.sh8
-rwxr-xr-xt/t5536-fetch-conflicts.sh8
-rwxr-xr-xt/t5537-fetch-shallow.sh5
-rwxr-xr-xt/t5541-http-push-smart.sh114
-rwxr-xr-xt/t5543-atomic-push.sh5
-rwxr-xr-xt/t5544-pack-objects-hook.sh9
-rwxr-xr-xt/t5545-push-options.sh3
-rwxr-xr-xt/t5546-receive-limits.sh37
-rwxr-xr-xt/t5547-push-quarantine.sh2
-rwxr-xr-xt/t5550-http-fetch-dumb.sh19
-rwxr-xr-xt/t5551-http-fetch-smart.sh311
-rwxr-xr-xt/t5552-skipping-fetch-negotiator.sh16
-rwxr-xr-xt/t5554-noop-fetch-negotiator.sh2
-rwxr-xr-xt/t5555-http-smart-common.sh1
-rwxr-xr-xt/t5557-http-get.sh39
-rwxr-xr-xt/t5558-clone-bundle-uri.sh1076
-rwxr-xr-xt/t5559-http-fetch-smart-http2.sh5
-rwxr-xr-xt/t5560-http-backend-noserver.sh1
-rwxr-xr-xt/t5561-http-backend.sh1
-rwxr-xr-xt/t5562-http-backend-content-length.sh2
-rw-r--r--t/t5562/invoke-with-content-length.pl2
-rwxr-xr-xt/t5563-simple-http-auth.sh329
-rwxr-xr-xt/t5564-http-proxy.sh41
-rwxr-xr-xt/t5570-git-daemon.sh10
-rwxr-xr-xt/t5571-pre-push-hook.sh1
-rwxr-xr-xt/t5572-pull-submodule.sh10
-rwxr-xr-xt/t5573-pull-verify-signatures.sh28
-rwxr-xr-xt/t5574-fetch-output.sh304
-rwxr-xr-xt/t5580-unc-paths.sh2
-rwxr-xr-xt/t5583-push-branches.sh116
-rwxr-xr-xt/t5601-clone.sh170
-rwxr-xr-xt/t5604-clone-reference.sh67
-rwxr-xr-xt/t5605-clone-local.sh18
-rwxr-xr-xt/t5606-clone-options.sh38
-rwxr-xr-xt/t5607-clone-bundle.sh4
-rwxr-xr-xt/t5610-clone-detached.sh1
-rwxr-xr-xt/t5611-clone-config.sh5
-rwxr-xr-xt/t5613-info-alternate.sh2
-rwxr-xr-xt/t5614-clone-submodules-shallow.sh9
-rwxr-xr-xt/t5616-partial-clone.sh84
-rwxr-xr-xt/t5617-clone-submodules-remote.sh2
-rwxr-xr-xt/t5618-alternate-refs.sh2
-rwxr-xr-xt/t5619-clone-local-ambiguous-transport.sh70
-rwxr-xr-xt/t5700-protocol-v1.sh31
-rwxr-xr-xt/t5701-git-serve.sh72
-rwxr-xr-xt/t5702-protocol-v2.sh119
-rwxr-xr-xt/t5703-upload-pack-ref-in-want.sh10
-rwxr-xr-xt/t5704-protocol-violations.sh4
-rwxr-xr-xt/t5705-session-id-in-capabilities.sh1
-rwxr-xr-xt/t5730-protocol-v2-bundle-uri-file.sh17
-rwxr-xr-xt/t5731-protocol-v2-bundle-uri-git.sh17
-rwxr-xr-xt/t5732-protocol-v2-bundle-uri-http.sh17
-rwxr-xr-xt/t5750-bundle-uri-parse.sh290
-rwxr-xr-xt/t5801-remote-helpers.sh8
-rwxr-xr-xt/t5801/git-remote-testgit9
-rwxr-xr-xt/t5810-proto-disable-local.sh2
-rwxr-xr-xt/t5811-proto-disable-git.sh2
-rwxr-xr-xt/t5812-proto-disable-http.sh2
-rwxr-xr-xt/t5813-proto-disable-ssh.sh2
-rwxr-xr-xt/t6000-rev-list-misc.sh13
-rwxr-xr-xt/t6001-rev-list-graft.sh5
-rwxr-xr-xt/t6003-rev-list-topo-order.sh23
-rwxr-xr-xt/t6005-rev-list-count.sh18
-rwxr-xr-xt/t6006-rev-list-format.sh2
-rwxr-xr-xt/t6008-rev-list-submodule.sh3
-rwxr-xr-xt/t6009-rev-list-parent.sh12
-rwxr-xr-xt/t6011-rev-list-with-bad-commit.sh1
-rwxr-xr-xt/t6014-rev-list-all.sh1
-rwxr-xr-xt/t6017-rev-list-stdin.sh72
-rwxr-xr-xt/t6018-rev-list-glob.sh38
-rwxr-xr-xt/t6019-rev-list-ancestry-path.sh101
-rwxr-xr-xt/t6020-bundle-misc.sh92
-rwxr-xr-xt/t6021-rev-list-exclude-hidden.sh164
-rwxr-xr-xt/t6022-rev-list-missing.sh149
-rwxr-xr-xt/t6030-bisect-porcelain.sh236
-rwxr-xr-xt/t6040-tracking-info.sh19
-rwxr-xr-xt/t6050-replace.sh306
-rwxr-xr-xt/t6060-merge-index.sh2
-rwxr-xr-xt/t6101-rev-parse-parents.sh2
-rwxr-xr-xt/t6102-rev-list-unexpected-objects.sh22
-rwxr-xr-xt/t6112-rev-list-filters-objects.sh4
-rwxr-xr-xt/t6113-rev-list-bitmap-filters.sh16
-rwxr-xr-xt/t6115-rev-list-du.sh29
-rwxr-xr-xt/t6120-describe.sh16
-rwxr-xr-xt/t6134-pathspec-in-submodule.sh5
-rwxr-xr-xt/t6135-pathspec-with-attrs.sh189
-rwxr-xr-xt/t6136-pathspec-in-bare.sh8
-rwxr-xr-xt/t6300-for-each-ref.sh721
-rwxr-xr-xt/t6301-for-each-ref-errors.sh28
-rwxr-xr-xt/t6302-for-each-ref-filter.sh33
-rwxr-xr-xt/t6400-merge-df.sh2
-rwxr-xr-xt/t6401-merge-criss-cross.sh2
-rwxr-xr-xt/t6402-merge-rename.sh18
-rwxr-xr-xt/t6403-merge-file.sh184
-rwxr-xr-xt/t6404-recursive-merge.sh1
-rwxr-xr-xt/t6405-merge-symlinks.sh1
-rwxr-xr-xt/t6406-merge-attr.sh43
-rwxr-xr-xt/t6408-merge-up-to-date.sh1
-rwxr-xr-xt/t6411-merge-filemode.sh1
-rwxr-xr-xt/t6413-merge-crlf.sh5
-rwxr-xr-xt/t6415-merge-dir-to-symlink.sh1
-rwxr-xr-xt/t6416-recursive-corner-cases.sh39
-rwxr-xr-xt/t6417-merge-ours-theirs.sh1
-rwxr-xr-xt/t6418-merge-text-auto.sh1
-rwxr-xr-xt/t6421-merge-partial-clone.sh6
-rwxr-xr-xt/t6422-merge-rename-corner-cases.sh57
-rwxr-xr-xt/t6423-merge-rename-directories.sh334
-rwxr-xr-xt/t6424-merge-unrelated-index-changes.sh71
-rwxr-xr-xt/t6425-merge-rename-delete.sh5
-rwxr-xr-xt/t6426-merge-skip-unneeded-updates.sh76
-rwxr-xr-xt/t6427-diff3-conflict-markers.sh10
-rwxr-xr-xt/t6428-merge-conflicts-sparse.sh2
-rwxr-xr-xt/t6429-merge-sequence-rename-caching.sh61
-rwxr-xr-xt/t6430-merge-recursive.sh8
-rwxr-xr-xt/t6431-merge-criscross.sh1
-rwxr-xr-xt/t6433-merge-toplevel.sh5
-rwxr-xr-xt/t6435-merge-sparse.sh3
-rwxr-xr-xt/t6436-merge-overwrite.sh4
-rwxr-xr-xt/t6437-submodule-merge.sh91
-rwxr-xr-xt/t6439-merge-co-error-msgs.sh2
-rwxr-xr-xt/t6500-gc.sh196
-rwxr-xr-xt/t6501-freshen-objects.sh13
-rwxr-xr-xt/t6600-test-reach.sh169
-rwxr-xr-xt/t6700-tree-depth.sh95
-rwxr-xr-xt/t7001-mv.sh112
-rwxr-xr-xt/t7002-mv-sparse-checkout.sh310
-rwxr-xr-xt/t7003-filter-branch.sh9
-rwxr-xr-xt/t7004-tag.sh129
-rwxr-xr-xt/t7007-show.sh1
-rwxr-xr-xt/t7030-verify-tag.sh2
-rwxr-xr-xt/t7031-verify-tag-signed-ssh.sh12
-rwxr-xr-xt/t7060-wtstatus.sh1
-rwxr-xr-xt/t7062-wtstatus-ignorecase.sh1
-rwxr-xr-xt/t7063-status-untracked-cache.sh3
-rwxr-xr-xt/t7064-wtstatus-pv2.sh1
-rwxr-xr-xt/t7101-reset-empty-subdirs.sh48
-rwxr-xr-xt/t7102-reset.sh18
-rwxr-xr-xt/t7103-reset-bare.sh2
-rwxr-xr-xt/t7105-reset-patch.sh44
-rwxr-xr-xt/t7106-reset-unborn-branch.sh6
-rwxr-xr-xt/t7107-reset-pathspec-file.sh11
-rwxr-xr-xt/t7110-reset-merge.sh315
-rwxr-xr-xt/t7111-reset-table.sh21
-rwxr-xr-xt/t7201-co.sh209
-rwxr-xr-xt/t7300-clean.sh37
-rwxr-xr-xt/t7301-clean-interactive.sh491
-rwxr-xr-xt/t7400-submodule-basic.sh153
-rwxr-xr-xt/t7401-submodule-summary.sh1
-rwxr-xr-xt/t7402-submodule-rebase.sh33
-rwxr-xr-xt/t7403-submodule-sync.sh7
-rwxr-xr-xt/t7406-submodule-update.sh96
-rwxr-xr-xt/t7407-submodule-foreach.sh6
-rwxr-xr-xt/t7408-submodule-reference.sh4
-rwxr-xr-xt/t7409-submodule-detached-work-tree.sh5
-rwxr-xr-xt/t7411-submodule-config.sh43
-rwxr-xr-xt/t7412-submodule-absorbgitdirs.sh65
-rwxr-xr-xt/t7413-submodule-is-active.sh53
-rwxr-xr-xt/t7414-submodule-mistakes.sh13
-rwxr-xr-xt/t7416-submodule-dash-url.sh10
-rwxr-xr-xt/t7417-submodule-path-url.sh8
-rwxr-xr-xt/t7418-submodule-sparse-gitmodules.sh11
-rwxr-xr-xt/t7419-submodule-set-branch.sh59
-rwxr-xr-xt/t7420-submodule-set-url.sh32
-rwxr-xr-xt/t7421-submodule-summary-add.sh4
-rwxr-xr-xt/t7422-submodule-output.sh170
-rwxr-xr-xt/t7450-bad-git-dotfiles.sh46
-rwxr-xr-xt/t7500-commit-template-squash-signoff.sh2
-rwxr-xr-xt/t7501-commit-basic-functionality.sh90
-rwxr-xr-xt/t7502-commit-porcelain.sh74
-rwxr-xr-xt/t7503-pre-commit-and-pre-merge-commit-hooks.sh1
-rwxr-xr-xt/t7504-commit-msg-hook.sh5
-rwxr-xr-xt/t7506-status-submodule.sh31
-rwxr-xr-xt/t7507-commit-verbose.sh17
-rwxr-xr-xt/t7508-status.sh199
-rwxr-xr-xt/t7509-commit-authorship.sh6
-rwxr-xr-xt/t7510-signed-commit.sh74
-rwxr-xr-xt/t7512-status-help.sh50
-rwxr-xr-xt/t7513-interpret-trailers.sh539
-rwxr-xr-xt/t7514-commit-patch.sh6
-rwxr-xr-xt/t7516-commit-races.sh5
-rwxr-xr-xt/t7517-per-repo-email.sh1
-rwxr-xr-xt/t7518-ident-corner-cases.sh21
-rwxr-xr-xt/t7519-status-fsmonitor.sh6
-rwxr-xr-xt/t7520-ignored-hook-warning.sh9
-rwxr-xr-xt/t7525-status-rename.sh54
-rwxr-xr-xt/t7526-commit-pathspec-file.sh14
-rwxr-xr-xt/t7527-builtin-fsmonitor.sh333
-rwxr-xr-xt/t7528-signed-commit-ssh.sh2
-rwxr-xr-xt/t7600-merge.sh81
-rwxr-xr-xt/t7601-merge-pull-config.sh74
-rwxr-xr-xt/t7602-merge-octopus-many.sh1
-rwxr-xr-xt/t7603-merge-reduce-heads.sh1
-rwxr-xr-xt/t7605-merge-resolve.sh1
-rwxr-xr-xt/t7607-merge-state.sh33
-rwxr-xr-xt/t7608-merge-messages.sh1
-rwxr-xr-xt/t7609-mergetool--lib.sh1
-rwxr-xr-xt/t7610-mergetool.sh42
-rwxr-xr-xt/t7611-merge-abort.sh4
-rwxr-xr-xt/t7612-merge-verify-signatures.sh25
-rwxr-xr-xt/t7614-merge-signoff.sh1
-rwxr-xr-xt/t7700-repack.sh350
-rwxr-xr-xt/t7701-repack-unpack-unreachable.sh47
-rwxr-xr-xt/t7703-repack-geometric.sh174
-rwxr-xr-xt/t7704-repack-cruft.sh414
-rwxr-xr-xt/t7800-difftool.sh158
-rwxr-xr-xt/t7810-grep.sh150
-rwxr-xr-xt/t7811-grep-open.sh2
-rwxr-xr-xt/t7812-grep-icase-non-ascii.sh1
-rwxr-xr-xt/t7814-grep-recurse-submodules.sh55
-rwxr-xr-xt/t7816-grep-binary-pattern.sh4
-rwxr-xr-xt/t7900-maintenance.sh191
-rwxr-xr-xt/t8001-annotate.sh1
-rwxr-xr-xt/t8002-blame.sh1
-rwxr-xr-xt/t8003-blame-corner-cases.sh4
-rwxr-xr-xt/t8007-cat-file-textconv.sh2
-rwxr-xr-xt/t8010-cat-file-filters.sh4
-rwxr-xr-xt/t8012-blame-colors.sh1
-rwxr-xr-xt/t8013-blame-ignore-revs.sh34
-rwxr-xr-xt/t9001-send-email.sh274
-rwxr-xr-xt/t9002-column.sh12
-rwxr-xr-xt/t9003-help-autocorrect.sh8
-rwxr-xr-xt/t9004-example.sh2
-rwxr-xr-xt/t9100-git-svn-basic.sh32
-rwxr-xr-xt/t9101-git-svn-props.sh1
-rwxr-xr-xt/t9104-git-svn-follow-parent.sh63
-rwxr-xr-xt/t9106-git-svn-commit-diff-clobber.sh1
-rwxr-xr-xt/t9114-git-svn-dcommit-merge.sh2
-rwxr-xr-xt/t9115-git-svn-dcommit-funky-renames.sh1
-rwxr-xr-xt/t9117-git-svn-init-clone.sh16
-rwxr-xr-xt/t9118-git-svn-funky-branch-names.sh2
-rwxr-xr-xt/t9119-git-svn-info.sh2
-rwxr-xr-xt/t9122-git-svn-author.sh1
-rwxr-xr-xt/t9132-git-svn-broken-symlink.sh1
-rwxr-xr-xt/t9133-git-svn-nested-git-repo.sh8
-rwxr-xr-xt/t9134-git-svn-ignore-paths.sh8
-rwxr-xr-xt/t9140-git-svn-reset.sh4
-rwxr-xr-xt/t9146-git-svn-empty-dirs.sh57
-rwxr-xr-xt/t9147-git-svn-include-paths.sh8
-rwxr-xr-xt/t9148-git-svn-propset.sh1
-rwxr-xr-xt/t9160-git-svn-preserve-empty-dirs.sh1
-rwxr-xr-xt/t9162-git-svn-dcommit-interactive.sh1
-rwxr-xr-xt/t9164-git-svn-dcommit-concurrent.sh10
-rwxr-xr-xt/t9200-git-cvsexportcommit.sh351
-rwxr-xr-xt/t9210-scalar.sh241
-rwxr-xr-xt/t9211-scalar-clone.sh195
-rwxr-xr-xt/t9300-fast-import.sh53
-rwxr-xr-xt/t9301-fast-import-notes.sh1
-rwxr-xr-xt/t9304-fast-import-marks.sh30
-rwxr-xr-xt/t9350-fast-export.sh18
-rwxr-xr-xt/t9351-fast-export-anonymize.sh2
-rwxr-xr-xt/t9400-git-cvsserver-server.sh527
-rwxr-xr-xt/t9500-gitweb-standalone-no-errors.sh5
-rwxr-xr-xt/t9700-perl-git.sh90
-rwxr-xr-xt/t9700/test.pl14
-rwxr-xr-xt/t9800-git-p4-basic.sh20
-rwxr-xr-xt/t9801-git-p4-branch.sh4
-rwxr-xr-xt/t9802-git-p4-filetype.sh2
-rwxr-xr-xt/t9807-git-p4-submit.sh14
-rwxr-xr-xt/t9814-git-p4-rename.sh2
-rwxr-xr-xt/t9815-git-p4-submit-fail.sh16
-rwxr-xr-xt/t9816-git-p4-locked.sh2
-rwxr-xr-xt/t9824-git-p4-git-lfs.sh4
-rwxr-xr-xt/t9850-shell.sh37
-rwxr-xr-xt/t9901-git-web--browse.sh1
-rwxr-xr-xt/t9902-completion.sh353
-rwxr-xr-xt/t9903-bash-prompt.sh24
-rw-r--r--t/test-lib-functions.sh403
-rw-r--r--t/test-lib-github-workflow-markup.sh6
-rw-r--r--t/test-lib-junit.sh2
-rw-r--r--t/test-lib.sh353
-rwxr-xr-xt/test-terminal.perl2
-rw-r--r--t/unit-tests/.gitignore1
-rw-r--r--t/unit-tests/t-basic.c95
-rw-r--r--t/unit-tests/t-ctype.c53
-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-strbuf.c120
-rw-r--r--t/unit-tests/test-lib.c407
-rw-r--r--t/unit-tests/test-lib.h149
-rwxr-xr-xt/valgrind/valgrind.sh2
-rw-r--r--tag.c16
-rw-r--r--tempfile.c63
-rw-r--r--tempfile.h7
-rwxr-xr-xtemplates/hooks--pre-commit.sample2
-rwxr-xr-xtemplates/hooks--sendemail-validate.sample77
-rw-r--r--thread-utils.c2
-rw-r--r--tmp-objdir.c49
-rw-r--r--tmp-objdir.h6
-rw-r--r--trace.c15
-rw-r--r--trace.h3
-rw-r--r--trace2.c267
-rw-r--r--trace2.h114
-rw-r--r--trace2/tr2_cfg.c21
-rw-r--r--trace2/tr2_cmd_name.c3
-rw-r--r--trace2/tr2_ctr.c115
-rw-r--r--trace2/tr2_ctr.h104
-rw-r--r--trace2/tr2_dst.c4
-rw-r--r--trace2/tr2_sid.c4
-rw-r--r--trace2/tr2_sysenv.c8
-rw-r--r--trace2/tr2_tbuf.c2
-rw-r--r--trace2/tr2_tgt.h20
-rw-r--r--trace2/tr2_tgt_event.c78
-rw-r--r--trace2/tr2_tgt_normal.c70
-rw-r--r--trace2/tr2_tgt_perf.c57
-rw-r--r--trace2/tr2_tls.c38
-rw-r--r--trace2/tr2_tls.h56
-rw-r--r--trace2/tr2_tmr.c182
-rw-r--r--trace2/tr2_tmr.h140
-rw-r--r--trailer.c318
-rw-r--r--trailer.h47
-rw-r--r--transport-helper.c65
-rw-r--r--transport-internal.h7
-rw-r--r--transport.c130
-rw-r--r--transport.h20
-rw-r--r--tree-diff.c42
-rw-r--r--tree-walk.c128
-rw-r--r--tree-walk.h20
-rw-r--r--tree.c97
-rw-r--r--tree.h12
-rw-r--r--unicode-width.h38
-rw-r--r--unix-socket.c3
-rw-r--r--unix-stream-server.c2
-rw-r--r--unpack-trees.c414
-rw-r--r--unpack-trees.h51
-rw-r--r--upload-pack.c353
-rw-r--r--url.c4
-rw-r--r--urlmatch.c18
-rw-r--r--urlmatch.h8
-rw-r--r--usage.c8
-rw-r--r--userdiff.c100
-rw-r--r--userdiff.h2
-rw-r--r--utf8.c79
-rw-r--r--utf8.h8
-rw-r--r--versioncmp.c26
-rw-r--r--versioncmp.h6
-rw-r--r--walker.c21
-rw-r--r--wildmatch.c25
-rw-r--r--wildmatch.h2
-rw-r--r--worktree.c203
-rw-r--r--worktree.h29
-rw-r--r--wrapper.c60
-rw-r--r--wrapper.h143
-rw-r--r--write-or-die.c31
-rw-r--r--write-or-die.h78
-rw-r--r--ws.c15
-rw-r--r--ws.h33
-rw-r--r--wt-status.c187
-rw-r--r--wt-status.h7
-rw-r--r--xdiff-interface.c51
-rw-r--r--xdiff-interface.h7
-rw-r--r--xdiff/xdiff.h1
-rw-r--r--xdiff/xdiffi.c8
-rw-r--r--xdiff/xdiffi.h6
-rw-r--r--xdiff/xemit.c4
-rw-r--r--xdiff/xhistogram.c22
-rw-r--r--xdiff/xmacros.h18
-rw-r--r--xdiff/xpatience.c32
-rw-r--r--xdiff/xprepare.c41
-rw-r--r--xdiff/xutils.c17
-rw-r--r--xdiff/xutils.h3
2090 files changed, 159932 insertions, 64701 deletions
diff --git a/.cirrus.yml b/.cirrus.yml
index 4860beb..77346a4 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,7 +1,7 @@
env:
CIRRUS_CLONE_DEPTH: 1
-freebsd_12_task:
+freebsd_task:
env:
GIT_PROVE_OPTS: "--timer --jobs 10"
GIT_TEST_OPTS: "--no-chain-lint --no-bin-wrappers"
@@ -9,7 +9,7 @@ freebsd_12_task:
DEFAULT_TEST_TARGET: prove
DEVELOPER: 1
freebsd_instance:
- image_family: freebsd-12-3
+ image_family: freebsd-13-2
memory: 2G
install_script:
pkg install -y gettext gmake perl5
@@ -19,4 +19,4 @@ freebsd_12_task:
build_script:
- su git -c gmake
test_script:
- - su git -c 'gmake test'
+ - su git -c 'gmake DEFAULT_UNIT_TEST_TARGET=unit-tests-prove test unit-tests'
diff --git a/.clang-format b/.clang-format
index c592dda..3ed4fac 100644
--- a/.clang-format
+++ b/.clang-format
@@ -83,9 +83,9 @@ BinPackParameters: true
BreakBeforeBraces: Linux
# Break after operators
-# int valuve = aaaaaaaaaaaaa +
-# bbbbbb -
-# ccccccccccc;
+# int value = aaaaaaaaaaaaa +
+# bbbbbb -
+# ccccccccccc;
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: false
diff --git a/.editorconfig b/.editorconfig
index f9d8196..15d6cbe 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -4,7 +4,7 @@ insert_final_newline = true
# The settings for C (*.c and *.h) files are mirrored in .clang-format. Keep
# them in sync.
-[*.{c,h,sh,perl,pl,pm,txt}]
+[{*.{c,h,sh,perl,pl,pm,txt},config.mak.*,Makefile}]
indent_style = tab
tab_width = 8
diff --git a/.gitattributes b/.gitattributes
index b0044cf..158c3d4 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,17 +1,17 @@
* whitespace=!indent,trail,space
*.[ch] whitespace=indent,trail,space diff=cpp
-*.sh whitespace=indent,trail,space eol=lf
-*.perl eol=lf diff=perl
-*.pl eof=lf diff=perl
-*.pm eol=lf diff=perl
-*.py eol=lf diff=python
-*.bat eol=crlf
+*.sh whitespace=indent,trail,space text eol=lf
+*.perl text eol=lf diff=perl
+*.pl text eof=lf diff=perl
+*.pm text eol=lf diff=perl
+*.py text eol=lf diff=python
+*.bat text eol=crlf
CODE_OF_CONDUCT.md -whitespace
-/Documentation/**/*.txt eol=lf
-/command-list.txt eol=lf
-/GIT-VERSION-GEN eol=lf
-/mergetools/* eol=lf
-/t/oid-info/* eol=lf
+/Documentation/**/*.txt text eol=lf
+/command-list.txt text eol=lf
+/GIT-VERSION-GEN text eol=lf
+/mergetools/* text eol=lf
+/t/oid-info/* text eol=lf
/Documentation/git-merge.txt conflict-marker-size=32
/Documentation/gitk.txt conflict-marker-size=32
/Documentation/user-manual.txt conflict-marker-size=32
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 952c7c3..37654cd 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -4,4 +4,7 @@ a mailing list (git@vger.kernel.org) for code submissions, code reviews, and
bug reports. Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/)
to conveniently send your Pull Requests commits to our mailing list.
+For a single-commit pull request, please *leave the pull request description
+empty*: your commit message itself should describe your changes.
+
Please read the "guidelines for contributing" linked above!
diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml
index ad3466a..a241a63 100644
--- a/.github/workflows/check-whitespace.yml
+++ b/.github/workflows/check-whitespace.yml
@@ -9,42 +9,83 @@ on:
pull_request:
types: [opened, synchronize]
+# Avoid unnecessary builds. Unlike the main CI jobs, these are not
+# ci-configurable (but could be).
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
jobs:
check-whitespace:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
with:
fetch-depth: 0
- name: git log --check
id: check_out
run: |
- log=
+ baseSha=${{github.event.pull_request.base.sha}}
+ problems=()
commit=
- while read dash etc
+ commitText=
+ commitTextmd=
+ goodparent=
+ while read dash sha etc
do
case "${dash}" in
"---")
- commit="${etc}"
+ if test -z "${commit}"
+ then
+ goodparent=${sha}
+ fi
+ commit="${sha}"
+ commitText="${sha} ${etc}"
+ commitTextmd="[${sha}](https://github.com/${{ github.repository }}/commit/${sha}) ${etc}"
;;
"")
;;
*)
if test -n "${commit}"
then
- log="${log}\n${commit}"
+ problems+=("1) --- ${commitTextmd}")
echo ""
- echo "--- ${commit}"
+ echo "--- ${commitText}"
+ commit=
fi
- commit=
- log="${log}\n${dash} ${etc}"
- echo "${dash} ${etc}"
+ case "${dash}" in
+ *:[1-9]*:) # contains file and line number information
+ dashend=${dash#*:}
+ problems+=("[${dash}](https://github.com/${{ github.repository }}/blob/${{github.event.pull_request.head.ref}}/${dash%%:*}#L${dashend%:}) ${sha} ${etc}")
+ ;;
+ *)
+ problems+=("\`${dash} ${sha} ${etc}\`")
+ ;;
+ esac
+ echo "${dash} ${sha} ${etc}"
;;
esac
- done <<< $(git log --check --pretty=format:"---% h% s" ${{github.event.pull_request.base.sha}}..)
+ done <<< $(git log --check --pretty=format:"---% h% s" ${baseSha}..)
- if test -n "${log}"
+ if test ${#problems[*]} -gt 0
then
+ if test -z "${commit}"
+ then
+ goodparent=${baseSha: 0:7}
+ fi
+ echo "🛑 Please review the Summary output for further information."
+ echo "### :x: A whitespace issue was found in one or more of the commits." >$GITHUB_STEP_SUMMARY
+ echo "" >>$GITHUB_STEP_SUMMARY
+ echo "Run these commands to correct the problem:" >>$GITHUB_STEP_SUMMARY
+ echo "1. \`git rebase --whitespace=fix ${goodparent}\`" >>$GITHUB_STEP_SUMMARY
+ echo "1. \`git push --force\`" >>$GITHUB_STEP_SUMMARY
+ echo " " >>$GITHUB_STEP_SUMMARY
+ echo "Errors:" >>$GITHUB_STEP_SUMMARY
+ for i in "${problems[@]}"
+ do
+ echo "${i}" >>$GITHUB_STEP_SUMMARY
+ done
+
exit 2
fi
diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
new file mode 100644
index 0000000..53cf12f
--- /dev/null
+++ b/.github/workflows/coverity.yml
@@ -0,0 +1,163 @@
+name: Coverity
+
+# This GitHub workflow automates submitting builds to Coverity Scan. To enable it,
+# set the repository variable `ENABLE_COVERITY_SCAN_FOR_BRANCHES` (for details, see
+# https://docs.github.com/en/actions/learn-github-actions/variables) to a JSON
+# string array containing the names of the branches for which the workflow should be
+# run, e.g. `["main", "next"]`.
+#
+# In addition, two repository secrets must be set (for details how to add secrets, see
+# https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions):
+# `COVERITY_SCAN_EMAIL` and `COVERITY_SCAN_TOKEN`. The former specifies the
+# email to which the Coverity reports should be sent and the latter can be
+# obtained from the Project Settings tab of the Coverity project).
+#
+# The workflow runs on `ubuntu-latest` by default. This can be overridden by setting
+# the repository variable `ENABLE_COVERITY_SCAN_ON_OS` to a JSON string array specifying
+# the operating systems, e.g. `["ubuntu-latest", "windows-latest"]`.
+#
+# By default, the builds are submitted to the Coverity project `git`. To override this,
+# set the repository variable `COVERITY_PROJECT`.
+
+on:
+ push:
+
+defaults:
+ run:
+ shell: bash
+
+jobs:
+ coverity:
+ if: contains(fromJSON(vars.ENABLE_COVERITY_SCAN_FOR_BRANCHES || '[""]'), github.ref_name)
+ strategy:
+ matrix:
+ os: ${{ fromJSON(vars.ENABLE_COVERITY_SCAN_ON_OS || '["ubuntu-latest"]') }}
+ runs-on: ${{ matrix.os }}
+ env:
+ COVERITY_PROJECT: ${{ vars.COVERITY_PROJECT || 'git' }}
+ COVERITY_LANGUAGE: cxx
+ COVERITY_PLATFORM: overridden-below
+ steps:
+ - uses: actions/checkout@v4
+ - name: install minimal Git for Windows SDK
+ if: contains(matrix.os, 'windows')
+ uses: git-for-windows/setup-git-for-windows-sdk@v1
+ - run: ci/install-dependencies.sh
+ if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')
+ env:
+ runs_on_pool: ${{ matrix.os }}
+
+ # The Coverity site says the tool is usually updated twice yearly, so the
+ # MD5 of download can be used to determine whether there's been an update.
+ - name: get the Coverity Build Tool hash
+ id: lookup
+ run: |
+ case "${{ matrix.os }}" in
+ *windows*)
+ COVERITY_PLATFORM=win64
+ COVERITY_TOOL_FILENAME=cov-analysis.zip
+ MAKEFLAGS=-j$(nproc)
+ ;;
+ *macos*)
+ COVERITY_PLATFORM=macOSX
+ COVERITY_TOOL_FILENAME=cov-analysis.dmg
+ MAKEFLAGS=-j$(sysctl -n hw.physicalcpu)
+ ;;
+ *ubuntu*)
+ COVERITY_PLATFORM=linux64
+ COVERITY_TOOL_FILENAME=cov-analysis.tgz
+ MAKEFLAGS=-j$(nproc)
+ ;;
+ *)
+ echo '::error::unhandled OS ${{ matrix.os }}' >&2
+ exit 1
+ ;;
+ esac
+ echo "COVERITY_PLATFORM=$COVERITY_PLATFORM" >>$GITHUB_ENV
+ echo "COVERITY_TOOL_FILENAME=$COVERITY_TOOL_FILENAME" >>$GITHUB_ENV
+ echo "MAKEFLAGS=$MAKEFLAGS" >>$GITHUB_ENV
+ MD5=$(curl https://scan.coverity.com/download/$COVERITY_LANGUAGE/$COVERITY_PLATFORM \
+ --fail \
+ --form token='${{ secrets.COVERITY_SCAN_TOKEN }}' \
+ --form project="$COVERITY_PROJECT" \
+ --form md5=1)
+ case $? in
+ 0) ;; # okay
+ 22) # 40x, i.e. access denied
+ echo "::error::incorrect token or project?" >&2
+ exit 1
+ ;;
+ *) # other error
+ echo "::error::Failed to retrieve MD5" >&2
+ exit 1
+ ;;
+ esac
+ echo "hash=$MD5" >>$GITHUB_OUTPUT
+
+ # Try to cache the tool to avoid downloading 1GB+ on every run.
+ # A cache miss will add ~30s to create, but a cache hit will save minutes.
+ - name: restore the Coverity Build Tool
+ id: cache
+ uses: actions/cache/restore@v4
+ with:
+ path: ${{ runner.temp }}/cov-analysis
+ key: cov-build-${{ env.COVERITY_LANGUAGE }}-${{ env.COVERITY_PLATFORM }}-${{ steps.lookup.outputs.hash }}
+ - name: download the Coverity Build Tool (${{ env.COVERITY_LANGUAGE }} / ${{ env.COVERITY_PLATFORM}})
+ if: steps.cache.outputs.cache-hit != 'true'
+ run: |
+ curl https://scan.coverity.com/download/$COVERITY_LANGUAGE/$COVERITY_PLATFORM \
+ --fail --no-progress-meter \
+ --output $RUNNER_TEMP/$COVERITY_TOOL_FILENAME \
+ --form token='${{ secrets.COVERITY_SCAN_TOKEN }}' \
+ --form project="$COVERITY_PROJECT"
+ - name: extract the Coverity Build Tool
+ if: steps.cache.outputs.cache-hit != 'true'
+ run: |
+ case "$COVERITY_TOOL_FILENAME" in
+ *.tgz)
+ mkdir $RUNNER_TEMP/cov-analysis &&
+ tar -xzf $RUNNER_TEMP/$COVERITY_TOOL_FILENAME --strip 1 -C $RUNNER_TEMP/cov-analysis
+ ;;
+ *.dmg)
+ cd $RUNNER_TEMP &&
+ attach="$(hdiutil attach $COVERITY_TOOL_FILENAME)" &&
+ volume="$(echo "$attach" | cut -f 3 | grep /Volumes/)" &&
+ mkdir cov-analysis &&
+ cd cov-analysis &&
+ sh "$volume"/cov-analysis-macosx-*.sh &&
+ ls -l &&
+ hdiutil detach "$volume"
+ ;;
+ *.zip)
+ cd $RUNNER_TEMP &&
+ mkdir cov-analysis-tmp &&
+ unzip -d cov-analysis-tmp $COVERITY_TOOL_FILENAME &&
+ mv cov-analysis-tmp/* cov-analysis
+ ;;
+ *)
+ echo "::error::unhandled archive type: $COVERITY_TOOL_FILENAME" >&2
+ exit 1
+ ;;
+ esac
+ - name: cache the Coverity Build Tool
+ if: steps.cache.outputs.cache-hit != 'true'
+ uses: actions/cache/save@v4
+ with:
+ path: ${{ runner.temp }}/cov-analysis
+ key: cov-build-${{ env.COVERITY_LANGUAGE }}-${{ env.COVERITY_PLATFORM }}-${{ steps.lookup.outputs.hash }}
+ - name: build with cov-build
+ run: |
+ export PATH="$RUNNER_TEMP/cov-analysis/bin:$PATH" &&
+ cov-configure --gcc &&
+ cov-build --dir cov-int make
+ - name: package the build
+ run: tar -czvf cov-int.tgz cov-int
+ - name: submit the build to Coverity Scan
+ run: |
+ curl \
+ --fail \
+ --form token='${{ secrets.COVERITY_SCAN_TOKEN }}' \
+ --form email='${{ secrets.COVERITY_SCAN_EMAIL }}' \
+ --form file=@cov-int.tgz \
+ --form version='${{ github.sha }}' \
+ "https://scan.coverity.com/builds?project=$COVERITY_PROJECT"
diff --git a/.github/workflows/l10n.yml b/.github/workflows/l10n.yml
index 27f72f0..e2c3dbd 100644
--- a/.github/workflows/l10n.yml
+++ b/.github/workflows/l10n.yml
@@ -2,6 +2,12 @@ name: git-l10n
on: [push, pull_request_target]
+# Avoid unnecessary builds. Unlike the main CI jobs, these are not
+# ci-configurable (but could be).
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
jobs:
git-po-helper:
if: >-
@@ -23,8 +29,8 @@ jobs:
base=${{ github.event.before }}
head=${{ github.event.after }}
fi
- echo "::set-output name=base::$base"
- echo "::set-output name=head::$head"
+ echo base=$base >>$GITHUB_OUTPUT
+ echo head=$head >>$GITHUB_OUTPUT
- name: Run partial clone
run: |
git -c init.defaultBranch=master init --bare .
@@ -57,9 +63,10 @@ jobs:
origin \
${{ github.ref }} \
$args
- - uses: actions/setup-go@v2
+ - uses: actions/setup-go@v5
with:
go-version: '>=1.16'
+ cache: false
- name: Install git-po-helper
run: go install github.com/git-l10n/git-po-helper@main
- name: Install other dependencies
@@ -85,14 +92,13 @@ jobs:
cat git-po-helper.out
exit $exit_code
- name: Create comment in pull request for report
- uses: mshick/add-pr-comment@v1
+ uses: mshick/add-pr-comment@v2
if: >-
always() &&
github.event_name == 'pull_request_target' &&
env.COMMENT_BODY != ''
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- repo-token-user-login: 'github-actions[bot]'
message: >
${{ steps.check-commits.outcome == 'failure' && 'Errors and warnings' || 'Warnings' }}
found by [git-po-helper](https://github.com/git-l10n/git-po-helper#readme) in workflow
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index cd1f526..3428773 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -5,12 +5,27 @@ on: [push, pull_request]
env:
DEVELOPER: 1
+# If more than one workflow run is triggered for the very same commit hash
+# (which happens when multiple branches pointing to the same commit), only
+# the first one is allowed to run, the second will be kept in the "queued"
+# state. This allows a successful completion of the first run to be reused
+# in the second run via the `skip-if-redundant` logic in the `config` job.
+#
+# The only caveat is that if a workflow run is triggered for the same commit
+# hash that another run is already being held, that latter run will be
+# canceled. For more details about the `concurrency` attribute, see:
+# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
+concurrency:
+ group: ${{ github.sha }}
+
jobs:
ci-config:
name: config
+ if: vars.CI_BRANCHES == '' || contains(vars.CI_BRANCHES, github.ref_name)
runs-on: ubuntu-latest
outputs:
enabled: ${{ steps.check-ref.outputs.enabled }}${{ steps.skip-if-redundant.outputs.enabled }}
+ skip_concurrent: ${{ steps.check-ref.outputs.skip_concurrent }}
steps:
- name: try to clone ci-config branch
run: |
@@ -29,22 +44,33 @@ jobs:
name: check whether CI is enabled for ref
run: |
enabled=yes
- if test -x config-repo/ci/config/allow-ref &&
- ! config-repo/ci/config/allow-ref '${{ github.ref }}'
+ if test -x config-repo/ci/config/allow-ref
+ then
+ echo "::warning::ci/config/allow-ref is deprecated; use CI_BRANCHES instead"
+ if ! config-repo/ci/config/allow-ref '${{ github.ref }}'
+ then
+ enabled=no
+ fi
+ fi
+
+ skip_concurrent=yes
+ if test -x config-repo/ci/config/skip-concurrent &&
+ ! config-repo/ci/config/skip-concurrent '${{ github.ref }}'
then
- enabled=no
+ skip_concurrent=no
fi
- echo "::set-output name=enabled::$enabled"
+ echo "enabled=$enabled" >>$GITHUB_OUTPUT
+ echo "skip_concurrent=$skip_concurrent" >>$GITHUB_OUTPUT
- name: skip if the commit or tree was already tested
id: skip-if-redundant
- uses: actions/github-script@v3
+ uses: actions/github-script@v7
if: steps.check-ref.outputs.enabled == 'yes'
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
try {
// Figure out workflow ID, commit and tree
- const { data: run } = await github.actions.getWorkflowRun({
+ const { data: run } = await github.rest.actions.getWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId,
@@ -54,7 +80,7 @@ jobs:
const tree_id = run.head_commit.tree_id;
// See whether there is a successful run for that commit or tree
- const { data: runs } = await github.actions.listWorkflowRuns({
+ const { data: runs } = await github.rest.actions.listWorkflowRuns({
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 500,
@@ -82,8 +108,11 @@ jobs:
needs: ci-config
if: needs.ci-config.outputs.enabled == 'yes'
runs-on: windows-latest
+ concurrency:
+ group: windows-build-${{ github.ref }}
+ cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- uses: git-for-windows/setup-git-for-windows-sdk@v1
- name: build
shell: bash
@@ -94,21 +123,24 @@ jobs:
- name: zip up tracked files
run: git archive -o artifacts/tracked.tar.gz HEAD
- name: upload tracked files and build artifacts
- uses: actions/upload-artifact@v2
+ uses: actions/upload-artifact@v4
with:
name: windows-artifacts
path: artifacts
windows-test:
name: win test
runs-on: windows-latest
- needs: [windows-build]
+ needs: [ci-config, windows-build]
strategy:
fail-fast: false
matrix:
nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ concurrency:
+ group: windows-test-${{ matrix.nr }}-${{ github.ref }}
+ cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
steps:
- name: download tracked files and build artifacts
- uses: actions/download-artifact@v2
+ uses: actions/download-artifact@v4
with:
name: windows-artifacts
path: ${{github.workspace}}
@@ -125,23 +157,26 @@ jobs:
run: ci/print-test-failures.sh
- name: Upload failed tests' directories
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
- uses: actions/upload-artifact@v2
+ uses: actions/upload-artifact@v4
with:
- name: failed-tests-windows
+ name: failed-tests-windows-${{ matrix.nr }}
path: ${{env.FAILED_TEST_ARTIFACTS}}
vs-build:
name: win+VS build
needs: ci-config
- if: needs.ci-config.outputs.enabled == 'yes'
+ if: github.event.repository.owner.login == 'git-for-windows' && needs.ci-config.outputs.enabled == 'yes'
env:
NO_PERL: 1
GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
runs-on: windows-latest
+ concurrency:
+ group: vs-build-${{ github.ref }}
+ cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- uses: git-for-windows/setup-git-for-windows-sdk@v1
- name: initialize vcpkg
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
repository: 'microsoft/vcpkg'
path: 'compat/vcbuild/vcpkg'
@@ -177,22 +212,25 @@ jobs:
- name: zip up tracked files
run: git archive -o artifacts/tracked.tar.gz HEAD
- name: upload tracked files and build artifacts
- uses: actions/upload-artifact@v2
+ uses: actions/upload-artifact@v4
with:
name: vs-artifacts
path: artifacts
vs-test:
name: win+VS test
runs-on: windows-latest
- needs: vs-build
+ needs: [ci-config, vs-build]
strategy:
fail-fast: false
matrix:
nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ concurrency:
+ group: vs-test-${{ matrix.nr }}-${{ github.ref }}
+ cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
steps:
- uses: git-for-windows/setup-git-for-windows-sdk@v1
- name: download tracked files and build artifacts
- uses: actions/download-artifact@v2
+ uses: actions/download-artifact@v4
with:
name: vs-artifacts
path: ${{github.workspace}}
@@ -210,47 +248,57 @@ jobs:
run: ci/print-test-failures.sh
- name: Upload failed tests' directories
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
- uses: actions/upload-artifact@v2
+ uses: actions/upload-artifact@v4
with:
- name: failed-tests-windows
+ name: failed-tests-windows-vs-${{ matrix.nr }}
path: ${{env.FAILED_TEST_ARTIFACTS}}
regular:
name: ${{matrix.vector.jobname}} (${{matrix.vector.pool}})
needs: ci-config
if: needs.ci-config.outputs.enabled == 'yes'
+ concurrency:
+ group: ${{ matrix.vector.jobname }}-${{ matrix.vector.pool }}-${{ github.ref }}
+ cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
strategy:
fail-fast: false
matrix:
vector:
- - jobname: linux-clang
+ - jobname: linux-sha256
cc: clang
pool: ubuntu-latest
- - jobname: linux-sha256
+ - jobname: linux-reftable
cc: clang
- os: ubuntu
pool: ubuntu-latest
- jobname: linux-gcc
cc: gcc
cc_package: gcc-8
- pool: ubuntu-latest
+ pool: ubuntu-20.04
- jobname: linux-TEST-vars
cc: gcc
- os: ubuntu
cc_package: gcc-8
- pool: ubuntu-latest
+ pool: ubuntu-20.04
- jobname: osx-clang
cc: clang
- pool: macos-latest
+ pool: macos-13
+ - jobname: osx-reftable
+ cc: clang
+ pool: macos-13
- jobname: osx-gcc
cc: gcc
- cc_package: gcc-9
- pool: macos-latest
+ cc_package: gcc-13
+ pool: macos-13
- jobname: linux-gcc-default
cc: gcc
pool: ubuntu-latest
- jobname: linux-leaks
cc: gcc
pool: ubuntu-latest
+ - jobname: linux-reftable-leaks
+ cc: gcc
+ pool: ubuntu-latest
+ - jobname: linux-asan-ubsan
+ cc: clang
+ pool: ubuntu-latest
env:
CC: ${{matrix.vector.cc}}
CC_PACKAGE: ${{matrix.vector.cc_package}}
@@ -258,23 +306,36 @@ jobs:
runs_on_pool: ${{matrix.vector.pool}}
runs-on: ${{matrix.vector.pool}}
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- run: ci/install-dependencies.sh
- run: ci/run-build-and-tests.sh
- name: print test failures
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
- shell: bash
run: ci/print-test-failures.sh
- name: Upload failed tests' directories
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
- uses: actions/upload-artifact@v2
+ uses: actions/upload-artifact@v4
with:
name: failed-tests-${{matrix.vector.jobname}}
path: ${{env.FAILED_TEST_ARTIFACTS}}
+ fuzz-smoke-test:
+ name: fuzz smoke test
+ needs: ci-config
+ if: needs.ci-config.outputs.enabled == 'yes'
+ env:
+ CC: clang
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - run: ci/install-dependencies.sh
+ - run: ci/run-build-and-minimal-fuzzers.sh
dockerized:
name: ${{matrix.vector.jobname}} (${{matrix.vector.image}})
needs: ci-config
if: needs.ci-config.outputs.enabled == 'yes'
+ concurrency:
+ group: dockerized-${{ matrix.vector.jobname }}-${{ matrix.vector.image }}-${{ github.ref }}
+ cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
strategy:
fail-fast: false
matrix:
@@ -282,7 +343,6 @@ jobs:
- jobname: linux-musl
image: alpine
- jobname: linux32
- os: ubuntu32
image: daald/ubuntu32:xenial
- jobname: pedantic
image: fedora
@@ -291,16 +351,24 @@ jobs:
runs-on: ubuntu-latest
container: ${{matrix.vector.image}}
steps:
- - uses: actions/checkout@v1
+ - uses: actions/checkout@v4
+ if: matrix.vector.jobname != 'linux32'
+ - uses: actions/checkout@v1 # cannot be upgraded because Node.js Actions aren't supported in this container
+ if: matrix.vector.jobname == 'linux32'
- run: ci/install-docker-dependencies.sh
- run: ci/run-build-and-tests.sh
- name: print test failures
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
- shell: bash
run: ci/print-test-failures.sh
- name: Upload failed tests' directories
- if: failure() && env.FAILED_TEST_ARTIFACTS != ''
- uses: actions/upload-artifact@v1
+ if: failure() && env.FAILED_TEST_ARTIFACTS != '' && matrix.vector.jobname != 'linux32'
+ uses: actions/upload-artifact@v4
+ with:
+ name: failed-tests-${{matrix.vector.jobname}}
+ path: ${{env.FAILED_TEST_ARTIFACTS}}
+ - name: Upload failed tests' directories
+ if: failure() && env.FAILED_TEST_ARTIFACTS != '' && matrix.vector.jobname == 'linux32'
+ uses: actions/upload-artifact@v1 # cannot be upgraded because Node.js Actions aren't supported in this container
with:
name: failed-tests-${{matrix.vector.jobname}}
path: ${{env.FAILED_TEST_ARTIFACTS}}
@@ -309,9 +377,12 @@ jobs:
if: needs.ci-config.outputs.enabled == 'yes'
env:
jobname: StaticAnalysis
- runs-on: ubuntu-18.04
+ runs-on: ubuntu-22.04
+ concurrency:
+ group: static-analysis-${{ github.ref }}
+ cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- run: ci/install-dependencies.sh
- run: ci/run-static-analysis.sh
- run: ci/check-directional-formatting.bash
@@ -321,6 +392,9 @@ jobs:
env:
jobname: sparse
runs-on: ubuntu-20.04
+ concurrency:
+ group: sparse-${{ github.ref }}
+ cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
steps:
- name: Download a current `sparse` package
# Ubuntu's `sparse` version is too old for us
@@ -331,7 +405,7 @@ jobs:
artifact: sparse-20.04
- name: Install the current `sparse` package
run: sudo dpkg -i sparse-20.04/sparse_*.deb
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Install other dependencies
run: ci/install-dependencies.sh
- run: make sparse
@@ -339,10 +413,13 @@ jobs:
name: documentation
needs: ci-config
if: needs.ci-config.outputs.enabled == 'yes'
+ concurrency:
+ group: documentation-${{ github.ref }}
+ cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
env:
jobname: Documentation
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- run: ci/install-dependencies.sh
- run: ci/test-documentation.sh
diff --git a/.gitignore b/.gitignore
index a452215..612c0f6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,5 @@
-/fuzz-commit-graph
/fuzz_corpora
-/fuzz-pack-headers
-/fuzz-pack-idx
+/GIT-BUILD-DIR
/GIT-BUILD-OPTIONS
/GIT-CFLAGS
/GIT-LDFLAGS
@@ -10,19 +8,18 @@
/GIT-PERL-HEADER
/GIT-PYTHON-VARS
/GIT-SCRIPT-DEFINES
+/GIT-SPATCH-DEFINES
/GIT-USER-AGENT
/GIT-VERSION-FILE
/bin-wrappers/
/git
/git-add
-/git-add--interactive
/git-am
/git-annotate
/git-apply
/git-archimport
/git-archive
/git-bisect
-/git-bisect--helper
/git-blame
/git-branch
/git-bugreport
@@ -53,6 +50,7 @@
/git-cvsimport
/git-cvsserver
/git-daemon
+/git-diagnose
/git-diff
/git-diff-files
/git-diff-index
@@ -60,7 +58,6 @@
/git-difftool
/git-difftool--helper
/git-describe
-/git-env--helper
/git-fast-export
/git-fast-import
/git-fetch
@@ -138,6 +135,7 @@
/git-remote-ext
/git-repack
/git-replace
+/git-replay
/git-request-pull
/git-rerere
/git-reset
@@ -180,11 +178,14 @@
/git-verify-commit
/git-verify-pack
/git-verify-tag
+/git-version
/git-web--browse
/git-whatchanged
/git-worktree
/git-write-tree
+/scalar
/git-core-*/?*
+/git.res
/gitweb/GITWEB-BUILD-OPTIONS
/gitweb/gitweb.cgi
/gitweb/static/gitweb.js
@@ -222,10 +223,10 @@
/TAGS
/cscope*
/compile_commands.json
+/.cache/
*.hcc
*.obj
*.lib
-*.res
*.sln
*.sp
*.suo
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..c0fa2fe
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,104 @@
+default:
+ timeout: 2h
+
+workflow:
+ rules:
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
+ - if: $CI_COMMIT_TAG
+ - if: $CI_COMMIT_REF_PROTECTED == "true"
+
+test:linux:
+ image: $image
+ before_script:
+ - ./ci/install-docker-dependencies.sh
+ script:
+ - useradd builder --create-home
+ - chown -R builder "${CI_PROJECT_DIR}"
+ - sudo --preserve-env --set-home --user=builder ./ci/run-build-and-tests.sh
+ after_script:
+ - |
+ if test "$CI_JOB_STATUS" != 'success'
+ then
+ sudo --preserve-env --set-home --user=builder ./ci/print-test-failures.sh
+ fi
+ parallel:
+ matrix:
+ - jobname: linux-sha256
+ image: ubuntu:latest
+ CC: clang
+ - jobname: linux-reftable
+ image: ubuntu:latest
+ CC: clang
+ - jobname: linux-gcc
+ image: ubuntu:20.04
+ CC: gcc
+ CC_PACKAGE: gcc-8
+ - jobname: linux-TEST-vars
+ image: ubuntu:20.04
+ CC: gcc
+ CC_PACKAGE: gcc-8
+ - jobname: linux-gcc-default
+ image: ubuntu:latest
+ CC: gcc
+ - jobname: linux-leaks
+ image: ubuntu:latest
+ CC: gcc
+ - jobname: linux-reftable-leaks
+ image: ubuntu:latest
+ CC: gcc
+ - jobname: linux-asan-ubsan
+ image: ubuntu:latest
+ CC: clang
+ - jobname: pedantic
+ image: fedora:latest
+ - jobname: linux-musl
+ image: alpine:latest
+ artifacts:
+ paths:
+ - t/failed-test-artifacts
+ when: on_failure
+
+test:osx:
+ image: $image
+ tags:
+ - saas-macos-medium-m1
+ variables:
+ TEST_OUTPUT_DIRECTORY: "/Volumes/RAMDisk"
+ before_script:
+ # Create a 4GB RAM disk that we use to store test output on. This small hack
+ # significantly speeds up tests by more than a factor of 2 because the
+ # macOS runners use network-attached storage as disks, which is _really_
+ # slow with the many small writes that our tests do.
+ - sudo diskutil apfs create $(hdiutil attach -nomount ram://8192000) RAMDisk
+ - ./ci/install-dependencies.sh
+ script:
+ - ./ci/run-build-and-tests.sh
+ after_script:
+ - |
+ if test "$CI_JOB_STATUS" != 'success'
+ then
+ ./ci/print-test-failures.sh
+ mv "$TEST_OUTPUT_DIRECTORY"/failed-test-artifacts t/
+ fi
+ parallel:
+ matrix:
+ - jobname: osx-clang
+ image: macos-13-xcode-14
+ CC: clang
+ - jobname: osx-reftable
+ image: macos-13-xcode-14
+ CC: clang
+ artifacts:
+ paths:
+ - t/failed-test-artifacts
+ when: on_failure
+
+static-analysis:
+ image: ubuntu:22.04
+ variables:
+ jobname: StaticAnalysis
+ before_script:
+ - ./ci/install-docker-dependencies.sh
+ script:
+ - ./ci/run-static-analysis.sh
+ - ./ci/check-directional-formatting.bash
diff --git a/.mailmap b/.mailmap
index 07db36a..18128a1 100644
--- a/.mailmap
+++ b/.mailmap
@@ -59,12 +59,13 @@ David Reiss <dreiss@facebook.com> <dreiss@dreiss-vmware.(none)>
David S. Miller <davem@davemloft.net>
David Turner <novalis@novalis.org> <dturner@twopensource.com>
David Turner <novalis@novalis.org> <dturner@twosigma.com>
-Derrick Stolee <derrickstolee@github.com> <stolee@gmail.com>
-Derrick Stolee <derrickstolee@github.com> Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
-Derrick Stolee <derrickstolee@github.com> <dstolee@microsoft.com>
+Derrick Stolee <stolee@gmail.com> <derrickstolee@github.com>
+Derrick Stolee <stolee@gmail.com> Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
+Derrick Stolee <stolee@gmail.com> <dstolee@microsoft.com>
Deskin Miller <deskinm@umich.edu>
Äoàn Trần Công Danh <congdanhqx@gmail.com> Doan Tran Cong Danh
Dirk Süsserott <newsletter@dirk.my1.cc>
+Emily Shaffer <nasamuffin@google.com> <emilyshaffer@google.com>
Eric Blake <eblake@redhat.com> <ebb9@byu.net>
Eric Hanchrow <eric.hanchrow@gmail.com> <offby1@blarg.net>
Eric S. Raymond <esr@thyrsus.com>
@@ -79,6 +80,7 @@ Frank Lichtenheld <frank@lichtenheld.de> <flichtenheld@astaro.com>
Fredrik Kuivinen <frekui@gmail.com> <freku045@student.liu.se>
Frédéric Heitzmann <frederic.heitzmann@gmail.com>
Garry Dolley <gdolley@ucla.edu> <gdolley@arpnetworks.com>
+Glen Choo <glencbz@gmail.com> <chooglen@google.com>
Greg Price <price@mit.edu> <price@MIT.EDU>
Greg Price <price@mit.edu> <price@ksplice.com>
Heiko Voigt <hvoigt@hvoigt.net> <git-list@hvoigt.net>
@@ -150,6 +152,7 @@ Lars Doelle <lars.doelle@on-line ! de>
Lars Doelle <lars.doelle@on-line.de>
Lars Noschinski <lars@public.noschinski.de> <lars.noschinski@rwth-aachen.de>
Li Hong <leehong@pku.edu.cn>
+Linus Arver <linus@ucla.edu> <linusa@google.com>
Linus Torvalds <torvalds@linux-foundation.org> <torvalds@evo.osdl.org>
Linus Torvalds <torvalds@linux-foundation.org> <torvalds@g5.osdl.org>
Linus Torvalds <torvalds@linux-foundation.org> <torvalds@osdl.org>
@@ -165,6 +168,7 @@ Mark Rada <marada@uwaterloo.ca>
Martin Langhoff <martin@laptop.org> <martin@catalyst.net.nz>
Martin von Zweigbergk <martinvonz@gmail.com> <martin.von.zweigbergk@gmail.com>
Masaya Suzuki <masayasuzuki@google.com> <draftcode@gmail.com>
+Matheus Tavares <matheus.tavb@gmail.com> <matheus.bernardino@usp.br>
Matt Draisey <matt@draisey.ca> <mattdraisey@sympatico.ca>
Matt Kraai <kraai@ftbfs.org> <matt.kraai@amo.abbott.com>
Matt McCutchen <matt@mattmccutchen.net> <hashproduct@gmail.com>
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index 0215b1f..e58917c 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -130,11 +130,11 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
-Community Impact Guidelines were inspired by
+Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
-[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
+[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
at [https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
diff --git a/Documentation/.gitignore b/Documentation/.gitignore
index 1c3771e..a48448d 100644
--- a/Documentation/.gitignore
+++ b/Documentation/.gitignore
@@ -10,7 +10,6 @@ howto-index.txt
doc.dep
cmds-*.txt
mergetools-*.txt
-manpage-base-url.xsl
SubmittingPatches.txt
tmp-doc-diff/
GIT-ASCIIDOCFLAGS
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 4c756be..1d92b2d 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -1,5 +1,5 @@
-Like other projects, we also have some guidelines to keep to the
-code. For Git in general, a few rough rules are:
+Like other projects, we also have some guidelines for our code. For
+Git in general, a few rough rules are:
- Most importantly, we never say "It's in POSIX; we'll happily
ignore your needs should your system not conform to it."
@@ -24,7 +24,7 @@ code. For Git in general, a few rough rules are:
"Once it _is_ in the tree, it's not really worth the patch noise to
go and fix it up."
- Cf. http://lkml.iu.edu/hypermail/linux/kernel/1001.3/01069.html
+ Cf. https://lore.kernel.org/all/20100126160632.3bdbe172.akpm@linux-foundation.org/
- Log messages to explain your changes are as important as the
changes themselves. Clearly written code and in-code comments
@@ -40,7 +40,7 @@ As for more concrete guidelines, just imitate the existing code
contributing to). It is always preferable to match the _local_
convention. New code added to Git suite is expected to match
the overall style of existing code. Modifications to existing
-code is expected to match the style the surrounding code already
+code are expected to match the style the surrounding code already
uses (even if it doesn't match the overall style of existing code).
But if you must have a list of rules, here are some language
@@ -162,8 +162,6 @@ For shell scripts specifically (not exhaustive):
- We do not use \{m,n\};
- - We do not use -E;
-
- We do not use ? or + (which are \{0,1\} and \{1,\}
respectively in BRE) but that goes without saying as these
are ERE elements not BRE (note that \? and \+ are not even part
@@ -190,6 +188,26 @@ For shell scripts specifically (not exhaustive):
hopefully nobody starts using "local" before they are reimplemented
in C ;-)
+ - Some versions of shell do not understand "export variable=value",
+ so we write "variable=value" and then "export variable" on two
+ separate lines.
+
+ - Some versions of dash have broken variable assignment when prefixed
+ with "local", "export", and "readonly", in that the value to be
+ assigned goes through field splitting at $IFS unless quoted.
+
+ (incorrect)
+ local variable=$value
+ local variable=$(command args)
+
+ (correct)
+ local variable="$value"
+ local variable="$(command args)"
+
+ - Use octal escape sequences (e.g. "\302\242"), not hexadecimal (e.g.
+ "\xc2\xa2") in printf format strings, since hexadecimal escape
+ sequences are not portable.
+
For C programs:
@@ -204,10 +222,19 @@ For C programs:
by e.g. "echo DEVELOPER=1 >>config.mak".
- We try to support a wide range of C compilers to compile Git with,
- including old ones. You should not use features from newer C
+ including old ones. As of Git v2.35.0 Git requires C99 (we check
+ "__STDC_VERSION__"). You should not use features from a newer C
standard, even if your compiler groks them.
- There are a few exceptions to this guideline:
+ New C99 features have been phased in gradually, if something's new
+ in C99 but not used yet don't assume that it's safe to use, some
+ compilers we target have only partial support for it. These are
+ considered safe to use:
+
+ . since around 2007 with 2b6854c863a, we have been using
+ initializer elements which are not computable at load time. E.g.:
+
+ const char *args[] = {"constant", variable, NULL};
. since early 2012 with e1327023ea, we have been using an enum
definition whose last element is followed by a comma. This, like
@@ -223,18 +250,24 @@ For C programs:
. since early 2021 with 765dc168882, we have been using variadic
macros, mostly for printf-like trace and debug macros.
- These used to be forbidden, but we have not heard any breakage
- report, and they are assumed to be safe.
+ . since late 2021 with 44ba10d6, we have had variables declared in
+ the for loop "for (int i = 0; i < 10; i++)".
+
+ New C99 features that we cannot use yet:
+
+ . %z and %zu as a printf() argument for a size_t (the %z being for
+ the POSIX-specific ssize_t). Instead you should use
+ printf("%"PRIuMAX, (uintmax_t)v). These days the MSVC version we
+ rely on supports %z, but the C library used by MinGW does not.
+
+ . Shorthand like ".a.b = *c" in struct initializations is known to
+ trip up an older IBM XLC version, use ".a = { .b = *c }" instead.
+ See the 33665d98 (reftable: make assignments portable to AIX xlc
+ v12.01, 2022-03-28).
- Variables have to be declared at the beginning of the block, before
the first statement (i.e. -Wdeclaration-after-statement).
- - Declaring a variable in the for loop "for (int i = 0; i < 10; i++)"
- is still not allowed in this codebase. We are in the process of
- allowing it by waiting to see that 44ba10d6 (revision: use C99
- declaration of variable in for() loop, 2021-11-14) does not get
- complaints. Let's revisit this around November 2022.
-
- NULL pointers shall be written as NULL, not as 0.
- When declaring pointers, the star sides with the variable
@@ -429,8 +462,41 @@ For C programs:
detail.
- The first #include in C files, except in platform specific compat/
- implementations, must be either "git-compat-util.h", "cache.h" or
- "builtin.h". You do not have to include more than one of these.
+ implementations and sha1dc/, must be <git-compat-util.h>. This
+ header file insulates other header files and source files from
+ platform differences, like which system header files must be
+ included in what order, and what C preprocessor feature macros must
+ be defined to trigger certain features we expect out of the system.
+ A collorary to this is that C files should not directly include
+ system header files themselves.
+
+ There are some exceptions, because certain group of files that
+ implement an API all have to include the same header file that
+ defines the API and it is convenient to include <git-compat-util.h>
+ there. Namely:
+
+ - the implementation of the built-in commands in the "builtin/"
+ directory that include "builtin.h" for the cmd_foo() prototype
+ definition,
+
+ - the test helper programs in the "t/helper/" directory that include
+ "t/helper/test-tool.h" for the cmd__foo() prototype definition,
+
+ - the xdiff implementation in the "xdiff/" directory that includes
+ "xdiff/xinclude.h" for the xdiff machinery internals,
+
+ - the unit test programs in "t/unit-tests/" directory that include
+ "t/unit-tests/test-lib.h" that gives them the unit-tests
+ framework, and
+
+ - the source files that implement reftable in the "reftable/"
+ directory that include "reftable/system.h" for the reftable
+ internals,
+
+ are allowed to assume that they do not have to include
+ <git-compat-util.h> themselves, as it is included as the first
+ '#include' in these header files. These headers must be the first
+ header file to be "#include"d in them, though.
- A C file must directly include the header files that declare the
functions and the types it uses, except for the functions and types
@@ -469,7 +535,7 @@ For Perl programs:
- Most of the C guidelines above apply.
- - We try to support Perl 5.8 and later ("use Perl 5.008").
+ - We try to support Perl 5.8.1 and later ("use Perl 5.008001").
- use strict and use warnings are strongly preferred.
@@ -497,7 +563,7 @@ For Perl programs:
For Python scripts:
- - We follow PEP-8 (http://www.python.org/dev/peps/pep-0008/).
+ - We follow PEP-8 (https://peps.python.org/pep-0008/).
- As a minimum, we aim to be compatible with Python 2.7.
@@ -557,7 +623,7 @@ Externally Visible Names
. The variable name describes the effect of tweaking this knob.
The section and variable names that consist of multiple words are
- formed by concatenating the words without punctuations (e.g. `-`),
+ formed by concatenating the words without punctuation marks (e.g. `-`),
and are broken using bumpyCaps in documentation as a hint to the
reader.
@@ -591,30 +657,30 @@ Writing Documentation:
- Prefer succinctness and matter-of-factly describing functionality
in the abstract. E.g.
- --short:: Emit output in the short-format.
+ `--short`:: Emit output in the short-format.
and avoid something like these overly verbose alternatives:
- --short:: Use this to emit output in the short-format.
- --short:: You can use this to get output in the short-format.
- --short:: A user who prefers shorter output could....
- --short:: Should a person and/or program want shorter output, he
- she/they/it can...
+ `--short`:: Use this to emit output in the short-format.
+ `--short`:: You can use this to get output in the short-format.
+ `--short`:: A user who prefers shorter output could....
+ `--short`:: Should a person and/or program want shorter output, he
+ she/they/it can...
This practice often eliminates the need to involve human actors in
your description, but it is a good practice regardless of the
avoidance of gendered pronouns.
- When it becomes awkward to stick to this style, prefer "you" when
- addressing the the hypothetical user, and possibly "we" when
+ addressing the hypothetical user, and possibly "we" when
discussing how the program might react to the user. E.g.
- You can use this option instead of --xyz, but we might remove
+ You can use this option instead of `--xyz`, but we might remove
support for it in future versions.
while keeping in mind that you can probably be less verbose, e.g.
- Use this instead of --xyz. This option might be removed in future
+ Use this instead of `--xyz`. This option might be removed in future
versions.
- If you still need to refer to an example person that is
@@ -632,53 +698,118 @@ Writing Documentation:
The same general rule as for code applies -- imitate the existing
conventions.
- A few commented examples follow to provide reference when writing or
- modifying command usage strings and synopsis sections in the manual
- pages:
- Placeholders are spelled in lowercase and enclosed in angle brackets:
- <file>
- --sort=<key>
- --abbrev[=<n>]
+Markup:
+
+ Literal parts (e.g. use of command-line options, command names,
+ branch names, URLs, pathnames (files and directories), configuration and
+ environment variables) must be typeset as verbatim (i.e. wrapped with
+ backticks):
+ `--pretty=oneline`
+ `git rev-list`
+ `remote.pushDefault`
+ `http://git.example.com`
+ `.git/config`
+ `GIT_DIR`
+ `HEAD`
+ `umask`(2)
+
+ An environment variable must be prefixed with "$" only when referring to its
+ value and not when referring to the variable itself, in this case there is
+ nothing to add except the backticks:
+ `GIT_DIR` is specified
+ `$GIT_DIR/hooks/pre-receive`
+
+ Word phrases enclosed in `backtick characters` are rendered literally
+ and will not be further expanded. The use of `backticks` to achieve the
+ previous rule means that literal examples should not use AsciiDoc
+ escapes.
+ Correct:
+ `--pretty=oneline`
+ Incorrect:
+ `\--pretty=oneline`
+
+ Placeholders are spelled in lowercase and enclosed in
+ angle brackets surrounded by underscores:
+ _<file>_
+ _<commit>_
If a placeholder has multiple words, they are separated by dashes:
- <new-branch-name>
- --template=<template-directory>
+ _<new-branch-name>_
+ _<template-directory>_
+
+ A placeholder is not enclosed in backticks, as it is not a literal.
+
+ When needed, use a distinctive identifier for placeholders, usually
+ made of a qualification and a type:
+ _<git-dir>_
+ _<key-id>_
+
+ When literal and placeholders are mixed, each markup is applied for
+ each sub-entity. If they are stuck, a special markup, called
+ unconstrained formatting is required.
+ Unconstrained formating for placeholders is __<like-this>__
+ Unconstrained formatting for literal formatting is ++like this++
+ `--jobs` _<n>_
+ ++--sort=++__<key>__
+ __<directory>__++/.git++
+ ++remote.++__<name>__++.mirror++
+
+ caveat: ++ unconstrained format is not verbatim and may expand
+ content. Use Asciidoc escapes inside them.
+
+Synopsis Syntax
+
+ Syntax grammar is formatted neither as literal nor as placeholder.
+
+ A few commented examples follow to provide reference when writing or
+ modifying command usage strings and synopsis sections in the manual
+ pages:
Possibility of multiple occurrences is indicated by three dots:
- <file>...
+ _<file>_...
(One or more of <file>.)
Optional parts are enclosed in square brackets:
- [<extra>]
- (Zero or one <extra>.)
+ [_<file>_...]
+ (Zero or more of <file>.)
- --exec-path[=<path>]
+ ++--exec-path++[++=++__<path>__]
(Option with an optional argument. Note that the "=" is inside the
brackets.)
- [<patch>...]
+ [_<patch>_...]
(Zero or more of <patch>. Note that the dots are inside, not
outside the brackets.)
Multiple alternatives are indicated with vertical bars:
- [-q | --quiet]
- [--utf8 | --no-utf8]
+ [`-q` | `--quiet`]
+ [`--utf8` | `--no-utf8`]
+
+ Use spacing around "|" token(s), but not immediately after opening or
+ before closing a [] or () pair:
+ Do: [`-q` | `--quiet`]
+ Don't: [`-q`|`--quiet`]
+
+ Don't use spacing around "|" tokens when they're used to separate the
+ alternate arguments of an option:
+ Do: ++--track++[++=++(`direct`|`inherit`)]`
+ Don't: ++--track++[++=++(`direct` | `inherit`)]
Parentheses are used for grouping:
- [(<rev> | <range>)...]
+ [(_<rev>_ | _<range>_)...]
(Any number of either <rev> or <range>. Parens are needed to make
it clear that "..." pertains to both <rev> and <range>.)
- [(-p <parent>)...]
+ [(`-p` _<parent>_)...]
(Any number of option -p, each with one <parent> argument.)
- git remote set-head <name> (-a | -d | <branch>)
+ `git remote set-head` _<name>_ (`-a` | `-d` | _<branch>_)
(One and only one of "-a", "-d" or "<branch>" _must_ (no square
brackets) be provided.)
And a somewhat more contrived example:
- --diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]
+ `--diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]`
Here "=" is outside the brackets, because "--diff-filter=" is a
valid usage. "*" has its own pair of brackets, because it can
(optionally) be specified only when one or more of the letters is
@@ -689,37 +820,6 @@ Writing Documentation:
the user would type into a shell and use 'Git' (uppercase first letter)
when talking about the version control system and its properties.
- A few commented examples follow to provide reference when writing or
- modifying paragraphs or option/command explanations that contain options
- or commands:
-
- Literal examples (e.g. use of command-line options, command names,
- branch names, URLs, pathnames (files and directories), configuration and
- environment variables) must be typeset in monospace (i.e. wrapped with
- backticks):
- `--pretty=oneline`
- `git rev-list`
- `remote.pushDefault`
- `http://git.example.com`
- `.git/config`
- `GIT_DIR`
- `HEAD`
-
- An environment variable must be prefixed with "$" only when referring to its
- value and not when referring to the variable itself, in this case there is
- nothing to add except the backticks:
- `GIT_DIR` is specified
- `$GIT_DIR/hooks/pre-receive`
-
- Word phrases enclosed in `backtick characters` are rendered literally
- and will not be further expanded. The use of `backticks` to achieve the
- previous rule means that literal examples should not use AsciiDoc
- escapes.
- Correct:
- `--pretty=oneline`
- Incorrect:
- `\--pretty=oneline`
-
If some place in the documentation needs to typeset a command usage
example with inline substitutions, it is fine to use +monospaced and
inline substituted text+ instead of `monospaced literal text`, and with
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 4f801f4..3f2383a 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -21,13 +21,25 @@ MAN1_TXT += $(filter-out \
MAN1_TXT += git.txt
MAN1_TXT += gitk.txt
MAN1_TXT += gitweb.txt
+MAN1_TXT += scalar.txt
# man5 / man7 guides (note: new guides should also be added to command-list.txt)
MAN5_TXT += gitattributes.txt
+MAN5_TXT += gitformat-bundle.txt
+MAN5_TXT += gitformat-chunk.txt
+MAN5_TXT += gitformat-commit-graph.txt
+MAN5_TXT += gitformat-index.txt
+MAN5_TXT += gitformat-pack.txt
+MAN5_TXT += gitformat-signature.txt
MAN5_TXT += githooks.txt
MAN5_TXT += gitignore.txt
MAN5_TXT += gitmailmap.txt
MAN5_TXT += gitmodules.txt
+MAN5_TXT += gitprotocol-capabilities.txt
+MAN5_TXT += gitprotocol-common.txt
+MAN5_TXT += gitprotocol-http.txt
+MAN5_TXT += gitprotocol-pack.txt
+MAN5_TXT += gitprotocol-v2.txt
MAN5_TXT += gitrepository-layout.txt
MAN5_TXT += gitweb.conf.txt
@@ -51,6 +63,7 @@ HOWTO_TXT += $(wildcard howto/*.txt)
DOC_DEP_TXT += $(wildcard *.txt)
DOC_DEP_TXT += $(wildcard config/*.txt)
+DOC_DEP_TXT += $(wildcard includes/*.txt)
ifdef MAN_FILTER
MAN_TXT = $(filter $(MAN_FILTER),$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT))
@@ -90,32 +103,26 @@ SP_ARTICLES += howto/coordinate-embargoed-releases
API_DOCS = $(patsubst %.txt,%,$(filter-out technical/api-index-skel.txt technical/api-index.txt, $(wildcard technical/api-*.txt)))
SP_ARTICLES += $(API_DOCS)
+TECH_DOCS += ReviewingGuidelines
TECH_DOCS += MyFirstContribution
TECH_DOCS += MyFirstObjectWalk
TECH_DOCS += SubmittingPatches
TECH_DOCS += ToolsForGit
TECH_DOCS += technical/bitmap-format
-TECH_DOCS += technical/bundle-format
-TECH_DOCS += technical/cruft-packs
+TECH_DOCS += technical/bundle-uri
TECH_DOCS += technical/hash-function-transition
-TECH_DOCS += technical/http-protocol
-TECH_DOCS += technical/index-format
TECH_DOCS += technical/long-running-process-protocol
TECH_DOCS += technical/multi-pack-index
-TECH_DOCS += technical/pack-format
TECH_DOCS += technical/pack-heuristics
-TECH_DOCS += technical/pack-protocol
TECH_DOCS += technical/parallel-checkout
TECH_DOCS += technical/partial-clone
-TECH_DOCS += technical/protocol-capabilities
-TECH_DOCS += technical/protocol-common
-TECH_DOCS += technical/protocol-v2
TECH_DOCS += technical/racy-git
TECH_DOCS += technical/reftable
+TECH_DOCS += technical/scalar
TECH_DOCS += technical/send-pack-pipeline
TECH_DOCS += technical/shallow
-TECH_DOCS += technical/signature-format
TECH_DOCS += technical/trivial-merge
+TECH_DOCS += technical/unit-tests
SP_ARTICLES += $(TECH_DOCS)
SP_ARTICLES += technical/api-index
@@ -138,14 +145,16 @@ man5dir = $(mandir)/man5
man7dir = $(mandir)/man7
# DESTDIR =
+GIT_DATE := $(shell git show --quiet --pretty='%as')
+
ASCIIDOC = asciidoc
ASCIIDOC_EXTRA =
ASCIIDOC_HTML = xhtml11
ASCIIDOC_DOCBOOK = docbook
ASCIIDOC_CONF = -f asciidoc.conf
ASCIIDOC_COMMON = $(ASCIIDOC) $(ASCIIDOC_EXTRA) $(ASCIIDOC_CONF) \
- -amanversion=$(GIT_VERSION) \
- -amanmanual='Git Manual' -amansource='Git'
+ -amanmanual='Git Manual' -amansource='Git $(GIT_VERSION)' \
+ -arevdate='$(GIT_DATE)'
ASCIIDOC_DEPS = asciidoc.conf GIT-ASCIIDOCFLAGS
TXT_TO_HTML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_HTML)
TXT_TO_XML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_DOCBOOK)
@@ -183,15 +192,7 @@ endif
ifndef MAN_BASE_URL
MAN_BASE_URL = file://$(htmldir)/
endif
-XMLTO_EXTRA += -m manpage-base-url.xsl
-
-# If your target system uses GNU groff, it may try to render
-# apostrophes as a "pretty" apostrophe using unicode. This breaks
-# cut&paste, so you should set GNU_ROFF to force them to be ASCII
-# apostrophes. Unfortunately does not work with non-GNU roff.
-ifdef GNU_ROFF
-XMLTO_EXTRA += -m manpage-quote-apos.xsl
-endif
+XMLTO_EXTRA += --stringparam man.base.url.for.relative.links='$(MAN_BASE_URL)'
ifdef USE_ASCIIDOCTOR
ASCIIDOC = asciidoctor
@@ -290,6 +291,8 @@ cmds_txt = cmds-ancillaryinterrogators.txt \
cmds-synchingrepositories.txt \
cmds-synchelpers.txt \
cmds-guide.txt \
+ cmds-developerinterfaces.txt \
+ cmds-userinterfaces.txt \
cmds-purehelpers.txt \
cmds-foreignscminterface.txt
@@ -331,7 +334,6 @@ clean:
$(RM) technical/*.html technical/api-index.txt
$(RM) SubmittingPatches.txt
$(RM) $(cmds_txt) $(mergetools_txt) *.made
- $(RM) manpage-base-url.xsl
$(RM) GIT-ASCIIDOCFLAGS
$(MAN_HTML): %.html : %.txt $(ASCIIDOC_DEPS)
@@ -340,11 +342,15 @@ $(MAN_HTML): %.html : %.txt $(ASCIIDOC_DEPS)
$(OBSOLETE_HTML): %.html : %.txto $(ASCIIDOC_DEPS)
$(QUIET_ASCIIDOC)$(TXT_TO_HTML) -o $@ $<
-manpage-base-url.xsl: manpage-base-url.xsl.in
- $(QUIET_GEN)sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@
+manpage-prereqs := $(wildcard manpage*.xsl)
+manpage-cmd = $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
-%.1 %.5 %.7 : %.xml manpage-base-url.xsl $(wildcard manpage*.xsl)
- $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
+%.1 : %.xml $(manpage-prereqs)
+ $(manpage-cmd)
+%.5 : %.xml $(manpage-prereqs)
+ $(manpage-cmd)
+%.7 : %.xml $(manpage-prereqs)
+ $(manpage-cmd)
%.xml : %.txt $(ASCIIDOC_DEPS)
$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $<
@@ -468,8 +474,19 @@ $(LINT_DOCS_MAN_SECTION_ORDER): .build/lint-docs/man-section-order/%.ok: %.txt
.PHONY: lint-docs-man-section-order
lint-docs-man-section-order: $(LINT_DOCS_MAN_SECTION_ORDER)
+.PHONY: lint-docs-fsck-msgids
+LINT_DOCS_FSCK_MSGIDS = .build/lint-docs/fsck-msgids.ok
+$(LINT_DOCS_FSCK_MSGIDS): lint-fsck-msgids.perl
+$(LINT_DOCS_FSCK_MSGIDS): ../fsck.h fsck-msgids.txt
+ $(call mkdir_p_parent_template)
+ $(QUIET_GEN)$(PERL_PATH) lint-fsck-msgids.perl \
+ ../fsck.h fsck-msgids.txt $@
+
+lint-docs-fsck-msgids: $(LINT_DOCS_FSCK_MSGIDS)
+
## Lint: list of targets above
.PHONY: lint-docs
+lint-docs: lint-docs-fsck-msgids
lint-docs: lint-docs-gitlink
lint-docs: lint-docs-man-end-blurb
lint-docs: lint-docs-man-section-order
diff --git a/Documentation/MyFirstContribution.txt b/Documentation/MyFirstContribution.txt
index 1da15d9..f06563e 100644
--- a/Documentation/MyFirstContribution.txt
+++ b/Documentation/MyFirstContribution.txt
@@ -35,8 +35,9 @@ announcements, design discussions, and more take place. Those interested in
contributing are welcome to post questions here. The Git list requires
plain-text-only emails and prefers inline and bottom-posting when replying to
mail; you will be CC'd in all replies to you. Optionally, you can subscribe to
-the list by sending an email to majordomo@vger.kernel.org with "subscribe git"
-in the body. The https://lore.kernel.org/git[archive] of this mailing list is
+the list by sending an email to <git+subscribe@vger.kernel.org>
+(see https://subspace.kernel.org/subscribing.html for details).
+The https://lore.kernel.org/git[archive] of this mailing list is
available to view in a browser.
==== https://groups.google.com/forum/#!forum/git-mentoring[git-mentoring@googlegroups.com]
@@ -160,10 +161,11 @@ in order to keep the declarations alphabetically sorted:
int cmd_psuh(int argc, const char **argv, const char *prefix);
----
-Be sure to `#include "builtin.h"` in your `psuh.c`.
+Be sure to `#include "builtin.h"` in your `psuh.c`. You'll also need to
+`#include "gettext.h"` to use functions related to printing output text.
-Go ahead and add some throwaway printf to that function. This is a decent
-starting point as we can now add build rules and register the command.
+Go ahead and add some throwaway printf to the `cmd_psuh` function. This is a
+decent starting point as we can now add build rules and register the command.
NOTE: Your throwaway text, as well as much of the text you will be adding over
the course of this tutorial, is user-facing. That means it needs to be
@@ -736,7 +738,7 @@ the {lore}[Git mailing list archive]:
2022-02-21 1:43 ` John Cai
2022-02-21 1:50 ` Taylor Blau
2022-02-23 19:50 ` John Cai
-2022-02-18 20:00 ` // other replies ellided
+2022-02-18 20:00 ` // other replies elided
2022-02-18 18:40 ` [PATCH 2/3] reflog: call reflog_delete from reflog.c John Cai via GitGitGadget
2022-02-18 19:15 ` Ævar Arnfjörð Bjarmason
2022-02-18 20:26 ` Junio C Hamano
@@ -832,7 +834,7 @@ Johannes Schindelin to make life as a Git contributor easier for those used to
the GitHub PR workflow. It allows contributors to open pull requests against its
mirror of the Git project, and does some magic to turn the PR into a set of
emails and send them out for you. It also runs the Git continuous integration
-suite for you. It's documented at http://gitgitgadget.github.io.
+suite for you. It's documented at https://gitgitgadget.github.io/.
[[create-fork]]
=== Forking `git/git` on GitHub
@@ -1160,32 +1162,32 @@ all named like `v2-000n-my-commit-subject.patch`. `-v2` will also format
your patches by prefixing them with "[PATCH v2]" instead of "[PATCH]",
and your range-diff will be prefaced with "Range-diff against v1".
-Afer you run this command, `format-patch` will output the patches to the `psuh/`
+After you run this command, `format-patch` will output the patches to the `psuh/`
directory, alongside the v1 patches. Using a single directory makes it easy to
refer to the old v1 patches while proofreading the v2 patches, but you will need
to be careful to send out only the v2 patches. We will use a pattern like
-"psuh/v2-*.patch" (not "psuh/*.patch", which would match v1 and v2 patches).
+`psuh/v2-*.patch` (not `psuh/*.patch`, which would match v1 and v2 patches).
Edit your cover letter again. Now is a good time to mention what's different
between your last version and now, if it's something significant. You do not
need the exact same body in your second cover letter; focus on explaining to
reviewers the changes you've made that may not be as visible.
-You will also need to go and find the Message-Id of your previous cover letter.
+You will also need to go and find the Message-ID of your previous cover letter.
You can either note it when you send the first series, from the output of `git
send-email`, or you can look it up on the
https://lore.kernel.org/git[mailing list]. Find your cover letter in the
-archives, click on it, then click "permalink" or "raw" to reveal the Message-Id
+archives, click on it, then click "permalink" or "raw" to reveal the Message-ID
header. It should match:
----
-Message-Id: <foo.12345.author@example.com>
+Message-ID: <foo.12345.author@example.com>
----
-Your Message-Id is `<foo.12345.author@example.com>`. This example will be used
-below as well; make sure to replace it with the correct Message-Id for your
-**previous cover letter** - that is, if you're sending v2, use the Message-Id
-from v1; if you're sending v3, use the Message-Id from v2.
+Your Message-ID is `<foo.12345.author@example.com>`. This example will be used
+below as well; make sure to replace it with the correct Message-ID for your
+**previous cover letter** - that is, if you're sending v2, use the Message-ID
+from v1; if you're sending v3, use the Message-ID from v2.
While you're looking at the email, you should also note who is CC'd, as it's
common practice in the mailing list to keep all CCs on a thread. You can add
@@ -1256,6 +1258,38 @@ index 88f126184c..38da593a60 100644
[[now-what]]
== My Patch Got Emailed - Now What?
+Please give reviewers enough time to process your initial patch before
+sending an updated version. That is, resist the temptation to send a new
+version immediately, because others may have already started reviewing
+your initial version.
+
+While waiting for review comments, you may find mistakes in your initial
+patch, or perhaps realize a different and better way to achieve the goal
+of the patch. In this case you may communicate your findings to other
+reviewers as follows:
+
+ - If the mistakes you found are minor, send a reply to your patch as if
+ you were a reviewer and mention that you will fix them in an
+ updated version.
+
+ - On the other hand, if you think you want to change the course so
+ drastically that reviews on the initial patch would be a waste of
+ time (for everyone involved), retract the patch immediately with
+ a reply like "I am working on a much better approach, so please
+ ignore this patch and wait for the updated version."
+
+Now, the above is a good practice if you sent your initial patch
+prematurely without polish. But a better approach of course is to avoid
+sending your patch prematurely in the first place.
+
+Please be considerate of the time needed by reviewers to examine each
+new version of your patch. Rather than seeing the initial version right
+now (followed by several "oops, I like this version better than the
+previous one" patches over 2 days), reviewers would strongly prefer if a
+single polished version came 2 days later instead, and that version with
+fewer mistakes were the only one they would need to review.
+
+
[[reviewing]]
=== Responding to Reviews
diff --git a/Documentation/MyFirstObjectWalk.txt b/Documentation/MyFirstObjectWalk.txt
index 8d9e855..dec8afe 100644
--- a/Documentation/MyFirstObjectWalk.txt
+++ b/Documentation/MyFirstObjectWalk.txt
@@ -41,6 +41,7 @@ Open up a new file `builtin/walken.c` and set up the command handler:
*/
#include "builtin.h"
+#include "trace.h"
int cmd_walken(int argc, const char **argv, const char *prefix)
{
@@ -49,12 +50,13 @@ int cmd_walken(int argc, const char **argv, const char *prefix)
}
----
-NOTE: `trace_printf()` differs from `printf()` in that it can be turned on or
-off at runtime. For the purposes of this tutorial, we will write `walken` as
-though it is intended for use as a "plumbing" command: that is, a command which
-is used primarily in scripts, rather than interactively by humans (a "porcelain"
-command). So we will send our debug output to `trace_printf()` instead. When
-running, enable trace output by setting the environment variable `GIT_TRACE`.
+NOTE: `trace_printf()`, defined in `trace.h`, differs from `printf()` in
+that it can be turned on or off at runtime. For the purposes of this
+tutorial, we will write `walken` as though it is intended for use as
+a "plumbing" command: that is, a command which is used primarily in
+scripts, rather than interactively by humans (a "porcelain" command).
+So we will send our debug output to `trace_printf()` instead.
+When running, enable trace output by setting the environment variable `GIT_TRACE`.
Add usage text and `-h` handling, like all subcommands should consistently do
(our test suite will notice and complain if you fail to do so).
@@ -124,7 +126,7 @@ parameters provided by the user over the CLI.
`nr` represents the number of `rev_cmdline_entry` present in the array.
-`alloc` is used by the `ALLOC_GROW` macro. Check `cache.h` - this variable is
+`alloc` is used by the `ALLOC_GROW` macro. Check `alloc.h` - this variable is
used to track the allocated size of the list.
Per entry, we find:
@@ -208,13 +210,14 @@ We'll also need to include the `config.h` header:
...
-static int git_walken_config(const char *var, const char *value, void *cb)
+static int git_walken_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
/*
* For now, we don't have any custom configuration, so fall back to
* the default config.
*/
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
----
@@ -341,6 +344,10 @@ the walk loop below the `prepare_revision_walk()` call within your
`walken_commit_walk()`:
----
+#include "pretty.h"
+
+...
+
static void walken_commit_walk(struct rev_info *rev)
{
struct commit *commit;
@@ -383,10 +390,11 @@ modifying `rev_info.grep_filter`, which is a `struct grep_opt`.
First some setup. Add `grep_config()` to `git_walken_config()`:
----
-static int git_walken_config(const char *var, const char *value, void *cb)
+static int git_walken_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
- grep_config(var, value, cb);
- return git_default_config(var, value, cb);
+ grep_config(var, value, ctx, cb);
+ return git_default_config(var, value, ctx, cb);
}
----
@@ -517,7 +525,7 @@ about each one.
We can base our work on an example. `git pack-objects` prepares all kinds of
objects for packing into a bitmap or packfile. The work we are interested in
-resides in `builtins/pack-objects.c:get_object_list()`; examination of that
+resides in `builtin/pack-objects.c:get_object_list()`; examination of that
function shows that the all-object walk is being performed by
`traverse_commit_list()` or `traverse_commit_list_filtered()`. Those two
functions reside in `list-objects.c`; examining the source shows that, despite
@@ -534,7 +542,7 @@ the arguments to `traverse_commit_list()`.
- `void *show_data`: A context buffer which is passed in turn to `show_commit`
and `show_object`.
-In addition, `traverse_commit_list_filtered()` has an additional paramter:
+In addition, `traverse_commit_list_filtered()` has an additional parameter:
- `struct oidset *omitted`: A linked-list of object IDs which the provided
filter caused to be omitted.
@@ -726,8 +734,8 @@ walk we've just performed:
} else {
trace_printf(
_("Filtered object walk with filterspec 'tree:1'.\n"));
- CALLOC_ARRAY(rev->filter, 1);
- parse_list_objects_filter(rev->filter, "tree:1");
+
+ parse_list_objects_filter(&rev->filter, "tree:1");
}
traverse_commit_list(rev, walken_show_commit,
walken_show_object, NULL);
@@ -746,14 +754,20 @@ points to the same tree object as its grandparent.)
=== Counting Omitted Objects
We also have the capability to enumerate all objects which were omitted by a
-filter, like with `git log --filter=<spec> --filter-print-omitted`. Asking
-`traverse_commit_list_filtered()` to populate the `omitted` list means that our
-object walk does not perform any better than an unfiltered object walk; all
-reachable objects are walked in order to populate the list.
+filter, like with `git log --filter=<spec> --filter-print-omitted`. To do this,
+change `traverse_commit_list()` to `traverse_commit_list_filtered()`, which is
+able to populate an `omitted` list. Asking for this list of filtered objects
+may cause performance degradations, however, because in this case, despite
+filtering objects, the possibly much larger set of all reachable objects must
+be processed in order to populate that list.
First, add the `struct oidset` and related items we will use to iterate it:
----
+#include "oidset.h"
+
+...
+
static void walken_object_walk(
...
@@ -766,8 +780,9 @@ static void walken_object_walk(
...
----
-Modify the call to `traverse_commit_list_filtered()` to include your `omitted`
-object:
+Replace the call to `traverse_commit_list()` with
+`traverse_commit_list_filtered()` and pass a pointer to the `omitted` oidset
+defined and initialized above:
----
...
@@ -805,6 +820,10 @@ just walks of commits. First, we'll make our handlers chattier - modify
go:
----
+#include "hex.h"
+
+...
+
static void walken_show_commit(struct commit *cmt, void *buf)
{
trace_printf("commit: %s\n", oid_to_hex(&cmt->object.oid));
@@ -829,7 +848,7 @@ those lines without having to recompile.
With only that change, run again (but save yourself some scrollback):
----
-$ GIT_TRACE=1 ./bin-wrappers/git walken | head -n 10
+$ GIT_TRACE=1 ./bin-wrappers/git walken 2>&1 | head -n 10
----
Take a look at the top commit with `git show` and the object ID you printed; it
@@ -857,7 +876,7 @@ of the first handful:
----
$ make
-$ GIT_TRACE=1 ./bin-wrappers git walken | tail -n 10
+$ GIT_TRACE=1 ./bin-wrappers/git walken 2>&1 | tail -n 10
----
The last commit object given should have the same OID as the one we saw at the
diff --git a/Documentation/RelNotes/1.6.2.txt b/Documentation/RelNotes/1.6.2.txt
index 980adfb..166d73c 100644
--- a/Documentation/RelNotes/1.6.2.txt
+++ b/Documentation/RelNotes/1.6.2.txt
@@ -10,7 +10,7 @@ To ease the transition plan, the receiving repository of such a
push running this release will issue a big warning when the
configuration variable is missing. Please refer to:
- http://git.or.cz/gitwiki/GitFaq#non-bare
+ https://archive.kernel.org/oldwiki/git.wiki.kernel.org/index.php/GitFaq.html#non-bare
https://lore.kernel.org/git/7vbptlsuyv.fsf@gitster.siamese.dyndns.org/
for more details on the reason why this change is needed and the
diff --git a/Documentation/RelNotes/1.6.3.txt b/Documentation/RelNotes/1.6.3.txt
index 4bcff94..bbf177f 100644
--- a/Documentation/RelNotes/1.6.3.txt
+++ b/Documentation/RelNotes/1.6.3.txt
@@ -10,7 +10,7 @@ To ease the transition plan, the receiving repository of such a
push running this release will issue a big warning when the
configuration variable is missing. Please refer to:
- http://git.or.cz/gitwiki/GitFaq#non-bare
+ https://archive.kernel.org/oldwiki/git.wiki.kernel.org/index.php/GitFaq.html#non-bare
https://lore.kernel.org/git/7vbptlsuyv.fsf@gitster.siamese.dyndns.org/
for more details on the reason why this change is needed and the
diff --git a/Documentation/RelNotes/1.6.4.txt b/Documentation/RelNotes/1.6.4.txt
index a2a34b4..0fccfb0 100644
--- a/Documentation/RelNotes/1.6.4.txt
+++ b/Documentation/RelNotes/1.6.4.txt
@@ -10,7 +10,7 @@ To ease the transition plan, the receiving repository of such a
push running this release will issue a big warning when the
configuration variable is missing. Please refer to:
- http://git.or.cz/gitwiki/GitFaq#non-bare
+ https://archive.kernel.org/oldwiki/git.wiki.kernel.org/index.php/GitFaq.html#non-bare
https://lore.kernel.org/git/7vbptlsuyv.fsf@gitster.siamese.dyndns.org/
for more details on the reason why this change is needed and the
diff --git a/Documentation/RelNotes/1.6.5.txt b/Documentation/RelNotes/1.6.5.txt
index 6c7f7da..79cb1b2 100644
--- a/Documentation/RelNotes/1.6.5.txt
+++ b/Documentation/RelNotes/1.6.5.txt
@@ -21,7 +21,7 @@ To ease the transition plan, the receiving repository of such a
push running this release will issue a big warning when the
configuration variable is missing. Please refer to:
- http://git.or.cz/gitwiki/GitFaq#non-bare
+ https://archive.kernel.org/oldwiki/git.wiki.kernel.org/index.php/GitFaq.html#non-bare
https://lore.kernel.org/git/7vbptlsuyv.fsf@gitster.siamese.dyndns.org/
for more details on the reason why this change is needed and the
diff --git a/Documentation/RelNotes/1.6.6.txt b/Documentation/RelNotes/1.6.6.txt
index 3ed1e01..88b86a8 100644
--- a/Documentation/RelNotes/1.6.6.txt
+++ b/Documentation/RelNotes/1.6.6.txt
@@ -63,7 +63,7 @@ users will fare this time.
Please refer to:
- http://git.or.cz/gitwiki/GitFaq#non-bare
+ https://archive.kernel.org/oldwiki/git.wiki.kernel.org/index.php/GitFaq.html#non-bare
https://lore.kernel.org/git/7vbptlsuyv.fsf@gitster.siamese.dyndns.org/
for more details on the reason why this change is needed and the
diff --git a/Documentation/RelNotes/2.30.6.txt b/Documentation/RelNotes/2.30.6.txt
new file mode 100644
index 0000000..d649071
--- /dev/null
+++ b/Documentation/RelNotes/2.30.6.txt
@@ -0,0 +1,60 @@
+Git v2.30.6 Release Notes
+=========================
+
+This release addresses the security issues CVE-2022-39253 and
+CVE-2022-39260.
+
+Fixes since v2.30.5
+-------------------
+
+ * CVE-2022-39253:
+ When relying on the `--local` clone optimization, Git dereferences
+ symbolic links in the source repository before creating hardlinks
+ (or copies) of the dereferenced link in the destination repository.
+ This can lead to surprising behavior where arbitrary files are
+ present in a repository's `$GIT_DIR` when cloning from a malicious
+ repository.
+
+ Git will no longer dereference symbolic links via the `--local`
+ clone mechanism, and will instead refuse to clone repositories that
+ have symbolic links present in the `$GIT_DIR/objects` directory.
+
+ Additionally, the value of `protocol.file.allow` is changed to be
+ "user" by default.
+
+ * CVE-2022-39260:
+ An overly-long command string given to `git shell` can result in
+ overflow in `split_cmdline()`, leading to arbitrary heap writes and
+ remote code execution when `git shell` is exposed and the directory
+ `$HOME/git-shell-commands` exists.
+
+ `git shell` is taught to refuse interactive commands that are
+ longer than 4MiB in size. `split_cmdline()` is hardened to reject
+ inputs larger than 2GiB.
+
+Credit for finding CVE-2022-39253 goes to Cory Snider of Mirantis. The
+fix was authored by Taylor Blau, with help from Johannes Schindelin.
+
+Credit for finding CVE-2022-39260 goes to Kevin Backhouse of GitHub.
+The fix was authored by Kevin Backhouse, Jeff King, and Taylor Blau.
+
+
+Jeff King (2):
+ shell: add basic tests
+ shell: limit size of interactive commands
+
+Kevin Backhouse (1):
+ alias.c: reject too-long cmdline strings in split_cmdline()
+
+Taylor Blau (11):
+ builtin/clone.c: disallow `--local` clones with symlinks
+ t/lib-submodule-update.sh: allow local submodules
+ t/t1NNN: allow local submodules
+ t/2NNNN: allow local submodules
+ t/t3NNN: allow local submodules
+ t/t4NNN: allow local submodules
+ t/t5NNN: allow local submodules
+ t/t6NNN: allow local submodules
+ t/t7NNN: allow local submodules
+ t/t9NNN: allow local submodules
+ transport: make `protocol.file.allow` be "user" by default
diff --git a/Documentation/RelNotes/2.30.7.txt b/Documentation/RelNotes/2.30.7.txt
new file mode 100644
index 0000000..285beed
--- /dev/null
+++ b/Documentation/RelNotes/2.30.7.txt
@@ -0,0 +1,86 @@
+Git v2.30.7 Release Notes
+=========================
+
+This release addresses the security issues CVE-2022-41903 and
+CVE-2022-23521.
+
+
+Fixes since v2.30.6
+-------------------
+
+ * CVE-2022-41903:
+
+ git log has the ability to display commits using an arbitrary
+ format with its --format specifiers. This functionality is also
+ exposed to git archive via the export-subst gitattribute.
+
+ When processing the padding operators (e.g., %<(, %<|(, %>(,
+ %>>(, or %><( ), an integer overflow can occur in
+ pretty.c::format_and_pad_commit() where a size_t is improperly
+ stored as an int, and then added as an offset to a subsequent
+ memcpy() call.
+
+ This overflow can be triggered directly by a user running a
+ command which invokes the commit formatting machinery (e.g., git
+ log --format=...). It may also be triggered indirectly through
+ git archive via the export-subst mechanism, which expands format
+ specifiers inside of files within the repository during a git
+ archive.
+
+ This integer overflow can result in arbitrary heap writes, which
+ may result in remote code execution.
+
+* CVE-2022-23521:
+
+ gitattributes are a mechanism to allow defining attributes for
+ paths. These attributes can be defined by adding a `.gitattributes`
+ file to the repository, which contains a set of file patterns and
+ the attributes that should be set for paths matching this pattern.
+
+ When parsing gitattributes, multiple integer overflows can occur
+ when there is a huge number of path patterns, a huge number of
+ attributes for a single pattern, or when the declared attribute
+ names are huge.
+
+ These overflows can be triggered via a crafted `.gitattributes` file
+ that may be part of the commit history. Git silently splits lines
+ longer than 2KB when parsing gitattributes from a file, but not when
+ parsing them from the index. Consequentially, the failure mode
+ depends on whether the file exists in the working tree, the index or
+ both.
+
+ This integer overflow can result in arbitrary heap reads and writes,
+ which may result in remote code execution.
+
+Credit for finding CVE-2022-41903 goes to Joern Schneeweisz of GitLab.
+An initial fix was authored by Markus Vervier of X41 D-Sec. Credit for
+finding CVE-2022-23521 goes to Markus Vervier and Eric Sesterhenn of X41
+D-Sec. This work was sponsored by OSTIF.
+
+The proposed fixes have been polished and extended to cover additional
+findings by Patrick Steinhardt of GitLab, with help from others on the
+Git security mailing list.
+
+Patrick Steinhardt (21):
+ attr: fix overflow when upserting attribute with overly long name
+ attr: fix out-of-bounds read with huge attribute names
+ attr: fix integer overflow when parsing huge attribute names
+ attr: fix out-of-bounds write when parsing huge number of attributes
+ attr: fix out-of-bounds read with unreasonable amount of patterns
+ attr: fix integer overflow with more than INT_MAX macros
+ attr: harden allocation against integer overflows
+ attr: fix silently splitting up lines longer than 2048 bytes
+ attr: ignore attribute lines exceeding 2048 bytes
+ attr: ignore overly large gitattributes files
+ pretty: fix out-of-bounds write caused by integer overflow
+ pretty: fix out-of-bounds read when left-flushing with stealing
+ pretty: fix out-of-bounds read when parsing invalid padding format
+ pretty: fix adding linefeed when placeholder is not expanded
+ pretty: fix integer overflow in wrapping format
+ utf8: fix truncated string lengths in `utf8_strnwidth()`
+ utf8: fix returning negative string width
+ utf8: fix overflow when returning string width
+ utf8: fix checking for glyph width in `strbuf_utf8_replace()`
+ utf8: refactor `strbuf_utf8_replace` to not rely on preallocated buffer
+ pretty: restrict input lengths for padding and wrapping formats
+
diff --git a/Documentation/RelNotes/2.30.8.txt b/Documentation/RelNotes/2.30.8.txt
new file mode 100644
index 0000000..5ed3efb
--- /dev/null
+++ b/Documentation/RelNotes/2.30.8.txt
@@ -0,0 +1,51 @@
+Git v2.30.8 Release Notes
+=========================
+
+This release addresses the security issues CVE-2023-22490 and
+CVE-2023-23946.
+
+
+Fixes since v2.30.7
+-------------------
+
+ * CVE-2023-22490:
+
+ Using a specially-crafted repository, Git can be tricked into using
+ its local clone optimization even when using a non-local transport.
+ Though Git will abort local clones whose source $GIT_DIR/objects
+ directory contains symbolic links (c.f., CVE-2022-39253), the objects
+ directory itself may still be a symbolic link.
+
+ These two may be combined to include arbitrary files based on known
+ paths on the victim's filesystem within the malicious repository's
+ working copy, allowing for data exfiltration in a similar manner as
+ CVE-2022-39253.
+
+ * CVE-2023-23946:
+
+ By feeding a crafted input to "git apply", a path outside the
+ working tree can be overwritten as the user who is running "git
+ apply".
+
+ * A mismatched type in `attr.c::read_attr_from_index()` which could
+ cause Git to errantly reject attributes on Windows and 32-bit Linux
+ has been corrected.
+
+Credit for finding CVE-2023-22490 goes to yvvdwf, and the fix was
+developed by Taylor Blau, with additional help from others on the
+Git security mailing list.
+
+Credit for finding CVE-2023-23946 goes to Joern Schneeweisz, and the
+fix was developed by Patrick Steinhardt.
+
+
+Johannes Schindelin (1):
+ attr: adjust a mismatched data type
+
+Patrick Steinhardt (1):
+ apply: fix writing behind newly created symbolic links
+
+Taylor Blau (3):
+ t5619: demonstrate clone_local() with ambiguous transport
+ clone: delay picking a transport until after get_repo_path()
+ dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
diff --git a/Documentation/RelNotes/2.30.9.txt b/Documentation/RelNotes/2.30.9.txt
new file mode 100644
index 0000000..708d626
--- /dev/null
+++ b/Documentation/RelNotes/2.30.9.txt
@@ -0,0 +1,43 @@
+Git v2.30.9 Release Notes
+=========================
+
+This release addresses the security issues CVE-2023-25652,
+CVE-2023-25815, and CVE-2023-29007.
+
+
+Fixes since v2.30.8
+-------------------
+
+ * CVE-2023-25652:
+
+ By feeding specially crafted input to `git apply --reject`, a
+ path outside the working tree can be overwritten with partially
+ controlled contents (corresponding to the rejected hunk(s) from
+ the given patch).
+
+ * CVE-2023-25815:
+
+ When Git is compiled with runtime prefix support and runs without
+ translated messages, it still used the gettext machinery to
+ display messages, which subsequently potentially looked for
+ translated messages in unexpected places. This allowed for
+ malicious placement of crafted messages.
+
+ * CVE-2023-29007:
+
+ When renaming or deleting a section from a configuration file,
+ certain malicious configuration values may be misinterpreted as
+ the beginning of a new configuration section, leading to arbitrary
+ configuration injection.
+
+Credit for finding CVE-2023-25652 goes to Ry0taK, and the fix was
+developed by Taylor Blau, Junio C Hamano and Johannes Schindelin,
+with the help of Linus Torvalds.
+
+Credit for finding CVE-2023-25815 goes to Maxime Escourbiac and
+Yassine BENGANA of Michelin, and the fix was developed by Johannes
+Schindelin.
+
+Credit for finding CVE-2023-29007 goes to André Baptista and Vítor Pinho
+of Ethiack, and the fix was developed by Taylor Blau, and Johannes
+Schindelin, with help from Jeff King, and Patrick Steinhardt.
diff --git a/Documentation/RelNotes/2.31.5.txt b/Documentation/RelNotes/2.31.5.txt
new file mode 100644
index 0000000..0d87e6e
--- /dev/null
+++ b/Documentation/RelNotes/2.31.5.txt
@@ -0,0 +1,5 @@
+Git v2.31.5 Release Notes
+=========================
+
+This release merges the security fix that appears in v2.30.6; see
+the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.31.6.txt b/Documentation/RelNotes/2.31.6.txt
new file mode 100644
index 0000000..425a518
--- /dev/null
+++ b/Documentation/RelNotes/2.31.6.txt
@@ -0,0 +1,5 @@
+Git v2.31.6 Release Notes
+=========================
+
+This release merges the security fix that appears in v2.30.7; see
+the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.31.7.txt b/Documentation/RelNotes/2.31.7.txt
new file mode 100644
index 0000000..dd44d5b
--- /dev/null
+++ b/Documentation/RelNotes/2.31.7.txt
@@ -0,0 +1,6 @@
+Git v2.31.7 Release Notes
+=========================
+
+This release merges up the fixes that appear in v2.30.8 to
+address the security issues CVE-2023-22490 and CVE-2023-23946;
+see the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.31.8.txt b/Documentation/RelNotes/2.31.8.txt
new file mode 100644
index 0000000..0aa3080
--- /dev/null
+++ b/Documentation/RelNotes/2.31.8.txt
@@ -0,0 +1,6 @@
+Git v2.31.8 Release Notes
+=========================
+
+This release merges the fixes that appear in v2.30.9 to address the
+security issues CVE-2023-25652, CVE-2023-25815, and CVE-2023-29007;
+see the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.32.4.txt b/Documentation/RelNotes/2.32.4.txt
new file mode 100644
index 0000000..76c67b2
--- /dev/null
+++ b/Documentation/RelNotes/2.32.4.txt
@@ -0,0 +1,5 @@
+Git v2.32.4 Release Notes
+=========================
+
+This release merges the security fix that appears in v2.30.6; see
+the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.32.5.txt b/Documentation/RelNotes/2.32.5.txt
new file mode 100644
index 0000000..a8cad1a
--- /dev/null
+++ b/Documentation/RelNotes/2.32.5.txt
@@ -0,0 +1,8 @@
+Git v2.32.5 Release Notes
+=========================
+
+This release merges the security fix that appears in v2.30.7; see
+the release notes for that version for details.
+
+In addition, included are additional code for "git fsck" to check
+for questionable .gitattributes files.
diff --git a/Documentation/RelNotes/2.32.6.txt b/Documentation/RelNotes/2.32.6.txt
new file mode 100644
index 0000000..fd65961
--- /dev/null
+++ b/Documentation/RelNotes/2.32.6.txt
@@ -0,0 +1,6 @@
+Git v2.32.6 Release Notes
+=========================
+
+This release merges up the fixes that appear in v2.30.8 and v2.31.7
+to address the security issues CVE-2023-22490 and CVE-2023-23946;
+see the release notes for these versions for details.
diff --git a/Documentation/RelNotes/2.32.7.txt b/Documentation/RelNotes/2.32.7.txt
new file mode 100644
index 0000000..7bb3538
--- /dev/null
+++ b/Documentation/RelNotes/2.32.7.txt
@@ -0,0 +1,7 @@
+Git v2.32.7 Release Notes
+=========================
+
+This release merges the fixes that appear in v2.30.9 and v2.31.8 to
+address the security issues CVE-2023-25652, CVE-2023-25815, and
+CVE-2023-29007; see the release notes for these versions for
+details.
diff --git a/Documentation/RelNotes/2.33.5.txt b/Documentation/RelNotes/2.33.5.txt
new file mode 100644
index 0000000..a636526
--- /dev/null
+++ b/Documentation/RelNotes/2.33.5.txt
@@ -0,0 +1,5 @@
+Git v2.33.5 Release Notes
+=========================
+
+This release merges the security fix that appears in v2.30.6; see
+the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.33.6.txt b/Documentation/RelNotes/2.33.6.txt
new file mode 100644
index 0000000..b63e4e6
--- /dev/null
+++ b/Documentation/RelNotes/2.33.6.txt
@@ -0,0 +1,5 @@
+Git v2.33.6 Release Notes
+=========================
+
+This release merges the security fix that appears in v2.30.7; see
+the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.33.7.txt b/Documentation/RelNotes/2.33.7.txt
new file mode 100644
index 0000000..078a837
--- /dev/null
+++ b/Documentation/RelNotes/2.33.7.txt
@@ -0,0 +1,7 @@
+Git v2.33.7 Release Notes
+=========================
+
+This release merges up the fixes that appear in v2.30.8, v2.31.7
+and v2.32.6 to address the security issues CVE-2023-22490 and
+CVE-2023-23946; see the release notes for these versions for
+details.
diff --git a/Documentation/RelNotes/2.33.8.txt b/Documentation/RelNotes/2.33.8.txt
new file mode 100644
index 0000000..d8cf4c7
--- /dev/null
+++ b/Documentation/RelNotes/2.33.8.txt
@@ -0,0 +1,7 @@
+Git v2.33.8 Release Notes
+=========================
+
+This release merges the fixes that appear in v2.30.9, v2.31.8 and
+v2.32.7 to address the security issues CVE-2023-25652,
+CVE-2023-25815, and CVE-2023-29007; see the release notes for these
+versions for details.
diff --git a/Documentation/RelNotes/2.34.5.txt b/Documentation/RelNotes/2.34.5.txt
new file mode 100644
index 0000000..0e89992
--- /dev/null
+++ b/Documentation/RelNotes/2.34.5.txt
@@ -0,0 +1,5 @@
+Git v2.34.5 Release Notes
+=========================
+
+This release merges the security fix that appears in v2.30.6; see
+the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.34.6.txt b/Documentation/RelNotes/2.34.6.txt
new file mode 100644
index 0000000..b32080d
--- /dev/null
+++ b/Documentation/RelNotes/2.34.6.txt
@@ -0,0 +1,5 @@
+Git v2.34.6 Release Notes
+=========================
+
+This release merges the security fix that appears in v2.30.7; see
+the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.34.7.txt b/Documentation/RelNotes/2.34.7.txt
new file mode 100644
index 0000000..88898ad
--- /dev/null
+++ b/Documentation/RelNotes/2.34.7.txt
@@ -0,0 +1,7 @@
+Git v2.34.7 Release Notes
+=========================
+
+This release merges up the fixes that appear in v2.30.8, v2.31.7,
+v2.32.6 and v2.33.7 to address the security issues CVE-2023-22490
+and CVE-2023-23946; see the release notes for these versions
+for details.
diff --git a/Documentation/RelNotes/2.34.8.txt b/Documentation/RelNotes/2.34.8.txt
new file mode 100644
index 0000000..2b5bd7d
--- /dev/null
+++ b/Documentation/RelNotes/2.34.8.txt
@@ -0,0 +1,7 @@
+Git v2.34.8 Release Notes
+=========================
+
+This release merges the fixes that appear in v2.30.9, v2.31.8,
+v2.32.7 and v2.33.8 to address the security issues CVE-2023-25652,
+CVE-2023-25815, and CVE-2023-29007; see the release notes for these
+versions for details.
diff --git a/Documentation/RelNotes/2.35.5.txt b/Documentation/RelNotes/2.35.5.txt
new file mode 100644
index 0000000..e19cc48
--- /dev/null
+++ b/Documentation/RelNotes/2.35.5.txt
@@ -0,0 +1,5 @@
+Git v2.35.5 Release Notes
+=========================
+
+This release merges the security fix that appears in v2.30.6; see
+the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.35.6.txt b/Documentation/RelNotes/2.35.6.txt
new file mode 100644
index 0000000..e7ca57b
--- /dev/null
+++ b/Documentation/RelNotes/2.35.6.txt
@@ -0,0 +1,5 @@
+Git v2.35.6 Release Notes
+=========================
+
+This release merges the security fix that appears in v2.30.7; see
+the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.35.7.txt b/Documentation/RelNotes/2.35.7.txt
new file mode 100644
index 0000000..42baabf
--- /dev/null
+++ b/Documentation/RelNotes/2.35.7.txt
@@ -0,0 +1,7 @@
+Git v2.35.7 Release Notes
+=========================
+
+This release merges up the fixes that appear in v2.30.8, v2.31.7,
+v2.32.6, v2.33.7 and v2.34.7 to address the security issues
+CVE-2023-22490 and CVE-2023-23946; see the release notes for
+these versions for details.
diff --git a/Documentation/RelNotes/2.35.8.txt b/Documentation/RelNotes/2.35.8.txt
new file mode 100644
index 0000000..3c9c094
--- /dev/null
+++ b/Documentation/RelNotes/2.35.8.txt
@@ -0,0 +1,7 @@
+Git v2.35.8 Release Notes
+=========================
+
+This release merges the fixes that appear in v2.30.9, v2.31.8,
+v2.32.7, v2.33.8 and v2.34.8 to address the security issues
+CVE-2023-25652, CVE-2023-25815, and CVE-2023-29007; see the release
+notes for these versions for details.
diff --git a/Documentation/RelNotes/2.36.3.txt b/Documentation/RelNotes/2.36.3.txt
new file mode 100644
index 0000000..56db77b
--- /dev/null
+++ b/Documentation/RelNotes/2.36.3.txt
@@ -0,0 +1,5 @@
+Git v2.36.3 Release Notes
+=========================
+
+This release merges the security fix that appears in v2.30.6; see
+the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.36.4.txt b/Documentation/RelNotes/2.36.4.txt
new file mode 100644
index 0000000..58fb93a
--- /dev/null
+++ b/Documentation/RelNotes/2.36.4.txt
@@ -0,0 +1,5 @@
+Git v2.36.4 Release Notes
+=========================
+
+This release merges the security fix that appears in v2.30.7; see
+the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.36.5.txt b/Documentation/RelNotes/2.36.5.txt
new file mode 100644
index 0000000..8a098c7
--- /dev/null
+++ b/Documentation/RelNotes/2.36.5.txt
@@ -0,0 +1,7 @@
+Git v2.36.5 Release Notes
+=========================
+
+This release merges up the fixes that appear in v2.30.8, v2.31.7,
+v2.32.6, v2.33.7, v2.34.7 and v2.35.7 to address the security
+issues CVE-2023-22490 and CVE-2023-23946; see the release notes
+for these versions for details.
diff --git a/Documentation/RelNotes/2.36.6.txt b/Documentation/RelNotes/2.36.6.txt
new file mode 100644
index 0000000..e1edebc
--- /dev/null
+++ b/Documentation/RelNotes/2.36.6.txt
@@ -0,0 +1,7 @@
+Git v2.36.6 Release Notes
+=========================
+
+This release merges the fixes that appear in v2.30.9, v2.31.8,
+v2.32.7, v2.33.8, v2.34.8 and v2.35.8 to address the security issues
+CVE-2023-25652, CVS-2023-25815, and CVE-2023-29007; see the release
+notes for these versions for details.
diff --git a/Documentation/RelNotes/2.37.3.txt b/Documentation/RelNotes/2.37.3.txt
new file mode 100644
index 0000000..d66689e
--- /dev/null
+++ b/Documentation/RelNotes/2.37.3.txt
@@ -0,0 +1,46 @@
+Git 2.37.3 Release Notes
+========================
+
+This primarily is to backport various fixes accumulated on the 'master'
+front since 2.37.2.
+
+Fixes since v2.37.2
+-------------------
+
+ * The build procedure for Windows that uses CMake has been updated to
+ pick up the shell interpreter from local installation location.
+
+ * Conditionally allow building Python interpreter on Windows
+
+ * Fix to lstat() emulation on Windows.
+
+ * Older gcc with -Wall complains about the universal zero initializer
+ "struct s = { 0 };" idiom, which makes developers' lives
+ inconvenient (as -Werror is enabled by DEVELOPER=YesPlease). The
+ build procedure has been tweaked to help these compilers.
+
+ * Plug memory leaks in the failure code path in the "merge-ort" merge
+ strategy backend.
+
+ * Avoid repeatedly running getconf to ask libc version in the test
+ suite, and instead just as it once per script.
+
+ * Platform-specific code that determines if a directory is OK to use
+ as a repository has been taught to report more details, especially
+ on Windows.
+
+ * "vimdiff3" regression has been corrected.
+
+ * "git fsck" reads mode from tree objects but canonicalizes the mode
+ before passing it to the logic to check object sanity, which has
+ hid broken tree objects from the checking logic. This has been
+ corrected, but to help exiting projects with broken tree objects
+ that they cannot fix retroactively, the severity of anomalies this
+ code detects has been demoted to "info" for now.
+
+ * Fixes to sparse index compatibility work for "reset" and "checkout"
+ commands.
+
+ * Documentation for "git add --renormalize" has been improved.
+
+Also contains other minor documentation updates and code clean-ups.
diff --git a/Documentation/RelNotes/2.37.4.txt b/Documentation/RelNotes/2.37.4.txt
new file mode 100644
index 0000000..e42a5c1
--- /dev/null
+++ b/Documentation/RelNotes/2.37.4.txt
@@ -0,0 +1,65 @@
+Git 2.37.4 Release Notes
+========================
+
+This primarily is to backport various fixes accumulated on the 'master'
+front since 2.37.3, and also includes the same security fixes as in
+v2.30.6.
+
+Fixes since v2.37.3
+-------------------
+
+ * CVE-2022-39253:
+ When relying on the `--local` clone optimization, Git dereferences
+ symbolic links in the source repository before creating hardlinks
+ (or copies) of the dereferenced link in the destination repository.
+ This can lead to surprising behavior where arbitrary files are
+ present in a repository's `$GIT_DIR` when cloning from a malicious
+ repository.
+
+ Git will no longer dereference symbolic links via the `--local`
+ clone mechanism, and will instead refuse to clone repositories that
+ have symbolic links present in the `$GIT_DIR/objects` directory.
+
+ Additionally, the value of `protocol.file.allow` is changed to be
+ "user" by default.
+
+ Credit for finding CVE-2022-39253 goes to Cory Snider of Mirantis.
+ The fix was authored by Taylor Blau, with help from Johannes
+ Schindelin.
+
+ * CVE-2022-39260:
+ An overly-long command string given to `git shell` can result in
+ overflow in `split_cmdline()`, leading to arbitrary heap writes and
+ remote code execution when `git shell` is exposed and the directory
+ `$HOME/git-shell-commands` exists.
+
+ `git shell` is taught to refuse interactive commands that are
+ longer than 4MiB in size. `split_cmdline()` is hardened to reject
+ inputs larger than 2GiB.
+
+ Credit for finding CVE-2022-39260 goes to Kevin Backhouse of
+ GitHub. The fix was authored by Kevin Backhouse, Jeff King, and
+ Taylor Blau.
+
+ * An earlier optimization discarded a tree-object buffer that is
+ still in use, which has been corrected.
+
+ * Fix deadlocks between main Git process and subprocess spawned via
+ the pipe_command() API, that can kill "git add -p" that was
+ reimplemented in C recently.
+
+ * xcalloc(), imitating calloc(), takes "number of elements of the
+ array", and "size of a single element", in this order. A call that
+ does not follow this ordering has been corrected.
+
+ * The preload-index codepath made copies of pathspec to give to
+ multiple threads, which were left leaked.
+
+ * Update the version of Ubuntu used for GitHub Actions CI from 18.04
+ to 22.04.
+
+ * The auto-stashed local changes created by "git merge --autostash"
+ was mixed into a conflicted state left in the working tree, which
+ has been corrected.
+
+Also contains other minor documentation updates and code clean-ups.
diff --git a/Documentation/RelNotes/2.37.5.txt b/Documentation/RelNotes/2.37.5.txt
new file mode 100644
index 0000000..faa1447
--- /dev/null
+++ b/Documentation/RelNotes/2.37.5.txt
@@ -0,0 +1,5 @@
+Git v2.37.5 Release Notes
+=========================
+
+This release merges the security fix that appears in v2.30.7; see
+the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.37.6.txt b/Documentation/RelNotes/2.37.6.txt
new file mode 100644
index 0000000..51dc149
--- /dev/null
+++ b/Documentation/RelNotes/2.37.6.txt
@@ -0,0 +1,7 @@
+Git v2.37.6 Release Notes
+=========================
+
+This release merges up the fixes that appear in v2.30.8, v2.31.7,
+v2.32.6, v2.33.7, v2.34.7, v2.35.7 and v2.36.5 to address the
+security issues CVE-2023-22490 and CVE-2023-23946; see the release
+notes for these versions for details.
diff --git a/Documentation/RelNotes/2.37.7.txt b/Documentation/RelNotes/2.37.7.txt
new file mode 100644
index 0000000..4b8165f
--- /dev/null
+++ b/Documentation/RelNotes/2.37.7.txt
@@ -0,0 +1,7 @@
+Git v2.37.7 Release Notes
+=========================
+
+This release merges up the fix that appears in v2.30.9, v2.31.8,
+v2.32.7, v2.33.8, v2.34.8, v2.35.8 and v2.36.6 to address the
+security issues CVE-2023-25652, CVE-2023-25815, and CVE-2023-29007;
+see the release notes for these versions for details.
diff --git a/Documentation/RelNotes/2.38.0.txt b/Documentation/RelNotes/2.38.0.txt
new file mode 100644
index 0000000..870581f
--- /dev/null
+++ b/Documentation/RelNotes/2.38.0.txt
@@ -0,0 +1,404 @@
+Git v2.38 Release Notes
+=======================
+
+UI, Workflows & Features
+
+ * "git remote show [-n] frotz" now pays attention to negative
+ pathspec.
+
+ * "git push" sometimes performs poorly when reachability bitmaps are
+ used, even in a repository where other operations are helped by
+ bitmaps. The push.useBitmaps configuration variable is introduced
+ to allow disabling use of reachability bitmaps only for "git push".
+
+ * "git grep -m<max-hits>" is a way to limit the hits shown per file.
+
+ * "git merge-tree" learned a new mode where it takes two commits and
+ computes a tree that would result in the merge commit, if the
+ histories leading to these two commits were to be merged.
+
+ * "git mv A B" in a sparsely populated working tree can be asked to
+ move a path between directories that are "in cone" (i.e. expected
+ to be materialized in the working tree) and "out of cone"
+ (i.e. expected to be hidden). The handling of such cases has been
+ improved.
+
+ * Earlier, HTTP transport clients learned to tell the server side
+ what locale they are in by sending Accept-Language HTTP header, but
+ this was done only for some requests but not others.
+
+ * Introduce a safe.barerepository configuration variable that
+ allows users to forbid discovery of bare repositories.
+
+ * Various messages that come from the pack-bitmap codepaths have been
+ tweaked.
+
+ * "git rebase -i" learns to update branches whose tip appear in the
+ rebased range with "--update-refs" option.
+
+ * "git ls-files" learns the "--format" option to tweak its output.
+
+ * "git cat-file" learned an option to use the mailmap when showing
+ commit and tag objects.
+
+ * When "git merge" finds that it cannot perform a merge, it should
+ restore the working tree to the state before the command was
+ initiated, but in some corner cases it didn't.
+
+ * Operating modes like "--batch" of "git cat-file" command learned to
+ take NUL-terminated input, instead of one-item-per-line.
+
+ * "git rm" has become more aware of the sparse-index feature.
+
+ * "git rev-list --disk-usage" learned to take an optional value
+ "human" to show the reported value in human-readable format, like
+ "3.40MiB".
+
+ * The "diagnose" feature to create a zip archive for diagnostic
+ material has been lifted from "scalar" and made into a feature of
+ "git bugreport".
+
+ * The namespaces used by "log --decorate" from "refs/" hierarchy by
+ default has been tightened.
+
+ * "git rev-list --ancestry-path=C A..B" is a natural extension of
+ "git rev-list A..B"; instead of choosing a subset of A..B to those
+ that have ancestry relationship with A, it lets a subset with
+ ancestry relationship with C.
+
+ * "scalar" now enables built-in fsmonitor on enlisted repositories,
+ when able.
+
+ * The bash prompt (in contrib/) learned to optionally indicate when
+ the index is unmerged.
+
+ * "git clone" command learned the "--bundle-uri" option to coordinate
+ with hosting sites the use of pre-prepared bundle files.
+
+ * "git range-diff" learned to honor pathspec argument if given.
+
+ * "git format-patch --from=<ident>" can be told to add an in-body
+ "From:" line even for commits that are authored by the given
+ <ident> with "--force-in-body-from" option.
+
+ * The built-in fsmonitor refuses to work on a network mounted
+ repositories; a configuration knob for users to override this has
+ been introduced.
+
+ * The "scalar" addition from Microsoft is now part of the core Git
+ installation.
+
+
+Performance, Internal Implementation, Development Support etc.
+
+ * Collection of what is referenced by objects in promisor packs have
+ been optimized to inspect these objects in the in-pack order.
+
+ * Introduce a helper to see if a branch is already being worked on
+ (hence should not be newly checked out in a working tree), which
+ performs much better than the existing find_shared_symref() to
+ replace many uses of the latter.
+
+ * Teach "git archive" to (optionally and then by default) avoid
+ spawning an external "gzip" process when creating ".tar.gz" (and
+ ".tgz") archives.
+
+ * Allow large objects read from a packstream to be streamed into a
+ loose object file straight, without having to keep it in-core as a
+ whole.
+
+ * Further preparation to turn git-submodule.sh into a builtin
+ continues.
+
+ * Apply Coccinelle rule to turn raw memmove() into MOVE_ARRAY() cpp
+ macro, which would improve maintainability and readability.
+
+ * Teach "make all" to build gitweb as well.
+
+ * Tweak tests so that they still work when the "git init" template
+ did not create .git/info directory.
+
+ * Add Coccinelle rules to detect the pattern of initializing and then
+ finalizing a structure without using it in between at all, which
+ happens after code restructuring and the compilers fail to
+ recognize as an unused variable.
+
+ * The code to convert between GPG trust level strings and internal
+ constants we use to represent them have been cleaned up.
+
+ * Support for libnettle as SHA256 implementation has been added.
+
+ * The way "git multi-pack" uses parse-options API has been improved.
+
+ * A Coccinelle rule (in contrib/) to encourage use of COPY_ARRAY
+ macro has been improved.
+
+ * API tweak to make it easier to run fuzz testing on commit-graph parser.
+
+ * Omit fsync-related trace2 entries when their values are all zero.
+
+ * The codepath to write multi-pack index has been taught to release a
+ large chunk of memory that holds an array of objects in the packs,
+ as soon as it is done with the array, to reduce memory consumption.
+
+ * Add a level of redirection to array allocation API in xdiff part,
+ to make it easier to share with the libgit2 project.
+
+ * "git fetch" client logs the partial clone filter used in the trace2
+ output.
+
+ * The "bundle URI" design gets documented.
+
+ * The common ancestor negotiation exchange during a "git fetch"
+ session now leaves trace log.
+
+ * Test portability improvements.
+ (merge 4d1d843be7 mt/rot13-in-c later to maint).
+
+ * The "subcommand" mode is introduced to parse-options API and update
+ the command line parser of Git commands with subcommands.
+
+ * The pack bitmap file gained a bitmap-lookup table to speed up
+ locating the necessary bitmap for a given commit.
+
+ * The assembly version of SHA-1 implementation for PPC has been
+ removed.
+
+ * The server side that responds to "git fetch" and "git clone"
+ request has been optimized by allowing it to send objects in its
+ object store without recomputing and validating the object names.
+
+ * Annotate function parameters that are not used (but cannot be
+ removed for structural reasons), to prepare us to later compile
+ with -Wunused warning turned on.
+
+ * Share the text used to explain configuration variables used by "git
+ <subcmd>" in "git help <subcmd>" with the text from "git help config".
+
+ * "git mv A B" in a sparsely populated working tree can be asked to
+ move a path from a directory that is "in cone" to another directory
+ that is "out of cone". Handling of such a case has been improved.
+
+ * The chainlint script for our tests has been revamped.
+
+
+Fixes since v2.37
+-----------------
+
+ * Rewrite of "git add -i" in C that appeared in Git 2.25 didn't
+ correctly record a removed file to the index, which was fixed.
+
+ * Certain diff options are currently ignored when combined-diff is
+ shown; mark them as incompatible with the feature.
+
+ * Adjust technical/bitmap-format to be formatted by AsciiDoc, and
+ add some missing information to the documentation.
+
+ * Fixes for tests when the source directory has unusual characters in
+ its path, e.g. whitespaces, double-quotes, etc.
+
+ * "git mktree --missing" lazily fetched objects that are missing from
+ the local object store, which was totally unnecessary for the purpose
+ of creating the tree object(s) from its input.
+
+ * Give _() markings to fatal/warning/usage: labels that are shown in
+ front of these messages.
+
+ * References to commands-to-be-typed-literally in "git rebase"
+ documentation mark-up have been corrected.
+
+ * In a non-bare repository, the behavior of Git when the
+ core.worktree configuration variable points at a directory that has
+ a repository as its subdirectory, regressed in Git 2.27 days.
+
+ * Recent update to vimdiff layout code has been made more robust
+ against different end-user vim settings.
+
+ * Plug various memory leaks, both in the main code and in test-tool
+ commands.
+
+ * Fixes a long-standing corner case bug around directory renames in
+ the merge-ort strategy.
+
+ * The resolve-undo information in the index was not protected against
+ GC, which has been corrected.
+
+ * A corner case bug where lazily fetching objects from a promisor
+ remote resulted in infinite recursion has been corrected.
+
+ * "git clone" from a repository with some ref whose HEAD is unborn
+ did not set the HEAD in the resulting repository correctly, which
+ has been corrected.
+
+ * An earlier attempt to plug leaks placed a clean-up label to jump to
+ at a bogus place, which as been corrected.
+
+ * Variable quoting fix in the vimdiff driver of "git mergetool"
+
+ * "git shortlog -n" relied on the underlying qsort() to be stable,
+ which shouldn't have. Fixed.
+
+ * A fix for a regression in test framework.
+
+ * mkstemp() emulation on Windows has been improved.
+
+ * Add missing documentation for "include" and "includeIf" features in
+ "git config" file format, which incidentally teaches the command
+ line completion to include them in its offerings.
+
+ * Avoid "white/black-list" in documentation and code comments.
+
+ * Workaround for a compiler warning against use of die() in
+ osx-keychain (in contrib/).
+
+ * Workaround for a false positive compiler warning.
+
+ * "git p4" working on UTF-16 files on Windows did not implement
+ CRLF-to-LF conversion correctly, which has been corrected.
+
+ * "git p4" did not handle non-ASCII client name well, which has been
+ corrected.
+
+ * "rerere-train" script (in contrib/) used to honor commit.gpgSign
+ while recreating the throw-away merges.
+
+ * "git checkout" miscounted the paths it updated, which has been
+ corrected.
+
+ * Fix for a bug that makes write-tree to fail to write out a
+ non-existent index as a tree, introduced in 2.37.
+
+ * There was a bug in the codepath to upgrade generation information
+ in commit-graph from v1 to v2 format, which has been corrected.
+
+ * Gitweb had legacy URL shortener that is specific to the way
+ projects hosted on kernel.org used to (but no longer) work, which
+ has been removed.
+
+ * Fix build procedure for Windows that uses CMake so that it can pick
+ up the shell interpreter from local installation location.
+
+ * Conditionally allow building Python interpreter on Windows
+
+ * Fix to lstat() emulation on Windows.
+
+ * Older gcc with -Wall complains about the universal zero initializer
+ "struct s = { 0 };" idiom, which makes developers' lives
+ inconvenient (as -Werror is enabled by DEVELOPER=YesPlease). The
+ build procedure has been tweaked to help these compilers.
+
+ * Plug memory leaks in the failure code path in the "merge-ort" merge
+ strategy backend.
+
+ * "git symbolic-ref symref non..sen..se" is now diagnosed as an error.
+
+ * A follow-up fix to a fix for a regression in 2.36 around hooks.
+
+ * Avoid repeatedly running getconf to ask libc version in the test
+ suite, and instead just as it once per script.
+
+ * Platform-specific code that determines if a directory is OK to use
+ as a repository has been taught to report more details, especially
+ on Windows.
+
+ * "vimdiff3" regression fix.
+
+ * "git fsck" reads mode from tree objects but canonicalizes the mode
+ before passing it to the logic to check object sanity, which has
+ hid broken tree objects from the checking logic. This has been
+ corrected, but to help existing projects with broken tree objects
+ that they cannot fix retroactively, the severity of anomalies this
+ code detects has been demoted to "info" for now.
+
+ * Fixes to sparse index compatibility work for "reset" and "checkout"
+ commands.
+
+ * An earlier optimization discarded a tree-object buffer that is
+ still in use, which has been corrected.
+
+ * Fix deadlocks between main Git process and subprocess spawned via
+ the pipe_command() API, that can kill "git add -p" that was
+ reimplemented in C recently.
+
+ * The sequencer machinery translated messages left in the reflog by
+ mistake, which has been corrected.
+
+ * xcalloc(), imitating calloc(), takes "number of elements of the
+ array", and "size of a single element", in this order. A call that
+ does not follow this ordering has been corrected.
+
+ * The preload-index codepath made copies of pathspec to give to
+ multiple threads, which were left leaked.
+
+ * Update the version of Ubuntu used for GitHub Actions CI from 18.04
+ to 22.04.
+
+ * The auto-stashed local changes created by "git merge --autostash"
+ was mixed into a conflicted state left in the working tree, which
+ has been corrected.
+
+ * Multi-pack index got corrupted when preferred pack changed from one
+ pack to another in a certain way, which has been corrected.
+ (merge 99e4d084ff tb/midx-with-changing-preferred-pack-fix later to maint).
+
+ * The clean-up of temporary files created via mks_tempfile_dt() was
+ racy and attempted to unlink() the leading directory when signals
+ are involved, which has been corrected.
+ (merge babe2e0559 rs/tempfile-cleanup-race-fix later to maint).
+
+ * FreeBSD portability fix for "git maintenance" that spawns "crontab"
+ to schedule tasks.
+ (merge ee69e7884e bc/gc-crontab-fix later to maint).
+
+ * Those who use diff-so-fancy as the diff-filter noticed a regression
+ or two in the code that parses the diff output in the built-in
+ version of "add -p", which has been corrected.
+ (merge 0a101676e5 js/add-p-diff-parsing-fix later to maint).
+
+ * Segfault fix-up to an earlier fix to the topic to teach "git reset"
+ and "git checkout" work better in a sparse checkout.
+ (merge 037f8ea6d9 vd/sparse-reset-checkout-fixes later to maint).
+
+ * "git diff --no-index A B" managed its the pathnames of its two
+ input files rather haphazardly, sometimes leaking them. The
+ command line argument processing has been straightened out to clean
+ it up.
+ (merge 2b43dd0eb5 rs/diff-no-index-cleanup later to maint).
+
+ * "git rev-list --verify-objects" ought to inspect the contents of
+ objects and notice corrupted ones, but it didn't when the commit
+ graph is in use, which has been corrected.
+ (merge b27ccae34b jk/rev-list-verify-objects-fix later to maint).
+
+ * More fixes to "add -p"
+ (merge 64ec8efb83 js/builtin-add-p-portability-fix later to maint).
+
+ * The parser in the script interface to parse-options in "git
+ rev-parse" has been updated to diagnose a bogus input correctly.
+ (merge f20b9c36d0 ow/rev-parse-parseopt-fix later to maint).
+
+ * The code that manages list-object-filter structure, used in partial
+ clones, leaked the instances, which has been plugged.
+ (merge 66eede4a37 jk/plug-list-object-filter-leaks later to maint).
+
+ * Fix another UI regression in the reimplemented "add -p".
+ (merge f6f0ee247f rs/add-p-worktree-mode-prompt-fix later to maint).
+
+ * "git fetch" over protocol v2 sent an incorrect ref prefix request
+ to the server and made "git pull" with configured fetch refspec
+ that does not cover the remote branch to merge with fail, which has
+ been corrected.
+ (merge 49ca2fba39 jk/proto-v2-ref-prefix-fix later to maint).
+
+ * A result from opendir() was leaking in the commit-graph expiration
+ codepath, which has been plugged.
+ (merge 12f1ae5324 ml/commit-graph-expire-dir-leak-fix later to maint).
+
+ * Just like we have coding guidelines, we now have guidelines for
+ reviewers.
+ (merge e01b851923 vd/doc-reviewing-guidelines later to maint).
+
+ * Other code cleanup, docfix, build fix, etc.
+ (merge 77b9e85c0f vd/fix-perf-tests later to maint).
+ (merge 0682bc43f5 jk/test-crontab-fixes later to maint).
+ (merge b46dd1726c cc/doc-trailer-whitespace-rules later to maint).
diff --git a/Documentation/RelNotes/2.38.1.txt b/Documentation/RelNotes/2.38.1.txt
new file mode 100644
index 0000000..b2b5854
--- /dev/null
+++ b/Documentation/RelNotes/2.38.1.txt
@@ -0,0 +1,5 @@
+Git v2.38.1 Release Notes
+=========================
+
+This release merges the security fix that appears in v2.30.6; see
+the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.38.2.txt b/Documentation/RelNotes/2.38.2.txt
new file mode 100644
index 0000000..92acb62
--- /dev/null
+++ b/Documentation/RelNotes/2.38.2.txt
@@ -0,0 +1,67 @@
+Git 2.38.2 Release Notes
+========================
+
+This is to backport various fixes accumulated during the development
+towards Git 2.39, the next feature release.
+
+
+Fixes since v2.38.1
+-------------------
+
+ * Update CodingGuidelines to clarify what features to use and avoid
+ in C99.
+
+ * The codepath that reads from the index v4 had unaligned memory
+ accesses, which has been corrected.
+
+ * "git remote rename" failed to rename a remote without fetch
+ refspec, which has been corrected.
+
+ * "git clone" did not like to see the "--bare" and the "--origin"
+ options used together without a good reason.
+
+ * Fix messages incorrectly marked for translation.
+
+ * "git fsck" failed to release contents of tree objects already used
+ from the memory, which has been fixed.
+
+ * "git rebase -i" can mistakenly attempt to apply a fixup to a commit
+ itself, which has been corrected.
+
+ * In read-only repositories, "git merge-tree" tried to come up with a
+ merge result tree object, which it failed (which is not wrong) and
+ led to a segfault (which is bad), which has been corrected.
+
+ * Force C locale while running tests around httpd to make sure we can
+ find expected error messages in the log.
+
+ * Fix a logic in "mailinfo -b" that miscomputed the length of a
+ substring, which lead to an out-of-bounds access.
+
+ * The codepath to sign learned to report errors when it fails to read
+ from "ssh-keygen".
+
+ * "GIT_EDITOR=: git branch --edit-description" resulted in failure,
+ which has been corrected.
+
+ * Documentation on various Boolean GIT_* environment variables have
+ been clarified.
+
+ * "git multi-pack-index repack/expire" used to repack unreachable
+ cruft into a new pack, which have been corrected.
+
+ * The code to clean temporary object directories (used for
+ quarantine) tried to remove them inside its signal handler, which
+ was a no-no.
+
+ * "git branch --edit-description" on an unborh branch misleadingly
+ said that no such branch exists, which has been corrected.
+
+ * GitHub CI settings have been adjusted to recent reality, merging
+ and cherry-picking necessary topics that have been prepared for Git
+ 2.39.
+
+ * `git rebase --update-refs` would delete references when all `update-ref`
+ commands in the sequencer were removed, which has been corrected.
+
+Also contains various documentation updates and code clean-ups.
diff --git a/Documentation/RelNotes/2.38.3.txt b/Documentation/RelNotes/2.38.3.txt
new file mode 100644
index 0000000..4a46bb4
--- /dev/null
+++ b/Documentation/RelNotes/2.38.3.txt
@@ -0,0 +1,5 @@
+Git v2.38.3 Release Notes
+=========================
+
+This release merges the security fix that appears in v2.30.7; see
+the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.38.4.txt b/Documentation/RelNotes/2.38.4.txt
new file mode 100644
index 0000000..fdfde22
--- /dev/null
+++ b/Documentation/RelNotes/2.38.4.txt
@@ -0,0 +1,7 @@
+Git v2.38.4 Release Notes
+=========================
+
+This release merges up the fixes that appear in v2.30.8, v2.31.7,
+v2.32.6, v2.33.7, v2.34.7, v2.35.7, v2.36.5 and v2.37.6 to
+address the security issues CVE-2023-22490 and CVE-2023-23946;
+see the release notes for these versions for details.
diff --git a/Documentation/RelNotes/2.38.5.txt b/Documentation/RelNotes/2.38.5.txt
new file mode 100644
index 0000000..2d1f3b1
--- /dev/null
+++ b/Documentation/RelNotes/2.38.5.txt
@@ -0,0 +1,8 @@
+Git v2.38.5 Release Notes
+=========================
+
+This release merges up the fix that appears in v2.30.9, v2.31.8,
+v2.32.7, v2.33.8, v2.34.8, v2.35.8, v2.36.6 and v2.37.7 to address
+the security issues CVE-2023-25652, CVE-2023-25815, and
+CVE-2023-29007; see the release notes for these versions for
+details.
diff --git a/Documentation/RelNotes/2.39.0.txt b/Documentation/RelNotes/2.39.0.txt
new file mode 100644
index 0000000..9bf00ec
--- /dev/null
+++ b/Documentation/RelNotes/2.39.0.txt
@@ -0,0 +1,346 @@
+Git v2.39 Release Notes
+=======================
+
+UI, Workflows & Features
+------------------------
+
+ * "git grep" learned to expand the sparse-index more lazily and on
+ demand in a sparse checkout.
+
+ * By default, use of fsmonitor on a repository on networked
+ filesystem is disabled. Add knobs to make it workable on macOS.
+
+ * After checking out a "branch" that is a symbolic-ref that points at
+ another branch, "git symbolic-ref HEAD" reports the underlying
+ branch, not the symbolic-ref the user gave checkout as argument.
+ The command learned the "--no-recurse" option to stop after
+ dereferencing a symbolic-ref only once.
+
+ * "git branch --edit-description @{-1}" is now a way to edit branch
+ description of the branch you were on before switching to the
+ current branch.
+
+ * "git merge-tree --stdin" is a new way to request a series of merges
+ and report the merge results.
+
+ * "git shortlog" learned to group by the "format" string.
+
+ * A new "--include-whitespace" option is added to "git patch-id", and
+ existing bugs in the internal patch-id logic that did not match
+ what "git patch-id" produces have been corrected.
+
+ * Enable gc.cruftpacks by default for those who opt into
+ feature.experimental setting.
+
+ * "git repack" learns to send cruft objects out of the way into
+ packfiles outside the repository.
+
+ * 'scalar reconfigure -a' is taught to automatically remove
+ scalar.repo entires which no longer exist.
+
+ * Redact headers from cURL's h2h3 module in GIT_CURL_VERBOSE and
+ others.
+
+ * 'git maintenance register' is taught to write configuration to an
+ arbitrary path, and 'git for-each-repo' is taught to expand tilde
+ characters in paths.
+
+ * When creating new notes, the template used to get a stray empty
+ newline, which has been removed.
+
+ * "git receive-pack" used to use all the local refs as the boundary for
+ checking connectivity of the data "git push" sent, but now it uses
+ only the refs that it advertised to the pusher. In a repository with
+ the .hideRefs configuration, this reduces the resources needed to
+ perform the check.
+
+ * With '--recurse-submodules=on-demand', all submodules are
+ recursively pushed.
+
+
+Performance, Internal Implementation, Development Support etc.
+--------------------------------------------------------------
+
+ * With a bit of header twiddling, use the native regexp library on
+ macOS instead of the compat/ one.
+
+ * Prepare for GNU [ef]grep that throw warning of their uses.
+
+ * Sources related to fuzz testing have been moved down to their own
+ directory.
+
+ * Most credential helpers ignored unknown entries in a credential
+ description, but a few died upon seeing them. The latter were
+ taught to ignore them, too
+
+ * "scalar unregister" in a repository that is already been
+ unregistered reported an error.
+
+ * Remove error detection from a function that fetches from promisor
+ remotes, and make it die when such a fetch fails to bring all the
+ requested objects, to give an early failure to various operations.
+
+ * Update CodingGuidelines to clarify what features to use and avoid
+ in C99.
+
+ * Avoid false-positive from LSan whose assumption may be broken with
+ higher optimization levels.
+
+ * Enable address and undefined sanitizer tasks at GitHub Actions CI.
+
+ * More UNUSED annotation to help using -Wunused option with the
+ compiler.
+ (merge 4b992f0a24 jk/unused-anno-more later to maint).
+
+ * Rewrite a deep recursion in the skipping negotiator to use a loop
+ with on-heap prio queue to avoid stack wastage.
+
+ * Add documentation for message IDs in fsck error messages.
+
+ * Define the logical elements of a "bundle list", data structure to
+ store them in-core, format to transfer them, and code to parse
+ them.
+
+ * The role the security mailing list plays in an embargoed release
+ has been documented.
+
+ * Two new facilities, "timer" and "counter", are introduced to the
+ trace2 API.
+
+ * Code simplification by using strvec_pushf() instead of building an
+ argument in a separate strbuf.
+
+ * Make sure generated dependency file is stably sorted to help
+ developers debugging their build issues.
+
+ * The glossary entries for "commit-graph file" and "reachability
+ bitmap" have been added.
+
+ * Various tests exercising the transfer.credentialsInUrl
+ configuration are taught to avoid making requests which require
+ resolving localhost to reduce CI-flakiness.
+
+ * A redundant diagnostic message is dropped from test_path_is_missing().
+
+ * Simplify the run-command API.
+
+ * Update the actions/github-script dependency in CI to avoid a
+ deprecation warning.
+
+ * Progress on being able to initialize a rev_info struct with a
+ macro.
+
+ * Add trace2 counters to the region to clear skip worktree bits in a
+ sparse checkout.
+
+ * Modernize test script to avoid "test -f" and friends.
+
+ * Avoid calling 'cache_tree_update()' when doing so would be
+ redundant.
+
+ * Update the credential-cache documentation to provide a more
+ realistic example.
+
+ * Makefile comments updates and reordering to clarify knobs used to
+ choose SHA implementations.
+
+ * A design document for sparse-checkout's future directions has been
+ added.
+
+ * Teach chainlint.pl to annotate the original test definition instead
+ of the token stream.
+
+ * "make coccicheck" is time consuming. It has been made to run more
+ incrementally.
+
+ * `parse_object()` has been hardened to check for the existence of a
+ suspected blob object.
+
+ * The build procedure has been adjusted to GNUmake version 4.4, which
+ made some changes to how pattern rule with multiple targets are
+ handled.
+
+
+Fixes since v2.38
+-----------------
+
+ * The codepath that reads from the index v4 had unaligned memory
+ accesses, which has been corrected.
+
+ * Fix messages incorrectly marked for translation.
+
+ * "git fsck" failed to release contents of tree objects already used
+ from the memory, which has been fixed.
+
+ * "git clone" did not like to see the "--bare" and the "--origin"
+ options used together without a good reason.
+
+ * "git remote rename" failed to rename a remote without fetch
+ refspec, which has been corrected.
+
+ * Documentation on various Boolean GIT_* environment variables have
+ been clarified.
+
+ * "git rebase -i" can mistakenly attempt to apply a fixup to a commit
+ itself, which has been corrected.
+
+ * "git multi-pack-index repack/expire" used to repack unreachable
+ cruft into a new pack, which have been corrected.
+
+ * In read-only repositories, "git merge-tree" tried to come up with a
+ merge result tree object, which it failed (which is not wrong) and
+ led to a segfault (which is bad), which has been corrected.
+
+ * Force C locale while running tests around httpd to make sure we can
+ find expected error messages in the log.
+
+ * Fix a logic in "mailinfo -b" that miscomputed the length of a
+ substring, which lead to an out-of-bounds access.
+
+ * The codepath to sign learned to report errors when it fails to read
+ from "ssh-keygen".
+
+ * Code clean-up that results in plugging a leak.
+
+ * "GIT_EDITOR=: git branch --edit-description" resulted in failure,
+ which has been corrected.
+
+ * The code to clean temporary object directories (used for
+ quarantine) tried to remove them inside its signal handler, which
+ was a no-no.
+
+ * Update comment in the Makefile about the RUNTIME_PREFIX config knob.
+
+ * Clarify that "the sentence after <area>: prefix does not begin with
+ a capital letter" rule applies only to the commit title.
+
+ * "git branch --edit-description" on an unborn branch misleadingly
+ said that no such branch exists, which has been corrected.
+
+ * Work around older clang that warns against C99 zero initialization
+ syntax for struct.
+
+ * Giving "--invert-grep" and "--all-match" without "--grep" to the
+ "git log" command resulted in an attempt to access grep pattern
+ expression structure that has not been allocated, which has been
+ corrected.
+ (merge db84376f98 ab/grep-simplify-extended-expression later to maint).
+
+ * "git diff rev^!" did not show combined diff to go to the rev from
+ its parents.
+ (merge a79c6b6081 rs/diff-caret-bang-with-parents later to maint).
+
+ * Allow configuration files in "protected" scopes to include other
+ configuration files.
+ (merge ecec57b3c9 gc/bare-repo-discovery later to maint).
+
+ * Give a bit more diversity to macOS CI by using sha1dc in one of the
+ jobs (the other one tests Apple Common Crypto).
+ (merge 1ad5c3df35 jc/ci-osx-with-sha1dc later to maint).
+
+ * A bugfix with tracing support in midx codepath
+ (merge e9c3839944 tb/midx-bitmap-selection-fix later to maint).
+
+ * When geometric repacking feature is in use together with the
+ --pack-kept-objects option, we lost packs marked with .keep files.
+ (merge 197443e80a tb/save-keep-pack-during-geometric-repack later to maint).
+
+ * Move a global variable added as a hack during regression fixes to
+ its proper place in the API.
+ (merge 0b0ab95f17 ab/run-hook-api-cleanup later to maint).
+
+ * Update to build procedure with VS using CMake/CTest.
+ (merge c858750b41 js/cmake-updates later to maint).
+
+ * The short-help text shown by "git cmd -h" and the synopsis text
+ shown at the beginning of "git help cmd" have been made more
+ consistent.
+
+ * When creating a multi-pack bitmap, remove per-pack bitmap files
+ unconditionally as they will never be consulted.
+ (merge 55d902cd61 tb/remove-unused-pack-bitmap later to maint).
+
+ * Fix a longstanding syntax error in Git.pm error codepath.
+
+ * "git diff --stat" etc. were invented back when everything was ASCII
+ and strlen() was a way to measure the display width of a string;
+ adjust them to compute the display width assuming UTF-8 pathnames.
+ (merge ce8529b2bb tb/diffstat-with-utf8-strwidth later to maint).
+
+ * "git branch --edit-description" can exit with status -1 which is
+ not a good practice; it learned to use 1 as everybody else instead.
+
+ * "git apply" limits its input to a bit less than 1 GiB.
+
+ * Merging a branch with directory renames into a branch that changes
+ the directory to a symlink was mishandled by the ort merge
+ strategy, which has been corrected.
+
+ * A bugfix to "git subtree" in its split and merge features.
+
+ * Fix some bugs in the reflog messages when rebasing and changes the
+ reflog messages of "rebase --apply" to match "rebase --merge" with
+ the aim of making the reflog easier to parse.
+
+ * "git rebase --keep-base" used to discard the commits that are
+ already cherry-picked to the upstream, even when "keep-base" meant
+ that the base, on top of which the history is being rebuilt, does
+ not yet include these cherry-picked commits. The --keep-base
+ option now implies --reapply-cherry-picks and --no-fork-point
+ options.
+
+ * The way "git repack" created temporary files when it received a
+ signal was prone to deadlocking, which has been corrected.
+
+ * Various tests exercising the transfer.credentialsInUrl
+ configuration are taught to avoid making requests which require
+ resolving localhost to reduce CI-flakiness.
+
+ * The adjust_shared_perm() helper function learned to refrain from
+ setting the "g+s" bit on directories when it is not necessary.
+
+ * "git archive" mistakenly complained twice about a missing
+ executable, which has been corrected.
+
+ * Fix a bug where `git branch -d` did not work on an orphaned HEAD.
+
+ * `git rebase --update-refs` would delete references when all
+ `update-ref` commands in the sequencer were removed, which has been
+ corrected.
+
+ * Fix a regression in the bisect-helper which mistakenly treats
+ arguments to the command given to 'git bisect run' as arguments to
+ the helper.
+
+ * Correct an error where `git rebase` would mistakenly use a branch or
+ tag named "refs/rewritten/xyz" when missing a rebase label.
+
+ * Assorted fixes of parsing end-user input as integers.
+ (merge 14770cf0de pw/config-int-parse-fixes later to maint).
+
+ * "git prune" may try to iterate over .git/objects/pack for trash
+ files to remove in it, and loudly fail when the directory is
+ missing, which is not necessary. The command has been taught to
+ ignore such a failure.
+ (merge 6974765352 ew/prune-with-missing-objects-pack later to maint).
+
+ * Add one more candidate directory that may house httpd modules while
+ running tests.
+ (merge 1c7dc23d41 es/locate-httpd-module-location-in-test later to maint).
+
+ * A handful of leaks in the line-log machinery have been plugged.
+
+ * The format of a line in /proc/cpuinfo that describes a CPU on s390x
+ looked different from everybody else, and the code in chainlint.pl
+ failed to parse it.
+ (merge 1f51b77f4f ah/chainlint-cpuinfo-parse-fix later to maint).
+
+ * Adjust the GitHub CI to newer ubuntu release.
+ (merge 0d3507f3e7 jx/ci-ubuntu-fix later to maint).
+
+ * Other code cleanup, docfix, build fix, etc.
+ (merge 413bc6d20a ds/cmd-main-reorder later to maint).
+ (merge 8d2863e4ed nw/t1002-cleanup later to maint).
+ (merge 7c2dc122f9 rs/list-objects-filter-leakfix later to maint).
+ (merge 288fcb1c94 zk/push-use-bitmaps later to maint).
+ (merge 42db324c0f km/merge-recursive-typofix later to maint).
diff --git a/Documentation/RelNotes/2.39.1.txt b/Documentation/RelNotes/2.39.1.txt
new file mode 100644
index 0000000..60c86f4
--- /dev/null
+++ b/Documentation/RelNotes/2.39.1.txt
@@ -0,0 +1,5 @@
+Git v2.39.1 Release Notes
+=========================
+
+This release merges the security fix that appears in v2.30.7; see
+the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.39.2.txt b/Documentation/RelNotes/2.39.2.txt
new file mode 100644
index 0000000..ebb9900
--- /dev/null
+++ b/Documentation/RelNotes/2.39.2.txt
@@ -0,0 +1,7 @@
+Git v2.39.2 Release Notes
+=========================
+
+This release merges up the fixes that appear in v2.30.8, v2.31.7,
+v2.32.6, v2.33.7, v2.34.7, v2.35.7, v2.36.5, v2.37.6 and v2.38.4
+to address the security issues CVE-2023-22490 and CVE-2023-23946;
+see the release notes for these versions for details.
diff --git a/Documentation/RelNotes/2.39.3.txt b/Documentation/RelNotes/2.39.3.txt
new file mode 100644
index 0000000..66351b6
--- /dev/null
+++ b/Documentation/RelNotes/2.39.3.txt
@@ -0,0 +1,64 @@
+Git v2.39.3 Release Notes
+=========================
+
+This release merges up the fix that appears in v2.30.9, v2.31.8,
+v2.32.7, v2.33.8, v2.34.8, v2.35.8, v2.36.6, v2.37.7 and v2.38.5 to
+address the security issues CVE-2023-25652, CVE-2023-25815, and
+CVE-2023-29007; see the release notes for these versions for
+details.
+
+This release also merges fixes that have accumulated on the 'master'
+front to prepare for the 2.40 release that are still relevant to
+2.39.x maintenance track.
+
+Fixes since v2.39.2
+-------------------
+
+ * Stop running win+VS build by default.
+
+ * CI updates. We probably want a clean-up to move the long shell
+ script embedded in yaml file into a separate file, but that can
+ come later.
+
+ * Avoid unnecessary builds in CI, with settings configured in
+ ci-config.
+
+ * Redefining system functions for a few functions did not follow our
+ usual "implement git_foo() and #define foo(args) git_foo(args)"
+ pattern, which has broken build for some folks.
+
+ * Deal with a few deprecation warning from cURL library.
+
+ * Newer regex library macOS stopped enabling GNU-like enhanced BRE,
+ where '\(A\|B\)' works as alternation, unless explicitly asked with
+ the REG_ENHANCED flag. "git grep" now can be compiled to do so, to
+ retain the old behaviour.
+
+ * When given a pattern that matches an empty string at the end of a
+ line, the code to parse the "git diff" line-ranges fell into an
+ infinite loop, which has been corrected.
+
+ * Fix the sequence to fsync $GIT_DIR/packed-refs file that forgot to
+ flush its output to the disk..
+
+ * "git diff --relative" did not mix well with "git diff --ext-diff",
+ which has been corrected.
+
+ * The logic to see if we are using the "cone" mode by checking the
+ sparsity patterns has been tightened to avoid mistaking a pattern
+ that names a single file as specifying a cone.
+
+ * Doc update for environment variables set when hooks are invoked.
+
+ * Document ORIG_HEAD a bit more.
+
+ * "git ls-tree --format='%(path) %(path)' $tree $path" showed the
+ path three times, which has been corrected.
+
+ * Document that "branch -f <branch>" disables only the safety to
+ avoid recreating an existing branch.
+
+ * Clarify how "checkout -b/-B" and "git branch [-f]" are similar but
+ different in the documentation.
+
+Also contains minor documentation updates and code clean-ups.
diff --git a/Documentation/RelNotes/2.40.0.txt b/Documentation/RelNotes/2.40.0.txt
new file mode 100644
index 0000000..3ea445b
--- /dev/null
+++ b/Documentation/RelNotes/2.40.0.txt
@@ -0,0 +1,320 @@
+Git v2.40 Release Notes
+=======================
+
+UI, Workflows & Features
+
+ * "merge-tree" learns a new `--merge-base` option.
+
+ * "git jump" (in contrib/) learned to present the "quickfix list" to
+ its standard output (instead of letting it consumed by the editor
+ it invokes), and learned to also drive emacs/emacsclient.
+
+ * "git var UNKNOWN_VARIABLE" and "git var VARIABLE" with the variable
+ given an empty value used to behave identically. Now the latter
+ just gives an empty output, while the former still gives an error
+ message.
+
+ * Introduce a case insensitive mode to the Bash completion helpers.
+
+ * The advice message given by "git status" when it takes long time to
+ enumerate untracked paths has been updated.
+
+ * Just like "git var GIT_EDITOR" abstracts the complex logic to
+ choose which editor gets used behind it, "git var" now give support
+ to GIT_SEQUENCE_EDITOR.
+
+ * "git format-patch" learned to honor format.mboxrd even when sending
+ patches to the standard output stream,
+
+ * 'cat-file' gains mailmap support for its '--batch-check' and '-s'
+ options.
+
+ * Conditionally skip the pre-applypatch and applypatch-msg hooks when
+ applying patches with 'git am'.
+
+ * Introduce an optional configuration to allow the trailing hash that
+ protects the index file from bit flipping.
+
+ * "git check-attr" learned to take an optional tree-ish to read the
+ .gitattributes file from.
+
+ * "scalar" learned to give progress bar.
+
+ * "grep -P" learned to use Unicode Character Property to grok
+ character classes when processing \b and \w etc.
+
+ * "git rebase" often ignored incompatible options instead of
+ complaining, which has been corrected.
+
+ * "scalar" warns but continues when its periodic maintenance
+ feature cannot be enabled.
+
+ * The bundle-URI subsystem adds support for creation-token heuristics
+ to help incremental fetches.
+
+ * Userdiff regexp update for Java language.
+
+ * "git fetch --jobs=0" used to hit a BUG(), which has been corrected
+ to use the available CPUs.
+
+ * An invalid label or ref in the "rebase -i" todo file used to
+ trigger an runtime error. SUch an error is now diagnosed while the
+ todo file is parsed.
+
+ * The "diff" drivers specified by the "diff" attribute attached to
+ paths can now specify which algorithm (e.g. histogram) to use.
+
+ * "git range-diff" learned --abbrev=<num> option.
+
+ * "git archive HEAD^{tree}" records the paths with the current
+ timestamp in the archive, making it harder to obtain a stable
+ output. The command learned the --mtime option to specify an
+ arbitrary timestamp (e.g. --mtime="@0 +0000" for the epoch).
+
+ * The credential subsystem learned that a password may have an
+ explicit expiration.
+
+ * The format.attach configuration variable lacked a way to override a
+ value defined in a lower-priority configuration file (e.g. the
+ system one) by redefining it in a higher-priority configuration
+ file. Now, setting format.attach to an empty string means show the
+ patch inline in the e-mail message, without using MIME attachment.
+
+ This is a backward incompatible change.
+
+
+Performance, Internal Implementation, Development Support etc.
+
+ * `git bisect` becomes a builtin.
+
+ * The pack-bitmap machinery is taught to log the paths of redundant
+ bitmap(s) to trace2 instead of stderr.
+
+ * Use the SHA1DC implementation on macOS, just like other platforms,
+ by default.
+
+ * Even in a repository with promisor remote, it is useless to
+ attempt to lazily attempt fetching an object that is expected to be
+ commit, because no "filter" mode omits commit objects. Take
+ advantage of this assumption to fail fast on errors.
+
+ * Stop using "git --super-prefix" and narrow the scope of its use to
+ the submodule--helper.
+
+ * Stop running win+VS build by default.
+
+ * CI updates. We probably want a clean-up to move the long shell
+ script embedded in yaml file into a separate file, but that can
+ come later.
+
+ * Use `git diff --no-index` as a test_cmp on Windows.
+
+ We'd probably need to revisit "do we really want to, and have to,
+ lose CRLF vs LF?" later, at which time we may be able to further
+ clean this up by replacing "git diff --no-index" with "diff -u".
+
+ * Avoid unnecessary builds in CI, with settings configured in
+ ci-config.
+
+ * Plug leaks in sequencer subsystem and its users.
+
+ * In-tree .gitattributes update to match the way we recommend our
+ users to mark a file as text.
+ (merge 1f34e0cd3d po/attributes-text later to maint).
+
+ * Finally retire the scripted "git add -p/-i" implementation and have
+ everybody use the one reimplemented in C.
+
+
+Fixes since v2.39
+-----------------
+
+ * Various leak fixes.
+
+ * Fix a bug where `pack-objects` would not respect multiple `--filter`
+ arguments when invoked directly.
+ (merge d4f7036887 rs/multi-filter-args later to maint).
+
+ * Make fsmonitor more robust to avoid the flakiness seen in t7527.
+ (merge 6692d45477 jh/t7527-unflake-by-forcing-cookie later to maint).
+
+ * Stop using deprecated macOS API in fsmonitor.
+ (merge b0226007f0 jh/fsmonitor-darwin-modernize later to maint).
+
+ * Redefining system functions for a few functions did not follow our
+ usual "implement git_foo() and #define foo(args) git_foo(args)"
+ pattern, which has broken build for some folks.
+
+ * The way the diff machinery prepares the options array for the
+ parse_options API has been refactored to avoid resource leaks.
+ (merge 189e97bc4b rs/diff-parseopts later to maint).
+
+ * Correct pthread API usage.
+ (merge 786e67611d sx/pthread-error-check-fix later to maint).
+
+ * The code to auto-correct a misspelt subcommand unnecessarily called
+ into git_default_config() from the early config codepath, which was
+ a no-no. This has bee corrected.
+ (merge 0918d08887 sg/help-autocorrect-config-fix later to maint).
+
+ * "git http-fetch" (which is rarely used) forgot to identify itself
+ in the trace2 output.
+ (merge 7abb43cbc8 jt/http-fetch-trace2-report-name later to maint).
+
+ * The output from "git diff --stat" on an unmerged path lost the
+ terminating LF in Git 2.39, which has been corrected.
+ (merge 209d9cb011 pg/diff-stat-unmerged-regression-fix later to maint).
+
+ * "git pull -v --recurse-submodules" attempted to pass "-v" down to
+ underlying "git submodule update", which did not understand the
+ request and barfed, which has been corrected.
+ (merge 6f65f84766 ss/pull-v-recurse-fix later to maint).
+
+ * When given a pattern that matches an empty string at the end of a
+ line, the code to parse the "git diff" line-ranges fell into an
+ infinite loop, which has been corrected.
+
+ * Fix the sequence to fsync $GIT_DIR/packed-refs file that forgot to
+ flush its output to the disk..
+
+ * Fix to a small regression in 2.38 days.
+
+ * "git diff --relative" did not mix well with "git diff --ext-diff",
+ which has been corrected.
+
+ * The logic to see if we are using the "cone" mode by checking the
+ sparsity patterns has been tightened to avoid mistaking a pattern
+ that names a single file as specifying a cone.
+
+ * Deal with a few deprecation warning from cURL library.
+
+ * Doc update for environment variables set when hooks are invoked.
+
+ * Document ORIG_HEAD a bit more.
+
+ * "git ls-tree --format='%(path) %(path)' $tree $path" showed the
+ path three times, which has been corrected.
+
+ * Remove "git env--helper" and demote it to a test-tool subcommand.
+ (merge 4a1baacd46 ab/test-env-helper later to maint).
+
+ * Newer regex library macOS stopped enabling GNU-like enhanced BRE,
+ where '\(A\|B\)' works as alternation, unless explicitly asked with
+ the REG_ENHANCED flag. "git grep" now can be compiled to do so, to
+ retain the old behaviour.
+
+ * Pthread emulation on Win32 leaked thread handle when a thread is
+ joined.
+ (merge 238a9dfe86 sk/win32-close-handle-upon-pthread-join later to maint).
+
+ * "git send-email -v 3" used to be expanded to "git send-email
+ --validate 3" when the user meant to pass them down to
+ "format-patch", which has been corrected.
+ (merge 8774aa56ad km/send-email-with-v-reroll-count later to maint).
+
+ * Document that "branch -f <branch>" disables only the safety to
+ avoid recreating an existing branch.
+
+ * "git fetch <group>", when "<group>" of remotes lists the same
+ remote twice, unnecessarily failed when parallel fetching was
+ enabled, which has been corrected.
+ (merge 06a668cb90 cw/fetch-remote-group-with-duplication later to maint).
+
+ * Clarify how "checkout -b/-B" and "git branch [-f]" are similar but
+ different in the documentation.
+
+ * "git hash-object" now checks that the resulting object is well
+ formed with the same code as "git fsck".
+ (merge 8e4309038f jk/hash-object-fsck later to maint).
+
+ * Improve the error message given when private key is not loaded in
+ the ssh agent in the codepath to sign with an ssh key.
+ (merge dce7b31126 as/ssh-signing-improve-key-missing-error later to maint).
+
+ * Adjust "git request-pull" to strip embedded signature from signed
+ tags to notice non-PGP signatures.
+ (merge a9cad02538 gm/request-pull-with-non-pgp-signed-tags later to maint).
+
+ * Remove support for MSys, which now lags way behind MSys2.
+ (merge 2987407f3c hj/remove-msys-support later to maint).
+
+ * Fix use of CreateThread() API call made early in the windows
+ start-up code.
+ (merge 592bcab61b sk/winansi-createthread-fix later to maint).
+
+ * "git pack-objects" learned to release delta-island bitmap data when
+ it is done using it, saving peak heap memory usage.
+ (merge 647982bb71 ew/free-island-marks later to maint).
+
+ * In an environment where dynamically generated code is prohibited to
+ run (e.g. SELinux), failure to JIT pcre patterns is expected. Fall
+ back to interpreted execution in such a case.
+ (merge 50b6ad55b0 cb/grep-fallback-failing-jit later to maint).
+
+ * "git name-rev" heuristics update.
+ (merge b2182a8730 en/name-rev-make-taggerdate-much-less-important later to maint).
+
+ * Remove more remaining uses of macros that relies on the_index
+ singleton instance without explicitly spelling it out.
+
+ * Remove unnecessary explicit sizing of strbuf.
+ (merge 93ea118bed rs/cache-tree-strbuf-growth-fix later to maint).
+
+ * Doc update.
+ (merge d9ec3b0dc0 jk/doc-ls-remote-matching later to maint).
+
+ * Error messages given upon a signature verification failure used to
+ discard the errors from underlying gpg program, which has been
+ corrected.
+ (merge ad6b320756 js/gpg-errors later to maint).
+
+ * Update --date=default documentation.
+ (merge 9deef088ae rd/doc-default-date-format later to maint).
+
+ * A test helper had a single write(2) of 256kB, which was too big for
+ some platforms (e.g. NonStop), which has been corrected by using
+ xwrite() wrapper appropriately.
+ (merge 58eab6ff13 jc/genzeros-avoid-raw-write later to maint).
+
+ * sscanf(3) used in "git symbolic-ref --short" implementation found
+ to be not working reliably on macOS in UTF-8 locales. Rewrite the
+ code to avoid sscanf() altogether to work it around.
+ (merge 613bef56b8 jk/shorten-unambiguous-ref-wo-sscanf later to maint).
+
+ * Various fix-ups on HTTP tests.
+ (merge 8f2146dbf1 jk/http-test-fixes later to maint).
+
+ * Fixes to code that parses the todo file used in "rebase -i".
+ (merge 666b6e1135 pw/rebase-i-parse-fix later to maint).
+
+ * Test library clean-up.
+ (merge c600a91c94 ar/test-lib-remove-stale-comment later to maint).
+
+ * Other code cleanup, docfix, build fix, etc.
+ (merge 4eb1ccecd4 dh/mingw-ownership-check-typofix later to maint).
+ (merge f95526419b ar/typofix-gitattributes-doc later to maint).
+ (merge 27875aeec9 km/doc-branch-start-point later to maint).
+ (merge 35c194dc57 es/t1509-root-fixes later to maint).
+ (merge 7b341645e3 pw/ci-print-failure-name-fix later to maint).
+ (merge bcb71d45bf jx/t1301-updates later to maint).
+ (merge ebdc46c242 jc/doc-diff-patch.txt later to maint).
+ (merge a87a20cbb4 ar/test-cleanup later to maint).
+ (merge f5156f1885 ar/bisect-doc-update later to maint).
+ (merge fca2d86c97 jk/interop-error later to maint).
+ (merge cf4936ed74 tl/ls-tree-code-clean-up later to maint).
+ (merge dcb47e52b0 en/t6426-todo-cleanup later to maint).
+ (merge 5b8db44bdd jc/format-patch-v-unleak later to maint).
+ (merge 590b636737 jk/hash-object-literally-fd-leak later to maint).
+ (merge 5458ba0a4d tb/t0003-invoke-dd-more-portably later to maint).
+ (merge 70661d288b ar/markup-em-dash later to maint).
+ (merge e750951e74 en/ls-files-doc-update later to maint).
+ (merge 4f542975d1 mh/doc-credential-cache-only-in-core later to maint).
+ (merge 3a2ebaebc7 gc/index-format-doc later to maint).
+ (merge b08edf709d jk/httpd-test-updates later to maint).
+ (merge d85e9448dd wl/new-command-doc later to maint).
+ (merge d912a603ed kf/t5000-modernise later to maint).
+ (merge e65b868d07 rs/size-t-fixes later to maint).
+ (merge 3eb1e1ca9a ab/config-h-remove-unused later to maint).
+ (merge d390e08076 cw/doc-pushurl-vs-url later to maint).
+ (merge 567342fc77 rs/ctype-test later to maint).
+ (merge d35d8f2e7a ap/t2015-style-update later to maint).
diff --git a/Documentation/RelNotes/2.40.1.txt b/Documentation/RelNotes/2.40.1.txt
new file mode 100644
index 0000000..e72f6b1
--- /dev/null
+++ b/Documentation/RelNotes/2.40.1.txt
@@ -0,0 +1,8 @@
+Git v2.40.1 Release Notes
+=========================
+
+This release merges up the fix that appears in v2.30.9, v2.31.8,
+v2.32.7, v2.33.8, v2.34.8, v2.35.8, v2.36.6, v2.37.7, v2.38.5
+and v2.39.3 to address the security issues CVE-2023-25652,
+CVE-2023-25815, and CVE-2023-29007; see the release notes for these
+versions for details.
diff --git a/Documentation/RelNotes/2.41.0.txt b/Documentation/RelNotes/2.41.0.txt
new file mode 100644
index 0000000..8a9e170
--- /dev/null
+++ b/Documentation/RelNotes/2.41.0.txt
@@ -0,0 +1,399 @@
+Git v2.41 Release Notes
+=======================
+
+UI, Workflows & Features
+
+ * Allow information carried on the WWW-Authenticate header to be
+ passed to the credential helpers.
+
+ * A new "fetch.hideRefs" option can be used to exclude specified refs
+ from "rev-list --objects --stdin --not --all" traversal for
+ checking object connectivity, most useful when there are many
+ unrelated histories in a single repository.
+
+ * "git push" has been taught to allow deletion of refs with one-level
+ names to help repairing a repository who acquired such a ref by
+ mistake. In general, we don't encourage use of such a ref, and
+ creation or update to such a ref is rejected as before.
+
+ * Allow "git bisect reset" to check out the original branch when the
+ branch is already checked out in a different worktree linked to the
+ same repository.
+
+ * A few subcommands have been taught to stop users from working on a
+ branch that is being used in another worktree linked to the same
+ repository.
+
+ * "git format-patch" learned to write a log-message only output file
+ for empty commits.
+
+ * "git format-patch" honors the src/dst prefixes set to nonstandard
+ values with configuration variables like "diff.noprefix", causing
+ receiving end of the patch that expects the standard -p1 format to
+ break. "format-patch" has been taught to ignore end-user configuration
+ and always use the standard prefixes.
+
+ This is a backward compatibility breaking change.
+
+ * Lift the limitation that colored prompts can only be used with
+ PROMPT_COMMAND mode.
+
+ * "git blame --contents=<file> <rev> -- <path>" used to be forbidden,
+ but now it finds the origins of lines starting at <file> contents
+ through the history that leads to <rev>.
+
+ * "git pack-redundant" gave a warning when run, as the command has
+ outlived its usefulness long ago and is nominated for future
+ removal. Now we escalate to give an error.
+
+ * "git clone" from an empty repository learned to propagate the
+ choice of the hash algorithm from the source repository to the
+ newly created repository over any one of the v0/v1/v2 protocol.
+
+ * "git mergetool" and "git difftool" learns a new configuration
+ guiDefault to optionally favor configured guitool over non-gui-tool
+ automatically when $DISPLAY is set.
+
+ * "git branch -d origin/master" would say "no such branch", but it is
+ likely a missed "-r" if refs/remotes/origin/master exists. The
+ command has been taught to give such a hint in its error message.
+
+ * Clean-up of the code path that deals with merge strategy option
+ handling in "git rebase".
+
+ * "git clone --local" stops copying from an original repository that
+ has symbolic links inside its $GIT_DIR; an error message when that
+ happens has been updated.
+
+ * The "--format=..." option of "git for-each-ref", "git branch", and
+ "git tag" commands learn "--omit-empty" to hide refs whose
+ formatting results in an empty string from the output.
+
+ * The sendemail-validate validate hook learned to pass the total
+ number of input files and where in the sequence each invocation is
+ via environment variables.
+
+ * When "gc" needs to retain unreachable objects, packing them into
+ cruft packs (instead of exploding them into loose object files) has
+ been offered as a more efficient option for some time. Now the use
+ of cruft packs has been made the default and no longer considered
+ an experimental feature.
+
+ * The output given by "git blame" that attributes a line to contents
+ taken from the file specified by the "--contents" option shows it
+ differently from a line attributed to the working tree file.
+
+ * "git send-email" learned to give the e-mail headers to the validate
+ hook by passing an extra argument from the command line.
+
+ * The credential subsystem learns to help OAuth framework.
+
+ * The titles of manual pages used to be chomped at an unreasonably
+ short limit, which has been removed.
+
+ * Error messages given when working on an unborn branch that is
+ checked out in another worktree have been improved.
+
+ * The documentation was misleading about the interaction between
+ GIT_DEFAULT_HASH and "git clone", which has been clarified to
+ stress that the variable is to be ignored by the command.
+
+ * "git send-email" learned "--header-cmd=<cmd>" that can inject
+ arbitrary e-mail header lines to the outgoing messages.
+
+ * "git fsck" learned to detect bit-flip breakages in the reachability
+ bitmap files.
+
+ * The "--stdin" option of "git name-rev" has been replaced with
+ the "--annotate-stdin" option more than a year ago. We stop
+ advertising it in the "git name-rev -h" output.
+
+ * "git push --all" gained an alias "git push --branches".
+
+ * "git fetch" learned the "--porcelain" option that emits what it did
+ in a machine-parseable format.
+
+ * "git --attr-source=<tree> cmd $args" is a new way to have any
+ command to read attributes not from the working tree but from the
+ given tree object.
+
+
+Performance, Internal Implementation, Development Support etc.
+
+ * Code clean-up to clarify directory traversal API.
+
+ * Code clean-up to clarify the rule that "git-compat-util.h" must be
+ the first to be included.
+
+ * More work towards -Wunused.
+
+ * Instead of forcing each command to choose to honor GPG related
+ configuration variables, make the subsystem lazily initialize
+ itself.
+
+ * Remove workaround for ancient versions of DocBook to make it work
+ correctly with groff, which has not been necessary since docbook
+ 1.76 from 2010.
+
+ * Code clean-up to include and/or uninclude parse-options.h file as
+ needed.
+
+ * The code path that reports what "git fetch" did to each ref has
+ been cleaned up.
+
+ * Assorted config API updates.
+
+ * A few configuration variables to tell the cURL library that
+ different types of ssl-cert and ssl-key are in use have been added.
+
+ * Split key function and data structure definitions out of cache.h to
+ new header files and adjust the users.
+
+ * "git fetch --all" does not have to download and handle the same
+ bundleURI over and over, which has been corrected.
+
+ * "git sparse-checkout" command learns a debugging aid for the sparse
+ rule definitions.
+
+ * "git write-tree" learns to work better with sparse-index.
+
+ * The on-disk reverse index that allows mapping from the pack offset
+ to the object name for the object stored at the offset has been
+ enabled by default.
+
+ * "git fsck" learned to validate the on-disk pack reverse index files.
+
+ * strtok() and strtok_r() are banned in this codebase.
+
+ * The detect-compilers script to help auto-tweaking the build system
+ had trouble working with compilers whose version number has extra
+ suffixes. The script has been taught that certain suffixes (like
+ "-win32" in "gcc 10-win32") can be safely stripped as they share
+ the same features and bugs with the version without the suffix.
+
+ * ctype tests have been taught to test EOF, too.
+
+ * The implementation of credential helpers used fgets() over fixed
+ size buffers to read protocol messages, causing the remainder of
+ the folded long line to trigger unexpected behaviour, which has
+ been corrected.
+
+ * The implementation of the default "negotiator", used to find common
+ ancestor over the network for object tranfer, used to be recursive;
+ it was updated to be iterative to conserve stackspace usage.
+
+ * Our custom callout formatter is no longer used in the documentation
+ formatting toolchain, as the upstream default ones give better
+ output these days.
+
+ * The tracing mechanism learned to notice and report when
+ auto-discovered bare repositories are being used, as allowing so
+ without explicitly stating the user intends to do so (with setting
+ GIT_DIR for example) can be used with social engineering as an
+ attack vector.
+
+ * "git diff-files" learned not to expand sparse-index unless needed.
+
+
+Fixes since v2.40
+-----------------
+
+ * "git fsck" learned to check the index files in other worktrees,
+ just like "git gc" honors them as anchoring points.
+ (merge 8d3e7eac52 jk/fsck-indices-in-worktrees later to maint).
+
+ * Fix a segfaulting loop. The function and its caller may need
+ further clean-up.
+ (merge c5773dc078 ew/commit-reach-clean-up-flags-fix later to maint).
+
+ * "git restore" supports options like "--ours" that are only
+ meaningful during a conflicted merge, but these options are only
+ meaningful when updating the working tree files. These options are
+ marked to be incompatible when both "--staged" and "--worktree" are
+ in effect.
+ (merge ee8a88826a ak/restore-both-incompatible-with-conflicts later to maint).
+
+ * Simplify UI to control progress meter given by "git bundle" command.
+ (merge 8b95521edb jk/bundle-progress later to maint).
+
+ * "git bundle" learned that "-" is a common way to say that the input
+ comes from the standard input and/or the output goes to the
+ standard output. It used to work only for output and only from the
+ root level of the working tree.
+ (merge 0bbe10313e jk/bundle-use-dash-for-stdfiles later to maint).
+
+ * Once we start running, we assumed that the list of alternate object
+ databases would never change. Hook into the machinery used to
+ update the list of packfiles during runtime to update this list as
+ well.
+ (merge e2d003dbed ds/reprepare-alternates-when-repreparing-packfiles later to maint).
+
+ * The code to parse "git rebase -X<opt>" was not prepared to see an
+ unparsable option string, which has been corrected.
+ (merge 15a4cc912e ab/fix-strategy-opts-parsing later to maint).
+
+ * "git add -p" while the index is unmerged sometimes failed to parse
+ the diff output it internally produces and died, which has been
+ corrected.
+ (merge 28d1122f9c jk/add-p-unmerged-fix later to maint).
+
+ * Fix for a "ls-files --format="%(path)" that produced nonsense
+ output, which was a bug in 2.38.
+ (merge cfb62dd006 aj/ls-files-format-fix later to maint).
+
+ * "git receive-pack" that responds to "git push" requests failed to
+ clean a stale lockfile when killed in the middle, which has been
+ corrected.
+ (merge c55c30669c ps/receive-pack-unlock-before-die later to maint).
+
+ * "git rev-parse --quiet foo@{u}", or anything that asks @{u} to be
+ parsed with GET_OID_QUIETLY option, did not quietly fail, which has
+ been corrected.
+ (merge dfbfdc521d fc/oid-quietly-parse-upstream later to maint).
+
+ * Transports that do not support protocol v2 did not correctly fall
+ back to protocol v0 under certain conditions, which has been
+ corrected.
+ (merge eaa0fd6584 jk/fix-proto-downgrade-to-v0 later to maint).
+
+ * time(2) on glib 2.31+, especially on Linux, goes out of sync with
+ higher resolution timers used for gettimeofday(2) and by the
+ filesystem. Replace all calls to it with a git_time() wrapper and
+ (merge 370ddcbc89 pe/time-use-gettimeofday later to maint).
+
+ * Code clean-up to use designated initializers in parse-options API.
+ (merge 353e6d4554 sg/parse-options-h-initializers later to maint).
+
+ * A recent-ish change to allow unicode character classes to be used
+ with "grep -P" triggered a JIT bug in older pcre2 libraries.
+ The problematic change in Git built with these older libraries has
+ been disabled to work around the bug.
+ (merge 14b9a04479 mk/workaround-pcre-jit-ucp-bug later to maint).
+
+ * The wildmatch library code unlearns exponential behaviour it
+ acquired some time ago since it was borrowed from rsync.
+ (merge 3dc0b7f0dc pw/wildmatch-fixes later to maint).
+
+ * The index files can become corrupt under certain conditions when
+ the split-index feature is in use, especially together with
+ fsmonitor, which have been corrected.
+ (merge 061dd722dc js/split-index-fixes later to maint).
+
+ * Document what the pathname-looking strings in "rev-list --object"
+ output are for and what they mean.
+ (merge 15364d2a3c jk/document-rev-list-object-name later to maint).
+
+ * Fix unnecessary truncation of generation numbers used in-core.
+ (merge d3af1c193d ps/ahead-behind-truncation-fix later to maint).
+
+ * Code clean-up around the use of the_repository.
+ (merge 4a93b899c1 ab/remove-implicit-use-of-the-repository later to maint).
+
+ * Consistently spell "Message-ID" as such, not "Message-Id".
+ (merge ba4324c4e1 jc/spell-id-in-both-caps-in-message-id later to maint).
+
+ * Correct use of an uninitialized structure member.
+ (merge dc12ee77ab jx/cap-object-info-uninitialized-fix later to maint).
+
+ * Tests had a few places where we ignored PERL_PATH and blindly used
+ /usr/bin/perl, which have been corrected.
+ (merge c1917156a0 jk/use-perl-path-consistently later to maint).
+
+ * Documentation mark-up fix.
+ (merge 78b6369e67 la/mfc-markup-fix later to maint).
+
+ * Doc toolchain update to remove old workaround for AsciiDoc.
+ (merge 8806120de6 fc/remove-header-workarounds-for-asciidoc later to maint).
+
+ * The userdiff regexp patterns for various filetypes that are built
+ into the system have been updated to avoid triggering regexp errors
+ from UTF-8 aware regex engines.
+ (merge be39144954 rs/userdiff-multibyte-regex later to maint).
+
+ * The approxidate() API has been simplified by losing an extra
+ function that did the same thing as another one.
+ (merge 8a7f0b666f rs/remove-approxidate-relative later to maint).
+
+ * Code clean-up to replace a hardcoded constant with a CPP macro.
+ (merge c870de6502 rs/get-tar-commit-id-use-defined-const later to maint).
+
+ * Doc build simplification.
+ (merge 9a09ed3229 fc/doc-stop-using-manversion later to maint).
+
+ * "git archive" run from a subdirectory mishandled attributes and
+ paths outside the current directory.
+ (merge 92b1dd1b9e rs/archive-from-subdirectory-fixes later to maint).
+
+ * The code to parse capability list for v0 on-wire protocol fell into
+ an infinite loop when a capability appears multiple times, which
+ has been corrected.
+
+ * Geometric repacking ("git repack --geometric=<n>") in a repository
+ that borrows from an alternate object database had various corner
+ case bugs, which have been corrected.
+ (merge d85cd18777 ps/fix-geom-repack-with-alternates later to maint).
+
+ * The "%GT" placeholder for the "--format" option of "git log" and
+ friends caused BUG() to trigger on a commit signed with an unknown
+ key, which has been corrected.
+ (merge 7891e46585 jk/gpg-trust-level-fix later to maint).
+
+ * The completion script used to use bare "read" without the "-r"
+ option to read the contents of various state files, which risked
+ getting confused with backslashes in them. This has been
+ corrected.
+ (merge 197152098a ek/completion-use-read-r-to-read-literally later to maint).
+
+ * A small API fix to the ort merge strategy backend.
+ (merge 000c4ceca7 en/ort-finalize-after-0-merges-fix later to maint).
+
+ * The commit object parser has been taught to be a bit more lenient
+ to parse timestamps on the author/committer line with a malformed
+ author/committer ident.
+ (merge 90ef0f14eb jk/parse-commit-with-malformed-ident later to maint).
+
+ * Retitle a test script with an overly narrow name.
+ (merge 8bb19c14fb ob/t3501-retitle later to maint).
+
+ * Doc update to clarify how text and eol attributes interact to
+ specify the end-of-line conversion.
+ (merge 6696077ace ah/doc-attributes-text later to maint).
+
+ * Gitk updates from GfW project.
+ (merge 99e70f3077 js/gitk-fixes-from-gfw later to maint).
+
+ * "git diff --dirstat" leaked memory, which has been plugged.
+ (merge 83973981eb jc/dirstat-plug-leaks later to maint).
+
+ * "git merge-tree" reads the basic configuration, which can be used
+ by git forges to disable replace-refs feature.
+ (merge b6551feadf ds/merge-tree-use-config later to maint).
+
+ * A few bugs in the sequencer machinery that results in miscounting
+ the steps have been corrected.
+ (merge 170eea9750 js/rebase-count-fixes later to maint).
+
+ * Other code cleanup, docfix, build fix, etc.
+ (merge f7111175df as/doc-markup-fix later to maint).
+ (merge 90ff7c9898 fc/test-aggregation-clean-up later to maint).
+ (merge 9b0c7f308a jc/am-doc-refer-to-format-patch later to maint).
+ (merge b10cbdac4c bb/unicode-width-table-15 later to maint).
+ (merge 3457b50e8c ab/retire-scripted-add-p later to maint).
+ (merge d52fcf493b ds/p2000-fix-grep-sparse later to maint).
+ (merge ec063d2591 ss/hashmap-typofix later to maint).
+ (merge 1aaed69d11 rs/archive-mtime later to maint).
+ (merge 2da2cc9b28 ob/rollback-after-commit-lock-failure later to maint).
+ (merge 54dbd0933b ob/sequencer-save-head-simplify later to maint).
+ (merge a93cbe8d78 ar/test-cleanup-unused-file-creation later to maint).
+ (merge cc48ddd937 jk/chainlint-fixes later to maint).
+ (merge 4833b08426 ow/ref-format-remove-unused-member later to maint).
+ (merge d0ea2ca1cf dw/doc-submittingpatches-grammofix later to maint).
+ (merge fd72637423 ar/t2024-checkout-output-fix later to maint).
+ (merge d45cbe3fe0 ob/sequencer-i18n-fix later to maint).
+ (merge b734fe49fd ob/messages-capitalize-exception later to maint).
+ (merge ad353d7e77 ma/gittutorial-fixes later to maint).
+ (merge a5855fd8d4 ar/test-cleanup-unused-file-creation-part2 later to maint).
+ (merge 0c5308af30 sd/doc-gitignore-and-rm-cached later to maint).
+ (merge cbb83daeaf kh/doc-interpret-trailers-updates later to maint).
+ (merge 3d77fbb664 ar/config-count-tests-updates later to maint).
+ (merge b7cf25c8f4 jc/t9800-fix-use-of-show-s-raw later to maint).
diff --git a/Documentation/RelNotes/2.42.0.txt b/Documentation/RelNotes/2.42.0.txt
new file mode 100644
index 0000000..0f1897a
--- /dev/null
+++ b/Documentation/RelNotes/2.42.0.txt
@@ -0,0 +1,329 @@
+Git v2.42 Release Notes
+=======================
+
+UI, Workflows & Features
+
+ * "git pack-refs" learns "--include" and "--exclude" to tweak the ref
+ hierarchy to be packed using pattern matching.
+
+ * 'git worktree add' learned how to create a worktree based on an
+ orphaned branch with `--orphan`.
+
+ * "git pack-objects" learned to invoke a new hook program that
+ enumerates extra objects to be used as anchoring points to keep
+ otherwise unreachable objects in cruft packs.
+
+ * Add more "git var" for toolsmiths to learn various locations Git is
+ configured with either via the configuration or hard-coded defaults.
+
+ * 'git notes append' was taught '--separator' to specify string to insert
+ between paragraphs.
+
+ * The "git for-each-ref" family of commands learned placeholders
+ related to GPG signature verification.
+
+ * "git diff --no-index" learned to read from named pipes as if they
+ were regular files, to allow "git diff <(process) <(substitution)"
+ some shells support.
+
+ * Help newbies by suggesting that there are cases where force-pushing
+ is a valid and sensible thing to update a branch at a remote
+ repository, rather than reconciling with merge/rebase.
+
+ * "git blame --contents=file" has been taught to work in a bare
+ repository.
+
+ * "git branch -f X" to repoint the branch X said that X was "checked
+ out" in another worktree, even when branch X was not and instead
+ being bisected or rebased. The message was reworded to say the
+ branch was "in use".
+
+ * Tone down the warning on SHA-256 repositories being an experimental
+ curiosity. We do not have support for them to interoperate with
+ traditional SHA-1 repositories, but at this point, we do not plan
+ to make breaking changes to SHA-256 repositories and there is no
+ longer need for such a strongly phrased warning.
+
+
+Performance, Internal Implementation, Development Support etc.
+
+ * "git diff-tree" has been taught to take advantage of the
+ sparse-index feature.
+
+ * Clang's sanitizer implementation seems to work better than GCC's.
+ (merge d88d727143 jk/ci-use-clang-for-sanitizer-jobs later to maint).
+
+ * The object traversal using reachability bitmap done by
+ "pack-object" has been tweaked to take advantage of the fact that
+ using "boundary" commits as representative of all the uninteresting
+ ones can save quite a lot of object enumeration.
+
+ * discover_git_directory() no longer touches the_repository.
+
+ * "git worktree" learned to work better with sparse index feature.
+
+ * When the external merge driver is killed by a signal, its output
+ should not be trusted as a resolution with conflicts that is
+ proposed by the driver, but the code did.
+
+ * The set-up code for the get_revision() API now allows feeding
+ options like --all and --not in the --stdin mode.
+
+ * Move functions that are not about pure string manipulation out of
+ strbuf.[ch]
+
+ * "imap-send" codepaths got cleaned up to get rid of unused
+ parameters.
+
+ * Enumerating refs in the packed-refs file, while excluding refs that
+ match certain patterns, has been optimized.
+
+ * Mark-up unused parameters in the code so that we can eventually
+ enable -Wunused-parameter by default.
+
+ * Instead of inventing a custom counter variables for debugging,
+ use existing trace2 facility in the fsync customization codepath.
+
+ * "git branch --list --format=<format>" and friends are taught
+ a new "%(describe)" placeholder.
+
+ * Clarify how to choose the starting point for a new topic in
+ developer guidance document.
+
+ * The implementation of "get_sha1_hex()" that reads a hexadecimal
+ string that spells a full object name has been extended to cope
+ with any hash function used in the repository, but the "sha1" in
+ its name survived. Rename it to get_hash_hex(), a name that is
+ more consistent within its friends like get_hash_hex_algop().
+
+ * Command line parser fix, and a small parse-options API update.
+
+
+Fixes since v2.41
+-----------------
+
+ * "git tag" learned to leave the "$GIT_DIR/TAG_EDITMSG" file when the
+ command failed, so that the user can salvage what they typed.
+ (merge 08c12ec1d0 kh/keep-tag-editmsg-upon-failure later to maint).
+
+ * The "-s" (silent, squelch) option of the "diff" family of commands
+ did not interact with other options that specify the output format
+ well. This has been cleaned up so that it will clear all the
+ formatting options given before.
+ (merge 9d484b92ed jc/diff-s-with-other-options later to maint).
+
+ * Update documentation regarding Coccinelle patches.
+ (merge 3bd0097cfc gc/doc-cocci-updates later to maint).
+
+ * Some atoms that can be used in "--format=<format>" for "git ls-tree"
+ were not supported by "git ls-files", even though they were relevant
+ in the context of the latter.
+ (merge 4d28c4f75f zh/ls-files-format-atoms later to maint).
+
+ * Document more pseudo-refs and teach the command line completion
+ machinery to complete AUTO_MERGE.
+ (merge 982ff3a649 pb/complete-and-document-auto-merge-and-friends later to maint).
+
+ * "git submodule" code trusted the data coming from the config (and
+ the in-tree .gitmodules file) too much without validating, leading
+ to NULL dereference if the user mucks with a repository (e.g.
+ submodule.<name>.url is removed). This has been corrected.
+ (merge fbc806acd1 tb/submodule-null-deref-fix later to maint).
+
+ * The value of config.worktree is per-repository, but has been kept
+ in a singleton global variable per process. This has been OK as
+ most Git operations interacted with a single repository at a time,
+ but not right for operations like recursive "grep" that want to
+ access multiple repositories from a single process without forking.
+
+ The global variable has been eliminated and made into a member in
+ the per-repository data structure.
+ (merge 3867f6d650 vd/worktree-config-is-per-repository later to maint).
+
+ * "git [-c log.follow=true] log [--follow] ':(glob)f**'" used to barf.
+ (merge 8260bc5902 jk/log-follow-with-non-literal-pathspec later to maint).
+
+ * Introduce a mechanism to disable replace refs globally and per
+ repository.
+ (merge 9c7d1b057f ds/disable-replace-refs later to maint).
+
+ * "git cat-file --batch" and friends learned "-Z" that uses NUL
+ delimiter for both input and output.
+ (merge f79e18849b ps/cat-file-null-output later to maint).
+
+ * The reimplemented "git add -i" did not honor color.ui configuration.
+ (merge 6f74648cea ds/add-i-color-configuration-fix later to maint).
+
+ * Compilation fix for platforms without D_TYPE in struct dirent.
+ (merge 03bf92b9bf as/dtype-compilation-fix later to maint).
+
+ * Suggest to refrain from using hex literals that are non-portable
+ when writing printf(1) format strings.
+ (merge f0b68f0546 jt/doc-use-octal-with-printf later to maint).
+
+ * Simplify error message when run-command fails to start a command.
+ (merge 6d224ac286 rs/run-command-exec-error-on-noent later to maint).
+
+ * Gracefully deal with a stale MIDX file that lists a packfile that
+ no longer exists.
+ (merge 06f3867865 tb/open-midx-bitmap-fallback later to maint).
+
+ * Even when diff.ignoreSubmodules tells us to ignore submodule
+ changes, "git commit" with an index that already records changes to
+ submodules should include the submodule changes in the resulting
+ commit, but it did not.
+ (merge 5768478edc js/defeat-ignore-submodules-config-with-explicit-addition later to maint).
+
+ * When "git commit --trailer=..." invokes the interpret-trailers
+ machinery, it knows what it feeds to interpret-trailers is a full
+ log message without any patch, but failed to express that by
+ passing the "--no-divider" option, which has been corrected.
+ (merge be3d654343 jk/commit-use-no-divider-with-interpret-trailers later to maint).
+
+ * Avoid breakage of "git pack-objects --cruft" due to inconsistency
+ between the way the code enumerates packfiles in the repository.
+ (merge 73320e49ad tb/collect-pack-filenames-fix later to maint).
+
+ * We create .pack and then .idx, we consider only packfiles that have
+ .idx usable (those with only .pack are not ready yet), so we should
+ remove .idx before removing .pack for consistency.
+ (merge 0dd1324a73 ds/remove-idx-before-pack later to maint).
+
+ * Partially revert a sanity check that the rest of the config code
+ was not ready, to avoid triggering it in a corner case.
+ (merge a53f43f900 gc/config-partial-submodule-kvi-fix later to maint).
+
+ * "git apply" punts when it is fed too large a patch input; the error
+ message it gives when it happens has been clarified.
+ (merge 42612e18d2 pw/apply-too-large later to maint).
+
+ * During a cherry-pick or revert session that works on multiple
+ commits, "git status" did not give correct information, which has
+ been corrected.
+ (merge a096a889f4 jk/cherry-pick-revert-status later to maint).
+
+ * A few places failed to differentiate the case where the index is
+ truly empty (nothing added) and we haven't yet read from the
+ on-disk index file, which have been corrected.
+ (merge 2ee045eea1 js/empty-index-fixes later to maint).
+
+ * "git bugreport" tests did not test what it wanted to test, which
+ has been corrected.
+ (merge 1aa92b8500 ma/t0091-fixup later to maint).
+
+ * Code snippets in a tutorial document no longer compiled after
+ recent header shuffling, which have been corrected.
+ (merge bbd7c7b7c0 vd/adjust-mfow-doc-to-updated-headers later to maint).
+
+ * "git ls-files '(attr:X)D/'" that triggers the common prefix
+ optimization codepath failed to read from "D/.gitattributes",
+ which has been corrected.
+ (merge f4a8fde057 jc/pathspec-match-with-common-prefix later to maint).
+
+ * "git fsck --no-progress" still spewed noise from the commit-graph
+ subsystem, which has been corrected.
+ (merge 9281cd07f0 tb/fsck-no-progress later to maint).
+
+ * Various offset computation in the code that accesses the packfiles
+ and other data in the object layer has been hardened against
+ arithmetic overflow, especially on 32-bit systems.
+ (merge 9a25cad7e0 tb/object-access-overflow-protection later to maint).
+
+ * Names of MinGW header files are spelled in mixed case in some
+ source files, but the build host can be using case sensitive
+ filesystem with header files with their name spelled in all
+ lowercase.
+ (merge 4a53d0d0bc mh/mingw-case-sensitive-build later to maint).
+
+ * Update message mark-up for i18n in "git bundle".
+ (merge bbb6acd998 dk/bundle-i18n-more later to maint).
+
+ * "git tag --list --points-at X" showed tags that directly refers to
+ object X, but did not list a tag that points at such a tag, which
+ has been corrected.
+
+ * "./configure --with-expat=no" did not work as a way to refuse use
+ of the expat library on a system with the library installed, which
+ has been corrected.
+ (merge fb8f7269c2 ah/autoconf-fixes later to maint).
+
+ * When the user edits "rebase -i" todo file so that it starts with a
+ "fixup", which would make it invalid, the command truncated the
+ rest of the file before giving an error and returning the control
+ back to the user. Stop truncating to make it easier to correct
+ such a malformed todo file.
+ (merge 9645a087c2 ah/sequencer-rewrite-todo-fix later to maint).
+
+ * Rewrite the description of giving a custom command to the
+ submodule.<name>.update configuration variable.
+ (merge 7cebc5bd78 pv/doc-submodule-update-settings later to maint).
+
+ * Adjust to OpenSSL 3+, which deprecates its SHA-1 functions based on
+ its traditional API, by using its EVP API instead.
+ (merge bda9c12073 ew/hash-with-openssl-evp later to maint).
+
+ * Exclude "." from the set of characters to be removed from the
+ beginning and the end of the human-readable name.
+ (merge 1c04cb0744 bc/ident-dot-is-no-longer-crud-letter later to maint).
+
+ * "git bisect visualize" stopped running "gitk" on Git for Windows
+ when the command was reimplemented in C around Git 2.34 timeframe.
+ This has been corrected.
+ (merge fff1594fa7 ma/locate-in-path-for-windows later to maint).
+
+ * "git rebase -i" with a series of squash/fixup, when one of the
+ steps stopped in conflicts and ended up getting skipped, did not
+ handle the accumulated commit log messages, which has been
+ corrected.
+ (merge 6ce7afe163 pw/rebase-skip-commit-message-fix later to maint).
+
+ * Adjust to newer Term::ReadLine to prevent it from breaking
+ the interactive prompt code in send-email.
+ (merge c016726c2d jk/send-email-with-new-readline later to maint).
+
+ * Windows updates.
+ (merge 0050f8e401 ds/maintenance-on-windows-fix later to maint).
+
+ * Correct use of lstat() that assumed a failing call would not
+ clobber the statbuf.
+ (merge 72695d8214 st/mv-lstat-fix later to maint).
+
+ * Other code cleanup, docfix, build fix, etc.
+ (merge 51f9d2e563 sa/doc-ls-remote later to maint).
+ (merge c6d26a9dda jk/format-patch-message-id-unleak later to maint).
+ (merge f7e063f326 ps/fetch-cleanups later to maint).
+ (merge e4cf013468 tl/quote-problematic-arg-for-clarity later to maint).
+ (merge 20025fdfc7 tz/test-ssh-verifytime-fix later to maint).
+ (merge e48a21df65 tz/test-fix-pthreads-prereq later to maint).
+ (merge 68b51172e3 mh/commit-reach-get-reachable-plug-leak later to maint).
+ (merge aeee1408ce kh/use-default-notes-doc later to maint).
+ (merge 3b8724bce6 jc/test-modernization later to maint).
+ (merge 447a3b7331 jc/test-modernization-2 later to maint).
+ (merge d57fa7fc73 la/doc-interpret-trailers later to maint).
+ (merge 548afb0d9a la/docs-typofixes later to maint).
+ (merge 3744ffcbcd rs/doc-ls-tree-hex-literal later to maint).
+ (merge 6c26da8404 mh/credential-erase-improvements later to maint).
+ (merge 78e56cff69 tz/lib-gpg-prereq-fix later to maint).
+ (merge 80d32e84b5 rj/leakfixes later to maint).
+ (merge 0a868031ed pb/complete-diff-options later to maint).
+ (merge d4f28279ad jc/doc-hash-object-types later to maint).
+ (merge 1876a5ae15 ks/t4205-test-describe-with-abbrev-fix later to maint).
+ (merge 6e6a529b57 jk/fsck-indices-in-worktrees later to maint).
+ (merge 3e81b896f7 rs/packet-length-simplify later to maint).
+ (merge 4c9cb51fe7 mh/doc-credential-helpers later to maint).
+ (merge 3437f549dd jr/gitignore-doc-example-markup later to maint).
+ (merge 947ebd62a0 jc/am-parseopt-fix later to maint).
+ (merge e12cb98e1e jc/branch-parseopt-fix later to maint).
+ (merge d6f598e443 jc/gitignore-doc-pattern-markup later to maint).
+ (merge a2dad4868b jc/transport-parseopt-fix later to maint).
+ (merge 68cbb20e73 jc/parse-options-show-branch later to maint).
+ (merge 3821eb6c3d jc/parse-options-reset later to maint).
+ (merge c48af99a3e bb/trace2-comment-fix later to maint).
+ (merge c95ae3ff9c rs/describe-parseopt-fix later to maint).
+ (merge 36f76d2a25 rs/pack-objects-parseopt-fix later to maint).
+ (merge 30c8c55cbf jc/tree-walk-drop-base-offset later to maint).
+ (merge d089a06421 rs/bundle-parseopt-cleanup later to maint).
+ (merge 823839bda1 ew/sha256-gcrypt-leak-fixes later to maint).
+ (merge a5c01603b3 bc/ignore-clangd-cache later to maint).
+ (merge 12009a182b js/allow-t4000-to-be-indented-with-spaces later to maint).
+ (merge b3dcd24b8a jc/send-email-pre-process-fix later to maint).
diff --git a/Documentation/RelNotes/2.42.1.txt b/Documentation/RelNotes/2.42.1.txt
new file mode 100644
index 0000000..3d391b7
--- /dev/null
+++ b/Documentation/RelNotes/2.42.1.txt
@@ -0,0 +1,88 @@
+Git 2.42.1 Release Notes
+========================
+
+There is nothing exciting to see here. Relative to Git 2.42, this
+release contains the fixes that have already been merged to the
+'master' branch of the development towards Git 2.43 that has been
+tagged as Git 2.43.0-rc0.
+
+Fixes since Git 2.42.0
+----------------------
+
+ * Tests that are known to pass with LSan are now marked as such.
+
+ * Flaky "git p4" tests, as well as "git svn" tests, are now skipped
+ in the (rather expensive) sanitizer CI job.
+
+ * Tests with LSan from time to time seem to emit harmless message
+ that makes our tests unnecessarily flaky; we work it around by
+ filtering the uninteresting output.
+
+ * GitHub CI workflow has learned to trigger Coverity check.
+
+ * Overly long label names used in the sequencer machinery are now
+ chopped to fit under filesystem limitation.
+
+ * Scalar updates.
+
+ * Tweak GitHub Actions CI so that pushing the same commit to multiple
+ branch tips at the same time will not waste building and testing
+ the same thing twice.
+
+ * The commit-graph verification code that detects mixture of zero and
+ non-zero generation numbers has been updated.
+
+ * "git diff -w --exit-code" with various options did not work
+ correctly, which is being addressed.
+
+ * transfer.unpackLimit ought to be used as a fallback, but overrode
+ fetch.unpackLimit and receive.unpackLimit instead.
+
+ * The use of API between two calls to require_clean_work_tree() from
+ the sequencer code has been cleaned up for consistency.
+
+ * "git diff --no-such-option" and other corner cases around the exit
+ status of the "diff" command has been corrected.
+
+ * "git for-each-ref --sort='contents:size'" sorts the refs according
+ to size numerically, giving a ref that points at a blob twelve-byte
+ (12) long before showing a blob hundred-byte (100) long.
+
+ * Various fixes to the behavior of "rebase -i" when the command got
+ interrupted by conflicting changes.
+
+ * References from description of the `--patch` option in various
+ manual pages have been simplified and improved.
+
+ * "git grep -e A --no-or -e B" is accepted, even though the negation
+ of "or" did not mean anything, which has been tightened.
+
+ * The completion script (in contrib/) has been taught to treat the
+ "-t" option to "git checkout" and "git switch" just like the
+ "--track" option, to complete remote-tracking branches.
+
+ * "git diff --no-index -R <(one) <(two)" did not work correctly,
+ which has been corrected.
+
+ * Update "git maintenance" timers' implementation based on systemd
+ timers to work with WSL.
+
+ * "git diff --cached" codepath did not fill the necessary stat
+ information for a file when fsmonitor knows it is clean and ended
+ up behaving as if it is not clean, which has been corrected.
+
+ * Clarify how "alias.foo = : git cmd ; aliased-command-string" should
+ be spelled with necessary whitespaces around punctuation marks to
+ work.
+
+ * HTTP Header redaction code has been adjusted for a newer version of
+ cURL library that shows its traces differently from earlier
+ versions.
+
+ * An error message given by "git send-email" when given a malformed
+ address did not give correct information, which has been corrected.
+
+ * UBSan options were not propagated through the test framework to git
+ run via the httpd, unlike ASan options, which has been corrected.
+
+Also contains various documentation updates, code clean-ups and minor fixups.
diff --git a/Documentation/RelNotes/2.43.0.txt b/Documentation/RelNotes/2.43.0.txt
new file mode 100644
index 0000000..e0e5b53
--- /dev/null
+++ b/Documentation/RelNotes/2.43.0.txt
@@ -0,0 +1,323 @@
+Git v2.43 Release Notes
+=======================
+
+Backward Compatibility Notes
+
+ * The "--rfc" option of "git format-patch" used to be a valid way to
+ override an earlier "--subject-prefix=<something>" on the command
+ line and replace it with "[RFC PATCH]", but from this release, it
+ merely prefixes the string "RFC " in front of the given subject
+ prefix. If you are negatively affected by this change, please use
+ "--subject-prefix=PATCH --rfc" as a replacement.
+
+ * In Git 2.42, "git rev-list --stdin" learned to take non-revisions
+ (like "--not") from the standard input, but the way such a "--not" was
+ handled was quite confusing, which has been rethought. The updated
+ rule is that "--not" given from the command line only affects revs
+ given from the command line that comes but not revs read from the
+ standard input, and "--not" read from the standard input affects
+ revs given from the standard input and not revs given from the
+ command line.
+
+UI, Workflows & Features
+
+ * A message written in olden time prevented a branch from getting
+ checked out, saying it is already checked out elsewhere. But these
+ days, we treat a branch that is being bisected or rebased just like
+ a branch that is checked out and protect it from getting modified
+ with the same codepath. The message has been rephrased to say that
+ the branch is "in use" to avoid confusion.
+
+ * Hourly and other schedules of "git maintenance" jobs are randomly
+ distributed now.
+
+ * "git cmd -h" learned to signal which options can be negated by
+ listing such options like "--[no-]opt".
+
+ * The way authentication related data other than passwords (e.g.,
+ oauth token and password expiration data) are stored in libsecret
+ keyrings has been rethought.
+
+ * Update the libsecret and wincred credential helpers to correctly
+ match which credential to erase; they erased the wrong entry in
+ some cases.
+
+ * Git GUI updates.
+
+ * "git format-patch" learned a new "--description-file" option that
+ lets cover letter description to be fed; this can be used on
+ detached HEAD where there is no branch description available, and
+ also can override the branch description if there is one.
+
+ * Use of the "--max-pack-size" option to allow multiple packfiles to
+ be created is now supported even when we are sending unreachable
+ objects to cruft packs.
+
+ * "git format-patch --rfc --subject-prefix=<foo>" used to ignore the
+ "--subject-prefix" option and used "[RFC PATCH]"; now we will add
+ "RFC" prefix to whatever subject prefix is specified.
+
+ * "git log --format" has been taught the %(decorate) placeholder for
+ further customization over what the "--decorate" option offers.
+
+ * The default log message created by "git revert", when reverting a
+ commit that records a revert, has been tweaked, to encourage people
+ to describe complex "revert of revert of revert" situations better in
+ their own words.
+
+ * The command-line completion support (in contrib/) learned to
+ complete "git commit --trailer=" for possible trailer keys.
+
+ * "git update-index" learned the "--show-index-version" option to
+ inspect the index format version used by the on-disk index file.
+
+ * "git diff" learned the "diff.statNameWidth" configuration variable,
+ to give the default width for the name part in the "--stat" output.
+
+ * "git range-diff --notes=foo" compared "log --notes=foo --notes" of
+ the two ranges, instead of using just the specified notes tree,
+ which has been corrected to use only the specified notes tree.
+
+ * The command line completion script (in contrib/) can be told to
+ complete aliases by including ": git <cmd> ;" in the alias to tell
+ it that the alias should be completed in a similar way to how "git
+ <cmd>" is completed. The parsing code for the alias has been
+ loosened to allow ';' without an extra space before it.
+
+ * "git for-each-ref" and friends learned to apply mailmap to
+ authorname and other fields in a more flexible way than using
+ separate placeholder letters like %a[eElL] every time we want to
+ come up with small variants.
+
+ * "git repack" machinery learned to pay attention to the "--filter="
+ option.
+
+ * "git repack" learned the "--max-cruft-size" option to prevent cruft
+ packs from growing without bounds.
+
+ * "git merge-tree" learned to take strategy backend specific options
+ via the "-X" option, like "git merge" does.
+
+ * "git log" and friends learned the "--dd" option that is a
+ short-hand for "--diff-merges=first-parent -p".
+
+ * The attribute subsystem learned to honor the "attr.tree"
+ configuration variable that specifies which tree to read the
+ .gitattributes files from.
+
+ * "git merge-file" learns a mode to read three variants of the
+ contents to be merged from blob objects.
+
+
+Performance, Internal Implementation, Development Support etc.
+
+ * "git check-attr" has been taught to work better with sparse-index.
+
+ * It may be tempting to leave the help text NULL for a command line
+ option that is either hidden or too obvious, but "git subcmd -h"
+ and "git subcmd --help-all" would have segfaulted if done so. Now
+ the help text is truly optional.
+
+ * Tests that are known to pass with LSan are now marked as such.
+
+ * Flaky "git p4" tests, as well as "git svn" tests, are now skipped
+ in the (rather expensive) sanitizer CI job.
+
+ * Tests with LSan from time to time seem to emit harmless messages
+ that make our tests unnecessarily flaky; we work around it by
+ filtering the uninteresting output.
+
+ * Unused parameters to functions are marked as such, and/or removed,
+ in order to bring us closer to "-Wunused-parameter" clean.
+
+ * The code to keep track of existing packs in the repository while
+ repacking has been refactored.
+
+ * The "streaming" interface used for bulk-checkin codepath has been
+ narrowed to take only blob objects for now, with no real loss of
+ functionality.
+
+ * GitHub CI workflow has learned to trigger Coverity check.
+
+ * Test coverage for trailers has been improved.
+
+ * The code to iterate over loose references has been optimized to
+ reduce the number of lstat() system calls.
+
+ * The codepaths that read "chunk" formatted files have been corrected
+ to pay attention to the chunk size and notice broken files.
+
+ * Replace macos-12 used at GitHub CI with macos-13.
+ (merge 682a868f67 js/ci-use-macos-13 later to maint).
+
+
+Fixes since v2.42
+-----------------
+
+ * Overly long label names used in the sequencer machinery are now
+ chopped to fit under filesystem limitation.
+
+ * Scalar updates.
+
+ * Tweak GitHub Actions CI so that pushing the same commit to multiple
+ branch tips at the same time will not waste building and testing
+ the same thing twice.
+
+ * The commit-graph verification code that detects a mixture of zero and
+ non-zero generation numbers has been updated.
+
+ * "git diff -w --exit-code" with various options did not work
+ correctly, which has been corrected.
+
+ * The "transfer.unpackLimit" configuration variable ought to be used
+ as a fallback, but overrode the more specific "fetch.unpackLimit"
+ and "receive.unpackLimit" configuration variables by mistake, which
+ has been corrected.
+
+ * The use of API between two calls to require_clean_work_tree() from
+ the sequencer code has been cleaned up for consistency.
+
+ * "git diff --no-such-option" and other corner cases around the exit
+ status of the "diff" command have been corrected.
+
+ * "git for-each-ref --sort='contents:size'" sorted the refs according
+ to size numerically, giving a ref that points at a blob twelve-byte
+ (12) long before showing a blob hundred-byte (100) long, which has
+ been corrected.
+
+ * We now limit the depth of the tree objects and maximum length of
+ pathnames recorded in tree objects.
+ (merge 4d5693ba05 jk/tree-name-and-depth-limit later to maint).
+
+ * Various fixes to the behavior of "rebase -i", when the command got
+ interrupted by conflicting changes, have been made.
+
+ * References from a description of the `--patch` option in various
+ manual pages have been simplified and improved.
+
+ * "git grep -e A --no-or -e B" is accepted, even though the negation
+ of the "--or" option did not mean anything, which has been tightened.
+
+ * The completion script (in contrib/) has been taught to treat the
+ "-t" option to "git checkout" and "git switch" just like the
+ "--track" option, to complete remote-tracking branches.
+
+ * "git diff --no-index -R <(one) <(two)" did not work correctly,
+ which has been corrected.
+
+ * "git maintenance" timers' implementation has been updated, based on
+ systemd timers, to work with WSL.
+
+ * "git diff --cached" codepath did not fill the necessary stat
+ information for a file when fsmonitor knows it is clean and ended
+ up behaving as if it were not clean, which has been corrected.
+
+ * How "alias.foo = : git cmd ; aliased-command-string" should be
+ spelled with necessary whitespace around punctuation marks to work
+ has been more clearly documented (but this will be moot with newer
+ versions of Git where the parsing rules have been improved).
+
+ * HTTP Header redaction code has been adjusted for a newer version of
+ cURL library that shows its traces differently from earlier
+ versions.
+
+ * An error message given by "git send-email", when given a malformed
+ address, did not show the offending address, which has been corrected.
+
+ * UBSan options were not propagated through the test framework to git
+ run via the httpd, unlike ASan options, which has been corrected.
+
+ * "checkout --merge -- path" and "update-index --unresolve path" did
+ not resurrect conflicted state that was resolved to remove path,
+ but now they do.
+ (merge 5bdedac3c7 jc/unresolve-removal later to maint).
+
+ * The display width table for unicode characters has been updated for
+ Unicode 15.1
+ (merge 872976c37e bb/unicode-width-table-15 later to maint).
+
+ * Update mailmap entry for Derrick.
+ (merge 6e5457d8c7 ds/mailmap-entry-update later to maint).
+
+ * In the ".gitmodules" files, submodules are keyed by their names,
+ and the path to the submodule whose name is $name is specified by
+ the submodule.$name.path variable. There were a few codepaths that
+ mixed the name and path up when consulting the submodule database,
+ which have been corrected. It took long for these bugs to be found
+ as the name of a submodule initially is the same as its path, and
+ the problem does not surface until it is moved to a different path,
+ which apparently happens very rarely.
+
+ * "git diff --merge-base X other args..." insisted that X must be a
+ commit and errored out when given an annotated tag that peels to a
+ commit, but we only need it to be a committish. This has been
+ corrected.
+ (merge 4adceb5a29 ar/diff-index-merge-base-fix later to maint).
+
+ * "git merge-tree" used to segfault when the "--attr-source"
+ option is used, which has been corrected.
+ (merge e95bafc52f jc/merge-ort-attr-index-fix later to maint).
+
+ * Unlike "git log --pretty=%D", "git log --pretty="%(decorate)" did
+ not auto-initialize the decoration subsystem, which has been
+ corrected.
+
+ * Feeding "git stash store" with a random commit that was not created
+ by "git stash create" now errors out.
+ (merge d9b6634589 jc/fail-stash-to-store-non-stash later to maint).
+
+ * The index file has room only for the lower 32-bit of the file size in
+ the cached stat information, which means cached stat information
+ will have 0 in its sd_size member for a file whose size is a multiple
+ of 4GiB. This is mistaken for a racily clean path. Avoid it by
+ storing a bogus sd_size value instead for such files.
+ (merge 5143ac07b1 bc/racy-4gb-files later to maint).
+
+ * "git p4" tried to store symlinks to LFS when told, but has been
+ fixed not to do so, because it does not make sense.
+ (merge 10c89a02b0 mm/p4-symlink-with-lfs later to maint).
+
+ * The codepath to handle recipient addresses `git send-email
+ --compose` learns from the user was completely broken, which has
+ been corrected.
+ (merge 3ec6167567 jk/send-email-fix-addresses-from-composed-messages later to maint).
+
+ * "cd sub && git grep -f patterns" tried to read "patterns" file at
+ the top level of the working tree; it has been corrected to read
+ "sub/patterns" instead.
+
+ * "git reflog expire --single-worktree" has been broken for the past
+ 20 months or so, which has been corrected.
+
+ * "git send-email" did not have certain pieces of data computed yet
+ when it tried to validate the outgoing messages and its recipient
+ addresses, which has been sorted out.
+
+ * "git bugreport" learned to complain when it received a command line
+ argument that it will not use.
+
+ * The codepath to traverse the commit-graph learned to notice that a
+ commit is missing (e.g., corrupt repository lost an object), even
+ though it knows something about the commit (like its parents) from
+ what is in commit-graph.
+ (merge 7a5d604443 ps/do-not-trust-commit-graph-blindly-for-existence later to maint).
+
+ * "git rev-list --missing" did not work for missing commit objects,
+ which has been corrected.
+
+ * "git rev-list --unpacked --objects" failed to exclude packed
+ non-commit objects, which has been corrected.
+ (merge 7b3c8e9f38 tb/rev-list-unpacked-fix later to maint).
+
+ * "To dereference" and "to peel" were sometimes used in in-code
+ comments and documentation but without description in the glossary.
+ (merge 893dce2ffb vd/glossary-dereference-peel later to maint).
+
+ * Other code cleanup, docfix, build fix, etc.
+ (merge c2c349a15c xz/commit-title-soft-limit-doc later to maint).
+ (merge 1bd809938a tb/format-pack-doc-update later to maint).
+ (merge 8f81532599 an/clang-format-typofix later to maint).
+ (merge 3ca86adc2d la/strvec-header-fix later to maint).
+ (merge 6789275d37 jc/test-i18ngrep later to maint).
+ (merge 9972cd6004 ps/leakfixes later to maint).
+ (merge 46edab516b tz/send-email-helpfix later to maint).
diff --git a/Documentation/RelNotes/2.43.1.txt b/Documentation/RelNotes/2.43.1.txt
new file mode 100644
index 0000000..20e96f2
--- /dev/null
+++ b/Documentation/RelNotes/2.43.1.txt
@@ -0,0 +1,82 @@
+Git 2.43.1 Release Notes
+========================
+
+There is nothing exciting to see here. Relative to Git 2.43, this
+release contains the fixes that have already been merged to the
+'master' branch of the development towards the next major release.
+
+Fixes since Git 2.43.0
+----------------------
+
+ * The way CI testing used "prove" could lead to running the test
+ suite twice needlessly, which has been corrected.
+
+ * Newer versions of Getopt::Long started giving warnings against our
+ (ab)use of it in "git send-email". Bump the minimum version
+ requirement for Perl to 5.8.1 (from September 2002) to allow
+ simplifying our implementation.
+
+ * Earlier we stopped relying on commit-graph that (still) records
+ information about commits that are lost from the object store,
+ which has negative performance implications. The default has been
+ flipped to disable this pessimization.
+
+ * Stale URLs have been updated to their current counterparts (or
+ archive.org) and HTTP links are replaced with working HTTPS links.
+
+ * trace2 streams used to record the URLs that potentially embed
+ authentication material, which has been corrected.
+
+ * The sample pre-commit hook that tries to catch introduction of new
+ paths that use potentially non-portable characters did not notice
+ an existing path getting renamed to such a problematic path, when
+ rename detection was enabled.
+
+ * The command line parser for the "log" family of commands was too
+ loose when parsing certain numbers, e.g., silently ignoring the
+ extra 'q' in "git log -n 1q" without complaining, which has been
+ tightened up.
+
+ * "git $cmd --end-of-options --rev -- --path" for some $cmd failed
+ to interpret "--rev" as a rev, and "--path" as a path. This was
+ fixed for many programs like "reset" and "checkout".
+
+ * "git bisect reset" has been taught to clean up state files and refs
+ even when BISECT_START file is gone.
+
+ * Some codepaths did not correctly parse configuration variables
+ specified with valueless "true", which has been corrected.
+
+ * Code clean-up for sanity checking of command line options for "git
+ show-ref".
+
+ * The code to parse the From e-mail header has been updated to avoid
+ recursion.
+
+ * "git fetch --atomic" issued an unnecessary empty error message,
+ which has been corrected.
+
+ * Command line completion script (in contrib/) learned to work better
+ with the reftable backend.
+
+ * "git status" is taught to show both the branch being bisected and
+ being rebased when both are in effect at the same time.
+ cf. <xmqqil76kyov.fsf@gitster.g>
+
+ * "git archive --list extra garbage" silently ignored excess command
+ line parameters, which has been corrected.
+
+ * "git sparse-checkout set" added default patterns even when the
+ patterns are being fed from the standard input, which has been
+ corrected.
+
+ * Unlike other environment variables that took the usual
+ true/false/yes/no as well as 0/1, GIT_FLUSH only understood 0/1,
+ which has been corrected.
+
+ * Clearing in-core repository (happens during e.g., "git fetch
+ --recurse-submodules" with commit graph enabled) made in-core
+ commit object in an inconsistent state by discarding the necessary
+ data from commit-graph too early, which has been corrected.
+
+Also contains various documentation updates, code clean-ups and minor fixups.
diff --git a/Documentation/RelNotes/2.43.2.txt b/Documentation/RelNotes/2.43.2.txt
new file mode 100644
index 0000000..5895e23
--- /dev/null
+++ b/Documentation/RelNotes/2.43.2.txt
@@ -0,0 +1,37 @@
+Git 2.43.2 Release Notes
+========================
+
+Relative to Git 2.43.1, this release has two important fixes to allow
+"git imap-send" to be built with NO_CURL defined, and to restore the
+forced flushing behaviour when GIT_FLUSH=1 is set. It also contains
+other, unexciting, fixes that have already been merged to the 'master'
+branch of the development towards the next major release.
+
+Fixes since Git 2.43.1
+----------------------
+
+ * Update to a new feature recently added, "git show-ref --exists".
+
+ * Rename detection logic ignored the final line of a file if it is an
+ incomplete line.
+
+ * "git diff --no-rename A B" did not disable rename detection but did
+ not trigger an error from the command line parser.
+
+ * "git diff --no-index file1 file2" segfaulted while invoking the
+ external diff driver, which has been corrected.
+
+ * Rewrite //-comments to /* comments */ in files whose comments
+ prevalently use the latter.
+
+ * A failed "git tag -s" did not necessarily result in an error
+ depending on the crypto backend, which has been corrected.
+
+ * "git stash" sometimes was silent even when it failed due to
+ unwritable index file, which has been corrected.
+
+ * Recent conversion to allow more than 0/1 in GIT_FLUSH broke the
+ mechanism by flipping what yes/no means by mistake, which has been
+ corrected.
+
+Also contains documentation updates, code clean-ups and minor fixups.
diff --git a/Documentation/RelNotes/2.43.3.txt b/Documentation/RelNotes/2.43.3.txt
new file mode 100644
index 0000000..924f205
--- /dev/null
+++ b/Documentation/RelNotes/2.43.3.txt
@@ -0,0 +1,12 @@
+Git 2.43.3 Release Notes
+========================
+
+Relative to Git 2.43.2, this release fixes one regression that
+manifests while running "git commit -v --trailer".
+
+Fixes since Git 2.43.2
+----------------------
+
+ * "git commit -v --trailer=..." was broken with recent update and
+ placed the trailer _after_ the divider line, which has been
+ corrected.
diff --git a/Documentation/RelNotes/2.44.0.txt b/Documentation/RelNotes/2.44.0.txt
new file mode 100644
index 0000000..14f9ce8
--- /dev/null
+++ b/Documentation/RelNotes/2.44.0.txt
@@ -0,0 +1,334 @@
+Git v2.44 Release Notes
+=======================
+
+Backward Compatibility Notes
+
+ * "git checkout -B <branch>" used to allow switching to a branch that
+ is in use on another worktree, but this was by mistake. The users
+ need to use "--ignore-other-worktrees" option.
+
+
+UI, Workflows & Features
+
+ * "git add" and "git stash" learned to support the ":(attr:...)"
+ magic pathspec.
+
+ * "git rebase --autosquash" is now enabled for non-interactive rebase,
+ but it is still incompatible with the apply backend.
+
+ * Introduce "git replay", a tool meant on the server side without
+ working tree to recreate a history.
+
+ * "git merge-file" learned to take the "--diff-algorithm" option to
+ use algorithm different from the default "myers" diff.
+
+ * Command line completion (in contrib/) learned to complete path
+ arguments to the "add/set" subcommands of "git sparse-checkout"
+ better.
+
+ * "git checkout -B <branch> [<start-point>]" allowed a branch that is
+ in use in another worktree to be updated and checked out, which
+ might be a bit unexpected. The rule has been tightened, which is a
+ breaking change. "--ignore-other-worktrees" option is required to
+ unbreak you, if you are used to the current behaviour that "-B"
+ overrides the safety.
+
+ * The builtin_objectmode attribute is populated for each path
+ without adding anything in .gitattributes files, which would be
+ useful in magic pathspec, e.g., ":(attr:builtin_objectmode=100755)"
+ to limit to executables.
+
+ * "git fetch" learned to pay attention to "fetch.all" configuration
+ variable, which pretends as if "--all" was passed from the command
+ line when no remote parameter was given.
+
+ * In addition to (rather cryptic) Security Identifiers, show username
+ and domain in the error message when we barf on mismatch between
+ the Git directory and the current user on Windows.
+
+ * The error message given when "git branch -d branch" fails due to
+ commits unique to the branch has been split into an error and a new
+ conditional advice message.
+
+ * When given an existing but unreadable file as a configuration file,
+ gitweb behaved as if the file did not exist at all, but now it
+ errors out. This is a change that may break backward compatibility.
+
+ * When $HOME/.gitconfig is missing but XDG config file is available, we
+ should write into the latter, not former. "git gc" and "git
+ maintenance" wrote into a wrong "global config" file, which have
+ been corrected.
+
+ * Define "special ref" as a very narrow set that consists of
+ FETCH_HEAD and MERGE_HEAD, and clarify everything else that used to
+ be classified as such are actually just pseudorefs.
+
+ * All conditional "advice" messages show how to turn them off, which
+ becomes repetitive. Setting advice.* configuration explicitly on
+ now omits the instruction part.
+
+ * The "disable repository discovery of a bare repository" check,
+ triggered by setting safe.bareRepository configuration variable to
+ 'explicit', has been loosened to exclude the ".git/" directory inside
+ a non-bare repository from the check. So you can do "cd .git &&
+ git cmd" to run a Git command that works on a bare repository without
+ explicitly specifying $GIT_DIR now.
+
+ * The completion script (in contrib/) learned more options that can
+ be used with "git log".
+
+ * The labels on conflict markers for the common ancestor, our version,
+ and the other version are available to custom 3-way merge driver
+ via %S, %X, and %Y placeholders.
+
+ * The write codepath for the reftable data learned to honor
+ core.fsync configuration.
+
+ * The "--fsck-objects" option of "git index-pack" now can take the
+ optional parameter to tweak severity of different fsck errors.
+
+ * The wincred credential backend has been taught to support oauth
+ refresh token the same way as credential-cache and
+ credential-libsecret backends.
+
+ * Command line completion support (in contrib/) has been
+ updated for "git bisect".
+
+ * "git branch" and friends learned to use the formatted text as
+ sorting key, not the underlying timestamp value, when the --sort
+ option is used with author or committer timestamp with a format
+ specifier (e.g., "--sort=creatordate:format:%H:%M:%S").
+
+ * The command line completion script (in contrib/) learned to
+ complete configuration variable names better.
+
+
+Performance, Internal Implementation, Development Support etc.
+
+ * Process to add some form of low-level unit tests has started.
+
+ * Add support for GitLab CI.
+
+ * "git for-each-ref --no-sort" still sorted the refs alphabetically
+ which paid non-trivial cost. It has been redefined to show output
+ in an unspecified order, to allow certain optimizations to take
+ advantage of.
+
+ * Simplify API implementation to delete references by eliminating
+ duplication.
+
+ * Subject approxidate() and show_date() machinery to OSS-Fuzz.
+
+ * A new helper to let us pretend that we called lstat() when we know
+ our cache_entry is up-to-date via fsmonitor.
+
+ * The optimization based on fsmonitor in the "diff --cached"
+ codepath is resurrected with the "fake-lstat" introduced earlier.
+
+ * Test balloon to use C99 "bool" type from <stdbool.h> has been
+ added.
+
+ * "git clone" has been prepared to allow cloning a repository with
+ non-default hash function into a repository that uses the reftable
+ backend.
+
+ * Streaming spans of packfile data used to be done only from a
+ single, primary, pack in a repository with multiple packfiles. It
+ has been extended to allow reuse from other packfiles, too.
+
+ * Comment updates to help developers not to attempt to modify
+ messages from plumbing commands that must stay constant.
+
+ It might make sense to reassess the plumbing needs every few years,
+ but that should be done as a separate effort.
+
+ * Move test-ctype helper to the unit-test framework.
+
+ * Instead of manually creating refs/ hierarchy on disk upon a
+ creation of a secondary worktree, which is only usable via the
+ files backend, use the refs API to populate it.
+
+ * CI for GitLab learned to drive macOS jobs.
+
+ * A few tests to "git commit -o <pathspec>" and "git commit -i
+ <pathspec>" has been added.
+
+ * Tests on ref API are moved around to prepare for reftable.
+
+ * The Makefile often had to say "-L$(path) -R$(path)" that repeats
+ the path to the same library directory for link time and runtime.
+ A Makefile template is used to reduce such repetition.
+
+ * The priority queue test has been migrated to the unit testing
+ framework.
+
+ * Setting `feature.experimental` opts the user into multi-pack reuse
+ experiment
+
+ * Squelch node.js 16 deprecation warnings from GitHub Actions CI
+ by updating actions/github-script and actions/checkout that use
+ node.js 20.
+
+ * The mechanism to report the filename in the source code, used by
+ the unit-test machinery, assumed that the compiler expanded __FILE__
+ to the path to the source given to the $(CC), but some compilers
+ give full path, breaking the output. This has been corrected.
+
+
+Fixes since v2.43
+-----------------
+
+ * The way CI testing used "prove" could lead to running the test
+ suite twice needlessly, which has been corrected.
+
+ * Update ref-related tests.
+
+ * "git format-patch --encode-email-headers" ignored the option when
+ preparing the cover letter, which has been corrected.
+
+ * Newer versions of Getopt::Long started giving warnings against our
+ (ab)use of it in "git send-email". Bump the minimum version
+ requirement for Perl to 5.8.1 (from September 2002) to allow
+ simplifying our implementation.
+
+ * Earlier we stopped relying on commit-graph that (still) records
+ information about commits that are lost from the object store,
+ which has negative performance implications. The default has been
+ flipped to disable this pessimization.
+
+ * Stale URLs have been updated to their current counterparts (or
+ archive.org) and HTTP links are replaced with working HTTPS links.
+
+ * trace2 streams used to record the URLs that potentially embed
+ authentication material, which has been corrected.
+
+ * The sample pre-commit hook that tries to catch introduction of new
+ paths that use potentially non-portable characters did not notice
+ an existing path getting renamed to such a problematic path, when
+ rename detection was enabled.
+
+ * The command line parser for the "log" family of commands was too
+ loose when parsing certain numbers, e.g., silently ignoring the
+ extra 'q' in "git log -n 1q" without complaining, which has been
+ tightened up.
+
+ * "git $cmd --end-of-options --rev -- --path" for some $cmd failed
+ to interpret "--rev" as a rev, and "--path" as a path. This was
+ fixed for many programs like "reset" and "checkout".
+
+ * "git bisect reset" has been taught to clean up state files and refs
+ even when BISECT_START file is gone.
+
+ * Some codepaths did not correctly parse configuration variables
+ specified with valueless "true", which has been corrected.
+
+ * Code clean-up for sanity checking of command line options for "git
+ show-ref".
+
+ * The code to parse the From e-mail header has been updated to avoid
+ recursion.
+
+ * "git fetch --atomic" issued an unnecessary empty error message,
+ which has been corrected.
+
+ * Command line completion script (in contrib/) learned to work better
+ with the reftable backend.
+
+ * "git status" is taught to show both the branch being bisected and
+ being rebased when both are in effect at the same time.
+
+ * "git archive --list extra garbage" silently ignored excess command
+ line parameters, which has been corrected.
+
+ * "git sparse-checkout set" added default patterns even when the
+ patterns are being fed from the standard input, which has been
+ corrected.
+
+ * "git sparse-checkout (add|set) --[no-]cone --end-of-options" did
+ not handle "--end-of-options" correctly after a recent update.
+
+ * Unlike other environment variables that took the usual
+ true/false/yes/no as well as 0/1, GIT_FLUSH only understood 0/1,
+ which has been corrected.
+
+ * Clearing in-core repository (happens during e.g., "git fetch
+ --recurse-submodules" with commit graph enabled) made in-core
+ commit object in an inconsistent state by discarding the necessary
+ data from commit-graph too early, which has been corrected.
+
+ * Update to a new feature recently added, "git show-ref --exists".
+
+ * oss-fuzz tests are built and run in CI.
+ (merge c4a9cf1df3 js/oss-fuzz-build-in-ci later to maint).
+
+ * Rename detection logic ignored the final line of a file if it is an
+ incomplete line.
+
+ * GitHub CI update.
+ (merge 0188b2c8e0 pb/ci-github-skip-logs-for-broken-tests later to maint).
+
+ * "git diff --no-rename A B" did not disable rename detection but did
+ not trigger an error from the command line parser.
+
+ * "git archive --remote=<remote>" learned to talk over the smart
+ http (aka stateless) transport.
+ (merge 176cd68634 jx/remote-archive-over-smart-http later to maint).
+
+ * Fetching via protocol v0 over Smart HTTP transport sometimes failed
+ to correctly auto-follow tags.
+ (merge fba732c462 jk/fetch-auto-tag-following-fix later to maint).
+
+ * The documentation for the --exclude-per-directory option marked it
+ as deprecated, which confused readers into thinking there may be a
+ plan to remove it in the future, which was not our intention.
+ (merge 0009542cab jc/ls-files-doc-update later to maint).
+
+ * "git diff --no-index file1 file2" segfaulted while invoking the
+ external diff driver, which has been corrected.
+
+ * Rewrite //-comments to /* comments */ in files whose comments
+ prevalently use the latter.
+
+ * Cirrus CI jobs started breaking because we specified version of
+ FreeBSD that is no longer available, which has been corrected.
+ (merge 81fffb66d3 cb/use-freebsd-13-2-at-cirrus-ci later to maint).
+
+ * A caller called index_file_exists() that takes a string expressed
+ as <ptr, length> with a wrong length, which has been corrected.
+ (merge 156e28b36d jh/sparse-index-expand-to-path-fix later to maint).
+
+ * A failed "git tag -s" did not necessarily result in an error
+ depending on the crypto backend, which has been corrected.
+
+ * "git stash" sometimes was silent even when it failed due to
+ unwritable index file, which has been corrected.
+
+ * "git show-ref --verify" did not show things like "CHERRY_PICK_HEAD",
+ which has been corrected.
+
+ * Recent conversion to allow more than 0/1 in GIT_FLUSH broke the
+ mechanism by flipping what yes/no means by mistake, which has been
+ corrected.
+
+ * The sequencer machinery does not use the ref API and instead
+ records names of certain objects it needs for its correct operation
+ in temporary files, which makes these objects susceptible to loss
+ by garbage collection. These temporary files have been added as
+ starting points for reachability analysis to fix this.
+ (merge bc7f5db896 pw/gc-during-rebase later to maint).
+
+ * "git cherry-pick" invoked during "git rebase -i" session lost
+ the authorship information, which has been corrected.
+ (merge e4301f73ff vn/rebase-with-cherry-pick-authorship later to maint).
+
+ * The code paths that call repo_read_object_file() have been
+ tightened to react to errors.
+ (merge 568459bf5e js/check-null-from-read-object-file later to maint).
+
+ * Other code cleanup, docfix, build fix, etc.
+ (merge 5aea3955bc rj/clarify-branch-doc-m later to maint).
+ (merge 9cce3be2df bk/bisect-doc-fix later to maint).
+ (merge 8430b438f6 vd/fsck-submodule-url-test later to maint).
+ (merge 3cb4384683 jc/t0091-with-unknown-git later to maint).
+ (merge 020456cb74 rs/receive-pack-remove-find-header later to maint).
+ (merge bc47139f4f la/trailer-cleanups later to maint).
diff --git a/Documentation/RelNotes/2.45.0.txt b/Documentation/RelNotes/2.45.0.txt
new file mode 100644
index 0000000..15704ff
--- /dev/null
+++ b/Documentation/RelNotes/2.45.0.txt
@@ -0,0 +1,433 @@
+Git v2.45 Release Notes
+=======================
+
+Backward Compatibility Notes
+
+UI, Workflows & Features
+
+ * Integrate the reftable code into the refs framework as a backend.
+ With "git init --ref-format=reftable", hopefully it would be a lot
+ more efficient to manage a repository with many references.
+
+ * "git checkout -p" and friends learned that that "@" is a synonym
+ for "HEAD".
+
+ * Variants of vimdiff learned to honor mergetool.<variant>.layout
+ settings.
+
+ * "git reflog" learned a "list" subcommand that enumerates known reflogs.
+
+ * When a merge conflicted at a submodule, merge-ort backend used to
+ unconditionally give a lengthy message to suggest how to resolve
+ it. Now the message can be squelched as an advice message.
+
+ * "git for-each-ref" learned "--include-root-refs" option to show
+ even the stuff outside the 'refs/' hierarchy.
+
+ * "git rev-list --missing=print" has learned to optionally take
+ "--allow-missing-tips", which allows the objects at the starting
+ points to be missing.
+
+ * "git merge-tree" has learned that the three trees involved in the
+ 3-way merge only need to be trees, not necessarily commits.
+
+ * "git log --merge" learned to pay attention to CHERRY_PICK_HEAD and
+ other kinds of *_HEAD pseudorefs.
+
+ * Platform specific tweaks for OS/390 has been added to
+ config.mak.uname.
+
+ * Users with safe.bareRepository=explicit can still work from within
+ $GIT_DIR of a seconary worktree (which resides at .git/worktrees/$name/)
+ of the primary worktree without explicitly specifying the $GIT_DIR
+ environment variable or the --git-dir=<path> option.
+
+ * The output format for dates "iso-strict" has been tweaked to show
+ a time in the Zulu timezone with "Z" suffix, instead of "+00:00".
+
+ * "git diff" and friends learned two extra configuration variables,
+ diff.srcPrefix and diff.dstPrefix.
+
+ * The status.showUntrackedFiles configuration variable had a name
+ that tempts users to set a Boolean value expressed in our usual
+ "false", "off", and "0", but it only took "no". This has been
+ corrected so "true" and its synonyms are taken as "normal", while
+ "false" and its synonyms are taken as "no".
+
+ * Remove an ancient and not well maintained Hg-to-git migration
+ script from contrib/.
+
+ * Hints that suggest what to do after resolving conflicts can now be
+ squelched by disabling advice.mergeConflict.
+
+ * Allow git-cherry-pick(1) to automatically drop redundant commits via
+ a new `--empty` option, similar to the `--empty` options for
+ git-rebase(1) and git-am(1). Includes a soft deprecation of
+ `--keep-redundant-commits` as well as some related docs changes and
+ sequencer code cleanup.
+
+ * "git config" learned "--comment=<message>" option to leave a
+ comment immediately after the "variable = value" on the same line
+ in the configuration file.
+
+ * core.commentChar used to be limited to a single byte, but has been
+ updated to allow an arbitrary multi-byte sequence.
+
+ * "git add -p" and other "interactive hunk selection" UI has learned to
+ skip showing the hunk immediately after it has already been shown, and
+ an additional action to explicitly ask to reshow the current hunk.
+
+ * "git pack-refs" learned the "--auto" option, which defers the decision of
+ whether and how to pack to the ref backend. This is used by the reftable
+ backend to avoid repacking of an already-optimal ref database. The new mode
+ is triggered from "git gc --auto".
+
+ * "git add -u <pathspec>" and "git commit [-i] <pathspec>" did not
+ diagnose a pathspec element that did not match any files in certain
+ situations, unlike "git add <pathspec>" did.
+
+ * The userdiff patterns for C# has been updated.
+
+
+Performance, Internal Implementation, Development Support etc.
+
+ * The code to iterate over refs with the reftable backend has seen
+ some optimization.
+
+ * More tests that are marked as "ref-files only" have been updated to
+ improve test coverage of reftable backend.
+
+ * Some parts of command line completion script (in contrib/) have
+ been micro-optimized.
+
+ * The way placeholders are to be marked-up in documentation have been
+ specified; use "_<placeholder>_" to typeset the word inside a pair
+ of <angle-brackets> emphasized.
+
+ * "git --no-lazy-fetch cmd" allows to run "cmd" while disabling lazy
+ fetching of objects from the promisor remote, which may be handy
+ for debugging.
+
+ * The implementation in "git clean" that makes "-n" and "-i" ignore
+ clean.requireForce has been simplified, together with the
+ documentation.
+
+ * Uses of xwrite() helper have been audited and updated for better
+ error checking and simpler code.
+
+ * Some trace2 events that lacked def_param have learned to show it,
+ enriching the output.
+
+ * The parse-options code that deals with abbreviated long option
+ names have been cleaned up.
+
+ * The code in reftable backend that creates new table files works
+ better with the tempfile framework to avoid leaving cruft after a
+ failure.
+
+ * The reftable code has its own custom binary search function whose
+ comparison callback has an unusual interface, which caused the
+ binary search to degenerate into a linear search, which has been
+ corrected.
+
+ * The code to iterate over reflogs in the reftable has been optimized
+ to reduce memory allocation and deallocation.
+
+ * Work to support a repository that work with both SHA-1 and SHA-256
+ hash algorithms has started.
+
+ * A new fuzz target that exercises config parsing code has been
+ added.
+
+ * Fix the way recently added tests interpolate variables defined
+ outside them, and document the best practice to help future
+ developers.
+
+ * Introduce an experimental protocol for contributors to propose the
+ topic description to be used in the "What's cooking" report, the
+ merge commit message for the topic, and in the release notes and
+ document it in the SubmittingPatches document.
+
+ * The t/README file now gives a hint on running individual tests in
+ the "t/" directory with "make t<num>-*.sh t<num>-*.sh".
+ (merge 8d383806fc pb/test-scripts-are-build-targets later to maint).
+
+ * The "hint:" messages given by the advice mechanism, when given a
+ message with a blank line, left a line with trailing whitespace,
+ which has been cleansed.
+
+ * Documentation rules has been explicitly described how to mark-up
+ literal parts and a few manual pages have been updated as examples.
+
+ * The .editorconfig file has been taught that a Makefile uses HT
+ indentation.
+
+ * t-prio-queue test has been cleaned up by using C99 compound
+ literals; this is meant to also serve as a weather-balloon to smoke
+ out folks with compilers who have trouble compiling code that uses
+ the feature.
+
+ * Windows binary used to decide the use of unix-domain socket at
+ build time, but it learned to make the decision at runtime instead.
+
+ * The "shared repository" test in the t0610 reftable test failed
+ under restrictive umask setting (e.g. 007), which has been
+ corrected.
+
+ * Document and apply workaround for a buggy version of dash that
+ mishandles "local var=val" construct.
+
+ * The codepaths that reach date_mode_from_type() have been updated to
+ pass "struct date_mode" by value to make them thread safe.
+
+ * The strategy to compact multiple tables of reftables after many
+ operations accumulate many entries has been improved to avoid
+ accumulating too many tables uncollected.
+
+
+Fixes since v2.44
+-----------------
+
+ * "git apply" on a filesystem without filemode support have learned
+ to take a hint from what is in the index for the path, even when
+ not working with the "--index" or "--cached" option, when checking
+ the executable bit match what is required by the preimage in the
+ patch.
+ (merge 45b625142d cp/apply-core-filemode later to maint).
+
+ * "git column" has been taught to reject negative padding value, as
+ it would lead to nonsense behaviour including division by zero.
+ (merge 76fb807faa kh/column-reject-negative-padding later to maint).
+
+ * "git am --help" now tells readers what actions are available in
+ "git am --whitespace=<action>", in addition to saying that the
+ option is passed through to the underlying "git apply".
+ (merge a171dac734 jc/am-whitespace-doc later to maint).
+
+ * "git tag --column" failed to check the exit status of its "git
+ column" invocation, which has been corrected.
+ (merge 92e66478fc rj/tag-column-fix later to maint).
+
+ * Credential helper based on libsecret (in contrib/) has been updated
+ to handle an empty password correctly.
+ (merge 8f1f2023b7 mh/libsecret-empty-password-fix later to maint).
+
+ * "git difftool --dir-diff" learned to honor the "--trust-exit-code"
+ option; it used to always exit with 0 and signalled success.
+ (merge eb84c8b6ce ps/difftool-dir-diff-exit-code later to maint).
+
+ * The code incorrectly attempted to use textconv cache when asked,
+ even when we are not running in a repository, which has been
+ corrected.
+ (merge affe355fe7 jk/textconv-cache-outside-repo-fix later to maint).
+
+ * Remove an empty file that shouldn't have been added in the first
+ place.
+ (merge 4f66942215 js/remove-cruft-files later to maint).
+
+ * The logic to access reflog entries by date and number had ugly
+ corner cases at the boundaries, which have been cleaned up.
+ (merge 5edd126720 jk/reflog-special-cases-fix later to maint).
+
+ * An error message from "git upload-pack", which responds to "git
+ fetch" requests, had a trialing NUL in it, which has been
+ corrected.
+ (merge 3f4c7a0805 sg/upload-pack-error-message-fix later to maint).
+
+ * Clarify wording in the CodingGuidelines that requires <git-compat-util.h>
+ to be the first header file.
+ (merge 4e89f0e07c jc/doc-compat-util later to maint).
+
+ * "git commit -v --cleanup=scissors" used to add the scissors line
+ twice in the log message buffer, which has been corrected.
+ (merge e90cc075cc jt/commit-redundant-scissors-fix later to maint).
+
+ * A custom remote helper no longer cannot access the newly created
+ repository during "git clone", which is a regression in Git 2.44.
+ This has been corrected.
+ (merge 199f44cb2e ps/remote-helper-repo-initialization-fix later to maint).
+
+ * Various parts of upload-pack have been updated to bound the resource
+ consumption relative to the size of the repository to protect from
+ abusive clients.
+ (merge 6cd05e768b jk/upload-pack-bounded-resources later to maint).
+
+ * The upload-pack program, when talking over v2, accepted the
+ packfile-uris protocol extension from the client, even if it did
+ not advertise the capability, which has been corrected.
+ (merge a922bfa3b5 jk/upload-pack-v2-capability-cleanup later to maint).
+
+ * Make sure failure return from merge_bases_many() is properly caught.
+ (merge 25fd20eb44 js/merge-base-with-missing-commit later to maint).
+
+ * FSMonitor client code was confused when FSEvents were given in a
+ different case on a case-insensitive filesystem, which has been
+ corrected.
+ (merge 29c139ce78 jh/fsmonitor-icase-corner-case-fix later to maint).
+
+ * The "core.commentChar" configuration variable only allows an ASCII
+ character, which was not clearly documented, which has been
+ corrected.
+ (merge fb7c556f58 kh/doc-commentchar-is-a-byte later to maint).
+
+ * With release 2.44 we got rid of all uses of test_i18ngrep and there
+ is no in-flight topic that adds a new use of it. Make a call to
+ test_i18ngrep a hard failure, so that we can remove it at the end
+ of this release cycle.
+ (merge 381a83dfa3 jc/test-i18ngrep later to maint).
+
+ * The command line completion script (in contrib/) learned to
+ complete "git reflog" better.
+ (merge 1284f9cc11 rj/complete-reflog later to maint).
+
+ * The logic to complete the command line arguments to "git worktree"
+ subcommand (in contrib/) has been updated to correctly honor things
+ like "git -C dir" etc.
+ (merge 3574816d98 rj/complete-worktree-paths-fix later to maint).
+
+ * When git refuses to create a branch because the proposed branch
+ name is not a valid refname, an advice message is given to refer
+ the user to exact naming rules.
+ (merge 8fbd903e58 kh/branch-ref-syntax-advice later to maint).
+
+ * Code simplification by getting rid of code that sets an environment
+ variable that is no longer used.
+ (merge 72a8d3f027 pw/rebase-i-ignore-cherry-pick-help-environment later to maint).
+
+ * The code to find the effective end of log messages can fall into an
+ endless loop, which has been corrected.
+ (merge 2541cba2d6 fs/find-end-of-log-message-fix later to maint).
+
+ * Mark-up used in the documentation has been improved for
+ consistency.
+ (merge 45d5ed3e50 ja/doc-markup-fixes later to maint).
+
+ * The status.showUntrackedFiles configuration variable was
+ incorrectly documented to accept "false", which has been corrected.
+
+ * Leaks from "git restore" have been plugged.
+ (merge 2f64da0790 rj/restore-plug-leaks later to maint).
+
+ * "git bugreport --no-suffix" was not supported and instead
+ segfaulted, which has been corrected.
+ (merge b3b57c69da js/bugreport-no-suffix-fix later to maint).
+
+ * The documentation for "%(trailers[:options])" placeholder in the
+ "--pretty" option of commands in the "git log" family has been
+ updated.
+ (merge bff85a338c bl/doc-key-val-sep-fix later to maint).
+
+ * "git checkout --conflict=bad" reported a bad conflictStyle as if it
+ were given to a configuration variable; it has been corrected to
+ report that the command line option is bad.
+ (merge 5a99c1ac1a pw/checkout-conflict-errorfix later to maint).
+
+ * Code clean-up in the "git log" machinery that implements custom log
+ message formatting.
+ (merge 1c10b8e5b0 jk/pretty-subject-cleanup later to maint).
+
+ * "git config" corrupted literal HT characters written in the
+ configuration file as part of a value, which has been corrected.
+ (merge e6895c3f97 ds/config-internal-whitespace-fix later to maint).
+
+ * A unit test for reftable code tried to enumerate all files in a
+ directory after reftable operations and expected to see nothing but
+ the files it wanted to leave there, but was fooled by .nfs* cruft
+ files left, which has been corrected.
+ (merge 0068aa7946 ps/reftable-unit-test-nfs-workaround later to maint).
+
+ * The implementation and documentation of "object-format" option
+ exchange between the Git itself and its remote helpers did not
+ quite match, which has been corrected.
+
+ * The "--pretty=<shortHand>" option of the commands in the "git log"
+ family, defined as "[pretty] shortHand = <expansion>" should have
+ been looked up case insensitively, but was not, which has been
+ corrected.
+ (merge f999d5188b bl/pretty-shorthand-config-fix later to maint).
+
+ * "git apply" failed to extract the filename the patch applied to,
+ when the change was about an empty file created in or deleted from
+ a directory whose name ends with a SP, which has been corrected.
+ (merge 776ffd1a30 jc/apply-parse-diff-git-header-names-fix later to maint).
+
+ * Update a more recent tutorial doc.
+ (merge 95ab557b4b dg/myfirstobjectwalk-updates later to maint).
+
+ * The test script had an incomplete and ineffective attempt to avoid
+ clobbering the testing user's real crontab (and its equivalents),
+ which has been completed.
+ (merge 73cb87773b es/test-cron-safety later to maint).
+
+ * Use advice_if_enabled() API to rewrite a simple pattern to
+ call advise() after checking advice_enabled().
+ (merge 6412d01527 rj/use-adv-if-enabled later to maint).
+
+ * Another "set -u" fix for the bash prompt (in contrib/) script.
+ (merge d7805bc743 vs/complete-with-set-u-fix later to maint).
+
+ * "git checkout/switch --detach foo", after switching to the detached
+ HEAD state, gave the tracking information for the 'foo' branch,
+ which was pointless.
+
+ * "git apply" has been updated to lift the hardcoded pathname length
+ limit, which in turn allowed a mksnpath() function that is no
+ longer used.
+ (merge 708f7e0590 rs/apply-lift-path-length-limit later to maint).
+
+ * A file descriptor leak in an error codepath, used when "git apply
+ --reject" fails to create the *.rej file, has been corrected.
+ (merge 2b1f456adf rs/apply-reject-fd-leakfix later to maint).
+
+ * A config parser callback function fell through instead of returning
+ after recognising and processing a variable, wasting cycles, which
+ has been corrected.
+ (merge a816ccd642 ds/fetch-config-parse-microfix later to maint).
+
+ * Fix was added to work around a regression in libcURL 8.7.0 (which has
+ already been fixed in their tip of the tree).
+ (merge 92a209bf24 jk/libcurl-8.7-regression-workaround later to maint).
+
+ * The variable that holds the value read from the core.excludefile
+ configuration variable used to leak, which has been corrected.
+ (merge 0e0fefb29f jc/unleak-core-excludesfile later to maint).
+
+ * vreportf(), which is used by error() and friends, has been taught
+ to give the error message printf-format string when its vsnprintf()
+ call fails, instead of showing nothing useful to identify the
+ nature of the error.
+ (merge c63adab961 rs/usage-fallback-to-show-message-format later to maint).
+
+ * Adjust to an upcoming changes to GNU make that breaks our Makefiles.
+ (merge 227b8fd902 tb/make-indent-conditional-with-non-spaces later to maint).
+
+ * Other code cleanup, docfix, build fix, etc.
+ (merge f0e578c69c rs/use-xstrncmpz later to maint).
+ (merge 83e6eb7d7a ba/credential-test-clean-fix later to maint).
+ (merge 64562d784d jb/doc-interactive-singlekey-do-not-need-perl later to maint).
+ (merge c431a235e2 cp/t9146-use-test-path-helpers later to maint).
+ (merge 82d75402d5 ds/doc-send-email-capitalization later to maint).
+ (merge 41bff66e35 jc/doc-add-placeholder-fix later to maint).
+ (merge 6835f0efe9 jw/remote-doc-typofix later to maint).
+ (merge 244001aa20 hs/rebase-not-in-progress later to maint).
+ (merge 2ca6c07db2 jc/no-include-of-compat-util-from-headers later to maint).
+ (merge 87bd7fbb9c rs/fetch-simplify-with-starts-with later to maint).
+ (merge f39addd0d9 rs/name-rev-with-mempool later to maint).
+ (merge 9a97b43e03 rs/submodule-prefix-simplify later to maint).
+ (merge 40b8076462 ak/rebase-autosquash later to maint).
+ (merge 3223204456 eg/add-uflags later to maint).
+ (merge 5f78d52dce es/config-doc-sort-sections later to maint).
+ (merge 781fb7b4c2 as/option-names-in-messages later to maint).
+ (merge 51d41dc243 jk/doc-remote-helpers-markup-fix later to maint).
+ (merge e1aaf309db pb/ci-win-artifact-names-fix later to maint).
+ (merge ad538c61da jc/index-pack-fsck-levels later to maint).
+ (merge 67471bc704 ja/doc-formatting-fix later to maint).
+ (merge 86f9ce7dd6 bl/doc-config-fixes later to maint).
+ (merge 0d527842b7 az/grep-group-error-message-update later to maint).
+ (merge 7c43bdf07b rs/strbuf-expand-bad-format later to maint).
+ (merge 8b68b48d5c ds/typofix-core-config-doc later to maint).
+ (merge 39bb692152 rs/imap-send-use-xsnprintf later to maint).
+ (merge 8d320cec60 jc/t2104-style-fixes later to maint).
+ (merge b4454d5a7b pw/t3428-cleanup later to maint).
+ (merge 84a7c33a4b pf/commitish-committish later to maint).
+ (merge 8882ee9d68 la/mailmap-entry later to maint).
diff --git a/Documentation/ReviewingGuidelines.txt b/Documentation/ReviewingGuidelines.txt
new file mode 100644
index 0000000..515d470
--- /dev/null
+++ b/Documentation/ReviewingGuidelines.txt
@@ -0,0 +1,162 @@
+Reviewing Patches in the Git Project
+====================================
+
+Introduction
+------------
+The Git development community is a widely distributed, diverse, ever-changing
+group of individuals. Asynchronous communication via the Git mailing list poses
+unique challenges when reviewing or discussing patches. This document contains
+some guiding principles and helpful tools you can use to make your reviews both
+more efficient for yourself and more effective for other contributors.
+
+Note that none of the recommendations here are binding or in any way a
+requirement of participation in the Git community. They are provided as a
+resource to supplement your skills as a contributor.
+
+Principles
+----------
+
+Selecting patch(es) to review
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+If you are looking for a patch series in need of review, start by checking
+the latest "What's cooking in git.git" email
+(https://lore.kernel.org/git/xmqqilm1yp3m.fsf@gitster.g/[example]). The "What's
+cooking" emails & replies can be found using the query `s:"What's cooking"` on
+the https://lore.kernel.org/git/[`lore.kernel.org` mailing list archive];
+alternatively, you can find the contents of the "What's cooking" email tracked
+in `whats-cooking.txt` on the `todo` branch of Git. Topics tagged with "Needs
+review" and those in the "[New Topics]" section are typically those that would
+benefit the most from additional review.
+
+Patches can also be searched manually in the mailing list archive using a query
+like `s:"PATCH" -s:"Re:"`. You can browse these results for topics relevant to
+your expertise or interest.
+
+If you've already contributed to Git, you may also be CC'd in another
+contributor's patch series. These are topics where the author feels that your
+attention is warranted. This may be because their patch changes something you
+wrote previously (making you a good judge of whether the new approach does or
+doesn't work), or because you have the expertise to provide an exceptionally
+helpful review. There is no requirement to review these patches but, in the
+spirit of open source collaboration, you should strongly consider doing so.
+
+Reviewing patches
+~~~~~~~~~~~~~~~~~
+While every contributor takes their own approach to reviewing patches, here are
+some general pieces of advice to make your reviews as clear and helpful as
+possible. The advice is broken into two rough categories: high-level reviewing
+guidance, and concrete tips for interacting with patches on the mailing list.
+
+==== High-level guidance
+- Remember to review the content of commit messages for correctness and clarity,
+ in addition to the code change in the patch's diff. The commit message of a
+ patch should accurately and fully explain the code change being made in the
+ diff.
+
+- Reviewing test coverage is an important - but easy to overlook - component of
+ reviews. A patch's changes may be covered by existing tests, or new tests may
+ be introduced to exercise new behavior. Checking out a patch or series locally
+ allows you to manually mutate lines of new & existing tests to verify expected
+ pass/fail behavior. You can use this information to verify proper coverage or
+ to suggest additional tests the author could add.
+
+- When providing a recommendation, be as clear as possible about whether you
+ consider it "blocking" (the code would be broken or otherwise made worse if an
+ issue isn't fixed) or "non-blocking" (the patch could be made better by taking
+ the recommendation, but acceptance of the series does not require it).
+ Non-blocking recommendations can be particularly ambiguous when they are
+ related to - but outside the scope of - a series ("nice-to-have"s), or when
+ they represent only stylistic differences between the author and reviewer.
+
+- When commenting on an issue, try to include suggestions for how the author
+ could fix it. This not only helps the author to understand and fix the issue,
+ it also deepens and improves your understanding of the topic.
+
+- Reviews do not need to exclusively point out problems. Feel free to "think out
+ loud" in your review: describe how you read & understood a complex section of
+ a patch, ask a question about something that confused you, point out something
+ you found exceptionally well-written, etc. In particular, uplifting feedback
+ goes a long way towards encouraging contributors to participate more actively
+ in the Git community.
+
+==== Performing your review
+- Provide your review comments per-patch in a plaintext "Reply-All" email to the
+ relevant patch. Comments should be made inline, immediately below the relevant
+ section(s).
+
+- You may find that the limited context provided in the patch diff is sometimes
+ insufficient for a thorough review. In such cases, you can review patches in
+ your local tree by either applying patches with linkgit:git-am[1] or checking
+ out the associated branch from https://github.com/gitster/git once the series
+ is tracked there.
+
+- Large, complicated patch diffs are sometimes unavoidable, such as when they
+ refactor existing code. If you find such a patch difficult to parse, try
+ reviewing the diff produced with the `--color-moved` and/or
+ `--ignore-space-change` options.
+
+- If a patch is long, you are encouraged to delete parts of it that are
+ unrelated to your review from the email reply. Make sure to leave enough
+ context for readers to understand your comments!
+
+- If you cannot complete a full review of a series all at once, consider letting
+ the author know (on- or off-list) if/when you plan to review the rest of the
+ series.
+
+Completing a review
+~~~~~~~~~~~~~~~~~~~
+Once each patch of a series is reviewed, the author (and/or other contributors)
+may discuss the review(s). This may result in no changes being applied, or the
+author will send a new version of their patch(es).
+
+After a series is rerolled in response to your or others' review, make sure to
+re-review the updates. If you are happy with the state of the patch series,
+explicitly indicate your approval (typically with a reply to the latest
+version's cover letter). Optionally, you can let the author know that they can
+add a "Reviewed-by: <you>" trailer if they resubmit the reviewed patch verbatim
+in a later iteration of the series.
+
+Finally, subsequent "What's cooking" emails may explicitly ask whether a
+reviewed topic is ready for merging to the `next` branch (typically phrased
+"Will merge to \'next\'?"). You can help the maintainer and author by responding
+with a short description of the state of your (and others', if applicable)
+review, including the links to the relevant thread(s).
+
+Terminology
+-----------
+nit: ::
+ Denotes a small issue that should be fixed, such as a typographical error
+ or misalignment of conditions in an `if()` statement.
+
+aside: ::
+optional: ::
+non-blocking: ::
+ Indicates to the reader that the following comment should not block the
+ acceptance of the patch or series. These are typically recommendations
+ related to code organization & style, or musings about topics related to
+ the patch in question, but beyond its scope.
+
+s/<before>/<after>/::
+ Shorthand for "you wrote <before>, but I think you meant <after>," usually
+ for misspellings or other typographical errors. The syntax is a reference
+ to "substitute" command commonly found in Unix tools such as `ed`, `sed`,
+ `vim`, and `perl`.
+
+cover letter::
+ The "Patch 0" of a multi-patch series. This email describes the
+ high-level intent and structure of the patch series to readers on the
+ Git mailing list. It is also where the changelog notes and range-diff of
+ subsequent versions are provided by the author.
++
+On single-patch submissions, cover letter content is typically not sent as a
+separate email. Instead, it is inserted between the end of the patch's commit
+message (after the `---`) and the beginning of the diff.
+
+#leftoverbits::
+ Used by either an author or a reviewer to describe features or suggested
+ changes that are out-of-scope of a given patch or series, but are relevant
+ to the topic for the sake of discussion.
+
+See Also
+--------
+link:MyFirstContribution.html[MyFirstContribution]
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 5bd795e..c647c7e 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -3,45 +3,101 @@ Submitting Patches
== Guidelines
-Here are some guidelines for people who want to contribute their code to this
-software. There is also a link:MyFirstContribution.html[step-by-step tutorial]
+Here are some guidelines for contributing back to this
+project. There is also a link:MyFirstContribution.html[step-by-step tutorial]
available which covers many of these same guidelines.
-[[base-branch]]
-=== Decide what to base your work on.
-
-In general, always base your work on the oldest branch that your
-change is relevant to.
-
-* A bugfix should be based on `maint` in general. If the bug is not
- present in `maint`, base it on `master`. For a bug that's not yet
- in `master`, find the topic that introduces the regression, and
- base your work on the tip of the topic.
-
-* A new feature should be based on `master` in general. If the new
- feature depends on other topics that are in `next`, but not in
- `master`, fork a branch from the tip of `master`, merge these topics
- to the branch, and work on that branch. You can remind yourself of
- how you prepared the base with `git log --first-parent master..`.
-
-* Corrections and enhancements to a topic not yet in `master` should
- be based on the tip of that topic. If the topic has not been merged
- to `next`, it's alright to add a note to squash minor corrections
- into the series.
-
-* In the exceptional case that a new feature depends on several topics
- not in `master`, start working on `next` or `seen` privately and
- send out patches only for discussion. Once your new feature starts
- to stabilize, you would have to rebase it (see the "depends on other
- topics" above).
-
-* Some parts of the system have dedicated maintainers with their own
- repositories (see the section "Subsystems" below). Changes to
- these parts should be based on their trees.
-
-To find the tip of a topic branch, run `git log --first-parent
-master..seen` and look for the merge commit. The second parent of this
-commit is the tip of the topic branch.
+[[choose-starting-point]]
+=== Choose a starting point.
+
+As a preliminary step, you must first choose a starting point for your
+work. Typically this means choosing a branch, although technically
+speaking it is actually a particular commit (typically the HEAD, or tip,
+of the branch).
+
+There are several important branches to be aware of. Namely, there are
+four integration branches as discussed in linkgit:gitworkflows[7]:
+
+* maint
+* master
+* next
+* seen
+
+The branches lower on the list are typically descendants of the ones
+that come before it. For example, `maint` is an "older" branch than
+`master` because `master` usually has patches (commits) on top of
+`maint`.
+
+There are also "topic" branches, which contain work from other
+contributors. Topic branches are created by the Git maintainer (in
+their fork) to organize the current set of incoming contributions on
+the mailing list, and are itemized in the regular "What's cooking in
+git.git" announcements. To find the tip of a topic branch, run `git log
+--first-parent master..seen` and look for the merge commit. The second
+parent of this commit is the tip of the topic branch.
+
+There is one guiding principle for choosing the right starting point: in
+general, always base your work on the oldest integration branch that
+your change is relevant to (see "Merge upwards" in
+linkgit:gitworkflows[7]). What this principle means is that for the
+vast majority of cases, the starting point for new work should be the
+latest HEAD commit of `maint` or `master` based on the following cases:
+
+* If you are fixing bugs in the released version, use `maint` as the
+ starting point (which may mean you have to fix things without using
+ new API features on the cutting edge that recently appeared in
+ `master` but were not available in the released version).
+
+* Otherwise (such as if you are adding new features) use `master`.
+
+
+NOTE: In exceptional cases, a bug that was introduced in an old
+version may have to be fixed for users of releases that are much older
+than the recent releases. `git describe --contains X` may describe
+`X` as `v2.30.0-rc2-gXXXXXX` for the commit `X` that introduced the
+bug, and the bug may be so high-impact that we may need to issue a new
+maintenance release for Git 2.30.x series, when "Git 2.41.0" is the
+current release. In such a case, you may want to use the tip of the
+maintenance branch for the 2.30.x series, which may be available in the
+`maint-2.30` branch in https://github.com/gitster/git[the maintainer's
+"broken out" repo].
+
+This also means that `next` or `seen` are inappropriate starting points
+for your work, if you want your work to have a realistic chance of
+graduating to `master`. They are simply not designed to be used as a
+base for new work; they are only there to make sure that topics in
+flight work well together. This is why both `next` and `seen` are
+frequently re-integrated with incoming patches on the mailing list and
+force-pushed to replace previous versions of themselves. A topic that is
+literally built on top of `next` cannot be merged to `master` without
+dragging in all the other topics in `next`, some of which may not be
+ready.
+
+For example, if you are making tree-wide changes, while somebody else is
+also making their own tree-wide changes, your work may have severe
+overlap with the other person's work. This situation may tempt you to
+use `next` as your starting point (because it would have the other
+person's work included in it), but doing so would mean you'll not only
+depend on the other person's work, but all the other random things from
+other contributors that are already integrated into `next`. And as soon
+as `next` is updated with a new version, all of your work will need to
+be rebased anyway in order for them to be cleanly applied by the
+maintainer.
+
+Under truly exceptional circumstances where you absolutely must depend
+on a select few topic branches that are already in `next` but not in
+`master`, you may want to create your own custom base-branch by forking
+`master` and merging the required topic branches into it. You could then
+work on top of this base-branch. But keep in mind that this base-branch
+would only be known privately to you. So when you are ready to send
+your patches to the list, be sure to communicate how you created it in
+your cover letter. This critical piece of information would allow
+others to recreate your base-branch on their end in order for them to
+try out your work.
+
+Finally, note that some parts of the system have dedicated maintainers
+with their own separate source code repositories (see the section
+"Subsystems" below).
[[separate-commits]]
=== Make separate commits for logically separate changes.
@@ -153,7 +209,9 @@ files you are modifying to see the current conventions.
[[summary-section]]
The title sentence after the "area:" prefix omits the full stop at the
-end, and its first word is not capitalized unless there is a reason to
+end, and its first word is not capitalized (the omission
+of capitalization applies only to the word after the "area:"
+prefix of the title) unless there is a reason to
capitalize it other than because it is the first word in the sentence.
E.g. "doc: clarify...", not "doc: Clarify...", or "githooks.txt:
improve...", not "githooks.txt: Improve...". But "refs: HEAD is also
@@ -208,7 +266,7 @@ date)", like this:
noticed that ...
....
-The "Copy commit summary" command of gitk can be used to obtain this
+The "Copy commit reference" command of gitk can be used to obtain this
format (with the subject enclosed in a pair of double-quotes), or this
invocation of `git show`:
@@ -297,9 +355,21 @@ If you like, you can put extra tags at the end:
patch after a detailed analysis.
. `Tested-by:` is used to indicate that the person applied the patch
and found it to have the desired effect.
-
-You can also create your own tag or use one that's in common usage
-such as "Thanks-to:", "Based-on-patch-by:", or "Mentored-by:".
+. `Co-authored-by:` is used to indicate that people exchanged drafts
+ of a patch before submitting it.
+. `Helped-by:` is used to credit someone who suggested ideas for
+ changes without providing the precise changes in patch form.
+. `Mentored-by:` is used to credit someone with helping develop a
+ patch as part of a mentorship program (e.g., GSoC or Outreachy).
+. `Suggested-by:` is used to credit someone with suggesting the idea
+ for a patch.
+
+While you can also create your own trailer if the situation warrants it, we
+encourage you to instead use one of the common trailers in this project
+highlighted above.
+
+Only capitalize the very first letter of tags, i.e. favor
+"Signed-off-by" over "Signed-Off-By" and "Acked-by:" over "Acked-By".
[[git-tools]]
=== Generate your patch using Git tools out of your commits.
@@ -315,10 +385,13 @@ Please make sure your patch does not add commented out debugging code,
or include any extra files which do not relate to what your patch
is trying to achieve. Make sure to review
your patch after generating it, to ensure accuracy. Before
-sending out, please make sure it cleanly applies to the base you
-have chosen in the "Decide what to base your work on" section,
-and unless it targets the `master` branch (which is the default),
-mark your patches as such.
+sending out, please make sure it cleanly applies to the starting point you
+have chosen in the "Choose a starting point" section.
+
+NOTE: From the perspective of those reviewing your patch, the `master`
+branch is the default expected starting point. So if you have chosen a
+different starting point, please communicate this choice in your cover
+letter.
[[send-patches]]
@@ -332,8 +405,8 @@ mailing list{security-ml}, instead of the public mailing list.
Learn to use format-patch and send-email if possible. These commands
are optimized for the workflow of sending patches, avoiding many ways
-your existing e-mail client that is optimized for "multipart/*" mime
-type e-mails to corrupt and render your patches unusable.
+your existing e-mail client (often optimized for "multipart/*" MIME
+type e-mails) might render your patches unusable.
People on the Git mailing list need to be able to read and
comment on the changes you are submitting. It is important for
@@ -386,6 +459,18 @@ an explanation of changes between each iteration can be kept in
Git-notes and inserted automatically following the three-dash
line via `git format-patch --notes`.
+[[the-topic-summary]]
+*This is EXPERIMENTAL*.
+
+When sending a topic, you can propose a one-paragraph summary that
+should appear in the "What's cooking" report when it is picked up to
+explain the topic. If you choose to do so, please write a 2-5 line
+paragraph that will fit well in our release notes (see many bulleted
+entries in the Documentation/RelNotes/* files for examples), and make
+it the first paragraph of the cover letter. For a single-patch
+series, use the space between the three-dash line and the diffstat, as
+described earlier.
+
[[attachment]]
Do not attach the patch as a MIME attachment, compressed or not.
Do not let your e-mail client send quoted-printable. Do not let
@@ -454,8 +539,8 @@ repositories.
git://git.ozlabs.org/~paulus/gitk
- Those who are interested in improve gitk can volunteer to help Paul
- in maintaining it cf. <YntxL/fTplFm8lr6@cleo>.
+ Those who are interested in improving gitk can volunteer to help Paul
+ maintain it, cf. <YntxL/fTplFm8lr6@cleo>.
- `po/` comes from the localization coordinator, Jiang Xin:
@@ -495,7 +580,7 @@ help you find out who they are.
In any time between the (2)-(3) cycle, the maintainer may pick it up
from the list and queue it to `seen`, in order to make it easier for
-people play with it without having to pick up and apply the patch to
+people to play with it without having to pick up and apply the patch to
their trees themselves.
[[patch-status]]
@@ -509,7 +594,7 @@ their trees themselves.
master).
* Read the Git mailing list, the maintainer regularly posts messages
- entitled "What's cooking in git.git" and "What's in git.git" giving
+ entitled "What's cooking in git.git" giving
the status of various proposed changes.
== GitHub CI[[GHCI]]
@@ -529,11 +614,12 @@ After the initial setup, CI will run whenever you push new changes
to your fork of Git on GitHub. You can monitor the test state of all your
branches here: `https://github.com/<Your GitHub handle>/git/actions/workflows/main.yml`
-If a branch did not pass all test cases then it is marked with a red
-cross. In that case you can click on the failing job and navigate to
-"ci/run-build-and-tests.sh" and/or "ci/print-test-failures.sh". You
-can also download "Artifacts" which are tarred (or zipped) archives
-with test data relevant for debugging.
+If a branch does not pass all test cases then it will be marked with a
+red +x+, instead of a green check. In that case, you can click on the
+failing job and navigate to "ci/run-build-and-tests.sh" and/or
+"ci/print-test-failures.sh". You can also download "Artifacts" which
+are zip archives containing tarred (or zipped) archives with test data
+relevant for debugging.
Then fix the problem and push your fix to your GitHub fork. This will
trigger a new CI build to ensure all tests pass.
@@ -541,7 +627,7 @@ trigger a new CI build to ensure all tests pass.
[[mua]]
== MUA specific hints
-Some of patches I receive or pick up from the list share common
+Some of the patches I receive or pick up from the list share common
patterns of breakage. Please make sure your MUA is set up
properly not to corrupt whitespaces.
@@ -625,7 +711,7 @@ message to an external program, and this is a handy way to drive
`git am`. However, if the message is MIME encoded, what is
piped into the program is the representation you see in your
`*Article*` buffer after unwrapping MIME. This is often not what
-you would want for two reasons. It tends to screw up non ASCII
+you would want for two reasons. It tends to screw up non-ASCII
characters (most notably in people's names), and also
whitespaces (fatal in patches). Running "C-u g" to display the
message in raw form before using "|" to run the pipe can work
diff --git a/Documentation/ToolsForGit.txt b/Documentation/ToolsForGit.txt
index 5060d0d..ae7690b 100644
--- a/Documentation/ToolsForGit.txt
+++ b/Documentation/ToolsForGit.txt
@@ -5,7 +5,7 @@ Tools for developing Git
[[summary]]
== Summary
-This document gathers tips, scripts and configuration file to help people
+This document gathers tips, scripts, and configuration files to help people
working on Git's codebase use their favorite tools while following Git's
coding style.
@@ -32,7 +32,7 @@ information on using the script.
This is adapted from Linux's suggestion in its CodingStyle document:
-- To follow rules of the CodingGuideline, it's useful to put the following in
+- To follow the rules in CodingGuidelines, it's useful to put the following in
GIT_CHECKOUT/.dir-locals.el, assuming you use cperl-mode:
----
;; note the first part is useful for C editing, too
diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
index 3e4c139..60f76f4 100644
--- a/Documentation/asciidoc.conf
+++ b/Documentation/asciidoc.conf
@@ -51,25 +51,6 @@ ifdef::doctype-manpage[]
endif::doctype-manpage[]
endif::backend-docbook[]
-ifdef::doctype-manpage[]
-ifdef::backend-docbook[]
-[header]
-template::[header-declarations]
-<refentry>
-<refmeta>
-<refentrytitle>{mantitle}</refentrytitle>
-<manvolnum>{manvolnum}</manvolnum>
-<refmiscinfo class="source">{mansource}</refmiscinfo>
-<refmiscinfo class="version">{manversion}</refmiscinfo>
-<refmiscinfo class="manual">{manmanual}</refmiscinfo>
-</refmeta>
-<refnamediv>
- <refname>{manname}</refname>
- <refpurpose>{manpurpose}</refpurpose>
-</refnamediv>
-endif::backend-docbook[]
-endif::doctype-manpage[]
-
ifdef::backend-xhtml11[]
[attributes]
git-relative-html-prefix=
diff --git a/Documentation/blame-options.txt b/Documentation/blame-options.txt
index 9a66353..552dcc6 100644
--- a/Documentation/blame-options.txt
+++ b/Documentation/blame-options.txt
@@ -64,11 +64,9 @@ include::line-range-format.txt[]
manual page.
--contents <file>::
- When <rev> is not specified, the command annotates the
- changes starting backwards from the working tree copy.
- This flag makes the command pretend as if the working
- tree copy has the contents of the named file (specify
- `-` to make the command read from the standard input).
+ Annotate using the contents from the named file, starting from <rev>
+ if it is specified, and HEAD otherwise. You may specify '-' to make
+ the command read from the standard input for the file contents.
--date <format>::
Specifies the format used to output dates. If --date is not
diff --git a/Documentation/build-docdep.perl b/Documentation/build-docdep.perl
index ba4205e..1b3ac8f 100755
--- a/Documentation/build-docdep.perl
+++ b/Documentation/build-docdep.perl
@@ -38,9 +38,10 @@ while ($changed) {
}
}
-while (my ($text, $included) = each %include) {
+foreach my $text (sort keys %include) {
+ my $included = $include{$text};
if (! exists $included{$text} &&
(my $base = $text) =~ s/\.txt$//) {
- print "$base.html $base.xml : ", join(" ", keys %$included), "\n";
+ print "$base.html $base.xml : ", join(" ", sort keys %$included), "\n";
}
}
diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl
index af5da45..755a110 100755
--- a/Documentation/cmd-list.perl
+++ b/Documentation/cmd-list.perl
@@ -10,7 +10,7 @@ sub format_one {
$state = 0;
open I, '<', "$name.txt" or die "No such file $name.txt";
while (<I>) {
- if (/^git[a-z0-9-]*\(([0-9])\)$/) {
+ if (/^(?:git|scalar)[a-z0-9-]*\(([0-9])\)$/) {
$mansection = $1;
next;
}
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 5b5b976..70b448b 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -11,7 +11,7 @@ file. The file `/etc/gitconfig` can be used to store a system-wide
default configuration.
The configuration variables are used by both the Git plumbing
-and the porcelains. The variables are divided into sections, wherein
+and the porcelain commands. The variables are divided into sections, wherein
the fully qualified variable name of the variable itself is the last
dot-separated segment and the section name is everything before the last
dot. The variable names are case-insensitive, allow only alphanumeric
@@ -22,9 +22,10 @@ multivalued.
Syntax
~~~~~~
-The syntax is fairly flexible and permissive; whitespaces are mostly
-ignored. The '#' and ';' characters begin comments to the end of line,
-blank lines are ignored.
+The syntax is fairly flexible and permissive. Whitespace characters,
+which in this context are the space character (SP) and the horizontal
+tabulation (HT), are mostly ignored. The '#' and ';' characters begin
+comments to the end of line. Blank lines are ignored.
The file consists of sections and variables. A section begins with
the name of the section in square brackets and continues until the next
@@ -63,16 +64,17 @@ the variable is the boolean "true").
The variable names are case-insensitive, allow only alphanumeric characters
and `-`, and must start with an alphabetic character.
-A line that defines a value can be continued to the next line by
-ending it with a `\`; the backslash and the end-of-line are
-stripped. Leading whitespaces after 'name =', the remainder of the
-line after the first comment character '#' or ';', and trailing
-whitespaces of the line are discarded unless they are enclosed in
-double quotes. Internal whitespaces within the value are retained
-verbatim.
+Whitespace characters surrounding `name`, `=` and `value` are discarded.
+Internal whitespace characters within 'value' are retained verbatim.
+Comments starting with either `#` or `;` and extending to the end of line
+are discarded. A line that defines a value can be continued to the next
+line by ending it with a backslash (`\`); the backslash and the end-of-line
+characters are discarded.
-Inside double quotes, double quote `"` and backslash `\` characters
-must be escaped: use `\"` for `"` and `\\` for `\`.
+If `value` needs to contain leading or trailing whitespace characters,
+it must be enclosed in double quotation marks (`"`). Inside double quotation
+marks, double quote (`"`) and backslash (`\`) characters must be escaped:
+use `\"` for `"` and `\\` for `\`.
The following escape sequences (beside `\"` and `\\`) are recognized:
`\n` for newline character (NL), `\t` for horizontal tabulation (HT, TAB)
@@ -103,7 +105,7 @@ was found. See below for examples.
Conditional includes
~~~~~~~~~~~~~~~~~~~~
-You can include a config file from another conditionally by setting a
+You can conditionally include a config file from another by setting an
`includeIf.<condition>.path` variable to the name of the file to be
included.
@@ -118,7 +120,7 @@ are:
pattern, the include condition is met.
+
The .git location may be auto-discovered, or come from `$GIT_DIR`
-environment variable. If the repository is auto discovered via a .git
+environment variable. If the repository is auto-discovered via a .git
file (e.g. from submodules, or a linked worktree), the .git location
would be the final location where the .git directory is, not where the
.git file is.
@@ -182,7 +184,7 @@ included, Git breaks the cycle by prohibiting these files from affecting
the resolution of these conditions (thus, prohibiting them from
declaring remote URLs).
+
-As for the naming of this keyword, it is for forwards compatibiliy with
+As for the naming of this keyword, it is for forwards compatibility with
a naming scheme that supports more variable-based include conditions,
but currently Git only supports the exact keyword described above.
@@ -369,24 +371,26 @@ inventing new variables for use in your own tool, make sure their
names do not conflict with those that are used by Git itself and
other popular tools, and describe them in your documentation.
-include::config/advice.txt[]
-
-include::config/core.txt[]
-
include::config/add.txt[]
+include::config/advice.txt[]
+
include::config/alias.txt[]
include::config/am.txt[]
include::config/apply.txt[]
+include::config/attr.txt[]
+
include::config/blame.txt[]
include::config/branch.txt[]
include::config/browser.txt[]
+include::config/bundle.txt[]
+
include::config/checkout.txt[]
include::config/clean.txt[]
@@ -401,10 +405,12 @@ include::config/commit.txt[]
include::config/commitgraph.txt[]
-include::config/credential.txt[]
-
include::config/completion.txt[]
+include::config/core.txt[]
+
+include::config/credential.txt[]
+
include::config/diff.txt[]
include::config/difftool.txt[]
@@ -417,22 +423,24 @@ include::config/feature.txt[]
include::config/fetch.txt[]
-include::config/format.txt[]
-
include::config/filter.txt[]
+include::config/format.txt[]
+
include::config/fsck.txt[]
+include::config/fsmonitor--daemon.txt[]
+
include::config/gc.txt[]
include::config/gitcvs.txt[]
include::config/gitweb.txt[]
-include::config/grep.txt[]
-
include::config/gpg.txt[]
+include::config/grep.txt[]
+
include::config/gui.txt[]
include::config/guitool.txt[]
@@ -513,10 +521,10 @@ include::config/splitindex.txt[]
include::config/ssh.txt[]
-include::config/status.txt[]
-
include::config/stash.txt[]
+include::config/status.txt[]
+
include::config/submodule.txt[]
include::config/tag.txt[]
diff --git a/Documentation/config/add.txt b/Documentation/config/add.txt
index 3e859f3..e0354ce 100644
--- a/Documentation/config/add.txt
+++ b/Documentation/config/add.txt
@@ -7,6 +7,7 @@ add.ignore-errors (deprecated)::
variables.
add.interactive.useBuiltin::
- Set to `false` to fall back to the original Perl implementation of
- the interactive version of linkgit:git-add[1] instead of the built-in
- version. Is `true` by default.
+ Unused configuration variable. Used in Git versions v2.25.0 to
+ v2.36.0 to enable the built-in version of linkgit:git-add[1]'s
+ interactive mode, which then became the default in Git
+ versions v2.37.0 to v2.39.0.
diff --git a/Documentation/config/advice.txt b/Documentation/config/advice.txt
index a00d010..0e35ae5 100644
--- a/Documentation/config/advice.txt
+++ b/Documentation/config/advice.txt
@@ -1,30 +1,65 @@
advice.*::
These variables control various optional help messages designed to
- aid new users. All 'advice.*' variables default to 'true', and you
- can tell Git that you do not need help by setting these to 'false':
+ aid new users. When left unconfigured, Git will give the message
+ alongside instructions on how to squelch it. You can tell Git
+ that you do not need the help message by setting these to `false`:
+
--
+ addEmbeddedRepo::
+ Shown when the user accidentally adds one
+ git repo inside of another.
+ addEmptyPathspec::
+ Shown when the user runs `git add` without providing
+ the pathspec parameter.
+ addIgnoredFile::
+ Shown when the user attempts to add an ignored file to
+ the index.
+ amWorkDir::
+ Shown when linkgit:git-am[1] fails to apply a patch
+ file, to tell the user the location of the file.
ambiguousFetchRefspec::
- Advice shown when fetch refspec for multiple remotes map to
+ Shown when a fetch refspec for multiple remotes maps to
the same remote-tracking branch namespace and causes branch
tracking set-up to fail.
+ checkoutAmbiguousRemoteBranchName::
+ Shown when the argument to
+ linkgit:git-checkout[1] and linkgit:git-switch[1]
+ ambiguously resolves to a
+ remote tracking branch on more than one remote in
+ situations where an unambiguous argument would have
+ otherwise caused a remote-tracking branch to be
+ checked out. See the `checkout.defaultRemote`
+ configuration variable for how to set a given remote
+ to be used by default in some situations where this
+ advice would be printed.
+ commitBeforeMerge::
+ Shown when linkgit:git-merge[1] refuses to
+ merge to avoid overwriting local changes.
+ detachedHead::
+ Shown when the user uses
+ linkgit:git-switch[1] or linkgit:git-checkout[1]
+ to move to the detached HEAD state, to tell the user how
+ to create a local branch after the fact.
+ diverging::
+ Shown when a fast-forward is not possible.
fetchShowForcedUpdates::
- Advice shown when linkgit:git-fetch[1] takes a long time
+ Shown when linkgit:git-fetch[1] takes a long time
to calculate forced updates after ref updates, or to warn
that the check is disabled.
- pushUpdateRejected::
- Set this variable to 'false' if you want to disable
- 'pushNonFFCurrent', 'pushNonFFMatching', 'pushAlreadyExists',
- 'pushFetchFirst', 'pushNeedsForce', and 'pushRefNeedsUpdate'
- simultaneously.
- pushNonFFCurrent::
- Advice shown when linkgit:git-push[1] fails due to a
- non-fast-forward update to the current branch.
- pushNonFFMatching::
- Advice shown when you ran linkgit:git-push[1] and pushed
- 'matching refs' explicitly (i.e. you used ':', or
- specified a refspec that isn't your current branch) and
- it resulted in a non-fast-forward error.
+ forceDeleteBranch::
+ Shown when the user tries to delete a not fully merged
+ branch without the force option set.
+ ignoredHook::
+ Shown when a hook is ignored because the hook is not
+ set as executable.
+ implicitIdentity::
+ Shown when the user's information is guessed from the
+ system username and domain name, to tell the user how to
+ set their identity configuration.
+ mergeConflict::
+ Shown when various commands stop because of conflicts.
+ nestedTag::
+ Shown when a user attempts to recursively tag a tag object.
pushAlreadyExists::
Shown when linkgit:git-push[1] rejects an update that
does not qualify for fast-forwarding (e.g., a tag.)
@@ -37,17 +72,45 @@ advice.*::
tries to overwrite a remote ref that points at an
object that is not a commit-ish, or make the remote
ref point at an object that is not a commit-ish.
+ pushNonFFCurrent::
+ Shown when linkgit:git-push[1] fails due to a
+ non-fast-forward update to the current branch.
+ pushNonFFMatching::
+ Shown when the user ran linkgit:git-push[1] and pushed
+ "matching refs" explicitly (i.e. used `:`, or
+ specified a refspec that isn't the current branch) and
+ it resulted in a non-fast-forward error.
+ pushRefNeedsUpdate::
+ Shown when linkgit:git-push[1] rejects a forced update of
+ a branch when its remote-tracking ref has updates that we
+ do not have locally.
pushUnqualifiedRefname::
Shown when linkgit:git-push[1] gives up trying to
guess based on the source and destination refs what
remote ref namespace the source belongs in, but where
we can still suggest that the user push to either
- refs/heads/* or refs/tags/* based on the type of the
+ `refs/heads/*` or `refs/tags/*` based on the type of the
source object.
- pushRefNeedsUpdate::
- Shown when linkgit:git-push[1] rejects a forced update of
- a branch when its remote-tracking ref has updates that we
- do not have locally.
+ pushUpdateRejected::
+ Set this variable to `false` if you want to disable
+ `pushNonFFCurrent`, `pushNonFFMatching`, `pushAlreadyExists`,
+ `pushFetchFirst`, `pushNeedsForce`, and `pushRefNeedsUpdate`
+ simultaneously.
+ refSyntax::
+ Shown when the user provides an illegal ref name, to
+ tell the user about the ref syntax documentation.
+ resetNoRefresh::
+ Shown when linkgit:git-reset[1] takes more than 2
+ seconds to refresh the index after reset, to tell the user
+ that they can use the `--no-refresh` option.
+ resolveConflict::
+ Shown by various commands when conflicts
+ prevent the operation from being performed.
+ rmHints::
+ Shown on failure in the output of linkgit:git-rm[1], to
+ give directions on how to proceed from the current state.
+ sequencerInUse::
+ Shown when a sequencer command is already in progress.
skippedCherryPicks::
Shown when linkgit:git-rebase[1] skips a commit that has already
been cherry-picked onto the upstream branch.
@@ -63,77 +126,32 @@ advice.*::
the template shown when writing commit messages in
linkgit:git-commit[1], and in the help message shown
by linkgit:git-switch[1] or
- linkgit:git-checkout[1] when switching branch.
+ linkgit:git-checkout[1] when switching branches.
statusUoption::
- Advise to consider using the `-u` option to linkgit:git-status[1]
- when the command takes more than 2 seconds to enumerate untracked
- files.
- commitBeforeMerge::
- Advice shown when linkgit:git-merge[1] refuses to
- merge to avoid overwriting local changes.
- resetNoRefresh::
- Advice to consider using the `--no-refresh` option to
- linkgit:git-reset[1] when the command takes more than 2 seconds
- to refresh the index after reset.
- resolveConflict::
- Advice shown by various commands when conflicts
- prevent the operation from being performed.
- sequencerInUse::
- Advice shown when a sequencer command is already in progress.
- implicitIdentity::
- Advice on how to set your identity configuration when
- your information is guessed from the system username and
- domain name.
- detachedHead::
- Advice shown when you used
- linkgit:git-switch[1] or linkgit:git-checkout[1]
- to move to the detach HEAD state, to instruct how to
- create a local branch after the fact.
- suggestDetachingHead::
- Advice shown when linkgit:git-switch[1] refuses to detach HEAD
- without the explicit `--detach` option.
- checkoutAmbiguousRemoteBranchName::
- Advice shown when the argument to
- linkgit:git-checkout[1] and linkgit:git-switch[1]
- ambiguously resolves to a
- remote tracking branch on more than one remote in
- situations where an unambiguous argument would have
- otherwise caused a remote-tracking branch to be
- checked out. See the `checkout.defaultRemote`
- configuration variable for how to set a given remote
- to used by default in some situations where this
- advice would be printed.
- amWorkDir::
- Advice that shows the location of the patch file when
- linkgit:git-am[1] fails to apply it.
- rmHints::
- In case of failure in the output of linkgit:git-rm[1],
- show directions on how to proceed from the current state.
- addEmbeddedRepo::
- Advice on what to do when you've accidentally added one
- git repo inside of another.
- ignoredHook::
- Advice shown if a hook is ignored because the hook is not
- set as executable.
- waitingForEditor::
- Print a message to the terminal whenever Git is waiting for
- editor input from the user.
- nestedTag::
- Advice shown if a user attempts to recursively tag a tag object.
+ Shown when linkgit:git-status[1] takes more than 2
+ seconds to enumerate untracked files, to tell the user that
+ they can use the `-u` option.
submoduleAlternateErrorStrategyDie::
- Advice shown when a submodule.alternateErrorStrategy option
+ Shown when a submodule.alternateErrorStrategy option
configured to "die" causes a fatal error.
+ submoduleMergeConflict::
+ Advice shown when a non-trivial submodule merge conflict is
+ encountered.
submodulesNotUpdated::
- Advice shown when a user runs a submodule command that fails
+ Shown when a user runs a submodule command that fails
because `git submodule update --init` was not run.
- addIgnoredFile::
- Advice shown if a user attempts to add an ignored file to
- the index.
- addEmptyPathspec::
- Advice shown if a user runs the add command without providing
- the pathspec parameter.
+ suggestDetachingHead::
+ Shown when linkgit:git-switch[1] refuses to detach HEAD
+ without the explicit `--detach` option.
updateSparsePath::
- Advice shown when either linkgit:git-add[1] or linkgit:git-rm[1]
+ Shown when either linkgit:git-add[1] or linkgit:git-rm[1]
is asked to update index entries outside the current sparse
checkout.
+ waitingForEditor::
+ Shown when Git is waiting for editor input. Relevant
+ when e.g. the editor is not launched inside the terminal.
+ worktreeAddOrphan::
+ Shown when the user tries to create a worktree from an
+ invalid reference, to tell the user how to create a new unborn
+ branch instead.
--
diff --git a/Documentation/config/alias.txt b/Documentation/config/alias.txt
index f1ca739..01df96f 100644
--- a/Documentation/config/alias.txt
+++ b/Documentation/config/alias.txt
@@ -4,7 +4,7 @@ alias.*::
`git last` is equivalent to `git cat-file commit HEAD`. To avoid
confusion and troubles with script usage, aliases that
hide existing Git commands are ignored. Arguments are split by
- spaces, the usual shell quoting and escaping is supported.
+ spaces, the usual shell quoting and escaping are supported.
A quote pair or a backslash can be used to quote them.
+
Note that the first word of an alias does not necessarily have to be a
diff --git a/Documentation/config/apply.txt b/Documentation/config/apply.txt
index 8fb8ef7..f9908e2 100644
--- a/Documentation/config/apply.txt
+++ b/Documentation/config/apply.txt
@@ -2,10 +2,10 @@ apply.ignoreWhitespace::
When set to 'change', tells 'git apply' to ignore changes in
whitespace, in the same way as the `--ignore-space-change`
option.
- When set to one of: no, none, never, false tells 'git apply' to
+ When set to one of: no, none, never, false, it tells 'git apply' to
respect all whitespace differences.
See linkgit:git-apply[1].
apply.whitespace::
- Tells 'git apply' how to handle whitespaces, in the same way
+ Tells 'git apply' how to handle whitespace, in the same way
as the `--whitespace` option. See linkgit:git-apply[1].
diff --git a/Documentation/config/attr.txt b/Documentation/config/attr.txt
new file mode 100644
index 0000000..1a482d6
--- /dev/null
+++ b/Documentation/config/attr.txt
@@ -0,0 +1,7 @@
+attr.tree::
+ A reference to a tree in the repository from which to read attributes,
+ instead of the `.gitattributes` file in the working tree. In a bare
+ repository, this defaults to `HEAD:.gitattributes`. If the value does
+ not resolve to a valid tree object, an empty tree is used instead.
+ When the `GIT_ATTR_SOURCE` environment variable or `--attr-source`
+ command line option are used, this configuration variable has no effect.
diff --git a/Documentation/config/branch.txt b/Documentation/config/branch.txt
index 445341a..432b9cd 100644
--- a/Documentation/config/branch.txt
+++ b/Documentation/config/branch.txt
@@ -36,7 +36,7 @@ branch.sort::
branch.<name>.remote::
When on branch <name>, it tells 'git fetch' and 'git push'
- which remote to fetch from/push to. The remote to push to
+ which remote to fetch from or push to. The remote to push to
may be overridden with `remote.pushDefault` (for all branches).
The remote to push to, for the current branch, may be further
overridden by `branch.<name>.pushRemote`. If no remote is
@@ -64,7 +64,7 @@ branch.<name>.merge::
handled like the remote part of a refspec, and must match a
ref which is fetched from the remote given by
"branch.<name>.remote".
- The merge information is used by 'git pull' (which at first calls
+ The merge information is used by 'git pull' (which first calls
'git fetch') to lookup the default branch for merging. Without
this option, 'git pull' defaults to merge the first refspec fetched.
Specify multiple values to get an octopus merge.
@@ -99,5 +99,5 @@ for details).
branch.<name>.description::
Branch description, can be edited with
`git branch --edit-description`. Branch description is
- automatically added in the format-patch cover letter or
+ automatically added to the format-patch cover letter or
request-pull summary.
diff --git a/Documentation/config/bundle.txt b/Documentation/config/bundle.txt
new file mode 100644
index 0000000..3faae386
--- /dev/null
+++ b/Documentation/config/bundle.txt
@@ -0,0 +1,31 @@
+bundle.*::
+ The `bundle.*` keys may appear in a bundle list file found via the
+ `git clone --bundle-uri` option. These keys currently have no effect
+ if placed in a repository config file, though this will change in the
+ future. See link:technical/bundle-uri.html[the bundle URI design
+ document] for more details.
+
+bundle.version::
+ This integer value advertises the version of the bundle list format
+ used by the bundle list. Currently, the only accepted value is `1`.
+
+bundle.mode::
+ This string value should be either `all` or `any`. This value describes
+ whether all of the advertised bundles are required to unbundle a
+ complete understanding of the bundled information (`all`) or if any one
+ of the listed bundle URIs is sufficient (`any`).
+
+bundle.heuristic::
+ If this string-valued key exists, then the bundle list is designed to
+ work well with incremental `git fetch` commands. The heuristic signals
+ that there are additional keys available for each bundle that help
+ determine which subset of bundles the client should download. The
+ only value currently understood is `creationToken`.
+
+bundle.<id>.*::
+ The `bundle.<id>.*` keys are used to describe a single item in the
+ bundle list, grouped under `<id>` for identification purposes.
+
+bundle.<id>.uri::
+ This string value defines the URI by which Git can reach the contents
+ of this `<id>`. This URI may be a bundle file or another bundle list.
diff --git a/Documentation/config/checkout.txt b/Documentation/config/checkout.txt
index bfbca90..a323022 100644
--- a/Documentation/config/checkout.txt
+++ b/Documentation/config/checkout.txt
@@ -30,7 +30,7 @@ checkout.workers::
all commands that perform checkout. E.g. checkout, clone, reset,
sparse-checkout, etc.
+
-Note: parallel checkout usually delivers better performance for repositories
+Note: Parallel checkout usually delivers better performance for repositories
located on SSDs or over NFS. For repositories on spinning disks and/or machines
with a small number of cores, the default sequential checkout often performs
better. The size and compression level of a repository might also influence how
@@ -39,6 +39,6 @@ well the parallel version performs.
checkout.thresholdForParallelism::
When running parallel checkout with a small number of files, the cost
of subprocess spawning and inter-process communication might outweigh
- the parallelization gains. This setting allows to define the minimum
+ the parallelization gains. This setting allows you to define the minimum
number of files for which parallel checkout should be attempted. The
default is 100.
diff --git a/Documentation/config/clean.txt b/Documentation/config/clean.txt
index a807c92..c0188ea 100644
--- a/Documentation/config/clean.txt
+++ b/Documentation/config/clean.txt
@@ -1,3 +1,3 @@
clean.requireForce::
- A boolean to make git-clean do nothing unless given -f,
- -i or -n. Defaults to true.
+ A boolean to make git-clean refuse to delete files unless -f
+ is given. Defaults to true.
diff --git a/Documentation/config/clone.txt b/Documentation/config/clone.txt
index 26f4fb1..0a10efd 100644
--- a/Documentation/config/clone.txt
+++ b/Documentation/config/clone.txt
@@ -1,13 +1,23 @@
-clone.defaultRemoteName::
+`clone.defaultRemoteName`::
The name of the remote to create when cloning a repository. Defaults to
- `origin`, and can be overridden by passing the `--origin` command-line
+ `origin`.
+ifdef::git-clone[]
+ It can be overridden by passing the `--origin` command-line
+ option.
+endif::[]
+ifndef::git-clone[]
+ It can be overridden by passing the `--origin` command-line
option to linkgit:git-clone[1].
+endif::[]
-clone.rejectShallow::
- Reject to clone a repository if it is a shallow one, can be overridden by
- passing option `--reject-shallow` in command line. See linkgit:git-clone[1]
+`clone.rejectShallow`::
+ Reject cloning a repository if it is a shallow one; this can be overridden by
+ passing the `--reject-shallow` option on the command line.
+ifndef::git-clone[]
+ See linkgit:git-clone[1].
+endif::[]
-clone.filterSubmodules::
+`clone.filterSubmodules`::
If a partial clone filter is provided (see `--filter` in
linkgit:git-rev-list[1]) and `--recurse-submodules` is used, also apply
the filter to submodules.
diff --git a/Documentation/config/color.txt b/Documentation/config/color.txt
index 1795b2d..2f2275a 100644
--- a/Documentation/config/color.txt
+++ b/Documentation/config/color.txt
@@ -106,7 +106,7 @@ color.grep.<slot>::
matching text in context lines
`matchSelected`;;
matching text in selected lines. Also, used to customize the following
- linkgit:git-log[1] subcommands: `--grep`, `--author` and `--committer`.
+ linkgit:git-log[1] subcommands: `--grep`, `--author`, and `--committer`.
`selected`;;
non-matching text in selected lines. Also, used to customize the
following linkgit:git-log[1] subcommands: `--grep`, `--author` and
diff --git a/Documentation/config/column.txt b/Documentation/config/column.txt
index 76aa2f2..01e4198 100644
--- a/Documentation/config/column.txt
+++ b/Documentation/config/column.txt
@@ -43,7 +43,7 @@ column.branch::
See `column.ui` for details.
column.clean::
- Specify the layout when list items in `git clean -i`, which always
+ Specify the layout when listing items in `git clean -i`, which always
shows files and directories in columns. See `column.ui` for details.
column.status::
@@ -51,5 +51,5 @@ column.status::
See `column.ui` for details.
column.tag::
- Specify whether to output tag listing in `git tag` in columns.
+ Specify whether to output tag listings in `git tag` in columns.
See `column.ui` for details.
diff --git a/Documentation/config/commit.txt b/Documentation/config/commit.txt
index 2c95573..62f0d92 100644
--- a/Documentation/config/commit.txt
+++ b/Documentation/config/commit.txt
@@ -2,7 +2,7 @@ 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
- with comment character `#` in your log message, in which case you
+ 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).
@@ -25,5 +25,5 @@ commit.template::
new commit messages.
commit.verbose::
- A boolean or int to specify the level of verbose with `git commit`.
+ A boolean or int to specify the level of verbosity with `git commit`.
See linkgit:git-commit[1].
diff --git a/Documentation/config/core.txt b/Documentation/config/core.txt
index 88bc799c..93d65e1 100644
--- a/Documentation/config/core.txt
+++ b/Documentation/config/core.txt
@@ -444,17 +444,32 @@ You probably do not need to adjust this value.
Common unit suffixes of 'k', 'm', or 'g' are supported.
core.bigFileThreshold::
- Files larger than this size are stored deflated, without
- attempting delta compression. Storing large files without
- delta compression avoids excessive memory usage, at the
- slight expense of increased disk usage. Additionally files
- larger than this size are always treated as binary.
+ The size of files considered "big", which as discussed below
+ changes the behavior of numerous git commands, as well as how
+ such files are stored within the repository. The default is
+ 512 MiB. Common unit suffixes of 'k', 'm', or 'g' are
+ supported.
+
-Default is 512 MiB on all platforms. This should be reasonable
-for most projects as source code and other text files can still
-be delta compressed, but larger binary media files won't be.
+Files above the configured limit will be:
+
-Common unit suffixes of 'k', 'm', or 'g' are supported.
+* Stored deflated in packfiles, without attempting delta compression.
++
+The default limit is primarily set with this use-case in mind. With it,
+most projects will have their source code and other text files delta
+compressed, but not larger binary media files.
++
+Storing large files without delta compression avoids excessive memory
+usage, at the slight expense of increased disk usage.
++
+* Will be treated as if they were labeled "binary" (see
+ linkgit:gitattributes[5]). e.g. linkgit:git-log[1] and
+ linkgit:git-diff[1] will not compute diffs for files above this limit.
++
+* Will generally be streamed when written, which avoids excessive
+memory usage, at the cost of some fixed overhead. Commands that make
+use of this include linkgit:git-archive[1],
+linkgit:git-fast-import[1], linkgit:git-index-pack[1],
+linkgit:git-unpack-objects[1] and linkgit:git-fsck[1].
core.excludesFile::
Specifies the pathname to the file that contains patterns to
@@ -505,6 +520,7 @@ core.editor::
`GIT_EDITOR` is not set. See linkgit:git-var[1].
core.commentChar::
+core.commentString::
Commands such as `commit` and `tag` that let you edit
messages consider a line that begins with this character
commented, and removes them after the editor returns
@@ -512,6 +528,20 @@ core.commentChar::
+
If set to "auto", `git-commit` would select a character that is not
the beginning character of any line in existing commit messages.
++
+Note that these two variables are aliases of each other, and in modern
+versions of Git you are free to use a string (e.g., `//` or `â‘â•â‘`) with
+`commentChar`. Versions of Git prior to v2.45.0 will ignore
+`commentString` but will reject a value of `commentChar` that consists
+of more than a single ASCII byte. If you plan to use your config with
+older and newer versions of Git, you may want to specify both:
++
+ [core]
+ # single character for older versions
+ commentChar = "#"
+ # string for newer versions (which will override commentChar
+ # because it comes later in the file)
+ commentString = "//"
core.filesRefLockTimeout::
The length of time, in milliseconds, to retry when trying to
@@ -603,7 +633,7 @@ but risks losing recent work in the event of an unclean system shutdown.
* `loose-object` hardens objects added to the repo in loose-object form.
* `pack` hardens objects added to the repo in packfile form.
* `pack-metadata` hardens packfile bitmaps and indexes.
-* `commit-graph` hardens the commit graph file.
+* `commit-graph` hardens the commit-graph file.
* `index` hardens the index when it is modified.
* `objects` is an aggregate option that is equivalent to
`loose-object,pack`.
@@ -673,7 +703,7 @@ core.createObject::
will not overwrite existing objects.
+
On some file system/operating system combinations, this is unreliable.
-Set this config setting to 'rename' there; However, This will remove the
+Set this config setting to 'rename' there; however, this will remove the
check that makes sure that existing object files will not get overwritten.
core.notesRef::
@@ -721,3 +751,9 @@ core.abbrev::
If set to "no", no abbreviation is made and the object names
are shown in their full length.
The minimum length is 4.
+
+core.maxTreeDepth::
+ The maximum depth Git is willing to recurse while traversing a
+ tree (e.g., "a/b/cde/f" has a depth of 4). This is a fail-safe
+ to allow Git to abort cleanly, and should not generally need to
+ be adjusted. The default is 4096.
diff --git a/Documentation/config/credential.txt b/Documentation/config/credential.txt
index 512f318..0221c3e 100644
--- a/Documentation/config/credential.txt
+++ b/Documentation/config/credential.txt
@@ -21,7 +21,7 @@ credential.username::
credential.<url>.*::
Any of the credential.* options above can be applied selectively to
- some credentials. For example "credential.https://example.com.username"
+ some credentials. For example, "credential.https://example.com.username"
would set the default username only for https connections to
example.com. See linkgit:gitcredentials[7] for details on how URLs are
matched.
@@ -31,6 +31,6 @@ credentialCache.ignoreSIGHUP::
credentialStore.lockTimeoutMS::
The length of time, in milliseconds, for git-credential-store to retry
- when trying to lock the credentials file. Value 0 means not to retry at
+ when trying to lock the credentials file. A value of 0 means not to retry at
all; -1 means to try indefinitely. Default is 1000 (i.e., retry for
1s).
diff --git a/Documentation/config/diff.txt b/Documentation/config/diff.txt
index 32f8483..5ce7b91 100644
--- a/Documentation/config/diff.txt
+++ b/Documentation/config/diff.txt
@@ -1,6 +1,6 @@
diff.autoRefreshIndex::
When using 'git diff' to compare with work tree
- files, do not consider stat-only change as changed.
+ files, do not consider stat-only changes as changed.
Instead, silently run `git update-index --refresh` to
update the cached stat information for paths whose
contents in the work tree match the contents in the
@@ -52,6 +52,10 @@ directories with less than 10% of the total amount of changed files,
and accumulating child directory counts in the parent directories:
`files,10,cumulative`.
+diff.statNameWidth::
+ Limit the width of the filename part in --stat output. If set, applies
+ to all commands generating --stat output except format-patch.
+
diff.statGraphWidth::
Limit the width of the graph part in --stat output. If set, applies
to all commands generating --stat output except format-patch.
@@ -104,9 +108,15 @@ diff.mnemonicPrefix::
`git diff --no-index a b`;;
compares two non-git things (1) and (2).
-diff.noprefix::
+diff.noPrefix::
If set, 'git diff' does not show any source or destination prefix.
+diff.srcPrefix::
+ If set, 'git diff' uses this source prefix. Defaults to "a/".
+
+diff.dstPrefix::
+ If set, 'git diff' uses this destination prefix. Defaults to "b/".
+
diff.relative::
If set to 'true', 'git diff' does not show changes outside of the directory
and show pathnames relative to the current directory.
@@ -178,21 +188,6 @@ diff.<driver>.cachetextconv::
Set this option to true to make the diff driver cache the text
conversion outputs. See linkgit:gitattributes[5] for details.
-diff.tool::
- Controls which diff tool is used by linkgit:git-difftool[1].
- This variable overrides the value configured in `merge.tool`.
- The list below shows the valid built-in values.
- Any other value is treated as a custom diff tool and requires
- that a corresponding difftool.<tool>.cmd variable is defined.
-
-diff.guitool::
- Controls which diff tool is used by linkgit:git-difftool[1] when
- the -g/--gui flag is specified. This variable overrides the value
- configured in `merge.guitool`. The list below shows the valid
- built-in values. Any other value is treated as a custom diff tool
- and requires that a corresponding difftool.<guitool>.cmd variable
- is defined.
-
include::../mergetools-diff.txt[]
diff.indentHeuristic::
@@ -234,5 +229,5 @@ diff.colorMoved::
diff.colorMovedWS::
When moved lines are colored using e.g. the `diff.colorMoved` setting,
- this option controls the `<mode>` how spaces are treated
- for details of valid modes see '--color-moved-ws' in linkgit:git-diff[1].
+ this option controls the `<mode>` how spaces are treated.
+ For details of valid modes see '--color-moved-ws' in linkgit:git-diff[1].
diff --git a/Documentation/config/difftool.txt b/Documentation/config/difftool.txt
index 6762594..447c40d 100644
--- a/Documentation/config/difftool.txt
+++ b/Documentation/config/difftool.txt
@@ -1,6 +1,17 @@
-difftool.<tool>.path::
- Override the path for the given tool. This is useful in case
- your tool is not in the PATH.
+diff.tool::
+ Controls which diff tool is used by linkgit:git-difftool[1].
+ This variable overrides the value configured in `merge.tool`.
+ The list below shows the valid built-in values.
+ Any other value is treated as a custom diff tool and requires
+ that a corresponding difftool.<tool>.cmd variable is defined.
+
+diff.guitool::
+ Controls which diff tool is used by linkgit:git-difftool[1] when
+ the -g/--gui flag is specified. This variable overrides the value
+ configured in `merge.guitool`. The list below shows the valid
+ built-in values. Any other value is treated as a custom diff tool
+ and requires that a corresponding difftool.<guitool>.cmd variable
+ is defined.
difftool.<tool>.cmd::
Specify the command to invoke the specified diff tool.
@@ -9,6 +20,24 @@ difftool.<tool>.cmd::
file containing the contents of the diff pre-image and 'REMOTE'
is set to the name of the temporary file containing the contents
of the diff post-image.
++
+See the `--tool=<tool>` option in linkgit:git-difftool[1] for more details.
+
+difftool.<tool>.path::
+ Override the path for the given tool. This is useful in case
+ your tool is not in the PATH.
+
+difftool.trustExitCode::
+ Exit difftool if the invoked diff tool returns a non-zero exit status.
++
+See the `--trust-exit-code` option in linkgit:git-difftool[1] for more details.
difftool.prompt::
Prompt before each invocation of the diff tool.
+
+difftool.guiDefault::
+ Set `true` to use the `diff.guitool` by default (equivalent to specifying
+ the `--gui` argument), or `auto` to select `diff.guitool` or `diff.tool`
+ depending on the presence of a `DISPLAY` environment variable value. The
+ default is `false`, where the `--gui` argument must be provided
+ explicitly for the `diff.guitool` to be used.
diff --git a/Documentation/config/extensions.txt b/Documentation/config/extensions.txt
index bccaec7..38dce3d 100644
--- a/Documentation/config/extensions.txt
+++ b/Documentation/config/extensions.txt
@@ -7,6 +7,29 @@ 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.
+extensions.compatObjectFormat::
+
+ Specify a compatitbility hash algorithm to use. The acceptable values
+ are `sha1` and `sha256`. The value specified must be different from the
+ value of extensions.objectFormat. This allows client level
+ interoperability between git repositories whose objectFormat matches
+ this compatObjectFormat. In particular when fully implemented the
+ pushes and pulls from a repository in whose objectFormat matches
+ compatObjectFormat. As well as being able to use oids encoded in
+ compatObjectFormat in addition to oids encoded with objectFormat to
+ locally specify objects.
+
+extensions.refStorage::
+ Specify the ref storage format to use. The acceptable values are:
++
+include::../ref-storage-format.txt[]
++
+It is an error to specify this key unless `core.repositoryFormatVersion` is 1.
++
+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.
+
extensions.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/fastimport.txt b/Documentation/config/fastimport.txt
index c1166e3..903677d 100644
--- a/Documentation/config/fastimport.txt
+++ b/Documentation/config/fastimport.txt
@@ -1,8 +1,8 @@
fastimport.unpackLimit::
If the number of objects imported by linkgit:git-fast-import[1]
is below this limit, then the objects will be unpacked into
- loose object files. However if the number of imported objects
- equals or exceeds this limit then the pack will be stored as a
+ loose object files. However, if the number of imported objects
+ equals or exceeds this limit, then the pack will be stored as a
pack. Storing the pack from a fast-import can make the import
operation complete faster, especially on slow filesystems. If
not set, the value of `transfer.unpackLimit` is used instead.
diff --git a/Documentation/config/feature.txt b/Documentation/config/feature.txt
index cdecd04..f061b64 100644
--- a/Documentation/config/feature.txt
+++ b/Documentation/config/feature.txt
@@ -14,12 +14,23 @@ feature.experimental::
+
* `fetch.negotiationAlgorithm=skipping` may improve fetch negotiation times by
skipping more commits at a time, reducing the number of round trips.
++
+* `pack.useBitmapBoundaryTraversal=true` may improve bitmap traversal times by
+walking fewer objects.
++
+* `pack.allowPackReuse=multi` may improve the time it takes to create a pack by
+reusing objects from multiple packs instead of just one.
feature.manyFiles::
Enable config options that optimize for repos with many files in the
working directory. With many files, commands such as `git status` and
`git checkout` may be slow and these new defaults improve performance:
+
+* `index.skipHash=true` speeds up index writes by not computing a trailing
+ checksum. Note that this will cause Git versions earlier than 2.13.0 to
+ refuse to parse the index and Git versions earlier than 2.40.0 will report
+ a corrupted index during `git fsck`.
++
* `index.version=4` enables path-prefix compression in the index.
+
* `core.untrackedCache=true` enables the untracked cache. This setting assumes
diff --git a/Documentation/config/fetch.txt b/Documentation/config/fetch.txt
index cd65d23..d7dc461 100644
--- a/Documentation/config/fetch.txt
+++ b/Documentation/config/fetch.txt
@@ -50,10 +50,16 @@ fetch.pruneTags::
refs. See also `remote.<name>.pruneTags` and the PRUNING
section of linkgit:git-fetch[1].
+fetch.all::
+ If true, fetch will attempt to update all available remotes.
+ This behavior can be overridden by passing `--no-all` or by
+ explicitly specifying one or more remote(s) to fetch from.
+ Defaults to false.
+
fetch.output::
Control how ref update status is printed. Valid values are
- `full` and `compact`. Default value is `full`. See section
- OUTPUT in linkgit:git-fetch[1] for detail.
+ `full` and `compact`. Default value is `full`. See the
+ OUTPUT section in linkgit:git-fetch[1] for details.
fetch.negotiationAlgorithm::
Control how information about the commits in the local repository
@@ -96,3 +102,27 @@ fetch.writeCommitGraph::
merge and the write may take longer. Having an updated commit-graph
file helps performance of many Git commands, including `git merge-base`,
`git push -f`, and `git log --graph`. Defaults to false.
+
+fetch.bundleURI::
+ This value stores a URI for downloading Git object data from a bundle
+ URI before performing an incremental fetch from the origin Git server.
+ This is similar to how the `--bundle-uri` option behaves in
+ linkgit:git-clone[1]. `git clone --bundle-uri` will set the
+ `fetch.bundleURI` value if the supplied bundle URI contains a bundle
+ list that is organized for incremental fetches.
++
+If you modify this value and your repository has a `fetch.bundleCreationToken`
+value, then remove that `fetch.bundleCreationToken` value before fetching from
+the new bundle URI.
+
+fetch.bundleCreationToken::
+ When using `fetch.bundleURI` to fetch incrementally from a bundle
+ list that uses the "creationToken" heuristic, this config value
+ stores the maximum `creationToken` value of the downloaded bundles.
+ This value is used to prevent downloading bundles in the future
+ if the advertised `creationToken` is not strictly larger than this
+ value.
++
+The creation token values are chosen by the provider serving the specific
+bundle URI. If you modify the URI at `fetch.bundleURI`, then be sure to
+remove the value for the `fetch.bundleCreationToken` value before fetching.
diff --git a/Documentation/config/format.txt b/Documentation/config/format.txt
index fdbc06a..7410e93 100644
--- a/Documentation/config/format.txt
+++ b/Documentation/config/format.txt
@@ -3,7 +3,8 @@ format.attach::
'format-patch'. The value can also be a double quoted string
which will enable attachments as the default and set the
value as the boundary. See the --attach option in
- linkgit:git-format-patch[1].
+ linkgit:git-format-patch[1]. To countermand an earlier
+ value, set it to an empty string.
format.from::
Provides the default value for the `--from` option to format-patch.
@@ -15,6 +16,10 @@ format.from::
different. If set to a non-boolean value, format-patch uses that
value instead of your committer identity. Defaults to false.
+format.forceInBodyFrom::
+ Provides the default value for the `--[no-]force-in-body-from`
+ option to format-patch. Defaults to false.
+
format.numbered::
A boolean which can enable or disable sequence numbers in patch
subjects. It defaults to "auto" which enables it only if there
@@ -63,7 +68,7 @@ format.encodeEmailHeaders::
Defaults to true.
format.pretty::
- The default pretty format for log/show/whatchanged command,
+ The default pretty format for log/show/whatchanged command.
See linkgit:git-log[1], linkgit:git-show[1],
linkgit:git-whatchanged[1].
@@ -114,7 +119,7 @@ format.notes::
`--notes=<ref>`, where `ref` is the non-boolean value. Defaults
to false.
+
-If one wishes to use the ref `ref/notes/true`, please use that literal
+If one wishes to use the ref `refs/notes/true`, please use that literal
instead.
+
This configuration can be specified multiple times in order to allow
@@ -135,3 +140,14 @@ For example,
------------
+
will only show notes from `refs/notes/bar`.
+
+format.mboxrd::
+ A boolean value which enables the robust "mboxrd" format when
+ `--stdout` is in use to escape "^>+From " lines.
+
+format.noprefix::
+ If set, do not show any source or destination prefix in patches.
+ This is equivalent to the `diff.noprefix` option used by `git
+ diff` (but which is not respected by `format-patch`). Note that
+ by setting this, the receiver of any patches you generate will
+ have to apply them using the `-p0` option.
diff --git a/Documentation/config/fsck.txt b/Documentation/config/fsck.txt
index 450e8c3..8e9e508 100644
--- a/Documentation/config/fsck.txt
+++ b/Documentation/config/fsck.txt
@@ -11,13 +11,13 @@ to clone or fetch it set `fetch.fsck.<msg-id>`.
+
The rest of the documentation discusses `fsck.*` for brevity, but the
same applies for the corresponding `receive.fsck.*` and
-`fetch.<msg-id>.*`. variables.
+`fetch.fsck.*`. variables.
+
-Unlike variables like `color.ui` and `core.editor` the
+Unlike variables like `color.ui` and `core.editor`, the
`receive.fsck.<msg-id>` and `fetch.fsck.<msg-id>` variables will not
fall back on the `fsck.<msg-id>` configuration if they aren't set. To
-uniformly configure the same fsck settings in different circumstances
-all three of them they must all set to the same values.
+uniformly configure the same fsck settings in different circumstances,
+all three of them must be set to the same values.
+
When `fsck.<msg-id>` is set, errors can be switched to warnings and
vice versa by configuring the `fsck.<msg-id>` setting where the
@@ -35,16 +35,20 @@ allow new instances of the same breakages go unnoticed.
Setting an unknown `fsck.<msg-id>` value will cause fsck to die, but
doing the same for `receive.fsck.<msg-id>` and `fetch.fsck.<msg-id>`
will only cause git to warn.
++
+See the `Fsck Messages` section of linkgit:git-fsck[1] for supported
+values of `<msg-id>`.
+
fsck.skipList::
The path to a list of object names (i.e. one unabbreviated SHA-1 per
line) that are known to be broken in a non-fatal way and should
- be ignored. On versions of Git 2.20 and later comments ('#'), empty
- lines, and any leading and trailing whitespace is ignored. Everything
+ be ignored. On versions of Git 2.20 and later, comments ('#'), empty
+ lines, and any leading and trailing whitespace are ignored. Everything
but a SHA-1 per line will error out on older versions.
+
This feature is useful when an established project should be accepted
-despite early commits containing errors that can be safely ignored
+despite early commits containing errors that can be safely ignored,
such as invalid committer email addresses. Note: corrupt objects
cannot be skipped with this setting.
+
@@ -54,11 +58,11 @@ Like `fsck.<msg-id>` this variable has corresponding
Unlike variables like `color.ui` and `core.editor` the
`receive.fsck.skipList` and `fetch.fsck.skipList` variables will not
fall back on the `fsck.skipList` configuration if they aren't set. To
-uniformly configure the same fsck settings in different circumstances
-all three of them they must all set to the same values.
+uniformly configure the same fsck settings in different circumstances,
+all three of them must be set to the same values.
+
Older versions of Git (before 2.20) documented that the object names
-list should be sorted. This was never a requirement, the object names
+list should be sorted. This was never a requirement; the object names
could appear in any order, but when reading the list we tracked whether
the list was sorted for the purposes of an internal binary search
implementation, which could save itself some work with an already sorted
diff --git a/Documentation/config/fsmonitor--daemon.txt b/Documentation/config/fsmonitor--daemon.txt
new file mode 100644
index 0000000..671f9b9
--- /dev/null
+++ b/Documentation/config/fsmonitor--daemon.txt
@@ -0,0 +1,11 @@
+fsmonitor.allowRemote::
+ By default, the fsmonitor daemon refuses to work with network-mounted
+ repositories. Setting `fsmonitor.allowRemote` to `true` overrides this
+ behavior. Only respected when `core.fsmonitor` is set to `true`.
+
+fsmonitor.socketDir::
+ This Mac OS-specific option, if set, specifies the directory in
+ which to create the Unix domain socket used for communication
+ between the fsmonitor daemon and various Git commands. The directory must
+ reside on a native Mac OS filesystem. Only respected when `core.fsmonitor`
+ is set to `true`.
diff --git a/Documentation/config/gc.txt b/Documentation/config/gc.txt
index 38fea07..664a3c2 100644
--- a/Documentation/config/gc.txt
+++ b/Documentation/config/gc.txt
@@ -24,7 +24,7 @@ gc.auto::
default value is 6700.
+
Setting this to 0 disables not only automatic packing based on the
-number of loose objects, but any other heuristic `git gc --auto` will
+number of loose objects, but also any other heuristic `git gc --auto` will
otherwise use to determine if there's work to do, such as
`gc.autoPackLimit`.
@@ -39,15 +39,15 @@ See the `gc.bigPackThreshold` configuration variable below. When in
use, it'll affect how the auto pack limit works.
gc.autoDetach::
- Make `git gc --auto` return immediately and run in background
+ Make `git gc --auto` return immediately and run in the background
if the system supports it. Default is true.
gc.bigPackThreshold::
- If non-zero, all packs larger than this limit are kept when
- `git gc` is run. This is very similar to `--keep-largest-pack`
- except that all packs that meet the threshold are kept, not
- just the largest pack. Defaults to zero. Common unit suffixes of
- 'k', 'm', or 'g' are supported.
+ If non-zero, all non-cruft packs larger than this limit are kept
+ when `git gc` is run. This is very similar to
+ `--keep-largest-pack` except that all non-cruft packs that meet
+ the threshold are kept, not just the largest pack. Defaults to
+ zero. Common unit suffixes of 'k', 'm', or 'g' are supported.
+
Note that if the number of kept packs is more than gc.autoPackLimit,
this configuration variable is ignored, all packs except the base pack
@@ -84,7 +84,13 @@ gc.packRefs::
gc.cruftPacks::
Store unreachable objects in a cruft pack (see
linkgit:git-repack[1]) instead of as loose objects. The default
- is `false`.
+ is `true`.
+
+gc.maxCruftSize::
+ Limit the size of new cruft packs when repacking. When
+ specified in addition to `--max-cruft-size`, the command line
+ option takes priority. See the `--max-cruft-size` option of
+ linkgit:git-repack[1].
gc.pruneExpire::
When 'git gc' is run, it will call 'prune --expire 2.weeks.ago'
@@ -130,6 +136,37 @@ or rebase occurring. Since these changes are not part of the current
project most users will want to expire them sooner, which is why the
default is more aggressive than `gc.reflogExpire`.
+gc.recentObjectsHook::
+ When considering whether or not to remove an object (either when
+ generating a cruft pack or storing unreachable objects as
+ loose), use the shell to execute the specified command(s).
+ Interpret their output as object IDs which Git will consider as
+ "recent", regardless of their age. By treating their mtimes as
+ "now", any objects (and their descendants) mentioned in the
+ output will be kept regardless of their true age.
++
+Output must contain exactly one hex object ID per line, and nothing
+else. Objects which cannot be found in the repository are ignored.
+Multiple hooks are supported, but all must exit successfully, else the
+operation (either generating a cruft pack or unpacking unreachable
+objects) will be halted.
+
+gc.repackFilter::
+ When repacking, use the specified filter to move certain
+ objects into a separate packfile. See the
+ `--filter=<filter-spec>` option of linkgit:git-repack[1].
+
+gc.repackFilterTo::
+ When repacking and using a filter, see `gc.repackFilter`, the
+ specified location will be used to create the packfile
+ containing the filtered out objects. **WARNING:** The
+ specified location should be accessible, using for example the
+ Git alternates mechanism, otherwise the repo could be
+ considered corrupt by Git as it migh not be able to access the
+ objects in that packfile. See the `--filter-to=<dir>` option
+ of linkgit:git-repack[1] and the `objects/info/alternates`
+ section of linkgit:gitrepository-layout[5].
+
gc.rerereResolved::
Records of conflicted merge you resolved earlier are
kept for this many days when 'git rerere gc' is run.
diff --git a/Documentation/config/gpg.txt b/Documentation/config/gpg.txt
index 86f6308..5cf32b1 100644
--- a/Documentation/config/gpg.txt
+++ b/Documentation/config/gpg.txt
@@ -4,7 +4,7 @@ gpg.program::
same command-line interface as GPG, namely, to verify a detached
signature, "`gpg --verify $signature - <$file`" is run, and the
program is expected to signal a good signature by exiting with
- code 0, and to generate an ASCII-armored detached signature, the
+ code 0. To generate an ASCII-armored detached signature, the
standard input of "`gpg -bsau $key`" is fed with the contents to be
signed, and the program is expected to send the result to its
standard output.
@@ -12,6 +12,9 @@ gpg.program::
gpg.format::
Specifies which key format to use when signing with `--gpg-sign`.
Default is "openpgp". Other possible values are "x509", "ssh".
++
+See linkgit:gitformat-signature[5] for the signature format, which differs
+based on the selected `gpg.format`.
gpg.<format>.program::
Use this to customize the program used for the signing format you
@@ -22,7 +25,7 @@ gpg.<format>.program::
gpg.minTrustLevel::
Specifies a minimum trust level for signature verification. If
this option is unset, then signature verification for merge
- operations require a key with at least `marginal` trust. Other
+ operations requires a key with at least `marginal` trust. Other
operations that perform signature verification require a key
with at least `undefined` trust. Setting this option overrides
the required trust-level for all operations. Supported values,
@@ -35,7 +38,7 @@ gpg.minTrustLevel::
* `ultimate`
gpg.ssh.defaultKeyCommand::
- This command that will be run when user.signingkey is not set and a ssh
+ This command will be run when user.signingkey is not set and a ssh
signature is requested. On successful exit a valid ssh public key
prefixed with `key::` is expected in the first line of its output.
This allows for a script doing a dynamic lookup of the correct public
diff --git a/Documentation/config/grep.txt b/Documentation/config/grep.txt
index 182edd8..10041f2 100644
--- a/Documentation/config/grep.txt
+++ b/Documentation/config/grep.txt
@@ -17,9 +17,12 @@ grep.extendedRegexp::
other than 'default'.
grep.threads::
- Number of grep worker threads to use.
- See `grep.threads` in linkgit:git-grep[1] for more information.
+ Number of grep worker threads to use. If unset (or set to 0), Git will
+ use as many threads as the number of logical cores available.
+
+grep.fullName::
+ If set to true, enable `--full-name` option by default.
grep.fallbackToNoIndex::
- If set to true, fall back to git grep --no-index if git grep
+ If set to true, fall back to `git grep --no-index` if `git grep`
is executed outside of a git repository. Defaults to false.
diff --git a/Documentation/config/gui.txt b/Documentation/config/gui.txt
index 0c087fd..171be77 100644
--- a/Documentation/config/gui.txt
+++ b/Documentation/config/gui.txt
@@ -24,7 +24,7 @@ gui.matchTrackingBranch::
not. Default: "false".
gui.newBranchTemplate::
- Is used as suggested name when creating new branches using the
+ Is used as a suggested name when creating new branches using the
linkgit:git-gui[1].
gui.pruneDuringFetch::
diff --git a/Documentation/config/http.txt b/Documentation/config/http.txt
index afeeccf..2d4e0c9 100644
--- a/Documentation/config/http.txt
+++ b/Documentation/config/http.txt
@@ -246,20 +246,21 @@ significantly since the entire buffer is allocated even for small
pushes.
http.lowSpeedLimit, http.lowSpeedTime::
- If the HTTP transfer speed is less than 'http.lowSpeedLimit'
- for longer than 'http.lowSpeedTime' seconds, the transfer is aborted.
+ If the HTTP transfer speed, in bytes per second, is less than
+ 'http.lowSpeedLimit' for longer than 'http.lowSpeedTime' seconds,
+ the transfer is aborted.
Can be overridden by the `GIT_HTTP_LOW_SPEED_LIMIT` and
`GIT_HTTP_LOW_SPEED_TIME` environment variables.
http.noEPSV::
A boolean which disables using of EPSV ftp command by curl.
- This can helpful with some "poor" ftp servers which don't
+ This can be helpful with some "poor" ftp servers which don't
support EPSV mode. Can be overridden by the `GIT_CURL_FTP_NO_EPSV`
environment variable. Default is false (curl will use EPSV).
http.userAgent::
The HTTP USER_AGENT string presented to an HTTP server. The default
- value represents the version of the client Git such as git/1.7.1.
+ value represents the version of the Git client such as git/1.7.1.
This option allows you to override this value to a more common value
such as Mozilla/4.0. This may be necessary, for instance, if
connecting through a firewall that restricts HTTP connections to a set
diff --git a/Documentation/config/i18n.txt b/Documentation/config/i18n.txt
index cc25621..6e72fdb 100644
--- a/Documentation/config/i18n.txt
+++ b/Documentation/config/i18n.txt
@@ -2,7 +2,7 @@ i18n.commitEncoding::
Character encoding the commit messages are stored in; Git itself
does not care per se, but this information is necessary e.g. when
importing commits from emails or in the gitk graphical history
- browser (and possibly at other places in the future or in other
+ browser (and possibly in other places in the future or in other
porcelains). See e.g. linkgit:git-mailinfo[1]. Defaults to 'utf-8'.
i18n.logOutputEncoding::
diff --git a/Documentation/config/imap.txt b/Documentation/config/imap.txt
index 06166fb..3d28f72 100644
--- a/Documentation/config/imap.txt
+++ b/Documentation/config/imap.txt
@@ -4,7 +4,7 @@ imap.folder::
"[Gmail]/Drafts". Required.
imap.tunnel::
- Command used to setup a tunnel to the IMAP server through which
+ Command used to set up a tunnel to the IMAP server through which
commands will be piped instead of using a direct network connection
to the server. Required when imap.host is not set.
@@ -37,7 +37,7 @@ imap.preformattedHTML::
format=fixed email. Default is `false`.
imap.authMethod::
- Specify authenticate method for authentication with IMAP server.
+ Specify the authentication method for authenticating with the IMAP server.
If Git was built with the NO_CURL option, or if your curl version is older
than 7.34.0, or if you're running git-imap-send with the `--no-curl`
option, the only supported method is 'CRAM-MD5'. If this is not set
diff --git a/Documentation/config/index.txt b/Documentation/config/index.txt
index 75f3a2d..3eff420 100644
--- a/Documentation/config/index.txt
+++ b/Documentation/config/index.txt
@@ -23,10 +23,21 @@ index.threads::
Specifies the number of threads to spawn when loading the index.
This is meant to reduce index load time on multiprocessor machines.
Specifying 0 or 'true' will cause Git to auto-detect the number of
- CPU's and set the number of threads accordingly. Specifying 1 or
+ CPUs and set the number of threads accordingly. Specifying 1 or
'false' will disable multithreading. Defaults to 'true'.
index.version::
Specify the version with which new index files should be
initialized. This does not affect existing repositories.
If `feature.manyFiles` is enabled, then the default is 4.
+
+index.skipHash::
+ When enabled, do not compute the trailing hash for the index file.
+ This accelerates Git commands that manipulate the index, such as
+ `git add`, `git commit`, or `git status`. Instead of storing the
+ checksum, write a trailing set of bytes with value zero, indicating
+ that the computation was skipped.
++
+If you enable `index.skipHash`, then Git clients older than 2.13.0 will
+refuse to parse the index and Git clients older than 2.40.0 will report an
+error during `git fsck`.
diff --git a/Documentation/config/init.txt b/Documentation/config/init.txt
index 79c79d6..af03acd 100644
--- a/Documentation/config/init.txt
+++ b/Documentation/config/init.txt
@@ -1,7 +1,10 @@
-init.templateDir::
- Specify the directory from which templates will be copied.
- (See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].)
+:see-git-init:
+ifndef::git-init[]
+:see-git-init: (See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].)
+endif::[]
-init.defaultBranch::
+`init.templateDir`::
+ Specify the directory from which templates will be copied. {see-git-init}
+`init.defaultBranch`::
Allows overriding the default branch name e.g. when initializing
a new repository.
diff --git a/Documentation/config/interactive.txt b/Documentation/config/interactive.txt
index a2d3c7e..5cc2655 100644
--- a/Documentation/config/interactive.txt
+++ b/Documentation/config/interactive.txt
@@ -4,9 +4,7 @@ interactive.singleKey::
Currently this is used by the `--patch` mode of
linkgit:git-add[1], linkgit:git-checkout[1],
linkgit:git-restore[1], linkgit:git-commit[1],
- linkgit:git-reset[1], and linkgit:git-stash[1]. Note that this
- setting is silently ignored if portable keystroke input
- is not available; requires the Perl module Term::ReadKey.
+ linkgit:git-reset[1], and linkgit:git-stash[1].
interactive.diffFilter::
When an interactive command (such as `git add --patch`) shows
diff --git a/Documentation/config/log.txt b/Documentation/config/log.txt
index 456eb07..9003a82 100644
--- a/Documentation/config/log.txt
+++ b/Documentation/config/log.txt
@@ -7,6 +7,10 @@ log.date::
Set the default date-time mode for the 'log' command.
Setting a value for log.date is similar to using 'git log''s
`--date` option. See linkgit:git-log[1] for details.
++
+If the format is set to "auto:foo" and the pager is in use, format
+"foo" will be used for the date format. Otherwise, "default" will
+be used.
log.decorate::
Print out the ref names of any commits that are shown by the log
@@ -18,6 +22,11 @@ log.decorate::
names are shown. This is the same as the `--decorate` option
of the `git log`.
+log.initialDecorationSet::
+ By default, `git log` only shows decorations for certain known ref
+ namespaces. If 'all' is specified, then show all refs as
+ decorations.
+
log.excludeDecoration::
Exclude the specified patterns from the log decorations. This is
similar to the `--decorate-refs-exclude` command-line option, but
@@ -25,9 +34,9 @@ log.excludeDecoration::
option.
log.diffMerges::
- Set default diff format to be used for merge commits. See
- `--diff-merges` in linkgit:git-log[1] for details.
- Defaults to `separate`.
+ Set diff format to be used when `--diff-merges=on` is
+ specified, see `--diff-merges` in linkgit:git-log[1] for
+ details. Defaults to `separate`.
log.follow::
If `true`, `git log` will act as if the `--follow` option was used when
diff --git a/Documentation/config/lsrefs.txt b/Documentation/config/lsrefs.txt
index adeda0f..3d88fb0 100644
--- a/Documentation/config/lsrefs.txt
+++ b/Documentation/config/lsrefs.txt
@@ -1,7 +1,7 @@
lsrefs.unborn::
May be "advertise" (the default), "allow", or "ignore". If "advertise",
the server will respond to the client sending "unborn" (as described in
- protocol-v2.txt) and will advertise support for this feature during the
+ linkgit:gitprotocol-v2[5]) and will advertise support for this feature during the
protocol v2 capability advertisement. "allow" is the same as
"advertise" except that the server will not advertise support for this
feature; this is useful for load-balanced servers that cannot be
diff --git a/Documentation/config/mailinfo.txt b/Documentation/config/mailinfo.txt
index 3854d4a..ec3a5d8 100644
--- a/Documentation/config/mailinfo.txt
+++ b/Documentation/config/mailinfo.txt
@@ -1,6 +1,6 @@
mailinfo.scissors::
If true, makes linkgit:git-mailinfo[1] (and therefore
linkgit:git-am[1]) act by default as if the --scissors option
- was provided on the command-line. When active, this features
+ was provided on the command-line. When active, this feature
removes everything from the message body before a scissors
line (i.e. consisting mainly of ">8", "8<" and "-").
diff --git a/Documentation/config/maintenance.txt b/Documentation/config/maintenance.txt
index 18f0562..69a4f05 100644
--- a/Documentation/config/maintenance.txt
+++ b/Documentation/config/maintenance.txt
@@ -12,7 +12,7 @@ maintenance.strategy::
then that value is used instead of the one provided by
`maintenance.strategy`. The possible strategy strings are:
+
-* `none`: This default setting implies no task are run at any schedule.
+* `none`: This default setting implies no tasks are run at any schedule.
* `incremental`: This setting optimizes for performing small maintenance
activities that do not delete any data. This does not schedule the `gc`
task, but runs the `prefetch` and `commit-graph` tasks hourly, the
diff --git a/Documentation/config/man.txt b/Documentation/config/man.txt
index a727d98..5a0f82c 100644
--- a/Documentation/config/man.txt
+++ b/Documentation/config/man.txt
@@ -5,7 +5,7 @@ man.viewer::
man.<tool>.cmd::
Specify the command to invoke the specified man viewer. The
specified command is evaluated in shell with the man page
- passed as argument. (See linkgit:git-help[1].)
+ passed as an argument. (See linkgit:git-help[1].)
man.<tool>.path::
Override the path for the given tool that may be used to
diff --git a/Documentation/config/merge.txt b/Documentation/config/merge.txt
index 99e83dd..8851b6c 100644
--- a/Documentation/config/merge.txt
+++ b/Documentation/config/merge.txt
@@ -7,7 +7,7 @@ merge.conflictStyle::
marker and the original text before the `=======` marker. The
"merge" style tends to produce smaller conflict regions than diff3,
both because of the exclusion of the original text, and because
- when a subset of lines match on the two sides they are just pulled
+ when a subset of lines match on the two sides, they are just pulled
out of the conflict region. Another alternate style, "zdiff3", is
similar to diff3 but removes matching lines on the two sides from
the conflict region when those matching lines appear near either
diff --git a/Documentation/config/mergetool.txt b/Documentation/config/mergetool.txt
index 90b3809..00bf665 100644
--- a/Documentation/config/mergetool.txt
+++ b/Documentation/config/mergetool.txt
@@ -22,8 +22,8 @@ mergetool.<tool>.trustExitCode::
For a custom merge command, specify whether the exit code of
the merge command can be used to determine whether the merge was
successful. If this is not set to true then the merge target file
- timestamp is checked and the merge assumed to have been successful
- if the file has been updated, otherwise the user is prompted to
+ timestamp is checked, and the merge is assumed to have been successful
+ if the file has been updated; otherwise, the user is prompted to
indicate the success of the merge.
mergetool.meld.hasOutput::
@@ -37,7 +37,7 @@ mergetool.meld.hasOutput::
mergetool.meld.useAutoMerge::
When the `--auto-merge` is given, meld will merge all non-conflicting
- parts automatically, highlight the conflicting parts and wait for
+ parts automatically, highlight the conflicting parts, and wait for
user decision. Setting `mergetool.meld.useAutoMerge` to `true` tells
Git to unconditionally use the `--auto-merge` option with `meld`.
Setting this value to `auto` makes git detect whether `--auto-merge`
@@ -45,21 +45,28 @@ mergetool.meld.useAutoMerge::
value of `false` avoids using `--auto-merge` altogether, and is the
default value.
-mergetool.vimdiff.layout::
- The vimdiff backend uses this variable to control how its split
- windows look like. Applies even if you are using Neovim (`nvim`) or
- gVim (`gvim`) as the merge tool. See BACKEND SPECIFIC HINTS section
+mergetool.<vimdiff variant>.layout::
+ Configure the split window layout for vimdiff's `<variant>`, which is any of `vimdiff`,
+ `nvimdiff`, `gvimdiff`.
+ Upon launching `git mergetool` with `--tool=<variant>` (or without `--tool`
+ if `merge.tool` is configured as `<variant>`), Git will consult
+ `mergetool.<variant>.layout` to determine the tool's layout. If the
+ variant-specific configuration is not available, `vimdiff`'s is used as
+ fallback. If that too is not available, a default layout with 4 windows
+ will be used. To configure the layout, see the `BACKEND SPECIFIC HINTS`
+ifdef::git-mergetool[]
+ section.
+endif::[]
ifndef::git-mergetool[]
- in linkgit:git-mergetool[1].
+ section in linkgit:git-mergetool[1].
endif::[]
- for details.
mergetool.hideResolved::
- During a merge Git will automatically resolve as many conflicts as
+ During a merge, Git will automatically resolve as many conflicts as
possible and write the 'MERGED' file containing conflict markers around
any conflicts that it cannot resolve; 'LOCAL' and 'REMOTE' normally
represent the versions of the file from before Git's conflict
- resolution. This flag causes 'LOCAL' and 'REMOTE' to be overwriten so
+ resolution. This flag causes 'LOCAL' and 'REMOTE' to be overwritten so
that only the unresolved conflicts are presented to the merge tool. Can
be configured per-tool via the `mergetool.<tool>.hideResolved`
configuration variable. Defaults to `false`.
@@ -74,7 +81,7 @@ mergetool.keepTemporaries::
When invoking a custom merge tool, Git uses a set of temporary
files to pass to the tool. If the tool returns an error and this
variable is set to `true`, then these temporary files will be
- preserved, otherwise they will be removed after the tool has
+ preserved; otherwise, they will be removed after the tool has
exited. Defaults to `false`.
mergetool.writeToTemp::
@@ -85,3 +92,10 @@ mergetool.writeToTemp::
mergetool.prompt::
Prompt before each invocation of the merge resolution program.
+
+mergetool.guiDefault::
+ Set `true` to use the `merge.guitool` by default (equivalent to
+ specifying the `--gui` argument), or `auto` to select `merge.guitool`
+ or `merge.tool` depending on the presence of a `DISPLAY` environment
+ variable value. The default is `false`, where the `--gui` argument
+ must be provided explicitly for the `merge.guitool` to be used.
diff --git a/Documentation/config/notes.txt b/Documentation/config/notes.txt
index aeef56d..43db8e8 100644
--- a/Documentation/config/notes.txt
+++ b/Documentation/config/notes.txt
@@ -1,8 +1,11 @@
notes.mergeStrategy::
Which merge strategy to choose by default when resolving notes
conflicts. Must be one of `manual`, `ours`, `theirs`, `union`, or
- `cat_sort_uniq`. Defaults to `manual`. See "NOTES MERGE STRATEGIES"
+ `cat_sort_uniq`. Defaults to `manual`. See the "NOTES MERGE STRATEGIES"
section of linkgit:git-notes[1] for more information on each strategy.
++
+This setting can be overridden by passing the `--strategy` option to
+linkgit:git-notes[1].
notes.<name>.mergeStrategy::
Which merge strategy to choose when doing a notes merge into
@@ -11,28 +14,35 @@ notes.<name>.mergeStrategy::
linkgit:git-notes[1] for more information on the available strategies.
notes.displayRef::
- The (fully qualified) refname from which to show notes when
- showing commit messages. The value of this variable can be set
- to a glob, in which case notes from all matching refs will be
- shown. You may also specify this configuration variable
- several times. A warning will be issued for refs that do not
- exist, but a glob that does not match any refs is silently
- ignored.
+ Which ref (or refs, if a glob or specified more than once), in
+ addition to the default set by `core.notesRef` or
+ `GIT_NOTES_REF`, to read notes from when showing commit
+ messages with the 'git log' family of commands.
+
This setting can be overridden with the `GIT_NOTES_DISPLAY_REF`
environment variable, which must be a colon separated list of refs or
globs.
+
+A warning will be issued for refs that do not exist,
+but a glob that does not match any refs is silently ignored.
++
+This setting can be disabled by the `--no-notes` option to the 'git
+log' family of commands, or by the `--notes=<ref>` option accepted by
+those commands.
++
The effective value of "core.notesRef" (possibly overridden by
GIT_NOTES_REF) is also implicitly added to the list of refs to be
displayed.
notes.rewrite.<command>::
When rewriting commits with <command> (currently `amend` or
- `rebase`) and this variable is set to `true`, Git
- automatically copies your notes from the original to the
- rewritten commit. Defaults to `true`, but see
- "notes.rewriteRef" below.
+ `rebase`), if this variable is `false`, git will not copy
+ notes from the original to the rewritten commit. Defaults to
+ `true`. See also "`notes.rewriteRef`" below.
++
+This setting can be overridden with the `GIT_NOTES_REWRITE_REF`
+environment variable, which must be a colon separated list of refs or
+globs.
notes.rewriteMode::
When copying notes during a rewrite (see the
@@ -46,14 +56,13 @@ environment variable.
notes.rewriteRef::
When copying notes during a rewrite, specifies the (fully
- qualified) ref whose notes should be copied. The ref may be a
- glob, in which case notes in all matching refs will be copied.
- You may also specify this configuration several times.
+ qualified) ref whose notes should be copied. May be a glob,
+ in which case notes in all matching refs will be copied. You
+ may also specify this configuration several times.
+
Does not have a default value; you must configure this variable to
enable note rewriting. Set it to `refs/notes/commits` to enable
rewriting for the default commit notes.
+
-This setting can be overridden with the `GIT_NOTES_REWRITE_REF`
-environment variable, which must be a colon separated list of refs or
-globs.
+Can be overridden with the `GIT_NOTES_REWRITE_REF` environment variable.
+See `notes.rewrite.<command>` above for a further description of its format.
diff --git a/Documentation/config/pack.txt b/Documentation/config/pack.txt
index ad7f73a..da52737 100644
--- a/Documentation/config/pack.txt
+++ b/Documentation/config/pack.txt
@@ -28,11 +28,16 @@ all existing objects. You can force recompression by passing the -F option
to linkgit:git-repack[1].
pack.allowPackReuse::
- When true, and when reachability bitmaps are enabled,
- pack-objects will try to send parts of the bitmapped packfile
- verbatim. This can reduce memory and CPU usage to serve fetches,
- but might result in sending a slightly larger pack. Defaults to
- true.
+ When true or "single", and when reachability bitmaps are
+ enabled, pack-objects will try to send parts of the bitmapped
+ packfile verbatim. When "multi", and when a multi-pack
+ reachability bitmap is available, pack-objects will try to send
+ parts of all packs in the MIDX.
++
+If only a single pack bitmap is available, and `pack.allowPackReuse`
+is set to "multi", reuse parts of just the bitmapped packfile. This
+can reduce memory and CPU usage to serve fetches, but might result in
+sending a slightly larger pack. Defaults to true.
pack.island::
An extended regular expression configuring a set of delta
@@ -74,7 +79,7 @@ pack.threads::
warning. This is meant to reduce packing time on multiprocessor
machines. The required amount of memory for the delta search window
is however multiplied by the number of threads.
- Specifying 0 will cause Git to auto-detect the number of CPU's
+ Specifying 0 will cause Git to auto-detect the number of CPUs
and set the number of threads accordingly.
pack.indexVersion::
@@ -83,11 +88,11 @@ pack.indexVersion::
the new pack index with capabilities for packs larger than 4 GB
as well as proper protection against the repacking of corrupted
packs. Version 2 is the default. Note that version 2 is enforced
- and this config option ignored whenever the corresponding pack is
+ and this config option is ignored whenever the corresponding pack is
larger than 2 GB.
+
If you have an old Git that does not understand the version 2 `*.idx` file,
-cloning or fetching over a non native protocol (e.g. "http")
+cloning or fetching over a non-native protocol (e.g. "http")
that will copy both `*.pack` file and corresponding `*.idx` file from the
other side may give you a repository that cannot be accessed with your
older version of Git. If the `*.pack` file is smaller than 2 GB, however,
@@ -102,8 +107,8 @@ pack.packSizeLimit::
in the creation of multiple packfiles.
+
Note that this option is rarely useful, and may result in a larger total
-on-disk size (because Git will not store deltas between packs), as well
-as worse runtime performance (object lookup within multiple packs is
+on-disk size (because Git will not store deltas between packs) and
+worse runtime performance (object lookup within multiple packs is
slower than a single pack, and optimizations like reachability bitmaps
cannot cope with multiple packs).
+
@@ -123,6 +128,23 @@ pack.useBitmaps::
true. You should not generally need to turn this off unless
you are debugging pack bitmaps.
+pack.useBitmapBoundaryTraversal::
+ When true, Git will use an experimental algorithm for computing
+ reachability queries with bitmaps. Instead of building up
+ complete bitmaps for all of the negated tips and then OR-ing
+ them together, consider negated tips with existing bitmaps as
+ additive (i.e. OR-ing them into the result if they exist,
+ ignoring them otherwise), and build up a bitmap at the boundary
+ instead.
++
+When using this algorithm, Git may include too many objects as a result
+of not opening up trees belonging to certain UNINTERESTING commits. This
+inexactness matches the non-bitmap traversal algorithm.
++
+In many cases, this can provide a speed-up over the exact algorithm,
+particularly when there is poor bitmap coverage of the negated side of
+the query.
+
pack.useSparse::
When true, git will default to using the '--sparse' option in
'git pack-objects' when the '--revs' option is present. This
@@ -164,9 +186,22 @@ When writing a multi-pack reachability bitmap, no new namehashes are
computed; instead, any namehashes stored in an existing bitmap are
permuted into their appropriate location when writing a new bitmap.
+pack.writeBitmapLookupTable::
+ When true, Git will include a "lookup table" section in the
+ bitmap index (if one is written). This table is used to defer
+ loading individual bitmaps as late as possible. This can be
+ beneficial in repositories that have relatively large bitmap
+ indexes. Defaults to false.
+
+pack.readReverseIndex::
+ When true, git will read any .rev file(s) that may be available
+ (see: linkgit:gitformat-pack[5]). When false, the reverse index
+ will be generated from scratch and stored in memory. Defaults to
+ true.
+
pack.writeReverseIndex::
When true, git will write a corresponding .rev file (see:
- link:../technical/pack-format.html[Documentation/technical/pack-format.txt])
+ linkgit:gitformat-pack[5])
for each new packfile that it writes in all places except for
linkgit:git-fast-import[1] and in the bulk checkin mechanism.
- Defaults to false.
+ Defaults to true.
diff --git a/Documentation/config/protocol.txt b/Documentation/config/protocol.txt
index 756591d..a9bf187 100644
--- a/Documentation/config/protocol.txt
+++ b/Documentation/config/protocol.txt
@@ -1,10 +1,10 @@
protocol.allow::
If set, provide a user defined default policy for all protocols which
don't explicitly have a policy (`protocol.<name>.allow`). By default,
- if unset, known-safe protocols (http, https, git, ssh, file) have a
+ if unset, known-safe protocols (http, https, git, ssh) have a
default policy of `always`, known-dangerous protocols (ext) have a
- default policy of `never`, and all other protocols have a default
- policy of `user`. Supported policies:
+ default policy of `never`, and all other protocols (including file)
+ have a default policy of `user`. Supported policies:
+
--
@@ -58,6 +58,6 @@ protocol.version::
* `1` - the original wire protocol with the addition of a version string
in the initial response from the server.
-* `2` - link:technical/protocol-v2.html[wire protocol version 2].
+* `2` - Wire protocol version 2, see linkgit:gitprotocol-v2[5].
--
diff --git a/Documentation/config/push.txt b/Documentation/config/push.txt
index e32801e..0acbbea 100644
--- a/Documentation/config/push.txt
+++ b/Documentation/config/push.txt
@@ -35,7 +35,7 @@ push.default::
* `tracking` - This is a deprecated synonym for `upstream`.
-* `simple` - pushes the current branch with the same name on the remote.
+* `simple` - push the current branch with the same name on the remote.
+
If you are working on a centralized workflow (pushing to the same repository you
pull from, which is typically `origin`), then you need to configure an upstream
@@ -67,7 +67,7 @@ new default).
--
push.followTags::
- If set to true enable `--follow-tags` option by default. You
+ If set to true, enable `--follow-tags` option by default. You
may override this configuration at time of push by specifying
`--no-follow-tags`.
@@ -110,18 +110,8 @@ This will result in only b (a and c are cleared).
----
push.recurseSubmodules::
- Make sure all submodule commits used by the revisions to be pushed
- are available on a remote-tracking branch. If the value is 'check'
- then Git will verify that all submodule commits that changed in the
- revisions to be pushed are available on at least one remote of the
- submodule. If any commits are missing, the push will be aborted and
- exit with non-zero status. If the value is 'on-demand' then all
- submodules that changed in the revisions to be pushed will be
- pushed. If on-demand was not able to push all necessary revisions
- it will also be aborted and exit with non-zero status. If the value
- is 'no' then default behavior of ignoring submodules when pushing
- is retained. You may override this configuration at time of push by
- specifying '--recurse-submodules=check|on-demand|no'.
+ May be "check", "on-demand", "only", or "no", with the same behavior
+ as that of "push --recurse-submodules".
If not set, 'no' is used by default, unless 'submodule.recurse' is
set (in which case a 'true' value means 'on-demand').
@@ -137,3 +127,8 @@ push.negotiate::
server attempt to find commits in common. If "false", Git will
rely solely on the server's ref advertisement to find commits
in common.
+
+push.useBitmaps::
+ If set to "false", disable use of bitmaps for "git push" even if
+ `pack.useBitmaps` is "true", without preventing other git operations
+ from using bitmaps. Default is true.
diff --git a/Documentation/config/rebase.txt b/Documentation/config/rebase.txt
index 8c979cb..c6187ab 100644
--- a/Documentation/config/rebase.txt
+++ b/Documentation/config/rebase.txt
@@ -9,7 +9,9 @@ rebase.stat::
rebase. False by default.
rebase.autoSquash::
- If set to true enable `--autosquash` option by default.
+ If set to true, enable the `--autosquash` option of
+ linkgit:git-rebase[1] by default for interactive mode.
+ This can be overridden with the `--no-autosquash` option.
rebase.autoStash::
When set to true, automatically create a temporary stash entry
@@ -21,6 +23,9 @@ rebase.autoStash::
`--autostash` options of linkgit:git-rebase[1].
Defaults to false.
+rebase.updateRefs::
+ If set to true enable `--update-refs` option by default.
+
rebase.missingCommitsCheck::
If set to "warn", git rebase -i will print a warning if some
commits are removed (e.g. a line was deleted), however the
@@ -35,7 +40,7 @@ rebase.missingCommitsCheck::
rebase.instructionFormat::
A format string, as specified in linkgit:git-log[1], to be used for the
todo list during an interactive rebase. The format will
- automatically have the long commit hash prepended to the format.
+ automatically have the commit hash prepended to the format.
rebase.abbreviateCommands::
If set to true, `git rebase` will use abbreviated command names in the
@@ -64,3 +69,19 @@ rebase.rescheduleFailedExec::
rebase.forkPoint::
If set to false set `--no-fork-point` option by default.
+
+rebase.rebaseMerges::
+ Whether and how to set the `--rebase-merges` option by default. Can
+ be `rebase-cousins`, `no-rebase-cousins`, or a boolean. Setting to
+ true or to `no-rebase-cousins` is equivalent to
+ `--rebase-merges=no-rebase-cousins`, setting to `rebase-cousins` is
+ equivalent to `--rebase-merges=rebase-cousins`, and setting to false is
+ equivalent to `--no-rebase-merges`. Passing `--rebase-merges` on the
+ command line, with or without an argument, overrides any
+ `rebase.rebaseMerges` configuration.
+
+rebase.maxLabelLength::
+ When generating label names from commit subjects, truncate the names to
+ this length. By default, the names are truncated to a little less than
+ `NAME_MAX` (to allow e.g. `.lock` files to be written for the
+ corresponding loose refs).
diff --git a/Documentation/config/receive.txt b/Documentation/config/receive.txt
index 85d5b5a..c77e55b 100644
--- a/Documentation/config/receive.txt
+++ b/Documentation/config/receive.txt
@@ -14,12 +14,12 @@ receive.autogc::
receive.certNonceSeed::
By setting this variable to a string, `git receive-pack`
- will accept a `git push --signed` and verifies it by using
+ will accept a `git push --signed` and verify it by using
a "nonce" protected by HMAC using this string as a secret
key.
receive.certNonceSlop::
- When a `git push --signed` sent a push certificate with a
+ When a `git push --signed` sends a push certificate with a
"nonce" that was issued by a receive-pack serving the same
repository within this many seconds, export the "nonce"
found in the certificate to `GIT_PUSH_CERT_NONCE` to the
diff --git a/Documentation/config/rerere.txt b/Documentation/config/rerere.txt
index 40abdf6..3a78b5e 100644
--- a/Documentation/config/rerere.txt
+++ b/Documentation/config/rerere.txt
@@ -1,7 +1,7 @@
rerere.autoUpdate::
When set to true, `git-rerere` updates the index with the
resulting contents after it cleanly resolves conflicts using
- previously recorded resolution. Defaults to false.
+ previously recorded resolutions. Defaults to false.
rerere.enabled::
Activate recording of resolved conflicts, so that identical
diff --git a/Documentation/config/safe.txt b/Documentation/config/safe.txt
index fa02f3c..577df40 100644
--- a/Documentation/config/safe.txt
+++ b/Documentation/config/safe.txt
@@ -1,3 +1,22 @@
+safe.bareRepository::
+ Specifies which bare repositories Git will work with. The currently
+ supported values are:
++
+* `all`: Git works with all bare repositories. This is the default.
+* `explicit`: Git only works with bare repositories specified via
+ the top-level `--git-dir` command-line option, or the `GIT_DIR`
+ environment variable (see linkgit:git[1]).
++
+If you do not use bare repositories in your workflow, then it may be
+beneficial to set `safe.bareRepository` to `explicit` in your global
+config. This will protect you from attacks that involve cloning a
+repository that contains a bare repository and running a Git command
+within that directory.
++
+This config setting is only respected in protected configuration (see
+<<SCOPES>>). This prevents untrusted repositories from tampering with
+this value.
+
safe.directory::
These config entries specify Git-tracked directories that are
considered safe even if they are owned by someone other than the
@@ -12,9 +31,9 @@ via `git config --add`. To reset the list of safe directories (e.g. to
override any such directories specified in the system config), add a
`safe.directory` entry with an empty value.
+
-This config setting is only respected when specified in a system or global
-config, not when it is specified in a repository config, via the command
-line option `-c safe.directory=<path>`, or in environment variables.
+This config setting is only respected in protected configuration (see
+<<SCOPES>>). This prevents untrusted repositories from tampering with this
+value.
+
The value of this setting is interpolated, i.e. `~/<path>` expands to a
path relative to the home directory and `%(prefix)/<path>` expands to a
diff --git a/Documentation/config/sendemail.txt b/Documentation/config/sendemail.txt
index 50baa5d..6a869d6 100644
--- a/Documentation/config/sendemail.txt
+++ b/Documentation/config/sendemail.txt
@@ -8,7 +8,7 @@ sendemail.smtpEncryption::
See linkgit:git-send-email[1] for description. Note that this
setting is not subject to the 'identity' mechanism.
-sendemail.smtpsslcertpath::
+sendemail.smtpSSLCertPath::
Path to ca-certificates (either a directory or a single file).
Set it to an empty string to disable certificate verification.
@@ -18,23 +18,56 @@ sendemail.<identity>.*::
identity is selected, through either the command-line or
`sendemail.identity`.
+sendemail.multiEdit::
+ If true (default), a single editor instance will be spawned to edit
+ files you have to edit (patches when `--annotate` is used, and the
+ summary when `--compose` is used). If false, files will be edited one
+ after the other, spawning a new editor each time.
+
+sendemail.confirm::
+ Sets the default for whether to confirm before sending. Must be
+ one of 'always', 'never', 'cc', 'compose', or 'auto'. See `--confirm`
+ in the linkgit:git-send-email[1] documentation for the meaning of these
+ values.
+
sendemail.aliasesFile::
+ To avoid typing long email addresses, point this to one or more
+ email aliases files. You must also supply `sendemail.aliasFileType`.
+
sendemail.aliasFileType::
+ Format of the file(s) specified in sendemail.aliasesFile. Must be
+ one of 'mutt', 'mailrc', 'pine', 'elm', 'gnus', or 'sendmail'.
++
+What an alias file in each format looks like can be found in
+the documentation of the email program of the same name. The
+differences and limitations from the standard formats are
+described below:
++
+--
+sendmail;;
+* Quoted aliases and quoted addresses are not supported: lines that
+ contain a `"` symbol are ignored.
+* Redirection to a file (`/path/name`) or pipe (`|command`) is not
+ supported.
+* File inclusion (`:include: /path/name`) is not supported.
+* Warnings are printed on the standard error output for any
+ explicitly unsupported constructs, and any other lines that are not
+ recognized by the parser.
+--
sendemail.annotate::
sendemail.bcc::
sendemail.cc::
sendemail.ccCmd::
sendemail.chainReplyTo::
-sendemail.confirm::
sendemail.envelopeSender::
sendemail.from::
-sendemail.multiEdit::
-sendemail.signedoffbycc::
+sendemail.headerCmd::
+sendemail.signedOffByCc::
sendemail.smtpPass::
-sendemail.suppresscc::
+sendemail.suppressCc::
sendemail.suppressFrom::
sendemail.to::
-sendemail.tocmd::
+sendemail.toCmd::
sendemail.smtpDomain::
sendemail.smtpServer::
sendemail.smtpServerPort::
@@ -44,10 +77,12 @@ sendemail.thread::
sendemail.transferEncoding::
sendemail.validate::
sendemail.xmailer::
- See linkgit:git-send-email[1] for description.
+ These configuration variables all provide a default for
+ linkgit:git-send-email[1] command-line options. See its
+ documentation for details.
-sendemail.signedoffcc (deprecated)::
- Deprecated alias for `sendemail.signedoffbycc`.
+sendemail.signedOffCc (deprecated)::
+ Deprecated alias for `sendemail.signedOffByCc`.
sendemail.smtpBatchSize::
Number of messages to be sent per connection, after that a relogin
@@ -56,7 +91,7 @@ sendemail.smtpBatchSize::
See also the `--batch-size` option of linkgit:git-send-email[1].
sendemail.smtpReloginDelay::
- Seconds wait before reconnecting to smtp server.
+ Seconds to wait before reconnecting to the smtp server.
See also the `--relogin-delay` option of linkgit:git-send-email[1].
sendemail.forbidSendmailVariables::
diff --git a/Documentation/config/sequencer.txt b/Documentation/config/sequencer.txt
index b48d532..e664eef 100644
--- a/Documentation/config/sequencer.txt
+++ b/Documentation/config/sequencer.txt
@@ -2,4 +2,4 @@ sequence.editor::
Text editor used by `git rebase -i` for editing the rebase instruction file.
The value is meant to be interpreted by the shell when it is used.
It can be overridden by the `GIT_SEQUENCE_EDITOR` environment variable.
- When not configured the default commit message editor is used instead.
+ When not configured, the default commit message editor is used instead.
diff --git a/Documentation/config/splitindex.txt b/Documentation/config/splitindex.txt
index afdb186..cfaa296 100644
--- a/Documentation/config/splitindex.txt
+++ b/Documentation/config/splitindex.txt
@@ -3,10 +3,10 @@ splitIndex.maxPercentChange::
percent of entries the split index can contain compared to the
total number of entries in both the split index and the shared
index before a new shared index is written.
- The value should be between 0 and 100. If the value is 0 then
- a new shared index is always written, if it is 100 a new
+ The value should be between 0 and 100. If the value is 0, then
+ a new shared index is always written; if it is 100, a new
shared index is never written.
- By default the value is 20, so a new shared index is written
+ By default, the value is 20, so a new shared index is written
if the number of entries in the split index would be greater
than 20 percent of the total number of entries.
See linkgit:git-update-index[1].
diff --git a/Documentation/config/stash.txt b/Documentation/config/stash.txt
index b9f609e..ec1edae 100644
--- a/Documentation/config/stash.txt
+++ b/Documentation/config/stash.txt
@@ -1,14 +1,14 @@
stash.showIncludeUntracked::
If this is set to true, the `git stash show` command will show
the untracked files of a stash entry. Defaults to false. See
- description of 'show' command in linkgit:git-stash[1].
+ the description of the 'show' command in linkgit:git-stash[1].
stash.showPatch::
If this is set to true, the `git stash show` command without an
option will show the stash entry in patch form. Defaults to false.
- See description of 'show' command in linkgit:git-stash[1].
+ See the description of the 'show' command in linkgit:git-stash[1].
stash.showStat::
If this is set to true, the `git stash show` command without an
- option will show diffstat of the stash entry. Defaults to true.
- See description of 'show' command in linkgit:git-stash[1].
+ option will show a diffstat of the stash entry. Defaults to true.
+ See the description of the 'show' command in linkgit:git-stash[1].
diff --git a/Documentation/config/status.txt b/Documentation/config/status.txt
index 0fc704a..8caf90f 100644
--- a/Documentation/config/status.txt
+++ b/Documentation/config/status.txt
@@ -47,7 +47,7 @@ status.showUntrackedFiles::
contain only untracked files, are shown with the directory name
only. Showing untracked files means that Git needs to lstat() all
the files in the whole repository, which might be slow on some
- systems. So, this variable controls how the commands displays
+ systems. So, this variable controls how the commands display
the untracked files. Possible values are:
+
--
@@ -57,12 +57,14 @@ status.showUntrackedFiles::
--
+
If this variable is not specified, it defaults to 'normal'.
+All usual spellings for Boolean value `true` are taken as `normal`
+and `false` as `no`.
This variable can be overridden with the -u|--untracked-files option
of linkgit:git-status[1] and linkgit:git-commit[1].
status.submoduleSummary::
Defaults to false.
- If this is set to a non zero number or true (identical to -1 or an
+ If this is set to a non-zero number or true (identical to -1 or an
unlimited number), the submodule summary will be enabled and a
summary of commits for modified submodules will be shown (see
--summary-limit option of linkgit:git-submodule[1]). Please note
diff --git a/Documentation/config/submodule.txt b/Documentation/config/submodule.txt
index 6490527..0672d99 100644
--- a/Documentation/config/submodule.txt
+++ b/Documentation/config/submodule.txt
@@ -2,7 +2,7 @@ submodule.<name>.url::
The URL for a submodule. This variable is copied from the .gitmodules
file to the git config via 'git submodule init'. The user can change
the configured URL before obtaining the submodule via 'git submodule
- update'. If neither submodule.<name>.active or submodule.active are
+ update'. If neither submodule.<name>.active nor submodule.active are
set, the presence of this variable is used as a fallback to indicate
whether the submodule is of interest to git commands.
See linkgit:git-submodule[1] and linkgit:gitmodules[5] for details.
@@ -35,7 +35,7 @@ submodule.<name>.ignore::
a submodule as modified. When set to "all", it will never be considered
modified (but it will nonetheless show up in the output of status and
commit when it has been staged), "dirty" will ignore all changes
- to the submodules work tree and
+ to the submodule's work tree and
takes only differences between the HEAD of the submodule and the commit
recorded in the superproject into account. "untracked" will additionally
let submodules with modified tracked files in their work tree show up.
diff --git a/Documentation/config/trace2.txt b/Documentation/config/trace2.txt
index fe1642f..3b6bca2 100644
--- a/Documentation/config/trace2.txt
+++ b/Documentation/config/trace2.txt
@@ -66,6 +66,6 @@ trace2.destinationDebug::
trace2.maxFiles::
Integer. When writing trace files to a target directory, do not
- write additional traces if we would exceed this many files. Instead,
+ write additional traces if doing so would exceed this many files. Instead,
write a sentinel file that will block further tracing to this
directory. Defaults to 0, which disables this check.
diff --git a/Documentation/config/transfer.txt b/Documentation/config/transfer.txt
index 7ed917f..f1ce50f 100644
--- a/Documentation/config/transfer.txt
+++ b/Documentation/config/transfer.txt
@@ -7,13 +7,13 @@ transfer.credentialsInUrl::
and any other direct use of the configured URL.
+
Note that this is currently limited to detecting credentials in
-`remote.<name>.url` configuration, it won't detect credentials in
+`remote.<name>.url` configuration; it won't detect credentials in
`remote.<name>.pushurl` configuration.
+
You might want to enable this to prevent inadvertent credentials
exposure, e.g. because:
+
-* The OS or system where you're running git may not provide way way or
+* The OS or system where you're running git may not provide a way or
otherwise allow you to configure the permissions of the
configuration file where the username and/or password are stored.
* Even if it does, having such data stored "at rest" might expose you
@@ -21,12 +21,12 @@ exposure, e.g. because:
system.
* The git programs will pass the full URL to one another as arguments
on the command-line, meaning the credentials will be exposed to other
- users on OS's or systems that allow other users to see the full
+ unprivileged users on systems that allow them to see the full
process list of other users. On linux the "hidepid" setting
documented in procfs(5) allows for configuring this behavior.
+
If such concerns don't apply to you then you probably don't need to be
-concerned about credentials exposure due to storing that sensitive
+concerned about credentials exposure due to storing sensitive
data in git's configuration files. If you do want to use this, set
`transfer.credentialsInUrl` to one of these values:
+
@@ -115,3 +115,13 @@ transfer.unpackLimit::
transfer.advertiseSID::
Boolean. When true, client and server processes will advertise their
unique session IDs to their remote counterpart. Defaults to false.
+
+transfer.bundleURI::
+ When `true`, local `git clone` commands will request bundle
+ information from the remote server (if advertised) and download
+ bundles before continuing the clone through the Git protocol.
+ Defaults to `false`.
+
+transfer.advertiseObjectInfo::
+ When `true`, the `object-info` capability is advertised by
+ servers. Defaults to false.
diff --git a/Documentation/config/uploadpack.txt b/Documentation/config/uploadpack.txt
index 32fad5b..16264d8 100644
--- a/Documentation/config/uploadpack.txt
+++ b/Documentation/config/uploadpack.txt
@@ -49,9 +49,9 @@ uploadpack.packObjectsHook::
`pack-objects` to the hook, and expects a completed packfile on
stdout.
+
-Note that this configuration variable is ignored if it is seen in the
-repository-level config (this is a safety measure against fetching from
-untrusted repositories).
+Note that this configuration variable is only respected when it is specified
+in protected configuration (see <<SCOPES>>). This is a safety measure
+against fetching from untrusted repositories.
uploadpack.allowFilter::
If this option is set, `upload-pack` will support partial
diff --git a/Documentation/config/user.txt b/Documentation/config/user.txt
index ec9233b..2ffc38d 100644
--- a/Documentation/config/user.txt
+++ b/Documentation/config/user.txt
@@ -5,14 +5,14 @@ author.email::
committer.name::
committer.email::
The `user.name` and `user.email` variables determine what ends
- up in the `author` and `committer` field of commit
+ up in the `author` and `committer` fields of commit
objects.
If you need the `author` or `committer` to be different, the
- `author.name`, `author.email`, `committer.name` or
+ `author.name`, `author.email`, `committer.name`, or
`committer.email` variables can be set.
- Also, all of these can be overridden by the `GIT_AUTHOR_NAME`,
+ All of these can be overridden by the `GIT_AUTHOR_NAME`,
`GIT_AUTHOR_EMAIL`, `GIT_COMMITTER_NAME`,
- `GIT_COMMITTER_EMAIL` and `EMAIL` environment variables.
+ `GIT_COMMITTER_EMAIL`, and `EMAIL` environment variables.
+
Note that the `name` forms of these variables conventionally refer to
some form of a personal name. See linkgit:git-commit[1] and the
@@ -40,7 +40,7 @@ user.signingKey::
your private ssh key or the public key when ssh-agent is used.
Alternatively it can contain a public key prefixed with `key::`
directly (e.g.: "key::ssh-rsa XXXXXX identifier"). The private key
- needs to be available via ssh-agent. If not set git will call
+ needs to be available via ssh-agent. If not set Git will call
gpg.ssh.defaultKeyCommand (e.g.: "ssh-add -L") and try to use the
first key available. For backward compatibility, a raw key which
begins with "ssh-", such as "ssh-rsa XXXXXX identifier", is treated
diff --git a/Documentation/config/versionsort.txt b/Documentation/config/versionsort.txt
index 6c7cc05..0cff090 100644
--- a/Documentation/config/versionsort.txt
+++ b/Documentation/config/versionsort.txt
@@ -19,14 +19,14 @@ with those suffixes. E.g. if "-pre" appears before "-rc" in the
configuration, then all "1.0-preX" tags will be listed before any
"1.0-rcX" tags. The placement of the main release tag relative to tags
with various suffixes can be determined by specifying the empty suffix
-among those other suffixes. E.g. if the suffixes "-rc", "", "-ck" and
+among those other suffixes. E.g. if the suffixes "-rc", "", "-ck", and
"-bfs" appear in the configuration in this order, then all "v4.8-rcX" tags
are listed first, followed by "v4.8", then "v4.8-ckX" and finally
"v4.8-bfsX".
+
-If more than one suffixes match the same tagname, then that tagname will
+If more than one suffix matches the same tagname, then that tagname will
be sorted according to the suffix which starts at the earliest position in
-the tagname. If more than one different matching suffixes start at
+the tagname. If more than one different matching suffix starts at
that earliest position, then that tagname will be sorted according to the
longest of those suffixes.
The sorting order between different suffixes is undefined if they are
diff --git a/Documentation/diff-generate-patch.txt b/Documentation/diff-generate-patch.txt
index c78063d..4b5aa5c 100644
--- a/Documentation/diff-generate-patch.txt
+++ b/Documentation/diff-generate-patch.txt
@@ -1,3 +1,4 @@
+[[generate_patch_text_with_p]]
Generating patch text with -p
-----------------------------
@@ -16,7 +17,7 @@ You can customize the creation of patch text via the
What the -p option produces is slightly different from the traditional
diff format:
-1. It is preceded with a "git diff" header that looks like this:
+1. It is preceded by a "git diff" header that looks like this:
diff --git a/file1 b/file2
+
@@ -24,9 +25,9 @@ The `a/` and `b/` filenames are the same unless rename/copy is
involved. Especially, even for a creation or a deletion,
`/dev/null` is _not_ used in place of the `a/` or `b/` filenames.
+
-When rename/copy is involved, `file1` and `file2` show the
+When a rename/copy is involved, `file1` and `file2` show the
name of the source file of the rename/copy and the name of
-the file that rename/copy produces, respectively.
+the file that the rename/copy produces, respectively.
2. It is followed by one or more extended header lines:
@@ -76,7 +77,7 @@ separate lines indicate the old and the new mode.
5. Hunk headers mention the name of the function to which the hunk
applies. See "Defining a custom hunk-header" in
- linkgit:gitattributes[5] for details of how to tailor to this to
+ linkgit:gitattributes[5] for details of how to tailor this to
specific languages.
@@ -88,7 +89,7 @@ produce a 'combined diff' when showing a merge. This is the default
format when showing merges with linkgit:git-diff[1] or
linkgit:git-show[1]. Note also that you can give suitable
`--diff-merges` option to any of these commands to force generation of
-diffs in specific format.
+diffs in a specific format.
A "combined diff" format looks like this:
@@ -122,7 +123,7 @@ index fabadb8,cc95eb0..4866510
for_each_ref(get_name);
------------
-1. It is preceded with a "git diff" header, that looks like
+1. It is preceded by a "git diff" header, that looks like
this (when the `-c` option is used):
diff --combined file
@@ -141,22 +142,22 @@ or like this (when the `--cc` option is used):
+
The `mode <mode>,<mode>..<mode>` line appears only if at least one of
the <mode> is different from the rest. Extended headers with
-information about detected contents movement (renames and
-copying detection) are designed to work with diff of two
+information about detected content movement (renames and
+copying detection) are designed to work with the diff of two
<tree-ish> and are not used by combined diff format.
-3. It is followed by two-line from-file/to-file header
+3. It is followed by a two-line from-file/to-file header:
--- a/file
+++ b/file
+
-Similar to two-line header for traditional 'unified' diff
+Similar to the two-line header for the traditional 'unified' diff
format, `/dev/null` is used to signal created or deleted
files.
+
However, if the --combined-all-paths option is provided, instead of a
-two-line from-file/to-file you get a N+1 line from-file/to-file header,
-where N is the number of parents in the merge commit
+two-line from-file/to-file, you get an N+1 line from-file/to-file header,
+where N is the number of parents in the merge commit:
--- a/file
--- a/file
@@ -196,7 +197,7 @@ added, from the point of view of that parent).
In the above example output, the function signature was changed
from both files (hence two `-` removals from both file1 and
file2, plus `++` to mean one line that was added does not appear
-in either file1 or file2). Also eight other lines are the same
+in either file1 or file2). Also, eight other lines are the same
from file1 but do not appear in file2 (hence prefixed with `+`).
When shown by `git diff-tree -c`, it compares the parents of a
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 3674ac4..0e94569 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -22,78 +22,94 @@ ifndef::git-format-patch[]
-p::
-u::
--patch::
- Generate patch (see section on generating patches).
+ Generate patch (see <<generate_patch_text_with_p>>).
ifdef::git-diff[]
This is the default.
endif::git-diff[]
-s::
--no-patch::
- Suppress diff output. Useful for commands like `git show` that
- show the patch by default, or to cancel the effect of `--patch`.
+ Suppress all output from the diff machinery. Useful for
+ commands like `git show` that show the patch by default to
+ squelch their output, or to cancel the effect of options like
+ `--patch`, `--stat` earlier on the command line in an alias.
+
endif::git-format-patch[]
ifdef::git-log[]
---diff-merges=(off|none|on|first-parent|1|separate|m|combined|c|dense-combined|cc|remerge|r)::
+-m::
+ Show diffs for merge commits in the default format. This is
+ similar to '--diff-merges=on', except `-m` will
+ produce no output unless `-p` is given as well.
+
+-c::
+ Produce combined diff output for merge commits.
+ Shortcut for '--diff-merges=combined -p'.
+
+--cc::
+ Produce dense combined diff output for merge commits.
+ Shortcut for '--diff-merges=dense-combined -p'.
+
+--dd::
+ Produce diff with respect to first parent for both merge and
+ regular commits.
+ Shortcut for '--diff-merges=first-parent -p'.
+
+--remerge-diff::
+ Produce remerge-diff output for merge commits.
+ Shortcut for '--diff-merges=remerge -p'.
+
--no-diff-merges::
+ Synonym for '--diff-merges=off'.
+
+--diff-merges=<format>::
Specify diff format to be used for merge commits. Default is
- {diff-merges-default} unless `--first-parent` is in use, in which case
- `first-parent` is the default.
+ {diff-merges-default} unless `--first-parent` is in use, in
+ which case `first-parent` is the default.
+
---diff-merges=(off|none):::
---no-diff-merges:::
+The following formats are supported:
++
+--
+off, none::
Disable output of diffs for merge commits. Useful to override
implied value.
+
---diff-merges=on:::
---diff-merges=m:::
--m:::
- This option makes diff output for merge commits to be shown in
- the default format. `-m` will produce the output only if `-p`
- is given as well. The default format could be changed using
- `log.diffMerges` configuration parameter, which default value
+on, m::
+ Make diff output for merge commits to be shown in the default
+ format. The default format can be changed using
+ `log.diffMerges` configuration variable, whose default value
is `separate`.
+
---diff-merges=first-parent:::
---diff-merges=1:::
- This option makes merge commits show the full diff with
- respect to the first parent only.
+first-parent, 1::
+ Show full diff with respect to first parent. This is the same
+ format as `--patch` produces for non-merge commits.
++
+separate::
+ Show full diff with respect to each of parents.
+ Separate log entry and diff is generated for each parent.
++
+combined, c::
+ Show differences from each of the parents to the merge
+ result simultaneously instead of showing pairwise diff between
+ a parent and the result one at a time. Furthermore, it lists
+ only files which were modified from all parents.
+
---diff-merges=separate:::
- This makes merge commits show the full diff with respect to
- each of the parents. Separate log entry and diff is generated
- for each parent.
+dense-combined, cc::
+ Further compress output produced by `--diff-merges=combined`
+ by omitting uninteresting hunks whose contents in the parents
+ have only two variants and the merge result picks one of them
+ without modification.
+
---diff-merges=remerge:::
---diff-merges=r:::
---remerge-diff:::
- With this option, two-parent merge commits are remerged to
- create a temporary tree object -- potentially containing files
- with conflict markers and such. A diff is then shown between
- that temporary tree and the actual merge commit.
+remerge, r::
+ Remerge two-parent merge commits to create a temporary tree
+ object--potentially containing files with conflict markers
+ and such. A diff is then shown between that temporary tree
+ and the actual merge commit.
+
The output emitted when this option is used is subject to change, and
so is its interaction with other options (unless explicitly
documented).
-+
---diff-merges=combined:::
---diff-merges=c:::
--c:::
- With this option, diff output for a merge commit shows the
- differences from each of the parents to the merge result
- simultaneously instead of showing pairwise diff between a
- parent and the result one at a time. Furthermore, it lists
- only files which were modified from all parents. `-c` implies
- `-p`.
-+
---diff-merges=dense-combined:::
---diff-merges=cc:::
---cc:::
- With this option the output produced by
- `--diff-merges=combined` is further compressed by omitting
- uninteresting hunks whose contents in the parents have only
- two variants and the merge result picks one of them without
- modification. `--cc` implies `-p`.
+--
--combined-all-paths::
This flag causes combined diffs (used for merge commits) to
@@ -201,14 +217,15 @@ have to use `--diff-algorithm=default` option.
part. Maximum width defaults to terminal width, or 80 columns
if not connected to a terminal, and can be overridden by
`<width>`. The width of the filename part can be limited by
- giving another width `<name-width>` after a comma. The width
- of the graph part can be limited by using
- `--stat-graph-width=<width>` (affects all commands generating
- a stat graph) or by setting `diff.statGraphWidth=<width>`
- (does not affect `git format-patch`).
- By giving a third parameter `<count>`, you can limit the
- output to the first `<count>` lines, followed by `...` if
- there are more.
+ giving another width `<name-width>` after a comma or by setting
+ `diff.statNameWidth=<width>`. The width of the graph part can be
+ limited by using `--stat-graph-width=<width>` or by setting
+ `diff.statGraphWidth=<width>`. Using `--stat` or
+ `--stat-graph-width` affects all commands generating a stat graph,
+ while setting `diff.statNameWidth` or `diff.statGraphWidth`
+ does not affect `git format-patch`.
+ By giving a third parameter `<count>`, you can limit the output to
+ the first `<count>` lines, followed by `...` if there are more.
+
These parameters can also be set individually with `--stat-width=<width>`,
`--stat-name-width=<name-width>` and `--stat-count=<count>`.
@@ -282,7 +299,7 @@ and accumulating child directory counts in the parent directories:
Synonym for --dirstat=cumulative
--dirstat-by-file[=<param1,param2>...]::
- Synonym for --dirstat=files,param1,param2...
+ Synonym for --dirstat=files,<param1>,<param2>...
--summary::
Output a condensed summary of extended header information
@@ -297,7 +314,7 @@ ifndef::git-format-patch[]
-z::
ifdef::git-log[]
- Separate the commits with NULs instead of with new newlines.
+ Separate the commits with NULs instead of newlines.
+
Also, when `--raw` or `--numstat` has been given, do not munge
pathnames and use NULs as output field terminators.
@@ -729,7 +746,7 @@ matches "`fooasdfbar`" and "`foo/bar/baz/asdf`" but not "`foobarx`".
--rotate-to=<file>::
Discard the files before the named <file> from the output
(i.e. 'skip to'), or move them to the end of the output
- (i.e. 'rotate to'). These were invented primarily for use
+ (i.e. 'rotate to'). These options were invented primarily for the use
of the `git difftool` command, and may not be very useful
otherwise.
@@ -846,6 +863,12 @@ endif::git-format-patch[]
--no-prefix::
Do not show any source or destination prefix.
+--default-prefix::
+ Use the default source and destination prefixes ("a/" and "b/").
+ This overrides configuration variables such as `diff.noprefix`,
+ `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`
+ (see `git-config`(1)).
+
--line-prefix=<prefix>::
Prepend an additional prefix to every line of output.
diff --git a/Documentation/doc-diff b/Documentation/doc-diff
index 1694300..fb09e0a 100755
--- a/Documentation/doc-diff
+++ b/Documentation/doc-diff
@@ -153,7 +153,7 @@ render_tree () {
make -j$parallel -C "$tmp/worktree" \
$makemanflags \
GIT_VERSION=omitted \
- SOURCE_DATE_EPOCH=0 \
+ GIT_DATE=1970-01-01 \
DESTDIR="$tmp/installed/$dname+" \
install-man &&
mv "$tmp/installed/$dname+" "$tmp/installed/$dname"
diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt
index 622bd84..e22b217 100644
--- a/Documentation/fetch-options.txt
+++ b/Documentation/fetch-options.txt
@@ -1,5 +1,6 @@
---all::
- Fetch all remotes.
+--[no-]all::
+ Fetch all remotes. This overrides the configuration variable
+ `fetch.all`.
-a::
--append::
@@ -43,7 +44,7 @@ the current repository has the same history as the source repository.
--update-shallow::
By default when fetching from a shallow repository,
`git fetch` refuses refs that require updating
- .git/shallow. This option updates .git/shallow and accept such
+ .git/shallow. This option updates .git/shallow and accepts such
refs.
--negotiation-tip=<commit|glob>::
@@ -78,6 +79,13 @@ linkgit:git-config[1].
--dry-run::
Show what would be done, without making any changes.
+--porcelain::
+ Print the output to standard output in an easy-to-parse format for
+ scripts. See section OUTPUT in linkgit:git-fetch[1] for details.
++
+This is incompatible with `--recurse-submodules=[yes|on-demand]` and takes
+precedence over the `fetch.output` config option.
+
ifndef::git-pull[]
--[no-]write-fetch-head::
Write the list of remote refs fetched in the `FETCH_HEAD`
@@ -89,7 +97,7 @@ endif::git-pull[]
-f::
--force::
- When 'git fetch' is used with `<src>:<dst>` refspec it may
+ When 'git fetch' is used with `<src>:<dst>` refspec, it may
refuse to update the local branch as discussed
ifdef::git-pull[]
in the `<refspec>` part of the linkgit:git-fetch[1]
@@ -194,7 +202,7 @@ endif::git-pull[]
destination of an explicit refspec; see `--prune`).
ifndef::git-pull[]
---recurse-submodules[=yes|on-demand|no]::
+--recurse-submodules[=(yes|on-demand|no)]::
This option controls if and under what conditions new commits of
submodules should be fetched too. When recursing through submodules,
`git fetch` always attempts to fetch "changed" submodules, that is, a
diff --git a/Documentation/fsck-msgids.txt b/Documentation/fsck-msgids.txt
new file mode 100644
index 0000000..f643585
--- /dev/null
+++ b/Documentation/fsck-msgids.txt
@@ -0,0 +1,180 @@
+`badDate`::
+ (ERROR) Invalid date format in an author/committer line.
+
+`badDateOverflow`::
+ (ERROR) Invalid date value in an author/committer line.
+
+`badEmail`::
+ (ERROR) Invalid email format in an author/committer line.
+
+`badFilemode`::
+ (INFO) A tree contains a bad filemode entry.
+
+`badName`::
+ (ERROR) An author/committer name is empty.
+
+`badObjectSha1`::
+ (ERROR) An object has a bad sha1.
+
+`badParentSha1`::
+ (ERROR) A commit object has a bad parent sha1.
+
+`badTagName`::
+ (INFO) A tag has an invalid format.
+
+`badTimezone`::
+ (ERROR) Found an invalid time zone in an author/committer line.
+
+`badTree`::
+ (ERROR) A tree cannot be parsed.
+
+`badTreeSha1`::
+ (ERROR) A tree has an invalid format.
+
+`badType`::
+ (ERROR) Found an invalid object type.
+
+`duplicateEntries`::
+ (ERROR) A tree contains duplicate file entries.
+
+`emptyName`::
+ (WARN) A path contains an empty name.
+
+`extraHeaderEntry`::
+ (IGNORE) Extra headers found after `tagger`.
+
+`fullPathname`::
+ (WARN) A path contains the full path starting with "/".
+
+`gitattributesBlob`::
+ (ERROR) A non-blob found at `.gitattributes`.
+
+`gitattributesLarge`::
+ (ERROR) The `.gitattributes` blob is too large.
+
+`gitattributesLineLength`::
+ (ERROR) The `.gitattributes` blob contains too long lines.
+
+`gitattributesMissing`::
+ (ERROR) Unable to read `.gitattributes` blob.
+
+`gitattributesSymlink`::
+ (INFO) `.gitattributes` is a symlink.
+
+`gitignoreSymlink`::
+ (INFO) `.gitignore` is a symlink.
+
+`gitmodulesBlob`::
+ (ERROR) A non-blob found at `.gitmodules`.
+
+`gitmodulesLarge`::
+ (ERROR) The `.gitmodules` file is too large to parse.
+
+`gitmodulesMissing`::
+ (ERROR) Unable to read `.gitmodules` blob.
+
+`gitmodulesName`::
+ (ERROR) A submodule name is invalid.
+
+`gitmodulesParse`::
+ (INFO) Could not parse `.gitmodules` blob.
+
+`gitmodulesLarge`;
+ (ERROR) `.gitmodules` blob is too large to parse.
+
+`gitmodulesPath`::
+ (ERROR) `.gitmodules` path is invalid.
+
+`gitmodulesSymlink`::
+ (ERROR) `.gitmodules` is a symlink.
+
+`gitmodulesUpdate`::
+ (ERROR) Found an invalid submodule update setting.
+
+`gitmodulesUrl`::
+ (ERROR) Found an invalid submodule url.
+
+`hasDot`::
+ (WARN) A tree contains an entry named `.`.
+
+`hasDotdot`::
+ (WARN) A tree contains an entry named `..`.
+
+`hasDotgit`::
+ (WARN) A tree contains an entry named `.git`.
+
+`largePathname`::
+ (WARN) A tree contains an entry with a very long path name. If
+ the value of `fsck.largePathname` contains a colon, that value
+ is used as the maximum allowable length (e.g., "warn:10" would
+ complain about any path component of 11 or more bytes). The
+ default value is 4096.
+
+`mailmapSymlink`::
+ (INFO) `.mailmap` is a symlink.
+
+`missingAuthor`::
+ (ERROR) Author is missing.
+
+`missingCommitter`::
+ (ERROR) Committer is missing.
+
+`missingEmail`::
+ (ERROR) Email is missing in an author/committer line.
+
+`missingNameBeforeEmail`::
+ (ERROR) Missing name before an email in an author/committer line.
+
+`missingObject`::
+ (ERROR) Missing `object` line in tag object.
+
+`missingSpaceBeforeDate`::
+ (ERROR) Missing space before date in an author/committer line.
+
+`missingSpaceBeforeEmail`::
+ (ERROR) Missing space before the email in an author/committer line.
+
+`missingTag`::
+ (ERROR) Unexpected end after `type` line in a tag object.
+
+`missingTagEntry`::
+ (ERROR) Missing `tag` line in a tag object.
+
+`missingTaggerEntry`::
+ (INFO) Missing `tagger` line in a tag object.
+
+`missingTree`::
+ (ERROR) Missing `tree` line in a commit object.
+
+`missingType`::
+ (ERROR) Invalid type value on the `type` line in a tag object.
+
+`missingTypeEntry`::
+ (ERROR) Missing `type` line in a tag object.
+
+`multipleAuthors`::
+ (ERROR) Multiple author lines found in a commit.
+
+`nulInCommit`::
+ (WARN) Found a NUL byte in the commit object body.
+
+`nulInHeader`::
+ (FATAL) NUL byte exists in the object header.
+
+`nullSha1`::
+ (WARN) Tree contains entries pointing to a null sha1.
+
+`treeNotSorted`::
+ (ERROR) A tree is not properly sorted.
+
+`unknownType`::
+ (ERROR) Found an unknown object type.
+
+`unterminatedHeader`::
+ (FATAL) Missing end-of-line in the object header.
+
+`zeroPaddedDate`::
+ (ERROR) Found a zero padded date in an author/committer line.
+
+`zeroPaddedFilemode`::
+ (WARN) Found a zero padded filemode in a tree.
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
index 11eb70f..aceaa02 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -9,7 +9,7 @@ SYNOPSIS
--------
[verse]
'git add' [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p]
- [--edit | -e] [--[no-]all | --[no-]ignore-removal | [--update | -u]] [--sparse]
+ [--edit | -e] [--[no-]all | -A | --[no-]ignore-removal | [--update | -u]] [--sparse]
[--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing] [--renormalize]
[--chmod=(+|-)x] [--pathspec-from-file=<file> [--pathspec-file-nul]]
[--] [<pathspec>...]
@@ -63,7 +63,7 @@ OPTIONS
to ignore removed files; use `--no-all` option if you want
to add modified or new files but ignore removed ones.
+
-For more details about the <pathspec> syntax, see the 'pathspec' entry
+For more details about the _<pathspec>_ syntax, see the 'pathspec' entry
in linkgit:gitglossary[7].
-n::
@@ -119,10 +119,10 @@ apply to the index. See EDITING PATCHES below.
-u::
--update::
Update the index just where it already has an entry matching
- <pathspec>. This removes as well as modifies index entries to
+ _<pathspec>_. This removes as well as modifies index entries to
match the working tree, but adds no new files.
+
-If no <pathspec> is given when `-u` option is used, all
+If no _<pathspec>_ is given when `-u` option is used, all
tracked files in the entire working tree are updated (old versions
of Git used to limit the update to the current directory and its
subdirectories).
@@ -131,11 +131,11 @@ subdirectories).
--all::
--no-ignore-removal::
Update the index not only where the working tree has a file
- matching <pathspec> but also where the index already has an
+ matching _<pathspec>_ but also where the index already has an
entry. This adds, modifies, and removes index entries to
match the working tree.
+
-If no <pathspec> is given when `-A` option is used, all
+If no _<pathspec>_ is given when `-A` option is used, all
files in the entire working tree are updated (old versions
of Git used to limit the update to the current directory and its
subdirectories).
@@ -145,11 +145,11 @@ subdirectories).
Update the index by adding new files that are unknown to the
index and files modified in the working tree, but ignore
files that have been removed from the working tree. This
- option is a no-op when no <pathspec> is used.
+ option is a no-op when no _<pathspec>_ is used.
+
This option is primarily to help users who are used to older
-versions of Git, whose "git add <pathspec>..." was a synonym
-for "git add --no-all <pathspec>...", i.e. ignored removed files.
+versions of Git, whose "git add _<pathspec>_..." was a synonym
+for "git add --no-all _<pathspec>_...", i.e. ignored removed files.
-N::
--intent-to-add::
@@ -188,7 +188,9 @@ for "git add --no-all <pathspec>...", i.e. ignored removed files.
forcibly add them again to the index. This is useful after
changing `core.autocrlf` configuration or the `text` attribute
in order to correct files added with wrong CRLF/LF line endings.
- This option implies `-u`.
+ This option implies `-u`. Lone CR characters are untouched, thus
+ while a CRLF cleans to LF, a CRCRLF sequence is only partially
+ cleaned to CRLF.
--chmod=(+|-)x::
Override the executable bit of the added files. The executable
@@ -196,8 +198,8 @@ for "git add --no-all <pathspec>...", i.e. ignored removed files.
unchanged.
--pathspec-from-file=<file>::
- Pathspec is passed in `<file>` instead of commandline args. If
- `<file>` is exactly `-` then standard input is used. Pathspec
+ 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
quoted as explained for the configuration variable `core.quotePath`
(see linkgit:git-config[1]). See also `--pathspec-file-nul` and
@@ -272,7 +274,7 @@ status::
------------
staged unstaged path
1: binary nothing foo.png
- 2: +403/-35 +1/-1 git-add--interactive.perl
+ 2: +403/-35 +1/-1 add-interactive.c
------------
+
It shows that foo.png has differences from HEAD (but that is
@@ -280,7 +282,7 @@ binary so line count cannot be shown) and there is no
difference between indexed copy and the working tree
version (if the working tree version were also different,
'binary' would have been shown in place of 'nothing'). The
-other file, git-add{litdd}interactive.perl, has 403 lines added
+other file, add-interactive.c, has 403 lines added
and 35 lines deleted if you commit what is in the index, but
working tree file has further modifications (one addition and
one deletion).
@@ -301,7 +303,7 @@ like this:
------------
staged unstaged path
1: binary nothing foo.png
-* 2: +403/-35 +1/-1 git-add--interactive.perl
+* 2: +403/-35 +1/-1 add-interactive.c
------------
+
To remove selection, prefix the input with `-`
@@ -346,6 +348,7 @@ patch::
K - leave this hunk undecided, see previous hunk
s - split the current hunk into smaller hunks
e - manually edit the current hunk
+ p - print the current hunk
? - print help
+
After deciding the fate for all hunks, if there is any hunk
@@ -431,6 +434,13 @@ they will make the patch impossible to apply:
* deleting context or removal lines
* modifying the contents of context or removal lines
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/add.txt[]
+
SEE ALSO
--------
linkgit:git-status[1]
diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index 09107fb..624a6e6 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -9,10 +9,10 @@ git-am - Apply a series of patches from a mailbox
SYNOPSIS
--------
[verse]
-'git am' [--signoff] [--keep] [--[no-]keep-cr] [--[no-]utf8]
+'git am' [--signoff] [--keep] [--[no-]keep-cr] [--[no-]utf8] [--no-verify]
[--[no-]3way] [--interactive] [--committer-date-is-author-date]
[--ignore-date] [--ignore-space-change | --ignore-whitespace]
- [--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]
+ [--whitespace=<action>] [-C<n>] [-p<n>] [--directory=<dir>]
[--exclude=<path>] [--include=<path>] [--reject] [-q | --quiet]
[--[no-]scissors] [-S[<keyid>]] [--patch-format=<format>]
[--quoted-cr=<action>]
@@ -22,9 +22,11 @@ SYNOPSIS
DESCRIPTION
-----------
-Splits mail messages in a mailbox into commit log message,
-authorship information and patches, and applies them to the
-current branch.
+Splits mail messages in a mailbox into commit log messages,
+authorship information, and patches, and applies them to the
+current branch. You could think of it as a reverse operation
+of linkgit:git-format-patch[1] run on a branch with a straight
+history without merges.
OPTIONS
-------
@@ -64,13 +66,19 @@ OPTIONS
--quoted-cr=<action>::
This flag will be passed down to 'git mailinfo' (see linkgit:git-mailinfo[1]).
---empty=(stop|drop|keep)::
- By default, or when the option is set to 'stop', the command
- errors out on an input e-mail message lacking a patch
- and stops into the middle of the current am session. When this
- option is set to 'drop', skip such an e-mail message instead.
- When this option is set to 'keep', create an empty commit,
- recording the contents of the e-mail message as its log.
+--empty=(drop|keep|stop)::
+ How to handle an e-mail message lacking a patch:
++
+--
+`drop`;;
+ The e-mail message will be skipped.
+`keep`;;
+ An empty commit will be created, with the contents of the e-mail
+ message as its log.
+`stop`;;
+ The command will fail, stopping in the middle of the current `am`
+ session. This is the default behavior.
+--
-m::
--message-id::
@@ -92,7 +100,7 @@ OPTIONS
Pass `-u` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]).
The proposed commit log message taken from the e-mail
is re-coded into UTF-8 encoding (configuration variable
- `i18n.commitEncoding` can be used to specify project's
+ `i18n.commitEncoding` can be used to specify the project's
preferred encoding if it is not UTF-8).
+
This was optional in prior versions of git, but now it is the
@@ -112,14 +120,11 @@ default. You can use `--no-utf8` to override this.
am.threeWay configuration variable. For more information,
see am.threeWay in linkgit:git-config[1].
---rerere-autoupdate::
---no-rerere-autoupdate::
- Allow the rerere mechanism to update the index with the
- result of auto-conflict resolution if possible.
+include::rerere-options.txt[]
--ignore-space-change::
--ignore-whitespace::
---whitespace=<option>::
+--whitespace=<action>::
-C<n>::
-p<n>::
--directory=<dir>::
@@ -129,18 +134,27 @@ default. You can use `--no-utf8` to override this.
These flags are passed to the 'git apply' (see linkgit:git-apply[1])
program that applies
the patch.
++
+Valid <action> for the `--whitespace` option are:
+`nowarn`, `warn`, `fix`, `error`, and `error-all`.
--patch-format::
By default the command will try to detect the patch format
automatically. This option allows the user to bypass the automatic
detection and specify the patch format that the patch(es) should be
interpreted as. Valid formats are mbox, mboxrd,
- stgit, stgit-series and hg.
+ stgit, stgit-series, and hg.
-i::
--interactive::
Run interactively.
+-n::
+--no-verify::
+ By default, the pre-applypatch and applypatch-msg hooks are run.
+ When any of `--no-verify` or `-n` is given, these are bypassed.
+ See also linkgit:githooks[5].
+
--committer-date-is-author-date::
By default the command records the date from the e-mail
message as the commit author date, and uses the time of
@@ -187,7 +201,7 @@ default. You can use `--no-utf8` to override this.
--abort::
Restore the original branch and abort the patching operation.
- Revert contents of files involved in the am operation to their
+ Revert the contents of files involved in the am operation to their
pre-am state.
--quit::
@@ -261,9 +275,17 @@ This command can run `applypatch-msg`, `pre-applypatch`,
and `post-applypatch` hooks. See linkgit:githooks[5] for more
information.
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/am.txt[]
+
SEE ALSO
--------
-linkgit:git-apply[1].
+linkgit:git-apply[1],
+linkgit:git-format-patch[1].
GIT
---
diff --git a/Documentation/git-annotate.txt b/Documentation/git-annotate.txt
index e44a831..5ae8aab 100644
--- a/Documentation/git-annotate.txt
+++ b/Documentation/git-annotate.txt
@@ -8,7 +8,7 @@ git-annotate - Annotate file lines with commit information
SYNOPSIS
--------
[verse]
-'git annotate' [<options>] <file> [<revision>]
+'git annotate' [<options>] [<rev-opts>] [<rev>] [--] <file>
DESCRIPTION
-----------
diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt
index b6d77f4..9cce68a 100644
--- a/Documentation/git-apply.txt
+++ b/Documentation/git-apply.txt
@@ -23,8 +23,8 @@ DESCRIPTION
Reads the supplied diff output (i.e. "a patch") and applies it to files.
When running from a subdirectory in a repository, patched paths
outside the directory are ignored.
-With the `--index` option the patch is also applied to the index, and
-with the `--cached` option the patch is only applied to the index.
+With the `--index` option, the patch is also applied to the index, and
+with the `--cached` option, the patch is only applied to the index.
Without these options, the command applies the patch only to files,
and does not require them to be in a Git repository.
@@ -52,7 +52,7 @@ OPTIONS
--summary::
Instead of applying the patch, output a condensed
summary of information obtained from git diff extended
- headers, such as creations, renames and mode changes.
+ headers, such as creations, renames, and mode changes.
Turns off "apply".
--check::
@@ -140,7 +140,7 @@ linkgit:git-config[1]).
applying a diff generated with `--unified=0`. To bypass these
checks use `--unidiff-zero`.
+
-Note, for the reasons stated above usage of context-free patches is
+Note, for the reasons stated above, the usage of context-free patches is
discouraged.
--apply::
@@ -159,9 +159,9 @@ discouraged.
--allow-binary-replacement::
--binary::
- Historically we did not allow binary patch applied
+ Historically we did not allow binary patch application
without an explicit permission from the user, and this
- flag was the way to do so. Currently we always allow binary
+ flag was the way to do so. Currently, we always allow binary
patch application, so this is a no-op.
--exclude=<path-pattern>::
@@ -208,7 +208,7 @@ behavior:
* `warn` outputs warnings for a few such errors, but applies the
patch as-is (default).
* `fix` outputs warnings for a few such errors, and applies the
- patch after fixing them (`strip` is a synonym --- the tool
+ patch after fixing them (`strip` is a synonym -- the tool
used to consider only trailing whitespace characters as errors, and the
fix involved 'stripping' them, but modern Gits do more).
* `error` outputs warnings for a few such errors, and refuses
@@ -257,19 +257,15 @@ the `--unsafe-paths` option to override this safety check. This option
has no effect when `--index` or `--cached` is in use.
--allow-empty::
- Don't return error for patches containing no diff. This includes
+ Don't return an error for patches containing no diff. This includes
empty patches and patches with commit text only.
CONFIGURATION
-------------
-apply.ignoreWhitespace::
- Set to 'change' if you want changes in whitespace to be ignored by default.
- Set to one of: no, none, never, false if you want changes in
- whitespace to be significant.
-apply.whitespace::
- When no `--whitespace` flag is given from the command
- line, this configuration item is used as the default.
+include::includes/cmd-config-section-all.txt[]
+
+include::config/apply.txt[]
SUBMODULES
----------
diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt
index 56989a2..98526f2 100644
--- a/Documentation/git-archive.txt
+++ b/Documentation/git-archive.txt
@@ -21,23 +21,25 @@ structure for the named tree, and writes it out to the standard
output. If <prefix> is specified it is
prepended to the filenames in the archive.
-'git archive' behaves differently when given a tree ID versus when
-given a commit ID or tag ID. In the first case the current time is
-used as the modification time of each file in the archive. In the latter
-case the commit time as recorded in the referenced commit object is
-used instead. Additionally the commit ID is stored in a global
-extended pax header if the tar format is used; it can be extracted
-using 'git get-tar-commit-id'. In ZIP files it is stored as a file
-comment.
+'git archive' behaves differently when given a tree ID as opposed to a
+commit ID or tag ID. When a tree ID is provided, the current time is
+used as the modification time of each file in the archive. On the
+other hand, when a commit ID or tag ID is provided, the commit time as
+recorded in the referenced commit object is used instead.
+Additionally the commit ID is stored in a global extended pax header
+if the tar format is used; it can be extracted using 'git
+get-tar-commit-id'. In ZIP files it is stored as a file comment.
OPTIONS
-------
--format=<fmt>::
- Format of the resulting archive: 'tar' or 'zip'. If this option
+ Format of the resulting archive. Possible values are `tar`,
+ `zip`, `tar.gz`, `tgz`, and any format defined using the
+ configuration option `tar.<format>.command`. If `--format`
is not given, and the output file is specified, the format is
- inferred from the filename if possible (e.g. writing to "foo.zip"
- makes the output to be in the zip format). Otherwise the output
+ inferred from the filename if possible (e.g. writing to `foo.zip`
+ makes the output to be in the `zip` format). Otherwise the output
format is `tar`.
-l::
@@ -84,6 +86,11 @@ cases, write an untracked file and use `--add-file` instead.
Look for attributes in .gitattributes files in the working tree
as well (see <<ATTRIBUTES>>).
+--mtime=<time>::
+ Set modification time of archive entries. Without this option
+ the committer time is used if `<tree-ish>` is a commit or tag,
+ and the current time if it is a tree.
+
<extra>::
This can be any options that the archiver backend understands.
See next section.
@@ -143,17 +150,16 @@ tar.<format>.command::
is executed using the shell with the generated tar file on its
standard input, and should produce the final output on its
standard output. Any compression-level options will be passed
- to the command (e.g., "-9"). An output file with the same
- extension as `<format>` will be use this format if no other
- format is given.
+ to the command (e.g., `-9`).
+
-The "tar.gz" and "tgz" formats are defined automatically and default to
-`gzip -cn`. You may override them with custom commands.
+The `tar.gz` and `tgz` formats are defined automatically and use the
+magic command `git archive gzip` by default, which invokes an internal
+implementation of gzip.
tar.<format>.remote::
- If true, enable `<format>` for use by remote clients via
+ If true, enable the format for use by remote clients via
linkgit:git-upload-archive[1]. Defaults to false for
- user-defined formats, but true for the "tar.gz" and "tgz"
+ user-defined formats, but true for the `tar.gz` and `tgz`
formats.
[[ATTRIBUTES]]
diff --git a/Documentation/git-bisect-lk2009.txt b/Documentation/git-bisect-lk2009.txt
index f3d9566..0bc1657 100644
--- a/Documentation/git-bisect-lk2009.txt
+++ b/Documentation/git-bisect-lk2009.txt
@@ -1347,8 +1347,8 @@ author to given a talk and for publishing this paper.
References
----------
-- [[[1]]] https://www.nist.gov/sites/default/files/documents/director/planning/report02-3.pdf['The Economic Impacts of Inadequate Infratructure for Software Testing'. Nist Planning Report 02-3], see Executive Summary and Chapter 8.
-- [[[2]]] http://www.oracle.com/technetwork/java/codeconvtoc-136057.html['Code Conventions for the Java Programming Language'. Sun Microsystems.]
+- [[[1]]] https://web.archive.org/web/20091206032101/http://www.nist.gov/public_affairs/releases/n02-10.htm['Software Errors Cost U.S. Economy $59.5 Billion Annually'. Nist News Release.] See also https://www.nist.gov/system/files/documents/director/planning/report02-3.pdf['The Economic Impacts of Inadequate Infratructure for Software Testing'. Nist Planning Report 02-3], Executive Summary and Chapter 8.
+- [[[2]]] https://www.oracle.com/java/technologies/javase/codeconventions-introduction.html['Code Conventions for the Java Programming Language: 1. Introduction'. Sun Microsystems.]
- [[[3]]] https://en.wikipedia.org/wiki/Software_maintenance['Software maintenance'. Wikipedia.]
- [[[4]]] https://lore.kernel.org/git/7vps5xsbwp.fsf_-_@assigned-by-dhcp.cox.net/[Junio C Hamano. 'Automated bisect success story'.]
- [[[5]]] https://lwn.net/Articles/317154/[Christian Couder. 'Fully automated bisecting with "git bisect run"'. LWN.net.]
diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
index fbb39fb..82f944d 100644
--- a/Documentation/git-bisect.txt
+++ b/Documentation/git-bisect.txt
@@ -16,17 +16,17 @@ DESCRIPTION
The command takes various subcommands, and different options depending
on the subcommand:
- git bisect start [--term-{new,bad}=<term> --term-{old,good}=<term>]
- [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] [<paths>...]
+ git bisect start [--term-(bad|new)=<term-new> --term-(good|old)=<term-old>]
+ [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]
git bisect (bad|new|<term-new>) [<rev>]
git bisect (good|old|<term-old>) [<rev>...]
- git bisect terms [--term-good | --term-bad]
+ git bisect terms [--term-(good|old) | --term-(bad|new)]
git bisect skip [(<rev>|<range>)...]
git bisect reset [<commit>]
git bisect (visualize|view)
git bisect replay <logfile>
git bisect log
- git bisect run <cmd>...
+ git bisect run <cmd> [<arg>...]
git bisect help
This command uses a binary search algorithm to find which commit in
@@ -165,8 +165,10 @@ To get a reminder of the currently used terms, use
git bisect terms
------------------------------------------------
-You can get just the old (respectively new) term with `git bisect terms
---term-old` or `git bisect terms --term-good`.
+You can get just the old term with `git bisect terms --term-old`
+or `git bisect terms --term-good`; `git bisect terms --term-new`
+and `git bisect terms --term-bad` can be used to learn how to call
+the commits more recent than the sought change.
If you would like to use your own terms instead of "bad"/"good" or
"new"/"old", you can choose any names you like (except existing bisect
@@ -204,9 +206,14 @@ as an alternative to `visualize`):
$ git bisect visualize
------------
-If the `DISPLAY` environment variable is not set, 'git log' is used
-instead. You can also give command-line options such as `-p` and
-`--stat`.
+Git detects a graphical environment through various environment variables:
+`DISPLAY`, which is set in X Window System environments on Unix systems.
+`SESSIONNAME`, which is set under Cygwin in interactive desktop sessions.
+`MSYSTEM`, which is set under Msys2 and Git for Windows.
+`SECURITYSESSIONID`, which may be set on macOS in interactive desktop sessions.
+
+If none of these environment variables is set, 'git log' is used instead.
+You can also give command-line options such as `-p` and `--stat`.
------------
$ git bisect visualize --stat
@@ -294,7 +301,7 @@ Cutting down bisection by giving more parameters to bisect start
You can further cut down the number of trials, if you know what part of
the tree is involved in the problem you are tracking down, by specifying
-path parameters when issuing the `bisect start` command:
+pathspec parameters when issuing the `bisect start` command:
------------
$ git bisect start -- arch/i386 include/asm-i386
@@ -357,7 +364,7 @@ OPTIONS
--no-checkout::
+
Do not checkout the new working tree at each iteration of the bisection
-process. Instead just update a special reference named `BISECT_HEAD` to make
+process. Instead just update the reference named `BISECT_HEAD` to make
it point to the commit that should be tested.
+
This option may be useful when the test you would perform in each step
diff --git a/Documentation/git-blame.txt b/Documentation/git-blame.txt
index d7a46cc..b1d7fb5 100644
--- a/Documentation/git-blame.txt
+++ b/Documentation/git-blame.txt
@@ -12,7 +12,7 @@ SYNOPSIS
[-L <range>] [-S <revs-file>] [-M] [-C] [-C] [-C] [--since=<date>]
[--ignore-rev <rev>] [--ignore-revs-file <file>]
[--color-lines] [--color-by-age] [--progress] [--abbrev=<n>]
- [<rev> | --contents <file> | --reverse <rev>..<rev>] [--] <file>
+ [ --contents <file> ] [<rev> | --reverse <rev>..<rev>] [--] <file>
DESCRIPTION
-----------
@@ -77,7 +77,7 @@ include::blame-options.txt[]
-e::
--show-email::
- Show the author email instead of author name (Default: off).
+ Show the author email instead of the author name (Default: off).
This can also be controlled via the `blame.showEmail` config
option.
@@ -100,7 +100,7 @@ When neither `--porcelain` nor `--incremental` option is specified,
`git blame` will output annotation for each line with:
- abbreviated object name for the commit the line came from;
-- author ident (by default author name and date, unless `-s` or `-e`
+- author ident (by default the author name and date, unless `-s` or `-e`
is specified); and
- line number
@@ -128,7 +128,7 @@ at least once for each commit:
- the filename in the commit that the line is attributed to.
- the first line of the commit log message ("summary").
-The contents of the actual line is output after the above
+The contents of the actual line are output after the above
header, prefixed by a TAB. This is to allow adding more
header elements later.
@@ -170,7 +170,7 @@ which limits the annotation to the body of the `hello` subroutine.
When you are not interested in changes older than version
v2.6.18, or changes older than 3 weeks, you can use revision
-range specifiers similar to 'git rev-list':
+range specifiers similar to 'git rev-list':
git blame v2.6.18.. -- foo
git blame --since=3.weeks -- foo
@@ -210,7 +210,7 @@ annotated.
. Each blame entry always starts with a line of:
- <40-byte hex sha1> <sourceline> <resultline> <num_lines>
+ <40-byte-hex-sha1> <sourceline> <resultline> <num-lines>
+
Line numbers count from 1.
@@ -241,6 +241,12 @@ MAPPING AUTHORS
See linkgit:gitmailmap[5].
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/blame.txt[]
SEE ALSO
--------
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index ae82378..0b08442 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -116,13 +116,17 @@ OPTIONS
-f::
--force::
- Reset <branchname> to <startpoint>, even if <branchname> exists
+ Reset <branchname> to <start-point>, even if <branchname> exists
already. Without `-f`, 'git branch' refuses to change an existing branch.
In combination with `-d` (or `--delete`), allow deleting the
branch irrespective of its merged status, or whether it even
points to a valid commit. In combination with
`-m` (or `--move`), allow renaming the branch even if the new
branch name already exists, the same applies for `-c` (or `--copy`).
++
+Note that 'git branch -f <branchname> [<start-point>]', even with '-f',
+refuses to change an existing branch `<branchname>` that is checked out
+in another worktree linked to the same repository.
-m::
--move::
@@ -152,6 +156,10 @@ OPTIONS
--ignore-case::
Sorting and filtering branches are case insensitive.
+--omit-empty::
+ Do not print a newline after formatted refs where the format expands
+ to the empty string.
+
--column[=<options>]::
--no-column::
Display branch listing in columns. See configuration variable
@@ -304,7 +312,8 @@ superproject's "origin/main", but tracks the submodule's "origin/main".
option is omitted, the current HEAD will be used instead.
<oldbranch>::
- The name of an existing branch to rename.
+ The name of an existing branch. If this option is omitted,
+ the name of the current branch will be used instead.
<newbranch>::
The new name for an existing branch. The same restrictions as for
@@ -316,7 +325,7 @@ superproject's "origin/main", but tracks the submodule's "origin/main".
multiple times, in which case the last key becomes the primary
key. The keys supported are the same as those in `git
for-each-ref`. Sort order defaults to the value configured for the
- `branch.sort` variable if exists, or to sorting based on the
+ `branch.sort` variable if it exists, or to sorting based on the
full refname (including `refs/...` prefix). This lists
detached HEAD (if present) first, then local branches and
finally remote-tracking branches. See linkgit:git-config[1].
@@ -336,6 +345,10 @@ CONFIGURATION
`--list` is used or implied. The default is to use a pager.
See linkgit:git-config[1].
+include::includes/cmd-config-section-rest.txt[]
+
+include::config/branch.txt[]
+
EXAMPLES
--------
diff --git a/Documentation/git-bugreport.txt b/Documentation/git-bugreport.txt
index d8817bf..112658b 100644
--- a/Documentation/git-bugreport.txt
+++ b/Documentation/git-bugreport.txt
@@ -8,14 +8,17 @@ git-bugreport - Collect information for user to file a bug report
SYNOPSIS
--------
[verse]
-'git bugreport' [(-o | --output-directory) <path>] [(-s | --suffix) <format>]
+'git bugreport' [(-o | --output-directory) <path>]
+ [(-s | --suffix) <format> | --no-suffix]
+ [--diagnose[=<mode>]]
DESCRIPTION
-----------
-Captures information about the user's machine, Git client, and repository state,
-as well as a form requesting information about the behavior the user observed,
-into a single text file which the user can then share, for example to the Git
-mailing list, in order to report an observed bug.
+Collects information about the user's machine, Git client, and repository
+state, in addition to a form requesting information about the behavior the
+user observed, and stores it in a single text file which the user can then
+share, for example to the Git mailing list, in order to report an observed
+bug.
The following information is requested from the user:
@@ -31,6 +34,10 @@ The following information is captured automatically:
- A list of enabled hooks
- $SHELL
+Additional information may be gathered into a separate zip archive using the
+`--diagnose` option, and can be attached alongside the bugreport document to
+provide additional context to readers.
+
This tool is invoked via the typical Git setup process, which means that in some
cases, it might not be able to launch - for example, if a relevant config file
is unreadable. In this kind of scenario, it may be helpful to manually gather
@@ -45,9 +52,25 @@ OPTIONS
-s <format>::
--suffix <format>::
+--no-suffix::
Specify an alternate suffix for the bugreport name, to create a file
- named 'git-bugreport-<formatted suffix>'. This should take the form of a
+ named 'git-bugreport-<formatted-suffix>'. This should take the form of a
strftime(3) format string; the current local time will be used.
+ `--no-suffix` disables the suffix and the file is just named
+ `git-bugreport` without any disambiguation measure.
+
+--no-diagnose::
+--diagnose[=<mode>]::
+ Create a zip archive of supplemental information about the user's
+ machine, Git client, and repository state. The archive is written to the
+ same output directory as the bug report and is named
+ 'git-diagnostics-<formatted-suffix>'.
++
+Without `mode` specified, the diagnostic archive will contain the default set of
+statistics reported by `git diagnose`. An optional `mode` value may be specified
+to change which information is included in the archive. See
+linkgit:git-diagnose[1] for the list of valid values for `mode` and details
+about their usage.
GIT
---
diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt
index 7685b57..3ab42a1 100644
--- a/Documentation/git-bundle.txt
+++ b/Documentation/git-bundle.txt
@@ -9,7 +9,7 @@ git-bundle - Move objects and refs by archive
SYNOPSIS
--------
[verse]
-'git bundle' create [-q | --quiet | --progress | --all-progress] [--all-progress-implied]
+'git bundle' create [-q | --quiet | --progress]
[--version=<version>] <file> <git-rev-list-args>
'git bundle' verify [-q | --quiet] <file>
'git bundle' list-heads <file> [<refname>...]
@@ -42,7 +42,7 @@ BUNDLE FORMAT
Bundles are `.pack` files (see linkgit:git-pack-objects[1]) with a
header indicating what references are contained within the bundle.
-Like the the packed archive format itself bundles can either be
+Like the packed archive format itself bundles can either be
self-contained, or be created using exclusions.
See the "OBJECT PREREQUISITES" section below.
@@ -56,10 +56,8 @@ using "thin packs", bundles created using exclusions are smaller in
size. That they're "thin" under the hood is merely noted here as a
curiosity, and as a reference to other documentation.
-See link:technical/bundle-format.html[the `bundle-format`
-documentation] for more details and the discussion of "thin pack" in
-link:technical/pack-format.html[the pack format documentation] for
-further details.
+See linkgit:gitformat-bundle[5] for more details and the discussion of
+"thin pack" in linkgit:gitformat-pack[5] for further details.
OPTIONS
-------
@@ -68,7 +66,7 @@ create [options] <file> <git-rev-list-args>::
Used to create a bundle named 'file'. This requires the
'<git-rev-list-args>' arguments to define the bundle contents.
'options' contains the options specific to the 'git bundle create'
- subcommand.
+ subcommand. If 'file' is `-`, the bundle is written to stdout.
verify <file>::
Used to check that a bundle file is valid and will apply
@@ -77,14 +75,15 @@ verify <file>::
commits exist and are fully linked in the current repository.
Then, 'git bundle' prints a list of missing commits, if any.
Finally, information about additional capabilities, such as "object
- filter", is printed. See "Capabilities" in link:technical/bundle-format.html
+ filter", is printed. See "Capabilities" in linkgit:gitformat-bundle[5]
for more information. The exit code is zero for success, but will
- be nonzero if the bundle file is invalid.
+ be nonzero if the bundle file is invalid. If 'file' is `-`, the
+ bundle is read from stdin.
list-heads <file>::
Lists the references defined in the bundle. If followed by a
list of references, only references matching those given are
- printed out.
+ printed out. If 'file' is `-`, the bundle is read from stdin.
unbundle <file>::
Passes the objects in the bundle to 'git index-pack'
@@ -92,6 +91,7 @@ unbundle <file>::
defined references. If a list of references is given, only
references matching those in the list are printed. This command is
really plumbing, intended to be called only by 'git fetch'.
+ If 'file' is `-`, the bundle is read from stdin.
<git-rev-list-args>::
A list of arguments, acceptable to 'git rev-parse' and
@@ -117,22 +117,6 @@ unbundle <file>::
is specified. This flag forces progress status even if
the standard error stream is not directed to a terminal.
---all-progress::
- When --stdout is specified then progress report is
- displayed during the object count and compression phases
- but inhibited during the write-out phase. The reason is
- that in some cases the output stream is directly linked
- to another command which may wish to display progress
- status of its own as it processes incoming pack data.
- This flag is like --progress except that it forces progress
- report for the write-out phase as well even if --stdout is
- used.
-
---all-progress-implied::
- This is used to imply --all-progress whenever progress display
- is activated. Unlike --all-progress this flag doesn't actually
- force any progress display by itself.
-
--version=<version>::
Specify the bundle version. Version 2 is the older format and can only be
used with SHA-1 repositories; the newer version 3 contains capabilities that
@@ -337,6 +321,11 @@ You can also see what references it offers:
$ git ls-remote mybundle
----------------
+FILE FORMAT
+-----------
+
+See linkgit:gitformat-bundle[5].
+
GIT
---
Part of the linkgit:git[1] suite
diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt
index 24a811f..bd95a6c 100644
--- a/Documentation/git-cat-file.txt
+++ b/Documentation/git-cat-file.txt
@@ -3,8 +3,7 @@ git-cat-file(1)
NAME
----
-git-cat-file - Provide content or type and size information for repository objects
-
+git-cat-file - Provide contents or details of repository objects
SYNOPSIS
--------
@@ -12,25 +11,24 @@ SYNOPSIS
'git cat-file' <type> <object>
'git cat-file' (-e | -p) <object>
'git cat-file' (-t | -s) [--allow-unknown-type] <object>
-'git cat-file' (--batch | --batch-check | --batch-command) [--batch-all-objects]
- [--buffer] [--follow-symlinks] [--unordered]
- [--textconv | --filters]
'git cat-file' (--textconv | --filters)
[<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]
+'git cat-file' (--batch | --batch-check | --batch-command) [--batch-all-objects]
+ [--buffer] [--follow-symlinks] [--unordered]
+ [--textconv | --filters] [-Z]
DESCRIPTION
-----------
-In its first form, the command provides the content or the type of an object in
-the repository. The type is required unless `-t` or `-p` is used to find the
-object type, or `-s` is used to find the object size, or `--textconv` or
-`--filters` is used (which imply type "blob").
-
-In the second form, a list of objects (separated by linefeeds) is provided on
-stdin, and the SHA-1, type, and size of each object is printed on stdout. The
-output format can be overridden using the optional `<format>` argument. If
-either `--textconv` or `--filters` was specified, the input is expected to
-list the object names followed by the path name, separated by a single
-whitespace, so that the appropriate drivers can be determined.
+Output the contents or other properties such as size, type or delta
+information of one or more objects.
+
+This command can operate in two modes, depending on whether an option
+from the `--batch` family is specified.
+
+In non-batch mode, the command provides information on an object
+named on the command line.
+
+In batch mode, arguments are read from standard input.
OPTIONS
-------
@@ -45,12 +43,14 @@ OPTIONS
-s::
Instead of the content, show the object size identified by
- `<object>`.
+ `<object>`. If used with `--use-mailmap` option, will show
+ the size of updated object after replacing idents using the
+ mailmap mechanism.
-e::
Exit with zero status if `<object>` exists and is a valid
- object. If `<object>` is of an invalid format exit with non-zero and
- emits an error on stderr.
+ object. If `<object>` is of an invalid format, exit with non-zero
+ status and emit an error on stderr.
-p::
Pretty-print the contents of `<object>` based on its type.
@@ -63,6 +63,12 @@ OPTIONS
or to ask for a "blob" with `<object>` being a tag object that
points at it.
+--[no-]mailmap::
+--[no-]use-mailmap::
+ Use mailmap file to map author, committer and tagger names
+ and email addresses to canonical real names and email addresses.
+ See linkgit:git-shortlog[1].
+
--textconv::
Show the content as transformed by a textconv filter. In this case,
`<object>` has to be of the form `<tree-ish>:<path>`, or `:<path>` in
@@ -83,26 +89,54 @@ OPTIONS
--batch::
--batch=<format>::
Print object information and contents for each object provided
- on stdin. May not be combined with any other options or arguments
- except `--textconv` or `--filters`, in which case the input lines
- also need to specify the path, separated by whitespace. See the
- section `BATCH OUTPUT` below for details.
+ on stdin. May not be combined with any other options or arguments
+ except `--textconv`, `--filters`, or `--use-mailmap`.
++
+--
+ * When used with `--textconv` or `--filters`, the input lines
+ must specify the path, separated by whitespace. See the section
+ `BATCH OUTPUT` below for details.
+
+ * When used with `--use-mailmap`, for commit and tag objects, the
+ contents part of the output shows the identities replaced using the
+ mailmap mechanism, while the information part of the output shows
+ the size of the object as if it actually recorded the replacement
+ identities.
+--
--batch-check::
--batch-check=<format>::
- Print object information for each object provided on stdin. May
- not be combined with any other options or arguments except
- `--textconv` or `--filters`, in which case the input lines also
- need to specify the path, separated by whitespace. See the
- section `BATCH OUTPUT` below for details.
+ Print object information for each object provided on stdin. May not be
+ combined with any other options or arguments except `--textconv`, `--filters`
+ or `--use-mailmap`.
++
+--
+ * When used with `--textconv` or `--filters`, the input lines must
+ specify the path, separated by whitespace. See the section
+ `BATCH OUTPUT` below for details.
+
+ * When used with `--use-mailmap`, for commit and tag objects, the
+ printed object information shows the size of the object as if the
+ identities recorded in it were replaced by the mailmap mechanism.
+--
--batch-command::
--batch-command=<format>::
Enter a command mode that reads commands and arguments from stdin. May
- only be combined with `--buffer`, `--textconv` or `--filters`. In the
- case of `--textconv` or `--filters`, the input lines also need to specify
- the path, separated by whitespace. See the section `BATCH OUTPUT` below
- for details.
+ only be combined with `--buffer`, `--textconv`, `--use-mailmap` or
+ `--filters`.
++
+--
+ * When used with `--textconv` or `--filters`, the input lines must
+ specify the path, separated by whitespace. See the section
+ `BATCH OUTPUT` below for details.
+
+ * When used with `--use-mailmap`, for commit and tag objects, the
+ `contents` command shows the identities replaced using the
+ mailmap mechanism, while the `info` command shows the size
+ of the object as if it actually recorded the replacement
+ identities.
+--
+
`--batch-command` recognizes the following commands:
+
@@ -207,6 +241,17 @@ respectively print:
/etc/passwd
--
+-Z::
+ Only meaningful with `--batch`, `--batch-check`, or
+ `--batch-command`; input and output is NUL-delimited instead of
+ newline-delimited.
+
+-z::
+ Only meaningful with `--batch`, `--batch-check`, or
+ `--batch-command`; input is NUL-delimited instead of
+ newline-delimited. This option is deprecated in favor of
+ `-Z` as the output can otherwise be ambiguous.
+
OUTPUT
------
@@ -343,6 +388,11 @@ notdir SP <size> LF
is printed when, during symlink resolution, a file is used as a
directory name.
+Alternatively, when `-Z` is passed, the line feeds in any of the above examples
+are replaced with NUL terminators. This ensures that output will be parsable if
+the output itself would contain a linefeed and is thus recommended for
+scripting purposes.
+
CAVEATS
-------
diff --git a/Documentation/git-check-attr.txt b/Documentation/git-check-attr.txt
index 84f41a8..cb5a6c8 100644
--- a/Documentation/git-check-attr.txt
+++ b/Documentation/git-check-attr.txt
@@ -9,8 +9,8 @@ git-check-attr - Display gitattributes information
SYNOPSIS
--------
[verse]
-'git check-attr' [-a | --all | <attr>...] [--] <pathname>...
-'git check-attr' --stdin [-z] [-a | --all | <attr>...]
+'git check-attr' [--source <tree-ish>] [-a | --all | <attr>...] [--] <pathname>...
+'git check-attr' --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]
DESCRIPTION
-----------
@@ -29,13 +29,18 @@ OPTIONS
--stdin::
Read pathnames from the standard input, one per line,
- instead of from the command-line.
+ instead of from the command line.
-z::
The output format is modified to be machine-parsable.
If `--stdin` is also given, input paths are separated
with a NUL character instead of a linefeed character.
+--source=<tree-ish>::
+ Check attributes against the specified tree-ish. It is common to
+ specify the source tree by naming a commit, branch, or tag associated
+ with it.
+
\--::
Interpret all preceding arguments as attributes and all following
arguments as path names.
@@ -55,7 +60,7 @@ unless `-z` is in effect, in which case NUL is used as delimiter:
<path> is the path of a file being queried, <attribute> is an attribute
-being queried and <info> can be either:
+being queried, and <info> can be either:
'unspecified';; when the attribute is not defined for the path.
'unset';; when the attribute is defined as false.
diff --git a/Documentation/git-check-ignore.txt b/Documentation/git-check-ignore.txt
index 2892799..3e3b4e3 100644
--- a/Documentation/git-check-ignore.txt
+++ b/Documentation/git-check-ignore.txt
@@ -50,7 +50,7 @@ linkgit:gitignore[5].
with a NUL character instead of a linefeed character.
-n, --non-matching::
- Show given paths which don't match any pattern. This only
+ Show given paths which don't match any pattern. This only
makes sense when `--verbose` is enabled, otherwise it would
not be possible to distinguish between paths which match a
pattern and those which don't.
diff --git a/Documentation/git-check-ref-format.txt b/Documentation/git-check-ref-format.txt
index ee6a414..2aacfd1 100644
--- a/Documentation/git-check-ref-format.txt
+++ b/Documentation/git-check-ref-format.txt
@@ -48,7 +48,7 @@ Git imposes the following rules on how references are named:
. They cannot begin or end with a slash `/` or contain multiple
consecutive slashes (see the `--normalize` option below for an
- exception to this rule)
+ exception to this rule).
. They cannot end with a dot `.`.
@@ -85,7 +85,7 @@ The rule `git check-ref-format --branch $name` implements
may be stricter than what `git check-ref-format refs/heads/$name`
says (e.g. a dash may appear at the beginning of a ref component,
but it is explicitly forbidden at the beginning of a branch name).
-When run with `--branch` option in a repository, the input is first
+When run with the `--branch` option in a repository, the input is first
expanded for the ``previous checkout syntax''
`@{-n}`. For example, `@{-1}` is a way to refer the last thing that
was checked out using "git switch" or "git checkout" operation.
diff --git a/Documentation/git-checkout-index.txt b/Documentation/git-checkout-index.txt
index 01dbd5c..faf8d6c 100644
--- a/Documentation/git-checkout-index.txt
+++ b/Documentation/git-checkout-index.txt
@@ -18,7 +18,7 @@ SYNOPSIS
DESCRIPTION
-----------
-Will copy all files listed from the index to the working directory
+Copies all listed files from the index to the working directory
(not overwriting existing files).
OPTIONS
@@ -53,11 +53,11 @@ OPTIONS
--stage=<number>|all::
Instead of checking out unmerged entries, copy out the
- files from named stage. <number> must be between 1 and 3.
+ files from the named stage. <number> must be between 1 and 3.
Note: --stage=all automatically implies --temp.
--temp::
- Instead of copying the files to the working directory
+ Instead of copying the files to the working directory,
write the content to temporary files. The temporary name
associations will be written to stdout.
@@ -66,8 +66,8 @@ OPTIONS
set.
--stdin::
- Instead of taking list of paths from the command line,
- read list of paths from the standard input. Paths are
+ Instead of taking a list of paths from the command line,
+ read the list of paths from the standard input. Paths are
separated by LF (i.e. one path per line) by default.
-z::
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 9f37e22..8bdfa54 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -12,8 +12,10 @@ SYNOPSIS
'git checkout' [-q] [-f] [-m] --detach [<branch>]
'git checkout' [-q] [-f] [-m] [--detach] <commit>
'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] <new-branch>] [<start-point>]
-'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <pathspec>...
-'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] --pathspec-from-file=<file> [--pathspec-file-nul]
+'git checkout' [-f] <tree-ish> [--] <pathspec>...
+'git checkout' [-f] <tree-ish> --pathspec-from-file=<file> [--pathspec-file-nul]
+'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [--] <pathspec>...
+'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] --pathspec-from-file=<file> [--pathspec-file-nul]
'git checkout' (-p|--patch) [<tree-ish>] [--] [<pathspec>...]
DESCRIPTION
@@ -41,7 +43,7 @@ $ git checkout -b <branch> --track <remote>/<branch>
You could omit `<branch>`, in which case the command degenerates to
"check out the current branch", which is a glorified no-op with
rather expensive side-effects to show only the tracking information,
-if exists, for the current branch.
+if it exists, for the current branch.
'git checkout' -b|-B <new-branch> [<start-point>]::
@@ -61,7 +63,9 @@ $ git checkout <branch>
------------
+
that is to say, the branch is not reset/created unless "git checkout" is
-successful.
+successful (e.g., when the branch is in use in another worktree, not
+just the current branch stays the same, but the branch is not reset to
+the start-point, either).
'git checkout' --detach [<branch>]::
'git checkout' [--detach] <commit>::
@@ -146,14 +150,16 @@ on your side branch as `theirs` (i.e. "one contributor's work on top
of it").
-b <new-branch>::
- Create a new branch named `<new-branch>` and start it at
- `<start-point>`; see linkgit:git-branch[1] for details.
+ Create a new branch named `<new-branch>`, start it at
+ `<start-point>`, and check the resulting branch out;
+ see linkgit:git-branch[1] for details.
-B <new-branch>::
- Creates the branch `<new-branch>` and start it at `<start-point>`;
- if it already exists, then reset it to `<start-point>`. This is
- equivalent to running "git branch" with "-f"; see
- linkgit:git-branch[1] for details.
+ Creates the branch `<new-branch>`, start it at `<start-point>`;
+ if it already exists, then reset it to `<start-point>`. And then
+ check the resulting branch out. This is equivalent to running
+ "git branch" with "-f" followed by "git checkout" of that branch;
+ see linkgit:git-branch[1] for details.
-t::
--track[=(direct|inherit)]::
@@ -211,7 +217,7 @@ variable.
below for details.
--orphan <new-branch>::
- Create a new 'orphan' branch, named `<new-branch>`, started from
+ Create a new unborn branch, named `<new-branch>`, started from
`<start-point>` and switch to it. The first commit made on this
new branch will have no parents and it will be the root of a new
history totally disconnected from all the other branches and
@@ -258,7 +264,8 @@ and mark the resolved paths with `git add` (or `git rm` if the merge
should result in deletion of the path).
+
When checking out paths from the index, this option lets you recreate
-the conflicted merge in the specified paths.
+the conflicted merge in the specified paths. This option cannot be
+used when checking out paths from a tree-ish.
+
When switching branches with `--merge`, staged changes may be lost.
@@ -477,18 +484,15 @@ before that happens. If we have not yet moved away from commit `f`,
any of these will create a reference to it:
------------
-$ git checkout -b foo <1>
-$ git branch foo <2>
-$ git tag foo <3>
+$ git checkout -b foo # or "git switch -c foo" <1>
+$ git branch foo <2>
+$ git tag foo <3>
------------
-
<1> creates a new branch `foo`, which refers to commit `f`, and then
updates `HEAD` to refer to branch `foo`. In other words, we'll no longer
be in detached `HEAD` state after this command.
-
<2> similarly creates a new branch `foo`, which refers to commit `f`,
but leaves `HEAD` detached.
-
<3> creates a new tag `foo`, which refers to commit `f`,
leaving `HEAD` detached.
@@ -517,89 +521,101 @@ to checkout these paths out of the index.
EXAMPLES
--------
-. The following sequence checks out the `master` branch, reverts
- the `Makefile` to two revisions back, deletes `hello.c` by
- mistake, and gets it back from the index.
-+
+=== 1. Paths
+
+The following sequence checks out the `master` branch, reverts
+the `Makefile` to two revisions back, deletes `hello.c` by
+mistake, and gets it back from the index.
+
------------
$ git checkout master <1>
$ git checkout master~2 Makefile <2>
$ rm -f hello.c
$ git checkout hello.c <3>
------------
-+
<1> switch branch
<2> take a file out of another commit
<3> restore `hello.c` from the index
-+
+
If you want to check out _all_ C source files out of the index,
you can say
-+
+
------------
$ git checkout -- '*.c'
------------
-+
+
Note the quotes around `*.c`. The file `hello.c` will also be
checked out, even though it is no longer in the working tree,
because the file globbing is used to match entries in the index
(not in the working tree by the shell).
-+
+
If you have an unfortunate branch that is named `hello.c`, this
step would be confused as an instruction to switch to that branch.
You should instead write:
-+
+
------------
$ git checkout -- hello.c
------------
-. After working in the wrong branch, switching to the correct
- branch would be done using:
-+
+=== 2. Merge
+
+After working in the wrong branch, switching to the correct
+branch would be done using:
+
------------
$ git checkout mytopic
------------
-+
+
However, your "wrong" branch and correct `mytopic` branch may
differ in files that you have modified locally, in which case
the above checkout would fail like this:
-+
+
------------
$ git checkout mytopic
error: You have local changes to 'frotz'; not switching branches.
------------
-+
+
You can give the `-m` flag to the command, which would try a
three-way merge:
-+
+
------------
$ git checkout -m mytopic
Auto-merging frotz
------------
-+
+
After this three-way merge, the local modifications are _not_
registered in your index file, so `git diff` would show you what
changes you made since the tip of the new branch.
-. When a merge conflict happens during switching branches with
- the `-m` option, you would see something like this:
-+
+=== 3. Merge conflict
+
+When a merge conflict happens during switching branches with
+the `-m` option, you would see something like this:
+
------------
$ git checkout -m mytopic
Auto-merging frotz
ERROR: Merge conflict in frotz
fatal: merge program failed
------------
-+
+
At this point, `git diff` shows the changes cleanly merged as in
the previous example, as well as the changes in the conflicted
files. Edit and resolve the conflict and mark it resolved with
`git add` as usual:
-+
+
------------
$ edit frotz
$ git add frotz
------------
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/checkout.txt[]
+
SEE ALSO
--------
linkgit:git-switch[1],
diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt
index 78dcc91..81ace90 100644
--- a/Documentation/git-cherry-pick.txt
+++ b/Documentation/git-cherry-pick.txt
@@ -131,20 +131,36 @@ effect to your index in a row.
even without this option. Note also, that use of this option only
keeps commits that were initially empty (i.e. the commit recorded the
same tree as its parent). Commits which are made empty due to a
- previous commit are dropped. To force the inclusion of those commits
- use `--keep-redundant-commits`.
+ previous commit will cause the cherry-pick to fail. To force the
+ inclusion of those commits, use `--empty=keep`.
--allow-empty-message::
By default, cherry-picking a commit with an empty message will fail.
This option overrides that behavior, allowing commits with empty
messages to be cherry picked.
+--empty=(drop|keep|stop)::
+ How to handle commits being cherry-picked that are redundant with
+ changes already in the current history.
++
+--
+`drop`;;
+ The commit will be dropped.
+`keep`;;
+ The commit will be kept. Implies `--allow-empty`.
+`stop`;;
+ The cherry-pick will stop when the commit is applied, allowing
+ you to examine the commit. This is the default behavior.
+--
++
+Note that `--empty=drop` and `--empty=stop` only specify how to handle a
+commit that was not initially empty, but rather became empty due to a previous
+commit. Commits that were initially empty will still cause the cherry-pick to
+fail unless one of `--empty=keep` or `--allow-empty` are specified.
++
+
--keep-redundant-commits::
- If a commit being cherry picked duplicates a commit already in the
- current history, it will become empty. By default these
- redundant commits cause `cherry-pick` to stop so the user can
- examine the commit. This option overrides that behavior and
- creates an empty commit object. Implies `--allow-empty`.
+ Deprecated synonym for `--empty=keep`.
--strategy=<strategy>::
Use the given merge strategy. Should only be used once.
@@ -156,10 +172,7 @@ effect to your index in a row.
Pass the merge strategy-specific option through to the
merge strategy. See linkgit:git-merge[1] for details.
---rerere-autoupdate::
---no-rerere-autoupdate::
- Allow the rerere mechanism to update the index with the
- result of auto-conflict resolution if possible.
+include::rerere-options.txt[]
SEQUENCER SUBCOMMANDS
---------------------
@@ -222,7 +235,7 @@ again, this time exercising more care about matching up context lines.
------------
$ git cherry-pick topic^ <1>
$ git diff <2>
-$ git reset --merge ORIG_HEAD <3>
+$ git cherry-pick --abort <3>
$ git cherry-pick -Xpatience topic^ <4>
------------
<1> apply the change that would be shown by `git show topic^`.
diff --git a/Documentation/git-clean.txt b/Documentation/git-clean.txt
index a7f309d..fd17165 100644
--- a/Documentation/git-clean.txt
+++ b/Documentation/git-clean.txt
@@ -8,7 +8,7 @@ git-clean - Remove untracked files from the working tree
SYNOPSIS
--------
[verse]
-'git clean' [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <path>...
+'git clean' [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] [<pathspec>...]
DESCRIPTION
-----------
@@ -20,16 +20,16 @@ Normally, only files unknown to Git are removed, but if the `-x`
option is specified, ignored files are also removed. This can, for
example, be useful to remove all build products.
-If any optional `<path>...` arguments are given, only those paths
-are affected.
+If any optional `<pathspec>...` arguments are given, only those paths
+that match the pathspec are affected.
OPTIONS
-------
-d::
- Normally, when no <path> is specified, git clean will not
+ Normally, when no <pathspec> is specified, git clean will not
recurse into untracked directories to avoid removing too much.
Specify -d to have it recurse into such directories as well.
- If any paths are specified, -d is irrelevant; all untracked
+ If a <pathspec> is specified, -d is irrelevant; all untracked
files matching the specified paths (with exceptions for nested
git directories mentioned under `--force`) will be removed.
@@ -37,7 +37,7 @@ OPTIONS
--force::
If the Git configuration variable clean.requireForce is not set
to false, 'git clean' will refuse to delete files or directories
- unless given -f or -i. Git will refuse to modify untracked
+ unless given -f. Git will refuse to modify untracked
nested git repositories (directories with a .git subdirectory)
unless a second -f is given.
@@ -45,10 +45,14 @@ OPTIONS
--interactive::
Show what would be done and clean files interactively. See
``Interactive mode'' for details.
+ Configuration variable `clean.requireForce` is ignored, as
+ this mode gives its own safety protection by going interactive.
-n::
--dry-run::
Don't actually remove anything, just show what would be done.
+ Configuration variable `clean.requireForce` is ignored, as
+ nothing will be deleted anyway.
-q::
--quiet::
@@ -103,7 +107,7 @@ filter by pattern::
This shows the files and directories to be deleted and issues an
"Input ignore patterns>>" prompt. You can input space-separated
patterns to exclude files and directories from deletion.
- E.g. "*.c *.h" will excludes files end with ".c" and ".h" from
+ E.g. "*.c *.h" will exclude files ending with ".c" and ".h" from
deletion. When you are satisfied with the filtered result, press
ENTER (empty) back to the main menu.
@@ -127,12 +131,19 @@ ask each::
quit::
- This lets you quit without do cleaning.
+ This lets you quit without doing any cleaning.
help::
Show brief usage of interactive git-clean.
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/clean.txt[]
+
SEE ALSO
--------
linkgit:gitignore[5]
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 632bd13..5de18de 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -9,15 +9,15 @@ git-clone - Clone a repository into a new directory
SYNOPSIS
--------
[verse]
-'git clone' [--template=<template-directory>]
- [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
- [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
- [--dissociate] [--separate-git-dir <git-dir>]
- [--depth <depth>] [--[no-]single-branch] [--no-tags]
- [--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]
- [--[no-]remote-submodules] [--jobs <n>] [--sparse] [--[no-]reject-shallow]
- [--filter=<filter> [--also-filter-submodules]] [--] <repository>
- [<directory>]
+`git clone` [++--template=++__<template-directory>__]
+ [`-l`] [`-s`] [`--no-hardlinks`] [`-q`] [`-n`] [`--bare`] [`--mirror`]
+ [`-o` _<name>_] [`-b` _<name>_] [`-u` _<upload-pack>_] [`--reference` _<repository>_]
+ [`--dissociate`] [`--separate-git-dir` _<git-dir>_]
+ [`--depth` _<depth>_] [`--`[`no-`]`single-branch`] [`--no-tags`]
+ [++--recurse-submodules++[++=++__<pathspec>__]] [`--`[`no-`]`shallow-submodules`]
+ [`--`[`no-`]`remote-submodules`] [`--jobs` _<n>_] [`--sparse`] [`--`[`no-`]`reject-shallow`]
+ [++--filter=++__<filter-spec>__] [`--also-filter-submodules`]] [`--`] _<repository>_
+ [_<directory>_]
DESCRIPTION
-----------
@@ -31,7 +31,7 @@ currently active branch.
After the clone, a plain `git fetch` without arguments will update
all the remote-tracking branches, and a `git pull` without
arguments will in addition merge the remote master branch into the
-current master branch, if any (this is untrue when "--single-branch"
+current master branch, if any (this is untrue when `--single-branch`
is given; see below).
This default configuration is achieved by creating references to
@@ -42,12 +42,12 @@ configuration variables.
OPTIONS
-------
--l::
---local::
+`-l`::
+`--local`::
When the repository to clone from is on a local machine,
this flag bypasses the normal "Git aware" transport
mechanism and clones the repository by making a copy of
- HEAD and everything under objects and refs directories.
+ `HEAD` and everything under objects and refs directories.
The files under `.git/objects/` directory are hardlinked
to save space when possible.
+
@@ -58,18 +58,23 @@ never use the local optimizations). Specifying `--no-local` will
override the default when `/path/to/repo` is given, using the regular
Git transport instead.
+
+If the repository's `$GIT_DIR/objects` has symbolic links or is a
+symbolic link, the clone will fail. This is a security measure to
+prevent the unintentional copying of files by dereferencing the symbolic
+links.
++
*NOTE*: this operation can race with concurrent modification to the
source repository, similar to running `cp -r src dst` while modifying
`src`.
---no-hardlinks::
+`--no-hardlinks`::
Force the cloning process from a repository on a local
filesystem to copy the files under the `.git/objects`
directory instead of using hardlinks. This may be desirable
if you are trying to make a back-up of your repository.
--s::
---shared::
+`-s`::
+`--shared`::
When the repository to clone is on the local machine,
instead of using hard links, automatically setup
`.git/objects/info/alternates` to share the objects
@@ -96,10 +101,10 @@ If you want to break the dependency of a repository cloned with `--shared` on
its source repository, you can simply run `git repack -a` to copy all
objects from the source repository into a pack in the cloned repository.
---reference[-if-able] <repository>::
- If the reference repository is on the local machine,
+`--reference`[`-if-able`] _<repository>_::
+ If the reference _<repository>_ is on the local machine,
automatically setup `.git/objects/info/alternates` to
- obtain objects from the reference repository. Using
+ obtain objects from the reference _<repository>_. Using
an already existing repository as an alternate will
require fewer objects to be copied from the repository
being cloned, reducing network and local storage costs.
@@ -110,7 +115,7 @@ objects from the source repository into a pack in the cloned repository.
*NOTE*: see the NOTE for the `--shared` option, and also the
`--dissociate` option.
---dissociate::
+`--dissociate`::
Borrow the objects from reference repositories specified
with the `--reference` options only to reduce network
transfer, and stop borrowing from them after a clone is made
@@ -121,43 +126,43 @@ objects from the source repository into a pack in the cloned repository.
same repository, and this option can be used to stop the
borrowing.
--q::
---quiet::
+`-q`::
+`--quiet`::
Operate quietly. Progress is not reported to the standard
error stream.
--v::
---verbose::
+`-v`::
+`--verbose`::
Run verbosely. Does not affect the reporting of progress status
to the standard error stream.
---progress::
+`--progress`::
Progress status is reported on the standard error stream
by default when it is attached to a terminal, unless `--quiet`
is specified. This flag forces progress status even if the
standard error stream is not directed to a terminal.
---server-option=<option>::
+++--server-option=++__<option>__::
Transmit the given string to the server when communicating using
protocol version 2. The given string must not contain a NUL or LF
character. The server's handling of server options, including
unknown ones, is server-specific.
- When multiple `--server-option=<option>` are given, they are all
+ When multiple ++--server-option=++__<option>__ are given, they are all
sent to the other side in the order listed on the command line.
--n::
---no-checkout::
+`-n`::
+`--no-checkout`::
No checkout of HEAD is performed after the clone is complete.
---[no-]reject-shallow::
+`--`[`no-`]`reject-shallow`::
Fail if the source repository is a shallow repository.
- The 'clone.rejectShallow' configuration variable can be used to
+ The `clone.rejectShallow` configuration variable can be used to
specify the default.
---bare::
+`--bare`::
Make a 'bare' Git repository. That is, instead of
- creating `<directory>` and placing the administrative
- files in `<directory>/.git`, make the `<directory>`
+ creating _<directory>_ and placing the administrative
+ files in _<directory>_`/.git`, make the _<directory>_
itself the `$GIT_DIR`. This obviously implies the `--no-checkout`
because there is nowhere to check out the working tree.
Also the branch heads at the remote are copied directly
@@ -166,28 +171,28 @@ objects from the source repository into a pack in the cloned repository.
used, neither remote-tracking branches nor the related
configuration variables are created.
---sparse::
+`--sparse`::
Employ a sparse-checkout, with only files in the toplevel
directory initially being present. The
linkgit:git-sparse-checkout[1] command can be used to grow the
working directory as needed.
---filter=<filter-spec>::
+++--filter=++__<filter-spec>__::
Use the partial clone feature and request that the server sends
a subset of reachable objects according to a given object filter.
- When using `--filter`, the supplied `<filter-spec>` is used for
+ When using `--filter`, the supplied _<filter-spec>_ is used for
the partial clone filter. For example, `--filter=blob:none` will
filter out all blobs (file contents) until needed by Git. Also,
- `--filter=blob:limit=<size>` will filter out all blobs of size
- at least `<size>`. For more details on filter specifications, see
+ ++--filter=blob:limit=++__<size>__ will filter out all blobs of size
+ at least _<size>_. For more details on filter specifications, see
the `--filter` option in linkgit:git-rev-list[1].
---also-filter-submodules::
+`--also-filter-submodules`::
Also apply the partial clone filter to any submodules in the repository.
Requires `--filter` and `--recurse-submodules`. This can be turned on by
default by setting the `clone.filterSubmodules` config option.
---mirror::
+`--mirror`::
Set up a mirror of the source repository. This implies `--bare`.
Compared to `--bare`, `--mirror` not only maps local branches of the
source to local branches of the target, it maps all refs (including
@@ -195,37 +200,37 @@ objects from the source repository into a pack in the cloned repository.
that all these refs are overwritten by a `git remote update` in the
target repository.
--o <name>::
---origin <name>::
+`-o` _<name>_::
+`--origin` _<name>_::
Instead of using the remote name `origin` to keep track of the upstream
- repository, use `<name>`. Overrides `clone.defaultRemoteName` from the
+ repository, use _<name>_. Overrides `clone.defaultRemoteName` from the
config.
--b <name>::
---branch <name>::
+`-b` _<name>_::
+`--branch` _<name>_::
Instead of pointing the newly created HEAD to the branch pointed
- to by the cloned repository's HEAD, point to `<name>` branch
+ to by the cloned repository's HEAD, point to _<name>_ branch
instead. In a non-bare repository, this is the branch that will
be checked out.
`--branch` can also take tags and detaches the HEAD at that commit
in the resulting repository.
--u <upload-pack>::
---upload-pack <upload-pack>::
+`-u` _<upload-pack>_::
+`--upload-pack` _<upload-pack>_::
When given, and the repository to clone from is accessed
via ssh, this specifies a non-default path for the command
run on the other end.
---template=<template-directory>::
+++--template=++__<template-directory>__::
Specify the directory from which templates will be used;
(See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].)
--c <key>=<value>::
---config <key>=<value>::
+`-c` __<key>__++=++__<value>__::
+`--config` __<key>__++=++__<value>__::
Set a configuration variable in the newly-created repository;
this takes effect immediately after the repository is
initialized, but before the remote history is fetched or any
- files checked out. The key is in the same format as expected by
+ files checked out. The _<key>_ is in the same format as expected by
linkgit:git-config[1] (e.g., `core.eol=true`). If multiple
values are given for the same key, each value will be written to
the config file. This makes it safe, for example, to add
@@ -234,35 +239,35 @@ objects from the source repository into a pack in the cloned repository.
Due to limitations of the current implementation, some configuration
variables do not take effect until after the initial fetch and checkout.
Configuration variables known to not take effect are:
-`remote.<name>.mirror` and `remote.<name>.tagOpt`. Use the
+++remote.++__<name>__++.mirror++ and ++remote.++__<name>__++.tagOpt++. Use the
corresponding `--mirror` and `--no-tags` options instead.
---depth <depth>::
+`--depth` _<depth>_::
Create a 'shallow' clone with a history truncated to the
specified number of commits. Implies `--single-branch` unless
`--no-single-branch` is given to fetch the histories near the
tips of all branches. If you want to clone submodules shallowly,
also pass `--shallow-submodules`.
---shallow-since=<date>::
+++--shallow-since=++__<date>__::
Create a shallow clone with a history after the specified time.
---shallow-exclude=<revision>::
+++--shallow-exclude=++__<revision>__::
Create a shallow clone with a history, excluding commits
reachable from a specified remote branch or tag. This option
can be specified multiple times.
---[no-]single-branch::
+`--`[`no-`]`single-branch`::
Clone only the history leading to the tip of a single branch,
either specified by the `--branch` option or the primary
branch remote's `HEAD` points at.
Further fetches into the resulting repository will only update the
remote-tracking branch for the branch this option was used for the
- initial cloning. If the HEAD at the remote did not point at any
+ initial cloning. If the `HEAD` at the remote did not point at any
branch when `--single-branch` clone was made, no remote-tracking
branch is created.
---no-tags::
+`--no-tags`::
Don't clone any tags, and set
`remote.<remote>.tagOpt=--no-tags` in the config, ensuring
that future `git pull` and `git fetch` operations won't follow
@@ -274,9 +279,9 @@ maintain a branch with no references other than a single cloned
branch. This is useful e.g. to maintain minimal clones of the default
branch of some repository for search indexing.
---recurse-submodules[=<pathspec>]::
+`--recurse-submodules`[`=`{empty}__<pathspec>__]::
After the clone is created, initialize and clone submodules
- within based on the provided pathspec. If no pathspec is
+ within based on the provided _<pathspec>_. If no _=<pathspec>_ is
provided, all submodules are initialized and cloned.
This option can be given multiple times for pathspecs consisting
of multiple entries. The resulting clone has `submodule.active` set to
@@ -290,39 +295,52 @@ the clone is finished. This option is ignored if the cloned repository does
not have a worktree/checkout (i.e. if any of `--no-checkout`/`-n`, `--bare`,
or `--mirror` is given)
---[no-]shallow-submodules::
+`--`[`no-`]`shallow-submodules`::
All submodules which are cloned will be shallow with a depth of 1.
---[no-]remote-submodules::
+`--`[`no-`]`remote-submodules`::
All submodules which are cloned will use the status of the submodule's
remote-tracking branch to update the submodule, rather than the
superproject's recorded SHA-1. Equivalent to passing `--remote` to
`git submodule update`.
---separate-git-dir=<git-dir>::
+`--separate-git-dir=`{empty}__<git-dir>__::
Instead of placing the cloned repository where it is supposed
to be, place the cloned repository at the specified directory,
then make a filesystem-agnostic Git symbolic link to there.
The result is Git repository can be separated from working
tree.
--j <n>::
---jobs <n>::
+`--ref-format=`{empty}__<ref-format>__::
+
+Specify the given ref storage format for the repository. The valid values are:
++
+include::ref-storage-format.txt[]
+
+`-j` _<n>_::
+`--jobs` _<n>_::
The number of submodules fetched at the same time.
Defaults to the `submodule.fetchJobs` option.
-<repository>::
- The (possibly remote) repository to clone from. See the
+_<repository>_::
+ The (possibly remote) _<repository>_ to clone from. See the
<<URLS,GIT URLS>> section below for more information on specifying
repositories.
-<directory>::
+_<directory>_::
The name of a new directory to clone into. The "humanish"
- part of the source repository is used if no directory is
+ part of the source repository is used if no _<directory>_ is
explicitly given (`repo` for `/path/to/repo.git` and `foo`
for `host.xz:foo/.git`). Cloning into an existing directory
is only allowed if the directory is empty.
+`--bundle-uri=`{empty}__<uri>__::
+ Before fetching from the remote, fetch a bundle from the given
+ _<uri>_ and unbundle the data into the local repository. The refs
+ in the bundle will be stored under the hidden `refs/bundle/*`
+ namespace. This option is incompatible with `--depth`,
+ `--shallow-since`, and `--shallow-exclude`.
+
:git-clone: 1
include::urls.txt[]
@@ -363,6 +381,15 @@ $ cd my-linux
$ git clone --bare -l /home/proj/.git /pub/scm/proj.git
------------
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/init.txt[]
+
+include::config/clone.txt[]
+
GIT
---
diff --git a/Documentation/git-column.txt b/Documentation/git-column.txt
index 6cea9ab..1843164 100644
--- a/Documentation/git-column.txt
+++ b/Documentation/git-column.txt
@@ -74,6 +74,13 @@ v2.4.3 v2.4.4 v2.4.5 v2.4.6 v2.4.7
v2.4.8 v2.4.9
------------
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/column.txt[]
+
GIT
---
Part of the linkgit:git[1] suite
diff --git a/Documentation/git-commit-graph.txt b/Documentation/git-commit-graph.txt
index e1f48c9..903b168 100644
--- a/Documentation/git-commit-graph.txt
+++ b/Documentation/git-commit-graph.txt
@@ -10,7 +10,10 @@ SYNOPSIS
--------
[verse]
'git commit-graph verify' [--object-dir <dir>] [--shallow] [--[no-]progress]
-'git commit-graph write' <options> [--object-dir <dir>] [--[no-]progress]
+'git commit-graph write' [--object-dir <dir>] [--append]
+ [--split[=<strategy>]] [--reachable | --stdin-packs | --stdin-commits]
+ [--changed-paths] [--[no-]max-new-filters <n>] [--[no-]progress]
+ <split-options>
DESCRIPTION
@@ -142,6 +145,18 @@ $ git show-ref -s | git commit-graph write --stdin-commits
$ git rev-parse HEAD | git commit-graph write --stdin-commits --append
------------------------------------------------
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/commitgraph.txt[]
+
+
+FILE FORMAT
+-----------
+
+see linkgit:gitformat-commit-graph[5].
GIT
---
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index 6c60bf9..89ecfc6 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -347,6 +347,8 @@ The possible options are:
- '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
configuration variable documented in linkgit:git-config[1].
--
@@ -541,7 +543,7 @@ DISCUSSION
----------
Though not required, it's a good idea to begin the commit message
-with a single short (less than 50 character) line summarizing the
+with a single short (no more than 50 characters) line summarizing the
change, followed by a blank line and then a more thorough description.
The text up to the first blank line in a commit message is treated
as the commit title, and that title is used throughout Git.
@@ -557,6 +559,10 @@ The editor used to edit the commit log message will be chosen from the
`VISUAL` environment variable, or the `EDITOR` environment variable (in that
order). See linkgit:git-var[1] for details.
+include::includes/cmd-config-section-rest.txt[]
+
+include::config/commit.txt[]
+
HOOKS
-----
This command can run `commit-msg`, `prepare-commit-msg`, `pre-commit`,
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 9376e39..ac61113 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -9,9 +9,9 @@ git-config - Get and set repository or global options
SYNOPSIS
--------
[verse]
-'git config' [<file-option>] [--type=<type>] [--fixed-value] [--show-origin] [--show-scope] [-z|--null] <name> [<value> [<value-pattern>]]
-'git config' [<file-option>] [--type=<type>] --add <name> <value>
-'git config' [<file-option>] [--type=<type>] [--fixed-value] --replace-all <name> <value> [<value-pattern>]
+'git config' [<file-option>] [--type=<type>] [--comment=<message>] [--fixed-value] [--show-origin] [--show-scope] [-z|--null] <name> [<value> [<value-pattern>]]
+'git config' [<file-option>] [--type=<type>] [--comment=<message>] --add <name> <value>
+'git config' [<file-option>] [--type=<type>] [--comment=<message>] [--fixed-value] --replace-all <name> <value> [<value-pattern>]
'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] --get <name> [<value-pattern>]
'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] --get-all <name> [<value-pattern>]
'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] [--name-only] --get-regexp <name-regex> [<value-pattern>]
@@ -87,6 +87,18 @@ OPTIONS
values. This is the same as providing '^$' as the `value-pattern`
in `--replace-all`.
+--comment <message>::
+ Append a comment at the end of new or modified lines.
+
+ If _<message>_ begins with one or more whitespaces followed
+ by "#", it is used as-is. If it begins with "#", a space is
+ prepended before it is used. Otherwise, a string " # " (a
+ space followed by a hash followed by a space) is prepended
+ to it. And the resulting string is placed immediately after
+ the value defined for the variable. The _<message>_ must
+ not contain linefeed characters (no multi-line comments are
+ permitted).
+
--get::
Get the value for a given key (optionally filtered by a regex
matching the value). Returns error code 1 if the key was not
@@ -103,11 +115,11 @@ OPTIONS
names are not.
--get-urlmatch <name> <URL>::
- When given a two-part name section.key, the value for
- section.<URL>.key whose <URL> part matches the best to the
+ When given a two-part <name> as <section>.<key>, the value for
+ <section>.<URL>.<key> whose <URL> part matches the best to the
given URL is returned (if no such key exists, the value for
- section.key is used as a fallback). When given just the
- section as name, do so for all the keys in the section and
+ <section>.<key> is used as a fallback). When given just the
+ <section> as name, do so for all the keys in the section and
list them. Returns error code 1 if no value is found.
--global::
@@ -201,7 +213,7 @@ Valid `<type>`'s include:
1073741824 upon input.
- 'bool-or-int': canonicalize according to either 'bool' or 'int', as described
above.
-- 'path': canonicalize by adding a leading `~` to the value of `$HOME` and
+- 'path': canonicalize by expanding a leading `~` to the value of `$HOME` and
`~user` to the home directory for the specified user. This specifier has no
effect when setting the value (but you can use `git config section.variable
~/` from the command line to let your shell do the expansion.)
@@ -275,7 +287,8 @@ Valid `<type>`'s include:
-e::
--edit::
Opens an editor to modify the specified config file; either
- `--system`, `--global`, or repository (default).
+ `--system`, `--global`, `--local` (default), `--worktree`, or
+ `--file <config-file>`.
--[no-]includes::
Respect `include.*` directives in config files when looking up
@@ -285,7 +298,7 @@ Valid `<type>`'s include:
--default <value>::
When using `--get`, and the requested variable is not found, behave as if
- <value> were the value assigned to the that variable.
+ <value> were the value assigned to that variable.
CONFIGURATION
-------------
@@ -297,23 +310,20 @@ The default is to use a pager.
FILES
-----
-If not set explicitly with `--file`, there are four files where
-'git config' will search for configuration options:
+By default, 'git config' will read configuration options from multiple
+files:
$(prefix)/etc/gitconfig::
System-wide configuration file.
$XDG_CONFIG_HOME/git/config::
- Second user-specific configuration file. If $XDG_CONFIG_HOME is not set
- or empty, `$HOME/.config/git/config` will be used. Any single-valued
- variable set in this file will be overwritten by whatever is in
- `~/.gitconfig`. It is a good idea not to create this file if
- you sometimes use older versions of Git, as support for this
- file was added fairly recently.
-
~/.gitconfig::
- User-specific configuration file. Also called "global"
- configuration file.
+ User-specific configuration files. When the XDG_CONFIG_HOME environment
+ variable is not set or empty, $HOME/.config/ is used as
+ $XDG_CONFIG_HOME.
++
+These are also called "global" configuration files. If both files exist, both
+files are read in the order given above.
$GIT_DIR/config::
Repository specific configuration file.
@@ -322,28 +332,80 @@ $GIT_DIR/config.worktree::
This is optional and is only searched when
`extensions.worktreeConfig` is present in $GIT_DIR/config.
-If no further options are given, all reading options will read all of these
-files that are available. If the global or the system-wide configuration
-file are not available they will be ignored. If the repository configuration
-file is not available or readable, 'git config' will exit with a non-zero
-error code. However, in neither case will an error message be issued.
+You may also provide additional configuration parameters when running any
+git command by using the `-c` option. See linkgit:git[1] for details.
+
+Options will be read from all of these files that are available. If the
+global or the system-wide configuration files are missing or unreadable they
+will be ignored. If the repository configuration file is missing or unreadable,
+'git config' will exit with a non-zero error code. An error message is produced
+if the file is unreadable, but not if it is missing.
The files are read in the order given above, with last value found taking
precedence over values read earlier. When multiple values are taken then all
values of a key from all files will be used.
-You may override individual configuration parameters when running any git
-command by using the `-c` option. See linkgit:git[1] for details.
-
-All writing options will per default write to the repository specific
+By default, options are only written to the repository specific
configuration file. Note that this also affects options like `--replace-all`
and `--unset`. *'git config' will only ever change one file at a time*.
-You can override these rules using the `--global`, `--system`,
-`--local`, `--worktree`, and `--file` command-line options; see
-<<OPTIONS>> above.
+You can limit which configuration sources are read from or written to by
+specifying the path of a file with the `--file` option, or by specifying a
+configuration scope with `--system`, `--global`, `--local`, or `--worktree`.
+For more, see <<OPTIONS>> above.
+
+[[SCOPES]]
+SCOPES
+------
+
+Each configuration source falls within a configuration scope. The scopes
+are:
+
+system::
+ $(prefix)/etc/gitconfig
+
+global::
+ $XDG_CONFIG_HOME/git/config
++
+~/.gitconfig
+
+local::
+ $GIT_DIR/config
+
+worktree::
+ $GIT_DIR/config.worktree
+
+command::
+ GIT_CONFIG_{COUNT,KEY,VALUE} environment variables (see <<ENVIRONMENT>>
+ below)
++
+the `-c` option
+
+With the exception of 'command', each scope corresponds to a command line
+option: `--system`, `--global`, `--local`, `--worktree`.
+
+When reading options, specifying a scope will only read options from the
+files within that scope. When writing options, specifying a scope will write
+to the files within that scope (instead of the repository specific
+configuration file). See <<OPTIONS>> above for a complete description.
+
+Most configuration options are respected regardless of the scope it is
+defined in, but some options are only respected in certain scopes. See the
+respective option's documentation for the full details.
+
+Protected configuration
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Protected configuration refers to the 'system', 'global', and 'command' scopes.
+For security reasons, certain options are only respected when they are
+specified in protected configuration, and ignored otherwise.
+Git treats these scopes as if they are controlled by the user or a trusted
+administrator. This is because an attacker who controls these scopes can do
+substantial harm without using Git, so it is assumed that the user's environment
+protects these scopes against attackers.
+[[ENVIRONMENT]]
ENVIRONMENT
-----------
diff --git a/Documentation/git-count-objects.txt b/Documentation/git-count-objects.txt
index cb9b4d2..97f9f12 100644
--- a/Documentation/git-count-objects.txt
+++ b/Documentation/git-count-objects.txt
@@ -12,7 +12,7 @@ SYNOPSIS
DESCRIPTION
-----------
-This counts the number of unpacked object files and disk space consumed by
+Counts the number of unpacked object files and disk space consumed by
them, to help you decide when it is a good time to repack.
@@ -20,7 +20,7 @@ OPTIONS
-------
-v::
--verbose::
- Report in more detail:
+ Provide more detailed reports:
+
count: the number of loose objects
+
@@ -33,7 +33,7 @@ size-pack: disk space consumed by the packs, in KiB (unless -H is specified)
prune-packable: the number of loose objects that are also present in
the packs. These objects could be pruned using `git prune-packed`.
+
-garbage: the number of files in object database that are neither valid loose
+garbage: the number of files in the object database that are neither valid loose
objects nor valid packs
+
size-garbage: disk space consumed by garbage files, in KiB (unless -H is
diff --git a/Documentation/git-credential-cache--daemon.txt b/Documentation/git-credential-cache--daemon.txt
index 01e1c21..650a15a 100644
--- a/Documentation/git-credential-cache--daemon.txt
+++ b/Documentation/git-credential-cache--daemon.txt
@@ -8,7 +8,7 @@ git-credential-cache--daemon - Temporarily store user credentials in memory
SYNOPSIS
--------
[verse]
-'git credential-cache{litdd}daemon' [--debug] <socket>
+'git credential-cache{litdd}daemon' [--debug] <socket-path>
DESCRIPTION
-----------
@@ -16,7 +16,7 @@ DESCRIPTION
NOTE: You probably don't want to invoke this command yourself; it is
started automatically when you use linkgit:git-credential-cache[1].
-This command listens on the Unix domain socket specified by `<socket>`
+This command listens on the Unix domain socket specified by `<socket-path>`
for `git-credential-cache` clients. Clients may store and retrieve
credentials. Each credential is held for a timeout specified by the
client; once no credentials are held, the daemon exits.
diff --git a/Documentation/git-credential-cache.txt b/Documentation/git-credential-cache.txt
index 0216c18..487cc55 100644
--- a/Documentation/git-credential-cache.txt
+++ b/Documentation/git-credential-cache.txt
@@ -14,10 +14,13 @@ git config credential.helper 'cache [<options>]'
DESCRIPTION
-----------
-This command caches credentials in memory for use by future Git
-programs. The stored credentials never touch the disk, and are forgotten
-after a configurable timeout. The cache is accessible over a Unix
-domain socket, restricted to the current user by filesystem permissions.
+This command caches credentials for use by future Git programs.
+The stored credentials are kept in memory of the cache-daemon
+process (instead of being written to a file) and are forgotten after a
+configurable timeout. Credentials are forgotten sooner if the
+cache-daemon dies, for example if the system restarts. The cache
+is accessible over a Unix domain socket, restricted to the current
+user by filesystem permissions.
You probably don't want to invoke this command directly; it is meant to
be used as a credential helper by other parts of Git. See
@@ -69,10 +72,10 @@ $ git push http://example.com/repo.git
------------------------------------
You can provide options via the credential.helper configuration
-variable (this example drops the cache time to 5 minutes):
+variable (this example increases the cache time to 1 hour):
-------------------------------------------------------
-$ git config credential.helper 'cache --timeout=300'
+$ git config credential.helper 'cache --timeout=3600'
-------------------------------------------------------
GIT
diff --git a/Documentation/git-credential-store.txt b/Documentation/git-credential-store.txt
index 76b0798..71864a8 100644
--- a/Documentation/git-credential-store.txt
+++ b/Documentation/git-credential-store.txt
@@ -33,7 +33,7 @@ OPTIONS
Use `<path>` to lookup and store credentials. The file will have its
filesystem permissions set to prevent other users on the system
- from reading it, but will not be encrypted or otherwise
+ from reading it, but it will not be encrypted or otherwise
protected. If not specified, credentials will be searched for from
`~/.git-credentials` and `$XDG_CONFIG_HOME/git/credentials`, and
credentials will be written to `~/.git-credentials` if it exists, or
diff --git a/Documentation/git-credential.txt b/Documentation/git-credential.txt
index f186730..918a0aa 100644
--- a/Documentation/git-credential.txt
+++ b/Documentation/git-credential.txt
@@ -39,7 +39,7 @@ for later use.
If the action is `reject`, git-credential will send the description to
any configured credential helpers, which may erase any stored
-credential matching the description.
+credentials matching the description.
If the action is `approve` or `reject`, no output should be emitted.
@@ -94,7 +94,7 @@ unlocked) before it returned `password=secr3t`.
that `git credential` will ask for a new password in its next
invocation. In either case, `git credential` should be fed with
the credential description obtained from step (2) (which also
- contain the ones provided in step (1)).
+ contains the fields provided in step (1)).
[[IOFMT]]
INPUT/OUTPUT FORMAT
@@ -113,7 +113,13 @@ separated by an `=` (equals) sign, followed by a newline.
The key may contain any bytes except `=`, newline, or NUL. The value may
contain any bytes except newline or NUL.
-In both cases, all bytes are treated as-is (i.e., there is no quoting,
+Attributes with keys that end with C-style array brackets `[]` can have
+multiple values. Each instance of a multi-valued attribute forms an
+ordered list of values - the order of the repeated attributes defines
+the order of the values. An empty multi-valued attribute (`key[]=\n`)
+acts to clear any previous entries and reset the list.
+
+In all cases, all bytes are treated as-is (i.e., there is no quoting,
and one cannot transmit a value with newline or NUL in it). The list of
attributes is terminated by a blank line or end-of-file.
@@ -144,6 +150,18 @@ Git understands the following attributes:
The credential's password, if we are asking it to be stored.
+`password_expiry_utc`::
+
+ Generated passwords such as an OAuth access token may have an expiry date.
+ When reading credentials from helpers, `git credential fill` ignores expired
+ passwords. Represented as Unix time UTC, seconds since 1970.
+
+`oauth_refresh_token`::
+
+ An OAuth refresh token may accompany a password that is an OAuth access
+ token. Helpers must treat this attribute as confidential like the password
+ attribute. Git itself has no special behaviour for this attribute.
+
`url`::
When this special attribute is read by `git credential`, the
@@ -160,6 +178,19 @@ empty string.
Components which are missing from the URL (e.g., there is no
username in the example above) will be left unset.
+`wwwauth[]`::
+
+ When an HTTP response is received by Git that includes one or more
+ 'WWW-Authenticate' authentication headers, these will be passed by Git
+ to credential helpers.
++
+Each 'WWW-Authenticate' header value is passed as a multi-valued
+attribute 'wwwauth[]', where the order of the attributes is the same as
+they appear in the HTTP response. This attribute is 'one-way' from Git
+to pass additional information to credential helpers.
+
+Unrecognised attributes are silently discarded.
+
GIT
---
Part of the linkgit:git[1] suite
diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt
index b3f2767..90fdc25 100644
--- a/Documentation/git-cvsimport.txt
+++ b/Documentation/git-cvsimport.txt
@@ -22,7 +22,7 @@ DESCRIPTION
deprecated; it does not work with cvsps version 3 and later. If you are
performing a one-shot import of a CVS repository consider using
http://cvs2svn.tigris.org/cvs2git.html[cvs2git] or
-http://www.catb.org/esr/cvs-fast-export/[cvs-fast-export].
+https://gitlab.com/esr/cvs-fast-export[cvs-fast-export].
Imports a CVS repository into Git. It will either create a new
repository, or incrementally import into an existing one.
@@ -221,7 +221,7 @@ Problems related to tags:
If you suspect that any of these issues may apply to the repository you
want to import, consider using cvs2git:
-* cvs2git (part of cvs2svn), `http://subversion.apache.org/`
+* cvs2git (part of cvs2svn), `https://subversion.apache.org/`
GIT
---
diff --git a/Documentation/git-cvsserver.txt b/Documentation/git-cvsserver.txt
index 53f111b..4c475ef 100644
--- a/Documentation/git-cvsserver.txt
+++ b/Documentation/git-cvsserver.txt
@@ -118,7 +118,7 @@ for example:
myuser:$5$.NqmNH1vwfzGpV8B$znZIcumu1tNLATgV2l6e1/mY8RzhUDHMOaVOeL1cxV3
------
You can use the 'htpasswd' facility that comes with Apache to make these
-files, but only with the -d option (or -B if your system suports it).
+files, but only with the -d option (or -B if your system supports it).
Preferably use the system specific utility that manages password hash
creation in your platform (e.g. mkpasswd in Linux, encrypt in OpenBSD or
@@ -197,7 +197,7 @@ allowing access over SSH.
5. Clients should now be able to check out the project. Use the CVS 'module'
name to indicate what Git 'head' you want to check out. This also sets the
name of your newly checked-out directory, unless you tell it otherwise with
- `-d <dir_name>`. For example, this checks out 'master' branch to the
+ `-d <dir-name>`. For example, this checks out 'master' branch to the
`project-master` directory:
+
------
@@ -224,7 +224,7 @@ the database to work reliably (otherwise you need to make sure
that the database is up to date any time 'git-cvsserver' is executed).
By default it uses SQLite databases in the Git directory, named
-`gitcvs.<module_name>.sqlite`. Note that the SQLite backend creates
+`gitcvs.<module-name>.sqlite`. Note that the SQLite backend creates
temporary files in the same directory as the database file on
write so it might not be enough to grant the users using
'git-cvsserver' write access to the database file without granting
diff --git a/Documentation/git-daemon.txt b/Documentation/git-daemon.txt
index 236df51..ede7b93 100644
--- a/Documentation/git-daemon.txt
+++ b/Documentation/git-daemon.txt
@@ -18,7 +18,7 @@ SYNOPSIS
[--allow-override=<service>] [--forbid-override=<service>]
[--access-hook=<path>] [--[no-]informative-errors]
[--inetd |
- [--listen=<host_or_ipaddr>] [--port=<n>]
+ [--listen=<host-or-ipaddr>] [--port=<n>]
[--user=<user> [--group=<group>]]]
[--log-destination=(stderr|syslog|none)]
[<directory>...]
@@ -86,10 +86,10 @@ OPTIONS
Incompatible with --detach, --port, --listen, --user and --group
options.
---listen=<host_or_ipaddr>::
+--listen=<host-or-ipaddr>::
Listen on a specific IP address or hostname. IP addresses can
be either an IPv4 address or an IPv6 address if supported. If IPv6
- is not supported, then --listen=hostname is also not supported and
+ is not supported, then --listen=<hostname> is also not supported and
--listen must be given an IPv4 address.
Can be given more than once.
Incompatible with `--inetd` option.
@@ -138,11 +138,11 @@ otherwise `stderr`.
--user-path::
--user-path=<path>::
Allow {tilde}user notation to be used in requests. When
- specified with no parameter, requests to
+ specified with no parameter, a request to
git://host/{tilde}alice/foo is taken as a request to access
'foo' repository in the home directory of user `alice`.
- If `--user-path=path` is specified, the same request is
- taken as a request to access `path/foo` repository in
+ If `--user-path=<path>` is specified, the same request is
+ taken as a request to access `<path>/foo` repository in
the home directory of user `alice`.
--verbose::
diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt
index c6a79c2..08ff715 100644
--- a/Documentation/git-describe.txt
+++ b/Documentation/git-describe.txt
@@ -140,7 +140,7 @@ at the end.
The number of additional commits is the number
of commits which would be displayed by "git log v1.0.4..parent".
-The hash suffix is "-g" + an unambigous abbreviation for the tip commit
+The hash suffix is "-g" + an unambiguous abbreviation for the tip commit
of parent (which was `2414721b194453f058079d897d13c4e377f92dc6`). The
length of the abbreviation scales as the repository grows, using the
approximate number of objects in the repository and a bit of math
@@ -203,7 +203,7 @@ BUGS
Tree objects as well as tag objects not pointing at commits, cannot be described.
When describing blobs, the lightweight tags pointing at blobs are ignored,
-but the blob is still described as <committ-ish>:<path> despite the lightweight
+but the blob is still described as <commit-ish>:<path> despite the lightweight
tag being favorable.
GIT
diff --git a/Documentation/git-diagnose.txt b/Documentation/git-diagnose.txt
new file mode 100644
index 0000000..0711959
--- /dev/null
+++ b/Documentation/git-diagnose.txt
@@ -0,0 +1,65 @@
+git-diagnose(1)
+================
+
+NAME
+----
+git-diagnose - Generate a zip archive of diagnostic information
+
+SYNOPSIS
+--------
+[verse]
+'git diagnose' [(-o | --output-directory) <path>] [(-s | --suffix) <format>]
+ [--mode=<mode>]
+
+DESCRIPTION
+-----------
+Collects detailed information about the user's machine, Git client, and
+repository state and packages that information into a zip archive. The
+generated archive can then, for example, be shared with the Git mailing list to
+help debug an issue or serve as a reference for independent debugging.
+
+By default, the following information is captured in the archive:
+
+ * 'git version --build-options'
+ * The path to the repository root
+ * The available disk space on the filesystem
+ * The name and size of each packfile, including those in alternate object
+ stores
+ * The total count of loose objects, as well as counts broken down by
+ `.git/objects` subdirectory
+
+Additional information can be collected by selecting a different diagnostic mode
+using the `--mode` option.
+
+This tool differs from linkgit:git-bugreport[1] in that it collects much more
+detailed information with a greater focus on reporting the size and data shape
+of repository contents.
+
+OPTIONS
+-------
+-o <path>::
+--output-directory <path>::
+ Place the resulting diagnostics archive in `<path>` instead of the
+ current directory.
+
+-s <format>::
+--suffix <format>::
+ Specify an alternate suffix for the diagnostics archive name, to create
+ a file named 'git-diagnostics-<formatted-suffix>'. This should take the
+ form of a strftime(3) format string; the current local time will be
+ used.
+
+--mode=(stats|all)::
+ Specify the type of diagnostics that should be collected. The default behavior
+ of 'git diagnose' is equivalent to `--mode=stats`.
++
+The `--mode=all` option collects everything included in `--mode=stats`, as well
+as copies of `.git`, `.git/hooks`, `.git/info`, `.git/logs`, and
+`.git/objects/info` directories. This additional information may be sensitive,
+as it can be used to reconstruct the full contents of the diagnosed repository.
+Users should exercise caution when sharing an archive generated with
+`--mode=all`.
+
+GIT
+---
+Part of the linkgit:git[1] suite
diff --git a/Documentation/git-diff-files.txt b/Documentation/git-diff-files.txt
index bf1febb..bf78e31 100644
--- a/Documentation/git-diff-files.txt
+++ b/Documentation/git-diff-files.txt
@@ -9,7 +9,7 @@ git-diff-files - Compares files in the working tree and the index
SYNOPSIS
--------
[verse]
-'git diff-files' [-q] [-0|-1|-2|-3|-c|--cc] [<common-diff-options>] [<path>...]
+'git diff-files' [-q] [-0 | -1 | -2 | -3 | -c | --cc] [<common-diff-options>] [<path>...]
DESCRIPTION
-----------
@@ -26,7 +26,7 @@ include::diff-options.txt[]
-2 --ours::
-3 --theirs::
-0::
- Diff against the "base" version, "our branch" or "their
+ Diff against the "base" version, "our branch", or "their
branch" respectively. With these options, diffs for
merged entries are not shown.
+
@@ -37,12 +37,12 @@ omit diff output for unmerged entries and just show "Unmerged".
-c::
--cc::
This compares stage 2 (our branch), stage 3 (their
- branch) and the working tree file and outputs a combined
+ branch), and the working tree file and outputs a combined
diff, similar to the way 'diff-tree' shows a merge
commit with these flags.
-q::
- Remain silent even on nonexistent files
+ Remain silent even for nonexistent files
include::diff-format.txt[]
diff --git a/Documentation/git-diff-index.txt b/Documentation/git-diff-index.txt
index c30d8f0..4de1d4c 100644
--- a/Documentation/git-diff-index.txt
+++ b/Documentation/git-diff-index.txt
@@ -13,10 +13,10 @@ SYNOPSIS
DESCRIPTION
-----------
-Compares the content and mode of the blobs found in a tree object
+Compare the content and mode of the blobs found in a tree object
with the corresponding tracked files in the working tree, or with the
corresponding paths in the index. When <path> arguments are present,
-compares only paths matching those patterns. Otherwise all tracked
+compare only paths matching those patterns. Otherwise all tracked
files are compared.
OPTIONS
diff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt
index 274d5ea..143318c 100644
--- a/Documentation/git-diff-tree.txt
+++ b/Documentation/git-diff-tree.txt
@@ -15,7 +15,7 @@ SYNOPSIS
DESCRIPTION
-----------
-Compares the content and mode of the blobs found via two tree objects.
+Compare the content and mode of blobs found via two tree objects.
If there is only one <tree-ish> given, the commit is compared with its parents
(see --stdin below).
@@ -34,10 +34,10 @@ include::diff-options.txt[]
matching one of the provided pathspecs.
-r::
- recurse into sub-trees
+ Recurse into sub-trees.
-t::
- show tree entry itself as well as subtrees. Implies -r.
+ Show tree entry itself as well as subtrees. Implies -r.
--root::
When `--root` is specified the initial commit will be shown as a big
@@ -78,7 +78,7 @@ commits (but not trees).
By default, 'git diff-tree --stdin' shows differences,
either in machine-readable form (without `-p`) or in patch
form (with `-p`). This output can be suppressed. It is
- only useful with `-v` flag.
+ only useful with the `-v` flag.
-v::
This flag causes 'git diff-tree --stdin' to also show
@@ -104,10 +104,10 @@ include::pretty-options.txt[]
This flag changes the way a merge commit patch is displayed,
in a similar way to the `-c` option. It implies the `-c`
and `-p` options and further compresses the patch output
- by omitting uninteresting hunks whose the contents in the parents
+ by omitting uninteresting hunks whose contents in the parents
have only two variants and the merge result picks one of them
without modification. When all hunks are uninteresting, the commit
- itself and the commit log message is not shown, just like in any other
+ itself and the commit log message are not shown, just like in any other
"empty diff" case.
--combined-all-paths::
diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt
index 6236c75..c065f02 100644
--- a/Documentation/git-diff.txt
+++ b/Documentation/git-diff.txt
@@ -79,10 +79,10 @@ If --merge-base is given, use the merge base of the two commits for the
This form is to view the results of a merge commit. The first
listed <commit> must be the merge itself; the remaining two or
- more commits should be its parents. A convenient way to produce
- the desired set of revisions is to use the `^@` suffix.
- For instance, if `master` names a merge commit, `git diff master
- master^@` gives the same combined diff as `git show master`.
+ more commits should be its parents. Convenient ways to produce
+ the desired set of revisions are to use the suffixes `^@` and
+ `^!`. If A is a merge commit, then `git diff A A^@`,
+ `git diff A^!` and `git show A` all give the same combined diff.
'git diff' [<options>] <commit>..<commit> [--] [<path>...]::
@@ -102,7 +102,11 @@ If --merge-base is given, use the merge base of the two commits for the
Just in case you are doing something exotic, it should be
noted that all of the <commit> in the above description, except
in the `--merge-base` case and in the last two forms that use `..`
-notations, can be any <tree>.
+notations, can be any <tree>. A tree of interest is the one pointed to
+by the ref named `AUTO_MERGE`, which is written by the 'ort' merge
+strategy upon hitting merge conflicts (see linkgit:git-merge[1]).
+Comparing the working tree with `AUTO_MERGE` shows changes you've made
+so far to resolve textual conflicts (see the examples below).
For a more complete list of ways to spell <commit>, see
"SPECIFYING REVISIONS" section in linkgit:gitrevisions[7].
@@ -152,6 +156,7 @@ Various ways to check your working tree::
$ git diff <1>
$ git diff --cached <2>
$ git diff HEAD <3>
+$ git diff AUTO_MERGE <4>
------------
+
<1> Changes in the working tree not yet staged for the next commit.
@@ -159,6 +164,8 @@ $ git diff HEAD <3>
would be committing if you run `git commit` without `-a` option.
<3> Changes in the working tree since your last commit; what you
would be committing if you run `git commit -a`
+<4> Changes in the working tree you've made to resolve textual
+ conflicts so far.
Comparing with arbitrary commits::
+
@@ -213,6 +220,13 @@ $ git diff -R <2>
rewrites (very expensive).
<2> Output diff in reverse.
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/diff.txt[]
+
SEE ALSO
--------
diff(1),
diff --git a/Documentation/git-difftool.txt b/Documentation/git-difftool.txt
index 143b0c4..a616f8b 100644
--- a/Documentation/git-difftool.txt
+++ b/Documentation/git-difftool.txt
@@ -36,7 +36,7 @@ OPTIONS
--rotate-to=<file>::
Start showing the diff for the given path,
- the paths before it will move to end and output.
+ the paths before it will move to the end and output.
--skip-to=<file>::
Start showing the diff for the given path, skipping all
@@ -78,7 +78,7 @@ with custom merge tool commands and has the same value as `$MERGED`.
Print a list of diff tools that may be used with `--tool`.
--[no-]symlinks::
- 'git difftool''s default behavior is create symlinks to the
+ 'git difftool''s default behavior is to create symlinks to the
working tree when run in `--dir-diff` mode and the right-hand
side of the comparison yields the same content as the file in
the working tree.
@@ -90,20 +90,21 @@ instead. `--no-symlinks` is the default on Windows.
--extcmd=<command>::
Specify a custom command for viewing diffs.
'git-difftool' ignores the configured defaults and runs
- `$command $LOCAL $REMOTE` when this option is specified.
+ `<command> $LOCAL $REMOTE` when this option is specified.
Additionally, `$BASE` is set in the environment.
-g::
--[no-]gui::
When 'git-difftool' is invoked with the `-g` or `--gui` option
the default diff tool will be read from the configured
- `diff.guitool` variable instead of `diff.tool`. The `--no-gui`
- option can be used to override this setting. If `diff.guitool`
- is not set, we will fallback in the order of `merge.guitool`,
- `diff.tool`, `merge.tool` until a tool is found.
+ `diff.guitool` variable instead of `diff.tool`. This may be
+ selected automatically using the configuration variable
+ `difftool.guiDefault`. The `--no-gui` option can be used to
+ override these settings. If `diff.guitool` is not set, we will
+ fallback in the order of `merge.guitool`, `diff.tool`,
+ `merge.tool` until a tool is found.
--[no-]trust-exit-code::
- 'git-difftool' invokes a diff tool individually on each file.
Errors reported by the diff tool are ignored by default.
Use `--trust-exit-code` to make 'git-difftool' exit when an
invoked diff tool returns a non-zero exit code.
@@ -113,33 +114,14 @@ instead. `--no-symlinks` is the default on Windows.
See linkgit:git-diff[1] for the full list of supported options.
-CONFIG VARIABLES
-----------------
+CONFIGURATION
+-------------
'git difftool' falls back to 'git mergetool' config variables when the
difftool equivalents have not been defined.
-diff.tool::
- The default diff tool to use.
+include::includes/cmd-config-section-rest.txt[]
-diff.guitool::
- The default diff tool to use when `--gui` is specified.
-
-difftool.<tool>.path::
- Override the path for the given tool. This is useful in case
- your tool is not in the PATH.
-
-difftool.<tool>.cmd::
- Specify the command to invoke the specified diff tool.
-+
-See the `--tool=<tool>` option above for more details.
-
-difftool.prompt::
- Prompt before each invocation of the diff tool.
-
-difftool.trustExitCode::
- Exit difftool if the invoked diff tool returns a non-zero exit status.
-+
-See the `--trust-exit-code` option above for more details.
+include::config/difftool.txt[]
SEE ALSO
--------
diff --git a/Documentation/git-fast-export.txt b/Documentation/git-fast-export.txt
index 1978dbd..752e4b9 100644
--- a/Documentation/git-fast-export.txt
+++ b/Documentation/git-fast-export.txt
@@ -9,7 +9,7 @@ git-fast-export - Git data exporter
SYNOPSIS
--------
[verse]
-'git fast-export [<options>]' | 'git fast-import'
+'git fast-export' [<options>] | 'git fast-import'
DESCRIPTION
-----------
@@ -48,7 +48,7 @@ When asking to 'abort' (which is the default), this program will die
when encountering such a tag. With 'drop' it will omit such tags from
the output. With 'rewrite', if the tagged object is a commit, it will
rewrite the tag to tag an ancestor commit (via parent rewriting; see
-linkgit:git-rev-list[1])
+linkgit:git-rev-list[1]).
-M::
-C::
diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt
index 39cfa05..b260736 100644
--- a/Documentation/git-fast-import.txt
+++ b/Documentation/git-fast-import.txt
@@ -622,7 +622,7 @@ in octal. Git only supports the following modes:
* `100755` or `755`: A normal, but executable, file.
* `120000`: A symlink, the content of the file will be the link target.
* `160000`: A gitlink, SHA-1 of the object refers to a commit in
- another repository. Git links can only be specified by SHA or through
+ another repository. Git links can only be specified either by SHA or through
a commit mark. They are used to implement submodules.
* `040000`: A subdirectory. Subdirectories can only be specified by
SHA or through a tree mark set with `--import-marks`.
@@ -745,11 +745,11 @@ paths for a commit are encouraged to do so.
`notemodify`
^^^^^^^^^^^^
-Included in a `commit` `<notes_ref>` command to add a new note
+Included in a `commit` `<notes-ref>` command to add a new note
annotating a `<commit-ish>` or change this annotation contents.
Internally it is similar to filemodify 100644 on `<commit-ish>`
path (maybe split into subdirectories). It's not advised to
-use any other commands to write to the `<notes_ref>` tree except
+use any other commands to write to the `<notes-ref>` tree except
`filedeleteall` to delete all existing notes in this tree.
This command has two different means of specifying the content
of the note.
@@ -1353,7 +1353,7 @@ the marks back to the source repository, it is easy to verify the
accuracy and completeness of the import by comparing each Git
commit to the corresponding source revision.
-Coming from a system such as Perforce or Subversion this should be
+Coming from a system such as Perforce or Subversion, this should be
quite simple, as the fast-import mark can also be the Perforce changeset
number or the Subversion revision number.
@@ -1564,6 +1564,13 @@ operator can use this facility to peek at the objects and refs from an
import in progress, at the cost of some added running time and worse
compression.
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/fastimport.txt[]
+
SEE ALSO
--------
linkgit:git-fast-export[1]
diff --git a/Documentation/git-fetch-pack.txt b/Documentation/git-fetch-pack.txt
index 46747d5..b346766 100644
--- a/Documentation/git-fetch-pack.txt
+++ b/Documentation/git-fetch-pack.txt
@@ -69,7 +69,7 @@ be in a separate packet, and the list must end with a flush packet.
--upload-pack=<git-upload-pack>::
Use this to specify the path to 'git-upload-pack' on the
- remote side, if is not found on your $PATH.
+ remote side, if it is not found on your $PATH.
Installations of sshd ignores the user's environment
setup scripts for login shells (e.g. .bash_profile) and
your privately installed git may not be found on the system
diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt
index e9d3646..50900a5 100644
--- a/Documentation/git-fetch.txt
+++ b/Documentation/git-fetch.txt
@@ -186,8 +186,8 @@ origin:
------------------------------------------------
$ git fetch origin --prune --prune-tags
$ git fetch origin --prune 'refs/tags/*:refs/tags/*'
-$ git fetch <url of origin> --prune --prune-tags
-$ git fetch <url of origin> --prune 'refs/tags/*:refs/tags/*'
+$ git fetch <url-of-origin> --prune --prune-tags
+$ git fetch <url-of-origin> --prune 'refs/tags/*:refs/tags/*'
------------------------------------------------
OUTPUT
@@ -204,6 +204,15 @@ representing the status of a single ref. Each line is of the form:
<flag> <summary> <from> -> <to> [<reason>]
-------------------------------
+When using `--porcelain`, the output format is intended to be
+machine-parseable. In contrast to the human-readable output formats it
+thus prints to standard output instead of standard error. Each line is
+of the form:
+
+-------------------------------
+<flag> <old-object-id> <new-object-id> <local-reference>
+-------------------------------
+
The status of up-to-date refs is shown only if the --verbose option is
used.
@@ -251,10 +260,10 @@ EXAMPLES
$ git fetch origin
------------------------------------------------
+
-The above command copies all branches from the remote refs/heads/
-namespace and stores them to the local refs/remotes/origin/ namespace,
-unless the branch.<name>.fetch option is used to specify a non-default
-refspec.
+The above command copies all branches from the remote `refs/heads/`
+namespace and stores them to the local `refs/remotes/origin/` namespace,
+unless the `remote.<repository>.fetch` option is used to specify a
+non-default refspec.
* Using refspecs explicitly:
+
@@ -285,6 +294,13 @@ linkgit:git-gc[1]).
include::transfer-data-leaks.txt[]
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/fetch.txt[]
+
BUGS
----
Using --recurse-submodules can only fetch new commits in submodules that are
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index 62e482a..5a4f853 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -14,7 +14,7 @@ SYNOPSIS
[--msg-filter <command>] [--commit-filter <command>]
[--tag-name-filter <command>] [--prune-empty]
[--original <namespace>] [-d <directory>] [-f | --force]
- [--state-branch <branch>] [--] [<rev-list options>...]
+ [--state-branch <branch>] [--] [<rev-list-options>...]
WARNING
-------
@@ -32,7 +32,7 @@ listed there as reasonably possible.
DESCRIPTION
-----------
Lets you rewrite Git revision history by rewriting the branches mentioned
-in the <rev-list options>, applying custom filters on each revision.
+in the <rev-list-options>, applying custom filters on each revision.
Those filters can modify each tree (e.g. removing a file or running
a perl rewrite on all files) or information about each commit.
Otherwise, all information (including original commit times or merge
@@ -624,7 +624,7 @@ with:
real backup; it dereferences tags first.)
** Running git-filter-branch with either --tags or --all in your
- <rev-list options>. In order to retain annotated tags as
+ <rev-list-options>. In order to retain annotated tags as
annotated, you must use --tag-name-filter (and must not have
restored from refs/original/ in a previously botched rewrite).
diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt
index 6da899c..c1dd12b 100644
--- a/Documentation/git-for-each-ref.txt
+++ b/Documentation/git-for-each-ref.txt
@@ -9,10 +9,12 @@ SYNOPSIS
--------
[verse]
'git for-each-ref' [--count=<count>] [--shell|--perl|--python|--tcl]
- [(--sort=<key>)...] [--format=<format>] [<pattern>...]
+ [(--sort=<key>)...] [--format=<format>]
+ [--include-root-refs] [ --stdin | <pattern>... ]
[--points-at=<object>]
[--merged[=<object>]] [--no-merged[=<object>]]
[--contains[=<object>]] [--no-contains[=<object>]]
+ [--exclude=<pattern> ...]
DESCRIPTION
-----------
@@ -32,6 +34,10 @@ OPTIONS
literally, in the latter case matching completely or from the
beginning up to a slash.
+--stdin::
+ If `--stdin` is supplied, then the list of patterns is read from
+ standard input instead of from the argument list.
+
--count=<count>::
By default the command shows all refs that match
`<pattern>`. This option makes it stop after showing
@@ -45,17 +51,14 @@ OPTIONS
key.
--format=<format>::
- A string that interpolates `%(fieldname)` from a ref being shown
- and the object it points at. If `fieldname`
- is prefixed with an asterisk (`*`) and the ref points
- at a tag object, use the value for the field in the object
- which the tag object refers to (instead of the field in the tag object).
- When unspecified, `<format>` defaults to
- `%(objectname) SPC %(objecttype) TAB %(refname)`.
- It also interpolates `%%` to `%`, and `%xx` where `xx`
- are hex digits interpolates to character with hex code
- `xx`; for example `%00` interpolates to `\0` (NUL),
- `%09` to `\t` (TAB) and `%0a` to `\n` (LF).
+ A string that interpolates `%(fieldname)` from a ref being shown and
+ the object it points at. In addition, the string literal `%%`
+ renders as `%` and `%xx` - where `xx` are hex digits - renders as
+ the character with hex code `xx`. For example, `%00` interpolates to
+ `\0` (NUL), `%09` to `\t` (TAB), and `%0a` to `\n` (LF).
++
+When unspecified, `<format>` defaults to `%(objectname) SPC %(objecttype)
+TAB %(refname)`.
--color[=<when>]::
Respect any colors specified in the `--format` option. The
@@ -93,6 +96,18 @@ OPTIONS
--ignore-case::
Sorting and filtering refs are case insensitive.
+--omit-empty::
+ Do not print a newline after formatted refs where the format expands
+ to the empty string.
+
+--exclude=<pattern>::
+ If one or more patterns are given, only refs which do not match
+ any excluded pattern(s) are shown. Matching is done using the
+ same rules as `<pattern>` above.
+
+--include-root-refs::
+ List root refs (HEAD and pseudorefs) apart from regular refs.
+
FIELD NAMES
-----------
@@ -212,11 +227,66 @@ symref::
`:lstrip` and `:rstrip` options in the same way as `refname`
above.
+signature::
+ The GPG signature of a commit.
+
+signature:grade::
+ Show "G" for a good (valid) signature, "B" for a bad
+ signature, "U" for a good signature with unknown validity, "X"
+ for a good signature that has expired, "Y" for a good
+ signature made by an expired key, "R" for a good signature
+ made by a revoked key, "E" if the signature cannot be
+ checked (e.g. missing key) and "N" for no signature.
+
+signature:signer::
+ The signer of the GPG signature of a commit.
+
+signature:key::
+ The key of the GPG signature of a commit.
+
+signature:fingerprint::
+ The fingerprint of the GPG signature of a commit.
+
+signature:primarykeyfingerprint::
+ The primary key fingerprint of the GPG signature of a commit.
+
+signature:trustlevel::
+ The trust level of the GPG signature of a commit. Possible
+ outputs are `ultimate`, `fully`, `marginal`, `never` and `undefined`.
+
worktreepath::
The absolute path to the worktree in which the ref is checked
out, if it is checked out in any linked worktree. Empty string
otherwise.
+ahead-behind:<committish>::
+ Two integers, separated by a space, demonstrating the number of
+ commits ahead and behind, respectively, when comparing the output
+ ref to the `<committish>` specified in the format.
+
+describe[:options]::
+ A human-readable name, like linkgit:git-describe[1];
+ empty string for undescribable commits. The `describe` string may
+ be followed by a colon and one or more comma-separated options.
++
+--
+tags=<bool-value>;;
+ Instead of only considering annotated tags, consider
+ lightweight tags as well; see the corresponding option in
+ linkgit:git-describe[1] for details.
+abbrev=<number>;;
+ Use at least <number> hexadecimal digits; see the corresponding
+ option in linkgit:git-describe[1] for details.
+match=<pattern>;;
+ Only consider tags matching the given `glob(7)` pattern,
+ excluding the "refs/tags/" prefix; see the corresponding option
+ in linkgit:git-describe[1] for details.
+exclude=<pattern>;;
+ Do not consider tags matching the given `glob(7)` pattern,
+ excluding the "refs/tags/" prefix; see the corresponding option
+ in linkgit:git-describe[1] for details.
+--
+
In addition to the above, for commit and tag objects, the header
field names (`tree`, `parent`, `object`, `type`, and `tag`) can
be used to specify the value in the header field.
@@ -228,12 +298,20 @@ fields will correspond to the appropriate date or name-email-date tuple
from the `committer` or `tagger` fields depending on the object type.
These are intended for working on a mix of annotated and lightweight tags.
+For tag objects, a `fieldname` prefixed with an asterisk (`*`) expands to
+the `fieldname` value of the peeled object, rather than that of the tag
+object itself.
+
Fields that have name-email-date tuple as its value (`author`,
`committer`, and `tagger`) can be suffixed with `name`, `email`,
and `date` to extract the named component. For email fields (`authoremail`,
`committeremail` and `taggeremail`), `:trim` can be appended to get the email
without angle brackets, and `:localpart` to get the part before the `@` symbol
-out of the trimmed email.
+out of the trimmed email. In addition to these, the `:mailmap` option and the
+corresponding `:mailmap,trim` and `:mailmap,localpart` can be used (order does
+not matter) to get values of the name and email according to the .mailmap file
+or according to the file set in the mailmap.file or mailmap.blob configuration
+variable (see linkgit:gitmailmap[5]).
The raw data in an object is `raw`.
@@ -284,9 +362,11 @@ In any case, a field name that refers to a field inapplicable to
the object referred by the ref does not cause an error. It
returns an empty string instead.
-As a special case for the date-type fields, you may specify a format for
-the date by adding `:` followed by date format name (see the
-values the `--date` option to linkgit:git-rev-list[1] takes).
+As a special case for the date-type fields, you may specify a format for the
+date by adding `:` followed by date format name (see the values the `--date`
+option to linkgit:git-rev-list[1] takes). If this formatting is provided in
+a `--sort` key, references will be sorted according to the byte-value of the
+formatted string rather than the numeric value of the underlying timestamp.
Some atoms like %(align) and %(if) always require a matching %(end).
We call them "opening atoms" and sometimes denote them as %($open).
diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index be797d7..728bb38 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -17,10 +17,10 @@ SYNOPSIS
[--signature-file=<file>]
[-n | --numbered | -N | --no-numbered]
[--start-number <n>] [--numbered-files]
- [--in-reply-to=<message id>] [--suffix=.<sfx>]
+ [--in-reply-to=<message-id>] [--suffix=.<sfx>]
[--ignore-if-in-upstream] [--always]
[--cover-from-description=<mode>]
- [--rfc] [--subject-prefix=<subject prefix>]
+ [--rfc] [--subject-prefix=<subject-prefix>]
[(--reroll-count|-v) <n>]
[--to=<email>] [--cc=<email>]
[--[no-]cover-letter] [--quiet]
@@ -30,8 +30,8 @@ SYNOPSIS
[--range-diff=<previous> [--creation-factor=<percent>]]
[--filename-max-length=<n>]
[--progress]
- [<common diff options>]
- [ <since> | <revision range> ]
+ [<common-diff-options>]
+ [ <since> | <revision-range> ]
DESCRIPTION
-----------
@@ -55,7 +55,7 @@ A "message" generated by the command consists of three parts:
* The "patch", which is the "diff -p --stat" output (see
linkgit:git-diff[1]) between the commit and its parent.
-The log message and the patch is separated by a line with a
+The log message and the patch are separated by a line with a
three-dash line.
There are two ways to specify which commits to operate on.
@@ -64,7 +64,7 @@ There are two ways to specify which commits to operate on.
to the tip of the current branch that are not in the history
that leads to the <since> to be output.
-2. Generic <revision range> expression (see "SPECIFYING
+2. Generic <revision-range> expression (see "SPECIFYING
REVISIONS" section in linkgit:gitrevisions[7]) means the
commits in the specified range.
@@ -99,7 +99,7 @@ To omit patch numbers from the subject, use `-N`.
If given `--thread`, `git-format-patch` will generate `In-Reply-To` and
`References` headers to make the second and subsequent patch mails appear
-as replies to the first mail; this also generates a `Message-Id` header to
+as replies to the first mail; this also generates a `Message-ID` header to
reference.
OPTIONS
@@ -163,7 +163,7 @@ include::diff-options.txt[]
--no-thread::
Controls addition of `In-Reply-To` and `References` headers to
make the second and subsequent mails appear as replies to the
- first. Also controls generation of the `Message-Id` header to
+ first. Also controls generation of the `Message-ID` header to
reference.
+
The optional <style> argument can be either `shallow` or `deep`.
@@ -173,16 +173,15 @@ series, where the head is chosen from the cover letter, the
threading makes every mail a reply to the previous one.
+
The default is `--no-thread`, unless the `format.thread` configuration
-is set. If `--thread` is specified without a style, it defaults to the
-style specified by `format.thread` if any, or else `shallow`.
+is set. `--thread` without an argument is equivalent to `--thread=shallow`.
+
Beware that the default for 'git send-email' is to thread emails
itself. If you want `git format-patch` to take care of threading, you
will want to ensure that threading is disabled for `git send-email`.
---in-reply-to=<message id>::
+--in-reply-to=<message-id>::
Make the first mail (or all the mails with `--no-thread`) appear as a
- reply to the given <message id>, which avoids breaking threads to
+ reply to the given <message-id>, which avoids breaking threads to
provide a new patch series.
--ignore-if-in-upstream::
@@ -216,11 +215,21 @@ is greater than 100 bytes, then the mode will be `message`, otherwise
If `<mode>` is `none`, both the cover letter subject and body will be
populated with placeholder text.
---subject-prefix=<subject prefix>::
+--description-file=<file>::
+ Use the contents of <file> instead of the branch's description
+ for generating the cover letter.
+
+--subject-prefix=<subject-prefix>::
Instead of the standard '[PATCH]' prefix in the subject
- line, instead use '[<subject prefix>]'. This
- allows for useful naming of a patch series, and can be
- combined with the `--numbered` option.
+ line, instead use '[<subject-prefix>]'. This can be used
+ to name a patch series, and can be combined with the
+ `--numbered` option.
++
+The configuration variable `format.subjectPrefix` may also be used
+to configure a subject prefix to apply to a given repository for
+all patches. This is often useful on mailing lists which receive
+patches for several repositories and can be used to disambiguate
+the patches (with a value of e.g. "PATCH my-project").
--filename-max-length=<n>::
Instead of the standard 64 bytes, chomp the generated output
@@ -230,9 +239,9 @@ populated with placeholder text.
variable, or 64 if unconfigured.
--rfc::
- Alias for `--subject-prefix="RFC PATCH"`. RFC means "Request For
- Comments"; use this when sending an experimental patch for
- discussion rather than application.
+ Prepends "RFC" to the subject prefix (producing "RFC PATCH" by
+ default). RFC means "Request For Comments"; use this when sending
+ an experimental patch for discussion rather than application.
-v <n>::
--reroll-count=<n>::
@@ -246,7 +255,7 @@ populated with placeholder text.
or "--reroll-count=4rev2" are allowed), but the downside of
using such a reroll-count is that the range-diff/interdiff
with the previous version does not state exactly which
- version the new interation is compared against.
+ version the new iteration is compared against.
--to=<email>::
Add a `To:` header to the email headers. This is in addition
@@ -275,6 +284,17 @@ header). Note also that `git send-email` already handles this
transformation for you, and this option should not be used if you are
feeding the result to `git send-email`.
+--[no-]force-in-body-from::
+ With the e-mail sender specified via the `--from` option, by
+ default, an in-body "From:" to identify the real author of
+ the commit is added at the top of the commit log message if
+ the sender is different from the author. With this option,
+ the in-body "From:" is added even when the sender and the
+ author have the same name and address, which may help if the
+ mailing list software mangles the sender's identity.
+ Defaults to the value of the `format.forceInBodyFrom`
+ configuration variable.
+
--add-header=<header>::
Add an arbitrary header to the email headers. This is in addition
to any configured headers, and may be used multiple times.
@@ -383,7 +403,7 @@ you can use `--suffix=-patch` to get `0001-description-of-my-change-patch`.
`format.useAutoBase` configuration.
--root::
- Treat the revision argument as a <revision range>, even if it
+ Treat the revision argument as a <revision-range>, even if it
is just a single commit (that would normally be treated as a
<since>). Note that root commits included in the specified
range are always formatted as creation patches, independently
@@ -590,8 +610,8 @@ Approach #3 (external editor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following Thunderbird extensions are needed:
-AboutConfig from http://aboutconfig.mozdev.org/ and
-External Editor from http://globs.org/articles.php?lng=en&pg=8
+AboutConfig from https://mjg.github.io/AboutConfig/ and
+External Editor from https://globs.org/articles.php?lng=en&pg=8
1. Prepare the patch as a text file using your method of choice.
diff --git a/Documentation/git-fsck.txt b/Documentation/git-fsck.txt
index 5088783..5b82e46 100644
--- a/Documentation/git-fsck.txt
+++ b/Documentation/git-fsck.txt
@@ -24,7 +24,7 @@ OPTIONS
An object to treat as the head of an unreachability trace.
+
If no objects are given, 'git fsck' defaults to using the
-index file, all SHA-1 references in `refs` namespace, and all reflogs
+index file, all SHA-1 references in the `refs` namespace, and all reflogs
(unless --no-reflogs is given) as heads.
--unreachable::
@@ -64,7 +64,7 @@ index file, all SHA-1 references in `refs` namespace, and all reflogs
--connectivity-only::
Check only the connectivity of reachable objects, making sure
that any objects referenced by a reachable tag, commit, or tree
- is present. This speeds up the operation by avoiding reading
+ are present. This speeds up the operation by avoiding reading
blobs entirely (though it does still check that referenced blobs
exist). This will detect corruption in commits and trees, but
not do any semantic checks (e.g., for format errors). Corruption
@@ -79,7 +79,7 @@ care about this output and want to speed it up further.
recorded with g+w bit set, which was created by older
versions of Git. Existing repositories, including the
Linux kernel, Git itself, and sparse repository have old
- objects that triggers this check, but it is recommended
+ objects that trigger this check, but it is recommended
to check new projects with this flag.
--verbose::
@@ -107,6 +107,8 @@ care about this output and want to speed it up further.
CONFIGURATION
-------------
+include::includes/cmd-config-section-all.txt[]
+
include::config/fsck.txt[]
DISCUSSION
@@ -150,6 +152,18 @@ hash mismatch <object>::
object database value.
This indicates a serious data integrity problem.
+
+FSCK MESSAGES
+-------------
+
+The following lists the types of errors `git fsck` detects and what
+each error means, with their default severity. The severity of the
+error, other than those that are marked as "(FATAL)", can be tweaked
+by setting the corresponding `fsck.<msg-id>` configuration variable.
+
+include::fsck-msgids.txt[]
+
+
Environment Variables
---------------------
diff --git a/Documentation/git-fsmonitor--daemon.txt b/Documentation/git-fsmonitor--daemon.txt
index cc142fb..8585d19 100644
--- a/Documentation/git-fsmonitor--daemon.txt
+++ b/Documentation/git-fsmonitor--daemon.txt
@@ -3,7 +3,7 @@ git-fsmonitor{litdd}daemon(1)
NAME
----
-git-fsmonitor--daemon - A Built-in File System Monitor
+git-fsmonitor--daemon - A Built-in Filesystem Monitor
SYNOPSIS
--------
@@ -17,7 +17,7 @@ DESCRIPTION
-----------
A daemon to watch the working directory for file and directory
-changes using platform-specific file system notification facilities.
+changes using platform-specific filesystem notification facilities.
This daemon communicates directly with commands like `git status`
using the link:technical/api-simple-ipc.html[simple IPC] interface
@@ -63,13 +63,44 @@ CAVEATS
-------
The fsmonitor daemon does not currently know about submodules and does
-not know to filter out file system events that happen within a
+not know to filter out filesystem events that happen within a
submodule. If fsmonitor daemon is watching a super repo and a file is
modified within the working directory of a submodule, it will report
the change (as happening against the super repo). However, the client
will properly ignore these extra events, so performance may be affected
but it will not cause an incorrect result.
+By default, the fsmonitor daemon refuses to work with network-mounted
+repositories; this may be overridden by setting `fsmonitor.allowRemote` to
+`true`. Note, however, that the fsmonitor daemon is not guaranteed to work
+correctly with all network-mounted repositories, so such use is considered
+experimental.
+
+On Mac OS, the inter-process communication (IPC) between various Git
+commands and the fsmonitor daemon is done via a Unix domain socket (UDS) -- a
+special type of file -- which is supported by native Mac OS filesystems,
+but not on network-mounted filesystems, NTFS, or FAT32. Other filesystems
+may or may not have the needed support; the fsmonitor daemon is not guaranteed
+to work with these filesystems and such use is considered experimental.
+
+By default, the socket is created in the `.git` directory. However, if the
+`.git` directory is on a network-mounted filesystem, it will instead be
+created at `$HOME/.git-fsmonitor-*` unless `$HOME` itself is on a
+network-mounted filesystem, in which case you must set the configuration
+variable `fsmonitor.socketDir` to the path of a directory on a Mac OS native
+filesystem in which to create the socket file.
+
+If none of the above directories (`.git`, `$HOME`, or `fsmonitor.socketDir`)
+is on a native Mac OS file filesystem the fsmonitor daemon will report an
+error that will cause the daemon and the currently running command to exit.
+
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/fsmonitor--daemon.txt[]
+
GIT
---
Part of the linkgit:git[1] suite
diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt
index 0af7540..b5561c4 100644
--- a/Documentation/git-gc.txt
+++ b/Documentation/git-gc.txt
@@ -54,9 +54,17 @@ other housekeeping tasks (e.g. rerere, working trees, reflog...) will
be performed as well.
---cruft::
+--[no-]cruft::
When expiring unreachable objects, pack them separately into a
- cruft pack instead of storing them as loose objects.
+ cruft pack instead of storing them as loose objects. `--cruft`
+ is on by default.
+
+--max-cruft-size=<n>::
+ When packing unreachable objects into a cruft pack, limit the
+ size of new cruft packs to be at most `<n>` bytes. Overrides any
+ value specified via the `gc.maxCruftSize` configuration. See
+ the `--max-cruft-size` option of linkgit:git-repack[1] for
+ more.
--prune=<date>::
Prune loose objects older than date (default is 2 weeks ago,
@@ -77,9 +85,10 @@ be performed as well.
instance running on this repository.
--keep-largest-pack::
- All packs except the largest pack and those marked with a
- `.keep` files are consolidated into a single pack. When this
- option is used, `gc.bigPackThreshold` is ignored.
+ All packs except the largest non-cruft pack, any packs marked
+ with a `.keep` file, and any cruft pack(s) are consolidated into
+ a single pack. When this option is used, `gc.bigPackThreshold`
+ is ignored.
AGGRESSIVE
----------
@@ -110,8 +119,7 @@ users and their repositories.
CONFIGURATION
-------------
-The below documentation is the same as what's found in
-linkgit:git-config[1]:
+include::includes/cmd-config-section-all.txt[]
include::config/gc.txt[]
diff --git a/Documentation/git-get-tar-commit-id.txt b/Documentation/git-get-tar-commit-id.txt
index ac44d85..b537bb4 100644
--- a/Documentation/git-get-tar-commit-id.txt
+++ b/Documentation/git-get-tar-commit-id.txt
@@ -20,7 +20,7 @@ and extract the commit ID stored in it. It reads only the first
1024 bytes of input, thus its runtime is not influenced by the size
of the tar archive very much.
-If no commit ID is found, 'git get-tar-commit-id' quietly exists with a
+If no commit ID is found, 'git get-tar-commit-id' quietly exits with a
return code of 1. This can happen if the archive had not been created
using 'git archive' or if the first parameter of 'git archive' had been
a tree ID instead of a commit ID or tag.
diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index 3d393fb..1e6d7b6 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -23,11 +23,12 @@ SYNOPSIS
[--break] [--heading] [-p | --show-function]
[-A <post-context>] [-B <pre-context>] [-C <context>]
[-W | --function-context]
+ [(-m | --max-count) <num>]
[--threads <num>]
[-f <file>] [-e] <pattern>
[--and|--or|--not|(|)|-e <pattern>...]
[--recurse-submodules] [--parent-basename <basename>]
- [ [--[no-]exclude-standard] [--cached | --no-index | --untracked] | <tree>...]
+ [ [--[no-]exclude-standard] [--cached | --untracked | --no-index] | <tree>...]
[--] [<pathspec>...]
DESCRIPTION
@@ -44,13 +45,21 @@ OPTIONS
Instead of searching tracked files in the working tree, search
blobs registered in the index file.
---no-index::
- Search files in the current directory that is not managed by Git.
-
--untracked::
In addition to searching in the tracked files in the working
tree, search also in untracked files.
+--no-index::
+ Search files in the current directory that is not managed by Git,
+ or by ignoring that the current directory is managed by Git. This
+ is rather similar to running the regular `grep(1)` utility with its
+ `-r` option specified, but with some additional benefits, such as
+ using pathspec patterns to limit paths; see the 'pathspec' entry
+ in linkgit:gitglossary[7] for more information.
++
+This option cannot be used together with `--cached` or `--untracked`.
+See also `grep.fallbackToNoIndex` in 'CONFIGURATION' below.
+
--no-exclude-standard::
Also search in ignored files by not honoring the `.gitignore`
mechanism. Only useful with `--untracked`.
@@ -63,9 +72,9 @@ OPTIONS
--recurse-submodules::
Recursively search in each submodule that is active and
checked out in the repository. When used in combination with the
- <tree> option the prefix of all submodule output will be the name of
- the parent project's <tree> object. This option has no effect
- if `--no-index` is given.
+ _<tree>_ option the prefix of all submodule output will be the name of
+ the parent project's _<tree>_ object. This option cannot be used together
+ with `--untracked`, and it has no effect if `--no-index` is specified.
-a::
--text::
@@ -177,7 +186,7 @@ providing this option will cause it to die.
Use \0 as the delimiter for pathnames in the output, and print
them verbatim. Without this option, pathnames with "unusual"
characters are quoted as explained for the configuration
- variable core.quotePath (see linkgit:git-config[1]).
+ variable `core.quotePath` (see linkgit:git-config[1]).
-o::
--only-matching::
@@ -238,9 +247,17 @@ providing this option will cause it to die.
`git diff` works out patch hunk headers (see 'Defining a
custom hunk-header' in linkgit:gitattributes[5]).
+-m <num>::
+--max-count <num>::
+ Limit the amount of matches per file. When using the `-v` or
+ `--invert-match` option, the search stops after the specified
+ number of non-matches. A value of -1 will return unlimited
+ results (the default). A value of 0 will exit immediately with
+ a non-zero status.
+
--threads <num>::
- Number of grep worker threads to use.
- See `grep.threads` in 'CONFIGURATION' for more information.
+ Number of `grep` worker threads to use. See 'NOTES ON THREADS'
+ and `grep.threads` in 'CONFIGURATION' for more information.
-f <file>::
Read patterns from <file>, one per line.
@@ -323,45 +340,20 @@ EXAMPLES
NOTES ON THREADS
----------------
-The `--threads` option (and the grep.threads configuration) will be ignored when
+The `--threads` option (and the `grep.threads` configuration) will be ignored when
`--open-files-in-pager` is used, forcing a single-threaded execution.
When grepping the object store (with `--cached` or giving tree objects), running
-with multiple threads might perform slower than single threaded if `--textconv`
-is given and there're too many text conversions. So if you experience low
-performance in this case, it might be desirable to use `--threads=1`.
+with multiple threads might perform slower than single-threaded if `--textconv`
+is given and there are too many text conversions. Thus, if low performance is
+experienced in this case, it might be desirable to use `--threads=1`.
CONFIGURATION
-------------
-grep.lineNumber::
- If set to true, enable `-n` option by default.
-
-grep.column::
- If set to true, enable the `--column` option by default.
-
-grep.patternType::
- Set the default matching behavior. Using a value of 'basic', 'extended',
- 'fixed', or 'perl' will enable the `--basic-regexp`, `--extended-regexp`,
- `--fixed-strings`, or `--perl-regexp` option accordingly, while the
- value 'default' will return to the default matching behavior.
-
-grep.extendedRegexp::
- If set to true, enable `--extended-regexp` option by default. This
- option is ignored when the `grep.patternType` option is set to a value
- other than 'default'.
-
-grep.threads::
- Number of grep worker threads to use. If unset (or set to 0), Git will
- use as many threads as the number of logical cores available.
-
-grep.fullName::
- If set to true, enable `--full-name` option by default.
-
-grep.fallbackToNoIndex::
- If set to true, fall back to git grep --no-index if git grep
- is executed outside of a git repository. Defaults to false.
+include::includes/cmd-config-section-all.txt[]
+include::config/grep.txt[]
GIT
---
diff --git a/Documentation/git-hash-object.txt b/Documentation/git-hash-object.txt
index df9e2c5..ef4719a 100644
--- a/Documentation/git-hash-object.txt
+++ b/Documentation/git-hash-object.txt
@@ -3,13 +3,14 @@ git-hash-object(1)
NAME
----
-git-hash-object - Compute object ID and optionally creates a blob from a file
+git-hash-object - Compute object ID and optionally create an object from a file
SYNOPSIS
--------
[verse]
-'git hash-object' [-t <type>] [-w] [--path=<file>|--no-filters] [--stdin [--literally]] [--] <file>...
+'git hash-object' [-t <type>] [-w] [--path=<file> | --no-filters]
+ [--stdin [--literally]] [--] <file>...
'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters]
DESCRIPTION
@@ -24,7 +25,8 @@ OPTIONS
-------
-t <type>::
- Specify the type (default: "blob").
+ Specify the type of object to be created (default: "blob"). Possible
+ values are `commit`, `tree`, `blob`, and `tag`.
-w::
Actually write the object into the object database.
@@ -37,10 +39,10 @@ OPTIONS
of from the command-line.
--path::
- Hash object as it were located at the given path. The location of
- file does not directly influence on the hash value, but path is
- used to determine what Git filters should be applied to the object
- before it can be placed to the object database, and, as result of
+ Hash object as if it were located at the given path. The location of
+ the file does not directly influence the hash value, but the path is
+ used to determine which Git filters should be applied to the object
+ before it can be placed in the object database. As a result of
applying filters, the actual blob put into the object database may
differ from the given file. This option is mainly useful for hashing
temporary files located outside of the working directory or files
diff --git a/Documentation/git-help.txt b/Documentation/git-help.txt
index 239c68d..f0bedc1 100644
--- a/Documentation/git-help.txt
+++ b/Documentation/git-help.txt
@@ -9,14 +9,16 @@ SYNOPSIS
--------
[verse]
'git help' [-a|--all] [--[no-]verbose] [--[no-]external-commands] [--[no-]aliases]
-'git help' [[-i|--info] [-m|--man] [-w|--web]] [<command>|<guide>]
+'git help' [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]
'git help' [-g|--guides]
'git help' [-c|--config]
+'git help' [--user-interfaces]
+'git help' [--developer-interfaces]
DESCRIPTION
-----------
-With no options and no '<command>' or '<guide>' given, the synopsis of the 'git'
+With no options and no '<command>' or '<doc>' given, the synopsis of the 'git'
command and a list of the most commonly used Git commands are printed
on the standard output.
@@ -26,8 +28,8 @@ printed on the standard output.
If the option `--guides` or `-g` is given, a list of the
Git concept guides is also printed on the standard output.
-If a command, or a guide, is given, a manual page for that command or
-guide is brought up. The 'man' program is used by default for this
+If a command or other documentation is given, the relevant manual page
+will be brought up. The 'man' program is used by default for this
purpose, but this can be overridden by other options or configuration
variables.
@@ -40,13 +42,13 @@ former is internally converted into the latter.
To display the linkgit:git[1] man page, use `git help git`.
-This page can be displayed with 'git help help' or `git help --help`
+This page can be displayed with 'git help help' or `git help --help`.
OPTIONS
-------
-a::
--all::
- Prints all the available commands on the standard output.
+ Print all the available commands on the standard output.
--no-external-commands::
When used with `--all`, exclude the listing of external "git-*"
@@ -57,7 +59,7 @@ OPTIONS
aliases.
--verbose::
- When used with `--all` print description for all recognized
+ When used with `--all`, print description for all recognized
commands. This is the default.
-c::
@@ -67,7 +69,24 @@ OPTIONS
-g::
--guides::
- Prints a list of the Git concept guides on the standard output.
+ Print a list of the Git concept guides on the standard output.
+
+--user-interfaces::
+ Print a list of the repository, command and file interfaces
+ documentation on the standard output.
++
+In-repository file interfaces such as `.git/info/exclude` are
+documented here (see linkgit:gitrepository-layout[5]), as well as
+in-tree configuration such as `.mailmap` (see linkgit:gitmailmap[5]).
++
+This section of the documentation also covers general or widespread
+user-interface conventions (e.g. linkgit:gitcli[7]), and
+pseudo-configuration such as the file-based `.git/hooks/*` interface
+described in linkgit:githooks[5].
+
+--developer-interfaces::
+ Print a list of file formats, protocols and other developer
+ interfaces documentation on the standard output.
-i::
--info::
@@ -90,7 +109,7 @@ other display programs (see below).
format. A web browser will be used for that purpose.
+
The web browser can be specified using the configuration variable
-`help.browser`, or `web.browser` if the former is not set. If none of
+`help.browser`, or `web.browser` if the former is not set. If neither of
these config variables is set, the 'git web{litdd}browse' helper script
(called by 'git help') will pick a suitable default. See
linkgit:git-web{litdd}browse[1] for more information about this.
@@ -110,8 +129,8 @@ line option:
* "info" corresponds to '-i|--info',
* "web" or "html" correspond to '-w|--web'.
-help.browser, web.browser and browser.<tool>.path
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+help.browser, web.browser, and browser.<tool>.path
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The `help.browser`, `web.browser` and `browser.<tool>.path` will also
be checked if the 'web' format is chosen (either by command-line
diff --git a/Documentation/git-hook.txt b/Documentation/git-hook.txt
index 77c3a8a..f6cc72d 100644
--- a/Documentation/git-hook.txt
+++ b/Documentation/git-hook.txt
@@ -8,12 +8,12 @@ git-hook - Run git hooks
SYNOPSIS
--------
[verse]
-'git hook' run [--ignore-missing] <hook-name> [-- <hook-args>]
+'git hook' run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-args>]
DESCRIPTION
-----------
-A command interface to running git hooks (see linkgit:githooks[5]),
+A command interface for running git hooks (see linkgit:githooks[5]),
for use by other scripted git commands.
SUBCOMMANDS
@@ -31,6 +31,11 @@ linkgit:githooks[5] for arguments hooks might expect (if any).
OPTIONS
-------
+--to-stdin::
+ For "run"; specify a file which will be streamed into the
+ hook's stdin. The hook will receive the entire file from
+ beginning to EOF.
+
--ignore-missing::
Ignore any missing hook by quietly returning zero. Used for
tools that want to do a blind one-shot run of a hook that may
diff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt
index 0c5c0dd..f37ddad 100644
--- a/Documentation/git-http-backend.txt
+++ b/Documentation/git-http-backend.txt
@@ -23,7 +23,7 @@ discussion of `GIT_PROTOCOL` in the ENVIRONMENT section below.
It verifies that the directory has the magic file
"git-daemon-export-ok", and it will refuse to export any Git directory
that hasn't explicitly been marked for export this way (unless the
-`GIT_HTTP_EXPORT_ALL` environmental variable is set).
+`GIT_HTTP_EXPORT_ALL` environment variable is set).
By default, only the `upload-pack` service is enabled, which serves
'git fetch-pack' and 'git ls-remote' clients, which are invoked from
@@ -42,12 +42,12 @@ http.getanyfile::
any file within the repository, including objects that are
no longer reachable from a branch but are still present.
It is enabled by default, but a repository can disable it
- by setting this configuration item to `false`.
+ by setting this configuration value to `false`.
http.uploadpack::
This serves 'git fetch-pack' and 'git ls-remote' clients.
It is enabled by default, but a repository can disable it
- by setting this configuration item to `false`.
+ by setting this configuration value to `false`.
http.receivepack::
This serves 'git send-pack' clients, allowing push. It is
@@ -265,12 +265,12 @@ by the invoking web server, including:
* QUERY_STRING
* REQUEST_METHOD
-The `GIT_HTTP_EXPORT_ALL` environmental variable may be passed to
+The `GIT_HTTP_EXPORT_ALL` environment variable may be passed to
'git-http-backend' to bypass the check for the "git-daemon-export-ok"
file in each repository before allowing export of that repository.
The `GIT_HTTP_MAX_REQUEST_BUFFER` environment variable (or the
-`http.maxRequestBuffer` config variable) may be set to change the
+`http.maxRequestBuffer` config option) may be set to change the
largest ref negotiation request that git will handle during a fetch; any
fetch requiring a larger buffer will not succeed. This value should not
normally need to be changed, but may be helpful if you are fetching from
diff --git a/Documentation/git-http-fetch.txt b/Documentation/git-http-fetch.txt
index 319062c..4ec7c68 100644
--- a/Documentation/git-http-fetch.txt
+++ b/Documentation/git-http-fetch.txt
@@ -31,7 +31,7 @@ commit-id::
Report what is downloaded.
-w <filename>::
- Writes the commit-id into the filename under $GIT_DIR/refs/<filename> on
+ Writes the commit-id into the specified filename under $GIT_DIR/refs/<filename> on
the local end after the transfer is complete.
--stdin::
diff --git a/Documentation/git-http-push.txt b/Documentation/git-http-push.txt
index 7c6a6dd..ce0d808 100644
--- a/Documentation/git-http-push.txt
+++ b/Documentation/git-http-push.txt
@@ -13,12 +13,12 @@ SYNOPSIS
DESCRIPTION
-----------
-Sends missing objects to remote repository, and updates the
+Sends missing objects to the remote repository, and updates the
remote branch.
*NOTE*: This command is temporarily disabled if your libcurl
is older than 7.16, as the combination has been reported
-not to work and sometimes corrupts repository.
+not to work and sometimes corrupts the repository.
OPTIONS
-------
@@ -44,7 +44,7 @@ OPTIONS
-d::
-D::
Remove <ref> from remote repository. The specified branch
- cannot be the remote HEAD. If -d is specified the following
+ cannot be the remote HEAD. If -d is specified, the following
other conditions must also be met:
- Remote HEAD must resolve to an object that exists locally
@@ -83,8 +83,8 @@ and where it is pushed is determined by using the destination side.
Without `--force`, the <src> ref is stored at the remote only if
<dst> does not exist, or <dst> is a proper subset (i.e. an
ancestor) of <src>. This check, known as "fast-forward check",
-is performed in order to avoid accidentally overwriting the
-remote ref and lose other peoples' commits from there.
+is performed to avoid accidentally overwriting the
+remote ref and losing other peoples' commits from there.
With `--force`, the fast-forward check is disabled for all refs.
diff --git a/Documentation/git-imap-send.txt b/Documentation/git-imap-send.txt
index 63cf498..c8a89d7 100644
--- a/Documentation/git-imap-send.txt
+++ b/Documentation/git-imap-send.txt
@@ -54,6 +54,8 @@ CONFIGURATION
To use the tool, `imap.folder` and either `imap.tunnel` or `imap.host` must be set
to appropriate values.
+include::includes/cmd-config-section-rest.txt[]
+
include::config/imap.txt[]
EXAMPLES
@@ -133,7 +135,7 @@ flames ridiculing you if you don't check this.
Thunderbird in particular is known to be problematic. Thunderbird
users may wish to visit this web page for more information:
- http://kb.mozillazine.org/Plain_text_e-mail_-_Thunderbird#Completely_plain_email
+ https://kb.mozillazine.org/Plain_text_e-mail_-_Thunderbird#Completely_plain_email
SEE ALSO
--------
diff --git a/Documentation/git-index-pack.txt b/Documentation/git-index-pack.txt
index 4e71c25..5a20dee 100644
--- a/Documentation/git-index-pack.txt
+++ b/Documentation/git-index-pack.txt
@@ -16,10 +16,10 @@ SYNOPSIS
DESCRIPTION
-----------
-Reads a packed archive (.pack) from the specified file, and
-builds a pack index file (.idx) for it. Optionally writes a
+Reads a packed archive (.pack) from the specified file,
+builds a pack index file (.idx) for it, and optionally writes a
reverse-index (.rev) for the specified pack. The packed
-archive together with the pack index can then be placed in
+archive, together with the pack index, can then be placed in
the objects/pack/ directory of a Git repository.
@@ -68,8 +68,8 @@ OPTIONS
updated to use objects contained in the pack.
--keep=<msg>::
- Like --keep create a .keep file before moving the index into
- its final destination, but rather than creating an empty file
+ Like --keep, create a .keep file before moving the index into
+ its final destination. However, instead of creating an empty file
place '<msg>' followed by an LF into the .keep file. The '<msg>'
message can later be searched for within all .keep files to
locate any which have outlived their usefulness.
@@ -79,8 +79,13 @@ OPTIONS
to force the version for the generated pack index, and to force
64-bit index entries on objects located above the given offset.
---strict::
- Die, if the pack contains broken objects or links.
+--strict[=<msg-id>=<severity>...]::
+ Die, if the pack contains broken objects or links. An optional
+ comma-separated list of `<msg-id>=<severity>` can be passed to change
+ the severity of some possible issues, e.g.,
+ `--strict="missingEmail=ignore,badTagName=error"`. See the entry for the
+ `fsck.<msg-id>` configuration options in linkgit:git-fsck[1] for more
+ information on the possible values of `<msg-id>` and `<severity>`.
--progress-title::
For internal use only.
@@ -91,13 +96,18 @@ default and "Indexing objects" when `--stdin` is specified.
--check-self-contained-and-connected::
Die if the pack contains broken links. For internal use only.
---fsck-objects::
- For internal use only.
+--fsck-objects[=<msg-id>=<severity>...]::
+ Die if the pack contains broken objects, but unlike `--strict`, don't
+ choke on broken links. If the pack contains a tree pointing to a
+ .gitmodules blob that does not exist, prints the hash of that blob
+ (for the caller to check) after the hash that goes into the name of the
+ pack/idx file (see "Notes").
+
-Die if the pack contains broken objects. If the pack contains a tree
-pointing to a .gitmodules blob that does not exist, prints the hash of
-that blob (for the caller to check) after the hash that goes into the
-name of the pack/idx file (see "Notes").
+An optional comma-separated list of `<msg-id>=<severity>` can be passed to
+change the severity of some possible issues, e.g.,
+`--fsck-objects="missingEmail=ignore,badTagName=ignore"`. See the entry for the
+`fsck.<msg-id>` configuration options in linkgit:git-fsck[1] for more
+information on the possible values of `<msg-id>` and `<severity>`.
--threads=<n>::
Specifies the number of threads to spawn when resolving
diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt
index ad921fe..daff93b 100644
--- a/Documentation/git-init.txt
+++ b/Documentation/git-init.txt
@@ -9,10 +9,11 @@ git-init - Create an empty Git repository or reinitialize an existing one
SYNOPSIS
--------
[verse]
-'git init' [-q | --quiet] [--bare] [--template=<template-directory>]
- [--separate-git-dir <git-dir>] [--object-format=<format>]
- [-b <branch-name> | --initial-branch=<branch-name>]
- [--shared[=<permissions>]] [<directory>]
+`git init` [`-q` | `--quiet`] [`--bare`] [++--template=++__<template-directory>__]
+ [`--separate-git-dir` _<git-dir>_] [++--object-format=++__<format>__]
+ [++--ref-format=++__<format>__]
+ [`-b` _<branch-name>_ | ++--initial-branch=++__<branch-name>__]
+ [++--shared++[++=++__<permissions>__]] [_<directory>_]
DESCRIPTION
@@ -29,94 +30,104 @@ to use instead of `./.git` for the base of the repository.
If the object storage directory is specified via the
`$GIT_OBJECT_DIRECTORY` environment variable then the sha1 directories
-are created underneath - otherwise the default `$GIT_DIR/objects`
+are created underneath; otherwise, the default `$GIT_DIR/objects`
directory is used.
-Running 'git init' in an existing repository is safe. It will not
+Running `git init` in an existing repository is safe. It will not
overwrite things that are already there. The primary reason for
-rerunning 'git init' is to pick up newly added templates (or to move
-the repository to another place if --separate-git-dir is given).
+rerunning `git init` is to pick up newly added templates (or to move
+the repository to another place if `--separate-git-dir` is given).
OPTIONS
-------
--q::
---quiet::
+`-q`::
+`--quiet`::
Only print error and warning messages; all other output will be suppressed.
---bare::
+`--bare`::
Create a bare repository. If `GIT_DIR` environment is not set, it is set to the
current working directory.
---object-format=<format>::
+++--object-format=++__<format>__::
-Specify the given object format (hash algorithm) for the repository. The valid
-values are 'sha1' and (if enabled) 'sha256'. 'sha1' is the default.
+Specify the given object _<format>_ (hash algorithm) for the repository. The valid
+values are `sha1` and (if enabled) `sha256`. `sha1` is the default.
+
include::object-format-disclaimer.txt[]
---template=<template-directory>::
+++--ref-format=++__<format>__::
+
+Specify the given ref storage _<format>_ for the repository. The valid values are:
++
+include::ref-storage-format.txt[]
+
+++--template=++__<template-directory>__::
Specify the directory from which templates will be used. (See the "TEMPLATE
DIRECTORY" section below.)
---separate-git-dir=<git-dir>::
+++--separate-git-dir=++__<git-dir>__::
Instead of initializing the repository as a directory to either `$GIT_DIR` or
`./.git/`, create a text file there containing the path to the actual
-repository. This file acts as filesystem-agnostic Git symbolic link to the
+repository. This file acts as a filesystem-agnostic Git symbolic link to the
repository.
+
-If this is reinitialization, the repository will be moved to the specified path.
+If this is a reinitialization, the repository will be moved to the specified path.
--b <branch-name>::
---initial-branch=<branch-name>::
+`-b` _<branch-name>_::
+++--initial-branch=++__<branch-name>__::
-Use the specified name for the initial branch in the newly created
+Use _<branch-name>_ for the initial branch in the newly created
repository. If not specified, fall back to the default name (currently
`master`, but this is subject to change in the future; the name can be
customized via the `init.defaultBranch` configuration variable).
---shared[=(false|true|umask|group|all|world|everybody|<perm>)]::
+++--shared++[++=++(`false`|`true`|`umask`|`group`|`all`|`world`|`everybody`|_<perm>_)]::
Specify that the Git repository is to be shared amongst several users. This
allows users belonging to the same group to push into that
-repository. When specified, the config variable "core.sharedRepository" is
+repository. When specified, the config variable `core.sharedRepository` is
set so that files and directories under `$GIT_DIR` are created with the
requested permissions. When not specified, Git will use permissions reported
-by umask(2).
+by `umask`(2).
+
-The option can have the following values, defaulting to 'group' if no value
+The option can have the following values, defaulting to `group` if no value
is given:
+
--
-'umask' (or 'false')::
+`umask`::
+`false`::
-Use permissions reported by umask(2). The default, when `--shared` is not
+Use permissions reported by `umask`(2). The default, when `--shared` is not
specified.
-'group' (or 'true')::
+`group`::
+`true`::
-Make the repository group-writable, (and g+sx, since the git group may be not
+Make the repository group-writable, (and `g+sx`, since the git group may not be
the primary group of all users). This is used to loosen the permissions of an
-otherwise safe umask(2) value. Note that the umask still applies to the other
-permission bits (e.g. if umask is '0022', using 'group' will not remove read
-privileges from other (non-group) users). See '0xxx' for how to exactly specify
+otherwise safe `umask`(2) value. Note that the umask still applies to the other
+permission bits (e.g. if umask is `0022`, using `group` will not remove read
+privileges from other (non-group) users). See `0xxx` for how to exactly specify
the repository permissions.
-'all' (or 'world' or 'everybody')::
+`all`::
+`world`::
+`everybody`::
-Same as 'group', but make the repository readable by all users.
+Same as `group`, but make the repository readable by all users.
-'<perm>'::
+_<perm>_::
-'<perm>' is a 3-digit octal number prefixed with `0` and each file
-will have mode '<perm>'. '<perm>' will override users' umask(2)
-value (and not only loosen permissions as 'group' and 'all'
-does). '0640' will create a repository which is group-readable, but
-not group-writable or accessible to others. '0660' will create a repo
+_<perm>_ is a 3-digit octal number prefixed with `0` and each file
+will have mode _<perm>_. _<perm>_ will override users' `umask`(2)
+value (and not only loosen permissions as `group` and `all`
+do). `0640` will create a repository which is group-readable, but
+not group-writable or accessible to others. `0660` will create a repo
that is readable and writable to the current user and group, but
inaccessible to others (directories and executable files get their
`x` bit from the `r` bit for corresponding classes of users).
@@ -126,7 +137,7 @@ By default, the configuration flag `receive.denyNonFastForwards` is enabled
in shared repositories, so that you cannot force a non fast-forwarding push
into it.
-If you provide a 'directory', the command is run inside it. If this directory
+If you provide a _<directory>_, the command is run inside it. If this directory
does not exist, it will be created.
TEMPLATE DIRECTORY
@@ -165,10 +176,19 @@ $ git add . <2>
$ git commit <3>
----------------
+
-<1> Create a /path/to/my/codebase/.git directory.
+<1> Create a `/path/to/my/codebase/.git` directory.
<2> Add all existing files to the index.
<3> Record the pristine state as the first commit in the history.
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+:git-init:
+
+include::config/init.txt[]
+
GIT
---
Part of the linkgit:git[1] suite
diff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-trailers.txt
index 956a01d..d9dfb75 100644
--- a/Documentation/git-interpret-trailers.txt
+++ b/Documentation/git-interpret-trailers.txt
@@ -8,66 +8,106 @@ git-interpret-trailers - Add or parse structured information in commit messages
SYNOPSIS
--------
[verse]
-'git interpret-trailers' [<options>] [(--trailer <token>[(=|:)<value>])...] [<file>...]
-'git interpret-trailers' [<options>] [--parse] [<file>...]
+'git interpret-trailers' [--in-place] [--trim-empty]
+ [(--trailer (<key>|<key-alias>)[(=|:)<value>])...]
+ [--parse] [<file>...]
DESCRIPTION
-----------
-Help parsing or adding 'trailers' lines, that look similar to RFC 822 e-mail
+Add or parse 'trailer' lines that look similar to RFC 822 e-mail
headers, at the end of the otherwise free-form part of a commit
-message.
+message. For example, in the following commit message
-This command reads some patches or commit messages from either the
-<file> arguments or the standard input if no <file> is specified. If
-`--parse` is specified, the output consists of the parsed trailers.
+------------------------------------------------
+subject
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-Otherwise, this command applies the arguments passed using the
-`--trailer` option, if any, to the commit message part of each input
-file. The result is emitted on the standard output.
+Signed-off-by: Alice <alice@example.com>
+Signed-off-by: Bob <bob@example.com>
+------------------------------------------------
+
+the last two lines starting with "Signed-off-by" are trailers.
+
+This command reads commit messages from either the
+<file> arguments or the standard input if no <file> is specified.
+If `--parse` is specified, the output consists of the parsed trailers
+coming from the input, without influencing them with any command line
+options or configuration variables.
+
+Otherwise, this command applies `trailer.*` configuration variables
+(which could potentially add new trailers, as well as reposition them),
+as well as any command line arguments that can override configuration
+variables (such as `--trailer=...` which could also add new trailers),
+to each input file. The result is emitted on the standard output.
+
+This command can also operate on the output of linkgit:git-format-patch[1],
+which is more elaborate than a plain commit message. Namely, such output
+includes a commit message (as above), a "---" divider line, and a patch part.
+For these inputs, the divider and patch parts are not modified by
+this command and are emitted as is on the output, unless
+`--no-divider` is specified.
Some configuration variables control the way the `--trailer` arguments
-are applied to each commit message and the way any existing trailer in
-the commit message is changed. They also make it possible to
+are applied to each input and the way any existing trailer in
+the input is changed. They also make it possible to
automatically add some trailers.
-By default, a '<token>=<value>' or '<token>:<value>' argument given
+By default, a '<key>=<value>' or '<key>:<value>' argument given
using `--trailer` will be appended after the existing trailers only if
-the last trailer has a different (<token>, <value>) pair (or if there
-is no existing trailer). The <token> and <value> parts will be trimmed
+the last trailer has a different (<key>, <value>) pair (or if there
+is no existing trailer). The <key> and <value> parts will be trimmed
to remove starting and trailing whitespace, and the resulting trimmed
-<token> and <value> will appear in the message like this:
+<key> and <value> will appear in the output like this:
------------------------------------------------
-token: value
+key: value
------------------------------------------------
-This means that the trimmed <token> and <value> will be separated by
+This means that the trimmed <key> and <value> will be separated by
`': '` (one colon followed by one space).
+For convenience, a <key-alias> can be configured to make using `--trailer`
+shorter to type on the command line. This can be configured using the
+'trailer.<key-alias>.key' configuration variable. The <keyAlias> must be a prefix
+of the full <key> string, although case sensitivity does not matter. For
+example, if you have
+
+------------------------------------------------
+trailer.sign.key "Signed-off-by: "
+------------------------------------------------
+
+in your configuration, you only need to specify `--trailer="sign: foo"`
+on the command line instead of `--trailer="Signed-off-by: foo"`.
+
By default the new trailer will appear at the end of all the existing
trailers. If there is no existing trailer, the new trailer will appear
-after the commit message part of the output, and, if there is no line
-with only spaces at the end of the commit message part, one blank line
-will be added before the new trailer.
+at the end of the input. A blank line will be added before the new
+trailer if there isn't one already.
-Existing trailers are extracted from the input message by looking for
+Existing trailers are extracted from the input by looking for
a group of one or more lines that (i) is all trailers, or (ii) contains at
least one Git-generated or user-configured trailer and consists of at
least 25% trailers.
The group must be preceded by one or more empty (or whitespace-only) lines.
-The group must either be at the end of the message or be the last
+The group must either be at the end of the input or be the last
non-whitespace lines before a line that starts with '---' (followed by a
-space or the end of the line). Such three minus signs start the patch
-part of the message. See also `--no-divider` below.
+space or the end of the line).
-When reading trailers, there can be whitespaces after the
-token, the separator and the value. There can also be whitespaces
-inside the token and the value. The value may be split over multiple lines with
-each subsequent line starting with whitespace, like the "folding" in RFC 822.
+When reading trailers, there can be no whitespace before or inside the
+<key>, but any number of regular space and tab characters are allowed
+between the <key> and the separator. There can be whitespaces before,
+inside or after the <value>. The <value> may be split over multiple lines
+with each subsequent line starting with at least one whitespace, like
+the "folding" in RFC 822. Example:
-Note that 'trailers' do not follow and are not intended to follow many
-rules for RFC 822 headers. For example they do not follow
-the encoding rules and probably many other rules.
+------------------------------------------------
+key: This is a very long value, with spaces and
+ newlines in it.
+------------------------------------------------
+
+Note that trailers do not follow (nor are they intended to follow) many of the
+rules for RFC 822 headers. For example they do not follow the encoding rule.
OPTIONS
-------
@@ -76,38 +116,47 @@ OPTIONS
--trim-empty::
If the <value> part of any trailer contains only whitespace,
- the whole trailer will be removed from the resulting message.
+ the whole trailer will be removed from the output.
This applies to existing trailers as well as new trailers.
---trailer <token>[(=|:)<value>]::
- Specify a (<token>, <value>) pair that should be applied as a
- trailer to the input messages. See the description of this
+--trailer <key>[(=|:)<value>]::
+ Specify a (<key>, <value>) pair that should be applied as a
+ trailer to the inputs. See the description of this
command.
--where <placement>::
--no-where::
Specify where all new trailers will be added. A setting
- provided with '--where' overrides all configuration variables
+ provided with '--where' overrides the `trailer.where` and any
+ applicable `trailer.<keyAlias>.where` configuration variables
and applies to all '--trailer' options until the next occurrence of
- '--where' or '--no-where'. Possible values are `after`, `before`,
- `end` or `start`.
+ '--where' or '--no-where'. Upon encountering '--no-where', clear the
+ effect of any previous use of '--where', such that the relevant configuration
+ variables are no longer overridden. Possible placements are `after`,
+ `before`, `end` or `start`.
--if-exists <action>::
--no-if-exists::
Specify what action will be performed when there is already at
- least one trailer with the same <token> in the message. A setting
- provided with '--if-exists' overrides all configuration variables
+ least one trailer with the same <key> in the input. A setting
+ provided with '--if-exists' overrides the `trailer.ifExists` and any
+ applicable `trailer.<keyAlias>.ifExists` configuration variables
and applies to all '--trailer' options until the next occurrence of
- '--if-exists' or '--no-if-exists'. Possible actions are `addIfDifferent`,
+ '--if-exists' or '--no-if-exists'. Upon encountering '--no-if-exists, clear the
+ effect of any previous use of '--if-exists, such that the relevant configuration
+ variables are no longer overridden. Possible actions are `addIfDifferent`,
`addIfDifferentNeighbor`, `add`, `replace` and `doNothing`.
--if-missing <action>::
--no-if-missing::
Specify what action will be performed when there is no other
- trailer with the same <token> in the message. A setting
- provided with '--if-missing' overrides all configuration variables
+ trailer with the same <key> in the input. A setting
+ provided with '--if-missing' overrides the `trailer.ifMissing` and any
+ applicable `trailer.<keyAlias>.ifMissing` configuration variables
and applies to all '--trailer' options until the next occurrence of
- '--if-missing' or '--no-if-missing'. Possible actions are `doNothing`
+ '--if-missing' or '--no-if-missing'. Upon encountering '--no-if-missing,
+ clear the effect of any previous use of '--if-missing, such that the relevant
+ configuration variables are no longer overridden. Possible actions are `doNothing`
or `add`.
--only-trailers::
@@ -115,16 +164,19 @@ OPTIONS
--only-input::
Output only trailers that exist in the input; do not add any
- from the command-line or by following configured `trailer.*`
- rules.
+ from the command-line or by applying `trailer.*` configuration
+ variables.
--unfold::
- Remove any whitespace-continuation in trailers, so that each
- trailer appears on a line by itself with its full content.
+ If a trailer has a value that runs over multiple lines (aka "folded"),
+ reformat the value into a single line.
--parse::
A convenience alias for `--only-trailers --only-input
- --unfold`.
+ --unfold`. This makes it easier to only see the trailers coming from the
+ input without influencing them with any command line options or
+ configuration variables, while also making the output machine-friendly with
+ --unfold.
--no-divider::
Do not treat `---` as the end of the commit message. Use this
@@ -145,11 +197,11 @@ used when another separator is not specified in the config for this
trailer.
+
For example, if the value for this option is "%=$", then only lines
-using the format '<token><sep><value>' with <sep> containing '%', '='
+using the format '<key><sep><value>' with <sep> containing '%', '='
or '$' and then spaces will be considered trailers. And '%' will be
the default separator used, so by default trailers will appear like:
-'<token>% <value>' (one percent sign and one space will appear between
-the token and the value).
+'<key>% <value>' (one percent sign and one space will appear between
+the key and the value).
trailer.where::
This option tells where a new trailer will be added.
@@ -163,41 +215,41 @@ If it is `start`, then each new trailer will appear at the start,
instead of the end, of the existing trailers.
+
If it is `after`, then each new trailer will appear just after the
-last trailer with the same <token>.
+last trailer with the same <key>.
+
If it is `before`, then each new trailer will appear just before the
-first trailer with the same <token>.
+first trailer with the same <key>.
trailer.ifexists::
This option makes it possible to choose what action will be
performed when there is already at least one trailer with the
- same <token> in the message.
+ same <key> in the input.
+
The valid values for this option are: `addIfDifferentNeighbor` (this
is the default), `addIfDifferent`, `add`, `replace` or `doNothing`.
+
With `addIfDifferentNeighbor`, a new trailer will be added only if no
-trailer with the same (<token>, <value>) pair is above or below the line
+trailer with the same (<key>, <value>) pair is above or below the line
where the new trailer will be added.
+
With `addIfDifferent`, a new trailer will be added only if no trailer
-with the same (<token>, <value>) pair is already in the message.
+with the same (<key>, <value>) pair is already in the input.
+
With `add`, a new trailer will be added, even if some trailers with
-the same (<token>, <value>) pair are already in the message.
+the same (<key>, <value>) pair are already in the input.
+
-With `replace`, an existing trailer with the same <token> will be
+With `replace`, an existing trailer with the same <key> will be
deleted and the new trailer will be added. The deleted trailer will be
-the closest one (with the same <token>) to the place where the new one
+the closest one (with the same <key>) to the place where the new one
will be added.
+
With `doNothing`, nothing will be done; that is no new trailer will be
-added if there is already one with the same <token> in the message.
+added if there is already one with the same <key> in the input.
trailer.ifmissing::
This option makes it possible to choose what action will be
performed when there is not yet any trailer with the same
- <token> in the message.
+ <key> in the input.
+
The valid values for this option are: `add` (this is the default) and
`doNothing`.
@@ -206,100 +258,106 @@ With `add`, a new trailer will be added.
+
With `doNothing`, nothing will be done.
-trailer.<token>.key::
- This `key` will be used instead of <token> in the trailer. At
- the end of this key, a separator can appear and then some
- space characters. By default the only valid separator is ':',
- but this can be changed using the `trailer.separators` config
- variable.
+trailer.<keyAlias>.key::
+ Defines a <keyAlias> for the <key>. The <keyAlias> must be a
+ prefix (case does not matter) of the <key>. For example, in `git
+ config trailer.ack.key "Acked-by"` the "Acked-by" is the <key> and
+ the "ack" is the <keyAlias>. This configuration allows the shorter
+ `--trailer "ack:..."` invocation on the command line using the "ack"
+ <keyAlias> instead of the longer `--trailer "Acked-by:..."`.
++
+At the end of the <key>, a separator can appear and then some
+space characters. By default the only valid separator is ':',
+but this can be changed using the `trailer.separators` config
+variable.
+
-If there is a separator, then the key will be used instead of both the
-<token> and the default separator when adding the trailer.
+If there is a separator in the key, then it overrides the default
+separator when adding the trailer.
-trailer.<token>.where::
+trailer.<keyAlias>.where::
This option takes the same values as the 'trailer.where'
configuration variable and it overrides what is specified by
- that option for trailers with the specified <token>.
+ that option for trailers with the specified <keyAlias>.
-trailer.<token>.ifexists::
+trailer.<keyAlias>.ifexists::
This option takes the same values as the 'trailer.ifexists'
configuration variable and it overrides what is specified by
- that option for trailers with the specified <token>.
+ that option for trailers with the specified <keyAlias>.
-trailer.<token>.ifmissing::
+trailer.<keyAlias>.ifmissing::
This option takes the same values as the 'trailer.ifmissing'
configuration variable and it overrides what is specified by
- that option for trailers with the specified <token>.
+ that option for trailers with the specified <keyAlias>.
-trailer.<token>.command::
- This option behaves in the same way as 'trailer.<token>.cmd', except
+trailer.<keyAlias>.command::
+ Deprecated in favor of 'trailer.<keyAlias>.cmd'.
+ This option behaves in the same way as 'trailer.<keyAlias>.cmd', except
that it doesn't pass anything as argument to the specified command.
Instead the first occurrence of substring $ARG is replaced by the
- value that would be passed as argument.
+ <value> that would be passed as argument.
+
-The 'trailer.<token>.command' option has been deprecated in favor of
-'trailer.<token>.cmd' due to the fact that $ARG in the user's command is
+Note that $ARG in the user's command is
only replaced once and that the original way of replacing $ARG is not safe.
+
-When both 'trailer.<token>.cmd' and 'trailer.<token>.command' are given
-for the same <token>, 'trailer.<token>.cmd' is used and
-'trailer.<token>.command' is ignored.
-
-trailer.<token>.cmd::
- This option can be used to specify a shell command that will be called:
- once to automatically add a trailer with the specified <token>, and then
- each time a '--trailer <token>=<value>' argument to modify the <value> of
- the trailer that this option would produce.
+When both 'trailer.<keyAlias>.cmd' and 'trailer.<keyAlias>.command' are given
+for the same <keyAlias>, 'trailer.<keyAlias>.cmd' is used and
+'trailer.<keyAlias>.command' is ignored.
+
+trailer.<keyAlias>.cmd::
+ This option can be used to specify a shell command that will be called
+ once to automatically add a trailer with the specified <keyAlias>, and then
+ called each time a '--trailer <keyAlias>=<value>' argument is specified to
+ modify the <value> of the trailer that this option would produce.
+
When the specified command is first called to add a trailer
-with the specified <token>, the behavior is as if a special
-'--trailer <token>=<value>' argument was added at the beginning
+with the specified <keyAlias>, the behavior is as if a special
+'--trailer <keyAlias>=<value>' argument was added at the beginning
of the "git interpret-trailers" command, where <value>
is taken to be the standard output of the command with any
leading and trailing whitespace trimmed off.
+
-If some '--trailer <token>=<value>' arguments are also passed
+If some '--trailer <keyAlias>=<value>' arguments are also passed
on the command line, the command is called again once for each
-of these arguments with the same <token>. And the <value> part
+of these arguments with the same <keyAlias>. And the <value> part
of these arguments, if any, will be passed to the command as its
first argument. This way the command can produce a <value> computed
-from the <value> passed in the '--trailer <token>=<value>' argument.
+from the <value> passed in the '--trailer <keyAlias>=<value>' argument.
EXAMPLES
--------
* Configure a 'sign' trailer with a 'Signed-off-by' key, and then
- add two of these trailers to a message:
+ add two of these trailers to a commit message file:
+
------------
$ git config trailer.sign.key "Signed-off-by"
$ cat msg.txt
subject
-message
-$ cat msg.txt | git interpret-trailers --trailer 'sign: Alice <alice@example.com>' --trailer 'sign: Bob <bob@example.com>'
+body text
+$ git interpret-trailers --trailer 'sign: Alice <alice@example.com>' --trailer 'sign: Bob <bob@example.com>' <msg.txt
subject
-message
+body text
Signed-off-by: Alice <alice@example.com>
Signed-off-by: Bob <bob@example.com>
------------
-* Use the `--in-place` option to edit a message file in place:
+* Use the `--in-place` option to edit a commit message file in place:
+
------------
$ cat msg.txt
subject
-message
+body text
Signed-off-by: Bob <bob@example.com>
$ git interpret-trailers --trailer 'Acked-by: Alice <alice@example.com>' --in-place msg.txt
$ cat msg.txt
subject
-message
+body text
Signed-off-by: Bob <bob@example.com>
Acked-by: Alice <alice@example.com>
@@ -319,17 +377,30 @@ $ git interpret-trailers --trailer 'Cc: Alice <alice@example.com>' --trailer 'Re
'Signed-off-by: ' already, and show how it works:
+
------------
+$ cat msg1.txt
+subject
+
+body text
$ git config trailer.sign.key "Signed-off-by: "
$ git config trailer.sign.ifmissing add
$ git config trailer.sign.ifexists doNothing
-$ git config trailer.sign.command 'echo "$(git config user.name) <$(git config user.email)>"'
-$ git interpret-trailers <<EOF
-> EOF
+$ git config trailer.sign.cmd 'echo "$(git config user.name) <$(git config user.email)>"'
+$ git interpret-trailers --trailer sign <msg1.txt
+subject
+
+body text
Signed-off-by: Bob <bob@example.com>
-$ git interpret-trailers <<EOF
-> Signed-off-by: Alice <alice@example.com>
-> EOF
+$ cat msg2.txt
+subject
+
+body text
+
+Signed-off-by: Alice <alice@example.com>
+$ git interpret-trailers --trailer sign <msg2.txt
+subject
+
+body text
Signed-off-by: Alice <alice@example.com>
------------
@@ -354,18 +425,17 @@ Fix #42
$ cat ~/bin/glog-find-author
#!/bin/sh
test -n "$1" && git log --author="$1" --pretty="%an <%ae>" -1 || true
+$ cat msg.txt
+subject
+
+body text
$ git config trailer.help.key "Helped-by: "
$ git config trailer.help.ifExists "addIfDifferentNeighbor"
$ git config trailer.help.cmd "~/bin/glog-find-author"
-$ git interpret-trailers --trailer="help:Junio" --trailer="help:Couder" <<EOF
-> subject
->
-> message
->
-> EOF
+$ git interpret-trailers --trailer="help:Junio" --trailer="help:Couder" <msg.txt
subject
-message
+body text
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Christian Couder <christian.couder@gmail.com>
@@ -379,18 +449,17 @@ Helped-by: Christian Couder <christian.couder@gmail.com>
$ cat ~/bin/glog-grep
#!/bin/sh
test -n "$1" && git log --grep "$1" --pretty=reference -1 || true
+$ cat msg.txt
+subject
+
+body text
$ git config trailer.ref.key "Reference-to: "
$ git config trailer.ref.ifExists "replace"
$ git config trailer.ref.cmd "~/bin/glog-grep"
-$ git interpret-trailers --trailer="ref:Add copyright notices." <<EOF
-> subject
->
-> message
->
-> EOF
+$ git interpret-trailers --trailer="ref:Add copyright notices." <msg.txt
subject
-message
+body text
Reference-to: 8bc9a0c769 (Add copyright notices., 2005-04-07)
------------
@@ -399,20 +468,23 @@ Reference-to: 8bc9a0c769 (Add copyright notices., 2005-04-07)
commit that is related, and show how it works:
+
------------
+$ cat msg.txt
+subject
+
+body text
+
+see: HEAD~2
+$ cat ~/bin/glog-ref
+#!/bin/sh
+git log -1 --oneline --format="%h (%s)" --abbrev-commit --abbrev=14
$ git config trailer.see.key "See-also: "
$ git config trailer.see.ifExists "replace"
$ git config trailer.see.ifMissing "doNothing"
-$ git config trailer.see.command "git log -1 --oneline --format=\"%h (%s)\" --abbrev-commit --abbrev=14 \$ARG"
-$ git interpret-trailers <<EOF
-> subject
->
-> message
->
-> see: HEAD~2
-> EOF
+$ git config trailer.see.cmd "glog-ref"
+$ git interpret-trailers --trailer=see <msg.txt
subject
-message
+body text
See-also: fe3187489d69c4 (subject of related commit)
------------
@@ -424,22 +496,21 @@ See-also: fe3187489d69c4 (subject of related commit)
to add a 'git-version' trailer:
+
------------
-$ sed -e 's/ Z$/ /' >commit_template.txt <<EOF
-> ***subject***
->
-> ***message***
->
-> Fixes: Z
-> Cc: Z
-> Reviewed-by: Z
-> Signed-off-by: Z
-> EOF
+$ cat temp.txt
+***subject***
+
+***message***
+
+Fixes: Z
+Cc: Z
+Reviewed-by: Z
+Signed-off-by: Z
+$ sed -e 's/ Z$/ /' temp.txt > commit_template.txt
$ git config commit.template commit_template.txt
-$ cat >.git/hooks/commit-msg <<EOF
-> #!/bin/sh
-> git interpret-trailers --trim-empty --trailer "git-version: \$(git describe)" "\$1" > "\$1.new"
-> mv "\$1.new" "\$1"
-> EOF
+$ cat .git/hooks/commit-msg
+#!/bin/sh
+git interpret-trailers --trim-empty --trailer "git-version: \$(git describe)" "\$1" > "\$1.new"
+mv "\$1.new" "\$1"
$ chmod +x .git/hooks/commit-msg
------------
diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index 20e87ce..5796821 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -45,13 +45,23 @@ OPTIONS
--decorate-refs=<pattern>::
--decorate-refs-exclude=<pattern>::
- If no `--decorate-refs` is given, pretend as if all refs were
- included. For each candidate, do not use it for decoration if it
+ For each candidate reference, do not use it for decoration if it
matches any patterns given to `--decorate-refs-exclude` or if it
doesn't match any of the patterns given to `--decorate-refs`. The
`log.excludeDecoration` config option allows excluding refs from
the decorations, but an explicit `--decorate-refs` pattern will
override a match in `log.excludeDecoration`.
++
+If none of these options or config settings are given, then references are
+used as decoration if they match `HEAD`, `refs/heads/`, `refs/remotes/`,
+`refs/stash/`, or `refs/tags/`.
+
+--clear-decorations::
+ When specified, this option clears all previous `--decorate-refs`
+ or `--decorate-refs-exclude` options and relaxes the default
+ decoration filter to include all references. This option is
+ assumed if the config value `log.initialDecorationSet` is set to
+ `all`.
--source::
Print out the ref name given on the command line by which each
@@ -110,11 +120,11 @@ By default, `git log` does not generate any diff output. The options
below can be used to show the changes made by each commit.
Note that unless one of `--diff-merges` variants (including short
-`-m`, `-c`, and `--cc` options) is explicitly given, merge commits
+`-m`, `-c`, `--cc`, and `--dd` options) is explicitly given, merge commits
will not show a diff, even if a diff format like `--patch` is
selected, nor will they match search options like `-S`. The exception
is when `--first-parent` is in use, in which case `first-parent` is
-the default format.
+the default format for merge commits.
:git-log: 1
:diff-merges-default: `off`
@@ -199,47 +209,11 @@ i18n.logOutputEncoding::
Defaults to the value of `i18n.commitEncoding` if set, and UTF-8
otherwise.
-log.date::
- Default format for human-readable dates. (Compare the
- `--date` option.) Defaults to "default", which means to write
- dates like `Sat May 8 19:35:34 2010 -0500`.
-+
-If the format is set to "auto:foo" and the pager is in use, format
-"foo" will be the used for the date format. Otherwise "default" will
-be used.
-
-log.follow::
- If `true`, `git log` will act as if the `--follow` option was used when
- a single <path> is given. This has the same limitations as `--follow`,
- i.e. it cannot be used to follow multiple files and does not work well
- on non-linear history.
-
-log.showRoot::
- If `false`, `git log` and related commands will not treat the
- initial commit as a big creation event. Any root commits in
- `git log -p` output would be shown without a diff attached.
- The default is `true`.
-
-log.showSignature::
- If `true`, `git log` and related commands will act as if the
- `--show-signature` option was passed to them.
-
-mailmap.*::
- See linkgit:git-shortlog[1].
-
-notes.displayRef::
- Which refs, in addition to the default set by `core.notesRef`
- or `GIT_NOTES_REF`, to read notes from when showing commit
- messages with the `log` family of commands. See
- linkgit:git-notes[1].
-+
-May be an unabbreviated ref name or a glob and may be specified
-multiple times. A warning will be issued for refs that do not exist,
-but a glob that does not match any refs is silently ignored.
-+
-This setting can be disabled by the `--no-notes` option,
-overridden by the `GIT_NOTES_DISPLAY_REF` environment variable,
-and overridden by the `--notes=<ref>` option.
+include::includes/cmd-config-section-rest.txt[]
+
+include::config/log.txt[]
+
+include::config/notes.txt[]
GIT
---
diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt
index 0dabf3f..d08c7da 100644
--- a/Documentation/git-ls-files.txt
+++ b/Documentation/git-ls-files.txt
@@ -10,8 +10,9 @@ SYNOPSIS
--------
[verse]
'git ls-files' [-z] [-t] [-v] [-f]
- [-c|--cached] [-d|--deleted] [-o|--others] [-i|--|ignored]
- [-s|--stage] [-u|--unmerged] [-k|--|killed] [-m|--modified]
+ [-c|--cached] [-d|--deleted] [-o|--others] [-i|--ignored]
+ [-s|--stage] [-u|--unmerged] [-k|--killed] [-m|--modified]
+ [--resolve-undo]
[--directory [--no-empty-directory]] [--eol]
[--deduplicate]
[-x <pattern>|--exclude=<pattern>]
@@ -20,29 +21,34 @@ SYNOPSIS
[--exclude-standard]
[--error-unmatch] [--with-tree=<tree-ish>]
[--full-name] [--recurse-submodules]
- [--abbrev[=<n>]] [--] [<file>...]
+ [--abbrev[=<n>]] [--format=<format>] [--] [<file>...]
DESCRIPTION
-----------
-This merges the file listing in the index with the actual working
+This command merges the file listing in the index with the actual working
directory list, and shows different combinations of the two.
-One or more of the options below may be used to determine the files
-shown:
+Several flags can be used to determine which files are
+shown, and each file may be printed multiple times if there are
+multiple entries in the index or if multiple statuses are applicable for
+the relevant file selection options.
OPTIONS
-------
-c::
--cached::
- Show cached files in the output (default)
+ Show all files cached in Git's index, i.e. all tracked files.
+ (This is the default if no -c/-s/-d/-o/-u/-k/-m/--resolve-undo
+ options are specified.)
-d::
--deleted::
- Show deleted files in the output
+ Show files with an unstaged deletion
-m::
--modified::
- Show modified files in the output
+ Show files with an unstaged modification (note that an unstaged
+ deletion also counts as an unstaged modification)
-o::
--others::
@@ -50,11 +56,14 @@ OPTIONS
-i::
--ignored::
- Show only ignored files in the output. When showing files in the
- index, print only those matched by an exclude pattern. When
- showing "other" files, show only those matched by an exclude
- pattern. Standard ignore rules are not automatically activated,
- therefore at least one of the `--exclude*` options is required.
+ Show only ignored files in the output. Must be used with
+ either an explicit '-c' or '-o'. When showing files in the
+ index (i.e. when used with '-c'), print only those files
+ matching an exclude pattern. When showing "other" files
+ (i.e. when used with '-o'), show only those matched by an
+ exclude pattern. Standard ignore rules are not automatically
+ activated; therefore, at least one of the `--exclude*` options
+ is required.
-s::
--stage::
@@ -63,19 +72,29 @@ OPTIONS
--directory::
If a whole directory is classified as "other", show just its
name (with a trailing slash) and not its whole contents.
+ Has no effect without -o/--others.
--no-empty-directory::
Do not list empty directories. Has no effect without --directory.
-u::
--unmerged::
- Show unmerged files in the output (forces --stage)
+ Show information about unmerged files in the output, but do
+ not show any other tracked files (forces --stage, overrides
+ --cached).
-k::
--killed::
- Show files on the filesystem that need to be removed due
- to file/directory conflicts for checkout-index to
- succeed.
+ Show untracked files on the filesystem that need to be removed
+ due to file/directory conflicts for tracked files to be able to
+ be written to the filesystem.
+
+--resolve-undo::
+ Show files having resolve-undo information in the index
+ together with their resolve-undo information. (resolve-undo
+ information is what is used to implement "git checkout -m
+ $PATH", i.e. to recreate merge conflicts that were
+ accidentally resolved)
-z::
\0 line termination on output and do not quote filenames.
@@ -100,7 +119,10 @@ OPTIONS
--exclude-per-directory=<file>::
Read additional exclude patterns that apply only to the
- directory and its subdirectories in <file>.
+ directory and its subdirectories in <file>. If you are
+ trying to emulate the way Porcelain commands work, using
+ the `--exclude-standard` option instead is easier and more
+ thorough.
--exclude-standard::
Add the standard Git exclusions: .git/info/exclude, .gitignore
@@ -118,24 +140,27 @@ OPTIONS
with `-s` or `-u` options does not make any sense.
-t::
- This feature is semi-deprecated. For scripting purpose,
- linkgit:git-status[1] `--porcelain` and
+ Show status tags together with filenames. Note that for
+ scripting purposes, linkgit:git-status[1] `--porcelain` and
linkgit:git-diff-files[1] `--name-status` are almost always
- superior alternatives, and users should look at
+ superior alternatives; users should look at
linkgit:git-status[1] `--short` or linkgit:git-diff[1]
`--name-status` for more user-friendly alternatives.
+
--
-This option identifies the file status with the following tags (followed by
-a space) at the start of each line:
-
- H:: cached
- S:: skip-worktree
- M:: unmerged
- R:: removed/deleted
- C:: modified/changed
- K:: to be killed
- ?:: other
+This option provides a reason for showing each filename, in the form
+of a status tag (which is followed by a space and then the filename).
+The status tags are all single characters from the following list:
+
+ H:: tracked file that is not either unmerged or skip-worktree
+ S:: tracked file that is skip-worktree
+ M:: tracked file that is unmerged
+ R:: tracked file with unstaged removal/deletion
+ C:: tracked file with unstaged modification/change
+ K:: untracked paths which are part of file/directory conflicts
+ which prevent checking out tracked files
+ ?:: untracked file
+ U:: file with resolve-undo information
--
-v::
@@ -192,6 +217,13 @@ followed by the ("attr/<eolattr>").
to the contained files. Sparse directories will be shown with a
trailing slash, such as "x/" for a sparse directory "x".
+--format=<format>::
+ A string that interpolates `%(fieldname)` from the result being shown.
+ It also interpolates `%%` to `%`, and `%xx` where `xx` are hex digits
+ interpolates to character with hex code `xx`; for example `%00`
+ interpolates to `\0` (NUL), `%09` to `\t` (TAB) and %0a to `\n` (LF).
+ --format cannot be combined with `-s`, `-o`, `-k`, `-t`, `--resolve-undo`
+ and `--eol`.
\--::
Do not interpret any more arguments as options.
@@ -223,6 +255,42 @@ quoted as explained for the configuration variable `core.quotePath`
(see linkgit:git-config[1]). Using `-z` the filename is output
verbatim and the line is terminated by a NUL byte.
+It is possible to print in a custom format by using the `--format`
+option, which is able to interpolate different fields using
+a `%(fieldname)` notation. For example, if you only care about the
+"objectname" and "path" fields, you can execute with a specific
+"--format" like
+
+ git ls-files --format='%(objectname) %(path)'
+
+FIELD NAMES
+-----------
+The way each path is shown can be customized by using the
+`--format=<format>` option, where the %(fieldname) in the
+<format> string for various aspects of the index entry are
+interpolated. The following "fieldname" are understood:
+
+objectmode::
+ The mode of the file which is recorded in the index.
+objecttype::
+ The object type of the file which is recorded in the index.
+objectname::
+ The name of the file which is recorded in the index.
+objectsize[:padded]::
+ The object size of the file which is recorded in the index
+ ("-" if the object is a `commit` or `tree`).
+ It also supports a padded format of size with "%(objectsize:padded)".
+stage::
+ The stage of the file which is recorded in the index.
+eolinfo:index::
+eolinfo:worktree::
+ The <eolinfo> (see the description of the `--eol` option) of
+ the contents in the index or in the worktree for the path.
+eolattr::
+ The <eolattr> (see the description of the `--eol` option)
+ that applies to the path.
+path::
+ The pathname of the file which is recorded in the index.
EXCLUDE PATTERNS
----------------
@@ -232,7 +300,8 @@ traversing the directory tree and finding files to show when the
flags --others or --ignored are specified. linkgit:gitignore[5]
specifies the format of exclude patterns.
-These exclude patterns come from these places, in order:
+These exclude patterns can be specified from the following places,
+in order:
1. The command-line flag --exclude=<pattern> specifies a
single pattern. Patterns are ordered in the same order
@@ -254,6 +323,18 @@ top of the directory tree. A pattern read from a file specified
by --exclude-per-directory is relative to the directory that the
pattern file appears in.
+Generally, you should be able to use `--exclude-standard` when you
+want the exclude rules applied the same way as what Porcelain
+commands do. To emulate what `--exclude-standard` specifies, you
+can give `--exclude-per-directory=.gitignore`, and then specify:
+
+ 1. The file specified by the `core.excludesfile` configuration
+ variable, if exists, or the `$XDG_CONFIG_HOME/git/ignore` file.
+
+ 2. The `$GIT_DIR/info/exclude` file.
+
+via the `--exclude-from=` option.
+
SEE ALSO
--------
linkgit:git-read-tree[1], linkgit:gitignore[5]
diff --git a/Documentation/git-ls-remote.txt b/Documentation/git-ls-remote.txt
index 492e573..1c4f696 100644
--- a/Documentation/git-ls-remote.txt
+++ b/Documentation/git-ls-remote.txt
@@ -11,7 +11,7 @@ SYNOPSIS
[verse]
'git ls-remote' [--heads] [--tags] [--refs] [--upload-pack=<exec>]
[-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]
- [--symref] [<repository> [<refs>...]]
+ [--symref] [<repository> [<patterns>...]]
DESCRIPTION
-----------
@@ -85,31 +85,62 @@ OPTIONS
either a URL or the name of a remote (see the GIT URLS and
REMOTES sections of linkgit:git-fetch[1]).
-<refs>...::
+<patterns>...::
When unspecified, all references, after filtering done
- with --heads and --tags, are shown. When <refs>... are
- specified, only references matching the given patterns
- are displayed.
+ with --heads and --tags, are shown. When <patterns>... are
+ specified, only references matching one or more of the given
+ patterns are displayed. Each pattern is interpreted as a glob
+ (see `glob` in linkgit:gitglossary[7]) which is matched against
+ the "tail" of a ref, starting either from the start of the ref
+ (so a full name like `refs/heads/foo` matches) or from a slash
+ separator (so `bar` matches `refs/heads/bar` but not
+ `refs/heads/foobar`).
+
+OUTPUT
+------
+
+The output is in the format:
+
+------------
+<oid> TAB <ref> LF
+------------
+
+When showing an annotated tag, unless `--refs` is given, two such
+lines are shown: one with the refname for the tag itself as `<ref>`,
+and another with `<ref>` followed by `^{}`. The `<oid>` on the latter
+line shows the name of the object the tag points at.
EXAMPLES
--------
+* List all references (including symbolics and pseudorefs), peeling
+ tags:
++
+----
+$ git ls-remote
+27d43aaaf50ef0ae014b88bba294f93658016a2e HEAD
+950264636c68591989456e3ba0a5442f93152c1a refs/heads/main
+d9ab777d41f92a8c1684c91cfb02053d7dd1046b refs/heads/next
+d4ca2e3147b409459955613c152220f4db848ee1 refs/tags/v2.40.0
+73876f4861cd3d187a4682290ab75c9dccadbc56 refs/tags/v2.40.0^{}
+----
+
+* List all references matching given patterns:
++
----
-$ git ls-remote --tags ./.
-d6602ec5194c87b0fc87103ca4d67251c76f233a refs/tags/v0.99
-f25a265a342aed6041ab0cc484224d9ca54b6f41 refs/tags/v0.99.1
-7ceca275d047c90c0c7d5afb13ab97efdf51bd6e refs/tags/v0.99.3
-c5db5456ae3b0873fc659c19fafdde22313cc441 refs/tags/v0.99.2
-0918385dbd9656cab0d1d81ba7453d49bbc16250 refs/tags/junio-gpg-pub
$ git ls-remote http://www.kernel.org/pub/scm/git/git.git master seen rc
5fe978a5381f1fbad26a80e682ddd2a401966740 refs/heads/master
c781a84b5204fb294c9ccc79f8b3baceeb32c061 refs/heads/seen
-$ git remote add korg http://www.kernel.org/pub/scm/git/git.git
-$ git ls-remote --tags korg v\*
-d6602ec5194c87b0fc87103ca4d67251c76f233a refs/tags/v0.99
-f25a265a342aed6041ab0cc484224d9ca54b6f41 refs/tags/v0.99.1
-c5db5456ae3b0873fc659c19fafdde22313cc441 refs/tags/v0.99.2
-7ceca275d047c90c0c7d5afb13ab97efdf51bd6e refs/tags/v0.99.3
+----
+
+* List only tags matching a given wildcard pattern:
++
+----
+$ git ls-remote --tags http://www.kernel.org/pub/scm/git/git.git v\*
+485a869c64a68cc5795dd99689797c5900f4716d refs/tags/v2.39.2
+cbf04937d5b9fcf0a76c28f69e6294e9e3ecd7e6 refs/tags/v2.39.2^{}
+d4ca2e3147b409459955613c152220f4db848ee1 refs/tags/v2.40.0
+73876f4861cd3d187a4682290ab75c9dccadbc56 refs/tags/v2.40.0^{}
----
SEE ALSO
diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt
index 0240adb..6572095 100644
--- a/Documentation/git-ls-tree.txt
+++ b/Documentation/git-ls-tree.txt
@@ -86,9 +86,9 @@ OPTIONS
--format=<format>::
A string that interpolates `%(fieldname)` from the result
being shown. It also interpolates `%%` to `%`, and
- `%xx` where `xx` are hex digits interpolates to character
- with hex code `xx`; for example `%00` interpolates to
- `\0` (NUL), `%09` to `\t` (TAB) and `%0a` to `\n` (LF).
+ `%xNN` where `NN` are hex digits interpolates to character
+ with hex code `NN`; for example `%x00` interpolates to
+ `\0` (NUL), `%x09` to `\t` (TAB) and `%x0a` to `\n` (LF).
When specified, `--format` cannot be combined with other
format-altering options, including `--long`, `--name-only`
and `--object-only`.
@@ -145,7 +145,7 @@ FIELD NAMES
-----------
Various values from structured fields can be used to interpolate
-into the resulting output. For each outputing line, the following
+into the resulting output. For each outputting line, the following
names can be used:
objectmode::
diff --git a/Documentation/git-mailinfo.txt b/Documentation/git-mailinfo.txt
index 3fcfd96..2806028 100644
--- a/Documentation/git-mailinfo.txt
+++ b/Documentation/git-mailinfo.txt
@@ -115,6 +115,13 @@ If no such configuration option has been set, `warn` will be used.
<patch>::
The patch extracted from e-mail.
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/mailinfo.txt[]
+
GIT
---
Part of the linkgit:git[1] suite
diff --git a/Documentation/git-mailsplit.txt b/Documentation/git-mailsplit.txt
index e3b2a88..3f0a666 100644
--- a/Documentation/git-mailsplit.txt
+++ b/Documentation/git-mailsplit.txt
@@ -34,7 +34,7 @@ OPTIONS
-b::
If any file doesn't begin with a From line, assume it is a
- single mail message instead of signaling error.
+ single mail message instead of signaling an error.
-d<prec>::
Instead of the default 4 digits with leading zeros,
diff --git a/Documentation/git-maintenance.txt b/Documentation/git-maintenance.txt
index e56bad2..51d0f7e 100644
--- a/Documentation/git-maintenance.txt
+++ b/Documentation/git-maintenance.txt
@@ -11,7 +11,7 @@ SYNOPSIS
[verse]
'git maintenance' run [<options>]
'git maintenance' start [--scheduler=<scheduler>]
-'git maintenance' (stop|register|unregister)
+'git maintenance' (stop|register|unregister) [<options>]
DESCRIPTION
@@ -50,13 +50,13 @@ stop::
the background maintenance is restarted later.
register::
- Initialize Git config values so any scheduled maintenance will
- start running on this repository. This adds the repository to the
- `maintenance.repo` config variable in the current user's global
- config and enables some recommended configuration values for
- `maintenance.<task>.schedule`. The tasks that are enabled are safe
- for running in the background without disrupting foreground
- processes.
+ Initialize Git config values so any scheduled maintenance will start
+ running on this repository. This adds the repository to the
+ `maintenance.repo` config variable in the current user's global config,
+ or the config specified by --config-file option, and enables some
+ recommended configuration values for `maintenance.<task>.schedule`. The
+ tasks that are enabled are safe for running in the background without
+ disrupting foreground processes.
+
The `register` subcommand will also set the `maintenance.strategy` config
value to `incremental`, if this value is not previously set. The
@@ -79,6 +79,10 @@ unregister::
Remove the current repository from background maintenance. This
only removes the repository from the configured list. It does not
stop the background maintenance processes from running.
++
+The `unregister` subcommand will report an error if the current repository
+is not already registered. Use the `--force` option to return success even
+when the current repository is not registered.
TASKS
-----
@@ -98,9 +102,9 @@ prefetch::
requested refs within `refs/prefetch/`. Also, tags are not updated.
+
This is done to avoid disrupting the remote-tracking branches. The end users
-expect these refs to stay unmoved unless they initiate a fetch. With prefetch
-task, however, the objects necessary to complete a later real fetch would
-already be obtained, so the real fetch would go faster. In the ideal case,
+expect these refs to stay unmoved unless they initiate a fetch. However,
+with the prefetch task, the objects necessary to complete a later real fetch
+would already be obtained, making the real fetch faster. In the ideal case,
it will just become an update to a bunch of remote-tracking branches without
any object transfer.
@@ -397,6 +401,13 @@ If you want to customize the background tasks, please rename the tasks
so future calls to `git maintenance (start|stop)` do not overwrite your
custom tasks.
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/maintenance.txt[]
+
GIT
---
diff --git a/Documentation/git-merge-base.txt b/Documentation/git-merge-base.txt
index 2d944e0..5ab957c 100644
--- a/Documentation/git-merge-base.txt
+++ b/Documentation/git-merge-base.txt
@@ -9,8 +9,8 @@ git-merge-base - Find as good common ancestors as possible for a merge
SYNOPSIS
--------
[verse]
-'git merge-base' [-a|--all] <commit> <commit>...
-'git merge-base' [-a|--all] --octopus <commit>...
+'git merge-base' [-a | --all] <commit> <commit>...
+'git merge-base' [-a | --all] --octopus <commit>...
'git merge-base' --is-ancestor <commit> <commit>
'git merge-base' --independent <commit>...
'git merge-base' --fork-point <ref> [<commit>]
@@ -18,7 +18,7 @@ SYNOPSIS
DESCRIPTION
-----------
-'git merge-base' finds best common ancestor(s) between two commits to use
+'git merge-base' finds the best common ancestor(s) between two commits to use
in a three-way merge. One common ancestor is 'better' than another common
ancestor if the latter is an ancestor of the former. A common ancestor
that does not have any better common ancestor is a 'best common
@@ -28,7 +28,7 @@ merge base for a pair of commits.
OPERATION MODES
---------------
-As the most common special case, specifying only two commits on the
+In the most common special case, specifying only two commits on the
command line means computing the merge base between the given two commits.
More generally, among the two commits to compute the merge base from,
@@ -64,7 +64,7 @@ from linkgit:git-show-branch[1] when used with the `--merge-base` option.
the two commits, but also takes into account the reflog of
<ref> to see if the history leading to <commit> forked from
an earlier incarnation of the branch <ref> (see discussion
- on this mode below).
+ of this mode below).
OPTIONS
-------
@@ -88,7 +88,7 @@ For example, with this topology:
the merge base between 'A' and 'B' is '1'.
-Given three commits 'A', 'B' and 'C', `git merge-base A B C` will compute the
+Given three commits 'A', 'B', and 'C', `git merge-base A B C` will compute the
merge base between 'A' and a hypothetical commit 'M', which is a merge
between 'B' and 'C'. For example, with this topology:
@@ -130,7 +130,7 @@ When the history involves criss-cross merges, there can be more than one
---2---o---o---B
....
-both '1' and '2' are merge-bases of A and B. Neither one is better than
+both '1' and '2' are merge bases of A and B. Neither one is better than
the other (both are 'best' merge bases). When the `--all` option is not given,
it is unspecified which best one is output.
@@ -204,7 +204,7 @@ will find B0, and
$ git rebase --onto origin/master $fork_point topic
-will replay D0, D1 and D on top of B to create a new history of this
+will replay D0, D1, and D on top of B to create a new history of this
shape:
....
diff --git a/Documentation/git-merge-file.txt b/Documentation/git-merge-file.txt
index 7e9093f..71915a0 100644
--- a/Documentation/git-merge-file.txt
+++ b/Documentation/git-merge-file.txt
@@ -11,19 +11,20 @@ SYNOPSIS
[verse]
'git merge-file' [-L <current-name> [-L <base-name> [-L <other-name>]]]
[--ours|--theirs|--union] [-p|--stdout] [-q|--quiet] [--marker-size=<n>]
- [--[no-]diff3] <current-file> <base-file> <other-file>
+ [--[no-]diff3] [--object-id] <current> <base> <other>
DESCRIPTION
-----------
-'git merge-file' incorporates all changes that lead from the `<base-file>`
-to `<other-file>` into `<current-file>`. The result ordinarily goes into
-`<current-file>`. 'git merge-file' is useful for combining separate changes
-to an original. Suppose `<base-file>` is the original, and both
-`<current-file>` and `<other-file>` are modifications of `<base-file>`,
+Given three files `<current>`, `<base>` and `<other>`,
+'git merge-file' incorporates all changes that lead from `<base>`
+to `<other>` into `<current>`. The result ordinarily goes into
+`<current>`. 'git merge-file' is useful for combining separate changes
+to an original. Suppose `<base>` is the original, and both
+`<current>` and `<other>` are modifications of `<base>`,
then 'git merge-file' combines both changes.
-A conflict occurs if both `<current-file>` and `<other-file>` have changes
+A conflict occurs if both `<current>` and `<other>` have changes
in a common segment of lines. If a conflict is found, 'git merge-file'
normally outputs a warning and brackets the conflict with lines containing
<<<<<<< and >>>>>>> markers. A typical conflict will look like this:
@@ -36,10 +37,14 @@ normally outputs a warning and brackets the conflict with lines containing
If there are conflicts, the user should edit the result and delete one of
the alternatives. When `--ours`, `--theirs`, or `--union` option is in effect,
-however, these conflicts are resolved favouring lines from `<current-file>`,
-lines from `<other-file>`, or lines from both respectively. The length of the
+however, these conflicts are resolved favouring lines from `<current>`,
+lines from `<other>`, or lines from both respectively. The length of the
conflict markers can be given with the `--marker-size` option.
+If `--object-id` is specified, exactly the same behavior occurs, except that
+instead of specifying what to merge as files, it is specified as a list of
+object IDs referring to blobs.
+
The exit value of this program is negative on error, and the number of
conflicts otherwise (truncated to 127 if there are more than that many
conflicts). If the merge was clean, the exit value is 0.
@@ -52,6 +57,14 @@ linkgit:git[1].
OPTIONS
-------
+--object-id::
+ Specify the contents to merge as blobs in the current repository instead of
+ files. In this case, the operation must take place within a valid repository.
++
+If the `-p` option is specified, the merged file (including conflicts, if any)
+goes to standard output as normal; otherwise, the merged file is written to the
+object store and the object ID of its blob is written to standard output.
+
-L <label>::
This option may be given up to three times, and
specifies labels to be used in place of the
@@ -62,7 +75,7 @@ OPTIONS
-p::
Send results to standard output instead of overwriting
- `<current-file>`.
+ `<current>`.
-q::
Quiet; do not warn about conflicts.
@@ -79,6 +92,12 @@ OPTIONS
Instead of leaving conflicts in the file, resolve conflicts
favouring our (or their or both) side of the lines.
+--diff-algorithm={patience|minimal|histogram|myers}::
+ Use a different diff algorithm while merging. The current default is "myers",
+ but selecting more recent algorithm such as "histogram" can help
+ avoid mismerges that occur due to unimportant matching lines
+ (such as braces from distinct functions). See also
+ linkgit:git-diff[1] `--diff-algorithm`.
EXAMPLES
--------
@@ -93,6 +112,11 @@ EXAMPLES
merges tmp/a123 and tmp/c345 with the base tmp/b234, but uses labels
`a` and `c` instead of `tmp/a123` and `tmp/c345`.
+`git merge-file -p --object-id abc1234 def567 890abcd`::
+
+ combines the changes of the blob abc1234 and 890abcd since def567,
+ tries to merge them and writes the result to standard output
+
GIT
---
Part of the linkgit:git[1] suite
diff --git a/Documentation/git-merge-tree.txt b/Documentation/git-merge-tree.txt
index 58731c1..dd388fa 100644
--- a/Documentation/git-merge-tree.txt
+++ b/Documentation/git-merge-tree.txt
@@ -3,26 +3,316 @@ git-merge-tree(1)
NAME
----
-git-merge-tree - Show three-way merge without touching index
+git-merge-tree - Perform merge without touching index or working tree
SYNOPSIS
--------
[verse]
-'git merge-tree' <base-tree> <branch1> <branch2>
+'git merge-tree' [--write-tree] [<options>] <branch1> <branch2>
+'git merge-tree' [--trivial-merge] <base-tree> <branch1> <branch2> (deprecated)
+[[NEWMERGE]]
DESCRIPTION
-----------
-Reads three tree-ish, and output trivial merge results and
-conflicting stages to the standard output. This is similar to
-what three-way 'git read-tree -m' does, but instead of storing the
-results in the index, the command outputs the entries to the
-standard output.
-
-This is meant to be used by higher level scripts to compute
-merge results outside of the index, and stuff the results back into the
-index. For this reason, the output from the command omits
-entries that match the <branch1> tree.
+
+This command has a modern `--write-tree` mode and a deprecated
+`--trivial-merge` mode. With the exception of the
+<<DEPMERGE,DEPRECATED DESCRIPTION>> section at the end, the rest of
+this documentation describes the modern `--write-tree` mode.
+
+Performs a merge, but does not make any new commits and does not read
+from or write to either the working tree or index.
+
+The performed merge will use the same features as the "real"
+linkgit:git-merge[1], including:
+
+ * three way content merges of individual files
+ * rename detection
+ * proper directory/file conflict handling
+ * recursive ancestor consolidation (i.e. when there is more than one
+ merge base, creating a virtual merge base by merging the merge bases)
+ * etc.
+
+After the merge completes, a new toplevel tree object is created. See
+`OUTPUT` below for details.
+
+OPTIONS
+-------
+
+-z::
+ Do not quote filenames in the <Conflicted file info> section,
+ and end each filename with a NUL character rather than
+ newline. Also begin the messages section with a NUL character
+ instead of a newline. See <<OUTPUT>> below for more information.
+
+--name-only::
+ In the Conflicted file info section, instead of writing a list
+ of (mode, oid, stage, path) tuples to output for conflicted
+ files, just provide a list of filenames with conflicts (and
+ do not list filenames multiple times if they have multiple
+ conflicting stages).
+
+--[no-]messages::
+ Write any informational messages such as "Auto-merging <path>"
+ or CONFLICT notices to the end of stdout. If unspecified, the
+ default is to include these messages if there are merge
+ conflicts, and to omit them otherwise.
+
+--allow-unrelated-histories::
+ merge-tree will by default error out if the two branches specified
+ share no common history. This flag can be given to override that
+ check and make the merge proceed anyway.
+
+--merge-base=<tree-ish>::
+ Instead of finding the merge-bases for <branch1> and <branch2>,
+ specify a merge-base for the merge, and specifying multiple bases is
+ currently not supported. This option is incompatible with `--stdin`.
++
+As the merge-base is provided directly, <branch1> and <branch2> do not need
+to specify commits; trees are enough.
+
+[[OUTPUT]]
+OUTPUT
+------
+
+For a successful merge, the output from git-merge-tree is simply one
+line:
+
+ <OID of toplevel tree>
+
+Whereas for a conflicted merge, the output is by default of the form:
+
+ <OID of toplevel tree>
+ <Conflicted file info>
+ <Informational messages>
+
+These are discussed individually below.
+
+However, there is an exception. If `--stdin` is passed, then there is
+an extra section at the beginning, a NUL character at the end, and then
+all the sections repeat for each line of input. Thus, if the first merge
+is conflicted and the second is clean, the output would be of the form:
+
+ <Merge status>
+ <OID of toplevel tree>
+ <Conflicted file info>
+ <Informational messages>
+ NUL
+ <Merge status>
+ <OID of toplevel tree>
+ NUL
+
+[[MS]]
+Merge status
+~~~~~~~~~~~~
+
+This is an integer status followed by a NUL character. The integer status is:
+
+ 0: merge had conflicts
+ 1: merge was clean
+ <0: something prevented the merge from running (e.g. access to repository
+ objects denied by filesystem)
+
+[[OIDTLT]]
+OID of toplevel tree
+~~~~~~~~~~~~~~~~~~~~
+
+This is a tree object that represents what would be checked out in the
+working tree at the end of `git merge`. If there were conflicts, then
+files within this tree may have embedded conflict markers. This section
+is always followed by a newline (or NUL if `-z` is passed).
+
+[[CFI]]
+Conflicted file info
+~~~~~~~~~~~~~~~~~~~~
+
+This is a sequence of lines with the format
+
+ <mode> <object> <stage> <filename>
+
+The filename will be quoted as explained for the configuration
+variable `core.quotePath` (see linkgit:git-config[1]). However, if
+the `--name-only` option is passed, the mode, object, and stage will
+be omitted. If `-z` is passed, the "lines" are terminated by a NUL
+character instead of a newline character.
+
+[[IM]]
+Informational messages
+~~~~~~~~~~~~~~~~~~~~~~
+
+This section provides informational messages, typically about
+conflicts. The format of the section varies significantly depending
+on whether `-z` is passed.
+
+If `-z` is passed:
+
+The output format is zero or more conflict informational records, each
+of the form:
+
+ <list-of-paths><conflict-type>NUL<conflict-message>NUL
+
+where <list-of-paths> is of the form
+
+ <number-of-paths>NUL<path1>NUL<path2>NUL...<pathN>NUL
+
+and includes paths (or branch names) affected by the conflict or
+informational message in <conflict-message>. Also, <conflict-type> is a
+stable string explaining the type of conflict, such as
+
+ * "Auto-merging"
+ * "CONFLICT (rename/delete)"
+ * "CONFLICT (submodule lacks merge base)"
+ * "CONFLICT (binary)"
+
+and <conflict-message> is a more detailed message about the conflict which often
+(but not always) embeds the <stable-short-type-description> within it. These
+strings may change in future Git versions. Some examples:
+
+ * "Auto-merging <file>"
+ * "CONFLICT (rename/delete): <oldfile> renamed...but deleted in..."
+ * "Failed to merge submodule <submodule> (no merge base)"
+ * "Warning: cannot merge binary files: <filename>"
+
+If `-z` is NOT passed:
+
+This section starts with a blank line to separate it from the previous
+sections, and then only contains the <conflict-message> information
+from the previous section (separated by newlines). These are
+non-stable strings that should not be parsed by scripts, and are just
+meant for human consumption. Also, note that while <conflict-message>
+strings usually do not contain embedded newlines, they sometimes do.
+(However, the free-form messages will never have an embedded NUL
+character). So, the entire block of information is meant for human
+readers as an agglomeration of all conflict messages.
+
+EXIT STATUS
+-----------
+
+For a successful, non-conflicted merge, the exit status is 0. When the
+merge has conflicts, the exit status is 1. If the merge is not able to
+complete (or start) due to some kind of error, the exit status is
+something other than 0 or 1 (and the output is unspecified). When
+--stdin is passed, the return status is 0 for both successful and
+conflicted merges, and something other than 0 or 1 if it cannot complete
+all the requested merges.
+
+USAGE NOTES
+-----------
+
+This command is intended as low-level plumbing, similar to
+linkgit:git-hash-object[1], linkgit:git-mktree[1],
+linkgit:git-commit-tree[1], linkgit:git-write-tree[1],
+linkgit:git-update-ref[1], and linkgit:git-mktag[1]. Thus, it can be
+used as a part of a series of steps such as:
+
+ NEWTREE=$(git merge-tree --write-tree $BRANCH1 $BRANCH2)
+ test $? -eq 0 || die "There were conflicts..."
+ NEWCOMMIT=$(git commit-tree $NEWTREE -p $BRANCH1 -p $BRANCH2)
+ git update-ref $BRANCH1 $NEWCOMMIT
+
+Note that when the exit status is non-zero, `NEWTREE` in this sequence
+will contain a lot more output than just a tree.
+
+For conflicts, the output includes the same information that you'd get
+with linkgit:git-merge[1]:
+
+ * what would be written to the working tree (the
+ <<OIDTLT,OID of toplevel tree>>)
+ * the higher order stages that would be written to the index (the
+ <<CFI,Conflicted file info>>)
+ * any messages that would have been printed to stdout (the
+ <<IM,Informational messages>>)
+
+INPUT FORMAT
+------------
+'git merge-tree --stdin' input format is fully text based. Each line
+has this format:
+
+ [<base-commit> -- ]<branch1> <branch2>
+
+If one line is separated by `--`, the string before the separator is
+used for specifying a merge-base for the merge and the string after
+the separator describes the branches to be merged.
+
+MISTAKES TO AVOID
+-----------------
+
+Do NOT look through the resulting toplevel tree to try to find which
+files conflict; parse the <<CFI,Conflicted file info>> section instead.
+Not only would parsing an entire tree be horrendously slow in large
+repositories, there are numerous types of conflicts not representable by
+conflict markers (modify/delete, mode conflict, binary file changed on
+both sides, file/directory conflicts, various rename conflict
+permutations, etc.)
+
+Do NOT interpret an empty <<CFI,Conflicted file info>> list as a clean
+merge; check the exit status. A merge can have conflicts without having
+individual files conflict (there are a few types of directory rename
+conflicts that fall into this category, and others might also be added
+in the future).
+
+Do NOT attempt to guess or make the user guess the conflict types from
+the <<CFI,Conflicted file info>> list. The information there is
+insufficient to do so. For example: Rename/rename(1to2) conflicts (both
+sides renamed the same file differently) will result in three different
+files having higher order stages (but each only has one higher order
+stage), with no way (short of the <<IM,Informational messages>> section)
+to determine which three files are related. File/directory conflicts
+also result in a file with exactly one higher order stage.
+Possibly-involved-in-directory-rename conflicts (when
+"merge.directoryRenames" is unset or set to "conflicts") also result in
+a file with exactly one higher order stage. In all cases, the
+<<IM,Informational messages>> section has the necessary info, though it
+is not designed to be machine parseable.
+
+Do NOT assume that each path from <<CFI,Conflicted file info>>, and
+the logical conflicts in the <<IM,Informational messages>> have a
+one-to-one mapping, nor that there is a one-to-many mapping, nor a
+many-to-one mapping. Many-to-many mappings exist, meaning that each
+path can have many logical conflict types in a single merge, and each
+logical conflict type can affect many paths.
+
+Do NOT assume all filenames listed in the <<IM,Informational messages>>
+section had conflicts. Messages can be included for files that have no
+conflicts, such as "Auto-merging <file>".
+
+AVOID taking the OIDS from the <<CFI,Conflicted file info>> and
+re-merging them to present the conflicts to the user. This will lose
+information. Instead, look up the version of the file found within the
+<<OIDTLT,OID of toplevel tree>> and show that instead. In particular,
+the latter will have conflict markers annotated with the original
+branch/commit being merged and, if renames were involved, the original
+filename. While you could include the original branch/commit in the
+conflict marker annotations when re-merging, the original filename is
+not available from the <<CFI,Conflicted file info>> and thus you would
+be losing information that might help the user resolve the conflict.
+
+[[DEPMERGE]]
+DEPRECATED DESCRIPTION
+----------------------
+
+Per the <<NEWMERGE,DESCRIPTION>> and unlike the rest of this
+documentation, this section describes the deprecated `--trivial-merge`
+mode.
+
+Other than the optional `--trivial-merge`, this mode accepts no
+options.
+
+This mode reads three tree-ish, and outputs trivial merge results and
+conflicting stages to the standard output in a semi-diff format.
+Since this was designed for higher level scripts to consume and merge
+the results back into the index, it omits entries that match
+<branch1>. The result of this second form is similar to what
+three-way 'git read-tree -m' does, but instead of storing the results
+in the index, the command outputs the entries to the standard output.
+
+This form not only has limited applicability (a trivial merge cannot
+handle content merges of individual files, rename detection, proper
+directory/file conflict handling, etc.), the output format is also
+difficult to work with, and it will generally be less performant than
+the first form even on successful merges (especially if working in
+large repositories).
GIT
---
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index 3125473..1ab69f6 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -20,12 +20,12 @@ DESCRIPTION
-----------
Incorporates changes from the named commits (since the time their
histories diverged from the current branch) into the current
-branch. This command is used by 'git pull' to incorporate changes
+branch. This command is used by `git pull` to incorporate changes
from another repository and can be used by hand to merge changes
from one branch into another.
Assume the following history exists and the current branch is
-"`master`":
+`master`:
------------
A---B---C topic
@@ -33,11 +33,12 @@ Assume the following history exists and the current branch is
D---E---F---G master
------------
-Then "`git merge topic`" will replay the changes made on the
+Then `git merge topic` will replay the changes made on the
`topic` branch since it diverged from `master` (i.e., `E`) until
its current commit (`C`) on top of `master`, and record the result
in a new commit along with the names of the two parent commits and
-a log message from the user describing the changes.
+a log message from the user describing the changes. Before the operation,
+`ORIG_HEAD` is set to the tip of the current branch (`C`).
------------
A---B---C topic
@@ -45,21 +46,21 @@ a log message from the user describing the changes.
D---E---F---G---H master
------------
-The second syntax ("`git merge --abort`") can only be run after the
-merge has resulted in conflicts. 'git merge --abort' will abort the
-merge process and try to reconstruct the pre-merge state. However,
-if there were uncommitted changes when the merge started (and
-especially if those changes were further modified after the merge
-was started), 'git merge --abort' will in some cases be unable to
-reconstruct the original (pre-merge) changes. Therefore:
+A merge stops if there's a conflict that cannot be resolved
+automatically or if `--no-commit` was provided when initiating the
+merge. At that point you can run `git merge --abort` or `git merge
+--continue`.
-*Warning*: Running 'git merge' with non-trivial uncommitted changes is
+`git merge --abort` will abort the merge process and try to reconstruct
+the pre-merge state. However, if there were uncommitted changes when the
+merge started (and especially if those changes were further modified
+after the merge was started), `git merge --abort` will in some cases be
+unable to reconstruct the original (pre-merge) changes. Therefore:
+
+*Warning*: Running `git merge` with non-trivial uncommitted changes is
discouraged: while possible, it may leave you in a state that is hard to
back out of in the case of a conflict.
-The third syntax ("`git merge --continue`") can only be run after the
-merge has resulted in conflicts.
-
OPTIONS
-------
:git-merge: 1
@@ -73,8 +74,8 @@ include::merge-options.txt[]
If `--log` is specified, a shortlog of the commits being merged
will be appended to the specified message.
+
-The 'git fmt-merge-msg' command can be
-used to give a good default for automated 'git merge'
+The `git fmt-merge-msg` command can be
+used to give a good default for automated `git merge`
invocations. The automated message can include the branch description.
--into-name <branch>::
@@ -90,10 +91,7 @@ invocations. The automated message can include the branch description.
If `--log` is specified, a shortlog of the commits being merged
will be appended to the specified message.
---rerere-autoupdate::
---no-rerere-autoupdate::
- Allow the rerere mechanism to update the index with the
- result of auto-conflict resolution if possible.
+include::rerere-options.txt[]
--overwrite-ignore::
--no-overwrite-ignore::
@@ -106,14 +104,14 @@ will be appended to the specified message.
present, apply it to the worktree.
+
If there were uncommitted worktree changes present when the merge
-started, 'git merge --abort' will in some cases be unable to
+started, `git merge --abort` will in some cases be unable to
reconstruct these changes. It is therefore recommended to always
-commit or stash your changes before running 'git merge'.
+commit or stash your changes before running `git merge`.
+
-'git merge --abort' is equivalent to 'git reset --merge' when
+`git merge --abort` is equivalent to `git reset --merge` when
`MERGE_HEAD` is present unless `MERGE_AUTOSTASH` is also present in
-which case 'git merge --abort' applies the stash entry to the worktree
-whereas 'git reset --merge' will save the stashed changes in the stash
+which case `git merge --abort` applies the stash entry to the worktree
+whereas `git reset --merge` will save the stashed changes in the stash
list.
--quit::
@@ -122,8 +120,8 @@ list.
stash entry will be saved to the stash list.
--continue::
- After a 'git merge' stops due to conflicts you can conclude the
- merge by running 'git merge --continue' (see "HOW TO RESOLVE
+ After a `git merge` stops due to conflicts you can conclude the
+ merge by running `git merge --continue` (see "HOW TO RESOLVE
CONFLICTS" section below).
<commit>...::
@@ -146,25 +144,25 @@ PRE-MERGE CHECKS
Before applying outside changes, you should get your own work in
good shape and committed locally, so it will not be clobbered if
there are conflicts. See also linkgit:git-stash[1].
-'git pull' and 'git merge' will stop without doing anything when
-local uncommitted changes overlap with files that 'git pull'/'git
-merge' may need to update.
+`git pull` and `git merge` will stop without doing anything when
+local uncommitted changes overlap with files that `git pull`/`git
+merge` may need to update.
To avoid recording unrelated changes in the merge commit,
-'git pull' and 'git merge' will also abort if there are any changes
+`git pull` and `git merge` will also abort if there are any changes
registered in the index relative to the `HEAD` commit. (Special
narrow exceptions to this rule may exist depending on which merge
strategy is in use, but generally, the index must match HEAD.)
-If all named commits are already ancestors of `HEAD`, 'git merge'
+If all named commits are already ancestors of `HEAD`, `git merge`
will exit early with the message "Already up to date."
FAST-FORWARD MERGE
------------------
Often the current branch head is an ancestor of the named commit.
-This is the most common case especially when invoked from 'git
-pull': you are tracking an upstream repository, you have committed
+This is the most common case especially when invoked from `git
+pull`: you are tracking an upstream repository, you have committed
no local changes, and now you want to update to a newer upstream
revision. In this case, a new commit is not needed to store the
combined history; instead, the `HEAD` (along with the index) is
@@ -196,9 +194,13 @@ happens:
versions: stage 1 stores the version from the common ancestor,
stage 2 from `HEAD`, and stage 3 from `MERGE_HEAD` (you
can inspect the stages with `git ls-files -u`). The working
- tree files contain the result of the "merge" program; i.e. 3-way
+ tree files contain the result of the merge operation; i.e. 3-way
merge results with familiar conflict markers `<<<` `===` `>>>`.
-5. No other changes are made. In particular, the local
+5. A ref named `AUTO_MERGE` is written, pointing to a tree
+ corresponding to the current content of the working tree (including
+ conflict markers for textual conflicts). Note that this ref is only
+ written when the 'ort' merge strategy is used (the default).
+6. No other changes are made. In particular, the local
modifications you had before you started merge will stay the
same and the index entries for them stay as they were,
i.e. matching `HEAD`.
@@ -267,7 +269,7 @@ Barbie's remark on your side. The only thing you can tell is that your
side wants to say it is hard and you'd prefer to go shopping, while the
other side wants to claim it is easy.
-An alternative style can be used by setting the "merge.conflictStyle"
+An alternative style can be used by setting the `merge.conflictStyle`
configuration variable to either "diff3" or "zdiff3". In "diff3"
style, the above conflict may look like this:
@@ -326,19 +328,20 @@ After seeing a conflict, you can do two things:
* Resolve the conflicts. Git will mark the conflicts in
the working tree. Edit the files into shape and
- 'git add' them to the index. Use 'git commit' or
- 'git merge --continue' to seal the deal. The latter command
+ `git add` them to the index. Use `git commit` or
+ `git merge --continue` to seal the deal. The latter command
checks whether there is a (interrupted) merge in progress
- before calling 'git commit'.
+ before calling `git commit`.
You can work through the conflict with a number of tools:
* Use a mergetool. `git mergetool` to launch a graphical
- mergetool which will work you through the merge.
+ mergetool which will work through the merge with you.
* Look at the diffs. `git diff` will show a three-way diff,
highlighting changes from both the `HEAD` and `MERGE_HEAD`
- versions.
+ versions. `git diff AUTO_MERGE` will show what changes you've
+ made so far to resolve textual conflicts.
* Look at the diffs from each branch. `git log --merge -p <path>`
will show diffs first for the `HEAD` version and then the
@@ -386,13 +389,16 @@ include::merge-strategies.txt[]
CONFIGURATION
-------------
-include::config/merge.txt[]
branch.<name>.mergeOptions::
Sets default options for merging into branch <name>. The syntax and
- supported options are the same as those of 'git merge', but option
+ supported options are the same as those of `git merge`, but option
values containing whitespace characters are currently not supported.
+include::includes/cmd-config-section-rest.txt[]
+
+include::config/merge.txt[]
+
SEE ALSO
--------
linkgit:git-fmt-merge-msg[1], linkgit:git-pull[1],
diff --git a/Documentation/git-mergetool--lib.txt b/Documentation/git-mergetool--lib.txt
index 3e8f59a..0726b56 100644
--- a/Documentation/git-mergetool--lib.txt
+++ b/Documentation/git-mergetool--lib.txt
@@ -28,22 +28,22 @@ to define the operation mode for the functions listed below.
FUNCTIONS
---------
get_merge_tool::
- returns a merge tool. the return code is 1 if we returned a guessed
+ Returns a merge tool. The return code is 1 if we returned a guessed
merge tool, else 0. '$GIT_MERGETOOL_GUI' may be set to 'true' to
search for the appropriate guitool.
get_merge_tool_cmd::
- returns the custom command for a merge tool.
+ Returns the custom command for a merge tool.
get_merge_tool_path::
- returns the custom path for a merge tool.
+ Returns the custom path for a merge tool.
initialize_merge_tool::
- bring merge tool specific functions into scope so they can be used or
+ Brings merge tool specific functions into scope so they can be used or
overridden.
run_merge_tool::
- launches a merge tool given the tool name and a true/false
+ Launches a merge tool given the tool name and a true/false
flag to indicate whether a merge base is present.
'$MERGED', '$LOCAL', '$REMOTE', and '$BASE' must be defined
for use by the merge tool.
diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt
index f784027..b9e20c5 100644
--- a/Documentation/git-mergetool.txt
+++ b/Documentation/git-mergetool.txt
@@ -17,7 +17,7 @@ Use `git mergetool` to run one of several merge utilities to resolve
merge conflicts. It is typically run after 'git merge'.
If one or more <file> parameters are given, the merge tool program will
-be run to resolve differences on each file (skipping those without
+be run to resolve differences in each file (skipping those without
conflicts). Specifying a directory will include all unresolved files in
that path. If no <file> names are specified, 'git mergetool' will run
the merge tool program on every file with merge conflicts.
@@ -49,7 +49,7 @@ variable `mergetool.<tool>.cmd`.
+
When 'git mergetool' is invoked with this tool (either through the
`-t` or `--tool` option or the `merge.tool` configuration
-variable) the configured command line will be invoked with `$BASE`
+variable), the configured command line will be invoked with `$BASE`
set to the name of a temporary file containing the common base for
the merge, if available; `$LOCAL` set to the name of a temporary
file containing the contents of the file on the current branch;
@@ -81,16 +81,17 @@ success of the resolution after the custom tool has exited.
-g::
--gui::
- When 'git-mergetool' is invoked with the `-g` or `--gui` option
+ When 'git-mergetool' is invoked with the `-g` or `--gui` option,
the default merge tool will be read from the configured
`merge.guitool` variable instead of `merge.tool`. If
`merge.guitool` is not set, we will fallback to the tool
- configured under `merge.tool`.
+ configured under `merge.tool`. This may be autoselected using
+ the configuration variable `mergetool.guiDefault`.
--no-gui::
- This overrides a previous `-g` or `--gui` setting and reads the
- default merge tool will be read from the configured `merge.tool`
- variable.
+ This overrides a previous `-g` or `--gui` setting or
+ `mergetool.guiDefault` configuration and reads the default merge
+ tool from the configured `merge.tool` variable.
-O<orderfile>::
Process files in the order specified in the
@@ -102,6 +103,9 @@ success of the resolution after the custom tool has exited.
CONFIGURATION
-------------
:git-mergetool: 1
+
+include::includes/cmd-config-section-all.txt[]
+
include::config/mergetool.txt[]
TEMPORARY FILES
@@ -111,7 +115,7 @@ These are safe to remove once a file has been merged and its
`git mergetool` session has completed.
Setting the `mergetool.keepBackup` configuration variable to `false`
-causes `git mergetool` to automatically remove the backup as files
+causes `git mergetool` to automatically remove the backup files as files
are successfully merged.
BACKEND SPECIFIC HINTS
diff --git a/Documentation/git-mktag.txt b/Documentation/git-mktag.txt
index 466a697..006d759 100644
--- a/Documentation/git-mktag.txt
+++ b/Documentation/git-mktag.txt
@@ -14,7 +14,7 @@ SYNOPSIS
DESCRIPTION
-----------
-Reads a tag contents on standard input and creates a tag object. The
+Reads a tag's contents on standard input and creates a tag object. The
output is the new tag's <object> identifier.
This command is mostly equivalent to linkgit:git-hash-object[1]
@@ -27,13 +27,13 @@ write a tag found in `my-tag`:
The difference is that mktag will die before writing the tag if the
tag doesn't pass a linkgit:git-fsck[1] check.
-The "fsck" check done mktag is stricter than what linkgit:git-fsck[1]
+The "fsck" check done by mktag is stricter than what linkgit:git-fsck[1]
would run by default in that all `fsck.<msg-id>` messages are promoted
from warnings to errors (so e.g. a missing "tagger" line is an error).
Extra headers in the object are also an error under mktag, but ignored
by linkgit:git-fsck[1]. This extra check can be turned off by setting
-the appropriate `fsck.<msg-id>` varible:
+the appropriate `fsck.<msg-id>` variable:
git -c fsck.extraHeaderEntry=ignore mktag <my-tag-with-headers
@@ -56,7 +56,7 @@ has a very simple fixed format: four lines of
tagger <tagger>
followed by some 'optional' free-form message (some tags created
-by older Git may not have `tagger` line). The message, when it
+by older Git may not have a `tagger` line). The message, when it
exists, is separated by a blank line from the header. The
message part may contain a signature that Git itself doesn't
care about, but that can be verified with gpg.
diff --git a/Documentation/git-mktree.txt b/Documentation/git-mktree.txt
index 76b44f4..383f09d 100644
--- a/Documentation/git-mktree.txt
+++ b/Documentation/git-mktree.txt
@@ -25,13 +25,13 @@ OPTIONS
--missing::
Allow missing objects. The default behaviour (without this option)
- is to verify that each tree entry's sha1 identifies an existing
+ is to verify that each tree entry's hash identifies an existing
object. This option has no effect on the treatment of gitlink entries
(aka "submodules") which are always allowed to be missing.
--batch::
Allow building of more than one tree object before exiting. Each
- tree is separated by a single blank line. The final new-line is
+ tree is separated by a single blank line. The final newline is
optional. Note - if the `-z` option is used, lines are terminated
with NUL.
diff --git a/Documentation/git-multi-pack-index.txt b/Documentation/git-multi-pack-index.txt
index c588fb9..3696506 100644
--- a/Documentation/git-multi-pack-index.txt
+++ b/Documentation/git-multi-pack-index.txt
@@ -70,9 +70,10 @@ verify::
Verify the contents of the MIDX file.
expire::
- Delete the pack-files that are tracked by the MIDX file, but
- have no objects referenced by the MIDX. Rewrite the MIDX file
- afterward to remove all references to these pack-files.
+ Delete the pack-files that are tracked by the MIDX file, but
+ have no objects referenced by the MIDX (with the exception of
+ `.keep` packs and cruft packs). Rewrite the MIDX file afterward
+ to remove all references to these pack-files.
repack::
Create a new pack-file containing objects in small pack-files
@@ -128,8 +129,8 @@ $ git multi-pack-index verify
SEE ALSO
--------
See link:technical/multi-pack-index.html[The Multi-Pack-Index Design
-Document] and link:technical/pack-format.html[The Multi-Pack-Index
-Format] for more information on the multi-pack-index feature.
+Document] and linkgit:gitformat-pack[5] for more information on the
+multi-pack-index feature and its file format.
GIT
diff --git a/Documentation/git-mv.txt b/Documentation/git-mv.txt
index 79449bf..dc1bf61 100644
--- a/Documentation/git-mv.txt
+++ b/Documentation/git-mv.txt
@@ -9,14 +9,14 @@ git-mv - Move or rename a file, a directory, or a symlink
SYNOPSIS
--------
[verse]
-'git mv' <options>... <args>...
+'git mv' [<options>] <source>... <destination>
DESCRIPTION
-----------
-Move or rename a file, directory or symlink.
+Move or rename a file, directory, or symlink.
git mv [-v] [-f] [-n] [-k] <source> <destination>
- git mv [-v] [-f] [-n] [-k] <source> ... <destination directory>
+ git mv [-v] [-f] [-n] [-k] <source> ... <destination-directory>
In the first form, it renames <source>, which must exist and be either
a file, symlink or directory, to <destination>.
@@ -30,7 +30,7 @@ OPTIONS
-------
-f::
--force::
- Force renaming or moving of a file even if the target exists
+ Force renaming or moving of a file even if the <destination> exists.
-k::
Skip move or rename actions which would lead to an error
condition. An error happens when a source is neither existing nor
diff --git a/Documentation/git-name-rev.txt b/Documentation/git-name-rev.txt
index ec8a27c..d4f1c4d 100644
--- a/Documentation/git-name-rev.txt
+++ b/Documentation/git-name-rev.txt
@@ -10,7 +10,7 @@ SYNOPSIS
--------
[verse]
'git name-rev' [--tags] [--refs=<pattern>]
- ( --all | --stdin | <commit-ish>... )
+ ( --all | --annotate-stdin | <commit-ish>... )
DESCRIPTION
-----------
@@ -26,7 +26,7 @@ OPTIONS
--refs=<pattern>::
Only use refs whose names match a given shell pattern. The pattern
- can be one of branch name, tag name or fully qualified ref name. If
+ can be a branch name, a tag name, or a fully qualified ref name. If
given multiple times, use refs whose names match any of the given shell
patterns. Use `--no-refs` to clear any previous ref patterns given.
@@ -46,7 +46,8 @@ OPTIONS
Transform stdin by substituting all the 40-character SHA-1
hexes (say $hex) with "$hex ($rev_name)". When used with
--name-only, substitute with "$rev_name", omitting $hex
- altogether.
+ altogether. This option was called `--stdin` in older versions
+ of Git.
+
For example:
+
@@ -70,10 +71,6 @@ The full name after substitution is master,
while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad
-----------
---stdin::
- This option is deprecated in favor of 'git name-rev --annotate-stdin'.
- They are functionally equivalent.
-
--name-only::
Instead of printing both the SHA-1 and the name, print only
the name. If given with --tags the usual tag prefix of
@@ -107,7 +104,7 @@ Now you are wiser, because you know that it happened 940 revisions before v0.99.
Another nice thing you can do is:
------------
-% git log | git name-rev --stdin
+% git log | git name-rev --annotate-stdin
------------
GIT
diff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt
index 0a42006..c9221a6 100644
--- a/Documentation/git-notes.txt
+++ b/Documentation/git-notes.txt
@@ -9,10 +9,10 @@ SYNOPSIS
--------
[verse]
'git notes' [list [<object>]]
-'git notes' add [-f] [--allow-empty] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>]
+'git notes' add [-f] [--allow-empty] [--[no-]separator | --separator=<paragraph-break>] [--[no-]stripspace] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>]
'git notes' copy [-f] ( --stdin | <from-object> [<to-object>] )
-'git notes' append [--allow-empty] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>]
-'git notes' edit [--allow-empty] [<object>]
+'git notes' append [--allow-empty] [--[no-]separator | --separator=<paragraph-break>] [--[no-]stripspace] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>]
+'git notes' edit [--allow-empty] [<object>] [--[no-]stripspace]
'git notes' show [<object>]
'git notes' merge [-v | -q] [-s <strategy> ] <notes-ref>
'git notes' merge --commit [-v | -q]
@@ -44,7 +44,7 @@ using the `--notes` option. Such notes are added as a patch commentary
after a three dash separator line.
To change which notes are shown by 'git log', see the
-"notes.displayRef" configuration in linkgit:git-log[1].
+"notes.displayRef" discussion in <<CONFIGURATION>>.
See the "notes.rewrite.<command>" configuration for a way to carry
notes across commands that rewrite commits.
@@ -56,7 +56,7 @@ SUBCOMMANDS
list::
List the notes object for a given object. If no object is
given, show a list of all note objects and the objects they
- annotate (in the format "<note object> <annotated object>").
+ annotate (in the format "<note-object> <annotated-object>").
This is the default subcommand if no subcommand is given.
add::
@@ -65,7 +65,9 @@ add::
However, if you're using `add` interactively (using an editor
to supply the notes contents), then - instead of aborting -
the existing notes will be opened in the editor (like the `edit`
- subcommand).
+ subcommand). If you specify multiple `-m` and `-F`, a blank
+ line will be inserted between the messages. Use the `--separator`
+ option to insert other delimiters.
copy::
Copy the notes for the first object onto the second object (defaults to
@@ -85,8 +87,12 @@ corresponding <to-object>. (The optional `<rest>` is ignored so that
the command can read the input given to the `post-rewrite` hook.)
append::
- Append to the notes of an existing object (defaults to HEAD).
- Creates a new notes object if needed.
+ Append new message(s) given by `-m` or `-F` options to an
+ existing note, or add them as a new note if one does not
+ exist, for the object (defaults to HEAD). When appending to
+ an existing note, a blank line is added before each new
+ message as an inter-paragraph separator. The separator can
+ be customized with the `--separator` option.
edit::
Edit the notes for a given object (defaults to HEAD).
@@ -136,6 +142,7 @@ OPTIONS
are concatenated as separate paragraphs.
Lines starting with `#` and empty lines other than a
single line between paragraphs will be stripped out.
+ If you wish to keep them verbatim, use `--no-stripspace`.
-F <file>::
--file=<file>::
@@ -143,12 +150,16 @@ OPTIONS
read the note message from the standard input.
Lines starting with `#` and empty lines other than a
single line between paragraphs will be stripped out.
+ If you wish to keep them verbatim, use `--no-stripspace`.
-C <object>::
--reuse-message=<object>::
Take the given blob object (for example, another note) as the
note message. (Use `git notes copy <object>` instead to
- copy notes between objects.)
+ copy notes between objects.). By default, message will be
+ copied verbatim, but if you wish to strip out the lines
+ starting with `#` and empty lines other than a single line
+ between paragraphs, use with`--stripspace` option.
-c <object>::
--reedit-message=<object>::
@@ -159,6 +170,19 @@ OPTIONS
Allow an empty note object to be stored. The default behavior is
to automatically remove empty notes.
+--[no-]separator, --separator=<paragraph-break>::
+ Specify a string used as a custom inter-paragraph separator
+ (a newline is added at the end as needed). If `--no-separator`, no
+ separators will be added between paragraphs. Defaults to a blank
+ line.
+
+--[no-]stripspace::
+ Strip leading and trailing whitespace from the note message.
+ Also strip out empty lines other than a single line between
+ paragraphs. Lines starting with `#` will be stripped out
+ in non-editor cases like `-m`, `-F` and `-C`, but not in
+ editor case like `git notes edit`, `-c`, etc.
+
--ref <ref>::
Manipulate the notes tree in <ref>. This overrides
`GIT_NOTES_REF` and the "core.notesRef" configuration. The ref
@@ -307,6 +331,7 @@ with 'git log', so if you use such notes, you'll probably need to write
some special-purpose tools to do something useful with them.
+[[CONFIGURATION]]
CONFIGURATION
-------------
@@ -316,57 +341,9 @@ core.notesRef::
This setting can be overridden through the environment and
command line.
-notes.mergeStrategy::
- Which merge strategy to choose by default when resolving notes
- conflicts. Must be one of `manual`, `ours`, `theirs`, `union`, or
- `cat_sort_uniq`. Defaults to `manual`. See "NOTES MERGE STRATEGIES"
- section above for more information on each strategy.
-+
-This setting can be overridden by passing the `--strategy` option.
-
-notes.<name>.mergeStrategy::
- Which merge strategy to choose when doing a notes merge into
- refs/notes/<name>. This overrides the more general
- "notes.mergeStrategy". See the "NOTES MERGE STRATEGIES" section above
- for more information on each available strategy.
+include::includes/cmd-config-section-rest.txt[]
-notes.displayRef::
- Which ref (or refs, if a glob or specified more than once), in
- addition to the default set by `core.notesRef` or
- `GIT_NOTES_REF`, to read notes from when showing commit
- messages with the 'git log' family of commands.
- This setting can be overridden on the command line or by the
- `GIT_NOTES_DISPLAY_REF` environment variable.
- See linkgit:git-log[1].
-
-notes.rewrite.<command>::
- When rewriting commits with <command> (currently `amend` or
- `rebase`), if this variable is `false`, git will not copy
- notes from the original to the rewritten commit. Defaults to
- `true`. See also "`notes.rewriteRef`" below.
-+
-This setting can be overridden by the `GIT_NOTES_REWRITE_REF`
-environment variable.
-
-notes.rewriteMode::
- When copying notes during a rewrite, what to do if the target
- commit already has a note. Must be one of `overwrite`,
- `concatenate`, `cat_sort_uniq`, or `ignore`. Defaults to
- `concatenate`.
-+
-This setting can be overridden with the `GIT_NOTES_REWRITE_MODE`
-environment variable.
-
-notes.rewriteRef::
- When copying notes during a rewrite, specifies the (fully
- qualified) ref whose notes should be copied. May be a glob,
- in which case notes in all matching refs will be copied. You
- may also specify this configuration several times.
-+
-Does not have a default value; you must configure this variable to
-enable note rewriting.
-+
-Can be overridden with the `GIT_NOTES_REWRITE_REF` environment variable.
+include::config/notes.txt[]
ENVIRONMENT
diff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt
index a9995a9..e32404c 100644
--- a/Documentation/git-pack-objects.txt
+++ b/Documentation/git-pack-objects.txt
@@ -116,9 +116,7 @@ unreachable object whose mtime is newer than the `--cruft-expiration`).
+
Incompatible with `--unpack-unreachable`, `--keep-unreachable`,
`--pack-loose-unreachable`, `--stdin-packs`, as well as any other
-options which imply `--revs`. Also incompatible with `--max-pack-size`;
-when this option is set, the maximum pack size is not inferred from
-`pack.packSizeLimit`.
+options which imply `--revs`.
--cruft-expiration=<approxidate>::
If specified, objects are eliminated from the cruft pack if they
@@ -298,8 +296,8 @@ So does `git bundle` (see linkgit:git-bundle[1]) when it creates a bundle.
nevertheless.
--filter=<filter-spec>::
- Requires `--stdout`. Omits certain objects (usually blobs) from
- the resulting packfile. See linkgit:git-rev-list[1] for valid
+ Omits certain objects (usually blobs) from the resulting
+ packfile. See linkgit:git-rev-list[1] for valid
`<filter-spec>` forms.
--no-filter::
diff --git a/Documentation/git-pack-redundant.txt b/Documentation/git-pack-redundant.txt
index ee7034b..13c3eb5 100644
--- a/Documentation/git-pack-redundant.txt
+++ b/Documentation/git-pack-redundant.txt
@@ -9,7 +9,21 @@ git-pack-redundant - Find redundant pack files
SYNOPSIS
--------
[verse]
-'git pack-redundant' [ --verbose ] [ --alt-odb ] ( --all | <pack-filename>... )
+'git pack-redundant' [--verbose] [--alt-odb] (--all | <pack-filename>...)
+
+WARNING
+-------
+`git pack-redundant` has been deprecated and is scheduled for removal in
+a future version of Git. Because it can only remove entire duplicate
+packs and not individual duplicate objects, it is generally not a useful
+tool for reducing repository size. You are better off using `git gc` to
+do so, which will put objects into a new pack, removing duplicates.
+
+Running `pack-redundant` without the `--i-still-use-this` flag will fail
+in this release. If you believe you have a use case for which
+`pack-redundant` is better suited and oppose this removal, please
+contact the Git mailing list at git@vger.kernel.org. More information
+about the list is available at https://git-scm.com/community.
DESCRIPTION
-----------
@@ -34,7 +48,7 @@ OPTIONS
--alt-odb::
Don't require objects present in packs from alternate object
- directories to be present in local packs.
+ database (odb) directories to be present in local packs.
--verbose::
Outputs some statistics to stderr. Has a small performance penalty.
diff --git a/Documentation/git-pack-refs.txt b/Documentation/git-pack-refs.txt
index 154081f..2dcabaf 100644
--- a/Documentation/git-pack-refs.txt
+++ b/Documentation/git-pack-refs.txt
@@ -8,7 +8,7 @@ git-pack-refs - Pack heads and tags for efficient repository access
SYNOPSIS
--------
[verse]
-'git pack-refs' [--all] [--no-prune]
+'git pack-refs' [--all] [--no-prune] [--auto] [--include <pattern>] [--exclude <pattern>]
DESCRIPTION
-----------
@@ -51,14 +51,50 @@ The command by default packs all tags and refs that are already
packed, and leaves other refs
alone. This is because branches are expected to be actively
developed and packing their tips does not help performance.
-This option causes branch tips to be packed as well. Useful for
-a repository with many branches of historical interests.
+This option causes all refs to be packed as well, with the exception
+of hidden refs, broken refs, and symbolic refs. Useful for a repository
+with many branches of historical interests.
--no-prune::
The command usually removes loose refs under `$GIT_DIR/refs`
hierarchy after packing them. This option tells it not to.
+--auto::
+
+Pack refs as needed depending on the current state of the ref database. The
+behavior depends on the ref format used by the repository and may change in the
+future.
++
+ - "files": No special handling for `--auto` has been implemented.
++
+ - "reftable": Tables are compacted such that they form a geometric
+ sequence. For two tables N and N+1, where N+1 is newer, this
+ maintains the property that N is at least twice as big as N+1. Only
+ tables that violate this property are compacted.
+
+--include <pattern>::
+
+Pack refs based on a `glob(7)` pattern. Repetitions of this option
+accumulate inclusion patterns. If a ref is both included in `--include` and
+`--exclude`, `--exclude` takes precedence. Using `--include` will preclude all
+tags from being included by default. Symbolic refs and broken refs will never
+be packed. When used with `--all`, it will be a noop. Use `--no-include` to clear
+and reset the list of patterns.
+
+--exclude <pattern>::
+
+Do not pack refs matching the given `glob(7)` pattern. Repetitions of this option
+accumulate exclusion patterns. Use `--no-exclude` to clear and reset the list of
+patterns. If a ref is already packed, including it with `--exclude` will not
+unpack it.
+
+When used with `--all`, pack only loose refs which do not match any of
+the provided `--exclude` patterns.
+
+When used with `--include`, refs provided to `--include`, minus refs that are
+provided to `--exclude` will be packed.
+
BUGS
----
diff --git a/Documentation/git-patch-id.txt b/Documentation/git-patch-id.txt
index 442caff..1d15fa4 100644
--- a/Documentation/git-patch-id.txt
+++ b/Documentation/git-patch-id.txt
@@ -8,18 +8,18 @@ git-patch-id - Compute unique ID for a patch
SYNOPSIS
--------
[verse]
-'git patch-id' [--stable | --unstable]
+'git patch-id' [--stable | --unstable | --verbatim]
DESCRIPTION
-----------
Read a patch from the standard input and compute the patch ID for it.
A "patch ID" is nothing but a sum of SHA-1 of the file diffs associated with a
-patch, with whitespace and line numbers ignored. As such, it's "reasonably
-stable", but at the same time also reasonably unique, i.e., two patches that
-have the same "patch ID" are almost guaranteed to be the same thing.
+patch, with line numbers ignored. As such, it's "reasonably stable", but at
+the same time also reasonably unique, i.e., two patches that have the same
+"patch ID" are almost guaranteed to be the same thing.
-IOW, you can use this thing to look for likely duplicate commits.
+The main usecase for this command is to look for likely duplicate commits.
When dealing with 'git diff-tree' output, it takes advantage of
the fact that the patch is prefixed with the object name of the
@@ -30,6 +30,12 @@ This can be used to make a mapping from patch ID to commit ID.
OPTIONS
-------
+--verbatim::
+ Calculate the patch-id of the input as it is given, do not strip
+ any whitespace.
+
+ This is the default if patchid.verbatim is true.
+
--stable::
Use a "stable" sum of hashes as the patch ID. With this option:
- Reordering file diffs that make up a patch does not affect the ID.
@@ -45,14 +51,16 @@ OPTIONS
of "-O<orderfile>", thereby making existing databases storing such
"unstable" or historical patch-ids unusable.
+ - All whitespace within the patch is ignored and does not affect the id.
+
This is the default if patchid.stable is set to true.
--unstable::
Use an "unstable" hash as the patch ID. With this option,
the result produced is compatible with the patch-id value produced
- by git 1.9 and older. Users with pre-existing databases storing
- patch-ids produced by git 1.9 and older (who do not deal with reordered
- patches) may want to use this option.
+ by git 1.9 and older and whitespace is ignored. Users with pre-existing
+ databases storing patch-ids produced by git 1.9 and older (who do not deal
+ with reordered patches) may want to use this option.
This is the default.
diff --git a/Documentation/git-prune-packed.txt b/Documentation/git-prune-packed.txt
index 9fed59a..db742dc 100644
--- a/Documentation/git-prune-packed.txt
+++ b/Documentation/git-prune-packed.txt
@@ -9,13 +9,13 @@ git-prune-packed - Remove extra objects that are already in pack files
SYNOPSIS
--------
[verse]
-'git prune-packed' [-n|--dry-run] [-q|--quiet]
+'git prune-packed' [-n | --dry-run] [-q | --quiet]
DESCRIPTION
-----------
This program searches the `$GIT_OBJECT_DIRECTORY` for all objects that currently
-exist in a pack file as well as the independent object directories.
+exist in a pack file as well as in the independent object directories.
All such extra objects are removed.
diff --git a/Documentation/git-prune.txt b/Documentation/git-prune.txt
index 03552dd..9a45571 100644
--- a/Documentation/git-prune.txt
+++ b/Documentation/git-prune.txt
@@ -18,7 +18,7 @@ NOTE: In most cases, users should run 'git gc', which calls
'git prune'. See the section "NOTES", below.
This runs 'git fsck --unreachable' using all the refs
-available in `refs/`, optionally with additional set of
+available in `refs/`, optionally with an additional set of
objects specified on the command line, and prunes all unpacked
objects unreachable from any of these head objects from the object database.
In addition, it
diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
index 0e14f8b..b2ae496 100644
--- a/Documentation/git-pull.txt
+++ b/Documentation/git-pull.txt
@@ -87,7 +87,7 @@ OPTIONS
--verbose::
Pass --verbose to git-fetch and git-merge.
---[no-]recurse-submodules[=yes|on-demand|no]::
+--[no-]recurse-submodules[=(yes|on-demand|no)]::
This option controls if new commits of populated submodules should
be fetched, and if the working trees of active submodules should be
updated, too (see linkgit:git-fetch[1], linkgit:git-config[1] and
@@ -105,7 +105,7 @@ Options related to merging
include::merge-options.txt[]
-r::
---rebase[=false|true|merges|interactive]::
+--rebase[=(false|true|merges|interactive)]::
When true, rebase the current branch on top of the upstream
branch after fetching. If there is a remote-tracking branch
corresponding to the upstream branch and the upstream branch
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 2f25aa3..9b7cfbc 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -9,8 +9,8 @@ git-push - Update remote refs along with associated objects
SYNOPSIS
--------
[verse]
-'git push' [--all | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>]
- [--repo=<repository>] [-f | --force] [-d | --delete] [--prune] [-v | --verbose]
+'git push' [--all | --branches | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>]
+ [--repo=<repository>] [-f | --force] [-d | --delete] [--prune] [-q | --quiet] [-v | --verbose]
[-u | --set-upstream] [-o <string> | --push-option=<string>]
[--[no-]signed|--signed=(true|false|if-asked)]
[--force-with-lease[=<refname>[:<expect>]] [--force-if-includes]]
@@ -37,7 +37,7 @@ the default `<refspec>` by consulting `remote.*.push` configuration,
and if it is not found, honors `push.default` configuration to decide
what to push (See linkgit:git-config[1] for the meaning of `push.default`).
-When neither the command-line nor the configuration specify what to
+When neither the command-line nor the configuration specifies what to
push, the default behavior is used, which corresponds to the `simple`
value for `push.default`: the current branch is pushed to the
corresponding upstream branch, but as a safety measure, the push is
@@ -48,7 +48,7 @@ local one.
OPTIONS[[OPTIONS]]
------------------
<repository>::
- The "remote" repository that is destination of a push
+ The "remote" repository that is the destination of a push
operation. This parameter can be either a URL
(see the section <<URLS,GIT URLS>> below) or the name
of a remote (see the section <<REMOTES,REMOTES>> below).
@@ -147,6 +147,7 @@ already exists on the remote side.
`tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
--all::
+--branches::
Push all branches (i.e. refs under `refs/heads/`); cannot be
used with other <refspec>.
@@ -409,10 +410,14 @@ Specifying `--no-force-if-includes` disables this behavior.
all submodules that changed in the revisions to be pushed will be
pushed. If on-demand was not able to push all necessary revisions it will
also be aborted and exit with non-zero status. If 'only' is used all
- submodules will be recursively pushed while the superproject is left
+ submodules will be pushed while the superproject is left
unpushed. A value of 'no' or using `--no-recurse-submodules` can be used
to override the push.recurseSubmodules configuration variable when no
submodule recursion is required.
++
+When using 'on-demand' or 'only', if a submodule has a
+"push.recurseSubmodules={on-demand,only}" or "submodule.recurse" configuration,
+further recursion will occur. In this case, "only" is treated as "on-demand".
--[no-]verify::
Toggle the pre-push hook (see linkgit:githooks[5]). The
@@ -692,6 +697,13 @@ a `git gc` command on the origin repository.
include::transfer-data-leaks.txt[]
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/push.txt[]
+
GIT
---
Part of the linkgit:git[1] suite
diff --git a/Documentation/git-quiltimport.txt b/Documentation/git-quiltimport.txt
index 70562dc..40e02d9 100644
--- a/Documentation/git-quiltimport.txt
+++ b/Documentation/git-quiltimport.txt
@@ -38,14 +38,14 @@ OPTIONS
a patch. At the time of this writing only missing author
information is warned about.
---author Author Name <Author Email>::
+--author 'Author Name <Author Email>'::
The author name and email address to use when no author
information can be found in the patch description.
--patches <dir>::
The directory to find the quilt patches.
+
-The default for the patch directory is patches
+The default for the patch directory is 'patches'
or the value of the `$QUILT_PATCHES` environment
variable.
diff --git a/Documentation/git-range-diff.txt b/Documentation/git-range-diff.txt
index fe350d7..fbdbe0b 100644
--- a/Documentation/git-range-diff.txt
+++ b/Documentation/git-range-diff.txt
@@ -12,6 +12,7 @@ SYNOPSIS
[--no-dual-color] [--creation-factor=<factor>]
[--left-only | --right-only]
( <range1> <range2> | <rev1>...<rev2> | <base> <rev1> <rev2> )
+ [[--] <path>...]
DESCRIPTION
-----------
@@ -19,6 +20,9 @@ DESCRIPTION
This command shows the differences between two versions of a patch
series, or more generally, two commit ranges (ignoring merge commits).
+In the presence of `<path>` arguments, these commit ranges are limited
+accordingly.
+
To that end, it first finds pairs of commits from both commit ranges
that correspond with each other. Two commits are said to correspond when
the diff between their patches (i.e. the author information, the commit
@@ -66,7 +70,7 @@ to revert to color all lines according to the outer diff markers
Defaults to 60. Try a larger value if `git range-diff` erroneously
considers a large change a total rewrite (deletion of one commit
and addition of another), and a smaller one in the reverse case.
- See the ``Algorithm`` section below for an explanation why this is
+ See the ``Algorithm`` section below for an explanation of why this is
needed.
--left-only::
@@ -162,7 +166,7 @@ A typical output of `git range-diff` would look like this:
In this example, there are 3 old and 3 new commits, where the developer
removed the 3rd, added a new one before the first two, and modified the
-commit message of the 2nd commit as well its diff.
+commit message of the 2nd commit as well as its diff.
When the output goes to a terminal, it is color-coded by default, just
like regular `git diff`'s output. In addition, the first line (adding a
diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt
index b9bfdc0..1c48c28 100644
--- a/Documentation/git-read-tree.txt
+++ b/Documentation/git-read-tree.txt
@@ -9,7 +9,7 @@ git-read-tree - Reads tree information into the index
SYNOPSIS
--------
[verse]
-'git read-tree' [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>]
+'git read-tree' [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>)
[-u | -i]] [--index-output=<file>] [--no-sparse-checkout]
(--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])
@@ -25,15 +25,15 @@ fast-forward (i.e. 2-way) merge, or a 3-way merge, with the `-m`
flag. When used with `-m`, the `-u` flag causes it to also update
the files in the work tree with the result of the merge.
-Trivial merges are done by 'git read-tree' itself. Only conflicting paths
-will be in unmerged state when 'git read-tree' returns.
+Only trivial merges are done by 'git read-tree' itself. Only conflicting paths
+will be in an unmerged state when 'git read-tree' returns.
OPTIONS
-------
-m::
Perform a merge, not just a read. The command will
refuse to run if your index file has unmerged entries,
- indicating that you have not finished previous merge you
+ indicating that you have not finished a previous merge you
started.
--reset::
@@ -219,7 +219,7 @@ see which of the "local changes" that you made were carried forward by running
`git diff-index --cached $M`. Note that this does not
necessarily match what `git diff-index --cached $H` would have
produced before such a two tree merge. This is because of cases
-18 and 19 --- if you already had the changes in $M (e.g. maybe
+18 and 19 -- if you already had the changes in $M (e.g. maybe
you picked it up via e-mail in a patch form), `git diff-index
--cached $H` would have told you about the change before this
merge, but it would not show in `git diff-index --cached $M`
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index a872ab0..74df345 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -12,7 +12,7 @@ SYNOPSIS
[--onto <newbase> | --keep-base] [<upstream> [<branch>]]
'git rebase' [-i | --interactive] [<options>] [--exec <cmd>] [--onto <newbase>]
--root [<branch>]
-'git rebase' (--continue | --skip | --abort | --quit | --edit-todo | --show-current-patch)
+'git rebase' (--continue|--skip|--abort|--quit|--edit-todo|--show-current-patch)
DESCRIPTION
-----------
@@ -38,6 +38,13 @@ The current branch is reset to `<upstream>` or `<newbase>` if the
`git reset --hard <upstream>` (or `<newbase>`). `ORIG_HEAD` is set
to point at the tip of the branch before the reset.
+[NOTE]
+`ORIG_HEAD` is not guaranteed to still point to the previous branch tip
+at the end of the rebase if other commands that write that pseudo-ref
+(e.g. `git reset`) are used during the rebase. The previous branch tip,
+however, is accessible using the reflog of the current branch
+(i.e. `@{1}`, see linkgit:gitrevisions[7]).
+
The commits that were previously saved into the temporary area are
then reapplied to the current branch, one by one, in order. Note that
any commits in `HEAD` which introduce the same textual changes as a commit
@@ -201,6 +208,39 @@ Alternatively, you can undo the 'git rebase' with
git rebase --abort
+MODE OPTIONS
+------------
+
+The options in this section cannot be used with any other option,
+including not with each other:
+
+--continue::
+ Restart the rebasing process after having resolved a merge conflict.
+
+--skip::
+ Restart the rebasing process by skipping the current patch.
+
+--abort::
+ Abort the rebase operation and reset HEAD to the original
+ branch. If `<branch>` was provided when the rebase operation was
+ started, then `HEAD` will be reset to `<branch>`. Otherwise `HEAD`
+ will be reset to where it was when the rebase operation was
+ started.
+
+--quit::
+ Abort the rebase operation but `HEAD` is not reset back to the
+ original branch. The index and working tree are also left
+ unchanged as a result. If a temporary stash entry was created
+ using `--autostash`, it will be saved to the stash list.
+
+--edit-todo::
+ Edit the todo list during an interactive rebase.
+
+--show-current-patch::
+ Show the current patch in an interactive rebase or when rebase
+ is stopped because of conflicts. This is the equivalent of
+ `git show REBASE_HEAD`.
+
OPTIONS
-------
--onto <newbase>::
@@ -218,12 +258,14 @@ leave out at most one of A and B, in which case it defaults to HEAD.
merge base of `<upstream>` and `<branch>`. Running
`git rebase --keep-base <upstream> <branch>` is equivalent to
running
- `git rebase --onto <upstream>...<branch> <upstream> <branch>`.
+ `git rebase --reapply-cherry-picks --no-fork-point --onto <upstream>...<branch> <upstream> <branch>`.
+
This option is useful in the case where one is developing a feature on
top of an upstream branch. While the feature is being worked on, the
upstream branch may advance and it may not be the best idea to keep
-rebasing on top of the upstream but to keep the base commit as-is.
+rebasing on top of the upstream but to keep the base commit as-is. As
+the base commit is unchanged this option implies `--reapply-cherry-picks`
+to avoid losing commits.
+
Although both this option and `--fork-point` find the merge base between
`<upstream>` and `<branch>`, this option uses the merge base as the _starting
@@ -240,22 +282,6 @@ See also INCOMPATIBLE OPTIONS below.
<branch>::
Working branch; defaults to `HEAD`.
---continue::
- Restart the rebasing process after having resolved a merge conflict.
-
---abort::
- Abort the rebase operation and reset HEAD to the original
- branch. If `<branch>` was provided when the rebase operation was
- started, then `HEAD` will be reset to `<branch>`. Otherwise `HEAD`
- will be reset to where it was when the rebase operation was
- started.
-
---quit::
- Abort the rebase operation but `HEAD` is not reset back to the
- original branch. The index and working tree are also left
- unchanged as a result. If a temporary stash entry was created
- using `--autostash`, it will be saved to the stash list.
-
--apply::
Use applying strategies to rebase (calling `git-am`
internally). This option may become a no-op in the future
@@ -263,22 +289,31 @@ See also INCOMPATIBLE OPTIONS below.
+
See also INCOMPATIBLE OPTIONS below.
---empty={drop,keep,ask}::
+--empty=(drop|keep|stop)::
How to handle commits that are not empty to start and are not
clean cherry-picks of any upstream commit, but which become
empty after rebasing (because they contain a subset of already
- upstream changes). With drop (the default), commits that
- become empty are dropped. With keep, such commits are kept.
- With ask (implied by `--interactive`), the rebase will halt when
- an empty commit is applied allowing you to choose whether to
- drop it, edit files more, or just commit the empty changes.
- Other options, like `--exec`, will use the default of drop unless
- `-i`/`--interactive` is explicitly specified.
+ upstream changes):
++
+--
+`drop`;;
+ The commit will be dropped. This is the default behavior.
+`keep`;;
+ The commit will be kept. This option is implied when `--exec` is
+ specified unless `-i`/`--interactive` is also specified.
+`stop`;;
+`ask`;;
+ The rebase will halt when the commit is applied, allowing you to
+ choose whether to drop it, edit files more, or just commit the empty
+ changes. This option is implied when `-i`/`--interactive` is
+ specified. `ask` is a deprecated synonym of `stop`.
+--
+
Note that commits which start empty are kept (unless `--no-keep-empty`
is specified), and commits which are clean cherry-picks (as determined
by `git log --cherry-mark ...`) are detected and dropped as a
-preliminary step (unless `--reapply-cherry-picks` is passed).
+preliminary step (unless `--reapply-cherry-picks` or `--keep-base` is
+passed).
+
See also INCOMPATIBLE OPTIONS below.
@@ -311,13 +346,14 @@ See also INCOMPATIBLE OPTIONS below.
upstream changes, the behavior towards them is controlled by
the `--empty` flag.)
+
-By default (or if `--no-reapply-cherry-picks` is given), these commits
-will be automatically dropped. Because this necessitates reading all
-upstream commits, this can be expensive in repos with a large number
-of upstream commits that need to be read. When using the 'merge'
-backend, warnings will be issued for each dropped commit (unless
-`--quiet` is given). Advice will also be issued unless
-`advice.skippedCherryPicks` is set to false (see linkgit:git-config[1]).
+In the absence of `--keep-base` (or if `--no-reapply-cherry-picks` is
+given), these commits will be automatically dropped. Because this
+necessitates reading all upstream commits, this can be expensive in
+repositories with a large number of upstream commits that need to be
+read. When using the 'merge' backend, warnings will be issued for each
+dropped commit (unless `--quiet` is given). Advice will also be issued
+unless `advice.skippedCherryPicks` is set to false (see
+linkgit:git-config[1]).
+
`--reapply-cherry-picks` allows rebase to forgo reading all upstream
commits, potentially improving performance.
@@ -332,17 +368,6 @@ See also INCOMPATIBLE OPTIONS below.
+
See also INCOMPATIBLE OPTIONS below.
---skip::
- Restart the rebasing process by skipping the current patch.
-
---edit-todo::
- Edit the todo list during an interactive rebase.
-
---show-current-patch::
- Show the current patch in an interactive rebase or when rebase
- is stopped because of conflicts. This is the equivalent of
- `git show REBASE_HEAD`.
-
-m::
--merge::
Using merging strategies to rebase (default).
@@ -376,10 +401,7 @@ See also INCOMPATIBLE OPTIONS below.
+
See also INCOMPATIBLE OPTIONS below.
---rerere-autoupdate::
---no-rerere-autoupdate::
- Allow the rerere mechanism to update the index with the
- result of auto-conflict resolution if possible.
+include::rerere-options.txt[]
-S[<keyid>]::
--gpg-sign[=<keyid>]::
@@ -446,9 +468,9 @@ When `--fork-point` is active, 'fork_point' will be used instead of
<branch>` command (see linkgit:git-merge-base[1]). If 'fork_point'
ends up being empty, the `<upstream>` will be used as a fallback.
+
-If `<upstream>` is given on the command line, then the default is
-`--no-fork-point`, otherwise the default is `--fork-point`. See also
-`rebase.forkpoint` in linkgit:git-config[1].
+If `<upstream>` or `--keep-base` is given on the command line, then
+the default is `--no-fork-point`, otherwise the default is
+`--fork-point`. See also `rebase.forkpoint` in linkgit:git-config[1].
+
If your branch was based on `<upstream>` but `<upstream>` was rewound and
your branch contains commits which were dropped, this option can be used
@@ -509,26 +531,31 @@ See also INCOMPATIBLE OPTIONS below.
+
The commit list format can be changed by setting the configuration option
rebase.instructionFormat. A customized instruction format will automatically
-have the long commit hash prepended to the format.
+have the commit hash prepended to the format.
+
See also INCOMPATIBLE OPTIONS below.
-r::
--rebase-merges[=(rebase-cousins|no-rebase-cousins)]::
+--no-rebase-merges::
By default, a rebase will simply drop merge commits from the todo
list, and put the rebased commits into a single, linear branch.
With `--rebase-merges`, the rebase will instead try to preserve
the branching structure within the commits that are to be rebased,
by recreating the merge commits. Any resolved merge conflicts or
manual amendments in these merge commits will have to be
- resolved/re-applied manually.
+ resolved/re-applied manually. `--no-rebase-merges` can be used to
+ countermand both the `rebase.rebaseMerges` config option and a previous
+ `--rebase-merges`.
+
-By default, or when `no-rebase-cousins` was specified, commits which do not
-have `<upstream>` as direct ancestor will keep their original branch point,
-i.e. commits that would be excluded by linkgit:git-log[1]'s
-`--ancestry-path` option will keep their original ancestry by default. If
-the `rebase-cousins` mode is turned on, such commits are instead rebased
-onto `<upstream>` (or `<onto>`, if specified).
+When rebasing merges, there are two modes: `rebase-cousins` and
+`no-rebase-cousins`. If the mode is not specified, it defaults to
+`no-rebase-cousins`. In `no-rebase-cousins` mode, commits which do not have
+`<upstream>` as direct ancestor will keep their original branch point, i.e.
+commits that would be excluded by linkgit:git-log[1]'s `--ancestry-path`
+option will keep their original ancestry by default. In `rebase-cousins` mode,
+such commits are instead rebased onto `<upstream>` (or `<onto>`, if
+specified).
+
It is currently only possible to recreate the merge commits using the
`ort` merge strategy; different merge strategies can be used only via
@@ -564,30 +591,33 @@ See also INCOMPATIBLE OPTIONS below.
--root::
Rebase all commits reachable from `<branch>`, instead of
limiting them with an `<upstream>`. This allows you to rebase
- the root commit(s) on a branch. When used with `--onto`, it
- will skip changes already contained in `<newbase>` (instead of
- `<upstream>`) whereas without `--onto` it will operate on every
- change.
+ the root commit(s) on a branch.
+
See also INCOMPATIBLE OPTIONS below.
--autosquash::
--no-autosquash::
- When the commit log message begins with "squash! ..." or "fixup! ..."
- or "amend! ...", and there is already a commit in the todo list that
- matches the same `...`, automatically modify the todo list of
- `rebase -i`, so that the commit marked for squashing comes right after
- the commit to be modified, and change the action of the moved commit
- from `pick` to `squash` or `fixup` or `fixup -C` respectively. A commit
- matches the `...` if the commit subject matches, or if the `...` refers
- to the commit's hash. As a fall-back, partial matches of the commit
- subject work, too. The recommended way to create fixup/amend/squash
- commits is by using the `--fixup`, `--fixup=amend:` or `--fixup=reword:`
- and `--squash` options respectively of linkgit:git-commit[1].
+ Automatically squash commits with specially formatted messages into
+ previous commits being rebased. If a commit message starts with
+ "squash! ", "fixup! " or "amend! ", the remainder of the subject line
+ is taken as a commit specifier, which matches a previous commit if it
+ matches the subject line or the hash of that commit. If no commit
+ matches fully, matches of the specifier with the start of commit
+ subjects are considered.
++
+In the rebase todo list, the actions of squash, fixup and amend commits are
+changed from `pick` to `squash`, `fixup` or `fixup -C`, respectively, and they
+are moved right after the commit they modify. The `--interactive` option can
+be used to review and edit the todo list before proceeding.
+
-If the `--autosquash` option is enabled by default using the
-configuration variable `rebase.autoSquash`, this option can be
-used to override and disable this setting.
+The recommended way to create commits with squash markers is by using the
+`--squash`, `--fixup`, `--fixup=amend:` or `--fixup=reword:` options of
+linkgit:git-commit[1], which take the target commit as an argument and
+automatically fill in the subject line of the new commit from that.
++
+Setting configuration variable `rebase.autoSquash` to true enables
+auto-squashing by default for interactive rebase. The `--no-autosquash`
+option can be used to override that setting.
+
See also INCOMPATIBLE OPTIONS below.
@@ -604,13 +634,27 @@ See also INCOMPATIBLE OPTIONS below.
Automatically reschedule `exec` commands that failed. This only makes
sense in interactive mode (or when an `--exec` option was provided).
+
-Even though this option applies once a rebase is started, it's set for
-the whole rebase at the start based on either the
-`rebase.rescheduleFailedExec` configuration (see linkgit:git-config[1]
-or "CONFIGURATION" below) or whether this option is
-provided. Otherwise an explicit `--no-reschedule-failed-exec` at the
-start would be overridden by the presence of
-`rebase.rescheduleFailedExec=true` configuration.
+This option applies once a rebase is started. It is preserved for the whole
+rebase based on, in order, the command line option provided to the initial `git
+rebase`, the `rebase.rescheduleFailedExec` configuration (see
+linkgit:git-config[1] or "CONFIGURATION" below), or it defaults to false.
++
+Recording this option for the whole rebase is a convenience feature. Otherwise
+an explicit `--no-reschedule-failed-exec` at the start would be overridden by
+the presence of a `rebase.rescheduleFailedExec=true` configuration when `git
+rebase --continue` is invoked. Currently, you cannot pass
+`--[no-]reschedule-failed-exec` to `git rebase --continue`.
+
+--update-refs::
+--no-update-refs::
+ Automatically force-update any branches that point to commits that
+ are being rebased. Any branches that are checked out in a worktree
+ are not updated in this way.
++
+If the configuration variable `rebase.updateRefs` is set, then this option
+can be used to override and disable this setting.
++
+See also INCOMPATIBLE OPTIONS below.
INCOMPATIBLE OPTIONS
--------------------
@@ -626,16 +670,15 @@ are incompatible with the following options:
* --merge
* --strategy
* --strategy-option
- * --allow-empty-message
- * --[no-]autosquash
+ * --autosquash
* --rebase-merges
* --interactive
* --exec
* --no-keep-empty
* --empty=
- * --reapply-cherry-picks
- * --edit-todo
- * --root when used in combination with --onto
+ * --[no-]reapply-cherry-picks when used without --keep-base
+ * --update-refs
+ * --root when used without --onto
In addition, the following pairs of options are incompatible:
@@ -669,7 +712,7 @@ be dropped automatically with `--no-keep-empty`).
Similar to the apply backend, by default the merge backend drops
commits that become empty unless `-i`/`--interactive` is specified (in
which case it stops and asks the user what to do). The merge backend
-also has an `--empty={drop,keep,ask}` option for changing the behavior
+also has an `--empty=(drop|keep|stop)` option for changing the behavior
of handling commits that become empty.
Directory rename detection
@@ -931,10 +974,9 @@ The interactive rebase will stop when a command fails (i.e. exits with
non-0 status) to give you an opportunity to fix the problem. You can
continue with `git rebase --continue`.
-The "exec" command launches the command in a shell (the one specified
-in `$SHELL`, or the default shell if `$SHELL` is not set), so you can
-use shell features (like "cd", ">", ";" ...). The command is run from
-the root of the working tree.
+The "exec" command launches the command in a shell (the default one, usually
+/bin/sh), so you can use shell features (like "cd", ">", ";" ...). The command
+is run from the root of the working tree.
----------------------------------
$ git rebase -i --exec "make test"
@@ -1252,6 +1294,8 @@ merge cmake
CONFIGURATION
-------------
+include::includes/cmd-config-section-all.txt[]
+
include::config/rebase.txt[]
include::config/sequencer.txt[]
diff --git a/Documentation/git-receive-pack.txt b/Documentation/git-receive-pack.txt
index 014a784..20aca92 100644
--- a/Documentation/git-receive-pack.txt
+++ b/Documentation/git-receive-pack.txt
@@ -9,7 +9,7 @@ git-receive-pack - Receive what is pushed into the repository
SYNOPSIS
--------
[verse]
-'git-receive-pack' <directory>
+'git receive-pack' <git-dir>
DESCRIPTION
-----------
@@ -18,10 +18,10 @@ information fed from the remote end.
This command is usually not invoked directly by the end user.
The UI for the protocol is on the 'git send-pack' side, and the
-program pair is meant to be used to push updates to remote
+program pair is meant to be used to push updates to a remote
repository. For pull operations, see linkgit:git-fetch-pack[1].
-The command allows for creation and fast-forwarding of sha1 refs
+The command allows for the creation and fast-forwarding of sha1 refs
(heads/tags) on the remote end (strictly speaking, it is the
local end 'git-receive-pack' runs, but to the user who is sitting at
the send-pack end, it is updating the remote. Confused?)
@@ -38,7 +38,7 @@ its behavior, see linkgit:git-config[1].
OPTIONS
-------
-<directory>::
+<git-dir>::
The repository to sync into.
--http-backend-info-refs::
diff --git a/Documentation/git-reflog.txt b/Documentation/git-reflog.txt
index 5ced7ad..a929c52 100644
--- a/Documentation/git-reflog.txt
+++ b/Documentation/git-reflog.txt
@@ -9,22 +9,19 @@ git-reflog - Manage reflog information
SYNOPSIS
--------
[verse]
-'git reflog' <subcommand> <options>
-
-DESCRIPTION
------------
-The command takes various subcommands, and different options
-depending on the subcommand:
-
-[verse]
-'git reflog' ['show'] [<log-options>] [<ref>]
+'git reflog' [show] [<log-options>] [<ref>]
+'git reflog list'
'git reflog expire' [--expire=<time>] [--expire-unreachable=<time>]
[--rewrite] [--updateref] [--stale-fix]
[--dry-run | -n] [--verbose] [--all [--single-worktree] | <refs>...]
'git reflog delete' [--rewrite] [--updateref]
- [--dry-run | -n] [--verbose] <ref>@\{<specifier>\}...
+ [--dry-run | -n] [--verbose] <ref>@{<specifier>}...
'git reflog exists' <ref>
+DESCRIPTION
+-----------
+This command manages the information recorded in the reflogs.
+
Reference logs, or "reflogs", record when the tips of branches and
other references were updated in the local repository. Reflogs are
useful in various Git commands, to specify the old value of a
@@ -33,7 +30,8 @@ moves ago", `master@{one.week.ago}` means "where master used to point
to one week ago in this local repository", and so on. See
linkgit:gitrevisions[7] for more details.
-This command manages the information recorded in the reflogs.
+The command takes various subcommands, and different options
+depending on the subcommand:
The "show" subcommand (which is also the default, in the absence of
any subcommands) shows the log of the reference provided in the
@@ -42,6 +40,8 @@ actions, and in addition the `HEAD` reflog records branch switching.
`git reflog show` is an alias for `git log -g --abbrev-commit
--pretty=oneline`; see linkgit:git-log[1] for more information.
+The "list" subcommand lists all refs which have a corresponding reflog.
+
The "expire" subcommand prunes older reflog entries. Entries older
than `expire` time, or entries older than `expire-unreachable` time
and not reachable from the current tip, are removed from the reflog.
diff --git a/Documentation/git-remote-ext.txt b/Documentation/git-remote-ext.txt
index 88ea7e1..b33ee3c 100644
--- a/Documentation/git-remote-ext.txt
+++ b/Documentation/git-remote-ext.txt
@@ -44,15 +44,15 @@ The following sequences have a special meaning:
This argument will not be passed to '<command>'. Instead, it
will cause the helper to start by sending git:// service requests to
the remote side with the service field set to an appropriate value and
- the repository field set to rest of the argument. Default is not to send
+ the repository field set to the rest of the argument. Default is not to send
such a request.
+
-This is useful if remote side is git:// server accessed over
+This is useful if the remote side is git:// server accessed over
some tunnel.
'%V' (must be first characters in argument)::
This argument will not be passed to '<command>'. Instead it sets
- the vhost field in the git:// service request (to rest of the argument).
+ the vhost field in the git:// service request (to the rest of the argument).
Default is not to send vhost in such request (if sent).
ENVIRONMENT VARIABLES
@@ -82,12 +82,12 @@ begins with `ext::`. Examples:
"ext::ssh -i /home/foo/.ssh/somekey user&#64;host.example %S 'foo/repo'"::
Like host.example:foo/repo, but use /home/foo/.ssh/somekey as
- keypair and user as user on remote side. This avoids needing to
+ keypair and user as the user on the remote side. This avoids the need to
edit .ssh/config.
"ext::socat -t3600 - ABSTRACT-CONNECT:/git-server %G/somerepo"::
Represents repository with path /somerepo accessible over
- git protocol at abstract namespace address /git-server.
+ git protocol at the abstract namespace address /git-server.
"ext::git-server-alias foo %G/repo"::
Represents a repository with path /repo accessed using the
diff --git a/Documentation/git-remote-fd.txt b/Documentation/git-remote-fd.txt
index 0451ceb..1dd2648 100644
--- a/Documentation/git-remote-fd.txt
+++ b/Documentation/git-remote-fd.txt
@@ -13,19 +13,19 @@ DESCRIPTION
-----------
This helper uses specified file descriptors to connect to a remote Git server.
This is not meant for end users but for programs and scripts calling git
-fetch, push or archive.
+fetch, push, or archive.
If only <infd> is given, it is assumed to be a bidirectional socket connected
-to remote Git server (git-upload-pack, git-receive-pack or
+to a remote Git server (git-upload-pack, git-receive-pack, or
git-upload-archive). If both <infd> and <outfd> are given, they are assumed
to be pipes connected to a remote Git server (<infd> being the inbound pipe
-and <outfd> being the outbound pipe.
+and <outfd> being the outbound pipe).
It is assumed that any handshaking procedures have already been completed
(such as sending service request for git://) before this helper is started.
<anything> can be any string. It is ignored. It is meant for providing
-information to user in the URL in case that URL is displayed in some
+information to the user in the URL in case that URL is displayed in some
context.
ENVIRONMENT VARIABLES
@@ -45,7 +45,7 @@ EXAMPLES
`git push fd::7,8 master (as URL)`::
Push master, using file descriptor #7 to read data from
git-receive-pack and file descriptor #8 to write data to
- same service.
+ the same service.
`git push fd::7,8/bar master`::
Same as above.
diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt
index 1dec314..932a5c3 100644
--- a/Documentation/git-remote.txt
+++ b/Documentation/git-remote.txt
@@ -35,7 +35,7 @@ OPTIONS
-v::
--verbose::
Be a little more verbose and show remote url after name.
- For promisor remotes, also show which filter (`blob:none` etc.)
+ For promisor remotes, also show which filters (`blob:none` etc.)
are configured.
NOTE: This must be placed between `remote` and subcommand.
diff --git a/Documentation/git-repack.txt b/Documentation/git-repack.txt
index 0bf1389..c902512 100644
--- a/Documentation/git-repack.txt
+++ b/Documentation/git-repack.txt
@@ -74,6 +74,23 @@ to the new separate pack will be written.
immediately instead of waiting for the next `git gc` invocation.
Only useful with `--cruft -d`.
+--max-cruft-size=<n>::
+ Repack cruft objects into packs as large as `<n>` bytes before
+ creating new packs. As long as there are enough cruft packs
+ smaller than `<n>`, repacking will cause a new cruft pack to
+ be created containing objects from any combined cruft packs,
+ along with any new unreachable objects. Cruft packs larger than
+ `<n>` will not be modified. When the new cruft pack is larger
+ than `<n>` bytes, it will be split into multiple packs, all of
+ which are guaranteed to be at most `<n>` bytes in size. Only
+ useful with `--cruft -d`.
+
+--expire-to=<dir>::
+ Write a cruft pack containing pruned objects (if any) to the
+ directory `<dir>`. This option is useful for keeping a copy of
+ any pruned objects in a separate directory as a backup. Only
+ useful with `--cruft -d`.
+
-l::
Pass the `--local` option to 'git pack-objects'. See
linkgit:git-pack-objects[1].
@@ -137,6 +154,29 @@ depth is 4095.
a larger and slower repository; see the discussion in
`pack.packSizeLimit`.
+--filter=<filter-spec>::
+ Remove objects matching the filter specification from the
+ resulting packfile and put them into a separate packfile. Note
+ that objects used in the working directory are not filtered
+ out. So for the split to fully work, it's best to perform it
+ in a bare repo and to use the `-a` and `-d` options along with
+ this option. Also `--no-write-bitmap-index` (or the
+ `repack.writebitmaps` config option set to `false`) should be
+ used otherwise writing bitmap index will fail, as it supposes
+ a single packfile containing all the objects. See
+ linkgit:git-rev-list[1] for valid `<filter-spec>` forms.
+
+--filter-to=<dir>::
+ Write the pack containing filtered out objects to the
+ directory `<dir>`. Only useful with `--filter`. This can be
+ used for putting the pack on a separate object directory that
+ is accessed through the Git alternates mechanism. **WARNING:**
+ If the packfile containing the filtered out objects is not
+ accessible, the repo can become corrupt as it might not be
+ possible to access the objects in that packfile. See the
+ `objects` and `objects/info/alternates` sections of
+ linkgit:gitrepository-layout[5].
+
-b::
--write-bitmap-index::
Write a reachability bitmap index as part of the repack. This
@@ -159,7 +199,7 @@ depth is 4095.
Exclude the given pack from repacking. This is the equivalent
of having `.keep` file on the pack. `<pack-name>` is the
pack file name without leading directory (e.g. `pack-123.pack`).
- The option could be specified multiple times to keep multiple
+ The option can be specified multiple times to keep multiple
packs.
--unpack-unreachable=<when>::
@@ -180,7 +220,7 @@ depth is 4095.
Pass the `--delta-islands` option to `git-pack-objects`, see
linkgit:git-pack-objects[1].
--g=<factor>::
+-g<factor>::
--geometric=<factor>::
Arrange resulting pack structure so that each successive pack
contains at least `<factor>` times the number of objects as the
@@ -197,11 +237,8 @@ uniquely by the set of packs being "rolled-up"; in other words, the
packs determined to need to be combined in order to restore a geometric
progression.
+
-When `--unpacked` is specified, loose objects are implicitly included in
-this "roll-up", without respect to their reachability. This is subject
-to change in the future. This option (implying a drastically different
-repack mode) is not guaranteed to work with all other combinations of
-option to `git repack`.
+Loose objects are implicitly included in this "roll-up", without respect to
+their reachability. This is subject to change in the future.
+
When writing a multi-pack bitmap, `git repack` selects the largest resulting
pack as the preferred pack for object selection by the MIDX (see
diff --git a/Documentation/git-replace.txt b/Documentation/git-replace.txt
index f271d75..0a65460 100644
--- a/Documentation/git-replace.txt
+++ b/Documentation/git-replace.txt
@@ -35,7 +35,7 @@ Replacement references will be used by default by all Git commands
except those doing reachability traversal (prune, pack transfer and
fsck).
-It is possible to disable use of replacement references for any
+It is possible to disable the use of replacement references for any
command using the `--no-replace-objects` option just after 'git'.
For example if commit 'foo' has been replaced by commit 'bar':
@@ -111,14 +111,14 @@ OPTIONS
FORMATS
-------
-The following format are available:
+The following formats are available:
* 'short':
- <replaced sha1>
+ <replaced-sha1>
* 'medium':
- <replaced sha1> -> <replacement sha1>
+ <replaced-sha1> -> <replacement-sha1>
* 'long':
- <replaced sha1> (<replaced type>) -> <replacement sha1> (<replacement type>)
+ <replaced-sha1> (<replaced-type>) -> <replacement-sha1> (<replacement-type>)
CREATING REPLACEMENT OBJECTS
----------------------------
diff --git a/Documentation/git-replay.txt b/Documentation/git-replay.txt
new file mode 100644
index 0000000..f6c269c
--- /dev/null
+++ b/Documentation/git-replay.txt
@@ -0,0 +1,127 @@
+git-replay(1)
+=============
+
+NAME
+----
+git-replay - EXPERIMENTAL: Replay commits on a new base, works with bare repos too
+
+
+SYNOPSIS
+--------
+[verse]
+(EXPERIMENTAL!) 'git replay' ([--contained] --onto <newbase> | --advance <branch>) <revision-range>...
+
+DESCRIPTION
+-----------
+
+Takes ranges of commits and replays them onto a new location. Leaves
+the working tree and the index untouched, and updates no references.
+The output of this command is meant to be used as input to
+`git update-ref --stdin`, which would update the relevant branches
+(see the OUTPUT section below).
+
+THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
+
+OPTIONS
+-------
+
+--onto <newbase>::
+ Starting point at which to create the new commits. May be any
+ valid commit, and not just an existing branch name.
++
+When `--onto` is specified, the update-ref command(s) in the output will
+update the branch(es) in the revision range to point at the new
+commits, similar to the way how `git rebase --update-refs` updates
+multiple branches in the affected range.
+
+--advance <branch>::
+ Starting point at which to create the new commits; must be a
+ branch name.
++
+When `--advance` is specified, the update-ref command(s) in the output
+will update the branch passed as an argument to `--advance` to point at
+the new commits (in other words, this mimics a cherry-pick operation).
+
+<revision-range>::
+ Range of commits to replay. More than one <revision-range> can
+ be passed, but in `--advance <branch>` mode, they should have
+ a single tip, so that it's clear where <branch> should point
+ to. See "Specifying Ranges" in linkgit:git-rev-parse and the
+ "Commit Limiting" options below.
+
+include::rev-list-options.txt[]
+
+OUTPUT
+------
+
+When there are no conflicts, the output of this command is usable as
+input to `git update-ref --stdin`. It is of the form:
+
+ update refs/heads/branch1 ${NEW_branch1_HASH} ${OLD_branch1_HASH}
+ update refs/heads/branch2 ${NEW_branch2_HASH} ${OLD_branch2_HASH}
+ update refs/heads/branch3 ${NEW_branch3_HASH} ${OLD_branch3_HASH}
+
+where the number of refs updated depends on the arguments passed and
+the shape of the history being replayed. When using `--advance`, the
+number of refs updated is always one, but for `--onto`, it can be one
+or more (rebasing multiple branches simultaneously is supported).
+
+EXIT STATUS
+-----------
+
+For a successful, non-conflicted replay, the exit status is 0. When
+the replay has conflicts, the exit status is 1. If the replay is not
+able to complete (or start) due to some kind of error, the exit status
+is something other than 0 or 1.
+
+EXAMPLES
+--------
+
+To simply rebase `mybranch` onto `target`:
+
+------------
+$ git replay --onto target origin/main..mybranch
+update refs/heads/mybranch ${NEW_mybranch_HASH} ${OLD_mybranch_HASH}
+------------
+
+To cherry-pick the commits from mybranch onto target:
+
+------------
+$ git replay --advance target origin/main..mybranch
+update refs/heads/target ${NEW_target_HASH} ${OLD_target_HASH}
+------------
+
+Note that the first two examples replay the exact same commits and on
+top of the exact same new base, they only differ in that the first
+provides instructions to make mybranch point at the new commits and
+the second provides instructions to make target point at them.
+
+What if you have a stack of branches, one depending upon another, and
+you'd really like to rebase the whole set?
+
+------------
+$ git replay --contained --onto origin/main origin/main..tipbranch
+update refs/heads/branch1 ${NEW_branch1_HASH} ${OLD_branch1_HASH}
+update refs/heads/branch2 ${NEW_branch2_HASH} ${OLD_branch2_HASH}
+update refs/heads/tipbranch ${NEW_tipbranch_HASH} ${OLD_tipbranch_HASH}
+------------
+
+When calling `git replay`, one does not need to specify a range of
+commits to replay using the syntax `A..B`; any range expression will
+do:
+
+------------
+$ git replay --onto origin/main ^base branch1 branch2 branch3
+update refs/heads/branch1 ${NEW_branch1_HASH} ${OLD_branch1_HASH}
+update refs/heads/branch2 ${NEW_branch2_HASH} ${OLD_branch2_HASH}
+update refs/heads/branch3 ${NEW_branch3_HASH} ${OLD_branch3_HASH}
+------------
+
+This will simultaneously rebase `branch1`, `branch2`, and `branch3`,
+all commits they have since `base`, playing them on top of
+`origin/main`. These three branches may have commits on top of `base`
+that they have in common, but that does not need to be the case.
+
+GIT
+---
+Part of the linkgit:git[1] suite
diff --git a/Documentation/git-request-pull.txt b/Documentation/git-request-pull.txt
index fa5a426..15dcbb6 100644
--- a/Documentation/git-request-pull.txt
+++ b/Documentation/git-request-pull.txt
@@ -16,7 +16,7 @@ DESCRIPTION
Generate a request asking your upstream project to pull changes into
their tree. The request, printed to the standard output,
begins with the branch description, summarizes
-the changes and indicates from where they can be pulled.
+the changes, and indicates from where they can be pulled.
The upstream project is expected to have the commit named by
`<start>` and the output asks it to integrate the changes you made
@@ -50,7 +50,7 @@ EXAMPLES
--------
Imagine that you built your work on your `master` branch on top of
-the `v1.0` release, and want it to be integrated to the project.
+the `v1.0` release, and want it to be integrated into the project.
First you push that change to your public repository for others to
see:
diff --git a/Documentation/git-rerere.txt b/Documentation/git-rerere.txt
index 4cfc883..992b469 100644
--- a/Documentation/git-rerere.txt
+++ b/Documentation/git-rerere.txt
@@ -8,7 +8,7 @@ git-rerere - Reuse recorded resolution of conflicted merges
SYNOPSIS
--------
[verse]
-'git rerere' ['clear'|'forget' <pathspec>|'diff'|'remaining'|'status'|'gc']
+'git rerere' [clear | forget <pathspec>... | diff | status | remaining | gc]
DESCRIPTION
-----------
diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
index 01cb4c9..79ad564 100644
--- a/Documentation/git-reset.txt
+++ b/Documentation/git-reset.txt
@@ -49,7 +49,8 @@ section of linkgit:git-add[1] to learn how to operate the `--patch` mode.
'git reset' [<mode>] [<commit>]::
This form resets the current branch head to `<commit>` and
possibly updates the index (resetting it to the tree of `<commit>`) and
- the working tree depending on `<mode>`. If `<mode>` is omitted,
+ the working tree depending on `<mode>`. Before the operation, `ORIG_HEAD`
+ is set to the tip of the current branch. If `<mode>` is omitted,
defaults to `--mixed`. The `<mode>` must be one of the following:
+
--
diff --git a/Documentation/git-restore.txt b/Documentation/git-restore.txt
index 5964810..975825b 100644
--- a/Documentation/git-restore.txt
+++ b/Documentation/git-restore.txt
@@ -78,6 +78,8 @@ all modified paths.
--theirs::
When restoring files in the working tree from the index, use
stage #2 ('ours') or #3 ('theirs') for unmerged paths.
+ This option cannot be used when checking out paths from a
+ tree-ish (i.e. with the `--source` option).
+
Note that during `git rebase` and `git pull --rebase`, 'ours' and
'theirs' may appear swapped. See the explanation of the same options
@@ -87,6 +89,8 @@ in linkgit:git-checkout[1] for details.
--merge::
When restoring files on the working tree from the index,
recreate the conflicted merge in the unmerged paths.
+ This option cannot be used when checking out paths from a
+ tree-ish (i.e. with the `--source` option).
--conflict=<style>::
The same as `--merge` option above, but changes the way the
@@ -101,7 +105,7 @@ in linkgit:git-checkout[1] for details.
specified. Unmerged paths on the working tree are left alone.
--ignore-skip-worktree-bits::
- In sparse checkout mode, by default is to only update entries
+ In sparse checkout mode, the default is to only update entries
matched by `<pathspec>` and sparse patterns in
$GIT_DIR/info/sparse-checkout. This option ignores the sparse
patterns and unconditionally restores any files in
@@ -195,7 +199,7 @@ the same as using linkgit:git-reset[1])
$ git restore --staged hello.c
------------
-or you can restore both the index and the working tree (this the same
+or you can restore both the index and the working tree (this is the same
as using linkgit:git-checkout[1])
------------
diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt
index 20bb8e8..2e05c4b 100644
--- a/Documentation/git-rev-list.txt
+++ b/Documentation/git-rev-list.txt
@@ -9,7 +9,7 @@ git-rev-list - Lists commit objects in reverse chronological order
SYNOPSIS
--------
[verse]
-'git rev-list' [<options>] <commit>... [[--] <path>...]
+'git rev-list' [<options>] <commit>... [--] [<path>...]
DESCRIPTION
-----------
@@ -17,9 +17,9 @@ DESCRIPTION
:git-rev-list: 1
include::rev-list-description.txt[]
-'rev-list' is a very essential Git command, since it
+'rev-list' is an essential Git command, since it
provides the ability to build and traverse commit ancestry graphs. For
-this reason, it has a lot of different options that enables it to be
+this reason, it has a lot of different options that enable it to be
used by commands as different as 'git bisect' and
'git repack'.
diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt
index 6b8ca08..f9d5a35 100644
--- a/Documentation/git-rev-parse.txt
+++ b/Documentation/git-rev-parse.txt
@@ -9,12 +9,12 @@ git-rev-parse - Pick out and massage parameters
SYNOPSIS
--------
[verse]
-'git rev-parse' [<options>] <args>...
+'git rev-parse' [<options>] <arg>...
DESCRIPTION
-----------
-Many Git porcelainish commands take mixture of flags
+Many Git porcelainish commands take a mixture of flags
(i.e. parameters that begin with a dash '-') and parameters
meant for the underlying 'git rev-list' command they use internally
and flags and parameters for the other commands they use
@@ -36,7 +36,7 @@ Each of these options must appear first on the command line.
--sq-quote::
Use 'git rev-parse' in shell quoting mode (see SQ-QUOTE
section below). In contrast to the `--sq` option below, this
- mode does only quoting. Nothing else is done to command input.
+ mode only does quoting. Nothing else is done to command input.
Options for --parseopt
~~~~~~~~~~~~~~~~~~~~~~
@@ -130,7 +130,7 @@ for another option.
'git diff-{asterisk}'). In contrast to the `--sq-quote` option,
the command input is still interpreted as usual.
---short[=length]::
+--short[=<length>]::
Same as `--verify` but shortens the object name to a unique
prefix with at least `length` characters. The minimum length
is 4, the default is the effective value of the `core.abbrev`
@@ -156,18 +156,30 @@ for another option.
are not refs (i.e. branch or tag names; or more
explicitly disambiguating "heads/master" form, when you
want to name the "master" branch when there is an
- unfortunately named tag "master"), and show them as full
+ unfortunately named tag "master"), and shows them as full
refnames (e.g. "refs/heads/master").
+--output-object-format=(sha1|sha256|storage)::
+
+ Allow oids to be input from any object format that the current
+ repository supports.
+
+ Specifying "sha1" translates if necessary and returns a sha1 oid.
+
+ Specifying "sha256" translates if necessary and returns a sha256 oid.
+
+ Specifying "storage" translates if necessary and returns an oid in
+ encoded in the storage hash algorithm.
+
Options for Objects
~~~~~~~~~~~~~~~~~~~
--all::
Show all refs found in `refs/`.
---branches[=pattern]::
---tags[=pattern]::
---remotes[=pattern]::
+--branches[=<pattern>]::
+--tags[=<pattern>]::
+--remotes[=<pattern>]::
Show all branches, tags, or remote-tracking branches,
respectively (i.e., refs found in `refs/heads`,
`refs/tags`, or `refs/remotes`, respectively).
@@ -176,7 +188,7 @@ If a `pattern` is given, only refs matching the given shell glob are
shown. If the pattern does not contain a globbing character (`?`,
`*`, or `[`), it is turned into a prefix match by appending `/*`.
---glob=pattern::
+--glob=<pattern>::
Show all refs matching the shell glob pattern `pattern`. If
the pattern does not start with `refs/`, this is automatically
prepended. If the pattern does not contain a globbing
@@ -197,6 +209,14 @@ respectively, and they must begin with `refs/` when applied to `--glob`
or `--all`. If a trailing '/{asterisk}' is intended, it must be given
explicitly.
+--exclude-hidden=(fetch|receive|uploadpack)::
+ Do not include refs that would be hidden by `git-fetch`,
+ `git-receive-pack` or `git-upload-pack` by consulting the appropriate
+ `fetch.hideRefs`, `receive.hideRefs` or `uploadpack.hideRefs`
+ configuration along with `transfer.hideRefs` (see
+ linkgit:git-config[1]). This option affects the next pseudo-ref option
+ `--all` or `--glob` and is cleared after processing them.
+
--disambiguate=<prefix>::
Show every object whose name begins with the given prefix.
The <prefix> must be at least 4 hexadecimal digits long to
@@ -299,21 +319,24 @@ The following options are unaffected by `--path-format`:
input, multiple algorithms may be printed, space-separated.
If not specified, the default is "storage".
+--show-ref-format::
+ Show the reference storage format used for the repository.
+
Other Options
~~~~~~~~~~~~~
---since=datestring::
---after=datestring::
+--since=<datestring>::
+--after=<datestring>::
Parse the date string, and output the corresponding
--max-age= parameter for 'git rev-list'.
---until=datestring::
---before=datestring::
+--until=<datestring>::
+--before=<datestring>::
Parse the date string, and output the corresponding
--min-age= parameter for 'git rev-list'.
-<args>...::
+<arg>...::
Flags and parameters to be parsed.
@@ -375,7 +398,7 @@ Each line of options has this format:
dash to separate words in a multi-word argument hint.
The remainder of the line, after stripping the spaces, is used
-as the help associated to the option.
+as the help associated with the option.
Blank lines are ignored, and lines that don't match this specification are used
as option group headers (start the line with a space to create such
@@ -390,7 +413,7 @@ some-command [<options>] <args>...
some-command does foo and bar!
--
-h,help show the help
+h,help! show the help
foo some nifty option --foo
bar= some cool option --bar with an argument
@@ -416,10 +439,10 @@ usage: some-command [<options>] <args>...
some-command does foo and bar!
-h, --help show the help
- --foo some nifty option --foo
- --bar ... some cool option --bar with an argument
- --baz <arg> another cool option --baz with a named argument
- --qux[=<path>] qux may take a path argument but has meaning by itself
+ --[no-]foo some nifty option --foo
+ --[no-]bar ... some cool option --bar with an argument
+ --[no-]baz <arg> another cool option --baz with a named argument
+ --[no-]qux[=<path>] qux may take a path argument but has meaning by itself
An option group Header
-C[...] option C with an optional argument
diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt
index 8463fe9..568925d 100644
--- a/Documentation/git-revert.txt
+++ b/Documentation/git-revert.txt
@@ -8,7 +8,7 @@ git-revert - Revert some existing commits
SYNOPSIS
--------
[verse]
-'git revert' [--[no-]edit] [-n] [-m parent-number] [-s] [-S[<keyid>]] <commit>...
+'git revert' [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] <commit>...
'git revert' (--continue | --skip | --abort | --quit)
DESCRIPTION
@@ -112,14 +112,11 @@ effect to your index in a row.
Pass the merge strategy-specific option through to the
merge strategy. See linkgit:git-merge[1] for details.
---rerere-autoupdate::
---no-rerere-autoupdate::
- Allow the rerere mechanism to update the index with the
- result of auto-conflict resolution if possible.
+include::rerere-options.txt[]
--reference::
Instead of starting the body of the log message with "This
- reverts <full object name of the commit being reverted>.",
+ reverts <full-object-name-of-the-commit-being-reverted>.",
refer to the commit using "--pretty=reference" format
(cf. linkgit:git-log[1]). The `revert.reference`
configuration variable can be used to enable this option by
@@ -145,6 +142,23 @@ EXAMPLES
changes. The revert only modifies the working tree and the
index.
+DISCUSSION
+----------
+
+While git creates a basic commit message automatically, it is
+_strongly_ recommended to explain why the original commit is being
+reverted.
+In addition, repeatedly reverting reverts will result in increasingly
+unwieldy subject lines, for example 'Reapply "Reapply "<original-subject>""'.
+Please consider rewording these to be shorter and more unique.
+
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/revert.txt[]
+
SEE ALSO
--------
linkgit:git-cherry-pick[1]
diff --git a/Documentation/git-rm.txt b/Documentation/git-rm.txt
index 81bc23f..363a269 100644
--- a/Documentation/git-rm.txt
+++ b/Documentation/git-rm.txt
@@ -163,7 +163,7 @@ will be staged (unless --cached or -n are used).
A submodule is considered up to date when the HEAD is the same as
recorded in the index, no tracked files are modified and no untracked
-files that aren't ignored are present in the submodules work tree.
+files that aren't ignored are present in the submodule's work tree.
Ignored files are deemed expendable and won't stop a submodule's work
tree from being removed.
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 41cd8cb..c5d664f 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -9,8 +9,8 @@ git-send-email - Send a collection of patches as emails
SYNOPSIS
--------
[verse]
-'git send-email' [<options>] <file|directory>...
-'git send-email' [<options>] <format-patch options>
+'git send-email' [<options>] (<file>|<directory>)...
+'git send-email' [<options>] <format-patch-options>
'git send-email' --dump-aliases
@@ -68,11 +68,12 @@ This option may be specified multiple times.
Invoke a text editor (see GIT_EDITOR in linkgit:git-var[1])
to edit an introductory message for the patch series.
+
-When `--compose` is used, git send-email will use the From, Subject, and
-In-Reply-To headers specified in the message. If the body of the message
-(what you type after the headers and a blank line) only contains blank
-(or Git: prefixed) lines, the summary won't be sent, but From, Subject,
-and In-Reply-To headers will be used unless they are removed.
+When `--compose` is used, git send-email will use the From, To, Cc, Bcc,
+Subject, Reply-To, and In-Reply-To headers specified in the message. If
+the body of the message (what you type after the headers and a blank
+line) only contains blank (or Git: prefixed) lines, the summary won't be
+sent, but the headers mentioned above will be used unless they are
+removed.
+
Missing From or In-Reply-To headers will be prompted for.
+
@@ -93,7 +94,7 @@ See the CONFIGURATION section for `sendemail.multiEdit`.
--in-reply-to=<identifier>::
Make the first mail (or all the mails with `--no-thread`) appear as a
- reply to the given Message-Id, which avoids breaking threads to
+ reply to the given Message-ID, which avoids breaking threads to
provide a new patch series.
The second and subsequent emails will be sent as replies according to
the `--[no-]chain-reply-to` setting.
@@ -137,7 +138,7 @@ Note that no attempts whatsoever are made to validate the encoding.
--compose-encoding=<encoding>::
Specify encoding of compose message. Default is the value of the
- 'sendemail.composeencoding'; if that is unspecified, UTF-8 is assumed.
+ 'sendemail.composeEncoding'; if that is unspecified, UTF-8 is assumed.
--transfer-encoding=(7bit|8bit|quoted-printable|base64|auto)::
Specify the transfer encoding to be used to send the message over SMTP.
@@ -173,14 +174,23 @@ Sending
Specify a command to run to send the email. The command should
be sendmail-like; specifically, it must support the `-i` option.
The command will be executed in the shell if necessary. Default
- is the value of `sendemail.sendmailcmd`. If unspecified, and if
+ is the value of `sendemail.sendmailCmd`. If unspecified, and if
--smtp-server is also unspecified, git-send-email will search
for `sendmail` in `/usr/sbin`, `/usr/lib` and $PATH.
--smtp-encryption=<encryption>::
- Specify the encryption to use, either 'ssl' or 'tls'. Any other
- value reverts to plain SMTP. Default is the value of
- `sendemail.smtpEncryption`.
+ Specify in what way encrypting begins for the SMTP connection.
+ Valid values are 'ssl' and 'tls'. Any other value reverts to plain
+ (unencrypted) SMTP, which defaults to port 25.
+ Despite the names, both values will use the same newer version of TLS,
+ but for historic reasons have these names. 'ssl' refers to "implicit"
+ encryption (sometimes called SMTPS), that uses port 465 by default.
+ 'tls' refers to "explicit" encryption (often known as STARTTLS),
+ that uses port 25 by default. Other ports might be used by the SMTP
+ server, which are not the default. Commonly found alternative port for
+ 'tls' and unencrypted is 587. You need to check your provider's
+ documentation or your server configuration to make sure
+ for your own case. Default is the value of `sendemail.smtpEncryption`.
--smtp-domain=<FQDN>::
Specifies the Fully Qualified Domain Name (FQDN) used in the
@@ -259,7 +269,7 @@ must be used for each option.
certificates concatenated together: see verify(1) -CAfile and
-CApath for more information on these). Set it to an empty string
to disable certificate verification. Defaults to the value of the
- `sendemail.smtpsslcertpath` configuration variable, if set, or the
+ `sendemail.smtpSSLCertPath` configuration variable, if set, or the
backing SSL library's compiled-in default otherwise (which should
be the best choice on most platforms).
@@ -268,7 +278,7 @@ must be used for each option.
if a username is not specified (with `--smtp-user` or `sendemail.smtpUser`),
then authentication is not attempted.
---smtp-debug=0|1::
+--smtp-debug=(0|1)::
Enable (1) or disable (0) debug output. If enabled, SMTP
commands and replies will be printed. Useful to debug TLS
connection and authentication problems.
@@ -291,7 +301,9 @@ must be used for each option.
Automating
~~~~~~~~~~
---no-[to|cc|bcc]::
+--no-to::
+--no-cc::
+--no-bcc::
Clears any list of "To:", "Cc:", "Bcc:" addresses previously
set via config.
@@ -303,7 +315,7 @@ Automating
Specify a command to execute once per patch file which
should generate patch file specific "To:" entries.
Output of this command must be single email address per line.
- Default is the value of 'sendemail.tocmd' configuration value.
+ Default is the value of 'sendemail.toCmd' configuration value.
--cc-cmd=<command>::
Specify a command to execute once per patch file which
@@ -311,6 +323,17 @@ Automating
Output of this command must be single email address per line.
Default is the value of `sendemail.ccCmd` configuration value.
+--header-cmd=<command>::
+ Specify a command that is executed once per outgoing message
+ and output RFC 2822 style header lines to be inserted into
+ them. When the `sendemail.headerCmd` configuration variable is
+ set, its value is always used. When --header-cmd is provided
+ at the command line, its value takes precedence over the
+ `sendemail.headerCmd` configuration variable.
+
+--no-header-cmd::
+ Disable any header command in use.
+
--[no-]chain-reply-to::
If this is set, each email will be sent as a reply to the previous
email sent. If disabled with "--no-chain-reply-to", all emails after
@@ -327,19 +350,19 @@ Automating
--[no-]signed-off-by-cc::
If this is set, add emails found in the `Signed-off-by` trailer or Cc: lines to the
- cc list. Default is the value of `sendemail.signedoffbycc` configuration
+ cc list. Default is the value of `sendemail.signedOffByCc` configuration
value; if that is unspecified, default to --signed-off-by-cc.
--[no-]cc-cover::
If this is set, emails found in Cc: headers in the first patch of
the series (typically the cover letter) are added to the cc list
- for each email set. Default is the value of 'sendemail.cccover'
+ for each email set. Default is the value of 'sendemail.ccCover'
configuration value; if that is unspecified, default to --no-cc-cover.
--[no-]to-cover::
If this is set, emails found in To: headers in the first patch of
the series (typically the cover letter) are added to the to list
- for each email set. Default is the value of 'sendemail.tocover'
+ for each email set. Default is the value of 'sendemail.toCover'
configuration value; if that is unspecified, default to --no-to-cover.
--suppress-cc=<category>::
@@ -363,7 +386,7 @@ Automating
- 'all' will suppress all auto cc values.
--
+
-Default is the value of `sendemail.suppresscc` configuration value; if
+Default is the value of `sendemail.suppressCc` configuration value; if
that is unspecified, default to 'self' if --suppress-from is
specified, as well as 'body' if --no-signed-off-cc is specified.
@@ -433,7 +456,7 @@ have been specified, in which case default to 'compose'.
998 characters unless a suitable transfer encoding
('auto', 'base64', or 'quoted-printable') is used;
this is due to SMTP limits as described by
- http://www.ietf.org/rfc/rfc5322.txt.
+ https://www.ietf.org/rfc/rfc5322.txt.
--
+
Default is the value of `sendemail.validate`; if this is not set,
@@ -448,49 +471,17 @@ Information
--dump-aliases::
Instead of the normal operation, dump the shorthand alias names from
- the configured alias file(s), one per line in alphabetical order. Note,
- this only includes the alias name and not its expanded email addresses.
- See 'sendemail.aliasesfile' for more information about aliases.
+ the configured alias file(s), one per line in alphabetical order. Note
+ that this only includes the alias name and not its expanded email addresses.
+ See 'sendemail.aliasesFile' for more information about aliases.
CONFIGURATION
-------------
-sendemail.aliasesFile::
- To avoid typing long email addresses, point this to one or more
- email aliases files. You must also supply `sendemail.aliasFileType`.
+include::includes/cmd-config-section-all.txt[]
-sendemail.aliasFileType::
- Format of the file(s) specified in sendemail.aliasesFile. Must be
- one of 'mutt', 'mailrc', 'pine', 'elm', or 'gnus', or 'sendmail'.
-+
-What an alias file in each format looks like can be found in
-the documentation of the email program of the same name. The
-differences and limitations from the standard formats are
-described below:
-+
---
-sendmail;;
-* Quoted aliases and quoted addresses are not supported: lines that
- contain a `"` symbol are ignored.
-* Redirection to a file (`/path/name`) or pipe (`|command`) is not
- supported.
-* File inclusion (`:include: /path/name`) is not supported.
-* Warnings are printed on the standard error output for any
- explicitly unsupported constructs, and any other lines that are not
- recognized by the parser.
---
-
-sendemail.multiEdit::
- If true (default), a single editor instance will be spawned to edit
- files you have to edit (patches when `--annotate` is used, and the
- summary when `--compose` is used). If false, files will be edited one
- after the other, spawning a new editor each time.
-
-sendemail.confirm::
- Sets the default for whether to confirm before sending. Must be
- one of 'always', 'never', 'cc', 'compose', or 'auto'. See `--confirm`
- in the previous section for the meaning of these values.
+include::config/sendemail.txt[]
EXAMPLES
--------
@@ -507,14 +498,10 @@ edit ~/.gitconfig to specify your account settings:
smtpServerPort = 587
----
-If you have multi-factor authentication set up on your Gmail account, you will
-need to generate an app-specific password for use with 'git send-email'. Visit
+If you have multi-factor authentication set up on your Gmail account, you can
+generate an app-specific password for use with 'git send-email'. Visit
https://security.google.com/settings/security/apppasswords to create it.
-If you do not have multi-factor authentication set up on your Gmail account,
-you will need to allow less secure app access. Visit
-https://myaccount.google.com/lesssecureapps to enable it.
-
Once your commits are ready to be sent to the mailing list, run the
following commands:
diff --git a/Documentation/git-send-pack.txt b/Documentation/git-send-pack.txt
index be41f11..b9e73f2 100644
--- a/Documentation/git-send-pack.txt
+++ b/Documentation/git-send-pack.txt
@@ -9,9 +9,10 @@ git-send-pack - Push objects over Git protocol to another repository
SYNOPSIS
--------
[verse]
-'git send-pack' [--dry-run] [--force] [--receive-pack=<git-receive-pack>]
+'git send-pack' [--mirror] [--dry-run] [--force]
+ [--receive-pack=<git-receive-pack>]
[--verbose] [--thin] [--atomic]
- [--[no-]signed|--signed=(true|false|if-asked)]
+ [--[no-]signed | --signed=(true|false|if-asked)]
[<host>:]<directory> (--all | <ref>...)
DESCRIPTION
@@ -54,7 +55,7 @@ be in a separate packet, and the list must end with a flush packet.
--force::
Usually, the command refuses to update a remote ref that
is not an ancestor of the local ref used to overwrite it.
- This flag disables the check. What this means is that
+ This flag disables the check. This means that
the remote repository can lose commits; use it with
care.
@@ -105,7 +106,7 @@ SPECIFYING THE REFS
There are three ways to specify which refs to update on the
remote end.
-With `--all` flag, all refs that exist locally are transferred to
+With the `--all` flag, all refs that exist locally are transferred to
the remote side. You cannot specify any '<ref>' if you use
this flag.
@@ -114,9 +115,9 @@ both on the local side and on the remote side are updated.
When one or more '<ref>' are specified explicitly (whether on the
command line or via `--stdin`), it can be either a
-single pattern, or a pair of such pattern separated by a colon
+single pattern, or a pair of such patterns separated by a colon
":" (this means that a ref name cannot have a colon in it). A
-single pattern '<name>' is just a shorthand for '<name>:<name>'.
+single pattern '<name>' is just shorthand for '<name>:<name>'.
Each pattern pair consists of the source side (before the colon)
and the destination side (after the colon). The ref to be
@@ -129,7 +130,7 @@ name. See linkgit:git-rev-parse[1].
- It is an error if <src> does not match exactly one of the
local refs.
- - It is an error if <dst> matches more than one remote refs.
+ - It is an error if <dst> matches more than one remote ref.
- If <dst> does not match any remote ref, either
@@ -142,9 +143,9 @@ name. See linkgit:git-rev-parse[1].
Without `--force`, the <src> ref is stored at the remote only if
<dst> does not exist, or <dst> is a proper subset (i.e. an
-ancestor) of <src>. This check, known as "fast-forward check",
-is performed in order to avoid accidentally overwriting the
-remote ref and lose other peoples' commits from there.
+ancestor) of <src>. This check, known as the "fast-forward check",
+is performed to avoid accidentally overwriting the
+remote ref and losing other people's commits from there.
With `--force`, the fast-forward check is disabled for all refs.
diff --git a/Documentation/git-sh-setup.txt b/Documentation/git-sh-setup.txt
index 8632612..bdaf6e5 100644
--- a/Documentation/git-sh-setup.txt
+++ b/Documentation/git-sh-setup.txt
@@ -22,7 +22,7 @@ The 'git sh-setup' scriptlet is designed to be sourced (using
the normal Git directories and a few helper shell functions.
Before sourcing it, your script should set up a few variables;
-`USAGE` (and `LONG_USAGE`, if any) is used to define message
+`USAGE` (and `LONG_USAGE`, if any) is used to define the message
given by `usage()` shell function. `SUBDIRECTORY_OK` can be set
if the script can run from a subdirectory of the working tree
(some commands do not).
diff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt
index f64e770..7d0277d 100644
--- a/Documentation/git-shortlog.txt
+++ b/Documentation/git-shortlog.txt
@@ -47,6 +47,11 @@ OPTIONS
Each pretty-printed commit will be rewrapped before it is shown.
+--date=<format>::
+ Show dates formatted according to the given date string. (See
+ the `--date` option in the "Commit Formatting" section of
+ linkgit:git-log[1]). Useful with `--group=format:<format>`.
+
--group=<type>::
Group commits based on `<type>`. If no `--group` option is
specified, the default is `author`. `<type>` is one of:
@@ -59,6 +64,9 @@ OPTIONS
example, if your project uses `Reviewed-by` trailers, you might want
to see who has been reviewing with
`git shortlog -ns --group=trailer:reviewed-by`.
+ - `format:<format>`, any string accepted by the `--format` option of
+ 'git log'. (See the "PRETTY FORMATS" section of
+ linkgit:git-log[1].)
+
Note that commits that do not include the trailer will not be counted.
Likewise, commits with multiple trailers (e.g., multiple signoffs) may
diff --git a/Documentation/git-show-branch.txt b/Documentation/git-show-branch.txt
index 5cc2fce..c771c89 100644
--- a/Documentation/git-show-branch.txt
+++ b/Documentation/git-show-branch.txt
@@ -8,12 +8,12 @@ git-show-branch - Show branches and their commits
SYNOPSIS
--------
[verse]
-'git show-branch' [-a|--all] [-r|--remotes] [--topo-order | --date-order]
+'git show-branch' [-a | --all] [-r | --remotes] [--topo-order | --date-order]
[--current] [--color[=<when>] | --no-color] [--sparse]
[--more=<n> | --list | --independent | --merge-base]
[--no-name | --sha1-name] [--topics]
[(<rev> | <glob>)...]
-'git show-branch' (-g|--reflog)[=<n>[,<base>]] [--list] [<ref>]
+'git show-branch' (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]
DESCRIPTION
-----------
@@ -50,7 +50,7 @@ OPTIONS
--current::
With this option, the command includes the current
- branch to the list of revs to be shown when it is not
+ branch in the list of revs to be shown when it is not
given on the command line.
--topo-order::
@@ -74,8 +74,7 @@ OPTIONS
that is the common ancestor of all the branches. This
flag tells the command to go <n> more common commits
beyond that. When <n> is negative, display only the
- <reference>s given, without showing the commit ancestry
- tree.
+ <ref>s given, without showing the commit ancestry tree.
--list::
Synonym to `--more=-1`
@@ -88,8 +87,8 @@ OPTIONS
the case of three or more commits.
--independent::
- Among the <reference>s given, display only the ones that
- cannot be reached from any other <reference>.
+ Among the <ref>s given, display only the ones that cannot be
+ reached from any other <ref>.
--no-name::
Do not show naming strings for each commit.
@@ -126,25 +125,26 @@ OPTIONS
default to color output.
Same as `--color=never`.
-Note that --more, --list, --independent and --merge-base options
+Note that --more, --list, --independent, and --merge-base options
are mutually exclusive.
OUTPUT
------
-Given N <references>, the first N lines are the one-line
-description from their commit message. The branch head that is
-pointed at by $GIT_DIR/HEAD is prefixed with an asterisk `*`
-character while other heads are prefixed with a `!` character.
-Following these N lines, one-line log for each commit is
+Given N <ref>s, the first N lines are the one-line description from
+their commit message. The branch head that is pointed at by
+$GIT_DIR/HEAD is prefixed with an asterisk `*` character while other
+heads are prefixed with a `!` character.
+
+Following these N lines, a one-line log for each commit is
displayed, indented N places. If a commit is on the I-th
branch, the I-th indentation character shows a `+` sign;
otherwise it shows a space. Merge commits are denoted by
a `-` sign. Each commit shows a short name that
can be used as an extended SHA-1 to name that commit.
-The following example shows three branches, "master", "fixes"
+The following example shows three branches, "master", "fixes",
and "mhf":
------------------------------------------------
@@ -154,7 +154,7 @@ $ git show-branch master fixes mhf
! [mhf] Allow "+remote:local" refspec to cause --force when fetching.
---
+ [mhf] Allow "+remote:local" refspec to cause --force when fetching.
- + [mhf~1] Use git-octopus when pulling more than one heads.
+ + [mhf~1] Use git-octopus when pulling more than one head.
+ [fixes] Introduce "reset type" flag to "git reset"
+ [mhf~2] "git fetch --force".
+ [mhf~3] Use .git/remote/origin, not .git/branches/origin.
@@ -197,7 +197,14 @@ $ git show-branch --reflog="10,1 hour ago" --list master
shows 10 reflog entries going back from the tip as of 1 hour ago.
Without `--list`, the output also shows how these tips are
-topologically related with each other.
+topologically related to each other.
+
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/showbranch.txt[]
GIT
---
diff --git a/Documentation/git-show-ref.txt b/Documentation/git-show-ref.txt
index ab4d271..ba75747 100644
--- a/Documentation/git-show-ref.txt
+++ b/Documentation/git-show-ref.txt
@@ -8,10 +8,14 @@ git-show-ref - List references in a local repository
SYNOPSIS
--------
[verse]
-'git show-ref' [-q|--quiet] [--verify] [--head] [-d|--dereference]
- [-s|--hash[=<n>]] [--abbrev[=<n>]] [--tags]
+'git show-ref' [--head] [-d | --dereference]
+ [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]
[--heads] [--] [<pattern>...]
+'git show-ref' --verify [-q | --quiet] [-d | --dereference]
+ [-s | --hash[=<n>]] [--abbrev[=<n>]]
+ [--] [<ref>...]
'git show-ref' --exclude-existing[=<pattern>]
+'git show-ref' --exists <ref>
DESCRIPTION
-----------
@@ -23,10 +27,14 @@ particular ref exists.
By default, shows the tags, heads, and remote refs.
-The --exclude-existing form is a filter that does the inverse. It reads
+The `--exclude-existing` form is a filter that does the inverse. It reads
refs from stdin, one ref per line, and shows those that don't exist in
the local repository.
+The `--exists` form can be used to check for the existence of a single
+references. This form does not verify whether the reference resolves to an
+actual object.
+
Use of this utility is encouraged in favor of directly accessing files under
the `.git` directory.
@@ -47,14 +55,14 @@ OPTIONS
-d::
--dereference::
- Dereference tags into object IDs as well. They will be shown with "{caret}{}"
+ Dereference tags into object IDs as well. They will be shown with `^{}`
appended.
-s::
--hash[=<n>]::
- Only show the SHA-1 hash, not the reference name. When combined with
- --dereference the dereferenced tag will still be shown after the SHA-1.
+ Only show the OID, not the reference name. When combined with
+ `--dereference`, the dereferenced tag will still be shown after the OID.
--verify::
@@ -62,6 +70,12 @@ OPTIONS
Aside from returning an error code of 1, it will also print an error
message if `--quiet` was not specified.
+--exists::
+
+ Check whether the given reference exists. Returns an exit code of 0 if
+ it does, 2 if it is missing, and 1 in case looking up the reference
+ failed with an error other than the reference being missing.
+
--abbrev[=<n>]::
Abbreviate the object name. When using `--hash`, you do
@@ -70,15 +84,15 @@ OPTIONS
-q::
--quiet::
- Do not print any results to stdout. When combined with `--verify` this
- can be used to silently check if a reference exists.
+ Do not print any results to stdout. Can be used with `--verify` to
+ silently check if a reference exists.
--exclude-existing[=<pattern>]::
- Make 'git show-ref' act as a filter that reads refs from stdin of the
- form "`^(?:<anything>\s)?<refname>(?:\^{})?$`"
+ Make `git show-ref` act as a filter that reads refs from stdin of the
+ form `^(?:<anything>\s)?<refname>(?:\^{})?$`
and performs the following actions on each:
- (1) strip "{caret}{}" at the end of line if any;
+ (1) strip `^{}` at the end of line if any;
(2) ignore if pattern is provided and does not head-match refname;
(3) warn if refname is not a well-formed refname and skip;
(4) ignore if refname is a ref that exists in the local repository;
@@ -96,7 +110,13 @@ OPTIONS
OUTPUT
------
-The output is in the format: '<SHA-1 ID>' '<space>' '<reference name>'.
+The output is in the format:
+
+------------
+<oid> SP <ref> LF
+------------
+
+For example,
-----------------------------------------------------------------------------
$ git show-ref --head --dereference
@@ -110,7 +130,13 @@ $ git show-ref --head --dereference
...
-----------------------------------------------------------------------------
-When using --hash (and not --dereference) the output format is: '<SHA-1 ID>'
+When using `--hash` (and not `--dereference`), the output is in the format:
+
+------------
+<oid> LF
+------------
+
+For example,
-----------------------------------------------------------------------------
$ git show-ref --heads --hash
@@ -132,7 +158,7 @@ use:
-----------------------------------------------------------------------------
This will show "refs/heads/master" but also "refs/remote/other-repo/master",
-if such references exists.
+if such references exist.
When using the `--verify` flag, the command requires an exact path:
@@ -142,10 +168,10 @@ When using the `--verify` flag, the command requires an exact path:
will only match the exact branch called "master".
-If nothing matches, 'git show-ref' will return an error code of 1,
+If nothing matches, `git show-ref` will return an error code of 1,
and in the case of verification, it will show an error message.
-For scripting, you can ask it to be quiet with the "--quiet" flag, which
+For scripting, you can ask it to be quiet with the `--quiet` flag, which
allows you to do things like
-----------------------------------------------------------------------------
@@ -157,11 +183,11 @@ to check whether a particular branch exists or not (notice how we don't
actually want to show any results, and we want to use the full refname for it
in order to not trigger the problem with ambiguous partial matches).
-To show only tags, or only proper branch heads, use "--tags" and/or "--heads"
+To show only tags, or only proper branch heads, use `--tags` and/or `--heads`
respectively (using both means that it shows tags and heads, but not other
random references under the refs/ subdirectory).
-To do automatic tag object dereferencing, use the "-d" or "--dereference"
+To do automatic tag object dereferencing, use the `-d` or `--dereference`
flag, so you can do
-----------------------------------------------------------------------------
diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt
index 2b1bc72..5eb6743 100644
--- a/Documentation/git-show.txt
+++ b/Documentation/git-show.txt
@@ -26,7 +26,7 @@ with --name-only).
For plain blobs, it shows the plain contents.
-The command takes options applicable to the 'git diff-tree' command to
+Some options that 'git log' command understands can be used to
control how the changes the commit introduces are shown.
This manual page describes only the most frequently used options.
@@ -61,7 +61,7 @@ EXAMPLES
--------
`git show v1.0.0`::
- Shows the tag `v1.0.0`, along with the object the tags
+ Shows the tag `v1.0.0`, along with the object the tag
points at.
`git show v1.0.0^{tree}`::
diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt
index 3776705..529a8ed 100644
--- a/Documentation/git-sparse-checkout.txt
+++ b/Documentation/git-sparse-checkout.txt
@@ -9,7 +9,7 @@ git-sparse-checkout - Reduce your working tree to a subset of tracked files
SYNOPSIS
--------
[verse]
-'git sparse-checkout <subcommand> [<options>]'
+'git sparse-checkout' (init | list | set | add | reapply | disable | check-rules) [<options>]
DESCRIPTION
@@ -135,6 +135,29 @@ paths to pass to a subsequent 'set' or 'add' command. However,
the disable command, so the easy restore of calling a plain `init`
decreased in utility.
+'check-rules'::
+ Check whether sparsity rules match one or more paths.
++
+By default `check-rules` reads a list of paths from stdin and outputs only
+the ones that match the current sparsity rules. The input is expected to consist
+of one path per line, matching the output of `git ls-tree --name-only` including
+that pathnames that begin with a double quote (") are interpreted as C-style
+quoted strings.
++
+When called with the `--rules-file <file>` flag the input files are matched
+against the sparse checkout rules found in `<file>` instead of the current ones.
+The rules in the files are expected to be in the same form as accepted by `git
+sparse-checkout set --stdin` (in particular, they must be newline-delimited).
++
+By default, the rules passed to the `--rules-file` option are interpreted as
+cone mode directories. To pass non-cone mode patterns with `--rules-file`,
+combine the option with the `--no-cone` option.
++
+When called with the `-z` flag, the format of the paths input on stdin as well
+as the output paths are \0 terminated and not quoted. Note that this does not
+apply to the format of the rules passed with the `--rules-file` option.
+
+
EXAMPLES
--------
`git sparse-checkout set MY/DIR1 SUB/DIR2`::
@@ -263,7 +286,7 @@ patterns in non-cone mode has a number of shortcomings:
problem above? Also, if it suggests paths, what if the user has a
file or directory that begins with either a '!' or '#' or has a '*',
'\', '?', '[', or ']' in its name? And if it suggests paths, will
- it complete "/pro" to "/proc" (in the root filesytem) rather than to
+ it complete "/pro" to "/proc" (in the root filesystem) rather than to
"/progress.txt" in the current directory? (Note that users are
likely to want to start paths with a leading '/' in non-cone mode,
for the same reason that .gitignore files often have one.)
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 6e15f47..06fb7f1 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -9,17 +9,20 @@ SYNOPSIS
--------
[verse]
'git stash' list [<log-options>]
-'git stash' show [-u|--include-untracked|--only-untracked] [<diff-options>] [<stash>]
-'git stash' drop [-q|--quiet] [<stash>]
-'git stash' ( pop | apply ) [--index] [-q|--quiet] [<stash>]
+'git stash' show [-u | --include-untracked | --only-untracked] [<diff-options>] [<stash>]
+'git stash' drop [-q | --quiet] [<stash>]
+'git stash' pop [--index] [-q | --quiet] [<stash>]
+'git stash' apply [--index] [-q | --quiet] [<stash>]
'git stash' branch <branchname> [<stash>]
-'git stash' [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--quiet]
- [-u|--include-untracked] [-a|--all] [-m|--message <message>]
+'git stash' [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]
+ [-u | --include-untracked] [-a | --all] [(-m | --message) <message>]
[--pathspec-from-file=<file> [--pathspec-file-nul]]
[--] [<pathspec>...]]
+'git stash' save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]
+ [-u | --include-untracked] [-a | --all] [<message>]
'git stash' clear
'git stash' create [<message>]
-'git stash' store [-m|--message <message>] [-q|--quiet] <commit>
+'git stash' store [(-m | --message) <message>] [-q | --quiet] <commit>
DESCRIPTION
-----------
@@ -47,7 +50,7 @@ stash index (e.g. the integer `n` is equivalent to `stash@{n}`).
COMMANDS
--------
-push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [-m|--message <message>] [--pathspec-from-file=<file> [--pathspec-file-nul]] [--] [<pathspec>...]::
+push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [(-m|--message) <message>] [--pathspec-from-file=<file> [--pathspec-file-nul]] [--] [<pathspec>...]::
Save your local modifications to a new 'stash entry' and roll them
back to HEAD (in the working tree and in the index).
@@ -363,7 +366,7 @@ only the commit ends-up being in the stash and not on the current branch.
# ... hack hack hack ...
$ git add --patch foo # add unrelated changes to the index
$ git stash push --staged # save these changes to the stash
-# ... hack hack hack, finish curent changes ...
+# ... hack hack hack, finish current changes ...
$ git commit -m 'Massive' # commit fully tested changes
$ git switch fixup-branch # switch to another branch
$ git stash pop # to finish work on the saved changes
@@ -382,6 +385,13 @@ grep commit | cut -d\ -f3 |
xargs git log --merges --no-walk --grep=WIP
----------------------------------------------------------------
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/stash.txt[]
+
SEE ALSO
--------
diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index 54a4b29..9a37688 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -9,7 +9,7 @@ git-status - Show the working tree status
SYNOPSIS
--------
[verse]
-'git status' [<options>...] [--] [<pathspec>...]
+'git status' [<options>] [--] [<pathspec>...]
DESCRIPTION
-----------
@@ -79,6 +79,8 @@ Consider enabling untracked cache and split index if supported (see
`git update-index --untracked-cache` and `git update-index
--split-index`), Otherwise you can use `no` to have `git status`
return more quickly without showing untracked files.
+All usual spellings for Boolean value `true` are taken as `normal`
+and `false` as `no`.
The default can be changed using the status.showUntrackedFiles
configuration variable documented in linkgit:git-config[1].
@@ -245,11 +247,12 @@ U U unmerged, both modified
....
Submodules have more state and instead report
- M the submodule has a different HEAD than
- recorded in the index
- m the submodule has modified content
- ? the submodule has untracked files
-since modified content or untracked files in a submodule cannot be added
+
+* 'M' = the submodule has a different HEAD than recorded in the index
+* 'm' = the submodule has modified content
+* '?' = the submodule has untracked files
+
+This is since modified content or untracked files in a submodule cannot be added
via `git add` in the superproject to prepare a commit.
'm' and '?' are applied recursively. For example if a nested submodule
@@ -308,7 +311,7 @@ Line Notes
------------------------------------------------------------
# branch.oid <commit> | (initial) Current commit.
# branch.head <branch> | (detached) Current branch.
-# branch.upstream <upstream_branch> If upstream is set.
+# branch.upstream <upstream-branch> If upstream is set.
# branch.ab +<ahead> -<behind> If upstream is set and
the commit is present.
------------------------------------------------------------
@@ -457,6 +460,66 @@ during the write may conflict with other simultaneous processes, causing
them to fail. Scripts running `status` in the background should consider
using `git --no-optional-locks status` (see linkgit:git[1] for details).
+UNTRACKED FILES AND PERFORMANCE
+-------------------------------
+
+`git status` can be very slow in large worktrees if/when it
+needs to search for untracked files and directories. There are
+many configuration options available to speed this up by either
+avoiding the work or making use of cached results from previous
+Git commands. There is no single optimum set of settings right
+for everyone. We'll list a summary of the relevant options to help
+you, but before going into the list, you may want to run `git status`
+again, because your configuration may already be caching `git status`
+results, so it could be faster on subsequent runs.
+
+* The `--untracked-files=no` flag or the
+ `status.showUntrackedFiles=no` config (see above for both):
+ indicate that `git status` should not report untracked
+ files. This is the fastest option. `git status` will not list
+ the untracked files, so you need to be careful to remember if
+ you create any new files and manually `git add` them.
+
+* `advice.statusUoption=false` (see linkgit:git-config[1]):
+ setting this variable to `false` disables the warning message
+ given when enumerating untracked files takes more than 2
+ seconds. In a large project, it may take longer and the user
+ may have already accepted the trade off (e.g. using "-uno" may
+ not be an acceptable option for the user), in which case, there
+ is no point issuing the warning message, and in such a case,
+ disabling the warning may be the best.
+
+* `core.untrackedCache=true` (see linkgit:git-update-index[1]):
+ enable the untracked cache feature and only search directories
+ that have been modified since the previous `git status` command.
+ Git remembers the set of untracked files within each directory
+ and assumes that if a directory has not been modified, then
+ the set of untracked files within has not changed. This is much
+ faster than enumerating the contents of every directory, but still
+ not without cost, because Git still has to search for the set of
+ modified directories. The untracked cache is stored in the
+ `.git/index` file. The reduced cost of searching for untracked
+ files is offset slightly by the increased size of the index and
+ the cost of keeping it up-to-date. That reduced search time is
+ usually worth the additional size.
+
+* `core.untrackedCache=true` and `core.fsmonitor=true` or
+ `core.fsmonitor=<hook-command-pathname>` (see
+ linkgit:git-update-index[1]): enable both the untracked cache
+ and FSMonitor features and only search directories that have
+ been modified since the previous `git status` command. This
+ is faster than using just the untracked cache alone because
+ Git can also avoid searching for modified directories. Git
+ only has to enumerate the exact set of directories that have
+ changed recently. While the FSMonitor feature can be enabled
+ without the untracked cache, the benefits are greatly reduced
+ in that case.
+
+Note that after you turn on the untracked cache and/or FSMonitor
+features it may take a few `git status` commands for the various
+caches to warm up before you see improved command times. This is
+normal.
+
SEE ALSO
--------
linkgit:gitignore[5]
diff --git a/Documentation/git-stripspace.txt b/Documentation/git-stripspace.txt
index 2438f76..a293327 100644
--- a/Documentation/git-stripspace.txt
+++ b/Documentation/git-stripspace.txt
@@ -29,7 +29,7 @@ With no arguments, this will:
In the case where the input consists entirely of whitespace characters, no
output will be produced.
-*NOTE*: This is intended for cleaning metadata, prefer the `--whitespace=fix`
+*NOTE*: This is intended for cleaning metadata. Prefer the `--whitespace=fix`
mode of linkgit:git-apply[1] for correcting whitespace of patches or files in
the repository.
@@ -37,11 +37,11 @@ OPTIONS
-------
-s::
--strip-comments::
- Skip and remove all lines starting with comment character (default '#').
+ Skip and remove all lines starting with a comment character (default '#').
-c::
--comment-lines::
- Prepend comment character and blank to each line. Lines will automatically
+ Prepend the comment character and a blank space to each line. Lines will automatically
be terminated with a newline. On empty lines, only the comment character
will be prepended.
diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
index 4d3ab6b..ca0347a 100644
--- a/Documentation/git-submodule.txt
+++ b/Documentation/git-submodule.txt
@@ -95,7 +95,7 @@ too (and can also report changes to a submodule's work tree).
init [--] [<path>...]::
Initialize the submodules recorded in the index (which were
added and committed elsewhere) by setting `submodule.$name.url`
- in .git/config. It uses the same setting from `.gitmodules` as
+ in `.git/config`, using the same setting from `.gitmodules` as
a template. If the URL is relative, it will be resolved using
the default remote. If there is no default remote, the current
repository will be assumed to be upstream.
@@ -105,9 +105,12 @@ If no path is specified and submodule.active has been configured, submodules
configured to be active will be initialized, otherwise all submodules are
initialized.
+
-When present, it will also copy the value of `submodule.$name.update`.
-This command does not alter existing information in .git/config.
-You can then customize the submodule clone URLs in .git/config
+It will also copy the value of `submodule.$name.update`, if present in
+the `.gitmodules` file, to `.git/config`, but (1) this command does not
+alter existing information in `.git/config`, and (2) `submodule.$name.update`
+that is set to a custom command is *not* copied for security reasons.
++
+You can then customize the submodule clone URLs in `.git/config`
for your local setup and proceed to `git submodule update`;
you can also just use `git submodule update --init` without
the explicit 'init' step if you do not intend to customize
@@ -133,7 +136,7 @@ If you really want to remove a submodule from the repository and commit
that use linkgit:git-rm[1] instead. See linkgit:gitsubmodules[7] for removal
options.
-update [--init] [--remote] [-N|--no-fetch] [--[no-]recommend-shallow] [-f|--force] [--checkout|--rebase|--merge] [--reference <repository>] [--depth <depth>] [--recursive] [--jobs <n>] [--[no-]single-branch] [--filter <filter spec>] [--] [<path>...]::
+update [--init] [--remote] [-N|--no-fetch] [--[no-]recommend-shallow] [-f|--force] [--checkout|--rebase|--merge] [--reference <repository>] [--depth <depth>] [--recursive] [--jobs <n>] [--[no-]single-branch] [--filter <filter-spec>] [--] [<path>...]::
+
--
Update the registered submodules to match what the superproject
@@ -143,6 +146,8 @@ the submodules. The "updating" can be done in several ways depending
on command line options and the value of `submodule.<name>.update`
configuration variable. The command line option takes precedence over
the configuration variable. If neither is given, a 'checkout' is performed.
+(note: what is in `.gitmodules` file is irrelevant at this point;
+see `git submodule init` above for how `.gitmodules` is used).
The 'update' procedures supported both from the command line as well as
through the `submodule.<name>.update` configuration are:
@@ -160,16 +165,18 @@ checked out in the submodule.
merge;; the commit recorded in the superproject will be merged
into the current branch in the submodule.
-The following 'update' procedures are only available via the
-`submodule.<name>.update` configuration variable:
+The following update procedures have additional limitations:
- custom command;; arbitrary shell command that takes a single
- argument (the sha1 of the commit recorded in the
- superproject) is executed. When `submodule.<name>.update`
- is set to '!command', the remainder after the exclamation mark
- is the custom command.
+ custom command;; mechanism for running arbitrary commands with the
+ commit ID as an argument. Specifically, if the
+ `submodule.<name>.update` configuration variable is set to
+ `!custom command`, the object name of the commit recorded in the
+ superproject for the submodule is appended to the `custom command`
+ string and executed. Note that this mechanism is not supported in
+ the `.gitmodules` file or on the command line.
- none;; the submodule is not updated.
+ none;; the submodule is not updated. This update procedure is not
+ allowed on the command line.
If the submodule is not yet initialized, and you just want to use the
setting as stored in `.gitmodules`, you can automatically initialize the
@@ -178,7 +185,7 @@ submodule with the `--init` option.
If `--recursive` is specified, this command will recurse into the
registered submodules, and update any nested submodules within.
-If `--filter <filter spec>` is specified, the given partial clone filter will be
+If `--filter <filter-spec>` is specified, the given partial clone filter will be
applied to the submodule. See linkgit:git-rev-list[1] for details on filter
specifications.
--
diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 4e92308..43c68c2 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -37,12 +37,12 @@ COMMANDS
argument. Normally this command initializes the current
directory.
--T<trunk_subdir>;;
---trunk=<trunk_subdir>;;
--t<tags_subdir>;;
---tags=<tags_subdir>;;
--b<branches_subdir>;;
---branches=<branches_subdir>;;
+-T<trunk-subdir>;;
+--trunk=<trunk-subdir>;;
+-t<tags-subdir>;;
+--tags=<tags-subdir>;;
+-b<branches-subdir>;;
+--branches=<branches-subdir>;;
-s;;
--stdlayout;;
These are optional command-line options for init. Each of
@@ -726,9 +726,9 @@ ADVANCED OPTIONS
when tracking a single URL. The 'log' and 'dcommit' commands
no longer require this switch as an argument.
--R<remote name>::
---svn-remote <remote name>::
- Specify the [svn-remote "<remote name>"] section to use,
+-R<remote-name>::
+--svn-remote <remote-name>::
+ Specify the [svn-remote "<remote-name>"] section to use,
this allows SVN multiple repositories to be tracked.
Default: "svn"
diff --git a/Documentation/git-switch.txt b/Documentation/git-switch.txt
index bbcbdce..f38e4c8 100644
--- a/Documentation/git-switch.txt
+++ b/Documentation/git-switch.txt
@@ -59,13 +59,18 @@ out at most one of `A` and `B`, in which case it defaults to `HEAD`.
-c <new-branch>::
--create <new-branch>::
Create a new branch named `<new-branch>` starting at
- `<start-point>` before switching to the branch. This is a
- convenient shortcut for:
+ `<start-point>` before switching to the branch. This is the
+ transactional equivalent of
+
------------
$ git branch <new-branch>
$ git switch <new-branch>
------------
++
+that is to say, the branch is not reset/created unless "git switch" is
+successful (e.g., when the branch is in use in another worktree, not
+just the current branch stays the same, but the branch is not reset to
+the start-point, either).
-C <new-branch>::
--force-create <new-branch>::
@@ -171,7 +176,7 @@ name, the guessing is aborted. You can explicitly give a name with
`branch.autoSetupMerge` configuration variable is true.
--orphan <new-branch>::
- Create a new 'orphan' branch, named `<new-branch>`. All
+ Create a new unborn branch, named `<new-branch>`. All
tracked files are removed.
--ignore-other-worktrees::
@@ -265,6 +270,13 @@ always create a new name for it (without switching away):
$ git switch -c good-surprises
------------
+CONFIGURATION
+-------------
+
+include::includes/cmd-config-section-all.txt[]
+
+include::config/checkout.txt[]
+
SEE ALSO
--------
linkgit:git-checkout[1],
diff --git a/Documentation/git-symbolic-ref.txt b/Documentation/git-symbolic-ref.txt
index ef68ad2..761b154 100644
--- a/Documentation/git-symbolic-ref.txt
+++ b/Documentation/git-symbolic-ref.txt
@@ -9,7 +9,7 @@ SYNOPSIS
--------
[verse]
'git symbolic-ref' [-m <reason>] <name> <ref>
-'git symbolic-ref' [-q] [--short] <name>
+'git symbolic-ref' [-q] [--short] [--no-recurse] <name>
'git symbolic-ref' --delete [-q] <name>
DESCRIPTION
@@ -27,7 +27,7 @@ symbolic ref.
A symbolic ref is a regular file that stores a string that
begins with `ref: refs/`. For example, your `.git/HEAD` is
-a regular file whose contents is `ref: refs/heads/master`.
+a regular file whose content is `ref: refs/heads/master`.
OPTIONS
-------
@@ -46,6 +46,15 @@ OPTIONS
When showing the value of <name> as a symbolic ref, try to shorten the
value, e.g. from `refs/heads/master` to `master`.
+--recurse::
+--no-recurse::
+ When showing the value of <name> as a symbolic ref, if
+ <name> refers to another symbolic ref, follow such a chain
+ of symbolic refs until the result no longer points at a
+ symbolic ref (`--recurse`, which is the default).
+ `--no-recurse` stops after dereferencing only a single level
+ of symbolic ref.
+
-m::
Update the reflog for <name> with <reason>. This is valid only
when creating or updating a symbolic ref.
diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt
index 31a97a1..5fe519c 100644
--- a/Documentation/git-tag.txt
+++ b/Documentation/git-tag.txt
@@ -9,7 +9,7 @@ git-tag - Create, list, delete or verify a tag object signed with GPG
SYNOPSIS
--------
[verse]
-'git tag' [-a | -s | -u <keyid>] [-f] [-m <msg> | -F <file>] [-e]
+'git tag' [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]
<tagname> [<commit> | <object>]
'git tag' -d <tagname>...
'git tag' [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]
@@ -26,19 +26,19 @@ to delete, list or verify tags.
Unless `-f` is given, the named tag must not yet exist.
-If one of `-a`, `-s`, or `-u <keyid>` is passed, the command
+If one of `-a`, `-s`, or `-u <key-id>` is passed, the command
creates a 'tag' object, and requires a tag message. Unless
`-m <msg>` or `-F <file>` is given, an editor is started for the user to type
in the tag message.
-If `-m <msg>` or `-F <file>` is given and `-a`, `-s`, and `-u <keyid>`
+If `-m <msg>` or `-F <file>` is given and `-a`, `-s`, and `-u <key-id>`
are absent, `-a` is implied.
Otherwise, a tag reference that points directly at the given object
(i.e., a lightweight tag) is created.
A GnuPG signed tag object will be created when `-s` or `-u
-<keyid>` is used. When `-u <keyid>` is not used, the
+<key-id>` is used. When `-u <key-id>` is not used, the
committer identity for the current user is used to find the
GnuPG key for signing. The configuration variable `gpg.program`
is used to specify custom GnuPG binary.
@@ -72,8 +72,8 @@ OPTIONS
Override `tag.gpgSign` configuration variable that is
set to force each and every tag to be signed.
--u <keyid>::
---local-user=<keyid>::
+-u <key-id>::
+--local-user=<key-id>::
Make a GPG-signed tag, using the given key.
-f::
@@ -131,6 +131,10 @@ options for details.
--ignore-case::
Sorting and filtering tags are case insensitive.
+--omit-empty::
+ Do not print a newline after formatted refs where the format expands
+ to the empty string.
+
--column[=<options>]::
--no-column::
Display tag listing in columns. See configuration variable
@@ -164,14 +168,14 @@ This option is only applicable when listing tags without annotation lines.
Use the given tag message (instead of prompting).
If multiple `-m` options are given, their values are
concatenated as separate paragraphs.
- Implies `-a` if none of `-a`, `-s`, or `-u <keyid>`
+ Implies `-a` if none of `-a`, `-s`, or `-u <key-id>`
is given.
-F <file>::
--file=<file>::
Take the tag message from the given file. Use '-' to
read the message from the standard input.
- Implies `-a` if none of `-a`, `-s`, or `-u <keyid>`
+ Implies `-a` if none of `-a`, `-s`, or `-u <key-id>`
is given.
-e::
@@ -220,7 +224,7 @@ it in the repository configuration as follows:
-------------------------------------
[user]
- signingKey = <gpg-keyid>
+ signingKey = <gpg-key-id>
-------------------------------------
`pager.tag` is only respected when listing tags, i.e., when `-l` is
@@ -377,6 +381,16 @@ $ GIT_COMMITTER_DATE="2006-10-02 10:31" git tag -s v1.0.1
include::date-formats.txt[]
+FILES
+-----
+
+`$GIT_DIR/TAG_EDITMSG`::
+ This file contains the message of an in-progress annotated
+ tag. If `git tag` exits due to an error before creating an
+ annotated tag then the tag message that has been provided by the
+ user in an editor session will be available in this file, but
+ may be overwritten by the next invocation of `git tag`.
+
NOTES
-----
diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index 5ea2f2c..8c47890 100644
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -49,7 +49,7 @@ OPTIONS
--remove::
If a specified file is in the index but is missing then it's
removed.
- Default behavior is to ignore removed file.
+ Default behavior is to ignore removed files.
--refresh::
Looks at the current index and checks to see if merges or
@@ -95,7 +95,7 @@ OPTIONS
the index. If you want to change the working tree file,
you need to unset the bit to tell Git. This is
sometimes helpful when working with a big project on a
- filesystem that has very slow lstat(2) system call
+ filesystem that has a very slow lstat(2) system call
(e.g. cifs).
+
Git will fail (gracefully) in case it needs to modify this file
@@ -108,7 +108,7 @@ you will need to handle the situation manually.
without regard to the "assume unchanged" setting.
--[no-]skip-worktree::
- When one of these flags is specified, the object name recorded
+ When one of these flags is specified, the object names recorded
for the paths are not updated. Instead, these options
set and unset the "skip-worktree" bit for the paths. See
section "Skip-worktree bit" below for more information.
@@ -119,7 +119,7 @@ you will need to handle the situation manually.
the `--remove` option was specified.
--[no-]fsmonitor-valid::
- When one of these flags is specified, the object name recorded
+ When one of these flags is specified, the object names recorded
for the paths are not updated. Instead, these options
set and unset the "fsmonitor valid" bit for the paths. See
section "File System Monitor" below for more information.
@@ -127,7 +127,7 @@ you will need to handle the situation manually.
-g::
--again::
Runs 'git update-index' itself on the paths whose index
- entries are different from those from the `HEAD` commit.
+ entries are different from those of the `HEAD` commit.
--unresolve::
Restores the 'unmerged' or 'needs updating' state of a
@@ -151,24 +151,30 @@ you will need to handle the situation manually.
automatically removed with warning messages.
--stdin::
- Instead of taking list of paths from the command line,
- read list of paths from the standard input. Paths are
+ Instead of taking a list of paths from the command line,
+ read a list of paths from the standard input. Paths are
separated by LF (i.e. one path per line) by default.
--verbose::
- Report what is being added and removed from index.
+ Report what is being added and removed from the index.
--index-version <n>::
Write the resulting index out in the named on-disk format version.
- Supported versions are 2, 3 and 4. The current default version is 2
+ Supported versions are 2, 3, and 4. The current default version is 2
or 3, depending on whether extra features are used, such as
- `git add -N`.
+ `git add -N`. With `--verbose`, also report the version the index
+ file uses before and after this command.
+
Version 4 performs a simple pathname compression that reduces index
size by 30%-50% on large repositories, which results in faster load
-time. Version 4 is relatively young (first released in 1.8.0 in
-October 2012). Other Git implementations such as JGit and libgit2
-may not support it yet.
+time. Git supports it since version 1.8.0, released in October 2012,
+and support for it was added to libgit2 in 2016 and to JGit in 2020.
+Older versions of this manual page called it "relatively young", but
+it should be considered mature technology these days.
+
+--show-index-version::
+ Report the index format version used by the on-disk index file.
+ See `--index-version` above.
-z::
Only meaningful with `--stdin` or `--index-info`; paths are
@@ -420,7 +426,7 @@ as `switch`, `pull`, `merge`) will avoid writing these files.
However, these commands will sometimes write these files anyway in
important cases such as conflicts during a merge or rebase. Git
commands will also avoid treating the lack of such files as an
-intentional deletion; for example `git add -u` will not not stage a
+intentional deletion; for example `git add -u` will not stage a
deletion for these files and `git commit -a` will not make a commit
deleting them either.
diff --git a/Documentation/git-update-ref.txt b/Documentation/git-update-ref.txt
index 48b6683..374a2eb 100644
--- a/Documentation/git-update-ref.txt
+++ b/Documentation/git-update-ref.txt
@@ -8,21 +8,21 @@ git-update-ref - Update the object name stored in a ref safely
SYNOPSIS
--------
[verse]
-'git update-ref' [-m <reason>] [--no-deref] (-d <ref> [<oldvalue>] | [--create-reflog] <ref> <newvalue> [<oldvalue>] | --stdin [-z])
+'git update-ref' [-m <reason>] [--no-deref] (-d <ref> [<old-oid>] | [--create-reflog] <ref> <new-oid> [<old-oid>] | --stdin [-z])
DESCRIPTION
-----------
-Given two arguments, stores the <newvalue> in the <ref>, possibly
+Given two arguments, stores the <new-oid> in the <ref>, possibly
dereferencing the symbolic refs. E.g. `git update-ref HEAD
-<newvalue>` updates the current branch head to the new object.
+<new-oid>` updates the current branch head to the new object.
-Given three arguments, stores the <newvalue> in the <ref>,
+Given three arguments, stores the <new-oid> in the <ref>,
possibly dereferencing the symbolic refs, after verifying that
-the current value of the <ref> matches <oldvalue>.
-E.g. `git update-ref refs/heads/master <newvalue> <oldvalue>`
-updates the master branch head to <newvalue> only if its current
-value is <oldvalue>. You can specify 40 "0" or an empty string
-as <oldvalue> to make sure that the ref you are creating does
+the current value of the <ref> matches <old-oid>.
+E.g. `git update-ref refs/heads/master <new-oid> <old-oid>`
+updates the master branch head to <new-oid> only if its current
+value is <old-oid>. You can specify 40 "0" or an empty string
+as <old-oid> to make sure that the ref you are creating does
not exist.
It also allows a "ref" file to be a symbolic pointer to another
@@ -56,15 +56,15 @@ ref symlink to some other tree, if you have copied a whole
archive by creating a symlink tree).
With `-d` flag, it deletes the named <ref> after verifying it
-still contains <oldvalue>.
+still contains <old-oid>.
With `--stdin`, update-ref reads instructions from standard input and
performs all modifications together. Specify commands of the form:
- update SP <ref> SP <newvalue> [SP <oldvalue>] LF
- create SP <ref> SP <newvalue> LF
- delete SP <ref> [SP <oldvalue>] LF
- verify SP <ref> [SP <oldvalue>] LF
+ update SP <ref> SP <new-oid> [SP <old-oid>] LF
+ create SP <ref> SP <new-oid> LF
+ delete SP <ref> [SP <old-oid>] LF
+ verify SP <ref> [SP <old-oid>] LF
option SP <opt> LF
start LF
prepare LF
@@ -82,10 +82,10 @@ specify a missing value, omit the value and its preceding SP entirely.
Alternatively, use `-z` to specify in NUL-terminated format, without
quoting:
- update SP <ref> NUL <newvalue> NUL [<oldvalue>] NUL
- create SP <ref> NUL <newvalue> NUL
- delete SP <ref> NUL [<oldvalue>] NUL
- verify SP <ref> NUL [<oldvalue>] NUL
+ update SP <ref> NUL <new-oid> NUL [<old-oid>] NUL
+ create SP <ref> NUL <new-oid> NUL
+ delete SP <ref> NUL [<old-oid>] NUL
+ verify SP <ref> NUL [<old-oid>] NUL
option SP <opt> NUL
start NUL
prepare NUL
@@ -100,25 +100,25 @@ recognizes as an object name. Commands in any other format or a
repeated <ref> produce an error. Command meanings are:
update::
- Set <ref> to <newvalue> after verifying <oldvalue>, if given.
- Specify a zero <newvalue> to ensure the ref does not exist
- after the update and/or a zero <oldvalue> to make sure the
+ Set <ref> to <new-oid> after verifying <old-oid>, if given.
+ Specify a zero <new-oid> to ensure the ref does not exist
+ after the update and/or a zero <old-oid> to make sure the
ref does not exist before the update.
create::
- Create <ref> with <newvalue> after verifying it does not
- exist. The given <newvalue> may not be zero.
+ Create <ref> with <new-oid> after verifying it does not
+ exist. The given <new-oid> may not be zero.
delete::
- Delete <ref> after verifying it exists with <oldvalue>, if
- given. If given, <oldvalue> may not be zero.
+ Delete <ref> after verifying it exists with <old-oid>, if
+ given. If given, <old-oid> may not be zero.
verify::
- Verify <ref> against <oldvalue> but do not change it. If
- <oldvalue> is zero or missing, the ref must not exist.
+ Verify <ref> against <old-oid> but do not change it. If
+ <old-oid> is zero or missing, the ref must not exist.
option::
- Modify behavior of the next command naming a <ref>.
+ Modify the behavior of the next command naming a <ref>.
The only valid option is `no-deref` to avoid dereferencing
a symbolic ref.
@@ -141,7 +141,7 @@ abort::
Abort the transaction, releasing all locks if the transaction is in
prepared state.
-If all <ref>s can be locked with matching <oldvalue>s
+If all <ref>s can be locked with matching <old-oid>s
simultaneously, all modifications are performed. Otherwise, no
modifications are performed. Note that while each individual
<ref> is updated or deleted atomically, a concurrent reader may
@@ -161,7 +161,7 @@ formatted as:
Where "oldsha1" is the 40 character hexadecimal value previously
stored in <ref>, "newsha1" is the 40 character hexadecimal value of
-<newvalue> and "committer" is the committer's name, email address
+<new-oid> and "committer" is the committer's name, email address
and date in the standard Git committer ident format.
Optionally with -m:
diff --git a/Documentation/git-update-server-info.txt b/Documentation/git-update-server-info.txt
index 969bb2e..6bc9b50 100644
--- a/Documentation/git-update-server-info.txt
+++ b/Documentation/git-update-server-info.txt
@@ -9,7 +9,7 @@ git-update-server-info - Update auxiliary info file to help dumb servers
SYNOPSIS
--------
[verse]
-'git update-server-info'
+'git update-server-info' [-f | --force]
DESCRIPTION
-----------
@@ -19,11 +19,17 @@ $GIT_OBJECT_DIRECTORY/info directories to help clients discover
what references and packs the server has. This command
generates such auxiliary files.
+OPTIONS
+-------
+-f::
+--force::
+ Update the info files from scratch.
+
OUTPUT
------
Currently the command updates the following files. Please see
-linkgit:gitrepository-layout[5] for description of
+linkgit:gitrepository-layout[5] for a description of
what they are for:
* objects/info/packs
diff --git a/Documentation/git-upload-archive.txt b/Documentation/git-upload-archive.txt
index fba0f1c..e8eb10b 100644
--- a/Documentation/git-upload-archive.txt
+++ b/Documentation/git-upload-archive.txt
@@ -9,7 +9,7 @@ git-upload-archive - Send archive back to git-archive
SYNOPSIS
--------
[verse]
-'git upload-archive' <directory>
+'git upload-archive' <repository>
DESCRIPTION
-----------
@@ -54,7 +54,7 @@ access via non-smart-http.
OPTIONS
-------
-<directory>::
+<repository>::
The repository to get a tar archive from.
GIT
diff --git a/Documentation/git-upload-pack.txt b/Documentation/git-upload-pack.txt
index 8f87b23..7ad60bc 100644
--- a/Documentation/git-upload-pack.txt
+++ b/Documentation/git-upload-pack.txt
@@ -26,7 +26,7 @@ OPTIONS
-------
--[no-]strict::
- Do not try <directory>/.git/ if <directory> is no Git directory.
+ Do not try <directory>/.git/ if <directory> is not a Git directory.
--timeout=<n>::
Interrupt transfer after <n> seconds of inactivity.
@@ -39,10 +39,9 @@ OPTIONS
--http-backend-info-refs::
Used by linkgit:git-http-backend[1] to serve up
`$GIT_URL/info/refs?service=git-upload-pack` requests. See
- "Smart Clients" in link:technical/http-protocol.html[the HTTP
- transfer protocols] documentation and "HTTP Transport" in
- link:technical/protocol-v2.html[the Git Wire Protocol, Version
- 2] documentation. Also understood by
+ "Smart Clients" in linkgit:gitprotocol-http[5] and "HTTP
+ Transport" in the linkgit:gitprotocol-v2[5]
+ documentation. Also understood by
linkgit:git-receive-pack[1].
<directory>::
diff --git a/Documentation/git-var.txt b/Documentation/git-var.txt
index 387cc1b..0680568 100644
--- a/Documentation/git-var.txt
+++ b/Documentation/git-var.txt
@@ -9,16 +9,17 @@ git-var - Show a Git logical variable
SYNOPSIS
--------
[verse]
-'git var' ( -l | <variable> )
+'git var' (-l | <variable>)
DESCRIPTION
-----------
-Prints a Git logical variable.
+Prints a Git logical variable. Exits with code 1 if the variable has
+no value.
OPTIONS
-------
-l::
- Cause the logical variables to be listed. In addition, all the
+ Display the logical variables. In addition, all the
variables of the Git configuration file .git/config are listed
as well. (However, the configuration variables listing functionality
is deprecated in favor of `git config -l`.)
@@ -49,6 +50,14 @@ ifdef::git-default-editor[]
The build you are using chose '{git-default-editor}' as the default.
endif::git-default-editor[]
+GIT_SEQUENCE_EDITOR::
+ Text editor used to edit the 'todo' file while running `git rebase
+ -i`. Like `GIT_EDITOR`, the value is meant to be interpreted by
+ the shell when it is used. The order of preference is the
+ `$GIT_SEQUENCE_EDITOR` environment variable, then
+ `sequence.editor` configuration, and then the value of `git var
+ GIT_EDITOR`.
+
GIT_PAGER::
Text viewer for use by Git commands (e.g., 'less'). The value
is meant to be interpreted by the shell. The order of preference
@@ -62,6 +71,29 @@ endif::git-default-pager[]
GIT_DEFAULT_BRANCH::
The name of the first branch created in newly initialized repositories.
+GIT_SHELL_PATH::
+ The path of the binary providing the POSIX shell for commands which use the shell.
+
+GIT_ATTR_SYSTEM::
+ The path to the system linkgit:gitattributes[5] file, if one is enabled.
+
+GIT_ATTR_GLOBAL::
+ The path to the global (per-user) linkgit:gitattributes[5] file.
+
+GIT_CONFIG_SYSTEM::
+ The path to the system configuration file, if one is enabled.
+
+GIT_CONFIG_GLOBAL::
+ The path to the global (per-user) configuration files, if any.
+
+Most path values contain only one value. However, some can contain multiple
+values, which are separated by newlines, and are listed in order from highest to
+lowest priority. Callers should be prepared for any such path value to contain
+multiple items.
+
+Note that paths are printed even if they do not exist, but not if they are
+disabled by other environment variables.
+
SEE ALSO
--------
linkgit:git-commit-tree[1]
diff --git a/Documentation/git-verify-commit.txt b/Documentation/git-verify-commit.txt
index 92097f6..aee4c40 100644
--- a/Documentation/git-verify-commit.txt
+++ b/Documentation/git-verify-commit.txt
@@ -8,7 +8,7 @@ git-verify-commit - Check the GPG signature of commits
SYNOPSIS
--------
[verse]
-'git verify-commit' <commit>...
+'git verify-commit' [-v | --verbose] [--raw] <commit>...
DESCRIPTION
-----------
diff --git a/Documentation/git-verify-pack.txt b/Documentation/git-verify-pack.txt
index 61ca6d0..d7e8869 100644
--- a/Documentation/git-verify-pack.txt
+++ b/Documentation/git-verify-pack.txt
@@ -9,13 +9,13 @@ git-verify-pack - Validate packed Git archive files
SYNOPSIS
--------
[verse]
-'git verify-pack' [-v|--verbose] [-s|--stat-only] [--] <pack>.idx ...
+'git verify-pack' [-v | --verbose] [-s | --stat-only] [--] <pack>.idx...
DESCRIPTION
-----------
Reads given idx file for packed Git archive created with the
-'git pack-objects' command and verifies idx file and the
+'git pack-objects' command and verifies the idx file and the
corresponding pack file.
OPTIONS
@@ -25,13 +25,13 @@ OPTIONS
-v::
--verbose::
- After verifying the pack, show list of objects contained
+ After verifying the pack, show the list of objects contained
in the pack and a histogram of delta chain length.
-s::
--stat-only::
Do not verify the pack contents; only show the histogram of delta
- chain length. With `--verbose`, list of objects is also shown.
+ chain length. With `--verbose`, the list of objects is also shown.
\--::
Do not interpret any more arguments as options.
diff --git a/Documentation/git-verify-tag.txt b/Documentation/git-verify-tag.txt
index 0b8075d..81d50ec 100644
--- a/Documentation/git-verify-tag.txt
+++ b/Documentation/git-verify-tag.txt
@@ -8,7 +8,7 @@ git-verify-tag - Check the GPG signature of tags
SYNOPSIS
--------
[verse]
-'git verify-tag' [--format=<format>] <tag>...
+'git verify-tag' [-v | --verbose] [--format=<format>] [--raw] <tag>...
DESCRIPTION
-----------
diff --git a/Documentation/git-whatchanged.txt b/Documentation/git-whatchanged.txt
index 8b63ceb..8e55e0b 100644
--- a/Documentation/git-whatchanged.txt
+++ b/Documentation/git-whatchanged.txt
@@ -3,7 +3,7 @@ git-whatchanged(1)
NAME
----
-git-whatchanged - Show logs with difference each commit introduces
+git-whatchanged - Show logs with differences each commit introduces
SYNOPSIS
@@ -18,11 +18,11 @@ Shows commit logs and diff output each commit introduces.
New users are encouraged to use linkgit:git-log[1] instead. The
`whatchanged` command is essentially the same as linkgit:git-log[1]
-but defaults to show the raw format diff output and to skip merges.
+but defaults to showing the raw format diff output and skipping merges.
-The command is kept primarily for historical reasons; fingers of
+The command is primarily kept for historical reasons; fingers of
many people who learned Git long before `git log` was invented by
-reading Linux kernel mailing list are trained to type it.
+reading the Linux kernel mailing list are trained to type it.
Examples
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
index ada30c8..2a240f5 100644
--- a/Documentation/git-worktree.txt
+++ b/Documentation/git-worktree.txt
@@ -9,7 +9,8 @@ git-worktree - Manage multiple working trees
SYNOPSIS
--------
[verse]
-'git worktree add' [-f] [--detach] [--checkout] [--lock [--reason <string>]] [-b <new-branch>] <path> [<commit-ish>]
+'git worktree add' [-f] [--detach] [--checkout] [--lock [--reason <string>]]
+ [--orphan] [(-b | -B) <new-branch>] <path> [<commit-ish>]
'git worktree list' [-v | --porcelain [-z]]
'git worktree lock' [--reason <string>] <worktree>
'git worktree move' <worktree> <new-path>
@@ -94,6 +95,16 @@ exist, a new branch based on `HEAD` is automatically created as if
`-b <branch>` was given. If `<branch>` does exist, it will be checked out
in the new worktree, if it's not checked out anywhere else, otherwise the
command will refuse to create the worktree (unless `--force` is used).
++
+If `<commit-ish>` is omitted, neither `--detach`, or `--orphan` is
+used, and there are no valid local branches (or remote branches if
+`--guess-remote` is specified) then, as a convenience, the new worktree is
+associated with a new unborn branch named `<branch>` (after
+`$(basename <path>)` if neither `-b` or `-B` is used) as if `--orphan` was
+passed to the command. In the event the repository has a remote and
+`--guess-remote` is used, but no remote or local branches exist, then the
+command fails with a warning reminding the user to fetch from their remote
+first (or override by using `-f/--force`).
list::
@@ -221,6 +232,10 @@ This can also be set up as the default behaviour by using the
With `prune`, do not remove anything; just report what it would
remove.
+--orphan::
+ With `add`, make the new worktree and index empty, associating
+ the worktree with a new unborn branch named `<new-branch>`.
+
--porcelain::
With `list`, output in an easy-to-parse format for scripts.
This format will remain stable across Git versions and regardless of user
@@ -271,7 +286,8 @@ rules and how to access refs of one worktree from another.
In general, all pseudo refs are per-worktree and all refs starting with
`refs/` are shared. Pseudo refs are ones like `HEAD` which are directly
under `$GIT_DIR` instead of inside `$GIT_DIR/refs`. There are exceptions,
-however: refs inside `refs/bisect` and `refs/worktree` are not shared.
+however: refs inside `refs/bisect`, `refs/worktree` and `refs/rewritten` are
+not shared.
Refs that are per-worktree can still be accessed from another worktree via
two special paths, `main-worktree` and `worktrees`. The former gives
@@ -348,8 +364,8 @@ linked worktree `git rev-parse --git-path HEAD` returns
`/path/other/test-next/.git/HEAD` or `/path/main/.git/HEAD`) while `git
rev-parse --git-path refs/heads/master` uses
`$GIT_COMMON_DIR` and returns `/path/main/.git/refs/heads/master`,
-since refs are shared across all worktrees, except `refs/bisect` and
-`refs/worktree`.
+since refs are shared across all worktrees, except `refs/bisect`,
+`refs/worktree` and `refs/rewritten`.
See linkgit:gitrepository-layout[5] for more information. The rule of
thumb is do not make any assumption about whether a path belongs to
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 47a6095..7a1b112 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -13,8 +13,7 @@ SYNOPSIS
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|-P|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
- [--super-prefix=<path>] [--config-env=<name>=<envvar>]
- <command> [<args>]
+ [--config-env=<name>=<envvar>] <command> [<args>]
DESCRIPTION
-----------
@@ -97,9 +96,9 @@ foo.bar= ...`) sets `foo.bar` to the empty string which `git config
to avoid ambiguity with `<name>` containing one.
+
This is useful for cases where you want to pass transitory
-configuration options to git, but are doing so on OS's where
-other processes might be able to read your cmdline
-(e.g. `/proc/self/cmdline`), but not your environ
+configuration options to git, but are doing so on operating systems
+where other processes might be able to read your command line
+(e.g. `/proc/self/cmdline`), but not your environment
(e.g. `/proc/self/environ`). That behavior is the default on
Linux, but may not be on your system.
+
@@ -169,19 +168,23 @@ If you just want to run git as if it was started in `<path>` then use
details. Equivalent to setting the `GIT_NAMESPACE` environment
variable.
---super-prefix=<path>::
- Currently for internal use only. Set a prefix which gives a path from
- above a repository down to its root. One use is to give submodules
- context about the superproject that invoked it.
-
--bare::
Treat the repository as a bare repository. If GIT_DIR
environment is not set, it is set to the current working
directory.
--no-replace-objects::
- Do not use replacement refs to replace Git objects. See
- linkgit:git-replace[1] for more information.
+ Do not use replacement refs to replace Git objects.
+ This is equivalent to exporting the `GIT_NO_REPLACE_OBJECTS`
+ environment variable with any value.
+ See linkgit:git-replace[1] for more information.
+
+--no-lazy-fetch::
+ Do not fetch missing objects from the promisor remote on
+ demand. Useful together with `git cat-file -e <object>` to
+ see if the object is locally available.
+ This is equivalent to setting the `GIT_NO_LAZY_FETCH`
+ environment variable to `1`.
--literal-pathspecs::
Treat pathspecs literally (i.e. no globbing, no pathspec magic).
@@ -208,7 +211,7 @@ If you just want to run git as if it was started in `<path>` then use
Do not perform optional operations that require locks. This is
equivalent to setting the `GIT_OPTIONAL_LOCKS` to `0`.
---list-cmds=group[,group...]::
+--list-cmds=<group>[,<group>...]::
List commands by group. This is an internal/experimental
option and may change or be removed in the future. Supported
groups are: builtins, parseopt (builtin commands that use
@@ -218,6 +221,11 @@ If you just want to run git as if it was started in `<path>` then use
nohelpers (exclude helper commands), alias and config
(retrieve command list from config variable completion.commands)
+--attr-source=<tree-ish>::
+ Read gitattributes from <tree-ish> instead of the worktree. See
+ linkgit:gitattributes[5]. This is equivalent to setting the
+ `GIT_ATTR_SOURCE` environment variable.
+
GIT COMMANDS
------------
@@ -339,6 +347,23 @@ The following documentation pages are guides about Git concepts.
include::cmds-guide.txt[]
+Repository, command and file interfaces
+---------------------------------------
+
+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[]
+
+File formats, protocols and other developer interfaces
+------------------------------------------------------
+
+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[]
Configuration Mechanism
-----------------------
@@ -441,7 +466,12 @@ Please see linkgit:gitglossary[7].
Environment Variables
---------------------
-Various Git commands use the following environment variables:
+Various Git commands pay attention to environment variables and change
+their behavior. The environment variables marked as "Boolean" take
+their values the same way as Boolean valued configuration variables, e.g.
+"true", "yes", "on" and positive numbers are taken as "yes".
+
+Here are the variables:
The Git Repository
~~~~~~~~~~~~~~~~~~
@@ -450,13 +480,13 @@ is worth noting that they may be used/overridden by SCMS sitting above
Git so take care if using a foreign front-end.
`GIT_INDEX_FILE`::
- This environment allows the specification of an alternate
+ This environment variable specifies an alternate
index file. If not specified, the default of `$GIT_DIR/index`
is used.
`GIT_INDEX_VERSION`::
- This environment variable allows the specification of an index
- version for new repositories. It won't affect existing index
+ This environment variable specifies what index version is used
+ when writing the index file out. It won't affect existing index
files. By default index file version 2 or 3 is used. See
linkgit:git-update-index[1] for more information.
@@ -513,7 +543,7 @@ double-quotes and respecting backslash escapes. E.g., the value
When run in a directory that does not have ".git" repository
directory, Git tries to find such a directory in the parent
directories to find the top of the working tree, but by default it
- does not cross filesystem boundaries. This environment variable
+ does not cross filesystem boundaries. This Boolean environment variable
can be set to true to tell Git not to stop at filesystem
boundaries. Like `GIT_CEILING_DIRECTORIES`, this will not affect
an explicit repository directory set via `GIT_DIR` or on the
@@ -530,10 +560,15 @@ double-quotes and respecting backslash escapes. E.g., the value
`GIT_DEFAULT_HASH`::
If this variable is set, the default hash algorithm for new
- repositories will be set to this value. This value is currently
- ignored when cloning; the setting of the remote repository
- is used instead. The default is "sha1". THIS VARIABLE IS
- EXPERIMENTAL! See `--object-format` in linkgit:git-init[1].
+ repositories will be set to this value. This value is
+ ignored when cloning and the setting of the remote repository
+ is always used. The default is "sha1".
+ See `--object-format` in linkgit:git-init[1].
+
+`GIT_DEFAULT_REF_FORMAT`::
+ If this variable is set, the default reference backend format for new
+ repositories will be set to this value. The default is "files".
+ See `--ref-format` in linkgit:git-init[1].
Git Commits
~~~~~~~~~~~
@@ -597,7 +632,7 @@ The file parameters can point at the user's working file
(e.g. `new-file` in "git-diff-files"), `/dev/null` (e.g. `old-file`
when a new file is added), or a temporary file (e.g. `old-file` in the
index). `GIT_EXTERNAL_DIFF` should not worry about unlinking the
-temporary file --- it is removed when `GIT_EXTERNAL_DIFF` exits.
+temporary file -- it is removed when `GIT_EXTERNAL_DIFF` exits.
+
For a path that is unmerged, `GIT_EXTERNAL_DIFF` is called with 1
parameter, <path>.
@@ -665,6 +700,14 @@ for further details.
plink or tortoiseplink. This variable overrides the config setting
`ssh.variant` that serves the same purpose.
+`GIT_SSL_NO_VERIFY`::
+ Setting and exporting this environment variable to any value
+ tells Git not to verify the SSL certificate when fetching or
+ pushing over HTTPS.
+
+`GIT_ATTR_SOURCE`::
+ Sets the treeish that gitattributes will be read from.
+
`GIT_ASKPASS`::
If this environment variable is set, then Git commands which need to
acquire passwords or passphrases (e.g. for HTTP or IMAP authentication)
@@ -673,7 +716,7 @@ for further details.
option in linkgit:git-config[1].
`GIT_TERMINAL_PROMPT`::
- If this environment variable is set to `0`, git will not prompt
+ If this Boolean environment variable is set to false, git will not prompt
on the terminal (e.g., when asking for HTTP authentication).
`GIT_CONFIG_GLOBAL`::
@@ -688,19 +731,19 @@ for further details.
`GIT_CONFIG_NOSYSTEM`::
Whether to skip reading settings from the system-wide
- `$(prefix)/etc/gitconfig` file. This environment variable can
+ `$(prefix)/etc/gitconfig` file. This Boolean environment variable can
be used along with `$HOME` and `$XDG_CONFIG_HOME` to create a
predictable environment for a picky script, or you can set it
- temporarily to avoid using a buggy `/etc/gitconfig` file while
+ to true to temporarily avoid using a buggy `/etc/gitconfig` file while
waiting for someone with sufficient permissions to fix it.
`GIT_FLUSH`::
- If this environment variable is set to "1", then commands such
+ If this Boolean environment variable is set to true, then commands such
as 'git blame' (in incremental mode), 'git rev-list', 'git log',
'git check-attr' and 'git check-ignore' will
force a flush of the output stream after each record have been
flushed. If this
- variable is set to "0", the output of these commands will be done
+ variable is set to false, the output of these commands will be done
using completely buffered I/O. If this environment variable is
not set, Git will choose buffered or record-oriented flushing
based on whether stdout appears to be redirected to a file or not.
@@ -808,7 +851,7 @@ of the SID and an optional counter (to avoid filename
collisions).
+
In addition, if the variable is set to
-`af_unix:[<socket_type>:]<absolute-pathname>`, Git will try
+`af_unix:[<socket-type>:]<absolute-pathname>`, Git will try
to open the path as a Unix Domain Socket. The socket type
can be either `stream` or `dgram`.
+
@@ -835,11 +878,15 @@ for full details.
`GIT_TRACE_REDACT`::
By default, when tracing is activated, Git redacts the values of
cookies, the "Authorization:" header, the "Proxy-Authorization:"
- header and packfile URIs. Set this variable to `0` to prevent this
+ header and packfile URIs. Set this Boolean environment variable to false to prevent this
redaction.
+`GIT_NO_REPLACE_OBJECTS`::
+ Setting and exporting this environment variable tells Git to
+ ignore replacement refs and do not replace Git objects.
+
`GIT_LITERAL_PATHSPECS`::
- Setting this variable to `1` will cause Git to treat all
+ Setting this Boolean environment variable to true will cause Git to treat all
pathspecs literally, rather than as glob patterns. For example,
running `GIT_LITERAL_PATHSPECS=1 git log -- '*.c'` will search
for commits that touch the path `*.c`, not any paths that the
@@ -848,17 +895,22 @@ for full details.
`git ls-tree`, `--raw` diff output, etc).
`GIT_GLOB_PATHSPECS`::
- Setting this variable to `1` will cause Git to treat all
+ Setting this Boolean environment variable to true will cause Git to treat all
pathspecs as glob patterns (aka "glob" magic).
`GIT_NOGLOB_PATHSPECS`::
- Setting this variable to `1` will cause Git to treat all
+ Setting this Boolean environment variable to true will cause Git to treat all
pathspecs as literal (aka "literal" magic).
`GIT_ICASE_PATHSPECS`::
- Setting this variable to `1` will cause Git to treat all
+ Setting this Boolean environment variable to true will cause Git to treat all
pathspecs as case-insensitive.
+`GIT_NO_LAZY_FETCH`::
+ Setting this Boolean environment variable to true tells Git
+ not to lazily fetch missing objects from the promisor remote
+ on demand.
+
`GIT_REFLOG_ACTION`::
When a ref is updated, reflog entries are created to keep
track of the reason why the ref was updated (which is
@@ -870,7 +922,7 @@ for full details.
end user, to be recorded in the body of the reflog.
`GIT_REF_PARANOIA`::
- If set to `0`, ignore broken or badly named refs when iterating
+ If this Boolean environment variable is set to false, ignore broken or badly named refs when iterating
over lists of refs. Normally Git will try to include any such
refs, which may cause some operations to fail. This is usually
preferable, as potentially destructive operations (e.g.,
@@ -881,6 +933,16 @@ for full details.
should not normally need to set this to `0`, but it may be
useful when trying to salvage data from a corrupted repository.
+`GIT_COMMIT_GRAPH_PARANOIA`::
+ When loading a commit object from the commit-graph, Git performs an
+ existence check on the object in the object database. This is done to
+ avoid issues with stale commit-graphs that contain references to
+ already-deleted commits, but comes with a performance penalty.
++
+The default is "false", which disables the aforementioned behavior.
+Setting this to "true" enables the existence check so that stale commits
+will never be returned from the commit-graph at the cost of performance.
+
`GIT_ALLOW_PROTOCOL`::
If set to a colon-separated list of protocols, behave as if
`protocol.allow` is set to `never`, and each of the listed
@@ -889,7 +951,7 @@ for full details.
`protocol.allow` in linkgit:git-config[1] for more details.
`GIT_PROTOCOL_FROM_USER`::
- Set to 0 to prevent protocols used by fetch/push/clone which are
+ Set this Boolean environment variable to false to prevent protocols used by fetch/push/clone which are
configured to the `user` state. This is useful to restrict recursive
submodule initialization from an untrusted repository or for programs
which feed potentially-untrusted URLS to git commands. See
@@ -898,7 +960,7 @@ for full details.
`GIT_PROTOCOL`::
For internal use only. Used in handshaking the wire protocol.
Contains a colon ':' separated list of keys with optional values
- 'key[=value]'. Presence of unknown keys and values must be
+ '<key>[=<value>]'. Presence of unknown keys and values must be
ignored.
+
Note that servers may need to be configured to allow this variable to
@@ -917,7 +979,7 @@ only affects clones and fetches; it is not yet used for pushes (but may
be in the future).
`GIT_OPTIONAL_LOCKS`::
- If set to `0`, Git will complete any requested operation without
+ If this Boolean environment variable is set to false, Git will complete any requested operation without
performing any optional sub-operations that require taking a lock.
For example, this will prevent `git status` from refreshing the
index as a side effect. This is useful for processes running in
@@ -985,10 +1047,11 @@ When first created, objects are stored in individual files, but for
efficiency may later be compressed together into "pack files".
Named pointers called refs mark interesting points in history. A ref
-may contain the SHA-1 name of an object or the name of another ref. Refs
-with names beginning `ref/head/` contain the SHA-1 name of the most
+may contain the SHA-1 name of an object or the name of another ref (the
+latter is called a "symbolic ref").
+Refs with names beginning `refs/head/` contain the SHA-1 name of the most
recent commit (or "head") of a branch under development. SHA-1 names of
-tags of interest are stored under `ref/tags/`. A special ref named
+tags of interest are stored under `refs/tags/`. A symbolic ref named
`HEAD` contains the name of the currently checked-out branch.
The index file is initialized with a list of all paths and, for each
@@ -1031,7 +1094,7 @@ Authors
-------
Git was started by Linus Torvalds, and is currently maintained by Junio
C Hamano. Numerous contributions have come from the Git mailing list
-<git@vger.kernel.org>. http://www.openhub.net/p/git/contributors/summary
+<git@vger.kernel.org>. https://openhub.net/p/git/contributors/summary
gives you a more complete list of contributors.
If you have a clone of git.git itself, the
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index 4b36d51..4338d02 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -100,6 +100,21 @@ for a path to `Unspecified` state. This can be done by listing
the name of the attribute prefixed with an exclamation point `!`.
+RESERVED BUILTIN_* ATTRIBUTES
+-----------------------------
+
+builtin_* is a reserved namespace for builtin attribute values. Any
+user defined attributes under this namespace will be ignored and
+trigger a warning.
+
+`builtin_objectmode`
+~~~~~~~~~~~~~~~~~~~~
+This attribute is for filtering files by their file bit modes (40000,
+120000, 160000, 100755, 100644). e.g. ':(attr:builtin_objectmode=160000)'.
+You may also check these values with `git check-attr builtin_objectmode -- <file>`.
+If the object is not in the index `git check-attr --cached` will return unspecified.
+
+
EFFECTS
-------
@@ -120,20 +135,19 @@ repository upon 'git add' and 'git commit'.
`text`
^^^^^^
-This attribute enables and controls end-of-line normalization. When a
-text file is normalized, its line endings are converted to LF in the
-repository. To control what line ending style is used in the working
-directory, use the `eol` attribute for a single file and the
-`core.eol` configuration variable for all text files.
-Note that setting `core.autocrlf` to `true` or `input` overrides
-`core.eol` (see the definitions of those options in
-linkgit:git-config[1]).
+This attribute marks the path as a text file, which enables end-of-line
+conversion: When a matching file is added to the index, the file's line
+endings are normalized to LF in the index. Conversely, when the file is
+copied from the index to the working directory, its line endings may be
+converted from LF to CRLF depending on the `eol` attribute, the Git
+config, and the platform (see explanation of `eol` below).
Set::
Setting the `text` attribute on a path enables end-of-line
- normalization and marks the path as a text file. End-of-line
- conversion takes place without guessing the content type.
+ conversion on checkin and checkout as described above. Line endings
+ are normalized to LF in the index every time the file is checked in,
+ even if the file was previously added to Git with CRLF line endings.
Unset::
@@ -142,10 +156,11 @@ Unset::
Set to string value "auto"::
- When `text` is set to "auto", the path is marked for automatic
- end-of-line conversion. If Git decides that the content is
- text, its line endings are converted to LF on checkin.
- When the file has been committed with CRLF, no conversion is done.
+ When `text` is set to "auto", Git decides by itself whether the file
+ is text or binary. If it is text and the file was not already in
+ Git with CRLF endings, line endings are converted on checkin and
+ checkout as described above. Otherwise, no conversion is done on
+ checkin or checkout.
Unspecified::
@@ -159,26 +174,29 @@ unspecified.
`eol`
^^^^^
-This attribute sets a specific line-ending style to be used in the
-working directory. This attribute has effect only if the `text`
-attribute is set or unspecified, or if it is set to `auto`, the file is
-detected as text, and it is stored with LF endings in the index. Note
-that setting this attribute on paths which are in the index with CRLF
-line endings may make the paths to be considered dirty unless
-`text=auto` is set. Adding the path to the index again will normalize
-the line endings in the index.
+This attribute marks a path to use a specific line-ending style in the
+working tree when it is checked out. It has effect only if `text` or
+`text=auto` is set (see above), but specifying `eol` automatically sets
+`text` if `text` was left unspecified.
Set to string value "crlf"::
- This setting forces Git to normalize line endings for this
- file on checkin and convert them to CRLF when the file is
- checked out.
+ This setting converts the file's line endings in the working
+ directory to CRLF when the file is checked out.
Set to string value "lf"::
- This setting forces Git to normalize line endings to LF on
- checkin and prevents conversion to CRLF when the file is
- checked out.
+ This setting uses the same line endings in the working directory as
+ in the index when the file is checked out.
+
+Unspecified::
+
+ If the `eol` attribute is unspecified for a file, its line endings
+ in the working directory are determined by the `core.autocrlf` or
+ `core.eol` configuration variable (see the definitions of those
+ options in linkgit:git-config[1]). If `text` is set but neither of
+ those variables is, the default is `eol=crlf` on Windows and
+ `eol=lf` on all other platforms.
Backwards compatibility with `crlf` attribute
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -758,6 +776,37 @@ with the above configuration, i.e. `j-c-diff`, with 7
parameters, just like `GIT_EXTERNAL_DIFF` program is called.
See linkgit:git[1] for details.
+Setting the internal diff algorithm
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The diff algorithm can be set through the `diff.algorithm` config key, but
+sometimes it may be helpful to set the diff algorithm per path. For example,
+one may want to use the `minimal` diff algorithm for .json files, and the
+`histogram` for .c files, and so on without having to pass in the algorithm
+through the command line each time.
+
+First, in `.gitattributes`, assign the `diff` attribute for paths.
+
+------------------------
+*.json diff=<name>
+------------------------
+
+Then, define a "diff.<name>.algorithm" configuration to specify the diff
+algorithm, choosing from `myers`, `patience`, `minimal`, or `histogram`.
+
+----------------------------------------------------------------
+[diff "<name>"]
+ algorithm = histogram
+----------------------------------------------------------------
+
+This diff algorithm applies to user facing diff output like git-diff(1),
+git-show(1) and is used for the `--stat` output as well. The merge machinery
+will not use the diff algorithm set through this method.
+
+NOTE: If `diff.<name>.command` is defined for path with the
+`diff=<name>` attribute, it is executed as an external diff driver
+(see above), and adding `diff.<name>.algorithm` has no effect, as the
+algorithm is not passed to the external diff driver.
Defining a custom hunk-header
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1088,17 +1137,20 @@ The `merge.*.name` variable gives the driver a human-readable
name.
The `merge.*.driver` variable's value is used to construct a
-command to run to merge ancestor's version (`%O`), current
+command to run to common ancestor's version (`%O`), current
version (`%A`) and the other branches' version (`%B`). These
three tokens are replaced with the names of temporary files that
hold the contents of these versions when the command line is
-built. Additionally, %L will be replaced with the conflict marker
+built. Additionally, `%L` will be replaced with the conflict marker
size (see below).
The merge driver is expected to leave the result of the merge in
the file named with `%A` by overwriting it, and exit with zero
status if it managed to merge them cleanly, or non-zero if there
-were conflicts.
+were conflicts. When the driver crashes (e.g. killed by SEGV),
+it is expected to exit with non-zero status that are higher than
+128, and in such a case, the merge results in a failure (which is
+different from producing a conflict).
The `merge.*.recursive` variable specifies what other merge
driver to use when the merge driver is called for an internal
@@ -1107,15 +1159,16 @@ When left unspecified, the driver itself is used for both
internal merge and the final merge.
The merge driver can learn the pathname in which the merged result
-will be stored via placeholder `%P`.
-
+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.
`conflict-marker-size`
^^^^^^^^^^^^^^^^^^^^^^
This attribute controls the length of conflict markers left in
-the work tree file during a conflicted merge. Only setting to
-the value to a positive integer has any meaningful effect.
+the work tree file during a conflicted merge. Only a positive
+integer has a meaningful effect.
For example, this line in `.gitattributes` can be used to tell the merge
machinery to leave much longer (instead of the usual 7-character-long)
@@ -1155,7 +1208,7 @@ Unspecified::
String::
- Specify a comma separate list of common whitespace problems to
+ Specify a comma separated list of common whitespace problems to
notice in the same format as the `core.whitespace` configuration
variable.
diff --git a/Documentation/gitcli.txt b/Documentation/gitcli.txt
index 1819a5a..7c70932 100644
--- a/Documentation/gitcli.txt
+++ b/Documentation/gitcli.txt
@@ -23,10 +23,10 @@ arguments. Here are the rules:
A subcommand may take dashed options (which may take their own
arguments, e.g. "--max-parents 2") and arguments. You SHOULD
give dashed options first and then arguments. Some commands may
- accept dashed options after you have already gave non-option
+ accept dashed options after you have already given non-option
arguments (which may make the command ambiguous), but you should
not rely on it (because eventually we may find a way to fix
- these ambiguity by enforcing the "options then args" rule).
+ these ambiguities by enforcing the "options then args" rule).
* Revisions come first and then paths.
E.g. in `git diff v1.0 v2.0 arch/x86 include/asm-x86`,
@@ -37,12 +37,12 @@ arguments. Here are the rules:
they can be disambiguated by placing `--` between them.
E.g. `git diff -- HEAD` is, "I have a file called HEAD in my work
tree. Please show changes between the version I staged in the index
- and what I have in the work tree for that file", not "show difference
+ and what I have in the work tree for that file", not "show the difference
between the HEAD commit and the work tree as a whole". You can say
`git diff HEAD --` to ask for the latter.
* Without disambiguating `--`, Git makes a reasonable guess, but errors
- out and asking you to disambiguate when ambiguous. E.g. if you have a
+ out and asks you to disambiguate when ambiguous. E.g. if you have a
file called HEAD in your work tree, `git diff HEAD` is ambiguous, and
you have to say either `git diff HEAD --` or `git diff -- HEAD` to
disambiguate.
@@ -81,9 +81,6 @@ you will.
Here are the rules regarding the "flags" that you should follow when you are
scripting Git:
- * It's preferred to use the non-dashed form of Git commands, which means that
- you should prefer `git foo` to `git-foo`.
-
* Splitting short options to separate words (prefer `git foo -a -b`
to `git foo -ab`, the latter may not even work).
diff --git a/Documentation/gitcore-tutorial.txt b/Documentation/gitcore-tutorial.txt
index c0b9525..2122aeb 100644
--- a/Documentation/gitcore-tutorial.txt
+++ b/Documentation/gitcore-tutorial.txt
@@ -1089,7 +1089,7 @@ the remote repository URL in the local repository's config file
like this:
------------------------------------------------
-$ git config remote.linus.url http://www.kernel.org/pub/scm/git/git.git/
+$ git config remote.linus.url https://git.kernel.org/pub/scm/git/git.git/
------------------------------------------------
and use the "linus" keyword with 'git pull' instead of the full URL.
diff --git a/Documentation/gitcredentials.txt b/Documentation/gitcredentials.txt
index 80517b4..71dd197 100644
--- a/Documentation/gitcredentials.txt
+++ b/Documentation/gitcredentials.txt
@@ -17,9 +17,10 @@ DESCRIPTION
Git will sometimes need credentials from the user in order to perform
operations; for example, it may need to ask for a username and password
-in order to access a remote repository over HTTP. This manual describes
-the mechanisms Git uses to request these credentials, as well as some
-features to avoid inputting these credentials repeatedly.
+in order to access a remote repository over HTTP. Some remotes accept
+a personal access token or OAuth access token as a password. This
+manual describes the mechanisms Git uses to request these credentials,
+as well as some features to avoid inputting these credentials repeatedly.
REQUESTING CREDENTIALS
----------------------
@@ -61,7 +62,9 @@ for a password. It is generally configured by adding this to your config:
Credential helpers, on the other hand, are external programs from which Git can
request both usernames and passwords; they typically interface with secure
-storage provided by the OS or other programs.
+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:
@@ -101,6 +104,17 @@ $ git help credential-foo
$ git config --global credential.helper foo
-------------------------------------------
+=== Available helpers
+
+The community maintains a comprehensive list of Git credential helpers at
+https://git-scm.com/doc/credential-helpers.
+
+=== OAuth
+
+An alternative to inputting passwords or personal access tokens is to use an
+OAuth credential helper. Initial authentication opens a browser window to the
+host. Subsequent authentication happens in the background. Many popular Git
+hosts support OAuth.
CREDENTIAL CONTEXTS
-------------------
@@ -164,7 +178,7 @@ helper::
If there are multiple instances of the `credential.helper` configuration
variable, each helper will be tried in turn, and may provide a username,
password, or nothing. Once Git has acquired both a username and a
-password, no more helpers will be tried.
+non-expired password, no more helpers will be tried.
+
If `credential.helper` is configured to the empty string, this resets
the helper list to empty (so you may override a helper set by a
@@ -257,7 +271,7 @@ appended to its command line, which is one of:
`erase`::
- Remove a matching credential, if any, from the helper's storage.
+ Remove matching credentials, if any, from the helper's storage.
The details of the credential will be provided on the helper's stdin
stream. The exact format is the same as the input/output format of the
@@ -269,6 +283,7 @@ stdout in the same format (see linkgit:git-credential[1] for common
attributes). A helper is free to produce a subset, or even no values at
all if it has nothing useful to provide. Any provided attributes will
overwrite those already known about by Git's credential subsystem.
+Unrecognised attributes are silently discarded.
While it is possible to override all attributes, well behaving helpers
should refrain from doing so for any attribute other than username and
@@ -286,8 +301,8 @@ For a `store` or `erase` operation, the helper's output is ignored.
If a helper fails to perform the requested operation or needs to notify
the user of a potential issue, it may write to stderr.
-If it does not support the requested operation (e.g., a read-only store),
-it should silently ignore the request.
+If it does not support the requested operation (e.g., a read-only store
+or generator), it should silently ignore the request.
If a helper receives any other operation, it should silently ignore the
request. This leaves room for future operations to be added (older
diff --git a/Documentation/gitdiffcore.txt b/Documentation/gitdiffcore.txt
index 0d57f86..642c512 100644
--- a/Documentation/gitdiffcore.txt
+++ b/Documentation/gitdiffcore.txt
@@ -173,7 +173,7 @@ Note that when rename detection is on but both copy and break
detection are off, rename detection adds a preliminary step that first
checks if files are moved across directories while keeping their
filename the same. If there is a file added to a directory whose
-contents is sufficiently similar to a file with the same name that got
+contents are sufficiently similar to a file with the same name that got
deleted from a different directory, it will mark them as renames and
exclude them from the later quadratic step (the one that pairwise
compares all unmatched files to find the "best" matches, determined by
@@ -213,7 +213,7 @@ from the original, and does not count insertion. If you removed
only 10 lines from a 100-line document, even if you added 910
new lines to make a new 1000-line document, you did not do a
complete rewrite. diffcore-break breaks such a case in order to
-help diffcore-rename to consider such filepairs as candidate of
+help diffcore-rename to consider such filepairs as a candidate of
rename/copy detection, but if filepairs broken that way were not
matched with other filepairs to create rename/copy, then this
transformation merges them back into the original
@@ -230,13 +230,13 @@ like these:
* -B/60 (the same as above, since diffcore-break defaults to 50%).
-Note that earlier implementation left a broken pair as a separate
-creation and deletion patches. This was an unnecessary hack and
+Note that earlier implementation left a broken pair as separate
+creation and deletion patches. This was an unnecessary hack, and
the latest implementation always merges all the broken pairs
back into modifications, but the resulting patch output is
formatted differently for easier review in case of such
-a complete rewrite by showing the entire contents of old version
-prefixed with '-', followed by the entire contents of new
+a complete rewrite by showing the entire contents of the old version
+prefixed with '-', followed by the entire contents of the new
version prefixed with '+'.
@@ -245,25 +245,25 @@ diffcore-pickaxe: For Detecting Addition/Deletion of Specified String
This transformation limits the set of filepairs to those that change
specified strings between the preimage and the postimage in a certain
-way. -S<block of text> and -G<regular expression> options are used to
+way. -S<block-of-text> and -G<regular-expression> options are used to
specify different ways these strings are sought.
-"-S<block of text>" detects filepairs whose preimage and postimage
+"-S<block-of-text>" detects filepairs whose preimage and postimage
have different number of occurrences of the specified block of text.
By definition, it will not detect in-file moves. Also, when a
changeset moves a file wholesale without affecting the interesting
string, diffcore-rename kicks in as usual, and `-S` omits the filepair
(since the number of occurrences of that string didn't change in that
rename-detected filepair). When used with `--pickaxe-regex`, treat
-the <block of text> as an extended POSIX regular expression to match,
+the <block-of-text> as an extended POSIX regular expression to match,
instead of a literal string.
-"-G<regular expression>" (mnemonic: grep) detects filepairs whose
+"-G<regular-expression>" (mnemonic: grep) detects filepairs whose
textual diff has an added or a deleted line that matches the given
regular expression. This means that it will detect in-file (or what
rename-detection considers the same file) moves, which is noise. The
implementation runs diff twice and greps, and this can be quite
-expensive. To speed things up binary files without textconv filters
+expensive. To speed things up, binary files without textconv filters
will be ignored.
When `-S` or `-G` are used without `--pickaxe-all`, only filepairs
diff --git a/Documentation/giteveryday.txt b/Documentation/giteveryday.txt
index faba2ef..6cfdd0e 100644
--- a/Documentation/giteveryday.txt
+++ b/Documentation/giteveryday.txt
@@ -14,7 +14,7 @@ DESCRIPTION
-----------
Git users can broadly be grouped into four categories for the purposes of
-describing here a small set of useful command for everyday Git.
+describing here a small set of useful commands for everyday Git.
* <<STANDALONE,Individual Developer (Standalone)>> commands are essential
for anybody who makes a commit, even for somebody who works alone.
@@ -229,7 +229,7 @@ without a formal "merging". Or longhand +
git am -3 -k`
An alternate participant submission mechanism is using the
-`git request-pull` or pull-request mechanisms (e.g as used on
+`git request-pull` or pull-request mechanisms (e.g. as used on
GitHub (www.github.com) to notify your upstream of your
contribution.
diff --git a/Documentation/technical/bundle-format.txt b/Documentation/gitformat-bundle.txt
index b9be864..1b75cf7 100644
--- a/Documentation/technical/bundle-format.txt
+++ b/Documentation/gitformat-bundle.txt
@@ -1,11 +1,33 @@
-= Git bundle v2 format
+gitformat-bundle(5)
+===================
-The Git bundle format is a format that represents both refs and Git objects.
+NAME
+----
+gitformat-bundle - The bundle file format
+
+
+SYNOPSIS
+--------
+[verse]
+*.bundle
+*.bdl
+
+DESCRIPTION
+-----------
+
+The Git bundle format is a format that represents both refs and Git
+objects. A bundle is a header in a format similar to
+linkgit:git-show-ref[1] followed by a pack in *.pack format.
-== Format
+The format is created and read by the linkgit:git-bundle[1] command,
+and supported by e.g. linkgit:git-fetch[1] and linkgit:git-clone[1].
+
+
+FORMAT
+------
We will use ABNF notation to define the Git bundle format. See
-protocol-common.txt for the details.
+linkgit:gitprotocol-common[5] for the details.
A v2 bundle looks like this:
@@ -36,14 +58,16 @@ value = *(%01-09 / %0b-FF)
pack = ... ; packfile
----
-== Semantics
+
+SEMANTICS
+---------
A Git bundle consists of several parts.
* "Capabilities", which are only in the v3 format, indicate functionality that
the bundle requires to be read properly.
-* "Prerequisites" lists the objects that are NOT included in the bundle and the
+* "Prerequisites" list the objects that are NOT included in the bundle and the
reader of the bundle MUST already have, in order to use the data in the
bundle. The objects stored in the bundle may refer to prerequisite objects and
anything reachable from them (e.g. a tree object in the bundle can reference
@@ -62,13 +86,15 @@ In the bundle format, there can be a comment following a prerequisite obj-id.
This is a comment and it has no specific meaning. The writer of the bundle MAY
put any string here. The reader of the bundle MUST ignore the comment.
-=== Note on the shallow clone and a Git bundle
+Note on shallow clones and Git bundles
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Note that the prerequisites does not represent a shallow-clone boundary. The
+Note that the prerequisites do not represent a shallow-clone boundary. The
semantics of the prerequisites and the shallow-clone boundaries are different,
and the Git bundle v2 format cannot represent a shallow clone repository.
-== Capabilities
+CAPABILITIES
+------------
Because there is no opportunity for negotiation, unknown capabilities cause 'git
bundle' to abort.
@@ -79,3 +105,7 @@ bundle' to abort.
* `filter` specifies an object filter as in the `--filter` option in
linkgit:git-rev-list[1]. The resulting pack-file must be marked as a
`.promisor` pack-file after it is unbundled.
+
+GIT
+---
+Part of the linkgit:git[1] suite
diff --git a/Documentation/technical/chunk-format.txt b/Documentation/gitformat-chunk.txt
index 593614f..3315df6 100644
--- a/Documentation/technical/chunk-format.txt
+++ b/Documentation/gitformat-chunk.txt
@@ -1,12 +1,25 @@
-Chunk-based file formats
-========================
+gitformat-chunk(5)
+==================
+
+NAME
+----
+gitformat-chunk - Chunk-based file formats
+
+SYNOPSIS
+--------
+
+Used by linkgit:gitformat-commit-graph[5] and the "MIDX" format (see
+the pack format documentation in linkgit:gitformat-pack[5]).
+
+DESCRIPTION
+-----------
Some file formats in Git use a common concept of "chunks" to describe
sections of the file. This allows structured access to a large file by
scanning a small "table of contents" for the remaining data. This common
format is used by the `commit-graph` and `multi-pack-index` files. See
-link:technical/pack-format.html[the `multi-pack-index` format] and
-link:technical/commit-graph-format.html[the `commit-graph` format] for
+the `multi-pack-index` format in linkgit:gitformat-pack[5] and
+the `commit-graph` format in linkgit:gitformat-commit-graph[5] for
how they use the chunks to describe structured data.
A chunk-based file format begins with some header information custom to
@@ -29,7 +42,7 @@ Each row consists of a 4-byte chunk identifier (ID) and an 8-byte offset.
Each integer is stored in network-byte order.
The chunk identifier `ID[i]` is a label for the data stored within this
-fill from `OFFSET[i]` (inclusive) to `OFFSET[i+1]` (exclusive). Thus, the
+file from `OFFSET[i]` (inclusive) to `OFFSET[i+1]` (exclusive). Thus, the
size of the `i`th chunk is equal to the difference between `OFFSET[i+1]`
and `OFFSET[i]`. This requires that the chunk data appears contiguously
in the same order as the table of contents.
@@ -54,7 +67,7 @@ caller is responsible for opening the `hashfile` and writing header
information so the file format is identifiable before the chunk-based
format begins.
-Then, call `add_chunk()` for each chunk that is intended for write. This
+Then, call `add_chunk()` for each chunk that is intended for writing. This
populates the `chunkfile` with information about the order and size of
each chunk to write. Provide a `chunk_write_fn` function pointer to
perform the write of the chunk data upon request.
@@ -108,9 +121,13 @@ for future formats:
* *commit-graph:* see `write_commit_graph_file()` and `parse_commit_graph()`
in `commit-graph.c` for how the chunk-format API is used to write and
parse the commit-graph file format documented in
- link:technical/commit-graph-format.html[the commit-graph file format].
+ the commit-graph file format in linkgit:gitformat-commit-graph[5].
* *multi-pack-index:* see `write_midx_internal()` and `load_multi_pack_index()`
in `midx.c` for how the chunk-format API is used to write and
parse the multi-pack-index file format documented in
- link:technical/pack-format.html[the multi-pack-index file format].
+ the multi-pack-index file format section of linkgit:gitformat-pack[5].
+
+GIT
+---
+Part of the linkgit:git[1] suite
diff --git a/Documentation/technical/commit-graph-format.txt b/Documentation/gitformat-commit-graph.txt
index 484b185..31cad58 100644
--- a/Documentation/technical/commit-graph-format.txt
+++ b/Documentation/gitformat-commit-graph.txt
@@ -1,7 +1,20 @@
-Git commit graph format
-=======================
+gitformat-commit-graph(5)
+=========================
-The Git commit graph stores a list of commit OIDs and some associated
+NAME
+----
+gitformat-commit-graph - Git commit-graph format
+
+SYNOPSIS
+--------
+[verse]
+$GIT_DIR/objects/info/commit-graph
+$GIT_DIR/objects/info/commit-graphs/*
+
+DESCRIPTION
+-----------
+
+The Git commit-graph stores a list of commit OIDs and some associated
metadata, including:
- The generation number of the commit.
@@ -21,7 +34,7 @@ corresponding to the array position within the list of commit OIDs. Due
to some special constants we use to track parents, we can store at most
(1 << 30) + (1 << 29) + (1 << 28) - 1 (around 1.8 billion) commits.
-== Commit graph files have the following format:
+== Commit-graph files have the following format:
In order to allow extensions that add extra data to the graph, we organize
the body into "chunks" and provide a binary lookup table at the beginning
@@ -30,7 +43,7 @@ and hash type.
All multi-byte numbers are in network byte order.
-HEADER:
+=== HEADER:
4-byte signature:
The signature is: {'C', 'G', 'P', 'H'}
@@ -52,7 +65,7 @@ HEADER:
We infer the length (H*B) of the Base Graphs chunk
from this value.
-CHUNK LOOKUP:
+=== CHUNK LOOKUP:
(C + 1) * 12 bytes listing the table of contents for the chunks:
First 4 bytes describe the chunk id. Value 0 is a terminating label.
@@ -62,23 +75,23 @@ CHUNK LOOKUP:
ID appears at most once.
The CHUNK LOOKUP matches the table of contents from
- link:technical/chunk-format.html[the chunk-based file format].
+ the chunk-based file format, see linkgit:gitformat-chunk[5]
The remaining data in the body is described one chunk at a time, and
these chunks may be given in any order. Chunks are required unless
otherwise specified.
-CHUNK DATA:
+=== CHUNK DATA:
- OID Fanout (ID: {'O', 'I', 'D', 'F'}) (256 * 4 bytes)
+==== OID Fanout (ID: {'O', 'I', 'D', 'F'}) (256 * 4 bytes)
The ith entry, F[i], stores the number of OIDs with first
byte at most i. Thus F[255] stores the total
number of commits (N).
- OID Lookup (ID: {'O', 'I', 'D', 'L'}) (N * H bytes)
+==== OID Lookup (ID: {'O', 'I', 'D', 'L'}) (N * H bytes)
The OIDs for all commits in the graph, sorted in ascending order.
- Commit Data (ID: {'C', 'D', 'A', 'T' }) (N * (H + 16) bytes)
+==== Commit Data (ID: {'C', 'D', 'A', 'T' }) (N * (H + 16) bytes)
* The first H bytes are for the OID of the root tree.
* The next 8 bytes are for the positions of the first two parents
of the ith commit. Stores value 0x70000000 if no parent in that
@@ -93,7 +106,7 @@ CHUNK DATA:
2 bits of the lowest byte, storing the 33rd and 34th bit of the
commit time.
- Generation Data (ID: {'G', 'D', 'A', '2' }) (N * 4 bytes) [Optional]
+==== Generation Data (ID: {'G', 'D', 'A', '2' }) (N * 4 bytes) [Optional]
* This list of 4-byte values store corrected commit date offsets for the
commits, arranged in the same order as commit data chunk.
* If the corrected commit date offset cannot be stored within 31 bits,
@@ -104,7 +117,7 @@ CHUNK DATA:
by compatible versions of Git and in case of split commit-graph chains,
the topmost layer also has Generation Data chunk.
- Generation Data Overflow (ID: {'G', 'D', 'O', '2' }) [Optional]
+==== Generation Data Overflow (ID: {'G', 'D', 'O', '2' }) [Optional]
* This list of 8-byte values stores the corrected commit date offsets
for commits with corrected commit date offsets that cannot be
stored within 31 bits.
@@ -112,7 +125,7 @@ CHUNK DATA:
chunk is present and atleast one corrected commit date offset cannot
be stored within 31 bits.
- Extra Edge List (ID: {'E', 'D', 'G', 'E'}) [Optional]
+==== Extra Edge List (ID: {'E', 'D', 'G', 'E'}) [Optional]
This list of 4-byte values store the second through nth parents for
all octopus merges. The second parent value in the commit data stores
an array position within this list along with the most-significant bit
@@ -120,14 +133,14 @@ CHUNK DATA:
positions for the parents until reaching a value with the most-significant
bit on. The other bits correspond to the position of the last parent.
- Bloom Filter Index (ID: {'B', 'I', 'D', 'X'}) (N * 4 bytes) [Optional]
+==== Bloom Filter Index (ID: {'B', 'I', 'D', 'X'}) (N * 4 bytes) [Optional]
* The ith entry, BIDX[i], stores the number of bytes in all Bloom filters
from commit 0 to commit i (inclusive) in lexicographic order. The Bloom
filter for the i-th commit spans from BIDX[i-1] to BIDX[i] (plus header
length), where BIDX[-1] is 0.
* The BIDX chunk is ignored if the BDAT chunk is not present.
- Bloom Filter Data (ID: {'B', 'D', 'A', 'T'}) [Optional]
+==== Bloom Filter Data (ID: {'B', 'D', 'A', 'T'}) [Optional]
* It starts with header consisting of three unsigned 32-bit integers:
- Version of the hash algorithm being used. We currently only support
value 1 which corresponds to the 32-bit version of the murmur3 hash
@@ -147,13 +160,13 @@ CHUNK DATA:
of length one, with either all bits set to zero or one respectively.
* The BDAT chunk is present if and only if BIDX is present.
- Base Graphs List (ID: {'B', 'A', 'S', 'E'}) [Optional]
+==== Base Graphs List (ID: {'B', 'A', 'S', 'E'}) [Optional]
This list of H-byte hashes describe a set of B commit-graph files that
form a commit-graph chain. The graph position for the ith commit in this
file's OID Lookup chunk is equal to i plus the number of commits in all
base graphs. If B is non-zero, this chunk must exist.
-TRAILER:
+=== TRAILER:
H-byte HASH-checksum of all of the above.
@@ -164,3 +177,7 @@ the number '2' in their chunk IDs because a previous version of Git wrote
possibly erroneous data in these chunks with the IDs "GDAT" and "GDOV". By
changing the IDs, newer versions of Git will silently ignore those older
chunks and write the new information without trusting the incorrect data.
+
+GIT
+---
+Part of the linkgit:git[1] suite
diff --git a/Documentation/technical/index-format.txt b/Documentation/gitformat-index.txt
index f691c20..145cace 100644
--- a/Documentation/technical/index-format.txt
+++ b/Documentation/gitformat-index.txt
@@ -1,5 +1,19 @@
+gitformat-index(5)
+==================
+
+NAME
+----
+gitformat-index - Git index format
+
+SYNOPSIS
+--------
+[verse]
+$GIT_DIR/index
+
+DESCRIPTION
+-----------
+
Git index format
-================
== The Git index file has the following format
@@ -69,11 +83,13 @@ Git index format
32-bit mode, split into (high to low bits)
+ 16-bit unused, must be zero
+
4-bit object type
valid values in binary are 1000 (regular file), 1010 (symbolic link)
and 1110 (gitlink)
- 3-bit unused
+ 3-bit unused, must be zero
9-bit unix permission. Only 0755 and 0644 are valid for regular files.
Symbolic links and gitlinks have value 0 in this field.
@@ -125,7 +141,7 @@ Git index format
entry is encoded as if the path name for the previous entry is an
empty string). At the beginning of an entry, an integer N in the
variable width encoding (the same encoding as the offset is encoded
- for OFS_DELTA pack entries; see pack-format.txt) is stored, followed
+ for OFS_DELTA pack entries; see linkgit:gitformat-pack[5]) is stored, followed
by a NUL-terminated string S. Removing N bytes from the end of the
path name for the previous entry, and replacing it with the string S
yields the path name for this entry.
@@ -370,8 +386,8 @@ The remaining data of each directory block is grouped by type:
long, "REUC" extension that is M-bytes long, followed by "EOIE",
then the hash would be:
- Hash("TREE" + <binary representation of N> +
- "REUC" + <binary representation of M>)
+ Hash("TREE" + <binary-representation-of-N> +
+ "REUC" + <binary-representation-of-M>)
== Index Entry Offset Table
@@ -402,3 +418,7 @@ The remaining data of each directory block is grouped by type:
with signature { 's', 'd', 'i', 'r' }. Like the split-index extension,
tools should avoid interacting with a sparse index unless they understand
this extension.
+
+GIT
+---
+Part of the linkgit:git[1] suite
diff --git a/Documentation/technical/pack-format.txt b/Documentation/gitformat-pack.txt
index b520aa9..d6ae229 100644
--- a/Documentation/technical/pack-format.txt
+++ b/Documentation/gitformat-pack.txt
@@ -1,5 +1,30 @@
-Git pack format
-===============
+gitformat-pack(5)
+=================
+
+NAME
+----
+gitformat-pack - Git pack format
+
+
+SYNOPSIS
+--------
+[verse]
+$GIT_DIR/objects/pack/pack-*.{pack,idx}
+$GIT_DIR/objects/pack/pack-*.rev
+$GIT_DIR/objects/pack/pack-*.mtimes
+$GIT_DIR/objects/pack/multi-pack-index
+
+DESCRIPTION
+-----------
+
+The Git pack format is how Git stores most of its primary repository
+data. Over the lifetime of a repository, loose objects (if any) and
+smaller packs are consolidated into larger pack(s). See
+linkgit:git-gc[1] and linkgit:git-pack-objects[1].
+
+The pack format is also used over-the-wire, see
+e.g. linkgit:gitprotocol-v2[5], as well as being a part of
+other container formats in the case of linkgit:gitformat-bundle[5].
== Checksums and object IDs
@@ -23,7 +48,7 @@ Similarly, in SHA-256 repositories, these values are computed using SHA-256.
Observation: we cannot have more than 4G versions ;-) and
more than 4G objects in a pack.
- - The header is followed by number of object entries, each of
+ - The header is followed by a number of object entries, each of
which looks like this:
(undeltified representation)
@@ -37,7 +62,7 @@ Similarly, in SHA-256 repositories, these values are computed using SHA-256.
is an OBJ_OFS_DELTA object
compressed delta data
- Observation: length of each object is encoded in a variable
+ Observation: the length of each object is encoded in a variable
length format and is not constrained to 32-bit or anything.
- The trailer records a pack checksum of all of the above.
@@ -92,7 +117,7 @@ the delta data is a sequence of instructions to reconstruct the object
from the base object. If the base object is deltified, it must be
converted to canonical form first. Each instruction appends more and
more data to the target object until it's complete. There are two
-supported instructions so far: one for copy a byte range from the
+supported instructions so far: one for copying a byte range from the
source object and one for inserting new data embedded in the
instruction itself.
@@ -112,7 +137,7 @@ copy. Offset and size are in little-endian order.
All offset and size bytes are optional. This is to reduce the
instruction size when encoding small offsets or sizes. The first seven
-bits in the first octet determines which of the next seven octets is
+bits in the first octet determine which of the next seven octets is
present. If bit zero is set, offset1 is present. If bit one is set
offset2 is present and so on.
@@ -136,9 +161,9 @@ converted to 0x10000.
| 0xxxxxxx | data |
+----------+============+
-This is the instruction to construct target object without the base
+This is the instruction to construct the target object without the base
object. The following data is appended to the target object. The first
-seven bits of the first octet determines the size of data in
+seven bits of the first octet determine the size of data in
bytes. The size must be non-zero.
==== Reserved instruction
@@ -269,7 +294,7 @@ Pack file entry: <+
- The same trailer as a v1 pack file:
- A copy of the pack checksum at the end of
+ A copy of the pack checksum at the end of the
corresponding packfile.
Index checksum of all of the above.
@@ -356,7 +381,7 @@ CHUNK LOOKUP:
using the next chunk position if necessary.)
The CHUNK LOOKUP matches the table of contents from
- link:technical/chunk-format.html[the chunk-based file format].
+ the chunk-based file format, see linkgit:gitformat-chunk[5].
The remaining data in the body is described one chunk at a time, and
these chunks may be given in any order. Chunks are required unless
@@ -365,10 +390,20 @@ CHUNK LOOKUP:
CHUNK DATA:
Packfile Names (ID: {'P', 'N', 'A', 'M'})
- Stores the packfile names as concatenated, null-terminated strings.
- Packfiles must be listed in lexicographic order for fast lookups by
- name. This is the only chunk not guaranteed to be a multiple of four
- bytes in length, so should be the last chunk for alignment reasons.
+ Store the names of packfiles as a sequence of NUL-terminated
+ strings. There is no extra padding between the filenames,
+ and they are listed in lexicographic order. The chunk itself
+ is padded at the end with between 0 and 3 NUL bytes to make the
+ chunk size a multiple of 4 bytes.
+
+ Bitmapped Packfiles (ID: {'B', 'T', 'M', 'P'})
+ Stores a table of two 4-byte unsigned integers in network order.
+ Each table entry corresponds to a single pack (in the order that
+ they appear above in the `PNAM` chunk). The values for each table
+ entry are as follows:
+ - The first bit position (in pseudo-pack order, see below) to
+ contain an object from that pack.
+ - The number of bits whose objects are selected from that pack.
OID Fanout (ID: {'O', 'I', 'D', 'F'})
The ith entry, F[i], stores the number of OIDs with first
@@ -482,3 +517,165 @@ packs arranged in MIDX order (with the preferred pack coming first).
The MIDX's reverse index is stored in the optional 'RIDX' chunk within
the MIDX itself.
+
+=== `BTMP` chunk
+
+The Bitmapped Packfiles (`BTMP`) chunk encodes additional information
+about the objects in the multi-pack index's reachability bitmap. Recall
+that objects from the MIDX are arranged in "pseudo-pack" order (see
+above) for reachability bitmaps.
+
+From the example above, suppose we have packs "a", "b", and "c", with
+10, 15, and 20 objects, respectively. In pseudo-pack order, those would
+be arranged as follows:
+
+ |a,0|a,1|...|a,9|b,0|b,1|...|b,14|c,0|c,1|...|c,19|
+
+When working with single-pack bitmaps (or, equivalently, multi-pack
+reachability bitmaps with a preferred pack), linkgit:git-pack-objects[1]
+performs ``verbatim'' reuse, attempting to reuse chunks of the bitmapped
+or preferred packfile instead of adding objects to the packing list.
+
+When a chunk of bytes is reused from an existing pack, any objects
+contained therein do not need to be added to the packing list, saving
+memory and CPU time. But a chunk from an existing packfile can only be
+reused when the following conditions are met:
+
+ - The chunk contains only objects which were requested by the caller
+ (i.e. does not contain any objects which the caller didn't ask for
+ explicitly or implicitly).
+
+ - All objects stored in non-thin packs as offset- or reference-deltas
+ also include their base object in the resulting pack.
+
+The `BTMP` chunk encodes the necessary information in order to implement
+multi-pack reuse over a set of packfiles as described above.
+Specifically, the `BTMP` chunk encodes three pieces of information (all
+32-bit unsigned integers in network byte-order) for each packfile `p`
+that is stored in the MIDX, as follows:
+
+`bitmap_pos`:: The first bit position (in pseudo-pack order) in the
+ multi-pack index's reachability bitmap occupied by an object from `p`.
+
+`bitmap_nr`:: The number of bit positions (including the one at
+ `bitmap_pos`) that encode objects from that pack `p`.
+
+For example, the `BTMP` chunk corresponding to the above example (with
+packs ``a'', ``b'', and ``c'') would look like:
+
+[cols="1,2,2"]
+|===
+| |`bitmap_pos` |`bitmap_nr`
+
+|packfile ``a''
+|`0`
+|`10`
+
+|packfile ``b''
+|`10`
+|`15`
+
+|packfile ``c''
+|`25`
+|`20`
+|===
+
+With this information in place, we can treat each packfile as
+individually reusable in the same fashion as verbatim pack reuse is
+performed on individual packs prior to the implementation of the `BTMP`
+chunk.
+
+== cruft packs
+
+The cruft packs feature offer an alternative to Git's traditional mechanism of
+removing unreachable objects. This document provides an overview of Git's
+pruning mechanism, and how a cruft pack can be used instead to accomplish the
+same.
+
+=== Background
+
+To remove unreachable objects from your repository, Git offers `git repack -Ad`
+(see linkgit:git-repack[1]). Quoting from the documentation:
+
+----
+[...] unreachable objects in a previous pack become loose, unpacked objects,
+instead of being left in the old pack. [...] loose unreachable objects will be
+pruned according to normal expiry rules with the next 'git gc' invocation.
+----
+
+Unreachable objects aren't removed immediately, since doing so could race with
+an incoming push which may reference an object which is about to be deleted.
+Instead, those unreachable objects are stored as loose objects and stay that way
+until they are older than the expiration window, at which point they are removed
+by linkgit:git-prune[1].
+
+Git must store these unreachable objects loose in order to keep track of their
+per-object mtimes. If these unreachable objects were written into one big pack,
+then either freshening that pack (because an object contained within it was
+re-written) or creating a new pack of unreachable objects would cause the pack's
+mtime to get updated, and the objects within it would never leave the expiration
+window. Instead, objects are stored loose in order to keep track of the
+individual object mtimes and avoid a situation where all cruft objects are
+freshened at once.
+
+This can lead to undesirable situations when a repository contains many
+unreachable objects which have not yet left the grace period. Having large
+directories in the shards of `.git/objects` can lead to decreased performance in
+the repository. But given enough unreachable objects, this can lead to inode
+starvation and degrade the performance of the whole system. Since we
+can never pack those objects, these repositories often take up a large amount of
+disk space, since we can only zlib compress them, but not store them in delta
+chains.
+
+=== Cruft packs
+
+A cruft pack eliminates the need for storing unreachable objects in a loose
+state by including the per-object mtimes in a separate file alongside a single
+pack containing all loose objects.
+
+A cruft pack is written by `git repack --cruft` when generating a new pack.
+linkgit:git-pack-objects[1]'s `--cruft` option. Note that `git repack --cruft`
+is a classic all-into-one repack, meaning that everything in the resulting pack is
+reachable, and everything else is unreachable. Once written, the `--cruft`
+option instructs `git repack` to generate another pack containing only objects
+not packed in the previous step (which equates to packing all unreachable
+objects together). This progresses as follows:
+
+ 1. Enumerate every object, marking any object which is (a) not contained in a
+ kept-pack, and (b) whose mtime is within the grace period as a traversal
+ tip.
+
+ 2. Perform a reachability traversal based on the tips gathered in the previous
+ step, adding every object along the way to the pack.
+
+ 3. Write the pack out, along with a `.mtimes` file that records the per-object
+ timestamps.
+
+This mode is invoked internally by linkgit:git-repack[1] when instructed to
+write a cruft pack. Crucially, the set of in-core kept packs is exactly the set
+of packs which will not be deleted by the repack; in other words, they contain
+all of the repository's reachable objects.
+
+When a repository already has a cruft pack, `git repack --cruft` typically only
+adds objects to it. An exception to this is when `git repack` is given the
+`--cruft-expiration` option, which allows the generated cruft pack to omit
+expired objects instead of waiting for linkgit:git-gc[1] to expire those objects
+later on.
+
+It is linkgit:git-gc[1] that is typically responsible for removing expired
+unreachable objects.
+
+=== Alternatives
+
+Notable alternatives to this design include:
+
+ - The location of the per-object mtime data.
+
+On the location of mtime data, a new auxiliary file tied to the pack was chosen
+to avoid complicating the `.idx` format. If the `.idx` format were ever to gain
+support for optional chunks of data, it may make sense to consolidate the
+`.mtimes` format into the `.idx` itself.
+
+GIT
+---
+Part of the linkgit:git[1] suite
diff --git a/Documentation/technical/signature-format.txt b/Documentation/gitformat-signature.txt
index 166721b..d4d3a31 100644
--- a/Documentation/technical/signature-format.txt
+++ b/Documentation/gitformat-signature.txt
@@ -1,17 +1,40 @@
-Git signature format
-====================
+gitformat-signature(5)
+======================
-== Overview
+NAME
+----
+gitformat-signature - Git cryptographic signature formats
+
+SYNOPSIS
+--------
+[verse]
+<[tag|commit] object header(s)>
+<over-the-wire protocol>
+
+DESCRIPTION
+-----------
Git uses cryptographic signatures in various places, currently objects (tags,
commits, mergetags) and transactions (pushes). In every case, the command which
is about to create an object or transaction determines a payload from that,
-calls gpg to obtain a detached signature for the payload (`gpg -bsa`) and
-embeds the signature into the object or transaction.
+calls an external program to obtain a detached signature for the payload
+(`gpg -bsa` in the case of PGP signatures), and embeds the signature into the
+object or transaction.
+
+Signatures begin with an "ASCII Armor" header line and end with a tail line,
+which differ depending on signature type (as selected by `gpg.format`, see
+linkgit:git-config[1]). These are, for `gpg.format` values:
-Signatures always begin with `-----BEGIN PGP SIGNATURE-----`
-and end with `-----END PGP SIGNATURE-----`, unless gpg is told to
-produce RFC1991 signatures which use `MESSAGE` instead of `SIGNATURE`.
+`gpg` (PGP)::
+ `-----BEGIN PGP SIGNATURE-----` and `-----END PGP SIGNATURE-----`.
+ Or, if gpg is told to produce RFC1991 signatures,
+ `-----BEGIN PGP MESSAGE-----` and `-----END PGP MESSAGE-----`
+
+`ssh` (SSH)::
+ `-----BEGIN SSH SIGNATURE-----` and `-----END SSH SIGNATURE-----`
+
+`x509` (X.509)::
+ `-----BEGIN SIGNED MESSAGE-----` and `-----END SIGNED MESSAGE-----`
Signatures sometimes appear as a part of the normal payload
(e.g. a signed tag has the signature block appended after the payload
@@ -26,7 +49,7 @@ line.
This is even true for an originally empty line. In the following
examples, the end of line that ends with a whitespace letter is
highlighted with a `$` sign; if you are trying to recreate these
-example by hand, do not cut and paste them---they are there
+example by hand, do not cut and paste them--they are there
primarily to highlight extra whitespace at the end of some lines.
The signed payload and the way the signature is embedded depends
@@ -200,3 +223,7 @@ Date: Wed Jun 15 09:13:29 2016 +0000
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: D4BE 2231 1AD3 131E 5EDA 29A4 6109 2E85 B722 7189
----
+
+GIT
+---
+Part of the linkgit:git[1] suite
diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
index a16e62b..ee9b92c 100644
--- a/Documentation/githooks.txt
+++ b/Documentation/githooks.txt
@@ -27,6 +27,18 @@ repository. An exception are hooks triggered during a push ('pre-receive',
'update', 'post-receive', 'post-update', 'push-to-checkout') which are always
executed in $GIT_DIR.
+Environment variables, such as `GIT_DIR`, `GIT_WORK_TREE`, etc., are exported
+so that Git commands run by the hook can correctly locate the repository. If
+your hook needs to invoke Git commands in a foreign repository or in a
+different working tree of the same repository, then it should clear these
+environment variables so they do not interfere with Git operations at the
+foreign location. For example:
+
+------------
+local_desc=$(git describe)
+foreign_desc=$(unset $(git rev-parse --local-env-vars); git -C ../foreign-repo describe)
+------------
+
Hooks can get their arguments via the environment, command-line
arguments, and stdin. See the documentation for each hook below for
details.
@@ -68,7 +80,7 @@ If it exits with non-zero status, then the working tree will not be
committed after applying the patch.
It can be used to inspect the current working tree and refuse to
-make a commit if it does not pass certain test.
+make a commit if it does not pass certain tests.
The default 'pre-applypatch' hook, when enabled, runs the
'pre-commit' hook, if the latter is enabled.
@@ -145,7 +157,7 @@ If the exit status is non-zero, `git commit` will abort.
The purpose of the hook is to edit the message file in place, and
it is not suppressed by the `--no-verify` option. A non-zero exit
means a failure of the hook and aborts the commit. It should not
-be used as replacement for pre-commit hook.
+be used as a replacement for the pre-commit hook.
The sample `prepare-commit-msg` hook that comes with Git removes the
help message found in the commented portion of the commit template.
@@ -231,7 +243,7 @@ named remote is not being used both values will be the same.
Information about what is to be pushed is provided on the hook's standard
input with lines of the form:
- <local ref> SP <local object name> SP <remote ref> SP <remote object name> LF
+ <local-ref> SP <local-object-name> SP <remote-ref> SP <remote-object-name> LF
For instance, if the command +git push origin master:foreign+ were run the
hook would receive a line like the following:
@@ -239,9 +251,9 @@ hook would receive a line like the following:
refs/heads/master 67890 refs/heads/foreign 12345
although the full object name would be supplied. If the foreign ref does not
-yet exist the `<remote object name>` will be the all-zeroes object name. If a
-ref is to be deleted, the `<local ref>` will be supplied as `(delete)` and the
-`<local object name>` will be the all-zeroes object name. If the local commit
+yet exist the `<remote-object-name>` will be the all-zeroes object name. If a
+ref is to be deleted, the `<local-ref>` will be supplied as `(delete)` and the
+`<local-object-name>` will be the all-zeroes object name. If the local commit
was specified by something other than a name which could be expanded (such as
`HEAD~`, or an object name) it will be supplied as it was originally given.
@@ -263,12 +275,12 @@ This hook executes once for the receive operation. It takes no
arguments, but for each ref to be updated it receives on standard
input a line of the format:
- <old-value> SP <new-value> SP <ref-name> LF
+ <old-oid> SP <new-oid> SP <ref-name> LF
-where `<old-value>` is the old object name stored in the ref,
-`<new-value>` is the new object name to be stored in the ref and
+where `<old-oid>` is the old object name stored in the ref,
+`<new-oid>` is the new object name to be stored in the ref and
`<ref-name>` is the full name of the ref.
-When creating a new ref, `<old-value>` is the all-zeroes object name.
+When creating a new ref, `<old-oid>` is the all-zeroes object name.
If the hook exits with non-zero status, none of the refs will be
updated. If the hook exits with zero, updating of individual refs can
@@ -333,7 +345,7 @@ for the user.
The default 'update' hook, when enabled--and with
`hooks.allowunannotated` config option unset or set to false--prevents
-unannotated tags to be pushed.
+unannotated tags from being pushed.
[[proc-receive]]
proc-receive
@@ -367,12 +379,12 @@ following example for the protocol, the letter 'S' stands for
S: ... ...
S: flush-pkt
- # Receive result from the hook.
+ # Receive results from the hook.
# OK, run this command successfully.
H: PKT-LINE(ok <ref>)
# NO, I reject it.
H: PKT-LINE(ng <ref> <reason>)
- # Fall through, let 'receive-pack' to execute it.
+ # Fall through, let 'receive-pack' execute it.
H: PKT-LINE(ok <ref>)
H: PKT-LINE(option fall-through)
# OK, but has an alternate reference. The alternate reference name
@@ -491,13 +503,13 @@ given reference transaction is in:
For each reference update that was added to the transaction, the hook
receives on standard input a line of the format:
- <old-value> SP <new-value> SP <ref-name> LF
+ <old-oid> SP <new-oid> SP <ref-name> LF
-where `<old-value>` is the old object name passed into the reference
-transaction, `<new-value>` is the new object name to be stored in the
+where `<old-oid>` is the old object name passed into the reference
+transaction, `<new-oid>` is the new object name to be stored in the
ref and `<ref-name>` is the full name of the ref. When force updating
the reference regardless of its current value or when the reference is
-to be created anew, `<old-value>` is the all-zeroes object name. To
+to be created anew, `<old-oid>` is the all-zeroes object name. To
distinguish these cases, you can inspect the current value of
`<ref-name>` via `git rev-parse`.
@@ -583,10 +595,51 @@ processed by rebase.
sendemail-validate
~~~~~~~~~~~~~~~~~~
-This hook is invoked by linkgit:git-send-email[1]. It takes a single parameter,
-the name of the file that holds the e-mail to be sent. Exiting with a
-non-zero status causes `git send-email` to abort before sending any
-e-mails.
+This hook is invoked by linkgit:git-send-email[1].
+
+It takes these command line arguments. They are,
+1. the name of the file which holds the contents of the email to be sent.
+2. The name of the file which holds the SMTP headers of the email.
+
+The SMTP headers are passed in the exact same way as they are passed to the
+user's Mail Transport Agent (MTA). In effect, the email given to the user's
+MTA, is the contents of $2 followed by the contents of $1.
+
+An example of a few common headers is shown below. Take notice of the
+capitalization and multi-line tab structure.
+
+ From: Example <from@example.com>
+ To: to@example.com
+ Cc: cc@example.com,
+ A <author@example.com>,
+ One <one@example.com>,
+ two@example.com
+ Subject: PATCH-STRING
+
+Exiting with a non-zero status causes `git send-email` to abort
+before sending any e-mails.
+
+The following environment variables are set when executing the hook.
+
+`GIT_SENDEMAIL_FILE_COUNTER`::
+ A 1-based counter incremented by one for every file holding an e-mail
+ to be sent (excluding any FIFOs). This counter does not follow the
+ patch series counter scheme. It will always start at 1 and will end at
+ GIT_SENDEMAIL_FILE_TOTAL.
+
+`GIT_SENDEMAIL_FILE_TOTAL`::
+ The total number of files that will be sent (excluding any FIFOs). This
+ counter does not follow the patch series counter scheme. It will always
+ be equal to the number of files being sent, whether there is a cover
+ letter or not.
+
+These variables may for instance be used to validate patch series.
+
+The sample `sendemail-validate` hook that comes with Git checks that all sent
+patches (excluding the cover letter) can be applied on top of the upstream
+repository default branch without conflicts. Some placeholders are left for
+additional validation steps to be performed after all patches of a given series
+have been applied.
fsmonitor-watchman
~~~~~~~~~~~~~~~~~~
diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
index f2738b1..5e0964e 100644
--- a/Documentation/gitignore.txt
+++ b/Documentation/gitignore.txt
@@ -88,7 +88,7 @@ PATTERN FORMAT
Put a backslash ("`\`") in front of the first "`!`" for patterns
that begin with a literal "`!`", for example, "`\!important!.txt`".
- - The slash '/' is used as the directory separator. Separators may
+ - The slash "`/`" is used as the directory separator. Separators may
occur at the beginning, middle or end of the `.gitignore` search pattern.
- If there is a separator at the beginning or middle (or both) of the
@@ -146,7 +146,9 @@ The purpose of gitignore files is to ensure that certain files
not tracked by Git remain untracked.
To stop tracking a file that is currently tracked, use
-'git rm --cached'.
+'git rm --cached' to remove the file from the index. The filename
+can then be added to the `.gitignore` file to stop the file from
+being reintroduced in later commits.
Git does not follow symbolic links when accessing a `.gitignore` file in
the working tree. This keeps behavior consistent when the file is
@@ -172,10 +174,10 @@ EXAMPLES
is not relevant if there is already a middle slash in
the pattern.
- - The pattern "foo/*", matches "foo/test.json"
- (a regular file), "foo/bar" (a directory), but it does not match
- "foo/bar/hello.c" (a regular file), as the asterisk in the
- pattern does not match "bar/hello.c" which has a slash in it.
+ - The pattern `foo/*`, matches `foo/test.json`
+ (a regular file), `foo/bar` (a directory), but it does not match
+ `foo/bar/hello.c` (a regular file), as the asterisk in the
+ pattern does not match `bar/hello.c` which has a slash in it.
--------------------------------------------------------------
$ git status
diff --git a/Documentation/gitk.txt b/Documentation/gitk.txt
index d50e9ed..35b3996 100644
--- a/Documentation/gitk.txt
+++ b/Documentation/gitk.txt
@@ -8,7 +8,7 @@ gitk - The Git repository browser
SYNOPSIS
--------
[verse]
-'gitk' [<options>] [<revision range>] [--] [<path>...]
+'gitk' [<options>] [<revision-range>] [--] [<path>...]
DESCRIPTION
-----------
@@ -26,7 +26,7 @@ changes each commit introduces are shown. Finally, it supports some
gitk-specific options.
gitk generally only understands options with arguments in the
-'sticked' form (see linkgit:gitcli[7]) due to limitations in the
+'stuck' form (see linkgit:gitcli[7]) due to limitations in the
command-line parser.
rev-list options and arguments
@@ -124,7 +124,7 @@ gitk-specific options
range to show. The command is expected to print on its
standard output a list of additional revisions to be shown,
one per line. Use this instead of explicitly specifying a
- '<revision range>' if the set of commits to show may vary
+ '<revision-range>' if the set of commits to show may vary
between refreshes.
--select-commit=<ref>::
diff --git a/Documentation/gitmodules.txt b/Documentation/gitmodules.txt
index dcee09b..d9bec8b 100644
--- a/Documentation/gitmodules.txt
+++ b/Documentation/gitmodules.txt
@@ -43,9 +43,9 @@ submodule.<name>.update::
command in the superproject. This is only used by `git
submodule init` to initialize the configuration variable of
the same name. Allowed values here are 'checkout', 'rebase',
- 'merge' or 'none'. See description of 'update' command in
- linkgit:git-submodule[1] for their meaning. For security
- reasons, the '!command' form is not accepted here.
+ 'merge' or 'none', but not '!command' (for security reasons).
+ See the description of the 'update' command in
+ linkgit:git-submodule[1] for more details.
submodule.<name>.branch::
A remote branch name for tracking updates in the upstream submodule.
diff --git a/Documentation/technical/protocol-capabilities.txt b/Documentation/gitprotocol-capabilities.txt
index 9dfade9..2cf7735 100644
--- a/Documentation/technical/protocol-capabilities.txt
+++ b/Documentation/gitprotocol-capabilities.txt
@@ -1,8 +1,20 @@
-Git Protocol Capabilities
-=========================
+gitprotocol-capabilities(5)
+===========================
+
+NAME
+----
+gitprotocol-capabilities - Protocol v0 and v1 capabilities
+
+SYNOPSIS
+--------
+[verse]
+<over-the-wire-protocol>
+
+DESCRIPTION
+-----------
NOTE: this document describes capabilities for versions 0 and 1 of the pack
-protocol. For version 2, please refer to the link:protocol-v2.html[protocol-v2]
+protocol. For version 2, please refer to the linkgit:gitprotocol-v2[5]
doc.
Servers SHOULD support all capabilities defined in this document.
@@ -18,7 +30,7 @@ to be in effect. The client MUST NOT ask for capabilities the server
did not say it supports.
Server MUST diagnose and abort if capabilities it does not understand
-was sent. Server MUST NOT ignore capabilities that client requested
+were sent. Server MUST NOT ignore capabilities that client requested
and server advertised. As a consequence of these rules, server MUST
NOT advertise capabilities it does not understand.
@@ -49,8 +61,8 @@ complete cut across the DAG, or the client has said "done".
Without multi_ack, a client sends have lines in --date-order until
the server has found a common base. That means the client will send
have lines that are already known by the server to be common, because
-they overlap in time with another branch that the server hasn't found
-a common base on yet.
+they overlap in time with another branch on which the server hasn't found
+a common base yet.
For example suppose the client has commits in caps that the server
doesn't and the server has commits in lower case that the client
@@ -76,8 +88,8 @@ interleaved with S-R-Q.
multi_ack_detailed
------------------
-This is an extension of multi_ack that permits client to better
-understand the server's in-memory state. See pack-protocol.txt,
+This is an extension of multi_ack that permits the client to better
+understand the server's in-memory state. See linkgit:gitprotocol-pack[5],
section "Packfile Negotiation" for more information.
no-done
@@ -123,7 +135,7 @@ to disable the feature in a backwards-compatible manner.
side-band, side-band-64k
------------------------
-This capability means that server can send, and client understand multiplexed
+This capability means that the server can send, and the client can understand, multiplexed
progress reports and error info interleaved with the packfile itself.
These two options are mutually exclusive. A modern client always
@@ -151,14 +163,14 @@ Further, with side-band and its up to 1000-byte messages, it's actually
same deal, you have up to 65519 bytes of data and 1 byte for the stream
code.
-The client MUST send only maximum of one of "side-band" and "side-
-band-64k". Server MUST diagnose it as an error if client requests
+The client MUST send only one of "side-band" and "side-
+band-64k". The server MUST diagnose it as an error if client requests
both.
ofs-delta
---------
-Server can send, and client understand PACKv2 with delta referring to
+The server can send, and the client can understand, PACKv2 with delta referring to
its base by position in pack rather than by an obj-id. That is, they can
send/read OBJ_OFS_DELTA (aka type 6) in a packfile.
@@ -240,7 +252,7 @@ the current shallow boundary, instead of the depth from remote refs.
no-progress
-----------
-The client was started with "git clone -q" or something, and doesn't
+The client was started with "git clone -q" or something similar, and doesn't
want that side band 2. Basically the client just says "I do not
wish to receive stream 2 on sideband, so do not send it to me, and if
you did, I will drop it on the floor anyway". However, the sideband
@@ -261,7 +273,7 @@ request include-tag only has to do with the client's desires for tag
data, whether or not a server had advertised objects in the
refs/tags/* namespace.
-Servers MUST pack the tags if their referrant is packed and the client
+Servers MUST pack the tags if their referent is packed and the client
has requested include-tags.
Clients MUST be prepared for the case where a server has ignored
@@ -281,7 +293,7 @@ a packfile upload and reference update. If the pushing client requests
this capability, after unpacking and updating references the server
will respond with whether the packfile unpacked successfully and if
each reference was updated successfully. If any of those were not
-successful, it will send back an error message. See pack-protocol.txt
+successful, it will send back an error message. See linkgit:gitprotocol-pack[5]
for example messages.
report-status-v2
@@ -292,7 +304,7 @@ adding new "option" directives in order to support reference rewritten by
the "proc-receive" hook. The "proc-receive" hook may handle a command
for a pseudo-reference which may create or update a reference with
different name, new-oid, and old-oid. While the capability
-'report-status' cannot report for such case. See pack-protocol.txt
+'report-status' cannot report for such case. See linkgit:gitprotocol-pack[5]
for details.
delete-refs
@@ -366,7 +378,7 @@ fetch-pack may send "filter" commands to request a partial clone
or partial fetch and request that the server omit various objects
from the packfile.
-session-id=<session id>
+session-id=<session-id>
-----------------------
The server may advertise a session ID that can be used to identify this process
@@ -376,5 +388,9 @@ the server as well.
Session IDs should be unique to a given process. They must fit within a
packet-line, and must not contain non-printable or whitespace characters. The
current implementation uses trace2 session IDs (see
-link:api-trace2.html[api-trace2] for details), but this may change and users of
-the session ID should not rely on this fact.
+link:technical/api-trace2.html[api-trace2] for details), but this may change
+and users of the session ID should not rely on this fact.
+
+GIT
+---
+Part of the linkgit:git[1] suite
diff --git a/Documentation/technical/protocol-common.txt b/Documentation/gitprotocol-common.txt
index ecedb34..cdc9d6e 100644
--- a/Documentation/technical/protocol-common.txt
+++ b/Documentation/gitprotocol-common.txt
@@ -1,5 +1,20 @@
-Documentation Common to Pack and Http Protocols
-===============================================
+gitprotocol-common(5)
+=====================
+
+NAME
+----
+gitprotocol-common - Things common to various protocols
+
+SYNOPSIS
+--------
+[verse]
+<over-the-wire-protocol>
+
+DESCRIPTION
+-----------
+
+This document defines things common to various over-the-wire
+protocols and file formats used in Git.
ABNF Notation
-------------
@@ -97,3 +112,7 @@ Examples (as C-style strings):
"000bfoobar\n" "foobar\n"
"0004" ""
----
+
+GIT
+---
+Part of the linkgit:git[1] suite
diff --git a/Documentation/technical/http-protocol.txt b/Documentation/gitprotocol-http.txt
index cc5126c..ec40a55 100644
--- a/Documentation/technical/http-protocol.txt
+++ b/Documentation/gitprotocol-http.txt
@@ -1,5 +1,19 @@
-HTTP transfer protocols
-=======================
+gitprotocol-http(5)
+===================
+
+NAME
+----
+gitprotocol-http - Git HTTP-based protocols
+
+
+SYNOPSIS
+--------
+[verse]
+<over-the-wire-protocol>
+
+
+DESCRIPTION
+-----------
Git supports two HTTP based transfer protocols. A "dumb" protocol
which requires only a standard HTTP server on the server end of the
@@ -28,7 +42,7 @@ both the "smart" and "dumb" HTTP protocols used by Git operate
by appending additional path components onto the end of the user
supplied `$GIT_URL` string.
-An example of a dumb client requesting for a loose object:
+An example of a dumb client requesting a loose object:
$GIT_URL: http://example.com:8080/git/repo.git
URL request: http://example.com:8080/git/repo.git/objects/d0/49f6c27a2244e12041955e262a404c7faba355
@@ -222,7 +236,7 @@ smart server reply:
S: 0000
The client may send Extra Parameters (see
-Documentation/technical/pack-protocol.txt) as a colon-separated string
+linkgit:gitprotocol-pack[5]) as a colon-separated string
in the Git-Protocol HTTP header.
Uses the `--http-backend-info-refs` option to
@@ -365,7 +379,7 @@ C: Place any object seen into set `advertised`.
C: Build an empty set, `common`, to hold the objects that are later
determined to be on both ends.
-C: Build a set, `want`, of the objects from `advertised` the client
+C: Build a set, `want`, of the objects from `advertised` that the client
wants to fetch, based on what it saw during ref discovery.
C: Start a queue, `c_pending`, ordered by commit time (popping newest
@@ -377,14 +391,14 @@ C: Start a queue, `c_pending`, ordered by commit time (popping newest
C: Send one `$GIT_URL/git-upload-pack` request:
- C: 0032want <want #1>...............................
- C: 0032want <want #2>...............................
+ C: 0032want <want-#1>...............................
+ C: 0032want <want-#2>...............................
....
- C: 0032have <common #1>.............................
- C: 0032have <common #2>.............................
+ C: 0032have <common-#1>.............................
+ C: 0032have <common-#2>.............................
....
- C: 0032have <have #1>...............................
- C: 0032have <have #2>...............................
+ C: 0032have <have-#1>...............................
+ C: 0032have <have-#2>...............................
....
C: 0000
@@ -409,7 +423,7 @@ multiple commands. Object names MUST be given using the object format
negotiated through the `object-format` capability (default SHA-1).
The `have` list is created by popping the first 32 commits
-from `c_pending`. Less can be supplied if `c_pending` empties.
+from `c_pending`. Fewer can be supplied if `c_pending` empties.
If the client has sent 256 "have" commits and has not yet
received one of those back from `s_common`, or the client has
@@ -498,7 +512,7 @@ Within the command portion of the request body clients SHOULD send
the id obtained through ref discovery as old_id.
update_request = command_list
- "PACK" <binary data>
+ "PACK" <binary-data>
command_list = PKT-LINE(command NUL cap_list LF)
*(command_pkt)
@@ -512,11 +526,18 @@ the id obtained through ref discovery as old_id.
TODO: Document this further.
-
-References
+REFERENCES
----------
-http://www.ietf.org/rfc/rfc1738.txt[RFC 1738: Uniform Resource Locators (URL)]
-http://www.ietf.org/rfc/rfc2616.txt[RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1]
-link:technical/pack-protocol.html
-link:technical/protocol-capabilities.html
+https://www.ietf.org/rfc/rfc1738.txt[RFC 1738: Uniform Resource Locators (URL)]
+https://www.ietf.org/rfc/rfc2616.txt[RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1]
+
+SEE ALSO
+--------
+
+linkgit:gitprotocol-pack[5]
+linkgit:gitprotocol-capabilities[5]
+
+GIT
+---
+Part of the linkgit:git[1] suite
diff --git a/Documentation/technical/pack-protocol.txt b/Documentation/gitprotocol-pack.txt
index e13a2c0..837b691 100644
--- a/Documentation/technical/pack-protocol.txt
+++ b/Documentation/gitprotocol-pack.txt
@@ -1,11 +1,23 @@
-Packfile transfer protocols
-===========================
+gitprotocol-pack(5)
+===================
+
+NAME
+----
+gitprotocol-pack - How packs are transferred over-the-wire
+
+SYNOPSIS
+--------
+[verse]
+<over-the-wire-protocol>
+
+DESCRIPTION
+-----------
Git supports transferring data in packfiles over the ssh://, git://, http:// and
file:// transports. There exist two sets of protocols, one for pushing
data from a client to a server and another for fetching data from a
server to a client. The three transports (ssh, git, file) use the same
-protocol to transfer data. http is documented in http-protocol.txt.
+protocol to transfer data. http is documented in linkgit:gitprotocol-http[5].
The processes invoked in the canonical Git implementation are 'upload-pack'
on the server side and 'fetch-pack' on the client side for fetching data;
@@ -18,7 +30,7 @@ pkt-line Format
---------------
The descriptions below build on the pkt-line format described in
-protocol-common.txt. When the grammar indicate `PKT-LINE(...)`, unless
+linkgit:gitprotocol-common[5]. When the grammar indicates `PKT-LINE(...)`, unless
otherwise noted the usual pkt-line LF rules apply: the sender SHOULD
include a LF, but the receiver MUST NOT complain if it is not present.
@@ -60,7 +72,7 @@ Each Extra Parameter takes the form of `<key>=<value>` or `<key>`.
Servers that receive any such Extra Parameters MUST ignore all
unrecognized keys. Currently, the only Extra Parameter recognized is
-"version" with a value of '1' or '2'. See protocol-v2.txt for more
+"version" with a value of '1' or '2'. See linkgit:gitprotocol-v2[5] for more
information on protocol version 2.
Git Transport
@@ -125,7 +137,7 @@ an absolute path in the remote filesystem.
v
ssh user@example.com "git-upload-pack '/project.git'"
-In a "user@host:path" format URI, its relative to the user's home
+In a "user@host:path" format URI, it's relative to the user's home
directory, because the Git client will run:
git clone user@example.com:project.git
@@ -313,7 +325,7 @@ a positive depth, this step is skipped.
If the client has requested a positive depth, the server will compute
the set of commits which are no deeper than the desired depth. The set
-of commits start at the client's wants.
+of commits starts at the client's wants.
The server writes 'shallow' lines for each
commit whose parents will not be sent as a result. The server writes
@@ -455,7 +467,7 @@ Now that the client and server have finished negotiation about what
the minimal amount of data that needs to be sent to the client is, the server
will construct and send the required data in packfile format.
-See pack-format.txt for what the packfile itself actually looks like.
+See linkgit:gitformat-pack[5] for what the packfile itself actually looks like.
If 'side-band' or 'side-band-64k' capabilities have been specified by
the client, the server will send the packfile data multiplexed.
@@ -707,3 +719,7 @@ An example client/server communication might look like this:
S: 0018ok refs/heads/debug\n
S: 002ang refs/heads/master non-fast-forward\n
----
+
+GIT
+---
+Part of the linkgit:git[1] suite
diff --git a/Documentation/technical/protocol-v2.txt b/Documentation/gitprotocol-v2.txt
index 8a877d2..414bc62 100644
--- a/Documentation/technical/protocol-v2.txt
+++ b/Documentation/gitprotocol-v2.txt
@@ -1,5 +1,17 @@
-Git Wire Protocol, Version 2
-============================
+gitprotocol-v2(5)
+=================
+
+NAME
+----
+gitprotocol-v2 - Git Wire Protocol, Version 2
+
+SYNOPSIS
+--------
+[verse]
+<over-the-wire-protocol>
+
+DESCRIPTION
+-----------
This document presents a specification for a version 2 of Git's wire
protocol. Protocol v2 will improve upon v1 in the following ways:
@@ -17,7 +29,7 @@ protocol. Protocol v2 will improve upon v1 in the following ways:
semantics the http remote helper can simply act as a proxy
In protocol v2 communication is command oriented. When first contacting a
-server a list of capabilities will advertised. Some of these capabilities
+server a list of capabilities will be advertised. Some of these capabilities
will be commands which a client can request be executed. Once a command
has completed, a client can reuse the connection and request that other
commands be executed.
@@ -26,8 +38,7 @@ Packet-Line Framing
-------------------
All communication is done using packet-line framing, just as in v1. See
-`Documentation/technical/pack-protocol.txt` and
-`Documentation/technical/protocol-common.txt` for more information.
+linkgit:gitprotocol-pack[5] and linkgit:gitprotocol-common[5] for more information.
In protocol v2 these special packets will have the following semantics:
@@ -42,7 +53,7 @@ Initial Client Request
In general a client can request to speak protocol v2 by sending
`version=2` through the respective side-channel for the transport being
used which inevitably sets `GIT_PROTOCOL`. More information can be
-found in `pack-protocol.txt` and `http-protocol.txt`, as well as the
+found in linkgit:gitprotocol-pack[5] and linkgit:gitprotocol-http[5], as well as the
`GIT_PROTOCOL` definition in `git.txt`. In all cases the
response from the server is the capability advertisement.
@@ -66,7 +77,7 @@ HTTP Transport
~~~~~~~~~~~~~~
When using the http:// or https:// transport a client makes a "smart"
-info/refs request as described in `http-protocol.txt` and requests that
+info/refs request as described in linkgit:gitprotocol-http[5] and requests that
v2 be used by supplying "version=2" in the `Git-Protocol` header.
C: GET $GIT_URL/info/refs?service=git-upload-pack HTTP/1.0
@@ -188,7 +199,7 @@ which can be used to limit the refs sent from the server.
Additional features not supported in the base command will be advertised
as the value of the command in the capability advertisement in the form
-of a space separated list of features: "<command>=<feature 1> <feature 2>"
+of a space separated list of features: "<command>=<feature-1> <feature-2>"
ls-refs takes in the following arguments:
@@ -234,7 +245,7 @@ addition of future extensions.
Additional features not supported in the base command will be advertised
as the value of the command in the capability advertisement in the form
-of a space separated list of features: "<command>=<feature 1> <feature 2>"
+of a space separated list of features: "<command>=<feature-1> <feature-2>"
A `fetch` request can take the following arguments:
@@ -335,7 +346,8 @@ the 'wanted-refs' section in the server's response as explained below.
want-ref <ref>
Indicates to the server that the client wants to retrieve a
particular ref, where <ref> is the full name of a ref on the
- server.
+ server. It is a protocol error to send want-ref for the
+ same ref more than once.
If the 'sideband-all' feature is advertised, the following argument can be
included in the client's request:
@@ -350,9 +362,10 @@ included in the client's request:
If the 'packfile-uris' feature is advertised, the following argument
can be included in the client's request as well as the potential
addition of the 'packfile-uris' section in the server's response as
-explained below.
+explained below. Note that at most one `packfile-uris` line can be sent
+to the server.
- packfile-uris <comma-separated list of protocols>
+ packfile-uris <comma-separated-list-of-protocols>
Indicates to the server that the client is willing to receive
URIs of any of the given protocols in place of objects in the
sent packfile. Before performing the connectivity check, the
@@ -523,7 +536,7 @@ with objects using hash algorithm X. If not specified, the server is assumed to
only handle SHA-1. If the client would like to use a hash algorithm other than
SHA-1, it should specify its object-format string.
-session-id=<session id>
+session-id=<session-id>
~~~~~~~~~~~~~~~~~~~~~~~
The server may advertise a session ID that can be used to identify this process
@@ -533,8 +546,8 @@ the server as well.
Session IDs should be unique to a given process. They must fit within a
packet-line, and must not contain non-printable or whitespace characters. The
current implementation uses trace2 session IDs (see
-link:api-trace2.html[api-trace2] for details), but this may change and users of
-the session ID should not rely on this fact.
+link:technical/api-trace2.html[api-trace2] for details), but this may change
+and users of the session ID should not rely on this fact.
object-info
~~~~~~~~~~~
@@ -566,3 +579,208 @@ and associated requested information, each separated by a single space.
attr = "size"
obj-info = obj-id SP obj-size
+
+bundle-uri
+~~~~~~~~~~
+
+If the 'bundle-uri' capability is advertised, the server supports the
+`bundle-uri' command.
+
+The capability is currently advertised with no value (i.e. not
+"bundle-uri=somevalue"), a value may be added in the future for
+supporting command-wide extensions. Clients MUST ignore any unknown
+capability values and proceed with the 'bundle-uri` dialog they
+support.
+
+The 'bundle-uri' command is intended to be issued before `fetch` to
+get URIs to bundle files (see linkgit:git-bundle[1]) to "seed" and
+inform the subsequent `fetch` command.
+
+The client CAN issue `bundle-uri` before or after any other valid
+command. To be useful to clients it's expected that it'll be issued
+after an `ls-refs` and before `fetch`, but CAN be issued at any time
+in the dialog.
+
+DISCUSSION of bundle-uri
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+The intent of the feature is optimize for server resource consumption
+in the common case by changing the common case of fetching a very
+large PACK during linkgit:git-clone[1] into a smaller incremental
+fetch.
+
+It also allows servers to achieve better caching in combination with
+an `uploadpack.packObjectsHook` (see linkgit:git-config[1]).
+
+By having new clones or fetches be a more predictable and common
+negotiation against the tips of recently produces *.bundle file(s).
+Servers might even pre-generate the results of such negotiations for
+the `uploadpack.packObjectsHook` as new pushes come in.
+
+One way that servers could take advantage of these bundles is that the
+server would anticipate that fresh clones will download a known bundle,
+followed by catching up to the current state of the repository using ref
+tips found in that bundle (or bundles).
+
+PROTOCOL for bundle-uri
+^^^^^^^^^^^^^^^^^^^^^^^
+
+A `bundle-uri` request takes no arguments, and as noted above does not
+currently advertise a capability value. Both may be added in the
+future.
+
+When the client issues a `command=bundle-uri` request, the response is a
+list of key-value pairs provided as packet lines with value
+`<key>=<value>`. Each `<key>` should be interpreted as a config key from
+the `bundle.*` namespace to construct a list of bundles. These keys are
+grouped by a `bundle.<id>.` subsection, where each key corresponding to a
+given `<id>` contributes attributes to the bundle defined by that `<id>`.
+See linkgit:git-config[1] for the specific details of these keys and how
+the Git client will interpret their values.
+
+Clients MUST parse the line according to the above format, lines that do
+not conform to the format SHOULD be discarded. The user MAY be warned in
+such a case.
+
+bundle-uri CLIENT AND SERVER EXPECTATIONS
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+URI CONTENTS::
+The content at the advertised URIs MUST be one of two types.
++
+The advertised URI may contain a bundle file that `git bundle verify`
+would accept. I.e. they MUST contain one or more reference tips for
+use by the client, MUST indicate prerequisites (in any) with standard
+"-" prefixes, and MUST indicate their "object-format", if
+applicable.
++
+The advertised URI may alternatively contain a plaintext file that `git
+config --list` would accept (with the `--file` option). The key-value
+pairs in this list are in the `bundle.*` namespace (see
+linkgit:git-config[1]).
+
+bundle-uri CLIENT ERROR RECOVERY::
+A client MUST above all gracefully degrade on errors, whether that
+error is because of bad missing/data in the bundle URI(s), because
+that client is too dumb to e.g. understand and fully parse out bundle
+headers and their prerequisite relationships, or something else.
++
+Server operators should feel confident in turning on "bundle-uri" and
+not worry if e.g. their CDN goes down that clones or fetches will run
+into hard failures. Even if the server bundle(s) are
+incomplete, or bad in some way the client should still end up with a
+functioning repository, just as if it had chosen not to use this
+protocol extension.
++
+All subsequent discussion on client and server interaction MUST keep
+this in mind.
+
+bundle-uri SERVER TO CLIENT::
+The ordering of the returned bundle uris is not significant. Clients
+MUST parse their headers to discover their contained OIDS and
+prerequisites. A client MUST consider the content of the bundle(s)
+themselves and their header as the ultimate source of truth.
++
+A server MAY even return bundle(s) that don't have any direct
+relationship to the repository being cloned (either through accident,
+or intentional "clever" configuration), and expect a client to sort
+out what data they'd like from the bundle(s), if any.
+
+bundle-uri CLIENT TO SERVER::
+The client SHOULD provide reference tips found in the bundle header(s)
+as 'have' lines in any subsequent `fetch` request. A client MAY also
+ignore the bundle(s) entirely if doing so is deemed worse for some
+reason, e.g. if the bundles can't be downloaded, it doesn't like the
+tips it finds etc.
+
+WHEN ADVERTISED BUNDLE(S) REQUIRE NO FURTHER NEGOTIATION::
+If after issuing `bundle-uri` and `ls-refs`, and getting the header(s)
+of the bundle(s) the client finds that the ref tips it wants can be
+retrieved entirely from advertised bundle(s), the client MAY disconnect
+from the Git server. The results of such a 'clone' or 'fetch' should be
+indistinguishable from the state attained without using bundle-uri.
+
+EARLY CLIENT DISCONNECTIONS AND ERROR RECOVERY::
+A client MAY perform an early disconnect while still downloading the
+bundle(s) (having streamed and parsed their headers). In such a case
+the client MUST gracefully recover from any errors related to
+finishing the download and validation of the bundle(s).
++
+I.e. a client might need to re-connect and issue a 'fetch' command,
+and possibly fall back to not making use of 'bundle-uri' at all.
++
+This "MAY" behavior is specified as such (and not a "SHOULD") on the
+assumption that a server advertising bundle uris is more likely than
+not to be serving up a relatively large repository, and to be pointing
+to URIs that have a good chance of being in working order. A client
+MAY e.g. look at the payload size of the bundles as a heuristic to see
+if an early disconnect is worth it, should falling back on a full
+"fetch" dialog be necessary.
+
+WHEN ADVERTISED BUNDLE(S) REQUIRE FURTHER NEGOTIATION::
+A client SHOULD commence a negotiation of a PACK from the server via
+the "fetch" command using the OID tips found in advertised bundles,
+even if's still in the process of downloading those bundle(s).
++
+This allows for aggressive early disconnects from any interactive
+server dialog. The client blindly trusts that the advertised OID tips
+are relevant, and issues them as 'have' lines, it then requests any
+tips it would like (usually from the "ls-refs" advertisement) via
+'want' lines. The server will then compute a (hopefully small) PACK
+with the expected difference between the tips from the bundle(s) and
+the data requested.
++
+The only connection the client then needs to keep active is to the
+concurrently downloading static bundle(s), when those and the
+incremental PACK are retrieved they should be inflated and
+validated. Any errors at this point should be gracefully recovered
+from, see above.
+
+bundle-uri PROTOCOL FEATURES
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The client constructs a bundle list from the `<key>=<value>` pairs
+provided by the server. These pairs are part of the `bundle.*` namespace
+as documented in linkgit:git-config[1]. In this section, we discuss some
+of these keys and describe the actions the client will do in response to
+this information.
+
+In particular, the `bundle.version` key specifies an integer value. The
+only accepted value at the moment is `1`, but if the client sees an
+unexpected value here then the client MUST ignore the bundle list.
+
+As long as `bundle.version` is understood, all other unknown keys MAY be
+ignored by the client. The server will guarantee compatibility with older
+clients, though newer clients may be better able to use the extra keys to
+minimize downloads.
+
+Any backwards-incompatible addition of pre-URI key-value will be
+guarded by a new `bundle.version` value or values in 'bundle-uri'
+capability advertisement itself, and/or by new future `bundle-uri`
+request arguments.
+
+Some example key-value pairs that are not currently implemented but could
+be implemented in the future include:
+
+ * Add a "hash=<val>" or "size=<bytes>" advertise the expected hash or
+ size of the bundle file.
+
+ * Advertise that one or more bundle files are the same (to e.g. have
+ clients round-robin or otherwise choose one of N possible files).
+
+ * A "oid=<OID>" shortcut and "prerequisite=<OID>" shortcut. For
+ expressing the common case of a bundle with one tip and no
+ prerequisites, or one tip and one prerequisite.
++
+This would allow for optimizing the common case of servers who'd like
+to provide one "big bundle" containing only their "main" branch,
+and/or incremental updates thereof.
++
+A client receiving such a a response MAY assume that they can skip
+retrieving the header from a bundle at the indicated URI, and thus
+save themselves and the server(s) the request(s) needed to inspect the
+headers of that bundle or bundles.
+
+GIT
+---
+Part of the linkgit:git[1] suite
diff --git a/Documentation/gitremote-helpers.txt b/Documentation/gitremote-helpers.txt
index 6f1e269..d0be008 100644
--- a/Documentation/gitremote-helpers.txt
+++ b/Documentation/gitremote-helpers.txt
@@ -168,6 +168,9 @@ Supported commands: 'list', 'import'.
Can guarantee that when a clone is requested, the received
pack is self contained and is connected.
+'get'::
+ Can use the 'get' command to download a file from a given URI.
+
If a helper advertises 'connect', Git will use it if possible and
fall back to another capability if the helper requests so when
connecting (see the 'connect' command under COMMANDS).
@@ -418,6 +421,12 @@ Supported if the helper has the "connect" capability.
+
Supported if the helper has the "stateless-connect" capability.
+'get' <uri> <path>::
+ Downloads the file from the given `<uri>` to the given `<path>`. If
+ `<path>.temp` exists, then Git assumes that the `.temp` file is a
+ partial download from a previous attempt and will resume the
+ download from that position.
+
If a fatal error occurs, the program writes the error message to
stderr and exits. The caller should expect that a suitable error
message has been printed if the child closes the connection without
@@ -470,14 +479,14 @@ set by Git if the remote helper has the 'option' capability.
'option depth' <depth>::
Deepens the history of a shallow repository.
-'option deepen-since <timestamp>::
+'option deepen-since' <timestamp>::
Deepens the history of a shallow repository based on time.
-'option deepen-not <ref>::
+'option deepen-not' <ref>::
Deepens the history of a shallow repository excluding ref.
Multiple options add up.
-'option deepen-relative {'true'|'false'}::
+'option deepen-relative' {'true'|'false'}::
Deepens the history of a shallow repository relative to
current boundary. Only valid when used with "option depth".
@@ -517,7 +526,7 @@ set by Git if the remote helper has the 'option' capability.
'option pushcert' {'true'|'false'}::
GPG sign pushes.
-'option push-option <string>::
+'option push-option' <string>::
Transmit <string> as a push option. As the push option
must not contain LF or NUL characters, the string is not encoded.
@@ -533,13 +542,10 @@ set by Git if the remote helper has the 'option' capability.
transaction. If successful, all refs will be updated, or none will. If the
remote side does not support this capability, the push will fail.
-'option object-format' {'true'|algorithm}::
- If 'true', indicate that the caller wants hash algorithm information
+'option object-format true'::
+ Indicate that the caller wants hash algorithm information
to be passed back from the remote. This mode is used when fetching
refs.
-+
-If set to an algorithm, indicate that the caller wants to interact with
-the remote side using that algorithm.
SEE ALSO
--------
diff --git a/Documentation/gitrepository-layout.txt b/Documentation/gitrepository-layout.txt
index 1a2ef4c..949cd8a 100644
--- a/Documentation/gitrepository-layout.txt
+++ b/Documentation/gitrepository-layout.txt
@@ -23,7 +23,9 @@ A Git repository comes in two different flavours:
*Note*: Also you can have a plain text file `.git` at the root of
your working tree, containing `gitdir: <path>` to point at the real
-directory that has the repository. This mechanism is often used for
+directory that has the repository.
+This mechanism is called a 'gitfile' and is usually managed via the
+`git submodule` and `git worktree` commands. It is often used for
a working tree of a submodule checkout, to allow you in the
containing superproject to `git checkout` a branch that does not
have the submodule. The `checkout` has to remove the entire
diff --git a/Documentation/gitsubmodules.txt b/Documentation/gitsubmodules.txt
index 941858a..f7b5a25 100644
--- a/Documentation/gitsubmodules.txt
+++ b/Documentation/gitsubmodules.txt
@@ -78,7 +78,7 @@ Submodule operations can be configured using the following mechanisms
* The command line for those commands that support taking submodules
as part of their pathspecs. Most commands have a boolean flag
- `--recurse-submodules` which specify whether to recurse into submodules.
+ `--recurse-submodules` which specifies whether to recurse into submodules.
Examples are `grep` and `checkout`.
Some commands take enums, such as `fetch` and `push`, where you can
specify how submodules are affected.
@@ -151,7 +151,7 @@ the superproject's `$GIT_DIR/config` file, so the superproject's history
is not affected. This can be undone using `git submodule init`.
* Deleted submodule: A submodule can be deleted by running
-`git rm <submodule path> && git commit`. This can be undone
+`git rm <submodule-path> && git commit`. This can be undone
using `git revert`.
+
The deletion removes the superproject's tracking data, which are
@@ -192,7 +192,7 @@ For example:
[submodule "baz"]
url = https://example.org/baz
-In the above config only the submodule 'bar' and 'baz' are active,
+In the above config only the submodules 'bar' and 'baz' are active,
'bar' due to (1) and 'baz' due to (3). 'foo' is inactive because
(1) takes precedence over (3)
@@ -229,7 +229,7 @@ Workflow for a third party library
git submodule add <URL> <path>
# Occasionally update the submodule to a new version:
- git -C <path> checkout <new version>
+ git -C <path> checkout <new-version>
git add <path>
git commit -m "update submodule to new version"
@@ -274,7 +274,7 @@ will not be checked out by default; you can instruct `clone` to recurse
into submodules. The `init` and `update` subcommands of `git submodule`
will maintain submodules checked out and at an appropriate revision in
your working tree. Alternatively you can set `submodule.recurse` to have
-`checkout` recursing into submodules (note that `submodule.recurse` also
+`checkout` recurse into submodules (note that `submodule.recurse` also
affects other Git commands, see linkgit:git-config[1] for a complete list).
diff --git a/Documentation/gittutorial.txt b/Documentation/gittutorial.txt
index 0e0b863..4759408 100644
--- a/Documentation/gittutorial.txt
+++ b/Documentation/gittutorial.txt
@@ -49,7 +49,7 @@ $ git config --global user.email you@yourdomain.example.com
Importing a new project
-----------------------
-Assume you have a tarball project.tar.gz with your initial work. You
+Assume you have a tarball `project.tar.gz` with your initial work. You
can place it under Git revision control as follows.
------------------------------------------------
@@ -65,10 +65,10 @@ Initialized empty Git repository in .git/
------------------------------------------------
You've now initialized the working directory--you may notice a new
-directory created, named ".git".
+directory created, named `.git`.
Next, tell Git to take a snapshot of the contents of all files under the
-current directory (note the '.'), with 'git add':
+current directory (note the `.`), with `git add`:
------------------------------------------------
$ git add .
@@ -76,7 +76,7 @@ $ git add .
This snapshot is now stored in a temporary staging area which Git calls
the "index". You can permanently store the contents of the index in the
-repository with 'git commit':
+repository with `git commit`:
------------------------------------------------
$ git commit
@@ -95,21 +95,20 @@ $ git add file1 file2 file3
------------------------------------------------
You are now ready to commit. You can see what is about to be committed
-using 'git diff' with the --cached option:
+using `git diff` with the `--cached` option:
------------------------------------------------
$ git diff --cached
------------------------------------------------
-(Without --cached, 'git diff' will show you any changes that
+(Without `--cached`, `git diff` will show you any changes that
you've made but not yet added to the index.) You can also get a brief
-summary of the situation with 'git status':
+summary of the situation with `git status`:
------------------------------------------------
$ git status
On branch master
Changes to be committed:
-Your branch is up to date with 'origin/master'.
(use "git restore --staged <file>..." to unstage)
modified: file1
@@ -128,7 +127,7 @@ $ git commit
This will again prompt you for a message describing the change, and then
record a new version of the project.
-Alternatively, instead of running 'git add' beforehand, you can use
+Alternatively, instead of running `git add` beforehand, you can use
------------------------------------------------
$ git commit -a
@@ -138,10 +137,10 @@ which will automatically notice any modified (but not new) files, add
them to the index, and commit, all in one step.
A note on commit messages: Though not required, it's a good idea to
-begin the commit message with a single short (less than 50 character)
-line summarizing the change, followed by a blank line and then a more
-thorough description. The text up to the first blank line in a commit
-message is treated as the commit title, and that title is used
+begin the commit message with a single short (no more than 50
+characters) line summarizing the change, followed by a blank line and
+then a more thorough description. The text up to the first blank line in
+a commit message is treated as the commit title, and that title is used
throughout Git. For example, linkgit:git-format-patch[1] turns a
commit into email, and it uses the title on the Subject line and the
rest of the commit in the body.
@@ -151,7 +150,7 @@ Git tracks content not files
Many revision control systems provide an `add` command that tells the
system to start tracking changes to a new file. Git's `add` command
-does something simpler and more powerful: 'git add' is used both for new
+does something simpler and more powerful: `git add` is used both for new
and newly modified files, and in both cases it takes a snapshot of the
given files and stages that content in the index, ready for inclusion in
the next commit.
@@ -182,7 +181,7 @@ Managing branches
-----------------
A single Git repository can maintain multiple branches of
-development. To create a new branch named "experimental", use
+development. To create a new branch named `experimental`, use
------------------------------------------------
$ git branch experimental
@@ -201,8 +200,8 @@ you'll get a list of all existing branches:
* master
------------------------------------------------
-The "experimental" branch is the one you just created, and the
-"master" branch is a default branch that was created for you
+The `experimental` branch is the one you just created, and the
+`master` branch is a default branch that was created for you
automatically. The asterisk marks the branch you are currently on;
type
@@ -210,8 +209,8 @@ type
$ git switch experimental
------------------------------------------------
-to switch to the experimental branch. Now edit a file, commit the
-change, and switch back to the master branch:
+to switch to the `experimental` branch. Now edit a file, commit the
+change, and switch back to the `master` branch:
------------------------------------------------
(edit file)
@@ -220,9 +219,9 @@ $ git switch master
------------------------------------------------
Check that the change you made is no longer visible, since it was
-made on the experimental branch and you're back on the master branch.
+made on the `experimental` branch and you're back on the `master` branch.
-You can make a different change on the master branch:
+You can make a different change on the `master` branch:
------------------------------------------------
(edit file)
@@ -230,7 +229,7 @@ $ git commit -a
------------------------------------------------
at this point the two branches have diverged, with different changes
-made in each. To merge the changes made in experimental into master, run
+made in each. To merge the changes made in `experimental` into `master`, run
------------------------------------------------
$ git merge experimental
@@ -258,16 +257,16 @@ $ gitk
will show a nice graphical representation of the resulting history.
-At this point you could delete the experimental branch with
+At this point you could delete the `experimental` branch with
------------------------------------------------
$ git branch -d experimental
------------------------------------------------
-This command ensures that the changes in the experimental branch are
+This command ensures that the changes in the `experimental` branch are
already in the current branch.
-If you develop on a branch crazy-idea, then regret it, you can always
+If you develop on a branch `crazy-idea`, then regret it, you can always
delete the branch with
-------------------------------------
@@ -281,7 +280,7 @@ Using Git for collaboration
---------------------------
Suppose that Alice has started a new project with a Git repository in
-/home/alice/project, and that Bob, who has a home directory on the
+`/home/alice/project`, and that Bob, who has a home directory on the
same machine, wants to contribute.
Bob begins with:
@@ -290,7 +289,7 @@ Bob begins with:
bob$ git clone /home/alice/project myrepo
------------------------------------------------
-This creates a new directory "myrepo" containing a clone of Alice's
+This creates a new directory `myrepo` containing a clone of Alice's
repository. The clone is on an equal footing with the original
project, possessing its own copy of the original project's history.
@@ -303,31 +302,31 @@ bob$ git commit -a
------------------------------------------------
When he's ready, he tells Alice to pull changes from the repository
-at /home/bob/myrepo. She does this with:
+at `/home/bob/myrepo`. She does this with:
------------------------------------------------
alice$ cd /home/alice/project
alice$ git pull /home/bob/myrepo master
------------------------------------------------
-This merges the changes from Bob's "master" branch into Alice's
+This merges the changes from Bob's `master` branch into Alice's
current branch. If Alice has made her own changes in the meantime,
then she may need to manually fix any conflicts.
-The "pull" command thus performs two operations: it fetches changes
+The `pull` command thus performs two operations: it fetches changes
from a remote branch, then merges them into the current branch.
Note that in general, Alice would want her local changes committed before
-initiating this "pull". If Bob's work conflicts with what Alice did since
+initiating this `pull`. If Bob's work conflicts with what Alice did since
their histories forked, Alice will use her working tree and the index to
resolve conflicts, and existing local changes will interfere with the
conflict resolution process (Git will still perform the fetch but will
refuse to merge -- Alice will have to get rid of her local changes in
some way and pull again when this happens).
-Alice can peek at what Bob did without merging first, using the "fetch"
+Alice can peek at what Bob did without merging first, using the `fetch`
command; this allows Alice to inspect what Bob did, using a special
-symbol "FETCH_HEAD", in order to determine if he has anything worth
+symbol `FETCH_HEAD`, in order to determine if he has anything worth
pulling, like this:
------------------------------------------------
@@ -336,10 +335,10 @@ alice$ git log -p HEAD..FETCH_HEAD
------------------------------------------------
This operation is safe even if Alice has uncommitted local changes.
-The range notation "HEAD..FETCH_HEAD" means "show everything that is reachable
-from the FETCH_HEAD but exclude anything that is reachable from HEAD".
-Alice already knows everything that leads to her current state (HEAD),
-and reviews what Bob has in his state (FETCH_HEAD) that she has not
+The range notation `HEAD..FETCH_HEAD` means "show everything that is reachable
+from the `FETCH_HEAD` but exclude anything that is reachable from `HEAD`".
+Alice already knows everything that leads to her current state (`HEAD`),
+and reviews what Bob has in his state (`FETCH_HEAD`) that she has not
seen with this command.
If Alice wants to visualize what Bob did since their histories forked
@@ -349,7 +348,7 @@ she can issue the following command:
$ gitk HEAD..FETCH_HEAD
------------------------------------------------
-This uses the same two-dot range notation we saw earlier with 'git log'.
+This uses the same two-dot range notation we saw earlier with `git log`.
Alice may want to view what both of them did since they forked.
She can use three-dot form instead of the two-dot form:
@@ -361,13 +360,13 @@ $ gitk HEAD...FETCH_HEAD
This means "show everything that is reachable from either one, but
exclude anything that is reachable from both of them".
-Please note that these range notation can be used with both gitk
-and "git log".
+Please note that these range notation can be used with both `gitk`
+and `git log`.
After inspecting what Bob did, if there is nothing urgent, Alice may
decide to continue working without pulling from Bob. If Bob's history
does have something Alice would immediately need, Alice may choose to
-stash her work-in-progress first, do a "pull", and then finally unstash
+stash her work-in-progress first, do a `pull`, and then finally unstash
her work-in-progress on top of the resulting history.
When you are working in a small closely knit group, it is not
@@ -379,8 +378,8 @@ it easier:
alice$ git remote add bob /home/bob/myrepo
------------------------------------------------
-With this, Alice can perform the first part of the "pull" operation
-alone using the 'git fetch' command without merging them with her own
+With this, Alice can perform the first part of the `pull` operation
+alone using the `git fetch` command without merging them with her own
branch, using:
-------------------------------------
@@ -388,7 +387,7 @@ alice$ git fetch bob
-------------------------------------
Unlike the longhand form, when Alice fetches from Bob using a
-remote repository shorthand set up with 'git remote', what was
+remote repository shorthand set up with `git remote`, what was
fetched is stored in a remote-tracking branch, in this case
`bob/master`. So after this:
@@ -397,10 +396,10 @@ alice$ git log -p master..bob/master
-------------------------------------
shows a list of all the changes that Bob made since he branched from
-Alice's master branch.
+Alice's `master` branch.
After examining those changes, Alice
-could merge the changes into her master branch:
+could merge the changes into her `master` branch:
-------------------------------------
alice$ git merge bob/master
@@ -432,12 +431,12 @@ bob$ git config --get remote.origin.url
/home/alice/project
-------------------------------------
-(The complete configuration created by 'git clone' is visible using
+(The complete configuration created by `git clone` is visible using
`git config -l`, and the linkgit:git-config[1] man page
explains the meaning of each option.)
-Git also keeps a pristine copy of Alice's master branch under the
-name "origin/master":
+Git also keeps a pristine copy of Alice's `master` branch under the
+name `origin/master`:
-------------------------------------
bob$ git branch -r
@@ -462,8 +461,8 @@ Exploring history
-----------------
Git history is represented as a series of interrelated commits. We
-have already seen that the 'git log' command can list those commits.
-Note that first line of each git log entry also gives a name for the
+have already seen that the `git log` command can list those commits.
+Note that first line of each `git log` entry also gives a name for the
commit:
-------------------------------------
@@ -475,7 +474,7 @@ Date: Tue May 16 17:18:22 2006 -0700
merge-base: Clarify the comments on post processing.
-------------------------------------
-We can give this name to 'git show' to see the details about this
+We can give this name to `git show` to see the details about this
commit.
-------------------------------------
@@ -514,7 +513,7 @@ You can also give commits names of your own; after running
$ git tag v2.5 1b2e1d63ff
-------------------------------------
-you can refer to 1b2e1d63ff by the name "v2.5". If you intend to
+you can refer to `1b2e1d63ff` by the name `v2.5`. If you intend to
share this name with other people (for example, to identify a release
version), you should create a "tag" object, and perhaps sign it; see
linkgit:git-tag[1] for details.
@@ -533,22 +532,22 @@ $ git reset --hard HEAD^ # reset your current branch and working
Be careful with that last command: in addition to losing any changes
in the working directory, it will also remove all later commits from
this branch. If this branch is the only branch containing those
-commits, they will be lost. Also, don't use 'git reset' on a
+commits, they will be lost. Also, don't use `git reset` on a
publicly-visible branch that other developers pull from, as it will
force needless merges on other developers to clean up the history.
-If you need to undo changes that you have pushed, use 'git revert'
+If you need to undo changes that you have pushed, use `git revert`
instead.
-The 'git grep' command can search for strings in any version of your
+The `git grep` command can search for strings in any version of your
project, so
-------------------------------------
$ git grep "hello" v2.5
-------------------------------------
-searches for all occurrences of "hello" in v2.5.
+searches for all occurrences of "hello" in `v2.5`.
-If you leave out the commit name, 'git grep' will search any of the
+If you leave out the commit name, `git grep` will search any of the
files it manages in your current directory. So
-------------------------------------
@@ -558,7 +557,7 @@ $ git grep "hello"
is a quick way to search just the files that are tracked by Git.
Many Git commands also take sets of commits, which can be specified
-in a number of ways. Here are some examples with 'git log':
+in a number of ways. Here are some examples with `git log`:
-------------------------------------
$ git log v2.5..v2.6 # commits between v2.5 and v2.6
@@ -568,16 +567,16 @@ $ git log v2.5.. Makefile # commits since v2.5 which modify
# Makefile
-------------------------------------
-You can also give 'git log' a "range" of commits where the first is not
+You can also give `git log` a "range" of commits where the first is not
necessarily an ancestor of the second; for example, if the tips of
-the branches "stable" and "master" diverged from a common
+the branches `stable` and `master` diverged from a common
commit some time ago, then
-------------------------------------
$ git log stable..master
-------------------------------------
-will list commits made in the master branch but not in the
+will list commits made in the `master` branch but not in the
stable branch, while
-------------------------------------
@@ -585,15 +584,15 @@ $ git log master..stable
-------------------------------------
will show the list of commits made on the stable branch but not
-the master branch.
+the `master` branch.
-The 'git log' command has a weakness: it must present commits in a
+The `git log` command has a weakness: it must present commits in a
list. When the history has lines of development that diverged and
-then merged back together, the order in which 'git log' presents
+then merged back together, the order in which `git log` presents
those commits is meaningless.
Most projects with multiple contributors (such as the Linux kernel,
-or Git itself) have frequent merges, and 'gitk' does a better job of
+or Git itself) have frequent merges, and `gitk` does a better job of
visualizing their history. For example,
-------------------------------------
@@ -601,7 +600,7 @@ $ gitk --since="2 weeks ago" drivers/
-------------------------------------
allows you to browse any commits from the last 2 weeks of commits
-that modified files under the "drivers" directory. (Note: you can
+that modified files under the `drivers` directory. (Note: you can
adjust gitk's fonts by holding down the control key while pressing
"-" or "+".)
@@ -613,7 +612,7 @@ of the file:
$ git diff v2.5:Makefile HEAD:Makefile.in
-------------------------------------
-You can also use 'git show' to see any such file:
+You can also use `git show` to see any such file:
-------------------------------------
$ git show v2.5:Makefile
@@ -649,7 +648,7 @@ digressions that may be interesting at this point are:
* linkgit:git-bisect[1]: When there is a regression in your
project, one way to track down the bug is by searching through
- the history to find the exact commit that's to blame. Git bisect
+ the history to find the exact commit that's to blame. `git bisect`
can help you perform a binary search for that commit. It is
smart enough to perform a close-to-optimal search even in the
case of complex non-linear history with lots of merged branches.
diff --git a/Documentation/gitweb.conf.txt b/Documentation/gitweb.conf.txt
index 34b1d6e..8598358 100644
--- a/Documentation/gitweb.conf.txt
+++ b/Documentation/gitweb.conf.txt
@@ -53,7 +53,7 @@ following order:
`/etc/gitweb-common.conf`),
* either per-instance configuration file (defaults to 'gitweb_config.perl'
- in the same directory as the installed gitweb), or if it does not exists
+ in the same directory as the installed gitweb), or if it does not exist
then fallback system-wide configuration file (defaults to `/etc/gitweb.conf`).
Values obtained in later configuration files override values obtained earlier
@@ -242,7 +242,7 @@ $mimetypes_file::
$highlight_bin::
Path to the highlight executable to use (it must be the one from
- http://www.andre-simon.de[] due to assumptions about parameters and output).
+ http://andre-simon.de/zip/download.php[] due to assumptions about parameters and output).
By default set to 'highlight'; set it to full path to highlight
executable if it is not installed on your web server's PATH.
Note that 'highlight' feature must be set for gitweb to actually
@@ -343,7 +343,7 @@ $home_link_str::
Label for the "home link" at the top of all pages, leading to `$home_link`
(usually the main gitweb page, which contains the projects list). It is
used as the first component of gitweb's "breadcrumb trail":
- `<home link> / <project> / <action>`. Can be set at build time using
+ `<home-link> / <project> / <action>`. Can be set at build time using
the `GITWEB_HOME_LINK_STR` variable. By default it is set to "projects",
as this link leads to the list of projects. Another popular choice is to
set it to the name of site. Note that it is treated as raw HTML so it
@@ -604,9 +604,9 @@ Many gitweb features can be enabled (or disabled) and configured using the
Each `%feature` hash element is a hash reference and has the following
structure:
----------------------------------------------------------------------
-"<feature_name>" => {
- "sub" => <feature-sub (subroutine)>,
- "override" => <allow-override (boolean)>,
+"<feature-name>" => {
+ "sub" => <feature-sub-(subroutine)>,
+ "override" => <allow-override-(boolean)>,
"default" => [ <options>... ]
},
----------------------------------------------------------------------
@@ -614,7 +614,7 @@ Some features cannot be overridden per project. For those
features the structure of appropriate `%feature` hash element has a simpler
form:
----------------------------------------------------------------------
-"<feature_name>" => {
+"<feature-name>" => {
"override" => 0,
"default" => [ <options>... ]
},
@@ -820,7 +820,7 @@ filesystem (i.e. "$projectroot/$project"), `%h` to the current hash
(\'h' gitweb parameter) and `%b` to the current hash base
(\'hb' gitweb parameter); `%%` expands to \'%'.
+
-For example, at the time this page was written, the http://repo.or.cz[]
+For example, at the time this page was written, the https://repo.or.cz[]
Git hosting site set it to the following to enable graphical log
(using the third party tool *git-browser*):
+
diff --git a/Documentation/gitweb.txt b/Documentation/gitweb.txt
index 7cee9d3..56d24a3 100644
--- a/Documentation/gitweb.txt
+++ b/Documentation/gitweb.txt
@@ -8,7 +8,7 @@ gitweb - Git web interface (web frontend to Git repositories)
SYNOPSIS
--------
To get started with gitweb, run linkgit:git-instaweb[1] from a Git repository.
-This would configure and start your web server, and run web browser pointing to
+This will configure and start your web server, and run a web browser pointing to
gitweb.
@@ -20,15 +20,15 @@ Gitweb provides a web interface to Git repositories. Its features include:
* Browsing every revision of the repository.
* Viewing the contents of files in the repository at any revision.
* Viewing the revision log of branches, history of files and directories,
- see what was changed when, by who.
+ seeing what was changed, when, and by whom.
* Viewing the blame/annotation details of any file (if enabled).
* Generating RSS and Atom feeds of commits, for any branch.
The feeds are auto-discoverable in modern web browsers.
-* Viewing everything that was changed in a revision, and step through
+* Viewing everything that was changed in a revision, and stepping through
revisions one at a time, viewing the history of the repository.
-* Finding commits which commit messages matches given search term.
+* Finding commits whose commit messages match a given search term.
-See http://repo.or.cz/w/git.git/tree/HEAD:/gitweb/[] for gitweb source code,
+See https://repo.or.cz/w/git.git/tree/HEAD:/gitweb/[] for gitweb source code,
browsed using gitweb itself.
@@ -41,9 +41,9 @@ for details.
Repositories
~~~~~~~~~~~~
Gitweb can show information from one or more Git repositories. These
-repositories have to be all on local filesystem, and have to share common
+repositories have to be all on local filesystem, and have to share a common
repository root, i.e. be all under a single parent repository (but see also
-"Advanced web server setup" section, "Webserver configuration with multiple
+the "Advanced web server setup" section, "Webserver configuration with multiple
projects' root" subsection).
-----------------------------------------------------------------------
@@ -51,7 +51,7 @@ our $projectroot = '/path/to/parent/directory';
-----------------------------------------------------------------------
The default value for `$projectroot` is `/pub/git`. You can change it during
-building gitweb via `GITWEB_PROJECTROOT` build configuration variable.
+building gitweb via the `GITWEB_PROJECTROOT` build configuration variable.
By default all Git repositories under `$projectroot` are visible and available
to gitweb. The list of projects is generated by default by scanning the
@@ -66,7 +66,7 @@ found at "$projectroot/$repo".
Projects list file format
~~~~~~~~~~~~~~~~~~~~~~~~~
-Instead of having gitweb find repositories by scanning filesystem
+Instead of having gitweb find repositories by scanning the filesystem
starting from $projectroot, you can provide a pre-generated list of
visible projects by setting `$projects_list` to point to a plain text
file with a list of projects (with some additional info).
@@ -305,7 +305,7 @@ pathnames. In most general form such path_info (component) based gitweb URL
looks like this:
-----------------------------------------------------------------------
-.../gitweb.cgi/<repo>/<action>/<revision_from>:/<path_from>..<revision_to>:/<path_to>?<arguments>
+.../gitweb.cgi/<repo>/<action>/<revision-from>:/<path-from>..<revision-to>:/<path-to>?<arguments>
-----------------------------------------------------------------------
@@ -503,7 +503,7 @@ repositories, you can configure Apache like this:
The above configuration expects your public repositories to live under
`/pub/git` and will serve them as `http://git.domain.org/dir-under-pub-git`,
-both as clonable Git URL and as browseable gitweb interface. If you then
+both as clonable Git URL and as browsable gitweb interface. If you then
start your linkgit:git-daemon[1] with `--base-path=/pub/git --export-all`
then you can even use the `git://` URL with exactly the same path.
diff --git a/Documentation/glossary-content.txt b/Documentation/glossary-content.txt
index aa2f41f..d71b199 100644
--- a/Documentation/glossary-content.txt
+++ b/Documentation/glossary-content.txt
@@ -20,7 +20,7 @@
[[def_branch]]branch::
A "branch" is a line of development. The most recent
<<def_commit,commit>> on a branch is referred to as the tip of
- that branch. The tip of the branch is referenced by a branch
+ that branch. The tip of the branch is <<def_ref,referenced>> by a branch
<<def_head,head>>, which moves forward as additional development
is done on the branch. A single Git
<<def_repository,repository>> can track an arbitrary number of
@@ -75,6 +75,21 @@ state in the Git history, by creating a new commit representing the current
state of the <<def_index,index>> and advancing <<def_HEAD,HEAD>>
to point at the new commit.
+[[def_commit_graph_general]]commit graph concept, representations and usage::
+ A synonym for the <<def_DAG,DAG>> structure formed by the commits
+ in the object database, <<def_ref,referenced>> by branch tips,
+ using their <<def_chain,chain>> of linked commits.
+ This structure is the definitive commit graph. The
+ graph can be represented in other ways, e.g. the
+ <<def_commit_graph_file,"commit-graph" file>>.
+
+[[def_commit_graph_file]]commit-graph file::
+ The "commit-graph" (normally hyphenated) file is a supplemental
+ representation of the <<def_commit_graph_general,commit graph>>
+ which accelerates commit graph walks. The "commit-graph" file is
+ stored either in the .git/objects/info directory or in the info
+ directory of an alternate object database.
+
[[def_commit_object]]commit object::
An <<def_object,object>> which contains the information about a
particular <<def_revision,revision>>, such as <<def_parent,parents>>, committer,
@@ -83,9 +98,8 @@ to point at the new commit.
revision.
[[def_commit-ish]]commit-ish (also committish)::
- A <<def_commit_object,commit object>> or an
- <<def_object,object>> that can be recursively dereferenced to
- a commit object.
+ A <<def_commit_object,commit object>> or an <<def_object,object>> that
+ can be recursively <<def_dereference,dereferenced>> to a commit object.
The following are all commit-ishes:
a commit object,
a <<def_tag_object,tag object>> that points to a commit
@@ -110,6 +124,25 @@ to point at the new commit.
dangling object has no references to it from any
reference or <<def_object,object>> in the <<def_repository,repository>>.
+[[def_dereference]]dereference::
+ Referring to a <<def_symref,symbolic ref>>: the action of accessing the
+ <<def_ref,reference>> pointed at by a symbolic ref. Recursive
+ dereferencing involves repeating the aforementioned process on the
+ resulting ref until a non-symbolic reference is found.
++
+Referring to a <<def_tag_object,tag object>>: the action of accessing the
+<<def_object,object>> a tag points at. Tags are recursively dereferenced by
+repeating the operation on the result object until the result has either a
+specified <<def_object_type,object type>> (where applicable) or any non-"tag"
+object type. A synonym for "recursive dereference" in the context of tags is
+"<<def_peel,peel>>".
++
+Referring to a <<def_commit_object,commit object>>: the action of accessing
+the commit's tree object. Commits cannot be dereferenced recursively.
++
+Unless otherwise specified, "dereferencing" as it used in the context of Git
+commands or protocols is implicitly recursive.
+
[[def_detached_HEAD]]detached HEAD::
Normally the <<def_HEAD,HEAD>> stores the name of a
<<def_branch,branch>>, and commands that operate on the
@@ -169,9 +202,11 @@ current branch integrates with) obviously do not work, as there is no
[[def_gitfile]]gitfile::
A plain file `.git` at the root of a working tree that
points at the directory that is the real repository.
+ For proper use see linkgit:git-worktree[1] or linkgit:git-submodule[1].
+ For syntax see linkgit:gitrepository-layout[5].
[[def_grafts]]grafts::
- Grafts enables two otherwise different lines of development to be joined
+ Grafts enable two otherwise different lines of development to be joined
together by recording fake ancestry information for commits. This way
you can make Git pretend the set of <<def_parent,parents>> a <<def_commit,commit>> has
is different from what was recorded when the commit was
@@ -262,7 +297,7 @@ This commit is referred to as a "merge commit", or sometimes just a
identified by its <<def_object_name,object name>>. The objects usually
live in `$GIT_DIR/objects/`.
-[[def_object_identifier]]object identifier::
+[[def_object_identifier]]object identifier (oid)::
Synonym for <<def_object_name,object name>>.
[[def_object_name]]object name::
@@ -279,6 +314,12 @@ This commit is referred to as a "merge commit", or sometimes just a
[[def_octopus]]octopus::
To <<def_merge,merge>> more than two <<def_branch,branches>>.
+[[def_orphan]]orphan::
+ The act of getting on a <<def_branch,branch>> that does not
+ exist yet (i.e., an <<def_unborn,unborn>> branch). After
+ such an operation, the commit first created becomes a commit
+ without a parent, starting a new history.
+
[[def_origin]]origin::
The default upstream <<def_repository,repository>>. Most projects have
at least one upstream project which they track. By default
@@ -429,6 +470,10 @@ exclude;;
of the logical predecessor(s) in the line of development, i.e. its
parents.
+[[def_peel]]peel::
+ The action of recursively <<def_dereference,dereferencing>> a
+ <<def_tag_object,tag object>>.
+
[[def_pickaxe]]pickaxe::
The term <<def_pickaxe,pickaxe>> refers to an option to the diffcore
routines that help select changes that add or delete a given text
@@ -493,6 +538,14 @@ exclude;;
<<def_tree_object,trees>> to the trees or <<def_blob_object,blobs>>
that they contain.
+[[def_reachability_bitmap]]reachability bitmaps::
+ Reachability bitmaps store information about the
+ <<def_reachable,reachability>> of a selected set of commits in
+ a packfile, or a multi-pack index (MIDX), to speed up object search.
+ The bitmaps are stored in a ".bitmap" file. A repository may have at
+ most one bitmap file in use. The bitmap file may belong to either one
+ pack, or the repository's multi-pack index (if it exists).
+
[[def_rebase]]rebase::
To reapply a series of changes from a <<def_branch,branch>> to a
different base, and reset the <<def_head,head>> of that branch
@@ -585,6 +638,20 @@ The most notable example is `HEAD`.
An <<def_object,object>> used to temporarily store the contents of a
<<def_dirty,dirty>> working directory and the index for future reuse.
+[[def_special_ref]]special ref::
+ A ref that has different semantics than normal refs. These refs can be
+ accessed via normal Git commands but may not behave the same as a
+ normal ref in some cases.
++
+The following special refs are known to Git:
+
+ - "`FETCH_HEAD`" is written by linkgit:git-fetch[1] or linkgit:git-pull[1]. It
+ may refer to multiple object IDs. Each object ID is annotated with metadata
+ indicating where it was fetched from and its fetch status.
+
+ - "`MERGE_HEAD`" is written by linkgit:git-merge[1] when resolving merge
+ conflicts. It contains all commit IDs which are being merged.
+
[[def_submodule]]submodule::
A <<def_repository,repository>> that holds the history of a
separate project inside another repository (the latter of
@@ -597,12 +664,11 @@ The most notable example is `HEAD`.
copies of) commit objects of the contained submodules.
[[def_symref]]symref::
- Symbolic reference: instead of containing the <<def_SHA1,SHA-1>>
- id itself, it is of the format 'ref: refs/some/thing' and when
- referenced, it recursively dereferences to this reference.
- '<<def_HEAD,HEAD>>' is a prime example of a symref. Symbolic
- references are manipulated with the linkgit:git-symbolic-ref[1]
- command.
+ Symbolic reference: instead of containing the <<def_SHA1,SHA-1>> id
+ itself, it is of the format 'ref: refs/some/thing' and when referenced,
+ it recursively <<def_dereference,dereferences>> to this reference.
+ '<<def_HEAD,HEAD>>' is a prime example of a symref. Symbolic references
+ are manipulated with the linkgit:git-symbolic-ref[1] command.
[[def_tag]]tag::
A <<def_ref,ref>> under `refs/tags/` namespace that points to an
@@ -638,11 +704,11 @@ The most notable example is `HEAD`.
<<def_tree,tree>> is equivalent to a <<def_directory,directory>>.
[[def_tree-ish]]tree-ish (also treeish)::
- A <<def_tree_object,tree object>> or an <<def_object,object>>
- that can be recursively dereferenced to a tree object.
- Dereferencing a <<def_commit_object,commit object>> yields the
- tree object corresponding to the <<def_revision,revision>>'s
- top <<def_directory,directory>>.
+ A <<def_tree_object,tree object>> or an <<def_object,object>> that can
+ be recursively <<def_dereference,dereferenced>> to a tree object.
+ Dereferencing a <<def_commit_object,commit object>> yields the tree
+ object corresponding to the <<def_revision,revision>>'s top
+ <<def_directory,directory>>.
The following are all tree-ishes:
a <<def_commit-ish,commit-ish>>,
a tree object,
@@ -651,6 +717,18 @@ The most notable example is `HEAD`.
object,
etc.
+[[def_unborn]]unborn::
+ The <<def_HEAD,HEAD>> can point at a <<def_branch,branch>>
+ that does not yet exist and that does not have any commit on
+ it yet, and such a branch is called an unborn branch. The
+ most typical way users encounter an unborn branch is by
+ creating a repository anew without cloning from elsewhere.
+ The HEAD would point at the 'main' (or 'master', depending
+ on your configuration) branch that is yet to be born. Also
+ some operations can get you on an unborn branch with their
+ <<def_orphan,orphan>> option.
+
+
[[def_unmerged_index]]unmerged index::
An <<def_index,index>> which contains unmerged
<<def_index_entry,index entries>>.
diff --git a/Documentation/howto/coordinate-embargoed-releases.txt b/Documentation/howto/coordinate-embargoed-releases.txt
index 601aae8..b9cb95e 100644
--- a/Documentation/howto/coordinate-embargoed-releases.txt
+++ b/Documentation/howto/coordinate-embargoed-releases.txt
@@ -1,9 +1,10 @@
Content-type: text/asciidoc
-Abstract: When a critical vulnerability is discovered and fixed, we follow this
- script to coordinate a public release.
+Abstract: When a vulnerability is reported, we follow these guidelines to
+ assess the vulnerability, create and review a fix, and coordinate embargoed
+ security releases.
How we coordinate embargoed releases
-====================================
+------------------------------------
To protect Git users from critical vulnerabilities, we do not just release
fixed versions like regular maintenance releases. Instead, we coordinate
@@ -11,33 +12,147 @@ releases with packagers, keeping the fixes under an embargo until the release
date. That way, users will have a chance to upgrade on that date, no matter
what Operating System or distribution they run.
-Open a Security Advisory draft
-------------------------------
+The `git-security` mailing list
+-------------------------------
+
+Responsible disclosures of vulnerabilities, analysis, proposed fixes as
+well as the orchestration of coordinated embargoed releases all happen on the
+`git-security` mailing list at <git-security@googlegroups.com>.
+
+In this context, the term "embargo" refers to the time period that information
+about a vulnerability is kept under wraps and only shared on a need-to-know
+basis. This is necessary to protect Git's users from bad actors who would
+otherwise be made aware of attack vectors that could be exploited. "Lifting the
+embargo" refers to publishing the version that fixes the vulnerabilities.
+
+Audience of the `git-security` mailing list
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Anybody may contact the `git-security` mailing list by sending an email
+to <git-security@googlegroups.com>, though the archive is closed to the
+public and only accessible to subscribed members.
+
+There are a few dozen subscribed members: core Git developers who are trusted
+with addressing vulnerabilities, and stakeholders (i.e. owners of products
+affected by security vulnerabilities in Git).
+
+Most of the discussions revolve around assessing the severity of the reported
+issue (including the decision whether the report is security-relevant or can be
+redirected to the public mailing list), how to remediate the issue, determining
+the timeline of the disclosure as well as aligning priorities and
+requirements.
-The first step is to https://github.com/git/git/security/advisories/new[open an
-advisory]. Technically, it is not necessary, but it is convenient and saves a
-bit of hassle. This advisory can also be used to obtain the CVE number and it
-will give us a private fork associated with it that can be used to collaborate
-on a fix.
+Communications
+~~~~~~~~~~~~~~
-Release date of the embargoed version
--------------------------------------
+If you are a stakeholder, it is a good idea to pay close attention to the
+discussions, as pertinent information may be buried in the middle of a lively
+conversation that might not look relevant to your interests. For example, the
+tentative timeline might be agreed upon in the middle of discussing code
+comment formatting in one of the patches and whether or not to combine fixes
+for multiple, separate vulnerabilities into the same embargoed release. Most
+mail threads are not usually structured specifically to communicate
+agreements, assessments or timelines.
-If the vulnerability affects Windows users, we want to have our friends over at
-Visual Studio on board. This means we need to target a "Patch Tuesday" (i.e. a
-second Tuesday of the month), at the minimum three weeks from heads-up to
-coordinated release.
+Typical timeline
+----------------
-If the vulnerability affects the server side, or can benefit from scans on the
-server side (i.e. if `git fsck` can detect an attack), it is important to give
-all involved Git repository hosting sites enough time to scan all of those
-repositories.
+- A potential vulnerability is reported to the `git-security` mailing list.
+
+- The members of the git-security list start a discussion to give an initial
+ assessment of the severity of the reported potential vulnerability.
+ We aspire to do so within a few days.
+
+- After discussion, if consensus is reached that it is not critical enough
+ to warrant any embargo, the reporter is redirected to the public Git mailing
+ list. This ends the reporter's interaction with the `git-security` list.
+
+- If it is deemed critical enough for an embargo, ideas are presented on how to
+ address the vulnerability.
+
+- Usually around that time, the Git maintainer or their delegate(s) open a draft
+ security advisory in the `git/git` repository on GitHub (see below for more
+ details).
+
+- Code review can take place in a variety of different locations,
+ depending on context. These are: patches sent inline on the git-security list,
+ a private fork on GitHub associated with the draft security advisory, or the
+ git/cabal repository.
+
+- Contributors working on a fix should consider beginning by sending
+ patches to the git-security list (inline with the original thread), since they
+ are accessible to all subscribers, along with the original reporter.
+
+- Once the review has settled and everyone involved in the review agrees that
+ the patches are nearing the finish line, the Git maintainer, and others
+ determine a release date as well as the release trains that are serviced. The
+ decision regarding which versions need a backported fix is based on input from
+ the reporter, the contributor who worked on the patches, and from
+ stakeholders. Operators of hosting sites who may want to analyze whether the
+ given issue is exploited via any of the repositories they host, and binary
+ packagers who want to make sure their product gets patched adequately against
+ the vulnerability, for example, may want to give their input at this stage.
+
+- While the Git community does its best to accommodate the specific timeline
+ requests of the various binary packagers, the nature of the issue may preclude
+ a prolonged release schedule. For fixes deemed urgent, it may be in the best
+ interest of the Git users community to shorten the disclosure and release
+ timeline, and packagers may need to adapt accordingly.
+
+- Subsequently, branches with the fixes are pushed to the git/cabal repository.
+
+- The tags are created by the Git maintainer and pushed to the same repository.
+
+- The Git for Windows, Git for macOS, BSD, Debian, etc. maintainers prepare the
+ corresponding release artifacts, based on the tags created that have been
+ prepared by the Git maintainer.
+
+- The release artifacts prepared by various binary packagers can be
+ made available to stakeholders under embargo via a mail to the
+ `git-security` list.
+
+- Less than a week before the release, a mail with the relevant information is
+ sent to <distros@vs.openwall.org> (see below), a list used to pre-announce
+ embargoed releases of open source projects to the stakeholders of all major
+ distributions of Linux as well as other OSes.
+
+- Public communication is then prepared in advance of the release date. This
+ includes blog posts and mails to the Git and Git for Windows mailing lists.
+
+- On the day of the release, at around 10am Pacific Time, the Git maintainer
+ pushes the tag and the `master` branch to the public repository, then sends
+ out an announcement mail.
+
+- Once the tag is pushed, the Git for Windows maintainer publishes the
+ corresponding tag and creates a GitHub Release with the associated release
+ artifacts (Git for Windows installer, Portable Git, MinGit, etc).
+
+- Git for Windows release is then announced via a mail to the public Git and
+ Git for Windows mailing lists as well as via a tweet.
+
+- Ditto for distribution packagers for Linux and other platforms:
+ their releases are announced via their preferred channels.
+
+- A mail to <oss-security@lists.openwall.org> (see below for details) is sent
+ as a follow-up to the <distros@vs.openwall.org> one, describing the
+ vulnerability in detail, often including a proof of concept of an exploit.
+
+Note: The Git project makes no guarantees about timelines, but aims to keep
+embargoes reasonably short in the interest of keeping Git's users safe.
+
+Opening a Security Advisory draft
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The first step is to https://github.com/git/git/security/advisories/new[open
+an advisory]. Technically, this is not necessary. However, it is the most
+convenient way to obtain the CVE number and it gives us a private repository
+associated with it that can be used to collaborate on a fix.
Notifying the Linux distributions
----------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At most two weeks before release date, we need to send a notification to
-distros@vs.openwall.org, preferably less than 7 days before the release date.
+<distros@vs.openwall.org>, preferably less than 7 days before the release date.
This will reach most (all?) Linux distributions. See an example below, and the
guidelines for this mailing list at
https://oss-security.openwall.org/wiki/mailing-lists/distros#how-to-use-the-lists[here].
@@ -65,7 +180,7 @@ created using a command like this:
tar cJvf cve-xxx.bundle.tar.xz cve-xxx.bundle
Example mail to distros@vs.openwall.org
----------------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
....
To: distros@vs.openwall.org
@@ -101,7 +216,7 @@ Thanks,
....
Example mail to oss-security@lists.openwall.com
------------------------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
....
To: oss-security@lists.openwall.com
@@ -128,4 +243,4 @@ it goes to <developer>.
Thanks,
<name>
-....
+.... \ No newline at end of file
diff --git a/Documentation/howto/keep-canonical-history-correct.txt b/Documentation/howto/keep-canonical-history-correct.txt
index 35d48ef..5f800fd 100644
--- a/Documentation/howto/keep-canonical-history-correct.txt
+++ b/Documentation/howto/keep-canonical-history-correct.txt
@@ -213,4 +213,4 @@ The procedure will result in a history that looks like this:
B0--B1---------B2
------------
-See also http://git-blame.blogspot.com/2013/09/fun-with-first-parent-history.html
+See also https://git-blame.blogspot.com/2013/09/fun-with-first-parent-history.html
diff --git a/Documentation/howto/maintain-git.txt b/Documentation/howto/maintain-git.txt
index a67130d..013014b 100644
--- a/Documentation/howto/maintain-git.txt
+++ b/Documentation/howto/maintain-git.txt
@@ -104,7 +104,7 @@ by doing the following:
files in mbox format).
- Write his own patches to address issues raised on the list but
- nobody has stepped up solving. Send it out just like other
+ nobody has stepped up to solve. Send it out just like other
contributors do, and pick them up just like patches from other
contributors (see above).
@@ -231,7 +231,7 @@ by doing the following:
- Prepare 'jch' branch, which is used to represent somewhere
between 'master' and 'seen' and often is slightly ahead of 'next'.
- $ Meta/Reintegrate master..seen >Meta/redo-jch.sh
+ $ Meta/Reintegrate master..jch >Meta/redo-jch.sh
The result is a script that lists topics to be merged in order to
rebuild 'seen' as the input to Meta/Reintegrate script. Remove
@@ -256,7 +256,7 @@ by doing the following:
merged to 'next', add it at the end of the list. Then:
$ git checkout -B jch master
- $ Meta/redo-jch.sh -c1
+ $ sh Meta/redo-jch.sh -c1
to rebuild the 'jch' branch from scratch. "-c1" tells the script
to stop merging at the first line that begins with '###'
@@ -283,6 +283,11 @@ by doing the following:
$ git diff jch next
+ Then build the rest of 'jch':
+
+ $ git checkout jch
+ $ sh Meta/redo-jch.sh
+
When all is well, clean up the redo-jch.sh script with
$ sh Meta/redo-jch.sh -u
@@ -293,7 +298,7 @@ by doing the following:
- Rebuild 'seen'.
- $ Meta/Reintegrate master..seen >Meta/redo-seen.sh
+ $ Meta/Reintegrate jch..seen >Meta/redo-seen.sh
Edit the result by adding new topics that are not still in 'seen'
in the script. Then
@@ -406,13 +411,13 @@ Preparing a "merge-fix"
A merge of two topics may not textually conflict but still have
conflict at the semantic level. A classic example is for one topic
-to rename an variable and all its uses, while another topic adds a
+to rename a variable and all its uses, while another topic adds a
new use of the variable under its old name. When these two topics
are merged together, the reference to the variable newly added by
the latter topic will still use the old name in the result.
The Meta/Reintegrate script that is used by redo-jch and redo-seen
-scripts implements a crude but usable way to work this issue around.
+scripts implements a crude but usable way to work around this issue.
When the script merges branch $X, it checks if "refs/merge-fix/$X"
exists, and if so, the effect of it is squashed into the result of
the mechanical merge. In other words,
diff --git a/Documentation/howto/new-command.txt b/Documentation/howto/new-command.txt
index 15a4c80..880c511 100644
--- a/Documentation/howto/new-command.txt
+++ b/Documentation/howto/new-command.txt
@@ -1,13 +1,13 @@
From: Eric S. Raymond <esr@thyrsus.com>
Abstract: This is how-to documentation for people who want to add extension
- commands to Git. It should be read alongside api-builtin.txt.
+ commands to Git. It should be read alongside builtin.h.
Content-type: text/asciidoc
How to integrate new subcommands
================================
This is how-to documentation for people who want to add extension
-commands to Git. It should be read alongside api-builtin.txt.
+commands to Git. It should be read alongside builtin.h.
Runtime environment
-------------------
diff --git a/Documentation/howto/recover-corrupted-object-harder.txt b/Documentation/howto/recover-corrupted-object-harder.txt
index 8994e25..5efb4fe 100644
--- a/Documentation/howto/recover-corrupted-object-harder.txt
+++ b/Documentation/howto/recover-corrupted-object-harder.txt
@@ -68,7 +68,7 @@ Note that the "object" file isn't fit for feeding straight to zlib; it
has the git packed object header, which is variable-length. We want to
strip that off so we can start playing with the zlib data directly. You
can either work your way through it manually (the format is described in
-link:../technical/pack-format.html[Documentation/technical/pack-format.txt]),
+linkgit:gitformat-pack[5]),
or you can walk through it in a debugger. I did the latter, creating a
valid pack like:
diff --git a/Documentation/howto/update-hook-example.txt b/Documentation/howto/update-hook-example.txt
index 151ee84..4e727de 100644
--- a/Documentation/howto/update-hook-example.txt
+++ b/Documentation/howto/update-hook-example.txt
@@ -100,7 +100,7 @@ info "The user is: '$username'"
if test -f "$allowed_users_file"
then
- rc=$(cat $allowed_users_file | grep -v '^#' | grep -v '^$' |
+ rc=$(grep -Ev '^(#|$)' $allowed_users_file |
while read heads user_patterns
do
# does this rule apply to us?
@@ -138,7 +138,7 @@ info "'$groups'"
if test -f "$allowed_groups_file"
then
- rc=$(cat $allowed_groups_file | grep -v '^#' | grep -v '^$' |
+ rc=$(grep -Ev '^(#|$)' $allowed_groups_file |
while read heads group_patterns
do
# does this rule apply to us?
diff --git a/Documentation/howto/use-git-daemon.txt b/Documentation/howto/use-git-daemon.txt
index 7af2e52..2cad9b3 100644
--- a/Documentation/howto/use-git-daemon.txt
+++ b/Documentation/howto/use-git-daemon.txt
@@ -4,7 +4,7 @@ How to use git-daemon
=====================
Git can be run in inetd mode and in stand alone mode. But all you want is
-let a coworker pull from you, and therefore need to set up a Git server
+to let a coworker pull from you, and therefore need to set up a Git server
real quick, right?
Note that git-daemon is not really chatty at the moment, especially when
diff --git a/Documentation/howto/using-merge-subtree.txt b/Documentation/howto/using-merge-subtree.txt
index a499a94..3bd581a 100644
--- a/Documentation/howto/using-merge-subtree.txt
+++ b/Documentation/howto/using-merge-subtree.txt
@@ -11,7 +11,7 @@ Message-ID: <BAYC1-PASMTP12374B54BA370A1E1C6E78AE4E0@CEZ.ICE>
How to use the subtree merge strategy
=====================================
-There are situations where you want to include contents in your project
+There are situations where you want to include content in your project
from an independently developed project. You can just pull from the
other project as long as there are no conflicting paths.
diff --git a/Documentation/i18n.txt b/Documentation/i18n.txt
index 6c6baee..3a866af 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' issues
+. '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
@@ -46,7 +46,7 @@ mind.
------------
+
Commit objects created with the above setting record the value
-of `i18n.commitEncoding` in its `encoding` header. This is to
+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.
diff --git a/Documentation/includes/cmd-config-section-all.txt b/Documentation/includes/cmd-config-section-all.txt
new file mode 100644
index 0000000..296a239
--- /dev/null
+++ b/Documentation/includes/cmd-config-section-all.txt
@@ -0,0 +1,3 @@
+Everything below this line in this section is selectively included
+from the linkgit:git-config[1] documentation. The content is the same
+as what's found there:
diff --git a/Documentation/includes/cmd-config-section-rest.txt b/Documentation/includes/cmd-config-section-rest.txt
new file mode 100644
index 0000000..b1e7682
--- /dev/null
+++ b/Documentation/includes/cmd-config-section-rest.txt
@@ -0,0 +1,3 @@
+Everything above this line in this section isn't included from the
+linkgit:git-config[1] documentation. The content that follows is the
+same as what's found there:
diff --git a/Documentation/lint-fsck-msgids.perl b/Documentation/lint-fsck-msgids.perl
new file mode 100755
index 0000000..1233ffe
--- /dev/null
+++ b/Documentation/lint-fsck-msgids.perl
@@ -0,0 +1,70 @@
+#!/usr/bin/perl
+
+my ($fsck_h, $fsck_msgids_txt, $okfile) = @ARGV;
+
+my (%in_fsck_h, $fh, $bad);
+
+open($fh, "<", "$fsck_h") or die;
+while (<$fh>) {
+ if (/^\s+FUNC\(([0-9A-Z_]+), ([A-Z]+)\)/) {
+ my ($name, $severity) = ($1, $2);
+ my ($first) = 1;
+ $name = join('',
+ map {
+ y/A-Z/a-z/;
+ if (!$first) {
+ s/^(.)/uc($1)/e;
+ } else {
+ $first = 0;
+ }
+ $_;
+ }
+ split(/_/, $name));
+ $in_fsck_h{$name} = $severity;
+ }
+}
+close($fh);
+
+open($fh, "<", "$fsck_msgids_txt") or die;
+my ($previous, $current);
+while (<$fh>) {
+ if (!defined $current) {
+ if (/^\`([a-zA-Z0-9]*)\`::/) {
+ $current = $1;
+ if ((defined $previous) &&
+ ($current le $previous)) {
+ print STDERR "$previous >= $current in doc\n";
+ $bad = 1;
+ }
+ }
+ } elsif (/^\s+\(([A-Z]+)\) /) {
+ my ($level) = $1;
+ if (!exists $in_fsck_h{$current}) {
+ print STDERR "$current does not exist in fsck.h\n";
+ $bad = 1;
+ } elsif ($in_fsck_h{$current} eq "") {
+ print STDERR "$current defined twice\n";
+ $bad = 1;
+ } elsif ($in_fsck_h{$current} ne $level) {
+ print STDERR "$current severity $level != $in_fsck_h{$current}\n";
+ $bad = 1;
+ }
+ $previous = $current;
+ $in_fsck_h{$current} = ""; # mark as seen.
+ undef $current;
+ }
+}
+close($fh);
+
+for my $key (keys %in_fsck_h) {
+ if ($in_fsck_h{$key} ne "") {
+ print STDERR "$key not explained in doc.\n";
+ $bad = 1;
+ }
+}
+
+die if ($bad);
+
+open($fh, ">", "$okfile");
+print $fh "good\n";
+close($fh);
diff --git a/Documentation/lint-man-section-order.perl b/Documentation/lint-man-section-order.perl
index 425377d..02408a0 100755
--- a/Documentation/lint-man-section-order.perl
+++ b/Documentation/lint-man-section-order.perl
@@ -32,6 +32,9 @@ my %SECTIONS;
'SEE ALSO' => {
order => $order++,
},
+ 'FILE FORMAT' => {
+ order => $order++,
+ },
'GIT' => {
required => 1,
order => $order++,
diff --git a/Documentation/manpage-base-url.xsl.in b/Documentation/manpage-base-url.xsl.in
deleted file mode 100644
index e800904..0000000
--- a/Documentation/manpage-base-url.xsl.in
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- manpage-base-url.xsl:
- special settings for manpages rendered from newer docbook -->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
-
-<!-- set a base URL for relative links -->
-<xsl:param name="man.base.url.for.relative.links"
- >@@MAN_BASE_URL@@</xsl:param>
-
-</xsl:stylesheet>
diff --git a/Documentation/manpage-normal.xsl b/Documentation/manpage-normal.xsl
index a9c7ec6..beb5ff8 100644
--- a/Documentation/manpage-normal.xsl
+++ b/Documentation/manpage-normal.xsl
@@ -8,19 +8,7 @@
<xsl:param name="man.output.quietly" select="1"/>
<xsl:param name="refentry.meta.get.quietly" select="1"/>
-<!-- convert asciidoc callouts to man page format -->
-<xsl:template match="co">
- <xsl:value-of select="concat('\fB(',substring-after(@id,'-'),')\fR')"/>
-</xsl:template>
-<xsl:template match="calloutlist">
- <xsl:text>.sp&#10;</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>&#10;</xsl:text>
-</xsl:template>
-<xsl:template match="callout">
- <xsl:value-of select="concat('\fB',substring-after(@arearefs,'-'),'. \fR')"/>
- <xsl:apply-templates/>
- <xsl:text>.br&#10;</xsl:text>
-</xsl:template>
+<!-- unset maximum length of title -->
+<xsl:param name="man.th.title.max.length"/>
</xsl:stylesheet>
diff --git a/Documentation/manpage-quote-apos.xsl b/Documentation/manpage-quote-apos.xsl
deleted file mode 100644
index aeb8839..0000000
--- a/Documentation/manpage-quote-apos.xsl
+++ /dev/null
@@ -1,16 +0,0 @@
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
-
-<!-- work around newer groff/man setups using a prettier apostrophe
- that unfortunately does not quote anything when cut&pasting
- examples to the shell -->
-<xsl:template name="escape.apostrophe">
- <xsl:param name="content"/>
- <xsl:call-template name="string.subst">
- <xsl:with-param name="string" select="$content"/>
- <xsl:with-param name="target">'</xsl:with-param>
- <xsl:with-param name="replacement">\(aq</xsl:with-param>
- </xsl:call-template>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index d8f7cd7..3eaefc4 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -191,7 +191,7 @@ endif::git-pull[]
--autostash::
--no-autostash::
Automatically create a temporary stash entry before the operation
- begins, record it in the special ref `MERGE_AUTOSTASH`
+ begins, record it in the ref `MERGE_AUTOSTASH`
and apply it after the operation ends. This means
that you can run the operation on a dirty worktree. However, use
with care: the final stash application after a successful
diff --git a/Documentation/mergetools/vimdiff.txt b/Documentation/mergetools/vimdiff.txt
index 2d631e9..befa86d 100644
--- a/Documentation/mergetools/vimdiff.txt
+++ b/Documentation/mergetools/vimdiff.txt
@@ -32,10 +32,10 @@ have special meaning:
- `+` is used to "open a new tab"
- `,` is used to "open a new vertical split"
- `/` is used to "open a new horizontal split"
- - `@` is used to indicate which is the file containing the final version after
+ - `@` is used to indicate the file containing the final version after
solving the conflicts. If not present, `MERGED` will be used by default.
-The precedence of the operators is this one (you can use parentheses to change
+The precedence of the operators is as follows (you can use parentheses to change
it):
`@` > `+` > `/` > `,`
@@ -162,7 +162,7 @@ information as the first tab, with a different layout.
| REMOTE | |
---------------------------------------------
....
-Note how in the third tab definition we need to use parenthesis to make `,`
+Note how in the third tab definition we need to use parentheses to make `,`
have precedence over `/`.
--
@@ -177,7 +177,8 @@ Instead of `--tool=vimdiff`, you can also use one of these other variants:
When using these variants, in order to specify a custom layout you will have to
set configuration variables `mergetool.gvimdiff.layout` and
-`mergetool.nvimdiff.layout` instead of `mergetool.vimdiff.layout`
+`mergetool.nvimdiff.layout` instead of `mergetool.vimdiff.layout` (though the
+latter will be used as fallback if the variant-specific one is not set).
In addition, for backwards compatibility with previous Git versions, you can
also append `1`, `2` or `3` to either `vimdiff` or any of the variants (ex:
diff --git a/Documentation/object-format-disclaimer.txt b/Documentation/object-format-disclaimer.txt
index 4cb106f..e561e66 100644
--- a/Documentation/object-format-disclaimer.txt
+++ b/Documentation/object-format-disclaimer.txt
@@ -1,6 +1,9 @@
-THIS OPTION IS EXPERIMENTAL! SHA-256 support is experimental and still
-in an early stage. A SHA-256 repository will in general not be able to
-share work with "regular" SHA-1 repositories. It should be assumed
-that, e.g., Git internal file formats in relation to SHA-256
-repositories may change in backwards-incompatible ways. Only use
-`--object-format=sha256` for testing purposes.
+Note: At present, there is no interoperability between SHA-256
+repositories and SHA-1 repositories.
+
+Historically, we warned that SHA-256 repositories may later need
+backward incompatible changes when we introduce such interoperability
+features. Today, we only expect compatible changes. Furthermore, if such
+changes prove to be necessary, it can be expected that SHA-256 repositories
+created with today's Git will be usable by future versions of Git
+without data loss.
diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt
index 0b4c1c8..8ee940b 100644
--- a/Documentation/pretty-formats.txt
+++ b/Documentation/pretty-formats.txt
@@ -122,7 +122,9 @@ The placeholders are:
- Placeholders that expand to a single literal character:
'%n':: newline
'%%':: a raw '%'
-'%x00':: print a byte from a hex code
+'%x00':: '%x' followed by two hexadecimal digits is replaced with a
+ byte with the hexadecimal digits' value (we will call this
+ "literal formatting code" in the rest of this document).
- Placeholders that affect formatting of later placeholders:
'%Cred':: switch color to red
@@ -146,24 +148,34 @@ The placeholders are:
'%m':: left (`<`), right (`>`) or boundary (`-`) mark
'%w([<w>[,<i1>[,<i2>]]])':: switch line wrapping, like the -w option of
linkgit:git-shortlog[1].
-'%<(<N>[,trunc|ltrunc|mtrunc])':: make the next placeholder take at
- least N columns, padding spaces on
+'%<( <N> [,trunc|ltrunc|mtrunc])':: make the next placeholder take at
+ least N column widths, padding spaces on
the right if necessary. Optionally
- truncate at the beginning (ltrunc),
- the middle (mtrunc) or the end
- (trunc) if the output is longer than
- N columns. Note that truncating
+ truncate (with ellipsis '..') at the left (ltrunc) `..ft`,
+ the middle (mtrunc) `mi..le`, or the end
+ (trunc) `rig..`, if the output is longer than
+ N columns.
+ Note 1: that truncating
only works correctly with N >= 2.
-'%<|(<N>)':: make the next placeholder take at least until Nth
- columns, padding spaces on the right if necessary
-'%>(<N>)', '%>|(<N>)':: similar to '%<(<N>)', '%<|(<N>)' respectively,
+ Note 2: spaces around the N and M (see below)
+ values are optional.
+ Note 3: Emojis and other wide characters
+ will take two display columns, which may
+ over-run column boundaries.
+ Note 4: decomposed character combining marks
+ may be misplaced at padding boundaries.
+'%<|( <M> )':: make the next placeholder take at least until Mth
+ display column, padding spaces on the right if necessary.
+ Use negative M values for column positions measured
+ from the right hand edge of the terminal window.
+'%>( <N> )', '%>|( <M> )':: similar to '%<( <N> )', '%<|( <M> )' respectively,
but padding spaces on the left
-'%>>(<N>)', '%>>|(<N>)':: similar to '%>(<N>)', '%>|(<N>)'
+'%>>( <N> )', '%>>|( <M> )':: similar to '%>( <N> )', '%>|( <M> )'
respectively, except that if the next
placeholder takes more spaces than given and
there are spaces on its left, use those
spaces
-'%><(<N>)', '%><|(<N>)':: similar to '%<(<N>)', '%<|(<N>)'
+'%><( <N> )', '%><|( <M> )':: similar to '%<( <N> )', '%<|( <M> )'
respectively, but padding both sides
(i.e. the text is centered)
@@ -212,13 +224,30 @@ The placeholders are:
linkgit:git-rev-list[1])
'%d':: ref names, like the --decorate option of linkgit:git-log[1]
'%D':: ref names without the " (", ")" wrapping.
-'%(describe[:options])':: human-readable name, like
- linkgit:git-describe[1]; empty string for
- undescribable commits. The `describe` string
- may be followed by a colon and zero or more
- comma-separated options. Descriptions can be
- inconsistent when tags are added or removed at
- the same time.
+'%(decorate[:<options>])'::
+ref names with custom decorations. The `decorate` string may be followed by a
+colon and zero or more comma-separated options. Option values may contain
+literal formatting codes. These must be used for commas (`%x2C`) and closing
+parentheses (`%x29`), due to their role in the option syntax.
++
+** 'prefix=<value>': Shown before the list of ref names. Defaults to "{nbsp}`(`".
+** 'suffix=<value>': Shown after the list of ref names. Defaults to "`)`".
+** 'separator=<value>': Shown between ref names. Defaults to "`,`{nbsp}".
+** 'pointer=<value>': Shown between HEAD and the branch it points to, if any.
+ Defaults to "{nbsp}`->`{nbsp}".
+** 'tag=<value>': Shown before tag names. Defaults to "`tag:`{nbsp}".
+
++
+For example, to produce decorations with no wrapping
+or tag annotations, and spaces as separators:
++
+`%(decorate:prefix=,suffix=,tag=,separator= )`
+
+'%(describe[:<options>])'::
+human-readable name, like linkgit:git-describe[1]; empty string for
+undescribable commits. The `describe` string may be followed by a colon and
+zero or more comma-separated options. Descriptions can be inconsistent when
+tags are added or removed at the same time.
+
** 'tags[=<bool-value>]': Instead of only considering annotated tags,
consider lightweight tags as well.
@@ -271,13 +300,11 @@ endif::git-rev-list[]
'%gE':: reflog identity email (respecting .mailmap, see
linkgit:git-shortlog[1] or linkgit:git-blame[1])
'%gs':: reflog subject
-'%(trailers[:options])':: display the trailers of the body as
- interpreted by
- linkgit:git-interpret-trailers[1]. The
- `trailers` string may be followed by a colon
- and zero or more comma-separated options.
- If any option is provided multiple times the
- last occurrence wins.
+'%(trailers[:<options>])'::
+display the trailers of the body as interpreted by
+linkgit:git-interpret-trailers[1]. The `trailers` string may be followed by
+a colon and zero or more comma-separated options. If any option is provided
+multiple times, the last occurrence wins.
+
** 'key=<key>': only show trailers with specified <key>. Matching is done
case-insensitively and trailing colon is optional. If option is
@@ -289,9 +316,8 @@ endif::git-rev-list[]
`Reviewed-by`.
** 'only[=<bool>]': select whether non-trailer lines from the trailer
block should be included.
-** 'separator=<sep>': specify a separator inserted between trailer
- lines. When this option is not given each trailer line is
- terminated with a line feed character. The string <sep> may contain
+** 'separator=<sep>': specify the separator inserted between trailer
+ lines. Defaults to a line feed character. The string <sep> may contain
the literal formatting codes described above. To use comma as
separator one must use `%x2C` as it would otherwise be parsed as
next option. E.g., `%(trailers:key=Ticket,separator=%x2C )`
@@ -302,10 +328,9 @@ endif::git-rev-list[]
`%(trailers:only,unfold=true)` unfolds and shows all trailer lines.
** 'keyonly[=<bool>]': only show the key part of the trailer.
** 'valueonly[=<bool>]': only show the value part of the trailer.
-** 'key_value_separator=<sep>': specify a separator inserted between
- trailer lines. When this option is not given each trailer key-value
- pair is separated by ": ". Otherwise it shares the same semantics
- as 'separator=<sep>' above.
+** 'key_value_separator=<sep>': specify the separator inserted between
+ the key and value of each trailer. Defaults to ": ". Otherwise it
+ shares the same semantics as 'separator=<sep>' above.
NOTE: Some placeholders may depend on other options given to the
revision traversal engine. For example, the `%g*` reflog options will
diff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt
index dc685be..23888cd 100644
--- a/Documentation/pretty-options.txt
+++ b/Documentation/pretty-options.txt
@@ -48,7 +48,7 @@ people using 80-column terminals.
--expand-tabs::
--no-expand-tabs::
Perform a tab expansion (replace each tab with enough spaces
- to fill to the next display column that is multiple of '<n>')
+ to fill to the next display column that is a multiple of '<n>')
in the log message before showing it in the output.
`--expand-tabs` is a short-hand for `--expand-tabs=8`, and
`--no-expand-tabs` is a short-hand for `--expand-tabs=0`,
@@ -73,7 +73,7 @@ environment overrides). See linkgit:git-config[1] for more details.
With an optional '<ref>' argument, use the ref to find the notes
to display. The ref can specify the full refname when it begins
with `refs/notes/`; when it begins with `notes/`, `refs/` and otherwise
-`refs/notes/` is prefixed to form a full name of the ref.
+`refs/notes/` is prefixed to form the full name of the ref.
+
Multiple --notes options can be combined to control which notes are
being displayed. Examples: "--notes=foo" will show only notes from
@@ -87,6 +87,10 @@ being displayed. Examples: "--notes=foo" will show only notes from
"--notes --notes=foo --no-notes --notes=bar" will only show notes
from "refs/notes/bar".
+--show-notes-by-default::
+ Show the default notes unless options for displaying specific
+ notes are given.
+
--show-notes[=<ref>]::
--[no-]standard-notes::
These options are deprecated. Use the above --notes/--no-notes
diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt
index 95a7390..c718f79 100644
--- a/Documentation/pull-fetch-param.txt
+++ b/Documentation/pull-fetch-param.txt
@@ -71,7 +71,7 @@ refspec (or `--force`).
Unlike when pushing with linkgit:git-push[1], any updates outside of
`refs/{tags,heads}/*` will be accepted without `+` in the refspec (or
`--force`), whether that's swapping e.g. a tree object for a blob, or
-a commit for another commit that's doesn't have the previous commit as
+a commit for another commit that doesn't have the previous commit as
an ancestor etc.
+
Unlike when pushing with linkgit:git-push[1], there is no
@@ -80,7 +80,7 @@ configuration which'll amend these rules, and nothing like a
+
As with pushing with linkgit:git-push[1], all of the rules described
above about what's not allowed as an update can be overridden by
-adding an the optional leading `+` to a refspec (or using `--force`
+adding an optional leading `+` to a refspec (or using the `--force`
command line option). The only exception to this is that no amount of
forcing will make the `refs/heads/*` namespace accept a non-commit
object.
@@ -88,7 +88,7 @@ object.
[NOTE]
When the remote branch you want to fetch is known to
be rewound and rebased regularly, it is expected that
-its new tip will not be descendant of its previous tip
+its new tip will not be a descendant of its previous tip
(as stored in your remote-tracking branch the last time
you fetched). You would want
to use the `+` sign to indicate non-fast-forward updates
diff --git a/Documentation/ref-storage-format.txt b/Documentation/ref-storage-format.txt
new file mode 100644
index 0000000..14fff8a
--- /dev/null
+++ b/Documentation/ref-storage-format.txt
@@ -0,0 +1,3 @@
+* `files` for loose files with packed-refs. This is the default.
+* `reftable` for the reftable format. This format is experimental and its
+ internals are subject to change.
diff --git a/Documentation/rerere-options.txt b/Documentation/rerere-options.txt
new file mode 100644
index 0000000..c3321dd
--- /dev/null
+++ b/Documentation/rerere-options.txt
@@ -0,0 +1,9 @@
+--rerere-autoupdate::
+--no-rerere-autoupdate::
+ After the rerere mechanism reuses a recorded resolution on
+ the current conflict to update the files in the working
+ tree, allow it to also update the index with the result of
+ resolution. `--no-rerere-autoupdate` is a good way to
+ double-check what `rerere` did and catch potential
+ mismerges, before committing the result to the index with a
+ separate `git add`.
diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index 195e74e..00ccf68 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -56,7 +56,7 @@ endif::git-rev-list[]
error to use this option unless `--walk-reflogs` is in use.
--grep=<pattern>::
- Limit the commits output to ones with log message that
+ Limit the commits output to ones with a log message that
matches the specified pattern (regular expression). With
more than one `--grep=<pattern>`, commits whose message
matches any of the given patterns are chosen (but see
@@ -72,7 +72,7 @@ endif::git-rev-list[]
instead of ones that match at least one.
--invert-grep::
- Limit the commits output to ones with log message that do not
+ Limit the commits output to ones with a log message that do not
match the pattern specified with `--grep=<pattern>`.
-i::
@@ -151,6 +151,10 @@ endif::git-log[]
--not::
Reverses the meaning of the '{caret}' prefix (or lack thereof)
for all following revision specifiers, up to the next `--not`.
+ When used on the command line before --stdin, the revisions passed
+ through stdin will not be affected by it. Conversely, when passed
+ via standard input, the revisions passed on the command line will
+ not be affected by it.
--all::
Pretend as if all the refs in `refs/`, along with `HEAD`, are
@@ -195,6 +199,14 @@ respectively, and they must begin with `refs/` when applied to `--glob`
or `--all`. If a trailing '/{asterisk}' is intended, it must be given
explicitly.
+--exclude-hidden=[fetch|receive|uploadpack]::
+ Do not include refs that would be hidden by `git-fetch`,
+ `git-receive-pack` or `git-upload-pack` by consulting the appropriate
+ `fetch.hideRefs`, `receive.hideRefs` or `uploadpack.hideRefs`
+ configuration along with `transfer.hideRefs` (see
+ linkgit:git-config[1]). This option affects the next pseudo-ref option
+ `--all` or `--glob` and is cleared after processing them.
+
--reflog::
Pretend as if all objects mentioned by reflogs are listed on the
command line as `<commit>`.
@@ -228,10 +240,13 @@ ifndef::git-rev-list[]
endif::git-rev-list[]
--stdin::
- In addition to the '<commit>' listed on the command
- line, read them from the standard input. If a `--` separator is
- seen, stop reading commits and start reading paths to limit the
- result.
+ In addition to getting arguments from the command line, read
+ them from standard input as well. This accepts commits and
+ pseudo-options like `--all` and `--glob=`. When a `--` separator
+ is seen, the following input is treated as paths and used to
+ limit the result. Flags like `--not` which are read via standard input
+ are only respected for arguments passed in the same way and will not
+ influence any subsequent command line arguments.
ifdef::git-rev-list[]
--quiet::
@@ -242,6 +257,7 @@ ifdef::git-rev-list[]
to `/dev/null` as the output does not have to be formatted.
--disk-usage::
+--disk-usage=human::
Suppress normal output; instead, print the sum of the bytes used
for on-disk storage by the selected commits or objects. This is
equivalent to piping the output into `git cat-file
@@ -249,6 +265,8 @@ ifdef::git-rev-list[]
faster (especially with `--use-bitmap-index`). See the `CAVEATS`
section in linkgit:git-cat-file[1] for the limitations of what
"on-disk storage" means.
+ With the optional value `human`, on-disk storage size is shown
+ in human-readable string(e.g. 12.24 Kib, 3.50 Mib).
endif::git-rev-list[]
--cherry-mark::
@@ -298,12 +316,12 @@ list.
With `--pretty` format other than `oneline` and `reference` (for obvious reasons),
this causes the output to have two extra lines of information
taken from the reflog. The reflog designator in the output may be shown
-as `ref@{Nth}` (where `Nth` is the reverse-chronological index in the
-reflog) or as `ref@{timestamp}` (with the timestamp for that entry),
+as `ref@{<Nth>}` (where _<Nth>_ is the reverse-chronological index in the
+reflog) or as `ref@{<timestamp>}` (with the _<timestamp>_ for that entry),
depending on a few rules:
+
--
-1. If the starting point is specified as `ref@{Nth}`, show the index
+1. If the starting point is specified as `ref@{<Nth>}`, show the index
format.
+
2. If the starting point was specified as `ref@{now}`, show the
@@ -323,8 +341,11 @@ See also linkgit:git-reflog[1].
Under `--pretty=reference`, this information will not be shown at all.
--merge::
- After a failed merge, show refs that touch files having a
- conflict and don't exist on all heads to merge.
+ Show commits touching conflicted paths in the range `HEAD...<other>`,
+ where `<other>` is the first existing pseudoref in `MERGE_HEAD`,
+ `CHERRY_PICK_HEAD`, `REVERT_HEAD` or `REBASE_HEAD`. Only works
+ when the index has unmerged entries. This option can be used to show
+ relevant commits when resolving conflicts from a 3-way merge.
--boundary::
Output excluded boundary commits. Boundary commits are
@@ -389,12 +410,14 @@ Default mode::
merges from the resulting history, as there are no selected
commits contributing to this merge.
---ancestry-path::
+--ancestry-path[=<commit>]::
When given a range of commits to display (e.g. 'commit1..commit2'
- or 'commit2 {caret}commit1'), only display commits that exist
- directly on the ancestry chain between the 'commit1' and
- 'commit2', i.e. commits that are both descendants of 'commit1',
- and ancestors of 'commit2'.
+ or 'commit2 {caret}commit1'), 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
+ times; if so, a commit is included if it is any of the commits
+ given or if it is an ancestor or descendant of one of them.
A more detailed explanation follows.
@@ -568,11 +591,10 @@ Note the major differences in `N`, `P`, and `Q` over `--full-history`:
There is another simplification mode available:
---ancestry-path::
- Limit the displayed commits to those directly on the ancestry
- chain between the ``from'' and ``to'' commits in the given commit
- range. I.e. only display commits that are ancestor of the ``to''
- commit and descendants of the ``from'' commit.
+--ancestry-path[=<commit>]::
+ Limit the displayed commits to those which are an ancestor of
+ <commit>, or which are a descendant of <commit>, or are <commit>
+ itself.
+
As an example use case, consider the following commit history:
+
@@ -604,6 +626,29 @@ option does. Applied to the 'D..M' range, it results in:
\
L--M
-----------------------------------------------------------------------
++
+We can also use `--ancestry-path=D` instead of `--ancestry-path` which
+means the same thing when applied to the 'D..M' range but is just more
+explicit.
++
+If we instead are interested in a given topic within this range, and all
+commits affected by that topic, we may only want to view the subset of
+`D..M` which contain that topic in their ancestry path. So, using
+`--ancestry-path=H D..M` for example would result in:
++
+-----------------------------------------------------------------------
+ E
+ \
+ G---H---I---J
+ \
+ L--M
+-----------------------------------------------------------------------
++
+Whereas `--ancestry-path=K D..M` would result in
++
+-----------------------------------------------------------------------
+ K---------------L--M
+-----------------------------------------------------------------------
Before discussing another option, `--show-pulls`, we need to
create a new example history.
@@ -659,7 +704,7 @@ Here, the merge commits `O` and `P` contribute extra noise, as they did
not actually contribute a change to `file.txt`. They only merged a topic
that was based on an older version of `file.txt`. This is a common
issue in repositories using a workflow where many contributors work in
-parallel and merge their topic branches along a single trunk: manu
+parallel and merge their topic branches along a single trunk: many
unrelated merges appear in the `--full-history` results.
When using the `--simplify-merges` option, the commits `O` and `P`
@@ -855,7 +900,7 @@ ifdef::git-rev-list[]
Print the object IDs of any object referenced by the listed
commits. `--objects foo ^bar` thus means ``send me
all object IDs which I need to download if I have the commit
- object _bar_ but not _foo_''.
+ object _bar_ but not _foo_''. See also `--object-names` below.
--in-commit-order::
Print tree and blob ids in order of the commits. The tree
@@ -885,7 +930,12 @@ ifdef::git-rev-list[]
--object-names::
Only useful with `--objects`; print the names of the object IDs
- that are found. This is the default behavior.
+ that are found. This is the default behavior. Note that the
+ "name" of each object is ambiguous, and mostly intended as a
+ hint for packing objects. In particular: no distinction is made between
+ the names of tags, trees, and blobs; path names may be modified
+ to remove newlines; and if an object would appear multiple times
+ with different names, only one name is shown.
--no-object-names::
Only useful with `--objects`; does not print the names of the object
@@ -900,10 +950,10 @@ ifdef::git-rev-list[]
+
The form '--filter=blob:none' omits all blobs.
+
-The form '--filter=blob:limit=<n>[kmg]' omits blobs larger than n bytes
-or units. n may be zero. The suffixes k, m, and g can be used to name
-units in KiB, MiB, or GiB. For example, 'blob:limit=1k' is the same
-as 'blob:limit=1024'.
+The form '--filter=blob:limit=<n>[kmg]' omits blobs of size at least n
+bytes or units. n may be zero. The suffixes k, m, and g can be used
+to name units in KiB, MiB, or GiB. For example, 'blob:limit=1k'
+is the same as 'blob:limit=1024'.
+
The form '--filter=object:type=(tag|commit|tree|blob)' omits all objects
which are not of the requested type.
@@ -972,6 +1022,10 @@ Unexpected missing objects will raise an error.
+
The form '--missing=print' is like 'allow-any', but will also print a
list of the missing objects. Object IDs are prefixed with a ``?'' character.
++
+If some tips passed to the traversal are missing, they will be
+considered as missing too, and the traversal will ignore them. In case
+we cannot get their Object ID though, an error will be raised.
--exclude-promisor-objects::
(For internal use only.) Prefilter object traversal at
@@ -1066,12 +1120,12 @@ preferred format. See the `strftime` manual for a complete list of
format placeholders. When using `-local`, the correct syntax is
`--date=format-local:...`.
-`--date=default` is the default format, and is similar to
-`--date=rfc2822`, with a few exceptions:
+`--date=default` is the default format, and is based on ctime(3)
+output. It shows a single line with three-letter day of the week,
+three-letter month, day-of-month, hour-minute-seconds in "HH:MM:SS"
+format, followed by 4-digit year, plus timezone information, unless
+the local time zone is used, e.g. `Thu Jan 1 00:00:00 1970 +0000`.
--
- - there is no comma after the day-of-week
-
- - the time zone is omitted when the local time zone is used
ifdef::git-rev-list[]
--header::
diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt
index e3e3501..6ea6c7c 100644
--- a/Documentation/revisions.txt
+++ b/Documentation/revisions.txt
@@ -30,10 +30,11 @@ characters and to avoid word splitting.
explicitly say 'heads/master' to tell Git which one you mean.
When ambiguous, a '<refname>' is disambiguated by taking the
first match in the following rules:
-
++
. If '$GIT_DIR/<refname>' exists, that is what you mean (this is usually
- useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD`, `MERGE_HEAD`
- and `CHERRY_PICK_HEAD`);
+ useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD`, `MERGE_HEAD`,
+ `REBASE_HEAD`, `REVERT_HEAD`, `CHERRY_PICK_HEAD`, `BISECT_HEAD`
+ and `AUTO_MERGE`);
. otherwise, 'refs/<refname>' if it exists;
@@ -44,18 +45,38 @@ characters and to avoid word splitting.
. otherwise, 'refs/remotes/<refname>' if it exists;
. otherwise, 'refs/remotes/<refname>/HEAD' if it exists.
+
+
-`HEAD` names the commit on which you based the changes in the working tree.
-`FETCH_HEAD` records the branch which you fetched from a remote repository
-with your last `git fetch` invocation.
-`ORIG_HEAD` is created by commands that move your `HEAD` in a drastic
-way, to record the position of the `HEAD` before their operation, so that
-you can easily change the tip of the branch back to the state before you ran
-them.
-`MERGE_HEAD` records the commit(s) which you are merging into your branch
-when you run `git merge`.
-`CHERRY_PICK_HEAD` records the commit which you are cherry-picking
-when you run `git cherry-pick`.
+ `HEAD`:::
+ names the commit on which you based the changes in the working tree.
+ `FETCH_HEAD`:::
+ records the branch which you fetched from a remote repository with
+ your last `git fetch` invocation.
+ `ORIG_HEAD`:::
+ is created by commands that move your `HEAD` in a drastic way (`git
+ am`, `git merge`, `git rebase`, `git reset`), to record the position
+ of the `HEAD` before their operation, so that you can easily change
+ the tip of the branch back to the state before you ran them.
+ `MERGE_HEAD`:::
+ records the commit(s) which you are merging into your branch when you
+ run `git merge`.
+ `REBASE_HEAD`:::
+ during a rebase, records the commit at which the operation is
+ currently stopped, either because of conflicts or an `edit` command in
+ an interactive rebase.
+ `REVERT_HEAD`:::
+ records the commit which you are reverting when you run `git revert`.
+ `CHERRY_PICK_HEAD`:::
+ records the commit which you are cherry-picking when you run `git
+ cherry-pick`.
+ `BISECT_HEAD`:::
+ records the current commit to be tested when you run `git bisect
+ --no-checkout`.
+ `AUTO_MERGE`:::
+ records a tree object corresponding to the state the
+ 'ort' merge strategy wrote to the working tree when a merge operation
+ resulted in conflicts.
+
+
Note that any of the 'refs/*' cases above may come either from
the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.
@@ -363,7 +384,7 @@ Revision Range Summary
'<rev>{caret}!', e.g. 'HEAD{caret}!'::
A suffix '{caret}' followed by an exclamation mark is the same
- as giving commit '<rev>' and then all its parents prefixed with
+ as giving commit '<rev>' and all its parents prefixed with
'{caret}' to exclude them (and their ancestors).
'<rev>{caret}-<n>', e.g. 'HEAD{caret}-, HEAD{caret}-2'::
diff --git a/contrib/scalar/scalar.txt b/Documentation/scalar.txt
index c0425e0..361f51a 100644
--- a/contrib/scalar/scalar.txt
+++ b/Documentation/scalar.txt
@@ -3,12 +3,13 @@ scalar(1)
NAME
----
-scalar - an opinionated repository management tool
+scalar - A tool for managing large Git repositories
SYNOPSIS
--------
[verse]
-scalar clone [--single-branch] [--branch <main-branch>] [--full-clone] <url> [<enlistment>]
+scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]
+ [--[no-]src] <url> [<enlistment>]
scalar list
scalar register [<enlistment>]
scalar unregister [<enlistment>]
@@ -20,10 +21,9 @@ scalar delete <enlistment>
DESCRIPTION
-----------
-Scalar is an opinionated repository management tool. By creating new
-repositories or registering existing repositories with Scalar, your Git
-experience will speed up. Scalar sets advanced Git config settings,
-maintains your repositories in the background, and helps reduce data sent
+Scalar is a repository management tool that optimizes Git for use in large
+repositories. Scalar improves performance by configuring advanced Git settings,
+maintaining repositories in the background, and helping to reduce data sent
across the network.
An important Scalar concept is the enlistment: this is the top-level directory
@@ -81,6 +81,11 @@ remote-tracking branch for the branch this option was used for the initial
cloning. If the HEAD at the remote did not point at any branch when
`--single-branch` clone was made, no remote-tracking branch is created.
+--[no-]src::
+ By default, `scalar clone` places the cloned repository within a
+ `<entlistment>/src` directory. Use `--no-src` to place the cloned
+ repository directly in the `<enlistment>` directory.
+
--[no-]full-clone::
A sparse-checkout is initialized by default. This behavior can be
turned off via `--full-clone`.
@@ -162,6 +167,6 @@ SEE ALSO
--------
linkgit:git-clone[1], linkgit:git-maintenance[1].
-Scalar
+GIT
---
-Associated with the linkgit:git[1] suite
+Part of the linkgit:git[1] suite
diff --git a/Documentation/signoff-option.txt b/Documentation/signoff-option.txt
index 12aa233..d98758f 100644
--- a/Documentation/signoff-option.txt
+++ b/Documentation/signoff-option.txt
@@ -9,7 +9,7 @@ endif::git-commit[]
the committer has the rights to submit the work under the
project's license or agrees to some contributor representation,
such as a Developer Certificate of Origin.
- (See http://developercertificate.org for the one used by the
+ (See https://developercertificate.org for the one used by the
Linux kernel and Git projects.) Consult the documentation or
leadership of the project to which you're contributing to
understand how the signoffs are used in that project.
diff --git a/Documentation/technical/api-error-handling.txt b/Documentation/technical/api-error-handling.txt
index 70bf1d3..665c496 100644
--- a/Documentation/technical/api-error-handling.txt
+++ b/Documentation/technical/api-error-handling.txt
@@ -46,7 +46,7 @@ parse-options.c.
returns -1 after reporting the situation to the caller.
These reports will be logged via the trace2 facility. See the "error"
-event in link:api-trace2.txt[trace2 API].
+event in link:api-trace2.html[trace2 API].
Customizable error handlers
---------------------------
diff --git a/Documentation/technical/api-index-skel.txt b/Documentation/technical/api-index-skel.txt
index eda8c19..7780a76 100644
--- a/Documentation/technical/api-index-skel.txt
+++ b/Documentation/technical/api-index-skel.txt
@@ -1,7 +1,7 @@
Git API Documents
=================
-Git has grown a set of internal API over time. This collection
+Git has grown a set of internal APIs over time. This collection
documents them.
////////////////////////////////////////////////////////////////
diff --git a/Documentation/technical/api-merge.txt b/Documentation/technical/api-merge.txt
index 487d4d8..c2ba018 100644
--- a/Documentation/technical/api-merge.txt
+++ b/Documentation/technical/api-merge.txt
@@ -28,9 +28,9 @@ and `diff.c` for examples.
* `struct ll_merge_options`
-Check ll-merge.h for details.
+Check merge-ll.h for details.
Low-level (single file) merge
-----------------------------
-Check ll-merge.h for details.
+Check merge-ll.h for details.
diff --git a/Documentation/technical/api-parse-options.txt b/Documentation/technical/api-parse-options.txt
index acfd5dc..61fa6ee 100644
--- a/Documentation/technical/api-parse-options.txt
+++ b/Documentation/technical/api-parse-options.txt
@@ -8,7 +8,8 @@ Basics
------
The argument vector `argv[]` may usually contain mandatory or optional
-'non-option arguments', e.g. a filename or a branch, and 'options'.
+'non-option arguments', e.g. a filename or a branch, 'options', and
+'subcommands'.
Options are optional arguments that start with a dash and
that allow to change the behavior of a command.
@@ -48,6 +49,33 @@ The parse-options API allows:
option, e.g. `-a -b --option -- --this-is-a-file` indicates that
`--this-is-a-file` must not be processed as an option.
+Subcommands are special in a couple of ways:
+
+* Subcommands only have long form, and they have no double dash prefix, no
+ negated form, and no description, and they don't take any arguments, and
+ can't be abbreviated.
+
+* There must be exactly one subcommand among the arguments, or zero if the
+ command has a default operation mode.
+
+* All arguments following the subcommand are considered to be arguments of
+ the subcommand, and, conversely, arguments meant for the subcommand may
+ not precede the subcommand.
+
+Therefore, if the options array contains at least one subcommand and
+`parse_options()` encounters the first dashless argument, it will either:
+
+* stop and return, if that dashless argument is a known subcommand, setting
+ `value` to the function pointer associated with that subcommand, storing
+ the name of the subcommand in argv[0], and leaving the rest of the
+ arguments unprocessed, or
+
+* stop and return, if it was invoked with the `PARSE_OPT_SUBCOMMAND_OPTIONAL`
+ flag and that dashless argument doesn't match any subcommands, leaving
+ `value` unchanged and the rest of the arguments unprocessed, or
+
+* show error and usage, and abort.
+
Steps to parse options
----------------------
@@ -90,8 +118,8 @@ Flags are the bitwise-or of:
Keep the first argument, which contains the program name. It's
removed from argv[] by default.
-`PARSE_OPT_KEEP_UNKNOWN`::
- Keep unknown arguments instead of erroring out. This doesn't
+`PARSE_OPT_KEEP_UNKNOWN_OPT`::
+ Keep unknown options instead of erroring out. This doesn't
work for all combinations of arguments as users might expect
it to do. E.g. if the first argument in `--unknown --known`
takes a value (which we can't know), the second one is
@@ -101,6 +129,8 @@ Flags are the bitwise-or of:
non-option, not as a value belonging to the unknown option,
the parser early. That's why parse_options() errors out if
both options are set.
+ Note that non-option arguments are always kept, even without
+ this flag.
`PARSE_OPT_NO_INTERNAL_HELP`::
By default, parse_options() handles `-h`, `--help` and
@@ -108,6 +138,13 @@ Flags are the bitwise-or of:
turns it off and allows one to add custom handlers for these
options, or to just leave them unknown.
+`PARSE_OPT_SUBCOMMAND_OPTIONAL`::
+ Don't error out when no subcommand is specified.
+
+Note that `PARSE_OPT_STOP_AT_NON_OPTION` is incompatible with subcommands;
+while `PARSE_OPT_KEEP_DASHDASH` and `PARSE_OPT_KEEP_UNKNOWN_OPT` can only be
+used with subcommands when combined with `PARSE_OPT_SUBCOMMAND_OPTIONAL`.
+
Data Structure
--------------
@@ -236,10 +273,14 @@ There are some macros to easily define options:
`OPT_CMDMODE(short, long, &int_var, description, enum_val)`::
Define an "operation mode" option, only one of which in the same
group of "operating mode" options that share the same `int_var`
- can be given by the user. `enum_val` is set to `int_var` when the
+ can be given by the user. `int_var` is set to `enum_val` when the
option is used, but an error is reported if other "operating mode"
option has already set its value to the same `int_var`.
+ In new commands consider using subcommands instead.
+`OPT_SUBCOMMAND(long, &fn_ptr, subcommand_fn)`::
+ Define a subcommand. `subcommand_fn` is put into `fn_ptr` when
+ this subcommand is used.
The last element of the array must be `OPT_END()`.
diff --git a/Documentation/technical/api-simple-ipc.txt b/Documentation/technical/api-simple-ipc.txt
index d79ad32..c4fb152 100644
--- a/Documentation/technical/api-simple-ipc.txt
+++ b/Documentation/technical/api-simple-ipc.txt
@@ -2,7 +2,7 @@ Simple-IPC API
==============
The Simple-IPC API is a collection of `ipc_` prefixed library routines
-and a basic communication protocol that allow an IPC-client process to
+and a basic communication protocol that allows an IPC-client process to
send an application-specific IPC-request message to an IPC-server
process and receive an application-specific IPC-response message.
@@ -20,12 +20,12 @@ IPC-client.
The IPC-client routines within a client application process connect
to the IPC-server and send a request message and wait for a response.
-When received, the response is returned back the caller.
+When received, the response is returned back to the caller.
For example, the `fsmonitor--daemon` feature will be built as a server
application on top of the IPC-server library routines. It will have
threads watching for file system events and a thread pool waiting for
-client connections. Clients, such as `git status` will request a list
+client connections. Clients, such as `git status`, will request a list
of file system events since a point in time and the server will
respond with a list of changed files and directories. The formats of
the request and response are application-specific; the IPC-client and
@@ -37,7 +37,7 @@ Comparison with sub-process model
The Simple-IPC mechanism differs from the existing `sub-process.c`
model (Documentation/technical/long-running-process-protocol.txt) and
-used by applications like Git-LFS. In the LFS-style sub-process model
+used by applications like Git-LFS. In the LFS-style sub-process model,
the helper is started by the foreground process, communication happens
via a pair of file descriptors bound to the stdin/stdout of the
sub-process, the sub-process only serves the current foreground
@@ -78,7 +78,7 @@ client and an optional response message from the server. Both the
client and server messages are unlimited in length and are terminated
with a flush packet.
-The pkt-line routines (Documentation/technical/protocol-common.txt)
+The pkt-line routines (linkgit:gitprotocol-common[5])
are used to simplify buffer management during message generation,
transmission, and reception. A flush packet is used to mark the end
of the message. This allows the sender to incrementally generate and
@@ -102,4 +102,4 @@ stateless request, receive an application-specific
response, and disconnect. It is a one round trip facility for
querying the server. The Simple-IPC routines hide the socket,
named pipe, and thread pool details and allow the application
-layer to focus on the application at hand.
+layer to focus on the task at hand.
diff --git a/Documentation/technical/api-trace2.txt b/Documentation/technical/api-trace2.txt
index 77a150b..de5fc25 100644
--- a/Documentation/technical/api-trace2.txt
+++ b/Documentation/technical/api-trace2.txt
@@ -148,20 +148,18 @@ filename collisions).
== Trace2 API
-All public Trace2 functions and macros are defined in `trace2.h` and
-`trace2.c`. All public symbols are prefixed with `trace2_`.
+The Trace2 public API is defined and documented in `trace2.h`; refer to it for
+more information. All public functions and macros are prefixed
+with `trace2_` and are implemented in `trace2.c`.
There are no public Trace2 data structures.
The Trace2 code also defines a set of private functions and data types
in the `trace2/` directory. These symbols are prefixed with `tr2_`
-and should only be used by functions in `trace2.c`.
+and should only be used by functions in `trace2.c` (or other private
+source files in `trace2/`).
-== Conventions for Public Functions and Macros
-
-The functions defined by the Trace2 API are declared and documented
-in `trace2.h`. It defines the API functions and wrapper macros for
-Trace2.
+=== Conventions for Public Functions and Macros
Some functions have a `_fl()` suffix to indicate that they take `file`
and `line-number` arguments.
@@ -172,52 +170,7 @@ take a `va_list` argument.
Some functions have a `_printf_fl()` suffix to indicate that they also
take a `printf()` style format with a variable number of arguments.
-There are CPP wrapper macros and `#ifdef`s to hide most of these details.
-See `trace2.h` for more details. The following discussion will only
-describe the simplified forms.
-
-== Public API
-
-All Trace2 API functions send a message to all of the active
-Trace2 Targets. This section describes the set of available
-messages.
-
-It helps to divide these functions into groups for discussion
-purposes.
-
-=== Basic Command Messages
-
-These are concerned with the lifetime of the overall git process.
-e.g: `void trace2_initialize_clock()`, `void trace2_initialize()`,
-`int trace2_is_enabled()`, `void trace2_cmd_start(int argc, const char **argv)`.
-
-=== Command Detail Messages
-
-These are concerned with describing the specific Git command
-after the command line, config, and environment are inspected.
-e.g: `void trace2_cmd_name(const char *name)`,
-`void trace2_cmd_mode(const char *mode)`.
-
-=== Child Process Messages
-
-These are concerned with the various spawned child processes,
-including shell scripts, git commands, editors, pagers, and hooks.
-
-e.g: `void trace2_child_start(struct child_process *cmd)`.
-
-=== Git Thread Messages
-
-These messages are concerned with Git thread usage.
-
-e.g: `void trace2_thread_start(const char *thread_name)`.
-
-=== Region and Data Messages
-
-These are concerned with recording performance data
-over regions or spans of code. e.g:
-`void trace2_region_enter(const char *category, const char *label, const struct repository *repo)`.
-
-Refer to trace2.h for details about all trace2 functions.
+CPP wrapper macros are defined to hide most of these details.
== Trace2 Target Formats
@@ -685,8 +638,8 @@ The "exec_id" field is a command-unique id and is only useful if the
`"thread_start"`::
This event is generated when a thread is started. It is
- generated from *within* the new thread's thread-proc (for TLS
- reasons).
+ generated from *within* the new thread's thread-proc (because
+ it needs to access data in the thread's thread-local storage).
+
------------
{
@@ -698,7 +651,7 @@ The "exec_id" field is a command-unique id and is only useful if the
`"thread_exit"`::
This event is generated when a thread exits. It is generated
- from *within* the thread's thread-proc (for TLS reasons).
+ from *within* the thread's thread-proc.
+
------------
{
@@ -717,6 +670,7 @@ The "exec_id" field is a command-unique id and is only useful if the
{
"event":"def_param",
...
+ "scope":"global",
"param":"core.abbrev",
"value":"7"
}
@@ -815,6 +769,73 @@ The "value" field may be an integer or a string.
}
------------
+`"th_timer"`::
+ This event logs the amount of time that a stopwatch timer was
+ running in the thread. This event is generated when a thread
+ exits for timers that requested per-thread events.
++
+------------
+{
+ "event":"th_timer",
+ ...
+ "category":"my_category",
+ "name":"my_timer",
+ "intervals":5, # number of time it was started/stopped
+ "t_total":0.052741, # total time in seconds it was running
+ "t_min":0.010061, # shortest interval
+ "t_max":0.011648 # longest interval
+}
+------------
+
+`"timer"`::
+ This event logs the amount of time that a stopwatch timer was
+ running aggregated across all threads. This event is generated
+ when the process exits.
++
+------------
+{
+ "event":"timer",
+ ...
+ "category":"my_category",
+ "name":"my_timer",
+ "intervals":5, # number of time it was started/stopped
+ "t_total":0.052741, # total time in seconds it was running
+ "t_min":0.010061, # shortest interval
+ "t_max":0.011648 # longest interval
+}
+------------
+
+`"th_counter"`::
+ This event logs the value of a counter variable in a thread.
+ This event is generated when a thread exits for counters that
+ requested per-thread events.
++
+------------
+{
+ "event":"th_counter",
+ ...
+ "category":"my_category",
+ "name":"my_counter",
+ "count":23
+}
+------------
+
+`"counter"`::
+ This event logs the value of a counter variable across all threads.
+ This event is generated when the process exits. The total value
+ reported here is the sum across all threads.
++
+------------
+{
+ "event":"counter",
+ ...
+ "category":"my_category",
+ "name":"my_counter",
+ "count":23
+}
+------------
+
+
== Example Trace2 API Usage
Here is a hypothetical usage of the Trace2 API showing the intended
@@ -1205,7 +1226,100 @@ worked on 508 items at offset 2032. Thread "th04" worked on 508 items
at offset 508.
+
This example also shows that thread names are assigned in a racy manner
-as each thread starts and allocates TLS storage.
+as each thread starts.
+
+Config (def param) Events::
+
+ Dump "interesting" config values to trace2 log.
++
+We can optionally emit configuration events, see
+`trace2.configparams` in linkgit:git-config[1] for how to enable
+it.
++
+----------------
+$ git config --system color.ui never
+$ git config --global color.ui always
+$ git config --local color.ui auto
+$ git config --list --show-scope | grep 'color.ui'
+system color.ui=never
+global color.ui=always
+local color.ui=auto
+----------------
++
+Then, mark the config `color.ui` as "interesting" config with
+`GIT_TRACE2_CONFIG_PARAMS`:
++
+----------------
+$ export GIT_TRACE2_PERF_BRIEF=1
+$ export GIT_TRACE2_PERF=~/log.perf
+$ export GIT_TRACE2_CONFIG_PARAMS=color.ui
+$ git version
+...
+$ cat ~/log.perf
+d0 | main | version | | | | | ...
+d0 | main | start | | 0.001642 | | | /usr/local/bin/git version
+d0 | main | cmd_name | | | | | version (version)
+d0 | main | def_param | | | | scope:system | color.ui:never
+d0 | main | def_param | | | | scope:global | color.ui:always
+d0 | main | def_param | | | | scope:local | color.ui:auto
+d0 | main | data | r0 | 0.002100 | 0.002100 | fsync | fsync/writeout-only:0
+d0 | main | data | r0 | 0.002126 | 0.002126 | fsync | fsync/hardware-flush:0
+d0 | main | exit | | 0.000470 | | | code:0
+d0 | main | atexit | | 0.000477 | | | code:0
+----------------
+
+Stopwatch Timer Events::
+
+ Measure the time spent in a function call or span of code
+ that might be called from many places within the code
+ throughout the life of the process.
++
+----------------
+static void expensive_function(void)
+{
+ trace2_timer_start(TRACE2_TIMER_ID_TEST1);
+ ...
+ sleep_millisec(1000); // Do something expensive
+ ...
+ trace2_timer_stop(TRACE2_TIMER_ID_TEST1);
+}
+
+static int ut_100timer(int argc, const char **argv)
+{
+ ...
+
+ expensive_function();
+
+ // Do something else 1...
+
+ expensive_function();
+
+ // Do something else 2...
+
+ expensive_function();
+
+ return 0;
+}
+----------------
++
+In this example, we measure the total time spent in
+`expensive_function()` regardless of when it is called
+in the overall flow of the program.
++
+----------------
+$ export GIT_TRACE2_PERF_BRIEF=1
+$ export GIT_TRACE2_PERF=~/log.perf
+$ t/helper/test-tool trace2 100timer 3 1000
+...
+$ cat ~/log.perf
+d0 | main | version | | | | | ...
+d0 | main | start | | 0.001453 | | | t/helper/test-tool trace2 100timer 3 1000
+d0 | main | cmd_name | | | | | trace2 (trace2)
+d0 | main | exit | | 3.003667 | | | code:0
+d0 | main | timer | | | | test | name:test1 intervals:3 total:3.001686 min:1.000254 max:1.000929
+d0 | main | atexit | | 3.003796 | | | code:0
+----------------
+
== Future Work
diff --git a/Documentation/technical/bitmap-format.txt b/Documentation/technical/bitmap-format.txt
index a85f58f..f5d2009 100644
--- a/Documentation/technical/bitmap-format.txt
+++ b/Documentation/technical/bitmap-format.txt
@@ -72,6 +72,17 @@ MIDXs, both the bit-cache and rev-cache extensions are required.
pack/MIDX. The format and meaning of the name-hash is
described below.
+ ** {empty}
+ BITMAP_OPT_LOOKUP_TABLE (0x10): :::
+ If present, the end of the bitmap file contains a table
+ containing a list of `N` <commit_pos, offset, xor_row>
+ triplets. The format and meaning of the table is described
+ below.
++
+NOTE: Unlike the xor_offset used to compress an individual bitmap,
+`xor_row` stores an *absolute* index into the lookup table, not a location
+relative to the current entry.
+
4-byte entry count (network byte order): ::
The total count of entries (bitmapped commits) in this bitmap index.
@@ -103,7 +114,7 @@ result in an empty bitmap (no bits set).
* N entries with compressed bitmaps, one for each indexed commit
+
-Where `N` is the total amount of entries in this bitmap index.
+Where `N` is the total number of entries in this bitmap index.
Each entry contains the following:
** {empty}
@@ -115,7 +126,7 @@ Each entry contains the following:
** {empty}
1-byte XOR-offset: ::
The xor offset used to compress this bitmap. For an entry
- in position `x`, a XOR offset of `y` means that the actual
+ in position `x`, an XOR offset of `y` means that the actual
bitmap representing this commit is composed by XORing the
bitmap for this entry with the bitmap in entry `x-y` (i.e.
the bitmap `y` entries before this one).
@@ -216,3 +227,31 @@ Note that this hashing scheme is tied to the BITMAP_OPT_HASH_CACHE flag.
If implementations want to choose a different hashing scheme, they are
free to do so, but MUST allocate a new header flag (because comparing
hashes made under two different schemes would be pointless).
+
+Commit lookup table
+-------------------
+
+If the BITMAP_OPT_LOOKUP_TABLE flag is set, the last `N * (4 + 8 + 4)`
+bytes (preceding the name-hash cache and trailing hash) of the `.bitmap`
+file contains a lookup table specifying the information needed to get
+the desired bitmap from the entries without parsing previous unnecessary
+bitmaps.
+
+For a `.bitmap` containing `nr_entries` reachability bitmaps, the table
+contains a list of `nr_entries` <commit_pos, offset, xor_row> triplets
+(sorted in the ascending order of `commit_pos`). The content of the i'th
+triplet is -
+
+ * {empty}
+ commit_pos (4 byte integer, network byte order): ::
+ It stores the object position of a commit (in the midx or pack
+ index).
+
+ * {empty}
+ offset (8 byte integer, network byte order): ::
+ The offset from which that commit's bitmap can be read.
+
+ * {empty}
+ xor_row (4 byte integer, network byte order): ::
+ The position of the triplet whose bitmap is used to compress
+ this one, or `0xffffffff` if no such bitmap exists.
diff --git a/Documentation/technical/bundle-uri.txt b/Documentation/technical/bundle-uri.txt
new file mode 100644
index 0000000..91d3a13
--- /dev/null
+++ b/Documentation/technical/bundle-uri.txt
@@ -0,0 +1,572 @@
+Bundle URIs
+===========
+
+Git bundles are files that store a pack-file along with some extra metadata,
+including a set of refs and a (possibly empty) set of necessary commits. See
+linkgit:git-bundle[1] and linkgit:gitformat-bundle[5] for more information.
+
+Bundle URIs are locations where Git can download one or more bundles in
+order to bootstrap the object database in advance of fetching the remaining
+objects from a remote.
+
+One goal is to speed up clones and fetches for users with poor network
+connectivity to the origin server. Another benefit is to allow heavy users,
+such as CI build farms, to use local resources for the majority of Git data
+and thereby reducing the load on the origin server.
+
+To enable the bundle URI feature, users can specify a bundle URI using
+command-line options or the origin server can advertise one or more URIs
+via a protocol v2 capability.
+
+Design Goals
+------------
+
+The bundle URI standard aims to be flexible enough to satisfy multiple
+workloads. The bundle provider and the Git client have several choices in
+how they create and consume bundle URIs.
+
+* Bundles can have whatever name the server desires. This name could refer
+ to immutable data by using a hash of the bundle contents. However, this
+ means that a new URI will be needed after every update of the content.
+ This might be acceptable if the server is advertising the URI (and the
+ server is aware of new bundles being generated) but would not be
+ ergonomic for users using the command line option.
+
+* The bundles could be organized specifically for bootstrapping full
+ clones, but could also be organized with the intention of bootstrapping
+ incremental fetches. The bundle provider must decide on one of several
+ organization schemes to minimize client downloads during incremental
+ fetches, but the Git client can also choose whether to use bundles for
+ either of these operations.
+
+* The bundle provider can choose to support full clones, partial clones,
+ or both. The client can detect which bundles are appropriate for the
+ repository's partial clone filter, if any.
+
+* The bundle provider can use a single bundle (for clones only), or a
+ list of bundles. When using a list of bundles, the provider can specify
+ whether or not the client needs _all_ of the bundle URIs for a full
+ clone, or if _any_ one of the bundle URIs is sufficient. This allows the
+ bundle provider to use different URIs for different geographies.
+
+* The bundle provider can organize the bundles using heuristics, such as
+ creation tokens, to help the client prevent downloading bundles it does
+ not need. When the bundle provider does not provide these heuristics,
+ the client can use optimizations to minimize how much of the data is
+ downloaded.
+
+* The bundle provider does not need to be associated with the Git server.
+ The client can choose to use the bundle provider without it being
+ advertised by the Git server.
+
+* The client can choose to discover bundle providers that are advertised
+ by the Git server. This could happen during `git clone`, during
+ `git fetch`, both, or neither. The user can choose which combination
+ works best for them.
+
+* The client can choose to configure a bundle provider manually at any
+ time. The client can also choose to specify a bundle provider manually
+ as a command-line option to `git clone`.
+
+Each repository is different and every Git server has different needs.
+Hopefully the bundle URI feature is flexible enough to satisfy all needs.
+If not, then the feature can be extended through its versioning mechanism.
+
+Server requirements
+-------------------
+
+To provide a server-side implementation of bundle servers, no other parts
+of the Git protocol are required. This allows server maintainers to use
+static content solutions such as CDNs in order to serve the bundle files.
+
+At the current scope of the bundle URI feature, all URIs are expected to
+be HTTP(S) URLs where content is downloaded to a local file using a `GET`
+request to that URL. The server could include authentication requirements
+to those requests with the aim of triggering the configured credential
+helper for secure access. (Future extensions could use "file://" URIs or
+SSH URIs.)
+
+Assuming a `200 OK` response from the server, the content at the URL is
+inspected. First, Git attempts to parse the file as a bundle file of
+version 2 or higher. If the file is not a bundle, then the file is parsed
+as a plain-text file using Git's config parser. The key-value pairs in
+that config file are expected to describe a list of bundle URIs. If
+neither of these parse attempts succeed, then Git will report an error to
+the user that the bundle URI provided erroneous data.
+
+Any other data provided by the server is considered erroneous.
+
+Bundle Lists
+------------
+
+The Git server can advertise bundle URIs using a set of `key=value` pairs.
+A bundle URI can also serve a plain-text file in the Git config format
+containing these same `key=value` pairs. In both cases, we consider this
+to be a _bundle list_. The pairs specify information about the bundles
+that the client can use to make decisions for which bundles to download
+and which to ignore.
+
+A few keys focus on properties of the list itself.
+
+bundle.version::
+ (Required) This value provides a version number for the bundle
+ list. If a future Git change enables a feature that needs the Git
+ client to react to a new key in the bundle list file, then this version
+ will increment. The only current version number is 1, and if any other
+ value is specified then Git will fail to use this file.
+
+bundle.mode::
+ (Required) This value has one of two values: `all` and `any`. When `all`
+ is specified, then the client should expect to need all of the listed
+ bundle URIs that match their repository's requirements. When `any` is
+ specified, then the client should expect that any one of the bundle URIs
+ that match their repository's requirements will suffice. Typically, the
+ `any` option is used to list a number of different bundle servers
+ located in different geographies.
+
+bundle.heuristic::
+ If this string-valued key exists, then the bundle list is designed to
+ work well with incremental `git fetch` commands. The heuristic signals
+ that there are additional keys available for each bundle that help
+ determine which subset of bundles the client should download. The only
+ heuristic currently planned is `creationToken`.
+
+The remaining keys include an `<id>` segment which is a server-designated
+name for each available bundle. The `<id>` must contain only alphanumeric
+and `-` characters.
+
+bundle.<id>.uri::
+ (Required) This string value is the URI for downloading bundle `<id>`.
+ If the URI begins with a protocol (`http://` or `https://`) then the URI
+ is absolute. Otherwise, the URI is interpreted as relative to the URI
+ used for the bundle list. If the URI begins with `/`, then that relative
+ path is relative to the domain name used for the bundle list. (This use
+ of relative paths is intended to make it easier to distribute a set of
+ bundles across a large number of servers or CDNs with different domain
+ names.)
+
+bundle.<id>.filter::
+ This string value represents an object filter that should also appear in
+ the header of this bundle. The server uses this value to differentiate
+ different kinds of bundles from which the client can choose those that
+ match their object filters.
+
+bundle.<id>.creationToken::
+ This value is a nonnegative 64-bit integer used for sorting the bundles
+ list. This is used to download a subset of bundles during a fetch when
+ `bundle.heuristic=creationToken`.
+
+bundle.<id>.location::
+ This string value advertises a real-world location from where the bundle
+ URI is served. This can be used to present the user with an option for
+ which bundle URI to use or simply as an informative indicator of which
+ bundle URI was selected by Git. This is only valuable when
+ `bundle.mode` is `any`.
+
+Here is an example bundle list using the Git config format:
+
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+
+ [bundle "2022-02-09-1644442601-daily"]
+ uri = https://bundles.example.com/git/git/2022-02-09-1644442601-daily.bundle
+ creationToken = 1644442601
+
+ [bundle "2022-02-02-1643842562"]
+ uri = https://bundles.example.com/git/git/2022-02-02-1643842562.bundle
+ creationToken = 1643842562
+
+ [bundle "2022-02-09-1644442631-daily-blobless"]
+ uri = 2022-02-09-1644442631-daily-blobless.bundle
+ creationToken = 1644442631
+ filter = blob:none
+
+ [bundle "2022-02-02-1643842568-blobless"]
+ uri = /git/git/2022-02-02-1643842568-blobless.bundle
+ creationToken = 1643842568
+ filter = blob:none
+
+This example uses `bundle.mode=all` as well as the
+`bundle.<id>.creationToken` heuristic. It also uses the `bundle.<id>.filter`
+options to present two parallel sets of bundles: one for full clones and
+another for blobless partial clones.
+
+Suppose that this bundle list was found at the URI
+`https://bundles.example.com/git/git/` and so the two blobless bundles have
+the following fully-expanded URIs:
+
+* `https://bundles.example.com/git/git/2022-02-09-1644442631-daily-blobless.bundle`
+* `https://bundles.example.com/git/git/2022-02-02-1643842568-blobless.bundle`
+
+Advertising Bundle URIs
+-----------------------
+
+If a user knows a bundle URI for the repository they are cloning, then
+they can specify that URI manually through a command-line option. However,
+a Git host may want to advertise bundle URIs during the clone operation,
+helping users unaware of the feature.
+
+The only thing required for this feature is that the server can advertise
+one or more bundle URIs. This advertisement takes the form of a new
+protocol v2 capability specifically for discovering bundle URIs.
+
+The client could choose an arbitrary bundle URI as an option _or_ select
+the URI with best performance by some exploratory checks. It is up to the
+bundle provider to decide if having multiple URIs is preferable to a
+single URI that is geodistributed through server-side infrastructure.
+
+Cloning with Bundle URIs
+------------------------
+
+The primary need for bundle URIs is to speed up clones. The Git client
+will interact with bundle URIs according to the following flow:
+
+1. The user specifies a bundle URI with the `--bundle-uri` command-line
+ option _or_ the client discovers a bundle list advertised by the
+ Git server.
+
+2. If the downloaded data from a bundle URI is a bundle, then the client
+ inspects the bundle headers to check that the prerequisite commit OIDs
+ are present in the client repository. If some are missing, then the
+ client delays unbundling until other bundles have been unbundled,
+ making those OIDs present. When all required OIDs are present, the
+ client unbundles that data using a refspec. The default refspec is
+ `+refs/heads/*:refs/bundles/*`, but this can be configured. These refs
+ are stored so that later `git fetch` negotiations can communicate each
+ bundled ref as a `have`, reducing the size of the fetch over the Git
+ protocol. To allow pruning refs from this ref namespace, Git may
+ introduce a numbered namespace (such as `refs/bundles/<i>/*`) such that
+ stale bundle refs can be deleted.
+
+3. If the file is instead a bundle list, then the client inspects the
+ `bundle.mode` to see if the list is of the `all` or `any` form.
+
+ a. If `bundle.mode=all`, then the client considers all bundle
+ URIs. The list is reduced based on the `bundle.<id>.filter` options
+ matching the client repository's partial clone filter. Then, all
+ bundle URIs are requested. If the `bundle.<id>.creationToken`
+ heuristic is provided, then the bundles are downloaded in decreasing
+ order by the creation token, stopping when a bundle has all required
+ OIDs. The bundles can then be unbundled in increasing creation token
+ order. The client stores the latest creation token as a heuristic
+ for avoiding future downloads if the bundle list does not advertise
+ bundles with larger creation tokens.
+
+ b. If `bundle.mode=any`, then the client can choose any one of the
+ bundle URIs to inspect. The client can use a variety of ways to
+ choose among these URIs. The client can also fallback to another URI
+ if the initial choice fails to return a result.
+
+Note that during a clone we expect that all bundles will be required, and
+heuristics such as `bundle.<uri>.creationToken` can be used to download
+bundles in chronological order or in parallel.
+
+If a given bundle URI is a bundle list with a `bundle.heuristic`
+value, then the client can choose to store that URI as its chosen bundle
+URI. The client can then navigate directly to that URI during later `git
+fetch` calls.
+
+When downloading bundle URIs, the client can choose to inspect the initial
+content before committing to downloading the entire content. This may
+provide enough information to determine if the URI is a bundle list or
+a bundle. In the case of a bundle, the client may inspect the bundle
+header to determine that all advertised tips are already in the client
+repository and cancel the remaining download.
+
+Fetching with Bundle URIs
+-------------------------
+
+When the client fetches new data, it can decide to fetch from bundle
+servers before fetching from the origin remote. This could be done via a
+command-line option, but it is more likely useful to use a config value
+such as the one specified during the clone.
+
+The fetch operation follows the same procedure to download bundles from a
+bundle list (although we do _not_ want to use parallel downloads here). We
+expect that the process will end when all prerequisite commit OIDs in a
+thin bundle are already in the object database.
+
+When using the `creationToken` heuristic, the client can avoid downloading
+any bundles if their creation tokens are not larger than the stored
+creation token. After fetching new bundles, Git updates this local
+creation token.
+
+If the bundle provider does not provide a heuristic, then the client
+should attempt to inspect the bundle headers before downloading the full
+bundle data in case the bundle tips already exist in the client
+repository.
+
+Error Conditions
+----------------
+
+If the Git client discovers something unexpected while downloading
+information according to a bundle URI or the bundle list found at that
+location, then Git can ignore that data and continue as if it was not
+given a bundle URI. The remote Git server is the ultimate source of truth,
+not the bundle URI.
+
+Here are a few example error conditions:
+
+* The client fails to connect with a server at the given URI or a connection
+ is lost without any chance to recover.
+
+* The client receives a 400-level response (such as `404 Not Found` or
+ `401 Not Authorized`). The client should use the credential helper to
+ find and provide a credential for the URI, but match the semantics of
+ Git's other HTTP protocols in terms of handling specific 400-level
+ errors.
+
+* The server reports any other failure response.
+
+* The client receives data that is not parsable as a bundle or bundle list.
+
+* A bundle includes a filter that does not match expectations.
+
+* The client cannot unbundle the bundles because the prerequisite commit OIDs
+ are not in the object database and there are no more bundles to download.
+
+There are also situations that could be seen as wasteful, but are not
+error conditions:
+
+* The downloaded bundles contain more information than is requested by
+ the clone or fetch request. A primary example is if the user requests
+ a clone with `--single-branch` but downloads bundles that store every
+ reachable commit from all `refs/heads/*` references. This might be
+ initially wasteful, but perhaps these objects will become reachable by
+ a later ref update that the client cares about.
+
+* A bundle download during a `git fetch` contains objects already in the
+ object database. This is probably unavoidable if we are using bundles
+ for fetches, since the client will almost always be slightly ahead of
+ the bundle servers after performing its "catch-up" fetch to the remote
+ server. This extra work is most wasteful when the client is fetching
+ much more frequently than the server is computing bundles, such as if
+ the client is using hourly prefetches with background maintenance, but
+ the server is computing bundles weekly. For this reason, the client
+ should not use bundle URIs for fetch unless the server has explicitly
+ recommended it through a `bundle.heuristic` value.
+
+Example Bundle Provider organization
+------------------------------------
+
+The bundle URI feature is intentionally designed to be flexible to
+different ways a bundle provider wants to organize the object data.
+However, it can be helpful to have a complete organization model described
+here so providers can start from that base.
+
+This example organization is a simplified model of what is used by the
+GVFS Cache Servers (see section near the end of this document) which have
+been beneficial in speeding up clones and fetches for very large
+repositories, although using extra software outside of Git.
+
+The bundle provider deploys servers across multiple geographies. Each
+server manages its own bundle set. The server can track a number of Git
+repositories, but provides a bundle list for each based on a pattern. For
+example, when mirroring a repository at `https://<domain>/<org>/<repo>`
+the bundle server could have its bundle list available at
+`https://<server-url>/<domain>/<org>/<repo>`. The origin Git server can
+list all of these servers under the "any" mode:
+
+ [bundle]
+ version = 1
+ mode = any
+
+ [bundle "eastus"]
+ uri = https://eastus.example.com/<domain>/<org>/<repo>
+
+ [bundle "europe"]
+ uri = https://europe.example.com/<domain>/<org>/<repo>
+
+ [bundle "apac"]
+ uri = https://apac.example.com/<domain>/<org>/<repo>
+
+This "list of lists" is static and only changes if a bundle server is
+added or removed.
+
+Each bundle server manages its own set of bundles. The initial bundle list
+contains only a single bundle, containing all of the objects received from
+cloning the repository from the origin server. The list uses the
+`creationToken` heuristic and a `creationToken` is made for the bundle
+based on the server's timestamp.
+
+The bundle server runs regularly-scheduled updates for the bundle list,
+such as once a day. During this task, the server fetches the latest
+contents from the origin server and generates a bundle containing the
+objects reachable from the latest origin refs, but not contained in a
+previously-computed bundle. This bundle is added to the list, with care
+that the `creationToken` is strictly greater than the previous maximum
+`creationToken`.
+
+When the bundle list grows too large, say more than 30 bundles, then the
+oldest "_N_ minus 30" bundles are combined into a single bundle. This
+bundle's `creationToken` is equal to the maximum `creationToken` among the
+merged bundles.
+
+An example bundle list is provided here, although it only has two daily
+bundles and not a full list of 30:
+
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+
+ [bundle "2022-02-13-1644770820-daily"]
+ uri = https://eastus.example.com/<domain>/<org>/<repo>/2022-02-09-1644770820-daily.bundle
+ creationToken = 1644770820
+
+ [bundle "2022-02-09-1644442601-daily"]
+ uri = https://eastus.example.com/<domain>/<org>/<repo>/2022-02-09-1644442601-daily.bundle
+ creationToken = 1644442601
+
+ [bundle "2022-02-02-1643842562"]
+ uri = https://eastus.example.com/<domain>/<org>/<repo>/2022-02-02-1643842562.bundle
+ creationToken = 1643842562
+
+To avoid storing and serving object data in perpetuity despite becoming
+unreachable in the origin server, this bundle merge can be more careful.
+Instead of taking an absolute union of the old bundles, instead the bundle
+can be created by looking at the newer bundles and ensuring that their
+necessary commits are all available in this merged bundle (or in another
+one of the newer bundles). This allows "expiring" object data that is not
+being used by new commits in this window of time. That data could be
+reintroduced by a later push.
+
+The intention of this data organization has two main goals. First, initial
+clones of the repository become faster by downloading precomputed object
+data from a closer source. Second, `git fetch` commands can be faster,
+especially if the client has not fetched for a few days. However, if a
+client does not fetch for 30 days, then the bundle list organization would
+cause redownloading a large amount of object data.
+
+One way to make this organization more useful to users who fetch frequently
+is to have more frequent bundle creation. For example, bundles could be
+created every hour, and then once a day those "hourly" bundles could be
+merged into a "daily" bundle. The daily bundles are merged into the
+oldest bundle after 30 days.
+
+It is recommended that this bundle strategy is repeated with the `blob:none`
+filter if clients of this repository are expecting to use blobless partial
+clones. This list of blobless bundles stays in the same list as the full
+bundles, but uses the `bundle.<id>.filter` key to separate the two groups.
+For very large repositories, the bundle provider may want to _only_ provide
+blobless bundles.
+
+Implementation Plan
+-------------------
+
+This design document is being submitted on its own as an aspirational
+document, with the goal of implementing all of the mentioned client
+features over the course of several patch series. Here is a potential
+outline for submitting these features:
+
+1. Integrate bundle URIs into `git clone` with a `--bundle-uri` option.
+ This will include a new `git fetch --bundle-uri` mode for use as the
+ implementation underneath `git clone`. The initial version here will
+ expect a single bundle at the given URI.
+
+2. Implement the ability to parse a bundle list from a bundle URI and
+ update the `git fetch --bundle-uri` logic to properly distinguish
+ between `bundle.mode` options. Specifically design the feature so
+ that the config format parsing feeds a list of key-value pairs into the
+ bundle list logic.
+
+3. Create the `bundle-uri` protocol v2 command so Git servers can advertise
+ bundle URIs using the key-value pairs. Plug into the existing key-value
+ input to the bundle list logic. Allow `git clone` to discover these
+ bundle URIs and bootstrap the client repository from the bundle data.
+ (This choice is an opt-in via a config option and a command-line
+ option.)
+
+4. Allow the client to understand the `bundle.heuristic` configuration key
+ and the `bundle.<id>.creationToken` heuristic. When `git clone`
+ discovers a bundle URI with `bundle.heuristic`, it configures the client
+ repository to check that bundle URI during later `git fetch <remote>`
+ commands.
+
+5. Allow clients to discover bundle URIs during `git fetch` and configure
+ a bundle URI for later fetches if `bundle.heuristic` is set.
+
+6. Implement the "inspect headers" heuristic to reduce data downloads when
+ the `bundle.<id>.creationToken` heuristic is not available.
+
+As these features are reviewed, this plan might be updated. We also expect
+that new designs will be discovered and implemented as this feature
+matures and becomes used in real-world scenarios.
+
+Related Work: Packfile URIs
+---------------------------
+
+The Git protocol already has a capability where the Git server can list
+a set of URLs along with the packfile response when serving a client
+request. The client is then expected to download the packfiles at those
+locations in order to have a complete understanding of the response.
+
+This mechanism is used by the Gerrit server (implemented with JGit) and
+has been effective at reducing CPU load and improving user performance for
+clones.
+
+A major downside to this mechanism is that the origin server needs to know
+_exactly_ what is in those packfiles, and the packfiles need to be available
+to the user for some time after the server has responded. This coupling
+between the origin and the packfile data is difficult to manage.
+
+Further, this implementation is extremely hard to make work with fetches.
+
+Related Work: GVFS Cache Servers
+--------------------------------
+
+The GVFS Protocol [2] is a set of HTTP endpoints designed independently of
+the Git project before Git's partial clone was created. One feature of this
+protocol is the idea of a "cache server" which can be colocated with build
+machines or developer offices to transfer Git data without overloading the
+central server.
+
+The endpoint that VFS for Git is famous for is the `GET /gvfs/objects/{oid}`
+endpoint, which allows downloading an object on-demand. This is a critical
+piece of the filesystem virtualization of that product.
+
+However, a more subtle need is the `GET /gvfs/prefetch?lastPackTimestamp=<t>`
+endpoint. Given an optional timestamp, the cache server responds with a list
+of precomputed packfiles containing the commits and trees that were introduced
+in those time intervals.
+
+The cache server computes these "prefetch" packfiles using the following
+strategy:
+
+1. Every hour, an "hourly" pack is generated with a given timestamp.
+2. Nightly, the previous 24 hourly packs are rolled up into a "daily" pack.
+3. Nightly, all prefetch packs more than 30 days old are rolled up into
+ one pack.
+
+When a user runs `gvfs clone` or `scalar clone` against a repo with cache
+servers, the client requests all prefetch packfiles, which is at most
+`24 + 30 + 1` packfiles downloading only commits and trees. The client
+then follows with a request to the origin server for the references, and
+attempts to checkout that tip reference. (There is an extra endpoint that
+helps get all reachable trees from a given commit, in case that commit
+was not already in a prefetch packfile.)
+
+During a `git fetch`, a hook requests the prefetch endpoint using the
+most-recent timestamp from a previously-downloaded prefetch packfile.
+Only the list of packfiles with later timestamps are downloaded. Most
+users fetch hourly, so they get at most one hourly prefetch pack. Users
+whose machines have been off or otherwise have not fetched in over 30 days
+might redownload all prefetch packfiles. This is rare.
+
+It is important to note that the clients always contact the origin server
+for the refs advertisement, so the refs are frequently "ahead" of the
+prefetched pack data. The missing objects are downloaded on-demand using
+the `GET gvfs/objects/{oid}` requests, when needed by a command such as
+`git checkout` or `git log`. Some Git optimizations disable checks that
+would cause these on-demand downloads to be too aggressive.
+
+See Also
+--------
+
+[1] https://lore.kernel.org/git/RFC-cover-00.13-0000000000-20210805T150534Z-avarab@gmail.com/
+ An earlier RFC for a bundle URI feature.
+
+[2] https://github.com/microsoft/VFSForGit/blob/master/Protocol.md
+ The GVFS Protocol
diff --git a/Documentation/technical/commit-graph.txt b/Documentation/technical/commit-graph.txt
index f05e7bd..2c26e95 100644
--- a/Documentation/technical/commit-graph.txt
+++ b/Documentation/technical/commit-graph.txt
@@ -1,4 +1,4 @@
-Git Commit Graph Design Notes
+Git Commit-Graph Design Notes
=============================
Git walks the commit graph for many reasons, including:
@@ -17,7 +17,7 @@ There are two main costs here:
The commit-graph file is a supplemental data structure that accelerates
commit graph walks. If a user downgrades or disables the 'core.commitGraph'
-config setting, then the existing ODB is sufficient. The file is stored
+config setting, then the existing object database is sufficient. The file is stored
as "commit-graph" either in the .git/objects/info directory or in the info
directory of an alternate.
@@ -40,7 +40,7 @@ Values 1-4 satisfy the requirements of parse_commit_gently().
There are two definitions of generation number:
1. Corrected committer dates (generation number v2)
-2. Topological levels (generation nummber v1)
+2. Topological levels (generation number v1)
Define "corrected committer date" of a commit recursively as follows:
@@ -48,7 +48,7 @@ Define "corrected committer date" of a commit recursively as follows:
equal to its committer date.
* A commit with at least one parent has corrected committer date equal to
- the maximum of its commiter date and one more than the largest corrected
+ the maximum of its committer date and one more than the largest corrected
committer date among its parents.
* As a special case, a root commit with timestamp zero has corrected commit
@@ -95,7 +95,7 @@ with default order), but is not used when the topological order is
required (such as merge base calculations, "git log --graph").
In practice, we expect some commits to be created recently and not stored
-in the commit graph. We can treat these commits as having "infinite"
+in the commit-graph. We can treat these commits as having "infinite"
generation number and walk until reaching commits with known generation
number.
@@ -136,7 +136,7 @@ Design Details
- Commit grafts and replace objects can change the shape of the commit
history. The latter can also be enabled/disabled on the fly using
- `--no-replace-objects`. This leads to difficultly storing both possible
+ `--no-replace-objects`. This leads to difficulty storing both possible
interpretations of a commit id, especially when computing generation
numbers. The commit-graph will not be read or written when
replace-objects or grafts are present.
@@ -149,7 +149,7 @@ Design Details
helpful for these clones, anyway. The commit-graph will not be read or
written when shallow commits are present.
-Commit Graphs Chains
+Commit-Graphs Chains
--------------------
Typically, repos grow with near-constant velocity (commits per day). Over time,
diff --git a/Documentation/technical/cruft-packs.txt b/Documentation/technical/cruft-packs.txt
deleted file mode 100644
index d81f3a8..0000000
--- a/Documentation/technical/cruft-packs.txt
+++ /dev/null
@@ -1,123 +0,0 @@
-= Cruft packs
-
-The cruft packs feature offer an alternative to Git's traditional mechanism of
-removing unreachable objects. This document provides an overview of Git's
-pruning mechanism, and how a cruft pack can be used instead to accomplish the
-same.
-
-== Background
-
-To remove unreachable objects from your repository, Git offers `git repack -Ad`
-(see linkgit:git-repack[1]). Quoting from the documentation:
-
-[quote]
-[...] unreachable objects in a previous pack become loose, unpacked objects,
-instead of being left in the old pack. [...] loose unreachable objects will be
-pruned according to normal expiry rules with the next 'git gc' invocation.
-
-Unreachable objects aren't removed immediately, since doing so could race with
-an incoming push which may reference an object which is about to be deleted.
-Instead, those unreachable objects are stored as loose objects and stay that way
-until they are older than the expiration window, at which point they are removed
-by linkgit:git-prune[1].
-
-Git must store these unreachable objects loose in order to keep track of their
-per-object mtimes. If these unreachable objects were written into one big pack,
-then either freshening that pack (because an object contained within it was
-re-written) or creating a new pack of unreachable objects would cause the pack's
-mtime to get updated, and the objects within it would never leave the expiration
-window. Instead, objects are stored loose in order to keep track of the
-individual object mtimes and avoid a situation where all cruft objects are
-freshened at once.
-
-This can lead to undesirable situations when a repository contains many
-unreachable objects which have not yet left the grace period. Having large
-directories in the shards of `.git/objects` can lead to decreased performance in
-the repository. But given enough unreachable objects, this can lead to inode
-starvation and degrade the performance of the whole system. Since we
-can never pack those objects, these repositories often take up a large amount of
-disk space, since we can only zlib compress them, but not store them in delta
-chains.
-
-== Cruft packs
-
-A cruft pack eliminates the need for storing unreachable objects in a loose
-state by including the per-object mtimes in a separate file alongside a single
-pack containing all loose objects.
-
-A cruft pack is written by `git repack --cruft` when generating a new pack.
-linkgit:git-pack-objects[1]'s `--cruft` option. Note that `git repack --cruft`
-is a classic all-into-one repack, meaning that everything in the resulting pack is
-reachable, and everything else is unreachable. Once written, the `--cruft`
-option instructs `git repack` to generate another pack containing only objects
-not packed in the previous step (which equates to packing all unreachable
-objects together). This progresses as follows:
-
- 1. Enumerate every object, marking any object which is (a) not contained in a
- kept-pack, and (b) whose mtime is within the grace period as a traversal
- tip.
-
- 2. Perform a reachability traversal based on the tips gathered in the previous
- step, adding every object along the way to the pack.
-
- 3. Write the pack out, along with a `.mtimes` file that records the per-object
- timestamps.
-
-This mode is invoked internally by linkgit:git-repack[1] when instructed to
-write a cruft pack. Crucially, the set of in-core kept packs is exactly the set
-of packs which will not be deleted by the repack; in other words, they contain
-all of the repository's reachable objects.
-
-When a repository already has a cruft pack, `git repack --cruft` typically only
-adds objects to it. An exception to this is when `git repack` is given the
-`--cruft-expiration` option, which allows the generated cruft pack to omit
-expired objects instead of waiting for linkgit:git-gc[1] to expire those objects
-later on.
-
-It is linkgit:git-gc[1] that is typically responsible for removing expired
-unreachable objects.
-
-== Caution for mixed-version environments
-
-Repositories that have cruft packs in them will continue to work with any older
-version of Git. Note, however, that previous versions of Git which do not
-understand the `.mtimes` file will use the cruft pack's mtime as the mtime for
-all of the objects in it. In other words, do not expect older (pre-cruft pack)
-versions of Git to interpret or even read the contents of the `.mtimes` file.
-
-Note that having mixed versions of Git GC-ing the same repository can lead to
-unreachable objects never being completely pruned. This can happen under the
-following circumstances:
-
- - An older version of Git running GC explodes the contents of an existing
- cruft pack loose, using the cruft pack's mtime.
- - A newer version running GC collects those loose objects into a cruft pack,
- where the .mtime file reflects the loose object's actual mtimes, but the
- cruft pack mtime is "now".
-
-Repeating this process will lead to unreachable objects not getting pruned as a
-result of repeatedly resetting the objects' mtimes to the present time.
-
-If you are GC-ing repositories in a mixed version environment, consider omitting
-the `--cruft` option when using linkgit:git-repack[1] and linkgit:git-gc[1], and
-leaving the `gc.cruftPacks` configuration unset until all writers understand
-cruft packs.
-
-== Alternatives
-
-Notable alternatives to this design include:
-
- - The location of the per-object mtime data, and
- - Storing unreachable objects in multiple cruft packs.
-
-On the location of mtime data, a new auxiliary file tied to the pack was chosen
-to avoid complicating the `.idx` format. If the `.idx` format were ever to gain
-support for optional chunks of data, it may make sense to consolidate the
-`.mtimes` format into the `.idx` itself.
-
-Storing unreachable objects among multiple cruft packs (e.g., creating a new
-cruft pack during each repacking operation including only unreachable objects
-which aren't already stored in an earlier cruft pack) is significantly more
-complicated to construct, and so aren't pursued here. The obvious drawback to
-the current implementation is that the entire cruft pack must be re-written from
-scratch.
diff --git a/Documentation/technical/hash-function-transition.txt b/Documentation/technical/hash-function-transition.txt
index 260224b..ed57481 100644
--- a/Documentation/technical/hash-function-transition.txt
+++ b/Documentation/technical/hash-function-transition.txt
@@ -205,7 +205,7 @@ SHA-1 content.
Object storage
~~~~~~~~~~~~~~
Loose objects use zlib compression and packed objects use the packed
-format described in Documentation/technical/pack-format.txt, just like
+format described in linkgit:gitformat-pack[5], just like
today. The content that is compressed and stored uses SHA-256 content
instead of SHA-1 content.
@@ -562,7 +562,7 @@ hash re-encode during clone and to encourage peers to modernize.
The design described here allows fetches by SHA-1 clients of a
personal SHA-256 repository because it's not much more difficult than
allowing pushes from that repository. This support needs to be guarded
-by a configuration option --- servers like git.kernel.org that serve a
+by a configuration option -- servers like git.kernel.org that serve a
large number of clients would not be expected to bear that cost.
Meaning of signatures
diff --git a/Documentation/technical/long-running-process-protocol.txt b/Documentation/technical/long-running-process-protocol.txt
index aa0aa9a..6f33654 100644
--- a/Documentation/technical/long-running-process-protocol.txt
+++ b/Documentation/technical/long-running-process-protocol.txt
@@ -3,7 +3,7 @@ Long-running process protocol
This protocol is used when Git needs to communicate with an external
process throughout the entire life of a single Git command. All
-communication is in pkt-line format (see technical/protocol-common.txt)
+communication is in pkt-line format (see linkgit:gitprotocol-common[5])
over standard input and standard output.
Handshake
diff --git a/Documentation/technical/packfile-uri.txt b/Documentation/technical/packfile-uri.txt
index 1eb525f..9d453d4 100644
--- a/Documentation/technical/packfile-uri.txt
+++ b/Documentation/technical/packfile-uri.txt
@@ -18,7 +18,7 @@ a `packfile-uris` argument, the server MAY send a `packfile-uris` section
directly before the `packfile` section (right after `wanted-refs` if it is
sent) containing URIs of any of the given protocols. The URIs point to
packfiles that use only features that the client has declared that it supports
-(e.g. ofs-delta and thin-pack). See protocol-v2.txt for the documentation of
+(e.g. ofs-delta and thin-pack). See linkgit:gitprotocol-v2[5] for the documentation of
this section.
Clients should then download and index all the given URIs (in addition to
diff --git a/Documentation/technical/parallel-checkout.txt b/Documentation/technical/parallel-checkout.txt
index e790258..b4a144e 100644
--- a/Documentation/technical/parallel-checkout.txt
+++ b/Documentation/technical/parallel-checkout.txt
@@ -56,14 +56,14 @@ Rejected Multi-Threaded Solution
The most "straightforward" implementation would be to spread the set of
to-be-updated cache entries across multiple threads. But due to the
-thread-unsafe functions in the ODB code, we would have to use locks to
+thread-unsafe functions in the object database code, we would have to use locks to
coordinate the parallel operation. An early prototype of this solution
showed that the multi-threaded checkout would bring performance
improvements over the sequential code, but there was still too much lock
contention. A `perf` profiling indicated that around 20% of the runtime
during a local Linux clone (on an SSD) was spent in locking functions.
For this reason this approach was rejected in favor of using multiple
-child processes, which led to a better performance.
+child processes, which led to better performance.
Multi-Process Solution
----------------------
@@ -126,7 +126,7 @@ Then, for each assigned item, each worker:
* W5: Writes the result to the file descriptor opened at W2.
-* W6: Calls `fstat()` or lstat()` on the just-written path, and sends
+* W6: Calls `fstat()` or `lstat()` on the just-written path, and sends
the result back to the main process, together with the end status of
the operation and the item's identification number.
@@ -148,7 +148,7 @@ information, the main process handles the results in two steps:
- First, it updates the in-memory index with the `lstat()` information
sent by the workers. (This must be done first as this information
- might me required in the following step.)
+ might be required in the following step.)
- Then it writes the items which collided on disk (i.e. items marked
with `PC_ITEM_COLLIDED`). More on this below.
@@ -185,7 +185,7 @@ quite straightforward: for each parallel-eligible entry, the main
process must remove all files that prevent this entry from being written
(before enqueueing it). This includes any non-directory file in the
leading path of the entry. Later, when a worker gets assigned the entry,
-it looks again for the non-directories files and for an already existing
+it looks again for the non-directory files and for an already existing
file at the entry's path. If any of these checks finds something, the
worker knows that there was a path collision.
@@ -232,7 +232,7 @@ conversion and re-encoding, are eligible for parallel checkout.
Ineligible entries are checked out by the classic sequential codepath
*before* spawning workers.
-Note: submodules's files are also eligible for parallel checkout (as
+Note: submodules' files are also eligible for parallel checkout (as
long as they don't fall into any of the excluding categories mentioned
above). But since each submodule is checked out in its own child
process, we don't mix the superproject's and the submodules' files in
diff --git a/Documentation/technical/partial-clone.txt b/Documentation/technical/partial-clone.txt
index 99f0eb3..cd948b0 100644
--- a/Documentation/technical/partial-clone.txt
+++ b/Documentation/technical/partial-clone.txt
@@ -3,7 +3,7 @@ Partial Clone Design Notes
The "Partial Clone" feature is a performance optimization for Git that
allows Git to function without having a complete copy of the repository.
-The goal of this work is to allow Git better handle extremely large
+The goal of this work is to allow Git to better handle extremely large
repositories.
During clone and fetch operations, Git downloads the complete contents
@@ -79,7 +79,7 @@ Design Details
upload-pack negotiation.
+
This uses the existing capability discovery mechanism.
-See "filter" in Documentation/technical/pack-protocol.txt.
+See "filter" in linkgit:gitprotocol-pack[5].
- Clients pass a "filter-spec" to clone and fetch which is passed to the
server to request filtering during packfile construction.
@@ -256,7 +256,7 @@ remote in a specific order.
- Dynamic object fetching currently uses the existing pack protocol V0
which means that each object is requested via fetch-pack. The server
will send a full set of info/refs when the connection is established.
- If there are large number of refs, this may incur significant overhead.
+ If there are a large number of refs, this may incur significant overhead.
Future Work
@@ -265,7 +265,7 @@ Future Work
- Improve the way to specify the order in which promisor remotes are
tried.
+
-For example this could allow to specify explicitly something like:
+For example this could allow specifying explicitly something like:
"When fetching from this remote, I want to use these promisor remotes
in this order, though, when pushing or fetching to that remote, I want
to use those promisor remotes in that order."
@@ -322,7 +322,7 @@ Footnotes
[a] expensive-to-modify list of missing objects: Earlier in the design of
partial clone we discussed the need for a single list of missing objects.
- This would essentially be a sorted linear list of OIDs that the were
+ This would essentially be a sorted linear list of OIDs that were
omitted by the server during a clone or subsequent fetches.
This file would need to be loaded into memory on every object lookup.
diff --git a/Documentation/technical/racy-git.txt b/Documentation/technical/racy-git.txt
index ceda4bb..59bea66 100644
--- a/Documentation/technical/racy-git.txt
+++ b/Documentation/technical/racy-git.txt
@@ -11,7 +11,7 @@ write out the next tree object to be committed. The state is
"virtual" in the sense that it does not necessarily have to, and
often does not, match the files in the working tree.
-There are cases Git needs to examine the differences between the
+There are cases where Git needs to examine the differences between the
virtual working tree state in the index and the files in the
working tree. The most obvious case is when the user asks `git
diff` (or its low level implementation, `git diff-files`) or
@@ -165,9 +165,9 @@ Avoiding runtime penalty
In order to avoid the above runtime penalty, post 1.4.2 Git used
to have a code that made sure the index file
-got timestamp newer than the youngest files in the index when
-there are many young files with the same timestamp as the
-resulting index file would otherwise would have by waiting
+got a timestamp newer than the youngest files in the index when
+there were many young files with the same timestamp as the
+resulting index file otherwise would have by waiting
before finishing writing the index file out.
I suspected that in practice the situation where many paths in the
@@ -190,7 +190,7 @@ In a large project where raciness avoidance cost really matters,
however, the initial computation of all object names in the
index takes more than one second, and the index file is written
out after all that happens. Therefore the timestamp of the
-index file will be more than one seconds later than the
+index file will be more than one second later than the
youngest file in the working tree. This means that in these
cases there actually will not be any racily clean entry in
the resulting index.
diff --git a/Documentation/technical/reftable.txt b/Documentation/technical/reftable.txt
index 6a67cc4..dd0b37c 100644
--- a/Documentation/technical/reftable.txt
+++ b/Documentation/technical/reftable.txt
@@ -46,7 +46,7 @@ search lookup, and range scans.
Storage in the file is organized into variable sized blocks. Prefix
compression is used within a single block to reduce disk space. Block
-size and alignment is tunable by the writer.
+size and alignment are tunable by the writer.
Performance
^^^^^^^^^^^
@@ -115,7 +115,7 @@ Varint encoding
Varint encoding is identical to the ofs-delta encoding method used
within pack files.
-Decoder works such as:
+Decoder works as follows:
....
val = buf[ptr] & 0x7f
@@ -175,7 +175,7 @@ log_index*
footer
....
-in a log-only file the first log block immediately follows the file
+In a log-only file, the first log block immediately follows the file
header, without padding to block alignment.
Block size
@@ -247,7 +247,7 @@ uint32( hash_id )
....
The header is identical to `version_number=1`, with the 4-byte hash ID
-("sha1" for SHA1 and "s256" for SHA-256) append to the header.
+("sha1" for SHA1 and "s256" for SHA-256) appended to the header.
For maximum backward compatibility, it is recommended to use version 1 when
writing SHA1 reftables.
@@ -288,7 +288,7 @@ The 2-byte `restart_count` stores the number of entries in the
`restart_count` to binary search between restarts before starting a
linear scan.
-Exactly `restart_count` 3-byte `restart_offset` values precedes the
+Exactly `restart_count` 3-byte `restart_offset` values precede the
`restart_count`. Offsets are relative to the start of the block and
refer to the first byte of any `ref_record` whose name has not been
prefix compressed. Entries in the `restart_offset` list must be sorted,
diff --git a/Documentation/technical/remembering-renames.txt b/Documentation/technical/remembering-renames.txt
index 2fd5cc8..73f4176 100644
--- a/Documentation/technical/remembering-renames.txt
+++ b/Documentation/technical/remembering-renames.txt
@@ -20,7 +20,7 @@ Outline:
3. Why any rename on MERGE_SIDE1 in any given pick is _almost_ always also
a rename on MERGE_SIDE1 for the next pick
- 4. A detailed description of the the counter-examples to #3.
+ 4. A detailed description of the counter-examples to #3.
5. Why the special cases in #4 are still fully reasonable to use to pair
up files for three-way content merging in the merge machinery, and why
@@ -407,7 +407,7 @@ considered to be "irrelevant". See for example the following commits:
no longer relevant", 2021-03-13)
Relevance is always determined by what the _other_ side of history has
-done, in terms of modifing a file that our side renamed, or adding a
+done, in terms of modifying a file that our side renamed, or adding a
file to a directory which our side renamed. This means that a path
that is "irrelevant" when picking the first commit of a series in a
rebase or cherry-pick, may suddenly become "relevant" when picking the
@@ -664,7 +664,7 @@ skip-irrelevant-renames optimization means we sometimes don't detect
renames for any files within a directory that was renamed, in which
case we will not have been able to detect any rename for the directory
itself. In such a case, we do not know whether the directory was
-renamed; we want to be careful to avoid cacheing some kind of "this
+renamed; we want to be careful to avoid caching some kind of "this
directory was not renamed" statement. If we did, then a subsequent
commit being rebased could add a file to the old directory, and the
user would expect it to end up in the correct directory -- something
diff --git a/Documentation/technical/repository-version.txt b/Documentation/technical/repository-version.txt
index 7844ef3..4728142 100644
--- a/Documentation/technical/repository-version.txt
+++ b/Documentation/technical/repository-version.txt
@@ -82,9 +82,9 @@ When the config key `extensions.preciousObjects` is set to `true`,
objects in the repository MUST NOT be deleted (e.g., by `git-prune` or
`git repack -d`).
-==== `partialclone`
+==== `partialClone`
-When the config key `extensions.partialclone` is set, it indicates
+When the config key `extensions.partialClone` is set, it indicates
that the repo was created with a partial clone (or later performed
a partial fetch) and that the remote may have omitted sending
certain unwanted objects. Such a remote is called a "promisor remote"
@@ -96,7 +96,13 @@ The value of this key is the name of the promisor remote.
==== `worktreeConfig`
If set, by default "git config" reads from both "config" and
-"config.worktree" file from GIT_DIR in that order. In
+"config.worktree" files from GIT_DIR in that order. In
multiple working directory mode, "config" file is shared while
"config.worktree" is per-working directory (i.e., it's in
GIT_COMMON_DIR/worktrees/<id>/config.worktree)
+
+==== `refStorage`
+
+Specifies the file format for the ref database. The valid values are
+`files` (loose references with a packed-refs file) and `reftable` (see
+Documentation/technical/reftable.txt).
diff --git a/Documentation/technical/rerere.txt b/Documentation/technical/rerere.txt
index 35d4541..580f233 100644
--- a/Documentation/technical/rerere.txt
+++ b/Documentation/technical/rerere.txt
@@ -60,7 +60,7 @@ By resolving this conflict, to leave line D, the user declares:
what AB and AC wanted to do.
As branch AC2 refers to the same commit as AC, the above implies that
-this is also compatible what AB and AC2 wanted to do.
+this is also compatible with what AB and AC2 wanted to do.
By extension, this means that rerere should recognize that the above
conflicts are the same. To do this, the labels on the conflict
@@ -76,7 +76,7 @@ examples would both result in the following normalized conflict:
Sorting hunks
~~~~~~~~~~~~~
-As before, lets imagine that a common ancestor had a file with line A
+As before, let's imagine that a common ancestor had a file with line A
its early part, and line X in its late part. And then four branches
are forked that do these things:
@@ -99,7 +99,7 @@ conflict to leave line D means that the user declares:
compatible with what AB and AC wanted to do.
So the conflict we would see when merging AB into ACAB should be
-resolved the same way---it is the resolution that is in line with that
+resolved the same way--it is the resolution that is in line with that
declaration.
Imagine that similarly previously a branch XYXZ was forked from XY,
@@ -145,7 +145,7 @@ Nested conflicts
Nested conflicts are handled very similarly to "simple" conflicts.
Similar to simple conflicts, the conflict is first normalized by
stripping the labels from conflict markers, stripping the common ancestor
-version, and the sorting the conflict hunks, both for the outer and the
+version, and sorting the conflict hunks, both for the outer and the
inner conflict. This is done recursively, so any number of nested
conflicts can be handled.
diff --git a/Documentation/technical/scalar.txt b/Documentation/technical/scalar.txt
new file mode 100644
index 0000000..921cb10
--- /dev/null
+++ b/Documentation/technical/scalar.txt
@@ -0,0 +1,66 @@
+Scalar
+======
+
+Scalar is a repository management tool that optimizes Git for use in large
+repositories. It accomplishes this by helping users to take advantage of
+advanced performance features in Git. Unlike most other Git built-in commands,
+Scalar is not executed as a subcommand of 'git'; rather, it is built as a
+separate executable containing its own series of subcommands.
+
+Background
+----------
+
+Scalar was originally designed as an add-on to Git and implemented as a .NET
+Core application. It was created based on the learnings from the VFS for Git
+project (another application aimed at improving the experience of working with
+large repositories). As part of its initial implementation, Scalar relied on
+custom features in the Microsoft fork of Git that have since been integrated
+into core Git:
+
+* partial clone,
+* commit graphs,
+* multi-pack index,
+* sparse checkout (cone mode),
+* scheduled background maintenance,
+* etc
+
+With the requisite Git functionality in place and a desire to bring the benefits
+of Scalar to the larger Git community, the Scalar application itself was ported
+from C# to C and integrated upstream.
+
+Features
+--------
+
+Scalar is comprised of two major pieces of functionality: automatically
+configuring built-in Git performance features and managing repository
+enlistments.
+
+The Git performance features configured by Scalar (see "Background" for
+examples) confer substantial performance benefits to large repositories, but are
+either too experimental to enable for all of Git yet, or only benefit large
+repositories. As new features are introduced, Scalar should be updated
+accordingly to incorporate them. This will prevent the tool from becoming stale
+while also providing a path for more easily bringing features to the appropriate
+users.
+
+Enlistments are how Scalar knows which repositories on a user's system should
+utilize Scalar-configured features. This allows it to update performance
+settings when new ones are added to the tool, as well as centrally manage
+repository maintenance. The enlistment structure - a root directory with a
+`src/` subdirectory containing the cloned repository itself - is designed to
+encourage users to route build outputs outside of the repository to avoid the
+performance-limiting overhead of ignoring those files in Git.
+
+Design
+------
+
+Scalar is implemented in C and interacts with Git via a mix of child process
+invocations of Git and direct usage of `libgit.a`. Internally, it is structured
+much like other built-ins with subcommands (e.g., `git stash`), containing a
+`cmd_<subcommand>()` function for each subcommand, routed through a `cmd_main()`
+function. Most options are unique to each subcommand, with `scalar` respecting
+some "global" `git` options (e.g., `-c` and `-C`).
+
+Because `scalar` is not invoked as a Git subcommand (like `git scalar`), it is
+built and installed as its own executable in the `bin/` directory, alongside
+`git`, `git-gui`, etc.
diff --git a/Documentation/technical/sparse-checkout.txt b/Documentation/technical/sparse-checkout.txt
new file mode 100644
index 0000000..fa0d01c
--- /dev/null
+++ b/Documentation/technical/sparse-checkout.txt
@@ -0,0 +1,1103 @@
+Table of contents:
+
+ * Terminology
+ * Purpose of sparse-checkouts
+ * Usecases of primary concern
+ * Oversimplified mental models ("Cliff Notes" for this document!)
+ * Desired behavior
+ * Behavior classes
+ * Subcommand-dependent defaults
+ * Sparse specification vs. sparsity patterns
+ * Implementation Questions
+ * Implementation Goals/Plans
+ * Known bugs
+ * Reference Emails
+
+
+=== Terminology ===
+
+cone mode: one of two modes for specifying the desired subset of files
+ in a sparse-checkout. In cone-mode, the user specifies
+ directories (getting both everything under that directory as
+ well as everything in leading directories), while in non-cone
+ mode, the user specifies gitignore-style patterns. Controlled
+ by the --[no-]cone option to sparse-checkout init|set.
+
+SKIP_WORKTREE: When tracked files do not match the sparse specification and
+ are removed from the working tree, the file in the index is marked
+ with a SKIP_WORKTREE bit. Note that if a tracked file has the
+ SKIP_WORKTREE bit set but the file is later written by the user to
+ the working tree anyway, the SKIP_WORKTREE bit will be cleared at
+ the beginning of any subsequent Git operation.
+
+ Most sparse checkout users are unaware of this implementation
+ detail, and the term should generally be avoided in user-facing
+ descriptions and command flags. Unfortunately, prior to the
+ `sparse-checkout` subcommand this low-level detail was exposed,
+ and as of time of writing, is still exposed in various places.
+
+sparse-checkout: a subcommand in git used to reduce the files present in
+ the working tree to a subset of all tracked files. Also, the
+ name of the file in the $GIT_DIR/info directory used to track
+ the sparsity patterns corresponding to the user's desired
+ subset.
+
+sparse cone: see cone mode
+
+sparse directory: An entry in the index corresponding to a directory, which
+ appears in the index instead of all the files under that directory
+ that would normally appear. See also sparse-index. Something that
+ can cause confusion is that the "sparse directory" does NOT match
+ the sparse specification, i.e. the directory is NOT present in the
+ working tree. May be renamed in the future (e.g. to "skipped
+ directory").
+
+sparse index: A special mode for sparse-checkout that also makes the
+ index sparse by recording a directory entry in lieu of all the
+ files underneath that directory (thus making that a "skipped
+ directory" which unfortunately has also been called a "sparse
+ directory"), and does this for potentially multiple
+ directories. Controlled by the --[no-]sparse-index option to
+ init|set|reapply.
+
+sparsity patterns: patterns from $GIT_DIR/info/sparse-checkout used to
+ define the set of files of interest. A warning: It is easy to
+ over-use this term (or the shortened "patterns" term), for two
+ reasons: (1) users in cone mode specify directories rather than
+ patterns (their directories are transformed into patterns, but
+ users may think you are talking about non-cone mode if you use the
+ word "patterns"), and (b) the sparse specification might
+ transiently differ in the working tree or index from the sparsity
+ patterns (see "Sparse specification vs. sparsity patterns").
+
+sparse specification: The set of paths in the user's area of focus. This
+ is typically just the tracked files that match the sparsity
+ patterns, but the sparse specification can temporarily differ and
+ include additional files. (See also "Sparse specification
+ vs. sparsity patterns")
+
+ * When working with history, the sparse specification is exactly
+ the set of files matching the sparsity patterns.
+ * When interacting with the working tree, the sparse specification
+ is the set of tracked files with a clear SKIP_WORKTREE bit or
+ tracked files present in the working copy.
+ * When modifying or showing results from the index, the sparse
+ specification is the set of files with a clear SKIP_WORKTREE bit
+ or that differ in the index from HEAD.
+ * If working with the index and the working copy, the sparse
+ specification is the union of the paths from above.
+
+vivifying: When a command restores a tracked file to the working tree (and
+ hopefully also clears the SKIP_WORKTREE bit in the index for that
+ file), this is referred to as "vivifying" the file.
+
+
+=== Purpose of sparse-checkouts ===
+
+sparse-checkouts exist to allow users to work with a subset of their
+files.
+
+You can think of sparse-checkouts as subdividing "tracked" files into two
+categories -- a sparse subset, and all the rest. Implementationally, we
+mark "all the rest" in the index with a SKIP_WORKTREE bit and leave them
+out of the working tree. The SKIP_WORKTREE files are still tracked, just
+not present in the working tree.
+
+In the past, sparse-checkouts were defined by "SKIP_WORKTREE means the file
+is missing from the working tree but pretend the file contents match HEAD".
+That was not only bogus (it actually meant the file missing from the
+working tree matched the index rather than HEAD), but it was also a
+low-level detail which only provided decent behavior for a few commands.
+There were a surprising number of ways in which that guiding principle gave
+command results that violated user expectations, and as such was a bad
+mental model. However, it persisted for many years and may still be found
+in some corners of the code base.
+
+Anyway, the idea of "working with a subset of files" is simple enough, but
+there are multiple different high-level usecases which affect how some Git
+subcommands should behave. Further, even if we only considered one of
+those usecases, sparse-checkouts can modify different subcommands in over a
+half dozen different ways. Let's start by considering the high level
+usecases:
+
+ A) Users are _only_ interested in the sparse portion of the repo
+
+ A*) Users are _only_ interested in the sparse portion of the repo
+ that they have downloaded so far
+
+ B) Users want a sparse working tree, but are working in a larger whole
+
+ C) sparse-checkout is a behind-the-scenes implementation detail allowing
+ Git to work with a specially crafted in-house virtual file system;
+ users are actually working with a "full" working tree that is
+ lazily populated, and sparse-checkout helps with the lazy population
+ piece.
+
+It may be worth explaining each of these in a bit more detail:
+
+
+ (Behavior A) Users are _only_ interested in the sparse portion of the repo
+
+These folks might know there are other things in the repository, but
+don't care. They are uninterested in other parts of the repository, and
+only want to know about changes within their area of interest. Showing
+them other files from history (e.g. from diff/log/grep/etc.) is a
+usability annoyance, potentially a huge one since other changes in
+history may dwarf the changes they are interested in.
+
+Some of these users also arrive at this usecase from wanting to use partial
+clones together with sparse checkouts (in a way where they have downloaded
+blobs within the sparse specification) and do disconnected development.
+Not only do these users generally not care about other parts of the
+repository, but consider it a blocker for Git commands to try to operate on
+those. If commands attempt to access paths in history outside the sparsity
+specification, then the partial clone will attempt to download additional
+blobs on demand, fail, and then fail the user's command. (This may be
+unavoidable in some cases, e.g. when `git merge` has non-trivial changes to
+reconcile outside the sparse specification, but we should limit how often
+users are forced to connect to the network.)
+
+Also, even for users using partial clones that do not mind being
+always connected to the network, the need to download blobs as
+side-effects of various other commands (such as the printed diffstat
+after a merge or pull) can lead to worries about local repository size
+growing unnecessarily[10].
+
+ (Behavior A*) Users are _only_ interested in the sparse portion of the repo
+ that they have downloaded so far (a variant on the first usecase)
+
+This variant is driven by folks who using partial clones together with
+sparse checkouts and do disconnected development (so far sounding like a
+subset of behavior A users) and doing so on very large repositories. The
+reason for yet another variant is that downloading even just the blobs
+through history within their sparse specification may be too much, so they
+only download some. They would still like operations to succeed without
+network connectivity, though, so things like `git log -S${SEARCH_TERM} -p`
+or `git grep ${SEARCH_TERM} OLDREV ` would need to be prepared to provide
+partial results that depend on what happens to have been downloaded.
+
+This variant could be viewed as Behavior A with the sparse specification
+for history querying operations modified from "sparsity patterns" to
+"sparsity patterns limited to the blobs we have already downloaded".
+
+ (Behavior B) Users want a sparse working tree, but are working in a
+ larger whole
+
+Stolee described this usecase this way[11]:
+
+"I'm also focused on users that know that they are a part of a larger
+whole. They know they are operating on a large repository but focus on
+what they need to contribute their part. I expect multiple "roles" to
+use very different, almost disjoint parts of the codebase. Some other
+"architect" users operate across the entire tree or hop between different
+sections of the codebase as necessary. In this situation, I'm wary of
+scoping too many features to the sparse-checkout definition, especially
+"git log," as it can be too confusing to have their view of the codebase
+depend on your "point of view."
+
+People might also end up wanting behavior B due to complex inter-project
+dependencies. The initial attempts to use sparse-checkouts usually involve
+the directories you are directly interested in plus what those directories
+depend upon within your repository. But there's a monkey wrench here: if
+you have integration tests, they invert the hierarchy: to run integration
+tests, you need not only what you are interested in and its in-tree
+dependencies, you also need everything that depends upon what you are
+interested in or that depends upon one of your dependencies...AND you need
+all the in-tree dependencies of that expanded group. That can easily
+change your sparse-checkout into a nearly dense one.
+
+Naturally, that tends to kill the benefits of sparse-checkouts. There are
+a couple solutions to this conundrum: either avoid grabbing in-repo
+dependencies (maybe have built versions of your in-repo dependencies pulled
+from a CI cache somewhere), or say that users shouldn't run integration
+tests directly and instead do it on the CI server when they submit a code
+review. Or do both. Regardless of whether you stub out your in-repo
+dependencies or stub out the things that depend upon you, there is
+certainly a reason to want to query and be aware of those other stubbed-out
+parts of the repository, particularly when the dependencies are complex or
+change relatively frequently. Thus, for such uses, sparse-checkouts can be
+used to limit what you directly build and modify, but these users do not
+necessarily want their sparse checkout paths to limit their queries of
+versions in history.
+
+Some people may also be interested in behavior B over behavior A simply as
+a performance workaround: if they are using non-cone mode, then they have
+to deal with its inherent quadratic performance problems. In that mode,
+every operation that checks whether paths match the sparsity specification
+can be expensive. As such, these users may only be willing to pay for
+those expensive checks when interacting with the working copy, and may
+prefer getting "unrelated" results from their history queries over having
+slow commands.
+
+ (Behavior C) sparse-checkout is an implementational detail supporting a
+ special VFS.
+
+This usecase goes slightly against the traditional definition of
+sparse-checkout in that it actually tries to present a full or dense
+checkout to the user. However, this usecase utilizes the same underlying
+technical underpinnings in a new way which does provide some performance
+advantages to users. The basic idea is that a company can have an in-house
+Git-aware Virtual File System which pretends all files are present in the
+working tree, by intercepting all file system accesses and using those to
+fetch and write accessed files on demand via partial clones. The VFS uses
+sparse-checkout to prevent Git from writing or paying attention to many
+files, and manually updates the sparse checkout patterns itself based on
+user access and modification of files in the working tree. See commit
+ecc7c8841d ("repo_read_index: add config to expect files outside sparse
+patterns", 2022-02-25) and the link at [17] for a more detailed description
+of such a VFS.
+
+The biggest difference here is that users are completely unaware that the
+sparse-checkout machinery is even in use. The sparse patterns are not
+specified by the user but rather are under the complete control of the VFS
+(and the patterns are updated frequently and dynamically by it). The user
+will perceive the checkout as dense, and commands should thus behave as if
+all files are present.
+
+
+=== Usecases of primary concern ===
+
+Most of the rest of this document will focus on Behavior A and Behavior
+B. Some notes about the other two cases and why we are not focusing on
+them:
+
+ (Behavior A*)
+
+Supporting this usecase is estimated to be difficult and a lot of work.
+There are no plans to implement it currently, but it may be a potential
+future alternative. Knowing about the existence of additional alternatives
+may affect our choice of command line flags (e.g. if we need tri-state or
+quad-state flags rather than just binary flags), so it was still important
+to at least note.
+
+Further, I believe the descriptions below for Behavior A are probably still
+valid for this usecase, with the only exception being that it redefines the
+sparse specification to restrict it to already-downloaded blobs. The hard
+part is in making commands capable of respecting that modified definition.
+
+ (Behavior C)
+
+This usecase violates some of the early sparse-checkout documented
+assumptions (since files marked as SKIP_WORKTREE will be displayed to users
+as present in the working tree). That violation may mean various
+sparse-checkout related behaviors are not well suited to this usecase and
+we may need tweaks -- to both documentation and code -- to handle it.
+However, this usecase is also perhaps the simplest model to support in that
+everything behaves like a dense checkout with a few exceptions (e.g. branch
+checkouts and switches write fewer things, knowing the VFS will lazily
+write the rest on an as-needed basis).
+
+Since there is no publically available VFS-related code for folks to try,
+the number of folks who can test such a usecase is limited.
+
+The primary reason to note the Behavior C usecase is that as we fix things
+to better support Behaviors A and B, there may be additional places where
+we need to make tweaks allowing folks in this usecase to get the original
+non-sparse treatment. For an example, see ecc7c8841d ("repo_read_index:
+add config to expect files outside sparse patterns", 2022-02-25). The
+secondary reason to note Behavior C, is so that folks taking advantage of
+Behavior C do not assume they are part of the Behavior B camp and propose
+patches that break things for the real Behavior B folks.
+
+
+=== Oversimplified mental models ===
+
+An oversimplification of the differences in the above behaviors is:
+
+ Behavior A: Restrict worktree and history operations to sparse specification
+ Behavior B: Restrict worktree operations to sparse specification; have any
+ history operations work across all files
+ Behavior C: Do not restrict either worktree or history operations to the
+ sparse specification...with the exception of branch checkouts or
+ switches which avoid writing files that will match the index so
+ they can later lazily be populated instead.
+
+
+=== Desired behavior ===
+
+As noted previously, despite the simple idea of just working with a subset
+of files, there are a range of different behavioral changes that need to be
+made to different subcommands to work well with such a feature. See
+[1,2,3,4,5,6,7,8,9,10] for various examples. In particular, at [2], we saw
+that mere composition of other commands that individually worked correctly
+in a sparse-checkout context did not imply that the higher level command
+would work correctly; it sometimes requires further tweaks. So,
+understanding these differences can be beneficial.
+
+* Commands behaving the same regardless of high-level use-case
+
+ * commands that only look at files within the sparsity specification
+
+ * diff (without --cached or REVISION arguments)
+ * grep (without --cached or REVISION arguments)
+ * diff-files
+
+ * commands that restore files to the working tree that match sparsity
+ patterns, and remove unmodified files that don't match those
+ patterns:
+
+ * switch
+ * checkout (the switch-like half)
+ * read-tree
+ * reset --hard
+
+ * commands that write conflicted files to the working tree, but otherwise
+ will omit writing files to the working tree that do not match the
+ sparsity patterns:
+
+ * merge
+ * rebase
+ * cherry-pick
+ * revert
+
+ * `am` and `apply --cached` should probably be in this section but
+ are buggy (see the "Known bugs" section below)
+
+ The behavior for these commands somewhat depends upon the merge
+ strategy being used:
+ * `ort` behaves as described above
+ * `recursive` tries to not vivify files unnecessarily, but does sometimes
+ vivify files without conflicts.
+ * `octopus` and `resolve` will always vivify any file changed in the merge
+ relative to the first parent, which is rather suboptimal.
+
+ It is also important to note that these commands WILL update the index
+ outside the sparse specification relative to when the operation began,
+ BUT these commands often make a commit just before or after such that
+ by the end of the operation there is no change to the index outside the
+ sparse specification. Of course, if the operation hits conflicts or
+ does not make a commit, then these operations clearly can modify the
+ index outside the sparse specification.
+
+ Finally, it is important to note that at least the first four of these
+ commands also try to remove differences between the sparse
+ specification and the sparsity patterns (much like the commands in the
+ previous section).
+
+ * commands that always ignore sparsity since commits must be full-tree
+
+ * archive
+ * bundle
+ * commit
+ * format-patch
+ * fast-export
+ * fast-import
+ * commit-tree
+
+ * commands that write any modified file to the working tree (conflicted
+ or not, and whether those paths match sparsity patterns or not):
+
+ * stash
+ * apply (without `--index` or `--cached`)
+
+* Commands that may slightly differ for behavior A vs. behavior B:
+
+ Commands in this category behave mostly the same between the two
+ behaviors, but may differ in verbosity and types of warning and error
+ messages.
+
+ * commands that make modifications to which files are tracked:
+ * add
+ * rm
+ * mv
+ * update-index
+
+ The fact that files can move between the 'tracked' and 'untracked'
+ categories means some commands will have to treat untracked files
+ differently. But if we have to treat untracked files differently,
+ then additional commands may also need changes:
+
+ * status
+ * clean
+
+ In particular, `status` may need to report any untracked files outside
+ the sparsity specification as an erroneous condition (especially to
+ avoid the user trying to `git add` them, forcing `git add` to display
+ an error).
+
+ It's not clear to me exactly how (or even if) `clean` would change,
+ but it's the other command that also affects untracked files.
+
+ `update-index` may be slightly special. Its --[no-]skip-worktree flag
+ may need to ignore the sparse specification by its nature. Also, its
+ current --[no-]ignore-skip-worktree-entries default is totally bogus.
+
+ * commands for manually tweaking paths in both the index and the working tree
+ * `restore`
+ * the restore-like half of `checkout`
+
+ These commands should be similar to add/rm/mv in that they should
+ only operate on the sparse specification by default, and require a
+ special flag to operate on all files.
+
+ Also, note that these commands currently have a number of issues (see
+ the "Known bugs" section below)
+
+* Commands that significantly differ for behavior A vs. behavior B:
+
+ * commands that query history
+ * diff (with --cached or REVISION arguments)
+ * grep (with --cached or REVISION arguments)
+ * show (when given commit arguments)
+ * blame (only matters when one or more -C flags are passed)
+ * and annotate
+ * log
+ * whatchanged
+ * ls-files
+ * diff-index
+ * diff-tree
+ * ls-tree
+
+ Note: for log and whatchanged, revision walking logic is unaffected
+ but displaying of patches is affected by scoping the command to the
+ sparse-checkout. (The fact that revision walking is unaffected is
+ why rev-list, shortlog, show-branch, and bisect are not in this
+ list.)
+
+ ls-files may be slightly special in that e.g. `git ls-files -t` is
+ often used to see what is sparse and what is not. Perhaps -t should
+ always work on the full tree?
+
+* Commands I don't know how to classify
+
+ * range-diff
+
+ Is this like `log` or `format-patch`?
+
+ * cherry
+
+ See range-diff
+
+* Commands unaffected by sparse-checkouts
+
+ * shortlog
+ * show-branch
+ * rev-list
+ * bisect
+
+ * branch
+ * describe
+ * fetch
+ * gc
+ * init
+ * maintenance
+ * notes
+ * pull (merge & rebase have the necessary changes)
+ * push
+ * submodule
+ * tag
+
+ * config
+ * filter-branch (works in separate checkout without sparse-checkout setup)
+ * pack-refs
+ * prune
+ * remote
+ * repack
+ * replace
+
+ * bugreport
+ * count-objects
+ * fsck
+ * gitweb
+ * help
+ * instaweb
+ * merge-tree (doesn't touch worktree or index, and merges always compute full-tree)
+ * rerere
+ * verify-commit
+ * verify-tag
+
+ * commit-graph
+ * hash-object
+ * index-pack
+ * mktag
+ * mktree
+ * multi-pack-index
+ * pack-objects
+ * prune-packed
+ * symbolic-ref
+ * unpack-objects
+ * update-ref
+ * write-tree (operates on index, possibly optimized to use sparse dir entries)
+
+ * for-each-ref
+ * get-tar-commit-id
+ * ls-remote
+ * merge-base (merges are computed full tree, so merge base should be too)
+ * name-rev
+ * pack-redundant
+ * rev-parse
+ * show-index
+ * show-ref
+ * unpack-file
+ * var
+ * verify-pack
+
+ * <Everything under 'Interacting with Others' in 'git help --all'>
+ * <Everything under 'Low-level...Syncing' in 'git help --all'>
+ * <Everything under 'Low-level...Internal Helpers' in 'git help --all'>
+ * <Everything under 'External commands' in 'git help --all'>
+
+* Commands that might be affected, but who cares?
+
+ * merge-file
+ * merge-index
+ * gitk?
+
+
+=== Behavior classes ===
+
+From the above there are a few classes of behavior:
+
+ * "restrict"
+
+ Commands in this class only read or write files in the working tree
+ within the sparse specification.
+
+ When moving to a new commit (e.g. switch, reset --hard), these commands
+ may update index files outside the sparse specification as of the start
+ of the operation, but by the end of the operation those index files
+ will match HEAD again and thus those files will again be outside the
+ sparse specification.
+
+ When paths are explicitly specified, these paths are intersected with
+ the sparse specification and will only operate on such paths.
+ (e.g. `git restore [--staged] -- '*.png'`, `git reset -p -- '*.md'`)
+
+ Some of these commands may also attempt, at the end of their operation,
+ to cull transient differences between the sparse specification and the
+ sparsity patterns (see "Sparse specification vs. sparsity patterns" for
+ details, but this basically means either removing unmodified files not
+ matching the sparsity patterns and marking those files as
+ SKIP_WORKTREE, or vivifying files that match the sparsity patterns and
+ marking those files as !SKIP_WORKTREE).
+
+ * "restrict modulo conflicts"
+
+ Commands in this class generally behave like the "restrict" class,
+ except that:
+ (1) they will ignore the sparse specification and write files with
+ conflicts to the working tree (thus temporarily expanding the
+ sparse specification to include such files.)
+ (2) they are grouped with commands which move to a new commit, since
+ they often create a commit and then move to it, even though we
+ know there are many exceptions to moving to the new commit. (For
+ example, the user may rebase a commit that becomes empty, or have
+ a cherry-pick which conflicts, or a user could run `merge
+ --no-commit`, and we also view `apply --index` kind of like `am
+ --no-commit`.) As such, these commands can make changes to index
+ files outside the sparse specification, though they'll mark such
+ files with SKIP_WORKTREE.
+
+ * "restrict also specially applied to untracked files"
+
+ Commands in this class generally behave like the "restrict" class,
+ except that they have to handle untracked files differently too, often
+ because these commands are dealing with files changing state between
+ 'tracked' and 'untracked'. Often, this may mean printing an error
+ message if the command had nothing to do, but the arguments may have
+ referred to files whose tracked-ness state could have changed were it
+ not for the sparsity patterns excluding them.
+
+ * "no restrict"
+
+ Commands in this class ignore the sparse specification entirely.
+
+ * "restrict or no restrict dependent upon behavior A vs. behavior B"
+
+ Commands in this class behave like "no restrict" for folks in the
+ behavior B camp, and like "restrict" for folks in the behavior A camp.
+ However, when behaving like "restrict" a warning of some sort might be
+ provided that history queries have been limited by the sparse-checkout
+ specification.
+
+
+=== Subcommand-dependent defaults ===
+
+Note that we have different defaults depending on the command for the
+desired behavior :
+
+ * Commands defaulting to "restrict":
+ * diff-files
+ * diff (without --cached or REVISION arguments)
+ * grep (without --cached or REVISION arguments)
+ * switch
+ * checkout (the switch-like half)
+ * reset (<commit>)
+
+ * restore
+ * checkout (the restore-like half)
+ * checkout-index
+ * reset (with pathspec)
+
+ This behavior makes sense; these interact with the working tree.
+
+ * Commands defaulting to "restrict modulo conflicts":
+ * merge
+ * rebase
+ * cherry-pick
+ * revert
+
+ * am
+ * apply --index (which is kind of like an `am --no-commit`)
+
+ * read-tree (especially with -m or -u; is kind of like a --no-commit merge)
+ * reset (<tree-ish>, due to similarity to read-tree)
+
+ These also interact with the working tree, but require slightly
+ different behavior either so that (a) conflicts can be resolved or (b)
+ because they are kind of like a merge-without-commit operation.
+
+ (See also the "Known bugs" section below regarding `am` and `apply`)
+
+ * Commands defaulting to "no restrict":
+ * archive
+ * bundle
+ * commit
+ * format-patch
+ * fast-export
+ * fast-import
+ * commit-tree
+
+ * stash
+ * apply (without `--index`)
+
+ These have completely different defaults and perhaps deserve the most
+ detailed explanation:
+
+ In the case of commands in the first group (format-patch,
+ fast-export, bundle, archive, etc.), these are commands for
+ communicating history, which will be broken if they restrict to a
+ subset of the repository. As such, they operate on full paths and
+ have no `--restrict` option for overriding. Some of these commands may
+ take paths for manually restricting what is exported, but it needs to
+ be very explicit.
+
+ In the case of stash, it needs to vivify files to avoid losing the
+ user's changes.
+
+ In the case of apply without `--index`, that command needs to update
+ the working tree without the index (or the index without the working
+ tree if `--cached` is passed), and if we restrict those updates to the
+ sparse specification then we'll lose changes from the user.
+
+ * Commands defaulting to "restrict also specially applied to untracked files":
+ * add
+ * rm
+ * mv
+ * update-index
+ * status
+ * clean (?)
+
+ Our original implementation for the first three of these commands was
+ "no restrict", but it had some severe usability issues:
+ * `git add <somefile>` if honored and outside the sparse
+ specification, can result in the file randomly disappearing later
+ when some subsequent command is run (since various commands
+ automatically clean up unmodified files outside the sparse
+ specification).
+ * `git rm '*.jpg'` could very negatively surprise users if it deletes
+ files outside the range of the user's interest.
+ * `git mv` has similar surprises when moving into or out of the cone,
+ so best to restrict by default
+
+ So, we switched `add` and `rm` to default to "restrict", which made
+ usability problems much less severe and less frequent, but we still got
+ complaints because commands like:
+ git add <file-outside-sparse-specification>
+ git rm <file-outside-sparse-specification>
+ would silently do nothing. We should instead print an error in those
+ cases to get usability right.
+
+ update-index needs to be updated to match, and status and maybe clean
+ also need to be updated to specially handle untracked paths.
+
+ There may be a difference in here between behavior A and behavior B in
+ terms of verboseness of errors or additional warnings.
+
+ * Commands falling under "restrict or no restrict dependent upon behavior
+ A vs. behavior B"
+
+ * diff (with --cached or REVISION arguments)
+ * grep (with --cached or REVISION arguments)
+ * show (when given commit arguments)
+ * blame (only matters when one or more -C flags passed)
+ * and annotate
+ * log
+ * and variants: shortlog, gitk, show-branch, whatchanged, rev-list
+ * ls-files
+ * diff-index
+ * diff-tree
+ * ls-tree
+
+ For now, we default to behavior B for these, which want a default of
+ "no restrict".
+
+ Note that two of these commands -- diff and grep -- also appeared in a
+ different list with a default of "restrict", but only when limited to
+ searching the working tree. The working tree vs. history distinction
+ is fundamental in how behavior B operates, so this is expected. Note,
+ though, that for diff and grep with --cached, when doing "restrict"
+ behavior, the difference between sparse specification and sparsity
+ patterns is important to handle.
+
+ "restrict" may make more sense as the long term default for these[12].
+ Also, supporting "restrict" for these commands might be a fair amount
+ of work to implement, meaning it might be implemented over multiple
+ releases. If that behavior were the default in the commands that
+ supported it, that would force behavior B users to need to learn to
+ slowly add additional flags to their commands, depending on git
+ version, to get the behavior they want. That gradual switchover would
+ be painful, so we should avoid it at least until it's fully
+ implemented.
+
+
+=== Sparse specification vs. sparsity patterns ===
+
+In a well-behaved situation, the sparse specification is given directly
+by the $GIT_DIR/info/sparse-checkout file. However, it can transiently
+diverge for a few reasons:
+
+ * needing to resolve conflicts (merging will vivify conflicted files)
+ * running Git commands that implicitly vivify files (e.g. "git stash apply")
+ * running Git commands that explicitly vivify files (e.g. "git checkout
+ --ignore-skip-worktree-bits FILENAME")
+ * other commands that write to these files (perhaps a user copies it
+ from elsewhere)
+
+For the last item, note that we do automatically clear the SKIP_WORKTREE
+bit for files that are present in the working tree. This has been true
+since 82386b4496 ("Merge branch 'en/present-despite-skipped'",
+2022-03-09)
+
+However, such a situation is transient because:
+
+ * Such transient differences can and will be automatically removed as
+ a side-effect of commands which call unpack_trees() (checkout,
+ merge, reset, etc.).
+ * Users can also request such transient differences be corrected via
+ running `git sparse-checkout reapply`. Various places recommend
+ running that command.
+ * Additional commands are also welcome to implicitly fix these
+ differences; we may add more in the future.
+
+While we avoid dropping unstaged changes or files which have conflicts,
+we otherwise aggressively try to fix these transient differences. If
+users want these differences to persist, they should run the `set` or
+`add` subcommands of `git sparse-checkout` to reflect their intended
+sparse specification.
+
+However, when we need to do a query on history restricted to the
+"relevant subset of files" such a transiently expanded sparse
+specification is ignored. There are a couple reasons for this:
+
+ * The behavior wanted when doing something like
+ git grep expression REVISION
+ is roughly what the users would expect from
+ git checkout REVISION && git grep expression
+ (modulo a "REVISION:" prefix), which has a couple ramifications:
+
+ * REVISION may have paths not in the current index, so there is no
+ path we can consult for a SKIP_WORKTREE setting for those paths.
+
+ * Since `checkout` is one of those commands that tries to remove
+ transient differences in the sparse specification, it makes sense
+ to use the corrected sparse specification
+ (i.e. $GIT_DIR/info/sparse-checkout) rather than attempting to
+ consult SKIP_WORKTREE anyway.
+
+So, a transiently expanded (or restricted) sparse specification applies to
+the working tree, but not to history queries where we always use the
+sparsity patterns. (See [16] for an early discussion of this.)
+
+Similar to a transiently expanded sparse specification of the working tree
+based on additional files being present in the working tree, we also need
+to consider additional files being modified in the index. In particular,
+if the user has staged changes to files (relative to HEAD) that do not
+match the sparsity patterns, and the file is not present in the working
+tree, we still want to consider the file part of the sparse specification
+if we are specifically performing a query related to the index (e.g. git
+diff --cached [REVISION], git diff-index [REVISION], git restore --staged
+--source=REVISION -- PATHS, etc.) Note that a transiently expanded sparse
+specification for the index usually only matters under behavior A, since
+under behavior B index operations are lumped with history and tend to
+operate full-tree.
+
+
+=== Implementation Questions ===
+
+ * Do the options --scope={sparse,all} sound good to others? Are there better
+ options?
+ * Names in use, or appearing in patches, or previously suggested:
+ * --sparse/--dense
+ * --ignore-skip-worktree-bits
+ * --ignore-skip-worktree-entries
+ * --ignore-sparsity
+ * --[no-]restrict-to-sparse-paths
+ * --full-tree/--sparse-tree
+ * --[no-]restrict
+ * --scope={sparse,all}
+ * --focus/--unfocus
+ * --limit/--unlimited
+ * Rationale making me lean slightly towards --scope={sparse,all}:
+ * We want a name that works for many commands, so we need a name that
+ does not conflict
+ * We know that we have more than two possible usecases, so it is best
+ to avoid a flag that appears to be binary.
+ * --scope={sparse,all} isn't overly long and seems relatively
+ explanatory
+ * `--sparse`, as used in add/rm/mv, is totally backwards for
+ grep/log/etc. Changing the meaning of `--sparse` for these
+ commands would fix the backwardness, but possibly break existing
+ scripts. Using a new name pairing would allow us to treat
+ `--sparse` in these commands as a deprecated alias.
+ * There is a different `--sparse`/`--dense` pair for commands using
+ revision machinery, so using that naming might cause confusion
+ * There is also a `--sparse` in both pack-objects and show-branch, which
+ don't conflict but do suggest that `--sparse` is overloaded
+ * The name --ignore-skip-worktree-bits is a double negative, is
+ quite a mouthful, refers to an implementation detail that many
+ users may not be familiar with, and we'd need a negation for it
+ which would probably be even more ridiculously long. (But we
+ can make --ignore-skip-worktree-bits a deprecated alias for
+ --no-restrict.)
+
+ * If a config option is added (sparse.scope?) what should the values and
+ description be? "sparse" (behavior A), "worktree-sparse-history-dense"
+ (behavior B), "dense" (behavior C)? There's a risk of confusion,
+ because even for Behaviors A and B we want some commands to be
+ full-tree and others to operate sparsely, so the wording may need to be
+ more tied to the usecases and somehow explain that. Also, right now,
+ the primary difference we are focusing is just the history-querying
+ commands (log/diff/grep). Previous config suggestion here: [13]
+
+ * Is `--no-expand` a good alias for ls-files's `--sparse` option?
+ (`--sparse` does not map to either `--scope=sparse` or `--scope=all`,
+ because in non-cone mode it does nothing and in cone-mode it shows the
+ sparse directory entries which are technically outside the sparse
+ specification)
+
+ * Under Behavior A:
+ * Does ls-files' `--no-expand` override the default `--scope=all`, or
+ does it need an extra flag?
+ * Does ls-files' `-t` option imply `--scope=all`?
+ * Does update-index's `--[no-]skip-worktree` option imply `--scope=all`?
+
+ * sparse-checkout: once behavior A is fully implemented, should we take
+ an interim measure to ease people into switching the default? Namely,
+ if folks are not already in a sparse checkout, then require
+ `sparse-checkout init/set` to take a
+ `--set-scope=(sparse|worktree-sparse-history-dense|dense)` flag (which
+ would set sparse.scope according to the setting given), and throw an
+ error if the flag is not provided? That error would be a great place
+ to warn folks that the default may change in the future, and get them
+ used to specifying what they want so that the eventual default switch
+ is seamless for them.
+
+
+=== Implementation Goals/Plans ===
+
+ * Get buy-in on this document in general.
+
+ * Figure out answers to the 'Implementation Questions' sections (above)
+
+ * Fix bugs in the 'Known bugs' section (below)
+
+ * Provide some kind of method for backfilling the blobs within the sparse
+ specification in a partial clone
+
+ [Below here is kind of spitballing since the first two haven't been resolved]
+
+ * update-index: flip the default to --no-ignore-skip-worktree-entries,
+ nuke this stupid "Oh, there's a bug? Let me add a flag to let users
+ request that they not trigger this bug." flag
+
+ * Flags & Config
+ * Make `--sparse` in add/rm/mv a deprecated alias for `--scope=all`
+ * Make `--ignore-skip-worktree-bits` in checkout-index/checkout/restore
+ a deprecated aliases for `--scope=all`
+ * Create config option (sparse.scope?), tie it to the "Cliff notes"
+ overview
+
+ * Add --scope=sparse (and --scope=all) flag to each of the history querying
+ commands. IMPORTANT: make sure diff machinery changes don't mess with
+ format-patch, fast-export, etc.
+
+=== Known bugs ===
+
+This list used to be a lot longer (see e.g. [1,2,3,4,5,6,7,8,9]), but we've
+been working on it.
+
+0. Behavior A is not well supported in Git. (Behavior B didn't used to
+ be either, but was the easier of the two to implement.)
+
+1. am and apply:
+
+ apply, without `--index` or `--cached`, relies on files being present
+ in the working copy, and also writes to them unconditionally. As
+ such, it should first check for the files' presence, and if found to
+ be SKIP_WORKTREE, then clear the bit and vivify the paths, then do
+ its work. Currently, it just throws an error.
+
+ apply, with either `--cached` or `--index`, will not preserve the
+ SKIP_WORKTREE bit. This is fine if the file has conflicts, but
+ otherwise SKIP_WORKTREE bits should be preserved for --cached and
+ probably also for --index.
+
+ am, if there are no conflicts, will vivify files and fail to preserve
+ the SKIP_WORKTREE bit. If there are conflicts and `-3` is not
+ specified, it will vivify files and then complain the patch doesn't
+ apply. If there are conflicts and `-3` is specified, it will vivify
+ files and then complain that those vivified files would be
+ overwritten by merge.
+
+2. reset --hard:
+
+ reset --hard provides confusing error message (works correctly, but
+ misleads the user into believing it didn't):
+
+ $ touch addme
+ $ git add addme
+ $ git ls-files -t
+ H addme
+ H tracked
+ S tracked-but-maybe-skipped
+ $ git reset --hard # usually works great
+ error: Path 'addme' not uptodate; will not remove from working tree.
+ HEAD is now at bdbbb6f third
+ $ git ls-files -t
+ H tracked
+ S tracked-but-maybe-skipped
+ $ ls -1
+ tracked
+
+ `git reset --hard` DID remove addme from the index and the working tree, contrary
+ to the error message, but in line with how reset --hard should behave.
+
+3. read-tree
+
+ `read-tree` doesn't apply the 'SKIP_WORKTREE' bit to *any* of the
+ entries it reads into the index, resulting in all your files suddenly
+ appearing to be "deleted".
+
+4. Checkout, restore:
+
+ These command do not handle path & revision arguments appropriately:
+
+ $ ls
+ tracked
+ $ git ls-files -t
+ H tracked
+ S tracked-but-maybe-skipped
+ $ git status --porcelain
+ $ git checkout -- '*skipped'
+ error: pathspec '*skipped' did not match any file(s) known to git
+ $ git ls-files -- '*skipped'
+ tracked-but-maybe-skipped
+ $ git checkout HEAD -- '*skipped'
+ error: pathspec '*skipped' did not match any file(s) known to git
+ $ git ls-tree HEAD | grep skipped
+ 100644 blob 276f5a64354b791b13840f02047738c77ad0584f tracked-but-maybe-skipped
+ $ git status --porcelain
+ $ git checkout HEAD~1 -- '*skipped'
+ $ git ls-files -t
+ H tracked
+ H tracked-but-maybe-skipped
+ $ git status --porcelain
+ M tracked-but-maybe-skipped
+ $ git checkout HEAD -- '*skipped'
+ $ git status --porcelain
+ $
+
+ Note that checkout without a revision (or restore --staged) fails to
+ find a file to restore from the index, even though ls-files shows
+ such a file certainly exists.
+
+ Similar issues occur with HEAD (--source=HEAD in restore's case),
+ but suddenly works when HEAD~1 is specified. And then after that it
+ will work with HEAD specified, even though it didn't before.
+
+ Directories are also an issue:
+
+ $ git sparse-checkout set nomatches
+ $ git status
+ On branch main
+ You are in a sparse checkout with 0% of tracked files present.
+
+ nothing to commit, working tree clean
+ $ git checkout .
+ error: pathspec '.' did not match any file(s) known to git
+ $ git checkout HEAD~1 .
+ Updated 1 path from 58916d9
+ $ git ls-files -t
+ S tracked
+ H tracked-but-maybe-skipped
+
+5. checkout and restore --staged, continued:
+
+ These commands do not correctly scope operations to the sparse
+ specification, and make it worse by not setting important SKIP_WORKTREE
+ bits:
+
+ $ git restore --source OLDREV --staged outside-sparse-cone/
+ $ git status --porcelain
+ MD outside-sparse-cone/file1
+ MD outside-sparse-cone/file2
+ MD outside-sparse-cone/file3
+
+ We can add a --scope=all mode to `git restore` to let it operate outside
+ the sparse specification, but then it will be important to set the
+ SKIP_WORKTREE bits appropriately.
+
+6. Performance issues; see:
+ https://lore.kernel.org/git/CABPp-BEkJQoKZsQGCYioyga_uoDQ6iBeW+FKr8JhyuuTMK1RDw@mail.gmail.com/
+
+
+=== Reference Emails ===
+
+Emails that detail various bugs we've had in sparse-checkout:
+
+[1] (Original descriptions of behavior A & behavior B)
+ https://lore.kernel.org/git/CABPp-BGJ_Nvi5TmgriD9Bh6eNXE2EDq2f8e8QKXAeYG3BxZafA@mail.gmail.com/
+[2] (Fix stash applications in sparse checkouts; bugs from behavioral differences)
+ https://lore.kernel.org/git/ccfedc7140dbf63ba26a15f93bd3885180b26517.1606861519.git.gitgitgadget@gmail.com/
+[3] (Present-despite-skipped entries)
+ https://lore.kernel.org/git/11d46a399d26c913787b704d2b7169cafc28d639.1642175983.git.gitgitgadget@gmail.com/
+[4] (Clone --no-checkout interaction)
+ https://lore.kernel.org/git/pull.801.v2.git.git.1591324899170.gitgitgadget@gmail.com/ (clone --no-checkout)
+[5] (The need for update_sparsity() and avoiding `read-tree -mu HEAD`)
+ https://lore.kernel.org/git/3a1f084641eb47515b5a41ed4409a36128913309.1585270142.git.gitgitgadget@gmail.com/
+[6] (SKIP_WORKTREE is advisory, not mandatory)
+ https://lore.kernel.org/git/844306c3e86ef67591cc086decb2b760e7d710a3.1585270142.git.gitgitgadget@gmail.com/
+[7] (`worktree add` should copy sparsity settings from current worktree)
+ https://lore.kernel.org/git/c51cb3714e7b1d2f8c9370fe87eca9984ff4859f.1644269584.git.gitgitgadget@gmail.com/
+[8] (Avoid negative surprises in add, rm, and mv)
+ https://lore.kernel.org/git/cover.1617914011.git.matheus.bernardino@usp.br/
+ https://lore.kernel.org/git/pull.1018.v4.git.1632497954.gitgitgadget@gmail.com/
+[9] (Move from out-of-cone to in-cone)
+ https://lore.kernel.org/git/20220630023737.473690-6-shaoxuan.yuan02@gmail.com/
+ https://lore.kernel.org/git/20220630023737.473690-4-shaoxuan.yuan02@gmail.com/
+[10] (Unnecessarily downloading objects outside sparse specification)
+ https://lore.kernel.org/git/CAOLTT8QfwOi9yx_qZZgyGa8iL8kHWutEED7ok_jxwTcYT_hf9Q@mail.gmail.com/
+
+[11] (Stolee's comments on high-level usecases)
+ https://lore.kernel.org/git/1a1e33f6-3514-9afc-0a28-5a6b85bd8014@gmail.com/
+
+[12] Others commenting on eventually switching default to behavior A:
+ * https://lore.kernel.org/git/xmqqh719pcoo.fsf@gitster.g/
+ * https://lore.kernel.org/git/xmqqzgeqw0sy.fsf@gitster.g/
+ * https://lore.kernel.org/git/a86af661-cf58-a4e5-0214-a67d3a794d7e@github.com/
+
+[13] Previous config name suggestion and description
+ * https://lore.kernel.org/git/CABPp-BE6zW0nJSStcVU=_DoDBnPgLqOR8pkTXK3dW11=T01OhA@mail.gmail.com/
+
+[14] Tangential issue: switch to cone mode as default sparse specification mechanism:
+ https://lore.kernel.org/git/a1b68fd6126eb341ef3637bb93fedad4309b36d0.1650594746.git.gitgitgadget@gmail.com/
+
+[15] Lengthy email on grep behavior, covering what should be searched:
+ * https://lore.kernel.org/git/CABPp-BGVO3QdbfE84uF_3QDF0-y2iHHh6G5FAFzNRfeRitkuHw@mail.gmail.com/
+
+[16] Email explaining sparsity patterns vs. SKIP_WORKTREE and history operations,
+ search for the parenthetical comment starting "We do not check".
+ https://lore.kernel.org/git/CABPp-BFsCPPNOZ92JQRJeGyNd0e-TCW-LcLyr0i_+VSQJP+GCg@mail.gmail.com/
+
+[17] https://lore.kernel.org/git/20220207190320.2960362-1-jonathantanmy@google.com/
diff --git a/Documentation/technical/unit-tests.txt b/Documentation/technical/unit-tests.txt
new file mode 100644
index 0000000..206037f
--- /dev/null
+++ b/Documentation/technical/unit-tests.txt
@@ -0,0 +1,240 @@
+= Unit Testing
+
+In our current testing environment, we spend a significant amount of effort
+crafting end-to-end tests for error conditions that could easily be captured by
+unit tests (or we simply forgo some hard-to-setup and rare error conditions).
+Unit tests additionally provide stability to the codebase and can simplify
+debugging through isolation. Writing unit tests in pure C, rather than with our
+current shell/test-tool helper setup, simplifies test setup, simplifies passing
+data around (no shell-isms required), and reduces testing runtime by not
+spawning a separate process for every test invocation.
+
+We believe that a large body of unit tests, living alongside the existing test
+suite, will improve code quality for the Git project.
+
+== Definitions
+
+For the purposes of this document, we'll use *test framework* to refer to
+projects that support writing test cases and running tests within the context
+of a single executable. *Test harness* will refer to projects that manage
+running multiple executables (each of which may contain multiple test cases) and
+aggregating their results.
+
+In reality, these terms are not strictly defined, and many of the projects
+discussed below contain features from both categories.
+
+For now, we will evaluate projects solely on their framework features. Since we
+are relying on having TAP output (see below), we can assume that any framework
+can be made to work with a harness that we can choose later.
+
+
+== Summary
+
+We believe the best way forward is to implement a custom TAP framework for the
+Git project. We use a version of the framework originally proposed in
+https://lore.kernel.org/git/c902a166-98ce-afba-93f2-ea6027557176@gmail.com/[1].
+
+See the <<framework-selection,Framework Selection>> section below for the
+rationale behind this decision.
+
+
+== Choosing a test harness
+
+During upstream discussion, it was occasionally noted that `prove` provides many
+convenient features, such as scheduling slower tests first, or re-running
+previously failed tests.
+
+While we already support the use of `prove` as a test harness for the shell
+tests, it is not strictly required. The t/Makefile allows running shell tests
+directly (though with interleaved output if parallelism is enabled). Git
+developers who wish to use `prove` as a more advanced harness can do so by
+setting DEFAULT_TEST_TARGET=prove in their config.mak.
+
+We will follow a similar approach for unit tests: by default the test
+executables will be run directly from the t/Makefile, but `prove` can be
+configured with DEFAULT_UNIT_TEST_TARGET=prove.
+
+
+[[framework-selection]]
+== Framework selection
+
+There are a variety of features we can use to rank the candidate frameworks, and
+those features have different priorities:
+
+* Critical features: we probably won't consider a framework without these
+** Can we legally / easily use the project?
+*** <<license,License>>
+*** <<vendorable-or-ubiquitous,Vendorable or ubiquitous>>
+*** <<maintainable-extensible,Maintainable / extensible>>
+*** <<major-platform-support,Major platform support>>
+** Does the project support our bare-minimum needs?
+*** <<tap-support,TAP support>>
+*** <<diagnostic-output,Diagnostic output>>
+*** <<runtime-skippable-tests,Runtime-skippable tests>>
+* Nice-to-have features:
+** <<parallel-execution,Parallel execution>>
+** <<mock-support,Mock support>>
+** <<signal-error-handling,Signal & error-handling>>
+* Tie-breaker stats
+** <<project-kloc,Project KLOC>>
+** <<adoption,Adoption>>
+
+[[license]]
+=== License
+
+We must be able to legally use the framework in connection with Git. As Git is
+licensed only under GPLv2, we must eliminate any LGPLv3, GPLv3, or Apache 2.0
+projects.
+
+[[vendorable-or-ubiquitous]]
+=== Vendorable or ubiquitous
+
+We want to avoid forcing Git developers to install new tools just to run unit
+tests. Any prospective frameworks and harnesses must either be vendorable
+(meaning, we can copy their source directly into Git's repository), or so
+ubiquitous that it is reasonable to expect that most developers will have the
+tools installed already.
+
+[[maintainable-extensible]]
+=== Maintainable / extensible
+
+It is unlikely that any pre-existing project perfectly fits our needs, so any
+project we select will need to be actively maintained and open to accepting
+changes. Alternatively, assuming we are vendoring the source into our repo, it
+must be simple enough that Git developers can feel comfortable making changes as
+needed to our version.
+
+In the comparison table below, "True" means that the framework seems to have
+active developers, that it is simple enough that Git developers can make changes
+to it, and that the project seems open to accepting external contributions (or
+that it is vendorable). "Partial" means that at least one of the above
+conditions holds.
+
+[[major-platform-support]]
+=== Major platform support
+
+At a bare minimum, unit-testing must work on Linux, MacOS, and Windows.
+
+In the comparison table below, "True" means that it works on all three major
+platforms with no issues. "Partial" means that there may be annoyances on one or
+more platforms, but it is still usable in principle.
+
+[[tap-support]]
+=== TAP support
+
+The https://testanything.org/[Test Anything Protocol] is a text-based interface
+that allows tests to communicate with a test harness. It is already used by
+Git's integration test suite. Supporting TAP output is a mandatory feature for
+any prospective test framework.
+
+In the comparison table below, "True" means this is natively supported.
+"Partial" means TAP output must be generated by post-processing the native
+output.
+
+Frameworks that do not have at least Partial support will not be evaluated
+further.
+
+[[diagnostic-output]]
+=== Diagnostic output
+
+When a test case fails, the framework must generate enough diagnostic output to
+help developers find the appropriate test case in source code in order to debug
+the failure.
+
+[[runtime-skippable-tests]]
+=== Runtime-skippable tests
+
+Test authors may wish to skip certain test cases based on runtime circumstances,
+so the framework should support this.
+
+[[parallel-execution]]
+=== Parallel execution
+
+Ideally, we will build up a significant collection of unit test cases, most
+likely split across multiple executables. It will be necessary to run these
+tests in parallel to enable fast develop-test-debug cycles.
+
+In the comparison table below, "True" means that individual test cases within a
+single test executable can be run in parallel. We assume that executable-level
+parallelism can be handled by the test harness.
+
+[[mock-support]]
+=== Mock support
+
+Unit test authors may wish to test code that interacts with objects that may be
+inconvenient to handle in a test (e.g. interacting with a network service).
+Mocking allows test authors to provide a fake implementation of these objects
+for more convenient tests.
+
+[[signal-error-handling]]
+=== Signal & error handling
+
+The test framework should fail gracefully when test cases are themselves buggy
+or when they are interrupted by signals during runtime.
+
+[[project-kloc]]
+=== Project KLOC
+
+The size of the project, in thousands of lines of code as measured by
+https://dwheeler.com/sloccount/[sloccount] (rounded up to the next multiple of
+1,000). As a tie-breaker, we probably prefer a project with fewer LOC.
+
+[[adoption]]
+=== Adoption
+
+As a tie-breaker, we prefer a more widely-used project. We use the number of
+GitHub / GitLab stars to estimate this.
+
+
+=== Comparison
+
+:true: [lime-background]#True#
+:false: [red-background]#False#
+:partial: [yellow-background]#Partial#
+
+:gpl: [lime-background]#GPL v2#
+:isc: [lime-background]#ISC#
+:mit: [lime-background]#MIT#
+:expat: [lime-background]#Expat#
+:lgpl: [lime-background]#LGPL v2.1#
+
+:custom-impl: https://lore.kernel.org/git/c902a166-98ce-afba-93f2-ea6027557176@gmail.com/[Custom Git impl.]
+:greatest: https://github.com/silentbicycle/greatest[Greatest]
+:criterion: https://github.com/Snaipe/Criterion[Criterion]
+:c-tap: https://github.com/rra/c-tap-harness/[C TAP]
+:check: https://libcheck.github.io/check/[Check]
+
+[format="csv",options="header",width="33%",subs="specialcharacters,attributes,quotes,macros"]
+|=====
+Framework,"<<license,License>>","<<vendorable-or-ubiquitous,Vendorable or ubiquitous>>","<<maintainable-extensible,Maintainable / extensible>>","<<major-platform-support,Major platform support>>","<<tap-support,TAP support>>","<<diagnostic-output,Diagnostic output>>","<<runtime--skippable-tests,Runtime- skippable tests>>","<<parallel-execution,Parallel execution>>","<<mock-support,Mock support>>","<<signal-error-handling,Signal & error handling>>","<<project-kloc,Project KLOC>>","<<adoption,Adoption>>"
+{custom-impl},{gpl},{true},{true},{true},{true},{true},{true},{false},{false},{false},1,0
+{greatest},{isc},{true},{partial},{true},{partial},{true},{true},{false},{false},{false},3,1400
+{criterion},{mit},{false},{partial},{true},{true},{true},{true},{true},{false},{true},19,1800
+{c-tap},{expat},{true},{partial},{partial},{true},{false},{true},{false},{false},{false},4,33
+{check},{lgpl},{false},{partial},{true},{true},{true},{false},{false},{false},{true},17,973
+|=====
+
+=== Additional framework candidates
+
+Several suggested frameworks have been eliminated from consideration:
+
+* Incompatible licenses:
+** https://github.com/zorgnax/libtap[libtap] (LGPL v3)
+** https://cmocka.org/[cmocka] (Apache 2.0)
+* Missing source: https://www.kindahl.net/mytap/doc/index.html[MyTap]
+* No TAP support:
+** https://nemequ.github.io/munit/[µnit]
+** https://github.com/google/cmockery[cmockery]
+** https://github.com/lpabon/cmockery2[cmockery2]
+** https://github.com/ThrowTheSwitch/Unity[Unity]
+** https://github.com/siu/minunit[minunit]
+** https://cunit.sourceforge.net/[CUnit]
+
+
+== Milestones
+
+* Add useful tests of library-like code
+* Integrate with
+ https://lore.kernel.org/git/20230502211454.1673000-1-calvinwan@google.com/[stdlib
+ work]
+* Run alongside regular `make test` target
diff --git a/Documentation/trace2-target-values.txt b/Documentation/trace2-target-values.txt
index 3985b6d..06f1953 100644
--- a/Documentation/trace2-target-values.txt
+++ b/Documentation/trace2-target-values.txt
@@ -5,7 +5,7 @@
* `<absolute-pathname>` - Writes to the file in append mode. If the target
already exists and is a directory, the traces will be written to files (one
per process) underneath the given directory.
-* `af_unix:[<socket_type>:]<absolute-pathname>` - Write to a
+* `af_unix:[<socket-type>:]<absolute-pathname>` - Write to a
Unix DomainSocket (on platforms that support them). Socket
type can be either `stream` or `dgram`; if omitted Git will
try both.
diff --git a/Documentation/urls-remotes.txt b/Documentation/urls-remotes.txt
index 86d0008..bf17012 100644
--- a/Documentation/urls-remotes.txt
+++ b/Documentation/urls-remotes.txt
@@ -33,7 +33,9 @@ config file would appear like this:
------------
The `<pushurl>` is used for pushes only. It is optional and defaults
-to `<URL>`.
+to `<URL>`. Pushing to a remote affects all defined pushurls or all
+defined urls if no pushurls are defined. Fetch, however, will only
+fetch from the first defined url if multiple urls are defined.
Named file in `$GIT_DIR/remotes`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -46,7 +48,7 @@ provide a refspec on the command line. This file should have the
following format:
------------
- URL: one of the above URL format
+ URL: one of the above URL formats
Push: <refspec>
Pull: <refspec>
diff --git a/Documentation/urls.txt b/Documentation/urls.txt
index 1c229d7..7cec85a 100644
--- a/Documentation/urls.txt
+++ b/Documentation/urls.txt
@@ -6,23 +6,23 @@ address of the remote server, and the path to the repository.
Depending on the transport protocol, some of this information may be
absent.
-Git supports ssh, git, http, and https protocols (in addition, ftp,
+Git supports ssh, git, http, and https protocols (in addition, ftp
and ftps can be used for fetching, but this is inefficient and
-deprecated; do not use it).
+deprecated; do not use them).
The native transport (i.e. git:// URL) does no authentication and
should be used with caution on unsecured networks.
The following syntaxes may be used with them:
-- ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/path/to/repo.git/
-- git://host.xz{startsb}:port{endsb}/path/to/repo.git/
-- http{startsb}s{endsb}://host.xz{startsb}:port{endsb}/path/to/repo.git/
-- ftp{startsb}s{endsb}://host.xz{startsb}:port{endsb}/path/to/repo.git/
+- ++ssh://++{startsb}__<user>__++@++{endsb}__<host>__{startsb}++:++__<port>__{endsb}++/++__<path-to-git-repo>__
+- ++git://++__<host>__{startsb}:__<port>__{endsb}++/++__<path-to-git-repo>__
+- ++http++{startsb}++s++{endsb}++://++__<host>__{startsb}++:++__<port>__{endsb}++/++__<path-to-git-repo>__
+- ++ftp++{startsb}++s++{endsb}++://++__<host>__{startsb}++:++__<port>__{endsb}++/++__<path-to-git-repo>__
An alternative scp-like syntax may also be used with the ssh protocol:
-- {startsb}user@{endsb}host.xz:path/to/repo.git/
+- {startsb}__<user>__++@++{endsb}__<host>__++:/++__<path-to-git-repo>__
This syntax is only recognized if there are no slashes before the
first colon. This helps differentiate a local path that contains a
@@ -30,40 +30,40 @@ colon. For example the local path `foo:bar` could be specified as an
absolute path or `./foo:bar` to avoid being misinterpreted as an ssh
url.
-The ssh and git protocols additionally support ~username expansion:
+The ssh and git protocols additionally support ++~++__<username>__ expansion:
-- ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/~{startsb}user{endsb}/path/to/repo.git/
-- git://host.xz{startsb}:port{endsb}/~{startsb}user{endsb}/path/to/repo.git/
-- {startsb}user@{endsb}host.xz:/~{startsb}user{endsb}/path/to/repo.git/
+- ++ssh://++{startsb}__<user>__++@++{endsb}__<host>__{startsb}++:++__<port>__{endsb}++/~++__<user>__++/++__<path-to-git-repo>__
+- ++git://++__<host>__{startsb}++:++__<port>__{endsb}++/~++__<user>__++/++__<path-to-git-repo>__
+- {startsb}__<user>__++@++{endsb}__<host>__++:~++__<user>__++/++__<path-to-git-repo>__
For local repositories, also supported by Git natively, the following
syntaxes may be used:
-- /path/to/repo.git/
-- \file:///path/to/repo.git/
+- `/path/to/repo.git/`
+- ++file:///path/to/repo.git/++
ifndef::git-clone[]
These two syntaxes are mostly equivalent, except when cloning, when
-the former implies --local option. See linkgit:git-clone[1] for
+the former implies `--local` option. See linkgit:git-clone[1] for
details.
endif::git-clone[]
ifdef::git-clone[]
These two syntaxes are mostly equivalent, except the former implies
---local option.
+`--local` option.
endif::git-clone[]
-'git clone', 'git fetch' and 'git pull', but not 'git push', will also
+`git clone`, `git fetch` and `git pull`, but not `git push`, will also
accept a suitable bundle file. See linkgit:git-bundle[1].
When Git doesn't know how to handle a certain transport protocol, it
-attempts to use the 'remote-<transport>' remote helper, if one
+attempts to use the `remote-`{empty}__<transport>__ remote helper, if one
exists. To explicitly request a remote helper, the following syntax
may be used:
-- <transport>::<address>
+- _<transport>_::__<address>__
-where <address> may be a path, a server and path, or an arbitrary
+where _<address>_ may be a path, a server and path, or an arbitrary
URL-like string recognized by the specific remote helper being
invoked. See linkgit:gitremote-helpers[7] for details.
@@ -72,10 +72,11 @@ you want to use a different format for them (such that the URLs you
use will be rewritten into URLs that work), you can create a
configuration section of the form:
-------------
- [url "<actual url base>"]
- insteadOf = <other url base>
-------------
+[verse]
+--
+ [url "__<actual-url-base>__"]
+ insteadOf = _<other-url-base>_
+--
For example, with this:
@@ -91,10 +92,11 @@ rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".
If you want to rewrite URLs for push only, you can create a
configuration section of the form:
-------------
- [url "<actual url base>"]
- pushInsteadOf = <other url base>
-------------
+[verse]
+--
+ [url "__<actual-url-base>__"]
+ pushInsteadOf = _<other-url-base>_
+--
For example, with this:
diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
index 865074b..90a4189 100644
--- a/Documentation/user-manual.txt
+++ b/Documentation/user-manual.txt
@@ -1122,7 +1122,7 @@ choosing "Stage Hunk For Commit").
=== Creating good commit messages
Though not required, it's a good idea to begin the commit message
-with a single short (less than 50 character) line summarizing the
+with a single short (no more than 50 characters) line summarizing the
change, followed by a blank line and then a more thorough
description. The text up to the first blank line in a commit
message is treated as the commit title, and that title is used
@@ -1343,6 +1343,33 @@ $ git diff -3 file.txt # diff against stage 3
$ git diff --theirs file.txt # same as the above.
-------------------------------------------------
+When using the 'ort' merge strategy (the default), before updating the working
+tree with the result of the merge, Git writes a ref named AUTO_MERGE
+reflecting the state of the tree it is about to write. Conflicted paths with
+textual conflicts that could not be automatically merged are written to this
+tree with conflict markers, just as in the working tree. AUTO_MERGE can thus be
+used with linkgit:git-diff[1] to show the changes you've made so far to resolve
+conflicts. Using the same example as above, after resolving the conflict we
+get:
+
+-------------------------------------------------
+$ git diff AUTO_MERGE
+diff --git a/file.txt b/file.txt
+index cd10406..8bf5ae7 100644
+--- a/file.txt
++++ b/file.txt
+@@ -1,5 +1 @@
+-<<<<<<< HEAD:file.txt
+-Hello world
+-=======
+-Goodbye
+->>>>>>> 77976da35a11db4580b80ae27e8d65caf5208086:file.txt
++Goodbye world
+-------------------------------------------------
+
+Notice that the diff shows we deleted the conflict markers and both versions of
+the content line, and wrote "Goodbye world" instead.
+
The linkgit:git-log[1] and linkgit:gitk[1] commands also provide special help
for merges:
@@ -3133,7 +3160,7 @@ those "loose" objects.
You can save space and make Git faster by moving these loose objects in
to a "pack file", which stores a group of objects in an efficient
compressed format; the details of how pack files are formatted can be
-found in link:technical/pack-format.html[pack format].
+found in linkgit:gitformat-pack[5].
To put the loose objects into a pack, just run git repack:
@@ -4066,15 +4093,46 @@ that not only specifies their type, but also provides size information
about the data in the object. It's worth noting that the SHA-1 hash
that is used to name the object is the hash of the original data
plus this header, so `sha1sum` 'file' does not match the object name
-for 'file'.
+for 'file' (the earliest versions of Git hashed slightly differently
+but the conclusion is still the same).
+
+The following is a short example that demonstrates how these hashes
+can be generated manually:
+
+Let's assume a small text file with some simple content:
+
+-------------------------------------------------
+$ echo "Hello world" >hello.txt
+-------------------------------------------------
+
+We can now manually generate the hash Git would use for this file:
+
+- The object we want the hash for is of type "blob" and its size is
+ 12 bytes.
+
+- Prepend the object header to the file content and feed this to
+ `sha1sum`:
+
+-------------------------------------------------
+$ { printf "blob 12\0"; cat hello.txt; } | sha1sum
+802992c4220de19a90767f3000a79a31b98d0df7 -
+-------------------------------------------------
+
+This manually constructed hash can be verified using `git hash-object`
+which of course hides the addition of the header:
+
+-------------------------------------------------
+$ git hash-object hello.txt
+802992c4220de19a90767f3000a79a31b98d0df7
+-------------------------------------------------
As a result, the general consistency of an object can always be tested
independently of the contents or the type of the object: all objects can
be validated by verifying that (a) their hashes match the content of the
file and (b) the object successfully inflates to a stream of bytes that
forms a sequence of
-`<ascii type without space> + <space> + <ascii decimal size> +
-<byte\0> + <binary object data>`.
+`<ascii-type-without-space> + <space> + <ascii-decimal-size> +
+<byte\0> + <binary-object-data>`.
The structured objects can further have their structure and
connectivity to other objects verified. This is generally done with
@@ -4096,19 +4154,18 @@ $ git switch --detach e83c5163
----------------------------------------------------
The initial revision lays the foundation for almost everything Git has
-today, but is small enough to read in one sitting.
+today (even though details may differ in a few places), but is small
+enough to read in one sitting.
Note that terminology has changed since that revision. For example, the
README in that revision uses the word "changeset" to describe what we
now call a <<def_commit_object,commit>>.
-Also, we do not call it "cache" any more, but rather "index"; however, the
-file is still called `cache.h`. Remark: Not much reason to change it now,
-especially since there is no good single name for it anyway, because it is
-basically _the_ header file which is included by _all_ of Git's C sources.
+Also, we do not call it "cache" any more, but rather "index"; however,
+the file is still called `read-cache.h`.
If you grasp the ideas in that initial commit, you should check out a
-more recent version and skim `cache.h`, `object.h` and `commit.h`.
+more recent version and skim `read-cache-ll.h`, `object.h` and `commit.h`.
In the early days, Git (in the tradition of UNIX) was a bunch of programs
which were extremely simple, and which you used in scripts, piping the
@@ -4119,11 +4176,11 @@ many of these parts have become builtins, and some of the core has been
and to avoid code duplication.
By now, you know what the index is (and find the corresponding data
-structures in `cache.h`), and that there are just a couple of object types
-(blobs, trees, commits and tags) which inherit their common structure from
-`struct object`, which is their first member (and thus, you can cast e.g.
-`(struct object *)commit` to achieve the _same_ as `&commit->object`, i.e.
-get at the object name and flags).
+structures in `read-cache-ll.h`), and that there are just a couple of
+object types (blobs, trees, commits and tags) which inherit their
+common structure from `struct object`, which is their first member
+(and thus, you can cast e.g. `(struct object *)commit` to achieve the
+_same_ as `&commit->object`, i.e. get at the object name and flags).
Now is a good point to take a break to let this information sink in.
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index e2d51b5..dabd2b5 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -1,7 +1,7 @@
#!/bin/sh
GVF=GIT-VERSION-FILE
-DEF_VER=v2.37.2
+DEF_VER=v2.45.0-rc0
LF='
'
@@ -11,7 +11,7 @@ LF='
if test -f version
then
VN=$(cat version) || VN="$DEF_VER"
-elif test -d ${GIT_DIR:-.git} -o -f .git &&
+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) ;;
diff --git a/INSTALL b/INSTALL
index 4140a3f..2a46d04 100644
--- a/INSTALL
+++ b/INSTALL
@@ -119,12 +119,12 @@ Issues of note:
- A POSIX-compliant shell is required to run some scripts needed
for everyday use (e.g. "bisect", "request-pull").
- - "Perl" version 5.8 or later is needed to use some of the
- features (e.g. preparing a partial commit using "git add -i/-p",
+ - "Perl" version 5.8.1 or later is needed to use some of the
+ features (e.g. sending patches using "git send-email",
interacting with svn repositories with "git svn"). If you can
live without these, use NO_PERL. Note that recent releases of
Redhat/Fedora are reported to ship Perl binary package with some
- core modules stripped away (see http://lwn.net/Articles/477234/),
+ core modules stripped away (see https://lwn.net/Articles/477234/),
so you might need to install additional packages other than Perl
itself, e.g. Digest::MD5, File::Spec, File::Temp, Net::Domain,
Net::SMTP, and Time::HiRes.
@@ -133,18 +133,13 @@ Issues of note:
you are using libcurl older than 7.34.0. Otherwise you can use
NO_OPENSSL without losing git-imap-send.
- By default, git uses OpenSSL for SHA1 but it will use its own
- library (inspired by Mozilla's) with either NO_OPENSSL or
- BLK_SHA1. Also included is a version optimized for PowerPC
- (PPC_SHA1).
-
- "libcurl" library is used for fetching and pushing
repositories over http:// or https://, as well as by
git-imap-send if the curl version is >= 7.34.0. If you do
not need that functionality, use NO_CURL to build without
it.
- Git requires version "7.19.4" or later of "libcurl" to build
+ Git requires version "7.21.3" or later of "libcurl" to build
without NO_CURL. This version requirement may be bumped in
the future.
diff --git a/Makefile b/Makefile
index 04d0fd1..1e31acc 100644
--- a/Makefile
+++ b/Makefile
@@ -4,8 +4,20 @@ all::
# Import tree-wide shared Makefile behavior and libraries
include shared.mak
+# == Makefile defines ==
+#
+# These defines change the behavior of the Makefile itself, but have
+# no impact on what it builds:
+#
# Define V=1 to have a more verbose compile.
#
+# == Portability and optional library defines ==
+#
+# These defines indicate what Git can expect from the OS, what
+# libraries are available etc. Much of this is auto-detected in
+# config.mak.uname, or in configure.ac when using the optional "make
+# configure && ./configure" (see INSTALL).
+#
# Define SHELL_PATH to a POSIX shell if your /bin/sh is broken.
#
# Define SANE_TOOL_PATH to a colon-separated list of paths to prepend
@@ -30,68 +42,8 @@ include shared.mak
#
# Define NO_OPENSSL environment variable if you do not have OpenSSL.
#
-# Define USE_LIBPCRE if you have and want to use libpcre. Various
-# commands such as log and grep offer runtime options to use
-# Perl-compatible regular expressions instead of standard or extended
-# POSIX regular expressions.
-#
-# Only libpcre version 2 is supported. USE_LIBPCRE2 is a synonym for
-# USE_LIBPCRE, support for the old USE_LIBPCRE1 has been removed.
-#
-# Define LIBPCREDIR=/foo/bar if your PCRE header and library files are
-# in /foo/bar/include and /foo/bar/lib directories.
-#
# Define HAVE_ALLOCA_H if you have working alloca(3) defined in that header.
#
-# Define NO_CURL if you do not have libcurl installed. git-http-fetch and
-# git-http-push are not built, and you cannot use http:// and https://
-# transports (neither smart nor dumb).
-#
-# Define CURLDIR=/foo/bar if your curl header and library files are in
-# /foo/bar/include and /foo/bar/lib directories.
-#
-# Define CURL_CONFIG to curl's configuration program that prints information
-# about the library (e.g., its version number). The default is 'curl-config'.
-#
-# Define CURL_LDFLAGS to specify flags that you need to link when using libcurl,
-# if you do not want to rely on the libraries provided by CURL_CONFIG. The
-# default value is a result of `curl-config --libs`. An example value for
-# CURL_LDFLAGS is as follows:
-#
-# CURL_LDFLAGS=-lcurl
-#
-# Define NO_EXPAT if you do not have expat installed. git-http-push is
-# not built, and you cannot push using http:// and https:// transports (dumb).
-#
-# Define EXPATDIR=/foo/bar if your expat header and library files are in
-# /foo/bar/include and /foo/bar/lib directories.
-#
-# Define EXPAT_NEEDS_XMLPARSE_H if you have an old version of expat (e.g.,
-# 1.1 or 1.2) that provides xmlparse.h instead of expat.h.
-#
-# Define NO_GETTEXT if you don't want Git output to be translated.
-# A translated Git requires GNU libintl or another gettext implementation,
-# plus libintl-perl at runtime.
-#
-# Define USE_GETTEXT_SCHEME and set it to 'fallthrough', if you don't trust
-# the installed gettext translation of the shell scripts output.
-#
-# Define HAVE_LIBCHARSET_H if you haven't set NO_GETTEXT and you can't
-# trust the langinfo.h's nl_langinfo(CODESET) function to return the
-# current character set. GNU and Solaris have a nl_langinfo(CODESET),
-# FreeBSD can use either, but MinGW and some others need to use
-# libcharset.h's locale_charset() instead.
-#
-# Define CHARSET_LIB to the library you need to link with in order to
-# use locale_charset() function. On some platforms this needs to set to
-# -lcharset, on others to -liconv .
-#
-# Define LIBC_CONTAINS_LIBINTL if your gettext implementation doesn't
-# need -lintl when linking.
-#
-# Define NO_MSGFMT_EXTENDED_OPTIONS if your implementation of msgfmt
-# doesn't support GNU extensions like --check and --statistics
-#
# Define HAVE_PATHS_H if you have paths.h and want to use the default PATH
# it specifies.
#
@@ -152,40 +104,6 @@ include shared.mak
# and do not want to use Apple's CommonCrypto library. This allows you
# to provide your own OpenSSL library, for example from MacPorts.
#
-# Define BLK_SHA1 environment variable to make use of the bundled
-# optimized C SHA1 routine.
-#
-# Define PPC_SHA1 environment variable when running make to make use of
-# a bundled SHA1 routine optimized for PowerPC.
-#
-# Define DC_SHA1 to unconditionally enable the collision-detecting sha1
-# algorithm. This is slower, but may detect attempted collision attacks.
-# Takes priority over other *_SHA1 knobs.
-#
-# Define DC_SHA1_EXTERNAL in addition to DC_SHA1 if you want to build / link
-# git with the external SHA1 collision-detect library.
-# Without this option, i.e. the default behavior is to build git with its
-# own built-in code (or submodule).
-#
-# Define DC_SHA1_SUBMODULE in addition to DC_SHA1 to use the
-# sha1collisiondetection shipped as a submodule instead of the
-# non-submodule copy in sha1dc/. This is an experimental option used
-# by the git project to migrate to using sha1collisiondetection as a
-# submodule.
-#
-# Define OPENSSL_SHA1 environment variable when running make to link
-# with the SHA1 routine from openssl library.
-#
-# Define SHA1_MAX_BLOCK_SIZE to limit the amount of data that will be hashed
-# in one call to the platform's SHA1_Update(). e.g. APPLE_COMMON_CRYPTO
-# wants 'SHA1_MAX_BLOCK_SIZE=1024L*1024L*1024L' defined.
-#
-# Define BLK_SHA256 to use the built-in SHA-256 routines.
-#
-# Define GCRYPT_SHA256 to use the SHA-256 routines in libgcrypt.
-#
-# Define OPENSSL_SHA256 to use the SHA-256 routines in OpenSSL.
-#
# Define NEEDS_CRYPTO_WITH_SSL if you need -lcrypto when using -lssl (Darwin).
#
# Define NEEDS_SSL_WITH_CRYPTO if you need -lssl when using -lcrypto (Darwin).
@@ -268,7 +186,7 @@ include shared.mak
# Define NO_DEFLATE_BOUND if your zlib does not have deflateBound.
#
# Define NO_NORETURN if using buggy versions of gcc 4.6+ and profile feedback,
-# as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)
+# as the compiler can crash (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)
#
# Define USE_NSEC below if you want git to care about sub-second file mtimes
# and ctimes. Note that you need recent glibc (at least 2.2.4) for this. On
@@ -289,10 +207,6 @@ include shared.mak
# Define NO_ST_BLOCKS_IN_STRUCT_STAT if your platform does not have st_blocks
# field that counts the on-disk footprint in 512-byte blocks.
#
-# Define GNU_ROFF if your target system uses GNU groff. This forces
-# apostrophes to be ASCII so that cut&pasting examples to the shell
-# will work.
-#
# Define USE_ASCIIDOCTOR to use Asciidoctor instead of AsciiDoc to build the
# documentation.
#
@@ -309,6 +223,11 @@ include shared.mak
# distributions that want to use their packaged versions of Perl
# modules, instead of the fallbacks shipped with Git.
#
+# Define NO_GITWEB if you do not want to build or install
+# 'gitweb'. Note that defining NO_PERL currently has the same effect
+# on not installing gitweb, but not on whether it's built in the
+# gitweb/ directory.
+#
# Define PYTHON_PATH to the path of your Python binary (often /usr/bin/python
# but /usr/bin/python2.7 or /usr/bin/python3 on some platforms).
#
@@ -366,6 +285,10 @@ include shared.mak
# Define NO_REGEX if your C library lacks regex support with REG_STARTEND
# feature.
#
+# Define USE_ENHANCED_BASIC_REGULAR_EXPRESSIONS if your C library provides
+# the flag REG_ENHANCED and you'd like to use it to enable enhanced basic
+# regular expressions.
+#
# Define HAVE_DEV_TTY if your system can open /dev/tty to interact with the
# user.
#
@@ -486,6 +409,149 @@ include shared.mak
# to the "<name>" of the corresponding `compat/fsmonitor/fsm-settings-<name>.c`
# that implements the `fsm_os_settings__*()` routines.
#
+# === Optional library: libintl ===
+#
+# Define NO_GETTEXT if you don't want Git output to be translated.
+# A translated Git requires GNU libintl or another gettext implementation,
+# plus libintl-perl at runtime.
+#
+# Define USE_GETTEXT_SCHEME and set it to 'fallthrough', if you don't trust
+# the installed gettext translation of the shell scripts output.
+#
+# Define HAVE_LIBCHARSET_H if you haven't set NO_GETTEXT and you can't
+# trust the langinfo.h's nl_langinfo(CODESET) function to return the
+# current character set. GNU and Solaris have a nl_langinfo(CODESET),
+# FreeBSD can use either, but MinGW and some others need to use
+# libcharset.h's locale_charset() instead.
+#
+# Define CHARSET_LIB to the library you need to link with in order to
+# use locale_charset() function. On some platforms this needs to set to
+# -lcharset, on others to -liconv .
+#
+# Define LIBC_CONTAINS_LIBINTL if your gettext implementation doesn't
+# need -lintl when linking.
+#
+# Define NO_MSGFMT_EXTENDED_OPTIONS if your implementation of msgfmt
+# doesn't support GNU extensions like --check and --statistics
+#
+# === Optional library: libexpat ===
+#
+# Define NO_EXPAT if you do not have expat installed. git-http-push is
+# not built, and you cannot push using http:// and https:// transports (dumb).
+#
+# Define EXPATDIR=/foo/bar if your expat header and library files are in
+# /foo/bar/include and /foo/bar/lib directories.
+#
+# Define EXPAT_NEEDS_XMLPARSE_H if you have an old version of expat (e.g.,
+# 1.1 or 1.2) that provides xmlparse.h instead of expat.h.
+
+# === Optional library: libcurl ===
+#
+# Define NO_CURL if you do not have libcurl installed. git-http-fetch and
+# git-http-push are not built, and you cannot use http:// and https://
+# transports (neither smart nor dumb).
+#
+# Define CURLDIR=/foo/bar if your curl header and library files are in
+# /foo/bar/include and /foo/bar/lib directories.
+#
+# Define CURL_CONFIG to curl's configuration program that prints information
+# about the library (e.g., its version number). The default is 'curl-config'.
+#
+# Define CURL_LDFLAGS to specify flags that you need to link when using libcurl,
+# if you do not want to rely on the libraries provided by CURL_CONFIG. The
+# default value is a result of `curl-config --libs`. An example value for
+# CURL_LDFLAGS is as follows:
+#
+# CURL_LDFLAGS=-lcurl
+#
+# === Optional library: libpcre2 ===
+#
+# Define USE_LIBPCRE if you have and want to use libpcre. Various
+# commands such as log and grep offer runtime options to use
+# Perl-compatible regular expressions instead of standard or extended
+# POSIX regular expressions.
+#
+# Only libpcre version 2 is supported. USE_LIBPCRE2 is a synonym for
+# USE_LIBPCRE, support for the old USE_LIBPCRE1 has been removed.
+#
+# Define LIBPCREDIR=/foo/bar if your PCRE header and library files are
+# in /foo/bar/include and /foo/bar/lib directories.
+#
+# == SHA-1 and SHA-256 defines ==
+#
+# === SHA-1 backend ===
+#
+# ==== Security ====
+#
+# Due to the SHAttered (https://shattered.io) attack vector on SHA-1
+# it's strongly recommended to use the sha1collisiondetection
+# counter-cryptanalysis library for SHA-1 hashing.
+#
+# If you know that you can trust the repository contents, or where
+# potential SHA-1 attacks are otherwise mitigated the other backends
+# listed in "SHA-1 implementations" are faster than
+# sha1collisiondetection.
+#
+# ==== Default SHA-1 backend ====
+#
+# If no *_SHA1 backend is picked, the first supported one listed in
+# "SHA-1 implementations" will be picked.
+#
+# ==== Options common to all SHA-1 implementations ====
+#
+# Define SHA1_MAX_BLOCK_SIZE to limit the amount of data that will be hashed
+# in one call to the platform's SHA1_Update(). e.g. APPLE_COMMON_CRYPTO
+# wants 'SHA1_MAX_BLOCK_SIZE=1024L*1024L*1024L' defined.
+#
+# ==== SHA-1 implementations ====
+#
+# Define OPENSSL_SHA1 to link to the SHA-1 routines from the OpenSSL
+# library.
+#
+# Define BLK_SHA1 to make use of optimized C SHA-1 routines bundled
+# with git (in the block-sha1/ directory).
+#
+# Define APPLE_COMMON_CRYPTO_SHA1 to use Apple's CommonCrypto for
+# SHA-1.
+#
+# If don't enable any of the *_SHA1 settings in this section, Git will
+# default to its built-in sha1collisiondetection library, which is a
+# collision-detecting sha1 This is slower, but may detect attempted
+# collision attacks.
+#
+# ==== Options for the sha1collisiondetection library ====
+#
+# Define DC_SHA1_EXTERNAL if you want to build / link
+# git with the external SHA1 collision-detect library.
+# Without this option, i.e. the default behavior is to build git with its
+# own built-in code (or submodule).
+#
+# Define DC_SHA1_SUBMODULE to use the
+# sha1collisiondetection shipped as a submodule instead of the
+# non-submodule copy in sha1dc/. This is an experimental option used
+# by the git project to migrate to using sha1collisiondetection as a
+# submodule.
+#
+# === SHA-256 backend ===
+#
+# ==== Security ====
+#
+# Unlike SHA-1 the SHA-256 algorithm does not suffer from any known
+# vulnerabilities, so any implementation will do.
+#
+# ==== SHA-256 implementations ====
+#
+# Define OPENSSL_SHA256 to use the SHA-256 routines in OpenSSL.
+#
+# Define NETTLE_SHA256 to use the SHA-256 routines in libnettle.
+#
+# Define GCRYPT_SHA256 to use the SHA-256 routines in libgcrypt.
+#
+# If don't enable any of the *_SHA256 settings in this section, Git
+# will default to its built-in sha256 implementation.
+#
+# == DEVELOPER defines ==
+#
# Define DEVELOPER to enable more compiler warnings. Compiler version
# and family are auto detected, but could be overridden by defining
# COMPILER_FEATURES (see config.mak.dev). You can still set
@@ -525,8 +591,9 @@ GIT-VERSION-FILE: FORCE
# template_dir
# sysconfdir
# can be specified as a relative path some/where/else;
-# this is interpreted as relative to $(prefix) and "git" at
-# runtime figures out where they are based on the path to the executable.
+# this is interpreted as relative to $(prefix) and "git" built with
+# RUNTIME_PREFIX flag will figure out (at runtime) where they are
+# based on the path to the executable.
# Additionally, the following will be treated as relative by "git" if they
# begin with "$(prefix)/":
# mandir
@@ -544,6 +611,7 @@ gitexecdir = libexec/git-core
mergetoolsdir = $(gitexecdir)/mergetools
sharedir = $(prefix)/share
gitwebdir = $(sharedir)/gitweb
+gitwebstaticdir = $(gitwebdir)/static
perllibdir = $(sharedir)/perl5
localedir = $(sharedir)/locale
template_dir = share/git-core/templates
@@ -562,7 +630,7 @@ localedir_relative = $(patsubst $(prefix)/%,%,$(localedir))
htmldir_relative = $(patsubst $(prefix)/%,%,$(htmldir))
perllibdir_relative = $(patsubst $(prefix)/%,%,$(perllibdir))
-export prefix bindir sharedir sysconfdir gitwebdir perllibdir localedir
+export prefix bindir sharedir sysconfdir perllibdir localedir
# Set our default programs
CC = cc
@@ -600,7 +668,9 @@ FUZZ_OBJS =
FUZZ_PROGRAMS =
GIT_OBJS =
LIB_OBJS =
+SCALAR_OBJS =
OBJECTS =
+OTHER_PROGRAMS =
PROGRAM_OBJS =
PROGRAMS =
EXCLUDED_PROGRAMS =
@@ -612,6 +682,9 @@ TEST_BUILTINS_OBJS =
TEST_OBJS =
TEST_PROGRAMS_NEED_X =
THIRD_PARTY_SOURCES =
+UNIT_TEST_PROGRAMS =
+UNIT_TEST_DIR = t/unit-tests
+UNIT_TEST_BIN = $(UNIT_TEST_DIR)/bin
# Having this variable in your environment would break pipelines because
# you cause "cd" to echo its destination to stdout. It can also take
@@ -619,7 +692,6 @@ THIRD_PARTY_SOURCES =
# interactive shell sessions without exporting it.
unexport CDPATH
-SCRIPT_SH += git-bisect.sh
SCRIPT_SH += git-difftool--helper.sh
SCRIPT_SH += git-filter-branch.sh
SCRIPT_SH += git-merge-octopus.sh
@@ -635,7 +707,6 @@ SCRIPT_LIB += git-mergetool--lib
SCRIPT_LIB += git-sh-i18n
SCRIPT_LIB += git-sh-setup
-SCRIPT_PERL += git-add--interactive.perl
SCRIPT_PERL += git-archimport.perl
SCRIPT_PERL += git-cvsexportcommit.perl
SCRIPT_PERL += git-cvsimport.perl
@@ -681,16 +752,22 @@ SCRIPTS = $(SCRIPT_SH_GEN) \
ETAGS_TARGET = TAGS
-FUZZ_OBJS += fuzz-commit-graph.o
-FUZZ_OBJS += fuzz-pack-headers.o
-FUZZ_OBJS += fuzz-pack-idx.o
+# If you add a new fuzzer, please also make sure to run it in
+# ci/run-build-and-minimal-fuzzers.sh so that we make sure it still links and
+# runs in the future.
+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-date.o
+FUZZ_OBJS += oss-fuzz/fuzz-pack-headers.o
+FUZZ_OBJS += oss-fuzz/fuzz-pack-idx.o
.PHONY: fuzz-objs
fuzz-objs: $(FUZZ_OBJS)
# Always build fuzz objects even if not testing, to prevent bit-rot.
all:: $(FUZZ_OBJS)
-FUZZ_PROGRAMS += $(patsubst %.o,%,$(FUZZ_OBJS))
+FUZZ_PROGRAMS += $(patsubst %.o,%,$(filter-out %dummy-cmd-main.o,$(FUZZ_OBJS)))
# Empty...
EXTRA_PROGRAMS =
@@ -714,12 +791,14 @@ PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
TEST_BUILTINS_OBJS += test-advise.o
TEST_BUILTINS_OBJS += test-bitmap.o
TEST_BUILTINS_OBJS += test-bloom.o
+TEST_BUILTINS_OBJS += test-bundle-uri.o
+TEST_BUILTINS_OBJS += test-cache-tree.o
TEST_BUILTINS_OBJS += test-chmtime.o
TEST_BUILTINS_OBJS += test-config.o
TEST_BUILTINS_OBJS += test-crontab.o
TEST_BUILTINS_OBJS += test-csprng.o
-TEST_BUILTINS_OBJS += test-ctype.o
TEST_BUILTINS_OBJS += test-date.o
+TEST_BUILTINS_OBJS += test-delete-gpgsig.o
TEST_BUILTINS_OBJS += test-delta.o
TEST_BUILTINS_OBJS += test-dir-iterator.o
TEST_BUILTINS_OBJS += test-drop-caches.o
@@ -727,8 +806,9 @@ TEST_BUILTINS_OBJS += test-dump-cache-tree.o
TEST_BUILTINS_OBJS += test-dump-fsmonitor.o
TEST_BUILTINS_OBJS += test-dump-split-index.o
TEST_BUILTINS_OBJS += test-dump-untracked-cache.o
+TEST_BUILTINS_OBJS += test-env-helper.o
TEST_BUILTINS_OBJS += test-example-decorate.o
-TEST_BUILTINS_OBJS += test-fast-rebase.o
+TEST_BUILTINS_OBJS += test-find-pack.o
TEST_BUILTINS_OBJS += test-fsmonitor-client.o
TEST_BUILTINS_OBJS += test-genrandom.o
TEST_BUILTINS_OBJS += test-genzeros.o
@@ -737,7 +817,6 @@ TEST_BUILTINS_OBJS += test-hash-speed.o
TEST_BUILTINS_OBJS += test-hash.o
TEST_BUILTINS_OBJS += test-hashmap.o
TEST_BUILTINS_OBJS += test-hexdump.o
-TEST_BUILTINS_OBJS += test-index-version.o
TEST_BUILTINS_OBJS += test-json-writer.o
TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o
TEST_BUILTINS_OBJS += test-match-trees.o
@@ -754,7 +833,6 @@ TEST_BUILTINS_OBJS += test-partial-clone.o
TEST_BUILTINS_OBJS += test-path-utils.o
TEST_BUILTINS_OBJS += test-pcre2-config.o
TEST_BUILTINS_OBJS += test-pkt-line.o
-TEST_BUILTINS_OBJS += test-prio-queue.o
TEST_BUILTINS_OBJS += test-proc-receive.o
TEST_BUILTINS_OBJS += test-progress.o
TEST_BUILTINS_OBJS += test-reach.o
@@ -764,6 +842,7 @@ TEST_BUILTINS_OBJS += test-read-midx.o
TEST_BUILTINS_OBJS += test-ref-store.o
TEST_BUILTINS_OBJS += test-reftable.o
TEST_BUILTINS_OBJS += test-regex.o
+TEST_BUILTINS_OBJS += test-rot13-filter.o
TEST_BUILTINS_OBJS += test-repository.o
TEST_BUILTINS_OBJS += test-revision-walking.o
TEST_BUILTINS_OBJS += test-run-command.o
@@ -777,8 +856,10 @@ TEST_BUILTINS_OBJS += test-strcmp-offset.o
TEST_BUILTINS_OBJS += test-string-list.o
TEST_BUILTINS_OBJS += test-submodule-config.o
TEST_BUILTINS_OBJS += test-submodule-nested-repo-config.o
+TEST_BUILTINS_OBJS += test-submodule.o
TEST_BUILTINS_OBJS += test-subprocess.o
TEST_BUILTINS_OBJS += test-trace2.o
+TEST_BUILTINS_OBJS += test-truncate.o
TEST_BUILTINS_OBJS += test-urlmatch-normalization.o
TEST_BUILTINS_OBJS += test-userdiff.o
TEST_BUILTINS_OBJS += test-wildmatch.o
@@ -809,13 +890,16 @@ BUILT_INS += git-show$X
BUILT_INS += git-stage$X
BUILT_INS += git-status$X
BUILT_INS += git-switch$X
+BUILT_INS += git-version$X
BUILT_INS += git-whatchanged$X
# what 'all' will build but not install in gitexecdir
-OTHER_PROGRAMS = git$X
+OTHER_PROGRAMS += git$X
+OTHER_PROGRAMS += scalar$X
# what test wrappers are needed and 'install' will install, in bindir
BINDIR_PROGRAMS_NEED_X += git
+BINDIR_PROGRAMS_NEED_X += scalar
BINDIR_PROGRAMS_NEED_X += git-receive-pack
BINDIR_PROGRAMS_NEED_X += git-shell
BINDIR_PROGRAMS_NEED_X += git-upload-archive
@@ -898,6 +982,7 @@ LIB_OBJS += blob.o
LIB_OBJS += bloom.o
LIB_OBJS += branch.o
LIB_OBJS += bulk-checkin.o
+LIB_OBJS += bundle-uri.o
LIB_OBJS += bundle.o
LIB_OBJS += cache-tree.o
LIB_OBJS += cbtree.o
@@ -910,6 +995,7 @@ LIB_OBJS += combine-diff.o
LIB_OBJS += commit-graph.o
LIB_OBJS += commit-reach.o
LIB_OBJS += commit.o
+LIB_OBJS += compat/nonblock.o
LIB_OBJS += compat/obstack.o
LIB_OBJS += compat/terminal.o
LIB_OBJS += compat/zlib-uncompress2.o
@@ -924,6 +1010,7 @@ LIB_OBJS += ctype.o
LIB_OBJS += date.o
LIB_OBJS += decorate.o
LIB_OBJS += delta-islands.o
+LIB_OBJS += diagnose.o
LIB_OBJS += diff-delta.o
LIB_OBJS += diff-merges.o
LIB_OBJS += diff-lib.o
@@ -953,6 +1040,7 @@ LIB_OBJS += fsmonitor.o
LIB_OBJS += fsmonitor-ipc.o
LIB_OBJS += fsmonitor-settings.o
LIB_OBJS += gettext.o
+LIB_OBJS += git-zlib.o
LIB_OBJS += gpg-interface.o
LIB_OBJS += graph.o
LIB_OBJS += grep.o
@@ -960,6 +1048,7 @@ LIB_OBJS += hash-lookup.o
LIB_OBJS += hashmap.o
LIB_OBJS += help.o
LIB_OBJS += hex.o
+LIB_OBJS += hex-ll.o
LIB_OBJS += hook.o
LIB_OBJS += ident.o
LIB_OBJS += json-writer.o
@@ -971,21 +1060,22 @@ LIB_OBJS += linear-assignment.o
LIB_OBJS += list-objects-filter-options.o
LIB_OBJS += list-objects-filter.o
LIB_OBJS += list-objects.o
-LIB_OBJS += ll-merge.o
LIB_OBJS += lockfile.o
LIB_OBJS += log-tree.o
+LIB_OBJS += loose.o
LIB_OBJS += ls-refs.o
LIB_OBJS += mailinfo.o
LIB_OBJS += mailmap.o
LIB_OBJS += match-trees.o
LIB_OBJS += mem-pool.o
LIB_OBJS += merge-blobs.o
+LIB_OBJS += merge-ll.o
LIB_OBJS += merge-ort.o
LIB_OBJS += merge-ort-wrappers.o
LIB_OBJS += merge-recursive.o
LIB_OBJS += merge.o
-LIB_OBJS += mergesort.o
LIB_OBJS += midx.o
+LIB_OBJS += midx-write.o
LIB_OBJS += name-hash.o
LIB_OBJS += negotiator/default.o
LIB_OBJS += negotiator/noop.o
@@ -994,6 +1084,7 @@ LIB_OBJS += notes-cache.o
LIB_OBJS += notes-merge.o
LIB_OBJS += notes-utils.o
LIB_OBJS += notes.o
+LIB_OBJS += object-file-convert.o
LIB_OBJS += object-file.o
LIB_OBJS += object-name.o
LIB_OBJS += object.o
@@ -1011,6 +1102,7 @@ LIB_OBJS += pack-write.o
LIB_OBJS += packfile.o
LIB_OBJS += pager.o
LIB_OBJS += parallel-checkout.o
+LIB_OBJS += parse.o
LIB_OBJS += parse-options-cb.o
LIB_OBJS += parse-options.o
LIB_OBJS += patch-delta.o
@@ -1039,6 +1131,7 @@ LIB_OBJS += reflog.o
LIB_OBJS += refs.o
LIB_OBJS += refs/debug.o
LIB_OBJS += refs/files-backend.o
+LIB_OBJS += refs/reftable-backend.o
LIB_OBJS += refs/iterator.o
LIB_OBJS += refs/packed-backend.o
LIB_OBJS += refs/ref-cache.o
@@ -1063,6 +1156,7 @@ LIB_OBJS += sigchain.o
LIB_OBJS += sparse-index.o
LIB_OBJS += split-index.o
LIB_OBJS += stable-qsort.o
+LIB_OBJS += statinfo.o
LIB_OBJS += strbuf.o
LIB_OBJS += streaming.o
LIB_OBJS += string-list.o
@@ -1080,6 +1174,7 @@ LIB_OBJS += trace.o
LIB_OBJS += trace2.o
LIB_OBJS += trace2/tr2_cfg.o
LIB_OBJS += trace2/tr2_cmd_name.o
+LIB_OBJS += trace2/tr2_ctr.o
LIB_OBJS += trace2/tr2_dst.o
LIB_OBJS += trace2/tr2_sid.o
LIB_OBJS += trace2/tr2_sysenv.o
@@ -1088,6 +1183,7 @@ LIB_OBJS += trace2/tr2_tgt_event.o
LIB_OBJS += trace2/tr2_tgt_normal.o
LIB_OBJS += trace2/tr2_tgt_perf.o
LIB_OBJS += trace2/tr2_tls.o
+LIB_OBJS += trace2/tr2_tmr.o
LIB_OBJS += trailer.o
LIB_OBJS += transport-helper.o
LIB_OBJS += transport.o
@@ -1112,14 +1208,13 @@ LIB_OBJS += write-or-die.o
LIB_OBJS += ws.o
LIB_OBJS += wt-status.o
LIB_OBJS += xdiff-interface.o
-LIB_OBJS += zlib.o
BUILTIN_OBJS += builtin/add.o
BUILTIN_OBJS += builtin/am.o
BUILTIN_OBJS += builtin/annotate.o
BUILTIN_OBJS += builtin/apply.o
BUILTIN_OBJS += builtin/archive.o
-BUILTIN_OBJS += builtin/bisect--helper.o
+BUILTIN_OBJS += builtin/bisect.o
BUILTIN_OBJS += builtin/blame.o
BUILTIN_OBJS += builtin/branch.o
BUILTIN_OBJS += builtin/bugreport.o
@@ -1145,12 +1240,12 @@ BUILTIN_OBJS += builtin/credential-cache.o
BUILTIN_OBJS += builtin/credential-store.o
BUILTIN_OBJS += builtin/credential.o
BUILTIN_OBJS += builtin/describe.o
+BUILTIN_OBJS += builtin/diagnose.o
BUILTIN_OBJS += builtin/diff-files.o
BUILTIN_OBJS += builtin/diff-index.o
BUILTIN_OBJS += builtin/diff-tree.o
BUILTIN_OBJS += builtin/diff.o
BUILTIN_OBJS += builtin/difftool.o
-BUILTIN_OBJS += builtin/env--helper.o
BUILTIN_OBJS += builtin/fast-export.o
BUILTIN_OBJS += builtin/fast-import.o
BUILTIN_OBJS += builtin/fetch-pack.o
@@ -1206,6 +1301,7 @@ BUILTIN_OBJS += builtin/remote-fd.o
BUILTIN_OBJS += builtin/remote.o
BUILTIN_OBJS += builtin/repack.o
BUILTIN_OBJS += builtin/replace.o
+BUILTIN_OBJS += builtin/replay.o
BUILTIN_OBJS += builtin/rerere.o
BUILTIN_OBJS += builtin/reset.o
BUILTIN_OBJS += builtin/rev-list.o
@@ -1251,6 +1347,15 @@ THIRD_PARTY_SOURCES += compat/regex/%
THIRD_PARTY_SOURCES += sha1collisiondetection/%
THIRD_PARTY_SOURCES += sha1dc/%
+UNIT_TEST_PROGRAMS += t-basic
+UNIT_TEST_PROGRAMS += t-mem-pool
+UNIT_TEST_PROGRAMS += t-strbuf
+UNIT_TEST_PROGRAMS += t-ctype
+UNIT_TEST_PROGRAMS += t-prio-queue
+UNIT_TEST_PROGS = $(patsubst %,$(UNIT_TEST_BIN)/%$X,$(UNIT_TEST_PROGRAMS))
+UNIT_TEST_OBJS = $(patsubst %,$(UNIT_TEST_DIR)/%.o,$(UNIT_TEST_PROGRAMS))
+UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/test-lib.o
+
# xdiff and reftable libs may in turn depend on what is in libgit.a
GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(LIB_FILE)
EXTLIBS =
@@ -1283,11 +1388,53 @@ SP_EXTRA_FLAGS = -Wno-universal-initializer
SANITIZE_LEAK =
SANITIZE_ADDRESS =
-# For the 'coccicheck' target; setting SPATCH_BATCH_SIZE higher will
-# usually result in less CPU usage at the cost of higher peak memory.
-# Setting it to 0 will feed all files in a single spatch invocation.
-SPATCH_FLAGS = --all-includes --patch .
-SPATCH_BATCH_SIZE = 1
+# For the 'coccicheck' target
+SPATCH_INCLUDE_FLAGS = --all-includes
+SPATCH_FLAGS =
+SPATCH_TEST_FLAGS =
+
+# If *.o files are present, have "coccicheck" depend on them, with
+# COMPUTE_HEADER_DEPENDENCIES this will speed up the common-case of
+# only needing to re-generate coccicheck results for the users of a
+# given API if it's changed, and not all files in the project. If
+# COMPUTE_HEADER_DEPENDENCIES=no this will be unset too.
+SPATCH_USE_O_DEPENDENCIES = YesPlease
+
+# Set SPATCH_CONCAT_COCCI to concatenate the contrib/cocci/*.cocci
+# files into a single contrib/cocci/ALL.cocci before running
+# "coccicheck".
+#
+# Pros:
+#
+# - Speeds up a one-shot run of "make coccicheck", as we won't have to
+# parse *.[ch] files N times for the N *.cocci rules
+#
+# Cons:
+#
+# - Will make incremental development of *.cocci slower, as
+# e.g. changing strbuf.cocci will re-run all *.cocci.
+#
+# - Makes error and performance analysis harder, as rules will be
+# applied from a monolithic ALL.cocci, rather than
+# e.g. strbuf.cocci. To work around this either undefine this, or
+# generate a specific patch, e.g. this will always use strbuf.cocci,
+# not ALL.cocci:
+#
+# make contrib/coccinelle/strbuf.cocci.patch
+SPATCH_CONCAT_COCCI = YesPlease
+
+# Rebuild 'coccicheck' if $(SPATCH), its flags etc. change
+TRACK_SPATCH_DEFINES =
+TRACK_SPATCH_DEFINES += $(SPATCH)
+TRACK_SPATCH_DEFINES += $(SPATCH_INCLUDE_FLAGS)
+TRACK_SPATCH_DEFINES += $(SPATCH_FLAGS)
+TRACK_SPATCH_DEFINES += $(SPATCH_TEST_FLAGS)
+GIT-SPATCH-DEFINES: FORCE
+ @FLAGS='$(TRACK_SPATCH_DEFINES)'; \
+ if test x"$$FLAGS" != x"`cat GIT-SPATCH-DEFINES 2>/dev/null`" ; then \
+ echo >&2 " * new spatch flags"; \
+ echo "$$FLAGS" >GIT-SPATCH-DEFINES; \
+ fi
include config.mak.uname
-include config.mak.autogen
@@ -1323,6 +1470,7 @@ BASIC_CFLAGS += -DSHA1DC_FORCE_ALIGNED_ACCESS
endif
ifneq ($(filter leak,$(SANITIZERS)),)
BASIC_CFLAGS += -DSUPPRESS_ANNOTATED_LEAKS
+BASIC_CFLAGS += -O0
SANITIZE_LEAK = YesCompiledWithIt
endif
ifneq ($(filter address,$(SANITIZERS)),)
@@ -1410,24 +1558,23 @@ ifneq (,$(SOCKLEN_T))
endif
ifeq ($(uname_S),Darwin)
- ifndef NO_FINK
- ifeq ($(shell test -d /sw/lib && echo y),y)
+ ifndef NO_FINK
+ ifeq ($(shell test -d /sw/lib && echo y),y)
BASIC_CFLAGS += -I/sw/include
BASIC_LDFLAGS += -L/sw/lib
- endif
- endif
- ifndef NO_DARWIN_PORTS
- ifeq ($(shell test -d /opt/local/lib && echo y),y)
+ endif
+ endif
+ ifndef NO_DARWIN_PORTS
+ ifeq ($(shell test -d /opt/local/lib && echo y),y)
BASIC_CFLAGS += -I/opt/local/include
BASIC_LDFLAGS += -L/opt/local/lib
- endif
- endif
- ifndef NO_APPLE_COMMON_CRYPTO
+ endif
+ endif
+ ifndef NO_APPLE_COMMON_CRYPTO
NO_OPENSSL = YesPlease
APPLE_COMMON_CRYPTO = YesPlease
COMPAT_CFLAGS += -DAPPLE_COMMON_CRYPTO
- endif
- NO_REGEX = YesPlease
+ endif
PTHREAD_LIBS =
endif
@@ -1449,7 +1596,7 @@ endif
ifdef LIBPCREDIR
BASIC_CFLAGS += -I$(LIBPCREDIR)/include
- EXTLIBS += -L$(LIBPCREDIR)/$(lib) $(CC_LD_DYNPATH)$(LIBPCREDIR)/$(lib)
+ EXTLIBS += $(call libpath_template,$(LIBPCREDIR)/$(lib))
endif
ifdef HAVE_ALLOCA_H
@@ -1466,23 +1613,23 @@ ifdef NO_CURL
REMOTE_CURL_NAMES =
EXCLUDED_PROGRAMS += git-http-fetch git-http-push
else
- ifdef CURLDIR
+ ifdef CURLDIR
# Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
CURL_CFLAGS = -I$(CURLDIR)/include
- CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib)
- else
+ CURL_LIBCURL = $(call libpath_template,$(CURLDIR)/$(lib))
+ else
CURL_CFLAGS =
CURL_LIBCURL =
- endif
+ endif
- ifndef CURL_LDFLAGS
+ ifndef CURL_LDFLAGS
CURL_LDFLAGS = $(eval CURL_LDFLAGS := $$(shell $$(CURL_CONFIG) --libs))$(CURL_LDFLAGS)
- endif
+ endif
CURL_LIBCURL += $(CURL_LDFLAGS)
- ifndef CURL_CFLAGS
+ ifndef CURL_CFLAGS
CURL_CFLAGS = $(eval CURL_CFLAGS := $$(shell $$(CURL_CONFIG) --cflags))$(CURL_CFLAGS)
- endif
+ endif
BASIC_CFLAGS += $(CURL_CFLAGS)
REMOTE_CURL_PRIMARY = git-remote-http$X
@@ -1490,49 +1637,49 @@ else
REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
PROGRAM_OBJS += http-fetch.o
PROGRAMS += $(REMOTE_CURL_NAMES)
- ifndef NO_EXPAT
+ ifndef NO_EXPAT
PROGRAM_OBJS += http-push.o
- endif
+ endif
curl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
- ifeq "$(curl_check)" "072200"
+ ifeq "$(curl_check)" "072200"
USE_CURL_FOR_IMAP_SEND = YesPlease
- endif
- ifdef USE_CURL_FOR_IMAP_SEND
+ endif
+ ifdef USE_CURL_FOR_IMAP_SEND
BASIC_CFLAGS += -DUSE_CURL_FOR_IMAP_SEND
IMAP_SEND_BUILDDEPS = http.o
IMAP_SEND_LDFLAGS += $(CURL_LIBCURL)
- endif
- ifndef NO_EXPAT
- ifdef EXPATDIR
+ endif
+ ifndef NO_EXPAT
+ ifdef EXPATDIR
BASIC_CFLAGS += -I$(EXPATDIR)/include
- EXPAT_LIBEXPAT = -L$(EXPATDIR)/$(lib) $(CC_LD_DYNPATH)$(EXPATDIR)/$(lib) -lexpat
- else
+ EXPAT_LIBEXPAT = $(call libpath_template,$(EXPATDIR)/$(lib)) -lexpat
+ else
EXPAT_LIBEXPAT = -lexpat
- endif
- ifdef EXPAT_NEEDS_XMLPARSE_H
+ endif
+ ifdef EXPAT_NEEDS_XMLPARSE_H
BASIC_CFLAGS += -DEXPAT_NEEDS_XMLPARSE_H
- endif
- endif
+ endif
+ endif
endif
IMAP_SEND_LDFLAGS += $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)
ifdef ZLIB_PATH
BASIC_CFLAGS += -I$(ZLIB_PATH)/include
- EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
+ EXTLIBS += $(call libpath_template,$(ZLIB_PATH)/$(lib))
endif
EXTLIBS += -lz
ifndef NO_OPENSSL
OPENSSL_LIBSSL = -lssl
- ifdef OPENSSLDIR
+ ifdef OPENSSLDIR
BASIC_CFLAGS += -I$(OPENSSLDIR)/include
- OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
- else
+ OPENSSL_LINK = $(call libpath_template,$(OPENSSLDIR)/$(lib))
+ else
OPENSSL_LINK =
- endif
- ifdef NEEDS_CRYPTO_WITH_SSL
+ endif
+ ifdef NEEDS_CRYPTO_WITH_SSL
OPENSSL_LIBSSL += -lcrypto
- endif
+ endif
else
BASIC_CFLAGS += -DNO_OPENSSL
OPENSSL_LIBSSL =
@@ -1550,18 +1697,18 @@ ifdef APPLE_COMMON_CRYPTO
endif
endif
ifndef NO_ICONV
- ifdef NEEDS_LIBICONV
- ifdef ICONVDIR
+ ifdef NEEDS_LIBICONV
+ ifdef ICONVDIR
BASIC_CFLAGS += -I$(ICONVDIR)/include
- ICONV_LINK = -L$(ICONVDIR)/$(lib) $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib)
- else
+ ICONV_LINK = $(call libpath_template,$(ICONVDIR)/$(lib))
+ else
ICONV_LINK =
- endif
- ifdef NEEDS_LIBINTL_BEFORE_LIBICONV
+ endif
+ ifdef NEEDS_LIBINTL_BEFORE_LIBICONV
ICONV_LINK += -lintl
- endif
+ endif
EXTLIBS += $(ICONV_LINK) -liconv
- endif
+ endif
endif
ifdef ICONV_OMITS_BOM
BASIC_CFLAGS += -DICONV_OMITS_BOM
@@ -1682,10 +1829,10 @@ ifdef NO_MMAP
COMPAT_CFLAGS += -DNO_MMAP
COMPAT_OBJS += compat/mmap.o
else
- ifdef USE_WIN32_MMAP
+ ifdef USE_WIN32_MMAP
COMPAT_CFLAGS += -DUSE_WIN32_MMAP
COMPAT_OBJS += compat/win32mmap.o
- endif
+ endif
endif
ifdef MMAP_PREVENTS_DELETE
BASIC_CFLAGS += -DMMAP_PREVENTS_DELETE
@@ -1786,11 +1933,15 @@ ifdef NO_POSIX_GOODIES
BASIC_CFLAGS += -DNO_POSIX_GOODIES
endif
-ifdef APPLE_COMMON_CRYPTO
+ifdef APPLE_COMMON_CRYPTO_SHA1
# Apple CommonCrypto requires chunking
SHA1_MAX_BLOCK_SIZE = 1024L*1024L*1024L
endif
+ifdef PPC_SHA1
+$(error the PPC_SHA1 flag has been removed along with the PowerPC-specific SHA-1 implementation.)
+endif
+
ifdef OPENSSL_SHA1
EXTLIBS += $(LIB_4_CRYPTO)
BASIC_CFLAGS += -DSHA1_OPENSSL
@@ -1799,23 +1950,18 @@ ifdef BLK_SHA1
LIB_OBJS += block-sha1/sha1.o
BASIC_CFLAGS += -DSHA1_BLK
else
-ifdef PPC_SHA1
- LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
- BASIC_CFLAGS += -DSHA1_PPC
-else
-ifdef APPLE_COMMON_CRYPTO
+ifdef APPLE_COMMON_CRYPTO_SHA1
COMPAT_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL
BASIC_CFLAGS += -DSHA1_APPLE
else
- DC_SHA1 := YesPlease
BASIC_CFLAGS += -DSHA1_DC
LIB_OBJS += sha1dc_git.o
ifdef DC_SHA1_EXTERNAL
- ifdef DC_SHA1_SUBMODULE
- ifneq ($(DC_SHA1_SUBMODULE),auto)
+ ifdef DC_SHA1_SUBMODULE
+ ifneq ($(DC_SHA1_SUBMODULE),auto)
$(error Only set DC_SHA1_EXTERNAL or DC_SHA1_SUBMODULE, not both)
- endif
- endif
+ endif
+ endif
BASIC_CFLAGS += -DDC_SHA1_EXTERNAL
EXTLIBS += -lsha1detectcoll
else
@@ -1830,18 +1976,21 @@ endif
BASIC_CFLAGS += \
-DSHA1DC_NO_STANDARD_INCLUDES \
-DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 \
- -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"cache.h\"" \
+ -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" \
-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\""
endif
endif
endif
endif
-endif
ifdef OPENSSL_SHA256
EXTLIBS += $(LIB_4_CRYPTO)
BASIC_CFLAGS += -DSHA256_OPENSSL
else
+ifdef NETTLE_SHA256
+ BASIC_CFLAGS += -DSHA256_NETTLE
+ EXTLIBS += -lnettle
+else
ifdef GCRYPT_SHA256
BASIC_CFLAGS += -DSHA256_GCRYPT
EXTLIBS += -lgcrypt
@@ -1850,6 +1999,7 @@ else
BASIC_CFLAGS += -DSHA256_BLK
endif
endif
+endif
ifdef SHA1_MAX_BLOCK_SIZE
LIB_OBJS += compat/sha1-chunked.o
@@ -1911,6 +2061,11 @@ endif
ifdef NO_REGEX
COMPAT_CFLAGS += -Icompat/regex
COMPAT_OBJS += compat/regex/regex.o
+else
+ifdef USE_ENHANCED_BASIC_REGULAR_EXPRESSIONS
+ COMPAT_CFLAGS += -DUSE_ENHANCED_BASIC_REGULAR_EXPRESSIONS
+ COMPAT_OBJS += compat/regcomp_enhanced.o
+endif
endif
ifdef NATIVE_CRLF
BASIC_CFLAGS += -DNATIVE_CRLF
@@ -2020,11 +2175,13 @@ ifdef FSMONITOR_DAEMON_BACKEND
COMPAT_CFLAGS += -DHAVE_FSMONITOR_DAEMON_BACKEND
COMPAT_OBJS += compat/fsmonitor/fsm-listen-$(FSMONITOR_DAEMON_BACKEND).o
COMPAT_OBJS += compat/fsmonitor/fsm-health-$(FSMONITOR_DAEMON_BACKEND).o
+ COMPAT_OBJS += compat/fsmonitor/fsm-ipc-$(FSMONITOR_DAEMON_BACKEND).o
endif
ifdef FSMONITOR_OS_SETTINGS
COMPAT_CFLAGS += -DHAVE_FSMONITOR_OS_SETTINGS
COMPAT_OBJS += compat/fsmonitor/fsm-settings-$(FSMONITOR_OS_SETTINGS).o
+ COMPAT_OBJS += compat/fsmonitor/fsm-path-utils-$(FSMONITOR_OS_SETTINGS).o
endif
ifeq ($(TCLTK_PATH),)
@@ -2089,6 +2246,7 @@ htmldir_relative_SQ = $(subst ','\'',$(htmldir_relative))
prefix_SQ = $(subst ','\'',$(prefix))
perllibdir_relative_SQ = $(subst ','\'',$(perllibdir_relative))
gitwebdir_SQ = $(subst ','\'',$(gitwebdir))
+gitwebstaticdir_SQ = $(subst ','\'',$(gitwebstaticdir))
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
TEST_SHELL_PATH_SQ = $(subst ','\'',$(TEST_SHELL_PATH))
@@ -2205,7 +2363,7 @@ profile-fast: profile-clean
all:: $(ALL_COMMANDS_TO_INSTALL) $(SCRIPT_LIB) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
ifneq (,$X)
- $(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';)
+ $(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL) $(OTHER_PROGRAMS))), if test ! -d '$p' && test ! '$p' -ef '$p$X'; then $(RM) '$p'; fi;)
endif
all::
@@ -2417,10 +2575,6 @@ GIT-PERL-HEADER: $(PERL_HEADER_TEMPLATE) GIT-PERL-DEFINES Makefile
perllibdir:
@echo '$(perllibdir_SQ)'
-.PHONY: gitweb
-gitweb:
- $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all
-
git-instaweb: git-instaweb.sh GIT-SCRIPT-DEFINES
$(QUIET_GEN)$(cmd_munge_script) && \
chmod +x $@+ && \
@@ -2532,21 +2686,23 @@ GIT_OBJS += git.o
.PHONY: git-objs
git-objs: $(GIT_OBJS)
+SCALAR_OBJS += scalar.o
+.PHONY: scalar-objs
+scalar-objs: $(SCALAR_OBJS)
+
OBJECTS += $(GIT_OBJS)
+OBJECTS += $(SCALAR_OBJS)
OBJECTS += $(PROGRAM_OBJS)
OBJECTS += $(TEST_OBJS)
OBJECTS += $(XDIFF_OBJS)
OBJECTS += $(FUZZ_OBJS)
OBJECTS += $(REFTABLE_OBJS) $(REFTABLE_TEST_OBJS)
+OBJECTS += $(UNIT_TEST_OBJS)
ifndef NO_CURL
OBJECTS += http.o http-walker.o remote-curl.o
endif
-SCALAR_SOURCES := contrib/scalar/scalar.c
-SCALAR_OBJECTS := $(SCALAR_SOURCES:c=o)
-OBJECTS += $(SCALAR_OBJECTS)
-
.PHONY: objects
objects: $(OBJECTS)
@@ -2581,13 +2737,7 @@ missing_compdb_dir =
compdb_args =
endif
-ASM_SRC := $(wildcard $(OBJECTS:o=S))
-ASM_OBJ := $(ASM_SRC:S=o)
-C_OBJ := $(filter-out $(ASM_OBJ),$(OBJECTS))
-
-$(C_OBJ): %.o: %.c GIT-CFLAGS $(missing_dep_dirs) $(missing_compdb_dir)
- $(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
-$(ASM_OBJ): %.o: %.S GIT-CFLAGS $(missing_dep_dirs) $(missing_compdb_dir)
+$(OBJECTS): %.o: %.c GIT-CFLAGS $(missing_dep_dirs) $(missing_compdb_dir)
$(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
%.s: %.c GIT-CFLAGS FORCE
@@ -2595,7 +2745,7 @@ $(ASM_OBJ): %.o: %.S GIT-CFLAGS $(missing_dep_dirs) $(missing_compdb_dir)
ifdef USE_COMPUTED_HEADER_DEPENDENCIES
# Take advantage of gcc's on-the-fly dependency generation
-# See <http://gcc.gnu.org/gcc-3.0/features.html>.
+# See <https://gcc.gnu.org/gcc-3.0/features.html>.
dep_files_present := $(wildcard $(dep_files))
ifneq ($(dep_files_present),)
include $(dep_files_present)
@@ -2618,8 +2768,8 @@ exec-cmd.sp exec-cmd.s exec-cmd.o: EXTRA_CPPFLAGS = \
'-DBINDIR="$(bindir_relative_SQ)"' \
'-DFALLBACK_RUNTIME_PREFIX="$(prefix_SQ)"'
-builtin/init-db.sp builtin/init-db.s builtin/init-db.o: GIT-PREFIX
-builtin/init-db.sp builtin/init-db.s builtin/init-db.o: EXTRA_CPPFLAGS = \
+setup.sp setup.s setup.o: GIT-PREFIX
+setup.sp setup.s setup.o: EXTRA_CPPFLAGS = \
-DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"'
config.sp config.s config.o: GIT-PREFIX
@@ -2654,6 +2804,13 @@ compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null
endif
+headless-git.o: compat/win32/headless.c GIT-CFLAGS
+ $(QUIET_CC)$(CC) $(ALL_CFLAGS) $(COMPAT_CFLAGS) \
+ -fno-stack-protector -o $@ -c -Wall -Wwrite-strings $<
+
+headless-git$X: headless-git.o git.res GIT-LDFLAGS
+ $(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -mwindows -o $@ $< git.res
+
git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
@@ -2678,7 +2835,7 @@ $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
-contrib/scalar/scalar$X: $(SCALAR_OBJECTS) GIT-LDFLAGS $(GITLIBS)
+scalar$X: scalar.o GIT-LDFLAGS $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
$(filter %.o,$^) $(LIBS)
@@ -2734,8 +2891,7 @@ XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \
XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --language=Perl \
--keyword=__ --keyword=N__ --keyword="__n:1,2"
MSGMERGE_FLAGS = --add-location --backup=off --update
-LOCALIZED_C = $(sort $(FOUND_C_SOURCES) $(FOUND_H_SOURCES) $(SCALAR_SOURCES) \
- $(GENERATED_H))
+LOCALIZED_C = $(sort $(FOUND_C_SOURCES) $(FOUND_H_SOURCES) $(GENERATED_H))
LOCALIZED_SH = $(sort $(SCRIPT_SH) git-sh-setup.sh)
LOCALIZED_PERL = $(sort $(SCRIPT_PERL))
@@ -2970,9 +3126,9 @@ GIT-BUILD-OPTIONS: FORCE
@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 DC_SHA1=\''$(subst ','\'',$(subst ','\'',$(DC_SHA1)))'\' >>$@+
@echo SANITIZE_LEAK=\''$(subst ','\'',$(subst ','\'',$(SANITIZE_LEAK)))'\' >>$@+
@echo SANITIZE_ADDRESS=\''$(subst ','\'',$(subst ','\'',$(SANITIZE_ADDRESS)))'\' >>$@+
@echo X=\'$(X)\' >>$@+
@@ -3028,6 +3184,7 @@ else
@echo RUNTIME_PREFIX=\'false\' >>$@+
endif
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
+ @if test -f GIT-BUILD-DIR; then rm GIT-BUILD-DIR; fi
### Detect Python interpreter path changes
ifndef NO_PYTHON
@@ -3043,13 +3200,13 @@ endif
test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X))
-all:: $(TEST_PROGRAMS) $(test_bindir_programs)
+all:: $(TEST_PROGRAMS) $(test_bindir_programs) $(UNIT_TEST_PROGS)
bin-wrappers/%: wrap-for-bin.sh
$(call mkdir_p_parent_template)
$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's|@@BUILD_DIR@@|$(shell pwd)|' \
- -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X)))|' < $< > $@ && \
+ -e 's|@@PROG@@|$(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.
@@ -3079,7 +3236,7 @@ t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS) $(REFTABLE_TEST_LIB)
check-sha1:: t/helper/test-tool$X
t/helper/test-sha1.sh
-SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))
+SP_OBJ = $(patsubst %.o,%.sp,$(OBJECTS))
$(SP_OBJ): %.sp: %.c %.o
$(QUIET_SP)cgcc -no-compile $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) \
@@ -3091,6 +3248,15 @@ $(SP_OBJ): %.sp: %.c %.o
sparse: $(SP_OBJ)
EXCEPT_HDRS := $(GENERATED_H) unicode-width.h compat/% xdiff/%
+ifndef OPENSSL_SHA1
+ EXCEPT_HDRS += sha1/openssl.h
+endif
+ifndef OPENSSL_SHA256
+ EXCEPT_HDRS += sha256/openssl.h
+endif
+ifndef NETTLE_SHA256
+ EXCEPT_HDRS += sha256/nettle.h
+endif
ifndef GCRYPT_SHA256
EXCEPT_HDRS += sha256/gcrypt.h
endif
@@ -3123,32 +3289,147 @@ check: $(GENERATED_H)
exit 1; \
fi
-%.cocci.patch: %.cocci $(COCCI_SOURCES)
- $(QUIET_SPATCH) \
- if test $(SPATCH_BATCH_SIZE) = 0; then \
- limit=; \
- else \
- limit='-n $(SPATCH_BATCH_SIZE)'; \
- fi; \
- if ! echo $(COCCI_SOURCES) | xargs $$limit \
- $(SPATCH) --sp-file $< $(SPATCH_FLAGS) \
- >$@+ 2>$@.log; \
+COCCI_GEN_ALL = .build/contrib/coccinelle/ALL.cocci
+COCCI_GLOB = $(wildcard contrib/coccinelle/*.cocci)
+COCCI_RULES_TRACKED = $(COCCI_GLOB:%=.build/%)
+COCCI_RULES_TRACKED_NO_PENDING = $(filter-out %.pending.cocci,$(COCCI_RULES_TRACKED))
+COCCI_RULES =
+COCCI_RULES += $(COCCI_GEN_ALL)
+COCCI_RULES += $(COCCI_RULES_TRACKED)
+COCCI_NAMES =
+COCCI_NAMES += $(COCCI_RULES:.build/contrib/coccinelle/%.cocci=%)
+
+COCCICHECK_PENDING = $(filter %.pending.cocci,$(COCCI_RULES))
+COCCICHECK = $(filter-out $(COCCICHECK_PENDING),$(COCCI_RULES))
+
+COCCICHECK_PATCHES = $(COCCICHECK:%=%.patch)
+COCCICHECK_PATCHES_PENDING = $(COCCICHECK_PENDING:%=%.patch)
+
+COCCICHECK_PATCHES_INTREE = $(COCCICHECK_PATCHES:.build/%=%)
+COCCICHECK_PATCHES_PENDING_INTREE = $(COCCICHECK_PATCHES_PENDING:.build/%=%)
+
+# It's expensive to compute the many=many rules below, only eval them
+# on $(MAKECMDGOALS) that match these $(COCCI_RULES)
+COCCI_RULES_GLOB =
+COCCI_RULES_GLOB += cocci%
+COCCI_RULES_GLOB += .build/contrib/coccinelle/%
+COCCI_RULES_GLOB += $(COCCICHECK_PATCHES)
+COCCI_RULES_GLOB += $(COCCICHEC_PATCHES_PENDING)
+COCCI_RULES_GLOB += $(COCCICHECK_PATCHES_INTREE)
+COCCI_RULES_GLOB += $(COCCICHECK_PATCHES_PENDING_INTREE)
+COCCI_GOALS = $(filter $(COCCI_RULES_GLOB),$(MAKECMDGOALS))
+
+COCCI_TEST_RES = $(wildcard contrib/coccinelle/tests/*.res)
+
+$(COCCI_RULES_TRACKED): .build/% : %
+ $(call mkdir_p_parent_template)
+ $(QUIET_CP)cp $< $@
+
+.build/contrib/coccinelle/FOUND_H_SOURCES: $(FOUND_H_SOURCES)
+ $(call mkdir_p_parent_template)
+ $(QUIET_GEN) >$@
+
+$(COCCI_GEN_ALL): $(COCCI_RULES_TRACKED_NO_PENDING)
+ $(call mkdir_p_parent_template)
+ $(QUIET_SPATCH_CAT)cat $^ >$@
+
+ifeq ($(COMPUTE_HEADER_DEPENDENCIES),no)
+SPATCH_USE_O_DEPENDENCIES =
+endif
+define cocci-rule
+
+## Rule for .build/$(1).patch/$(2); Params:
+# $(1) = e.g. ".build/contrib/coccinelle/free.cocci"
+# $(2) = e.g. "grep.c"
+# $(3) = e.g. "grep.o"
+COCCI_$(1:.build/contrib/coccinelle/%.cocci=%) += $(1).d/$(2).patch
+$(1).d/$(2).patch: GIT-SPATCH-DEFINES
+$(1).d/$(2).patch: $(if $(and $(SPATCH_USE_O_DEPENDENCIES),$(wildcard $(3))),$(3),.build/contrib/coccinelle/FOUND_H_SOURCES)
+$(1).d/$(2).patch: $(1)
+$(1).d/$(2).patch: $(1).d/%.patch : %
+ $$(call mkdir_p_parent_template)
+ $$(QUIET_SPATCH)if ! $$(SPATCH) $$(SPATCH_FLAGS) \
+ $$(SPATCH_INCLUDE_FLAGS) \
+ --sp-file $(1) --patch . $$< \
+ >$$@ 2>$$@.log; \
then \
- cat $@.log; \
+ echo "ERROR when applying '$(1)' to '$$<'; '$$@.log' follows:"; \
+ cat $$@.log; \
exit 1; \
- fi; \
- mv $@+ $@; \
- if test -s $@; \
+ fi
+endef
+
+define cocci-matrix
+
+$(foreach s,$(COCCI_SOURCES),$(call cocci-rule,$(c),$(s),$(s:%.c=%.o)))
+endef
+
+ifdef COCCI_GOALS
+$(eval $(foreach c,$(COCCI_RULES),$(call cocci-matrix,$(c))))
+endif
+
+define spatch-rule
+
+.build/contrib/coccinelle/$(1).cocci.patch: $$(COCCI_$(1))
+ $$(QUIET_SPATCH_CAT)cat $$^ >$$@ && \
+ if test -s $$@; \
then \
- echo ' ' SPATCH result: $@; \
+ echo ' ' SPATCH result: $$@; \
fi
-coccicheck: $(addsuffix .patch,$(filter-out %.pending.cocci,$(wildcard contrib/coccinelle/*.cocci)))
+contrib/coccinelle/$(1).cocci.patch: .build/contrib/coccinelle/$(1).cocci.patch
+ $$(QUIET_CP)cp $$< $$@
+
+endef
+
+ifdef COCCI_GOALS
+$(eval $(foreach n,$(COCCI_NAMES),$(call spatch-rule,$(n))))
+endif
+
+COCCI_TEST_RES_GEN = $(addprefix .build/,$(COCCI_TEST_RES))
+$(COCCI_TEST_RES_GEN): GIT-SPATCH-DEFINES
+$(COCCI_TEST_RES_GEN): .build/%.res : %.c
+$(COCCI_TEST_RES_GEN): .build/%.res : %.res
+ifdef SPATCH_CONCAT_COCCI
+$(COCCI_TEST_RES_GEN): .build/contrib/coccinelle/tests/%.res : $(COCCI_GEN_ALL)
+else
+$(COCCI_TEST_RES_GEN): .build/contrib/coccinelle/tests/%.res : contrib/coccinelle/%.cocci
+endif
+ $(call mkdir_p_parent_template)
+ $(QUIET_SPATCH_TEST)$(SPATCH) $(SPATCH_TEST_FLAGS) \
+ --very-quiet --no-show-diff \
+ --sp-file $< -o $@ \
+ $(@:.build/%.res=%.c) && \
+ cmp $(@:.build/%=%) $@ || \
+ git -P diff --no-index $(@:.build/%=%) $@ 2>/dev/null; \
+
+.PHONY: coccicheck-test
+coccicheck-test: $(COCCI_TEST_RES_GEN)
+
+coccicheck: coccicheck-test
+ifdef SPATCH_CONCAT_COCCI
+coccicheck: contrib/coccinelle/ALL.cocci.patch
+else
+coccicheck: $(COCCICHECK_PATCHES_INTREE)
+endif
# See contrib/coccinelle/README
-coccicheck-pending: $(addsuffix .patch,$(wildcard contrib/coccinelle/*.pending.cocci))
+coccicheck-pending: coccicheck-test
+coccicheck-pending: $(COCCICHECK_PATCHES_PENDING_INTREE)
.PHONY: coccicheck coccicheck-pending
+# "Sub"-Makefiles, not really because they can't be run stand-alone,
+# only there to contain directory-specific rules and variables
+## gitweb/Makefile inclusion:
+MAK_DIR_GITWEB = gitweb/
+include gitweb/Makefile
+
+.PHONY: gitweb
+gitweb: $(MAK_DIR_GITWEB_ALL)
+ifndef NO_GITWEB
+all:: gitweb
+endif
+
### Installation rules
ifneq ($(filter /%,$(firstword $(template_dir))),)
@@ -3221,21 +3502,20 @@ ifndef NO_PERL
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perllibdir_SQ)'
(cd perl/build/lib && $(TAR) cf - .) | \
(cd '$(DESTDIR_SQ)$(perllibdir_SQ)' && umask 022 && $(TAR) xof -)
- $(MAKE) -C gitweb install
endif
ifndef NO_TCLTK
$(MAKE) -C gitk-git install
$(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install
endif
ifneq (,$X)
- $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL) git$X)), test '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' -ef '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p$X' || $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)
+ $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL) $(OTHER_PROGRAMS))), test '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' -ef '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p$X' || $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)
endif
bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
destdir_from_execdir_SQ=$$(echo '$(gitexecdir_relative_SQ)' | sed -e 's|[^/][^/]*|..|g') && \
{ test "$$bindir/" = "$$execdir/" || \
- for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
+ for p in $(OTHER_PROGRAMS) $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
$(RM) "$$execdir/$$p" && \
test -n "$(INSTALL_SYMLINKS)" && \
ln -s "$$destdir_from_execdir_SQ/$(bindir_relative_SQ)/$$p" "$$execdir/$$p" || \
@@ -3276,10 +3556,8 @@ endif
cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; } \
done
-.PHONY: install-gitweb install-doc install-man install-man-perl install-html install-info install-pdf
+.PHONY: install-doc install-man install-man-perl install-html install-info install-pdf
.PHONY: quick-install-doc quick-install-man quick-install-html
-install-gitweb:
- $(MAKE) -C gitweb install
install-doc: install-man-perl
$(MAKE) -C Documentation install
@@ -3348,12 +3626,12 @@ rpm::
.PHONY: rpm
ifneq ($(INCLUDE_DLLS_IN_ARTIFACTS),)
-OTHER_PROGRAMS += $(shell echo *.dll t/helper/*.dll)
+OTHER_PROGRAMS += $(shell echo *.dll t/helper/*.dll t/unit-tests/bin/*.dll)
endif
artifacts-tar:: $(ALL_COMMANDS_TO_INSTALL) $(SCRIPT_LIB) $(OTHER_PROGRAMS) \
GIT-BUILD-OPTIONS $(TEST_PROGRAMS) $(test_bindir_programs) \
- $(MOFILES)
+ $(UNIT_TEST_PROGS) $(MOFILES)
$(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1) \
SHELL_PATH='$(SHELL_PATH_SQ)' PERL_PATH='$(PERL_PATH_SQ)'
test -n "$(ARTIFACTS_DIRECTORY)"
@@ -3403,15 +3681,18 @@ profile-clean:
$(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
cocciclean:
- $(RM) contrib/coccinelle/*.cocci.patch*
+ $(RM) GIT-SPATCH-DEFINES
+ $(RM) -r .build/contrib/coccinelle
+ $(RM) contrib/coccinelle/*.cocci.patch
clean: profile-clean coverage-clean cocciclean
- $(RM) -r .build
+ $(RM) -r .build $(UNIT_TEST_BIN)
$(RM) po/git.pot po/git-core.pot
- $(RM) *.res
+ $(RM) git.res
$(RM) $(OBJECTS)
+ $(RM) headless-git.o
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB)
- $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
+ $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)
$(RM) $(TEST_PROGRAMS)
$(RM) $(FUZZ_PROGRAMS)
$(RM) $(SP_OBJ)
@@ -3425,7 +3706,6 @@ clean: profile-clean coverage-clean cocciclean
$(MAKE) -C Documentation/ clean
$(RM) Documentation/GIT-EXCLUDED-PROGRAMS
ifndef NO_PERL
- $(MAKE) -C gitweb clean
$(RM) -r perl/build/
endif
$(MAKE) -C templates/ clean
@@ -3439,6 +3719,7 @@ endif
$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS
ifdef MSVC
$(RM) $(patsubst %.o,%.o.pdb,$(OBJECTS))
+ $(RM) headless-git.o.pdb
$(RM) $(patsubst %.exe,%.pdb,$(OTHER_PROGRAMS))
$(RM) $(patsubst %.exe,%.iobj,$(OTHER_PROGRAMS))
$(RM) $(patsubst %.exe,%.ipdb,$(OTHER_PROGRAMS))
@@ -3463,6 +3744,7 @@ ALL_COMMANDS += git-citool
ALL_COMMANDS += git-gui
ALL_COMMANDS += gitk
ALL_COMMANDS += gitweb
+ALL_COMMANDS += scalar
.PHONY: check-docs
check-docs::
@@ -3489,6 +3771,7 @@ check-docs::
sed -e '1,/^### command list/d' \
-e '/^#/d' \
-e '/guide$$/d' \
+ -e '/interfaces$$/d' \
-e 's/[ ].*//' \
-e 's/^/listed /' command-list.txt; \
$(MAKE) -C Documentation print-man1 | \
@@ -3577,15 +3860,26 @@ cover_db_html: cover_db
#
# make CC=clang CXX=clang++ \
# CFLAGS="-fsanitize=fuzzer-no-link,address" \
-# LIB_FUZZING_ENGINE="-fsanitize=fuzzer" \
+# LIB_FUZZING_ENGINE="-fsanitize=fuzzer,address" \
# fuzz-all
#
-FUZZ_CXXFLAGS ?= $(CFLAGS)
+FUZZ_CXXFLAGS ?= $(ALL_CFLAGS)
.PHONY: fuzz-all
-$(FUZZ_PROGRAMS): all
- $(QUIET_LINK)$(CXX) $(FUZZ_CXXFLAGS) $(LIB_OBJS) $(BUILTIN_OBJS) \
- $(XDIFF_OBJS) $(EXTLIBS) git.o $@.o $(LIB_FUZZING_ENGINE) -o $@
+$(FUZZ_PROGRAMS): %: %.o oss-fuzz/dummy-cmd-main.o $(GITLIBS) GIT-LDFLAGS
+ $(QUIET_LINK)$(CXX) $(FUZZ_CXXFLAGS) -o $@ $(ALL_LDFLAGS) \
+ -Wl,--allow-multiple-definition \
+ $(filter %.o,$^) $(filter %.a,$^) $(LIBS) $(LIB_FUZZING_ENGINE)
fuzz-all: $(FUZZ_PROGRAMS)
+
+$(UNIT_TEST_PROGS): $(UNIT_TEST_BIN)/%$X: $(UNIT_TEST_DIR)/%.o $(UNIT_TEST_DIR)/test-lib.o $(GITLIBS) GIT-LDFLAGS
+ $(call mkdir_p_parent_template)
+ $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
+ $(filter %.o,$^) $(filter %.a,$^) $(LIBS)
+
+.PHONY: build-unit-tests unit-tests
+build-unit-tests: $(UNIT_TEST_PROGS)
+unit-tests: $(UNIT_TEST_PROGS)
+ $(MAKE) -C t/ unit-tests
diff --git a/README.md b/README.md
index 7ce4f05..665ce5f 100644
--- a/README.md
+++ b/README.md
@@ -39,10 +39,10 @@ Those wishing to help with error message, usage and informational message
string translations (localization l10) should see [po/README.md][]
(a `po` file is a Portable Object file that holds the translations).
-To subscribe to the list, send an email with just "subscribe git" in
-the body to majordomo@vger.kernel.org (not the Git list). The mailing
+To subscribe to the list, send an email to <git+subscribe@vger.kernel.org>
+(see https://subspace.kernel.org/subscribing.html for details). The mailing
list archives are available at <https://lore.kernel.org/git/>,
-<http://marc.info/?l=git> and other archival sites.
+<https://marc.info/?l=git> and other archival sites.
Issues which are security relevant should be disclosed privately to
the Git Security mailing list <git-security@googlegroups.com>.
diff --git a/RelNotes b/RelNotes
index 952f80e..ae70277 120000
--- a/RelNotes
+++ b/RelNotes
@@ -1 +1 @@
-Documentation/RelNotes/2.37.2.txt \ No newline at end of file
+Documentation/RelNotes/2.45.0.txt \ No newline at end of file
diff --git a/abspath.c b/abspath.c
index 39e06b5..1202cde 100644
--- a/abspath.c
+++ b/abspath.c
@@ -1,4 +1,6 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "strbuf.h"
/*
* Do not use this for inspecting *tracked* content. When path is a
@@ -280,3 +282,46 @@ char *prefix_filename(const char *pfx, const char *arg)
#endif
return strbuf_detach(&path, NULL);
}
+
+char *prefix_filename_except_for_dash(const char *pfx, const char *arg)
+{
+ if (!strcmp(arg, "-"))
+ return xstrdup(arg);
+ return prefix_filename(pfx, arg);
+}
+
+void strbuf_add_absolute_path(struct strbuf *sb, const char *path)
+{
+ if (!*path)
+ die("The empty string is not a valid path");
+ if (!is_absolute_path(path)) {
+ struct stat cwd_stat, pwd_stat;
+ size_t orig_len = sb->len;
+ char *cwd = xgetcwd();
+ char *pwd = getenv("PWD");
+ if (pwd && strcmp(pwd, cwd) &&
+ !stat(cwd, &cwd_stat) &&
+ (cwd_stat.st_dev || cwd_stat.st_ino) &&
+ !stat(pwd, &pwd_stat) &&
+ pwd_stat.st_dev == cwd_stat.st_dev &&
+ pwd_stat.st_ino == cwd_stat.st_ino)
+ strbuf_addstr(sb, pwd);
+ else
+ strbuf_addstr(sb, cwd);
+ if (sb->len > orig_len && !is_dir_sep(sb->buf[sb->len - 1]))
+ strbuf_addch(sb, '/');
+ free(cwd);
+ }
+ strbuf_addstr(sb, path);
+}
+
+void strbuf_add_real_path(struct strbuf *sb, const char *path)
+{
+ if (sb->len) {
+ struct strbuf resolved = STRBUF_INIT;
+ strbuf_realpath(&resolved, path, 1);
+ strbuf_addbuf(sb, &resolved);
+ strbuf_release(&resolved);
+ } else
+ strbuf_realpath(sb, path, 1);
+}
diff --git a/abspath.h b/abspath.h
new file mode 100644
index 0000000..4653080
--- /dev/null
+++ b/abspath.h
@@ -0,0 +1,54 @@
+#ifndef ABSPATH_H
+#define ABSPATH_H
+
+int is_directory(const char *);
+char *strbuf_realpath(struct strbuf *resolved, const char *path,
+ int die_on_error);
+char *strbuf_realpath_forgiving(struct strbuf *resolved, const char *path,
+ int die_on_error);
+char *real_pathdup(const char *path, int die_on_error);
+const char *absolute_path(const char *path);
+char *absolute_pathdup(const char *path);
+
+/*
+ * Concatenate "prefix" (if len is non-zero) and "path", with no
+ * connecting characters (so "prefix" should end with a "/").
+ * Unlike prefix_path, this should be used if the named file does
+ * not have to interact with index entry; i.e. name of a random file
+ * on the filesystem.
+ *
+ * The return value is always a newly allocated string (even if the
+ * prefix was empty).
+ */
+char *prefix_filename(const char *prefix, const char *path);
+
+/* Likewise, but path=="-" always yields "-" */
+char *prefix_filename_except_for_dash(const char *prefix, const char *path);
+
+static inline int is_absolute_path(const char *path)
+{
+ return is_dir_sep(path[0]) || has_dos_drive_prefix(path);
+}
+
+/**
+ * Add a path to a buffer, converting a relative path to an
+ * absolute one in the process. Symbolic links are not
+ * resolved.
+ */
+void strbuf_add_absolute_path(struct strbuf *sb, const char *path);
+
+/**
+ * Canonize `path` (make it absolute, resolve symlinks, remove extra
+ * slashes) and append it to `sb`. Die with an informative error
+ * message if there is a problem.
+ *
+ * The directory part of `path` (i.e., everything up to the last
+ * dir_sep) must denote a valid, existing directory, but the last
+ * component need not exist.
+ *
+ * Callers that don't mind links should use the more lightweight
+ * strbuf_add_absolute_path() instead.
+ */
+void strbuf_add_real_path(struct strbuf *sb, const char *path);
+
+#endif /* ABSPATH_H */
diff --git a/add-interactive.c b/add-interactive.c
index 22fcd34..6bf87e7 100644
--- a/add-interactive.c
+++ b/add-interactive.c
@@ -1,8 +1,14 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "add-interactive.h"
#include "color.h"
#include "config.h"
#include "diffcore.h"
+#include "gettext.h"
+#include "hash.h"
+#include "hex.h"
+#include "preload-index.h"
+#include "read-cache-ll.h"
+#include "repository.h"
#include "revision.h"
#include "refs.h"
#include "string-list.h"
@@ -10,6 +16,7 @@
#include "dir.h"
#include "run-command.h"
#include "prompt.h"
+#include "tree.h"
static void init_color(struct repository *r, struct add_i_state *s,
const char *section_and_slot, char *dst,
@@ -430,7 +437,7 @@ struct pathname_entry {
struct file_item *item;
};
-static int pathname_entry_cmp(const void *unused_cmp_data,
+static int pathname_entry_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *he1,
const struct hashmap_entry *he2,
const void *name)
@@ -530,8 +537,8 @@ static int get_modified_files(struct repository *r,
struct collection_status s = { 0 };
int i;
- if (discard_index(r->index) < 0 ||
- repo_read_index_preload(r, ps, 0) < 0)
+ discard_index(r->index);
+ if (repo_read_index_preload(r, ps, 0) < 0)
return error(_("could not read index"));
prefix_item_list_clear(files);
@@ -551,7 +558,7 @@ static int get_modified_files(struct repository *r,
opt.def = is_initial ?
empty_tree_oid_hex() : oid_to_hex(&head_oid);
- init_revisions(&rev, NULL);
+ repo_init_revisions(r, &rev, NULL);
setup_revisions(0, NULL, &rev, &opt);
rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;
@@ -562,7 +569,7 @@ static int get_modified_files(struct repository *r,
copy_pathspec(&rev.prune_data, ps);
if (s.mode == FROM_INDEX)
- run_diff_index(&rev, 1);
+ run_diff_index(&rev, DIFF_INDEX_CACHED);
else {
rev.diffopt.flags.ignore_dirty_submodules = 1;
run_diff_files(&rev, 0);
@@ -724,7 +731,7 @@ static int run_update(struct add_i_state *s, const struct pathspec *ps,
}
static void revert_from_diff(struct diff_queue_struct *q,
- struct diff_options *opt, void *data)
+ struct diff_options *opt, void *data UNUSED)
{
int i, add_flags = ADD_CACHE_OK_TO_ADD | ADD_CACHE_OK_TO_REPLACE;
@@ -997,27 +1004,26 @@ static int run_diff(struct add_i_state *s, const struct pathspec *ps,
count = list_and_choose(s, files, opts);
opts->flags = 0;
if (count > 0) {
- struct strvec args = STRVEC_INIT;
+ struct child_process cmd = CHILD_PROCESS_INIT;
- strvec_pushl(&args, "git", "diff", "-p", "--cached",
+ strvec_pushl(&cmd.args, "git", "diff", "-p", "--cached",
oid_to_hex(!is_initial ? &oid :
s->r->hash_algo->empty_tree),
"--", NULL);
for (i = 0; i < files->items.nr; i++)
if (files->selected[i])
- strvec_push(&args,
+ strvec_push(&cmd.args,
files->items.items[i].string);
- res = run_command_v_opt(args.v, 0);
- strvec_clear(&args);
+ res = run_command(&cmd);
}
putchar('\n');
return res;
}
-static int run_help(struct add_i_state *s, const struct pathspec *unused_ps,
- struct prefix_item_list *unused_files,
- struct list_and_choose_options *unused_opts)
+static int run_help(struct add_i_state *s, const struct pathspec *ps UNUSED,
+ struct prefix_item_list *files UNUSED,
+ struct list_and_choose_options *opts UNUSED)
{
color_fprintf_ln(stdout, s->help_color, "status - %s",
_("show paths with changes"));
@@ -1068,7 +1074,7 @@ struct print_command_item_data {
const char *color, *reset;
};
-static void print_command_item(int i, int selected,
+static void print_command_item(int i, int selected UNUSED,
struct string_list_item *item,
void *print_command_item_data)
{
@@ -1157,8 +1163,8 @@ int run_add_i(struct repository *r, const struct pathspec *ps)
_("staged"), _("unstaged"), _("path"));
opts.list_opts.header = header.buf;
- if (discard_index(r->index) < 0 ||
- repo_read_index(r) < 0 ||
+ discard_index(r->index);
+ if (repo_read_index(r) < 0 ||
repo_refresh_and_write_index(r, REFRESH_QUIET, 0, 1,
NULL, NULL, NULL) < 0)
warning(_("could not refresh index"));
diff --git a/add-patch.c b/add-patch.c
index 509ca04..a06dd18 100644
--- a/add-patch.c
+++ b/add-patch.c
@@ -1,11 +1,17 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "add-interactive.h"
+#include "advice.h"
+#include "editor.h"
+#include "environment.h"
+#include "gettext.h"
+#include "object-name.h"
+#include "read-cache-ll.h"
+#include "repository.h"
#include "strbuf.h"
#include "run-command.h"
#include "strvec.h"
#include "pathspec.h"
#include "color.h"
-#include "diff.h"
#include "compat/terminal.h"
#include "prompt.h"
@@ -191,10 +197,10 @@ static struct patch_mode patch_mode_worktree_head = {
.apply_check_args = { "-R", NULL },
.is_reverse = 1,
.prompt_mode = {
- N_("Discard mode change from index and worktree [y,n,q,a,d%s,?]? "),
- N_("Discard deletion from index and worktree [y,n,q,a,d%s,?]? "),
- N_("Discard addition from index and worktree [y,n,q,a,d%s,?]? "),
- N_("Discard this hunk from index and worktree [y,n,q,a,d%s,?]? "),
+ N_("Discard mode change from worktree [y,n,q,a,d%s,?]? "),
+ N_("Discard deletion from worktree [y,n,q,a,d%s,?]? "),
+ N_("Discard addition from worktree [y,n,q,a,d%s,?]? "),
+ N_("Discard this hunk from worktree [y,n,q,a,d%s,?]? "),
},
.edit_hunk_hint = N_("If the patch applies cleanly, the edited hunk "
"will immediately be marked for discarding."),
@@ -213,10 +219,10 @@ static struct patch_mode patch_mode_worktree_nothead = {
.apply_args = { NULL },
.apply_check_args = { NULL },
.prompt_mode = {
- N_("Apply mode change to index and worktree [y,n,q,a,d%s,?]? "),
- N_("Apply deletion to index and worktree [y,n,q,a,d%s,?]? "),
- N_("Apply addition to index and worktree [y,n,q,a,d%s,?]? "),
- N_("Apply this hunk to index and worktree [y,n,q,a,d%s,?]? "),
+ N_("Apply mode change to worktree [y,n,q,a,d%s,?]? "),
+ N_("Apply deletion to worktree [y,n,q,a,d%s,?]? "),
+ N_("Apply addition to worktree [y,n,q,a,d%s,?]? "),
+ N_("Apply this hunk to worktree [y,n,q,a,d%s,?]? "),
},
.edit_hunk_hint = N_("If the patch applies cleanly, the edited hunk "
"will immediately be marked for applying."),
@@ -238,6 +244,7 @@ struct hunk_header {
* include the newline.
*/
size_t extra_start, extra_end, colored_extra_start, colored_extra_end;
+ unsigned suppress_colored_line_range:1;
};
struct hunk {
@@ -358,15 +365,14 @@ static int parse_hunk_header(struct add_p_state *s, struct hunk *hunk)
if (!eol)
eol = s->colored.buf + s->colored.len;
p = memmem(line, eol - line, "@@ -", 4);
- if (!p)
- return error(_("could not parse colored hunk header '%.*s'"),
- (int)(eol - line), line);
- p = memmem(p + 4, eol - p - 4, " @@", 3);
- if (!p)
- return error(_("could not parse colored hunk header '%.*s'"),
- (int)(eol - line), line);
+ if (p && (p = memmem(p + 4, eol - p - 4, " @@", 3))) {
+ header->colored_extra_start = p + 3 - s->colored.buf;
+ } else {
+ /* could not parse colored hunk header, leave as-is */
+ header->colored_extra_start = hunk->colored_start;
+ header->suppress_colored_line_range = 1;
+ }
hunk->colored_start = eol - s->colored.buf + (*eol == '\n');
- header->colored_extra_start = p + 3 - s->colored.buf;
header->colored_extra_end = hunk->colored_start;
return 0;
@@ -414,12 +420,13 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)
strvec_push(&args,
/* could be on an unborn branch */
!strcmp("HEAD", s->revision) &&
- get_oid("HEAD", &oid) ?
+ repo_get_oid(the_repository, "HEAD", &oid) ?
empty_tree_oid_hex() : s->revision);
}
color_arg_index = args.nr;
/* Use `--no-color` explicitly, just in case `diff.color = always`. */
- strvec_pushl(&args, "--no-color", "-p", "--", NULL);
+ strvec_pushl(&args, "--no-color", "--ignore-submodules=dirty", "-p",
+ "--", NULL);
for (i = 0; i < ps->nr; i++)
strvec_push(&args, ps->items[i].original);
@@ -482,7 +489,8 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)
if (!eol)
eol = pend;
- if (starts_with(p, "diff ")) {
+ if (starts_with(p, "diff ") ||
+ starts_with(p, "* Unmerged path ")) {
complete_file(marker, hunk);
ALLOC_GROW_BY(s->file_diff, s->file_diff_nr, 1,
file_diff_alloc);
@@ -592,7 +600,10 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)
if (colored_eol)
colored_p = colored_eol + 1;
else if (p != pend)
- /* colored shorter than non-colored? */
+ /* non-colored has more lines? */
+ goto mismatched_output;
+ else if (colored_p == colored_pend)
+ /* last line has no matching colored one? */
goto mismatched_output;
else
colored_p = colored_pend;
@@ -656,6 +667,15 @@ static void render_hunk(struct add_p_state *s, struct hunk *hunk,
if (!colored) {
p = s->plain.buf + header->extra_start;
len = header->extra_end - header->extra_start;
+ } else if (header->suppress_colored_line_range) {
+ strbuf_add(out,
+ s->colored.buf + header->colored_extra_start,
+ header->colored_extra_end -
+ header->colored_extra_start);
+
+ strbuf_add(out, s->colored.buf + hunk->colored_start,
+ hunk->colored_end - hunk->colored_start);
+ return;
} else {
strbuf_addstr(out, s->s.fraginfo_color);
p = s->colored.buf + header->colored_extra_start;
@@ -1085,24 +1105,26 @@ static int edit_hunk_manually(struct add_p_state *s, struct hunk *hunk)
size_t i;
strbuf_reset(&s->buf);
- strbuf_commented_addf(&s->buf, _("Manual hunk edit mode -- see bottom for "
- "a quick guide.\n"));
+ strbuf_commented_addf(&s->buf, comment_line_str,
+ _("Manual hunk edit mode -- see bottom for "
+ "a quick guide.\n"));
render_hunk(s, hunk, 0, 0, &s->buf);
- strbuf_commented_addf(&s->buf,
+ strbuf_commented_addf(&s->buf, comment_line_str,
_("---\n"
"To remove '%c' lines, make them ' ' lines "
"(context).\n"
"To remove '%c' lines, delete them.\n"
- "Lines starting with %c will be removed.\n"),
+ "Lines starting with %s will be removed.\n"),
s->mode->is_reverse ? '+' : '-',
s->mode->is_reverse ? '-' : '+',
- comment_line_char);
- strbuf_commented_addf(&s->buf, "%s", _(s->mode->edit_hunk_hint));
+ comment_line_str);
+ strbuf_commented_addf(&s->buf, comment_line_str, "%s",
+ _(s->mode->edit_hunk_hint));
/*
* TRANSLATORS: 'it' refers to the patch mentioned in the previous
* messages.
*/
- strbuf_commented_addf(&s->buf,
+ strbuf_commented_addf(&s->buf, comment_line_str,
_("If it does not apply cleanly, you will be "
"given an opportunity to\n"
"edit again. If all lines of the hunk are "
@@ -1117,7 +1139,7 @@ static int edit_hunk_manually(struct add_p_state *s, struct hunk *hunk)
for (i = 0; i < s->buf.len; ) {
size_t next = find_next_line(&s->buf, i);
- if (s->buf.buf[i] != comment_line_char)
+ if (!starts_with(s->buf.buf + i, comment_line_str))
strbuf_add(&s->plain, s->buf.buf + i, next - i);
i = next;
}
@@ -1366,13 +1388,14 @@ N_("j - leave this hunk undecided, see next undecided hunk\n"
"/ - search for a hunk matching the given regex\n"
"s - split the current hunk into smaller hunks\n"
"e - manually edit the current hunk\n"
+ "p - print the current hunk\n"
"? - print help\n");
static int patch_update_file(struct add_p_state *s,
struct file_diff *file_diff)
{
size_t hunk_index = 0;
- ssize_t i, undecided_previous, undecided_next;
+ ssize_t i, undecided_previous, undecided_next, rendered_hunk_index = -1;
struct hunk *hunk;
char ch;
struct child_process cp = CHILD_PROCESS_INIT;
@@ -1425,8 +1448,11 @@ static int patch_update_file(struct add_p_state *s,
strbuf_reset(&s->buf);
if (file_diff->hunk_nr) {
- render_hunk(s, hunk, 0, colored, &s->buf);
- fputs(s->buf.buf, stdout);
+ if (rendered_hunk_index != hunk_index) {
+ render_hunk(s, hunk, 0, colored, &s->buf);
+ fputs(s->buf.buf, stdout);
+ rendered_hunk_index = hunk_index;
+ }
strbuf_reset(&s->buf);
if (undecided_previous >= 0) {
@@ -1458,6 +1484,7 @@ static int patch_update_file(struct add_p_state *s,
permitted |= ALLOW_EDIT;
strbuf_addstr(&s->buf, ",e");
}
+ strbuf_addstr(&s->buf, ",p");
}
if (file_diff->deleted)
prompt_mode_type = PROMPT_DELETION;
@@ -1547,7 +1574,7 @@ soft_increment:
strbuf_remove(&s->answer, 0, 1);
strbuf_trim(&s->answer);
i = hunk_index - DISPLAY_HUNKS_LINES / 2;
- if (i < file_diff->mode_change)
+ if (i < (int)file_diff->mode_change)
i = file_diff->mode_change;
while (s->answer.len == 0) {
i = display_hunks(s, file_diff, i);
@@ -1622,13 +1649,15 @@ soft_increment:
hunk_index = i;
} else if (s->answer.buf[0] == 's') {
size_t splittable_into = hunk->splittable_into;
- if (!(permitted & ALLOW_SPLIT))
+ if (!(permitted & ALLOW_SPLIT)) {
err(s, _("Sorry, cannot split this hunk"));
- else if (!split_hunk(s, file_diff,
- hunk - file_diff->hunk))
+ } else if (!split_hunk(s, file_diff,
+ hunk - file_diff->hunk)) {
color_fprintf_ln(stdout, s->s.header_color,
_("Split into %d hunks."),
(int)splittable_into);
+ rendered_hunk_index = -1;
+ }
} else if (s->answer.buf[0] == 'e') {
if (!(permitted & ALLOW_EDIT))
err(s, _("Sorry, cannot edit this hunk"));
@@ -1636,6 +1665,8 @@ soft_increment:
hunk->use = USE_HUNK;
goto soft_increment;
}
+ } else if (s->answer.buf[0] == 'p') {
+ rendered_hunk_index = -1;
} else {
const char *p = _(help_patch_remainder), *eol = p;
@@ -1707,14 +1738,6 @@ int run_add_p(struct repository *r, enum add_p_mode mode,
if (mode == ADD_P_STASH)
s.mode = &patch_mode_stash;
else if (mode == ADD_P_RESET) {
- /*
- * NEEDSWORK: Instead of comparing to the literal "HEAD",
- * compare the commit objects instead so that other ways of
- * saying the same thing (such as "@") are also handled
- * appropriately.
- *
- * This applies to the cases below too.
- */
if (!revision || !strcmp(revision, "HEAD"))
s.mode = &patch_mode_reset_head;
else
@@ -1737,7 +1760,8 @@ int run_add_p(struct repository *r, enum add_p_mode mode,
s.mode = &patch_mode_add;
s.revision = revision;
- if (discard_index(r->index) < 0 || repo_read_index(r) < 0 ||
+ discard_index(r->index);
+ if (repo_read_index(r) < 0 ||
(!s.mode->index_only &&
repo_refresh_and_write_index(r, REFRESH_QUIET, 0, 1,
NULL, NULL, NULL) < 0) ||
diff --git a/advice.c b/advice.c
index 6fda9ed..7511119 100644
--- a/advice.c
+++ b/advice.c
@@ -1,6 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "advice.h"
#include "config.h"
#include "color.h"
+#include "gettext.h"
#include "help.h"
#include "string-list.h"
@@ -31,50 +33,59 @@ static const char *advise_get_color(enum color_advice ix)
return "";
}
+enum advice_level {
+ ADVICE_LEVEL_NONE = 0,
+ ADVICE_LEVEL_DISABLED,
+ ADVICE_LEVEL_ENABLED,
+};
+
static struct {
const char *key;
- int enabled;
+ enum advice_level level;
} advice_setting[] = {
- [ADVICE_ADD_EMBEDDED_REPO] = { "addEmbeddedRepo", 1 },
- [ADVICE_ADD_EMPTY_PATHSPEC] = { "addEmptyPathspec", 1 },
- [ADVICE_ADD_IGNORED_FILE] = { "addIgnoredFile", 1 },
- [ADVICE_AM_WORK_DIR] = { "amWorkDir", 1 },
- [ADVICE_AMBIGUOUS_FETCH_REFSPEC] = { "ambiguousFetchRefspec", 1 },
- [ADVICE_CHECKOUT_AMBIGUOUS_REMOTE_BRANCH_NAME] = { "checkoutAmbiguousRemoteBranchName", 1 },
- [ADVICE_COMMIT_BEFORE_MERGE] = { "commitBeforeMerge", 1 },
- [ADVICE_DETACHED_HEAD] = { "detachedHead", 1 },
- [ADVICE_SUGGEST_DETACHING_HEAD] = { "suggestDetachingHead", 1 },
- [ADVICE_FETCH_SHOW_FORCED_UPDATES] = { "fetchShowForcedUpdates", 1 },
- [ADVICE_GRAFT_FILE_DEPRECATED] = { "graftFileDeprecated", 1 },
- [ADVICE_IGNORED_HOOK] = { "ignoredHook", 1 },
- [ADVICE_IMPLICIT_IDENTITY] = { "implicitIdentity", 1 },
- [ADVICE_NESTED_TAG] = { "nestedTag", 1 },
- [ADVICE_OBJECT_NAME_WARNING] = { "objectNameWarning", 1 },
- [ADVICE_PUSH_ALREADY_EXISTS] = { "pushAlreadyExists", 1 },
- [ADVICE_PUSH_FETCH_FIRST] = { "pushFetchFirst", 1 },
- [ADVICE_PUSH_NEEDS_FORCE] = { "pushNeedsForce", 1 },
- [ADVICE_PUSH_REF_NEEDS_UPDATE] = { "pushRefNeedsUpdate", 1 },
-
- /* make this an alias for backward compatibility */
- [ADVICE_PUSH_UPDATE_REJECTED_ALIAS] = { "pushNonFastForward", 1 },
-
- [ADVICE_PUSH_NON_FF_CURRENT] = { "pushNonFFCurrent", 1 },
- [ADVICE_PUSH_NON_FF_MATCHING] = { "pushNonFFMatching", 1 },
- [ADVICE_PUSH_UNQUALIFIED_REF_NAME] = { "pushUnqualifiedRefName", 1 },
- [ADVICE_PUSH_UPDATE_REJECTED] = { "pushUpdateRejected", 1 },
- [ADVICE_RESET_NO_REFRESH_WARNING] = { "resetNoRefresh", 1 },
- [ADVICE_RESOLVE_CONFLICT] = { "resolveConflict", 1 },
- [ADVICE_RM_HINTS] = { "rmHints", 1 },
- [ADVICE_SEQUENCER_IN_USE] = { "sequencerInUse", 1 },
- [ADVICE_SET_UPSTREAM_FAILURE] = { "setUpstreamFailure", 1 },
- [ADVICE_SKIPPED_CHERRY_PICKS] = { "skippedCherryPicks", 1 },
- [ADVICE_STATUS_AHEAD_BEHIND_WARNING] = { "statusAheadBehindWarning", 1 },
- [ADVICE_STATUS_HINTS] = { "statusHints", 1 },
- [ADVICE_STATUS_U_OPTION] = { "statusUoption", 1 },
- [ADVICE_SUBMODULE_ALTERNATE_ERROR_STRATEGY_DIE] = { "submoduleAlternateErrorStrategyDie", 1 },
- [ADVICE_SUBMODULES_NOT_UPDATED] = { "submodulesNotUpdated", 1 },
- [ADVICE_UPDATE_SPARSE_PATH] = { "updateSparsePath", 1 },
- [ADVICE_WAITING_FOR_EDITOR] = { "waitingForEditor", 1 },
+ [ADVICE_ADD_EMBEDDED_REPO] = { "addEmbeddedRepo" },
+ [ADVICE_ADD_EMPTY_PATHSPEC] = { "addEmptyPathspec" },
+ [ADVICE_ADD_IGNORED_FILE] = { "addIgnoredFile" },
+ [ADVICE_AMBIGUOUS_FETCH_REFSPEC] = { "ambiguousFetchRefspec" },
+ [ADVICE_AM_WORK_DIR] = { "amWorkDir" },
+ [ADVICE_CHECKOUT_AMBIGUOUS_REMOTE_BRANCH_NAME] = { "checkoutAmbiguousRemoteBranchName" },
+ [ADVICE_COMMIT_BEFORE_MERGE] = { "commitBeforeMerge" },
+ [ADVICE_DETACHED_HEAD] = { "detachedHead" },
+ [ADVICE_DIVERGING] = { "diverging" },
+ [ADVICE_FETCH_SHOW_FORCED_UPDATES] = { "fetchShowForcedUpdates" },
+ [ADVICE_FORCE_DELETE_BRANCH] = { "forceDeleteBranch" },
+ [ADVICE_GRAFT_FILE_DEPRECATED] = { "graftFileDeprecated" },
+ [ADVICE_IGNORED_HOOK] = { "ignoredHook" },
+ [ADVICE_IMPLICIT_IDENTITY] = { "implicitIdentity" },
+ [ADVICE_MERGE_CONFLICT] = { "mergeConflict" },
+ [ADVICE_NESTED_TAG] = { "nestedTag" },
+ [ADVICE_OBJECT_NAME_WARNING] = { "objectNameWarning" },
+ [ADVICE_PUSH_ALREADY_EXISTS] = { "pushAlreadyExists" },
+ [ADVICE_PUSH_FETCH_FIRST] = { "pushFetchFirst" },
+ [ADVICE_PUSH_NEEDS_FORCE] = { "pushNeedsForce" },
+ [ADVICE_PUSH_NON_FF_CURRENT] = { "pushNonFFCurrent" },
+ [ADVICE_PUSH_NON_FF_MATCHING] = { "pushNonFFMatching" },
+ [ADVICE_PUSH_REF_NEEDS_UPDATE] = { "pushRefNeedsUpdate" },
+ [ADVICE_PUSH_UNQUALIFIED_REF_NAME] = { "pushUnqualifiedRefName" },
+ [ADVICE_PUSH_UPDATE_REJECTED] = { "pushUpdateRejected" },
+ [ADVICE_PUSH_UPDATE_REJECTED_ALIAS] = { "pushNonFastForward" }, /* backwards compatibility */
+ [ADVICE_REF_SYNTAX] = { "refSyntax" },
+ [ADVICE_RESET_NO_REFRESH_WARNING] = { "resetNoRefresh" },
+ [ADVICE_RESOLVE_CONFLICT] = { "resolveConflict" },
+ [ADVICE_RM_HINTS] = { "rmHints" },
+ [ADVICE_SEQUENCER_IN_USE] = { "sequencerInUse" },
+ [ADVICE_SET_UPSTREAM_FAILURE] = { "setUpstreamFailure" },
+ [ADVICE_SKIPPED_CHERRY_PICKS] = { "skippedCherryPicks" },
+ [ADVICE_STATUS_AHEAD_BEHIND_WARNING] = { "statusAheadBehindWarning" },
+ [ADVICE_STATUS_HINTS] = { "statusHints" },
+ [ADVICE_STATUS_U_OPTION] = { "statusUoption" },
+ [ADVICE_SUBMODULES_NOT_UPDATED] = { "submodulesNotUpdated" },
+ [ADVICE_SUBMODULE_ALTERNATE_ERROR_STRATEGY_DIE] = { "submoduleAlternateErrorStrategyDie" },
+ [ADVICE_SUBMODULE_MERGE_CONFLICT] = { "submoduleMergeConflict" },
+ [ADVICE_SUGGEST_DETACHING_HEAD] = { "suggestDetachingHead" },
+ [ADVICE_UPDATE_SPARSE_PATH] = { "updateSparsePath" },
+ [ADVICE_WAITING_FOR_EDITOR] = { "waitingForEditor" },
+ [ADVICE_WORKTREE_ADD_ORPHAN] = { "worktreeAddOrphan" },
};
static const char turn_off_instructions[] =
@@ -94,8 +105,9 @@ static void vadvise(const char *advice, int display_instructions,
for (cp = buf.buf; *cp; cp = np) {
np = strchrnul(cp, '\n');
- fprintf(stderr, _("%shint: %.*s%s\n"),
+ fprintf(stderr, _("%shint:%s%.*s%s\n"),
advise_get_color(ADVICE_COLOR_HINT),
+ (np == cp) ? "" : " ",
(int)(np - cp), cp,
advise_get_color(ADVICE_COLOR_RESET));
if (*np)
@@ -114,13 +126,13 @@ void advise(const char *advice, ...)
int advice_enabled(enum advice_type type)
{
- switch(type) {
- case ADVICE_PUSH_UPDATE_REJECTED:
- return advice_setting[ADVICE_PUSH_UPDATE_REJECTED].enabled &&
- advice_setting[ADVICE_PUSH_UPDATE_REJECTED_ALIAS].enabled;
- default:
- return advice_setting[type].enabled;
- }
+ int enabled = advice_setting[type].level != ADVICE_LEVEL_DISABLED;
+
+ if (type == ADVICE_PUSH_UPDATE_REJECTED)
+ return enabled &&
+ advice_enabled(ADVICE_PUSH_UPDATE_REJECTED_ALIAS);
+
+ return enabled;
}
void advise_if_enabled(enum advice_type type, const char *advice, ...)
@@ -131,7 +143,8 @@ void advise_if_enabled(enum advice_type type, const char *advice, ...)
return;
va_start(params, advice);
- vadvise(advice, 1, advice_setting[type].key, params);
+ vadvise(advice, !advice_setting[type].level, advice_setting[type].key,
+ params);
va_end(params);
}
@@ -160,7 +173,9 @@ int git_default_advice_config(const char *var, const char *value)
for (i = 0; i < ARRAY_SIZE(advice_setting); i++) {
if (strcasecmp(k, advice_setting[i].key))
continue;
- advice_setting[i].enabled = git_config_bool(var, value);
+ advice_setting[i].level = git_config_bool(var, value)
+ ? ADVICE_LEVEL_ENABLED
+ : ADVICE_LEVEL_DISABLED;
return 0;
}
@@ -187,9 +202,10 @@ int error_resolve_conflict(const char *me)
error(_("Pulling is not possible because you have unmerged files."));
else if (!strcmp(me, "revert"))
error(_("Reverting is not possible because you have unmerged files."));
+ else if (!strcmp(me, "rebase"))
+ error(_("Rebasing is not possible because you have unmerged files."));
else
- error(_("It is not possible to %s because you have unmerged files."),
- me);
+ BUG("Unhandled conflict reason '%s'", me);
if (advice_enabled(ADVICE_RESOLVE_CONFLICT))
/*
@@ -217,6 +233,14 @@ void NORETURN die_conclude_merge(void)
void NORETURN die_ff_impossible(void)
{
+ advise_if_enabled(ADVICE_DIVERGING,
+ _("Diverging branches can't be fast-forwarded, you need to either:\n"
+ "\n"
+ "\tgit merge --no-ff\n"
+ "\n"
+ "or:\n"
+ "\n"
+ "\tgit rebase\n"));
die(_("Not possible to fast-forward, aborting."));
}
@@ -261,3 +285,22 @@ void detach_advice(const char *new_name)
fprintf(stderr, fmt, new_name);
}
+
+void advise_on_moving_dirty_path(struct string_list *pathspec_list)
+{
+ struct string_list_item *item;
+
+ if (!pathspec_list->nr)
+ return;
+
+ fprintf(stderr, _("The following paths have been moved outside the\n"
+ "sparse-checkout definition but are not sparse due to local\n"
+ "modifications.\n"));
+ for_each_string_list_item(item, pathspec_list)
+ fprintf(stderr, "%s\n", item->string);
+
+ advise_if_enabled(ADVICE_UPDATE_SPARSE_PATH,
+ _("To correct the sparsity of these paths, do the following:\n"
+ "* Use \"git add --sparse <paths>\" to update the index\n"
+ "* Use \"git sparse-checkout reapply\" to apply the sparsity rules"));
+}
diff --git a/advice.h b/advice.h
index 7ddc6cb..c8d29f9 100644
--- a/advice.h
+++ b/advice.h
@@ -1,8 +1,6 @@
#ifndef ADVICE_H
#define ADVICE_H
-#include "git-compat-util.h"
-
struct string_list;
/*
@@ -12,20 +10,22 @@ struct string_list;
* Add the new config variable to Documentation/config/advice.txt.
* Call advise_if_enabled to print your advice.
*/
- enum advice_type {
+enum advice_type {
ADVICE_ADD_EMBEDDED_REPO,
ADVICE_ADD_EMPTY_PATHSPEC,
ADVICE_ADD_IGNORED_FILE,
- ADVICE_AM_WORK_DIR,
ADVICE_AMBIGUOUS_FETCH_REFSPEC,
+ ADVICE_AM_WORK_DIR,
ADVICE_CHECKOUT_AMBIGUOUS_REMOTE_BRANCH_NAME,
ADVICE_COMMIT_BEFORE_MERGE,
ADVICE_DETACHED_HEAD,
- ADVICE_SUGGEST_DETACHING_HEAD,
+ ADVICE_DIVERGING,
ADVICE_FETCH_SHOW_FORCED_UPDATES,
+ ADVICE_FORCE_DELETE_BRANCH,
ADVICE_GRAFT_FILE_DEPRECATED,
ADVICE_IGNORED_HOOK,
ADVICE_IMPLICIT_IDENTITY,
+ ADVICE_MERGE_CONFLICT,
ADVICE_NESTED_TAG,
ADVICE_OBJECT_NAME_WARNING,
ADVICE_PUSH_ALREADY_EXISTS,
@@ -33,23 +33,27 @@ struct string_list;
ADVICE_PUSH_NEEDS_FORCE,
ADVICE_PUSH_NON_FF_CURRENT,
ADVICE_PUSH_NON_FF_MATCHING,
+ ADVICE_PUSH_REF_NEEDS_UPDATE,
ADVICE_PUSH_UNQUALIFIED_REF_NAME,
- ADVICE_PUSH_UPDATE_REJECTED_ALIAS,
ADVICE_PUSH_UPDATE_REJECTED,
- ADVICE_PUSH_REF_NEEDS_UPDATE,
+ ADVICE_PUSH_UPDATE_REJECTED_ALIAS,
+ ADVICE_REF_SYNTAX,
ADVICE_RESET_NO_REFRESH_WARNING,
ADVICE_RESOLVE_CONFLICT,
ADVICE_RM_HINTS,
ADVICE_SEQUENCER_IN_USE,
ADVICE_SET_UPSTREAM_FAILURE,
+ ADVICE_SKIPPED_CHERRY_PICKS,
ADVICE_STATUS_AHEAD_BEHIND_WARNING,
ADVICE_STATUS_HINTS,
ADVICE_STATUS_U_OPTION,
- ADVICE_SUBMODULE_ALTERNATE_ERROR_STRATEGY_DIE,
ADVICE_SUBMODULES_NOT_UPDATED,
+ ADVICE_SUBMODULE_ALTERNATE_ERROR_STRATEGY_DIE,
+ ADVICE_SUBMODULE_MERGE_CONFLICT,
+ ADVICE_SUGGEST_DETACHING_HEAD,
ADVICE_UPDATE_SPARSE_PATH,
ADVICE_WAITING_FOR_EDITOR,
- ADVICE_SKIPPED_CHERRY_PICKS,
+ ADVICE_WORKTREE_ADD_ORPHAN,
};
int git_default_advice_config(const char *var, const char *value);
@@ -74,5 +78,6 @@ void NORETURN die_conclude_merge(void);
void NORETURN die_ff_impossible(void);
void advise_on_updating_sparse_paths(struct string_list *pathspec_list);
void detach_advice(const char *new_name);
+void advise_on_moving_dirty_path(struct string_list *pathspec_list);
#endif /* ADVICE_H */
diff --git a/alias.c b/alias.c
index c471538..5a238f2 100644
--- a/alias.c
+++ b/alias.c
@@ -1,6 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "alias.h"
#include "config.h"
+#include "gettext.h"
+#include "strbuf.h"
#include "string-list.h"
struct config_alias_data {
@@ -9,7 +11,8 @@ struct config_alias_data {
struct string_list *list;
};
-static int config_alias_cb(const char *key, const char *value, void *d)
+static int config_alias_cb(const char *key, const char *value,
+ const struct config_context *ctx UNUSED, void *d)
{
struct config_alias_data *data = d;
const char *p;
@@ -44,16 +47,35 @@ void list_aliases(struct string_list *list)
read_early_config(config_alias_cb, &data);
}
+void quote_cmdline(struct strbuf *buf, const char **argv)
+{
+ for (const char **argp = argv; *argp; argp++) {
+ if (argp != argv)
+ strbuf_addch(buf, ' ');
+ strbuf_addch(buf, '"');
+ for (const char *p = *argp; *p; p++) {
+ const char c = *p;
+
+ if (c == '"' || c =='\\')
+ strbuf_addch(buf, '\\');
+ strbuf_addch(buf, c);
+ }
+ strbuf_addch(buf, '"');
+ }
+}
+
#define SPLIT_CMDLINE_BAD_ENDING 1
#define SPLIT_CMDLINE_UNCLOSED_QUOTE 2
+#define SPLIT_CMDLINE_ARGC_OVERFLOW 3
static const char *split_cmdline_errors[] = {
N_("cmdline ends with \\"),
- N_("unclosed quote")
+ N_("unclosed quote"),
+ N_("too many arguments"),
};
int split_cmdline(char *cmdline, const char ***argv)
{
- int src, dst, count = 0, size = 16;
+ size_t src, dst, count = 0, size = 16;
char quoted = 0;
ALLOC_ARRAY(*argv, size);
@@ -96,6 +118,11 @@ int split_cmdline(char *cmdline, const char ***argv)
return -SPLIT_CMDLINE_UNCLOSED_QUOTE;
}
+ if (count >= INT_MAX) {
+ FREE_AND_NULL(*argv);
+ return -SPLIT_CMDLINE_ARGC_OVERFLOW;
+ }
+
ALLOC_GROW(*argv, count + 1, size);
(*argv)[count] = NULL;
diff --git a/alias.h b/alias.h
index aef4843..43db736 100644
--- a/alias.h
+++ b/alias.h
@@ -1,9 +1,12 @@
#ifndef ALIAS_H
#define ALIAS_H
+struct strbuf;
struct string_list;
char *alias_lookup(const char *alias);
+/* Quote argv so buf can be parsed by split_cmdline() */
+void quote_cmdline(struct strbuf *buf, const char **argv);
int split_cmdline(char *cmdline, const char ***argv);
/* Takes a negative value returned by split_cmdline */
const char *split_cmdline_strerror(int cmdline_errno);
diff --git a/alloc.c b/alloc.c
index 27f697e..377e80f 100644
--- a/alloc.c
+++ b/alloc.c
@@ -8,11 +8,12 @@
* up with maximal alignment because it doesn't know what the object alignment
* for the new allocation is.
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "object.h"
#include "blob.h"
#include "tree.h"
#include "commit.h"
+#include "repository.h"
#include "tag.h"
#include "alloc.h"
diff --git a/apply.c b/apply.c
index 2b7cd93..34f2032 100644
--- a/apply.c
+++ b/apply.c
@@ -7,21 +7,34 @@
*
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "base85.h"
#include "config.h"
-#include "object-store.h"
-#include "blob.h"
+#include "object-store-ll.h"
#include "delta.h"
#include "diff.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "xdiff-interface.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
#include "lockfile.h"
+#include "name-hash.h"
+#include "object-name.h"
+#include "object-file.h"
#include "parse-options.h"
+#include "path.h"
#include "quote.h"
+#include "read-cache.h"
#include "rerere.h"
#include "apply.h"
#include "entry.h"
+#include "setup.h"
+#include "symlinks.h"
+#include "wildmatch.h"
+#include "ws.h"
struct gitdiff_data {
struct strbuf *root;
@@ -64,7 +77,8 @@ static int parse_whitespace_option(struct apply_state *state, const char *option
return 0;
}
/*
- * Please update $__git_whitespacelist in git-completion.bash
+ * Please update $__git_whitespacelist in git-completion.bash,
+ * Documentation/git-apply.txt, and Documentation/git-am.txt
* when you add new options.
*/
return error(_("unrecognized whitespace option '%s'"), option);
@@ -125,7 +139,7 @@ void clear_apply_state(struct apply_state *state)
/* &state->fn_table is cleared at the end of apply_patch() */
}
-static void mute_routine(const char *msg, va_list params)
+static void mute_routine(const char *msg UNUSED, va_list params UNUSED)
{
/* do nothing */
}
@@ -386,11 +400,22 @@ static void say_patch_name(FILE *output, const char *fmt, struct patch *patch)
#define SLOP (16)
+/*
+ * apply.c isn't equipped to handle arbitrarily large patches, because
+ * it intermingles `unsigned long` with `int` for the type used to store
+ * buffer lengths.
+ *
+ * Only process patches that are just shy of 1 GiB large in order to
+ * avoid any truncation or overflow issues.
+ */
+#define MAX_APPLY_SIZE (1024UL * 1024 * 1023)
+
static int read_patch_file(struct strbuf *sb, int fd)
{
if (strbuf_read(sb, fd, 0) < 0)
- return error_errno("git apply: failed to read");
-
+ return error_errno(_("failed to read patch"));
+ else if (sb->len >= MAX_APPLY_SIZE)
+ return error(_("patch too large"));
/*
* Make sure that we have some slop in the buffer
* so that we can do speculative "memcmp" etc, and
@@ -892,9 +917,9 @@ static int parse_traditional_patch(struct apply_state *state,
return 0;
}
-static int gitdiff_hdrend(struct gitdiff_data *state,
- const char *line,
- struct patch *patch)
+static int gitdiff_hdrend(struct gitdiff_data *state UNUSED,
+ const char *line UNUSED,
+ struct patch *patch UNUSED)
{
return 1;
}
@@ -1044,7 +1069,7 @@ static int gitdiff_renamedst(struct gitdiff_data *state,
return 0;
}
-static int gitdiff_similarity(struct gitdiff_data *state,
+static int gitdiff_similarity(struct gitdiff_data *state UNUSED,
const char *line,
struct patch *patch)
{
@@ -1054,7 +1079,7 @@ static int gitdiff_similarity(struct gitdiff_data *state,
return 0;
}
-static int gitdiff_dissimilarity(struct gitdiff_data *state,
+static int gitdiff_dissimilarity(struct gitdiff_data *state UNUSED,
const char *line,
struct patch *patch)
{
@@ -1104,9 +1129,9 @@ static int gitdiff_index(struct gitdiff_data *state,
* This is normal for a diff that doesn't change anything: we'll fall through
* into the next diff. Tell the parser to break out.
*/
-static int gitdiff_unrecognized(struct gitdiff_data *state,
- const char *line,
- struct patch *patch)
+static int gitdiff_unrecognized(struct gitdiff_data *state UNUSED,
+ const char *line UNUSED,
+ struct patch *patch UNUSED)
{
return 1;
}
@@ -1267,8 +1292,15 @@ static char *git_header_name(int p_value,
return NULL; /* no postimage name */
second = skip_tree_prefix(p_value, name + len + 1,
line_len - (len + 1));
+ /*
+ * If we are at the SP at the end of a directory,
+ * skip_tree_prefix() may return NULL as that makes
+ * it appears as if we have an absolute path.
+ * Keep going to find another SP.
+ */
if (!second)
- return NULL;
+ continue;
+
/*
* Does len bytes starting at "name" and "second"
* (that are separated by one HT or SP we just
@@ -2195,7 +2227,8 @@ static void reverse_patches(struct patch *p)
struct fragment *frag = p->fragments;
SWAP(p->new_name, p->old_name);
- SWAP(p->new_mode, p->old_mode);
+ if (p->new_mode)
+ SWAP(p->new_mode, p->old_mode);
SWAP(p->is_new, p->is_delete);
SWAP(p->lines_added, p->lines_deleted);
SWAP(p->old_oid_prefix, p->new_oid_prefix);
@@ -2903,7 +2936,7 @@ static int apply_one_fragment(struct apply_state *state,
break;
case ' ':
if (plen && (ws_rule & WS_BLANK_AT_EOF) &&
- ws_blank_line(patch + 1, plen, ws_rule))
+ ws_blank_line(patch + 1, plen))
is_blank_context = 1;
/* fallthrough */
case '-':
@@ -2932,7 +2965,7 @@ static int apply_one_fragment(struct apply_state *state,
(first == '+' ? 0 : LINE_COMMON));
if (first == '+' &&
(ws_rule & WS_BLANK_AT_EOF) &&
- ws_blank_line(patch + 1, plen, ws_rule))
+ ws_blank_line(patch + 1, plen))
added_blank_line = 1;
break;
case '@': case '\\':
@@ -3191,7 +3224,8 @@ static int apply_binary(struct apply_state *state,
unsigned long size;
char *result;
- result = read_object_file(&oid, &type, &size);
+ result = repo_read_object_file(the_repository, &oid, &type,
+ &size);
if (!result)
return error(_("the necessary postimage %s for "
"'%s' cannot be read"),
@@ -3254,7 +3288,8 @@ static int read_blob_object(struct strbuf *buf, const struct object_id *oid, uns
unsigned long sz;
char *result;
- result = read_object_file(oid, &type, &sz);
+ result = repo_read_object_file(the_repository, oid, &type,
+ &sz);
if (!result)
return -1;
/* XXX read_sha1_file NUL-terminates */
@@ -3482,7 +3517,8 @@ static int resolve_to(struct image *image, const struct object_id *result_id)
clear_image(image);
- image->buf = read_object_file(result_id, &type, &size);
+ image->buf = repo_read_object_file(the_repository, result_id, &type,
+ &size);
if (!image->buf || type != OBJ_BLOB)
die("unable to read blob object %s", oid_to_hex(result_id));
image->len = size;
@@ -3600,7 +3636,7 @@ static int try_threeway(struct apply_state *state,
/* Preimage the patch was prepared for */
if (patch->is_new)
write_object_file("", 0, OBJ_BLOB, &pre_oid);
- else if (get_oid(patch->old_oid_prefix, &pre_oid) ||
+ else if (repo_get_oid(the_repository, patch->old_oid_prefix, &pre_oid) ||
read_blob_object(&buf, &pre_oid, patch->old_mode))
return error(_("repository lacks the necessary blob to perform 3-way merge."));
@@ -3750,8 +3786,17 @@ static int check_preimage(struct apply_state *state,
return error_errno("%s", old_name);
}
- if (!state->cached && !previous)
- st_mode = ce_mode_from_stat(*ce, st->st_mode);
+ if (!state->cached && !previous) {
+ if (*ce && !(*ce)->ce_mode)
+ BUG("ce_mode == 0 for path '%s'", old_name);
+
+ if (trust_executable_bit)
+ st_mode = ce_mode_from_stat(*ce, st->st_mode);
+ else if (*ce)
+ st_mode = (*ce)->ce_mode;
+ else
+ st_mode = patch->old_mode;
+ }
if (patch->is_new < 0)
patch->is_new = 0;
@@ -4095,7 +4140,7 @@ static int preimage_oid_in_gitlink_patch(struct patch *p, struct object_id *oid)
static int build_fake_ancestor(struct apply_state *state, struct patch *list)
{
struct patch *patch;
- struct index_state result = { NULL };
+ struct index_state result = INDEX_STATE_INIT(state->repo);
struct lock_file lock = LOCK_INIT;
int res;
@@ -4117,7 +4162,7 @@ static int build_fake_ancestor(struct apply_state *state, struct patch *list)
else
return error(_("sha1 information is lacking or "
"useless for submodule %s"), name);
- } else if (!get_oid_blob(patch->old_oid_prefix, &oid)) {
+ } else if (!repo_get_oid_blob(the_repository, patch->old_oid_prefix, &oid)) {
; /* ok */
} else if (!patch->lines_added && !patch->lines_deleted) {
/* mode-only change: update the current */
@@ -4403,11 +4448,39 @@ static int create_one_file(struct apply_state *state,
const char *buf,
unsigned long size)
{
+ char *newpath = NULL;
int res;
if (state->cached)
return 0;
+ /*
+ * We already try to detect whether files are beyond a symlink in our
+ * up-front checks. But in the case where symlinks are created by any
+ * of the intermediate hunks it can happen that our up-front checks
+ * didn't yet see the symlink, but at the point of arriving here there
+ * in fact is one. We thus repeat the check for symlinks here.
+ *
+ * Note that this does not make the up-front check obsolete as the
+ * failure mode is different:
+ *
+ * - The up-front checks cause us to abort before we have written
+ * anything into the working directory. So when we exit this way the
+ * working directory remains clean.
+ *
+ * - The checks here happen in the middle of the action where we have
+ * already started to apply the patch. The end result will be a dirty
+ * working directory.
+ *
+ * Ideally, we should update the up-front checks to catch what would
+ * happen when we apply the patch before we damage the working tree.
+ * We have all the information necessary to do so. But for now, as a
+ * part of embargoed security work, having this check would serve as a
+ * reasonable first step.
+ */
+ if (path_is_beyond_symlink(state, path))
+ return error(_("affected file '%s' is beyond a symbolic link"), path);
+
res = try_create_file(state, path, mode, buf, size);
if (res < 0)
return -1;
@@ -4437,24 +4510,26 @@ static int create_one_file(struct apply_state *state,
unsigned int nr = getpid();
for (;;) {
- char newpath[PATH_MAX];
- mksnpath(newpath, sizeof(newpath), "%s~%u", path, nr);
+ newpath = mkpathdup("%s~%u", path, nr);
res = try_create_file(state, newpath, mode, buf, size);
if (res < 0)
- return -1;
+ goto out;
if (!res) {
if (!rename(newpath, path))
- return 0;
+ goto out;
unlink_or_warn(newpath);
break;
}
if (errno != EEXIST)
break;
++nr;
+ FREE_AND_NULL(newpath);
}
}
- return error_errno(_("unable to write file '%s' mode %o"),
- path, mode);
+ res = error_errno(_("unable to write file '%s' mode %o"), path, mode);
+out:
+ free(newpath);
+ return res;
}
static int add_conflicted_stages_file(struct apply_state *state,
@@ -4539,7 +4614,7 @@ static int write_out_one_reject(struct apply_state *state, struct patch *patch)
FILE *rej;
char namebuf[PATH_MAX];
struct fragment *frag;
- int cnt = 0;
+ int fd, cnt = 0;
struct strbuf sb = STRBUF_INIT;
for (cnt = 0, frag = patch->fragments; frag; frag = frag->next) {
@@ -4579,9 +4654,22 @@ static int write_out_one_reject(struct apply_state *state, struct patch *patch)
memcpy(namebuf, patch->new_name, cnt);
memcpy(namebuf + cnt, ".rej", 5);
- rej = fopen(namebuf, "w");
- if (!rej)
- return error_errno(_("cannot open %s"), namebuf);
+ fd = open(namebuf, O_CREAT | O_EXCL | O_WRONLY, 0666);
+ if (fd < 0) {
+ if (errno != EEXIST)
+ return error_errno(_("cannot open %s"), namebuf);
+ if (unlink(namebuf))
+ return error_errno(_("cannot unlink '%s'"), namebuf);
+ fd = open(namebuf, O_CREAT | O_EXCL | O_WRONLY, 0666);
+ if (fd < 0)
+ return error_errno(_("cannot open %s"), namebuf);
+ }
+ rej = fdopen(fd, "w");
+ if (!rej) {
+ error_errno(_("cannot open %s"), namebuf);
+ close(fd);
+ return -1;
+ }
/* Normal git tools never deal with .rej, so do not pretend
* this is a git patch by saying --git or giving extended
diff --git a/apply.h b/apply.h
index b9f18ce..7cd38b1 100644
--- a/apply.h
+++ b/apply.h
@@ -1,7 +1,7 @@
#ifndef APPLY_H
#define APPLY_H
-#include "hash.h"
+#include "hash-ll.h"
#include "lockfile.h"
#include "string-list.h"
#include "strmap.h"
diff --git a/archive-tar.c b/archive-tar.c
index 042feb6..8ae3012 100644
--- a/archive-tar.c
+++ b/archive-tar.c
@@ -1,13 +1,18 @@
/*
* Copyright (c) 2005, 2006 Rene Scharfe
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "gettext.h"
+#include "git-zlib.h"
+#include "hex.h"
#include "tar.h"
#include "archive.h"
-#include "object-store.h"
+#include "object-store-ll.h"
+#include "strbuf.h"
#include "streaming.h"
#include "run-command.h"
+#include "write-or-die.h"
#define RECORDSIZE (512)
#define BLOCKSIZE (RECORDSIZE * 20)
@@ -38,11 +43,18 @@ static int write_tar_filter_archive(const struct archiver *ar,
#define USTAR_MAX_MTIME 077777777777ULL
#endif
+static void tar_write_block(const void *buf)
+{
+ write_or_die(1, buf, BLOCKSIZE);
+}
+
+static void (*write_block)(const void *) = tar_write_block;
+
/* writes out the whole block, but only if it is full */
static void write_if_needed(void)
{
if (offset == BLOCKSIZE) {
- write_or_die(1, block, BLOCKSIZE);
+ write_block(block);
offset = 0;
}
}
@@ -66,7 +78,7 @@ static void do_write_blocked(const void *data, unsigned long size)
write_if_needed();
}
while (size >= BLOCKSIZE) {
- write_or_die(1, buf, BLOCKSIZE);
+ write_block(buf);
size -= BLOCKSIZE;
buf += BLOCKSIZE;
}
@@ -101,10 +113,10 @@ static void write_trailer(void)
{
int tail = BLOCKSIZE - offset;
memset(block + offset, 0, tail);
- write_or_die(1, block, BLOCKSIZE);
+ write_block(block);
if (tail < 2 * RECORDSIZE) {
memset(block, 0, offset);
- write_or_die(1, block, BLOCKSIZE);
+ write_block(block);
}
}
@@ -353,13 +365,14 @@ static struct archiver *find_tar_filter(const char *name, size_t len)
int i;
for (i = 0; i < nr_tar_filters; i++) {
struct archiver *ar = tar_filters[i];
- if (!strncmp(ar->name, name, len) && !ar->name[len])
+ if (!xstrncmpz(ar->name, name, len))
return ar;
}
return NULL;
}
-static int tar_filter_config(const char *var, const char *value, void *data)
+static int tar_filter_config(const char *var, const char *value,
+ void *data UNUSED)
{
struct archiver *ar;
const char *name;
@@ -383,8 +396,8 @@ static int tar_filter_config(const char *var, const char *value, void *data)
if (!strcmp(type, "command")) {
if (!value)
return config_error_nonbool(var);
- free(ar->data);
- ar->data = xstrdup(value);
+ free(ar->filter_command);
+ ar->filter_command = xstrdup(value);
return 0;
}
if (!strcmp(type, "remote")) {
@@ -398,14 +411,15 @@ static int tar_filter_config(const char *var, const char *value, void *data)
return 0;
}
-static int git_tar_config(const char *var, const char *value, void *cb)
+static int git_tar_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(var, "tar.umask")) {
if (value && !strcmp(value, "user")) {
tar_umask = umask(0);
umask(tar_umask);
} else {
- tar_umask = git_config_int(var, value);
+ tar_umask = git_config_int(var, value, ctx->kvi);
}
return 0;
}
@@ -413,7 +427,7 @@ static int git_tar_config(const char *var, const char *value, void *cb)
return tar_filter_config(var, value, cb);
}
-static int write_tar_archive(const struct archiver *ar,
+static int write_tar_archive(const struct archiver *ar UNUSED,
struct archiver_args *args)
{
int err = 0;
@@ -425,23 +439,72 @@ static int write_tar_archive(const struct archiver *ar,
return err;
}
+static git_zstream gzstream;
+static unsigned char outbuf[16384];
+
+static void tgz_deflate(int flush)
+{
+ while (gzstream.avail_in || flush == Z_FINISH) {
+ int status = git_deflate(&gzstream, flush);
+ if (!gzstream.avail_out || status == Z_STREAM_END) {
+ write_or_die(1, outbuf, gzstream.next_out - outbuf);
+ gzstream.next_out = outbuf;
+ gzstream.avail_out = sizeof(outbuf);
+ if (status == Z_STREAM_END)
+ break;
+ }
+ if (status != Z_OK && status != Z_BUF_ERROR)
+ die(_("deflate error (%d)"), status);
+ }
+}
+
+static void tgz_write_block(const void *data)
+{
+ gzstream.next_in = (void *)data;
+ gzstream.avail_in = BLOCKSIZE;
+ tgz_deflate(Z_NO_FLUSH);
+}
+
+static const char internal_gzip_command[] = "git archive gzip";
+
static int write_tar_filter_archive(const struct archiver *ar,
struct archiver_args *args)
{
+#if ZLIB_VERNUM >= 0x1221
+ struct gz_header_s gzhead = { .os = 3 }; /* Unix, for reproducibility */
+#endif
struct strbuf cmd = STRBUF_INIT;
struct child_process filter = CHILD_PROCESS_INIT;
int r;
- if (!ar->data)
+ if (!ar->filter_command)
BUG("tar-filter archiver called with no filter defined");
- strbuf_addstr(&cmd, ar->data);
+ if (!strcmp(ar->filter_command, internal_gzip_command)) {
+ write_block = tgz_write_block;
+ git_deflate_init_gzip(&gzstream, args->compression_level);
+#if ZLIB_VERNUM >= 0x1221
+ if (deflateSetHeader(&gzstream.z, &gzhead) != Z_OK)
+ BUG("deflateSetHeader() called too late");
+#endif
+ gzstream.next_out = outbuf;
+ gzstream.avail_out = sizeof(outbuf);
+
+ r = write_tar_archive(ar, args);
+
+ tgz_deflate(Z_FINISH);
+ git_deflate_end(&gzstream);
+ return r;
+ }
+
+ strbuf_addstr(&cmd, ar->filter_command);
if (args->compression_level >= 0)
strbuf_addf(&cmd, " -%d", args->compression_level);
strvec_push(&filter.args, cmd.buf);
filter.use_shell = 1;
filter.in = -1;
+ filter.silent_exec_failure = 1;
if (start_command(&filter) < 0)
die_errno(_("unable to start '%s' filter"), cmd.buf);
@@ -471,14 +534,14 @@ void init_tar_archiver(void)
int i;
register_archiver(&tar_archiver);
- tar_filter_config("tar.tgz.command", "gzip -cn", NULL);
+ tar_filter_config("tar.tgz.command", internal_gzip_command, NULL);
tar_filter_config("tar.tgz.remote", "true", NULL);
- tar_filter_config("tar.tar.gz.command", "gzip -cn", NULL);
+ tar_filter_config("tar.tar.gz.command", internal_gzip_command, NULL);
tar_filter_config("tar.tar.gz.remote", "true", NULL);
git_config(git_tar_config, NULL);
for (i = 0; i < nr_tar_filters; i++) {
/* omit any filters that never had a command configured */
- if (tar_filters[i]->data)
+ if (tar_filters[i]->filter_command)
register_archiver(tar_filters[i]);
}
}
diff --git a/archive-zip.c b/archive-zip.c
index 9fe43d7..fd1d3f8 100644
--- a/archive-zip.c
+++ b/archive-zip.c
@@ -1,13 +1,18 @@
/*
* Copyright (c) 2006 Rene Scharfe
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "archive.h"
+#include "gettext.h"
+#include "git-zlib.h"
+#include "hex.h"
#include "streaming.h"
#include "utf8.h"
-#include "object-store.h"
+#include "object-store-ll.h"
+#include "strbuf.h"
#include "userdiff.h"
+#include "write-or-die.h"
#include "xdiff-interface.h"
#include "date.h"
@@ -612,12 +617,14 @@ static void dos_time(timestamp_t *timestamp, int *dos_date, int *dos_time)
*dos_time = tm.tm_sec / 2 + tm.tm_min * 32 + tm.tm_hour * 2048;
}
-static int archive_zip_config(const char *var, const char *value, void *data)
+static int archive_zip_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *data UNUSED)
{
return userdiff_config(var, value);
}
-static int write_zip_archive(const struct archiver *ar,
+static int write_zip_archive(const struct archiver *ar UNUSED,
struct archiver_args *args)
{
int err;
diff --git a/archive.c b/archive.c
index d5109ab..5287fcd 100644
--- a/archive.c
+++ b/archive.c
@@ -1,14 +1,23 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
#include "config.h"
+#include "convert.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-name.h"
+#include "path.h"
+#include "pretty.h"
+#include "setup.h"
#include "refs.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "commit.h"
+#include "tree.h"
#include "tree-walk.h"
#include "attr.h"
#include "archive.h"
#include "parse-options.h"
#include "unpack-trees.h"
-#include "dir.h"
#include "quote.h"
static char const * const archive_usage[] = {
@@ -59,7 +68,8 @@ static void format_subst(const struct commit *commit,
strbuf_add(&fmt, b + 8, c - b - 8);
strbuf_add(buf, src, b - src);
- format_commit_message(commit, fmt.buf, buf, ctx);
+ repo_format_commit_message(the_repository, commit, fmt.buf,
+ buf, ctx);
len -= c + 1 - src;
src = c + 1;
}
@@ -84,7 +94,7 @@ static void *object_file_to_archive(const struct archiver_args *args,
(args->tree ? &args->tree->object.oid : NULL), oid);
path += args->baselen;
- buffer = read_object_file(oid, type, sizep);
+ buffer = repo_read_object_file(the_repository, oid, type, sizep);
if (buffer && S_ISREG(mode)) {
struct strbuf buf = STRBUF_INIT;
size_t size = 0;
@@ -166,18 +176,39 @@ static int write_archive_entry(const struct object_id *oid, const char *base,
args->convert = check_attr_export_subst(check);
}
+ if (args->prefix) {
+ static struct strbuf new_path = STRBUF_INIT;
+ static struct strbuf buf = STRBUF_INIT;
+ const char *rel;
+
+ rel = relative_path(path_without_prefix, args->prefix, &buf);
+
+ /*
+ * We don't add an entry for the current working
+ * directory when we are at the root; skip it also when
+ * we're in a subdirectory or submodule. Skip entries
+ * higher up as well.
+ */
+ if (!strcmp(rel, "./") || starts_with(rel, "../"))
+ return S_ISDIR(mode) ? READ_TREE_RECURSIVE : 0;
+
+ /* rel can refer to path, so don't edit it in place */
+ strbuf_reset(&new_path);
+ strbuf_add(&new_path, args->base, args->baselen);
+ strbuf_addstr(&new_path, rel);
+ strbuf_swap(&path, &new_path);
+ }
+
+ if (args->verbose)
+ fprintf(stderr, "%.*s\n", (int)path.len, path.buf);
+
if (S_ISDIR(mode) || S_ISGITLINK(mode)) {
- if (args->verbose)
- fprintf(stderr, "%.*s\n", (int)path.len, path.buf);
err = write_entry(args, oid, path.buf, path.len, mode, NULL, 0);
if (err)
return err;
return (S_ISDIR(mode) ? READ_TREE_RECURSIVE : 0);
}
- if (args->verbose)
- fprintf(stderr, "%.*s\n", (int)path.len, path.buf);
-
/* Stream it? */
if (S_ISREG(mode) && !args->convert &&
oid_object_info(args->repo, oid, &size) == OBJ_BLOB &&
@@ -308,7 +339,8 @@ int write_archive_entries(struct archiver_args *args,
opts.src_index = args->repo->index;
opts.dst_index = args->repo->index;
opts.fn = oneway_merge;
- init_tree_desc(&t, args->tree->buffer, args->tree->size);
+ init_tree_desc(&t, &args->tree->object.oid,
+ args->tree->buffer, args->tree->size);
if (unpack_trees(1, &t, &opts))
return -1;
git_attr_set_direction(GIT_ATTR_INDEX);
@@ -382,7 +414,8 @@ struct path_exists_context {
struct archiver_args *args;
};
-static int reject_entry(const struct object_id *oid, struct strbuf *base,
+static int reject_entry(const struct object_id *oid UNUSED,
+ struct strbuf *base,
const char *filename, unsigned mode,
void *context)
{
@@ -402,6 +435,27 @@ static int reject_entry(const struct object_id *oid, struct strbuf *base,
return ret;
}
+static int reject_outside(const struct object_id *oid UNUSED,
+ struct strbuf *base, const char *filename,
+ unsigned mode, void *context)
+{
+ struct archiver_args *args = context;
+ struct strbuf buf = STRBUF_INIT;
+ struct strbuf path = STRBUF_INIT;
+ int ret = 0;
+
+ if (S_ISDIR(mode))
+ return READ_TREE_RECURSIVE;
+
+ strbuf_addbuf(&path, base);
+ strbuf_addstr(&path, filename);
+ if (starts_with(relative_path(path.buf, args->prefix, &buf), "../"))
+ ret = -1;
+ strbuf_release(&buf);
+ strbuf_release(&path);
+ return ret;
+}
+
static int path_exists(struct archiver_args *args, const char *path)
{
const char *paths[] = { path, NULL };
@@ -409,8 +463,13 @@ static int path_exists(struct archiver_args *args, const char *path)
int ret;
ctx.args = args;
- parse_pathspec(&ctx.pathspec, 0, 0, "", paths);
+ parse_pathspec(&ctx.pathspec, 0, PATHSPEC_PREFER_CWD,
+ args->prefix, paths);
ctx.pathspec.recursive = 1;
+ if (args->prefix && read_tree(args->repo, args->tree, &ctx.pathspec,
+ reject_outside, args))
+ die(_("pathspec '%s' matches files outside the "
+ "current directory"), path);
ret = read_tree(args->repo, args->tree,
&ctx.pathspec,
reject_entry, &ctx);
@@ -426,9 +485,8 @@ static void parse_pathspec_arg(const char **pathspec,
* Also if pathspec patterns are dependent, we're in big
* trouble as we test each one separately
*/
- parse_pathspec(&ar_args->pathspec, 0,
- PATHSPEC_PREFER_FULL,
- "", pathspec);
+ parse_pathspec(&ar_args->pathspec, 0, PATHSPEC_PREFER_CWD,
+ ar_args->prefix, pathspec);
ar_args->pathspec.recursive = 1;
if (pathspec) {
while (*pathspec) {
@@ -440,8 +498,7 @@ static void parse_pathspec_arg(const char **pathspec,
}
static void parse_treeish_arg(const char **argv,
- struct archiver_args *ar_args, const char *prefix,
- int remote)
+ struct archiver_args *ar_args, int remote)
{
const char *name = argv[0];
const struct object_id *commit_oid;
@@ -456,13 +513,14 @@ static void parse_treeish_arg(const char **argv,
const char *colon = strchrnul(name, ':');
int refnamelen = colon - name;
- if (!dwim_ref(name, refnamelen, &oid, &ref, 0))
+ if (!repo_dwim_ref(the_repository, name, refnamelen, &oid, &ref, 0))
die(_("no such ref: %.*s"), refnamelen, name);
} else {
- dwim_ref(name, strlen(name), &oid, &ref, 0);
+ repo_dwim_ref(the_repository, name, strlen(name), &oid, &ref,
+ 0);
}
- if (get_oid(name, &oid))
+ if (repo_get_oid(the_repository, name, &oid))
die(_("not a valid object name: %s"), name);
commit = lookup_commit_reference_gently(ar_args->repo, &oid, 1);
@@ -473,25 +531,13 @@ static void parse_treeish_arg(const char **argv,
commit_oid = NULL;
archive_time = time(NULL);
}
+ if (ar_args->mtime_option)
+ archive_time = approxidate(ar_args->mtime_option);
tree = parse_tree_indirect(&oid);
if (!tree)
die(_("not a tree object: %s"), oid_to_hex(&oid));
- if (prefix) {
- struct object_id tree_oid;
- unsigned short mode;
- int err;
-
- err = get_tree_entry(ar_args->repo,
- &tree->object.oid,
- prefix, &tree_oid,
- &mode);
- if (err || !S_ISDIR(mode))
- die(_("current working directory is untracked"));
-
- tree = parse_tree_indirect(&tree_oid);
- }
ar_args->refname = ref;
ar_args->tree = tree;
ar_args->commit_oid = commit_oid;
@@ -499,7 +545,7 @@ static void parse_treeish_arg(const char **argv,
ar_args->time = archive_time;
}
-static void extra_file_info_clear(void *util, const char *str)
+static void extra_file_info_clear(void *util, const char *str UNUSED)
{
struct extra_file_info *info = util;
free(info->base);
@@ -587,6 +633,7 @@ static int parse_archive_args(int argc, const char **argv,
const char *remote = NULL;
const char *exec = NULL;
const char *output = NULL;
+ const char *mtime_option = NULL;
int compression_level = -1;
int verbose = 0;
int i;
@@ -608,6 +655,9 @@ static int parse_archive_args(int argc, const char **argv,
OPT_BOOL(0, "worktree-attributes", &worktree_attributes,
N_("read .gitattributes in working directory")),
OPT__VERBOSE(&verbose, N_("report archived files on stderr")),
+ { OPTION_STRING, 0, "mtime", &mtime_option, N_("time"),
+ N_("set modification time of archive entries"),
+ PARSE_OPT_NONEG },
OPT_NUMBER_CALLBACK(&compression_level,
N_("set compression level"), number_callback),
OPT_GROUP(""),
@@ -636,6 +686,8 @@ static int parse_archive_args(int argc, const char **argv,
base = "";
if (list) {
+ if (argc)
+ die(_("extra command line parameter '%s'"), *argv);
for (i = 0; i < nr_archivers; i++)
if (!is_remote || archivers[i]->flags & ARCHIVER_REMOTE)
printf("%s\n", archivers[i]->name);
@@ -669,6 +721,7 @@ static int parse_archive_args(int argc, const char **argv,
args->base = base;
args->baselen = strlen(base);
args->worktree_attributes = worktree_attributes;
+ args->mtime_option = mtime_option;
return argc;
}
@@ -704,13 +757,14 @@ int write_archive(int argc, const char **argv, const char *prefix,
setup_git_directory();
}
- parse_treeish_arg(argv, &args, prefix, remote);
+ parse_treeish_arg(argv, &args, remote);
parse_pathspec_arg(argv + 1, &args);
rc = ar->write_archive(ar, &args);
string_list_clear_func(&args.extra_files, extra_file_info_clear);
free(args.refname);
+ clear_pathspec(&args.pathspec);
return rc;
}
diff --git a/archive.h b/archive.h
index 49fab71..bbe65ba 100644
--- a/archive.h
+++ b/archive.h
@@ -1,8 +1,8 @@
#ifndef ARCHIVE_H
#define ARCHIVE_H
-#include "cache.h"
#include "pathspec.h"
+#include "string-list.h"
struct repository;
struct pretty_print_context;
@@ -16,6 +16,7 @@ struct archiver_args {
struct tree *tree;
const struct object_id *commit_oid;
const struct commit *commit;
+ const char *mtime_option;
timestamp_t time;
struct pathspec pathspec;
unsigned int verbose : 1;
@@ -43,7 +44,7 @@ struct archiver {
const char *name;
int (*write_archive)(const struct archiver *, struct archiver_args *);
unsigned flags;
- void *data;
+ char *filter_command;
};
void register_archiver(struct archiver *);
diff --git a/attr.c b/attr.c
index 21e4ad2..679e422 100644
--- a/attr.c
+++ b/attr.c
@@ -6,14 +6,26 @@
* an insanely large number of attributes.
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "environment.h"
#include "exec-cmd.h"
#include "attr.h"
#include "dir.h"
+#include "gettext.h"
+#include "path.h"
#include "utf8.h"
#include "quote.h"
+#include "read-cache-ll.h"
+#include "refs.h"
+#include "revision.h"
+#include "object-store-ll.h"
+#include "setup.h"
#include "thread-utils.h"
+#include "tree-walk.h"
+#include "object-name.h"
+
+const char *git_attr_tree;
const char git_attr__true[] = "(builtin)true";
const char git_attr__false[] = "\0(builtin)false";
@@ -23,12 +35,8 @@ static const char git_attr__unknown[] = "(builtin)unknown";
#define ATTR__UNSET NULL
#define ATTR__UNKNOWN git_attr__unknown
-#ifndef DEBUG_ATTR
-#define DEBUG_ATTR 0
-#endif
-
struct git_attr {
- int attr_nr; /* unique attribute number */
+ unsigned int attr_nr; /* unique attribute number */
char name[FLEX_ARRAY]; /* attribute name */
};
@@ -61,10 +69,10 @@ struct attr_hash_entry {
};
/* attr_hashmap comparison function */
-static int attr_hash_entry_cmp(const void *unused_cmp_data,
+static int attr_hash_entry_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
- const void *unused_keydata)
+ const void *keydata UNUSED)
{
const struct attr_hash_entry *a, *b;
@@ -176,6 +184,15 @@ static void all_attrs_init(struct attr_hashmap *map, struct attr_check *check)
}
}
+/*
+ * Atribute name cannot begin with "builtin_" which
+ * is a reserved namespace for built in attributes values.
+ */
+static int attr_name_reserved(const char *name)
+{
+ return starts_with(name, "builtin_");
+}
+
static int attr_name_valid(const char *name, size_t namelen)
{
/*
@@ -210,7 +227,7 @@ static void report_invalid_attr(const char *name, size_t len,
* dictionary. If no entry is found, create a new attribute and store it in
* the dictionary.
*/
-static const struct git_attr *git_attr_internal(const char *name, int namelen)
+static const struct git_attr *git_attr_internal(const char *name, size_t namelen)
{
struct git_attr *a;
@@ -226,8 +243,8 @@ static const struct git_attr *git_attr_internal(const char *name, int namelen)
a->attr_nr = hashmap_get_size(&g_attr_hashmap.map);
attr_hashmap_add(&g_attr_hashmap, a->name, namelen, a);
- assert(a->attr_nr ==
- (hashmap_get_size(&g_attr_hashmap.map) - 1));
+ if (a->attr_nr != hashmap_get_size(&g_attr_hashmap.map) - 1)
+ die(_("unable to add additional attribute"));
}
hashmap_unlock(&g_attr_hashmap);
@@ -272,7 +289,7 @@ struct match_attr {
const struct git_attr *attr;
} u;
char is_macro;
- unsigned num_attr;
+ size_t num_attr;
struct attr_state state[FLEX_ARRAY];
};
@@ -293,7 +310,7 @@ static const char *parse_attr(const char *src, int lineno, const char *cp,
struct attr_state *e)
{
const char *ep, *equals;
- int len;
+ size_t len;
ep = cp + strcspn(cp, blank);
equals = strchr(cp, '=');
@@ -308,7 +325,7 @@ static const char *parse_attr(const char *src, int lineno, const char *cp,
cp++;
len--;
}
- if (!attr_name_valid(cp, len)) {
+ if (!attr_name_valid(cp, len) || attr_name_reserved(cp)) {
report_invalid_attr(cp, len, src, lineno);
return NULL;
}
@@ -337,8 +354,7 @@ static const char *parse_attr(const char *src, int lineno, const char *cp,
static struct match_attr *parse_attr_line(const char *line, const char *src,
int lineno, unsigned flags)
{
- int namelen;
- int num_attr, i;
+ size_t namelen, num_attr, i;
const char *cp, *name, *states;
struct match_attr *res = NULL;
int is_macro;
@@ -349,6 +365,11 @@ static struct match_attr *parse_attr_line(const char *line, const char *src,
return NULL;
name = cp;
+ if (strlen(line) >= ATTR_MAX_LINE_LENGTH) {
+ warning(_("ignoring overly long attributes line %d"), lineno);
+ return NULL;
+ }
+
if (*cp == '"' && !unquote_c_style(&pattern, name, &states)) {
name = pattern.buf;
namelen = pattern.len;
@@ -368,7 +389,7 @@ static struct match_attr *parse_attr_line(const char *line, const char *src,
name += strlen(ATTRIBUTE_MACRO_PREFIX);
name += strspn(name, blank);
namelen = strcspn(name, blank);
- if (!attr_name_valid(name, namelen)) {
+ if (!attr_name_valid(name, namelen) || attr_name_reserved(name)) {
report_invalid_attr(name, namelen, src, lineno);
goto fail_return;
}
@@ -385,10 +406,9 @@ static struct match_attr *parse_attr_line(const char *line, const char *src,
goto fail_return;
}
- res = xcalloc(1,
- sizeof(*res) +
- sizeof(struct attr_state) * num_attr +
- (is_macro ? 0 : namelen + 1));
+ res = xcalloc(1, st_add3(sizeof(*res),
+ st_mult(sizeof(struct attr_state), num_attr),
+ is_macro ? 0 : namelen + 1));
if (is_macro) {
res->u.attr = git_attr_internal(name, namelen);
} else {
@@ -451,11 +471,12 @@ struct attr_stack {
static void attr_stack_free(struct attr_stack *e)
{
- int i;
+ unsigned i;
free(e->origin);
for (i = 0; i < e->num_matches; i++) {
struct match_attr *a = e->attrs[i];
- int j;
+ size_t j;
+
for (j = 0; j < a->num_attr; j++) {
const char *setto = a->state[j].setto;
if (setto == ATTR__TRUE ||
@@ -603,8 +624,7 @@ struct attr_check *attr_check_dup(const struct attr_check *check)
ret->nr = check->nr;
ret->alloc = check->alloc;
- ALLOC_ARRAY(ret->items, ret->nr);
- COPY_ARRAY(ret->items, check->items, ret->nr);
+ DUP_ARRAY(ret->items, check->items, ret->nr);
return ret;
}
@@ -664,8 +684,8 @@ static void handle_attr_line(struct attr_stack *res,
a = parse_attr_line(line, src, lineno, flags);
if (!a)
return;
- ALLOC_GROW(res->attrs, res->num_matches + 1, res->alloc);
- res->attrs[res->num_matches++] = a;
+ ALLOC_GROW_BY(res->attrs, res->num_matches, 1, res->alloc);
+ res->attrs[res->num_matches - 1] = a;
}
static struct attr_stack *read_attr_from_array(const char **list)
@@ -705,11 +725,12 @@ void git_attr_set_direction(enum git_attr_direction new_direction)
static struct attr_stack *read_attr_from_file(const char *path, unsigned flags)
{
+ struct strbuf buf = STRBUF_INIT;
int fd;
FILE *fp;
struct attr_stack *res;
- char buf[2048];
int lineno = 0;
+ struct stat st;
if (flags & READ_ATTR_NOFOLLOW)
fd = open_nofollow(path, O_RDONLY);
@@ -721,49 +742,41 @@ static struct attr_stack *read_attr_from_file(const char *path, unsigned flags)
return NULL;
}
fp = xfdopen(fd, "r");
+ if (fstat(fd, &st)) {
+ warning_errno(_("cannot fstat gitattributes file '%s'"), path);
+ fclose(fp);
+ return NULL;
+ }
+ if (st.st_size >= ATTR_MAX_FILE_SIZE) {
+ warning(_("ignoring overly large gitattributes file '%s'"), path);
+ fclose(fp);
+ return NULL;
+ }
CALLOC_ARRAY(res, 1);
- while (fgets(buf, sizeof(buf), fp)) {
- char *bufp = buf;
- if (!lineno)
- skip_utf8_bom(&bufp, strlen(bufp));
- handle_attr_line(res, bufp, path, ++lineno, flags);
+ while (strbuf_getline(&buf, fp) != EOF) {
+ if (!lineno && starts_with(buf.buf, utf8_bom))
+ strbuf_remove(&buf, 0, strlen(utf8_bom));
+ handle_attr_line(res, buf.buf, path, ++lineno, flags);
}
+
fclose(fp);
+ strbuf_release(&buf);
return res;
}
-static struct attr_stack *read_attr_from_index(struct index_state *istate,
- const char *path,
- unsigned flags)
+static struct attr_stack *read_attr_from_buf(char *buf, const char *path,
+ unsigned flags)
{
struct attr_stack *res;
- char *buf, *sp;
+ char *sp;
int lineno = 0;
- if (!istate)
- return NULL;
-
- /*
- * The .gitattributes file only applies to files within its
- * parent directory. In the case of cone-mode sparse-checkout,
- * the .gitattributes file is sparse if and only if all paths
- * within that directory are also sparse. Thus, don't load the
- * .gitattributes file since it will not matter.
- *
- * In the case of a sparse index, it is critical that we don't go
- * looking for a .gitattributes file, as doing so would cause the
- * index to expand.
- */
- if (!path_in_cone_mode_sparse_checkout(path, istate))
- return NULL;
-
- buf = read_blob_data_from_index(istate, path, NULL);
if (!buf)
return NULL;
CALLOC_ARRAY(res, 1);
- for (sp = buf; *sp; ) {
+ for (sp = buf; *sp;) {
char *ep;
int more;
@@ -774,16 +787,100 @@ static struct attr_stack *read_attr_from_index(struct index_state *istate,
sp = ep + more;
}
free(buf);
+
return res;
}
+static struct attr_stack *read_attr_from_blob(struct index_state *istate,
+ const struct object_id *tree_oid,
+ const char *path, unsigned flags)
+{
+ struct object_id oid;
+ unsigned long sz;
+ enum object_type type;
+ void *buf;
+ unsigned short mode;
+
+ if (!tree_oid)
+ return NULL;
+
+ if (get_tree_entry(istate->repo, tree_oid, path, &oid, &mode))
+ return NULL;
+
+ buf = repo_read_object_file(istate->repo, &oid, &type, &sz);
+ if (!buf || type != OBJ_BLOB) {
+ free(buf);
+ return NULL;
+ }
+
+ return read_attr_from_buf(buf, path, flags);
+}
+
+static struct attr_stack *read_attr_from_index(struct index_state *istate,
+ const char *path, unsigned flags)
+{
+ struct attr_stack *stack = NULL;
+ char *buf;
+ unsigned long size;
+ int sparse_dir_pos = -1;
+
+ if (!istate)
+ return NULL;
+
+ /*
+ * When handling sparse-checkouts, .gitattributes files
+ * may reside within a sparse directory. We distinguish
+ * whether a path exists directly in the index or not by
+ * evaluating if 'pos' is negative.
+ * If 'pos' is negative, the path is not directly present
+ * in the index and is likely within a sparse directory.
+ * For paths not in the index, The absolute value of 'pos'
+ * minus 1 gives us the position where the path would be
+ * inserted in lexicographic order within the index.
+ * We then subtract another 1 from this value
+ * (sparse_dir_pos = -pos - 2) to find the position of the
+ * last index entry which is lexicographically smaller than
+ * the path. This would be the sparse directory containing
+ * the path. By identifying the sparse directory containing
+ * the path, we can correctly read the attributes specified
+ * in the .gitattributes file from the tree object of the
+ * sparse directory.
+ */
+ if (!path_in_cone_mode_sparse_checkout(path, istate)) {
+ int pos = index_name_pos_sparse(istate, path, strlen(path));
+
+ if (pos < 0)
+ sparse_dir_pos = -pos - 2;
+ }
+
+ if (sparse_dir_pos >= 0 &&
+ S_ISSPARSEDIR(istate->cache[sparse_dir_pos]->ce_mode) &&
+ !strncmp(istate->cache[sparse_dir_pos]->name, path, ce_namelen(istate->cache[sparse_dir_pos]))) {
+ const char *relative_path = path + ce_namelen(istate->cache[sparse_dir_pos]);
+ stack = read_attr_from_blob(istate, &istate->cache[sparse_dir_pos]->oid, relative_path, flags);
+ } else {
+ buf = read_blob_data_from_index(istate, path, &size);
+ if (!buf)
+ return NULL;
+ if (size >= ATTR_MAX_FILE_SIZE) {
+ warning(_("ignoring overly large gitattributes blob '%s'"), path);
+ return NULL;
+ }
+ stack = read_attr_from_buf(buf, path, flags);
+ }
+ return stack;
+}
+
static struct attr_stack *read_attr(struct index_state *istate,
+ const struct object_id *tree_oid,
const char *path, unsigned flags)
{
struct attr_stack *res = NULL;
if (direction == GIT_ATTR_INDEX) {
res = read_attr_from_index(istate, path, flags);
+ } else if (tree_oid) {
+ res = read_attr_from_blob(istate, tree_oid, path, flags);
} else if (!is_bare_repository()) {
if (direction == GIT_ATTR_CHECKOUT) {
res = read_attr_from_index(istate, path, flags);
@@ -807,34 +904,7 @@ static struct attr_stack *read_attr(struct index_state *istate,
return res;
}
-#if DEBUG_ATTR
-static void debug_info(const char *what, struct attr_stack *elem)
-{
- fprintf(stderr, "%s: %s\n", what, elem->origin ? elem->origin : "()");
-}
-static void debug_set(const char *what, const char *match, struct git_attr *attr, const void *v)
-{
- const char *value = v;
-
- if (ATTR_TRUE(value))
- value = "set";
- else if (ATTR_FALSE(value))
- value = "unset";
- else if (ATTR_UNSET(value))
- value = "unspecified";
-
- fprintf(stderr, "%s: %s => %s (%s)\n",
- what, attr->name, (char *) value, match);
-}
-#define debug_push(a) debug_info("push", (a))
-#define debug_pop(a) debug_info("pop", (a))
-#else
-#define debug_push(a) do { ; } while (0)
-#define debug_pop(a) do { ; } while (0)
-#define debug_set(a,b,c,d) do { ; } while (0)
-#endif /* DEBUG_ATTR */
-
-static const char *git_etc_gitattributes(void)
+const char *git_attr_system_file(void)
{
static const char *system_wide;
if (!system_wide)
@@ -842,7 +912,7 @@ static const char *git_etc_gitattributes(void)
return system_wide;
}
-static const char *get_home_gitattributes(void)
+const char *git_attr_global_file(void)
{
if (!git_attributes_file)
git_attributes_file = xdg_config_home("attributes");
@@ -850,7 +920,7 @@ static const char *get_home_gitattributes(void)
return git_attributes_file;
}
-static int git_attr_system(void)
+int git_attr_system_is_enabled(void)
{
return !git_env_bool("GIT_ATTR_NOSYSTEM", 0);
}
@@ -870,6 +940,7 @@ static void push_stack(struct attr_stack **attr_stack_p,
}
static void bootstrap_attr_stack(struct index_state *istate,
+ const struct object_id *tree_oid,
struct attr_stack **stack)
{
struct attr_stack *e;
@@ -883,19 +954,19 @@ static void bootstrap_attr_stack(struct index_state *istate,
push_stack(stack, e, NULL, 0);
/* system-wide frame */
- if (git_attr_system()) {
- e = read_attr_from_file(git_etc_gitattributes(), flags);
+ if (git_attr_system_is_enabled()) {
+ e = read_attr_from_file(git_attr_system_file(), flags);
push_stack(stack, e, NULL, 0);
}
/* home directory */
- if (get_home_gitattributes()) {
- e = read_attr_from_file(get_home_gitattributes(), flags);
+ if (git_attr_global_file()) {
+ e = read_attr_from_file(git_attr_global_file(), flags);
push_stack(stack, e, NULL, 0);
}
/* root directory */
- e = read_attr(istate, GITATTRIBUTES_FILE, flags | READ_ATTR_NOFOLLOW);
+ e = read_attr(istate, tree_oid, GITATTRIBUTES_FILE, flags | READ_ATTR_NOFOLLOW);
push_stack(stack, e, xstrdup(""), 0);
/* info frame */
@@ -909,6 +980,7 @@ static void bootstrap_attr_stack(struct index_state *istate,
}
static void prepare_attr_stack(struct index_state *istate,
+ const struct object_id *tree_oid,
const char *path, int dirlen,
struct attr_stack **stack)
{
@@ -930,7 +1002,7 @@ static void prepare_attr_stack(struct index_state *istate,
* .gitattributes in deeper directories to shallower ones,
* and finally use the built-in set as the default.
*/
- bootstrap_attr_stack(istate, stack);
+ bootstrap_attr_stack(istate, tree_oid, stack);
/*
* Pop the "info" one that is always at the top of the stack.
@@ -954,7 +1026,6 @@ static void prepare_attr_stack(struct index_state *istate,
(!namelen || path[namelen] == '/'))
break;
- debug_pop(elem);
*stack = elem->prev;
attr_stack_free(elem);
}
@@ -986,7 +1057,7 @@ static void prepare_attr_stack(struct index_state *istate,
strbuf_add(&pathbuf, path + pathbuf.len, (len - pathbuf.len));
strbuf_addf(&pathbuf, "/%s", GITATTRIBUTES_FILE);
- next = read_attr(istate, pathbuf.buf, READ_ATTR_NOFOLLOW);
+ next = read_attr(istate, tree_oid, pathbuf.buf, READ_ATTR_NOFOLLOW);
/* reset the pathbuf to not include "/.gitattributes" */
strbuf_setlen(&pathbuf, len);
@@ -1023,25 +1094,22 @@ static int path_matches(const char *pathname, int pathlen,
}
return match_pathname(pathname, pathlen - isdir,
base, baselen,
- pattern, prefix, pat->patternlen, pat->flags);
+ pattern, prefix, pat->patternlen);
}
static int macroexpand_one(struct all_attrs_item *all_attrs, int nr, int rem);
-static int fill_one(const char *what, struct all_attrs_item *all_attrs,
+static int fill_one(struct all_attrs_item *all_attrs,
const struct match_attr *a, int rem)
{
- int i;
+ size_t i;
- for (i = a->num_attr - 1; rem > 0 && i >= 0; i--) {
- const struct git_attr *attr = a->state[i].attr;
+ for (i = a->num_attr; rem > 0 && i > 0; i--) {
+ const struct git_attr *attr = a->state[i - 1].attr;
const char **n = &(all_attrs[attr->attr_nr].value);
- const char *v = a->state[i].setto;
+ const char *v = a->state[i - 1].setto;
if (*n == ATTR__UNKNOWN) {
- debug_set(what,
- a->is_macro ? a->u.attr->name : a->u.pat.pattern,
- attr, v);
*n = v;
rem--;
rem = macroexpand_one(all_attrs, attr->attr_nr, rem);
@@ -1055,16 +1123,16 @@ static int fill(const char *path, int pathlen, int basename_offset,
struct all_attrs_item *all_attrs, int rem)
{
for (; rem > 0 && stack; stack = stack->prev) {
- int i;
+ unsigned i;
const char *base = stack->origin ? stack->origin : "";
- for (i = stack->num_matches - 1; 0 < rem && 0 <= i; i--) {
- const struct match_attr *a = stack->attrs[i];
+ for (i = stack->num_matches; 0 < rem && 0 < i; i--) {
+ const struct match_attr *a = stack->attrs[i - 1];
if (a->is_macro)
continue;
if (path_matches(path, pathlen, basename_offset,
&a->u.pat, base, stack->originlen))
- rem = fill_one("fill", all_attrs, a, rem);
+ rem = fill_one(all_attrs, a, rem);
}
}
@@ -1076,7 +1144,7 @@ static int macroexpand_one(struct all_attrs_item *all_attrs, int nr, int rem)
const struct all_attrs_item *item = &all_attrs[nr];
if (item->macro && item->value == ATTR__TRUE)
- return fill_one("expand", all_attrs, item->macro, rem);
+ return fill_one(all_attrs, item->macro, rem);
else
return rem;
}
@@ -1090,11 +1158,11 @@ static void determine_macros(struct all_attrs_item *all_attrs,
const struct attr_stack *stack)
{
for (; stack; stack = stack->prev) {
- int i;
- for (i = stack->num_matches - 1; i >= 0; i--) {
- const struct match_attr *ma = stack->attrs[i];
+ unsigned i;
+ for (i = stack->num_matches; i > 0; i--) {
+ const struct match_attr *ma = stack->attrs[i - 1];
if (ma->is_macro) {
- int n = ma->u.attr->attr_nr;
+ unsigned int n = ma->u.attr->attr_nr;
if (!all_attrs[n].macro) {
all_attrs[n].macro = ma;
}
@@ -1109,8 +1177,8 @@ static void determine_macros(struct all_attrs_item *all_attrs,
* Otherwise all attributes are collected.
*/
static void collect_some_attrs(struct index_state *istate,
- const char *path,
- struct attr_check *check)
+ const struct object_id *tree_oid,
+ const char *path, struct attr_check *check)
{
int pathlen, rem, dirlen;
const char *cp, *last_slash = NULL;
@@ -1129,7 +1197,7 @@ static void collect_some_attrs(struct index_state *istate,
dirlen = 0;
}
- prepare_attr_stack(istate, path, dirlen, &check->stack);
+ prepare_attr_stack(istate, tree_oid, path, dirlen, &check->stack);
all_attrs_init(&g_attr_hashmap, check);
determine_macros(check->all_attrs, check->stack);
@@ -1137,19 +1205,144 @@ static void collect_some_attrs(struct index_state *istate,
fill(path, pathlen, basename_offset, check->stack, check->all_attrs, rem);
}
+static const char *default_attr_source_tree_object_name;
+static int ignore_bad_attr_tree;
+
+void set_git_attr_source(const char *tree_object_name)
+{
+ default_attr_source_tree_object_name = xstrdup(tree_object_name);
+}
+
+static void compute_default_attr_source(struct object_id *attr_source)
+{
+ if (!default_attr_source_tree_object_name)
+ default_attr_source_tree_object_name = getenv(GIT_ATTR_SOURCE_ENVIRONMENT);
+
+ if (!default_attr_source_tree_object_name && git_attr_tree) {
+ default_attr_source_tree_object_name = git_attr_tree;
+ ignore_bad_attr_tree = 1;
+ }
+
+ if (!default_attr_source_tree_object_name &&
+ startup_info->have_repository &&
+ is_bare_repository()) {
+ default_attr_source_tree_object_name = "HEAD";
+ ignore_bad_attr_tree = 1;
+ }
+
+ if (!default_attr_source_tree_object_name || !is_null_oid(attr_source))
+ return;
+
+ if (repo_get_oid_treeish(the_repository,
+ default_attr_source_tree_object_name,
+ attr_source) && !ignore_bad_attr_tree)
+ die(_("bad --attr-source or GIT_ATTR_SOURCE"));
+}
+
+static struct object_id *default_attr_source(void)
+{
+ static struct object_id attr_source;
+
+ if (is_null_oid(&attr_source))
+ compute_default_attr_source(&attr_source);
+ if (is_null_oid(&attr_source))
+ return NULL;
+ return &attr_source;
+}
+
+static const char *interned_mode_string(unsigned int mode)
+{
+ static struct {
+ unsigned int val;
+ char str[7];
+ } mode_string[] = {
+ { .val = 0040000 },
+ { .val = 0100644 },
+ { .val = 0100755 },
+ { .val = 0120000 },
+ { .val = 0160000 },
+ };
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(mode_string); i++) {
+ if (mode_string[i].val != mode)
+ continue;
+ if (!*mode_string[i].str)
+ snprintf(mode_string[i].str, sizeof(mode_string[i].str),
+ "%06o", mode);
+ return mode_string[i].str;
+ }
+ BUG("Unsupported mode 0%o", mode);
+}
+
+static const char *builtin_object_mode_attr(struct index_state *istate, const char *path)
+{
+ unsigned int mode;
+
+ if (direction == GIT_ATTR_CHECKIN) {
+ struct object_id oid;
+ struct stat st;
+ if (lstat(path, &st))
+ die_errno(_("unable to stat '%s'"), path);
+ mode = canon_mode(st.st_mode);
+ if (S_ISDIR(mode)) {
+ /*
+ *`path` is either a directory or it is a submodule,
+ * in which case it is already indexed as submodule
+ * or it does not exist in the index yet and we need to
+ * check if we can resolve to a ref.
+ */
+ int pos = index_name_pos(istate, path, strlen(path));
+ if (pos >= 0) {
+ if (S_ISGITLINK(istate->cache[pos]->ce_mode))
+ mode = istate->cache[pos]->ce_mode;
+ } else if (resolve_gitlink_ref(path, "HEAD", &oid) == 0) {
+ mode = S_IFGITLINK;
+ }
+ }
+ } else {
+ /*
+ * For GIT_ATTR_CHECKOUT and GIT_ATTR_INDEX we only check
+ * for mode in the index.
+ */
+ int pos = index_name_pos(istate, path, strlen(path));
+ if (pos >= 0)
+ mode = istate->cache[pos]->ce_mode;
+ else
+ return ATTR__UNSET;
+ }
+
+ return interned_mode_string(mode);
+}
+
+
+static const char *compute_builtin_attr(struct index_state *istate,
+ const char *path,
+ const struct git_attr *attr) {
+ static const struct git_attr *object_mode_attr;
+
+ if (!object_mode_attr)
+ object_mode_attr = git_attr("builtin_objectmode");
+
+ if (attr == object_mode_attr)
+ return builtin_object_mode_attr(istate, path);
+ return ATTR__UNSET;
+}
+
void git_check_attr(struct index_state *istate,
const char *path,
struct attr_check *check)
{
int i;
+ const struct object_id *tree_oid = default_attr_source();
- collect_some_attrs(istate, path, check);
+ collect_some_attrs(istate, tree_oid, path, check);
for (i = 0; i < check->nr; i++) {
- size_t n = check->items[i].attr->attr_nr;
+ unsigned int n = check->items[i].attr->attr_nr;
const char *value = check->all_attrs[n].value;
if (value == ATTR__UNKNOWN)
- value = ATTR__UNSET;
+ value = compute_builtin_attr(istate, path, check->all_attrs[n].attr);
check->items[i].value = value;
}
}
@@ -1158,9 +1351,10 @@ void git_all_attrs(struct index_state *istate,
const char *path, struct attr_check *check)
{
int i;
+ const struct object_id *tree_oid = default_attr_source();
attr_check_reset(check);
- collect_some_attrs(istate, path, check);
+ collect_some_attrs(istate, tree_oid, path, check);
for (i = 0; i < check->all_attrs_nr; i++) {
const char *name = check->all_attrs[i].attr->name;
diff --git a/attr.h b/attr.h
index 3fb40cc..127998a 100644
--- a/attr.h
+++ b/attr.h
@@ -45,7 +45,7 @@
* const char *path;
*
* setup_check();
- * git_check_attr(path, check);
+ * git_check_attr(&the_index, path, check);
* ------------
*
* - Act on `.value` member of the result, left in `check->items[]`:
@@ -107,6 +107,18 @@
* - Free the `attr_check` struct by calling `attr_check_free()`.
*/
+/**
+ * The maximum line length for a gitattributes file. If the line exceeds this
+ * length we will ignore it.
+ */
+#define ATTR_MAX_LINE_LENGTH 2048
+
+ /**
+ * The maximum size of the giattributes file. If the file exceeds this size we
+ * will ignore it.
+ */
+#define ATTR_MAX_FILE_SIZE (100 * 1024 * 1024)
+
struct index_state;
/**
@@ -123,6 +135,12 @@ struct all_attrs_item;
struct attr_stack;
/*
+ * The textual object name for the tree-ish used by git_check_attr()
+ * to read attributes from (instead of from the working tree).
+ */
+void set_git_attr_source(const char *);
+
+/*
* Given a string, return the gitattribute object that
* corresponds to it.
*/
@@ -190,7 +208,8 @@ void attr_check_free(struct attr_check *check);
const char *git_attr_name(const struct git_attr *);
void git_check_attr(struct index_state *istate,
- const char *path, struct attr_check *check);
+ const char *path,
+ struct attr_check *check);
/*
* Retrieve all attributes that apply to the specified path.
@@ -208,4 +227,15 @@ void git_attr_set_direction(enum git_attr_direction new_direction);
void attr_start(void);
+/* Return the system gitattributes file. */
+const char *git_attr_system_file(void);
+
+/* Return the global gitattributes file, if any. */
+const char *git_attr_global_file(void);
+
+/* Return whether the system gitattributes file is enabled and should be used. */
+int git_attr_system_is_enabled(void);
+
+extern const char *git_attr_tree;
+
#endif /* ATTR_H */
diff --git a/banned.h b/banned.h
index 6ccf46b..44e76bd 100644
--- a/banned.h
+++ b/banned.h
@@ -18,6 +18,10 @@
#define strncpy(x,y,n) BANNED(strncpy)
#undef strncat
#define strncat(x,y,n) BANNED(strncat)
+#undef strtok
+#define strtok(x,y) BANNED(strtok)
+#undef strtok_r
+#define strtok_r(x,y,z) BANNED(strtok_r)
#undef sprintf
#undef vsprintf
diff --git a/base85.c b/base85.c
index 5ca601e..bbacdca 100644
--- a/base85.c
+++ b/base85.c
@@ -1,4 +1,5 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "base85.h"
#undef DEBUG_85
diff --git a/base85.h b/base85.h
new file mode 100644
index 0000000..c835086
--- /dev/null
+++ b/base85.h
@@ -0,0 +1,7 @@
+#ifndef BASE85_H
+#define BASE85_H
+
+int decode_85(char *dst, const char *line, int linelen);
+void encode_85(char *buf, const unsigned char *data, int bytes);
+
+#endif /* BASE85_H */
diff --git a/bisect.c b/bisect.c
index b63669c..60aae2f 100644
--- a/bisect.c
+++ b/bisect.c
@@ -1,12 +1,14 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "commit.h"
#include "diff.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "revision.h"
#include "refs.h"
#include "list-objects.h"
#include "quote.h"
-#include "hash-lookup.h"
#include "run-command.h"
#include "log-tree.h"
#include "bisect.h"
@@ -14,7 +16,9 @@
#include "strvec.h"
#include "commit-slab.h"
#include "commit-reach.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "path.h"
#include "dir.h"
static struct oid_array good_revs;
@@ -22,8 +26,6 @@ static struct oid_array skipped_revs;
static struct object_id *current_bad_oid;
-static const char *argv_checkout[] = {"checkout", "-q", NULL, "--", NULL};
-
static const char *term_bad;
static const char *term_good;
@@ -150,11 +152,15 @@ static void show_list(const char *debug, int counted, int nr,
unsigned commit_flags = commit->object.flags;
enum object_type type;
unsigned long size;
- char *buf = read_object_file(&commit->object.oid, &type,
- &size);
+ char *buf = repo_read_object_file(the_repository,
+ &commit->object.oid, &type,
+ &size);
const char *subject_start;
int subject_len;
+ if (!buf)
+ die(_("unable to read %s"), oid_to_hex(&commit->object.oid));
+
fprintf(stderr, "%c%c%c ",
(commit_flags & TREESAME) ? ' ' : 'T',
(commit_flags & UNINTERESTING) ? 'U' : ' ',
@@ -441,7 +447,7 @@ void find_bisection(struct commit_list **commit_list, int *reaches,
}
static int register_ref(const char *refname, const struct object_id *oid,
- int flags, void *cb_data)
+ int flags UNUSED, void *cb_data UNUSED)
{
struct strbuf good_prefix = STRBUF_INIT;
strbuf_addstr(&good_prefix, term_good);
@@ -467,14 +473,12 @@ static int read_bisect_refs(void)
}
static GIT_PATH_FUNC(git_path_bisect_names, "BISECT_NAMES")
-static GIT_PATH_FUNC(git_path_bisect_expected_rev, "BISECT_EXPECTED_REV")
static GIT_PATH_FUNC(git_path_bisect_ancestors_ok, "BISECT_ANCESTORS_OK")
static GIT_PATH_FUNC(git_path_bisect_run, "BISECT_RUN")
static GIT_PATH_FUNC(git_path_bisect_start, "BISECT_START")
static GIT_PATH_FUNC(git_path_bisect_log, "BISECT_LOG")
static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
static GIT_PATH_FUNC(git_path_bisect_first_parent, "BISECT_FIRST_PARENT")
-static GIT_PATH_FUNC(git_path_head_name, "head-name")
static void read_bisect_paths(struct strvec *array)
{
@@ -648,11 +652,14 @@ static struct commit_list *managed_skipped(struct commit_list *list,
}
static void bisect_rev_setup(struct repository *r, struct rev_info *revs,
+ struct strvec *rev_argv,
const char *prefix,
const char *bad_format, const char *good_format,
int read_paths)
{
- struct strvec rev_argv = STRVEC_INIT;
+ struct setup_revision_opt opt = {
+ .free_removed_argv_elements = 1,
+ };
int i;
repo_init_revisions(r, revs, prefix);
@@ -660,17 +667,16 @@ static void bisect_rev_setup(struct repository *r, struct rev_info *revs,
revs->commit_format = CMIT_FMT_UNSPECIFIED;
/* rev_argv.argv[0] will be ignored by setup_revisions */
- strvec_push(&rev_argv, "bisect_rev_setup");
- strvec_pushf(&rev_argv, bad_format, oid_to_hex(current_bad_oid));
+ strvec_push(rev_argv, "bisect_rev_setup");
+ strvec_pushf(rev_argv, bad_format, oid_to_hex(current_bad_oid));
for (i = 0; i < good_revs.nr; i++)
- strvec_pushf(&rev_argv, good_format,
+ strvec_pushf(rev_argv, good_format,
oid_to_hex(good_revs.oid + i));
- strvec_push(&rev_argv, "--");
+ strvec_push(rev_argv, "--");
if (read_paths)
- read_bisect_paths(&rev_argv);
+ read_bisect_paths(rev_argv);
- setup_revisions(rev_argv.nr, rev_argv.v, revs, NULL);
- /* XXX leak rev_argv, as "revs" may still be pointing to it */
+ setup_revisions(rev_argv->nr, rev_argv->v, revs, &opt);
}
static void bisect_common(struct rev_info *revs)
@@ -702,45 +708,31 @@ static enum bisect_error error_if_skipped_commits(struct commit_list *tried,
static int is_expected_rev(const struct object_id *oid)
{
- const char *filename = git_path_bisect_expected_rev();
- struct stat st;
- struct strbuf str = STRBUF_INIT;
- FILE *fp;
- int res = 0;
-
- if (stat(filename, &st) || !S_ISREG(st.st_mode))
+ struct object_id expected_oid;
+ if (read_ref("BISECT_EXPECTED_REV", &expected_oid))
return 0;
-
- fp = fopen_or_warn(filename, "r");
- if (!fp)
- return 0;
-
- if (strbuf_getline_lf(&str, fp) != EOF)
- res = !strcmp(str.buf, oid_to_hex(oid));
-
- strbuf_release(&str);
- fclose(fp);
-
- return res;
+ return oideq(oid, &expected_oid);
}
enum bisect_error bisect_checkout(const struct object_id *bisect_rev,
int no_checkout)
{
- char bisect_rev_hex[GIT_MAX_HEXSZ + 1];
struct commit *commit;
struct pretty_print_context pp = {0};
struct strbuf commit_msg = STRBUF_INIT;
- oid_to_hex_r(bisect_rev_hex, bisect_rev);
update_ref(NULL, "BISECT_EXPECTED_REV", bisect_rev, NULL, 0, UPDATE_REFS_DIE_ON_ERR);
- argv_checkout[2] = bisect_rev_hex;
if (no_checkout) {
update_ref(NULL, "BISECT_HEAD", bisect_rev, NULL, 0,
UPDATE_REFS_DIE_ON_ERR);
} else {
- if (run_command_v_opt(argv_checkout, RUN_GIT_CMD))
+ struct child_process cmd = CHILD_PROCESS_INIT;
+
+ cmd.git_cmd = 1;
+ strvec_pushl(&cmd.args, "checkout", "-q",
+ oid_to_hex(bisect_rev), "--", NULL);
+ if (run_command(&cmd))
/*
* Errors in `run_command()` itself, signaled by res < 0,
* and errors in the child process, signaled by res > 0
@@ -750,7 +742,8 @@ enum bisect_error bisect_checkout(const struct object_id *bisect_rev,
}
commit = lookup_commit_reference(the_repository, bisect_rev);
- format_commit_message(commit, "[%H] %s%n", &commit_msg, &pp);
+ repo_format_commit_message(the_repository, commit, "[%H] %s%n",
+ &commit_msg, &pp);
fputs(commit_msg.buf, stdout);
strbuf_release(&commit_msg);
@@ -843,9 +836,11 @@ static void handle_skipped_merge_base(const struct object_id *mb)
static enum bisect_error check_merge_bases(int rev_nr, struct commit **rev, int no_checkout)
{
enum bisect_error res = BISECT_OK;
- struct commit_list *result;
+ struct commit_list *result = NULL;
- result = get_merge_bases_many(rev[0], rev_nr - 1, rev + 1);
+ if (repo_get_merge_bases_many(the_repository, rev[0], rev_nr - 1,
+ rev + 1, &result) < 0)
+ exit(128);
for (; result; result = result->next) {
const struct object_id *mb = &result->item->object.oid;
@@ -873,10 +868,11 @@ static enum bisect_error check_merge_bases(int rev_nr, struct commit **rev, int
static int check_ancestors(struct repository *r, int rev_nr,
struct commit **rev, const char *prefix)
{
+ struct strvec rev_argv = STRVEC_INIT;
struct rev_info revs;
int res;
- bisect_rev_setup(r, &revs, prefix, "^%s", "%s", 0);
+ bisect_rev_setup(r, &revs, &rev_argv, prefix, "^%s", "%s", 0);
bisect_common(&revs);
res = (revs.commits != NULL);
@@ -885,6 +881,7 @@ static int check_ancestors(struct repository *r, int rev_nr,
clear_commit_marks_many(rev_nr, rev, ALL_REV_FLAGS);
release_revisions(&revs);
+ strvec_clear(&rev_argv);
return res;
}
@@ -1010,6 +1007,7 @@ void read_bisect_terms(const char **read_bad, const char **read_good)
*/
enum bisect_error bisect_next_all(struct repository *r, const char *prefix)
{
+ struct strvec rev_argv = STRVEC_INIT;
struct rev_info revs = REV_INFO_INIT;
struct commit_list *tried;
int reaches = 0, all = 0, nr, steps;
@@ -1037,7 +1035,7 @@ enum bisect_error bisect_next_all(struct repository *r, const char *prefix)
if (res)
goto cleanup;
- bisect_rev_setup(r, &revs, prefix, "%s", "^%s", 1);
+ bisect_rev_setup(r, &revs, &rev_argv, prefix, "%s", "^%s", 1);
revs.first_parent_only = !!(bisect_flags & FIND_BISECTION_FIRST_PARENT_ONLY);
revs.limited = 1;
@@ -1054,7 +1052,7 @@ enum bisect_error bisect_next_all(struct repository *r, const char *prefix)
*/
res = error_if_skipped_commits(tried, NULL);
if (res < 0)
- return res;
+ goto cleanup;
printf(_("%s was both %s and %s\n"),
oid_to_hex(current_bad_oid),
term_good,
@@ -1112,6 +1110,7 @@ enum bisect_error bisect_next_all(struct repository *r, const char *prefix)
res = bisect_checkout(bisect_rev, no_checkout);
cleanup:
release_revisions(&revs);
+ strvec_clear(&rev_argv);
return res;
}
@@ -1154,8 +1153,9 @@ int estimate_bisect_steps(int all)
return (e < 3 * x) ? n : n - 1;
}
-static int mark_for_removal(const char *refname, const struct object_id *oid,
- int flag, void *cb_data)
+static int mark_for_removal(const char *refname,
+ const struct object_id *oid UNUSED,
+ int flag UNUSED, void *cb_data)
{
struct string_list *refs = cb_data;
char *ref = xstrfmt("refs/bisect%s", refname);
@@ -1171,18 +1171,16 @@ int bisect_clean_state(void)
struct string_list refs_for_removal = STRING_LIST_INIT_NODUP;
for_each_ref_in("refs/bisect", mark_for_removal, (void *) &refs_for_removal);
string_list_append(&refs_for_removal, xstrdup("BISECT_HEAD"));
+ string_list_append(&refs_for_removal, xstrdup("BISECT_EXPECTED_REV"));
result = delete_refs("bisect: remove", &refs_for_removal, REF_NO_DEREF);
refs_for_removal.strdup_strings = 1;
string_list_clear(&refs_for_removal, 0);
- unlink_or_warn(git_path_bisect_expected_rev());
unlink_or_warn(git_path_bisect_ancestors_ok());
unlink_or_warn(git_path_bisect_log());
unlink_or_warn(git_path_bisect_names());
unlink_or_warn(git_path_bisect_run());
unlink_or_warn(git_path_bisect_terms());
unlink_or_warn(git_path_bisect_first_parent());
- /* Cleanup head-name if it got left by an old version of git-bisect */
- unlink_or_warn(git_path_head_name());
/*
* Cleanup BISECT_START last to support the --no-checkout option
* introduced in the commit 4796e823a.
diff --git a/blame.c b/blame.c
index da1052a..1a16d4e 100644
--- a/blame.c
+++ b/blame.c
@@ -1,11 +1,20 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "refs.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "cache-tree.h"
#include "mergesort.h"
+#include "commit.h"
+#include "convert.h"
#include "diff.h"
#include "diffcore.h"
+#include "gettext.h"
+#include "hex.h"
+#include "path.h"
+#include "read-cache.h"
+#include "revision.h"
+#include "setup.h"
#include "tag.h"
+#include "trace2.h"
#include "blame.h"
#include "alloc.h"
#include "commit-slab.h"
@@ -176,12 +185,12 @@ static void set_commit_buffer_from_strbuf(struct repository *r,
static struct commit *fake_working_tree_commit(struct repository *r,
struct diff_options *opt,
const char *path,
- const char *contents_from)
+ const char *contents_from,
+ struct object_id *oid)
{
struct commit *commit;
struct blame_origin *origin;
struct commit_list **parent_tail, *parent;
- struct object_id head_oid;
struct strbuf buf = STRBUF_INIT;
const char *ident;
time_t now;
@@ -197,17 +206,18 @@ static struct commit *fake_working_tree_commit(struct repository *r,
commit->date = now;
parent_tail = &commit->parents;
- if (!resolve_ref_unsafe("HEAD", RESOLVE_REF_READING, &head_oid, NULL))
- die("no such ref: HEAD");
-
- parent_tail = append_parent(r, parent_tail, &head_oid);
+ parent_tail = append_parent(r, parent_tail, oid);
append_merge_parents(r, parent_tail);
verify_working_tree_path(r, commit, path);
origin = make_origin(commit, path);
- ident = fmt_ident("Not Committed Yet", "not.committed.yet",
- WANT_BLANK_IDENT, NULL, 0);
+ if (contents_from)
+ ident = fmt_ident("External file (--contents)", "external.file",
+ WANT_BLANK_IDENT, NULL, 0);
+ else
+ ident = fmt_ident("Not Committed Yet", "not.committed.yet",
+ WANT_BLANK_IDENT, NULL, 0);
strbuf_addstr(&msg, "tree 0000000000000000000000000000000000000000\n");
for (parent = commit->parents; parent; parent = parent->next)
strbuf_addf(&msg, "parent %s\n",
@@ -1028,8 +1038,9 @@ static void fill_origin_blob(struct diff_options *opt,
&o->blob_oid, 1, &file->ptr, &file_size))
;
else
- file->ptr = read_object_file(&o->blob_oid, &type,
- &file_size);
+ file->ptr = repo_read_object_file(the_repository,
+ &o->blob_oid, &type,
+ &file_size);
file->size = file_size;
if (!file->ptr)
@@ -1098,30 +1109,22 @@ static struct blame_entry *blame_merge(struct blame_entry *list1,
}
}
-static void *get_next_blame(const void *p)
-{
- return ((struct blame_entry *)p)->next;
-}
-
-static void set_next_blame(void *p1, void *p2)
-{
- ((struct blame_entry *)p1)->next = p2;
-}
+DEFINE_LIST_SORT(static, sort_blame_entries, struct blame_entry, next);
/*
* Final image line numbers are all different, so we don't need a
* three-way comparison here.
*/
-static int compare_blame_final(const void *p1, const void *p2)
+static int compare_blame_final(const struct blame_entry *e1,
+ const struct blame_entry *e2)
{
- return ((struct blame_entry *)p1)->lno > ((struct blame_entry *)p2)->lno
- ? 1 : -1;
+ return e1->lno > e2->lno ? 1 : -1;
}
-static int compare_blame_suspect(const void *p1, const void *p2)
+static int compare_blame_suspect(const struct blame_entry *s1,
+ const struct blame_entry *s2)
{
- const struct blame_entry *s1 = p1, *s2 = p2;
/*
* to allow for collating suspects, we sort according to the
* respective pointer value as the primary sorting criterion.
@@ -1138,8 +1141,7 @@ static int compare_blame_suspect(const void *p1, const void *p2)
void blame_sort_final(struct blame_scoreboard *sb)
{
- sb->ent = llist_mergesort(sb->ent, get_next_blame, set_next_blame,
- compare_blame_final);
+ sort_blame_entries(&sb->ent, compare_blame_final);
}
static int compare_commits_by_reverse_commit_date(const void *a,
@@ -1964,9 +1966,7 @@ static void pass_blame_to_parent(struct blame_scoreboard *sb,
parent, target, 0);
*d.dstq = NULL;
if (ignore_diffs)
- newdest = llist_mergesort(newdest, get_next_blame,
- set_next_blame,
- compare_blame_suspect);
+ sort_blame_entries(&newdest, compare_blame_suspect);
queue_blames(sb, parent, newdest);
return;
@@ -2383,8 +2383,7 @@ static int num_scapegoats(struct rev_info *revs, struct commit *commit, int reve
*/
static void distribute_blame(struct blame_scoreboard *sb, struct blame_entry *blamed)
{
- blamed = llist_mergesort(blamed, get_next_blame, set_next_blame,
- compare_blame_suspect);
+ sort_blame_entries(&blamed, compare_blame_suspect);
while (blamed)
{
struct blame_origin *porigin = blamed->suspect;
@@ -2441,7 +2440,7 @@ static void pass_blame(struct blame_scoreboard *sb, struct blame_origin *origin,
if (sg_origin[i])
continue;
- if (parse_commit(p))
+ if (repo_parse_commit(the_repository, p))
continue;
porigin = find(sb->repo, p, origin, sb->bloom_data);
if (!porigin)
@@ -2604,7 +2603,7 @@ void assign_blame(struct blame_scoreboard *sb, int opt)
* so hold onto it in the meantime.
*/
blame_origin_incref(suspect);
- parse_commit(commit);
+ repo_parse_commit(the_repository, commit);
if (sb->reverse ||
(!(commit->object.flags & UNINTERESTING) &&
!(revs->max_age != -1 && commit->date < revs->max_age)))
@@ -2783,22 +2782,39 @@ void setup_scoreboard(struct blame_scoreboard *sb,
sb->commits.compare = compare_commits_by_reverse_commit_date;
}
- if (sb->final && sb->contents_from)
- die(_("cannot use --contents with final commit object name"));
-
if (sb->reverse && sb->revs->first_parent_only)
sb->revs->children.name = NULL;
- if (!sb->final) {
+ if (sb->contents_from || !sb->final) {
+ struct object_id head_oid, *parent_oid;
+
/*
- * "--not A B -- path" without anything positive;
- * do not default to HEAD, but use the working tree
- * or "--contents".
+ * Build a fake commit at the top of the history, when
+ * (1) "git blame [^A] --path", i.e. with no positive end
+ * of the history range, in which case we build such
+ * a fake commit on top of the HEAD to blame in-tree
+ * modifications.
+ * (2) "git blame --contents=file [A] -- path", with or
+ * without positive end of the history range but with
+ * --contents, in which case we pretend that there is
+ * a fake commit on top of the positive end (defaulting to
+ * HEAD) that has the given contents in the path.
*/
- setup_work_tree();
+ if (sb->final) {
+ parent_oid = &sb->final->object.oid;
+ } else {
+ if (!resolve_ref_unsafe("HEAD", RESOLVE_REF_READING, &head_oid, NULL))
+ die("no such ref: HEAD");
+ parent_oid = &head_oid;
+ }
+
+ if (!sb->contents_from)
+ setup_work_tree();
+
sb->final = fake_working_tree_commit(sb->repo,
&sb->revs->diffopt,
- sb->path, sb->contents_from);
+ sb->path, sb->contents_from,
+ parent_oid);
add_pending_object(sb->revs, &(sb->final->object), ":");
}
@@ -2850,8 +2866,10 @@ void setup_scoreboard(struct blame_scoreboard *sb,
&sb->final_buf_size))
;
else
- sb->final_buf = read_object_file(&o->blob_oid, &type,
- &sb->final_buf_size);
+ sb->final_buf = repo_read_object_file(the_repository,
+ &o->blob_oid,
+ &type,
+ &sb->final_buf_size);
if (!sb->final_buf)
die(_("cannot read blob %s for path %s"),
diff --git a/blame.h b/blame.h
index 38bde53..5b4e47d 100644
--- a/blame.h
+++ b/blame.h
@@ -1,12 +1,9 @@
#ifndef BLAME_H
#define BLAME_H
-#include "cache.h"
-#include "commit.h"
+#include "oidset.h"
#include "xdiff-interface.h"
-#include "revision.h"
#include "prio-queue.h"
-#include "diff.h"
#define PICKAXE_BLAME_MOVE 01
#define PICKAXE_BLAME_COPY 02
diff --git a/blob.c b/blob.c
index 182718a..3fb2922 100644
--- a/blob.c
+++ b/blob.c
@@ -1,6 +1,5 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "blob.h"
-#include "repository.h"
#include "alloc.h"
const char *blob_type = "blob";
@@ -13,8 +12,7 @@ struct blob *lookup_blob(struct repository *r, const struct object_id *oid)
return object_as_type(obj, OBJ_BLOB, 0);
}
-int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size)
+void parse_blob_buffer(struct blob *item)
{
item->object.parsed = 1;
- return 0;
}
diff --git a/blob.h b/blob.h
index 1664872..74555c9 100644
--- a/blob.h
+++ b/blob.h
@@ -11,8 +11,6 @@ struct blob {
struct blob *lookup_blob(struct repository *r, const struct object_id *oid);
-int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size);
-
/**
* Blobs do not contain references to other objects and do not have
* structured data that needs parsing. However, code may use the
@@ -21,5 +19,6 @@ int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size);
* parse_blob_buffer() is used (by object.c) to flag that the object
* has been read successfully from the database.
**/
+void parse_blob_buffer(struct blob *item);
#endif /* BLOB_H */
diff --git a/block-sha1/sha1.c b/block-sha1/sha1.c
index 5974cd7..80cebd2 100644
--- a/block-sha1/sha1.c
+++ b/block-sha1/sha1.c
@@ -28,10 +28,6 @@
* try to do the silly "optimize away loads" part because it won't
* see what the value will be).
*
- * Ben Herrenschmidt reports that on PPC, the C version comes close
- * to the optimized asm with this (ie on PPC you don't want that
- * 'volatile', since there are lots of registers).
- *
* On ARM we get the best code generation by forcing a full memory barrier
* between each SHA_ROUND, otherwise gcc happily get wild with spilling and
* the stack frame size simply explode and performance goes down the drain.
diff --git a/bloom.c b/bloom.c
index 816f063..e529f76 100644
--- a/bloom.c
+++ b/bloom.c
@@ -2,10 +2,10 @@
#include "bloom.h"
#include "diff.h"
#include "diffcore.h"
-#include "revision.h"
#include "hashmap.h"
#include "commit-graph.h"
#include "commit.h"
+#include "commit-slab.h"
define_commit_slab(bloom_filter_slab, struct bloom_filter);
@@ -28,6 +28,26 @@ static inline unsigned char get_bitmask(uint32_t pos)
return ((unsigned char)1) << (pos & (BITS_PER_WORD - 1));
}
+static int check_bloom_offset(struct commit_graph *g, uint32_t pos,
+ uint32_t offset)
+{
+ /*
+ * Note that we allow offsets equal to the data size, which would set
+ * our pointers at one past the end of the chunk memory. This is
+ * necessary because the on-disk index points to the end of the
+ * entries (so we can compute size by comparing adjacent ones). And
+ * naturally the final entry's end is one-past-the-end of the chunk.
+ */
+ if (offset <= g->chunk_bloom_data_size - BLOOMDATA_CHUNK_HEADER_SIZE)
+ return 0;
+
+ warning("ignoring out-of-range offset (%"PRIuMAX") for changed-path"
+ " filter at pos %"PRIuMAX" of %s (chunk size: %"PRIuMAX")",
+ (uintmax_t)offset, (uintmax_t)pos,
+ g->filename, (uintmax_t)g->chunk_bloom_data_size);
+ return -1;
+}
+
static int load_bloom_filter_from_graph(struct commit_graph *g,
struct bloom_filter *filter,
uint32_t graph_pos)
@@ -50,6 +70,20 @@ static int load_bloom_filter_from_graph(struct commit_graph *g,
else
start_index = 0;
+ if (check_bloom_offset(g, lex_pos, end_index) < 0 ||
+ check_bloom_offset(g, lex_pos - 1, start_index) < 0)
+ return 0;
+
+ if (end_index < start_index) {
+ warning("ignoring decreasing changed-path index offsets"
+ " (%"PRIuMAX" > %"PRIuMAX") for positions"
+ " %"PRIuMAX" and %"PRIuMAX" of %s",
+ (uintmax_t)start_index, (uintmax_t)end_index,
+ (uintmax_t)(lex_pos-1), (uintmax_t)lex_pos,
+ g->filename);
+ return 0;
+ }
+
filter->len = end_index - start_index;
filter->data = (unsigned char *)(g->chunk_bloom_data +
sizeof(unsigned char) * start_index +
@@ -163,10 +197,10 @@ void init_bloom_filters(void)
init_bloom_filter_slab(&bloom_filters);
}
-static int pathmap_cmp(const void *hashmap_cmp_fn_data,
+static int pathmap_cmp(const void *hashmap_cmp_fn_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
- const void *keydata)
+ const void *keydata UNUSED)
{
const struct pathmap_hash_entry *e1, *e2;
diff --git a/branch.c b/branch.c
index 4c8523c..e4a738f 100644
--- a/branch.c
+++ b/branch.c
@@ -1,15 +1,22 @@
#include "git-compat-util.h"
-#include "cache.h"
+#include "advice.h"
#include "config.h"
#include "branch.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-name.h"
+#include "path.h"
#include "refs.h"
#include "refspec.h"
#include "remote.h"
+#include "repository.h"
#include "sequencer.h"
#include "commit.h"
#include "worktree.h"
#include "submodule-config.h"
#include "run-command.h"
+#include "strmap.h"
struct tracking {
struct refspec_item spec;
@@ -31,7 +38,7 @@ static int find_tracked_branch(struct remote *remote, void *priv)
if (!remote_find_tracking(remote, &tracking->spec)) {
switch (++tracking->matches) {
case 1:
- string_list_append(tracking->srcs, tracking->spec.src);
+ string_list_append_nodup(tracking->srcs, tracking->spec.src);
tracking->remote = remote->name;
break;
case 2:
@@ -227,7 +234,7 @@ static int inherit_tracking(struct tracking *tracking, const char *orig_ref)
return -1;
}
- tracking->remote = xstrdup(branch->remote_name);
+ tracking->remote = branch->remote_name;
for (i = 0; i < branch->merge_nr; i++)
string_list_append(tracking->srcs, branch->merge_name[i]);
return 0;
@@ -327,7 +334,7 @@ static void setup_tracking(const char *new_ref, const char *orig_ref,
if (!skip_prefix(tracking.srcs->items[0].string,
"refs/heads/", &tracked_branch) ||
strcmp(tracked_branch, new_ref))
- return;
+ goto cleanup;
}
if (tracking.srcs->nr < 1)
@@ -363,12 +370,93 @@ 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))
- die(_("'%s' is not a valid branch name"), name);
+ if (strbuf_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`"));
+ exit(code);
+ }
return ref_exists(ref->buf);
}
+static int initialized_checked_out_branches;
+static struct strmap current_checked_out_branches = STRMAP_INIT;
+
+static void prepare_checked_out_branches(void)
+{
+ int i = 0;
+ struct worktree **worktrees;
+
+ if (initialized_checked_out_branches)
+ return;
+ initialized_checked_out_branches = 1;
+
+ worktrees = get_worktrees();
+
+ while (worktrees[i]) {
+ char *old;
+ struct wt_status_state state = { 0 };
+ struct worktree *wt = worktrees[i++];
+ struct string_list update_refs = STRING_LIST_INIT_DUP;
+
+ if (wt->is_bare)
+ continue;
+
+ if (wt->head_ref) {
+ old = strmap_put(&current_checked_out_branches,
+ wt->head_ref,
+ xstrdup(wt->path));
+ free(old);
+ }
+
+ if (wt_status_check_rebase(wt, &state) &&
+ (state.rebase_in_progress || state.rebase_interactive_in_progress) &&
+ state.branch) {
+ struct strbuf ref = STRBUF_INIT;
+ strbuf_addf(&ref, "refs/heads/%s", state.branch);
+ old = strmap_put(&current_checked_out_branches,
+ ref.buf,
+ xstrdup(wt->path));
+ free(old);
+ strbuf_release(&ref);
+ }
+ wt_status_state_free_buffers(&state);
+
+ if (wt_status_check_bisect(wt, &state) &&
+ state.bisecting_from) {
+ struct strbuf ref = STRBUF_INIT;
+ strbuf_addf(&ref, "refs/heads/%s", state.bisecting_from);
+ old = strmap_put(&current_checked_out_branches,
+ ref.buf,
+ xstrdup(wt->path));
+ free(old);
+ strbuf_release(&ref);
+ }
+ wt_status_state_free_buffers(&state);
+
+ if (!sequencer_get_update_refs_state(get_worktree_git_dir(wt),
+ &update_refs)) {
+ struct string_list_item *item;
+ for_each_string_list_item(item, &update_refs) {
+ old = strmap_put(&current_checked_out_branches,
+ item->string,
+ xstrdup(wt->path));
+ free(old);
+ }
+ string_list_clear(&update_refs, 1);
+ }
+ }
+
+ free_worktrees(worktrees);
+}
+
+const char *branch_checked_out(const char *refname)
+{
+ prepare_checked_out_branches();
+ return strmap_get(&current_checked_out_branches, refname);
+}
+
/*
* Check if a branch 'name' can be created as a new branch; die otherwise.
* 'force' can be used when it is OK for the named branch already exists.
@@ -377,9 +465,7 @@ int validate_branchname(const char *name, struct strbuf *ref)
*/
int validate_new_branchname(const char *name, struct strbuf *ref, int force)
{
- struct worktree **worktrees;
- const struct worktree *wt;
-
+ const char *path;
if (!validate_branchname(name, ref))
return 0;
@@ -387,13 +473,10 @@ int validate_new_branchname(const char *name, struct strbuf *ref, int force)
die(_("a branch named '%s' already exists"),
ref->buf + strlen("refs/heads/"));
- worktrees = get_worktrees();
- wt = find_shared_symref(worktrees, "HEAD", ref->buf);
- if (wt && !wt->is_bare)
+ if ((path = branch_checked_out(ref->buf)))
die(_("cannot force update the branch '%s' "
- "checked out at '%s'"),
- ref->buf + strlen("refs/heads/"), wt->path);
- free_worktrees(worktrees);
+ "used by worktree at '%s'"),
+ ref->buf + strlen("refs/heads/"), path);
return 1;
}
@@ -402,9 +485,12 @@ static int check_tracking_branch(struct remote *remote, void *cb_data)
{
char *tracking_branch = cb_data;
struct refspec_item query;
+ int res;
memset(&query, 0, sizeof(struct refspec_item));
query.dst = tracking_branch;
- return !remote_find_tracking(remote, &query);
+ res = !remote_find_tracking(remote, &query);
+ free(query.src);
+ return res;
}
static int validate_remote_tracking_branch(char *ref)
@@ -458,7 +544,7 @@ static void dwim_branch_start(struct repository *r, const char *start_name,
explicit_tracking = 1;
real_ref = NULL;
- if (get_oid_mb(start_name, &oid)) {
+ if (repo_get_oid_mb(r, start_name, &oid)) {
if (explicit_tracking) {
int code = die_message(_(upstream_missing), start_name);
advise_if_enabled(ADVICE_SET_UPSTREAM_FAILURE,
@@ -468,7 +554,8 @@ static void dwim_branch_start(struct repository *r, const char *start_name,
die(_("not a valid object name: '%s'"), start_name);
}
- switch (dwim_ref(start_name, strlen(start_name), &oid, &real_ref, 0)) {
+ switch (repo_dwim_ref(r, start_name, strlen(start_name), &oid,
+ &real_ref, 0)) {
case 0:
/* Not branching from any existing branch */
if (explicit_tracking)
@@ -559,9 +646,10 @@ void dwim_and_setup_tracking(struct repository *r, const char *new_ref,
const char *orig_ref, enum branch_track track,
int quiet)
{
- char *real_orig_ref;
+ char *real_orig_ref = NULL;
dwim_branch_start(r, orig_ref, track, &real_orig_ref, NULL);
setup_tracking(new_ref, real_orig_ref, track, quiet);
+ free(real_orig_ref);
}
/**
@@ -650,7 +738,7 @@ static int submodule_create_branch(struct repository *r,
}
void create_branches_recursively(struct repository *r, const char *name,
- const char *start_commitish,
+ const char *start_committish,
const char *tracking_name, int force,
int reflog, int quiet, enum branch_track track,
int dry_run)
@@ -660,8 +748,8 @@ void create_branches_recursively(struct repository *r, const char *name,
struct object_id super_oid;
struct submodule_entry_list submodule_entry_list;
- /* Perform dwim on start_commitish to get super_oid and branch_point. */
- dwim_branch_start(r, start_commitish, BRANCH_TRACK_NEVER,
+ /* Perform dwim on start_committish to get super_oid and branch_point. */
+ dwim_branch_start(r, start_committish, BRANCH_TRACK_NEVER,
&branch_point, &super_oid);
/*
@@ -683,8 +771,8 @@ void create_branches_recursively(struct repository *r, const char *name,
_("submodule '%s': unable to find submodule"),
submodule_entry_list.entries[i].submodule->name);
if (advice_enabled(ADVICE_SUBMODULES_NOT_UPDATED))
- advise(_("You may try updating the submodules using 'git checkout %s && git submodule update --init'"),
- start_commitish);
+ advise(_("You may try updating the submodules using 'git checkout --no-recurse-submodules %s && git submodule update --init'"),
+ start_committish);
exit(code);
}
@@ -699,7 +787,7 @@ void create_branches_recursively(struct repository *r, const char *name,
name);
}
- create_branch(the_repository, name, start_commitish, force, 0, reflog, quiet,
+ create_branch(r, name, start_committish, force, 0, reflog, quiet,
BRANCH_TRACK_NEVER, dry_run);
if (dry_run)
return;
@@ -733,8 +821,9 @@ void remove_merge_branch_state(struct repository *r)
unlink(git_path_merge_rr(r));
unlink(git_path_merge_msg(r));
unlink(git_path_merge_mode(r));
- unlink(git_path_auto_merge(r));
- save_autostash(git_path_merge_autostash(r));
+ refs_delete_ref(get_main_ref_store(r), "", "AUTO_MERGE",
+ NULL, REF_NO_DEREF);
+ save_autostash_ref(r, "MERGE_AUTOSTASH");
}
void remove_branch_state(struct repository *r, int verbose)
@@ -747,40 +836,17 @@ void remove_branch_state(struct repository *r, int verbose)
void die_if_checked_out(const char *branch, int ignore_current_worktree)
{
struct worktree **worktrees = get_worktrees();
- const struct worktree *wt;
-
- wt = find_shared_symref(worktrees, "HEAD", branch);
- if (wt && (!ignore_current_worktree || !wt->is_current)) {
- skip_prefix(branch, "refs/heads/", &branch);
- die(_("'%s' is already checked out at '%s'"), branch, wt->path);
- }
-
- free_worktrees(worktrees);
-}
-
-int replace_each_worktree_head_symref(const char *oldref, const char *newref,
- const char *logmsg)
-{
- int ret = 0;
- struct worktree **worktrees = get_worktrees();
- int i;
-
- for (i = 0; worktrees[i]; i++) {
- struct ref_store *refs;
- if (worktrees[i]->is_detached)
- continue;
- if (!worktrees[i]->head_ref)
- continue;
- if (strcmp(oldref, worktrees[i]->head_ref))
+ for (int i = 0; worktrees[i]; i++) {
+ if (worktrees[i]->is_current && ignore_current_worktree)
continue;
- refs = get_worktree_ref_store(worktrees[i]);
- if (refs_create_symref(refs, "HEAD", newref, logmsg))
- ret = error(_("HEAD of working tree %s is not updated"),
- worktrees[i]->path);
+ if (is_shared_symref(worktrees[i], "HEAD", branch)) {
+ skip_prefix(branch, "refs/heads/", &branch);
+ die(_("'%s' is already used by worktree at '%s'"),
+ branch, worktrees[i]->path);
+ }
}
free_worktrees(worktrees);
- return ret;
}
diff --git a/branch.h b/branch.h
index 560b6b9..ec2f35f 100644
--- a/branch.h
+++ b/branch.h
@@ -78,29 +78,36 @@ void create_branch(struct repository *r,
* those of create_branch() except for start_name, which is represented
* by two different parameters:
*
- * - start_commitish is the commit-ish, in repository r, that determines
+ * - start_committish is the commit-ish, in repository r, that determines
* which commits the branches will point to. The superproject branch
- * will point to the commit of start_commitish and the submodule
- * branches will point to the gitlink commit oids in start_commitish's
+ * will point to the commit of start_committish and the submodule
+ * branches will point to the gitlink commit oids in start_committish's
* tree.
*
* - tracking_name is the name of the ref, in repository r, that will be
* used to set up tracking information. This value is propagated to
* all submodules, which will evaluate the ref using their own ref
- * stores. If NULL, this defaults to start_commitish.
+ * stores. If NULL, this defaults to start_committish.
*
- * When this function is called on the superproject, start_commitish
+ * When this function is called on the superproject, start_committish
* can be any user-provided ref and tracking_name can be NULL (similar
* to create_branches()). But when recursing through submodules,
- * start_commitish is the plain gitlink commit oid. Since the oid cannot
+ * start_committish is the plain gitlink commit oid. Since the oid cannot
* be used for tracking information, tracking_name is propagated and
* used for tracking instead.
*/
void create_branches_recursively(struct repository *r, const char *name,
- const char *start_commitish,
+ const char *start_committish,
const char *tracking_name, int force,
int reflog, int quiet, enum branch_track track,
int dry_run);
+
+/*
+ * If the branch at 'refname' is currently checked out in a worktree,
+ * then return the path to that worktree.
+ */
+const char *branch_checked_out(const char *refname);
+
/*
* Check if 'name' can be a valid name for a branch; die otherwise.
* Return 1 if the named branch already exists; return 0 otherwise.
@@ -148,12 +155,4 @@ int read_branch_desc(struct strbuf *, const char *branch_name);
*/
void die_if_checked_out(const char *branch, int ignore_current_worktree);
-/*
- * Update all per-worktree HEADs pointing at the old ref to point the new ref.
- * This will be used when renaming a branch. Returns 0 if successful, non-zero
- * otherwise.
- */
-int replace_each_worktree_head_symref(const char *oldref, const char *newref,
- const char *logmsg);
-
#endif
diff --git a/builtin.h b/builtin.h
index 40e9ecc..2828063 100644
--- a/builtin.h
+++ b/builtin.h
@@ -2,9 +2,6 @@
#define BUILTIN_H
#include "git-compat-util.h"
-#include "strbuf.h"
-#include "cache.h"
-#include "commit.h"
/*
* builtin API
@@ -51,10 +48,6 @@
* on bare repositories.
* This only makes sense when `RUN_SETUP` is also set.
*
- * `SUPPORT_SUPER_PREFIX`:
- *
- * The built-in supports `--super-prefix`.
- *
* `DELAY_PAGER_CONFIG`:
*
* If RUN_SETUP or RUN_SETUP_GENTLY is set, git.c normally handles
@@ -111,12 +104,22 @@ void setup_auto_pager(const char *cmd, int def);
int is_builtin(const char *s);
+/*
+ * Builtins which do not use RUN_SETUP should never see
+ * a prefix that is not empty; use this to protect downstream
+ * code which is not prepared to call prefix_filename(), etc.
+ */
+#define BUG_ON_NON_EMPTY_PREFIX(prefix) do { \
+ if ((prefix)) \
+ BUG("unexpected prefix in builtin: %s", (prefix)); \
+} while (0)
+
int cmd_add(int argc, const char **argv, const char *prefix);
int cmd_am(int argc, const char **argv, const char *prefix);
int cmd_annotate(int argc, const char **argv, const char *prefix);
int cmd_apply(int argc, const char **argv, const char *prefix);
int cmd_archive(int argc, const char **argv, const char *prefix);
-int cmd_bisect__helper(int argc, const char **argv, const char *prefix);
+int cmd_bisect(int argc, const char **argv, const char *prefix);
int cmd_blame(int argc, const char **argv, const char *prefix);
int cmd_branch(int argc, const char **argv, const char *prefix);
int cmd_bugreport(int argc, const char **argv, const char *prefix);
@@ -144,6 +147,7 @@ int cmd_credential_cache(int argc, const char **argv, const char *prefix);
int cmd_credential_cache_daemon(int argc, const char **argv, const char *prefix);
int cmd_credential_store(int argc, const char **argv, const char *prefix);
int cmd_describe(int argc, const char **argv, const char *prefix);
+int cmd_diagnose(int argc, const char **argv, const char *prefix);
int cmd_diff_files(int argc, const char **argv, const char *prefix);
int cmd_diff_index(int argc, const char **argv, const char *prefix);
int cmd_diff(int argc, const char **argv, const char *prefix);
@@ -207,6 +211,7 @@ int cmd_remote(int argc, const char **argv, const char *prefix);
int cmd_remote_ext(int argc, const char **argv, const char *prefix);
int cmd_remote_fd(int argc, const char **argv, const char *prefix);
int cmd_repack(int argc, const char **argv, const char *prefix);
+int cmd_replay(int argc, const char **argv, const char *prefix);
int cmd_rerere(int argc, const char **argv, const char *prefix);
int cmd_reset(int argc, const char **argv, const char *prefix);
int cmd_restore(int argc, const char **argv, const char *prefix);
diff --git a/builtin/add.c b/builtin/add.c
index f843729..ae723bc 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -3,19 +3,22 @@
*
* Copyright (C) 2006 Linus Torvalds
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
-#include "config.h"
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "advice.h"
+#include "config.h"
#include "lockfile.h"
+#include "editor.h"
#include "dir.h"
+#include "gettext.h"
#include "pathspec.h"
-#include "exec-cmd.h"
-#include "cache-tree.h"
#include "run-command.h"
#include "parse-options.h"
+#include "path.h"
+#include "preload-index.h"
#include "diff.h"
-#include "diffcore.h"
+#include "read-cache.h"
+#include "repository.h"
#include "revision.h"
#include "bulk-checkin.h"
#include "strvec.h"
@@ -33,17 +36,12 @@ static int pathspec_file_nul;
static int include_sparse;
static const char *pathspec_from_file;
-struct update_callback_data {
- int flags;
- int add_errors;
-};
-
static int chmod_pathspec(struct pathspec *pathspec, char flip, int show_only)
{
int i, ret = 0;
- for (i = 0; i < active_nr; i++) {
- struct cache_entry *ce = active_cache[i];
+ for (i = 0; i < the_index.cache_nr; i++) {
+ struct cache_entry *ce = the_index.cache[i];
int err;
if (!include_sparse &&
@@ -55,7 +53,7 @@ static int chmod_pathspec(struct pathspec *pathspec, char flip, int show_only)
continue;
if (!show_only)
- err = chmod_cache_entry(ce, flip);
+ err = chmod_index_entry(&the_index, ce, flip);
else
err = S_ISREG(ce->ce_mode) ? 0 : -1;
@@ -66,101 +64,12 @@ static int chmod_pathspec(struct pathspec *pathspec, char flip, int show_only)
return ret;
}
-static int fix_unmerged_status(struct diff_filepair *p,
- struct update_callback_data *data)
-{
- if (p->status != DIFF_STATUS_UNMERGED)
- return p->status;
- if (!(data->flags & ADD_CACHE_IGNORE_REMOVAL) && !p->two->mode)
- /*
- * This is not an explicit add request, and the
- * path is missing from the working tree (deleted)
- */
- return DIFF_STATUS_DELETED;
- else
- /*
- * Either an explicit add request, or path exists
- * in the working tree. An attempt to explicitly
- * add a path that does not exist in the working tree
- * will be caught as an error by the caller immediately.
- */
- return DIFF_STATUS_MODIFIED;
-}
-
-static void update_callback(struct diff_queue_struct *q,
- struct diff_options *opt, void *cbdata)
-{
- int i;
- struct update_callback_data *data = cbdata;
-
- for (i = 0; i < q->nr; i++) {
- struct diff_filepair *p = q->queue[i];
- const char *path = p->one->path;
-
- if (!include_sparse && !path_in_sparse_checkout(path, &the_index))
- continue;
-
- switch (fix_unmerged_status(p, data)) {
- default:
- die(_("unexpected diff status %c"), p->status);
- case DIFF_STATUS_MODIFIED:
- case DIFF_STATUS_TYPE_CHANGED:
- if (add_file_to_index(&the_index, path, data->flags)) {
- if (!(data->flags & ADD_CACHE_IGNORE_ERRORS))
- die(_("updating files failed"));
- data->add_errors++;
- }
- break;
- case DIFF_STATUS_DELETED:
- if (data->flags & ADD_CACHE_IGNORE_REMOVAL)
- break;
- if (!(data->flags & ADD_CACHE_PRETEND))
- remove_file_from_index(&the_index, path);
- if (data->flags & (ADD_CACHE_PRETEND|ADD_CACHE_VERBOSE))
- printf(_("remove '%s'\n"), path);
- break;
- }
- }
-}
-
-int add_files_to_cache(const char *prefix,
- const struct pathspec *pathspec, int flags)
-{
- struct update_callback_data data;
- struct rev_info rev;
-
- memset(&data, 0, sizeof(data));
- data.flags = flags;
-
- repo_init_revisions(the_repository, &rev, prefix);
- setup_revisions(0, NULL, &rev, NULL);
- if (pathspec)
- copy_pathspec(&rev.prune_data, pathspec);
- rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;
- rev.diffopt.format_callback = update_callback;
- rev.diffopt.format_callback_data = &data;
- rev.diffopt.flags.override_submodule_config = 1;
- rev.max_count = 0; /* do not compare unmerged paths with stage #2 */
-
- /*
- * Use an ODB transaction to optimize adding multiple objects.
- * This function is invoked from commands other than 'add', which
- * may not have their own transaction active.
- */
- begin_odb_transaction();
- run_diff_files(&rev, DIFF_RACY_IS_MODIFIED);
- end_odb_transaction();
-
- release_revisions(&rev);
- return !!data.add_errors;
-}
-
static int renormalize_tracked_files(const struct pathspec *pathspec, int flags)
{
int i, retval = 0;
- for (i = 0; i < active_nr; i++) {
- struct cache_entry *ce = active_cache[i];
+ for (i = 0; i < the_index.cache_nr; i++) {
+ struct cache_entry *ce = the_index.cache[i];
if (!include_sparse &&
(ce_skip_worktree(ce) ||
@@ -172,7 +81,8 @@ static int renormalize_tracked_files(const struct pathspec *pathspec, int flags)
continue; /* do not touch non blobs */
if (pathspec && !ce_path_match(&the_index, ce, pathspec, NULL))
continue;
- retval |= add_file_to_cache(ce->name, flags | ADD_CACHE_RENORMALIZE);
+ retval |= add_file_to_index(&the_index, ce->name,
+ flags | ADD_CACHE_RENORMALIZE);
}
return retval;
@@ -205,7 +115,7 @@ static int refresh(int verbose, const struct pathspec *pathspec)
int i, ret = 0;
char *skip_worktree_seen = NULL;
struct string_list only_match_skip_worktree = STRING_LIST_INIT_NODUP;
- int flags = REFRESH_IGNORE_SKIP_WORKTREE |
+ unsigned int flags = REFRESH_IGNORE_SKIP_WORKTREE |
(verbose ? REFRESH_IN_PORCELAIN : REFRESH_QUIET);
seen = xcalloc(pathspec->nr, 1);
@@ -237,59 +147,14 @@ static int refresh(int verbose, const struct pathspec *pathspec)
return ret;
}
-int run_add_interactive(const char *revision, const char *patch_mode,
- const struct pathspec *pathspec)
-{
- int status, i;
- struct strvec argv = STRVEC_INIT;
- int use_builtin_add_i =
- git_env_bool("GIT_TEST_ADD_I_USE_BUILTIN", -1);
-
- if (use_builtin_add_i < 0 &&
- git_config_get_bool("add.interactive.usebuiltin",
- &use_builtin_add_i))
- use_builtin_add_i = 1;
-
- if (use_builtin_add_i != 0) {
- enum add_p_mode mode;
-
- if (!patch_mode)
- return !!run_add_i(the_repository, pathspec);
-
- if (!strcmp(patch_mode, "--patch"))
- mode = ADD_P_ADD;
- else if (!strcmp(patch_mode, "--patch=stash"))
- mode = ADD_P_STASH;
- else if (!strcmp(patch_mode, "--patch=reset"))
- mode = ADD_P_RESET;
- else if (!strcmp(patch_mode, "--patch=checkout"))
- mode = ADD_P_CHECKOUT;
- else if (!strcmp(patch_mode, "--patch=worktree"))
- mode = ADD_P_WORKTREE;
- else
- die("'%s' not supported", patch_mode);
-
- return !!run_add_p(the_repository, mode, revision, pathspec);
- }
-
- strvec_push(&argv, "add--interactive");
- if (patch_mode)
- strvec_push(&argv, patch_mode);
- if (revision)
- strvec_push(&argv, revision);
- strvec_push(&argv, "--");
- for (i = 0; i < pathspec->nr; i++)
- /* pass original pathspec, to be re-parsed */
- strvec_push(&argv, pathspec->items[i].original);
-
- status = run_command_v_opt(argv.v, RUN_GIT_CMD);
- strvec_clear(&argv);
- return status;
-}
-
int interactive_add(const char **argv, const char *prefix, int patch)
{
struct pathspec pathspec;
+ int unused;
+
+ if (!git_config_get_bool("add.interactive.usebuiltin", &unused))
+ warning(_("the add.interactive.useBuiltin setting has been removed!\n"
+ "See its entry in 'git help config' for details."));
parse_pathspec(&pathspec, 0,
PATHSPEC_PREFER_FULL |
@@ -297,9 +162,10 @@ int interactive_add(const char **argv, const char *prefix, int patch)
PATHSPEC_PREFIX_ORIGIN,
prefix, argv);
- return run_add_interactive(NULL,
- patch ? "--patch" : NULL,
- &pathspec);
+ if (patch)
+ return !!run_add_p(the_repository, ADD_P_ADD, NULL, &pathspec);
+ else
+ return !!run_add_i(the_repository, &pathspec);
}
static int edit_patch(int argc, const char **argv, const char *prefix)
@@ -312,8 +178,8 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
- if (read_cache() < 0)
- die(_("Could not read the index"));
+ if (repo_read_index(the_repository) < 0)
+ die(_("could not read the index"));
repo_init_revisions(the_repository, &rev, prefix);
rev.diffopt.context = 7;
@@ -325,22 +191,21 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
out = xopen(file, O_CREAT | O_WRONLY | O_TRUNC, 0666);
rev.diffopt.file = xfdopen(out, "w");
rev.diffopt.close_file = 1;
- if (run_diff_files(&rev, 0))
- die(_("Could not write patch"));
+ run_diff_files(&rev, 0);
if (launch_editor(file, NULL, NULL))
die(_("editing patch failed"));
if (stat(file, &st))
- die_errno(_("Could not stat '%s'"), file);
+ die_errno(_("could not stat '%s'"), file);
if (!st.st_size)
- die(_("Empty patch. Aborted."));
+ die(_("empty patch. aborted"));
child.git_cmd = 1;
strvec_pushl(&child.args, "apply", "--recount", "--cached", file,
NULL);
if (run_command(&child))
- die(_("Could not apply '%s'"), file);
+ die(_("could not apply '%s'"), file);
unlink(file);
free(file);
@@ -363,6 +228,8 @@ static char *chmod_arg;
static int ignore_removal_cb(const struct option *opt, const char *arg, int unset)
{
+ BUG_ON_OPT_ARG(arg);
+
/* if we are told to ignore, we are not adding removals */
*(int *)opt->value = !unset ? 0 : 1;
return 0;
@@ -397,7 +264,8 @@ static struct option builtin_add_options[] = {
OPT_END(),
};
-static int add_config(const char *var, const char *value, void *cb)
+static int add_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(var, "add.ignoreerrors") ||
!strcmp(var, "add.ignore-errors")) {
@@ -405,7 +273,10 @@ static int add_config(const char *var, const char *value, void *cb)
return 0;
}
- return git_default_config(var, value, cb);
+ if (git_color_config(var, value, cb) < 0)
+ return -1;
+
+ return git_default_config(var, value, ctx, cb);
}
static const char embedded_advice[] = N_(
@@ -439,9 +310,9 @@ static void check_embedded_repo(const char *path)
strbuf_strip_suffix(&name, "/");
warning(_("adding embedded git repository: %s"), name.buf);
- if (!adviced_on_embedded_repo &&
- advice_enabled(ADVICE_ADD_EMBEDDED_REPO)) {
- advise(embedded_advice, name.buf, name.buf);
+ if (!adviced_on_embedded_repo) {
+ advise_if_enabled(ADVICE_ADD_EMBEDDED_REPO,
+ embedded_advice, name.buf, name.buf);
adviced_on_embedded_repo = 1;
}
@@ -457,10 +328,8 @@ static int add_files(struct dir_struct *dir, int flags)
fprintf(stderr, _(ignore_error));
for (i = 0; i < dir->ignored_nr; i++)
fprintf(stderr, "%s\n", dir->ignored[i]->name);
- if (advice_enabled(ADVICE_ADD_IGNORED_FILE))
- advise(_("Use -f if you really want to add them.\n"
- "Turn this message off by running\n"
- "\"git config advice.addIgnoredFile false\""));
+ advise_if_enabled(ADVICE_ADD_IGNORED_FILE,
+ _("Use -f if you really want to add them."));
exit_status = 1;
}
@@ -499,6 +368,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
int add_new_files;
int require_pathspec;
char *seen = NULL;
+ char *ps_matched = NULL;
struct lock_file lock_file = LOCK_INIT;
git_config(add_config, NULL);
@@ -544,13 +414,13 @@ int cmd_add(int argc, const char **argv, const char *prefix)
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
- hold_locked_index(&lock_file, LOCK_DIE_ON_ERROR);
+ repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
/*
* Check the "pathspec '%s' did not match any files" block
* below before enabling new magic.
*/
- parse_pathspec(&pathspec, PATHSPEC_ATTR,
+ parse_pathspec(&pathspec, 0,
PATHSPEC_PREFER_FULL |
PATHSPEC_SYMLINK_LEADING_PATH,
prefix, argv);
@@ -559,7 +429,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
if (pathspec.nr)
die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file");
- parse_pathspec_file(&pathspec, PATHSPEC_ATTR,
+ parse_pathspec_file(&pathspec, 0,
PATHSPEC_PREFER_FULL |
PATHSPEC_SYMLINK_LEADING_PATH,
prefix, pathspec_from_file, pathspec_file_nul);
@@ -569,10 +439,8 @@ int cmd_add(int argc, const char **argv, const char *prefix)
if (require_pathspec && pathspec.nr == 0) {
fprintf(stderr, _("Nothing specified, nothing added.\n"));
- if (advice_enabled(ADVICE_ADD_EMPTY_PATHSPEC))
- advise( _("Maybe you wanted to say 'git add .'?\n"
- "Turn this message off by running\n"
- "\"git config advice.addEmptyPathspec false\""));
+ advise_if_enabled(ADVICE_ADD_EMPTY_PATHSPEC,
+ _("Maybe you wanted to say 'git add .'?"));
return 0;
}
@@ -587,7 +455,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
(!(addremove || take_worktree_changes)
? ADD_CACHE_IGNORE_REMOVAL : 0));
- if (read_cache_preload(&pathspec) < 0)
+ if (repo_read_index_preload(the_repository, &pathspec, 0) < 0)
die(_("index file corrupt"));
die_in_unpopulated_submodule(&the_index, prefix);
@@ -630,7 +498,8 @@ int cmd_add(int argc, const char **argv, const char *prefix)
PATHSPEC_LITERAL |
PATHSPEC_GLOB |
PATHSPEC_ICASE |
- PATHSPEC_EXCLUDE);
+ PATHSPEC_EXCLUDE |
+ PATHSPEC_ATTR);
for (i = 0; i < pathspec.nr; i++) {
const char *path = pathspec.items[i].match;
@@ -677,10 +546,17 @@ int cmd_add(int argc, const char **argv, const char *prefix)
begin_odb_transaction();
+ ps_matched = xcalloc(pathspec.nr, 1);
if (add_renormalize)
exit_status |= renormalize_tracked_files(&pathspec, flags);
else
- exit_status |= add_files_to_cache(prefix, &pathspec, flags);
+ exit_status |= add_files_to_cache(the_repository, prefix,
+ &pathspec, ps_matched,
+ include_sparse, flags);
+
+ if (take_worktree_changes && !add_renormalize && !ignore_add_errors &&
+ report_path_error(ps_matched, &pathspec))
+ exit(128);
if (add_new_files)
exit_status |= add_files(&dir, flags);
@@ -692,9 +568,10 @@ int cmd_add(int argc, const char **argv, const char *prefix)
finish:
if (write_locked_index(&the_index, &lock_file,
COMMIT_LOCK | SKIP_IF_UNCHANGED))
- die(_("Unable to write new index file"));
+ die(_("unable to write new index file"));
+ free(ps_matched);
dir_clear(&dir);
- UNLEAK(pathspec);
+ clear_pathspec(&pathspec);
return exit_status;
}
diff --git a/builtin/am.c b/builtin/am.c
index 93bec62..022cae2 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -3,11 +3,15 @@
*
* Based on git-am.sh by Junio C Hamano.
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
-#include "config.h"
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
-#include "exec-cmd.h"
+#include "abspath.h"
+#include "advice.h"
+#include "config.h"
+#include "editor.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "parse-options.h"
#include "dir.h"
#include "run-command.h"
@@ -19,20 +23,21 @@
#include "refs.h"
#include "commit.h"
#include "diff.h"
-#include "diffcore.h"
#include "unpack-trees.h"
#include "branch.h"
+#include "object-name.h"
+#include "preload-index.h"
#include "sequencer.h"
#include "revision.h"
#include "merge-recursive.h"
#include "log-tree.h"
#include "notes-utils.h"
#include "rerere.h"
-#include "prompt.h"
#include "mailinfo.h"
#include "apply.h"
#include "string-list.h"
-#include "packfile.h"
+#include "pager.h"
+#include "path.h"
#include "repository.h"
#include "pretty.h"
@@ -83,9 +88,16 @@ enum signoff_type {
SIGNOFF_EXPLICIT /* --signoff was set on the command-line */
};
-enum show_patch_type {
- SHOW_PATCH_RAW = 0,
- SHOW_PATCH_DIFF = 1,
+enum resume_type {
+ RESUME_FALSE = 0,
+ RESUME_APPLY,
+ RESUME_RESOLVED,
+ RESUME_SKIP,
+ RESUME_ABORT,
+ RESUME_QUIT,
+ RESUME_SHOW_PATCH_RAW,
+ RESUME_SHOW_PATCH_DIFF,
+ RESUME_ALLOW_EMPTY,
};
enum empty_action {
@@ -117,6 +129,7 @@ struct am_state {
/* various operating modes and command line options */
int interactive;
+ int no_verify;
int threeway;
int quiet;
int signoff; /* enum signoff_type */
@@ -472,10 +485,12 @@ static void am_destroy(const struct am_state *state)
*/
static int run_applypatch_msg_hook(struct am_state *state)
{
- int ret;
+ int ret = 0;
assert(state->msg);
- ret = run_hooks_l("applypatch-msg", am_path(state, "final-commit"), NULL);
+
+ if (!state->no_verify)
+ ret = run_hooks_l("applypatch-msg", am_path(state, "final-commit"), NULL);
if (!ret) {
FREE_AND_NULL(state->msg);
@@ -492,24 +507,12 @@ static int run_applypatch_msg_hook(struct am_state *state)
*/
static int run_post_rewrite_hook(const struct am_state *state)
{
- struct child_process cp = CHILD_PROCESS_INIT;
- const char *hook = find_hook("post-rewrite");
- int ret;
-
- if (!hook)
- return 0;
-
- strvec_push(&cp.args, hook);
- strvec_push(&cp.args, "rebase");
+ struct run_hooks_opt opt = RUN_HOOKS_OPT_INIT;
- cp.in = xopen(am_path(state, "rewritten"), O_RDONLY);
- cp.stdout_to_stderr = 1;
- cp.trace2_hook_name = "post-rewrite";
+ strvec_push(&opt.args, "rebase");
+ opt.path_to_stdin = am_path(state, "rewritten");
- ret = run_command(&cp);
-
- close(cp.in);
- return ret;
+ return run_hooks_opt("post-rewrite", &opt);
}
/**
@@ -786,7 +789,7 @@ static int split_mail_conv(mail_conv_fn fn, struct am_state *state,
* A split_mail_conv() callback that converts an StGit patch to an RFC2822
* message suitable for parsing with git-mailinfo.
*/
-static int stgit_patch_to_mail(FILE *out, FILE *in, int keep_cr)
+static int stgit_patch_to_mail(FILE *out, FILE *in, int keep_cr UNUSED)
{
struct strbuf sb = STRBUF_INIT;
int subject_printed = 0;
@@ -869,7 +872,7 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,
* A split_patches_conv() callback that converts a mercurial patch to a RFC2822
* message suitable for parsing with git-mailinfo.
*/
-static int hg_patch_to_mail(FILE *out, FILE *in, int keep_cr)
+static int hg_patch_to_mail(FILE *out, FILE *in, int keep_cr UNUSED)
{
struct strbuf sb = STRBUF_INIT;
int rc = 0;
@@ -1075,7 +1078,7 @@ static void am_setup(struct am_state *state, enum patch_format patch_format,
else
write_state_text(state, "applying", "");
- if (!get_oid("HEAD", &curr_head)) {
+ if (!repo_get_oid(the_repository, "HEAD", &curr_head)) {
write_state_text(state, "abort-safety", oid_to_hex(&curr_head));
if (!state->rebasing)
update_ref("am", "ORIG_HEAD", &curr_head, NULL, 0,
@@ -1118,7 +1121,7 @@ static void am_next(struct am_state *state)
unlink(am_path(state, "original-commit"));
delete_ref(NULL, "REBASE_HEAD", NULL, REF_NO_DEREF);
- if (!get_oid("HEAD", &head))
+ if (!repo_get_oid(the_repository, "HEAD", &head))
write_state_text(state, "abort-safety", oid_to_hex(&head));
else
write_state_text(state, "abort-safety", "");
@@ -1147,19 +1150,23 @@ static const char *msgnum(const struct am_state *state)
static void NORETURN die_user_resolve(const struct am_state *state)
{
if (state->resolvemsg) {
- printf_ln("%s", state->resolvemsg);
+ advise_if_enabled(ADVICE_MERGE_CONFLICT, "%s", state->resolvemsg);
} else {
const char *cmdline = state->interactive ? "git am -i" : "git am";
+ struct strbuf sb = STRBUF_INIT;
- printf_ln(_("When you have resolved this problem, run \"%s --continue\"."), cmdline);
- printf_ln(_("If you prefer to skip this patch, run \"%s --skip\" instead."), cmdline);
+ strbuf_addf(&sb, _("When you have resolved this problem, run \"%s --continue\".\n"), cmdline);
+ strbuf_addf(&sb, _("If you prefer to skip this patch, run \"%s --skip\" instead.\n"), cmdline);
if (advice_enabled(ADVICE_AM_WORK_DIR) &&
is_empty_or_missing_file(am_path(state, "patch")) &&
!repo_index_has_changes(the_repository, NULL, NULL))
- printf_ln(_("To record the empty patch as an empty commit, run \"%s --allow-empty\"."), cmdline);
+ strbuf_addf(&sb, _("To record the empty patch as an empty commit, run \"%s --allow-empty\".\n"), cmdline);
+
+ strbuf_addf(&sb, _("To restore the original branch and stop patching, run \"%s --abort\"."), cmdline);
- printf_ln(_("To restore the original branch and stop patching, run \"%s --abort\"."), cmdline);
+ advise_if_enabled(ADVICE_MERGE_CONFLICT, "%s", sb.buf);
+ strbuf_release(&sb);
}
exit(128);
@@ -1283,7 +1290,7 @@ static int parse_mail(struct am_state *state, const char *mail)
strbuf_addstr(&msg, "\n\n");
strbuf_addbuf(&msg, &mi.log_message);
- strbuf_stripspace(&msg, 0);
+ strbuf_stripspace(&msg, NULL);
assert(!state->author_name);
state->author_name = strbuf_detach(&author_name, NULL);
@@ -1338,7 +1345,8 @@ static void get_commit_info(struct am_state *state, struct commit *commit)
size_t ident_len;
struct ident_split id;
- buffer = logmsg_reencode(commit, NULL, get_commit_output_encoding());
+ buffer = repo_logmsg_reencode(the_repository, commit, NULL,
+ get_commit_output_encoding());
ident_line = find_commit_header(buffer, "author", &ident_len);
if (!ident_line)
@@ -1370,7 +1378,7 @@ static void get_commit_info(struct am_state *state, struct commit *commit)
die(_("unable to parse commit %s"), oid_to_hex(&commit->object.oid));
state->msg = xstrdup(msg + 2);
state->msg_len = strlen(state->msg);
- unuse_commit_buffer(commit, buffer);
+ repo_unuse_commit_buffer(the_repository, commit, buffer);
}
/**
@@ -1411,9 +1419,9 @@ static void write_index_patch(const struct am_state *state)
struct rev_info rev_info;
FILE *fp;
- if (!get_oid("HEAD", &head)) {
+ if (!repo_get_oid(the_repository, "HEAD", &head)) {
struct commit *commit = lookup_commit_or_die(&head, "HEAD");
- tree = get_commit_tree(commit);
+ tree = repo_get_commit_tree(the_repository, commit);
} else
tree = lookup_tree(the_repository,
the_repository->hash_algo->empty_tree);
@@ -1429,7 +1437,7 @@ static void write_index_patch(const struct am_state *state)
rev_info.diffopt.close_file = 1;
add_pending_object(&rev_info, &tree->object, "");
diff_setup_done(&rev_info.diffopt);
- run_diff_index(&rev_info, 1);
+ run_diff_index(&rev_info, DIFF_INDEX_CACHED);
release_revisions(&rev_info);
}
@@ -1476,6 +1484,7 @@ static int run_apply(const struct am_state *state, const char *index_file)
int res, opts_left;
int force_apply = 0;
int options = 0;
+ const char **apply_argv;
if (init_apply_state(&apply_state, the_repository, NULL))
BUG("init_apply_state() failed");
@@ -1483,7 +1492,14 @@ static int run_apply(const struct am_state *state, const char *index_file)
strvec_push(&apply_opts, "apply");
strvec_pushv(&apply_opts, state->git_apply_opts.v);
- opts_left = apply_parse_options(apply_opts.nr, apply_opts.v,
+ /*
+ * Build a copy that apply_parse_options() can rearrange.
+ * apply_opts.v keeps referencing the allocated strings for
+ * strvec_clear() to release.
+ */
+ DUP_ARRAY(apply_argv, apply_opts.v, apply_opts.nr);
+
+ opts_left = apply_parse_options(apply_opts.nr, apply_argv,
&apply_state, &force_apply, &options,
NULL);
@@ -1513,14 +1529,15 @@ static int run_apply(const struct am_state *state, const char *index_file)
strvec_clear(&apply_paths);
strvec_clear(&apply_opts);
clear_apply_state(&apply_state);
+ free(apply_argv);
if (res)
return res;
if (index_file) {
/* Reload index as apply_all_patches() will have modified it. */
- discard_cache();
- read_cache_from(index_file);
+ discard_index(&the_index);
+ read_index_from(&the_index, index_file, get_git_dir());
}
return 0;
@@ -1556,14 +1573,14 @@ static int fall_back_threeway(const struct am_state *state, const char *index_pa
struct commit *result;
char *their_tree_name;
- if (get_oid("HEAD", &our_tree) < 0)
+ if (repo_get_oid(the_repository, "HEAD", &our_tree) < 0)
oidcpy(&our_tree, the_hash_algo->empty_tree);
if (build_fake_ancestor(state, index_path))
return error("could not build fake ancestor");
- discard_cache();
- read_cache_from(index_path);
+ discard_index(&the_index);
+ read_index_from(&the_index, index_path, get_git_dir());
if (write_index_as_tree(&orig_tree, &the_index, index_path, 0, NULL))
return error(_("Repository lacks necessary blobs to fall back on 3-way merge."));
@@ -1583,7 +1600,7 @@ static int fall_back_threeway(const struct am_state *state, const char *index_pa
rev_info.diffopt.filter |= diff_filter_bit('M');
add_pending_oid(&rev_info, "HEAD", &our_tree, 0);
diff_setup_done(&rev_info.diffopt);
- run_diff_index(&rev_info, 1);
+ run_diff_index(&rev_info, DIFF_INDEX_CACHED);
release_revisions(&rev_info);
}
@@ -1596,8 +1613,8 @@ static int fall_back_threeway(const struct am_state *state, const char *index_pa
say(state, stdout, _("Falling back to patching base and 3-way merge..."));
- discard_cache();
- read_cache();
+ discard_index(&the_index);
+ repo_read_index(the_repository);
/*
* This is not so wrong. Depending on which base we picked, orig_tree
@@ -1640,13 +1657,13 @@ static void do_commit(const struct am_state *state)
const char *reflog_msg, *author, *committer = NULL;
struct strbuf sb = STRBUF_INIT;
- if (run_hooks("pre-applypatch"))
+ if (!state->no_verify && run_hooks("pre-applypatch"))
exit(1);
- if (write_cache_as_tree(&tree, 0, NULL))
+ if (write_index_as_tree(&tree, &the_index, get_index_file(), 0, NULL))
die(_("git write-tree failed to write a tree"));
- if (!get_oid_commit("HEAD", &parent)) {
+ if (!repo_get_oid_commit(the_repository, "HEAD", &parent)) {
old_oid = &parent;
commit_list_insert(lookup_commit(the_repository, &parent),
&parents);
@@ -1781,7 +1798,8 @@ static void am_run(struct am_state *state, int resume)
unlink(am_path(state, "dirtyindex"));
- if (refresh_and_write_cache(REFRESH_QUIET, 0, 0) < 0)
+ if (repo_refresh_and_write_index(the_repository, REFRESH_QUIET, 0, 0,
+ NULL, NULL, NULL) < 0)
die(_("unable to write index file"));
if (repo_index_has_changes(the_repository, NULL, &sb)) {
@@ -1930,7 +1948,7 @@ static void am_resolve(struct am_state *state, int allow_empty)
}
}
- if (unmerged_cache()) {
+ if (unmerged_index(&the_index)) {
printf_ln(_("You still have unmerged paths in your index.\n"
"You should 'git add' each file with resolved conflicts to mark them as such.\n"
"You might run `git rm` on a file to accept \"deleted by them\" for it."));
@@ -1967,9 +1985,9 @@ static int fast_forward_to(struct tree *head, struct tree *remote, int reset)
if (parse_tree(head) || parse_tree(remote))
return -1;
- hold_locked_index(&lock_file, LOCK_DIE_ON_ERROR);
+ repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
- refresh_cache(REFRESH_QUIET);
+ refresh_index(&the_index, REFRESH_QUIET, NULL, NULL, NULL);
memset(&opts, 0, sizeof(opts));
opts.head_idx = 1;
@@ -1980,8 +1998,8 @@ static int fast_forward_to(struct tree *head, struct tree *remote, int reset)
opts.reset = reset ? UNPACK_RESET_PROTECT_UNTRACKED : 0;
opts.preserve_ignored = 0; /* FIXME: !overwrite_ignore */
opts.fn = twoway_merge;
- init_tree_desc(&t[0], head->buffer, head->size);
- init_tree_desc(&t[1], remote->buffer, remote->size);
+ init_tree_desc(&t[0], &head->object.oid, head->buffer, head->size);
+ init_tree_desc(&t[1], &remote->object.oid, remote->buffer, remote->size);
if (unpack_trees(2, t, &opts)) {
rollback_lock_file(&lock_file);
@@ -2007,7 +2025,7 @@ static int merge_tree(struct tree *tree)
if (parse_tree(tree))
return -1;
- hold_locked_index(&lock_file, LOCK_DIE_ON_ERROR);
+ repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
memset(&opts, 0, sizeof(opts));
opts.head_idx = 1;
@@ -2015,7 +2033,7 @@ static int merge_tree(struct tree *tree)
opts.dst_index = &the_index;
opts.merge = 1;
opts.fn = oneway_merge;
- init_tree_desc(&t[0], tree->buffer, tree->size);
+ init_tree_desc(&t[0], &tree->object.oid, tree->buffer, tree->size);
if (unpack_trees(1, t, &opts)) {
rollback_lock_file(&lock_file);
@@ -2045,12 +2063,12 @@ static int clean_index(const struct object_id *head, const struct object_id *rem
if (!remote_tree)
return error(_("Could not parse object '%s'."), oid_to_hex(remote));
- read_cache_unmerged();
+ repo_read_index_unmerged(the_repository);
if (fast_forward_to(head_tree, head_tree, 1))
return -1;
- if (write_cache_as_tree(&index, 0, NULL))
+ if (write_index_as_tree(&index, &the_index, get_index_file(), 0, NULL))
return -1;
index_tree = parse_tree_indirect(&index);
@@ -2087,7 +2105,7 @@ static void am_skip(struct am_state *state)
am_rerere_clear();
- if (get_oid("HEAD", &head))
+ if (repo_get_oid(the_repository, "HEAD", &head))
oidcpy(&head, the_hash_algo->empty_tree);
if (clean_index(&head, &head))
@@ -2129,7 +2147,7 @@ static int safe_to_abort(const struct am_state *state)
oidclr(&abort_safety);
strbuf_release(&sb);
- if (get_oid("HEAD", &head))
+ if (repo_get_oid(the_repository, "HEAD", &head))
oidclr(&head);
if (oideq(&head, &abort_safety))
@@ -2162,7 +2180,7 @@ static void am_abort(struct am_state *state)
if (!has_curr_head)
oidcpy(&curr_head, the_hash_algo->empty_tree);
- has_orig_head = !get_oid("ORIG_HEAD", &orig_head);
+ has_orig_head = !repo_get_oid(the_repository, "ORIG_HEAD", &orig_head);
if (!has_orig_head)
oidcpy(&orig_head, the_hash_algo->empty_tree);
@@ -2180,28 +2198,26 @@ static void am_abort(struct am_state *state)
am_destroy(state);
}
-static int show_patch(struct am_state *state, enum show_patch_type sub_mode)
+static int show_patch(struct am_state *state, enum resume_type resume_mode)
{
struct strbuf sb = STRBUF_INIT;
const char *patch_path;
int len;
if (!is_null_oid(&state->orig_commit)) {
- const char *av[4] = { "show", NULL, "--", NULL };
- char *new_oid_str;
- int ret;
+ struct child_process cmd = CHILD_PROCESS_INIT;
- av[1] = new_oid_str = xstrdup(oid_to_hex(&state->orig_commit));
- ret = run_command_v_opt(av, RUN_GIT_CMD);
- free(new_oid_str);
- return ret;
+ strvec_pushl(&cmd.args, "show", oid_to_hex(&state->orig_commit),
+ "--", NULL);
+ cmd.git_cmd = 1;
+ return run_command(&cmd);
}
- switch (sub_mode) {
- case SHOW_PATCH_RAW:
+ switch (resume_mode) {
+ case RESUME_SHOW_PATCH_RAW:
patch_path = am_path(state, msgnum(state));
break;
- case SHOW_PATCH_DIFF:
+ case RESUME_SHOW_PATCH_DIFF:
patch_path = am_path(state, "patch");
break;
default:
@@ -2248,77 +2264,35 @@ static int parse_opt_patchformat(const struct option *opt, const char *arg, int
return 0;
}
-enum resume_type {
- RESUME_FALSE = 0,
- RESUME_APPLY,
- RESUME_RESOLVED,
- RESUME_SKIP,
- RESUME_ABORT,
- RESUME_QUIT,
- RESUME_SHOW_PATCH,
- RESUME_ALLOW_EMPTY,
-};
-
-struct resume_mode {
- enum resume_type mode;
- enum show_patch_type sub_mode;
-};
-
static int parse_opt_show_current_patch(const struct option *opt, const char *arg, int unset)
{
int *opt_value = opt->value;
- struct resume_mode *resume = container_of(opt_value, struct resume_mode, mode);
+ BUG_ON_OPT_NEG(unset);
+
+ if (!arg)
+ *opt_value = opt->defval;
+ else if (!strcmp(arg, "raw"))
+ *opt_value = RESUME_SHOW_PATCH_RAW;
+ else if (!strcmp(arg, "diff"))
+ *opt_value = RESUME_SHOW_PATCH_DIFF;
/*
* Please update $__git_showcurrentpatch in git-completion.bash
* when you add new options
*/
- const char *valid_modes[] = {
- [SHOW_PATCH_DIFF] = "diff",
- [SHOW_PATCH_RAW] = "raw"
- };
- int new_value = SHOW_PATCH_RAW;
-
- BUG_ON_OPT_NEG(unset);
-
- if (arg) {
- for (new_value = 0; new_value < ARRAY_SIZE(valid_modes); new_value++) {
- if (!strcmp(arg, valid_modes[new_value]))
- break;
- }
- if (new_value >= ARRAY_SIZE(valid_modes))
- return error(_("invalid value for '%s': '%s'"),
- "--show-current-patch", arg);
- }
-
- if (resume->mode == RESUME_SHOW_PATCH && new_value != resume->sub_mode)
- return error(_("options '%s=%s' and '%s=%s' "
- "cannot be used together"),
- "--show-current-patch", "--show-current-patch", arg, valid_modes[resume->sub_mode]);
-
- resume->mode = RESUME_SHOW_PATCH;
- resume->sub_mode = new_value;
+ else
+ return error(_("invalid value for '%s': '%s'"),
+ "--show-current-patch", arg);
return 0;
}
-static int git_am_config(const char *k, const char *v, void *cb)
-{
- int status;
-
- status = git_gpg_config(k, v, NULL);
- if (status)
- return status;
-
- return git_default_config(k, v, NULL);
-}
-
int cmd_am(int argc, const char **argv, const char *prefix)
{
struct am_state state;
int binary = -1;
int keep_cr = -1;
int patch_format = PATCH_FORMAT_UNKNOWN;
- struct resume_mode resume = { .mode = RESUME_FALSE };
+ enum resume_type resume_mode = RESUME_FALSE;
int in_progress;
int ret = 0;
@@ -2331,6 +2305,8 @@ int cmd_am(int argc, const char **argv, const char *prefix)
struct option options[] = {
OPT_BOOL('i', "interactive", &state.interactive,
N_("run interactively")),
+ OPT_BOOL('n', "no-verify", &state.no_verify,
+ N_("bypass pre-applypatch and applypatch-msg hooks")),
OPT_HIDDEN_BOOL('b', "binary", &binary,
N_("historical option -- no-op")),
OPT_BOOL('3', "3way", &state.threeway,
@@ -2347,12 +2323,9 @@ int cmd_am(int argc, const char **argv, const char *prefix)
N_("pass -b flag to git-mailinfo"), KEEP_NON_PATCH),
OPT_BOOL('m', "message-id", &state.message_id,
N_("pass -m flag to git-mailinfo")),
- OPT_SET_INT_F(0, "keep-cr", &keep_cr,
- N_("pass --keep-cr flag to git-mailsplit for mbox format"),
- 1, PARSE_OPT_NONEG),
- OPT_SET_INT_F(0, "no-keep-cr", &keep_cr,
- N_("do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"),
- 0, PARSE_OPT_NONEG),
+ OPT_SET_INT(0, "keep-cr", &keep_cr,
+ N_("pass --keep-cr flag to git-mailsplit for mbox format"),
+ 1),
OPT_BOOL('c', "scissors", &state.scissors,
N_("strip everything before a scissors line")),
OPT_CALLBACK_F(0, "quoted-cr", &state.quoted_cr, N_("action"),
@@ -2390,27 +2363,27 @@ int cmd_am(int argc, const char **argv, const char *prefix)
PARSE_OPT_NOARG),
OPT_STRING(0, "resolvemsg", &state.resolvemsg, NULL,
N_("override error message when patch failure occurs")),
- OPT_CMDMODE(0, "continue", &resume.mode,
+ OPT_CMDMODE(0, "continue", &resume_mode,
N_("continue applying patches after resolving a conflict"),
RESUME_RESOLVED),
- OPT_CMDMODE('r', "resolved", &resume.mode,
+ OPT_CMDMODE('r', "resolved", &resume_mode,
N_("synonyms for --continue"),
RESUME_RESOLVED),
- OPT_CMDMODE(0, "skip", &resume.mode,
+ OPT_CMDMODE(0, "skip", &resume_mode,
N_("skip the current patch"),
RESUME_SKIP),
- OPT_CMDMODE(0, "abort", &resume.mode,
+ OPT_CMDMODE(0, "abort", &resume_mode,
N_("restore the original branch and abort the patching operation"),
RESUME_ABORT),
- OPT_CMDMODE(0, "quit", &resume.mode,
+ OPT_CMDMODE(0, "quit", &resume_mode,
N_("abort the patching operation but keep HEAD where it is"),
RESUME_QUIT),
- { OPTION_CALLBACK, 0, "show-current-patch", &resume.mode,
+ { OPTION_CALLBACK, 0, "show-current-patch", &resume_mode,
"(diff|raw)",
N_("show the patch being applied"),
PARSE_OPT_CMDMODE | PARSE_OPT_OPTARG | PARSE_OPT_NONEG | PARSE_OPT_LITERAL_ARGHELP,
- parse_opt_show_current_patch, RESUME_SHOW_PATCH },
- OPT_CMDMODE(0, "allow-empty", &resume.mode,
+ parse_opt_show_current_patch, RESUME_SHOW_PATCH_RAW },
+ OPT_CMDMODE(0, "allow-empty", &resume_mode,
N_("record the empty patch as an empty commit"),
RESUME_ALLOW_EMPTY),
OPT_BOOL(0, "committer-date-is-author-date",
@@ -2422,7 +2395,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
{ OPTION_STRING, 'S', "gpg-sign", &state.sign_commit, N_("key-id"),
N_("GPG-sign commits"),
PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
- OPT_CALLBACK_F(STOP_ON_EMPTY_COMMIT, "empty", &state.empty_type, "{stop,drop,keep}",
+ OPT_CALLBACK_F(0, "empty", &state.empty_type, "(stop|drop|keep)",
N_("how to handle empty patches"),
PARSE_OPT_NONEG, am_option_parse_empty),
OPT_HIDDEN_BOOL(0, "rebasing", &state.rebasing,
@@ -2433,7 +2406,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
if (argc == 2 && !strcmp(argv[1], "-h"))
usage_with_options(usage, options);
- git_config(git_am_config, NULL);
+ git_config(git_default_config, NULL);
am_state_init(&state);
@@ -2465,12 +2438,12 @@ int cmd_am(int argc, const char **argv, const char *prefix)
* intend to feed us a patch but wanted to continue
* unattended.
*/
- if (argc || (resume.mode == RESUME_FALSE && !isatty(0)))
+ if (argc || (resume_mode == RESUME_FALSE && !isatty(0)))
die(_("previous rebase directory %s still exists but mbox given."),
state.dir);
- if (resume.mode == RESUME_FALSE)
- resume.mode = RESUME_APPLY;
+ if (resume_mode == RESUME_FALSE)
+ resume_mode = RESUME_APPLY;
if (state.signoff == SIGNOFF_EXPLICIT)
am_append_signoff(&state);
@@ -2484,7 +2457,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
* stray directories.
*/
if (file_exists(state.dir) && !state.rebasing) {
- if (resume.mode == RESUME_ABORT || resume.mode == RESUME_QUIT) {
+ if (resume_mode == RESUME_ABORT || resume_mode == RESUME_QUIT) {
am_destroy(&state);
am_state_release(&state);
return 0;
@@ -2495,7 +2468,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
state.dir);
}
- if (resume.mode)
+ if (resume_mode)
die(_("Resolve operation not in progress, we are not resuming."));
for (i = 0; i < argc; i++) {
@@ -2513,7 +2486,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
strvec_clear(&paths);
}
- switch (resume.mode) {
+ switch (resume_mode) {
case RESUME_FALSE:
am_run(&state, 0);
break;
@@ -2522,7 +2495,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
break;
case RESUME_RESOLVED:
case RESUME_ALLOW_EMPTY:
- am_resolve(&state, resume.mode == RESUME_ALLOW_EMPTY ? 1 : 0);
+ am_resolve(&state, resume_mode == RESUME_ALLOW_EMPTY ? 1 : 0);
break;
case RESUME_SKIP:
am_skip(&state);
@@ -2534,8 +2507,9 @@ int cmd_am(int argc, const char **argv, const char *prefix)
am_rerere_clear();
am_destroy(&state);
break;
- case RESUME_SHOW_PATCH:
- ret = show_patch(&state, resume.sub_mode);
+ case RESUME_SHOW_PATCH_RAW:
+ case RESUME_SHOW_PATCH_DIFF:
+ ret = show_patch(&state, resume_mode);
break;
default:
BUG("invalid resume value");
diff --git a/builtin/apply.c b/builtin/apply.c
index 555219d..861a019 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -1,6 +1,6 @@
-#include "cache.h"
#include "builtin.h"
-#include "parse-options.h"
+#include "gettext.h"
+#include "repository.h"
#include "apply.h"
static const char * const apply_usage[] = {
diff --git a/builtin/archive.c b/builtin/archive.c
index 7176b04..15ee1ec 100644
--- a/builtin/archive.c
+++ b/builtin/archive.c
@@ -2,13 +2,13 @@
* Copyright (c) 2006 Franck Bui-Huu
* Copyright (c) 2006 Rene Scharfe
*/
-#include "cache.h"
#include "builtin.h"
#include "archive.h"
+#include "gettext.h"
#include "transport.h"
#include "parse-options.h"
#include "pkt-line.h"
-#include "sideband.h"
+#include "repository.h"
static void create_output_file(const char *output_file)
{
@@ -75,13 +75,13 @@ static int run_remote_archiver(int argc, const char **argv,
#define PARSE_OPT_KEEP_ALL ( PARSE_OPT_KEEP_DASHDASH | \
PARSE_OPT_KEEP_ARGV0 | \
- PARSE_OPT_KEEP_UNKNOWN | \
+ PARSE_OPT_KEEP_UNKNOWN_OPT | \
PARSE_OPT_NO_INTERNAL_HELP )
int cmd_archive(int argc, const char **argv, const char *prefix)
{
const char *exec = "git-upload-archive";
- const char *output = NULL;
+ char *output = NULL;
const char *remote = NULL;
struct option local_opts[] = {
OPT_FILENAME('o', "output", &output,
@@ -106,5 +106,6 @@ int cmd_archive(int argc, const char **argv, const char *prefix)
setvbuf(stderr, NULL, _IOLBF, BUFSIZ);
+ UNLEAK(output);
return write_archive(argc, argv, prefix, the_repository, output, 0);
}
diff --git a/builtin/bisect--helper.c b/builtin/bisect.c
index 8a052c7..f69c3f7 100644
--- a/builtin/bisect--helper.c
+++ b/builtin/bisect.c
@@ -1,37 +1,62 @@
#include "builtin.h"
-#include "cache.h"
+#include "copy.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-name.h"
#include "parse-options.h"
#include "bisect.h"
#include "refs.h"
-#include "dir.h"
#include "strvec.h"
#include "run-command.h"
+#include "oid-array.h"
+#include "path.h"
#include "prompt.h"
#include "quote.h"
#include "revision.h"
static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
-static GIT_PATH_FUNC(git_path_bisect_expected_rev, "BISECT_EXPECTED_REV")
static GIT_PATH_FUNC(git_path_bisect_ancestors_ok, "BISECT_ANCESTORS_OK")
static GIT_PATH_FUNC(git_path_bisect_start, "BISECT_START")
static GIT_PATH_FUNC(git_path_bisect_log, "BISECT_LOG")
-static GIT_PATH_FUNC(git_path_head_name, "head-name")
static GIT_PATH_FUNC(git_path_bisect_names, "BISECT_NAMES")
static GIT_PATH_FUNC(git_path_bisect_first_parent, "BISECT_FIRST_PARENT")
static GIT_PATH_FUNC(git_path_bisect_run, "BISECT_RUN")
-static const char * const git_bisect_helper_usage[] = {
- N_("git bisect--helper --bisect-reset [<commit>]"),
- "git bisect--helper --bisect-terms [--term-good | --term-old | --term-bad | --term-new]",
- N_("git bisect--helper --bisect-start [--term-{new,bad}=<term> --term-{old,good}=<term>]"
- " [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] [<paths>...]"),
- "git bisect--helper --bisect-next",
- N_("git bisect--helper --bisect-state (bad|new) [<rev>]"),
- N_("git bisect--helper --bisect-state (good|old) [<rev>...]"),
- N_("git bisect--helper --bisect-replay <filename>"),
- N_("git bisect--helper --bisect-skip [(<rev>|<range>)...]"),
- "git bisect--helper --bisect-visualize",
- N_("git bisect--helper --bisect-run <cmd>..."),
+#define BUILTIN_GIT_BISECT_START_USAGE \
+ N_("git bisect start [--term-(new|bad)=<term> --term-(old|good)=<term>]" \
+ " [--no-checkout] [--first-parent] [<bad> [<good>...]] [--]" \
+ " [<pathspec>...]")
+#define BUILTIN_GIT_BISECT_STATE_USAGE \
+ N_("git bisect (good|bad) [<rev>...]")
+#define BUILTIN_GIT_BISECT_TERMS_USAGE \
+ "git bisect terms [--term-good | --term-bad]"
+#define BUILTIN_GIT_BISECT_SKIP_USAGE \
+ N_("git bisect skip [(<rev>|<range>)...]")
+#define BUILTIN_GIT_BISECT_NEXT_USAGE \
+ "git bisect next"
+#define BUILTIN_GIT_BISECT_RESET_USAGE \
+ N_("git bisect reset [<commit>]")
+#define BUILTIN_GIT_BISECT_VISUALIZE_USAGE \
+ "git bisect visualize"
+#define BUILTIN_GIT_BISECT_REPLAY_USAGE \
+ N_("git bisect replay <logfile>")
+#define BUILTIN_GIT_BISECT_LOG_USAGE \
+ "git bisect log"
+#define BUILTIN_GIT_BISECT_RUN_USAGE \
+ N_("git bisect run <cmd> [<arg>...]")
+
+static const char * const git_bisect_usage[] = {
+ BUILTIN_GIT_BISECT_START_USAGE,
+ BUILTIN_GIT_BISECT_STATE_USAGE,
+ BUILTIN_GIT_BISECT_TERMS_USAGE,
+ BUILTIN_GIT_BISECT_SKIP_USAGE,
+ BUILTIN_GIT_BISECT_NEXT_USAGE,
+ BUILTIN_GIT_BISECT_RESET_USAGE,
+ BUILTIN_GIT_BISECT_VISUALIZE_USAGE,
+ BUILTIN_GIT_BISECT_REPLAY_USAGE,
+ BUILTIN_GIT_BISECT_LOG_USAGE,
+ BUILTIN_GIT_BISECT_RUN_USAGE,
NULL
};
@@ -206,32 +231,31 @@ static int bisect_reset(const char *commit)
struct strbuf branch = STRBUF_INIT;
if (!commit) {
- if (strbuf_read_file(&branch, git_path_bisect_start(), 0) < 1) {
+ if (!strbuf_read_file(&branch, git_path_bisect_start(), 0))
printf(_("We are not bisecting.\n"));
- return 0;
- }
- strbuf_rtrim(&branch);
+ else
+ strbuf_rtrim(&branch);
} else {
struct object_id oid;
- if (get_oid_commit(commit, &oid))
+ if (repo_get_oid_commit(the_repository, commit, &oid))
return error(_("'%s' is not a valid commit"), commit);
strbuf_addstr(&branch, commit);
}
- if (!ref_exists("BISECT_HEAD")) {
- struct strvec argv = STRVEC_INIT;
+ if (branch.len && !ref_exists("BISECT_HEAD")) {
+ struct child_process cmd = CHILD_PROCESS_INIT;
- strvec_pushl(&argv, "checkout", branch.buf, "--", NULL);
- if (run_command_v_opt(argv.v, RUN_GIT_CMD)) {
+ cmd.git_cmd = 1;
+ strvec_pushl(&cmd.args, "checkout", "--ignore-other-worktrees",
+ branch.buf, "--", NULL);
+ if (run_command(&cmd)) {
error(_("could not check out original"
" HEAD '%s'. Try 'git bisect"
" reset <commit>'."), branch.buf);
strbuf_release(&branch);
- strvec_clear(&argv);
return -1;
}
- strvec_clear(&argv);
}
strbuf_release(&branch);
@@ -245,7 +269,8 @@ static void log_commit(FILE *fp, char *fmt, const char *state,
struct strbuf commit_msg = STRBUF_INIT;
char *label = xstrfmt(fmt, state);
- format_commit_message(commit, "%s", &commit_msg, &pp);
+ repo_format_commit_message(the_repository, commit, "%s", &commit_msg,
+ &pp);
fprintf(fp, "# %s: [%s] %s\n", label, oid_to_hex(&commit->object.oid),
commit_msg.buf);
@@ -272,7 +297,7 @@ static int bisect_write(const char *state, const char *rev,
goto finish;
}
- if (get_oid(rev, &oid)) {
+ if (repo_get_oid(the_repository, rev, &oid)) {
res = error(_("couldn't get the oid of the rev '%s'"), rev);
goto finish;
}
@@ -329,8 +354,9 @@ static int check_and_set_terms(struct bisect_terms *terms, const char *cmd)
return 0;
}
-static int inc_nr(const char *refname, const struct object_id *oid,
- int flag, void *cb_data)
+static int inc_nr(const char *refname UNUSED,
+ const struct object_id *oid UNUSED,
+ int flag UNUSED, void *cb_data)
{
unsigned int *nr = (unsigned int *)cb_data;
(*nr)++;
@@ -518,7 +544,7 @@ finish:
}
static int add_bisect_ref(const char *refname, const struct object_id *oid,
- int flags, void *cb)
+ int flags UNUSED, void *cb)
{
struct add_bisect_ref_data *data = cb;
@@ -546,7 +572,7 @@ static int prepare_revs(struct bisect_terms *terms, struct rev_info *revs)
* sets up a revision walk.
*/
reset_revision_walk();
- init_revisions(revs, NULL);
+ repo_init_revisions(the_repository, revs, NULL);
setup_revisions(0, NULL, revs, NULL);
for_each_glob_ref_in(add_bisect_ref, bad, "refs/bisect/", &cb);
cb.object_flags = UNINTERESTING;
@@ -582,8 +608,8 @@ static int bisect_skipped_commits(struct bisect_terms *terms)
while ((commit = get_revision(&revs)) != NULL) {
strbuf_reset(&commit_name);
- format_commit_message(commit, "%s",
- &commit_name, &pp);
+ repo_format_commit_message(the_repository, commit, "%s",
+ &commit_name, &pp);
fprintf(fp, "# possible first %s commit: [%s] %s\n",
terms->term_bad, oid_to_hex(&commit->object.oid),
commit_name.buf);
@@ -612,7 +638,8 @@ static int bisect_successful(struct bisect_terms *terms)
read_ref(bad_ref, &oid);
commit = lookup_commit_reference_by_name(bad_ref);
- format_commit_message(commit, "%s", &commit_name, &pp);
+ repo_format_commit_message(the_repository, commit, "%s", &commit_name,
+ &pp);
res = append_to_file(git_path_bisect_log(), "# first %s commit: [%s] %s\n",
terms->term_bad, oid_to_hex(&commit->object.oid),
@@ -656,7 +683,8 @@ static enum bisect_error bisect_auto_next(struct bisect_terms *terms, const char
return bisect_next(terms, prefix);
}
-static enum bisect_error bisect_start(struct bisect_terms *terms, const char **argv, int argc)
+static enum bisect_error bisect_start(struct bisect_terms *terms, int argc,
+ const char **argv)
{
int no_checkout = 0;
int first_parent_only = 0;
@@ -753,7 +781,7 @@ static enum bisect_error bisect_start(struct bisect_terms *terms, const char **a
*/
head = resolve_ref_unsafe("HEAD", 0, &head_oid, &flags);
if (!head)
- if (get_oid("HEAD", &head_oid))
+ if (repo_get_oid(the_repository, "HEAD", &head_oid))
return error(_("bad HEAD - I need a HEAD"));
/*
@@ -764,11 +792,12 @@ static enum bisect_error bisect_start(struct bisect_terms *terms, const char **a
strbuf_read_file(&start_head, git_path_bisect_start(), 0);
strbuf_trim(&start_head);
if (!no_checkout) {
- struct strvec argv = STRVEC_INIT;
+ struct child_process cmd = CHILD_PROCESS_INIT;
- strvec_pushl(&argv, "checkout", start_head.buf,
+ cmd.git_cmd = 1;
+ strvec_pushl(&cmd.args, "checkout", start_head.buf,
"--", NULL);
- if (run_command_v_opt(argv.v, RUN_GIT_CMD)) {
+ if (run_command(&cmd)) {
res = error(_("checking out '%s' failed."
" Try 'git bisect start "
"<valid-branch>'."),
@@ -778,19 +807,12 @@ static enum bisect_error bisect_start(struct bisect_terms *terms, const char **a
}
} else {
/* Get the rev from where we start. */
- if (!get_oid(head, &head_oid) &&
+ if (!repo_get_oid(the_repository, head, &head_oid) &&
!starts_with(head, "refs/heads/")) {
strbuf_reset(&start_head);
strbuf_addstr(&start_head, oid_to_hex(&head_oid));
- } else if (!get_oid(head, &head_oid) &&
+ } else if (!repo_get_oid(the_repository, head, &head_oid) &&
skip_prefix(head, "refs/heads/", &head)) {
- /*
- * This error message should only be triggered by
- * cogito usage, and cogito users should understand
- * it relates to cg-seek.
- */
- if (!is_empty_or_missing_file(git_path_head_name()))
- return error(_("won't bisect on cg-seek'ed tree"));
strbuf_addstr(&start_head, head);
} else {
return error(_("bad HEAD - strange symbolic ref"));
@@ -812,7 +834,7 @@ static enum bisect_error bisect_start(struct bisect_terms *terms, const char **a
write_file(git_path_bisect_first_parent(), "\n");
if (no_checkout) {
- if (get_oid(start_head.buf, &oid) < 0) {
+ if (repo_get_oid(the_repository, start_head.buf, &oid) < 0) {
res = error(_("invalid ref: '%s'"), start_head.buf);
goto finish;
}
@@ -885,18 +907,17 @@ static int bisect_autostart(struct bisect_terms *terms)
yesno = git_prompt(_("Do you want me to do it for you "
"[Y/n]? "), PROMPT_ECHO);
res = tolower(*yesno) == 'n' ?
- -1 : bisect_start(terms, empty_strvec, 0);
+ -1 : bisect_start(terms, 0, empty_strvec);
return res;
}
-static enum bisect_error bisect_state(struct bisect_terms *terms, const char **argv,
- int argc)
+static enum bisect_error bisect_state(struct bisect_terms *terms, int argc,
+ const char **argv)
{
const char *state;
int i, verify_expected = 1;
struct object_id oid, expected;
- struct strbuf buf = STRBUF_INIT;
struct oid_array revs = OID_ARRAY_INIT;
if (!argc)
@@ -917,11 +938,12 @@ static enum bisect_error bisect_state(struct bisect_terms *terms, const char **a
if (argc == 0) {
const char *head = "BISECT_HEAD";
- enum get_oid_result res_head = get_oid(head, &oid);
+ enum get_oid_result res_head = repo_get_oid(the_repository,
+ head, &oid);
if (res_head == MISSING_OBJECT) {
head = "HEAD";
- res_head = get_oid(head, &oid);
+ res_head = repo_get_oid(the_repository, head, &oid);
}
if (res_head)
@@ -937,7 +959,7 @@ static enum bisect_error bisect_state(struct bisect_terms *terms, const char **a
for (; argc; argc--, argv++) {
struct commit *commit;
- if (get_oid(*argv, &oid)){
+ if (repo_get_oid(the_repository, *argv, &oid)){
error(_("Bad rev input: %s"), *argv);
oid_array_clear(&revs);
return BISECT_FAILED;
@@ -950,10 +972,8 @@ static enum bisect_error bisect_state(struct bisect_terms *terms, const char **a
oid_array_append(&revs, &commit->object.oid);
}
- if (strbuf_read_file(&buf, git_path_bisect_expected_rev(), 0) < the_hash_algo->hexsz ||
- get_oid_hex(buf.buf, &expected) < 0)
+ if (read_ref("BISECT_EXPECTED_REV", &expected))
verify_expected = 0; /* Ignore invalid file contents */
- strbuf_release(&buf);
for (i = 0; i < revs.nr; i++) {
if (bisect_write(state, oid_to_hex(&revs.oid[i]), terms, 0)) {
@@ -962,7 +982,7 @@ static enum bisect_error bisect_state(struct bisect_terms *terms, const char **a
}
if (verify_expected && !oideq(&revs.oid[i], &expected)) {
unlink_or_warn(git_path_bisect_ancestors_ok());
- unlink_or_warn(git_path_bisect_expected_rev());
+ delete_ref(NULL, "BISECT_EXPECTED_REV", NULL, REF_NO_DEREF);
verify_expected = 0;
}
}
@@ -1010,7 +1030,7 @@ static int process_replay_line(struct bisect_terms *terms, struct strbuf *line)
struct strvec argv = STRVEC_INIT;
int res;
sq_dequote_to_strvec(rev, &argv);
- res = bisect_start(terms, argv.v, argv.nr);
+ res = bisect_start(terms, argv.nr, argv.v);
strvec_clear(&argv);
return res;
}
@@ -1060,7 +1080,8 @@ static enum bisect_error bisect_replay(struct bisect_terms *terms, const char *f
return bisect_auto_next(terms, NULL);
}
-static enum bisect_error bisect_skip(struct bisect_terms *terms, const char **argv, int argc)
+static enum bisect_error bisect_skip(struct bisect_terms *terms, int argc,
+ const char **argv)
{
int i;
enum bisect_error res;
@@ -1075,7 +1096,7 @@ static enum bisect_error bisect_skip(struct bisect_terms *terms, const char **ar
struct rev_info revs;
struct commit *commit;
- init_revisions(&revs, NULL);
+ repo_init_revisions(the_repository, &revs, NULL);
setup_revisions(2, argv + i - 1, &revs, NULL);
if (prepare_revision_walk(&revs))
@@ -1090,59 +1111,68 @@ static enum bisect_error bisect_skip(struct bisect_terms *terms, const char **ar
strvec_push(&argv_state, argv[i]);
}
}
- res = bisect_state(terms, argv_state.v, argv_state.nr);
+ res = bisect_state(terms, argv_state.nr, argv_state.v);
strvec_clear(&argv_state);
return res;
}
-static int bisect_visualize(struct bisect_terms *terms, const char **argv, int argc)
+static int bisect_visualize(struct bisect_terms *terms, int argc,
+ const char **argv)
{
- struct strvec args = STRVEC_INIT;
- int flags = RUN_COMMAND_NO_STDIN, res = 0;
+ struct child_process cmd = CHILD_PROCESS_INIT;
struct strbuf sb = STRBUF_INIT;
if (bisect_next_check(terms, NULL) != 0)
return BISECT_FAILED;
+ cmd.no_stdin = 1;
if (!argc) {
if ((getenv("DISPLAY") || getenv("SESSIONNAME") || getenv("MSYSTEM") ||
getenv("SECURITYSESSIONID")) && exists_in_PATH("gitk")) {
- strvec_push(&args, "gitk");
+ strvec_push(&cmd.args, "gitk");
} else {
- strvec_push(&args, "log");
- flags |= RUN_GIT_CMD;
+ strvec_push(&cmd.args, "log");
+ cmd.git_cmd = 1;
}
} else {
if (argv[0][0] == '-') {
- strvec_push(&args, "log");
- flags |= RUN_GIT_CMD;
+ strvec_push(&cmd.args, "log");
+ cmd.git_cmd = 1;
} else if (strcmp(argv[0], "tig") && !starts_with(argv[0], "git"))
- flags |= RUN_GIT_CMD;
+ cmd.git_cmd = 1;
- strvec_pushv(&args, argv);
+ strvec_pushv(&cmd.args, argv);
}
- strvec_pushl(&args, "--bisect", "--", NULL);
+ strvec_pushl(&cmd.args, "--bisect", "--", NULL);
strbuf_read_file(&sb, git_path_bisect_names(), 0);
- sq_dequote_to_strvec(sb.buf, &args);
+ sq_dequote_to_strvec(sb.buf, &cmd.args);
strbuf_release(&sb);
- res = run_command_v_opt(args.v, flags);
- strvec_clear(&args);
- return res;
+ return run_command(&cmd);
}
-static int get_first_good(const char *refname, const struct object_id *oid,
- int flag, void *cb_data)
+static int get_first_good(const char *refname UNUSED,
+ const struct object_id *oid,
+ int flag UNUSED, void *cb_data)
{
oidcpy(cb_data, oid);
return 1;
}
-static int verify_good(const struct bisect_terms *terms,
- const char **quoted_argv)
+static int do_bisect_run(const char *command)
+{
+ struct child_process cmd = CHILD_PROCESS_INIT;
+
+ printf(_("running %s\n"), command);
+ cmd.use_shell = 1;
+ strvec_push(&cmd.args, command);
+ return run_command(&cmd);
+}
+
+static int verify_good(const struct bisect_terms *terms, const char *command)
{
int rc;
enum bisect_error res;
@@ -1162,8 +1192,7 @@ static int verify_good(const struct bisect_terms *terms,
if (res != BISECT_OK)
return -1;
- printf(_("running %s\n"), quoted_argv[0]);
- rc = run_command_v_opt(quoted_argv, RUN_USING_SHELL);
+ rc = do_bisect_run(command);
res = bisect_checkout(&current_rev, no_checkout);
if (res != BISECT_OK)
@@ -1172,11 +1201,10 @@ static int verify_good(const struct bisect_terms *terms,
return rc;
}
-static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
+static int bisect_run(struct bisect_terms *terms, int argc, const char **argv)
{
int res = BISECT_OK;
struct strbuf command = STRBUF_INIT;
- struct strvec run_args = STRVEC_INIT;
const char *new_state;
int temporary_stdout_fd, saved_stdout;
int is_first_run = 1;
@@ -1184,18 +1212,15 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
if (bisect_next_check(terms, NULL))
return BISECT_FAILED;
- if (argc)
- sq_quote_argv(&command, argv);
- else {
+ if (!argc) {
error(_("bisect run failed: no command provided."));
return BISECT_FAILED;
}
- strvec_push(&run_args, command.buf);
-
+ sq_quote_argv(&command, argv);
+ strbuf_ltrim(&command);
while (1) {
- printf(_("running %s\n"), command.buf);
- res = run_command_v_opt(run_args.v, RUN_USING_SHELL);
+ res = do_bisect_run(command.buf);
/*
* Exit code 126 and 127 can either come from the shell
@@ -1205,10 +1230,10 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
* missing or non-executable script.
*/
if (is_first_run && (res == 126 || res == 127)) {
- int rc = verify_good(terms, run_args.v);
+ int rc = verify_good(terms, command.buf);
is_first_run = 0;
- if (rc < 0) {
- error(_("unable to verify '%s' on good"
+ if (rc < 0 || 128 <= rc) {
+ error(_("unable to verify %s on good"
" revision"), command.buf);
res = BISECT_FAILED;
break;
@@ -1223,7 +1248,7 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
if (res < 0 || 128 <= res) {
error(_("bisect run failed: exit code %d from"
- " '%s' is < 0 or >= 128"), res, command.buf);
+ " %s is < 0 or >= 128"), res, command.buf);
break;
}
@@ -1245,7 +1270,7 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
saved_stdout = dup(1);
dup2(temporary_stdout_fd, 1);
- res = bisect_state(terms, &new_state, 1);
+ res = bisect_state(terms, 1, &new_state);
fflush(stdout);
dup2(saved_stdout, 1);
@@ -1257,14 +1282,14 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
if (res == BISECT_ONLY_SKIPPED_LEFT)
error(_("bisect run cannot continue any more"));
else if (res == BISECT_INTERNAL_SUCCESS_MERGE_BASE) {
- printf(_("bisect run success"));
+ puts(_("bisect run success"));
res = BISECT_OK;
} else if (res == BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND) {
- printf(_("bisect found first bad commit"));
+ puts(_("bisect found first bad commit"));
res = BISECT_OK;
} else if (res) {
- error(_("bisect run failed: 'git bisect--helper --bisect-state"
- " %s' exited with error code %d"), new_state, res);
+ error(_("bisect run failed: 'git bisect %s'"
+ " exited with error code %d"), new_state, res);
} else {
continue;
}
@@ -1272,126 +1297,147 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
}
strbuf_release(&command);
- strvec_clear(&run_args);
return res;
}
-int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
+static int cmd_bisect__reset(int argc, const char **argv, const char *prefix UNUSED)
+{
+ if (argc > 1)
+ return error(_("'%s' requires either no argument or a commit"),
+ "git bisect reset");
+ return bisect_reset(argc ? argv[0] : NULL);
+}
+
+static int cmd_bisect__terms(int argc, const char **argv, const char *prefix UNUSED)
+{
+ int res;
+ struct bisect_terms terms = { 0 };
+
+ if (argc > 1)
+ return error(_("'%s' requires 0 or 1 argument"),
+ "git bisect terms");
+ res = bisect_terms(&terms, argc == 1 ? argv[0] : NULL);
+ free_terms(&terms);
+ return res;
+}
+
+static int cmd_bisect__start(int argc, const char **argv, const char *prefix UNUSED)
{
- enum {
- BISECT_RESET = 1,
- BISECT_NEXT_CHECK,
- BISECT_TERMS,
- BISECT_START,
- BISECT_AUTOSTART,
- BISECT_NEXT,
- BISECT_STATE,
- BISECT_LOG,
- BISECT_REPLAY,
- BISECT_SKIP,
- BISECT_VISUALIZE,
- BISECT_RUN,
- } cmdmode = 0;
- int res = 0, nolog = 0;
+ int res;
+ struct bisect_terms terms = { 0 };
+
+ set_terms(&terms, "bad", "good");
+ res = bisect_start(&terms, argc, argv);
+ free_terms(&terms);
+ return res;
+}
+
+static int cmd_bisect__next(int argc, const char **argv UNUSED, const char *prefix)
+{
+ int res;
+ struct bisect_terms terms = { 0 };
+
+ if (argc)
+ return error(_("'%s' requires 0 arguments"),
+ "git bisect next");
+ get_terms(&terms);
+ res = bisect_next(&terms, prefix);
+ free_terms(&terms);
+ return res;
+}
+
+static int cmd_bisect__log(int argc UNUSED, const char **argv UNUSED, const char *prefix UNUSED)
+{
+ return bisect_log();
+}
+
+static int cmd_bisect__replay(int argc, const char **argv, const char *prefix UNUSED)
+{
+ int res;
+ struct bisect_terms terms = { 0 };
+
+ if (argc != 1)
+ return error(_("no logfile given"));
+ set_terms(&terms, "bad", "good");
+ res = bisect_replay(&terms, argv[0]);
+ free_terms(&terms);
+ return res;
+}
+
+static int cmd_bisect__skip(int argc, const char **argv, const char *prefix UNUSED)
+{
+ int res;
+ struct bisect_terms terms = { 0 };
+
+ set_terms(&terms, "bad", "good");
+ get_terms(&terms);
+ res = bisect_skip(&terms, argc, argv);
+ free_terms(&terms);
+ return res;
+}
+
+static int cmd_bisect__visualize(int argc, const char **argv, const char *prefix UNUSED)
+{
+ int res;
+ struct bisect_terms terms = { 0 };
+
+ get_terms(&terms);
+ res = bisect_visualize(&terms, argc, argv);
+ free_terms(&terms);
+ return res;
+}
+
+static int cmd_bisect__run(int argc, const char **argv, const char *prefix UNUSED)
+{
+ int res;
+ struct bisect_terms terms = { 0 };
+
+ if (!argc)
+ return error(_("'%s' failed: no command provided."), "git bisect run");
+ get_terms(&terms);
+ res = bisect_run(&terms, argc, argv);
+ free_terms(&terms);
+ return res;
+}
+
+int cmd_bisect(int argc, const char **argv, const char *prefix)
+{
+ int res = 0;
+ parse_opt_subcommand_fn *fn = NULL;
struct option options[] = {
- OPT_CMDMODE(0, "bisect-reset", &cmdmode,
- N_("reset the bisection state"), BISECT_RESET),
- OPT_CMDMODE(0, "bisect-next-check", &cmdmode,
- N_("check whether bad or good terms exist"), BISECT_NEXT_CHECK),
- OPT_CMDMODE(0, "bisect-terms", &cmdmode,
- N_("print out the bisect terms"), BISECT_TERMS),
- OPT_CMDMODE(0, "bisect-start", &cmdmode,
- N_("start the bisect session"), BISECT_START),
- OPT_CMDMODE(0, "bisect-next", &cmdmode,
- N_("find the next bisection commit"), BISECT_NEXT),
- OPT_CMDMODE(0, "bisect-state", &cmdmode,
- N_("mark the state of ref (or refs)"), BISECT_STATE),
- OPT_CMDMODE(0, "bisect-log", &cmdmode,
- N_("list the bisection steps so far"), BISECT_LOG),
- OPT_CMDMODE(0, "bisect-replay", &cmdmode,
- N_("replay the bisection process from the given file"), BISECT_REPLAY),
- OPT_CMDMODE(0, "bisect-skip", &cmdmode,
- N_("skip some commits for checkout"), BISECT_SKIP),
- OPT_CMDMODE(0, "bisect-visualize", &cmdmode,
- N_("visualize the bisection"), BISECT_VISUALIZE),
- OPT_CMDMODE(0, "bisect-run", &cmdmode,
- N_("use <cmd>... to automatically bisect"), BISECT_RUN),
- OPT_BOOL(0, "no-log", &nolog,
- N_("no log for BISECT_WRITE")),
+ OPT_SUBCOMMAND("reset", &fn, cmd_bisect__reset),
+ OPT_SUBCOMMAND("terms", &fn, cmd_bisect__terms),
+ OPT_SUBCOMMAND("start", &fn, cmd_bisect__start),
+ OPT_SUBCOMMAND("next", &fn, cmd_bisect__next),
+ OPT_SUBCOMMAND("log", &fn, cmd_bisect__log),
+ OPT_SUBCOMMAND("replay", &fn, cmd_bisect__replay),
+ OPT_SUBCOMMAND("skip", &fn, cmd_bisect__skip),
+ OPT_SUBCOMMAND("visualize", &fn, cmd_bisect__visualize),
+ OPT_SUBCOMMAND("view", &fn, cmd_bisect__visualize),
+ OPT_SUBCOMMAND("run", &fn, cmd_bisect__run),
OPT_END()
};
- struct bisect_terms terms = { .term_good = NULL, .term_bad = NULL };
+ argc = parse_options(argc, argv, prefix, options, git_bisect_usage,
+ PARSE_OPT_SUBCOMMAND_OPTIONAL);
- argc = parse_options(argc, argv, prefix, options,
- git_bisect_helper_usage,
- PARSE_OPT_KEEP_DASHDASH | PARSE_OPT_KEEP_UNKNOWN);
+ if (!fn) {
+ struct bisect_terms terms = { 0 };
- if (!cmdmode)
- usage_with_options(git_bisect_helper_usage, options);
+ if (!argc)
+ usage_msg_opt(_("need a command"), git_bisect_usage, options);
- switch (cmdmode) {
- case BISECT_RESET:
- if (argc > 1)
- return error(_("--bisect-reset requires either no argument or a commit"));
- res = bisect_reset(argc ? argv[0] : NULL);
- break;
- case BISECT_TERMS:
- if (argc > 1)
- return error(_("--bisect-terms requires 0 or 1 argument"));
- res = bisect_terms(&terms, argc == 1 ? argv[0] : NULL);
- break;
- case BISECT_START:
- set_terms(&terms, "bad", "good");
- res = bisect_start(&terms, argv, argc);
- break;
- case BISECT_NEXT:
- if (argc)
- return error(_("--bisect-next requires 0 arguments"));
- get_terms(&terms);
- res = bisect_next(&terms, prefix);
- break;
- case BISECT_STATE:
- set_terms(&terms, "bad", "good");
- get_terms(&terms);
- res = bisect_state(&terms, argv, argc);
- break;
- case BISECT_LOG:
- if (argc)
- return error(_("--bisect-log requires 0 arguments"));
- res = bisect_log();
- break;
- case BISECT_REPLAY:
- if (argc != 1)
- return error(_("no logfile given"));
- set_terms(&terms, "bad", "good");
- res = bisect_replay(&terms, argv[0]);
- break;
- case BISECT_SKIP:
set_terms(&terms, "bad", "good");
get_terms(&terms);
- res = bisect_skip(&terms, argv, argc);
- break;
- case BISECT_VISUALIZE:
- get_terms(&terms);
- res = bisect_visualize(&terms, argv, argc);
- break;
- case BISECT_RUN:
- if (!argc)
- return error(_("bisect run failed: no command provided."));
- get_terms(&terms);
- res = bisect_run(&terms, argv, argc);
- break;
- default:
- BUG("unknown subcommand %d", cmdmode);
+ if (check_and_set_terms(&terms, argv[0]))
+ usage_msg_optf(_("unknown command: '%s'"), git_bisect_usage,
+ options, argv[0]);
+ res = bisect_state(&terms, argc, argv);
+ free_terms(&terms);
+ } else {
+ argc--;
+ argv++;
+ res = fn(argc, argv, prefix);
}
- free_terms(&terms);
-
- /*
- * Handle early success
- * From check_merge_bases > check_good_are_ancestors_of_bad > bisect_next_all
- */
- if ((res == BISECT_INTERNAL_SUCCESS_MERGE_BASE) || (res == BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND))
- res = BISECT_OK;
- return -res;
+ return is_bisect_success(res) ? 0 : -res;
}
diff --git a/builtin/blame.c b/builtin/blame.c
index 02e3942..9aa7468 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -5,10 +5,13 @@
* See COPYING for licensing conditions
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "color.h"
#include "builtin.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "repository.h"
#include "commit.h"
#include "diff.h"
@@ -22,14 +25,18 @@
#include "userdiff.h"
#include "line-range.h"
#include "line-log.h"
-#include "dir.h"
#include "progress.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "pager.h"
#include "blame.h"
#include "refs.h"
+#include "setup.h"
#include "tag.h"
+#include "write-or-die.h"
static char blame_usage[] = N_("git blame [<options>] [<rev-opts>] [<rev>] [--] <file>");
+static char annotate_usage[] = N_("git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>");
static const char *blame_opt_usage[] = {
blame_usage,
@@ -38,6 +45,13 @@ static const char *blame_opt_usage[] = {
NULL
};
+static const char *annotate_opt_usage[] = {
+ annotate_usage,
+ "",
+ N_("<rev-opts> are documented in git-rev-list(1)"),
+ NULL
+};
+
static int longest_file;
static int longest_author;
static int max_orig_digits;
@@ -191,13 +205,13 @@ static void get_commit_info(struct commit *commit,
const char *message;
encoding = get_log_output_encoding();
- message = logmsg_reencode(commit, NULL, encoding);
+ message = repo_logmsg_reencode(the_repository, commit, NULL, encoding);
get_ac_line(message, "\nauthor ",
&ret->author, &ret->author_mail,
&ret->author_time, &ret->author_tz);
if (!detailed) {
- unuse_commit_buffer(commit, message);
+ repo_unuse_commit_buffer(the_repository, commit, message);
return;
}
@@ -211,7 +225,7 @@ static void get_commit_info(struct commit *commit,
else
strbuf_addf(&ret->summary, "(%s)", oid_to_hex(&commit->object.oid));
- unuse_commit_buffer(commit, message);
+ repo_unuse_commit_buffer(the_repository, commit, message);
}
/*
@@ -302,7 +316,7 @@ static const char *format_time(timestamp_t time, const char *tz_str,
size_t time_width;
int tz;
tz = atoi(tz_str);
- time_str = show_date(time, tz, &blame_date_mode);
+ time_str = show_date(time, tz, blame_date_mode);
strbuf_addstr(&time_buf, time_str);
/*
* Add space paddings to time_buf to display a fixed width
@@ -593,8 +607,9 @@ static int read_ancestry(const char *graft_file)
static int update_auto_abbrev(int auto_abbrev, struct blame_origin *suspect)
{
- const char *uniq = find_unique_abbrev(&suspect->commit->object.oid,
- auto_abbrev);
+ const char *uniq = repo_find_unique_abbrev(the_repository,
+ &suspect->commit->object.oid,
+ auto_abbrev);
int len = strlen(uniq);
if (auto_abbrev < len)
return len;
@@ -677,7 +692,8 @@ static const char *add_prefix(const char *prefix, const char *path)
return prefix_path(prefix, prefix ? strlen(prefix) : 0, path);
}
-static int git_blame_config(const char *var, const char *value, void *cb)
+static int git_blame_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(var, "blame.showroot")) {
show_root = git_config_bool(var, value);
@@ -731,6 +747,8 @@ static int git_blame_config(const char *var, const char *value, void *cb)
}
if (!strcmp(var, "blame.coloring")) {
+ if (!value)
+ return config_error_nonbool(var);
if (!strcmp(value, "repeatedLines")) {
coloring_mode |= OUTPUT_COLOR_LINE;
} else if (!strcmp(value, "highlightRecent")) {
@@ -750,7 +768,7 @@ static int git_blame_config(const char *var, const char *value, void *cb)
if (userdiff_config(var, value) < 0)
return -1;
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
static int blame_copy_callback(const struct option *option, const char *arg, int unset)
@@ -794,7 +812,7 @@ static int is_a_rev(const char *name)
{
struct object_id oid;
- if (get_oid(name, &oid))
+ if (repo_get_oid(the_repository, name, &oid))
return 0;
return OBJ_NONE < oid_object_info(the_repository, &oid, NULL);
}
@@ -837,7 +855,7 @@ static void build_ignorelist(struct blame_scoreboard *sb,
peel_to_commit_oid, sb);
}
for_each_string_list_item(i, ignore_rev_list) {
- if (get_oid_committish(i->string, &oid) ||
+ if (repo_get_oid_committish(the_repository, i->string, &oid) ||
peel_to_commit_oid(&oid, sb))
die(_("cannot find revision %s to ignore"), i->string);
oidset_insert(&sb->ignore_list, &oid);
@@ -899,6 +917,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
long anchor;
const int hexsz = the_hash_algo->hexsz;
long num_lines = 0;
+ const char *str_usage = cmd_is_annotate ? annotate_usage : blame_usage;
+ const char **opt_usage = cmd_is_annotate ? annotate_opt_usage : blame_opt_usage;
setup_default_color_by_age();
git_config(git_blame_config, &output_option);
@@ -914,12 +934,13 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
parse_options_start(&ctx, argc, argv, prefix, options,
PARSE_OPT_KEEP_DASHDASH | PARSE_OPT_KEEP_ARGV0);
for (;;) {
- switch (parse_options_step(&ctx, options, blame_opt_usage)) {
+ switch (parse_options_step(&ctx, options, opt_usage)) {
case PARSE_OPT_NON_OPTION:
case PARSE_OPT_UNKNOWN:
break;
case PARSE_OPT_HELP:
case PARSE_OPT_ERROR:
+ case PARSE_OPT_SUBCOMMAND:
exit(129);
case PARSE_OPT_COMPLETE:
exit(0);
@@ -933,7 +954,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
ctx.argv[0] = "--children";
reverse = 1;
}
- parse_revision_opt(&revs, &ctx, options, blame_opt_usage);
+ parse_revision_opt(&revs, &ctx, options, opt_usage);
}
parse_done:
revision_opts_finish(&revs);
@@ -1008,7 +1029,7 @@ parse_done:
blame_date_width = sizeof("Thu Oct 19 16:00:04 2006 -0700");
break;
case DATE_STRFTIME:
- blame_date_width = strlen(show_date(0, 0, &blame_date_mode)) + 1; /* add the null */
+ blame_date_width = strlen(show_date(0, 0, blame_date_mode)) + 1; /* add the null */
break;
}
blame_date_width -= 1; /* strip the null */
@@ -1039,7 +1060,7 @@ parse_done:
switch (argc - dashdash_pos - 1) {
case 2: /* (1b) */
if (argc != 4)
- usage_with_options(blame_opt_usage, options);
+ usage_with_options(opt_usage, options);
/* reorder for the new way: <rev> -- <path> */
argv[1] = argv[3];
argv[3] = argv[2];
@@ -1050,11 +1071,11 @@ parse_done:
argv[argc] = NULL;
break;
default:
- usage_with_options(blame_opt_usage, options);
+ usage_with_options(opt_usage, options);
}
} else {
if (argc < 2)
- usage_with_options(blame_opt_usage, options);
+ usage_with_options(opt_usage, options);
if (argc == 3 && is_a_rev(argv[argc - 1])) { /* (2b) */
path = add_prefix(prefix, argv[1]);
argv[1] = argv[2];
@@ -1112,7 +1133,7 @@ parse_done:
nth_line_cb, &sb, lno, anchor,
&bottom, &top, sb.path,
the_repository->index))
- usage(blame_usage);
+ usage(str_usage);
if ((!lno && (top || bottom)) || lno < bottom)
die(Q_("file %s has only %lu line",
"file %s has only %lu lines",
diff --git a/builtin/branch.c b/builtin/branch.c
index 5d00d0b..dd3e3a7 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -5,24 +5,26 @@
* Based on git-branch.sh by Junio C Hamano.
*/
-#include "cache.h"
+#include "builtin.h"
#include "config.h"
#include "color.h"
+#include "editor.h"
+#include "environment.h"
#include "refs.h"
#include "commit.h"
-#include "builtin.h"
+#include "gettext.h"
+#include "object-name.h"
#include "remote.h"
#include "parse-options.h"
#include "branch.h"
-#include "diff.h"
-#include "revision.h"
+#include "path.h"
#include "string-list.h"
#include "column.h"
#include "utf8.h"
-#include "wt-status.h"
#include "ref-filter.h"
#include "worktree.h"
#include "help.h"
+#include "advice.h"
#include "commit-reach.h"
static const char * const builtin_branch_usage[] = {
@@ -77,7 +79,8 @@ static unsigned int colopts;
define_list_config_array(color_branch_slots);
-static int git_branch_config(const char *var, const char *value, void *cb)
+static int git_branch_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
const char *slot_name;
@@ -111,7 +114,10 @@ static int git_branch_config(const char *var, const char *value, void *cb)
return 0;
}
- return git_color_default_config(var, value, cb);
+ if (git_color_config(var, value, cb) < 0)
+ return -1;
+
+ return git_default_config(var, value, ctx, cb);
}
static const char *branch_get_color(enum color_branch ix)
@@ -150,24 +156,31 @@ static int branch_merged(int kind, const char *name,
if (!reference_rev)
reference_rev = head_rev;
- merged = in_merge_bases(rev, reference_rev);
+ merged = reference_rev ? repo_in_merge_bases(the_repository, rev,
+ reference_rev) : 0;
+ if (merged < 0)
+ exit(128);
/*
* After the safety valve is fully redefined to "check with
* upstream, if any, otherwise with HEAD", we should just
- * return the result of the in_merge_bases() above without
+ * return the result of the repo_in_merge_bases() above without
* any of the following code, but during the transition period,
* a gentle reminder is in order.
*/
- if ((head_rev != reference_rev) &&
- in_merge_bases(rev, head_rev) != merged) {
- if (merged)
+ if (head_rev != reference_rev) {
+ int expect = head_rev ? repo_in_merge_bases(the_repository, rev, head_rev) : 0;
+ if (expect < 0)
+ exit(128);
+ if (expect == merged)
+ ; /* okay */
+ else if (merged)
warning(_("deleting branch '%s' that has been merged to\n"
- " '%s', but not yet merged to HEAD."),
+ " '%s', but not yet merged to HEAD"),
name, reference_name);
else
warning(_("not deleting branch '%s' that is not yet merged to\n"
- " '%s', even though it is merged to HEAD."),
+ " '%s', even though it is merged to HEAD"),
name, reference_name);
}
free(reference_name_to_free);
@@ -180,13 +193,14 @@ static int check_branch_commit(const char *branchname, const char *refname,
{
struct commit *rev = lookup_commit_reference(the_repository, oid);
if (!force && !rev) {
- error(_("Couldn't look up commit object for '%s'"), refname);
+ error(_("couldn't look up commit object for '%s'"), refname);
return -1;
}
if (!force && !branch_merged(kinds, branchname, rev, head_rev)) {
- error(_("The branch '%s' is not fully merged.\n"
- "If you are sure you want to delete it, "
- "run 'git branch -D %s'."), branchname, branchname);
+ error(_("the branch '%s' is not fully merged"), branchname);
+ advise_if_enabled(ADVICE_FORCE_DELETE_BRANCH,
+ _("If you are sure you want to delete it, "
+ "run 'git branch -D %s'"), branchname);
return -1;
}
return 0;
@@ -197,14 +211,13 @@ static void delete_branch_config(const char *branchname)
struct strbuf buf = STRBUF_INIT;
strbuf_addf(&buf, "branch.%s", branchname);
if (git_config_rename_section(buf.buf, NULL) < 0)
- warning(_("Update of config-file failed"));
+ warning(_("update of config-file failed"));
strbuf_release(&buf);
}
static int delete_branches(int argc, const char **argv, int force, int kinds,
int quiet)
{
- struct worktree **worktrees;
struct commit *head_rev = NULL;
struct object_id oid;
char *name = NULL;
@@ -217,10 +230,11 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
struct string_list refs_to_delete = STRING_LIST_INIT_DUP;
struct string_list_item *item;
int branch_name_pos;
+ const char *fmt_remotes = "refs/remotes/%s";
switch (kinds) {
case FILTER_REFS_REMOTES:
- fmt = "refs/remotes/%s";
+ fmt = fmt_remotes;
/* For subsequent UI messages */
remote_branch = 1;
allowed_interpret = INTERPRET_BRANCH_REMOTE;
@@ -236,13 +250,8 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
}
branch_name_pos = strcspn(fmt, "%");
- if (!force) {
+ if (!force)
head_rev = lookup_commit_reference(the_repository, &head_oid);
- if (!head_rev)
- die(_("Couldn't look up commit object for HEAD"));
- }
-
- worktrees = get_worktrees();
for (i = 0; i < argc; i++, strbuf_reset(&bname)) {
char *target = NULL;
@@ -253,12 +262,11 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
name = mkpathdup(fmt, bname.buf);
if (kinds == FILTER_REFS_BRANCHES) {
- const struct worktree *wt =
- find_shared_symref(worktrees, "HEAD", name);
- if (wt) {
- error(_("Cannot delete branch '%s' "
- "checked out at '%s'"),
- bname.buf, wt->path);
+ const char *path;
+ if ((path = branch_checked_out(name))) {
+ error(_("cannot delete branch '%s' "
+ "used by worktree at '%s'"),
+ bname.buf, path);
ret = 1;
continue;
}
@@ -270,9 +278,25 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
| RESOLVE_REF_ALLOW_BAD_NAME,
&oid, &flags);
if (!target) {
- error(remote_branch
- ? _("remote-tracking branch '%s' not found.")
- : _("branch '%s' not found."), bname.buf);
+ if (remote_branch) {
+ error(_("remote-tracking branch '%s' not found"), bname.buf);
+ } else {
+ char *virtual_name = mkpathdup(fmt_remotes, bname.buf);
+ char *virtual_target = resolve_refdup(virtual_name,
+ RESOLVE_REF_READING
+ | RESOLVE_REF_NO_RECURSE
+ | RESOLVE_REF_ALLOW_BAD_NAME,
+ &oid, &flags);
+ FREE_AND_NULL(virtual_name);
+
+ if (virtual_target)
+ error(_("branch '%s' not found.\n"
+ "Did you forget --remote?"),
+ bname.buf);
+ else
+ error(_("branch '%s' not found"), bname.buf);
+ FREE_AND_NULL(virtual_target);
+ }
ret = 1;
continue;
}
@@ -287,7 +311,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
item = string_list_append(&refs_to_delete, name);
item->util = xstrdup((flags & REF_ISBROKEN) ? "broken"
: (flags & REF_ISSYMREF) ? target
- : find_unique_abbrev(&oid, DEFAULT_ABBREV));
+ : repo_find_unique_abbrev(the_repository, &oid, DEFAULT_ABBREV));
next:
free(target);
@@ -315,7 +339,6 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
free(name);
strbuf_release(&bname);
- free_worktrees(worktrees);
return ret;
}
@@ -350,17 +373,8 @@ static const char *quote_literal_for_format(const char *s)
static struct strbuf buf = STRBUF_INIT;
strbuf_reset(&buf);
- while (*s) {
- const char *ep = strchrnul(s, '%');
- if (s < ep)
- strbuf_add(&buf, s, ep - s);
- if (*ep == '%') {
- strbuf_addstr(&buf, "%%");
- s = ep + 1;
- } else {
- s = ep;
- }
- }
+ while (strbuf_expand_step(&buf, &s))
+ strbuf_addstr(&buf, "%%");
return buf.buf;
}
@@ -428,8 +442,6 @@ static void print_ref_list(struct ref_filter *filter, struct ref_sorting *sortin
{
int i;
struct ref_array array;
- struct strbuf out = STRBUF_INIT;
- struct strbuf err = STRBUF_INIT;
int maxwidth = 0;
const char *remote_prefix = "";
char *to_free = NULL;
@@ -456,25 +468,30 @@ 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);
ref_array_sort(sorting, &array);
- for (i = 0; i < array.nr; i++) {
- strbuf_reset(&err);
- strbuf_reset(&out);
- if (format_ref_array_item(array.items[i], format, &out, &err))
- die("%s", err.buf);
- if (column_active(colopts)) {
- assert(!filter->verbose && "--column and --verbose are incompatible");
- /* format to a string_list to let print_columns() do its job */
+ if (column_active(colopts)) {
+ struct strbuf out = STRBUF_INIT, err = STRBUF_INIT;
+
+ assert(!filter->verbose && "--column and --verbose are incompatible");
+
+ for (i = 0; i < array.nr; i++) {
+ strbuf_reset(&err);
+ strbuf_reset(&out);
+ if (format_ref_array_item(array.items[i], format, &out, &err))
+ die("%s", err.buf);
+
+ /* format to a string_list to let print_columns() do its job */
string_list_append(output, out.buf);
- } else {
- fwrite(out.buf, 1, out.len, stdout);
- putchar('\n');
}
+
+ strbuf_release(&err);
+ strbuf_release(&out);
+ } else {
+ print_formatted_ref_array(&array, format);
}
- strbuf_release(&err);
- strbuf_release(&out);
ref_array_clear(&array);
free(to_free);
}
@@ -494,9 +511,9 @@ static void print_current_branch_name(void)
die(_("HEAD (%s) points outside of refs/heads/"), refname);
}
-static void reject_rebase_or_bisect_branch(const char *target)
+static void reject_rebase_or_bisect_branch(struct worktree **worktrees,
+ const char *target)
{
- struct worktree **worktrees = get_worktrees();
int i;
for (i = 0; worktrees[i]; i++) {
@@ -506,31 +523,57 @@ static void reject_rebase_or_bisect_branch(const char *target)
continue;
if (is_worktree_being_rebased(wt, target))
- die(_("Branch %s is being rebased at %s"),
+ die(_("branch %s is being rebased at %s"),
target, wt->path);
if (is_worktree_being_bisected(wt, target))
- die(_("Branch %s is being bisected at %s"),
+ die(_("branch %s is being bisected at %s"),
target, wt->path);
}
+}
- free_worktrees(worktrees);
+/*
+ * Update all per-worktree HEADs pointing at the old ref to point the new ref.
+ * This will be used when renaming a branch. Returns 0 if successful, non-zero
+ * otherwise.
+ */
+static int replace_each_worktree_head_symref(struct worktree **worktrees,
+ const char *oldref, const char *newref,
+ const char *logmsg)
+{
+ int ret = 0;
+ int i;
+
+ for (i = 0; worktrees[i]; i++) {
+ struct ref_store *refs;
+
+ if (worktrees[i]->is_detached)
+ continue;
+ if (!worktrees[i]->head_ref)
+ continue;
+ if (strcmp(oldref, worktrees[i]->head_ref))
+ continue;
+
+ refs = get_worktree_ref_store(worktrees[i]);
+ if (refs_create_symref(refs, "HEAD", newref, logmsg))
+ ret = error(_("HEAD of working tree %s is not updated"),
+ worktrees[i]->path);
+ }
+
+ return ret;
}
+#define IS_HEAD 1
+#define IS_ORPHAN 2
+
static void copy_or_rename_branch(const char *oldname, const char *newname, int copy, int force)
{
struct strbuf oldref = STRBUF_INIT, newref = STRBUF_INIT, logmsg = STRBUF_INIT;
struct strbuf oldsection = STRBUF_INIT, newsection = STRBUF_INIT;
const char *interpreted_oldname = NULL;
const char *interpreted_newname = NULL;
- int recovery = 0;
-
- if (!oldname) {
- if (copy)
- die(_("cannot copy the current branch while not on any."));
- else
- die(_("cannot rename the current branch while not on any."));
- }
+ int recovery = 0, oldref_usage = 0;
+ struct worktree **worktrees = get_worktrees();
if (strbuf_check_branch_ref(&oldref, oldname)) {
/*
@@ -539,8 +582,30 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int
*/
if (ref_exists(oldref.buf))
recovery = 1;
+ else {
+ int code = die_message(_("invalid branch name: '%s'"), oldname);
+ advise_if_enabled(ADVICE_REF_SYNTAX,
+ _("See `man git check-ref-format`"));
+ exit(code);
+ }
+ }
+
+ for (int i = 0; worktrees[i]; i++) {
+ struct worktree *wt = worktrees[i];
+
+ if (wt->head_ref && !strcmp(oldref.buf, wt->head_ref)) {
+ oldref_usage |= IS_HEAD;
+ if (is_null_oid(&wt->head_oid))
+ oldref_usage |= IS_ORPHAN;
+ break;
+ }
+ }
+
+ if ((copy || !(oldref_usage & IS_HEAD)) && !ref_exists(oldref.buf)) {
+ if (oldref_usage & IS_HEAD)
+ die(_("no commit on branch '%s' yet"), oldname);
else
- die(_("Invalid branch name: '%s'"), oldname);
+ die(_("no branch named '%s'"), oldname);
}
/*
@@ -552,7 +617,7 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int
else
validate_new_branchname(newname, &newref, force);
- reject_rebase_or_bisect_branch(oldref.buf);
+ reject_rebase_or_bisect_branch(worktrees, oldref.buf);
if (!skip_prefix(oldref.buf, "refs/heads/", &interpreted_oldname) ||
!skip_prefix(newref.buf, "refs/heads/", &interpreted_newname)) {
@@ -566,65 +631,68 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int
strbuf_addf(&logmsg, "Branch: renamed %s to %s",
oldref.buf, newref.buf);
- if (!copy &&
- (!head || strcmp(oldname, head) || !is_null_oid(&head_oid)) &&
+ if (!copy && !(oldref_usage & IS_ORPHAN) &&
rename_ref(oldref.buf, newref.buf, logmsg.buf))
- die(_("Branch rename failed"));
+ die(_("branch rename failed"));
if (copy && copy_existing_ref(oldref.buf, newref.buf, logmsg.buf))
- die(_("Branch copy failed"));
+ die(_("branch copy failed"));
if (recovery) {
if (copy)
- warning(_("Created a copy of a misnamed branch '%s'"),
+ warning(_("created a copy of a misnamed branch '%s'"),
interpreted_oldname);
else
- warning(_("Renamed a misnamed branch '%s' away"),
+ warning(_("renamed a misnamed branch '%s' away"),
interpreted_oldname);
}
- if (!copy &&
- replace_each_worktree_head_symref(oldref.buf, newref.buf, logmsg.buf))
- die(_("Branch renamed to %s, but HEAD is not updated!"), newname);
+ if (!copy && (oldref_usage & IS_HEAD) &&
+ replace_each_worktree_head_symref(worktrees, oldref.buf, newref.buf,
+ logmsg.buf))
+ die(_("branch renamed to %s, but HEAD is not updated"), newname);
strbuf_release(&logmsg);
strbuf_addf(&oldsection, "branch.%s", interpreted_oldname);
- strbuf_release(&oldref);
strbuf_addf(&newsection, "branch.%s", interpreted_newname);
- strbuf_release(&newref);
if (!copy && git_config_rename_section(oldsection.buf, newsection.buf) < 0)
- die(_("Branch is renamed, but update of config-file failed"));
- if (copy && strcmp(oldname, newname) && git_config_copy_section(oldsection.buf, newsection.buf) < 0)
- die(_("Branch is copied, but update of config-file failed"));
+ die(_("branch is renamed, but update of config-file failed"));
+ if (copy && strcmp(interpreted_oldname, interpreted_newname) && git_config_copy_section(oldsection.buf, newsection.buf) < 0)
+ die(_("branch is copied, but update of config-file failed"));
+ strbuf_release(&oldref);
+ strbuf_release(&newref);
strbuf_release(&oldsection);
strbuf_release(&newsection);
+ free_worktrees(worktrees);
}
static GIT_PATH_FUNC(edit_description, "EDIT_DESCRIPTION")
static int edit_branch_description(const char *branch_name)
{
+ int exists;
struct strbuf buf = STRBUF_INIT;
struct strbuf name = STRBUF_INIT;
- read_branch_desc(&buf, branch_name);
+ exists = !read_branch_desc(&buf, branch_name);
if (!buf.len || buf.buf[buf.len-1] != '\n')
strbuf_addch(&buf, '\n');
- strbuf_commented_addf(&buf,
+ strbuf_commented_addf(&buf, comment_line_str,
_("Please edit the description for the branch\n"
" %s\n"
- "Lines starting with '%c' will be stripped.\n"),
- branch_name, comment_line_char);
+ "Lines starting with '%s' will be stripped.\n"),
+ branch_name, comment_line_str);
write_file_buf(edit_description(), buf.buf, buf.len);
strbuf_reset(&buf);
if (launch_editor(edit_description(), &buf, NULL)) {
strbuf_release(&buf);
return -1;
}
- strbuf_stripspace(&buf, 1);
+ strbuf_stripspace(&buf, comment_line_str);
strbuf_addf(&name, "branch.%s.description", branch_name);
- git_config_set(name.buf, buf.len ? buf.buf : NULL);
+ if (buf.len || exists)
+ git_config_set(name.buf, buf.len ? buf.buf : NULL);
strbuf_release(&name);
strbuf_release(&buf);
@@ -642,7 +710,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
int reflog = 0, quiet = 0, icase = 0, force = 0,
recurse_submodules_explicit = 0;
enum branch_track track;
- struct ref_filter filter;
+ struct ref_filter filter = REF_FILTER_INIT;
static struct ref_sorting *sorting;
struct string_list sorting_options = STRING_LIST_INIT_DUP;
struct ref_format format = REF_FORMAT_INIT;
@@ -661,8 +729,9 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
OPT_STRING('u', "set-upstream-to", &new_upstream, N_("upstream"), N_("change the upstream info")),
OPT_BOOL(0, "unset-upstream", &unset_upstream, N_("unset the upstream info")),
OPT__COLOR(&branch_use_color, N_("use colored output")),
- OPT_SET_INT('r', "remotes", &filter.kind, N_("act on remote-tracking branches"),
- FILTER_REFS_REMOTES),
+ OPT_SET_INT_F('r', "remotes", &filter.kind, N_("act on remote-tracking branches"),
+ FILTER_REFS_REMOTES,
+ PARSE_OPT_NONEG),
OPT_CONTAINS(&filter.with_commit, N_("print only branches that contain the commit")),
OPT_NO_CONTAINS(&filter.no_commit, N_("print only branches that don't contain the commit")),
OPT_WITH(&filter.with_commit, N_("print only branches that contain the commit")),
@@ -670,12 +739,15 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
OPT__ABBREV(&filter.abbrev),
OPT_GROUP(N_("Specific git-branch actions:")),
- OPT_SET_INT('a', "all", &filter.kind, N_("list both remote-tracking and local branches"),
- FILTER_REFS_REMOTES | FILTER_REFS_BRANCHES),
+ OPT_SET_INT_F('a', "all", &filter.kind, N_("list both remote-tracking and local branches"),
+ FILTER_REFS_REMOTES | FILTER_REFS_BRANCHES,
+ PARSE_OPT_NONEG),
OPT_BIT('d', "delete", &delete, N_("delete fully merged branch"), 1),
OPT_BIT('D', NULL, &delete, N_("delete branch (even if not merged)"), 2),
OPT_BIT('m', "move", &rename, N_("move/rename a branch and its reflog"), 1),
OPT_BIT('M', NULL, &rename, N_("move/rename a branch, even if target exists"), 2),
+ OPT_BOOL(0, "omit-empty", &format.array_opts.omit_empty,
+ N_("do not output a newline after empty formatted refs")),
OPT_BIT('c', "copy", &copy, N_("copy a branch and its reflog"), 1),
OPT_BIT('C', NULL, &copy, N_("copy a branch, even if target exists"), 2),
OPT_BOOL('l', "list", &list, N_("list branch names")),
@@ -698,20 +770,25 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
setup_ref_filter_porcelain_msg();
- memset(&filter, 0, sizeof(filter));
filter.kind = FILTER_REFS_BRANCHES;
filter.abbrev = -1;
if (argc == 2 && !strcmp(argv[1], "-h"))
usage_with_options(builtin_branch_usage, options);
+ /*
+ * Try to set sort keys from config. If config does not set any,
+ * fall back on default (refname) sorting.
+ */
git_config(git_branch_config, &sorting_options);
+ if (!sorting_options.nr)
+ string_list_append(&sorting_options, "refname");
track = git_branch_track;
head = resolve_refdup("HEAD", 0, &head_oid, NULL);
if (!head)
- die(_("Failed to resolve HEAD as a valid ref."));
+ die(_("failed to resolve HEAD as a valid ref"));
if (!strcmp(head, "HEAD"))
filter.detached = 1;
else if (!skip_prefix(head, "refs/heads/", &head))
@@ -765,6 +842,8 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
if (list)
setup_auto_pager("branch", 1);
+ UNLEAK(sorting_options);
+
if (delete) {
if (!argc)
die(_("branch name required"));
@@ -792,90 +871,104 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
print_columns(&output, colopts, NULL);
string_list_clear(&output, 0);
ref_sorting_release(sorting);
+ ref_filter_clear(&filter);
return 0;
} else if (edit_description) {
const char *branch_name;
struct strbuf branch_ref = STRBUF_INIT;
+ struct strbuf buf = STRBUF_INIT;
+ int ret = 1; /* assume failure */
if (!argc) {
if (filter.detached)
- die(_("Cannot give description to detached HEAD"));
+ die(_("cannot give description to detached HEAD"));
branch_name = head;
- } else if (argc == 1)
- branch_name = argv[0];
- else
+ } else if (argc == 1) {
+ strbuf_branchname(&buf, argv[0], INTERPRET_BRANCH_LOCAL);
+ branch_name = buf.buf;
+ } else {
die(_("cannot edit description of more than one branch"));
+ }
strbuf_addf(&branch_ref, "refs/heads/%s", branch_name);
- if (!ref_exists(branch_ref.buf)) {
- strbuf_release(&branch_ref);
-
- if (!argc)
- return error(_("No commit on branch '%s' yet."),
- branch_name);
- else
- return error(_("No branch named '%s'."),
- branch_name);
- }
+ if (!ref_exists(branch_ref.buf))
+ error((!argc || branch_checked_out(branch_ref.buf))
+ ? _("no commit on branch '%s' yet")
+ : _("no branch named '%s'"),
+ branch_name);
+ else if (!edit_branch_description(branch_name))
+ ret = 0; /* happy */
+
strbuf_release(&branch_ref);
+ strbuf_release(&buf);
- if (edit_branch_description(branch_name))
- return 1;
- } else if (copy) {
+ return ret;
+ } else if (copy || rename) {
if (!argc)
die(_("branch name required"));
+ else if ((argc == 1) && filter.detached)
+ die(copy? _("cannot copy the current branch while not on any")
+ : _("cannot rename the current branch while not on any"));
else if (argc == 1)
- copy_or_rename_branch(head, argv[0], 1, copy > 1);
+ copy_or_rename_branch(head, argv[0], copy, copy + rename > 1);
else if (argc == 2)
- copy_or_rename_branch(argv[0], argv[1], 1, copy > 1);
+ copy_or_rename_branch(argv[0], argv[1], copy, copy + rename > 1);
else
- die(_("too many branches for a copy operation"));
- } else if (rename) {
- if (!argc)
- die(_("branch name required"));
- else if (argc == 1)
- copy_or_rename_branch(head, argv[0], 0, rename > 1);
- else if (argc == 2)
- copy_or_rename_branch(argv[0], argv[1], 0, rename > 1);
- else
- die(_("too many arguments for a rename operation"));
+ die(copy? _("too many branches for a copy operation")
+ : _("too many arguments for a rename operation"));
} else if (new_upstream) {
- struct branch *branch = branch_get(argv[0]);
+ struct branch *branch;
+ struct strbuf buf = STRBUF_INIT;
- if (argc > 1)
+ if (!argc)
+ branch = branch_get(NULL);
+ else if (argc == 1) {
+ strbuf_branchname(&buf, argv[0], INTERPRET_BRANCH_LOCAL);
+ branch = branch_get(buf.buf);
+ } else
die(_("too many arguments to set new upstream"));
if (!branch) {
if (!argc || !strcmp(argv[0], "HEAD"))
die(_("could not set upstream of HEAD to %s when "
- "it does not point to any branch."),
+ "it does not point to any branch"),
new_upstream);
die(_("no such branch '%s'"), argv[0]);
}
- if (!ref_exists(branch->refname))
+ if (!ref_exists(branch->refname)) {
+ if (!argc || branch_checked_out(branch->refname))
+ die(_("no commit on branch '%s' yet"), branch->name);
die(_("branch '%s' does not exist"), branch->name);
+ }
dwim_and_setup_tracking(the_repository, branch->name,
new_upstream, BRANCH_TRACK_OVERRIDE,
quiet);
+ strbuf_release(&buf);
} else if (unset_upstream) {
- struct branch *branch = branch_get(argv[0]);
+ struct branch *branch;
struct strbuf buf = STRBUF_INIT;
- if (argc > 1)
+ if (!argc)
+ branch = branch_get(NULL);
+ else if (argc == 1) {
+ strbuf_branchname(&buf, argv[0], INTERPRET_BRANCH_LOCAL);
+ branch = branch_get(buf.buf);
+ } else
die(_("too many arguments to unset upstream"));
if (!branch) {
if (!argc || !strcmp(argv[0], "HEAD"))
die(_("could not unset upstream of HEAD when "
- "it does not point to any branch."));
+ "it does not point to any branch"));
die(_("no such branch '%s'"), argv[0]);
}
if (!branch_has_merge_config(branch))
- die(_("Branch '%s' has no upstream information"), branch->name);
+ die(_("branch '%s' has no upstream information"), branch->name);
+ strbuf_reset(&buf);
strbuf_addf(&buf, "branch.%s.remote", branch->name);
git_config_set_multivar(buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
strbuf_reset(&buf);
@@ -887,11 +980,11 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
const char *start_name = argc == 2 ? argv[1] : head;
if (filter.kind != FILTER_REFS_BRANCHES)
- die(_("The -a, and -r, options to 'git branch' do not take a branch name.\n"
+ die(_("the -a, and -r, options to 'git branch' do not take a branch name.\n"
"Did you mean to use: -a|-r --list <pattern>?"));
if (track == BRANCH_TRACK_OVERRIDE)
- die(_("the '--set-upstream' option is no longer supported. Please use '--track' or '--set-upstream-to' instead."));
+ die(_("the '--set-upstream' option is no longer supported. Please use '--track' or '--set-upstream-to' instead"));
if (recurse_submodules) {
create_branches_recursively(the_repository, branch_name,
diff --git a/builtin/bugreport.c b/builtin/bugreport.c
index 9de32bc..25f860a 100644
--- a/builtin/bugreport.c
+++ b/builtin/bugreport.c
@@ -1,11 +1,16 @@
#include "builtin.h"
+#include "abspath.h"
+#include "editor.h"
+#include "gettext.h"
#include "parse-options.h"
#include "strbuf.h"
#include "help.h"
#include "compat/compiler.h"
#include "hook.h"
#include "hook-list.h"
-
+#include "diagnose.h"
+#include "object-file.h"
+#include "setup.h"
static void get_system_info(struct strbuf *sys_info)
{
@@ -59,7 +64,9 @@ static void get_populated_hooks(struct strbuf *hook_info, int nongit)
}
static const char * const bugreport_usage[] = {
- N_("git bugreport [-o|--output-directory <file>] [-s|--suffix <format>]"),
+ N_("git bugreport [(-o | --output-directory) <path>]\n"
+ " [(-s | --suffix) <format> | --no-suffix]\n"
+ " [--diagnose[=<mode>]]"),
NULL
};
@@ -98,30 +105,45 @@ int cmd_bugreport(int argc, const char **argv, const char *prefix)
int report = -1;
time_t now = time(NULL);
struct tm tm;
+ enum diagnose_mode diagnose = DIAGNOSE_NONE;
char *option_output = NULL;
char *option_suffix = "%Y-%m-%d-%H%M";
const char *user_relative_path = NULL;
char *prefixed_filename;
+ size_t output_path_len;
+ int ret;
const struct option bugreport_options[] = {
+ OPT_CALLBACK_F(0, "diagnose", &diagnose, N_("mode"),
+ N_("create an additional zip archive of detailed diagnostics (default 'stats')"),
+ PARSE_OPT_OPTARG, option_parse_diagnose),
OPT_STRING('o', "output-directory", &option_output, N_("path"),
- N_("specify a destination for the bugreport file")),
+ N_("specify a destination for the bugreport file(s)")),
OPT_STRING('s', "suffix", &option_suffix, N_("format"),
- N_("specify a strftime format suffix for the filename")),
+ N_("specify a strftime format suffix for the filename(s)")),
OPT_END()
};
argc = parse_options(argc, argv, prefix, bugreport_options,
bugreport_usage, 0);
+ if (argc) {
+ error(_("unknown argument `%s'"), argv[0]);
+ usage(bugreport_usage[0]);
+ }
+
/* Prepare the path to put the result */
prefixed_filename = prefix_filename(prefix,
option_output ? option_output : "");
strbuf_addstr(&report_path, prefixed_filename);
strbuf_complete(&report_path, '/');
+ output_path_len = report_path.len;
- strbuf_addstr(&report_path, "git-bugreport-");
- strbuf_addftime(&report_path, option_suffix, localtime_r(&now, &tm), 0, 0);
+ strbuf_addstr(&report_path, "git-bugreport");
+ if (option_suffix) {
+ strbuf_addch(&report_path, '-');
+ strbuf_addftime(&report_path, option_suffix, localtime_r(&now, &tm), 0, 0);
+ }
strbuf_addstr(&report_path, ".txt");
switch (safe_create_leading_directories(report_path.buf)) {
@@ -133,6 +155,20 @@ int cmd_bugreport(int argc, const char **argv, const char *prefix)
report_path.buf);
}
+ /* Prepare diagnostics, if requested */
+ if (diagnose != DIAGNOSE_NONE) {
+ struct strbuf zip_path = STRBUF_INIT;
+ strbuf_add(&zip_path, report_path.buf, output_path_len);
+ strbuf_addstr(&zip_path, "git-diagnostics-");
+ strbuf_addftime(&zip_path, option_suffix, localtime_r(&now, &tm), 0, 0);
+ strbuf_addstr(&zip_path, ".zip");
+
+ if (create_diagnostics_archive(&zip_path, diagnose))
+ die_errno(_("unable to create diagnostics archive %s"), zip_path.buf);
+
+ strbuf_release(&zip_path);
+ }
+
/* Prepare the report contents */
get_bug_template(&buffer);
@@ -160,7 +196,9 @@ int cmd_bugreport(int argc, const char **argv, const char *prefix)
user_relative_path);
free(prefixed_filename);
- UNLEAK(buffer);
- UNLEAK(report_path);
- return !!launch_editor(report_path.buf, NULL, NULL);
+ strbuf_release(&buffer);
+
+ ret = !!launch_editor(report_path.buf, NULL, NULL);
+ strbuf_release(&report_path);
+ return ret;
}
diff --git a/builtin/bundle.c b/builtin/bundle.c
index 2adad54..3ad11dc 100644
--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -1,7 +1,11 @@
#include "builtin.h"
+#include "abspath.h"
+#include "gettext.h"
+#include "setup.h"
#include "strvec.h"
#include "parse-options.h"
-#include "cache.h"
+#include "pkt-line.h"
+#include "repository.h"
#include "bundle.h"
/*
@@ -11,32 +15,42 @@
* bundle supporting "fetch", "pull", and "ls-remote".
*/
-static const char * const builtin_bundle_usage[] = {
- N_("git bundle create [<options>] <file> <git-rev-list args>"),
- N_("git bundle verify [<options>] <file>"),
- N_("git bundle list-heads <file> [<refname>...]"),
- N_("git bundle unbundle <file> [<refname>...]"),
- NULL
+#define BUILTIN_BUNDLE_CREATE_USAGE \
+ N_("git bundle create [-q | --quiet | --progress]\n" \
+ " [--version=<version>] <file> <git-rev-list-args>")
+#define BUILTIN_BUNDLE_VERIFY_USAGE \
+ N_("git bundle verify [-q | --quiet] <file>")
+#define BUILTIN_BUNDLE_LIST_HEADS_USAGE \
+ N_("git bundle list-heads <file> [<refname>...]")
+#define BUILTIN_BUNDLE_UNBUNDLE_USAGE \
+ N_("git bundle unbundle [--progress] <file> [<refname>...]")
+
+static char const * const builtin_bundle_usage[] = {
+ BUILTIN_BUNDLE_CREATE_USAGE,
+ BUILTIN_BUNDLE_VERIFY_USAGE,
+ BUILTIN_BUNDLE_LIST_HEADS_USAGE,
+ BUILTIN_BUNDLE_UNBUNDLE_USAGE,
+ NULL,
};
static const char * const builtin_bundle_create_usage[] = {
- N_("git bundle create [<options>] <file> <git-rev-list args>"),
- NULL
+ BUILTIN_BUNDLE_CREATE_USAGE,
+ NULL
};
static const char * const builtin_bundle_verify_usage[] = {
- N_("git bundle verify [<options>] <file>"),
- NULL
+ BUILTIN_BUNDLE_VERIFY_USAGE,
+ NULL
};
static const char * const builtin_bundle_list_heads_usage[] = {
- N_("git bundle list-heads <file> [<refname>...]"),
- NULL
+ BUILTIN_BUNDLE_LIST_HEADS_USAGE,
+ NULL
};
static const char * const builtin_bundle_unbundle_usage[] = {
- N_("git bundle unbundle <file> [<refname>...]"),
- NULL
+ BUILTIN_BUNDLE_UNBUNDLE_USAGE,
+ NULL
};
static int parse_options_cmd_bundle(int argc,
@@ -45,51 +59,45 @@ static int parse_options_cmd_bundle(int argc,
const char * const usagestr[],
const struct option options[],
char **bundle_file) {
- int newargc;
- newargc = parse_options(argc, argv, NULL, options, usagestr,
+ argc = parse_options(argc, argv, NULL, options, usagestr,
PARSE_OPT_STOP_AT_NON_OPTION);
- if (argc < 1)
- usage_with_options(usagestr, options);
- *bundle_file = prefix_filename(prefix, argv[0]);
- return newargc;
+ if (!argc)
+ usage_msg_opt(_("need a <file> argument"), usagestr, options);
+ *bundle_file = prefix_filename_except_for_dash(prefix, argv[0]);
+ return argc;
}
static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {
- int all_progress_implied = 0;
- int progress = isatty(STDERR_FILENO);
- struct strvec pack_opts;
+ struct strvec pack_opts = STRVEC_INIT;
int version = -1;
int ret;
struct option options[] = {
- OPT_SET_INT('q', "quiet", &progress,
- N_("do not show progress meter"), 0),
- OPT_SET_INT(0, "progress", &progress,
- N_("show progress meter"), 1),
- OPT_SET_INT(0, "all-progress", &progress,
- N_("show progress meter during object writing phase"), 2),
- OPT_BOOL(0, "all-progress-implied",
- &all_progress_implied,
- N_("similar to --all-progress when progress meter is shown")),
+ OPT_PASSTHRU_ARGV('q', "quiet", &pack_opts, NULL,
+ N_("do not show progress meter"),
+ PARSE_OPT_NOARG),
+ OPT_PASSTHRU_ARGV(0, "progress", &pack_opts, NULL,
+ N_("show progress meter"),
+ PARSE_OPT_NOARG),
+ OPT_PASSTHRU_ARGV(0, "all-progress", &pack_opts, NULL,
+ N_("historical; same as --progress"),
+ PARSE_OPT_NOARG | PARSE_OPT_HIDDEN),
+ OPT_PASSTHRU_ARGV(0, "all-progress-implied", &pack_opts, NULL,
+ N_("historical; does nothing"),
+ PARSE_OPT_NOARG | PARSE_OPT_HIDDEN),
OPT_INTEGER(0, "version", &version,
N_("specify bundle format version")),
OPT_END()
};
char *bundle_file;
+ if (isatty(STDERR_FILENO))
+ strvec_push(&pack_opts, "--progress");
+ strvec_push(&pack_opts, "--all-progress-implied");
+
argc = parse_options_cmd_bundle(argc, argv, prefix,
builtin_bundle_create_usage, options, &bundle_file);
/* bundle internals use argv[1] as further parameters */
- strvec_init(&pack_opts);
- if (progress == 0)
- strvec_push(&pack_opts, "--quiet");
- else if (progress == 1)
- strvec_push(&pack_opts, "--progress");
- else if (progress == 2)
- strvec_push(&pack_opts, "--all-progress");
- if (progress && all_progress_implied)
- strvec_push(&pack_opts, "--all-progress-implied");
-
if (!startup_info->have_repository)
die(_("Need a repository to create a bundle."));
ret = !!create_bundle(the_repository, bundle_file, argc, argv, &pack_opts, version);
@@ -98,6 +106,23 @@ static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {
return ret;
}
+/*
+ * Similar to read_bundle_header(), but handle "-" as stdin.
+ */
+static int open_bundle(const char *path, struct bundle_header *header,
+ const char **name)
+{
+ if (!strcmp(path, "-")) {
+ if (name)
+ *name = "<stdin>";
+ return read_bundle_header_fd(0, header, "<stdin>");
+ }
+
+ if (name)
+ *name = path;
+ return read_bundle_header(path, header);
+}
+
static int cmd_bundle_verify(int argc, const char **argv, const char *prefix) {
struct bundle_header header = BUNDLE_HEADER_INIT;
int bundle_fd = -1;
@@ -109,22 +134,24 @@ static int cmd_bundle_verify(int argc, const char **argv, const char *prefix) {
OPT_END()
};
char *bundle_file;
+ const char *name;
argc = parse_options_cmd_bundle(argc, argv, prefix,
builtin_bundle_verify_usage, options, &bundle_file);
/* bundle internals use argv[1] as further parameters */
- if ((bundle_fd = read_bundle_header(bundle_file, &header)) < 0) {
+ if ((bundle_fd = open_bundle(bundle_file, &header, &name)) < 0) {
ret = 1;
goto cleanup;
}
close(bundle_fd);
- if (verify_bundle(the_repository, &header, !quiet)) {
+ if (verify_bundle(the_repository, &header,
+ quiet ? VERIFY_BUNDLE_QUIET : VERIFY_BUNDLE_VERBOSE)) {
ret = 1;
goto cleanup;
}
- fprintf(stderr, _("%s is okay\n"), bundle_file);
+ fprintf(stderr, _("%s is okay\n"), name);
ret = 0;
cleanup:
free(bundle_file);
@@ -145,7 +172,7 @@ static int cmd_bundle_list_heads(int argc, const char **argv, const char *prefix
builtin_bundle_list_heads_usage, options, &bundle_file);
/* bundle internals use argv[1] as further parameters */
- if ((bundle_fd = read_bundle_header(bundle_file, &header)) < 0) {
+ if ((bundle_fd = open_bundle(bundle_file, &header, NULL)) < 0) {
ret = 1;
goto cleanup;
}
@@ -175,7 +202,7 @@ static int cmd_bundle_unbundle(int argc, const char **argv, const char *prefix)
builtin_bundle_unbundle_usage, options, &bundle_file);
/* bundle internals use argv[1] as further parameters */
- if ((bundle_fd = read_bundle_header(bundle_file, &header)) < 0) {
+ if ((bundle_fd = open_bundle(bundle_file, &header, NULL)) < 0) {
ret = 1;
goto cleanup;
}
@@ -185,7 +212,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) ||
+ &extra_index_pack_args, 0) ||
list_bundle_refs(&header, argc, argv);
bundle_header_release(&header);
cleanup:
@@ -195,30 +222,19 @@ cleanup:
int cmd_bundle(int argc, const char **argv, const char *prefix)
{
+ parse_opt_subcommand_fn *fn = NULL;
struct option options[] = {
+ OPT_SUBCOMMAND("create", &fn, cmd_bundle_create),
+ OPT_SUBCOMMAND("verify", &fn, cmd_bundle_verify),
+ OPT_SUBCOMMAND("list-heads", &fn, cmd_bundle_list_heads),
+ OPT_SUBCOMMAND("unbundle", &fn, cmd_bundle_unbundle),
OPT_END()
};
- int result;
argc = parse_options(argc, argv, prefix, options, builtin_bundle_usage,
- PARSE_OPT_STOP_AT_NON_OPTION);
+ 0);
packet_trace_identity("bundle");
- if (argc < 2)
- usage_with_options(builtin_bundle_usage, options);
-
- else if (!strcmp(argv[0], "create"))
- result = cmd_bundle_create(argc, argv, prefix);
- else if (!strcmp(argv[0], "verify"))
- result = cmd_bundle_verify(argc, argv, prefix);
- else if (!strcmp(argv[0], "list-heads"))
- result = cmd_bundle_list_heads(argc, argv, prefix);
- else if (!strcmp(argv[0], "unbundle"))
- result = cmd_bundle_unbundle(argc, argv, prefix);
- else {
- error(_("Unknown subcommand: %s"), argv[0]);
- usage_with_options(builtin_bundle_usage, options);
- }
- return result ? 1 : 0;
+ return !!fn(argc, argv, prefix);
}
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 50cf389..0c948f4 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -3,19 +3,27 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
-#include "config.h"
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "config.h"
+#include "convert.h"
#include "diff.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
+#include "ident.h"
#include "parse-options.h"
#include "userdiff.h"
#include "streaming.h"
-#include "tree-walk.h"
#include "oid-array.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "replace-object.h"
#include "promisor-remote.h"
+#include "mailmap.h"
+#include "write-or-die.h"
enum batch_mode {
BATCH_MODE_CONTENTS,
@@ -31,18 +39,36 @@ struct batch_options {
int all_objects;
int unordered;
int transform_mode; /* may be 'w' or 'c' for --filters or --textconv */
+ char input_delim;
+ char output_delim;
const char *format;
};
static const char *force_path;
+static struct string_list mailmap = STRING_LIST_INIT_NODUP;
+static int use_mailmap;
+
+static char *replace_idents_using_mailmap(char *, size_t *);
+
+static char *replace_idents_using_mailmap(char *object_buf, size_t *size)
+{
+ struct strbuf sb = STRBUF_INIT;
+ const char *headers[] = { "author ", "committer ", "tagger ", NULL };
+
+ strbuf_attach(&sb, object_buf, *size, *size + 1);
+ apply_mailmap_to_header(&sb, headers, &mailmap);
+ *size = sb.len;
+ return strbuf_detach(&sb, NULL);
+}
+
static int filter_object(const char *path, unsigned mode,
const struct object_id *oid,
char **buf, unsigned long *size)
{
enum object_type type;
- *buf = read_object_file(oid, &type, size);
+ *buf = repo_read_object_file(the_repository, oid, &type, size);
if (!*buf)
return error(_("cannot read object %s '%s'"),
oid_to_hex(oid), path);
@@ -71,6 +97,7 @@ static int stream_blob(const struct object_id *oid)
static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
int unknown_type)
{
+ int ret;
struct object_id oid;
enum object_type type;
char *buf;
@@ -79,7 +106,10 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
struct object_info oi = OBJECT_INFO_INIT;
struct strbuf sb = STRBUF_INIT;
unsigned flags = OBJECT_INFO_LOOKUP_REPLACE;
- unsigned get_oid_flags = GET_OID_RECORD_PATH | GET_OID_ONLY_TO_DIE;
+ unsigned get_oid_flags =
+ GET_OID_RECORD_PATH |
+ GET_OID_ONLY_TO_DIE |
+ GET_OID_HASH_ANY;
const char *path = force_path;
const int opt_cw = (opt == 'c' || opt == 'w');
if (!path && opt_cw)
@@ -106,25 +136,42 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
if (sb.len) {
printf("%s\n", sb.buf);
strbuf_release(&sb);
- return 0;
+ ret = 0;
+ goto cleanup;
}
break;
case 's':
oi.sizep = &size;
+
+ if (use_mailmap) {
+ oi.typep = &type;
+ oi.contentp = (void**)&buf;
+ }
+
if (oid_object_info_extended(the_repository, &oid, &oi, flags) < 0)
die("git cat-file: could not get object info");
+
+ if (use_mailmap && (type == OBJ_COMMIT || type == OBJ_TAG)) {
+ size_t s = size;
+ buf = replace_idents_using_mailmap(buf, &s);
+ size = cast_size_t_to_ulong(s);
+ }
+
printf("%"PRIuMAX"\n", (uintmax_t)size);
- return 0;
+ ret = 0;
+ goto cleanup;
case 'e':
- return !has_object_file(&oid);
+ return !repo_has_object_file(the_repository, &oid);
case 'w':
if (filter_object(path, obj_context.mode,
- &oid, &buf, &size))
- return -1;
+ &oid, &buf, &size)) {
+ ret = -1;
+ goto cleanup;
+ }
break;
case 'c':
@@ -143,15 +190,25 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
const char *ls_args[3] = { NULL };
ls_args[0] = "ls-tree";
ls_args[1] = obj_name;
- return cmd_ls_tree(2, ls_args, NULL);
+ ret = cmd_ls_tree(2, ls_args, NULL);
+ goto cleanup;
}
- if (type == OBJ_BLOB)
- return stream_blob(&oid);
- buf = read_object_file(&oid, &type, &size);
+ if (type == OBJ_BLOB) {
+ ret = stream_blob(&oid);
+ goto cleanup;
+ }
+ buf = repo_read_object_file(the_repository, &oid, &type,
+ &size);
if (!buf)
die("Cannot read object %s", obj_name);
+ if (use_mailmap) {
+ size_t s = size;
+ buf = replace_idents_using_mailmap(buf, &s);
+ size = cast_size_t_to_ulong(s);
+ }
+
/* otherwise just spit out the data */
break;
@@ -162,18 +219,27 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
if (exp_type_id == OBJ_BLOB) {
struct object_id blob_oid;
if (oid_object_info(the_repository, &oid, NULL) == OBJ_TAG) {
- char *buffer = read_object_file(&oid, &type,
- &size);
+ char *buffer = repo_read_object_file(the_repository,
+ &oid,
+ &type,
+ &size);
const char *target;
+
+ if (!buffer)
+ die(_("unable to read %s"), oid_to_hex(&oid));
+
if (!skip_prefix(buffer, "object ", &target) ||
- get_oid_hex(target, &blob_oid))
+ get_oid_hex_algop(target, &blob_oid,
+ &hash_algos[oid.algo]))
die("%s not a valid tag", oid_to_hex(&oid));
free(buffer);
} else
oidcpy(&blob_oid, &oid);
- if (oid_object_info(the_repository, &blob_oid, NULL) == OBJ_BLOB)
- return stream_blob(&blob_oid);
+ if (oid_object_info(the_repository, &blob_oid, NULL) == OBJ_BLOB) {
+ ret = stream_blob(&blob_oid);
+ goto cleanup;
+ }
/*
* we attempted to dereference a tag to a blob
* and failed; there may be new dereference
@@ -183,6 +249,12 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
}
buf = read_object_with_reference(the_repository, &oid,
exp_type_id, &size, NULL);
+
+ if (use_mailmap) {
+ size_t s = size;
+ buf = replace_idents_using_mailmap(buf, &s);
+ size = cast_size_t_to_ulong(s);
+ }
break;
}
default:
@@ -193,9 +265,11 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
die("git cat-file %s: bad file", obj_name);
write_or_die(1, buf, size);
+ ret = 0;
+cleanup:
free(buf);
free(obj_context.path);
- return 0;
+ return ret;
}
struct expand_data {
@@ -240,11 +314,9 @@ static int is_atom(const char *atom, const char *s, int slen)
return alen == slen && !memcmp(atom, s, alen);
}
-static void expand_atom(struct strbuf *sb, const char *atom, int len,
- void *vdata)
+static int expand_atom(struct strbuf *sb, const char *atom, int len,
+ struct expand_data *data)
{
- struct expand_data *data = vdata;
-
if (is_atom("objectname", atom, len)) {
if (!data->mark_query)
strbuf_addstr(sb, oid_to_hex(&data->oid));
@@ -275,22 +347,24 @@ static void expand_atom(struct strbuf *sb, const char *atom, int len,
strbuf_addstr(sb,
oid_to_hex(&data->delta_base_oid));
} else
- die("unknown format element: %.*s", len, atom);
+ return 0;
+ return 1;
}
-static size_t expand_format(struct strbuf *sb, const char *start, void *data)
+static void expand_format(struct strbuf *sb, const char *start,
+ struct expand_data *data)
{
- const char *end;
-
- if (*start != '(')
- return 0;
- end = strchr(start + 1, ')');
- if (!end)
- die("format element '%s' does not end in ')'", start);
-
- expand_atom(sb, start + 1, end - start - 1, data);
-
- return end - start + 1;
+ while (strbuf_expand_step(sb, &start)) {
+ const char *end;
+
+ if (skip_prefix(start, "%", &start) || *start != '(')
+ strbuf_addch(sb, '%');
+ else if ((end = strchr(start + 1, ')')) &&
+ expand_atom(sb, start + 1, end - start - 1, data))
+ start = end + 1;
+ else
+ strbuf_expand_bad_format(start, "cat-file");
+ }
}
static void batch_write(struct batch_options *opt, const void *data, int len)
@@ -328,9 +402,10 @@ static void print_object_or_die(struct batch_options *opt, struct expand_data *d
if (!textconv_object(the_repository,
data->rest, 0100644, oid,
1, &contents, &size))
- contents = read_object_file(oid,
- &type,
- &size);
+ contents = repo_read_object_file(the_repository,
+ oid,
+ &type,
+ &size);
if (!contents)
die("could not convert '%s' %s",
oid_to_hex(oid), data->rest);
@@ -347,12 +422,20 @@ static void print_object_or_die(struct batch_options *opt, struct expand_data *d
unsigned long size;
void *contents;
- contents = read_object_file(oid, &type, &size);
+ contents = repo_read_object_file(the_repository, oid, &type,
+ &size);
if (!contents)
die("object %s disappeared", oid_to_hex(oid));
+
+ if (use_mailmap) {
+ size_t s = size;
+ contents = replace_idents_using_mailmap(contents, &s);
+ size = cast_size_t_to_ulong(s);
+ }
+
if (type != data->type)
die("object %s changed type!?", oid_to_hex(oid));
- if (data->info.sizep && size != data->size)
+ if (data->info.sizep && size != data->size && !use_mailmap)
die("object %s changed size!?", oid_to_hex(oid));
batch_write(opt, contents, size);
@@ -360,11 +443,12 @@ static void print_object_or_die(struct batch_options *opt, struct expand_data *d
}
}
-static void print_default_format(struct strbuf *scratch, struct expand_data *data)
+static void print_default_format(struct strbuf *scratch, struct expand_data *data,
+ struct batch_options *opt)
{
- strbuf_addf(scratch, "%s %s %"PRIuMAX"\n", oid_to_hex(&data->oid),
+ strbuf_addf(scratch, "%s %s %"PRIuMAX"%c", oid_to_hex(&data->oid),
type_name(data->type),
- (uintmax_t)data->size);
+ (uintmax_t)data->size, opt->output_delim);
}
/*
@@ -382,6 +466,9 @@ static void batch_object_write(const char *obj_name,
if (!data->skip_object_info) {
int ret;
+ if (use_mailmap)
+ data->info.typep = &data->type;
+
if (pack)
ret = packed_object_info(the_repository, pack, offset,
&data->info);
@@ -390,27 +477,41 @@ static void batch_object_write(const char *obj_name,
&data->oid, &data->info,
OBJECT_INFO_LOOKUP_REPLACE);
if (ret < 0) {
- printf("%s missing\n",
- obj_name ? obj_name : oid_to_hex(&data->oid));
+ printf("%s missing%c",
+ obj_name ? obj_name : oid_to_hex(&data->oid), opt->output_delim);
fflush(stdout);
return;
}
+
+ if (use_mailmap && (data->type == OBJ_COMMIT || data->type == OBJ_TAG)) {
+ size_t s = data->size;
+ char *buf = NULL;
+
+ buf = repo_read_object_file(the_repository, &data->oid, &data->type,
+ &data->size);
+ if (!buf)
+ die(_("unable to read %s"), oid_to_hex(&data->oid));
+ buf = replace_idents_using_mailmap(buf, &s);
+ data->size = cast_size_t_to_ulong(s);
+
+ free(buf);
+ }
}
strbuf_reset(scratch);
if (!opt->format) {
- print_default_format(scratch, data);
+ print_default_format(scratch, data, opt);
} else {
- strbuf_expand(scratch, opt->format, expand_format, data);
- strbuf_addch(scratch, '\n');
+ expand_format(scratch, opt->format, data);
+ strbuf_addch(scratch, opt->output_delim);
}
batch_write(opt, scratch->buf, scratch->len);
if (opt->batch_mode == BATCH_MODE_CONTENTS) {
print_object_or_die(opt, data);
- batch_write(opt, "\n", 1);
+ batch_write(opt, &opt->output_delim, 1);
}
}
@@ -420,7 +521,9 @@ static void batch_one_object(const char *obj_name,
struct expand_data *data)
{
struct object_context ctx;
- int flags = opt->follow_symlinks ? GET_OID_FOLLOW_SYMLINKS : 0;
+ int flags =
+ GET_OID_HASH_ANY |
+ (opt->follow_symlinks ? GET_OID_FOLLOW_SYMLINKS : 0);
enum get_oid_result result;
result = get_oid_with_context(the_repository, obj_name,
@@ -428,22 +531,25 @@ static void batch_one_object(const char *obj_name,
if (result != FOUND) {
switch (result) {
case MISSING_OBJECT:
- printf("%s missing\n", obj_name);
+ printf("%s missing%c", obj_name, opt->output_delim);
break;
case SHORT_NAME_AMBIGUOUS:
- printf("%s ambiguous\n", obj_name);
+ printf("%s ambiguous%c", obj_name, opt->output_delim);
break;
case DANGLING_SYMLINK:
- printf("dangling %"PRIuMAX"\n%s\n",
- (uintmax_t)strlen(obj_name), obj_name);
+ printf("dangling %"PRIuMAX"%c%s%c",
+ (uintmax_t)strlen(obj_name),
+ opt->output_delim, obj_name, opt->output_delim);
break;
case SYMLINK_LOOP:
- printf("loop %"PRIuMAX"\n%s\n",
- (uintmax_t)strlen(obj_name), obj_name);
+ printf("loop %"PRIuMAX"%c%s%c",
+ (uintmax_t)strlen(obj_name),
+ opt->output_delim, obj_name, opt->output_delim);
break;
case NOT_DIR:
- printf("notdir %"PRIuMAX"\n%s\n",
- (uintmax_t)strlen(obj_name), obj_name);
+ printf("notdir %"PRIuMAX"%c%s%c",
+ (uintmax_t)strlen(obj_name),
+ opt->output_delim, obj_name, opt->output_delim);
break;
default:
BUG("unknown get_sha1_with_context result %d\n",
@@ -455,9 +561,9 @@ static void batch_one_object(const char *obj_name,
}
if (ctx.mode == 0) {
- printf("symlink %"PRIuMAX"\n%s\n",
+ printf("symlink %"PRIuMAX"%c%s%c",
(uintmax_t)ctx.symlink_path.len,
- ctx.symlink_path.buf);
+ opt->output_delim, ctx.symlink_path.buf, opt->output_delim);
fflush(stdout);
return;
}
@@ -482,7 +588,7 @@ static int batch_object_cb(const struct object_id *oid, void *vdata)
}
static int collect_loose_object(const struct object_id *oid,
- const char *path,
+ const char *path UNUSED,
void *data)
{
oid_array_append(data, oid);
@@ -490,8 +596,8 @@ static int collect_loose_object(const struct object_id *oid,
}
static int collect_packed_object(const struct object_id *oid,
- struct packed_git *pack,
- uint32_t pos,
+ struct packed_git *pack UNUSED,
+ uint32_t pos UNUSED,
void *data)
{
oid_array_append(data, oid);
@@ -514,7 +620,7 @@ static int batch_unordered_object(const struct object_id *oid,
}
static int batch_unordered_loose(const struct object_id *oid,
- const char *path,
+ const char *path UNUSED,
void *data)
{
return batch_unordered_object(oid, NULL, 0, data);
@@ -602,7 +708,7 @@ static void batch_objects_command(struct batch_options *opt,
struct queued_cmd *queued_cmd = NULL;
size_t alloc = 0, nr = 0;
- while (!strbuf_getline(&input, stdin)) {
+ while (strbuf_getdelim_strip_crlf(&input, stdin, opt->input_delim) != EOF) {
int i;
const struct parse_cmd *cmd = NULL;
const char *p = NULL, *cmd_end;
@@ -655,6 +761,7 @@ static void batch_objects_command(struct batch_options *opt,
free_cmds(queued_cmd, &nr);
}
+ free_cmds(queued_cmd, &nr);
free(queued_cmd);
strbuf_release(&input);
}
@@ -676,9 +783,8 @@ static int batch_objects(struct batch_options *opt)
*/
memset(&data, 0, sizeof(data));
data.mark_query = 1;
- strbuf_expand(&output,
+ expand_format(&output,
opt->format ? opt->format : DEFAULT_FORMAT,
- expand_format,
&data);
data.mark_query = 0;
strbuf_release(&output);
@@ -701,10 +807,10 @@ static int batch_objects(struct batch_options *opt)
if (!memcmp(&data.info, &empty, sizeof(empty)))
data.skip_object_info = 1;
- if (has_promisor_remote())
+ if (repo_has_promisor_remote(the_repository))
warning("This repository uses promisor remotes. Some objects may not be loaded.");
- read_replace_refs = 0;
+ disable_replace_refs();
cb.opt = opt;
cb.expand = &data;
@@ -750,7 +856,7 @@ static int batch_objects(struct batch_options *opt)
goto cleanup;
}
- while (strbuf_getline(&input, stdin) != EOF) {
+ while (strbuf_getdelim_strip_crlf(&input, stdin, opt->input_delim) != EOF) {
if (data.split_on_whitespace) {
/*
* Split at first whitespace, tying off the beginning
@@ -775,12 +881,13 @@ static int batch_objects(struct batch_options *opt)
return retval;
}
-static int git_cat_file_config(const char *var, const char *value, void *cb)
+static int git_cat_file_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (userdiff_config(var, value) < 0)
return -1;
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
static int batch_option_callback(const struct option *opt,
@@ -819,16 +926,18 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
const char *exp_type = NULL, *obj_name = NULL;
struct batch_options batch = {0};
int unknown_type = 0;
+ int input_nul_terminated = 0;
+ int nul_terminated = 0;
const char * const usage[] = {
N_("git cat-file <type> <object>"),
N_("git cat-file (-e | -p) <object>"),
N_("git cat-file (-t | -s) [--allow-unknown-type] <object>"),
- N_("git cat-file (--batch | --batch-check | --batch-command) [--batch-all-objects]\n"
- " [--buffer] [--follow-symlinks] [--unordered]\n"
- " [--textconv | --filters]"),
N_("git cat-file (--textconv | --filters)\n"
" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"),
+ N_("git cat-file (--batch | --batch-check | --batch-command) [--batch-all-objects]\n"
+ " [--buffer] [--follow-symlinks] [--unordered]\n"
+ " [--textconv | --filters] [-Z]"),
NULL
};
const struct option options[] = {
@@ -843,6 +952,8 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
OPT_CMDMODE('s', NULL, &opt, N_("show object size"), 's'),
OPT_BOOL(0, "allow-unknown-type", &unknown_type,
N_("allow -s and -t to work with broken/corrupt objects")),
+ OPT_BOOL(0, "use-mailmap", &use_mailmap, N_("use mail map file")),
+ OPT_ALIAS(0, "mailmap", "use-mailmap"),
/* Batch mode */
OPT_GROUP(N_("Batch objects requested on stdin (or --batch-all-objects)")),
OPT_CALLBACK_F(0, "batch", &batch, N_("format"),
@@ -853,6 +964,9 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
N_("like --batch, but don't emit <contents>"),
PARSE_OPT_OPTARG | PARSE_OPT_NONEG,
batch_option_callback),
+ OPT_BOOL_F('z', NULL, &input_nul_terminated, N_("stdin is NUL-terminated"),
+ PARSE_OPT_HIDDEN),
+ OPT_BOOL('Z', NULL, &nul_terminated, N_("stdin and stdout is NUL-terminated")),
OPT_CALLBACK_F(0, "batch-command", &batch, N_("format"),
N_("read commands from stdin"),
PARSE_OPT_OPTARG | PARSE_OPT_NONEG,
@@ -885,6 +999,9 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
opt_cw = (opt == 'c' || opt == 'w');
opt_epts = (opt == 'e' || opt == 'p' || opt == 't' || opt == 's');
+ if (use_mailmap)
+ read_mailmap(&mailmap);
+
/* --batch-all-objects? */
if (opt == 'b')
batch.all_objects = 1;
@@ -908,6 +1025,18 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
else if (batch.all_objects)
usage_msg_optf(_("'%s' requires a batch mode"), usage, options,
"--batch-all-objects");
+ else if (input_nul_terminated)
+ usage_msg_optf(_("'%s' requires a batch mode"), usage, options,
+ "-z");
+ else if (nul_terminated)
+ usage_msg_optf(_("'%s' requires a batch mode"), usage, options,
+ "-Z");
+
+ batch.input_delim = batch.output_delim = '\n';
+ if (input_nul_terminated)
+ batch.input_delim = '\0';
+ if (nul_terminated)
+ batch.input_delim = batch.output_delim = '\0';
/* Batch defaults */
if (batch.buffer_output < 0)
diff --git a/builtin/check-attr.c b/builtin/check-attr.c
index dd83397..c1da1d1 100644
--- a/builtin/check-attr.c
+++ b/builtin/check-attr.c
@@ -1,17 +1,23 @@
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
-#include "cache.h"
#include "config.h"
#include "attr.h"
+#include "environment.h"
+#include "gettext.h"
+#include "object-name.h"
#include "quote.h"
+#include "repository.h"
+#include "setup.h"
#include "parse-options.h"
+#include "write-or-die.h"
static int all_attrs;
static int cached_attrs;
static int stdin_paths;
+static char *source;
static const char * const check_attr_usage[] = {
-N_("git check-attr [-a | --all | <attr>...] [--] <pathname>..."),
-N_("git check-attr --stdin [-z] [-a | --all | <attr>...]"),
+N_("git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] <pathname>..."),
+N_("git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"),
NULL
};
@@ -23,6 +29,7 @@ static const struct option check_attr_options[] = {
OPT_BOOL(0 , "stdin", &stdin_paths, N_("read file names from stdin")),
OPT_BOOL('z', NULL, &nul_term_line,
N_("terminate input and output records by a NUL character")),
+ OPT_STRING(0, "source", &source, N_("<tree-ish>"), N_("which tree-ish to check attributes at")),
OPT_END()
};
@@ -55,10 +62,10 @@ static void output_attr(struct attr_check *check, const char *file)
}
}
-static void check_attr(const char *prefix,
- struct attr_check *check,
+static void check_attr(const char *prefix, struct attr_check *check,
int collect_all,
const char *file)
+
{
char *full_path =
prefix_path(prefix, prefix ? strlen(prefix) : 0, file);
@@ -73,8 +80,7 @@ static void check_attr(const char *prefix,
free(full_path);
}
-static void check_attr_stdin_paths(const char *prefix,
- struct attr_check *check,
+static void check_attr_stdin_paths(const char *prefix, struct attr_check *check,
int collect_all)
{
struct strbuf buf = STRBUF_INIT;
@@ -105,6 +111,7 @@ static NORETURN void error_with_usage(const char *msg)
int cmd_check_attr(int argc, const char **argv, const char *prefix)
{
struct attr_check *check;
+ struct object_id initialized_oid;
int cnt, i, doubledash, filei;
if (!is_bare_repository())
@@ -115,7 +122,10 @@ int cmd_check_attr(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, prefix, check_attr_options,
check_attr_usage, PARSE_OPT_KEEP_DASHDASH);
- if (read_cache() < 0) {
+ prepare_repo_settings(the_repository);
+ the_repository->settings.command_requires_full_index = 0;
+
+ if (repo_read_index(the_repository) < 0) {
die("invalid cache");
}
@@ -176,6 +186,12 @@ int cmd_check_attr(int argc, const char **argv, const char *prefix)
}
}
+ if (source) {
+ if (repo_get_oid_tree(the_repository, source, &initialized_oid))
+ die("%s: not a valid tree-ish source", source);
+ set_git_attr_source(source);
+ }
+
if (stdin_paths)
check_attr_stdin_paths(prefix, check, all_attrs);
else {
diff --git a/builtin/check-ignore.c b/builtin/check-ignore.c
index 2191256..906cd96 100644
--- a/builtin/check-ignore.c
+++ b/builtin/check-ignore.c
@@ -1,12 +1,14 @@
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
-#include "cache.h"
#include "config.h"
#include "dir.h"
+#include "gettext.h"
#include "quote.h"
#include "pathspec.h"
#include "parse-options.h"
+#include "repository.h"
#include "submodule.h"
+#include "write-or-die.h"
static int quiet, verbose, stdin_paths, show_non_matching, no_index;
static const char * const check_ignore_usage[] = {
@@ -179,7 +181,7 @@ int cmd_check_ignore(int argc, const char **argv, const char *prefix)
die(_("--non-matching is only valid with --verbose"));
/* read_cache() is only necessary so we can watch out for submodules. */
- if (!no_index && read_cache() < 0)
+ if (!no_index && repo_read_index(the_repository) < 0)
die(_("index file corrupt"));
setup_standard_excludes(&dir);
diff --git a/builtin/check-mailmap.c b/builtin/check-mailmap.c
index 7dc47e4..b8a05b8 100644
--- a/builtin/check-mailmap.c
+++ b/builtin/check-mailmap.c
@@ -1,8 +1,12 @@
#include "builtin.h"
#include "config.h"
+#include "gettext.h"
+#include "ident.h"
#include "mailmap.h"
#include "parse-options.h"
+#include "strbuf.h"
#include "string-list.h"
+#include "write-or-die.h"
static int use_stdin;
static const char * const check_mailmap_usage[] = {
diff --git a/builtin/check-ref-format.c b/builtin/check-ref-format.c
index bc67d3f..5eb6bdc 100644
--- a/builtin/check-ref-format.c
+++ b/builtin/check-ref-format.c
@@ -2,9 +2,9 @@
* GIT - The information manager from hell
*/
-#include "cache.h"
-#include "refs.h"
#include "builtin.h"
+#include "refs.h"
+#include "setup.h"
#include "strbuf.h"
static const char builtin_check_ref_format_usage[] =
@@ -57,6 +57,10 @@ int cmd_check_ref_format(int argc, const char **argv, const char *prefix)
int normalize = 0;
int flags = 0;
const char *refname;
+ char *to_free = NULL;
+ int ret = 1;
+
+ BUG_ON_NON_EMPTY_PREFIX(prefix);
if (argc == 2 && !strcmp(argv[1], "-h"))
usage(builtin_check_ref_format_usage);
@@ -81,11 +85,14 @@ int cmd_check_ref_format(int argc, const char **argv, const char *prefix)
refname = argv[i];
if (normalize)
- refname = collapse_slashes(refname);
+ refname = to_free = collapse_slashes(refname);
if (check_refname_format(refname, flags))
- return 1;
+ goto cleanup;
if (normalize)
printf("%s\n", refname);
- return 0;
+ ret = 0;
+cleanup:
+ free(to_free);
+ return ret;
}
diff --git a/builtin/checkout--worker.c b/builtin/checkout--worker.c
index ede7dc3..6b62b53 100644
--- a/builtin/checkout--worker.c
+++ b/builtin/checkout--worker.c
@@ -1,9 +1,11 @@
#include "builtin.h"
#include "config.h"
#include "entry.h"
+#include "gettext.h"
#include "parallel-checkout.h"
#include "parse-options.h"
#include "pkt-line.h"
+#include "read-cache-ll.h"
static void packet_to_pc_item(const char *buffer, int len,
struct parallel_checkout_item *pc_item)
diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c
index 97e06e8..2e086a2 100644
--- a/builtin/checkout-index.c
+++ b/builtin/checkout-index.c
@@ -4,22 +4,26 @@
* Copyright (C) 2005 Linus Torvalds
*
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
#include "config.h"
-#include "dir.h"
+#include "gettext.h"
#include "lockfile.h"
#include "quote.h"
+#include "repository.h"
#include "cache-tree.h"
#include "parse-options.h"
#include "entry.h"
#include "parallel-checkout.h"
+#include "read-cache-ll.h"
+#include "setup.h"
+#include "sparse-index.h"
#define CHECKOUT_ALL 4
static int nul_term_line;
static int checkout_stage; /* default to checkout stage0 */
static int ignore_skip_worktree; /* default to 0 */
-static int to_tempfile;
+static int to_tempfile = -1;
static char topath[4][TEMPORARY_FILENAME_LENGTH + 1];
static struct checkout state = CHECKOUT_INIT;
@@ -65,7 +69,7 @@ static void write_tempfile_record(const char *name, const char *prefix)
static int checkout_file(const char *name, const char *prefix)
{
int namelen = strlen(name);
- int pos = cache_name_pos(name, namelen);
+ int pos = index_name_pos(&the_index, name, namelen);
int has_same_name = 0;
int is_file = 0;
int is_skipped = 1;
@@ -75,8 +79,8 @@ static int checkout_file(const char *name, const char *prefix)
if (pos < 0)
pos = -pos - 1;
- while (pos < active_nr) {
- struct cache_entry *ce = active_cache[pos];
+ while (pos < the_index.cache_nr) {
+ struct cache_entry *ce = the_index.cache[pos];
if (ce_namelen(ce) != namelen ||
memcmp(ce->name, name, namelen))
break;
@@ -136,8 +140,8 @@ static int checkout_all(const char *prefix, int prefix_length)
int i, errs = 0;
struct cache_entry *last_ce = NULL;
- for (i = 0; i < active_nr ; i++) {
- struct cache_entry *ce = active_cache[i];
+ for (i = 0; i < the_index.cache_nr ; i++) {
+ struct cache_entry *ce = the_index.cache[i];
if (S_ISSPARSEDIR(ce->ce_mode)) {
if (!ce_skip_worktree(ce))
@@ -151,7 +155,7 @@ static int checkout_all(const char *prefix, int prefix_length)
*/
if (ignore_skip_worktree) {
ensure_full_index(&the_index);
- ce = active_cache[i];
+ ce = the_index.cache[i];
}
}
@@ -188,15 +192,16 @@ static const char * const builtin_checkout_index_usage[] = {
static int option_parse_stage(const struct option *opt,
const char *arg, int unset)
{
+ int *stage = opt->value;
+
BUG_ON_OPT_NEG(unset);
if (!strcmp(arg, "all")) {
- to_tempfile = 1;
- checkout_stage = CHECKOUT_ALL;
+ *stage = CHECKOUT_ALL;
} else {
int ch = arg[0];
if ('1' <= ch && ch <= '3')
- checkout_stage = arg[0] - '0';
+ *stage = arg[0] - '0';
else
die(_("stage should be between 1 and 3 or all"));
}
@@ -234,7 +239,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
N_("write the content to temporary files")),
OPT_STRING(0, "prefix", &state.base_dir, N_("string"),
N_("when creating files, prepend <string>")),
- OPT_CALLBACK_F(0, "stage", NULL, "(1|2|3|all)",
+ OPT_CALLBACK_F(0, "stage", &checkout_stage, "(1|2|3|all)",
N_("copy out the files from named stage"),
PARSE_OPT_NONEG, option_parse_stage),
OPT_END()
@@ -249,7 +254,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
- if (read_cache() < 0) {
+ if (repo_read_index(the_repository) < 0) {
die("invalid cache");
}
@@ -264,13 +269,20 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
state.base_dir = "";
state.base_dir_len = strlen(state.base_dir);
+ if (to_tempfile < 0)
+ to_tempfile = (checkout_stage == CHECKOUT_ALL);
+ if (!to_tempfile && checkout_stage == CHECKOUT_ALL)
+ die(_("options '%s' and '%s' cannot be used together"),
+ "--stage=all", "--no-temp");
+
/*
* when --prefix is specified we do not want to update cache.
*/
if (index_opt && !state.base_dir_len && !to_tempfile) {
state.refresh_cache = 1;
state.istate = &the_index;
- hold_locked_index(&lock_file, LOCK_DIE_ON_ERROR);
+ repo_hold_locked_index(the_repository, &lock_file,
+ LOCK_DIE_ON_ERROR);
}
get_parallel_checkout_configs(&pc_workers, &pc_threshold);
diff --git a/builtin/checkout.c b/builtin/checkout.c
index df3f166..71e6036 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -1,7 +1,6 @@
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
#include "advice.h"
-#include "blob.h"
#include "branch.h"
#include "cache-tree.h"
#include "checkout.h"
@@ -9,19 +8,28 @@
#include "config.h"
#include "diff.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "hook.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
#include "lockfile.h"
+#include "mem-pool.h"
#include "merge-recursive.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "parse-options.h"
+#include "path.h"
+#include "preload-index.h"
+#include "read-cache.h"
#include "refs.h"
#include "remote.h"
#include "resolve-undo.h"
#include "revision.h"
-#include "run-command.h"
+#include "setup.h"
#include "submodule.h"
-#include "submodule-config.h"
+#include "symlinks.h"
+#include "trace2.h"
#include "tree.h"
#include "tree-walk.h"
#include "unpack-trees.h"
@@ -29,6 +37,7 @@
#include "xdiff-interface.h"
#include "entry.h"
#include "parallel-checkout.h"
+#include "add-interactive.h"
static const char * const checkout_usage[] = {
N_("git checkout [<options>] <branch>"),
@@ -74,7 +83,7 @@ struct checkout_opts {
const char *ignore_unmerged_opt;
int ignore_unmerged;
int pathspec_file_nul;
- const char *pathspec_from_file;
+ char *pathspec_from_file;
const char *new_branch;
const char *new_branch_force;
@@ -82,7 +91,7 @@ struct checkout_opts {
int new_branch_log;
enum branch_track track;
struct diff_options diff_options;
- char *conflict_style;
+ int conflict_style;
int branch_exists;
const char *prefix;
@@ -91,6 +100,8 @@ struct checkout_opts {
struct tree *source_tree;
};
+#define CHECKOUT_OPTS_INIT { .conflict_style = -1, .merge = -1 }
+
struct branch_info {
char *name; /* The short name used */
char *path; /* The full name of a real branch */
@@ -125,7 +136,7 @@ static int post_checkout_hook(struct commit *old_commit, struct commit *new_comm
}
static int update_some(const struct object_id *oid, struct strbuf *base,
- const char *pathname, unsigned mode, void *context)
+ const char *pathname, unsigned mode, void *context UNUSED)
{
int len;
struct cache_entry *ce;
@@ -148,9 +159,9 @@ static int update_some(const struct object_id *oid, struct strbuf *base,
* entry in place. Whether it is UPTODATE or not, checkout_entry will
* do the right thing.
*/
- pos = cache_name_pos(ce->name, ce->ce_namelen);
+ pos = index_name_pos(&the_index, ce->name, ce->ce_namelen);
if (pos >= 0) {
- struct cache_entry *old = active_cache[pos];
+ struct cache_entry *old = the_index.cache[pos];
if (ce->ce_mode == old->ce_mode &&
!ce_intent_to_add(old) &&
oideq(&ce->oid, &old->oid)) {
@@ -160,7 +171,8 @@ static int update_some(const struct object_id *oid, struct strbuf *base,
}
}
- add_cache_entry(ce, ADD_CACHE_OK_TO_ADD | ADD_CACHE_OK_TO_REPLACE);
+ add_index_entry(&the_index, ce,
+ ADD_CACHE_OK_TO_ADD | ADD_CACHE_OK_TO_REPLACE);
return 0;
}
@@ -178,8 +190,8 @@ static int read_tree_some(struct tree *tree, const struct pathspec *pathspec)
static int skip_same_name(const struct cache_entry *ce, int pos)
{
- while (++pos < active_nr &&
- !strcmp(active_cache[pos]->name, ce->name))
+ while (++pos < the_index.cache_nr &&
+ !strcmp(the_index.cache[pos]->name, ce->name))
; /* skip */
return pos;
}
@@ -187,9 +199,9 @@ static int skip_same_name(const struct cache_entry *ce, int pos)
static int check_stage(int stage, const struct cache_entry *ce, int pos,
int overlay_mode)
{
- while (pos < active_nr &&
- !strcmp(active_cache[pos]->name, ce->name)) {
- if (ce_stage(active_cache[pos]) == stage)
+ while (pos < the_index.cache_nr &&
+ !strcmp(the_index.cache[pos]->name, ce->name)) {
+ if (ce_stage(the_index.cache[pos]) == stage)
return 0;
pos++;
}
@@ -206,8 +218,8 @@ static int check_stages(unsigned stages, const struct cache_entry *ce, int pos)
unsigned seen = 0;
const char *name = ce->name;
- while (pos < active_nr) {
- ce = active_cache[pos];
+ while (pos < the_index.cache_nr) {
+ ce = the_index.cache[pos];
if (strcmp(name, ce->name))
break;
seen |= (1 << ce_stage(ce));
@@ -223,15 +235,15 @@ static int checkout_stage(int stage, const struct cache_entry *ce, int pos,
const struct checkout *state, int *nr_checkouts,
int overlay_mode)
{
- while (pos < active_nr &&
- !strcmp(active_cache[pos]->name, ce->name)) {
- if (ce_stage(active_cache[pos]) == stage)
- return checkout_entry(active_cache[pos], state,
+ while (pos < the_index.cache_nr &&
+ !strcmp(the_index.cache[pos]->name, ce->name)) {
+ if (ce_stage(the_index.cache[pos]) == stage)
+ return checkout_entry(the_index.cache[pos], state,
NULL, nr_checkouts);
pos++;
}
if (!overlay_mode) {
- unlink_entry(ce);
+ unlink_entry(ce, NULL);
return 0;
}
if (stage == 2)
@@ -241,9 +253,10 @@ static int checkout_stage(int stage, const struct cache_entry *ce, int pos,
}
static int checkout_merged(int pos, const struct checkout *state,
- int *nr_checkouts, struct mem_pool *ce_mem_pool)
+ int *nr_checkouts, struct mem_pool *ce_mem_pool,
+ int conflict_style)
{
- struct cache_entry *ce = active_cache[pos];
+ struct cache_entry *ce = the_index.cache[pos];
const char *path = ce->name;
mmfile_t ancestor, ours, theirs;
enum ll_merge_result merge_status;
@@ -252,11 +265,11 @@ static int checkout_merged(int pos, const struct checkout *state,
mmbuffer_t result_buf;
struct object_id threeway[3];
unsigned mode = 0;
- struct ll_merge_options ll_opts;
+ struct ll_merge_options ll_opts = LL_MERGE_OPTIONS_INIT;
int renormalize = 0;
memset(threeway, 0, sizeof(threeway));
- while (pos < active_nr) {
+ while (pos < the_index.cache_nr) {
int stage;
stage = ce_stage(ce);
if (!stage || strcmp(path, ce->name))
@@ -265,7 +278,7 @@ static int checkout_merged(int pos, const struct checkout *state,
if (stage == 2)
mode = create_ce_mode(ce->ce_mode);
pos++;
- ce = active_cache[pos];
+ ce = the_index.cache[pos];
}
if (is_null_oid(&threeway[1]) || is_null_oid(&threeway[2]))
return error(_("path '%s' does not have necessary versions"), path);
@@ -274,9 +287,9 @@ static int checkout_merged(int pos, const struct checkout *state,
read_mmblob(&ours, &threeway[1]);
read_mmblob(&theirs, &threeway[2]);
- memset(&ll_opts, 0, sizeof(ll_opts));
git_config_get_bool("merge.renormalize", &renormalize);
ll_opts.renormalize = renormalize;
+ ll_opts.conflict_style = conflict_style;
merge_status = ll_merge(&result_buf, path, &ancestor, "base",
&ours, "ours", &theirs, "theirs",
state->istate, &ll_opts);
@@ -391,8 +404,8 @@ static int checkout_worktree(const struct checkout_opts *opts,
if (pc_workers > 1)
init_parallel_checkout();
- for (pos = 0; pos < active_nr; pos++) {
- struct cache_entry *ce = active_cache[pos];
+ for (pos = 0; pos < the_index.cache_nr; pos++) {
+ struct cache_entry *ce = the_index.cache[pos];
if (ce->ce_flags & CE_MATCHED) {
if (!ce_stage(ce)) {
errs |= checkout_entry(ce, &state,
@@ -407,7 +420,8 @@ static int checkout_worktree(const struct checkout_opts *opts,
else if (opts->merge)
errs |= checkout_merged(pos, &state,
&nr_unmerged,
- &ce_mem_pool);
+ &ce_mem_pool,
+ opts->conflict_style);
pos = skip_same_name(ce, pos) - 1;
}
}
@@ -430,8 +444,8 @@ static int checkout_worktree(const struct checkout_opts *opts,
"Updated %d paths from %s",
nr_checkouts),
nr_checkouts,
- find_unique_abbrev(&opts->source_tree->object.oid,
- DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, &opts->source_tree->object.oid,
+ DEFAULT_ABBREV));
else if (!nr_unmerged || nr_checkouts)
fprintf_ln(stderr, Q_("Updated %d path from the index",
"Updated %d paths from the index",
@@ -487,18 +501,40 @@ static int checkout_paths(const struct checkout_opts *opts,
die(_("'%s' must be used when '%s' is not specified"),
"--worktree", "--source");
- if (opts->checkout_index && !opts->checkout_worktree &&
- opts->writeout_stage)
- die(_("'%s' or '%s' cannot be used with %s"),
- "--ours", "--theirs", "--staged");
+ /*
+ * Reject --staged option to the restore command when combined with
+ * merge-related options. Use the accept_ref flag to distinguish it
+ * from the checkout command, which does not accept --staged anyway.
+ *
+ * `restore --ours|--theirs --worktree --staged` could mean resolving
+ * conflicted paths to one side in both the worktree and the index,
+ * but does not currently.
+ *
+ * `restore --merge|--conflict=<style>` already recreates conflicts
+ * in both the worktree and the index, so adding --staged would be
+ * meaningless.
+ */
+ if (!opts->accept_ref && opts->checkout_index) {
+ if (opts->writeout_stage)
+ die(_("'%s' or '%s' cannot be used with %s"),
+ "--ours", "--theirs", "--staged");
+
+ if (opts->merge)
+ die(_("'%s' or '%s' cannot be used with %s"),
+ "--merge", "--conflict", "--staged");
+ }
- if (opts->checkout_index && !opts->checkout_worktree &&
- opts->merge)
- die(_("'%s' or '%s' cannot be used with %s"),
- "--merge", "--conflict", "--staged");
+ /*
+ * recreating unmerged index entries and writing out data from
+ * unmerged index entries would make no sense when checking out
+ * of a tree-ish.
+ */
+ if ((opts->merge || opts->writeout_stage) && opts->source_tree)
+ die(_("'%s', '%s', or '%s' cannot be used when checking out of a tree"),
+ "--merge", "--ours", "--theirs");
if (opts->patch_mode) {
- const char *patch_mode;
+ enum add_p_mode patch_mode;
const char *rev = new_branch_info->name;
char rev_oid[GIT_MAX_HEXSZ + 1];
@@ -516,23 +552,26 @@ static int checkout_paths(const struct checkout_opts *opts,
rev = oid_to_hex_r(rev_oid, &new_branch_info->commit->object.oid);
if (opts->checkout_index && opts->checkout_worktree)
- patch_mode = "--patch=checkout";
+ patch_mode = ADD_P_CHECKOUT;
else if (opts->checkout_index && !opts->checkout_worktree)
- patch_mode = "--patch=reset";
+ patch_mode = ADD_P_RESET;
else if (!opts->checkout_index && opts->checkout_worktree)
- patch_mode = "--patch=worktree";
+ patch_mode = ADD_P_WORKTREE;
else
BUG("either flag must have been set, worktree=%d, index=%d",
opts->checkout_worktree, opts->checkout_index);
- return run_add_interactive(rev, patch_mode, &opts->pathspec);
+ return !!run_add_p(the_repository, patch_mode, rev,
+ &opts->pathspec);
}
repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
- if (read_cache_preload(&opts->pathspec) < 0)
+ if (repo_read_index_preload(the_repository, &opts->pathspec, 0) < 0)
return error(_("index file corrupt"));
if (opts->source_tree)
read_tree_some(opts->source_tree, &opts->pathspec);
+ if (opts->merge)
+ unmerge_index(&the_index, &opts->pathspec, CE_MATCHED);
ps_matched = xcalloc(opts->pathspec.nr, 1);
@@ -540,13 +579,13 @@ static int checkout_paths(const struct checkout_opts *opts,
* Make sure all pathspecs participated in locating the paths
* to be checked out.
*/
- for (pos = 0; pos < active_nr; pos++)
+ for (pos = 0; pos < the_index.cache_nr; pos++)
if (opts->overlay_mode)
- mark_ce_for_checkout_overlay(active_cache[pos],
+ mark_ce_for_checkout_overlay(the_index.cache[pos],
ps_matched,
opts);
else
- mark_ce_for_checkout_no_overlay(active_cache[pos],
+ mark_ce_for_checkout_no_overlay(the_index.cache[pos],
ps_matched,
opts);
@@ -556,13 +595,9 @@ static int checkout_paths(const struct checkout_opts *opts,
}
free(ps_matched);
- /* "checkout -m path" to recreate conflicted state */
- if (opts->merge)
- unmerge_marked_index(&the_index);
-
/* Any unmerged paths? */
- for (pos = 0; pos < active_nr; pos++) {
- const struct cache_entry *ce = active_cache[pos];
+ for (pos = 0; pos < the_index.cache_nr; pos++) {
+ const struct cache_entry *ce = the_index.cache[pos];
if (ce->ce_flags & CE_MATCHED) {
if (!ce_stage(ce))
continue;
@@ -626,6 +661,7 @@ static void show_local_changes(struct object *head,
repo_init_revisions(the_repository, &rev, NULL);
rev.diffopt.flags = opts->flags;
rev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS;
+ rev.diffopt.flags.recursive = 1;
diff_setup_done(&rev.diffopt);
add_pending_object(&rev, head, NULL);
run_diff_index(&rev, 0);
@@ -636,14 +672,16 @@ static void describe_detached_head(const char *msg, struct commit *commit)
{
struct strbuf sb = STRBUF_INIT;
- if (!parse_commit(commit))
+ if (!repo_parse_commit(the_repository, commit))
pp_commit_easy(CMIT_FMT_ONELINE, commit, &sb);
if (print_sha1_ellipsis()) {
fprintf(stderr, "%s %s... %s\n", msg,
- find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV), sb.buf);
+ repo_find_unique_abbrev(the_repository, &commit->object.oid, DEFAULT_ABBREV),
+ sb.buf);
} else {
fprintf(stderr, "%s %s %s\n", msg,
- find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV), sb.buf);
+ repo_find_unique_abbrev(the_repository, &commit->object.oid, DEFAULT_ABBREV),
+ sb.buf);
}
strbuf_release(&sb);
}
@@ -670,8 +708,9 @@ static int reset_tree(struct tree *tree, const struct checkout_opts *o,
init_checkout_metadata(&opts.meta, info->refname,
info->commit ? &info->commit->object.oid : null_oid(),
NULL);
- parse_tree(tree);
- init_tree_desc(&tree_desc, tree->buffer, tree->size);
+ if (parse_tree(tree) < 0)
+ return 128;
+ init_tree_desc(&tree_desc, &tree->object.oid, tree->buffer, tree->size);
switch (unpack_trees(1, &tree_desc, &opts)) {
case -2:
*writeout_error = 1;
@@ -697,7 +736,8 @@ static void setup_branch_path(struct branch_info *branch)
* If this is a ref, resolve it; otherwise, look up the OID for our
* expression. Failure here is okay.
*/
- if (!dwim_ref(branch->name, strlen(branch->name), &branch->oid, &branch->refname, 0))
+ if (!repo_dwim_ref(the_repository, branch->name, strlen(branch->name),
+ &branch->oid, &branch->refname, 0))
repo_get_oid_committish(the_repository, branch->name, &branch->oid);
strbuf_branchname(&buf, branch->name, INTERPRET_BRANCH_LOCAL);
@@ -710,6 +750,26 @@ static void setup_branch_path(struct branch_info *branch)
branch->path = strbuf_detach(&buf, NULL);
}
+static void init_topts(struct unpack_trees_options *topts, int merge,
+ int show_progress, int overwrite_ignore,
+ struct commit *old_commit)
+{
+ memset(topts, 0, sizeof(*topts));
+ topts->head_idx = -1;
+ topts->src_index = &the_index;
+ topts->dst_index = &the_index;
+
+ setup_unpack_trees_porcelain(topts, "checkout");
+
+ topts->initial_checkout = is_index_unborn(&the_index);
+ topts->update = 1;
+ topts->merge = 1;
+ topts->quiet = merge && old_commit;
+ topts->verbose_update = show_progress;
+ topts->fn = twoway_merge;
+ topts->preserve_ignored = !overwrite_ignore;
+}
+
static int merge_working_tree(const struct checkout_opts *opts,
struct branch_info *old_branch_info,
struct branch_info *new_branch_info,
@@ -719,17 +779,24 @@ static int merge_working_tree(const struct checkout_opts *opts,
struct lock_file lock_file = LOCK_INIT;
struct tree *new_tree;
- hold_locked_index(&lock_file, LOCK_DIE_ON_ERROR);
- if (read_cache_preload(NULL) < 0)
+ repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
+ if (repo_read_index_preload(the_repository, NULL, 0) < 0)
return error(_("index file corrupt"));
- resolve_undo_clear();
+ resolve_undo_clear_index(&the_index);
if (opts->new_orphan_branch && opts->orphan_from_empty_tree) {
if (new_branch_info->commit)
BUG("'switch --orphan' should never accept a commit as starting point");
new_tree = parse_tree_indirect(the_hash_algo->empty_tree);
- } else
- new_tree = get_commit_tree(new_branch_info->commit);
+ if (!new_tree)
+ BUG("unable to read empty tree");
+ } else {
+ new_tree = repo_get_commit_tree(the_repository,
+ new_branch_info->commit);
+ if (!new_tree)
+ return error(_("unable to read tree (%s)"),
+ oid_to_hex(&new_branch_info->commit->object.oid));
+ }
if (opts->discard_changes) {
ret = reset_tree(new_tree, opts, 1, writeout_error, new_branch_info);
if (ret)
@@ -740,32 +807,20 @@ static int merge_working_tree(const struct checkout_opts *opts,
struct unpack_trees_options topts;
const struct object_id *old_commit_oid;
- memset(&topts, 0, sizeof(topts));
- topts.head_idx = -1;
- topts.src_index = &the_index;
- topts.dst_index = &the_index;
-
- setup_unpack_trees_porcelain(&topts, "checkout");
-
- refresh_cache(REFRESH_QUIET);
+ refresh_index(&the_index, REFRESH_QUIET, NULL, NULL, NULL);
- if (unmerged_cache()) {
+ if (unmerged_index(&the_index)) {
error(_("you need to resolve your current index first"));
return 1;
}
/* 2-way merge to the new branch */
- topts.initial_checkout = is_cache_unborn();
- topts.update = 1;
- topts.merge = 1;
- topts.quiet = opts->merge && old_branch_info->commit;
- topts.verbose_update = opts->show_progress;
- topts.fn = twoway_merge;
+ init_topts(&topts, opts->merge, opts->show_progress,
+ opts->overwrite_ignore, old_branch_info->commit);
init_checkout_metadata(&topts.meta, new_branch_info->refname,
new_branch_info->commit ?
&new_branch_info->commit->object.oid :
&new_branch_info->oid, NULL);
- topts.preserve_ignored = !opts->overwrite_ignore;
old_commit_oid = old_branch_info->commit ?
&old_branch_info->commit->object.oid :
@@ -775,10 +830,13 @@ static int merge_working_tree(const struct checkout_opts *opts,
die(_("unable to parse commit %s"),
oid_to_hex(old_commit_oid));
- init_tree_desc(&trees[0], tree->buffer, tree->size);
- parse_tree(new_tree);
+ init_tree_desc(&trees[0], &tree->object.oid,
+ tree->buffer, tree->size);
+ if (parse_tree(new_tree) < 0)
+ exit(128);
tree = new_tree;
- init_tree_desc(&trees[1], tree->buffer, tree->size);
+ init_tree_desc(&trees[1], &tree->object.oid,
+ tree->buffer, tree->size);
ret = unpack_trees(2, trees, &topts);
clear_unpack_trees_porcelain(&topts);
@@ -803,7 +861,8 @@ static int merge_working_tree(const struct checkout_opts *opts,
*/
if (!old_branch_info->commit)
return 1;
- old_tree = get_commit_tree(old_branch_info->commit);
+ old_tree = repo_get_commit_tree(the_repository,
+ old_branch_info->commit);
if (repo_index_has_changes(the_repository, old_tree, &sb))
die(_("cannot continue with staged changes in "
@@ -823,7 +882,8 @@ static int merge_working_tree(const struct checkout_opts *opts,
* entries in the index.
*/
- add_files_to_cache(NULL, NULL, 0);
+ add_files_to_cache(the_repository, NULL, NULL, NULL, 0,
+ 0);
init_merge_options(&o, the_repository);
o.verbosity = 0;
work = write_in_core_index_as_tree(the_repository);
@@ -842,6 +902,7 @@ static int merge_working_tree(const struct checkout_opts *opts,
}
o.branch1 = new_branch_info->name;
o.branch2 = "local";
+ o.conflict_style = opts->conflict_style;
ret = merge_trees(&o,
new_tree,
work,
@@ -858,7 +919,7 @@ static int merge_working_tree(const struct checkout_opts *opts,
}
}
- if (!cache_tree_fully_valid(active_cache_tree))
+ if (!cache_tree_fully_valid(the_index.cache_tree))
cache_tree_update(&the_index, WRITE_TREE_SILENT | WRITE_TREE_REPAIR);
if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
@@ -875,7 +936,7 @@ static void report_tracking(struct branch_info *new_branch_info)
struct strbuf sb = STRBUF_INIT;
struct branch *branch = branch_get(new_branch_info->name);
- if (!format_tracking_info(branch, &sb, AHEAD_BEHIND_FULL))
+ if (!format_tracking_info(branch, &sb, AHEAD_BEHIND_FULL, 1))
return;
fputs(sb.buf, stdout);
strbuf_release(&sb);
@@ -975,13 +1036,14 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
remove_branch_state(the_repository, !opts->quiet);
strbuf_release(&msg);
if (!opts->quiet &&
- (new_branch_info->path || (!opts->force_detach && !strcmp(new_branch_info->name, "HEAD"))))
+ !opts->force_detach &&
+ (new_branch_info->path || !strcmp(new_branch_info->name, "HEAD")))
report_tracking(new_branch_info);
}
static int add_pending_uninteresting_ref(const char *refname,
const struct object_id *oid,
- int flags, void *cb_data)
+ int flags UNUSED, void *cb_data)
{
add_pending_oid(cb_data, refname, oid, UNINTERESTING);
return 0;
@@ -992,7 +1054,7 @@ static void describe_one_orphan(struct strbuf *sb, struct commit *commit)
strbuf_addstr(sb, " ");
strbuf_add_unique_abbrev(sb, &commit->object.oid, DEFAULT_ABBREV);
strbuf_addch(sb, ' ');
- if (!parse_commit(commit))
+ if (!repo_parse_commit(the_repository, commit))
pp_commit_easy(CMIT_FMT_ONELINE, commit, sb);
strbuf_addch(sb, '\n');
}
@@ -1048,7 +1110,7 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs)
" git branch <new-branch-name> %s\n\n",
/* Give ngettext() the count */
lost),
- find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, &commit->object.oid, DEFAULT_ABBREV));
}
/*
@@ -1148,11 +1210,14 @@ static int switch_branches(const struct checkout_opts *opts,
return ret || writeout_error;
}
-static int git_checkout_config(const char *var, const char *value, void *cb)
+static int git_checkout_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
struct checkout_opts *opts = cb;
if (!strcmp(var, "diff.ignoresubmodules")) {
+ if (!value)
+ return config_error_nonbool(var);
handle_ignore_submodules_arg(&opts->diff_options, value);
return 0;
}
@@ -1164,7 +1229,7 @@ static int git_checkout_config(const char *var, const char *value, void *cb)
if (starts_with(var, "submodule."))
return git_default_submodule_config(var, value, NULL);
- return git_xmerge_config(var, value, NULL);
+ return git_xmerge_config(var, value, ctx, NULL);
}
static void setup_new_branch_info_and_source_tree(
@@ -1176,7 +1241,9 @@ static void setup_new_branch_info_and_source_tree(
struct tree **source_tree = &opts->source_tree;
struct object_id branch_rev;
- new_branch_info->name = xstrdup(arg);
+ /* treat '@' as a shortcut for 'HEAD' */
+ new_branch_info->name = !strcmp(arg, "@") ? xstrdup("HEAD") :
+ xstrdup(arg);
setup_branch_path(new_branch_info);
if (!check_refname_format(new_branch_info->path, 0) &&
@@ -1190,9 +1257,15 @@ static void setup_new_branch_info_and_source_tree(
if (!new_branch_info->commit) {
/* not a commit */
*source_tree = parse_tree_indirect(rev);
+ if (!*source_tree)
+ die(_("unable to read tree (%s)"), oid_to_hex(rev));
} else {
parse_commit_or_die(new_branch_info->commit);
- *source_tree = get_commit_tree(new_branch_info->commit);
+ *source_tree = repo_get_commit_tree(the_repository,
+ new_branch_info->commit);
+ if (!*source_tree)
+ die(_("unable to read tree (%s)"),
+ oid_to_hex(&new_branch_info->commit->object.oid));
}
}
@@ -1260,7 +1333,7 @@ static int parse_branchname_arg(int argc, const char **argv,
* between A and B, A...B names that merge base.
*
* (b) If <something> is _not_ a commit, either "--" is present
- * or <something> is not a path, no -t or -b was given, and
+ * or <something> is not a path, no -t or -b was given,
* and there is a tracking branch whose name is <something>
* in one and only one remote (or if the branch exists on the
* remote named in checkout.defaultRemote), then this is a
@@ -1310,7 +1383,7 @@ static int parse_branchname_arg(int argc, const char **argv,
if (!strcmp(arg, "-"))
arg = "@{-1}";
- if (get_oid_mb(arg, rev)) {
+ if (repo_get_oid_mb(the_repository, arg, rev)) {
/*
* Either case (3) or (4), with <something> not being
* a commit, or an attempt to use case (1) with an
@@ -1407,7 +1480,8 @@ static void die_expecting_a_branch(const struct branch_info *branch_info)
char *to_free;
int code;
- if (dwim_ref(branch_info->name, strlen(branch_info->name), &oid, &to_free, 0) == 1) {
+ if (repo_dwim_ref(the_repository, branch_info->name,
+ strlen(branch_info->name), &oid, &to_free, 0) == 1) {
const char *ref = to_free;
if (skip_prefix(ref, "refs/tags/", &ref))
@@ -1461,6 +1535,28 @@ static void die_if_some_operation_in_progress(void)
"or \"git worktree add\"."));
if (state.bisect_in_progress)
warning(_("you are switching branch while bisecting"));
+
+ wt_status_state_free_buffers(&state);
+}
+
+/*
+ * die if attempting to checkout an existing branch that is in use
+ * in another worktree, unless ignore-other-wortrees option is given.
+ * The check is bypassed when the branch is already the current one,
+ * as it will not make things any worse.
+ */
+static void die_if_switching_to_a_branch_in_use(struct checkout_opts *opts,
+ const char *full_ref)
+{
+ int flags;
+ char *head_ref;
+
+ if (opts->ignore_other_worktrees)
+ return;
+ head_ref = resolve_refdup("HEAD", 0, NULL, &flags);
+ if (head_ref && (!(flags & REF_ISSYMREF) || strcmp(head_ref, full_ref)))
+ die_if_checked_out(full_ref, 1);
+ free(head_ref);
}
static int checkout_branch(struct checkout_opts *opts,
@@ -1523,14 +1619,15 @@ static int checkout_branch(struct checkout_opts *opts,
if (!opts->can_switch_when_in_progress)
die_if_some_operation_in_progress();
- if (new_branch_info->path && !opts->force_detach && !opts->new_branch &&
- !opts->ignore_other_worktrees) {
- int flag;
- char *head_ref = resolve_refdup("HEAD", 0, NULL, &flag);
- if (head_ref &&
- (!(flag & REF_ISSYMREF) || strcmp(head_ref, new_branch_info->path)))
- die_if_checked_out(new_branch_info->path, 1);
- free(head_ref);
+ /* "git checkout <branch>" */
+ if (new_branch_info->path && !opts->force_detach && !opts->new_branch)
+ die_if_switching_to_a_branch_in_use(opts, new_branch_info->path);
+
+ /* "git checkout -B <branch>" */
+ if (opts->new_branch_force) {
+ char *full_ref = xstrfmt("refs/heads/%s", opts->new_branch);
+ die_if_switching_to_a_branch_in_use(opts, full_ref);
+ free(full_ref);
}
if (!new_branch_info->commit && opts->new_branch) {
@@ -1544,6 +1641,24 @@ static int checkout_branch(struct checkout_opts *opts,
return switch_branches(opts, new_branch_info);
}
+static int parse_opt_conflict(const struct option *o, const char *arg, int unset)
+{
+ struct checkout_opts *opts = o->value;
+
+ if (unset) {
+ opts->conflict_style = -1;
+ return 0;
+ }
+ opts->conflict_style = parse_conflict_style_name(arg);
+ if (opts->conflict_style < 0)
+ return error(_("unknown conflict style '%s'"), arg);
+ /* --conflict overrides a previous --no-merge */
+ if (!opts->merge)
+ opts->merge = -1;
+
+ return 0;
+}
+
static struct option *add_common_options(struct checkout_opts *opts,
struct option *prevopts)
{
@@ -1554,8 +1669,9 @@ static struct option *add_common_options(struct checkout_opts *opts,
PARSE_OPT_OPTARG, option_parse_recurse_submodules_worktree_updater),
OPT_BOOL(0, "progress", &opts->show_progress, N_("force progress reporting")),
OPT_BOOL('m', "merge", &opts->merge, N_("perform a 3-way merge with the new branch")),
- OPT_STRING(0, "conflict", &opts->conflict_style, N_("style"),
- N_("conflict style (merge, diff3, or zdiff3)")),
+ OPT_CALLBACK(0, "conflict", opts, N_("style"),
+ N_("conflict style (merge, diff3, or zdiff3)"),
+ parse_opt_conflict),
OPT_END()
};
struct option *newopts = parse_options_concat(prevopts, options);
@@ -1574,7 +1690,7 @@ static struct option *add_common_switch_branch_options(
parse_opt_tracking_mode),
OPT__FORCE(&opts->force, N_("force checkout (throw away local modifications)"),
PARSE_OPT_NOCOMPLETE),
- OPT_STRING(0, "orphan", &opts->new_orphan_branch, N_("new-branch"), N_("new unparented branch")),
+ OPT_STRING(0, "orphan", &opts->new_orphan_branch, N_("new-branch"), N_("new unborn branch")),
OPT_BOOL_F(0, "overwrite-ignore", &opts->overwrite_ignore,
N_("update ignored files (default)"),
PARSE_OPT_NOCOMPLETE),
@@ -1614,10 +1730,11 @@ static char cb_option = 'b';
static int checkout_main(int argc, const char **argv, const char *prefix,
struct checkout_opts *opts, struct option *options,
- const char * const usagestr[],
- struct branch_info *new_branch_info)
+ const char * const usagestr[])
{
int parseopt_flags = 0;
+ struct branch_info new_branch_info = { 0 };
+ int ret;
opts->overwrite_ignore = 1;
opts->prefix = prefix;
@@ -1646,10 +1763,10 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
opts->show_progress = isatty(2);
}
- if (opts->conflict_style) {
- opts->merge = 1; /* implied */
- git_xmerge_config("merge.conflictstyle", opts->conflict_style, NULL);
- }
+ /* --conflicts implies --merge */
+ if (opts->merge == -1)
+ opts->merge = opts->conflict_style >= 0;
+
if (opts->force) {
opts->discard_changes = 1;
opts->ignore_unmerged_opt = "--force";
@@ -1728,16 +1845,16 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
opts->track == BRANCH_TRACK_UNSPECIFIED &&
!opts->new_branch;
int n = parse_branchname_arg(argc, argv, dwim_ok,
- new_branch_info, opts, &rev);
+ &new_branch_info, opts, &rev);
argv += n;
argc -= n;
} else if (!opts->accept_ref && opts->from_treeish) {
struct object_id rev;
- if (get_oid_mb(opts->from_treeish, &rev))
+ if (repo_get_oid_mb(the_repository, opts->from_treeish, &rev))
die(_("could not resolve %s"), opts->from_treeish);
- setup_new_branch_info_and_source_tree(new_branch_info,
+ setup_new_branch_info_and_source_tree(&new_branch_info,
opts, &rev,
opts->from_treeish);
@@ -1757,7 +1874,7 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
* Try to give more helpful suggestion.
* new_branch && argc > 1 will be caught later.
*/
- if (opts->new_branch && argc == 1 && !new_branch_info->commit)
+ if (opts->new_branch && argc == 1 && !new_branch_info.commit)
die(_("'%s' is not a commit and a branch '%s' cannot be created from it"),
argv[0], opts->new_branch);
@@ -1807,14 +1924,21 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
}
if (opts->patch_mode || opts->pathspec.nr)
- return checkout_paths(opts, new_branch_info);
+ ret = checkout_paths(opts, &new_branch_info);
else
- return checkout_branch(opts, new_branch_info);
+ ret = checkout_branch(opts, &new_branch_info);
+
+ branch_info_release(&new_branch_info);
+ clear_pathspec(&opts->pathspec);
+ free(opts->pathspec_from_file);
+ free(options);
+
+ return ret;
}
int cmd_checkout(int argc, const char **argv, const char *prefix)
{
- struct checkout_opts opts;
+ struct checkout_opts opts = CHECKOUT_OPTS_INIT;
struct option *options;
struct option checkout_options[] = {
OPT_STRING('b', NULL, &opts.new_branch, N_("branch"),
@@ -1827,10 +1951,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
OPT_BOOL(0, "overlay", &opts.overlay_mode, N_("use overlay mode (default)")),
OPT_END()
};
- int ret;
- struct branch_info new_branch_info = { 0 };
- memset(&opts, 0, sizeof(opts));
opts.dwim_new_local_branch = 1;
opts.switch_branch_doing_nothing_is_ok = 1;
opts.only_merge_on_switching_branches = 0;
@@ -1858,17 +1979,13 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
options = add_common_switch_branch_options(&opts, options);
options = add_checkout_path_options(&opts, options);
- ret = checkout_main(argc, argv, prefix, &opts,
- options, checkout_usage, &new_branch_info);
- branch_info_release(&new_branch_info);
- clear_pathspec(&opts.pathspec);
- FREE_AND_NULL(options);
- return ret;
+ return checkout_main(argc, argv, prefix, &opts, options,
+ checkout_usage);
}
int cmd_switch(int argc, const char **argv, const char *prefix)
{
- struct checkout_opts opts;
+ struct checkout_opts opts = CHECKOUT_OPTS_INIT;
struct option *options = NULL;
struct option switch_options[] = {
OPT_STRING('c', "create", &opts.new_branch, N_("branch"),
@@ -1881,10 +1998,7 @@ int cmd_switch(int argc, const char **argv, const char *prefix)
N_("throw away local modifications")),
OPT_END()
};
- int ret;
- struct branch_info new_branch_info = { 0 };
- memset(&opts, 0, sizeof(opts));
opts.dwim_new_local_branch = 1;
opts.accept_ref = 1;
opts.accept_pathspec = 0;
@@ -1901,16 +2015,13 @@ int cmd_switch(int argc, const char **argv, const char *prefix)
cb_option = 'c';
- ret = checkout_main(argc, argv, prefix, &opts,
- options, switch_branch_usage, &new_branch_info);
- branch_info_release(&new_branch_info);
- FREE_AND_NULL(options);
- return ret;
+ return checkout_main(argc, argv, prefix, &opts, options,
+ switch_branch_usage);
}
int cmd_restore(int argc, const char **argv, const char *prefix)
{
- struct checkout_opts opts;
+ struct checkout_opts opts = CHECKOUT_OPTS_INIT;
struct option *options;
struct option restore_options[] = {
OPT_STRING('s', "source", &opts.from_treeish, "<tree-ish>",
@@ -1924,10 +2035,7 @@ int cmd_restore(int argc, const char **argv, const char *prefix)
OPT_BOOL(0, "overlay", &opts.overlay_mode, N_("use overlay mode")),
OPT_END()
};
- int ret;
- struct branch_info new_branch_info = { 0 };
- memset(&opts, 0, sizeof(opts));
opts.accept_ref = 0;
opts.accept_pathspec = 1;
opts.empty_pathspec_ok = 0;
@@ -1940,9 +2048,6 @@ int cmd_restore(int argc, const char **argv, const char *prefix)
options = add_common_options(&opts, options);
options = add_checkout_path_options(&opts, options);
- ret = checkout_main(argc, argv, prefix, &opts,
- options, restore_usage, &new_branch_info);
- branch_info_release(&new_branch_info);
- FREE_AND_NULL(options);
- return ret;
+ return checkout_main(argc, argv, prefix, &opts, options,
+ restore_usage);
}
diff --git a/builtin/clean.c b/builtin/clean.c
index 5466636..29efe84 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -6,12 +6,17 @@
* Based on git-clean.sh by Pavel Roskin
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
-#include "cache.h"
+#include "abspath.h"
#include "config.h"
#include "dir.h"
+#include "gettext.h"
#include "parse-options.h"
+#include "path.h"
+#include "read-cache-ll.h"
+#include "repository.h"
+#include "setup.h"
#include "string-list.h"
#include "quote.h"
#include "column.h"
@@ -20,13 +25,13 @@
#include "help.h"
#include "prompt.h"
-static int force = -1; /* unset */
+static int require_force = -1; /* unset */
static int interactive;
static struct string_list del_list = STRING_LIST_INIT_DUP;
static unsigned int colopts;
static const char *const builtin_clean_usage[] = {
- N_("git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <paths>..."),
+ N_("git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] [<pathspec>...]"),
NULL
};
@@ -99,7 +104,8 @@ struct menu_stuff {
define_list_config_array(color_interactive_slots);
-static int git_clean_config(const char *var, const char *value, void *cb)
+static int git_clean_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
const char *slot_name;
@@ -122,12 +128,14 @@ static int git_clean_config(const char *var, const char *value, void *cb)
}
if (!strcmp(var, "clean.requireforce")) {
- force = !git_config_bool(var, value);
+ require_force = git_config_bool(var, value);
return 0;
}
- /* inspect the color.ui config variable and others */
- return git_color_default_config(var, value, cb);
+ if (git_color_config(var, value, cb) < 0)
+ return -1;
+
+ return git_default_config(var, value, ctx, cb);
}
static const char *clean_get_color(enum color_clean ix)
@@ -560,7 +568,7 @@ static int parse_choice(struct menu_stuff *menu_stuff,
/*
* Implement a git-add-interactive compatible UI, which is borrowed
- * from git-add--interactive.perl.
+ * from add-interactive.c.
*
* Return value:
*
@@ -912,7 +920,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
{
int i, res;
int dry_run = 0, remove_directories = 0, quiet = 0, ignored = 0;
- int ignored_only = 0, config_set = 0, errors = 0, gone = 1;
+ int ignored_only = 0, force = 0, errors = 0, gone = 1;
int rm_flags = REMOVE_DIR_KEEP_NESTED_GIT;
struct strbuf abs_path = STRBUF_INIT;
struct dir_struct dir = DIR_INIT;
@@ -938,22 +946,12 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
};
git_config(git_clean_config, NULL);
- if (force < 0)
- force = 0;
- else
- config_set = 1;
argc = parse_options(argc, argv, prefix, options, builtin_clean_usage,
0);
- if (!interactive && !dry_run && !force) {
- if (config_set)
- die(_("clean.requireForce set to true and neither -i, -n, nor -f given; "
- "refusing to clean"));
- else
- die(_("clean.requireForce defaults to true and neither -i, -n, nor -f given;"
- " refusing to clean"));
- }
+ if (require_force != 0 && !force && !interactive && !dry_run)
+ die(_("clean.requireForce is true and -f not given: refusing to clean"));
if (force > 1)
rm_flags = 0;
@@ -963,7 +961,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
dir.flags |= DIR_SHOW_OTHER_DIRECTORIES;
if (ignored && ignored_only)
- die(_("-x and -X cannot be used together"));
+ die(_("options '%s' and '%s' cannot be used together"), "-x", "-X");
if (!ignored)
setup_standard_excludes(&dir);
if (ignored_only)
@@ -1012,7 +1010,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
- if (read_cache() < 0)
+ if (repo_read_index(the_repository) < 0)
die(_("index file corrupt"));
pl = add_pattern_list(&dir, EXC_CMDL, "--exclude option");
@@ -1031,7 +1029,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
struct stat st;
const char *rel;
- if (!cache_name_is_other(ent->name, ent->len))
+ if (!index_name_is_other(&the_index, ent->name, ent->len))
continue;
if (lstat(ent->name, &st))
@@ -1092,5 +1090,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
strbuf_release(&buf);
string_list_clear(&del_list, 0);
string_list_clear(&exclude_list, 0);
+ clear_pathspec(&pathspec);
return (errors != 0);
}
diff --git a/builtin/clone.c b/builtin/clone.c
index 9e0b2b4..74ec145 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -8,15 +8,21 @@
* Clone a repository into a different directory that does not yet exist.
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
+#include "advice.h"
#include "config.h"
+#include "copy.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "lockfile.h"
#include "parse-options.h"
-#include "fetch-pack.h"
#include "refs.h"
#include "refspec.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
#include "tree.h"
#include "tree-walk.h"
#include "unpack-trees.h"
@@ -29,11 +35,15 @@
#include "branch.h"
#include "remote.h"
#include "run-command.h"
+#include "setup.h"
#include "connected.h"
#include "packfile.h"
+#include "path.h"
+#include "pkt-line.h"
#include "list-objects-filter-options.h"
#include "hook.h"
#include "bundle.h"
+#include "bundle-uri.h"
/*
* Overall FIXMEs:
@@ -61,6 +71,7 @@ static char *remote_name = NULL;
static char *option_branch = NULL;
static struct string_list option_not = STRING_LIST_INIT_NODUP;
static const char *real_git_dir;
+static const char *ref_format;
static char *option_upload_pack = "git-upload-pack";
static int option_verbosity;
static int option_progress = -1;
@@ -72,11 +83,12 @@ static struct string_list option_optional_reference = STRING_LIST_INIT_NODUP;
static int option_dissociate;
static int max_jobs = -1;
static struct string_list option_recurse_submodules = STRING_LIST_INIT_NODUP;
-static struct list_objects_filter_options filter_options;
+static struct list_objects_filter_options filter_options = LIST_OBJECTS_FILTER_INIT;
static int option_filter_submodules = -1; /* unspecified */
static int config_filter_submodules = -1; /* unspecified */
static struct string_list server_options = STRING_LIST_INIT_NODUP;
static int option_remote_submodules;
+static const char *bundle_uri;
static int recurse_submodules_cb(const struct option *opt,
const char *arg, int unset)
@@ -104,7 +116,7 @@ static struct option builtin_clone_options[] = {
OPT_HIDDEN_BOOL(0, "naked", &option_bare,
N_("create a bare repository")),
OPT_BOOL(0, "mirror", &option_mirror,
- N_("create a mirror repository (implies bare)")),
+ N_("create a mirror repository (implies --bare)")),
OPT_BOOL('l', "local", &option_local,
N_("to clone from a local repository")),
OPT_BOOL(0, "no-hardlinks", &option_no_hardlinks,
@@ -145,14 +157,13 @@ static struct option builtin_clone_options[] = {
N_("any cloned submodules will be shallow")),
OPT_STRING(0, "separate-git-dir", &real_git_dir, N_("gitdir"),
N_("separate git dir from working tree")),
+ OPT_STRING(0, "ref-format", &ref_format, N_("format"),
+ N_("specify the reference format to use")),
OPT_STRING_LIST('c', "config", &option_config, N_("key=value"),
N_("set config inside the new repository")),
OPT_STRING_LIST(0, "server-option", &server_options,
N_("server-specific"), N_("option to transmit")),
- OPT_SET_INT('4', "ipv4", &family, N_("use IPv4 addresses only"),
- TRANSPORT_FAMILY_IPV4),
- OPT_SET_INT('6', "ipv6", &family, N_("use IPv6 addresses only"),
- TRANSPORT_FAMILY_IPV6),
+ OPT_IPVERSION(&family),
OPT_PARSE_LIST_OBJECTS_FILTER(&filter_options),
OPT_BOOL(0, "also-filter-submodules", &option_filter_submodules,
N_("apply partial clone filters to submodules")),
@@ -160,6 +171,8 @@ static struct option builtin_clone_options[] = {
N_("any cloned submodules will use their remote-tracking branch")),
OPT_BOOL(0, "sparse", &option_sparse_checkout,
N_("initialize sparse-checkout file to include only files at root")),
+ OPT_STRING(0, "bundle-uri", &bundle_uri,
+ N_("uri"), N_("a URI for downloading bundles before fetching from origin remote")),
OPT_END()
};
@@ -316,16 +329,24 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest,
int src_len, dest_len;
struct dir_iterator *iter;
int iter_status;
- unsigned int flags;
struct strbuf realpath = STRBUF_INIT;
mkdir_if_missing(dest->buf, 0777);
- flags = DIR_ITERATOR_PEDANTIC | DIR_ITERATOR_FOLLOW_SYMLINKS;
- iter = dir_iterator_begin(src->buf, flags);
+ iter = dir_iterator_begin(src->buf, DIR_ITERATOR_PEDANTIC);
- if (!iter)
+ if (!iter) {
+ if (errno == ENOTDIR) {
+ int saved_errno = errno;
+ struct stat st;
+
+ if (!lstat(src->buf, &st) && S_ISLNK(st.st_mode))
+ die(_("'%s' is a symlink, refusing to clone with --local"),
+ src->buf);
+ errno = saved_errno;
+ }
die_errno(_("failed to start iterator over '%s'"), src->buf);
+ }
strbuf_addch(src, '/');
src_len = src->len;
@@ -338,6 +359,10 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest,
strbuf_setlen(dest, dest_len);
strbuf_addstr(dest, iter->relative_path);
+ if (S_ISLNK(iter->st.st_mode))
+ die(_("symlink '%s' exists, refusing to clone with --local"),
+ iter->relative_path);
+
if (S_ISDIR(iter->st.st_mode)) {
mkdir_if_missing(dest->buf, 0777);
continue;
@@ -494,6 +519,7 @@ static struct ref *wanted_peer_refs(const struct ref *refs,
/* if --branch=tag, pull the requested tag explicitly */
get_fetch_map(remote_head, tag_refspec, &tail, 0);
}
+ free_refs(remote_head);
} else {
int i;
for (i = 0; i < refspec->nr; i++)
@@ -540,9 +566,9 @@ static void write_followtags(const struct ref *refs, const char *msg)
continue;
if (ends_with(ref->name, "^{}"))
continue;
- if (!has_object_file_with_flags(&ref->old_oid,
- OBJECT_INFO_QUICK |
- OBJECT_INFO_SKIP_FETCH_OBJECT))
+ if (!repo_has_object_file_with_flags(the_repository, &ref->old_oid,
+ OBJECT_INFO_QUICK |
+ OBJECT_INFO_SKIP_FETCH_OBJECT))
continue;
update_ref(msg, ref->name, &ref->old_oid, NULL, 0,
UPDATE_REFS_DIE_ON_ERR);
@@ -646,9 +672,9 @@ static void update_head(const struct ref *our, const struct ref *remote,
static int git_sparse_checkout_init(const char *repo)
{
- struct strvec argv = STRVEC_INIT;
+ struct child_process cmd = CHILD_PROCESS_INIT;
int result = 0;
- strvec_pushl(&argv, "-C", repo, "sparse-checkout", "set", NULL);
+ strvec_pushl(&cmd.args, "-C", repo, "sparse-checkout", "set", NULL);
/*
* We must apply the setting in the current process
@@ -656,12 +682,12 @@ static int git_sparse_checkout_init(const char *repo)
*/
core_apply_sparse_checkout = 1;
- if (run_command_v_opt(argv.v, RUN_GIT_CMD)) {
+ cmd.git_cmd = 1;
+ if (run_command(&cmd)) {
error(_("failed to initialize sparse-checkout"));
result = 1;
}
- strvec_clear(&argv);
return result;
}
@@ -696,7 +722,7 @@ static int checkout(int submodule_progress, int filter_submodules)
/* We need to be in the new work tree for the checkout */
setup_work_tree();
- hold_locked_index(&lock_file, LOCK_DIE_ON_ERROR);
+ repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
memset(&opts, 0, sizeof opts);
opts.update = 1;
@@ -712,8 +738,9 @@ static int checkout(int submodule_progress, int filter_submodules)
tree = parse_tree_indirect(&oid);
if (!tree)
die(_("unable to parse commit %s"), oid_to_hex(&oid));
- parse_tree(tree);
- init_tree_desc(&t, tree->buffer, tree->size);
+ if (parse_tree(tree) < 0)
+ exit(128);
+ init_tree_desc(&t, &tree->object.oid, tree->buffer, tree->size);
if (unpack_trees(1, &t, &opts) < 0)
die(_("unable to checkout working tree"));
@@ -726,45 +753,49 @@ static int checkout(int submodule_progress, int filter_submodules)
oid_to_hex(&oid), "1", NULL);
if (!err && (option_recurse_submodules.nr > 0)) {
- struct strvec args = STRVEC_INIT;
- strvec_pushl(&args, "submodule", "update", "--require-init", "--recursive", NULL);
+ struct child_process cmd = CHILD_PROCESS_INIT;
+ strvec_pushl(&cmd.args, "submodule", "update", "--require-init",
+ "--recursive", NULL);
if (option_shallow_submodules == 1)
- strvec_push(&args, "--depth=1");
+ strvec_push(&cmd.args, "--depth=1");
if (max_jobs != -1)
- strvec_pushf(&args, "--jobs=%d", max_jobs);
+ strvec_pushf(&cmd.args, "--jobs=%d", max_jobs);
if (submodule_progress)
- strvec_push(&args, "--progress");
+ strvec_push(&cmd.args, "--progress");
if (option_verbosity < 0)
- strvec_push(&args, "--quiet");
+ strvec_push(&cmd.args, "--quiet");
if (option_remote_submodules) {
- strvec_push(&args, "--remote");
- strvec_push(&args, "--no-fetch");
+ strvec_push(&cmd.args, "--remote");
+ strvec_push(&cmd.args, "--no-fetch");
}
if (filter_submodules && filter_options.choice)
- strvec_pushf(&args, "--filter=%s",
+ strvec_pushf(&cmd.args, "--filter=%s",
expand_list_objects_filter_spec(&filter_options));
if (option_single_branch >= 0)
- strvec_push(&args, option_single_branch ?
+ strvec_push(&cmd.args, option_single_branch ?
"--single-branch" :
"--no-single-branch");
- err = run_command_v_opt(args.v, RUN_GIT_CMD);
- strvec_clear(&args);
+ cmd.git_cmd = 1;
+ err = run_command(&cmd);
}
return err;
}
-static int git_clone_config(const char *k, const char *v, void *cb)
+static int git_clone_config(const char *k, const char *v,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(k, "clone.defaultremotename")) {
+ if (!v)
+ return config_error_nonbool(k);
free(remote_name);
remote_name = xstrdup(v);
}
@@ -773,17 +804,19 @@ static int git_clone_config(const char *k, const char *v, void *cb)
if (!strcmp(k, "clone.filtersubmodules"))
config_filter_submodules = git_config_bool(k, v);
- return git_default_config(k, v, cb);
+ return git_default_config(k, v, ctx, cb);
}
-static int write_one_config(const char *key, const char *value, void *data)
+static int write_one_config(const char *key, const char *value,
+ const struct config_context *ctx,
+ void *data)
{
/*
* give git_clone_config a chance to write config values back to the
* environment, since git_config_set_multivar_gently only deals with
* config-file writes
*/
- int apply_failed = git_clone_config(key, value, data);
+ int apply_failed = git_clone_config(key, value, ctx, data);
if (apply_failed)
return apply_failed;
@@ -857,11 +890,15 @@ static void write_refspec_config(const char *src_ref_prefix,
static void dissociate_from_references(void)
{
- static const char* argv[] = { "repack", "-a", "-d", NULL };
char *alternates = git_pathdup("objects/info/alternates");
if (!access(alternates, F_OK)) {
- if (run_command_v_opt(argv, RUN_GIT_CMD|RUN_COMMAND_NO_STDIN))
+ struct child_process cmd = CHILD_PROCESS_INIT;
+
+ cmd.git_cmd = 1;
+ cmd.no_stdin = 1;
+ strvec_pushl(&cmd.args, "repack", "-a", "-d", NULL);
+ if (run_command(&cmd))
die(_("cannot repack to clean up"));
if (unlink(alternates) && errno != ENOENT)
die_errno(_("cannot unlink temporary alternates file"));
@@ -880,6 +917,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
int is_bundle = 0, is_local;
int reject_shallow = 0;
const char *repo_name, *repo, *work_tree, *git_dir;
+ char *repo_to_free = NULL;
char *path = NULL, *dir, *display_repo = NULL;
int dest_exists, real_dest_exists = 0;
const struct ref *refs, *remote_head;
@@ -889,6 +927,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
struct ref *mapped_refs = NULL;
const struct ref *ref;
struct strbuf key = STRBUF_INIT;
+ struct strbuf buf = STRBUF_INIT;
struct strbuf branch_top = STRBUF_INIT, reflog_msg = STRBUF_INIT;
struct transport *transport = NULL;
const char *src_ref_prefix = "refs/heads/";
@@ -896,6 +935,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
int err = 0, complete_refs_before_fetch = 1;
int submodule_progress;
int filter_submodules = 0;
+ int hash_algo;
+ unsigned int ref_storage_format = REF_STORAGE_FORMAT_UNKNOWN;
+ const int do_not_override_repo_unix_permissions = -1;
struct transport_ls_refs_options transport_ls_refs_options =
TRANSPORT_LS_REFS_OPTIONS_INIT;
@@ -920,24 +962,32 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (option_single_branch == -1)
option_single_branch = deepen ? 1 : 0;
+ if (ref_format) {
+ ref_storage_format = ref_storage_format_by_name(ref_format);
+ if (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)
+ die(_("unknown ref storage format '%s'"), ref_format);
+ }
+
if (option_mirror)
option_bare = 1;
if (option_bare) {
- if (option_origin)
- die(_("options '%s' and '%s %s' cannot be used together"),
- "--bare", "--origin", option_origin);
if (real_git_dir)
die(_("options '%s' and '%s' cannot be used together"), "--bare", "--separate-git-dir");
option_no_checkout = 1;
}
+ if (bundle_uri && deepen)
+ die(_("options '%s' and '%s' cannot be used together"),
+ "--bundle-uri",
+ "--depth/--shallow-since/--shallow-exclude");
+
repo_name = argv[0];
path = get_repo_path(repo_name, &is_bundle);
if (path) {
FREE_AND_NULL(path);
- repo = absolute_pathdup(repo_name);
+ repo = repo_to_free = absolute_pathdup(repo_name);
} else if (strchr(repo_name, ':')) {
repo = repo_name;
display_repo = transport_anonymize_url(repo);
@@ -1062,8 +1112,15 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
}
}
- init_db(git_dir, real_git_dir, option_template, GIT_HASH_UNKNOWN, NULL,
- INIT_DB_QUIET);
+ /*
+ * Initialize the repository, but skip initializing the reference
+ * database. We do not yet know about the object format of the
+ * repository, and reference backends may persist that information into
+ * their on-disk data structures.
+ */
+ init_db(git_dir, real_git_dir, option_template, GIT_HASH_UNKNOWN,
+ ref_storage_format, NULL,
+ do_not_override_repo_unix_permissions, INIT_DB_QUIET | INIT_DB_SKIP_REFDB);
if (real_git_dir) {
free((char *)git_dir);
@@ -1071,6 +1128,50 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
}
/*
+ * We have a chicken-and-egg situation between initializing the refdb
+ * and spawning transport helpers:
+ *
+ * - Initializing the refdb requires us to know about the object
+ * format. We thus have to spawn the transport helper to learn
+ * about it.
+ *
+ * - The transport helper may want to access the Git repository. But
+ * because the refdb has not been initialized, we don't have "HEAD"
+ * or "refs/". Thus, the helper cannot find the Git repository.
+ *
+ * Ideally, we would have structured the helper protocol such that it's
+ * mandatory for the helper to first announce its capabilities without
+ * yet assuming a fully initialized repository. Like that, we could
+ * have added a "lazy-refdb-init" capability that announces whether the
+ * helper is ready to handle not-yet-initialized refdbs. If any helper
+ * didn't support them, we would have fully initialized the refdb with
+ * the SHA1 object format, but later on bailed out if we found out that
+ * the remote repository used a different object format.
+ *
+ * But we didn't, and thus we use the following workaround to partially
+ * initialize the repository's refdb such that it can be discovered by
+ * Git commands. To do so, we:
+ *
+ * - Create an invalid HEAD ref pointing at "refs/heads/.invalid".
+ *
+ * - Create the "refs/" directory.
+ *
+ * - Set up the ref storage format and repository version as
+ * required.
+ *
+ * This is sufficient for Git commands to discover the Git directory.
+ */
+ initialize_repository_version(GIT_HASH_UNKNOWN,
+ the_repository->ref_storage_format, 1);
+
+ strbuf_addf(&buf, "%s/HEAD", git_dir);
+ write_file(buf.buf, "ref: refs/heads/.invalid");
+
+ strbuf_reset(&buf);
+ strbuf_addf(&buf, "%s/refs", git_dir);
+ safe_create_dir(buf.buf, 1);
+
+ /*
* additional config can be injected with -c, make sure it's included
* after init_db, which clears the entire config environment.
*/
@@ -1150,18 +1251,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (option_required_reference.nr || option_optional_reference.nr)
setup_reference();
- if (option_sparse_checkout && git_sparse_checkout_init(dir))
- return 1;
-
- remote = remote_get(remote_name);
+ remote = remote_get_early(remote_name);
refspec_appendf(&remote->fetch, "+%s*:%s*", src_ref_prefix,
branch_top.buf);
- transport = transport_get(remote, remote->url[0]);
- transport_set_verbosity(transport, option_verbosity, option_progress);
- transport->family = family;
-
path = get_repo_path(remote->url[0], &is_bundle);
is_local = option_local != 0 && path && !is_bundle;
if (is_local) {
@@ -1183,6 +1277,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
}
if (option_local > 0 && !is_local)
warning(_("--local is ignored"));
+
+ transport = transport_get(remote, path ? path : remote->url[0]);
+ transport_set_verbosity(transport, option_verbosity, option_progress);
+ transport->family = family;
transport->cloning = 1;
if (is_bundle) {
@@ -1231,7 +1329,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (transport->smart_options && !deepen && !filter_options.choice)
transport->smart_options->check_self_contained_and_connected = 1;
-
strvec_push(&transport_ls_refs_options.ref_prefixes, "HEAD");
refspec_ref_prefixes(&remote->fetch,
&transport_ls_refs_options.ref_prefixes);
@@ -1244,18 +1341,55 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
refs = transport_get_remote_refs(transport, &transport_ls_refs_options);
+ /*
+ * Now that we know what algorithm the remote side is using, let's set
+ * ours to the same thing.
+ */
+ hash_algo = hash_algo_by_ptr(transport_get_hash_algo(transport));
+ initialize_repository_version(hash_algo, the_repository->ref_storage_format, 1);
+ repo_set_hash_algo(the_repository, hash_algo);
+ create_reference_database(the_repository->ref_storage_format, NULL, 1);
+
+ /*
+ * Before fetching from the remote, download and install bundle
+ * data from the --bundle-uri option.
+ */
+ if (bundle_uri) {
+ int has_heuristic = 0;
+
+ /* At this point, we need the_repository to match the cloned repo. */
+ if (repo_init(the_repository, git_dir, work_tree))
+ warning(_("failed to initialize the repo, skipping bundle URI"));
+ else if (fetch_bundle_uri(the_repository, bundle_uri, &has_heuristic))
+ warning(_("failed to fetch objects from bundle URI '%s'"),
+ bundle_uri);
+ else if (has_heuristic)
+ git_config_set_gently("fetch.bundleuri", bundle_uri);
+ } else {
+ /*
+ * Populate transport->got_remote_bundle_uri and
+ * transport->bundle_uri. We might get nothing.
+ */
+ transport_get_remote_bundle_uri(transport);
+
+ if (transport->bundles &&
+ hashmap_get_size(&transport->bundles->bundles)) {
+ /* At this point, we need the_repository to match the cloned repo. */
+ if (repo_init(the_repository, git_dir, work_tree))
+ warning(_("failed to initialize the repo, skipping bundle URI"));
+ else if (fetch_bundle_list(the_repository,
+ transport->bundles))
+ warning(_("failed to fetch advertised bundles"));
+ } else {
+ clear_bundle_list(transport->bundles);
+ FREE_AND_NULL(transport->bundles);
+ }
+ }
+
if (refs)
mapped_refs = wanted_peer_refs(refs, &remote->fetch);
if (mapped_refs) {
- int hash_algo = hash_algo_by_ptr(transport_get_hash_algo(transport));
-
- /*
- * Now that we know what algorithm the remote side is using,
- * let's set ours to the same thing.
- */
- initialize_repository_version(hash_algo, 1);
- repo_set_hash_algo(the_repository, hash_algo);
/*
* transport_get_remote_refs() may return refs with null sha-1
* in mapped_refs (see struct transport->get_refs_list
@@ -1356,19 +1490,23 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
dissociate_from_references();
}
+ if (option_sparse_checkout && git_sparse_checkout_init(dir))
+ return 1;
+
junk_mode = JUNK_LEAVE_REPO;
err = checkout(submodule_progress, filter_submodules);
free(remote_name);
strbuf_release(&reflog_msg);
strbuf_release(&branch_top);
+ strbuf_release(&buf);
strbuf_release(&key);
free_refs(mapped_refs);
free_refs(remote_head_points_at);
free(unborn_head);
free(dir);
free(path);
- UNLEAK(repo);
+ free(repo_to_free);
junk_mode = JUNK_LEAVE_ALL;
transport_ls_refs_options_release(&transport_ls_refs_options);
diff --git a/builtin/column.c b/builtin/column.c
index 158fdf5..10ff7e0 100644
--- a/builtin/column.c
+++ b/builtin/column.c
@@ -1,6 +1,6 @@
#include "builtin.h"
-#include "cache.h"
#include "config.h"
+#include "gettext.h"
#include "strbuf.h"
#include "parse-options.h"
#include "string-list.h"
@@ -12,7 +12,8 @@ static const char * const builtin_column_usage[] = {
};
static unsigned int colopts;
-static int column_config(const char *var, const char *value, void *cb)
+static int column_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED, void *cb)
{
return git_column_config(var, value, cb, &colopts);
}
@@ -44,6 +45,8 @@ int cmd_column(int argc, const char **argv, const char *prefix)
memset(&copts, 0, sizeof(copts));
copts.padding = 1;
argc = parse_options(argc, argv, prefix, options, builtin_column_usage, 0);
+ if (copts.padding < 0)
+ die(_("%s must be non-negative"), "--padding");
if (argc)
usage_with_options(builtin_column_usage, options);
if (real_command || command) {
@@ -55,5 +58,7 @@ int cmd_column(int argc, const char **argv, const char *prefix)
string_list_append(&list, sb.buf);
print_columns(&list, colopts, &copts);
+ strbuf_release(&sb);
+ string_list_clear(&list, 0);
return 0;
}
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c
index 51c4040..7102ee9 100644
--- a/builtin/commit-graph.c
+++ b/builtin/commit-graph.c
@@ -1,22 +1,27 @@
#include "builtin.h"
+#include "commit.h"
#include "config.h"
-#include "dir.h"
-#include "lockfile.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "parse-options.h"
#include "repository.h"
#include "commit-graph.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "progress.h"
+#include "replace-object.h"
+#include "strbuf.h"
#include "tag.h"
+#include "trace2.h"
#define BUILTIN_COMMIT_GRAPH_VERIFY_USAGE \
- N_("git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]")
+ N_("git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]")
#define BUILTIN_COMMIT_GRAPH_WRITE_USAGE \
- N_("git commit-graph write [--object-dir <objdir>] [--append] " \
- "[--split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] " \
- "[--changed-paths] [--[no-]max-new-filters <n>] [--[no-]progress] " \
- "<split options>")
+ N_("git commit-graph write [--object-dir <dir>] [--append]\n" \
+ " [--split[=<strategy>]] [--reachable | --stdin-packs | --stdin-commits]\n" \
+ " [--changed-paths] [--[no-]max-new-filters <n>] [--[no-]progress]\n" \
+ " <split-options>")
static const char * builtin_commit_graph_verify_usage[] = {
BUILTIN_COMMIT_GRAPH_VERIFY_USAGE,
@@ -58,15 +63,18 @@ static struct option *add_common_options(struct option *to)
return parse_options_concat(common_opts, to);
}
-static int graph_verify(int argc, const char **argv)
+static int graph_verify(int argc, const char **argv, const char *prefix)
{
struct commit_graph *graph = NULL;
struct object_directory *odb = NULL;
char *graph_name;
- int open_ok;
+ char *chain_name;
+ enum { OPENED_NONE, OPENED_GRAPH, OPENED_CHAIN } opened = OPENED_NONE;
int fd;
struct stat st;
int flags = 0;
+ int incomplete_chain = 0;
+ int ret;
static struct option builtin_commit_graph_verify_options[] = {
OPT_BOOL(0, "shallow", &opts.shallow,
@@ -80,7 +88,7 @@ static int graph_verify(int argc, const char **argv)
trace2_cmd_mode("verify");
opts.progress = isatty(2);
- argc = parse_options(argc, argv, NULL,
+ argc = parse_options(argc, argv, prefix,
options,
builtin_commit_graph_verify_usage, 0);
if (argc)
@@ -95,24 +103,40 @@ static int graph_verify(int argc, const char **argv)
odb = find_odb(the_repository, opts.obj_dir);
graph_name = get_commit_graph_filename(odb);
- open_ok = open_commit_graph(graph_name, &fd, &st);
- if (!open_ok && errno != ENOENT)
+ chain_name = get_commit_graph_chain_filename(odb);
+ if (open_commit_graph(graph_name, &fd, &st))
+ opened = OPENED_GRAPH;
+ else if (errno != ENOENT)
die_errno(_("Could not open commit-graph '%s'"), graph_name);
+ else if (open_commit_graph_chain(chain_name, &fd, &st))
+ opened = OPENED_CHAIN;
+ else if (errno != ENOENT)
+ die_errno(_("could not open commit-graph chain '%s'"), chain_name);
FREE_AND_NULL(graph_name);
+ FREE_AND_NULL(chain_name);
FREE_AND_NULL(options);
- if (open_ok)
+ if (opened == OPENED_NONE)
+ return 0;
+ else if (opened == OPENED_GRAPH)
graph = load_commit_graph_one_fd_st(the_repository, fd, &st, odb);
else
- graph = read_commit_graph_one(the_repository, odb);
+ graph = load_commit_graph_chain_fd_st(the_repository, fd, &st,
+ &incomplete_chain);
- /* Return failure if open_ok predicted success */
if (!graph)
- return !!open_ok;
+ return 1;
+
+ ret = verify_commit_graph(the_repository, graph, flags);
+ free_commit_graph(graph);
- UNLEAK(graph);
- return verify_commit_graph(the_repository, graph, flags);
+ if (incomplete_chain) {
+ error("one or more commit-graph chain files could not be loaded");
+ ret |= 1;
+ }
+
+ return ret;
}
extern int read_replace_refs;
@@ -179,10 +203,11 @@ static int write_option_max_new_filters(const struct option *opt,
}
static int git_commit_graph_write_config(const char *var, const char *value,
- void *cb)
+ const struct config_context *ctx,
+ void *cb UNUSED)
{
if (!strcmp(var, "commitgraph.maxnewfilters"))
- write_opts.max_new_filters = git_config_int(var, value);
+ write_opts.max_new_filters = git_config_int(var, value, ctx->kvi);
/*
* No need to fall-back to 'git_default_config', since this was already
* called in 'cmd_commit_graph()'.
@@ -190,7 +215,7 @@ static int git_commit_graph_write_config(const char *var, const char *value,
return 0;
}
-static int graph_write(int argc, const char **argv)
+static int graph_write(int argc, const char **argv, const char *prefix)
{
struct string_list pack_indexes = STRING_LIST_INIT_DUP;
struct strbuf buf = STRBUF_INIT;
@@ -241,7 +266,7 @@ static int graph_write(int argc, const char **argv)
git_config(git_commit_graph_write_config, &opts);
- argc = parse_options(argc, argv, NULL,
+ argc = parse_options(argc, argv, prefix,
options,
builtin_commit_graph_write_usage, 0);
if (argc)
@@ -267,8 +292,8 @@ static int graph_write(int argc, const char **argv)
if (opts.reachable) {
if (write_commit_graph_reachable(odb, flags, &write_opts))
- return 1;
- return 0;
+ result = 1;
+ goto cleanup;
}
if (opts.stdin_packs) {
@@ -302,31 +327,28 @@ cleanup:
FREE_AND_NULL(options);
string_list_clear(&pack_indexes, 0);
strbuf_release(&buf);
+ oidset_clear(&commits);
return result;
}
int cmd_commit_graph(int argc, const char **argv, const char *prefix)
{
- struct option *builtin_commit_graph_options = common_opts;
+ parse_opt_subcommand_fn *fn = NULL;
+ struct option builtin_commit_graph_options[] = {
+ OPT_SUBCOMMAND("verify", &fn, graph_verify),
+ OPT_SUBCOMMAND("write", &fn, graph_write),
+ OPT_END(),
+ };
+ struct option *options = parse_options_concat(builtin_commit_graph_options, common_opts);
git_config(git_default_config, NULL);
- argc = parse_options(argc, argv, prefix,
- builtin_commit_graph_options,
- builtin_commit_graph_usage,
- PARSE_OPT_STOP_AT_NON_OPTION);
- if (!argc)
- goto usage;
- read_replace_refs = 0;
+ disable_replace_refs();
save_commit_buffer = 0;
- if (!strcmp(argv[0], "verify"))
- return graph_verify(argc, argv);
- else if (argc && !strcmp(argv[0], "write"))
- return graph_write(argc, argv);
+ argc = parse_options(argc, argv, prefix, options,
+ builtin_commit_graph_usage, 0);
+ FREE_AND_NULL(options);
- error(_("unrecognized subcommand: %s"), argv[0]);
-usage:
- usage_with_options(builtin_commit_graph_usage,
- builtin_commit_graph_options);
+ return fn(argc, argv, prefix);
}
diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c
index 63ea322..1bb7819 100644
--- a/builtin/commit-tree.c
+++ b/builtin/commit-tree.c
@@ -3,20 +3,20 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
-#include "cache.h"
+#include "builtin.h"
#include "config.h"
-#include "object-store.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "repository.h"
#include "commit.h"
-#include "tree.h"
-#include "builtin.h"
-#include "utf8.h"
-#include "gpg-interface.h"
#include "parse-options.h"
static const char * const commit_tree_usage[] = {
- N_("git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...] "
- "[(-F <file>)...] <tree>"),
+ N_("git commit-tree <tree> [(-p <parent>)...]"),
+ N_("git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]\n"
+ " [(-F <file>)...] <tree>"),
NULL
};
@@ -36,14 +36,6 @@ static void new_parent(struct commit *parent, struct commit_list **parents_p)
commit_list_insert(parent, parents_p);
}
-static int commit_tree_config(const char *var, const char *value, void *cb)
-{
- int status = git_gpg_config(var, value, NULL);
- if (status)
- return status;
- return git_default_config(var, value, cb);
-}
-
static int parse_parent_arg_callback(const struct option *opt,
const char *arg, int unset)
{
@@ -52,7 +44,7 @@ static int parse_parent_arg_callback(const struct option *opt,
BUG_ON_OPT_NEG_NOARG(unset, arg);
- if (get_oid_commit(arg, &oid))
+ if (repo_get_oid_commit(the_repository, arg, &oid))
die(_("not a valid object name %s"), arg);
assert_oid_type(&oid, OBJ_COMMIT);
@@ -120,7 +112,7 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
OPT_END()
};
- git_config(commit_tree_config, NULL);
+ git_config(git_default_config, NULL);
if (argc < 2 || !strcmp(argv[1], "-h"))
usage_with_options(commit_tree_usage, options);
@@ -130,7 +122,7 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
if (argc != 1)
die(_("must give exactly one tree"));
- if (get_oid_tree(argv[0], &tree_oid))
+ if (repo_get_oid_tree(the_repository, argv[0], &tree_oid))
die(_("not a valid object name %s"), argv[0]);
if (!buffer.len) {
diff --git a/builtin/commit.c b/builtin/commit.c
index fcf9c85..6e14844 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -5,34 +5,34 @@
* Based on git-commit.sh by Junio C Hamano and Linus Torvalds
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
+#define USE_THE_INDEX_VARIABLE
+#include "builtin.h"
+#include "advice.h"
#include "config.h"
#include "lockfile.h"
#include "cache-tree.h"
#include "color.h"
#include "dir.h"
-#include "builtin.h"
+#include "editor.h"
+#include "environment.h"
#include "diff.h"
-#include "diffcore.h"
#include "commit.h"
+#include "gettext.h"
#include "revision.h"
#include "wt-status.h"
#include "run-command.h"
-#include "hook.h"
-#include "refs.h"
-#include "log-tree.h"
#include "strbuf.h"
-#include "utf8.h"
+#include "object-name.h"
#include "parse-options.h"
+#include "path.h"
+#include "preload-index.h"
+#include "read-cache.h"
#include "string-list.h"
#include "rerere.h"
#include "unpack-trees.h"
-#include "quote.h"
-#include "submodule.h"
-#include "gpg-interface.h"
#include "column.h"
#include "sequencer.h"
+#include "sparse-index.h"
#include "mailmap.h"
#include "help.h"
#include "commit-reach.h"
@@ -40,12 +40,19 @@
#include "pretty.h"
static const char * const builtin_commit_usage[] = {
- N_("git commit [<options>] [--] <pathspec>..."),
+ 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"
+ " [--date=<date>] [--cleanup=<mode>] [--[no-]status]\n"
+ " [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+ " [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n"
+ " [--] [<pathspec>...]"),
NULL
};
static const char * const builtin_status_usage[] = {
- N_("git status [<options>] [--] <pathspec>..."),
+ N_("git status [<options>] [--] [<pathspec>...]"),
NULL
};
@@ -139,7 +146,7 @@ static int opt_pass_trailer(const struct option *opt, const char *arg, int unset
{
BUG_ON_OPT_NEG(unset);
- strvec_pushl(&trailer_args, "--trailer", arg, NULL);
+ strvec_pushl(opt->value, "--trailer", arg, NULL);
return 0;
}
@@ -265,8 +272,8 @@ static int list_paths(struct string_list *list, const char *with_tree,
/* TODO: audit for interaction with sparse-index. */
ensure_full_index(&the_index);
- for (i = 0; i < active_nr; i++) {
- const struct cache_entry *ce = active_cache[i];
+ for (i = 0; i < the_index.cache_nr; i++) {
+ const struct cache_entry *ce = the_index.cache[i];
struct string_list_item *item;
if (ce->ce_flags & CE_UPDATE)
@@ -295,10 +302,10 @@ static void add_remove_files(struct string_list *list)
continue;
if (!lstat(p->string, &st)) {
- if (add_to_cache(p->string, &st, 0))
+ if (add_to_index(&the_index, p->string, &st, 0))
die(_("updating files failed"));
} else
- remove_file_from_cache(p->string);
+ remove_file_from_index(&the_index, p->string);
}
}
@@ -309,7 +316,7 @@ static void create_base_index(const struct commit *current_head)
struct tree_desc t;
if (!current_head) {
- discard_cache();
+ discard_index(&the_index);
return;
}
@@ -324,8 +331,9 @@ static void create_base_index(const struct commit *current_head)
tree = parse_tree_indirect(&current_head->object.oid);
if (!tree)
die(_("failed to unpack HEAD tree object"));
- parse_tree(tree);
- init_tree_desc(&t, tree->buffer, tree->size);
+ if (parse_tree(tree) < 0)
+ exit(128);
+ init_tree_desc(&t, &tree->object.oid, tree->buffer, tree->size);
if (unpack_trees(1, &t, &opts))
exit(128); /* We've already reported the error, finish dying */
}
@@ -336,7 +344,7 @@ static void refresh_cache_or_die(int refresh_flags)
* refresh_flags contains REFRESH_QUIET, so the only errors
* are for unmerged entries.
*/
- if (refresh_cache(refresh_flags | REFRESH_IN_PORCELAIN))
+ if (refresh_index(&the_index, refresh_flags | REFRESH_IN_PORCELAIN, NULL, NULL, NULL))
die_resolve_conflict("commit");
}
@@ -375,12 +383,13 @@ static const char *prepare_index(const char **argv, const char *prefix,
(!amend || (fixup_message && strcmp(fixup_prefix, "amend"))))))
die(_("No paths with --include/--only does not make sense."));
- if (read_cache_preload(&pathspec) < 0)
+ if (repo_read_index_preload(the_repository, &pathspec, 0) < 0)
die(_("index file corrupt"));
if (interactive) {
char *old_index_env = NULL, *old_repo_index_file;
- hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
+ repo_hold_locked_index(the_repository, &index_lock,
+ LOCK_DIE_ON_ERROR);
refresh_cache_or_die(refresh_flags);
@@ -403,9 +412,10 @@ static const char *prepare_index(const char **argv, const char *prefix,
unsetenv(INDEX_ENVIRONMENT);
FREE_AND_NULL(old_index_env);
- discard_cache();
- read_cache_from(get_lock_file_path(&index_lock));
- if (update_main_cache_tree(WRITE_TREE_SILENT) == 0) {
+ discard_index(&the_index);
+ read_index_from(&the_index, get_lock_file_path(&index_lock),
+ get_git_dir());
+ if (cache_tree_update(&the_index, WRITE_TREE_SILENT) == 0) {
if (reopen_lock_file(&index_lock) < 0)
die(_("unable to write index file"));
if (write_locked_index(&the_index, &index_lock, 0))
@@ -431,14 +441,21 @@ static const char *prepare_index(const char **argv, const char *prefix,
* (B) on failure, rollback the real index.
*/
if (all || (also && pathspec.nr)) {
- hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
- add_files_to_cache(also ? prefix : NULL, &pathspec, 0);
+ char *ps_matched = xcalloc(pathspec.nr, 1);
+ repo_hold_locked_index(the_repository, &index_lock,
+ LOCK_DIE_ON_ERROR);
+ add_files_to_cache(the_repository, also ? prefix : NULL,
+ &pathspec, ps_matched, 0, 0);
+ if (!all && report_path_error(ps_matched, &pathspec))
+ exit(128);
+
refresh_cache_or_die(refresh_flags);
- update_main_cache_tree(WRITE_TREE_SILENT);
+ cache_tree_update(&the_index, WRITE_TREE_SILENT);
if (write_locked_index(&the_index, &index_lock, 0))
- die(_("unable to write new_index file"));
+ die(_("unable to write new index file"));
commit_style = COMMIT_NORMAL;
ret = get_lock_file_path(&index_lock);
+ free(ps_matched);
goto out;
}
@@ -452,14 +469,15 @@ static const char *prepare_index(const char **argv, const char *prefix,
* We still need to refresh the index here.
*/
if (!only && !pathspec.nr) {
- hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
+ repo_hold_locked_index(the_repository, &index_lock,
+ LOCK_DIE_ON_ERROR);
refresh_cache_or_die(refresh_flags);
- if (active_cache_changed
- || !cache_tree_fully_valid(active_cache_tree))
- update_main_cache_tree(WRITE_TREE_SILENT);
+ if (the_index.cache_changed
+ || !cache_tree_fully_valid(the_index.cache_tree))
+ cache_tree_update(&the_index, WRITE_TREE_SILENT);
if (write_locked_index(&the_index, &index_lock,
COMMIT_LOCK | SKIP_IF_UNCHANGED))
- die(_("unable to write new_index file"));
+ die(_("unable to write new index file"));
commit_style = COMMIT_AS_IS;
ret = get_index_file();
goto out;
@@ -498,16 +516,16 @@ static const char *prepare_index(const char **argv, const char *prefix,
if (list_paths(&partial, !current_head ? NULL : "HEAD", &pathspec))
exit(1);
- discard_cache();
- if (read_cache() < 0)
+ discard_index(&the_index);
+ if (repo_read_index(the_repository) < 0)
die(_("cannot read the index"));
- hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
+ repo_hold_locked_index(the_repository, &index_lock, LOCK_DIE_ON_ERROR);
add_remove_files(&partial);
- refresh_cache(REFRESH_QUIET);
- update_main_cache_tree(WRITE_TREE_SILENT);
+ refresh_index(&the_index, REFRESH_QUIET, NULL, NULL, NULL);
+ cache_tree_update(&the_index, WRITE_TREE_SILENT);
if (write_locked_index(&the_index, &index_lock, 0))
- die(_("unable to write new_index file"));
+ die(_("unable to write new index file"));
hold_lock_file_for_update(&false_lock,
git_path("next-index-%"PRIuMAX,
@@ -516,14 +534,14 @@ static const char *prepare_index(const char **argv, const char *prefix,
create_base_index(current_head);
add_remove_files(&partial);
- refresh_cache(REFRESH_QUIET);
+ refresh_index(&the_index, REFRESH_QUIET, NULL, NULL, NULL);
if (write_locked_index(&the_index, &false_lock, 0))
die(_("unable to write temporary index file"));
- discard_cache();
+ discard_index(&the_index);
ret = get_lock_file_path(&false_lock);
- read_cache_from(ret);
+ read_index_from(&the_index, ret, get_git_dir());
out:
string_list_clear(&partial, 0);
clear_pathspec(&pathspec);
@@ -546,7 +564,7 @@ static int run_status(FILE *fp, const char *index_file, const char *prefix, int
s->index_file = index_file;
s->fp = fp;
s->nowarn = nowarn;
- s->is_initial = get_oid(s->reference, &oid) ? 1 : 0;
+ s->is_initial = repo_get_oid(the_repository, s->reference, &oid) ? 1 : 0;
if (!s->is_initial)
oidcpy(&s->oid_commit, &oid);
s->status_format = status_format;
@@ -672,9 +690,10 @@ static void adjust_comment_line_char(const struct strbuf *sb)
char *candidate;
const char *p;
- comment_line_char = candidates[0];
- if (!memchr(sb->buf, comment_line_char, sb->len))
+ if (!memchr(sb->buf, candidates[0], sb->len)) {
+ comment_line_str = xstrfmt("%c", candidates[0]);
return;
+ }
p = sb->buf;
candidate = strchr(candidates, *p);
@@ -693,7 +712,7 @@ static void adjust_comment_line_char(const struct strbuf *sb)
if (!*p)
die(_("unable to select a comment character that is not used\n"
"in the current commit message"));
- comment_line_char = *p;
+ comment_line_str = xstrfmt("%c", *p);
}
static void prepare_amend_commit(struct commit *commit, struct strbuf *sb,
@@ -701,15 +720,15 @@ static void prepare_amend_commit(struct commit *commit, struct strbuf *sb,
{
const char *buffer, *subject, *fmt;
- buffer = get_commit_buffer(commit, NULL);
+ buffer = repo_get_commit_buffer(the_repository, commit, NULL);
find_commit_subject(buffer, &subject);
/*
* If we amend the 'amend!' commit then we don't want to
* duplicate the subject line.
*/
fmt = starts_with(subject, "amend!") ? "%b" : "%B";
- format_commit_message(commit, fmt, sb, ctx);
- unuse_commit_buffer(commit, buffer);
+ repo_format_commit_message(the_repository, commit, fmt, sb, ctx);
+ repo_unuse_commit_buffer(the_repository, commit, buffer);
}
static int prepare_to_commit(const char *index_file, const char *prefix,
@@ -725,7 +744,6 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
const char *hook_arg2 = NULL;
int clean_message_contents = (cleanup_mode != COMMIT_MSG_CLEANUP_NONE);
int old_display_comment_prefix;
- int merge_contains_scissors = 0;
int invoked_hook;
/* This checks and barfs if author is badly specified */
@@ -747,10 +765,11 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
struct commit *c;
c = lookup_commit_reference_by_name(squash_message);
if (!c)
- die(_("could not lookup commit %s"), squash_message);
+ die(_("could not lookup commit '%s'"), squash_message);
ctx.output_encoding = get_commit_output_encoding();
- format_commit_message(c, "squash! %s\n\n", &sb,
- &ctx);
+ repo_format_commit_message(the_repository, c,
+ "squash! %s\n\n", &sb,
+ &ctx);
}
}
@@ -781,10 +800,11 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
char *fmt;
commit = lookup_commit_reference_by_name(fixup_commit);
if (!commit)
- die(_("could not lookup commit %s"), fixup_commit);
+ die(_("could not lookup commit '%s'"), fixup_commit);
ctx.output_encoding = get_commit_output_encoding();
fmt = xstrfmt("%s! %%s\n\n", fixup_prefix);
- format_commit_message(commit, fmt, &sb, &ctx);
+ repo_format_commit_message(the_repository, commit, fmt, &sb,
+ &ctx);
free(fmt);
hook_arg1 = "message";
@@ -827,7 +847,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
wt_status_locate_end(sb.buf + merge_msg_start,
sb.len - merge_msg_start) <
sb.len - merge_msg_start)
- merge_contains_scissors = 1;
+ s->added_cut_line = 1;
} else if (!stat(git_path_squash_msg(the_repository), &statbuf)) {
if (strbuf_read_file(&sb, git_path_squash_msg(the_repository), 0) < 0)
die_errno(_("could not read SQUASH_MSG"));
@@ -875,10 +895,10 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
s->hints = 0;
if (clean_message_contents)
- strbuf_stripspace(&sb, 0);
+ strbuf_stripspace(&sb, NULL);
if (signoff)
- append_signoff(&sb, ignore_non_trailer(sb.buf, sb.len), 0);
+ append_signoff(&sb, ignored_log_message_bytes(sb.buf, sb.len), 0);
if (fwrite(sb.buf, 1, sb.len, s->fp) < sb.len)
die_errno(_("could not write commit template"));
@@ -895,24 +915,23 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
struct ident_split ci, ai;
const char *hint_cleanup_all = allow_empty_message ?
_("Please enter the commit message for your changes."
- " Lines starting\nwith '%c' will be ignored.\n") :
+ " Lines starting\nwith '%s' will be ignored.\n") :
_("Please enter the commit message for your changes."
- " Lines starting\nwith '%c' will be ignored, and an empty"
+ " Lines starting\nwith '%s' will be ignored, and an empty"
" message aborts the commit.\n");
const char *hint_cleanup_space = allow_empty_message ?
_("Please enter the commit message for your changes."
" Lines starting\n"
- "with '%c' will be kept; you may remove them"
+ "with '%s' will be kept; you may remove them"
" yourself if you want to.\n") :
_("Please enter the commit message for your changes."
" Lines starting\n"
- "with '%c' will be kept; you may remove them"
+ "with '%s' will be kept; you may remove them"
" yourself if you want to.\n"
"An empty message aborts the commit.\n");
if (whence != FROM_COMMIT) {
- if (cleanup_mode == COMMIT_MSG_CLEANUP_SCISSORS &&
- !merge_contains_scissors)
- wt_status_add_cut_line(s->fp);
+ if (cleanup_mode == COMMIT_MSG_CLEANUP_SCISSORS)
+ wt_status_add_cut_line(s);
status_printf_ln(
s, GIT_COLOR_NORMAL,
whence == FROM_MERGE ?
@@ -930,12 +949,12 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
fprintf(s->fp, "\n");
if (cleanup_mode == COMMIT_MSG_CLEANUP_ALL)
- status_printf(s, GIT_COLOR_NORMAL, hint_cleanup_all, comment_line_char);
+ status_printf(s, GIT_COLOR_NORMAL, hint_cleanup_all, comment_line_str);
else if (cleanup_mode == COMMIT_MSG_CLEANUP_SCISSORS) {
- if (whence == FROM_COMMIT && !merge_contains_scissors)
- wt_status_add_cut_line(s->fp);
+ if (whence == FROM_COMMIT)
+ wt_status_add_cut_line(s);
} else /* COMMIT_MSG_CLEANUP_SPACE, that is. */
- status_printf(s, GIT_COLOR_NORMAL, hint_cleanup_space, comment_line_char);
+ status_printf(s, GIT_COLOR_NORMAL, hint_cleanup_space, comment_line_str);
/*
* These should never fail because they come from our own
@@ -980,21 +999,21 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
struct object_id oid;
const char *parent = "HEAD";
- if (!active_nr && read_cache() < 0)
+ if (!the_index.initialized && repo_read_index(the_repository) < 0)
die(_("Cannot read index"));
if (amend)
parent = "HEAD^1";
- if (get_oid(parent, &oid)) {
+ if (repo_get_oid(the_repository, parent, &oid)) {
int i, ita_nr = 0;
/* TODO: audit for interaction with sparse-index. */
ensure_full_index(&the_index);
- for (i = 0; i < active_nr; i++)
- if (ce_intent_to_add(active_cache[i]))
+ for (i = 0; i < the_index.cache_nr; i++)
+ if (ce_intent_to_add(the_index.cache[i]))
ita_nr++;
- committable = active_nr - ita_nr > 0;
+ committable = the_index.cache_nr - ita_nr > 0;
} else {
/*
* Unless the user did explicitly request a submodule
@@ -1022,7 +1041,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
struct child_process run_trailer = CHILD_PROCESS_INIT;
strvec_pushl(&run_trailer.args, "interpret-trailers",
- "--in-place", git_path_commit_editmsg(), NULL);
+ "--in-place", "--no-divider",
+ git_path_commit_editmsg(), NULL);
strvec_pushv(&run_trailer.args, trailer_args.v);
run_trailer.git_cmd = 1;
if (run_command(&run_trailer))
@@ -1061,11 +1081,11 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
* and could have updated it. We must do this before we invoke
* the editor and after we invoke run_status above.
*/
- discard_cache();
+ discard_index(&the_index);
}
- read_cache_from(index_file);
+ read_index_from(&the_index, index_file, get_git_dir());
- if (update_main_cache_tree(0)) {
+ if (cache_tree_update(&the_index, 0)) {
error(_("Error building trees"));
return 0;
}
@@ -1121,7 +1141,8 @@ static const char *find_author_by_nickname(const char *name)
struct pretty_print_context ctx = {0};
ctx.date_mode.type = DATE_NORMAL;
strbuf_release(&buf);
- format_commit_message(commit, "%aN <%aE>", &buf, &ctx);
+ repo_format_commit_message(the_repository, commit,
+ "%aN <%aE>", &buf, &ctx);
release_revisions(&revs);
return strbuf_detach(&buf, NULL);
}
@@ -1142,22 +1163,45 @@ static void handle_ignored_arg(struct wt_status *s)
die(_("Invalid ignored mode '%s'"), ignored_arg);
}
-static void handle_untracked_files_arg(struct wt_status *s)
+static enum untracked_status_type parse_untracked_setting_name(const char *u)
{
- if (!untracked_files_arg)
- ; /* default already initialized */
- else if (!strcmp(untracked_files_arg, "no"))
- s->show_untracked_files = SHOW_NO_UNTRACKED_FILES;
- else if (!strcmp(untracked_files_arg, "normal"))
- s->show_untracked_files = SHOW_NORMAL_UNTRACKED_FILES;
- else if (!strcmp(untracked_files_arg, "all"))
- s->show_untracked_files = SHOW_ALL_UNTRACKED_FILES;
/*
* Please update $__git_untracked_file_modes in
* git-completion.bash when you add new options
*/
+ switch (git_parse_maybe_bool(u)) {
+ case 0:
+ u = "no";
+ break;
+ case 1:
+ u = "normal";
+ break;
+ default:
+ break;
+ }
+
+ if (!strcmp(u, "no"))
+ return SHOW_NO_UNTRACKED_FILES;
+ else if (!strcmp(u, "normal"))
+ return SHOW_NORMAL_UNTRACKED_FILES;
+ else if (!strcmp(u, "all"))
+ return SHOW_ALL_UNTRACKED_FILES;
else
- die(_("Invalid untracked files mode '%s'"), untracked_files_arg);
+ return SHOW_UNTRACKED_FILES_ERROR;
+}
+
+static void handle_untracked_files_arg(struct wt_status *s)
+{
+ enum untracked_status_type u;
+
+ if (!untracked_files_arg)
+ return; /* default already initialized */
+
+ u = parse_untracked_setting_name(untracked_files_arg);
+ if (u == SHOW_UNTRACKED_FILES_ERROR)
+ die(_("Invalid untracked files mode '%s'"),
+ untracked_files_arg);
+ s->show_untracked_files = u;
}
static const char *read_commit_message(const char *name)
@@ -1167,9 +1211,9 @@ static const char *read_commit_message(const char *name)
commit = lookup_commit_reference_by_name(name);
if (!commit)
- die(_("could not lookup commit %s"), name);
+ die(_("could not lookup commit '%s'"), name);
out_enc = get_commit_output_encoding();
- return logmsg_reencode(commit, NULL, out_enc);
+ return repo_logmsg_reencode(the_repository, commit, NULL, out_enc);
}
/*
@@ -1383,7 +1427,8 @@ static int parse_status_slot(const char *slot)
return LOOKUP_CONFIG(color_status_slots, slot);
}
-static int git_status_config(const char *k, const char *v, void *cb)
+static int git_status_config(const char *k, const char *v,
+ const struct config_context *ctx, void *cb)
{
struct wt_status *s = cb;
const char *slot_name;
@@ -1392,7 +1437,8 @@ static int git_status_config(const char *k, const char *v, void *cb)
return git_column_config(k, v, "status", &s->colopts);
if (!strcmp(k, "status.submodulesummary")) {
int is_bool;
- s->submodule_summary = git_config_bool_or_int(k, v, &is_bool);
+ s->submodule_summary = git_config_bool_or_int(k, v, ctx->kvi,
+ &is_bool);
if (is_bool && s->submodule_summary)
s->submodule_summary = -1;
return 0;
@@ -1438,25 +1484,21 @@ static int git_status_config(const char *k, const char *v, void *cb)
return 0;
}
if (!strcmp(k, "status.showuntrackedfiles")) {
- if (!v)
- return config_error_nonbool(k);
- else if (!strcmp(v, "no"))
- s->show_untracked_files = SHOW_NO_UNTRACKED_FILES;
- else if (!strcmp(v, "normal"))
- s->show_untracked_files = SHOW_NORMAL_UNTRACKED_FILES;
- else if (!strcmp(v, "all"))
- s->show_untracked_files = SHOW_ALL_UNTRACKED_FILES;
- else
+ enum untracked_status_type u;
+
+ u = parse_untracked_setting_name(v);
+ if (u == SHOW_UNTRACKED_FILES_ERROR)
return error(_("Invalid untracked files mode '%s'"), v);
+ s->show_untracked_files = u;
return 0;
}
if (!strcmp(k, "diff.renamelimit")) {
if (s->rename_limit == -1)
- s->rename_limit = git_config_int(k, v);
+ s->rename_limit = git_config_int(k, v, ctx->kvi);
return 0;
}
if (!strcmp(k, "status.renamelimit")) {
- s->rename_limit = git_config_int(k, v);
+ s->rename_limit = git_config_int(k, v, ctx->kvi);
return 0;
}
if (!strcmp(k, "diff.renames")) {
@@ -1468,7 +1510,7 @@ static int git_status_config(const char *k, const char *v, void *cb)
s->detect_rename = git_config_rename(k, v);
return 0;
}
- return git_diff_ui_config(k, v, NULL);
+ return git_diff_ui_config(k, v, ctx, NULL);
}
int cmd_status(int argc, const char **argv, const char *prefix)
@@ -1549,11 +1591,11 @@ int cmd_status(int argc, const char **argv, const char *prefix)
&s.pathspec, NULL, NULL);
if (use_optional_locks())
- fd = hold_locked_index(&index_lock, 0);
+ fd = repo_hold_locked_index(the_repository, &index_lock, 0);
else
fd = -1;
- s.is_initial = get_oid(s.reference, &oid) ? 1 : 0;
+ s.is_initial = repo_get_oid(the_repository, s.reference, &oid) ? 1 : 0;
if (!s.is_initial)
oidcpy(&s.oid_commit, &oid);
@@ -1583,10 +1625,10 @@ int cmd_status(int argc, const char **argv, const char *prefix)
return 0;
}
-static int git_commit_config(const char *k, const char *v, void *cb)
+static int git_commit_config(const char *k, const char *v,
+ const struct config_context *ctx, void *cb)
{
struct wt_status *s = cb;
- int status;
if (!strcmp(k, "commit.template"))
return git_config_pathname(&template_file, k, v);
@@ -1602,14 +1644,12 @@ static int git_commit_config(const char *k, const char *v, void *cb)
}
if (!strcmp(k, "commit.verbose")) {
int is_bool;
- config_commit_verbose = git_config_bool_or_int(k, v, &is_bool);
+ config_commit_verbose = git_config_bool_or_int(k, v, ctx->kvi,
+ &is_bool);
return 0;
}
- status = git_gpg_config(k, v, NULL);
- if (status)
- return status;
- return git_status_config(k, v, s);
+ return git_status_config(k, v, ctx, s);
}
int cmd_commit(int argc, const char **argv, const char *prefix)
@@ -1633,7 +1673,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
OPT_STRING(0, "fixup", &fixup_message, N_("[(amend|reword):]commit"), N_("use autosquash formatted message to fixup or amend/reword specified commit")),
OPT_STRING(0, "squash", &squash_message, N_("commit"), N_("use autosquash formatted message to squash specified commit")),
OPT_BOOL(0, "reset-author", &renew_authorship, N_("the commit is authored by me now (used with -C/-c/--amend)")),
- OPT_CALLBACK_F(0, "trailer", NULL, N_("trailer"), N_("add custom trailer(s)"), PARSE_OPT_NONEG, opt_pass_trailer),
+ OPT_CALLBACK_F(0, "trailer", &trailer_args, N_("trailer"), N_("add custom trailer(s)"), PARSE_OPT_NONEG, opt_pass_trailer),
OPT_BOOL('s', "signoff", &signoff, N_("add a Signed-off-by trailer")),
OPT_FILENAME('t', "template", &template_file, N_("use specified template file")),
OPT_BOOL('e', "edit", &edit_flag, N_("force edit of commit")),
@@ -1700,11 +1740,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
status_format = STATUS_FORMAT_NONE; /* Ignore status.short */
s.colopts = 0;
- if (get_oid("HEAD", &oid))
+ if (repo_get_oid(the_repository, "HEAD", &oid))
current_head = NULL;
else {
current_head = lookup_commit_or_die(&oid, "HEAD");
- if (parse_commit(current_head))
+ if (repo_parse_commit(the_repository, current_head))
die(_("could not parse HEAD commit"));
}
verbose = -1; /* unspecified */
@@ -1816,7 +1856,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
append_merge_tag_headers(parents, &tail);
}
- if (commit_tree_extended(sb.buf, sb.len, &active_cache_tree->oid,
+ if (commit_tree_extended(sb.buf, sb.len, &the_index.cache_tree->oid,
parents, &oid, author_ident.buf, NULL,
sign_commit, extra)) {
rollback_index_files();
@@ -1838,7 +1878,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
if (commit_index_files())
die(_("repository has been updated, but unable to write\n"
- "new_index file. Check that disk is not full and quota is\n"
+ "new index file. Check that disk is not full and quota is\n"
"not exceeded, and then \"git restore --staged :/\" to recover."));
git_test_write_commit_graph_or_die();
@@ -1861,11 +1901,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
&oid, flags);
}
- apply_autostash(git_path_merge_autostash(the_repository));
+ apply_autostash_ref(the_repository, "MERGE_AUTOSTASH");
cleanup:
- UNLEAK(author_ident);
- UNLEAK(err);
- UNLEAK(sb);
+ strbuf_release(&author_ident);
+ strbuf_release(&err);
+ strbuf_release(&sb);
return ret;
}
diff --git a/builtin/config.c b/builtin/config.c
index e7b88a9..0015620 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -1,10 +1,18 @@
#include "builtin.h"
-#include "cache.h"
+#include "abspath.h"
#include "config.h"
#include "color.h"
+#include "editor.h"
+#include "environment.h"
+#include "repository.h"
+#include "gettext.h"
+#include "ident.h"
#include "parse-options.h"
#include "urlmatch.h"
+#include "path.h"
#include "quote.h"
+#include "setup.h"
+#include "strbuf.h"
#include "worktree.h"
static const char *const builtin_config_usage[] = {
@@ -36,6 +44,7 @@ static struct config_options config_options;
static int show_origin;
static int show_scope;
static int fixed_value;
+static const char *comment;
#define ACTION_GET (1<<0)
#define ACTION_GET_ALL (1<<1)
@@ -165,6 +174,7 @@ static struct option builtin_config_options[] = {
OPT_BOOL(0, "show-origin", &show_origin, N_("show origin of config (file, standard input, blob, command line)")),
OPT_BOOL(0, "show-scope", &show_scope, N_("show scope of config (worktree, local, global, system, command)")),
OPT_STRING(0, "default", &default_value, N_("value"), N_("with --get, use default value when missing entry")),
+ OPT_STRING(0, "comment", &comment, N_("value"), N_("human-readable comment string (# will be prepended as needed)")),
OPT_END(),
};
@@ -185,36 +195,42 @@ static void check_argc(int argc, int min, int max)
usage_builtin_config();
}
-static void show_config_origin(struct strbuf *buf)
+static void show_config_origin(const struct key_value_info *kvi,
+ struct strbuf *buf)
{
const char term = end_nul ? '\0' : '\t';
- strbuf_addstr(buf, current_config_origin_type());
+ strbuf_addstr(buf, config_origin_type_name(kvi->origin_type));
strbuf_addch(buf, ':');
if (end_nul)
- strbuf_addstr(buf, current_config_name());
+ strbuf_addstr(buf, kvi->filename ? kvi->filename : "");
else
- quote_c_style(current_config_name(), buf, NULL, 0);
+ quote_c_style(kvi->filename ? kvi->filename : "", buf, NULL, 0);
strbuf_addch(buf, term);
}
-static void show_config_scope(struct strbuf *buf)
+static void show_config_scope(const struct key_value_info *kvi,
+ struct strbuf *buf)
{
const char term = end_nul ? '\0' : '\t';
- const char *scope = config_scope_name(current_config_scope());
+ const char *scope = config_scope_name(kvi->scope);
strbuf_addstr(buf, N_(scope));
strbuf_addch(buf, term);
}
-static int show_all_config(const char *key_, const char *value_, void *cb)
+static int show_all_config(const char *key_, const char *value_,
+ const struct config_context *ctx,
+ void *cb UNUSED)
{
+ const struct key_value_info *kvi = ctx->kvi;
+
if (show_origin || show_scope) {
struct strbuf buf = STRBUF_INIT;
if (show_scope)
- show_config_scope(&buf);
+ show_config_scope(kvi, &buf);
if (show_origin)
- show_config_origin(&buf);
+ show_config_origin(kvi, &buf);
/* Use fwrite as "buf" can contain \0's if "end_null" is set. */
fwrite(buf.buf, 1, buf.len, stdout);
strbuf_release(&buf);
@@ -232,12 +248,13 @@ struct strbuf_list {
int alloc;
};
-static int format_config(struct strbuf *buf, const char *key_, const char *value_)
+static int format_config(struct strbuf *buf, const char *key_,
+ const char *value_, const struct key_value_info *kvi)
{
if (show_scope)
- show_config_scope(buf);
+ show_config_scope(kvi, buf);
if (show_origin)
- show_config_origin(buf);
+ show_config_origin(kvi, buf);
if (show_keys)
strbuf_addstr(buf, key_);
if (!omit_values) {
@@ -246,13 +263,14 @@ static int format_config(struct strbuf *buf, const char *key_, const char *value
if (type == TYPE_INT)
strbuf_addf(buf, "%"PRId64,
- git_config_int64(key_, value_ ? value_ : ""));
+ git_config_int64(key_, value_ ? value_ : "", kvi));
else if (type == TYPE_BOOL)
strbuf_addstr(buf, git_config_bool(key_, value_) ?
"true" : "false");
else if (type == TYPE_BOOL_OR_INT) {
int is_bool, v;
- v = git_config_bool_or_int(key_, value_, &is_bool);
+ v = git_config_bool_or_int(key_, value_, kvi,
+ &is_bool);
if (is_bool)
strbuf_addstr(buf, v ? "true" : "false");
else
@@ -291,9 +309,11 @@ static int format_config(struct strbuf *buf, const char *key_, const char *value
return 0;
}
-static int collect_config(const char *key_, const char *value_, void *cb)
+static int collect_config(const char *key_, const char *value_,
+ const struct config_context *ctx, void *cb)
{
struct strbuf_list *values = cb;
+ const struct key_value_info *kvi = ctx->kvi;
if (!use_key_regexp && strcmp(key_, key))
return 0;
@@ -308,7 +328,7 @@ static int collect_config(const char *key_, const char *value_, void *cb)
ALLOC_GROW(values->items, values->nr + 1, values->alloc);
strbuf_init(&values->items[values->nr], 0);
- return format_config(&values->items[values->nr++], key_, value_);
+ return format_config(&values->items[values->nr++], key_, value_, kvi);
}
static int get_value(const char *key_, const char *regex_, unsigned flags)
@@ -366,14 +386,18 @@ static int get_value(const char *key_, const char *regex_, unsigned flags)
}
config_with_options(collect_config, &values,
- &given_config_source, &config_options);
+ &given_config_source, the_repository,
+ &config_options);
if (!values.nr && default_value) {
+ struct key_value_info kvi = KVI_INIT;
struct strbuf *item;
+
+ kvi_from_param(&kvi);
ALLOC_GROW(values.items, values.nr + 1, values.alloc);
item = &values.items[values.nr++];
strbuf_init(item, 0);
- if (format_config(item, key_, default_value) < 0)
+ if (format_config(item, key_, default_value, &kvi) < 0)
die(_("failed to format default config value: %s"),
default_value);
}
@@ -402,7 +426,8 @@ free_strings:
return ret;
}
-static char *normalize_value(const char *key, const char *value)
+static char *normalize_value(const char *key, const char *value,
+ struct key_value_info *kvi)
{
if (!value)
return NULL;
@@ -417,12 +442,12 @@ static char *normalize_value(const char *key, const char *value)
*/
return xstrdup(value);
if (type == TYPE_INT)
- return xstrfmt("%"PRId64, git_config_int64(key, value));
+ return xstrfmt("%"PRId64, git_config_int64(key, value, kvi));
if (type == TYPE_BOOL)
return xstrdup(git_config_bool(key, value) ? "true" : "false");
if (type == TYPE_BOOL_OR_INT) {
int is_bool, v;
- v = git_config_bool_or_int(key, value, &is_bool);
+ v = git_config_bool_or_int(key, value, kvi, &is_bool);
if (!is_bool)
return xstrfmt("%d", v);
else
@@ -458,7 +483,9 @@ static const char *get_color_slot;
static const char *get_colorbool_slot;
static char parsed_color[COLOR_MAXLEN];
-static int git_get_color_config(const char *var, const char *value, void *cb)
+static int git_get_color_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *cb UNUSED)
{
if (!strcmp(var, get_color_slot)) {
if (!value)
@@ -476,7 +503,8 @@ static void get_color(const char *var, const char *def_color)
get_color_found = 0;
parsed_color[0] = '\0';
config_with_options(git_get_color_config, NULL,
- &given_config_source, &config_options);
+ &given_config_source, the_repository,
+ &config_options);
if (!get_color_found && def_color) {
if (color_parse(def_color, parsed_color) < 0)
@@ -490,7 +518,8 @@ static int get_colorbool_found;
static int get_diff_color_found;
static int get_color_ui_found;
static int git_get_colorbool_config(const char *var, const char *value,
- void *cb)
+ const struct config_context *ctx UNUSED,
+ void *data UNUSED)
{
if (!strcmp(var, get_colorbool_slot))
get_colorbool_found = git_config_colorbool(var, value);
@@ -508,7 +537,8 @@ static int get_colorbool(const char *var, int print)
get_diff_color_found = -1;
get_color_ui_found = -1;
config_with_options(git_get_colorbool_config, NULL,
- &given_config_source, &config_options);
+ &given_config_source, the_repository,
+ &config_options);
if (get_colorbool_found < 0) {
if (!strcmp(get_colorbool_slot, "color.diff"))
@@ -545,13 +575,17 @@ static void check_write(void)
struct urlmatch_current_candidate_value {
char value_is_null;
struct strbuf value;
+ struct key_value_info kvi;
};
-static int urlmatch_collect_fn(const char *var, const char *value, void *cb)
+static int urlmatch_collect_fn(const char *var, const char *value,
+ const struct config_context *ctx,
+ void *cb)
{
struct string_list *values = cb;
struct string_list_item *item = string_list_insert(values, var);
struct urlmatch_current_candidate_value *matched = item->util;
+ const struct key_value_info *kvi = ctx->kvi;
if (!matched) {
matched = xmalloc(sizeof(*matched));
@@ -560,6 +594,7 @@ static int urlmatch_collect_fn(const char *var, const char *value, void *cb)
} else {
strbuf_reset(&matched->value);
}
+ matched->kvi = *kvi;
if (value) {
strbuf_addstr(&matched->value, value);
@@ -597,7 +632,8 @@ static int get_urlmatch(const char *var, const char *url)
}
config_with_options(urlmatch_config_entry, &config,
- &given_config_source, &config_options);
+ &given_config_source, the_repository,
+ &config_options);
ret = !values.nr;
@@ -606,7 +642,8 @@ static int get_urlmatch(const char *var, const char *url)
struct strbuf buf = STRBUF_INIT;
format_config(&buf, item->string,
- matched->value_is_null ? NULL : matched->value.buf);
+ matched->value_is_null ? NULL : matched->value.buf,
+ &matched->kvi);
fwrite(buf.buf, 1, buf.len, stdout);
strbuf_release(&buf);
@@ -637,8 +674,10 @@ static char *default_user_config(void)
int cmd_config(int argc, const char **argv, const char *prefix)
{
int nongit = !startup_info->have_repository;
- char *value;
+ char *value = NULL;
int flags = 0;
+ int ret = 0;
+ struct key_value_info default_kvi = KVI_INIT;
given_config_source.file = xstrdup_or_null(getenv(CONFIG_ENVIRONMENT));
@@ -671,10 +710,8 @@ int cmd_config(int argc, const char **argv, const char *prefix)
}
if (use_global_config) {
- char *user_config, *xdg_config;
-
- git_global_config(&user_config, &xdg_config);
- if (!user_config)
+ given_config_source.file = git_global_config();
+ if (!given_config_source.file)
/*
* It is unknown if HOME/.gitconfig exists, so
* we do not know if we should write to XDG
@@ -682,19 +719,8 @@ int cmd_config(int argc, const char **argv, const char *prefix)
* is set and points at a sane location.
*/
die(_("$HOME not set"));
-
given_config_source.scope = CONFIG_SCOPE_GLOBAL;
-
- if (access_or_warn(user_config, R_OK, 0) &&
- xdg_config && !access_or_warn(xdg_config, R_OK, 0)) {
- given_config_source.file = xdg_config;
- free(user_config);
- } else {
- given_config_source.file = user_config;
- free(xdg_config);
- }
- }
- else if (use_system_config) {
+ } else if (use_system_config) {
given_config_source.file = git_system_config();
given_config_source.scope = CONFIG_SCOPE_SYSTEM;
} else if (use_local_config) {
@@ -702,7 +728,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
given_config_source.scope = CONFIG_SCOPE_LOCAL;
} else if (use_worktree_config) {
struct worktree **worktrees = get_worktrees();
- if (repository_format_worktree_config)
+ if (the_repository->repository_format_worktree_config)
given_config_source.file = git_pathdup("config.worktree");
else if (worktrees[0] && worktrees[1])
die(_("--worktree cannot be used with multiple "
@@ -723,7 +749,6 @@ int cmd_config(int argc, const char **argv, const char *prefix)
given_config_source.scope = CONFIG_SCOPE_COMMAND;
}
-
if (respect_includes_opt == -1)
config_options.respect_includes = !given_config_source.file;
else
@@ -774,6 +799,12 @@ int cmd_config(int argc, const char **argv, const char *prefix)
usage_builtin_config();
}
+ if (comment &&
+ !(actions & (ACTION_ADD|ACTION_SET|ACTION_SET_ALL|ACTION_REPLACE_ALL))) {
+ error(_("--comment is only applicable to add/set/replace operations"));
+ usage_builtin_config();
+ }
+
/* check usage of --fixed-value */
if (fixed_value) {
int allowed_usage = 0;
@@ -810,13 +841,15 @@ int cmd_config(int argc, const char **argv, const char *prefix)
flags |= CONFIG_FLAGS_FIXED_VALUE;
}
+ comment = git_config_prepare_comment_string(comment);
+
if (actions & PAGING_ACTIONS)
setup_auto_pager("config", 1);
if (actions == ACTION_LIST) {
check_argc(argc, 0, 0);
if (config_with_options(show_all_config, NULL,
- &given_config_source,
+ &given_config_source, the_repository,
&config_options) < 0) {
if (given_config_source.file)
die_errno(_("unable to read config file '%s'"),
@@ -854,44 +887,38 @@ int cmd_config(int argc, const char **argv, const char *prefix)
free(config_file);
}
else if (actions == ACTION_SET) {
- int ret;
check_write();
check_argc(argc, 2, 2);
- value = normalize_value(argv[0], argv[1]);
- UNLEAK(value);
- ret = git_config_set_in_file_gently(given_config_source.file, argv[0], value);
+ value = normalize_value(argv[0], argv[1], &default_kvi);
+ ret = git_config_set_in_file_gently(given_config_source.file, argv[0], comment, value);
if (ret == CONFIG_NOTHING_SET)
error(_("cannot overwrite multiple values with a single value\n"
" Use a regexp, --add or --replace-all to change %s."), argv[0]);
- return ret;
}
else if (actions == ACTION_SET_ALL) {
check_write();
check_argc(argc, 2, 3);
- value = normalize_value(argv[0], argv[1]);
- UNLEAK(value);
- return git_config_set_multivar_in_file_gently(given_config_source.file,
- argv[0], value, argv[2],
- flags);
+ value = normalize_value(argv[0], argv[1], &default_kvi);
+ ret = git_config_set_multivar_in_file_gently(given_config_source.file,
+ argv[0], value, argv[2],
+ comment, flags);
}
else if (actions == ACTION_ADD) {
check_write();
check_argc(argc, 2, 2);
- value = normalize_value(argv[0], argv[1]);
- UNLEAK(value);
- return git_config_set_multivar_in_file_gently(given_config_source.file,
- argv[0], value,
- CONFIG_REGEX_NONE,
- flags);
+ value = normalize_value(argv[0], argv[1], &default_kvi);
+ ret = git_config_set_multivar_in_file_gently(given_config_source.file,
+ argv[0], value,
+ CONFIG_REGEX_NONE,
+ comment, flags);
}
else if (actions == ACTION_REPLACE_ALL) {
check_write();
check_argc(argc, 2, 3);
- value = normalize_value(argv[0], argv[1]);
- UNLEAK(value);
- return git_config_set_multivar_in_file_gently(given_config_source.file,
- argv[0], value, argv[2],
- flags | CONFIG_FLAGS_MULTI_REPLACE);
+ value = normalize_value(argv[0], argv[1], &default_kvi);
+ ret = git_config_set_multivar_in_file_gently(given_config_source.file,
+ argv[0], value, argv[2],
+ comment, flags | CONFIG_FLAGS_MULTI_REPLACE);
}
else if (actions == ACTION_GET) {
check_argc(argc, 1, 2);
@@ -919,39 +946,41 @@ int cmd_config(int argc, const char **argv, const char *prefix)
if (argc == 2)
return git_config_set_multivar_in_file_gently(given_config_source.file,
argv[0], NULL, argv[1],
- flags);
+ NULL, flags);
else
return git_config_set_in_file_gently(given_config_source.file,
- argv[0], NULL);
+ argv[0], NULL, NULL);
}
else if (actions == ACTION_UNSET_ALL) {
check_write();
check_argc(argc, 1, 2);
return git_config_set_multivar_in_file_gently(given_config_source.file,
argv[0], NULL, argv[1],
- flags | CONFIG_FLAGS_MULTI_REPLACE);
+ NULL, flags | CONFIG_FLAGS_MULTI_REPLACE);
}
else if (actions == ACTION_RENAME_SECTION) {
- int ret;
check_write();
check_argc(argc, 2, 2);
ret = git_config_rename_section_in_file(given_config_source.file,
argv[0], argv[1]);
if (ret < 0)
return ret;
- if (ret == 0)
+ else if (!ret)
die(_("no such section: %s"), argv[0]);
+ else
+ ret = 0;
}
else if (actions == ACTION_REMOVE_SECTION) {
- int ret;
check_write();
check_argc(argc, 1, 1);
ret = git_config_rename_section_in_file(given_config_source.file,
argv[0], NULL);
if (ret < 0)
return ret;
- if (ret == 0)
+ else if (!ret)
die(_("no such section: %s"), argv[0]);
+ else
+ ret = 0;
}
else if (actions == ACTION_GET_COLOR) {
check_argc(argc, 1, 2);
@@ -964,5 +993,6 @@ int cmd_config(int argc, const char **argv, const char *prefix)
return get_colorbool(argv[0], argc == 2);
}
- return 0;
+ free(value);
+ return ret;
}
diff --git a/builtin/count-objects.c b/builtin/count-objects.c
index 07b9419..2d4bb5e 100644
--- a/builtin/count-objects.c
+++ b/builtin/count-objects.c
@@ -4,15 +4,17 @@
* Copyright (c) 2006 Junio C Hamano
*/
-#include "cache.h"
+#include "builtin.h"
#include "config.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
+#include "path.h"
#include "repository.h"
-#include "builtin.h"
#include "parse-options.h"
#include "quote.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
static unsigned long garbage;
static off_t size_garbage;
@@ -57,7 +59,8 @@ static void loose_garbage(const char *path)
report_garbage(PACKDIR_FILE_GARBAGE, path);
}
-static int count_loose(const struct object_id *oid, const char *path, void *data)
+static int count_loose(const struct object_id *oid, const char *path,
+ void *data UNUSED)
{
struct stat st;
@@ -72,13 +75,14 @@ static int count_loose(const struct object_id *oid, const char *path, void *data
return 0;
}
-static int count_cruft(const char *basename, const char *path, void *data)
+static int count_cruft(const char *basename UNUSED, const char *path,
+ void *data UNUSED)
{
loose_garbage(path);
return 0;
}
-static int print_alternate(struct object_directory *odb, void *data)
+static int print_alternate(struct object_directory *odb, void *data UNUSED)
{
printf("alternate: ");
quote_c_style(odb->path, NULL, stdout, 0);
diff --git a/builtin/credential-cache--daemon.c b/builtin/credential-cache--daemon.c
index 4c6c89a..17f929d 100644
--- a/builtin/credential-cache--daemon.c
+++ b/builtin/credential-cache--daemon.c
@@ -1,4 +1,7 @@
#include "builtin.h"
+#include "abspath.h"
+#include "gettext.h"
+#include "object-file.h"
#include "parse-options.h"
#ifndef NO_UNIX_SOCKETS
@@ -34,19 +37,22 @@ static struct credential_cache_entry *lookup_credential(const struct credential
int i;
for (i = 0; i < entries_nr; i++) {
struct credential *e = &entries[i].item;
- if (credential_match(c, e))
+ if (credential_match(c, e, 0))
return &entries[i];
}
return NULL;
}
-static void remove_credential(const struct credential *c)
+static void remove_credential(const struct credential *c, int match_password)
{
struct credential_cache_entry *e;
- e = lookup_credential(c);
- if (e)
- e->expiration = 0;
+ int i;
+ for (i = 0; i < entries_nr; i++) {
+ e = &entries[i];
+ if (credential_match(c, &e->item, match_password))
+ e->expiration = 0;
+ }
}
static timestamp_t check_expirations(void)
@@ -127,6 +133,12 @@ static void serve_one_client(FILE *in, FILE *out)
if (e) {
fprintf(out, "username=%s\n", e->item.username);
fprintf(out, "password=%s\n", e->item.password);
+ if (e->item.password_expiry_utc != TIME_MAX)
+ fprintf(out, "password_expiry_utc=%"PRItime"\n",
+ e->item.password_expiry_utc);
+ if (e->item.oauth_refresh_token)
+ fprintf(out, "oauth_refresh_token=%s\n",
+ e->item.oauth_refresh_token);
}
}
else if (!strcmp(action.buf, "exit")) {
@@ -141,14 +153,14 @@ static void serve_one_client(FILE *in, FILE *out)
exit(0);
}
else if (!strcmp(action.buf, "erase"))
- remove_credential(&c);
+ remove_credential(&c, 1);
else if (!strcmp(action.buf, "store")) {
if (timeout < 0)
warning("cache client didn't specify a timeout");
else if (!c.username || !c.password)
warning("cache client gave us a partial credential");
else {
- remove_credential(&c);
+ remove_credential(&c, 0);
cache_credential(&c, timeout);
}
}
@@ -267,7 +279,7 @@ int cmd_credential_cache_daemon(int argc, const char **argv, const char *prefix)
const char *socket_path;
int ignore_sighup = 0;
static const char *usage[] = {
- "git-credential-cache--daemon [opts] <socket_path>",
+ "git credential-cache--daemon [--debug] <socket-path>",
NULL
};
int debug = 0;
@@ -282,6 +294,8 @@ int cmd_credential_cache_daemon(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, prefix, options, usage, 0);
socket_path = argv[0];
+ if (!have_unix_sockets())
+ die(_("credential-cache--daemon unavailable; no unix socket support"));
if (!socket_path)
usage_with_options(usage, options);
@@ -305,7 +319,7 @@ int cmd_credential_cache_daemon(int argc, const char **argv, const char *prefix)
int cmd_credential_cache_daemon(int argc, const char **argv, const char *prefix)
{
const char * const usage[] = {
- "git credential-cache--daemon [options] <action>",
+ "git credential-cache--daemon [--debug] <socket-path>",
"",
"credential-cache--daemon is disabled in this build of Git",
NULL
diff --git a/builtin/credential-cache.c b/builtin/credential-cache.c
index 78c02ad..bef120b 100644
--- a/builtin/credential-cache.c
+++ b/builtin/credential-cache.c
@@ -1,10 +1,12 @@
#include "builtin.h"
+#include "gettext.h"
#include "parse-options.h"
+#include "path.h"
+#include "strbuf.h"
+#include "write-or-die.h"
#ifndef NO_UNIX_SOCKETS
-#include "credential.h"
-#include "string-list.h"
#include "unix-socket.h"
#include "run-command.h"
@@ -147,6 +149,9 @@ int cmd_credential_cache(int argc, const char **argv, const char *prefix)
usage_with_options(usage, options);
op = argv[0];
+ if (!have_unix_sockets())
+ die(_("credential-cache unavailable; no unix socket support"));
+
if (!socket_path)
socket_path = get_socket_path();
if (!socket_path)
diff --git a/builtin/credential-store.c b/builtin/credential-store.c
index 62a4f3c..4a49241 100644
--- a/builtin/credential-store.c
+++ b/builtin/credential-store.c
@@ -1,16 +1,20 @@
#include "builtin.h"
#include "config.h"
+#include "gettext.h"
#include "lockfile.h"
#include "credential.h"
+#include "path.h"
#include "string-list.h"
#include "parse-options.h"
+#include "write-or-die.h"
static struct lock_file credential_lock;
static int parse_credential_file(const char *fn,
struct credential *c,
void (*match_cb)(struct credential *),
- void (*other_cb)(struct strbuf *))
+ void (*other_cb)(struct strbuf *),
+ int match_password)
{
FILE *fh;
struct strbuf line = STRBUF_INIT;
@@ -27,7 +31,7 @@ static int parse_credential_file(const char *fn,
while (strbuf_getline_lf(&line, fh) != EOF) {
if (!credential_from_url_gently(&entry, line.buf, 1) &&
entry.username && entry.password &&
- credential_match(c, &entry)) {
+ credential_match(c, &entry, match_password)) {
found_credential = 1;
if (match_cb) {
match_cb(&entry);
@@ -57,7 +61,7 @@ static void print_line(struct strbuf *buf)
}
static void rewrite_credential_file(const char *fn, struct credential *c,
- struct strbuf *extra)
+ struct strbuf *extra, int match_password)
{
int timeout_ms = 1000;
@@ -66,11 +70,30 @@ static void rewrite_credential_file(const char *fn, struct credential *c,
die_errno(_("unable to get credential storage lock in %d ms"), timeout_ms);
if (extra)
print_line(extra);
- parse_credential_file(fn, c, NULL, print_line);
+ parse_credential_file(fn, c, NULL, print_line, match_password);
if (commit_lock_file(&credential_lock) < 0)
die_errno("unable to write credential store");
}
+static int is_rfc3986_unreserved(char ch)
+{
+ return isalnum(ch) ||
+ ch == '-' || ch == '_' || ch == '.' || ch == '~';
+}
+
+static int is_rfc3986_reserved_or_unreserved(char ch)
+{
+ if (is_rfc3986_unreserved(ch))
+ return 1;
+ switch (ch) {
+ case '!': case '*': case '\'': case '(': case ')': case ';':
+ case ':': case '@': case '&': case '=': case '+': case '$':
+ case ',': case '/': case '?': case '#': case '[': case ']':
+ return 1;
+ }
+ return 0;
+}
+
static void store_credential_file(const char *fn, struct credential *c)
{
struct strbuf buf = STRBUF_INIT;
@@ -88,7 +111,7 @@ static void store_credential_file(const char *fn, struct credential *c)
is_rfc3986_reserved_or_unreserved);
}
- rewrite_credential_file(fn, c, &buf);
+ rewrite_credential_file(fn, c, &buf, 0);
strbuf_release(&buf);
}
@@ -135,7 +158,7 @@ static void remove_credential(const struct string_list *fns, struct credential *
return;
for_each_string_list_item(fn, fns)
if (!access(fn->string, F_OK))
- rewrite_credential_file(fn->string, c, NULL);
+ rewrite_credential_file(fn->string, c, NULL, 1);
}
static void lookup_credential(const struct string_list *fns, struct credential *c)
@@ -143,7 +166,7 @@ static void lookup_credential(const struct string_list *fns, struct credential *
struct string_list_item *fn;
for_each_string_list_item(fn, fns)
- if (parse_credential_file(fn->string, c, print_entry, NULL))
+ if (parse_credential_file(fn->string, c, print_entry, NULL, 0))
return; /* Found credential */
}
diff --git a/builtin/credential.c b/builtin/credential.c
index d7b304f..7010752 100644
--- a/builtin/credential.c
+++ b/builtin/credential.c
@@ -6,7 +6,7 @@
static const char usage_msg[] =
"git credential (fill|approve|reject)";
-int cmd_credential(int argc, const char **argv, const char *prefix)
+int cmd_credential(int argc, const char **argv, const char *prefix UNUSED)
{
const char *op;
struct credential c = CREDENTIAL_INIT;
diff --git a/builtin/describe.c b/builtin/describe.c
index a76f1a1..d6c77a7 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -1,30 +1,36 @@
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
+#define USE_THE_INDEX_VARIABLE
+#include "builtin.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "lockfile.h"
#include "commit.h"
#include "tag.h"
-#include "blob.h"
#include "refs.h"
-#include "builtin.h"
-#include "exec-cmd.h"
+#include "object-name.h"
#include "parse-options.h"
+#include "read-cache-ll.h"
#include "revision.h"
#include "diff.h"
#include "hashmap.h"
+#include "setup.h"
#include "strvec.h"
#include "run-command.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "list-objects.h"
#include "commit-slab.h"
+#include "wildmatch.h"
#define MAX_TAGS (FLAG_BITS - 1)
+#define DEFAULT_CANDIDATES 10
define_commit_slab(commit_names, struct commit_name *);
static const char * const describe_usage[] = {
- N_("git describe [<options>] [<commit-ish>...]"),
- N_("git describe [<options>] --dirty"),
+ N_("git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"),
+ N_("git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]"),
+ N_("git describe <blob>"),
NULL
};
@@ -34,7 +40,7 @@ static int tags; /* Allow lightweight tags */
static int longformat;
static int first_parent;
static int abbrev = -1; /* unspecified */
-static int max_candidates = 10;
+static int max_candidates = DEFAULT_CANDIDATES;
static struct hashmap names;
static int have_util;
static struct string_list patterns = STRING_LIST_INIT_NODUP;
@@ -63,7 +69,7 @@ static const char *prio_names[] = {
N_("head"), N_("lightweight"), N_("annotated"),
};
-static int commit_name_neq(const void *unused_cmp_data,
+static int commit_name_neq(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *peeled)
@@ -140,7 +146,8 @@ static void add_to_known_names(const char *path,
}
}
-static int get_name(const char *path, const struct object_id *oid, int flag, void *cb_data)
+static int get_name(const char *path, const struct object_id *oid,
+ int flag UNUSED, void *cb_data UNUSED)
{
int is_tag = 0;
struct object_id peeled;
@@ -259,7 +266,7 @@ static unsigned long finish_depth_computation(
best->depth++;
while (parents) {
struct commit *p = parents->item;
- parse_commit(p);
+ repo_parse_commit(the_repository, p);
if (!(p->object.flags & SEEN))
commit_list_insert_by_date(p, list);
p->object.flags |= c->object.flags;
@@ -296,7 +303,8 @@ static void append_name(struct commit_name *n, struct strbuf *dst)
static void append_suffix(int depth, const struct object_id *oid, struct strbuf *dst)
{
- strbuf_addf(dst, "-%d-g%s", depth, find_unique_abbrev(oid, abbrev));
+ strbuf_addf(dst, "-%d-g%s", depth,
+ repo_find_unique_abbrev(the_repository, oid, abbrev));
}
static void describe_commit(struct object_id *oid, struct strbuf *dst)
@@ -401,7 +409,7 @@ static void describe_commit(struct object_id *oid, struct strbuf *dst)
}
while (parents) {
struct commit *p = parents->item;
- parse_commit(p);
+ repo_parse_commit(the_repository, p);
if (!(p->object.flags & SEEN))
commit_list_insert_by_date(p, &list);
p->object.flags |= c->object.flags;
@@ -529,7 +537,7 @@ static void describe(const char *arg, int last_one)
if (debug)
fprintf(stderr, _("describe %s\n"), arg);
- if (get_oid(arg, &oid))
+ if (repo_get_oid(the_repository, arg, &oid))
die(_("Not a valid object name %s"), arg);
cmit = lookup_commit_reference_gently(the_repository, &oid, 1);
@@ -548,6 +556,17 @@ static void describe(const char *arg, int last_one)
strbuf_release(&sb);
}
+static int option_parse_exact_match(const struct option *opt, const char *arg,
+ int unset)
+{
+ int *val = opt->value;
+
+ BUG_ON_OPT_ARG(arg);
+
+ *val = unset ? DEFAULT_CANDIDATES : 0;
+ return 0;
+}
+
int cmd_describe(int argc, const char **argv, const char *prefix)
{
int contains = 0;
@@ -559,8 +578,9 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
OPT_BOOL(0, "long", &longformat, N_("always use long format")),
OPT_BOOL(0, "first-parent", &first_parent, N_("only follow first parent")),
OPT__ABBREV(&abbrev),
- OPT_SET_INT(0, "exact-match", &max_candidates,
- N_("only output exact matches"), 0),
+ OPT_CALLBACK_F(0, "exact-match", &max_candidates, NULL,
+ N_("only output exact matches"),
+ PARSE_OPT_NOARG, option_parse_exact_match),
OPT_INTEGER(0, "candidates", &max_candidates,
N_("consider <n> most recent tags (default: 10)")),
OPT_STRING_LIST(0, "match", &patterns, N_("pattern"),
@@ -648,13 +668,16 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
struct lock_file index_lock = LOCK_INIT;
struct rev_info revs;
struct strvec args = STRVEC_INIT;
- int fd, result;
+ int fd;
setup_work_tree();
- read_cache();
+ prepare_repo_settings(the_repository);
+ the_repository->settings.command_requires_full_index = 0;
+ repo_read_index(the_repository);
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED,
NULL, NULL, NULL);
- fd = hold_locked_index(&index_lock, 0);
+ fd = repo_hold_locked_index(the_repository,
+ &index_lock, 0);
if (0 <= fd)
repo_update_index_if_able(the_repository, &index_lock);
@@ -662,9 +685,9 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
strvec_pushv(&args, diff_index_args);
if (setup_revisions(args.nr, args.v, &revs, NULL) != 1)
BUG("malformed internal diff-index command line");
- result = run_diff_index(&revs, 0);
+ run_diff_index(&revs, 0);
- if (!diff_result_code(&revs.diffopt, result))
+ if (!diff_result_code(&revs.diffopt))
suffix = NULL;
else
suffix = dirty;
diff --git a/builtin/diagnose.c b/builtin/diagnose.c
new file mode 100644
index 0000000..4f22eb2
--- /dev/null
+++ b/builtin/diagnose.c
@@ -0,0 +1,65 @@
+#include "builtin.h"
+#include "abspath.h"
+#include "gettext.h"
+#include "object-file.h"
+#include "parse-options.h"
+#include "diagnose.h"
+
+static const char * const diagnose_usage[] = {
+ N_("git diagnose [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+ " [--mode=<mode>]"),
+ NULL
+};
+
+int cmd_diagnose(int argc, const char **argv, const char *prefix)
+{
+ struct strbuf zip_path = STRBUF_INIT;
+ time_t now = time(NULL);
+ struct tm tm;
+ enum diagnose_mode mode = DIAGNOSE_STATS;
+ char *option_output = NULL;
+ char *option_suffix = "%Y-%m-%d-%H%M";
+ char *prefixed_filename;
+
+ const struct option diagnose_options[] = {
+ OPT_STRING('o', "output-directory", &option_output, N_("path"),
+ N_("specify a destination for the diagnostics archive")),
+ OPT_STRING('s', "suffix", &option_suffix, N_("format"),
+ N_("specify a strftime format suffix for the filename")),
+ OPT_CALLBACK_F(0, "mode", &mode, "(stats|all)",
+ N_("specify the content of the diagnostic archive"),
+ PARSE_OPT_NONEG, option_parse_diagnose),
+ OPT_END()
+ };
+
+ argc = parse_options(argc, argv, prefix, diagnose_options,
+ diagnose_usage, 0);
+
+ /* Prepare the path to put the result */
+ prefixed_filename = prefix_filename(prefix,
+ option_output ? option_output : "");
+ strbuf_addstr(&zip_path, prefixed_filename);
+ strbuf_complete(&zip_path, '/');
+
+ strbuf_addstr(&zip_path, "git-diagnostics-");
+ strbuf_addftime(&zip_path, option_suffix, localtime_r(&now, &tm), 0, 0);
+ strbuf_addstr(&zip_path, ".zip");
+
+ switch (safe_create_leading_directories(zip_path.buf)) {
+ case SCLD_OK:
+ case SCLD_EXISTS:
+ break;
+ default:
+ die_errno(_("could not create leading directories for '%s'"),
+ zip_path.buf);
+ }
+
+ /* Prepare diagnostics */
+ if (create_diagnostics_archive(&zip_path, mode))
+ die_errno(_("unable to create diagnostics archive %s"),
+ zip_path.buf);
+
+ free(prefixed_filename);
+ strbuf_release(&zip_path);
+ return 0;
+}
diff --git a/builtin/diff-files.c b/builtin/diff-files.c
index 92cf6e1..018011f 100644
--- a/builtin/diff-files.c
+++ b/builtin/diff-files.c
@@ -3,18 +3,18 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
+#include "builtin.h"
#include "config.h"
#include "diff.h"
#include "diff-merges.h"
#include "commit.h"
+#include "preload-index.h"
+#include "repository.h"
#include "revision.h"
-#include "builtin.h"
-#include "submodule.h"
static const char diff_files_usage[] =
"git diff-files [-q] [-0 | -1 | -2 | -3 | -c | --cc] [<common-diff-options>] [<path>...]"
+"\n"
COMMON_DIFF_OPTIONS_HELP;
int cmd_diff_files(int argc, const char **argv, const char *prefix)
@@ -27,6 +27,10 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix)
usage(diff_files_usage);
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
+
+ prepare_repo_settings(the_repository);
+ the_repository->settings.command_requires_full_index = 0;
+
repo_init_revisions(the_repository, &rev, prefix);
rev.abbrev = 0;
@@ -75,14 +79,10 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix)
(rev.diffopt.output_format & DIFF_FORMAT_PATCH))
diff_merges_set_dense_combined_if_unset(&rev);
- if (read_cache_preload(&rev.diffopt.pathspec) < 0) {
- perror("read_cache_preload");
- result = -1;
- goto cleanup;
- }
- result = run_diff_files(&rev, options);
- result = diff_result_code(&rev.diffopt, result);
-cleanup:
+ if (repo_read_index_preload(the_repository, &rev.diffopt.pathspec, 0) < 0)
+ die_errno("repo_read_index_preload");
+ run_diff_files(&rev, options);
+ result = diff_result_code(&rev.diffopt);
release_revisions(&rev);
return result;
}
diff --git a/builtin/diff-index.c b/builtin/diff-index.c
index 7d158af..3e05260 100644
--- a/builtin/diff-index.c
+++ b/builtin/diff-index.c
@@ -1,16 +1,17 @@
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
+#include "builtin.h"
#include "config.h"
#include "diff.h"
#include "diff-merges.h"
#include "commit.h"
+#include "preload-index.h"
+#include "repository.h"
#include "revision.h"
-#include "builtin.h"
-#include "submodule.h"
+#include "setup.h"
static const char diff_cache_usage[] =
-"git diff-index [-m] [--cached] "
+"git diff-index [-m] [--cached] [--merge-base] "
"[<common-diff-options>] <tree-ish> [<path>...]"
+"\n"
COMMON_DIFF_OPTIONS_HELP;
int cmd_diff_index(int argc, const char **argv, const char *prefix)
@@ -61,16 +62,16 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix)
usage(diff_cache_usage);
if (!(option & DIFF_INDEX_CACHED)) {
setup_work_tree();
- if (read_cache_preload(&rev.diffopt.pathspec) < 0) {
- perror("read_cache_preload");
+ if (repo_read_index_preload(the_repository, &rev.diffopt.pathspec, 0) < 0) {
+ perror("repo_read_index_preload");
return -1;
}
- } else if (read_cache() < 0) {
- perror("read_cache");
+ } else if (repo_read_index(the_repository) < 0) {
+ perror("repo_read_index");
return -1;
}
- result = run_diff_index(&rev, option);
- result = diff_result_code(&rev.diffopt, result);
+ run_diff_index(&rev, option);
+ result = diff_result_code(&rev.diffopt);
release_revisions(&rev);
return result;
}
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index 116097a..a8e68ce 100644
--- a/builtin/diff-tree.c
+++ b/builtin/diff-tree.c
@@ -1,12 +1,15 @@
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
+#define USE_THE_INDEX_VARIABLE
+#include "builtin.h"
#include "config.h"
#include "diff.h"
#include "commit.h"
+#include "gettext.h"
+#include "hex.h"
#include "log-tree.h"
-#include "builtin.h"
-#include "submodule.h"
+#include "read-cache-ll.h"
#include "repository.h"
+#include "revision.h"
+#include "tree.h"
static struct rev_info log_tree_opt;
@@ -83,8 +86,10 @@ static int diff_tree_stdin(char *line)
}
static const char diff_tree_usage[] =
-"git diff-tree [--stdin] [-m] [-c | --cc] [-s] [-v] [--pretty] [-t] [-r] [--root] "
-"[<common-diff-options>] <tree-ish> [<tree-ish>] [<path>...]\n"
+"git diff-tree [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]\n"
+" [-t] [-r] [-c | --cc] [--combined-all-paths] [--root] [--merge-base]\n"
+" [<common-diff-options>] <tree-ish> [<tree-ish>] [<path>...]\n"
+"\n"
" -r diff recursively\n"
" -c show combined diff for merge commits\n"
" --cc show combined diff for merge commits removing uninteresting hunks\n"
@@ -93,7 +98,7 @@ static const char diff_tree_usage[] =
" --root include the initial commit as diff against /dev/null\n"
COMMON_DIFF_OPTIONS_HELP;
-static void diff_tree_tweak_rev(struct rev_info *rev, struct setup_revision_opt *opt)
+static void diff_tree_tweak_rev(struct rev_info *rev)
{
if (!rev->diffopt.output_format) {
if (rev->dense_combined_merges)
@@ -117,8 +122,12 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
usage(diff_tree_usage);
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
+
+ prepare_repo_settings(the_repository);
+ the_repository->settings.command_requires_full_index = 0;
+
repo_init_revisions(the_repository, opt, prefix);
- if (read_cache() < 0)
+ if (repo_read_index(the_repository) < 0)
die(_("index file corrupt"));
opt->abbrev = 0;
opt->diff = 1;
@@ -222,5 +231,5 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
diff_free(&opt->diffopt);
}
- return diff_result_code(&opt->diffopt, 0);
+ return diff_result_code(&opt->diffopt);
}
diff --git a/builtin/diff.c b/builtin/diff.c
index 54bb3de..6e196e0 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -3,23 +3,25 @@
*
* Copyright (c) 2006 Junio C Hamano
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
+#define USE_THE_INDEX_VARIABLE
+#include "builtin.h"
#include "config.h"
#include "ewah/ewok.h"
#include "lockfile.h"
#include "color.h"
#include "commit.h"
-#include "blob.h"
+#include "gettext.h"
#include "tag.h"
#include "diff.h"
#include "diff-merges.h"
#include "diffcore.h"
+#include "preload-index.h"
+#include "read-cache-ll.h"
#include "revision.h"
#include "log-tree.h"
-#include "builtin.h"
-#include "submodule.h"
+#include "setup.h"
#include "oid-array.h"
+#include "tree.h"
#define DIFF_NO_INDEX_EXPLICIT 1
#define DIFF_NO_INDEX_IMPLICIT 2
@@ -30,7 +32,8 @@ static const char builtin_diff_usage[] =
" or: git diff [<options>] [--merge-base] <commit> [<commit>...] <commit> [--] [<path>...]\n"
" or: git diff [<options>] <commit>...<commit> [--] [<path>...]\n"
" or: git diff [<options>] <blob> <blob>\n"
-" or: git diff [<options>] --no-index [--] <path> <path>\n"
+" or: git diff [<options>] --no-index [--] <path> <path>"
+"\n"
COMMON_DIFF_OPTIONS_HELP;
static const char *blob_path(struct object_array_entry *entry)
@@ -72,9 +75,9 @@ static void stuff_change(struct diff_options *opt,
diff_queue(&diff_queued_diff, one, two);
}
-static int builtin_diff_b_f(struct rev_info *revs,
- int argc, const char **argv,
- struct object_array_entry **blob)
+static void builtin_diff_b_f(struct rev_info *revs,
+ int argc, const char **argv UNUSED,
+ struct object_array_entry **blob)
{
/* Blob vs file in the working tree*/
struct stat st;
@@ -104,12 +107,11 @@ static int builtin_diff_b_f(struct rev_info *revs,
path);
diffcore_std(&revs->diffopt);
diff_flush(&revs->diffopt);
- return 0;
}
-static int builtin_diff_blobs(struct rev_info *revs,
- int argc, const char **argv,
- struct object_array_entry **blob)
+static void builtin_diff_blobs(struct rev_info *revs,
+ int argc, const char **argv UNUSED,
+ struct object_array_entry **blob)
{
const unsigned mode = canon_mode(S_IFREG | 0644);
@@ -129,11 +131,10 @@ static int builtin_diff_blobs(struct rev_info *revs,
blob_path(blob[0]), blob_path(blob[1]));
diffcore_std(&revs->diffopt);
diff_flush(&revs->diffopt);
- return 0;
}
-static int builtin_diff_index(struct rev_info *revs,
- int argc, const char **argv)
+static void builtin_diff_index(struct rev_info *revs,
+ int argc, const char **argv)
{
unsigned int option = 0;
while (1 < argc) {
@@ -156,21 +157,20 @@ static int builtin_diff_index(struct rev_info *revs,
usage(builtin_diff_usage);
if (!(option & DIFF_INDEX_CACHED)) {
setup_work_tree();
- if (read_cache_preload(&revs->diffopt.pathspec) < 0) {
- perror("read_cache_preload");
- return -1;
+ if (repo_read_index_preload(the_repository,
+ &revs->diffopt.pathspec, 0) < 0) {
+ die_errno("repo_read_index_preload");
}
- } else if (read_cache() < 0) {
- perror("read_cache");
- return -1;
+ } else if (repo_read_index(the_repository) < 0) {
+ die_errno("repo_read_cache");
}
- return run_diff_index(revs, option);
+ run_diff_index(revs, option);
}
-static int builtin_diff_tree(struct rev_info *revs,
- int argc, const char **argv,
- struct object_array_entry *ent0,
- struct object_array_entry *ent1)
+static void builtin_diff_tree(struct rev_info *revs,
+ int argc, const char **argv,
+ struct object_array_entry *ent0,
+ struct object_array_entry *ent1)
{
const struct object_id *(oid[2]);
struct object_id mb_oid;
@@ -203,13 +203,12 @@ static int builtin_diff_tree(struct rev_info *revs,
}
diff_tree_oid(oid[0], oid[1], "", &revs->diffopt);
log_tree_diff_flush(revs);
- return 0;
}
-static int builtin_diff_combined(struct rev_info *revs,
- int argc, const char **argv,
- struct object_array_entry *ent,
- int ents)
+static void builtin_diff_combined(struct rev_info *revs,
+ int argc, const char **argv UNUSED,
+ struct object_array_entry *ent,
+ int ents, int first_non_parent)
{
struct oid_array parents = OID_ARRAY_INIT;
int i;
@@ -217,13 +216,19 @@ static int builtin_diff_combined(struct rev_info *revs,
if (argc > 1)
usage(builtin_diff_usage);
+ if (first_non_parent < 0)
+ die(_("no merge given, only parents."));
+ if (first_non_parent >= ents)
+ BUG("first_non_parent out of range: %d", first_non_parent);
+
diff_merges_set_dense_combined_if_unset(revs);
- for (i = 1; i < ents; i++)
- oid_array_append(&parents, &ent[i].item->oid);
- diff_tree_combined(&ent[0].item->oid, &parents, revs);
+ for (i = 0; i < ents; i++) {
+ if (i != first_non_parent)
+ oid_array_append(&parents, &ent[i].item->oid);
+ }
+ diff_tree_combined(&ent[first_non_parent].item->oid, &parents, revs);
oid_array_clear(&parents);
- return 0;
}
static void refresh_index_quietly(void)
@@ -231,16 +236,17 @@ static void refresh_index_quietly(void)
struct lock_file lock_file = LOCK_INIT;
int fd;
- fd = hold_locked_index(&lock_file, 0);
+ fd = repo_hold_locked_index(the_repository, &lock_file, 0);
if (fd < 0)
return;
- discard_cache();
- read_cache();
- refresh_cache(REFRESH_QUIET|REFRESH_UNMERGED);
+ discard_index(&the_index);
+ repo_read_index(the_repository);
+ refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, NULL, NULL,
+ NULL);
repo_update_index_if_able(the_repository, &lock_file);
}
-static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv)
+static void builtin_diff_files(struct rev_info *revs, int argc, const char **argv)
{
unsigned int options = 0;
@@ -255,8 +261,10 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv
options |= DIFF_SILENT_ON_REMOVED;
else if (!strcmp(argv[1], "-h"))
usage(builtin_diff_usage);
- else
- return error(_("invalid option: %s"), argv[1]);
+ else {
+ error(_("invalid option: %s"), argv[1]);
+ usage(builtin_diff_usage);
+ }
argv++; argc--;
}
@@ -271,11 +279,11 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv
diff_merges_set_dense_combined_if_unset(revs);
setup_work_tree();
- if (read_cache_preload(&revs->diffopt.pathspec) < 0) {
- perror("read_cache_preload");
- return -1;
+ if (repo_read_index_preload(the_repository, &revs->diffopt.pathspec,
+ 0) < 0) {
+ die_errno("repo_read_index_preload");
}
- return run_diff_files(revs, options);
+ run_diff_files(revs, options);
}
struct symdiff {
@@ -385,10 +393,11 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
int i;
struct rev_info rev;
struct object_array ent = OBJECT_ARRAY_INIT;
+ int first_non_parent = -1;
int blobs = 0, paths = 0;
struct object_array_entry *blob[2];
int nongit = 0, no_index = 0;
- int result = 0;
+ int result;
struct symdiff sdiff;
/*
@@ -463,8 +472,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
repo_init_revisions(the_repository, &rev, prefix);
/* Set up defaults that will apply to both no-index and regular diffs. */
- rev.diffopt.stat_width = -1;
- rev.diffopt.stat_graph_width = -1;
+ init_diffstat_widths(&rev.diffopt);
rev.diffopt.flags.allow_external = 1;
rev.diffopt.flags.allow_textconv = 1;
@@ -536,13 +544,18 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
if (!obj)
die(_("invalid object '%s' given."), name);
if (obj->type == OBJ_COMMIT)
- obj = &get_commit_tree(((struct commit *)obj))->object;
+ obj = &repo_get_commit_tree(the_repository,
+ ((struct commit *)obj))->object;
if (obj->type == OBJ_TREE) {
if (sdiff.skip && bitmap_get(sdiff.skip, i))
continue;
obj->flags |= flags;
add_object_array(obj, name, &ent);
+ if (first_non_parent < 0 &&
+ (i >= rev.cmdline.nr || /* HEAD by hand. */
+ rev.cmdline.rev[i].whence != REV_CMD_PARENTS_ONLY))
+ first_non_parent = ent.nr - 1;
} else if (obj->type == OBJ_BLOB) {
if (2 <= blobs)
die(_("more than two blobs given: '%s'"), name);
@@ -562,17 +575,17 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
if (!ent.nr) {
switch (blobs) {
case 0:
- result = builtin_diff_files(&rev, argc, argv);
+ builtin_diff_files(&rev, argc, argv);
break;
case 1:
if (paths != 1)
usage(builtin_diff_usage);
- result = builtin_diff_b_f(&rev, argc, argv, blob);
+ builtin_diff_b_f(&rev, argc, argv, blob);
break;
case 2:
if (paths)
usage(builtin_diff_usage);
- result = builtin_diff_blobs(&rev, argc, argv, blob);
+ builtin_diff_blobs(&rev, argc, argv, blob);
break;
default:
usage(builtin_diff_usage);
@@ -581,21 +594,22 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
else if (blobs)
usage(builtin_diff_usage);
else if (ent.nr == 1)
- result = builtin_diff_index(&rev, argc, argv);
+ builtin_diff_index(&rev, argc, argv);
else if (ent.nr == 2) {
if (sdiff.warn)
warning(_("%s...%s: multiple merge bases, using %s"),
sdiff.left, sdiff.right, sdiff.base);
- result = builtin_diff_tree(&rev, argc, argv,
- &ent.objects[0], &ent.objects[1]);
+ builtin_diff_tree(&rev, argc, argv,
+ &ent.objects[0], &ent.objects[1]);
} else
- result = builtin_diff_combined(&rev, argc, argv,
- ent.objects, ent.nr);
- result = diff_result_code(&rev.diffopt, result);
+ builtin_diff_combined(&rev, argc, argv,
+ ent.objects, ent.nr,
+ first_non_parent);
+ result = diff_result_code(&rev.diffopt);
if (1 < rev.diffopt.skip_stat_unmatch)
refresh_index_quietly();
release_revisions(&rev);
- UNLEAK(ent);
+ object_array_clear(&ent);
UNLEAK(blob);
return result;
}
diff --git a/builtin/difftool.c b/builtin/difftool.c
index b3c509b..a3c72b8 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -11,19 +11,26 @@
*
* Copyright (C) 2016 Johannes Schindelin
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
-#include "config.h"
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
+#include "config.h"
+#include "copy.h"
#include "run-command.h"
-#include "exec-cmd.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "parse-options.h"
+#include "read-cache-ll.h"
+#include "sparse-index.h"
#include "strvec.h"
#include "strbuf.h"
#include "lockfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
#include "dir.h"
#include "entry.h"
+#include "setup.h"
static int trust_exit_code;
@@ -32,20 +39,24 @@ static const char *const builtin_difftool_usage[] = {
NULL
};
-static int difftool_config(const char *var, const char *value, void *cb)
+static int difftool_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(var, "difftool.trustexitcode")) {
trust_exit_code = git_config_bool(var, value);
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
static int print_tool_help(void)
{
- const char *argv[] = { "mergetool", "--tool-help=diff", NULL };
- return run_command_v_opt(argv, RUN_GIT_CMD);
+ struct child_process cmd = CHILD_PROCESS_INIT;
+
+ cmd.git_cmd = 1;
+ strvec_pushl(&cmd.args, "mergetool", "--tool-help=diff", NULL);
+ return run_command(&cmd);
}
static int parse_index_info(char *p, int *mode1, int *mode2,
@@ -125,10 +136,10 @@ struct working_tree_entry {
char path[FLEX_ARRAY];
};
-static int working_tree_entry_cmp(const void *unused_cmp_data,
+static int working_tree_entry_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
- const void *unused_keydata)
+ const void *keydata UNUSED)
{
const struct working_tree_entry *a, *b;
@@ -148,10 +159,10 @@ struct pair_entry {
const char path[FLEX_ARRAY];
};
-static int pair_cmp(const void *unused_cmp_data,
+static int pair_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
- const void *unused_keydata)
+ const void *keydata UNUSED)
{
const struct pair_entry *a, *b;
@@ -184,7 +195,7 @@ struct path_entry {
char path[FLEX_ARRAY];
};
-static int path_entry_cmp(const void *unused_cmp_data,
+static int path_entry_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *key)
@@ -292,7 +303,8 @@ static char *get_symlink(const struct object_id *oid, const char *path)
} else {
enum object_type type;
unsigned long size;
- data = read_object_file(oid, &type, &size);
+ data = repo_read_object_file(the_repository, oid, &type,
+ &size);
if (!data)
die(_("could not read object %s for symlink %s"),
oid_to_hex(oid), path);
@@ -358,10 +370,10 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
struct hashmap symlinks2 = HASHMAP_INIT(pair_cmp, NULL);
struct hashmap_iter iter;
struct pair_entry *entry;
- struct index_state wtindex;
+ struct index_state wtindex = INDEX_STATE_INIT(the_repository);
struct checkout lstate, rstate;
- int flags = RUN_GIT_CMD, err = 0;
- const char *helper_argv[] = { "difftool--helper", NULL, NULL, NULL };
+ int err = 0;
+ struct child_process cmd = CHILD_PROCESS_INIT;
struct hashmap wt_modified, tmp_modified;
int indices_loaded = 0;
@@ -384,8 +396,6 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
mkdir(ldir.buf, 0700);
mkdir(rdir.buf, 0700);
- memset(&wtindex, 0, sizeof(wtindex));
-
memset(&lstate, 0, sizeof(lstate));
lstate.base_dir = lbase_dir = xstrdup(ldir.buf);
lstate.base_dir_len = ldir.len;
@@ -563,16 +573,17 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
}
strbuf_setlen(&ldir, ldir_len);
- helper_argv[1] = ldir.buf;
strbuf_setlen(&rdir, rdir_len);
- helper_argv[2] = rdir.buf;
if (extcmd) {
- helper_argv[0] = extcmd;
- flags = 0;
- } else
+ strvec_push(&cmd.args, extcmd);
+ } else {
+ strvec_push(&cmd.args, "difftool--helper");
+ cmd.git_cmd = 1;
setenv("GIT_DIFFTOOL_DIRDIFF", "true", 1);
- ret = run_command_v_opt(helper_argv, flags);
+ }
+ strvec_pushl(&cmd.args, ldir.buf, rdir.buf, NULL);
+ ret = run_command(&cmd);
/* TODO: audit for interaction with sparse-index. */
ensure_full_index(&wtindex);
@@ -682,7 +693,7 @@ static int run_file_diff(int prompt, const char *prefix,
int cmd_difftool(int argc, const char **argv, const char *prefix)
{
- int use_gui_tool = 0, dir_diff = 0, prompt = -1, symlinks = 0,
+ int use_gui_tool = -1, dir_diff = 0, prompt = -1, symlinks = 0,
tool_help = 0, no_index = 0;
static char *difftool_cmd = NULL, *extcmd = NULL;
struct option builtin_difftool_options[] = {
@@ -716,7 +727,7 @@ int cmd_difftool(int argc, const char **argv, const char *prefix)
symlinks = has_symlinks;
argc = parse_options(argc, argv, prefix, builtin_difftool_options,
- builtin_difftool_usage, PARSE_OPT_KEEP_UNKNOWN |
+ builtin_difftool_usage, PARSE_OPT_KEEP_UNKNOWN_OPT |
PARSE_OPT_KEEP_DASHDASH);
if (tool_help)
@@ -732,13 +743,21 @@ int cmd_difftool(int argc, const char **argv, const char *prefix)
} else if (dir_diff)
die(_("options '%s' and '%s' cannot be used together"), "--dir-diff", "--no-index");
- die_for_incompatible_opt3(use_gui_tool, "--gui",
+ die_for_incompatible_opt3(use_gui_tool == 1, "--gui",
!!difftool_cmd, "--tool",
!!extcmd, "--extcmd");
- if (use_gui_tool)
+ /*
+ * Explicitly specified GUI option is forwarded to git-mergetool--lib.sh;
+ * empty or unset means "use the difftool.guiDefault config or default to
+ * false".
+ */
+ if (use_gui_tool == 1)
setenv("GIT_MERGETOOL_GUI", "true", 1);
- else if (difftool_cmd) {
+ else if (use_gui_tool == 0)
+ setenv("GIT_MERGETOOL_GUI", "false", 1);
+
+ if (difftool_cmd) {
if (*difftool_cmd)
setenv("GIT_DIFF_TOOL", difftool_cmd, 1);
else
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index e1748fb..4693d18 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -4,11 +4,13 @@
* Copyright (C) 2007 Johannes E. Schindelin
*/
#include "builtin.h"
-#include "cache.h"
#include "config.h"
+#include "gettext.h"
+#include "hex.h"
#include "refs.h"
#include "refspec.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
#include "commit.h"
#include "object.h"
#include "tag.h"
@@ -23,7 +25,6 @@
#include "quote.h"
#include "remote.h"
#include "blob.h"
-#include "commit-slab.h"
static const char *fast_export_usage[] = {
N_("git fast-export [<rev-list-opts>]"),
@@ -31,9 +32,9 @@ static const char *fast_export_usage[] = {
};
static int progress;
-static enum { SIGNED_TAG_ABORT, VERBATIM, WARN, WARN_STRIP, STRIP } signed_tag_mode = SIGNED_TAG_ABORT;
-static enum { TAG_FILTERING_ABORT, DROP, REWRITE } tag_of_filtered_mode = TAG_FILTERING_ABORT;
-static enum { REENCODE_ABORT, REENCODE_YES, REENCODE_NO } reencode_mode = REENCODE_ABORT;
+static enum signed_tag_mode { SIGNED_TAG_ABORT, VERBATIM, WARN, WARN_STRIP, STRIP } signed_tag_mode = SIGNED_TAG_ABORT;
+static enum tag_of_filtered_mode { TAG_FILTERING_ABORT, DROP, REWRITE } tag_of_filtered_mode = TAG_FILTERING_ABORT;
+static enum reencode_mode { REENCODE_ABORT, REENCODE_YES, REENCODE_NO } reencode_mode = REENCODE_ABORT;
static int fake_missing_tagger;
static int use_done_feature;
static int no_data;
@@ -51,16 +52,18 @@ static struct revision_sources revision_sources;
static int parse_opt_signed_tag_mode(const struct option *opt,
const char *arg, int unset)
{
+ enum signed_tag_mode *val = opt->value;
+
if (unset || !strcmp(arg, "abort"))
- signed_tag_mode = SIGNED_TAG_ABORT;
+ *val = SIGNED_TAG_ABORT;
else if (!strcmp(arg, "verbatim") || !strcmp(arg, "ignore"))
- signed_tag_mode = VERBATIM;
+ *val = VERBATIM;
else if (!strcmp(arg, "warn"))
- signed_tag_mode = WARN;
+ *val = WARN;
else if (!strcmp(arg, "warn-strip"))
- signed_tag_mode = WARN_STRIP;
+ *val = WARN_STRIP;
else if (!strcmp(arg, "strip"))
- signed_tag_mode = STRIP;
+ *val = STRIP;
else
return error("Unknown signed-tags mode: %s", arg);
return 0;
@@ -69,12 +72,14 @@ static int parse_opt_signed_tag_mode(const struct option *opt,
static int parse_opt_tag_of_filtered_mode(const struct option *opt,
const char *arg, int unset)
{
+ enum tag_of_filtered_mode *val = opt->value;
+
if (unset || !strcmp(arg, "abort"))
- tag_of_filtered_mode = TAG_FILTERING_ABORT;
+ *val = TAG_FILTERING_ABORT;
else if (!strcmp(arg, "drop"))
- tag_of_filtered_mode = DROP;
+ *val = DROP;
else if (!strcmp(arg, "rewrite"))
- tag_of_filtered_mode = REWRITE;
+ *val = REWRITE;
else
return error("Unknown tag-of-filtered mode: %s", arg);
return 0;
@@ -83,21 +88,23 @@ static int parse_opt_tag_of_filtered_mode(const struct option *opt,
static int parse_opt_reencode_mode(const struct option *opt,
const char *arg, int unset)
{
+ enum reencode_mode *val = opt->value;
+
if (unset) {
- reencode_mode = REENCODE_ABORT;
+ *val = REENCODE_ABORT;
return 0;
}
switch (git_parse_maybe_bool(arg)) {
case 0:
- reencode_mode = REENCODE_NO;
+ *val = REENCODE_NO;
break;
case 1:
- reencode_mode = REENCODE_YES;
+ *val = REENCODE_YES;
break;
default:
if (!strcasecmp(arg, "abort"))
- reencode_mode = REENCODE_ABORT;
+ *val = REENCODE_ABORT;
else
return error("Unknown reencoding mode: %s", arg);
}
@@ -109,7 +116,7 @@ static struct decoration idnums;
static uint32_t last_idnum;
struct anonymized_entry {
struct hashmap_entry hash;
- const char *anon;
+ char *anon;
const char orig[FLEX_ARRAY];
};
@@ -119,7 +126,7 @@ struct anonymized_entry_key {
size_t orig_len;
};
-static int anonymized_entry_cmp(const void *unused_cmp_data,
+static int anonymized_entry_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *keydata)
@@ -129,8 +136,7 @@ static int anonymized_entry_cmp(const void *unused_cmp_data,
a = container_of(eptr, const struct anonymized_entry, hash);
if (keydata) {
const struct anonymized_entry_key *key = keydata;
- int equal = !strncmp(a->orig, key->orig, key->orig_len) &&
- !a->orig[key->orig_len];
+ int equal = !xstrncmpz(a->orig, key->orig, key->orig_len);
return !equal;
}
@@ -138,43 +144,56 @@ static int anonymized_entry_cmp(const void *unused_cmp_data,
return strcmp(a->orig, b->orig);
}
+static struct anonymized_entry *add_anonymized_entry(struct hashmap *map,
+ unsigned hash,
+ const char *orig, size_t len,
+ char *anon)
+{
+ struct anonymized_entry *ret, *old;
+
+ if (!map->cmpfn)
+ hashmap_init(map, anonymized_entry_cmp, NULL, 0);
+
+ FLEX_ALLOC_MEM(ret, orig, orig, len);
+ hashmap_entry_init(&ret->hash, hash);
+ ret->anon = anon;
+ old = hashmap_put_entry(map, ret, hash);
+
+ if (old) {
+ free(old->anon);
+ free(old);
+ }
+
+ return ret;
+}
+
/*
* Basically keep a cache of X->Y so that we can repeatedly replace
* the same anonymized string with another. The actual generation
* is farmed out to the generate function.
*/
static const char *anonymize_str(struct hashmap *map,
- char *(*generate)(void *),
- const char *orig, size_t len,
- void *data)
+ char *(*generate)(void),
+ const char *orig, size_t len)
{
struct anonymized_entry_key key;
struct anonymized_entry *ret;
- if (!map->cmpfn)
- hashmap_init(map, anonymized_entry_cmp, NULL, 0);
-
hashmap_entry_init(&key.hash, memhash(orig, len));
key.orig = orig;
key.orig_len = len;
/* First check if it's a token the user configured manually... */
- if (anonymized_seeds.cmpfn)
- ret = hashmap_get_entry(&anonymized_seeds, &key, hash, &key);
- else
- ret = NULL;
+ ret = hashmap_get_entry(&anonymized_seeds, &key, hash, &key);
/* ...otherwise check if we've already seen it in this context... */
if (!ret)
ret = hashmap_get_entry(map, &key, hash, &key);
/* ...and finally generate a new mapping if necessary */
- if (!ret) {
- FLEX_ALLOC_MEM(ret, orig, orig, len);
- hashmap_entry_init(&ret->hash, key.hash.hash);
- ret->anon = generate(data);
- hashmap_put(map, &ret->hash);
- }
+ if (!ret)
+ ret = add_anonymized_entry(map, key.hash.hash,
+ orig, len, generate());
return ret->anon;
}
@@ -187,12 +206,12 @@ static const char *anonymize_str(struct hashmap *map,
*/
static void anonymize_path(struct strbuf *out, const char *path,
struct hashmap *map,
- char *(*generate)(void *))
+ char *(*generate)(void))
{
while (*path) {
const char *end_of_component = strchrnul(path, '/');
size_t len = end_of_component - path;
- const char *c = anonymize_str(map, generate, path, len, NULL);
+ const char *c = anonymize_str(map, generate, path, len);
strbuf_addstr(out, c);
path = end_of_component;
if (*path)
@@ -296,7 +315,7 @@ static void export_blob(const struct object_id *oid)
object = (struct object *)lookup_blob(the_repository, oid);
eaten = 0;
} else {
- buf = read_object_file(oid, &type, &size);
+ buf = repo_read_object_file(the_repository, oid, &type, &size);
if (!buf)
die("could not read blob %s", oid_to_hex(oid));
if (check_object_signature(the_repository, oid, buf, size,
@@ -367,7 +386,7 @@ static void print_path_1(const char *path)
printf("%s", path);
}
-static char *anonymize_path_component(void *data)
+static char *anonymize_path_component(void)
{
static int counter;
struct strbuf out = STRBUF_INIT;
@@ -389,7 +408,7 @@ static void print_path(const char *path)
}
}
-static char *generate_fake_oid(void *data)
+static char *generate_fake_oid(void)
{
static uint32_t counter = 1; /* avoid null oid */
const unsigned hashsz = the_hash_algo->rawsz;
@@ -405,11 +424,11 @@ static const char *anonymize_oid(const char *oid_hex)
{
static struct hashmap objs;
size_t len = strlen(oid_hex);
- return anonymize_str(&objs, generate_fake_oid, oid_hex, len, NULL);
+ return anonymize_str(&objs, generate_fake_oid, oid_hex, len);
}
static void show_filemodify(struct diff_queue_struct *q,
- struct diff_options *options, void *data)
+ struct diff_options *options UNUSED, void *data)
{
int i;
struct string_list *changed = data;
@@ -502,7 +521,7 @@ static const char *find_encoding(const char *begin, const char *end)
return bol;
}
-static char *anonymize_ref_component(void *data)
+static char *anonymize_ref_component(void)
{
static int counter;
struct strbuf out = STRBUF_INIT;
@@ -542,13 +561,13 @@ static const char *anonymize_refname(const char *refname)
* We do not even bother to cache commit messages, as they are unlikely
* to be repeated verbatim, and it is not that interesting when they are.
*/
-static char *anonymize_commit_message(const char *old)
+static char *anonymize_commit_message(void)
{
static int counter;
return xstrfmt("subject %d\n\nbody\n", counter++);
}
-static char *anonymize_ident(void *data)
+static char *anonymize_ident(void)
{
static int counter;
struct strbuf out = STRBUF_INIT;
@@ -591,7 +610,7 @@ static void anonymize_ident_line(const char **beg, const char **end)
len = split.mail_end - split.name_begin;
ident = anonymize_str(&idents, anonymize_ident,
- split.name_begin, len, NULL);
+ split.name_begin, len);
strbuf_addstr(out, ident);
strbuf_addch(out, ' ');
strbuf_add(out, split.date_begin, split.tz_end - split.date_begin);
@@ -618,7 +637,7 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,
rev->diffopt.output_format = DIFF_FORMAT_CALLBACK;
parse_commit_or_die(commit);
- commit_buffer = get_commit_buffer(commit, NULL);
+ commit_buffer = repo_get_commit_buffer(the_repository, commit, NULL);
author = strstr(commit_buffer, "\nauthor ");
if (!author)
die("could not find author in commit %s",
@@ -669,7 +688,7 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,
mark_next_object(&commit->object);
if (anonymize) {
- reencoded = anonymize_commit_message(message);
+ reencoded = anonymize_commit_message();
} else if (encoding) {
switch(reencode_mode) {
case REENCODE_YES:
@@ -699,7 +718,7 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,
? strlen(message) : 0),
reencoded ? reencoded : message ? message : "");
free(reencoded);
- unuse_commit_buffer(commit, commit_buffer);
+ repo_unuse_commit_buffer(the_repository, commit, commit_buffer);
for (i = 0, p = commit->parents; p; p = p->next) {
struct object *obj = &p->item->object;
@@ -732,7 +751,7 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,
show_progress();
}
-static char *anonymize_tag(void *data)
+static char *anonymize_tag(void)
{
static int counter;
struct strbuf out = STRBUF_INIT;
@@ -766,7 +785,8 @@ static void handle_tag(const char *name, struct tag *tag)
return;
}
- buf = read_object_file(&tag->object.oid, &type, &size);
+ buf = repo_read_object_file(the_repository, &tag->object.oid, &type,
+ &size);
if (!buf)
die("could not read tag %s", oid_to_hex(&tag->object.oid));
message = memmem(buf, size, "\n\n", 2);
@@ -794,7 +814,7 @@ static void handle_tag(const char *name, struct tag *tag)
if (message) {
static struct hashmap tags;
message = anonymize_str(&tags, anonymize_tag,
- message, message_size, NULL);
+ message, message_size);
message_size = strlen(message);
}
}
@@ -917,7 +937,8 @@ static void get_tags_and_duplicates(struct rev_cmdline_info *info)
if (e->flags & UNINTERESTING)
continue;
- if (dwim_ref(e->name, strlen(e->name), &oid, &full_name, 0) != 1)
+ if (repo_dwim_ref(the_repository, e->name, strlen(e->name),
+ &oid, &full_name, 0) != 1)
continue;
if (refspecs.nr) {
@@ -1125,11 +1146,6 @@ static void handle_deletes(void)
}
}
-static char *anonymize_seed(void *data)
-{
- return xstrdup(data);
-}
-
static int parse_opt_anonymize_map(const struct option *opt,
const char *arg, int unset)
{
@@ -1151,7 +1167,8 @@ static int parse_opt_anonymize_map(const struct option *opt,
if (!keylen || !*value)
return error(_("--anonymize-map token cannot be empty"));
- anonymize_str(map, anonymize_seed, arg, keylen, (void *)value);
+ add_anonymized_entry(map, memhash(arg, keylen), arg, keylen,
+ xstrdup(value));
return 0;
}
@@ -1221,7 +1238,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
revs.sources = &revision_sources;
revs.rewrite_parents = 1;
argc = parse_options(argc, argv, prefix, options, fast_export_usage,
- PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN);
+ PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN_OPT);
argc = setup_revisions(argc, argv, &revs, NULL);
if (argc > 1)
usage_with_options (fast_export_usage, options);
diff --git a/builtin/fast-import.c b/builtin/fast-import.c
index 14113cf..782bda0 100644
--- a/builtin/fast-import.c
+++ b/builtin/fast-import.c
@@ -1,5 +1,8 @@
#include "builtin.h"
-#include "cache.h"
+#include "abspath.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "lockfile.h"
@@ -9,13 +12,16 @@
#include "commit.h"
#include "delta.h"
#include "pack.h"
+#include "path.h"
#include "refs.h"
#include "csum-file.h"
#include "quote.h"
#include "dir.h"
#include "run-command.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "mem-pool.h"
#include "commit-reach.h"
#include "khash.h"
@@ -46,7 +52,7 @@ struct object_entry {
depth : DEPTH_BITS;
};
-static int object_entry_hashcmp(const void *map_data,
+static int object_entry_hashcmp(const void *map_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *keydata)
@@ -175,6 +181,7 @@ static FILE *pack_edges;
static unsigned int show_stats = 1;
static int global_argc;
static const char **global_argv;
+static const char *global_prefix;
/* Memory pools */
static struct mem_pool fi_mem_pool = {
@@ -436,7 +443,7 @@ static void set_checkpoint_signal(void)
#else
-static void checkpoint_signal(int signo)
+static void checkpoint_signal(int signo UNUSED)
{
checkpoint_requested = 1;
}
@@ -1095,6 +1102,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);
hashfile_checkpoint(pack_file, &checkpoint);
offset = checkpoint.offset;
@@ -1228,20 +1236,6 @@ static void *gfi_unpack_entry(
return unpack_entry(the_repository, p, oe->idx.offset, &type, sizep);
}
-static const char *get_mode(const char *str, uint16_t *modep)
-{
- unsigned char c;
- uint16_t mode = 0;
-
- while ((c = *str++) != ' ') {
- if (c < '0' || c > '7')
- return NULL;
- mode = (mode << 3) + (c - '0');
- }
- *modep = mode;
- return str;
-}
-
static void load_tree(struct tree_entry *root)
{
struct object_id *oid = &root->versions[1].oid;
@@ -1265,7 +1259,7 @@ static void load_tree(struct tree_entry *root)
die("Can't load tree %s", oid_to_hex(oid));
} else {
enum object_type type;
- buf = read_object_file(oid, &type, &size);
+ buf = repo_read_object_file(the_repository, oid, &type, &size);
if (!buf || type != OBJ_TREE)
die("Can't load tree %s", oid_to_hex(oid));
}
@@ -1279,7 +1273,7 @@ static void load_tree(struct tree_entry *root)
t->entries[t->entry_count++] = e;
e->tree = NULL;
- c = get_mode(c, &e->versions[1].mode);
+ c = parse_mode(c, &e->versions[1].mode);
if (!c)
die("Corrupt mode in %s", oid_to_hex(oid));
e->versions[0].mode = e->versions[1].mode;
@@ -1617,6 +1611,7 @@ static int update_branch(struct branch *b)
oidclr(&old_oid);
if (!force_update && !is_null_oid(&old_oid)) {
struct commit *old_cmit, *new_cmit;
+ int ret;
old_cmit = lookup_commit_reference_gently(the_repository,
&old_oid, 0);
@@ -1625,7 +1620,10 @@ static int update_branch(struct branch *b)
if (!old_cmit || !new_cmit)
return error("Branch %s is missing commits.", b->name);
- if (!in_merge_bases(old_cmit, new_cmit)) {
+ ret = repo_in_merge_bases(the_repository, old_cmit, new_cmit);
+ if (ret < 0)
+ exit(128);
+ if (!ret) {
warning("Not updating %s"
" (new tip %s does not contain %s)",
b->name, oid_to_hex(&b->oid),
@@ -2268,7 +2266,7 @@ static void file_change_m(const char *p, struct branch *b)
struct object_id oid;
uint16_t mode, inline_data = 0;
- p = get_mode(p, &mode);
+ p = parse_mode(p, &mode);
if (!p)
die("Corrupt mode: %s", command_buf.buf);
switch (mode) {
@@ -2486,7 +2484,7 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa
if (commit_oe->type != OBJ_COMMIT)
die("Mark :%" PRIuMAX " not a commit", commit_mark);
oidcpy(&commit_oid, &commit_oe->idx.oid);
- } else if (!get_oid(p, &commit_oid)) {
+ } else if (!repo_get_oid(the_repository, p, &commit_oid)) {
unsigned long size;
char *buf = read_object_with_reference(the_repository,
&commit_oid,
@@ -2599,7 +2597,7 @@ static int parse_objectish(struct branch *b, const char *objectish)
} else
parse_from_existing(b);
}
- } else if (!get_oid(objectish, &b->oid)) {
+ } else if (!repo_get_oid(the_repository, objectish, &b->oid)) {
parse_from_existing(b);
if (is_null_oid(&b->oid))
b->delete = 1;
@@ -2654,7 +2652,7 @@ static struct hash_list *parse_merge(unsigned int *count)
if (oe->type != OBJ_COMMIT)
die("Mark :%" PRIuMAX " not a commit", idnum);
oidcpy(&n->oid, &oe->idx.oid);
- } else if (!get_oid(from, &n->oid)) {
+ } else if (!repo_get_oid(the_repository, from, &n->oid)) {
unsigned long size;
char *buf = read_object_with_reference(the_repository,
&n->oid,
@@ -2801,8 +2799,7 @@ static void parse_new_tag(const char *arg)
enum object_type type;
const char *v;
- t = mem_pool_alloc(&fi_mem_pool, sizeof(struct tag));
- memset(t, 0, sizeof(struct tag));
+ t = mem_pool_calloc(&fi_mem_pool, 1, sizeof(struct tag));
t->name = mem_pool_strdup(&fi_mem_pool, arg);
if (last_tag)
last_tag->next_tag = t;
@@ -2827,7 +2824,7 @@ static void parse_new_tag(const char *arg)
oe = find_mark(marks, from_mark);
type = oe->type;
oidcpy(&oid, &oe->idx.oid);
- } else if (!get_oid(from, &oid)) {
+ } else if (!repo_get_oid(the_repository, from, &oid)) {
struct object_entry *oe = find_object(&oid);
if (!oe) {
type = oid_object_info(the_repository, &oid, NULL);
@@ -2936,7 +2933,7 @@ static void cat_blob(struct object_entry *oe, struct object_id *oid)
char *buf;
if (!oe || oe->pack_id == MAX_PACK_ID) {
- buf = read_object_file(oid, &type, &size);
+ buf = repo_read_object_file(the_repository, oid, &type, &size);
} else {
type = oe->type;
buf = gfi_unpack_entry(oe, &size);
@@ -3044,7 +3041,8 @@ static struct object_entry *dereference(struct object_entry *oe,
buf = gfi_unpack_entry(oe, &size);
} else {
enum object_type unused;
- buf = read_object_file(oid, &unused, &size);
+ buf = repo_read_object_file(the_repository, oid, &unused,
+ &size);
}
if (!buf)
die("Can't load object %s", oid_to_hex(oid));
@@ -3245,7 +3243,7 @@ static void parse_alias(void)
static char* make_fast_import_path(const char *path)
{
if (!relative_marks_paths || is_absolute_path(path))
- return xstrdup(path);
+ return prefix_filename(global_prefix, path);
return git_pathdup("info/fast-import/%s", path);
}
@@ -3316,9 +3314,11 @@ static void option_cat_blob_fd(const char *fd)
static void option_export_pack_edges(const char *edges)
{
+ char *fn = prefix_filename(global_prefix, edges);
if (pack_edges)
fclose(pack_edges);
- pack_edges = xfopen(edges, "a");
+ pack_edges = xfopen(fn, "a");
+ free(fn);
}
static void option_rewrite_submodules(const char *arg, struct string_list *list)
@@ -3333,11 +3333,13 @@ static void option_rewrite_submodules(const char *arg, struct string_list *list)
f++;
CALLOC_ARRAY(ms, 1);
+ f = prefix_filename(global_prefix, f);
fp = fopen(f, "r");
if (!fp)
die_errno("cannot read '%s'", f);
read_mark_file(&ms, fp, insert_oid_entry);
fclose(fp);
+ free(f);
string_list_insert(list, s)->util = ms;
}
@@ -3551,6 +3553,7 @@ int cmd_fast_import(int argc, const char **argv, const char *prefix)
global_argc = argc;
global_argv = argv;
+ global_prefix = prefix;
rc_free = mem_pool_alloc(&fi_mem_pool, cmd_save * sizeof(*rc_free));
for (i = 0; i < (cmd_save - 1); i++)
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index f045bbb..44c05ee 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -1,4 +1,7 @@
#include "builtin.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-file.h"
#include "pkt-line.h"
#include "fetch-pack.h"
#include "remote.h"
@@ -40,7 +43,7 @@ static void add_sought_entry(struct ref ***sought, int *nr, int *alloc,
(*sought)[*nr - 1] = ref;
}
-int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
+int cmd_fetch_pack(int argc, const char **argv, const char *prefix UNUSED)
{
int i, ret;
struct ref *ref = NULL;
@@ -62,6 +65,7 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
packet_trace_identity("fetch-pack");
memset(&args, 0, sizeof(args));
+ list_objects_filter_init(&args.filter_options);
args.uploadpack = "git-upload-pack";
for (i = 1; i < argc && *argv[i] == '-'; i++) {
@@ -210,8 +214,8 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
int flags = args.verbose ? CONNECT_VERBOSE : 0;
if (args.diag_url)
flags |= CONNECT_DIAG_URL;
- conn = git_connect(fd, dest, args.uploadpack,
- flags);
+ conn = git_connect(fd, dest, "git-upload-pack",
+ args.uploadpack, flags);
if (!conn)
return args.diag_url ? 0 : 1;
}
diff --git a/builtin/fetch.c b/builtin/fetch.c
index ac29c2b..5857d86 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -1,15 +1,20 @@
/*
* "git fetch"
*/
-#include "cache.h"
+#include "builtin.h"
+#include "advice.h"
#include "config.h"
+#include "gettext.h"
+#include "environment.h"
+#include "hex.h"
#include "repository.h"
#include "refs.h"
#include "refspec.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "oidset.h"
+#include "oid-array.h"
#include "commit.h"
-#include "builtin.h"
#include "string-list.h"
#include "remote.h"
#include "transport.h"
@@ -21,14 +26,18 @@
#include "connected.h"
#include "strvec.h"
#include "utf8.h"
-#include "packfile.h"
+#include "pager.h"
+#include "path.h"
+#include "pkt-line.h"
#include "list-objects-filter-options.h"
#include "commit-reach.h"
#include "branch.h"
#include "promisor-remote.h"
#include "commit-graph.h"
#include "shallow.h"
-#include "worktree.h"
+#include "trace.h"
+#include "trace2.h"
+#include "bundle-uri.h"
#define FORCED_UPDATES_DELAY_WARNING_IN_MS (10 * 1000)
@@ -46,25 +55,35 @@ enum {
TAGS_SET = 2
};
-static int fetch_prune_config = -1; /* unspecified */
-static int fetch_show_forced_updates = 1;
+enum display_format {
+ DISPLAY_FORMAT_FULL,
+ DISPLAY_FORMAT_COMPACT,
+ DISPLAY_FORMAT_PORCELAIN,
+};
+
+struct display_state {
+ struct strbuf buf;
+
+ int refcol_width;
+ enum display_format format;
+
+ char *url;
+ int url_len, shown_url;
+};
+
static uint64_t forced_updates_ms = 0;
static int prefetch = 0;
static int prune = -1; /* unspecified */
#define PRUNE_BY_DEFAULT 0 /* do we prune by default? */
-static int fetch_prune_tags_config = -1; /* unspecified */
static int prune_tags = -1; /* unspecified */
#define PRUNE_TAGS_BY_DEFAULT 0 /* do we prune tags by default? */
-static int all, append, dry_run, force, keep, multiple, update_head_ok;
+static int append, dry_run, force, keep, update_head_ok;
static int write_fetch_head = 1;
static int verbosity, deepen_relative, set_upstream, refetch;
static int progress = -1;
-static int enable_auto_gc = 1;
-static int tags = TAGS_DEFAULT, unshallow, update_shallow, deepen;
-static int max_jobs = -1, submodule_fetch_jobs_config = -1;
-static int fetch_parallel_config = 1;
+static int tags = TAGS_DEFAULT, update_shallow, deepen;
static int atomic_fetch;
static enum transport_family family;
static const char *depth;
@@ -74,58 +93,84 @@ static struct string_list deepen_not = STRING_LIST_INIT_NODUP;
static struct strbuf default_rla = STRBUF_INIT;
static struct transport *gtransport;
static struct transport *gsecondary;
-static const char *submodule_prefix = "";
-static int recurse_submodules = RECURSE_SUBMODULES_DEFAULT;
-static int recurse_submodules_cli = RECURSE_SUBMODULES_DEFAULT;
-static int recurse_submodules_default = RECURSE_SUBMODULES_ON_DEMAND;
-static int shown_url = 0;
static struct refspec refmap = REFSPEC_INIT_FETCH;
-static struct list_objects_filter_options filter_options;
+static struct list_objects_filter_options filter_options = LIST_OBJECTS_FILTER_INIT;
static struct string_list server_options = STRING_LIST_INIT_DUP;
static struct string_list negotiation_tip = STRING_LIST_INIT_NODUP;
-static int fetch_write_commit_graph = -1;
-static int stdin_refspecs = 0;
-static int negotiate_only;
-static int git_fetch_config(const char *k, const char *v, void *cb)
+struct fetch_config {
+ enum display_format display_format;
+ int all;
+ int prune;
+ int prune_tags;
+ int show_forced_updates;
+ int recurse_submodules;
+ int parallel;
+ int submodule_fetch_jobs;
+};
+
+static int git_fetch_config(const char *k, const char *v,
+ const struct config_context *ctx, void *cb)
{
+ struct fetch_config *fetch_config = cb;
+
+ if (!strcmp(k, "fetch.all")) {
+ fetch_config->all = git_config_bool(k, v);
+ return 0;
+ }
+
if (!strcmp(k, "fetch.prune")) {
- fetch_prune_config = git_config_bool(k, v);
+ fetch_config->prune = git_config_bool(k, v);
return 0;
}
if (!strcmp(k, "fetch.prunetags")) {
- fetch_prune_tags_config = git_config_bool(k, v);
+ fetch_config->prune_tags = git_config_bool(k, v);
return 0;
}
if (!strcmp(k, "fetch.showforcedupdates")) {
- fetch_show_forced_updates = git_config_bool(k, v);
+ fetch_config->show_forced_updates = git_config_bool(k, v);
return 0;
}
if (!strcmp(k, "submodule.recurse")) {
int r = git_config_bool(k, v) ?
RECURSE_SUBMODULES_ON : RECURSE_SUBMODULES_OFF;
- recurse_submodules = r;
+ fetch_config->recurse_submodules = r;
+ return 0;
}
if (!strcmp(k, "submodule.fetchjobs")) {
- submodule_fetch_jobs_config = parse_submodule_fetchjobs(k, v);
+ fetch_config->submodule_fetch_jobs = parse_submodule_fetchjobs(k, v, ctx->kvi);
return 0;
} else if (!strcmp(k, "fetch.recursesubmodules")) {
- recurse_submodules = parse_fetch_recurse_submodules_arg(k, v);
+ fetch_config->recurse_submodules = parse_fetch_recurse_submodules_arg(k, v);
return 0;
}
if (!strcmp(k, "fetch.parallel")) {
- fetch_parallel_config = git_config_int(k, v);
- if (fetch_parallel_config < 0)
+ fetch_config->parallel = git_config_int(k, v, ctx->kvi);
+ if (fetch_config->parallel < 0)
die(_("fetch.parallel cannot be negative"));
+ if (!fetch_config->parallel)
+ fetch_config->parallel = online_cpus();
return 0;
}
- return git_default_config(k, v, cb);
+ if (!strcmp(k, "fetch.output")) {
+ if (!v)
+ return config_error_nonbool(k);
+ else if (!strcasecmp(v, "full"))
+ fetch_config->display_format = DISPLAY_FORMAT_FULL;
+ else if (!strcasecmp(v, "compact"))
+ fetch_config->display_format = DISPLAY_FORMAT_COMPACT;
+ else
+ die(_("invalid value for '%s': '%s'"),
+ "fetch.output", v);
+ }
+
+ return git_default_config(k, v, ctx, cb);
}
static int parse_refmap_arg(const struct option *opt, const char *arg, int unset)
@@ -136,97 +181,11 @@ static int parse_refmap_arg(const struct option *opt, const char *arg, int unset
* "git fetch --refmap='' origin foo"
* can be used to tell the command not to store anywhere
*/
- refspec_append(&refmap, arg);
+ refspec_append(opt->value, arg);
return 0;
}
-static struct option builtin_fetch_options[] = {
- OPT__VERBOSITY(&verbosity),
- OPT_BOOL(0, "all", &all,
- N_("fetch from all remotes")),
- OPT_BOOL(0, "set-upstream", &set_upstream,
- N_("set upstream for git pull/fetch")),
- OPT_BOOL('a', "append", &append,
- N_("append to .git/FETCH_HEAD instead of overwriting")),
- OPT_BOOL(0, "atomic", &atomic_fetch,
- N_("use atomic transaction to update references")),
- OPT_STRING(0, "upload-pack", &upload_pack, N_("path"),
- N_("path to upload pack on remote end")),
- OPT__FORCE(&force, N_("force overwrite of local reference"), 0),
- OPT_BOOL('m', "multiple", &multiple,
- N_("fetch from multiple remotes")),
- OPT_SET_INT('t', "tags", &tags,
- N_("fetch all tags and associated objects"), TAGS_SET),
- OPT_SET_INT('n', NULL, &tags,
- N_("do not fetch all tags (--no-tags)"), TAGS_UNSET),
- OPT_INTEGER('j', "jobs", &max_jobs,
- N_("number of submodules fetched in parallel")),
- OPT_BOOL(0, "prefetch", &prefetch,
- N_("modify the refspec to place all refs within refs/prefetch/")),
- OPT_BOOL('p', "prune", &prune,
- N_("prune remote-tracking branches no longer on remote")),
- OPT_BOOL('P', "prune-tags", &prune_tags,
- N_("prune local tags no longer on remote and clobber changed tags")),
- OPT_CALLBACK_F(0, "recurse-submodules", &recurse_submodules_cli, N_("on-demand"),
- N_("control recursive fetching of submodules"),
- PARSE_OPT_OPTARG, option_fetch_parse_recurse_submodules),
- OPT_BOOL(0, "dry-run", &dry_run,
- N_("dry run")),
- OPT_BOOL(0, "write-fetch-head", &write_fetch_head,
- N_("write fetched references to the FETCH_HEAD file")),
- OPT_BOOL('k', "keep", &keep, N_("keep downloaded pack")),
- OPT_BOOL('u', "update-head-ok", &update_head_ok,
- N_("allow updating of HEAD ref")),
- OPT_BOOL(0, "progress", &progress, N_("force progress reporting")),
- OPT_STRING(0, "depth", &depth, N_("depth"),
- N_("deepen history of shallow clone")),
- OPT_STRING(0, "shallow-since", &deepen_since, N_("time"),
- N_("deepen history of shallow repository based on time")),
- OPT_STRING_LIST(0, "shallow-exclude", &deepen_not, N_("revision"),
- N_("deepen history of shallow clone, excluding rev")),
- OPT_INTEGER(0, "deepen", &deepen_relative,
- N_("deepen history of shallow clone")),
- OPT_SET_INT_F(0, "unshallow", &unshallow,
- N_("convert to a complete repository"),
- 1, PARSE_OPT_NONEG),
- OPT_SET_INT_F(0, "refetch", &refetch,
- N_("re-fetch without negotiating common commits"),
- 1, PARSE_OPT_NONEG),
- { OPTION_STRING, 0, "submodule-prefix", &submodule_prefix, N_("dir"),
- N_("prepend this to submodule path output"), PARSE_OPT_HIDDEN },
- OPT_CALLBACK_F(0, "recurse-submodules-default",
- &recurse_submodules_default, N_("on-demand"),
- N_("default for recursive fetching of submodules "
- "(lower priority than config files)"),
- PARSE_OPT_HIDDEN, option_fetch_parse_recurse_submodules),
- OPT_BOOL(0, "update-shallow", &update_shallow,
- N_("accept refs that update .git/shallow")),
- OPT_CALLBACK_F(0, "refmap", NULL, N_("refmap"),
- N_("specify fetch refmap"), PARSE_OPT_NONEG, parse_refmap_arg),
- OPT_STRING_LIST('o', "server-option", &server_options, N_("server-specific"), N_("option to transmit")),
- OPT_SET_INT('4', "ipv4", &family, N_("use IPv4 addresses only"),
- TRANSPORT_FAMILY_IPV4),
- OPT_SET_INT('6', "ipv6", &family, N_("use IPv6 addresses only"),
- TRANSPORT_FAMILY_IPV6),
- OPT_STRING_LIST(0, "negotiation-tip", &negotiation_tip, N_("revision"),
- N_("report that we have only objects reachable from this object")),
- OPT_BOOL(0, "negotiate-only", &negotiate_only,
- N_("do not fetch a packfile; instead, print ancestors of negotiation tips")),
- OPT_PARSE_LIST_OBJECTS_FILTER(&filter_options),
- OPT_BOOL(0, "auto-maintenance", &enable_auto_gc,
- N_("run 'maintenance --auto' after fetching")),
- OPT_BOOL(0, "auto-gc", &enable_auto_gc,
- N_("run 'maintenance --auto' after fetching")),
- OPT_BOOL(0, "show-forced-updates", &fetch_show_forced_updates,
- N_("check for forced-updates on all updated branches")),
- OPT_BOOL(0, "write-commit-graph", &fetch_write_commit_graph,
- N_("write the commit-graph after fetching")),
- OPT_BOOL(0, "stdin", &stdin_refspecs,
- N_("accept refspecs from stdin")),
- OPT_END()
-};
-
static void unlock_pack(unsigned int flags)
{
if (gtransport)
@@ -301,7 +260,7 @@ struct refname_hash_entry {
char refname[FLEX_ARRAY];
};
-static int refname_hash_entry_cmp(const void *hashmap_cmp_fn_data,
+static int refname_hash_entry_cmp(const void *hashmap_cmp_fn_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *keydata)
@@ -329,7 +288,7 @@ static struct refname_hash_entry *refname_hash_add(struct hashmap *map,
static int add_one_refname(const char *refname,
const struct object_id *oid,
- int flag, void *cbdata)
+ int flag UNUSED, void *cbdata)
{
struct hashmap *refname_map = cbdata;
@@ -354,7 +313,7 @@ static void clear_item(struct refname_hash_entry *item)
static void add_already_queued_tags(const char *refname,
- const struct object_id *old_oid,
+ const struct object_id *old_oid UNUSED,
const struct object_id *new_oid,
void *cb_data)
{
@@ -404,9 +363,9 @@ static void find_non_local_tags(const struct ref *refs,
*/
if (ends_with(ref->name, "^{}")) {
if (item &&
- !has_object_file_with_flags(&ref->old_oid, quick_flags) &&
+ !repo_has_object_file_with_flags(the_repository, &ref->old_oid, quick_flags) &&
!oidset_contains(&fetch_oids, &ref->old_oid) &&
- !has_object_file_with_flags(&item->oid, quick_flags) &&
+ !repo_has_object_file_with_flags(the_repository, &item->oid, quick_flags) &&
!oidset_contains(&fetch_oids, &item->oid))
clear_item(item);
item = NULL;
@@ -420,7 +379,7 @@ static void find_non_local_tags(const struct ref *refs,
* fetch.
*/
if (item &&
- !has_object_file_with_flags(&item->oid, quick_flags) &&
+ !repo_has_object_file_with_flags(the_repository, &item->oid, quick_flags) &&
!oidset_contains(&fetch_oids, &item->oid))
clear_item(item);
@@ -441,7 +400,7 @@ static void find_non_local_tags(const struct ref *refs,
* checked to see if it needs fetching.
*/
if (item &&
- !has_object_file_with_flags(&item->oid, quick_flags) &&
+ !repo_has_object_file_with_flags(the_repository, &item->oid, quick_flags) &&
!oidset_contains(&fetch_oids, &item->oid))
clear_item(item);
@@ -490,7 +449,8 @@ static void filter_prefetch_refspec(struct refspec *rs)
continue;
if (!rs->items[i].dst ||
(rs->items[i].src &&
- !strncmp(rs->items[i].src, "refs/tags/", 10))) {
+ starts_with(rs->items[i].src,
+ ref_namespace[NAMESPACE_TAGS].ref))) {
int j;
free(rs->items[i].src);
@@ -506,7 +466,7 @@ static void filter_prefetch_refspec(struct refspec *rs)
}
old_dst = rs->items[i].dst;
- strbuf_addstr(&new_dst, "refs/prefetch/");
+ strbuf_addstr(&new_dst, ref_namespace[NAMESPACE_PREFETCH].ref);
/*
* If old_dst starts with "refs/", then place
@@ -736,76 +696,97 @@ out:
return ret;
}
-static int refcol_width = 10;
-static int compact_format;
-
-static void adjust_refcol_width(const struct ref *ref)
+static int refcol_width(const struct ref *ref_map, int compact_format)
{
- int max, rlen, llen, len;
+ const struct ref *ref;
+ int max, width = 10;
- /* uptodate lines are only shown on high verbosity level */
- if (verbosity <= 0 && oideq(&ref->peer_ref->old_oid, &ref->old_oid))
- return;
+ max = term_columns();
+ if (compact_format)
+ max = max * 2 / 3;
- max = term_columns();
- rlen = utf8_strwidth(prettify_refname(ref->name));
+ for (ref = ref_map; ref; ref = ref->next) {
+ int rlen, llen = 0, len;
- llen = utf8_strwidth(prettify_refname(ref->peer_ref->name));
+ if (ref->status == REF_STATUS_REJECT_SHALLOW ||
+ !ref->peer_ref ||
+ !strcmp(ref->name, "HEAD"))
+ continue;
- /*
- * rough estimation to see if the output line is too long and
- * should not be counted (we can't do precise calculation
- * anyway because we don't know if the error explanation part
- * will be printed in update_local_ref)
- */
- if (compact_format) {
- llen = 0;
- max = max * 2 / 3;
+ /* uptodate lines are only shown on high verbosity level */
+ if (verbosity <= 0 && oideq(&ref->peer_ref->old_oid, &ref->old_oid))
+ continue;
+
+ rlen = utf8_strwidth(prettify_refname(ref->name));
+ if (!compact_format)
+ llen = utf8_strwidth(prettify_refname(ref->peer_ref->name));
+
+ /*
+ * rough estimation to see if the output line is too long and
+ * should not be counted (we can't do precise calculation
+ * anyway because we don't know if the error explanation part
+ * will be printed in update_local_ref)
+ */
+ len = 21 /* flag and summary */ + rlen + 4 /* -> */ + llen;
+ if (len >= max)
+ continue;
+
+ if (width < rlen)
+ width = rlen;
}
- len = 21 /* flag and summary */ + rlen + 4 /* -> */ + llen;
- if (len >= max)
- return;
- /*
- * Not precise calculation for compact mode because '*' can
- * appear on the left hand side of '->' and shrink the column
- * back.
- */
- if (refcol_width < rlen)
- refcol_width = rlen;
+ return width;
}
-static void prepare_format_display(struct ref *ref_map)
+static void display_state_init(struct display_state *display_state, struct ref *ref_map,
+ const char *raw_url, enum display_format format)
{
- struct ref *rm;
- const char *format = "full";
+ int i;
- if (verbosity < 0)
- return;
+ memset(display_state, 0, sizeof(*display_state));
+ strbuf_init(&display_state->buf, 0);
+ display_state->format = format;
- git_config_get_string_tmp("fetch.output", &format);
- if (!strcasecmp(format, "full"))
- compact_format = 0;
- else if (!strcasecmp(format, "compact"))
- compact_format = 1;
+ if (raw_url)
+ display_state->url = transport_anonymize_url(raw_url);
else
- die(_("invalid value for '%s': '%s'"),
- "fetch.output", format);
+ display_state->url = xstrdup("foreign");
- for (rm = ref_map; rm; rm = rm->next) {
- if (rm->status == REF_STATUS_REJECT_SHALLOW ||
- !rm->peer_ref ||
- !strcmp(rm->name, "HEAD"))
- continue;
+ display_state->url_len = strlen(display_state->url);
+ for (i = display_state->url_len - 1; display_state->url[i] == '/' && 0 <= i; i--)
+ ;
+ display_state->url_len = i + 1;
+ if (4 < i && !strncmp(".git", display_state->url + i - 3, 4))
+ display_state->url_len = i - 3;
+
+ if (verbosity < 0)
+ return;
- adjust_refcol_width(rm);
+ switch (display_state->format) {
+ case DISPLAY_FORMAT_FULL:
+ case DISPLAY_FORMAT_COMPACT:
+ display_state->refcol_width = refcol_width(ref_map,
+ display_state->format == DISPLAY_FORMAT_COMPACT);
+ break;
+ case DISPLAY_FORMAT_PORCELAIN:
+ /* We don't need to precompute anything here. */
+ break;
+ default:
+ BUG("unexpected display format %d", display_state->format);
}
}
-static void print_remote_to_local(struct strbuf *display,
+static void display_state_release(struct display_state *display_state)
+{
+ strbuf_release(&display_state->buf);
+ free(display_state->url);
+}
+
+static void print_remote_to_local(struct display_state *display_state,
const char *remote, const char *local)
{
- strbuf_addf(display, "%-*s -> %s", refcol_width, remote, local);
+ strbuf_addf(&display_state->buf, "%-*s -> %s",
+ display_state->refcol_width, remote, local);
}
static int find_and_replace(struct strbuf *haystack,
@@ -835,14 +816,14 @@ static int find_and_replace(struct strbuf *haystack,
return 1;
}
-static void print_compact(struct strbuf *display,
+static void print_compact(struct display_state *display_state,
const char *remote, const char *local)
{
struct strbuf r = STRBUF_INIT;
struct strbuf l = STRBUF_INIT;
if (!strcmp(remote, local)) {
- strbuf_addf(display, "%-*s -> *", refcol_width, remote);
+ strbuf_addf(&display_state->buf, "%-*s -> *", display_state->refcol_width, remote);
return;
}
@@ -851,42 +832,74 @@ static void print_compact(struct strbuf *display,
if (!find_and_replace(&r, local, "*"))
find_and_replace(&l, remote, "*");
- print_remote_to_local(display, r.buf, l.buf);
+ print_remote_to_local(display_state, r.buf, l.buf);
strbuf_release(&r);
strbuf_release(&l);
}
-static void format_display(struct strbuf *display, char code,
- const char *summary, const char *error,
- const char *remote, const char *local,
- int summary_width)
+static void display_ref_update(struct display_state *display_state, char code,
+ const char *summary, const char *error,
+ const char *remote, const char *local,
+ const struct object_id *old_oid,
+ const struct object_id *new_oid,
+ int summary_width)
{
- int width;
+ FILE *f = stderr;
if (verbosity < 0)
return;
- width = (summary_width + strlen(summary) - gettext_width(summary));
+ strbuf_reset(&display_state->buf);
- strbuf_addf(display, "%c %-*s ", code, width, summary);
- if (!compact_format)
- print_remote_to_local(display, remote, local);
- else
- print_compact(display, remote, local);
- if (error)
- strbuf_addf(display, " (%s)", error);
+ switch (display_state->format) {
+ case DISPLAY_FORMAT_FULL:
+ case DISPLAY_FORMAT_COMPACT: {
+ int width;
+
+ if (!display_state->shown_url) {
+ strbuf_addf(&display_state->buf, _("From %.*s\n"),
+ display_state->url_len, display_state->url);
+ display_state->shown_url = 1;
+ }
+
+ width = (summary_width + strlen(summary) - gettext_width(summary));
+ remote = prettify_refname(remote);
+ local = prettify_refname(local);
+
+ strbuf_addf(&display_state->buf, " %c %-*s ", code, width, summary);
+
+ if (display_state->format != DISPLAY_FORMAT_COMPACT)
+ print_remote_to_local(display_state, remote, local);
+ else
+ print_compact(display_state, remote, local);
+
+ if (error)
+ strbuf_addf(&display_state->buf, " (%s)", error);
+
+ break;
+ }
+ case DISPLAY_FORMAT_PORCELAIN:
+ strbuf_addf(&display_state->buf, "%c %s %s %s", code,
+ oid_to_hex(old_oid), oid_to_hex(new_oid), local);
+ f = stdout;
+ break;
+ default:
+ BUG("unexpected display format %d", display_state->format);
+ };
+ strbuf_addch(&display_state->buf, '\n');
+
+ fputs(display_state->buf.buf, f);
}
static int update_local_ref(struct ref *ref,
struct ref_transaction *transaction,
- const char *remote, const struct ref *remote_ref,
- struct strbuf *display, int summary_width,
- struct worktree **worktrees)
+ struct display_state *display_state,
+ const struct ref *remote_ref,
+ int summary_width,
+ const struct fetch_config *config)
{
struct commit *current = NULL, *updated;
- const struct worktree *wt;
- const char *pretty_ref = prettify_refname(ref->name);
int fast_forward = 0;
if (!repo_has_object_file(the_repository, &ref->new_oid))
@@ -894,23 +907,23 @@ static int update_local_ref(struct ref *ref,
if (oideq(&ref->old_oid, &ref->new_oid)) {
if (verbosity > 0)
- format_display(display, '=', _("[up to date]"), NULL,
- remote, pretty_ref, summary_width);
+ display_ref_update(display_state, '=', _("[up to date]"), NULL,
+ remote_ref->name, ref->name,
+ &ref->old_oid, &ref->new_oid, summary_width);
return 0;
}
if (!update_head_ok &&
- (wt = find_shared_symref(worktrees, "HEAD", ref->name)) &&
- !wt->is_bare && !is_null_oid(&ref->old_oid)) {
+ !is_null_oid(&ref->old_oid) &&
+ branch_checked_out(ref->name)) {
/*
* If this is the head, and it's not okay to update
* the head, and the old value of the head isn't empty...
*/
- format_display(display, '!', _("[rejected]"),
- wt->is_current ?
- _("can't fetch in current branch") :
- _("checked out in another worktree"),
- remote, pretty_ref, summary_width);
+ display_ref_update(display_state, '!', _("[rejected]"),
+ _("can't fetch into checked-out branch"),
+ remote_ref->name, ref->name,
+ &ref->old_oid, &ref->new_oid, summary_width);
return 1;
}
@@ -919,13 +932,16 @@ static int update_local_ref(struct ref *ref,
if (force || ref->force) {
int r;
r = s_update_ref("updating tag", ref, transaction, 0);
- format_display(display, r ? '!' : 't', _("[tag update]"),
- r ? _("unable to update local ref") : NULL,
- remote, pretty_ref, summary_width);
+ display_ref_update(display_state, r ? '!' : 't', _("[tag update]"),
+ r ? _("unable to update local ref") : NULL,
+ remote_ref->name, ref->name,
+ &ref->old_oid, &ref->new_oid, summary_width);
return r;
} else {
- format_display(display, '!', _("[rejected]"), _("would clobber existing tag"),
- remote, pretty_ref, summary_width);
+ display_ref_update(display_state, '!', _("[rejected]"),
+ _("would clobber existing tag"),
+ remote_ref->name, ref->name,
+ &ref->old_oid, &ref->new_oid, summary_width);
return 1;
}
}
@@ -943,11 +959,10 @@ static int update_local_ref(struct ref *ref,
* Base this on the remote's ref name, as it's
* more likely to follow a standard layout.
*/
- const char *name = remote_ref ? remote_ref->name : "";
- if (starts_with(name, "refs/tags/")) {
+ if (starts_with(remote_ref->name, "refs/tags/")) {
msg = "storing tag";
what = _("[new tag]");
- } else if (starts_with(name, "refs/heads/")) {
+ } else if (starts_with(remote_ref->name, "refs/heads/")) {
msg = "storing head";
what = _("[new branch]");
} else {
@@ -956,15 +971,19 @@ static int update_local_ref(struct ref *ref,
}
r = s_update_ref(msg, ref, transaction, 0);
- format_display(display, r ? '!' : '*', what,
- r ? _("unable to update local ref") : NULL,
- remote, pretty_ref, summary_width);
+ display_ref_update(display_state, r ? '!' : '*', what,
+ r ? _("unable to update local ref") : NULL,
+ remote_ref->name, ref->name,
+ &ref->old_oid, &ref->new_oid, summary_width);
return r;
}
- if (fetch_show_forced_updates) {
+ if (config->show_forced_updates) {
uint64_t t_before = getnanotime();
- fast_forward = in_merge_bases(current, updated);
+ fast_forward = repo_in_merge_bases(the_repository, current,
+ updated);
+ if (fast_forward < 0)
+ exit(128);
forced_updates_ms += (getnanotime() - t_before) / 1000000;
} else {
fast_forward = 1;
@@ -978,9 +997,10 @@ static int update_local_ref(struct ref *ref,
strbuf_addstr(&quickref, "..");
strbuf_add_unique_abbrev(&quickref, &ref->new_oid, DEFAULT_ABBREV);
r = s_update_ref("fast-forward", ref, transaction, 1);
- format_display(display, r ? '!' : ' ', quickref.buf,
- r ? _("unable to update local ref") : NULL,
- remote, pretty_ref, summary_width);
+ display_ref_update(display_state, r ? '!' : ' ', quickref.buf,
+ r ? _("unable to update local ref") : NULL,
+ remote_ref->name, ref->name,
+ &ref->old_oid, &ref->new_oid, summary_width);
strbuf_release(&quickref);
return r;
} else if (force || ref->force) {
@@ -990,14 +1010,16 @@ static int update_local_ref(struct ref *ref,
strbuf_addstr(&quickref, "...");
strbuf_add_unique_abbrev(&quickref, &ref->new_oid, DEFAULT_ABBREV);
r = s_update_ref("forced-update", ref, transaction, 1);
- format_display(display, r ? '!' : '+', quickref.buf,
- r ? _("unable to update local ref") : _("forced update"),
- remote, pretty_ref, summary_width);
+ display_ref_update(display_state, r ? '!' : '+', quickref.buf,
+ r ? _("unable to update local ref") : _("forced update"),
+ remote_ref->name, ref->name,
+ &ref->old_oid, &ref->new_oid, summary_width);
strbuf_release(&quickref);
return r;
} else {
- format_display(display, '!', _("[rejected]"), _("non-fast-forward"),
- remote, pretty_ref, summary_width);
+ display_ref_update(display_state, '!', _("[rejected]"), _("non-fast-forward"),
+ remote_ref->name, ref->name,
+ &ref->old_oid, &ref->new_oid, summary_width);
return 1;
}
}
@@ -1107,39 +1129,35 @@ N_("it took %.2f seconds to check forced updates; you can use\n"
"'--no-show-forced-updates' or run 'git config fetch.showForcedUpdates false'\n"
"to avoid this check\n");
-static int store_updated_refs(const char *raw_url, const char *remote_name,
+static int store_updated_refs(struct display_state *display_state,
+ const char *remote_name,
int connectivity_checked,
struct ref_transaction *transaction, struct ref *ref_map,
- struct fetch_head *fetch_head, struct worktree **worktrees)
+ struct fetch_head *fetch_head,
+ const struct fetch_config *config)
{
- int url_len, i, rc = 0;
- struct strbuf note = STRBUF_INIT, err = STRBUF_INIT;
+ int rc = 0;
+ struct strbuf note = STRBUF_INIT;
const char *what, *kind;
struct ref *rm;
- char *url;
int want_status;
int summary_width = 0;
if (verbosity >= 0)
summary_width = transport_summary_width(ref_map);
- if (raw_url)
- url = transport_anonymize_url(raw_url);
- else
- url = xstrdup("foreign");
-
if (!connectivity_checked) {
struct check_connected_options opt = CHECK_CONNECTED_INIT;
+ opt.exclude_hidden_refs_section = "fetch";
rm = ref_map;
if (check_connected(iterate_ref_map, &rm, &opt)) {
- rc = error(_("%s did not send all necessary objects\n"), url);
+ rc = error(_("%s did not send all necessary objects\n"),
+ display_state->url);
goto abort;
}
}
- prepare_format_display(ref_map);
-
/*
* We do a pass for each fetch_head_status type in their enum order, so
* merged entries are written before not-for-merge. That lets readers
@@ -1199,7 +1217,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
ref->force = rm->peer_ref->force;
}
- if (recurse_submodules != RECURSE_SUBMODULES_OFF &&
+ if (config->recurse_submodules != RECURSE_SUBMODULES_OFF &&
(!rm->peer_ref || !oideq(&ref->old_oid, &ref->new_oid))) {
check_for_new_submodule_commits(&rm->old_oid);
}
@@ -1207,25 +1225,17 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
if (!strcmp(rm->name, "HEAD")) {
kind = "";
what = "";
- }
- else if (skip_prefix(rm->name, "refs/heads/", &what))
+ } else if (skip_prefix(rm->name, "refs/heads/", &what)) {
kind = "branch";
- else if (skip_prefix(rm->name, "refs/tags/", &what))
+ } else if (skip_prefix(rm->name, "refs/tags/", &what)) {
kind = "tag";
- else if (skip_prefix(rm->name, "refs/remotes/", &what))
+ } else if (skip_prefix(rm->name, "refs/remotes/", &what)) {
kind = "remote-tracking branch";
- else {
+ } else {
kind = "";
what = rm->name;
}
- url_len = strlen(url);
- for (i = url_len - 1; url[i] == '/' && 0 <= i; i--)
- ;
- url_len = i + 1;
- if (4 < i && !strncmp(".git", url + i - 3, 4))
- url_len = i - 3;
-
strbuf_reset(&note);
if (*what) {
if (*kind)
@@ -1235,13 +1245,12 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
append_fetch_head(fetch_head, &rm->old_oid,
rm->fetch_head_status,
- note.buf, url, url_len);
+ note.buf, display_state->url,
+ display_state->url_len);
- strbuf_reset(&note);
if (ref) {
- rc |= update_local_ref(ref, transaction, what,
- rm, &note, summary_width,
- worktrees);
+ rc |= update_local_ref(ref, transaction, display_state,
+ rm, summary_width, config);
free(ref);
} else if (write_fetch_head || dry_run) {
/*
@@ -1249,18 +1258,12 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
* would be written to FETCH_HEAD, if --dry-run
* is set).
*/
- format_display(&note, '*',
- *kind ? kind : "branch", NULL,
- *what ? what : "HEAD",
- "FETCH_HEAD", summary_width);
- }
- if (note.len) {
- if (!shown_url) {
- fprintf(stderr, _("From %.*s\n"),
- url_len, url);
- shown_url = 1;
- }
- fprintf(stderr, " %s\n", note.buf);
+ display_ref_update(display_state, '*',
+ *kind ? kind : "branch", NULL,
+ rm->name,
+ "FETCH_HEAD",
+ &rm->new_oid, &rm->old_oid,
+ summary_width);
}
}
}
@@ -1271,7 +1274,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
"branches"), remote_name);
if (advice_enabled(ADVICE_FETCH_SHOW_FORCED_UPDATES)) {
- if (!fetch_show_forced_updates) {
+ if (!config->show_forced_updates) {
warning(_(warn_show_forced_updates));
} else if (forced_updates_ms > FORCED_UPDATES_DELAY_WARNING_IN_MS) {
warning(_(warn_time_show_forced_updates),
@@ -1281,8 +1284,6 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
abort:
strbuf_release(&note);
- strbuf_release(&err);
- free(url);
return rc;
}
@@ -1320,20 +1321,22 @@ static int check_exist_and_connected(struct ref *ref_map)
* we need all direct targets to exist.
*/
for (r = rm; r; r = r->next) {
- if (!has_object_file_with_flags(&r->old_oid,
- OBJECT_INFO_SKIP_FETCH_OBJECT))
+ if (!repo_has_object_file_with_flags(the_repository, &r->old_oid,
+ OBJECT_INFO_SKIP_FETCH_OBJECT))
return -1;
}
opt.quiet = 1;
+ opt.exclude_hidden_refs_section = "fetch";
return check_connected(iterate_ref_map, &rm, &opt);
}
-static int fetch_and_consume_refs(struct transport *transport,
+static int fetch_and_consume_refs(struct display_state *display_state,
+ struct transport *transport,
struct ref_transaction *transaction,
struct ref *ref_map,
struct fetch_head *fetch_head,
- struct worktree **worktrees)
+ const struct fetch_config *config)
{
int connectivity_checked = 1;
int ret;
@@ -1354,9 +1357,9 @@ static int fetch_and_consume_refs(struct transport *transport,
}
trace2_region_enter("fetch", "consume_refs", the_repository);
- ret = store_updated_refs(transport->url, transport->remote->name,
+ ret = store_updated_refs(display_state, transport->remote->name,
connectivity_checked, transaction, ref_map,
- fetch_head, worktrees);
+ fetch_head, config);
trace2_region_leave("fetch", "consume_refs", the_repository);
out:
@@ -1364,32 +1367,18 @@ out:
return ret;
}
-static int prune_refs(struct refspec *rs,
+static int prune_refs(struct display_state *display_state,
+ struct refspec *rs,
struct ref_transaction *transaction,
- struct ref *ref_map,
- const char *raw_url)
+ struct ref *ref_map)
{
- int url_len, i, result = 0;
+ int result = 0;
struct ref *ref, *stale_refs = get_stale_heads(rs, ref_map);
struct strbuf err = STRBUF_INIT;
- char *url;
const char *dangling_msg = dry_run
? _(" (%s will become dangling)")
: _(" (%s has become dangling)");
- if (raw_url)
- url = transport_anonymize_url(raw_url);
- else
- url = xstrdup("foreign");
-
- url_len = strlen(url);
- for (i = url_len - 1; url[i] == '/' && 0 <= i; i--)
- ;
-
- url_len = i + 1;
- if (4 < i && !strncmp(".git", url + i - 3, 4))
- url_len = i - 3;
-
if (!dry_run) {
if (transaction) {
for (ref = stale_refs; ref; ref = ref->next) {
@@ -1413,40 +1402,30 @@ static int prune_refs(struct refspec *rs,
int summary_width = transport_summary_width(stale_refs);
for (ref = stale_refs; ref; ref = ref->next) {
- struct strbuf sb = STRBUF_INIT;
- if (!shown_url) {
- fprintf(stderr, _("From %.*s\n"), url_len, url);
- shown_url = 1;
- }
- format_display(&sb, '-', _("[deleted]"), NULL,
- _("(none)"), prettify_refname(ref->name),
- summary_width);
- fprintf(stderr, " %s\n",sb.buf);
- strbuf_release(&sb);
+ display_ref_update(display_state, '-', _("[deleted]"), NULL,
+ _("(none)"), ref->name,
+ &ref->new_oid, &ref->old_oid,
+ summary_width);
warn_dangling_symref(stderr, dangling_msg, ref->name);
}
}
cleanup:
strbuf_release(&err);
- free(url);
free_refs(stale_refs);
return result;
}
-static void check_not_current_branch(struct ref *ref_map,
- struct worktree **worktrees)
+static void check_not_current_branch(struct ref *ref_map)
{
- const struct worktree *wt;
+ const char *path;
for (; ref_map; ref_map = ref_map->next)
if (ref_map->peer_ref &&
starts_with(ref_map->peer_ref->name, "refs/heads/") &&
- (wt = find_shared_symref(worktrees, "HEAD",
- ref_map->peer_ref->name)) &&
- !wt->is_bare)
+ (path = branch_checked_out(ref_map->peer_ref->name)))
die(_("refusing to fetch into branch '%s' "
"checked out at '%s'"),
- ref_map->peer_ref->name, wt->path);
+ ref_map->peer_ref->name, path);
}
static int truncate_fetch_head(void)
@@ -1472,8 +1451,9 @@ static void set_option(struct transport *transport, const char *name, const char
}
-static int add_oid(const char *refname, const struct object_id *oid, int flags,
- void *cb_data)
+static int add_oid(const char *refname UNUSED,
+ const struct object_id *oid,
+ int flags UNUSED, void *cb_data)
{
struct oid_array *oids = cb_data;
@@ -1491,7 +1471,7 @@ static void add_negotiation_tips(struct git_transport_options *smart_options)
int old_nr;
if (!has_glob_specials(s)) {
struct object_id oid;
- if (get_oid(s, &oid))
+ if (repo_get_oid(the_repository, s, &oid))
die(_("%s is not a valid object"), s);
if (!has_object(the_repository, &oid, 0))
die(_("the object %s does not exist"), s);
@@ -1546,11 +1526,12 @@ static struct transport *prepare_transport(struct remote *remote, int deepen)
return transport;
}
-static int backfill_tags(struct transport *transport,
+static int backfill_tags(struct display_state *display_state,
+ struct transport *transport,
struct ref_transaction *transaction,
struct ref *ref_map,
struct fetch_head *fetch_head,
- struct worktree **worktrees)
+ const struct fetch_config *config)
{
int retcode, cannot_reuse;
@@ -1571,7 +1552,8 @@ static int backfill_tags(struct transport *transport,
transport_set_option(transport, TRANS_OPT_FOLLOWTAGS, NULL);
transport_set_option(transport, TRANS_OPT_DEPTH, "0");
transport_set_option(transport, TRANS_OPT_DEEPEN_RELATIVE, NULL);
- retcode = fetch_and_consume_refs(transport, transaction, ref_map, fetch_head, worktrees);
+ retcode = fetch_and_consume_refs(display_state, transport, transaction, ref_map,
+ fetch_head, config);
if (gsecondary) {
transport_disconnect(gsecondary);
@@ -1582,17 +1564,18 @@ static int backfill_tags(struct transport *transport,
}
static int do_fetch(struct transport *transport,
- struct refspec *rs)
+ struct refspec *rs,
+ const struct fetch_config *config)
{
struct ref_transaction *transaction = NULL;
struct ref *ref_map = NULL;
+ struct display_state display_state = { 0 };
int autotags = (transport->remote->fetch_tags == 1);
int retcode = 0;
const struct ref *remote_refs;
struct transport_ls_refs_options transport_ls_refs_options =
TRANSPORT_LS_REFS_OPTIONS_INIT;
int must_list_refs = 1;
- struct worktree **worktrees = get_worktrees();
struct fetch_head fetch_head = { 0 };
struct strbuf err = STRBUF_INIT;
@@ -1626,9 +1609,21 @@ static int do_fetch(struct transport *transport,
break;
}
}
- } else if (transport->remote && transport->remote->fetch.nr)
- refspec_ref_prefixes(&transport->remote->fetch,
- &transport_ls_refs_options.ref_prefixes);
+ } else {
+ struct branch *branch = branch_get(NULL);
+
+ if (transport->remote->fetch.nr)
+ refspec_ref_prefixes(&transport->remote->fetch,
+ &transport_ls_refs_options.ref_prefixes);
+ if (branch_has_merge_config(branch) &&
+ !strcmp(branch->remote_name, transport->remote->name)) {
+ int i;
+ for (i = 0; i < branch->merge_nr; i++) {
+ strvec_push(&transport_ls_refs_options.ref_prefixes,
+ branch->merge[i]->src);
+ }
+ }
+ }
if (tags == TAGS_SET || tags == TAGS_DEFAULT) {
must_list_refs = 1;
@@ -1650,16 +1645,19 @@ static int do_fetch(struct transport *transport,
ref_map = get_ref_map(transport->remote, remote_refs, rs,
tags, &autotags);
if (!update_head_ok)
- check_not_current_branch(ref_map, worktrees);
+ check_not_current_branch(ref_map);
retcode = open_fetch_head(&fetch_head);
if (retcode)
goto cleanup;
+ display_state_init(&display_state, ref_map, transport->url,
+ config->display_format);
+
if (atomic_fetch) {
transaction = ref_transaction_begin(&err);
if (!transaction) {
- retcode = error("%s", err.buf);
+ retcode = -1;
goto cleanup;
}
}
@@ -1673,17 +1671,17 @@ static int do_fetch(struct transport *transport,
* don't care whether --tags was specified.
*/
if (rs->nr) {
- retcode = prune_refs(rs, transaction, ref_map, transport->url);
+ retcode = prune_refs(&display_state, rs, transaction, ref_map);
} else {
- retcode = prune_refs(&transport->remote->fetch,
- transaction, ref_map,
- transport->url);
+ retcode = prune_refs(&display_state, &transport->remote->fetch,
+ transaction, ref_map);
}
if (retcode != 0)
retcode = 1;
}
- if (fetch_and_consume_refs(transport, transaction, ref_map, &fetch_head, worktrees)) {
+ if (fetch_and_consume_refs(&display_state, transport, transaction, ref_map,
+ &fetch_head, config)) {
retcode = 1;
goto cleanup;
}
@@ -1705,8 +1703,8 @@ static int do_fetch(struct transport *transport,
* when `--atomic` is passed: in that case we'll abort
* the transaction and don't commit anything.
*/
- if (backfill_tags(transport, transaction, tags_ref_map,
- &fetch_head, worktrees))
+ if (backfill_tags(&display_state, transport, transaction, tags_ref_map,
+ &fetch_head, config))
retcode = 1;
}
@@ -1719,7 +1717,6 @@ static int do_fetch(struct transport *transport,
retcode = ref_transaction_commit(transaction, &err);
if (retcode) {
- error("%s", err.buf);
ref_transaction_free(transaction);
transaction = NULL;
goto cleanup;
@@ -1783,15 +1780,20 @@ static int do_fetch(struct transport *transport,
}
cleanup:
- if (retcode && transaction) {
- ref_transaction_abort(transaction, &err);
- error("%s", err.buf);
+ if (retcode) {
+ if (err.len) {
+ error("%s", err.buf);
+ strbuf_reset(&err);
+ }
+ if (transaction && ref_transaction_abort(transaction, &err) &&
+ err.len)
+ error("%s", err.buf);
}
+ display_state_release(&display_state);
close_fetch_head(&fetch_head);
strbuf_release(&err);
free_refs(ref_map);
- free_worktrees(worktrees);
return retcode;
}
@@ -1808,7 +1810,9 @@ struct remote_group_data {
struct string_list *list;
};
-static int get_remote_group(const char *key, const char *value, void *priv)
+static int get_remote_group(const char *key, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *priv)
{
struct remote_group_data *g = priv;
@@ -1843,7 +1847,8 @@ static int add_remote_or_group(const char *name, struct string_list *list)
return 1;
}
-static void add_options_to_argv(struct strvec *argv)
+static void add_options_to_argv(struct strvec *argv,
+ const struct fetch_config *config)
{
if (dry_run)
strvec_push(argv, "--dry-run");
@@ -1857,9 +1862,11 @@ static void add_options_to_argv(struct strvec *argv)
strvec_push(argv, "--force");
if (keep)
strvec_push(argv, "--keep");
- if (recurse_submodules == RECURSE_SUBMODULES_ON)
+ if (config->recurse_submodules == RECURSE_SUBMODULES_ON)
strvec_push(argv, "--recurse-submodules");
- else if (recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND)
+ else if (config->recurse_submodules == RECURSE_SUBMODULES_OFF)
+ strvec_push(argv, "--no-recurse-submodules");
+ else if (config->recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND)
strvec_push(argv, "--recurse-submodules=on-demand");
if (tags == TAGS_SET)
strvec_push(argv, "--tags");
@@ -1875,6 +1882,10 @@ static void add_options_to_argv(struct strvec *argv)
strvec_push(argv, "--ipv4");
else if (family == TRANSPORT_FAMILY_IPV6)
strvec_push(argv, "--ipv6");
+ if (!write_fetch_head)
+ strvec_push(argv, "--no-write-fetch-head");
+ if (config->display_format == DISPLAY_FORMAT_PORCELAIN)
+ strvec_pushf(argv, "--porcelain");
}
/* Fetch multiple remotes in parallel */
@@ -1883,9 +1894,11 @@ struct parallel_fetch_state {
const char **argv;
struct string_list *remotes;
int next, result;
+ const struct fetch_config *config;
};
-static int fetch_next_remote(struct child_process *cp, struct strbuf *out,
+static int fetch_next_remote(struct child_process *cp,
+ struct strbuf *out UNUSED,
void *cb, void **task_cb)
{
struct parallel_fetch_state *state = cb;
@@ -1901,13 +1914,14 @@ static int fetch_next_remote(struct child_process *cp, struct strbuf *out,
strvec_push(&cp->args, remote);
cp->git_cmd = 1;
- if (verbosity >= 0)
+ if (verbosity >= 0 && state->config->display_format != DISPLAY_FORMAT_PORCELAIN)
printf(_("Fetching %s\n"), remote);
return 1;
}
-static int fetch_failed_to_start(struct strbuf *out, void *cb, void *task_cb)
+static int fetch_failed_to_start(struct strbuf *out UNUSED,
+ void *cb, void *task_cb)
{
struct parallel_fetch_state *state = cb;
const char *remote = task_cb;
@@ -1932,7 +1946,8 @@ static int fetch_finished(int result, struct strbuf *out,
return 0;
}
-static int fetch_multiple(struct string_list *list, int max_children)
+static int fetch_multiple(struct string_list *list, int max_children,
+ const struct fetch_config *config)
{
int i, result = 0;
struct strvec argv = STRVEC_INIT;
@@ -1943,34 +1958,47 @@ static int fetch_multiple(struct string_list *list, int max_children)
return errcode;
}
- strvec_pushl(&argv, "fetch", "--append", "--no-auto-gc",
+ /*
+ * Cancel out the fetch.bundleURI config when running subprocesses,
+ * to avoid fetching from the same bundle list multiple times.
+ */
+ strvec_pushl(&argv, "-c", "fetch.bundleURI=",
+ "fetch", "--append", "--no-auto-gc",
"--no-write-commit-graph", NULL);
- add_options_to_argv(&argv);
+ add_options_to_argv(&argv, config);
if (max_children != 1 && list->nr != 1) {
- struct parallel_fetch_state state = { argv.v, list, 0, 0 };
+ struct parallel_fetch_state state = { argv.v, list, 0, 0, config };
+ const struct run_process_parallel_opts opts = {
+ .tr2_category = "fetch",
+ .tr2_label = "parallel/fetch",
+
+ .processes = max_children,
+
+ .get_next_task = &fetch_next_remote,
+ .start_failure = &fetch_failed_to_start,
+ .task_finished = &fetch_finished,
+ .data = &state,
+ };
strvec_push(&argv, "--end-of-options");
- result = run_processes_parallel_tr2(max_children,
- &fetch_next_remote,
- &fetch_failed_to_start,
- &fetch_finished,
- &state,
- "fetch", "parallel/fetch");
-
- if (!result)
- result = state.result;
+
+ run_processes_parallel(&opts);
+ result = state.result;
} else
for (i = 0; i < list->nr; i++) {
const char *name = list->items[i].string;
- strvec_push(&argv, name);
- if (verbosity >= 0)
+ struct child_process cmd = CHILD_PROCESS_INIT;
+
+ strvec_pushv(&cmd.args, argv.v);
+ strvec_push(&cmd.args, name);
+ if (verbosity >= 0 && config->display_format != DISPLAY_FORMAT_PORCELAIN)
printf(_("Fetching %s\n"), name);
- if (run_command_v_opt(argv.v, RUN_GIT_CMD)) {
+ cmd.git_cmd = 1;
+ if (run_command(&cmd)) {
error(_("could not fetch %s"), name);
result = 1;
}
- strvec_pop(&argv);
}
strvec_clear(&argv);
@@ -1994,7 +2022,7 @@ static inline void fetch_one_setup_partial(struct remote *remote)
* If no prior partial clone/fetch and the current fetch DID NOT
* request a partial-fetch, do a normal fetch.
*/
- if (!has_promisor_remote() && !filter_options.choice)
+ if (!repo_has_promisor_remote(the_repository) && !filter_options.choice)
return;
/*
@@ -2019,7 +2047,8 @@ static inline void fetch_one_setup_partial(struct remote *remote)
}
static int fetch_one(struct remote *remote, int argc, const char **argv,
- int prune_tags_ok, int use_stdin_refspecs)
+ int prune_tags_ok, int use_stdin_refspecs,
+ const struct fetch_config *config)
{
struct refspec rs = REFSPEC_INIT_FETCH;
int i;
@@ -2037,8 +2066,8 @@ static int fetch_one(struct remote *remote, int argc, const char **argv,
/* no command line request */
if (0 <= remote->prune)
prune = remote->prune;
- else if (0 <= fetch_prune_config)
- prune = fetch_prune_config;
+ else if (0 <= config->prune)
+ prune = config->prune;
else
prune = PRUNE_BY_DEFAULT;
}
@@ -2047,8 +2076,8 @@ static int fetch_one(struct remote *remote, int argc, const char **argv,
/* no command line request */
if (0 <= remote->prune_tags)
prune_tags = remote->prune_tags;
- else if (0 <= fetch_prune_tags_config)
- prune_tags = fetch_prune_tags_config;
+ else if (0 <= config->prune_tags)
+ prune_tags = config->prune_tags;
else
prune_tags = PRUNE_TAGS_BY_DEFAULT;
}
@@ -2086,7 +2115,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv,
sigchain_push_common(unlock_pack_on_signal);
atexit(unlock_pack_atexit);
sigchain_push(SIGPIPE, SIG_IGN);
- exit_code = do_fetch(gtransport, &rs);
+ exit_code = do_fetch(gtransport, &rs, config);
sigchain_pop(SIGPIPE);
refspec_clear(&rs);
transport_disconnect(gtransport);
@@ -2096,11 +2125,116 @@ static int fetch_one(struct remote *remote, int argc, const char **argv,
int cmd_fetch(int argc, const char **argv, const char *prefix)
{
- int i;
+ struct fetch_config config = {
+ .display_format = DISPLAY_FORMAT_FULL,
+ .prune = -1,
+ .prune_tags = -1,
+ .show_forced_updates = 1,
+ .recurse_submodules = RECURSE_SUBMODULES_DEFAULT,
+ .parallel = 1,
+ .submodule_fetch_jobs = -1,
+ };
+ const char *submodule_prefix = "";
+ const char *bundle_uri;
struct string_list list = STRING_LIST_INIT_DUP;
struct remote *remote = NULL;
+ int all = -1, multiple = 0;
int result = 0;
int prune_tags_ok = 1;
+ int enable_auto_gc = 1;
+ int unshallow = 0;
+ int max_jobs = -1;
+ int recurse_submodules_cli = RECURSE_SUBMODULES_DEFAULT;
+ int recurse_submodules_default = RECURSE_SUBMODULES_ON_DEMAND;
+ int fetch_write_commit_graph = -1;
+ int stdin_refspecs = 0;
+ int negotiate_only = 0;
+ int porcelain = 0;
+ int i;
+
+ struct option builtin_fetch_options[] = {
+ OPT__VERBOSITY(&verbosity),
+ OPT_BOOL(0, "all", &all,
+ N_("fetch from all remotes")),
+ OPT_BOOL(0, "set-upstream", &set_upstream,
+ N_("set upstream for git pull/fetch")),
+ OPT_BOOL('a', "append", &append,
+ N_("append to .git/FETCH_HEAD instead of overwriting")),
+ OPT_BOOL(0, "atomic", &atomic_fetch,
+ N_("use atomic transaction to update references")),
+ OPT_STRING(0, "upload-pack", &upload_pack, N_("path"),
+ N_("path to upload pack on remote end")),
+ OPT__FORCE(&force, N_("force overwrite of local reference"), 0),
+ OPT_BOOL('m', "multiple", &multiple,
+ N_("fetch from multiple remotes")),
+ OPT_SET_INT('t', "tags", &tags,
+ N_("fetch all tags and associated objects"), TAGS_SET),
+ OPT_SET_INT('n', NULL, &tags,
+ N_("do not fetch all tags (--no-tags)"), TAGS_UNSET),
+ OPT_INTEGER('j', "jobs", &max_jobs,
+ N_("number of submodules fetched in parallel")),
+ OPT_BOOL(0, "prefetch", &prefetch,
+ N_("modify the refspec to place all refs within refs/prefetch/")),
+ OPT_BOOL('p', "prune", &prune,
+ N_("prune remote-tracking branches no longer on remote")),
+ OPT_BOOL('P', "prune-tags", &prune_tags,
+ N_("prune local tags no longer on remote and clobber changed tags")),
+ OPT_CALLBACK_F(0, "recurse-submodules", &recurse_submodules_cli, N_("on-demand"),
+ N_("control recursive fetching of submodules"),
+ PARSE_OPT_OPTARG, option_fetch_parse_recurse_submodules),
+ OPT_BOOL(0, "dry-run", &dry_run,
+ N_("dry run")),
+ OPT_BOOL(0, "porcelain", &porcelain, N_("machine-readable output")),
+ OPT_BOOL(0, "write-fetch-head", &write_fetch_head,
+ N_("write fetched references to the FETCH_HEAD file")),
+ OPT_BOOL('k', "keep", &keep, N_("keep downloaded pack")),
+ OPT_BOOL('u', "update-head-ok", &update_head_ok,
+ N_("allow updating of HEAD ref")),
+ OPT_BOOL(0, "progress", &progress, N_("force progress reporting")),
+ OPT_STRING(0, "depth", &depth, N_("depth"),
+ N_("deepen history of shallow clone")),
+ OPT_STRING(0, "shallow-since", &deepen_since, N_("time"),
+ N_("deepen history of shallow repository based on time")),
+ OPT_STRING_LIST(0, "shallow-exclude", &deepen_not, N_("revision"),
+ N_("deepen history of shallow clone, excluding rev")),
+ OPT_INTEGER(0, "deepen", &deepen_relative,
+ N_("deepen history of shallow clone")),
+ OPT_SET_INT_F(0, "unshallow", &unshallow,
+ N_("convert to a complete repository"),
+ 1, PARSE_OPT_NONEG),
+ OPT_SET_INT_F(0, "refetch", &refetch,
+ N_("re-fetch without negotiating common commits"),
+ 1, PARSE_OPT_NONEG),
+ { OPTION_STRING, 0, "submodule-prefix", &submodule_prefix, N_("dir"),
+ N_("prepend this to submodule path output"), PARSE_OPT_HIDDEN },
+ OPT_CALLBACK_F(0, "recurse-submodules-default",
+ &recurse_submodules_default, N_("on-demand"),
+ N_("default for recursive fetching of submodules "
+ "(lower priority than config files)"),
+ PARSE_OPT_HIDDEN, option_fetch_parse_recurse_submodules),
+ OPT_BOOL(0, "update-shallow", &update_shallow,
+ N_("accept refs that update .git/shallow")),
+ OPT_CALLBACK_F(0, "refmap", &refmap, N_("refmap"),
+ N_("specify fetch refmap"), PARSE_OPT_NONEG, parse_refmap_arg),
+ OPT_STRING_LIST('o', "server-option", &server_options, N_("server-specific"), N_("option to transmit")),
+ OPT_IPVERSION(&family),
+ OPT_STRING_LIST(0, "negotiation-tip", &negotiation_tip, N_("revision"),
+ N_("report that we have only objects reachable from this object")),
+ OPT_BOOL(0, "negotiate-only", &negotiate_only,
+ N_("do not fetch a packfile; instead, print ancestors of negotiation tips")),
+ OPT_PARSE_LIST_OBJECTS_FILTER(&filter_options),
+ OPT_BOOL(0, "auto-maintenance", &enable_auto_gc,
+ N_("run 'maintenance --auto' after fetching")),
+ OPT_BOOL(0, "auto-gc", &enable_auto_gc,
+ N_("run 'maintenance --auto' after fetching")),
+ OPT_BOOL(0, "show-forced-updates", &config.show_forced_updates,
+ N_("check for forced-updates on all updated branches")),
+ OPT_BOOL(0, "write-commit-graph", &fetch_write_commit_graph,
+ N_("write the commit-graph after fetching")),
+ OPT_BOOL(0, "stdin", &stdin_refspecs,
+ N_("accept refspecs from stdin")),
+ OPT_END()
+ };
packet_trace_identity("fetch");
@@ -2114,7 +2248,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
free(anon);
}
- git_config(git_fetch_config, NULL);
+ git_config(git_fetch_config, &config);
if (the_repository->gitdir) {
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
@@ -2124,7 +2258,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
builtin_fetch_options, builtin_fetch_usage, 0);
if (recurse_submodules_cli != RECURSE_SUBMODULES_DEFAULT)
- recurse_submodules = recurse_submodules_cli;
+ config.recurse_submodules = recurse_submodules_cli;
if (negotiate_only) {
switch (recurse_submodules_cli) {
@@ -2135,7 +2269,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
* submodules. Skip it by setting recurse_submodules to
* RECURSE_SUBMODULES_OFF.
*/
- recurse_submodules = RECURSE_SUBMODULES_OFF;
+ config.recurse_submodules = RECURSE_SUBMODULES_OFF;
break;
default:
@@ -2144,15 +2278,35 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
}
}
- if (recurse_submodules != RECURSE_SUBMODULES_OFF) {
- int *sfjc = submodule_fetch_jobs_config == -1
- ? &submodule_fetch_jobs_config : NULL;
- int *rs = recurse_submodules == RECURSE_SUBMODULES_DEFAULT
- ? &recurse_submodules : NULL;
+ if (config.recurse_submodules != RECURSE_SUBMODULES_OFF) {
+ int *sfjc = config.submodule_fetch_jobs == -1
+ ? &config.submodule_fetch_jobs : NULL;
+ int *rs = config.recurse_submodules == RECURSE_SUBMODULES_DEFAULT
+ ? &config.recurse_submodules : NULL;
fetch_config_from_gitmodules(sfjc, rs);
}
+
+ if (porcelain) {
+ switch (recurse_submodules_cli) {
+ case RECURSE_SUBMODULES_OFF:
+ case RECURSE_SUBMODULES_DEFAULT:
+ /*
+ * Reference updates in submodules would be ambiguous
+ * in porcelain mode, so we reject this combination.
+ */
+ config.recurse_submodules = RECURSE_SUBMODULES_OFF;
+ break;
+
+ default:
+ die(_("options '%s' and '%s' cannot be used together"),
+ "--porcelain", "--recurse-submodules");
+ }
+
+ config.display_format = DISPLAY_FORMAT_PORCELAIN;
+ }
+
if (negotiate_only && !negotiation_tip.nr)
die(_("--negotiate-only needs one or more --negotiation-tip=*"));
@@ -2182,11 +2336,27 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
if (dry_run)
write_fetch_head = 0;
+ if (!max_jobs)
+ max_jobs = online_cpus();
+
+ if (!git_config_get_string_tmp("fetch.bundleuri", &bundle_uri) &&
+ fetch_bundle_uri(the_repository, bundle_uri, NULL))
+ warning(_("failed to fetch bundles from '%s'"), bundle_uri);
+
+ if (all < 0) {
+ /*
+ * no --[no-]all given;
+ * only use config option if no remote was explicitly specified
+ */
+ all = (!argc) ? config.all : 0;
+ }
+
if (all) {
if (argc == 1)
die(_("fetch --all does not take a repository argument"));
else if (argc > 1)
die(_("fetch --all does not make sense with refspecs"));
+
(void) for_each_remote(get_one_remote_for_fetch, &list);
/* do not do fetch_multiple() of one */
@@ -2216,6 +2386,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
argv++;
}
}
+ string_list_remove_duplicates(&list, 0);
if (negotiate_only) {
struct oidset acked_commits = OIDSET_INIT;
@@ -2241,9 +2412,10 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
printf("%s\n", oid_to_hex(oid));
oidset_clear(&acked_commits);
} else if (remote) {
- if (filter_options.choice || has_promisor_remote())
+ if (filter_options.choice || repo_has_promisor_remote(the_repository))
fetch_one_setup_partial(remote);
- result = fetch_one(remote, argc, argv, prune_tags_ok, stdin_refspecs);
+ result = fetch_one(remote, argc, argv, prune_tags_ok, stdin_refspecs,
+ &config);
} else {
int max_children = max_jobs;
@@ -2260,13 +2432,12 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
"from one remote"));
if (max_children < 0)
- max_children = fetch_parallel_config;
+ max_children = config.parallel;
/* TODO should this also die if we have a previous partial-clone? */
- result = fetch_multiple(&list, max_children);
+ result = fetch_multiple(&list, max_children, &config);
}
-
/*
* This is only needed after fetch_one(), which does not fetch
* submodules by itself.
@@ -2276,20 +2447,20 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
* the fetched history from each remote, so there is no need
* to fetch submodules from here.
*/
- if (!result && remote && (recurse_submodules != RECURSE_SUBMODULES_OFF)) {
+ if (!result && remote && (config.recurse_submodules != RECURSE_SUBMODULES_OFF)) {
struct strvec options = STRVEC_INIT;
int max_children = max_jobs;
if (max_children < 0)
- max_children = submodule_fetch_jobs_config;
+ max_children = config.submodule_fetch_jobs;
if (max_children < 0)
- max_children = fetch_parallel_config;
+ max_children = config.parallel;
- add_options_to_argv(&options);
+ add_options_to_argv(&options, &config);
result = fetch_submodules(the_repository,
&options,
submodule_prefix,
- recurse_submodules,
+ config.recurse_submodules,
recurse_submodules_default,
verbosity < 0,
max_children);
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index 8d8fd39..0f9855b 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -1,6 +1,7 @@
#include "builtin.h"
#include "config.h"
#include "fmt-merge-msg.h"
+#include "gettext.h"
#include "parse-options.h"
static const char * const fmt_merge_msg_usage[] = {
diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
index 6f62f40..919282e 100644
--- a/builtin/for-each-ref.c
+++ b/builtin/for-each-ref.c
@@ -1,10 +1,12 @@
#include "builtin.h"
-#include "cache.h"
+#include "commit.h"
#include "config.h"
-#include "refs.h"
+#include "gettext.h"
#include "object.h"
#include "parse-options.h"
#include "ref-filter.h"
+#include "strbuf.h"
+#include "strvec.h"
static char const * const for_each_ref_usage[] = {
N_("git for-each-ref [<options>] [<pattern>]"),
@@ -16,15 +18,13 @@ static char const * const for_each_ref_usage[] = {
int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
{
- int i;
struct ref_sorting *sorting;
struct string_list sorting_options = STRING_LIST_INIT_DUP;
- int maxcount = 0, icase = 0;
- struct ref_array array;
- struct ref_filter filter;
+ int icase = 0, include_root_refs = 0, from_stdin = 0;
+ struct ref_filter filter = REF_FILTER_INIT;
struct ref_format format = REF_FORMAT_INIT;
- struct strbuf output = STRBUF_INIT;
- struct strbuf err = STRBUF_INIT;
+ unsigned int flags = FILTER_REFS_REGULAR;
+ struct strvec vec = STRVEC_INIT;
struct option opts[] = {
OPT_BIT('s', "shell", &format.quote_style,
@@ -35,11 +35,14 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
N_("quote placeholders suitably for python"), QUOTE_PYTHON),
OPT_BIT(0 , "tcl", &format.quote_style,
N_("quote placeholders suitably for Tcl"), QUOTE_TCL),
+ OPT_BOOL(0, "omit-empty", &format.array_opts.omit_empty,
+ N_("do not output a newline after empty formatted refs")),
OPT_GROUP(""),
- OPT_INTEGER( 0 , "count", &maxcount, N_("show only <n> matched refs")),
+ OPT_INTEGER( 0 , "count", &format.array_opts.max_count, N_("show only <n> matched refs")),
OPT_STRING( 0 , "format", &format.format, N_("format"), N_("format to use for the output")),
OPT__COLOR(&format.use_color, N_("respect format colors")),
+ OPT_REF_FILTER_EXCLUDE(&filter),
OPT_REF_SORT(&sorting_options),
OPT_CALLBACK(0, "points-at", &filter.points_at,
N_("object"), N_("print only refs which points at the given object"),
@@ -49,19 +52,21 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
OPT_CONTAINS(&filter.with_commit, N_("print only refs which contain the commit")),
OPT_NO_CONTAINS(&filter.no_commit, N_("print only refs which don't contain the commit")),
OPT_BOOL(0, "ignore-case", &icase, N_("sorting and filtering are case insensitive")),
+ OPT_BOOL(0, "stdin", &from_stdin, N_("read reference patterns from stdin")),
+ OPT_BOOL(0, "include-root-refs", &include_root_refs, N_("also include HEAD ref and pseudorefs")),
OPT_END(),
};
- memset(&array, 0, sizeof(array));
- memset(&filter, 0, sizeof(filter));
-
format.format = "%(objectname) %(objecttype)\t%(refname)";
git_config(git_default_config, NULL);
+ /* Set default (refname) sorting */
+ string_list_append(&sorting_options, "refname");
+
parse_options(argc, argv, prefix, opts, for_each_ref_usage, 0);
- if (maxcount < 0) {
- error("invalid --count argument: `%d'", maxcount);
+ if (format.array_opts.max_count < 0) {
+ error("invalid --count argument: `%d'", format.array_opts.max_count);
usage_with_options(for_each_ref_usage, opts);
}
if (HAS_MULTI_BITS(format.quote_style)) {
@@ -75,27 +80,31 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
ref_sorting_set_sort_flags_all(sorting, REF_SORTING_ICASE, icase);
filter.ignore_case = icase;
- filter.name_patterns = argv;
- filter.match_as_path = 1;
- filter_refs(&array, &filter, FILTER_REFS_ALL);
- ref_array_sort(sorting, &array);
-
- if (!maxcount || array.nr < maxcount)
- maxcount = array.nr;
- for (i = 0; i < maxcount; i++) {
- strbuf_reset(&err);
- strbuf_reset(&output);
- if (format_ref_array_item(array.items[i], &format, &output, &err))
- die("%s", err.buf);
- fwrite(output.buf, 1, output.len, stdout);
- putchar('\n');
+ if (from_stdin) {
+ struct strbuf line = STRBUF_INIT;
+
+ if (argv[0])
+ die(_("unknown arguments supplied with --stdin"));
+
+ while (strbuf_getline(&line, stdin) != EOF)
+ strvec_push(&vec, line.buf);
+
+ strbuf_release(&line);
+
+ /* vec.v is NULL-terminated, just like 'argv'. */
+ filter.name_patterns = vec.v;
+ } else {
+ filter.name_patterns = argv;
}
- strbuf_release(&err);
- strbuf_release(&output);
- ref_array_clear(&array);
- free_commit_list(filter.with_commit);
- free_commit_list(filter.no_commit);
+ if (include_root_refs)
+ flags |= FILTER_REFS_ROOT_REFS;
+
+ filter.match_as_path = 1;
+ filter_and_format_refs(&filter, flags, sorting, &format);
+
+ ref_filter_clear(&filter);
ref_sorting_release(sorting);
+ strvec_clear(&vec);
return 0;
}
diff --git a/builtin/for-each-repo.c b/builtin/for-each-repo.c
index fd86e5a..28186b3 100644
--- a/builtin/for-each-repo.c
+++ b/builtin/for-each-repo.c
@@ -1,12 +1,14 @@
-#include "cache.h"
-#include "config.h"
#include "builtin.h"
+#include "config.h"
+#include "gettext.h"
#include "parse-options.h"
+#include "path.h"
+#include "repository.h"
#include "run-command.h"
#include "string-list.h"
static const char * const for_each_repo_usage[] = {
- N_("git for-each-repo --config=<config> <command-args>"),
+ N_("git for-each-repo --config=<config> [--] <arguments>"),
NULL
};
@@ -14,13 +16,16 @@ static int run_command_on_repo(const char *path, int argc, const char ** argv)
{
int i;
struct child_process child = CHILD_PROCESS_INIT;
+ char *abspath = interpolate_path(path, 0);
child.git_cmd = 1;
- strvec_pushl(&child.args, "-C", path, NULL);
+ strvec_pushl(&child.args, "-C", abspath, NULL);
for (i = 0; i < argc; i++)
strvec_push(&child.args, argv[i]);
+ free(abspath);
+
return run_command(&child);
}
@@ -29,6 +34,7 @@ int cmd_for_each_repo(int argc, const char **argv, const char *prefix)
static const char *config_key = NULL;
int i, result = 0;
const struct string_list *values;
+ int err;
const struct option options[] = {
OPT_STRING(0, "config", &config_key, N_("config"),
@@ -42,14 +48,11 @@ int cmd_for_each_repo(int argc, const char **argv, const char *prefix)
if (!config_key)
die(_("missing --config=<config>"));
- values = repo_config_get_value_multi(the_repository,
- config_key);
-
- /*
- * Do nothing on an empty list, which is equivalent to the case
- * where the config variable does not exist at all.
- */
- if (!values)
+ err = repo_config_get_string_multi(the_repository, config_key, &values);
+ if (err < 0)
+ usage_msg_optf(_("got bad config --config=%s"),
+ for_each_repo_usage, options, config_key);
+ else if (err)
return 0;
for (i = 0; !result && i < values->nr; i++)
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 6c73092..f892487 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -1,6 +1,6 @@
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
#include "builtin.h"
-#include "cache.h"
+#include "gettext.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "commit.h"
@@ -10,18 +10,23 @@
#include "refs.h"
#include "pack.h"
#include "cache-tree.h"
-#include "tree-walk.h"
#include "fsck.h"
#include "parse-options.h"
-#include "dir.h"
#include "progress.h"
#include "streaming.h"
-#include "decorate.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "path.h"
+#include "read-cache-ll.h"
+#include "replace-object.h"
#include "resolve-undo.h"
#include "run-command.h"
+#include "sparse-index.h"
#include "worktree.h"
+#include "pack-revindex.h"
+#include "pack-bitmap.h"
#define REACHABLE 0x0001
#define SEEN 0x0002
@@ -51,6 +56,8 @@ static int name_objects;
#define ERROR_REFS 010
#define ERROR_COMMIT_GRAPH 020
#define ERROR_MULTI_PACK_INDEX 040
+#define ERROR_PACK_REV_INDEX 0100
+#define ERROR_BITMAP 0200
static const char *describe_object(const struct object_id *oid)
{
@@ -82,11 +89,11 @@ static int objerror(struct object *obj, const char *err)
return -1;
}
-static int fsck_error_func(struct fsck_options *o,
+static int fsck_error_func(struct fsck_options *o UNUSED,
const struct object_id *oid,
enum object_type object_type,
enum fsck_msg_type msg_type,
- enum fsck_msg_id msg_id,
+ enum fsck_msg_id msg_id UNUSED,
const char *message)
{
switch (msg_type) {
@@ -111,7 +118,7 @@ static int fsck_error_func(struct fsck_options *o,
static struct object_array pending;
static int mark_object(struct object *obj, enum object_type type,
- void *data, struct fsck_options *options)
+ void *data, struct fsck_options *options UNUSED)
{
struct object *parent = data;
@@ -196,8 +203,8 @@ static int traverse_reachable(void)
return !!result;
}
-static int mark_used(struct object *obj, enum object_type object_type,
- void *data, struct fsck_options *options)
+static int mark_used(struct object *obj, enum object_type type UNUSED,
+ void *data UNUSED, struct fsck_options *options UNUSED)
{
if (!obj)
return 1;
@@ -228,20 +235,22 @@ static void mark_unreachable_referents(const struct object_id *oid)
options.walk = mark_used;
fsck_walk(obj, NULL, &options);
+ if (obj->type == OBJ_TREE)
+ free_tree_buffer((struct tree *)obj);
}
static int mark_loose_unreachable_referents(const struct object_id *oid,
- const char *path,
- void *data)
+ const char *path UNUSED,
+ void *data UNUSED)
{
mark_unreachable_referents(oid);
return 0;
}
static int mark_packed_unreachable_referents(const struct object_id *oid,
- struct packed_git *pack,
- uint32_t pos,
- void *data)
+ struct packed_git *pack UNUSED,
+ uint32_t pos UNUSED,
+ void *data UNUSED)
{
mark_unreachable_referents(oid);
return 0;
@@ -437,9 +446,6 @@ static int fsck_obj(struct object *obj, void *buffer, unsigned long size)
out:
if (obj->type == OBJ_TREE)
free_tree_buffer((struct tree *)obj);
- if (obj->type == OBJ_COMMIT)
- free_commit_buffer(the_repository->parsed_objects,
- (struct commit *)obj);
return err;
}
@@ -488,8 +494,9 @@ static void fsck_handle_reflog_oid(const char *refname, struct object_id *oid,
}
static int fsck_handle_reflog_ent(struct object_id *ooid, struct object_id *noid,
- const char *email, timestamp_t timestamp, int tz,
- const char *message, void *cb_data)
+ const char *email UNUSED,
+ timestamp_t timestamp, int tz UNUSED,
+ const char *message UNUSED, void *cb_data)
{
const char *refname = cb_data;
@@ -502,8 +509,7 @@ static int fsck_handle_reflog_ent(struct object_id *ooid, struct object_id *noid
return 0;
}
-static int fsck_handle_reflog(const char *logname, const struct object_id *oid,
- int flag, void *cb_data)
+static int fsck_handle_reflog(const char *logname, void *cb_data)
{
struct strbuf refname = STRBUF_INIT;
@@ -514,7 +520,7 @@ static int fsck_handle_reflog(const char *logname, const struct object_id *oid,
}
static int fsck_handle_ref(const char *refname, const struct object_id *oid,
- int flag, void *cb_data)
+ int flag UNUSED, void *cb_data UNUSED)
{
struct object *obj;
@@ -660,14 +666,15 @@ static int fsck_loose(const struct object_id *oid, const char *path, void *data)
return 0; /* keep checking other objects, even if we saw an error */
}
-static int fsck_cruft(const char *basename, const char *path, void *data)
+static int fsck_cruft(const char *basename, const char *path,
+ void *data UNUSED)
{
if (!starts_with(basename, "tmp_obj_"))
fprintf_ln(stderr, _("bad sha1 file: %s"), path);
return 0;
}
-static int fsck_subdir(unsigned int nr, const char *path, void *data)
+static int fsck_subdir(unsigned int nr, const char *path UNUSED, void *data)
{
struct for_each_loose_cb *cb_data = data;
struct progress *progress = cb_data->progress;
@@ -731,19 +738,19 @@ static int fsck_head_link(const char *head_ref_name,
return 0;
}
-static int fsck_cache_tree(struct cache_tree *it)
+static int fsck_cache_tree(struct cache_tree *it, const char *index_path)
{
int i;
int err = 0;
if (verbose)
- fprintf_ln(stderr, _("Checking cache tree"));
+ fprintf_ln(stderr, _("Checking cache tree of %s"), index_path);
if (0 <= it->entry_count) {
struct object *obj = parse_object(the_repository, &it->oid);
if (!obj) {
- error(_("%s: invalid sha1 pointer in cache-tree"),
- oid_to_hex(&it->oid));
+ error(_("%s: invalid sha1 pointer in cache-tree of %s"),
+ oid_to_hex(&it->oid), index_path);
errors_found |= ERROR_REFS;
return 1;
}
@@ -754,11 +761,12 @@ static int fsck_cache_tree(struct cache_tree *it)
err |= objerror(obj, _("non-tree in cache-tree"));
}
for (i = 0; i < it->subtree_nr; i++)
- err |= fsck_cache_tree(it->down[i]->cache_tree);
+ err |= fsck_cache_tree(it->down[i]->cache_tree, index_path);
return err;
}
-static int fsck_resolve_undo(struct index_state *istate)
+static int fsck_resolve_undo(struct index_state *istate,
+ const char *index_path)
{
struct string_list_item *item;
struct string_list *resolve_undo = istate->resolve_undo;
@@ -781,8 +789,9 @@ static int fsck_resolve_undo(struct index_state *istate)
obj = parse_object(the_repository, &ru->oid[i]);
if (!obj) {
- error(_("%s: invalid sha1 pointer in resolve-undo"),
- oid_to_hex(&ru->oid[i]));
+ error(_("%s: invalid sha1 pointer in resolve-undo of %s"),
+ oid_to_hex(&ru->oid[i]),
+ index_path);
errors_found |= ERROR_REFS;
continue;
}
@@ -795,6 +804,38 @@ static int fsck_resolve_undo(struct index_state *istate)
return 0;
}
+static void fsck_index(struct index_state *istate, const char *index_path,
+ int is_current_worktree)
+{
+ unsigned int i;
+
+ /* TODO: audit for interaction with sparse-index. */
+ ensure_full_index(istate);
+ for (i = 0; i < istate->cache_nr; i++) {
+ unsigned int mode;
+ struct blob *blob;
+ struct object *obj;
+
+ mode = istate->cache[i]->ce_mode;
+ if (S_ISGITLINK(mode))
+ continue;
+ blob = lookup_blob(the_repository,
+ &istate->cache[i]->oid);
+ if (!blob)
+ continue;
+ obj = &blob->object;
+ obj->flags |= USED;
+ fsck_put_object_name(&fsck_walk_options, &obj->oid,
+ "%s:%s",
+ is_current_worktree ? "" : index_path,
+ istate->cache[i]->name);
+ mark_object_reachable(obj);
+ }
+ if (istate->cache_tree)
+ fsck_cache_tree(istate->cache_tree, index_path);
+ fsck_resolve_undo(istate, index_path);
+}
+
static void mark_object_for_connectivity(const struct object_id *oid)
{
struct object *obj = lookup_unknown_object(the_repository, oid);
@@ -802,24 +843,59 @@ static void mark_object_for_connectivity(const struct object_id *oid)
}
static int mark_loose_for_connectivity(const struct object_id *oid,
- const char *path,
- void *data)
+ const char *path UNUSED,
+ void *data UNUSED)
{
mark_object_for_connectivity(oid);
return 0;
}
static int mark_packed_for_connectivity(const struct object_id *oid,
- struct packed_git *pack,
- uint32_t pos,
- void *data)
+ struct packed_git *pack UNUSED,
+ uint32_t pos UNUSED,
+ void *data UNUSED)
{
mark_object_for_connectivity(oid);
return 0;
}
+static int check_pack_rev_indexes(struct repository *r, int show_progress)
+{
+ struct progress *progress = NULL;
+ uint32_t pack_count = 0;
+ int res = 0;
+
+ if (show_progress) {
+ for (struct packed_git *p = get_all_packs(r); p; p = p->next)
+ pack_count++;
+ progress = start_delayed_progress("Verifying reverse pack-indexes", pack_count);
+ pack_count = 0;
+ }
+
+ for (struct packed_git *p = get_all_packs(r); p; p = p->next) {
+ int load_error = load_pack_revindex_from_disk(p);
+
+ if (load_error < 0) {
+ error(_("unable to load rev-index for pack '%s'"), p->pack_name);
+ res = ERROR_PACK_REV_INDEX;
+ } else if (!load_error &&
+ !load_pack_revindex(r, p) &&
+ verify_pack_revindex(p)) {
+ error(_("invalid rev-index for pack '%s'"), p->pack_name);
+ res = ERROR_PACK_REV_INDEX;
+ }
+ display_progress(progress, ++pack_count);
+ }
+ stop_progress(&progress);
+
+ return res;
+}
+
static char const * const fsck_usage[] = {
- N_("git fsck [<options>] [<object>...]"),
+ N_("git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+ " [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+ " [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+ " [--[no-]name-objects] [<object>...]"),
NULL
};
@@ -850,7 +926,8 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
fetch_if_missing = 0;
errors_found = 0;
- read_replace_refs = 0;
+ disable_replace_refs();
+ save_commit_buffer = 0;
argc = parse_options(argc, argv, prefix, fsck_opts, fsck_usage, 0);
@@ -918,7 +995,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
for (i = 0; i < argc; i++) {
const char *arg = argv[i];
struct object_id oid;
- if (!get_oid(arg, &oid)) {
+ if (!repo_get_oid(the_repository, arg, &oid)) {
struct object *obj = lookup_object(the_repository,
&oid);
@@ -951,34 +1028,36 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
}
if (keep_cache_objects) {
+ struct worktree **worktrees, **p;
+
verify_index_checksum = 1;
verify_ce_order = 1;
- read_cache();
- /* TODO: audit for interaction with sparse-index. */
- ensure_full_index(&the_index);
- for (i = 0; i < active_nr; i++) {
- unsigned int mode;
- struct blob *blob;
- struct object *obj;
- mode = active_cache[i]->ce_mode;
- if (S_ISGITLINK(mode))
- continue;
- blob = lookup_blob(the_repository,
- &active_cache[i]->oid);
- if (!blob)
- continue;
- obj = &blob->object;
- obj->flags |= USED;
- fsck_put_object_name(&fsck_walk_options, &obj->oid,
- ":%s", active_cache[i]->name);
- mark_object_reachable(obj);
+ worktrees = get_worktrees();
+ for (p = worktrees; *p; p++) {
+ struct worktree *wt = *p;
+ struct index_state istate =
+ INDEX_STATE_INIT(the_repository);
+ char *path;
+
+ /*
+ * Make a copy since the buffer is reusable
+ * and may get overwritten by other calls
+ * while we're examining the index.
+ */
+ path = xstrdup(worktree_git_path(wt, "index"));
+ read_index_from(&istate, path, get_worktree_git_dir(wt));
+ fsck_index(&istate, path, wt->is_current);
+ discard_index(&istate);
+ free(path);
}
- if (active_cache_tree)
- fsck_cache_tree(active_cache_tree);
- fsck_resolve_undo(&the_index);
+ free_worktrees(worktrees);
}
+ errors_found |= check_pack_rev_indexes(the_repository, show_progress);
+ if (verify_bitmap_files(the_repository))
+ errors_found |= ERROR_BITMAP;
+
check_connectivity();
if (the_repository->settings.core_commit_graph) {
@@ -990,6 +1069,10 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
commit_graph_verify.git_cmd = 1;
strvec_pushl(&commit_graph_verify.args, "commit-graph",
"verify", "--object-dir", odb->path, NULL);
+ if (show_progress)
+ strvec_push(&commit_graph_verify.args, "--progress");
+ else
+ strvec_push(&commit_graph_verify.args, "--no-progress");
if (run_command(&commit_graph_verify))
errors_found |= ERROR_COMMIT_GRAPH;
}
@@ -1004,6 +1087,10 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
midx_verify.git_cmd = 1;
strvec_pushl(&midx_verify.args, "multi-pack-index",
"verify", "--object-dir", odb->path, NULL);
+ if (show_progress)
+ strvec_push(&midx_verify.args, "--progress");
+ else
+ strvec_push(&midx_verify.args, "--no-progress");
if (run_command(&midx_verify))
errors_found |= ERROR_MULTI_PACK_INDEX;
}
diff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c
index 2c109cf..1593713 100644
--- a/builtin/fsmonitor--daemon.c
+++ b/builtin/fsmonitor--daemon.c
@@ -1,20 +1,28 @@
#include "builtin.h"
+#include "abspath.h"
#include "config.h"
+#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
#include "parse-options.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
#include "fsmonitor-ipc.h"
+#include "fsmonitor-settings.h"
#include "compat/fsmonitor/fsm-health.h"
#include "compat/fsmonitor/fsm-listen.h"
#include "fsmonitor--daemon.h"
+#include "repository.h"
#include "simple-ipc.h"
#include "khash.h"
-#include "pkt-line.h"
+#include "run-command.h"
+#include "trace.h"
+#include "trace2.h"
static const char * const builtin_fsmonitor__daemon_usage[] = {
N_("git fsmonitor--daemon start [<options>]"),
N_("git fsmonitor--daemon run [<options>]"),
- N_("git fsmonitor--daemon stop"),
- N_("git fsmonitor--daemon status"),
+ "git fsmonitor--daemon stop",
+ "git fsmonitor--daemon status",
NULL
};
@@ -31,10 +39,11 @@ static int fsmonitor__start_timeout_sec = 60;
#define FSMONITOR__ANNOUNCE_STARTUP "fsmonitor.announcestartup"
static int fsmonitor__announce_startup = 0;
-static int fsmonitor_config(const char *var, const char *value, void *cb)
+static int fsmonitor_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(var, FSMONITOR__IPC_THREADS)) {
- int i = git_config_int(var, value);
+ int i = git_config_int(var, value, ctx->kvi);
if (i < 1)
return error(_("value of '%s' out of range: %d"),
FSMONITOR__IPC_THREADS, i);
@@ -43,7 +52,7 @@ static int fsmonitor_config(const char *var, const char *value, void *cb)
}
if (!strcmp(var, FSMONITOR__START_TIMEOUT)) {
- int i = git_config_int(var, value);
+ int i = git_config_int(var, value, ctx->kvi);
if (i < 0)
return error(_("value of '%s' out of range: %d"),
FSMONITOR__START_TIMEOUT, i);
@@ -53,7 +62,7 @@ static int fsmonitor_config(const char *var, const char *value, void *cb)
if (!strcmp(var, FSMONITOR__ANNOUNCE_STARTUP)) {
int is_bool;
- int i = git_config_bool_or_int(var, value, &is_bool);
+ int i = git_config_bool_or_int(var, value, ctx->kvi, &is_bool);
if (i < 0)
return error(_("value of '%s' not bool or int: %d"),
var, i);
@@ -61,7 +70,7 @@ static int fsmonitor_config(const char *var, const char *value, void *cb)
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
/*
@@ -121,8 +130,9 @@ struct fsmonitor_cookie_item {
enum fsmonitor_cookie_item_result result;
};
-static int cookies_cmp(const void *data, const struct hashmap_entry *he1,
- const struct hashmap_entry *he2, const void *keydata)
+static int cookies_cmp(const void *data UNUSED,
+ const struct hashmap_entry *he1,
+ const struct hashmap_entry *he2, const void *keydata)
{
const struct fsmonitor_cookie_item *a =
container_of(he1, const struct fsmonitor_cookie_item, entry);
@@ -709,6 +719,7 @@ static int do_handle_client(struct fsmonitor_daemon_state *state,
"fsmonitor: unsupported V1 protocol '%s'"),
command);
do_trivial = 1;
+ do_cookie = 1;
} else {
/* We have "builtin:*" */
@@ -718,6 +729,7 @@ static int do_handle_client(struct fsmonitor_daemon_state *state,
"fsmonitor: invalid V2 protocol token '%s'",
command);
do_trivial = 1;
+ do_cookie = 1;
} else {
/*
@@ -1208,7 +1220,7 @@ static int fsmonitor_run_daemon_1(struct fsmonitor_daemon_state *state)
* events.
*/
if (pthread_create(&state->listener_thread, NULL,
- fsm_listen__thread_proc, state) < 0) {
+ fsm_listen__thread_proc, state)) {
ipc_server_stop_async(state->ipc_server_data);
err = error(_("could not start fsmonitor listener thread"));
goto cleanup;
@@ -1219,7 +1231,7 @@ static int fsmonitor_run_daemon_1(struct fsmonitor_daemon_state *state)
* Start the health thread to watch over our process.
*/
if (pthread_create(&state->health_thread, NULL,
- fsm_health__thread_proc, state) < 0) {
+ fsm_health__thread_proc, state)) {
ipc_server_stop_async(state->ipc_server_data);
err = error(_("could not start fsmonitor health thread"));
goto cleanup;
@@ -1282,6 +1294,11 @@ static int fsmonitor_run_daemon(void)
strbuf_addstr(&state.path_worktree_watch, absolute_path(get_git_work_tree()));
state.nr_paths_watching = 1;
+ strbuf_init(&state.alias.alias, 0);
+ strbuf_init(&state.alias.points_to, 0);
+ if ((err = fsmonitor__get_alias(state.path_worktree_watch.buf, &state.alias)))
+ goto done;
+
/*
* We create and delete cookie files somewhere inside the .git
* directory to help us keep sync with the file system. If
@@ -1343,7 +1360,8 @@ static int fsmonitor_run_daemon(void)
* directory.)
*/
strbuf_init(&state.path_ipc, 0);
- strbuf_addstr(&state.path_ipc, absolute_path(fsmonitor_ipc__get_path()));
+ strbuf_addstr(&state.path_ipc,
+ absolute_path(fsmonitor_ipc__get_path(the_repository)));
/*
* Confirm that we can create platform-specific resources for the
@@ -1390,11 +1408,13 @@ done:
strbuf_release(&state.path_gitdir_watch);
strbuf_release(&state.path_cookie_prefix);
strbuf_release(&state.path_ipc);
+ strbuf_release(&state.alias.alias);
+ strbuf_release(&state.alias.points_to);
return err;
}
-static int try_to_run_foreground_daemon(int detach_console)
+static int try_to_run_foreground_daemon(int detach_console MAYBE_UNUSED)
{
/*
* Technically, we don't need to probe for an existing daemon
@@ -1424,7 +1444,8 @@ static int try_to_run_foreground_daemon(int detach_console)
static start_bg_wait_cb bg_wait_cb;
-static int bg_wait_cb(const struct child_process *cp, void *cb_data)
+static int bg_wait_cb(const struct child_process *cp UNUSED,
+ void *cb_data UNUSED)
{
enum ipc_active_state s = fsmonitor_ipc__get_state();
@@ -1563,7 +1584,7 @@ int cmd_fsmonitor__daemon(int argc, const char **argv, const char *prefix)
}
#else
-int cmd_fsmonitor__daemon(int argc, const char **argv, const char *prefix)
+int cmd_fsmonitor__daemon(int argc, const char **argv, const char *prefix UNUSED)
{
struct option options[] = {
OPT_END()
diff --git a/builtin/gc.c b/builtin/gc.c
index 021e925..d187cec 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -11,6 +11,10 @@
*/
#include "builtin.h"
+#include "abspath.h"
+#include "date.h"
+#include "environment.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "tempfile.h"
@@ -22,16 +26,21 @@
#include "commit.h"
#include "commit-graph.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
#include "pack.h"
#include "pack-objects.h"
+#include "path.h"
#include "blob.h"
#include "tree.h"
#include "promisor-remote.h"
#include "refs.h"
#include "remote.h"
#include "exec-cmd.h"
+#include "gettext.h"
#include "hook.h"
+#include "setup.h"
+#include "trace2.h"
#define FAILED_RUN "failed to run %s"
@@ -42,7 +51,8 @@ static const char * const builtin_gc_usage[] = {
static int pack_refs = 1;
static int prune_reflogs = 1;
-static int cruft_packs = 0;
+static int cruft_packs = 1;
+static unsigned long max_cruft_size;
static int aggressive_depth = 50;
static int aggressive_window = 250;
static int gc_auto_threshold = 6700;
@@ -52,6 +62,8 @@ static timestamp_t gc_log_expire_time;
static const char *gc_log_expire = "1.day.ago";
static const char *prune_expire = "2.weeks.ago";
static const char *prune_worktrees_expire = "3.months.ago";
+static char *repack_filter;
+static char *repack_filter_to;
static unsigned long big_pack_threshold;
static unsigned long max_delta_cache_size = DEFAULT_DELTA_CACHE_SIZE;
@@ -154,6 +166,7 @@ static void gc_config(void)
git_config_get_int("gc.autopacklimit", &gc_auto_pack_limit);
git_config_get_bool("gc.autodetach", &detach_auto);
git_config_get_bool("gc.cruftpacks", &cruft_packs);
+ git_config_get_ulong("gc.maxcruftsize", &max_cruft_size);
git_config_get_expiry("gc.pruneexpire", &prune_expire);
git_config_get_expiry("gc.worktreepruneexpire", &prune_worktrees_expire);
git_config_get_expiry("gc.logexpiry", &gc_log_expire);
@@ -161,16 +174,58 @@ static void gc_config(void)
git_config_get_ulong("gc.bigpackthreshold", &big_pack_threshold);
git_config_get_ulong("pack.deltacachesize", &max_delta_cache_size);
+ git_config_get_string("gc.repackfilter", &repack_filter);
+ git_config_get_string("gc.repackfilterto", &repack_filter_to);
+
git_config(git_default_config, NULL);
}
-struct maintenance_run_opts;
+enum schedule_priority {
+ SCHEDULE_NONE = 0,
+ SCHEDULE_WEEKLY = 1,
+ SCHEDULE_DAILY = 2,
+ SCHEDULE_HOURLY = 3,
+};
+
+static enum schedule_priority parse_schedule(const char *value)
+{
+ if (!value)
+ return SCHEDULE_NONE;
+ if (!strcasecmp(value, "hourly"))
+ return SCHEDULE_HOURLY;
+ if (!strcasecmp(value, "daily"))
+ return SCHEDULE_DAILY;
+ if (!strcasecmp(value, "weekly"))
+ return SCHEDULE_WEEKLY;
+ return SCHEDULE_NONE;
+}
+
+struct maintenance_run_opts {
+ int auto_flag;
+ int quiet;
+ enum schedule_priority schedule;
+};
+
+static int pack_refs_condition(void)
+{
+ /*
+ * The auto-repacking logic for refs is handled by the ref backends and
+ * exposed via `git pack-refs --auto`. We thus always return truish
+ * here and let the backend decide for us.
+ */
+ return 1;
+}
+
static int maintenance_task_pack_refs(MAYBE_UNUSED struct maintenance_run_opts *opts)
{
- struct strvec pack_refs_cmd = STRVEC_INIT;
- strvec_pushl(&pack_refs_cmd, "pack-refs", "--all", "--prune", NULL);
+ struct child_process cmd = CHILD_PROCESS_INIT;
- return run_command_v_opt(pack_refs_cmd.v, RUN_GIT_CMD);
+ cmd.git_cmd = 1;
+ strvec_pushl(&cmd.args, "pack-refs", "--all", "--prune", NULL);
+ if (opts->auto_flag)
+ strvec_push(&cmd.args, "--auto");
+
+ return run_command(&cmd);
}
static int too_many_loose_objects(void)
@@ -212,7 +267,7 @@ static struct packed_git *find_base_packs(struct string_list *packs,
struct packed_git *p, *base = NULL;
for (p = get_all_packs(the_repository); p; p = p->next) {
- if (!p->pack_local)
+ if (!p->pack_local || p->is_cruft)
continue;
if (limit) {
if (p->pack_size >= limit)
@@ -283,7 +338,7 @@ static uint64_t total_ram(void)
static uint64_t estimate_repack_memory(struct packed_git *pack)
{
- unsigned long nr_objects = approximate_object_count();
+ unsigned long nr_objects = repo_approximate_object_count(the_repository);
size_t os_cache, heap;
if (!pack || !nr_objects)
@@ -323,7 +378,7 @@ static uint64_t estimate_repack_memory(struct packed_git *pack)
return os_cache + heap;
}
-static int keep_one_pack(struct string_list_item *item, void *data)
+static int keep_one_pack(struct string_list_item *item, void *data UNUSED)
{
strvec_pushf(&repack, "--keep-pack=%s", basename(item->string));
return 0;
@@ -337,6 +392,9 @@ static void add_repack_all_option(struct string_list *keep_pack)
strvec_push(&repack, "--cruft");
if (prune_expire)
strvec_pushf(&repack, "--cruft-expiration=%s", prune_expire);
+ if (max_cruft_size)
+ strvec_pushf(&repack, "--max-cruft-size=%lu",
+ max_cruft_size);
} else {
strvec_push(&repack, "-A");
if (prune_expire)
@@ -345,6 +403,11 @@ static void add_repack_all_option(struct string_list *keep_pack)
if (keep_pack)
for_each_string_list(keep_pack, keep_one_pack, NULL);
+
+ if (repack_filter && *repack_filter)
+ strvec_pushf(&repack, "--filter=%s", repack_filter);
+ if (repack_filter_to && *repack_filter_to)
+ strvec_pushf(&repack, "--filter-to=%s", repack_filter_to);
}
static void add_repack_incremental_option(void)
@@ -522,7 +585,7 @@ done:
return ret;
}
-static void gc_before_repack(void)
+static void gc_before_repack(struct maintenance_run_opts *opts)
{
/*
* We may be called twice, as both the pre- and
@@ -533,17 +596,22 @@ static void gc_before_repack(void)
if (done++)
return;
- if (pack_refs && maintenance_task_pack_refs(NULL))
+ if (pack_refs && maintenance_task_pack_refs(opts))
die(FAILED_RUN, "pack-refs");
- if (prune_reflogs && run_command_v_opt(reflog.v, RUN_GIT_CMD))
- die(FAILED_RUN, reflog.v[0]);
+ if (prune_reflogs) {
+ struct child_process cmd = CHILD_PROCESS_INIT;
+
+ cmd.git_cmd = 1;
+ strvec_pushv(&cmd.args, reflog.v);
+ if (run_command(&cmd))
+ die(FAILED_RUN, reflog.v[0]);
+ }
}
int cmd_gc(int argc, const char **argv, const char *prefix)
{
int aggressive = 0;
- int auto_gc = 0;
int quiet = 0;
int force = 0;
const char *name;
@@ -551,6 +619,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
int daemonized = 0;
int keep_largest_pack = -1;
timestamp_t dummy;
+ struct child_process rerere_cmd = CHILD_PROCESS_INIT;
+ struct maintenance_run_opts opts = {0};
struct option builtin_gc_options[] = {
OPT__QUIET(&quiet, N_("suppress progress reporting")),
@@ -558,8 +628,10 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
N_("prune unreferenced objects"),
PARSE_OPT_OPTARG, NULL, (intptr_t)prune_expire },
OPT_BOOL(0, "cruft", &cruft_packs, N_("pack unreferenced objects separately")),
+ OPT_MAGNITUDE(0, "max-cruft-size", &max_cruft_size,
+ N_("with --cruft, limit the size of new cruft packs")),
OPT_BOOL(0, "aggressive", &aggressive, N_("be more thorough (increased runtime)")),
- OPT_BOOL_F(0, "auto", &auto_gc, N_("enable auto-gc mode"),
+ OPT_BOOL_F(0, "auto", &opts.auto_flag, N_("enable auto-gc mode"),
PARSE_OPT_NOCOMPLETE),
OPT_BOOL_F(0, "force", &force,
N_("force running gc even if there may be another gc running"),
@@ -604,7 +676,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
if (quiet)
strvec_push(&repack, "-q");
- if (auto_gc) {
+ if (opts.auto_flag) {
/*
* Auto-gc should be least intrusive as possible.
*/
@@ -629,7 +701,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
if (lock_repo_for_gc(force, &pid))
return 0;
- gc_before_repack(); /* dies on failure */
+ gc_before_repack(&opts); /* dies on failure */
delete_tempfile(&pidfile);
/*
@@ -654,7 +726,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
name = lock_repo_for_gc(force, &pid);
if (name) {
- if (auto_gc)
+ if (opts.auto_flag)
return 0; /* be quiet on --auto */
die(_("gc is already running on machine '%s' pid %"PRIuMAX" (use --force if not)"),
name, (uintmax_t)pid);
@@ -669,33 +741,47 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
atexit(process_log_file_at_exit);
}
- gc_before_repack();
+ gc_before_repack(&opts);
if (!repository_format_precious_objects) {
- if (run_command_v_opt(repack.v,
- RUN_GIT_CMD | RUN_CLOSE_OBJECT_STORE))
+ struct child_process repack_cmd = CHILD_PROCESS_INIT;
+
+ repack_cmd.git_cmd = 1;
+ repack_cmd.close_object_store = 1;
+ strvec_pushv(&repack_cmd.args, repack.v);
+ if (run_command(&repack_cmd))
die(FAILED_RUN, repack.v[0]);
if (prune_expire) {
+ struct child_process prune_cmd = CHILD_PROCESS_INIT;
+
/* run `git prune` even if using cruft packs */
strvec_push(&prune, prune_expire);
if (quiet)
strvec_push(&prune, "--no-progress");
- if (has_promisor_remote())
+ if (repo_has_promisor_remote(the_repository))
strvec_push(&prune,
"--exclude-promisor-objects");
- if (run_command_v_opt(prune.v, RUN_GIT_CMD))
+ prune_cmd.git_cmd = 1;
+ strvec_pushv(&prune_cmd.args, prune.v);
+ if (run_command(&prune_cmd))
die(FAILED_RUN, prune.v[0]);
}
}
if (prune_worktrees_expire) {
+ struct child_process prune_worktrees_cmd = CHILD_PROCESS_INIT;
+
strvec_push(&prune_worktrees, prune_worktrees_expire);
- if (run_command_v_opt(prune_worktrees.v, RUN_GIT_CMD))
+ prune_worktrees_cmd.git_cmd = 1;
+ strvec_pushv(&prune_worktrees_cmd.args, prune_worktrees.v);
+ if (run_command(&prune_worktrees_cmd))
die(FAILED_RUN, prune_worktrees.v[0]);
}
- if (run_command_v_opt(rerere.v, RUN_GIT_CMD))
+ rerere_cmd.git_cmd = 1;
+ strvec_pushv(&rerere_cmd.args, rerere.v);
+ if (run_command(&rerere_cmd))
die(FAILED_RUN, rerere.v[0]);
report_garbage = report_pack_garbage;
@@ -705,13 +791,12 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
clean_pack_garbage();
}
- prepare_repo_settings(the_repository);
if (the_repository->settings.gc_write_commit_graph == 1)
write_commit_graph_reachable(the_repository->objects->odb,
!quiet && !daemonized ? COMMIT_GRAPH_WRITE_PROGRESS : 0,
NULL);
- if (auto_gc && too_many_loose_objects())
+ if (opts.auto_flag && too_many_loose_objects())
warning(_("There are too many unreachable loose objects; "
"run 'git prune' to remove them."));
@@ -726,26 +811,6 @@ static const char *const builtin_maintenance_run_usage[] = {
NULL
};
-enum schedule_priority {
- SCHEDULE_NONE = 0,
- SCHEDULE_WEEKLY = 1,
- SCHEDULE_DAILY = 2,
- SCHEDULE_HOURLY = 3,
-};
-
-static enum schedule_priority parse_schedule(const char *value)
-{
- if (!value)
- return SCHEDULE_NONE;
- if (!strcasecmp(value, "hourly"))
- return SCHEDULE_HOURLY;
- if (!strcasecmp(value, "daily"))
- return SCHEDULE_DAILY;
- if (!strcasecmp(value, "weekly"))
- return SCHEDULE_WEEKLY;
- return SCHEDULE_NONE;
-}
-
static int maintenance_opt_schedule(const struct option *opt, const char *arg,
int unset)
{
@@ -762,12 +827,6 @@ static int maintenance_opt_schedule(const struct option *opt, const char *arg,
return 0;
}
-struct maintenance_run_opts {
- int auto_flag;
- int quiet;
- enum schedule_priority schedule;
-};
-
/* Remember to update object flag allocation in object.h */
#define SEEN (1u<<0)
@@ -776,8 +835,9 @@ struct cg_auto_data {
int limit;
};
-static int dfs_on_ref(const char *refname,
- const struct object_id *oid, int flags,
+static int dfs_on_ref(const char *refname UNUSED,
+ const struct object_id *oid,
+ int flags UNUSED,
void *cb_data)
{
struct cg_auto_data *data = (struct cg_auto_data *)cb_data;
@@ -794,7 +854,7 @@ static int dfs_on_ref(const char *refname,
commit = lookup_commit(the_repository, oid);
if (!commit)
return 0;
- if (parse_commit(commit) ||
+ if (repo_parse_commit(the_repository, commit) ||
commit_graph_position(commit) != COMMIT_NOT_FROM_GRAPH)
return 0;
@@ -811,7 +871,7 @@ static int dfs_on_ref(const char *refname,
commit = pop_commit(&stack);
for (parent = commit->parents; parent; parent = parent->next) {
- if (parse_commit(parent->item) ||
+ if (repo_parse_commit(the_repository, parent->item) ||
commit_graph_position(parent->item) != COMMIT_NOT_FROM_GRAPH ||
parent->item->object.flags & SEEN)
continue;
@@ -904,12 +964,6 @@ static int fetch_remote(struct remote *remote, void *cbdata)
static int maintenance_task_prefetch(struct maintenance_run_opts *opts)
{
- git_config_set_multivar_gently("log.excludedecoration",
- "refs/prefetch/",
- "refs/prefetch/",
- CONFIG_FLAGS_FIXED_VALUE |
- CONFIG_FLAGS_MULTI_REPLACE);
-
if (for_each_remote(fetch_remote, opts)) {
error(_("failed to prefetch remotes"));
return 1;
@@ -956,9 +1010,9 @@ struct write_loose_object_data {
static int loose_object_auto_limit = 100;
-static int loose_object_count(const struct object_id *oid,
- const char *path,
- void *data)
+static int loose_object_count(const struct object_id *oid UNUSED,
+ const char *path UNUSED,
+ void *data)
{
int *count = (int*)data;
if (++(*count) >= loose_object_auto_limit)
@@ -983,15 +1037,15 @@ static int loose_object_auto_condition(void)
NULL, NULL, &count);
}
-static int bail_on_loose(const struct object_id *oid,
- const char *path,
- void *data)
+static int bail_on_loose(const struct object_id *oid UNUSED,
+ const char *path UNUSED,
+ void *data UNUSED)
{
return 1;
}
static int write_loose_object_to_stdin(const struct object_id *oid,
- const char *path,
+ const char *path UNUSED,
void *data)
{
struct write_loose_object_data *d = (struct write_loose_object_data *)data;
@@ -1254,7 +1308,7 @@ static struct maintenance_task tasks[] = {
[TASK_PACK_REFS] = {
"pack-refs",
maintenance_task_pack_refs,
- NULL,
+ pack_refs_condition,
},
};
@@ -1378,7 +1432,7 @@ static void initialize_task_config(int schedule)
strbuf_release(&config_name);
}
-static int task_option_parse(const struct option *opt,
+static int task_option_parse(const struct option *opt UNUSED,
const char *arg, int unset)
{
int i, num_selected = 0;
@@ -1459,63 +1513,140 @@ static char *get_maintpath(void)
return strbuf_detach(&sb, NULL);
}
-static int maintenance_register(void)
+static char const * const builtin_maintenance_register_usage[] = {
+ "git maintenance register [--config-file <path>]",
+ NULL
+};
+
+static int maintenance_register(int argc, const char **argv, const char *prefix)
{
- int rc;
- char *config_value;
- struct child_process config_set = CHILD_PROCESS_INIT;
- struct child_process config_get = CHILD_PROCESS_INIT;
+ char *config_file = NULL;
+ struct option options[] = {
+ OPT_STRING(0, "config-file", &config_file, N_("file"), N_("use given config file")),
+ OPT_END(),
+ };
+ int found = 0;
+ const char *key = "maintenance.repo";
char *maintpath = get_maintpath();
+ struct string_list_item *item;
+ const struct string_list *list;
+
+ argc = parse_options(argc, argv, prefix, options,
+ builtin_maintenance_register_usage, 0);
+ if (argc)
+ usage_with_options(builtin_maintenance_register_usage,
+ options);
/* Disable foreground maintenance */
git_config_set("maintenance.auto", "false");
/* Set maintenance strategy, if unset */
- if (!git_config_get_string("maintenance.strategy", &config_value))
- free(config_value);
- else
+ if (git_config_get("maintenance.strategy"))
git_config_set("maintenance.strategy", "incremental");
- config_get.git_cmd = 1;
- strvec_pushl(&config_get.args, "config", "--global", "--get",
- "--fixed-value", "maintenance.repo", maintpath, NULL);
- config_get.out = -1;
-
- if (start_command(&config_get)) {
- rc = error(_("failed to run 'git config'"));
- goto done;
- }
-
- /* We already have this value in our config! */
- if (!finish_command(&config_get)) {
- rc = 0;
- goto done;
+ if (!git_config_get_string_multi(key, &list)) {
+ for_each_string_list_item(item, list) {
+ if (!strcmp(maintpath, item->string)) {
+ found = 1;
+ break;
+ }
+ }
}
- config_set.git_cmd = 1;
- strvec_pushl(&config_set.args, "config", "--add", "--global", "maintenance.repo",
- maintpath, NULL);
+ if (!found) {
+ int rc;
+ char *global_config_file = NULL;
- rc = run_command(&config_set);
+ if (!config_file) {
+ global_config_file = git_global_config();
+ config_file = global_config_file;
+ }
+ if (!config_file)
+ die(_("$HOME not set"));
+ rc = git_config_set_multivar_in_file_gently(
+ config_file, "maintenance.repo", maintpath,
+ CONFIG_REGEX_NONE, NULL, 0);
+ free(global_config_file);
+
+ if (rc)
+ die(_("unable to add '%s' value of '%s'"),
+ key, maintpath);
+ }
-done:
free(maintpath);
- return rc;
+ return 0;
}
-static int maintenance_unregister(void)
+static char const * const builtin_maintenance_unregister_usage[] = {
+ "git maintenance unregister [--config-file <path>] [--force]",
+ NULL
+};
+
+static int maintenance_unregister(int argc, const char **argv, const char *prefix)
{
- int rc;
- struct child_process config_unset = CHILD_PROCESS_INIT;
+ int force = 0;
+ char *config_file = NULL;
+ struct option options[] = {
+ OPT_STRING(0, "config-file", &config_file, N_("file"), N_("use given config file")),
+ OPT__FORCE(&force,
+ N_("return success even if repository was not registered"),
+ PARSE_OPT_NOCOMPLETE),
+ OPT_END(),
+ };
+ const char *key = "maintenance.repo";
char *maintpath = get_maintpath();
+ int found = 0;
+ struct string_list_item *item;
+ const struct string_list *list;
+ struct config_set cs = { { 0 } };
+
+ argc = parse_options(argc, argv, prefix, options,
+ builtin_maintenance_unregister_usage, 0);
+ if (argc)
+ usage_with_options(builtin_maintenance_unregister_usage,
+ options);
- config_unset.git_cmd = 1;
- strvec_pushl(&config_unset.args, "config", "--global", "--unset",
- "--fixed-value", "maintenance.repo", maintpath, NULL);
+ if (config_file) {
+ git_configset_init(&cs);
+ git_configset_add_file(&cs, config_file);
+ }
+ if (!(config_file
+ ? git_configset_get_string_multi(&cs, key, &list)
+ : git_config_get_string_multi(key, &list))) {
+ for_each_string_list_item(item, list) {
+ if (!strcmp(maintpath, item->string)) {
+ found = 1;
+ break;
+ }
+ }
+ }
- rc = run_command(&config_unset);
+ if (found) {
+ int rc;
+ char *global_config_file = NULL;
+
+ if (!config_file) {
+ global_config_file = git_global_config();
+ config_file = global_config_file;
+ }
+ if (!config_file)
+ die(_("$HOME not set"));
+ rc = git_config_set_multivar_in_file_gently(
+ config_file, key, NULL, maintpath, NULL,
+ CONFIG_FLAGS_MULTI_REPLACE | CONFIG_FLAGS_FIXED_VALUE);
+ free(global_config_file);
+
+ if (rc &&
+ (!force || rc == CONFIG_NOTHING_SET))
+ die(_("unable to unset '%s' value of '%s'"),
+ key, maintpath);
+ } else if (!force) {
+ die(_("repository '%s' is not registered"), maintpath);
+ }
+
+ git_configset_clear(&cs);
free(maintpath);
- return rc;
+ return 0;
}
static const char *get_frequency(enum schedule_priority schedule)
@@ -1583,11 +1714,11 @@ static int get_schedule_cmd(const char **cmd, int *is_available)
if (is_available)
*is_available = 0;
- string_list_split_in_place(&list, testing, ',', -1);
+ string_list_split_in_place(&list, testing, ",", -1);
for_each_string_list_item(item, &list) {
struct string_list pair = STRING_LIST_INIT_NODUP;
- if (string_list_split_in_place(&pair, item->string, ':', 2) != 2)
+ if (string_list_split_in_place(&pair, item->string, ":", 2) != 2)
continue;
if (!strcmp(*cmd, pair.items[0].string)) {
@@ -1605,6 +1736,15 @@ static int get_schedule_cmd(const char **cmd, int *is_available)
return 1;
}
+static int get_random_minute(void)
+{
+ /* Use a static value when under tests. */
+ if (getenv("GIT_TEST_MAINT_SCHEDULER"))
+ return 13;
+
+ return git_rand() % 60;
+}
+
static int is_launchctl_available(void)
{
const char *cmd = "launchctl";
@@ -1717,6 +1857,7 @@ static int launchctl_schedule_plist(const char *exec_path, enum schedule_priorit
struct strbuf plist = STRBUF_INIT, plist2 = STRBUF_INIT;
struct stat st;
const char *cmd = "launchctl";
+ int minute = get_random_minute();
get_schedule_cmd(&cmd, NULL);
preamble = "<?xml version=\"1.0\"?>\n"
@@ -1742,29 +1883,30 @@ static int launchctl_schedule_plist(const char *exec_path, enum schedule_priorit
case SCHEDULE_HOURLY:
repeat = "<dict>\n"
"<key>Hour</key><integer>%d</integer>\n"
- "<key>Minute</key><integer>0</integer>\n"
+ "<key>Minute</key><integer>%d</integer>\n"
"</dict>\n";
for (i = 1; i <= 23; i++)
- strbuf_addf(&plist, repeat, i);
+ strbuf_addf(&plist, repeat, i, minute);
break;
case SCHEDULE_DAILY:
repeat = "<dict>\n"
"<key>Day</key><integer>%d</integer>\n"
"<key>Hour</key><integer>0</integer>\n"
- "<key>Minute</key><integer>0</integer>\n"
+ "<key>Minute</key><integer>%d</integer>\n"
"</dict>\n";
for (i = 1; i <= 6; i++)
- strbuf_addf(&plist, repeat, i);
+ strbuf_addf(&plist, repeat, i, minute);
break;
case SCHEDULE_WEEKLY:
- strbuf_addstr(&plist,
- "<dict>\n"
- "<key>Day</key><integer>0</integer>\n"
- "<key>Hour</key><integer>0</integer>\n"
- "<key>Minute</key><integer>0</integer>\n"
- "</dict>\n");
+ strbuf_addf(&plist,
+ "<dict>\n"
+ "<key>Day</key><integer>0</integer>\n"
+ "<key>Hour</key><integer>0</integer>\n"
+ "<key>Minute</key><integer>%d</integer>\n"
+ "</dict>\n",
+ minute);
break;
default:
@@ -1820,7 +1962,7 @@ static int launchctl_add_plists(void)
launchctl_schedule_plist(exec_path, SCHEDULE_WEEKLY);
}
-static int launchctl_update_schedule(int run_maintenance, int fd)
+static int launchctl_update_schedule(int run_maintenance, int fd UNUSED)
{
if (run_maintenance)
return launchctl_add_plists();
@@ -1852,20 +1994,16 @@ static char *schtasks_task_name(const char *frequency)
static int schtasks_remove_task(enum schedule_priority schedule)
{
const char *cmd = "schtasks";
- int result;
- struct strvec args = STRVEC_INIT;
+ struct child_process child = CHILD_PROCESS_INIT;
const char *frequency = get_frequency(schedule);
char *name = schtasks_task_name(frequency);
get_schedule_cmd(&cmd, NULL);
- strvec_split(&args, cmd);
- strvec_pushl(&args, "/delete", "/tn", name, "/f", NULL);
-
- result = run_command_v_opt(args.v, 0);
-
- strvec_clear(&args);
+ strvec_split(&child.args, cmd);
+ strvec_pushl(&child.args, "/delete", "/tn", name, "/f", NULL);
free(name);
- return result;
+
+ return run_command(&child);
}
static int schtasks_remove_tasks(void)
@@ -1885,6 +2023,7 @@ static int schtasks_schedule_task(const char *exec_path, enum schedule_priority
const char *frequency = get_frequency(schedule);
char *name = schtasks_task_name(frequency);
struct strbuf tfilename = STRBUF_INIT;
+ int minute = get_random_minute();
get_schedule_cmd(&cmd, NULL);
@@ -1905,7 +2044,7 @@ static int schtasks_schedule_task(const char *exec_path, enum schedule_priority
switch (schedule) {
case SCHEDULE_HOURLY:
fprintf(tfile->fp,
- "<StartBoundary>2020-01-01T01:00:00</StartBoundary>\n"
+ "<StartBoundary>2020-01-01T01:%02d:00</StartBoundary>\n"
"<Enabled>true</Enabled>\n"
"<ScheduleByDay>\n"
"<DaysInterval>1</DaysInterval>\n"
@@ -1914,12 +2053,13 @@ static int schtasks_schedule_task(const char *exec_path, enum schedule_priority
"<Interval>PT1H</Interval>\n"
"<Duration>PT23H</Duration>\n"
"<StopAtDurationEnd>false</StopAtDurationEnd>\n"
- "</Repetition>\n");
+ "</Repetition>\n",
+ minute);
break;
case SCHEDULE_DAILY:
fprintf(tfile->fp,
- "<StartBoundary>2020-01-01T00:00:00</StartBoundary>\n"
+ "<StartBoundary>2020-01-01T00:%02d:00</StartBoundary>\n"
"<Enabled>true</Enabled>\n"
"<ScheduleByWeek>\n"
"<DaysOfWeek>\n"
@@ -1931,19 +2071,21 @@ static int schtasks_schedule_task(const char *exec_path, enum schedule_priority
"<Saturday />\n"
"</DaysOfWeek>\n"
"<WeeksInterval>1</WeeksInterval>\n"
- "</ScheduleByWeek>\n");
+ "</ScheduleByWeek>\n",
+ minute);
break;
case SCHEDULE_WEEKLY:
fprintf(tfile->fp,
- "<StartBoundary>2020-01-01T00:00:00</StartBoundary>\n"
+ "<StartBoundary>2020-01-01T00:%02d:00</StartBoundary>\n"
"<Enabled>true</Enabled>\n"
"<ScheduleByWeek>\n"
"<DaysOfWeek>\n"
"<Sunday />\n"
"</DaysOfWeek>\n"
"<WeeksInterval>1</WeeksInterval>\n"
- "</ScheduleByWeek>\n");
+ "</ScheduleByWeek>\n",
+ minute);
break;
default:
@@ -1969,7 +2111,7 @@ static int schtasks_schedule_task(const char *exec_path, enum schedule_priority
"</Settings>\n"
"<Actions Context=\"Author\">\n"
"<Exec>\n"
- "<Command>\"%s\\git.exe\"</Command>\n"
+ "<Command>\"%s\\headless-git.exe\"</Command>\n"
"<Arguments>--exec-path=\"%s\" for-each-repo --config=maintenance.repo maintenance run --schedule=%s</Arguments>\n"
"</Exec>\n"
"</Actions>\n"
@@ -2001,7 +2143,7 @@ static int schtasks_schedule_tasks(void)
schtasks_schedule_task(exec_path, SCHEDULE_WEEKLY);
}
-static int schtasks_update_schedule(int run_maintenance, int fd)
+static int schtasks_update_schedule(int run_maintenance, int fd UNUSED)
{
if (run_maintenance)
return schtasks_schedule_tasks();
@@ -2059,6 +2201,8 @@ static int crontab_update_schedule(int run_maintenance, int fd)
struct child_process crontab_edit = CHILD_PROCESS_INIT;
FILE *cron_list, *cron_in;
struct strbuf line = STRBUF_INIT;
+ struct tempfile *tmpedit = NULL;
+ int minute = get_random_minute();
get_schedule_cmd(&cmd, NULL);
strvec_split(&crontab_list.args, cmd);
@@ -2073,6 +2217,17 @@ static int crontab_update_schedule(int run_maintenance, int fd)
/* Ignore exit code, as an empty crontab will return error. */
finish_command(&crontab_list);
+ tmpedit = mks_tempfile_t(".git_cron_edit_tmpXXXXXX");
+ if (!tmpedit) {
+ result = error(_("failed to create crontab temporary file"));
+ goto out;
+ }
+ cron_in = fdopen_tempfile(tmpedit, "w");
+ if (!cron_in) {
+ result = error(_("failed to open temporary file"));
+ goto out;
+ }
+
/*
* Read from the .lock file, filtering out the old
* schedule while appending the new schedule.
@@ -2080,19 +2235,6 @@ static int crontab_update_schedule(int run_maintenance, int fd)
cron_list = fdopen(fd, "r");
rewind(cron_list);
- strvec_split(&crontab_edit.args, cmd);
- crontab_edit.in = -1;
- crontab_edit.git_cmd = 0;
-
- if (start_command(&crontab_edit))
- return error(_("failed to run 'crontab'; your system might not support 'cron'"));
-
- cron_in = fdopen(crontab_edit.in, "w");
- if (!cron_in) {
- result = error(_("failed to open stdin of 'crontab'"));
- goto done_editing;
- }
-
while (!strbuf_getline_lf(&line, cron_list)) {
if (!in_old_region && !strcmp(line.buf, BEGIN_LINE))
in_old_region = 1;
@@ -2115,25 +2257,33 @@ static int crontab_update_schedule(int run_maintenance, int fd)
"# replaced in the future by a Git command.\n\n");
strbuf_addf(&line_format,
- "%%s %%s * * %%s \"%s/git\" --exec-path=\"%s\" for-each-repo --config=maintenance.repo maintenance run --schedule=%%s\n",
+ "%%d %%s * * %%s \"%s/git\" --exec-path=\"%s\" for-each-repo --config=maintenance.repo maintenance run --schedule=%%s\n",
exec_path, exec_path);
- fprintf(cron_in, line_format.buf, "0", "1-23", "*", "hourly");
- fprintf(cron_in, line_format.buf, "0", "0", "1-6", "daily");
- fprintf(cron_in, line_format.buf, "0", "0", "0", "weekly");
+ fprintf(cron_in, line_format.buf, minute, "1-23", "*", "hourly");
+ fprintf(cron_in, line_format.buf, minute, "0", "1-6", "daily");
+ fprintf(cron_in, line_format.buf, minute, "0", "0", "weekly");
strbuf_release(&line_format);
fprintf(cron_in, "\n%s\n", END_LINE);
}
fflush(cron_in);
- fclose(cron_in);
- close(crontab_edit.in);
-done_editing:
+ strvec_split(&crontab_edit.args, cmd);
+ strvec_push(&crontab_edit.args, get_tempfile_path(tmpedit));
+ crontab_edit.git_cmd = 0;
+
+ if (start_command(&crontab_edit)) {
+ result = error(_("failed to run 'crontab'; your system might not support 'cron'"));
+ goto out;
+ }
+
if (finish_command(&crontab_edit))
result = error(_("'crontab' died"));
else
fclose(cron_list);
+out:
+ delete_tempfile(&tmpedit);
return result;
}
@@ -2170,77 +2320,54 @@ static char *xdg_config_home_systemd(const char *filename)
return xdg_config_home_for("systemd/user", filename);
}
-static int systemd_timer_enable_unit(int enable,
- enum schedule_priority schedule)
-{
- const char *cmd = "systemctl";
- struct child_process child = CHILD_PROCESS_INIT;
- const char *frequency = get_frequency(schedule);
+#define SYSTEMD_UNIT_FORMAT "git-maintenance@%s.%s"
- /*
- * Disabling the systemd unit while it is already disabled makes
- * systemctl print an error.
- * Let's ignore it since it means we already are in the expected state:
- * the unit is disabled.
- *
- * On the other hand, enabling a systemd unit which is already enabled
- * produces no error.
- */
- if (!enable)
- child.no_stderr = 1;
-
- get_schedule_cmd(&cmd, NULL);
- strvec_split(&child.args, cmd);
- strvec_pushl(&child.args, "--user", enable ? "enable" : "disable",
- "--now", NULL);
- strvec_pushf(&child.args, "git-maintenance@%s.timer", frequency);
-
- if (start_command(&child))
- return error(_("failed to start systemctl"));
- if (finish_command(&child))
- /*
- * Disabling an already disabled systemd unit makes
- * systemctl fail.
- * Let's ignore this failure.
- *
- * Enabling an enabled systemd unit doesn't fail.
- */
- if (enable)
- return error(_("failed to run systemctl"));
- return 0;
-}
-
-static int systemd_timer_delete_unit_templates(void)
+static int systemd_timer_delete_timer_file(enum schedule_priority priority)
{
int ret = 0;
- char *filename = xdg_config_home_systemd("git-maintenance@.timer");
- if (unlink(filename) && !is_missing_file_error(errno))
- ret = error_errno(_("failed to delete '%s'"), filename);
- FREE_AND_NULL(filename);
+ const char *frequency = get_frequency(priority);
+ char *local_timer_name = xstrfmt(SYSTEMD_UNIT_FORMAT, frequency, "timer");
+ char *filename = xdg_config_home_systemd(local_timer_name);
- filename = xdg_config_home_systemd("git-maintenance@.service");
if (unlink(filename) && !is_missing_file_error(errno))
ret = error_errno(_("failed to delete '%s'"), filename);
free(filename);
+ free(local_timer_name);
return ret;
}
-static int systemd_timer_delete_units(void)
+static int systemd_timer_delete_service_template(void)
{
- return systemd_timer_enable_unit(0, SCHEDULE_HOURLY) ||
- systemd_timer_enable_unit(0, SCHEDULE_DAILY) ||
- systemd_timer_enable_unit(0, SCHEDULE_WEEKLY) ||
- systemd_timer_delete_unit_templates();
+ int ret = 0;
+ char *local_service_name = xstrfmt(SYSTEMD_UNIT_FORMAT, "", "service");
+ char *filename = xdg_config_home_systemd(local_service_name);
+ if (unlink(filename) && !is_missing_file_error(errno))
+ ret = error_errno(_("failed to delete '%s'"), filename);
+
+ free(filename);
+ free(local_service_name);
+ return ret;
}
-static int systemd_timer_write_unit_templates(const char *exec_path)
+/*
+ * Write the schedule information into a git-maintenance@<schedule>.timer
+ * file using a custom minute. This timer file cannot use the templating
+ * system, so we generate a specific file for each.
+ */
+static int systemd_timer_write_timer_file(enum schedule_priority schedule,
+ int minute)
{
+ int res = -1;
char *filename;
FILE *file;
const char *unit;
+ char *schedule_pattern = NULL;
+ const char *frequency = get_frequency(schedule);
+ char *local_timer_name = xstrfmt(SYSTEMD_UNIT_FORMAT, frequency, "timer");
+
+ filename = xdg_config_home_systemd(local_timer_name);
- filename = xdg_config_home_systemd("git-maintenance@.timer");
if (safe_create_leading_directories(filename)) {
error(_("failed to create directories for '%s'"), filename);
goto error;
@@ -2249,6 +2376,23 @@ static int systemd_timer_write_unit_templates(const char *exec_path)
if (!file)
goto error;
+ switch (schedule) {
+ case SCHEDULE_HOURLY:
+ schedule_pattern = xstrfmt("*-*-* 1..23:%02d:00", minute);
+ break;
+
+ case SCHEDULE_DAILY:
+ schedule_pattern = xstrfmt("Tue..Sun *-*-* 0:%02d:00", minute);
+ break;
+
+ case SCHEDULE_WEEKLY:
+ schedule_pattern = xstrfmt("Mon 0:%02d:00", minute);
+ break;
+
+ default:
+ BUG("Unhandled schedule_priority");
+ }
+
unit = "# This file was created and is maintained by Git.\n"
"# Any edits made in this file might be replaced in the future\n"
"# by a Git command.\n"
@@ -2257,12 +2401,12 @@ static int systemd_timer_write_unit_templates(const char *exec_path)
"Description=Optimize Git repositories data\n"
"\n"
"[Timer]\n"
- "OnCalendar=%i\n"
+ "OnCalendar=%s\n"
"Persistent=true\n"
"\n"
"[Install]\n"
"WantedBy=timers.target\n";
- if (fputs(unit, file) == EOF) {
+ if (fprintf(file, unit, schedule_pattern) < 0) {
error(_("failed to write to '%s'"), filename);
fclose(file);
goto error;
@@ -2271,9 +2415,36 @@ static int systemd_timer_write_unit_templates(const char *exec_path)
error_errno(_("failed to flush '%s'"), filename);
goto error;
}
+
+ res = 0;
+
+error:
+ free(schedule_pattern);
+ free(local_timer_name);
free(filename);
+ return res;
+}
+
+/*
+ * No matter the schedule, we use the same service and can make use of the
+ * templating system. When installing git-maintenance@<schedule>.timer,
+ * systemd will notice that git-maintenance@.service exists as a template
+ * and will use this file and insert the <schedule> into the template at
+ * the position of "%i".
+ */
+static int systemd_timer_write_service_template(const char *exec_path)
+{
+ int res = -1;
+ char *filename;
+ FILE *file;
+ const char *unit;
+ char *local_service_name = xstrfmt(SYSTEMD_UNIT_FORMAT, "", "service");
- filename = xdg_config_home_systemd("git-maintenance@.service");
+ filename = xdg_config_home_systemd(local_service_name);
+ if (safe_create_leading_directories(filename)) {
+ error(_("failed to create directories for '%s'"), filename);
+ goto error;
+ }
file = fopen_or_warn(filename, "w");
if (!file)
goto error;
@@ -2291,7 +2462,7 @@ static int systemd_timer_write_unit_templates(const char *exec_path)
"LockPersonality=yes\n"
"MemoryDenyWriteExecute=yes\n"
"NoNewPrivileges=yes\n"
- "RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6\n"
+ "RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_VSOCK\n"
"RestrictNamespaces=yes\n"
"RestrictRealtime=yes\n"
"RestrictSUIDSGID=yes\n"
@@ -2306,29 +2477,114 @@ static int systemd_timer_write_unit_templates(const char *exec_path)
error_errno(_("failed to flush '%s'"), filename);
goto error;
}
+
+ res = 0;
+
+error:
+ free(local_service_name);
free(filename);
+ return res;
+}
+
+static int systemd_timer_enable_unit(int enable,
+ enum schedule_priority schedule,
+ int minute)
+{
+ const char *cmd = "systemctl";
+ struct child_process child = CHILD_PROCESS_INIT;
+ const char *frequency = get_frequency(schedule);
+
+ /*
+ * Disabling the systemd unit while it is already disabled makes
+ * systemctl print an error.
+ * Let's ignore it since it means we already are in the expected state:
+ * the unit is disabled.
+ *
+ * On the other hand, enabling a systemd unit which is already enabled
+ * produces no error.
+ */
+ if (!enable)
+ child.no_stderr = 1;
+ else if (systemd_timer_write_timer_file(schedule, minute))
+ return -1;
+
+ get_schedule_cmd(&cmd, NULL);
+ strvec_split(&child.args, cmd);
+ strvec_pushl(&child.args, "--user", enable ? "enable" : "disable",
+ "--now", NULL);
+ strvec_pushf(&child.args, SYSTEMD_UNIT_FORMAT, frequency, "timer");
+
+ if (start_command(&child))
+ return error(_("failed to start systemctl"));
+ if (finish_command(&child))
+ /*
+ * Disabling an already disabled systemd unit makes
+ * systemctl fail.
+ * Let's ignore this failure.
+ *
+ * Enabling an enabled systemd unit doesn't fail.
+ */
+ if (enable)
+ return error(_("failed to run systemctl"));
return 0;
+}
+
+/*
+ * A previous version of Git wrote the timer units as template files.
+ * Clean these up, if they exist.
+ */
+static void systemd_timer_delete_stale_timer_templates(void)
+{
+ char *timer_template_name = xstrfmt(SYSTEMD_UNIT_FORMAT, "", "timer");
+ char *filename = xdg_config_home_systemd(timer_template_name);
+
+ if (unlink(filename) && !is_missing_file_error(errno))
+ warning(_("failed to delete '%s'"), filename);
-error:
free(filename);
- systemd_timer_delete_unit_templates();
- return -1;
+ free(timer_template_name);
+}
+
+static int systemd_timer_delete_unit_files(void)
+{
+ systemd_timer_delete_stale_timer_templates();
+
+ /* Purposefully not short-circuited to make sure all are called. */
+ return systemd_timer_delete_timer_file(SCHEDULE_HOURLY) |
+ systemd_timer_delete_timer_file(SCHEDULE_DAILY) |
+ systemd_timer_delete_timer_file(SCHEDULE_WEEKLY) |
+ systemd_timer_delete_service_template();
+}
+
+static int systemd_timer_delete_units(void)
+{
+ int minute = get_random_minute();
+ /* Purposefully not short-circuited to make sure all are called. */
+ return systemd_timer_enable_unit(0, SCHEDULE_HOURLY, minute) |
+ systemd_timer_enable_unit(0, SCHEDULE_DAILY, minute) |
+ systemd_timer_enable_unit(0, SCHEDULE_WEEKLY, minute) |
+ systemd_timer_delete_unit_files();
}
static int systemd_timer_setup_units(void)
{
+ int minute = get_random_minute();
const char *exec_path = git_exec_path();
- int ret = systemd_timer_write_unit_templates(exec_path) ||
- systemd_timer_enable_unit(1, SCHEDULE_HOURLY) ||
- systemd_timer_enable_unit(1, SCHEDULE_DAILY) ||
- systemd_timer_enable_unit(1, SCHEDULE_WEEKLY);
+ int ret = systemd_timer_write_service_template(exec_path) ||
+ systemd_timer_enable_unit(1, SCHEDULE_HOURLY, minute) ||
+ systemd_timer_enable_unit(1, SCHEDULE_DAILY, minute) ||
+ systemd_timer_enable_unit(1, SCHEDULE_WEEKLY, minute);
+
if (ret)
systemd_timer_delete_units();
+ else
+ systemd_timer_delete_stale_timer_templates();
+
return ret;
}
-static int systemd_timer_update_schedule(int run_maintenance, int fd)
+static int systemd_timer_update_schedule(int run_maintenance, int fd UNUSED)
{
if (run_maintenance)
return systemd_timer_setup_units();
@@ -2490,6 +2746,7 @@ static int maintenance_start(int argc, const char **argv, const char *prefix)
PARSE_OPT_NONEG, maintenance_opt_scheduler),
OPT_END()
};
+ const char *register_args[] = { "register", NULL };
argc = parse_options(argc, argv, prefix, options,
builtin_maintenance_start_usage, 0);
@@ -2499,34 +2756,49 @@ static int maintenance_start(int argc, const char **argv, const char *prefix)
opts.scheduler = resolve_scheduler(opts.scheduler);
validate_scheduler(opts.scheduler);
- if (maintenance_register())
+ if (update_background_schedule(&opts, 1))
+ die(_("failed to set up maintenance schedule"));
+
+ if (maintenance_register(ARRAY_SIZE(register_args)-1, register_args, NULL))
warning(_("failed to add repo to global config"));
- return update_background_schedule(&opts, 1);
+ return 0;
}
-static int maintenance_stop(void)
+static const char *const builtin_maintenance_stop_usage[] = {
+ "git maintenance stop",
+ NULL
+};
+
+static int maintenance_stop(int argc, const char **argv, const char *prefix)
{
+ struct option options[] = {
+ OPT_END()
+ };
+ argc = parse_options(argc, argv, prefix, options,
+ builtin_maintenance_stop_usage, 0);
+ if (argc)
+ usage_with_options(builtin_maintenance_stop_usage, options);
return update_background_schedule(NULL, 0);
}
-static const char builtin_maintenance_usage[] = N_("git maintenance <subcommand> [<options>]");
+static const char * const builtin_maintenance_usage[] = {
+ N_("git maintenance <subcommand> [<options>]"),
+ NULL,
+};
int cmd_maintenance(int argc, const char **argv, const char *prefix)
{
- if (argc < 2 ||
- (argc == 2 && !strcmp(argv[1], "-h")))
- usage(builtin_maintenance_usage);
-
- if (!strcmp(argv[1], "run"))
- return maintenance_run(argc - 1, argv + 1, prefix);
- if (!strcmp(argv[1], "start"))
- return maintenance_start(argc - 1, argv + 1, prefix);
- if (!strcmp(argv[1], "stop"))
- return maintenance_stop();
- if (!strcmp(argv[1], "register"))
- return maintenance_register();
- if (!strcmp(argv[1], "unregister"))
- return maintenance_unregister();
-
- die(_("invalid subcommand: %s"), argv[1]);
+ parse_opt_subcommand_fn *fn = NULL;
+ struct option builtin_maintenance_options[] = {
+ OPT_SUBCOMMAND("run", &fn, maintenance_run),
+ OPT_SUBCOMMAND("start", &fn, maintenance_start),
+ OPT_SUBCOMMAND("stop", &fn, maintenance_stop),
+ OPT_SUBCOMMAND("register", &fn, maintenance_register),
+ OPT_SUBCOMMAND("unregister", &fn, maintenance_unregister),
+ OPT_END(),
+ };
+
+ argc = parse_options(argc, argv, prefix, builtin_maintenance_options,
+ builtin_maintenance_usage, 0);
+ return fn(argc, argv, prefix);
}
diff --git a/builtin/get-tar-commit-id.c b/builtin/get-tar-commit-id.c
index 491af92..66a7389 100644
--- a/builtin/get-tar-commit-id.c
+++ b/builtin/get-tar-commit-id.c
@@ -1,11 +1,9 @@
/*
* Copyright (c) 2005, 2006 Rene Scharfe
*/
-#include "cache.h"
+#include "builtin.h"
#include "commit.h"
#include "tar.h"
-#include "builtin.h"
-#include "quote.h"
static const char builtin_get_tar_commit_id_usage[] =
"git get-tar-commit-id";
@@ -14,7 +12,7 @@ static const char builtin_get_tar_commit_id_usage[] =
#define RECORDSIZE (512)
#define HEADERSIZE (2 * RECORDSIZE)
-int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix)
+int cmd_get_tar_commit_id(int argc, const char **argv UNUSED, const char *prefix)
{
char buffer[HEADERSIZE];
struct ustar_header *header = (struct ustar_header *)buffer;
@@ -24,6 +22,8 @@ int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix)
long len;
char *end;
+ BUG_ON_NON_EMPTY_PREFIX(prefix);
+
if (argc != 1)
usage(builtin_get_tar_commit_id_usage);
@@ -32,7 +32,7 @@ int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix)
die_errno("git get-tar-commit-id: read error");
if (n != HEADERSIZE)
die_errno("git get-tar-commit-id: EOF before reading tar header");
- if (header->typeflag[0] != 'g')
+ if (header->typeflag[0] != TYPEFLAG_GLOBAL_HEADER)
return 1;
len = strtol(content, &end, 10);
diff --git a/builtin/grep.c b/builtin/grep.c
index bcb07ea..5777ba8 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -3,28 +3,32 @@
*
* Copyright (c) 2006 Junio C Hamano
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
+#include "builtin.h"
+#include "abspath.h"
+#include "gettext.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
-#include "blob.h"
-#include "tree.h"
-#include "commit.h"
#include "tag.h"
#include "tree-walk.h"
-#include "builtin.h"
#include "parse-options.h"
#include "string-list.h"
#include "run-command.h"
-#include "userdiff.h"
#include "grep.h"
#include "quote.h"
#include "dir.h"
#include "pathspec.h"
+#include "setup.h"
#include "submodule.h"
#include "submodule-config.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "packfile.h"
+#include "pager.h"
+#include "path.h"
+#include "read-cache-ll.h"
+#include "write-or-die.h"
static const char *grep_prefix;
@@ -283,14 +287,18 @@ static int wait_all(void)
return hit;
}
-static int grep_cmd_config(const char *var, const char *value, void *cb)
+static int grep_cmd_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
- int st = grep_config(var, value, cb);
- if (git_color_default_config(var, value, NULL) < 0)
+ int st = grep_config(var, value, ctx, cb);
+
+ if (git_color_config(var, value, cb) < 0)
+ st = -1;
+ else if (git_default_config(var, value, ctx, cb) < 0)
st = -1;
if (!strcmp(var, "grep.threads")) {
- num_threads = git_config_int(var, value);
+ num_threads = git_config_int(var, value, ctx->kvi);
if (num_threads < 0)
die(_("invalid number of threads specified (%d) for %s"),
num_threads, var);
@@ -458,6 +466,33 @@ static int grep_submodule(struct grep_opt *opt,
* subrepo's odbs to the in-memory alternates list.
*/
obj_read_lock();
+
+ /*
+ * NEEDSWORK: when reading a submodule, the sparsity settings in the
+ * superproject are incorrectly forgotten or misused. For example:
+ *
+ * 1. "command_requires_full_index"
+ * When this setting is turned on for `grep`, only the superproject
+ * knows it. All the submodules are read with their own configs
+ * and get prepare_repo_settings()'d. Therefore, these submodules
+ * "forget" the sparse-index feature switch. As a result, the index
+ * of these submodules are expanded unexpectedly.
+ *
+ * 2. "core_apply_sparse_checkout"
+ * When running `grep` in the superproject, this setting is
+ * populated using the superproject's configs. However, once
+ * initialized, this config is globally accessible and is read by
+ * prepare_repo_settings() for the submodules. For instance, if a
+ * submodule is using a sparse-checkout, however, the superproject
+ * is not, the result is that the config from the superproject will
+ * dictate the behavior for the submodule, making it "forget" its
+ * sparse-checkout state.
+ *
+ * 3. "core_sparse_checkout_cone"
+ * ditto.
+ *
+ * Note that this list is not exhaustive.
+ */
repo_read_gitmodules(subrepo, 0);
/*
@@ -492,7 +527,7 @@ static int grep_submodule(struct grep_opt *opt,
strbuf_addstr(&base, filename);
strbuf_addch(&base, '/');
- init_tree_desc(&tree, data, size);
+ init_tree_desc(&tree, oid, data, size);
hit = grep_tree(&subopt, pathspec, &tree, &base, base.len,
object_type == OBJ_COMMIT);
strbuf_release(&base);
@@ -520,8 +555,6 @@ static int grep_cache(struct grep_opt *opt,
if (repo_read_index(repo) < 0)
die(_("index file corrupt"));
- /* TODO: audit for interaction with sparse-index. */
- ensure_full_index(repo->index);
for (nr = 0; nr < repo->index->cache_nr; nr++) {
const struct cache_entry *ce = repo->index->cache[nr];
@@ -530,8 +563,23 @@ static int grep_cache(struct grep_opt *opt,
strbuf_setlen(&name, name_base_len);
strbuf_addstr(&name, ce->name);
+ if (S_ISSPARSEDIR(ce->ce_mode)) {
+ enum object_type type;
+ struct tree_desc tree;
+ void *data;
+ unsigned long size;
- if (S_ISREG(ce->ce_mode) &&
+ data = repo_read_object_file(the_repository, &ce->oid,
+ &type, &size);
+ if (!data)
+ die(_("unable to read tree %s"), oid_to_hex(&ce->oid));
+ init_tree_desc(&tree, &ce->oid, data, size);
+
+ hit |= grep_tree(opt, pathspec, &tree, &name, 0, 0);
+ strbuf_setlen(&name, name_base_len);
+ strbuf_addstr(&name, ce->name);
+ free(data);
+ } else if (S_ISREG(ce->ce_mode) &&
match_pathspec(repo->index, pathspec, name.buf, name.len, 0, NULL,
S_ISDIR(ce->ce_mode) ||
S_ISGITLINK(ce->ce_mode))) {
@@ -594,7 +642,7 @@ static int grep_tree(struct grep_opt *opt, const struct pathspec *pathspec,
strbuf_addstr(&name, base->buf + tn_len);
match = tree_entry_interesting(repo->index,
&entry, &name,
- 0, pathspec);
+ pathspec);
strbuf_setlen(&name, name_base_len);
if (match == all_entries_not_interesting)
@@ -614,13 +662,14 @@ static int grep_tree(struct grep_opt *opt, const struct pathspec *pathspec,
void *data;
unsigned long size;
- data = read_object_file(&entry.oid, &type, &size);
+ data = repo_read_object_file(the_repository,
+ &entry.oid, &type, &size);
if (!data)
die(_("unable to read tree (%s)"),
oid_to_hex(&entry.oid));
strbuf_addch(base, '/');
- init_tree_desc(&sub, data, size);
+ init_tree_desc(&sub, &entry.oid, data, size);
hit |= grep_tree(opt, pathspec, &sub, base, tn_len,
check_attr);
free(data);
@@ -664,7 +713,7 @@ static int grep_object(struct grep_opt *opt, const struct pathspec *pathspec,
strbuf_add(&base, name, len);
strbuf_addch(&base, ':');
}
- init_tree_desc(&tree, data, size);
+ init_tree_desc(&tree, &obj->oid, data, size);
hit = grep_tree(opt, pathspec, &tree, &base, base.len,
obj->type == OBJ_COMMIT);
strbuf_release(&base);
@@ -762,14 +811,20 @@ static int file_callback(const struct option *opt, const char *arg, int unset)
{
struct grep_opt *grep_opt = opt->value;
int from_stdin;
+ const char *filename = arg;
FILE *patterns;
int lno = 0;
struct strbuf sb = STRBUF_INIT;
BUG_ON_OPT_NEG(unset);
- from_stdin = !strcmp(arg, "-");
- patterns = from_stdin ? stdin : fopen(arg, "r");
+ if (!*filename)
+ ; /* leave it as-is */
+ else
+ filename = prefix_filename_except_for_dash(grep_prefix, filename);
+
+ from_stdin = !strcmp(filename, "-");
+ patterns = from_stdin ? stdin : fopen(filename, "r");
if (!patterns)
die_errno(_("cannot open '%s'"), arg);
while (strbuf_getline(&sb, patterns) == 0) {
@@ -783,6 +838,8 @@ static int file_callback(const struct option *opt, const char *arg, int unset)
if (!from_stdin)
fclose(patterns);
strbuf_release(&sb);
+ if (filename != arg)
+ free((void *)filename);
return 0;
}
@@ -874,9 +931,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
N_("process binary files with textconv filters")),
OPT_SET_INT('r', "recursive", &opt.max_depth,
N_("search in subdirectories (default)"), -1),
- { OPTION_INTEGER, 0, "max-depth", &opt.max_depth, N_("depth"),
- N_("descend at most <depth> levels"), PARSE_OPT_NONEG,
- NULL, 1 },
+ OPT_INTEGER_F(0, "max-depth", &opt.max_depth,
+ N_("descend at most <n> levels"), PARSE_OPT_NONEG),
OPT_GROUP(""),
OPT_SET_INT('E', "extended-regexp", &opt.pattern_type_option,
N_("use extended POSIX regular expressions"),
@@ -940,7 +996,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
OPT_CALLBACK_F(0, "and", &opt, NULL,
N_("combine patterns specified with -e"),
PARSE_OPT_NOARG | PARSE_OPT_NONEG, and_callback),
- OPT_BOOL(0, "or", &dummy, ""),
+ OPT_BOOL_F(0, "or", &dummy, "", PARSE_OPT_NONEG),
OPT_CALLBACK_F(0, "not", &opt, NULL, "",
PARSE_OPT_NOARG | PARSE_OPT_NONEG, not_callback),
OPT_CALLBACK_F('(', NULL, &opt, NULL, "",
@@ -961,6 +1017,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
OPT_BOOL_F(0, "ext-grep", &external_grep_allowed__ignored,
N_("allow calling of grep(1) (ignored by this build)"),
PARSE_OPT_NOCOMPLETE),
+ OPT_INTEGER('m', "max-count", &opt.max_count,
+ N_("maximum number of results per file")),
OPT_END()
};
grep_prefix = prefix;
@@ -982,6 +1040,11 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
PARSE_OPT_KEEP_DASHDASH |
PARSE_OPT_STOP_AT_NON_OPTION);
+ if (the_repository->gitdir) {
+ prepare_repo_settings(the_repository);
+ the_repository->settings.command_requires_full_index = 0;
+ }
+
if (use_index && !startup_info->have_repository) {
int fallback = 0;
git_config_get_bool("grep.fallbacktonoindex", &fallback);
@@ -1101,6 +1164,13 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
if (recurse_submodules && untracked)
die(_("--untracked not supported with --recurse-submodules"));
+ /*
+ * Optimize out the case where the amount of matches is limited to zero.
+ * We do this to keep results consistent with GNU grep(1).
+ */
+ if (opt.max_count == 0)
+ return 1;
+
if (show_in_pager) {
if (num_threads > 1)
warning(_("invalid option combination, ignoring --threads"));
diff --git a/builtin/hash-object.c b/builtin/hash-object.c
index fbae878..82ca6d2 100644
--- a/builtin/hash-object.c
+++ b/builtin/hash-object.c
@@ -5,12 +5,18 @@
* Copyright (C) Junio C Hamano, 2005
*/
#include "builtin.h"
+#include "abspath.h"
#include "config.h"
-#include "object-store.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-file.h"
+#include "object-store-ll.h"
#include "blob.h"
#include "quote.h"
#include "parse-options.h"
-#include "exec-cmd.h"
+#include "setup.h"
+#include "strbuf.h"
+#include "write-or-die.h"
/*
* This is to create corrupt objects for debugging and as such it
@@ -27,6 +33,7 @@ static int hash_literally(struct object_id *oid, int fd, const char *type, unsig
else
ret = write_object_file_literally(buf.buf, buf.len, type, oid,
flags);
+ close(fd);
strbuf_release(&buf);
return ret;
}
@@ -80,8 +87,9 @@ static void hash_stdin_paths(const char *type, int no_filters, unsigned flags,
int cmd_hash_object(int argc, const char **argv, const char *prefix)
{
static const char * const hash_object_usage[] = {
- N_("git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] [--] <file>..."),
- "git hash-object --stdin-paths",
+ N_("git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
+ " [--stdin [--literally]] [--] <file>..."),
+ N_("git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]"),
NULL
};
const char *type = blob_type;
diff --git a/builtin/help.c b/builtin/help.c
index 222f994..dc1fbe2 100644
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -1,15 +1,18 @@
/*
* Builtin help command
*/
-#include "cache.h"
-#include "config.h"
#include "builtin.h"
+#include "config.h"
#include "exec-cmd.h"
+#include "gettext.h"
+#include "pager.h"
#include "parse-options.h"
+#include "path.h"
#include "run-command.h"
#include "config-list.h"
#include "help.h"
#include "alias.h"
+#include "setup.h"
#ifndef DEFAULT_HELP_FORMAT
#define DEFAULT_HELP_FORMAT "man"
@@ -43,6 +46,8 @@ static enum help_action {
HELP_ACTION_ALL = 1,
HELP_ACTION_GUIDES,
HELP_ACTION_CONFIG,
+ HELP_ACTION_USER_INTERFACES,
+ HELP_ACTION_DEVELOPER_INTERFACES,
HELP_ACTION_CONFIG_FOR_COMPLETION,
HELP_ACTION_CONFIG_SECTIONS_FOR_COMPLETION,
} cmd_mode;
@@ -69,6 +74,12 @@ static struct option builtin_help_options[] = {
OPT_CMDMODE('g', "guides", &cmd_mode, N_("print list of useful guides"),
HELP_ACTION_GUIDES),
+ OPT_CMDMODE(0, "user-interfaces", &cmd_mode,
+ N_("print list of user-facing repository, command and file interfaces"),
+ HELP_ACTION_USER_INTERFACES),
+ OPT_CMDMODE(0, "developer-interfaces", &cmd_mode,
+ N_("print list of file formats, protocols and other developer interfaces"),
+ HELP_ACTION_DEVELOPER_INTERFACES),
OPT_CMDMODE('c', "config", &cmd_mode, N_("print all configuration variable names"),
HELP_ACTION_CONFIG),
OPT_CMDMODE_F(0, "config-for-completion", &cmd_mode, "",
@@ -80,10 +91,12 @@ static struct option builtin_help_options[] = {
};
static const char * const builtin_help_usage[] = {
- "git help [-a|--all] [--[no-]verbose]] [--[no-]external-commands] [--[no-]aliases]",
- N_("git help [[-i|--info] [-m|--man] [-w|--web]] [<command>]"),
+ "git help [-a|--all] [--[no-]verbose] [--[no-]external-commands] [--[no-]aliases]",
+ N_("git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"),
"git help [-g|--guides]",
"git help [-c|--config]",
+ "git help [--user-interfaces]",
+ "git help [--developer-interfaces]",
NULL
};
@@ -384,7 +397,8 @@ static int add_man_viewer_info(const char *var, const char *value)
return 0;
}
-static int git_help_config(const char *var, const char *value, void *cb)
+static int git_help_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(var, "help.format")) {
if (!value)
@@ -407,7 +421,7 @@ static int git_help_config(const char *var, const char *value, void *cb)
if (starts_with(var, "man."))
return add_man_viewer_info(var, value);
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
static struct cmdnames main_cmds, other_cmds;
@@ -430,6 +444,8 @@ static const char *cmd_to_page(const char *git_cmd)
return git_cmd;
else if (is_git_command(git_cmd))
return xstrfmt("git-%s", git_cmd);
+ else if (!strcmp("scalar", git_cmd))
+ return xstrdup(git_cmd);
else
return xstrfmt("git%s", git_cmd);
}
@@ -654,6 +670,14 @@ int cmd_help(int argc, const char **argv, const char *prefix)
opt_mode_usage(argc, "--config-for-completion", help_format);
list_config_help(SHOW_CONFIG_VARS);
return 0;
+ case HELP_ACTION_USER_INTERFACES:
+ opt_mode_usage(argc, "--user-interfaces", help_format);
+ list_user_interfaces_help();
+ return 0;
+ case HELP_ACTION_DEVELOPER_INTERFACES:
+ opt_mode_usage(argc, "--developer-interfaces", help_format);
+ list_developer_interfaces_help();
+ return 0;
case HELP_ACTION_CONFIG_SECTIONS_FOR_COMPLETION:
opt_mode_usage(argc, "--config-sections-for-completion",
help_format);
diff --git a/builtin/hook.c b/builtin/hook.c
index 54e5c6e..5234693 100644
--- a/builtin/hook.c
+++ b/builtin/hook.c
@@ -1,13 +1,12 @@
-#include "cache.h"
#include "builtin.h"
#include "config.h"
+#include "gettext.h"
#include "hook.h"
#include "parse-options.h"
-#include "strbuf.h"
#include "strvec.h"
#define BUILTIN_HOOK_RUN_USAGE \
- N_("git hook run [--ignore-missing] <hook-name> [-- <hook-args>]")
+ N_("git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-args>]")
static const char * const builtin_hook_usage[] = {
BUILTIN_HOOK_RUN_USAGE,
@@ -28,6 +27,8 @@ static int run(int argc, const char **argv, const char *prefix)
struct option run_options[] = {
OPT_BOOL(0, "ignore-missing", &ignore_missing,
N_("silently ignore missing requested <hook-name>")),
+ OPT_STRING(0, "to-stdin", &opt.path_to_stdin, N_("path"),
+ N_("file to read into hooks' stdin")),
OPT_END(),
};
int ret;
@@ -67,18 +68,14 @@ usage:
int cmd_hook(int argc, const char **argv, const char *prefix)
{
+ parse_opt_subcommand_fn *fn = NULL;
struct option builtin_hook_options[] = {
+ OPT_SUBCOMMAND("run", &fn, run),
OPT_END(),
};
argc = parse_options(argc, argv, NULL, builtin_hook_options,
- builtin_hook_usage, PARSE_OPT_STOP_AT_NON_OPTION);
- if (!argc)
- goto usage;
+ builtin_hook_usage, 0);
- if (!strcmp(argv[0], "run"))
- return run(argc, argv, prefix);
-
-usage:
- usage_with_options(builtin_hook_usage, builtin_hook_options);
+ return fn(argc, argv, prefix);
}
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 6648f2d..856428f 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1,23 +1,30 @@
#include "builtin.h"
#include "config.h"
#include "delta.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "pack.h"
#include "csum-file.h"
#include "blob.h"
#include "commit.h"
-#include "tag.h"
#include "tree.h"
#include "progress.h"
#include "fsck.h"
-#include "exec-cmd.h"
+#include "strbuf.h"
#include "streaming.h"
#include "thread-utils.h"
#include "packfile.h"
-#include "object-store.h"
+#include "pack-revindex.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "oid-array.h"
+#include "replace-object.h"
#include "promisor-remote.h"
+#include "setup.h"
static const char index_pack_usage[] =
-"git index-pack [-v] [-o <index-file>] [--keep | --keep=<msg>] [--[no-]rev-index] [--verify] [--strict] (<pack-file> | --stdin [--fix-thin] [<pack-file>])";
+"git index-pack [-v] [-o <index-file>] [--keep | --keep=<msg>] [--[no-]rev-index] [--verify] [--strict[=<msg-id>=<severity>...]] [--fsck-objects[=<msg-id>=<severity>...]] (<pack-file> | --stdin [--fix-thin] [<pack-file>])";
struct object_entry {
struct pack_idx_entry idx;
@@ -212,7 +219,8 @@ static void cleanup_thread(void)
}
static int mark_link(struct object *obj, enum object_type type,
- void *data, struct fsck_options *options)
+ void *data UNUSED,
+ struct fsck_options *options UNUSED)
{
if (!obj)
return -1;
@@ -801,7 +809,8 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
if (startup_info->have_repository) {
read_lock();
collision_test_needed =
- has_object_file_with_flags(oid, OBJECT_INFO_QUICK);
+ repo_has_object_file_with_flags(the_repository, oid,
+ OBJECT_INFO_QUICK);
read_unlock();
}
@@ -821,7 +830,8 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
die(_("cannot read existing object info %s"), oid_to_hex(oid));
if (has_type != type || has_size != size)
die(_("SHA1 COLLISION FOUND WITH %s !"), oid_to_hex(oid));
- has_data = read_object_file(oid, &has_type, &has_size);
+ has_data = repo_read_object_file(the_repository, oid,
+ &has_type, &has_size);
read_unlock();
if (!data)
data = new_data = get_data_from_pack(obj_entry);
@@ -1154,6 +1164,7 @@ static void parse_pack_objects(unsigned char *hash)
struct ofs_delta_entry *ofs_delta = ofs_deltas;
struct object_id ref_delta_oid;
struct stat st;
+ git_hash_ctx tmp_ctx;
if (verbose)
progress = start_progress(
@@ -1190,7 +1201,9 @@ static void parse_pack_objects(unsigned char *hash)
/* Check pack integrity */
flush();
- the_hash_algo->final_fn(hash, &input_ctx);
+ the_hash_algo->init_fn(&tmp_ctx);
+ the_hash_algo->clone_fn(&tmp_ctx, &input_ctx);
+ the_hash_algo->final_fn(hash, &tmp_ctx);
if (!hasheq(fill(the_hash_algo->rawsz), hash))
die(_("pack is corrupted (SHA1 mismatch)"));
use(the_hash_algo->rawsz);
@@ -1242,6 +1255,7 @@ static void resolve_deltas(void)
base_cache_limit = 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);
@@ -1249,6 +1263,7 @@ 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();
@@ -1388,7 +1403,7 @@ static void fix_unresolved_deltas(struct hashfile *f)
sorted_by_pos[i] = &ref_deltas[i];
QSORT(sorted_by_pos, nr_ref_deltas, delta_pos_compare);
- if (has_promisor_remote()) {
+ if (repo_has_promisor_remote(the_repository)) {
/*
* Prefetch the delta bases.
*/
@@ -1414,7 +1429,8 @@ static void fix_unresolved_deltas(struct hashfile *f)
if (objects[d->obj_no].real_type != OBJ_REF_DELTA)
continue;
- data = read_object_file(&d->oid, &type, &size);
+ data = repo_read_object_file(the_repository, &d->oid, &type,
+ &size);
if (!data)
continue;
@@ -1508,14 +1524,12 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
struct strbuf pack_name = STRBUF_INIT;
struct strbuf index_name = STRBUF_INIT;
struct strbuf rev_index_name = STRBUF_INIT;
- int err;
if (!from_stdin) {
close(input_fd);
} else {
fsync_component_or_die(FSYNC_COMPONENT_PACK, output_fd, curr_pack_name);
- err = close(output_fd);
- if (err)
+ if (close(output_fd))
die_errno(_("error while closing pack file"));
}
@@ -1550,17 +1564,8 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
write_or_die(1, buf.buf, buf.len);
strbuf_release(&buf);
- /*
- * Let's just mimic git-unpack-objects here and write
- * the last part of the input buffer to stdout.
- */
- while (input_len) {
- err = xwrite(1, input_buffer + input_offset, input_len);
- if (err <= 0)
- break;
- input_len -= err;
- input_offset += err;
- }
+ /* Write the last part of the buffer to stdout */
+ write_in_full(1, input_buffer + input_offset, input_len);
}
strbuf_release(&rev_index_name);
@@ -1568,18 +1573,19 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
strbuf_release(&pack_name);
}
-static int git_index_pack_config(const char *k, const char *v, void *cb)
+static int git_index_pack_config(const char *k, const char *v,
+ const struct config_context *ctx, void *cb)
{
struct pack_idx_option *opts = cb;
if (!strcmp(k, "pack.indexversion")) {
- opts->version = git_config_int(k, v);
+ opts->version = git_config_int(k, v, ctx->kvi);
if (opts->version > 2)
die(_("bad pack.indexVersion=%"PRIu32), opts->version);
return 0;
}
if (!strcmp(k, "pack.threads")) {
- nr_threads = git_config_int(k, v);
+ nr_threads = git_config_int(k, v, ctx->kvi);
if (nr_threads < 0)
die(_("invalid number of threads specified (%d)"),
nr_threads);
@@ -1595,7 +1601,7 @@ static int git_index_pack_config(const char *k, const char *v, void *cb)
else
opts->flags &= ~WRITE_REV;
}
- return git_default_config(k, v, cb);
+ return git_default_config(k, v, ctx, cb);
}
static int cmp_uint32(const void *a_, const void *b_)
@@ -1739,16 +1745,17 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
if (argc == 2 && !strcmp(argv[1], "-h"))
usage(index_pack_usage);
- read_replace_refs = 0;
+ disable_replace_refs();
fsck_options.walk = mark_link;
reset_pack_idx_option(&opts);
+ opts.flags |= WRITE_REV;
git_config(git_index_pack_config, &opts);
if (prefix && chdir(prefix))
die(_("Cannot come back to cwd"));
- if (git_env_bool(GIT_TEST_WRITE_REV_INDEX, 0))
- rev_index = 1;
+ if (git_env_bool(GIT_TEST_NO_WRITE_REV_INDEX, 0))
+ rev_index = 0;
else
rev_index = !!(opts.flags & (WRITE_REV_VERIFY | WRITE_REV));
@@ -1767,8 +1774,9 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
} else if (!strcmp(arg, "--check-self-contained-and-connected")) {
strict = 1;
check_self_contained_and_connected = 1;
- } else if (!strcmp(arg, "--fsck-objects")) {
+ } else if (skip_to_optional_arg(arg, "--fsck-objects", &arg)) {
do_fsck_object = 1;
+ fsck_set_msg_types(&fsck_options, arg);
} else if (!strcmp(arg, "--verify")) {
verify = 1;
} else if (!strcmp(arg, "--verify-stat")) {
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 546f9c5..0170469 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -3,476 +3,17 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
-#include "cache.h"
-#include "config.h"
-#include "refs.h"
#include "builtin.h"
-#include "exec-cmd.h"
+#include "abspath.h"
+#include "environment.h"
+#include "gettext.h"
+#include "object-file.h"
#include "parse-options.h"
-#include "worktree.h"
-
-#ifndef DEFAULT_GIT_TEMPLATE_DIR
-#define DEFAULT_GIT_TEMPLATE_DIR "/usr/share/git-core/templates"
-#endif
-
-#ifdef NO_TRUSTABLE_FILEMODE
-#define TEST_FILEMODE 0
-#else
-#define TEST_FILEMODE 1
-#endif
-
-#define GIT_DEFAULT_HASH_ENVIRONMENT "GIT_DEFAULT_HASH"
-
-static int init_is_bare_repository = 0;
-static int init_shared_repository = -1;
-
-static void copy_templates_1(struct strbuf *path, struct strbuf *template_path,
- DIR *dir)
-{
- size_t path_baselen = path->len;
- size_t template_baselen = template_path->len;
- struct dirent *de;
-
- /* Note: if ".git/hooks" file exists in the repository being
- * re-initialized, /etc/core-git/templates/hooks/update would
- * cause "git init" to fail here. I think this is sane but
- * it means that the set of templates we ship by default, along
- * with the way the namespace under .git/ is organized, should
- * be really carefully chosen.
- */
- safe_create_dir(path->buf, 1);
- while ((de = readdir(dir)) != NULL) {
- struct stat st_git, st_template;
- int exists = 0;
-
- strbuf_setlen(path, path_baselen);
- strbuf_setlen(template_path, template_baselen);
-
- if (de->d_name[0] == '.')
- continue;
- strbuf_addstr(path, de->d_name);
- strbuf_addstr(template_path, de->d_name);
- if (lstat(path->buf, &st_git)) {
- if (errno != ENOENT)
- die_errno(_("cannot stat '%s'"), path->buf);
- }
- else
- exists = 1;
-
- if (lstat(template_path->buf, &st_template))
- die_errno(_("cannot stat template '%s'"), template_path->buf);
-
- if (S_ISDIR(st_template.st_mode)) {
- DIR *subdir = opendir(template_path->buf);
- if (!subdir)
- die_errno(_("cannot opendir '%s'"), template_path->buf);
- strbuf_addch(path, '/');
- strbuf_addch(template_path, '/');
- copy_templates_1(path, template_path, subdir);
- closedir(subdir);
- }
- else if (exists)
- continue;
- else if (S_ISLNK(st_template.st_mode)) {
- struct strbuf lnk = STRBUF_INIT;
- if (strbuf_readlink(&lnk, template_path->buf,
- st_template.st_size) < 0)
- die_errno(_("cannot readlink '%s'"), template_path->buf);
- if (symlink(lnk.buf, path->buf))
- die_errno(_("cannot symlink '%s' '%s'"),
- lnk.buf, path->buf);
- strbuf_release(&lnk);
- }
- else if (S_ISREG(st_template.st_mode)) {
- if (copy_file(path->buf, template_path->buf, st_template.st_mode))
- die_errno(_("cannot copy '%s' to '%s'"),
- template_path->buf, path->buf);
- }
- else
- error(_("ignoring template %s"), template_path->buf);
- }
-}
-
-static void copy_templates(const char *template_dir, const char *init_template_dir)
-{
- struct strbuf path = STRBUF_INIT;
- struct strbuf template_path = STRBUF_INIT;
- size_t template_len;
- struct repository_format template_format = REPOSITORY_FORMAT_INIT;
- struct strbuf err = STRBUF_INIT;
- DIR *dir;
- char *to_free = NULL;
-
- if (!template_dir)
- template_dir = getenv(TEMPLATE_DIR_ENVIRONMENT);
- if (!template_dir)
- template_dir = init_template_dir;
- if (!template_dir)
- template_dir = to_free = system_path(DEFAULT_GIT_TEMPLATE_DIR);
- if (!template_dir[0]) {
- free(to_free);
- return;
- }
-
- strbuf_addstr(&template_path, template_dir);
- strbuf_complete(&template_path, '/');
- template_len = template_path.len;
-
- dir = opendir(template_path.buf);
- if (!dir) {
- warning(_("templates not found in %s"), template_dir);
- goto free_return;
- }
-
- /* Make sure that template is from the correct vintage */
- strbuf_addstr(&template_path, "config");
- read_repository_format(&template_format, template_path.buf);
- strbuf_setlen(&template_path, template_len);
-
- /*
- * No mention of version at all is OK, but anything else should be
- * verified.
- */
- if (template_format.version >= 0 &&
- verify_repository_format(&template_format, &err) < 0) {
- warning(_("not copying templates from '%s': %s"),
- template_dir, err.buf);
- strbuf_release(&err);
- goto close_free_return;
- }
-
- strbuf_addstr(&path, get_git_common_dir());
- strbuf_complete(&path, '/');
- copy_templates_1(&path, &template_path, dir);
-close_free_return:
- closedir(dir);
-free_return:
- free(to_free);
- strbuf_release(&path);
- strbuf_release(&template_path);
- clear_repository_format(&template_format);
-}
-
-/*
- * If the git_dir is not directly inside the working tree, then git will not
- * find it by default, and we need to set the worktree explicitly.
- */
-static int needs_work_tree_config(const char *git_dir, const char *work_tree)
-{
- if (!strcmp(work_tree, "/") && !strcmp(git_dir, "/.git"))
- return 0;
- if (skip_prefix(git_dir, work_tree, &git_dir) &&
- !strcmp(git_dir, "/.git"))
- return 0;
- return 1;
-}
-
-void initialize_repository_version(int hash_algo, int reinit)
-{
- char repo_version_string[10];
- int repo_version = GIT_REPO_VERSION;
-
- if (hash_algo != GIT_HASH_SHA1)
- repo_version = GIT_REPO_VERSION_READ;
-
- /* This forces creation of new config file */
- xsnprintf(repo_version_string, sizeof(repo_version_string),
- "%d", repo_version);
- git_config_set("core.repositoryformatversion", repo_version_string);
-
- if (hash_algo != GIT_HASH_SHA1)
- git_config_set("extensions.objectformat",
- hash_algos[hash_algo].name);
- else if (reinit)
- git_config_set_gently("extensions.objectformat", NULL);
-}
-
-static int create_default_files(const char *template_path,
- const char *original_git_dir,
- const char *initial_branch,
- const struct repository_format *fmt,
- int quiet)
-{
- struct stat st1;
- struct strbuf buf = STRBUF_INIT;
- char *path;
- char junk[2];
- int reinit;
- int filemode;
- struct strbuf err = STRBUF_INIT;
- const char *init_template_dir = NULL;
- const char *work_tree = get_git_work_tree();
-
- /*
- * First copy the templates -- we might have the default
- * config file there, in which case we would want to read
- * from it after installing.
- *
- * Before reading that config, we also need to clear out any cached
- * values (since we've just potentially changed what's available on
- * disk).
- */
- git_config_get_pathname("init.templatedir", &init_template_dir);
- copy_templates(template_path, init_template_dir);
- free((char *)init_template_dir);
- git_config_clear();
- reset_shared_repository();
- git_config(git_default_config, NULL);
-
- /*
- * We must make sure command-line options continue to override any
- * values we might have just re-read from the config.
- */
- is_bare_repository_cfg = init_is_bare_repository || !work_tree;
- if (init_shared_repository != -1)
- set_shared_repository(init_shared_repository);
-
- /*
- * We would have created the above under user's umask -- under
- * shared-repository settings, we would need to fix them up.
- */
- if (get_shared_repository()) {
- adjust_shared_perm(get_git_dir());
- }
-
- /*
- * We need to create a "refs" dir in any case so that older
- * versions of git can tell that this is a repository.
- */
- safe_create_dir(git_path("refs"), 1);
- adjust_shared_perm(git_path("refs"));
-
- if (refs_init_db(&err))
- die("failed to set up refs db: %s", err.buf);
-
- /*
- * Point the HEAD symref to the initial branch with if HEAD does
- * not yet exist.
- */
- path = git_path_buf(&buf, "HEAD");
- reinit = (!access(path, R_OK)
- || readlink(path, junk, sizeof(junk)-1) != -1);
- if (!reinit) {
- char *ref;
-
- if (!initial_branch)
- initial_branch = git_default_branch_name(quiet);
-
- ref = xstrfmt("refs/heads/%s", initial_branch);
- if (check_refname_format(ref, 0) < 0)
- die(_("invalid initial branch name: '%s'"),
- initial_branch);
-
- if (create_symref("HEAD", ref, NULL) < 0)
- exit(1);
- free(ref);
- }
-
- initialize_repository_version(fmt->hash_algo, 0);
-
- /* Check filemode trustability */
- path = git_path_buf(&buf, "config");
- filemode = TEST_FILEMODE;
- if (TEST_FILEMODE && !lstat(path, &st1)) {
- struct stat st2;
- filemode = (!chmod(path, st1.st_mode ^ S_IXUSR) &&
- !lstat(path, &st2) &&
- st1.st_mode != st2.st_mode &&
- !chmod(path, st1.st_mode));
- if (filemode && !reinit && (st1.st_mode & S_IXUSR))
- filemode = 0;
- }
- git_config_set("core.filemode", filemode ? "true" : "false");
-
- if (is_bare_repository())
- git_config_set("core.bare", "true");
- else {
- git_config_set("core.bare", "false");
- /* allow template config file to override the default */
- if (log_all_ref_updates == LOG_REFS_UNSET)
- git_config_set("core.logallrefupdates", "true");
- if (needs_work_tree_config(original_git_dir, work_tree))
- git_config_set("core.worktree", work_tree);
- }
-
- if (!reinit) {
- /* Check if symlink is supported in the work tree */
- path = git_path_buf(&buf, "tXXXXXX");
- if (!close(xmkstemp(path)) &&
- !unlink(path) &&
- !symlink("testing", path) &&
- !lstat(path, &st1) &&
- S_ISLNK(st1.st_mode))
- unlink(path); /* good */
- else
- git_config_set("core.symlinks", "false");
-
- /* Check if the filesystem is case-insensitive */
- path = git_path_buf(&buf, "CoNfIg");
- if (!access(path, F_OK))
- git_config_set("core.ignorecase", "true");
- probe_utf8_pathname_composition();
- }
-
- strbuf_release(&buf);
- return reinit;
-}
-
-static void create_object_directory(void)
-{
- struct strbuf path = STRBUF_INIT;
- size_t baselen;
-
- strbuf_addstr(&path, get_object_directory());
- baselen = path.len;
-
- safe_create_dir(path.buf, 1);
-
- strbuf_setlen(&path, baselen);
- strbuf_addstr(&path, "/pack");
- safe_create_dir(path.buf, 1);
-
- strbuf_setlen(&path, baselen);
- strbuf_addstr(&path, "/info");
- safe_create_dir(path.buf, 1);
-
- strbuf_release(&path);
-}
-
-static void separate_git_dir(const char *git_dir, const char *git_link)
-{
- struct stat st;
-
- if (!stat(git_link, &st)) {
- const char *src;
-
- if (S_ISREG(st.st_mode))
- src = read_gitfile(git_link);
- else if (S_ISDIR(st.st_mode))
- src = git_link;
- else
- die(_("unable to handle file type %d"), (int)st.st_mode);
-
- if (rename(src, git_dir))
- die_errno(_("unable to move %s to %s"), src, git_dir);
- repair_worktrees(NULL, NULL);
- }
-
- write_file(git_link, "gitdir: %s", git_dir);
-}
-
-static void validate_hash_algorithm(struct repository_format *repo_fmt, int hash)
-{
- const char *env = getenv(GIT_DEFAULT_HASH_ENVIRONMENT);
- /*
- * If we already have an initialized repo, don't allow the user to
- * specify a different algorithm, as that could cause corruption.
- * Otherwise, if the user has specified one on the command line, use it.
- */
- if (repo_fmt->version >= 0 && hash != GIT_HASH_UNKNOWN && hash != repo_fmt->hash_algo)
- die(_("attempt to reinitialize repository with different hash"));
- else if (hash != GIT_HASH_UNKNOWN)
- repo_fmt->hash_algo = hash;
- else if (env) {
- int env_algo = hash_algo_by_name(env);
- if (env_algo == GIT_HASH_UNKNOWN)
- die(_("unknown hash algorithm '%s'"), env);
- repo_fmt->hash_algo = env_algo;
- }
-}
-
-int init_db(const char *git_dir, const char *real_git_dir,
- const char *template_dir, int hash, const char *initial_branch,
- unsigned int flags)
-{
- int reinit;
- int exist_ok = flags & INIT_DB_EXIST_OK;
- char *original_git_dir = real_pathdup(git_dir, 1);
- struct repository_format repo_fmt = REPOSITORY_FORMAT_INIT;
-
- if (real_git_dir) {
- struct stat st;
-
- if (!exist_ok && !stat(git_dir, &st))
- die(_("%s already exists"), git_dir);
-
- if (!exist_ok && !stat(real_git_dir, &st))
- die(_("%s already exists"), real_git_dir);
-
- set_git_dir(real_git_dir, 1);
- git_dir = get_git_dir();
- separate_git_dir(git_dir, original_git_dir);
- }
- else {
- set_git_dir(git_dir, 1);
- git_dir = get_git_dir();
- }
- startup_info->have_repository = 1;
-
- /* Ensure `core.hidedotfiles` is processed */
- git_config(platform_core_config, NULL);
-
- safe_create_dir(git_dir, 0);
-
- init_is_bare_repository = is_bare_repository();
-
- /* Check to see if the repository version is right.
- * Note that a newly created repository does not have
- * config file, so this will not fail. What we are catching
- * is an attempt to reinitialize new repository with an old tool.
- */
- check_repository_format(&repo_fmt);
-
- validate_hash_algorithm(&repo_fmt, hash);
-
- reinit = create_default_files(template_dir, original_git_dir,
- initial_branch, &repo_fmt,
- flags & INIT_DB_QUIET);
- if (reinit && initial_branch)
- warning(_("re-init: ignored --initial-branch=%s"),
- initial_branch);
-
- create_object_directory();
-
- if (get_shared_repository()) {
- char buf[10];
- /* We do not spell "group" and such, so that
- * the configuration can be read by older version
- * of git. Note, we use octal numbers for new share modes,
- * and compatibility values for PERM_GROUP and
- * PERM_EVERYBODY.
- */
- if (get_shared_repository() < 0)
- /* force to the mode value */
- xsnprintf(buf, sizeof(buf), "0%o", -get_shared_repository());
- else if (get_shared_repository() == PERM_GROUP)
- xsnprintf(buf, sizeof(buf), "%d", OLD_PERM_GROUP);
- else if (get_shared_repository() == PERM_EVERYBODY)
- xsnprintf(buf, sizeof(buf), "%d", OLD_PERM_EVERYBODY);
- else
- BUG("invalid value for shared_repository");
- git_config_set("core.sharedrepository", buf);
- git_config_set("receive.denyNonFastforwards", "true");
- }
-
- if (!(flags & INIT_DB_QUIET)) {
- int len = strlen(git_dir);
-
- if (reinit)
- printf(get_shared_repository()
- ? _("Reinitialized existing shared Git repository in %s%s\n")
- : _("Reinitialized existing Git repository in %s%s\n"),
- git_dir, len && git_dir[len-1] != '/' ? "/" : "");
- else
- printf(get_shared_repository()
- ? _("Initialized empty shared Git repository in %s%s\n")
- : _("Initialized empty Git repository in %s%s\n"),
- git_dir, len && git_dir[len-1] != '/' ? "/" : "");
- }
-
- free(original_git_dir);
- return 0;
-}
+#include "path.h"
+#include "refs.h"
+#include "repository.h"
+#include "setup.h"
+#include "strbuf.h"
static int guess_repository_type(const char *git_dir)
{
@@ -515,7 +56,11 @@ static int shared_callback(const struct option *opt, const char *arg, int unset)
}
static const char *const init_db_usage[] = {
- N_("git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]] [<directory>]"),
+ N_("git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
+ " [--separate-git-dir <git-dir>] [--object-format=<format>]\n"
+ " [--ref-format=<format>]\n"
+ " [-b <branch-name> | --initial-branch=<branch-name>]\n"
+ " [--shared[=<permissions>]] [<directory>]"),
NULL
};
@@ -533,8 +78,11 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
const char *template_dir = NULL;
unsigned int flags = 0;
const char *object_format = NULL;
+ const char *ref_format = NULL;
const char *initial_branch = NULL;
int hash_algo = GIT_HASH_UNKNOWN;
+ unsigned int ref_storage_format = REF_STORAGE_FORMAT_UNKNOWN;
+ int init_shared_repository = -1;
const struct option init_db_options[] = {
OPT_STRING(0, "template", &template_dir, N_("template-directory"),
N_("directory from which templates will be used")),
@@ -551,6 +99,8 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
N_("override the name of the initial branch")),
OPT_STRING(0, "object-format", &object_format, N_("hash"),
N_("specify the hash algorithm to use")),
+ OPT_STRING(0, "ref-format", &ref_format, N_("format"),
+ N_("specify the reference format to use")),
OPT_END()
};
@@ -614,6 +164,12 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
die(_("unknown hash algorithm '%s'"), object_format);
}
+ if (ref_format) {
+ ref_storage_format = ref_storage_format_by_name(ref_format);
+ if (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)
+ die(_("unknown ref storage format '%s'"), ref_format);
+ }
+
if (init_shared_repository != -1)
set_shared_repository(init_shared_repository);
@@ -692,5 +248,6 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
flags |= INIT_DB_EXIST_OK;
return init_db(git_dir, real_git_dir, template_dir, hash_algo,
- initial_branch, flags);
+ ref_storage_format, initial_branch,
+ init_shared_repository, flags);
}
diff --git a/builtin/interpret-trailers.c b/builtin/interpret-trailers.c
index 84748ea..8768bfe 100644
--- a/builtin/interpret-trailers.c
+++ b/builtin/interpret-trailers.c
@@ -5,15 +5,18 @@
*
*/
-#include "cache.h"
#include "builtin.h"
+#include "gettext.h"
#include "parse-options.h"
#include "string-list.h"
+#include "tempfile.h"
#include "trailer.h"
#include "config.h"
static const char * const git_interpret_trailers_usage[] = {
- N_("git interpret-trailers [--in-place] [--trim-empty] [(--trailer <token>[(=|:)<value>])...] [<file>...]"),
+ N_("git interpret-trailers [--in-place] [--trim-empty]\n"
+ " [(--trailer (<key>|<key-alias>)[(=|:)<value>])...]\n"
+ " [--parse] [<file>...]"),
NULL
};
@@ -22,21 +25,24 @@ static enum trailer_if_exists if_exists;
static enum trailer_if_missing if_missing;
static int option_parse_where(const struct option *opt,
- const char *arg, int unset)
+ const char *arg, int unset UNUSED)
{
- return trailer_set_where(&where, arg);
+ /* unset implies NULL arg, which is handled in our helper */
+ return trailer_set_where(opt->value, arg);
}
static int option_parse_if_exists(const struct option *opt,
- const char *arg, int unset)
+ const char *arg, int unset UNUSED)
{
- return trailer_set_if_exists(&if_exists, arg);
+ /* unset implies NULL arg, which is handled in our helper */
+ return trailer_set_if_exists(opt->value, arg);
}
static int option_parse_if_missing(const struct option *opt,
- const char *arg, int unset)
+ const char *arg, int unset UNUSED)
{
- return trailer_set_if_missing(&if_missing, arg);
+ /* unset implies NULL arg, which is handled in our helper */
+ return trailer_set_if_missing(opt->value, arg);
}
static void new_trailers_clear(struct list_head *trailers)
@@ -86,6 +92,102 @@ static int parse_opt_parse(const struct option *opt, const char *arg,
return 0;
}
+static struct tempfile *trailers_tempfile;
+
+static FILE *create_in_place_tempfile(const char *file)
+{
+ struct stat st;
+ struct strbuf filename_template = STRBUF_INIT;
+ const char *tail;
+ FILE *outfile;
+
+ if (stat(file, &st))
+ die_errno(_("could not stat %s"), file);
+ if (!S_ISREG(st.st_mode))
+ die(_("file %s is not a regular file"), file);
+ if (!(st.st_mode & S_IWUSR))
+ die(_("file %s is not writable by user"), file);
+
+ /* Create temporary file in the same directory as the original */
+ tail = strrchr(file, '/');
+ if (tail)
+ strbuf_add(&filename_template, file, tail - file + 1);
+ strbuf_addstr(&filename_template, "git-interpret-trailers-XXXXXX");
+
+ trailers_tempfile = xmks_tempfile_m(filename_template.buf, st.st_mode);
+ strbuf_release(&filename_template);
+ outfile = fdopen_tempfile(trailers_tempfile, "w");
+ if (!outfile)
+ die_errno(_("could not open temporary file"));
+
+ return outfile;
+}
+
+static void read_input_file(struct strbuf *sb, const char *file)
+{
+ if (file) {
+ if (strbuf_read_file(sb, file, 0) < 0)
+ die_errno(_("could not read input file '%s'"), file);
+ } else {
+ if (strbuf_read(sb, fileno(stdin), 0) < 0)
+ die_errno(_("could not read from stdin"));
+ }
+}
+
+static void interpret_trailers(const struct process_trailer_options *opts,
+ struct list_head *new_trailer_head,
+ const char *file)
+{
+ LIST_HEAD(head);
+ struct strbuf sb = STRBUF_INIT;
+ struct strbuf trailer_block = STRBUF_INIT;
+ struct trailer_info info;
+ FILE *outfile = stdout;
+
+ trailer_config_init();
+
+ read_input_file(&sb, file);
+
+ if (opts->in_place)
+ outfile = create_in_place_tempfile(file);
+
+ parse_trailers(opts, &info, sb.buf, &head);
+
+ /* Print the lines before the trailers */
+ if (!opts->only_trailers)
+ fwrite(sb.buf, 1, info.trailer_block_start, outfile);
+
+ if (!opts->only_trailers && !info.blank_line_before_trailer)
+ fprintf(outfile, "\n");
+
+
+ if (!opts->only_input) {
+ LIST_HEAD(config_head);
+ LIST_HEAD(arg_head);
+ parse_trailers_from_config(&config_head);
+ parse_trailers_from_command_line_args(&arg_head, new_trailer_head);
+ list_splice(&config_head, &arg_head);
+ process_trailers_lists(&head, &arg_head);
+ }
+
+ /* Print trailer block. */
+ format_trailers(opts, &head, &trailer_block);
+ free_trailers(&head);
+ fwrite(trailer_block.buf, 1, trailer_block.len, outfile);
+ strbuf_release(&trailer_block);
+
+ /* Print the lines after the trailers as is */
+ if (!opts->only_trailers)
+ fwrite(sb.buf + info.trailer_block_end, 1, sb.len - info.trailer_block_end, outfile);
+ trailer_info_release(&info);
+
+ if (opts->in_place)
+ if (rename_tempfile(&trailers_tempfile, file))
+ die_errno(_("could not rename temporary file to %s"), file);
+
+ strbuf_release(&sb);
+}
+
int cmd_interpret_trailers(int argc, const char **argv, const char *prefix)
{
struct process_trailer_options opts = PROCESS_TRAILER_OPTIONS_INIT;
@@ -95,19 +197,19 @@ int cmd_interpret_trailers(int argc, const char **argv, const char *prefix)
OPT_BOOL(0, "in-place", &opts.in_place, N_("edit files in place")),
OPT_BOOL(0, "trim-empty", &opts.trim_empty, N_("trim empty trailers")),
- OPT_CALLBACK(0, "where", NULL, N_("action"),
+ OPT_CALLBACK(0, "where", &where, N_("placement"),
N_("where to place the new trailer"), option_parse_where),
- OPT_CALLBACK(0, "if-exists", NULL, N_("action"),
+ OPT_CALLBACK(0, "if-exists", &if_exists, N_("action"),
N_("action if trailer already exists"), option_parse_if_exists),
- OPT_CALLBACK(0, "if-missing", NULL, N_("action"),
+ OPT_CALLBACK(0, "if-missing", &if_missing, N_("action"),
N_("action if trailer is missing"), option_parse_if_missing),
OPT_BOOL(0, "only-trailers", &opts.only_trailers, N_("output only the trailers")),
- OPT_BOOL(0, "only-input", &opts.only_input, N_("do not apply config rules")),
- OPT_BOOL(0, "unfold", &opts.unfold, N_("join whitespace-continued values")),
- OPT_CALLBACK_F(0, "parse", &opts, NULL, N_("set parsing options"),
+ OPT_BOOL(0, "only-input", &opts.only_input, N_("do not apply trailer.* configuration variables")),
+ OPT_BOOL(0, "unfold", &opts.unfold, N_("reformat multiline trailer values as single-line values")),
+ OPT_CALLBACK_F(0, "parse", &opts, NULL, N_("alias for --only-trailers --only-input --unfold"),
PARSE_OPT_NOARG | PARSE_OPT_NONEG, parse_opt_parse),
- OPT_BOOL(0, "no-divider", &opts.no_divider, N_("do not treat --- specially")),
+ OPT_BOOL(0, "no-divider", &opts.no_divider, N_("do not treat \"---\" as the end of input")),
OPT_CALLBACK(0, "trailer", &trailers, N_("trailer"),
N_("trailer(s) to add"), option_parse_trailer),
OPT_END()
@@ -127,11 +229,11 @@ int cmd_interpret_trailers(int argc, const char **argv, const char *prefix)
if (argc) {
int i;
for (i = 0; i < argc; i++)
- process_trailers(argv[i], &opts, &trailers);
+ interpret_trailers(&opts, &trailers, argv[i]);
} else {
if (opts.in_place)
die(_("no input file given for in-place editing"));
- process_trailers(NULL, &opts, &trailers);
+ interpret_trailers(&opts, &trailers, NULL);
}
new_trailers_clear(&trailers);
diff --git a/builtin/log.c b/builtin/log.c
index 88a5e98..c0a8bb9 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -4,11 +4,17 @@
* (C) Copyright 2006 Linus Torvalds
* 2006 Junio Hamano
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "refs.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "pager.h"
#include "color.h"
#include "commit.h"
#include "diff.h"
@@ -16,10 +22,10 @@
#include "revision.h"
#include "log-tree.h"
#include "builtin.h"
+#include "oid-array.h"
#include "tag.h"
#include "reflog-walk.h"
#include "patch-ids.h"
-#include "run-command.h"
#include "shortlog.h"
#include "remote.h"
#include "string-list.h"
@@ -29,13 +35,14 @@
#include "streaming.h"
#include "version.h"
#include "mailmap.h"
-#include "gpg-interface.h"
#include "progress.h"
#include "commit-slab.h"
#include "repository.h"
#include "commit-reach.h"
#include "range-diff.h"
#include "tmp-objdir.h"
+#include "tree.h"
+#include "write-or-die.h"
#define MAIL_DEFAULT_WRAP 72
#define COVER_FROM_AUTO_MAX_SUBJECT_LEN 100
@@ -52,9 +59,12 @@ static int default_encode_email_headers = 1;
static int decoration_style;
static int decoration_given;
static int use_mailmap_config = 1;
+static unsigned int force_in_body_from;
+static int stdout_mboxrd;
static const char *fmt_patch_subject_prefix = "PATCH";
static int fmt_patch_name_max = FORMAT_PATCH_NAME_MAX_DEFAULT;
static const char *fmt_pretty;
+static int format_no_prefix;
static const char * const builtin_log_usage[] = {
N_("git log [<options>] [<revision-range>] [[--] <path>...]"),
@@ -101,7 +111,24 @@ static int parse_decoration_style(const char *value)
return -1;
}
-static int decorate_callback(const struct option *opt, const char *arg, int unset)
+static int use_default_decoration_filter = 1;
+static struct string_list decorate_refs_exclude = STRING_LIST_INIT_NODUP;
+static struct string_list decorate_refs_exclude_config = STRING_LIST_INIT_NODUP;
+static struct string_list decorate_refs_include = STRING_LIST_INIT_NODUP;
+
+static int clear_decorations_callback(const struct option *opt UNUSED,
+ const char *arg, int unset)
+{
+ BUG_ON_OPT_NEG(unset);
+ BUG_ON_OPT_ARG(arg);
+ string_list_clear(&decorate_refs_include, 0);
+ string_list_clear(&decorate_refs_exclude, 0);
+ use_default_decoration_filter = 0;
+ return 0;
+}
+
+static int decorate_callback(const struct option *opt UNUSED, const char *arg,
+ int unset)
{
if (unset)
decoration_style = 0;
@@ -147,33 +174,75 @@ static void cmd_log_init_defaults(struct rev_info *rev)
if (default_follow)
rev->diffopt.flags.default_follow_renames = 1;
rev->verbose_header = 1;
+ init_diffstat_widths(&rev->diffopt);
rev->diffopt.flags.recursive = 1;
- rev->diffopt.stat_width = -1; /* use full terminal width */
- rev->diffopt.stat_graph_width = -1; /* respect statGraphWidth config */
+ rev->diffopt.flags.allow_textconv = 1;
rev->abbrev_commit = default_abbrev_commit;
rev->show_root_diff = default_show_root;
rev->subject_prefix = fmt_patch_subject_prefix;
rev->patch_name_max = fmt_patch_name_max;
rev->show_signature = default_show_signature;
rev->encode_email_headers = default_encode_email_headers;
- rev->diffopt.flags.allow_textconv = 1;
if (default_date_mode)
parse_date_format(default_date_mode, &rev->date_mode);
}
+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;
+
+ if (!git_config_get_string_multi("log.excludeDecoration",
+ &config_exclude)) {
+ struct string_list_item *item;
+ for_each_string_list_item(item, config_exclude)
+ string_list_append(decoration_filter->exclude_ref_config_pattern,
+ item->string);
+ }
+
+ /*
+ * By default, decorate_all is disabled. Enable it if
+ * log.initialDecorationSet=all. Don't ever disable it by config,
+ * since the command-line takes precedent.
+ */
+ if (use_default_decoration_filter &&
+ !git_config_get_string("log.initialdecorationset", &value) &&
+ !strcmp("all", value))
+ use_default_decoration_filter = 0;
+ free(value);
+
+ if (!use_default_decoration_filter ||
+ decoration_filter->exclude_ref_pattern->nr ||
+ decoration_filter->include_ref_pattern->nr ||
+ decoration_filter->exclude_ref_config_pattern->nr)
+ return;
+
+ /*
+ * No command-line or config options were given, so
+ * populate with sensible defaults.
+ */
+ for (i = 0; i < ARRAY_SIZE(ref_namespace); i++) {
+ if (!ref_namespace[i].decoration)
+ continue;
+
+ string_list_append(include, ref_namespace[i].ref);
+ }
+}
+
static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
struct rev_info *rev, struct setup_revision_opt *opt)
{
struct userformat_want w;
int quiet = 0, source = 0, mailmap;
static struct line_opt_callback_data line_cb = {NULL, NULL, STRING_LIST_INIT_DUP};
- static struct string_list decorate_refs_exclude = STRING_LIST_INIT_NODUP;
- static struct string_list decorate_refs_exclude_config = STRING_LIST_INIT_NODUP;
- static struct string_list decorate_refs_include = STRING_LIST_INIT_NODUP;
- struct decoration_filter decoration_filter = {&decorate_refs_include,
- &decorate_refs_exclude,
- &decorate_refs_exclude_config};
+ struct decoration_filter decoration_filter = {
+ .exclude_ref_pattern = &decorate_refs_exclude,
+ .include_ref_pattern = &decorate_refs_include,
+ .exclude_ref_config_pattern = &decorate_refs_exclude_config,
+ };
static struct revision_sources revision_sources;
const struct option builtin_log_options[] = {
@@ -181,6 +250,10 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
OPT_BOOL(0, "source", &source, N_("show source")),
OPT_BOOL(0, "use-mailmap", &mailmap, N_("use mail map file")),
OPT_ALIAS(0, "mailmap", "use-mailmap"),
+ OPT_CALLBACK_F(0, "clear-decorations", NULL, NULL,
+ N_("clear all previously-defined decoration filters"),
+ PARSE_OPT_NOARG | PARSE_OPT_NONEG,
+ clear_decorations_callback),
OPT_STRING_LIST(0, "decorate-refs", &decorate_refs_include,
N_("pattern"), N_("only decorate refs that match <pattern>")),
OPT_STRING_LIST(0, "decorate-refs-exclude", &decorate_refs_exclude,
@@ -199,7 +272,7 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
mailmap = use_mailmap_config;
argc = parse_options(argc, argv, prefix,
builtin_log_options, builtin_log_usage,
- PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN |
+ PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN_OPT |
PARSE_OPT_KEEP_DASHDASH);
if (quiet)
@@ -265,16 +338,7 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
}
if (decoration_style || rev->simplify_by_decoration) {
- const struct string_list *config_exclude =
- repo_config_get_value_multi(the_repository,
- "log.excludeDecoration");
-
- if (config_exclude) {
- struct string_list_item *item;
- for_each_string_list_item(item, config_exclude)
- string_list_append(&decorate_refs_exclude_config,
- item->string);
- }
+ set_default_decoration_filter(&decoration_filter);
if (decoration_style)
rev->show_decorations = 1;
@@ -383,7 +447,7 @@ static void log_show_early(struct rev_info *revs, struct commit_list *list)
setitimer(ITIMER_REAL, &early_output_timer, NULL);
}
-static void early_output(int signal)
+static void early_output(int signal UNUSED)
{
show_early_output = log_show_early;
}
@@ -485,7 +549,7 @@ static int cmd_log_walk_no_free(struct rev_info *rev)
rev->diffopt.flags.check_failed) {
return 02;
}
- return diff_result_code(&rev->diffopt, 0);
+ return diff_result_code(&rev->diffopt);
}
static int cmd_log_walk(struct rev_info *rev)
@@ -499,7 +563,8 @@ static int cmd_log_walk(struct rev_info *rev)
return retval;
}
-static int git_log_config(const char *var, const char *value, void *cb)
+static int git_log_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
const char *slot_name;
@@ -508,7 +573,7 @@ static int git_log_config(const char *var, const char *value, void *cb)
if (!strcmp(var, "format.subjectprefix"))
return git_config_string(&fmt_patch_subject_prefix, var, value);
if (!strcmp(var, "format.filenamemaxlength")) {
- fmt_patch_name_max = git_config_int(var, value);
+ fmt_patch_name_max = git_config_int(var, value, ctx->kvi);
return 0;
}
if (!strcmp(var, "format.encodeemailheaders")) {
@@ -527,8 +592,11 @@ static int git_log_config(const char *var, const char *value, void *cb)
decoration_style = 0; /* maybe warn? */
return 0;
}
- if (!strcmp(var, "log.diffmerges"))
+ if (!strcmp(var, "log.diffmerges")) {
+ if (!value)
+ return config_error_nonbool(var);
return diff_merges_config(value);
+ }
if (!strcmp(var, "log.showroot")) {
default_show_root = git_config_bool(var, value);
return 0;
@@ -548,9 +616,7 @@ static int git_log_config(const char *var, const char *value, void *cb)
return 0;
}
- if (git_gpg_config(var, value, cb) < 0)
- return -1;
- return git_diff_ui_config(var, value, cb);
+ return git_diff_ui_config(var, value, ctx, cb);
}
int cmd_whatchanged(int argc, const char **argv, const char *prefix)
@@ -622,7 +688,7 @@ static int show_tag_object(const struct object_id *oid, struct rev_info *rev)
{
unsigned long size;
enum object_type type;
- char *buf = read_object_file(oid, &type, &size);
+ char *buf = repo_read_object_file(the_repository, oid, &type, &size);
int offset = 0;
if (!buf)
@@ -645,17 +711,17 @@ static int show_tag_object(const struct object_id *oid, struct rev_info *rev)
return 0;
}
-static int show_tree_object(const struct object_id *oid,
- struct strbuf *base,
- const char *pathname, unsigned mode, void *context)
+static int show_tree_object(const struct object_id *oid UNUSED,
+ struct strbuf *base UNUSED,
+ const char *pathname, unsigned mode,
+ void *context)
{
FILE *file = context;
fprintf(file, "%s%s\n", pathname, S_ISDIR(mode) ? "/" : "");
return 0;
}
-static void show_setup_revisions_tweak(struct rev_info *rev,
- struct setup_revision_opt *opt)
+static void show_setup_revisions_tweak(struct rev_info *rev)
{
if (rev->first_parent_only)
diff_merges_default_to_first_parent(rev);
@@ -668,10 +734,10 @@ static void show_setup_revisions_tweak(struct rev_info *rev,
int cmd_show(int argc, const char **argv, const char *prefix)
{
struct rev_info rev;
- struct object_array_entry *objects;
+ unsigned int i;
struct setup_revision_opt opt;
struct pathspec match_all;
- int i, count, ret = 0;
+ int ret = 0;
init_log_defaults();
git_config(git_log_config, NULL);
@@ -698,12 +764,10 @@ int cmd_show(int argc, const char **argv, const char *prefix)
if (!rev.no_walk)
return cmd_log_deinit(cmd_log_walk(&rev), &rev);
- count = rev.pending.nr;
- objects = rev.pending.objects;
rev.diffopt.no_free = 1;
- for (i = 0; i < count && !ret; i++) {
- struct object *o = objects[i].item;
- const char *name = objects[i].name;
+ for (i = 0; i < rev.pending.nr && !ret; i++) {
+ struct object *o = rev.pending.objects[i].item;
+ const char *name = rev.pending.objects[i].name;
switch (o->type) {
case OBJ_BLOB:
ret = show_blob_object(&o->oid, &rev, name);
@@ -726,7 +790,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)
if (!o)
ret = error(_("could not read object %s"),
oid_to_hex(oid));
- objects[i].item = o;
+ rev.pending.objects[i].item = o;
i--;
break;
}
@@ -743,11 +807,24 @@ int cmd_show(int argc, const char **argv, const char *prefix)
rev.shown_one = 1;
break;
case OBJ_COMMIT:
- rev.pending.nr = rev.pending.alloc = 0;
- rev.pending.objects = NULL;
+ {
+ struct object_array old;
+ struct object_array blank = OBJECT_ARRAY_INIT;
+
+ memcpy(&old, &rev.pending, sizeof(old));
+ memcpy(&rev.pending, &blank, sizeof(rev.pending));
+
add_object_array(o, name, &rev.pending);
ret = cmd_log_walk_no_free(&rev);
+
+ /*
+ * No need for
+ * object_array_clear(&pending). It was
+ * cleared already in prepare_revision_walk()
+ */
+ memcpy(&rev.pending, &old, sizeof(rev.pending));
break;
+ }
default:
ret = error(_("unknown type: %d"), o->type);
}
@@ -787,11 +864,10 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)
return cmd_log_deinit(cmd_log_walk(&rev), &rev);
}
-static void log_setup_revisions_tweak(struct rev_info *rev,
- struct setup_revision_opt *opt)
+static void log_setup_revisions_tweak(struct rev_info *rev)
{
if (rev->diffopt.flags.default_follow_renames &&
- rev->prune_data.nr == 1)
+ diff_check_follow_pathspec(&rev->prune_data, 0))
rev->diffopt.flags.follow_renames = 1;
if (rev->first_parent_only)
@@ -904,7 +980,8 @@ static enum cover_from_description parse_cover_from_description(const char *arg)
die(_("%s: invalid cover from description mode"), arg);
}
-static int git_format_config(const char *var, const char *value, void *cb)
+static int git_format_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(var, "format.headers")) {
if (!value)
@@ -942,6 +1019,8 @@ static int git_format_config(const char *var, const char *value, void *cb)
if (!strcmp(var, "format.attach")) {
if (value && *value)
default_attach = xstrdup(value);
+ else if (value && !*value)
+ FREE_AND_NULL(default_attach);
else
default_attach = xstrdup(git_version_string);
return 0;
@@ -995,6 +1074,10 @@ static int git_format_config(const char *var, const char *value, void *cb)
from = NULL;
return 0;
}
+ if (!strcmp(var, "format.forceinbodyfrom")) {
+ force_in_body_from = git_config_bool(var, value);
+ return 0;
+ }
if (!strcmp(var, "format.notes")) {
int b = git_parse_maybe_bool(value);
if (b < 0)
@@ -1009,8 +1092,25 @@ static int git_format_config(const char *var, const char *value, void *cb)
cover_from_description_mode = parse_cover_from_description(value);
return 0;
}
+ if (!strcmp(var, "format.mboxrd")) {
+ stdout_mboxrd = git_config_bool(var, value);
+ return 0;
+ }
+ if (!strcmp(var, "format.noprefix")) {
+ format_no_prefix = 1;
+ return 0;
+ }
- return git_log_config(var, value, cb);
+ /*
+ * ignore some porcelain config which would otherwise be parsed by
+ * git_diff_ui_config(), via git_log_config(); we can't just avoid
+ * diff_ui_config completely, because we do care about some ui options
+ * like color.
+ */
+ if (!strcmp(var, "diff.noprefix"))
+ return 0;
+
+ return git_log_config(var, value, ctx, cb);
}
static const char *output_directory = NULL;
@@ -1129,7 +1229,8 @@ static char *find_branch_name(struct rev_info *rev)
return NULL;
ref = rev->cmdline.rev[positive].name;
tip_oid = &rev->cmdline.rev[positive].item->oid;
- if (dwim_ref(ref, strlen(ref), &branch_oid, &full_ref, 0) &&
+ if (repo_dwim_ref(the_repository, ref, strlen(ref), &branch_oid,
+ &full_ref, 0) &&
skip_prefix(full_ref, "refs/heads/", &v) &&
oideq(tip_oid, &branch_oid))
branch = xstrdup(v);
@@ -1155,7 +1256,15 @@ static void show_diffstat(struct rev_info *rev,
fprintf(rev->diffopt.file, "\n");
}
+static void read_desc_file(struct strbuf *buf, const char *desc_file)
+{
+ if (strbuf_read_file(buf, desc_file, 0) < 0)
+ die_errno(_("unable to read branch description file '%s'"),
+ desc_file);
+}
+
static void prepare_cover_text(struct pretty_print_context *pp,
+ const char *description_file,
const char *branch_name,
struct strbuf *sb,
const char *encoding,
@@ -1169,7 +1278,9 @@ static void prepare_cover_text(struct pretty_print_context *pp,
if (cover_from_description_mode == COVER_FROM_NONE)
goto do_pp;
- if (branch_name && *branch_name)
+ if (description_file && *description_file)
+ read_desc_file(&description_sb, description_file);
+ else if (branch_name && *branch_name)
read_branch_desc(&description_sb, branch_name);
if (!description_sb.len)
goto do_pp;
@@ -1186,7 +1297,7 @@ static void prepare_cover_text(struct pretty_print_context *pp,
subject = subject_sb.buf;
do_pp:
- pp_title_line(pp, &subject, sb, encoding, need_8bit_cte);
+ pp_email_subject(pp, &subject, sb, encoding, need_8bit_cte);
pp_remainder(pp, &body, sb, 0);
strbuf_release(&description_sb);
@@ -1215,6 +1326,7 @@ static void get_notes_args(struct strvec *arg, struct rev_info *rev)
static void make_cover_letter(struct rev_info *rev, int use_separate_file,
struct commit *origin,
int nr, struct commit **list,
+ const char *description_file,
const char *branch_name,
int quiet)
{
@@ -1239,10 +1351,11 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file,
log_write_email_headers(rev, head, &pp.after_subject, &need_8bit_cte, 0);
for (i = 0; !need_8bit_cte && i < nr; i++) {
- const char *buf = get_commit_buffer(list[i], NULL);
+ const char *buf = repo_get_commit_buffer(the_repository,
+ list[i], NULL);
if (has_non_ascii(buf))
need_8bit_cte = 1;
- unuse_commit_buffer(list[i], buf);
+ repo_unuse_commit_buffer(the_repository, list[i], buf);
}
if (!branch_name)
@@ -1251,11 +1364,13 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file,
pp.fmt = CMIT_FMT_EMAIL;
pp.date_mode.type = DATE_RFC2822;
pp.rev = rev;
- pp.print_email_subject = 1;
+ pp.encode_email_headers = rev->encode_email_headers;
pp_user_info(&pp, NULL, &sb, committer, encoding);
- prepare_cover_text(&pp, branch_name, &sb, encoding, need_8bit_cte);
+ prepare_cover_text(&pp, description_file, branch_name, &sb,
+ encoding, need_8bit_cte);
fprintf(rev->diffopt.file, "%s\n", sb.buf);
+ free(pp.after_subject);
strbuf_release(&sb);
shortlog_init(&log);
@@ -1265,6 +1380,7 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file,
log.in2 = 4;
log.file = rev->diffopt.file;
log.groups = SHORTLOG_GROUP_AUTHOR;
+ shortlog_finish_setup(&log);
for (i = 0; i < nr; i++)
shortlog_add_commit(&log, list[i]);
@@ -1294,7 +1410,7 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file,
.other_arg = &other_arg
};
- diff_setup(&opts);
+ repo_diff_setup(the_repository, &opts);
opts.file = rev->diffopt.file;
opts.use_color = rev->diffopt.use_color;
diff_setup_done(&opts);
@@ -1305,7 +1421,7 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file,
}
}
-static const char *clean_message_id(const char *msg_id)
+static char *clean_message_id(const char *msg_id)
{
char ch;
const char *a, *z, *m;
@@ -1323,7 +1439,7 @@ static const char *clean_message_id(const char *msg_id)
if (!z)
die(_("insane in-reply-to: %s"), msg_id);
if (++z == m)
- return a;
+ return xstrdup(a);
return xmemdupz(a, z - a);
}
@@ -1368,19 +1484,16 @@ static int subject_prefix = 0;
static int subject_prefix_callback(const struct option *opt, const char *arg,
int unset)
{
+ struct strbuf *sprefix;
+
BUG_ON_OPT_NEG(unset);
+ sprefix = opt->value;
subject_prefix = 1;
- ((struct rev_info *)opt->value)->subject_prefix = arg;
+ strbuf_reset(sprefix);
+ strbuf_addstr(sprefix, arg);
return 0;
}
-static int rfc_callback(const struct option *opt, const char *arg, int unset)
-{
- BUG_ON_OPT_NEG(unset);
- BUG_ON_OPT_ARG(arg);
- return subject_prefix_callback(opt, "RFC PATCH", unset);
-}
-
static int numbered_cmdline_opt = 0;
static int numbered_callback(const struct option *opt, const char *arg,
@@ -1455,7 +1568,8 @@ static int inline_callback(const struct option *opt, const char *arg, int unset)
return 0;
}
-static int header_callback(const struct option *opt, const char *arg, int unset)
+static int header_callback(const struct option *opt UNUSED, const char *arg,
+ int unset)
{
if (unset) {
string_list_clear(&extra_hdr, 0);
@@ -1467,24 +1581,6 @@ static int header_callback(const struct option *opt, const char *arg, int unset)
return 0;
}
-static int to_callback(const struct option *opt, const char *arg, int unset)
-{
- if (unset)
- string_list_clear(&extra_to, 0);
- else
- string_list_append(&extra_to, arg);
- return 0;
-}
-
-static int cc_callback(const struct option *opt, const char *arg, int unset)
-{
- if (unset)
- string_list_clear(&extra_cc, 0);
- else
- string_list_append(&extra_cc, arg);
- return 0;
-}
-
static int from_callback(const struct option *opt, const char *arg, int unset)
{
char **from = opt->value;
@@ -1529,7 +1625,7 @@ static struct commit *get_base_commit(const char *base_commit,
{
struct commit *base = NULL;
struct commit **rev;
- int i = 0, rev_nr = 0, auto_select, die_on_failure;
+ int i = 0, rev_nr = 0, auto_select, die_on_failure, ret;
switch (auto_base) {
case AUTO_BASE_NEVER:
@@ -1562,20 +1658,23 @@ static struct commit *get_base_commit(const char *base_commit,
struct branch *curr_branch = branch_get(NULL);
const char *upstream = branch_get_upstream(curr_branch, NULL);
if (upstream) {
- struct commit_list *base_list;
+ struct commit_list *base_list = NULL;
struct commit *commit;
struct object_id oid;
- if (get_oid(upstream, &oid)) {
+ if (repo_get_oid(the_repository, upstream, &oid)) {
if (die_on_failure)
die(_("failed to resolve '%s' as a valid ref"), upstream);
else
return NULL;
}
commit = lookup_commit_or_die(&oid, "upstream base");
- base_list = get_merge_bases_many(commit, total, list);
- /* There should be one and only one merge base. */
- if (!base_list || base_list->next) {
+ if (repo_get_merge_bases_many(the_repository,
+ commit, total,
+ list,
+ &base_list) < 0 ||
+ /* There should be one and only one merge base. */
+ !base_list || base_list->next) {
if (die_on_failure) {
die(_("could not find exact merge base"));
} else {
@@ -1606,9 +1705,11 @@ static struct commit *get_base_commit(const char *base_commit,
*/
while (rev_nr > 1) {
for (i = 0; i < rev_nr / 2; i++) {
- struct commit_list *merge_base;
- merge_base = get_merge_bases(rev[2 * i], rev[2 * i + 1]);
- if (!merge_base || merge_base->next) {
+ struct commit_list *merge_base = NULL;
+ if (repo_get_merge_bases(the_repository,
+ rev[2 * i],
+ rev[2 * i + 1], &merge_base) < 0 ||
+ !merge_base || merge_base->next) {
if (die_on_failure) {
die(_("failed to find exact merge base"));
} else {
@@ -1625,7 +1726,10 @@ static struct commit *get_base_commit(const char *base_commit,
rev_nr = DIV_ROUND_UP(rev_nr, 2);
}
- if (!in_merge_bases(base, rev[0])) {
+ ret = repo_in_merge_bases(the_repository, base, rev[0]);
+ if (ret < 0)
+ exit(128);
+ if (!ret) {
if (die_on_failure) {
die(_("base commit should be the ancestor of revision list"));
} else {
@@ -1694,7 +1798,7 @@ static void prepare_bases(struct base_tree_info *bases,
struct object_id *patch_id;
if (*commit_base_at(&commit_base, commit))
continue;
- if (commit_patch_id(commit, &diffopt, &oid, 0, 1))
+ if (commit_patch_id(commit, &diffopt, &oid, 0))
die(_("cannot get patch id"));
ALLOC_GROW(bases->patch_id, bases->nr_patch_id + 1, bases->alloc_patch_id);
patch_id = bases->patch_id + bases->nr_patch_id;
@@ -1789,6 +1893,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
int quiet = 0;
const char *reroll_count = NULL;
char *cover_from_description_arg = NULL;
+ char *description_file = NULL;
char *branch_name = NULL;
char *base_commit = NULL;
struct base_tree_info bases;
@@ -1801,7 +1906,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
struct strbuf rdiff1 = STRBUF_INIT;
struct strbuf rdiff2 = STRBUF_INIT;
struct strbuf rdiff_title = STRBUF_INIT;
+ struct strbuf sprefix = STRBUF_INIT;
int creation_factor = -1;
+ int rfc = 0;
const struct option builtin_format_patch_options[] = {
OPT_CALLBACK_F('n', "numbered", &numbered, NULL,
@@ -1825,13 +1932,13 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
N_("mark the series as Nth re-roll")),
OPT_INTEGER(0, "filename-max-length", &fmt_patch_name_max,
N_("max length of output filename")),
- OPT_CALLBACK_F(0, "rfc", &rev, NULL,
- N_("use [RFC PATCH] instead of [PATCH]"),
- PARSE_OPT_NOARG | PARSE_OPT_NONEG, rfc_callback),
+ OPT_BOOL(0, "rfc", &rfc, N_("use [RFC PATCH] instead of [PATCH]")),
OPT_STRING(0, "cover-from-description", &cover_from_description_arg,
N_("cover-from-description-mode"),
N_("generate parts of a cover letter based on a branch's description")),
- OPT_CALLBACK_F(0, "subject-prefix", &rev, N_("prefix"),
+ OPT_FILENAME(0, "description-file", &description_file,
+ N_("use branch description from file")),
+ OPT_CALLBACK_F(0, "subject-prefix", &sprefix, N_("prefix"),
N_("use [<prefix>] instead of [PATCH]"),
PARSE_OPT_NONEG, subject_prefix_callback),
OPT_CALLBACK_F('o', "output-directory", &output_directory,
@@ -1852,8 +1959,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
OPT_GROUP(N_("Messaging")),
OPT_CALLBACK(0, "add-header", NULL, N_("header"),
N_("add email header"), header_callback),
- OPT_CALLBACK(0, "to", NULL, N_("email"), N_("add To: header"), to_callback),
- OPT_CALLBACK(0, "cc", NULL, N_("email"), N_("add Cc: header"), cc_callback),
+ OPT_STRING_LIST(0, "to", &extra_to, N_("email"), N_("add To: header")),
+ OPT_STRING_LIST(0, "cc", &extra_cc, N_("email"), N_("add Cc: header")),
OPT_CALLBACK_F(0, "from", &from, N_("ident"),
N_("set From address to <ident> (or committer ident if absent)"),
PARSE_OPT_OPTARG, from_callback),
@@ -1886,6 +1993,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
N_("show changes against <refspec> in cover letter or single patch")),
OPT_INTEGER(0, "creation-factor", &creation_factor,
N_("percentage by which creation is weighted")),
+ OPT_BOOL(0, "force-in-body-from", &force_in_body_from,
+ N_("show in-body From: even if identical to the e-mail header")),
OPT_END()
};
@@ -1909,11 +2018,14 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
rev.max_parents = 1;
rev.diffopt.flags.recursive = 1;
rev.diffopt.no_free = 1;
- rev.subject_prefix = fmt_patch_subject_prefix;
memset(&s_r_opt, 0, sizeof(s_r_opt));
s_r_opt.def = "HEAD";
s_r_opt.revarg_opt = REVARG_COMMITTISH;
+ strbuf_addstr(&sprefix, fmt_patch_subject_prefix);
+ if (format_no_prefix)
+ diff_set_noprefix(&rev.diffopt);
+
if (default_attach) {
rev.mime_boundary = default_attach;
rev.no_inline = 1;
@@ -1926,9 +2038,11 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
*/
argc = parse_options(argc, argv, prefix, builtin_format_patch_options,
builtin_format_patch_usage,
- PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN |
+ PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN_OPT |
PARSE_OPT_KEEP_DASHDASH);
+ rev.force_in_body_from = force_in_body_from;
+
/* Make sure "0000-$sub.patch" gives non-negative length for $sub */
if (fmt_patch_name_max <= strlen("0000-") + strlen(fmt_patch_suffix))
fmt_patch_name_max = strlen("0000-") + strlen(fmt_patch_suffix);
@@ -1936,15 +2050,16 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
if (cover_from_description_arg)
cover_from_description_mode = parse_cover_from_description(cover_from_description_arg);
- if (reroll_count) {
- struct strbuf sprefix = STRBUF_INIT;
+ if (rfc)
+ strbuf_insertstr(&sprefix, 0, "RFC ");
- strbuf_addf(&sprefix, "%s v%s",
- rev.subject_prefix, reroll_count);
+ if (reroll_count) {
+ strbuf_addf(&sprefix, " v%s", reroll_count);
rev.reroll_count = reroll_count;
- rev.subject_prefix = strbuf_detach(&sprefix, NULL);
}
+ rev.subject_prefix = sprefix.buf;
+
for (i = 0; i < extra_hdr.nr; i++) {
strbuf_addstr(&buf, extra_hdr.items[i].string);
strbuf_addch(&buf, '\n');
@@ -2018,6 +2133,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
/* Always generate a patch */
rev.diffopt.output_format |= DIFF_FORMAT_PATCH;
+ rev.always_show_header = 1;
rev.zero_commit = zero_commit;
rev.patch_name_max = fmt_patch_name_max;
@@ -2032,6 +2148,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
rev.diffopt.close_file, "--output",
!!output_directory, "--output-directory");
+ if (use_stdout && stdout_mboxrd)
+ rev.commit_format = CMIT_FMT_MBOXRD;
+
if (use_stdout) {
setup_pager();
} else if (!rev.diffopt.close_file) {
@@ -2195,11 +2314,11 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
if (in_reply_to || thread || cover_letter) {
rev.ref_message_ids = xmalloc(sizeof(*rev.ref_message_ids));
- string_list_init_nodup(rev.ref_message_ids);
+ string_list_init_dup(rev.ref_message_ids);
}
if (in_reply_to) {
- const char *msgid = clean_message_id(in_reply_to);
- string_list_append(rev.ref_message_ids, msgid);
+ char *msgid = clean_message_id(in_reply_to);
+ string_list_append_nodup(rev.ref_message_ids, msgid);
}
rev.numbered_files = just_numbers;
rev.patch_suffix = fmt_patch_suffix;
@@ -2207,7 +2326,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
if (thread)
gen_message_id(&rev, "cover");
make_cover_letter(&rev, !!output_directory,
- origin, nr, list, branch_name, quiet);
+ origin, nr, list, description_file, branch_name, quiet);
print_bases(&bases, rev.diffopt.file);
print_signature(rev.diffopt.file);
total++;
@@ -2255,8 +2374,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
&& (!cover_letter || rev.nr > 1))
free(rev.message_id);
else
- string_list_append(rev.ref_message_ids,
- rev.message_id);
+ string_list_append_nodup(rev.ref_message_ids,
+ rev.message_id);
}
gen_message_id(&rev, oid_to_hex(&commit->object.oid));
}
@@ -2303,7 +2422,9 @@ done:
strbuf_release(&rdiff1);
strbuf_release(&rdiff2);
strbuf_release(&rdiff_title);
+ strbuf_release(&sprefix);
free(to_free);
+ free(rev.message_id);
if (rev.ref_message_ids)
string_list_clear(rev.ref_message_ids, 0);
free(rev.ref_message_ids);
@@ -2313,7 +2434,7 @@ done:
static int add_pending_commit(const char *arg, struct rev_info *revs, int flags)
{
struct object_id oid;
- if (get_oid(arg, &oid) == 0) {
+ if (repo_get_oid(the_repository, arg, &oid) == 0) {
struct commit *commit = lookup_commit_reference(the_repository,
&oid);
if (commit) {
@@ -2335,12 +2456,12 @@ static void print_commit(char sign, struct commit *commit, int verbose,
{
if (!verbose) {
fprintf(file, "%c %s\n", sign,
- find_unique_abbrev(&commit->object.oid, abbrev));
+ repo_find_unique_abbrev(the_repository, &commit->object.oid, abbrev));
} else {
struct strbuf buf = STRBUF_INIT;
pp_commit_easy(CMIT_FMT_ONELINE, commit, &buf);
fprintf(file, "%c %s %s\n", sign,
- find_unique_abbrev(&commit->object.oid, abbrev),
+ repo_find_unique_abbrev(the_repository, &commit->object.oid, abbrev),
buf.buf);
strbuf_release(&buf);
}
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index e791b65..6eeb5cb 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -5,21 +5,27 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
-#include "cache.h"
+#include "builtin.h"
#include "repository.h"
#include "config.h"
+#include "convert.h"
#include "quote.h"
#include "dir.h"
-#include "builtin.h"
-#include "tree.h"
-#include "cache-tree.h"
+#include "gettext.h"
+#include "object-name.h"
+#include "strbuf.h"
#include "parse-options.h"
#include "resolve-undo.h"
#include "string-list.h"
+#include "path.h"
#include "pathspec.h"
-#include "run-command.h"
+#include "read-cache.h"
+#include "setup.h"
+#include "sparse-index.h"
#include "submodule.h"
-#include "submodule-config.h"
+#include "object-store.h"
+#include "hex.h"
+
static int abbrev;
static int show_deleted;
@@ -48,6 +54,7 @@ static char *ps_matched;
static const char *with_tree;
static int exc_given;
static int exclude_args;
+static const char *format;
static const char *tag_cached = "";
static const char *tag_unmerged = "";
@@ -85,6 +92,19 @@ static void write_name(const char *name)
stdout, line_terminator);
}
+static void write_name_to_buf(struct strbuf *sb, const char *name)
+{
+ struct strbuf buf = STRBUF_INIT;
+ const char *rel = relative_path(name, prefix_len ? prefix : NULL, &buf);
+
+ if (line_terminator)
+ quote_c_style(rel, sb, NULL, 0);
+ else
+ strbuf_addstr(sb, rel);
+
+ strbuf_release(&buf);
+}
+
static const char *get_tag(const struct cache_entry *ce, const char *tag)
{
static char alttag[4];
@@ -222,6 +242,72 @@ static void show_submodule(struct repository *superproject,
repo_clear(&subrepo);
}
+static void expand_objectsize(struct strbuf *line, const struct object_id *oid,
+ const enum object_type type, unsigned int padded)
+{
+ if (type == OBJ_BLOB) {
+ unsigned long size;
+ if (oid_object_info(the_repository, oid, &size) < 0)
+ die(_("could not get object info about '%s'"),
+ oid_to_hex(oid));
+ if (padded)
+ strbuf_addf(line, "%7"PRIuMAX, (uintmax_t)size);
+ else
+ strbuf_addf(line, "%"PRIuMAX, (uintmax_t)size);
+ } else if (padded) {
+ strbuf_addf(line, "%7s", "-");
+ } else {
+ strbuf_addstr(line, "-");
+ }
+}
+
+static void show_ce_fmt(struct repository *repo, const struct cache_entry *ce,
+ const char *format, const char *fullname) {
+ struct strbuf sb = STRBUF_INIT;
+
+ while (strbuf_expand_step(&sb, &format)) {
+ size_t len;
+ struct stat st;
+
+ if (skip_prefix(format, "%", &format))
+ strbuf_addch(&sb, '%');
+ else if ((len = strbuf_expand_literal(&sb, format)))
+ format += len;
+ else if (skip_prefix(format, "(objectmode)", &format))
+ strbuf_addf(&sb, "%06o", ce->ce_mode);
+ else if (skip_prefix(format, "(objectname)", &format))
+ strbuf_add_unique_abbrev(&sb, &ce->oid, abbrev);
+ else if (skip_prefix(format, "(objecttype)", &format))
+ strbuf_addstr(&sb, type_name(object_type(ce->ce_mode)));
+ else if (skip_prefix(format, "(objectsize:padded)", &format))
+ expand_objectsize(&sb, &ce->oid,
+ object_type(ce->ce_mode), 1);
+ else if (skip_prefix(format, "(objectsize)", &format))
+ expand_objectsize(&sb, &ce->oid,
+ object_type(ce->ce_mode), 0);
+ else if (skip_prefix(format, "(stage)", &format))
+ strbuf_addf(&sb, "%d", ce_stage(ce));
+ else if (skip_prefix(format, "(eolinfo:index)", &format))
+ strbuf_addstr(&sb, S_ISREG(ce->ce_mode) ?
+ get_cached_convert_stats_ascii(repo->index,
+ ce->name) : "");
+ else if (skip_prefix(format, "(eolinfo:worktree)", &format))
+ strbuf_addstr(&sb, !lstat(fullname, &st) &&
+ S_ISREG(st.st_mode) ?
+ get_wt_convert_stats_ascii(fullname) : "");
+ else if (skip_prefix(format, "(eolattr)", &format))
+ strbuf_addstr(&sb, get_convert_attr_ascii(repo->index,
+ fullname));
+ else if (skip_prefix(format, "(path)", &format))
+ write_name_to_buf(&sb, fullname);
+ else
+ strbuf_expand_bad_format(format, "ls-files");
+ }
+ strbuf_addch(&sb, line_terminator);
+ fwrite(sb.buf, sb.len, 1, stdout);
+ strbuf_release(&sb);
+}
+
static void show_ce(struct repository *repo, struct dir_struct *dir,
const struct cache_entry *ce, const char *fullname,
const char *tag)
@@ -236,6 +322,12 @@ static void show_ce(struct repository *repo, struct dir_struct *dir,
max_prefix_len, ps_matched,
S_ISDIR(ce->ce_mode) ||
S_ISGITLINK(ce->ce_mode))) {
+ if (format) {
+ show_ce_fmt(repo, ce, format, fullname);
+ print_debug(ce);
+ return;
+ }
+
tag = get_tag(ce, tag);
if (!show_stage) {
@@ -275,7 +367,7 @@ static void show_ru_info(struct index_state *istate)
if (!ui->mode[i])
continue;
printf("%s%06o %s %d\t", tag_resolve_undo, ui->mode[i],
- find_unique_abbrev(&ui->oid[i], abbrev),
+ repo_find_unique_abbrev(the_repository, &ui->oid[i], abbrev),
i + 1);
write_name(path);
}
@@ -424,142 +516,6 @@ static int get_common_prefix_len(const char *common_prefix)
return common_prefix_len;
}
-static int read_one_entry_opt(struct index_state *istate,
- const struct object_id *oid,
- struct strbuf *base,
- const char *pathname,
- unsigned mode, int opt)
-{
- int len;
- struct cache_entry *ce;
-
- if (S_ISDIR(mode))
- return READ_TREE_RECURSIVE;
-
- len = strlen(pathname);
- ce = make_empty_cache_entry(istate, base->len + len);
-
- ce->ce_mode = create_ce_mode(mode);
- ce->ce_flags = create_ce_flags(1);
- ce->ce_namelen = base->len + len;
- memcpy(ce->name, base->buf, base->len);
- memcpy(ce->name + base->len, pathname, len+1);
- oidcpy(&ce->oid, oid);
- return add_index_entry(istate, ce, opt);
-}
-
-static int read_one_entry(const struct object_id *oid, struct strbuf *base,
- const char *pathname, unsigned mode,
- void *context)
-{
- struct index_state *istate = context;
- return read_one_entry_opt(istate, oid, base, pathname,
- mode,
- ADD_CACHE_OK_TO_ADD|ADD_CACHE_SKIP_DFCHECK);
-}
-
-/*
- * This is used when the caller knows there is no existing entries at
- * the stage that will conflict with the entry being added.
- */
-static int read_one_entry_quick(const struct object_id *oid, struct strbuf *base,
- const char *pathname, unsigned mode,
- void *context)
-{
- struct index_state *istate = context;
- return read_one_entry_opt(istate, oid, base, pathname,
- mode, ADD_CACHE_JUST_APPEND);
-}
-
-/*
- * Read the tree specified with --with-tree option
- * (typically, HEAD) into stage #1 and then
- * squash them down to stage #0. This is used for
- * --error-unmatch to list and check the path patterns
- * that were given from the command line. We are not
- * going to write this index out.
- */
-void overlay_tree_on_index(struct index_state *istate,
- const char *tree_name, const char *prefix)
-{
- struct tree *tree;
- struct object_id oid;
- struct pathspec pathspec;
- struct cache_entry *last_stage0 = NULL;
- int i;
- read_tree_fn_t fn = NULL;
- int err;
-
- if (get_oid(tree_name, &oid))
- die("tree-ish %s not found.", tree_name);
- tree = parse_tree_indirect(&oid);
- if (!tree)
- die("bad tree-ish %s", tree_name);
-
- /* Hoist the unmerged entries up to stage #3 to make room */
- /* TODO: audit for interaction with sparse-index. */
- ensure_full_index(istate);
- for (i = 0; i < istate->cache_nr; i++) {
- struct cache_entry *ce = istate->cache[i];
- if (!ce_stage(ce))
- continue;
- ce->ce_flags |= CE_STAGEMASK;
- }
-
- if (prefix) {
- static const char *(matchbuf[1]);
- matchbuf[0] = NULL;
- parse_pathspec(&pathspec, PATHSPEC_ALL_MAGIC,
- PATHSPEC_PREFER_CWD, prefix, matchbuf);
- } else
- memset(&pathspec, 0, sizeof(pathspec));
-
- /*
- * See if we have cache entry at the stage. If so,
- * do it the original slow way, otherwise, append and then
- * sort at the end.
- */
- for (i = 0; !fn && i < istate->cache_nr; i++) {
- const struct cache_entry *ce = istate->cache[i];
- if (ce_stage(ce) == 1)
- fn = read_one_entry;
- }
-
- if (!fn)
- fn = read_one_entry_quick;
- err = read_tree(the_repository, tree, &pathspec, fn, istate);
- if (err)
- die("unable to read tree entries %s", tree_name);
-
- /*
- * Sort the cache entry -- we need to nuke the cache tree, though.
- */
- if (fn == read_one_entry_quick) {
- cache_tree_free(&istate->cache_tree);
- QSORT(istate->cache, istate->cache_nr, cmp_cache_name_compare);
- }
-
- for (i = 0; i < istate->cache_nr; i++) {
- struct cache_entry *ce = istate->cache[i];
- switch (ce_stage(ce)) {
- case 0:
- last_stage0 = ce;
- /* fallthru */
- default:
- continue;
- case 1:
- /*
- * If there is stage #0 entry for this, we do not
- * need to show it. We use CE_UPDATE bit to mark
- * such an entry.
- */
- if (last_stage0 &&
- !strcmp(last_stage0->name, ce->name))
- ce->ce_flags |= CE_UPDATE;
- }
- }
-}
-
static const char * const ls_files_usage[] = {
N_("git ls-files [<options>] [<file>...]"),
NULL
@@ -675,6 +631,9 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
N_("suppress duplicate entries")),
OPT_BOOL(0, "sparse", &show_sparse_dirs,
N_("show sparse directories in the presence of a sparse index")),
+ OPT_STRING_F(0, "format", &format, N_("format"),
+ N_("format to use for the output"),
+ PARSE_OPT_NONEG),
OPT_END()
};
int ret = 0;
@@ -699,6 +658,13 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
for (i = 0; i < exclude_list.nr; i++) {
add_pattern(exclude_list.items[i].string, "", 0, pl, --exclude_args);
}
+
+ if (format && (show_stage || show_others || show_killed ||
+ show_resolve_undo || skipping_duplicates || show_eol || show_tag))
+ usage_msg_opt(_("--format cannot be used with -s, -o, -k, -t, "
+ "--resolve-undo, --deduplicate, --eol"),
+ ls_files_usage, builtin_ls_files_options);
+
if (show_tag || show_valid_bit || show_fsmonitor_bit) {
tag_cached = "H ";
tag_unmerged = "M ";
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
index df44e5c..e8d65eb 100644
--- a/builtin/ls-remote.c
+++ b/builtin/ls-remote.c
@@ -1,14 +1,17 @@
#include "builtin.h"
-#include "cache.h"
+#include "gettext.h"
+#include "hex.h"
#include "transport.h"
+#include "pkt-line.h"
#include "ref-filter.h"
#include "remote.h"
-#include "refs.h"
+#include "parse-options.h"
+#include "wildmatch.h"
static const char * const ls_remote_usage[] = {
N_("git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
- " [-q | --quiet] [--exit-code] [--get-url]\n"
- " [--symref] [<repository> [<refs>...]]"),
+ " [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
+ " [--symref] [<repository> [<patterns>...]]"),
NULL
};
@@ -54,6 +57,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
struct transport *transport;
const struct ref *ref;
struct ref_array ref_array;
+ struct ref_sorting *sorting;
struct string_list sorting_options = STRING_LIST_INIT_DUP;
struct option options[] = {
@@ -137,13 +141,8 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
item->symref = xstrdup_or_null(ref->symref);
}
- if (sorting_options.nr) {
- struct ref_sorting *sorting;
-
- sorting = ref_sorting_options(&sorting_options);
- ref_array_sort(sorting, &ref_array);
- ref_sorting_release(sorting);
- }
+ sorting = ref_sorting_options(&sorting_options);
+ ref_array_sort(sorting, &ref_array);
for (i = 0; i < ref_array.nr; i++) {
const struct ref_array_item *ref = ref_array.items[i];
@@ -153,6 +152,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
status = 0; /* we found something */
}
+ ref_sorting_release(sorting);
ref_array_clear(&ref_array);
if (transport_disconnect(transport))
status = 1;
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c
index e279be8..7bf84b2 100644
--- a/builtin/ls-tree.c
+++ b/builtin/ls-tree.c
@@ -3,48 +3,23 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
-#include "cache.h"
+#include "builtin.h"
#include "config.h"
-#include "object-store.h"
-#include "blob.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "tree.h"
-#include "commit.h"
+#include "path.h"
#include "quote.h"
-#include "builtin.h"
#include "parse-options.h"
#include "pathspec.h"
-static int line_termination = '\n';
-#define LS_RECURSIVE 1
-#define LS_TREE_ONLY (1 << 1)
-#define LS_SHOW_TREES (1 << 2)
-static int abbrev;
-static int ls_options;
-static struct pathspec pathspec;
-static int chomp_prefix;
-static const char *ls_tree_prefix;
-static const char *format;
-struct show_tree_data {
- unsigned mode;
- enum object_type type;
- const struct object_id *oid;
- const char *pathname;
- struct strbuf *base;
-};
-
-static const char * const ls_tree_usage[] = {
+static const char * const ls_tree_usage[] = {
N_("git ls-tree [<options>] <tree-ish> [<path>...]"),
NULL
};
-static enum ls_tree_cmdmode {
- MODE_DEFAULT = 0,
- MODE_LONG,
- MODE_NAME_ONLY,
- MODE_NAME_STATUS,
- MODE_OBJECT_ONLY,
-} cmdmode;
-
static void expand_objectsize(struct strbuf *line, const struct object_id *oid,
const enum object_type type, unsigned int padded)
{
@@ -64,65 +39,32 @@ static void expand_objectsize(struct strbuf *line, const struct object_id *oid,
}
}
-static size_t expand_show_tree(struct strbuf *sb, const char *start,
- void *context)
-{
- struct show_tree_data *data = context;
- const char *end;
- const char *p;
- unsigned int errlen;
- size_t len = strbuf_expand_literal_cb(sb, start, NULL);
-
- if (len)
- return len;
- if (*start != '(')
- die(_("bad ls-tree format: element '%s' does not start with '('"), start);
-
- end = strchr(start + 1, ')');
- if (!end)
- die(_("bad ls-tree format: element '%s' does not end in ')'"), start);
-
- len = end - start + 1;
- if (skip_prefix(start, "(objectmode)", &p)) {
- strbuf_addf(sb, "%06o", data->mode);
- } else if (skip_prefix(start, "(objecttype)", &p)) {
- strbuf_addstr(sb, type_name(data->type));
- } else if (skip_prefix(start, "(objectsize:padded)", &p)) {
- expand_objectsize(sb, data->oid, data->type, 1);
- } else if (skip_prefix(start, "(objectsize)", &p)) {
- expand_objectsize(sb, data->oid, data->type, 0);
- } else if (skip_prefix(start, "(objectname)", &p)) {
- strbuf_add_unique_abbrev(sb, data->oid, abbrev);
- } else if (skip_prefix(start, "(path)", &p)) {
- const char *name = data->base->buf;
- const char *prefix = chomp_prefix ? ls_tree_prefix : NULL;
- struct strbuf quoted = STRBUF_INIT;
- struct strbuf sbuf = STRBUF_INIT;
- strbuf_addstr(data->base, data->pathname);
- name = relative_path(data->base->buf, prefix, &sbuf);
- quote_c_style(name, &quoted, NULL, 0);
- strbuf_addbuf(sb, &quoted);
- strbuf_release(&sbuf);
- strbuf_release(&quoted);
- } else {
- errlen = (unsigned long)len;
- die(_("bad ls-tree format: %%%.*s"), errlen, start);
- }
- return len;
-}
+struct ls_tree_options {
+ unsigned null_termination:1;
+ int abbrev;
+ enum ls_tree_path_options {
+ LS_RECURSIVE = 1 << 0,
+ LS_TREE_ONLY = 1 << 1,
+ LS_SHOW_TREES = 1 << 2,
+ } ls_options;
+ struct pathspec pathspec;
+ const char *prefix;
+ const char *format;
+};
-static int show_recursive(const char *base, size_t baselen, const char *pathname)
+static int show_recursive(struct ls_tree_options *options, const char *base,
+ size_t baselen, const char *pathname)
{
int i;
- if (ls_options & LS_RECURSIVE)
+ if (options->ls_options & LS_RECURSIVE)
return 1;
- if (!pathspec.nr)
+ if (!options->pathspec.nr)
return 0;
- for (i = 0; i < pathspec.nr; i++) {
- const char *spec = pathspec.items[i].match;
+ for (i = 0; i < options->pathspec.nr; i++) {
+ const char *spec = options->pathspec.items[i].match;
size_t len, speclen;
if (strncmp(base, spec, baselen))
@@ -144,70 +86,97 @@ static int show_recursive(const char *base, size_t baselen, const char *pathname
static int show_tree_fmt(const struct object_id *oid, struct strbuf *base,
const char *pathname, unsigned mode, void *context)
{
- size_t baselen;
+ struct ls_tree_options *options = context;
int recurse = 0;
struct strbuf sb = STRBUF_INIT;
enum object_type type = object_type(mode);
+ const char *format = options->format;
- struct show_tree_data data = {
- .mode = mode,
- .type = type,
- .oid = oid,
- .pathname = pathname,
- .base = base,
- };
-
- if (type == OBJ_TREE && show_recursive(base->buf, base->len, pathname))
+ if (type == OBJ_TREE && show_recursive(options, base->buf, base->len, pathname))
recurse = READ_TREE_RECURSIVE;
- if (type == OBJ_TREE && recurse && !(ls_options & LS_SHOW_TREES))
+ if (type == OBJ_TREE && recurse && !(options->ls_options & LS_SHOW_TREES))
return recurse;
- if (type == OBJ_BLOB && (ls_options & LS_TREE_ONLY))
+ if (type == OBJ_BLOB && (options->ls_options & LS_TREE_ONLY))
return 0;
- baselen = base->len;
- strbuf_expand(&sb, format, expand_show_tree, &data);
- strbuf_addch(&sb, line_termination);
+ while (strbuf_expand_step(&sb, &format)) {
+ size_t len;
+
+ if (skip_prefix(format, "%", &format))
+ strbuf_addch(&sb, '%');
+ else if ((len = strbuf_expand_literal(&sb, format)))
+ format += len;
+ else if (skip_prefix(format, "(objectmode)", &format))
+ strbuf_addf(&sb, "%06o", mode);
+ else if (skip_prefix(format, "(objecttype)", &format))
+ strbuf_addstr(&sb, type_name(type));
+ else if (skip_prefix(format, "(objectsize:padded)", &format))
+ expand_objectsize(&sb, oid, type, 1);
+ else if (skip_prefix(format, "(objectsize)", &format))
+ expand_objectsize(&sb, oid, type, 0);
+ else if (skip_prefix(format, "(objectname)", &format))
+ strbuf_add_unique_abbrev(&sb, oid, options->abbrev);
+ else if (skip_prefix(format, "(path)", &format)) {
+ const char *name;
+ const char *prefix = options->prefix;
+ struct strbuf sbuf = STRBUF_INIT;
+ size_t baselen = base->len;
+
+ strbuf_addstr(base, pathname);
+ name = relative_path(base->buf, prefix, &sbuf);
+ quote_c_style(name, &sb, NULL, 0);
+ strbuf_setlen(base, baselen);
+ strbuf_release(&sbuf);
+ } else
+ strbuf_expand_bad_format(format, "ls-tree");
+ }
+ strbuf_addch(&sb, options->null_termination ? '\0' : '\n');
fwrite(sb.buf, sb.len, 1, stdout);
strbuf_release(&sb);
- strbuf_setlen(base, baselen);
return recurse;
}
-static int show_tree_common(struct show_tree_data *data, int *recurse,
- const struct object_id *oid, struct strbuf *base,
- const char *pathname, unsigned mode)
+static int show_tree_common(struct ls_tree_options *options, int *recurse,
+ struct strbuf *base, const char *pathname,
+ enum object_type type)
{
- enum object_type type = object_type(mode);
int ret = -1;
-
*recurse = 0;
- data->mode = mode;
- data->type = type;
- data->oid = oid;
- data->pathname = pathname;
- data->base = base;
if (type == OBJ_BLOB) {
- if (ls_options & LS_TREE_ONLY)
+ if (options->ls_options & LS_TREE_ONLY)
ret = 0;
} else if (type == OBJ_TREE &&
- show_recursive(base->buf, base->len, pathname)) {
+ show_recursive(options, base->buf, base->len, pathname)) {
*recurse = READ_TREE_RECURSIVE;
- if (!(ls_options & LS_SHOW_TREES))
+ if (!(options->ls_options & LS_SHOW_TREES))
ret = *recurse;
}
return ret;
}
-static void show_tree_common_default_long(struct strbuf *base,
+static void show_tree_common_default_long(struct ls_tree_options *options,
+ struct strbuf *base,
const char *pathname,
const size_t baselen)
{
+ const char *prefix = options->prefix;
+
strbuf_addstr(base, pathname);
- write_name_quoted_relative(base->buf,
- chomp_prefix ? ls_tree_prefix : NULL, stdout,
- line_termination);
+
+ if (options->null_termination) {
+ struct strbuf sb = STRBUF_INIT;
+ const char *name = relative_path(base->buf, prefix, &sb);
+
+ fputs(name, stdout);
+ fputc('\0', stdout);
+
+ strbuf_release(&sb);
+ } else {
+ write_name_quoted_relative(base->buf, prefix, stdout, '\n');
+ }
+
strbuf_setlen(base, baselen);
}
@@ -215,35 +184,38 @@ static int show_tree_default(const struct object_id *oid, struct strbuf *base,
const char *pathname, unsigned mode,
void *context)
{
+ struct ls_tree_options *options = context;
int early;
int recurse;
- struct show_tree_data data = { 0 };
+ enum object_type type = object_type(mode);
- early = show_tree_common(&data, &recurse, oid, base, pathname, mode);
+ early = show_tree_common(options, &recurse, base, pathname, type);
if (early >= 0)
return early;
- printf("%06o %s %s\t", data.mode, type_name(data.type),
- find_unique_abbrev(data.oid, abbrev));
- show_tree_common_default_long(base, pathname, data.base->len);
+ printf("%06o %s %s\t", mode, type_name(object_type(mode)),
+ repo_find_unique_abbrev(the_repository, oid, options->abbrev));
+ show_tree_common_default_long(options, base, pathname, base->len);
return recurse;
}
static int show_tree_long(const struct object_id *oid, struct strbuf *base,
- const char *pathname, unsigned mode, void *context)
+ const char *pathname, unsigned mode,
+ void *context)
{
+ struct ls_tree_options *options = context;
int early;
int recurse;
- struct show_tree_data data = { 0 };
char size_text[24];
+ enum object_type type = object_type(mode);
- early = show_tree_common(&data, &recurse, oid, base, pathname, mode);
+ early = show_tree_common(options, &recurse, base, pathname, type);
if (early >= 0)
return early;
- if (data.type == OBJ_BLOB) {
+ if (type == OBJ_BLOB) {
unsigned long size;
- if (oid_object_info(the_repository, data.oid, &size) == OBJ_BAD)
+ if (oid_object_info(the_repository, oid, &size) == OBJ_BAD)
xsnprintf(size_text, sizeof(size_text), "BAD");
else
xsnprintf(size_text, sizeof(size_text),
@@ -252,47 +224,78 @@ static int show_tree_long(const struct object_id *oid, struct strbuf *base,
xsnprintf(size_text, sizeof(size_text), "-");
}
- printf("%06o %s %s %7s\t", data.mode, type_name(data.type),
- find_unique_abbrev(data.oid, abbrev), size_text);
- show_tree_common_default_long(base, pathname, data.base->len);
+ printf("%06o %s %s %7s\t", mode, type_name(type),
+ repo_find_unique_abbrev(the_repository, oid, options->abbrev),
+ size_text);
+ show_tree_common_default_long(options, base, pathname, base->len);
return recurse;
}
-static int show_tree_name_only(const struct object_id *oid, struct strbuf *base,
- const char *pathname, unsigned mode, void *context)
+static int show_tree_name_only(const struct object_id *oid UNUSED,
+ struct strbuf *base,
+ const char *pathname, unsigned mode,
+ void *context)
{
+ struct ls_tree_options *options = context;
int early;
int recurse;
const size_t baselen = base->len;
- struct show_tree_data data = { 0 };
+ enum object_type type = object_type(mode);
+ const char *prefix;
- early = show_tree_common(&data, &recurse, oid, base, pathname, mode);
+ early = show_tree_common(options, &recurse, base, pathname, type);
if (early >= 0)
return early;
+ prefix = options->prefix;
strbuf_addstr(base, pathname);
- write_name_quoted_relative(base->buf,
- chomp_prefix ? ls_tree_prefix : NULL,
- stdout, line_termination);
+ if (options->null_termination) {
+ struct strbuf sb = STRBUF_INIT;
+ const char *name = relative_path(base->buf, prefix, &sb);
+
+ fputs(name, stdout);
+ fputc('\0', stdout);
+
+ strbuf_release(&sb);
+ } else {
+ write_name_quoted_relative(base->buf, prefix, stdout, '\n');
+ }
strbuf_setlen(base, baselen);
return recurse;
}
static int show_tree_object(const struct object_id *oid, struct strbuf *base,
- const char *pathname, unsigned mode, void *context)
+ const char *pathname, unsigned mode,
+ void *context)
{
+ struct ls_tree_options *options = context;
int early;
int recurse;
- struct show_tree_data data = { 0 };
+ enum object_type type = object_type(mode);
+ const char *str;
- early = show_tree_common(&data, &recurse, oid, base, pathname, mode);
+ early = show_tree_common(options, &recurse, base, pathname, type);
if (early >= 0)
return early;
- printf("%s%c", find_unique_abbrev(oid, abbrev), line_termination);
+ str = repo_find_unique_abbrev(the_repository, oid, options->abbrev);
+ if (options->null_termination) {
+ fputs(str, stdout);
+ fputc('\0', stdout);
+ } else {
+ puts(str);
+ }
return recurse;
}
+enum ls_tree_cmdmode {
+ MODE_DEFAULT = 0,
+ MODE_LONG,
+ MODE_NAME_ONLY,
+ MODE_NAME_STATUS,
+ MODE_OBJECT_ONLY,
+};
+
struct ls_tree_cmdmode_to_fmt {
enum ls_tree_cmdmode mode;
const char *const fmt;
@@ -331,16 +334,20 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
struct object_id oid;
struct tree *tree;
int i, full_tree = 0;
+ int full_name = !prefix || !*prefix;
read_tree_fn_t fn = NULL;
+ enum ls_tree_cmdmode cmdmode = MODE_DEFAULT;
+ int null_termination = 0;
+ struct ls_tree_options options = { 0 };
const struct option ls_tree_options[] = {
- OPT_BIT('d', NULL, &ls_options, N_("only show trees"),
+ OPT_BIT('d', NULL, &options.ls_options, N_("only show trees"),
LS_TREE_ONLY),
- OPT_BIT('r', NULL, &ls_options, N_("recurse into subtrees"),
+ OPT_BIT('r', NULL, &options.ls_options, N_("recurse into subtrees"),
LS_RECURSIVE),
- OPT_BIT('t', NULL, &ls_options, N_("show trees when recursing"),
+ OPT_BIT('t', NULL, &options.ls_options, N_("show trees when recursing"),
LS_SHOW_TREES),
- OPT_SET_INT('z', NULL, &line_termination,
- N_("terminate entries with NUL byte"), 0),
+ OPT_BOOL('z', NULL, &null_termination,
+ N_("terminate entries with NUL byte")),
OPT_CMDMODE('l', "long", &cmdmode, N_("include object size"),
MODE_LONG),
OPT_CMDMODE(0, "name-only", &cmdmode, N_("list only filenames"),
@@ -349,30 +356,30 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
MODE_NAME_STATUS),
OPT_CMDMODE(0, "object-only", &cmdmode, N_("list only objects"),
MODE_OBJECT_ONLY),
- OPT_SET_INT(0, "full-name", &chomp_prefix,
- N_("use full path names"), 0),
+ OPT_BOOL(0, "full-name", &full_name, N_("use full path names")),
OPT_BOOL(0, "full-tree", &full_tree,
N_("list entire tree; not just current directory "
"(implies --full-name)")),
- OPT_STRING_F(0, "format", &format, N_("format"),
+ OPT_STRING_F(0, "format", &options.format, N_("format"),
N_("format to use for the output"),
PARSE_OPT_NONEG),
- OPT__ABBREV(&abbrev),
+ OPT__ABBREV(&options.abbrev),
OPT_END()
};
struct ls_tree_cmdmode_to_fmt *m2f = ls_tree_cmdmode_format;
+ struct object_context obj_context;
+ int ret;
git_config(git_default_config, NULL);
- ls_tree_prefix = prefix;
- if (prefix)
- chomp_prefix = strlen(prefix);
argc = parse_options(argc, argv, prefix, ls_tree_options,
ls_tree_usage, 0);
- if (full_tree) {
- ls_tree_prefix = prefix = NULL;
- chomp_prefix = 0;
- }
+ options.null_termination = null_termination;
+
+ if (full_tree)
+ prefix = NULL;
+ options.prefix = full_name ? NULL : prefix;
+
/*
* We wanted to detect conflicts between --name-only and
* --name-status, but once we're done with that subsequent
@@ -383,16 +390,18 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
/* -d -r should imply -t, but -d by itself should not have to. */
if ( (LS_TREE_ONLY|LS_RECURSIVE) ==
- ((LS_TREE_ONLY|LS_RECURSIVE) & ls_options))
- ls_options |= LS_SHOW_TREES;
+ ((LS_TREE_ONLY|LS_RECURSIVE) & options.ls_options))
+ options.ls_options |= LS_SHOW_TREES;
- if (format && cmdmode)
+ if (options.format && cmdmode)
usage_msg_opt(
_("--format can't be combined with other format-altering options"),
ls_tree_usage, ls_tree_options);
if (argc < 1)
usage_with_options(ls_tree_usage, ls_tree_options);
- if (get_oid(argv[0], &oid))
+ if (get_oid_with_context(the_repository, argv[0],
+ GET_OID_HASH_ANY, &oid,
+ &obj_context))
die("Not a valid object name %s", argv[0]);
/*
@@ -401,13 +410,13 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
* cannot be lifted until it is converted to use
* match_pathspec() or tree_entry_interesting()
*/
- parse_pathspec(&pathspec, PATHSPEC_ALL_MAGIC &
- ~(PATHSPEC_FROMTOP | PATHSPEC_LITERAL),
+ parse_pathspec(&options.pathspec, PATHSPEC_ALL_MAGIC &
+ ~(PATHSPEC_FROMTOP | PATHSPEC_LITERAL),
PATHSPEC_PREFER_CWD,
prefix, argv + 1);
- for (i = 0; i < pathspec.nr; i++)
- pathspec.items[i].nowildcard_len = pathspec.items[i].len;
- pathspec.has_wildcard = 0;
+ for (i = 0; i < options.pathspec.nr; i++)
+ options.pathspec.items[i].nowildcard_len = options.pathspec.items[i].len;
+ options.pathspec.has_wildcard = 0;
tree = parse_tree_indirect(&oid);
if (!tree)
die("not a tree object");
@@ -417,11 +426,11 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
*/
while (m2f) {
if (!m2f->fmt) {
- fn = format ? show_tree_fmt : show_tree_default;
- } else if (format && !strcmp(format, m2f->fmt)) {
+ fn = options.format ? show_tree_fmt : show_tree_default;
+ } else if (options.format && !strcmp(options.format, m2f->fmt)) {
cmdmode = m2f->mode;
fn = m2f->fn;
- } else if (!format && cmdmode == m2f->mode) {
+ } else if (!options.format && cmdmode == m2f->mode) {
fn = m2f->fn;
} else {
m2f++;
@@ -430,5 +439,7 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
break;
}
- return !!read_tree(the_repository, tree, &pathspec, fn, NULL);
+ ret = !!read_tree(the_repository, tree, &options.pathspec, fn, &options);
+ clear_pathspec(&options.pathspec);
+ return ret;
}
diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c
index 01d16ef..53a2264 100644
--- a/builtin/mailinfo.c
+++ b/builtin/mailinfo.c
@@ -2,9 +2,10 @@
* Another stupid program, this one parsing the headers of an
* email to figure out authorship and subject
*/
-#include "cache.h"
#include "builtin.h"
-#include "utf8.h"
+#include "abspath.h"
+#include "environment.h"
+#include "gettext.h"
#include "strbuf.h"
#include "mailinfo.h"
#include "parse-options.h"
diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c
index 73509f6..3af9ddb 100644
--- a/builtin/mailsplit.c
+++ b/builtin/mailsplit.c
@@ -4,8 +4,8 @@
* It just splits a mbox into a list of files: "0001" "0002" ..
* so you can process them further from there.
*/
-#include "cache.h"
#include "builtin.h"
+#include "gettext.h"
#include "string-list.h"
#include "strbuf.h"
@@ -277,6 +277,8 @@ int cmd_mailsplit(int argc, const char **argv, const char *prefix)
const char **argp;
static const char *stdin_only[] = { "-", NULL };
+ BUG_ON_NON_EMPTY_PREFIX(prefix);
+
for (argp = argv+1; *argp; argp++) {
const char *arg = *argp;
diff --git a/builtin/merge-base.c b/builtin/merge-base.c
index a11f8c6..5a8e729 100644
--- a/builtin/merge-base.c
+++ b/builtin/merge-base.c
@@ -1,19 +1,22 @@
#include "builtin.h"
-#include "cache.h"
#include "config.h"
#include "commit.h"
-#include "refs.h"
-#include "diff.h"
-#include "revision.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-name.h"
#include "parse-options.h"
#include "repository.h"
#include "commit-reach.h"
static int show_merge_base(struct commit **rev, int rev_nr, int show_all)
{
- struct commit_list *result, *r;
+ struct commit_list *result = NULL, *r;
- result = get_merge_bases_many_dirty(rev[0], rev_nr - 1, rev + 1);
+ if (repo_get_merge_bases_many_dirty(the_repository, rev[0],
+ rev_nr - 1, rev + 1, &result) < 0) {
+ free_commit_list(result);
+ return -1;
+ }
if (!result)
return 1;
@@ -31,8 +34,8 @@ static int show_merge_base(struct commit **rev, int rev_nr, int show_all)
static const char * const merge_base_usage[] = {
N_("git merge-base [-a | --all] <commit> <commit>..."),
N_("git merge-base [-a | --all] --octopus <commit>..."),
- N_("git merge-base --independent <commit>..."),
N_("git merge-base --is-ancestor <commit> <commit>"),
+ N_("git merge-base --independent <commit>..."),
N_("git merge-base --fork-point <ref> [<commit>]"),
NULL
};
@@ -42,7 +45,7 @@ static struct commit *get_commit_reference(const char *arg)
struct object_id revkey;
struct commit *r;
- if (get_oid(arg, &revkey))
+ if (repo_get_oid(the_repository, arg, &revkey))
die("Not a valid object name %s", arg);
r = lookup_commit_reference(the_repository, &revkey);
if (!r)
@@ -74,13 +77,17 @@ static int handle_independent(int count, const char **args)
static int handle_octopus(int count, const char **args, int show_all)
{
struct commit_list *revs = NULL;
- struct commit_list *result, *rev;
+ struct commit_list *result = NULL, *rev;
int i;
for (i = count - 1; i >= 0; i--)
commit_list_insert(get_commit_reference(args[i]), &revs);
- result = get_octopus_merge_bases(revs);
+ if (get_octopus_merge_bases(revs, &result) < 0) {
+ free_commit_list(revs);
+ free_commit_list(result);
+ return 128;
+ }
free_commit_list(revs);
reduce_heads_replace(&result);
@@ -100,12 +107,16 @@ static int handle_octopus(int count, const char **args, int show_all)
static int handle_is_ancestor(int argc, const char **argv)
{
struct commit *one, *two;
+ int ret;
if (argc != 2)
die("--is-ancestor takes exactly two commits");
one = get_commit_reference(argv[0]);
two = get_commit_reference(argv[1]);
- if (in_merge_bases(one, two))
+ ret = repo_in_merge_bases(the_repository, one, two);
+ if (ret < 0)
+ exit(128);
+ if (ret)
return 0;
else
return 1;
@@ -118,7 +129,7 @@ static int handle_fork_point(int argc, const char **argv)
const char *commitname;
commitname = (argc == 2) ? argv[1] : "HEAD";
- if (get_oid(commitname, &oid))
+ if (repo_get_oid(the_repository, commitname, &oid))
die("Not a valid object name: '%s'", commitname);
derived = lookup_commit_reference(the_repository, &oid);
diff --git a/builtin/merge-file.c b/builtin/merge-file.c
index e695867..1f98733 100644
--- a/builtin/merge-file.c
+++ b/builtin/merge-file.c
@@ -1,6 +1,12 @@
#include "builtin.h"
-#include "cache.h"
+#include "abspath.h"
+#include "diff.h"
+#include "hex.h"
+#include "object-name.h"
+#include "object-store.h"
#include "config.h"
+#include "gettext.h"
+#include "setup.h"
#include "xdiff/xdiff.h"
#include "xdiff-interface.h"
#include "parse-options.h"
@@ -23,16 +29,41 @@ static int label_cb(const struct option *opt, const char *arg, int unset)
return 0;
}
+static int set_diff_algorithm(xpparam_t *xpp,
+ const char *alg)
+{
+ long diff_algorithm = parse_algorithm_value(alg);
+ if (diff_algorithm < 0)
+ return -1;
+ xpp->flags = (xpp->flags & ~XDF_DIFF_ALGORITHM_MASK) | diff_algorithm;
+ return 0;
+}
+
+static int diff_algorithm_cb(const struct option *opt,
+ const char *arg, int unset)
+{
+ xpparam_t *xpp = opt->value;
+
+ BUG_ON_OPT_NEG(unset);
+
+ if (set_diff_algorithm(xpp, arg))
+ return error(_("option diff-algorithm accepts \"myers\", "
+ "\"minimal\", \"patience\" and \"histogram\""));
+
+ return 0;
+}
+
int cmd_merge_file(int argc, const char **argv, const char *prefix)
{
- const char *names[3] = { NULL, NULL, NULL };
- mmfile_t mmfs[3];
- mmbuffer_t result = {NULL, 0};
- xmparam_t xmp = {{0}};
- int ret = 0, i = 0, to_stdout = 0;
+ const char *names[3] = { 0 };
+ mmfile_t mmfs[3] = { 0 };
+ mmbuffer_t result = { 0 };
+ xmparam_t xmp = { 0 };
+ int ret = 0, i = 0, to_stdout = 0, object_id = 0;
int quiet = 0;
struct option options[] = {
OPT_BOOL('p', "stdout", &to_stdout, N_("send results to standard output")),
+ OPT_BOOL(0, "object-id", &object_id, N_("use object IDs instead of filenames")),
OPT_SET_INT(0, "diff3", &xmp.style, N_("use a diff3 based merge"), XDL_MERGE_DIFF3),
OPT_SET_INT(0, "zdiff3", &xmp.style, N_("use a zealous diff3 based merge"),
XDL_MERGE_ZEALOUS_DIFF3),
@@ -42,6 +73,9 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
XDL_MERGE_FAVOR_THEIRS),
OPT_SET_INT(0, "union", &xmp.favor, N_("for conflicts, use a union version"),
XDL_MERGE_FAVOR_UNION),
+ OPT_CALLBACK_F(0, "diff-algorithm", &xmp.xpp, N_("<algorithm>"),
+ N_("choose a diff algorithm"),
+ PARSE_OPT_NONEG, diff_algorithm_cb),
OPT_INTEGER(0, "marker-size", &xmp.marker_size,
N_("for conflicts, use this marker size")),
OPT__QUIET(&quiet, N_("do not warn about conflicts")),
@@ -69,23 +103,40 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
return error_errno("failed to redirect stderr to /dev/null");
}
+ if (object_id)
+ setup_git_directory();
+
for (i = 0; i < 3; i++) {
char *fname;
- int ret;
+ struct object_id oid;
+ mmfile_t *mmf = mmfs + i;
if (!names[i])
names[i] = argv[i];
fname = prefix_filename(prefix, argv[i]);
- ret = read_mmfile(mmfs + i, fname);
+
+ if (object_id) {
+ if (repo_get_oid(the_repository, argv[i], &oid))
+ ret = error(_("object '%s' does not exist"),
+ argv[i]);
+ else if (!oideq(&oid, the_hash_algo->empty_blob))
+ read_mmblob(mmf, &oid);
+ else
+ read_mmfile(mmf, "/dev/null");
+ } else if (read_mmfile(mmf, fname)) {
+ ret = -1;
+ }
+ if (ret != -1 && (mmf->size > MAX_XDIFF_SIZE ||
+ buffer_is_binary(mmf->ptr, mmf->size))) {
+ ret = error("Cannot merge binary files: %s",
+ argv[i]);
+ }
+
free(fname);
if (ret)
- return -1;
+ goto cleanup;
- if (mmfs[i].size > MAX_XDIFF_SIZE ||
- buffer_is_binary(mmfs[i].ptr, mmfs[i].size))
- return error("Cannot merge binary files: %s",
- argv[i]);
}
xmp.ancestor = names[1];
@@ -93,28 +144,41 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
xmp.file2 = names[2];
ret = xdl_merge(mmfs + 1, mmfs + 0, mmfs + 2, &xmp, &result);
- for (i = 0; i < 3; i++)
- free(mmfs[i].ptr);
-
if (ret >= 0) {
- const char *filename = argv[0];
- char *fpath = prefix_filename(prefix, argv[0]);
- FILE *f = to_stdout ? stdout : fopen(fpath, "wb");
-
- if (!f)
- ret = error_errno("Could not open %s for writing",
- filename);
- else if (result.size &&
- fwrite(result.ptr, result.size, 1, f) != 1)
- ret = error_errno("Could not write to %s", filename);
- else if (fclose(f))
- ret = error_errno("Could not close %s", filename);
+ if (object_id && !to_stdout) {
+ struct object_id oid;
+ if (result.size) {
+ if (write_object_file(result.ptr, result.size, OBJ_BLOB, &oid) < 0)
+ ret = error(_("Could not write object file"));
+ } else {
+ oidcpy(&oid, the_hash_algo->empty_blob);
+ }
+ if (ret >= 0)
+ printf("%s\n", oid_to_hex(&oid));
+ } else {
+ const char *filename = argv[0];
+ char *fpath = prefix_filename(prefix, argv[0]);
+ FILE *f = to_stdout ? stdout : fopen(fpath, "wb");
+
+ if (!f)
+ ret = error_errno("Could not open %s for writing",
+ filename);
+ else if (result.size &&
+ fwrite(result.ptr, result.size, 1, f) != 1)
+ ret = error_errno("Could not write to %s", filename);
+ else if (fclose(f))
+ ret = error_errno("Could not close %s", filename);
+ free(fpath);
+ }
free(result.ptr);
- free(fpath);
}
if (ret > 127)
ret = 127;
+cleanup:
+ for (i = 0; i < 3; i++)
+ free(mmfs[i].ptr);
+
return ret;
}
diff --git a/builtin/merge-index.c b/builtin/merge-index.c
index c0383fe..270d5f6 100644
--- a/builtin/merge-index.c
+++ b/builtin/merge-index.c
@@ -1,6 +1,10 @@
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "hex.h"
+#include "read-cache-ll.h"
+#include "repository.h"
#include "run-command.h"
+#include "sparse-index.h"
static const char *pgm;
static int one_shot, quiet;
@@ -12,12 +16,13 @@ static int merge_entry(int pos, const char *path)
const char *arguments[] = { pgm, "", "", "", path, "", "", "", NULL };
char hexbuf[4][GIT_MAX_HEXSZ + 1];
char ownbuf[4][60];
+ struct child_process cmd = CHILD_PROCESS_INIT;
- if (pos >= active_nr)
+ if (pos >= the_index.cache_nr)
die("git merge-index: %s not in the cache", path);
found = 0;
do {
- const struct cache_entry *ce = active_cache[pos];
+ const struct cache_entry *ce = the_index.cache[pos];
int stage = ce_stage(ce);
if (strcmp(ce->name, path))
@@ -27,11 +32,12 @@ static int merge_entry(int pos, const char *path)
xsnprintf(ownbuf[stage], sizeof(ownbuf[stage]), "%o", ce->ce_mode);
arguments[stage] = hexbuf[stage];
arguments[stage + 4] = ownbuf[stage];
- } while (++pos < active_nr);
+ } while (++pos < the_index.cache_nr);
if (!found)
die("git merge-index: %s not in the cache", path);
- if (run_command_v_opt(arguments, 0)) {
+ strvec_pushv(&cmd.args, arguments);
+ if (run_command(&cmd)) {
if (one_shot)
err++;
else {
@@ -45,7 +51,7 @@ static int merge_entry(int pos, const char *path)
static void merge_one_path(const char *path)
{
- int pos = cache_name_pos(path, strlen(path));
+ int pos = index_name_pos(&the_index, path, strlen(path));
/*
* If it already exists in the cache as stage0, it's
@@ -60,15 +66,15 @@ static void merge_all(void)
int i;
/* TODO: audit for interaction with sparse-index. */
ensure_full_index(&the_index);
- for (i = 0; i < active_nr; i++) {
- const struct cache_entry *ce = active_cache[i];
+ for (i = 0; i < the_index.cache_nr; i++) {
+ const struct cache_entry *ce = the_index.cache[i];
if (!ce_stage(ce))
continue;
i += merge_entry(i, ce->name)-1;
}
}
-int cmd_merge_index(int argc, const char **argv, const char *prefix)
+int cmd_merge_index(int argc, const char **argv, const char *prefix UNUSED)
{
int i, force_file = 0;
@@ -80,7 +86,7 @@ int cmd_merge_index(int argc, const char **argv, const char *prefix)
if (argc < 3)
usage("git merge-index [-o] [-q] <merge-program> (-a | [--] [<filename>...])");
- read_cache();
+ repo_read_index(the_repository);
/* TODO: audit for interaction with sparse-index. */
ensure_full_index(&the_index);
diff --git a/builtin/merge-ours.c b/builtin/merge-ours.c
index 3583cff..932924e 100644
--- a/builtin/merge-ours.c
+++ b/builtin/merge-ours.c
@@ -7,15 +7,15 @@
*
* Pretend we resolved the heads, but declare our tree trumps everybody else.
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
#include "git-compat-util.h"
#include "builtin.h"
#include "diff.h"
+#include "repository.h"
static const char builtin_merge_ours_usage[] =
"git merge-ours <base>... -- HEAD <remote>...";
-int cmd_merge_ours(int argc, const char **argv, const char *prefix)
+int cmd_merge_ours(int argc, const char **argv, const char *prefix UNUSED)
{
if (argc == 2 && !strcmp(argv[1], "-h"))
usage(builtin_merge_ours_usage);
@@ -25,7 +25,7 @@ int cmd_merge_ours(int argc, const char **argv, const char *prefix)
* commit. The index must match HEAD, or this merge cannot go
* through.
*/
- if (read_cache() < 0)
+ if (repo_read_index(the_repository) < 0)
die_errno("read_cache failed");
if (index_differs_from(the_repository, "HEAD", NULL, 0))
return 2;
diff --git a/builtin/merge-recursive.c b/builtin/merge-recursive.c
index b9acbf5..c2ce044 100644
--- a/builtin/merge-recursive.c
+++ b/builtin/merge-recursive.c
@@ -1,9 +1,10 @@
-#include "cache.h"
#include "builtin.h"
-#include "commit.h"
-#include "tag.h"
+#include "advice.h"
+#include "gettext.h"
+#include "hash.h"
#include "merge-recursive.h"
-#include "xdiff-interface.h"
+#include "object-name.h"
+#include "repository.h"
static const char builtin_merge_recursive_usage[] =
"git %s <base>... -- <head> <remote> ...";
@@ -20,7 +21,7 @@ static char *better_branch_name(const char *branch)
return xstrdup(name ? name : branch);
}
-int cmd_merge_recursive(int argc, const char **argv, const char *prefix)
+int cmd_merge_recursive(int argc, const char **argv, const char *prefix UNUSED)
{
const struct object_id *bases[21];
unsigned bases_count = 0;
@@ -49,7 +50,7 @@ int cmd_merge_recursive(int argc, const char **argv, const char *prefix)
}
if (bases_count < ARRAY_SIZE(bases)-1) {
struct object_id *oid = xmalloc(sizeof(struct object_id));
- if (get_oid(argv[i], oid))
+ if (repo_get_oid(the_repository, argv[i], oid))
die(_("could not parse object '%s'"), argv[i]);
bases[bases_count++] = oid;
}
@@ -70,9 +71,9 @@ int cmd_merge_recursive(int argc, const char **argv, const char *prefix)
o.branch1 = argv[++i];
o.branch2 = argv[++i];
- if (get_oid(o.branch1, &h1))
+ if (repo_get_oid(the_repository, o.branch1, &h1))
die(_("could not resolve ref '%s'"), o.branch1);
- if (get_oid(o.branch2, &h2))
+ if (repo_get_oid(the_repository, o.branch2, &h2))
die(_("could not resolve ref '%s'"), o.branch2);
o.branch1 = better1 = better_branch_name(o.branch1);
diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c
index 5dc94d6..8bdb439 100644
--- a/builtin/merge-tree.c
+++ b/builtin/merge-tree.c
@@ -1,14 +1,25 @@
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
#include "tree-walk.h"
#include "xdiff-interface.h"
-#include "object-store.h"
+#include "help.h"
+#include "gettext.h"
+#include "hex.h"
+#include "commit.h"
+#include "commit-reach.h"
+#include "merge-ort.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "parse-options.h"
#include "repository.h"
#include "blob.h"
-#include "exec-cmd.h"
#include "merge-blobs.h"
+#include "quote.h"
+#include "tree.h"
+#include "config.h"
+#include "strvec.h"
-static const char merge_tree_usage[] = "git merge-tree <base-tree> <branch1> <branch2>";
+static int line_termination = '\n';
struct merge_list {
struct merge_list *next;
@@ -28,7 +39,7 @@ static void add_merge_entry(struct merge_list *entry)
merge_result_end = &entry->next;
}
-static void merge_trees(struct tree_desc t[3], const char *base);
+static void trivial_merge_trees(struct tree_desc t[3], const char *base);
static const char *explanation(struct merge_list *entry)
{
@@ -63,7 +74,9 @@ static void *result(struct merge_list *entry, unsigned long *size)
const char *path = entry->path;
if (!entry->stage)
- return read_object_file(&entry->blob->object.oid, &type, size);
+ return repo_read_object_file(the_repository,
+ &entry->blob->object.oid, &type,
+ size);
base = NULL;
if (entry->stage == 1) {
base = entry->blob;
@@ -86,14 +99,15 @@ static void *origin(struct merge_list *entry, unsigned long *size)
enum object_type type;
while (entry) {
if (entry->stage == 2)
- return read_object_file(&entry->blob->object.oid,
- &type, size);
+ return repo_read_object_file(the_repository,
+ &entry->blob->object.oid,
+ &type, size);
entry = entry->link;
}
return NULL;
}
-static int show_outf(void *priv_, mmbuffer_t *mb, int nbuf)
+static int show_outf(void *priv UNUSED, mmbuffer_t *mb, int nbuf)
{
int i;
for (i = 0; i < nbuf; i++)
@@ -225,7 +239,7 @@ static void unresolved_directory(const struct traverse_info *info,
buf2 = fill_tree_descriptor(r, t + 2, ENTRY_OID(n + 2));
#undef ENTRY_OID
- merge_trees(t, newbase);
+ trivial_merge_trees(t, newbase);
free(buf0);
free(buf1);
@@ -310,7 +324,9 @@ static void unresolved(const struct traverse_info *info, struct name_entry n[3])
* The successful merge rules are the same as for the three-way merge
* in git-read-tree.
*/
-static int threeway_callback(int n, unsigned long mask, unsigned long dirmask, struct name_entry *entry, struct traverse_info *info)
+static int threeway_callback(int n UNUSED, unsigned long mask,
+ unsigned long dirmask UNUSED,
+ struct name_entry *entry, struct traverse_info *info)
{
/* Same in both? */
if (same_entry(entry+1, entry+2) || both_empty(entry+1, entry+2)) {
@@ -342,7 +358,7 @@ static int threeway_callback(int n, unsigned long mask, unsigned long dirmask, s
return mask;
}
-static void merge_trees(struct tree_desc t[3], const char *base)
+static void trivial_merge_trees(struct tree_desc t[3], const char *base)
{
struct traverse_info info;
@@ -366,19 +382,18 @@ static void *get_tree_descriptor(struct repository *r,
return buf;
}
-int cmd_merge_tree(int argc, const char **argv, const char *prefix)
+static int trivial_merge(const char *base,
+ const char *branch1,
+ const char *branch2)
{
struct repository *r = the_repository;
struct tree_desc t[3];
void *buf1, *buf2, *buf3;
- if (argc != 4)
- usage(merge_tree_usage);
-
- buf1 = get_tree_descriptor(r, t+0, argv[1]);
- buf2 = get_tree_descriptor(r, t+1, argv[2]);
- buf3 = get_tree_descriptor(r, t+2, argv[3]);
- merge_trees(t, "");
+ buf1 = get_tree_descriptor(r, t+0, base);
+ buf2 = get_tree_descriptor(r, t+1, branch1);
+ buf3 = get_tree_descriptor(r, t+2, branch2);
+ trivial_merge_trees(t, "");
free(buf1);
free(buf2);
free(buf3);
@@ -386,3 +401,270 @@ int cmd_merge_tree(int argc, const char **argv, const char *prefix)
show_result();
return 0;
}
+
+enum mode {
+ MODE_UNKNOWN,
+ MODE_TRIVIAL,
+ MODE_REAL,
+};
+
+struct merge_tree_options {
+ int mode;
+ int allow_unrelated_histories;
+ int show_messages;
+ int name_only;
+ int use_stdin;
+ struct merge_options merge_options;
+};
+
+static int real_merge(struct merge_tree_options *o,
+ const char *merge_base,
+ const char *branch1, const char *branch2,
+ const char *prefix)
+{
+ struct commit *parent1, *parent2;
+ struct commit_list *merge_bases = NULL;
+ struct merge_result result = { 0 };
+ int show_messages = o->show_messages;
+ struct merge_options opt;
+
+ copy_merge_options(&opt, &o->merge_options);
+ opt.show_rename_progress = 0;
+
+ opt.branch1 = branch1;
+ opt.branch2 = branch2;
+
+ if (merge_base) {
+ struct tree *base_tree, *parent1_tree, *parent2_tree;
+
+ /*
+ * We actually only need the trees because we already
+ * have a merge base.
+ */
+ struct object_id base_oid, head_oid, merge_oid;
+
+ if (repo_get_oid_treeish(the_repository, merge_base, &base_oid))
+ die(_("could not parse as tree '%s'"), merge_base);
+ base_tree = parse_tree_indirect(&base_oid);
+ if (!base_tree)
+ die(_("unable to read tree (%s)"), oid_to_hex(&base_oid));
+ if (repo_get_oid_treeish(the_repository, branch1, &head_oid))
+ die(_("could not parse as tree '%s'"), branch1);
+ parent1_tree = parse_tree_indirect(&head_oid);
+ if (!parent1_tree)
+ die(_("unable to read tree (%s)"), oid_to_hex(&head_oid));
+ if (repo_get_oid_treeish(the_repository, branch2, &merge_oid))
+ die(_("could not parse as tree '%s'"), branch2);
+ parent2_tree = parse_tree_indirect(&merge_oid);
+ if (!parent2_tree)
+ die(_("unable to read tree (%s)"), oid_to_hex(&merge_oid));
+
+ opt.ancestor = merge_base;
+ merge_incore_nonrecursive(&opt, base_tree, parent1_tree, parent2_tree, &result);
+ } else {
+ parent1 = get_merge_parent(branch1);
+ if (!parent1)
+ help_unknown_ref(branch1, "merge-tree",
+ _("not something we can merge"));
+
+ parent2 = get_merge_parent(branch2);
+ if (!parent2)
+ help_unknown_ref(branch2, "merge-tree",
+ _("not something we can merge"));
+
+ /*
+ * Get the merge bases, in reverse order; see comment above
+ * merge_incore_recursive in merge-ort.h
+ */
+ if (repo_get_merge_bases(the_repository, parent1,
+ parent2, &merge_bases) < 0)
+ exit(128);
+ if (!merge_bases && !o->allow_unrelated_histories)
+ die(_("refusing to merge unrelated histories"));
+ merge_bases = reverse_commit_list(merge_bases);
+ merge_incore_recursive(&opt, merge_bases, parent1, parent2, &result);
+ }
+
+ if (result.clean < 0)
+ die(_("failure to merge"));
+
+ if (show_messages == -1)
+ show_messages = !result.clean;
+
+ if (o->use_stdin)
+ printf("%d%c", result.clean, line_termination);
+ printf("%s%c", oid_to_hex(&result.tree->object.oid), line_termination);
+ 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++) {
+ const char *name = conflicted_files.items[i].string;
+ struct stage_info *c = conflicted_files.items[i].util;
+ if (!o->name_only)
+ printf("%06o %s %d\t",
+ c->mode, oid_to_hex(&c->oid), c->stage);
+ else if (last && !strcmp(last, name))
+ continue;
+ write_name_quoted_relative(
+ name, prefix, stdout, line_termination);
+ last = name;
+ }
+ string_list_clear(&conflicted_files, 1);
+ }
+ if (show_messages) {
+ putchar(line_termination);
+ merge_display_update_messages(&opt, line_termination == '\0',
+ &result);
+ }
+ if (o->use_stdin)
+ putchar(line_termination);
+ merge_finalize(&opt, &result);
+ clear_merge_options(&opt);
+ return !result.clean; /* result.clean < 0 handled above */
+}
+
+int cmd_merge_tree(int argc, const char **argv, const char *prefix)
+{
+ struct merge_tree_options o = { .show_messages = -1 };
+ struct strvec xopts = STRVEC_INIT;
+ int expected_remaining_argc;
+ int original_argc;
+ const char *merge_base = NULL;
+
+ const char * const merge_tree_usage[] = {
+ N_("git merge-tree [--write-tree] [<options>] <branch1> <branch2>"),
+ N_("git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"),
+ NULL
+ };
+ struct option mt_options[] = {
+ OPT_CMDMODE(0, "write-tree", &o.mode,
+ N_("do a real merge instead of a trivial merge"),
+ MODE_REAL),
+ OPT_CMDMODE(0, "trivial-merge", &o.mode,
+ N_("do a trivial merge only"), MODE_TRIVIAL),
+ OPT_BOOL(0, "messages", &o.show_messages,
+ N_("also show informational/conflict messages")),
+ OPT_SET_INT('z', NULL, &line_termination,
+ N_("separate paths with the NUL character"), '\0'),
+ OPT_BOOL_F(0, "name-only",
+ &o.name_only,
+ N_("list filenames without modes/oids/stages"),
+ PARSE_OPT_NONEG),
+ OPT_BOOL_F(0, "allow-unrelated-histories",
+ &o.allow_unrelated_histories,
+ N_("allow merging unrelated histories"),
+ PARSE_OPT_NONEG),
+ OPT_BOOL_F(0, "stdin",
+ &o.use_stdin,
+ N_("perform multiple merges, one per line of input"),
+ PARSE_OPT_NONEG),
+ OPT_STRING(0, "merge-base",
+ &merge_base,
+ N_("tree-ish"),
+ N_("specify a merge-base for the merge")),
+ OPT_STRVEC('X', "strategy-option", &xopts, N_("option=value"),
+ N_("option for selected merge strategy")),
+ OPT_END()
+ };
+
+ /* Init merge options */
+ init_merge_options(&o.merge_options, the_repository);
+
+ /* Parse arguments */
+ original_argc = argc - 1; /* ignoring argv[0] */
+ argc = parse_options(argc, argv, prefix, mt_options,
+ merge_tree_usage, PARSE_OPT_STOP_AT_NON_OPTION);
+
+ if (xopts.nr && o.mode == MODE_TRIVIAL)
+ die(_("--trivial-merge is incompatible with all other options"));
+ for (int 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]);
+
+ /* Handle --stdin */
+ if (o.use_stdin) {
+ struct strbuf buf = STRBUF_INIT;
+
+ if (o.mode == MODE_TRIVIAL)
+ die(_("--trivial-merge is incompatible with all other options"));
+ if (merge_base)
+ die(_("options '%s' and '%s' cannot be used together"),
+ "--merge-base", "--stdin");
+ line_termination = '\0';
+ while (strbuf_getline_lf(&buf, stdin) != EOF) {
+ struct strbuf **split;
+ int result;
+ const char *input_merge_base = NULL;
+
+ split = strbuf_split(&buf, ' ');
+ if (!split[0] || !split[1])
+ die(_("malformed input line: '%s'."), buf.buf);
+ strbuf_rtrim(split[0]);
+ strbuf_rtrim(split[1]);
+
+ /* parse the merge-base */
+ if (!strcmp(split[1]->buf, "--")) {
+ input_merge_base = split[0]->buf;
+ }
+
+ if (input_merge_base && split[2] && split[3] && !split[4]) {
+ strbuf_rtrim(split[2]);
+ strbuf_rtrim(split[3]);
+ result = real_merge(&o, input_merge_base, split[2]->buf, split[3]->buf, prefix);
+ } else if (!input_merge_base && !split[2]) {
+ result = real_merge(&o, NULL, split[0]->buf, split[1]->buf, prefix);
+ } else {
+ die(_("malformed input line: '%s'."), buf.buf);
+ }
+
+ if (result < 0)
+ die(_("merging cannot continue; got unclean result of %d"), result);
+ strbuf_list_free(split);
+ }
+ strbuf_release(&buf);
+ return 0;
+ }
+
+ /* Figure out which mode to use */
+ switch (o.mode) {
+ default:
+ BUG("unexpected command mode %d", o.mode);
+ case MODE_UNKNOWN:
+ switch (argc) {
+ default:
+ usage_with_options(merge_tree_usage, mt_options);
+ case 2:
+ o.mode = MODE_REAL;
+ break;
+ case 3:
+ o.mode = MODE_TRIVIAL;
+ break;
+ }
+ expected_remaining_argc = argc;
+ break;
+ case MODE_REAL:
+ expected_remaining_argc = 2;
+ break;
+ case MODE_TRIVIAL:
+ expected_remaining_argc = 3;
+ /* Removal of `--trivial-merge` is expected */
+ original_argc--;
+ break;
+ }
+ if (o.mode == MODE_TRIVIAL && argc < original_argc)
+ die(_("--trivial-merge is incompatible with all other options"));
+
+ if (argc != expected_remaining_argc)
+ usage_with_options(merge_tree_usage, mt_options);
+
+ git_config(git_default_config, NULL);
+
+ /* Do the relevant type of merge */
+ if (o.mode == MODE_REAL)
+ return real_merge(&o, merge_base, argv[0], argv[1], prefix);
+ else
+ return trivial_merge(argv[0], argv[1], argv[2]);
+}
diff --git a/builtin/merge.c b/builtin/merge.c
index d9784d4..6f4fec8 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -6,11 +6,17 @@
* Based on git-merge.sh by Junio C Hamano.
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
+#define USE_THE_INDEX_VARIABLE
+#include "builtin.h"
+#include "abspath.h"
+#include "advice.h"
#include "config.h"
+#include "editor.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-name.h"
#include "parse-options.h"
-#include "builtin.h"
#include "lockfile.h"
#include "run-command.h"
#include "hook.h"
@@ -20,24 +26,22 @@
#include "refspec.h"
#include "commit.h"
#include "diffcore.h"
+#include "path.h"
#include "revision.h"
#include "unpack-trees.h"
#include "cache-tree.h"
#include "dir.h"
-#include "utf8.h"
-#include "log-tree.h"
#include "color.h"
#include "rerere.h"
#include "help.h"
+#include "merge.h"
#include "merge-recursive.h"
#include "merge-ort-wrappers.h"
#include "resolve-undo.h"
#include "remote.h"
#include "fmt-merge-msg.h"
-#include "gpg-interface.h"
#include "sequencer.h"
#include "string-list.h"
-#include "packfile.h"
#include "tag.h"
#include "alias.h"
#include "branch.h"
@@ -71,8 +75,7 @@ static int overwrite_ignore = 1;
static struct strbuf merge_msg = STRBUF_INIT;
static struct strategy **use_strategies;
static size_t use_strategies_nr, use_strategies_alloc;
-static const char **xopts;
-static size_t xopts_nr, xopts_alloc;
+static struct strvec xopts = STRVEC_INIT;
static const char *branch;
static char *branch_mergeoptions;
static int verbosity;
@@ -188,9 +191,8 @@ static struct strategy *get_strategy(const char *name)
for (i = 0; i < main_cmds.cnt; i++) {
int j, found = 0;
struct cmdname *ent = main_cmds.names[i];
- for (j = 0; j < ARRAY_SIZE(all_strategy); j++)
- if (!strncmp(ent->name, all_strategy[j].name, ent->len)
- && !all_strategy[j].name[ent->len])
+ for (j = 0; !found && j < ARRAY_SIZE(all_strategy); j++)
+ if (!xstrncmpz(all_strategy[j].name, ent->name, ent->len))
found = 1;
if (!found)
add_cmdname(&not_strategies, ent->name, ent->len);
@@ -224,7 +226,7 @@ static void append_strategy(struct strategy *s)
use_strategies[use_strategies_nr++] = s;
}
-static int option_parse_strategy(const struct option *opt,
+static int option_parse_strategy(const struct option *opt UNUSED,
const char *name, int unset)
{
if (unset)
@@ -234,29 +236,9 @@ static int option_parse_strategy(const struct option *opt,
return 0;
}
-static int option_parse_x(const struct option *opt,
- const char *arg, int unset)
-{
- if (unset)
- return 0;
-
- ALLOC_GROW(xopts, xopts_nr + 1, xopts_alloc);
- xopts[xopts_nr++] = xstrdup(arg);
- return 0;
-}
-
-static int option_parse_n(const struct option *opt,
- const char *arg, int unset)
-{
- BUG_ON_OPT_ARG(arg);
- show_diffstat = unset;
- return 0;
-}
-
static struct option builtin_merge_options[] = {
- OPT_CALLBACK_F('n', NULL, NULL, NULL,
- N_("do not show a diffstat at the end of the merge"),
- PARSE_OPT_NOARG, option_parse_n),
+ OPT_SET_INT('n', NULL, &show_diffstat,
+ N_("do not show a diffstat at the end of the merge"), 0),
OPT_BOOL(0, "stat", &show_diffstat,
N_("show a diffstat at the end of the merge")),
OPT_BOOL(0, "summary", &show_diffstat, N_("(synonym to --stat)")),
@@ -277,10 +259,10 @@ static struct option builtin_merge_options[] = {
OPT_RERERE_AUTOUPDATE(&allow_rerere_auto),
OPT_BOOL(0, "verify-signatures", &verify_signatures,
N_("verify that the named commit has a valid GPG signature")),
- OPT_CALLBACK('s', "strategy", &use_strategies, N_("strategy"),
+ OPT_CALLBACK('s', "strategy", NULL, N_("strategy"),
N_("merge strategy to use"), option_parse_strategy),
- OPT_CALLBACK('X', "strategy-option", &xopts, N_("option=value"),
- N_("option for selected merge strategy"), option_parse_x),
+ OPT_STRVEC('X', "strategy-option", &xopts, N_("option=value"),
+ N_("option for selected merge strategy")),
OPT_CALLBACK('m', "message", &merge_msg, N_("message"),
N_("merge commit message (for a non-fast-forward merge)"),
option_parse_message),
@@ -313,8 +295,16 @@ static int save_state(struct object_id *stash)
int len;
struct child_process cp = CHILD_PROCESS_INIT;
struct strbuf buffer = STRBUF_INIT;
+ struct lock_file lock_file = LOCK_INIT;
+ int fd;
int rc = -1;
+ fd = repo_hold_locked_index(the_repository, &lock_file, 0);
+ refresh_index(&the_index, REFRESH_QUIET, NULL, NULL, NULL);
+ if (0 <= fd)
+ repo_update_index_if_able(the_repository, &lock_file);
+ rollback_lock_file(&lock_file);
+
strvec_pushl(&cp.args, "stash", "create", NULL);
cp.out = -1;
cp.git_cmd = 1;
@@ -329,7 +319,7 @@ static int save_state(struct object_id *stash)
else if (!len) /* no changes */
goto out;
strbuf_setlen(&buffer, buffer.len-1);
- if (get_oid(buffer.buf, stash))
+ if (repo_get_oid(the_repository, buffer.buf, stash))
die(_("not a valid object: %s"), buffer.buf);
rc = 0;
out:
@@ -337,62 +327,54 @@ out:
return rc;
}
-static void read_empty(const struct object_id *oid, int verbose)
+static void read_empty(const struct object_id *oid)
{
- int i = 0;
- const char *args[7];
-
- args[i++] = "read-tree";
- if (verbose)
- args[i++] = "-v";
- args[i++] = "-m";
- args[i++] = "-u";
- args[i++] = empty_tree_oid_hex();
- args[i++] = oid_to_hex(oid);
- args[i] = NULL;
+ struct child_process cmd = CHILD_PROCESS_INIT;
+
+ strvec_pushl(&cmd.args, "read-tree", "-m", "-u", empty_tree_oid_hex(),
+ oid_to_hex(oid), NULL);
+ cmd.git_cmd = 1;
- if (run_command_v_opt(args, RUN_GIT_CMD))
+ if (run_command(&cmd))
die(_("read-tree failed"));
}
-static void reset_hard(const struct object_id *oid, int verbose)
+static void reset_hard(const struct object_id *oid)
{
- int i = 0;
- const char *args[6];
-
- args[i++] = "read-tree";
- if (verbose)
- args[i++] = "-v";
- args[i++] = "--reset";
- args[i++] = "-u";
- args[i++] = oid_to_hex(oid);
- args[i] = NULL;
+ struct child_process cmd = CHILD_PROCESS_INIT;
- if (run_command_v_opt(args, RUN_GIT_CMD))
+ strvec_pushl(&cmd.args, "read-tree", "-v", "--reset", "-u",
+ oid_to_hex(oid), NULL);
+ cmd.git_cmd = 1;
+
+ if (run_command(&cmd))
die(_("read-tree failed"));
}
static void restore_state(const struct object_id *head,
const struct object_id *stash)
{
- struct strbuf sb = STRBUF_INIT;
- const char *args[] = { "stash", "apply", NULL, NULL };
+ struct child_process cmd = CHILD_PROCESS_INIT;
- if (is_null_oid(stash))
- return;
+ reset_hard(head);
- reset_hard(head, 1);
+ if (is_null_oid(stash))
+ goto refresh_cache;
- args[2] = oid_to_hex(stash);
+ strvec_pushl(&cmd.args, "stash", "apply", "--index", "--quiet", NULL);
+ strvec_push(&cmd.args, oid_to_hex(stash));
/*
* It is OK to ignore error here, for example when there was
* nothing to restore.
*/
- run_command_v_opt(args, RUN_GIT_CMD);
+ cmd.git_cmd = 1;
+ run_command(&cmd);
- strbuf_release(&sb);
- refresh_cache(REFRESH_QUIET);
+refresh_cache:
+ discard_index(&the_index);
+ if (repo_read_index(the_repository) < 0)
+ die(_("could not read index"));
}
/* This is called when no merge was necessary. */
@@ -479,8 +461,7 @@ static void finish(struct commit *head_commit,
if (new_head && show_diffstat) {
struct diff_options opts;
repo_diff_setup(the_repository, &opts);
- opts.stat_width = -1; /* use full terminal width */
- opts.stat_graph_width = -1; /* respect statGraphWidth config */
+ init_diffstat_widths(&opts);
opts.output_format |=
DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT;
opts.detect_rename = DIFF_DETECT_RENAME;
@@ -493,7 +474,8 @@ static void finish(struct commit *head_commit,
/* Run a post-merge hook */
run_hooks_l("post-merge", squash ? "1" : "0", NULL);
- apply_autostash(git_path_merge_autostash(the_repository));
+ if (new_head)
+ apply_autostash_ref(the_repository, "MERGE_AUTOSTASH");
strbuf_release(&reflog_message);
}
@@ -502,7 +484,6 @@ static void merge_name(const char *remote, struct strbuf *msg)
{
struct commit *remote_head;
struct object_id branch_head;
- struct strbuf buf = STRBUF_INIT;
struct strbuf bname = STRBUF_INIT;
struct merge_remote_desc *desc;
const char *ptr;
@@ -517,7 +498,8 @@ static void merge_name(const char *remote, struct strbuf *msg)
if (!remote_head)
die(_("'%s' does not point to a commit"), remote);
- if (dwim_ref(remote, strlen(remote), &branch_head, &found_ref, 0) > 0) {
+ if (repo_dwim_ref(the_repository, remote, strlen(remote), &branch_head,
+ &found_ref, 0) > 0) {
if (starts_with(found_ref, "refs/heads/")) {
strbuf_addf(msg, "%s\t\tbranch '%s' of .\n",
oid_to_hex(&branch_head), remote);
@@ -590,7 +572,6 @@ static void merge_name(const char *remote, struct strbuf *msg)
oid_to_hex(&remote_head->object.oid), remote);
cleanup:
free(found_ref);
- strbuf_release(&buf);
strbuf_release(&bname);
}
@@ -614,7 +595,8 @@ static void parse_branch_merge_options(char *bmo)
free(argv);
}
-static int git_merge_config(const char *k, const char *v, void *cb)
+static int git_merge_config(const char *k, const char *v,
+ const struct config_context *ctx, void *cb)
{
int status;
const char *str;
@@ -659,13 +641,10 @@ static int git_merge_config(const char *k, const char *v, void *cb)
return 0;
}
- status = fmt_merge_msg_config(k, v, cb);
- if (status)
- return status;
- status = git_gpg_config(k, v, NULL);
+ status = fmt_merge_msg_config(k, v, ctx, cb);
if (status)
return status;
- return git_diff_ui_config(k, v, cb);
+ return git_diff_ui_config(k, v, ctx, cb);
}
static int read_tree_trivial(struct object_id *common, struct object_id *head,
@@ -695,10 +674,11 @@ static int read_tree_trivial(struct object_id *common, struct object_id *head,
if (!trees[nr_trees++])
return -1;
opts.fn = threeway_merge;
- cache_tree_free(&active_cache_tree);
+ cache_tree_free(&the_index.cache_tree);
for (i = 0; i < nr_trees; i++) {
parse_tree(trees[i]);
- init_tree_desc(t+i, trees[i]->buffer, trees[i]->size);
+ init_tree_desc(t+i, &trees[i]->object.oid,
+ trees[i]->buffer, trees[i]->size);
}
if (unpack_trees(nr_trees, t, &opts))
return -1;
@@ -707,7 +687,7 @@ static int read_tree_trivial(struct object_id *common, struct object_id *head,
static void write_tree_trivial(struct object_id *oid)
{
- if (write_cache_as_tree(oid, 0, NULL))
+ if (write_index_as_tree(oid, &the_index, get_index_file(), 0, NULL))
die(_("git write-tree failed to write a tree"));
}
@@ -717,7 +697,9 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
{
const char *head_arg = "HEAD";
- if (refresh_and_write_cache(REFRESH_QUIET, SKIP_IF_UNCHANGED, 0) < 0)
+ if (repo_refresh_and_write_index(the_repository, REFRESH_QUIET,
+ SKIP_IF_UNCHANGED, 0, NULL, NULL,
+ NULL) < 0)
return error(_("Unable to write index."));
if (!strcmp(strategy, "recursive") || !strcmp(strategy, "subtree") ||
@@ -741,9 +723,9 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
o.show_rename_progress =
show_progress == -1 ? isatty(2) : show_progress;
- for (x = 0; x < xopts_nr; x++)
- if (parse_merge_opt(&o, xopts[x]))
- die(_("unknown strategy option: -X%s"), xopts[x]);
+ for (x = 0; x < xopts.nr; x++)
+ if (parse_merge_opt(&o, xopts.v[x]))
+ die(_("unknown strategy option: -X%s"), xopts.v[x]);
o.branch1 = head_arg;
o.branch2 = merge_remote_util(remoteheads->item)->name;
@@ -751,28 +733,31 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
for (j = common; j; j = j->next)
commit_list_insert(j->item, &reversed);
- hold_locked_index(&lock, LOCK_DIE_ON_ERROR);
+ repo_hold_locked_index(the_repository, &lock,
+ LOCK_DIE_ON_ERROR);
if (!strcmp(strategy, "ort"))
clean = merge_ort_recursive(&o, head, remoteheads->item,
reversed, &result);
else
clean = merge_recursive(&o, head, remoteheads->item,
reversed, &result);
- if (clean < 0)
- exit(128);
+ if (clean < 0) {
+ rollback_lock_file(&lock);
+ return 2;
+ }
if (write_locked_index(&the_index, &lock,
COMMIT_LOCK | SKIP_IF_UNCHANGED))
die(_("unable to write %s"), get_index_file());
return clean ? 0 : 1;
} else {
return try_merge_command(the_repository,
- strategy, xopts_nr, xopts,
+ strategy, xopts.nr, xopts.v,
common, head_arg, remoteheads);
}
}
static void count_diff_files(struct diff_queue_struct *q,
- struct diff_options *opt, void *data)
+ struct diff_options *opt UNUSED, void *data)
{
int *count = data;
@@ -783,8 +768,8 @@ static int count_unmerged_entries(void)
{
int i, ret = 0;
- for (i = 0; i < active_nr; i++)
- if (ce_stage(active_cache[i]))
+ for (i = 0; i < the_index.cache_nr; i++)
+ if (ce_stage(the_index.cache[i]))
ret++;
return ret;
@@ -837,7 +822,7 @@ static const char scissors_editor_comment[] =
N_("An empty message aborts the commit.\n");
static const char no_scissors_editor_comment[] =
-N_("Lines starting with '%c' will be ignored, and an empty message aborts\n"
+N_("Lines starting with '%s' will be ignored, and an empty message aborts\n"
"the commit.\n");
static void write_merge_heads(struct commit_list *);
@@ -858,9 +843,9 @@ static void prepare_to_commit(struct commit_list *remoteheads)
* the editor and after we invoke run_status above.
*/
if (invoked_hook)
- discard_cache();
+ discard_index(&the_index);
}
- read_cache_from(index_file);
+ read_index_from(&the_index, index_file, get_git_dir());
strbuf_addbuf(&msg, &merge_msg);
if (squash)
BUG("the control must not reach here under --squash");
@@ -868,17 +853,19 @@ static void prepare_to_commit(struct commit_list *remoteheads)
strbuf_addch(&msg, '\n');
if (cleanup_mode == COMMIT_MSG_CLEANUP_SCISSORS) {
wt_status_append_cut_line(&msg);
- strbuf_commented_addf(&msg, "\n");
+ strbuf_commented_addf(&msg, comment_line_str, "\n");
}
- strbuf_commented_addf(&msg, _(merge_editor_comment));
+ strbuf_commented_addf(&msg, comment_line_str,
+ _(merge_editor_comment));
if (cleanup_mode == COMMIT_MSG_CLEANUP_SCISSORS)
- strbuf_commented_addf(&msg, _(scissors_editor_comment));
+ strbuf_commented_addf(&msg, comment_line_str,
+ _(scissors_editor_comment));
else
- strbuf_commented_addf(&msg,
- _(no_scissors_editor_comment), comment_line_char);
+ strbuf_commented_addf(&msg, comment_line_str,
+ _(no_scissors_editor_comment), comment_line_str);
}
if (signoff)
- append_signoff(&msg, ignore_non_trailer(msg.buf, msg.len), 0);
+ append_signoff(&msg, ignored_log_message_bytes(msg.buf, msg.len), 0);
write_merge_heads(remoteheads);
write_file_buf(git_path_merge_msg(the_repository), msg.buf, msg.len);
if (run_commit_hook(0 < option_edit, get_index_file(), NULL,
@@ -909,7 +896,9 @@ static int merge_trivial(struct commit *head, struct commit_list *remoteheads)
struct object_id result_tree, result_commit;
struct commit_list *parents, **pptr = &parents;
- if (refresh_and_write_cache(REFRESH_QUIET, SKIP_IF_UNCHANGED, 0) < 0)
+ if (repo_refresh_and_write_index(the_repository, REFRESH_QUIET,
+ SKIP_IF_UNCHANGED, 0, NULL, NULL,
+ NULL) < 0)
return error(_("Unable to write index."));
write_tree_trivial(&result_tree);
@@ -1326,7 +1315,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
if (abort_current_merge) {
int nargc = 2;
const char *nargv[] = {"reset", "--merge", NULL};
- struct strbuf stash_oid = STRBUF_INIT;
+ char stash_oid_hex[GIT_MAX_HEXSZ + 1];
+ struct object_id stash_oid = {0};
if (orig_argc != 2)
usage_msg_opt(_("--abort expects no arguments"),
@@ -1335,17 +1325,17 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
if (!file_exists(git_path_merge_head(the_repository)))
die(_("There is no merge to abort (MERGE_HEAD missing)."));
- if (read_oneliner(&stash_oid, git_path_merge_autostash(the_repository),
- READ_ONELINER_SKIP_IF_EMPTY))
- unlink(git_path_merge_autostash(the_repository));
+ if (!read_ref("MERGE_AUTOSTASH", &stash_oid))
+ delete_ref("", "MERGE_AUTOSTASH", &stash_oid, REF_NO_DEREF);
/* Invoke 'git reset --merge' */
ret = cmd_reset(nargc, nargv, prefix);
- if (stash_oid.len)
- apply_autostash_oid(stash_oid.buf);
+ if (!is_null_oid(&stash_oid)) {
+ oid_to_hex_r(stash_oid_hex, &stash_oid);
+ apply_autostash_oid(stash_oid_hex);
+ }
- strbuf_release(&stash_oid);
goto done;
}
@@ -1375,7 +1365,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
goto done;
}
- if (read_cache_unmerged())
+ if (repo_read_index_unmerged(the_repository))
die_resolve_conflict("merge");
if (file_exists(git_path_merge_head(the_repository))) {
@@ -1396,7 +1386,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
else
die(_("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists)."));
}
- resolve_undo_clear();
+ resolve_undo_clear_index(&the_index);
if (option_edit < 0)
option_edit = default_edit_option();
@@ -1459,7 +1449,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
check_trust_level);
remote_head_oid = &remoteheads->item->object.oid;
- read_empty(remote_head_oid, 0);
+ read_empty(remote_head_oid);
update_ref("initial pull", "HEAD", remote_head_oid, NULL, 0,
UPDATE_REFS_DIE_ON_ERR);
goto done;
@@ -1524,12 +1514,20 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
if (!remoteheads)
; /* already up-to-date */
- else if (!remoteheads->next)
- common = get_merge_bases(head_commit, remoteheads->item);
- else {
+ else if (!remoteheads->next) {
+ if (repo_get_merge_bases(the_repository, head_commit,
+ remoteheads->item, &common) < 0) {
+ ret = 2;
+ goto done;
+ }
+ } else {
struct commit_list *list = remoteheads;
commit_list_insert(head_commit, &list);
- common = get_octopus_merge_bases(list);
+ if (get_octopus_merge_bases(list, &common) < 0) {
+ free(list);
+ ret = 2;
+ goto done;
+ }
free(list);
}
@@ -1554,20 +1552,18 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
!common->next &&
oideq(&common->item->object.oid, &head_commit->object.oid)) {
/* Again the most common case of merging one remote. */
- struct strbuf msg = STRBUF_INIT;
+ const char *msg = have_message ?
+ "Fast-forward (no commit created; -m option ignored)" :
+ "Fast-forward";
struct commit *commit;
if (verbosity >= 0) {
printf(_("Updating %s..%s\n"),
- find_unique_abbrev(&head_commit->object.oid,
- DEFAULT_ABBREV),
- find_unique_abbrev(&remoteheads->item->object.oid,
- DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, &head_commit->object.oid,
+ DEFAULT_ABBREV),
+ repo_find_unique_abbrev(the_repository, &remoteheads->item->object.oid,
+ DEFAULT_ABBREV));
}
- strbuf_addstr(&msg, "Fast-forward");
- if (have_message)
- strbuf_addstr(&msg,
- " (no commit created; -m option ignored)");
commit = remoteheads->item;
if (!commit) {
ret = 1;
@@ -1575,20 +1571,18 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
}
if (autostash)
- create_autostash(the_repository,
- git_path_merge_autostash(the_repository));
+ create_autostash_ref(the_repository, "MERGE_AUTOSTASH");
if (checkout_fast_forward(the_repository,
&head_commit->object.oid,
&commit->object.oid,
overwrite_ignore)) {
- apply_autostash(git_path_merge_autostash(the_repository));
+ apply_autostash_ref(the_repository, "MERGE_AUTOSTASH");
ret = 1;
goto done;
}
- finish(head_commit, remoteheads, &commit->object.oid, msg.buf);
+ finish(head_commit, remoteheads, &commit->object.oid, msg);
remove_merge_branch_state(the_repository);
- strbuf_release(&msg);
goto done;
} else if (!remoteheads->next && common->next)
;
@@ -1601,8 +1595,25 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
* We are not doing octopus, not fast-forward, and have
* only one common.
*/
- refresh_cache(REFRESH_QUIET);
+ refresh_index(&the_index, REFRESH_QUIET, NULL, NULL, NULL);
if (allow_trivial && fast_forward != FF_ONLY) {
+ /*
+ * Must first ensure that index matches HEAD before
+ * attempting a trivial merge.
+ */
+ struct tree *head_tree = repo_get_commit_tree(the_repository,
+ head_commit);
+ struct strbuf sb = STRBUF_INIT;
+
+ if (repo_index_has_changes(the_repository, head_tree,
+ &sb)) {
+ error(_("Your local changes to the following files would be overwritten by merge:\n %s"),
+ sb.buf);
+ strbuf_release(&sb);
+ ret = 2;
+ goto done;
+ }
+
/* See if it is really trivial. */
git_committer_info(IDENT_STRICT);
printf(_("Trying really trivial in-index merge...\n"));
@@ -1623,15 +1634,21 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
struct commit_list *j;
for (j = remoteheads; j; j = j->next) {
- struct commit_list *common_one;
+ struct commit_list *common_one = NULL;
+ struct commit *common_item;
/*
* Here we *have* to calculate the individual
* merge_bases again, otherwise "git merge HEAD^
* HEAD^^" would be missed.
*/
- common_one = get_merge_bases(head_commit, j->item);
- if (!oideq(&common_one->item->object.oid, &j->item->object.oid)) {
+ if (repo_get_merge_bases(the_repository, head_commit,
+ j->item, &common_one) < 0)
+ exit(128);
+
+ common_item = common_one->item;
+ free_commit_list(common_one);
+ if (!oideq(&common_item->object.oid, &j->item->object.oid)) {
up_to_date = 0;
break;
}
@@ -1646,8 +1663,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
die_ff_impossible();
if (autostash)
- create_autostash(the_repository,
- git_path_merge_autostash(the_repository));
+ create_autostash_ref(the_repository, "MERGE_AUTOSTASH");
/* We are going to make a new commit. */
git_committer_info(IDENT_STRICT);
@@ -1659,15 +1675,15 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
* tree in the index -- this means that the index must be in
* sync with the head commit. The strategies are responsible
* to ensure this.
+ *
+ * Stash away the local changes so that we can try more than one
+ * and/or recover from merge strategies bailing while leaving the
+ * index and working tree polluted.
*/
- if (use_strategies_nr == 1 ||
- /*
- * Stash away the local changes so that we can try more than one.
- */
- save_state(&stash))
+ if (save_state(&stash))
oidclr(&stash);
- for (i = 0; !merge_was_ok && i < use_strategies_nr; i++) {
+ for (i = 0; i < use_strategies_nr; i++) {
int ret, cnt;
if (i) {
printf(_("Rewinding the tree to pristine...\n"));
@@ -1682,7 +1698,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
*/
wt_strategy = use_strategies[i]->name;
- ret = try_merge_strategy(use_strategies[i]->name,
+ ret = try_merge_strategy(wt_strategy,
common, remoteheads,
head_commit);
/*
@@ -1692,16 +1708,17 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
*/
if (ret < 2) {
if (!ret) {
- if (option_commit) {
- /* Automerge succeeded. */
- automerge_was_ok = 1;
- break;
- }
+ /*
+ * This strategy worked; no point in trying
+ * another.
+ */
merge_was_ok = 1;
+ best_strategy = wt_strategy;
+ break;
}
cnt = (use_strategies_nr > 1) ? evaluate_result() : 0;
if (best_cnt <= 0 || cnt <= best_cnt) {
- best_strategy = use_strategies[i]->name;
+ best_strategy = wt_strategy;
best_cnt = cnt;
}
}
@@ -1711,7 +1728,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
* If we have a resulting tree, that means the strategy module
* auto resolved the merge cleanly.
*/
- if (automerge_was_ok) {
+ if (merge_was_ok && option_commit) {
+ automerge_was_ok = 1;
ret = finish_automerge(head_commit, head_subsumed,
common, remoteheads,
&result_tree, wt_strategy);
@@ -1730,7 +1748,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
else
fprintf(stderr, _("Merge with strategy %s failed.\n"),
use_strategies[0]->name);
- apply_autostash(git_path_merge_autostash(the_repository));
+ apply_autostash_ref(the_repository, "MERGE_AUTOSTASH");
ret = 2;
goto done;
} else if (best_strategy == wt_strategy)
@@ -1756,6 +1774,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
"stopped before committing as requested\n"));
else
ret = suggest_conflicts();
+ if (autostash)
+ printf(_("When finished, apply stashed changes with `git stash pop`\n"));
done:
if (!automerge_was_ok) {
@@ -1764,5 +1784,6 @@ done:
}
strbuf_release(&buf);
free(branch_to_free);
+ discard_index(&the_index);
return ret;
}
diff --git a/builtin/mktag.c b/builtin/mktag.c
index 5d22909..4767f1a 100644
--- a/builtin/mktag.c
+++ b/builtin/mktag.c
@@ -1,8 +1,11 @@
#include "builtin.h"
+#include "gettext.h"
+#include "hex.h"
#include "parse-options.h"
-#include "tag.h"
+#include "strbuf.h"
#include "replace-object.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
#include "fsck.h"
#include "config.h"
@@ -14,11 +17,11 @@ static int option_strict = 1;
static struct fsck_options fsck_options = FSCK_OPTIONS_STRICT;
-static int mktag_fsck_error_func(struct fsck_options *o,
- const struct object_id *oid,
- enum object_type object_type,
+static int mktag_fsck_error_func(struct fsck_options *o UNUSED,
+ const struct object_id *oid UNUSED,
+ enum object_type object_type UNUSED,
enum fsck_msg_type msg_type,
- enum fsck_msg_id msg_id,
+ enum fsck_msg_id msg_id UNUSED,
const char *message)
{
switch (msg_type) {
@@ -51,7 +54,8 @@ static int verify_object_in_tag(struct object_id *tagged_oid, int *tagged_type)
void *buffer;
const struct object_id *repl;
- buffer = read_object_file(tagged_oid, &type, &size);
+ buffer = repo_read_object_file(the_repository, tagged_oid, &type,
+ &size);
if (!buffer)
die(_("could not read tagged object '%s'"),
oid_to_hex(tagged_oid));
@@ -80,7 +84,7 @@ int cmd_mktag(int argc, const char **argv, const char *prefix)
int tagged_type;
struct object_id result;
- argc = parse_options(argc, argv, NULL,
+ argc = parse_options(argc, argv, prefix,
builtin_mktag_options,
builtin_mktag_usage, 0);
diff --git a/builtin/mktree.c b/builtin/mktree.c
index 06d8140..9a22d4e 100644
--- a/builtin/mktree.c
+++ b/builtin/mktree.c
@@ -4,10 +4,13 @@
* Copyright (c) Junio C Hamano, 2006, 2009
*/
#include "builtin.h"
+#include "gettext.h"
+#include "hex.h"
#include "quote.h"
+#include "strbuf.h"
#include "tree.h"
#include "parse-options.h"
-#include "object-store.h"
+#include "object-store-ll.h"
static struct treeent {
unsigned mode;
diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c
index 5edbb7f..a72aebe 100644
--- a/builtin/multi-pack-index.c
+++ b/builtin/multi-pack-index.c
@@ -1,10 +1,13 @@
#include "builtin.h"
-#include "cache.h"
+#include "abspath.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "parse-options.h"
#include "midx.h"
+#include "strbuf.h"
#include "trace2.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#define BUILTIN_MIDX_WRITE_USAGE \
N_("git multi-pack-index [<options>] write [--preferred-pack=<pack>]" \
@@ -56,11 +59,12 @@ static struct opts_multi_pack_index {
static int parse_object_dir(const struct option *opt, const char *arg,
int unset)
{
- free(opts.object_dir);
+ char **value = opt->value;
+ free(*value);
if (unset)
- opts.object_dir = xstrdup(get_object_directory());
+ *value = xstrdup(get_object_directory());
else
- opts.object_dir = real_pathdup(arg, 1);
+ *value = real_pathdup(arg, 1);
return 0;
}
@@ -78,7 +82,8 @@ static struct option *add_common_options(struct option *prev)
}
static int git_multi_pack_index_write_config(const char *var, const char *value,
- void *cb)
+ const struct config_context *ctx UNUSED,
+ void *cb UNUSED)
{
if (!strcmp(var, "pack.writebitmaphashcache")) {
if (git_config_bool(var, value))
@@ -87,6 +92,13 @@ static int git_multi_pack_index_write_config(const char *var, const char *value,
opts.flags &= ~MIDX_WRITE_BITMAP_HASH_CACHE;
}
+ if (!strcmp(var, "pack.writebitmaplookuptable")) {
+ if (git_config_bool(var, value))
+ opts.flags |= MIDX_WRITE_BITMAP_LOOKUP_TABLE;
+ else
+ opts.flags &= ~MIDX_WRITE_BITMAP_LOOKUP_TABLE;
+ }
+
/*
* We should never make a fall-back call to 'git_default_config', since
* this was already called in 'cmd_multi_pack_index()'.
@@ -104,7 +116,8 @@ static void read_packs_from_stdin(struct string_list *to)
strbuf_release(&buf);
}
-static int cmd_multi_pack_index_write(int argc, const char **argv)
+static int cmd_multi_pack_index_write(int argc, const char **argv,
+ const char *prefix)
{
struct option *options;
static struct option builtin_multi_pack_index_write_options[] = {
@@ -132,9 +145,9 @@ static int cmd_multi_pack_index_write(int argc, const char **argv)
if (isatty(2))
opts.flags |= MIDX_PROGRESS;
- argc = parse_options(argc, argv, NULL,
+ argc = parse_options(argc, argv, prefix,
options, builtin_multi_pack_index_write_usage,
- PARSE_OPT_KEEP_UNKNOWN);
+ 0);
if (argc)
usage_with_options(builtin_multi_pack_index_write_usage,
options);
@@ -160,7 +173,8 @@ static int cmd_multi_pack_index_write(int argc, const char **argv)
opts.refs_snapshot, opts.flags);
}
-static int cmd_multi_pack_index_verify(int argc, const char **argv)
+static int cmd_multi_pack_index_verify(int argc, const char **argv,
+ const char *prefix)
{
struct option *options;
static struct option builtin_multi_pack_index_verify_options[] = {
@@ -174,9 +188,9 @@ static int cmd_multi_pack_index_verify(int argc, const char **argv)
if (isatty(2))
opts.flags |= MIDX_PROGRESS;
- argc = parse_options(argc, argv, NULL,
+ argc = parse_options(argc, argv, prefix,
options, builtin_multi_pack_index_verify_usage,
- PARSE_OPT_KEEP_UNKNOWN);
+ 0);
if (argc)
usage_with_options(builtin_multi_pack_index_verify_usage,
options);
@@ -186,7 +200,8 @@ static int cmd_multi_pack_index_verify(int argc, const char **argv)
return verify_midx_file(the_repository, opts.object_dir, opts.flags);
}
-static int cmd_multi_pack_index_expire(int argc, const char **argv)
+static int cmd_multi_pack_index_expire(int argc, const char **argv,
+ const char *prefix)
{
struct option *options;
static struct option builtin_multi_pack_index_expire_options[] = {
@@ -200,9 +215,9 @@ static int cmd_multi_pack_index_expire(int argc, const char **argv)
if (isatty(2))
opts.flags |= MIDX_PROGRESS;
- argc = parse_options(argc, argv, NULL,
+ argc = parse_options(argc, argv, prefix,
options, builtin_multi_pack_index_expire_usage,
- PARSE_OPT_KEEP_UNKNOWN);
+ 0);
if (argc)
usage_with_options(builtin_multi_pack_index_expire_usage,
options);
@@ -212,7 +227,8 @@ static int cmd_multi_pack_index_expire(int argc, const char **argv)
return expire_midx_packs(the_repository, opts.object_dir, opts.flags);
}
-static int cmd_multi_pack_index_repack(int argc, const char **argv)
+static int cmd_multi_pack_index_repack(int argc, const char **argv,
+ const char *prefix)
{
struct option *options;
static struct option builtin_multi_pack_index_repack_options[] = {
@@ -229,10 +245,10 @@ static int cmd_multi_pack_index_repack(int argc, const char **argv)
if (isatty(2))
opts.flags |= MIDX_PROGRESS;
- argc = parse_options(argc, argv, NULL,
+ argc = parse_options(argc, argv, prefix,
options,
builtin_multi_pack_index_repack_usage,
- PARSE_OPT_KEEP_UNKNOWN);
+ 0);
if (argc)
usage_with_options(builtin_multi_pack_index_repack_usage,
options);
@@ -247,7 +263,15 @@ int cmd_multi_pack_index(int argc, const char **argv,
const char *prefix)
{
int res;
- struct option *builtin_multi_pack_index_options = common_opts;
+ parse_opt_subcommand_fn *fn = NULL;
+ struct option builtin_multi_pack_index_options[] = {
+ OPT_SUBCOMMAND("repack", &fn, cmd_multi_pack_index_repack),
+ OPT_SUBCOMMAND("write", &fn, cmd_multi_pack_index_write),
+ OPT_SUBCOMMAND("verify", &fn, cmd_multi_pack_index_verify),
+ OPT_SUBCOMMAND("expire", &fn, cmd_multi_pack_index_expire),
+ OPT_END(),
+ };
+ struct option *options = parse_options_concat(builtin_multi_pack_index_options, common_opts);
git_config(git_default_config, NULL);
@@ -256,31 +280,12 @@ int cmd_multi_pack_index(int argc, const char **argv,
the_repository->objects->odb)
opts.object_dir = xstrdup(the_repository->objects->odb->path);
- argc = parse_options(argc, argv, prefix,
- builtin_multi_pack_index_options,
- builtin_multi_pack_index_usage,
- PARSE_OPT_STOP_AT_NON_OPTION);
-
- if (!argc)
- goto usage;
-
- if (!strcmp(argv[0], "repack"))
- res = cmd_multi_pack_index_repack(argc, argv);
- else if (!strcmp(argv[0], "write"))
- res = cmd_multi_pack_index_write(argc, argv);
- else if (!strcmp(argv[0], "verify"))
- res = cmd_multi_pack_index_verify(argc, argv);
- else if (!strcmp(argv[0], "expire"))
- res = cmd_multi_pack_index_expire(argc, argv);
- else {
- error(_("unrecognized subcommand: %s"), argv[0]);
- goto usage;
- }
+ argc = parse_options(argc, argv, prefix, options,
+ builtin_multi_pack_index_usage, 0);
+ FREE_AND_NULL(options);
+
+ res = fn(argc, argv, prefix);
free(opts.object_dir);
return res;
-
-usage:
- usage_with_options(builtin_multi_pack_index_usage,
- builtin_multi_pack_index_options);
}
diff --git a/builtin/mv.c b/builtin/mv.c
index 83a465b..22e64fc 100644
--- a/builtin/mv.c
+++ b/builtin/mv.c
@@ -3,22 +3,38 @@
*
* Copyright (C) 2006 Johannes Schindelin
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
+#include "advice.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "name-hash.h"
+#include "object-file.h"
#include "pathspec.h"
#include "lockfile.h"
#include "dir.h"
-#include "cache-tree.h"
#include "string-list.h"
#include "parse-options.h"
+#include "read-cache-ll.h"
+#include "repository.h"
+#include "setup.h"
#include "submodule.h"
+#include "entry.h"
static const char * const builtin_mv_usage[] = {
N_("git mv [<options>] <source>... <destination>"),
NULL
};
+enum update_mode {
+ WORKING_DIRECTORY = (1 << 1),
+ INDEX = (1 << 2),
+ SPARSE = (1 << 3),
+ SKIP_WORKTREE_DIR = (1 << 4),
+};
+
#define DUP_BASENAME 1
#define KEEP_TRAILING_SLASH 2
@@ -63,7 +79,7 @@ static const char **internal_prefix_pathspec(const char *prefix,
static const char *add_slash(const char *path)
{
size_t len = strlen(path);
- if (path[len - 1] != '/') {
+ if (len && path[len - 1] != '/') {
char *with_slash = xmalloc(st_add(len, 2));
memcpy(with_slash, path, len);
with_slash[len++] = '/';
@@ -79,7 +95,7 @@ static void prepare_move_submodule(const char *src, int first,
const char **submodule_gitfile)
{
struct strbuf submodule_dotgit = STRBUF_INIT;
- if (!S_ISGITLINK(active_cache[first]->ce_mode))
+ if (!S_ISGITLINK(the_index.cache[first]->ce_mode))
die(_("Directory %s is in index and no submodule?"), src);
if (!is_staging_gitmodules_ok(&the_index))
die(_("Please stage your changes to .gitmodules or stash them to proceed"));
@@ -98,13 +114,13 @@ static int index_range_of_same_dir(const char *src, int length,
const char *src_w_slash = add_slash(src);
int first, last, len_w_slash = length + 1;
- first = cache_name_pos(src_w_slash, len_w_slash);
+ first = index_name_pos(&the_index, src_w_slash, len_w_slash);
if (first >= 0)
die(_("%.*s is in index"), len_w_slash, src_w_slash);
first = -1 - first;
- for (last = first; last < active_nr; last++) {
- const char *path = active_cache[last]->name;
+ for (last = first; last < the_index.cache_nr; last++) {
+ const char *path = the_index.cache[last]->name;
if (strncmp(path, src_w_slash, len_w_slash))
break;
}
@@ -115,6 +131,39 @@ static int index_range_of_same_dir(const char *src, int length,
return last - first;
}
+/*
+ * Given the path of a directory that does not exist on-disk, check whether the
+ * directory contains any entries in the index with the SKIP_WORKTREE flag
+ * enabled.
+ * Return 1 if such index entries exist.
+ * Return 0 otherwise.
+ */
+static int empty_dir_has_sparse_contents(const char *name)
+{
+ int ret = 0;
+ const char *with_slash = add_slash(name);
+ int length = strlen(with_slash);
+
+ int pos = index_name_pos(&the_index, with_slash, length);
+ const struct cache_entry *ce;
+
+ if (pos < 0) {
+ pos = -pos - 1;
+ if (pos >= the_index.cache_nr)
+ goto free_return;
+ ce = the_index.cache[pos];
+ if (strncmp(with_slash, ce->name, length))
+ goto free_return;
+ if (ce_skip_worktree(ce))
+ ret = 1;
+ }
+
+free_return:
+ if (with_slash != name)
+ free((char *)with_slash);
+ return ret;
+}
+
int cmd_mv(int argc, const char **argv, const char *prefix)
{
int i, flags, gitmodules_modified = 0;
@@ -129,12 +178,17 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
OPT_END(),
};
const char **source, **destination, **dest_path, **submodule_gitfile;
- enum update_mode { BOTH = 0, WORKING_DIRECTORY, INDEX, SPARSE } *modes;
- struct stat st;
+ const char *dst_w_slash;
+ const char **src_dir = NULL;
+ int src_dir_nr = 0, src_dir_alloc = 0;
+ struct strbuf a_src_dir = STRBUF_INIT;
+ enum update_mode *modes, dst_mode = 0;
+ struct stat st, dest_st;
struct string_list src_for_dst = STRING_LIST_INIT_NODUP;
struct lock_file lock_file = LOCK_INIT;
struct cache_entry *ce;
struct string_list only_match_skip_worktree = STRING_LIST_INIT_NODUP;
+ struct string_list dirty_paths = STRING_LIST_INIT_NODUP;
git_config(git_default_config, NULL);
@@ -143,12 +197,13 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
if (--argc < 1)
usage_with_options(builtin_mv_usage, builtin_mv_options);
- hold_locked_index(&lock_file, LOCK_DIE_ON_ERROR);
- if (read_cache() < 0)
+ repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
+ if (repo_read_index(the_repository) < 0)
die(_("index file corrupt"));
source = internal_prefix_pathspec(prefix, argv, argc, 0);
- modes = xcalloc(argc, sizeof(enum update_mode));
+ CALLOC_ARRAY(modes, argc);
+
/*
* Keep trailing slash, needed to let
* "git mv file no-such-dir/" error out, except in the case
@@ -158,6 +213,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
if (argc == 1 && is_directory(argv[0]) && !is_directory(argv[1]))
flags = 0;
dest_path = internal_prefix_pathspec(prefix, argv + argc, 1, flags);
+ dst_w_slash = add_slash(dest_path[0]);
submodule_gitfile = xcalloc(argc, sizeof(char *));
if (dest_path[0][0] == '\0')
@@ -165,18 +221,37 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
destination = internal_prefix_pathspec(dest_path[0], argv, argc, DUP_BASENAME);
else if (!lstat(dest_path[0], &st) &&
S_ISDIR(st.st_mode)) {
- dest_path[0] = add_slash(dest_path[0]);
- destination = internal_prefix_pathspec(dest_path[0], argv, argc, DUP_BASENAME);
+ destination = internal_prefix_pathspec(dst_w_slash, argv, argc, DUP_BASENAME);
} else {
- if (argc != 1)
+ if (!path_in_sparse_checkout(dst_w_slash, &the_index) &&
+ empty_dir_has_sparse_contents(dst_w_slash)) {
+ destination = internal_prefix_pathspec(dst_w_slash, argv, argc, DUP_BASENAME);
+ dst_mode = SKIP_WORKTREE_DIR;
+ } else if (argc != 1) {
die(_("destination '%s' is not a directory"), dest_path[0]);
- destination = dest_path;
+ } else {
+ destination = dest_path;
+ /*
+ * <destination> is a file outside of sparse-checkout
+ * cone. Insist on cone mode here for backward
+ * compatibility. We don't want dst_mode to be assigned
+ * for a file when the repo is using no-cone mode (which
+ * is deprecated at this point) sparse-checkout. As
+ * SPARSE here is only considering cone-mode situation.
+ */
+ if (!path_in_cone_mode_sparse_checkout(destination[0], &the_index))
+ dst_mode = SPARSE;
+ }
+ }
+ if (dst_w_slash != dest_path[0]) {
+ free((char *)dst_w_slash);
+ dst_w_slash = NULL;
}
/* Checking */
for (i = 0; i < argc; i++) {
const char *src = source[i], *dst = destination[i];
- int length, src_is_dir;
+ int length;
const char *bad = NULL;
int skip_sparse = 0;
@@ -185,54 +260,107 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
length = strlen(src);
if (lstat(src, &st) < 0) {
- /* only error if existence is expected. */
- if (modes[i] != SPARSE)
+ int pos;
+ const struct cache_entry *ce;
+
+ pos = index_name_pos(&the_index, src, length);
+ if (pos < 0) {
+ const char *src_w_slash = add_slash(src);
+ if (!path_in_sparse_checkout(src_w_slash, &the_index) &&
+ empty_dir_has_sparse_contents(src)) {
+ modes[i] |= SKIP_WORKTREE_DIR;
+ goto dir_check;
+ }
+ /* only error if existence is expected. */
+ if (!(modes[i] & SPARSE))
+ bad = _("bad source");
+ goto act_on_entry;
+ }
+ ce = the_index.cache[pos];
+ if (!ce_skip_worktree(ce)) {
bad = _("bad source");
- } else if (!strncmp(src, dst, length) &&
- (dst[length] == 0 || dst[length] == '/')) {
+ goto act_on_entry;
+ }
+ if (!ignore_sparse) {
+ string_list_append(&only_match_skip_worktree, src);
+ goto act_on_entry;
+ }
+ /* Check if dst exists in index */
+ if (index_name_pos(&the_index, dst, strlen(dst)) < 0) {
+ modes[i] |= SPARSE;
+ goto act_on_entry;
+ }
+ if (!force) {
+ bad = _("destination exists");
+ goto act_on_entry;
+ }
+ modes[i] |= SPARSE;
+ goto act_on_entry;
+ }
+ if (!strncmp(src, dst, length) &&
+ (dst[length] == 0 || dst[length] == '/')) {
bad = _("can not move directory into itself");
- } else if ((src_is_dir = S_ISDIR(st.st_mode))
- && lstat(dst, &st) == 0)
- bad = _("cannot move directory over file");
- else if (src_is_dir) {
- int first = cache_name_pos(src, length), last;
+ goto act_on_entry;
+ }
+ if (S_ISDIR(st.st_mode)
+ && lstat(dst, &dest_st) == 0) {
+ bad = _("destination already exists");
+ goto act_on_entry;
+ }
- if (first >= 0)
+dir_check:
+ if (S_ISDIR(st.st_mode)) {
+ int j, dst_len, n;
+ int first = index_name_pos(&the_index, src, length), last;
+
+ if (first >= 0) {
prepare_move_submodule(src, first,
submodule_gitfile + i);
- else if (index_range_of_same_dir(src, length,
- &first, &last) < 1)
+ goto act_on_entry;
+ } else if (index_range_of_same_dir(src, length,
+ &first, &last) < 1) {
bad = _("source directory is empty");
- else { /* last - first >= 1 */
- int j, dst_len, n;
-
- modes[i] = WORKING_DIRECTORY;
- n = argc + last - first;
- REALLOC_ARRAY(source, n);
- REALLOC_ARRAY(destination, n);
- REALLOC_ARRAY(modes, n);
- REALLOC_ARRAY(submodule_gitfile, n);
-
- dst = add_slash(dst);
- dst_len = strlen(dst);
-
- for (j = 0; j < last - first; j++) {
- const struct cache_entry *ce = active_cache[first + j];
- const char *path = ce->name;
- source[argc + j] = path;
- destination[argc + j] =
- prefix_path(dst, dst_len, path + length + 1);
- modes[argc + j] = ce_skip_worktree(ce) ? SPARSE : INDEX;
- submodule_gitfile[argc + j] = NULL;
- }
- argc += last - first;
+ goto act_on_entry;
}
- } else if (!(ce = cache_file_exists(src, length, 0))) {
+
+ /* last - first >= 1 */
+ modes[i] |= WORKING_DIRECTORY;
+
+ ALLOC_GROW(src_dir, src_dir_nr + 1, src_dir_alloc);
+ src_dir[src_dir_nr++] = src;
+
+ n = argc + last - first;
+ REALLOC_ARRAY(source, n);
+ REALLOC_ARRAY(destination, n);
+ REALLOC_ARRAY(modes, n);
+ REALLOC_ARRAY(submodule_gitfile, n);
+
+ dst = add_slash(dst);
+ dst_len = strlen(dst);
+
+ for (j = 0; j < last - first; j++) {
+ const struct cache_entry *ce = the_index.cache[first + j];
+ const char *path = ce->name;
+ source[argc + j] = path;
+ destination[argc + j] =
+ prefix_path(dst, dst_len, path + length + 1);
+ memset(modes + argc + j, 0, sizeof(enum update_mode));
+ modes[argc + j] |= ce_skip_worktree(ce) ? SPARSE : INDEX;
+ submodule_gitfile[argc + j] = NULL;
+ }
+ argc += last - first;
+ goto act_on_entry;
+ }
+ if (!(ce = index_file_exists(&the_index, src, length, 0))) {
bad = _("not under version control");
- } else if (ce_stage(ce)) {
+ goto act_on_entry;
+ }
+ if (ce_stage(ce)) {
bad = _("conflicted");
- } else if (lstat(dst, &st) == 0 &&
- (!ignore_case || strcasecmp(src, dst))) {
+ goto act_on_entry;
+ }
+ if (lstat(dst, &st) == 0 &&
+ (!ignore_case || strcasecmp(src, dst))) {
bad = _("destination exists");
if (force) {
/*
@@ -246,34 +374,52 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
} else
bad = _("Cannot overwrite");
}
- } else if (string_list_has_string(&src_for_dst, dst))
+ goto act_on_entry;
+ }
+ if (string_list_has_string(&src_for_dst, dst)) {
bad = _("multiple sources for the same target");
- else if (is_dir_sep(dst[strlen(dst) - 1]))
+ goto act_on_entry;
+ }
+ if (is_dir_sep(dst[strlen(dst) - 1])) {
bad = _("destination directory does not exist");
- else {
- /*
- * We check if the paths are in the sparse-checkout
- * definition as a very final check, since that
- * allows us to point the user to the --sparse
- * option as a way to have a successful run.
- */
- if (!ignore_sparse &&
- !path_in_sparse_checkout(src, &the_index)) {
- string_list_append(&only_match_skip_worktree, src);
- skip_sparse = 1;
- }
- if (!ignore_sparse &&
- !path_in_sparse_checkout(dst, &the_index)) {
- string_list_append(&only_match_skip_worktree, dst);
- skip_sparse = 1;
+ goto act_on_entry;
+ }
+
+ if (ignore_sparse &&
+ (dst_mode & (SKIP_WORKTREE_DIR | SPARSE)) &&
+ index_entry_exists(&the_index, dst, strlen(dst))) {
+ bad = _("destination exists in the index");
+ if (force) {
+ if (verbose)
+ warning(_("overwriting '%s'"), dst);
+ bad = NULL;
+ } else {
+ goto act_on_entry;
}
+ }
+ /*
+ * We check if the paths are in the sparse-checkout
+ * definition as a very final check, since that
+ * allows us to point the user to the --sparse
+ * option as a way to have a successful run.
+ */
+ if (!ignore_sparse &&
+ !path_in_sparse_checkout(src, &the_index)) {
+ string_list_append(&only_match_skip_worktree, src);
+ skip_sparse = 1;
+ }
+ if (!ignore_sparse &&
+ !path_in_sparse_checkout(dst, &the_index)) {
+ string_list_append(&only_match_skip_worktree, dst);
+ skip_sparse = 1;
+ }
- if (skip_sparse)
- goto remove_entry;
+ if (skip_sparse)
+ goto remove_entry;
- string_list_insert(&src_for_dst, dst);
- }
+ string_list_insert(&src_for_dst, dst);
+act_on_entry:
if (!bad)
continue;
if (!ignore_errors)
@@ -282,14 +428,11 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
remove_entry:
if (--argc > 0) {
int n = argc - i;
- memmove(source + i, source + i + 1,
- n * sizeof(char *));
- memmove(destination + i, destination + i + 1,
- n * sizeof(char *));
- memmove(modes + i, modes + i + 1,
- n * sizeof(enum update_mode));
- memmove(submodule_gitfile + i, submodule_gitfile + i + 1,
- n * sizeof(char *));
+ MOVE_ARRAY(source + i, source + i + 1, n);
+ MOVE_ARRAY(destination + i, destination + i + 1, n);
+ MOVE_ARRAY(modes + i, modes + i + 1, n);
+ MOVE_ARRAY(submodule_gitfile + i,
+ submodule_gitfile + i + 1, n);
i--;
}
}
@@ -304,11 +447,19 @@ remove_entry:
const char *src = source[i], *dst = destination[i];
enum update_mode mode = modes[i];
int pos;
+ int sparse_and_dirty = 0;
+ struct checkout state = CHECKOUT_INIT;
+ state.istate = &the_index;
+
+ if (force)
+ state.force = 1;
if (show_only || verbose)
printf(_("Renaming %s to %s\n"), src, dst);
if (show_only)
continue;
- if (mode != INDEX && mode != SPARSE && rename(src, dst) < 0) {
+ if (!(mode & (INDEX | SPARSE | SKIP_WORKTREE_DIR)) &&
+ !(dst_mode & (SKIP_WORKTREE_DIR | SPARSE)) &&
+ rename(src, dst) < 0) {
if (ignore_errors)
continue;
die_errno(_("renaming '%s' failed"), src);
@@ -322,14 +473,91 @@ remove_entry:
1);
}
- if (mode == WORKING_DIRECTORY)
+ if (mode & (WORKING_DIRECTORY | SKIP_WORKTREE_DIR))
continue;
- pos = cache_name_pos(src, strlen(src));
+ pos = index_name_pos(&the_index, src, strlen(src));
assert(pos >= 0);
- rename_cache_entry_at(pos, dst);
+ if (!(mode & SPARSE) && !lstat(src, &st))
+ sparse_and_dirty = ie_modified(&the_index,
+ the_index.cache[pos],
+ &st,
+ 0);
+ rename_index_entry_at(&the_index, pos, dst);
+
+ if (ignore_sparse &&
+ core_apply_sparse_checkout &&
+ core_sparse_checkout_cone) {
+ /*
+ * NEEDSWORK: we are *not* paying attention to
+ * "out-to-out" move (<source> is out-of-cone and
+ * <destination> is out-of-cone) at this point. It
+ * should be added in a future patch.
+ */
+ if ((mode & SPARSE) &&
+ path_in_sparse_checkout(dst, &the_index)) {
+ /* from out-of-cone to in-cone */
+ int dst_pos = index_name_pos(&the_index, dst,
+ strlen(dst));
+ struct cache_entry *dst_ce = the_index.cache[dst_pos];
+
+ dst_ce->ce_flags &= ~CE_SKIP_WORKTREE;
+
+ if (checkout_entry(dst_ce, &state, NULL, NULL))
+ die(_("cannot checkout %s"), dst_ce->name);
+ } else if ((dst_mode & (SKIP_WORKTREE_DIR | SPARSE)) &&
+ !(mode & SPARSE) &&
+ !path_in_sparse_checkout(dst, &the_index)) {
+ /* from in-cone to out-of-cone */
+ int dst_pos = index_name_pos(&the_index, dst,
+ strlen(dst));
+ struct cache_entry *dst_ce = the_index.cache[dst_pos];
+
+ /*
+ * if src is clean, it will suffice to remove it
+ */
+ if (!sparse_and_dirty) {
+ dst_ce->ce_flags |= CE_SKIP_WORKTREE;
+ unlink_or_warn(src);
+ } else {
+ /*
+ * if src is dirty, move it to the
+ * destination and create leading
+ * dirs if necessary
+ */
+ char *dst_dup = xstrdup(dst);
+ string_list_append(&dirty_paths, dst);
+ safe_create_leading_directories(dst_dup);
+ FREE_AND_NULL(dst_dup);
+ rename(src, dst);
+ }
+ }
+ }
}
+ /*
+ * cleanup the empty src_dirs
+ */
+ for (i = 0; i < src_dir_nr; i++) {
+ int dummy;
+ strbuf_addstr(&a_src_dir, src_dir[i]);
+ /*
+ * if entries under a_src_dir are all moved away,
+ * recursively remove a_src_dir to cleanup
+ */
+ if (index_range_of_same_dir(a_src_dir.buf, a_src_dir.len,
+ &dummy, &dummy) < 1) {
+ remove_dir_recursively(&a_src_dir, 0);
+ }
+ strbuf_reset(&a_src_dir);
+ }
+
+ strbuf_release(&a_src_dir);
+ free(src_dir);
+
+ if (dirty_paths.nr)
+ advise_on_moving_dirty_path(&dirty_paths);
+
if (gitmodules_modified)
stage_updated_gitmodules(&the_index);
@@ -338,6 +566,7 @@ remove_entry:
die(_("Unable to write new index file"));
string_list_clear(&src_for_dst, 0);
+ string_list_clear(&dirty_paths, 0);
UNLEAK(source);
UNLEAK(dest_path);
free(submodule_gitfile);
diff --git a/builtin/name-rev.c b/builtin/name-rev.c
index 580b1eb..ad9930c 100644
--- a/builtin/name-rev.c
+++ b/builtin/name-rev.c
@@ -1,15 +1,21 @@
#include "builtin.h"
-#include "cache.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "commit.h"
#include "tag.h"
#include "refs.h"
+#include "object-name.h"
+#include "pager.h"
#include "parse-options.h"
#include "prio-queue.h"
#include "hash-lookup.h"
#include "commit-slab.h"
#include "commit-graph.h"
+#include "wildmatch.h"
+#include "mem-pool.h"
/*
* One day. See the 'name a rev shortly after epoch' test in t6120 when
@@ -108,19 +114,11 @@ static int is_better_name(struct rev_name *name,
int name_distance = effective_distance(name->distance, name->generation);
int new_distance = effective_distance(distance, generation);
- /*
- * When comparing names based on tags, prefer names
- * based on the older tag, even if it is farther away.
- */
+ /* If both are tags, we prefer the nearer one. */
if (from_tag && name->from_tag)
- return (name->taggerdate > taggerdate ||
- (name->taggerdate == taggerdate &&
- name_distance > new_distance));
+ return name_distance > new_distance;
- /*
- * We know that at least one of them is a non-tag at this point.
- * favor a tag over a non-tag.
- */
+ /* Favor a tag over a non-tag. */
if (name->from_tag != from_tag)
return from_tag;
@@ -158,30 +156,25 @@ static struct rev_name *create_or_update_name(struct commit *commit,
return name;
}
-static char *get_parent_name(const struct rev_name *name, int parent_number)
+static char *get_parent_name(const struct rev_name *name, int parent_number,
+ struct mem_pool *string_pool)
{
- struct strbuf sb = STRBUF_INIT;
size_t len;
strip_suffix(name->tip_name, "^0", &len);
if (name->generation > 0) {
- strbuf_grow(&sb, len +
- 1 + decimal_width(name->generation) +
- 1 + decimal_width(parent_number));
- strbuf_addf(&sb, "%.*s~%d^%d", (int)len, name->tip_name,
- name->generation, parent_number);
+ return mem_pool_strfmt(string_pool, "%.*s~%d^%d",
+ (int)len, name->tip_name,
+ name->generation, parent_number);
} else {
- strbuf_grow(&sb, len +
- 1 + decimal_width(parent_number));
- strbuf_addf(&sb, "%.*s^%d", (int)len, name->tip_name,
- parent_number);
+ return mem_pool_strfmt(string_pool, "%.*s^%d",
+ (int)len, name->tip_name, parent_number);
}
- return strbuf_detach(&sb, NULL);
}
static void name_rev(struct commit *start_commit,
const char *tip_name, timestamp_t taggerdate,
- int from_tag, int deref)
+ int from_tag, int deref, struct mem_pool *string_pool)
{
struct prio_queue queue;
struct commit *commit;
@@ -189,7 +182,7 @@ static void name_rev(struct commit *start_commit,
size_t parents_to_queue_nr, parents_to_queue_alloc = 0;
struct rev_name *start_name;
- parse_commit(start_commit);
+ repo_parse_commit(the_repository, start_commit);
if (commit_is_before_cutoff(start_commit))
return;
@@ -198,9 +191,10 @@ static void name_rev(struct commit *start_commit,
if (!start_name)
return;
if (deref)
- start_name->tip_name = xstrfmt("%s^0", tip_name);
+ start_name->tip_name = mem_pool_strfmt(string_pool, "%s^0",
+ tip_name);
else
- start_name->tip_name = xstrdup(tip_name);
+ start_name->tip_name = mem_pool_strdup(string_pool, tip_name);
memset(&queue, 0, sizeof(queue)); /* Use the prio_queue as LIFO */
prio_queue_put(&queue, start_commit);
@@ -219,7 +213,7 @@ static void name_rev(struct commit *start_commit,
struct rev_name *parent_name;
int generation, distance;
- parse_commit(parent);
+ repo_parse_commit(the_repository, parent);
if (commit_is_before_cutoff(parent))
continue;
@@ -238,7 +232,8 @@ static void name_rev(struct commit *start_commit,
if (parent_number > 1)
parent_name->tip_name =
get_parent_name(name,
- parent_number);
+ parent_number,
+ string_pool);
else
parent_name->tip_name = name->tip_name;
ALLOC_GROW(parents_to_queue,
@@ -273,17 +268,6 @@ static int subpath_matches(const char *path, const char *filter)
return -1;
}
-static const char *name_ref_abbrev(const char *refname, int shorten_unambiguous)
-{
- if (shorten_unambiguous)
- refname = shorten_unambiguous_ref(refname, 0);
- else if (skip_prefix(refname, "refs/heads/", &refname))
- ; /* refname already advanced */
- else
- skip_prefix(refname, "refs/", &refname);
- return refname;
-}
-
struct name_ref_data {
int tags_only;
int name_only;
@@ -309,11 +293,19 @@ static void add_to_tip_table(const struct object_id *oid, const char *refname,
int shorten_unambiguous, struct commit *commit,
timestamp_t taggerdate, int from_tag, int deref)
{
- refname = name_ref_abbrev(refname, shorten_unambiguous);
+ char *short_refname = NULL;
+
+ if (shorten_unambiguous)
+ short_refname = shorten_unambiguous_ref(refname, 0);
+ else if (skip_prefix(refname, "refs/heads/", &refname))
+ ; /* refname already advanced */
+ else
+ skip_prefix(refname, "refs/", &refname);
ALLOC_GROW(tip_table.table, tip_table.nr + 1, tip_table.alloc);
oidcpy(&tip_table.table[tip_table.nr].oid, oid);
- tip_table.table[tip_table.nr].refname = xstrdup(refname);
+ tip_table.table[tip_table.nr].refname = short_refname ?
+ short_refname : xstrdup(refname);
tip_table.table[tip_table.nr].commit = commit;
tip_table.table[tip_table.nr].taggerdate = taggerdate;
tip_table.table[tip_table.nr].from_tag = from_tag;
@@ -344,7 +336,8 @@ static int cmp_by_tag_and_age(const void *a_, const void *b_)
return a->taggerdate != b->taggerdate;
}
-static int name_ref(const char *path, const struct object_id *oid, int flags, void *cb_data)
+static int name_ref(const char *path, const struct object_id *oid,
+ int flags UNUSED, void *cb_data)
{
struct object *o = parse_object(the_repository, oid);
struct name_ref_data *data = cb_data;
@@ -420,7 +413,7 @@ static int name_ref(const char *path, const struct object_id *oid, int flags, vo
return 0;
}
-static void name_tips(void)
+static void name_tips(struct mem_pool *string_pool)
{
int i;
@@ -433,7 +426,7 @@ static void name_tips(void)
struct tip_table_entry *e = &tip_table.table[i];
if (e->commit) {
name_rev(e->commit, e->refname, e->taggerdate,
- e->from_tag, e->deref);
+ e->from_tag, e->deref, string_pool);
}
}
}
@@ -503,7 +496,8 @@ static void show_name(const struct object *obj,
else if (allow_undefined)
printf("undefined\n");
else if (always)
- printf("%s\n", find_unique_abbrev(oid, DEFAULT_ABBREV));
+ printf("%s\n",
+ repo_find_unique_abbrev(the_repository, oid, DEFAULT_ABBREV));
else
die("cannot describe '%s'", oid_to_hex(oid));
strbuf_release(&buf);
@@ -537,7 +531,7 @@ static void name_rev_line(char *p, struct name_ref_data *data)
counter = 0;
*(p+1) = 0;
- if (!get_oid(p - (hexsz - 1), &oid)) {
+ if (!repo_get_oid(the_repository, p - (hexsz - 1), &oid)) {
struct object *o =
lookup_object(the_repository, &oid);
if (o)
@@ -565,6 +559,7 @@ static void name_rev_line(char *p, struct name_ref_data *data)
int cmd_name_rev(int argc, const char **argv, const char *prefix)
{
+ struct mem_pool string_pool;
struct object_array revs = OBJECT_ARRAY_INIT;
int all = 0, annotate_stdin = 0, transform_stdin = 0, allow_undefined = 1, always = 0, peel_tag = 0;
struct name_ref_data data = { 0, 0, STRING_LIST_INIT_NODUP, STRING_LIST_INIT_NODUP };
@@ -577,20 +572,21 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
N_("ignore refs matching <pattern>")),
OPT_GROUP(""),
OPT_BOOL(0, "all", &all, N_("list all commits reachable from all refs")),
- OPT_BOOL(0, "stdin", &transform_stdin, N_("deprecated: use --annotate-stdin instead")),
+ OPT_BOOL_F(0,
+ "stdin",
+ &transform_stdin,
+ N_("deprecated: use --annotate-stdin instead"),
+ PARSE_OPT_HIDDEN),
OPT_BOOL(0, "annotate-stdin", &annotate_stdin, N_("annotate text from stdin")),
OPT_BOOL(0, "undefined", &allow_undefined, N_("allow to print `undefined` names (default)")),
OPT_BOOL(0, "always", &always,
N_("show abbreviated commit object as fallback")),
- {
- /* A Hidden OPT_BOOL */
- OPTION_SET_INT, 0, "peel-tag", &peel_tag, NULL,
- N_("dereference tags in the input (internal use)"),
- PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1,
- },
+ OPT_HIDDEN_BOOL(0, "peel-tag", &peel_tag,
+ N_("dereference tags in the input (internal use)")),
OPT_END(),
};
+ mem_pool_init(&string_pool, 0);
init_commit_rev_name(&rev_names);
git_config(git_default_config, NULL);
argc = parse_options(argc, argv, prefix, opts, name_rev_usage, 0);
@@ -614,7 +610,7 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
struct object *object;
struct commit *commit;
- if (get_oid(*argv, &oid)) {
+ if (repo_get_oid(the_repository, *argv, &oid)) {
fprintf(stderr, "Could not get sha1 for %s. Skipping.\n",
*argv);
continue;
@@ -652,7 +648,7 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
adjust_cutoff_timestamp_for_slop();
for_each_ref(name_ref, &data);
- name_tips();
+ name_tips(&string_pool);
if (annotate_stdin) {
struct strbuf sb = STRBUF_INIT;
@@ -680,6 +676,7 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
always, allow_undefined, data.name_only);
}
+ UNLEAK(string_pool);
UNLEAK(revs);
return 0;
}
diff --git a/builtin/notes.c b/builtin/notes.c
index a3d0d15..cb01130 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -7,13 +7,17 @@
* and builtin/tag.c by Kristian Høgsberg and Carlos Rica.
*/
-#include "cache.h"
-#include "config.h"
#include "builtin.h"
+#include "config.h"
+#include "editor.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "notes.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "path.h"
#include "repository.h"
-#include "blob.h"
#include "pretty.h"
#include "refs.h"
#include "exec-cmd.h"
@@ -23,12 +27,14 @@
#include "notes-merge.h"
#include "notes-utils.h"
#include "worktree.h"
+#include "write-or-die.h"
+static const char *separator = "\n";
static const char * const git_notes_usage[] = {
N_("git notes [--ref <notes-ref>] [list [<object>]]"),
- N_("git notes [--ref <notes-ref>] add [-f] [--allow-empty] [-m <msg> | -F <file> | (-c | -C) <object>] [<object>]"),
+ N_("git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c | -C) <object>] [<object>]"),
N_("git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"),
- N_("git notes [--ref <notes-ref>] append [--allow-empty] [-m <msg> | -F <file> | (-c | -C) <object>] [<object>]"),
+ N_("git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c | -C) <object>] [<object>]"),
N_("git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"),
N_("git notes [--ref <notes-ref>] show [<object>]"),
N_("git notes [--ref <notes-ref>] merge [-v | -q] [-s <strategy>] <notes-ref>"),
@@ -96,11 +102,26 @@ static const char * const git_notes_get_ref_usage[] = {
static const char note_template[] =
N_("Write/edit the notes for the following object:");
+enum notes_stripspace {
+ UNSPECIFIED = -1,
+ NO_STRIPSPACE = 0,
+ STRIPSPACE = 1,
+};
+
+struct note_msg {
+ enum notes_stripspace stripspace;
+ struct strbuf buf;
+};
+
struct note_data {
int given;
int use_editor;
+ int stripspace;
char *edit_path;
struct strbuf buf;
+ struct note_msg **messages;
+ size_t msg_nr;
+ size_t msg_alloc;
};
static void free_note_data(struct note_data *d)
@@ -110,11 +131,18 @@ static void free_note_data(struct note_data *d)
free(d->edit_path);
}
strbuf_release(&d->buf);
+
+ while (d->msg_nr--) {
+ strbuf_release(&d->messages[d->msg_nr]->buf);
+ free(d->messages[d->msg_nr]);
+ }
+ free(d->messages);
}
static int list_each_note(const struct object_id *object_oid,
- const struct object_id *note_oid, char *note_path,
- void *cb_data)
+ const struct object_id *note_oid,
+ char *note_path UNUSED,
+ void *cb_data UNUSED)
{
printf("%s %s\n", oid_to_hex(note_oid), oid_to_hex(object_oid));
return 0;
@@ -124,7 +152,7 @@ static void copy_obj_to_fd(int fd, const struct object_id *oid)
{
unsigned long size;
enum object_type type;
- char *buf = read_object_file(oid, &type, &size);
+ char *buf = repo_read_object_file(the_repository, oid, &type, &size);
if (buf) {
if (size)
write_or_die(fd, buf, size);
@@ -151,7 +179,7 @@ static void write_commented_object(int fd, const struct object_id *object)
if (strbuf_read(&buf, show.out, 0) < 0)
die_errno(_("could not read 'show' output"));
- strbuf_add_commented_lines(&cbuf, buf.buf, buf.len);
+ strbuf_add_commented_lines(&cbuf, buf.buf, buf.len, comment_line_str);
write_or_die(fd, cbuf.buf, cbuf.len);
strbuf_release(&cbuf);
@@ -179,9 +207,10 @@ static void prepare_note_data(const struct object_id *object, struct note_data *
copy_obj_to_fd(fd, old_note);
strbuf_addch(&buf, '\n');
- strbuf_add_commented_lines(&buf, "\n", strlen("\n"));
- strbuf_add_commented_lines(&buf, _(note_template), strlen(_(note_template)));
- strbuf_addch(&buf, '\n');
+ strbuf_add_commented_lines(&buf, "\n", strlen("\n"), comment_line_str);
+ strbuf_add_commented_lines(&buf, _(note_template), strlen(_(note_template)),
+ comment_line_str);
+ strbuf_add_commented_lines(&buf, "\n", strlen("\n"), comment_line_str);
write_or_die(fd, buf.buf, buf.len);
write_commented_object(fd, object);
@@ -193,7 +222,8 @@ static void prepare_note_data(const struct object_id *object, struct note_data *
if (launch_editor(d->edit_path, &d->buf, NULL)) {
die(_("please supply the note contents using either -m or -F option"));
}
- strbuf_stripspace(&d->buf, 1);
+ if (d->stripspace)
+ strbuf_stripspace(&d->buf, comment_line_str);
}
}
@@ -209,66 +239,102 @@ static void write_note_data(struct note_data *d, struct object_id *oid)
}
}
+static void append_separator(struct strbuf *message)
+{
+ size_t sep_len = 0;
+
+ if (!separator)
+ return;
+ else if ((sep_len = strlen(separator)) && separator[sep_len - 1] == '\n')
+ strbuf_addstr(message, separator);
+ else
+ strbuf_addf(message, "%s%s", separator, "\n");
+}
+
+static void concat_messages(struct note_data *d)
+{
+ struct strbuf msg = STRBUF_INIT;
+ size_t i;
+
+ for (i = 0; i < d->msg_nr ; i++) {
+ if (d->buf.len)
+ append_separator(&d->buf);
+ strbuf_add(&msg, d->messages[i]->buf.buf, d->messages[i]->buf.len);
+ strbuf_addbuf(&d->buf, &msg);
+ if ((d->stripspace == UNSPECIFIED &&
+ d->messages[i]->stripspace == STRIPSPACE) ||
+ d->stripspace == STRIPSPACE)
+ strbuf_stripspace(&d->buf, NULL);
+ strbuf_reset(&msg);
+ }
+ strbuf_release(&msg);
+}
+
static int parse_msg_arg(const struct option *opt, const char *arg, int unset)
{
struct note_data *d = opt->value;
+ struct note_msg *msg = xmalloc(sizeof(*msg));
BUG_ON_OPT_NEG(unset);
- strbuf_grow(&d->buf, strlen(arg) + 2);
- if (d->buf.len)
- strbuf_addch(&d->buf, '\n');
- strbuf_addstr(&d->buf, arg);
- strbuf_stripspace(&d->buf, 0);
-
- d->given = 1;
+ strbuf_init(&msg->buf, strlen(arg));
+ strbuf_addstr(&msg->buf, arg);
+ ALLOC_GROW_BY(d->messages, d->msg_nr, 1, d->msg_alloc);
+ d->messages[d->msg_nr - 1] = msg;
+ msg->stripspace = STRIPSPACE;
return 0;
}
static int parse_file_arg(const struct option *opt, const char *arg, int unset)
{
struct note_data *d = opt->value;
+ struct note_msg *msg = xmalloc(sizeof(*msg));
BUG_ON_OPT_NEG(unset);
- if (d->buf.len)
- strbuf_addch(&d->buf, '\n');
+ strbuf_init(&msg->buf , 0);
if (!strcmp(arg, "-")) {
- if (strbuf_read(&d->buf, 0, 1024) < 0)
+ if (strbuf_read(&msg->buf, 0, 1024) < 0)
die_errno(_("cannot read '%s'"), arg);
- } else if (strbuf_read_file(&d->buf, arg, 1024) < 0)
+ } else if (strbuf_read_file(&msg->buf, arg, 1024) < 0)
die_errno(_("could not open or read '%s'"), arg);
- strbuf_stripspace(&d->buf, 0);
- d->given = 1;
+ ALLOC_GROW_BY(d->messages, d->msg_nr, 1, d->msg_alloc);
+ d->messages[d->msg_nr - 1] = msg;
+ msg->stripspace = STRIPSPACE;
return 0;
}
static int parse_reuse_arg(const struct option *opt, const char *arg, int unset)
{
struct note_data *d = opt->value;
- char *buf;
+ struct note_msg *msg = xmalloc(sizeof(*msg));
+ char *value;
struct object_id object;
enum object_type type;
unsigned long len;
BUG_ON_OPT_NEG(unset);
- if (d->buf.len)
- strbuf_addch(&d->buf, '\n');
-
- if (get_oid(arg, &object))
+ strbuf_init(&msg->buf, 0);
+ if (repo_get_oid(the_repository, arg, &object))
die(_("failed to resolve '%s' as a valid ref."), arg);
- if (!(buf = read_object_file(&object, &type, &len)))
+ if (!(value = repo_read_object_file(the_repository, &object, &type, &len)))
die(_("failed to read object '%s'."), arg);
if (type != OBJ_BLOB) {
- free(buf);
+ strbuf_release(&msg->buf);
+ free(value);
+ free(msg);
die(_("cannot read note data from non-blob object '%s'."), arg);
}
- strbuf_add(&d->buf, buf, len);
- free(buf);
- d->given = 1;
+ strbuf_add(&msg->buf, value, len);
+ free(value);
+
+ msg->buf.len = len;
+ ALLOC_GROW_BY(d->messages, d->msg_nr, 1, d->msg_alloc);
+ d->messages[d->msg_nr - 1] = msg;
+ msg->stripspace = NO_STRIPSPACE;
return 0;
}
@@ -280,6 +346,16 @@ static int parse_reedit_arg(const struct option *opt, const char *arg, int unset
return parse_reuse_arg(opt, arg, unset);
}
+static int parse_separator_arg(const struct option *opt, const char *arg,
+ int unset)
+{
+ if (unset)
+ *(const char **)opt->value = NULL;
+ else
+ *(const char **)opt->value = arg ? arg : "\n";
+ return 0;
+}
+
static int notes_copy_from_stdin(int force, const char *rewrite_cmd)
{
struct strbuf buf = STRBUF_INIT;
@@ -307,9 +383,9 @@ static int notes_copy_from_stdin(int force, const char *rewrite_cmd)
die(_("malformed input line: '%s'."), buf.buf);
strbuf_rtrim(split[0]);
strbuf_rtrim(split[1]);
- if (get_oid(split[0]->buf, &from_obj))
+ if (repo_get_oid(the_repository, split[0]->buf, &from_obj))
die(_("failed to resolve '%s' as a valid ref."), split[0]->buf);
- if (get_oid(split[1]->buf, &to_obj))
+ if (repo_get_oid(the_repository, split[1]->buf, &to_obj))
die(_("failed to resolve '%s' as a valid ref."), split[1]->buf);
if (rewrite_cmd)
@@ -377,7 +453,7 @@ static int list(int argc, const char **argv, const char *prefix)
t = init_notes_check("list", 0);
if (argc) {
- if (get_oid(argv[0], &object))
+ if (repo_get_oid(the_repository, argv[0], &object))
die(_("failed to resolve '%s' as a valid ref."), argv[0]);
note = get_note(t, &object);
if (note) {
@@ -402,7 +478,8 @@ static int add(int argc, const char **argv, const char *prefix)
struct notes_tree *t;
struct object_id object, new_note;
const struct object_id *note;
- struct note_data d = { 0, 0, NULL, STRBUF_INIT };
+ struct note_data d = { .buf = STRBUF_INIT, .stripspace = UNSPECIFIED };
+
struct option options[] = {
OPT_CALLBACK_F('m', "message", &d, N_("message"),
N_("note contents as a string"), PARSE_OPT_NONEG,
@@ -419,6 +496,12 @@ static int add(int argc, const char **argv, const char *prefix)
OPT_BOOL(0, "allow-empty", &allow_empty,
N_("allow storing empty note")),
OPT__FORCE(&force, N_("replace existing notes"), PARSE_OPT_NOCOMPLETE),
+ OPT_CALLBACK_F(0, "separator", &separator,
+ N_("<paragraph-break>"),
+ N_("insert <paragraph-break> between paragraphs"),
+ PARSE_OPT_OPTARG, parse_separator_arg),
+ OPT_BOOL(0, "stripspace", &d.stripspace,
+ N_("remove unnecessary whitespace")),
OPT_END()
};
@@ -430,9 +513,13 @@ static int add(int argc, const char **argv, const char *prefix)
usage_with_options(git_notes_add_usage, options);
}
+ if (d.msg_nr)
+ concat_messages(&d);
+ d.given = !!d.buf.len;
+
object_ref = argc > 1 ? argv[1] : "HEAD";
- if (get_oid(object_ref, &object))
+ if (repo_get_oid(the_repository, object_ref, &object))
die(_("failed to resolve '%s' as a valid ref."), object_ref);
t = init_notes_check("add", NOTES_INIT_WRITABLE);
@@ -520,12 +607,12 @@ static int copy(int argc, const char **argv, const char *prefix)
usage_with_options(git_notes_copy_usage, options);
}
- if (get_oid(argv[0], &from_obj))
+ if (repo_get_oid(the_repository, argv[0], &from_obj))
die(_("failed to resolve '%s' as a valid ref."), argv[0]);
object_ref = 1 < argc ? argv[1] : "HEAD";
- if (get_oid(object_ref, &object))
+ if (repo_get_oid(the_repository, object_ref, &object))
die(_("failed to resolve '%s' as a valid ref."), object_ref);
t = init_notes_check("copy", NOTES_INIT_WRITABLE);
@@ -568,7 +655,7 @@ static int append_edit(int argc, const char **argv, const char *prefix)
const struct object_id *note;
char *logmsg;
const char * const *usage;
- struct note_data d = { 0, 0, NULL, STRBUF_INIT };
+ struct note_data d = { .buf = STRBUF_INIT, .stripspace = UNSPECIFIED };
struct option options[] = {
OPT_CALLBACK_F('m', "message", &d, N_("message"),
N_("note contents as a string"), PARSE_OPT_NONEG,
@@ -584,6 +671,12 @@ static int append_edit(int argc, const char **argv, const char *prefix)
parse_reuse_arg),
OPT_BOOL(0, "allow-empty", &allow_empty,
N_("allow storing empty note")),
+ OPT_CALLBACK_F(0, "separator", &separator,
+ N_("<paragraph-break>"),
+ N_("insert <paragraph-break> between paragraphs"),
+ PARSE_OPT_OPTARG, parse_separator_arg),
+ OPT_BOOL(0, "stripspace", &d.stripspace,
+ N_("remove unnecessary whitespace")),
OPT_END()
};
int edit = !strcmp(argv[0], "edit");
@@ -597,6 +690,10 @@ static int append_edit(int argc, const char **argv, const char *prefix)
usage_with_options(usage, options);
}
+ if (d.msg_nr)
+ concat_messages(&d);
+ d.given = !!d.buf.len;
+
if (d.given && edit)
fprintf(stderr, _("The -m/-F/-c/-C options have been deprecated "
"for the 'edit' subcommand.\n"
@@ -604,7 +701,7 @@ static int append_edit(int argc, const char **argv, const char *prefix)
object_ref = 1 < argc ? argv[1] : "HEAD";
- if (get_oid(object_ref, &object))
+ if (repo_get_oid(the_repository, object_ref, &object))
die(_("failed to resolve '%s' as a valid ref."), object_ref);
t = init_notes_check(argv[0], NOTES_INIT_WRITABLE);
@@ -616,14 +713,19 @@ static int append_edit(int argc, const char **argv, const char *prefix)
/* Append buf to previous note contents */
unsigned long size;
enum object_type type;
- char *prev_buf = read_object_file(note, &type, &size);
+ struct strbuf buf = STRBUF_INIT;
+ char *prev_buf = repo_read_object_file(the_repository, note, &type, &size);
+
+ if (!prev_buf)
+ die(_("unable to read %s"), oid_to_hex(note));
+ if (size)
+ strbuf_add(&buf, prev_buf, size);
+ if (d.buf.len && size)
+ append_separator(&buf);
+ strbuf_insert(&d.buf, 0, buf.buf, buf.len);
- strbuf_grow(&d.buf, size + 1);
- if (d.buf.len && prev_buf && size)
- strbuf_insertstr(&d.buf, 0, "\n");
- if (prev_buf && size)
- strbuf_insert(&d.buf, 0, prev_buf, size);
free(prev_buf);
+ strbuf_release(&buf);
}
if (d.buf.len || allow_empty) {
@@ -666,7 +768,7 @@ static int show(int argc, const char **argv, const char *prefix)
object_ref = argc ? argv[0] : "HEAD";
- if (get_oid(object_ref, &object))
+ if (repo_get_oid(the_repository, object_ref, &object))
die(_("failed to resolve '%s' as a valid ref."), object_ref);
t = init_notes_check("show", 0);
@@ -716,11 +818,11 @@ static int merge_commit(struct notes_merge_options *o)
* and target notes ref from .git/NOTES_MERGE_REF.
*/
- if (get_oid("NOTES_MERGE_PARTIAL", &oid))
+ if (repo_get_oid(the_repository, "NOTES_MERGE_PARTIAL", &oid))
die(_("failed to read ref NOTES_MERGE_PARTIAL"));
else if (!(partial = lookup_commit_reference(the_repository, &oid)))
die(_("could not find commit from NOTES_MERGE_PARTIAL."));
- else if (parse_commit(partial))
+ else if (repo_parse_commit(the_repository, partial))
die(_("could not parse commit from NOTES_MERGE_PARTIAL."));
if (partial->parents)
@@ -741,7 +843,8 @@ static int merge_commit(struct notes_merge_options *o)
/* Reuse existing commit message in reflog message */
memset(&pretty_ctx, 0, sizeof(pretty_ctx));
- format_commit_message(partial, "%s", &msg, &pretty_ctx);
+ repo_format_commit_message(the_repository, partial, "%s", &msg,
+ &pretty_ctx);
strbuf_trim(&msg);
strbuf_insertstr(&msg, 0, "notes: ");
update_ref(msg.buf, o->local_ref, &oid,
@@ -895,7 +998,7 @@ static int remove_one_note(struct notes_tree *t, const char *name, unsigned flag
{
int status;
struct object_id oid;
- if (get_oid(name, &oid))
+ if (repo_get_oid(the_repository, name, &oid))
return error(_("Failed to resolve '%s' as a valid ref."), name);
status = remove_note(t, oid.hash);
if (status)
@@ -994,17 +1097,34 @@ static int get_ref(int argc, const char **argv, const char *prefix)
int cmd_notes(int argc, const char **argv, const char *prefix)
{
- int result;
const char *override_notes_ref = NULL;
+ parse_opt_subcommand_fn *fn = NULL;
struct option options[] = {
OPT_STRING(0, "ref", &override_notes_ref, N_("notes-ref"),
N_("use notes from <notes-ref>")),
+ OPT_SUBCOMMAND("list", &fn, list),
+ OPT_SUBCOMMAND("add", &fn, add),
+ OPT_SUBCOMMAND("copy", &fn, copy),
+ OPT_SUBCOMMAND("append", &fn, append_edit),
+ OPT_SUBCOMMAND("edit", &fn, append_edit),
+ OPT_SUBCOMMAND("show", &fn, show),
+ OPT_SUBCOMMAND("merge", &fn, merge),
+ OPT_SUBCOMMAND("remove", &fn, remove_cmd),
+ OPT_SUBCOMMAND("prune", &fn, prune),
+ OPT_SUBCOMMAND("get-ref", &fn, get_ref),
OPT_END()
};
git_config(git_default_config, NULL);
argc = parse_options(argc, argv, prefix, options, git_notes_usage,
- PARSE_OPT_STOP_AT_NON_OPTION);
+ PARSE_OPT_SUBCOMMAND_OPTIONAL);
+ if (!fn) {
+ if (argc) {
+ error(_("unknown subcommand: `%s'"), argv[0]);
+ usage_with_options(git_notes_usage, options);
+ }
+ fn = list;
+ }
if (override_notes_ref) {
struct strbuf sb = STRBUF_INIT;
@@ -1014,28 +1134,5 @@ int cmd_notes(int argc, const char **argv, const char *prefix)
strbuf_release(&sb);
}
- if (argc < 1 || !strcmp(argv[0], "list"))
- result = list(argc, argv, prefix);
- else if (!strcmp(argv[0], "add"))
- result = add(argc, argv, prefix);
- else if (!strcmp(argv[0], "copy"))
- result = copy(argc, argv, prefix);
- else if (!strcmp(argv[0], "append") || !strcmp(argv[0], "edit"))
- result = append_edit(argc, argv, prefix);
- else if (!strcmp(argv[0], "show"))
- result = show(argc, argv, prefix);
- else if (!strcmp(argv[0], "merge"))
- result = merge(argc, argv, prefix);
- else if (!strcmp(argv[0], "remove"))
- result = remove_cmd(argc, argv, prefix);
- else if (!strcmp(argv[0], "prune"))
- result = prune(argc, argv, prefix);
- else if (!strcmp(argv[0], "get-ref"))
- result = get_ref(argc, argv, prefix);
- else {
- result = error(_("unknown subcommand: %s"), argv[0]);
- usage_with_options(git_notes_usage, options);
- }
-
- return result ? 1 : 0;
+ return !!fn(argc, argv, prefix);
}
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 39e28cf..baf0090 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1,13 +1,13 @@
#include "builtin.h"
-#include "cache.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "attr.h"
#include "object.h"
-#include "blob.h"
#include "commit.h"
#include "tag.h"
-#include "tree.h"
#include "delta.h"
#include "pack.h"
#include "pack-revindex.h"
@@ -16,7 +16,6 @@
#include "diff.h"
#include "revision.h"
#include "list-objects.h"
-#include "list-objects-filter.h"
#include "list-objects-filter-options.h"
#include "pack-objects.h"
#include "progress.h"
@@ -30,13 +29,16 @@
#include "strvec.h"
#include "list.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "replace-object.h"
#include "dir.h"
#include "midx.h"
#include "trace2.h"
#include "shallow.h"
#include "promisor-remote.h"
#include "pack-mtimes.h"
+#include "parse-options.h"
/*
* Objects we are going to pack are collected in the `to_pack` structure.
@@ -180,8 +182,8 @@ static inline void oe_set_delta_size(struct packing_data *pack,
#define SET_DELTA_SIBLING(obj, val) oe_set_delta_sibling(&to_pack, obj, val)
static const char *pack_usage[] = {
- N_("git pack-objects --stdout [<options>...] [< <ref-list> | < <object-list>]"),
- N_("git pack-objects [<options>...] <base-name> [< <ref-list> | < <object-list>]"),
+ N_("git pack-objects --stdout [<options>] [< <ref-list> | < <object-list>]"),
+ N_("git pack-objects [<options>] <base-name> [< <ref-list> | < <object-list>]"),
NULL
};
@@ -216,13 +218,19 @@ static int thin;
static int num_preferred_base;
static struct progress *progress_state;
-static struct packed_git *reuse_packfile;
+static struct bitmapped_pack *reuse_packfiles;
+static size_t reuse_packfiles_nr;
+static size_t reuse_packfiles_used_nr;
static uint32_t reuse_packfile_objects;
static struct bitmap *reuse_packfile_bitmap;
static int use_bitmap_index_default = 1;
static int use_bitmap_index = -1;
-static int allow_pack_reuse = 1;
+static enum {
+ NO_PACK_REUSE = 0,
+ SINGLE_PACK_REUSE,
+ MULTI_PACK_REUSE,
+} allow_pack_reuse = SINGLE_PACK_REUSE;
static enum {
WRITE_BITMAP_FALSE = 0,
WRITE_BITMAP_QUIET,
@@ -288,11 +296,13 @@ static void *get_delta(struct object_entry *entry)
void *buf, *base_buf, *delta_buf;
enum object_type type;
- buf = read_object_file(&entry->idx.oid, &type, &size);
+ buf = repo_read_object_file(the_repository, &entry->idx.oid, &type,
+ &size);
if (!buf)
die(_("unable to read %s"), oid_to_hex(&entry->idx.oid));
- base_buf = read_object_file(&DELTA(entry)->idx.oid, &type,
- &base_size);
+ base_buf = repo_read_object_file(the_repository,
+ &DELTA(entry)->idx.oid, &type,
+ &base_size);
if (!base_buf)
die("unable to read %s",
oid_to_hex(&DELTA(entry)->idx.oid));
@@ -454,7 +464,9 @@ static unsigned long write_no_reuse_object(struct hashfile *f, struct object_ent
&size, NULL)) != NULL)
buf = NULL;
else {
- buf = read_object_file(&entry->idx.oid, &type, &size);
+ buf = repo_read_object_file(the_repository,
+ &entry->idx.oid, &type,
+ &size);
if (!buf)
die(_("unable to read %s"),
oid_to_hex(&entry->idx.oid));
@@ -759,8 +771,8 @@ static enum write_one_status write_one(struct hashfile *f,
return WRITE_ONE_WRITTEN;
}
-static int mark_tagged(const char *path, const struct object_id *oid, int flag,
- void *cb_data)
+static int mark_tagged(const char *path UNUSED, const struct object_id *oid,
+ int flag UNUSED, void *cb_data UNUSED)
{
struct object_id peeled;
struct object_entry *entry = packlist_find(&to_pack, oid);
@@ -929,8 +941,10 @@ static struct object_entry **compute_write_order(void)
*/
for_each_tag_ref(mark_tagged, NULL);
- if (use_delta_islands)
+ if (use_delta_islands) {
max_layers = compute_pack_layers(&to_pack);
+ free_island_marks();
+ }
ALLOC_ARRAY(wo, to_pack.nr_objects);
wo_end = 0;
@@ -1002,7 +1016,9 @@ static off_t find_reused_offset(off_t where)
return reused_chunks[lo-1].difference;
}
-static void write_reused_pack_one(size_t pos, struct hashfile *out,
+static void write_reused_pack_one(struct packed_git *reuse_packfile,
+ size_t pos, struct hashfile *out,
+ off_t pack_start,
struct pack_window **w_curs)
{
off_t offset, next, cur;
@@ -1012,7 +1028,8 @@ static void write_reused_pack_one(size_t pos, struct hashfile *out,
offset = pack_pos_to_offset(reuse_packfile, pos);
next = pack_pos_to_offset(reuse_packfile, pos + 1);
- record_reused_object(offset, offset - hashfile_total(out));
+ record_reused_object(offset,
+ offset - (hashfile_total(out) - pack_start));
cur = offset;
type = unpack_object_header(reuse_packfile, w_curs, &cur, &size);
@@ -1080,41 +1097,93 @@ static void write_reused_pack_one(size_t pos, struct hashfile *out,
copy_pack_data(out, reuse_packfile, w_curs, offset, next - offset);
}
-static size_t write_reused_pack_verbatim(struct hashfile *out,
+static size_t write_reused_pack_verbatim(struct bitmapped_pack *reuse_packfile,
+ struct hashfile *out,
+ off_t pack_start,
struct pack_window **w_curs)
{
- size_t pos = 0;
+ size_t pos = reuse_packfile->bitmap_pos;
+ size_t end;
+
+ if (pos % BITS_IN_EWORD) {
+ size_t word_pos = (pos / BITS_IN_EWORD);
+ size_t offset = pos % BITS_IN_EWORD;
+ size_t last;
+ eword_t word = reuse_packfile_bitmap->words[word_pos];
+
+ if (offset + reuse_packfile->bitmap_nr < BITS_IN_EWORD)
+ last = offset + reuse_packfile->bitmap_nr;
+ else
+ last = BITS_IN_EWORD;
+
+ for (; offset < last; offset++) {
+ if (word >> offset == 0)
+ return word_pos;
+ if (!bitmap_get(reuse_packfile_bitmap,
+ word_pos * BITS_IN_EWORD + offset))
+ return word_pos;
+ }
+
+ pos += BITS_IN_EWORD - (pos % BITS_IN_EWORD);
+ }
+
+ /*
+ * Now we're going to copy as many whole eword_t's as possible.
+ * "end" is the index of the last whole eword_t we copy, but
+ * there may be additional bits to process. Those are handled
+ * individually by write_reused_pack().
+ *
+ * Begin by advancing to the first word boundary in range of the
+ * bit positions occupied by objects in "reuse_packfile". Then
+ * pick the last word boundary in the same range. If we have at
+ * least one word's worth of bits to process, continue on.
+ */
+ end = reuse_packfile->bitmap_pos + reuse_packfile->bitmap_nr;
+ if (end % BITS_IN_EWORD)
+ end -= end % BITS_IN_EWORD;
+ if (pos >= end)
+ return reuse_packfile->bitmap_pos / BITS_IN_EWORD;
+
+ while (pos < end &&
+ reuse_packfile_bitmap->words[pos / BITS_IN_EWORD] == (eword_t)~0)
+ pos += BITS_IN_EWORD;
- while (pos < reuse_packfile_bitmap->word_alloc &&
- reuse_packfile_bitmap->words[pos] == (eword_t)~0)
- pos++;
+ if (pos > end)
+ pos = end;
- if (pos) {
- off_t to_write;
+ if (reuse_packfile->bitmap_pos < pos) {
+ off_t pack_start_off = pack_pos_to_offset(reuse_packfile->p, 0);
+ off_t pack_end_off = pack_pos_to_offset(reuse_packfile->p,
+ pos - reuse_packfile->bitmap_pos);
- written = (pos * BITS_IN_EWORD);
- to_write = pack_pos_to_offset(reuse_packfile, written)
- - sizeof(struct pack_header);
+ written += pos - reuse_packfile->bitmap_pos;
/* We're recording one chunk, not one object. */
- record_reused_object(sizeof(struct pack_header), 0);
+ record_reused_object(pack_start_off,
+ pack_start_off - (hashfile_total(out) - pack_start));
hashflush(out);
- copy_pack_data(out, reuse_packfile, w_curs,
- sizeof(struct pack_header), to_write);
+ copy_pack_data(out, reuse_packfile->p, w_curs,
+ pack_start_off, pack_end_off - pack_start_off);
display_progress(progress_state, written);
}
- return pos;
+ if (pos % BITS_IN_EWORD)
+ BUG("attempted to jump past a word boundary to %"PRIuMAX,
+ (uintmax_t)pos);
+ return pos / BITS_IN_EWORD;
}
-static void write_reused_pack(struct hashfile *f)
+static void write_reused_pack(struct bitmapped_pack *reuse_packfile,
+ struct hashfile *f)
{
- size_t i = 0;
+ size_t i = reuse_packfile->bitmap_pos / BITS_IN_EWORD;
uint32_t offset;
+ off_t pack_start = hashfile_total(f) - sizeof(struct pack_header);
struct pack_window *w_curs = NULL;
if (allow_ofs_delta)
- i = write_reused_pack_verbatim(f, &w_curs);
+ i = write_reused_pack_verbatim(reuse_packfile, f, pack_start,
+ &w_curs);
for (; i < reuse_packfile_bitmap->word_alloc; ++i) {
eword_t word = reuse_packfile_bitmap->words[i];
@@ -1125,16 +1194,23 @@ static void write_reused_pack(struct hashfile *f)
break;
offset += ewah_bit_ctz64(word >> offset);
+ if (pos + offset < reuse_packfile->bitmap_pos)
+ continue;
+ if (pos + offset >= reuse_packfile->bitmap_pos + reuse_packfile->bitmap_nr)
+ goto done;
/*
* Can use bit positions directly, even for MIDX
* bitmaps. See comment in try_partial_reuse()
* for why.
*/
- write_reused_pack_one(pos + offset, f, &w_curs);
+ write_reused_pack_one(reuse_packfile->p,
+ pos + offset - reuse_packfile->bitmap_pos,
+ f, pack_start, &w_curs);
display_progress(progress_state, ++written);
}
}
+done:
unuse_pack(&w_curs);
}
@@ -1186,9 +1262,14 @@ static void write_pack_file(void)
offset = write_pack_header(f, nr_remaining);
- if (reuse_packfile) {
+ if (reuse_packfiles_nr) {
assert(pack_to_stdout);
- write_reused_pack(f);
+ for (j = 0; j < reuse_packfiles_nr; j++) {
+ reused_chunks_nr = 0;
+ write_reused_pack(&reuse_packfiles[j], f);
+ if (reused_chunks_nr)
+ reuse_packfiles_used_nr++;
+ }
offset = hashfile_total(f);
}
@@ -1588,7 +1669,7 @@ static int add_object_entry(const struct object_id *oid, enum object_type type,
static int add_object_entry_from_bitmap(const struct object_id *oid,
enum object_type type,
- int flags, uint32_t name_hash,
+ int flags UNUSED, uint32_t name_hash,
struct packed_git *pack, off_t offset)
{
display_progress(progress_state, ++nr_seen);
@@ -1663,7 +1744,7 @@ static struct pbase_tree_cache *pbase_tree_get(const struct object_id *oid)
/* Did not find one. Either we got a bogus request or
* we need to read and perhaps cache.
*/
- data = read_object_file(oid, &type, &size);
+ data = repo_read_object_file(the_repository, oid, &type, &size);
if (!data)
return NULL;
if (type != OBJ_TREE) {
@@ -1708,17 +1789,14 @@ static void pbase_tree_put(struct pbase_tree_cache *cache)
free(cache);
}
-static int name_cmp_len(const char *name)
+static size_t name_cmp_len(const char *name)
{
- int i;
- for (i = 0; name[i] && name[i] != '\n' && name[i] != '/'; i++)
- ;
- return i;
+ return strcspn(name, "\n/");
}
static void add_pbase_object(struct tree_desc *tree,
const char *name,
- int cmplen,
+ size_t cmplen,
const char *fullname)
{
struct name_entry entry;
@@ -1743,12 +1821,13 @@ static void add_pbase_object(struct tree_desc *tree,
struct tree_desc sub;
struct pbase_tree_cache *tree;
const char *down = name+cmplen+1;
- int downlen = name_cmp_len(down);
+ size_t downlen = name_cmp_len(down);
tree = pbase_tree_get(&entry.oid);
if (!tree)
return;
- init_tree_desc(&sub, tree->tree_data, tree->tree_size);
+ init_tree_desc(&sub, &tree->oid,
+ tree->tree_data, tree->tree_size);
add_pbase_object(&sub, down, downlen, fullname);
pbase_tree_put(tree);
@@ -1795,7 +1874,7 @@ static int check_pbase_path(unsigned hash)
static void add_preferred_base_object(const char *name)
{
struct pbase_tree *it;
- int cmplen;
+ size_t cmplen;
unsigned hash = pack_name_hash(name);
if (!num_preferred_base || check_pbase_path(hash))
@@ -1808,7 +1887,8 @@ static void add_preferred_base_object(const char *name)
}
else {
struct tree_desc tree;
- init_tree_desc(&tree, it->pcache.tree_data, it->pcache.tree_size);
+ init_tree_desc(&tree, &it->pcache.oid,
+ it->pcache.tree_data, it->pcache.tree_size);
add_pbase_object(&tree, name, cmplen, name);
}
}
@@ -2075,7 +2155,7 @@ static void check_object(struct object_entry *entry, uint32_t object_index)
if (oid_object_info_extended(the_repository, &entry->idx.oid, &oi,
OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_LOOKUP_REPLACE) < 0) {
- if (has_promisor_remote()) {
+ if (repo_has_promisor_remote(the_repository)) {
prefetch_to_pack(object_index);
if (oid_object_info_extended(the_repository, &entry->idx.oid, &oi,
OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_LOOKUP_REPLACE) < 0)
@@ -2526,7 +2606,9 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
/* Load data if not already done */
if (!trg->data) {
packing_data_lock(&to_pack);
- trg->data = read_object_file(&trg_entry->idx.oid, &type, &sz);
+ trg->data = repo_read_object_file(the_repository,
+ &trg_entry->idx.oid, &type,
+ &sz);
packing_data_unlock(&to_pack);
if (!trg->data)
die(_("object %s cannot be read"),
@@ -2539,7 +2621,9 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
}
if (!src->data) {
packing_data_lock(&to_pack);
- src->data = read_object_file(&src_entry->idx.oid, &type, &sz);
+ src->data = repo_read_object_file(the_repository,
+ &src_entry->idx.oid, &type,
+ &sz);
packing_data_unlock(&to_pack);
if (!src->data) {
if (src_entry->preferred_base) {
@@ -3035,7 +3119,8 @@ static void add_tag_chain(const struct object_id *oid)
}
}
-static int add_ref_tag(const char *tag, const struct object_id *oid, int flag, void *cb_data)
+static int add_ref_tag(const char *tag UNUSED, const struct object_id *oid,
+ int flag UNUSED, void *cb_data UNUSED)
{
struct object_id peeled;
@@ -3120,26 +3205,27 @@ static void prepare_pack(int window, int depth)
free(delta_list);
}
-static int git_pack_config(const char *k, const char *v, void *cb)
+static int git_pack_config(const char *k, const char *v,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(k, "pack.window")) {
- window = git_config_int(k, v);
+ window = git_config_int(k, v, ctx->kvi);
return 0;
}
if (!strcmp(k, "pack.windowmemory")) {
- window_memory_limit = git_config_ulong(k, v);
+ window_memory_limit = git_config_ulong(k, v, ctx->kvi);
return 0;
}
if (!strcmp(k, "pack.depth")) {
- depth = git_config_int(k, v);
+ depth = git_config_int(k, v, ctx->kvi);
return 0;
}
if (!strcmp(k, "pack.deltacachesize")) {
- max_delta_cache_size = git_config_int(k, v);
+ max_delta_cache_size = git_config_int(k, v, ctx->kvi);
return 0;
}
if (!strcmp(k, "pack.deltacachelimit")) {
- cache_max_small_delta_size = git_config_int(k, v);
+ cache_max_small_delta_size = git_config_int(k, v, ctx->kvi);
return 0;
}
if (!strcmp(k, "pack.writebitmaphashcache")) {
@@ -3148,16 +3234,36 @@ static int git_pack_config(const char *k, const char *v, void *cb)
else
write_bitmap_options &= ~BITMAP_OPT_HASH_CACHE;
}
+
+ if (!strcmp(k, "pack.writebitmaplookuptable")) {
+ if (git_config_bool(k, v))
+ write_bitmap_options |= BITMAP_OPT_LOOKUP_TABLE;
+ else
+ write_bitmap_options &= ~BITMAP_OPT_LOOKUP_TABLE;
+ }
+
if (!strcmp(k, "pack.usebitmaps")) {
use_bitmap_index_default = git_config_bool(k, v);
return 0;
}
if (!strcmp(k, "pack.allowpackreuse")) {
- allow_pack_reuse = git_config_bool(k, v);
+ int res = git_parse_maybe_bool_text(v);
+ if (res < 0) {
+ if (!strcasecmp(v, "single"))
+ allow_pack_reuse = SINGLE_PACK_REUSE;
+ else if (!strcasecmp(v, "multi"))
+ allow_pack_reuse = MULTI_PACK_REUSE;
+ else
+ die(_("invalid pack.allowPackReuse value: '%s'"), v);
+ } else if (res) {
+ allow_pack_reuse = SINGLE_PACK_REUSE;
+ } else {
+ allow_pack_reuse = NO_PACK_REUSE;
+ }
return 0;
}
if (!strcmp(k, "pack.threads")) {
- delta_search_threads = git_config_int(k, v);
+ delta_search_threads = git_config_int(k, v, ctx->kvi);
if (delta_search_threads < 0)
die(_("invalid number of threads specified (%d)"),
delta_search_threads);
@@ -3168,7 +3274,7 @@ static int git_pack_config(const char *k, const char *v, void *cb)
return 0;
}
if (!strcmp(k, "pack.indexversion")) {
- pack_idx_opts.version = git_config_int(k, v);
+ pack_idx_opts.version = git_config_int(k, v, ctx->kvi);
if (pack_idx_opts.version > 2)
die(_("bad pack.indexVersion=%"PRIu32),
pack_idx_opts.version);
@@ -3182,7 +3288,7 @@ static int git_pack_config(const char *k, const char *v, void *cb)
return 0;
}
if (!strcmp(k, "uploadpack.blobpackfileuri")) {
- struct configured_exclusion *ex = xmalloc(sizeof(*ex));
+ struct configured_exclusion *ex;
const char *oid_end, *pack_end;
/*
* Stores the pack hash. This is not a true object ID, but is
@@ -3190,6 +3296,10 @@ static int git_pack_config(const char *k, const char *v, void *cb)
*/
struct object_id pack_hash;
+ if (!v)
+ return config_error_nonbool(k);
+
+ ex = xmalloc(sizeof(*ex));
if (parse_oid_hex(v, &ex->e.oid, &oid_end) ||
*oid_end != ' ' ||
parse_oid_hex(oid_end + 1, &pack_hash, &pack_end) ||
@@ -3204,7 +3314,7 @@ static int git_pack_config(const char *k, const char *v, void *cb)
ex->uri = xstrdup(pack_end + 1);
oidmap_put(&configured_exclusions, ex);
}
- return git_default_config(k, v, cb);
+ return git_default_config(k, v, ctx, cb);
}
/* Counters for trace2 output when in --stdin-packs mode. */
@@ -3252,13 +3362,14 @@ static int add_object_entry_from_pack(const struct object_id *oid,
return 0;
}
-static void show_commit_pack_hint(struct commit *commit, void *_data)
+static void show_commit_pack_hint(struct commit *commit UNUSED,
+ void *data UNUSED)
{
/* nothing to do; commits don't have a namehash */
}
static void show_object_pack_hint(struct object *object, const char *name,
- void *_data)
+ void *data UNUSED)
{
struct object_entry *oe = packlist_find(&to_pack, &object->oid);
if (!oe)
@@ -3336,16 +3447,16 @@ static void read_packs_list_from_stdin(void)
}
string_list_sort(&include_packs);
+ string_list_remove_duplicates(&include_packs, 0);
string_list_sort(&exclude_packs);
+ string_list_remove_duplicates(&exclude_packs, 0);
for (p = get_all_packs(the_repository); p; p = p->next) {
const char *pack_name = pack_basename(p);
- item = string_list_lookup(&include_packs, pack_name);
- if (!item)
- item = string_list_lookup(&exclude_packs, pack_name);
-
- if (item)
+ if ((item = string_list_lookup(&include_packs, pack_name)))
+ item->util = p;
+ if ((item = string_list_lookup(&exclude_packs, pack_name)))
item->util = p;
}
@@ -3456,7 +3567,7 @@ static void add_cruft_object_entry(const struct object_id *oid, enum object_type
return;
}
-static void show_cruft_object(struct object *obj, const char *name, void *data)
+static void show_cruft_object(struct object *obj, const char *name, void *data UNUSED)
{
/*
* if we did not record it earlier, it's at least as old as our
@@ -3476,7 +3587,7 @@ static void show_cruft_commit(struct commit *commit, void *data)
show_cruft_object((struct object*)commit, NULL, data);
}
-static int cruft_include_check_obj(struct object *obj, 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);
}
@@ -3580,7 +3691,6 @@ static void read_cruft_objects(void)
string_list_append(&discard_packs, buf.buf + 1);
else
string_list_append(&fresh_packs, buf.buf);
- strbuf_reset(&buf);
}
string_list_sort(&discard_packs);
@@ -3655,7 +3765,7 @@ static void read_object_list_from_stdin(void)
}
}
-static void show_commit(struct commit *commit, void *data)
+static void show_commit(struct commit *commit, void *data UNUSED)
{
add_object_entry(&commit->object.oid, OBJ_COMMIT, NULL, 0);
@@ -3666,7 +3776,8 @@ static void show_commit(struct commit *commit, void *data)
propagate_island_marks(commit);
}
-static void show_object(struct object *obj, const char *name, void *data)
+static void show_object(struct object *obj, const char *name,
+ void *data UNUSED)
{
add_preferred_base_object(name);
add_object_entry(&obj->oid, obj->type, name, 0);
@@ -3715,7 +3826,7 @@ static void show_object__ma_allow_promisor(struct object *obj, const char *name,
show_object(obj, name, data);
}
-static int option_parse_missing_action(const struct option *opt,
+static int option_parse_missing_action(const struct option *opt UNUSED,
const char *arg, int unset)
{
assert(arg);
@@ -3753,7 +3864,7 @@ static void show_edge(struct commit *commit)
static int add_object_in_unpacked_pack(const struct object_id *oid,
struct packed_git *pack,
uint32_t pos,
- void *_data)
+ void *data UNUSED)
{
if (cruft) {
off_t offset;
@@ -3787,7 +3898,7 @@ static void add_objects_in_unpacked_packs(void)
}
static int add_loose_object(const struct object_id *oid, const char *path,
- void *data)
+ void *data UNUSED)
{
enum object_type type = oid_object_info(the_repository, oid, NULL);
@@ -3907,7 +4018,7 @@ static void loosen_unused_packed_objects(void)
*/
static int pack_options_allow_reuse(void)
{
- return allow_pack_reuse &&
+ return allow_pack_reuse != NO_PACK_REUSE &&
pack_to_stdout &&
!ignore_packed_keep_on_disk &&
!ignore_packed_keep_in_core &&
@@ -3920,13 +4031,18 @@ static int get_object_list_from_bitmap(struct rev_info *revs)
if (!(bitmap_git = prepare_bitmap_walk(revs, 0)))
return -1;
- if (pack_options_allow_reuse() &&
- !reuse_partial_packfile_from_bitmap(
- bitmap_git,
- &reuse_packfile,
- &reuse_packfile_objects,
- &reuse_packfile_bitmap)) {
- assert(reuse_packfile_objects);
+ if (pack_options_allow_reuse())
+ reuse_partial_packfile_from_bitmap(bitmap_git,
+ &reuse_packfiles,
+ &reuse_packfiles_nr,
+ &reuse_packfile_bitmap,
+ allow_pack_reuse == MULTI_PACK_REUSE);
+
+ if (reuse_packfiles) {
+ reuse_packfile_objects = bitmap_popcount(reuse_packfile_bitmap);
+ if (!reuse_packfile_objects)
+ BUG("expected non-empty reuse bitmap");
+
nr_result += reuse_packfile_objects;
nr_seen += reuse_packfile_objects;
display_progress(progress_state, nr_seen);
@@ -3938,20 +4054,21 @@ static int get_object_list_from_bitmap(struct rev_info *revs)
}
static void record_recent_object(struct object *obj,
- const char *name,
- void *data)
+ const char *name UNUSED,
+ void *data UNUSED)
{
oid_array_append(&recent_objects, &obj->oid);
}
-static void record_recent_commit(struct commit *commit, void *data)
+static void record_recent_commit(struct commit *commit, void *data UNUSED)
{
oid_array_append(&recent_objects, &commit->object.oid);
}
static int mark_bitmap_preferred_tip(const char *refname,
- const struct object_id *oid, int flags,
- void *_data)
+ const struct object_id *oid,
+ int flags UNUSED,
+ void *data UNUSED)
{
struct object_id peeled;
struct object *object;
@@ -4092,25 +4209,40 @@ static void add_extra_kept_packs(const struct string_list *names)
}
}
+static int option_parse_quiet(const struct option *opt, const char *arg,
+ int unset)
+{
+ int *val = opt->value;
+
+ BUG_ON_OPT_ARG(arg);
+
+ if (!unset)
+ *val = 0;
+ else if (!*val)
+ *val = 1;
+ return 0;
+}
+
static int option_parse_index_version(const struct option *opt,
const char *arg, int unset)
{
+ struct pack_idx_option *popts = opt->value;
char *c;
const char *val = arg;
BUG_ON_OPT_NEG(unset);
- pack_idx_opts.version = strtoul(val, &c, 10);
- if (pack_idx_opts.version > 2)
+ popts->version = strtoul(val, &c, 10);
+ if (popts->version > 2)
die(_("unsupported index version %s"), val);
if (*c == ',' && c[1])
- pack_idx_opts.off32_limit = strtoul(c+1, &c, 0);
- if (*c || pack_idx_opts.off32_limit & 0x80000000)
+ popts->off32_limit = strtoul(c+1, &c, 0);
+ if (*c || popts->off32_limit & 0x80000000)
die(_("bad index version '%s'"), val);
return 0;
}
-static int option_parse_unpack_unreachable(const struct option *opt,
+static int option_parse_unpack_unreachable(const struct option *opt UNUSED,
const char *arg, int unset)
{
if (unset) {
@@ -4125,7 +4257,7 @@ static int option_parse_unpack_unreachable(const struct option *opt,
return 0;
}
-static int option_parse_cruft_expiration(const struct option *opt,
+static int option_parse_cruft_expiration(const struct option *opt UNUSED,
const char *arg, int unset)
{
if (unset) {
@@ -4139,21 +4271,6 @@ static int option_parse_cruft_expiration(const struct option *opt,
return 0;
}
-struct po_filter_data {
- unsigned have_revs:1;
- struct rev_info revs;
-};
-
-static struct list_objects_filter_options *po_filter_revs_init(void *value)
-{
- struct po_filter_data *data = value;
-
- repo_init_revisions(the_repository, &data->revs, NULL);
- data->have_revs = 1;
-
- return &data->revs.filter;
-}
-
int cmd_pack_objects(int argc, const char **argv, const char *prefix)
{
int use_internal_rev_list = 0;
@@ -4164,11 +4281,13 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
int rev_list_index = 0;
int stdin_packs = 0;
struct string_list keep_pack_list = STRING_LIST_INIT_NODUP;
- struct po_filter_data pfd = { .have_revs = 0 };
+ struct list_objects_filter_options filter_options =
+ LIST_OBJECTS_FILTER_INIT;
struct option pack_objects_options[] = {
- OPT_SET_INT('q', "quiet", &progress,
- N_("do not show progress meter"), 0),
+ OPT_CALLBACK_F('q', "quiet", &progress, NULL,
+ N_("do not show progress meter"),
+ PARSE_OPT_NOARG, option_parse_quiet),
OPT_SET_INT(0, "progress", &progress,
N_("show progress meter"), 1),
OPT_SET_INT(0, "all-progress", &progress,
@@ -4176,7 +4295,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
OPT_BOOL(0, "all-progress-implied",
&all_progress_implied,
N_("similar to --all-progress when progress meter is shown")),
- OPT_CALLBACK_F(0, "index-version", NULL, N_("<version>[,<offset>]"),
+ OPT_CALLBACK_F(0, "index-version", &pack_idx_opts, N_("<version>[,<offset>]"),
N_("write the pack index file in the specified idx format version"),
PARSE_OPT_NONEG, option_parse_index_version),
OPT_MAGNITUDE(0, "max-pack-size", &pack_size_limit,
@@ -4244,8 +4363,8 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
N_("ignore this pack")),
OPT_INTEGER(0, "compression", &pack_compression_level,
N_("pack compression level")),
- OPT_SET_INT(0, "keep-true-parents", &grafts_replace_parents,
- N_("do not hide commits by grafts"), 0),
+ OPT_BOOL(0, "keep-true-parents", &grafts_keep_true_parents,
+ N_("do not hide commits by grafts")),
OPT_BOOL(0, "use-bitmap-index", &use_bitmap_index,
N_("use a bitmap index if available to speed up counting objects")),
OPT_SET_INT(0, "write-bitmap-index", &write_bitmap_index,
@@ -4255,7 +4374,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
&write_bitmap_index,
N_("write a bitmap index if possible"),
WRITE_BITMAP_QUIET, PARSE_OPT_HIDDEN),
- OPT_PARSE_LIST_OBJECTS_FILTER_INIT(&pfd, po_filter_revs_init),
+ OPT_PARSE_LIST_OBJECTS_FILTER(&filter_options),
OPT_CALLBACK_F(0, "missing", NULL, N_("action"),
N_("handling for missing objects"), PARSE_OPT_NONEG,
option_parse_missing_action),
@@ -4272,19 +4391,22 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
if (DFS_NUM_STATES > (1 << OE_DFS_STATE_BITS))
BUG("too many dfs states, increase OE_DFS_STATE_BITS");
- read_replace_refs = 0;
+ disable_replace_refs();
sparse = git_env_bool("GIT_TEST_PACK_SPARSE", -1);
if (the_repository->gitdir) {
prepare_repo_settings(the_repository);
if (sparse < 0)
sparse = the_repository->settings.pack_use_sparse;
+ if (the_repository->settings.pack_use_multi_pack_reuse)
+ allow_pack_reuse = MULTI_PACK_REUSE;
}
reset_pack_idx_option(&pack_idx_opts);
+ pack_idx_opts.flags |= WRITE_REV;
git_config(git_pack_config, NULL);
- if (git_env_bool(GIT_TEST_WRITE_REV_INDEX, 0))
- pack_idx_opts.flags |= WRITE_REV;
+ if (git_env_bool(GIT_TEST_NO_WRITE_REV_INDEX, 0))
+ pack_idx_opts.flags &= ~WRITE_REV;
progress = isatty(2);
argc = parse_options(argc, argv, prefix, pack_objects_options,
@@ -4358,7 +4480,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
if (!HAVE_THREADS && delta_search_threads != 1)
warning(_("no threads support, ignoring --threads"));
- if (!pack_to_stdout && !pack_size_limit && !cruft)
+ if (!pack_to_stdout && !pack_size_limit)
pack_size_limit = pack_size_limit_cfg;
if (pack_to_stdout && pack_size_limit)
die(_("--max-pack-size cannot be used to build a pack for transfer"));
@@ -4375,12 +4497,8 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
if (!rev_list_all || !rev_list_reflog || !rev_list_index)
unpack_unreachable_expiration = 0;
- if (pfd.have_revs && pfd.revs.filter.choice) {
- if (!pack_to_stdout)
- die(_("cannot use --filter without --stdout"));
- if (stdin_packs)
- die(_("cannot use --filter with --stdin-packs"));
- }
+ if (stdin_packs && filter_options.choice)
+ die(_("cannot use --filter with --stdin-packs"));
if (stdin_packs && use_internal_rev_list)
die(_("cannot use internal rev list with --stdin-packs"));
@@ -4390,8 +4508,6 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
die(_("cannot use internal rev list with --cruft"));
if (stdin_packs)
die(_("cannot use --stdin-packs with --cruft"));
- if (pack_size_limit)
- die(_("cannot use --max-pack-size with --cruft"));
}
/*
@@ -4462,13 +4578,11 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
read_cruft_objects();
} else if (!use_internal_rev_list) {
read_object_list_from_stdin();
- } else if (pfd.have_revs) {
- get_object_list(&pfd.revs, rp.nr, rp.v);
- release_revisions(&pfd.revs);
} else {
struct rev_info revs;
repo_init_revisions(the_repository, &revs, NULL);
+ list_objects_filter_copy(&revs.filter, &filter_options);
get_object_list(&revs, rp.nr, rp.v);
release_revisions(&revs);
}
@@ -4498,11 +4612,21 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
fprintf_ln(stderr,
_("Total %"PRIu32" (delta %"PRIu32"),"
" reused %"PRIu32" (delta %"PRIu32"),"
- " pack-reused %"PRIu32),
+ " pack-reused %"PRIu32" (from %"PRIuMAX")"),
written, written_delta, reused, reused_delta,
- reuse_packfile_objects);
+ reuse_packfile_objects,
+ (uintmax_t)reuse_packfiles_used_nr);
+
+ trace2_data_intmax("pack-objects", the_repository, "written", written);
+ trace2_data_intmax("pack-objects", the_repository, "written/delta", written_delta);
+ trace2_data_intmax("pack-objects", the_repository, "reused", reused);
+ trace2_data_intmax("pack-objects", the_repository, "reused/delta", reused_delta);
+ trace2_data_intmax("pack-objects", the_repository, "pack-reused", reuse_packfile_objects);
+ trace2_data_intmax("pack-objects", the_repository, "packs-reused", reuse_packfiles_used_nr);
cleanup:
+ clear_packing_data(&to_pack);
+ list_objects_filter_release(&filter_options);
strvec_clear(&rp);
return 0;
diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c
index ed9b901..4c735ba 100644
--- a/builtin/pack-redundant.c
+++ b/builtin/pack-redundant.c
@@ -7,14 +7,16 @@
*/
#include "builtin.h"
+#include "gettext.h"
+#include "hex.h"
#include "repository.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#define BLKSIZE 512
static const char pack_redundant_usage[] =
-"git pack-redundant [--verbose] [--alt-odb] (--all | <filename.pack>...)";
+"git pack-redundant [--verbose] [--alt-odb] (--all | <pack-filename>...)";
static int load_all_packs, verbose, alt_odb;
@@ -557,7 +559,7 @@ static void load_all(void)
}
}
-int cmd_pack_redundant(int argc, const char **argv, const char *prefix)
+int cmd_pack_redundant(int argc, const char **argv, const char *prefix UNUSED)
{
int i;
int i_still_use_this = 0;
@@ -603,6 +605,7 @@ int cmd_pack_redundant(int argc, const char **argv, const char *prefix)
"option, '--i-still-use-this', on the command line\n"
"and let us know you still use it by sending an e-mail\n"
"to <git@vger.kernel.org>. Thanks.\n"), stderr);
+ die(_("refusing to run without --i-still-use-this"));
}
if (load_all_packs)
diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c
index cfbd5c3..db40825 100644
--- a/builtin/pack-refs.c
+++ b/builtin/pack-refs.c
@@ -1,24 +1,57 @@
#include "builtin.h"
#include "config.h"
+#include "gettext.h"
#include "parse-options.h"
#include "refs.h"
#include "repository.h"
+#include "revision.h"
static char const * const pack_refs_usage[] = {
- N_("git pack-refs [<options>]"),
+ N_("git pack-refs [--all] [--no-prune] [--auto] [--include <pattern>] [--exclude <pattern>]"),
NULL
};
int cmd_pack_refs(int argc, const char **argv, const char *prefix)
{
- unsigned int flags = PACK_REFS_PRUNE;
+ struct ref_exclusions excludes = REF_EXCLUSIONS_INIT;
+ struct string_list included_refs = STRING_LIST_INIT_NODUP;
+ struct pack_refs_opts pack_refs_opts = {
+ .exclusions = &excludes,
+ .includes = &included_refs,
+ .flags = PACK_REFS_PRUNE,
+ };
+ struct string_list option_excluded_refs = STRING_LIST_INIT_NODUP;
+ struct string_list_item *item;
+ int pack_all = 0;
+ int ret;
+
struct option opts[] = {
- OPT_BIT(0, "all", &flags, N_("pack everything"), PACK_REFS_ALL),
- OPT_BIT(0, "prune", &flags, N_("prune loose refs (default)"), PACK_REFS_PRUNE),
+ OPT_BOOL(0, "all", &pack_all, N_("pack everything")),
+ OPT_BIT(0, "prune", &pack_refs_opts.flags, N_("prune loose refs (default)"), PACK_REFS_PRUNE),
+ OPT_BIT(0, "auto", &pack_refs_opts.flags, N_("auto-pack refs as needed"), PACK_REFS_AUTO),
+ OPT_STRING_LIST(0, "include", pack_refs_opts.includes, N_("pattern"),
+ N_("references to include")),
+ OPT_STRING_LIST(0, "exclude", &option_excluded_refs, N_("pattern"),
+ N_("references to exclude")),
OPT_END(),
};
git_config(git_default_config, NULL);
if (parse_options(argc, argv, prefix, opts, pack_refs_usage, 0))
usage_with_options(pack_refs_usage, opts);
- return refs_pack_refs(get_main_ref_store(the_repository), flags);
+
+ for_each_string_list_item(item, &option_excluded_refs)
+ add_ref_exclusion(pack_refs_opts.exclusions, item->string);
+
+ if (pack_all)
+ string_list_append(pack_refs_opts.includes, "*");
+
+ if (!pack_refs_opts.includes->nr)
+ string_list_append(pack_refs_opts.includes, "refs/tags/*");
+
+ ret = refs_pack_refs(get_main_ref_store(the_repository), &pack_refs_opts);
+
+ clear_ref_exclusions(&excludes);
+ string_list_clear(&included_refs, 0);
+ string_list_clear(&option_excluded_refs, 0);
+ return ret;
}
diff --git a/builtin/patch-id.c b/builtin/patch-id.c
index 881fcf3..3894d2b 100644
--- a/builtin/patch-id.c
+++ b/builtin/patch-id.c
@@ -1,7 +1,10 @@
-#include "cache.h"
#include "builtin.h"
#include "config.h"
#include "diff.h"
+#include "gettext.h"
+#include "hash.h"
+#include "hex.h"
+#include "parse-options.h"
static void flush_current_id(int patchlen, struct object_id *id, struct object_id *result)
{
@@ -57,10 +60,12 @@ static int scan_hunk_header(const char *p, int *p_before, int *p_after)
}
static int get_one_patchid(struct object_id *next_oid, struct object_id *result,
- struct strbuf *line_buf, int stable)
+ struct strbuf *line_buf, int stable, int verbatim)
{
int patchlen = 0, 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];
git_hash_ctx ctx;
the_hash_algo->init_fn(&ctx);
@@ -71,11 +76,14 @@ static int get_one_patchid(struct object_id *next_oid, struct object_id *result,
const char *p = line;
int len;
- if (!skip_prefix(line, "diff-tree ", &p) &&
- !skip_prefix(line, "commit ", &p) &&
+ /* Possibly skip over the prefix added by "log" or "format-patch" */
+ if (!skip_prefix(line, "commit ", &p) &&
!skip_prefix(line, "From ", &p) &&
- starts_with(line, "\\ ") && 12 < strlen(line))
+ starts_with(line, "\\ ") && 12 < strlen(line)) {
+ if (verbatim)
+ the_hash_algo->update_fn(&ctx, line, strlen(line));
continue;
+ }
if (!get_oid_hex(p, next_oid)) {
found_next = 1;
@@ -88,14 +96,44 @@ static int get_one_patchid(struct object_id *next_oid, struct object_id *result,
/* Parsing diff header? */
if (before == -1) {
- if (starts_with(line, "index "))
+ if (starts_with(line, "GIT binary patch") ||
+ starts_with(line, "Binary files")) {
+ diff_is_binary = 1;
+ before = 0;
+ the_hash_algo->update_fn(&ctx, pre_oid_str,
+ strlen(pre_oid_str));
+ the_hash_algo->update_fn(&ctx, post_oid_str,
+ strlen(post_oid_str));
+ if (stable)
+ flush_one_hunk(result, &ctx);
+ continue;
+ } else if (skip_prefix(line, "index ", &p)) {
+ char *oid1_end = strstr(line, "..");
+ char *oid2_end = NULL;
+ if (oid1_end)
+ oid2_end = strstr(oid1_end, " ");
+ if (!oid2_end)
+ oid2_end = line + strlen(line) - 1;
+ if (oid1_end != NULL && oid2_end != NULL) {
+ *oid1_end = *oid2_end = '\0';
+ strlcpy(pre_oid_str, p, GIT_MAX_HEXSZ + 1);
+ strlcpy(post_oid_str, oid1_end + 2, GIT_MAX_HEXSZ + 1);
+ }
continue;
- else if (starts_with(line, "--- "))
+ } else if (starts_with(line, "--- "))
before = after = 1;
else if (!isalpha(line[0]))
break;
}
+ if (diff_is_binary) {
+ if (starts_with(line, "diff ")) {
+ diff_is_binary = 0;
+ before = -1;
+ }
+ continue;
+ }
+
/* Looking for a valid hunk header? */
if (before == 0 && after == 0) {
if (starts_with(line, "@@ -")) {
@@ -120,8 +158,8 @@ static int get_one_patchid(struct object_id *next_oid, struct object_id *result,
if (line[0] == '+' || line[0] == ' ')
after--;
- /* Compute the sha without whitespace */
- len = remove_space(line);
+ /* Add line to hash algo (possibly removing whitespace) */
+ len = verbatim ? strlen(line) : remove_space(line);
patchlen += len;
the_hash_algo->update_fn(&ctx, line, len);
}
@@ -134,7 +172,7 @@ static int get_one_patchid(struct object_id *next_oid, struct object_id *result,
return patchlen;
}
-static void generate_id_list(int stable)
+static void generate_id_list(int stable, int verbatim)
{
struct object_id oid, n, result;
int patchlen;
@@ -142,44 +180,64 @@ static void generate_id_list(int stable)
oidclr(&oid);
while (!feof(stdin)) {
- patchlen = get_one_patchid(&n, &result, &line_buf, stable);
+ patchlen = get_one_patchid(&n, &result, &line_buf, stable, verbatim);
flush_current_id(patchlen, &oid, &result);
oidcpy(&oid, &n);
}
strbuf_release(&line_buf);
}
-static const char patch_id_usage[] = "git patch-id [--stable | --unstable]";
+static const char *const patch_id_usage[] = {
+ N_("git patch-id [--stable | --unstable | --verbatim]"), NULL
+};
+
+struct patch_id_opts {
+ int stable;
+ int verbatim;
+};
-static int git_patch_id_config(const char *var, const char *value, void *cb)
+static int git_patch_id_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
- int *stable = cb;
+ struct patch_id_opts *opts = cb;
if (!strcmp(var, "patchid.stable")) {
- *stable = git_config_bool(var, value);
+ opts->stable = git_config_bool(var, value);
+ return 0;
+ }
+ if (!strcmp(var, "patchid.verbatim")) {
+ opts->verbatim = git_config_bool(var, value);
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
int cmd_patch_id(int argc, const char **argv, const char *prefix)
{
- int stable = -1;
-
- git_config(git_patch_id_config, &stable);
-
- /* If nothing is set, default to unstable. */
- if (stable < 0)
- stable = 0;
-
- if (argc == 2 && !strcmp(argv[1], "--stable"))
- stable = 1;
- else if (argc == 2 && !strcmp(argv[1], "--unstable"))
- stable = 0;
- else if (argc != 1)
- usage(patch_id_usage);
-
- generate_id_list(stable);
+ /* if nothing is set, default to unstable */
+ struct patch_id_opts config = {0, 0};
+ int opts = 0;
+ struct option builtin_patch_id_options[] = {
+ OPT_CMDMODE(0, "unstable", &opts,
+ N_("use the unstable patch-id algorithm"), 1),
+ OPT_CMDMODE(0, "stable", &opts,
+ N_("use the stable patch-id algorithm"), 2),
+ OPT_CMDMODE(0, "verbatim", &opts,
+ N_("don't strip whitespace from the patch"), 3),
+ OPT_END()
+ };
+
+ git_config(git_patch_id_config, &config);
+
+ /* verbatim implies stable */
+ if (config.verbatim)
+ config.stable = 1;
+
+ argc = parse_options(argc, argv, prefix, builtin_patch_id_options,
+ patch_id_usage, 0);
+
+ generate_id_list(opts ? opts > 1 : config.stable,
+ opts ? opts == 3 : config.verbatim);
return 0;
}
diff --git a/builtin/prune-packed.c b/builtin/prune-packed.c
index da3273a..ca3578e 100644
--- a/builtin/prune-packed.c
+++ b/builtin/prune-packed.c
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "gettext.h"
#include "parse-options.h"
#include "prune-packed.h"
diff --git a/builtin/prune.c b/builtin/prune.c
index df376b2..57fe314 100644
--- a/builtin/prune.c
+++ b/builtin/prune.c
@@ -1,13 +1,20 @@
-#include "cache.h"
+#include "builtin.h"
#include "commit.h"
#include "diff.h"
+#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "revision.h"
-#include "builtin.h"
#include "reachable.h"
#include "parse-options.h"
+#include "path.h"
#include "progress.h"
#include "prune-packed.h"
-#include "object-store.h"
+#include "replace-object.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "shallow.h"
static const char * const prune_usage[] = {
@@ -98,7 +105,8 @@ static int prune_object(const struct object_id *oid, const char *fullpath,
return 0;
}
-static int prune_cruft(const char *basename, const char *path, void *data)
+static int prune_cruft(const char *basename, const char *path,
+ void *data UNUSED)
{
if (starts_with(basename, "tmp_obj_"))
prune_tmp_file(path);
@@ -107,7 +115,8 @@ static int prune_cruft(const char *basename, const char *path, void *data)
return 0;
}
-static int prune_subdir(unsigned int nr, const char *path, void *data)
+static int prune_subdir(unsigned int nr UNUSED, const char *path,
+ void *data UNUSED)
{
if (!show_only)
rmdir(path);
@@ -127,7 +136,9 @@ static void remove_temporary_files(const char *path)
dir = opendir(path);
if (!dir) {
- fprintf(stderr, "Unable to open directory %s\n", path);
+ if (errno != ENOENT)
+ fprintf(stderr, "Unable to open directory %s: %s\n",
+ path, strerror(errno));
return;
}
while ((de = readdir(dir)) != NULL)
@@ -154,7 +165,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
expire = TIME_MAX;
save_commit_buffer = 0;
- read_replace_refs = 0;
+ disable_replace_refs();
repo_init_revisions(the_repository, &revs, prefix);
argc = parse_options(argc, argv, prefix, options, prune_usage, 0);
@@ -166,7 +177,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
struct object_id oid;
const char *name = *argv++;
- if (!get_oid(name, &oid)) {
+ if (!repo_get_oid(the_repository, name, &oid)) {
struct object *object = parse_object_or_die(&oid,
name);
add_pending_object(&revs, object, "");
diff --git a/builtin/pull.c b/builtin/pull.c
index 01155ba..72cbb76 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -5,28 +5,29 @@
*
* Fetch one or more remote refs and merge it/them into the current HEAD.
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
-#include "config.h"
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "advice.h"
+#include "config.h"
+#include "gettext.h"
+#include "hex.h"
+#include "merge.h"
+#include "object-name.h"
#include "parse-options.h"
-#include "exec-cmd.h"
#include "run-command.h"
#include "oid-array.h"
#include "remote.h"
#include "dir.h"
+#include "path.h"
+#include "read-cache-ll.h"
#include "rebase.h"
#include "refs.h"
#include "refspec.h"
-#include "revision.h"
#include "submodule.h"
#include "submodule-config.h"
-#include "tempfile.h"
-#include "lockfile.h"
#include "wt-status.h"
#include "commit-reach.h"
#include "sequencer.h"
-#include "packfile.h"
/**
* Parses the value of --rebase. If value is a false value, returns
@@ -357,10 +358,9 @@ static enum rebase_type config_get_rebase(int *rebase_unspecified)
/**
* Read config variables.
*/
-static int git_pull_config(const char *var, const char *value, void *cb)
+static int git_pull_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
- int status;
-
if (!strcmp(var, "rebase.autostash")) {
config_autostash = git_config_bool(var, value);
return 0;
@@ -372,11 +372,7 @@ static int git_pull_config(const char *var, const char *value, void *cb)
check_trust_level = 0;
}
- status = git_gpg_config(var, value, cb);
- if (status)
- return status;
-
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
/**
@@ -515,76 +511,75 @@ static void parse_repo_refspecs(int argc, const char **argv, const char **repo,
*/
static int run_fetch(const char *repo, const char **refspecs)
{
- struct strvec args = STRVEC_INIT;
- int ret;
+ struct child_process cmd = CHILD_PROCESS_INIT;
- strvec_pushl(&args, "fetch", "--update-head-ok", NULL);
+ strvec_pushl(&cmd.args, "fetch", "--update-head-ok", NULL);
/* Shared options */
- argv_push_verbosity(&args);
+ argv_push_verbosity(&cmd.args);
if (opt_progress)
- strvec_push(&args, opt_progress);
+ strvec_push(&cmd.args, opt_progress);
/* Options passed to git-fetch */
if (opt_all)
- strvec_push(&args, opt_all);
+ strvec_push(&cmd.args, opt_all);
if (opt_append)
- strvec_push(&args, opt_append);
+ strvec_push(&cmd.args, opt_append);
if (opt_upload_pack)
- strvec_push(&args, opt_upload_pack);
- argv_push_force(&args);
+ strvec_push(&cmd.args, opt_upload_pack);
+ argv_push_force(&cmd.args);
if (opt_tags)
- strvec_push(&args, opt_tags);
+ strvec_push(&cmd.args, opt_tags);
if (opt_prune)
- strvec_push(&args, opt_prune);
+ strvec_push(&cmd.args, opt_prune);
if (recurse_submodules_cli != RECURSE_SUBMODULES_DEFAULT)
switch (recurse_submodules_cli) {
case RECURSE_SUBMODULES_ON:
- strvec_push(&args, "--recurse-submodules=on");
+ strvec_push(&cmd.args, "--recurse-submodules=on");
break;
case RECURSE_SUBMODULES_OFF:
- strvec_push(&args, "--recurse-submodules=no");
+ strvec_push(&cmd.args, "--recurse-submodules=no");
break;
case RECURSE_SUBMODULES_ON_DEMAND:
- strvec_push(&args, "--recurse-submodules=on-demand");
+ strvec_push(&cmd.args, "--recurse-submodules=on-demand");
break;
default:
BUG("submodule recursion option not understood");
}
if (max_children)
- strvec_push(&args, max_children);
+ strvec_push(&cmd.args, max_children);
if (opt_dry_run)
- strvec_push(&args, "--dry-run");
+ strvec_push(&cmd.args, "--dry-run");
if (opt_keep)
- strvec_push(&args, opt_keep);
+ strvec_push(&cmd.args, opt_keep);
if (opt_depth)
- strvec_push(&args, opt_depth);
+ strvec_push(&cmd.args, opt_depth);
if (opt_unshallow)
- strvec_push(&args, opt_unshallow);
+ strvec_push(&cmd.args, opt_unshallow);
if (opt_update_shallow)
- strvec_push(&args, opt_update_shallow);
+ strvec_push(&cmd.args, opt_update_shallow);
if (opt_refmap)
- strvec_push(&args, opt_refmap);
+ strvec_push(&cmd.args, opt_refmap);
if (opt_ipv4)
- strvec_push(&args, opt_ipv4);
+ strvec_push(&cmd.args, opt_ipv4);
if (opt_ipv6)
- strvec_push(&args, opt_ipv6);
+ strvec_push(&cmd.args, opt_ipv6);
if (opt_show_forced_updates > 0)
- strvec_push(&args, "--show-forced-updates");
+ strvec_push(&cmd.args, "--show-forced-updates");
else if (opt_show_forced_updates == 0)
- strvec_push(&args, "--no-show-forced-updates");
+ strvec_push(&cmd.args, "--no-show-forced-updates");
if (set_upstream)
- strvec_push(&args, set_upstream);
- strvec_pushv(&args, opt_fetch.v);
+ strvec_push(&cmd.args, set_upstream);
+ strvec_pushv(&cmd.args, opt_fetch.v);
if (repo) {
- strvec_push(&args, repo);
- strvec_pushv(&args, refspecs);
+ strvec_push(&cmd.args, repo);
+ strvec_pushv(&cmd.args, refspecs);
} else if (*refspecs)
BUG("refspecs without repo?");
- ret = run_command_v_opt(args.v, RUN_GIT_CMD | RUN_CLOSE_OBJECT_STORE);
- strvec_clear(&args);
- return ret;
+ cmd.git_cmd = 1;
+ cmd.close_object_store = 1;
+ return run_command(&cmd);
}
/**
@@ -653,52 +648,50 @@ static int update_submodules(void)
*/
static int run_merge(void)
{
- int ret;
- struct strvec args = STRVEC_INIT;
+ struct child_process cmd = CHILD_PROCESS_INIT;
- strvec_pushl(&args, "merge", NULL);
+ strvec_pushl(&cmd.args, "merge", NULL);
/* Shared options */
- argv_push_verbosity(&args);
+ argv_push_verbosity(&cmd.args);
if (opt_progress)
- strvec_push(&args, opt_progress);
+ strvec_push(&cmd.args, opt_progress);
/* Options passed to git-merge */
if (opt_diffstat)
- strvec_push(&args, opt_diffstat);
+ strvec_push(&cmd.args, opt_diffstat);
if (opt_log)
- strvec_push(&args, opt_log);
+ strvec_push(&cmd.args, opt_log);
if (opt_signoff)
- strvec_push(&args, opt_signoff);
+ strvec_push(&cmd.args, opt_signoff);
if (opt_squash)
- strvec_push(&args, opt_squash);
+ strvec_push(&cmd.args, opt_squash);
if (opt_commit)
- strvec_push(&args, opt_commit);
+ strvec_push(&cmd.args, opt_commit);
if (opt_edit)
- strvec_push(&args, opt_edit);
+ strvec_push(&cmd.args, opt_edit);
if (cleanup_arg)
- strvec_pushf(&args, "--cleanup=%s", cleanup_arg);
+ strvec_pushf(&cmd.args, "--cleanup=%s", cleanup_arg);
if (opt_ff)
- strvec_push(&args, opt_ff);
+ strvec_push(&cmd.args, opt_ff);
if (opt_verify)
- strvec_push(&args, opt_verify);
+ strvec_push(&cmd.args, opt_verify);
if (opt_verify_signatures)
- strvec_push(&args, opt_verify_signatures);
- strvec_pushv(&args, opt_strategies.v);
- strvec_pushv(&args, opt_strategy_opts.v);
+ strvec_push(&cmd.args, opt_verify_signatures);
+ strvec_pushv(&cmd.args, opt_strategies.v);
+ strvec_pushv(&cmd.args, opt_strategy_opts.v);
if (opt_gpg_sign)
- strvec_push(&args, opt_gpg_sign);
+ strvec_push(&cmd.args, opt_gpg_sign);
if (opt_autostash == 0)
- strvec_push(&args, "--no-autostash");
+ strvec_push(&cmd.args, "--no-autostash");
else if (opt_autostash == 1)
- strvec_push(&args, "--autostash");
+ strvec_push(&cmd.args, "--autostash");
if (opt_allow_unrelated_histories > 0)
- strvec_push(&args, "--allow-unrelated-histories");
+ strvec_push(&cmd.args, "--allow-unrelated-histories");
- strvec_push(&args, "FETCH_HEAD");
- ret = run_command_v_opt(args.v, RUN_GIT_CMD);
- strvec_clear(&args);
- return ret;
+ strvec_push(&cmd.args, "FETCH_HEAD");
+ cmd.git_cmd = 1;
+ return run_command(&cmd);
}
/**
@@ -822,7 +815,7 @@ static int get_octopus_merge_base(struct object_id *merge_base,
const struct object_id *merge_head,
const struct object_id *fork_point)
{
- struct commit_list *revs = NULL, *result;
+ struct commit_list *revs = NULL, *result = NULL;
commit_list_insert(lookup_commit_reference(the_repository, curr_head),
&revs);
@@ -832,7 +825,8 @@ static int get_octopus_merge_base(struct object_id *merge_base,
commit_list_insert(lookup_commit_reference(the_repository, fork_point),
&revs);
- result = get_octopus_merge_bases(revs);
+ if (get_octopus_merge_bases(revs, &result) < 0)
+ exit(128);
free_commit_list(revs);
reduce_heads_replace(&result);
@@ -879,43 +873,41 @@ static int get_rebase_newbase_and_upstream(struct object_id *newbase,
static int run_rebase(const struct object_id *newbase,
const struct object_id *upstream)
{
- int ret;
- struct strvec args = STRVEC_INIT;
+ struct child_process cmd = CHILD_PROCESS_INIT;
- strvec_push(&args, "rebase");
+ strvec_push(&cmd.args, "rebase");
/* Shared options */
- argv_push_verbosity(&args);
+ argv_push_verbosity(&cmd.args);
/* Options passed to git-rebase */
if (opt_rebase == REBASE_MERGES)
- strvec_push(&args, "--rebase-merges");
+ strvec_push(&cmd.args, "--rebase-merges");
else if (opt_rebase == REBASE_INTERACTIVE)
- strvec_push(&args, "--interactive");
+ strvec_push(&cmd.args, "--interactive");
if (opt_diffstat)
- strvec_push(&args, opt_diffstat);
- strvec_pushv(&args, opt_strategies.v);
- strvec_pushv(&args, opt_strategy_opts.v);
+ strvec_push(&cmd.args, opt_diffstat);
+ strvec_pushv(&cmd.args, opt_strategies.v);
+ strvec_pushv(&cmd.args, opt_strategy_opts.v);
if (opt_gpg_sign)
- strvec_push(&args, opt_gpg_sign);
+ strvec_push(&cmd.args, opt_gpg_sign);
if (opt_signoff)
- strvec_push(&args, opt_signoff);
+ strvec_push(&cmd.args, opt_signoff);
if (opt_autostash == 0)
- strvec_push(&args, "--no-autostash");
+ strvec_push(&cmd.args, "--no-autostash");
else if (opt_autostash == 1)
- strvec_push(&args, "--autostash");
+ strvec_push(&cmd.args, "--autostash");
if (opt_verify_signatures &&
!strcmp(opt_verify_signatures, "--verify-signatures"))
warning(_("ignoring --verify-signatures for rebase"));
- strvec_push(&args, "--onto");
- strvec_push(&args, oid_to_hex(newbase));
+ strvec_push(&cmd.args, "--onto");
+ strvec_push(&cmd.args, oid_to_hex(newbase));
- strvec_push(&args, oid_to_hex(upstream));
+ strvec_push(&cmd.args, oid_to_hex(upstream));
- ret = run_command_v_opt(args.v, RUN_GIT_CMD);
- strvec_clear(&args);
- return ret;
+ cmd.git_cmd = 1;
+ return run_command(&cmd);
}
static int get_can_ff(struct object_id *orig_head,
@@ -935,6 +927,8 @@ static int get_can_ff(struct object_id *orig_head,
merge_head = lookup_commit_reference(the_repository, orig_merge_head);
ret = repo_is_descendant_of(the_repository, merge_head, list);
free_commit_list(list);
+ if (ret < 0)
+ exit(128);
return ret;
}
@@ -959,6 +953,8 @@ static int already_up_to_date(struct object_id *orig_head,
commit_list_insert(theirs, &list);
ok = repo_is_descendant_of(the_repository, ours, list);
free_commit_list(list);
+ if (ok < 0)
+ exit(128);
if (!ok)
return 0;
}
@@ -990,6 +986,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
int rebase_unspecified = 0;
int can_ff;
int divergent;
+ int ret;
if (!getenv("GIT_REFLOG_ACTION"))
set_reflog_message(argc, argv);
@@ -1034,26 +1031,26 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
if (opt_rebase < 0)
opt_rebase = config_get_rebase(&rebase_unspecified);
- if (read_cache_unmerged())
+ if (repo_read_index_unmerged(the_repository))
die_resolve_conflict("pull");
if (file_exists(git_path_merge_head(the_repository)))
die_conclude_merge();
- if (get_oid("HEAD", &orig_head))
+ if (repo_get_oid(the_repository, "HEAD", &orig_head))
oidclr(&orig_head);
if (opt_rebase) {
if (opt_autostash == -1)
opt_autostash = config_autostash;
- if (is_null_oid(&orig_head) && !is_cache_unborn())
+ if (is_null_oid(&orig_head) && !is_index_unborn(&the_index))
die(_("Updating an unborn branch with changes added to the index."));
if (!opt_autostash)
require_clean_work_tree(the_repository,
N_("pull with rebase"),
- _("please commit or stash them."), 1, 0);
+ _("Please commit or stash them."), 1, 0);
if (get_rebase_fork_point(&rebase_fork_point, repo, *refspecs))
oidclr(&rebase_fork_point);
@@ -1065,7 +1062,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
if (opt_dry_run)
return 0;
- if (get_oid("HEAD", &curr_head))
+ if (repo_get_oid(the_repository, "HEAD", &curr_head))
oidclr(&curr_head);
if (!is_null_oid(&orig_head) && !is_null_oid(&curr_head) &&
@@ -1100,7 +1097,8 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
if (is_null_oid(&orig_head)) {
if (merge_heads.nr > 1)
die(_("Cannot merge multiple branches into empty head."));
- return pull_into_void(merge_heads.oid, &curr_head);
+ ret = pull_into_void(merge_heads.oid, &curr_head);
+ goto cleanup;
}
if (merge_heads.nr > 1) {
if (opt_rebase)
@@ -1125,8 +1123,6 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
}
if (opt_rebase) {
- int ret = 0;
-
struct object_id newbase;
struct object_id upstream;
get_rebase_newbase_and_upstream(&newbase, &upstream, &curr_head,
@@ -1149,12 +1145,16 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND))
ret = rebase_submodules();
- return ret;
+ goto cleanup;
} else {
- int ret = run_merge();
+ ret = run_merge();
if (!ret && (recurse_submodules == RECURSE_SUBMODULES_ON ||
recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND))
ret = update_submodules();
- return ret;
+ goto cleanup;
}
+
+cleanup:
+ oid_array_clear(&merge_heads);
+ return ret;
}
diff --git a/builtin/push.c b/builtin/push.c
index df0d68e..2fbb31c 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -1,19 +1,23 @@
/*
* "git push"
*/
-#include "cache.h"
+#include "builtin.h"
+#include "advice.h"
#include "branch.h"
#include "config.h"
-#include "refs.h"
+#include "environment.h"
+#include "gettext.h"
#include "refspec.h"
#include "run-command.h"
-#include "builtin.h"
#include "remote.h"
#include "transport.h"
#include "parse-options.h"
+#include "pkt-line.h"
+#include "repository.h"
#include "submodule.h"
#include "submodule-config.h"
#include "send-pack.h"
+#include "trace2.h"
#include "color.h"
static const char * const push_usage[] = {
@@ -63,16 +67,9 @@ static struct refspec rs = REFSPEC_INIT_PUSH;
static struct string_list push_options_config = STRING_LIST_INIT_DUP;
static void refspec_append_mapped(struct refspec *refspec, const char *ref,
- struct remote *remote, struct ref *local_refs)
+ struct remote *remote, struct ref *matched)
{
const char *branch_name;
- struct ref *matched = NULL;
-
- /* Does "ref" uniquely name our ref? */
- if (count_refspec_match(ref, local_refs, &matched) != 1) {
- refspec_append(refspec, ref);
- return;
- }
if (remote->push.nr) {
struct refspec_item query;
@@ -120,15 +117,28 @@ static void set_refspecs(const char **refs, int nr, const char *repo)
die(_("--delete only accepts plain target ref names"));
refspec_appendf(&rs, ":%s", ref);
} else if (!strchr(ref, ':')) {
- if (!remote) {
- /* lazily grab remote and local_refs */
- remote = remote_get(repo);
+ struct ref *matched = NULL;
+
+ /* lazily grab local_refs */
+ if (!local_refs)
local_refs = get_local_heads();
+
+ /* Does "ref" uniquely name our ref? */
+ if (count_refspec_match(ref, local_refs, &matched) != 1) {
+ refspec_append(&rs, ref);
+ } else {
+ /* lazily grab remote */
+ if (!remote)
+ remote = remote_get(repo);
+ if (!remote)
+ BUG("must get a remote for repo '%s'", repo);
+
+ refspec_append_mapped(&rs, ref, remote, matched);
}
- refspec_append_mapped(&rs, ref, remote, local_refs);
} else
refspec_append(&rs, ref);
}
+ free_refs(local_refs);
}
static int push_url_of_remote(struct remote *remote, const char ***url_p)
@@ -169,8 +179,8 @@ static NORETURN void die_push_simple(struct branch *branch,
if (git_branch_track != BRANCH_TRACK_SIMPLE)
advice_automergesimple_maybe = _("\n"
"To avoid automatically configuring "
- "upstream branches when their name\n"
- "doesn't match the local branch, see option "
+ "an upstream branch when its name\n"
+ "won't match the local branch, see option "
"'simple' of branch.autoSetupMerge\n"
"in 'git help config'.\n");
die(_("The upstream branch of your current branch does not match\n"
@@ -290,21 +300,21 @@ static void setup_default_push_refspecs(int *flags, struct remote *remote)
static const char message_advice_pull_before_push[] =
N_("Updates were rejected because the tip of your current branch is behind\n"
- "its remote counterpart. Integrate the remote changes (e.g.\n"
- "'git pull ...') before pushing again.\n"
+ "its remote counterpart. If you want to integrate the remote changes,\n"
+ "use 'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details.");
static const char message_advice_checkout_pull_push[] =
N_("Updates were rejected because a pushed branch tip is behind its remote\n"
- "counterpart. Check out this branch and integrate the remote changes\n"
- "(e.g. 'git pull ...') before pushing again.\n"
+ "counterpart. If you want to integrate the remote changes, use 'git pull'\n"
+ "before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details.");
static const char message_advice_ref_fetch_first[] =
- N_("Updates were rejected because the remote contains work that you do\n"
- "not have locally. This is usually caused by another repository pushing\n"
- "to the same ref. You may want to first integrate the remote changes\n"
- "(e.g., 'git pull ...') before pushing again.\n"
+ N_("Updates were rejected because the remote contains work that you do not\n"
+ "have locally. This is usually caused by another repository pushing to\n"
+ "the same ref. If you want to integrate the remote changes, use\n"
+ "'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details.");
static const char message_advice_ref_already_exists[] =
@@ -316,10 +326,10 @@ static const char message_advice_ref_needs_force[] =
"without using the '--force' option.\n");
static const char message_advice_ref_needs_update[] =
- N_("Updates were rejected because the tip of the remote-tracking\n"
- "branch has been updated since the last checkout. You may want\n"
- "to integrate those changes locally (e.g., 'git pull ...')\n"
- "before forcing an update.\n");
+ N_("Updates were rejected because the tip of the remote-tracking branch has\n"
+ "been updated since the last checkout. If you want to integrate the\n"
+ "remote changes, use 'git pull' before pushing again.\n"
+ "See the 'Note about fast-forwards' in 'git push --help' for details.");
static void advise_pull_before_push(void)
{
@@ -381,7 +391,7 @@ static int push_with_options(struct transport *transport, struct refspec *rs,
if (!is_empty_cas(&cas)) {
if (!transport->smart_options)
die("underlying transport does not support --%s option",
- CAS_OPT_NAME);
+ "force-with-lease");
transport->smart_options->cas = &cas;
}
@@ -466,8 +476,16 @@ static int option_parse_recurse_submodules(const struct option *opt,
if (unset)
*recurse_submodules = RECURSE_SUBMODULES_OFF;
- else
- *recurse_submodules = parse_push_recurse_submodules_arg(opt->long_name, arg);
+ else {
+ if (!strcmp(arg, "only-is-on-demand")) {
+ if (*recurse_submodules == RECURSE_SUBMODULES_ONLY) {
+ warning(_("recursing into submodule with push.recurseSubmodules=only; using on-demand instead"));
+ *recurse_submodules = RECURSE_SUBMODULES_ON_DEMAND;
+ }
+ } else {
+ *recurse_submodules = parse_push_recurse_submodules_arg(opt->long_name, arg);
+ }
+ }
return 0;
}
@@ -490,15 +508,11 @@ static void set_push_cert_flags(int *flags, int v)
}
-static int git_push_config(const char *k, const char *v, void *cb)
+static int git_push_config(const char *k, const char *v,
+ const struct config_context *ctx, void *cb)
{
const char *slot_name;
int *flags = cb;
- int status;
-
- status = git_gpg_config(k, v, NULL);
- if (status)
- return status;
if (!strcmp(k, "push.followtags")) {
if (git_config_bool(k, v))
@@ -511,26 +525,21 @@ static int git_push_config(const char *k, const char *v, void *cb)
*flags |= TRANSPORT_PUSH_AUTO_UPSTREAM;
return 0;
} else if (!strcmp(k, "push.gpgsign")) {
- const char *value;
- if (!git_config_get_value("push.gpgsign", &value)) {
- switch (git_parse_maybe_bool(value)) {
- case 0:
- set_push_cert_flags(flags, SEND_PACK_PUSH_CERT_NEVER);
- break;
- case 1:
- set_push_cert_flags(flags, SEND_PACK_PUSH_CERT_ALWAYS);
- break;
- default:
- if (value && !strcasecmp(value, "if-asked"))
- set_push_cert_flags(flags, SEND_PACK_PUSH_CERT_IF_ASKED);
- else
- return error(_("invalid value for '%s'"), k);
- }
+ switch (git_parse_maybe_bool(v)) {
+ case 0:
+ set_push_cert_flags(flags, SEND_PACK_PUSH_CERT_NEVER);
+ break;
+ case 1:
+ set_push_cert_flags(flags, SEND_PACK_PUSH_CERT_ALWAYS);
+ break;
+ default:
+ if (!strcasecmp(v, "if-asked"))
+ set_push_cert_flags(flags, SEND_PACK_PUSH_CERT_IF_ASKED);
+ else
+ return error(_("invalid value for '%s'"), k);
}
} else if (!strcmp(k, "push.recursesubmodules")) {
- const char *value;
- if (!git_config_get_value("push.recursesubmodules", &value))
- recurse_submodules = parse_push_recurse_submodules_arg(k, value);
+ recurse_submodules = parse_push_recurse_submodules_arg(k, v);
} else if (!strcmp(k, "submodule.recurse")) {
int val = git_config_bool(k, v) ?
RECURSE_SUBMODULES_ON_DEMAND : RECURSE_SUBMODULES_OFF;
@@ -562,7 +571,7 @@ static int git_push_config(const char *k, const char *v, void *cb)
return 0;
}
- return git_default_config(k, v, NULL);
+ return git_default_config(k, v, ctx, NULL);
}
int cmd_push(int argc, const char **argv, const char *prefix)
@@ -580,15 +589,16 @@ int cmd_push(int argc, const char **argv, const char *prefix)
struct option options[] = {
OPT__VERBOSITY(&verbosity),
OPT_STRING( 0 , "repo", &repo, N_("repository"), N_("repository")),
- OPT_BIT( 0 , "all", &flags, N_("push all refs"), TRANSPORT_PUSH_ALL),
+ OPT_BIT( 0 , "all", &flags, N_("push all branches"), TRANSPORT_PUSH_ALL),
+ OPT_ALIAS( 0 , "branches", "all"),
OPT_BIT( 0 , "mirror", &flags, N_("mirror all refs"),
(TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE)),
OPT_BOOL('d', "delete", &deleterefs, N_("delete refs")),
- OPT_BOOL( 0 , "tags", &tags, N_("push tags (can't be used with --all or --mirror)")),
+ OPT_BOOL( 0 , "tags", &tags, N_("push tags (can't be used with --all or --branches or --mirror)")),
OPT_BIT('n' , "dry-run", &flags, N_("dry run"), TRANSPORT_PUSH_DRY_RUN),
OPT_BIT( 0, "porcelain", &flags, N_("machine-readable output"), TRANSPORT_PUSH_PORCELAIN),
OPT_BIT('f', "force", &flags, N_("force updates"), TRANSPORT_PUSH_FORCE),
- OPT_CALLBACK_F(0, CAS_OPT_NAME, &cas, N_("<refname>:<expect>"),
+ OPT_CALLBACK_F(0, "force-with-lease", &cas, N_("<refname>:<expect>"),
N_("require old value of ref to be at this value"),
PARSE_OPT_OPTARG | PARSE_OPT_LITERAL_ARGHELP, parseopt_push_cas_option),
OPT_BIT(0, TRANS_OPT_FORCE_IF_INCLUDES, &flags,
@@ -611,10 +621,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
PARSE_OPT_OPTARG, option_parse_push_signed),
OPT_BIT(0, "atomic", &flags, N_("request atomic transaction on remote side"), TRANSPORT_PUSH_ATOMIC),
OPT_STRING_LIST('o', "push-option", &push_options_cmdline, N_("server-specific"), N_("option to transmit")),
- OPT_SET_INT('4', "ipv4", &family, N_("use IPv4 addresses only"),
- TRANSPORT_FAMILY_IPV4),
- OPT_SET_INT('6', "ipv6", &family, N_("use IPv6 addresses only"),
- TRANSPORT_FAMILY_IPV6),
+ OPT_IPVERSION(&family),
OPT_END()
};
@@ -626,8 +633,10 @@ int cmd_push(int argc, const char **argv, const char *prefix)
: &push_options_config);
set_push_cert_flags(&flags, push_cert);
- if (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))
- die(_("options '%s' and '%s' cannot be used together"), "--delete", "--all/--mirror/--tags");
+ die_for_incompatible_opt4(deleterefs, "--delete",
+ tags, "--tags",
+ flags & TRANSPORT_PUSH_ALL, "--all/--branches",
+ flags & TRANSPORT_PUSH_MIRROR, "--mirror");
if (deleterefs && argc < 2)
die(_("--delete doesn't make sense without any refs"));
@@ -664,19 +673,13 @@ int cmd_push(int argc, const char **argv, const char *prefix)
flags |= (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE);
if (flags & TRANSPORT_PUSH_ALL) {
- if (tags)
- die(_("options '%s' and '%s' cannot be used together"), "--all", "--tags");
if (argc >= 2)
die(_("--all can't be combined with refspecs"));
}
if (flags & TRANSPORT_PUSH_MIRROR) {
- if (tags)
- die(_("options '%s' and '%s' cannot be used together"), "--mirror", "--tags");
if (argc >= 2)
die(_("--mirror can't be combined with refspecs"));
}
- if ((flags & TRANSPORT_PUSH_ALL) && (flags & TRANSPORT_PUSH_MIRROR))
- die(_("options '%s' and '%s' cannot be used together"), "--all", "--mirror");
if (!is_empty_cas(&cas) && (flags & TRANSPORT_PUSH_FORCE_IF_INCLUDES))
cas.use_force_if_includes = 1;
diff --git a/builtin/range-diff.c b/builtin/range-diff.c
index 5031884..f02cbac 100644
--- a/builtin/range-diff.c
+++ b/builtin/range-diff.c
@@ -1,9 +1,10 @@
-#include "cache.h"
#include "builtin.h"
+#include "gettext.h"
+#include "object-name.h"
#include "parse-options.h"
#include "range-diff.h"
#include "config.h"
-#include "revision.h"
+#include "repository.h"
static const char * const builtin_range_diff_usage[] = {
N_("git range-diff [<options>] <old-base>..<old-tip> <new-base>..<new-tip>"),
@@ -38,16 +39,18 @@ int cmd_range_diff(int argc, const char **argv, const char *prefix)
OPT_END()
};
struct option *options;
- int res = 0;
+ int i, dash_dash = -1, res = 0;
struct strbuf range1 = STRBUF_INIT, range2 = STRBUF_INIT;
+ struct object_id oid;
+ const char *three_dots = NULL;
git_config(git_diff_ui_config, NULL);
repo_diff_setup(the_repository, &diffopt);
- options = parse_options_concat(range_diff_options, diffopt.parseopts);
+ options = add_diff_options(range_diff_options, &diffopt);
argc = parse_options(argc, argv, prefix, options,
- builtin_range_diff_usage, 0);
+ builtin_range_diff_usage, PARSE_OPT_KEEP_DASHDASH);
diff_setup_done(&diffopt);
@@ -55,40 +58,91 @@ int cmd_range_diff(int argc, const char **argv, const char *prefix)
if (!simple_color)
diffopt.use_color = 1;
- if (argc == 2) {
- if (!is_range_diff_range(argv[0]))
- die(_("not a commit range: '%s'"), argv[0]);
- strbuf_addstr(&range1, argv[0]);
+ for (i = 0; i < argc; i++)
+ if (!strcmp(argv[i], "--")) {
+ dash_dash = i;
+ break;
+ }
+
+ if (dash_dash == 3 ||
+ (dash_dash < 0 && argc > 2 &&
+ !repo_get_oid_committish(the_repository, argv[0], &oid) &&
+ !repo_get_oid_committish(the_repository, argv[1], &oid) &&
+ !repo_get_oid_committish(the_repository, argv[2], &oid))) {
+ if (dash_dash < 0)
+ ; /* already validated arguments */
+ else if (repo_get_oid_committish(the_repository, argv[0], &oid))
+ usage_msg_optf(_("not a revision: '%s'"),
+ builtin_range_diff_usage, options,
+ argv[0]);
+ else if (repo_get_oid_committish(the_repository, argv[1], &oid))
+ usage_msg_optf(_("not a revision: '%s'"),
+ builtin_range_diff_usage, options,
+ argv[1]);
+ else if (repo_get_oid_committish(the_repository, argv[2], &oid))
+ usage_msg_optf(_("not a revision: '%s'"),
+ builtin_range_diff_usage, options,
+ argv[2]);
- if (!is_range_diff_range(argv[1]))
- die(_("not a commit range: '%s'"), argv[1]);
- strbuf_addstr(&range2, argv[1]);
- } else if (argc == 3) {
strbuf_addf(&range1, "%s..%s", argv[0], argv[1]);
strbuf_addf(&range2, "%s..%s", argv[0], argv[2]);
- } else if (argc == 1) {
- const char *b = strstr(argv[0], "..."), *a = argv[0];
+
+ strvec_pushv(&other_arg, argv +
+ (dash_dash < 0 ? 3 : dash_dash));
+ } else if (dash_dash == 2 ||
+ (dash_dash < 0 && argc > 1 &&
+ is_range_diff_range(argv[0]) &&
+ is_range_diff_range(argv[1]))) {
+ if (dash_dash < 0)
+ ; /* already validated arguments */
+ else if (!is_range_diff_range(argv[0]))
+ usage_msg_optf(_("not a commit range: '%s'"),
+ builtin_range_diff_usage, options,
+ argv[0]);
+ else if (!is_range_diff_range(argv[1]))
+ usage_msg_optf(_("not a commit range: '%s'"),
+ builtin_range_diff_usage, options,
+ argv[1]);
+
+ strbuf_addstr(&range1, argv[0]);
+ strbuf_addstr(&range2, argv[1]);
+
+ strvec_pushv(&other_arg, argv +
+ (dash_dash < 0 ? 2 : dash_dash));
+ } else if (dash_dash == 1 ||
+ (dash_dash < 0 && argc > 0 &&
+ (three_dots = strstr(argv[0], "...")))) {
+ const char *a, *b;
int a_len;
- if (!b) {
- error(_("single arg format must be symmetric range"));
- usage_with_options(builtin_range_diff_usage, options);
- }
+ if (dash_dash < 0)
+ ; /* already validated arguments */
+ else if (!(three_dots = strstr(argv[0], "...")))
+ usage_msg_optf(_("not a symmetric range: '%s'"),
+ builtin_range_diff_usage, options,
+ argv[0]);
- a_len = (int)(b - a);
- if (!a_len) {
+ if (three_dots == argv[0]) {
a = "HEAD";
a_len = strlen(a);
+ } else {
+ a = argv[0];
+ a_len = (int)(three_dots - a);
}
- b += 3;
- if (!*b)
+
+ if (three_dots[3])
+ b = three_dots + 3;
+ else
b = "HEAD";
+
strbuf_addf(&range1, "%s..%.*s", b, a_len, a);
strbuf_addf(&range2, "%.*s..%s", a_len, a, b);
- } else {
- error(_("need two commit ranges"));
- usage_with_options(builtin_range_diff_usage, options);
- }
+
+ strvec_pushv(&other_arg, argv +
+ (dash_dash < 0 ? 1 : dash_dash));
+ } else
+ usage_msg_opt(_("need two commit ranges"),
+ builtin_range_diff_usage, options);
FREE_AND_NULL(options);
range_diff_opts.dual_color = simple_color < 1;
diff --git a/builtin/read-tree.c b/builtin/read-tree.c
index 9f1f33e..6f89cec 100644
--- a/builtin/read-tree.c
+++ b/builtin/read-tree.c
@@ -4,21 +4,24 @@
* Copyright (C) Linus Torvalds, 2005
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
+#define USE_THE_INDEX_VARIABLE
+#include "builtin.h"
#include "config.h"
+#include "gettext.h"
+#include "hex.h"
#include "lockfile.h"
#include "object.h"
+#include "object-name.h"
#include "tree.h"
#include "tree-walk.h"
#include "cache-tree.h"
#include "unpack-trees.h"
-#include "dir.h"
-#include "builtin.h"
#include "parse-options.h"
+#include "repository.h"
#include "resolve-undo.h"
+#include "setup.h"
+#include "sparse-index.h"
#include "submodule.h"
-#include "submodule-config.h"
static int nr_trees;
static int read_empty;
@@ -38,11 +41,13 @@ static int list_tree(struct object_id *oid)
}
static const char * const read_tree_usage[] = {
- N_("git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>) [-u | -i]] [--no-sparse-checkout] [--index-output=<file>] (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"),
+ N_("git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>)\n"
+ " [-u | -i]] [--index-output=<file>] [--no-sparse-checkout]\n"
+ " (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"),
NULL
};
-static int index_output_cb(const struct option *opt, const char *arg,
+static int index_output_cb(const struct option *opt UNUSED, const char *arg,
int unset)
{
BUG_ON_OPT_NEG(unset);
@@ -85,9 +90,9 @@ static int debug_merge(const struct cache_entry * const *stages,
{
int i;
- printf("* %d-way merge\n", o->merge_size);
+ printf("* %d-way merge\n", o->internal.merge_size);
debug_stage("index", stages[0], o);
- for (i = 1; i <= o->merge_size; i++) {
+ for (i = 1; i <= o->internal.merge_size; i++) {
char buf[24];
xsnprintf(buf, sizeof(buf), "ent#%d", i);
debug_stage(buf, stages[i], o);
@@ -95,12 +100,13 @@ static int debug_merge(const struct cache_entry * const *stages,
return 0;
}
-static int git_read_tree_config(const char *var, const char *value, void *cb)
+static int git_read_tree_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(var, "submodule.recurse"))
return git_default_submodule_config(var, value, cb);
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix)
@@ -112,6 +118,7 @@ int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix)
int prefix_set = 0;
struct lock_file lock_file = LOCK_INIT;
const struct option read_tree_options[] = {
+ OPT__SUPER_PREFIX(&opts.super_prefix),
OPT_CALLBACK_F(0, "index-output", NULL, N_("file"),
N_("write resulting index to <file>"),
PARSE_OPT_NONEG, index_output_cb),
@@ -141,7 +148,7 @@ int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix)
OPT__DRY_RUN(&opts.dry_run, N_("don't update the index or the work tree")),
OPT_BOOL(0, "no-sparse-checkout", &opts.skip_sparse_checkout,
N_("skip applying sparse checkout filter")),
- OPT_BOOL(0, "debug-unpack", &opts.debug_unpack,
+ OPT_BOOL(0, "debug-unpack", &opts.internal.debug_unpack,
N_("debug unpack-trees")),
OPT_CALLBACK_F(0, "recurse-submodules", NULL,
"checkout", "control recursive updating of submodules",
@@ -174,7 +181,7 @@ int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix)
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
- hold_locked_index(&lock_file, LOCK_DIE_ON_ERROR);
+ repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
/*
* NEEDSWORK
@@ -186,16 +193,16 @@ int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix)
*/
if (opts.reset || opts.merge || opts.prefix) {
- if (read_cache_unmerged() && (opts.prefix || opts.merge))
+ if (repo_read_index_unmerged(the_repository) && (opts.prefix || opts.merge))
die(_("You need to resolve your current index first"));
stage = opts.merge = 1;
}
- resolve_undo_clear();
+ resolve_undo_clear_index(&the_index);
for (i = 0; i < argc; i++) {
const char *arg = argv[i];
- if (get_oid(arg, &oid))
+ if (repo_get_oid(the_repository, arg, &oid))
die("Not a valid object name %s", arg);
if (list_tree(&oid) < 0)
die("failed to unpack tree object %s", arg);
@@ -230,7 +237,7 @@ int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix)
break;
case 2:
opts.fn = twoway_merge;
- opts.initial_checkout = is_cache_unborn();
+ opts.initial_checkout = is_index_unborn(&the_index);
break;
case 3:
default:
@@ -244,19 +251,24 @@ int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix)
opts.head_idx = 1;
}
- if (opts.debug_unpack)
+ if (opts.internal.debug_unpack)
opts.fn = debug_merge;
- cache_tree_free(&active_cache_tree);
+ /* If we're going to prime_cache_tree later, skip cache tree update */
+ if (nr_trees == 1 && !opts.prefix)
+ opts.skip_cache_tree_update = 1;
+
+ cache_tree_free(&the_index.cache_tree);
for (i = 0; i < nr_trees; i++) {
struct tree *tree = trees[i];
- parse_tree(tree);
- init_tree_desc(t+i, tree->buffer, tree->size);
+ if (parse_tree(tree) < 0)
+ return 128;
+ init_tree_desc(t+i, &tree->object.oid, tree->buffer, tree->size);
}
if (unpack_trees(nr_trees, t, &opts))
return 128;
- if (opts.debug_unpack || opts.dry_run)
+ if (opts.internal.debug_unpack || opts.dry_run)
return 0; /* do not write the index out */
/*
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 70aa7c8..891f284 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -4,20 +4,23 @@
* Copyright (c) 2018 Pratik Karki
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "run-command.h"
-#include "exec-cmd.h"
#include "strvec.h"
#include "dir.h"
-#include "packfile.h"
#include "refs.h"
-#include "quote.h"
#include "config.h"
-#include "cache-tree.h"
#include "unpack-trees.h"
#include "lockfile.h"
+#include "object-file.h"
+#include "object-name.h"
#include "parse-options.h"
+#include "path.h"
#include "commit.h"
#include "diff.h"
#include "wt-status.h"
@@ -28,10 +31,9 @@
#include "sequencer.h"
#include "rebase-interactive.h"
#include "reset.h"
+#include "trace2.h"
#include "hook.h"
-#define DEFAULT_REFLOG_ACTION "rebase"
-
static char const * const builtin_rebase_usage[] = {
N_("git rebase [-i] [options] [--exec <cmd>] "
"[--onto <newbase> | --keep-base] [<upstream> [<branch>]]"),
@@ -56,7 +58,27 @@ enum empty_type {
EMPTY_UNSPECIFIED = -1,
EMPTY_DROP,
EMPTY_KEEP,
- EMPTY_ASK
+ EMPTY_STOP
+};
+
+enum action {
+ ACTION_NONE = 0,
+ ACTION_CONTINUE,
+ ACTION_SKIP,
+ ACTION_ABORT,
+ ACTION_QUIT,
+ ACTION_EDIT_TODO,
+ ACTION_SHOW_CURRENT_PATCH
+};
+
+static const char *action_names[] = {
+ "undefined",
+ "continue",
+ "skip",
+ "abort",
+ "quit",
+ "edit_todo",
+ "show_current_patch"
};
struct rebase_options {
@@ -68,7 +90,7 @@ struct rebase_options {
const char *upstream_name;
const char *upstream_arg;
char *head_name;
- struct object_id orig_head;
+ struct commit *orig_head;
struct commit *onto;
const char *onto_name;
const char *revisions;
@@ -85,7 +107,8 @@ struct rebase_options {
REBASE_INTERACTIVE_EXPLICIT = 1<<4,
} flags;
struct strvec git_am_opts;
- const char *action;
+ enum action action;
+ char *reflog_action;
int signoff;
int allow_rerere_autoupdate;
int keep_empty;
@@ -94,14 +117,19 @@ struct rebase_options {
int autostash;
int committer_date_is_author_date;
int ignore_date;
- char *cmd;
+ struct string_list exec;
int allow_empty_message;
int rebase_merges, rebase_cousins;
- char *strategy, *strategy_opts;
+ char *strategy;
+ struct string_list strategy_opts;
struct strbuf git_format_patch_opt;
int reschedule_failed_exec;
int reapply_cherry_picks;
int fork_point;
+ int update_refs;
+ int config_autosquash;
+ int config_rebase_merges;
+ int config_update_refs;
};
#define REBASE_OPTIONS_INIT { \
@@ -111,8 +139,17 @@ struct rebase_options {
.default_backend = "merge", \
.flags = REBASE_NO_QUIET, \
.git_am_opts = STRVEC_INIT, \
+ .exec = STRING_LIST_INIT_NODUP, \
.git_format_patch_opt = STRBUF_INIT, \
.fork_point = -1, \
+ .reapply_cherry_picks = -1, \
+ .allow_empty_message = 1, \
+ .autosquash = -1, \
+ .rebase_merges = -1, \
+ .config_rebase_merges = -1, \
+ .update_refs = -1, \
+ .config_update_refs = -1, \
+ .strategy_opts = STRING_LIST_INIT_NODUP,\
}
static struct replay_opts get_replay_opts(const struct rebase_options *opts)
@@ -138,6 +175,7 @@ static struct replay_opts get_replay_opts(const struct rebase_options *opts)
opts->committer_date_is_author_date;
replay.ignore_date = opts->ignore_date;
replay.gpg_sign = xstrdup_or_null(opts->gpg_sign_opt);
+ replay.reflog_action = xstrdup(opts->reflog_action);
if (opts->strategy)
replay.strategy = xstrdup_or_null(opts->strategy);
else if (!replay.strategy && replay.default_strategy) {
@@ -145,8 +183,8 @@ static struct replay_opts get_replay_opts(const struct rebase_options *opts)
replay.default_strategy = NULL;
}
- if (opts->strategy_opts)
- parse_strategy_opts(&replay, opts->strategy_opts);
+ for (size_t i = 0; i < opts->strategy_opts.nr; i++)
+ strvec_push(&replay.xopts, opts->strategy_opts.items[i].string);
if (opts->squash_onto) {
oidcpy(&replay.squash_onto, opts->squash_onto);
@@ -156,24 +194,6 @@ static struct replay_opts get_replay_opts(const struct rebase_options *opts)
return replay;
}
-enum action {
- ACTION_NONE = 0,
- ACTION_CONTINUE,
- ACTION_SKIP,
- ACTION_ABORT,
- ACTION_QUIT,
- ACTION_EDIT_TODO,
- ACTION_SHOW_CURRENT_PATCH
-};
-
-static const char *action_names[] = { "undefined",
- "continue",
- "skip",
- "abort",
- "quit",
- "edit_todo",
- "show_current_patch" };
-
static int edit_todo_file(unsigned flags)
{
const char *todo_file = rebase_path_todo();
@@ -184,7 +204,7 @@ static int edit_todo_file(unsigned flags)
if (strbuf_read_file(&todo_list.buf, todo_file, 0) < 0)
return error_errno(_("could not read '%s'."), todo_file);
- strbuf_stripspace(&todo_list.buf, 1);
+ strbuf_stripspace(&todo_list.buf, comment_line_str);
res = edit_todo_list(the_repository, &todo_list, &new_todo, NULL, NULL, flags);
if (!res && todo_list_write_to_file(the_repository, &new_todo, todo_file,
NULL, NULL, -1, flags & ~(TODO_LIST_SHORTEN_IDS)))
@@ -206,13 +226,15 @@ static int get_revision_ranges(struct commit *upstream, struct commit *onto,
*revisions = xstrfmt("%s...%s", oid_to_hex(&base_rev->object.oid),
oid_to_hex(orig_head));
- shorthead = find_unique_abbrev(orig_head, DEFAULT_ABBREV);
+ shorthead = repo_find_unique_abbrev(the_repository, orig_head,
+ DEFAULT_ABBREV);
if (upstream) {
const char *shortrev;
- shortrev = find_unique_abbrev(&base_rev->object.oid,
- DEFAULT_ABBREV);
+ shortrev = repo_find_unique_abbrev(the_repository,
+ &base_rev->object.oid,
+ DEFAULT_ABBREV);
*shortrevisions = xstrfmt("%s..%s", shortrev, shorthead);
} else
@@ -240,38 +262,22 @@ static int init_basic_state(struct replay_opts *opts, const char *head_name,
return write_basic_state(opts, head_name, onto, orig_head);
}
-static void split_exec_commands(const char *cmd, struct string_list *commands)
-{
- if (cmd && *cmd) {
- string_list_split(commands, cmd, '\n', -1);
-
- /* rebase.c adds a new line to cmd after every command,
- * so here the last command is always empty */
- string_list_remove_empty_items(commands, 0);
- }
-}
-
static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)
{
- int ret;
+ int ret = -1;
char *revisions = NULL, *shortrevisions = NULL;
struct strvec make_script_args = STRVEC_INIT;
struct todo_list todo_list = TODO_LIST_INIT;
struct replay_opts replay = get_replay_opts(opts);
- struct string_list commands = STRING_LIST_INIT_DUP;
- if (get_revision_ranges(opts->upstream, opts->onto, &opts->orig_head,
+ if (get_revision_ranges(opts->upstream, opts->onto, &opts->orig_head->object.oid,
&revisions, &shortrevisions))
- return -1;
+ goto cleanup;
if (init_basic_state(&replay,
opts->head_name ? opts->head_name : "detached HEAD",
- opts->onto, &opts->orig_head)) {
- free(revisions);
- free(shortrevisions);
-
- return -1;
- }
+ opts->onto, &opts->orig_head->object.oid))
+ goto cleanup;
if (!opts->upstream && opts->squash_onto)
write_file(path_squash_onto(), "%s\n",
@@ -289,19 +295,19 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)
if (ret)
error(_("could not generate todo list"));
else {
- discard_cache();
+ discard_index(&the_index);
if (todo_list_parse_insn_buffer(the_repository, todo_list.buf.buf,
&todo_list))
BUG("unusable todo list");
- split_exec_commands(opts->cmd, &commands);
ret = complete_action(the_repository, &replay, flags,
shortrevisions, opts->onto_name, opts->onto,
- &opts->orig_head, &commands, opts->autosquash,
- &todo_list);
+ &opts->orig_head->object.oid, &opts->exec,
+ opts->autosquash, opts->update_refs, &todo_list);
}
- string_list_clear(&commands, 0);
+cleanup:
+ replay_opts_release(&replay);
free(revisions);
free(shortrevisions);
todo_list_release(&todo_list);
@@ -310,8 +316,7 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)
return ret;
}
-static int run_sequencer_rebase(struct rebase_options *opts,
- enum action command)
+static int run_sequencer_rebase(struct rebase_options *opts)
{
unsigned flags = 0;
int abbreviate_commands = 0, ret = 0;
@@ -326,7 +331,7 @@ static int run_sequencer_rebase(struct rebase_options *opts,
flags |= opts->reapply_cherry_picks ? TODO_LIST_REAPPLY_CHERRY_PICKS : 0;
flags |= opts->flags & REBASE_NO_QUIET ? TODO_LIST_WARN_SKIPPED_CHERRY_PICKS : 0;
- switch (command) {
+ switch (opts->action) {
case ACTION_NONE: {
if (!opts->onto && !opts->upstream)
die(_("a base commit must be provided with --upstream or --onto"));
@@ -344,6 +349,7 @@ static int run_sequencer_rebase(struct rebase_options *opts,
struct replay_opts replay_opts = get_replay_opts(opts);
ret = sequencer_continue(the_repository, &replay_opts);
+ replay_opts_release(&replay_opts);
break;
}
case ACTION_EDIT_TODO:
@@ -359,26 +365,12 @@ static int run_sequencer_rebase(struct rebase_options *opts,
break;
}
default:
- BUG("invalid command '%d'", command);
+ BUG("invalid command '%d'", opts->action);
}
return ret;
}
-static void imply_merge(struct rebase_options *opts, const char *option);
-static int parse_opt_keep_empty(const struct option *opt, const char *arg,
- int unset)
-{
- struct rebase_options *opts = opt->value;
-
- BUG_ON_OPT_ARG(arg);
-
- imply_merge(opts, unset ? "--no-keep-empty" : "--keep-empty");
- opts->keep_empty = !unset;
- opts->type = REBASE_MERGE;
- return 0;
-}
-
static int is_merge(struct rebase_options *opts)
{
return opts->type == REBASE_MERGE;
@@ -429,9 +421,9 @@ static int read_basic_state(struct rebase_options *opts)
opts->head_name = starts_with(head_name.buf, "refs/") ?
xstrdup(head_name.buf) : NULL;
strbuf_release(&head_name);
- if (get_oid(buf.buf, &oid))
- return error(_("could not get 'onto': '%s'"), buf.buf);
- opts->onto = lookup_commit_or_die(&oid, buf.buf);
+ if (get_oid_hex(buf.buf, &oid) ||
+ !(opts->onto = lookup_commit_object(the_repository, &oid)))
+ return error(_("invalid onto: '%s'"), buf.buf);
/*
* We always write to orig-head, but interactive rebase used to write to
@@ -446,7 +438,8 @@ static int read_basic_state(struct rebase_options *opts)
} else if (!read_oneliner(&buf, state_dir_path("head", opts),
READ_ONELINER_WARN_MISSING))
return -1;
- if (get_oid(buf.buf, &opts->orig_head))
+ if (get_oid_hex(buf.buf, &oid) ||
+ !(opts->orig_head = lookup_commit_object(the_repository, &oid)))
return error(_("invalid orig-head: '%s'"), buf.buf);
if (file_exists(state_dir_path("quiet", opts)))
@@ -485,24 +478,6 @@ static int read_basic_state(struct rebase_options *opts)
opts->gpg_sign_opt = xstrdup(buf.buf);
}
- if (file_exists(state_dir_path("strategy", opts))) {
- strbuf_reset(&buf);
- if (!read_oneliner(&buf, state_dir_path("strategy", opts),
- READ_ONELINER_WARN_MISSING))
- return -1;
- free(opts->strategy);
- opts->strategy = xstrdup(buf.buf);
- }
-
- if (file_exists(state_dir_path("strategy_opts", opts))) {
- strbuf_reset(&buf);
- if (!read_oneliner(&buf, state_dir_path("strategy_opts", opts),
- READ_ONELINER_WARN_MISSING))
- return -1;
- free(opts->strategy_opts);
- opts->strategy_opts = xstrdup(buf.buf);
- }
-
strbuf_release(&buf);
return 0;
@@ -515,17 +490,11 @@ static int rebase_write_basic_state(struct rebase_options *opts)
write_file(state_dir_path("onto", opts), "%s",
opts->onto ? oid_to_hex(&opts->onto->object.oid) : "");
write_file(state_dir_path("orig-head", opts), "%s",
- oid_to_hex(&opts->orig_head));
+ oid_to_hex(&opts->orig_head->object.oid));
if (!(opts->flags & REBASE_NO_QUIET))
write_file(state_dir_path("quiet", opts), "%s", "");
if (opts->flags & REBASE_VERBOSE)
write_file(state_dir_path("verbose", opts), "%s", "");
- if (opts->strategy)
- write_file(state_dir_path("strategy", opts), "%s",
- opts->strategy);
- if (opts->strategy_opts)
- write_file(state_dir_path("strategy_opts", opts), "%s",
- opts->strategy_opts);
if (opts->allow_rerere_autoupdate > 0)
write_file(state_dir_path("allow_rerere_autoupdate", opts),
"-%s-rerere-autoupdate",
@@ -546,7 +515,7 @@ static int finish_rebase(struct rebase_options *opts)
int ret = 0;
delete_ref(NULL, "REBASE_HEAD", NULL, REF_NO_DEREF);
- unlink(git_path_auto_merge(the_repository));
+ delete_ref(NULL, "AUTO_MERGE", NULL, REF_NO_DEREF);
apply_autostash(state_dir_path("autostash", opts));
/*
* We ignore errors in 'git maintenance run --auto', since the
@@ -558,6 +527,7 @@ static int finish_rebase(struct rebase_options *opts)
replay.action = REPLAY_INTERACTIVE_REBASE;
ret = sequencer_remove_state(&replay);
+ replay_opts_release(&replay);
} else {
strbuf_addstr(&dir, opts->state_dir);
if (remove_dir_recursively(&dir, 0))
@@ -581,10 +551,11 @@ static int move_to_original_branch(struct rebase_options *opts)
if (!opts->onto)
BUG("move_to_original_branch without onto");
- strbuf_addf(&branch_reflog, "rebase finished: %s onto %s",
+ strbuf_addf(&branch_reflog, "%s (finish): %s onto %s",
+ opts->reflog_action,
opts->head_name, oid_to_hex(&opts->onto->object.oid));
- strbuf_addf(&head_reflog, "rebase finished: returning to %s",
- opts->head_name);
+ strbuf_addf(&head_reflog, "%s (finish): returning to %s",
+ opts->reflog_action, opts->head_name);
ropts.branch = opts->head_name;
ropts.flags = RESET_HEAD_REFS_ONLY;
ropts.branch_msg = branch_reflog.buf;
@@ -596,27 +567,20 @@ static int move_to_original_branch(struct rebase_options *opts)
return ret;
}
-static const char *resolvemsg =
-N_("Resolve all conflicts manually, mark them as resolved with\n"
-"\"git add/rm <conflicted_files>\", then run \"git rebase --continue\".\n"
-"You can instead skip this commit: run \"git rebase --skip\".\n"
-"To abort and get back to the state before \"git rebase\", run "
-"\"git rebase --abort\".");
-
static int run_am(struct rebase_options *opts)
{
struct child_process am = CHILD_PROCESS_INIT;
struct child_process format_patch = CHILD_PROCESS_INIT;
- struct strbuf revisions = STRBUF_INIT;
int status;
char *rebased_patches;
am.git_cmd = 1;
strvec_push(&am.args, "am");
-
- if (opts->action && !strcmp("continue", opts->action)) {
+ strvec_pushf(&am.env, GIT_REFLOG_ACTION_ENVIRONMENT "=%s (pick)",
+ opts->reflog_action);
+ if (opts->action == ACTION_CONTINUE) {
strvec_push(&am.args, "--resolved");
- strvec_pushf(&am.args, "--resolvemsg=%s", resolvemsg);
+ strvec_pushf(&am.args, "--resolvemsg=%s", rebase_resolvemsg);
if (opts->gpg_sign_opt)
strvec_push(&am.args, opts->gpg_sign_opt);
status = run_command(&am);
@@ -625,27 +589,20 @@ static int run_am(struct rebase_options *opts)
return move_to_original_branch(opts);
}
- if (opts->action && !strcmp("skip", opts->action)) {
+ if (opts->action == ACTION_SKIP) {
strvec_push(&am.args, "--skip");
- strvec_pushf(&am.args, "--resolvemsg=%s", resolvemsg);
+ strvec_pushf(&am.args, "--resolvemsg=%s", rebase_resolvemsg);
status = run_command(&am);
if (status)
return status;
return move_to_original_branch(opts);
}
- if (opts->action && !strcmp("show-current-patch", opts->action)) {
+ if (opts->action == ACTION_SHOW_CURRENT_PATCH) {
strvec_push(&am.args, "--show-current-patch");
return run_command(&am);
}
- strbuf_addf(&revisions, "%s...%s",
- oid_to_hex(opts->root ?
- /* this is now equivalent to !opts->upstream */
- &opts->onto->object.oid :
- &opts->upstream->object.oid),
- oid_to_hex(&opts->orig_head));
-
rebased_patches = xstrdup(git_path("rebased-patches"));
format_patch.out = open(rebased_patches,
O_WRONLY | O_CREAT | O_TRUNC, 0666);
@@ -653,20 +610,25 @@ static int run_am(struct rebase_options *opts)
status = error_errno(_("could not open '%s' for writing"),
rebased_patches);
free(rebased_patches);
- strvec_clear(&am.args);
+ child_process_clear(&am);
return status;
}
format_patch.git_cmd = 1;
strvec_pushl(&format_patch.args, "format-patch", "-k", "--stdout",
"--full-index", "--cherry-pick", "--right-only",
- "--src-prefix=a/", "--dst-prefix=b/", "--no-renames",
+ "--default-prefix", "--no-renames",
"--no-cover-letter", "--pretty=mboxrd", "--topo-order",
"--no-base", NULL);
if (opts->git_format_patch_opt.len)
strvec_split(&format_patch.args,
opts->git_format_patch_opt.buf);
- strvec_push(&format_patch.args, revisions.buf);
+ strvec_pushf(&format_patch.args, "%s...%s",
+ oid_to_hex(opts->root ?
+ /* this is now equivalent to !opts->upstream */
+ &opts->onto->object.oid :
+ &opts->upstream->object.oid),
+ oid_to_hex(&opts->orig_head->object.oid));
if (opts->restrict_revision)
strvec_pushf(&format_patch.args, "^%s",
oid_to_hex(&opts->restrict_revision->object.oid));
@@ -676,11 +638,11 @@ static int run_am(struct rebase_options *opts)
struct reset_head_opts ropts = { 0 };
unlink(rebased_patches);
free(rebased_patches);
- strvec_clear(&am.args);
+ child_process_clear(&am);
- ropts.oid = &opts->orig_head;
+ ropts.oid = &opts->orig_head->object.oid;
ropts.branch = opts->head_name;
- ropts.default_reflog_action = DEFAULT_REFLOG_ACTION;
+ ropts.default_reflog_action = opts->reflog_action;
reset_head(the_repository, &ropts);
error(_("\ngit encountered an error while preparing the "
"patches to replay\n"
@@ -689,23 +651,21 @@ static int run_am(struct rebase_options *opts)
"As a result, git cannot rebase them."),
opts->revisions);
- strbuf_release(&revisions);
return status;
}
- strbuf_release(&revisions);
am.in = open(rebased_patches, O_RDONLY);
if (am.in < 0) {
status = error_errno(_("could not open '%s' for reading"),
rebased_patches);
free(rebased_patches);
- strvec_clear(&am.args);
+ child_process_clear(&am);
return status;
}
strvec_pushv(&am.args, opts->git_am_opts.v);
strvec_push(&am.args, "--rebasing");
- strvec_pushf(&am.args, "--resolvemsg=%s", resolvemsg);
+ strvec_pushf(&am.args, "--resolvemsg=%s", rebase_resolvemsg);
strvec_push(&am.args, "--patch-format=mboxrd");
if (opts->allow_rerere_autoupdate == RERERE_AUTOUPDATE)
strvec_push(&am.args, "--rerere-autoupdate");
@@ -727,17 +687,14 @@ static int run_am(struct rebase_options *opts)
return status;
}
-static int run_specific_rebase(struct rebase_options *opts, enum action action)
+static int run_specific_rebase(struct rebase_options *opts)
{
int status;
if (opts->type == REBASE_MERGE) {
/* Run sequencer-based rebase */
- setenv("GIT_CHERRY_PICK_HELP", resolvemsg, 1);
- if (!(opts->flags & REBASE_INTERACTIVE_EXPLICIT)) {
+ if (!(opts->flags & REBASE_INTERACTIVE_EXPLICIT))
setenv("GIT_SEQUENCE_EDITOR", ":", 1);
- opts->autosquash = 0;
- }
if (opts->gpg_sign_opt) {
/* remove the leading "-S" */
char *tmp = xstrdup(opts->gpg_sign_opt + 2);
@@ -745,7 +702,7 @@ static int run_specific_rebase(struct rebase_options *opts, enum action action)
opts->gpg_sign_opt = tmp;
}
- status = run_sequencer_rebase(opts, action);
+ status = run_sequencer_rebase(opts);
} else if (opts->type == REBASE_APPLY)
status = run_am(opts);
else
@@ -771,7 +728,18 @@ static int run_specific_rebase(struct rebase_options *opts, enum action action)
return status ? -1 : 0;
}
-static int rebase_config(const char *var, const char *value, void *data)
+static void parse_rebase_merges_value(struct rebase_options *options, const char *value)
+{
+ if (!strcmp("no-rebase-cousins", value))
+ options->rebase_cousins = 0;
+ else if (!strcmp("rebase-cousins", value))
+ options->rebase_cousins = 1;
+ else
+ die(_("Unknown rebase-merges mode: %s"), value);
+}
+
+static int rebase_config(const char *var, const char *value,
+ const struct config_context *ctx, void *data)
{
struct rebase_options *opts = data;
@@ -784,7 +752,7 @@ static int rebase_config(const char *var, const char *value, void *data)
}
if (!strcmp(var, "rebase.autosquash")) {
- opts->autosquash = git_config_bool(var, value);
+ opts->config_autosquash = git_config_bool(var, value);
return 0;
}
@@ -800,6 +768,22 @@ static int rebase_config(const char *var, const char *value, void *data)
return 0;
}
+ if (!strcmp(var, "rebase.rebasemerges")) {
+ opts->config_rebase_merges = git_parse_maybe_bool(value);
+ if (opts->config_rebase_merges < 0) {
+ opts->config_rebase_merges = 1;
+ parse_rebase_merges_value(opts, value);
+ } else {
+ opts->rebase_cousins = 0;
+ }
+ return 0;
+ }
+
+ if (!strcmp(var, "rebase.updaterefs")) {
+ opts->config_update_refs = git_config_bool(var, value);
+ return 0;
+ }
+
if (!strcmp(var, "rebase.reschedulefailedexec")) {
opts->reschedule_failed_exec = git_config_bool(var, value);
return 0;
@@ -814,7 +798,7 @@ static int rebase_config(const char *var, const char *value, void *data)
return git_config_string(&opts->default_backend, var, value);
}
- return git_default_config(var, value, data);
+ return git_default_config(var, value, ctx, data);
}
static int checkout_up_to_date(struct rebase_options *options)
@@ -824,9 +808,8 @@ static int checkout_up_to_date(struct rebase_options *options)
int ret = 0;
strbuf_addf(&buf, "%s: checkout %s",
- getenv(GIT_REFLOG_ACTION_ENVIRONMENT),
- options->switch_to);
- ropts.oid = &options->orig_head;
+ options->reflog_action, options->switch_to);
+ ropts.oid = &options->orig_head->object.oid;
ropts.branch = options->head_name;
ropts.flags = RESET_HEAD_RUN_POST_CHECKOUT_HOOK;
if (!ropts.branch)
@@ -847,7 +830,7 @@ static int checkout_up_to_date(struct rebase_options *options)
static int is_linear_history(struct commit *from, struct commit *to)
{
while (to && to != from) {
- parse_commit(to);
+ repo_parse_commit(the_repository, to);
if (!to->parents)
return 1;
if (to->parents->next)
@@ -859,33 +842,25 @@ static int is_linear_history(struct commit *from, struct commit *to)
static int can_fast_forward(struct commit *onto, struct commit *upstream,
struct commit *restrict_revision,
- struct object_id *head_oid, struct object_id *merge_base)
+ struct commit *head, struct object_id *branch_base)
{
- struct commit *head = lookup_commit(the_repository, head_oid);
struct commit_list *merge_bases = NULL;
int res = 0;
- if (!head)
- goto done;
+ if (is_null_oid(branch_base))
+ goto done; /* fill_branch_base() found multiple merge bases */
- merge_bases = get_merge_bases(onto, head);
- if (!merge_bases || merge_bases->next) {
- oidcpy(merge_base, null_oid());
+ if (!oideq(branch_base, &onto->object.oid))
goto done;
- }
- oidcpy(merge_base, &merge_bases->item->object.oid);
- if (!oideq(merge_base, &onto->object.oid))
- goto done;
-
- if (restrict_revision && !oideq(&restrict_revision->object.oid, merge_base))
+ if (restrict_revision && !oideq(&restrict_revision->object.oid, branch_base))
goto done;
if (!upstream)
goto done;
- free_commit_list(merge_bases);
- merge_bases = get_merge_bases(upstream, head);
+ if (repo_get_merge_bases(the_repository, upstream, head, &merge_bases) < 0)
+ exit(128);
if (!merge_bases || merge_bases->next)
goto done;
@@ -899,6 +874,22 @@ done:
return res && is_linear_history(onto, head);
}
+static void fill_branch_base(struct rebase_options *options,
+ struct object_id *branch_base)
+{
+ struct commit_list *merge_bases = NULL;
+
+ if (repo_get_merge_bases(the_repository, options->onto,
+ options->orig_head, &merge_bases) < 0)
+ exit(128);
+ if (!merge_bases || merge_bases->next)
+ oidcpy(branch_base, null_oid());
+ else
+ oidcpy(branch_base, &merge_bases->item->object.oid);
+
+ free_commit_list(merge_bases);
+}
+
static int parse_opt_am(const struct option *opt, const char *arg, int unset)
{
struct rebase_options *opts = opt->value;
@@ -906,6 +897,9 @@ static int parse_opt_am(const struct option *opt, const char *arg, int unset)
BUG_ON_OPT_NEG(unset);
BUG_ON_OPT_ARG(arg);
+ if (opts->type != REBASE_UNSPECIFIED && opts->type != REBASE_APPLY)
+ die(_("apply options and merge options cannot be used together"));
+
opts->type = REBASE_APPLY;
return 0;
@@ -919,8 +913,10 @@ static int parse_opt_merge(const struct option *opt, const char *arg, int unset)
BUG_ON_OPT_NEG(unset);
BUG_ON_OPT_ARG(arg);
- if (!is_merge(opts))
- opts->type = REBASE_MERGE;
+ if (opts->type != REBASE_UNSPECIFIED && opts->type != REBASE_MERGE)
+ die(_("apply options and merge options cannot be used together"));
+
+ opts->type = REBASE_MERGE;
return 0;
}
@@ -934,6 +930,9 @@ static int parse_opt_interactive(const struct option *opt, const char *arg,
BUG_ON_OPT_NEG(unset);
BUG_ON_OPT_ARG(arg);
+ if (opts->type != REBASE_UNSPECIFIED && opts->type != REBASE_MERGE)
+ die(_("apply options and merge options cannot be used together"));
+
opts->type = REBASE_MERGE;
opts->flags |= REBASE_INTERACTIVE_EXPLICIT;
@@ -946,10 +945,26 @@ static enum empty_type parse_empty_value(const char *value)
return EMPTY_DROP;
else if (!strcasecmp(value, "keep"))
return EMPTY_KEEP;
- else if (!strcasecmp(value, "ask"))
- return EMPTY_ASK;
+ else if (!strcasecmp(value, "stop"))
+ return EMPTY_STOP;
+ else if (!strcasecmp(value, "ask")) {
+ warning(_("--empty=ask is deprecated; use '--empty=stop' instead."));
+ return EMPTY_STOP;
+ }
+
+ die(_("unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and \"stop\"."), value);
+}
+
+static int parse_opt_keep_empty(const struct option *opt, const char *arg,
+ int unset)
+{
+ struct rebase_options *opts = opt->value;
+
+ BUG_ON_OPT_ARG(arg);
- die(_("unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and \"ask\"."), value);
+ imply_merge(opts, unset ? "--no-keep-empty" : "--keep-empty");
+ opts->keep_empty = !unset;
+ return 0;
}
static int parse_opt_empty(const struct option *opt, const char *arg, int unset)
@@ -963,6 +978,28 @@ static int parse_opt_empty(const struct option *opt, const char *arg, int unset)
return 0;
}
+static int parse_opt_rebase_merges(const struct option *opt, const char *arg, int unset)
+{
+ struct rebase_options *options = opt->value;
+
+ options->rebase_merges = !unset;
+ options->rebase_cousins = 0;
+
+ if (arg) {
+ if (!*arg) {
+ warning(_("--rebase-merges with an empty string "
+ "argument is deprecated and will stop "
+ "working in a future version of Git. Use "
+ "--rebase-merges without an argument "
+ "instead, which does the same thing."));
+ return 0;
+ }
+ parse_rebase_merges_value(options, arg);
+ }
+
+ return 0;
+}
+
static void NORETURN error_on_missing_default_upstream(void)
{
struct branch *current_branch = branch_get(NULL);
@@ -993,23 +1030,6 @@ static void NORETURN error_on_missing_default_upstream(void)
exit(1);
}
-static void set_reflog_action(struct rebase_options *options)
-{
- const char *env;
- struct strbuf buf = STRBUF_INIT;
-
- if (!is_merge(options))
- return;
-
- env = getenv(GIT_REFLOG_ACTION_ENVIRONMENT);
- if (env && strcmp("rebase", env))
- return; /* only override it if it is "rebase" */
-
- strbuf_addf(&buf, "rebase (%s)", options->action);
- setenv(GIT_REFLOG_ACTION_ENVIRONMENT, buf.buf, 1);
- strbuf_release(&buf);
-}
-
static int check_exec_cmd(const char *cmd)
{
if (strchr(cmd, '\n'))
@@ -1032,15 +1052,12 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
struct strbuf msg = STRBUF_INIT;
struct strbuf revisions = STRBUF_INIT;
struct strbuf buf = STRBUF_INIT;
- struct object_id merge_base;
+ struct object_id branch_base;
int ignore_whitespace = 0;
- enum action action = ACTION_NONE;
const char *gpg_sign = NULL;
- struct string_list exec = STRING_LIST_INIT_NODUP;
- const char *rebase_merges = NULL;
- struct string_list strategy_options = STRING_LIST_INIT_NODUP;
struct object_id squash_onto;
char *squash_onto_name = NULL;
+ char *keep_base_onto_name = NULL;
int reschedule_failed_exec = -1;
int allow_preemptive_ff = 1;
int preserve_merges_selected = 0;
@@ -1083,18 +1100,18 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
OPT_BIT(0, "no-ff", &options.flags,
N_("cherry-pick all commits, even if unchanged"),
REBASE_FORCE),
- OPT_CMDMODE(0, "continue", &action, N_("continue"),
+ OPT_CMDMODE(0, "continue", &options.action, N_("continue"),
ACTION_CONTINUE),
- OPT_CMDMODE(0, "skip", &action,
+ OPT_CMDMODE(0, "skip", &options.action,
N_("skip current patch and continue"), ACTION_SKIP),
- OPT_CMDMODE(0, "abort", &action,
+ OPT_CMDMODE(0, "abort", &options.action,
N_("abort and check out the original branch"),
ACTION_ABORT),
- OPT_CMDMODE(0, "quit", &action,
+ OPT_CMDMODE(0, "quit", &options.action,
N_("abort but keep HEAD where it is"), ACTION_QUIT),
- OPT_CMDMODE(0, "edit-todo", &action, N_("edit the todo list "
+ OPT_CMDMODE(0, "edit-todo", &options.action, N_("edit the todo list "
"during an interactive rebase"), ACTION_EDIT_TODO),
- OPT_CMDMODE(0, "show-current-patch", &action,
+ OPT_CMDMODE(0, "show-current-patch", &options.action,
N_("show the patch file being applied or merged"),
ACTION_SHOW_CURRENT_PATCH),
OPT_CALLBACK_F(0, "apply", &options, NULL,
@@ -1114,7 +1131,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
"instead of ignoring them"),
1, PARSE_OPT_HIDDEN),
OPT_RERERE_AUTOUPDATE(&options.allow_rerere_autoupdate),
- OPT_CALLBACK_F(0, "empty", &options, "{drop,keep,ask}",
+ OPT_CALLBACK_F(0, "empty", &options, "(drop|keep|stop)",
N_("how to handle commits that become empty"),
PARSE_OPT_NONEG, parse_opt_empty),
OPT_CALLBACK_F('k', "keep-empty", &options, NULL,
@@ -1124,26 +1141,28 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
OPT_BOOL(0, "autosquash", &options.autosquash,
N_("move commits that begin with "
"squash!/fixup! under -i")),
+ OPT_BOOL(0, "update-refs", &options.update_refs,
+ N_("update branches that point to commits "
+ "that are being rebased")),
{ OPTION_STRING, 'S', "gpg-sign", &gpg_sign, N_("key-id"),
N_("GPG-sign commits"),
PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
OPT_AUTOSTASH(&options.autostash),
- OPT_STRING_LIST('x', "exec", &exec, N_("exec"),
+ OPT_STRING_LIST('x', "exec", &options.exec, N_("exec"),
N_("add exec lines after each commit of the "
"editable list")),
OPT_BOOL_F(0, "allow-empty-message",
&options.allow_empty_message,
N_("allow rebasing commits with empty messages"),
PARSE_OPT_HIDDEN),
- {OPTION_STRING, 'r', "rebase-merges", &rebase_merges,
- N_("mode"),
+ OPT_CALLBACK_F('r', "rebase-merges", &options, N_("mode"),
N_("try to rebase merges instead of skipping them"),
- PARSE_OPT_OPTARG, NULL, (intptr_t)""},
+ PARSE_OPT_OPTARG, parse_opt_rebase_merges),
OPT_BOOL(0, "fork-point", &options.fork_point,
N_("use 'merge-base --fork-point' to refine upstream")),
OPT_STRING('s', "strategy", &options.strategy,
N_("strategy"), N_("use the given merge strategy")),
- OPT_STRING_LIST('X', "strategy-option", &strategy_options,
+ OPT_STRING_LIST('X', "strategy-option", &options.strategy_opts,
N_("option"),
N_("pass the argument through to the merge "
"strategy")),
@@ -1165,7 +1184,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
- options.allow_empty_message = 1;
git_config(rebase_config, &options);
/* options.gpg_sign_opt will be either "-S" or NULL */
gpg_sign = options.gpg_sign_opt ? "" : NULL;
@@ -1182,7 +1200,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
} else if (is_directory(merge_dir())) {
strbuf_reset(&buf);
strbuf_addf(&buf, "%s/rewritten", merge_dir());
- if (!(action == ACTION_ABORT) && is_directory(buf.buf)) {
+ if (!(options.action == ACTION_ABORT) && is_directory(buf.buf)) {
die(_("`rebase --preserve-merges` (-p) is no longer supported.\n"
"Use `git rebase --abort` to terminate current rebase.\n"
"Or downgrade to v2.33, or earlier, to complete the rebase."));
@@ -1209,7 +1227,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
"Note: Your `pull.rebase` configuration may also be set to 'preserve',\n"
"which is no longer supported; use 'merges' instead"));
- if (action != ACTION_NONE && total_argc != 2) {
+ if (options.action != ACTION_NONE && total_argc != 2) {
usage_with_options(builtin_rebase_usage,
builtin_rebase_options);
}
@@ -1223,42 +1241,47 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
die(_("options '%s' and '%s' cannot be used together"), "--keep-base", "--onto");
if (options.root)
die(_("options '%s' and '%s' cannot be used together"), "--keep-base", "--root");
+ /*
+ * --keep-base defaults to --no-fork-point to keep the
+ * base the same.
+ */
+ if (options.fork_point < 0)
+ options.fork_point = 0;
}
-
if (options.root && options.fork_point > 0)
die(_("options '%s' and '%s' cannot be used together"), "--root", "--fork-point");
- if (action != ACTION_NONE && !in_progress)
- die(_("No rebase in progress?"));
- setenv(GIT_REFLOG_ACTION_ENVIRONMENT, "rebase", 0);
+ if (options.action != ACTION_NONE && !in_progress)
+ die(_("no rebase in progress"));
- if (action == ACTION_EDIT_TODO && !is_merge(&options))
+ if (options.action == ACTION_EDIT_TODO && !is_merge(&options))
die(_("The --edit-todo action can only be used during "
"interactive rebase."));
if (trace2_is_enabled()) {
if (is_merge(&options))
trace2_cmd_mode("interactive");
- else if (exec.nr)
+ else if (options.exec.nr)
trace2_cmd_mode("interactive-exec");
else
- trace2_cmd_mode(action_names[action]);
+ trace2_cmd_mode(action_names[options.action]);
}
- switch (action) {
+ options.reflog_action = getenv(GIT_REFLOG_ACTION_ENVIRONMENT);
+ options.reflog_action =
+ xstrdup(options.reflog_action ? options.reflog_action : "rebase");
+
+ switch (options.action) {
case ACTION_CONTINUE: {
struct object_id head;
struct lock_file lock_file = LOCK_INIT;
int fd;
- options.action = "continue";
- set_reflog_action(&options);
-
/* Sanity check */
- if (get_oid("HEAD", &head))
+ if (repo_get_oid(the_repository, "HEAD", &head))
die(_("Cannot read HEAD"));
- fd = hold_locked_index(&lock_file, 0);
+ fd = repo_hold_locked_index(the_repository, &lock_file, 0);
if (repo_read_index(the_repository) < 0)
die(_("could not read index"));
refresh_index(the_repository->index, REFRESH_QUIET, NULL, NULL,
@@ -1279,9 +1302,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
case ACTION_SKIP: {
struct string_list merge_rr = STRING_LIST_INIT_DUP;
- options.action = "skip";
- set_reflog_action(&options);
-
rerere_clear(the_repository, &merge_rr);
string_list_clear(&merge_rr, 1);
ropts.flags = RESET_HEAD_HARD;
@@ -1294,21 +1314,26 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
}
case ACTION_ABORT: {
struct string_list merge_rr = STRING_LIST_INIT_DUP;
- options.action = "abort";
- set_reflog_action(&options);
+ struct strbuf head_msg = STRBUF_INIT;
rerere_clear(the_repository, &merge_rr);
string_list_clear(&merge_rr, 1);
if (read_basic_state(&options))
exit(1);
- ropts.oid = &options.orig_head;
+
+ strbuf_addf(&head_msg, "%s (abort): returning to %s",
+ options.reflog_action,
+ options.head_name ? options.head_name
+ : oid_to_hex(&options.orig_head->object.oid));
+ ropts.oid = &options.orig_head->object.oid;
+ ropts.head_msg = head_msg.buf;
ropts.branch = options.head_name;
ropts.flags = RESET_HEAD_HARD;
- ropts.default_reflog_action = DEFAULT_REFLOG_ACTION;
if (reset_head(the_repository, &ropts) < 0)
die(_("could not move back to %s"),
- oid_to_hex(&options.orig_head));
+ oid_to_hex(&options.orig_head->object.oid));
+ strbuf_release(&head_msg);
remove_branch_state(the_repository, 0);
ret = finish_rebase(&options);
goto cleanup;
@@ -1320,6 +1345,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
replay.action = REPLAY_INTERACTIVE_REBASE;
ret = sequencer_remove_state(&replay);
+ replay_opts_release(&replay);
} else {
strbuf_reset(&buf);
strbuf_addstr(&buf, options.state_dir);
@@ -1331,17 +1357,15 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
goto cleanup;
}
case ACTION_EDIT_TODO:
- options.action = "edit-todo";
options.dont_finish_rebase = 1;
goto run_rebase;
case ACTION_SHOW_CURRENT_PATCH:
- options.action = "show-current-patch";
options.dont_finish_rebase = 1;
goto run_rebase;
case ACTION_NONE:
break;
default:
- BUG("action: %d", action);
+ BUG("action: %d", options.action);
}
/* Make sure no rebase is in progress */
@@ -1365,9 +1389,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
}
if ((options.flags & REBASE_INTERACTIVE_EXPLICIT) ||
- (action != ACTION_NONE) ||
- (exec.nr > 0) ||
- options.autosquash) {
+ (options.action != ACTION_NONE) ||
+ (options.exec.nr > 0) ||
+ options.autosquash == 1) {
allow_preemptive_ff = 0;
}
if (options.committer_date_is_author_date || options.ignore_date)
@@ -1390,8 +1414,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
}
}
- for (i = 0; i < exec.nr; i++)
- if (check_exec_cmd(exec.items[i].string))
+ for (i = 0; i < options.exec.nr; i++)
+ if (check_exec_cmd(options.exec.items[i].string))
exit(1);
if (!(options.flags & REBASE_NO_QUIET))
@@ -1400,34 +1424,34 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
if (options.empty != EMPTY_UNSPECIFIED)
imply_merge(&options, "--empty");
- if (options.reapply_cherry_picks)
- imply_merge(&options, "--reapply-cherry-picks");
+ if (options.reapply_cherry_picks < 0)
+ /*
+ * We default to --no-reapply-cherry-picks unless
+ * --keep-base is given; when --keep-base is given, we want
+ * to default to --reapply-cherry-picks.
+ */
+ options.reapply_cherry_picks = keep_base;
+ else if (!keep_base)
+ /*
+ * The apply backend always searches for and drops cherry
+ * picks. This is often not wanted with --keep-base, so
+ * --keep-base allows --reapply-cherry-picks to be
+ * simulated by altering the upstream such that
+ * cherry-picks cannot be detected and thus all commits are
+ * reapplied. Thus, --[no-]reapply-cherry-picks is
+ * supported when --keep-base is specified, but not when
+ * --keep-base is left out.
+ */
+ imply_merge(&options, options.reapply_cherry_picks ?
+ "--reapply-cherry-picks" :
+ "--no-reapply-cherry-picks");
if (gpg_sign)
options.gpg_sign_opt = xstrfmt("-S%s", gpg_sign);
- if (exec.nr) {
- int i;
-
+ if (options.exec.nr)
imply_merge(&options, "--exec");
- strbuf_reset(&buf);
- for (i = 0; i < exec.nr; i++)
- strbuf_addf(&buf, "exec %s\n", exec.items[i].string);
- options.cmd = xstrdup(buf.buf);
- }
-
- if (rebase_merges) {
- if (!*rebase_merges)
- ; /* default mode; do nothing */
- else if (!strcmp("rebase-cousins", rebase_merges))
- options.rebase_cousins = 1;
- else if (strcmp("no-rebase-cousins", rebase_merges))
- die(_("Unknown mode: %s"), rebase_merges);
- options.rebase_merges = 1;
- imply_merge(&options, "--rebase-merges");
- }
-
if (options.type == REBASE_APPLY) {
if (ignore_whitespace)
strvec_push(&options.git_am_opts,
@@ -1440,43 +1464,19 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
} else {
/* REBASE_MERGE */
if (ignore_whitespace) {
- string_list_append(&strategy_options,
+ string_list_append(&options.strategy_opts,
"ignore-space-change");
}
}
- if (strategy_options.nr) {
- int i;
-
- if (!options.strategy)
- options.strategy = "ort";
-
- strbuf_reset(&buf);
- for (i = 0; i < strategy_options.nr; i++)
- strbuf_addf(&buf, " --%s",
- strategy_options.items[i].string);
- options.strategy_opts = xstrdup(buf.buf);
- }
+ if (options.strategy_opts.nr && !options.strategy)
+ options.strategy = "ort";
if (options.strategy) {
options.strategy = xstrdup(options.strategy);
- switch (options.type) {
- case REBASE_APPLY:
- die(_("--strategy requires --merge or --interactive"));
- case REBASE_MERGE:
- /* compatible */
- break;
- case REBASE_UNSPECIFIED:
- options.type = REBASE_MERGE;
- break;
- default:
- BUG("unhandled rebase type (%d)", options.type);
- }
+ imply_merge(&options, "--strategy");
}
- if (options.type == REBASE_MERGE)
- imply_merge(&options, "--merge");
-
if (options.root && !options.onto_name)
imply_merge(&options, "--root without --onto");
@@ -1489,18 +1489,40 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
if (strcmp(options.git_am_opts.v[i], "-q"))
break;
- if (i >= 0) {
+ if (i >= 0 || options.type == REBASE_APPLY) {
if (is_merge(&options))
die(_("apply options and merge options "
"cannot be used together"));
+ else if (options.rebase_merges == -1 && options.config_rebase_merges == 1)
+ die(_("apply options are incompatible with rebase.rebaseMerges. Consider adding --no-rebase-merges"));
+ else if (options.update_refs == -1 && options.config_update_refs == 1)
+ die(_("apply options are incompatible with rebase.updateRefs. Consider adding --no-update-refs"));
else
options.type = REBASE_APPLY;
}
}
+ if (options.update_refs == 1)
+ imply_merge(&options, "--update-refs");
+ options.update_refs = (options.update_refs >= 0) ? options.update_refs :
+ ((options.config_update_refs >= 0) ? options.config_update_refs : 0);
+
+ if (options.rebase_merges == 1)
+ imply_merge(&options, "--rebase-merges");
+ options.rebase_merges = (options.rebase_merges >= 0) ? options.rebase_merges :
+ ((options.config_rebase_merges >= 0) ? options.config_rebase_merges : 0);
+
+ if (options.autosquash == 1) {
+ imply_merge(&options, "--autosquash");
+ } else if (options.autosquash == -1) {
+ options.autosquash =
+ options.config_autosquash &&
+ (options.flags & REBASE_INTERACTIVE_EXPLICIT);
+ }
+
if (options.type == REBASE_UNSPECIFIED) {
if (!strcmp(options.default_backend, "merge"))
- imply_merge(&options, "--merge");
+ options.type = REBASE_MERGE;
else if (!strcmp(options.default_backend, "apply"))
options.type = REBASE_APPLY;
else
@@ -1526,8 +1548,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
if (options.empty == EMPTY_UNSPECIFIED) {
if (options.flags & REBASE_INTERACTIVE_EXPLICIT)
- options.empty = EMPTY_ASK;
- else if (exec.nr > 0)
+ options.empty = EMPTY_STOP;
+ else if (options.exec.nr > 0)
options.empty = EMPTY_KEEP;
else
options.empty = EMPTY_DROP;
@@ -1594,25 +1616,27 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
*/
if (argc == 1) {
/* Is it "rebase other branchname" or "rebase other commit"? */
+ struct object_id branch_oid;
branch_name = argv[0];
options.switch_to = argv[0];
/* Is it a local branch? */
strbuf_reset(&buf);
strbuf_addf(&buf, "refs/heads/%s", branch_name);
- if (!read_ref(buf.buf, &options.orig_head)) {
+ if (!read_ref(buf.buf, &branch_oid)) {
die_if_checked_out(buf.buf, 1);
options.head_name = xstrdup(buf.buf);
+ options.orig_head =
+ lookup_commit_object(the_repository,
+ &branch_oid);
/* If not is it a valid ref (branch or commit)? */
} else {
- struct commit *commit =
+ options.orig_head =
lookup_commit_reference_by_name(branch_name);
- if (!commit)
- die(_("no such branch/commit '%s'"),
- branch_name);
- oidcpy(&options.orig_head, &commit->object.oid);
options.head_name = NULL;
}
+ if (!options.orig_head)
+ die(_("no such branch/commit '%s'"), branch_name);
} else if (argc == 0) {
/* Do not need to switch branches, we are already on it. */
options.head_name =
@@ -1629,8 +1653,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
FREE_AND_NULL(options.head_name);
branch_name = "HEAD";
}
- if (get_oid("HEAD", &options.orig_head))
- die(_("Could not resolve HEAD to a revision"));
+ options.orig_head = lookup_commit_reference_by_name("HEAD");
+ if (!options.orig_head)
+ die(_("Could not resolve HEAD to a commit"));
} else
BUG("unexpected number of arguments left to parse");
@@ -1640,11 +1665,11 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
strbuf_addstr(&buf, options.upstream_name);
strbuf_addstr(&buf, "...");
strbuf_addstr(&buf, branch_name);
- options.onto_name = xstrdup(buf.buf);
+ options.onto_name = keep_base_onto_name = xstrdup(buf.buf);
} else if (!options.onto_name)
options.onto_name = options.upstream_name;
if (strstr(options.onto_name, "...")) {
- if (get_oid_mb(options.onto_name, &merge_base) < 0) {
+ if (repo_get_oid_mb(the_repository, options.onto_name, &branch_base) < 0) {
if (keep_base)
die(_("'%s': need exactly one merge base with branch"),
options.upstream_name);
@@ -1652,7 +1677,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
die(_("'%s': need exactly one merge base"),
options.onto_name);
}
- options.onto = lookup_commit_or_die(&merge_base,
+ options.onto = lookup_commit_or_die(&branch_base,
options.onto_name);
} else {
options.onto =
@@ -1660,15 +1685,15 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
if (!options.onto)
die(_("Does not point to a valid commit '%s'"),
options.onto_name);
+ fill_branch_base(&options, &branch_base);
}
- if (options.fork_point > 0) {
- struct commit *head =
- lookup_commit_reference(the_repository,
- &options.orig_head);
+ if (keep_base && options.reapply_cherry_picks)
+ options.upstream = options.onto;
+
+ if (options.fork_point > 0)
options.restrict_revision =
- get_fork_point(options.upstream_name, head);
- }
+ get_fork_point(options.upstream_name, options.orig_head);
if (repo_read_index(the_repository) < 0)
die(_("could not read index"));
@@ -1693,13 +1718,10 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
* Check if we are already based on onto with linear history,
* in which case we could fast-forward without replacing the commits
* with new commits recreated by replaying their changes.
- *
- * Note that can_fast_forward() initializes merge_base, so we have to
- * call it before checking allow_preemptive_ff.
*/
- if (can_fast_forward(options.onto, options.upstream, options.restrict_revision,
- &options.orig_head, &merge_base) &&
- allow_preemptive_ff) {
+ if (allow_preemptive_ff &&
+ can_fast_forward(options.onto, options.upstream, options.restrict_revision,
+ options.orig_head, &branch_base)) {
int flag;
if (!(options.flags & REBASE_FORCE)) {
@@ -1740,25 +1762,24 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
struct diff_options opts;
if (options.flags & REBASE_VERBOSE) {
- if (is_null_oid(&merge_base))
+ if (is_null_oid(&branch_base))
printf(_("Changes to %s:\n"),
oid_to_hex(&options.onto->object.oid));
else
printf(_("Changes from %s to %s:\n"),
- oid_to_hex(&merge_base),
+ oid_to_hex(&branch_base),
oid_to_hex(&options.onto->object.oid));
}
/* We want color (if set), but no pager */
- diff_setup(&opts);
- opts.stat_width = -1; /* use full terminal width */
- opts.stat_graph_width = -1; /* respect statGraphWidth config */
+ repo_diff_setup(the_repository, &opts);
+ init_diffstat_widths(&opts);
opts.output_format |=
DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT;
opts.detect_rename = DIFF_DETECT_RENAME;
diff_setup_done(&opts);
- diff_tree_oid(is_null_oid(&merge_base) ?
- the_hash_algo->empty_tree : &merge_base,
+ diff_tree_oid(is_null_oid(&branch_base) ?
+ the_hash_algo->empty_tree : &branch_base,
&options.onto->object.oid, "", &opts);
diffcore_std(&opts);
diff_flush(&opts);
@@ -1772,14 +1793,14 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
printf(_("First, rewinding head to replay your work on top of "
"it...\n"));
- strbuf_addf(&msg, "%s: checkout %s",
- getenv(GIT_REFLOG_ACTION_ENVIRONMENT), options.onto_name);
+ strbuf_addf(&msg, "%s (start): checkout %s",
+ options.reflog_action, options.onto_name);
ropts.oid = &options.onto->object.oid;
- ropts.orig_head = &options.orig_head,
+ ropts.orig_head = &options.orig_head->object.oid,
ropts.flags = RESET_HEAD_DETACH | RESET_ORIG_HEAD |
RESET_HEAD_RUN_POST_CHECKOUT_HOOK;
ropts.head_msg = msg.buf;
- ropts.default_reflog_action = DEFAULT_REFLOG_ACTION;
+ ropts.default_reflog_action = options.reflog_action;
if (reset_head(the_repository, &ropts))
die(_("Could not detach HEAD"));
strbuf_release(&msg);
@@ -1788,19 +1809,10 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
* If the onto is a proper descendant of the tip of the branch, then
* we just fast-forwarded.
*/
- strbuf_reset(&msg);
- if (oideq(&merge_base, &options.orig_head)) {
+ if (oideq(&branch_base, &options.orig_head->object.oid)) {
printf(_("Fast-forwarded %s to %s.\n"),
branch_name, options.onto_name);
- strbuf_addf(&msg, "rebase finished: %s onto %s",
- options.head_name ? options.head_name : "detached HEAD",
- oid_to_hex(&options.onto->object.oid));
- memset(&ropts, 0, sizeof(ropts));
- ropts.branch = options.head_name;
- ropts.flags = RESET_HEAD_REFS_ONLY;
- ropts.head_msg = msg.buf;
- reset_head(the_repository, &ropts);
- strbuf_release(&msg);
+ move_to_original_branch(&options);
ret = finish_rebase(&options);
goto cleanup;
}
@@ -1810,21 +1822,25 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
(options.restrict_revision ?
oid_to_hex(&options.restrict_revision->object.oid) :
oid_to_hex(&options.upstream->object.oid)),
- oid_to_hex(&options.orig_head));
+ oid_to_hex(&options.orig_head->object.oid));
options.revisions = revisions.buf;
run_rebase:
- ret = run_specific_rebase(&options, action);
+ ret = run_specific_rebase(&options);
cleanup:
strbuf_release(&buf);
strbuf_release(&revisions);
+ free(options.reflog_action);
free(options.head_name);
+ strvec_clear(&options.git_am_opts);
free(options.gpg_sign_opt);
- free(options.cmd);
+ string_list_clear(&options.exec, 0);
free(options.strategy);
+ string_list_clear(&options.strategy_opts, 0);
strbuf_release(&options.git_format_patch_opt);
free(squash_onto_name);
+ free(keep_base_onto_name);
return !!ret;
}
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 31b48e7..56d8a77 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -1,6 +1,10 @@
#include "builtin.h"
+#include "abspath.h"
#include "repository.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "lockfile.h"
#include "pack.h"
#include "refs.h"
@@ -18,18 +22,23 @@
#include "connected.h"
#include "strvec.h"
#include "version.h"
-#include "tag.h"
#include "gpg-interface.h"
#include "sigchain.h"
#include "fsck.h"
#include "tmp-objdir.h"
#include "oidset.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "path.h"
#include "protocol.h"
#include "commit-reach.h"
+#include "server-info.h"
+#include "trace.h"
+#include "trace2.h"
#include "worktree.h"
#include "shallow.h"
+#include "parse-options.h"
static const char * const receive_pack_usage[] = {
N_("git receive-pack <git-dir>"),
@@ -80,6 +89,7 @@ static struct object_id push_cert_oid;
static struct signature_check sigcheck;
static const char *push_cert_nonce;
static const char *cert_nonce_seed;
+static struct strvec hidden_refs = STRVEC_INIT;
static const char *NONCE_UNSOLICITED = "UNSOLICITED";
static const char *NONCE_BAD = "BAD";
@@ -128,17 +138,15 @@ static enum deny_action parse_deny_action(const char *var, const char *value)
return DENY_IGNORE;
}
-static int receive_pack_config(const char *var, const char *value, void *cb)
+static int receive_pack_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
- int status = parse_hide_refs_config(var, value, "receive");
+ const char *msg_id;
+ int status = parse_hide_refs_config(var, value, "receive", &hidden_refs);
if (status)
return status;
- status = git_gpg_config(var, value, NULL);
- if (status)
- return status;
-
if (strcmp(var, "receive.denydeletes") == 0) {
deny_deletes = git_config_bool(var, value);
return 0;
@@ -150,12 +158,12 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
}
if (strcmp(var, "receive.unpacklimit") == 0) {
- receive_unpack_limit = git_config_int(var, value);
+ receive_unpack_limit = git_config_int(var, value, ctx->kvi);
return 0;
}
if (strcmp(var, "transfer.unpacklimit") == 0) {
- transfer_unpack_limit = git_config_int(var, value);
+ transfer_unpack_limit = git_config_int(var, value, ctx->kvi);
return 0;
}
@@ -170,12 +178,14 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
return 0;
}
- if (skip_prefix(var, "receive.fsck.", &var)) {
- if (is_valid_msg_type(var, value))
+ if (skip_prefix(var, "receive.fsck.", &msg_id)) {
+ 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 ? ',' : '=', var, value);
+ fsck_msg_types.len ? ',' : '=', msg_id, value);
else
- warning("skipping unknown msg id '%s'", var);
+ warning("skipping unknown msg id '%s'", msg_id);
return 0;
}
@@ -223,7 +233,7 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
return git_config_string(&cert_nonce_seed, var, value);
if (strcmp(var, "receive.certnonceslop") == 0) {
- nonce_stamp_slop_limit = git_config_ulong(var, value);
+ nonce_stamp_slop_limit = git_config_ulong(var, value, ctx->kvi);
return 0;
}
@@ -238,12 +248,12 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
}
if (strcmp(var, "receive.keepalive") == 0) {
- keepalive_in_sec = git_config_int(var, value);
+ keepalive_in_sec = git_config_int(var, value, ctx->kvi);
return 0;
}
if (strcmp(var, "receive.maxinputsize") == 0) {
- max_input_size = git_config_int64(var, value);
+ max_input_size = git_config_int64(var, value, ctx->kvi);
return 0;
}
@@ -259,7 +269,7 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
static void show_ref(const char *path, const struct object_id *oid)
@@ -291,12 +301,12 @@ static void show_ref(const char *path, const struct object_id *oid)
}
static int show_ref_cb(const char *path_full, const struct object_id *oid,
- int flag, void *data)
+ int flag UNUSED, void *data)
{
struct oidset *seen = data;
const char *path = strip_namespace(path_full);
- if (ref_is_hidden(path, path_full))
+ if (ref_is_hidden(path, path_full, &hidden_refs))
return 0;
/*
@@ -330,7 +340,9 @@ static void write_head_info(void)
{
static struct oidset seen = OIDSET_INIT;
- for_each_ref(show_ref_cb, &seen);
+ refs_for_each_fullref_in(get_main_ref_store(the_repository), "",
+ hidden_refs_to_excludes(&hidden_refs),
+ show_ref_cb, &seen);
for_each_alternate_ref(show_one_alternate_ref, &seen);
oidset_clear(&seen);
if (!sent_capabilities)
@@ -465,7 +477,7 @@ static void rp_error(const char *err, ...)
va_end(params);
}
-static int copy_to_sideband(int in, int out, void *arg)
+static int copy_to_sideband(int in, int out UNUSED, void *arg UNUSED)
{
char data[128];
int keepalive_active = 0;
@@ -581,21 +593,6 @@ static char *prepare_push_cert_nonce(const char *path, timestamp_t stamp)
return strbuf_detach(&buf, NULL);
}
-static char *find_header(const char *msg, size_t len, const char *key,
- const char **next_line)
-{
- size_t out_len;
- const char *val = find_header_mem(msg, len, key, &out_len);
-
- if (!val)
- return NULL;
-
- if (next_line)
- *next_line = val + out_len + 1;
-
- return xmemdupz(val, out_len);
-}
-
/*
* Return zero if a and b are equal up to n bytes and nonzero if they are not.
* This operation is guaranteed to run in constant time to avoid leaking data.
@@ -610,13 +607,14 @@ static int constant_memequal(const char *a, const char *b, size_t n)
return res;
}
-static const char *check_nonce(const char *buf, size_t len)
+static const char *check_nonce(const char *buf)
{
- char *nonce = find_header(buf, len, "nonce", NULL);
+ size_t noncelen;
+ const char *found = find_commit_header(buf, "nonce", &noncelen);
+ char *nonce = found ? xmemdupz(found, noncelen) : NULL;
timestamp_t stamp, ostamp;
char *bohmac, *expect = NULL;
const char *retval = NONCE_BAD;
- size_t noncelen;
if (!nonce) {
retval = NONCE_MISSING;
@@ -658,7 +656,6 @@ static const char *check_nonce(const char *buf, size_t len)
goto leave;
}
- noncelen = strlen(nonce);
expect = prepare_push_cert_nonce(service_dir, stamp);
if (noncelen != strlen(expect)) {
/* This is not even the right size. */
@@ -706,35 +703,28 @@ leave:
static int check_cert_push_options(const struct string_list *push_options)
{
const char *buf = push_cert.buf;
- int len = push_cert.len;
- char *option;
- const char *next_line;
+ const char *option;
+ size_t optionlen;
int options_seen = 0;
int retval = 1;
- if (!len)
+ if (!*buf)
return 1;
- while ((option = find_header(buf, len, "push-option", &next_line))) {
- len -= (next_line - buf);
- buf = next_line;
+ while ((option = find_commit_header(buf, "push-option", &optionlen))) {
+ buf = option + optionlen + 1;
options_seen++;
if (options_seen > push_options->nr
- || strcmp(option,
- push_options->items[options_seen - 1].string)) {
- retval = 0;
- goto leave;
- }
- free(option);
+ || xstrncmpz(push_options->items[options_seen - 1].string,
+ option, optionlen))
+ return 0;
}
if (options_seen != push_options->nr)
retval = 0;
-leave:
- free(option);
return retval;
}
@@ -761,7 +751,7 @@ static void prepare_push_cert_sha1(struct child_process *proc)
check_signature(&sigcheck, push_cert.buf + bogs,
push_cert.len - bogs);
- nonce_status = check_nonce(push_cert.buf, bogs);
+ nonce_status = check_nonce(sigcheck.payload);
}
if (!is_null_oid(&push_cert_oid)) {
strvec_pushf(&proc->env, "GIT_PUSH_CERT=%s",
@@ -1346,7 +1336,7 @@ static int head_has_history(void)
{
struct object_id oid;
- return !get_oid("HEAD", &oid);
+ return !repo_get_oid(the_repository, "HEAD", &oid);
}
static const char *push_to_deploy(unsigned char *sha1,
@@ -1462,8 +1452,10 @@ static const char *update(struct command *cmd, struct shallow_info *si)
find_shared_symref(worktrees, "HEAD", name);
/* only refs/... are allowed */
- if (!starts_with(name, "refs/") || check_refname_format(name + 5, 0)) {
- rp_error("refusing to create funny ref '%s' remotely", name);
+ if (!starts_with(name, "refs/") ||
+ check_refname_format(name + 5, is_null_oid(new_oid) ?
+ REFNAME_ALLOW_ONELEVEL : 0)) {
+ rp_error("refusing to update funny ref '%s' remotely", name);
ret = "funny refname";
goto out;
}
@@ -1493,7 +1485,7 @@ static const char *update(struct command *cmd, struct shallow_info *si)
}
}
- if (!is_null_oid(new_oid) && !has_object_file(new_oid)) {
+ if (!is_null_oid(new_oid) && !repo_has_object_file(the_repository, new_oid)) {
error("unpack should have generated %s, "
"but I can't find it!", oid_to_hex(new_oid));
ret = "bad pack";
@@ -1534,6 +1526,7 @@ static const char *update(struct command *cmd, struct shallow_info *si)
starts_with(name, "refs/heads/")) {
struct object *old_object, *new_object;
struct commit *old_commit, *new_commit;
+ int ret2;
old_object = parse_object(the_repository, old_oid);
new_object = parse_object(the_repository, new_oid);
@@ -1547,7 +1540,10 @@ static const char *update(struct command *cmd, struct shallow_info *si)
}
old_commit = (struct commit *)old_object;
new_commit = (struct commit *)new_object;
- if (!in_merge_bases(old_commit, new_commit)) {
+ ret2 = repo_in_merge_bases(the_repository, old_commit, new_commit);
+ if (ret2 < 0)
+ exit(128);
+ if (!ret2) {
rp_error("denying non-fast-forward %s"
" (you should pull first)", name);
ret = "non-fast-forward";
@@ -1680,11 +1676,11 @@ static void check_aliased_update_internal(struct command *cmd,
rp_error("refusing inconsistent update between symref '%s' (%s..%s) and"
" its target '%s' (%s..%s)",
cmd->ref_name,
- find_unique_abbrev(&cmd->old_oid, DEFAULT_ABBREV),
- find_unique_abbrev(&cmd->new_oid, DEFAULT_ABBREV),
+ repo_find_unique_abbrev(the_repository, &cmd->old_oid, DEFAULT_ABBREV),
+ repo_find_unique_abbrev(the_repository, &cmd->new_oid, DEFAULT_ABBREV),
dst_cmd->ref_name,
- find_unique_abbrev(&dst_cmd->old_oid, DEFAULT_ABBREV),
- find_unique_abbrev(&dst_cmd->new_oid, DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, &dst_cmd->old_oid, DEFAULT_ABBREV),
+ repo_find_unique_abbrev(the_repository, &dst_cmd->new_oid, DEFAULT_ABBREV));
cmd->error_string = dst_cmd->error_string =
"inconsistent aliased update";
@@ -1794,7 +1790,7 @@ static void reject_updates_to_hidden(struct command *commands)
strbuf_setlen(&refname_full, prefix_len);
strbuf_addstr(&refname_full, cmd->ref_name);
- if (!ref_is_hidden(cmd->ref_name, refname_full.buf))
+ if (!ref_is_hidden(cmd->ref_name, refname_full.buf, &hidden_refs))
continue;
if (is_null_oid(&cmd->new_oid))
cmd->error_string = "deny deleting a hidden ref";
@@ -1928,6 +1924,8 @@ static void execute_commands(struct command *commands,
opt.err_fd = err_fd;
opt.progress = err_fd && !quiet;
opt.env = tmp_objdir_env(tmp_objdir);
+ opt.exclude_hidden_refs_section = "receive";
+
if (check_connected(iterate_receive_command_list, &data, &opt))
set_connectivity_errors(commands, si);
@@ -2029,6 +2027,16 @@ static struct command **queue_command(struct command **tail,
return &cmd->next;
}
+static void free_commands(struct command *commands)
+{
+ while (commands) {
+ struct command *next = commands->next;
+
+ free(commands);
+ commands = next;
+ }
+}
+
static void queue_commands_from_cert(struct command **tail,
struct strbuf *push_cert)
{
@@ -2076,7 +2084,7 @@ static struct command *read_head_info(struct packet_reader *reader,
const char *feature_list = reader->line + linelen + 1;
const char *hash = NULL;
const char *client_sid;
- int len = 0;
+ size_t len = 0;
if (parse_feature_request(feature_list, "report-status"))
report_status = 1;
if (parse_feature_request(feature_list, "report-status-v2"))
@@ -2171,7 +2179,7 @@ static const char *parse_pack_header(struct pack_header *hdr)
}
}
-static const char *pack_lockfile;
+static struct tempfile *pack_lockfile;
static void push_header_arg(struct strvec *args, struct pack_header *hdr)
{
@@ -2238,6 +2246,7 @@ static const char *unpack(int err_fd, struct shallow_info *si)
return "unpack-objects abnormal exit";
} else {
char hostname[HOST_NAME_MAX + 1];
+ char *lockfile;
strvec_pushl(&child.args, "index-pack", "--stdin", NULL);
push_header_arg(&child.args, &hdr);
@@ -2267,8 +2276,14 @@ static const char *unpack(int err_fd, struct shallow_info *si)
status = start_command(&child);
if (status)
return "index-pack fork failed";
- pack_lockfile = index_pack_lockfile(child.out, NULL);
+
+ lockfile = index_pack_lockfile(child.out, NULL);
+ if (lockfile) {
+ pack_lockfile = register_tempfile(lockfile);
+ free(lockfile);
+ }
close(child.out);
+
status = finish_command(&child);
if (status)
return "index-pack abnormal exit";
@@ -2496,10 +2511,10 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
if (cert_nonce_seed)
push_cert_nonce = prepare_push_cert_nonce(service_dir, time(NULL));
- if (0 <= transfer_unpack_limit)
- unpack_limit = transfer_unpack_limit;
- else if (0 <= receive_unpack_limit)
+ if (0 <= receive_unpack_limit)
unpack_limit = receive_unpack_limit;
+ else if (0 <= transfer_unpack_limit)
+ unpack_limit = transfer_unpack_limit;
switch (determine_protocol_version_server()) {
case protocol_v2:
@@ -2555,8 +2570,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
use_keepalive = KEEPALIVE_ALWAYS;
execute_commands(commands, unpack_status, &si,
&push_options);
- if (pack_lockfile)
- unlink_or_warn(pack_lockfile);
+ delete_tempfile(&pack_lockfile);
sigchain_push(SIGPIPE, SIG_IGN);
if (report_status_v2)
report_v2(commands, unpack_status);
@@ -2566,6 +2580,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
run_receive_hook(commands, "post-receive", 1,
&push_options);
run_update_post_hook(commands);
+ free_commands(commands);
string_list_clear(&push_options, 0);
if (auto_gc) {
struct child_process proc = CHILD_PROCESS_INIT;
@@ -2591,6 +2606,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
packet_flush(1);
oid_array_clear(&shallow);
oid_array_clear(&ref);
+ strvec_clear(&hidden_refs);
free((void *)push_cert_nonce);
return 0;
}
diff --git a/builtin/reflog.c b/builtin/reflog.c
index 4dd297d..060eb33 100644
--- a/builtin/reflog.c
+++ b/builtin/reflog.c
@@ -1,13 +1,21 @@
#include "builtin.h"
#include "config.h"
+#include "gettext.h"
+#include "repository.h"
#include "revision.h"
#include "reachable.h"
+#include "wildmatch.h"
#include "worktree.h"
#include "reflog.h"
+#include "refs.h"
+#include "parse-options.h"
#define BUILTIN_REFLOG_SHOW_USAGE \
N_("git reflog [show] [<log-options>] [<ref>]")
+#define BUILTIN_REFLOG_LIST_USAGE \
+ N_("git reflog list")
+
#define BUILTIN_REFLOG_EXPIRE_USAGE \
N_("git reflog expire [--expire=<time>] [--expire-unreachable=<time>]\n" \
" [--rewrite] [--updateref] [--stale-fix]\n" \
@@ -25,6 +33,11 @@ static const char *const reflog_show_usage[] = {
NULL,
};
+static const char *const reflog_list_usage[] = {
+ BUILTIN_REFLOG_LIST_USAGE,
+ NULL,
+};
+
static const char *const reflog_expire_usage[] = {
BUILTIN_REFLOG_EXPIRE_USAGE,
NULL
@@ -42,6 +55,7 @@ static const char *const reflog_exists_usage[] = {
static const char *const reflog_usage[] = {
BUILTIN_REFLOG_SHOW_USAGE,
+ BUILTIN_REFLOG_LIST_USAGE,
BUILTIN_REFLOG_EXPIRE_USAGE,
BUILTIN_REFLOG_DELETE_USAGE,
BUILTIN_REFLOG_EXISTS_USAGE,
@@ -56,7 +70,7 @@ struct worktree_reflogs {
struct string_list reflogs;
};
-static int collect_reflog(const char *ref, const struct object_id *oid, int unused, void *cb_data)
+static int collect_reflog(const char *ref, void *cb_data)
{
struct worktree_reflogs *cb = cb_data;
struct worktree *worktree = cb->worktree;
@@ -66,7 +80,8 @@ static int collect_reflog(const char *ref, const struct object_id *oid, int unus
* Avoid collecting the same shared ref multiple times because
* they are available via all worktrees.
*/
- if (!worktree->is_current && ref_type(ref) == REF_TYPE_NORMAL)
+ if (!worktree->is_current &&
+ parse_worktree_ref(ref, NULL, NULL, NULL) == REF_WORKTREE_SHARED)
return 0;
strbuf_worktree_ref(worktree, &newref, ref);
@@ -90,8 +105,7 @@ static struct reflog_expire_cfg *find_cfg_ent(const char *pattern, size_t len)
reflog_expire_cfg_tail = &reflog_expire_cfg;
for (ent = reflog_expire_cfg; ent; ent = ent->next)
- if (!strncmp(ent->pattern, pattern, len) &&
- ent->pattern[len] == '\0')
+ if (!xstrncmpz(ent->pattern, pattern, len))
return ent;
FLEX_ALLOC_MEM(ent, pattern, pattern, len);
@@ -104,7 +118,8 @@ static struct reflog_expire_cfg *find_cfg_ent(const char *pattern, size_t len)
#define EXPIRE_TOTAL 01
#define EXPIRE_UNREACH 02
-static int reflog_expire_config(const char *var, const char *value, void *cb)
+static int reflog_expire_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
const char *pattern, *key;
size_t pattern_len;
@@ -113,7 +128,7 @@ static int reflog_expire_config(const char *var, const char *value, void *cb)
struct reflog_expire_cfg *ent;
if (parse_config_key(var, "gc", &pattern, &pattern_len, &key) < 0)
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
if (!strcmp(key, "reflogexpire")) {
slot = EXPIRE_TOTAL;
@@ -124,7 +139,7 @@ static int reflog_expire_config(const char *var, const char *value, void *cb)
if (git_config_expiry_date(&expire, var, value))
return -1;
} else
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
if (!pattern) {
switch (slot) {
@@ -193,6 +208,8 @@ static int expire_unreachable_callback(const struct option *opt,
{
struct cmd_reflog_expire_cb *cmd = opt->value;
+ BUG_ON_OPT_NEG(unset);
+
if (parse_expiry_date(arg, &cmd->expire_unreachable))
die(_("invalid timestamp '%s' given to '--%s'"),
arg, opt->long_name);
@@ -207,6 +224,8 @@ static int expire_total_callback(const struct option *opt,
{
struct cmd_reflog_expire_cb *cmd = opt->value;
+ BUG_ON_OPT_NEG(unset);
+
if (parse_expiry_date(arg, &cmd->expire_total))
die(_("invalid timestamp '%s' given to '--%s'"),
arg, opt->long_name);
@@ -223,21 +242,44 @@ static int cmd_reflog_show(int argc, const char **argv, const char *prefix)
parse_options(argc, argv, prefix, options, reflog_show_usage,
PARSE_OPT_KEEP_DASHDASH | PARSE_OPT_KEEP_ARGV0 |
- PARSE_OPT_KEEP_UNKNOWN);
+ PARSE_OPT_KEEP_UNKNOWN_OPT);
return cmd_log_reflog(argc, argv, prefix);
}
+static int show_reflog(const char *refname, void *cb_data UNUSED)
+{
+ printf("%s\n", refname);
+ return 0;
+}
+
+static int cmd_reflog_list(int argc, const char **argv, const char *prefix)
+{
+ struct option options[] = {
+ OPT_END()
+ };
+ struct ref_store *ref_store;
+
+ argc = parse_options(argc, argv, prefix, options, reflog_list_usage, 0);
+ if (argc)
+ return error(_("%s does not accept arguments: '%s'"),
+ "list", argv[0]);
+
+ ref_store = get_main_ref_store(the_repository);
+
+ return refs_for_each_reflog(ref_store, show_reflog, NULL);
+}
+
static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
{
struct cmd_reflog_expire_cb cmd = { 0 };
timestamp_t now = time(NULL);
- int i, status, do_all, all_worktrees = 1;
+ int i, status, do_all, single_worktree = 0;
unsigned int flags = 0;
int verbose = 0;
reflog_expiry_should_prune_fn *should_prune_fn = should_expire_reflog_ent;
const struct option options[] = {
- OPT_BIT(0, "dry-run", &flags, N_("do not actually prune any entries"),
+ OPT_BIT('n', "dry-run", &flags, N_("do not actually prune any entries"),
EXPIRE_REFLOGS_DRY_RUN),
OPT_BIT(0, "rewrite", &flags,
N_("rewrite the old SHA1 with the new SHA1 of the entry that now precedes it"),
@@ -257,7 +299,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
OPT_BOOL(0, "stale-fix", &cmd.stalefix,
N_("prune any reflog entries that point to broken commits")),
OPT_BOOL(0, "all", &do_all, N_("process the reflogs of all references")),
- OPT_BOOL(1, "single-worktree", &all_worktrees,
+ OPT_BOOL(0, "single-worktree", &single_worktree,
N_("limits processing to reflogs from the current worktree only")),
OPT_END()
};
@@ -287,7 +329,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
struct rev_info revs;
repo_init_revisions(the_repository, &revs, prefix);
- revs.do_not_die_on_missing_tree = 1;
+ revs.do_not_die_on_missing_objects = 1;
revs.ignore_missing = 1;
revs.ignore_missing_links = 1;
if (verbose)
@@ -307,7 +349,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
worktrees = get_worktrees();
for (p = worktrees; *p; p++) {
- if (!all_worktrees && !(*p)->is_current)
+ if (single_worktree && !(*p)->is_current)
continue;
collected.worktree = *p;
refs_for_each_reflog(get_worktree_ref_store(*p),
@@ -357,7 +399,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
int verbose = 0;
const struct option options[] = {
- OPT_BIT(0, "dry-run", &flags, N_("do not actually prune any entries"),
+ OPT_BIT('n', "dry-run", &flags, N_("do not actually prune any entries"),
EXPIRE_REFLOGS_DRY_RUN),
OPT_BIT(0, "rewrite", &flags,
N_("rewrite the old SHA1 with the new SHA1 of the entry that now precedes it"),
@@ -404,40 +446,22 @@ static int cmd_reflog_exists(int argc, const char **argv, const char *prefix)
int cmd_reflog(int argc, const char **argv, const char *prefix)
{
+ parse_opt_subcommand_fn *fn = NULL;
struct option options[] = {
+ OPT_SUBCOMMAND("show", &fn, cmd_reflog_show),
+ OPT_SUBCOMMAND("list", &fn, cmd_reflog_list),
+ OPT_SUBCOMMAND("expire", &fn, cmd_reflog_expire),
+ OPT_SUBCOMMAND("delete", &fn, cmd_reflog_delete),
+ OPT_SUBCOMMAND("exists", &fn, cmd_reflog_exists),
OPT_END()
};
argc = parse_options(argc, argv, prefix, options, reflog_usage,
+ PARSE_OPT_SUBCOMMAND_OPTIONAL |
PARSE_OPT_KEEP_DASHDASH | PARSE_OPT_KEEP_ARGV0 |
- PARSE_OPT_KEEP_UNKNOWN |
- PARSE_OPT_NO_INTERNAL_HELP);
-
- /*
- * With "git reflog" we default to showing it. !argc is
- * impossible with PARSE_OPT_KEEP_ARGV0.
- */
- if (argc == 1)
- goto log_reflog;
-
- if (!strcmp(argv[1], "-h"))
- usage_with_options(reflog_usage, options);
- else if (*argv[1] == '-')
- goto log_reflog;
-
- if (!strcmp(argv[1], "show"))
- return cmd_reflog_show(argc - 1, argv + 1, prefix);
- else if (!strcmp(argv[1], "expire"))
- return cmd_reflog_expire(argc - 1, argv + 1, prefix);
- else if (!strcmp(argv[1], "delete"))
- return cmd_reflog_delete(argc - 1, argv + 1, prefix);
- else if (!strcmp(argv[1], "exists"))
- return cmd_reflog_exists(argc - 1, argv + 1, prefix);
-
- /*
- * Fall-through for e.g. "git reflog -1", "git reflog master",
- * as well as the plain "git reflog" above goto above.
- */
-log_reflog:
- return cmd_log_reflog(argc, argv, prefix);
+ PARSE_OPT_KEEP_UNKNOWN_OPT);
+ if (fn)
+ return fn(argc - 1, argv + 1, prefix);
+ else
+ return cmd_log_reflog(argc, argv, prefix);
}
diff --git a/builtin/remote-ext.c b/builtin/remote-ext.c
index fd3538d..282782e 100644
--- a/builtin/remote-ext.c
+++ b/builtin/remote-ext.c
@@ -169,6 +169,8 @@ static int command_loop(const char *child)
while (1) {
size_t i;
+ const char *arg;
+
if (!fgets(buffer, MAXCOMMAND - 1, stdin)) {
if (ferror(stdin))
die("Command input error");
@@ -182,10 +184,10 @@ static int command_loop(const char *child)
if (!strcmp(buffer, "capabilities")) {
printf("*connect\n\n");
fflush(stdout);
- } else if (!strncmp(buffer, "connect ", 8)) {
+ } else if (skip_prefix(buffer, "connect ", &arg)) {
printf("\n");
fflush(stdout);
- return run_child(child, buffer + 8);
+ return run_child(child, arg);
} else {
fprintf(stderr, "Bad command");
return 1;
@@ -195,6 +197,8 @@ static int command_loop(const char *child)
int cmd_remote_ext(int argc, const char **argv, const char *prefix)
{
+ BUG_ON_NON_EMPTY_PREFIX(prefix);
+
if (argc != 3)
usage(usage_msg);
diff --git a/builtin/remote-fd.c b/builtin/remote-fd.c
index 91dfe07..9020fab 100644
--- a/builtin/remote-fd.c
+++ b/builtin/remote-fd.c
@@ -40,7 +40,7 @@ static void command_loop(int input_fd, int output_fd)
if (!strcmp(buffer, "capabilities")) {
printf("*connect\n\n");
fflush(stdout);
- } else if (!strncmp(buffer, "connect ", 8)) {
+ } else if (starts_with(buffer, "connect ")) {
printf("\n");
fflush(stdout);
if (bidirectional_transfer_loop(input_fd,
@@ -59,6 +59,8 @@ int cmd_remote_fd(int argc, const char **argv, const char *prefix)
int output_fd = -1;
char *end;
+ BUG_ON_NON_EMPTY_PREFIX(prefix);
+
if (argc != 3)
usage(usage_msg);
diff --git a/builtin/remote.c b/builtin/remote.c
index a3a0c27..8412d12 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -1,6 +1,8 @@
#include "builtin.h"
#include "config.h"
+#include "gettext.h"
#include "parse-options.h"
+#include "path.h"
#include "transport.h"
#include "remote.h"
#include "string-list.h"
@@ -9,7 +11,7 @@
#include "rebase.h"
#include "refs.h"
#include "refspec.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "strvec.h"
#include "commit-reach.h"
#include "progress.h"
@@ -92,13 +94,15 @@ static int verbose;
static int fetch_remote(const char *name)
{
- const char *argv[] = { "fetch", name, NULL, NULL };
- if (verbose) {
- argv[1] = "-v";
- argv[2] = name;
- }
+ struct child_process cmd = CHILD_PROCESS_INIT;
+
+ strvec_push(&cmd.args, "fetch");
+ if (verbose)
+ strvec_push(&cmd.args, "-v");
+ strvec_push(&cmd.args, name);
+ cmd.git_cmd = 1;
printf_ln(_("Updating %s"), name);
- if (run_command_v_opt(argv, RUN_GIT_CMD))
+ if (run_command(&cmd))
return error(_("Could not fetch %s"), name);
return 0;
}
@@ -146,11 +150,11 @@ static int parse_mirror_opt(const struct option *opt, const char *arg, int not)
else if (!strcmp(arg, "push"))
*mirror = MIRROR_PUSH;
else
- return error(_("unknown mirror argument: %s"), arg);
+ return error(_("unknown --mirror argument: %s"), arg);
return 0;
}
-static int add(int argc, const char **argv)
+static int add(int argc, const char **argv, const char *prefix)
{
int fetch = 0, fetch_tags = TAGS_DEFAULT;
unsigned mirror = MIRROR_NONE;
@@ -164,10 +168,9 @@ static int add(int argc, const char **argv)
struct option options[] = {
OPT_BOOL('f', "fetch", &fetch, N_("fetch the remote branches")),
OPT_SET_INT(0, "tags", &fetch_tags,
- N_("import all tags and associated objects when fetching"),
+ N_("import all tags and associated objects when fetching\n"
+ "or do not fetch any tag at all (--no-tags)"),
TAGS_SET),
- OPT_SET_INT(0, NULL, &fetch_tags,
- N_("or do not fetch any tag at all (--no-tags)"), TAGS_UNSET),
OPT_STRING_LIST('t', "track", &track, N_("branch"),
N_("branch(es) to track")),
OPT_STRING('m', "master", &master, N_("branch"), N_("master branch")),
@@ -177,8 +180,8 @@ static int add(int argc, const char **argv)
OPT_END()
};
- argc = parse_options(argc, argv, NULL, options, builtin_remote_add_usage,
- 0);
+ argc = parse_options(argc, argv, prefix, options,
+ builtin_remote_add_usage, 0);
if (argc != 2)
usage_with_options(builtin_remote_add_usage, options);
@@ -264,7 +267,9 @@ static const char *abbrev_ref(const char *name, const char *prefix)
}
#define abbrev_branch(name) abbrev_ref((name), "refs/heads/")
-static int config_read_branches(const char *key, const char *value, void *cb)
+static int config_read_branches(const char *key, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *data UNUSED)
{
const char *orig_key = key;
char *name;
@@ -344,12 +349,13 @@ static void read_branches(void)
struct ref_states {
struct remote *remote;
- struct string_list new_refs, stale, tracked, heads, push;
+ struct string_list new_refs, skipped, stale, tracked, heads, push;
int queried;
};
#define REF_STATES_INIT { \
.new_refs = STRING_LIST_INIT_DUP, \
+ .skipped = STRING_LIST_INIT_DUP, \
.stale = STRING_LIST_INIT_DUP, \
.tracked = STRING_LIST_INIT_DUP, \
.heads = STRING_LIST_INIT_DUP, \
@@ -368,7 +374,9 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat
states->remote->fetch.raw[i]);
for (ref = fetch_map; ref; ref = ref->next) {
- if (!ref->peer_ref || !ref_exists(ref->peer_ref->name))
+ if (omit_name_by_refspec(ref->name, &states->remote->fetch))
+ string_list_append(&states->skipped, abbrev_branch(ref->name));
+ else if (!ref->peer_ref || !ref_exists(ref->peer_ref->name))
string_list_append(&states->new_refs, abbrev_branch(ref->name));
else
string_list_append(&states->tracked, abbrev_branch(ref->name));
@@ -383,6 +391,7 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat
free_refs(fetch_map);
string_list_sort(&states->new_refs);
+ string_list_sort(&states->skipped);
string_list_sort(&states->tracked);
string_list_sort(&states->stale);
@@ -436,7 +445,7 @@ static int get_push_ref_states(const struct ref *remote_refs,
info->status = PUSH_STATUS_UPTODATE;
else if (is_null_oid(&ref->old_oid))
info->status = PUSH_STATUS_CREATE;
- else if (has_object_file(&ref->old_oid) &&
+ else if (repo_has_object_file(the_repository, &ref->old_oid) &&
ref_newer(&ref->new_oid, &ref->old_oid))
info->status = PUSH_STATUS_FASTFORWARD;
else
@@ -534,7 +543,8 @@ struct branches_for_remote {
};
static int add_branch_for_removal(const char *refname,
- const struct object_id *oid, int flags, void *cb_data)
+ const struct object_id *oid UNUSED,
+ int flags UNUSED, void *cb_data)
{
struct branches_for_remote *branches = cb_data;
struct refspec_item refspec;
@@ -576,7 +586,8 @@ struct rename_info {
};
static int read_remote_branches(const char *refname,
- const struct object_id *oid, int flags, void *cb_data)
+ const struct object_id *oid UNUSED,
+ int flags UNUSED, void *cb_data)
{
struct rename_info *rename = cb_data;
struct strbuf buf = STRBUF_INIT;
@@ -635,17 +646,19 @@ struct push_default_info
};
static int config_read_push_default(const char *key, const char *value,
- void *cb)
+ const struct config_context *ctx, void *cb)
{
+ const struct key_value_info *kvi = ctx->kvi;
+
struct push_default_info* info = cb;
if (strcmp(key, "remote.pushdefault") ||
!value || strcmp(value, info->old_name))
return 0;
- info->scope = current_config_scope();
+ info->scope = kvi->scope;
strbuf_reset(&info->origin);
- strbuf_addstr(&info->origin, current_config_name());
- info->linenr = current_config_line();
+ strbuf_addstr(&info->origin, config_origin_type_name(kvi->origin_type));
+ info->linenr = kvi->linenr;
return 0;
}
@@ -676,7 +689,7 @@ static void handle_push_default(const char* old_name, const char* new_name)
}
-static int mv(int argc, const char **argv)
+static int mv(int argc, const char **argv, const char *prefix)
{
int show_progress = isatty(2);
struct option options[] = {
@@ -691,7 +704,7 @@ static int mv(int argc, const char **argv)
int i, refs_renamed_nr = 0, refspec_updated = 0;
struct progress *progress = NULL;
- argc = parse_options(argc, argv, NULL, options,
+ argc = parse_options(argc, argv, prefix, options,
builtin_remote_rename_usage, 0);
if (argc != 2)
@@ -726,29 +739,31 @@ static int mv(int argc, const char **argv)
return error(_("Could not rename config section '%s' to '%s'"),
buf.buf, buf2.buf);
- strbuf_reset(&buf);
- strbuf_addf(&buf, "remote.%s.fetch", rename.new_name);
- git_config_set_multivar(buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
- strbuf_addf(&old_remote_context, ":refs/remotes/%s/", rename.old_name);
- for (i = 0; i < oldremote->fetch.raw_nr; i++) {
- char *ptr;
-
- strbuf_reset(&buf2);
- strbuf_addstr(&buf2, oldremote->fetch.raw[i]);
- ptr = strstr(buf2.buf, old_remote_context.buf);
- if (ptr) {
- refspec_updated = 1;
- strbuf_splice(&buf2,
- ptr-buf2.buf + strlen(":refs/remotes/"),
- strlen(rename.old_name), rename.new_name,
- strlen(rename.new_name));
- } else
- warning(_("Not updating non-default fetch refspec\n"
- "\t%s\n"
- "\tPlease update the configuration manually if necessary."),
- buf2.buf);
-
- git_config_set_multivar(buf.buf, buf2.buf, "^$", 0);
+ if (oldremote->fetch.raw_nr) {
+ strbuf_reset(&buf);
+ strbuf_addf(&buf, "remote.%s.fetch", rename.new_name);
+ git_config_set_multivar(buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
+ strbuf_addf(&old_remote_context, ":refs/remotes/%s/", rename.old_name);
+ for (i = 0; i < oldremote->fetch.raw_nr; i++) {
+ char *ptr;
+
+ strbuf_reset(&buf2);
+ strbuf_addstr(&buf2, oldremote->fetch.raw[i]);
+ ptr = strstr(buf2.buf, old_remote_context.buf);
+ if (ptr) {
+ refspec_updated = 1;
+ strbuf_splice(&buf2,
+ ptr-buf2.buf + strlen(":refs/remotes/"),
+ strlen(rename.old_name), rename.new_name,
+ strlen(rename.new_name));
+ } else
+ warning(_("Not updating non-default fetch refspec\n"
+ "\t%s\n"
+ "\tPlease update the configuration manually if necessary."),
+ buf2.buf);
+
+ git_config_set_multivar(buf.buf, buf2.buf, "^$", 0);
+ }
}
read_branches();
@@ -840,7 +855,7 @@ static int mv(int argc, const char **argv)
return 0;
}
-static int rm(int argc, const char **argv)
+static int rm(int argc, const char **argv, const char *prefix)
{
struct option options[] = {
OPT_END()
@@ -858,12 +873,14 @@ static int rm(int argc, const char **argv)
cb_data.skipped = &skipped;
cb_data.keep = &known_remotes;
- if (argc != 2)
+ argc = parse_options(argc, argv, prefix, options,
+ builtin_remote_rm_usage, 0);
+ if (argc != 1)
usage_with_options(builtin_remote_rm_usage, options);
- remote = remote_get(argv[1]);
+ remote = remote_get(argv[0]);
if (!remote_is_configured(remote, 1)) {
- error(_("No such remote: '%s'"), argv[1]);
+ error(_("No such remote: '%s'"), argv[0]);
exit(2);
}
@@ -931,7 +948,7 @@ static int rm(int argc, const char **argv)
return result;
}
-static void clear_push_info(void *util, const char *string)
+static void clear_push_info(void *util, const char *string UNUSED)
{
struct push_info *info = util;
free(info->dest);
@@ -941,6 +958,7 @@ static void clear_push_info(void *util, const char *string)
static void free_remote_ref_states(struct ref_states *states)
{
string_list_clear(&states->new_refs, 0);
+ string_list_clear(&states->skipped, 0);
string_list_clear(&states->stale, 1);
string_list_clear(&states->tracked, 0);
string_list_clear(&states->heads, 0);
@@ -948,7 +966,8 @@ static void free_remote_ref_states(struct ref_states *states)
}
static int append_ref_to_tracked_list(const char *refname,
- const struct object_id *oid, int flags, void *cb_data)
+ const struct object_id *oid UNUSED,
+ int flags, void *cb_data)
{
struct ref_states *states = cb_data;
struct refspec_item refspec;
@@ -1035,6 +1054,8 @@ static int show_remote_info_item(struct string_list_item *item, void *cb_data)
arg = states->remote->name;
} else if (string_list_has_string(&states->tracked, name))
arg = _(" tracked");
+ else if (string_list_has_string(&states->skipped, name))
+ arg = _(" skipped");
else if (string_list_has_string(&states->stale, name))
arg = _(" stale (use 'git remote prune' to remove)");
else
@@ -1247,7 +1268,7 @@ static int show_all(void)
return result;
}
-static int show(int argc, const char **argv)
+static int show(int argc, const char **argv, const char *prefix)
{
int no_query = 0, result = 0, query_flag = 0;
struct option options[] = {
@@ -1256,7 +1277,8 @@ static int show(int argc, const char **argv)
};
struct show_info info = SHOW_INFO_INIT;
- argc = parse_options(argc, argv, NULL, options, builtin_remote_show_usage,
+ argc = parse_options(argc, argv, prefix, options,
+ builtin_remote_show_usage,
0);
if (argc < 1)
@@ -1307,6 +1329,7 @@ static int show(int argc, const char **argv)
/* remote branch info */
info.width = 0;
for_each_string_list(&info.states.new_refs, add_remote_to_show_info, &info);
+ for_each_string_list(&info.states.skipped, add_remote_to_show_info, &info);
for_each_string_list(&info.states.tracked, add_remote_to_show_info, &info);
for_each_string_list(&info.states.stale, add_remote_to_show_info, &info);
if (info.list.nr)
@@ -1349,7 +1372,7 @@ static int show(int argc, const char **argv)
return result;
}
-static int set_head(int argc, const char **argv)
+static int set_head(int argc, const char **argv, const char *prefix)
{
int i, opt_a = 0, opt_d = 0, result = 0;
struct strbuf buf = STRBUF_INIT, buf2 = STRBUF_INIT;
@@ -1362,8 +1385,8 @@ static int set_head(int argc, const char **argv)
N_("delete refs/remotes/<name>/HEAD")),
OPT_END()
};
- argc = parse_options(argc, argv, NULL, options, builtin_remote_sethead_usage,
- 0);
+ argc = parse_options(argc, argv, prefix, options,
+ builtin_remote_sethead_usage, 0);
if (argc)
strbuf_addf(&buf, "refs/remotes/%s/HEAD", argv[0]);
@@ -1454,7 +1477,7 @@ static int prune_remote(const char *remote, int dry_run)
return result;
}
-static int prune(int argc, const char **argv)
+static int prune(int argc, const char **argv, const char *prefix)
{
int dry_run = 0, result = 0;
struct option options[] = {
@@ -1462,8 +1485,8 @@ static int prune(int argc, const char **argv)
OPT_END()
};
- argc = parse_options(argc, argv, NULL, options, builtin_remote_prune_usage,
- 0);
+ argc = parse_options(argc, argv, prefix, options,
+ builtin_remote_prune_usage, 0);
if (argc < 1)
usage_with_options(builtin_remote_prune_usage, options);
@@ -1474,7 +1497,9 @@ static int prune(int argc, const char **argv)
return result;
}
-static int get_remote_default(const char *key, const char *value, void *priv)
+static int get_remote_default(const char *key, const char *value UNUSED,
+ const struct config_context *ctx UNUSED,
+ void *priv)
{
if (strcmp(key, "remotes.default") == 0) {
int *found = priv;
@@ -1483,7 +1508,7 @@ static int get_remote_default(const char *key, const char *value, void *priv)
return 0;
}
-static int update(int argc, const char **argv)
+static int update(int argc, const char **argv, const char *prefix)
{
int i, prune = -1;
struct option options[] = {
@@ -1491,36 +1516,35 @@ static int update(int argc, const char **argv)
N_("prune remotes after fetching")),
OPT_END()
};
- struct strvec fetch_argv = STRVEC_INIT;
+ struct child_process cmd = CHILD_PROCESS_INIT;
int default_defined = 0;
- int retval;
- argc = parse_options(argc, argv, NULL, options, builtin_remote_update_usage,
+ argc = parse_options(argc, argv, prefix, options,
+ builtin_remote_update_usage,
PARSE_OPT_KEEP_ARGV0);
- strvec_push(&fetch_argv, "fetch");
+ strvec_push(&cmd.args, "fetch");
if (prune != -1)
- strvec_push(&fetch_argv, prune ? "--prune" : "--no-prune");
+ strvec_push(&cmd.args, prune ? "--prune" : "--no-prune");
if (verbose)
- strvec_push(&fetch_argv, "-v");
- strvec_push(&fetch_argv, "--multiple");
+ strvec_push(&cmd.args, "-v");
+ strvec_push(&cmd.args, "--multiple");
if (argc < 2)
- strvec_push(&fetch_argv, "default");
+ strvec_push(&cmd.args, "default");
for (i = 1; i < argc; i++)
- strvec_push(&fetch_argv, argv[i]);
+ strvec_push(&cmd.args, argv[i]);
- if (strcmp(fetch_argv.v[fetch_argv.nr-1], "default") == 0) {
+ if (strcmp(cmd.args.v[cmd.args.nr-1], "default") == 0) {
git_config(get_remote_default, &default_defined);
if (!default_defined) {
- strvec_pop(&fetch_argv);
- strvec_push(&fetch_argv, "--all");
+ strvec_pop(&cmd.args);
+ strvec_push(&cmd.args, "--all");
}
}
- retval = run_command_v_opt(fetch_argv.v, RUN_GIT_CMD);
- strvec_clear(&fetch_argv);
- return retval;
+ cmd.git_cmd = 1;
+ return run_command(&cmd);
}
static int remove_all_fetch_refspecs(const char *key)
@@ -1566,7 +1590,7 @@ static int set_remote_branches(const char *remotename, const char **branches,
return 0;
}
-static int set_branches(int argc, const char **argv)
+static int set_branches(int argc, const char **argv, const char *prefix)
{
int add_mode = 0;
struct option options[] = {
@@ -1574,7 +1598,7 @@ static int set_branches(int argc, const char **argv)
OPT_END()
};
- argc = parse_options(argc, argv, NULL, options,
+ argc = parse_options(argc, argv, prefix, options,
builtin_remote_setbranches_usage, 0);
if (argc == 0) {
error(_("no remote specified"));
@@ -1585,7 +1609,7 @@ static int set_branches(int argc, const char **argv)
return set_remote_branches(argv[0], argv + 1, add_mode);
}
-static int get_url(int argc, const char **argv)
+static int get_url(int argc, const char **argv, const char *prefix)
{
int i, push_mode = 0, all_mode = 0;
const char *remotename = NULL;
@@ -1599,7 +1623,8 @@ static int get_url(int argc, const char **argv)
N_("return all URLs")),
OPT_END()
};
- argc = parse_options(argc, argv, NULL, options, builtin_remote_geturl_usage, 0);
+ argc = parse_options(argc, argv, prefix, options,
+ builtin_remote_geturl_usage, 0);
if (argc != 1)
usage_with_options(builtin_remote_geturl_usage, options);
@@ -1638,7 +1663,7 @@ static int get_url(int argc, const char **argv)
return 0;
}
-static int set_url(int argc, const char **argv)
+static int set_url(int argc, const char **argv, const char *prefix)
{
int i, push_mode = 0, add_mode = 0, delete_mode = 0;
int matches = 0, negative_matches = 0;
@@ -1659,7 +1684,8 @@ static int set_url(int argc, const char **argv)
N_("delete URLs")),
OPT_END()
};
- argc = parse_options(argc, argv, NULL, options, builtin_remote_seturl_usage,
+ argc = parse_options(argc, argv, prefix, options,
+ builtin_remote_seturl_usage,
PARSE_OPT_KEEP_ARGV0);
if (add_mode && delete_mode)
@@ -1730,41 +1756,33 @@ out:
int cmd_remote(int argc, const char **argv, const char *prefix)
{
+ parse_opt_subcommand_fn *fn = NULL;
struct option options[] = {
OPT__VERBOSE(&verbose, N_("be verbose; must be placed before a subcommand")),
+ OPT_SUBCOMMAND("add", &fn, add),
+ OPT_SUBCOMMAND("rename", &fn, mv),
+ OPT_SUBCOMMAND_F("rm", &fn, rm, PARSE_OPT_NOCOMPLETE),
+ OPT_SUBCOMMAND("remove", &fn, rm),
+ OPT_SUBCOMMAND("set-head", &fn, set_head),
+ OPT_SUBCOMMAND("set-branches", &fn, set_branches),
+ OPT_SUBCOMMAND("get-url", &fn, get_url),
+ OPT_SUBCOMMAND("set-url", &fn, set_url),
+ OPT_SUBCOMMAND("show", &fn, show),
+ OPT_SUBCOMMAND("prune", &fn, prune),
+ OPT_SUBCOMMAND("update", &fn, update),
OPT_END()
};
- int result;
argc = parse_options(argc, argv, prefix, options, builtin_remote_usage,
- PARSE_OPT_STOP_AT_NON_OPTION);
+ PARSE_OPT_SUBCOMMAND_OPTIONAL);
- if (argc < 1)
- result = show_all();
- else if (!strcmp(argv[0], "add"))
- result = add(argc, argv);
- else if (!strcmp(argv[0], "rename"))
- result = mv(argc, argv);
- else if (!strcmp(argv[0], "rm") || !strcmp(argv[0], "remove"))
- result = rm(argc, argv);
- else if (!strcmp(argv[0], "set-head"))
- result = set_head(argc, argv);
- else if (!strcmp(argv[0], "set-branches"))
- result = set_branches(argc, argv);
- else if (!strcmp(argv[0], "get-url"))
- result = get_url(argc, argv);
- else if (!strcmp(argv[0], "set-url"))
- result = set_url(argc, argv);
- else if (!strcmp(argv[0], "show"))
- result = show(argc, argv);
- else if (!strcmp(argv[0], "prune"))
- result = prune(argc, argv);
- else if (!strcmp(argv[0], "update"))
- result = update(argc, argv);
- else {
- error(_("Unknown subcommand: %s"), argv[0]);
- usage_with_options(builtin_remote_usage, options);
+ if (fn) {
+ return !!fn(argc, argv, prefix);
+ } else {
+ if (argc) {
+ error(_("unknown subcommand: `%s'"), argv[0]);
+ usage_with_options(builtin_remote_usage, options);
+ }
+ return !!show_all();
}
-
- return result ? 1 : 0;
}
diff --git a/builtin/repack.c b/builtin/repack.c
index 4a7ae4c..15e4ccc 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -1,29 +1,33 @@
#include "builtin.h"
-#include "cache.h"
#include "config.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "parse-options.h"
+#include "path.h"
#include "run-command.h"
-#include "sigchain.h"
+#include "server-info.h"
#include "strbuf.h"
#include "string-list.h"
#include "strvec.h"
#include "midx.h"
#include "packfile.h"
#include "prune-packed.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "promisor-remote.h"
#include "shallow.h"
#include "pack.h"
#include "pack-bitmap.h"
#include "refs.h"
+#include "list-objects-filter-options.h"
#define ALL_INTO_ONE 1
#define LOOSEN_UNREACHABLE 2
#define PACK_CRUFT 4
#define DELETE_PACK 1
-#define CRUFT_PACK 2
+#define RETAIN_PACK 2
static int pack_everything;
static int delta_base_offset = 1;
@@ -32,7 +36,6 @@ static int write_bitmaps = -1;
static int use_delta_islands;
static int run_update_server_info = 1;
static char *packdir, *packtmp_name, *packtmp;
-static char *cruft_expiration;
static const char *const git_repack_usage[] = {
N_("git repack [<options>]"),
@@ -49,14 +52,16 @@ struct pack_objects_args {
const char *window_memory;
const char *depth;
const char *threads;
- const char *max_pack_size;
+ unsigned long max_pack_size;
int no_reuse_delta;
int no_reuse_object;
int quiet;
int local;
+ struct list_objects_filter_options filter_options;
};
-static int repack_config(const char *var, const char *value, void *cb)
+static int repack_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
struct pack_objects_args *cruft_po_args = cb;
if (!strcmp(var, "repack.usedeltabaseoffset")) {
@@ -88,107 +93,185 @@ static int repack_config(const char *var, const char *value, void *cb)
return git_config_string(&cruft_po_args->depth, var, value);
if (!strcmp(var, "repack.cruftthreads"))
return git_config_string(&cruft_po_args->threads, var, value);
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
-/*
- * Remove temporary $GIT_OBJECT_DIRECTORY/pack/.tmp-$$-pack-* files.
- */
-static void remove_temporary_files(void)
+struct existing_packs {
+ struct string_list kept_packs;
+ struct string_list non_kept_packs;
+ struct string_list cruft_packs;
+};
+
+#define EXISTING_PACKS_INIT { \
+ .kept_packs = STRING_LIST_INIT_DUP, \
+ .non_kept_packs = STRING_LIST_INIT_DUP, \
+ .cruft_packs = STRING_LIST_INIT_DUP, \
+}
+
+static int has_existing_non_kept_packs(const struct existing_packs *existing)
{
- struct strbuf buf = STRBUF_INIT;
- size_t dirlen, prefixlen;
- DIR *dir;
- struct dirent *e;
+ return existing->non_kept_packs.nr || existing->cruft_packs.nr;
+}
- dir = opendir(packdir);
- if (!dir)
- return;
+static void pack_mark_for_deletion(struct string_list_item *item)
+{
+ item->util = (void*)((uintptr_t)item->util | DELETE_PACK);
+}
+
+static void pack_unmark_for_deletion(struct string_list_item *item)
+{
+ item->util = (void*)((uintptr_t)item->util & ~DELETE_PACK);
+}
+
+static int pack_is_marked_for_deletion(struct string_list_item *item)
+{
+ return (uintptr_t)item->util & DELETE_PACK;
+}
- /* Point at the slash at the end of ".../objects/pack/" */
- dirlen = strlen(packdir) + 1;
- strbuf_addstr(&buf, packtmp);
- /* Hold the length of ".tmp-%d-pack-" */
- prefixlen = buf.len - dirlen;
+static void pack_mark_retained(struct string_list_item *item)
+{
+ item->util = (void*)((uintptr_t)item->util | RETAIN_PACK);
+}
- while ((e = readdir(dir))) {
- if (strncmp(e->d_name, buf.buf + dirlen, prefixlen))
+static int pack_is_retained(struct string_list_item *item)
+{
+ return (uintptr_t)item->util & RETAIN_PACK;
+}
+
+static void mark_packs_for_deletion_1(struct string_list *names,
+ struct string_list *list)
+{
+ struct string_list_item *item;
+ const int hexsz = the_hash_algo->hexsz;
+
+ for_each_string_list_item(item, list) {
+ char *sha1;
+ size_t len = strlen(item->string);
+ if (len < hexsz)
continue;
- strbuf_setlen(&buf, dirlen);
- strbuf_addstr(&buf, e->d_name);
- unlink(buf.buf);
+ sha1 = item->string + len - hexsz;
+
+ if (pack_is_retained(item)) {
+ pack_unmark_for_deletion(item);
+ } else if (!string_list_has_string(names, sha1)) {
+ /*
+ * Mark this pack for deletion, which ensures
+ * that this pack won't be included in a MIDX
+ * (if `--write-midx` was given) and that we
+ * will actually delete this pack (if `-d` was
+ * given).
+ */
+ pack_mark_for_deletion(item);
+ }
}
- closedir(dir);
+}
+
+static void retain_cruft_pack(struct existing_packs *existing,
+ struct packed_git *cruft)
+{
+ struct strbuf buf = STRBUF_INIT;
+ struct string_list_item *item;
+
+ strbuf_addstr(&buf, pack_basename(cruft));
+ strbuf_strip_suffix(&buf, ".pack");
+
+ item = string_list_lookup(&existing->cruft_packs, buf.buf);
+ if (!item)
+ BUG("could not find cruft pack '%s'", pack_basename(cruft));
+
+ pack_mark_retained(item);
strbuf_release(&buf);
}
-static void remove_pack_on_signal(int signo)
+static void mark_packs_for_deletion(struct existing_packs *existing,
+ struct string_list *names)
+
{
- remove_temporary_files();
- sigchain_pop(signo);
- raise(signo);
+ mark_packs_for_deletion_1(names, &existing->non_kept_packs);
+ mark_packs_for_deletion_1(names, &existing->cruft_packs);
+}
+
+static void remove_redundant_pack(const char *dir_name, const char *base_name)
+{
+ struct strbuf buf = STRBUF_INIT;
+ struct multi_pack_index *m = get_local_multi_pack_index(the_repository);
+ strbuf_addf(&buf, "%s.pack", base_name);
+ if (m && midx_contains_pack(m, buf.buf))
+ clear_midx_file(the_repository);
+ strbuf_insertf(&buf, 0, "%s/", dir_name);
+ unlink_pack_path(buf.buf, 1);
+ strbuf_release(&buf);
+}
+
+static void remove_redundant_packs_1(struct string_list *packs)
+{
+ struct string_list_item *item;
+ for_each_string_list_item(item, packs) {
+ if (!pack_is_marked_for_deletion(item))
+ continue;
+ remove_redundant_pack(packdir, item->string);
+ }
+}
+
+static void remove_redundant_existing_packs(struct existing_packs *existing)
+{
+ remove_redundant_packs_1(&existing->non_kept_packs);
+ remove_redundant_packs_1(&existing->cruft_packs);
+}
+
+static void existing_packs_release(struct existing_packs *existing)
+{
+ string_list_clear(&existing->kept_packs, 0);
+ string_list_clear(&existing->non_kept_packs, 0);
+ string_list_clear(&existing->cruft_packs, 0);
}
/*
- * Adds all packs hex strings to either fname_nonkept_list or
- * fname_kept_list based on whether each pack has a corresponding
+ * Adds all packs hex strings (pack-$HASH) to either packs->non_kept
+ * or packs->kept based on whether each pack has a corresponding
* .keep file or not. Packs without a .keep file are not to be kept
* if we are going to pack everything into one file.
*/
-static void collect_pack_filenames(struct string_list *fname_nonkept_list,
- struct string_list *fname_kept_list,
+static void collect_pack_filenames(struct existing_packs *existing,
const struct string_list *extra_keep)
{
- DIR *dir;
- struct dirent *e;
- char *fname;
-
- if (!(dir = opendir(packdir)))
- return;
+ struct packed_git *p;
+ struct strbuf buf = STRBUF_INIT;
- while ((e = readdir(dir)) != NULL) {
- size_t len;
+ for (p = get_all_packs(the_repository); p; p = p->next) {
int i;
+ const char *base;
- if (!strip_suffix(e->d_name, ".pack", &len))
+ if (!p->pack_local)
continue;
+ base = pack_basename(p);
+
for (i = 0; i < extra_keep->nr; i++)
- if (!fspathcmp(e->d_name, extra_keep->items[i].string))
+ if (!fspathcmp(base, extra_keep->items[i].string))
break;
- fname = xmemdupz(e->d_name, len);
+ strbuf_reset(&buf);
+ strbuf_addstr(&buf, base);
+ strbuf_strip_suffix(&buf, ".pack");
- if ((extra_keep->nr > 0 && i < extra_keep->nr) ||
- (file_exists(mkpath("%s/%s.keep", packdir, fname)))) {
- string_list_append_nodup(fname_kept_list, fname);
- } else {
- struct string_list_item *item;
- item = string_list_append_nodup(fname_nonkept_list,
- fname);
- if (file_exists(mkpath("%s/%s.mtimes", packdir, fname)))
- item->util = (void*)(uintptr_t)CRUFT_PACK;
- }
+ if ((extra_keep->nr > 0 && i < extra_keep->nr) || p->pack_keep)
+ string_list_append(&existing->kept_packs, buf.buf);
+ else if (p->is_cruft)
+ string_list_append(&existing->cruft_packs, buf.buf);
+ else
+ string_list_append(&existing->non_kept_packs, buf.buf);
}
- closedir(dir);
-
- string_list_sort(fname_kept_list);
-}
-static void remove_redundant_pack(const char *dir_name, const char *base_name)
-{
- struct strbuf buf = STRBUF_INIT;
- struct multi_pack_index *m = get_local_multi_pack_index(the_repository);
- strbuf_addf(&buf, "%s.pack", base_name);
- if (m && midx_contains_pack(m, buf.buf))
- clear_midx_file(the_repository);
- strbuf_insertf(&buf, 0, "%s/", dir_name);
- unlink_pack_path(buf.buf, 1);
+ string_list_sort(&existing->kept_packs);
+ string_list_sort(&existing->non_kept_packs);
+ string_list_sort(&existing->cruft_packs);
strbuf_release(&buf);
}
static void prepare_pack_objects(struct child_process *cmd,
- const struct pack_objects_args *args)
+ const struct pack_objects_args *args,
+ const char *out)
{
strvec_push(&cmd->args, "pack-objects");
if (args->window)
@@ -200,7 +283,7 @@ static void prepare_pack_objects(struct child_process *cmd,
if (args->threads)
strvec_pushf(&cmd->args, "--threads=%s", args->threads);
if (args->max_pack_size)
- strvec_pushf(&cmd->args, "--max-pack-size=%s", args->max_pack_size);
+ strvec_pushf(&cmd->args, "--max-pack-size=%lu", args->max_pack_size);
if (args->no_reuse_delta)
strvec_pushf(&cmd->args, "--no-reuse-delta");
if (args->no_reuse_object)
@@ -211,7 +294,7 @@ static void prepare_pack_objects(struct child_process *cmd,
strvec_push(&cmd->args, "--quiet");
if (delta_base_offset)
strvec_push(&cmd->args, "--delta-base-offset");
- strvec_push(&cmd->args, packtmp);
+ strvec_push(&cmd->args, out);
cmd->git_cmd = 1;
cmd->out = -1;
}
@@ -220,8 +303,9 @@ static void prepare_pack_objects(struct child_process *cmd,
* Write oid to the given struct child_process's stdin, starting it first if
* necessary.
*/
-static int write_oid(const struct object_id *oid, struct packed_git *pack,
- uint32_t pos, void *data)
+static int write_oid(const struct object_id *oid,
+ struct packed_git *pack UNUSED,
+ uint32_t pos UNUSED, void *data)
{
struct child_process *cmd = data;
@@ -230,8 +314,9 @@ static int write_oid(const struct object_id *oid, struct packed_git *pack,
die(_("could not start pack-objects to repack promisor objects"));
}
- xwrite(cmd->in, oid_to_hex(oid), the_hash_algo->hexsz);
- xwrite(cmd->in, "\n", 1);
+ 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 promisor objects to pack-objects"));
return 0;
}
@@ -247,11 +332,15 @@ static struct {
{".idx"},
};
-static unsigned populate_pack_exts(char *name)
+struct generated_pack_data {
+ struct tempfile *tempfiles[ARRAY_SIZE(exts)];
+};
+
+static struct generated_pack_data *populate_pack_exts(const char *name)
{
struct stat statbuf;
struct strbuf path = STRBUF_INIT;
- unsigned ret = 0;
+ struct generated_pack_data *data = xcalloc(1, sizeof(*data));
int i;
for (i = 0; i < ARRAY_SIZE(exts); i++) {
@@ -261,11 +350,23 @@ static unsigned populate_pack_exts(char *name)
if (stat(path.buf, &statbuf))
continue;
- ret |= (1 << i);
+ data->tempfiles[i] = register_tempfile(path.buf);
}
strbuf_release(&path);
- return ret;
+ return data;
+}
+
+static int has_pack_ext(const struct generated_pack_data *data,
+ const char *ext)
+{
+ int i;
+ for (i = 0; i < ARRAY_SIZE(exts); i++) {
+ if (strcmp(exts[i].name, ext))
+ continue;
+ return !!data->tempfiles[i];
+ }
+ BUG("unknown pack extension: '%s'", ext);
}
static void repack_promisor_objects(const struct pack_objects_args *args,
@@ -275,7 +376,7 @@ static void repack_promisor_objects(const struct pack_objects_args *args,
FILE *out;
struct strbuf line = STRBUF_INIT;
- prepare_pack_objects(&cmd, args);
+ prepare_pack_objects(&cmd, args, packtmp);
cmd.in = -1;
/*
@@ -320,7 +421,7 @@ static void repack_promisor_objects(const struct pack_objects_args *args,
line.buf);
write_promisor_file(promisor_name, NULL, 0);
- item->util = (void *)(uintptr_t)populate_pack_exts(item->string);
+ item->util = populate_pack_exts(item->string);
free(promisor_name);
}
@@ -333,6 +434,8 @@ struct pack_geometry {
struct packed_git **pack;
uint32_t pack_nr, pack_alloc;
uint32_t split;
+
+ int split_factor;
};
static uint32_t geometry_pack_weight(struct packed_git *p)
@@ -354,36 +457,42 @@ static int geometry_cmp(const void *va, const void *vb)
return 0;
}
-static void init_pack_geometry(struct pack_geometry **geometry_p,
- struct string_list *existing_kept_packs)
+static void init_pack_geometry(struct pack_geometry *geometry,
+ struct existing_packs *existing,
+ const struct pack_objects_args *args)
{
struct packed_git *p;
- struct pack_geometry *geometry;
struct strbuf buf = STRBUF_INIT;
- *geometry_p = xcalloc(1, sizeof(struct pack_geometry));
- geometry = *geometry_p;
-
for (p = get_all_packs(the_repository); p; p = p->next) {
+ if (args->local && !p->pack_local)
+ /*
+ * When asked to only repack local packfiles we skip
+ * over any packfiles that are borrowed from alternate
+ * object directories.
+ */
+ continue;
+
if (!pack_kept_objects) {
/*
- * Any pack that has its pack_keep bit set will appear
- * in existing_kept_packs below, but this saves us from
- * doing a more expensive check.
+ * Any pack that has its pack_keep bit set will
+ * appear in existing->kept_packs below, but
+ * this saves us from doing a more expensive
+ * check.
*/
if (p->pack_keep)
continue;
/*
- * The pack may be kept via the --keep-pack option;
- * check 'existing_kept_packs' to determine whether to
- * ignore it.
+ * The pack may be kept via the --keep-pack
+ * option; check 'existing->kept_packs' to
+ * determine whether to ignore it.
*/
strbuf_reset(&buf);
strbuf_addstr(&buf, pack_basename(p));
strbuf_strip_suffix(&buf, ".pack");
- if (string_list_has_string(existing_kept_packs, buf.buf))
+ if (string_list_has_string(&existing->kept_packs, buf.buf))
continue;
}
if (p->is_cruft)
@@ -401,7 +510,7 @@ static void init_pack_geometry(struct pack_geometry **geometry_p,
strbuf_release(&buf);
}
-static void split_pack_geometry(struct pack_geometry *geometry, int factor)
+static void split_pack_geometry(struct pack_geometry *geometry)
{
uint32_t i;
uint32_t split;
@@ -420,12 +529,14 @@ static void split_pack_geometry(struct pack_geometry *geometry, int factor)
struct packed_git *ours = geometry->pack[i];
struct packed_git *prev = geometry->pack[i - 1];
- if (unsigned_mult_overflows(factor, geometry_pack_weight(prev)))
+ if (unsigned_mult_overflows(geometry->split_factor,
+ geometry_pack_weight(prev)))
die(_("pack %s too large to consider in geometric "
"progression"),
prev->pack_name);
- if (geometry_pack_weight(ours) < factor * geometry_pack_weight(prev))
+ if (geometry_pack_weight(ours) <
+ geometry->split_factor * geometry_pack_weight(prev))
break;
}
@@ -460,10 +571,12 @@ static void split_pack_geometry(struct pack_geometry *geometry, int factor)
for (i = split; i < geometry->pack_nr; i++) {
struct packed_git *ours = geometry->pack[i];
- if (unsigned_mult_overflows(factor, total_size))
+ if (unsigned_mult_overflows(geometry->split_factor,
+ total_size))
die(_("pack %s too large to roll up"), ours->pack_name);
- if (geometry_pack_weight(ours) < factor * total_size) {
+ if (geometry_pack_weight(ours) <
+ geometry->split_factor * total_size) {
if (unsigned_add_overflows(total_size,
geometry_pack_weight(ours)))
die(_("pack %s too large to roll up"),
@@ -478,8 +591,10 @@ static void split_pack_geometry(struct pack_geometry *geometry, int factor)
geometry->split = split;
}
-static struct packed_git *get_largest_active_pack(struct pack_geometry *geometry)
+static struct packed_git *get_preferred_pack(struct pack_geometry *geometry)
{
+ uint32_t i;
+
if (!geometry) {
/*
* No geometry means either an all-into-one repack (in which
@@ -494,18 +609,55 @@ static struct packed_git *get_largest_active_pack(struct pack_geometry *geometry
}
if (geometry->split == geometry->pack_nr)
return NULL;
- return geometry->pack[geometry->pack_nr - 1];
+
+ /*
+ * The preferred pack is the largest pack above the split line. In
+ * other words, it is the largest pack that does not get rolled up in
+ * the geometric repack.
+ */
+ for (i = geometry->pack_nr; i > geometry->split; i--)
+ /*
+ * A pack that is not local would never be included in a
+ * multi-pack index. We thus skip over any non-local packs.
+ */
+ if (geometry->pack[i - 1]->pack_local)
+ return geometry->pack[i - 1];
+
+ return NULL;
+}
+
+static void geometry_remove_redundant_packs(struct pack_geometry *geometry,
+ struct string_list *names,
+ struct existing_packs *existing)
+{
+ struct strbuf buf = STRBUF_INIT;
+ uint32_t i;
+
+ for (i = 0; i < geometry->split; i++) {
+ struct packed_git *p = geometry->pack[i];
+ if (string_list_has_string(names, hash_to_hex(p->hash)))
+ continue;
+
+ strbuf_reset(&buf);
+ strbuf_addstr(&buf, pack_basename(p));
+ strbuf_strip_suffix(&buf, ".pack");
+
+ if ((p->pack_keep) ||
+ (string_list_has_string(&existing->kept_packs, buf.buf)))
+ continue;
+
+ remove_redundant_pack(packdir, buf.buf);
+ }
+
+ strbuf_release(&buf);
}
-static void clear_pack_geometry(struct pack_geometry *geometry)
+static void free_pack_geometry(struct pack_geometry *geometry)
{
if (!geometry)
return;
free(geometry->pack);
- geometry->pack_nr = 0;
- geometry->pack_alloc = 0;
- geometry->split = 0;
}
struct midx_snapshot_ref_data {
@@ -514,9 +666,9 @@ struct midx_snapshot_ref_data {
int preferred;
};
-static int midx_snapshot_ref_one(const char *refname,
+static int midx_snapshot_ref_one(const char *refname UNUSED,
const struct object_id *oid,
- int flag, void *_data)
+ int flag UNUSED, void *_data)
{
struct midx_snapshot_ref_data *data = _data;
struct object_id peeled;
@@ -571,57 +723,76 @@ static void midx_snapshot_refs(struct tempfile *f)
}
static void midx_included_packs(struct string_list *include,
- struct string_list *existing_nonkept_packs,
- struct string_list *existing_kept_packs,
+ struct existing_packs *existing,
struct string_list *names,
struct pack_geometry *geometry)
{
struct string_list_item *item;
- for_each_string_list_item(item, existing_kept_packs)
+ for_each_string_list_item(item, &existing->kept_packs)
string_list_insert(include, xstrfmt("%s.idx", item->string));
for_each_string_list_item(item, names)
string_list_insert(include, xstrfmt("pack-%s.idx", item->string));
- if (geometry) {
+ if (geometry->split_factor) {
struct strbuf buf = STRBUF_INIT;
uint32_t i;
for (i = geometry->split; i < geometry->pack_nr; i++) {
struct packed_git *p = geometry->pack[i];
+ /*
+ * The multi-pack index never refers to packfiles part
+ * of an alternate object database, so we skip these.
+ * While git-multi-pack-index(1) would silently ignore
+ * them anyway, this allows us to skip executing the
+ * command completely when we have only non-local
+ * packfiles.
+ */
+ if (!p->pack_local)
+ continue;
+
strbuf_addstr(&buf, pack_basename(p));
strbuf_strip_suffix(&buf, ".pack");
strbuf_addstr(&buf, ".idx");
string_list_insert(include, strbuf_detach(&buf, NULL));
}
-
- for_each_string_list_item(item, existing_nonkept_packs) {
- if (!((uintptr_t)item->util & CRUFT_PACK)) {
- /*
- * no need to check DELETE_PACK, since we're not
- * doing an ALL_INTO_ONE repack
- */
- continue;
- }
- string_list_insert(include, xstrfmt("%s.idx", item->string));
- }
} else {
- for_each_string_list_item(item, existing_nonkept_packs) {
- if ((uintptr_t)item->util & DELETE_PACK)
+ for_each_string_list_item(item, &existing->non_kept_packs) {
+ if (pack_is_marked_for_deletion(item))
continue;
string_list_insert(include, xstrfmt("%s.idx", item->string));
}
}
+
+ for_each_string_list_item(item, &existing->cruft_packs) {
+ /*
+ * When doing a --geometric repack, there is no need to check
+ * for deleted packs, since we're by definition not doing an
+ * ALL_INTO_ONE repack (hence no packs will be deleted).
+ * Otherwise we must check for and exclude any packs which are
+ * enqueued for deletion.
+ *
+ * So we could omit the conditional below in the --geometric
+ * case, but doing so is unnecessary since no packs are marked
+ * as pending deletion (since we only call
+ * `mark_packs_for_deletion()` when doing an all-into-one
+ * repack).
+ */
+ if (pack_is_marked_for_deletion(item))
+ continue;
+ string_list_insert(include, xstrfmt("%s.idx", item->string));
+ }
}
static int write_midx_included_packs(struct string_list *include,
struct pack_geometry *geometry,
+ struct string_list *names,
const char *refs_snapshot,
int show_progress, int write_bitmaps)
{
struct child_process cmd = CHILD_PROCESS_INIT;
struct string_list_item *item;
- struct packed_git *largest = get_largest_active_pack(geometry);
+ struct packed_git *preferred = get_preferred_pack(geometry);
FILE *in;
int ret;
@@ -642,9 +813,41 @@ static int write_midx_included_packs(struct string_list *include,
if (write_bitmaps)
strvec_push(&cmd.args, "--bitmap");
- if (largest)
+ if (preferred)
strvec_pushf(&cmd.args, "--preferred-pack=%s",
- pack_basename(largest));
+ pack_basename(preferred));
+ else if (names->nr) {
+ /* The largest pack was repacked, meaning that either
+ * one or two packs exist depending on whether the
+ * repository has a cruft pack or not.
+ *
+ * Select the non-cruft one as preferred to encourage
+ * pack-reuse among packs containing reachable objects
+ * over unreachable ones.
+ *
+ * (Note we could write multiple packs here if
+ * `--max-pack-size` was given, but any one of them
+ * will suffice, so pick the first one.)
+ */
+ for_each_string_list_item(item, names) {
+ struct generated_pack_data *data = item->util;
+ if (has_pack_ext(data, ".mtimes"))
+ continue;
+
+ strvec_pushf(&cmd.args, "--preferred-pack=pack-%s.pack",
+ item->string);
+ break;
+ }
+ } else {
+ /*
+ * No packs were kept, and no packs were written. The
+ * only thing remaining are .keep packs (unless
+ * --pack-kept-objects was given).
+ *
+ * Set the `--preferred-pack` arbitrarily here.
+ */
+ ;
+ }
if (refs_snapshot)
strvec_pushf(&cmd.args, "--refs-snapshot=%s", refs_snapshot);
@@ -661,19 +864,197 @@ static int write_midx_included_packs(struct string_list *include,
return finish_command(&cmd);
}
+static void remove_redundant_bitmaps(struct string_list *include,
+ const char *packdir)
+{
+ struct strbuf path = STRBUF_INIT;
+ struct string_list_item *item;
+ size_t packdir_len;
+
+ strbuf_addstr(&path, packdir);
+ strbuf_addch(&path, '/');
+ packdir_len = path.len;
+
+ /*
+ * Remove any pack bitmaps corresponding to packs which are now
+ * included in the MIDX.
+ */
+ for_each_string_list_item(item, include) {
+ strbuf_addstr(&path, item->string);
+ strbuf_strip_suffix(&path, ".idx");
+ strbuf_addstr(&path, ".bitmap");
+
+ if (unlink(path.buf) && errno != ENOENT)
+ warning_errno(_("could not remove stale bitmap: %s"),
+ path.buf);
+
+ strbuf_setlen(&path, packdir_len);
+ }
+ strbuf_release(&path);
+}
+
+static int finish_pack_objects_cmd(struct child_process *cmd,
+ struct string_list *names,
+ int local)
+{
+ FILE *out;
+ struct strbuf line = STRBUF_INIT;
+
+ out = xfdopen(cmd->out, "r");
+ while (strbuf_getline_lf(&line, out) != EOF) {
+ struct string_list_item *item;
+
+ if (line.len != the_hash_algo->hexsz)
+ die(_("repack: Expecting full hex object ID lines only "
+ "from pack-objects."));
+ /*
+ * Avoid putting packs written outside of the repository in the
+ * list of names.
+ */
+ if (local) {
+ item = string_list_append(names, line.buf);
+ item->util = populate_pack_exts(line.buf);
+ }
+ }
+ fclose(out);
+
+ strbuf_release(&line);
+
+ return finish_command(cmd);
+}
+
+static int write_filtered_pack(const struct pack_objects_args *args,
+ const char *destination,
+ const char *pack_prefix,
+ struct existing_packs *existing,
+ struct string_list *names)
+{
+ struct child_process cmd = CHILD_PROCESS_INIT;
+ struct string_list_item *item;
+ FILE *in;
+ int ret;
+ const char *caret;
+ const char *scratch;
+ int local = skip_prefix(destination, packdir, &scratch);
+
+ prepare_pack_objects(&cmd, args, destination);
+
+ strvec_push(&cmd.args, "--stdin-packs");
+
+ if (!pack_kept_objects)
+ strvec_push(&cmd.args, "--honor-pack-keep");
+ for_each_string_list_item(item, &existing->kept_packs)
+ strvec_pushf(&cmd.args, "--keep-pack=%s", item->string);
+
+ cmd.in = -1;
+
+ ret = start_command(&cmd);
+ if (ret)
+ return ret;
+
+ /*
+ * Here 'names' contains only the pack(s) that were just
+ * written, which is exactly the packs we want to keep. Also
+ * 'existing_kept_packs' already contains the packs in
+ * 'keep_pack_list'.
+ */
+ in = xfdopen(cmd.in, "w");
+ for_each_string_list_item(item, names)
+ fprintf(in, "^%s-%s.pack\n", pack_prefix, item->string);
+ for_each_string_list_item(item, &existing->non_kept_packs)
+ fprintf(in, "%s.pack\n", item->string);
+ for_each_string_list_item(item, &existing->cruft_packs)
+ fprintf(in, "%s.pack\n", item->string);
+ caret = pack_kept_objects ? "" : "^";
+ for_each_string_list_item(item, &existing->kept_packs)
+ fprintf(in, "%s%s.pack\n", caret, item->string);
+ fclose(in);
+
+ return finish_pack_objects_cmd(&cmd, names, local);
+}
+
+static int existing_cruft_pack_cmp(const void *va, const void *vb)
+{
+ struct packed_git *a = *(struct packed_git **)va;
+ struct packed_git *b = *(struct packed_git **)vb;
+
+ if (a->pack_size < b->pack_size)
+ return -1;
+ if (a->pack_size > b->pack_size)
+ return 1;
+ return 0;
+}
+
+static void collapse_small_cruft_packs(FILE *in, size_t max_size,
+ struct existing_packs *existing)
+{
+ struct packed_git **existing_cruft, *p;
+ struct strbuf buf = STRBUF_INIT;
+ size_t total_size = 0;
+ size_t existing_cruft_nr = 0;
+ size_t i;
+
+ ALLOC_ARRAY(existing_cruft, existing->cruft_packs.nr);
+
+ for (p = get_all_packs(the_repository); p; p = p->next) {
+ if (!(p->is_cruft && p->pack_local))
+ continue;
+
+ strbuf_reset(&buf);
+ strbuf_addstr(&buf, pack_basename(p));
+ strbuf_strip_suffix(&buf, ".pack");
+
+ if (!string_list_has_string(&existing->cruft_packs, buf.buf))
+ continue;
+
+ if (existing_cruft_nr >= existing->cruft_packs.nr)
+ BUG("too many cruft packs (found %"PRIuMAX", but knew "
+ "of %"PRIuMAX")",
+ (uintmax_t)existing_cruft_nr + 1,
+ (uintmax_t)existing->cruft_packs.nr);
+ existing_cruft[existing_cruft_nr++] = p;
+ }
+
+ QSORT(existing_cruft, existing_cruft_nr, existing_cruft_pack_cmp);
+
+ for (i = 0; i < existing_cruft_nr; i++) {
+ size_t proposed;
+
+ p = existing_cruft[i];
+ proposed = st_add(total_size, p->pack_size);
+
+ if (proposed <= max_size) {
+ total_size = proposed;
+ fprintf(in, "-%s\n", pack_basename(p));
+ } else {
+ retain_cruft_pack(existing, p);
+ fprintf(in, "%s\n", pack_basename(p));
+ }
+ }
+
+ for (i = 0; i < existing->non_kept_packs.nr; i++)
+ fprintf(in, "-%s.pack\n",
+ existing->non_kept_packs.items[i].string);
+
+ strbuf_release(&buf);
+ free(existing_cruft);
+}
+
static int write_cruft_pack(const struct pack_objects_args *args,
+ const char *destination,
const char *pack_prefix,
+ const char *cruft_expiration,
struct string_list *names,
- struct string_list *existing_packs,
- struct string_list *existing_kept_packs)
+ struct existing_packs *existing)
{
struct child_process cmd = CHILD_PROCESS_INIT;
- struct strbuf line = STRBUF_INIT;
struct string_list_item *item;
- FILE *in, *out;
+ FILE *in;
int ret;
+ const char *scratch;
+ int local = skip_prefix(destination, packdir, &scratch);
- prepare_pack_objects(&cmd, args);
+ prepare_pack_objects(&cmd, args, destination);
strvec_push(&cmd.args, "--cruft");
if (cruft_expiration)
@@ -682,7 +1063,6 @@ static int write_cruft_pack(const struct pack_objects_args *args,
strvec_push(&cmd.args, "--honor-pack-keep");
strvec_push(&cmd.args, "--non-empty");
- strvec_push(&cmd.args, "--max-pack-size=0");
cmd.in = -1;
@@ -698,28 +1078,38 @@ static int write_cruft_pack(const struct pack_objects_args *args,
* By the time it is read here, it contains only the pack(s)
* that were just written, which is exactly the set of packs we
* want to consider kept.
+ *
+ * If `--expire-to` is given, the double-use served by `names`
+ * ensures that the pack written to `--expire-to` excludes any
+ * objects contained in the cruft pack.
*/
in = xfdopen(cmd.in, "w");
for_each_string_list_item(item, names)
fprintf(in, "%s-%s.pack\n", pack_prefix, item->string);
- for_each_string_list_item(item, existing_packs)
- fprintf(in, "-%s.pack\n", item->string);
- for_each_string_list_item(item, existing_kept_packs)
+ if (args->max_pack_size && !cruft_expiration) {
+ collapse_small_cruft_packs(in, args->max_pack_size, existing);
+ } else {
+ for_each_string_list_item(item, &existing->non_kept_packs)
+ fprintf(in, "-%s.pack\n", item->string);
+ for_each_string_list_item(item, &existing->cruft_packs)
+ fprintf(in, "-%s.pack\n", item->string);
+ }
+ for_each_string_list_item(item, &existing->kept_packs)
fprintf(in, "%s.pack\n", item->string);
fclose(in);
- out = xfdopen(cmd.out, "r");
- while (strbuf_getline_lf(&line, out) != EOF) {
- if (line.len != the_hash_algo->hexsz)
- die(_("repack: Expecting full hex object ID lines only "
- "from pack-objects."));
- string_list_append(names, line.buf);
- }
- fclose(out);
-
- strbuf_release(&line);
+ return finish_pack_objects_cmd(&cmd, names, local);
+}
- return finish_command(&cmd);
+static const char *find_pack_prefix(const char *packdir, const char *packtmp)
+{
+ const char *pack_prefix;
+ if (!skip_prefix(packtmp, packdir, &pack_prefix))
+ die(_("pack prefix %s does not begin with objdir %s"),
+ packtmp, packdir);
+ if (*pack_prefix == '/')
+ pack_prefix++;
+ return pack_prefix;
}
int cmd_repack(int argc, const char **argv, const char *prefix)
@@ -727,14 +1117,10 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
struct child_process cmd = CHILD_PROCESS_INIT;
struct string_list_item *item;
struct string_list names = STRING_LIST_INIT_DUP;
- struct string_list rollback = STRING_LIST_INIT_NODUP;
- struct string_list existing_nonkept_packs = STRING_LIST_INIT_DUP;
- struct string_list existing_kept_packs = STRING_LIST_INIT_DUP;
- struct pack_geometry *geometry = NULL;
- struct strbuf line = STRBUF_INIT;
+ struct existing_packs existing = EXISTING_PACKS_INIT;
+ struct pack_geometry geometry = { 0 };
struct tempfile *refs_snapshot = NULL;
int i, ext, ret;
- FILE *out;
int show_progress;
/* variables to be filled by option parsing */
@@ -744,8 +1130,10 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
struct string_list keep_pack_list = STRING_LIST_INIT_NODUP;
struct pack_objects_args po_args = {NULL};
struct pack_objects_args cruft_po_args = {NULL};
- int geometric_factor = 0;
int write_midx = 0;
+ const char *cruft_expiration = NULL;
+ const char *expire_to = NULL;
+ const char *filter_to = NULL;
struct option builtin_repack_options[] = {
OPT_BIT('a', NULL, &pack_everything,
@@ -757,7 +1145,9 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
N_("same as -a, pack unreachable cruft objects separately"),
PACK_CRUFT),
OPT_STRING(0, "cruft-expiration", &cruft_expiration, N_("approxidate"),
- N_("with -C, expire objects older than this")),
+ N_("with --cruft, expire objects older than this")),
+ OPT_MAGNITUDE(0, "max-cruft-size", &cruft_po_args.max_pack_size,
+ N_("with --cruft, limit the size of new cruft packs")),
OPT_BOOL('d', NULL, &delete_redundant,
N_("remove redundant packs, and run git-prune-packed")),
OPT_BOOL('f', NULL, &po_args.no_reuse_delta,
@@ -785,19 +1175,26 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
N_("limits the maximum delta depth")),
OPT_STRING(0, "threads", &po_args.threads, N_("n"),
N_("limits the maximum number of threads")),
- OPT_STRING(0, "max-pack-size", &po_args.max_pack_size, N_("bytes"),
+ OPT_MAGNITUDE(0, "max-pack-size", &po_args.max_pack_size,
N_("maximum size of each packfile")),
+ OPT_PARSE_LIST_OBJECTS_FILTER(&po_args.filter_options),
OPT_BOOL(0, "pack-kept-objects", &pack_kept_objects,
N_("repack objects in packs marked with .keep")),
OPT_STRING_LIST(0, "keep-pack", &keep_pack_list, N_("name"),
N_("do not repack this pack")),
- OPT_INTEGER('g', "geometric", &geometric_factor,
+ OPT_INTEGER('g', "geometric", &geometry.split_factor,
N_("find a geometric progression with factor <N>")),
OPT_BOOL('m', "write-midx", &write_midx,
N_("write a multi-pack index of the resulting packs")),
+ OPT_STRING(0, "expire-to", &expire_to, N_("dir"),
+ N_("pack prefix to store a pack containing pruned objects")),
+ OPT_STRING(0, "filter-to", &filter_to, N_("dir"),
+ N_("pack prefix to store a pack containing filtered out objects")),
OPT_END()
};
+ list_objects_filter_init(&po_args.filter_options);
+
git_config(repack_config, &cruft_po_args);
argc = parse_options(argc, argv, prefix, builtin_repack_options,
@@ -806,19 +1203,13 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
if (delete_redundant && repository_format_precious_objects)
die(_("cannot delete packs in a precious-objects repo"));
- if (keep_unreachable &&
- (unpack_unreachable || (pack_everything & LOOSEN_UNREACHABLE)))
- die(_("options '%s' and '%s' cannot be used together"), "--keep-unreachable", "-A");
+ die_for_incompatible_opt3(unpack_unreachable || (pack_everything & LOOSEN_UNREACHABLE), "-A",
+ keep_unreachable, "-k/--keep-unreachable",
+ pack_everything & PACK_CRUFT, "--cruft");
- if (pack_everything & PACK_CRUFT) {
+ if (pack_everything & PACK_CRUFT)
pack_everything |= ALL_INTO_ONE;
- if (unpack_unreachable || (pack_everything & LOOSEN_UNREACHABLE))
- die(_("options '%s' and '%s' cannot be used together"), "--cruft", "-A");
- if (keep_unreachable)
- die(_("options '%s' and '%s' cannot be used together"), "--cruft", "-k");
- }
-
if (write_bitmaps < 0) {
if (!write_midx &&
(!(pack_everything & ALL_INTO_ONE) || !is_bare_repository()))
@@ -834,6 +1225,18 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
if (write_bitmaps && !(pack_everything & ALL_INTO_ONE) && !write_midx)
die(_(incremental_bitmap_conflict_error));
+ if (write_bitmaps && po_args.local && has_alt_odb(the_repository)) {
+ /*
+ * When asked to do a local repack, but we have
+ * packfiles that are inherited from an alternate, then
+ * we cannot guarantee that the multi-pack-index would
+ * have full coverage of all objects. We thus disable
+ * writing bitmaps in that case.
+ */
+ warning(_("disabling bitmap writing, as some objects are not being packed"));
+ write_bitmaps = 0;
+ }
+
if (write_midx && write_bitmaps) {
struct strbuf path = STRBUF_INIT;
@@ -850,19 +1253,16 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
packtmp_name = xstrfmt(".tmp-%d-pack", (int)getpid());
packtmp = mkpathdup("%s/%s", packdir, packtmp_name);
- collect_pack_filenames(&existing_nonkept_packs, &existing_kept_packs,
- &keep_pack_list);
+ collect_pack_filenames(&existing, &keep_pack_list);
- if (geometric_factor) {
+ if (geometry.split_factor) {
if (pack_everything)
die(_("options '%s' and '%s' cannot be used together"), "--geometric", "-A/-a");
- init_pack_geometry(&geometry, &existing_kept_packs);
- split_pack_geometry(geometry, geometric_factor);
+ init_pack_geometry(&geometry, &existing, &po_args);
+ split_pack_geometry(&geometry);
}
- sigchain_push_common(remove_pack_on_signal);
-
- prepare_pack_objects(&cmd, &po_args);
+ prepare_pack_objects(&cmd, &po_args, packtmp);
show_progress = !po_args.quiet && isatty(2);
@@ -873,7 +1273,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
strvec_pushf(&cmd.args, "--keep-pack=%s",
keep_pack_list.items[i].string);
strvec_push(&cmd.args, "--non-empty");
- if (!geometry) {
+ if (!geometry.split_factor) {
/*
* We need to grab all reachable objects, including those that
* are reachable from reflogs and the index.
@@ -888,7 +1288,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
strvec_push(&cmd.args, "--reflog");
strvec_push(&cmd.args, "--indexed-objects");
}
- if (has_promisor_remote())
+ if (repo_has_promisor_remote(the_repository))
strvec_push(&cmd.args, "--exclude-promisor-objects");
if (!write_midx) {
if (write_bitmaps > 0)
@@ -902,7 +1302,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
if (pack_everything & ALL_INTO_ONE) {
repack_promisor_objects(&po_args, &names);
- if (existing_nonkept_packs.nr && delete_redundant &&
+ if (has_existing_non_kept_packs(&existing) &&
+ delete_redundant &&
!(pack_everything & PACK_CRUFT)) {
for_each_string_list_item(item, &names) {
strvec_pushf(&cmd.args, "--keep-pack=%s-%s.pack",
@@ -920,7 +1321,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
strvec_push(&cmd.args, "--pack-loose-unreachable");
}
}
- } else if (geometry) {
+ } else if (geometry.split_factor) {
strvec_push(&cmd.args, "--stdin-packs");
strvec_push(&cmd.args, "--unpacked");
} else {
@@ -928,50 +1329,44 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
strvec_push(&cmd.args, "--incremental");
}
- if (geometry)
+ if (po_args.filter_options.choice)
+ strvec_pushf(&cmd.args, "--filter=%s",
+ expand_list_objects_filter_spec(&po_args.filter_options));
+ else if (filter_to)
+ die(_("option '%s' can only be used along with '%s'"), "--filter-to", "--filter");
+
+ if (geometry.split_factor)
cmd.in = -1;
else
cmd.no_stdin = 1;
ret = start_command(&cmd);
if (ret)
- return ret;
+ goto cleanup;
- if (geometry) {
+ if (geometry.split_factor) {
FILE *in = xfdopen(cmd.in, "w");
/*
* The resulting pack should contain all objects in packs that
* are going to be rolled up, but exclude objects in packs which
* are being left alone.
*/
- for (i = 0; i < geometry->split; i++)
- fprintf(in, "%s\n", pack_basename(geometry->pack[i]));
- for (i = geometry->split; i < geometry->pack_nr; i++)
- fprintf(in, "^%s\n", pack_basename(geometry->pack[i]));
+ for (i = 0; i < geometry.split; i++)
+ fprintf(in, "%s\n", pack_basename(geometry.pack[i]));
+ for (i = geometry.split; i < geometry.pack_nr; i++)
+ fprintf(in, "^%s\n", pack_basename(geometry.pack[i]));
fclose(in);
}
- out = xfdopen(cmd.out, "r");
- while (strbuf_getline_lf(&line, out) != EOF) {
- if (line.len != the_hash_algo->hexsz)
- die(_("repack: Expecting full hex object ID lines only from pack-objects."));
- string_list_append(&names, line.buf);
- }
- fclose(out);
- ret = finish_command(&cmd);
+ ret = finish_pack_objects_cmd(&cmd, &names, 1);
if (ret)
- return ret;
+ goto cleanup;
if (!names.nr && !po_args.quiet)
printf_ln(_("Nothing new to pack."));
if (pack_everything & PACK_CRUFT) {
- const char *pack_prefix;
- if (!skip_prefix(packtmp, packdir, &pack_prefix))
- die(_("pack prefix %s does not begin with objdir %s"),
- packtmp, packdir);
- if (*pack_prefix == '/')
- pack_prefix++;
+ const char *pack_prefix = find_pack_prefix(packdir, packtmp);
if (!cruft_po_args.window)
cruft_po_args.window = po_args.window;
@@ -981,119 +1376,131 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
cruft_po_args.depth = po_args.depth;
if (!cruft_po_args.threads)
cruft_po_args.threads = po_args.threads;
+ if (!cruft_po_args.max_pack_size)
+ cruft_po_args.max_pack_size = po_args.max_pack_size;
cruft_po_args.local = po_args.local;
cruft_po_args.quiet = po_args.quiet;
- ret = write_cruft_pack(&cruft_po_args, pack_prefix, &names,
- &existing_nonkept_packs,
- &existing_kept_packs);
+ ret = write_cruft_pack(&cruft_po_args, packtmp, pack_prefix,
+ cruft_expiration, &names,
+ &existing);
if (ret)
- return ret;
+ goto cleanup;
+
+ if (delete_redundant && expire_to) {
+ /*
+ * If `--expire-to` is given with `-d`, it's possible
+ * that we're about to prune some objects. With cruft
+ * packs, pruning is implicit: any objects from existing
+ * packs that weren't picked up by new packs are removed
+ * when their packs are deleted.
+ *
+ * Generate an additional cruft pack, with one twist:
+ * `names` now includes the name of the cruft pack
+ * written in the previous step. So the contents of
+ * _this_ cruft pack exclude everything contained in the
+ * existing cruft pack (that is, all of the unreachable
+ * objects which are no older than
+ * `--cruft-expiration`).
+ *
+ * To make this work, cruft_expiration must become NULL
+ * so that this cruft pack doesn't actually prune any
+ * objects. If it were non-NULL, this call would always
+ * generate an empty pack (since every object not in the
+ * cruft pack generated above will have an mtime older
+ * than the expiration).
+ */
+ ret = write_cruft_pack(&cruft_po_args, expire_to,
+ pack_prefix,
+ NULL,
+ &names,
+ &existing);
+ if (ret)
+ goto cleanup;
+ }
}
- string_list_sort(&names);
+ if (po_args.filter_options.choice) {
+ if (!filter_to)
+ filter_to = packtmp;
- for_each_string_list_item(item, &names) {
- item->util = (void *)(uintptr_t)populate_pack_exts(item->string);
+ ret = write_filtered_pack(&po_args,
+ filter_to,
+ find_pack_prefix(packdir, packtmp),
+ &existing,
+ &names);
+ if (ret)
+ goto cleanup;
}
+ string_list_sort(&names);
+
close_object_store(the_repository->objects);
/*
* Ok we have prepared all new packfiles.
*/
for_each_string_list_item(item, &names) {
+ struct generated_pack_data *data = item->util;
+
for (ext = 0; ext < ARRAY_SIZE(exts); ext++) {
- char *fname, *fname_old;
+ char *fname;
fname = mkpathdup("%s/pack-%s%s",
packdir, item->string, exts[ext].name);
- fname_old = mkpathdup("%s-%s%s",
- packtmp, item->string, exts[ext].name);
- if (((uintptr_t)item->util) & ((uintptr_t)1 << ext)) {
+ if (data->tempfiles[ext]) {
+ const char *fname_old = get_tempfile_path(data->tempfiles[ext]);
struct stat statbuffer;
+
if (!stat(fname_old, &statbuffer)) {
statbuffer.st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
chmod(fname_old, statbuffer.st_mode);
}
- if (rename(fname_old, fname))
- die_errno(_("renaming '%s' failed"), fname_old);
+ if (rename_tempfile(&data->tempfiles[ext], fname))
+ die_errno(_("renaming pack to '%s' failed"), fname);
} else if (!exts[ext].optional)
- die(_("missing required file: %s"), fname_old);
+ die(_("pack-objects did not write a '%s' file for pack %s-%s"),
+ exts[ext].name, packtmp, item->string);
else if (unlink(fname) < 0 && errno != ENOENT)
die_errno(_("could not unlink: %s"), fname);
free(fname);
- free(fname_old);
}
}
/* End of pack replacement. */
- if (delete_redundant && pack_everything & ALL_INTO_ONE) {
- const int hexsz = the_hash_algo->hexsz;
- for_each_string_list_item(item, &existing_nonkept_packs) {
- char *sha1;
- size_t len = strlen(item->string);
- if (len < hexsz)
- continue;
- sha1 = item->string + len - hexsz;
- /*
- * Mark this pack for deletion, which ensures that this
- * pack won't be included in a MIDX (if `--write-midx`
- * was given) and that we will actually delete this pack
- * (if `-d` was given).
- */
- if (!string_list_has_string(&names, sha1))
- item->util = (void*)(uintptr_t)((size_t)item->util | DELETE_PACK);
- }
- }
+ if (delete_redundant && pack_everything & ALL_INTO_ONE)
+ mark_packs_for_deletion(&existing, &names);
if (write_midx) {
struct string_list include = STRING_LIST_INIT_NODUP;
- midx_included_packs(&include, &existing_nonkept_packs,
- &existing_kept_packs, &names, geometry);
+ midx_included_packs(&include, &existing, &names, &geometry);
- ret = write_midx_included_packs(&include, geometry,
+ ret = write_midx_included_packs(&include, &geometry, &names,
refs_snapshot ? get_tempfile_path(refs_snapshot) : NULL,
show_progress, write_bitmaps > 0);
+ if (!ret && write_bitmaps)
+ remove_redundant_bitmaps(&include, packdir);
+
string_list_clear(&include, 0);
if (ret)
- return ret;
+ goto cleanup;
}
reprepare_packed_git(the_repository);
if (delete_redundant) {
int opts = 0;
- for_each_string_list_item(item, &existing_nonkept_packs) {
- if (!((uintptr_t)item->util & DELETE_PACK))
- continue;
- remove_redundant_pack(packdir, item->string);
- }
-
- if (geometry) {
- struct strbuf buf = STRBUF_INIT;
-
- uint32_t i;
- for (i = 0; i < geometry->split; i++) {
- struct packed_git *p = geometry->pack[i];
- if (string_list_has_string(&names,
- hash_to_hex(p->hash)))
- continue;
+ remove_redundant_existing_packs(&existing);
- strbuf_reset(&buf);
- strbuf_addstr(&buf, pack_basename(p));
- strbuf_strip_suffix(&buf, ".pack");
-
- remove_redundant_pack(packdir, buf.buf);
- }
- strbuf_release(&buf);
- }
+ if (geometry.split_factor)
+ geometry_remove_redundant_packs(&geometry, &names,
+ &existing);
if (show_progress)
opts |= PRUNE_PACKED_VERBOSE;
prune_packed_objects(opts);
@@ -1107,7 +1514,6 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
if (run_update_server_info)
update_server_info(0);
- remove_temporary_files();
if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0)) {
unsigned flags = 0;
@@ -1116,12 +1522,11 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
write_midx_file(get_object_directory(), NULL, NULL, flags);
}
- string_list_clear(&names, 0);
- string_list_clear(&rollback, 0);
- string_list_clear(&existing_nonkept_packs, 0);
- string_list_clear(&existing_kept_packs, 0);
- clear_pack_geometry(geometry);
- strbuf_release(&line);
+cleanup:
+ string_list_clear(&names, 1);
+ existing_packs_release(&existing);
+ free_pack_geometry(&geometry);
+ list_objects_filter_release(&po_args.filter_options);
- return 0;
+ return ret;
}
diff --git a/builtin/replace.c b/builtin/replace.c
index 583702a..da59600 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -8,15 +8,23 @@
* git-tag.sh and mktag.c by Linus Torvalds.
*/
-#include "cache.h"
-#include "config.h"
#include "builtin.h"
+#include "config.h"
+#include "editor.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "refs.h"
#include "parse-options.h"
+#include "path.h"
#include "run-command.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "replace-object.h"
#include "repository.h"
#include "tag.h"
+#include "wildmatch.h"
static const char * const git_replace_usage[] = {
N_("git replace [-f] <object> <replacement>"),
@@ -41,7 +49,7 @@ struct show_data {
static int show_reference(struct repository *r, const char *refname,
const struct object_id *oid,
- int flag, void *cb_data)
+ int flag UNUSED, void *cb_data)
{
struct show_data *data = cb_data;
@@ -54,7 +62,7 @@ static int show_reference(struct repository *r, const char *refname,
struct object_id object;
enum object_type obj_type, repl_type;
- if (get_oid(refname, &object))
+ if (repo_get_oid(r, refname, &object))
return error(_("failed to resolve '%s' as a valid ref"), refname);
obj_type = oid_object_info(r, &object, NULL);
@@ -106,12 +114,13 @@ static int for_each_replace_name(const char **argv, each_replace_name_fn fn)
size_t base_len;
int had_error = 0;
struct object_id oid;
+ const char *git_replace_ref_base = ref_namespace[NAMESPACE_REPLACE].ref;
strbuf_addstr(&ref, git_replace_ref_base);
base_len = ref.len;
for (p = argv; *p; p++) {
- if (get_oid(*p, &oid)) {
+ if (repo_get_oid(the_repository, *p, &oid)) {
error("failed to resolve '%s' as a valid ref", *p);
had_error = 1;
continue;
@@ -147,6 +156,8 @@ static int check_ref_valid(struct object_id *object,
struct strbuf *ref,
int force)
{
+ const char *git_replace_ref_base = ref_namespace[NAMESPACE_REPLACE].ref;
+
strbuf_reset(ref);
strbuf_addf(ref, "%s%s", git_replace_ref_base, oid_to_hex(object));
if (check_refname_format(ref->buf, 0))
@@ -203,10 +214,10 @@ static int replace_object(const char *object_ref, const char *replace_ref, int f
{
struct object_id object, repl;
- if (get_oid(object_ref, &object))
+ if (repo_get_oid(the_repository, object_ref, &object))
return error(_("failed to resolve '%s' as a valid ref"),
object_ref);
- if (get_oid(replace_ref, &repl))
+ if (repo_get_oid(the_repository, replace_ref, &repl))
return error(_("failed to resolve '%s' as a valid ref"),
replace_ref);
@@ -317,7 +328,7 @@ static int edit_and_replace(const char *object_ref, int force, int raw)
struct object_id old_oid, new_oid, prev;
struct strbuf ref = STRBUF_INIT;
- if (get_oid(object_ref, &old_oid) < 0)
+ if (repo_get_oid(the_repository, object_ref, &old_oid) < 0)
return error(_("not a valid object name: '%s'"), object_ref);
type = oid_object_info(the_repository, &old_oid, NULL);
@@ -372,7 +383,7 @@ static int replace_parents(struct strbuf *buf, int argc, const char **argv)
struct object_id oid;
struct commit *commit;
- if (get_oid(argv[i], &oid) < 0) {
+ if (repo_get_oid(the_repository, argv[i], &oid) < 0) {
strbuf_release(&new_parents);
return error(_("not a valid object name: '%s'"),
argv[i]);
@@ -398,7 +409,7 @@ struct check_mergetag_data {
const char **argv;
};
-static int check_one_mergetag(struct commit *commit,
+static int check_one_mergetag(struct commit *commit UNUSED,
struct commit_extra_header *extra,
void *data)
{
@@ -419,7 +430,7 @@ static int check_one_mergetag(struct commit *commit,
/* iterate over new parents */
for (i = 1; i < mergetag_data->argc; i++) {
struct object_id oid;
- if (get_oid(mergetag_data->argv[i], &oid) < 0)
+ if (repo_get_oid(the_repository, mergetag_data->argv[i], &oid) < 0)
return error(_("not a valid object name: '%s'"),
mergetag_data->argv[i]);
if (oideq(get_tagged_oid(tag), &oid))
@@ -449,15 +460,15 @@ static int create_graft(int argc, const char **argv, int force, int gentle)
const char *buffer;
unsigned long size;
- if (get_oid(old_ref, &old_oid) < 0)
+ if (repo_get_oid(the_repository, old_ref, &old_oid) < 0)
return error(_("not a valid object name: '%s'"), old_ref);
commit = lookup_commit_reference(the_repository, &old_oid);
if (!commit)
return error(_("could not parse %s"), old_ref);
- buffer = get_commit_buffer(commit, &size);
+ buffer = repo_get_commit_buffer(the_repository, commit, &size);
strbuf_add(&buf, buffer, size);
- unuse_commit_buffer(commit, buffer);
+ repo_unuse_commit_buffer(the_repository, commit, buffer);
if (replace_parents(&buf, argc - 1, &argv[1]) < 0) {
strbuf_release(&buf);
@@ -556,7 +567,7 @@ int cmd_replace(int argc, const char **argv, const char *prefix)
OPT_END()
};
- read_replace_refs = 0;
+ disable_replace_refs();
git_config(git_default_config, NULL);
argc = parse_options(argc, argv, prefix, options, git_replace_usage, 0);
diff --git a/builtin/replay.c b/builtin/replay.c
new file mode 100644
index 0000000..6bc4b47
--- /dev/null
+++ b/builtin/replay.c
@@ -0,0 +1,446 @@
+/*
+ * "git replay" builtin command
+ */
+
+#define USE_THE_INDEX_VARIABLE
+#include "git-compat-util.h"
+
+#include "builtin.h"
+#include "environment.h"
+#include "hex.h"
+#include "lockfile.h"
+#include "merge-ort.h"
+#include "object-name.h"
+#include "parse-options.h"
+#include "refs.h"
+#include "revision.h"
+#include "strmap.h"
+#include <oidset.h>
+#include <tree.h>
+
+static const char *short_commit_name(struct commit *commit)
+{
+ return repo_find_unique_abbrev(the_repository, &commit->object.oid,
+ DEFAULT_ABBREV);
+}
+
+static struct commit *peel_committish(const char *name)
+{
+ struct object *obj;
+ struct object_id oid;
+
+ if (repo_get_oid(the_repository, name, &oid))
+ return NULL;
+ obj = parse_object(the_repository, &oid);
+ return (struct commit *)repo_peel_to_type(the_repository, name, 0, obj,
+ OBJ_COMMIT);
+}
+
+static char *get_author(const char *message)
+{
+ size_t len;
+ const char *a;
+
+ a = find_commit_header(message, "author", &len);
+ if (a)
+ return xmemdupz(a, len);
+
+ return NULL;
+}
+
+static struct commit *create_commit(struct tree *tree,
+ struct commit *based_on,
+ struct commit *parent)
+{
+ struct object_id ret;
+ struct object *obj;
+ struct commit_list *parents = NULL;
+ char *author;
+ char *sign_commit = NULL; /* FIXME: cli users might want to sign again */
+ struct commit_extra_header *extra;
+ struct strbuf msg = STRBUF_INIT;
+ const char *out_enc = get_commit_output_encoding();
+ const char *message = repo_logmsg_reencode(the_repository, based_on,
+ NULL, out_enc);
+ const char *orig_message = NULL;
+ const char *exclude_gpgsig[] = { "gpgsig", NULL };
+
+ commit_list_insert(parent, &parents);
+ extra = read_commit_extra_headers(based_on, exclude_gpgsig);
+ find_commit_subject(message, &orig_message);
+ strbuf_addstr(&msg, orig_message);
+ author = get_author(message);
+ reset_ident_date();
+ if (commit_tree_extended(msg.buf, msg.len, &tree->object.oid, parents,
+ &ret, author, NULL, sign_commit, extra)) {
+ error(_("failed to write commit object"));
+ return NULL;
+ }
+ free(author);
+ strbuf_release(&msg);
+
+ obj = parse_object(the_repository, &ret);
+ return (struct commit *)obj;
+}
+
+struct ref_info {
+ struct commit *onto;
+ struct strset positive_refs;
+ struct strset negative_refs;
+ int positive_refexprs;
+ int negative_refexprs;
+};
+
+static void get_ref_information(struct rev_cmdline_info *cmd_info,
+ struct ref_info *ref_info)
+{
+ int i;
+
+ ref_info->onto = NULL;
+ strset_init(&ref_info->positive_refs);
+ strset_init(&ref_info->negative_refs);
+ ref_info->positive_refexprs = 0;
+ ref_info->negative_refexprs = 0;
+
+ /*
+ * When the user specifies e.g.
+ * git replay origin/main..mybranch
+ * git replay ^origin/next mybranch1 mybranch2
+ * we want to be able to determine where to replay the commits. In
+ * these examples, the branches are probably based on an old version
+ * of either origin/main or origin/next, so we want to replay on the
+ * newest version of that branch. In contrast we would want to error
+ * out if they ran
+ * git replay ^origin/master ^origin/next mybranch
+ * git replay mybranch~2..mybranch
+ * the first of those because there's no unique base to choose, and
+ * the second because they'd likely just be replaying commits on top
+ * of the same commit and not making any difference.
+ */
+ for (i = 0; i < cmd_info->nr; i++) {
+ struct rev_cmdline_entry *e = cmd_info->rev + i;
+ struct object_id oid;
+ const char *refexpr = e->name;
+ char *fullname = NULL;
+ int can_uniquely_dwim = 1;
+
+ if (*refexpr == '^')
+ refexpr++;
+ if (repo_dwim_ref(the_repository, refexpr, strlen(refexpr), &oid, &fullname, 0) != 1)
+ can_uniquely_dwim = 0;
+
+ if (e->flags & BOTTOM) {
+ if (can_uniquely_dwim)
+ strset_add(&ref_info->negative_refs, fullname);
+ if (!ref_info->negative_refexprs)
+ ref_info->onto = lookup_commit_reference_gently(the_repository,
+ &e->item->oid, 1);
+ ref_info->negative_refexprs++;
+ } else {
+ if (can_uniquely_dwim)
+ strset_add(&ref_info->positive_refs, fullname);
+ ref_info->positive_refexprs++;
+ }
+
+ free(fullname);
+ }
+}
+
+static void determine_replay_mode(struct rev_cmdline_info *cmd_info,
+ const char *onto_name,
+ const char **advance_name,
+ struct commit **onto,
+ struct strset **update_refs)
+{
+ struct ref_info rinfo;
+
+ get_ref_information(cmd_info, &rinfo);
+ if (!rinfo.positive_refexprs)
+ die(_("need some commits to replay"));
+ if (onto_name && *advance_name)
+ die(_("--onto and --advance are incompatible"));
+ else if (onto_name) {
+ *onto = peel_committish(onto_name);
+ if (rinfo.positive_refexprs <
+ strset_get_size(&rinfo.positive_refs))
+ die(_("all positive revisions given must be references"));
+ } else if (*advance_name) {
+ struct object_id oid;
+ char *fullname = NULL;
+
+ *onto = peel_committish(*advance_name);
+ if (repo_dwim_ref(the_repository, *advance_name, strlen(*advance_name),
+ &oid, &fullname, 0) == 1) {
+ *advance_name = fullname;
+ } else {
+ die(_("argument to --advance must be a reference"));
+ }
+ if (rinfo.positive_refexprs > 1)
+ die(_("cannot advance target with multiple sources because ordering would be ill-defined"));
+ } else {
+ int positive_refs_complete = (
+ rinfo.positive_refexprs ==
+ strset_get_size(&rinfo.positive_refs));
+ int negative_refs_complete = (
+ rinfo.negative_refexprs ==
+ strset_get_size(&rinfo.negative_refs));
+ /*
+ * We need either positive_refs_complete or
+ * negative_refs_complete, but not both.
+ */
+ if (rinfo.negative_refexprs > 0 &&
+ positive_refs_complete == negative_refs_complete)
+ die(_("cannot implicitly determine whether this is an --advance or --onto operation"));
+ if (negative_refs_complete) {
+ struct hashmap_iter iter;
+ struct strmap_entry *entry;
+
+ if (rinfo.negative_refexprs == 0)
+ die(_("all positive revisions given must be references"));
+ else if (rinfo.negative_refexprs > 1)
+ die(_("cannot implicitly determine whether this is an --advance or --onto operation"));
+ else if (rinfo.positive_refexprs > 1)
+ die(_("cannot advance target with multiple source branches because ordering would be ill-defined"));
+
+ /* Only one entry, but we have to loop to get it */
+ strset_for_each_entry(&rinfo.negative_refs,
+ &iter, entry) {
+ *advance_name = entry->key;
+ }
+ } else { /* positive_refs_complete */
+ if (rinfo.negative_refexprs > 1)
+ die(_("cannot implicitly determine correct base for --onto"));
+ if (rinfo.negative_refexprs == 1)
+ *onto = rinfo.onto;
+ }
+ }
+ if (!*advance_name) {
+ *update_refs = xcalloc(1, sizeof(**update_refs));
+ **update_refs = rinfo.positive_refs;
+ memset(&rinfo.positive_refs, 0, sizeof(**update_refs));
+ }
+ strset_clear(&rinfo.negative_refs);
+ strset_clear(&rinfo.positive_refs);
+}
+
+static struct commit *mapped_commit(kh_oid_map_t *replayed_commits,
+ struct commit *commit,
+ struct commit *fallback)
+{
+ khint_t pos = kh_get_oid_map(replayed_commits, commit->object.oid);
+ if (pos == kh_end(replayed_commits))
+ return fallback;
+ return kh_value(replayed_commits, pos);
+}
+
+static struct commit *pick_regular_commit(struct commit *pickme,
+ kh_oid_map_t *replayed_commits,
+ struct commit *onto,
+ struct merge_options *merge_opt,
+ struct merge_result *result)
+{
+ struct commit *base, *replayed_base;
+ struct tree *pickme_tree, *base_tree;
+
+ base = pickme->parents->item;
+ replayed_base = mapped_commit(replayed_commits, base, onto);
+
+ result->tree = repo_get_commit_tree(the_repository, replayed_base);
+ pickme_tree = repo_get_commit_tree(the_repository, pickme);
+ base_tree = repo_get_commit_tree(the_repository, base);
+
+ merge_opt->branch1 = short_commit_name(replayed_base);
+ merge_opt->branch2 = short_commit_name(pickme);
+ merge_opt->ancestor = xstrfmt("parent of %s", merge_opt->branch2);
+
+ merge_incore_nonrecursive(merge_opt,
+ base_tree,
+ result->tree,
+ pickme_tree,
+ result);
+
+ free((char*)merge_opt->ancestor);
+ merge_opt->ancestor = NULL;
+ if (!result->clean)
+ return NULL;
+ return create_commit(result->tree, pickme, replayed_base);
+}
+
+int cmd_replay(int argc, const char **argv, const char *prefix)
+{
+ const char *advance_name = NULL;
+ struct commit *onto = NULL;
+ const char *onto_name = NULL;
+ int contained = 0;
+
+ struct rev_info revs;
+ struct commit *last_commit = NULL;
+ struct commit *commit;
+ struct merge_options merge_opt;
+ struct merge_result result;
+ struct strset *update_refs = NULL;
+ kh_oid_map_t *replayed_commits;
+ int ret = 0;
+
+ const char * const replay_usage[] = {
+ N_("(EXPERIMENTAL!) git replay "
+ "([--contained] --onto <newbase> | --advance <branch>) "
+ "<revision-range>..."),
+ NULL
+ };
+ struct option replay_options[] = {
+ OPT_STRING(0, "advance", &advance_name,
+ N_("branch"),
+ N_("make replay advance given branch")),
+ OPT_STRING(0, "onto", &onto_name,
+ N_("revision"),
+ N_("replay onto given commit")),
+ OPT_BOOL(0, "contained", &contained,
+ N_("advance all branches contained in revision-range")),
+ OPT_END()
+ };
+
+ argc = parse_options(argc, argv, prefix, replay_options, replay_usage,
+ PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN_OPT);
+
+ if (!onto_name && !advance_name) {
+ error(_("option --onto or --advance is mandatory"));
+ usage_with_options(replay_usage, replay_options);
+ }
+
+ if (advance_name && contained)
+ die(_("options '%s' and '%s' cannot be used together"),
+ "--advance", "--contained");
+
+ repo_init_revisions(the_repository, &revs, prefix);
+
+ /*
+ * Set desired values for rev walking options here. If they
+ * are changed by some user specified option in setup_revisions()
+ * below, we will detect that below and then warn.
+ *
+ * TODO: In the future we might want to either die(), or allow
+ * some options changing these values if we think they could
+ * be useful.
+ */
+ revs.reverse = 1;
+ revs.sort_order = REV_SORT_IN_GRAPH_ORDER;
+ revs.topo_order = 1;
+ revs.simplify_history = 0;
+
+ argc = setup_revisions(argc, argv, &revs, NULL);
+ if (argc > 1) {
+ ret = error(_("unrecognized argument: %s"), argv[1]);
+ goto cleanup;
+ }
+
+ /*
+ * Detect and warn if we override some user specified rev
+ * walking options.
+ */
+ if (revs.reverse != 1) {
+ warning(_("some rev walking options will be overridden as "
+ "'%s' bit in 'struct rev_info' will be forced"),
+ "reverse");
+ revs.reverse = 1;
+ }
+ if (revs.sort_order != REV_SORT_IN_GRAPH_ORDER) {
+ warning(_("some rev walking options will be overridden as "
+ "'%s' bit in 'struct rev_info' will be forced"),
+ "sort_order");
+ revs.sort_order = REV_SORT_IN_GRAPH_ORDER;
+ }
+ if (revs.topo_order != 1) {
+ warning(_("some rev walking options will be overridden as "
+ "'%s' bit in 'struct rev_info' will be forced"),
+ "topo_order");
+ revs.topo_order = 1;
+ }
+ if (revs.simplify_history != 0) {
+ warning(_("some rev walking options will be overridden as "
+ "'%s' bit in 'struct rev_info' will be forced"),
+ "simplify_history");
+ revs.simplify_history = 0;
+ }
+
+ determine_replay_mode(&revs.cmdline, onto_name, &advance_name,
+ &onto, &update_refs);
+
+ if (!onto) /* FIXME: Should handle replaying down to root commit */
+ die("Replaying down to root commit is not supported yet!");
+
+ if (prepare_revision_walk(&revs) < 0) {
+ ret = error(_("error preparing revisions"));
+ goto cleanup;
+ }
+
+ init_merge_options(&merge_opt, the_repository);
+ memset(&result, 0, sizeof(result));
+ merge_opt.show_rename_progress = 0;
+ last_commit = onto;
+ replayed_commits = kh_init_oid_map();
+ while ((commit = get_revision(&revs))) {
+ const struct name_decoration *decoration;
+ khint_t pos;
+ int hr;
+
+ if (!commit->parents)
+ die(_("replaying down to root commit is not supported yet!"));
+ if (commit->parents->next)
+ die(_("replaying merge commits is not supported yet!"));
+
+ last_commit = pick_regular_commit(commit, replayed_commits, onto,
+ &merge_opt, &result);
+ if (!last_commit)
+ break;
+
+ /* Record commit -> last_commit mapping */
+ pos = kh_put_oid_map(replayed_commits, commit->object.oid, &hr);
+ if (hr == 0)
+ BUG("Duplicate rewritten commit: %s\n",
+ oid_to_hex(&commit->object.oid));
+ kh_value(replayed_commits, pos) = last_commit;
+
+ /* Update any necessary branches */
+ if (advance_name)
+ continue;
+ decoration = get_name_decoration(&commit->object);
+ if (!decoration)
+ continue;
+ while (decoration) {
+ if (decoration->type == DECORATION_REF_LOCAL &&
+ (contained || strset_contains(update_refs,
+ decoration->name))) {
+ printf("update %s %s %s\n",
+ decoration->name,
+ oid_to_hex(&last_commit->object.oid),
+ oid_to_hex(&commit->object.oid));
+ }
+ decoration = decoration->next;
+ }
+ }
+
+ /* In --advance mode, advance the target ref */
+ if (result.clean == 1 && advance_name) {
+ printf("update %s %s %s\n",
+ advance_name,
+ oid_to_hex(&last_commit->object.oid),
+ oid_to_hex(&onto->object.oid));
+ }
+
+ merge_finalize(&merge_opt, &result);
+ kh_destroy_oid_map(replayed_commits);
+ if (update_refs) {
+ strset_clear(update_refs);
+ free(update_refs);
+ }
+ ret = result.clean;
+
+cleanup:
+ release_revisions(&revs);
+
+ /* Return */
+ if (ret < 0)
+ exit(128);
+ return ret ? 0 : 1;
+}
diff --git a/builtin/rerere.c b/builtin/rerere.c
index 83d7a77..b2efc6f 100644
--- a/builtin/rerere.c
+++ b/builtin/rerere.c
@@ -1,8 +1,8 @@
#include "builtin.h"
-#include "cache.h"
#include "config.h"
-#include "dir.h"
+#include "gettext.h"
#include "parse-options.h"
+#include "repository.h"
#include "string-list.h"
#include "rerere.h"
#include "xdiff/xdiff.h"
@@ -10,11 +10,11 @@
#include "pathspec.h"
static const char * const rerere_usage[] = {
- N_("git rerere [clear | forget <path>... | status | remaining | diff | gc]"),
+ N_("git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]"),
NULL,
};
-static int outf(void *dummy, mmbuffer_t *ptr, int nbuf)
+static int outf(void *dummy UNUSED, mmbuffer_t *ptr, int nbuf)
{
int i;
for (i = 0; i < nbuf; i++)
diff --git a/builtin/reset.c b/builtin/reset.c
index 344fff8..1d62ff6 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -7,25 +7,34 @@
*
* Copyright (c) 2005, 2006 Linus Torvalds and Junio C Hamano
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "advice.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hash.h"
+#include "hex.h"
#include "lockfile.h"
-#include "tag.h"
#include "object.h"
#include "pretty.h"
-#include "run-command.h"
#include "refs.h"
#include "diff.h"
#include "diffcore.h"
#include "tree.h"
#include "branch.h"
+#include "object-name.h"
#include "parse-options.h"
+#include "path.h"
#include "unpack-trees.h"
#include "cache-tree.h"
+#include "setup.h"
+#include "sparse-index.h"
#include "submodule.h"
-#include "submodule-config.h"
+#include "trace.h"
+#include "trace2.h"
#include "dir.h"
+#include "add-interactive.h"
#define REFRESH_INDEX_DELAY_WARNING_IN_MS (2 * 1000)
@@ -73,20 +82,22 @@ static int reset_index(const char *ref, const struct object_id *oid, int reset_t
case HARD:
opts.update = 1;
opts.reset = UNPACK_RESET_OVERWRITE_UNTRACKED;
+ opts.skip_cache_tree_update = 1;
break;
case MIXED:
opts.reset = UNPACK_RESET_PROTECT_UNTRACKED;
+ opts.skip_cache_tree_update = 1;
/* but opts.update=0, so working tree not updated */
break;
default:
BUG("invalid reset_type passed to reset_index");
}
- read_cache_unmerged();
+ repo_read_index_unmerged(the_repository);
if (reset_type == KEEP) {
struct object_id head_oid;
- if (get_oid("HEAD", &head_oid))
+ if (repo_get_oid(the_repository, "HEAD", &head_oid))
return error(_("You do not have a valid HEAD."));
if (!fill_tree_descriptor(the_repository, desc + nr, &head_oid))
return error(_("Failed to find tree of HEAD."));
@@ -105,6 +116,10 @@ static int reset_index(const char *ref, const struct object_id *oid, int reset_t
if (reset_type == MIXED || reset_type == HARD) {
tree = parse_tree_indirect(oid);
+ if (!tree) {
+ error(_("unable to read tree (%s)"), oid_to_hex(oid));
+ goto out;
+ }
prime_cache_tree(the_repository, the_repository->index, tree);
}
@@ -121,7 +136,7 @@ static void print_new_head_line(struct commit *commit)
struct strbuf buf = STRBUF_INIT;
printf(_("HEAD is now at %s"),
- find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, &commit->object.oid, DEFAULT_ABBREV));
pp_commit_easy(CMIT_FMT_ONELINE, commit, &buf);
if (buf.len > 0)
@@ -131,7 +146,8 @@ static void print_new_head_line(struct commit *commit)
}
static void update_index_from_diff(struct diff_queue_struct *q,
- struct diff_options *opt, void *data)
+ struct diff_options *opt UNUSED,
+ void *data)
{
int i;
int intent_to_add = *(int *)data;
@@ -143,7 +159,7 @@ static void update_index_from_diff(struct diff_queue_struct *q,
struct cache_entry *ce;
if (!is_in_reset_tree && !intent_to_add) {
- remove_file_from_cache(one->path);
+ remove_file_from_index(&the_index, one->path);
continue;
}
@@ -158,8 +174,8 @@ static void update_index_from_diff(struct diff_queue_struct *q,
* if this entry is outside the sparse cone - this is necessary
* to properly construct the reset sparse directory.
*/
- pos = cache_name_pos(one->path, strlen(one->path));
- if ((pos >= 0 && ce_skip_worktree(active_cache[pos])) ||
+ pos = index_name_pos(&the_index, one->path, strlen(one->path));
+ if ((pos >= 0 && ce_skip_worktree(the_index.cache[pos])) ||
(pos < 0 && !path_in_sparse_checkout(one->path, &the_index)))
ce->ce_flags |= CE_SKIP_WORKTREE;
@@ -170,90 +186,9 @@ static void update_index_from_diff(struct diff_queue_struct *q,
ce->ce_flags |= CE_INTENT_TO_ADD;
set_object_name_for_intent_to_add_entry(ce);
}
- add_cache_entry(ce, ADD_CACHE_OK_TO_ADD | ADD_CACHE_OK_TO_REPLACE);
- }
-}
-
-static int pathspec_needs_expanded_index(const struct pathspec *pathspec)
-{
- unsigned int i, pos;
- int res = 0;
- char *skip_worktree_seen = NULL;
-
- /*
- * When using a magic pathspec, assume for the sake of simplicity that
- * the index needs to be expanded to match all matchable files.
- */
- if (pathspec->magic)
- return 1;
-
- for (i = 0; i < pathspec->nr; i++) {
- struct pathspec_item item = pathspec->items[i];
-
- /*
- * If the pathspec item has a wildcard, the index should be expanded
- * if the pathspec has the possibility of matching a subset of entries inside
- * of a sparse directory (but not the entire directory).
- *
- * If the pathspec item is a literal path, the index only needs to be expanded
- * if a) the pathspec isn't in the sparse checkout cone (to make sure we don't
- * expand for in-cone files) and b) it doesn't match any sparse directories
- * (since we can reset whole sparse directories without expanding them).
- */
- if (item.nowildcard_len < item.len) {
- /*
- * Special case: if the pattern is a path inside the cone
- * followed by only wildcards, the pattern cannot match
- * partial sparse directories, so we know we don't need to
- * expand the index.
- *
- * Examples:
- * - in-cone/foo***: doesn't need expanded index
- * - not-in-cone/bar*: may need expanded index
- * - **.c: may need expanded index
- */
- if (strspn(item.original + item.nowildcard_len, "*") == item.len - item.nowildcard_len &&
- path_in_cone_mode_sparse_checkout(item.original, &the_index))
- continue;
-
- for (pos = 0; pos < active_nr; pos++) {
- struct cache_entry *ce = active_cache[pos];
-
- if (!S_ISSPARSEDIR(ce->ce_mode))
- continue;
-
- /*
- * If the pre-wildcard length is longer than the sparse
- * directory name and the sparse directory is the first
- * component of the pathspec, need to expand the index.
- */
- if (item.nowildcard_len > ce_namelen(ce) &&
- !strncmp(item.original, ce->name, ce_namelen(ce))) {
- res = 1;
- break;
- }
-
- /*
- * If the pre-wildcard length is shorter than the sparse
- * directory and the pathspec does not match the whole
- * directory, need to expand the index.
- */
- if (!strncmp(item.original, ce->name, item.nowildcard_len) &&
- wildmatch(item.original, ce->name, 0)) {
- res = 1;
- break;
- }
- }
- } else if (!path_in_cone_mode_sparse_checkout(item.original, &the_index) &&
- !matches_skip_worktree(pathspec, i, &skip_worktree_seen))
- res = 1;
-
- if (res > 0)
- break;
+ add_index_entry(&the_index, ce,
+ ADD_CACHE_OK_TO_ADD | ADD_CACHE_OK_TO_REPLACE);
}
-
- free(skip_worktree_seen);
- return res;
}
static int read_from_tree(const struct pathspec *pathspec,
@@ -273,7 +208,7 @@ static int read_from_tree(const struct pathspec *pathspec,
opt.change = diff_change;
opt.add_remove = diff_addremove;
- if (pathspec->nr && the_index.sparse_index && pathspec_needs_expanded_index(pathspec))
+ if (pathspec->nr && pathspec_needs_expanded_index(&the_index, pathspec))
ensure_full_index(&the_index);
if (do_diff_cache(tree_oid, &opt))
@@ -300,7 +235,7 @@ static void set_reflog_message(struct strbuf *sb, const char *action,
static void die_if_unmerged_cache(int reset_type)
{
- if (is_merge() || unmerged_cache())
+ if (is_merge() || unmerged_index(&the_index))
die(_("Cannot do a %s reset in the middle of a merge."),
_(reset_type_names[reset_type]));
@@ -337,8 +272,8 @@ static void parse_args(struct pathspec *pathspec,
* has to be unambiguous. If there is a single argument, it
* can not be a tree
*/
- else if ((!argv[1] && !get_oid_committish(argv[0], &unused)) ||
- (argv[1] && !get_oid_treeish(argv[0], &unused))) {
+ else if ((!argv[1] && !repo_get_oid_committish(the_repository, argv[0], &unused)) ||
+ (argv[1] && !repo_get_oid_treeish(the_repository, argv[0], &unused))) {
/*
* Ok, argv[0] looks like a commit/tree; it should not
* be a filename.
@@ -350,7 +285,9 @@ static void parse_args(struct pathspec *pathspec,
verify_filename(prefix, argv[0], 1);
}
}
- *rev_ret = rev;
+
+ /* treat '@' as a shortcut for 'HEAD' */
+ *rev_ret = !strcmp("@", rev) ? "HEAD" : rev;
parse_pathspec(pathspec, 0,
PATHSPEC_PREFER_FULL |
@@ -365,9 +302,9 @@ static int reset_refs(const char *rev, const struct object_id *oid)
struct object_id *orig = NULL, oid_orig,
*old_orig = NULL, oid_old_orig;
- if (!get_oid("ORIG_HEAD", &oid_old_orig))
+ if (!repo_get_oid(the_repository, "ORIG_HEAD", &oid_old_orig))
old_orig = &oid_old_orig;
- if (!get_oid("HEAD", &oid_orig)) {
+ if (!repo_get_oid(the_repository, "HEAD", &oid_orig)) {
orig = &oid_orig;
set_reflog_message(&msg, "updating ORIG_HEAD", NULL);
update_ref(msg.buf, "ORIG_HEAD", orig, old_orig, 0,
@@ -381,12 +318,13 @@ static int reset_refs(const char *rev, const struct object_id *oid)
return update_ref_status;
}
-static int git_reset_config(const char *var, const char *value, void *cb)
+static int git_reset_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(var, "submodule.recurse"))
return git_default_submodule_config(var, value, cb);
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
int cmd_reset(int argc, const char **argv, const char *prefix)
@@ -394,7 +332,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
int reset_type = NONE, update_ref_status = 0, quiet = 0;
int no_refresh = 0;
int patch_mode = 0, pathspec_file_nul = 0, unborn;
- const char *rev, *pathspec_from_file = NULL;
+ const char *rev;
+ char *pathspec_from_file = NULL;
struct object_id oid;
struct pathspec pathspec;
int intent_to_add = 0;
@@ -402,18 +341,25 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
OPT__QUIET(&quiet, N_("be quiet, only report errors")),
OPT_BOOL(0, "no-refresh", &no_refresh,
N_("skip refreshing the index after reset")),
- OPT_SET_INT(0, "mixed", &reset_type,
- N_("reset HEAD and index"), MIXED),
- OPT_SET_INT(0, "soft", &reset_type, N_("reset only HEAD"), SOFT),
- OPT_SET_INT(0, "hard", &reset_type,
- N_("reset HEAD, index and working tree"), HARD),
- OPT_SET_INT(0, "merge", &reset_type,
- N_("reset HEAD, index and working tree"), MERGE),
- OPT_SET_INT(0, "keep", &reset_type,
- N_("reset HEAD but keep local changes"), KEEP),
+ OPT_SET_INT_F(0, "mixed", &reset_type,
+ N_("reset HEAD and index"),
+ MIXED, PARSE_OPT_NONEG),
+ OPT_SET_INT_F(0, "soft", &reset_type,
+ N_("reset only HEAD"),
+ SOFT, PARSE_OPT_NONEG),
+ OPT_SET_INT_F(0, "hard", &reset_type,
+ N_("reset HEAD, index and working tree"),
+ HARD, PARSE_OPT_NONEG),
+ OPT_SET_INT_F(0, "merge", &reset_type,
+ N_("reset HEAD, index and working tree"),
+ MERGE, PARSE_OPT_NONEG),
+ OPT_SET_INT_F(0, "keep", &reset_type,
+ N_("reset HEAD but keep local changes"),
+ KEEP, PARSE_OPT_NONEG),
OPT_CALLBACK_F(0, "recurse-submodules", NULL,
- "reset", "control recursive updating of submodules",
- PARSE_OPT_OPTARG, option_parse_recurse_submodules_worktree_updater),
+ "reset", "control recursive updating of submodules",
+ PARSE_OPT_OPTARG,
+ option_parse_recurse_submodules_worktree_updater),
OPT_BOOL('p', "patch", &patch_mode, N_("select hunks interactively")),
OPT_BOOL('N', "intent-to-add", &intent_to_add,
N_("record only the fact that removed paths will be added later")),
@@ -442,13 +388,14 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
}
- unborn = !strcmp(rev, "HEAD") && get_oid("HEAD", &oid);
+ unborn = !strcmp(rev, "HEAD") && repo_get_oid(the_repository, "HEAD",
+ &oid);
if (unborn) {
/* reset on unborn branch: treat as reset to empty tree */
oidcpy(&oid, the_hash_algo->empty_tree);
} else if (!pathspec.nr && !patch_mode) {
struct commit *commit;
- if (get_oid_committish(rev, &oid))
+ if (repo_get_oid_committish(the_repository, rev, &oid))
die(_("Failed to resolve '%s' as a valid revision."), rev);
commit = lookup_commit_reference(the_repository, &oid);
if (!commit)
@@ -456,7 +403,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
oidcpy(&oid, &commit->object.oid);
} else {
struct tree *tree;
- if (get_oid_treeish(rev, &oid))
+ if (repo_get_oid_treeish(the_repository, rev, &oid))
die(_("Failed to resolve '%s' as a valid tree."), rev);
tree = parse_tree_indirect(&oid);
if (!tree)
@@ -468,7 +415,9 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
if (reset_type != NONE)
die(_("options '%s' and '%s' cannot be used together"), "--patch", "--{hard,mixed,soft}");
trace2_cmd_mode("patch-interactive");
- return run_add_interactive(rev, "--patch=reset", &pathspec);
+ update_ref_status = !!run_add_p(the_repository, ADD_P_RESET, rev,
+ &pathspec);
+ goto cleanup;
}
/* git reset tree [--] paths... can be used to
@@ -502,7 +451,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
- if (read_cache() < 0)
+ if (repo_read_index(the_repository) < 0)
die(_("index file corrupt"));
/* Soft reset does not touch the index file nor the working tree
@@ -513,11 +462,14 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
if (reset_type != SOFT) {
struct lock_file lock = LOCK_INIT;
- hold_locked_index(&lock, LOCK_DIE_ON_ERROR);
+ repo_hold_locked_index(the_repository, &lock,
+ LOCK_DIE_ON_ERROR);
if (reset_type == MIXED) {
int flags = quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN;
- if (read_from_tree(&pathspec, &oid, intent_to_add))
- return 1;
+ if (read_from_tree(&pathspec, &oid, intent_to_add)) {
+ update_ref_status = 1;
+ goto cleanup;
+ }
the_index.updated_skipworktree = 1;
if (!no_refresh && get_git_work_tree()) {
uint64_t t_begin, t_delta_in_ms;
@@ -536,7 +488,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
char *ref = NULL;
int err;
- dwim_ref(rev, strlen(rev), &dummy, &ref, 0);
+ repo_dwim_ref(the_repository, rev, strlen(rev),
+ &dummy, &ref, 0);
if (ref && !starts_with(ref, "refs/"))
FREE_AND_NULL(ref);
@@ -563,5 +516,10 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
if (!pathspec.nr)
remove_branch_state(the_repository, 0);
+ discard_index(&the_index);
+
+cleanup:
+ clear_pathspec(&pathspec);
+ free(pathspec_from_file);
return update_ref_status;
}
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 30fd8e8..7780372 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -1,16 +1,18 @@
-#include "cache.h"
+#include "builtin.h"
#include "config.h"
#include "commit.h"
#include "diff.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "revision.h"
#include "list-objects.h"
-#include "list-objects-filter.h"
#include "list-objects-filter-options.h"
#include "object.h"
-#include "object-store.h"
-#include "pack.h"
+#include "object-name.h"
+#include "object-file.h"
+#include "object-store-ll.h"
#include "pack-bitmap.h"
-#include "builtin.h"
#include "log-tree.h"
#include "graph.h"
#include "bisect.h"
@@ -20,7 +22,8 @@
#include "packfile.h"
static const char rev_list_usage[] =
-"git rev-list [<options>] <commit-id>... [-- <path>...]\n"
+"git rev-list [<options>] <commit>... [--] [<path>...]\n"
+"\n"
" limiting output:\n"
" --max-count=<n>\n"
" --max-age=<epoch>\n"
@@ -37,6 +40,7 @@ static const char rev_list_usage[] =
" --tags\n"
" --remotes\n"
" --stdin\n"
+" --exclude-hidden=[fetch|receive|uploadpack]\n"
" --quiet\n"
" ordering output:\n"
" --topo-order\n"
@@ -46,6 +50,7 @@ static const char rev_list_usage[] =
" --parents\n"
" --children\n"
" --objects | --objects-edge\n"
+" --disk-usage[=human]\n"
" --unpacked\n"
" --header | --pretty\n"
" --[no-]object-names\n"
@@ -81,6 +86,7 @@ static int arg_show_object_names = 1;
static int show_disk_usage;
static off_t total_disk_usage;
+static int human_readable;
static off_t get_object_disk_usage(struct object *obj)
{
@@ -92,7 +98,48 @@ static off_t get_object_disk_usage(struct object *obj)
return size;
}
-static void finish_commit(struct commit *commit);
+static inline void finish_object__ma(struct object *obj)
+{
+ /*
+ * Whether or not we try to dynamically fetch missing objects
+ * from the server, we currently DO NOT have the object. We
+ * can either print, allow (ignore), or conditionally allow
+ * (ignore) them.
+ */
+ switch (arg_missing_action) {
+ case MA_ERROR:
+ die("missing %s object '%s'",
+ type_name(obj->type), oid_to_hex(&obj->oid));
+ return;
+
+ case MA_ALLOW_ANY:
+ return;
+
+ case MA_PRINT:
+ oidset_insert(&missing_objects, &obj->oid);
+ return;
+
+ case MA_ALLOW_PROMISOR:
+ if (is_promisor_object(&obj->oid))
+ return;
+ die("unexpected missing %s object '%s'",
+ type_name(obj->type), oid_to_hex(&obj->oid));
+ return;
+
+ default:
+ BUG("unhandled missing_action");
+ return;
+ }
+}
+
+static void finish_commit(struct commit *commit)
+{
+ free_commit_list(commit->parents);
+ commit->parents = NULL;
+ free_commit_buffer(the_repository->parsed_objects,
+ commit);
+}
+
static void show_commit(struct commit *commit, void *data)
{
struct rev_list_info *info = data;
@@ -100,6 +147,12 @@ static void show_commit(struct commit *commit, void *data)
display_progress(progress, ++progress_counter);
+ if (revs->do_not_die_on_missing_objects &&
+ oidset_contains(&revs->missing_commits, &commit->object.oid)) {
+ finish_object__ma(&commit->object);
+ return;
+ }
+
if (show_disk_usage)
total_disk_usage += get_object_disk_usage(&commit->object);
@@ -130,7 +183,7 @@ static void show_commit(struct commit *commit, void *data)
if (!revs->graph)
fputs(get_revision_mark(revs, commit), stdout);
if (revs->abbrev_commit && revs->abbrev)
- fputs(find_unique_abbrev(&commit->object.oid, revs->abbrev),
+ fputs(repo_find_unique_abbrev(the_repository, &commit->object.oid, revs->abbrev),
stdout);
else
fputs(oid_to_hex(&commit->object.oid), stdout);
@@ -166,6 +219,7 @@ static void show_commit(struct commit *commit, void *data)
ctx.fmt = revs->commit_format;
ctx.output_encoding = get_log_output_encoding();
ctx.color = revs->diffopt.use_color;
+ ctx.rev = revs;
pretty_print_commit(&ctx, commit, &buf);
if (buf.len) {
if (revs->commit_format != CMIT_FMT_ONELINE)
@@ -211,49 +265,8 @@ static void show_commit(struct commit *commit, void *data)
finish_commit(commit);
}
-static void finish_commit(struct commit *commit)
-{
- free_commit_list(commit->parents);
- commit->parents = NULL;
- free_commit_buffer(the_repository->parsed_objects,
- commit);
-}
-
-static inline void finish_object__ma(struct object *obj)
-{
- /*
- * Whether or not we try to dynamically fetch missing objects
- * from the server, we currently DO NOT have the object. We
- * can either print, allow (ignore), or conditionally allow
- * (ignore) them.
- */
- switch (arg_missing_action) {
- case MA_ERROR:
- die("missing %s object '%s'",
- type_name(obj->type), oid_to_hex(&obj->oid));
- return;
-
- case MA_ALLOW_ANY:
- return;
-
- case MA_PRINT:
- oidset_insert(&missing_objects, &obj->oid);
- return;
-
- case MA_ALLOW_PROMISOR:
- if (is_promisor_object(&obj->oid))
- return;
- die("unexpected missing %s object '%s'",
- type_name(obj->type), oid_to_hex(&obj->oid));
- return;
-
- default:
- BUG("unhandled missing_action");
- return;
- }
-}
-
-static int finish_object(struct object *obj, const char *name, void *cb_data)
+static int finish_object(struct object *obj, const char *name UNUSED,
+ void *cb_data)
{
struct rev_list_info *info = cb_data;
if (oid_object_info_extended(the_repository, &obj->oid, NULL, 0) < 0) {
@@ -358,16 +371,27 @@ static int show_bisect_vars(struct rev_list_info *info, int reaches, int all)
static int show_object_fast(
const struct object_id *oid,
- enum object_type type,
- int exclude,
- uint32_t name_hash,
- struct packed_git *found_pack,
- off_t found_offset)
+ enum object_type type UNUSED,
+ int exclude UNUSED,
+ uint32_t name_hash UNUSED,
+ struct packed_git *found_pack UNUSED,
+ off_t found_offset UNUSED)
{
fprintf(stdout, "%s\n", oid_to_hex(oid));
return 1;
}
+static void print_disk_usage(off_t size)
+{
+ struct strbuf sb = STRBUF_INIT;
+ if (human_readable)
+ strbuf_humanise_bytes(&sb, size);
+ else
+ strbuf_addf(&sb, "%"PRIuMAX, (uintmax_t)size);
+ puts(sb.buf);
+ strbuf_release(&sb);
+}
+
static inline int parse_missing_action_value(const char *value)
{
if (!strcmp(value, "error")) {
@@ -473,6 +497,7 @@ static int try_bitmap_disk_usage(struct rev_info *revs,
int filter_provided_objects)
{
struct bitmap_index *bitmap_git;
+ off_t size_from_bitmap;
if (!show_disk_usage)
return -1;
@@ -481,8 +506,8 @@ static int try_bitmap_disk_usage(struct rev_info *revs,
if (!bitmap_git)
return -1;
- printf("%"PRIuMAX"\n",
- (uintmax_t)get_disk_usage_from_bitmap(bitmap_git, revs));
+ size_from_bitmap = get_disk_usage_from_bitmap(bitmap_git, revs);
+ print_disk_usage(size_from_bitmap);
return 0;
}
@@ -521,6 +546,18 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
*
* Let "--missing" to conditionally set fetch_if_missing.
*/
+ /*
+ * NEEDSWORK: These loops that attempt to find presence of
+ * options without understanding that the options they are
+ * skipping are broken (e.g., it would not know "--grep
+ * --exclude-promisor-objects" is not triggering
+ * "--exclude-promisor-objects" option). We really need
+ * setup_revisions() to have a mechanism to allow and disallow
+ * some sets of options for different commands (like rev-list,
+ * replay, etc). Such a mechanism should do an early parsing
+ * of options and be able to manage the `--missing=...` and
+ * `--exclude-promisor-objects` options below.
+ */
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
if (!strcmp(arg, "--exclude-promisor-objects")) {
@@ -540,7 +577,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
}
if (arg_missing_action)
- revs.do_not_die_on_missing_tree = 1;
+ revs.do_not_die_on_missing_objects = 1;
argc = setup_revisions(argc, argv, &revs, &s_r_opt);
@@ -624,7 +661,21 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
continue;
}
- if (!strcmp(arg, "--disk-usage")) {
+ if (skip_prefix(arg, "--disk-usage", &arg)) {
+ if (*arg == '=') {
+ if (!strcmp(++arg, "human")) {
+ human_readable = 1;
+ } else
+ die(_("invalid value for '%s': '%s', the only allowed format is '%s'"),
+ "--disk-usage=<format>", arg, "human");
+ } else if (*arg) {
+ /*
+ * Arguably should goto a label to continue chain of ifs?
+ * Doesn't matter unless we try to add --disk-usage-foo
+ * afterwards.
+ */
+ usage(rev_list_usage);
+ }
show_disk_usage = 1;
info.flags |= REV_LIST_QUIET;
continue;
@@ -715,8 +766,12 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
if (arg_print_omitted)
oidset_init(&omitted_objects, DEFAULT_OIDSET_SIZE);
- if (arg_missing_action == MA_PRINT)
+ if (arg_missing_action == MA_PRINT) {
oidset_init(&missing_objects, DEFAULT_OIDSET_SIZE);
+ /* Add missing tips */
+ oidset_insert_from_set(&missing_objects, &revs.missing_commits);
+ oidset_clear(&revs.missing_commits);
+ }
traverse_commit_list_filtered(
&revs, show_commit, show_object, &info,
@@ -753,7 +808,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
}
if (show_disk_usage)
- printf("%"PRIuMAX"\n", (uintmax_t)total_disk_usage);
+ print_disk_usage(total_disk_usage);
cleanup:
release_revisions(&revs);
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index b259d89..624182e 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -3,20 +3,29 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
+#define USE_THE_INDEX_VARIABLE
+#include "builtin.h"
+#include "abspath.h"
#include "config.h"
#include "commit.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hash.h"
+#include "hex.h"
#include "refs.h"
#include "quote.h"
-#include "builtin.h"
+#include "object-name.h"
#include "parse-options.h"
+#include "path.h"
#include "diff.h"
+#include "read-cache-ll.h"
#include "revision.h"
+#include "setup.h"
#include "split-index.h"
#include "submodule.h"
#include "commit-reach.h"
#include "shallow.h"
+#include "object-file-convert.h"
#define DO_REVS 1
#define DO_NOREV 2
@@ -39,7 +48,7 @@ static int abbrev_ref_strict;
static int output_sq;
static int stuck_long;
-static struct string_list *ref_excludes;
+static struct ref_exclusions ref_excludes = REF_EXCLUSIONS_INIT;
/*
* Some arguments are relevant "revision" arguments,
@@ -136,7 +145,9 @@ static void show_rev(int type, const struct object_id *oid, const char *name)
struct object_id discard;
char *full;
- switch (dwim_ref(name, strlen(name), &discard, &full, 0)) {
+ switch (repo_dwim_ref(the_repository, name,
+ strlen(name), &discard, &full,
+ 0)) {
case 0:
/*
* Not found -- not a ref. We could
@@ -147,9 +158,12 @@ static void show_rev(int type, const struct object_id *oid, const char *name)
*/
break;
case 1: /* happy */
- if (abbrev_ref)
+ if (abbrev_ref) {
+ char *old = full;
full = shorten_unambiguous_ref(full,
abbrev_ref_strict);
+ free(old);
+ }
show_with_type(type, full);
break;
default: /* ambiguous */
@@ -162,7 +176,8 @@ static void show_rev(int type, const struct object_id *oid, const char *name)
}
}
else if (abbrev)
- show_with_type(type, find_unique_abbrev(oid, abbrev));
+ show_with_type(type,
+ repo_find_unique_abbrev(the_repository, oid, abbrev));
else
show_with_type(type, oid_to_hex(oid));
}
@@ -187,7 +202,7 @@ static int show_default(void)
struct object_id oid;
def = NULL;
- if (!get_oid(s, &oid)) {
+ if (!repo_get_oid(the_repository, s, &oid)) {
show_rev(NORMAL, &oid, s);
return 1;
}
@@ -195,21 +210,23 @@ static int show_default(void)
return 0;
}
-static int show_reference(const char *refname, const struct object_id *oid, int flag, void *cb_data)
+static int show_reference(const char *refname, const struct object_id *oid,
+ int flag UNUSED, void *cb_data UNUSED)
{
- if (ref_excluded(ref_excludes, refname))
+ if (ref_excluded(&ref_excludes, refname))
return 0;
show_rev(NORMAL, oid, refname);
return 0;
}
-static int anti_reference(const char *refname, const struct object_id *oid, int flag, void *cb_data)
+static int anti_reference(const char *refname, const struct object_id *oid,
+ int flag UNUSED, void *cb_data UNUSED)
{
show_rev(REVERSED, oid, refname);
return 0;
}
-static int show_abbrev(const struct object_id *oid, void *cb_data)
+static int show_abbrev(const struct object_id *oid, void *cb_data UNUSED)
{
show_rev(NORMAL, oid, NULL);
return 0;
@@ -277,11 +294,11 @@ static int try_difference(const char *arg)
return 0;
}
- if (!get_oid_committish(start, &start_oid) && !get_oid_committish(end, &end_oid)) {
+ if (!repo_get_oid_committish(the_repository, start, &start_oid) && !repo_get_oid_committish(the_repository, end, &end_oid)) {
show_rev(NORMAL, &end_oid, end);
show_rev(symmetric ? NORMAL : REVERSED, &start_oid, start);
if (symmetric) {
- struct commit_list *exclude;
+ struct commit_list *exclude = NULL;
struct commit *a, *b;
a = lookup_commit_reference(the_repository, &start_oid);
b = lookup_commit_reference(the_repository, &end_oid);
@@ -289,7 +306,8 @@ static int try_difference(const char *arg)
*dotdot = '.';
return 0;
}
- exclude = get_merge_bases(a, b);
+ if (repo_get_merge_bases(the_repository, a, b, &exclude) < 0)
+ exit(128);
while (exclude) {
struct commit *commit = pop_commit(&exclude);
show_rev(REVERSED, &commit->object.oid, NULL);
@@ -335,7 +353,7 @@ static int try_parent_shorthands(const char *arg)
return 0;
*dotdot = 0;
- if (get_oid_committish(arg, &oid) ||
+ if (repo_get_oid_committish(the_repository, arg, &oid) ||
!(commit = lookup_commit_reference(the_repository, &oid))) {
*dotdot = '^';
return 0;
@@ -479,6 +497,9 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)
if (!s)
s = help;
+ if (s == sb.buf)
+ die(_("missing opt-spec before option flags"));
+
if (s - sb.buf == 1) /* short option only */
o->short_name = *sb.buf;
else if (sb.buf[1] != ',') /* long option only */
@@ -525,6 +546,7 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)
strbuf_addstr(&parsed, " --");
sq_quote_argv(&parsed, argv);
puts(parsed.buf);
+ strbuf_release(&parsed);
return 0;
}
@@ -580,7 +602,7 @@ static void handle_ref_opt(const char *pattern, const char *prefix)
for_each_glob_ref_in(show_reference, pattern, prefix, NULL);
else
for_each_ref_in(prefix, show_reference, NULL);
- clear_ref_exclusion(&ref_excludes);
+ clear_ref_exclusions(&ref_excludes);
}
enum format_type {
@@ -655,6 +677,8 @@ static void print_path(const char *path, const char *prefix, enum format_type fo
int cmd_rev_parse(int argc, const char **argv, const char *prefix)
{
int i, as_is = 0, verify = 0, quiet = 0, revs_count = 0, type = 0;
+ const struct git_hash_algo *output_algo = NULL;
+ const struct git_hash_algo *compat = NULL;
int did_repo_setup = 0;
int has_dashdash = 0;
int output_prefix = 0;
@@ -726,6 +750,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
+ compat = the_repository->compat_hash_algo;
}
if (!strcmp(arg, "--")) {
@@ -813,6 +838,22 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
flags |= GET_OID_QUIETLY;
continue;
}
+ if (opt_with_value(arg, "--output-object-format", &arg)) {
+ if (!arg)
+ die(_("no object format specified"));
+ if (!strcmp(arg, the_hash_algo->name) ||
+ !strcmp(arg, "storage")) {
+ flags |= GET_OID_HASH_ANY;
+ output_algo = the_hash_algo;
+ continue;
+ }
+ else if (compat && !strcmp(arg, compat->name)) {
+ flags |= GET_OID_HASH_ANY;
+ output_algo = compat;
+ continue;
+ }
+ else die(_("unsupported object format: %s"), arg);
+ }
if (opt_with_value(arg, "--short", &arg)) {
filter &= ~(DO_FLAGS|DO_NOREV);
verify = 1;
@@ -858,11 +899,12 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
}
if (!strcmp(arg, "--all")) {
for_each_ref(show_reference, NULL);
- clear_ref_exclusion(&ref_excludes);
+ clear_ref_exclusions(&ref_excludes);
continue;
}
if (skip_prefix(arg, "--disambiguate=", &arg)) {
- for_each_abbrev(arg, show_abbrev, NULL);
+ repo_for_each_abbrev(the_repository, arg, the_hash_algo,
+ show_abbrev, NULL);
continue;
}
if (!strcmp(arg, "--bisect")) {
@@ -871,10 +913,16 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
continue;
}
if (opt_with_value(arg, "--branches", &arg)) {
+ if (ref_excludes.hidden_refs_configured)
+ return error(_("options '%s' and '%s' cannot be used together"),
+ "--exclude-hidden", "--branches");
handle_ref_opt(arg, "refs/heads/");
continue;
}
if (opt_with_value(arg, "--tags", &arg)) {
+ if (ref_excludes.hidden_refs_configured)
+ return error(_("options '%s' and '%s' cannot be used together"),
+ "--exclude-hidden", "--tags");
handle_ref_opt(arg, "refs/tags/");
continue;
}
@@ -883,6 +931,9 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
continue;
}
if (opt_with_value(arg, "--remotes", &arg)) {
+ if (ref_excludes.hidden_refs_configured)
+ return error(_("options '%s' and '%s' cannot be used together"),
+ "--exclude-hidden", "--remotes");
handle_ref_opt(arg, "refs/remotes/");
continue;
}
@@ -890,6 +941,10 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
add_ref_exclusion(&ref_excludes, arg);
continue;
}
+ if (skip_prefix(arg, "--exclude-hidden=", &arg)) {
+ exclude_hidden_refs(&ref_excludes, arg);
+ continue;
+ }
if (!strcmp(arg, "--show-toplevel")) {
const char *work_tree = get_git_work_tree();
if (work_tree)
@@ -992,7 +1047,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
continue;
}
if (!strcmp(arg, "--shared-index-path")) {
- if (read_cache() < 0)
+ if (repo_read_index(the_repository) < 0)
die(_("Could not read the index"));
if (the_index.split_index) {
const struct object_id *oid = &the_index.split_index->base_oid;
@@ -1028,6 +1083,10 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
puts(the_hash_algo->name);
continue;
}
+ if (!strcmp(arg, "--show-ref-format")) {
+ puts(ref_storage_format_to_name(the_repository->ref_storage_format));
+ continue;
+ }
if (!strcmp(arg, "--end-of-options")) {
seen_end_of_options = 1;
if (filter & (DO_FLAGS | DO_REVS))
@@ -1052,6 +1111,9 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
}
if (!get_oid_with_context(the_repository, name,
flags, &oid, &unused)) {
+ if (output_algo)
+ repo_oid_to_algop(the_repository, &oid,
+ output_algo, &oid);
if (verify)
revs_count++;
else
diff --git a/builtin/revert.c b/builtin/revert.c
index f84c253..53935d2 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -1,11 +1,11 @@
-#include "cache.h"
-#include "config.h"
+#include "git-compat-util.h"
#include "builtin.h"
#include "parse-options.h"
#include "diff.h"
+#include "gettext.h"
+#include "repository.h"
#include "revision.h"
#include "rerere.h"
-#include "dir.h"
#include "sequencer.h"
#include "branch.h"
@@ -21,14 +21,15 @@
*/
static const char * const revert_usage[] = {
- N_("git revert [<options>] <commit-ish>..."),
- N_("git revert <subcommand>"),
+ N_("git revert [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] <commit>..."),
+ N_("git revert (--continue | --skip | --abort | --quit)"),
NULL
};
static const char * const cherry_pick_usage[] = {
- N_("git cherry-pick [<options>] <commit-ish>..."),
- N_("git cherry-pick <subcommand>"),
+ N_("git cherry-pick [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff]\n"
+ " [-S[<keyid>]] <commit>..."),
+ N_("git cherry-pick (--continue | --skip | --abort | --quit)"),
NULL
};
@@ -42,17 +43,28 @@ static const char * const *revert_or_cherry_pick_usage(struct replay_opts *opts)
return opts->action == REPLAY_REVERT ? revert_usage : cherry_pick_usage;
}
-static int option_parse_x(const struct option *opt,
- const char *arg, int unset)
+enum empty_action {
+ EMPTY_COMMIT_UNSPECIFIED = -1,
+ STOP_ON_EMPTY_COMMIT, /* output errors and stop in the middle of a cherry-pick */
+ DROP_EMPTY_COMMIT, /* skip with a notice message */
+ KEEP_EMPTY_COMMIT, /* keep recording as empty commits */
+};
+
+static int parse_opt_empty(const struct option *opt, const char *arg, int unset)
{
- struct replay_opts **opts_ptr = opt->value;
- struct replay_opts *opts = *opts_ptr;
+ int *opt_value = opt->value;
- if (unset)
- return 0;
+ BUG_ON_OPT_NEG(unset);
+
+ if (!strcmp(arg, "stop"))
+ *opt_value = STOP_ON_EMPTY_COMMIT;
+ else if (!strcmp(arg, "drop"))
+ *opt_value = DROP_EMPTY_COMMIT;
+ else if (!strcmp(arg, "keep"))
+ *opt_value = KEEP_EMPTY_COMMIT;
+ else
+ return error(_("invalid value for '%s': '%s'"), "--empty", arg);
- ALLOC_GROW(opts->xopts, opts->xopts_nr + 1, opts->xopts_alloc);
- opts->xopts[opts->xopts_nr++] = xstrdup(arg);
return 0;
}
@@ -92,11 +104,13 @@ static void verify_opt_compatible(const char *me, const char *base_opt, ...)
die(_("%s: %s cannot be used with %s"), me, this_opt, base_opt);
}
-static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
+static int run_sequencer(int argc, const char **argv, const char *prefix,
+ struct replay_opts *opts)
{
const char * const * usage_str = revert_or_cherry_pick_usage(opts);
const char *me = action_name(opts);
const char *cleanup_arg = NULL;
+ enum empty_action empty_opt = EMPTY_COMMIT_UNSPECIFIED;
int cmd = 0;
struct option base_options[] = {
OPT_CMDMODE(0, "quit", &cmd, N_("end revert or cherry-pick sequence"), 'q'),
@@ -112,8 +126,8 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
N_("select mainline parent"), option_parse_m),
OPT_RERERE_AUTOUPDATE(&opts->allow_rerere_auto),
OPT_STRING(0, "strategy", &opts->strategy, N_("strategy"), N_("merge strategy")),
- OPT_CALLBACK('X', "strategy-option", &opts, N_("option"),
- N_("option for merge strategy"), option_parse_x),
+ OPT_STRVEC('X', "strategy-option", &opts->xopts, N_("option"),
+ N_("option for merge strategy")),
{ OPTION_STRING, 'S', "gpg-sign", &opts->gpg_sign, N_("key-id"),
N_("GPG sign commit"), PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
OPT_END()
@@ -126,7 +140,10 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
OPT_BOOL(0, "ff", &opts->allow_ff, N_("allow fast-forward")),
OPT_BOOL(0, "allow-empty", &opts->allow_empty, N_("preserve initially empty commits")),
OPT_BOOL(0, "allow-empty-message", &opts->allow_empty_message, N_("allow commits with empty messages")),
- OPT_BOOL(0, "keep-redundant-commits", &opts->keep_redundant_commits, N_("keep redundant, empty commits")),
+ OPT_BOOL(0, "keep-redundant-commits", &opts->keep_redundant_commits, N_("deprecated: use --empty=keep instead")),
+ OPT_CALLBACK_F(0, "empty", &empty_opt, "(stop|drop|keep)",
+ N_("how to handle commits that become empty"),
+ PARSE_OPT_NONEG, parse_opt_empty),
OPT_END(),
};
options = parse_options_concat(options, cp_extra);
@@ -139,13 +156,18 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
options = parse_options_concat(options, cp_extra);
}
- argc = parse_options(argc, argv, NULL, options, usage_str,
+ argc = parse_options(argc, argv, prefix, options, usage_str,
PARSE_OPT_KEEP_ARGV0 |
- PARSE_OPT_KEEP_UNKNOWN);
+ PARSE_OPT_KEEP_UNKNOWN_OPT);
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
+ if (opts->action == REPLAY_PICK) {
+ opts->drop_redundant_commits = (empty_opt == DROP_EMPTY_COMMIT);
+ opts->keep_redundant_commits = opts->keep_redundant_commits || (empty_opt == KEEP_EMPTY_COMMIT);
+ }
+
/* implies allow_empty */
if (opts->keep_redundant_commits)
opts->allow_empty = 1;
@@ -174,11 +196,13 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
"--signoff", opts->signoff,
"--mainline", opts->mainline,
"--strategy", opts->strategy ? 1 : 0,
- "--strategy-option", opts->xopts ? 1 : 0,
+ "--strategy-option", opts->xopts.nr ? 1 : 0,
"-x", opts->record_origin,
"--ff", opts->allow_ff,
"--rerere-autoupdate", opts->allow_rerere_auto == RERERE_AUTOUPDATE,
"--no-rerere-autoupdate", opts->allow_rerere_auto == RERERE_NOAUTOUPDATE,
+ "--keep-redundant-commits", opts->keep_redundant_commits,
+ "--empty", empty_opt != EMPTY_COMMIT_UNSPECIFIED,
NULL);
}
@@ -220,6 +244,7 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
opts->strategy = xstrdup_or_null(opts->strategy);
if (!opts->strategy && getenv("GIT_TEST_MERGE_ALGORITHM"))
opts->strategy = xstrdup(getenv("GIT_TEST_MERGE_ALGORITHM"));
+ free(options);
if (cmd == 'q') {
int ret = sequencer_remove_state(opts);
@@ -243,9 +268,10 @@ int cmd_revert(int argc, const char **argv, const char *prefix)
opts.action = REPLAY_REVERT;
sequencer_init_config(&opts);
- res = run_sequencer(argc, argv, &opts);
+ res = run_sequencer(argc, argv, prefix, &opts);
if (res < 0)
die(_("revert failed"));
+ replay_opts_release(&opts);
return res;
}
@@ -256,8 +282,9 @@ int cmd_cherry_pick(int argc, const char **argv, const char *prefix)
opts.action = REPLAY_PICK;
sequencer_init_config(&opts);
- res = run_sequencer(argc, argv, &opts);
+ res = run_sequencer(argc, argv, prefix, &opts);
if (res < 0)
die(_("cherry-pick failed"));
+ replay_opts_release(&opts);
return res;
}
diff --git a/builtin/rm.c b/builtin/rm.c
index 84a935a..fd130ce 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -3,21 +3,29 @@
*
* Copyright (C) Linus Torvalds 2006
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
#include "advice.h"
#include "config.h"
#include "lockfile.h"
#include "dir.h"
-#include "cache-tree.h"
+#include "gettext.h"
+#include "hash.h"
#include "tree-walk.h"
+#include "object-name.h"
#include "parse-options.h"
+#include "read-cache.h"
+#include "repository.h"
#include "string-list.h"
+#include "setup.h"
+#include "sparse-index.h"
#include "submodule.h"
#include "pathspec.h"
static const char * const builtin_rm_usage[] = {
- N_("git rm [<options>] [--] <file>..."),
+ N_("git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+ " [--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+ " [--] [<pathspec>...]"),
NULL
};
@@ -33,8 +41,8 @@ static int get_ours_cache_pos(const char *path, int pos)
{
int i = -pos - 1;
- while ((i < active_nr) && !strcmp(active_cache[i]->name, path)) {
- if (ce_stage(active_cache[i]) == 2)
+ while ((i < the_index.cache_nr) && !strcmp(the_index.cache[i]->name, path)) {
+ if (ce_stage(the_index.cache[i]) == 2)
return i;
i++;
}
@@ -70,13 +78,13 @@ static void submodules_absorb_gitdir_if_needed(void)
int pos;
const struct cache_entry *ce;
- pos = cache_name_pos(name, strlen(name));
+ pos = index_name_pos(&the_index, name, strlen(name));
if (pos < 0) {
pos = get_ours_cache_pos(name, pos);
if (pos < 0)
continue;
}
- ce = active_cache[pos];
+ ce = the_index.cache[pos];
if (!S_ISGITLINK(ce->ce_mode) ||
!file_exists(ce->name) ||
@@ -84,8 +92,7 @@ static void submodules_absorb_gitdir_if_needed(void)
continue;
if (!submodule_uses_gitfile(name))
- absorb_git_dir_into_superproject(name,
- ABSORB_GITDIR_RECURSE_SUBMODULES);
+ absorb_git_dir_into_superproject(name, NULL);
}
}
@@ -115,7 +122,7 @@ static int check_local_mod(struct object_id *head, int index_only)
int local_changes = 0;
int staged_changes = 0;
- pos = cache_name_pos(name, strlen(name));
+ pos = index_name_pos(&the_index, name, strlen(name));
if (pos < 0) {
/*
* Skip unmerged entries except for populated submodules
@@ -125,11 +132,11 @@ static int check_local_mod(struct object_id *head, int index_only)
if (pos < 0)
continue;
- if (!S_ISGITLINK(active_cache[pos]->ce_mode) ||
+ if (!S_ISGITLINK(the_index.cache[pos]->ce_mode) ||
is_empty_dir(name))
continue;
}
- ce = active_cache[pos];
+ ce = the_index.cache[pos];
if (lstat(ce->name, &st) < 0) {
if (!is_missing_file_error(errno))
@@ -166,7 +173,7 @@ static int check_local_mod(struct object_id *head, int index_only)
* Is the index different from the file in the work tree?
* If it's a submodule, is its work tree modified?
*/
- if (ce_match_stat(ce, &st, 0) ||
+ if (ie_match_stat(&the_index, ce, &st, 0) ||
(S_ISGITLINK(ce->ce_mode) &&
bad_to_remove_submodule(ce->name,
SUBMODULE_REMOVAL_DIE_ON_ERROR |
@@ -287,19 +294,22 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
if (!index_only)
setup_work_tree();
- hold_locked_index(&lock_file, LOCK_DIE_ON_ERROR);
+ prepare_repo_settings(the_repository);
+ the_repository->settings.command_requires_full_index = 0;
+ repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
- if (read_cache() < 0)
+ if (repo_read_index(the_repository) < 0)
die(_("index file corrupt"));
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, &pathspec, NULL, NULL);
seen = xcalloc(pathspec.nr, 1);
- /* TODO: audit for interaction with sparse-index. */
- ensure_full_index(&the_index);
- for (i = 0; i < active_nr; i++) {
- const struct cache_entry *ce = active_cache[i];
+ if (pathspec_needs_expanded_index(&the_index, &pathspec))
+ ensure_full_index(&the_index);
+
+ for (i = 0; i < the_index.cache_nr; i++) {
+ const struct cache_entry *ce = the_index.cache[i];
if (!include_sparse &&
(ce_skip_worktree(ce) ||
@@ -366,7 +376,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
*/
if (!force) {
struct object_id oid;
- if (get_oid("HEAD", &oid))
+ if (repo_get_oid(the_repository, "HEAD", &oid))
oidclr(&oid);
if (check_local_mod(&oid, index_only))
exit(1);
@@ -381,7 +391,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
if (!quiet)
printf("rm '%s'\n", path);
- if (remove_file_from_cache(path))
+ if (remove_file_from_index(&the_index, path))
die(_("git rm: unable to remove %s"), path);
}
diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index 64962be..3df9eaa 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -1,25 +1,24 @@
#include "builtin.h"
#include "config.h"
-#include "commit.h"
-#include "refs.h"
+#include "hex.h"
#include "pkt-line.h"
-#include "sideband.h"
#include "run-command.h"
#include "remote.h"
#include "connect.h"
#include "send-pack.h"
#include "quote.h"
#include "transport.h"
-#include "version.h"
#include "oid-array.h"
-#include "gpg-interface.h"
#include "gettext.h"
#include "protocol.h"
+#include "parse-options.h"
+#include "write-or-die.h"
static const char * const send_pack_usage[] = {
N_("git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
+ " [--[no-]signed | --signed=(true|false|if-asked)]\n"
" [<host>:]<directory> (--all | <ref>...)"),
NULL,
};
@@ -127,29 +126,25 @@ static void print_helper_status(struct ref *ref)
strbuf_release(&buf);
}
-static int send_pack_config(const char *k, const char *v, void *cb)
+static int send_pack_config(const char *k, const char *v,
+ const struct config_context *ctx, void *cb)
{
- git_gpg_config(k, v, NULL);
-
if (!strcmp(k, "push.gpgsign")) {
- const char *value;
- if (!git_config_get_value("push.gpgsign", &value)) {
- switch (git_parse_maybe_bool(value)) {
- case 0:
- args.push_cert = SEND_PACK_PUSH_CERT_NEVER;
- break;
- case 1:
- args.push_cert = SEND_PACK_PUSH_CERT_ALWAYS;
- break;
- default:
- if (value && !strcasecmp(value, "if-asked"))
- args.push_cert = SEND_PACK_PUSH_CERT_IF_ASKED;
- else
- return error(_("invalid value for '%s'"), k);
- }
+ switch (git_parse_maybe_bool(v)) {
+ case 0:
+ args.push_cert = SEND_PACK_PUSH_CERT_NEVER;
+ break;
+ case 1:
+ args.push_cert = SEND_PACK_PUSH_CERT_ALWAYS;
+ break;
+ default:
+ if (!strcasecmp(v, "if-asked"))
+ args.push_cert = SEND_PACK_PUSH_CERT_IF_ASKED;
+ else
+ return error(_("invalid value for '%s'"), k);
}
}
- return git_default_config(k, v, cb);
+ return git_default_config(k, v, ctx, cb);
}
int cmd_send_pack(int argc, const char **argv, const char *prefix)
@@ -205,7 +200,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
OPT_BOOL(0, "stateless-rpc", &stateless_rpc, N_("use stateless RPC protocol")),
OPT_BOOL(0, "stdin", &from_stdin, N_("read refs from stdin")),
OPT_BOOL(0, "helper-status", &helper_status, N_("print status from remote helper")),
- OPT_CALLBACK_F(0, CAS_OPT_NAME, &cas, N_("<refname>:<expect>"),
+ OPT_CALLBACK_F(0, "force-with-lease", &cas, N_("<refname>:<expect>"),
N_("require old value of ref to be at this value"),
PARSE_OPT_OPTARG, parseopt_push_cas_option),
OPT_BOOL(0, TRANS_OPT_FORCE_IF_INCLUDES, &force_if_includes,
@@ -274,7 +269,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
fd[0] = 0;
fd[1] = 1;
} else {
- conn = git_connect(fd, dest, receivepack,
+ conn = git_connect(fd, dest, "git-receive-pack", receivepack,
args.verbose ? CONNECT_VERBOSE : 0);
}
@@ -338,6 +333,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
}
if (!ret && !transport_refs_pushed(remote_refs))
+ /* stable plumbing output; do not modify or localize */
fprintf(stderr, "Everything up-to-date\n");
return ret;
diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index 086dfee..3c7cd2d 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -1,12 +1,15 @@
#include "builtin.h"
-#include "cache.h"
#include "config.h"
#include "commit.h"
#include "diff.h"
+#include "environment.h"
+#include "gettext.h"
#include "string-list.h"
+#include "repository.h"
#include "revision.h"
#include "utf8.h"
#include "mailmap.h"
+#include "setup.h"
#include "shortlog.h"
#include "parse-options.h"
#include "trailer.h"
@@ -132,7 +135,9 @@ static void read_from_stdin(struct shortlog *log)
match = committer_match;
break;
case SHORTLOG_GROUP_TRAILER:
- die(_("using --group=trailer with stdin is not supported"));
+ die(_("using %s with stdin is not supported"), "--group=trailer");
+ case SHORTLOG_GROUP_FORMAT:
+ die(_("using %s with stdin is not supported"), "--group=format");
default:
BUG("unhandled shortlog group");
}
@@ -170,11 +175,15 @@ static void insert_records_from_trailers(struct shortlog *log,
const char *commit_buffer, *body;
struct strbuf ident = STRBUF_INIT;
+ if (!log->trailers.nr)
+ return;
+
/*
- * Using format_commit_message("%B") would be simpler here, but
+ * Using repo_format_commit_message("%B") would be simpler here, but
* this saves us copying the message.
*/
- commit_buffer = logmsg_reencode(commit, NULL, ctx->output_encoding);
+ commit_buffer = repo_logmsg_reencode(the_repository, commit, NULL,
+ ctx->output_encoding);
body = strstr(commit_buffer, "\n\n");
if (!body)
return;
@@ -197,12 +206,38 @@ static void insert_records_from_trailers(struct shortlog *log,
trailer_iterator_release(&iter);
strbuf_release(&ident);
- unuse_commit_buffer(commit, commit_buffer);
+ repo_unuse_commit_buffer(the_repository, commit, commit_buffer);
+}
+
+static int shortlog_needs_dedup(const struct shortlog *log)
+{
+ return HAS_MULTI_BITS(log->groups) || log->format.nr > 1 || log->trailers.nr;
+}
+
+static void insert_records_from_format(struct shortlog *log,
+ struct strset *dups,
+ struct commit *commit,
+ struct pretty_print_context *ctx,
+ const char *oneline)
+{
+ struct strbuf buf = STRBUF_INIT;
+ struct string_list_item *item;
+
+ for_each_string_list_item(item, &log->format) {
+ strbuf_reset(&buf);
+
+ repo_format_commit_message(the_repository, commit,
+ item->string, &buf, ctx);
+
+ if (!shortlog_needs_dedup(log) || strset_add(dups, buf.buf))
+ insert_one_record(log, buf.buf, oneline);
+ }
+
+ strbuf_release(&buf);
}
void shortlog_add_commit(struct shortlog *log, struct commit *commit)
{
- struct strbuf ident = STRBUF_INIT;
struct strbuf oneline = STRBUF_INIT;
struct strset dups = STRSET_INIT;
struct pretty_print_context ctx = {0};
@@ -210,42 +245,22 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)
ctx.fmt = CMIT_FMT_USERFORMAT;
ctx.abbrev = log->abbrev;
- ctx.print_email_subject = 1;
- ctx.date_mode.type = DATE_NORMAL;
+ ctx.date_mode = log->date_mode;
ctx.output_encoding = get_log_output_encoding();
if (!log->summary) {
if (log->user_format)
pretty_print_commit(&ctx, commit, &oneline);
else
- format_commit_message(commit, "%s", &oneline, &ctx);
+ repo_format_commit_message(the_repository, commit,
+ "%s", &oneline, &ctx);
}
oneline_str = oneline.len ? oneline.buf : "<none>";
- if (log->groups & SHORTLOG_GROUP_AUTHOR) {
- strbuf_reset(&ident);
- format_commit_message(commit,
- log->email ? "%aN <%aE>" : "%aN",
- &ident, &ctx);
- if (!HAS_MULTI_BITS(log->groups) ||
- strset_add(&dups, ident.buf))
- insert_one_record(log, ident.buf, oneline_str);
- }
- if (log->groups & SHORTLOG_GROUP_COMMITTER) {
- strbuf_reset(&ident);
- format_commit_message(commit,
- log->email ? "%cN <%cE>" : "%cN",
- &ident, &ctx);
- if (!HAS_MULTI_BITS(log->groups) ||
- strset_add(&dups, ident.buf))
- insert_one_record(log, ident.buf, oneline_str);
- }
- if (log->groups & SHORTLOG_GROUP_TRAILER) {
- insert_records_from_trailers(log, &dups, commit, &ctx, oneline_str);
- }
+ insert_records_from_trailers(log, &dups, commit, &ctx, oneline_str);
+ insert_records_from_format(log, &dups, commit, &ctx, oneline_str);
strset_clear(&dups);
- strbuf_release(&ident);
strbuf_release(&oneline);
}
@@ -314,6 +329,7 @@ static int parse_group_option(const struct option *opt, const char *arg, int uns
if (unset) {
log->groups = 0;
string_list_clear(&log->trailers, 0);
+ string_list_clear(&log->format, 0);
} else if (!strcasecmp(arg, "author"))
log->groups |= SHORTLOG_GROUP_AUTHOR;
else if (!strcasecmp(arg, "committer"))
@@ -321,8 +337,15 @@ static int parse_group_option(const struct option *opt, const char *arg, int uns
else if (skip_prefix(arg, "trailer:", &field)) {
log->groups |= SHORTLOG_GROUP_TRAILER;
string_list_append(&log->trailers, field);
- } else
+ } else if (skip_prefix(arg, "format:", &field)) {
+ log->groups |= SHORTLOG_GROUP_FORMAT;
+ string_list_append(&log->format, field);
+ } else if (strchr(arg, '%')) {
+ log->groups |= SHORTLOG_GROUP_FORMAT;
+ string_list_append(&log->format, arg);
+ } else {
return error(_("unknown group type: %s"), arg);
+ }
return 0;
}
@@ -340,6 +363,19 @@ void shortlog_init(struct shortlog *log)
log->in2 = DEFAULT_INDENT2;
log->trailers.strdup_strings = 1;
log->trailers.cmp = strcasecmp;
+ log->format.strdup_strings = 1;
+}
+
+void shortlog_finish_setup(struct shortlog *log)
+{
+ if (log->groups & SHORTLOG_GROUP_AUTHOR)
+ string_list_append(&log->format,
+ log->email ? "%aN <%aE>" : "%aN");
+ if (log->groups & SHORTLOG_GROUP_COMMITTER)
+ string_list_append(&log->format,
+ log->email ? "%cN <%cE>" : "%cN");
+
+ string_list_sort(&log->trailers);
}
int cmd_shortlog(int argc, const char **argv, const char *prefix)
@@ -381,6 +417,7 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
break;
case PARSE_OPT_HELP:
case PARSE_OPT_ERROR:
+ case PARSE_OPT_SUBCOMMAND:
exit(129);
case PARSE_OPT_COMPLETE:
exit(0);
@@ -406,10 +443,11 @@ parse_done:
log.user_format = rev.commit_format == CMIT_FMT_USERFORMAT;
log.abbrev = rev.abbrev;
log.file = rev.diffopt.file;
+ log.date_mode = rev.date_mode;
if (!log.groups)
log.groups = SHORTLOG_GROUP_AUTHOR;
- string_list_sort(&log.trailers);
+ shortlog_finish_setup(&log);
/* assume HEAD if from a tty */
if (!nongit && !rev.pending.nr && isatty(0))
@@ -478,4 +516,5 @@ void shortlog_output(struct shortlog *log)
log->list.strdup_strings = 1;
string_list_clear(&log->list, 1);
clear_mailmap(&log->mailmap);
+ string_list_clear(&log->format, 0);
}
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index 64c649c..b01ec76 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -1,20 +1,27 @@
-#include "cache.h"
+#include "builtin.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hash.h"
+#include "hex.h"
#include "pretty.h"
#include "refs.h"
-#include "builtin.h"
#include "color.h"
#include "strvec.h"
+#include "object-name.h"
#include "parse-options.h"
+#include "repository.h"
#include "dir.h"
#include "commit-slab.h"
#include "date.h"
+#include "wildmatch.h"
static const char* show_branch_usage[] = {
N_("git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
" [--current] [--color[=<when>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
- " [--no-name | --sha1-name] [--topics] [(<rev> | <glob>)...]"),
+ " [--no-name | --sha1-name] [--topics]\n"
+ " [(<rev> | <glob>)...]"),
N_("git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]"),
NULL
};
@@ -239,7 +246,7 @@ static void join_revs(struct commit_list **list_p,
parents = parents->next;
if ((this_flag & flags) == flags)
continue;
- parse_commit(p);
+ repo_parse_commit(the_repository, p);
if (mark_seen(p, seen_p) && !still_interesting)
extra--;
p->object.flags |= flags;
@@ -311,8 +318,8 @@ static void show_one_commit(struct commit *commit, int no_name)
}
else
printf("[%s] ",
- find_unique_abbrev(&commit->object.oid,
- DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, &commit->object.oid,
+ DEFAULT_ABBREV));
}
puts(pretty_str);
strbuf_release(&pretty);
@@ -404,7 +411,7 @@ static int append_ref(const char *refname, const struct object_id *oid,
}
static int append_head_ref(const char *refname, const struct object_id *oid,
- int flag, void *cb_data)
+ int flag UNUSED, void *cb_data UNUSED)
{
struct object_id tmp;
int ofs = 11;
@@ -413,13 +420,13 @@ static int append_head_ref(const char *refname, const struct object_id *oid,
/* If both heads/foo and tags/foo exists, get_sha1 would
* get confused.
*/
- if (get_oid(refname + ofs, &tmp) || !oideq(&tmp, oid))
+ if (repo_get_oid(the_repository, refname + ofs, &tmp) || !oideq(&tmp, oid))
ofs = 5;
return append_ref(refname + ofs, oid, 0);
}
static int append_remote_ref(const char *refname, const struct object_id *oid,
- int flag, void *cb_data)
+ int flag UNUSED, void *cb_data UNUSED)
{
struct object_id tmp;
int ofs = 13;
@@ -428,13 +435,13 @@ static int append_remote_ref(const char *refname, const struct object_id *oid,
/* If both heads/foo and tags/foo exists, get_sha1 would
* get confused.
*/
- if (get_oid(refname + ofs, &tmp) || !oideq(&tmp, oid))
+ if (repo_get_oid(the_repository, refname + ofs, &tmp) || !oideq(&tmp, oid))
ofs = 5;
return append_ref(refname + ofs, oid, 0);
}
static int append_tag_ref(const char *refname, const struct object_id *oid,
- int flag, void *cb_data)
+ int flag UNUSED, void *cb_data UNUSED)
{
if (!starts_with(refname, "refs/tags/"))
return 0;
@@ -532,7 +539,7 @@ static int show_independent(struct commit **rev,
static void append_one_rev(const char *av)
{
struct object_id revkey;
- if (!get_oid(av, &revkey)) {
+ if (!repo_get_oid(the_repository, av, &revkey)) {
append_ref(av, &revkey, 0);
return;
}
@@ -552,7 +559,8 @@ static void append_one_rev(const char *av)
die("bad sha1 reference %s", av);
}
-static int git_show_branch_config(const char *var, const char *value, void *cb)
+static int git_show_branch_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(var, "showbranch.default")) {
if (!value)
@@ -572,7 +580,10 @@ static int git_show_branch_config(const char *var, const char *value, void *cb)
return 0;
}
- return git_color_default_config(var, value, cb);
+ if (git_color_config(var, value, cb) < 0)
+ return -1;
+
+ return git_default_config(var, value, ctx, cb);
}
static int omit_in_dense(struct commit *commit, struct commit **rev, int n)
@@ -638,7 +649,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
int with_current_branch = 0;
int head_at = -1;
int topics = 0;
- int dense = 1;
+ int sparse = 0;
const char *reflog_base = NULL;
struct option builtin_show_branch_options[] = {
OPT_BOOL('a', "all", &all_heads,
@@ -660,17 +671,17 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
N_("show possible merge bases")),
OPT_BOOL(0, "independent", &independent,
N_("show refs unreachable from any other ref")),
- OPT_SET_INT(0, "topo-order", &sort_order,
- N_("show commits in topological order"),
- REV_SORT_IN_GRAPH_ORDER),
+ OPT_SET_INT_F(0, "topo-order", &sort_order,
+ N_("show commits in topological order"),
+ REV_SORT_IN_GRAPH_ORDER, PARSE_OPT_NONEG),
OPT_BOOL(0, "topics", &topics,
N_("show only commits not on the first branch")),
- OPT_SET_INT(0, "sparse", &dense,
- N_("show merges reachable from only one tip"), 0),
- OPT_SET_INT(0, "date-order", &sort_order,
- N_("topologically sort, maintaining date order "
- "where possible"),
- REV_SORT_BY_COMMIT_DATE),
+ OPT_SET_INT(0, "sparse", &sparse,
+ N_("show merges reachable from only one tip"), 1),
+ OPT_SET_INT_F(0, "date-order", &sort_order,
+ N_("topologically sort, maintaining date order "
+ "where possible"),
+ REV_SORT_BY_COMMIT_DATE, PARSE_OPT_NONEG),
OPT_CALLBACK_F('g', "reflog", &reflog_base, N_("<n>[,<base>]"),
N_("show <n> most recent ref-log entries starting at "
"base"),
@@ -745,7 +756,8 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
die(Q_("only %d entry can be shown at one time.",
"only %d entries can be shown at one time.",
MAX_REVS), MAX_REVS);
- if (!dwim_ref(*av, strlen(*av), &oid, &ref, 0))
+ if (!repo_dwim_ref(the_repository, *av, strlen(*av), &oid,
+ &ref, 0))
die(_("no such ref %s"), *av);
/* Has the base been specified? */
@@ -835,13 +847,13 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
die(Q_("cannot handle more than %d rev.",
"cannot handle more than %d revs.",
MAX_REVS), MAX_REVS);
- if (get_oid(ref_name[num_rev], &revkey))
+ if (repo_get_oid(the_repository, ref_name[num_rev], &revkey))
die(_("'%s' is not a valid ref."), ref_name[num_rev]);
commit = lookup_commit_reference(the_repository, &revkey);
if (!commit)
die(_("cannot find commit %s (%s)"),
ref_name[num_rev], oid_to_hex(&revkey));
- parse_commit(commit);
+ repo_parse_commit(the_repository, commit);
mark_seen(commit, &seen);
/* rev#0 uses bit REV_SHIFT, rev#1 uses bit REV_SHIFT+1,
@@ -928,7 +940,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
!is_merge_point &&
(this_flag & (1u << REV_SHIFT)))
continue;
- if (dense && is_merge &&
+ if (!sparse && is_merge &&
omit_in_dense(commit, rev, num_rev))
continue;
for (i = 0; i < num_rev; i++) {
@@ -955,5 +967,6 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
if (shown_merge_point && --extra < 0)
break;
}
+ free(head);
return 0;
}
diff --git a/builtin/show-index.c b/builtin/show-index.c
index 0e0b9fb..540dc3d 100644
--- a/builtin/show-index.c
+++ b/builtin/show-index.c
@@ -1,7 +1,10 @@
#include "builtin.h"
-#include "cache.h"
+#include "gettext.h"
+#include "hash.h"
+#include "hex.h"
#include "pack.h"
#include "parse-options.h"
+#include "repository.h"
static const char *const show_index_usage[] = {
"git show-index [--object-format=<hash-algorithm>]",
diff --git a/builtin/show-ref.c b/builtin/show-ref.c
index 5fa207a..1c15421 100644
--- a/builtin/show-ref.c
+++ b/builtin/show-ref.c
@@ -1,60 +1,79 @@
#include "builtin.h"
-#include "cache.h"
#include "config.h"
-#include "refs.h"
-#include "object-store.h"
+#include "gettext.h"
+#include "hex.h"
+#include "refs/refs-internal.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "object.h"
-#include "tag.h"
#include "string-list.h"
#include "parse-options.h"
static const char * const show_ref_usage[] = {
- N_("git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...]"),
+ N_("git show-ref [--head] [-d | --dereference]\n"
+ " [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+ " [--heads] [--] [<pattern>...]"),
+ N_("git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+ " [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+ " [--] [<ref>...]"),
N_("git show-ref --exclude-existing[=<pattern>]"),
+ N_("git show-ref --exists <ref>"),
NULL
};
-static int deref_tags, show_head, tags_only, heads_only, found_match, verify,
- quiet, hash_only, abbrev, exclude_arg;
-static const char **pattern;
-static const char *exclude_existing_arg;
+struct show_one_options {
+ int quiet;
+ int hash_only;
+ int abbrev;
+ int deref_tags;
+};
-static void show_one(const char *refname, const struct object_id *oid)
+static void show_one(const struct show_one_options *opts,
+ const char *refname, const struct object_id *oid)
{
const char *hex;
struct object_id peeled;
- if (!has_object_file(oid))
+ if (!repo_has_object_file(the_repository, oid))
die("git show-ref: bad ref %s (%s)", refname,
oid_to_hex(oid));
- if (quiet)
+ if (opts->quiet)
return;
- hex = find_unique_abbrev(oid, abbrev);
- if (hash_only)
+ hex = repo_find_unique_abbrev(the_repository, oid, opts->abbrev);
+ if (opts->hash_only)
printf("%s\n", hex);
else
printf("%s %s\n", hex, refname);
- if (!deref_tags)
+ if (!opts->deref_tags)
return;
if (!peel_iterated_oid(oid, &peeled)) {
- hex = find_unique_abbrev(&peeled, abbrev);
+ hex = repo_find_unique_abbrev(the_repository, &peeled, opts->abbrev);
printf("%s %s^{}\n", hex, refname);
}
}
+struct show_ref_data {
+ const struct show_one_options *show_one_opts;
+ const char **patterns;
+ int found_match;
+ int show_head;
+};
+
static int show_ref(const char *refname, const struct object_id *oid,
- int flag, void *cbdata)
+ int flag UNUSED, void *cbdata)
{
- if (show_head && !strcmp(refname, "HEAD"))
+ struct show_ref_data *data = cbdata;
+
+ if (data->show_head && !strcmp(refname, "HEAD"))
goto match;
- if (pattern) {
+ if (data->patterns) {
int reflen = strlen(refname);
- const char **p = pattern, *m;
+ const char **p = data->patterns, *m;
while ((m = *p++) != NULL) {
int len = strlen(m);
if (len > reflen)
@@ -70,21 +89,31 @@ static int show_ref(const char *refname, const struct object_id *oid,
}
match:
- found_match++;
+ data->found_match++;
- show_one(refname, oid);
+ show_one(data->show_one_opts, refname, oid);
return 0;
}
-static int add_existing(const char *refname, const struct object_id *oid,
- int flag, void *cbdata)
+static int add_existing(const char *refname,
+ const struct object_id *oid UNUSED,
+ int flag UNUSED, void *cbdata)
{
struct string_list *list = (struct string_list *)cbdata;
string_list_insert(list, refname);
return 0;
}
+struct exclude_existing_options {
+ /*
+ * We need an explicit `enabled` field because it is perfectly valid
+ * for `pattern` to be `NULL` even if `--exclude-existing` was given.
+ */
+ int enabled;
+ const char *pattern;
+};
+
/*
* read "^(?:<anything>\s)?<refname>(?:\^\{\})?$" from the standard input,
* and
@@ -94,11 +123,11 @@ static int add_existing(const char *refname, const struct object_id *oid,
* (4) ignore if refname is a ref that exists in the local repository;
* (5) otherwise output the line.
*/
-static int exclude_existing(const char *match)
+static int cmd_show_ref__exclude_existing(const struct exclude_existing_options *opts)
{
- static struct string_list existing_refs = STRING_LIST_INIT_DUP;
+ struct string_list existing_refs = STRING_LIST_INIT_DUP;
char buf[1024];
- int matchlen = match ? strlen(match) : 0;
+ int patternlen = opts->pattern ? strlen(opts->pattern) : 0;
for_each_ref(add_existing, &existing_refs);
while (fgets(buf, sizeof(buf), stdin)) {
@@ -114,11 +143,11 @@ static int exclude_existing(const char *match)
for (ref = buf + len; buf < ref; ref--)
if (isspace(ref[-1]))
break;
- if (match) {
+ if (opts->pattern) {
int reflen = buf + len - ref;
- if (reflen < matchlen)
+ if (reflen < patternlen)
continue;
- if (strncmp(ref, match, matchlen))
+ if (strncmp(ref, opts->pattern, patternlen))
continue;
}
if (check_refname_format(ref, 0)) {
@@ -129,97 +158,172 @@ static int exclude_existing(const char *match)
printf("%s\n", buf);
}
}
+
+ string_list_clear(&existing_refs, 0);
+ return 0;
+}
+
+static int cmd_show_ref__verify(const struct show_one_options *show_one_opts,
+ const char **refs)
+{
+ if (!refs || !*refs)
+ die("--verify requires a reference");
+
+ while (*refs) {
+ struct object_id oid;
+
+ if ((starts_with(*refs, "refs/") || refname_is_safe(*refs)) &&
+ !read_ref(*refs, &oid)) {
+ show_one(show_one_opts, *refs, &oid);
+ }
+ else if (!show_one_opts->quiet)
+ die("'%s' - not a valid ref", *refs);
+ else
+ return 1;
+ refs++;
+ }
+
return 0;
}
+struct patterns_options {
+ int show_head;
+ int heads_only;
+ int tags_only;
+};
+
+static int cmd_show_ref__patterns(const struct patterns_options *opts,
+ const struct show_one_options *show_one_opts,
+ const char **patterns)
+{
+ struct show_ref_data show_ref_data = {
+ .show_one_opts = show_one_opts,
+ .show_head = opts->show_head,
+ };
+
+ if (patterns && *patterns)
+ show_ref_data.patterns = patterns;
+
+ if (opts->show_head)
+ head_ref(show_ref, &show_ref_data);
+ if (opts->heads_only || opts->tags_only) {
+ if (opts->heads_only)
+ for_each_fullref_in("refs/heads/", show_ref, &show_ref_data);
+ if (opts->tags_only)
+ for_each_fullref_in("refs/tags/", show_ref, &show_ref_data);
+ } else {
+ for_each_ref(show_ref, &show_ref_data);
+ }
+ if (!show_ref_data.found_match)
+ return 1;
+
+ return 0;
+}
+
+static int cmd_show_ref__exists(const char **refs)
+{
+ struct strbuf unused_referent = STRBUF_INIT;
+ struct object_id unused_oid;
+ unsigned int unused_type;
+ int failure_errno = 0;
+ const char *ref;
+ int ret = 0;
+
+ if (!refs || !*refs)
+ die("--exists requires a reference");
+ ref = *refs++;
+ if (*refs)
+ die("--exists requires exactly one reference");
+
+ if (refs_read_raw_ref(get_main_ref_store(the_repository), ref,
+ &unused_oid, &unused_referent, &unused_type,
+ &failure_errno)) {
+ if (failure_errno == ENOENT || failure_errno == EISDIR) {
+ error(_("reference does not exist"));
+ ret = 2;
+ } else {
+ errno = failure_errno;
+ error_errno(_("failed to look up reference"));
+ ret = 1;
+ }
+
+ goto out;
+ }
+
+out:
+ strbuf_release(&unused_referent);
+ return ret;
+}
+
static int hash_callback(const struct option *opt, const char *arg, int unset)
{
- hash_only = 1;
+ struct show_one_options *opts = opt->value;
+ struct option abbrev_opt = *opt;
+
+ opts->hash_only = 1;
/* Use full length SHA1 if no argument */
if (!arg)
return 0;
- return parse_opt_abbrev_cb(opt, arg, unset);
+
+ abbrev_opt.value = &opts->abbrev;
+ return parse_opt_abbrev_cb(&abbrev_opt, arg, unset);
}
static int exclude_existing_callback(const struct option *opt, const char *arg,
int unset)
{
+ struct exclude_existing_options *opts = opt->value;
BUG_ON_OPT_NEG(unset);
- exclude_arg = 1;
- *(const char **)opt->value = arg;
+ opts->enabled = 1;
+ opts->pattern = arg;
return 0;
}
-static const struct option show_ref_options[] = {
- OPT_BOOL(0, "tags", &tags_only, N_("only show tags (can be combined with heads)")),
- OPT_BOOL(0, "heads", &heads_only, N_("only show heads (can be combined with tags)")),
- OPT_BOOL(0, "verify", &verify, N_("stricter reference checking, "
- "requires exact ref path")),
- OPT_HIDDEN_BOOL('h', NULL, &show_head,
- N_("show the HEAD reference, even if it would be filtered out")),
- OPT_BOOL(0, "head", &show_head,
- N_("show the HEAD reference, even if it would be filtered out")),
- OPT_BOOL('d', "dereference", &deref_tags,
- N_("dereference tags into object IDs")),
- OPT_CALLBACK_F('s', "hash", &abbrev, N_("n"),
- N_("only show SHA1 hash using <n> digits"),
- PARSE_OPT_OPTARG, &hash_callback),
- OPT__ABBREV(&abbrev),
- OPT__QUIET(&quiet,
- N_("do not print results to stdout (useful with --verify)")),
- OPT_CALLBACK_F(0, "exclude-existing", &exclude_existing_arg,
- N_("pattern"), N_("show refs from stdin that aren't in local repository"),
- PARSE_OPT_OPTARG | PARSE_OPT_NONEG, exclude_existing_callback),
- OPT_END()
-};
-
int cmd_show_ref(int argc, const char **argv, const char *prefix)
{
+ struct exclude_existing_options exclude_existing_opts = {0};
+ struct patterns_options patterns_opts = {0};
+ struct show_one_options show_one_opts = {0};
+ int verify = 0, exists = 0;
+ const struct option show_ref_options[] = {
+ OPT_BOOL(0, "tags", &patterns_opts.tags_only, N_("only show tags (can be combined with heads)")),
+ OPT_BOOL(0, "heads", &patterns_opts.heads_only, N_("only show heads (can be combined with tags)")),
+ OPT_BOOL(0, "exists", &exists, N_("check for reference existence without resolving")),
+ OPT_BOOL(0, "verify", &verify, N_("stricter reference checking, "
+ "requires exact ref path")),
+ OPT_HIDDEN_BOOL('h', NULL, &patterns_opts.show_head,
+ N_("show the HEAD reference, even if it would be filtered out")),
+ OPT_BOOL(0, "head", &patterns_opts.show_head,
+ N_("show the HEAD reference, even if it would be filtered out")),
+ OPT_BOOL('d', "dereference", &show_one_opts.deref_tags,
+ N_("dereference tags into object IDs")),
+ OPT_CALLBACK_F('s', "hash", &show_one_opts, N_("n"),
+ N_("only show SHA1 hash using <n> digits"),
+ PARSE_OPT_OPTARG, &hash_callback),
+ OPT__ABBREV(&show_one_opts.abbrev),
+ OPT__QUIET(&show_one_opts.quiet,
+ N_("do not print results to stdout (useful with --verify)")),
+ OPT_CALLBACK_F(0, "exclude-existing", &exclude_existing_opts,
+ N_("pattern"), N_("show refs from stdin that aren't in local repository"),
+ PARSE_OPT_OPTARG | PARSE_OPT_NONEG, exclude_existing_callback),
+ OPT_END()
+ };
+
git_config(git_default_config, NULL);
argc = parse_options(argc, argv, prefix, show_ref_options,
show_ref_usage, 0);
- if (exclude_arg)
- return exclude_existing(exclude_existing_arg);
-
- pattern = argv;
- if (!*pattern)
- pattern = NULL;
-
- if (verify) {
- if (!pattern)
- die("--verify requires a reference");
- while (*pattern) {
- struct object_id oid;
-
- if ((starts_with(*pattern, "refs/") || !strcmp(*pattern, "HEAD")) &&
- !read_ref(*pattern, &oid)) {
- show_one(*pattern, &oid);
- }
- else if (!quiet)
- die("'%s' - not a valid ref", *pattern);
- else
- return 1;
- pattern++;
- }
- return 0;
- }
+ die_for_incompatible_opt3(exclude_existing_opts.enabled, "--exclude-existing",
+ verify, "--verify",
+ exists, "--exists");
- if (show_head)
- head_ref(show_ref, NULL);
- if (heads_only || tags_only) {
- if (heads_only)
- for_each_fullref_in("refs/heads/", show_ref, NULL);
- if (tags_only)
- for_each_fullref_in("refs/tags/", show_ref, NULL);
- } else {
- for_each_ref(show_ref, NULL);
- }
- if (!found_match) {
- if (verify && !quiet)
- die("No match");
- return 1;
- }
- return 0;
+ if (exclude_existing_opts.enabled)
+ return cmd_show_ref__exclude_existing(&exclude_existing_opts);
+ else if (verify)
+ return cmd_show_ref__verify(&show_one_opts, argv);
+ else if (exists)
+ return cmd_show_ref__exists(argv);
+ else
+ return cmd_show_ref__patterns(&patterns_opts, &show_one_opts, argv);
}
diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c
index f91e29b..0f52e25 100644
--- a/builtin/sparse-checkout.c
+++ b/builtin/sparse-checkout.c
@@ -1,26 +1,26 @@
#include "builtin.h"
-#include "cache.h"
#include "config.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
+#include "object-file.h"
+#include "object-name.h"
#include "parse-options.h"
#include "pathspec.h"
#include "repository.h"
-#include "run-command.h"
#include "strbuf.h"
#include "string-list.h"
-#include "cache-tree.h"
#include "lockfile.h"
-#include "resolve-undo.h"
#include "unpack-trees.h"
-#include "wt-status.h"
#include "quote.h"
+#include "setup.h"
#include "sparse-index.h"
#include "worktree.h"
static const char *empty_base = "";
static char const * const builtin_sparse_checkout_usage[] = {
- N_("git sparse-checkout (init|list|set|add|reapply|disable) <options>"),
+ N_("git sparse-checkout (init | list | set | add | reapply | disable | check-rules) [<options>]"),
NULL
};
@@ -48,7 +48,7 @@ static char const * const builtin_sparse_checkout_list_usage[] = {
NULL
};
-static int sparse_checkout_list(int argc, const char **argv)
+static int sparse_checkout_list(int argc, const char **argv, const char *prefix)
{
static struct option builtin_sparse_checkout_list_options[] = {
OPT_END(),
@@ -57,10 +57,11 @@ static int sparse_checkout_list(int argc, const char **argv)
char *sparse_filename;
int res;
+ setup_work_tree();
if (!core_apply_sparse_checkout)
die(_("this worktree is not sparse"));
- argc = parse_options(argc, argv, NULL,
+ argc = parse_options(argc, argv, prefix,
builtin_sparse_checkout_list_options,
builtin_sparse_checkout_list_usage, 0);
@@ -218,14 +219,13 @@ static int update_working_directory(struct pattern_list *pl)
o.src_index = r->index;
o.dst_index = r->index;
o.skip_sparse_checkout = 0;
- o.pl = pl;
setup_work_tree();
repo_hold_locked_index(r, &lock_file, LOCK_DIE_ON_ERROR);
setup_unpack_trees_porcelain(&o, "sparse-checkout");
- result = update_sparsity(&o);
+ result = update_sparsity(&o, pl);
clear_unpack_trees_porcelain(&o);
if (result == UPDATE_SPARSITY_WARNINGS)
@@ -382,13 +382,7 @@ static int set_config(enum sparse_checkout_mode mode)
return 0;
}
-static int update_modes(int *cone_mode, int *sparse_index)
-{
- int mode, record_mode;
-
- /* Determine if we need to record the mode; ensure sparse checkout on */
- record_mode = (*cone_mode != -1) || !core_apply_sparse_checkout;
-
+static enum sparse_checkout_mode update_cone_mode(int *cone_mode) {
/* If not specified, use previous definition of cone mode */
if (*cone_mode == -1 && core_apply_sparse_checkout)
*cone_mode = core_sparse_checkout_cone;
@@ -396,12 +390,21 @@ static int update_modes(int *cone_mode, int *sparse_index)
/* Set cone/non-cone mode appropriately */
core_apply_sparse_checkout = 1;
if (*cone_mode == 1 || *cone_mode == -1) {
- mode = MODE_CONE_PATTERNS;
core_sparse_checkout_cone = 1;
- } else {
- mode = MODE_ALL_PATTERNS;
- core_sparse_checkout_cone = 0;
+ return MODE_CONE_PATTERNS;
}
+ core_sparse_checkout_cone = 0;
+ return MODE_ALL_PATTERNS;
+}
+
+static int update_modes(int *cone_mode, int *sparse_index)
+{
+ int mode, record_mode;
+
+ /* Determine if we need to record the mode; ensure sparse checkout on */
+ record_mode = (*cone_mode != -1) || !core_apply_sparse_checkout;
+
+ mode = update_cone_mode(cone_mode);
if (record_mode && set_config(mode))
return 1;
@@ -431,7 +434,7 @@ static struct sparse_checkout_init_opts {
int sparse_index;
} init_opts;
-static int sparse_checkout_init(int argc, const char **argv)
+static int sparse_checkout_init(int argc, const char **argv, const char *prefix)
{
struct pattern_list pl;
char *sparse_filename;
@@ -447,12 +450,13 @@ static int sparse_checkout_init(int argc, const char **argv)
OPT_END(),
};
+ setup_work_tree();
repo_read_index(the_repository);
init_opts.cone_mode = -1;
init_opts.sparse_index = -1;
- argc = parse_options(argc, argv, NULL,
+ argc = parse_options(argc, argv, prefix,
builtin_sparse_checkout_init_options,
builtin_sparse_checkout_init_usage, 0);
@@ -470,7 +474,7 @@ static int sparse_checkout_init(int argc, const char **argv)
return update_working_directory(NULL);
}
- if (get_oid("HEAD", &oid)) {
+ if (repo_get_oid(the_repository, "HEAD", &oid)) {
FILE *fp;
/* assume we are in a fresh repo, but update the sparse-checkout file */
@@ -544,7 +548,7 @@ static void strbuf_to_cone_pattern(struct strbuf *line, struct pattern_list *pl)
static void add_patterns_from_input(struct pattern_list *pl,
int argc, const char **argv,
- int use_stdin)
+ FILE *file)
{
int i;
if (core_sparse_checkout_cone) {
@@ -554,9 +558,9 @@ static void add_patterns_from_input(struct pattern_list *pl,
hashmap_init(&pl->parent_hashmap, pl_hashmap_cmp, NULL, 0);
pl->use_cone_patterns = 1;
- if (use_stdin) {
+ if (file) {
struct strbuf unquoted = STRBUF_INIT;
- while (!strbuf_getline(&line, stdin)) {
+ while (!strbuf_getline(&line, file)) {
if (line.buf[0] == '"') {
strbuf_reset(&unquoted);
if (unquote_c_style(&unquoted, line.buf, NULL))
@@ -578,10 +582,10 @@ static void add_patterns_from_input(struct pattern_list *pl,
}
}
} else {
- if (use_stdin) {
+ if (file) {
struct strbuf line = STRBUF_INIT;
- while (!strbuf_getline(&line, stdin)) {
+ while (!strbuf_getline(&line, file)) {
size_t len;
char *buf = strbuf_detach(&line, &len);
add_pattern(buf, empty_base, 0, pl, 0);
@@ -608,7 +612,8 @@ static void add_patterns_cone_mode(int argc, const char **argv,
struct pattern_list existing;
char *sparse_filename = get_sparse_checkout_filename();
- add_patterns_from_input(pl, argc, argv, use_stdin);
+ add_patterns_from_input(pl, argc, argv,
+ use_stdin ? stdin : NULL);
memset(&existing, 0, sizeof(existing));
existing.use_cone_patterns = core_sparse_checkout_cone;
@@ -645,7 +650,7 @@ static void add_patterns_literal(int argc, const char **argv,
pl, NULL, 0))
die(_("unable to load existing sparse-checkout patterns"));
free(sparse_filename);
- add_patterns_from_input(pl, argc, argv, use_stdin);
+ add_patterns_from_input(pl, argc, argv, use_stdin ? stdin : NULL);
}
static int modify_pattern_list(int argc, const char **argv, int use_stdin,
@@ -664,7 +669,8 @@ static int modify_pattern_list(int argc, const char **argv, int use_stdin,
break;
case REPLACE:
- add_patterns_from_input(pl, argc, argv, use_stdin);
+ add_patterns_from_input(pl, argc, argv,
+ use_stdin ? stdin : NULL);
break;
}
@@ -759,6 +765,7 @@ static int sparse_checkout_add(int argc, const char **argv, const char *prefix)
OPT_END(),
};
+ setup_work_tree();
if (!core_apply_sparse_checkout)
die(_("no sparse-checkout to add to"));
@@ -766,8 +773,7 @@ static int sparse_checkout_add(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, prefix,
builtin_sparse_checkout_add_options,
- builtin_sparse_checkout_add_usage,
- PARSE_OPT_KEEP_UNKNOWN);
+ builtin_sparse_checkout_add_usage, 0);
sanitize_paths(argc, argv, prefix, add_opts.skip_checks);
@@ -805,6 +811,7 @@ static int sparse_checkout_set(int argc, const char **argv, const char *prefix)
OPT_END(),
};
+ setup_work_tree();
repo_read_index(the_repository);
set_opts.cone_mode = -1;
@@ -812,8 +819,7 @@ static int sparse_checkout_set(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, prefix,
builtin_sparse_checkout_set_options,
- builtin_sparse_checkout_set_usage,
- PARSE_OPT_KEEP_UNKNOWN);
+ builtin_sparse_checkout_set_usage, 0);
if (update_modes(&set_opts.cone_mode, &set_opts.sparse_index))
return 1;
@@ -823,7 +829,7 @@ static int sparse_checkout_set(int argc, const char **argv, const char *prefix)
* non-cone mode, if nothing is specified, manually select just the
* top-level directory (much as 'init' would do).
*/
- if (!core_sparse_checkout_cone && argc == 0) {
+ if (!core_sparse_checkout_cone && !set_opts.use_stdin && argc == 0) {
argv = default_patterns;
argc = default_patterns_nr;
} else {
@@ -843,7 +849,8 @@ static struct sparse_checkout_reapply_opts {
int sparse_index;
} reapply_opts;
-static int sparse_checkout_reapply(int argc, const char **argv)
+static int sparse_checkout_reapply(int argc, const char **argv,
+ const char *prefix)
{
static struct option builtin_sparse_checkout_reapply_options[] = {
OPT_BOOL(0, "cone", &reapply_opts.cone_mode,
@@ -853,13 +860,14 @@ static int sparse_checkout_reapply(int argc, const char **argv)
OPT_END(),
};
+ setup_work_tree();
if (!core_apply_sparse_checkout)
die(_("must be in a sparse-checkout to reapply sparsity patterns"));
reapply_opts.cone_mode = -1;
reapply_opts.sparse_index = -1;
- argc = parse_options(argc, argv, NULL,
+ argc = parse_options(argc, argv, prefix,
builtin_sparse_checkout_reapply_options,
builtin_sparse_checkout_reapply_usage, 0);
@@ -876,7 +884,8 @@ static char const * const builtin_sparse_checkout_disable_usage[] = {
NULL
};
-static int sparse_checkout_disable(int argc, const char **argv)
+static int sparse_checkout_disable(int argc, const char **argv,
+ const char *prefix)
{
static struct option builtin_sparse_checkout_disable_options[] = {
OPT_END(),
@@ -895,7 +904,8 @@ static int sparse_checkout_disable(int argc, const char **argv)
* forcibly return to a dense checkout regardless of initial state.
*/
- argc = parse_options(argc, argv, NULL,
+ setup_work_tree();
+ argc = parse_options(argc, argv, prefix,
builtin_sparse_checkout_disable_options,
builtin_sparse_checkout_disable_usage, 0);
@@ -920,41 +930,112 @@ static int sparse_checkout_disable(int argc, const char **argv)
return set_config(MODE_NO_PATTERNS);
}
-int cmd_sparse_checkout(int argc, const char **argv, const char *prefix)
+static char const * const builtin_sparse_checkout_check_rules_usage[] = {
+ N_("git sparse-checkout check-rules [-z] [--skip-checks]"
+ "[--[no-]cone] [--rules-file <file>]"),
+ NULL
+};
+
+static struct sparse_checkout_check_rules_opts {
+ int cone_mode;
+ int null_termination;
+ char *rules_file;
+} check_rules_opts;
+
+static int check_rules(struct pattern_list *pl, int null_terminated) {
+ struct strbuf line = STRBUF_INIT;
+ struct strbuf unquoted = STRBUF_INIT;
+ char *path;
+ int line_terminator = null_terminated ? 0 : '\n';
+ strbuf_getline_fn getline_fn = null_terminated ? strbuf_getline_nul
+ : strbuf_getline;
+ the_repository->index->sparse_checkout_patterns = pl;
+ while (!getline_fn(&line, stdin)) {
+ path = line.buf;
+ if (!null_terminated && line.buf[0] == '"') {
+ strbuf_reset(&unquoted);
+ if (unquote_c_style(&unquoted, line.buf, NULL))
+ die(_("unable to unquote C-style string '%s'"),
+ line.buf);
+
+ path = unquoted.buf;
+ }
+
+ if (path_in_sparse_checkout(path, the_repository->index))
+ write_name_quoted(path, stdout, line_terminator);
+ }
+ strbuf_release(&line);
+ strbuf_release(&unquoted);
+
+ return 0;
+}
+
+static int sparse_checkout_check_rules(int argc, const char **argv, const char *prefix)
{
- static struct option builtin_sparse_checkout_options[] = {
+ static struct option builtin_sparse_checkout_check_rules_options[] = {
+ OPT_BOOL('z', NULL, &check_rules_opts.null_termination,
+ N_("terminate input and output files by a NUL character")),
+ OPT_BOOL(0, "cone", &check_rules_opts.cone_mode,
+ N_("when used with --rules-file interpret patterns as cone mode patterns")),
+ OPT_FILENAME(0, "rules-file", &check_rules_opts.rules_file,
+ N_("use patterns in <file> instead of the current ones.")),
OPT_END(),
};
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage_with_options(builtin_sparse_checkout_usage,
- builtin_sparse_checkout_options);
+ FILE *fp;
+ int ret;
+ struct pattern_list pl = {0};
+ char *sparse_filename;
+ check_rules_opts.cone_mode = -1;
+
+ argc = parse_options(argc, argv, prefix,
+ builtin_sparse_checkout_check_rules_options,
+ builtin_sparse_checkout_check_rules_usage, 0);
+
+ if (check_rules_opts.rules_file && check_rules_opts.cone_mode < 0)
+ check_rules_opts.cone_mode = 1;
+
+ update_cone_mode(&check_rules_opts.cone_mode);
+ pl.use_cone_patterns = core_sparse_checkout_cone;
+ if (check_rules_opts.rules_file) {
+ fp = xfopen(check_rules_opts.rules_file, "r");
+ add_patterns_from_input(&pl, argc, argv, fp);
+ fclose(fp);
+ } else {
+ sparse_filename = get_sparse_checkout_filename();
+ if (add_patterns_from_file_to_list(sparse_filename, "", 0, &pl,
+ NULL, 0))
+ die(_("unable to load existing sparse-checkout patterns"));
+ free(sparse_filename);
+ }
+
+ ret = check_rules(&pl, check_rules_opts.null_termination);
+ clear_pattern_list(&pl);
+ return ret;
+}
+
+int cmd_sparse_checkout(int argc, const char **argv, const char *prefix)
+{
+ parse_opt_subcommand_fn *fn = NULL;
+ struct option builtin_sparse_checkout_options[] = {
+ OPT_SUBCOMMAND("list", &fn, sparse_checkout_list),
+ OPT_SUBCOMMAND("init", &fn, sparse_checkout_init),
+ OPT_SUBCOMMAND("set", &fn, sparse_checkout_set),
+ OPT_SUBCOMMAND("add", &fn, sparse_checkout_add),
+ OPT_SUBCOMMAND("reapply", &fn, sparse_checkout_reapply),
+ OPT_SUBCOMMAND("disable", &fn, sparse_checkout_disable),
+ OPT_SUBCOMMAND("check-rules", &fn, sparse_checkout_check_rules),
+ OPT_END(),
+ };
argc = parse_options(argc, argv, prefix,
builtin_sparse_checkout_options,
- builtin_sparse_checkout_usage,
- PARSE_OPT_STOP_AT_NON_OPTION);
+ builtin_sparse_checkout_usage, 0);
git_config(git_default_config, NULL);
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
- if (argc > 0) {
- if (!strcmp(argv[0], "list"))
- return sparse_checkout_list(argc, argv);
- if (!strcmp(argv[0], "init"))
- return sparse_checkout_init(argc, argv);
- if (!strcmp(argv[0], "set"))
- return sparse_checkout_set(argc, argv, prefix);
- if (!strcmp(argv[0], "add"))
- return sparse_checkout_add(argc, argv, prefix);
- if (!strcmp(argv[0], "reapply"))
- return sparse_checkout_reapply(argc, argv);
- if (!strcmp(argv[0], "disable"))
- return sparse_checkout_disable(argc, argv);
- }
-
- usage_with_options(builtin_sparse_checkout_usage,
- builtin_sparse_checkout_options);
+ return fn(argc, argv, prefix);
}
diff --git a/builtin/stash.c b/builtin/stash.c
index 30fa101..062be1f 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -1,6 +1,12 @@
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hash.h"
+#include "hex.h"
+#include "object-name.h"
#include "parse-options.h"
#include "refs.h"
#include "lockfile.h"
@@ -12,81 +18,108 @@
#include "run-command.h"
#include "dir.h"
#include "entry.h"
+#include "preload-index.h"
+#include "read-cache.h"
#include "rerere.h"
#include "revision.h"
+#include "setup.h"
+#include "sparse-index.h"
#include "log-tree.h"
#include "diffcore.h"
-#include "exec-cmd.h"
#include "reflog.h"
+#include "add-interactive.h"
#define INCLUDE_ALL_FILES 2
+#define BUILTIN_STASH_LIST_USAGE \
+ N_("git stash list [<log-options>]")
+#define BUILTIN_STASH_SHOW_USAGE \
+ N_("git stash show [-u | --include-untracked | --only-untracked] [<diff-options>] [<stash>]")
+#define BUILTIN_STASH_DROP_USAGE \
+ N_("git stash drop [-q | --quiet] [<stash>]")
+#define BUILTIN_STASH_POP_USAGE \
+ N_("git stash pop [--index] [-q | --quiet] [<stash>]")
+#define BUILTIN_STASH_APPLY_USAGE \
+ N_("git stash apply [--index] [-q | --quiet] [<stash>]")
+#define BUILTIN_STASH_BRANCH_USAGE \
+ N_("git stash branch <branchname> [<stash>]")
+#define BUILTIN_STASH_STORE_USAGE \
+ N_("git stash store [(-m | --message) <message>] [-q | --quiet] <commit>")
+#define BUILTIN_STASH_PUSH_USAGE \
+ N_("git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]\n" \
+ " [-u | --include-untracked] [-a | --all] [(-m | --message) <message>]\n" \
+ " [--pathspec-from-file=<file> [--pathspec-file-nul]]\n" \
+ " [--] [<pathspec>...]]")
+#define BUILTIN_STASH_SAVE_USAGE \
+ N_("git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]\n" \
+ " [-u | --include-untracked] [-a | --all] [<message>]")
+#define BUILTIN_STASH_CREATE_USAGE \
+ N_("git stash create [<message>]")
+#define BUILTIN_STASH_CLEAR_USAGE \
+ "git stash clear"
+
static const char * const git_stash_usage[] = {
- N_("git stash list [<options>]"),
- N_("git stash show [<options>] [<stash>]"),
- N_("git stash drop [-q|--quiet] [<stash>]"),
- N_("git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"),
- N_("git stash branch <branchname> [<stash>]"),
- "git stash clear",
- N_("git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--quiet]\n"
- " [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
- " [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
- " [--] [<pathspec>...]]"),
- N_("git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--quiet]\n"
- " [-u|--include-untracked] [-a|--all] [<message>]"),
+ BUILTIN_STASH_LIST_USAGE,
+ BUILTIN_STASH_SHOW_USAGE,
+ BUILTIN_STASH_DROP_USAGE,
+ BUILTIN_STASH_POP_USAGE,
+ BUILTIN_STASH_APPLY_USAGE,
+ BUILTIN_STASH_BRANCH_USAGE,
+ BUILTIN_STASH_PUSH_USAGE,
+ BUILTIN_STASH_SAVE_USAGE,
+ BUILTIN_STASH_CLEAR_USAGE,
+ BUILTIN_STASH_CREATE_USAGE,
+ BUILTIN_STASH_STORE_USAGE,
NULL
};
static const char * const git_stash_list_usage[] = {
- N_("git stash list [<options>]"),
+ BUILTIN_STASH_LIST_USAGE,
NULL
};
static const char * const git_stash_show_usage[] = {
- N_("git stash show [<options>] [<stash>]"),
+ BUILTIN_STASH_SHOW_USAGE,
NULL
};
static const char * const git_stash_drop_usage[] = {
- N_("git stash drop [-q|--quiet] [<stash>]"),
+ BUILTIN_STASH_DROP_USAGE,
NULL
};
static const char * const git_stash_pop_usage[] = {
- N_("git stash pop [--index] [-q|--quiet] [<stash>]"),
+ BUILTIN_STASH_POP_USAGE,
NULL
};
static const char * const git_stash_apply_usage[] = {
- N_("git stash apply [--index] [-q|--quiet] [<stash>]"),
+ BUILTIN_STASH_APPLY_USAGE,
NULL
};
static const char * const git_stash_branch_usage[] = {
- N_("git stash branch <branchname> [<stash>]"),
+ BUILTIN_STASH_BRANCH_USAGE,
NULL
};
static const char * const git_stash_clear_usage[] = {
- "git stash clear",
+ BUILTIN_STASH_CLEAR_USAGE,
NULL
};
static const char * const git_stash_store_usage[] = {
- N_("git stash store [-m|--message <message>] [-q|--quiet] <commit>"),
+ BUILTIN_STASH_STORE_USAGE,
NULL
};
static const char * const git_stash_push_usage[] = {
- N_("git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
- " [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
- " [--] [<pathspec>...]]"),
+ BUILTIN_STASH_PUSH_USAGE,
NULL
};
static const char * const git_stash_save_usage[] = {
- N_("git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
- " [-u|--include-untracked] [-a|--all] [<message>]"),
+ BUILTIN_STASH_SAVE_USAGE,
NULL
};
@@ -177,7 +210,7 @@ static int get_stash_info(struct stash_info *info, int argc, const char **argv)
revision = info->revision.buf;
- if (get_oid(revision, &info->w_commit))
+ if (repo_get_oid(the_repository, revision, &info->w_commit))
return error(_("%s is not a valid reference"), revision);
assert_stash_like(info, revision);
@@ -187,7 +220,8 @@ static int get_stash_info(struct stash_info *info, int argc, const char **argv)
end_of_rev = strchrnul(revision, '@');
strbuf_add(&symbolic, revision, end_of_rev - revision);
- ret = dwim_ref(symbolic.buf, symbolic.len, &dummy, &expanded_ref, 0);
+ ret = repo_dwim_ref(the_repository, symbolic.buf, symbolic.len,
+ &dummy, &expanded_ref, 0);
strbuf_release(&symbolic);
switch (ret) {
case 0: /* Not found, but valid ref */
@@ -207,7 +241,7 @@ static int get_stash_info(struct stash_info *info, int argc, const char **argv)
static int do_clear_stash(void)
{
struct object_id obj;
- if (get_oid(ref_stash, &obj))
+ if (repo_get_oid(the_repository, ref_stash, &obj))
return 0;
return delete_ref(NULL, ref_stash, &obj, 0);
@@ -238,11 +272,11 @@ static int reset_tree(struct object_id *i_tree, int update, int reset)
struct tree *tree;
struct lock_file lock_file = LOCK_INIT;
- read_cache_preload(NULL);
- if (refresh_cache(REFRESH_QUIET))
+ repo_read_index_preload(the_repository, NULL, 0);
+ if (refresh_index(&the_index, REFRESH_QUIET, NULL, NULL, NULL))
return -1;
- hold_locked_index(&lock_file, LOCK_DIE_ON_ERROR);
+ repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
memset(&opts, 0, sizeof(opts));
@@ -250,7 +284,7 @@ static int reset_tree(struct object_id *i_tree, int update, int reset)
if (parse_tree(tree))
return -1;
- init_tree_desc(t, tree->buffer, tree->size);
+ init_tree_desc(t, &tree->object.oid, tree->buffer, tree->size);
opts.head_idx = 1;
opts.src_index = &the_index;
@@ -327,7 +361,7 @@ static int is_path_a_directory(const char *path)
}
static void add_diff_to_buf(struct diff_queue_struct *q,
- struct diff_options *options,
+ struct diff_options *options UNUSED,
void *data)
{
int i;
@@ -403,7 +437,7 @@ static void unstage_changes_unless_new(struct object_id *orig_tree)
* to the index before a merge was run) and the current index
* (reflecting the changes brought in by the merge).
*/
- diff_setup(&diff_opts);
+ repo_diff_setup(the_repository, &diff_opts);
diff_opts.flags.recursive = 1;
diff_opts.detect_rename = 0;
diff_opts.output_format = DIFF_FORMAT_NO_OUTPUT;
@@ -431,10 +465,10 @@ static void unstage_changes_unless_new(struct object_id *orig_tree)
* path, but left it out of the working tree, then clear the
* SKIP_WORKTREE bit and write it to the working tree.
*/
- if (pos >= 0 && ce_skip_worktree(active_cache[pos])) {
+ if (pos >= 0 && ce_skip_worktree(the_index.cache[pos])) {
struct stat st;
- ce = active_cache[pos];
+ ce = the_index.cache[pos];
if (!lstat(ce->name, &st)) {
/* Conflicting path present; relocate it */
struct strbuf new_path = STRBUF_INIT;
@@ -486,7 +520,7 @@ static void unstage_changes_unless_new(struct object_id *orig_tree)
repo_hold_locked_index(the_repository, &lock, LOCK_DIE_ON_ERROR);
if (write_locked_index(&the_index, &lock,
COMMIT_LOCK | SKIP_IF_UNCHANGED))
- die(_("Unable to write index."));
+ die(_("could not write index"));
}
static int do_apply_stash(const char *prefix, struct stash_info *info,
@@ -500,11 +534,13 @@ static int do_apply_stash(const char *prefix, struct stash_info *info,
struct tree *head, *merge, *merge_base;
struct lock_file lock = LOCK_INIT;
- read_cache_preload(NULL);
- if (refresh_and_write_cache(REFRESH_QUIET, 0, 0))
- return -1;
+ repo_read_index_preload(the_repository, NULL, 0);
+ if (repo_refresh_and_write_index(the_repository, REFRESH_QUIET, 0, 0,
+ NULL, NULL, NULL))
+ return error(_("could not write index"));
- if (write_cache_as_tree(&c_tree, 0, NULL))
+ if (write_index_as_tree(&c_tree, &the_index, get_index_file(), 0,
+ NULL))
return error(_("cannot apply a stash in the middle of a merge"));
if (index) {
@@ -526,14 +562,15 @@ static int do_apply_stash(const char *prefix, struct stash_info *info,
return error(_("conflicts in index. "
"Try without --index."));
- discard_cache();
- read_cache();
- if (write_cache_as_tree(&index_tree, 0, NULL))
+ discard_index(&the_index);
+ repo_read_index(the_repository);
+ if (write_index_as_tree(&index_tree, &the_index,
+ get_index_file(), 0, NULL))
return error(_("could not save index tree"));
reset_head();
- discard_cache();
- read_cache();
+ discard_index(&the_index);
+ repo_read_index(the_repository);
}
}
@@ -573,7 +610,7 @@ static int do_apply_stash(const char *prefix, struct stash_info *info,
ret = error(_("could not write index"));
if (ret) {
- rerere(0);
+ repo_rerere(the_repository, 0);
if (index)
fprintf_ln(stderr, _("Index was not unstashed."));
@@ -638,9 +675,12 @@ cleanup:
return ret;
}
-static int reject_reflog_ent(struct object_id *ooid, struct object_id *noid,
- const char *email, timestamp_t timestamp, int tz,
- const char *message, void *cb_data)
+static int reject_reflog_ent(struct object_id *ooid UNUSED,
+ struct object_id *noid UNUSED,
+ const char *email UNUSED,
+ timestamp_t timestamp UNUSED,
+ int tz UNUSED, const char *message UNUSED,
+ void *cb_data UNUSED)
{
return 1;
}
@@ -782,7 +822,7 @@ static int list_stash(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, prefix, options,
git_stash_list_usage,
- PARSE_OPT_KEEP_UNKNOWN);
+ PARSE_OPT_KEEP_UNKNOWN_OPT);
if (!ref_exists(ref_stash))
return 0;
@@ -800,7 +840,8 @@ static int show_stat = 1;
static int show_patch;
static int show_include_untracked;
-static int git_stash_config(const char *var, const char *value, void *cb)
+static int git_stash_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(var, "stash.showstat")) {
show_stat = git_config_bool(var, value);
@@ -814,7 +855,7 @@ static int git_stash_config(const char *var, const char *value, void *cb)
show_include_untracked = git_config_bool(var, value);
return 0;
}
- return git_diff_basic_config(var, value, cb);
+ return git_diff_basic_config(var, value, ctx, cb);
}
static void diff_include_untracked(const struct stash_info *info, struct diff_options *diff_opt)
@@ -829,7 +870,8 @@ static void diff_include_untracked(const struct stash_info *info, struct diff_op
tree[i] = parse_tree_indirect(oid[i]);
if (parse_tree(tree[i]) < 0)
die(_("failed to parse tree"));
- init_tree_desc(&tree_desc[i], tree[i]->buffer, tree[i]->size);
+ init_tree_desc(&tree_desc[i], &tree[i]->object.oid,
+ tree[i]->buffer, tree[i]->size);
}
unpack_tree_opt.head_idx = -1;
@@ -870,10 +912,10 @@ static int show_stash(int argc, const char **argv, const char *prefix)
init_diff_ui_defaults();
git_config(git_diff_ui_config, NULL);
- init_revisions(&rev, prefix);
+ repo_init_revisions(the_repository, &rev, prefix);
argc = parse_options(argc, argv, prefix, options, git_stash_show_usage,
- PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN |
+ PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN_OPT |
PARSE_OPT_KEEP_DASHDASH);
strvec_push(&revision_args, argv[0]);
@@ -931,7 +973,7 @@ static int show_stash(int argc, const char **argv, const char *prefix)
}
log_tree_diff_flush(&rev);
- ret = diff_result_code(&rev.diffopt, 0);
+ ret = diff_result_code(&rev.diffopt);
cleanup:
strvec_clear(&stash_args);
free_stash_info(&info);
@@ -947,6 +989,12 @@ usage:
static int do_store_stash(const struct object_id *w_commit, const char *stash_msg,
int quiet)
{
+ struct stash_info info;
+ char revision[GIT_MAX_HEXSZ];
+
+ oid_to_hex_r(revision, w_commit);
+ assert_stash_like(&info, revision);
+
if (!stash_msg)
stash_msg = "Created via \"git stash store\".";
@@ -979,7 +1027,7 @@ static int store_stash(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, prefix, options,
git_stash_store_usage,
- PARSE_OPT_KEEP_UNKNOWN);
+ PARSE_OPT_KEEP_UNKNOWN_OPT);
if (argc != 1) {
if (!quiet)
@@ -1047,19 +1095,18 @@ static int get_untracked_files(const struct pathspec *ps, int include_untracked,
*/
static int check_changes_tracked_files(const struct pathspec *ps)
{
- int result;
struct rev_info rev;
struct object_id dummy;
int ret = 0;
/* No initial commit. */
- if (get_oid("HEAD", &dummy))
+ if (repo_get_oid(the_repository, "HEAD", &dummy))
return -1;
- if (read_cache() < 0)
+ if (repo_read_index(the_repository) < 0)
return -1;
- init_revisions(&rev, NULL);
+ repo_init_revisions(the_repository, &rev, NULL);
copy_pathspec(&rev.prune_data, ps);
rev.diffopt.flags.quick = 1;
@@ -1069,14 +1116,14 @@ static int check_changes_tracked_files(const struct pathspec *ps)
add_head_to_pending(&rev);
diff_setup_done(&rev.diffopt);
- result = run_diff_index(&rev, 1);
- if (diff_result_code(&rev.diffopt, result)) {
+ run_diff_index(&rev, DIFF_INDEX_CACHED);
+ if (diff_result_code(&rev.diffopt)) {
ret = 1;
goto done;
}
- result = run_diff_files(&rev, 0);
- if (diff_result_code(&rev.diffopt, result)) {
+ run_diff_files(&rev, 0);
+ if (diff_result_code(&rev.diffopt)) {
ret = 1;
goto done;
}
@@ -1110,7 +1157,7 @@ static int save_untracked_files(struct stash_info *info, struct strbuf *msg,
int ret = 0;
struct strbuf untracked_msg = STRBUF_INIT;
struct child_process cp_upd_index = CHILD_PROCESS_INIT;
- struct index_state istate = { NULL };
+ struct index_state istate = INDEX_STATE_INIT(the_repository);
cp_upd_index.git_cmd = 1;
strvec_pushl(&cp_upd_index.args, "update-index", "-z", "--add",
@@ -1138,7 +1185,7 @@ static int save_untracked_files(struct stash_info *info, struct strbuf *msg,
}
done:
- discard_index(&istate);
+ release_index(&istate);
strbuf_release(&untracked_msg);
remove_path(stash_index_path.buf);
return ret;
@@ -1149,7 +1196,7 @@ static int stash_staged(struct stash_info *info, struct strbuf *out_patch,
{
int ret = 0;
struct child_process cp_diff_tree = CHILD_PROCESS_INIT;
- struct index_state istate = { NULL };
+ struct index_state istate = INDEX_STATE_INIT(the_repository);
if (write_index_as_tree(&info->w_tree, &istate, the_repository->index_file,
0, NULL)) {
@@ -1172,7 +1219,7 @@ static int stash_staged(struct stash_info *info, struct strbuf *out_patch,
}
done:
- discard_index(&istate);
+ release_index(&istate);
return ret;
}
@@ -1182,7 +1229,7 @@ static int stash_patch(struct stash_info *info, const struct pathspec *ps,
int ret = 0;
struct child_process cp_read_tree = CHILD_PROCESS_INIT;
struct child_process cp_diff_tree = CHILD_PROCESS_INIT;
- struct index_state istate = { NULL };
+ struct index_state istate = INDEX_STATE_INIT(the_repository);
char *old_index_env = NULL, *old_repo_index_file;
remove_path(stash_index_path.buf);
@@ -1202,7 +1249,7 @@ static int stash_patch(struct stash_info *info, const struct pathspec *ps,
old_index_env = xstrdup_or_null(getenv(INDEX_ENVIRONMENT));
setenv(INDEX_ENVIRONMENT, the_repository->index_file, 1);
- ret = run_add_interactive(NULL, "--patch=stash", ps);
+ ret = !!run_add_p(the_repository, ADD_P_STASH, NULL, ps);
the_repository->index_file = old_repo_index_file;
if (old_index_env && *old_index_env)
@@ -1233,7 +1280,7 @@ static int stash_patch(struct stash_info *info, const struct pathspec *ps,
}
done:
- discard_index(&istate);
+ release_index(&istate);
remove_path(stash_index_path.buf);
return ret;
}
@@ -1244,9 +1291,9 @@ static int stash_working_tree(struct stash_info *info, const struct pathspec *ps
struct rev_info rev;
struct child_process cp_upd_index = CHILD_PROCESS_INIT;
struct strbuf diff_output = STRBUF_INIT;
- struct index_state istate = { NULL };
+ struct index_state istate = INDEX_STATE_INIT(the_repository);
- init_revisions(&rev, NULL);
+ repo_init_revisions(the_repository, &rev, NULL);
copy_pathspec(&rev.prune_data, ps);
set_alternate_index_output(stash_index_path.buf);
@@ -1260,17 +1307,14 @@ static int stash_working_tree(struct stash_info *info, const struct pathspec *ps
rev.diffopt.format_callback = add_diff_to_buf;
rev.diffopt.format_callback_data = &diff_output;
- if (read_cache_preload(&rev.diffopt.pathspec) < 0) {
+ if (repo_read_index_preload(the_repository, &rev.diffopt.pathspec, 0) < 0) {
ret = -1;
goto done;
}
add_pending_object(&rev, parse_object(the_repository, &info->b_commit),
"");
- if (run_diff_index(&rev, 0)) {
- ret = -1;
- goto done;
- }
+ run_diff_index(&rev, 0);
cp_upd_index.git_cmd = 1;
strvec_pushl(&cp_upd_index.args, "update-index",
@@ -1292,7 +1336,7 @@ static int stash_working_tree(struct stash_info *info, const struct pathspec *ps
}
done:
- discard_index(&istate);
+ release_index(&istate);
release_revisions(&rev);
strbuf_release(&diff_output);
remove_path(stash_index_path.buf);
@@ -1318,13 +1362,14 @@ static int do_create_stash(const struct pathspec *ps, struct strbuf *stash_msg_b
prepare_fallback_ident("git stash", "git@stash");
- read_cache_preload(NULL);
- if (refresh_and_write_cache(REFRESH_QUIET, 0, 0) < 0) {
- ret = -1;
+ repo_read_index_preload(the_repository, NULL, 0);
+ if (repo_refresh_and_write_index(the_repository, REFRESH_QUIET, 0, 0,
+ NULL, NULL, NULL) < 0) {
+ ret = error(_("could not write index"));
goto done;
}
- if (get_oid("HEAD", &info->b_commit)) {
+ if (repo_get_oid(the_repository, "HEAD", &info->b_commit)) {
if (!quiet)
fprintf_ln(stderr, _("You do not have "
"the initial commit yet"));
@@ -1342,14 +1387,16 @@ static int do_create_stash(const struct pathspec *ps, struct strbuf *stash_msg_b
branch_ref = resolve_ref_unsafe("HEAD", 0, NULL, &flags);
if (flags & REF_ISSYMREF)
skip_prefix(branch_ref, "refs/heads/", &branch_name);
- head_short_sha1 = find_unique_abbrev(&head_commit->object.oid,
- DEFAULT_ABBREV);
+ head_short_sha1 = repo_find_unique_abbrev(the_repository,
+ &head_commit->object.oid,
+ DEFAULT_ABBREV);
strbuf_addf(&msg, "%s: %s ", branch_name, head_short_sha1);
pp_commit_easy(CMIT_FMT_ONELINE, head_commit, &msg);
strbuf_addf(&commit_tree_label, "index on %s\n", msg.buf);
commit_list_insert(head_commit, &parents);
- if (write_cache_as_tree(&info->i_tree, 0, NULL) ||
+ if (write_index_as_tree(&info->i_tree, &the_index, get_index_file(), 0,
+ NULL) ||
commit_tree(commit_tree_label.buf, commit_tree_label.len,
&info->i_tree, parents, &info->i_commit, NULL, NULL)) {
if (!quiet)
@@ -1433,7 +1480,7 @@ done:
return ret;
}
-static int create_stash(int argc, const char **argv, const char *prefix)
+static int create_stash(int argc, const char **argv, const char *prefix UNUSED)
{
int ret;
struct strbuf stash_msg_buf = STRBUF_INIT;
@@ -1487,15 +1534,15 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q
goto done;
}
- read_cache_preload(NULL);
+ 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_index);
- for (i = 0; i < active_nr; i++)
- ce_path_match(&the_index, active_cache[i], ps,
+ for (i = 0; i < the_index.cache_nr; i++)
+ ce_path_match(&the_index, the_index.cache[i], ps,
ps_matched);
if (report_path_error(ps_matched, ps)) {
@@ -1507,8 +1554,9 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q
free(ps_matched);
}
- if (refresh_and_write_cache(REFRESH_QUIET, 0, 0)) {
- ret = -1;
+ if (repo_refresh_and_write_index(the_repository, REFRESH_QUIET, 0, 0,
+ NULL, NULL, NULL)) {
+ ret = error(_("could not write index"));
goto done;
}
@@ -1564,7 +1612,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q
goto done;
}
}
- discard_cache();
+ discard_index(&the_index);
if (ps->nr) {
struct child_process cp_add = CHILD_PROCESS_INIT;
struct child_process cp_diff = CHILD_PROCESS_INIT;
@@ -1660,8 +1708,10 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q
}
done:
+ strbuf_release(&patch);
free_stash_info(&info);
strbuf_release(&stash_msg_buf);
+ strbuf_release(&untracked_files);
return ret;
}
@@ -1696,6 +1746,7 @@ static int push_stash(int argc, const char **argv, const char *prefix,
OPT_PATHSPEC_FILE_NUL(&pathspec_file_nul),
OPT_END()
};
+ int ret;
if (argc) {
force_assume = !strcmp(argv[0], "-p");
@@ -1735,8 +1786,15 @@ static int push_stash(int argc, const char **argv, const char *prefix,
die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
}
- return do_push_stash(&ps, stash_msg, quiet, keep_index, patch_mode,
- include_untracked, only_staged);
+ ret = do_push_stash(&ps, stash_msg, quiet, keep_index, patch_mode,
+ include_untracked, only_staged);
+ clear_pathspec(&ps);
+ return ret;
+}
+
+static int push_stash_unassumed(int argc, const char **argv, const char *prefix)
+{
+ return push_stash(argc, argv, prefix, 0);
}
static int save_stash(int argc, const char **argv, const char *prefix)
@@ -1787,15 +1845,28 @@ int cmd_stash(int argc, const char **argv, const char *prefix)
pid_t pid = getpid();
const char *index_file;
struct strvec args = STRVEC_INIT;
-
+ parse_opt_subcommand_fn *fn = NULL;
struct option options[] = {
+ OPT_SUBCOMMAND("apply", &fn, apply_stash),
+ OPT_SUBCOMMAND("clear", &fn, clear_stash),
+ OPT_SUBCOMMAND("drop", &fn, drop_stash),
+ OPT_SUBCOMMAND("pop", &fn, pop_stash),
+ OPT_SUBCOMMAND("branch", &fn, branch_stash),
+ OPT_SUBCOMMAND("list", &fn, list_stash),
+ OPT_SUBCOMMAND("show", &fn, show_stash),
+ OPT_SUBCOMMAND("store", &fn, store_stash),
+ OPT_SUBCOMMAND("create", &fn, create_stash),
+ OPT_SUBCOMMAND("push", &fn, push_stash_unassumed),
+ OPT_SUBCOMMAND_F("save", &fn, save_stash, PARSE_OPT_NOCOMPLETE),
OPT_END()
};
git_config(git_stash_config, NULL);
argc = parse_options(argc, argv, prefix, options, git_stash_usage,
- PARSE_OPT_KEEP_UNKNOWN | PARSE_OPT_KEEP_DASHDASH);
+ PARSE_OPT_SUBCOMMAND_OPTIONAL |
+ PARSE_OPT_KEEP_UNKNOWN_OPT |
+ PARSE_OPT_KEEP_DASHDASH);
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
@@ -1804,33 +1875,10 @@ int cmd_stash(int argc, const char **argv, const char *prefix)
strbuf_addf(&stash_index_path, "%s.stash.%" PRIuMAX, index_file,
(uintmax_t)pid);
- if (!argc)
- return !!push_stash(0, NULL, prefix, 0);
- else if (!strcmp(argv[0], "apply"))
- return !!apply_stash(argc, argv, prefix);
- else if (!strcmp(argv[0], "clear"))
- return !!clear_stash(argc, argv, prefix);
- else if (!strcmp(argv[0], "drop"))
- return !!drop_stash(argc, argv, prefix);
- else if (!strcmp(argv[0], "pop"))
- return !!pop_stash(argc, argv, prefix);
- else if (!strcmp(argv[0], "branch"))
- return !!branch_stash(argc, argv, prefix);
- else if (!strcmp(argv[0], "list"))
- return !!list_stash(argc, argv, prefix);
- else if (!strcmp(argv[0], "show"))
- return !!show_stash(argc, argv, prefix);
- else if (!strcmp(argv[0], "store"))
- return !!store_stash(argc, argv, prefix);
- else if (!strcmp(argv[0], "create"))
- return !!create_stash(argc, argv, prefix);
- else if (!strcmp(argv[0], "push"))
- return !!push_stash(argc, argv, prefix, 0);
- else if (!strcmp(argv[0], "save"))
- return !!save_stash(argc, argv, prefix);
- else if (*argv[0] != '-')
- usage_msg_optf(_("unknown subcommand: %s"),
- git_stash_usage, options, argv[0]);
+ if (fn)
+ return !!fn(argc, argv, prefix);
+ else if (!argc)
+ return !!push_stash_unassumed(0, NULL, prefix);
/* Assume 'stash push' */
strvec_push(&args, "push");
diff --git a/builtin/stripspace.c b/builtin/stripspace.c
index 1e34cf2..e5626e5 100644
--- a/builtin/stripspace.c
+++ b/builtin/stripspace.c
@@ -1,8 +1,11 @@
#include "builtin.h"
-#include "cache.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "parse-options.h"
+#include "setup.h"
#include "strbuf.h"
+#include "write-or-die.h"
static void comment_lines(struct strbuf *buf)
{
@@ -10,7 +13,7 @@ static void comment_lines(struct strbuf *buf)
size_t len;
msg = strbuf_detach(buf, &len);
- strbuf_add_commented_lines(buf, msg, len);
+ strbuf_add_commented_lines(buf, msg, len, comment_line_str);
free(msg);
}
@@ -55,7 +58,8 @@ int cmd_stripspace(int argc, const char **argv, const char *prefix)
die_errno("could not read the input");
if (mode == STRIP_DEFAULT || mode == STRIP_COMMENTS)
- strbuf_stripspace(&buf, mode == STRIP_COMMENTS);
+ strbuf_stripspace(&buf,
+ mode == STRIP_COMMENTS ? comment_line_str : NULL);
else
comment_lines(&buf);
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index c597df7..e4e18ad 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -1,12 +1,20 @@
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "repository.h"
-#include "cache.h"
#include "config.h"
#include "parse-options.h"
#include "quote.h"
+#include "path.h"
#include "pathspec.h"
+#include "preload-index.h"
#include "dir.h"
+#include "read-cache.h"
+#include "setup.h"
+#include "sparse-index.h"
#include "submodule.h"
#include "submodule-config.h"
#include "string-list.h"
@@ -14,11 +22,12 @@
#include "remote.h"
#include "refs.h"
#include "refspec.h"
-#include "connect.h"
#include "revision.h"
#include "diffcore.h"
#include "diff.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "advice.h"
#include "branch.h"
#include "list-objects-filter-options.h"
@@ -31,45 +40,61 @@
typedef void (*each_submodule_fn)(const struct cache_entry *list_item,
void *cb_data);
-static char *repo_get_default_remote(struct repository *repo)
+static int repo_get_default_remote(struct repository *repo, char **default_remote)
{
- char *dest = NULL, *ret;
+ char *dest = NULL;
struct strbuf sb = STRBUF_INIT;
struct ref_store *store = get_main_ref_store(repo);
const char *refname = refs_resolve_ref_unsafe(store, "HEAD", 0, NULL,
NULL);
if (!refname)
- die(_("No such ref: %s"), "HEAD");
+ return die_message(_("No such ref: %s"), "HEAD");
/* detached HEAD */
- if (!strcmp(refname, "HEAD"))
- return xstrdup("origin");
+ if (!strcmp(refname, "HEAD")) {
+ *default_remote = xstrdup("origin");
+ return 0;
+ }
if (!skip_prefix(refname, "refs/heads/", &refname))
- die(_("Expecting a full ref name, got %s"), refname);
+ return die_message(_("Expecting a full ref name, got %s"),
+ refname);
strbuf_addf(&sb, "branch.%s.remote", refname);
if (repo_config_get_string(repo, sb.buf, &dest))
- ret = xstrdup("origin");
+ *default_remote = xstrdup("origin");
else
- ret = dest;
+ *default_remote = dest;
strbuf_release(&sb);
- return ret;
+ return 0;
}
-static char *get_default_remote_submodule(const char *module_path)
+static int get_default_remote_submodule(const char *module_path, char **default_remote)
{
struct repository subrepo;
+ int ret;
+
+ if (repo_submodule_init(&subrepo, the_repository, module_path,
+ null_oid()) < 0)
+ return die_message(_("could not get a repository handle for submodule '%s'"),
+ module_path);
+ ret = repo_get_default_remote(&subrepo, default_remote);
+ repo_clear(&subrepo);
- repo_submodule_init(&subrepo, the_repository, module_path, null_oid());
- return repo_get_default_remote(&subrepo);
+ return ret;
}
static char *get_default_remote(void)
{
- return repo_get_default_remote(the_repository);
+ char *default_remote;
+ int code = repo_get_default_remote(the_repository, &default_remote);
+
+ if (code)
+ exit(code);
+
+ return default_remote;
}
static char *resolve_relative_url(const char *rel_url, const char *up_path, int quiet)
@@ -96,31 +121,9 @@ static char *resolve_relative_url(const char *rel_url, const char *up_path, int
return resolved_url;
}
-static int resolve_relative_url_test(int argc, const char **argv, const char *prefix)
-{
- char *remoteurl, *res;
- const char *up_path, *url;
-
- if (argc != 4)
- die("resolve-relative-url-test only accepts three arguments: <up_path> <remoteurl> <url>");
-
- up_path = argv[1];
- remoteurl = xstrdup(argv[2]);
- url = argv[3];
-
- if (!strcmp(up_path, "(null)"))
- up_path = NULL;
-
- res = relative_url(remoteurl, url, up_path);
- puts(res);
- free(res);
- free(remoteurl);
- return 0;
-}
-
-static char *do_get_submodule_displaypath(const char *path,
- const char *prefix,
- const char *super_prefix)
+/* the result should be freed by the caller. */
+static char *get_submodule_displaypath(const char *path, const char *prefix,
+ const char *super_prefix)
{
if (prefix && super_prefix) {
BUG("cannot have prefix '%s' and superprefix '%s'",
@@ -137,13 +140,6 @@ static char *do_get_submodule_displaypath(const char *path,
}
}
-/* the result should be freed by the caller. */
-static char *get_submodule_displaypath(const char *path, const char *prefix)
-{
- const char *super_prefix = get_super_prefix();
- return do_get_submodule_displaypath(path, prefix, super_prefix);
-}
-
static char *compute_rev_name(const char *sub_path, const char* object_id)
{
struct strbuf sb = STRBUF_INIT;
@@ -188,13 +184,19 @@ struct module_list {
};
#define MODULE_LIST_INIT { 0 }
-static int module_list_compute(int argc, const char **argv,
+static void module_list_release(struct module_list *ml)
+{
+ free(ml->entries);
+}
+
+static int module_list_compute(const char **argv,
const char *prefix,
struct pathspec *pathspec,
struct module_list *list)
{
int i, result = 0;
char *ps_matched = NULL;
+
parse_pathspec(pathspec, 0,
PATHSPEC_PREFER_FULL,
prefix, argv);
@@ -202,11 +204,11 @@ static int module_list_compute(int argc, const char **argv,
if (pathspec->nr)
ps_matched = xcalloc(pathspec->nr, 1);
- if (read_cache() < 0)
+ if (repo_read_index(the_repository) < 0)
die(_("index file corrupt"));
- for (i = 0; i < active_nr; i++) {
- const struct cache_entry *ce = active_cache[i];
+ for (i = 0; i < the_index.cache_nr; i++) {
+ const struct cache_entry *ce = the_index.cache[i];
if (!match_pathspec(&the_index, pathspec, ce->name, ce_namelen(ce),
0, ps_matched, 1) ||
@@ -215,8 +217,8 @@ static int module_list_compute(int argc, const char **argv,
ALLOC_GROW(list->entries, list->nr + 1, list->alloc);
list->entries[list->nr++] = ce;
- while (i + 1 < active_nr &&
- !strcmp(ce->name, active_cache[i + 1]->name))
+ while (i + 1 < the_index.cache_nr &&
+ !strcmp(ce->name, the_index.cache[i + 1]->name))
/*
* Skip entries with the same name in different stages
* to make sure an entry is returned only once.
@@ -249,7 +251,7 @@ static void module_list_active(struct module_list *list)
active_modules.entries[active_modules.nr++] = ce;
}
- free(list->entries);
+ module_list_release(list);
*list = active_modules;
}
@@ -272,49 +274,11 @@ static char *get_up_path(const char *path)
return strbuf_detach(&sb, NULL);
}
-static int module_list(int argc, const char **argv, const char *prefix)
-{
- int i;
- struct pathspec pathspec;
- struct module_list list = MODULE_LIST_INIT;
-
- struct option module_list_options[] = {
- OPT_STRING(0, "prefix", &prefix,
- N_("path"),
- N_("alternative anchor for relative paths")),
- OPT_END()
- };
-
- const char *const git_submodule_helper_usage[] = {
- N_("git submodule--helper list [--prefix=<path>] [<path>...]"),
- NULL
- };
-
- argc = parse_options(argc, argv, prefix, module_list_options,
- git_submodule_helper_usage, 0);
-
- if (module_list_compute(argc, argv, prefix, &pathspec, &list) < 0)
- return 1;
-
- for (i = 0; i < list.nr; i++) {
- const struct cache_entry *ce = list.entries[i];
-
- if (ce_stage(ce))
- printf("%06o %s U\t", ce->ce_mode,
- oid_to_hex(null_oid()));
- else
- printf("%06o %s %d\t", ce->ce_mode,
- oid_to_hex(&ce->oid), ce_stage(ce));
-
- fprintf(stdout, "%s\n", ce->name);
- }
- return 0;
-}
-
static void for_each_listed_submodule(const struct module_list *list,
each_submodule_fn fn, void *cb_data)
{
int i;
+
for (i = 0; i < list->nr; i++)
fn(list->entries[i], cb_data);
}
@@ -323,6 +287,7 @@ struct foreach_cb {
int argc;
const char **argv;
const char *prefix;
+ const char *super_prefix;
int quiet;
int recursive;
};
@@ -334,12 +299,12 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
struct foreach_cb *info = cb_data;
const char *path = list_item->name;
const struct object_id *ce_oid = &list_item->oid;
-
const struct submodule *sub;
struct child_process cp = CHILD_PROCESS_INIT;
char *displaypath;
- displaypath = get_submodule_displaypath(path, info->prefix);
+ displaypath = get_submodule_displaypath(path, info->prefix,
+ info->super_prefix);
sub = submodule_from_path(the_repository, null_oid(), path);
@@ -409,10 +374,10 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
cpr.dir = path;
prepare_submodule_repo_env(&cpr.env);
- strvec_pushl(&cpr.args, "--super-prefix", NULL);
- strvec_pushf(&cpr.args, "%s/", displaypath);
strvec_pushl(&cpr.args, "submodule--helper", "foreach", "--recursive",
NULL);
+ strvec_pushl(&cpr.args, "--super-prefix", NULL);
+ strvec_pushf(&cpr.args, "%s/", displaypath);
if (info->quiet)
strvec_push(&cpr.args, "--quiet");
@@ -433,26 +398,26 @@ cleanup:
static int module_foreach(int argc, const char **argv, const char *prefix)
{
struct foreach_cb info = FOREACH_CB_INIT;
- struct pathspec pathspec;
+ struct pathspec pathspec = { 0 };
struct module_list list = MODULE_LIST_INIT;
-
struct option module_foreach_options[] = {
+ OPT__SUPER_PREFIX(&info.super_prefix),
OPT__QUIET(&info.quiet, N_("suppress output of entering each submodule command")),
OPT_BOOL(0, "recursive", &info.recursive,
N_("recurse into nested submodules")),
OPT_END()
};
-
const char *const git_submodule_helper_usage[] = {
- N_("git submodule--helper foreach [--quiet] [--recursive] [--] <command>"),
+ N_("git submodule foreach [--quiet] [--recursive] [--] <command>"),
NULL
};
+ int ret = 1;
argc = parse_options(argc, argv, prefix, module_foreach_options,
git_submodule_helper_usage, 0);
- if (module_list_compute(0, NULL, prefix, &pathspec, &list) < 0)
- return 1;
+ if (module_list_compute(NULL, prefix, &pathspec, &list) < 0)
+ goto cleanup;
info.argc = argc;
info.argv = argv;
@@ -460,7 +425,11 @@ static int module_foreach(int argc, const char **argv, const char *prefix)
for_each_listed_submodule(&list, runcommand_in_submodule_cb, &info);
- return 0;
+ ret = 0;
+cleanup:
+ module_list_release(&list);
+ clear_pathspec(&pathspec);
+ return ret;
}
static int starts_with_dot_slash(const char *const path)
@@ -477,22 +446,21 @@ static int starts_with_dot_dot_slash(const char *const path)
struct init_cb {
const char *prefix;
- const char *superprefix;
+ const char *super_prefix;
unsigned int flags;
};
#define INIT_CB_INIT { 0 }
static void init_submodule(const char *path, const char *prefix,
- const char *superprefix, unsigned int flags)
+ const char *super_prefix,
+ unsigned int flags)
{
const struct submodule *sub;
struct strbuf sb = STRBUF_INIT;
- char *upd = NULL, *url = NULL, *displaypath;
+ const char *upd;
+ char *url = NULL, *displaypath;
- /* try superprefix from the environment, if it is not passed explicitly */
- if (!superprefix)
- superprefix = get_super_prefix();
- displaypath = do_get_submodule_displaypath(path, prefix, superprefix);
+ displaypath = get_submodule_displaypath(path, prefix, super_prefix);
sub = submodule_from_path(the_repository, null_oid(), path);
@@ -529,6 +497,7 @@ static void init_submodule(const char *path, const char *prefix,
if (starts_with_dot_dot_slash(url) ||
starts_with_dot_slash(url)) {
char *oldurl = url;
+
url = resolve_relative_url(oldurl, NULL, 0);
free(oldurl);
}
@@ -545,14 +514,15 @@ static void init_submodule(const char *path, const char *prefix,
/* Copy "update" setting when it is not set yet */
strbuf_addf(&sb, "submodule.%s.update", sub->name);
- if (git_config_get_string(sb.buf, &upd) &&
+ if (git_config_get_string_tmp(sb.buf, &upd) &&
sub->update_strategy.type != SM_UPDATE_UNSPECIFIED) {
if (sub->update_strategy.type == SM_UPDATE_COMMAND) {
fprintf(stderr, _("warning: command update mode suggested for submodule '%s'\n"),
sub->name);
- upd = xstrdup("none");
- } else
- upd = xstrdup(submodule_strategy_to_string(&sub->update_strategy));
+ upd = "none";
+ } else {
+ upd = submodule_update_type_to_string(sub->update_strategy.type);
+ }
if (git_config_set_gently(sb.buf, upd))
die(_("Failed to register update mode for submodule path '%s'"), displaypath);
@@ -560,43 +530,43 @@ static void init_submodule(const char *path, const char *prefix,
strbuf_release(&sb);
free(displaypath);
free(url);
- free(upd);
}
static void init_submodule_cb(const struct cache_entry *list_item, void *cb_data)
{
struct init_cb *info = cb_data;
- init_submodule(list_item->name, info->prefix, info->superprefix, info->flags);
+
+ init_submodule(list_item->name, info->prefix, info->super_prefix,
+ info->flags);
}
static int module_init(int argc, const char **argv, const char *prefix)
{
struct init_cb info = INIT_CB_INIT;
- struct pathspec pathspec;
+ struct pathspec pathspec = { 0 };
struct module_list list = MODULE_LIST_INIT;
int quiet = 0;
-
struct option module_init_options[] = {
OPT__QUIET(&quiet, N_("suppress output for initializing a submodule")),
OPT_END()
};
-
const char *const git_submodule_helper_usage[] = {
- N_("git submodule--helper init [<options>] [<path>]"),
+ N_("git submodule init [<options>] [<path>]"),
NULL
};
+ int ret = 1;
argc = parse_options(argc, argv, prefix, module_init_options,
git_submodule_helper_usage, 0);
- if (module_list_compute(argc, argv, prefix, &pathspec, &list) < 0)
- return 1;
+ if (module_list_compute(argv, prefix, &pathspec, &list) < 0)
+ goto cleanup;
/*
* If there are no path args and submodule.active is set then,
* by default, only initialize 'active' modules.
*/
- if (!argc && git_config_get_value_multi("submodule.active"))
+ if (!argc && !git_config_get("submodule.active"))
module_list_active(&list);
info.prefix = prefix;
@@ -605,11 +575,16 @@ static int module_init(int argc, const char **argv, const char *prefix)
for_each_listed_submodule(&list, init_submodule_cb, &info);
- return 0;
+ ret = 0;
+cleanup:
+ module_list_release(&list);
+ clear_pathspec(&pathspec);
+ return ret;
}
struct status_cb {
const char *prefix;
+ const char *super_prefix;
unsigned int flags;
};
#define STATUS_CB_INIT { 0 }
@@ -623,20 +598,23 @@ static void print_status(unsigned int flags, char state, const char *path,
printf("%c%s %s", state, oid_to_hex(oid), displaypath);
if (state == ' ' || state == '+') {
- const char *name = compute_rev_name(path, oid_to_hex(oid));
+ char *name = compute_rev_name(path, oid_to_hex(oid));
if (name)
printf(" (%s)", name);
+ free(name);
}
printf("\n");
}
-static int handle_submodule_head_ref(const char *refname,
- const struct object_id *oid, int flags,
+static int handle_submodule_head_ref(const char *refname UNUSED,
+ const struct object_id *oid,
+ int flags UNUSED,
void *cb_data)
{
struct object_id *output = cb_data;
+
if (oid)
oidcpy(output, oid);
@@ -645,20 +623,22 @@ static int handle_submodule_head_ref(const char *refname,
static void status_submodule(const char *path, const struct object_id *ce_oid,
unsigned int ce_flags, const char *prefix,
- unsigned int flags)
+ const char *super_prefix, unsigned int flags)
{
char *displaypath;
struct strvec diff_files_args = STRVEC_INIT;
struct rev_info rev = REV_INFO_INIT;
- int diff_files_result;
struct strbuf buf = STRBUF_INIT;
const char *git_dir;
+ struct setup_revision_opt opt = {
+ .free_removed_argv_elements = 1,
+ };
if (!submodule_from_path(the_repository, null_oid(), path))
die(_("no submodule mapping found in .gitmodules for path '%s'"),
path);
- displaypath = get_submodule_displaypath(path, prefix);
+ displaypath = get_submodule_displaypath(path, prefix, super_prefix);
if ((CE_STAGEMASK & ce_flags) >> CE_STAGESHIFT) {
print_status(flags, 'U', path, null_oid(), displaypath);
@@ -686,12 +666,10 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
repo_init_revisions(the_repository, &rev, NULL);
rev.abbrev = 0;
- diff_files_args.nr = setup_revisions(diff_files_args.nr,
- diff_files_args.v,
- &rev, NULL);
- diff_files_result = run_diff_files(&rev, 0);
+ setup_revisions(diff_files_args.nr, diff_files_args.v, &rev, &opt);
+ run_diff_files(&rev, 0);
- if (!diff_result_code(&rev.diffopt, diff_files_result)) {
+ if (!diff_result_code(&rev.diffopt)) {
print_status(flags, ' ', path, ce_oid,
displaypath);
} else if (!(flags & OPT_CACHED)) {
@@ -718,10 +696,10 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
cpr.dir = path;
prepare_submodule_repo_env(&cpr.env);
- strvec_push(&cpr.args, "--super-prefix");
- strvec_pushf(&cpr.args, "%s/", displaypath);
strvec_pushl(&cpr.args, "submodule--helper", "status",
"--recursive", NULL);
+ strvec_push(&cpr.args, "--super-prefix");
+ strvec_pushf(&cpr.args, "%s/", displaypath);
if (flags & OPT_CACHED)
strvec_push(&cpr.args, "--cached");
@@ -743,34 +721,35 @@ static void status_submodule_cb(const struct cache_entry *list_item,
void *cb_data)
{
struct status_cb *info = cb_data;
+
status_submodule(list_item->name, &list_item->oid, list_item->ce_flags,
- info->prefix, info->flags);
+ info->prefix, info->super_prefix, info->flags);
}
static int module_status(int argc, const char **argv, const char *prefix)
{
struct status_cb info = STATUS_CB_INIT;
- struct pathspec pathspec;
+ struct pathspec pathspec = { 0 };
struct module_list list = MODULE_LIST_INIT;
int quiet = 0;
-
struct option module_status_options[] = {
+ OPT__SUPER_PREFIX(&info.super_prefix),
OPT__QUIET(&quiet, N_("suppress submodule status output")),
OPT_BIT(0, "cached", &info.flags, N_("use commit stored in the index instead of the one stored in the submodule HEAD"), OPT_CACHED),
OPT_BIT(0, "recursive", &info.flags, N_("recurse into nested submodules"), OPT_RECURSIVE),
OPT_END()
};
-
const char *const git_submodule_helper_usage[] = {
N_("git submodule status [--quiet] [--cached] [--recursive] [<path>...]"),
NULL
};
+ int ret = 1;
argc = parse_options(argc, argv, prefix, module_status_options,
git_submodule_helper_usage, 0);
- if (module_list_compute(argc, argv, prefix, &pathspec, &list) < 0)
- return 1;
+ if (module_list_compute(argv, prefix, &pathspec, &list) < 0)
+ goto cleanup;
info.prefix = prefix;
if (quiet)
@@ -778,25 +757,11 @@ static int module_status(int argc, const char **argv, const char *prefix)
for_each_listed_submodule(&list, status_submodule_cb, &info);
- return 0;
-}
-
-static int module_name(int argc, const char **argv, const char *prefix)
-{
- const struct submodule *sub;
-
- if (argc != 2)
- usage(_("git submodule--helper name <path>"));
-
- sub = submodule_from_path(the_repository, null_oid(), argv[1]);
-
- if (!sub)
- die(_("no submodule mapping found in .gitmodules for path '%s'"),
- argv[1]);
-
- printf("%s\n", sub->name);
-
- return 0;
+ ret = 0;
+cleanup:
+ module_list_release(&list);
+ clear_pathspec(&pathspec);
+ return ret;
}
struct module_cb {
@@ -805,20 +770,39 @@ struct module_cb {
struct object_id oid_src;
struct object_id oid_dst;
char status;
- const char *sm_path;
+ char *sm_path;
};
#define MODULE_CB_INIT { 0 }
+static void module_cb_release(struct module_cb *mcb)
+{
+ free(mcb->sm_path);
+}
+
struct module_cb_list {
struct module_cb **entries;
int alloc, nr;
};
#define MODULE_CB_LIST_INIT { 0 }
+static void module_cb_list_release(struct module_cb_list *mcbl)
+{
+ int i;
+
+ for (i = 0; i < mcbl->nr; i++) {
+ struct module_cb *mcb = mcbl->entries[i];
+
+ module_cb_release(mcb);
+ free(mcb);
+ }
+ free(mcbl->entries);
+}
+
struct summary_cb {
int argc;
const char **argv;
const char *prefix;
+ const char *super_prefix;
unsigned int cached: 1;
unsigned int for_status: 1;
unsigned int files: 1;
@@ -851,7 +835,7 @@ static char *verify_submodule_committish(const char *sm_path,
return strbuf_detach(&result, NULL);
}
-static void print_submodule_summary(struct summary_cb *info, char *errmsg,
+static void print_submodule_summary(struct summary_cb *info, const char *errmsg,
int total_commits, const char *displaypath,
const char *src_abbrev, const char *dst_abbrev,
struct module_cb *p)
@@ -909,12 +893,13 @@ static void generate_submodule_summary(struct summary_cb *info,
{
char *displaypath, *src_abbrev = NULL, *dst_abbrev;
int missing_src = 0, missing_dst = 0;
- char *errmsg = NULL;
+ struct strbuf errmsg = STRBUF_INIT;
int total_commits = -1;
if (!info->cached && oideq(&p->oid_dst, null_oid())) {
if (S_ISGITLINK(p->mod_dst)) {
struct ref_store *refs = get_submodule_ref_store(p->sm_path);
+
if (refs)
refs_head_ref(refs, handle_submodule_head_ref, &p->oid_dst);
} else if (S_ISLNK(p->mod_dst) || S_ISREG(p->mod_dst)) {
@@ -979,7 +964,8 @@ static void generate_submodule_summary(struct summary_cb *info,
dst_abbrev = xstrndup(oid_to_hex(&p->oid_dst), 7);
}
- displaypath = get_submodule_displaypath(p->sm_path, info->prefix);
+ displaypath = get_submodule_displaypath(p->sm_path, info->prefix,
+ info->super_prefix);
if (!missing_src && !missing_dst) {
struct child_process cp_rev_list = CHILD_PROCESS_INIT;
@@ -1009,28 +995,27 @@ static void generate_submodule_summary(struct summary_cb *info,
* submodule, i.e., deleted or changed to blob
*/
if (S_ISGITLINK(p->mod_dst)) {
- struct strbuf errmsg_str = STRBUF_INIT;
if (missing_src && missing_dst) {
- strbuf_addf(&errmsg_str, " Warn: %s doesn't contain commits %s and %s\n",
+ strbuf_addf(&errmsg, " Warn: %s doesn't contain commits %s and %s\n",
displaypath, oid_to_hex(&p->oid_src),
oid_to_hex(&p->oid_dst));
} else {
- strbuf_addf(&errmsg_str, " Warn: %s doesn't contain commit %s\n",
+ strbuf_addf(&errmsg, " Warn: %s doesn't contain commit %s\n",
displaypath, missing_src ?
oid_to_hex(&p->oid_src) :
oid_to_hex(&p->oid_dst));
}
- errmsg = strbuf_detach(&errmsg_str, NULL);
}
}
- print_submodule_summary(info, errmsg, total_commits,
- displaypath, src_abbrev,
+ print_submodule_summary(info, errmsg.len ? errmsg.buf : NULL,
+ total_commits, displaypath, src_abbrev,
dst_abbrev, p);
free(displaypath);
free(src_abbrev);
free(dst_abbrev);
+ strbuf_release(&errmsg);
}
static void prepare_submodule_summary(struct summary_cb *info,
@@ -1075,7 +1060,7 @@ static void prepare_submodule_summary(struct summary_cb *info,
}
static void submodule_summary_callback(struct diff_queue_struct *q,
- struct diff_options *options,
+ struct diff_options *options UNUSED,
void *data)
{
int i;
@@ -1114,6 +1099,9 @@ static int compute_summary_module_list(struct object_id *head_oid,
{
struct strvec diff_args = STRVEC_INIT;
struct rev_info rev;
+ struct setup_revision_opt opt = {
+ .free_removed_argv_elements = 1,
+ };
struct module_cb_list list = MODULE_CB_LIST_INIT;
int ret = 0;
@@ -1128,10 +1116,10 @@ static int compute_summary_module_list(struct object_id *head_oid,
strvec_pushv(&diff_args, info->argv);
git_config(git_diff_basic_config, NULL);
- init_revisions(&rev, info->prefix);
+ repo_init_revisions(the_repository, &rev, info->prefix);
rev.abbrev = 0;
precompose_argv_prefix(diff_args.nr, diff_args.v, NULL);
- setup_revisions(diff_args.nr, diff_args.v, &rev, NULL);
+ setup_revisions(diff_args.nr, diff_args.v, &rev, &opt);
rev.diffopt.output_format = DIFF_FORMAT_NO_OUTPUT | DIFF_FORMAT_CALLBACK;
rev.diffopt.format_callback = submodule_summary_callback;
rev.diffopt.format_callback_data = &list;
@@ -1139,25 +1127,26 @@ static int compute_summary_module_list(struct object_id *head_oid,
if (!info->cached) {
if (diff_cmd == DIFF_INDEX)
setup_work_tree();
- if (read_cache_preload(&rev.diffopt.pathspec) < 0) {
- perror("read_cache_preload");
+ if (repo_read_index_preload(the_repository, &rev.diffopt.pathspec, 0) < 0) {
+ perror("repo_read_index_preload");
ret = -1;
goto cleanup;
}
- } else if (read_cache() < 0) {
- perror("read_cache");
+ } else if (repo_read_index(the_repository) < 0) {
+ perror("repo_read_cache");
ret = -1;
goto cleanup;
}
if (diff_cmd == DIFF_INDEX)
- run_diff_index(&rev, info->cached);
+ run_diff_index(&rev, info->cached ? DIFF_INDEX_CACHED : 0);
else
run_diff_files(&rev, 0);
prepare_submodule_summary(info, &list);
cleanup:
strvec_clear(&diff_args);
release_revisions(&rev);
+ module_cb_list_release(&list);
return ret;
}
@@ -1171,7 +1160,6 @@ static int module_summary(int argc, const char **argv, const char *prefix)
enum diff_cmd diff_cmd = DIFF_INDEX;
struct object_id head_oid;
int ret;
-
struct option module_summary_options[] = {
OPT_BOOL(0, "cached", &cached,
N_("use the commit stored in the index instead of the submodule HEAD")),
@@ -1183,9 +1171,8 @@ static int module_summary(int argc, const char **argv, const char *prefix)
N_("limit the summary size")),
OPT_END()
};
-
const char *const git_submodule_helper_usage[] = {
- N_("git submodule--helper summary [<options>] [<commit>] [--] [<path>]"),
+ N_("git submodule summary [<options>] [<commit>] [--] [<path>]"),
NULL
};
@@ -1195,7 +1182,7 @@ static int module_summary(int argc, const char **argv, const char *prefix)
if (!summary_limit)
return 0;
- if (!get_oid(argc ? argv[0] : "HEAD", &head_oid)) {
+ if (!repo_get_oid(the_repository, argc ? argv[0] : "HEAD", &head_oid)) {
if (argc) {
argv++;
argc--;
@@ -1208,7 +1195,7 @@ static int module_summary(int argc, const char **argv, const char *prefix)
argc--;
}
} else {
- if (get_oid("HEAD", &head_oid))
+ if (repo_get_oid(the_repository, "HEAD", &head_oid))
die(_("could not fetch a revision for HEAD"));
}
@@ -1233,18 +1220,20 @@ static int module_summary(int argc, const char **argv, const char *prefix)
struct sync_cb {
const char *prefix;
+ const char *super_prefix;
unsigned int flags;
};
#define SYNC_CB_INIT { 0 }
static void sync_submodule(const char *path, const char *prefix,
- unsigned int flags)
+ const char *super_prefix, unsigned int flags)
{
const struct submodule *sub;
char *remote_key = NULL;
char *sub_origin_url, *super_config_url, *displaypath, *default_remote;
struct strbuf sb = STRBUF_INIT;
char *sub_config_path = NULL;
+ int code;
if (!is_submodule_active(the_repository, path))
return;
@@ -1255,6 +1244,7 @@ static void sync_submodule(const char *path, const char *prefix,
if (starts_with_dot_dot_slash(sub->url) ||
starts_with_dot_slash(sub->url)) {
char *up_path = get_up_path(path);
+
sub_origin_url = resolve_relative_url(sub->url, up_path, 1);
super_config_url = resolve_relative_url(sub->url, NULL, 1);
free(up_path);
@@ -1267,7 +1257,7 @@ static void sync_submodule(const char *path, const char *prefix,
super_config_url = xstrdup("");
}
- displaypath = get_submodule_displaypath(path, prefix);
+ displaypath = get_submodule_displaypath(path, prefix, super_prefix);
if (!(flags & OPT_QUIET))
printf(_("Synchronizing submodule url for '%s'\n"),
@@ -1283,10 +1273,9 @@ static void sync_submodule(const char *path, const char *prefix,
goto cleanup;
strbuf_reset(&sb);
- default_remote = get_default_remote_submodule(path);
- if (!default_remote)
- die(_("failed to get the default remote for submodule '%s'"),
- path);
+ code = get_default_remote_submodule(path, &default_remote);
+ if (code)
+ exit(code);
remote_key = xstrfmt("remote.%s.url", default_remote);
free(default_remote);
@@ -1294,7 +1283,7 @@ static void sync_submodule(const char *path, const char *prefix,
submodule_to_gitdir(&sb, path);
strbuf_addstr(&sb, "/config");
- if (git_config_set_in_file_gently(sb.buf, remote_key, sub_origin_url))
+ if (git_config_set_in_file_gently(sb.buf, remote_key, NULL, sub_origin_url))
die(_("failed to update remote for submodule '%s'"),
path);
@@ -1305,10 +1294,11 @@ static void sync_submodule(const char *path, const char *prefix,
cpr.dir = path;
prepare_submodule_repo_env(&cpr.env);
- strvec_push(&cpr.args, "--super-prefix");
- strvec_pushf(&cpr.args, "%s/", displaypath);
strvec_pushl(&cpr.args, "submodule--helper", "sync",
"--recursive", NULL);
+ strvec_push(&cpr.args, "--super-prefix");
+ strvec_pushf(&cpr.args, "%s/", displaypath);
+
if (flags & OPT_QUIET)
strvec_push(&cpr.args, "--quiet");
@@ -1330,34 +1320,36 @@ cleanup:
static void sync_submodule_cb(const struct cache_entry *list_item, void *cb_data)
{
struct sync_cb *info = cb_data;
- sync_submodule(list_item->name, info->prefix, info->flags);
+
+ sync_submodule(list_item->name, info->prefix, info->super_prefix,
+ info->flags);
}
static int module_sync(int argc, const char **argv, const char *prefix)
{
struct sync_cb info = SYNC_CB_INIT;
- struct pathspec pathspec;
+ struct pathspec pathspec = { 0 };
struct module_list list = MODULE_LIST_INIT;
int quiet = 0;
int recursive = 0;
-
struct option module_sync_options[] = {
+ OPT__SUPER_PREFIX(&info.super_prefix),
OPT__QUIET(&quiet, N_("suppress output of synchronizing submodule url")),
OPT_BOOL(0, "recursive", &recursive,
N_("recurse into nested submodules")),
OPT_END()
};
-
const char *const git_submodule_helper_usage[] = {
- N_("git submodule--helper sync [--quiet] [--recursive] [<path>]"),
+ N_("git submodule sync [--quiet] [--recursive] [<path>]"),
NULL
};
+ int ret = 1;
argc = parse_options(argc, argv, prefix, module_sync_options,
git_submodule_helper_usage, 0);
- if (module_list_compute(argc, argv, prefix, &pathspec, &list) < 0)
- return 1;
+ if (module_list_compute(argv, prefix, &pathspec, &list) < 0)
+ goto cleanup;
info.prefix = prefix;
if (quiet)
@@ -1367,7 +1359,11 @@ static int module_sync(int argc, const char **argv, const char *prefix)
for_each_listed_submodule(&list, sync_submodule_cb, &info);
- return 0;
+ ret = 0;
+cleanup:
+ module_list_release(&list);
+ clear_pathspec(&pathspec);
+ return ret;
}
struct deinit_cb {
@@ -1390,7 +1386,7 @@ static void deinit_submodule(const char *path, const char *prefix,
if (!sub || !sub->name)
goto cleanup;
- displaypath = get_submodule_displaypath(path, prefix);
+ displaypath = get_submodule_displaypath(path, prefix, NULL);
/* remove the submodule work tree (unless the user already did it) */
if (is_directory(path)) {
@@ -1404,13 +1400,13 @@ static void deinit_submodule(const char *path, const char *prefix,
".git file by using absorbgitdirs."),
displaypath);
- absorb_git_dir_into_superproject(path,
- ABSORB_GITDIR_RECURSE_SUBMODULES);
+ absorb_git_dir_into_superproject(path, NULL);
}
if (!(flags & OPT_FORCE)) {
struct child_process cp_rm = CHILD_PROCESS_INIT;
+
cp_rm.git_cmd = 1;
strvec_pushl(&cp_rm.args, "rm", "-qn",
path, NULL);
@@ -1447,6 +1443,7 @@ static void deinit_submodule(const char *path, const char *prefix,
/* remove the .git/config entries (unless the user already did it) */
if (!capture_command(&cp_config, &sb_config, 0) && sb_config.len) {
char *sub_key = xstrfmt("submodule.%s", sub->name);
+
/*
* remove the whole section so we have a clean state when
* the user later decides to init this submodule again
@@ -1474,23 +1471,22 @@ static void deinit_submodule_cb(const struct cache_entry *list_item,
static int module_deinit(int argc, const char **argv, const char *prefix)
{
struct deinit_cb info = DEINIT_CB_INIT;
- struct pathspec pathspec;
+ struct pathspec pathspec = { 0 };
struct module_list list = MODULE_LIST_INIT;
int quiet = 0;
int force = 0;
int all = 0;
-
struct option module_deinit_options[] = {
OPT__QUIET(&quiet, N_("suppress submodule status output")),
OPT__FORCE(&force, N_("remove submodule working trees even if they contain local changes"), 0),
OPT_BOOL(0, "all", &all, N_("unregister all submodules")),
OPT_END()
};
-
const char *const git_submodule_helper_usage[] = {
N_("git submodule deinit [--quiet] [-f | --force] [--all | [--] [<path>...]]"),
NULL
};
+ int ret = 1;
argc = parse_options(argc, argv, prefix, module_deinit_options,
git_submodule_helper_usage, 0);
@@ -1504,8 +1500,8 @@ static int module_deinit(int argc, const char **argv, const char *prefix)
if (!argc && !all)
die(_("Use '--all' if you really want to deinitialize all submodules"));
- if (module_list_compute(argc, argv, prefix, &pathspec, &list) < 0)
- return 1;
+ if (module_list_compute(argv, prefix, &pathspec, &list) < 0)
+ goto cleanup;
info.prefix = prefix;
if (quiet)
@@ -1515,7 +1511,11 @@ static int module_deinit(int argc, const char **argv, const char *prefix)
for_each_listed_submodule(&list, deinit_submodule_cb, &info);
- return 0;
+ ret = 0;
+cleanup:
+ module_list_release(&list);
+ clear_pathspec(&pathspec);
+ return ret;
}
struct module_clone_data {
@@ -1525,7 +1525,6 @@ struct module_clone_data {
const char *url;
const char *depth;
struct list_objects_filter_options *filter_options;
- struct string_list reference;
unsigned int quiet: 1;
unsigned int progress: 1;
unsigned int dissociate: 1;
@@ -1533,7 +1532,6 @@ struct module_clone_data {
int single_branch;
};
#define MODULE_CLONE_DATA_INIT { \
- .reference = STRING_LIST_INIT_NODUP, \
.single_branch = -1, \
}
@@ -1574,7 +1572,9 @@ static int add_possible_reference_from_superproject(
struct strbuf err = STRBUF_INIT;
strbuf_add(&sb, odb->path, len);
- repo_init(&alternate, sb.buf, NULL);
+ if (repo_init(&alternate, sb.buf, NULL) < 0)
+ die(_("could not get a repository handle for gitdir '%s'"),
+ sb.buf);
/*
* We need to end the new path with '/' to mark it as a dir,
@@ -1589,7 +1589,9 @@ static int add_possible_reference_from_superproject(
sm_alternate = compute_alternate_path(sb.buf, &err);
if (sm_alternate) {
- string_list_append(sas->reference, xstrdup(sb.buf));
+ char *p = strbuf_detach(&sb, NULL);
+
+ string_list_append(sas->reference, p)->util = p;
free(sm_alternate);
} else {
switch (sas->error_mode) {
@@ -1648,23 +1650,31 @@ static void prepare_possible_alternates(const char *sm_name,
free(error_strategy);
}
-static int clone_submodule(struct module_clone_data *clone_data)
+static char *clone_submodule_sm_gitdir(const char *name)
{
- char *p, *sm_gitdir;
- char *sm_alternate = NULL, *error_strategy = NULL;
struct strbuf sb = STRBUF_INIT;
- struct child_process cp = CHILD_PROCESS_INIT;
+ char *sm_gitdir;
- submodule_name_to_gitdir(&sb, the_repository, clone_data->name);
+ submodule_name_to_gitdir(&sb, the_repository, name);
sm_gitdir = absolute_pathdup(sb.buf);
- strbuf_reset(&sb);
+ strbuf_release(&sb);
- if (!is_absolute_path(clone_data->path)) {
- strbuf_addf(&sb, "%s/%s", get_git_work_tree(), clone_data->path);
- clone_data->path = strbuf_detach(&sb, NULL);
- } else {
- clone_data->path = xstrdup(clone_data->path);
- }
+ return sm_gitdir;
+}
+
+static int clone_submodule(const struct module_clone_data *clone_data,
+ struct string_list *reference)
+{
+ char *p;
+ char *sm_gitdir = clone_submodule_sm_gitdir(clone_data->name);
+ char *sm_alternate = NULL, *error_strategy = NULL;
+ struct child_process cp = CHILD_PROCESS_INIT;
+ const char *clone_data_path = clone_data->path;
+ char *to_free = NULL;
+
+ if (!is_absolute_path(clone_data->path))
+ clone_data_path = to_free = xstrfmt("%s/%s", get_git_work_tree(),
+ clone_data->path);
if (validate_submodule_git_dir(sm_gitdir, clone_data->name) < 0)
die(_("refusing to create/use '%s' in another submodule's "
@@ -1674,7 +1684,7 @@ static int clone_submodule(struct module_clone_data *clone_data)
if (safe_create_leading_directories_const(sm_gitdir) < 0)
die(_("could not create directory '%s'"), sm_gitdir);
- prepare_possible_alternates(clone_data->name, &clone_data->reference);
+ prepare_possible_alternates(clone_data->name, reference);
strvec_push(&cp.args, "clone");
strvec_push(&cp.args, "--no-checkout");
@@ -1684,9 +1694,10 @@ static int clone_submodule(struct module_clone_data *clone_data)
strvec_push(&cp.args, "--progress");
if (clone_data->depth && *(clone_data->depth))
strvec_pushl(&cp.args, "--depth", clone_data->depth, NULL);
- if (clone_data->reference.nr) {
+ if (reference->nr) {
struct string_list_item *item;
- for_each_string_list_item(item, &clone_data->reference)
+
+ for_each_string_list_item(item, reference)
strvec_pushl(&cp.args, "--reference",
item->string, NULL);
}
@@ -1705,7 +1716,7 @@ static int clone_submodule(struct module_clone_data *clone_data)
strvec_push(&cp.args, "--");
strvec_push(&cp.args, clone_data->url);
- strvec_push(&cp.args, clone_data->path);
+ strvec_push(&cp.args, clone_data_path);
cp.git_cmd = 1;
prepare_submodule_repo_env(&cp.env);
@@ -1713,23 +1724,25 @@ static int clone_submodule(struct module_clone_data *clone_data)
if(run_command(&cp))
die(_("clone of '%s' into submodule path '%s' failed"),
- clone_data->url, clone_data->path);
+ clone_data->url, clone_data_path);
} else {
- if (clone_data->require_init && !access(clone_data->path, X_OK) &&
- !is_empty_dir(clone_data->path))
- die(_("directory not empty: '%s'"), clone_data->path);
- if (safe_create_leading_directories_const(clone_data->path) < 0)
- die(_("could not create directory '%s'"), clone_data->path);
- strbuf_addf(&sb, "%s/index", sm_gitdir);
- unlink_or_warn(sb.buf);
- strbuf_reset(&sb);
+ char *path;
+
+ if (clone_data->require_init && !access(clone_data_path, X_OK) &&
+ !is_empty_dir(clone_data_path))
+ die(_("directory not empty: '%s'"), clone_data_path);
+ if (safe_create_leading_directories_const(clone_data_path) < 0)
+ die(_("could not create directory '%s'"), clone_data_path);
+ path = xstrfmt("%s/index", sm_gitdir);
+ unlink_or_warn(path);
+ free(path);
}
- connect_work_tree_and_git_dir(clone_data->path, sm_gitdir, 0);
+ connect_work_tree_and_git_dir(clone_data_path, sm_gitdir, 0);
- p = git_pathdup_submodule(clone_data->path, "config");
+ p = git_pathdup_submodule(clone_data_path, "config");
if (!p)
- die(_("could not get submodule directory for '%s'"), clone_data->path);
+ die(_("could not get submodule directory for '%s'"), clone_data_path);
/* setup alternateLocation and alternateErrorStrategy in the cloned submodule if needed */
git_config_get_string("submodule.alternateLocation", &sm_alternate);
@@ -1744,9 +1757,9 @@ static int clone_submodule(struct module_clone_data *clone_data)
free(sm_alternate);
free(error_strategy);
- strbuf_release(&sb);
free(sm_gitdir);
free(p);
+ free(to_free);
return 0;
}
@@ -1754,7 +1767,9 @@ static int module_clone(int argc, const char **argv, const char *prefix)
{
int dissociate = 0, quiet = 0, progress = 0, require_init = 0;
struct module_clone_data clone_data = MODULE_CLONE_DATA_INIT;
- struct list_objects_filter_options filter_options;
+ struct string_list reference = STRING_LIST_INIT_NODUP;
+ struct list_objects_filter_options filter_options =
+ LIST_OBJECTS_FILTER_INIT;
struct option module_clone_options[] = {
OPT_STRING(0, "prefix", &clone_data.prefix,
@@ -1769,7 +1784,7 @@ static int module_clone(int argc, const char **argv, const char *prefix)
OPT_STRING(0, "url", &clone_data.url,
N_("string"),
N_("url where to clone the submodule from")),
- OPT_STRING_LIST(0, "reference", &clone_data.reference,
+ OPT_STRING_LIST(0, "reference", &reference,
N_("repo"),
N_("reference repository")),
OPT_BOOL(0, "dissociate", &dissociate,
@@ -1787,7 +1802,6 @@ static int module_clone(int argc, const char **argv, const char *prefix)
OPT_PARSE_LIST_OBJECTS_FILTER(&filter_options),
OPT_END()
};
-
const char *const git_submodule_helper_usage[] = {
N_("git submodule--helper clone [--prefix=<path>] [--quiet] "
"[--reference <repository>] [--name <name>] [--depth <depth>] "
@@ -1796,7 +1810,6 @@ static int module_clone(int argc, const char **argv, const char *prefix)
NULL
};
- memset(&filter_options, 0, sizeof(filter_options));
argc = parse_options(argc, argv, prefix, module_clone_options,
git_submodule_helper_usage, 0);
@@ -1810,31 +1823,33 @@ static int module_clone(int argc, const char **argv, const char *prefix)
usage_with_options(git_submodule_helper_usage,
module_clone_options);
- clone_submodule(&clone_data);
+ clone_submodule(&clone_data, &reference);
list_objects_filter_release(&filter_options);
+ string_list_clear(&reference, 1);
return 0;
}
-static void determine_submodule_update_strategy(struct repository *r,
- int just_cloned,
- const char *path,
- const char *update,
- struct submodule_update_strategy *out)
+static int determine_submodule_update_strategy(struct repository *r,
+ int just_cloned,
+ const char *path,
+ enum submodule_update_type update,
+ struct submodule_update_strategy *out)
{
const struct submodule *sub = submodule_from_path(r, null_oid(), path);
char *key;
const char *val;
+ int ret;
key = xstrfmt("submodule.%s.update", sub->name);
if (update) {
- if (parse_submodule_update_strategy(update, out) < 0)
- die(_("Invalid update mode '%s' for submodule path '%s'"),
- update, path);
+ out->type = update;
} else if (!repo_config_get_string_tmp(r, key, &val)) {
- if (parse_submodule_update_strategy(val, out) < 0)
- die(_("Invalid update mode '%s' configured for submodule path '%s'"),
- val, path);
+ if (parse_submodule_update_strategy(val, out) < 0) {
+ ret = die_message(_("Invalid update mode '%s' configured for submodule path '%s'"),
+ val, path);
+ goto cleanup;
+ }
} else if (sub->update_strategy.type != SM_UPDATE_UNSPECIFIED) {
if (sub->update_strategy.type == SM_UPDATE_COMMAND)
BUG("how did we read update = !command from .gitmodules?");
@@ -1849,7 +1864,10 @@ static void determine_submodule_update_strategy(struct repository *r,
out->type == SM_UPDATE_NONE))
out->type = SM_UPDATE_CHECKOUT;
+ ret = 0;
+cleanup:
free(key);
+ return ret;
}
struct update_clone_data {
@@ -1863,7 +1881,7 @@ struct submodule_update_clone {
int current;
/* configuration parameters which are passed on to the children */
- struct update_data *update_data;
+ const struct update_data *update_data;
/* to be consumed by update_submodule() */
struct update_clone_data *update_clone;
@@ -1878,11 +1896,17 @@ struct submodule_update_clone {
};
#define SUBMODULE_UPDATE_CLONE_INIT { 0 }
+static void submodule_update_clone_release(struct submodule_update_clone *suc)
+{
+ free(suc->update_clone);
+ free(suc->failed_clones);
+}
+
struct update_data {
const char *prefix;
- const char *recursive_prefix;
- const char *displaypath;
- const char *update_default;
+ const char *super_prefix;
+ char *displaypath;
+ enum submodule_update_type update_default;
struct object_id suboid;
struct string_list references;
struct submodule_update_strategy update_strategy;
@@ -1917,6 +1941,12 @@ struct update_data {
.max_jobs = 1, \
}
+static void update_data_release(struct update_data *ud)
+{
+ free(ud->displaypath);
+ module_list_release(&ud->list);
+}
+
static void next_submodule_warn_missing(struct submodule_update_clone *suc,
struct strbuf *out, const char *displaypath)
{
@@ -1949,30 +1979,21 @@ static int prepare_to_clone_next_submodule(const struct cache_entry *ce,
const char *update_string;
enum submodule_update_type update_type;
char *key;
- struct strbuf displaypath_sb = STRBUF_INIT;
+ const struct update_data *ud = suc->update_data;
+ char *displaypath = get_submodule_displaypath(ce->name, ud->prefix,
+ ud->super_prefix);
struct strbuf sb = STRBUF_INIT;
- const char *displaypath = NULL;
int needs_cloning = 0;
int need_free_url = 0;
if (ce_stage(ce)) {
- if (suc->update_data->recursive_prefix)
- strbuf_addf(&sb, "%s/%s", suc->update_data->recursive_prefix, ce->name);
- else
- strbuf_addstr(&sb, ce->name);
- strbuf_addf(out, _("Skipping unmerged submodule %s"), sb.buf);
+ strbuf_addf(out, _("Skipping unmerged submodule %s"), displaypath);
strbuf_addch(out, '\n');
goto cleanup;
}
sub = submodule_from_path(the_repository, null_oid(), ce->name);
- if (suc->update_data->recursive_prefix)
- displaypath = relative_path(suc->update_data->recursive_prefix,
- ce->name, &displaypath_sb);
- else
- displaypath = ce->name;
-
if (!sub) {
next_submodule_warn_missing(suc, out, displaypath);
goto cleanup;
@@ -2003,14 +2024,17 @@ static int prepare_to_clone_next_submodule(const struct cache_entry *ce,
strbuf_reset(&sb);
strbuf_addf(&sb, "submodule.%s.url", sub->name);
if (repo_config_get_string_tmp(the_repository, sb.buf, &url)) {
- if (starts_with_dot_slash(sub->url) ||
- starts_with_dot_dot_slash(sub->url)) {
+ if (sub->url && (starts_with_dot_slash(sub->url) ||
+ starts_with_dot_dot_slash(sub->url))) {
url = resolve_relative_url(sub->url, NULL, 0);
need_free_url = 1;
} else
url = sub->url;
}
+ if (!url)
+ die(_("cannot clone submodule '%s' without a URL"), sub->name);
+
strbuf_reset(&sb);
strbuf_addf(&sb, "%s/.git", ce->name);
needs_cloning = !file_exists(sb.buf);
@@ -2051,6 +2075,7 @@ static int prepare_to_clone_next_submodule(const struct cache_entry *ce,
strvec_pushl(&child->args, "--url", url, NULL);
if (suc->update_data->references.nr) {
struct string_list_item *item;
+
for_each_string_list_item(item, &suc->update_data->references)
strvec_pushl(&child->args, "--reference", item->string, NULL);
}
@@ -2062,7 +2087,7 @@ static int prepare_to_clone_next_submodule(const struct cache_entry *ce,
"--no-single-branch");
cleanup:
- strbuf_release(&displaypath_sb);
+ free(displaypath);
strbuf_release(&sb);
if (need_free_url)
free((void*)url);
@@ -2083,6 +2108,7 @@ static int update_clone_get_next_task(struct child_process *child,
ce = suc->update_data->list.entries[suc->current];
if (prepare_to_clone_next_submodule(ce, child, suc, err)) {
int *p = xmalloc(sizeof(*p));
+
*p = suc->current;
*idx_task_cb = p;
suc->current++;
@@ -2098,6 +2124,7 @@ static int update_clone_get_next_task(struct child_process *child,
index = suc->current - suc->update_data->list.nr;
if (index < suc->failed_clones_nr) {
int *p;
+
ce = suc->failed_clones[index];
if (!prepare_to_clone_next_submodule(ce, child, suc, err)) {
suc->current ++;
@@ -2116,11 +2143,12 @@ static int update_clone_get_next_task(struct child_process *child,
return 0;
}
-static int update_clone_start_failure(struct strbuf *err,
+static int update_clone_start_failure(struct strbuf *err UNUSED,
void *suc_cb,
- void *idx_task_cb)
+ void *idx_task_cb UNUSED)
{
struct submodule_update_clone *suc = suc_cb;
+
suc->quickstop = 1;
return 1;
}
@@ -2132,9 +2160,9 @@ static int update_clone_task_finished(int result,
{
const struct cache_entry *ce;
struct submodule_update_clone *suc = suc_cb;
-
int *idxP = idx_task_cb;
int idx = *idxP;
+
free(idxP);
if (!result)
@@ -2164,22 +2192,24 @@ static int update_clone_task_finished(int result,
}
static int git_update_clone_config(const char *var, const char *value,
+ const struct config_context *ctx,
void *cb)
{
int *max_jobs = cb;
+
if (!strcmp(var, "submodule.fetchjobs"))
- *max_jobs = parse_submodule_fetchjobs(var, value);
+ *max_jobs = parse_submodule_fetchjobs(var, value, ctx->kvi);
return 0;
}
-static int is_tip_reachable(const char *path, struct object_id *oid)
+static int is_tip_reachable(const char *path, const struct object_id *oid)
{
struct child_process cp = CHILD_PROCESS_INIT;
struct strbuf rev = STRBUF_INIT;
char *hex = oid_to_hex(oid);
cp.git_cmd = 1;
- cp.dir = xstrdup(path);
+ cp.dir = path;
cp.no_stderr = 1;
strvec_pushl(&cp.args, "rev-list", "-n", "1", hex, "--not", "--all", NULL);
@@ -2191,13 +2221,14 @@ static int is_tip_reachable(const char *path, struct object_id *oid)
return 1;
}
-static int fetch_in_submodule(const char *module_path, int depth, int quiet, struct object_id *oid)
+static int fetch_in_submodule(const char *module_path, int depth, int quiet,
+ const struct object_id *oid)
{
struct child_process cp = CHILD_PROCESS_INIT;
prepare_submodule_repo_env(&cp.env);
cp.git_cmd = 1;
- cp.dir = xstrdup(module_path);
+ cp.dir = module_path;
strvec_push(&cp.args, "fetch");
if (quiet)
@@ -2207,6 +2238,7 @@ static int fetch_in_submodule(const char *module_path, int depth, int quiet, str
if (oid) {
char *hex = oid_to_hex(oid);
char *remote = get_default_remote();
+
strvec_pushl(&cp.args, remote, hex, NULL);
free(remote);
}
@@ -2214,11 +2246,11 @@ static int fetch_in_submodule(const char *module_path, int depth, int quiet, str
return run_command(&cp);
}
-static int run_update_command(struct update_data *ud, int subforce)
+static int run_update_command(const struct update_data *ud, int subforce)
{
struct child_process cp = CHILD_PROCESS_INIT;
char *oid = oid_to_hex(&ud->oid);
- int must_die_on_failure = 0;
+ int ret;
switch (ud->update_strategy.type) {
case SM_UPDATE_CHECKOUT:
@@ -2232,55 +2264,50 @@ static int run_update_command(struct update_data *ud, int subforce)
strvec_push(&cp.args, "rebase");
if (ud->quiet)
strvec_push(&cp.args, "--quiet");
- must_die_on_failure = 1;
break;
case SM_UPDATE_MERGE:
cp.git_cmd = 1;
strvec_push(&cp.args, "merge");
if (ud->quiet)
strvec_push(&cp.args, "--quiet");
- must_die_on_failure = 1;
break;
case SM_UPDATE_COMMAND:
cp.use_shell = 1;
strvec_push(&cp.args, ud->update_strategy.command);
- must_die_on_failure = 1;
break;
default:
- BUG("unexpected update strategy type: %s",
- submodule_strategy_to_string(&ud->update_strategy));
+ BUG("unexpected update strategy type: %d",
+ ud->update_strategy.type);
}
strvec_push(&cp.args, oid);
- cp.dir = xstrdup(ud->sm_path);
+ cp.dir = ud->sm_path;
prepare_submodule_repo_env(&cp.env);
- if (run_command(&cp)) {
+ if ((ret = run_command(&cp))) {
switch (ud->update_strategy.type) {
case SM_UPDATE_CHECKOUT:
die_message(_("Unable to checkout '%s' in submodule path '%s'"),
oid, ud->displaypath);
+ /* No "ret" assignment, use "git checkout"'s */
break;
case SM_UPDATE_REBASE:
- die_message(_("Unable to rebase '%s' in submodule path '%s'"),
- oid, ud->displaypath);
+ ret = die_message(_("Unable to rebase '%s' in submodule path '%s'"),
+ oid, ud->displaypath);
break;
case SM_UPDATE_MERGE:
- die_message(_("Unable to merge '%s' in submodule path '%s'"),
- oid, ud->displaypath);
+ ret = die_message(_("Unable to merge '%s' in submodule path '%s'"),
+ oid, ud->displaypath);
break;
case SM_UPDATE_COMMAND:
- die_message(_("Execution of '%s %s' failed in submodule path '%s'"),
- ud->update_strategy.command, oid, ud->displaypath);
+ ret = die_message(_("Execution of '%s %s' failed in submodule path '%s'"),
+ ud->update_strategy.command, oid, ud->displaypath);
break;
default:
- BUG("unexpected update strategy type: %s",
- submodule_strategy_to_string(&ud->update_strategy));
+ BUG("unexpected update strategy type: %d",
+ ud->update_strategy.type);
}
- if (must_die_on_failure)
- exit(128);
- /* the command failed, but update must continue */
- return 1;
+ return ret;
}
if (ud->quiet)
@@ -2304,14 +2331,14 @@ static int run_update_command(struct update_data *ud, int subforce)
ud->displaypath, ud->update_strategy.command, oid);
break;
default:
- BUG("unexpected update strategy type: %s",
- submodule_strategy_to_string(&ud->update_strategy));
+ BUG("unexpected update strategy type: %d",
+ ud->update_strategy.type);
}
return 0;
}
-static int run_update_procedure(struct update_data *ud)
+static int run_update_procedure(const struct update_data *ud)
{
int subforce = is_null_oid(&ud->suboid) || ud->force;
@@ -2333,59 +2360,67 @@ static int run_update_procedure(struct update_data *ud)
*/
if (!is_tip_reachable(ud->sm_path, &ud->oid) &&
fetch_in_submodule(ud->sm_path, ud->depth, ud->quiet, &ud->oid))
- die(_("Fetched in submodule path '%s', but it did not "
- "contain %s. Direct fetching of that commit failed."),
- ud->displaypath, oid_to_hex(&ud->oid));
+ return die_message(_("Fetched in submodule path '%s', but it did not "
+ "contain %s. Direct fetching of that commit failed."),
+ ud->displaypath, oid_to_hex(&ud->oid));
}
return run_update_command(ud, subforce);
}
-static const char *remote_submodule_branch(const char *path)
+static int remote_submodule_branch(const char *path, const char **branch)
{
const struct submodule *sub;
- const char *branch = NULL;
char *key;
+ *branch = NULL;
sub = submodule_from_path(the_repository, null_oid(), path);
if (!sub)
- return NULL;
+ return die_message(_("could not initialize submodule at path '%s'"),
+ path);
key = xstrfmt("submodule.%s.branch", sub->name);
- if (repo_config_get_string_tmp(the_repository, key, &branch))
- branch = sub->branch;
+ if (repo_config_get_string_tmp(the_repository, key, branch))
+ *branch = sub->branch;
free(key);
- if (!branch)
- return "HEAD";
+ if (!*branch) {
+ *branch = "HEAD";
+ return 0;
+ }
- if (!strcmp(branch, ".")) {
+ if (!strcmp(*branch, ".")) {
const char *refname = resolve_ref_unsafe("HEAD", 0, NULL, NULL);
if (!refname)
- die(_("No such ref: %s"), "HEAD");
+ return die_message(_("No such ref: %s"), "HEAD");
/* detached HEAD */
if (!strcmp(refname, "HEAD"))
- die(_("Submodule (%s) branch configured to inherit "
- "branch from superproject, but the superproject "
- "is not on any branch"), sub->name);
+ return die_message(_("Submodule (%s) branch configured to inherit "
+ "branch from superproject, but the superproject "
+ "is not on any branch"), sub->name);
if (!skip_prefix(refname, "refs/heads/", &refname))
- die(_("Expecting a full ref name, got %s"), refname);
- return refname;
+ return die_message(_("Expecting a full ref name, got %s"),
+ refname);
+
+ *branch = refname;
+ return 0;
}
- return branch;
+ /* Our "branch" is coming from repo_config_get_string_tmp() */
+ return 0;
}
-static void ensure_core_worktree(const char *path)
+static int ensure_core_worktree(const char *path)
{
const char *cw;
struct repository subrepo;
if (repo_submodule_init(&subrepo, the_repository, path, null_oid()))
- die(_("could not get a repository handle for submodule '%s'"), path);
+ return die_message(_("could not get a repository handle for submodule '%s'"),
+ path);
if (!repo_config_get_string_tmp(&subrepo, "core.worktree", &cw)) {
char *cfg_file, *abs_path;
@@ -2403,15 +2438,39 @@ static void ensure_core_worktree(const char *path)
free(abs_path);
strbuf_release(&sb);
}
+
+ repo_clear(&subrepo);
+ return 0;
+}
+
+static const char *submodule_update_type_to_label(enum submodule_update_type type)
+{
+ switch (type) {
+ case SM_UPDATE_CHECKOUT:
+ return "checkout";
+ case SM_UPDATE_MERGE:
+ return "merge";
+ case SM_UPDATE_REBASE:
+ return "rebase";
+ case SM_UPDATE_UNSPECIFIED:
+ case SM_UPDATE_NONE:
+ case SM_UPDATE_COMMAND:
+ break;
+ }
+ BUG("unreachable with type %d", type);
}
-static void update_data_to_args(struct update_data *update_data, struct strvec *args)
+static void update_data_to_args(const struct update_data *update_data,
+ struct strvec *args)
{
+ enum submodule_update_type update_type = update_data->update_default;
+
strvec_pushl(args, "submodule--helper", "update", "--recursive", NULL);
+ if (update_data->displaypath) {
+ strvec_push(args, "--super-prefix");
+ strvec_pushf(args, "%s/", update_data->displaypath);
+ }
strvec_pushf(args, "--jobs=%d", update_data->max_jobs);
- if (update_data->recursive_prefix)
- strvec_pushl(args, "--recursive-prefix",
- update_data->recursive_prefix, NULL);
if (update_data->quiet)
strvec_push(args, "--quiet");
if (update_data->force)
@@ -2430,10 +2489,13 @@ static void update_data_to_args(struct update_data *update_data, struct strvec *
strvec_push(args, "--require-init");
if (update_data->depth)
strvec_pushf(args, "--depth=%d", update_data->depth);
- if (update_data->update_default)
- strvec_pushl(args, "--update", update_data->update_default, NULL);
+ if (update_type != SM_UPDATE_UNSPECIFIED)
+ strvec_pushf(args, "--%s",
+ submodule_update_type_to_label(update_type));
+
if (update_data->references.nr) {
struct string_list_item *item;
+
for_each_string_list_item(item, &update_data->references)
strvec_pushl(args, "--reference", item->string, NULL);
}
@@ -2453,66 +2515,62 @@ static void update_data_to_args(struct update_data *update_data, struct strvec *
static int update_submodule(struct update_data *update_data)
{
- char *prefixed_path;
-
- ensure_core_worktree(update_data->sm_path);
-
- if (update_data->recursive_prefix)
- prefixed_path = xstrfmt("%s%s", update_data->recursive_prefix,
- update_data->sm_path);
- else
- prefixed_path = xstrdup(update_data->sm_path);
-
- update_data->displaypath = get_submodule_displaypath(prefixed_path,
- update_data->prefix);
- free(prefixed_path);
+ int ret;
- determine_submodule_update_strategy(the_repository, update_data->just_cloned,
- update_data->sm_path, update_data->update_default,
- &update_data->update_strategy);
+ ret = determine_submodule_update_strategy(the_repository,
+ update_data->just_cloned,
+ update_data->sm_path,
+ update_data->update_default,
+ &update_data->update_strategy);
+ if (ret)
+ return ret;
if (update_data->just_cloned)
oidcpy(&update_data->suboid, null_oid());
else if (resolve_gitlink_ref(update_data->sm_path, "HEAD", &update_data->suboid))
- die(_("Unable to find current revision in submodule path '%s'"),
- update_data->displaypath);
+ return die_message(_("Unable to find current revision in submodule path '%s'"),
+ update_data->displaypath);
if (update_data->remote) {
- char *remote_name = get_default_remote_submodule(update_data->sm_path);
- const char *branch = remote_submodule_branch(update_data->sm_path);
- char *remote_ref = xstrfmt("refs/remotes/%s/%s", remote_name, branch);
+ char *remote_name;
+ const char *branch;
+ char *remote_ref;
+ int code;
+
+ code = get_default_remote_submodule(update_data->sm_path, &remote_name);
+ if (code)
+ return code;
+ code = remote_submodule_branch(update_data->sm_path, &branch);
+ if (code)
+ return code;
+ remote_ref = xstrfmt("refs/remotes/%s/%s", remote_name, branch);
+
+ free(remote_name);
if (!update_data->nofetch) {
if (fetch_in_submodule(update_data->sm_path, update_data->depth,
0, NULL))
- die(_("Unable to fetch in submodule path '%s'"),
- update_data->sm_path);
+ return die_message(_("Unable to fetch in submodule path '%s'"),
+ update_data->sm_path);
}
if (resolve_gitlink_ref(update_data->sm_path, remote_ref, &update_data->oid))
- die(_("Unable to find %s revision in submodule path '%s'"),
- remote_ref, update_data->sm_path);
+ return die_message(_("Unable to find %s revision in submodule path '%s'"),
+ remote_ref, update_data->sm_path);
free(remote_ref);
}
- if (!oideq(&update_data->oid, &update_data->suboid) || update_data->force)
- if (run_update_procedure(update_data))
- return 1;
+ if (!oideq(&update_data->oid, &update_data->suboid) || update_data->force) {
+ ret = run_update_procedure(update_data);
+ if (ret)
+ return ret;
+ }
if (update_data->recursive) {
struct child_process cp = CHILD_PROCESS_INIT;
struct update_data next = *update_data;
- int res;
-
- if (update_data->recursive_prefix)
- prefixed_path = xstrfmt("%s%s/", update_data->recursive_prefix,
- update_data->sm_path);
- else
- prefixed_path = xstrfmt("%s/", update_data->sm_path);
- next.recursive_prefix = get_submodule_displaypath(prefixed_path,
- update_data->prefix);
next.prefix = NULL;
oidcpy(&next.oid, null_oid());
oidcpy(&next.suboid, null_oid());
@@ -2522,16 +2580,11 @@ static int update_submodule(struct update_data *update_data)
prepare_submodule_repo_env(&cp.env);
update_data_to_args(&next, &cp.args);
- /* die() if child process die()'d */
- res = run_command(&cp);
- if (!res)
- return 0;
- die_message(_("Failed to recurse into submodule path '%s'"),
- update_data->displaypath);
- if (res == 128)
- exit(res);
- else if (res)
- return 1;
+ ret = run_command(&cp);
+ if (ret)
+ die_message(_("Failed to recurse into submodule path '%s'"),
+ update_data->displaypath);
+ return ret;
}
return 0;
@@ -2539,14 +2592,22 @@ static int update_submodule(struct update_data *update_data)
static int update_submodules(struct update_data *update_data)
{
- int i, res = 0;
+ int i, ret = 0;
struct submodule_update_clone suc = SUBMODULE_UPDATE_CLONE_INIT;
+ const struct run_process_parallel_opts opts = {
+ .tr2_category = "submodule",
+ .tr2_label = "parallel/update",
+
+ .processes = update_data->max_jobs,
+
+ .get_next_task = update_clone_get_next_task,
+ .start_failure = update_clone_start_failure,
+ .task_finished = update_clone_task_finished,
+ .data = &suc,
+ };
suc.update_data = update_data;
- run_processes_parallel_tr2(suc.update_data->max_jobs, update_clone_get_next_task,
- update_clone_start_failure,
- update_clone_task_finished, &suc, "submodule",
- "parallel/update");
+ run_processes_parallel(&opts);
/*
* We saved the output and put it out all at once now.
@@ -2557,34 +2618,51 @@ static int update_submodules(struct update_data *update_data)
* - the listener can avoid doing any work if fetching failed.
*/
if (suc.quickstop) {
- res = 1;
+ ret = 1;
goto cleanup;
}
for (i = 0; i < suc.update_clone_nr; i++) {
struct update_clone_data ucd = suc.update_clone[i];
+ int code;
oidcpy(&update_data->oid, &ucd.oid);
update_data->just_cloned = ucd.just_cloned;
update_data->sm_path = ucd.sub->path;
- if (update_submodule(update_data))
- res = 1;
+ code = ensure_core_worktree(update_data->sm_path);
+ if (code)
+ goto fail;
+
+ update_data->displaypath = get_submodule_displaypath(
+ update_data->sm_path, update_data->prefix,
+ update_data->super_prefix);
+ code = update_submodule(update_data);
+ FREE_AND_NULL(update_data->displaypath);
+fail:
+ if (!code)
+ continue;
+ ret = code;
+ if (ret == 128)
+ goto cleanup;
}
cleanup:
+ submodule_update_clone_release(&suc);
string_list_clear(&update_data->references, 0);
- return res;
+ return ret;
}
static int module_update(int argc, const char **argv, const char *prefix)
{
- struct pathspec pathspec;
+ struct pathspec pathspec = { 0 };
+ struct pathspec pathspec2 = { 0 };
struct update_data opt = UPDATE_DATA_INIT;
- struct list_objects_filter_options filter_options;
+ struct list_objects_filter_options filter_options =
+ LIST_OBJECTS_FILTER_INIT;
int ret;
-
struct option module_update_options[] = {
+ OPT__SUPER_PREFIX(&opt.super_prefix),
OPT__FORCE(&opt.force, N_("force checkout updates"), 0),
OPT_BOOL(0, "init", &opt.init,
N_("initialize uninitialized submodules before update")),
@@ -2594,16 +2672,15 @@ static int module_update(int argc, const char **argv, const char *prefix)
N_("traverse submodules recursively")),
OPT_BOOL('N', "no-fetch", &opt.nofetch,
N_("don't fetch new objects from the remote site")),
- OPT_STRING(0, "prefix", &opt.prefix,
- N_("path"),
- N_("path into the working tree")),
- OPT_STRING(0, "recursive-prefix", &opt.recursive_prefix,
- N_("path"),
- N_("path into the working tree, across nested "
- "submodule boundaries")),
- OPT_STRING(0, "update", &opt.update_default,
- N_("string"),
- N_("rebase, merge, checkout or none")),
+ OPT_SET_INT(0, "checkout", &opt.update_default,
+ N_("use the 'checkout' update strategy (default)"),
+ SM_UPDATE_CHECKOUT),
+ OPT_SET_INT('m', "merge", &opt.update_default,
+ N_("use the 'merge' update strategy"),
+ SM_UPDATE_MERGE),
+ OPT_SET_INT('r', "rebase", &opt.update_default,
+ N_("use the 'rebase' update strategy"),
+ SM_UPDATE_REBASE),
OPT_STRING_LIST(0, "reference", &opt.references, N_("repo"),
N_("reference repository")),
OPT_BOOL(0, "dissociate", &opt.dissociate,
@@ -2619,13 +2696,12 @@ static int module_update(int argc, const char **argv, const char *prefix)
OPT_BOOL(0, "progress", &opt.progress,
N_("force cloning progress")),
OPT_BOOL(0, "require-init", &opt.require_init,
- N_("disallow cloning into non-empty directory")),
+ N_("disallow cloning into non-empty directory, implies --init")),
OPT_BOOL(0, "single-branch", &opt.single_branch,
N_("clone only one branch, HEAD or --branch")),
OPT_PARSE_LIST_OBJECTS_FILTER(&filter_options),
OPT_END()
};
-
const char *const git_submodule_helper_usage[] = {
N_("git submodule [--quiet] update"
" [--init [--filter=<filter-spec>]] [--remote]"
@@ -2639,25 +2715,26 @@ static int module_update(int argc, const char **argv, const char *prefix)
update_clone_config_from_gitmodules(&opt.max_jobs);
git_config(git_update_clone_config, &opt.max_jobs);
- memset(&filter_options, 0, sizeof(filter_options));
argc = parse_options(argc, argv, prefix, module_update_options,
git_submodule_helper_usage, 0);
+ if (opt.require_init)
+ opt.init = 1;
+
if (filter_options.choice && !opt.init) {
usage_with_options(git_submodule_helper_usage,
module_update_options);
}
opt.filter_options = &filter_options;
+ opt.prefix = prefix;
if (opt.update_default)
- if (parse_submodule_update_strategy(opt.update_default,
- &opt.update_strategy) < 0)
- die(_("bad value for update parameter"));
+ opt.update_strategy.type = opt.update_default;
- if (module_list_compute(argc, argv, prefix, &pathspec, &opt.list) < 0) {
- list_objects_filter_release(&filter_options);
- return 1;
+ if (module_list_compute(argv, prefix, &pathspec, &opt.list) < 0) {
+ ret = 1;
+ goto cleanup;
}
if (pathspec.nr)
@@ -2667,31 +2744,39 @@ static int module_update(int argc, const char **argv, const char *prefix)
struct module_list list = MODULE_LIST_INIT;
struct init_cb info = INIT_CB_INIT;
- if (module_list_compute(argc, argv, opt.prefix,
- &pathspec, &list) < 0)
- return 1;
+ if (module_list_compute(argv, opt.prefix,
+ &pathspec2, &list) < 0) {
+ module_list_release(&list);
+ ret = 1;
+ goto cleanup;
+ }
/*
* If there are no path args and submodule.active is set then,
* by default, only initialize 'active' modules.
*/
- if (!argc && git_config_get_value_multi("submodule.active"))
+ if (!argc && !git_config_get("submodule.active"))
module_list_active(&list);
info.prefix = opt.prefix;
- info.superprefix = opt.recursive_prefix;
+ info.super_prefix = opt.super_prefix;
if (opt.quiet)
info.flags |= OPT_QUIET;
for_each_listed_submodule(&list, init_submodule_cb, &info);
+ module_list_release(&list);
}
ret = update_submodules(&opt);
+cleanup:
+ update_data_release(&opt);
list_objects_filter_release(&filter_options);
+ clear_pathspec(&pathspec);
+ clear_pathspec(&pathspec2);
return ret;
}
-static int push_check(int argc, const char **argv, const char *prefix)
+static int push_check(int argc, const char **argv, const char *prefix UNUSED)
{
struct remote *remote;
const char *superproject_head;
@@ -2771,142 +2856,73 @@ static int push_check(int argc, const char **argv, const char *prefix)
static int absorb_git_dirs(int argc, const char **argv, const char *prefix)
{
int i;
- struct pathspec pathspec;
+ struct pathspec pathspec = { 0 };
struct module_list list = MODULE_LIST_INIT;
- unsigned flags = ABSORB_GITDIR_RECURSE_SUBMODULES;
-
+ const char *super_prefix = NULL;
struct option embed_gitdir_options[] = {
- OPT_STRING(0, "prefix", &prefix,
- N_("path"),
- N_("path into the working tree")),
- OPT_BIT(0, "--recursive", &flags, N_("recurse into submodules"),
- ABSORB_GITDIR_RECURSE_SUBMODULES),
+ OPT__SUPER_PREFIX(&super_prefix),
OPT_END()
};
-
const char *const git_submodule_helper_usage[] = {
- N_("git submodule--helper absorb-git-dirs [<options>] [<path>...]"),
+ N_("git submodule absorbgitdirs [<options>] [<path>...]"),
NULL
};
+ int ret = 1;
argc = parse_options(argc, argv, prefix, embed_gitdir_options,
git_submodule_helper_usage, 0);
- if (module_list_compute(argc, argv, prefix, &pathspec, &list) < 0)
- return 1;
+ if (module_list_compute(argv, prefix, &pathspec, &list) < 0)
+ goto cleanup;
for (i = 0; i < list.nr; i++)
- absorb_git_dir_into_superproject(list.entries[i]->name, flags);
-
- return 0;
-}
-
-static int is_active(int argc, const char **argv, const char *prefix)
-{
- if (argc != 2)
- die("submodule--helper is-active takes exactly 1 argument");
-
- return !is_submodule_active(the_repository, argv[1]);
-}
-
-/*
- * Exit non-zero if any of the submodule names given on the command line is
- * invalid. If no names are given, filter stdin to print only valid names
- * (which is primarily intended for testing).
- */
-static int check_name(int argc, const char **argv, const char *prefix)
-{
- if (argc > 1) {
- while (*++argv) {
- if (check_submodule_name(*argv) < 0)
- return 1;
- }
- } else {
- struct strbuf buf = STRBUF_INIT;
- while (strbuf_getline(&buf, stdin) != EOF) {
- if (!check_submodule_name(buf.buf))
- printf("%s\n", buf.buf);
- }
- strbuf_release(&buf);
- }
- return 0;
-}
-
-static int module_config(int argc, const char **argv, const char *prefix)
-{
- enum {
- CHECK_WRITEABLE = 1,
- DO_UNSET = 2
- } command = 0;
-
- struct option module_config_options[] = {
- OPT_CMDMODE(0, "check-writeable", &command,
- N_("check if it is safe to write to the .gitmodules file"),
- CHECK_WRITEABLE),
- OPT_CMDMODE(0, "unset", &command,
- N_("unset the config in the .gitmodules file"),
- DO_UNSET),
- OPT_END()
- };
- const char *const git_submodule_helper_usage[] = {
- N_("git submodule--helper config <name> [<value>]"),
- N_("git submodule--helper config --unset <name>"),
- "git submodule--helper config --check-writeable",
- NULL
- };
-
- argc = parse_options(argc, argv, prefix, module_config_options,
- git_submodule_helper_usage, PARSE_OPT_KEEP_ARGV0);
-
- if (argc == 1 && command == CHECK_WRITEABLE)
- return is_writing_gitmodules_ok() ? 0 : -1;
-
- /* Equivalent to ACTION_GET in builtin/config.c */
- if (argc == 2 && command != DO_UNSET)
- return print_config_from_gitmodules(the_repository, argv[1]);
-
- /* Equivalent to ACTION_SET in builtin/config.c */
- if (argc == 3 || (argc == 2 && command == DO_UNSET)) {
- const char *value = (argc == 3) ? argv[2] : NULL;
+ absorb_git_dir_into_superproject(list.entries[i]->name,
+ super_prefix);
- if (!is_writing_gitmodules_ok())
- die(_("please make sure that the .gitmodules file is in the working tree"));
-
- return config_set_in_gitmodules_file_gently(argv[1], value);
- }
-
- usage_with_options(git_submodule_helper_usage, module_config_options);
+ ret = 0;
+cleanup:
+ clear_pathspec(&pathspec);
+ module_list_release(&list);
+ return ret;
}
static int module_set_url(int argc, const char **argv, const char *prefix)
{
- int quiet = 0;
+ int quiet = 0, ret;
const char *newurl;
const char *path;
char *config_name;
-
struct option options[] = {
OPT__QUIET(&quiet, N_("suppress output for setting url of a submodule")),
OPT_END()
};
const char *const usage[] = {
- N_("git submodule--helper set-url [--quiet] <path> <newurl>"),
+ N_("git submodule set-url [--quiet] <path> <newurl>"),
NULL
};
+ const struct submodule *sub;
argc = parse_options(argc, argv, prefix, options, usage, 0);
if (argc != 2 || !(path = argv[0]) || !(newurl = argv[1]))
usage_with_options(usage, options);
- config_name = xstrfmt("submodule.%s.url", path);
+ sub = submodule_from_path(the_repository, null_oid(), path);
- config_set_in_gitmodules_file_gently(config_name, newurl);
- sync_submodule(path, prefix, quiet ? OPT_QUIET : 0);
+ if (!sub)
+ die(_("no submodule mapping found in .gitmodules for path '%s'"),
+ path);
- free(config_name);
+ config_name = xstrfmt("submodule.%s.url", sub->name);
+ ret = config_set_in_gitmodules_file_gently(config_name, newurl);
- return 0;
+ if (!ret) {
+ repo_read_gitmodules(the_repository, 0);
+ sync_submodule(sub->path, prefix, NULL, quiet ? OPT_QUIET : 0);
+ }
+
+ free(config_name);
+ return !!ret;
}
static int module_set_branch(int argc, const char **argv, const char *prefix)
@@ -2915,13 +2931,13 @@ static int module_set_branch(int argc, const char **argv, const char *prefix)
const char *opt_branch = NULL;
const char *path;
char *config_name;
-
- /*
- * We accept the `quiet` option for uniformity across subcommands,
- * though there is nothing to make less verbose in this subcommand.
- */
struct option options[] = {
+ /*
+ * We accept the `quiet` option for uniformity across subcommands,
+ * though there is nothing to make less verbose in this subcommand.
+ */
OPT_NOOP_NOARG('q', "quiet"),
+
OPT_BOOL('d', "default", &opt_default,
N_("set the default tracking branch to master")),
OPT_STRING('b', "branch", &opt_branch, N_("branch"),
@@ -2929,10 +2945,11 @@ static int module_set_branch(int argc, const char **argv, const char *prefix)
OPT_END()
};
const char *const usage[] = {
- N_("git submodule--helper set-branch [-q|--quiet] (-d|--default) <path>"),
- N_("git submodule--helper set-branch [-q|--quiet] (-b|--branch) <branch> <path>"),
+ N_("git submodule set-branch [-q|--quiet] (-d|--default) <path>"),
+ N_("git submodule set-branch [-q|--quiet] (-b|--branch) <branch> <path>"),
NULL
};
+ const struct submodule *sub;
argc = parse_options(argc, argv, prefix, options, usage, 0);
@@ -2945,7 +2962,13 @@ static int module_set_branch(int argc, const char **argv, const char *prefix)
if (argc != 1 || !(path = argv[0]))
usage_with_options(usage, options);
- config_name = xstrfmt("submodule.%s.branch", path);
+ sub = submodule_from_path(the_repository, null_oid(), path);
+
+ if (!sub)
+ die(_("no submodule mapping found in .gitmodules for path '%s'"),
+ path);
+
+ config_name = xstrfmt("submodule.%s.branch", sub->name);
ret = config_set_in_gitmodules_file_gently(config_name, opt_branch);
free(config_name);
@@ -2956,7 +2979,6 @@ static int module_create_branch(int argc, const char **argv, const char *prefix)
{
enum branch_track track;
int quiet = 0, force = 0, reflog = 0, dry_run = 0;
-
struct option options[] = {
OPT__QUIET(&quiet, N_("print only error messages")),
OPT__FORCE(&force, N_("force creation"), 0),
@@ -3019,8 +3041,10 @@ static void append_fetch_remotes(struct strbuf *msg, const char *git_dir_path)
if (!capture_command(&cp_remote, &sb_remote_out, 0)) {
char *next_line;
char *line = sb_remote_out.buf;
+
while ((next_line = strchr(line, '\n')) != NULL) {
size_t len = next_line - line;
+
if (strip_suffix_mem(line, &len, " (fetch)"))
strbuf_addf(msg, " %.*s\n", (int)len, line);
line = next_line + 1;
@@ -3034,6 +3058,8 @@ static int add_submodule(const struct add_data *add_data)
{
char *submod_gitdir_path;
struct module_clone_data clone_data = MODULE_CLONE_DATA_INIT;
+ struct string_list reference = STRING_LIST_INIT_NODUP;
+ int ret = -1;
/* perhaps the path already exists and is already a git repo, else clone it */
if (is_directory(add_data->sm_path)) {
@@ -3050,6 +3076,7 @@ static int add_submodule(const struct add_data *add_data)
free(submod_gitdir_path);
} else {
struct child_process cp = CHILD_PROCESS_INIT;
+
submod_gitdir_path = xstrfmt(".git/modules/%s", add_data->sm_name);
if (is_directory(submod_gitdir_path)) {
@@ -3088,15 +3115,17 @@ static int add_submodule(const struct add_data *add_data)
clone_data.url = add_data->realrepo;
clone_data.quiet = add_data->quiet;
clone_data.progress = add_data->progress;
- if (add_data->reference_path)
- string_list_append(&clone_data.reference,
- xstrdup(add_data->reference_path));
+ if (add_data->reference_path) {
+ char *p = xstrdup(add_data->reference_path);
+
+ string_list_append(&reference, p)->util = p;
+ }
clone_data.dissociate = add_data->dissociate;
if (add_data->depth >= 0)
clone_data.depth = xstrfmt("%d", add_data->depth);
- if (clone_submodule(&clone_data))
- return -1;
+ if (clone_submodule(&clone_data, &reference))
+ goto cleanup;
prepare_submodule_repo_env(&cp.env);
cp.git_cmd = 1;
@@ -3115,7 +3144,10 @@ static int add_submodule(const struct add_data *add_data)
if (run_command(&cp))
die(_("unable to checkout submodule '%s'"), add_data->sm_path);
}
- return 0;
+ ret = 0;
+cleanup:
+ string_list_clear(&reference, 1);
+ return ret;
}
static int config_submodule_in_gitmodules(const char *name, const char *var, const char *value)
@@ -3136,7 +3168,6 @@ static int config_submodule_in_gitmodules(const char *name, const char *var, con
static void configure_added_submodule(struct add_data *add_data)
{
char *key;
- char *val = NULL;
struct child_process add_submod = CHILD_PROCESS_INIT;
struct child_process add_gitmodules = CHILD_PROCESS_INIT;
@@ -3181,7 +3212,7 @@ static void configure_added_submodule(struct add_data *add_data)
* is_submodule_active(), since that function needs to find
* out the value of "submodule.active" again anyway.
*/
- if (!git_config_get_string("submodule.active", &val) && val) {
+ if (!git_config_get("submodule.active")) {
/*
* If the submodule being added isn't already covered by the
* current configured pathspec, set the submodule's active flag
@@ -3204,7 +3235,7 @@ static void die_on_index_match(const char *path, int force)
const char *args[] = { path, NULL };
parse_pathspec(&ps, 0, PATHSPEC_PREFER_CWD, NULL, args);
- if (read_cache_preload(NULL) < 0)
+ if (repo_read_index_preload(the_repository, NULL, 0) < 0)
die(_("index file corrupt"));
if (ps.nr) {
@@ -3215,19 +3246,18 @@ static void die_on_index_match(const char *path, int force)
ensure_full_index(&the_index);
/*
- * Since there is only one pathspec, we just need
- * need to check ps_matched[0] to know if a cache
- * entry matched.
+ * 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 < active_nr; i++) {
- ce_path_match(&the_index, active_cache[i], &ps,
+ for (i = 0; i < the_index.cache_nr; i++) {
+ ce_path_match(&the_index, the_index.cache[i], &ps,
ps_matched);
if (ps_matched[0]) {
if (!force)
die(_("'%s' already exists in the index"),
path);
- if (!S_ISGITLINK(active_cache[i]->ce_mode))
+ if (!S_ISGITLINK(the_index.cache[i]->ce_mode))
die(_("'%s' already exists in the index "
"and is not a submodule"), path);
break;
@@ -3255,7 +3285,6 @@ static int module_add(int argc, const char **argv, const char *prefix)
int force = 0, quiet = 0, progress = 0, dissociate = 0;
struct add_data add_data = ADD_DATA_INIT;
char *to_free = NULL;
-
struct option options[] = {
OPT_STRING('b', "branch", &add_data.branch, N_("branch"),
N_("branch of repository to add as submodule")),
@@ -3272,11 +3301,12 @@ static int module_add(int argc, const char **argv, const char *prefix)
OPT_INTEGER(0, "depth", &add_data.depth, N_("depth for shallow clones")),
OPT_END()
};
-
const char *const usage[] = {
- N_("git submodule--helper add [<options>] [--] <repository> [<path>]"),
+ N_("git submodule add [<options>] [--] <repository> [<path>]"),
NULL
};
+ struct strbuf sb = STRBUF_INIT;
+ int ret = 1;
argc = parse_options(argc, argv, prefix, options, usage, 0);
@@ -3296,8 +3326,12 @@ static int module_add(int argc, const char **argv, const char *prefix)
else
add_data.sm_path = xstrdup(argv[1]);
- if (prefix && *prefix && !is_absolute_path(add_data.sm_path))
- add_data.sm_path = xstrfmt("%s%s", prefix, add_data.sm_path);
+ if (prefix && *prefix && !is_absolute_path(add_data.sm_path)) {
+ char *sm_path = add_data.sm_path;
+
+ add_data.sm_path = xstrfmt("%s%s", prefix, sm_path);
+ free(sm_path);
+ }
if (starts_with_dot_dot_slash(add_data.repo) ||
starts_with_dot_slash(add_data.repo)) {
@@ -3326,20 +3360,17 @@ static int module_add(int argc, const char **argv, const char *prefix)
die_on_repo_without_commits(add_data.sm_path);
if (!force) {
- int exit_code = -1;
- struct strbuf sb = STRBUF_INIT;
struct child_process cp = CHILD_PROCESS_INIT;
+
cp.git_cmd = 1;
cp.no_stdout = 1;
strvec_pushl(&cp.args, "add", "--dry-run", "--ignore-missing",
"--no-warn-embedded-repo", add_data.sm_path, NULL);
- if ((exit_code = pipe_command(&cp, NULL, 0, NULL, 0, &sb, 0))) {
+ if ((ret = pipe_command(&cp, NULL, 0, NULL, 0, &sb, 0))) {
strbuf_complete_line(&sb);
fputs(sb.buf, stderr);
- free(add_data.sm_path);
- return exit_code;
+ goto cleanup;
}
- strbuf_release(&sb);
}
if(!add_data.sm_name)
@@ -3354,64 +3385,44 @@ static int module_add(int argc, const char **argv, const char *prefix)
add_data.progress = !!progress;
add_data.dissociate = !!dissociate;
- if (add_submodule(&add_data)) {
- free(add_data.sm_path);
- return 1;
- }
+ if (add_submodule(&add_data))
+ goto cleanup;
configure_added_submodule(&add_data);
+
+ ret = 0;
+cleanup:
free(add_data.sm_path);
free(to_free);
+ strbuf_release(&sb);
- return 0;
+ return ret;
}
-#define SUPPORT_SUPER_PREFIX (1<<0)
-
-struct cmd_struct {
- const char *cmd;
- int (*fn)(int, const char **, const char *);
- unsigned option;
-};
-
-static struct cmd_struct commands[] = {
- {"list", module_list, 0},
- {"name", module_name, 0},
- {"clone", module_clone, 0},
- {"add", module_add, SUPPORT_SUPER_PREFIX},
- {"update", module_update, 0},
- {"resolve-relative-url-test", resolve_relative_url_test, 0},
- {"foreach", module_foreach, SUPPORT_SUPER_PREFIX},
- {"init", module_init, SUPPORT_SUPER_PREFIX},
- {"status", module_status, SUPPORT_SUPER_PREFIX},
- {"sync", module_sync, SUPPORT_SUPER_PREFIX},
- {"deinit", module_deinit, 0},
- {"summary", module_summary, SUPPORT_SUPER_PREFIX},
- {"push-check", push_check, 0},
- {"absorb-git-dirs", absorb_git_dirs, SUPPORT_SUPER_PREFIX},
- {"is-active", is_active, 0},
- {"check-name", check_name, 0},
- {"config", module_config, 0},
- {"set-url", module_set_url, 0},
- {"set-branch", module_set_branch, 0},
- {"create-branch", module_create_branch, 0},
-};
-
int cmd_submodule__helper(int argc, const char **argv, const char *prefix)
{
- int i;
- if (argc < 2 || !strcmp(argv[1], "-h"))
- usage("git submodule--helper <command>");
-
- for (i = 0; i < ARRAY_SIZE(commands); i++) {
- if (!strcmp(argv[1], commands[i].cmd)) {
- if (get_super_prefix() &&
- !(commands[i].option & SUPPORT_SUPER_PREFIX))
- die(_("%s doesn't support --super-prefix"),
- commands[i].cmd);
- return commands[i].fn(argc - 1, argv + 1, prefix);
- }
- }
+ parse_opt_subcommand_fn *fn = NULL;
+ const char *const usage[] = {
+ N_("git submodule--helper <command>"),
+ NULL
+ };
+ struct option options[] = {
+ OPT_SUBCOMMAND("clone", &fn, module_clone),
+ OPT_SUBCOMMAND("add", &fn, module_add),
+ OPT_SUBCOMMAND("update", &fn, module_update),
+ OPT_SUBCOMMAND("foreach", &fn, module_foreach),
+ OPT_SUBCOMMAND("init", &fn, module_init),
+ OPT_SUBCOMMAND("status", &fn, module_status),
+ OPT_SUBCOMMAND("sync", &fn, module_sync),
+ OPT_SUBCOMMAND("deinit", &fn, module_deinit),
+ OPT_SUBCOMMAND("summary", &fn, module_summary),
+ OPT_SUBCOMMAND("push-check", &fn, push_check),
+ OPT_SUBCOMMAND("absorbgitdirs", &fn, absorb_git_dirs),
+ OPT_SUBCOMMAND("set-url", &fn, module_set_url),
+ OPT_SUBCOMMAND("set-branch", &fn, module_set_branch),
+ OPT_SUBCOMMAND("create-branch", &fn, module_create_branch),
+ OPT_END()
+ };
+ argc = parse_options(argc, argv, prefix, options, usage, 0);
- die(_("'%s' is not a valid submodule--helper "
- "subcommand"), argv[1]);
+ return fn(argc, argv, prefix);
}
diff --git a/builtin/symbolic-ref.c b/builtin/symbolic-ref.c
index e547a08..c9defe4 100644
--- a/builtin/symbolic-ref.c
+++ b/builtin/symbolic-ref.c
@@ -1,19 +1,24 @@
#include "builtin.h"
#include "config.h"
-#include "cache.h"
+#include "gettext.h"
#include "refs.h"
#include "parse-options.h"
+#include "strbuf.h"
static const char * const git_symbolic_ref_usage[] = {
- N_("git symbolic-ref [<options>] <name> [<ref>]"),
- N_("git symbolic-ref -d [-q] <name>"),
+ N_("git symbolic-ref [-m <reason>] <name> <ref>"),
+ N_("git symbolic-ref [-q] [--short] [--no-recurse] <name>"),
+ N_("git symbolic-ref --delete [-q] <name>"),
NULL
};
-static int check_symref(const char *HEAD, int quiet, int shorten, int print)
+static int check_symref(const char *HEAD, int quiet, int shorten, int recurse, int print)
{
- int flag;
- const char *refname = resolve_ref_unsafe(HEAD, 0, NULL, &flag);
+ int resolve_flags, flag;
+ const char *refname;
+
+ resolve_flags = (recurse ? 0 : RESOLVE_REF_NO_RECURSE);
+ refname = resolve_ref_unsafe(HEAD, resolve_flags, NULL, &flag);
if (!refname)
die("No such ref: %s", HEAD);
@@ -35,13 +40,14 @@ static int check_symref(const char *HEAD, int quiet, int shorten, int print)
int cmd_symbolic_ref(int argc, const char **argv, const char *prefix)
{
- int quiet = 0, delete = 0, shorten = 0, ret = 0;
+ int quiet = 0, delete = 0, shorten = 0, recurse = 1, ret = 0;
const char *msg = NULL;
struct option options[] = {
OPT__QUIET(&quiet,
N_("suppress error message for non-symbolic (detached) refs")),
OPT_BOOL('d', "delete", &delete, N_("delete symbolic ref")),
OPT_BOOL(0, "short", &shorten, N_("shorten ref output")),
+ OPT_BOOL(0, "recurse", &recurse, N_("recursively dereference (default)")),
OPT_STRING('m', NULL, &msg, N_("reason"), N_("reason of the update")),
OPT_END(),
};
@@ -55,7 +61,7 @@ int cmd_symbolic_ref(int argc, const char **argv, const char *prefix)
if (delete) {
if (argc != 1)
usage_with_options(git_symbolic_ref_usage, options);
- ret = check_symref(argv[0], 1, 0, 0);
+ ret = check_symref(argv[0], 1, 0, 0, 0);
if (ret)
die("Cannot delete %s, not a symbolic ref", argv[0]);
if (!strcmp(argv[0], "HEAD"))
@@ -65,12 +71,14 @@ int cmd_symbolic_ref(int argc, const char **argv, const char *prefix)
switch (argc) {
case 1:
- ret = check_symref(argv[0], quiet, shorten, 1);
+ ret = check_symref(argv[0], quiet, shorten, recurse, 1);
break;
case 2:
if (!strcmp(argv[0], "HEAD") &&
!starts_with(argv[1], "refs/"))
die("Refusing to point HEAD outside of refs/");
+ if (check_refname_format(argv[1], REFNAME_ALLOW_ONELEVEL) < 0)
+ die("Refusing to set '%s' to invalid ref '%s'", argv[0], argv[1]);
ret = !!create_symref(argv[0], argv[1], msg);
break;
default:
diff --git a/builtin/tag.c b/builtin/tag.c
index 75dece0..9a33cb5 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -6,13 +6,18 @@
* Based on git-tag.sh and mktag.c by Linus Torvalds.
*/
-#include "cache.h"
-#include "config.h"
#include "builtin.h"
+#include "advice.h"
+#include "config.h"
+#include "editor.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "refs.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "path.h"
#include "tag.h"
-#include "run-command.h"
#include "parse-options.h"
#include "diff.h"
#include "revision.h"
@@ -21,13 +26,17 @@
#include "column.h"
#include "ref-filter.h"
#include "date.h"
+#include "write-or-die.h"
+#include "object-file-convert.h"
static const char * const git_tag_usage[] = {
- N_("git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]\n"
- " <tagname> [<head>]"),
+ N_("git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
+ " <tagname> [<commit> | <object>]"),
N_("git tag -d <tagname>..."),
- N_("git tag -l [-n[<num>]] [--contains <commit>] [--no-contains <commit>] [--points-at <object>]\n"
- " [--format=<format>] [--merged <commit>] [--no-merged <commit>] [<pattern>...]"),
+ N_("git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]\n"
+ " [--points-at <object>] [--column[=<options>] | --no-column]\n"
+ " [--create-reflog] [--sort=<key>] [--format=<format>]\n"
+ " [--merged <commit>] [--no-merged <commit>] [<pattern>...]"),
N_("git tag -v [--format=<format>] <tagname>..."),
NULL
};
@@ -39,13 +48,7 @@ static int config_sign_tag = -1; /* unspecified */
static int list_tags(struct ref_filter *filter, struct ref_sorting *sorting,
struct ref_format *format)
{
- struct ref_array array;
- struct strbuf output = STRBUF_INIT;
- struct strbuf err = STRBUF_INIT;
char *to_free = NULL;
- int i;
-
- memset(&array, 0, sizeof(array));
if (filter->lines == -1)
filter->lines = 0;
@@ -63,21 +66,8 @@ static int list_tags(struct ref_filter *filter, struct ref_sorting *sorting,
if (verify_ref_format(format))
die(_("unable to parse format string"));
filter->with_commit_tag_algo = 1;
- filter_refs(&array, filter, FILTER_REFS_TAGS);
- ref_array_sort(sorting, &array);
-
- for (i = 0; i < array.nr; i++) {
- strbuf_reset(&output);
- strbuf_reset(&err);
- if (format_ref_array_item(array.items[i], format, &output, &err))
- die("%s", err.buf);
- fwrite(output.buf, 1, output.len, stdout);
- putchar('\n');
- }
+ filter_and_format_refs(filter, FILTER_REFS_TAGS, sorting, format);
- strbuf_release(&err);
- strbuf_release(&output);
- ref_array_clear(&array);
free(to_free);
return 0;
@@ -109,7 +99,7 @@ static int for_each_tag_name(const char **argv, each_tag_name_fn fn,
return had_error;
}
-static int collect_tags(const char *name, const char *ref,
+static int collect_tags(const char *name UNUSED, const char *ref,
const struct object_id *oid, void *cb_data)
{
struct string_list *ref_list = cb_data;
@@ -135,7 +125,7 @@ static int delete_tags(const char **argv)
if (!ref_exists(name))
printf(_("Deleted tag '%s' (was %s)\n"),
item->string + 10,
- find_unique_abbrev(oid, DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, oid, DEFAULT_ABBREV));
free(oid);
}
@@ -143,7 +133,7 @@ static int delete_tags(const char **argv)
return result;
}
-static int verify_tag(const char *name, const char *ref,
+static int verify_tag(const char *name, const char *ref UNUSED,
const struct object_id *oid, void *cb_data)
{
int flags;
@@ -162,24 +152,57 @@ static int verify_tag(const char *name, const char *ref,
return 0;
}
-static int do_sign(struct strbuf *buffer)
+static int do_sign(struct strbuf *buffer, struct object_id **compat_oid,
+ struct object_id *compat_oid_buf)
{
- return sign_buffer(buffer, buffer, get_signing_key());
+ const struct git_hash_algo *compat = the_repository->compat_hash_algo;
+ struct strbuf sig = STRBUF_INIT, compat_sig = STRBUF_INIT;
+ struct strbuf compat_buf = STRBUF_INIT;
+ const char *keyid = get_signing_key();
+ int ret = -1;
+
+ if (sign_buffer(buffer, &sig, keyid))
+ return -1;
+
+ if (compat) {
+ const struct git_hash_algo *algo = the_repository->hash_algo;
+
+ if (convert_object_file(&compat_buf, algo, compat,
+ buffer->buf, buffer->len, OBJ_TAG, 1))
+ goto out;
+ if (sign_buffer(&compat_buf, &compat_sig, keyid))
+ goto out;
+ add_header_signature(&compat_buf, &sig, algo);
+ strbuf_addbuf(&compat_buf, &compat_sig);
+ hash_object_file(compat, compat_buf.buf, compat_buf.len,
+ OBJ_TAG, compat_oid_buf);
+ *compat_oid = compat_oid_buf;
+ }
+
+ if (compat_sig.len)
+ add_header_signature(buffer, &compat_sig, compat);
+
+ strbuf_addbuf(buffer, &sig);
+ ret = 0;
+out:
+ strbuf_release(&sig);
+ strbuf_release(&compat_sig);
+ strbuf_release(&compat_buf);
+ return ret;
}
static const char tag_template[] =
N_("\nWrite a message for tag:\n %s\n"
- "Lines starting with '%c' will be ignored.\n");
+ "Lines starting with '%s' will be ignored.\n");
static const char tag_template_nocleanup[] =
N_("\nWrite a message for tag:\n %s\n"
- "Lines starting with '%c' will be kept; you may remove them"
+ "Lines starting with '%s' will be kept; you may remove them"
" yourself if you want to.\n");
-static int git_tag_config(const char *var, const char *value, void *cb)
+static int git_tag_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
- int status;
-
if (!strcmp(var, "tag.gpgsign")) {
config_sign_tag = git_config_bool(var, value);
return 0;
@@ -192,9 +215,6 @@ static int git_tag_config(const char *var, const char *value, void *cb)
return 0;
}
- status = git_gpg_config(var, value, cb);
- if (status)
- return status;
if (!strcmp(var, "tag.forcesignannotated")) {
force_sign_annotate = git_config_bool(var, value);
return 0;
@@ -202,7 +222,11 @@ static int git_tag_config(const char *var, const char *value, void *cb)
if (starts_with(var, "column."))
return git_column_config(var, value, "tag", &colopts);
- return git_color_default_config(var, value, cb);
+
+ if (git_color_config(var, value, cb) < 0)
+ return -1;
+
+ return git_default_config(var, value, ctx, cb);
}
static void write_tag_body(int fd, const struct object_id *oid)
@@ -213,7 +237,7 @@ static void write_tag_body(int fd, const struct object_id *oid)
struct strbuf payload = STRBUF_INIT;
struct strbuf signature = STRBUF_INIT;
- orig = buf = read_object_file(oid, &type, &size);
+ orig = buf = repo_read_object_file(the_repository, oid, &type, &size);
if (!buf)
return;
if (parse_signature(buf, size, &payload, &signature)) {
@@ -237,9 +261,11 @@ static void write_tag_body(int fd, const struct object_id *oid)
static int build_tag_object(struct strbuf *buf, int sign, struct object_id *result)
{
- if (sign && do_sign(buf) < 0)
+ struct object_id *compat_oid = NULL, compat_oid_buf;
+ if (sign && do_sign(buf, &compat_oid, &compat_oid_buf) < 0)
return error(_("unable to sign the tag"));
- if (write_object_file(buf->buf, buf->len, OBJ_TAG, result) < 0)
+ if (write_object_file_flags(buf->buf, buf->len, OBJ_TAG, result,
+ compat_oid, 0) < 0)
return error(_("unable to write tag file"));
return 0;
}
@@ -264,11 +290,10 @@ static const char message_advice_nested_tag[] =
static void create_tag(const struct object_id *object, const char *object_ref,
const char *tag,
struct strbuf *buf, struct create_tag_options *opt,
- struct object_id *prev, struct object_id *result)
+ struct object_id *prev, struct object_id *result, char *path)
{
enum object_type type;
struct strbuf header = STRBUF_INIT;
- char *path = NULL;
type = oid_object_info(the_repository, object, NULL);
if (type <= OBJ_NONE)
@@ -292,7 +317,6 @@ static void create_tag(const struct object_id *object, const char *object_ref,
int fd;
/* write the template message before editing: */
- path = git_pathdup("TAG_EDITMSG");
fd = xopen(path, O_CREAT | O_TRUNC | O_WRONLY, 0600);
if (opt->message_given) {
@@ -304,9 +328,11 @@ static void create_tag(const struct object_id *object, const char *object_ref,
struct strbuf buf = STRBUF_INIT;
strbuf_addch(&buf, '\n');
if (opt->cleanup_mode == CLEANUP_ALL)
- strbuf_commented_addf(&buf, _(tag_template), tag, comment_line_char);
+ strbuf_commented_addf(&buf, comment_line_str,
+ _(tag_template), tag, comment_line_str);
else
- strbuf_commented_addf(&buf, _(tag_template_nocleanup), tag, comment_line_char);
+ strbuf_commented_addf(&buf, comment_line_str,
+ _(tag_template_nocleanup), tag, comment_line_str);
write_or_die(fd, buf.buf, buf.len);
strbuf_release(&buf);
}
@@ -320,7 +346,8 @@ static void create_tag(const struct object_id *object, const char *object_ref,
}
if (opt->cleanup_mode != CLEANUP_NONE)
- strbuf_stripspace(buf, opt->cleanup_mode == CLEANUP_ALL);
+ strbuf_stripspace(buf,
+ opt->cleanup_mode == CLEANUP_ALL ? comment_line_str : NULL);
if (!opt->message_given && !buf->len)
die(_("no tag message?"));
@@ -334,10 +361,6 @@ static void create_tag(const struct object_id *object, const char *object_ref,
path);
exit(128);
}
- if (path) {
- unlink_or_warn(path);
- free(path);
- }
}
static void create_reflog_msg(const struct object_id *oid, struct strbuf *sb)
@@ -364,7 +387,7 @@ static void create_reflog_msg(const struct object_id *oid, struct strbuf *sb)
strbuf_addstr(sb, "object of unknown type");
break;
case OBJ_COMMIT:
- if ((buf = read_object_file(oid, &type, &size))) {
+ if ((buf = repo_read_object_file(the_repository, oid, &type, &size))) {
subject_len = find_commit_subject(buf, &subject_start);
strbuf_insert(sb, sb->len, subject_start, subject_len);
} else {
@@ -431,11 +454,12 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
int create_reflog = 0;
int annotate = 0, force = 0;
int cmdmode = 0, create_tag_object = 0;
- const char *msgfile = NULL, *keyid = NULL;
+ char *msgfile = NULL;
+ const char *keyid = NULL;
struct msg_arg msg = { .buf = STRBUF_INIT };
struct ref_transaction *transaction;
struct strbuf err = STRBUF_INIT;
- struct ref_filter filter;
+ struct ref_filter filter = REF_FILTER_INIT;
struct ref_sorting *sorting;
struct string_list sorting_options = STRING_LIST_INIT_DUP;
struct ref_format format = REF_FORMAT_INIT;
@@ -471,6 +495,8 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
OPT_WITHOUT(&filter.no_commit, N_("print only tags that don't contain the commit")),
OPT_MERGED(&filter, N_("print only tags that are merged")),
OPT_NO_MERGED(&filter, N_("print only tags that are not merged")),
+ OPT_BOOL(0, "omit-empty", &format.array_opts.omit_empty,
+ N_("do not output a newline after empty formatted refs")),
OPT_REF_SORT(&sorting_options),
{
OPTION_CALLBACK, 0, "points-at", &filter.points_at, N_("object"),
@@ -485,13 +511,19 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
};
int ret = 0;
const char *only_in_list = NULL;
+ char *path = NULL;
setup_ref_filter_porcelain_msg();
+ /*
+ * Try to set sort keys from config. If config does not set any,
+ * fall back on default (refname) sorting.
+ */
git_config(git_tag_config, &sorting_options);
+ if (!sorting_options.nr)
+ string_list_append(&sorting_options, "refname");
memset(&opt, 0, sizeof(opt));
- memset(&filter, 0, sizeof(filter));
filter.lines = -1;
opt.sign = -1;
@@ -535,7 +567,8 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
struct column_options copts;
memset(&copts, 0, sizeof(copts));
copts.padding = 2;
- run_column_filter(colopts, &copts);
+ if (run_column_filter(colopts, &copts))
+ die(_("could not start 'git column'"));
}
filter.name_patterns = argv;
ret = list_tags(&filter, sorting, &format);
@@ -591,7 +624,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
if (argc > 2)
die(_("too many arguments"));
- if (get_oid(object_ref, &object))
+ 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))
@@ -619,7 +652,9 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
if (create_tag_object) {
if (force_sign_annotate && !annotate)
opt.sign = 1;
- create_tag(&object, object_ref, tag, &buf, &opt, &prev, &object);
+ path = git_pathdup("TAG_EDITMSG");
+ create_tag(&object, object_ref, tag, &buf, &opt, &prev, &object,
+ path);
}
transaction = ref_transaction_begin(&err);
@@ -627,19 +662,30 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
ref_transaction_update(transaction, ref.buf, &object, &prev,
create_reflog ? REF_FORCE_CREATE_REFLOG : 0,
reflog_msg.buf, &err) ||
- ref_transaction_commit(transaction, &err))
+ ref_transaction_commit(transaction, &err)) {
+ if (path)
+ fprintf(stderr,
+ _("The tag message has been left in %s\n"),
+ path);
die("%s", err.buf);
+ }
+ if (path) {
+ unlink_or_warn(path);
+ free(path);
+ }
ref_transaction_free(transaction);
if (force && !is_null_oid(&prev) && !oideq(&prev, &object))
printf(_("Updated tag '%s' (was %s)\n"), tag,
- find_unique_abbrev(&prev, DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, &prev, DEFAULT_ABBREV));
cleanup:
ref_sorting_release(sorting);
+ ref_filter_clear(&filter);
strbuf_release(&buf);
strbuf_release(&ref);
strbuf_release(&reflog_msg);
strbuf_release(&msg.buf);
strbuf_release(&err);
+ free(msgfile);
return ret;
}
diff --git a/builtin/unpack-file.c b/builtin/unpack-file.c
index 5865222..c129e2b 100644
--- a/builtin/unpack-file.c
+++ b/builtin/unpack-file.c
@@ -1,6 +1,8 @@
#include "builtin.h"
#include "config.h"
-#include "object-store.h"
+#include "hex.h"
+#include "object-name.h"
+#include "object-store-ll.h"
static char *create_temp_file(struct object_id *oid)
{
@@ -10,7 +12,7 @@ static char *create_temp_file(struct object_id *oid)
unsigned long size;
int fd;
- buf = read_object_file(oid, &type, &size);
+ buf = repo_read_object_file(the_repository, oid, &type, &size);
if (!buf || type != OBJ_BLOB)
die("unable to read blob object %s", oid_to_hex(oid));
@@ -19,16 +21,17 @@ static char *create_temp_file(struct object_id *oid)
if (write_in_full(fd, buf, size) < 0)
die_errno("unable to write temp-file");
close(fd);
+ free(buf);
return path;
}
-int cmd_unpack_file(int argc, const char **argv, const char *prefix)
+int cmd_unpack_file(int argc, const char **argv, const char *prefix UNUSED)
{
struct object_id oid;
if (argc != 2 || !strcmp(argv[1], "-h"))
- usage("git unpack-file <sha1>");
- if (get_oid(argv[1], &oid))
+ usage("git unpack-file <blob>");
+ if (repo_get_oid(the_repository, argv[1], &oid))
die("Not a valid object name %s", argv[1]);
git_config(git_default_config, NULL);
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c
index 56d05e2..f1c85a0 100644
--- a/builtin/unpack-objects.c
+++ b/builtin/unpack-objects.c
@@ -1,16 +1,17 @@
#include "builtin.h"
-#include "cache.h"
#include "bulk-checkin.h"
#include "config.h"
-#include "object-store.h"
+#include "environment.h"
+#include "gettext.h"
+#include "git-zlib.h"
+#include "hex.h"
+#include "object-store-ll.h"
#include "object.h"
#include "delta.h"
#include "pack.h"
#include "blob.h"
-#include "commit.h"
-#include "tag.h"
-#include "tree.h"
-#include "tree-walk.h"
+#include "replace-object.h"
+#include "strbuf.h"
#include "progress.h"
#include "decorate.h"
#include "fsck.h"
@@ -97,15 +98,27 @@ static void use(int bytes)
display_throughput(progress, consumed_bytes);
}
+/*
+ * Decompress zstream from the standard input into a newly
+ * allocated buffer of specified size and return the buffer.
+ * The caller is responsible to free the returned buffer.
+ *
+ * But for dry_run mode, "get_data()" is only used to check the
+ * integrity of data, and the returned buffer is not used at all.
+ * Therefore, in dry_run mode, "get_data()" will release the small
+ * allocated buffer which is reused to hold temporary zstream output
+ * and return NULL instead of returning garbage data.
+ */
static void *get_data(unsigned long size)
{
git_zstream stream;
- void *buf = xmallocz(size);
+ unsigned long bufsize = dry_run && size > 8192 ? 8192 : size;
+ void *buf = xmallocz(bufsize);
memset(&stream, 0, sizeof(stream));
stream.next_out = buf;
- stream.avail_out = size;
+ stream.avail_out = bufsize;
stream.next_in = fill(1);
stream.avail_in = len;
git_inflate_init(&stream);
@@ -125,8 +138,17 @@ static void *get_data(unsigned long size)
}
stream.next_in = fill(1);
stream.avail_in = len;
+ if (dry_run) {
+ /* reuse the buffer in dry_run mode */
+ stream.next_out = buf;
+ stream.avail_out = bufsize > size - stream.total_out ?
+ size - stream.total_out :
+ bufsize;
+ }
}
git_inflate_end(&stream);
+ if (dry_run)
+ FREE_AND_NULL(buf);
return buf;
}
@@ -189,7 +211,8 @@ static void write_cached_object(struct object *obj, struct obj_buffer *obj_buf)
* Verify its reachability and validity recursively and write it out.
*/
static int check_object(struct object *obj, enum object_type type,
- void *data, struct fsck_options *options)
+ void *data UNUSED,
+ struct fsck_options *options UNUSED)
{
struct obj_buffer *obj_buf;
@@ -326,10 +349,70 @@ static void unpack_non_delta_entry(enum object_type type, unsigned long size,
{
void *buf = get_data(size);
- if (!dry_run && buf)
+ if (buf)
write_object(nr, type, buf, size);
- else
- free(buf);
+}
+
+struct input_zstream_data {
+ git_zstream *zstream;
+ unsigned char buf[8192];
+ int status;
+};
+
+static const void *feed_input_zstream(struct input_stream *in_stream,
+ unsigned long *readlen)
+{
+ struct input_zstream_data *data = in_stream->data;
+ git_zstream *zstream = data->zstream;
+ void *in = fill(1);
+
+ if (in_stream->is_finished) {
+ *readlen = 0;
+ return NULL;
+ }
+
+ zstream->next_out = data->buf;
+ zstream->avail_out = sizeof(data->buf);
+ zstream->next_in = in;
+ zstream->avail_in = len;
+
+ data->status = git_inflate(zstream, 0);
+
+ in_stream->is_finished = data->status != Z_OK;
+ use(len - zstream->avail_in);
+ *readlen = sizeof(data->buf) - zstream->avail_out;
+
+ return data->buf;
+}
+
+static void stream_blob(unsigned long size, unsigned nr)
+{
+ git_zstream zstream = { 0 };
+ struct input_zstream_data data = { 0 };
+ struct input_stream in_stream = {
+ .read = feed_input_zstream,
+ .data = &data,
+ };
+ struct obj_info *info = &obj_list[nr];
+
+ data.zstream = &zstream;
+ git_inflate_init(&zstream);
+
+ if (stream_loose_object(&in_stream, size, &info->oid))
+ die(_("failed to write object in stream"));
+
+ if (data.status != Z_STREAM_END)
+ die(_("inflate returned (%d)"), data.status);
+ git_inflate_end(&zstream);
+
+ if (strict) {
+ struct blob *blob = lookup_blob(the_repository, &info->oid);
+
+ if (!blob)
+ die(_("invalid blob object from stream"));
+ blob->object.flags |= FLAG_WRITTEN;
+ }
+ info->obj = NULL;
}
static int resolve_against_held(unsigned nr, const struct object_id *base,
@@ -359,11 +442,9 @@ static void unpack_delta_entry(enum object_type type, unsigned long delta_size,
oidread(&base_oid, fill(the_hash_algo->rawsz));
use(the_hash_algo->rawsz);
delta_data = get_data(delta_size);
- if (dry_run || !delta_data) {
- free(delta_data);
+ if (!delta_data)
return;
- }
- if (has_object_file(&base_oid))
+ if (repo_has_object_file(the_repository, &base_oid))
; /* Ok we have this one */
else if (resolve_against_held(nr, &base_oid,
delta_data, delta_size))
@@ -398,10 +479,8 @@ static void unpack_delta_entry(enum object_type type, unsigned long delta_size,
die("offset value out of bound for delta base object");
delta_data = get_data(delta_size);
- if (dry_run || !delta_data) {
- free(delta_data);
+ if (!delta_data)
return;
- }
lo = 0;
hi = nr;
while (lo < hi) {
@@ -431,7 +510,8 @@ static void unpack_delta_entry(enum object_type type, unsigned long delta_size,
if (resolve_against_held(nr, &base_oid, delta_data, delta_size))
return;
- base = read_object_file(&base_oid, &type, &base_size);
+ base = repo_read_object_file(the_repository, &base_oid, &type,
+ &base_size);
if (!base) {
error("failed to read delta-pack base object %s",
oid_to_hex(&base_oid));
@@ -468,9 +548,14 @@ static void unpack_one(unsigned nr)
}
switch (type) {
+ case OBJ_BLOB:
+ if (!dry_run && size > big_file_threshold) {
+ stream_blob(size, nr);
+ return;
+ }
+ /* fallthrough */
case OBJ_COMMIT:
case OBJ_TREE:
- case OBJ_BLOB:
case OBJ_TAG:
unpack_non_delta_entry(type, size, nr);
return;
@@ -516,12 +601,13 @@ static void unpack_all(void)
die("unresolved deltas left after unpacking");
}
-int cmd_unpack_objects(int argc, const char **argv, const char *prefix)
+int cmd_unpack_objects(int argc, const char **argv, const char *prefix UNUSED)
{
int i;
struct object_id oid;
+ git_hash_ctx tmp_ctx;
- read_replace_refs = 0;
+ disable_replace_refs();
git_config(git_default_config, NULL);
@@ -580,7 +666,9 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix)
the_hash_algo->init_fn(&ctx);
unpack_all();
the_hash_algo->update_fn(&ctx, buffer, offset);
- the_hash_algo->final_oid_fn(&oid, &ctx);
+ the_hash_algo->init_fn(&tmp_ctx);
+ the_hash_algo->clone_fn(&tmp_ctx, &ctx);
+ the_hash_algo->final_oid_fn(&oid, &tmp_ctx);
if (strict) {
write_rest();
if (fsck_finish(&fsck_options))
@@ -591,13 +679,7 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix)
use(the_hash_algo->rawsz);
/* Write the last part of the buffer to stdout */
- while (len) {
- int ret = xwrite(1, buffer + offset, len);
- if (ret <= 0)
- break;
- len -= ret;
- offset += ret;
- }
+ write_in_full(1, buffer + offset, len);
/* All done */
return has_errors;
diff --git a/builtin/update-index.c b/builtin/update-index.c
index b622499..7bcaa14 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -3,22 +3,32 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
+#define USE_THE_INDEX_VARIABLE
+#include "builtin.h"
#include "bulk-checkin.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hash.h"
+#include "hex.h"
#include "lockfile.h"
#include "quote.h"
#include "cache-tree.h"
#include "tree-walk.h"
-#include "builtin.h"
+#include "object-file.h"
#include "refs.h"
#include "resolve-undo.h"
#include "parse-options.h"
#include "pathspec.h"
#include "dir.h"
+#include "read-cache.h"
+#include "repository.h"
+#include "setup.h"
+#include "sparse-index.h"
#include "split-index.h"
+#include "symlinks.h"
#include "fsmonitor.h"
+#include "write-or-die.h"
/*
* Default to not allowing changes to the list of files. The
@@ -237,16 +247,16 @@ done:
static int mark_ce_flags(const char *path, int flag, int mark)
{
int namelen = strlen(path);
- int pos = cache_name_pos(path, namelen);
+ int pos = index_name_pos(&the_index, path, namelen);
if (0 <= pos) {
- mark_fsmonitor_invalid(&the_index, active_cache[pos]);
+ mark_fsmonitor_invalid(&the_index, the_index.cache[pos]);
if (mark)
- active_cache[pos]->ce_flags |= flag;
+ the_index.cache[pos]->ce_flags |= flag;
else
- active_cache[pos]->ce_flags &= ~flag;
- active_cache[pos]->ce_flags |= CE_UPDATE_IN_BASE;
+ the_index.cache[pos]->ce_flags &= ~flag;
+ the_index.cache[pos]->ce_flags |= CE_UPDATE_IN_BASE;
cache_tree_invalidate_path(&the_index, path);
- active_cache_changed |= CE_ENTRY_CHANGED;
+ the_index.cache_changed |= CE_ENTRY_CHANGED;
return 0;
}
return -1;
@@ -256,7 +266,7 @@ static int remove_one_path(const char *path)
{
if (!allow_remove)
return error("%s: does not exist and --remove not passed", path);
- if (remove_file_from_cache(path))
+ if (remove_file_from_index(&the_index, path))
return error("%s: cannot remove from the index", path);
return 0;
}
@@ -281,7 +291,7 @@ static int add_one_path(const struct cache_entry *old, const char *path, int len
struct cache_entry *ce;
/* Was the old index entry already up-to-date? */
- if (old && !ce_stage(old) && !ce_match_stat(old, st, 0))
+ if (old && !ce_stage(old) && !ie_match_stat(&the_index, old, st, 0))
return 0;
ce = make_empty_cache_entry(&the_index, len);
@@ -298,7 +308,7 @@ static int add_one_path(const struct cache_entry *old, const char *path, int len
}
option = allow_add ? ADD_CACHE_OK_TO_ADD : 0;
option |= allow_replace ? ADD_CACHE_OK_TO_REPLACE : 0;
- if (add_cache_entry(ce, option)) {
+ if (add_index_entry(&the_index, ce, option)) {
discard_cache_entry(ce);
return error("%s: cannot add to the index - missing --add option?", path);
}
@@ -331,11 +341,11 @@ static int add_one_path(const struct cache_entry *old, const char *path, int len
static int process_directory(const char *path, int len, struct stat *st)
{
struct object_id oid;
- int pos = cache_name_pos(path, len);
+ int pos = index_name_pos(&the_index, path, len);
/* Exact match: file or existing gitlink */
if (pos >= 0) {
- const struct cache_entry *ce = active_cache[pos];
+ const struct cache_entry *ce = the_index.cache[pos];
if (S_ISGITLINK(ce->ce_mode)) {
/* Do nothing to the index if there is no HEAD! */
@@ -350,8 +360,8 @@ static int process_directory(const char *path, int len, struct stat *st)
/* Inexact match: is there perhaps a subdirectory match? */
pos = -pos-1;
- while (pos < active_nr) {
- const struct cache_entry *ce = active_cache[pos++];
+ while (pos < the_index.cache_nr) {
+ const struct cache_entry *ce = the_index.cache[pos++];
if (strncmp(ce->name, path, len))
break;
@@ -381,8 +391,8 @@ static int process_path(const char *path, struct stat *st, int stat_errno)
if (has_symlink_leading_path(path, len))
return error("'%s' is beyond a symbolic link", path);
- pos = cache_name_pos(path, len);
- ce = pos < 0 ? NULL : active_cache[pos];
+ pos = index_name_pos(&the_index, path, len);
+ ce = pos < 0 ? NULL : the_index.cache[pos];
if (ce && ce_skip_worktree(ce)) {
/*
* working directory version is assumed "good"
@@ -390,7 +400,7 @@ static int process_path(const char *path, struct stat *st, int stat_errno)
* On the other hand, removing it from index should work
*/
if (!ignore_skip_worktree_entries && allow_remove &&
- remove_file_from_cache(path))
+ remove_file_from_index(&the_index, path))
return error("%s: cannot remove from the index", path);
return 0;
}
@@ -429,7 +439,7 @@ static int add_cacheinfo(unsigned int mode, const struct object_id *oid,
ce->ce_flags |= CE_VALID;
option = allow_add ? ADD_CACHE_OK_TO_ADD : 0;
option |= allow_replace ? ADD_CACHE_OK_TO_REPLACE : 0;
- if (add_cache_entry(ce, option))
+ if (add_index_entry(&the_index, ce, option))
return error("%s: cannot add to the index - missing --add option?",
path);
report("add '%s'", path);
@@ -441,11 +451,11 @@ static void chmod_path(char flip, const char *path)
int pos;
struct cache_entry *ce;
- pos = cache_name_pos(path, strlen(path));
+ pos = index_name_pos(&the_index, path, strlen(path));
if (pos < 0)
goto fail;
- ce = active_cache[pos];
- if (chmod_cache_entry(ce, flip) < 0)
+ ce = the_index.cache[pos];
+ if (chmod_index_entry(&the_index, ce, flip) < 0)
goto fail;
report("chmod %cx '%s'", flip, path);
@@ -488,7 +498,7 @@ static void update_one(const char *path)
}
if (force_remove) {
- if (remove_file_from_cache(path))
+ if (remove_file_from_index(&the_index, path))
die("git update-index: unable to remove %s", path);
report("remove '%s'", path);
return;
@@ -571,7 +581,7 @@ static void read_index_info(int nul_term_line)
if (!mode) {
/* mode == 0 means there is no such path -- remove */
- if (remove_file_from_cache(path_name))
+ if (remove_file_from_index(&the_index, path_name))
die("git update-index: unable to remove %s",
ptr);
}
@@ -599,9 +609,6 @@ static const char * const update_index_usage[] = {
NULL
};
-static struct object_id head_oid;
-static struct object_id merge_head_oid;
-
static struct cache_entry *read_one_ent(const char *which,
struct object_id *ent, const char *path,
int namelen, int stage)
@@ -632,84 +639,17 @@ static struct cache_entry *read_one_ent(const char *which,
static int unresolve_one(const char *path)
{
- int namelen = strlen(path);
- int pos;
- int ret = 0;
- struct cache_entry *ce_2 = NULL, *ce_3 = NULL;
-
- /* See if there is such entry in the index. */
- pos = cache_name_pos(path, namelen);
- if (0 <= pos) {
- /* already merged */
- pos = unmerge_cache_entry_at(pos);
- if (pos < active_nr) {
- const struct cache_entry *ce = active_cache[pos];
- if (ce_stage(ce) &&
- ce_namelen(ce) == namelen &&
- !memcmp(ce->name, path, namelen))
- return 0;
- }
- /* no resolve-undo information; fall back */
- } else {
- /* If there isn't, either it is unmerged, or
- * resolved as "removed" by mistake. We do not
- * want to do anything in the former case.
- */
- pos = -pos-1;
- if (pos < active_nr) {
- const struct cache_entry *ce = active_cache[pos];
- if (ce_namelen(ce) == namelen &&
- !memcmp(ce->name, path, namelen)) {
- fprintf(stderr,
- "%s: skipping still unmerged path.\n",
- path);
- goto free_return;
- }
- }
- }
-
- /* Grab blobs from given path from HEAD and MERGE_HEAD,
- * stuff HEAD version in stage #2,
- * stuff MERGE_HEAD version in stage #3.
- */
- ce_2 = read_one_ent("our", &head_oid, path, namelen, 2);
- ce_3 = read_one_ent("their", &merge_head_oid, path, namelen, 3);
-
- if (!ce_2 || !ce_3) {
- ret = -1;
- goto free_return;
- }
- if (oideq(&ce_2->oid, &ce_3->oid) &&
- ce_2->ce_mode == ce_3->ce_mode) {
- fprintf(stderr, "%s: identical in both, skipping.\n",
- path);
- goto free_return;
- }
-
- remove_file_from_cache(path);
- if (add_cache_entry(ce_2, ADD_CACHE_OK_TO_ADD)) {
- error("%s: cannot add our version to the index.", path);
- ret = -1;
- goto free_return;
- }
- if (!add_cache_entry(ce_3, ADD_CACHE_OK_TO_ADD))
- return 0;
- error("%s: cannot add their version to the index.", path);
- ret = -1;
- free_return:
- discard_cache_entry(ce_2);
- discard_cache_entry(ce_3);
- return ret;
-}
-
-static void read_head_pointers(void)
-{
- if (read_ref("HEAD", &head_oid))
- die("No HEAD -- no initial commit yet?");
- if (read_ref("MERGE_HEAD", &merge_head_oid)) {
- fprintf(stderr, "Not in the middle of a merge.\n");
- exit(0);
- }
+ struct string_list_item *item;
+ int res = 0;
+
+ if (!the_index.resolve_undo)
+ return res;
+ item = string_list_lookup(the_index.resolve_undo, path);
+ if (!item)
+ return res; /* no resolve-undo record for the path */
+ res = unmerge_index_entry(&the_index, path, item->util, 0);
+ FREE_AND_NULL(item->util);
+ return res;
}
static int do_unresolve(int ac, const char **av,
@@ -718,11 +658,6 @@ static int do_unresolve(int ac, const char **av,
int i;
int err = 0;
- /* Read HEAD and MERGE_HEAD; if MERGE_HEAD does not exist, we
- * are not doing a merge, so exit with success status.
- */
- read_head_pointers();
-
for (i = 1; i < ac; i++) {
const char *arg = av[i];
char *p = prefix_path(prefix, prefix_length, arg);
@@ -732,7 +667,7 @@ static int do_unresolve(int ac, const char **av,
return err;
}
-static int do_reupdate(int ac, const char **av,
+static int do_reupdate(const char **paths,
const char *prefix)
{
/* Read HEAD and run update-index on paths that are
@@ -741,10 +676,11 @@ static int do_reupdate(int ac, const char **av,
int pos;
int has_head = 1;
struct pathspec pathspec;
+ struct object_id head_oid;
parse_pathspec(&pathspec, 0,
PATHSPEC_PREFER_CWD,
- prefix, av + 1);
+ prefix, paths);
if (read_ref("HEAD", &head_oid))
/* If there is no HEAD, that means it is an initial
@@ -752,8 +688,8 @@ static int do_reupdate(int ac, const char **av,
*/
has_head = 0;
redo:
- for (pos = 0; pos < active_nr; pos++) {
- const struct cache_entry *ce = active_cache[pos];
+ for (pos = 0; pos < the_index.cache_nr; pos++) {
+ const struct cache_entry *ce = the_index.cache[pos];
struct cache_entry *old = NULL;
int save_nr;
char *path;
@@ -782,12 +718,12 @@ static int do_reupdate(int ac, const char **av,
* path anymore, in which case, under 'allow_remove',
* or worse yet 'allow_replace', active_nr may decrease.
*/
- save_nr = active_nr;
+ save_nr = the_index.cache_nr;
path = xstrdup(ce->name);
update_one(path);
free(path);
discard_cache_entry(old);
- if (save_nr != active_nr)
+ if (save_nr != the_index.cache_nr)
goto redo;
}
clear_pathspec(&pathspec);
@@ -802,18 +738,19 @@ struct refresh_params {
static int refresh(struct refresh_params *o, unsigned int flag)
{
setup_work_tree();
- read_cache();
- *o->has_errors |= refresh_cache(o->flags | flag);
+ repo_read_index(the_repository);
+ *o->has_errors |= refresh_index(&the_index, o->flags | flag, NULL,
+ NULL, NULL);
if (has_racy_timestamp(&the_index)) {
/*
* Even if nothing else has changed, updating the file
* increases the chance that racy timestamps become
* non-racy, helping future run-time performance.
* We do that even in case of "errors" returned by
- * refresh_cache() as these are no actual errors.
+ * refresh_index() as these are no actual errors.
* cmd_status() does the same.
*/
- active_cache_changed |= SOMETHING_CHANGED;
+ the_index.cache_changed |= SOMETHING_CHANGED;
}
return 0;
}
@@ -845,12 +782,12 @@ static int chmod_callback(const struct option *opt,
return 0;
}
-static int resolve_undo_clear_callback(const struct option *opt,
+static int resolve_undo_clear_callback(const struct option *opt UNUSED,
const char *arg, int unset)
{
BUG_ON_OPT_NEG(unset);
BUG_ON_OPT_ARG(arg);
- resolve_undo_clear();
+ resolve_undo_clear_index(&the_index);
return 0;
}
@@ -879,7 +816,7 @@ static int parse_new_style_cacheinfo(const char *arg,
}
static enum parse_opt_result cacheinfo_callback(
- struct parse_opt_ctx_t *ctx, const struct option *opt,
+ struct parse_opt_ctx_t *ctx, const struct option *opt UNUSED,
const char *arg, int unset)
{
struct object_id oid;
@@ -951,7 +888,7 @@ static enum parse_opt_result unresolve_callback(
*has_errors = do_unresolve(ctx->argc, ctx->argv,
prefix, prefix ? strlen(prefix) : 0);
if (*has_errors)
- active_cache_changed = 0;
+ the_index.cache_changed = 0;
ctx->argv += ctx->argc - 1;
ctx->argc = 1;
@@ -970,9 +907,9 @@ static enum parse_opt_result reupdate_callback(
/* consume remaining arguments. */
setup_work_tree();
- *has_errors = do_reupdate(ctx->argc, ctx->argv, prefix);
+ *has_errors = do_reupdate(ctx->argv + 1, prefix);
if (*has_errors)
- active_cache_changed = 0;
+ the_index.cache_changed = 0;
ctx->argv += ctx->argc - 1;
ctx->argc = 1;
@@ -1079,6 +1016,8 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
resolve_undo_clear_callback),
OPT_INTEGER(0, "index-version", &preferred_index_format,
N_("write index in this format")),
+ OPT_SET_INT(0, "show-index-version", &preferred_index_format,
+ N_("report on-disk index format version"), -1),
OPT_BOOL(0, "split-index", &split_index,
N_("enable or disable split index")),
OPT_BOOL(0, "untracked-cache", &untracked_cache,
@@ -1109,11 +1048,11 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
the_repository->settings.command_requires_full_index = 0;
/* we will diagnose later if it turns out that we need to update it */
- newfd = hold_locked_index(&lock_file, 0);
+ newfd = repo_hold_locked_index(the_repository, &lock_file, 0);
if (newfd < 0)
lock_error = errno;
- entries = read_cache();
+ entries = repo_read_index(the_repository);
if (entries < 0)
die("cache corrupted");
@@ -1171,15 +1110,20 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
getline_fn = nul_term_line ? strbuf_getline_nul : strbuf_getline_lf;
if (preferred_index_format) {
- if (preferred_index_format < INDEX_FORMAT_LB ||
- INDEX_FORMAT_UB < preferred_index_format)
+ if (preferred_index_format < 0) {
+ printf(_("%d\n"), the_index.version);
+ } else if (preferred_index_format < INDEX_FORMAT_LB ||
+ INDEX_FORMAT_UB < preferred_index_format) {
die("index-version %d not in range: %d..%d",
preferred_index_format,
INDEX_FORMAT_LB, INDEX_FORMAT_UB);
-
- if (the_index.version != preferred_index_format)
- active_cache_changed |= SOMETHING_CHANGED;
- the_index.version = preferred_index_format;
+ } else {
+ if (the_index.version != preferred_index_format)
+ the_index.cache_changed |= SOMETHING_CHANGED;
+ report(_("index-version: was %d, set to %d"),
+ the_index.version, preferred_index_format);
+ the_index.version = preferred_index_format;
+ }
}
if (read_from_stdin) {
@@ -1290,7 +1234,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
report(_("fsmonitor disabled"));
}
- if (active_cache_changed || force_write) {
+ if (the_index.cache_changed || force_write) {
if (newfd < 0) {
if (refresh_args.flags & REFRESH_QUIET)
exit(128);
diff --git a/builtin/update-ref.c b/builtin/update-ref.c
index a84e7b4..e46afbc 100644
--- a/builtin/update-ref.c
+++ b/builtin/update-ref.c
@@ -1,14 +1,16 @@
-#include "cache.h"
+#include "builtin.h"
#include "config.h"
+#include "gettext.h"
+#include "hash.h"
#include "refs.h"
-#include "builtin.h"
+#include "object-name.h"
#include "parse-options.h"
#include "quote.h"
-#include "strvec.h"
+#include "repository.h"
static const char * const git_update_ref_usage[] = {
- N_("git update-ref [<options>] -d <refname> [<old-val>]"),
- N_("git update-ref [<options>] <refname> <new-val> [<old-val>]"),
+ N_("git update-ref [<options>] -d <refname> [<old-oid>]"),
+ N_("git update-ref [<options>] <refname> <new-oid> [<old-oid>]"),
N_("git update-ref [<options>] --stdin [-z]"),
NULL
};
@@ -75,14 +77,14 @@ static char *parse_refname(const char **next)
}
/*
- * The value being parsed is <oldvalue> (as opposed to <newvalue>; the
+ * The value being parsed is <old-oid> (as opposed to <new-oid>; the
* difference affects which error messages are generated):
*/
#define PARSE_SHA1_OLD 0x01
/*
* For backwards compatibility, accept an empty string for update's
- * <newvalue> in binary mode to be equivalent to specifying zeros.
+ * <new-oid> in binary mode to be equivalent to specifying zeros.
*/
#define PARSE_SHA1_ALLOW_EMPTY 0x02
@@ -116,7 +118,7 @@ static int parse_next_oid(const char **next, const char *end,
(*next)++;
*next = parse_arg(*next, &arg);
if (arg.len) {
- if (get_oid(arg.buf, oid))
+ if (repo_get_oid(the_repository, arg.buf, oid))
goto invalid;
} else {
/* Without -z, an empty value means all zeros: */
@@ -134,11 +136,11 @@ static int parse_next_oid(const char **next, const char *end,
*next += arg.len;
if (arg.len) {
- if (get_oid(arg.buf, oid))
+ if (repo_get_oid(the_repository, arg.buf, oid))
goto invalid;
} else if (flags & PARSE_SHA1_ALLOW_EMPTY) {
/* With -z, treat an empty value as all zeros: */
- warning("%s %s: missing <newvalue>, treating as zero",
+ warning("%s %s: missing <new-oid>, treating as zero",
command, refname);
oidclr(oid);
} else {
@@ -156,14 +158,14 @@ static int parse_next_oid(const char **next, const char *end,
invalid:
die(flags & PARSE_SHA1_OLD ?
- "%s %s: invalid <oldvalue>: %s" :
- "%s %s: invalid <newvalue>: %s",
+ "%s %s: invalid <old-oid>: %s" :
+ "%s %s: invalid <new-oid>: %s",
command, refname, arg.buf);
eof:
die(flags & PARSE_SHA1_OLD ?
- "%s %s: unexpected end of input when reading <oldvalue>" :
- "%s %s: unexpected end of input when reading <newvalue>",
+ "%s %s: unexpected end of input when reading <old-oid>" :
+ "%s %s: unexpected end of input when reading <new-oid>",
command, refname);
}
@@ -192,7 +194,7 @@ static void parse_cmd_update(struct ref_transaction *transaction,
if (parse_next_oid(&next, end, &new_oid, "update", refname,
PARSE_SHA1_ALLOW_EMPTY))
- die("update %s: missing <newvalue>", refname);
+ die("update %s: missing <new-oid>", refname);
have_old = !parse_next_oid(&next, end, &old_oid, "update", refname,
PARSE_SHA1_OLD);
@@ -223,10 +225,10 @@ static void parse_cmd_create(struct ref_transaction *transaction,
die("create: missing <ref>");
if (parse_next_oid(&next, end, &new_oid, "create", refname, 0))
- die("create %s: missing <newvalue>", refname);
+ die("create %s: missing <new-oid>", refname);
if (is_null_oid(&new_oid))
- die("create %s: zero <newvalue>", refname);
+ die("create %s: zero <new-oid>", refname);
if (*next != line_termination)
die("create %s: extra input: %s", refname, next);
@@ -258,7 +260,7 @@ static void parse_cmd_delete(struct ref_transaction *transaction,
have_old = 0;
} else {
if (is_null_oid(&old_oid))
- die("delete %s: zero <oldvalue>", refname);
+ die("delete %s: zero <old-oid>", refname);
have_old = 1;
}
@@ -308,8 +310,8 @@ static void report_ok(const char *command)
fflush(stdout);
}
-static void parse_cmd_option(struct ref_transaction *transaction,
- const char *next, const char *end)
+static void parse_cmd_option(struct ref_transaction *transaction UNUSED,
+ const char *next, const char *end UNUSED)
{
const char *rest;
if (skip_prefix(next, "no-deref", &rest) && *rest == line_termination)
@@ -318,8 +320,8 @@ static void parse_cmd_option(struct ref_transaction *transaction,
die("option unknown: %s", next);
}
-static void parse_cmd_start(struct ref_transaction *transaction,
- const char *next, const char *end)
+static void parse_cmd_start(struct ref_transaction *transaction UNUSED,
+ const char *next, const char *end UNUSED)
{
if (*next != line_termination)
die("start: extra input: %s", next);
@@ -327,7 +329,7 @@ static void parse_cmd_start(struct ref_transaction *transaction,
}
static void parse_cmd_prepare(struct ref_transaction *transaction,
- const char *next, const char *end)
+ const char *next, const char *end UNUSED)
{
struct strbuf error = STRBUF_INIT;
if (*next != line_termination)
@@ -338,7 +340,7 @@ static void parse_cmd_prepare(struct ref_transaction *transaction,
}
static void parse_cmd_abort(struct ref_transaction *transaction,
- const char *next, const char *end)
+ const char *next, const char *end UNUSED)
{
struct strbuf error = STRBUF_INIT;
if (*next != line_termination)
@@ -349,7 +351,7 @@ static void parse_cmd_abort(struct ref_transaction *transaction,
}
static void parse_cmd_commit(struct ref_transaction *transaction,
- const char *next, const char *end)
+ const char *next, const char *end UNUSED)
{
struct strbuf error = STRBUF_INIT;
if (*next != line_termination)
@@ -549,7 +551,7 @@ int cmd_update_ref(int argc, const char **argv, const char *prefix)
refname = argv[0];
value = argv[1];
oldval = argv[2];
- if (get_oid(value, &oid))
+ if (repo_get_oid(the_repository, value, &oid))
die("%s: not a valid SHA1", value);
}
@@ -560,7 +562,7 @@ int cmd_update_ref(int argc, const char **argv, const char *prefix)
* must not already exist:
*/
oidclr(&oldoid);
- else if (get_oid(oldval, &oldoid))
+ else if (repo_get_oid(the_repository, oldval, &oldoid))
die("%s: not a valid old SHA1", oldval);
}
diff --git a/builtin/update-server-info.c b/builtin/update-server-info.c
index 880fffe..1dc3971 100644
--- a/builtin/update-server-info.c
+++ b/builtin/update-server-info.c
@@ -1,10 +1,11 @@
-#include "cache.h"
-#include "config.h"
#include "builtin.h"
+#include "config.h"
+#include "gettext.h"
#include "parse-options.h"
+#include "server-info.h"
static const char * const update_server_info_usage[] = {
- "git update-server-info [--force]",
+ "git update-server-info [-f | --force]",
NULL
};
diff --git a/builtin/upload-archive.c b/builtin/upload-archive.c
index 98d028d..1b09e5e 100644
--- a/builtin/upload-archive.c
+++ b/builtin/upload-archive.c
@@ -1,16 +1,17 @@
/*
* Copyright (c) 2006 Franck Bui-Huu
*/
-#include "cache.h"
#include "builtin.h"
#include "archive.h"
+#include "path.h"
#include "pkt-line.h"
#include "sideband.h"
+#include "repository.h"
#include "run-command.h"
#include "strvec.h"
static const char upload_archive_usage[] =
- "git upload-archive <repo>";
+ "git upload-archive <repository>";
static const char deadchild[] =
"git upload-archive: archiver died with error";
@@ -79,6 +80,8 @@ int cmd_upload_archive(int argc, const char **argv, const char *prefix)
{
struct child_process writer = CHILD_PROCESS_INIT;
+ BUG_ON_NON_EMPTY_PREFIX(prefix);
+
if (argc == 2 && !strcmp(argv[1], "-h"))
usage(upload_archive_usage);
diff --git a/builtin/upload-pack.c b/builtin/upload-pack.c
index 125af53..15afb97 100644
--- a/builtin/upload-pack.c
+++ b/builtin/upload-pack.c
@@ -1,14 +1,18 @@
-#include "cache.h"
#include "builtin.h"
#include "exec-cmd.h"
+#include "gettext.h"
#include "pkt-line.h"
#include "parse-options.h"
+#include "path.h"
#include "protocol.h"
+#include "replace-object.h"
#include "upload-pack.h"
#include "serve.h"
+#include "commit.h"
static const char * const upload_pack_usage[] = {
- N_("git upload-pack [<options>] <dir>"),
+ N_("git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+ " [--advertise-refs] <directory>"),
NULL
};
@@ -33,7 +37,8 @@ int cmd_upload_pack(int argc, const char **argv, const char *prefix)
};
packet_trace_identity("upload-pack");
- read_replace_refs = 0;
+ disable_replace_refs();
+ save_commit_buffer = 0;
argc = parse_options(argc, argv, prefix, options, upload_pack_usage, 0);
diff --git a/builtin/var.c b/builtin/var.c
index 491db27..cf55672 100644
--- a/builtin/var.c
+++ b/builtin/var.c
@@ -4,84 +4,216 @@
* Copyright (C) Eric Biederman, 2005
*/
#include "builtin.h"
+#include "attr.h"
#include "config.h"
+#include "editor.h"
+#include "ident.h"
+#include "pager.h"
#include "refs.h"
+#include "path.h"
+#include "strbuf.h"
static const char var_usage[] = "git var (-l | <variable>)";
-static const char *editor(int flag)
+static char *committer(int ident_flag)
{
- const char *pgm = git_editor();
+ return xstrdup_or_null(git_committer_info(ident_flag));
+}
- if (!pgm && flag & IDENT_STRICT)
- die("Terminal is dumb, but EDITOR unset");
+static char *author(int ident_flag)
+{
+ return xstrdup_or_null(git_author_info(ident_flag));
+}
- return pgm;
+static char *editor(int ident_flag UNUSED)
+{
+ return xstrdup_or_null(git_editor());
}
-static const char *pager(int flag)
+static char *sequence_editor(int ident_flag UNUSED)
+{
+ return xstrdup_or_null(git_sequence_editor());
+}
+
+static char *pager(int ident_flag UNUSED)
{
const char *pgm = git_pager(1);
if (!pgm)
pgm = "cat";
- return pgm;
+ return xstrdup(pgm);
+}
+
+static char *default_branch(int ident_flag UNUSED)
+{
+ return xstrdup_or_null(git_default_branch_name(1));
+}
+
+static char *shell_path(int ident_flag UNUSED)
+{
+ return xstrdup(SHELL_PATH);
+}
+
+static char *git_attr_val_system(int ident_flag UNUSED)
+{
+ if (git_attr_system_is_enabled()) {
+ char *file = xstrdup(git_attr_system_file());
+ normalize_path_copy(file, file);
+ return file;
+ }
+ return NULL;
}
-static const char *default_branch(int flag)
+static char *git_attr_val_global(int ident_flag UNUSED)
{
- return git_default_branch_name(1);
+ char *file = xstrdup_or_null(git_attr_global_file());
+ if (file) {
+ normalize_path_copy(file, file);
+ return file;
+ }
+ return NULL;
+}
+
+static char *git_config_val_system(int ident_flag UNUSED)
+{
+ if (git_config_system()) {
+ char *file = git_system_config();
+ normalize_path_copy(file, file);
+ return file;
+ }
+ return NULL;
+}
+
+static char *git_config_val_global(int ident_flag UNUSED)
+{
+ struct strbuf buf = STRBUF_INIT;
+ char *user, *xdg;
+ size_t unused;
+
+ git_global_config_paths(&user, &xdg);
+ if (xdg && *xdg) {
+ normalize_path_copy(xdg, xdg);
+ strbuf_addf(&buf, "%s\n", xdg);
+ }
+ if (user && *user) {
+ normalize_path_copy(user, user);
+ strbuf_addf(&buf, "%s\n", user);
+ }
+ free(xdg);
+ free(user);
+ strbuf_trim_trailing_newline(&buf);
+ if (buf.len == 0) {
+ strbuf_release(&buf);
+ return NULL;
+ }
+ return strbuf_detach(&buf, &unused);
}
struct git_var {
const char *name;
- const char *(*read)(int);
+ char *(*read)(int);
+ int multivalued;
};
static struct git_var git_vars[] = {
- { "GIT_COMMITTER_IDENT", git_committer_info },
- { "GIT_AUTHOR_IDENT", git_author_info },
- { "GIT_EDITOR", editor },
- { "GIT_PAGER", pager },
- { "GIT_DEFAULT_BRANCH", default_branch },
- { "", NULL },
+ {
+ .name = "GIT_COMMITTER_IDENT",
+ .read = committer,
+ },
+ {
+ .name = "GIT_AUTHOR_IDENT",
+ .read = author,
+ },
+ {
+ .name = "GIT_EDITOR",
+ .read = editor,
+ },
+ {
+ .name = "GIT_SEQUENCE_EDITOR",
+ .read = sequence_editor,
+ },
+ {
+ .name = "GIT_PAGER",
+ .read = pager,
+ },
+ {
+ .name = "GIT_DEFAULT_BRANCH",
+ .read = default_branch,
+ },
+ {
+ .name = "GIT_SHELL_PATH",
+ .read = shell_path,
+ },
+ {
+ .name = "GIT_ATTR_SYSTEM",
+ .read = git_attr_val_system,
+ },
+ {
+ .name = "GIT_ATTR_GLOBAL",
+ .read = git_attr_val_global,
+ },
+ {
+ .name = "GIT_CONFIG_SYSTEM",
+ .read = git_config_val_system,
+ },
+ {
+ .name = "GIT_CONFIG_GLOBAL",
+ .read = git_config_val_global,
+ .multivalued = 1,
+ },
+ {
+ .name = "",
+ .read = NULL,
+ },
};
static void list_vars(void)
{
struct git_var *ptr;
- const char *val;
+ char *val;
for (ptr = git_vars; ptr->read; ptr++)
- if ((val = ptr->read(0)))
- printf("%s=%s\n", ptr->name, val);
+ if ((val = ptr->read(0))) {
+ if (ptr->multivalued && *val) {
+ struct string_list list = STRING_LIST_INIT_DUP;
+ int i;
+
+ string_list_split(&list, val, '\n', -1);
+ for (i = 0; i < list.nr; i++)
+ printf("%s=%s\n", ptr->name, list.items[i].string);
+ string_list_clear(&list, 0);
+ } else {
+ printf("%s=%s\n", ptr->name, val);
+ }
+ free(val);
+ }
}
-static const char *read_var(const char *var)
+static const struct git_var *get_git_var(const char *var)
{
struct git_var *ptr;
- const char *val;
- val = NULL;
for (ptr = git_vars; ptr->read; ptr++) {
if (strcmp(var, ptr->name) == 0) {
- val = ptr->read(IDENT_STRICT);
- break;
+ return ptr;
}
}
- return val;
+ return NULL;
}
-static int show_config(const char *var, const char *value, void *cb)
+static int show_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (value)
printf("%s=%s\n", var, value);
else
printf("%s\n", var);
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
-int cmd_var(int argc, const char **argv, const char *prefix)
+int cmd_var(int argc, const char **argv, const char *prefix UNUSED)
{
- const char *val = NULL;
+ const struct git_var *git_var;
+ char *val;
+
if (argc != 2)
usage(var_usage);
@@ -91,11 +223,17 @@ int cmd_var(int argc, const char **argv, const char *prefix)
return 0;
}
git_config(git_default_config, NULL);
- val = read_var(argv[1]);
- if (!val)
+
+ git_var = get_git_var(argv[1]);
+ if (!git_var)
usage(var_usage);
+ val = git_var->read(IDENT_STRICT);
+ if (!val)
+ return 1;
+
printf("%s\n", val);
+ free(val);
return 0;
}
diff --git a/builtin/verify-commit.c b/builtin/verify-commit.c
index 40c69a0..0d2b9ae 100644
--- a/builtin/verify-commit.c
+++ b/builtin/verify-commit.c
@@ -5,18 +5,17 @@
*
* Based on git-verify-tag
*/
-#include "cache.h"
-#include "config.h"
#include "builtin.h"
-#include "object-store.h"
+#include "config.h"
+#include "gettext.h"
+#include "object-name.h"
#include "repository.h"
#include "commit.h"
-#include "run-command.h"
#include "parse-options.h"
#include "gpg-interface.h"
static const char * const verify_commit_usage[] = {
- N_("git verify-commit [-v | --verbose] <commit>..."),
+ N_("git verify-commit [-v | --verbose] [--raw] <commit>..."),
NULL
};
@@ -39,7 +38,7 @@ static int verify_commit(const char *name, unsigned flags)
struct object_id oid;
struct object *obj;
- if (get_oid(name, &oid))
+ if (repo_get_oid(the_repository, name, &oid))
return error("commit '%s' not found.", name);
obj = parse_object(the_repository, &oid);
@@ -52,14 +51,6 @@ static int verify_commit(const char *name, unsigned flags)
return run_gpg_verify((struct commit *)obj, flags);
}
-static int git_verify_commit_config(const char *var, const char *value, void *cb)
-{
- int status = git_gpg_config(var, value, cb);
- if (status)
- return status;
- return git_default_config(var, value, cb);
-}
-
int cmd_verify_commit(int argc, const char **argv, const char *prefix)
{
int i = 1, verbose = 0, had_error = 0;
@@ -70,7 +61,7 @@ int cmd_verify_commit(int argc, const char **argv, const char *prefix)
OPT_END()
};
- git_config(git_verify_commit_config, NULL);
+ git_config(git_default_config, NULL);
argc = parse_options(argc, argv, prefix, verify_commit_options,
verify_commit_usage, PARSE_OPT_KEEP_ARGV0);
diff --git a/builtin/verify-pack.c b/builtin/verify-pack.c
index 05c5213..011dddd 100644
--- a/builtin/verify-pack.c
+++ b/builtin/verify-pack.c
@@ -1,8 +1,9 @@
#include "builtin.h"
-#include "cache.h"
#include "config.h"
+#include "gettext.h"
#include "run-command.h"
#include "parse-options.h"
+#include "strbuf.h"
#define VERIFY_PACK_VERBOSE 01
#define VERIFY_PACK_STAT_ONLY 02
@@ -56,7 +57,7 @@ static int verify_one_pack(const char *path, unsigned int flags, const char *has
}
static const char * const verify_pack_usage[] = {
- N_("git verify-pack [-v | --verbose] [-s | --stat-only] <pack>..."),
+ N_("git verify-pack [-v | --verbose] [-s | --stat-only] [--] <pack>.idx..."),
NULL
};
diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c
index f45136a..c731e2f 100644
--- a/builtin/verify-tag.c
+++ b/builtin/verify-tag.c
@@ -5,28 +5,20 @@
*
* Based on git-verify-tag.sh
*/
-#include "cache.h"
-#include "config.h"
#include "builtin.h"
+#include "config.h"
+#include "gettext.h"
#include "tag.h"
-#include "run-command.h"
+#include "object-name.h"
#include "parse-options.h"
#include "gpg-interface.h"
#include "ref-filter.h"
static const char * const verify_tag_usage[] = {
- N_("git verify-tag [-v | --verbose] [--format=<format>] <tag>..."),
+ N_("git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."),
NULL
};
-static int git_verify_tag_config(const char *var, const char *value, void *cb)
-{
- int status = git_gpg_config(var, value, cb);
- if (status)
- return status;
- return git_default_config(var, value, cb);
-}
-
int cmd_verify_tag(int argc, const char **argv, const char *prefix)
{
int i = 1, verbose = 0, had_error = 0;
@@ -39,7 +31,7 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix)
OPT_END()
};
- git_config(git_verify_tag_config, NULL);
+ git_config(git_default_config, NULL);
argc = parse_options(argc, argv, prefix, verify_tag_options,
verify_tag_usage, PARSE_OPT_KEEP_ARGV0);
@@ -60,7 +52,7 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix)
struct object_id oid;
const char *name = argv[i++];
- if (get_oid(name, &oid)) {
+ if (repo_get_oid(the_repository, name, &oid)) {
had_error = !!error("tag '%s' not found.", name);
continue;
}
diff --git a/builtin/worktree.c b/builtin/worktree.c
index cd62eef..7c6c725 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -1,12 +1,23 @@
-#include "cache.h"
+#include "builtin.h"
+#include "abspath.h"
+#include "advice.h"
#include "checkout.h"
#include "config.h"
-#include "builtin.h"
+#include "copy.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-file.h"
+#include "object-name.h"
#include "parse-options.h"
+#include "path.h"
#include "strvec.h"
#include "branch.h"
+#include "read-cache-ll.h"
#include "refs.h"
+#include "remote.h"
+#include "repository.h"
#include "run-command.h"
#include "hook.h"
#include "sigchain.h"
@@ -15,15 +26,91 @@
#include "worktree.h"
#include "quote.h"
-static const char * const worktree_usage[] = {
- N_("git worktree add [<options>] <path> [<commit-ish>]"),
- N_("git worktree list [<options>]"),
- N_("git worktree lock [<options>] <path>"),
- N_("git worktree move <worktree> <new-path>"),
- N_("git worktree prune [<options>]"),
- N_("git worktree remove [<options>] <worktree>"),
- N_("git worktree repair [<path>...]"),
- N_("git worktree unlock <path>"),
+#define BUILTIN_WORKTREE_ADD_USAGE \
+ N_("git worktree add [-f] [--detach] [--checkout] [--lock [--reason <string>]]\n" \
+ " [--orphan] [(-b | -B) <new-branch>] <path> [<commit-ish>]")
+
+#define BUILTIN_WORKTREE_LIST_USAGE \
+ N_("git worktree list [-v | --porcelain [-z]]")
+#define BUILTIN_WORKTREE_LOCK_USAGE \
+ N_("git worktree lock [--reason <string>] <worktree>")
+#define BUILTIN_WORKTREE_MOVE_USAGE \
+ N_("git worktree move <worktree> <new-path>")
+#define BUILTIN_WORKTREE_PRUNE_USAGE \
+ N_("git worktree prune [-n] [-v] [--expire <expire>]")
+#define BUILTIN_WORKTREE_REMOVE_USAGE \
+ N_("git worktree remove [-f] <worktree>")
+#define BUILTIN_WORKTREE_REPAIR_USAGE \
+ N_("git worktree repair [<path>...]")
+#define BUILTIN_WORKTREE_UNLOCK_USAGE \
+ N_("git worktree unlock <worktree>")
+
+#define WORKTREE_ADD_DWIM_ORPHAN_INFER_TEXT \
+ _("No possible source branch, inferring '--orphan'")
+
+#define WORKTREE_ADD_ORPHAN_WITH_DASH_B_HINT_TEXT \
+ _("If you meant to create a worktree containing a new unborn branch\n" \
+ "(branch with no commits) for this repository, you can do so\n" \
+ "using the --orphan flag:\n" \
+ "\n" \
+ " git worktree add --orphan -b %s %s\n")
+
+#define WORKTREE_ADD_ORPHAN_NO_DASH_B_HINT_TEXT \
+ _("If you meant to create a worktree containing a new unborn branch\n" \
+ "(branch with no commits) for this repository, you can do so\n" \
+ "using the --orphan flag:\n" \
+ "\n" \
+ " git worktree add --orphan %s\n")
+
+static const char * const git_worktree_usage[] = {
+ BUILTIN_WORKTREE_ADD_USAGE,
+ BUILTIN_WORKTREE_LIST_USAGE,
+ BUILTIN_WORKTREE_LOCK_USAGE,
+ BUILTIN_WORKTREE_MOVE_USAGE,
+ BUILTIN_WORKTREE_PRUNE_USAGE,
+ BUILTIN_WORKTREE_REMOVE_USAGE,
+ BUILTIN_WORKTREE_REPAIR_USAGE,
+ BUILTIN_WORKTREE_UNLOCK_USAGE,
+ NULL
+};
+
+static const char * const git_worktree_add_usage[] = {
+ BUILTIN_WORKTREE_ADD_USAGE,
+ NULL,
+};
+
+static const char * const git_worktree_list_usage[] = {
+ BUILTIN_WORKTREE_LIST_USAGE,
+ NULL
+};
+
+static const char * const git_worktree_lock_usage[] = {
+ BUILTIN_WORKTREE_LOCK_USAGE,
+ NULL
+};
+
+static const char * const git_worktree_move_usage[] = {
+ BUILTIN_WORKTREE_MOVE_USAGE,
+ NULL
+};
+
+static const char * const git_worktree_prune_usage[] = {
+ BUILTIN_WORKTREE_PRUNE_USAGE,
+ NULL
+};
+
+static const char * const git_worktree_remove_usage[] = {
+ BUILTIN_WORKTREE_REMOVE_USAGE,
+ NULL
+};
+
+static const char * const git_worktree_repair_usage[] = {
+ BUILTIN_WORKTREE_REPAIR_USAGE,
+ NULL
+};
+
+static const char * const git_worktree_unlock_usage[] = {
+ BUILTIN_WORKTREE_UNLOCK_USAGE,
NULL
};
@@ -32,6 +119,7 @@ struct add_opts {
int detach;
int quiet;
int checkout;
+ int orphan;
const char *keep_locked;
};
@@ -40,14 +128,15 @@ static int verbose;
static int guess_remote;
static timestamp_t expire;
-static int git_worktree_config(const char *var, const char *value, void *cb)
+static int git_worktree_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(var, "worktree.guessremote")) {
guess_remote = git_config_bool(var, value);
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
static int delete_git_dir(const char *id)
@@ -115,7 +204,7 @@ static void prune_worktrees(void)
{
struct strbuf reason = STRBUF_INIT;
struct strbuf main_path = STRBUF_INIT;
- struct string_list kept = STRING_LIST_INIT_NODUP;
+ struct string_list kept = STRING_LIST_INIT_DUP;
DIR *dir = opendir(git_path("worktrees"));
struct dirent *d;
if (!dir)
@@ -126,14 +215,14 @@ static void prune_worktrees(void)
if (should_prune_worktree(d->d_name, &reason, &path, expire))
prune_worktree(d->d_name, reason.buf);
else if (path)
- string_list_append(&kept, path)->util = xstrdup(d->d_name);
+ string_list_append_nodup(&kept, path)->util = xstrdup(d->d_name);
}
closedir(dir);
strbuf_add_absolute_path(&main_path, get_git_common_dir());
/* massage main worktree absolute path to match 'gitdir' content */
strbuf_strip_suffix(&main_path, "/.");
- string_list_append(&kept, strbuf_detach(&main_path, NULL));
+ string_list_append_nodup(&kept, strbuf_detach(&main_path, NULL));
prune_dups(&kept);
string_list_clear(&kept, 1);
@@ -153,9 +242,10 @@ static int prune(int ac, const char **av, const char *prefix)
};
expire = TIME_MAX;
- ac = parse_options(ac, av, prefix, options, worktree_usage, 0);
+ ac = parse_options(ac, av, prefix, options, git_worktree_prune_usage,
+ 0);
if (ac)
- usage_with_options(worktree_usage, options);
+ usage_with_options(git_worktree_prune_usage, options);
prune_worktrees();
return 0;
}
@@ -260,7 +350,6 @@ static void copy_filtered_worktree_config(const char *worktree_git_dir)
if (file_exists(from_file)) {
struct config_set cs = { { 0 } };
- const char *core_worktree;
int bare;
if (safe_create_leading_directories(to_file) ||
@@ -276,12 +365,12 @@ static void copy_filtered_worktree_config(const char *worktree_git_dir)
if (!git_configset_get_bool(&cs, "core.bare", &bare) &&
bare &&
git_config_set_multivar_in_file_gently(
- to_file, "core.bare", NULL, "true", 0))
+ to_file, "core.bare", NULL, "true", NULL, 0))
error(_("failed to unset '%s' in '%s'"),
"core.bare", to_file);
- if (!git_configset_get_value(&cs, "core.worktree", &core_worktree) &&
+ if (!git_configset_get(&cs, "core.worktree") &&
git_config_set_in_file_gently(to_file,
- "core.worktree", NULL))
+ "core.worktree", NULL, NULL))
error(_("failed to unset '%s' in '%s'"),
"core.worktree", to_file);
@@ -305,13 +394,28 @@ static int checkout_worktree(const struct add_opts *opts,
return run_command(&cp);
}
+static int make_worktree_orphan(const char * ref, const struct add_opts *opts,
+ struct strvec *child_env)
+{
+ struct strbuf symref = STRBUF_INIT;
+ struct child_process cp = CHILD_PROCESS_INIT;
+
+ validate_new_branchname(ref, &symref, 0);
+ strvec_pushl(&cp.args, "symbolic-ref", "HEAD", symref.buf, NULL);
+ if (opts->quiet)
+ strvec_push(&cp.args, "--quiet");
+ strvec_pushv(&cp.env, child_env->v);
+ strbuf_release(&symref);
+ cp.git_cmd = 1;
+ return run_command(&cp);
+}
+
static int add_worktree(const char *path, const char *refname,
const struct add_opts *opts)
{
struct strbuf sb_git = STRBUF_INIT, sb_repo = STRBUF_INIT;
struct strbuf sb = STRBUF_INIT, realpath = STRBUF_INIT;
const char *name;
- struct child_process cp = CHILD_PROCESS_INIT;
struct strvec child_env = STRVEC_INIT;
unsigned int counter = 0;
int len, ret;
@@ -319,7 +423,8 @@ static int add_worktree(const char *path, const char *refname,
struct commit *commit = NULL;
int is_branch = 0;
struct strbuf sb_name = STRBUF_INIT;
- struct worktree **worktrees;
+ struct worktree **worktrees, *wt = NULL;
+ struct ref_store *wt_refs;
worktrees = get_worktrees();
check_candidate_path(path, opts->force, worktrees, "add");
@@ -334,7 +439,7 @@ static int add_worktree(const char *path, const char *refname,
die_if_checked_out(symref.buf, 0);
}
commit = lookup_commit_reference_by_name(refname);
- if (!commit)
+ if (!commit && !opts->orphan)
die(_("invalid reference: %s"), refname);
name = worktree_basename(path, &len);
@@ -390,21 +495,33 @@ static int add_worktree(const char *path, const char *refname,
strbuf_realpath(&realpath, get_git_common_dir(), 1);
write_file(sb_git.buf, "gitdir: %s/worktrees/%s",
realpath.buf, name);
- /*
- * This is to keep resolve_ref() happy. We need a valid HEAD
- * or is_git_directory() will reject the directory. Any value which
- * looks like an object ID will do since it will be immediately
- * replaced by the symbolic-ref or update-ref invocation in the new
- * worktree.
- */
- strbuf_reset(&sb);
- strbuf_addf(&sb, "%s/HEAD", sb_repo.buf);
- write_file(sb.buf, "%s", oid_to_hex(null_oid()));
strbuf_reset(&sb);
strbuf_addf(&sb, "%s/commondir", sb_repo.buf);
write_file(sb.buf, "../..");
/*
+ * Set up the ref store of the worktree and create the HEAD reference.
+ */
+ wt = get_linked_worktree(name, 1);
+ if (!wt) {
+ ret = error(_("could not find created worktree '%s'"), name);
+ goto done;
+ }
+ wt_refs = get_worktree_ref_store(wt);
+
+ ret = refs_init_db(wt_refs, REFS_INIT_DB_IS_WORKTREE, &sb);
+ if (ret)
+ goto done;
+
+ if (!is_branch && commit)
+ ret = refs_update_ref(wt_refs, NULL, "HEAD", &commit->object.oid,
+ NULL, 0, UPDATE_REFS_MSG_ON_ERR);
+ else
+ ret = refs_create_symref(wt_refs, "HEAD", symref.buf, NULL);
+ if (ret)
+ goto done;
+
+ /*
* If the current worktree has sparse-checkout enabled, then copy
* the sparse-checkout patterns from the current worktree.
*/
@@ -416,26 +533,14 @@ static int add_worktree(const char *path, const char *refname,
* values from the current worktree into the new one, that way the
* new worktree behaves the same as this one.
*/
- if (repository_format_worktree_config)
+ if (the_repository->repository_format_worktree_config)
copy_filtered_worktree_config(sb_repo.buf);
strvec_pushf(&child_env, "%s=%s", GIT_DIR_ENVIRONMENT, sb_git.buf);
strvec_pushf(&child_env, "%s=%s", GIT_WORK_TREE_ENVIRONMENT, path);
- cp.git_cmd = 1;
-
- if (!is_branch)
- strvec_pushl(&cp.args, "update-ref", "HEAD",
- oid_to_hex(&commit->object.oid), NULL);
- else {
- strvec_pushl(&cp.args, "symbolic-ref", "HEAD",
- symref.buf, NULL);
- if (opts->quiet)
- strvec_push(&cp.args, "--quiet");
- }
- strvec_pushv(&cp.env, child_env.v);
- ret = run_command(&cp);
- if (ret)
+ if (opts->orphan &&
+ (ret = make_worktree_orphan(refname, opts, &child_env)))
goto done;
if (opts->checkout &&
@@ -457,7 +562,7 @@ done:
* Hook failure does not warrant worktree deletion, so run hook after
* is_junk is cleared, but do return appropriate code when hook fails.
*/
- if (!ret && opts->checkout) {
+ if (!ret && opts->checkout && !opts->orphan) {
struct run_hooks_opt opt = RUN_HOOKS_OPT_INIT;
strvec_pushl(&opt.env, "GIT_DIR", "GIT_WORK_TREE", NULL);
@@ -478,6 +583,7 @@ done:
strbuf_release(&sb_git);
strbuf_release(&sb_name);
strbuf_release(&realpath);
+ free_worktree(wt);
return ret;
}
@@ -493,7 +599,7 @@ static void print_preparing_worktree_line(int detach,
else
fprintf_ln(stderr, _("Preparing worktree (resetting branch '%s'; was at %s)"),
new_branch,
- find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, &commit->object.oid, DEFAULT_ABBREV));
} else if (new_branch) {
fprintf_ln(stderr, _("Preparing worktree (new branch '%s')"), new_branch);
} else {
@@ -505,14 +611,131 @@ static void print_preparing_worktree_line(int detach,
else {
struct commit *commit = lookup_commit_reference_by_name(branch);
if (!commit)
- die(_("invalid reference: %s"), branch);
+ BUG(_("unreachable: invalid reference: %s"), branch);
fprintf_ln(stderr, _("Preparing worktree (detached HEAD %s)"),
- find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, &commit->object.oid, DEFAULT_ABBREV));
}
strbuf_release(&s);
}
}
+/**
+ * Callback to short circuit iteration over refs on the first reference
+ * corresponding to a valid oid.
+ *
+ * Returns 0 on failure and non-zero on success.
+ */
+static int first_valid_ref(const char *refname UNUSED,
+ const struct object_id *oid UNUSED,
+ int flags UNUSED,
+ void *cb_data UNUSED)
+{
+ return 1;
+}
+
+/**
+ * Verifies HEAD and determines whether there exist any valid local references.
+ *
+ * - Checks whether HEAD points to a valid reference.
+ *
+ * - Checks whether any valid local branches exist.
+ *
+ * - Emits a warning if there exist any valid branches but HEAD does not point
+ * to a valid reference.
+ *
+ * Returns 1 if any of the previous checks are true, otherwise returns 0.
+ */
+static int can_use_local_refs(const struct add_opts *opts)
+{
+ if (head_ref(first_valid_ref, NULL)) {
+ return 1;
+ } else if (for_each_branch_ref(first_valid_ref, NULL)) {
+ if (!opts->quiet) {
+ struct strbuf path = STRBUF_INIT;
+ struct strbuf contents = STRBUF_INIT;
+
+ strbuf_add_real_path(&path, get_worktree_git_dir(NULL));
+ strbuf_addstr(&path, "/HEAD");
+ strbuf_read_file(&contents, path.buf, 64);
+ strbuf_stripspace(&contents, NULL);
+ strbuf_strip_suffix(&contents, "\n");
+
+ warning(_("HEAD points to an invalid (or orphaned) reference.\n"
+ "HEAD path: '%s'\n"
+ "HEAD contents: '%s'"),
+ path.buf, contents.buf);
+ strbuf_release(&path);
+ strbuf_release(&contents);
+ }
+ return 1;
+ }
+ return 0;
+}
+
+/**
+ * Reports whether the necessary flags were set and whether the repository has
+ * remote references to attempt DWIM tracking of upstream branches.
+ *
+ * 1. Checks that `--guess-remote` was used or `worktree.guessRemote = true`.
+ *
+ * 2. Checks whether any valid remote branches exist.
+ *
+ * 3. Checks that there exists at least one remote and emits a warning/error
+ * if both checks 1. and 2. are false (can be bypassed with `--force`).
+ *
+ * Returns 1 if checks 1. and 2. are true, otherwise 0.
+ */
+static int can_use_remote_refs(const struct add_opts *opts)
+{
+ if (!guess_remote) {
+ return 0;
+ } else if (for_each_remote_ref(first_valid_ref, NULL)) {
+ return 1;
+ } else if (!opts->force && remote_get(NULL)) {
+ die(_("No local or remote refs exist despite at least one remote\n"
+ "present, stopping; use 'add -f' to override or fetch a remote first"));
+ }
+ return 0;
+}
+
+/**
+ * Determines whether `--orphan` should be inferred in the evaluation of
+ * `worktree add path/` or `worktree add -b branch path/` and emits an error
+ * if the supplied arguments would produce an illegal combination when the
+ * `--orphan` flag is included.
+ *
+ * `opts` and `opt_track` contain the other options & flags supplied to the
+ * command.
+ *
+ * remote determines whether to check `can_use_remote_refs()` or not. This
+ * is primarily to differentiate between the basic `add` DWIM and `add -b`.
+ *
+ * Returns 1 when inferring `--orphan`, 0 otherwise, and emits an error when
+ * `--orphan` is inferred but doing so produces an illegal combination of
+ * options and flags. Additionally produces an error when remote refs are
+ * checked and the repo is in a state that looks like the user added a remote
+ * but forgot to fetch (and did not override the warning with -f).
+ */
+static int dwim_orphan(const struct add_opts *opts, int opt_track, int remote)
+{
+ if (can_use_local_refs(opts)) {
+ return 0;
+ } else if (remote && can_use_remote_refs(opts)) {
+ return 0;
+ } else if (!opts->quiet) {
+ fprintf_ln(stderr, WORKTREE_ADD_DWIM_ORPHAN_INFER_TEXT);
+ }
+
+ if (opt_track) {
+ die(_("options '%s' and '%s' cannot be used together"),
+ "--orphan", "--track");
+ } else if (!opts->checkout) {
+ die(_("options '%s' and '%s' cannot be used together"),
+ "--orphan", "--no-checkout");
+ }
+ return 1;
+}
+
static const char *dwim_branch(const char *path, const char **new_branch)
{
int n;
@@ -549,6 +772,7 @@ static int add(int ac, const char **av, const char *prefix)
const char *opt_track = NULL;
const char *lock_reason = NULL;
int keep_locked = 0;
+ int used_new_branch_options;
struct option options[] = {
OPT__FORCE(&opts.force,
N_("checkout <branch> even if already checked out in other worktree"),
@@ -557,6 +781,7 @@ static int add(int ac, const char **av, const char *prefix)
N_("create a new branch")),
OPT_STRING('B', NULL, &new_branch_force, N_("branch"),
N_("create or reset a branch")),
+ OPT_BOOL(0, "orphan", &opts.orphan, N_("create unborn branch")),
OPT_BOOL('d', "detach", &opts.detach, N_("detach HEAD at named commit")),
OPT_BOOL(0, "checkout", &opts.checkout, N_("populate the new working tree")),
OPT_BOOL(0, "lock", &keep_locked, N_("keep the new working tree locked")),
@@ -570,12 +795,25 @@ static int add(int ac, const char **av, const char *prefix)
N_("try to match the new branch name with a remote-tracking branch")),
OPT_END()
};
+ int ret;
memset(&opts, 0, sizeof(opts));
opts.checkout = 1;
- ac = parse_options(ac, av, prefix, options, worktree_usage, 0);
+ ac = parse_options(ac, av, prefix, options, git_worktree_add_usage, 0);
if (!!opts.detach + !!new_branch + !!new_branch_force > 1)
die(_("options '%s', '%s', and '%s' cannot be used together"), "-b", "-B", "--detach");
+ if (opts.detach && opts.orphan)
+ die(_("options '%s' and '%s' cannot be used together"),
+ "--orphan", "--detach");
+ if (opts.orphan && opt_track)
+ die(_("options '%s' and '%s' cannot be used together"),
+ "--orphan", "--track");
+ if (opts.orphan && !opts.checkout)
+ die(_("options '%s' and '%s' cannot be used together"),
+ "--orphan", "--no-checkout");
+ if (opts.orphan && ac == 2)
+ die(_("option '%s' and commit-ish cannot be used together"),
+ "--orphan");
if (lock_reason && !keep_locked)
die(_("the option '%s' requires '%s'"), "--reason", "--lock");
if (lock_reason)
@@ -584,10 +822,11 @@ static int add(int ac, const char **av, const char *prefix)
opts.keep_locked = _("added with --lock");
if (ac < 1 || ac > 2)
- usage_with_options(worktree_usage, options);
+ usage_with_options(git_worktree_add_usage, options);
path = prefix_filename(prefix, av[0]);
branch = ac < 2 ? "HEAD" : av[1];
+ used_new_branch_options = new_branch || new_branch_force;
if (!strcmp(branch, "-"))
branch = "@{-1}";
@@ -604,13 +843,28 @@ static int add(int ac, const char **av, const char *prefix)
strbuf_release(&symref);
}
- if (ac < 2 && !new_branch && !opts.detach) {
+ if (opts.orphan && !new_branch) {
+ int n;
+ const char *s = worktree_basename(path, &n);
+ new_branch = xstrndup(s, n);
+ } else if (opts.orphan) {
+ ; /* no-op */
+ } else if (opts.detach) {
+ /* Check HEAD */
+ if (!strcmp(branch, "HEAD"))
+ can_use_local_refs(&opts);
+ } else if (ac < 2 && new_branch) {
+ /* DWIM: Infer --orphan when repo has no refs. */
+ opts.orphan = dwim_orphan(&opts, !!opt_track, 0);
+ } else if (ac < 2) {
+ /* DWIM: Guess branch name from path. */
const char *s = dwim_branch(path, &new_branch);
if (s)
branch = s;
- }
- if (ac == 2 && !new_branch && !opts.detach) {
+ /* DWIM: Infer --orphan when repo has no refs. */
+ opts.orphan = (!s) && dwim_orphan(&opts, !!opt_track, 1);
+ } else if (ac == 2) {
struct object_id oid;
struct commit *commit;
const char *remote;
@@ -623,11 +877,31 @@ static int add(int ac, const char **av, const char *prefix)
branch = remote;
}
}
+
+ if (!strcmp(branch, "HEAD"))
+ can_use_local_refs(&opts);
+
}
+
+ if (!opts.orphan && !lookup_commit_reference_by_name(branch)) {
+ int attempt_hint = !opts.quiet && (ac < 2);
+ if (attempt_hint && used_new_branch_options) {
+ advise_if_enabled(ADVICE_WORKTREE_ADD_ORPHAN,
+ WORKTREE_ADD_ORPHAN_WITH_DASH_B_HINT_TEXT,
+ new_branch, path);
+ } else if (attempt_hint) {
+ advise_if_enabled(ADVICE_WORKTREE_ADD_ORPHAN,
+ WORKTREE_ADD_ORPHAN_NO_DASH_B_HINT_TEXT, path);
+ }
+ die(_("invalid reference: %s"), branch);
+ }
+
if (!opts.quiet)
print_preparing_worktree_line(opts.detach, branch, new_branch, !!new_branch_force);
- if (new_branch) {
+ if (opts.orphan) {
+ branch = new_branch;
+ } else if (new_branch) {
struct child_process cp = CHILD_PROCESS_INIT;
cp.git_cmd = 1;
strvec_push(&cp.args, "branch");
@@ -646,9 +920,9 @@ static int add(int ac, const char **av, const char *prefix)
die(_("--[no-]track can only be used if a new branch is created"));
}
- UNLEAK(path);
- UNLEAK(opts);
- return add_worktree(path, branch, &opts);
+ ret = add_worktree(path, branch, &opts);
+ free(path);
+ return ret;
}
static void show_worktree_porcelain(struct worktree *wt, int line_terminator)
@@ -696,7 +970,7 @@ static void show_worktree(struct worktree *wt, int path_maxlen, int abbrev_len)
strbuf_addstr(&sb, "(bare)");
else {
strbuf_addf(&sb, "%-*s ", abbrev_len,
- find_unique_abbrev(&wt->head_oid, DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, &wt->head_oid, DEFAULT_ABBREV));
if (wt->is_detached)
strbuf_addstr(&sb, "(detached HEAD)");
else if (wt->head_ref) {
@@ -733,7 +1007,7 @@ static void measure_widths(struct worktree **wt, int *abbrev, int *maxlen)
if (path_len > *maxlen)
*maxlen = path_len;
- sha1_len = strlen(find_unique_abbrev(&wt[i]->head_oid, *abbrev));
+ sha1_len = strlen(repo_find_unique_abbrev(the_repository, &wt[i]->head_oid, *abbrev));
if (sha1_len > *abbrev)
*abbrev = sha1_len;
}
@@ -772,9 +1046,9 @@ static int list(int ac, const char **av, const char *prefix)
};
expire = TIME_MAX;
- ac = parse_options(ac, av, prefix, options, worktree_usage, 0);
+ ac = parse_options(ac, av, prefix, options, git_worktree_list_usage, 0);
if (ac)
- usage_with_options(worktree_usage, options);
+ usage_with_options(git_worktree_list_usage, options);
else if (verbose && porcelain)
die(_("options '%s' and '%s' cannot be used together"), "--verbose", "--porcelain");
else if (!line_terminator && !porcelain)
@@ -811,9 +1085,9 @@ static int lock_worktree(int ac, const char **av, const char *prefix)
};
struct worktree **worktrees, *wt;
- ac = parse_options(ac, av, prefix, options, worktree_usage, 0);
+ ac = parse_options(ac, av, prefix, options, git_worktree_lock_usage, 0);
if (ac != 1)
- usage_with_options(worktree_usage, options);
+ usage_with_options(git_worktree_lock_usage, options);
worktrees = get_worktrees();
wt = find_worktree(worktrees, prefix, av[0]);
@@ -844,9 +1118,9 @@ static int unlock_worktree(int ac, const char **av, const char *prefix)
struct worktree **worktrees, *wt;
int ret;
- ac = parse_options(ac, av, prefix, options, worktree_usage, 0);
+ ac = parse_options(ac, av, prefix, options, git_worktree_unlock_usage, 0);
if (ac != 1)
- usage_with_options(worktree_usage, options);
+ usage_with_options(git_worktree_unlock_usage, options);
worktrees = get_worktrees();
wt = find_worktree(worktrees, prefix, av[0]);
@@ -863,7 +1137,7 @@ static int unlock_worktree(int ac, const char **av, const char *prefix)
static void validate_no_submodules(const struct worktree *wt)
{
- struct index_state istate = { NULL };
+ struct index_state istate = INDEX_STATE_INIT(the_repository);
struct strbuf path = STRBUF_INIT;
int i, found_submodules = 0;
@@ -914,9 +1188,10 @@ static int move_worktree(int ac, const char **av, const char *prefix)
const char *reason = NULL;
char *path;
- ac = parse_options(ac, av, prefix, options, worktree_usage, 0);
+ ac = parse_options(ac, av, prefix, options, git_worktree_move_usage,
+ 0);
if (ac != 2)
- usage_with_options(worktree_usage, options);
+ usage_with_options(git_worktree_move_usage, options);
path = prefix_filename(prefix, av[1]);
strbuf_addstr(&dst, path);
@@ -1042,9 +1317,9 @@ static int remove_worktree(int ac, const char **av, const char *prefix)
const char *reason = NULL;
int ret = 0;
- ac = parse_options(ac, av, prefix, options, worktree_usage, 0);
+ ac = parse_options(ac, av, prefix, options, git_worktree_remove_usage, 0);
if (ac != 1)
- usage_with_options(worktree_usage, options);
+ usage_with_options(git_worktree_remove_usage, options);
worktrees = get_worktrees();
wt = find_worktree(worktrees, prefix, av[0]);
@@ -1102,7 +1377,7 @@ static int repair(int ac, const char **av, const char *prefix)
};
int rc = 0;
- ac = parse_options(ac, av, prefix, options, worktree_usage, 0);
+ 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);
@@ -1112,31 +1387,28 @@ static int repair(int ac, const char **av, const char *prefix)
int cmd_worktree(int ac, const char **av, const char *prefix)
{
+ parse_opt_subcommand_fn *fn = NULL;
struct option options[] = {
+ OPT_SUBCOMMAND("add", &fn, add),
+ OPT_SUBCOMMAND("prune", &fn, prune),
+ OPT_SUBCOMMAND("list", &fn, list),
+ OPT_SUBCOMMAND("lock", &fn, lock_worktree),
+ OPT_SUBCOMMAND("unlock", &fn, unlock_worktree),
+ OPT_SUBCOMMAND("move", &fn, move_worktree),
+ OPT_SUBCOMMAND("remove", &fn, remove_worktree),
+ OPT_SUBCOMMAND("repair", &fn, repair),
OPT_END()
};
git_config(git_worktree_config, NULL);
- if (ac < 2)
- usage_with_options(worktree_usage, options);
if (!prefix)
prefix = "";
- if (!strcmp(av[1], "add"))
- return add(ac - 1, av + 1, prefix);
- if (!strcmp(av[1], "prune"))
- return prune(ac - 1, av + 1, prefix);
- if (!strcmp(av[1], "list"))
- return list(ac - 1, av + 1, prefix);
- if (!strcmp(av[1], "lock"))
- return lock_worktree(ac - 1, av + 1, prefix);
- if (!strcmp(av[1], "unlock"))
- return unlock_worktree(ac - 1, av + 1, prefix);
- if (!strcmp(av[1], "move"))
- return move_worktree(ac - 1, av + 1, prefix);
- if (!strcmp(av[1], "remove"))
- return remove_worktree(ac - 1, av + 1, prefix);
- if (!strcmp(av[1], "repair"))
- return repair(ac - 1, av + 1, prefix);
- usage_with_options(worktree_usage, options);
+
+ ac = parse_options(ac, av, prefix, options, git_worktree_usage, 0);
+
+ prepare_repo_settings(the_repository);
+ the_repository->settings.command_requires_full_index = 0;
+
+ return fn(ac, av, prefix);
}
diff --git a/builtin/write-tree.c b/builtin/write-tree.c
index 45d6170..66e83d0 100644
--- a/builtin/write-tree.c
+++ b/builtin/write-tree.c
@@ -3,13 +3,16 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
-#include "cache.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "tree.h"
#include "cache-tree.h"
#include "parse-options.h"
+#include "repository.h"
static const char * const write_tree_usage[] = {
N_("git write-tree [--missing-ok] [--prefix=<prefix>/]"),
@@ -38,7 +41,11 @@ int cmd_write_tree(int argc, const char **argv, const char *cmd_prefix)
argc = parse_options(argc, argv, cmd_prefix, write_tree_options,
write_tree_usage, 0);
- ret = write_cache_as_tree(&oid, flags, tree_prefix);
+ prepare_repo_settings(the_repository);
+ the_repository->settings.command_requires_full_index = 0;
+
+ ret = write_index_as_tree(&oid, &the_index, get_index_file(), flags,
+ tree_prefix);
switch (ret) {
case 0:
printf("%s\n", oid_to_hex(&oid));
diff --git a/bulk-checkin.c b/bulk-checkin.c
index 98ec893..eb46b88 100644
--- a/bulk-checkin.c
+++ b/bulk-checkin.c
@@ -1,17 +1,20 @@
/*
* Copyright (c) 2011, Google Inc.
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "bulk-checkin.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "lockfile.h"
#include "repository.h"
#include "csum-file.h"
#include "pack.h"
#include "strbuf.h"
-#include "string-list.h"
#include "tmp-objdir.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
static int odb_transaction_nesting;
@@ -124,7 +127,7 @@ static int already_written(struct bulk_checkin_packfile *state, struct object_id
int i;
/* The object may already exist in the repository */
- if (has_object_file(oid))
+ if (repo_has_object_file(the_repository, oid))
return 1;
/* Might want to keep the list sorted */
@@ -151,10 +154,10 @@ static int already_written(struct bulk_checkin_packfile *state, struct object_id
* status before calling us just in case we ask it to call us again
* with a new pack.
*/
-static int stream_to_pack(struct bulk_checkin_packfile *state,
- git_hash_ctx *ctx, off_t *already_hashed_to,
- int fd, size_t size, enum object_type type,
- const char *path, unsigned flags)
+static int stream_blob_to_pack(struct bulk_checkin_packfile *state,
+ git_hash_ctx *ctx, off_t *already_hashed_to,
+ int fd, size_t size, const char *path,
+ unsigned flags)
{
git_zstream s;
unsigned char ibuf[16384];
@@ -166,7 +169,7 @@ static int stream_to_pack(struct bulk_checkin_packfile *state,
git_deflate_init(&s, pack_compression_level);
- hdrlen = encode_in_pack_object_header(obuf, sizeof(obuf), type, size);
+ hdrlen = encode_in_pack_object_header(obuf, sizeof(obuf), OBJ_BLOB, size);
s.next_out = obuf + hdrlen;
s.avail_out = sizeof(obuf) - hdrlen;
@@ -243,11 +246,10 @@ static void prepare_to_stream(struct bulk_checkin_packfile *state,
die_errno("unable to write pack header");
}
-static int deflate_to_pack(struct bulk_checkin_packfile *state,
- struct object_id *result_oid,
- int fd, size_t size,
- enum object_type type, const char *path,
- unsigned flags)
+static int deflate_blob_to_pack(struct bulk_checkin_packfile *state,
+ struct object_id *result_oid,
+ int fd, size_t size,
+ const char *path, unsigned flags)
{
off_t seekback, already_hashed_to;
git_hash_ctx ctx;
@@ -261,9 +263,10 @@ static int deflate_to_pack(struct bulk_checkin_packfile *state,
return error("cannot find the current offset");
header_len = format_object_header((char *)obuf, sizeof(obuf),
- type, size);
+ 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);
/* Note: idx is non-NULL when we are writing */
if ((flags & HASH_WRITE_OBJECT) != 0)
@@ -278,8 +281,8 @@ static int deflate_to_pack(struct bulk_checkin_packfile *state,
idx->offset = state->offset;
crc32_begin(state->f);
}
- if (!stream_to_pack(state, &ctx, &already_hashed_to,
- fd, size, type, path, flags))
+ if (!stream_blob_to_pack(state, &ctx, &already_hashed_to,
+ fd, size, path, flags))
break;
/*
* Writing this object to the current pack will make
@@ -340,16 +343,18 @@ void fsync_loose_object_bulk_checkin(int fd, const char *filename)
*/
if (!bulk_fsync_objdir ||
git_fsync(fd, FSYNC_WRITEOUT_ONLY) < 0) {
+ if (errno == ENOSYS)
+ warning(_("core.fsyncMethod = batch is unsupported on this platform"));
fsync_or_die(fd, filename);
}
}
-int index_bulk_checkin(struct object_id *oid,
- int fd, size_t size, enum object_type type,
- const char *path, unsigned flags)
+int index_blob_bulk_checkin(struct object_id *oid,
+ int fd, size_t size,
+ const char *path, unsigned flags)
{
- int status = deflate_to_pack(&bulk_checkin_packfile, oid, fd, size, type,
- path, flags);
+ int status = deflate_blob_to_pack(&bulk_checkin_packfile, oid, fd, size,
+ path, flags);
if (!odb_transaction_nesting)
flush_bulk_checkin_packfile(&bulk_checkin_packfile);
return status;
diff --git a/bulk-checkin.h b/bulk-checkin.h
index 8281b9c..aa7286a 100644
--- a/bulk-checkin.h
+++ b/bulk-checkin.h
@@ -4,14 +4,14 @@
#ifndef BULK_CHECKIN_H
#define BULK_CHECKIN_H
-#include "cache.h"
+#include "object.h"
void prepare_loose_object_bulk_checkin(void);
void fsync_loose_object_bulk_checkin(int fd, const char *filename);
-int index_bulk_checkin(struct object_id *oid,
- int fd, size_t size, enum object_type type,
- const char *path, unsigned flags);
+int index_blob_bulk_checkin(struct object_id *oid,
+ int fd, size_t size,
+ const char *path, unsigned flags);
/*
* Tell the object database to optimize for adding
diff --git a/bundle-uri.c b/bundle-uri.c
new file mode 100644
index 0000000..ca32050
--- /dev/null
+++ b/bundle-uri.c
@@ -0,0 +1,934 @@
+#include "git-compat-util.h"
+#include "bundle-uri.h"
+#include "bundle.h"
+#include "copy.h"
+#include "environment.h"
+#include "gettext.h"
+#include "refs.h"
+#include "run-command.h"
+#include "hashmap.h"
+#include "pkt-line.h"
+#include "config.h"
+#include "remote.h"
+
+static struct {
+ enum bundle_list_heuristic heuristic;
+ const char *name;
+} heuristics[BUNDLE_HEURISTIC__COUNT] = {
+ { BUNDLE_HEURISTIC_NONE, ""},
+ { BUNDLE_HEURISTIC_CREATIONTOKEN, "creationToken" },
+};
+
+static int compare_bundles(const void *hashmap_cmp_fn_data UNUSED,
+ const struct hashmap_entry *he1,
+ const struct hashmap_entry *he2,
+ const void *id)
+{
+ const struct remote_bundle_info *e1 =
+ container_of(he1, const struct remote_bundle_info, ent);
+ const struct remote_bundle_info *e2 =
+ container_of(he2, const struct remote_bundle_info, ent);
+
+ return strcmp(e1->id, id ? (const char *)id : e2->id);
+}
+
+void init_bundle_list(struct bundle_list *list)
+{
+ memset(list, 0, sizeof(*list));
+
+ /* Implied defaults. */
+ list->mode = BUNDLE_MODE_ALL;
+ list->version = 1;
+
+ hashmap_init(&list->bundles, compare_bundles, NULL, 0);
+}
+
+static int clear_remote_bundle_info(struct remote_bundle_info *bundle,
+ void *data UNUSED)
+{
+ FREE_AND_NULL(bundle->id);
+ FREE_AND_NULL(bundle->uri);
+ FREE_AND_NULL(bundle->file);
+ bundle->unbundled = 0;
+ return 0;
+}
+
+void clear_bundle_list(struct bundle_list *list)
+{
+ if (!list)
+ return;
+
+ for_all_bundles_in_list(list, clear_remote_bundle_info, NULL);
+ hashmap_clear_and_free(&list->bundles, struct remote_bundle_info, ent);
+ free(list->baseURI);
+}
+
+int for_all_bundles_in_list(struct bundle_list *list,
+ bundle_iterator iter,
+ void *data)
+{
+ struct remote_bundle_info *info;
+ struct hashmap_iter i;
+
+ hashmap_for_each_entry(&list->bundles, &i, info, ent) {
+ int result = iter(info, data);
+
+ if (result)
+ return result;
+ }
+
+ return 0;
+}
+
+static int summarize_bundle(struct remote_bundle_info *info, void *data)
+{
+ FILE *fp = data;
+ fprintf(fp, "[bundle \"%s\"]\n", info->id);
+ fprintf(fp, "\turi = %s\n", info->uri);
+
+ if (info->creationToken)
+ fprintf(fp, "\tcreationToken = %"PRIu64"\n", info->creationToken);
+ return 0;
+}
+
+void print_bundle_list(FILE *fp, struct bundle_list *list)
+{
+ const char *mode;
+
+ switch (list->mode) {
+ case BUNDLE_MODE_ALL:
+ mode = "all";
+ break;
+
+ case BUNDLE_MODE_ANY:
+ mode = "any";
+ break;
+
+ case BUNDLE_MODE_NONE:
+ default:
+ mode = "<unknown>";
+ }
+
+ fprintf(fp, "[bundle]\n");
+ fprintf(fp, "\tversion = %d\n", list->version);
+ fprintf(fp, "\tmode = %s\n", mode);
+
+ if (list->heuristic) {
+ int i;
+ for (i = 0; i < BUNDLE_HEURISTIC__COUNT; i++) {
+ if (heuristics[i].heuristic == list->heuristic) {
+ printf("\theuristic = %s\n",
+ heuristics[list->heuristic].name);
+ break;
+ }
+ }
+ }
+
+ for_all_bundles_in_list(list, summarize_bundle, fp);
+}
+
+/**
+ * Given a key-value pair, update the state of the given bundle list.
+ * Returns 0 if the key-value pair is understood. Returns -1 if the key
+ * is not understood or the value is malformed.
+ */
+static int bundle_list_update(const char *key, const char *value,
+ struct bundle_list *list)
+{
+ struct strbuf id = STRBUF_INIT;
+ struct remote_bundle_info lookup = REMOTE_BUNDLE_INFO_INIT;
+ struct remote_bundle_info *bundle;
+ const char *subsection, *subkey;
+ size_t subsection_len;
+
+ if (parse_config_key(key, "bundle", &subsection, &subsection_len, &subkey))
+ return -1;
+
+ if (!subsection_len) {
+ if (!strcmp(subkey, "version")) {
+ int version;
+ if (!git_parse_int(value, &version))
+ return -1;
+ if (version != 1)
+ return -1;
+
+ list->version = version;
+ return 0;
+ }
+
+ if (!strcmp(subkey, "mode")) {
+ if (!strcmp(value, "all"))
+ list->mode = BUNDLE_MODE_ALL;
+ else if (!strcmp(value, "any"))
+ list->mode = BUNDLE_MODE_ANY;
+ else
+ return -1;
+ return 0;
+ }
+
+ if (!strcmp(subkey, "heuristic")) {
+ int i;
+ for (i = 0; i < BUNDLE_HEURISTIC__COUNT; i++) {
+ if (heuristics[i].heuristic &&
+ heuristics[i].name &&
+ !strcmp(value, heuristics[i].name)) {
+ list->heuristic = heuristics[i].heuristic;
+ return 0;
+ }
+ }
+
+ /* Ignore unknown heuristics. */
+ return 0;
+ }
+
+ /* Ignore other unknown global keys. */
+ return 0;
+ }
+
+ strbuf_add(&id, subsection, subsection_len);
+
+ /*
+ * Check for an existing bundle with this <id>, or create one
+ * if necessary.
+ */
+ lookup.id = id.buf;
+ hashmap_entry_init(&lookup.ent, strhash(lookup.id));
+ if (!(bundle = hashmap_get_entry(&list->bundles, &lookup, ent, NULL))) {
+ CALLOC_ARRAY(bundle, 1);
+ bundle->id = strbuf_detach(&id, NULL);
+ hashmap_entry_init(&bundle->ent, strhash(bundle->id));
+ hashmap_add(&list->bundles, &bundle->ent);
+ }
+ strbuf_release(&id);
+
+ if (!strcmp(subkey, "uri")) {
+ if (bundle->uri)
+ return -1;
+ bundle->uri = relative_url(list->baseURI, value, NULL);
+ return 0;
+ }
+
+ if (!strcmp(subkey, "creationtoken")) {
+ if (sscanf(value, "%"PRIu64, &bundle->creationToken) != 1)
+ warning(_("could not parse bundle list key %s with value '%s'"),
+ "creationToken", value);
+ return 0;
+ }
+
+ /*
+ * At this point, we ignore any information that we don't
+ * understand, assuming it to be hints for a heuristic the client
+ * does not currently understand.
+ */
+ return 0;
+}
+
+static int config_to_bundle_list(const char *key, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *data)
+{
+ struct bundle_list *list = data;
+ return bundle_list_update(key, value, list);
+}
+
+int bundle_uri_parse_config_format(const char *uri,
+ const char *filename,
+ struct bundle_list *list)
+{
+ int result;
+ struct config_options opts = {
+ .error_action = CONFIG_ERROR_ERROR,
+ };
+
+ if (!list->baseURI) {
+ struct strbuf baseURI = STRBUF_INIT;
+ strbuf_addstr(&baseURI, uri);
+
+ /*
+ * If the URI does not end with a trailing slash, then
+ * remove the filename portion of the path. This is
+ * important for relative URIs.
+ */
+ strbuf_strip_file_from_path(&baseURI);
+ list->baseURI = strbuf_detach(&baseURI, NULL);
+ }
+ result = git_config_from_file_with_options(config_to_bundle_list,
+ filename, list,
+ CONFIG_SCOPE_UNKNOWN,
+ &opts);
+
+ if (!result && list->mode == BUNDLE_MODE_NONE) {
+ warning(_("bundle list at '%s' has no mode"), uri);
+ result = 1;
+ }
+
+ return result;
+}
+
+static char *find_temp_filename(void)
+{
+ int fd;
+ struct strbuf name = STRBUF_INIT;
+ /*
+ * Find a temporary filename that is available. This is briefly
+ * racy, but unlikely to collide.
+ */
+ fd = odb_mkstemp(&name, "bundles/tmp_uri_XXXXXX");
+ if (fd < 0) {
+ warning(_("failed to create temporary file"));
+ return NULL;
+ }
+
+ close(fd);
+ unlink(name.buf);
+ return strbuf_detach(&name, NULL);
+}
+
+static int download_https_uri_to_file(const char *file, const char *uri)
+{
+ int result = 0;
+ struct child_process cp = CHILD_PROCESS_INIT;
+ FILE *child_in = NULL, *child_out = NULL;
+ struct strbuf line = STRBUF_INIT;
+ int found_get = 0;
+
+ strvec_pushl(&cp.args, "git-remote-https", uri, NULL);
+ cp.err = -1;
+ cp.in = -1;
+ cp.out = -1;
+
+ if (start_command(&cp))
+ return 1;
+
+ child_in = fdopen(cp.in, "w");
+ if (!child_in) {
+ result = 1;
+ goto cleanup;
+ }
+
+ child_out = fdopen(cp.out, "r");
+ if (!child_out) {
+ result = 1;
+ goto cleanup;
+ }
+
+ fprintf(child_in, "capabilities\n");
+ fflush(child_in);
+
+ while (!strbuf_getline(&line, child_out)) {
+ if (!line.len)
+ break;
+ if (!strcmp(line.buf, "get"))
+ found_get = 1;
+ }
+ strbuf_release(&line);
+
+ if (!found_get) {
+ result = error(_("insufficient capabilities"));
+ goto cleanup;
+ }
+
+ fprintf(child_in, "get %s %s\n\n", uri, file);
+
+cleanup:
+ if (child_in)
+ fclose(child_in);
+ if (finish_command(&cp))
+ return 1;
+ if (child_out)
+ fclose(child_out);
+ return result;
+}
+
+static int copy_uri_to_file(const char *filename, const char *uri)
+{
+ const char *out;
+
+ if (starts_with(uri, "https:") ||
+ starts_with(uri, "http:"))
+ return download_https_uri_to_file(filename, uri);
+
+ if (skip_prefix(uri, "file://", &out))
+ uri = out;
+
+ /* Copy as a file */
+ return copy_file(filename, uri, 0);
+}
+
+static int unbundle_from_file(struct repository *r, const char *file)
+{
+ int result = 0;
+ int bundle_fd;
+ struct bundle_header header = BUNDLE_HEADER_INIT;
+ struct string_list_item *refname;
+ struct strbuf bundle_ref = STRBUF_INIT;
+ size_t bundle_prefix_len;
+
+ if ((bundle_fd = read_bundle_header(file, &header)) < 0)
+ return 1;
+
+ /*
+ * Skip the reachability walk here, since we will be adding
+ * a reachable ref pointing to the new tips, which will reach
+ * the prerequisite commits.
+ */
+ if ((result = unbundle(r, &header, bundle_fd, NULL,
+ VERIFY_BUNDLE_QUIET)))
+ return 1;
+
+ /*
+ * Convert all refs/heads/ from the bundle into refs/bundles/
+ * in the local repository.
+ */
+ strbuf_addstr(&bundle_ref, "refs/bundles/");
+ bundle_prefix_len = bundle_ref.len;
+
+ for_each_string_list_item(refname, &header.references) {
+ struct object_id *oid = refname->util;
+ struct object_id old_oid;
+ const char *branch_name;
+ int has_old;
+
+ if (!skip_prefix(refname->string, "refs/heads/", &branch_name))
+ continue;
+
+ strbuf_setlen(&bundle_ref, bundle_prefix_len);
+ strbuf_addstr(&bundle_ref, branch_name);
+
+ has_old = !read_ref(bundle_ref.buf, &old_oid);
+ update_ref("fetched bundle", bundle_ref.buf, oid,
+ has_old ? &old_oid : NULL,
+ REF_SKIP_OID_VERIFICATION,
+ UPDATE_REFS_MSG_ON_ERR);
+ }
+
+ bundle_header_release(&header);
+ return result;
+}
+
+struct bundle_list_context {
+ struct repository *r;
+ struct bundle_list *list;
+ enum bundle_list_mode mode;
+ int count;
+ int depth;
+};
+
+/*
+ * This early definition is necessary because we use indirect recursion:
+ *
+ * While iterating through a bundle list that was downloaded as part
+ * of fetch_bundle_uri_internal(), iterator methods eventually call it
+ * again, but with depth + 1.
+ */
+static int fetch_bundle_uri_internal(struct repository *r,
+ struct remote_bundle_info *bundle,
+ int depth,
+ struct bundle_list *list);
+
+static int download_bundle_to_file(struct remote_bundle_info *bundle, void *data)
+{
+ int res;
+ struct bundle_list_context *ctx = data;
+
+ if (ctx->mode == BUNDLE_MODE_ANY && ctx->count)
+ return 0;
+
+ res = fetch_bundle_uri_internal(ctx->r, bundle, ctx->depth + 1, ctx->list);
+
+ /*
+ * Only increment count if the download succeeded. If our mode is
+ * BUNDLE_MODE_ANY, then we will want to try other URIs in the
+ * list in case they work instead.
+ */
+ if (!res)
+ ctx->count++;
+
+ /*
+ * To be opportunistic as possible, we continue iterating and
+ * download as many bundles as we can, so we can apply the ones
+ * that work, even in BUNDLE_MODE_ALL mode.
+ */
+ return 0;
+}
+
+struct bundles_for_sorting {
+ struct remote_bundle_info **items;
+ size_t alloc;
+ size_t nr;
+};
+
+static int append_bundle(struct remote_bundle_info *bundle, void *data)
+{
+ struct bundles_for_sorting *list = data;
+ list->items[list->nr++] = bundle;
+ return 0;
+}
+
+/**
+ * For use in QSORT() to get a list sorted by creationToken
+ * in decreasing order.
+ */
+static int compare_creation_token_decreasing(const void *va, const void *vb)
+{
+ const struct remote_bundle_info * const *a = va;
+ const struct remote_bundle_info * const *b = vb;
+
+ if ((*a)->creationToken > (*b)->creationToken)
+ return -1;
+ if ((*a)->creationToken < (*b)->creationToken)
+ return 1;
+ return 0;
+}
+
+static int fetch_bundles_by_token(struct repository *r,
+ struct bundle_list *list)
+{
+ int cur;
+ int move_direction = 0;
+ const char *creationTokenStr;
+ uint64_t maxCreationToken = 0, newMaxCreationToken = 0;
+ struct bundle_list_context ctx = {
+ .r = r,
+ .list = list,
+ .mode = list->mode,
+ };
+ struct bundles_for_sorting bundles = {
+ .alloc = hashmap_get_size(&list->bundles),
+ };
+
+ ALLOC_ARRAY(bundles.items, bundles.alloc);
+
+ for_all_bundles_in_list(list, append_bundle, &bundles);
+
+ if (!bundles.nr) {
+ free(bundles.items);
+ return 0;
+ }
+
+ QSORT(bundles.items, bundles.nr, compare_creation_token_decreasing);
+
+ /*
+ * If fetch.bundleCreationToken exists, parses to a uint64t, and
+ * is not strictly smaller than the maximum creation token in the
+ * bundle list, then do not download any bundles.
+ */
+ if (!repo_config_get_value(r,
+ "fetch.bundlecreationtoken",
+ &creationTokenStr) &&
+ sscanf(creationTokenStr, "%"PRIu64, &maxCreationToken) == 1 &&
+ bundles.items[0]->creationToken <= maxCreationToken) {
+ free(bundles.items);
+ return 0;
+ }
+
+ /*
+ * Attempt to download and unbundle the minimum number of bundles by
+ * creationToken in decreasing order. If we fail to unbundle (after
+ * a successful download) then move to the next non-downloaded bundle
+ * and attempt downloading. Once we succeed in applying a bundle,
+ * move to the previous unapplied bundle and attempt to unbundle it
+ * again.
+ *
+ * In the case of a fresh clone, we will likely download all of the
+ * bundles before successfully unbundling the oldest one, then the
+ * rest of the bundles unbundle successfully in increasing order
+ * of creationToken.
+ *
+ * If there are existing objects, then this process may terminate
+ * early when all required commits from "new" bundles exist in the
+ * repo's object store.
+ */
+ cur = 0;
+ while (cur >= 0 && cur < bundles.nr) {
+ struct remote_bundle_info *bundle = bundles.items[cur];
+
+ /*
+ * If we need to dig into bundles below the previous
+ * creation token value, then likely we are in an erroneous
+ * state due to missing or invalid bundles. Halt the process
+ * instead of continuing to download extra data.
+ */
+ if (bundle->creationToken <= maxCreationToken)
+ break;
+
+ if (!bundle->file) {
+ /*
+ * Not downloaded yet. Try downloading.
+ *
+ * Note that bundle->file is non-NULL if a download
+ * was attempted, even if it failed to download.
+ */
+ if (fetch_bundle_uri_internal(ctx.r, bundle, ctx.depth + 1, ctx.list)) {
+ /* Mark as unbundled so we do not retry. */
+ bundle->unbundled = 1;
+
+ /* Try looking deeper in the list. */
+ move_direction = 1;
+ goto move;
+ }
+
+ /* We expect bundles when using creationTokens. */
+ if (!is_bundle(bundle->file, 1)) {
+ warning(_("file downloaded from '%s' is not a bundle"),
+ bundle->uri);
+ break;
+ }
+ }
+
+ if (bundle->file && !bundle->unbundled) {
+ /*
+ * This was downloaded, but not successfully
+ * unbundled. Try unbundling again.
+ */
+ if (unbundle_from_file(ctx.r, bundle->file)) {
+ /* Try looking deeper in the list. */
+ move_direction = 1;
+ } else {
+ /*
+ * Succeeded in unbundle. Retry bundles
+ * that previously failed to unbundle.
+ */
+ move_direction = -1;
+ bundle->unbundled = 1;
+
+ if (bundle->creationToken > newMaxCreationToken)
+ newMaxCreationToken = bundle->creationToken;
+ }
+ }
+
+ /*
+ * Else case: downloaded and unbundled successfully.
+ * Skip this by moving in the same direction as the
+ * previous step.
+ */
+
+move:
+ /* Move in the specified direction and repeat. */
+ cur += move_direction;
+ }
+
+ /*
+ * We succeed if the loop terminates because 'cur' drops below
+ * zero. The other case is that we terminate because 'cur'
+ * reaches the end of the list, so we have a failure no matter
+ * which bundles we apply from the list.
+ */
+ if (cur < 0) {
+ struct strbuf value = STRBUF_INIT;
+ strbuf_addf(&value, "%"PRIu64"", newMaxCreationToken);
+ if (repo_config_set_multivar_gently(ctx.r,
+ "fetch.bundleCreationToken",
+ value.buf, NULL, 0))
+ warning(_("failed to store maximum creation token"));
+
+ strbuf_release(&value);
+ }
+
+ free(bundles.items);
+ return cur >= 0;
+}
+
+static int download_bundle_list(struct repository *r,
+ struct bundle_list *local_list,
+ struct bundle_list *global_list,
+ int depth)
+{
+ struct bundle_list_context ctx = {
+ .r = r,
+ .list = global_list,
+ .depth = depth + 1,
+ .mode = local_list->mode,
+ };
+
+ return for_all_bundles_in_list(local_list, download_bundle_to_file, &ctx);
+}
+
+static int fetch_bundle_list_in_config_format(struct repository *r,
+ struct bundle_list *global_list,
+ struct remote_bundle_info *bundle,
+ int depth)
+{
+ int result;
+ struct bundle_list list_from_bundle;
+
+ init_bundle_list(&list_from_bundle);
+
+ if ((result = bundle_uri_parse_config_format(bundle->uri,
+ bundle->file,
+ &list_from_bundle)))
+ goto cleanup;
+
+ if (list_from_bundle.mode == BUNDLE_MODE_NONE) {
+ warning(_("unrecognized bundle mode from URI '%s'"),
+ bundle->uri);
+ result = -1;
+ goto cleanup;
+ }
+
+ /*
+ * If this list uses the creationToken heuristic, then the URIs
+ * it advertises are expected to be bundles, not nested lists.
+ * We can drop 'global_list' and 'depth'.
+ */
+ if (list_from_bundle.heuristic == BUNDLE_HEURISTIC_CREATIONTOKEN) {
+ result = fetch_bundles_by_token(r, &list_from_bundle);
+ global_list->heuristic = BUNDLE_HEURISTIC_CREATIONTOKEN;
+ } else if ((result = download_bundle_list(r, &list_from_bundle,
+ global_list, depth)))
+ goto cleanup;
+
+cleanup:
+ clear_bundle_list(&list_from_bundle);
+ return result;
+}
+
+/**
+ * This limits the recursion on fetch_bundle_uri_internal() when following
+ * bundle lists.
+ */
+static int max_bundle_uri_depth = 4;
+
+/**
+ * Recursively download all bundles advertised at the given URI
+ * to files. If the file is a bundle, then add it to the given
+ * 'list'. Otherwise, expect a bundle list and recurse on the
+ * URIs in that list according to the list mode (ANY or ALL).
+ */
+static int fetch_bundle_uri_internal(struct repository *r,
+ struct remote_bundle_info *bundle,
+ int depth,
+ struct bundle_list *list)
+{
+ int result = 0;
+ struct remote_bundle_info *bcopy;
+
+ if (depth >= max_bundle_uri_depth) {
+ warning(_("exceeded bundle URI recursion limit (%d)"),
+ max_bundle_uri_depth);
+ return -1;
+ }
+
+ if (!bundle->file &&
+ !(bundle->file = find_temp_filename())) {
+ result = -1;
+ goto cleanup;
+ }
+
+ if ((result = copy_uri_to_file(bundle->file, bundle->uri))) {
+ warning(_("failed to download bundle from URI '%s'"), bundle->uri);
+ goto cleanup;
+ }
+
+ if ((result = !is_bundle(bundle->file, 1))) {
+ result = fetch_bundle_list_in_config_format(
+ r, list, bundle, depth);
+ if (result)
+ warning(_("file at URI '%s' is not a bundle or bundle list"),
+ bundle->uri);
+ goto cleanup;
+ }
+
+ /* Copy the bundle and insert it into the global list. */
+ CALLOC_ARRAY(bcopy, 1);
+ bcopy->id = xstrdup(bundle->id);
+ bcopy->file = xstrdup(bundle->file);
+ hashmap_entry_init(&bcopy->ent, strhash(bcopy->id));
+ hashmap_add(&list->bundles, &bcopy->ent);
+
+cleanup:
+ if (result && bundle->file)
+ unlink(bundle->file);
+ return result;
+}
+
+/**
+ * This loop iterator breaks the loop with nonzero return code on the
+ * first successful unbundling of a bundle.
+ */
+static int attempt_unbundle(struct remote_bundle_info *info, void *data)
+{
+ struct repository *r = data;
+
+ if (!info->file || info->unbundled)
+ return 0;
+
+ if (!unbundle_from_file(r, info->file)) {
+ info->unbundled = 1;
+ return 1;
+ }
+
+ return 0;
+}
+
+static int unbundle_all_bundles(struct repository *r,
+ struct bundle_list *list)
+{
+ /*
+ * Iterate through all bundles looking for ones that can
+ * successfully unbundle. If any succeed, then perhaps another
+ * will succeed in the next attempt.
+ *
+ * Keep in mind that a non-zero result for the loop here means
+ * the loop terminated early on a successful unbundling, which
+ * signals that we can try again.
+ */
+ while (for_all_bundles_in_list(list, attempt_unbundle, r)) ;
+
+ return 0;
+}
+
+static int unlink_bundle(struct remote_bundle_info *info, void *data UNUSED)
+{
+ if (info->file)
+ unlink_or_warn(info->file);
+ return 0;
+}
+
+int fetch_bundle_uri(struct repository *r, const char *uri,
+ int *has_heuristic)
+{
+ int result;
+ struct bundle_list list;
+ struct remote_bundle_info bundle = {
+ .uri = xstrdup(uri),
+ .id = xstrdup(""),
+ };
+
+ init_bundle_list(&list);
+
+ /*
+ * Do not fetch an empty bundle URI. An empty bundle URI
+ * could signal that a configured bundle URI has been disabled.
+ */
+ if (!*uri) {
+ result = 0;
+ goto cleanup;
+ }
+
+ /* If a bundle is added to this global list, then it is required. */
+ list.mode = BUNDLE_MODE_ALL;
+
+ if ((result = fetch_bundle_uri_internal(r, &bundle, 0, &list)))
+ goto cleanup;
+
+ result = unbundle_all_bundles(r, &list);
+
+cleanup:
+ if (has_heuristic)
+ *has_heuristic = (list.heuristic != BUNDLE_HEURISTIC_NONE);
+ for_all_bundles_in_list(&list, unlink_bundle, NULL);
+ clear_bundle_list(&list);
+ clear_remote_bundle_info(&bundle, NULL);
+ return result;
+}
+
+int fetch_bundle_list(struct repository *r, struct bundle_list *list)
+{
+ int result;
+ struct bundle_list global_list;
+
+ /*
+ * If the creationToken heuristic is used, then the URIs
+ * advertised by 'list' are not nested lists and instead
+ * direct bundles. We do not need to use global_list.
+ */
+ if (list->heuristic == BUNDLE_HEURISTIC_CREATIONTOKEN)
+ return fetch_bundles_by_token(r, list);
+
+ init_bundle_list(&global_list);
+
+ /* If a bundle is added to this global list, then it is required. */
+ global_list.mode = BUNDLE_MODE_ALL;
+
+ if ((result = download_bundle_list(r, list, &global_list, 0)))
+ goto cleanup;
+
+ if (list->heuristic == BUNDLE_HEURISTIC_CREATIONTOKEN)
+ result = fetch_bundles_by_token(r, list);
+ else
+ result = unbundle_all_bundles(r, &global_list);
+
+cleanup:
+ for_all_bundles_in_list(&global_list, unlink_bundle, NULL);
+ clear_bundle_list(&global_list);
+ return result;
+}
+
+/**
+ * API for serve.c.
+ */
+
+int bundle_uri_advertise(struct repository *r, struct strbuf *value UNUSED)
+{
+ static int advertise_bundle_uri = -1;
+
+ if (advertise_bundle_uri != -1)
+ goto cached;
+
+ advertise_bundle_uri = 0;
+ repo_config_get_maybe_bool(r, "uploadpack.advertisebundleuris", &advertise_bundle_uri);
+
+cached:
+ return advertise_bundle_uri;
+}
+
+static int config_to_packet_line(const char *key, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *data)
+{
+ struct packet_reader *writer = data;
+
+ if (starts_with(key, "bundle."))
+ packet_write_fmt(writer->fd, "%s=%s", key, value);
+
+ return 0;
+}
+
+int bundle_uri_command(struct repository *r,
+ struct packet_reader *request)
+{
+ struct packet_writer writer;
+ packet_writer_init(&writer, 1);
+
+ while (packet_reader_read(request) == PACKET_READ_NORMAL)
+ die(_("bundle-uri: unexpected argument: '%s'"), request->line);
+ if (request->status != PACKET_READ_FLUSH)
+ die(_("bundle-uri: expected flush after arguments"));
+
+ /*
+ * Read all "bundle.*" config lines to the client as key=value
+ * packet lines.
+ */
+ repo_config(r, config_to_packet_line, &writer);
+
+ packet_writer_flush(&writer);
+
+ return 0;
+}
+
+/**
+ * General API for {transport,connect}.c etc.
+ */
+int bundle_uri_parse_line(struct bundle_list *list, const char *line)
+{
+ int result;
+ const char *equals;
+ struct strbuf key = STRBUF_INIT;
+
+ if (!strlen(line))
+ return error(_("bundle-uri: got an empty line"));
+
+ equals = strchr(line, '=');
+
+ if (!equals)
+ return error(_("bundle-uri: line is not of the form 'key=value'"));
+ if (line == equals || !*(equals + 1))
+ return error(_("bundle-uri: line has empty key or value"));
+
+ strbuf_add(&key, line, equals - line);
+ result = bundle_list_update(key.buf, equals + 1, list);
+ strbuf_release(&key);
+
+ return result;
+}
diff --git a/bundle-uri.h b/bundle-uri.h
new file mode 100644
index 0000000..6dbc780
--- /dev/null
+++ b/bundle-uri.h
@@ -0,0 +1,168 @@
+#ifndef BUNDLE_URI_H
+#define BUNDLE_URI_H
+
+#include "hashmap.h"
+#include "strbuf.h"
+
+struct packet_reader;
+struct repository;
+struct string_list;
+
+/**
+ * The remote_bundle_info struct contains information for a single bundle
+ * URI. This may be initialized simply by a given URI or might have
+ * additional metadata associated with it if the bundle was advertised by
+ * a bundle list.
+ */
+struct remote_bundle_info {
+ struct hashmap_entry ent;
+
+ /**
+ * The 'id' is a name given to the bundle for reference
+ * by other bundle infos.
+ */
+ char *id;
+
+ /**
+ * The 'uri' is the location of the remote bundle so
+ * it can be downloaded on-demand. This will be NULL
+ * if there was no table of contents.
+ */
+ char *uri;
+
+ /**
+ * If the bundle has been downloaded, then 'file' is a
+ * filename storing its contents. Otherwise, 'file' is
+ * NULL.
+ */
+ char *file;
+
+ /**
+ * If the bundle has been unbundled successfully, then
+ * this boolean is true.
+ */
+ unsigned unbundled:1;
+
+ /**
+ * If the bundle is part of a list with the creationToken
+ * heuristic, then we use this member for sorting the bundles.
+ */
+ uint64_t creationToken;
+};
+
+#define REMOTE_BUNDLE_INFO_INIT { 0 }
+
+enum bundle_list_mode {
+ BUNDLE_MODE_NONE = 0,
+ BUNDLE_MODE_ALL,
+ BUNDLE_MODE_ANY
+};
+
+enum bundle_list_heuristic {
+ BUNDLE_HEURISTIC_NONE = 0,
+ BUNDLE_HEURISTIC_CREATIONTOKEN,
+
+ /* Must be last. */
+ BUNDLE_HEURISTIC__COUNT
+};
+
+/**
+ * A bundle_list contains an unordered set of remote_bundle_info structs,
+ * as well as information about the bundle listing, such as version and
+ * mode.
+ */
+struct bundle_list {
+ int version;
+ enum bundle_list_mode mode;
+ struct hashmap bundles;
+
+ /**
+ * The baseURI of a bundle_list is the URI that provided the list.
+ *
+ * In the case of the 'bundle-uri' protocol v2 command, the base
+ * URI is the URI of the Git remote.
+ *
+ * Otherwise, the bundle list was downloaded over HTTP from some
+ * known URI. 'baseURI' is set to that value.
+ *
+ * The baseURI is used as the base for any relative URIs
+ * advertised by the bundle list at that location.
+ */
+ char *baseURI;
+
+ /**
+ * A list can have a heuristic, which helps reduce the number of
+ * downloaded bundles.
+ */
+ enum bundle_list_heuristic heuristic;
+};
+
+void init_bundle_list(struct bundle_list *list);
+void clear_bundle_list(struct bundle_list *list);
+
+typedef int (*bundle_iterator)(struct remote_bundle_info *bundle,
+ void *data);
+
+int for_all_bundles_in_list(struct bundle_list *list,
+ bundle_iterator iter,
+ void *data);
+
+struct FILE;
+void print_bundle_list(FILE *fp, struct bundle_list *list);
+
+/**
+ * A bundle URI may point to a bundle list where the key=value
+ * pairs are provided in config file format. This method is
+ * exposed publicly for testing purposes.
+ */
+int bundle_uri_parse_config_format(const char *uri,
+ const char *filename,
+ struct bundle_list *list);
+
+/**
+ * Fetch data from the given 'uri' and unbundle the bundle data found
+ * based on that information.
+ *
+ * Returns non-zero if no bundle information is found at the given 'uri'.
+ *
+ * If the pointer 'has_heuristic' is non-NULL, then the value it points to
+ * will be set to be non-zero if and only if the fetched list has a
+ * heuristic value. Such a value indicates that the list was designed for
+ * incremental fetches.
+ */
+int fetch_bundle_uri(struct repository *r, const char *uri,
+ int *has_heuristic);
+
+/**
+ * Given a bundle list that was already advertised (likely by the
+ * bundle-uri protocol v2 verb) at the given uri, fetch and unbundle the
+ * bundles according to the bundle strategy of that list.
+ *
+ * It is expected that the given 'list' is initialized, including its
+ * 'baseURI' value.
+ *
+ * Returns non-zero if there was an error trying to download the list
+ * or any of its advertised bundles.
+ */
+int fetch_bundle_list(struct repository *r,
+ struct bundle_list *list);
+
+/**
+ * API for serve.c.
+ */
+int bundle_uri_advertise(struct repository *r, struct strbuf *value);
+int bundle_uri_command(struct repository *r, struct packet_reader *request);
+
+/**
+ * General API for {transport,connect}.c etc.
+ */
+
+/**
+ * Parse a "key=value" packet line from the bundle-uri verb.
+ *
+ * Returns 0 on success and non-zero on error.
+ */
+int bundle_uri_parse_line(struct bundle_list *list,
+ const char *line);
+
+#endif
diff --git a/bundle.c b/bundle.c
index 0208e6d..a9744da 100644
--- a/bundle.c
+++ b/bundle.c
@@ -1,7 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "lockfile.h"
#include "bundle.h"
-#include "object-store.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-store-ll.h"
#include "repository.h"
#include "object.h"
#include "commit.h"
@@ -12,6 +15,8 @@
#include "refs.h"
#include "strvec.h"
#include "list-objects-filter-options.h"
+#include "connected.h"
+#include "write-or-die.h"
static const char v2_bundle_signature[] = "# v2 git bundle\n";
static const char v3_bundle_signature[] = "# v3 git bundle\n";
@@ -187,79 +192,65 @@ static int list_refs(struct string_list *r, int argc, const char **argv)
/* Remember to update object flag allocation in object.h */
#define PREREQ_MARK (1u<<16)
+struct string_list_iterator {
+ struct string_list *list;
+ size_t cur;
+};
+
+static const struct object_id *iterate_ref_map(void *cb_data)
+{
+ struct string_list_iterator *iter = cb_data;
+
+ if (iter->cur >= iter->list->nr)
+ return NULL;
+
+ return iter->list->items[iter->cur++].util;
+}
+
int verify_bundle(struct repository *r,
struct bundle_header *header,
- int verbose)
+ enum verify_bundle_flags flags)
{
/*
* Do fast check, then if any prereqs are missing then go line by line
* to be verbose about the errors
*/
struct string_list *p = &header->prerequisites;
- struct rev_info revs = REV_INFO_INIT;
- const char *argv[] = {NULL, "--all", NULL};
- struct commit *commit;
- int i, ret = 0, req_nr;
+ int i, ret = 0;
const char *message = _("Repository lacks these prerequisite commits:");
+ struct string_list_iterator iter = {
+ .list = p,
+ };
+ struct check_connected_options opts = {
+ .quiet = 1,
+ };
- if (!r || !r->objects || !r->objects->odb) {
- ret = error(_("need a repository to verify a bundle"));
- goto cleanup;
- }
+ if (!r || !r->objects || !r->objects->odb)
+ return error(_("need a repository to verify a bundle"));
- repo_init_revisions(r, &revs, NULL);
for (i = 0; i < p->nr; i++) {
struct string_list_item *e = p->items + i;
const char *name = e->string;
struct object_id *oid = e->util;
struct object *o = parse_object(r, oid);
- if (o) {
- o->flags |= PREREQ_MARK;
- add_pending_object(&revs, o, name);
+ if (o)
continue;
- }
- if (++ret == 1)
- error("%s", message);
- error("%s %s", oid_to_hex(oid), name);
- }
- if (revs.pending.nr != p->nr)
- goto cleanup;
- req_nr = revs.pending.nr;
- setup_revisions(2, argv, &revs, NULL);
-
- list_objects_filter_copy(&revs.filter, &header->filter);
-
- if (prepare_revision_walk(&revs))
- die(_("revision walk setup failed"));
-
- i = req_nr;
- while (i && (commit = get_revision(&revs)))
- if (commit->object.flags & PREREQ_MARK)
- i--;
-
- for (i = 0; i < p->nr; i++) {
- struct string_list_item *e = p->items + i;
- const char *name = e->string;
- const struct object_id *oid = e->util;
- struct object *o = parse_object(r, oid);
- assert(o); /* otherwise we'd have returned early */
- if (o->flags & SHOWN)
+ ret++;
+ if (flags & VERIFY_BUNDLE_QUIET)
continue;
- if (++ret == 1)
+ if (ret == 1)
error("%s", message);
error("%s %s", oid_to_hex(oid), name);
}
+ if (ret)
+ goto cleanup;
- /* Clean up objects used, as they will be reused. */
- for (i = 0; i < p->nr; i++) {
- struct string_list_item *e = p->items + i;
- struct object_id *oid = e->util;
- commit = lookup_commit_reference_gently(r, oid, 1);
- if (commit)
- clear_commit_marks(commit, ALL_REV_FLAGS);
- }
+ if ((ret = check_connected(iterate_ref_map, &iter, &opts)))
+ error(_("some prerequisite commits exist in the object store, "
+ "but are not connected to the repository's history"));
- if (verbose) {
+ /* TODO: preserve this verbose language. */
+ if (flags & VERIFY_BUNDLE_VERBOSE) {
struct string_list *r;
r = &header->references;
@@ -280,14 +271,13 @@ int verify_bundle(struct repository *r,
list_refs(r, 0, NULL);
}
- printf_ln("The bundle uses this hash algorithm: %s",
+ printf_ln(_("The bundle uses this hash algorithm: %s"),
header->hash_algo->name);
if (header->filter.choice)
- printf_ln("The bundle uses this filter: %s",
+ printf_ln(_("The bundle uses this filter: %s"),
list_objects_filter_spec(&header->filter));
}
cleanup:
- release_revisions(&revs);
return ret;
}
@@ -307,7 +297,7 @@ static int is_tag_in_date_range(struct object *tag, struct rev_info *revs)
if (revs->max_age == -1 && revs->min_age == -1)
goto out;
- buf = read_object_file(&tag->oid, &type, &size);
+ buf = repo_read_object_file(the_repository, &tag->oid, &type, &size);
if (!buf)
goto out;
line = memmem(buf, size, "\ntagger ", 8);
@@ -396,7 +386,8 @@ static int write_bundle_refs(int bundle_fd, struct rev_info *revs)
if (e->item->flags & UNINTERESTING)
continue;
- if (dwim_ref(e->name, strlen(e->name), &oid, &ref, 0) != 1)
+ if (repo_dwim_ref(the_repository, e->name, strlen(e->name),
+ &oid, &ref, 0) != 1)
goto skip_write_ref;
if (read_ref_full(e->name, RESOLVE_REF_READING, &oid, &flag))
flag = 0;
@@ -620,9 +611,14 @@ err:
}
int unbundle(struct repository *r, struct bundle_header *header,
- int bundle_fd, struct strvec *extra_index_pack_args)
+ int bundle_fd, struct strvec *extra_index_pack_args,
+ enum verify_bundle_flags flags)
{
struct child_process ip = CHILD_PROCESS_INIT;
+
+ if (verify_bundle(r, header, flags))
+ return -1;
+
strvec_pushl(&ip.args, "index-pack", "--fix-thin", "--stdin", NULL);
/* If there is a filter, then we need to create the promisor pack. */
@@ -634,8 +630,6 @@ int unbundle(struct repository *r, struct bundle_header *header,
strvec_clear(extra_index_pack_args);
}
- if (verify_bundle(r, header, 0))
- return -1;
ip.in = bundle_fd;
ip.no_stdout = 1;
ip.git_cmd = 1;
diff --git a/bundle.h b/bundle.h
index 0c052f5..021adbd 100644
--- a/bundle.h
+++ b/bundle.h
@@ -2,7 +2,6 @@
#define BUNDLE_H
#include "strvec.h"
-#include "cache.h"
#include "string-list.h"
#include "list-objects-filter-options.h"
@@ -18,6 +17,7 @@ struct bundle_header {
{ \
.prerequisites = STRING_LIST_INIT_DUP, \
.references = STRING_LIST_INIT_DUP, \
+ .filter = LIST_OBJECTS_FILTER_INIT, \
}
void bundle_header_init(struct bundle_header *header);
void bundle_header_release(struct bundle_header *header);
@@ -29,7 +29,14 @@ int read_bundle_header_fd(int fd, struct bundle_header *header,
int create_bundle(struct repository *r, const char *path,
int argc, const char **argv, struct strvec *pack_options,
int version);
-int verify_bundle(struct repository *r, struct bundle_header *header, int verbose);
+
+enum verify_bundle_flags {
+ VERIFY_BUNDLE_VERBOSE = (1 << 0),
+ VERIFY_BUNDLE_QUIET = (1 << 1),
+};
+
+int verify_bundle(struct repository *r, struct bundle_header *header,
+ enum verify_bundle_flags flags);
/**
* Unbundle after reading the header with read_bundle_header().
@@ -40,9 +47,13 @@ int verify_bundle(struct repository *r, struct bundle_header *header, int verbos
* Provide "extra_index_pack_args" to pass any extra arguments
* (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'.
*/
int unbundle(struct repository *r, struct bundle_header *header,
- int bundle_fd, struct strvec *extra_index_pack_args);
+ int bundle_fd, struct strvec *extra_index_pack_args,
+ enum verify_bundle_flags flags);
int list_bundle_refs(struct bundle_header *header,
int argc, const char **argv);
diff --git a/cache-tree.c b/cache-tree.c
index 56db0b5..387c0a3 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -1,13 +1,18 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "environment.h"
+#include "hex.h"
#include "lockfile.h"
#include "tree.h"
#include "tree-walk.h"
#include "cache-tree.h"
#include "bulk-checkin.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "read-cache-ll.h"
#include "replace-object.h"
#include "promisor-remote.h"
-#include "sparse-index.h"
+#include "trace.h"
+#include "trace2.h"
#ifndef DEBUG_CACHE_TREE
#define DEBUG_CACHE_TREE 0
@@ -229,7 +234,7 @@ int cache_tree_fully_valid(struct cache_tree *it)
int i;
if (!it)
return 0;
- if (it->entry_count < 0 || !has_object_file(&it->oid))
+ if (it->entry_count < 0 || !repo_has_object_file(the_repository, &it->oid))
return 0;
for (i = 0; i < it->subtree_nr; i++) {
if (!cache_tree_fully_valid(it->down[i]->cache_tree))
@@ -240,7 +245,7 @@ int cache_tree_fully_valid(struct cache_tree *it)
static int must_check_existence(const struct cache_entry *ce)
{
- return !(has_promisor_remote() && ce_skip_worktree(ce));
+ return !(repo_has_promisor_remote(the_repository) && ce_skip_worktree(ce));
}
static int update_one(struct cache_tree *it,
@@ -280,7 +285,7 @@ static int update_one(struct cache_tree *it,
}
}
- if (0 <= it->entry_count && has_object_file(&it->oid))
+ if (0 <= it->entry_count && repo_has_object_file(the_repository, &it->oid))
return it->entry_count;
/*
@@ -386,7 +391,7 @@ static int update_one(struct cache_tree *it,
ce_missing_ok = mode == S_IFGITLINK || missing_ok ||
!must_check_existence(ce);
if (is_null_oid(oid) ||
- (!ce_missing_ok && !has_object_file(oid))) {
+ (!ce_missing_ok && !repo_has_object_file(the_repository, oid))) {
strbuf_release(&buffer);
if (expected_missing)
return -1;
@@ -405,7 +410,7 @@ static int update_one(struct cache_tree *it,
}
/*
- * CE_INTENT_TO_ADD entries exist on on-disk index but
+ * CE_INTENT_TO_ADD entries exist in on-disk index but
* they are not part of generated trees. Invalidate up
* to root to force cache-tree users to read elsewhere.
*/
@@ -434,7 +439,7 @@ static int update_one(struct cache_tree *it,
struct object_id oid;
hash_object_file(the_hash_algo, buffer.buf, buffer.len,
OBJ_TREE, &oid);
- if (has_object_file_with_flags(&oid, OBJECT_INFO_SKIP_FETCH_OBJECT))
+ if (repo_has_object_file_with_flags(the_repository, &oid, OBJECT_INFO_SKIP_FETCH_OBJECT))
oidcpy(&it->oid, &oid);
else
to_invalidate = 1;
@@ -442,7 +447,7 @@ static int update_one(struct cache_tree *it,
hash_object_file(the_hash_algo, buffer.buf, buffer.len,
OBJ_TREE, &it->oid);
} else if (write_object_file_flags(buffer.buf, buffer.len, OBJ_TREE,
- &it->oid, flags & WRITE_TREE_SILENT
+ &it->oid, NULL, flags & WRITE_TREE_SILENT
? HASH_SILENT : 0)) {
strbuf_release(&buffer);
return -1;
@@ -470,7 +475,7 @@ int cache_tree_update(struct index_state *istate, int flags)
if (!istate->cache_tree)
istate->cache_tree = cache_tree();
- if (!(flags & WRITE_TREE_MISSING_OK) && has_promisor_remote())
+ if (!(flags & WRITE_TREE_MISSING_OK) && repo_has_promisor_remote(the_repository))
prefetch_cache_entries(istate, must_check_existence);
trace_performance_enter();
@@ -760,11 +765,11 @@ static void prime_cache_tree_rec(struct repository *r,
struct tree_desc desc;
struct name_entry entry;
int cnt;
- int base_path_len = tree_path->len;
+ size_t base_path_len = tree_path->len;
oidcpy(&it->oid, &tree->object.oid);
- init_tree_desc(&desc, tree->buffer, tree->size);
+ init_tree_desc(&desc, &tree->object.oid, tree->buffer, tree->size);
cnt = 0;
while (tree_entry(&desc, &entry)) {
if (!S_ISDIR(entry.mode))
@@ -773,8 +778,8 @@ static void prime_cache_tree_rec(struct repository *r,
struct cache_tree_sub *sub;
struct tree *subtree = lookup_tree(r, &entry.oid);
- if (!subtree->object.parsed)
- parse_tree(subtree);
+ if (parse_tree(subtree) < 0)
+ exit(128);
sub = cache_tree_sub(it, entry.path);
sub->cache_tree = cache_tree();
@@ -785,7 +790,6 @@ static void prime_cache_tree_rec(struct repository *r,
*/
if (r->index->sparse_index) {
strbuf_setlen(tree_path, base_path_len);
- strbuf_grow(tree_path, base_path_len + entry.pathlen + 1);
strbuf_add(tree_path, entry.path, entry.pathlen);
strbuf_addch(tree_path, '/');
}
@@ -815,14 +819,14 @@ void prime_cache_tree(struct repository *r,
{
struct strbuf tree_path = STRBUF_INIT;
- trace2_region_enter("cache-tree", "prime_cache_tree", the_repository);
+ trace2_region_enter("cache-tree", "prime_cache_tree", r);
cache_tree_free(&istate->cache_tree);
istate->cache_tree = cache_tree();
prime_cache_tree_rec(r, istate->cache_tree, tree, &tree_path);
strbuf_release(&tree_path);
istate->cache_changed |= CACHE_TREE_CHANGED;
- trace2_region_leave("cache-tree", "prime_cache_tree", the_repository);
+ trace2_region_leave("cache-tree", "prime_cache_tree", r);
}
/*
@@ -857,9 +861,7 @@ int cache_tree_matches_traversal(struct cache_tree *root,
return 0;
}
-static void verify_one_sparse(struct repository *r,
- struct index_state *istate,
- struct cache_tree *it,
+static void verify_one_sparse(struct index_state *istate,
struct strbuf *path,
int pos)
{
@@ -910,7 +912,7 @@ static int verify_one(struct repository *r,
return 1;
if (pos >= 0) {
- verify_one_sparse(r, istate, it, path, pos);
+ verify_one_sparse(istate, path, pos);
return 0;
}
diff --git a/cache-tree.h b/cache-tree.h
index 8efecce..faae88b 100644
--- a/cache-tree.h
+++ b/cache-tree.h
@@ -1,7 +1,6 @@
#ifndef CACHE_TREE_H
#define CACHE_TREE_H
-#include "cache.h"
#include "tree.h"
#include "tree-walk.h"
@@ -53,19 +52,4 @@ int write_index_as_tree(struct object_id *oid, struct index_state *index_state,
void prime_cache_tree(struct repository *, struct index_state *, struct tree *);
int cache_tree_matches_traversal(struct cache_tree *, struct name_entry *ent, struct traverse_info *info);
-
-#ifdef USE_THE_INDEX_COMPATIBILITY_MACROS
-static inline int write_cache_as_tree(struct object_id *oid, int flags, const char *prefix)
-{
- return write_index_as_tree(oid, &the_index, get_index_file(), flags, prefix);
-}
-
-static inline int update_main_cache_tree(int flags)
-{
- if (!the_index.cache_tree)
- the_index.cache_tree = cache_tree();
- return cache_tree_update(&the_index, flags);
-}
-#endif
-
#endif
diff --git a/cache.h b/cache.h
deleted file mode 100644
index ac5ab4e..0000000
--- a/cache.h
+++ /dev/null
@@ -1,1955 +0,0 @@
-#ifndef CACHE_H
-#define CACHE_H
-
-#include "git-compat-util.h"
-#include "strbuf.h"
-#include "hashmap.h"
-#include "list.h"
-#include "advice.h"
-#include "gettext.h"
-#include "convert.h"
-#include "trace.h"
-#include "trace2.h"
-#include "string-list.h"
-#include "pack-revindex.h"
-#include "hash.h"
-#include "path.h"
-#include "oid-array.h"
-#include "repository.h"
-#include "mem-pool.h"
-
-typedef struct git_zstream {
- z_stream z;
- unsigned long avail_in;
- unsigned long avail_out;
- unsigned long total_in;
- unsigned long total_out;
- unsigned char *next_in;
- unsigned char *next_out;
-} git_zstream;
-
-void git_inflate_init(git_zstream *);
-void git_inflate_init_gzip_only(git_zstream *);
-void git_inflate_end(git_zstream *);
-int git_inflate(git_zstream *, int flush);
-
-void git_deflate_init(git_zstream *, int level);
-void git_deflate_init_gzip(git_zstream *, int level);
-void git_deflate_init_raw(git_zstream *, int level);
-void git_deflate_end(git_zstream *);
-int git_deflate_abort(git_zstream *);
-int git_deflate_end_gently(git_zstream *);
-int git_deflate(git_zstream *, int flush);
-unsigned long git_deflate_bound(git_zstream *, unsigned long);
-
-#if defined(DT_UNKNOWN) && !defined(NO_D_TYPE_IN_DIRENT)
-#define DTYPE(de) ((de)->d_type)
-#else
-#undef DT_UNKNOWN
-#undef DT_DIR
-#undef DT_REG
-#undef DT_LNK
-#define DT_UNKNOWN 0
-#define DT_DIR 1
-#define DT_REG 2
-#define DT_LNK 3
-#define DTYPE(de) DT_UNKNOWN
-#endif
-
-/* unknown mode (impossible combination S_IFIFO|S_IFCHR) */
-#define S_IFINVALID 0030000
-
-/*
- * A "directory link" is a link to another git directory.
- *
- * The value 0160000 is not normally a valid mode, and
- * also just happens to be S_IFDIR + S_IFLNK
- */
-#define S_IFGITLINK 0160000
-#define S_ISGITLINK(m) (((m) & S_IFMT) == S_IFGITLINK)
-
-/*
- * Some mode bits are also used internally for computations.
- *
- * They *must* not overlap with any valid modes, and they *must* not be emitted
- * to outside world - i.e. appear on disk or network. In other words, it's just
- * temporary fields, which we internally use, but they have to stay in-house.
- *
- * ( such approach is valid, as standard S_IF* fits into 16 bits, and in Git
- * codebase mode is `unsigned int` which is assumed to be at least 32 bits )
- */
-
-/* used internally in tree-diff */
-#define S_DIFFTREE_IFXMIN_NEQ 0x80000000
-
-
-/*
- * Intensive research over the course of many years has shown that
- * port 9418 is totally unused by anything else. Or
- *
- * Your search - "port 9418" - did not match any documents.
- *
- * as www.google.com puts it.
- *
- * This port has been properly assigned for git use by IANA:
- * git (Assigned-9418) [I06-050728-0001].
- *
- * git 9418/tcp git pack transfer service
- * git 9418/udp git pack transfer service
- *
- * with Linus Torvalds <torvalds@osdl.org> as the point of
- * contact. September 2005.
- *
- * See http://www.iana.org/assignments/port-numbers
- */
-#define DEFAULT_GIT_PORT 9418
-
-/*
- * Basic data structures for the directory cache
- */
-
-#define CACHE_SIGNATURE 0x44495243 /* "DIRC" */
-struct cache_header {
- uint32_t hdr_signature;
- uint32_t hdr_version;
- uint32_t hdr_entries;
-};
-
-#define INDEX_FORMAT_LB 2
-#define INDEX_FORMAT_UB 4
-
-/*
- * The "cache_time" is just the low 32 bits of the
- * time. It doesn't matter if it overflows - we only
- * check it for equality in the 32 bits we save.
- */
-struct cache_time {
- uint32_t sec;
- uint32_t nsec;
-};
-
-struct stat_data {
- struct cache_time sd_ctime;
- struct cache_time sd_mtime;
- unsigned int sd_dev;
- unsigned int sd_ino;
- unsigned int sd_uid;
- unsigned int sd_gid;
- unsigned int sd_size;
-};
-
-struct cache_entry {
- struct hashmap_entry ent;
- struct stat_data ce_stat_data;
- unsigned int ce_mode;
- unsigned int ce_flags;
- unsigned int mem_pool_allocated;
- unsigned int ce_namelen;
- unsigned int index; /* for link extension */
- struct object_id oid;
- char name[FLEX_ARRAY]; /* more */
-};
-
-#define CE_STAGEMASK (0x3000)
-#define CE_EXTENDED (0x4000)
-#define CE_VALID (0x8000)
-#define CE_STAGESHIFT 12
-
-/*
- * Range 0xFFFF0FFF in ce_flags is divided into
- * two parts: in-memory flags and on-disk ones.
- * Flags in CE_EXTENDED_FLAGS will get saved on-disk
- * if you want to save a new flag, add it in
- * CE_EXTENDED_FLAGS
- *
- * In-memory only flags
- */
-#define CE_UPDATE (1 << 16)
-#define CE_REMOVE (1 << 17)
-#define CE_UPTODATE (1 << 18)
-#define CE_ADDED (1 << 19)
-
-#define CE_HASHED (1 << 20)
-#define CE_FSMONITOR_VALID (1 << 21)
-#define CE_WT_REMOVE (1 << 22) /* remove in work directory */
-#define CE_CONFLICTED (1 << 23)
-
-#define CE_UNPACKED (1 << 24)
-#define CE_NEW_SKIP_WORKTREE (1 << 25)
-
-/* used to temporarily mark paths matched by pathspecs */
-#define CE_MATCHED (1 << 26)
-
-#define CE_UPDATE_IN_BASE (1 << 27)
-#define CE_STRIP_NAME (1 << 28)
-
-/*
- * Extended on-disk flags
- */
-#define CE_INTENT_TO_ADD (1 << 29)
-#define CE_SKIP_WORKTREE (1 << 30)
-/* CE_EXTENDED2 is for future extension */
-#define CE_EXTENDED2 (1U << 31)
-
-#define CE_EXTENDED_FLAGS (CE_INTENT_TO_ADD | CE_SKIP_WORKTREE)
-
-/*
- * Safeguard to avoid saving wrong flags:
- * - CE_EXTENDED2 won't get saved until its semantic is known
- * - Bits in 0x0000FFFF have been saved in ce_flags already
- * - Bits in 0x003F0000 are currently in-memory flags
- */
-#if CE_EXTENDED_FLAGS & 0x803FFFFF
-#error "CE_EXTENDED_FLAGS out of range"
-#endif
-
-#define S_ISSPARSEDIR(m) ((m) == S_IFDIR)
-
-/* Forward structure decls */
-struct pathspec;
-struct child_process;
-struct tree;
-
-/*
- * Copy the sha1 and stat state of a cache entry from one to
- * another. But we never change the name, or the hash state!
- */
-static inline void copy_cache_entry(struct cache_entry *dst,
- const struct cache_entry *src)
-{
- unsigned int state = dst->ce_flags & CE_HASHED;
- int mem_pool_allocated = dst->mem_pool_allocated;
-
- /* Don't copy hash chain and name */
- memcpy(&dst->ce_stat_data, &src->ce_stat_data,
- offsetof(struct cache_entry, name) -
- offsetof(struct cache_entry, ce_stat_data));
-
- /* Restore the hash state */
- dst->ce_flags = (dst->ce_flags & ~CE_HASHED) | state;
-
- /* Restore the mem_pool_allocated flag */
- dst->mem_pool_allocated = mem_pool_allocated;
-}
-
-static inline unsigned create_ce_flags(unsigned stage)
-{
- return (stage << CE_STAGESHIFT);
-}
-
-#define ce_namelen(ce) ((ce)->ce_namelen)
-#define ce_size(ce) cache_entry_size(ce_namelen(ce))
-#define ce_stage(ce) ((CE_STAGEMASK & (ce)->ce_flags) >> CE_STAGESHIFT)
-#define ce_uptodate(ce) ((ce)->ce_flags & CE_UPTODATE)
-#define ce_skip_worktree(ce) ((ce)->ce_flags & CE_SKIP_WORKTREE)
-#define ce_mark_uptodate(ce) ((ce)->ce_flags |= CE_UPTODATE)
-#define ce_intent_to_add(ce) ((ce)->ce_flags & CE_INTENT_TO_ADD)
-
-#define ce_permissions(mode) (((mode) & 0100) ? 0755 : 0644)
-static inline unsigned int create_ce_mode(unsigned int mode)
-{
- if (S_ISLNK(mode))
- return S_IFLNK;
- if (S_ISSPARSEDIR(mode))
- return S_IFDIR;
- if (S_ISDIR(mode) || S_ISGITLINK(mode))
- return S_IFGITLINK;
- return S_IFREG | ce_permissions(mode);
-}
-static inline unsigned int ce_mode_from_stat(const struct cache_entry *ce,
- unsigned int mode)
-{
- extern int trust_executable_bit, has_symlinks;
- if (!has_symlinks && S_ISREG(mode) &&
- ce && S_ISLNK(ce->ce_mode))
- return ce->ce_mode;
- if (!trust_executable_bit && S_ISREG(mode)) {
- if (ce && S_ISREG(ce->ce_mode))
- return ce->ce_mode;
- return create_ce_mode(0666);
- }
- return create_ce_mode(mode);
-}
-static inline int ce_to_dtype(const struct cache_entry *ce)
-{
- unsigned ce_mode = ntohl(ce->ce_mode);
- if (S_ISREG(ce_mode))
- return DT_REG;
- else if (S_ISDIR(ce_mode) || S_ISGITLINK(ce_mode))
- return DT_DIR;
- else if (S_ISLNK(ce_mode))
- return DT_LNK;
- else
- return DT_UNKNOWN;
-}
-static inline unsigned int canon_mode(unsigned int mode)
-{
- if (S_ISREG(mode))
- return S_IFREG | ce_permissions(mode);
- if (S_ISLNK(mode))
- return S_IFLNK;
- if (S_ISDIR(mode))
- return S_IFDIR;
- return S_IFGITLINK;
-}
-
-#define cache_entry_size(len) (offsetof(struct cache_entry,name) + (len) + 1)
-
-#define SOMETHING_CHANGED (1 << 0) /* unclassified changes go here */
-#define CE_ENTRY_CHANGED (1 << 1)
-#define CE_ENTRY_REMOVED (1 << 2)
-#define CE_ENTRY_ADDED (1 << 3)
-#define RESOLVE_UNDO_CHANGED (1 << 4)
-#define CACHE_TREE_CHANGED (1 << 5)
-#define SPLIT_INDEX_ORDERED (1 << 6)
-#define UNTRACKED_CHANGED (1 << 7)
-#define FSMONITOR_CHANGED (1 << 8)
-
-struct split_index;
-struct untracked_cache;
-struct progress;
-struct pattern_list;
-
-enum sparse_index_mode {
- /*
- * There are no sparse directories in the index at all.
- *
- * Repositories that don't use cone-mode sparse-checkout will
- * always have their indexes in this mode.
- */
- INDEX_EXPANDED = 0,
-
- /*
- * The index has already been collapsed to sparse directories
- * whereever possible.
- */
- INDEX_COLLAPSED,
-
- /*
- * The sparse directories that exist are outside the
- * sparse-checkout boundary, but it is possible that some file
- * entries could collapse to sparse directory entries.
- */
- INDEX_PARTIALLY_SPARSE,
-};
-
-struct index_state {
- struct cache_entry **cache;
- unsigned int version;
- unsigned int cache_nr, cache_alloc, cache_changed;
- struct string_list *resolve_undo;
- struct cache_tree *cache_tree;
- struct split_index *split_index;
- struct cache_time timestamp;
- unsigned name_hash_initialized : 1,
- initialized : 1,
- drop_cache_tree : 1,
- updated_workdir : 1,
- updated_skipworktree : 1,
- fsmonitor_has_run_once : 1;
- enum sparse_index_mode sparse_index;
- struct hashmap name_hash;
- struct hashmap dir_hash;
- struct object_id oid;
- struct untracked_cache *untracked;
- char *fsmonitor_last_update;
- struct ewah_bitmap *fsmonitor_dirty;
- struct mem_pool *ce_mem_pool;
- struct progress *progress;
- struct repository *repo;
- struct pattern_list *sparse_checkout_patterns;
-};
-
-/* Name hashing */
-int test_lazy_init_name_hash(struct index_state *istate, int try_threaded);
-void add_name_hash(struct index_state *istate, struct cache_entry *ce);
-void remove_name_hash(struct index_state *istate, struct cache_entry *ce);
-void free_name_hash(struct index_state *istate);
-
-/* Cache entry creation and cleanup */
-
-/*
- * Create cache_entry intended for use in the specified index. Caller
- * is responsible for discarding the cache_entry with
- * `discard_cache_entry`.
- */
-struct cache_entry *make_cache_entry(struct index_state *istate,
- unsigned int mode,
- const struct object_id *oid,
- const char *path,
- int stage,
- unsigned int refresh_options);
-
-struct cache_entry *make_empty_cache_entry(struct index_state *istate,
- size_t name_len);
-
-/*
- * Create a cache_entry that is not intended to be added to an index. If
- * `ce_mem_pool` is not NULL, the entry is allocated within the given memory
- * pool. Caller is responsible for discarding "loose" entries with
- * `discard_cache_entry()` and the memory pool with
- * `mem_pool_discard(ce_mem_pool, should_validate_cache_entries())`.
- */
-struct cache_entry *make_transient_cache_entry(unsigned int mode,
- const struct object_id *oid,
- const char *path,
- int stage,
- struct mem_pool *ce_mem_pool);
-
-struct cache_entry *make_empty_transient_cache_entry(size_t len,
- struct mem_pool *ce_mem_pool);
-
-/*
- * Discard cache entry.
- */
-void discard_cache_entry(struct cache_entry *ce);
-
-/*
- * Check configuration if we should perform extra validation on cache
- * entries.
- */
-int should_validate_cache_entries(void);
-
-/*
- * Duplicate a cache_entry. Allocate memory for the new entry from a
- * memory_pool. Takes into account cache_entry fields that are meant
- * for managing the underlying memory allocation of the cache_entry.
- */
-struct cache_entry *dup_cache_entry(const struct cache_entry *ce, struct index_state *istate);
-
-/*
- * Validate the cache entries in the index. This is an internal
- * consistency check that the cache_entry structs are allocated from
- * the expected memory pool.
- */
-void validate_cache_entries(const struct index_state *istate);
-
-/*
- * Bulk prefetch all missing cache entries that are not GITLINKs and that match
- * the given predicate. This function should only be called if
- * has_promisor_remote() returns true.
- */
-typedef int (*must_prefetch_predicate)(const struct cache_entry *);
-void prefetch_cache_entries(const struct index_state *istate,
- must_prefetch_predicate must_prefetch);
-
-#ifdef USE_THE_INDEX_COMPATIBILITY_MACROS
-extern struct index_state the_index;
-
-#define active_cache (the_index.cache)
-#define active_nr (the_index.cache_nr)
-#define active_alloc (the_index.cache_alloc)
-#define active_cache_changed (the_index.cache_changed)
-#define active_cache_tree (the_index.cache_tree)
-
-#define read_cache() repo_read_index(the_repository)
-#define read_cache_from(path) read_index_from(&the_index, (path), (get_git_dir()))
-#define read_cache_preload(pathspec) repo_read_index_preload(the_repository, (pathspec), 0)
-#define is_cache_unborn() is_index_unborn(&the_index)
-#define read_cache_unmerged() repo_read_index_unmerged(the_repository)
-#define discard_cache() discard_index(&the_index)
-#define unmerged_cache() unmerged_index(&the_index)
-#define cache_name_pos(name, namelen) index_name_pos(&the_index,(name),(namelen))
-#define add_cache_entry(ce, option) add_index_entry(&the_index, (ce), (option))
-#define rename_cache_entry_at(pos, new_name) rename_index_entry_at(&the_index, (pos), (new_name))
-#define remove_cache_entry_at(pos) remove_index_entry_at(&the_index, (pos))
-#define remove_file_from_cache(path) remove_file_from_index(&the_index, (path))
-#define add_to_cache(path, st, flags) add_to_index(&the_index, (path), (st), (flags))
-#define add_file_to_cache(path, flags) add_file_to_index(&the_index, (path), (flags))
-#define chmod_cache_entry(ce, flip) chmod_index_entry(&the_index, (ce), (flip))
-#define refresh_cache(flags) refresh_index(&the_index, (flags), NULL, NULL, NULL)
-#define refresh_and_write_cache(refresh_flags, write_flags, gentle) repo_refresh_and_write_index(the_repository, (refresh_flags), (write_flags), (gentle), NULL, NULL, NULL)
-#define ce_match_stat(ce, st, options) ie_match_stat(&the_index, (ce), (st), (options))
-#define ce_modified(ce, st, options) ie_modified(&the_index, (ce), (st), (options))
-#define cache_dir_exists(name, namelen) index_dir_exists(&the_index, (name), (namelen))
-#define cache_file_exists(name, namelen, igncase) index_file_exists(&the_index, (name), (namelen), (igncase))
-#define cache_name_is_other(name, namelen) index_name_is_other(&the_index, (name), (namelen))
-#define resolve_undo_clear() resolve_undo_clear_index(&the_index)
-#define unmerge_cache_entry_at(at) unmerge_index_entry_at(&the_index, at)
-#define unmerge_cache(pathspec) unmerge_index(&the_index, pathspec)
-#define read_blob_data_from_cache(path, sz) read_blob_data_from_index(&the_index, (path), (sz))
-#define hold_locked_index(lock_file, flags) repo_hold_locked_index(the_repository, (lock_file), (flags))
-#endif
-
-#define TYPE_BITS 3
-
-/*
- * Values in this enum (except those outside the 3 bit range) are part
- * of pack file format. See Documentation/technical/pack-format.txt
- * for more information.
- */
-enum object_type {
- OBJ_BAD = -1,
- OBJ_NONE = 0,
- OBJ_COMMIT = 1,
- OBJ_TREE = 2,
- OBJ_BLOB = 3,
- OBJ_TAG = 4,
- /* 5 for future expansion */
- OBJ_OFS_DELTA = 6,
- OBJ_REF_DELTA = 7,
- OBJ_ANY,
- OBJ_MAX
-};
-
-static inline enum object_type object_type(unsigned int mode)
-{
- return S_ISDIR(mode) ? OBJ_TREE :
- S_ISGITLINK(mode) ? OBJ_COMMIT :
- OBJ_BLOB;
-}
-
-/* Double-check local_repo_env below if you add to this list. */
-#define GIT_DIR_ENVIRONMENT "GIT_DIR"
-#define GIT_COMMON_DIR_ENVIRONMENT "GIT_COMMON_DIR"
-#define GIT_NAMESPACE_ENVIRONMENT "GIT_NAMESPACE"
-#define GIT_WORK_TREE_ENVIRONMENT "GIT_WORK_TREE"
-#define GIT_PREFIX_ENVIRONMENT "GIT_PREFIX"
-#define GIT_SUPER_PREFIX_ENVIRONMENT "GIT_INTERNAL_SUPER_PREFIX"
-#define DEFAULT_GIT_DIR_ENVIRONMENT ".git"
-#define DB_ENVIRONMENT "GIT_OBJECT_DIRECTORY"
-#define INDEX_ENVIRONMENT "GIT_INDEX_FILE"
-#define GRAFT_ENVIRONMENT "GIT_GRAFT_FILE"
-#define GIT_SHALLOW_FILE_ENVIRONMENT "GIT_SHALLOW_FILE"
-#define TEMPLATE_DIR_ENVIRONMENT "GIT_TEMPLATE_DIR"
-#define CONFIG_ENVIRONMENT "GIT_CONFIG"
-#define CONFIG_DATA_ENVIRONMENT "GIT_CONFIG_PARAMETERS"
-#define CONFIG_COUNT_ENVIRONMENT "GIT_CONFIG_COUNT"
-#define EXEC_PATH_ENVIRONMENT "GIT_EXEC_PATH"
-#define CEILING_DIRECTORIES_ENVIRONMENT "GIT_CEILING_DIRECTORIES"
-#define NO_REPLACE_OBJECTS_ENVIRONMENT "GIT_NO_REPLACE_OBJECTS"
-#define GIT_REPLACE_REF_BASE_ENVIRONMENT "GIT_REPLACE_REF_BASE"
-#define GITATTRIBUTES_FILE ".gitattributes"
-#define INFOATTRIBUTES_FILE "info/attributes"
-#define ATTRIBUTE_MACRO_PREFIX "[attr]"
-#define GITMODULES_FILE ".gitmodules"
-#define GITMODULES_INDEX ":.gitmodules"
-#define GITMODULES_HEAD "HEAD:.gitmodules"
-#define GIT_NOTES_REF_ENVIRONMENT "GIT_NOTES_REF"
-#define GIT_NOTES_DEFAULT_REF "refs/notes/commits"
-#define GIT_NOTES_DISPLAY_REF_ENVIRONMENT "GIT_NOTES_DISPLAY_REF"
-#define GIT_NOTES_REWRITE_REF_ENVIRONMENT "GIT_NOTES_REWRITE_REF"
-#define GIT_NOTES_REWRITE_MODE_ENVIRONMENT "GIT_NOTES_REWRITE_MODE"
-#define GIT_LITERAL_PATHSPECS_ENVIRONMENT "GIT_LITERAL_PATHSPECS"
-#define GIT_GLOB_PATHSPECS_ENVIRONMENT "GIT_GLOB_PATHSPECS"
-#define GIT_NOGLOB_PATHSPECS_ENVIRONMENT "GIT_NOGLOB_PATHSPECS"
-#define GIT_ICASE_PATHSPECS_ENVIRONMENT "GIT_ICASE_PATHSPECS"
-#define GIT_QUARANTINE_ENVIRONMENT "GIT_QUARANTINE_PATH"
-#define GIT_OPTIONAL_LOCKS_ENVIRONMENT "GIT_OPTIONAL_LOCKS"
-#define GIT_TEXT_DOMAIN_DIR_ENVIRONMENT "GIT_TEXTDOMAINDIR"
-
-/*
- * Environment variable used in handshaking the wire protocol.
- * Contains a colon ':' separated list of keys with optional values
- * 'key[=value]'. Presence of unknown keys and values must be
- * ignored.
- */
-#define GIT_PROTOCOL_ENVIRONMENT "GIT_PROTOCOL"
-/* HTTP header used to handshake the wire protocol */
-#define GIT_PROTOCOL_HEADER "Git-Protocol"
-
-/*
- * This environment variable is expected to contain a boolean indicating
- * whether we should or should not treat:
- *
- * GIT_DIR=foo.git git ...
- *
- * as if GIT_WORK_TREE=. was given. It's not expected that users will make use
- * of this, but we use it internally to communicate to sub-processes that we
- * are in a bare repo. If not set, defaults to true.
- */
-#define GIT_IMPLICIT_WORK_TREE_ENVIRONMENT "GIT_IMPLICIT_WORK_TREE"
-
-/*
- * Repository-local GIT_* environment variables; these will be cleared
- * when git spawns a sub-process that runs inside another repository.
- * The array is NULL-terminated, which makes it easy to pass in the "env"
- * parameter of a run-command invocation, or to do a simple walk.
- */
-extern const char * const local_repo_env[];
-
-void setup_git_env(const char *git_dir);
-
-/*
- * Returns true iff we have a configured git repository (either via
- * setup_git_directory, or in the environment via $GIT_DIR).
- */
-int have_git_dir(void);
-
-extern int is_bare_repository_cfg;
-int is_bare_repository(void);
-int is_inside_git_dir(void);
-extern char *git_work_tree_cfg;
-int is_inside_work_tree(void);
-const char *get_git_dir(void);
-const char *get_git_common_dir(void);
-const char *get_object_directory(void);
-char *get_index_file(void);
-char *get_graft_file(struct repository *r);
-void set_git_dir(const char *path, int make_realpath);
-int get_common_dir_noenv(struct strbuf *sb, const char *gitdir);
-int get_common_dir(struct strbuf *sb, const char *gitdir);
-const char *get_git_namespace(void);
-const char *strip_namespace(const char *namespaced_ref);
-const char *get_super_prefix(void);
-const char *get_git_work_tree(void);
-
-/*
- * Return true if the given path is a git directory; note that this _just_
- * looks at the directory itself. If you want to know whether "foo/.git"
- * is a repository, you must feed that path, not just "foo".
- */
-int is_git_directory(const char *path);
-
-/*
- * Return 1 if the given path is the root of a git repository or
- * submodule, else 0. Will not return 1 for bare repositories with the
- * exception of creating a bare repository in "foo/.git" and calling
- * is_git_repository("foo").
- *
- * If we run into read errors, we err on the side of saying "yes, it is",
- * as we usually consider sub-repos precious, and would prefer to err on the
- * side of not disrupting or deleting them.
- */
-int is_nonbare_repository_dir(struct strbuf *path);
-
-#define READ_GITFILE_ERR_STAT_FAILED 1
-#define READ_GITFILE_ERR_NOT_A_FILE 2
-#define READ_GITFILE_ERR_OPEN_FAILED 3
-#define READ_GITFILE_ERR_READ_FAILED 4
-#define READ_GITFILE_ERR_INVALID_FORMAT 5
-#define READ_GITFILE_ERR_NO_PATH 6
-#define READ_GITFILE_ERR_NOT_A_REPO 7
-#define READ_GITFILE_ERR_TOO_LARGE 8
-void read_gitfile_error_die(int error_code, const char *path, const char *dir);
-const char *read_gitfile_gently(const char *path, int *return_error_code);
-#define read_gitfile(path) read_gitfile_gently((path), NULL)
-const char *resolve_gitdir_gently(const char *suspect, int *return_error_code);
-#define resolve_gitdir(path) resolve_gitdir_gently((path), NULL)
-
-void set_git_work_tree(const char *tree);
-
-#define ALTERNATE_DB_ENVIRONMENT "GIT_ALTERNATE_OBJECT_DIRECTORIES"
-
-void setup_work_tree(void);
-/*
- * Find the commondir and gitdir of the repository that contains the current
- * working directory, without changing the working directory or other global
- * state. The result is appended to commondir and gitdir. If the discovered
- * gitdir does not correspond to a worktree, then 'commondir' and 'gitdir' will
- * both have the same result appended to the buffer. The return value is
- * either 0 upon success and non-zero if no repository was found.
- */
-int discover_git_directory(struct strbuf *commondir,
- struct strbuf *gitdir);
-const char *setup_git_directory_gently(int *);
-const char *setup_git_directory(void);
-char *prefix_path(const char *prefix, int len, const char *path);
-char *prefix_path_gently(const char *prefix, int len, int *remaining, const char *path);
-
-/*
- * Concatenate "prefix" (if len is non-zero) and "path", with no
- * connecting characters (so "prefix" should end with a "/").
- * Unlike prefix_path, this should be used if the named file does
- * not have to interact with index entry; i.e. name of a random file
- * on the filesystem.
- *
- * The return value is always a newly allocated string (even if the
- * prefix was empty).
- */
-char *prefix_filename(const char *prefix, const char *path);
-
-int check_filename(const char *prefix, const char *name);
-void verify_filename(const char *prefix,
- const char *name,
- int diagnose_misspelt_rev);
-void verify_non_filename(const char *prefix, const char *name);
-int path_inside_repo(const char *prefix, const char *path);
-
-#define INIT_DB_QUIET 0x0001
-#define INIT_DB_EXIST_OK 0x0002
-
-int init_db(const char *git_dir, const char *real_git_dir,
- const char *template_dir, int hash_algo,
- const char *initial_branch, unsigned int flags);
-void initialize_repository_version(int hash_algo, int reinit);
-
-void sanitize_stdfds(void);
-int daemonize(void);
-
-#define alloc_nr(x) (((x)+16)*3/2)
-
-/**
- * Dynamically growing an array using realloc() is error prone and boring.
- *
- * Define your array with:
- *
- * - a pointer (`item`) that points at the array, initialized to `NULL`
- * (although please name the variable based on its contents, not on its
- * type);
- *
- * - an integer variable (`alloc`) that keeps track of how big the current
- * allocation is, initialized to `0`;
- *
- * - another integer variable (`nr`) to keep track of how many elements the
- * array currently has, initialized to `0`.
- *
- * Then before adding `n`th element to the item, call `ALLOC_GROW(item, n,
- * alloc)`. This ensures that the array can hold at least `n` elements by
- * calling `realloc(3)` and adjusting `alloc` variable.
- *
- * ------------
- * sometype *item;
- * size_t nr;
- * size_t alloc
- *
- * for (i = 0; i < nr; i++)
- * if (we like item[i] already)
- * return;
- *
- * // we did not like any existing one, so add one
- * ALLOC_GROW(item, nr + 1, alloc);
- * item[nr++] = value you like;
- * ------------
- *
- * You are responsible for updating the `nr` variable.
- *
- * If you need to specify the number of elements to allocate explicitly
- * then use the macro `REALLOC_ARRAY(item, alloc)` instead of `ALLOC_GROW`.
- *
- * Consider using ALLOC_GROW_BY instead of ALLOC_GROW as it has some
- * added niceties.
- *
- * DO NOT USE any expression with side-effect for 'x', 'nr', or 'alloc'.
- */
-#define ALLOC_GROW(x, nr, alloc) \
- do { \
- if ((nr) > alloc) { \
- if (alloc_nr(alloc) < (nr)) \
- alloc = (nr); \
- else \
- alloc = alloc_nr(alloc); \
- REALLOC_ARRAY(x, alloc); \
- } \
- } while (0)
-
-/*
- * Similar to ALLOC_GROW but handles updating of the nr value and
- * zeroing the bytes of the newly-grown array elements.
- *
- * DO NOT USE any expression with side-effect for any of the
- * arguments.
- */
-#define ALLOC_GROW_BY(x, nr, increase, alloc) \
- do { \
- if (increase) { \
- size_t new_nr = nr + (increase); \
- if (new_nr < nr) \
- BUG("negative growth in ALLOC_GROW_BY"); \
- ALLOC_GROW(x, new_nr, alloc); \
- memset((x) + nr, 0, sizeof(*(x)) * (increase)); \
- nr = new_nr; \
- } \
- } while (0)
-
-/* Initialize and use the cache information */
-struct lock_file;
-void preload_index(struct index_state *index,
- const struct pathspec *pathspec,
- unsigned int refresh_flags);
-int do_read_index(struct index_state *istate, const char *path,
- int must_exist); /* for testting only! */
-int read_index_from(struct index_state *, const char *path,
- const char *gitdir);
-int is_index_unborn(struct index_state *);
-
-void ensure_full_index(struct index_state *istate);
-
-/* For use with `write_locked_index()`. */
-#define COMMIT_LOCK (1 << 0)
-#define SKIP_IF_UNCHANGED (1 << 1)
-
-/*
- * Write the index while holding an already-taken lock. Close the lock,
- * and if `COMMIT_LOCK` is given, commit it.
- *
- * Unless a split index is in use, write the index into the lockfile.
- *
- * With a split index, write the shared index to a temporary file,
- * adjust its permissions and rename it into place, then write the
- * split index to the lockfile. If the temporary file for the shared
- * index cannot be created, fall back to the behavior described in
- * the previous paragraph.
- *
- * With `COMMIT_LOCK`, the lock is always committed or rolled back.
- * Without it, the lock is closed, but neither committed nor rolled
- * back.
- *
- * If `SKIP_IF_UNCHANGED` is given and the index is unchanged, nothing
- * is written (and the lock is rolled back if `COMMIT_LOCK` is given).
- */
-int write_locked_index(struct index_state *, struct lock_file *lock, unsigned flags);
-
-int discard_index(struct index_state *);
-void move_index_extensions(struct index_state *dst, struct index_state *src);
-int unmerged_index(const struct index_state *);
-
-/**
- * Returns 1 if istate differs from tree, 0 otherwise. If tree is NULL,
- * compares istate to HEAD. If tree is NULL and on an unborn branch,
- * returns 1 if there are entries in istate, 0 otherwise. If an strbuf is
- * provided, the space-separated list of files that differ will be appended
- * to it.
- */
-int repo_index_has_changes(struct repository *repo,
- struct tree *tree,
- struct strbuf *sb);
-
-int verify_path(const char *path, unsigned mode);
-int strcmp_offset(const char *s1, const char *s2, size_t *first_change);
-int index_dir_exists(struct index_state *istate, const char *name, int namelen);
-void adjust_dirname_case(struct index_state *istate, char *name);
-struct cache_entry *index_file_exists(struct index_state *istate, const char *name, int namelen, int igncase);
-
-/*
- * Searches for an entry defined by name and namelen in the given index.
- * If the return value is positive (including 0) it is the position of an
- * exact match. If the return value is negative, the negated value minus 1
- * is the position where the entry would be inserted.
- * Example: The current index consists of these files and its stages:
- *
- * b#0, d#0, f#1, f#3
- *
- * index_name_pos(&index, "a", 1) -> -1
- * index_name_pos(&index, "b", 1) -> 0
- * index_name_pos(&index, "c", 1) -> -2
- * index_name_pos(&index, "d", 1) -> 1
- * index_name_pos(&index, "e", 1) -> -3
- * index_name_pos(&index, "f", 1) -> -3
- * index_name_pos(&index, "g", 1) -> -5
- */
-int index_name_pos(struct index_state *, const char *name, int namelen);
-
-/*
- * Determines whether an entry with the given name exists within the
- * given index. The return value is 1 if an exact match is found, otherwise
- * it is 0. Note that, unlike index_name_pos, this function does not expand
- * the index if it is sparse. If an item exists within the full index but it
- * is contained within a sparse directory (and not in the sparse index), 0 is
- * returned.
- */
-int index_entry_exists(struct index_state *, const char *name, int namelen);
-
-/*
- * Some functions return the negative complement of an insert position when a
- * precise match was not found but a position was found where the entry would
- * need to be inserted. This helper protects that logic from any integer
- * underflow.
- */
-static inline int index_pos_to_insert_pos(uintmax_t pos)
-{
- if (pos > INT_MAX)
- die("overflow: -1 - %"PRIuMAX, pos);
- return -1 - (int)pos;
-}
-
-#define ADD_CACHE_OK_TO_ADD 1 /* Ok to add */
-#define ADD_CACHE_OK_TO_REPLACE 2 /* Ok to replace file/directory */
-#define ADD_CACHE_SKIP_DFCHECK 4 /* Ok to skip DF conflict checks */
-#define ADD_CACHE_JUST_APPEND 8 /* Append only */
-#define ADD_CACHE_NEW_ONLY 16 /* Do not replace existing ones */
-#define ADD_CACHE_KEEP_CACHE_TREE 32 /* Do not invalidate cache-tree */
-#define ADD_CACHE_RENORMALIZE 64 /* Pass along HASH_RENORMALIZE */
-int add_index_entry(struct index_state *, struct cache_entry *ce, int option);
-void rename_index_entry_at(struct index_state *, int pos, const char *new_name);
-
-/* Remove entry, return true if there are more entries to go. */
-int remove_index_entry_at(struct index_state *, int pos);
-
-void remove_marked_cache_entries(struct index_state *istate, int invalidate);
-int remove_file_from_index(struct index_state *, const char *path);
-#define ADD_CACHE_VERBOSE 1
-#define ADD_CACHE_PRETEND 2
-#define ADD_CACHE_IGNORE_ERRORS 4
-#define ADD_CACHE_IGNORE_REMOVAL 8
-#define ADD_CACHE_INTENT 16
-/*
- * These two are used to add the contents of the file at path
- * to the index, marking the working tree up-to-date by storing
- * the cached stat info in the resulting cache entry. A caller
- * that has already run lstat(2) on the path can call
- * add_to_index(), and all others can call add_file_to_index();
- * the latter will do necessary lstat(2) internally before
- * calling the former.
- */
-int add_to_index(struct index_state *, const char *path, struct stat *, int flags);
-int add_file_to_index(struct index_state *, const char *path, int flags);
-
-int chmod_index_entry(struct index_state *, struct cache_entry *ce, char flip);
-int ce_same_name(const struct cache_entry *a, const struct cache_entry *b);
-void set_object_name_for_intent_to_add_entry(struct cache_entry *ce);
-int index_name_is_other(struct index_state *, const char *, int);
-void *read_blob_data_from_index(struct index_state *, const char *, unsigned long *);
-
-/* do stat comparison even if CE_VALID is true */
-#define CE_MATCH_IGNORE_VALID 01
-/* do not check the contents but report dirty on racily-clean entries */
-#define CE_MATCH_RACY_IS_DIRTY 02
-/* do stat comparison even if CE_SKIP_WORKTREE is true */
-#define CE_MATCH_IGNORE_SKIP_WORKTREE 04
-/* ignore non-existent files during stat update */
-#define CE_MATCH_IGNORE_MISSING 0x08
-/* enable stat refresh */
-#define CE_MATCH_REFRESH 0x10
-/* don't refresh_fsmonitor state or do stat comparison even if CE_FSMONITOR_VALID is true */
-#define CE_MATCH_IGNORE_FSMONITOR 0X20
-int is_racy_timestamp(const struct index_state *istate,
- const struct cache_entry *ce);
-int has_racy_timestamp(struct index_state *istate);
-int ie_match_stat(struct index_state *, const struct cache_entry *, struct stat *, unsigned int);
-int ie_modified(struct index_state *, const struct cache_entry *, struct stat *, unsigned int);
-
-#define HASH_WRITE_OBJECT 1
-#define HASH_FORMAT_CHECK 2
-#define HASH_RENORMALIZE 4
-#define HASH_SILENT 8
-int index_fd(struct index_state *istate, struct object_id *oid, int fd, struct stat *st, enum object_type type, const char *path, unsigned flags);
-int index_path(struct index_state *istate, struct object_id *oid, const char *path, struct stat *st, unsigned flags);
-
-/*
- * Record to sd the data from st that we use to check whether a file
- * might have changed.
- */
-void fill_stat_data(struct stat_data *sd, struct stat *st);
-
-/*
- * Return 0 if st is consistent with a file not having been changed
- * since sd was filled. If there are differences, return a
- * combination of MTIME_CHANGED, CTIME_CHANGED, OWNER_CHANGED,
- * INODE_CHANGED, and DATA_CHANGED.
- */
-int match_stat_data(const struct stat_data *sd, struct stat *st);
-int match_stat_data_racy(const struct index_state *istate,
- const struct stat_data *sd, struct stat *st);
-
-void fill_stat_cache_info(struct index_state *istate, struct cache_entry *ce, struct stat *st);
-
-#define REFRESH_REALLY (1 << 0) /* ignore_valid */
-#define REFRESH_UNMERGED (1 << 1) /* allow unmerged */
-#define REFRESH_QUIET (1 << 2) /* be quiet about it */
-#define REFRESH_IGNORE_MISSING (1 << 3) /* ignore non-existent */
-#define REFRESH_IGNORE_SUBMODULES (1 << 4) /* ignore submodules */
-#define REFRESH_IN_PORCELAIN (1 << 5) /* user friendly output, not "needs update" */
-#define REFRESH_PROGRESS (1 << 6) /* show progress bar if stderr is tty */
-#define REFRESH_IGNORE_SKIP_WORKTREE (1 << 7) /* ignore skip_worktree entries */
-int refresh_index(struct index_state *, unsigned int flags, const struct pathspec *pathspec, char *seen, const char *header_msg);
-/*
- * Refresh the index and write it to disk.
- *
- * 'refresh_flags' is passed directly to 'refresh_index()', while
- * 'COMMIT_LOCK | write_flags' is passed to 'write_locked_index()', so
- * the lockfile is always either committed or rolled back.
- *
- * If 'gentle' is passed, errors locking the index are ignored.
- *
- * Return 1 if refreshing the index returns an error, -1 if writing
- * the index to disk fails, 0 on success.
- *
- * Note that if refreshing the index returns an error, we still write
- * out the index (unless locking fails).
- */
-int repo_refresh_and_write_index(struct repository*, unsigned int refresh_flags, unsigned int write_flags, int gentle, const struct pathspec *, char *seen, const char *header_msg);
-
-struct cache_entry *refresh_cache_entry(struct index_state *, struct cache_entry *, unsigned int);
-
-void set_alternate_index_output(const char *);
-
-extern int verify_index_checksum;
-extern int verify_ce_order;
-
-/* Environment bits from configuration mechanism */
-extern int trust_executable_bit;
-extern int trust_ctime;
-extern int check_stat;
-extern int quote_path_fully;
-extern int has_symlinks;
-extern int minimum_abbrev, default_abbrev;
-extern int ignore_case;
-extern int assume_unchanged;
-extern int prefer_symlink_refs;
-extern int warn_ambiguous_refs;
-extern int warn_on_object_refname_ambiguity;
-extern char *apply_default_whitespace;
-extern char *apply_default_ignorewhitespace;
-extern const char *git_attributes_file;
-extern const char *git_hooks_path;
-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;
-
-/*
- * Accessors for the core.sharedrepository config which lazy-load the value
- * from the config (if not already set). The "reset" function can be
- * used to unset "set" or cached value, meaning that the value will be loaded
- * fresh from the config file on the next call to get_shared_repository().
- */
-void set_shared_repository(int value);
-int get_shared_repository(void);
-void reset_shared_repository(void);
-
-/*
- * Do replace refs need to be checked this run? This variable is
- * initialized to true unless --no-replace-object is used or
- * $GIT_NO_REPLACE_OBJECTS is set, but is set to false by some
- * commands that do not want replace references to be active.
- */
-extern int read_replace_refs;
-extern char *git_replace_ref_base;
-
-/*
- * These values are used to help identify parts of a repository to fsync.
- * FSYNC_COMPONENT_NONE identifies data that will not be a persistent part of the
- * repository and so shouldn't be fsynced.
- */
-enum fsync_component {
- FSYNC_COMPONENT_NONE,
- FSYNC_COMPONENT_LOOSE_OBJECT = 1 << 0,
- FSYNC_COMPONENT_PACK = 1 << 1,
- FSYNC_COMPONENT_PACK_METADATA = 1 << 2,
- FSYNC_COMPONENT_COMMIT_GRAPH = 1 << 3,
- FSYNC_COMPONENT_INDEX = 1 << 4,
- FSYNC_COMPONENT_REFERENCE = 1 << 5,
-};
-
-#define FSYNC_COMPONENTS_OBJECTS (FSYNC_COMPONENT_LOOSE_OBJECT | \
- FSYNC_COMPONENT_PACK)
-
-#define FSYNC_COMPONENTS_DERIVED_METADATA (FSYNC_COMPONENT_PACK_METADATA | \
- FSYNC_COMPONENT_COMMIT_GRAPH)
-
-#define FSYNC_COMPONENTS_DEFAULT ((FSYNC_COMPONENTS_OBJECTS | \
- FSYNC_COMPONENTS_DERIVED_METADATA) & \
- ~FSYNC_COMPONENT_LOOSE_OBJECT)
-
-#define FSYNC_COMPONENTS_COMMITTED (FSYNC_COMPONENTS_OBJECTS | \
- FSYNC_COMPONENT_REFERENCE)
-
-#define FSYNC_COMPONENTS_ADDED (FSYNC_COMPONENTS_COMMITTED | \
- FSYNC_COMPONENT_INDEX)
-
-#define FSYNC_COMPONENTS_ALL (FSYNC_COMPONENT_LOOSE_OBJECT | \
- FSYNC_COMPONENT_PACK | \
- FSYNC_COMPONENT_PACK_METADATA | \
- FSYNC_COMPONENT_COMMIT_GRAPH | \
- FSYNC_COMPONENT_INDEX | \
- FSYNC_COMPONENT_REFERENCE)
-
-#ifndef FSYNC_COMPONENTS_PLATFORM_DEFAULT
-#define FSYNC_COMPONENTS_PLATFORM_DEFAULT FSYNC_COMPONENTS_DEFAULT
-#endif
-
-/*
- * A bitmask indicating which components of the repo should be fsynced.
- */
-extern enum fsync_component fsync_components;
-extern int fsync_object_files;
-extern int use_fsync;
-
-enum fsync_method {
- FSYNC_METHOD_FSYNC,
- FSYNC_METHOD_WRITEOUT_ONLY,
- FSYNC_METHOD_BATCH,
-};
-
-extern enum fsync_method fsync_method;
-extern int core_preload_index;
-extern int precomposed_unicode;
-extern int protect_hfs;
-extern int protect_ntfs;
-
-extern int core_apply_sparse_checkout;
-extern int core_sparse_checkout_cone;
-extern int sparse_expect_files_outside_of_patterns;
-
-/*
- * Returns the boolean value of $GIT_OPTIONAL_LOCKS (or the default value).
- */
-int use_optional_locks(void);
-
-/*
- * The character that begins a commented line in user-editable file
- * that is subject to stripspace.
- */
-extern char comment_line_char;
-extern int auto_comment_line_char;
-
-enum log_refs_config {
- LOG_REFS_UNSET = -1,
- LOG_REFS_NONE = 0,
- LOG_REFS_NORMAL,
- LOG_REFS_ALWAYS
-};
-extern enum log_refs_config log_all_ref_updates;
-
-enum rebase_setup_type {
- AUTOREBASE_NEVER = 0,
- AUTOREBASE_LOCAL,
- AUTOREBASE_REMOTE,
- AUTOREBASE_ALWAYS
-};
-
-enum push_default_type {
- PUSH_DEFAULT_NOTHING = 0,
- PUSH_DEFAULT_MATCHING,
- PUSH_DEFAULT_SIMPLE,
- PUSH_DEFAULT_UPSTREAM,
- PUSH_DEFAULT_CURRENT,
- PUSH_DEFAULT_UNSPECIFIED
-};
-
-extern enum rebase_setup_type autorebase;
-extern enum push_default_type push_default;
-
-enum object_creation_mode {
- OBJECT_CREATION_USES_HARDLINKS = 0,
- OBJECT_CREATION_USES_RENAMES = 1
-};
-
-extern enum object_creation_mode object_creation_mode;
-
-extern char *notes_ref_name;
-
-extern int grafts_replace_parents;
-
-/*
- * GIT_REPO_VERSION is the version we write by default. The
- * _READ variant is the highest number we know how to
- * handle.
- */
-#define GIT_REPO_VERSION 0
-#define GIT_REPO_VERSION_READ 1
-extern int repository_format_precious_objects;
-extern int repository_format_worktree_config;
-
-/*
- * You _have_ to initialize a `struct repository_format` using
- * `= REPOSITORY_FORMAT_INIT` before calling `read_repository_format()`.
- */
-struct repository_format {
- int version;
- int precious_objects;
- char *partial_clone; /* value of extensions.partialclone */
- int worktree_config;
- int is_bare;
- int hash_algo;
- int sparse_index;
- char *work_tree;
- struct string_list unknown_extensions;
- struct string_list v1_only_extensions;
-};
-
-/*
- * Always use this to initialize a `struct repository_format`
- * to a well-defined, default state before calling
- * `read_repository()`.
- */
-#define REPOSITORY_FORMAT_INIT \
-{ \
- .version = -1, \
- .is_bare = -1, \
- .hash_algo = GIT_HASH_SHA1, \
- .unknown_extensions = STRING_LIST_INIT_DUP, \
- .v1_only_extensions = STRING_LIST_INIT_DUP, \
-}
-
-/*
- * Read the repository format characteristics from the config file "path" into
- * "format" struct. Returns the numeric version. On error, or if no version is
- * found in the configuration, -1 is returned, format->version is set to -1,
- * and all other fields in the struct are set to the default configuration
- * (REPOSITORY_FORMAT_INIT). Always initialize the struct using
- * REPOSITORY_FORMAT_INIT before calling this function.
- */
-int read_repository_format(struct repository_format *format, const char *path);
-
-/*
- * Free the memory held onto by `format`, but not the struct itself.
- * (No need to use this after `read_repository_format()` fails.)
- */
-void clear_repository_format(struct repository_format *format);
-
-/*
- * Verify that the repository described by repository_format is something we
- * can read. If it is, return 0. Otherwise, return -1, and "err" will describe
- * any errors encountered.
- */
-int verify_repository_format(const struct repository_format *format,
- struct strbuf *err);
-
-/*
- * Check the repository format version in the path found in get_git_dir(),
- * and die if it is a version we don't understand. Generally one would
- * set_git_dir() before calling this, and use it only for "are we in a valid
- * repo?".
- *
- * If successful and fmt is not NULL, fill fmt with data.
- */
-void check_repository_format(struct repository_format *fmt);
-
-#define MTIME_CHANGED 0x0001
-#define CTIME_CHANGED 0x0002
-#define OWNER_CHANGED 0x0004
-#define MODE_CHANGED 0x0008
-#define INODE_CHANGED 0x0010
-#define DATA_CHANGED 0x0020
-#define TYPE_CHANGED 0x0040
-
-/*
- * Return an abbreviated sha1 unique within this repository's object database.
- * The result will be at least `len` characters long, and will be NUL
- * terminated.
- *
- * The non-`_r` version returns a static buffer which remains valid until 4
- * more calls to find_unique_abbrev are made.
- *
- * The `_r` variant writes to a buffer supplied by the caller, which must be at
- * least `GIT_MAX_HEXSZ + 1` bytes. The return value is the number of bytes
- * written (excluding the NUL terminator).
- *
- * Note that while this version avoids the static buffer, it is not fully
- * reentrant, as it calls into other non-reentrant git code.
- */
-const char *repo_find_unique_abbrev(struct repository *r, const struct object_id *oid, int len);
-#define find_unique_abbrev(oid, len) repo_find_unique_abbrev(the_repository, oid, len)
-int repo_find_unique_abbrev_r(struct repository *r, char *hex, const struct object_id *oid, int len);
-#define find_unique_abbrev_r(hex, oid, len) repo_find_unique_abbrev_r(the_repository, hex, oid, len)
-
-/* set default permissions by passing mode arguments to open(2) */
-int git_mkstemps_mode(char *pattern, int suffix_len, int mode);
-int git_mkstemp_mode(char *pattern, int mode);
-
-/*
- * NOTE NOTE NOTE!!
- *
- * PERM_UMASK, OLD_PERM_GROUP and OLD_PERM_EVERYBODY enumerations must
- * not be changed. Old repositories have core.sharedrepository written in
- * numeric format, and therefore these values are preserved for compatibility
- * reasons.
- */
-enum sharedrepo {
- PERM_UMASK = 0,
- OLD_PERM_GROUP = 1,
- OLD_PERM_EVERYBODY = 2,
- PERM_GROUP = 0660,
- PERM_EVERYBODY = 0664
-};
-int git_config_perm(const char *var, const char *value);
-int adjust_shared_perm(const char *path);
-
-/*
- * Create the directory containing the named path, using care to be
- * somewhat safe against races. Return one of the scld_error values to
- * indicate success/failure. On error, set errno to describe the
- * problem.
- *
- * SCLD_VANISHED indicates that one of the ancestor directories of the
- * path existed at one point during the function call and then
- * suddenly vanished, probably because another process pruned the
- * directory while we were working. To be robust against this kind of
- * race, callers might want to try invoking the function again when it
- * returns SCLD_VANISHED.
- *
- * safe_create_leading_directories() temporarily changes path while it
- * is working but restores it before returning.
- * safe_create_leading_directories_const() doesn't modify path, even
- * temporarily. Both these variants adjust the permissions of the
- * created directories to honor core.sharedRepository, so they are best
- * suited for files inside the git dir. For working tree files, use
- * safe_create_leading_directories_no_share() instead, as it ignores
- * the core.sharedRepository setting.
- */
-enum scld_error {
- SCLD_OK = 0,
- SCLD_FAILED = -1,
- SCLD_PERMS = -2,
- SCLD_EXISTS = -3,
- SCLD_VANISHED = -4
-};
-enum scld_error safe_create_leading_directories(char *path);
-enum scld_error safe_create_leading_directories_const(const char *path);
-enum scld_error safe_create_leading_directories_no_share(char *path);
-
-int mkdir_in_gitdir(const char *path);
-char *interpolate_path(const char *path, int real_home);
-/* NEEDSWORK: remove this synonym once in-flight topics have migrated */
-#define expand_user_path interpolate_path
-const char *enter_repo(const char *path, int strict);
-static inline int is_absolute_path(const char *path)
-{
- return is_dir_sep(path[0]) || has_dos_drive_prefix(path);
-}
-int is_directory(const char *);
-char *strbuf_realpath(struct strbuf *resolved, const char *path,
- int die_on_error);
-char *strbuf_realpath_forgiving(struct strbuf *resolved, const char *path,
- int die_on_error);
-char *real_pathdup(const char *path, int die_on_error);
-const char *absolute_path(const char *path);
-char *absolute_pathdup(const char *path);
-const char *remove_leading_path(const char *in, const char *prefix);
-const char *relative_path(const char *in, const char *prefix, struct strbuf *sb);
-int normalize_path_copy_len(char *dst, const char *src, int *prefix_len);
-int normalize_path_copy(char *dst, const char *src);
-int longest_ancestor_length(const char *path, struct string_list *prefixes);
-char *strip_path_suffix(const char *path, const char *suffix);
-int daemon_avoid_alias(const char *path);
-
-/*
- * These functions match their is_hfs_dotgit() counterparts; see utf8.h for
- * details.
- */
-int is_ntfs_dotgit(const char *name);
-int is_ntfs_dotgitmodules(const char *name);
-int is_ntfs_dotgitignore(const char *name);
-int is_ntfs_dotgitattributes(const char *name);
-int is_ntfs_dotmailmap(const char *name);
-
-/*
- * Returns true iff "str" could be confused as a command-line option when
- * passed to a sub-program like "ssh". Note that this has nothing to do with
- * shell-quoting, which should be handled separately; we're assuming here that
- * the string makes it verbatim to the sub-program.
- */
-int looks_like_command_line_option(const char *str);
-
-/**
- * Return a newly allocated string with the evaluation of
- * "$XDG_CONFIG_HOME/$subdir/$filename" if $XDG_CONFIG_HOME is non-empty, otherwise
- * "$HOME/.config/$subdir/$filename". Return NULL upon error.
- */
-char *xdg_config_home_for(const char *subdir, const char *filename);
-
-/**
- * Return a newly allocated string with the evaluation of
- * "$XDG_CONFIG_HOME/git/$filename" if $XDG_CONFIG_HOME is non-empty, otherwise
- * "$HOME/.config/git/$filename". Return NULL upon error.
- */
-char *xdg_config_home(const char *filename);
-
-/**
- * Return a newly allocated string with the evaluation of
- * "$XDG_CACHE_HOME/git/$filename" if $XDG_CACHE_HOME is non-empty, otherwise
- * "$HOME/.cache/git/$filename". Return NULL upon error.
- */
-char *xdg_cache_home(const char *filename);
-
-int git_open_cloexec(const char *name, int flags);
-#define git_open(name) git_open_cloexec(name, O_RDONLY)
-
-/**
- * unpack_loose_header() initializes the data stream needed to unpack
- * a loose object header.
- *
- * Returns:
- *
- * - ULHR_OK on success
- * - ULHR_BAD on error
- * - ULHR_TOO_LONG if the header was too long
- *
- * It will only parse up to MAX_HEADER_LEN bytes unless an optional
- * "hdrbuf" argument is non-NULL. This is intended for use with
- * OBJECT_INFO_ALLOW_UNKNOWN_TYPE to extract the bad type for (error)
- * reporting. The full header will be extracted to "hdrbuf" for use
- * with parse_loose_header(), ULHR_TOO_LONG will still be returned
- * from this function to indicate that the header was too long.
- */
-enum unpack_loose_header_result {
- ULHR_OK,
- ULHR_BAD,
- ULHR_TOO_LONG,
-};
-enum unpack_loose_header_result unpack_loose_header(git_zstream *stream,
- unsigned char *map,
- unsigned long mapsize,
- void *buffer,
- unsigned long bufsiz,
- struct strbuf *hdrbuf);
-
-/**
- * parse_loose_header() parses the starting "<type> <len>\0" of an
- * object. If it doesn't follow that format -1 is returned. To check
- * the validity of the <type> populate the "typep" in the "struct
- * object_info". It will be OBJ_BAD if the object type is unknown. The
- * parsed <len> can be retrieved via "oi->sizep", and from there
- * passed to unpack_loose_rest().
- */
-struct object_info;
-int parse_loose_header(const char *hdr, struct object_info *oi);
-
-/**
- * With in-core object data in "buf", rehash it to make sure the
- * object name actually matches "oid" to detect object corruption.
- *
- * A negative value indicates an error, usually that the OID is not
- * what we expected, but it might also indicate another error.
- */
-int check_object_signature(struct repository *r, const struct object_id *oid,
- void *map, unsigned long size,
- enum object_type type);
-
-/**
- * A streaming version of check_object_signature().
- * Try reading the object named with "oid" using
- * the streaming interface and rehash it to do the same.
- */
-int stream_object_signature(struct repository *r, const struct object_id *oid);
-
-int finalize_object_file(const char *tmpfile, const char *filename);
-
-/* Helper to check and "touch" a file */
-int check_and_freshen_file(const char *fn, int freshen);
-
-extern const signed char hexval_table[256];
-static inline unsigned int hexval(unsigned char c)
-{
- return hexval_table[c];
-}
-
-/*
- * Convert two consecutive hexadecimal digits into a char. Return a
- * negative value on error. Don't run over the end of short strings.
- */
-static inline int hex2chr(const char *s)
-{
- unsigned int val = hexval(s[0]);
- return (val & ~0xf) ? val : (val << 4) | hexval(s[1]);
-}
-
-/* Convert to/from hex/sha1 representation */
-#define MINIMUM_ABBREV minimum_abbrev
-#define DEFAULT_ABBREV default_abbrev
-
-/* used when the code does not know or care what the default abbrev is */
-#define FALLBACK_DEFAULT_ABBREV 7
-
-struct object_context {
- unsigned short mode;
- /*
- * symlink_path is only used by get_tree_entry_follow_symlinks,
- * and only for symlinks that point outside the repository.
- */
- struct strbuf symlink_path;
- /*
- * If GET_OID_RECORD_PATH is set, this will record path (if any)
- * found when resolving the name. The caller is responsible for
- * releasing the memory.
- */
- char *path;
-};
-
-#define GET_OID_QUIETLY 01
-#define GET_OID_COMMIT 02
-#define GET_OID_COMMITTISH 04
-#define GET_OID_TREE 010
-#define GET_OID_TREEISH 020
-#define GET_OID_BLOB 040
-#define GET_OID_FOLLOW_SYMLINKS 0100
-#define GET_OID_RECORD_PATH 0200
-#define GET_OID_ONLY_TO_DIE 04000
-#define GET_OID_REQUIRE_PATH 010000
-
-#define GET_OID_DISAMBIGUATORS \
- (GET_OID_COMMIT | GET_OID_COMMITTISH | \
- GET_OID_TREE | GET_OID_TREEISH | \
- GET_OID_BLOB)
-
-enum get_oid_result {
- FOUND = 0,
- MISSING_OBJECT = -1, /* The requested object is missing */
- SHORT_NAME_AMBIGUOUS = -2,
- /* The following only apply when symlinks are followed */
- DANGLING_SYMLINK = -4, /*
- * The initial symlink is there, but
- * (transitively) points to a missing
- * in-tree file
- */
- SYMLINK_LOOP = -5,
- NOT_DIR = -6, /*
- * Somewhere along the symlink chain, a path is
- * requested which contains a file as a
- * non-final element.
- */
-};
-
-int repo_get_oid(struct repository *r, const char *str, struct object_id *oid);
-__attribute__((format (printf, 2, 3)))
-int get_oidf(struct object_id *oid, const char *fmt, ...);
-int repo_get_oid_commit(struct repository *r, const char *str, struct object_id *oid);
-int repo_get_oid_committish(struct repository *r, const char *str, struct object_id *oid);
-int repo_get_oid_tree(struct repository *r, const char *str, struct object_id *oid);
-int repo_get_oid_treeish(struct repository *r, const char *str, struct object_id *oid);
-int repo_get_oid_blob(struct repository *r, const char *str, struct object_id *oid);
-int repo_get_oid_mb(struct repository *r, const char *str, struct object_id *oid);
-void maybe_die_on_misspelt_object_name(struct repository *repo,
- const char *name,
- const char *prefix);
-enum get_oid_result get_oid_with_context(struct repository *repo, const char *str,
- unsigned flags, struct object_id *oid,
- struct object_context *oc);
-
-#define get_oid(str, oid) repo_get_oid(the_repository, str, oid)
-#define get_oid_commit(str, oid) repo_get_oid_commit(the_repository, str, oid)
-#define get_oid_committish(str, oid) repo_get_oid_committish(the_repository, str, oid)
-#define get_oid_tree(str, oid) repo_get_oid_tree(the_repository, str, oid)
-#define get_oid_treeish(str, oid) repo_get_oid_treeish(the_repository, str, oid)
-#define get_oid_blob(str, oid) repo_get_oid_blob(the_repository, str, oid)
-#define get_oid_mb(str, oid) repo_get_oid_mb(the_repository, str, oid)
-
-typedef int each_abbrev_fn(const struct object_id *oid, void *);
-int repo_for_each_abbrev(struct repository *r, const char *prefix, each_abbrev_fn, void *);
-#define for_each_abbrev(prefix, fn, data) repo_for_each_abbrev(the_repository, prefix, fn, data)
-
-int set_disambiguate_hint_config(const char *var, const char *value);
-
-/*
- * Try to read a SHA1 in hexadecimal format from the 40 characters
- * starting at hex. Write the 20-byte result to sha1 in binary form.
- * Return 0 on success. Reading stops if a NUL is encountered in the
- * input, so it is safe to pass this function an arbitrary
- * null-terminated string.
- */
-int get_sha1_hex(const char *hex, unsigned char *sha1);
-int get_oid_hex(const char *hex, struct object_id *sha1);
-
-/* Like get_oid_hex, but for an arbitrary hash algorithm. */
-int get_oid_hex_algop(const char *hex, struct object_id *oid, const struct git_hash_algo *algop);
-
-/*
- * Read `len` pairs of hexadecimal digits from `hex` and write the
- * values to `binary` as `len` bytes. Return 0 on success, or -1 if
- * the input does not consist of hex digits).
- */
-int hex_to_bytes(unsigned char *binary, const char *hex, size_t len);
-
-/*
- * Convert a binary hash in "unsigned char []" or an object name in
- * "struct object_id *" to its hex equivalent. The `_r` variant is reentrant,
- * and writes the NUL-terminated output to the buffer `out`, which must be at
- * least `GIT_MAX_HEXSZ + 1` bytes, and returns a pointer to out for
- * convenience.
- *
- * The non-`_r` variant returns a static buffer, but uses a ring of 4
- * buffers, making it safe to make multiple calls for a single statement, like:
- *
- * printf("%s -> %s", hash_to_hex(one), hash_to_hex(two));
- * printf("%s -> %s", oid_to_hex(one), oid_to_hex(two));
- */
-char *hash_to_hex_algop_r(char *buffer, const unsigned char *hash, const struct git_hash_algo *);
-char *oid_to_hex_r(char *out, const struct object_id *oid);
-char *hash_to_hex_algop(const unsigned char *hash, const struct git_hash_algo *); /* static buffer result! */
-char *hash_to_hex(const unsigned char *hash); /* same static buffer */
-char *oid_to_hex(const struct object_id *oid); /* same static buffer */
-
-/*
- * Parse a 40-character hexadecimal object ID starting from hex, updating the
- * pointer specified by end when parsing stops. The resulting object ID is
- * stored in oid. Returns 0 on success. Parsing will stop on the first NUL or
- * other invalid character. end is only updated on success; otherwise, it is
- * unmodified.
- */
-int parse_oid_hex(const char *hex, struct object_id *oid, const char **end);
-
-/* Like parse_oid_hex, but for an arbitrary hash algorithm. */
-int parse_oid_hex_algop(const char *hex, struct object_id *oid, const char **end,
- const struct git_hash_algo *algo);
-
-
-/*
- * These functions work like get_oid_hex and parse_oid_hex, but they will parse
- * a hex value for any algorithm. The algorithm is detected based on the length
- * and the algorithm in use is returned. If this is not a hex object ID in any
- * algorithm, returns GIT_HASH_UNKNOWN.
- */
-int get_oid_hex_any(const char *hex, struct object_id *oid);
-int parse_oid_hex_any(const char *hex, struct object_id *oid, const char **end);
-
-/*
- * This reads short-hand syntax that not only evaluates to a commit
- * object name, but also can act as if the end user spelled the name
- * of the branch from the command line.
- *
- * - "@{-N}" finds the name of the Nth previous branch we were on, and
- * places the name of the branch in the given buf and returns the
- * number of characters parsed if successful.
- *
- * - "<branch>@{upstream}" finds the name of the other ref that
- * <branch> is configured to merge with (missing <branch> defaults
- * to the current branch), and places the name of the branch in the
- * given buf and returns the number of characters parsed if
- * successful.
- *
- * If the input is not of the accepted format, it returns a negative
- * number to signal an error.
- *
- * If the input was ok but there are not N branch switches in the
- * reflog, it returns 0.
- */
-#define INTERPRET_BRANCH_LOCAL (1<<0)
-#define INTERPRET_BRANCH_REMOTE (1<<1)
-#define INTERPRET_BRANCH_HEAD (1<<2)
-struct interpret_branch_name_options {
- /*
- * If "allowed" is non-zero, it is a treated as a bitfield of allowable
- * expansions: local branches ("refs/heads/"), remote branches
- * ("refs/remotes/"), or "HEAD". If no "allowed" bits are set, any expansion is
- * allowed, even ones to refs outside of those namespaces.
- */
- unsigned allowed;
-
- /*
- * If ^{upstream} or ^{push} (or equivalent) is requested, and the
- * branch in question does not have such a reference, return -1 instead
- * of die()-ing.
- */
- unsigned nonfatal_dangling_mark : 1;
-};
-int repo_interpret_branch_name(struct repository *r,
- const char *str, int len,
- struct strbuf *buf,
- const struct interpret_branch_name_options *options);
-#define interpret_branch_name(str, len, buf, options) \
- repo_interpret_branch_name(the_repository, str, len, buf, options)
-
-int validate_headref(const char *ref);
-
-int base_name_compare(const char *name1, int len1, int mode1, const char *name2, int len2, int mode2);
-int df_name_compare(const char *name1, int len1, int mode1, const char *name2, int len2, int mode2);
-int name_compare(const char *name1, size_t len1, const char *name2, size_t len2);
-int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2);
-
-void *read_object_with_reference(struct repository *r,
- const struct object_id *oid,
- enum object_type required_type,
- unsigned long *size,
- struct object_id *oid_ret);
-
-struct object *repo_peel_to_type(struct repository *r,
- const char *name, int namelen,
- struct object *o, enum object_type);
-#define peel_to_type(name, namelen, obj, type) \
- repo_peel_to_type(the_repository, name, namelen, obj, type)
-
-#define IDENT_STRICT 1
-#define IDENT_NO_DATE 2
-#define IDENT_NO_NAME 4
-
-enum want_ident {
- WANT_BLANK_IDENT,
- WANT_AUTHOR_IDENT,
- WANT_COMMITTER_IDENT
-};
-
-const char *git_author_info(int);
-const char *git_committer_info(int);
-const char *fmt_ident(const char *name, const char *email,
- enum want_ident whose_ident,
- const char *date_str, int);
-const char *fmt_name(enum want_ident);
-const char *ident_default_name(void);
-const char *ident_default_email(void);
-const char *git_editor(void);
-const char *git_sequence_editor(void);
-const char *git_pager(int stdout_is_tty);
-int is_terminal_dumb(void);
-int git_ident_config(const char *, const char *, void *);
-/*
- * Prepare an ident to fall back on if the user didn't configure it.
- */
-void prepare_fallback_ident(const char *name, const char *email);
-void reset_ident_date(void);
-
-struct ident_split {
- const char *name_begin;
- const char *name_end;
- const char *mail_begin;
- const char *mail_end;
- const char *date_begin;
- const char *date_end;
- const char *tz_begin;
- const char *tz_end;
-};
-/*
- * Signals an success with 0, but time part of the result may be NULL
- * if the input lacks timestamp and zone
- */
-int split_ident_line(struct ident_split *, const char *, int);
-
-/*
- * Compare split idents for equality or strict ordering. Note that we
- * compare only the ident part of the line, ignoring any timestamp.
- *
- * Because there are two fields, we must choose one as the primary key; we
- * currently arbitrarily pick the email.
- */
-int ident_cmp(const struct ident_split *, const struct ident_split *);
-
-struct cache_def {
- struct strbuf path;
- int flags;
- int track_flags;
- int prefix_len_stat_func;
-};
-#define CACHE_DEF_INIT { \
- .path = STRBUF_INIT, \
-}
-static inline void cache_def_clear(struct cache_def *cache)
-{
- strbuf_release(&cache->path);
-}
-
-int has_symlink_leading_path(const char *name, int len);
-int threaded_has_symlink_leading_path(struct cache_def *, const char *, int);
-int check_leading_path(const char *name, int len, int warn_on_lstat_err);
-int has_dirs_only_path(const char *name, int len, int prefix_len);
-void invalidate_lstat_cache(void);
-void schedule_dir_for_removal(const char *name, int len);
-void remove_scheduled_dirs(void);
-
-struct pack_window {
- struct pack_window *next;
- unsigned char *base;
- off_t offset;
- size_t len;
- unsigned int last_used;
- unsigned int inuse_cnt;
-};
-
-struct pack_entry {
- off_t offset;
- struct packed_git *p;
-};
-
-/*
- * Create a temporary file rooted in the object database directory, or
- * die on failure. The filename is taken from "pattern", which should have the
- * usual "XXXXXX" trailer, and the resulting filename is written into the
- * "template" buffer. Returns the open descriptor.
- */
-int odb_mkstemp(struct strbuf *temp_filename, const char *pattern);
-
-/*
- * Create a pack .keep file named "name" (which should generally be the output
- * of odb_pack_name). Returns a file descriptor opened for writing, or -1 on
- * error.
- */
-int odb_pack_keep(const char *name);
-
-/*
- * Set this to 0 to prevent oid_object_info_extended() from fetching missing
- * blobs. This has a difference only if extensions.partialClone is set.
- *
- * Its default value is 1.
- */
-extern int fetch_if_missing;
-
-/* Dumb servers support */
-int update_server_info(int);
-
-const char *get_log_output_encoding(void);
-const char *get_commit_output_encoding(void);
-
-int committer_ident_sufficiently_given(void);
-int author_ident_sufficiently_given(void);
-
-extern const char *git_commit_encoding;
-extern const char *git_log_output_encoding;
-extern const char *git_mailmap_file;
-extern const char *git_mailmap_blob;
-
-/* IO helper functions */
-void maybe_flush_or_die(FILE *, const char *);
-__attribute__((format (printf, 2, 3)))
-void fprintf_or_die(FILE *, const char *fmt, ...);
-void fwrite_or_die(FILE *f, const void *buf, size_t count);
-void fflush_or_die(FILE *f);
-
-#define COPY_READ_ERROR (-2)
-#define COPY_WRITE_ERROR (-3)
-int copy_fd(int ifd, int ofd);
-int copy_file(const char *dst, const char *src, int mode);
-int copy_file_with_time(const char *dst, const char *src, int mode);
-
-void write_or_die(int fd, const void *buf, size_t count);
-void fsync_or_die(int fd, const char *);
-int fsync_component(enum fsync_component component, int fd);
-void fsync_component_or_die(enum fsync_component component, int fd, const char *msg);
-
-static inline int batch_fsync_enabled(enum fsync_component component)
-{
- return (fsync_components & component) && (fsync_method == FSYNC_METHOD_BATCH);
-}
-
-ssize_t read_in_full(int fd, void *buf, size_t count);
-ssize_t write_in_full(int fd, const void *buf, size_t count);
-ssize_t pread_in_full(int fd, void *buf, size_t count, off_t offset);
-
-static inline ssize_t write_str_in_full(int fd, const char *str)
-{
- return write_in_full(fd, str, strlen(str));
-}
-
-/**
- * Open (and truncate) the file at path, write the contents of buf to it,
- * and close it. Dies if any errors are encountered.
- */
-void write_file_buf(const char *path, const char *buf, size_t len);
-
-/**
- * Like write_file_buf(), but format the contents into a buffer first.
- * Additionally, write_file() will append a newline if one is not already
- * present, making it convenient to write text files:
- *
- * write_file(path, "counter: %d", ctr);
- */
-__attribute__((format (printf, 2, 3)))
-void write_file(const char *path, const char *fmt, ...);
-
-/* pager.c */
-void setup_pager(void);
-int pager_in_use(void);
-extern int pager_use_color;
-int term_columns(void);
-void term_clear_line(void);
-int decimal_width(uintmax_t);
-int check_pager_config(const char *cmd);
-void prepare_pager_args(struct child_process *, const char *pager);
-
-extern const char *editor_program;
-extern const char *askpass_program;
-extern const char *excludes_file;
-
-/* base85 */
-int decode_85(char *dst, const char *line, int linelen);
-void encode_85(char *buf, const unsigned char *data, int bytes);
-
-/* pkt-line.c */
-void packet_trace_identity(const char *prog);
-
-/* add */
-/*
- * return 0 if success, 1 - if addition of a file failed and
- * ADD_FILES_IGNORE_ERRORS was specified in flags
- */
-int add_files_to_cache(const char *prefix, const struct pathspec *pathspec, int flags);
-
-/* diff.c */
-extern int diff_auto_refresh_index;
-
-/* match-trees.c */
-void shift_tree(struct repository *, const struct object_id *, const struct object_id *, struct object_id *, int);
-void shift_tree_by(struct repository *, const struct object_id *, const struct object_id *, struct object_id *, const char *);
-
-/*
- * whitespace rules.
- * used by both diff and apply
- * last two digits are tab width
- */
-#define WS_BLANK_AT_EOL 0100
-#define WS_SPACE_BEFORE_TAB 0200
-#define WS_INDENT_WITH_NON_TAB 0400
-#define WS_CR_AT_EOL 01000
-#define WS_BLANK_AT_EOF 02000
-#define WS_TAB_IN_INDENT 04000
-#define WS_TRAILING_SPACE (WS_BLANK_AT_EOL|WS_BLANK_AT_EOF)
-#define WS_DEFAULT_RULE (WS_TRAILING_SPACE|WS_SPACE_BEFORE_TAB|8)
-#define WS_TAB_WIDTH_MASK 077
-/* All WS_* -- when extended, adapt diff.c emit_symbol */
-#define WS_RULE_MASK 07777
-extern unsigned whitespace_rule_cfg;
-unsigned whitespace_rule(struct index_state *, const char *);
-unsigned parse_whitespace_rule(const char *);
-unsigned ws_check(const char *line, int len, unsigned ws_rule);
-void ws_check_emit(const char *line, int len, unsigned ws_rule, FILE *stream, const char *set, const char *reset, const char *ws);
-char *whitespace_error_string(unsigned ws);
-void ws_fix_copy(struct strbuf *, const char *, int, unsigned, int *);
-int ws_blank_line(const char *line, int len, unsigned ws_rule);
-#define ws_tab_width(rule) ((rule) & WS_TAB_WIDTH_MASK)
-
-/* ls-files */
-void overlay_tree_on_index(struct index_state *istate,
- const char *tree_name, const char *prefix);
-
-/* setup.c */
-struct startup_info {
- int have_repository;
- const char *prefix;
- const char *original_cwd;
-};
-extern struct startup_info *startup_info;
-extern const char *tmp_original_cwd;
-
-/* merge.c */
-struct commit_list;
-int try_merge_command(struct repository *r,
- const char *strategy, size_t xopts_nr,
- const char **xopts, struct commit_list *common,
- const char *head_arg, struct commit_list *remotes);
-int checkout_fast_forward(struct repository *r,
- const struct object_id *from,
- const struct object_id *to,
- int overwrite_ignore);
-
-
-int sane_execvp(const char *file, char *const argv[]);
-
-/*
- * A struct to encapsulate the concept of whether a file has changed
- * since we last checked it. This uses criteria similar to those used
- * for the index.
- */
-struct stat_validity {
- struct stat_data *sd;
-};
-
-void stat_validity_clear(struct stat_validity *sv);
-
-/*
- * Returns 1 if the path is a regular file (or a symlink to a regular
- * file) and matches the saved stat_validity, 0 otherwise. A missing
- * or inaccessible file is considered a match if the struct was just
- * initialized, or if the previous update found an inaccessible file.
- */
-int stat_validity_check(struct stat_validity *sv, const char *path);
-
-/*
- * Update the stat_validity from a file opened at descriptor fd. If
- * the file is missing, inaccessible, or not a regular file, then
- * future calls to stat_validity_check will match iff one of those
- * conditions continues to be true.
- */
-void stat_validity_update(struct stat_validity *sv, int fd);
-
-int versioncmp(const char *s1, const char *s2);
-
-/*
- * Create a directory and (if share is nonzero) adjust its permissions
- * according to the shared_repository setting. Only use this for
- * directories under $GIT_DIR. Don't use it for working tree
- * directories.
- */
-void safe_create_dir(const char *dir, int share);
-
-/*
- * Should we print an ellipsis after an abbreviated SHA-1 value
- * when doing diff-raw output or indicating a detached HEAD?
- */
-int print_sha1_ellipsis(void);
-
-/* Return 1 if the file is empty or does not exists, 0 otherwise. */
-int is_empty_or_missing_file(const char *filename);
-
-#endif /* CACHE_H */
diff --git a/cbtree.c b/cbtree.c
index 336e46d..c1cc30a 100644
--- a/cbtree.c
+++ b/cbtree.c
@@ -4,6 +4,7 @@
* Based on Adam Langley's adaptation of Dan Bernstein's public domain code
* git clone https://github.com/agl/critbit.git
*/
+#include "git-compat-util.h"
#include "cbtree.h"
static struct cb_node *cb_node_of(const void *p)
diff --git a/cbtree.h b/cbtree.h
index 0be14fb..43193ab 100644
--- a/cbtree.h
+++ b/cbtree.h
@@ -14,8 +14,6 @@
#ifndef CBTREE_H
#define CBTREE_H
-#include "git-compat-util.h"
-
struct cb_node;
struct cb_node {
struct cb_node *child[2];
diff --git a/chdir-notify.c b/chdir-notify.c
index 5f7f2c2..0d7bc04 100644
--- a/chdir-notify.c
+++ b/chdir-notify.c
@@ -1,7 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
#include "chdir-notify.h"
#include "list.h"
+#include "path.h"
#include "strbuf.h"
+#include "trace.h"
struct chdir_notify_entry {
const char *name;
diff --git a/checkout.c b/checkout.c
index 2e39dae..4256e71 100644
--- a/checkout.c
+++ b/checkout.c
@@ -1,8 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "object-name.h"
#include "remote.h"
#include "refspec.h"
+#include "repository.h"
#include "checkout.h"
#include "config.h"
+#include "strbuf.h"
struct tracking_name_data {
/* const */ char *src_ref;
@@ -23,7 +26,7 @@ static int check_tracking_name(struct remote *remote, void *cb_data)
memset(&query, 0, sizeof(struct refspec_item));
query.src = cb->src_ref;
if (remote_find_tracking(remote, &query) ||
- get_oid(query.dst, cb->dst_oid)) {
+ repo_get_oid(the_repository, query.dst, cb->dst_oid)) {
free(query.dst);
return 0;
}
diff --git a/checkout.h b/checkout.h
index 1152133..3c514a5 100644
--- a/checkout.h
+++ b/checkout.h
@@ -1,7 +1,7 @@
#ifndef CHECKOUT_H
#define CHECKOUT_H
-#include "cache.h"
+#include "hash-ll.h"
/*
* Check if the branch name uniquely matches a branch name on a remote
diff --git a/chunk-format.c b/chunk-format.c
index 0275b74..cdc7f39 100644
--- a/chunk-format.c
+++ b/chunk-format.c
@@ -1,6 +1,9 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "chunk-format.h"
#include "csum-file.h"
+#include "gettext.h"
+#include "hash.h"
+#include "trace2.h"
/*
* When writing a chunk-based file format, collect the chunks in
@@ -99,7 +102,8 @@ int read_table_of_contents(struct chunkfile *cf,
const unsigned char *mfile,
size_t mfile_size,
uint64_t toc_offset,
- int toc_length)
+ int toc_length,
+ unsigned expected_alignment)
{
int i;
uint32_t chunk_id;
@@ -117,6 +121,11 @@ int read_table_of_contents(struct chunkfile *cf,
error(_("terminating chunk id appears earlier than expected"));
return 1;
}
+ if (chunk_offset % expected_alignment != 0) {
+ error(_("chunk id %"PRIx32" not %d-byte aligned"),
+ chunk_id, expected_alignment);
+ return 1;
+ }
table_of_contents += CHUNK_TOC_ENTRY_SIZE;
next_chunk_offset = get_be64(table_of_contents + 4);
@@ -151,20 +160,28 @@ int read_table_of_contents(struct chunkfile *cf,
return 0;
}
+struct pair_chunk_data {
+ const unsigned char **p;
+ size_t *size;
+};
+
static int pair_chunk_fn(const unsigned char *chunk_start,
size_t chunk_size,
void *data)
{
- const unsigned char **p = data;
- *p = chunk_start;
+ struct pair_chunk_data *pcd = data;
+ *pcd->p = chunk_start;
+ *pcd->size = chunk_size;
return 0;
}
int pair_chunk(struct chunkfile *cf,
uint32_t chunk_id,
- const unsigned char **p)
+ const unsigned char **p,
+ size_t *size)
{
- return read_chunk(cf, chunk_id, pair_chunk_fn, p);
+ struct pair_chunk_data pcd = { .p = p, .size = size };
+ return read_chunk(cf, chunk_id, pair_chunk_fn, &pcd);
}
int read_chunk(struct chunkfile *cf,
diff --git a/chunk-format.h b/chunk-format.h
index 7885aa0..14b7618 100644
--- a/chunk-format.h
+++ b/chunk-format.h
@@ -1,8 +1,7 @@
#ifndef CHUNK_FORMAT_H
#define CHUNK_FORMAT_H
-#include "git-compat-util.h"
-#include "hash.h"
+#include "hash-ll.h"
struct hashfile;
struct chunkfile;
@@ -37,20 +36,23 @@ int read_table_of_contents(struct chunkfile *cf,
const unsigned char *mfile,
size_t mfile_size,
uint64_t toc_offset,
- int toc_length);
+ int toc_length,
+ unsigned expected_alignment);
#define CHUNK_NOT_FOUND (-2)
/*
* Find 'chunk_id' in the given chunkfile and assign the
* given pointer to the position in the mmap'd file where
- * that chunk begins.
+ * that chunk begins. Likewise the "size" parameter is filled
+ * with the size of the chunk.
*
* Returns CHUNK_NOT_FOUND if the chunk does not exist.
*/
int pair_chunk(struct chunkfile *cf,
uint32_t chunk_id,
- const unsigned char **p);
+ const unsigned char **p,
+ size_t *size);
typedef int (*chunk_read_fn)(const unsigned char *chunk_start,
size_t chunk_size, void *data);
diff --git a/ci/config/README b/ci/config/README
new file mode 100644
index 0000000..8de3a04
--- /dev/null
+++ b/ci/config/README
@@ -0,0 +1,14 @@
+You can configure some aspects of the GitHub Actions-based CI on a
+per-repository basis by setting "variables" and "secrets" from with the
+GitHub web interface. These can be found at:
+
+ https://github.com/<user>/git/settings/secrets/actions
+
+The following variables can be used:
+
+ - CI_BRANCHES
+
+ By default, CI is run when any branch is pushed. If this variable is
+ non-empty, then only the branches it lists will run CI. Branch names
+ should be separated by spaces, and should use their shortened form
+ (e.g., "main", not "refs/heads/main").
diff --git a/ci/config/allow-ref.sample b/ci/config/allow-ref.sample
deleted file mode 100755
index af0e076..0000000
--- a/ci/config/allow-ref.sample
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-#
-# Sample script for enabling/disabling GitHub Actions CI runs on
-# particular refs. By default, CI is run for all branches pushed to
-# GitHub. You can override this by dropping the ".sample" from the script,
-# editing it, committing, and pushing the result to the "ci-config" branch of
-# your repository:
-#
-# git checkout -b ci-config
-# cp allow-ref.sample allow-ref
-# $EDITOR allow-ref
-# git add allow-ref
-# git commit -am "implement my ci preferences"
-# git push
-#
-# This script will then be run when any refs are pushed to that repository. It
-# gets the fully qualified refname as the first argument, and should exit with
-# success only for refs for which you want to run CI.
-
-case "$1" in
-# allow one-off tests by pushing to "for-ci" or "for-ci/mybranch"
-refs/heads/for-ci*) true ;;
-# always build your integration branch
-refs/heads/my-integration-branch) true ;;
-# don't build any other branches or tags
-*) false ;;
-esac
diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
index 107757a..b4e22de 100755
--- a/ci/install-dependencies.sh
+++ b/ci/install-dependencies.sh
@@ -5,17 +5,17 @@
. ${0%/*}/lib.sh
-P4WHENCE=https://cdist2.perforce.com/perforce/r$LINUX_P4_VERSION
+P4WHENCE=https://cdist2.perforce.com/perforce/r21.2
LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION
UBUNTU_COMMON_PKGS="make libssl-dev libcurl4-openssl-dev libexpat-dev
tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl
libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl"
case "$runs_on_pool" in
-ubuntu-latest)
+ubuntu-*)
sudo apt-get -q update
sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
- $UBUNTU_COMMON_PKGS $CC_PACKAGE
+ $UBUNTU_COMMON_PKGS $CC_PACKAGE $PYTHON_PACKAGE
mkdir --parents "$P4_PATH"
pushd "$P4_PATH"
wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"
@@ -30,22 +30,20 @@ ubuntu-latest)
cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .
popd
;;
-macos-latest)
+macos-*)
export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
# Uncomment this if you want to run perf tests:
# brew install gnu-time
test -z "$BREW_INSTALL_PACKAGES" ||
brew install $BREW_INSTALL_PACKAGES
brew link --force gettext
- mkdir -p $HOME/bin
- (
- cd $HOME/bin
- wget -q "https://cdist2.perforce.com/perforce/r21.2/bin.macosx1015x86_64/helix-core-server.tgz" &&
+
+ mkdir -p "$P4_PATH"
+ pushd "$P4_PATH"
+ wget -q "$P4WHENCE/bin.macosx1015x86_64/helix-core-server.tgz" &&
tar -xf helix-core-server.tgz &&
sudo xattr -d com.apple.quarantine p4 p4d 2>/dev/null || true
- )
- PATH="$PATH:${HOME}/bin"
- export PATH
+ popd
if test -n "$CC_PACKAGE"
then
@@ -83,9 +81,9 @@ esac
if type p4d >/dev/null 2>&1 && type p4 >/dev/null 2>&1
then
echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
- p4d -V | grep Rev.
+ p4d -V
echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
- p4 -V | grep Rev.
+ p4 -V
else
echo >&2 "WARNING: perforce wasn't installed, see above for clues why"
fi
diff --git a/ci/install-docker-dependencies.sh b/ci/install-docker-dependencies.sh
index 78b7e32..eb2c9e1 100755
--- a/ci/install-docker-dependencies.sh
+++ b/ci/install-docker-dependencies.sh
@@ -3,6 +3,10 @@
# Install dependencies required to build and test Git inside container
#
+. ${0%/*}/lib.sh
+
+begin_group "Install dependencies"
+
case "$jobname" in
linux32)
linux32 --32bit i386 sh -c '
@@ -12,11 +16,31 @@ linux32)
'
;;
linux-musl)
- apk add --update build-base curl-dev openssl-dev expat-dev gettext \
- pcre2-dev python3 musl-libintl perl-utils ncurses >/dev/null
+ apk add --update shadow sudo build-base curl-dev openssl-dev expat-dev gettext \
+ pcre2-dev python3 musl-libintl perl-utils ncurses \
+ apache2 apache2-http2 apache2-proxy apache2-ssl apache2-webdav apr-util-dbd_sqlite3 \
+ bash cvs gnupg perl-cgi perl-dbd-sqlite >/dev/null
+ ;;
+linux-*|StaticAnalysis)
+ # Required so that apt doesn't wait for user input on certain packages.
+ export DEBIAN_FRONTEND=noninteractive
+
+ apt update -q &&
+ apt install -q -y sudo git make language-pack-is libsvn-perl apache2 libssl-dev \
+ libcurl4-openssl-dev libexpat-dev tcl tk gettext zlib1g-dev \
+ perl-modules liberror-perl libauthen-sasl-perl libemail-valid-perl \
+ libdbd-sqlite3-perl libio-socket-ssl-perl libnet-smtp-ssl-perl ${CC_PACKAGE:-${CC:-gcc}} \
+ apache2 cvs cvsps gnupg libcgi-pm-perl subversion
+
+ if test "$jobname" = StaticAnalysis
+ then
+ apt install -q -y coccinelle
+ fi
;;
pedantic)
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
;;
esac
+
+end_group "Install dependencies"
diff --git a/ci/lib.sh b/ci/lib.sh
index f095519..0a73fc7 100755
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -1,16 +1,7 @@
# Library of functions shared by all CI scripts
-if test true != "$GITHUB_ACTIONS"
+if test true = "$GITHUB_ACTIONS"
then
- begin_group () { :; }
- end_group () { :; }
-
- group () {
- shift
- "$@"
- }
- set -x
-else
begin_group () {
need_to_end_group=t
echo "::group::$1" >&2
@@ -23,27 +14,50 @@ else
need_to_end_group=
echo '::endgroup::' >&2
}
- trap end_group EXIT
+elif test true = "$GITLAB_CI"
+then
+ begin_group () {
+ need_to_end_group=t
+ printf "\e[0Ksection_start:$(date +%s):$(echo "$1" | tr ' ' _)\r\e[0K$1\n"
+ trap "end_group '$1'" EXIT
+ set -x
+ }
- group () {
+ end_group () {
+ test -n "$need_to_end_group" || return 0
set +x
- begin_group "$1"
- shift
- # work around `dash` not supporting `set -o pipefail`
- (
- "$@" 2>&1
- echo $? >exit.status
- ) |
- sed 's/^\(\([^ ]*\):\([0-9]*\):\([0-9]*:\) \)\(error\|warning\): /::\5 file=\2,line=\3::\1/'
- res=$(cat exit.status)
- rm exit.status
- end_group
- return $res
+ need_to_end_group=
+ printf "\e[0Ksection_end:$(date +%s):$(echo "$1" | tr ' ' _)\r\e[0K\n"
+ trap - EXIT
}
+else
+ begin_group () { :; }
+ end_group () { :; }
- begin_group "CI setup"
+ set -x
fi
+group () {
+ group="$1"
+ shift
+ begin_group "$group"
+
+ # work around `dash` not supporting `set -o pipefail`
+ (
+ "$@" 2>&1
+ echo $? >exit.status
+ ) |
+ sed 's/^\(\([^ ]*\):\([0-9]*\):\([0-9]*:\) \)\(error\|warning\): /::\5 file=\2,line=\3::\1/'
+ res=$(cat exit.status)
+ rm exit.status
+
+ end_group "$group"
+ return $res
+}
+
+begin_group "CI setup"
+trap "end_group 'CI setup'" EXIT
+
# Set 'exit on error' for all CI scripts to let the caller know that
# something went wrong.
#
@@ -71,10 +85,32 @@ skip_branch_tip_with_tag () {
fi
}
+# Check whether we can use the path passed via the first argument as Git
+# repository.
+is_usable_git_repository () {
+ # We require Git in our PATH, otherwise we cannot access repositories
+ # at all.
+ if ! command -v git >/dev/null
+ then
+ return 1
+ fi
+
+ # And the target directory needs to be a proper Git repository.
+ if ! git -C "$1" rev-parse 2>/dev/null
+ then
+ return 1
+ fi
+}
+
# Save some info about the current commit's tree, so we can skip the build
# job if we encounter the same tree again and can provide a useful info
# message.
save_good_tree () {
+ if ! is_usable_git_repository .
+ then
+ return
+ fi
+
echo "$(git rev-parse $CI_COMMIT^{tree}) $CI_COMMIT $CI_JOB_NUMBER $CI_JOB_ID" >>"$good_trees_file"
# limit the file size
tail -1000 "$good_trees_file" >"$good_trees_file".tmp
@@ -90,6 +126,11 @@ skip_good_tree () {
return
fi
+ if ! is_usable_git_repository .
+ then
+ return
+ fi
+
if ! good_tree_info="$(grep "^$(git rev-parse $CI_COMMIT^{tree}) " "$good_trees_file")"
then
# Haven't seen this tree yet, or no cached good trees file yet.
@@ -121,6 +162,11 @@ skip_good_tree () {
}
check_unignored_build_artifacts () {
+ if ! is_usable_git_repository .
+ then
+ return
+ fi
+
! git ls-files --other --exclude-standard --error-unmatch \
-- ':/*' 2>/dev/null ||
{
@@ -133,6 +179,26 @@ handle_failed_tests () {
return 1
}
+create_failed_test_artifacts () {
+ mkdir -p t/failed-test-artifacts
+
+ for test_exit in t/test-results/*.exit
+ do
+ test 0 != "$(cat "$test_exit")" || continue
+
+ test_name="${test_exit%.exit}"
+ test_name="${test_name##*/}"
+ 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"
+
+ 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"
+ done
+}
+
# GitHub Action doesn't set TERM, which is required by tput
export TERM=${TERM:-dumb}
@@ -156,11 +222,8 @@ then
# among *all* phases)
cache_dir="$HOME/test-cache/$SYSTEM_PHASENAME"
- export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save"
- export GIT_TEST_OPTS="--verbose-log -x --write-junit-xml"
- MAKEFLAGS="$MAKEFLAGS --jobs=10"
- test windows_nt != "$CI_OS_NAME" ||
- GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS"
+ GIT_TEST_OPTS="--write-junit-xml"
+ JOBS=10
elif test true = "$GITHUB_ACTIONS"
then
CI_TYPE=github-actions
@@ -173,40 +236,70 @@ then
CC="${CC_PACKAGE:-${CC:-gcc}}"
DONT_SKIP_TAGS=t
handle_failed_tests () {
- mkdir -p t/failed-test-artifacts
echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV
+ create_failed_test_artifacts
+ return 1
+ }
+
+ cache_dir="$HOME/none"
- for test_exit in t/test-results/*.exit
- do
- test 0 != "$(cat "$test_exit")" || continue
-
- test_name="${test_exit%.exit}"
- test_name="${test_name##*/}"
- 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"
-
- 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"
- done
+ GIT_TEST_OPTS="--github-workflow-markup"
+ JOBS=10
+elif test true = "$GITLAB_CI"
+then
+ CI_TYPE=gitlab-ci
+ CI_BRANCH="$CI_COMMIT_REF_NAME"
+ CI_COMMIT="$CI_COMMIT_SHA"
+ case "$CI_JOB_IMAGE" in
+ macos-*)
+ # GitLab CI has Python installed via multiple package managers,
+ # most notably via asdf and Homebrew. Ensure that our builds
+ # pick up the Homebrew one by prepending it to our PATH as the
+ # asdf one breaks tests.
+ export PATH="$(brew --prefix)/bin:$PATH"
+
+ CI_OS_NAME=osx
+ ;;
+ alpine:*|fedora:*|ubuntu:*)
+ CI_OS_NAME=linux;;
+ *)
+ echo "Could not identify OS image" >&2
+ env >&2
+ exit 1
+ ;;
+ esac
+ CI_REPO_SLUG="$CI_PROJECT_PATH"
+ CI_JOB_ID="$CI_JOB_ID"
+ CC="${CC_PACKAGE:-${CC:-gcc}}"
+ DONT_SKIP_TAGS=t
+ handle_failed_tests () {
+ create_failed_test_artifacts
return 1
}
cache_dir="$HOME/none"
- export GIT_PROVE_OPTS="--timer --jobs 10"
- export GIT_TEST_OPTS="--verbose-log -x --github-workflow-markup"
- MAKEFLAGS="$MAKEFLAGS --jobs=10"
- test windows != "$CI_OS_NAME" ||
- GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS"
+ runs_on_pool=$(echo "$CI_JOB_IMAGE" | tr : -)
+ JOBS=$(nproc)
else
echo "Could not identify CI type" >&2
env >&2
exit 1
fi
+MAKEFLAGS="$MAKEFLAGS --jobs=$JOBS"
+GIT_PROVE_OPTS="--timer --jobs $JOBS"
+
+GIT_TEST_OPTS="$GIT_TEST_OPTS --verbose-log -x"
+case "$CI_OS_NAME" in
+windows|windows_nt)
+ GIT_TEST_OPTS="$GIT_TEST_OPTS --no-chain-lint --no-bin-wrappers"
+ ;;
+esac
+
+export GIT_TEST_OPTS
+export GIT_PROVE_OPTS
+
good_trees_file="$cache_dir/good-trees"
mkdir -p "$cache_dir"
@@ -226,18 +319,18 @@ export GIT_TEST_CLONE_2GB=true
export SKIP_DASHED_BUILT_INS=YesPlease
case "$runs_on_pool" in
-ubuntu-latest)
+ubuntu-*)
if test "$jobname" = "linux-gcc-default"
then
break
fi
- if [ "$jobname" = linux-gcc ]
+ PYTHON_PACKAGE=python2
+ if test "$jobname" = linux-gcc
then
- MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python3"
- else
- MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python2"
+ PYTHON_PACKAGE=python3
fi
+ MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/$PYTHON_PACKAGE"
export GIT_TEST_HTTPD=true
@@ -246,20 +339,21 @@ ubuntu-latest)
# were recorded in the Homebrew database upon creating the OS X
# image.
# Keep that in mind when you encounter a broken OS X build!
- export LINUX_P4_VERSION="16.2"
export LINUX_GIT_LFS_VERSION="1.5.2"
P4_PATH="$HOME/custom/p4"
GIT_LFS_PATH="$HOME/custom/git-lfs"
export PATH="$GIT_LFS_PATH:$P4_PATH:$PATH"
;;
-macos-latest)
- if [ "$jobname" = osx-gcc ]
+macos-*)
+ MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=$(which python3)"
+ if [ "$jobname" != osx-gcc ]
then
- MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=$(which python3)"
- else
- MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=$(which python2)"
+ MAKEFLAGS="$MAKEFLAGS APPLE_COMMON_CRYPTO_SHA1=Yes"
fi
+
+ P4_PATH="$HOME/custom/p4"
+ export PATH="$P4_PATH:$PATH"
;;
esac
@@ -273,13 +367,19 @@ linux-musl)
MAKEFLAGS="$MAKEFLAGS NO_REGEX=Yes ICONV_OMITS_BOM=Yes"
MAKEFLAGS="$MAKEFLAGS GIT_TEST_UTF8_LOCALE=C.UTF-8"
;;
-linux-leaks)
+linux-leaks|linux-reftable-leaks)
export SANITIZE=leak
export GIT_TEST_PASSING_SANITIZE_LEAK=true
+ export GIT_TEST_SANITIZE_LEAK_LOG=true
+ ;;
+linux-asan-ubsan)
+ export SANITIZE=address,undefined
+ export NO_SVN_TESTS=LetsSaveSomeTime
+ MAKEFLAGS="$MAKEFLAGS NO_PYTHON=YepBecauseP4FlakesTooOften"
;;
esac
MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc}"
-end_group
+end_group "CI setup"
set -x
diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh
index 57277ee..b1f80ae 100755
--- a/ci/print-test-failures.sh
+++ b/ci/print-test-failures.sh
@@ -8,7 +8,7 @@
# Tracing executed commands would produce too much noise in the loop below.
set +x
-cd t/
+cd "${TEST_OUTPUT_DIRECTORY:-t/}"
if ! ls test-results/*.exit >/dev/null 2>/dev/null
then
@@ -51,6 +51,12 @@ do
tar czf failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir"
continue
;;
+ gitlab-ci)
+ mkdir -p failed-test-artifacts
+ cp "${TEST_EXIT%.exit}.out" failed-test-artifacts/
+ tar czf failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir"
+ continue
+ ;;
*)
echo "Unhandled CI type: $CI_TYPE" >&2
exit 1
diff --git a/ci/run-build-and-minimal-fuzzers.sh b/ci/run-build-and-minimal-fuzzers.sh
new file mode 100755
index 0000000..a51076d
--- /dev/null
+++ b/ci/run-build-and-minimal-fuzzers.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# Build and test Git's fuzzers
+#
+
+. ${0%/*}/lib.sh
+
+group "Build fuzzers" make \
+ CC=clang \
+ CXX=clang++ \
+ CFLAGS="-fsanitize=fuzzer-no-link,address" \
+ LIB_FUZZING_ENGINE="-fsanitize=fuzzer,address" \
+ fuzz-all
+
+for fuzzer in commit-graph config date pack-headers pack-idx ; do
+ begin_group "fuzz-$fuzzer"
+ ./oss-fuzz/fuzz-$fuzzer -verbosity=0 -runs=1 || exit 1
+ end_group "fuzz-$fuzzer"
+done
diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh
index 8ebff42..c192bd6 100755
--- a/ci/run-build-and-tests.sh
+++ b/ci/run-build-and-tests.sh
@@ -26,10 +26,10 @@ linux-TEST-vars)
export GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=1
export GIT_TEST_MULTI_PACK_INDEX=1
export GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=1
- export GIT_TEST_ADD_I_USE_BUILTIN=0
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
- export GIT_TEST_WRITE_REV_INDEX=1
+ export GIT_TEST_NO_WRITE_REV_INDEX=1
export GIT_TEST_CHECKOUT_WORKERS=2
+ export GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL=1
;;
linux-clang)
export GIT_TEST_DEFAULT_HASH=sha1
@@ -37,6 +37,9 @@ linux-clang)
linux-sha256)
export GIT_TEST_DEFAULT_HASH=sha256
;;
+linux-reftable|linux-reftable-leaks|osx-reftable)
+ export GIT_TEST_DEFAULT_REF_FORMAT=reftable
+ ;;
pedantic)
# Don't run the tests; we only care about whether Git can be
# built.
@@ -50,6 +53,8 @@ if test -n "$run_tests"
then
group "Run tests" make test ||
handle_failed_tests
+ group "Run unit tests" \
+ make DEFAULT_UNIT_TEST_TARGET=unit-tests-prove unit-tests
fi
check_unignored_build_artifacts
diff --git a/ci/run-test-slice.sh b/ci/run-test-slice.sh
index a3c6795..ae80943 100755
--- a/ci/run-test-slice.sh
+++ b/ci/run-test-slice.sh
@@ -15,4 +15,9 @@ group "Run tests" make --quiet -C t T="$(cd t &&
tr '\n' ' ')" ||
handle_failed_tests
+# We only have one unit test at the moment, so run it in the first slice
+if [ "$1" == "0" ] ; then
+ group "Run unit tests" make --quiet -C t unit-tests-prove
+fi
+
check_unignored_build_artifacts
diff --git a/color.c b/color.c
index 4f884c6..f663c06 100644
--- a/color.c
+++ b/color.c
@@ -1,6 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "color.h"
+#include "editor.h"
+#include "gettext.h"
+#include "hex-ll.h"
+#include "pager.h"
+#include "strbuf.h"
static int git_use_color_default = GIT_COLOR_AUTO;
int color_stdout_is_tty = -1;
@@ -415,7 +420,7 @@ int want_color_fd(int fd, int var)
return var;
}
-int git_color_config(const char *var, const char *value, void *cb)
+int git_color_config(const char *var, const char *value, void *cb UNUSED)
{
if (!strcmp(var, "color.ui")) {
git_use_color_default = git_config_colorbool(var, value);
@@ -425,14 +430,6 @@ int git_color_config(const char *var, const char *value, void *cb)
return 0;
}
-int git_color_default_config(const char *var, const char *value, void *cb)
-{
- if (git_color_config(var, value, cb) < 0)
- return -1;
-
- return git_default_config(var, value, cb);
-}
-
void color_print_strbuf(FILE *fp, const char *color, const struct strbuf *sb)
{
if (*color)
diff --git a/color.h b/color.h
index cfc8f84..bb28343 100644
--- a/color.h
+++ b/color.h
@@ -88,12 +88,8 @@ extern const int column_colors_ansi_max;
*/
extern int color_stdout_is_tty;
-/*
- * Use the first one if you need only color config; the second is a convenience
- * if you are just going to change to git_default_config, too.
- */
+/* Parse color config. */
int git_color_config(const char *var, const char *value, void *cb);
-int git_color_default_config(const char *var, const char *value, void *cb);
/*
* Parse a config option, which can be a boolean or one of
diff --git a/column.c b/column.c
index 1261e18..50bbccc 100644
--- a/column.c
+++ b/column.c
@@ -1,7 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "column.h"
#include "string-list.h"
+#include "pager.h"
#include "parse-options.h"
#include "run-command.h"
#include "utf8.h"
@@ -23,7 +24,7 @@ struct column_data {
/* return length of 's' in letters, ANSI escapes stripped */
static int item_length(const char *s)
{
- return utf8_strnwidth(s, -1, 1);
+ return utf8_strnwidth(s, strlen(s), 1);
}
/*
@@ -181,6 +182,8 @@ void print_columns(const struct string_list *list, unsigned int colopts,
{
struct column_options nopts;
+ if (opts && (0 > opts->padding))
+ BUG("padding must be non-negative");
if (!list->nr)
return;
assert((colopts & COL_ENABLE_MASK) != COL_AUTO);
@@ -360,6 +363,8 @@ int run_column_filter(int colopts, const struct column_options *opts)
{
struct strvec *argv;
+ if (opts && (0 > opts->padding))
+ BUG("padding must be non-negative");
if (fd_out != -1)
return -1;
diff --git a/combine-diff.c b/combine-diff.c
index b0ece95..d6d6fa1 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -1,14 +1,18 @@
-#include "cache.h"
-#include "object-store.h"
+#include "git-compat-util.h"
+#include "object-store-ll.h"
#include "commit.h"
-#include "blob.h"
+#include "convert.h"
#include "diff.h"
#include "diffcore.h"
+#include "environment.h"
+#include "hex.h"
+#include "object-name.h"
#include "quote.h"
#include "xdiff-interface.h"
#include "xdiff/xmacros.h"
#include "log-tree.h"
#include "refs.h"
+#include "tree.h"
#include "userdiff.h"
#include "oid-array.h"
#include "revision.h"
@@ -332,7 +336,9 @@ static char *grab_blob(struct repository *r,
*size = fill_textconv(r, textconv, df, &blob);
free_filespec(df);
} else {
- blob = read_object_file(oid, &type, size);
+ blob = repo_read_object_file(r, oid, &type, size);
+ if (!blob)
+ die(_("unable to read %s"), oid_to_hex(oid));
if (type != OBJ_BLOB)
die("object '%s' is not a blob!", oid_to_hex(oid));
}
@@ -372,7 +378,7 @@ struct combine_diff_state {
static void consume_hunk(void *state_,
long ob, long on,
long nb, long nn,
- const char *funcline, long funclen)
+ const char *func UNUSED, long funclen UNUSED)
{
struct combine_diff_state *state = state_;
@@ -948,11 +954,11 @@ static void show_combined_header(struct combine_diff_path *elem,
"", elem->path, line_prefix, c_meta, c_reset);
printf("%s%sindex ", line_prefix, c_meta);
for (i = 0; i < num_parent; i++) {
- abb = find_unique_abbrev(&elem->parent[i].oid,
- abbrev);
+ abb = repo_find_unique_abbrev(the_repository,
+ &elem->parent[i].oid, abbrev);
printf("%s%s", i ? "," : "", abb);
}
- abb = find_unique_abbrev(&elem->oid, abbrev);
+ abb = repo_find_unique_abbrev(the_repository, &elem->oid, abbrev);
printf("..%s%s\n", abb, c_reset);
if (mode_differs) {
diff --git a/command-list.txt b/command-list.txt
index 9bd6f3c..c4cd0f3 100644
--- a/command-list.txt
+++ b/command-list.txt
@@ -43,6 +43,15 @@
# specified here, which can only have "guide" attribute and nothing
# else.
#
+# User-facing repository, command and file interfaces such as
+# documentation for the .gitmodules, .mailmap etc. files lives in man
+# sections 5 and 7. These entries can only have the "userinterfaces"
+# attribute and nothing else.
+#
+# Git's file formats and protocols, such as documentation for the
+# *.bundle format lives in man section 5. These entries can only have
+# the "developerinterfaces" attribute and nothing else.
+#
### command list (do not change this line)
# command name category [category] [category]
git-add mainporcelain worktree
@@ -82,6 +91,7 @@ git-cvsimport foreignscminterface
git-cvsserver foreignscminterface
git-daemon synchingrepositories
git-describe mainporcelain
+git-diagnose ancillaryinterrogators
git-diff mainporcelain info
git-diff-files plumbinginterrogators
git-diff-index plumbinginterrogators
@@ -150,6 +160,7 @@ git-reflog ancillarymanipulators complete
git-remote ancillarymanipulators complete
git-repack ancillarymanipulators complete
git-replace ancillarymanipulators complete
+git-replay plumbingmanipulators
git-request-pull foreignscminterface complete
git-rerere ancillaryinterrogators
git-reset mainporcelain history
@@ -189,29 +200,42 @@ git-var plumbinginterrogators
git-verify-commit ancillaryinterrogators
git-verify-pack plumbinginterrogators
git-verify-tag ancillaryinterrogators
+git-version ancillaryinterrogators
git-whatchanged ancillaryinterrogators complete
git-worktree mainporcelain
git-write-tree plumbingmanipulators
-gitattributes guide
-gitcli guide
+gitattributes userinterfaces
+gitcli userinterfaces
gitcore-tutorial guide
gitcredentials guide
gitcvs-migration guide
gitdiffcore guide
giteveryday guide
gitfaq guide
+gitformat-bundle developerinterfaces
+gitformat-chunk developerinterfaces
+gitformat-commit-graph developerinterfaces
+gitformat-index developerinterfaces
+gitformat-pack developerinterfaces
+gitformat-signature developerinterfaces
gitglossary guide
-githooks guide
-gitignore guide
+githooks userinterfaces
+gitignore userinterfaces
gitk mainporcelain
-gitmailmap guide
-gitmodules guide
+gitmailmap userinterfaces
+gitmodules userinterfaces
gitnamespaces guide
+gitprotocol-capabilities developerinterfaces
+gitprotocol-common developerinterfaces
+gitprotocol-http developerinterfaces
+gitprotocol-pack developerinterfaces
+gitprotocol-v2 developerinterfaces
gitremote-helpers guide
-gitrepository-layout guide
-gitrevisions guide
+gitrepository-layout userinterfaces
+gitrevisions userinterfaces
gitsubmodules guide
gittutorial guide
gittutorial-2 guide
gitweb ancillaryinterrogators
gitworkflows guide
+scalar mainporcelain
diff --git a/commit-graph.c b/commit-graph.c
index a487d49..45417d7 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -1,15 +1,19 @@
#include "git-compat-util.h"
#include "config.h"
+#include "csum-file.h"
+#include "gettext.h"
+#include "hex.h"
#include "lockfile.h"
-#include "pack.h"
#include "packfile.h"
#include "commit.h"
#include "object.h"
#include "refs.h"
-#include "revision.h"
#include "hash-lookup.h"
#include "commit-graph.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "oid-array.h"
+#include "path.h"
#include "alloc.h"
#include "hashmap.h"
#include "replace-object.h"
@@ -19,6 +23,7 @@
#include "shallow.h"
#include "json-writer.h"
#include "trace2.h"
+#include "tree.h"
#include "chunk-format.h"
void git_test_write_commit_graph_or_die(void)
@@ -116,11 +121,19 @@ timestamp_t commit_graph_generation(const struct commit *c)
struct commit_graph_data *data =
commit_graph_data_slab_peek(&commit_graph_data_slab, c);
- if (!data)
- return GENERATION_NUMBER_INFINITY;
- else if (data->graph_pos == COMMIT_NOT_FROM_GRAPH)
- return GENERATION_NUMBER_INFINITY;
+ if (data && data->generation)
+ return data->generation;
+ return GENERATION_NUMBER_INFINITY;
+}
+
+static timestamp_t commit_graph_generation_from_graph(const struct commit *c)
+{
+ struct commit_graph_data *data =
+ commit_graph_data_slab_peek(&commit_graph_data_slab, c);
+
+ if (!data || data->graph_pos == COMMIT_NOT_FROM_GRAPH)
+ return GENERATION_NUMBER_INFINITY;
return data->generation;
}
@@ -200,14 +213,12 @@ static struct commit_graph *alloc_commit_graph(void)
return g;
}
-extern int read_replace_refs;
-
static int commit_graph_compatible(struct repository *r)
{
if (!r->gitdir)
return 0;
- if (read_replace_refs) {
+ if (replace_refs_enabled(r)) {
prepare_replace_object(r);
if (hashmap_get_size(&r->objects->replace_map->map))
return 0;
@@ -252,7 +263,8 @@ struct commit_graph *load_commit_graph_one_fd_st(struct repository *r,
}
graph_map = xmmap(NULL, graph_size, PROT_READ, MAP_PRIVATE, fd, 0);
close(fd);
- ret = parse_commit_graph(r, graph_map, graph_size);
+ prepare_repo_settings(r);
+ ret = parse_commit_graph(&r->settings, graph_map, graph_size);
if (ret)
ret->odb = odb;
@@ -262,31 +274,25 @@ struct commit_graph *load_commit_graph_one_fd_st(struct repository *r,
return ret;
}
-static int verify_commit_graph_lite(struct commit_graph *g)
+static int graph_read_oid_fanout(const unsigned char *chunk_start,
+ size_t chunk_size, void *data)
{
- /*
- * Basic validation shared between parse_commit_graph()
- * which'll be called every time the graph is used, and the
- * much more expensive verify_commit_graph() used by
- * "commit-graph verify".
- *
- * There should only be very basic checks here to ensure that
- * we don't e.g. segfault in fill_commit_in_graph(), but
- * because this is a very hot codepath nothing that e.g. loops
- * over g->num_commits, or runs a checksum on the commit-graph
- * itself.
- */
- if (!g->chunk_oid_fanout) {
- error("commit-graph is missing the OID Fanout chunk");
- return 1;
- }
- if (!g->chunk_oid_lookup) {
- error("commit-graph is missing the OID Lookup chunk");
- return 1;
- }
- if (!g->chunk_commit_data) {
- error("commit-graph is missing the Commit Data chunk");
- return 1;
+ struct commit_graph *g = data;
+ int i;
+
+ if (chunk_size != 256 * sizeof(uint32_t))
+ return error(_("commit-graph oid fanout chunk is wrong size"));
+ g->chunk_oid_fanout = (const uint32_t *)chunk_start;
+ g->num_commits = ntohl(g->chunk_oid_fanout[255]);
+
+ for (i = 0; i < 255; i++) {
+ uint32_t oid_fanout1 = ntohl(g->chunk_oid_fanout[i]);
+ uint32_t oid_fanout2 = ntohl(g->chunk_oid_fanout[i + 1]);
+
+ if (oid_fanout1 > oid_fanout2) {
+ error(_("commit-graph fanout values out of order"));
+ return 1;
+ }
}
return 0;
@@ -297,7 +303,40 @@ static int graph_read_oid_lookup(const unsigned char *chunk_start,
{
struct commit_graph *g = data;
g->chunk_oid_lookup = chunk_start;
- g->num_commits = chunk_size / g->hash_len;
+ if (chunk_size / g->hash_len != g->num_commits)
+ return error(_("commit-graph OID lookup chunk is the wrong size"));
+ return 0;
+}
+
+static int graph_read_commit_data(const unsigned char *chunk_start,
+ size_t chunk_size, void *data)
+{
+ struct commit_graph *g = data;
+ if (chunk_size / GRAPH_DATA_WIDTH != g->num_commits)
+ return error(_("commit-graph commit data chunk is wrong size"));
+ g->chunk_commit_data = chunk_start;
+ return 0;
+}
+
+static int graph_read_generation_data(const unsigned char *chunk_start,
+ size_t chunk_size, void *data)
+{
+ struct commit_graph *g = data;
+ if (chunk_size / sizeof(uint32_t) != g->num_commits)
+ return error(_("commit-graph generations chunk is wrong size"));
+ g->chunk_generation_data = chunk_start;
+ return 0;
+}
+
+static int graph_read_bloom_index(const unsigned char *chunk_start,
+ size_t chunk_size, void *data)
+{
+ struct commit_graph *g = data;
+ if (chunk_size / 4 != g->num_commits) {
+ warning(_("commit-graph changed-path index chunk is too small"));
+ return -1;
+ }
+ g->chunk_bloom_indexes = chunk_start;
return 0;
}
@@ -306,7 +345,17 @@ static int graph_read_bloom_data(const unsigned char *chunk_start,
{
struct commit_graph *g = data;
uint32_t hash_version;
+
+ if (chunk_size < BLOOMDATA_CHUNK_HEADER_SIZE) {
+ warning(_("ignoring too-small changed-path chunk"
+ " (%"PRIuMAX" < %"PRIuMAX") in commit-graph file"),
+ (uintmax_t)chunk_size,
+ (uintmax_t)BLOOMDATA_CHUNK_HEADER_SIZE);
+ return -1;
+ }
+
g->chunk_bloom_data = chunk_start;
+ g->chunk_bloom_data_size = chunk_size;
hash_version = get_be32(chunk_start);
if (hash_version != 1)
@@ -321,7 +370,7 @@ static int graph_read_bloom_data(const unsigned char *chunk_start,
return 0;
}
-struct commit_graph *parse_commit_graph(struct repository *r,
+struct commit_graph *parse_commit_graph(struct repo_settings *s,
void *graph_map, size_t graph_size)
{
const unsigned char *data;
@@ -359,8 +408,6 @@ struct commit_graph *parse_commit_graph(struct repository *r,
return NULL;
}
- prepare_repo_settings(r);
-
graph = alloc_commit_graph();
graph->hash_len = the_hash_algo->rawsz;
@@ -380,29 +427,41 @@ struct commit_graph *parse_commit_graph(struct repository *r,
cf = init_chunkfile(NULL);
if (read_table_of_contents(cf, graph->data, graph_size,
- GRAPH_HEADER_SIZE, graph->num_chunks))
+ GRAPH_HEADER_SIZE, graph->num_chunks, 1))
+ goto free_and_return;
+
+ if (read_chunk(cf, GRAPH_CHUNKID_OIDFANOUT, graph_read_oid_fanout, graph)) {
+ error(_("commit-graph required OID fanout chunk missing or corrupted"));
+ goto free_and_return;
+ }
+ if (read_chunk(cf, GRAPH_CHUNKID_OIDLOOKUP, graph_read_oid_lookup, graph)) {
+ error(_("commit-graph required OID lookup chunk missing or corrupted"));
+ goto free_and_return;
+ }
+ if (read_chunk(cf, GRAPH_CHUNKID_DATA, graph_read_commit_data, graph)) {
+ error(_("commit-graph required commit data chunk missing or corrupted"));
goto free_and_return;
+ }
- pair_chunk(cf, GRAPH_CHUNKID_OIDFANOUT,
- (const unsigned char **)&graph->chunk_oid_fanout);
- read_chunk(cf, GRAPH_CHUNKID_OIDLOOKUP, graph_read_oid_lookup, graph);
- pair_chunk(cf, GRAPH_CHUNKID_DATA, &graph->chunk_commit_data);
- pair_chunk(cf, GRAPH_CHUNKID_EXTRAEDGES, &graph->chunk_extra_edges);
- pair_chunk(cf, GRAPH_CHUNKID_BASE, &graph->chunk_base_graphs);
+ pair_chunk(cf, GRAPH_CHUNKID_EXTRAEDGES, &graph->chunk_extra_edges,
+ &graph->chunk_extra_edges_size);
+ pair_chunk(cf, GRAPH_CHUNKID_BASE, &graph->chunk_base_graphs,
+ &graph->chunk_base_graphs_size);
- if (get_configured_generation_version(r) >= 2) {
- pair_chunk(cf, GRAPH_CHUNKID_GENERATION_DATA,
- &graph->chunk_generation_data);
+ if (s->commit_graph_generation_version >= 2) {
+ read_chunk(cf, GRAPH_CHUNKID_GENERATION_DATA,
+ graph_read_generation_data, graph);
pair_chunk(cf, GRAPH_CHUNKID_GENERATION_DATA_OVERFLOW,
- &graph->chunk_generation_data_overflow);
+ &graph->chunk_generation_data_overflow,
+ &graph->chunk_generation_data_overflow_size);
if (graph->chunk_generation_data)
graph->read_generation_data = 1;
}
- if (r->settings.commit_graph_read_changed_paths) {
- pair_chunk(cf, GRAPH_CHUNKID_BLOOMINDEXES,
- &graph->chunk_bloom_indexes);
+ if (s->commit_graph_read_changed_paths) {
+ read_chunk(cf, GRAPH_CHUNKID_BLOOMINDEXES,
+ graph_read_bloom_index, graph);
read_chunk(cf, GRAPH_CHUNKID_BLOOMDATA,
graph_read_bloom_data, graph);
}
@@ -418,9 +477,6 @@ struct commit_graph *parse_commit_graph(struct repository *r,
oidread(&graph->oid, graph->data + graph->data_len - graph->hash_len);
- if (verify_commit_graph_lite(graph))
- goto free_and_return;
-
free_chunkfile(cf);
return graph;
@@ -462,6 +518,31 @@ static struct commit_graph *load_commit_graph_v1(struct repository *r,
return g;
}
+/*
+ * returns 1 if and only if all graphs in the chain have
+ * corrected commit dates stored in the generation_data chunk.
+ */
+static int validate_mixed_generation_chain(struct commit_graph *g)
+{
+ int read_generation_data = 1;
+ struct commit_graph *p = g;
+
+ while (read_generation_data && p) {
+ read_generation_data = p->read_generation_data;
+ p = p->base_graph;
+ }
+
+ if (read_generation_data)
+ return 1;
+
+ while (g) {
+ g->read_generation_data = 0;
+ g = g->base_graph;
+ }
+
+ return 0;
+}
+
static int add_graph_to_chain(struct commit_graph *g,
struct commit_graph *chain,
struct object_id *oids,
@@ -474,12 +555,17 @@ static int add_graph_to_chain(struct commit_graph *g,
return 0;
}
+ if (g->chunk_base_graphs_size / g->hash_len < n) {
+ warning(_("commit-graph base graphs chunk is too small"));
+ return 0;
+ }
+
while (n) {
n--;
if (!cur_g ||
!oideq(&oids[n], &cur_g->oid) ||
- !hasheq(oids[n].hash, g->chunk_base_graphs + g->hash_len * n)) {
+ !hasheq(oids[n].hash, g->chunk_base_graphs + st_mult(g->hash_len, n))) {
warning(_("commit-graph chain does not match"));
return 0;
}
@@ -487,39 +573,56 @@ static int add_graph_to_chain(struct commit_graph *g,
cur_g = cur_g->base_graph;
}
+ if (chain) {
+ if (unsigned_add_overflows(chain->num_commits,
+ chain->num_commits_in_base)) {
+ warning(_("commit count in base graph too high: %"PRIuMAX),
+ (uintmax_t)chain->num_commits_in_base);
+ return 0;
+ }
+ g->num_commits_in_base = chain->num_commits + chain->num_commits_in_base;
+ }
+
g->base_graph = chain;
- if (chain)
- g->num_commits_in_base = chain->num_commits + chain->num_commits_in_base;
+ return 1;
+}
+int open_commit_graph_chain(const char *chain_file,
+ int *fd, struct stat *st)
+{
+ *fd = git_open(chain_file);
+ if (*fd < 0)
+ return 0;
+ if (fstat(*fd, st)) {
+ close(*fd);
+ return 0;
+ }
+ if (st->st_size < the_hash_algo->hexsz) {
+ close(*fd);
+ if (!st->st_size) {
+ /* treat empty files the same as missing */
+ errno = ENOENT;
+ } else {
+ warning(_("commit-graph chain file too small"));
+ errno = EINVAL;
+ }
+ return 0;
+ }
return 1;
}
-static struct commit_graph *load_commit_graph_chain(struct repository *r,
- struct object_directory *odb)
+struct commit_graph *load_commit_graph_chain_fd_st(struct repository *r,
+ int fd, struct stat *st,
+ int *incomplete_chain)
{
struct commit_graph *graph_chain = NULL;
struct strbuf line = STRBUF_INIT;
- struct stat st;
struct object_id *oids;
int i = 0, valid = 1, count;
- char *chain_name = get_commit_graph_chain_filename(odb);
- FILE *fp;
- int stat_res;
+ FILE *fp = xfdopen(fd, "r");
- fp = fopen(chain_name, "r");
- stat_res = stat(chain_name, &st);
- free(chain_name);
-
- if (!fp)
- return NULL;
- if (stat_res ||
- st.st_size <= the_hash_algo->hexsz) {
- fclose(fp);
- return NULL;
- }
-
- count = st.st_size / (the_hash_algo->hexsz + 1);
+ count = st->st_size / (the_hash_algo->hexsz + 1);
CALLOC_ARRAY(oids, count);
prepare_alt_odb(r);
@@ -548,6 +651,8 @@ static struct commit_graph *load_commit_graph_chain(struct repository *r,
if (add_graph_to_chain(g, graph_chain, oids, i)) {
graph_chain = g;
valid = 1;
+ } else {
+ free_commit_graph(g);
}
break;
@@ -560,36 +665,32 @@ static struct commit_graph *load_commit_graph_chain(struct repository *r,
}
}
+ validate_mixed_generation_chain(graph_chain);
+
free(oids);
fclose(fp);
strbuf_release(&line);
+ *incomplete_chain = !valid;
return graph_chain;
}
-/*
- * returns 1 if and only if all graphs in the chain have
- * corrected commit dates stored in the generation_data chunk.
- */
-static int validate_mixed_generation_chain(struct commit_graph *g)
+static struct commit_graph *load_commit_graph_chain(struct repository *r,
+ struct object_directory *odb)
{
- int read_generation_data = 1;
- struct commit_graph *p = g;
-
- while (read_generation_data && p) {
- read_generation_data = p->read_generation_data;
- p = p->base_graph;
- }
-
- if (read_generation_data)
- return 1;
+ char *chain_file = get_commit_graph_chain_filename(odb);
+ struct stat st;
+ int fd;
+ struct commit_graph *g = NULL;
- while (g) {
- g->read_generation_data = 0;
- g = g->base_graph;
+ if (open_commit_graph_chain(chain_file, &fd, &st)) {
+ int incomplete;
+ /* ownership of fd is taken over by load function */
+ g = load_commit_graph_chain_fd_st(r, fd, &st, &incomplete);
}
- return 0;
+ free(chain_file);
+ return g;
}
struct commit_graph *read_commit_graph_one(struct repository *r,
@@ -600,8 +701,6 @@ struct commit_graph *read_commit_graph_one(struct repository *r,
if (!g)
g = load_commit_graph_chain(r, odb);
- validate_mixed_generation_chain(g);
-
return g;
}
@@ -705,19 +804,13 @@ struct bloom_filter_settings *get_bloom_filter_settings(struct repository *r)
return NULL;
}
-static void close_commit_graph_one(struct commit_graph *g)
+void close_commit_graph(struct raw_object_store *o)
{
- if (!g)
+ if (!o->commit_graph)
return;
clear_commit_graph_data_slab(&commit_graph_data_slab);
- close_commit_graph_one(g->base_graph);
- free_commit_graph(g);
-}
-
-void close_commit_graph(struct raw_object_store *o)
-{
- close_commit_graph_one(o->commit_graph);
+ free_commit_graph(o->commit_graph);
o->commit_graph = NULL;
}
@@ -744,7 +837,7 @@ static void load_oid_from_graph(struct commit_graph *g,
lex_index = pos - g->num_commits_in_base;
- oidread(oid, g->chunk_oid_lookup + g->hash_len * lex_index);
+ oidread(oid, g->chunk_oid_lookup + st_mult(g->hash_len, lex_index));
}
static struct commit_list **insert_parent_or_die(struct repository *r,
@@ -780,7 +873,7 @@ static void fill_commit_graph_info(struct commit *item, struct commit_graph *g,
die(_("invalid commit position. commit-graph is likely corrupt"));
lex_index = pos - g->num_commits_in_base;
- commit_data = g->chunk_commit_data + GRAPH_DATA_WIDTH * lex_index;
+ commit_data = g->chunk_commit_data + st_mult(GRAPH_DATA_WIDTH, lex_index);
graph_data = commit_graph_data_at(item);
graph_data->graph_pos = pos;
@@ -790,14 +883,17 @@ static void fill_commit_graph_info(struct commit *item, struct commit_graph *g,
item->date = (timestamp_t)((date_high << 32) | date_low);
if (g->read_generation_data) {
- offset = (timestamp_t)get_be32(g->chunk_generation_data + sizeof(uint32_t) * lex_index);
+ offset = (timestamp_t)get_be32(g->chunk_generation_data + st_mult(sizeof(uint32_t), lex_index));
if (offset & CORRECTED_COMMIT_DATE_OFFSET_OVERFLOW) {
if (!g->chunk_generation_data_overflow)
die(_("commit-graph requires overflow generation data but has none"));
offset_pos = offset ^ CORRECTED_COMMIT_DATE_OFFSET_OVERFLOW;
- graph_data->generation = item->date + get_be64(g->chunk_generation_data_overflow + 8 * offset_pos);
+ if (g->chunk_generation_data_overflow_size / sizeof(uint64_t) <= offset_pos)
+ die(_("commit-graph overflow generation data is too small"));
+ graph_data->generation = item->date +
+ get_be64(g->chunk_generation_data_overflow + sizeof(uint64_t) * offset_pos);
} else
graph_data->generation = item->date + offset;
} else
@@ -817,7 +913,7 @@ static int fill_commit_in_graph(struct repository *r,
struct commit_graph *g, uint32_t pos)
{
uint32_t edge_value;
- uint32_t *parent_data_ptr;
+ uint32_t parent_data_pos;
struct commit_list **pptr;
const unsigned char *commit_data;
uint32_t lex_index;
@@ -828,7 +924,7 @@ static int fill_commit_in_graph(struct repository *r,
fill_commit_graph_info(item, g, pos);
lex_index = pos - g->num_commits_in_base;
- commit_data = g->chunk_commit_data + (g->hash_len + 16) * lex_index;
+ commit_data = g->chunk_commit_data + st_mult(g->hash_len + 16, lex_index);
item->object.parsed = 1;
@@ -849,14 +945,21 @@ static int fill_commit_in_graph(struct repository *r,
return 1;
}
- parent_data_ptr = (uint32_t*)(g->chunk_extra_edges +
- 4 * (uint64_t)(edge_value & GRAPH_EDGE_LAST_MASK));
+ parent_data_pos = edge_value & GRAPH_EDGE_LAST_MASK;
do {
- edge_value = get_be32(parent_data_ptr);
+ if (g->chunk_extra_edges_size / sizeof(uint32_t) <= parent_data_pos) {
+ error(_("commit-graph extra-edges pointer out of bounds"));
+ free_commit_list(item->parents);
+ item->parents = NULL;
+ item->object.parsed = 0;
+ return 0;
+ }
+ edge_value = get_be32(g->chunk_extra_edges +
+ sizeof(uint32_t) * parent_data_pos);
pptr = insert_parent_or_die(r, g,
edge_value & GRAPH_EDGE_LAST_MASK,
pptr);
- parent_data_ptr++;
+ parent_data_pos++;
} while (!(edge_value & GRAPH_LAST_EDGE));
return 1;
@@ -899,14 +1002,18 @@ int repo_find_commit_pos_in_graph(struct repository *r, struct commit *c,
struct commit *lookup_commit_in_graph(struct repository *repo, const struct object_id *id)
{
+ static int commit_graph_paranoia = -1;
struct commit *commit;
uint32_t pos;
- if (!repo->objects->commit_graph)
+ if (commit_graph_paranoia == -1)
+ commit_graph_paranoia = git_env_bool(GIT_COMMIT_GRAPH_PARANOIA, 0);
+
+ if (!prepare_commit_graph(repo))
return NULL;
if (!search_commit_pos_in_graph(id, repo->objects->commit_graph, &pos))
return NULL;
- if (!has_object(repo, id, 0))
+ if (commit_graph_paranoia && !has_object(repo, id, 0))
return NULL;
commit = lookup_commit(repo, id);
@@ -970,7 +1077,7 @@ static struct tree *load_tree_for_commit(struct repository *r,
g = g->base_graph;
commit_data = g->chunk_commit_data +
- GRAPH_DATA_WIDTH * (graph_pos - g->num_commits_in_base);
+ st_mult(GRAPH_DATA_WIDTH, graph_pos - g->num_commits_in_base);
oidread(&oid, commit_data);
set_commit_tree(c, lookup_tree(r, &oid));
@@ -1447,24 +1554,52 @@ static void close_reachable(struct write_commit_graph_context *ctx)
stop_progress(&ctx->progress);
}
-static void compute_topological_levels(struct write_commit_graph_context *ctx)
+struct compute_generation_info {
+ struct repository *r;
+ struct packed_commit_list *commits;
+ struct progress *progress;
+ int progress_cnt;
+
+ timestamp_t (*get_generation)(struct commit *c, void *data);
+ void (*set_generation)(struct commit *c, timestamp_t gen, void *data);
+ void *data;
+};
+
+static timestamp_t compute_generation_from_max(struct commit *c,
+ timestamp_t max_gen,
+ int generation_version)
+{
+ switch (generation_version) {
+ case 1: /* topological levels */
+ if (max_gen > GENERATION_NUMBER_V1_MAX - 1)
+ max_gen = GENERATION_NUMBER_V1_MAX - 1;
+ return max_gen + 1;
+
+ case 2: /* corrected commit date */
+ if (c->date && c->date > max_gen)
+ max_gen = c->date - 1;
+ return max_gen + 1;
+
+ default:
+ BUG("attempting unimplemented version");
+ }
+}
+
+static void compute_reachable_generation_numbers(
+ struct compute_generation_info *info,
+ int generation_version)
{
int i;
struct commit_list *list = NULL;
- if (ctx->report_progress)
- ctx->progress = start_delayed_progress(
- _("Computing commit graph topological levels"),
- ctx->commits.nr);
- for (i = 0; i < ctx->commits.nr; i++) {
- struct commit *c = ctx->commits.list[i];
- uint32_t level;
-
- repo_parse_commit(ctx->r, c);
- level = *topo_level_slab_at(ctx->topo_levels, c);
+ for (i = 0; i < info->commits->nr; i++) {
+ struct commit *c = info->commits->list[i];
+ timestamp_t gen;
+ repo_parse_commit(info->r, c);
+ gen = info->get_generation(c, info->data);
+ display_progress(info->progress, info->progress_cnt + 1);
- display_progress(ctx->progress, i + 1);
- if (level != GENERATION_NUMBER_ZERO)
+ if (gen != GENERATION_NUMBER_ZERO && gen != GENERATION_NUMBER_INFINITY)
continue;
commit_list_insert(c, &list);
@@ -1472,41 +1607,92 @@ static void compute_topological_levels(struct write_commit_graph_context *ctx)
struct commit *current = list->item;
struct commit_list *parent;
int all_parents_computed = 1;
- uint32_t max_level = 0;
+ uint32_t max_gen = 0;
for (parent = current->parents; parent; parent = parent->next) {
- repo_parse_commit(ctx->r, parent->item);
- level = *topo_level_slab_at(ctx->topo_levels, parent->item);
+ repo_parse_commit(info->r, parent->item);
+ gen = info->get_generation(parent->item, info->data);
- if (level == GENERATION_NUMBER_ZERO) {
+ if (gen == GENERATION_NUMBER_ZERO) {
all_parents_computed = 0;
commit_list_insert(parent->item, &list);
break;
}
- if (level > max_level)
- max_level = level;
+ if (gen > max_gen)
+ max_gen = gen;
}
if (all_parents_computed) {
pop_commit(&list);
-
- if (max_level > GENERATION_NUMBER_V1_MAX - 1)
- max_level = GENERATION_NUMBER_V1_MAX - 1;
- *topo_level_slab_at(ctx->topo_levels, current) = max_level + 1;
+ gen = compute_generation_from_max(
+ current, max_gen,
+ generation_version);
+ info->set_generation(current, gen, info->data);
}
}
}
+}
+
+static timestamp_t get_topo_level(struct commit *c, void *data)
+{
+ struct write_commit_graph_context *ctx = data;
+ return *topo_level_slab_at(ctx->topo_levels, c);
+}
+
+static void set_topo_level(struct commit *c, timestamp_t t, void *data)
+{
+ struct write_commit_graph_context *ctx = data;
+ *topo_level_slab_at(ctx->topo_levels, c) = (uint32_t)t;
+}
+
+static void compute_topological_levels(struct write_commit_graph_context *ctx)
+{
+ struct compute_generation_info info = {
+ .r = ctx->r,
+ .commits = &ctx->commits,
+ .get_generation = get_topo_level,
+ .set_generation = set_topo_level,
+ .data = ctx,
+ };
+
+ if (ctx->report_progress)
+ info.progress = ctx->progress
+ = start_delayed_progress(
+ _("Computing commit graph topological levels"),
+ ctx->commits.nr);
+
+ compute_reachable_generation_numbers(&info, 1);
+
stop_progress(&ctx->progress);
}
+static timestamp_t get_generation_from_graph_data(struct commit *c,
+ void *data UNUSED)
+{
+ return commit_graph_data_at(c)->generation;
+}
+
+static void set_generation_v2(struct commit *c, timestamp_t t,
+ void *data UNUSED)
+{
+ struct commit_graph_data *g = commit_graph_data_at(c);
+ g->generation = t;
+}
+
static void compute_generation_numbers(struct write_commit_graph_context *ctx)
{
int i;
- struct commit_list *list = NULL;
+ struct compute_generation_info info = {
+ .r = ctx->r,
+ .commits = &ctx->commits,
+ .get_generation = get_generation_from_graph_data,
+ .set_generation = set_generation_v2,
+ };
if (ctx->report_progress)
- ctx->progress = start_delayed_progress(
+ info.progress = ctx->progress
+ = start_delayed_progress(
_("Computing commit graph generation numbers"),
ctx->commits.nr);
@@ -1518,47 +1704,7 @@ static void compute_generation_numbers(struct write_commit_graph_context *ctx)
}
}
- for (i = 0; i < ctx->commits.nr; i++) {
- struct commit *c = ctx->commits.list[i];
- timestamp_t corrected_commit_date;
-
- repo_parse_commit(ctx->r, c);
- corrected_commit_date = commit_graph_data_at(c)->generation;
-
- display_progress(ctx->progress, i + 1);
- if (corrected_commit_date != GENERATION_NUMBER_ZERO)
- continue;
-
- commit_list_insert(c, &list);
- while (list) {
- struct commit *current = list->item;
- struct commit_list *parent;
- int all_parents_computed = 1;
- timestamp_t max_corrected_commit_date = 0;
-
- for (parent = current->parents; parent; parent = parent->next) {
- repo_parse_commit(ctx->r, parent->item);
- corrected_commit_date = commit_graph_data_at(parent->item)->generation;
-
- if (corrected_commit_date == GENERATION_NUMBER_ZERO) {
- all_parents_computed = 0;
- commit_list_insert(parent->item, &list);
- break;
- }
-
- if (corrected_commit_date > max_corrected_commit_date)
- max_corrected_commit_date = corrected_commit_date;
- }
-
- if (all_parents_computed) {
- pop_commit(&list);
-
- if (current->date && current->date > max_corrected_commit_date)
- max_corrected_commit_date = current->date - 1;
- commit_graph_data_at(current)->generation = max_corrected_commit_date + 1;
- }
- }
- }
+ compute_reachable_generation_numbers(&info, 2);
for (i = 0; i < ctx->commits.nr; i++) {
struct commit *c = ctx->commits.list[i];
@@ -1569,6 +1715,35 @@ static void compute_generation_numbers(struct write_commit_graph_context *ctx)
stop_progress(&ctx->progress);
}
+static void set_generation_in_graph_data(struct commit *c, timestamp_t t,
+ void *data UNUSED)
+{
+ commit_graph_data_at(c)->generation = t;
+}
+
+/*
+ * After this method, all commits reachable from those in the given
+ * list will have non-zero, non-infinite generation numbers.
+ */
+void ensure_generations_valid(struct repository *r,
+ struct commit **commits, size_t nr)
+{
+ int generation_version = get_configured_generation_version(r);
+ struct packed_commit_list list = {
+ .list = commits,
+ .alloc = nr,
+ .nr = nr,
+ };
+ struct compute_generation_info info = {
+ .r = r,
+ .commits = &list,
+ .get_generation = get_generation_from_graph_data,
+ .set_generation = set_generation_in_graph_data,
+ };
+
+ compute_reachable_generation_numbers(&info, generation_version);
+}
+
static void trace2_bloom_filter_write_statistics(struct write_commit_graph_context *ctx)
{
trace2_data_intmax("commit-graph", ctx->r, "filter-computed",
@@ -1595,8 +1770,7 @@ static void compute_bloom_filters(struct write_commit_graph_context *ctx)
_("Computing commit changed paths Bloom filters"),
ctx->commits.nr);
- ALLOC_ARRAY(sorted_commits, ctx->commits.nr);
- COPY_ARRAY(sorted_commits, ctx->commits.list, ctx->commits.nr);
+ DUP_ARRAY(sorted_commits, ctx->commits.list, ctx->commits.nr);
if (ctx->order_by_pack)
QSORT(sorted_commits, ctx->commits.nr, commit_pos_cmp);
@@ -1640,9 +1814,9 @@ struct refs_cb_data {
struct progress *progress;
};
-static int add_ref_to_set(const char *refname,
+static int add_ref_to_set(const char *refname UNUSED,
const struct object_id *oid,
- int flags, void *cb_data)
+ int flags UNUSED, void *cb_data)
{
struct object_id peeled;
struct refs_cb_data *data = (struct refs_cb_data *)cb_data;
@@ -1884,35 +2058,35 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
add_chunk(cf, GRAPH_CHUNKID_OIDFANOUT, GRAPH_FANOUT_SIZE,
write_graph_chunk_fanout);
- add_chunk(cf, GRAPH_CHUNKID_OIDLOOKUP, hashsz * ctx->commits.nr,
+ add_chunk(cf, GRAPH_CHUNKID_OIDLOOKUP, st_mult(hashsz, ctx->commits.nr),
write_graph_chunk_oids);
- add_chunk(cf, GRAPH_CHUNKID_DATA, (hashsz + 16) * ctx->commits.nr,
+ add_chunk(cf, GRAPH_CHUNKID_DATA, st_mult(hashsz + 16, ctx->commits.nr),
write_graph_chunk_data);
if (ctx->write_generation_data)
add_chunk(cf, GRAPH_CHUNKID_GENERATION_DATA,
- sizeof(uint32_t) * ctx->commits.nr,
+ st_mult(sizeof(uint32_t), ctx->commits.nr),
write_graph_chunk_generation_data);
if (ctx->num_generation_data_overflows)
add_chunk(cf, GRAPH_CHUNKID_GENERATION_DATA_OVERFLOW,
- sizeof(timestamp_t) * ctx->num_generation_data_overflows,
+ st_mult(sizeof(timestamp_t), ctx->num_generation_data_overflows),
write_graph_chunk_generation_data_overflow);
if (ctx->num_extra_edges)
add_chunk(cf, GRAPH_CHUNKID_EXTRAEDGES,
- 4 * ctx->num_extra_edges,
+ st_mult(4, ctx->num_extra_edges),
write_graph_chunk_extra_edges);
if (ctx->changed_paths) {
add_chunk(cf, GRAPH_CHUNKID_BLOOMINDEXES,
- sizeof(uint32_t) * ctx->commits.nr,
+ st_mult(sizeof(uint32_t), ctx->commits.nr),
write_graph_chunk_bloom_indexes);
add_chunk(cf, GRAPH_CHUNKID_BLOOMDATA,
- sizeof(uint32_t) * 3
- + ctx->total_bloom_filter_data_size,
+ st_add(sizeof(uint32_t) * 3,
+ ctx->total_bloom_filter_data_size),
write_graph_chunk_bloom_data);
}
if (ctx->num_commit_graphs_after > 1)
add_chunk(cf, GRAPH_CHUNKID_BASE,
- hashsz * (ctx->num_commit_graphs_after - 1),
+ st_mult(hashsz, ctx->num_commit_graphs_after - 1),
write_graph_chunk_base);
hashwrite_be32(f, GRAPH_SIGNATURE);
@@ -1930,7 +2104,7 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
get_num_chunks(cf));
ctx->progress = start_delayed_progress(
progress_title.buf,
- get_num_chunks(cf) * ctx->commits.nr);
+ st_mult(get_num_chunks(cf), ctx->commits.nr));
}
write_chunkfile(cf, ctx);
@@ -1987,9 +2161,11 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
free(graph_name);
}
+ free(ctx->commit_graph_hash_after[ctx->num_commit_graphs_after - 1]);
ctx->commit_graph_hash_after[ctx->num_commit_graphs_after - 1] = xstrdup(hash_to_hex(file_hash));
final_graph_name = get_split_graph_filename(ctx->odb,
ctx->commit_graph_hash_after[ctx->num_commit_graphs_after - 1]);
+ free(ctx->commit_graph_filenames_after[ctx->num_commit_graphs_after - 1]);
ctx->commit_graph_filenames_after[ctx->num_commit_graphs_after - 1] = final_graph_name;
result = rename(ctx->graph_name, final_graph_name);
@@ -2036,11 +2212,16 @@ static void split_graph_merge_strategy(struct write_commit_graph_context *ctx)
if (flags != COMMIT_GRAPH_SPLIT_MERGE_PROHIBITED &&
flags != COMMIT_GRAPH_SPLIT_REPLACE) {
- while (g && (g->num_commits <= size_mult * num_commits ||
+ while (g && (g->num_commits <= st_mult(size_mult, num_commits) ||
(max_commits && num_commits > max_commits))) {
if (g->odb != ctx->odb)
break;
+ if (unsigned_add_overflows(num_commits, g->num_commits))
+ die(_("cannot merge graphs with %"PRIuMAX", "
+ "%"PRIuMAX" commits"),
+ (uintmax_t)num_commits,
+ (uintmax_t)g->num_commits);
num_commits += g->num_commits;
g = g->base_graph;
@@ -2098,6 +2279,11 @@ static void merge_commit_graph(struct write_commit_graph_context *ctx,
uint32_t i;
uint32_t offset = g->num_commits_in_base;
+ if (unsigned_add_overflows(ctx->commits.nr, g->num_commits))
+ die(_("cannot merge graph %s, too many commits: %"PRIuMAX),
+ oid_to_hex(&g->oid),
+ (uintmax_t)st_add(ctx->commits.nr, g->num_commits));
+
ALLOC_GROW(ctx->commits.list, ctx->commits.nr + g->num_commits, ctx->commits.alloc);
for (i = 0; i < g->num_commits; i++) {
@@ -2266,6 +2452,8 @@ static void expire_commit_graphs(struct write_commit_graph_context *ctx)
}
out:
+ if(dir)
+ closedir(dir);
strbuf_release(&path);
}
@@ -2360,13 +2548,13 @@ int write_commit_graph(struct object_directory *odb,
replace = ctx->opts->split_flags & COMMIT_GRAPH_SPLIT_REPLACE;
}
- ctx->approx_nr_objects = approximate_object_count();
+ ctx->approx_nr_objects = repo_approximate_object_count(the_repository);
if (ctx->append && ctx->r->objects->commit_graph) {
struct commit_graph *g = ctx->r->objects->commit_graph;
for (i = 0; i < g->num_commits; i++) {
struct object_id oid;
- oidread(&oid, g->chunk_oid_lookup + g->hash_len * i);
+ oidread(&oid, g->chunk_oid_lookup + st_mult(g->hash_len, i));
oid_array_append(&ctx->oids, &oid);
}
}
@@ -2426,23 +2614,21 @@ int write_commit_graph(struct object_directory *odb,
cleanup:
free(ctx->graph_name);
+ free(ctx->base_graph_name);
free(ctx->commits.list);
oid_array_clear(&ctx->oids);
clear_topo_level_slab(&topo_levels);
- if (ctx->commit_graph_filenames_after) {
- for (i = 0; i < ctx->num_commit_graphs_after; i++) {
- free(ctx->commit_graph_filenames_after[i]);
- free(ctx->commit_graph_hash_after[i]);
- }
-
- for (i = 0; i < ctx->num_commit_graphs_before; i++)
- free(ctx->commit_graph_filenames_before[i]);
+ for (i = 0; i < ctx->num_commit_graphs_before; i++)
+ free(ctx->commit_graph_filenames_before[i]);
+ free(ctx->commit_graph_filenames_before);
- free(ctx->commit_graph_filenames_after);
- free(ctx->commit_graph_filenames_before);
- free(ctx->commit_graph_hash_after);
+ for (i = 0; i < ctx->num_commit_graphs_after; i++) {
+ free(ctx->commit_graph_filenames_after[i]);
+ free(ctx->commit_graph_hash_after[i]);
}
+ free(ctx->commit_graph_filenames_after);
+ free(ctx->commit_graph_hash_after);
free(ctx);
@@ -2464,30 +2650,20 @@ static void graph_report(const char *fmt, ...)
va_end(ap);
}
-#define GENERATION_ZERO_EXISTS 1
-#define GENERATION_NUMBER_EXISTS 2
-
static int commit_graph_checksum_valid(struct commit_graph *g)
{
return hashfile_checksum_valid(g->data, g->data_len);
}
-int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
+static int verify_one_commit_graph(struct repository *r,
+ struct commit_graph *g,
+ struct progress *progress,
+ uint64_t *seen)
{
uint32_t i, cur_fanout_pos = 0;
struct object_id prev_oid, cur_oid;
- int generation_zero = 0;
- struct progress *progress = NULL;
- int local_error = 0;
-
- if (!g) {
- graph_report("no commit-graph file loaded");
- return 1;
- }
-
- verify_commit_graph_error = verify_commit_graph_lite(g);
- if (verify_commit_graph_error)
- return verify_commit_graph_error;
+ struct commit *seen_gen_zero = NULL;
+ struct commit *seen_gen_non_zero = NULL;
if (!commit_graph_checksum_valid(g)) {
graph_report(_("the commit-graph file has incorrect checksum and is likely corrupt"));
@@ -2497,7 +2673,7 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
for (i = 0; i < g->num_commits; i++) {
struct commit *graph_commit;
- oidread(&cur_oid, g->chunk_oid_lookup + g->hash_len * i);
+ oidread(&cur_oid, g->chunk_oid_lookup + st_mult(g->hash_len, i));
if (i && oidcmp(&prev_oid, &cur_oid) >= 0)
graph_report(_("commit-graph has incorrect OID order: %s then %s"),
@@ -2534,22 +2710,18 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
if (verify_commit_graph_error & ~VERIFY_COMMIT_GRAPH_ERROR_HASH)
return verify_commit_graph_error;
- if (flags & COMMIT_GRAPH_WRITE_PROGRESS)
- progress = start_progress(_("Verifying commits in commit graph"),
- g->num_commits);
-
for (i = 0; i < g->num_commits; i++) {
struct commit *graph_commit, *odb_commit;
struct commit_list *graph_parents, *odb_parents;
timestamp_t max_generation = 0;
timestamp_t generation;
- display_progress(progress, i + 1);
- oidread(&cur_oid, g->chunk_oid_lookup + g->hash_len * i);
+ display_progress(progress, ++(*seen));
+ oidread(&cur_oid, g->chunk_oid_lookup + st_mult(g->hash_len, i));
graph_commit = lookup_commit(r, &cur_oid);
odb_commit = (struct commit *)create_object(r, &cur_oid, alloc_commit_node(r));
- if (parse_commit_internal(odb_commit, 0, 0)) {
+ if (repo_parse_commit_internal(r, odb_commit, 0, 0)) {
graph_report(_("failed to parse commit %s from object database for commit-graph"),
oid_to_hex(&cur_oid));
continue;
@@ -2581,7 +2753,7 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
oid_to_hex(&graph_parents->item->object.oid),
oid_to_hex(&odb_parents->item->object.oid));
- generation = commit_graph_generation(graph_parents->item);
+ generation = commit_graph_generation_from_graph(graph_parents->item);
if (generation > max_generation)
max_generation = generation;
@@ -2593,16 +2765,12 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
graph_report(_("commit-graph parent list for commit %s terminates early"),
oid_to_hex(&cur_oid));
- if (!commit_graph_generation(graph_commit)) {
- if (generation_zero == GENERATION_NUMBER_EXISTS)
- graph_report(_("commit-graph has generation number zero for commit %s, but non-zero elsewhere"),
- oid_to_hex(&cur_oid));
- generation_zero = GENERATION_ZERO_EXISTS;
- } else if (generation_zero == GENERATION_ZERO_EXISTS)
- graph_report(_("commit-graph has non-zero generation number for commit %s, but zero elsewhere"),
- oid_to_hex(&cur_oid));
+ if (commit_graph_generation_from_graph(graph_commit))
+ seen_gen_non_zero = graph_commit;
+ else
+ seen_gen_zero = graph_commit;
- if (generation_zero == GENERATION_ZERO_EXISTS)
+ if (seen_gen_zero)
continue;
/*
@@ -2627,27 +2795,60 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
graph_commit->date,
odb_commit->date);
}
- stop_progress(&progress);
- local_error = verify_commit_graph_error;
+ if (seen_gen_zero && seen_gen_non_zero)
+ graph_report(_("commit-graph has both zero and non-zero "
+ "generations (e.g., commits '%s' and '%s')"),
+ oid_to_hex(&seen_gen_zero->object.oid),
+ oid_to_hex(&seen_gen_non_zero->object.oid));
- if (!(flags & COMMIT_GRAPH_VERIFY_SHALLOW) && g->base_graph)
- local_error |= verify_commit_graph(r, g->base_graph, flags);
+ return verify_commit_graph_error;
+}
+
+int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
+{
+ struct progress *progress = NULL;
+ int local_error = 0;
+ uint64_t seen = 0;
+
+ if (!g) {
+ graph_report("no commit-graph file loaded");
+ return 1;
+ }
+
+ if (flags & COMMIT_GRAPH_WRITE_PROGRESS) {
+ uint64_t total = g->num_commits;
+ if (!(flags & COMMIT_GRAPH_VERIFY_SHALLOW))
+ total += g->num_commits_in_base;
+
+ progress = start_progress(_("Verifying commits in commit graph"),
+ total);
+ }
+
+ for (; g; g = g->base_graph) {
+ local_error |= verify_one_commit_graph(r, g, progress, &seen);
+ if (flags & COMMIT_GRAPH_VERIFY_SHALLOW)
+ break;
+ }
+
+ stop_progress(&progress);
return local_error;
}
void free_commit_graph(struct commit_graph *g)
{
- if (!g)
- return;
- if (g->data) {
- munmap((void *)g->data, g->data_len);
- g->data = NULL;
+ while (g) {
+ struct commit_graph *next = g->base_graph;
+
+ if (g->data)
+ munmap((void *)g->data, g->data_len);
+ free(g->filename);
+ free(g->bloom_filter_settings);
+ free(g);
+
+ g = next;
}
- free(g->filename);
- free(g->bloom_filter_settings);
- free(g);
}
void disable_commit_graph(struct repository *r)
diff --git a/commit-graph.h b/commit-graph.h
index f23b9e9..e519cb8 100644
--- a/commit-graph.h
+++ b/commit-graph.h
@@ -1,8 +1,7 @@
#ifndef COMMIT_GRAPH_H
#define COMMIT_GRAPH_H
-#include "git-compat-util.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "oidset.h"
#define GIT_TEST_COMMIT_GRAPH "GIT_TEST_COMMIT_GRAPH"
@@ -10,6 +9,12 @@
#define GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS "GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS"
/*
+ * This environment variable controls whether commits looked up via the
+ * commit graph will be double checked to exist in the object database.
+ */
+#define GIT_COMMIT_GRAPH_PARANOIA "GIT_COMMIT_GRAPH_PARANOIA"
+
+/*
* This method is only used to enhance coverage of the commit-graph
* feature in the test suite with the GIT_TEST_COMMIT_GRAPH and
* GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS environment variables. Do not
@@ -27,6 +32,7 @@ struct string_list;
char *get_commit_graph_filename(struct object_directory *odb);
char *get_commit_graph_chain_filename(struct object_directory *odb);
int open_commit_graph(const char *graph_file, int *fd, struct stat *st);
+int open_commit_graph_chain(const char *chain_file, int *fd, struct stat *st);
/*
* Given a commit struct, try to fill the commit struct info, including:
@@ -94,10 +100,14 @@ struct commit_graph {
const unsigned char *chunk_commit_data;
const unsigned char *chunk_generation_data;
const unsigned char *chunk_generation_data_overflow;
+ size_t chunk_generation_data_overflow_size;
const unsigned char *chunk_extra_edges;
+ size_t chunk_extra_edges_size;
const unsigned char *chunk_base_graphs;
+ size_t chunk_base_graphs_size;
const unsigned char *chunk_bloom_indexes;
const unsigned char *chunk_bloom_data;
+ size_t chunk_bloom_data_size;
struct topo_level_slab *topo_levels;
struct bloom_filter_settings *bloom_filter_settings;
@@ -106,9 +116,17 @@ struct commit_graph {
struct commit_graph *load_commit_graph_one_fd_st(struct repository *r,
int fd, struct stat *st,
struct object_directory *odb);
+struct commit_graph *load_commit_graph_chain_fd_st(struct repository *r,
+ int fd, struct stat *st,
+ int *incomplete_chain);
struct commit_graph *read_commit_graph_one(struct repository *r,
struct object_directory *odb);
-struct commit_graph *parse_commit_graph(struct repository *r,
+
+/*
+ * Callers should initialize the repo_settings with prepare_repo_settings()
+ * prior to calling parse_commit_graph().
+ */
+struct commit_graph *parse_commit_graph(struct repo_settings *s,
void *graph_map, size_t graph_size);
/*
@@ -185,4 +203,12 @@ struct commit_graph_data {
*/
timestamp_t commit_graph_generation(const struct commit *);
uint32_t commit_graph_position(const struct commit *);
+
+/*
+ * After this method, all commits reachable from those in the given
+ * list will have non-zero, non-infinite generation numbers.
+ */
+void ensure_generations_valid(struct repository *r,
+ struct commit **commits, size_t nr);
+
#endif
diff --git a/commit-reach.c b/commit-reach.c
index c226ee3..8f9b008 100644
--- a/commit-reach.c
+++ b/commit-reach.c
@@ -1,13 +1,14 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "commit.h"
#include "commit-graph.h"
#include "decorate.h"
+#include "hex.h"
#include "prio-queue.h"
-#include "tree.h"
#include "ref-filter.h"
#include "revision.h"
#include "tag.h"
#include "commit-reach.h"
+#include "ewah/ewok.h"
/* Remember to update object flag allocation in object.h */
#define PARENT1 (1u<<16)
@@ -48,13 +49,14 @@ static int queue_has_nonstale(struct prio_queue *queue)
}
/* all input commits in one and twos[] must have been parsed! */
-static struct commit_list *paint_down_to_common(struct repository *r,
- struct commit *one, int n,
- struct commit **twos,
- timestamp_t min_generation)
+static int paint_down_to_common(struct repository *r,
+ struct commit *one, int n,
+ struct commit **twos,
+ timestamp_t min_generation,
+ int ignore_missing_commits,
+ struct commit_list **result)
{
struct prio_queue queue = { compare_commits_by_gen_then_commit_date };
- struct commit_list *result = NULL;
int i;
timestamp_t last_gen = GENERATION_NUMBER_INFINITY;
@@ -63,8 +65,8 @@ static struct commit_list *paint_down_to_common(struct repository *r,
one->object.flags |= PARENT1;
if (!n) {
- commit_list_append(one, &result);
- return result;
+ commit_list_append(one, result);
+ return 0;
}
prio_queue_put(&queue, one);
@@ -92,7 +94,7 @@ static struct commit_list *paint_down_to_common(struct repository *r,
if (flags == (PARENT1 | PARENT2)) {
if (!(commit->object.flags & RESULT)) {
commit->object.flags |= RESULT;
- commit_list_insert_by_date(commit, &result);
+ commit_list_insert_by_date(commit, result);
}
/* Mark parents of a found merge stale */
flags |= STALE;
@@ -103,66 +105,97 @@ static struct commit_list *paint_down_to_common(struct repository *r,
parents = parents->next;
if ((p->object.flags & flags) == flags)
continue;
- if (repo_parse_commit(r, p))
- return NULL;
+ if (repo_parse_commit(r, p)) {
+ clear_prio_queue(&queue);
+ free_commit_list(*result);
+ *result = NULL;
+ /*
+ * At this stage, we know that the commit is
+ * missing: `repo_parse_commit()` uses
+ * `OBJECT_INFO_DIE_IF_CORRUPT` and therefore
+ * corrupt commits would already have been
+ * dispatched with a `die()`.
+ */
+ if (ignore_missing_commits)
+ return 0;
+ return error(_("could not parse commit %s"),
+ oid_to_hex(&p->object.oid));
+ }
p->object.flags |= flags;
prio_queue_put(&queue, p);
}
}
clear_prio_queue(&queue);
- return result;
+ return 0;
}
-static struct commit_list *merge_bases_many(struct repository *r,
- struct commit *one, int n,
- struct commit **twos)
+static int merge_bases_many(struct repository *r,
+ struct commit *one, int n,
+ struct commit **twos,
+ struct commit_list **result)
{
struct commit_list *list = NULL;
- struct commit_list *result = NULL;
int i;
for (i = 0; i < n; i++) {
- if (one == twos[i])
+ if (one == twos[i]) {
/*
* We do not mark this even with RESULT so we do not
* have to clean it up.
*/
- return commit_list_insert(one, &result);
+ *result = commit_list_insert(one, result);
+ return 0;
+ }
}
+ if (!one)
+ return 0;
if (repo_parse_commit(r, one))
- return NULL;
+ return error(_("could not parse commit %s"),
+ oid_to_hex(&one->object.oid));
for (i = 0; i < n; i++) {
+ if (!twos[i])
+ return 0;
if (repo_parse_commit(r, twos[i]))
- return NULL;
+ return error(_("could not parse commit %s"),
+ oid_to_hex(&twos[i]->object.oid));
}
- list = paint_down_to_common(r, one, n, twos, 0);
+ if (paint_down_to_common(r, one, n, twos, 0, 0, &list)) {
+ free_commit_list(list);
+ return -1;
+ }
while (list) {
struct commit *commit = pop_commit(&list);
if (!(commit->object.flags & STALE))
- commit_list_insert_by_date(commit, &result);
+ commit_list_insert_by_date(commit, result);
}
- return result;
+ return 0;
}
-struct commit_list *get_octopus_merge_bases(struct commit_list *in)
+int get_octopus_merge_bases(struct commit_list *in, struct commit_list **result)
{
- struct commit_list *i, *j, *k, *ret = NULL;
+ struct commit_list *i, *j, *k;
if (!in)
- return ret;
+ return 0;
- commit_list_insert(in->item, &ret);
+ commit_list_insert(in->item, result);
for (i = in->next; i; i = i->next) {
struct commit_list *new_commits = NULL, *end = NULL;
- for (j = ret; j; j = j->next) {
- struct commit_list *bases;
- bases = get_merge_bases(i->item, j->item);
+ for (j = *result; j; j = j->next) {
+ struct commit_list *bases = NULL;
+ if (repo_get_merge_bases(the_repository, i->item,
+ j->item, &bases) < 0) {
+ free_commit_list(bases);
+ free_commit_list(*result);
+ *result = NULL;
+ return -1;
+ }
if (!new_commits)
new_commits = bases;
else
@@ -170,9 +203,10 @@ struct commit_list *get_octopus_merge_bases(struct commit_list *in)
for (k = bases; k; k = k->next)
end = k;
}
- ret = new_commits;
+ free_commit_list(*result);
+ *result = new_commits;
}
- return ret;
+ return 0;
}
static int remove_redundant_no_gen(struct repository *r,
@@ -190,7 +224,7 @@ static int remove_redundant_no_gen(struct repository *r,
for (i = 0; i < cnt; i++)
repo_parse_commit(r, array[i]);
for (i = 0; i < cnt; i++) {
- struct commit_list *common;
+ struct commit_list *common = NULL;
timestamp_t min_generation = commit_graph_generation(array[i]);
if (redundant[i])
@@ -206,8 +240,16 @@ static int remove_redundant_no_gen(struct repository *r,
if (curr_generation < min_generation)
min_generation = curr_generation;
}
- common = paint_down_to_common(r, array[i], filled,
- work, min_generation);
+ if (paint_down_to_common(r, array[i], filled,
+ work, min_generation, 0, &common)) {
+ clear_commit_marks(array[i], all_flags);
+ clear_commit_marks_many(filled, work, all_flags);
+ free_commit_list(common);
+ free(work);
+ free(redundant);
+ free(filled_index);
+ return -1;
+ }
if (array[i]->object.flags & PARENT2)
redundant[i] = 1;
for (j = 0; j < filled; j++)
@@ -245,8 +287,7 @@ static int remove_redundant_with_gen(struct repository *r,
* min_gen_pos points to the current position within 'array'
* that is not yet known to be STALE.
*/
- ALLOC_ARRAY(sorted, cnt);
- COPY_ARRAY(sorted, array, cnt);
+ DUP_ARRAY(sorted, array, cnt);
QSORT(sorted, cnt, compare_commits_by_gen);
min_generation = commit_graph_generation(sorted[0]);
@@ -373,69 +414,77 @@ static int remove_redundant(struct repository *r, struct commit **array, int cnt
return remove_redundant_no_gen(r, array, cnt);
}
-static struct commit_list *get_merge_bases_many_0(struct repository *r,
- struct commit *one,
- int n,
- struct commit **twos,
- int cleanup)
+static int get_merge_bases_many_0(struct repository *r,
+ struct commit *one,
+ int n,
+ struct commit **twos,
+ int cleanup,
+ struct commit_list **result)
{
struct commit_list *list;
struct commit **rslt;
- struct commit_list *result;
int cnt, i;
- result = merge_bases_many(r, one, n, twos);
+ if (merge_bases_many(r, one, n, twos, result) < 0)
+ return -1;
for (i = 0; i < n; i++) {
if (one == twos[i])
- return result;
+ return 0;
}
- if (!result || !result->next) {
+ if (!*result || !(*result)->next) {
if (cleanup) {
clear_commit_marks(one, all_flags);
clear_commit_marks_many(n, twos, all_flags);
}
- return result;
+ return 0;
}
/* There are more than one */
- cnt = commit_list_count(result);
+ cnt = commit_list_count(*result);
CALLOC_ARRAY(rslt, cnt);
- for (list = result, i = 0; list; list = list->next)
+ for (list = *result, i = 0; list; list = list->next)
rslt[i++] = list->item;
- free_commit_list(result);
+ free_commit_list(*result);
+ *result = NULL;
clear_commit_marks(one, all_flags);
clear_commit_marks_many(n, twos, all_flags);
cnt = remove_redundant(r, rslt, cnt);
- result = NULL;
+ if (cnt < 0) {
+ free(rslt);
+ return -1;
+ }
for (i = 0; i < cnt; i++)
- commit_list_insert_by_date(rslt[i], &result);
+ commit_list_insert_by_date(rslt[i], result);
free(rslt);
- return result;
+ return 0;
}
-struct commit_list *repo_get_merge_bases_many(struct repository *r,
- struct commit *one,
- int n,
- struct commit **twos)
+int repo_get_merge_bases_many(struct repository *r,
+ struct commit *one,
+ int n,
+ struct commit **twos,
+ struct commit_list **result)
{
- return get_merge_bases_many_0(r, one, n, twos, 1);
+ return get_merge_bases_many_0(r, one, n, twos, 1, result);
}
-struct commit_list *repo_get_merge_bases_many_dirty(struct repository *r,
- struct commit *one,
- int n,
- struct commit **twos)
+int repo_get_merge_bases_many_dirty(struct repository *r,
+ struct commit *one,
+ int n,
+ struct commit **twos,
+ struct commit_list **result)
{
- return get_merge_bases_many_0(r, one, n, twos, 0);
+ return get_merge_bases_many_0(r, one, n, twos, 0, result);
}
-struct commit_list *repo_get_merge_bases(struct repository *r,
- struct commit *one,
- struct commit *two)
+int repo_get_merge_bases(struct repository *r,
+ struct commit *one,
+ struct commit *two,
+ struct commit_list **result)
{
- return get_merge_bases_many_0(r, one, 1, &two, 1);
+ return get_merge_bases_many_0(r, one, 1, &two, 1, result);
}
/*
@@ -448,7 +497,7 @@ int repo_is_descendant_of(struct repository *r,
if (!with_commit)
return 1;
- if (generation_numbers_enabled(the_repository)) {
+ if (generation_numbers_enabled(r)) {
struct commit_list *from_list = NULL;
int result;
commit_list_insert(commit, &from_list);
@@ -458,11 +507,13 @@ int repo_is_descendant_of(struct repository *r,
} else {
while (with_commit) {
struct commit *other;
+ int ret;
other = with_commit->item;
with_commit = with_commit->next;
- if (repo_in_merge_bases_many(r, other, 1, &commit))
- return 1;
+ ret = repo_in_merge_bases_many(r, other, 1, &commit, 0);
+ if (ret)
+ return ret;
}
return 0;
}
@@ -472,17 +523,18 @@ int repo_is_descendant_of(struct repository *r,
* Is "commit" an ancestor of one of the "references"?
*/
int repo_in_merge_bases_many(struct repository *r, struct commit *commit,
- int nr_reference, struct commit **reference)
+ int nr_reference, struct commit **reference,
+ int ignore_missing_commits)
{
- struct commit_list *bases;
+ struct commit_list *bases = NULL;
int ret = 0, i;
timestamp_t generation, max_generation = GENERATION_NUMBER_ZERO;
if (repo_parse_commit(r, commit))
- return ret;
+ return ignore_missing_commits ? 0 : -1;
for (i = 0; i < nr_reference; i++) {
if (repo_parse_commit(r, reference[i]))
- return ret;
+ return ignore_missing_commits ? 0 : -1;
generation = commit_graph_generation(reference[i]);
if (generation > max_generation)
@@ -493,10 +545,11 @@ int repo_in_merge_bases_many(struct repository *r, struct commit *commit,
if (generation > max_generation)
return ret;
- bases = paint_down_to_common(r, commit,
- nr_reference, reference,
- generation);
- if (commit->object.flags & PARENT2)
+ if (paint_down_to_common(r, commit,
+ nr_reference, reference,
+ generation, ignore_missing_commits, &bases))
+ ret = -1;
+ else if (commit->object.flags & PARENT2)
ret = 1;
clear_commit_marks(commit, all_flags);
clear_commit_marks_many(nr_reference, reference, all_flags);
@@ -549,6 +602,10 @@ struct commit_list *reduce_heads(struct commit_list *heads)
}
}
num_head = remove_redundant(the_repository, array, num_head);
+ if (num_head < 0) {
+ free(array);
+ return NULL;
+ }
for (i = 0; i < num_head; i++)
tail = &commit_list_insert(array[i], tail)->next;
free(array);
@@ -585,12 +642,14 @@ int ref_newer(const struct object_id *new_oid, const struct object_id *old_oid)
return 0;
new_commit = (struct commit *) o;
- if (parse_commit(new_commit) < 0)
+ if (repo_parse_commit(the_repository, new_commit) < 0)
return 0;
commit_list_insert(old_commit, &old_commit_list);
ret = repo_is_descendant_of(the_repository,
new_commit, old_commit_list);
+ if (ret < 0)
+ exit(128);
free_commit_list(old_commit_list);
return ret;
}
@@ -749,7 +808,7 @@ int can_all_from_reach_with_flag(struct object_array *from,
}
list[nr_commits] = (struct commit *)from_one;
- if (parse_commit(list[nr_commits]) ||
+ if (repo_parse_commit(the_repository, list[nr_commits]) ||
commit_graph_generation(list[nr_commits]) < min_generation) {
result = 0;
goto cleanup;
@@ -784,7 +843,7 @@ int can_all_from_reach_with_flag(struct object_array *from,
if (!(parent->item->object.flags & assign_flag)) {
parent->item->object.flags |= assign_flag;
- if (parse_commit(parent->item) ||
+ if (repo_parse_commit(the_repository, parent->item) ||
parent->item->date < min_commit_date ||
commit_graph_generation(parent->item) < min_generation)
continue;
@@ -808,8 +867,12 @@ cleanup:
clear_commit_marks_many(nr_commits, list, RESULT | assign_flag);
free(list);
- for (i = 0; i < from->nr; i++)
- from->objects[i].item->flags &= ~assign_flag;
+ for (i = 0; i < from->nr; i++) {
+ struct object *from_one = from->objects[i].item;
+
+ if (from_one)
+ from_one->flags &= ~assign_flag;
+ }
return result;
}
@@ -826,7 +889,7 @@ int can_all_from_reach(struct commit_list *from, struct commit_list *to,
while (from_iter) {
add_object_array(&from_iter->item->object, NULL, &from_objs);
- if (!parse_commit(from_iter->item)) {
+ if (!repo_parse_commit(the_repository, from_iter->item)) {
timestamp_t generation;
if (from_iter->item->date < min_commit_date)
min_commit_date = from_iter->item->date;
@@ -840,7 +903,7 @@ int can_all_from_reach(struct commit_list *from, struct commit_list *to,
}
while (to_iter) {
- if (!parse_commit(to_iter->item)) {
+ if (!repo_parse_commit(the_repository, to_iter->item)) {
timestamp_t generation;
if (to_iter->item->date < min_commit_date)
min_commit_date = to_iter->item->date;
@@ -890,7 +953,7 @@ struct commit_list *get_reachable_subset(struct commit **from, int nr_from,
timestamp_t generation;
struct commit *c = *item;
- parse_commit(c);
+ repo_parse_commit(the_repository, c);
generation = commit_graph_generation(c);
if (generation < min_generation)
min_generation = generation;
@@ -905,7 +968,7 @@ struct commit_list *get_reachable_subset(struct commit **from, int nr_from,
struct commit *c = *item;
if (!(c->object.flags & PARENT2)) {
c->object.flags |= PARENT2;
- parse_commit(c);
+ repo_parse_commit(the_repository, c);
prio_queue_put(&queue, *item);
}
@@ -924,7 +987,7 @@ struct commit_list *get_reachable_subset(struct commit **from, int nr_from,
for (parents = current->parents; parents; parents = parents->next) {
struct commit *p = parents->item;
- parse_commit(p);
+ repo_parse_commit(the_repository, p);
if (commit_graph_generation(p) < min_generation)
continue;
@@ -937,8 +1000,225 @@ struct commit_list *get_reachable_subset(struct commit **from, int nr_from,
}
}
+ clear_prio_queue(&queue);
+
clear_commit_marks_many(nr_to, to, PARENT1);
clear_commit_marks_many(nr_from, from, PARENT2);
return found_commits;
}
+
+define_commit_slab(bit_arrays, struct bitmap *);
+static struct bit_arrays bit_arrays;
+
+static void insert_no_dup(struct prio_queue *queue, struct commit *c)
+{
+ if (c->object.flags & PARENT2)
+ return;
+ prio_queue_put(queue, c);
+ c->object.flags |= PARENT2;
+}
+
+static struct bitmap *get_bit_array(struct commit *c, int width)
+{
+ struct bitmap **bitmap = bit_arrays_at(&bit_arrays, c);
+ if (!*bitmap)
+ *bitmap = bitmap_word_alloc(width);
+ return *bitmap;
+}
+
+static void free_bit_array(struct commit *c)
+{
+ struct bitmap **bitmap = bit_arrays_at(&bit_arrays, c);
+ if (!*bitmap)
+ return;
+ bitmap_free(*bitmap);
+ *bitmap = NULL;
+}
+
+void ahead_behind(struct repository *r,
+ struct commit **commits, size_t commits_nr,
+ struct ahead_behind_count *counts, size_t counts_nr)
+{
+ struct prio_queue queue = { .compare = compare_commits_by_gen_then_commit_date };
+ size_t width = DIV_ROUND_UP(commits_nr, BITS_IN_EWORD);
+
+ if (!commits_nr || !counts_nr)
+ return;
+
+ for (size_t i = 0; i < counts_nr; i++) {
+ counts[i].ahead = 0;
+ counts[i].behind = 0;
+ }
+
+ ensure_generations_valid(r, commits, commits_nr);
+
+ init_bit_arrays(&bit_arrays);
+
+ for (size_t i = 0; i < commits_nr; i++) {
+ struct commit *c = commits[i];
+ struct bitmap *bitmap = get_bit_array(c, width);
+
+ bitmap_set(bitmap, i);
+ insert_no_dup(&queue, c);
+ }
+
+ while (queue_has_nonstale(&queue)) {
+ struct commit *c = prio_queue_get(&queue);
+ struct commit_list *p;
+ struct bitmap *bitmap_c = get_bit_array(c, width);
+
+ for (size_t i = 0; i < counts_nr; i++) {
+ int reach_from_tip = !!bitmap_get(bitmap_c, counts[i].tip_index);
+ int reach_from_base = !!bitmap_get(bitmap_c, counts[i].base_index);
+
+ if (reach_from_tip ^ reach_from_base) {
+ if (reach_from_base)
+ counts[i].behind++;
+ else
+ counts[i].ahead++;
+ }
+ }
+
+ for (p = c->parents; p; p = p->next) {
+ struct bitmap *bitmap_p;
+
+ repo_parse_commit(r, p->item);
+
+ bitmap_p = get_bit_array(p->item, width);
+ bitmap_or(bitmap_p, bitmap_c);
+
+ /*
+ * If this parent is reachable from every starting
+ * commit, then none of its ancestors can contribute
+ * to the ahead/behind count. Mark it as STALE, so
+ * we can stop the walk when every commit in the
+ * queue is STALE.
+ */
+ if (bitmap_popcount(bitmap_p) == commits_nr)
+ p->item->object.flags |= STALE;
+
+ insert_no_dup(&queue, p->item);
+ }
+
+ free_bit_array(c);
+ }
+
+ /* STALE is used here, PARENT2 is used by insert_no_dup(). */
+ repo_clear_commit_marks(r, PARENT2 | STALE);
+ clear_bit_arrays(&bit_arrays);
+ clear_prio_queue(&queue);
+}
+
+struct commit_and_index {
+ struct commit *commit;
+ unsigned int index;
+ timestamp_t generation;
+};
+
+static int compare_commit_and_index_by_generation(const void *va, const void *vb)
+{
+ const struct commit_and_index *a = (const struct commit_and_index *)va;
+ const struct commit_and_index *b = (const struct commit_and_index *)vb;
+
+ if (a->generation > b->generation)
+ return 1;
+ if (a->generation < b->generation)
+ return -1;
+ return 0;
+}
+
+void tips_reachable_from_bases(struct repository *r,
+ struct commit_list *bases,
+ struct commit **tips, size_t tips_nr,
+ int mark)
+{
+ struct commit_and_index *commits;
+ size_t min_generation_index = 0;
+ timestamp_t min_generation;
+ struct commit_list *stack = NULL;
+
+ if (!bases || !tips || !tips_nr)
+ return;
+
+ /*
+ * Do a depth-first search starting at 'bases' to search for the
+ * tips. Stop at the lowest (un-found) generation number. When
+ * finding the lowest commit, increase the minimum generation
+ * number to the next lowest (un-found) generation number.
+ */
+
+ CALLOC_ARRAY(commits, tips_nr);
+
+ for (size_t i = 0; i < tips_nr; i++) {
+ commits[i].commit = tips[i];
+ commits[i].index = i;
+ commits[i].generation = commit_graph_generation(tips[i]);
+ }
+
+ /* Sort with generation number ascending. */
+ QSORT(commits, tips_nr, compare_commit_and_index_by_generation);
+ min_generation = commits[0].generation;
+
+ while (bases) {
+ repo_parse_commit(r, bases->item);
+ commit_list_insert(bases->item, &stack);
+ bases = bases->next;
+ }
+
+ while (stack) {
+ int explored_all_parents = 1;
+ struct commit_list *p;
+ struct commit *c = stack->item;
+ timestamp_t c_gen = commit_graph_generation(c);
+
+ /* Does it match any of our tips? */
+ for (size_t j = min_generation_index; j < tips_nr; j++) {
+ if (c_gen < commits[j].generation)
+ break;
+
+ if (commits[j].commit == c) {
+ tips[commits[j].index]->object.flags |= mark;
+
+ if (j == min_generation_index) {
+ unsigned int k = j + 1;
+ while (k < tips_nr &&
+ (tips[commits[k].index]->object.flags & mark))
+ k++;
+
+ /* Terminate early if all found. */
+ if (k >= tips_nr)
+ goto done;
+
+ min_generation_index = k;
+ min_generation = commits[k].generation;
+ }
+ }
+ }
+
+ for (p = c->parents; p; p = p->next) {
+ repo_parse_commit(r, p->item);
+
+ /* Have we already explored this parent? */
+ if (p->item->object.flags & SEEN)
+ continue;
+
+ /* Is it below the current minimum generation? */
+ if (commit_graph_generation(p->item) < min_generation)
+ continue;
+
+ /* Ok, we will explore from here on. */
+ p->item->object.flags |= SEEN;
+ explored_all_parents = 0;
+ commit_list_insert(p->item, &stack);
+ break;
+ }
+
+ if (explored_all_parents)
+ pop_commit(&stack);
+ }
+
+done:
+ free(commits);
+ repo_clear_commit_marks(r, SEEN);
+}
diff --git a/commit-reach.h b/commit-reach.h
index 148b56f..bf63cc4 100644
--- a/commit-reach.h
+++ b/commit-reach.h
@@ -9,23 +9,21 @@ struct ref_filter;
struct object_id;
struct object_array;
-struct commit_list *repo_get_merge_bases(struct repository *r,
- struct commit *rev1,
- struct commit *rev2);
-struct commit_list *repo_get_merge_bases_many(struct repository *r,
- struct commit *one, int n,
- struct commit **twos);
+int repo_get_merge_bases(struct repository *r,
+ struct commit *rev1,
+ struct commit *rev2,
+ struct commit_list **result);
+int repo_get_merge_bases_many(struct repository *r,
+ struct commit *one, int n,
+ struct commit **twos,
+ struct commit_list **result);
/* To be used only when object flags after this call no longer matter */
-struct commit_list *repo_get_merge_bases_many_dirty(struct repository *r,
- struct commit *one, int n,
- struct commit **twos);
-#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
-#define get_merge_bases(r1, r2) repo_get_merge_bases(the_repository, r1, r2)
-#define get_merge_bases_many(one, n, two) repo_get_merge_bases_many(the_repository, one, n, two)
-#define get_merge_bases_many_dirty(one, n, twos) repo_get_merge_bases_many_dirty(the_repository, one, n, twos)
-#endif
+int repo_get_merge_bases_many_dirty(struct repository *r,
+ struct commit *one, int n,
+ struct commit **twos,
+ struct commit_list **result);
-struct commit_list *get_octopus_merge_bases(struct commit_list *in);
+int get_octopus_merge_bases(struct commit_list *in, struct commit_list **result);
int repo_is_descendant_of(struct repository *r,
struct commit *commit,
@@ -35,11 +33,8 @@ int repo_in_merge_bases(struct repository *r,
struct commit *reference);
int repo_in_merge_bases_many(struct repository *r,
struct commit *commit,
- int nr_reference, struct commit **reference);
-#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
-#define in_merge_bases(c1, c2) repo_in_merge_bases(the_repository, c1, c2)
-#define in_merge_bases_many(c1, n, cs) repo_in_merge_bases_many(the_repository, c1, n, cs)
-#endif
+ int nr_reference, struct commit **reference,
+ int ignore_missing_commits);
/*
* Takes a list of commits and returns a new list where those
@@ -104,4 +99,44 @@ struct commit_list *get_reachable_subset(struct commit **from, int nr_from,
struct commit **to, int nr_to,
unsigned int reachable_flag);
+struct ahead_behind_count {
+ /**
+ * As input, the *_index members indicate which positions in
+ * the 'tips' array correspond to the tip and base of this
+ * comparison.
+ */
+ size_t tip_index;
+ size_t base_index;
+
+ /**
+ * These values store the computed counts for each side of the
+ * symmetric difference:
+ *
+ * 'ahead' stores the number of commits reachable from the tip
+ * and not reachable from the base.
+ *
+ * 'behind' stores the number of commits reachable from the base
+ * and not reachable from the tip.
+ */
+ unsigned int ahead;
+ unsigned int behind;
+};
+
+/*
+ * Given an array of commits and an array of ahead_behind_count pairs,
+ * compute the ahead/behind counts for each pair.
+ */
+void ahead_behind(struct repository *r,
+ struct commit **commits, size_t commits_nr,
+ struct ahead_behind_count *counts, size_t counts_nr);
+
+/*
+ * For all tip commits, add 'mark' to their flags if and only if they
+ * are reachable from one of the commits in 'bases'.
+ */
+void tips_reachable_from_bases(struct repository *r,
+ struct commit_list *bases,
+ struct commit **tips, size_t tips_nr,
+ int mark);
+
#endif
diff --git a/commit-slab-impl.h b/commit-slab-impl.h
index 557738d..4a414ee 100644
--- a/commit-slab-impl.h
+++ b/commit-slab-impl.h
@@ -1,8 +1,6 @@
#ifndef COMMIT_SLAB_IMPL_H
#define COMMIT_SLAB_IMPL_H
-#include "git-compat-util.h"
-
#define implement_static_commit_slab(slabname, elemtype) \
implement_commit_slab(slabname, elemtype, MAYBE_UNUSED static)
diff --git a/commit.c b/commit.c
index 1fb1b2e..1a479a9 100644
--- a/commit.c
+++ b/commit.c
@@ -1,10 +1,13 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "tag.h"
#include "commit.h"
#include "commit-graph.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "repository.h"
-#include "object-store.h"
-#include "pkt-line.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "utf8.h"
#include "diff.h"
#include "revision.h"
@@ -19,9 +22,12 @@
#include "advice.h"
#include "refs.h"
#include "commit-reach.h"
-#include "run-command.h"
+#include "setup.h"
#include "shallow.h"
+#include "tree.h"
#include "hook.h"
+#include "parse.h"
+#include "object-file-convert.h"
static struct commit_extra_header *read_commit_extra_header_lines(const char *buf, size_t len, const char **);
@@ -59,6 +65,14 @@ struct commit *lookup_commit_or_die(const struct object_id *oid, const char *ref
return c;
}
+struct commit *lookup_commit_object(struct repository *r,
+ const struct object_id *oid)
+{
+ struct object *obj = parse_object(r, oid);
+ return obj ? object_as_type(obj, OBJ_COMMIT, 0) : NULL;
+
+}
+
struct commit *lookup_commit(struct repository *r, const struct object_id *oid)
{
struct object *obj = lookup_object(r, oid);
@@ -72,10 +86,10 @@ struct commit *lookup_commit_reference_by_name(const char *name)
struct object_id oid;
struct commit *commit;
- if (get_oid_committish(name, &oid))
+ if (repo_get_oid_committish(the_repository, name, &oid))
return NULL;
commit = lookup_commit_reference(the_repository, &oid);
- if (parse_commit(commit))
+ if (repo_parse_commit(the_repository, commit))
return NULL;
return commit;
}
@@ -83,6 +97,7 @@ struct commit *lookup_commit_reference_by_name(const char *name)
static timestamp_t parse_commit_date(const char *buf, const char *tail)
{
const char *dateptr;
+ const char *eol;
if (buf + 6 >= tail)
return 0;
@@ -94,16 +109,56 @@ static timestamp_t parse_commit_date(const char *buf, const char *tail)
return 0;
if (memcmp(buf, "committer", 9))
return 0;
- while (buf < tail && *buf++ != '>')
- /* nada */;
- if (buf >= tail)
+
+ /*
+ * Jump to end-of-line so that we can walk backwards to find the
+ * end-of-email ">". This is more forgiving of malformed cases
+ * because unexpected characters tend to be in the name and email
+ * fields.
+ */
+ eol = memchr(buf, '\n', tail - buf);
+ if (!eol)
return 0;
- dateptr = buf;
- while (buf < tail && *buf++ != '\n')
- /* nada */;
- if (buf >= tail)
+ dateptr = eol;
+ while (dateptr > buf && dateptr[-1] != '>')
+ dateptr--;
+ if (dateptr == buf)
+ return 0;
+
+ /*
+ * Trim leading whitespace, but make sure we have at least one
+ * non-whitespace character, as parse_timestamp() will otherwise walk
+ * right past the newline we found in "eol" when skipping whitespace
+ * itself.
+ *
+ * In theory it would be sufficient to allow any character not matched
+ * by isspace(), but there's a catch: our isspace() does not
+ * necessarily match the behavior of parse_timestamp(), as the latter
+ * is implemented by system routines which match more exotic control
+ * codes, or even locale-dependent sequences.
+ *
+ * Since we expect the timestamp to be a number, we can check for that.
+ * Anything else (e.g., a non-numeric token like "foo") would just
+ * cause parse_timestamp() to return 0 anyway.
+ */
+ while (dateptr < eol && isspace(*dateptr))
+ dateptr++;
+ if (!isdigit(*dateptr) && *dateptr != '-')
return 0;
- /* dateptr < buf && buf[-1] == '\n', so parsing will stop at buf-1 */
+
+ /*
+ * We know there is at least one digit (or dash), so we'll begin
+ * parsing there and stop at worst case at eol.
+ *
+ * Note that we may feed parse_timestamp() extra characters here if the
+ * commit is malformed, and it will parse as far as it can. For
+ * example, "123foo456" would return "123". That might be questionable
+ * (versus returning "0"), but it would help in a hypothetical case
+ * like "123456+0100", where the whitespace from the timezone is
+ * missing. Since such syntactic errors may be baked into history and
+ * hard to correct now, let's err on trying to make our best guess
+ * here, rather than insist on perfect syntax.
+ */
return parse_timestamp(dateptr, NULL, 10);
}
@@ -374,7 +429,7 @@ struct tree *repo_get_commit_tree(struct repository *r,
struct object_id *get_commit_tree_oid(const struct commit *commit)
{
- struct tree *tree = get_commit_tree(commit);
+ struct tree *tree = repo_get_commit_tree(the_repository, commit);
return tree ? &tree->object.oid : NULL;
}
@@ -461,7 +516,7 @@ int parse_commit_buffer(struct repository *r, struct commit *item, const void *b
* The clone is shallow if nr_parent < 0, and we must
* not traverse its real parents even when we unhide them.
*/
- if (graft && (graft->nr_parent < 0 || grafts_replace_parents))
+ if (graft && (graft->nr_parent < 0 || !grafts_keep_true_parents))
continue;
new_parent = lookup_commit(r, &parent);
if (!new_parent)
@@ -500,16 +555,40 @@ int repo_parse_commit_internal(struct repository *r,
enum object_type type;
void *buffer;
unsigned long size;
+ struct object_info oi = {
+ .typep = &type,
+ .sizep = &size,
+ .contentp = &buffer,
+ };
+ /*
+ * Git does not support partial clones that exclude commits, so set
+ * OBJECT_INFO_SKIP_FETCH_OBJECT to fail fast when an object is missing.
+ */
+ int flags = OBJECT_INFO_LOOKUP_REPLACE | OBJECT_INFO_SKIP_FETCH_OBJECT |
+ OBJECT_INFO_DIE_IF_CORRUPT;
int ret;
if (!item)
return -1;
if (item->object.parsed)
return 0;
- if (use_commit_graph && parse_commit_in_graph(r, item))
+ if (use_commit_graph && parse_commit_in_graph(r, item)) {
+ static int commit_graph_paranoia = -1;
+
+ if (commit_graph_paranoia == -1)
+ commit_graph_paranoia = git_env_bool(GIT_COMMIT_GRAPH_PARANOIA, 0);
+
+ if (commit_graph_paranoia && !has_object(r, &item->object.oid, 0)) {
+ unparse_commit(r, &item->object.oid);
+ return quiet_on_missing ? -1 :
+ error(_("commit %s exists in commit-graph but not in the object database"),
+ oid_to_hex(&item->object.oid));
+ }
+
return 0;
- buffer = repo_read_object_file(r, &item->object.oid, &type, &size);
- if (!buffer)
+ }
+
+ if (oid_object_info_extended(r, &item->object.oid, &oi, flags) < 0)
return quiet_on_missing ? -1 :
error("Could not read %s",
oid_to_hex(&item->object.oid));
@@ -536,7 +615,7 @@ int repo_parse_commit_gently(struct repository *r,
void parse_commit_or_die(struct commit *item)
{
- if (parse_commit(item))
+ if (repo_parse_commit(the_repository, item))
die("unable to parse commit %s",
item ? oid_to_hex(&item->object.oid) : "(null)");
}
@@ -642,10 +721,11 @@ struct commit_list * commit_list_insert_by_date(struct commit *item, struct comm
return commit_list_insert(item, pp);
}
-static int commit_list_compare_by_date(const void *a, const void *b)
+static int commit_list_compare_by_date(const struct commit_list *a,
+ const struct commit_list *b)
{
- timestamp_t a_date = ((const struct commit_list *)a)->item->date;
- timestamp_t b_date = ((const struct commit_list *)b)->item->date;
+ timestamp_t a_date = a->item->date;
+ timestamp_t b_date = b->item->date;
if (a_date < b_date)
return 1;
if (a_date > b_date)
@@ -653,20 +733,11 @@ static int commit_list_compare_by_date(const void *a, const void *b)
return 0;
}
-static void *commit_list_get_next(const void *a)
-{
- return ((const struct commit_list *)a)->next;
-}
-
-static void commit_list_set_next(void *a, void *next)
-{
- ((struct commit_list *)a)->next = next;
-}
+DEFINE_LIST_SORT(static, commit_list_sort, struct commit_list, next);
void commit_list_sort_by_date(struct commit_list **list)
{
- *list = llist_mergesort(*list, commit_list_get_next, commit_list_set_next,
- commit_list_compare_by_date);
+ commit_list_sort(list, commit_list_compare_by_date);
}
struct commit *pop_most_recent_commit(struct commit_list **list,
@@ -677,7 +748,7 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
while (parents) {
struct commit *commit = parents->item;
- if (!parse_commit(commit) && !(commit->object.flags & mark)) {
+ if (!repo_parse_commit(the_repository, commit) && !(commit->object.flags & mark)) {
commit->object.flags |= mark;
commit_list_insert_by_date(commit, list);
}
@@ -701,8 +772,10 @@ static void clear_commit_marks_1(struct commit_list **plist,
if (!parents)
return;
- while ((parents = parents->next))
- commit_list_insert(parents->item, plist);
+ while ((parents = parents->next)) {
+ if (parents->item->object.flags & mark)
+ commit_list_insert(parents->item, plist);
+ }
commit = commit->parents->item;
}
@@ -749,7 +822,8 @@ define_commit_slab(author_date_slab, timestamp_t);
void record_author_date(struct author_date_slab *author_date,
struct commit *commit)
{
- const char *buffer = get_commit_buffer(commit, NULL);
+ const char *buffer = repo_get_commit_buffer(the_repository, commit,
+ NULL);
struct ident_split ident;
const char *ident_line;
size_t ident_len;
@@ -769,7 +843,7 @@ void record_author_date(struct author_date_slab *author_date,
*(author_date_slab_at(author_date, commit)) = date;
fail_exit:
- unuse_commit_buffer(commit, buffer);
+ repo_unuse_commit_buffer(the_repository, commit, buffer);
}
int compare_commits_by_author_date(const void *a_, const void *b_,
@@ -788,7 +862,8 @@ int compare_commits_by_author_date(const void *a_, const void *b_,
return 0;
}
-int compare_commits_by_gen_then_commit_date(const void *a_, const void *b_, void *unused)
+int compare_commits_by_gen_then_commit_date(const void *a_, const void *b_,
+ void *unused UNUSED)
{
const struct commit *a = a_, *b = b_;
const timestamp_t generation_a = commit_graph_generation(a),
@@ -808,7 +883,8 @@ int compare_commits_by_gen_then_commit_date(const void *a_, const void *b_, void
return 0;
}
-int compare_commits_by_commit_date(const void *a_, const void *b_, void *unused)
+int compare_commits_by_commit_date(const void *a_, const void *b_,
+ void *unused UNUSED)
{
const struct commit *a = a_, *b = b_;
/* newer commits with larger date first */
@@ -950,7 +1026,7 @@ static void add_one_commit(struct object_id *oid, struct rev_collect *revs)
commit = lookup_commit(the_repository, oid);
if (!commit ||
(commit->object.flags & TMP_MARK) ||
- parse_commit(commit))
+ repo_parse_commit(the_repository, commit))
return;
ALLOC_GROW(revs->commit, revs->nr + 1, revs->alloc);
@@ -959,8 +1035,9 @@ static void add_one_commit(struct object_id *oid, struct rev_collect *revs)
}
static int collect_one_reflog_ent(struct object_id *ooid, struct object_id *noid,
- const char *ident, timestamp_t timestamp,
- int tz, const char *message, void *cbdata)
+ const char *ident UNUSED,
+ timestamp_t timestamp UNUSED, int tz UNUSED,
+ const char *message UNUSED, void *cbdata)
{
struct rev_collect *revs = cbdata;
@@ -976,12 +1053,13 @@ struct commit *get_fork_point(const char *refname, struct commit *commit)
{
struct object_id oid;
struct rev_collect revs;
- struct commit_list *bases;
+ struct commit_list *bases = NULL;
int i;
struct commit *ret = NULL;
char *full_refname;
- switch (dwim_ref(refname, strlen(refname), &oid, &full_refname, 0)) {
+ switch (repo_dwim_ref(the_repository, refname, strlen(refname), &oid,
+ &full_refname, 0)) {
case 0:
die("No such ref: '%s'", refname);
case 1:
@@ -1000,7 +1078,9 @@ struct commit *get_fork_point(const char *refname, struct commit *commit)
for (i = 0; i < revs.nr; i++)
revs.commit[i]->object.flags &= ~TMP_MARK;
- bases = get_merge_bases_many(commit, revs.nr, revs.commit);
+ if (repo_get_merge_bases_many(the_repository, commit, revs.nr,
+ revs.commit, &bases) < 0)
+ exit(128);
/*
* There should be one and only one merge base, when we found
@@ -1019,6 +1099,7 @@ struct commit *get_fork_point(const char *refname, struct commit *commit)
ret = bases->item;
cleanup_return:
+ free(revs.commit);
free_commit_list(bases);
free(full_refname);
return ret;
@@ -1033,12 +1114,11 @@ static const char *gpg_sig_headers[] = {
"gpgsig-sha256",
};
-int sign_with_header(struct strbuf *buf, const char *keyid)
+int add_header_signature(struct strbuf *buf, struct strbuf *sig, const struct git_hash_algo *algo)
{
- struct strbuf sig = STRBUF_INIT;
int inspos, copypos;
const char *eoh;
- const char *gpg_sig_header = gpg_sig_headers[hash_algo_by_ptr(the_hash_algo)];
+ const char *gpg_sig_header = gpg_sig_headers[hash_algo_by_ptr(algo)];
int gpg_sig_header_len = strlen(gpg_sig_header);
/* find the end of the header */
@@ -1048,15 +1128,8 @@ int sign_with_header(struct strbuf *buf, const char *keyid)
else
inspos = eoh - buf->buf + 1;
- if (!keyid || !*keyid)
- keyid = get_signing_key();
- if (sign_buffer(buf, &sig, keyid)) {
- strbuf_release(&sig);
- return -1;
- }
-
- for (copypos = 0; sig.buf[copypos]; ) {
- const char *bol = sig.buf + copypos;
+ for (copypos = 0; sig->buf[copypos]; ) {
+ const char *bol = sig->buf + copypos;
const char *eol = strchrnul(bol, '\n');
int len = (eol - bol) + !!*eol;
@@ -1069,21 +1142,28 @@ int sign_with_header(struct strbuf *buf, const char *keyid)
inspos += len;
copypos += len;
}
- strbuf_release(&sig);
return 0;
}
-
+static int sign_commit_to_strbuf(struct strbuf *sig, struct strbuf *buf, const char *keyid)
+{
+ if (!keyid || !*keyid)
+ keyid = get_signing_key();
+ if (sign_buffer(buf, sig, keyid))
+ return -1;
+ return 0;
+}
int parse_signed_commit(const struct commit *commit,
struct strbuf *payload, struct strbuf *signature,
const struct git_hash_algo *algop)
{
unsigned long size;
- const char *buffer = get_commit_buffer(commit, &size);
+ const char *buffer = repo_get_commit_buffer(the_repository, commit,
+ &size);
int ret = parse_buffer_signed_by_header(buffer, size, payload, signature, algop);
- unuse_commit_buffer(commit, buffer);
+ repo_unuse_commit_buffer(the_repository, commit, buffer);
return ret;
}
@@ -1194,7 +1274,8 @@ static void handle_signed_tag(struct commit *parent, struct commit_extra_header
desc = merge_remote_util(parent);
if (!desc || !desc->obj)
return;
- buf = read_object_file(&desc->obj->oid, &type, &size);
+ buf = repo_read_object_file(the_repository, &desc->obj->oid, &type,
+ &size);
if (!buf || type != OBJ_TAG)
goto free_return;
if (!parse_signature(buf, size, &payload, &signature))
@@ -1256,7 +1337,8 @@ void verify_merge_signature(struct commit *commit, int verbosity,
ret = check_commit_signature(commit, &signature_check);
- find_unique_abbrev_r(hex, &commit->object.oid, DEFAULT_ABBREV);
+ repo_find_unique_abbrev_r(the_repository, hex, &commit->object.oid,
+ DEFAULT_ABBREV);
switch (signature_check.result) {
case 'G':
if (ret || (check_trust && signature_check.trust_level < TRUST_MARGINAL))
@@ -1286,6 +1368,39 @@ void append_merge_tag_headers(struct commit_list *parents,
}
}
+static int convert_commit_extra_headers(struct commit_extra_header *orig,
+ struct commit_extra_header **result)
+{
+ const struct git_hash_algo *compat = the_repository->compat_hash_algo;
+ const struct git_hash_algo *algo = the_repository->hash_algo;
+ struct commit_extra_header *extra = NULL, **tail = &extra;
+ struct strbuf out = STRBUF_INIT;
+ while (orig) {
+ struct commit_extra_header *new;
+ CALLOC_ARRAY(new, 1);
+ if (!strcmp(orig->key, "mergetag")) {
+ if (convert_object_file(&out, algo, compat,
+ orig->value, orig->len,
+ OBJ_TAG, 1)) {
+ free(new);
+ free_commit_extra_headers(extra);
+ return -1;
+ }
+ new->key = xstrdup("mergetag");
+ new->value = strbuf_detach(&out, &new->len);
+ } else {
+ new->key = xstrdup(orig->key);
+ new->len = orig->len;
+ new->value = xmemdupz(orig->value, orig->len);
+ }
+ *tail = new;
+ tail = &new->next;
+ orig = orig->next;
+ }
+ *result = extra;
+ return 0;
+}
+
static void add_extra_header(struct strbuf *buffer,
struct commit_extra_header *extra)
{
@@ -1301,9 +1416,10 @@ struct commit_extra_header *read_commit_extra_headers(struct commit *commit,
{
struct commit_extra_header *extra = NULL;
unsigned long size;
- const char *buffer = get_commit_buffer(commit, &size);
+ const char *buffer = repo_get_commit_buffer(the_repository, commit,
+ &size);
extra = read_commit_extra_header_lines(buffer, size, exclude);
- unuse_commit_buffer(commit, buffer);
+ repo_unuse_commit_buffer(the_repository, commit, buffer);
return extra;
}
@@ -1528,70 +1644,169 @@ N_("Warning: commit message did not conform to UTF-8.\n"
"You may want to amend it after fixing the message, or set the config\n"
"variable i18n.commitEncoding to the encoding your project uses.\n");
-int commit_tree_extended(const char *msg, size_t msg_len,
- const struct object_id *tree,
- struct commit_list *parents, struct object_id *ret,
- const char *author, const char *committer,
- const char *sign_commit,
- struct commit_extra_header *extra)
+static void write_commit_tree(struct strbuf *buffer, const char *msg, size_t msg_len,
+ const struct object_id *tree,
+ const struct object_id *parents, size_t parents_len,
+ const char *author, const char *committer,
+ struct commit_extra_header *extra)
{
- int result;
int encoding_is_utf8;
- struct strbuf buffer;
-
- assert_oid_type(tree, OBJ_TREE);
-
- if (memchr(msg, '\0', msg_len))
- return error("a NUL byte in commit log message not allowed.");
+ size_t i;
/* Not having i18n.commitencoding is the same as having utf-8 */
encoding_is_utf8 = is_encoding_utf8(git_commit_encoding);
- strbuf_init(&buffer, 8192); /* should avoid reallocs for the headers */
- strbuf_addf(&buffer, "tree %s\n", oid_to_hex(tree));
+ strbuf_grow(buffer, 8192); /* should avoid reallocs for the headers */
+ strbuf_addf(buffer, "tree %s\n", oid_to_hex(tree));
/*
* NOTE! This ordering means that the same exact tree merged with a
* different order of parents will be a _different_ changeset even
* if everything else stays the same.
*/
- while (parents) {
- struct commit *parent = pop_commit(&parents);
- strbuf_addf(&buffer, "parent %s\n",
- oid_to_hex(&parent->object.oid));
- }
+ for (i = 0; i < parents_len; i++)
+ strbuf_addf(buffer, "parent %s\n", oid_to_hex(&parents[i]));
/* Person/date information */
if (!author)
author = git_author_info(IDENT_STRICT);
- strbuf_addf(&buffer, "author %s\n", author);
+ strbuf_addf(buffer, "author %s\n", author);
if (!committer)
committer = git_committer_info(IDENT_STRICT);
- strbuf_addf(&buffer, "committer %s\n", committer);
+ strbuf_addf(buffer, "committer %s\n", committer);
if (!encoding_is_utf8)
- strbuf_addf(&buffer, "encoding %s\n", git_commit_encoding);
+ strbuf_addf(buffer, "encoding %s\n", git_commit_encoding);
while (extra) {
- add_extra_header(&buffer, extra);
+ add_extra_header(buffer, extra);
extra = extra->next;
}
- strbuf_addch(&buffer, '\n');
+ strbuf_addch(buffer, '\n');
/* And add the comment */
- strbuf_add(&buffer, msg, msg_len);
+ strbuf_add(buffer, msg, msg_len);
+}
- /* And check the encoding */
- if (encoding_is_utf8 && !verify_utf8(&buffer))
- fprintf(stderr, _(commit_utf8_warn));
+int commit_tree_extended(const char *msg, size_t msg_len,
+ const struct object_id *tree,
+ struct commit_list *parents, struct object_id *ret,
+ const char *author, const char *committer,
+ const char *sign_commit,
+ struct commit_extra_header *extra)
+{
+ struct repository *r = the_repository;
+ int result = 0;
+ int encoding_is_utf8;
+ struct strbuf buffer = STRBUF_INIT, compat_buffer = STRBUF_INIT;
+ struct strbuf sig = STRBUF_INIT, compat_sig = STRBUF_INIT;
+ struct object_id *parent_buf = NULL, *compat_oid = NULL;
+ struct object_id compat_oid_buf;
+ size_t i, nparents;
+
+ /* Not having i18n.commitencoding is the same as having utf-8 */
+ encoding_is_utf8 = is_encoding_utf8(git_commit_encoding);
- if (sign_commit && sign_with_header(&buffer, sign_commit)) {
+ assert_oid_type(tree, OBJ_TREE);
+
+ if (memchr(msg, '\0', msg_len))
+ return error("a NUL byte in commit log message not allowed.");
+
+ nparents = commit_list_count(parents);
+ CALLOC_ARRAY(parent_buf, nparents);
+ i = 0;
+ while (parents) {
+ struct commit *parent = pop_commit(&parents);
+ oidcpy(&parent_buf[i++], &parent->object.oid);
+ }
+
+ write_commit_tree(&buffer, msg, msg_len, tree, parent_buf, nparents, author, committer, extra);
+ if (sign_commit && sign_commit_to_strbuf(&sig, &buffer, sign_commit)) {
result = -1;
goto out;
}
+ if (r->compat_hash_algo) {
+ struct commit_extra_header *compat_extra = NULL;
+ struct object_id mapped_tree;
+ struct object_id *mapped_parents;
+
+ CALLOC_ARRAY(mapped_parents, nparents);
+
+ if (repo_oid_to_algop(r, tree, r->compat_hash_algo, &mapped_tree)) {
+ result = -1;
+ free(mapped_parents);
+ goto out;
+ }
+ for (i = 0; i < nparents; i++)
+ if (repo_oid_to_algop(r, &parent_buf[i], r->compat_hash_algo, &mapped_parents[i])) {
+ result = -1;
+ free(mapped_parents);
+ goto out;
+ }
+ if (convert_commit_extra_headers(extra, &compat_extra)) {
+ result = -1;
+ free(mapped_parents);
+ goto out;
+ }
+ write_commit_tree(&compat_buffer, msg, msg_len, &mapped_tree,
+ mapped_parents, nparents, author, committer, compat_extra);
+ free_commit_extra_headers(compat_extra);
+ free(mapped_parents);
+
+ if (sign_commit && sign_commit_to_strbuf(&compat_sig, &compat_buffer, sign_commit)) {
+ result = -1;
+ goto out;
+ }
+ }
+
+ if (sign_commit) {
+ struct sig_pairs {
+ struct strbuf *sig;
+ const struct git_hash_algo *algo;
+ } bufs [2] = {
+ { &compat_sig, r->compat_hash_algo },
+ { &sig, r->hash_algo },
+ };
+ int i;
- result = write_object_file(buffer.buf, buffer.len, OBJ_COMMIT, ret);
+ /*
+ * We write algorithms in the order they were implemented in
+ * Git to produce a stable hash when multiple algorithms are
+ * used.
+ */
+ if (r->compat_hash_algo && hash_algo_by_ptr(bufs[0].algo) > hash_algo_by_ptr(bufs[1].algo))
+ SWAP(bufs[0], bufs[1]);
+
+ /*
+ * We traverse each algorithm in order, and apply the signature
+ * to each buffer.
+ */
+ for (i = 0; i < ARRAY_SIZE(bufs); i++) {
+ if (!bufs[i].algo)
+ continue;
+ add_header_signature(&buffer, bufs[i].sig, bufs[i].algo);
+ if (r->compat_hash_algo)
+ add_header_signature(&compat_buffer, bufs[i].sig, bufs[i].algo);
+ }
+ }
+
+ /* And check the encoding. */
+ if (encoding_is_utf8 && (!verify_utf8(&buffer) || !verify_utf8(&compat_buffer)))
+ fprintf(stderr, _(commit_utf8_warn));
+
+ if (r->compat_hash_algo) {
+ hash_object_file(r->compat_hash_algo, compat_buffer.buf, compat_buffer.len,
+ OBJ_COMMIT, &compat_oid_buf);
+ compat_oid = &compat_oid_buf;
+ }
+
+ result = write_object_file_flags(buffer.buf, buffer.len, OBJ_COMMIT,
+ ret, compat_oid, 0);
out:
+ free(parent_buf);
strbuf_release(&buffer);
+ strbuf_release(&compat_buffer);
+ strbuf_release(&sig);
+ strbuf_release(&compat_sig);
return result;
}
@@ -1617,10 +1832,11 @@ struct commit *get_merge_parent(const char *name)
struct object *obj;
struct commit *commit;
struct object_id oid;
- if (get_oid(name, &oid))
+ if (repo_get_oid(the_repository, name, &oid))
return NULL;
obj = parse_object(the_repository, &oid);
- commit = (struct commit *)peel_to_type(name, 0, obj, OBJ_COMMIT);
+ commit = (struct commit *)repo_peel_to_type(the_repository, name, 0,
+ obj, OBJ_COMMIT);
if (commit && !merge_remote_util(commit))
set_merge_remote_desc(commit, name, obj);
return commit;
@@ -1697,7 +1913,7 @@ const char *find_commit_header(const char *msg, const char *key, size_t *out_len
* Returns the number of bytes from the tail to ignore, to be fed as
* the second parameter to append_signoff().
*/
-size_t ignore_non_trailer(const char *buf, size_t len)
+size_t ignored_log_message_bytes(const char *buf, size_t len)
{
size_t boc = 0;
size_t bol = 0;
@@ -1712,7 +1928,8 @@ size_t ignore_non_trailer(const char *buf, size_t len)
else
next_line++;
- if (buf[bol] == comment_line_char || buf[bol] == '\n') {
+ if (starts_with_mem(buf + bol, cutoff - bol, comment_line_str) ||
+ buf[bol] == '\n') {
/* is this the first of the run of comments? */
if (!boc)
boc = bol;
diff --git a/commit.h b/commit.h
index 21e4d25..62fe0d7 100644
--- a/commit.h
+++ b/commit.h
@@ -2,13 +2,10 @@
#define COMMIT_H
#include "object.h"
-#include "tree.h"
-#include "strbuf.h"
-#include "decorate.h"
-#include "gpg-interface.h"
-#include "string-list.h"
-#include "pretty.h"
-#include "commit-slab.h"
+
+struct signature_check;
+struct strbuf;
+struct tree;
#define COMMIT_NOT_FROM_GRAPH 0xFFFFFFFF
#define GENERATION_NUMBER_INFINITY ((1ULL << 63) - 1)
@@ -64,6 +61,19 @@ enum decoration_type {
void add_name_decoration(enum decoration_type type, const char *name, struct object *obj);
const struct name_decoration *get_name_decoration(const struct object *obj);
+/*
+ * Look up commit named by "oid" respecting replacement objects.
+ * Returns NULL if "oid" is not a commit or does not exist.
+ */
+struct commit *lookup_commit_object(struct repository *r, const struct object_id *oid);
+
+/*
+ * Look up commit named by "oid" without replacement objects or
+ * checking for object existence. Returns the requested commit if it
+ * is found in the object cache, NULL if "oid" is in the object cache
+ * but is not a commit and a newly allocated unparsed commit object if
+ * "oid" is not in the object cache.
+ */
struct commit *lookup_commit(struct repository *r, const struct object_id *oid);
struct commit *lookup_commit_reference(struct repository *r,
const struct object_id *oid);
@@ -96,11 +106,6 @@ static inline int repo_parse_commit_no_graph(struct repository *r,
return repo_parse_commit_internal(r, commit, 0, 0);
}
-#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
-#define parse_commit_internal(item, quiet, use) repo_parse_commit_internal(the_repository, item, quiet, use)
-#define parse_commit(item) repo_parse_commit(the_repository, item)
-#endif
-
void parse_commit_or_die(struct commit *item);
struct buffer_slab;
@@ -122,27 +127,21 @@ const void *get_cached_commit_buffer(struct repository *, const struct commit *,
/*
* Get the commit's object contents, either from cache or by reading the object
* from disk. The resulting memory should not be modified, and must be given
- * to unuse_commit_buffer when the caller is done.
+ * to repo_unuse_commit_buffer when the caller is done.
*/
const void *repo_get_commit_buffer(struct repository *r,
const struct commit *,
unsigned long *size);
-#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
-#define get_commit_buffer(c, s) repo_get_commit_buffer(the_repository, c, s)
-#endif
/*
* Tell the commit subsystem that we are done with a particular commit buffer.
* The commit and buffer should be the input and return value, respectively,
- * from an earlier call to get_commit_buffer. The buffer may or may not be
+ * from an earlier call to repo_get_commit_buffer. The buffer may or may not be
* freed by this call; callers should not access the memory afterwards.
*/
void repo_unuse_commit_buffer(struct repository *r,
const struct commit *,
const void *buffer);
-#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
-#define unuse_commit_buffer(c, b) repo_unuse_commit_buffer(the_repository, c, b)
-#endif
/*
* Free any cached object buffer associated with the commit.
@@ -150,7 +149,6 @@ void repo_unuse_commit_buffer(struct repository *r,
void free_commit_buffer(struct parsed_object_pool *pool, struct commit *);
struct tree *repo_get_commit_tree(struct repository *, const struct commit *);
-#define get_commit_tree(c) repo_get_commit_tree(the_repository, c)
struct object_id *get_commit_tree_oid(const struct commit *);
/*
@@ -192,17 +190,10 @@ void free_commit_list(struct commit_list *list);
struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */
-int has_non_ascii(const char *text);
-const char *logmsg_reencode(const struct commit *commit,
- char **commit_encoding,
- const char *output_encoding);
const char *repo_logmsg_reencode(struct repository *r,
const struct commit *commit,
char **commit_encoding,
const char *output_encoding);
-#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
-#define logmsg_reencode(c, enc, out) repo_logmsg_reencode(the_repository, c, enc, out)
-#endif
const char *skip_blank_lines(const char *msg);
@@ -261,8 +252,6 @@ struct ref;
int for_each_commit_graft(each_commit_graft_fn, void *);
int interactive_add(const char **argv, const char *prefix, int patch);
-int run_add_interactive(const char *revision, const char *patch_mode,
- const struct pathspec *pathspec);
struct commit_extra_header {
struct commit_extra_header *next;
@@ -305,8 +294,8 @@ const char *find_header_mem(const char *msg, size_t len,
const char *find_commit_header(const char *msg, const char *key,
size_t *out_len);
-/* Find the end of the log message, the right place for a new trailer. */
-size_t ignore_non_trailer(const char *buf, size_t len);
+/* Find the number of bytes to ignore from the end of a log message. */
+size_t ignored_log_message_bytes(const char *buf, size_t len);
typedef int (*each_mergetag_fn)(struct commit *commit, struct commit_extra_header *extra,
void *cb_data);
@@ -381,5 +370,6 @@ int parse_buffer_signed_by_header(const char *buffer,
struct strbuf *payload,
struct strbuf *signature,
const struct git_hash_algo *algop);
+int add_header_signature(struct strbuf *buf, struct strbuf *sig, const struct git_hash_algo *algo);
#endif /* COMMIT_H */
diff --git a/common-main.c b/common-main.c
index c531372..033778b 100644
--- a/common-main.c
+++ b/common-main.c
@@ -1,6 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "exec-cmd.h"
+#include "gettext.h"
#include "attr.h"
+#include "repository.h"
+#include "setup.h"
+#include "strbuf.h"
+#include "trace2.h"
/*
* Many parts of Git have subprograms communicate via pipe, expect the
@@ -40,6 +45,7 @@ int main(int argc, const char **argv)
git_resolve_executable_dir(argv[0]);
+ setlocale(LC_CTYPE, "");
git_setup_gettext();
initialize_the_repository();
diff --git a/compat/compiler.h b/compat/compiler.h
index 10dbb65..e9ad9db 100644
--- a/compat/compiler.h
+++ b/compat/compiler.h
@@ -1,7 +1,6 @@
#ifndef COMPILER_H
#define COMPILER_H
-#include "git-compat-util.h"
#include "strbuf.h"
#ifdef __GLIBC__
diff --git a/compat/disk.h b/compat/disk.h
new file mode 100644
index 0000000..23bc1be
--- /dev/null
+++ b/compat/disk.h
@@ -0,0 +1,57 @@
+#ifndef COMPAT_DISK_H
+#define COMPAT_DISK_H
+
+#include "abspath.h"
+#include "gettext.h"
+
+static int get_disk_info(struct strbuf *out)
+{
+ struct strbuf buf = STRBUF_INIT;
+ int res = 0;
+
+#ifdef GIT_WINDOWS_NATIVE
+ char volume_name[MAX_PATH], fs_name[MAX_PATH];
+ DWORD serial_number, component_length, flags;
+ ULARGE_INTEGER avail2caller, total, avail;
+
+ strbuf_realpath(&buf, ".", 1);
+ if (!GetDiskFreeSpaceExA(buf.buf, &avail2caller, &total, &avail)) {
+ error(_("could not determine free disk size for '%s'"),
+ buf.buf);
+ res = -1;
+ goto cleanup;
+ }
+
+ strbuf_setlen(&buf, offset_1st_component(buf.buf));
+ if (!GetVolumeInformationA(buf.buf, volume_name, sizeof(volume_name),
+ &serial_number, &component_length, &flags,
+ fs_name, sizeof(fs_name))) {
+ error(_("could not get info for '%s'"), buf.buf);
+ res = -1;
+ goto cleanup;
+ }
+ strbuf_addf(out, "Available space on '%s': ", buf.buf);
+ strbuf_humanise_bytes(out, avail2caller.QuadPart);
+ strbuf_addch(out, '\n');
+#else
+ struct statvfs stat;
+
+ strbuf_realpath(&buf, ".", 1);
+ if (statvfs(buf.buf, &stat) < 0) {
+ error_errno(_("could not determine free disk size for '%s'"),
+ buf.buf);
+ res = -1;
+ goto cleanup;
+ }
+
+ strbuf_addf(out, "Available space on '%s': ", buf.buf);
+ strbuf_humanise_bytes(out, (off_t)stat.f_bsize * (off_t)stat.f_bavail);
+ strbuf_addf(out, " (mount flags 0x%lx)\n", stat.f_flag);
+#endif
+
+cleanup:
+ strbuf_release(&buf);
+ return res;
+}
+
+#endif /* COMPAT_DISK_H */
diff --git a/compat/fsmonitor/fsm-darwin-gcc.h b/compat/fsmonitor/fsm-darwin-gcc.h
index 1c75c3d..3496e29 100644
--- a/compat/fsmonitor/fsm-darwin-gcc.h
+++ b/compat/fsmonitor/fsm-darwin-gcc.h
@@ -80,9 +80,7 @@ void CFRunLoopRun(void);
void CFRunLoopStop(CFRunLoopRef run_loop);
CFRunLoopRef CFRunLoopGetCurrent(void);
extern CFStringRef kCFRunLoopDefaultMode;
-void FSEventStreamScheduleWithRunLoop(FSEventStreamRef stream,
- CFRunLoopRef run_loop,
- CFStringRef run_loop_mode);
+void FSEventStreamSetDispatchQueue(FSEventStreamRef stream, dispatch_queue_t q);
unsigned char FSEventStreamStart(FSEventStreamRef stream);
void FSEventStreamStop(FSEventStreamRef stream);
void FSEventStreamInvalidate(FSEventStreamRef stream);
diff --git a/compat/fsmonitor/fsm-health-darwin.c b/compat/fsmonitor/fsm-health-darwin.c
index b9f709e..c2afcbe 100644
--- a/compat/fsmonitor/fsm-health-darwin.c
+++ b/compat/fsmonitor/fsm-health-darwin.c
@@ -1,24 +1,24 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
#include "fsm-health.h"
#include "fsmonitor--daemon.h"
-int fsm_health__ctor(struct fsmonitor_daemon_state *state)
+int fsm_health__ctor(struct fsmonitor_daemon_state *state UNUSED)
{
return 0;
}
-void fsm_health__dtor(struct fsmonitor_daemon_state *state)
+void fsm_health__dtor(struct fsmonitor_daemon_state *state UNUSED)
{
return;
}
-void fsm_health__loop(struct fsmonitor_daemon_state *state)
+void fsm_health__loop(struct fsmonitor_daemon_state *state UNUSED)
{
return;
}
-void fsm_health__stop_async(struct fsmonitor_daemon_state *state)
+void fsm_health__stop_async(struct fsmonitor_daemon_state *state UNUSED)
{
}
diff --git a/compat/fsmonitor/fsm-health-win32.c b/compat/fsmonitor/fsm-health-win32.c
index 2ea08c1..2aa8c21 100644
--- a/compat/fsmonitor/fsm-health-win32.c
+++ b/compat/fsmonitor/fsm-health-win32.c
@@ -1,8 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
#include "fsm-health.h"
#include "fsmonitor--daemon.h"
+#include "gettext.h"
+#include "simple-ipc.h"
/*
* Every minute wake up and test our health.
diff --git a/compat/fsmonitor/fsm-ipc-darwin.c b/compat/fsmonitor/fsm-ipc-darwin.c
new file mode 100644
index 0000000..6f3a954
--- /dev/null
+++ b/compat/fsmonitor/fsm-ipc-darwin.c
@@ -0,0 +1,56 @@
+#include "git-compat-util.h"
+#include "config.h"
+#include "gettext.h"
+#include "hex.h"
+#include "path.h"
+#include "repository.h"
+#include "strbuf.h"
+#include "fsmonitor-ll.h"
+#include "fsmonitor-ipc.h"
+#include "fsmonitor-path-utils.h"
+
+static GIT_PATH_FUNC(fsmonitor_ipc__get_default_path, "fsmonitor--daemon.ipc")
+
+const char *fsmonitor_ipc__get_path(struct repository *r)
+{
+ static const char *ipc_path = NULL;
+ git_SHA_CTX sha1ctx;
+ char *sock_dir = NULL;
+ struct strbuf ipc_file = STRBUF_INIT;
+ unsigned char hash[GIT_MAX_RAWSZ];
+
+ if (!r)
+ BUG("No repository passed into fsmonitor_ipc__get_path");
+
+ if (ipc_path)
+ return ipc_path;
+
+
+ /* By default the socket file is created in the .git directory */
+ if (fsmonitor__is_fs_remote(r->gitdir) < 1) {
+ ipc_path = fsmonitor_ipc__get_default_path();
+ return ipc_path;
+ }
+
+ git_SHA1_Init(&sha1ctx);
+ git_SHA1_Update(&sha1ctx, r->worktree, strlen(r->worktree));
+ git_SHA1_Final(hash, &sha1ctx);
+
+ repo_config_get_string(r, "fsmonitor.socketdir", &sock_dir);
+
+ /* Create the socket file in either socketDir or $HOME */
+ if (sock_dir && *sock_dir) {
+ strbuf_addf(&ipc_file, "%s/.git-fsmonitor-%s",
+ sock_dir, hash_to_hex(hash));
+ } else {
+ strbuf_addf(&ipc_file, "~/.git-fsmonitor-%s", hash_to_hex(hash));
+ }
+ free(sock_dir);
+
+ ipc_path = interpolate_path(ipc_file.buf, 1);
+ if (!ipc_path)
+ die(_("Invalid path: %s"), ipc_file.buf);
+
+ strbuf_release(&ipc_file);
+ return ipc_path;
+}
diff --git a/compat/fsmonitor/fsm-ipc-win32.c b/compat/fsmonitor/fsm-ipc-win32.c
new file mode 100644
index 0000000..41984ea
--- /dev/null
+++ b/compat/fsmonitor/fsm-ipc-win32.c
@@ -0,0 +1,11 @@
+#include "git-compat-util.h"
+#include "config.h"
+#include "fsmonitor-ipc.h"
+#include "path.h"
+
+const char *fsmonitor_ipc__get_path(struct repository *r) {
+ static char *ret;
+ if (!ret)
+ ret = repo_git_path(r, "fsmonitor--daemon.ipc");
+ return ret;
+}
diff --git a/compat/fsmonitor/fsm-listen-darwin.c b/compat/fsmonitor/fsm-listen-darwin.c
index 8e208e8..2fc6744 100644
--- a/compat/fsmonitor/fsm-listen-darwin.c
+++ b/compat/fsmonitor/fsm-listen-darwin.c
@@ -1,4 +1,5 @@
#ifndef __clang__
+#include <dispatch/dispatch.h>
#include "fsm-darwin-gcc.h"
#else
#include <CoreFoundation/CoreFoundation.h>
@@ -22,10 +23,15 @@
#endif
#endif
-#include "cache.h"
-#include "fsmonitor.h"
+#include "git-compat-util.h"
+#include "fsmonitor-ll.h"
#include "fsm-listen.h"
#include "fsmonitor--daemon.h"
+#include "fsmonitor-path-utils.h"
+#include "gettext.h"
+#include "simple-ipc.h"
+#include "string-list.h"
+#include "trace.h"
struct fsm_listen_data
{
@@ -37,7 +43,9 @@ struct fsm_listen_data
FSEventStreamRef stream;
- CFRunLoopRef rl;
+ dispatch_queue_t dq;
+ pthread_cond_t dq_finished;
+ pthread_mutex_t dq_lock;
enum shutdown_style {
SHUTDOWN_EVENT = 0,
@@ -184,12 +192,12 @@ static void my_add_path(struct fsmonitor_batch *batch, const char *path)
}
-static void fsevent_callback(ConstFSEventStreamRef streamRef,
+static void fsevent_callback(ConstFSEventStreamRef streamRef UNUSED,
void *ctx,
size_t num_of_events,
void *event_paths,
const FSEventStreamEventFlags event_flags[],
- const FSEventStreamEventId event_ids[])
+ const FSEventStreamEventId event_ids[] UNUSED)
{
struct fsmonitor_daemon_state *state = ctx;
struct fsm_listen_data *data = state->listen_data;
@@ -198,8 +206,9 @@ static void fsevent_callback(ConstFSEventStreamRef streamRef,
struct string_list cookie_list = STRING_LIST_INIT_DUP;
const char *path_k;
const char *slash;
- int k;
+ char *resolved = NULL;
struct strbuf tmp = STRBUF_INIT;
+ int k;
/*
* Build a list of all filesystem changes into a private/local
@@ -209,7 +218,12 @@ static void fsevent_callback(ConstFSEventStreamRef streamRef,
/*
* On Mac, we receive an array of absolute paths.
*/
- path_k = paths[k];
+ free(resolved);
+ resolved = fsmonitor__resolve_alias(paths[k], &state->alias);
+ if (resolved)
+ path_k = resolved;
+ else
+ path_k = paths[k];
/*
* If you want to debug FSEvents, log them to GIT_TRACE_FSMONITOR.
@@ -238,6 +252,7 @@ static void fsevent_callback(ConstFSEventStreamRef streamRef,
fsmonitor_force_resync(state);
fsmonitor_batch__free_list(batch);
string_list_clear(&cookie_list, 0);
+ batch = NULL;
/*
* We assume that any events that we received
@@ -328,7 +343,7 @@ static void fsevent_callback(ConstFSEventStreamRef streamRef,
* know how much to invalidate/refresh.
*/
- if (event_flags[k] & kFSEventStreamEventFlagItemIsFile) {
+ if (event_flags[k] & (kFSEventStreamEventFlagItemIsFile | kFSEventStreamEventFlagItemIsSymlink)) {
const char *rel = path_k +
state->path_worktree_watch.len + 1;
@@ -360,17 +375,22 @@ static void fsevent_callback(ConstFSEventStreamRef streamRef,
}
}
+ free(resolved);
fsmonitor_publish(state, batch, &cookie_list);
string_list_clear(&cookie_list, 0);
strbuf_release(&tmp);
return;
force_shutdown:
+ free(resolved);
fsmonitor_batch__free_list(batch);
string_list_clear(&cookie_list, 0);
+ pthread_mutex_lock(&data->dq_lock);
data->shutdown_style = FORCE_SHUTDOWN;
- CFRunLoopStop(data->rl);
+ pthread_cond_broadcast(&data->dq_finished);
+ pthread_mutex_unlock(&data->dq_lock);
+
strbuf_release(&tmp);
return;
}
@@ -431,10 +451,6 @@ int fsm_listen__ctor(struct fsmonitor_daemon_state *state)
if (!data->stream)
goto failed;
- /*
- * `data->rl` needs to be set inside the listener thread.
- */
-
return 0;
failed:
@@ -461,6 +477,11 @@ void fsm_listen__dtor(struct fsmonitor_daemon_state *state)
FSEventStreamRelease(data->stream);
}
+ if (data->dq)
+ dispatch_release(data->dq);
+ pthread_cond_destroy(&data->dq_finished);
+ pthread_mutex_destroy(&data->dq_lock);
+
FREE_AND_NULL(state->listen_data);
}
@@ -469,9 +490,11 @@ void fsm_listen__stop_async(struct fsmonitor_daemon_state *state)
struct fsm_listen_data *data;
data = state->listen_data;
- data->shutdown_style = SHUTDOWN_EVENT;
- CFRunLoopStop(data->rl);
+ pthread_mutex_lock(&data->dq_lock);
+ data->shutdown_style = SHUTDOWN_EVENT;
+ pthread_cond_broadcast(&data->dq_finished);
+ pthread_mutex_unlock(&data->dq_lock);
}
void fsm_listen__loop(struct fsmonitor_daemon_state *state)
@@ -480,9 +503,11 @@ void fsm_listen__loop(struct fsmonitor_daemon_state *state)
data = state->listen_data;
- data->rl = CFRunLoopGetCurrent();
+ pthread_mutex_init(&data->dq_lock, NULL);
+ pthread_cond_init(&data->dq_finished, NULL);
+ data->dq = dispatch_queue_create("FSMonitor", NULL);
- FSEventStreamScheduleWithRunLoop(data->stream, data->rl, kCFRunLoopDefaultMode);
+ FSEventStreamSetDispatchQueue(data->stream, data->dq);
data->stream_scheduled = 1;
if (!FSEventStreamStart(data->stream)) {
@@ -491,7 +516,9 @@ void fsm_listen__loop(struct fsmonitor_daemon_state *state)
}
data->stream_started = 1;
- CFRunLoopRun();
+ pthread_mutex_lock(&data->dq_lock);
+ pthread_cond_wait(&data->dq_finished, &data->dq_lock);
+ pthread_mutex_unlock(&data->dq_lock);
switch (data->shutdown_style) {
case FORCE_ERROR_STOP:
diff --git a/compat/fsmonitor/fsm-listen-win32.c b/compat/fsmonitor/fsm-listen-win32.c
index 03df8d9..5a21dad 100644
--- a/compat/fsmonitor/fsm-listen-win32.c
+++ b/compat/fsmonitor/fsm-listen-win32.c
@@ -1,8 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
#include "fsm-listen.h"
#include "fsmonitor--daemon.h"
+#include "gettext.h"
+#include "simple-ipc.h"
+#include "trace2.h"
/*
* The documentation of ReadDirectoryChangesW() states that the maximum
@@ -287,8 +290,7 @@ void fsm_listen__stop_async(struct fsmonitor_daemon_state *state)
SetEvent(state->listen_data->hListener[LISTENER_SHUTDOWN]);
}
-static struct one_watch *create_watch(struct fsmonitor_daemon_state *state,
- const char *path)
+static struct one_watch *create_watch(const char *path)
{
struct one_watch *watch = NULL;
DWORD desired_access = FILE_LIST_DIRECTORY;
@@ -359,8 +361,7 @@ static void destroy_watch(struct one_watch *watch)
free(watch);
}
-static int start_rdcw_watch(struct fsm_listen_data *data,
- struct one_watch *watch)
+static int start_rdcw_watch(struct one_watch *watch)
{
DWORD dwNotifyFilter =
FILE_NOTIFY_CHANGE_FILE_NAME |
@@ -733,11 +734,11 @@ void fsm_listen__loop(struct fsmonitor_daemon_state *state)
state->listen_error_code = 0;
- if (start_rdcw_watch(data, data->watch_worktree) == -1)
+ if (start_rdcw_watch(data->watch_worktree) == -1)
goto force_error_stop;
if (data->watch_gitdir &&
- start_rdcw_watch(data, data->watch_gitdir) == -1)
+ start_rdcw_watch(data->watch_gitdir) == -1)
goto force_error_stop;
for (;;) {
@@ -753,7 +754,7 @@ void fsm_listen__loop(struct fsmonitor_daemon_state *state)
}
if (result == -2) {
/* retryable error */
- if (start_rdcw_watch(data, data->watch_worktree) == -1)
+ if (start_rdcw_watch(data->watch_worktree) == -1)
goto force_error_stop;
continue;
}
@@ -761,7 +762,7 @@ void fsm_listen__loop(struct fsmonitor_daemon_state *state)
/* have data */
if (process_worktree_events(state) == LISTENER_SHUTDOWN)
goto force_shutdown;
- if (start_rdcw_watch(data, data->watch_worktree) == -1)
+ if (start_rdcw_watch(data->watch_worktree) == -1)
goto force_error_stop;
continue;
}
@@ -774,7 +775,7 @@ void fsm_listen__loop(struct fsmonitor_daemon_state *state)
}
if (result == -2) {
/* retryable error */
- if (start_rdcw_watch(data, data->watch_gitdir) == -1)
+ if (start_rdcw_watch(data->watch_gitdir) == -1)
goto force_error_stop;
continue;
}
@@ -782,7 +783,7 @@ void fsm_listen__loop(struct fsmonitor_daemon_state *state)
/* have data */
if (process_gitdir_events(state) == LISTENER_SHUTDOWN)
goto force_shutdown;
- if (start_rdcw_watch(data, data->watch_gitdir) == -1)
+ if (start_rdcw_watch(data->watch_gitdir) == -1)
goto force_error_stop;
continue;
}
@@ -819,16 +820,14 @@ int fsm_listen__ctor(struct fsmonitor_daemon_state *state)
data->hEventShutdown = CreateEvent(NULL, TRUE, FALSE, NULL);
- data->watch_worktree = create_watch(state,
- state->path_worktree_watch.buf);
+ data->watch_worktree = create_watch(state->path_worktree_watch.buf);
if (!data->watch_worktree)
goto failed;
check_for_shortnames(data->watch_worktree);
if (state->nr_paths_watching > 1) {
- data->watch_gitdir = create_watch(state,
- state->path_gitdir_watch.buf);
+ data->watch_gitdir = create_watch(state->path_gitdir_watch.buf);
if (!data->watch_gitdir)
goto failed;
}
diff --git a/compat/fsmonitor/fsm-path-utils-darwin.c b/compat/fsmonitor/fsm-path-utils-darwin.c
new file mode 100644
index 0000000..049f97e
--- /dev/null
+++ b/compat/fsmonitor/fsm-path-utils-darwin.c
@@ -0,0 +1,138 @@
+#include "git-compat-util.h"
+#include "fsmonitor-ll.h"
+#include "fsmonitor-path-utils.h"
+#include "gettext.h"
+#include "trace.h"
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/param.h>
+#include <sys/mount.h>
+
+int fsmonitor__get_fs_info(const char *path, struct fs_info *fs_info)
+{
+ struct statfs fs;
+ if (statfs(path, &fs) == -1) {
+ int saved_errno = errno;
+ trace_printf_key(&trace_fsmonitor, "statfs('%s') failed: %s",
+ path, strerror(saved_errno));
+ errno = saved_errno;
+ return -1;
+ }
+
+ trace_printf_key(&trace_fsmonitor,
+ "statfs('%s') [type 0x%08x][flags 0x%08x] '%s'",
+ path, fs.f_type, fs.f_flags, fs.f_fstypename);
+
+ if (!(fs.f_flags & MNT_LOCAL))
+ fs_info->is_remote = 1;
+ else
+ fs_info->is_remote = 0;
+
+ fs_info->typename = xstrdup(fs.f_fstypename);
+
+ trace_printf_key(&trace_fsmonitor,
+ "'%s' is_remote: %d",
+ path, fs_info->is_remote);
+ return 0;
+}
+
+int fsmonitor__is_fs_remote(const char *path)
+{
+ struct fs_info fs;
+ if (fsmonitor__get_fs_info(path, &fs))
+ return -1;
+
+ free(fs.typename);
+
+ return fs.is_remote;
+}
+
+/*
+ * Scan the root directory for synthetic firmlinks that when resolved
+ * are a prefix of the path, stopping at the first one found.
+ *
+ * Some information about firmlinks and synthetic firmlinks:
+ * https://eclecticlight.co/2020/01/23/catalina-boot-volumes/
+ *
+ * macOS no longer allows symlinks in the root directory; any link found
+ * there is therefore a synthetic firmlink.
+ *
+ * If this function gets called often, will want to cache all the firmlink
+ * information, but for now there is only one caller of this function.
+ *
+ * If there is more than one alias for the path, that is another
+ * matter altogether.
+ */
+int fsmonitor__get_alias(const char *path, struct alias_info *info)
+{
+ DIR *dir;
+ int retval = -1;
+ const char *const root = "/";
+ struct stat st;
+ struct dirent *de;
+ struct strbuf alias;
+ struct strbuf points_to = STRBUF_INIT;
+
+ dir = opendir(root);
+ if (!dir)
+ return error_errno(_("opendir('%s') failed"), root);
+
+ strbuf_init(&alias, 256);
+
+ while ((de = readdir(dir)) != NULL) {
+ strbuf_reset(&alias);
+ strbuf_addf(&alias, "%s%s", root, de->d_name);
+
+ if (lstat(alias.buf, &st) < 0) {
+ error_errno(_("lstat('%s') failed"), alias.buf);
+ goto done;
+ }
+
+ if (!S_ISLNK(st.st_mode))
+ continue;
+
+ if (strbuf_readlink(&points_to, alias.buf, st.st_size) < 0) {
+ error_errno(_("strbuf_readlink('%s') failed"), alias.buf);
+ goto done;
+ }
+
+ if (!strncmp(points_to.buf, path, points_to.len) &&
+ (path[points_to.len] == '/')) {
+ strbuf_addbuf(&info->alias, &alias);
+ strbuf_addbuf(&info->points_to, &points_to);
+ trace_printf_key(&trace_fsmonitor,
+ "Found alias for '%s' : '%s' -> '%s'",
+ path, info->alias.buf, info->points_to.buf);
+ retval = 0;
+ goto done;
+ }
+ }
+ retval = 0; /* no alias */
+
+done:
+ strbuf_release(&alias);
+ strbuf_release(&points_to);
+ if (closedir(dir) < 0)
+ return error_errno(_("closedir('%s') failed"), root);
+ return retval;
+}
+
+char *fsmonitor__resolve_alias(const char *path,
+ const struct alias_info *info)
+{
+ if (!info->alias.len)
+ return NULL;
+
+ if ((!strncmp(info->alias.buf, path, info->alias.len))
+ && path[info->alias.len] == '/') {
+ struct strbuf tmp = STRBUF_INIT;
+ const char *remainder = path + info->alias.len;
+
+ strbuf_addbuf(&tmp, &info->points_to);
+ strbuf_add(&tmp, remainder, strlen(remainder));
+ return strbuf_detach(&tmp, NULL);
+ }
+
+ return NULL;
+}
diff --git a/compat/fsmonitor/fsm-path-utils-win32.c b/compat/fsmonitor/fsm-path-utils-win32.c
new file mode 100644
index 0000000..f4f9cc1
--- /dev/null
+++ b/compat/fsmonitor/fsm-path-utils-win32.c
@@ -0,0 +1,148 @@
+#include "git-compat-util.h"
+#include "fsmonitor-ll.h"
+#include "fsmonitor-path-utils.h"
+#include "gettext.h"
+#include "trace.h"
+
+/*
+ * Check remote working directory protocol.
+ *
+ * Return -1 if client machine cannot get remote protocol information.
+ */
+static int check_remote_protocol(wchar_t *wpath)
+{
+ HANDLE h;
+ FILE_REMOTE_PROTOCOL_INFO proto_info;
+
+ h = CreateFileW(wpath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, NULL);
+
+ if (h == INVALID_HANDLE_VALUE) {
+ error(_("[GLE %ld] unable to open for read '%ls'"),
+ GetLastError(), wpath);
+ return -1;
+ }
+
+ if (!GetFileInformationByHandleEx(h, FileRemoteProtocolInfo,
+ &proto_info, sizeof(proto_info))) {
+ error(_("[GLE %ld] unable to get protocol information for '%ls'"),
+ GetLastError(), wpath);
+ CloseHandle(h);
+ return -1;
+ }
+
+ CloseHandle(h);
+
+ trace_printf_key(&trace_fsmonitor,
+ "check_remote_protocol('%ls') remote protocol %#8.8lx",
+ wpath, proto_info.Protocol);
+
+ return 0;
+}
+
+/*
+ * Notes for testing:
+ *
+ * (a) Windows allows a network share to be mapped to a drive letter.
+ * (This is the normal method to access it.)
+ *
+ * $ NET USE Z: \\server\share
+ * $ git -C Z:/repo status
+ *
+ * (b) Windows allows a network share to be referenced WITHOUT mapping
+ * it to drive letter.
+ *
+ * $ NET USE \\server\share\dir
+ * $ git -C //server/share/repo status
+ *
+ * (c) Windows allows "SUBST" to create a fake drive mapping to an
+ * arbitrary path (which may be remote)
+ *
+ * $ SUBST Q: Z:\repo
+ * $ git -C Q:/ status
+ *
+ * (d) Windows allows a directory symlink to be created on a local
+ * file system that points to a remote repo.
+ *
+ * $ mklink /d ./link //server/share/repo
+ * $ git -C ./link status
+ */
+int fsmonitor__get_fs_info(const char *path, struct fs_info *fs_info)
+{
+ wchar_t wpath[MAX_PATH];
+ wchar_t wfullpath[MAX_PATH];
+ size_t wlen;
+ UINT driveType;
+
+ /*
+ * Do everything in wide chars because the drive letter might be
+ * a multi-byte sequence. See win32_has_dos_drive_prefix().
+ */
+ if (xutftowcs_path(wpath, path) < 0) {
+ return -1;
+ }
+
+ /*
+ * GetDriveTypeW() requires a final slash. We assume that the
+ * worktree pathname points to an actual directory.
+ */
+ wlen = wcslen(wpath);
+ if (wpath[wlen - 1] != L'\\' && wpath[wlen - 1] != L'/') {
+ wpath[wlen++] = L'\\';
+ wpath[wlen] = 0;
+ }
+
+ /*
+ * Normalize the path. If nothing else, this converts forward
+ * slashes to backslashes. This is essential to get GetDriveTypeW()
+ * correctly handle some UNC "\\server\share\..." paths.
+ */
+ if (!GetFullPathNameW(wpath, MAX_PATH, wfullpath, NULL)) {
+ return -1;
+ }
+
+ driveType = GetDriveTypeW(wfullpath);
+ trace_printf_key(&trace_fsmonitor,
+ "DriveType '%s' L'%ls' (%u)",
+ path, wfullpath, driveType);
+
+ if (driveType == DRIVE_REMOTE) {
+ fs_info->is_remote = 1;
+ if (check_remote_protocol(wfullpath) < 0)
+ return -1;
+ } else {
+ fs_info->is_remote = 0;
+ }
+
+ trace_printf_key(&trace_fsmonitor,
+ "'%s' is_remote: %d",
+ path, fs_info->is_remote);
+
+ return 0;
+}
+
+int fsmonitor__is_fs_remote(const char *path)
+{
+ struct fs_info fs;
+ if (fsmonitor__get_fs_info(path, &fs))
+ return -1;
+ return fs.is_remote;
+}
+
+/*
+ * No-op for now.
+ */
+int fsmonitor__get_alias(const char *path UNUSED,
+ struct alias_info *info UNUSED)
+{
+ return 0;
+}
+
+/*
+ * No-op for now.
+ */
+char *fsmonitor__resolve_alias(const char *path UNUSED,
+ const struct alias_info *info UNUSED)
+{
+ return NULL;
+}
diff --git a/compat/fsmonitor/fsm-settings-darwin.c b/compat/fsmonitor/fsm-settings-darwin.c
index efc732c..a382590 100644
--- a/compat/fsmonitor/fsm-settings-darwin.c
+++ b/compat/fsmonitor/fsm-settings-darwin.c
@@ -1,32 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
-#include "repository.h"
+#include "fsmonitor-ll.h"
+#include "fsmonitor-ipc.h"
#include "fsmonitor-settings.h"
-#include "fsmonitor.h"
-#include <sys/param.h>
-#include <sys/mount.h>
+#include "fsmonitor-path-utils.h"
-/*
- * [1] Remote working directories are problematic for FSMonitor.
- *
- * The underlying file system on the server machine and/or the remote
- * mount type (NFS, SAMBA, etc.) dictates whether notification events
- * are available at all to remote client machines.
- *
- * Kernel differences between the server and client machines also
- * dictate the how (buffering, frequency, de-dup) the events are
- * delivered to client machine processes.
- *
- * A client machine (such as a laptop) may choose to suspend/resume
- * and it is unclear (without lots of testing) whether the watcher can
- * resync after a resume. We might be able to treat this as a normal
- * "events were dropped by the kernel" event and do our normal "flush
- * and resync" --or-- we might need to close the existing (zombie?)
- * notification fd and create a new one.
- *
- * In theory, the above issues need to be addressed whether we are
- * using the Hook or IPC API.
- *
+ /*
* For the builtin FSMonitor, we create the Unix domain socket for the
* IPC in the .git directory. If the working directory is remote,
* then the socket will be created on the remote file system. This
@@ -38,52 +17,47 @@
* be taken to ensure that $HOME is actually local and not a managed
* file share.)
*
- * So (for now at least), mark remote working directories as
- * incompatible.
- *
- *
- * [2] FAT32 and NTFS working directories are problematic too.
+ * FAT32 and NTFS working directories are problematic too.
*
* The builtin FSMonitor uses a Unix domain socket in the .git
* directory for IPC. These Windows drive formats do not support
* Unix domain sockets, so mark them as incompatible for the daemon.
*
*/
-static enum fsmonitor_reason check_volume(struct repository *r)
+static enum fsmonitor_reason check_uds_volume(struct repository *r)
{
- struct statfs fs;
+ struct fs_info fs;
+ const char *ipc_path = fsmonitor_ipc__get_path(r);
+ struct strbuf path = STRBUF_INIT;
+ strbuf_add(&path, ipc_path, strlen(ipc_path));
- if (statfs(r->worktree, &fs) == -1) {
- int saved_errno = errno;
- trace_printf_key(&trace_fsmonitor, "statfs('%s') failed: %s",
- r->worktree, strerror(saved_errno));
- errno = saved_errno;
+ if (fsmonitor__get_fs_info(dirname(path.buf), &fs) == -1) {
+ strbuf_release(&path);
return FSMONITOR_REASON_ERROR;
}
- trace_printf_key(&trace_fsmonitor,
- "statfs('%s') [type 0x%08x][flags 0x%08x] '%s'",
- r->worktree, fs.f_type, fs.f_flags, fs.f_fstypename);
-
- if (!(fs.f_flags & MNT_LOCAL))
- return FSMONITOR_REASON_REMOTE;
-
- if (!strcmp(fs.f_fstypename, "msdos")) /* aka FAT32 */
- return FSMONITOR_REASON_NOSOCKETS;
+ strbuf_release(&path);
- if (!strcmp(fs.f_fstypename, "ntfs"))
+ if (fs.is_remote ||
+ !strcmp(fs.typename, "msdos") ||
+ !strcmp(fs.typename, "ntfs")) {
+ free(fs.typename);
return FSMONITOR_REASON_NOSOCKETS;
+ }
+ free(fs.typename);
return FSMONITOR_REASON_OK;
}
-enum fsmonitor_reason fsm_os__incompatible(struct repository *r)
+enum fsmonitor_reason fsm_os__incompatible(struct repository *r, int ipc)
{
enum fsmonitor_reason reason;
- reason = check_volume(r);
- if (reason != FSMONITOR_REASON_OK)
- return reason;
+ if (ipc) {
+ reason = check_uds_volume(r);
+ if (reason != FSMONITOR_REASON_OK)
+ return reason;
+ }
return FSMONITOR_REASON_OK;
}
diff --git a/compat/fsmonitor/fsm-settings-win32.c b/compat/fsmonitor/fsm-settings-win32.c
index 9076557..0f2aa32 100644
--- a/compat/fsmonitor/fsm-settings-win32.c
+++ b/compat/fsmonitor/fsm-settings-win32.c
@@ -1,8 +1,9 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "repository.h"
+#include "fsmonitor-ll.h"
#include "fsmonitor-settings.h"
-#include "fsmonitor.h"
+#include "fsmonitor-path-utils.h"
/*
* VFS for Git is incompatible with FSMonitor.
@@ -24,104 +25,7 @@ static enum fsmonitor_reason check_vfs4git(struct repository *r)
return FSMONITOR_REASON_OK;
}
-/*
- * Remote working directories are problematic for FSMonitor.
- *
- * The underlying file system on the server machine and/or the remote
- * mount type dictates whether notification events are available at
- * all to remote client machines.
- *
- * Kernel differences between the server and client machines also
- * dictate the how (buffering, frequency, de-dup) the events are
- * delivered to client machine processes.
- *
- * A client machine (such as a laptop) may choose to suspend/resume
- * and it is unclear (without lots of testing) whether the watcher can
- * resync after a resume. We might be able to treat this as a normal
- * "events were dropped by the kernel" event and do our normal "flush
- * and resync" --or-- we might need to close the existing (zombie?)
- * notification fd and create a new one.
- *
- * In theory, the above issues need to be addressed whether we are
- * using the Hook or IPC API.
- *
- * So (for now at least), mark remote working directories as
- * incompatible.
- *
- * Notes for testing:
- *
- * (a) Windows allows a network share to be mapped to a drive letter.
- * (This is the normal method to access it.)
- *
- * $ NET USE Z: \\server\share
- * $ git -C Z:/repo status
- *
- * (b) Windows allows a network share to be referenced WITHOUT mapping
- * it to drive letter.
- *
- * $ NET USE \\server\share\dir
- * $ git -C //server/share/repo status
- *
- * (c) Windows allows "SUBST" to create a fake drive mapping to an
- * arbitrary path (which may be remote)
- *
- * $ SUBST Q: Z:\repo
- * $ git -C Q:/ status
- *
- * (d) Windows allows a directory symlink to be created on a local
- * file system that points to a remote repo.
- *
- * $ mklink /d ./link //server/share/repo
- * $ git -C ./link status
- */
-static enum fsmonitor_reason check_remote(struct repository *r)
-{
- wchar_t wpath[MAX_PATH];
- wchar_t wfullpath[MAX_PATH];
- size_t wlen;
- UINT driveType;
-
- /*
- * Do everything in wide chars because the drive letter might be
- * a multi-byte sequence. See win32_has_dos_drive_prefix().
- */
- if (xutftowcs_path(wpath, r->worktree) < 0)
- return FSMONITOR_REASON_ERROR;
-
- /*
- * GetDriveTypeW() requires a final slash. We assume that the
- * worktree pathname points to an actual directory.
- */
- wlen = wcslen(wpath);
- if (wpath[wlen - 1] != L'\\' && wpath[wlen - 1] != L'/') {
- wpath[wlen++] = L'\\';
- wpath[wlen] = 0;
- }
-
- /*
- * Normalize the path. If nothing else, this converts forward
- * slashes to backslashes. This is essential to get GetDriveTypeW()
- * correctly handle some UNC "\\server\share\..." paths.
- */
- if (!GetFullPathNameW(wpath, MAX_PATH, wfullpath, NULL))
- return FSMONITOR_REASON_ERROR;
-
- driveType = GetDriveTypeW(wfullpath);
- trace_printf_key(&trace_fsmonitor,
- "DriveType '%s' L'%ls' (%u)",
- r->worktree, wfullpath, driveType);
-
- if (driveType == DRIVE_REMOTE) {
- trace_printf_key(&trace_fsmonitor,
- "check_remote('%s') true",
- r->worktree);
- return FSMONITOR_REASON_REMOTE;
- }
-
- return FSMONITOR_REASON_OK;
-}
-
-enum fsmonitor_reason fsm_os__incompatible(struct repository *r)
+enum fsmonitor_reason fsm_os__incompatible(struct repository *r, int ipc UNUSED)
{
enum fsmonitor_reason reason;
@@ -129,9 +33,5 @@ enum fsmonitor_reason fsm_os__incompatible(struct repository *r)
if (reason != FSMONITOR_REASON_OK)
return reason;
- reason = check_remote(r);
- if (reason != FSMONITOR_REASON_OK)
- return reason;
-
return FSMONITOR_REASON_OK;
}
diff --git a/compat/linux/procinfo.c b/compat/linux/procinfo.c
index bc2f938..4bb2d66 100644
--- a/compat/linux/procinfo.c
+++ b/compat/linux/procinfo.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "strbuf.h"
#include "strvec.h"
diff --git a/compat/mingw.c b/compat/mingw.c
index b550299..4876344 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1,14 +1,21 @@
#include "../git-compat-util.h"
#include "win32.h"
#include <aclapi.h>
+#include <sddl.h>
#include <conio.h>
#include <wchar.h>
#include "../strbuf.h"
#include "../run-command.h"
-#include "../cache.h"
+#include "../abspath.h"
+#include "../alloc.h"
#include "win32/lazyload.h"
#include "../config.h"
+#include "../environment.h"
+#include "../trace2.h"
+#include "../symlinks.h"
+#include "../wrapper.h"
#include "dir.h"
+#include "gettext.h"
#define SECURITY_WIN32
#include <sspi.h>
@@ -195,16 +202,19 @@ static int read_yes_no_answer(void)
static int ask_yes_no_if_possible(const char *format, ...)
{
char question[4096];
- const char *retry_hook[] = { NULL, NULL, NULL };
+ const char *retry_hook;
va_list args;
va_start(args, format);
vsnprintf(question, sizeof(question), format, args);
va_end(args);
- if ((retry_hook[0] = mingw_getenv("GIT_ASK_YESNO"))) {
- retry_hook[1] = question;
- return !run_command_v_opt(retry_hook, 0);
+ retry_hook = mingw_getenv("GIT_ASK_YESNO");
+ if (retry_hook) {
+ struct child_process cmd = CHILD_PROCESS_INIT;
+
+ strvec_pushl(&cmd.args, retry_hook, question, NULL);
+ return !run_command(&cmd);
}
if (!isatty(_fileno(stdin)) || !isatty(_fileno(stderr)))
@@ -233,7 +243,8 @@ static int core_restrict_inherited_handles = -1;
static enum hide_dotfiles_type hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
static char *unset_environment_variables;
-int mingw_core_config(const char *var, const char *value, void *cb)
+int mingw_core_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(var, "core.hidedotfiles")) {
if (value && !strcasecmp(value, "dotgitonly"))
@@ -244,6 +255,8 @@ int mingw_core_config(const char *var, const char *value, void *cb)
}
if (!strcmp(var, "core.unsetenvvars")) {
+ if (!value)
+ return config_error_nonbool(var);
free(unset_environment_variables);
unset_environment_variables = xstrdup(value);
return 0;
@@ -694,13 +707,24 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
{
ssize_t result = write(fd, buf, len);
- if (result < 0 && errno == EINVAL && buf) {
+ if (result < 0 && (errno == EINVAL || errno == ENOSPC) && buf) {
+ int orig = errno;
+
/* check if fd is a pipe */
HANDLE h = (HANDLE) _get_osfhandle(fd);
- if (GetFileType(h) == FILE_TYPE_PIPE)
+ if (GetFileType(h) != FILE_TYPE_PIPE)
+ errno = orig;
+ else if (orig == EINVAL)
errno = EPIPE;
- else
- errno = EINVAL;
+ else {
+ DWORD buf_size;
+
+ if (!GetNamedPipeInfo(h, NULL, NULL, &buf_size, NULL))
+ buf_size = 4096;
+ if (len > buf_size)
+ return write(fd, buf, buf_size);
+ errno = orig;
+ }
}
return result;
@@ -768,8 +792,8 @@ static int has_valid_directory_prefix(wchar_t *wfilename)
wfilename[n] = L'\0';
attributes = GetFileAttributesW(wfilename);
wfilename[n] = c;
- if (attributes == FILE_ATTRIBUTE_DIRECTORY ||
- attributes == FILE_ATTRIBUTE_DEVICE)
+ if (attributes &
+ (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_DEVICE))
return 1;
if (attributes == INVALID_FILE_ATTRIBUTES)
switch (GetLastError()) {
@@ -1336,6 +1360,11 @@ static char *path_lookup(const char *cmd, int exe_only)
return prog;
}
+char *mingw_locate_in_PATH(const char *cmd)
+{
+ return path_lookup(cmd, 0);
+}
+
static const wchar_t *wcschrnul(const wchar_t *s, wchar_t c)
{
while (*s && *s != c)
@@ -1392,8 +1421,7 @@ static wchar_t *make_environment_block(char **deltaenv)
p += s;
}
- ALLOC_ARRAY(result, size);
- COPY_ARRAY(result, wenv, size);
+ DUP_ARRAY(result, wenv, size);
FreeEnvironmentStringsW(wenv);
return result;
}
@@ -1835,16 +1863,13 @@ static int try_shell_exec(const char *cmd, char *const *argv)
if (prog) {
int exec_id;
int argc = 0;
-#ifndef _MSC_VER
- const
-#endif
char **argv2;
while (argv[argc]) argc++;
ALLOC_ARRAY(argv2, argc + 1);
argv2[0] = (char *)cmd; /* full path to the script file */
COPY_ARRAY(&argv2[1], &argv[1], argc);
- exec_id = trace2_exec(prog, argv2);
- pid = mingw_spawnv(prog, argv2, 1);
+ exec_id = trace2_exec(prog, (const char **)argv2);
+ pid = mingw_spawnv(prog, (const char **)argv2, 1);
if (pid >= 0) {
int status;
if (waitpid(pid, &status, 0) < 0)
@@ -2670,7 +2695,46 @@ static PSID get_current_user_sid(void)
return result;
}
-int is_path_owned_by_current_sid(const char *path)
+static BOOL user_sid_to_user_name(PSID sid, LPSTR *str)
+{
+ SID_NAME_USE pe_use;
+ DWORD len_user = 0, len_domain = 0;
+ BOOL translate_sid_to_user;
+
+ /*
+ * returns only FALSE, because the string pointers are NULL
+ */
+ LookupAccountSidA(NULL, sid, NULL, &len_user, NULL, &len_domain,
+ &pe_use);
+ /*
+ * Alloc needed space of the strings
+ */
+ ALLOC_ARRAY((*str), (size_t)len_domain + (size_t)len_user);
+ translate_sid_to_user = LookupAccountSidA(NULL, sid,
+ (*str) + len_domain, &len_user, *str, &len_domain, &pe_use);
+ if (!translate_sid_to_user)
+ FREE_AND_NULL(*str);
+ else
+ (*str)[len_domain] = '/';
+ return translate_sid_to_user;
+}
+
+static int acls_supported(const char *path)
+{
+ size_t offset = offset_1st_component(path);
+ WCHAR wroot[MAX_PATH];
+ DWORD file_system_flags;
+
+ if (offset &&
+ xutftowcsn(wroot, path, MAX_PATH, offset) > 0 &&
+ GetVolumeInformationW(wroot, NULL, 0, NULL, NULL,
+ &file_system_flags, NULL, 0))
+ return !!(file_system_flags & FILE_PERSISTENT_ACLS);
+
+ return 0;
+}
+
+int is_path_owned_by_current_sid(const char *path, struct strbuf *report)
{
WCHAR wpath[MAX_PATH];
PSID sid = NULL;
@@ -2709,6 +2773,7 @@ int is_path_owned_by_current_sid(const char *path)
else if (sid && IsValidSid(sid)) {
/* Now, verify that the SID matches the current user's */
static PSID current_user_sid;
+ BOOL is_member;
if (!current_user_sid)
current_user_sid = get_current_user_sid();
@@ -2717,6 +2782,66 @@ int is_path_owned_by_current_sid(const char *path)
IsValidSid(current_user_sid) &&
EqualSid(sid, current_user_sid))
result = 1;
+ else if (IsWellKnownSid(sid, WinBuiltinAdministratorsSid) &&
+ CheckTokenMembership(NULL, sid, &is_member) &&
+ is_member)
+ /*
+ * If owned by the Administrators group, and the
+ * current user is an administrator, we consider that
+ * okay, too.
+ */
+ result = 1;
+ else if (report &&
+ IsWellKnownSid(sid, WinWorldSid) &&
+ !acls_supported(path)) {
+ /*
+ * On FAT32 volumes, ownership is not actually recorded.
+ */
+ strbuf_addf(report, "'%s' is on a file system that does "
+ "not record ownership\n", path);
+ } else if (report) {
+ LPSTR str1, str2, str3, str4, to_free1 = NULL,
+ to_free3 = NULL, to_local_free2 = NULL,
+ to_local_free4 = NULL;
+
+ if (user_sid_to_user_name(sid, &str1))
+ to_free1 = str1;
+ else
+ str1 = "(inconvertible)";
+ if (ConvertSidToStringSidA(sid, &str2))
+ to_local_free2 = str2;
+ else
+ str2 = "(inconvertible)";
+
+ if (!current_user_sid) {
+ str3 = "(none)";
+ str4 = "(none)";
+ }
+ else if (!IsValidSid(current_user_sid)) {
+ str3 = "(invalid)";
+ str4 = "(invalid)";
+ } else {
+ if (user_sid_to_user_name(current_user_sid,
+ &str3))
+ to_free3 = str3;
+ else
+ str3 = "(inconvertible)";
+ if (ConvertSidToStringSidA(current_user_sid,
+ &str4))
+ to_local_free4 = str4;
+ else
+ str4 = "(inconvertible)";
+ }
+ strbuf_addf(report,
+ "'%s' is owned by:\n"
+ "\t%s (%s)\nbut the current user is:\n"
+ "\t%s (%s)\n",
+ path, str1, str2, str3, str4);
+ free(to_free1);
+ LocalFree(to_local_free2);
+ free(to_free3);
+ LocalFree(to_local_free4);
+ }
}
/*
@@ -3033,3 +3158,22 @@ int uname(struct utsname *buf)
"%u", (v >> 16) & 0x7fff);
return 0;
}
+
+int mingw_have_unix_sockets(void)
+{
+ SC_HANDLE scm, srvc;
+ SERVICE_STATUS_PROCESS status;
+ DWORD bytes;
+ int ret = 0;
+ scm = OpenSCManagerA(NULL, NULL, SC_MANAGER_CONNECT);
+ if (scm) {
+ srvc = OpenServiceA(scm, "afunix", SERVICE_QUERY_STATUS);
+ if (srvc) {
+ if(QueryServiceStatusEx(srvc, SC_STATUS_PROCESS_INFO, (LPBYTE)&status, sizeof(SERVICE_STATUS_PROCESS), &bytes))
+ ret = status.dwCurrentState == SERVICE_RUNNING;
+ CloseServiceHandle(srvc);
+ }
+ CloseServiceHandle(scm);
+ }
+ return ret;
+}
diff --git a/compat/mingw.h b/compat/mingw.h
index a74da68..27b6128 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -11,7 +11,9 @@ typedef _sigset_t sigset_t;
#undef _POSIX_THREAD_SAFE_FUNCTIONS
#endif
-int mingw_core_config(const char *var, const char *value, void *cb);
+struct config_context;
+int mingw_core_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb);
#define platform_core_config mingw_core_config
/*
@@ -175,6 +177,9 @@ pid_t waitpid(pid_t pid, int *status, int options);
#define kill mingw_kill
int mingw_kill(pid_t pid, int sig);
+#define locate_in_PATH mingw_locate_in_PATH
+char *mingw_locate_in_PATH(const char *cmd);
+
#ifndef NO_OPENSSL
#include <openssl/ssl.h>
static inline int mingw_SSL_set_fd(SSL *ssl, int fd)
@@ -463,7 +468,7 @@ char *mingw_query_user_email(void);
* Verifies that the specified path is owned by the user running the
* current process.
*/
-int is_path_owned_by_current_sid(const char *path);
+int is_path_owned_by_current_sid(const char *path, struct strbuf *report);
#define is_path_owned_by_current_user is_path_owned_by_current_sid
/**
@@ -626,3 +631,9 @@ void open_in_gdb(void);
* Used by Pthread API implementation for Windows
*/
int err_win_to_posix(DWORD winerr);
+
+#ifndef NO_UNIX_SOCKETS
+int mingw_have_unix_sockets(void);
+#undef have_unix_sockets
+#define have_unix_sockets mingw_have_unix_sockets
+#endif
diff --git a/compat/nonblock.c b/compat/nonblock.c
new file mode 100644
index 0000000..5b51195
--- /dev/null
+++ b/compat/nonblock.c
@@ -0,0 +1,50 @@
+#include "git-compat-util.h"
+#include "nonblock.h"
+
+#ifdef O_NONBLOCK
+
+int enable_pipe_nonblock(int fd)
+{
+ int flags = fcntl(fd, F_GETFL);
+ if (flags < 0)
+ return -1;
+ flags |= O_NONBLOCK;
+ return fcntl(fd, F_SETFL, flags);
+}
+
+#elif defined(GIT_WINDOWS_NATIVE)
+
+#include "win32.h"
+
+int enable_pipe_nonblock(int fd)
+{
+ HANDLE h = (HANDLE)_get_osfhandle(fd);
+ DWORD mode;
+ DWORD type = GetFileType(h);
+ if (type == FILE_TYPE_UNKNOWN && GetLastError() != NO_ERROR) {
+ errno = EBADF;
+ return -1;
+ }
+ if (type != FILE_TYPE_PIPE)
+ BUG("unsupported file type: %lu", type);
+ if (!GetNamedPipeHandleState(h, &mode, NULL, NULL, NULL, NULL, 0)) {
+ errno = err_win_to_posix(GetLastError());
+ return -1;
+ }
+ mode |= PIPE_NOWAIT;
+ if (!SetNamedPipeHandleState(h, &mode, NULL, NULL)) {
+ errno = err_win_to_posix(GetLastError());
+ return -1;
+ }
+ return 0;
+}
+
+#else
+
+int enable_pipe_nonblock(int fd UNUSED)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+#endif
diff --git a/compat/nonblock.h b/compat/nonblock.h
new file mode 100644
index 0000000..af1a331
--- /dev/null
+++ b/compat/nonblock.h
@@ -0,0 +1,9 @@
+#ifndef COMPAT_NONBLOCK_H
+#define COMPAT_NONBLOCK_H
+
+/*
+ * Enable non-blocking I/O for the pipe specified by the passed-in descriptor.
+ */
+int enable_pipe_nonblock(int fd);
+
+#endif
diff --git a/compat/pread.c b/compat/pread.c
index 978cac4..484e6d4 100644
--- a/compat/pread.c
+++ b/compat/pread.c
@@ -1,4 +1,5 @@
#include "../git-compat-util.h"
+#include "../wrapper.h"
ssize_t git_pread(int fd, void *buf, size_t count, off_t offset)
{
diff --git a/compat/precompose_utf8.c b/compat/precompose_utf8.c
index cce1d57..0bd5c24 100644
--- a/compat/precompose_utf8.c
+++ b/compat/precompose_utf8.c
@@ -5,8 +5,12 @@
#define PRECOMPOSE_UNICODE_C
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "path.h"
+#include "strbuf.h"
#include "utf8.h"
#include "precompose_utf8.h"
diff --git a/compat/regcomp_enhanced.c b/compat/regcomp_enhanced.c
new file mode 100644
index 0000000..84193ce
--- /dev/null
+++ b/compat/regcomp_enhanced.c
@@ -0,0 +1,9 @@
+#include "../git-compat-util.h"
+#undef regcomp
+
+int git_regcomp(regex_t *preg, const char *pattern, int cflags)
+{
+ if (!(cflags & REG_EXTENDED))
+ cflags |= REG_ENHANCED;
+ return regcomp(preg, pattern, cflags);
+}
diff --git a/compat/sha1-chunked.c b/compat/sha1-chunked.c
index 6adfcfd..a4a6f93 100644
--- a/compat/sha1-chunked.c
+++ b/compat/sha1-chunked.c
@@ -1,4 +1,5 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "hash-ll.h"
int git_SHA1_Update_Chunked(platform_SHA_CTX *c, const void *data, size_t len)
{
diff --git a/compat/simple-ipc/ipc-shared.c b/compat/simple-ipc/ipc-shared.c
index 1b9d359..cb176d9 100644
--- a/compat/simple-ipc/ipc-shared.c
+++ b/compat/simple-ipc/ipc-shared.c
@@ -1,8 +1,5 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "simple-ipc.h"
-#include "strbuf.h"
-#include "pkt-line.h"
-#include "thread-utils.h"
#ifndef SUPPORTS_SIMPLE_IPC
/*
diff --git a/compat/simple-ipc/ipc-unix-socket.c b/compat/simple-ipc/ipc-unix-socket.c
index 28a7928..9b3f2cd 100644
--- a/compat/simple-ipc/ipc-unix-socket.c
+++ b/compat/simple-ipc/ipc-unix-socket.c
@@ -1,8 +1,9 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "gettext.h"
#include "simple-ipc.h"
#include "strbuf.h"
-#include "pkt-line.h"
#include "thread-utils.h"
+#include "trace2.h"
#include "unix-socket.h"
#include "unix-stream-server.h"
diff --git a/compat/simple-ipc/ipc-win32.c b/compat/simple-ipc/ipc-win32.c
index 20ea7b6..8bfe512 100644
--- a/compat/simple-ipc/ipc-win32.c
+++ b/compat/simple-ipc/ipc-win32.c
@@ -1,8 +1,12 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "gettext.h"
#include "simple-ipc.h"
#include "strbuf.h"
#include "pkt-line.h"
#include "thread-utils.h"
+#include "trace.h"
+#include "trace2.h"
#include "accctrl.h"
#include "aclapi.h"
diff --git a/compat/terminal.c b/compat/terminal.c
index 7db330c..0afda73 100644
--- a/compat/terminal.c
+++ b/compat/terminal.c
@@ -1,5 +1,6 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "compat/terminal.h"
+#include "gettext.h"
#include "sigchain.h"
#include "strbuf.h"
#include "run-command.h"
@@ -477,11 +478,14 @@ struct escape_sequence_entry {
char sequence[FLEX_ARRAY];
};
-static int sequence_entry_cmp(const void *hashmap_cmp_fn_data,
- const struct escape_sequence_entry *e1,
- const struct escape_sequence_entry *e2,
+static int sequence_entry_cmp(const void *hashmap_cmp_fn_data UNUSED,
+ const struct hashmap_entry *he1,
+ const struct hashmap_entry *he2,
const void *keydata)
{
+ const struct escape_sequence_entry
+ *e1 = container_of(he1, const struct escape_sequence_entry, entry),
+ *e2 = container_of(he2, const struct escape_sequence_entry, entry);
return strcmp(e1->sequence, keydata ? keydata : e2->sequence);
}
@@ -495,8 +499,7 @@ static int is_known_escape_sequence(const char *sequence)
struct strbuf buf = STRBUF_INIT;
char *p, *eol;
- hashmap_init(&sequences, (hashmap_cmp_fn)sequence_entry_cmp,
- NULL, 0);
+ hashmap_init(&sequences, sequence_entry_cmp, NULL, 0);
strvec_pushl(&cp.args, "infocmp", "-L", "-1", NULL);
if (pipe_command(&cp, NULL, 0, &buf, 0, NULL, 0))
diff --git a/compat/win32/headless.c b/compat/win32/headless.c
new file mode 100644
index 0000000..8b00dfe
--- /dev/null
+++ b/compat/win32/headless.c
@@ -0,0 +1,115 @@
+/*
+ * headless Git - run Git without opening a console window on Windows
+ */
+
+#define STRICT
+#define WIN32_LEAN_AND_MEAN
+#define UNICODE
+#define _UNICODE
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <wchar.h>
+
+/*
+ * If `dir` contains the path to a Git exec directory, extend `PATH` to
+ * include the corresponding `bin/` directory (which is where all those
+ * `.dll` files needed by `git.exe` are, on Windows).
+ */
+static int extend_path(wchar_t *dir, size_t dir_len)
+{
+ const wchar_t *suffix = L"\\libexec\\git-core";
+ size_t suffix_len = wcslen(suffix);
+ wchar_t *env;
+ DWORD len;
+
+ if (dir_len < suffix_len)
+ return 0;
+
+ dir_len -= suffix_len;
+ if (memcmp(dir + dir_len, suffix, suffix_len * sizeof(wchar_t)))
+ return 0;
+
+ len = GetEnvironmentVariableW(L"PATH", NULL, 0);
+ if (!len)
+ return 0;
+
+ env = _alloca((dir_len + 5 + len) * sizeof(wchar_t));
+ wcsncpy(env, dir, dir_len);
+ wcscpy(env + dir_len, L"\\bin;");
+ if (!GetEnvironmentVariableW(L"PATH", env + dir_len + 5, len))
+ return 0;
+
+ SetEnvironmentVariableW(L"PATH", env);
+ return 1;
+}
+
+int WINAPI wWinMain(_In_ HINSTANCE instance,
+ _In_opt_ HINSTANCE previous_instance,
+ _In_ LPWSTR command_line, _In_ int show)
+{
+ wchar_t git_command_line[32768];
+ size_t size = sizeof(git_command_line) / sizeof(wchar_t);
+ const wchar_t *needs_quotes = L"";
+ int slash = 0, i;
+
+ STARTUPINFO startup_info = {
+ .cb = sizeof(STARTUPINFO),
+ .dwFlags = STARTF_USESHOWWINDOW,
+ .wShowWindow = SW_HIDE,
+ };
+ PROCESS_INFORMATION process_info = { 0 };
+ DWORD creation_flags = CREATE_UNICODE_ENVIRONMENT |
+ CREATE_NEW_CONSOLE | CREATE_NO_WINDOW;
+ DWORD exit_code;
+
+ /* First, determine the full path of argv[0] */
+ for (i = 0; _wpgmptr[i]; i++)
+ if (_wpgmptr[i] == L' ')
+ needs_quotes = L"\"";
+ else if (_wpgmptr[i] == L'\\')
+ slash = i;
+
+ if (slash >= size - 11)
+ return 127; /* Too long path */
+
+ /* If it is in Git's exec path, add the bin/ directory to the PATH */
+ extend_path(_wpgmptr, slash);
+
+ /* Then, add the full path of `git.exe` as argv[0] */
+ i = swprintf_s(git_command_line, size, L"%ls%.*ls\\git.exe%ls",
+ needs_quotes, slash, _wpgmptr, needs_quotes);
+ if (i < 0)
+ return 127; /* Too long path */
+
+ if (*command_line) {
+ /* Now, append the command-line arguments */
+ i = swprintf_s(git_command_line + i, size - i,
+ L" %ls", command_line);
+ if (i < 0)
+ return 127;
+ }
+
+ startup_info.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
+ startup_info.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
+ startup_info.hStdError = GetStdHandle(STD_ERROR_HANDLE);
+
+ if (!CreateProcess(NULL, /* infer argv[0] from the command line */
+ git_command_line, /* modified command line */
+ NULL, /* inherit process handles? */
+ NULL, /* inherit thread handles? */
+ FALSE, /* handles inheritable? */
+ creation_flags,
+ NULL, /* use this process' environment */
+ NULL, /* use this process' working directory */
+ &startup_info, &process_info))
+ return 129; /* could not start */
+ WaitForSingleObject(process_info.hProcess, INFINITE);
+ if (!GetExitCodeProcess(process_info.hProcess, &exit_code))
+ exit_code = 130; /* Could not determine exit code? */
+
+ CloseHandle(process_info.hProcess);
+ CloseHandle(process_info.hThread);
+
+ return (int)exit_code;
+}
diff --git a/compat/win32/pthread.c b/compat/win32/pthread.c
index 2e7eead..85f8f79 100644
--- a/compat/win32/pthread.c
+++ b/compat/win32/pthread.c
@@ -22,12 +22,12 @@ static unsigned __stdcall win32_start_routine(void *arg)
}
int pthread_create(pthread_t *thread, const void *unused,
- void *(*start_routine)(void*), void *arg)
+ void *(*start_routine)(void *), void *arg)
{
thread->arg = arg;
thread->start_routine = start_routine;
- thread->handle = (HANDLE)
- _beginthreadex(NULL, 0, win32_start_routine, thread, 0, NULL);
+ thread->handle = (HANDLE)_beginthreadex(NULL, 0, win32_start_routine,
+ thread, 0, NULL);
if (!thread->handle)
return errno;
@@ -39,14 +39,17 @@ int win32_pthread_join(pthread_t *thread, void **value_ptr)
{
DWORD result = WaitForSingleObject(thread->handle, INFINITE);
switch (result) {
- case WAIT_OBJECT_0:
- if (value_ptr)
- *value_ptr = thread->arg;
- return 0;
- case WAIT_ABANDONED:
- return EINVAL;
- default:
- return err_win_to_posix(GetLastError());
+ case WAIT_OBJECT_0:
+ if (value_ptr)
+ *value_ptr = thread->arg;
+ CloseHandle(thread->handle);
+ return 0;
+ case WAIT_ABANDONED:
+ CloseHandle(thread->handle);
+ return EINVAL;
+ default:
+ /* the wait failed, so do not detach */
+ return err_win_to_posix(GetLastError());
}
}
diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h
index 737983d..cc3221c 100644
--- a/compat/win32/pthread.h
+++ b/compat/win32/pthread.h
@@ -66,7 +66,7 @@ pthread_t pthread_self(void);
static inline void NORETURN pthread_exit(void *ret)
{
- ExitThread((DWORD)(intptr_t)ret);
+ _endthreadex((unsigned)(uintptr_t)ret);
}
typedef DWORD pthread_key_t;
diff --git a/compat/win32/trace2_win32_process_info.c b/compat/win32/trace2_win32_process_info.c
index a53fd92..3ef0936 100644
--- a/compat/win32/trace2_win32_process_info.c
+++ b/compat/win32/trace2_win32_process_info.c
@@ -1,8 +1,10 @@
-#include "../../cache.h"
+#include "../../git-compat-util.h"
#include "../../json-writer.h"
+#include "../../repository.h"
+#include "../../trace2.h"
#include "lazyload.h"
-#include <Psapi.h>
-#include <tlHelp32.h>
+#include <psapi.h>
+#include <tlhelp32.h>
/*
* An arbitrarily chosen value to limit the size of the ancestor
diff --git a/compat/winansi.c b/compat/winansi.c
index 3abe8dd..f83610f 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -644,7 +644,7 @@ void winansi_init(void)
/* start console spool thread on the pipe's read end */
hthread = CreateThread(NULL, 0, console_thread, NULL, 0, NULL);
- if (hthread == INVALID_HANDLE_VALUE)
+ if (!hthread)
die_lasterr("CreateThread(console_thread) failed");
/* schedule cleanup routine */
diff --git a/config.c b/config.c
index 9b0e9c9..ae3652b 100644
--- a/config.c
+++ b/config.c
@@ -5,24 +5,39 @@
* Copyright (C) Johannes Schindelin, 2005
*
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "advice.h"
#include "date.h"
#include "branch.h"
#include "config.h"
+#include "parse.h"
+#include "convert.h"
#include "environment.h"
+#include "gettext.h"
+#include "ident.h"
#include "repository.h"
#include "lockfile.h"
+#include "mailmap.h"
+#include "attr.h"
#include "exec-cmd.h"
#include "strbuf.h"
#include "quote.h"
#include "hashmap.h"
#include "string-list.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "pager.h"
+#include "path.h"
#include "utf8.h"
-#include "dir.h"
#include "color.h"
#include "refs.h"
-#include "worktree.h"
+#include "setup.h"
+#include "strvec.h"
+#include "trace2.h"
+#include "wildmatch.h"
+#include "ws.h"
+#include "write-or-die.h"
struct config_source {
struct config_source *prev;
@@ -49,37 +64,21 @@ struct config_source {
int (*do_ungetc)(int c, struct config_source *conf);
long (*do_ftell)(struct config_source *c);
};
+#define CONFIG_SOURCE_INIT { 0 }
-/*
- * These variables record the "current" config source, which
- * can be accessed by parsing callbacks.
- *
- * The "cf" variable will be non-NULL only when we are actually parsing a real
- * config source (file, blob, cmdline, etc).
- *
- * The "current_config_kvi" variable will be non-NULL only when we are feeding
- * cached config from a configset into a callback.
- *
- * They should generally never be non-NULL at the same time. If they are both
- * NULL, then we aren't parsing anything (and depending on the function looking
- * at the variables, it's either a bug for it to be called in the first place,
- * or it's a function which can be reused for non-config purposes, and should
- * fall back to some sane behavior).
- */
-static struct config_source *cf;
-static struct key_value_info *current_config_kvi;
+static int pack_compression_seen;
+static int zlib_compression_seen;
/*
- * Similar to the variables above, this gives access to the "scope" of the
- * current value (repo, global, etc). For cached values, it can be found via
- * the current_config_kvi as above. During parsing, the current value can be
- * found in this variable. It's not part of "cf" because it transcends a single
- * file (i.e., a file included from .git/config is still in "repo" scope).
+ * Config that comes from trusted scopes, namely:
+ * - CONFIG_SCOPE_SYSTEM (e.g. /etc/gitconfig)
+ * - CONFIG_SCOPE_GLOBAL (e.g. $HOME/.gitconfig, $XDG_CONFIG_HOME/git)
+ * - CONFIG_SCOPE_COMMAND (e.g. "-c" option, environment variables)
+ *
+ * This is declared here for code cleanliness, but unlike the other
+ * static variables, this does not hold config parser state.
*/
-static enum config_scope current_parsing_scope;
-
-static int pack_compression_seen;
-static int zlib_compression_seen;
+static struct config_set protected_config;
static int config_file_fgetc(struct config_source *conf)
{
@@ -96,7 +95,6 @@ static long config_file_ftell(struct config_source *conf)
return ftell(conf->u.file);
}
-
static int config_buf_fgetc(struct config_source *conf)
{
if (conf->u.buf.pos < conf->u.buf.len)
@@ -128,6 +126,7 @@ struct config_include_data {
void *data;
const struct config_options *opts;
struct git_config_source *config_source;
+ struct repository *repo;
/*
* All remote URLs discovered when reading all config files.
@@ -136,7 +135,8 @@ struct config_include_data {
};
#define CONFIG_INCLUDE_INIT { 0 }
-static int git_config_include(const char *var, const char *value, void *data);
+static int git_config_include(const char *var, const char *value,
+ const struct config_context *ctx, void *data);
#define MAX_INCLUDE_DEPTH 10
static const char include_depth_advice[] = N_(
@@ -145,7 +145,9 @@ static const char include_depth_advice[] = N_(
"from\n"
" %s\n"
"This might be due to circular includes.");
-static int handle_path_include(const char *path, struct config_include_data *inc)
+static int handle_path_include(const struct key_value_info *kvi,
+ const char *path,
+ struct config_include_data *inc)
{
int ret = 0;
struct strbuf buf = STRBUF_INIT;
@@ -166,14 +168,14 @@ static int handle_path_include(const char *path, struct config_include_data *inc
if (!is_absolute_path(path)) {
char *slash;
- if (!cf || !cf->path) {
+ if (!kvi || !kvi->path) {
ret = error(_("relative config includes must come from files"));
goto cleanup;
}
- slash = find_last_dir_sep(cf->path);
+ slash = find_last_dir_sep(kvi->path);
if (slash)
- strbuf_add(&buf, cf->path, slash - cf->path + 1);
+ strbuf_add(&buf, kvi->path, slash - kvi->path + 1);
strbuf_addstr(&buf, path);
path = buf.buf;
}
@@ -181,10 +183,11 @@ static int handle_path_include(const char *path, struct config_include_data *inc
if (!access_or_die(path, R_OK, 0)) {
if (++inc->depth > MAX_INCLUDE_DEPTH)
die(_(include_depth_advice), MAX_INCLUDE_DEPTH, path,
- !cf ? "<unknown>" :
- cf->name ? cf->name :
+ !kvi ? "<unknown>" :
+ kvi->filename ? kvi->filename :
"the command line");
- ret = git_config_from_file(git_config_include, path, inc);
+ ret = git_config_from_file_with_options(git_config_include, path, inc,
+ kvi->scope, NULL);
inc->depth--;
}
cleanup:
@@ -199,7 +202,8 @@ static void add_trailing_starstar_for_dir(struct strbuf *pat)
strbuf_addstr(pat, "**");
}
-static int prepare_include_condition_pattern(struct strbuf *pat)
+static int prepare_include_condition_pattern(const struct key_value_info *kvi,
+ struct strbuf *pat)
{
struct strbuf path = STRBUF_INIT;
char *expanded;
@@ -215,11 +219,11 @@ static int prepare_include_condition_pattern(struct strbuf *pat)
if (pat->buf[0] == '.' && is_dir_sep(pat->buf[1])) {
const char *slash;
- if (!cf || !cf->path)
+ if (!kvi || !kvi->path)
return error(_("relative config include "
"conditionals must come from files"));
- strbuf_realpath(&path, cf->path, 1);
+ strbuf_realpath(&path, kvi->path, 1);
slash = find_last_dir_sep(path.buf);
if (!slash)
BUG("how is this possible?");
@@ -234,7 +238,8 @@ static int prepare_include_condition_pattern(struct strbuf *pat)
return prefix;
}
-static int include_by_gitdir(const struct config_options *opts,
+static int include_by_gitdir(const struct key_value_info *kvi,
+ const struct config_options *opts,
const char *cond, size_t cond_len, int icase)
{
struct strbuf text = STRBUF_INIT;
@@ -250,7 +255,7 @@ static int include_by_gitdir(const struct config_options *opts,
strbuf_realpath(&text, git_dir, 1);
strbuf_add(&pattern, cond, cond_len);
- prefix = prepare_include_condition_pattern(&pattern);
+ prefix = prepare_include_condition_pattern(kvi, &pattern);
again:
if (prefix < 0)
@@ -312,7 +317,8 @@ static int include_by_branch(const char *cond, size_t cond_len)
return ret;
}
-static int add_remote_url(const char *var, const char *value, void *data)
+static int add_remote_url(const char *var, const char *value,
+ const struct config_context *ctx UNUSED, void *data)
{
struct string_list *remote_urls = data;
const char *remote_name;
@@ -331,27 +337,18 @@ static void populate_remote_urls(struct config_include_data *inc)
{
struct config_options opts;
- struct config_source *store_cf = cf;
- struct key_value_info *store_kvi = current_config_kvi;
- enum config_scope store_scope = current_parsing_scope;
-
opts = *inc->opts;
opts.unconditional_remote_url = 1;
- cf = NULL;
- current_config_kvi = NULL;
- current_parsing_scope = 0;
-
inc->remote_urls = xmalloc(sizeof(*inc->remote_urls));
string_list_init_dup(inc->remote_urls);
- config_with_options(add_remote_url, inc->remote_urls, inc->config_source, &opts);
-
- cf = store_cf;
- current_config_kvi = store_kvi;
- current_parsing_scope = store_scope;
+ config_with_options(add_remote_url, inc->remote_urls,
+ inc->config_source, inc->repo, &opts);
}
-static int forbid_remote_url(const char *var, const char *value, void *data)
+static int forbid_remote_url(const char *var, const char *value UNUSED,
+ const struct config_context *ctx UNUSED,
+ void *data UNUSED)
{
const char *remote_name;
size_t remote_name_len;
@@ -394,15 +391,16 @@ static int include_by_remote_url(struct config_include_data *inc,
inc->remote_urls);
}
-static int include_condition_is_true(struct config_include_data *inc,
+static int include_condition_is_true(const struct key_value_info *kvi,
+ struct config_include_data *inc,
const char *cond, size_t cond_len)
{
const struct config_options *opts = inc->opts;
if (skip_prefix_mem(cond, cond_len, "gitdir:", &cond, &cond_len))
- return include_by_gitdir(opts, cond, cond_len, 0);
+ return include_by_gitdir(kvi, opts, cond, cond_len, 0);
else if (skip_prefix_mem(cond, cond_len, "gitdir/i:", &cond, &cond_len))
- return include_by_gitdir(opts, cond, cond_len, 1);
+ return include_by_gitdir(kvi, opts, cond, cond_len, 1);
else if (skip_prefix_mem(cond, cond_len, "onbranch:", &cond, &cond_len))
return include_by_branch(cond, cond_len);
else if (skip_prefix_mem(cond, cond_len, "hasconfig:remote.*.url:", &cond,
@@ -413,7 +411,9 @@ static int include_condition_is_true(struct config_include_data *inc,
return 0;
}
-static int git_config_include(const char *var, const char *value, void *data)
+static int git_config_include(const char *var, const char *value,
+ const struct config_context *ctx,
+ void *data)
{
struct config_include_data *inc = data;
const char *cond, *key;
@@ -424,21 +424,21 @@ static int git_config_include(const char *var, const char *value, void *data)
* Pass along all values, including "include" directives; this makes it
* possible to query information on the includes themselves.
*/
- ret = inc->fn(var, value, inc->data);
+ ret = inc->fn(var, value, ctx, inc->data);
if (ret < 0)
return ret;
if (!strcmp(var, "include.path"))
- ret = handle_path_include(value, inc);
+ ret = handle_path_include(ctx->kvi, value, inc);
if (!parse_config_key(var, "includeif", &cond, &cond_len, &key) &&
- cond && include_condition_is_true(inc, cond, cond_len) &&
+ cond && include_condition_is_true(ctx->kvi, inc, cond, cond_len) &&
!strcmp(key, "path")) {
config_fn_t old_fn = inc->fn;
if (inc->opts->unconditional_remote_url)
inc->fn = forbid_remote_url;
- ret = handle_path_include(value, inc);
+ ret = handle_path_include(ctx->kvi, value, inc);
inc->fn = old_fn;
}
@@ -596,27 +596,45 @@ out_free_ret_1:
}
static int config_parse_pair(const char *key, const char *value,
- config_fn_t fn, void *data)
+ struct key_value_info *kvi,
+ config_fn_t fn, void *data)
{
char *canonical_name;
int ret;
+ struct config_context ctx = {
+ .kvi = kvi,
+ };
if (!strlen(key))
return error(_("empty config key"));
if (git_config_parse_key(key, &canonical_name, NULL))
return -1;
- ret = (fn(canonical_name, value, data) < 0) ? -1 : 0;
+ ret = (fn(canonical_name, value, &ctx, data) < 0) ? -1 : 0;
free(canonical_name);
return ret;
}
+
+/* for values read from `git_config_from_parameters()` */
+void kvi_from_param(struct key_value_info *out)
+{
+ out->filename = NULL;
+ out->linenr = -1;
+ out->origin_type = CONFIG_ORIGIN_CMDLINE;
+ out->scope = CONFIG_SCOPE_COMMAND;
+ out->path = NULL;
+}
+
int git_config_parse_parameter(const char *text,
config_fn_t fn, void *data)
{
const char *value;
struct strbuf **pair;
int ret;
+ struct key_value_info kvi = KVI_INIT;
+
+ kvi_from_param(&kvi);
pair = strbuf_split_str(text, '=', 2);
if (!pair[0])
@@ -635,12 +653,13 @@ int git_config_parse_parameter(const char *text,
return error(_("bogus config parameter: %s"), text);
}
- ret = config_parse_pair(pair[0]->buf, value, fn, data);
+ ret = config_parse_pair(pair[0]->buf, value, &kvi, fn, data);
strbuf_list_free(pair);
return ret;
}
-static int parse_config_env_list(char *env, config_fn_t fn, void *data)
+static int parse_config_env_list(char *env, struct key_value_info *kvi,
+ config_fn_t fn, void *data)
{
char *cur = env;
while (cur && *cur) {
@@ -674,7 +693,7 @@ static int parse_config_env_list(char *env, config_fn_t fn, void *data)
CONFIG_DATA_ENVIRONMENT);
}
- if (config_parse_pair(key, value, fn, data) < 0)
+ if (config_parse_pair(key, value, kvi, fn, data) < 0)
return -1;
}
else {
@@ -698,13 +717,9 @@ int git_config_from_parameters(config_fn_t fn, void *data)
struct strvec to_free = STRVEC_INIT;
int ret = 0;
char *envw = NULL;
- struct config_source source;
-
- memset(&source, 0, sizeof(source));
- source.prev = cf;
- source.origin_type = CONFIG_ORIGIN_CMDLINE;
- cf = &source;
+ struct key_value_info kvi = KVI_INIT;
+ kvi_from_param(&kvi);
env = getenv(CONFIG_COUNT_ENVIRONMENT);
if (env) {
unsigned long count;
@@ -740,7 +755,7 @@ int git_config_from_parameters(config_fn_t fn, void *data)
}
strbuf_reset(&envvar);
- if (config_parse_pair(key, value, fn, data) < 0) {
+ if (config_parse_pair(key, value, &kvi, fn, data) < 0) {
ret = -1;
goto out;
}
@@ -751,7 +766,7 @@ int git_config_from_parameters(config_fn_t fn, void *data)
if (env) {
/* sq_dequote will write over it */
envw = xstrdup(env);
- if (parse_config_env_list(envw, fn, data) < 0) {
+ if (parse_config_env_list(envw, &kvi, fn, data) < 0) {
ret = -1;
goto out;
}
@@ -761,25 +776,24 @@ out:
strbuf_release(&envvar);
strvec_clear(&to_free);
free(envw);
- cf = source.prev;
return ret;
}
-static int get_next_char(void)
+static int get_next_char(struct config_source *cs)
{
- int c = cf->do_fgetc(cf);
+ int c = cs->do_fgetc(cs);
if (c == '\r') {
/* DOS like systems */
- c = cf->do_fgetc(cf);
+ c = cs->do_fgetc(cs);
if (c != '\n') {
if (c != EOF)
- cf->do_ungetc(c, cf);
+ cs->do_ungetc(c, cs);
c = '\r';
}
}
- if (c != EOF && ++cf->total_len > INT_MAX) {
+ if (c != EOF && ++cs->total_len > INT_MAX) {
/*
* This is an absurdly long config file; refuse to parse
* further in order to protect downstream code from integer
@@ -787,39 +801,44 @@ static int get_next_char(void)
* but we can mark EOF and put trash in the return value,
* which will trigger a parse error.
*/
- cf->eof = 1;
+ cs->eof = 1;
return 0;
}
if (c == '\n')
- cf->linenr++;
+ cs->linenr++;
if (c == EOF) {
- cf->eof = 1;
- cf->linenr++;
+ cs->eof = 1;
+ cs->linenr++;
c = '\n';
}
return c;
}
-static char *parse_value(void)
+static char *parse_value(struct config_source *cs)
{
- int quote = 0, comment = 0, space = 0;
+ int quote = 0, comment = 0;
+ size_t trim_len = 0;
- strbuf_reset(&cf->value);
+ strbuf_reset(&cs->value);
for (;;) {
- int c = get_next_char();
+ int c = get_next_char(cs);
if (c == '\n') {
if (quote) {
- cf->linenr--;
+ cs->linenr--;
return NULL;
}
- return cf->value.buf;
+ if (trim_len)
+ strbuf_setlen(&cs->value, trim_len);
+ return cs->value.buf;
}
if (comment)
continue;
if (isspace(c) && !quote) {
- if (cf->value.len)
- space++;
+ if (!trim_len)
+ trim_len = cs->value.len;
+ if (cs->value.len)
+ strbuf_addch(&cs->value, c);
continue;
}
if (!quote) {
@@ -828,10 +847,10 @@ static char *parse_value(void)
continue;
}
}
- for (; space; space--)
- strbuf_addch(&cf->value, ' ');
+ if (trim_len)
+ trim_len = 0;
if (c == '\\') {
- c = get_next_char();
+ c = get_next_char(cs);
switch (c) {
case '\n':
continue;
@@ -851,27 +870,31 @@ static char *parse_value(void)
default:
return NULL;
}
- strbuf_addch(&cf->value, c);
+ strbuf_addch(&cs->value, c);
continue;
}
if (c == '"') {
- quote = 1-quote;
+ quote = 1 - quote;
continue;
}
- strbuf_addch(&cf->value, c);
+ strbuf_addch(&cs->value, c);
}
}
-static int get_value(config_fn_t fn, void *data, struct strbuf *name)
+static int get_value(struct config_source *cs, struct key_value_info *kvi,
+ config_fn_t fn, void *data, struct strbuf *name)
{
int c;
char *value;
int ret;
+ struct config_context ctx = {
+ .kvi = kvi,
+ };
/* Get the full name */
for (;;) {
- c = get_next_char();
- if (cf->eof)
+ c = get_next_char(cs);
+ if (cs->eof)
break;
if (!iskeychar(c))
break;
@@ -879,13 +902,13 @@ static int get_value(config_fn_t fn, void *data, struct strbuf *name)
}
while (c == ' ' || c == '\t')
- c = get_next_char();
+ c = get_next_char(cs);
value = NULL;
if (c != '\n') {
if (c != '=')
return -1;
- value = parse_value();
+ value = parse_value(cs);
if (!value)
return -1;
}
@@ -894,20 +917,22 @@ static int get_value(config_fn_t fn, void *data, struct strbuf *name)
* the line we just parsed during the call to fn to get
* accurate line number in error messages.
*/
- cf->linenr--;
- ret = fn(name->buf, value, data);
+ cs->linenr--;
+ kvi->linenr = cs->linenr;
+ ret = fn(name->buf, value, &ctx, data);
if (ret >= 0)
- cf->linenr++;
+ cs->linenr++;
return ret;
}
-static int get_extended_base_var(struct strbuf *name, int c)
+static int get_extended_base_var(struct config_source *cs, struct strbuf *name,
+ int c)
{
- cf->subsection_case_sensitive = 0;
+ cs->subsection_case_sensitive = 0;
do {
if (c == '\n')
goto error_incomplete_line;
- c = get_next_char();
+ c = get_next_char(cs);
} while (isspace(c));
/* We require the format to be '[base "extension"]' */
@@ -916,13 +941,13 @@ static int get_extended_base_var(struct strbuf *name, int c)
strbuf_addch(name, '.');
for (;;) {
- int c = get_next_char();
+ int c = get_next_char(cs);
if (c == '\n')
goto error_incomplete_line;
if (c == '"')
break;
if (c == '\\') {
- c = get_next_char();
+ c = get_next_char(cs);
if (c == '\n')
goto error_incomplete_line;
}
@@ -930,25 +955,25 @@ static int get_extended_base_var(struct strbuf *name, int c)
}
/* Final ']' */
- if (get_next_char() != ']')
+ if (get_next_char(cs) != ']')
return -1;
return 0;
error_incomplete_line:
- cf->linenr--;
+ cs->linenr--;
return -1;
}
-static int get_base_var(struct strbuf *name)
+static int get_base_var(struct config_source *cs, struct strbuf *name)
{
- cf->subsection_case_sensitive = 1;
+ cs->subsection_case_sensitive = 1;
for (;;) {
- int c = get_next_char();
- if (cf->eof)
+ int c = get_next_char(cs);
+ if (cs->eof)
return -1;
if (c == ']')
return 0;
if (isspace(c))
- return get_extended_base_var(name, c);
+ return get_extended_base_var(cs, name, c);
if (!iskeychar(c) && c != '.')
return -1;
strbuf_addch(name, tolower(c));
@@ -961,7 +986,8 @@ struct parse_event_data {
const struct config_options *opts;
};
-static int do_event(enum config_event_t type, struct parse_event_data *data)
+static int do_event(struct config_source *cs, enum config_event_t type,
+ struct parse_event_data *data)
{
size_t offset;
@@ -972,7 +998,7 @@ static int do_event(enum config_event_t type, struct parse_event_data *data)
data->previous_type == type)
return 0;
- offset = cf->do_ftell(cf);
+ offset = cs->do_ftell(cs);
/*
* At EOF, the parser always "inserts" an extra '\n', therefore
* the end offset of the event is the current file position, otherwise
@@ -983,7 +1009,7 @@ static int do_event(enum config_event_t type, struct parse_event_data *data)
if (data->previous_type != CONFIG_EVENT_EOF &&
data->opts->event_fn(data->previous_type, data->previous_offset,
- offset, data->opts->event_fn_data) < 0)
+ offset, cs, data->opts->event_fn_data) < 0)
return -1;
data->previous_type = type;
@@ -992,12 +1018,24 @@ static int do_event(enum config_event_t type, struct parse_event_data *data)
return 0;
}
-static int git_parse_source(config_fn_t fn, void *data,
+static void kvi_from_source(struct config_source *cs,
+ enum config_scope scope,
+ struct key_value_info *out)
+{
+ out->filename = strintern(cs->name);
+ out->origin_type = cs->origin_type;
+ out->linenr = cs->linenr;
+ out->scope = scope;
+ out->path = cs->path;
+}
+
+static int git_parse_source(struct config_source *cs, config_fn_t fn,
+ struct key_value_info *kvi, void *data,
const struct config_options *opts)
{
int comment = 0;
size_t baselen = 0;
- struct strbuf *var = &cf->var;
+ struct strbuf *var = &cs->var;
int error_return = 0;
char *error_msg = NULL;
@@ -1012,7 +1050,7 @@ static int git_parse_source(config_fn_t fn, void *data,
for (;;) {
int c;
- c = get_next_char();
+ c = get_next_char(cs);
if (bomptr && *bomptr) {
/* We are at the file beginning; skip UTF8-encoded BOM
* if present. Sane editors won't put this in on their
@@ -1029,12 +1067,12 @@ static int git_parse_source(config_fn_t fn, void *data,
}
}
if (c == '\n') {
- if (cf->eof) {
- if (do_event(CONFIG_EVENT_EOF, &event_data) < 0)
+ if (cs->eof) {
+ if (do_event(cs, CONFIG_EVENT_EOF, &event_data) < 0)
return -1;
return 0;
}
- if (do_event(CONFIG_EVENT_WHITESPACE, &event_data) < 0)
+ if (do_event(cs, CONFIG_EVENT_WHITESPACE, &event_data) < 0)
return -1;
comment = 0;
continue;
@@ -1042,23 +1080,23 @@ static int git_parse_source(config_fn_t fn, void *data,
if (comment)
continue;
if (isspace(c)) {
- if (do_event(CONFIG_EVENT_WHITESPACE, &event_data) < 0)
+ if (do_event(cs, CONFIG_EVENT_WHITESPACE, &event_data) < 0)
return -1;
continue;
}
if (c == '#' || c == ';') {
- if (do_event(CONFIG_EVENT_COMMENT, &event_data) < 0)
+ if (do_event(cs, CONFIG_EVENT_COMMENT, &event_data) < 0)
return -1;
comment = 1;
continue;
}
if (c == '[') {
- if (do_event(CONFIG_EVENT_SECTION, &event_data) < 0)
+ if (do_event(cs, CONFIG_EVENT_SECTION, &event_data) < 0)
return -1;
/* Reset prior to determining a new stem */
strbuf_reset(var);
- if (get_base_var(var) < 0 || var->len < 1)
+ if (get_base_var(cs, var) < 0 || var->len < 1)
break;
strbuf_addch(var, '.');
baselen = var->len;
@@ -1067,7 +1105,7 @@ static int git_parse_source(config_fn_t fn, void *data,
if (!isalpha(c))
break;
- if (do_event(CONFIG_EVENT_ENTRY, &event_data) < 0)
+ if (do_event(cs, CONFIG_EVENT_ENTRY, &event_data) < 0)
return -1;
/*
@@ -1077,42 +1115,42 @@ static int git_parse_source(config_fn_t fn, void *data,
*/
strbuf_setlen(var, baselen);
strbuf_addch(var, tolower(c));
- if (get_value(fn, data, var) < 0)
+ if (get_value(cs, kvi, fn, data, var) < 0)
break;
}
- if (do_event(CONFIG_EVENT_ERROR, &event_data) < 0)
+ if (do_event(cs, CONFIG_EVENT_ERROR, &event_data) < 0)
return -1;
- switch (cf->origin_type) {
+ switch (cs->origin_type) {
case CONFIG_ORIGIN_BLOB:
error_msg = xstrfmt(_("bad config line %d in blob %s"),
- cf->linenr, cf->name);
+ cs->linenr, cs->name);
break;
case CONFIG_ORIGIN_FILE:
error_msg = xstrfmt(_("bad config line %d in file %s"),
- cf->linenr, cf->name);
+ cs->linenr, cs->name);
break;
case CONFIG_ORIGIN_STDIN:
error_msg = xstrfmt(_("bad config line %d in standard input"),
- cf->linenr);
+ cs->linenr);
break;
case CONFIG_ORIGIN_SUBMODULE_BLOB:
error_msg = xstrfmt(_("bad config line %d in submodule-blob %s"),
- cf->linenr, cf->name);
+ cs->linenr, cs->name);
break;
case CONFIG_ORIGIN_CMDLINE:
error_msg = xstrfmt(_("bad config line %d in command line %s"),
- cf->linenr, cf->name);
+ cs->linenr, cs->name);
break;
default:
error_msg = xstrfmt(_("bad config line %d in %s"),
- cf->linenr, cf->name);
+ cs->linenr, cs->name);
}
switch (opts && opts->error_action ?
opts->error_action :
- cf->default_error_action) {
+ cs->default_error_action) {
case CONFIG_ERROR_DIE:
die("%s", error_msg);
break;
@@ -1130,199 +1168,81 @@ static int git_parse_source(config_fn_t fn, void *data,
return error_return;
}
-static uintmax_t get_unit_factor(const char *end)
-{
- if (!*end)
- return 1;
- else if (!strcasecmp(end, "k"))
- return 1024;
- else if (!strcasecmp(end, "m"))
- return 1024 * 1024;
- else if (!strcasecmp(end, "g"))
- return 1024 * 1024 * 1024;
- return 0;
-}
-
-static int git_parse_signed(const char *value, intmax_t *ret, intmax_t max)
-{
- if (value && *value) {
- char *end;
- intmax_t val;
- uintmax_t uval;
- uintmax_t factor;
-
- errno = 0;
- val = strtoimax(value, &end, 0);
- if (errno == ERANGE)
- return 0;
- factor = get_unit_factor(end);
- if (!factor) {
- errno = EINVAL;
- return 0;
- }
- uval = val < 0 ? -val : val;
- if (unsigned_mult_overflows(factor, uval) ||
- factor * uval > max) {
- errno = ERANGE;
- return 0;
- }
- val *= factor;
- *ret = val;
- return 1;
- }
- errno = EINVAL;
- return 0;
-}
-
-static int git_parse_unsigned(const char *value, uintmax_t *ret, uintmax_t max)
-{
- if (value && *value) {
- char *end;
- uintmax_t val;
- uintmax_t factor;
-
- errno = 0;
- val = strtoumax(value, &end, 0);
- if (errno == ERANGE)
- return 0;
- factor = get_unit_factor(end);
- if (!factor) {
- errno = EINVAL;
- return 0;
- }
- if (unsigned_mult_overflows(factor, val) ||
- factor * val > max) {
- errno = ERANGE;
- return 0;
- }
- val *= factor;
- *ret = val;
- return 1;
- }
- errno = EINVAL;
- return 0;
-}
-
-static int git_parse_int(const char *value, int *ret)
-{
- intmax_t tmp;
- if (!git_parse_signed(value, &tmp, maximum_signed_value_of_type(int)))
- return 0;
- *ret = tmp;
- return 1;
-}
-
-static int git_parse_int64(const char *value, int64_t *ret)
-{
- intmax_t tmp;
- if (!git_parse_signed(value, &tmp, maximum_signed_value_of_type(int64_t)))
- return 0;
- *ret = tmp;
- return 1;
-}
-
-int git_parse_ulong(const char *value, unsigned long *ret)
-{
- uintmax_t tmp;
- if (!git_parse_unsigned(value, &tmp, maximum_unsigned_value_of_type(long)))
- return 0;
- *ret = tmp;
- return 1;
-}
-
-int git_parse_ssize_t(const char *value, ssize_t *ret)
-{
- intmax_t tmp;
- if (!git_parse_signed(value, &tmp, maximum_signed_value_of_type(ssize_t)))
- return 0;
- *ret = tmp;
- return 1;
-}
-
NORETURN
-static void die_bad_number(const char *name, const char *value)
+static void die_bad_number(const char *name, const char *value,
+ const struct key_value_info *kvi)
{
const char *error_type = (errno == ERANGE) ?
N_("out of range") : N_("invalid unit");
const char *bad_numeric = N_("bad numeric config value '%s' for '%s': %s");
+ if (!kvi)
+ BUG("kvi should not be NULL");
+
if (!value)
value = "";
- if (!(cf && cf->name))
+ if (!kvi->filename)
die(_(bad_numeric), value, name, _(error_type));
- switch (cf->origin_type) {
+ switch (kvi->origin_type) {
case CONFIG_ORIGIN_BLOB:
die(_("bad numeric config value '%s' for '%s' in blob %s: %s"),
- value, name, cf->name, _(error_type));
+ value, name, kvi->filename, _(error_type));
case CONFIG_ORIGIN_FILE:
die(_("bad numeric config value '%s' for '%s' in file %s: %s"),
- value, name, cf->name, _(error_type));
+ value, name, kvi->filename, _(error_type));
case CONFIG_ORIGIN_STDIN:
die(_("bad numeric config value '%s' for '%s' in standard input: %s"),
value, name, _(error_type));
case CONFIG_ORIGIN_SUBMODULE_BLOB:
die(_("bad numeric config value '%s' for '%s' in submodule-blob %s: %s"),
- value, name, cf->name, _(error_type));
+ value, name, kvi->filename, _(error_type));
case CONFIG_ORIGIN_CMDLINE:
die(_("bad numeric config value '%s' for '%s' in command line %s: %s"),
- value, name, cf->name, _(error_type));
+ value, name, kvi->filename, _(error_type));
default:
die(_("bad numeric config value '%s' for '%s' in %s: %s"),
- value, name, cf->name, _(error_type));
+ value, name, kvi->filename, _(error_type));
}
}
-int git_config_int(const char *name, const char *value)
+int git_config_int(const char *name, const char *value,
+ const struct key_value_info *kvi)
{
int ret;
if (!git_parse_int(value, &ret))
- die_bad_number(name, value);
+ die_bad_number(name, value, kvi);
return ret;
}
-int64_t git_config_int64(const char *name, const char *value)
+int64_t git_config_int64(const char *name, const char *value,
+ const struct key_value_info *kvi)
{
int64_t ret;
if (!git_parse_int64(value, &ret))
- die_bad_number(name, value);
+ die_bad_number(name, value, kvi);
return ret;
}
-unsigned long git_config_ulong(const char *name, const char *value)
+unsigned long git_config_ulong(const char *name, const char *value,
+ const struct key_value_info *kvi)
{
unsigned long ret;
if (!git_parse_ulong(value, &ret))
- die_bad_number(name, value);
+ die_bad_number(name, value, kvi);
return ret;
}
-ssize_t git_config_ssize_t(const char *name, const char *value)
+ssize_t git_config_ssize_t(const char *name, const char *value,
+ const struct key_value_info *kvi)
{
ssize_t ret;
if (!git_parse_ssize_t(value, &ret))
- die_bad_number(name, value);
+ die_bad_number(name, value, kvi);
return ret;
}
-static int git_parse_maybe_bool_text(const char *value)
-{
- if (!value)
- return 1;
- if (!*value)
- return 0;
- if (!strcasecmp(value, "true")
- || !strcasecmp(value, "yes")
- || !strcasecmp(value, "on"))
- return 1;
- if (!strcasecmp(value, "false")
- || !strcasecmp(value, "no")
- || !strcasecmp(value, "off"))
- return 0;
- return -1;
-}
-
static const struct fsync_component_name {
const char *name;
enum fsync_component component_bits;
@@ -1397,17 +1317,8 @@ next_name:
return (current & ~negative) | positive;
}
-int git_parse_maybe_bool(const char *value)
-{
- int v = git_parse_maybe_bool_text(value);
- if (0 <= v)
- return v;
- if (git_parse_int(value, &v))
- return !!v;
- return -1;
-}
-
-int git_config_bool_or_int(const char *name, const char *value, int *is_bool)
+int git_config_bool_or_int(const char *name, const char *value,
+ const struct key_value_info *kvi, int *is_bool)
{
int v = git_parse_maybe_bool_text(value);
if (0 <= v) {
@@ -1415,7 +1326,7 @@ int git_config_bool_or_int(const char *name, const char *value, int *is_bool)
return v;
}
*is_bool = 0;
- return git_config_int(name, value);
+ return git_config_int(name, value, kvi);
}
int git_config_bool(const char *name, const char *value)
@@ -1463,7 +1374,8 @@ int git_config_color(char *dest, const char *var, const char *value)
return 0;
}
-static int git_default_core_config(const char *var, const char *value, void *cb)
+static int git_default_core_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
/* This needs a better name */
if (!strcmp(var, "core.filemode")) {
@@ -1475,10 +1387,15 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
return 0;
}
if (!strcmp(var, "core.checkstat")) {
+ if (!value)
+ return config_error_nonbool(var);
if (!strcasecmp(value, "default"))
check_stat = 1;
else if (!strcasecmp(value, "minimal"))
check_stat = 0;
+ else
+ return error(_("invalid value for '%s': '%s'"),
+ var, value);
}
if (!strcmp(var, "core.quotepath")) {
@@ -1540,7 +1457,7 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
else if (!git_parse_maybe_bool_text(value))
default_abbrev = the_hash_algo->hexsz;
else {
- int abbrev = git_config_int(var, value);
+ int abbrev = git_config_int(var, value, ctx->kvi);
if (abbrev < minimum_abbrev || abbrev > the_hash_algo->hexsz)
return error(_("abbrev length out of range: %d"), abbrev);
default_abbrev = abbrev;
@@ -1552,7 +1469,7 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
return set_disambiguate_hint_config(var, value);
if (!strcmp(var, "core.loosecompression")) {
- int level = git_config_int(var, value);
+ int level = git_config_int(var, value, ctx->kvi);
if (level == -1)
level = Z_DEFAULT_COMPRESSION;
else if (level < 0 || level > Z_BEST_COMPRESSION)
@@ -1563,7 +1480,7 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
}
if (!strcmp(var, "core.compression")) {
- int level = git_config_int(var, value);
+ int level = git_config_int(var, value, ctx->kvi);
if (level == -1)
level = Z_DEFAULT_COMPRESSION;
else if (level < 0 || level > Z_BEST_COMPRESSION)
@@ -1577,7 +1494,7 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
if (!strcmp(var, "core.packedgitwindowsize")) {
int pgsz_x2 = getpagesize() * 2;
- packed_git_window_size = git_config_ulong(var, value);
+ packed_git_window_size = git_config_ulong(var, value, ctx->kvi);
/* This value must be multiple of (pagesize * 2) */
packed_git_window_size /= pgsz_x2;
@@ -1588,17 +1505,17 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
}
if (!strcmp(var, "core.bigfilethreshold")) {
- big_file_threshold = git_config_ulong(var, value);
+ big_file_threshold = git_config_ulong(var, value, ctx->kvi);
return 0;
}
if (!strcmp(var, "core.packedgitlimit")) {
- packed_git_limit = git_config_ulong(var, value);
+ packed_git_limit = git_config_ulong(var, value, ctx->kvi);
return 0;
}
if (!strcmp(var, "core.deltabasecachelimit")) {
- delta_base_cache_limit = git_config_ulong(var, value);
+ delta_base_cache_limit = git_config_ulong(var, value, ctx->kvi);
return 0;
}
@@ -1635,12 +1552,12 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
return 0;
}
- if (!strcmp(var, "core.checkroundtripencoding")) {
- check_roundtrip_encoding = xstrdup(value);
- return 0;
- }
+ if (!strcmp(var, "core.checkroundtripencoding"))
+ return git_config_string(&check_roundtrip_encoding, var, value);
if (!strcmp(var, "core.notesref")) {
+ if (!value)
+ return config_error_nonbool(var);
notes_ref_name = xstrdup(value);
return 0;
}
@@ -1648,24 +1565,29 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
if (!strcmp(var, "core.editor"))
return git_config_string(&editor_program, var, value);
- if (!strcmp(var, "core.commentchar")) {
+ if (!strcmp(var, "core.commentchar") ||
+ !strcmp(var, "core.commentstring")) {
if (!value)
return config_error_nonbool(var);
else if (!strcasecmp(value, "auto"))
auto_comment_line_char = 1;
- else if (value[0] && !value[1]) {
- comment_line_char = value[0];
+ else if (value[0]) {
+ if (strchr(value, '\n'))
+ return error(_("%s cannot contain newline"), var);
+ comment_line_str = xstrdup(value);
auto_comment_line_char = 0;
} else
- return error(_("core.commentChar should only be one character"));
+ return error(_("%s must have at least one character"), var);
return 0;
}
if (!strcmp(var, "core.askpass"))
return git_config_string(&askpass_program, var, value);
- if (!strcmp(var, "core.excludesfile"))
+ if (!strcmp(var, "core.excludesfile")) {
+ free((char *)excludes_file);
return git_config_pathname(&excludes_file, var, value);
+ }
if (!strcmp(var, "core.whitespace")) {
if (!value)
@@ -1708,6 +1630,8 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
}
if (!strcmp(var, "core.createobject")) {
+ if (!value)
+ return config_error_nonbool(var);
if (!strcmp(value, "rename"))
object_creation_mode = OBJECT_CREATION_USES_RENAMES;
else if (!strcmp(value, "link"))
@@ -1742,13 +1666,13 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
return 0;
}
- if (!strcmp(var, "core.usereplacerefs")) {
- read_replace_refs = git_config_bool(var, value);
+ if (!strcmp(var, "core.maxtreedepth")) {
+ max_allowed_tree_depth = git_config_int(var, value, ctx->kvi);
return 0;
}
/* Add other config variables here and to Documentation/config.txt. */
- return platform_core_config(var, value, cb);
+ return platform_core_config(var, value, ctx, cb);
}
static int git_default_sparse_config(const char *var, const char *value)
@@ -1850,15 +1774,28 @@ static int git_default_mailmap_config(const char *var, const char *value)
return 0;
}
-int git_default_config(const char *var, const char *value, void *cb)
+static int git_default_attr_config(const char *var, const char *value)
+{
+ if (!strcmp(var, "attr.tree"))
+ return git_config_string(&git_attr_tree, var, value);
+
+ /*
+ * Add other attribute related config variables here and to
+ * Documentation/config/attr.txt.
+ */
+ return 0;
+}
+
+int git_default_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (starts_with(var, "core."))
- return git_default_core_config(var, value, cb);
+ return git_default_core_config(var, value, ctx, cb);
if (starts_with(var, "user.") ||
starts_with(var, "author.") ||
starts_with(var, "committer."))
- return git_ident_config(var, value, cb);
+ return git_ident_config(var, value, ctx, cb);
if (starts_with(var, "i18n."))
return git_default_i18n_config(var, value);
@@ -1872,6 +1809,9 @@ int git_default_config(const char *var, const char *value, void *cb)
if (starts_with(var, "mailmap."))
return git_default_mailmap_config(var, value);
+ if (starts_with(var, "attr."))
+ return git_default_attr_config(var, value);
+
if (starts_with(var, "advice.") || starts_with(var, "color.advice"))
return git_default_advice_config(var, value);
@@ -1881,12 +1821,12 @@ int git_default_config(const char *var, const char *value, void *cb)
}
if (!strcmp(var, "pack.packsizelimit")) {
- pack_size_limit_cfg = git_config_ulong(var, value);
+ pack_size_limit_cfg = git_config_ulong(var, value, ctx->kvi);
return 0;
}
if (!strcmp(var, "pack.compression")) {
- int level = git_config_int(var, value);
+ int level = git_config_int(var, value, ctx->kvi);
if (level == -1)
level = Z_DEFAULT_COMPRESSION;
else if (level < 0 || level > Z_BEST_COMPRESSION)
@@ -1908,36 +1848,36 @@ int git_default_config(const char *var, const char *value, void *cb)
* fgetc, ungetc, ftell of top need to be initialized before calling
* this function.
*/
-static int do_config_from(struct config_source *top, config_fn_t fn, void *data,
+static int do_config_from(struct config_source *top, config_fn_t fn,
+ void *data, enum config_scope scope,
const struct config_options *opts)
{
+ struct key_value_info kvi = KVI_INIT;
int ret;
/* push config-file parsing state stack */
- top->prev = cf;
top->linenr = 1;
top->eof = 0;
top->total_len = 0;
strbuf_init(&top->value, 1024);
strbuf_init(&top->var, 1024);
- cf = top;
+ kvi_from_source(top, scope, &kvi);
- ret = git_parse_source(fn, data, opts);
+ ret = git_parse_source(top, fn, &kvi, data, opts);
- /* pop config-file parsing state stack */
strbuf_release(&top->value);
strbuf_release(&top->var);
- cf = top->prev;
return ret;
}
static int do_config_from_file(config_fn_t fn,
- const enum config_origin_type origin_type,
- const char *name, const char *path, FILE *f,
- void *data, const struct config_options *opts)
+ const enum config_origin_type origin_type,
+ const char *name, const char *path, FILE *f,
+ void *data, enum config_scope scope,
+ const struct config_options *opts)
{
- struct config_source top;
+ struct config_source top = CONFIG_SOURCE_INIT;
int ret;
top.u.file = f;
@@ -1950,28 +1890,31 @@ static int do_config_from_file(config_fn_t fn,
top.do_ftell = config_file_ftell;
flockfile(f);
- ret = do_config_from(&top, fn, data, opts);
+ ret = do_config_from(&top, fn, data, scope, opts);
funlockfile(f);
return ret;
}
-static int git_config_from_stdin(config_fn_t fn, void *data)
+static int git_config_from_stdin(config_fn_t fn, void *data,
+ enum config_scope scope)
{
return do_config_from_file(fn, CONFIG_ORIGIN_STDIN, "", NULL, stdin,
- data, NULL);
+ data, scope, NULL);
}
int git_config_from_file_with_options(config_fn_t fn, const char *filename,
- void *data,
+ void *data, enum config_scope scope,
const struct config_options *opts)
{
int ret = -1;
FILE *f;
+ if (!filename)
+ BUG("filename cannot be NULL");
f = fopen_or_warn(filename, "r");
if (f) {
ret = do_config_from_file(fn, CONFIG_ORIGIN_FILE, filename,
- filename, f, data, opts);
+ filename, f, data, scope, opts);
fclose(f);
}
return ret;
@@ -1979,15 +1922,17 @@ int git_config_from_file_with_options(config_fn_t fn, const char *filename,
int git_config_from_file(config_fn_t fn, const char *filename, void *data)
{
- return git_config_from_file_with_options(fn, filename, data, NULL);
+ return git_config_from_file_with_options(fn, filename, data,
+ CONFIG_SCOPE_UNKNOWN, NULL);
}
int git_config_from_mem(config_fn_t fn,
const enum config_origin_type origin_type,
const char *name, const char *buf, size_t len,
- void *data, const struct config_options *opts)
+ void *data, enum config_scope scope,
+ const struct config_options *opts)
{
- struct config_source top;
+ struct config_source top = CONFIG_SOURCE_INIT;
top.u.buf.buf = buf;
top.u.buf.len = len;
@@ -2000,14 +1945,15 @@ int git_config_from_mem(config_fn_t fn,
top.do_ungetc = config_buf_ungetc;
top.do_ftell = config_buf_ftell;
- return do_config_from(&top, fn, data, opts);
+ return do_config_from(&top, fn, data, scope, opts);
}
int git_config_from_blob_oid(config_fn_t fn,
const char *name,
struct repository *repo,
const struct object_id *oid,
- void *data)
+ void *data,
+ enum config_scope scope)
{
enum object_type type;
char *buf;
@@ -2023,7 +1969,7 @@ int git_config_from_blob_oid(config_fn_t fn,
}
ret = git_config_from_mem(fn, CONFIG_ORIGIN_BLOB, name, buf, size,
- data, NULL);
+ data, scope, NULL);
free(buf);
return ret;
@@ -2032,13 +1978,14 @@ int git_config_from_blob_oid(config_fn_t fn,
static int git_config_from_blob_ref(config_fn_t fn,
struct repository *repo,
const char *name,
- void *data)
+ void *data,
+ enum config_scope scope)
{
struct object_id oid;
if (repo_get_oid(repo, name, &oid) < 0)
return error(_("unable to resolve config blob '%s'"), name);
- return git_config_from_blob_oid(fn, name, repo, &oid, data);
+ return git_config_from_blob_oid(fn, name, repo, &oid, data, scope);
}
char *git_system_config(void)
@@ -2050,7 +1997,27 @@ char *git_system_config(void)
return system_config;
}
-void git_global_config(char **user_out, char **xdg_out)
+char *git_global_config(void)
+{
+ char *user_config, *xdg_config;
+
+ git_global_config_paths(&user_config, &xdg_config);
+ if (!user_config) {
+ free(xdg_config);
+ return NULL;
+ }
+
+ if (access_or_warn(user_config, R_OK, 0) && xdg_config &&
+ !access_or_warn(xdg_config, R_OK, 0)) {
+ free(user_config);
+ return xdg_config;
+ } else {
+ free(xdg_config);
+ return user_config;
+ }
+}
+
+void git_global_config_paths(char **user_out, char **xdg_out)
{
char *user_config = xstrdup_or_null(getenv("GIT_CONFIG_GLOBAL"));
char *xdg_config = NULL;
@@ -2064,34 +2031,13 @@ void git_global_config(char **user_out, char **xdg_out)
*xdg_out = xdg_config;
}
-/*
- * Parse environment variable 'k' as a boolean (in various
- * possible spellings); if missing, use the default value 'def'.
- */
-int git_env_bool(const char *k, int def)
-{
- const char *v = getenv(k);
- return v ? git_config_bool(k, v) : def;
-}
-
-/*
- * Parse environment variable 'k' as ulong with possibly a unit
- * suffix; if missing, use the default value 'val'.
- */
-unsigned long git_env_ulong(const char *k, unsigned long val)
-{
- const char *v = getenv(k);
- if (v && !git_parse_ulong(v, &val))
- die(_("failed to parse %s"), k);
- return val;
-}
-
int git_config_system(void)
{
return !git_env_bool("GIT_CONFIG_NOSYSTEM", 0);
}
static int do_git_config_sequence(const struct config_options *opts,
+ const struct repository *repo,
config_fn_t fn, void *data)
{
int ret = 0;
@@ -2099,57 +2045,68 @@ static int do_git_config_sequence(const struct config_options *opts,
char *xdg_config = NULL;
char *user_config = NULL;
char *repo_config;
- enum config_scope prev_parsing_scope = current_parsing_scope;
+ char *worktree_config;
+
+ /*
+ * Ensure that either:
+ * - the git_dir and commondir are both set, or
+ * - the git_dir and commondir are both NULL
+ */
+ if (!opts->git_dir != !opts->commondir)
+ BUG("only one of commondir and git_dir is non-NULL");
- if (opts->commondir)
+ if (opts->commondir) {
repo_config = mkpathdup("%s/config", opts->commondir);
- else if (opts->git_dir)
- BUG("git_dir without commondir");
- else
+ worktree_config = mkpathdup("%s/config.worktree", opts->git_dir);
+ } else {
repo_config = NULL;
+ worktree_config = NULL;
+ }
- current_parsing_scope = CONFIG_SCOPE_SYSTEM;
if (git_config_system() && system_config &&
!access_or_die(system_config, R_OK,
opts->system_gently ? ACCESS_EACCES_OK : 0))
- ret += git_config_from_file(fn, system_config, data);
+ ret += git_config_from_file_with_options(fn, system_config,
+ data, CONFIG_SCOPE_SYSTEM,
+ NULL);
- current_parsing_scope = CONFIG_SCOPE_GLOBAL;
- git_global_config(&user_config, &xdg_config);
+ git_global_config_paths(&user_config, &xdg_config);
if (xdg_config && !access_or_die(xdg_config, R_OK, ACCESS_EACCES_OK))
- ret += git_config_from_file(fn, xdg_config, data);
+ ret += git_config_from_file_with_options(fn, xdg_config, data,
+ CONFIG_SCOPE_GLOBAL, NULL);
if (user_config && !access_or_die(user_config, R_OK, ACCESS_EACCES_OK))
- ret += git_config_from_file(fn, user_config, data);
+ ret += git_config_from_file_with_options(fn, user_config, data,
+ CONFIG_SCOPE_GLOBAL, NULL);
- current_parsing_scope = CONFIG_SCOPE_LOCAL;
if (!opts->ignore_repo && repo_config &&
!access_or_die(repo_config, R_OK, 0))
- ret += git_config_from_file(fn, repo_config, data);
+ ret += git_config_from_file_with_options(fn, repo_config, data,
+ CONFIG_SCOPE_LOCAL, NULL);
- current_parsing_scope = CONFIG_SCOPE_WORKTREE;
- if (!opts->ignore_worktree && repository_format_worktree_config) {
- char *path = git_pathdup("config.worktree");
- if (!access_or_die(path, R_OK, 0))
- ret += git_config_from_file(fn, path, data);
- free(path);
+ if (!opts->ignore_worktree && worktree_config &&
+ repo && repo->repository_format_worktree_config &&
+ !access_or_die(worktree_config, R_OK, 0)) {
+ ret += git_config_from_file_with_options(fn, worktree_config, data,
+ CONFIG_SCOPE_WORKTREE,
+ NULL);
}
- current_parsing_scope = CONFIG_SCOPE_COMMAND;
if (!opts->ignore_cmdline && git_config_from_parameters(fn, data) < 0)
die(_("unable to parse command-line config"));
- current_parsing_scope = prev_parsing_scope;
free(system_config);
free(xdg_config);
free(user_config);
free(repo_config);
+ free(worktree_config);
return ret;
}
int config_with_options(config_fn_t fn, void *data,
struct git_config_source *config_source,
+ struct repository *repo,
const struct config_options *opts)
{
struct config_include_data inc = CONFIG_INCLUDE_INIT;
@@ -2159,29 +2116,27 @@ int config_with_options(config_fn_t fn, void *data,
inc.fn = fn;
inc.data = data;
inc.opts = opts;
+ inc.repo = repo;
inc.config_source = config_source;
fn = git_config_include;
data = &inc;
}
- if (config_source)
- current_parsing_scope = config_source->scope;
-
/*
* If we have a specific filename, use it. Otherwise, follow the
* regular lookup sequence.
*/
if (config_source && config_source->use_stdin) {
- ret = git_config_from_stdin(fn, data);
+ ret = git_config_from_stdin(fn, data, config_source->scope);
} else if (config_source && config_source->file) {
- ret = git_config_from_file(fn, config_source->file, data);
+ ret = git_config_from_file_with_options(fn, config_source->file,
+ data, config_source->scope,
+ NULL);
} else if (config_source && config_source->blob) {
- struct repository *repo = config_source->repo ?
- config_source->repo : the_repository;
ret = git_config_from_blob_ref(fn, repo, config_source->blob,
- data);
+ data, config_source->scope);
} else {
- ret = do_git_config_sequence(opts, fn, data);
+ ret = do_git_config_sequence(opts, repo, fn, data);
}
if (inc.remote_urls) {
@@ -2191,26 +2146,24 @@ int config_with_options(config_fn_t fn, void *data,
return ret;
}
-static void configset_iter(struct config_set *cs, config_fn_t fn, void *data)
+static void configset_iter(struct config_set *set, config_fn_t fn, void *data)
{
int i, value_index;
struct string_list *values;
struct config_set_element *entry;
- struct configset_list *list = &cs->list;
+ struct configset_list *list = &set->list;
+ struct config_context ctx = CONFIG_CONTEXT_INIT;
for (i = 0; i < list->nr; i++) {
entry = list->items[i].e;
value_index = list->items[i].value_index;
values = &entry->value_list;
- current_config_kvi = values->items[value_index].util;
-
- if (fn(entry->key, values->items[value_index].string, data) < 0)
+ ctx.kvi = values->items[value_index].util;
+ if (fn(entry->key, values->items[value_index].string, &ctx, data) < 0)
git_die_config_linenr(entry->key,
- current_config_kvi->filename,
- current_config_kvi->linenr);
-
- current_config_kvi = NULL;
+ ctx.kvi->filename,
+ ctx.kvi->linenr);
}
}
@@ -2238,7 +2191,7 @@ void read_early_config(config_fn_t cb, void *data)
opts.git_dir = gitdir.buf;
}
- config_with_options(cb, data, NULL, &opts);
+ config_with_options(cb, data, NULL, NULL, &opts);
strbuf_release(&commondir);
strbuf_release(&gitdir);
@@ -2258,36 +2211,47 @@ void read_very_early_config(config_fn_t cb, void *data)
opts.ignore_cmdline = 1;
opts.system_gently = 1;
- config_with_options(cb, data, NULL, &opts);
+ config_with_options(cb, data, NULL, NULL, &opts);
}
-static struct config_set_element *configset_find_element(struct config_set *cs, const char *key)
+RESULT_MUST_BE_USED
+static int configset_find_element(struct config_set *set, const char *key,
+ struct config_set_element **dest)
{
struct config_set_element k;
struct config_set_element *found_entry;
char *normalized_key;
+ int ret;
+
/*
* `key` may come from the user, so normalize it before using it
* for querying entries from the hashmap.
*/
- if (git_config_parse_key(key, &normalized_key, NULL))
- return NULL;
+ ret = git_config_parse_key(key, &normalized_key, NULL);
+ if (ret)
+ return ret;
hashmap_entry_init(&k.ent, strhash(normalized_key));
k.key = normalized_key;
- found_entry = hashmap_get_entry(&cs->config_hash, &k, ent, NULL);
+ found_entry = hashmap_get_entry(&set->config_hash, &k, ent, NULL);
free(normalized_key);
- return found_entry;
+ *dest = found_entry;
+ return 0;
}
-static int configset_add_value(struct config_set *cs, const char *key, const char *value)
+static int configset_add_value(const struct key_value_info *kvi_p,
+ struct config_set *set, const char *key,
+ const char *value)
{
struct config_set_element *e;
struct string_list_item *si;
struct configset_list_item *l_item;
struct key_value_info *kv_info = xmalloc(sizeof(*kv_info));
+ int ret;
- e = configset_find_element(cs, key);
+ ret = configset_find_element(set, key, &e);
+ if (ret)
+ return ret;
/*
* Since the keys are being fed by git_config*() callback mechanism, they
* are already normalized. So simply add them without any further munging.
@@ -2297,37 +2261,25 @@ static int configset_add_value(struct config_set *cs, const char *key, const cha
hashmap_entry_init(&e->ent, strhash(key));
e->key = xstrdup(key);
string_list_init_dup(&e->value_list);
- hashmap_add(&cs->config_hash, &e->ent);
+ hashmap_add(&set->config_hash, &e->ent);
}
si = string_list_append_nodup(&e->value_list, xstrdup_or_null(value));
- ALLOC_GROW(cs->list.items, cs->list.nr + 1, cs->list.alloc);
- l_item = &cs->list.items[cs->list.nr++];
+ ALLOC_GROW(set->list.items, set->list.nr + 1, set->list.alloc);
+ l_item = &set->list.items[set->list.nr++];
l_item->e = e;
l_item->value_index = e->value_list.nr - 1;
- if (!cf)
- BUG("configset_add_value has no source");
- if (cf->name) {
- kv_info->filename = strintern(cf->name);
- kv_info->linenr = cf->linenr;
- kv_info->origin_type = cf->origin_type;
- } else {
- /* for values read from `git_config_from_parameters()` */
- kv_info->filename = NULL;
- kv_info->linenr = -1;
- kv_info->origin_type = CONFIG_ORIGIN_CMDLINE;
- }
- kv_info->scope = current_parsing_scope;
+ *kv_info = *kvi_p;
si->util = kv_info;
return 0;
}
-static int config_set_element_cmp(const void *unused_cmp_data,
+static int config_set_element_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
- const void *unused_keydata)
+ const void *keydata UNUSED)
{
const struct config_set_element *e1, *e2;
@@ -2337,84 +2289,131 @@ static int config_set_element_cmp(const void *unused_cmp_data,
return strcmp(e1->key, e2->key);
}
-void git_configset_init(struct config_set *cs)
+void git_configset_init(struct config_set *set)
{
- hashmap_init(&cs->config_hash, config_set_element_cmp, NULL, 0);
- cs->hash_initialized = 1;
- cs->list.nr = 0;
- cs->list.alloc = 0;
- cs->list.items = NULL;
+ hashmap_init(&set->config_hash, config_set_element_cmp, NULL, 0);
+ set->hash_initialized = 1;
+ set->list.nr = 0;
+ set->list.alloc = 0;
+ set->list.items = NULL;
}
-void git_configset_clear(struct config_set *cs)
+void git_configset_clear(struct config_set *set)
{
struct config_set_element *entry;
struct hashmap_iter iter;
- if (!cs->hash_initialized)
+ if (!set->hash_initialized)
return;
- hashmap_for_each_entry(&cs->config_hash, &iter, entry,
+ hashmap_for_each_entry(&set->config_hash, &iter, entry,
ent /* member name */) {
free(entry->key);
string_list_clear(&entry->value_list, 1);
}
- hashmap_clear_and_free(&cs->config_hash, struct config_set_element, ent);
- cs->hash_initialized = 0;
- free(cs->list.items);
- cs->list.nr = 0;
- cs->list.alloc = 0;
- cs->list.items = NULL;
+ hashmap_clear_and_free(&set->config_hash, struct config_set_element, ent);
+ set->hash_initialized = 0;
+ free(set->list.items);
+ set->list.nr = 0;
+ set->list.alloc = 0;
+ set->list.items = NULL;
}
-static int config_set_callback(const char *key, const char *value, void *cb)
+static int config_set_callback(const char *key, const char *value,
+ const struct config_context *ctx,
+ void *cb)
{
- struct config_set *cs = cb;
- configset_add_value(cs, key, value);
+ struct config_set *set = cb;
+ configset_add_value(ctx->kvi, set, key, value);
return 0;
}
-int git_configset_add_file(struct config_set *cs, const char *filename)
+int git_configset_add_file(struct config_set *set, const char *filename)
{
- return git_config_from_file(config_set_callback, filename, cs);
+ return git_config_from_file(config_set_callback, filename, set);
}
-int git_configset_get_value(struct config_set *cs, const char *key, const char **value)
+int git_configset_get_value(struct config_set *set, const char *key,
+ const char **value, struct key_value_info *kvi)
{
const struct string_list *values = NULL;
+ int ret;
+ struct string_list_item item;
/*
* Follows "last one wins" semantic, i.e., if there are multiple matches for the
* queried key in the files of the configset, the value returned will be the last
* value in the value list for that key.
*/
- values = git_configset_get_value_multi(cs, key);
+ if ((ret = git_configset_get_value_multi(set, key, &values)))
+ return ret;
- if (!values)
- return 1;
assert(values->nr > 0);
- *value = values->items[values->nr - 1].string;
+ item = values->items[values->nr - 1];
+ *value = item.string;
+ if (kvi)
+ *kvi = *((struct key_value_info *)item.util);
+ return 0;
+}
+
+int git_configset_get_value_multi(struct config_set *set, const char *key,
+ const struct string_list **dest)
+{
+ struct config_set_element *e;
+ int ret;
+
+ if ((ret = configset_find_element(set, key, &e)))
+ return ret;
+ else if (!e)
+ return 1;
+ *dest = &e->value_list;
+
return 0;
}
-const struct string_list *git_configset_get_value_multi(struct config_set *cs, const char *key)
+static int check_multi_string(struct string_list_item *item, void *util)
{
- struct config_set_element *e = configset_find_element(cs, key);
- return e ? &e->value_list : NULL;
+ return item->string ? 0 : config_error_nonbool(util);
}
-int git_configset_get_string(struct config_set *cs, const char *key, char **dest)
+int git_configset_get_string_multi(struct config_set *cs, const char *key,
+ const struct string_list **dest)
+{
+ int ret;
+
+ if ((ret = git_configset_get_value_multi(cs, key, dest)))
+ return ret;
+ if ((ret = for_each_string_list((struct string_list *)*dest,
+ check_multi_string, (void *)key)))
+ return ret;
+
+ return 0;
+}
+
+int git_configset_get(struct config_set *set, const char *key)
+{
+ struct config_set_element *e;
+ int ret;
+
+ if ((ret = configset_find_element(set, key, &e)))
+ return ret;
+ else if (!e)
+ return 1;
+ return 0;
+}
+
+int git_configset_get_string(struct config_set *set, const char *key, char **dest)
{
const char *value;
- if (!git_configset_get_value(cs, key, &value))
+ if (!git_configset_get_value(set, key, &value, NULL))
return git_config_string((const char **)dest, key, value);
else
return 1;
}
-static int git_configset_get_string_tmp(struct config_set *cs, const char *key,
+static int git_configset_get_string_tmp(struct config_set *set, const char *key,
const char **dest)
{
const char *value;
- if (!git_configset_get_value(cs, key, &value)) {
+ if (!git_configset_get_value(set, key, &value, NULL)) {
if (!value)
return config_error_nonbool(key);
*dest = value;
@@ -2424,51 +2423,57 @@ static int git_configset_get_string_tmp(struct config_set *cs, const char *key,
}
}
-int git_configset_get_int(struct config_set *cs, const char *key, int *dest)
+int git_configset_get_int(struct config_set *set, const char *key, int *dest)
{
const char *value;
- if (!git_configset_get_value(cs, key, &value)) {
- *dest = git_config_int(key, value);
+ struct key_value_info kvi;
+
+ if (!git_configset_get_value(set, key, &value, &kvi)) {
+ *dest = git_config_int(key, value, &kvi);
return 0;
} else
return 1;
}
-int git_configset_get_ulong(struct config_set *cs, const char *key, unsigned long *dest)
+int git_configset_get_ulong(struct config_set *set, const char *key, unsigned long *dest)
{
const char *value;
- if (!git_configset_get_value(cs, key, &value)) {
- *dest = git_config_ulong(key, value);
+ struct key_value_info kvi;
+
+ if (!git_configset_get_value(set, key, &value, &kvi)) {
+ *dest = git_config_ulong(key, value, &kvi);
return 0;
} else
return 1;
}
-int git_configset_get_bool(struct config_set *cs, const char *key, int *dest)
+int git_configset_get_bool(struct config_set *set, const char *key, int *dest)
{
const char *value;
- if (!git_configset_get_value(cs, key, &value)) {
+ if (!git_configset_get_value(set, key, &value, NULL)) {
*dest = git_config_bool(key, value);
return 0;
} else
return 1;
}
-int git_configset_get_bool_or_int(struct config_set *cs, const char *key,
+int git_configset_get_bool_or_int(struct config_set *set, const char *key,
int *is_bool, int *dest)
{
const char *value;
- if (!git_configset_get_value(cs, key, &value)) {
- *dest = git_config_bool_or_int(key, value, is_bool);
+ struct key_value_info kvi;
+
+ if (!git_configset_get_value(set, key, &value, &kvi)) {
+ *dest = git_config_bool_or_int(key, value, &kvi, is_bool);
return 0;
} else
return 1;
}
-int git_configset_get_maybe_bool(struct config_set *cs, const char *key, int *dest)
+int git_configset_get_maybe_bool(struct config_set *set, const char *key, int *dest)
{
const char *value;
- if (!git_configset_get_value(cs, key, &value)) {
+ if (!git_configset_get_value(set, key, &value, NULL)) {
*dest = git_parse_maybe_bool(value);
if (*dest == -1)
return -1;
@@ -2477,10 +2482,10 @@ int git_configset_get_maybe_bool(struct config_set *cs, const char *key, int *de
return 1;
}
-int git_configset_get_pathname(struct config_set *cs, const char *key, const char **dest)
+int git_configset_get_pathname(struct config_set *set, const char *key, const char **dest)
{
const char *value;
- if (!git_configset_get_value(cs, key, &value))
+ if (!git_configset_get_value(set, key, &value, NULL))
return git_config_pathname(dest, key, value);
else
return 1;
@@ -2501,8 +2506,8 @@ static void repo_read_config(struct repository *repo)
git_configset_clear(repo->config);
git_configset_init(repo->config);
-
- if (config_with_options(config_set_callback, repo->config, NULL, &opts) < 0)
+ if (config_with_options(config_set_callback, repo->config, NULL,
+ repo, &opts) < 0)
/*
* config_with_options() normally returns only
* zero, as most errors are fatal, and
@@ -2537,18 +2542,31 @@ void repo_config(struct repository *repo, config_fn_t fn, void *data)
configset_iter(repo->config, fn, data);
}
+int repo_config_get(struct repository *repo, const char *key)
+{
+ git_config_check_init(repo);
+ return git_configset_get(repo->config, key);
+}
+
int repo_config_get_value(struct repository *repo,
const char *key, const char **value)
{
git_config_check_init(repo);
- return git_configset_get_value(repo->config, key, value);
+ return git_configset_get_value(repo->config, key, value, NULL);
+}
+
+int repo_config_get_value_multi(struct repository *repo, const char *key,
+ const struct string_list **dest)
+{
+ git_config_check_init(repo);
+ return git_configset_get_value_multi(repo->config, key, dest);
}
-const struct string_list *repo_config_get_value_multi(struct repository *repo,
- const char *key)
+int repo_config_get_string_multi(struct repository *repo, const char *key,
+ const struct string_list **dest)
{
git_config_check_init(repo);
- return git_configset_get_value_multi(repo->config, key);
+ return git_configset_get_string_multi(repo->config, key, dest);
}
int repo_config_get_string(struct repository *repo,
@@ -2619,6 +2637,28 @@ int repo_config_get_pathname(struct repository *repo,
return ret;
}
+/* Read values into protected_config. */
+static void read_protected_config(void)
+{
+ struct config_options opts = {
+ .respect_includes = 1,
+ .ignore_repo = 1,
+ .ignore_worktree = 1,
+ .system_gently = 1,
+ };
+
+ git_configset_init(&protected_config);
+ config_with_options(config_set_callback, &protected_config, NULL,
+ NULL, &opts);
+}
+
+void git_protected_config(config_fn_t fn, void *data)
+{
+ if (!protected_config.hash_initialized)
+ read_protected_config();
+ configset_iter(&protected_config, fn, data);
+}
+
/* Functions used historically to read configuration from 'the_repository' */
void git_config(config_fn_t fn, void *data)
{
@@ -2630,14 +2670,25 @@ void git_config_clear(void)
repo_config_clear(the_repository);
}
+int git_config_get(const char *key)
+{
+ return repo_config_get(the_repository, key);
+}
+
int git_config_get_value(const char *key, const char **value)
{
return repo_config_get_value(the_repository, key, value);
}
-const struct string_list *git_config_get_value_multi(const char *key)
+int git_config_get_value_multi(const char *key, const struct string_list **dest)
+{
+ return repo_config_get_value_multi(the_repository, key, dest);
+}
+
+int git_config_get_string_multi(const char *key,
+ const struct string_list **dest)
{
- return repo_config_get_value_multi(the_repository, key);
+ return repo_config_get_string_multi(the_repository, key, dest);
}
int git_config_get_string(const char *key, char **dest)
@@ -2784,7 +2835,8 @@ void git_die_config(const char *key, const char *err, ...)
error_fn(err, params);
va_end(params);
}
- values = git_config_get_value_multi(key);
+ if (git_config_get_value_multi(key, &values))
+ BUG("for key '%s' we must have a value to report on", key);
kv_info = values->items[values->nr - 1].util;
git_die_config_linenr(key, kv_info->filename, kv_info->linenr);
}
@@ -2808,6 +2860,7 @@ struct config_store_data {
unsigned int parsed_nr, parsed_alloc, *seen, seen_nr, seen_alloc;
unsigned int key_seen:1, section_seen:1, is_keys_section:1;
};
+#define CONFIG_STORE_INIT { 0 }
static void config_store_data_clear(struct config_store_data *store)
{
@@ -2838,8 +2891,8 @@ static int matches(const char *key, const char *value,
(value && !regexec(store->value_pattern, value, 0, NULL, 0));
}
-static int store_aux_event(enum config_event_t type,
- size_t begin, size_t end, void *data)
+static int store_aux_event(enum config_event_t type, size_t begin, size_t end,
+ struct config_source *cs, void *data)
{
struct config_store_data *store = data;
@@ -2851,10 +2904,10 @@ static int store_aux_event(enum config_event_t type,
if (type == CONFIG_EVENT_SECTION) {
int (*cmpfn)(const char *, const char *, size_t);
- if (cf->var.len < 2 || cf->var.buf[cf->var.len - 1] != '.')
- return error(_("invalid section name '%s'"), cf->var.buf);
+ if (cs->var.len < 2 || cs->var.buf[cs->var.len - 1] != '.')
+ return error(_("invalid section name '%s'"), cs->var.buf);
- if (cf->subsection_case_sensitive)
+ if (cs->subsection_case_sensitive)
cmpfn = strncasecmp;
else
cmpfn = strncmp;
@@ -2862,8 +2915,8 @@ static int store_aux_event(enum config_event_t type,
/* Is this the section we were looking for? */
store->is_keys_section =
store->parsed[store->parsed_nr].is_keys_section =
- cf->var.len - 1 == store->baselen &&
- !cmpfn(cf->var.buf, store->key, store->baselen);
+ cs->var.len - 1 == store->baselen &&
+ !cmpfn(cs->var.buf, store->key, store->baselen);
if (store->is_keys_section) {
store->section_seen = 1;
ALLOC_GROW(store->seen, store->seen_nr + 1,
@@ -2877,7 +2930,8 @@ static int store_aux_event(enum config_event_t type,
return 0;
}
-static int store_aux(const char *key, const char *value, void *cb)
+static int store_aux(const char *key, const char *value,
+ const struct config_context *ctx UNUSED, void *cb)
{
struct config_store_data *store = cb;
@@ -2957,6 +3011,7 @@ static ssize_t write_section(int fd, const char *key,
}
static ssize_t write_pair(int fd, const char *key, const char *value,
+ const char *comment,
const struct config_store_data *store)
{
int i;
@@ -2997,7 +3052,11 @@ static ssize_t write_pair(int fd, const char *key, const char *value,
strbuf_addch(&sb, value[i]);
break;
}
- strbuf_addf(&sb, "%s\n", quote);
+
+ if (comment)
+ strbuf_addf(&sb, "%s%s\n", quote, comment);
+ else
+ strbuf_addf(&sb, "%s\n", quote);
ret = write_in_full(fd, sb.buf, sb.len);
strbuf_release(&sb);
@@ -3086,9 +3145,9 @@ static void maybe_remove_section(struct config_store_data *store,
}
int git_config_set_in_file_gently(const char *config_filename,
- const char *key, const char *value)
+ const char *key, const char *comment, const char *value)
{
- return git_config_set_multivar_in_file_gently(config_filename, key, value, NULL, 0);
+ return git_config_set_multivar_in_file_gently(config_filename, key, value, NULL, comment, 0);
}
void git_config_set_in_file(const char *config_filename,
@@ -3105,11 +3164,11 @@ int git_config_set_gently(const char *key, const char *value)
int repo_config_set_worktree_gently(struct repository *r,
const char *key, const char *value)
{
- /* Only use worktree-specific config if it is is already enabled. */
- if (repository_format_worktree_config) {
+ /* Only use worktree-specific config if it is already enabled. */
+ if (r->repository_format_worktree_config) {
char *file = repo_git_path(r, "config.worktree");
int ret = git_config_set_multivar_in_file_gently(
- file, key, value, NULL, 0);
+ file, key, value, NULL, NULL, 0);
free(file);
return ret;
}
@@ -3124,6 +3183,62 @@ void git_config_set(const char *key, const char *value)
}
/*
+ * The ownership rule is that the caller will own the string
+ * if it receives a piece of memory different from what it passed
+ * as the parameter.
+ */
+const char *git_config_prepare_comment_string(const char *comment)
+{
+ size_t leading_blanks;
+
+ if (!comment)
+ return NULL;
+
+ if (strchr(comment, '\n'))
+ die(_("no multi-line comment allowed: '%s'"), comment);
+
+ /*
+ * If it begins with one or more leading whitespace characters
+ * followed by '#", the comment string is used as-is.
+ *
+ * If it begins with '#', a SP is inserted between the comment
+ * and the value the comment is about.
+ *
+ * Otherwise, the value is followed by a SP followed by '#'
+ * followed by SP and then the comment string comes.
+ */
+
+ leading_blanks = strspn(comment, " \t");
+ if (leading_blanks && comment[leading_blanks] == '#')
+ ; /* use it as-is */
+ else if (comment[0] == '#')
+ comment = xstrfmt(" %s", comment);
+ else
+ comment = xstrfmt(" # %s", comment);
+
+ return comment;
+}
+
+static void validate_comment_string(const char *comment)
+{
+ size_t leading_blanks;
+
+ if (!comment)
+ return;
+ /*
+ * The front-end must have massaged the comment string
+ * properly before calling us.
+ */
+ if (strchr(comment, '\n'))
+ BUG("multi-line comments are not permitted: '%s'", comment);
+
+ leading_blanks = strspn(comment, " \t");
+ if (!leading_blanks || comment[leading_blanks] != '#')
+ BUG("comment must begin with one or more SP followed by '#': '%s'",
+ comment);
+}
+
+/*
* If value==NULL, unset in (remove from) config,
* if value_pattern!=NULL, disregard key/value pairs where value does not match.
* if value_pattern==CONFIG_REGEX_NONE, do not match any existing values
@@ -3151,6 +3266,7 @@ void git_config_set(const char *key, const char *value)
int git_config_set_multivar_in_file_gently(const char *config_filename,
const char *key, const char *value,
const char *value_pattern,
+ const char *comment,
unsigned flags)
{
int fd = -1, in_fd = -1;
@@ -3159,9 +3275,9 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
char *filename_buf = NULL;
char *contents = NULL;
size_t contents_sz;
- struct config_store_data store;
+ struct config_store_data store = CONFIG_STORE_INIT;
- memset(&store, 0, sizeof(store));
+ validate_comment_string(comment);
/* parse-key returns negative; flip the sign to feed exit(3) */
ret = 0 - git_config_parse_key(key, &store.key, &store.baselen);
@@ -3203,7 +3319,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
free(store.key);
store.key = xstrdup(key);
if (write_section(fd, key, &store) < 0 ||
- write_pair(fd, key, value, &store) < 0)
+ write_pair(fd, key, value, comment, &store) < 0)
goto write_err_out;
} else {
struct stat st;
@@ -3251,7 +3367,8 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
*/
if (git_config_from_file_with_options(store_aux,
config_filename,
- &store, &opts)) {
+ &store, CONFIG_SCOPE_UNKNOWN,
+ &opts)) {
error(_("invalid config file %s"), config_filename);
ret = CONFIG_INVALID_FILE;
goto out_free;
@@ -3356,7 +3473,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
if (write_section(fd, key, &store) < 0)
goto write_err_out;
}
- if (write_pair(fd, key, value, &store) < 0)
+ if (write_pair(fd, key, value, comment, &store) < 0)
goto write_err_out;
}
@@ -3394,7 +3511,6 @@ out_free:
write_err_out:
ret = write_error(get_lock_file_path(&lock));
goto out_free;
-
}
void git_config_set_multivar_in_file(const char *config_filename,
@@ -3402,7 +3518,7 @@ void git_config_set_multivar_in_file(const char *config_filename,
const char *value_pattern, unsigned flags)
{
if (!git_config_set_multivar_in_file_gently(config_filename, key, value,
- value_pattern, flags))
+ value_pattern, NULL, flags))
return;
if (value)
die(_("could not set '%s' to '%s'"), key, value);
@@ -3425,7 +3541,7 @@ int repo_config_set_multivar_gently(struct repository *r, const char *key,
int res = git_config_set_multivar_in_file_gently(file,
key, value,
value_pattern,
- flags);
+ NULL, flags);
free(file);
return res;
}
@@ -3438,9 +3554,10 @@ void git_config_set_multivar(const char *key, const char *value,
flags);
}
-static int section_name_match (const char *buf, const char *name)
+static size_t section_name_match (const char *buf, const char *name)
{
- int i = 0, j = 0, dot = 0;
+ size_t i = 0, j = 0;
+ int dot = 0;
if (buf[i] != '[')
return 0;
for (i = 1; buf[i] && buf[i] != ']'; i++) {
@@ -3493,6 +3610,8 @@ static int section_name_is_ok(const char *name)
return 1;
}
+#define GIT_CONFIG_MAX_LINE_LEN (512 * 1024)
+
/* if new_name == NULL, the section is removed instead */
static int git_config_copy_or_rename_section_in_file(const char *config_filename,
const char *old_name,
@@ -3502,11 +3621,12 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
char *filename_buf = NULL;
struct lock_file lock = LOCK_INIT;
int out_fd;
- char buf[1024];
+ struct strbuf buf = STRBUF_INIT;
FILE *config_file = NULL;
struct stat st;
struct strbuf copystr = STRBUF_INIT;
struct config_store_data store;
+ uint32_t line_nr = 0;
memset(&store, 0, sizeof(store));
@@ -3543,16 +3663,25 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
goto out;
}
- while (fgets(buf, sizeof(buf), config_file)) {
- unsigned i;
- int length;
+ while (!strbuf_getwholeline(&buf, config_file, '\n')) {
+ size_t i, length;
int is_section = 0;
- char *output = buf;
- for (i = 0; buf[i] && isspace(buf[i]); i++)
+ char *output = buf.buf;
+
+ line_nr++;
+
+ if (buf.len >= GIT_CONFIG_MAX_LINE_LEN) {
+ ret = error(_("refusing to work with overly long line "
+ "in '%s' on line %"PRIuMAX),
+ config_filename, (uintmax_t)line_nr);
+ goto out;
+ }
+
+ for (i = 0; buf.buf[i] && isspace(buf.buf[i]); i++)
; /* do nothing */
- if (buf[i] == '[') {
+ if (buf.buf[i] == '[') {
/* it's a section */
- int offset;
+ size_t offset;
is_section = 1;
/*
@@ -3569,7 +3698,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
strbuf_reset(&copystr);
}
- offset = section_name_match(&buf[i], old_name);
+ offset = section_name_match(&buf.buf[i], old_name);
if (offset > 0) {
ret++;
if (!new_name) {
@@ -3599,6 +3728,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
output[0] = '\t';
}
} else {
+ strbuf_release(&copystr);
copystr = store_create_section(new_name, &store);
}
}
@@ -3644,6 +3774,8 @@ out:
out_no_rollback:
free(filename_buf);
config_store_data_clear(&store);
+ strbuf_release(&buf);
+ strbuf_release(&copystr);
return ret;
}
@@ -3717,16 +3849,8 @@ int parse_config_key(const char *var,
return 0;
}
-const char *current_config_origin_type(void)
+const char *config_origin_type_name(enum config_origin_type type)
{
- int type;
- if (current_config_kvi)
- type = current_config_kvi->origin_type;
- else if(cf)
- type = cf->origin_type;
- else
- BUG("current_config_origin_type called outside config callback");
-
switch (type) {
case CONFIG_ORIGIN_BLOB:
return "blob";
@@ -3763,34 +3887,6 @@ const char *config_scope_name(enum config_scope scope)
}
}
-const char *current_config_name(void)
-{
- const char *name;
- if (current_config_kvi)
- name = current_config_kvi->filename;
- else if (cf)
- name = cf->name;
- else
- BUG("current_config_name called outside config callback");
- return name ? name : "";
-}
-
-enum config_scope current_config_scope(void)
-{
- if (current_config_kvi)
- return current_config_kvi->scope;
- else
- return current_parsing_scope;
-}
-
-int current_config_line(void)
-{
- if (current_config_kvi)
- return current_config_kvi->linenr;
- else
- return cf->linenr;
-}
-
int lookup_config(const char **mapping, int nr_mapping, const char *var)
{
int i;
diff --git a/config.h b/config.h
index 7654f61..f4966e3 100644
--- a/config.h
+++ b/config.h
@@ -3,7 +3,8 @@
#include "hashmap.h"
#include "string-list.h"
-
+#include "repository.h"
+#include "parse.h"
/**
* The config API gives callers a way to access Git configuration files
@@ -49,13 +50,12 @@ const char *config_scope_name(enum config_scope scope);
struct git_config_source {
unsigned int use_stdin:1;
const char *file;
- /* The repository if blob is not NULL; leave blank for the_repository */
- struct repository *repo;
const char *blob;
enum config_scope scope;
};
enum config_origin_type {
+ CONFIG_ORIGIN_UNKNOWN = 0,
CONFIG_ORIGIN_BLOB,
CONFIG_ORIGIN_FILE,
CONFIG_ORIGIN_STDIN,
@@ -72,6 +72,7 @@ enum config_event_t {
CONFIG_EVENT_ERROR
};
+struct config_source;
/*
* The parser event function (if not NULL) is called with the event type and
* the begin/end offsets of the parsed elements.
@@ -81,6 +82,7 @@ enum config_event_t {
*/
typedef int (*config_parser_event_fn_t)(enum config_event_t type,
size_t begin_offset, size_t end_offset,
+ struct config_source *cs,
void *event_fn_data);
struct config_options {
@@ -100,6 +102,10 @@ struct config_options {
const char *commondir;
const char *git_dir;
+ /*
+ * event_fn and event_fn_data are for internal use only. Handles events
+ * emitted by the config parser.
+ */
config_parser_event_fn_t event_fn;
void *event_fn_data;
enum config_error_action {
@@ -110,8 +116,31 @@ struct config_options {
} error_action;
};
+/* Config source metadata for a given config key-value pair */
+struct key_value_info {
+ const char *filename;
+ int linenr;
+ enum config_origin_type origin_type;
+ enum config_scope scope;
+ const char *path;
+};
+#define KVI_INIT { \
+ .filename = NULL, \
+ .linenr = -1, \
+ .origin_type = CONFIG_ORIGIN_UNKNOWN, \
+ .scope = CONFIG_SCOPE_UNKNOWN, \
+ .path = NULL, \
+}
+
+/* Captures additional information that a config callback can use. */
+struct config_context {
+ /* Config source metadata for key and value. */
+ const struct key_value_info *kvi;
+};
+#define CONFIG_CONTEXT_INIT { 0 }
+
/**
- * A config callback function takes three parameters:
+ * A config callback function takes four parameters:
*
* - the name of the parsed variable. This is in canonical "flat" form: the
* section, subsection, and variable segments will be separated by dots,
@@ -122,15 +151,22 @@ struct config_options {
* value specified, the value will be NULL (typically this means it
* should be interpreted as boolean true).
*
+ * - the 'config context', that is, additional information about the config
+ * iteration operation provided by the config machinery. For example, this
+ * includes information about the config source being parsed (e.g. the
+ * filename).
+ *
* - a void pointer passed in by the caller of the config API; this can
* contain callback-specific data
*
* A config callback should return 0 for success, or -1 if the variable
* could not be parsed properly.
*/
-typedef int (*config_fn_t)(const char *, const char *, void *);
+typedef int (*config_fn_t)(const char *, const char *,
+ const struct config_context *, void *);
-int git_default_config(const char *, const char *, void *);
+int git_default_config(const char *, const char *,
+ const struct config_context *, void *);
/**
* Read a specific file in git-config format.
@@ -141,16 +177,18 @@ int git_default_config(const char *, const char *, void *);
int git_config_from_file(config_fn_t fn, const char *, void *);
int git_config_from_file_with_options(config_fn_t fn, const char *,
- void *,
+ void *, enum config_scope,
const struct config_options *);
int git_config_from_mem(config_fn_t fn,
const enum config_origin_type,
const char *name,
const char *buf, size_t len,
- void *data, const struct config_options *opts);
+ void *data, enum config_scope scope,
+ const struct config_options *opts);
int git_config_from_blob_oid(config_fn_t fn, const char *name,
struct repository *repo,
- const struct object_id *oid, void *data);
+ const struct object_id *oid, void *data,
+ enum config_scope scope);
void git_config_push_parameter(const char *text);
void git_config_push_env(const char *spec);
int git_config_from_parameters(config_fn_t fn, void *data);
@@ -195,6 +233,7 @@ void git_config(config_fn_t fn, void *);
*/
int config_with_options(config_fn_t fn, void *,
struct git_config_source *config_source,
+ struct repository *repo,
const struct config_options *opts);
/**
@@ -204,35 +243,30 @@ int config_with_options(config_fn_t fn, void *,
* The following helper functions aid in parsing string values
*/
-int git_parse_ssize_t(const char *, ssize_t *);
-int git_parse_ulong(const char *, unsigned long *);
-
-/**
- * Same as `git_config_bool`, except that it returns -1 on error rather
- * than dying.
- */
-int git_parse_maybe_bool(const char *);
-
/**
* Parse the string to an integer, including unit factors. Dies on error;
* otherwise, returns the parsed result.
*/
-int git_config_int(const char *, const char *);
+int git_config_int(const char *, const char *, const struct key_value_info *);
-int64_t git_config_int64(const char *, const char *);
+int64_t git_config_int64(const char *, const char *,
+ const struct key_value_info *);
/**
* Identical to `git_config_int`, but for unsigned longs.
*/
-unsigned long git_config_ulong(const char *, const char *);
+unsigned long git_config_ulong(const char *, const char *,
+ const struct key_value_info *);
-ssize_t git_config_ssize_t(const char *, const char *);
+ssize_t git_config_ssize_t(const char *, const char *,
+ const struct key_value_info *);
/**
* Same as `git_config_bool`, except that integers are returned as-is, and
* an `is_bool` flag is unset.
*/
-int git_config_bool_or_int(const char *, const char *, int *);
+int git_config_bool_or_int(const char *, const char *,
+ const struct key_value_info *, int *);
/**
* Parse a string into a boolean value, respecting keywords like "true" and
@@ -256,7 +290,7 @@ int git_config_pathname(const char **, const char *, const char *);
int git_config_expiry_date(timestamp_t *, const char *, const char *);
int git_config_color(char *, const char *, const char *);
-int git_config_set_in_file_gently(const char *, const char *, const char *);
+int git_config_set_in_file_gently(const char *, const char *, const char *, const char *);
/**
* write config values to a specific config file, takes a key/value pair as
@@ -302,7 +336,9 @@ int git_config_parse_key(const char *, char **, size_t *);
int git_config_set_multivar_gently(const char *, const char *, const char *, unsigned);
void git_config_set_multivar(const char *, const char *, const char *, unsigned);
int repo_config_set_multivar_gently(struct repository *, const char *, const char *, const char *, unsigned);
-int git_config_set_multivar_in_file_gently(const char *, const char *, const char *, const char *, unsigned);
+int git_config_set_multivar_in_file_gently(const char *, const char *, const char *, const char *, const char *, unsigned);
+
+const char *git_config_prepare_comment_string(const char *);
/**
* takes four parameters:
@@ -341,8 +377,6 @@ int git_config_rename_section(const char *, const char *);
int git_config_rename_section_in_file(const char *, const char *, const char *);
int git_config_copy_section(const char *, const char *);
int git_config_copy_section_in_file(const char *, const char *, const char *);
-int git_env_bool(const char *, int);
-unsigned long git_env_ulong(const char *, unsigned long);
int git_config_system(void);
int config_error_nonbool(const char *);
#if defined(__GNUC__)
@@ -350,14 +384,13 @@ int config_error_nonbool(const char *);
#endif
char *git_system_config(void);
-void git_global_config(char **user, char **xdg);
+char *git_global_config(void);
+void git_global_config_paths(char **user, char **xdg);
int git_config_parse_parameter(const char *, config_fn_t fn, void *data);
-enum config_scope current_config_scope(void);
-const char *current_config_origin_type(void);
-const char *current_config_name(void);
-int current_config_line(void);
+const char *config_origin_type_name(enum config_origin_type type);
+void kvi_from_param(struct key_value_info *out);
/*
* Match and parse a config key of the form:
@@ -449,10 +482,31 @@ int git_configset_add_file(struct config_set *cs, const char *filename);
/**
* Finds and returns the value list, sorted in order of increasing priority
* for the configuration variable `key` and config set `cs`. When the
- * configuration variable `key` is not found, returns NULL. The caller
- * should not free or modify the returned pointer, as it is owned by the cache.
+ * configuration variable `key` is not found, returns 1 without touching
+ * `value`.
+ *
+ * The key will be parsed for validity with git_config_parse_key(), on
+ * error a negative value will be returned.
+ *
+ * The caller should not free or modify the returned pointer, as it is
+ * owned by the cache.
+ */
+RESULT_MUST_BE_USED
+int git_configset_get_value_multi(struct config_set *cs, const char *key,
+ const struct string_list **dest);
+
+/**
+ * A validation wrapper for git_configset_get_value_multi() which does
+ * for it what git_configset_get_string() does for
+ * git_configset_get_value().
+ *
+ * The configuration syntax allows for "[section] key", which will
+ * give us a NULL entry in the "struct string_list", as opposed to
+ * "[section] key =" which is the empty string. Most users of the API
+ * are not prepared to handle NULL in a "struct string_list".
*/
-const struct string_list *git_configset_get_value_multi(struct config_set *cs, const char *key);
+int git_configset_get_string_multi(struct config_set *cs, const char *key,
+ const struct string_list **dest);
/**
* Clears `config_set` structure, removes all saved variable-value pairs.
@@ -464,6 +518,13 @@ void git_configset_clear(struct config_set *cs);
* value in the 'dest' pointer.
*/
+/**
+ * git_configset_get() returns negative values on error, see
+ * repo_config_get() below.
+ */
+RESULT_MUST_BE_USED
+int git_configset_get(struct config_set *cs, const char *key);
+
/*
* Finds the highest-priority value for the configuration variable `key`
* and config set `cs`, stores the pointer to it in `value` and returns 0.
@@ -471,7 +532,8 @@ void git_configset_clear(struct config_set *cs);
* touching `value`. The caller should not free or modify `value`, as it
* is owned by the cache.
*/
-int git_configset_get_value(struct config_set *cs, const char *key, const char **dest);
+int git_configset_get_value(struct config_set *cs, const char *key,
+ const char **dest, struct key_value_info *kvi);
int git_configset_get_string(struct config_set *cs, const char *key, char **dest);
int git_configset_get_int(struct config_set *cs, const char *key, int *dest);
@@ -484,10 +546,22 @@ int git_configset_get_pathname(struct config_set *cs, const char *key, const cha
/* Functions for reading a repository's config */
struct repository;
void repo_config(struct repository *repo, config_fn_t fn, void *data);
+
+/**
+ * Run only the discover part of the repo_config_get_*() functions
+ * below, in addition to 1 if not found, returns negative values on
+ * error (e.g. if the key itself is invalid).
+ */
+RESULT_MUST_BE_USED
+int repo_config_get(struct repository *repo, const char *key);
int repo_config_get_value(struct repository *repo,
const char *key, const char **value);
-const struct string_list *repo_config_get_value_multi(struct repository *repo,
- const char *key);
+RESULT_MUST_BE_USED
+int repo_config_get_value_multi(struct repository *repo, const char *key,
+ const struct string_list **dest);
+RESULT_MUST_BE_USED
+int repo_config_get_string_multi(struct repository *repo, const char *key,
+ const struct string_list **dest);
int repo_config_get_string(struct repository *repo,
const char *key, char **dest);
int repo_config_get_string_tmp(struct repository *repo,
@@ -505,6 +579,13 @@ int repo_config_get_maybe_bool(struct repository *repo,
int repo_config_get_pathname(struct repository *repo,
const char *key, const char **dest);
+/*
+ * Functions for reading protected config. By definition, protected
+ * config ignores repository config, so these do not take a `struct
+ * repository` parameter.
+ */
+void git_protected_config(config_fn_t fn, void *data);
+
/**
* Querying For Specific Variables
* -------------------------------
@@ -513,8 +594,15 @@ int repo_config_get_pathname(struct repository *repo,
* manner, the config API provides two functions `git_config_get_value`
* and `git_config_get_value_multi`. They both read values from an internal
* cache generated previously from reading the config files.
+ *
+ * For those git_config_get*() functions that aren't documented,
+ * consult the corresponding repo_config_get*() function's
+ * documentation.
*/
+RESULT_MUST_BE_USED
+int git_config_get(const char *key);
+
/**
* Finds the highest-priority value for the configuration variable `key`,
* stores the pointer to it in `value` and returns 0. When the
@@ -527,10 +615,17 @@ int git_config_get_value(const char *key, const char **value);
/**
* Finds and returns the value list, sorted in order of increasing priority
* for the configuration variable `key`. When the configuration variable
- * `key` is not found, returns NULL. The caller should not free or modify
- * the returned pointer, as it is owned by the cache.
+ * `key` is not found, returns 1 without touching `value`.
+ *
+ * The caller should not free or modify the returned pointer, as it is
+ * owned by the cache.
*/
-const struct string_list *git_config_get_value_multi(const char *key);
+RESULT_MUST_BE_USED
+int git_config_get_value_multi(const char *key,
+ const struct string_list **dest);
+RESULT_MUST_BE_USED
+int git_config_get_string_multi(const char *key,
+ const struct string_list **dest);
/**
* Resets and invalidates the config cache.
@@ -604,13 +699,6 @@ int git_config_get_expiry(const char *key, const char **output);
/* parse either "this many days" integer, or "5.days.ago" approxidate */
int git_config_get_expiry_in_days(const char *key, timestamp_t *, timestamp_t now);
-struct key_value_info {
- const char *filename;
- int linenr;
- enum config_origin_type origin_type;
- enum config_scope scope;
-};
-
/**
* First prints the error message specified by the caller in `err` and then
* dies printing the line number and the file name of the highest priority
diff --git a/config.mak.dev b/config.mak.dev
index 335efd4..9813047 100644
--- a/config.mak.dev
+++ b/config.mak.dev
@@ -59,9 +59,38 @@ endif
# uninitialized warnings on gcc 4.9.2 in xdiff/xdiffi.c and config.c
# not worth fixing since newer compilers correctly stop complaining
+#
+# Likewise, gcc older than 4.9 complains about initializing a
+# struct-within-a-struct using just "{ 0 }"
ifneq ($(filter gcc4,$(COMPILER_FEATURES)),)
ifeq ($(filter gcc5,$(COMPILER_FEATURES)),)
DEVELOPER_CFLAGS += -Wno-uninitialized
+DEVELOPER_CFLAGS += -Wno-missing-braces
+endif
+endif
+
+# Old versions of clang complain about initializaing a
+# struct-within-a-struct using just "{0}" rather than "{{0}}". This
+# error is considered a false-positive and not worth fixing, because
+# new clang versions do not, so just disable it.
+#
+# The "bug" was fixed in upstream clang 9.
+#
+# Complicating this is that versions of clang released by Apple have
+# their own version numbers (associated with the corresponding version
+# of XCode) unrelated to the official clang version numbers.
+#
+# The bug was fixed in Apple clang 12.
+#
+ifneq ($(filter clang1,$(COMPILER_FEATURES)),) # if we are using clang
+ifeq ($(uname_S),Darwin) # if we are on darwin
+ifeq ($(filter clang12,$(COMPILER_FEATURES)),) # if version < 12
+DEVELOPER_CFLAGS += -Wno-missing-braces
+endif
+else # not darwin
+ifeq ($(filter clang9,$(COMPILER_FEATURES)),) # if version < 9
+DEVELOPER_CFLAGS += -Wno-missing-braces
+endif
endif
endif
diff --git a/config.mak.uname b/config.mak.uname
index ce83cad..a7607a5 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -65,9 +65,9 @@ ifeq ($(uname_S),Linux)
HAVE_PLATFORM_PROCINFO = YesPlease
COMPAT_OBJS += compat/linux/procinfo.o
# centos7/rhel7 provides gcc 4.8.5 and zlib 1.2.7.
- ifneq ($(findstring .el7.,$(uname_R)),)
+ ifneq ($(findstring .el7.,$(uname_R)),)
BASIC_CFLAGS += -std=c99
- endif
+ endif
endif
ifeq ($(uname_S),GNU/kFreeBSD)
HAVE_ALLOCA_H = YesPlease
@@ -95,13 +95,13 @@ ifeq ($(uname_S),UnixWare)
NO_MEMMEM = YesPlease
endif
ifeq ($(uname_S),SCO_SV)
- ifeq ($(uname_R),3.2)
+ ifeq ($(uname_R),3.2)
CFLAGS = -O2
- endif
- ifeq ($(uname_R),5)
+ endif
+ ifeq ($(uname_R),5)
CC = cc
BASIC_CFLAGS += -Kthread
- endif
+ endif
NEEDS_SOCKET = YesPlease
NEEDS_NSL = YesPlease
NEEDS_SSL_WITH_CRYPTO = YesPlease
@@ -124,19 +124,19 @@ ifeq ($(uname_S),Darwin)
# - MacOS 10.0.* and MacOS 10.1.0 = Darwin 1.*
# - MacOS 10.x.* = Darwin (x+4).* for (1 <= x)
# i.e. "begins with [15678] and a dot" means "10.4.* or older".
- ifeq ($(shell expr "$(uname_R)" : '[15678]\.'),2)
+ ifeq ($(shell expr "$(uname_R)" : '[15678]\.'),2)
OLD_ICONV = UnfortunatelyYes
NO_APPLE_COMMON_CRYPTO = YesPlease
- endif
- ifeq ($(shell expr "$(uname_R)" : '[15]\.'),2)
+ endif
+ ifeq ($(shell expr "$(uname_R)" : '[15]\.'),2)
NO_STRLCPY = YesPlease
- endif
- ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 11 && echo 1),1)
+ endif
+ ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 11 && echo 1),1)
HAVE_GETDELIM = YesPlease
- endif
- ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 20 && echo 1),1)
+ endif
+ ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 20 && echo 1),1)
OPEN_RETURNS_EINTR = UnfortunatelyYes
- endif
+ endif
NO_MEMMEM = YesPlease
USE_ST_TIMESPEC = YesPlease
HAVE_DEV_TTY = YesPlease
@@ -147,26 +147,40 @@ ifeq ($(uname_S),Darwin)
FREAD_READS_DIRECTORIES = UnfortunatelyYes
HAVE_NS_GET_EXECUTABLE_PATH = YesPlease
CSPRNG_METHOD = arc4random
+ USE_ENHANCED_BASIC_REGULAR_EXPRESSIONS = YesPlease
# Workaround for `gettext` being keg-only and not even being linked via
# `brew link --force gettext`, should be obsolete as of
# https://github.com/Homebrew/homebrew-core/pull/53489
- ifeq ($(shell test -d /usr/local/opt/gettext/ && echo y),y)
+ ifeq ($(shell test -d /usr/local/opt/gettext/ && echo y),y)
BASIC_CFLAGS += -I/usr/local/include -I/usr/local/opt/gettext/include
BASIC_LDFLAGS += -L/usr/local/lib -L/usr/local/opt/gettext/lib
- ifeq ($(shell test -x /usr/local/opt/gettext/bin/msgfmt && echo y),y)
+ ifeq ($(shell test -x /usr/local/opt/gettext/bin/msgfmt && echo y),y)
MSGFMT = /usr/local/opt/gettext/bin/msgfmt
- endif
- endif
+ endif
+ # On newer ARM-based machines the default installation path has changed to
+ # /opt/homebrew. Include it in our search paths so that the user does not
+ # have to configure this manually.
+ #
+ # Note that we do not employ the same workaround as above where we manually
+ # add gettext. The issue was fixed more than three years ago by now, and at
+ # that point there haven't been any ARM-based Macs yet.
+ else ifeq ($(shell test -d /opt/homebrew/ && echo y),y)
+ BASIC_CFLAGS += -I/opt/homebrew/include
+ BASIC_LDFLAGS += -L/opt/homebrew/lib
+ ifeq ($(shell test -x /opt/homebrew/bin/msgfmt && echo y),y)
+ MSGFMT = /opt/homebrew/bin/msgfmt
+ endif
+ endif
# The builtin FSMonitor on MacOS builds upon Simple-IPC. Both require
# Unix domain sockets and PThreads.
- ifndef NO_PTHREADS
- ifndef NO_UNIX_SOCKETS
+ ifndef NO_PTHREADS
+ ifndef NO_UNIX_SOCKETS
FSMONITOR_DAEMON_BACKEND = darwin
FSMONITOR_OS_SETTINGS = darwin
- endif
- endif
+ endif
+ endif
BASIC_LDFLAGS += -framework CoreServices
endif
@@ -182,7 +196,7 @@ ifeq ($(uname_S),SunOS)
NO_REGEX = YesPlease
NO_MSGFMT_EXTENDED_OPTIONS = YesPlease
HAVE_DEV_TTY = YesPlease
- ifeq ($(uname_R),5.6)
+ ifeq ($(uname_R),5.6)
SOCKLEN_T = int
NO_HSTRERROR = YesPlease
NO_IPV6 = YesPlease
@@ -192,8 +206,8 @@ ifeq ($(uname_S),SunOS)
NO_STRLCPY = YesPlease
NO_STRTOUMAX = YesPlease
GIT_TEST_CMP = cmp
- endif
- ifeq ($(uname_R),5.7)
+ endif
+ ifeq ($(uname_R),5.7)
NEEDS_RESOLV = YesPlease
NO_IPV6 = YesPlease
NO_SOCKADDR_STORAGE = YesPlease
@@ -202,25 +216,25 @@ ifeq ($(uname_S),SunOS)
NO_STRLCPY = YesPlease
NO_STRTOUMAX = YesPlease
GIT_TEST_CMP = cmp
- endif
- ifeq ($(uname_R),5.8)
+ endif
+ ifeq ($(uname_R),5.8)
NO_UNSETENV = YesPlease
NO_SETENV = YesPlease
NO_STRTOUMAX = YesPlease
GIT_TEST_CMP = cmp
- endif
- ifeq ($(uname_R),5.9)
+ endif
+ ifeq ($(uname_R),5.9)
NO_UNSETENV = YesPlease
NO_SETENV = YesPlease
NO_STRTOUMAX = YesPlease
GIT_TEST_CMP = cmp
- endif
+ endif
INSTALL = /usr/ucb/install
TAR = gtar
BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__
endif
ifeq ($(uname_O),Cygwin)
- ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4)
+ ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4)
NO_D_TYPE_IN_DIRENT = YesPlease
NO_STRCASESTR = YesPlease
NO_MEMMEM = YesPlease
@@ -231,9 +245,9 @@ ifeq ($(uname_O),Cygwin)
# On some boxes NO_MMAP is needed, and not so elsewhere.
# Try commenting this out if you suspect MMAP is more efficient
NO_MMAP = YesPlease
- else
+ else
NO_REGEX = UnfortunatelyYes
- endif
+ endif
HAVE_ALLOCA_H = YesPlease
NEEDS_LIBICONV = YesPlease
NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
@@ -249,25 +263,25 @@ ifeq ($(uname_S),FreeBSD)
NEEDS_LIBICONV = YesPlease
# Versions up to 10.1 require OLD_ICONV; 10.2 and beyond don't.
# A typical version string looks like "10.2-RELEASE".
- ifeq ($(shell expr "$(uname_R)" : '[1-9]\.'),2)
+ ifeq ($(shell expr "$(uname_R)" : '[1-9]\.'),2)
OLD_ICONV = YesPlease
- endif
- ifeq ($(firstword $(subst -, ,$(uname_R))),10.0)
+ endif
+ ifeq ($(firstword $(subst -, ,$(uname_R))),10.0)
OLD_ICONV = YesPlease
- endif
- ifeq ($(firstword $(subst -, ,$(uname_R))),10.1)
+ endif
+ ifeq ($(firstword $(subst -, ,$(uname_R))),10.1)
OLD_ICONV = YesPlease
- endif
+ endif
NO_MEMMEM = YesPlease
BASIC_CFLAGS += -I/usr/local/include
BASIC_LDFLAGS += -L/usr/local/lib
DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
USE_ST_TIMESPEC = YesPlease
- ifeq ($(shell expr "$(uname_R)" : '4\.'),2)
+ ifeq ($(shell expr "$(uname_R)" : '4\.'),2)
PTHREAD_LIBS = -pthread
NO_UINTMAX_T = YesPlease
NO_STRTOUMAX = YesPlease
- endif
+ endif
PYTHON_PATH = /usr/local/bin/python
PERL_PATH = /usr/local/bin/perl
HAVE_PATHS_H = YesPlease
@@ -303,9 +317,9 @@ ifeq ($(uname_S),MirBSD)
CSPRNG_METHOD = arc4random
endif
ifeq ($(uname_S),NetBSD)
- ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2)
+ ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2)
NEEDS_LIBICONV = YesPlease
- endif
+ endif
BASIC_CFLAGS += -I/usr/pkg/include
BASIC_LDFLAGS += -L/usr/pkg/lib $(CC_LD_DYNPATH)/usr/pkg/lib
USE_ST_TIMESPEC = YesPlease
@@ -329,14 +343,14 @@ ifeq ($(uname_S),AIX)
BASIC_CFLAGS += -D_LARGE_FILES
FILENO_IS_A_MACRO = UnfortunatelyYes
NEED_ACCESS_ROOT_HANDLER = UnfortunatelyYes
- ifeq ($(shell expr "$(uname_V)" : '[1234]'),1)
+ ifeq ($(shell expr "$(uname_V)" : '[1234]'),1)
NO_PTHREADS = YesPlease
- else
+ else
PTHREAD_LIBS = -lpthread
- endif
- ifeq ($(shell expr "$(uname_V).$(uname_R)" : '5\.1'),3)
+ endif
+ ifeq ($(shell expr "$(uname_V).$(uname_R)" : '5\.1'),3)
INLINE = ''
- endif
+ endif
GIT_TEST_CMP = cmp
endif
ifeq ($(uname_S),GNU)
@@ -396,29 +410,29 @@ ifeq ($(uname_S),HP-UX)
NO_SYS_SELECT_H = YesPlease
SNPRINTF_RETURNS_BOGUS = YesPlease
NO_NSEC = YesPlease
- ifeq ($(uname_R),B.11.00)
+ ifeq ($(uname_R),B.11.00)
NO_INET_NTOP = YesPlease
NO_INET_PTON = YesPlease
- endif
- ifeq ($(uname_R),B.10.20)
+ endif
+ ifeq ($(uname_R),B.10.20)
# Override HP-UX 11.x setting:
INLINE =
SOCKLEN_T = size_t
NO_PREAD = YesPlease
NO_INET_NTOP = YesPlease
NO_INET_PTON = YesPlease
- endif
+ endif
GIT_TEST_CMP = cmp
endif
ifeq ($(uname_S),Windows)
GIT_VERSION := $(GIT_VERSION).MSVC
pathsep = ;
# Assume that this is built in Git for Windows' SDK
- ifeq (MINGW32,$(MSYSTEM))
+ ifeq (MINGW32,$(MSYSTEM))
prefix = /mingw32
- else
+ else
prefix = /mingw64
- endif
+ endif
# Prepend MSVC 64-bit tool-chain to PATH.
#
# A regular Git Bash *does not* have cl.exe in its $PATH. As there is a
@@ -433,7 +447,6 @@ ifeq ($(uname_S),Windows)
NO_POLL = YesPlease
NO_SYMLINK_HEAD = YesPlease
NO_IPV6 = YesPlease
- NO_UNIX_SOCKETS = YesPlease
NO_SETENV = YesPlease
NO_STRCASESTR = YesPlease
NO_STRLCPY = YesPlease
@@ -525,6 +538,8 @@ else
endif
X = .exe
+ EXTRA_PROGRAMS += headless-git$X
+
compat/msvc.o: compat/msvc.c compat/mingw.c GIT-CFLAGS
endif
ifeq ($(uname_S),Interix)
@@ -534,16 +549,16 @@ ifeq ($(uname_S),Interix)
NO_MKDTEMP = YesPlease
NO_STRTOUMAX = YesPlease
NO_NSEC = YesPlease
- ifeq ($(uname_R),3.5)
+ ifeq ($(uname_R),3.5)
NO_INET_NTOP = YesPlease
NO_INET_PTON = YesPlease
NO_SOCKADDR_STORAGE = YesPlease
- endif
- ifeq ($(uname_R),5.2)
+ endif
+ ifeq ($(uname_R),5.2)
NO_INET_NTOP = YesPlease
NO_INET_PTON = YesPlease
NO_SOCKADDR_STORAGE = YesPlease
- endif
+ endif
endif
ifeq ($(uname_S),Minix)
NO_IPV6 = YesPlease
@@ -563,12 +578,12 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
# still not compile in c89 mode, due to non-const array initializations.
CC = cc -c99
# Build down-rev compatible objects that don't use our new getopt_long.
- ifeq ($(uname_R).$(uname_V),J06.21)
+ ifeq ($(uname_R).$(uname_V),J06.21)
CC += -WRVU=J06.20
- endif
- ifeq ($(uname_R).$(uname_V),L17.02)
+ endif
+ ifeq ($(uname_R).$(uname_V),L17.02)
CC += -WRVU=L16.05
- endif
+ endif
# Disable all optimization, seems to result in bad code, with -O or -O2
# or even -O1 (default), /usr/local/libexec/git-core/git-pack-objects
# abends on "git push". Needs more investigation.
@@ -622,7 +637,22 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
SANE_TOOL_PATH = /usr/coreutils/bin:/usr/local/bin
SHELL_PATH = /usr/coreutils/bin/bash
endif
+ifeq ($(uname_S),OS/390)
+ NO_SYS_POLL_H = YesPlease
+ NO_STRCASESTR = YesPlease
+ NO_REGEX = YesPlease
+ NO_MMAP = YesPlease
+ NO_NSEC = YesPlease
+ NO_STRLCPY = YesPlease
+ NO_MEMMEM = YesPlease
+ NO_GECOS_IN_PWENT = YesPlease
+ HAVE_STRINGS_H = YesPlease
+ NEEDS_MODE_TRANSLATION = YesPlease
+endif
ifeq ($(uname_S),MINGW)
+ ifeq ($(shell expr "$(uname_R)" : '1\.'),2)
+ $(error "Building with MSys is no longer supported")
+ endif
pathsep = ;
HAVE_ALLOCA_H = YesPlease
NO_PREAD = YesPlease
@@ -630,7 +660,6 @@ ifeq ($(uname_S),MINGW)
NO_LIBGEN_H = YesPlease
NO_POLL = YesPlease
NO_SYMLINK_HEAD = YesPlease
- NO_UNIX_SOCKETS = YesPlease
NO_SETENV = YesPlease
NO_STRCASESTR = YesPlease
NO_STRLCPY = YesPlease
@@ -652,11 +681,9 @@ ifeq ($(uname_S),MINGW)
USE_WIN32_IPC = YesPlease
USE_WIN32_MMAP = YesPlease
MMAP_PREVENTS_DELETE = UnfortunatelyYes
- USE_NED_ALLOCATOR = YesPlease
UNRELIABLE_FSTAT = UnfortunatelyYes
OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
NO_REGEX = YesPlease
- NO_PYTHON = YesPlease
ETAGS_TARGET = ETAGS
NO_POSIX_GOODIES = UnfortunatelyYes
DEFAULT_HELP_FORMAT = html
@@ -678,60 +705,43 @@ ifeq ($(uname_S),MINGW)
RC = windres -O coff
NATIVE_CRLF = YesPlease
X = .exe
-ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
- htmldir = doc/git/html/
- prefix =
+ # MSys2
+ prefix = /usr/
+ # Enable DEP
+ BASIC_LDFLAGS += -Wl,--nxcompat
+ # Enable ASLR (unless debugging)
+ ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS))))
+ BASIC_LDFLAGS += -Wl,--dynamicbase
+ endif
+ ifeq (MINGW32,$(MSYSTEM))
+ prefix = /mingw32
+ HOST_CPU = i686
+ BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
+ endif
+ ifeq (MINGW64,$(MSYSTEM))
+ prefix = /mingw64
+ HOST_CPU = x86_64
+ BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
+ else
+ COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
+ BASIC_LDFLAGS += -Wl,--large-address-aware
+ endif
+ CC = gcc
+ COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
+ -fstack-protector-strong
+ EXTLIBS += -lntdll
+ EXTRA_PROGRAMS += headless-git$X
INSTALL = /bin/install
- EXTLIBS += /mingw/lib/libz.a
INTERNAL_QSORT = YesPlease
HAVE_LIBCHARSET_H = YesPlease
- NO_GETTEXT = YesPlease
- COMPAT_CFLAGS += -D__USE_MINGW_ACCESS
-else
- ifneq ($(shell expr "$(uname_R)" : '1\.'),2)
- # MSys2
- prefix = /usr/
- # Enable DEP
- BASIC_LDFLAGS += -Wl,--nxcompat
- # Enable ASLR (unless debugging)
- ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS))))
- BASIC_LDFLAGS += -Wl,--dynamicbase
- endif
- ifeq (MINGW32,$(MSYSTEM))
- prefix = /mingw32
- HOST_CPU = i686
- BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
- endif
- ifeq (MINGW64,$(MSYSTEM))
- prefix = /mingw64
- HOST_CPU = x86_64
- BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
- else
- COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
- BASIC_LDFLAGS += -Wl,--large-address-aware
- endif
- CC = gcc
- COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
- -fstack-protector-strong
- EXTLIBS += -lntdll
- INSTALL = /bin/install
- INTERNAL_QSORT = YesPlease
- HAVE_LIBCHARSET_H = YesPlease
- NO_GETTEXT =
- USE_GETTEXT_SCHEME = fallthrough
- USE_LIBPCRE = YesPlease
- NO_CURL =
- USE_NED_ALLOCATOR = YesPlease
- ifeq (/mingw64,$(subst 32,64,$(prefix)))
- # Move system config into top-level /etc/
- ETC_GITCONFIG = ../etc/gitconfig
- ETC_GITATTRIBUTES = ../etc/gitattributes
- endif
- else
- COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO
- NO_CURL = YesPlease
- endif
-endif
+ USE_GETTEXT_SCHEME = fallthrough
+ USE_LIBPCRE = YesPlease
+ USE_NED_ALLOCATOR = YesPlease
+ ifeq (/mingw64,$(subst 32,64,$(prefix)))
+ # Move system config into top-level /etc/
+ ETC_GITCONFIG = ../etc/gitconfig
+ ETC_GITATTRIBUTES = ../etc/gitattributes
+ endif
endif
ifeq ($(uname_S),QNX)
COMPAT_CFLAGS += -DSA_RESTART=0
diff --git a/configure.ac b/configure.ac
index 7dcd048..d1a96da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -94,7 +94,7 @@ AC_DEFUN([GIT_PARSE_WITH_SET_MAKE_VAR],
[AC_ARG_WITH([$1],
[AS_HELP_STRING([--with-$1=VALUE], $3)],
if test -n "$withval"; then
- if test "$withval" = "yes" -o "$withval" = "no"; then
+ if test "$withval" = "yes" || test "$withval" = "no"; then
AC_MSG_WARN([You likely do not want either 'yes' or 'no' as]
[a value for $1 ($2). Maybe you do...?])
fi
@@ -237,9 +237,6 @@ AC_MSG_NOTICE([CHECKS for site configuration])
# tests. These tests take up a significant amount of the total test time
# but are not needed unless you plan to talk to SVN repos.
#
-# Define PPC_SHA1 environment variable when running make to make use of
-# a bundled SHA1 routine optimized for PowerPC.
-#
# Define NO_OPENSSL environment variable if you do not have OpenSSL.
#
# Define OPENSSLDIR=/foo/bar if your openssl header and library files are in
@@ -549,6 +546,8 @@ fi
# git-http-push are not built, and you cannot use http:// and https://
# transports.
+if test -z "$NO_CURL"; then
+
GIT_STASH_FLAGS($CURLDIR)
AC_CHECK_LIB([curl], [curl_global_init],
@@ -557,6 +556,8 @@ AC_CHECK_LIB([curl], [curl_global_init],
GIT_UNSTASH_FLAGS($CURLDIR)
+fi
+
GIT_CONF_SUBST([NO_CURL])
if test -z "$NO_CURL"; then
@@ -584,6 +585,8 @@ fi
# Define NO_EXPAT if you do not have expat installed. git-http-push is
# not built, and you cannot push using http:// and https:// transports.
+if test -z "$NO_EXPAT"; then
+
GIT_STASH_FLAGS($EXPATDIR)
AC_CHECK_LIB([expat], [XML_ParserCreate],
@@ -592,6 +595,8 @@ AC_CHECK_LIB([expat], [XML_ParserCreate],
GIT_UNSTASH_FLAGS($EXPATDIR)
+fi
+
GIT_CONF_SUBST([NO_EXPAT])
#
@@ -639,7 +644,6 @@ LIBS="$old_LIBS"
GIT_UNSTASH_FLAGS($ICONVDIR)
GIT_CONF_SUBST([NEEDS_LIBICONV])
-GIT_CONF_SUBST([NO_ICONV])
if test -n "$NO_ICONV"; then
NEEDS_LIBICONV=
@@ -647,6 +651,8 @@ fi
fi
+GIT_CONF_SUBST([NO_ICONV])
+
#
# Define NO_DEFLATE_BOUND if deflateBound is missing from zlib.
diff --git a/connect.c b/connect.c
index 5ea53de..0d77737 100644
--- a/connect.c
+++ b/connect.c
@@ -1,6 +1,8 @@
#include "git-compat-util.h"
-#include "cache.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "pkt-line.h"
#include "quote.h"
#include "refs.h"
@@ -10,15 +12,18 @@
#include "url.h"
#include "string-list.h"
#include "oid-array.h"
+#include "path.h"
#include "transport.h"
+#include "trace2.h"
#include "strbuf.h"
#include "version.h"
#include "protocol.h"
#include "alias.h"
+#include "bundle-uri.h"
static char *server_capabilities_v1;
static struct strvec server_capabilities_v2 = STRVEC_INIT;
-static const char *next_server_feature_value(const char *feature, int *len, int *offset);
+static const char *next_server_feature_value(const char *feature, size_t *len, size_t *offset);
static int check_ref(const char *name, unsigned int flags)
{
@@ -29,7 +34,8 @@ static int check_ref(const char *name, unsigned int flags)
return 0;
/* REF_NORMAL means that we don't want the magic fake tag refs */
- if ((flags & REF_NORMAL) && check_refname_format(name, 0))
+ if ((flags & REF_NORMAL) && check_refname_format(name,
+ REFNAME_ALLOW_ONELEVEL))
return 0;
/* REF_HEADS means that we want regular branch heads */
@@ -66,7 +72,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 die_on_error)
+int server_supports_v2(const char *c)
{
int i;
@@ -76,11 +82,13 @@ int server_supports_v2(const char *c, int die_on_error)
(!*out || *out == '='))
return 1;
}
+ return 0;
+}
- if (die_on_error)
+void ensure_server_supports_v2(const char *c)
+{
+ if (!server_supports_v2(c))
die(_("server doesn't support '%s'"), c);
-
- return 0;
}
int server_feature_v2(const char *c, const char **v)
@@ -198,10 +206,10 @@ reject:
static void annotate_refs_with_symref_info(struct ref *ref)
{
struct string_list symref = STRING_LIST_INIT_DUP;
- int offset = 0;
+ size_t offset = 0;
while (1) {
- int len;
+ size_t len;
const char *val;
val = next_server_feature_value("symref", &len, &offset);
@@ -224,7 +232,7 @@ static void annotate_refs_with_symref_info(struct ref *ref)
static void process_capabilities(struct packet_reader *reader, int *linelen)
{
const char *feat_val;
- int feat_len;
+ size_t feat_len;
const char *line = reader->line;
int nul_location = strlen(line);
if (nul_location == *linelen)
@@ -256,7 +264,8 @@ static int process_dummy_ref(const struct packet_reader *reader)
return 0;
name++;
- return oideq(null_oid(), &oid) && !strcmp(name, "capabilities^{}");
+ return oideq(reader->hash_algo->null_oid, &oid) &&
+ !strcmp(name, "capabilities^{}");
}
static void check_no_capabilities(const char *line, int len)
@@ -477,7 +486,7 @@ static void send_capabilities(int fd_out, struct packet_reader *reader)
{
const char *hash_name;
- if (server_supports_v2("agent", 0))
+ if (server_supports_v2("agent"))
packet_write_fmt(fd_out, "agent=%s", git_user_agent_sanitized());
if (server_feature_v2("object-format", &hash_name)) {
@@ -491,6 +500,49 @@ static void send_capabilities(int fd_out, struct packet_reader *reader)
}
}
+int get_remote_bundle_uri(int fd_out, struct packet_reader *reader,
+ struct bundle_list *bundles, int stateless_rpc)
+{
+ int line_nr = 1;
+
+ /* Assert bundle-uri support */
+ ensure_server_supports_v2("bundle-uri");
+
+ /* (Re-)send capabilities */
+ send_capabilities(fd_out, reader);
+
+ /* Send command */
+ packet_write_fmt(fd_out, "command=bundle-uri\n");
+ packet_delim(fd_out);
+
+ packet_flush(fd_out);
+
+ /* Process response from server */
+ while (packet_reader_read(reader) == PACKET_READ_NORMAL) {
+ const char *line = reader->line;
+ line_nr++;
+
+ if (!bundle_uri_parse_line(bundles, line))
+ continue;
+
+ return error(_("error on bundle-uri response line %d: %s"),
+ line_nr, line);
+ }
+
+ if (reader->status != PACKET_READ_FLUSH)
+ return error(_("expected flush after bundle-uri listing"));
+
+ /*
+ * Might die(), but obscure enough that that's OK, e.g. in
+ * serve.c we'll call BUG() on its equivalent (the
+ * PACKET_READ_RESPONSE_END check).
+ */
+ check_stateless_delimiter(stateless_rpc, reader,
+ _("expected response end packet after ref listing"));
+
+ return 0;
+}
+
struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,
struct ref **list, int for_push,
struct transport_ls_refs_options *transport_options,
@@ -504,17 +556,18 @@ struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,
&transport_options->unborn_head_target : NULL;
*list = NULL;
- if (server_supports_v2("ls-refs", 1))
- packet_write_fmt(fd_out, "command=ls-refs\n");
+ ensure_server_supports_v2("ls-refs");
+ packet_write_fmt(fd_out, "command=ls-refs\n");
/* Send capabilities */
send_capabilities(fd_out, reader);
- if (server_options && server_options->nr &&
- server_supports_v2("server-option", 1))
+ if (server_options && server_options->nr) {
+ ensure_server_supports_v2("server-option");
for (i = 0; i < server_options->nr; i++)
packet_write_fmt(fd_out, "server-option=%s",
server_options->items[i].string);
+ }
packet_delim(fd_out);
/* When pushing we don't want to request the peeled tags */
@@ -544,9 +597,10 @@ struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,
return list;
}
-const char *parse_feature_value(const char *feature_list, const char *feature, int *lenp, int *offset)
+const char *parse_feature_value(const char *feature_list, const char *feature, size_t *lenp, size_t *offset)
{
- int len;
+ const char *orig_start = feature_list;
+ size_t len;
if (!feature_list)
return NULL;
@@ -565,19 +619,19 @@ const char *parse_feature_value(const char *feature_list, const char *feature, i
if (lenp)
*lenp = 0;
if (offset)
- *offset = found + len - feature_list;
+ *offset = found + len - orig_start;
return value;
}
/* feature with a value (e.g., "agent=git/1.2.3") */
else if (*value == '=') {
- int end;
+ size_t end;
value++;
end = strcspn(value, " \t\n");
if (lenp)
*lenp = end;
if (offset)
- *offset = value + end - feature_list;
+ *offset = value + end - orig_start;
return value;
}
/*
@@ -592,8 +646,8 @@ const char *parse_feature_value(const char *feature_list, const char *feature, i
int server_supports_hash(const char *desired, int *feature_supported)
{
- int offset = 0;
- int len;
+ size_t offset = 0;
+ size_t len;
const char *hash;
hash = next_server_feature_value("object-format", &len, &offset);
@@ -617,12 +671,12 @@ int parse_feature_request(const char *feature_list, const char *feature)
return !!parse_feature_value(feature_list, feature, NULL, NULL);
}
-static const char *next_server_feature_value(const char *feature, int *len, int *offset)
+static const char *next_server_feature_value(const char *feature, size_t *len, size_t *offset)
{
return parse_feature_value(server_capabilities_v1, feature, len, offset);
}
-const char *server_feature_value(const char *feature, int *len)
+const char *server_feature_value(const char *feature, size_t *len)
{
return parse_feature_value(server_capabilities_v1, feature, len, NULL);
}
@@ -911,7 +965,7 @@ static struct child_process *git_tcp_connect(int fd[2], char *host, int flags)
static char *git_proxy_command;
static int git_proxy_command_options(const char *var, const char *value,
- void *cb)
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(var, "core.gitproxy")) {
const char *for_pos;
@@ -957,7 +1011,7 @@ static int git_proxy_command_options(const char *var, const char *value,
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
static int git_use_proxy(const char *host)
@@ -1359,6 +1413,7 @@ static void fill_ssh_args(struct child_process *conn, const char *ssh_host,
* the connection failed).
*/
struct child_process *git_connect(int fd[2], const char *url,
+ const char *name,
const char *prog, int flags)
{
char *hostandport, *path;
@@ -1368,10 +1423,11 @@ struct child_process *git_connect(int fd[2], const char *url,
/*
* NEEDSWORK: If we are trying to use protocol v2 and we are planning
- * to perform a push, then fallback to v0 since the client doesn't know
- * how to push yet using v2.
+ * to perform any operation that doesn't involve upload-pack (i.e., a
+ * fetch, ls-remote, etc), then fallback to v0 since we don't know how
+ * to do anything else (like push or remote archive) via v2.
*/
- if (version == protocol_v2 && !strcmp("git-receive-pack", prog))
+ if (version == protocol_v2 && strcmp("git-upload-pack", name))
version = protocol_v0;
/* Without this we cannot rely on waitpid() to tell
diff --git a/connect.h b/connect.h
index c53586e..1645126 100644
--- a/connect.h
+++ b/connect.h
@@ -7,20 +7,21 @@
#define CONNECT_DIAG_URL (1u << 1)
#define CONNECT_IPV4 (1u << 2)
#define CONNECT_IPV6 (1u << 3)
-struct child_process *git_connect(int fd[2], const char *url, const char *prog, int flags);
+struct child_process *git_connect(int fd[2], const char *url, const char *name, const char *prog, int flags);
int finish_connect(struct child_process *conn);
int git_connection_is_socket(struct child_process *conn);
int server_supports(const char *feature);
int parse_feature_request(const char *features, const char *feature);
-const char *server_feature_value(const char *feature, int *len_ret);
+const char *server_feature_value(const char *feature, size_t *len_ret);
int url_is_local_not_ssh(const char *url);
struct packet_reader;
enum protocol_version discover_version(struct packet_reader *reader);
int server_supports_hash(const char *desired, int *feature_supported);
-const char *parse_feature_value(const char *feature_list, const char *feature, int *lenp, int *offset);
-int server_supports_v2(const char *c, int die_on_error);
+const char *parse_feature_value(const char *feature_list, const char *feature, size_t *lenp, size_t *offset);
+int server_supports_v2(const char *c);
+void ensure_server_supports_v2(const char *c);
int server_feature_v2(const char *c, const char **v);
int server_supports_feature(const char *c, const char *feature,
int die_on_error);
diff --git a/connected.c b/connected.c
index 74a20cb..8f89376 100644
--- a/connected.c
+++ b/connected.c
@@ -1,5 +1,7 @@
-#include "cache.h"
-#include "object-store.h"
+#include "git-compat-util.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-store-ll.h"
#include "run-command.h"
#include "sigchain.h"
#include "connected.h"
@@ -54,7 +56,7 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
strbuf_release(&idx_file);
}
- if (has_promisor_remote()) {
+ if (repo_has_promisor_remote(the_repository)) {
/*
* For partial clones, we don't want to have to do a regular
* connectivity check because we have to enumerate and exclude
@@ -85,6 +87,7 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
promisor_pack_found:
;
} while ((oid = fn(cb_data)) != NULL);
+ free(new_pack);
return 0;
}
@@ -96,10 +99,13 @@ no_promisor_pack_found:
strvec_push(&rev_list.args,"rev-list");
strvec_push(&rev_list.args, "--objects");
strvec_push(&rev_list.args, "--stdin");
- if (has_promisor_remote())
+ if (repo_has_promisor_remote(the_repository))
strvec_push(&rev_list.args, "--exclude-promisor-objects");
if (!opt->is_deepening_fetch) {
strvec_push(&rev_list.args, "--not");
+ if (opt->exclude_hidden_refs_section)
+ strvec_pushf(&rev_list.args, "--exclude-hidden=%s",
+ opt->exclude_hidden_refs_section);
strvec_push(&rev_list.args, "--all");
}
strvec_push(&rev_list.args, "--quiet");
@@ -118,8 +124,10 @@ no_promisor_pack_found:
else
rev_list.no_stderr = opt->quiet;
- if (start_command(&rev_list))
+ if (start_command(&rev_list)) {
+ free(new_pack);
return error(_("Could not run 'git rev-list'"));
+ }
sigchain_push(SIGPIPE, SIG_IGN);
@@ -151,5 +159,6 @@ no_promisor_pack_found:
err = error_errno(_("failed to close rev-list's stdin"));
sigchain_pop(SIGPIPE);
+ free(new_pack);
return finish_command(&rev_list) || err;
}
diff --git a/connected.h b/connected.h
index 6e59c92..16b2c84 100644
--- a/connected.h
+++ b/connected.h
@@ -46,6 +46,13 @@ struct check_connected_options {
* during a fetch.
*/
unsigned is_deepening_fetch : 1;
+
+ /*
+ * If not NULL, use `--exclude-hidden=$section` to exclude all refs
+ * hidden via the `$section.hideRefs` config from the set of
+ * already-reachable refs.
+ */
+ const char *exclude_hidden_refs_section;
};
#define CHECK_CONNECTED_INIT { 0 }
diff --git a/contrib/README b/contrib/README
index 05f291c..21d3d0e 100644
--- a/contrib/README
+++ b/contrib/README
@@ -23,7 +23,7 @@ This is the same way as how I have been treating gitk, and to a
lesser degree various foreign SCM interfaces, so you know the
drill.
-I expect that things that start their life in the contrib/ area
+I expect things that start their life in the contrib/ area
to graduate out of contrib/ once they mature, either by becoming
projects on their own, or moving to the toplevel directory. On
the other hand, I expect I'll be proposing removal of disused
@@ -31,7 +31,7 @@ and inactive ones from time to time.
If you have new things to add to this area, please first propose
it on the git mailing list, and after a list discussion proves
-there are some general interests (it does not have to be a
+there is general interest (it does not have to be a
list-wide consensus for a tool targeted to a relatively narrow
audience -- for example I do not work with projects whose
upstream is svn, so I have no use for git-svn myself, but it is
diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
index 1b23f24..804629c 100644
--- a/contrib/buildsystems/CMakeLists.txt
+++ b/contrib/buildsystems/CMakeLists.txt
@@ -77,7 +77,7 @@ if(USE_VCPKG)
set(CMAKE_TOOLCHAIN_FILE ${VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake CACHE STRING "Vcpkg toolchain file")
endif()
-find_program(SH_EXE sh PATHS "C:/Program Files/Git/bin")
+find_program(SH_EXE sh PATHS "C:/Program Files/Git/bin" "$ENV{LOCALAPPDATA}/Programs/Git/bin")
if(NOT SH_EXE)
message(FATAL_ERROR "sh: shell interpreter was not found in your path, please install one."
"On Windows, you can get it as part of 'Git for Windows' install at https://gitforwindows.org/")
@@ -227,7 +227,7 @@ add_compile_definitions(GIT_HOST_CPU="${CMAKE_SYSTEM_PROCESSOR}")
add_compile_definitions(SHA256_BLK INTERNAL_QSORT RUNTIME_PREFIX)
add_compile_definitions(NO_OPENSSL SHA1_DC SHA1DC_NO_STANDARD_INCLUDES
SHA1DC_INIT_SAFE_HASH_DEFAULT=0
- SHA1DC_CUSTOM_INCLUDE_SHA1_C="cache.h"
+ SHA1DC_CUSTOM_INCLUDE_SHA1_C="git-compat-util.h"
SHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="git-compat-util.h" )
list(APPEND compat_SOURCES sha1dc_git.c sha1dc/sha1.c sha1dc/ubc_check.c block-sha1/sha1.c sha256/block/sha256.c compat/qsort_s.c)
@@ -308,6 +308,8 @@ if(SUPPORTS_SIMPLE_IPC)
add_compile_definitions(HAVE_FSMONITOR_DAEMON_BACKEND)
list(APPEND compat_SOURCES compat/fsmonitor/fsm-listen-win32.c)
list(APPEND compat_SOURCES compat/fsmonitor/fsm-health-win32.c)
+ list(APPEND compat_SOURCES compat/fsmonitor/fsm-ipc-win32.c)
+ list(APPEND compat_SOURCES compat/fsmonitor/fsm-path-utils-win32.c)
add_compile_definitions(HAVE_FSMONITOR_OS_SETTINGS)
list(APPEND compat_SOURCES compat/fsmonitor/fsm-settings-win32.c)
@@ -315,6 +317,8 @@ if(SUPPORTS_SIMPLE_IPC)
add_compile_definitions(HAVE_FSMONITOR_DAEMON_BACKEND)
list(APPEND compat_SOURCES compat/fsmonitor/fsm-listen-darwin.c)
list(APPEND compat_SOURCES compat/fsmonitor/fsm-health-darwin.c)
+ list(APPEND compat_SOURCES compat/fsmonitor/fsm-ipc-darwin.c)
+ list(APPEND compat_SOURCES compat/fsmonitor/fsm-path-utils-darwin.c)
add_compile_definitions(HAVE_FSMONITOR_OS_SETTINGS)
list(APPEND compat_SOURCES compat/fsmonitor/fsm-settings-darwin.c)
@@ -610,7 +614,7 @@ unset(CMAKE_REQUIRED_INCLUDES)
#programs
set(PROGRAMS_BUILT
git git-daemon git-http-backend git-sh-i18n--envsubst
- git-shell)
+ git-shell scalar)
if(NOT CURL_FOUND)
list(APPEND excluded_progs git-http-fetch git-http-push)
@@ -734,6 +738,15 @@ if(WIN32)
else()
message(FATAL_ERROR "Unhandled compiler: ${CMAKE_C_COMPILER_ID}")
endif()
+
+ add_executable(headless-git ${CMAKE_SOURCE_DIR}/compat/win32/headless.c)
+ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ target_link_options(headless-git PUBLIC -municode -Wl,-subsystem,windows)
+ elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
+ target_link_options(headless-git PUBLIC /NOLOGO /ENTRY:wWinMainCRTStartup /SUBSYSTEM:WINDOWS)
+ else()
+ message(FATAL_ERROR "Unhandled compiler: ${CMAKE_C_COMPILER_ID}")
+ endif()
elseif(UNIX)
target_link_libraries(common-main pthread rt)
endif()
@@ -757,6 +770,9 @@ target_link_libraries(git-sh-i18n--envsubst common-main)
add_executable(git-shell ${CMAKE_SOURCE_DIR}/shell.c)
target_link_libraries(git-shell common-main)
+add_executable(scalar ${CMAKE_SOURCE_DIR}/scalar.c)
+target_link_libraries(scalar common-main)
+
if(CURL_FOUND)
add_library(http_obj OBJECT ${CMAKE_SOURCE_DIR}/http.c)
@@ -903,7 +919,7 @@ list(TRANSFORM git_perl_scripts PREPEND "${CMAKE_BINARY_DIR}/")
#install
foreach(program ${PROGRAMS_BUILT})
-if(program STREQUAL "git" OR program STREQUAL "git-shell")
+if(program MATCHES "^(git|git-shell|scalar)$")
install(TARGETS ${program}
RUNTIME DESTINATION bin)
else()
@@ -958,6 +974,35 @@ target_link_libraries(test-fake-ssh common-main)
parse_makefile_for_sources(test-reftable_SOURCES "REFTABLE_TEST_OBJS")
list(TRANSFORM test-reftable_SOURCES PREPEND "${CMAKE_SOURCE_DIR}/")
+#unit-tests
+add_library(unit-test-lib OBJECT ${CMAKE_SOURCE_DIR}/t/unit-tests/test-lib.c)
+
+parse_makefile_for_scripts(unit_test_PROGRAMS "UNIT_TEST_PROGRAMS" "")
+foreach(unit_test ${unit_test_PROGRAMS})
+ add_executable("${unit_test}" "${CMAKE_SOURCE_DIR}/t/unit-tests/${unit_test}.c")
+ target_link_libraries("${unit_test}" unit-test-lib common-main)
+ set_target_properties("${unit_test}"
+ PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/t/unit-tests/bin)
+ if(MSVC)
+ set_target_properties("${unit_test}"
+ PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/t/unit-tests/bin)
+ set_target_properties("${unit_test}"
+ PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/t/unit-tests/bin)
+ endif()
+ list(APPEND PROGRAMS_BUILT "${unit_test}")
+
+ # t-basic intentionally fails tests, to validate the unit-test infrastructure.
+ # Therefore, it should only be run as part of t0080, which verifies that it
+ # fails only in the expected ways.
+ #
+ # All other unit tests should be run.
+ if(NOT ${unit_test} STREQUAL "t-basic")
+ add_test(NAME "t.unit-tests.${unit_test}"
+ COMMAND "./${unit_test}"
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/t/unit-tests/bin)
+ endif()
+endforeach()
+
#test-tool
parse_makefile_for_sources(test-tool_SOURCES "TEST_BUILTINS_OBJS")
@@ -977,7 +1022,7 @@ endif()
#wrapper scripts
set(wrapper_scripts
- git git-upload-pack git-receive-pack git-upload-archive git-shell git-remote-ext)
+ git git-upload-pack git-receive-pack git-upload-archive git-shell git-remote-ext scalar)
set(wrapper_test_scripts
test-fake-ssh test-tool)
@@ -1018,7 +1063,6 @@ set(NO_PERL )
set(NO_PTHREADS )
set(NO_PYTHON )
set(PAGER_ENV "LESS=FRX LV=-c")
-set(DC_SHA1 YesPlease)
set(RUNTIME_PREFIX true)
set(NO_GETTEXT )
@@ -1054,7 +1098,6 @@ 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 "DC_SHA1='${DC_SHA1}'\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")
@@ -1067,29 +1110,30 @@ endif()
#Make the tests work when building out of the source tree
get_filename_component(CACHE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../CMakeCache.txt ABSOLUTE)
if(NOT ${CMAKE_BINARY_DIR}/CMakeCache.txt STREQUAL ${CACHE_PATH})
- file(RELATIVE_PATH BUILD_DIR_RELATIVE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/CMakeCache.txt)
- string(REPLACE "/CMakeCache.txt" "" BUILD_DIR_RELATIVE ${BUILD_DIR_RELATIVE})
#Setting the build directory in test-lib.sh before running tests
file(WRITE ${CMAKE_BINARY_DIR}/CTestCustom.cmake
- "file(STRINGS ${CMAKE_SOURCE_DIR}/t/test-lib.sh GIT_BUILD_DIR_REPL REGEX \"GIT_BUILD_DIR=(.*)\")\n"
- "file(STRINGS ${CMAKE_SOURCE_DIR}/t/test-lib.sh content NEWLINE_CONSUME)\n"
- "string(REPLACE \"\${GIT_BUILD_DIR_REPL}\" \"GIT_BUILD_DIR=\\\"$TEST_DIRECTORY/../${BUILD_DIR_RELATIVE}\\\"\" content \"\${content}\")\n"
- "file(WRITE ${CMAKE_SOURCE_DIR}/t/test-lib.sh \${content})")
+ "file(WRITE ${CMAKE_SOURCE_DIR}/GIT-BUILD-DIR \"${CMAKE_BINARY_DIR}\")")
#misc copies
- file(COPY ${CMAKE_SOURCE_DIR}/t/chainlint.sed DESTINATION ${CMAKE_BINARY_DIR}/t/)
+ file(COPY ${CMAKE_SOURCE_DIR}/t/chainlint.pl DESTINATION ${CMAKE_BINARY_DIR}/t/)
file(COPY ${CMAKE_SOURCE_DIR}/po/is.po DESTINATION ${CMAKE_BINARY_DIR}/po/)
- file(COPY ${CMAKE_SOURCE_DIR}/mergetools/tkdiff DESTINATION ${CMAKE_BINARY_DIR}/mergetools/)
+ file(GLOB mergetools "${CMAKE_SOURCE_DIR}/mergetools/*")
+ file(COPY ${mergetools} DESTINATION ${CMAKE_BINARY_DIR}/mergetools/)
file(COPY ${CMAKE_SOURCE_DIR}/contrib/completion/git-prompt.sh DESTINATION ${CMAKE_BINARY_DIR}/contrib/completion/)
file(COPY ${CMAKE_SOURCE_DIR}/contrib/completion/git-completion.bash DESTINATION ${CMAKE_BINARY_DIR}/contrib/completion/)
endif()
-file(GLOB test_scipts "${CMAKE_SOURCE_DIR}/t/t[0-9]*.sh")
+file(GLOB test_scripts "${CMAKE_SOURCE_DIR}/t/t[0-9]*.sh")
#test
-foreach(tsh ${test_scipts})
- add_test(NAME ${tsh}
- COMMAND ${SH_EXE} ${tsh}
+foreach(tsh ${test_scripts})
+ string(REGEX REPLACE ".*/(.*)\\.sh" "\\1" test_name ${tsh})
+ add_test(NAME "t.suite.${test_name}"
+ COMMAND ${SH_EXE} ${tsh} --no-bin-wrappers --no-chain-lint -vx
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/t)
endforeach()
+# This test script takes an extremely long time and is known to time out even
+# on fast machines because it requires in excess of one hour to run
+set_tests_properties("t.suite.t7112-reset-submodule" PROPERTIES TIMEOUT 4000)
+
endif()#BUILD_TESTING
diff --git a/contrib/buildsystems/Generators/Vcxproj.pm b/contrib/buildsystems/Generators/Vcxproj.pm
index 1a25789..b2e68a1 100644
--- a/contrib/buildsystems/Generators/Vcxproj.pm
+++ b/contrib/buildsystems/Generators/Vcxproj.pm
@@ -76,7 +76,7 @@ sub createProject {
my $libs_release = "\n ";
my $libs_debug = "\n ";
- if (!$static_library) {
+ if (!$static_library && $name ne 'headless-git') {
$libs_release = join(";", sort(grep /^(?!libgit\.lib|xdiff\/lib\.lib|vcs-svn\/lib\.lib|reftable\/libreftable\.lib)/, @{$$build_structure{"$prefix${name}_LIBS"}}));
$libs_debug = $libs_release;
$libs_debug =~ s/zlib\.lib/zlibd\.lib/g;
@@ -230,7 +230,7 @@ EOM
print F << "EOM";
</ItemGroup>
EOM
- if (!$static_library || $target =~ 'vcs-svn' || $target =~ 'xdiff') {
+ if ((!$static_library || $target =~ 'vcs-svn' || $target =~ 'xdiff') && !($name =~ /headless-git/)) {
my $uuid_libgit = $$build_structure{"LIBS_libgit_GUID"};
my $uuid_libreftable = $$build_structure{"LIBS_reftable/libreftable_GUID"};
my $uuid_xdiff_lib = $$build_structure{"LIBS_xdiff/lib_GUID"};
diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl
index ed6c459..069be7e 100755
--- a/contrib/buildsystems/engine.pl
+++ b/contrib/buildsystems/engine.pl
@@ -371,6 +371,7 @@ sub handleLinkLine
# exit(1);
foreach (@objfiles) {
my $sourcefile = $_;
+ $sourcefile =~ s/^headless-git\.o$/compat\/win32\/headless.c/;
$sourcefile =~ s/\.o$/.c/;
push(@sources, $sourcefile);
push(@cflags, @{$compile_options{"${sourcefile}_CFLAGS"}});
diff --git a/contrib/coccinelle/.gitignore b/contrib/coccinelle/.gitignore
index d3f2964..1d45c0a 100644
--- a/contrib/coccinelle/.gitignore
+++ b/contrib/coccinelle/.gitignore
@@ -1 +1 @@
-*.patch*
+*.patch
diff --git a/contrib/coccinelle/README b/contrib/coccinelle/README
index f0e80bd..055ad0e 100644
--- a/contrib/coccinelle/README
+++ b/contrib/coccinelle/README
@@ -1,7 +1,9 @@
-This directory provides examples of Coccinelle (http://coccinelle.lip6.fr/)
-semantic patches that might be useful to developers.
+= coccinelle
-There are two types of semantic patches:
+This directory provides Coccinelle (http://coccinelle.lip6.fr/) semantic patches
+that might be useful to developers.
+
+== Types of semantic patches
* Using the semantic transformation to check for bad patterns in the code;
The target 'make coccicheck' is designed to check for these patterns and
@@ -41,3 +43,82 @@ There are two types of semantic patches:
This allows to expose plans of pending large scale refactorings without
impacting the bad pattern checks.
+
+== Git-specific tips & things to know about how we run "spatch":
+
+ * The "make coccicheck" will piggy-back on
+ "COMPUTE_HEADER_DEPENDENCIES". If you've built a given object file
+ the "coccicheck" target will consider its depednency to decide if
+ it needs to re-run on the corresponding source file.
+
+ This means that a "make coccicheck" will re-compile object files
+ before running. This might be unexpected, but speeds up the run in
+ the common case, as e.g. a change to "column.h" won't require all
+ coccinelle rules to be re-run against "grep.c" (or another file
+ that happens not to use "column.h").
+
+ To disable this behavior use the "SPATCH_USE_O_DEPENDENCIES=NoThanks"
+ flag.
+
+ * To speed up our rules the "make coccicheck" target will by default
+ concatenate all of the *.cocci files here into an "ALL.cocci", and
+ apply it to each source file.
+
+ This makes the run faster, as we don't need to run each rule
+ against each source file. See the Makefile for further discussion,
+ this behavior can be disabled with "SPATCH_CONCAT_COCCI=".
+
+ But since they're concatenated any <id> in the <rulname> (e.g. "@
+ my_name", v.s. anonymous "@@") needs to be unique across all our
+ *.cocci files. You should only need to name rules if other rules
+ depend on them (currently only one rule is named).
+
+ * To speed up incremental runs even more use the "spatchcache" tool
+ in this directory as your "SPATCH". It aimns to be a "ccache" for
+ coccinelle, and piggy-backs on "COMPUTE_HEADER_DEPENDENCIES".
+
+ It caches in Redis by default, see it source for a how-to.
+
+ In one setup with a primed cache "make coccicheck" followed by a
+ "make clean && make" takes around 10s to run, but 2m30s with the
+ default of "SPATCH_CONCAT_COCCI=Y".
+
+ With "SPATCH_CONCAT_COCCI=" the total runtime is around ~6m, sped
+ up to ~1m with "spatchcache".
+
+ Most of the 10s (or ~1m) being spent on re-running "spatch" on
+ files we couldn't cache, as we didn't compile them (in contrib/*
+ and compat/* mostly).
+
+ The absolute times will differ for you, but the relative speedup
+ from caching should be on that order.
+
+== Authoring and reviewing coccinelle changes
+
+* When a .cocci is made, both the Git changes and .cocci file should be
+ reviewed. When reviewing such a change, do your best to understand the .cocci
+ changes (e.g. by asking the author to explain the change) and be explicit
+ about your understanding of the changes. This helps us decide whether input
+ from coccinelle experts is needed or not. If you aren't sure of the cocci
+ changes, indicate what changes you actively endorse and leave an Acked-by
+ (instead of Reviewed-by).
+
+* Authors should consider that reviewers may not be coccinelle experts, thus the
+ the .cocci changes may not be self-evident. A plain text description of the
+ changes is strongly encouraged, especially when using more esoteric features
+ of the language.
+
+* .cocci rules should target only the problem it is trying to solve; "collateral
+ damage" is not allowed. Reviewers should look out and flag overly-broad rules.
+
+* Consider the cost-benefit ratio of .cocci changes. In particular, consider the
+ effect on the runtime of "make coccicheck", and how often your .cocci check
+ will catch something valuable. As a rule of thumb, rules that can bail early
+ if a file doesn't have a particular token will have a small impact on runtime,
+ and vice-versa.
+
+* .cocci files used for refactoring should be temporarily kept in-tree to aid
+ the refactoring of out-of-tree code (e.g. in-flight topics). Periodically
+ evaluate the cost-benefit ratio to determine when the file should be removed.
+ For example, consider how many out-of-tree users are left and how much this
+ slows down "make coccicheck".
diff --git a/contrib/coccinelle/array.cocci b/contrib/coccinelle/array.cocci
index 9a4f00c..27a3b47 100644
--- a/contrib/coccinelle/array.cocci
+++ b/contrib/coccinelle/array.cocci
@@ -1,60 +1,58 @@
@@
-expression dst, src, n, E;
+type T;
+T *dst_ptr;
+T *src_ptr;
+expression n;
@@
- memcpy(dst, src, n * sizeof(
-- E[...]
-+ *(E)
- ))
+- memcpy(dst_ptr, src_ptr, (n) * \( sizeof(T)
+- \| sizeof(*(dst_ptr))
+- \| sizeof(*(src_ptr))
+- \| sizeof(dst_ptr[...])
+- \| sizeof(src_ptr[...])
+- \) )
++ COPY_ARRAY(dst_ptr, src_ptr, n)
@@
type T;
-T *ptr;
-T[] arr;
-expression E, n;
+T *dst_ptr;
+T[] src_arr;
+expression n;
@@
-(
- memcpy(ptr, E,
-- n * sizeof(*(ptr))
-+ n * sizeof(T)
- )
-|
- memcpy(arr, E,
-- n * sizeof(*(arr))
-+ n * sizeof(T)
- )
-|
- memcpy(E, ptr,
-- n * sizeof(*(ptr))
-+ n * sizeof(T)
- )
-|
- memcpy(E, arr,
-- n * sizeof(*(arr))
-+ n * sizeof(T)
- )
-)
+- memcpy(dst_ptr, src_arr, (n) * \( sizeof(T)
+- \| sizeof(*(dst_ptr))
+- \| sizeof(*(src_arr))
+- \| sizeof(dst_ptr[...])
+- \| sizeof(src_arr[...])
+- \) )
++ COPY_ARRAY(dst_ptr, src_arr, n)
@@
type T;
-T *dst_ptr;
+T[] dst_arr;
T *src_ptr;
+expression n;
+@@
+- memcpy(dst_arr, src_ptr, (n) * \( sizeof(T)
+- \| sizeof(*(dst_arr))
+- \| sizeof(*(src_ptr))
+- \| sizeof(dst_arr[...])
+- \| sizeof(src_ptr[...])
+- \) )
++ COPY_ARRAY(dst_arr, src_ptr, n)
+
+@@
+type T;
T[] dst_arr;
T[] src_arr;
expression n;
@@
-(
-- memcpy(dst_ptr, src_ptr, (n) * sizeof(T))
-+ COPY_ARRAY(dst_ptr, src_ptr, n)
-|
-- memcpy(dst_ptr, src_arr, (n) * sizeof(T))
-+ COPY_ARRAY(dst_ptr, src_arr, n)
-|
-- memcpy(dst_arr, src_ptr, (n) * sizeof(T))
-+ COPY_ARRAY(dst_arr, src_ptr, n)
-|
-- memcpy(dst_arr, src_arr, (n) * sizeof(T))
+- memcpy(dst_arr, src_arr, (n) * \( sizeof(T)
+- \| sizeof(*(dst_arr))
+- \| sizeof(*(src_arr))
+- \| sizeof(dst_arr[...])
+- \| sizeof(src_arr[...])
+- \) )
+ COPY_ARRAY(dst_arr, src_arr, n)
-)
@@
type T;
@@ -96,3 +94,10 @@ expression n != 1;
@@
- ptr = xcalloc(n, \( sizeof(*ptr) \| sizeof(T) \) )
+ CALLOC_ARRAY(ptr, n)
+
+@@
+expression dst, src, n;
+@@
+-ALLOC_ARRAY(dst, n);
+-COPY_ARRAY(dst, src, n);
++DUP_ARRAY(dst, src, n);
diff --git a/contrib/coccinelle/config_fn_ctx.pending.cocci b/contrib/coccinelle/config_fn_ctx.pending.cocci
new file mode 100644
index 0000000..6d3d100
--- /dev/null
+++ b/contrib/coccinelle/config_fn_ctx.pending.cocci
@@ -0,0 +1,144 @@
+@ get_fn @
+identifier fn, R;
+@@
+(
+(
+git_config_from_file
+|
+git_config_from_file_with_options
+|
+git_config_from_mem
+|
+git_config_from_blob_oid
+|
+read_early_config
+|
+read_very_early_config
+|
+config_with_options
+|
+git_config
+|
+git_protected_config
+|
+config_from_gitmodules
+)
+ (fn, ...)
+|
+repo_config(R, fn, ...)
+)
+
+@ extends get_fn @
+identifier C1, C2, D;
+@@
+int fn(const char *C1, const char *C2,
++ const struct config_context *ctx,
+ void *D);
+
+@ extends get_fn @
+@@
+int fn(const char *, const char *,
++ const struct config_context *,
+ void *);
+
+@ extends get_fn @
+// Don't change fns that look like callback fns but aren't
+identifier fn2 != tar_filter_config && != git_diff_heuristic_config &&
+ != git_default_submodule_config && != git_color_config &&
+ != bundle_list_update && != parse_object_filter_config;
+identifier C1, C2, D1, D2, S;
+attribute name UNUSED;
+@@
+int fn(const char *C1, const char *C2,
++ const struct config_context *ctx,
+ void *D1) {
+<+...
+(
+fn2(C1, C2
++ , ctx
+, D2);
+|
+if(fn2(C1, C2
++ , ctx
+, D2) < 0) { ... }
+|
+return fn2(C1, C2
++ , ctx
+, D2);
+|
+S = fn2(C1, C2
++ , ctx
+, D2);
+)
+...+>
+ }
+
+@ extends get_fn@
+identifier C1, C2, D;
+attribute name UNUSED;
+@@
+int fn(const char *C1, const char *C2,
++ const struct config_context *ctx UNUSED,
+ void *D) {...}
+
+
+// The previous rules don't catch all callbacks, especially if they're defined
+// in a separate file from the git_config() call. Fix these manually.
+@@
+identifier C1, C2, D;
+attribute name UNUSED;
+@@
+int
+(
+git_ident_config
+|
+urlmatch_collect_fn
+|
+write_one_config
+|
+forbid_remote_url
+|
+credential_config_callback
+)
+ (const char *C1, const char *C2,
++ const struct config_context *ctx UNUSED,
+ void *D) {...}
+
+@@
+identifier C1, C2, D, D2, S, fn2;
+@@
+int
+(
+http_options
+|
+git_status_config
+|
+git_commit_config
+|
+git_default_core_config
+|
+grep_config
+)
+ (const char *C1, const char *C2,
++ const struct config_context *ctx,
+ void *D) {
+<+...
+(
+fn2(C1, C2
++ , ctx
+, D2);
+|
+if(fn2(C1, C2
++ , ctx
+, D2) < 0) { ... }
+|
+return fn2(C1, C2
++ , ctx
+, D2);
+|
+S = fn2(C1, C2
++ , ctx
+, D2);
+)
+...+>
+ }
diff --git a/contrib/coccinelle/git_config_number.cocci b/contrib/coccinelle/git_config_number.cocci
new file mode 100644
index 0000000..7b57dce
--- /dev/null
+++ b/contrib/coccinelle/git_config_number.cocci
@@ -0,0 +1,27 @@
+@@
+identifier C1, C2, C3;
+@@
+(
+(
+git_config_int
+|
+git_config_int64
+|
+git_config_ulong
+|
+git_config_ssize_t
+)
+ (C1, C2
++ , ctx->kvi
+ )
+|
+(
+git_configset_get_value
+|
+git_config_bool_or_int
+)
+ (C1, C2
++ , ctx->kvi
+ , C3
+ )
+)
diff --git a/contrib/coccinelle/hashmap.cocci b/contrib/coccinelle/hashmap.cocci
index d69e120..c5dbb45 100644
--- a/contrib/coccinelle/hashmap.cocci
+++ b/contrib/coccinelle/hashmap.cocci
@@ -1,4 +1,4 @@
-@ hashmap_entry_init_usage @
+@@
expression E;
struct hashmap_entry HME;
@@
diff --git a/contrib/coccinelle/index-compatibility.cocci b/contrib/coccinelle/index-compatibility.cocci
new file mode 100644
index 0000000..31e36cf
--- /dev/null
+++ b/contrib/coccinelle/index-compatibility.cocci
@@ -0,0 +1,157 @@
+// the_index.* variables
+@@
+identifier AC = active_cache;
+identifier AN = active_nr;
+identifier ACC = active_cache_changed;
+identifier ACT = active_cache_tree;
+@@
+(
+- AC
++ the_index.cache
+|
+- AN
++ the_index.cache_nr
+|
+- ACC
++ the_index.cache_changed
+|
+- ACT
++ the_index.cache_tree
+)
+
+// "the_repository" simple cases
+@@
+@@
+(
+- read_cache
++ repo_read_index
+|
+- read_cache_unmerged
++ repo_read_index_unmerged
+|
+- hold_locked_index
++ repo_hold_locked_index
+)
+ (
++ the_repository,
+ ...)
+
+// "the_repository" special-cases
+@@
+@@
+(
+- read_cache_preload
++ repo_read_index_preload
+)
+ (
++ the_repository,
+ ...
++ , 0
+ )
+
+// "the_index" simple cases
+@@
+@@
+(
+- is_cache_unborn
++ is_index_unborn
+|
+- unmerged_cache
++ unmerged_index
+|
+- rename_cache_entry_at
++ rename_index_entry_at
+|
+- chmod_cache_entry
++ chmod_index_entry
+|
+- cache_file_exists
++ index_file_exists
+|
+- cache_name_is_other
++ index_name_is_other
+|
+- unmerge_cache_entry_at
++ unmerge_index_entry_at
+|
+- add_to_cache
++ add_to_index
+|
+- add_file_to_cache
++ add_file_to_index
+|
+- add_cache_entry
++ add_index_entry
+|
+- remove_file_from_cache
++ remove_file_from_index
+|
+- ce_match_stat
++ ie_match_stat
+|
+- ce_modified
++ ie_modified
+|
+- resolve_undo_clear
++ resolve_undo_clear_index
+|
+- cache_name_pos
++ index_name_pos
+|
+- update_main_cache_tree
++ cache_tree_update
+|
+- discard_cache
++ discard_index
+)
+ (
++ &the_index,
+ ...)
+
+@@
+@@
+(
+- refresh_and_write_cache
++ repo_refresh_and_write_index
+)
+ (
++ the_repository,
+ ...
++ , NULL, NULL, NULL
+ )
+
+// "the_index" special-cases
+@@
+@@
+(
+- read_cache_from
++ read_index_from
+)
+ (
++ &the_index,
+ ...
++ , get_git_dir()
+ )
+
+@@
+@@
+(
+- refresh_cache
++ refresh_index
+)
+ (
++ &the_index,
+ ...
++ , NULL, NULL, NULL
+ )
+
+@@
+expression O;
+@@
+- write_cache_as_tree
++ write_index_as_tree
+ (
+- O,
++ O, &the_index, get_index_file(),
+ ...
+ )
diff --git a/contrib/coccinelle/preincr.cocci b/contrib/coccinelle/preincr.cocci
index 7fe1e8d..ae42cb0 100644
--- a/contrib/coccinelle/preincr.cocci
+++ b/contrib/coccinelle/preincr.cocci
@@ -1,4 +1,4 @@
-@ preincrement @
+@@
identifier i;
@@
- ++i > 1
diff --git a/contrib/coccinelle/spatchcache b/contrib/coccinelle/spatchcache
new file mode 100755
index 0000000..29e9352
--- /dev/null
+++ b/contrib/coccinelle/spatchcache
@@ -0,0 +1,304 @@
+#!/bin/sh
+#
+# spatchcache: a poor-man's "ccache"-alike for "spatch" in git.git
+#
+# This caching command relies on the peculiarities of the Makefile
+# driving "spatch" in git.git, in particular if we invoke:
+#
+# make
+# # See "spatchCache.cacheWhenStderr" for why "--very-quiet" is
+# # used
+# make coccicheck SPATCH_FLAGS=--very-quiet
+#
+# We can with COMPUTE_HEADER_DEPENDENCIES (auto-detected as true with
+# "gcc" and "clang") write e.g. a .depend/grep.o.d for grep.c, when we
+# compile grep.o.
+#
+# The .depend/grep.o.d will have the full header dependency tree of
+# grep.c, and we can thus cache the output of "spatch" by:
+#
+# 1. Hashing all of those files
+# 2. Hashing our source file, and the *.cocci rule we're
+# applying
+# 3. Running spatch, if suggests no changes (by far the common
+# case) we invoke "spatchCache.getCmd" and
+# "spatchCache.setCmd" with a hash SHA-256 to ask "does this
+# ID have no changes" or "say that ID had no changes>
+# 4. If no "spatchCache.{set,get}Cmd" is specified we'll use
+# "redis-cli" and maintain a SET called "spatch-cache". Set
+# appropriate redis memory policies to keep it from growing
+# out of control.
+#
+# This along with the general incremental "make" support for
+# "contrib/coccinelle" makes it viable to (re-)run coccicheck
+# e.g. when merging integration branches.
+#
+# Note that the "--very-quiet" flag is currently critical. The cache
+# will refuse to cache anything that has output on STDERR (which might
+# be errors from spatch), but see spatchCache.cacheWhenStderr below.
+#
+# The STDERR (and exit code) could in principle be cached (as with
+# ccache), but then the simple structure in the Redis cache would need
+# to change, so just supply "--very-quiet" for now.
+#
+# To use this, simply set SPATCH to
+# contrib/coccinelle/spatchcache. Then optionally set:
+#
+# [spatchCache]
+# # Optional: path to a custom spatch
+# spatch = ~/g/coccicheck/spatch.opt
+#
+# As well as this trace config (debug implies trace):
+#
+# cacheWhenStderr = true
+# trace = false
+# debug = false
+#
+# The ".depend/grep.o.d" can also be customized, as a string that will
+# be eval'd, it has access to a "$dirname" and "$basename":
+#
+# [spatchCache]
+# dependFormat = "$dirname/.depend/${basename%.c}.o.d"
+#
+# Setting "trace" to "true" allows for seeing when we have a cache HIT
+# or MISS. To debug whether the cache is working do that, and run e.g.:
+#
+# redis-cli FLUSHALL
+# <make && make coccicheck, as above>
+# grep -hore HIT -e MISS -e SET -e NOCACHE -e CANTCACHE .build/contrib/coccinelle | sort | uniq -c
+# 600 CANTCACHE
+# 7365 MISS
+# 7365 SET
+#
+# A subsequent "make cocciclean && make coccicheck" should then have
+# all "HIT"'s and "CANTCACHE"'s.
+#
+# The "spatchCache.cacheWhenStderr" option is critical when using
+# spatchCache.{trace,debug} to debug whether something is set in the
+# cache, as we'll write to the spatch logs in .build/* we'd otherwise
+# always emit a NOCACHE.
+#
+# Reading the config can make the command much slower, to work around
+# this the config can be set in the environment, with environment
+# variable name corresponding to the config key. "default" can be used
+# to use whatever's the script default, e.g. setting
+# spatchCache.cacheWhenStderr=true and deferring to the defaults for
+# the rest is:
+#
+# export GIT_CONTRIB_SPATCHCACHE_DEBUG=default
+# export GIT_CONTRIB_SPATCHCACHE_TRACE=default
+# export GIT_CONTRIB_SPATCHCACHE_CACHEWHENSTDERR=true
+# export GIT_CONTRIB_SPATCHCACHE_SPATCH=default
+# export GIT_CONTRIB_SPATCHCACHE_DEPENDFORMAT=default
+# export GIT_CONTRIB_SPATCHCACHE_SETCMD=default
+# export GIT_CONTRIB_SPATCHCACHE_GETCMD=default
+
+set -e
+
+env_or_config () {
+ env="$1"
+ shift
+ if test "$env" = "default"
+ then
+ # Avoid expensive "git config" invocation
+ return
+ elif test -n "$env"
+ then
+ echo "$env"
+ else
+ git config $@ || :
+ fi
+}
+
+## Our own configuration & options
+debug=$(env_or_config "$GIT_CONTRIB_SPATCHCACHE_DEBUG" --bool "spatchCache.debug")
+if test "$debug" != "true"
+then
+ debug=
+fi
+if test -n "$debug"
+then
+ set -x
+fi
+
+trace=$(env_or_config "$GIT_CONTRIB_SPATCHCACHE_TRACE" --bool "spatchCache.trace")
+if test "$trace" != "true"
+then
+ trace=
+fi
+if test -n "$debug"
+then
+ # debug implies trace
+ trace=true
+fi
+
+cacheWhenStderr=$(env_or_config "$GIT_CONTRIB_SPATCHCACHE_CACHEWHENSTDERR" --bool "spatchCache.cacheWhenStderr")
+if test "$cacheWhenStderr" != "true"
+then
+ cacheWhenStderr=
+fi
+
+trace_it () {
+ if test -z "$trace"
+ then
+ return
+ fi
+ echo "$@" >&2
+}
+
+spatch=$(env_or_config "$GIT_CONTRIB_SPATCHCACHE_SPATCH" --path "spatchCache.spatch")
+if test -n "$spatch"
+then
+ if test -n "$debug"
+ then
+ trace_it "custom spatchCache.spatch='$spatch'"
+ fi
+else
+ spatch=spatch
+fi
+
+dependFormat='$dirname/.depend/${basename%.c}.o.d'
+dependFormatCfg=$(env_or_config "$GIT_CONTRIB_SPATCHCACHE_DEPENDFORMAT" "spatchCache.dependFormat")
+if test -n "$dependFormatCfg"
+then
+ dependFormat="$dependFormatCfg"
+fi
+
+set=$(env_or_config "$GIT_CONTRIB_SPATCHCACHE_SETCMD" "spatchCache.setCmd")
+get=$(env_or_config "$GIT_CONTRIB_SPATCHCACHE_GETCMD" "spatchCache.getCmd")
+
+## Parse spatch()-like command-line for caching info
+arg_sp=
+arg_file=
+args="$@"
+spatch_opts() {
+ while test $# != 0
+ do
+ arg_file="$1"
+ case "$1" in
+ --sp-file)
+ arg_sp="$2"
+ ;;
+ esac
+ shift
+ done
+}
+spatch_opts "$@"
+if ! test -f "$arg_file"
+then
+ arg_file=
+fi
+
+hash_for_cache() {
+ # Parameters that should affect the cache
+ echo "args=$args"
+ echo "config spatchCache.spatch=$spatch"
+ echo "config spatchCache.debug=$debug"
+ echo "config spatchCache.trace=$trace"
+ echo "config spatchCache.cacheWhenStderr=$cacheWhenStderr"
+ echo
+
+ # Our target file and its dependencies
+ git hash-object "$1" "$2" $(grep -E -o '^[^:]+:$' "$3" | tr -d ':')
+}
+
+# Sanity checks
+if ! test -f "$arg_sp" && ! test -f "$arg_file"
+then
+ echo $0: no idea how to cache "$@" >&2
+ exit 128
+fi
+
+# Main logic
+dirname=$(dirname "$arg_file")
+basename=$(basename "$arg_file")
+eval "dep=$dependFormat"
+
+if ! test -f "$dep"
+then
+ trace_it "$0: CANTCACHE have no '$dep' for '$arg_file'!"
+ exec "$spatch" "$@"
+fi
+
+if test -n "$debug"
+then
+ trace_it "$0: The full cache input for '$arg_sp' '$arg_file' '$dep'"
+ hash_for_cache "$arg_sp" "$arg_file" "$dep" >&2
+fi
+sum=$(hash_for_cache "$arg_sp" "$arg_file" "$dep" | git hash-object --stdin)
+
+trace_it "$0: processing '$arg_file' with '$arg_sp' rule, and got hash '$sum' for it + '$dep'"
+
+getret=
+if test -z "$get"
+then
+ if test $(redis-cli SISMEMBER spatch-cache "$sum") = 1
+ then
+ getret=0
+ else
+ getret=1
+ fi
+else
+ $set "$sum"
+ getret=$?
+fi
+
+if test "$getret" = 0
+then
+ trace_it "$0: HIT for '$arg_file' with '$arg_sp'"
+ exit 0
+else
+ trace_it "$0: MISS: for '$arg_file' with '$arg_sp'"
+fi
+
+out="$(mktemp)"
+err="$(mktemp)"
+
+set +e
+"$spatch" "$@" >"$out" 2>>"$err"
+ret=$?
+cat "$out"
+cat "$err" >&2
+set -e
+
+nocache=
+if test $ret != 0
+then
+ nocache="exited non-zero: $ret"
+elif test -s "$out"
+then
+ nocache="had patch output"
+elif test -z "$cacheWhenStderr" && test -s "$err"
+then
+ nocache="had stderr (use --very-quiet or spatchCache.cacheWhenStderr=true?)"
+fi
+
+if test -n "$nocache"
+then
+ trace_it "$0: NOCACHE ($nocache): for '$arg_file' with '$arg_sp'"
+ exit "$ret"
+fi
+
+trace_it "$0: SET: for '$arg_file' with '$arg_sp'"
+
+setret=
+if test -z "$set"
+then
+ if test $(redis-cli SADD spatch-cache "$sum") = 1
+ then
+ setret=0
+ else
+ setret=1
+ fi
+else
+ "$set" "$sum"
+ setret=$?
+fi
+
+if test "$setret" != 0
+then
+ echo "FAILED to set '$sum' in cache!" >&2
+ exit 128
+fi
+
+exit "$ret"
diff --git a/contrib/coccinelle/strbuf.cocci b/contrib/coccinelle/strbuf.cocci
index 0970d98..5f06105 100644
--- a/contrib/coccinelle/strbuf.cocci
+++ b/contrib/coccinelle/strbuf.cocci
@@ -1,4 +1,4 @@
-@ strbuf_addf_with_format_only @
+@@
expression E;
constant fmt !~ "%";
@@
diff --git a/contrib/coccinelle/swap.cocci b/contrib/coccinelle/swap.cocci
index a0934d1..522177a 100644
--- a/contrib/coccinelle/swap.cocci
+++ b/contrib/coccinelle/swap.cocci
@@ -1,4 +1,4 @@
-@ swap_with_declaration @
+@@
type T;
identifier tmp;
T a, b;
diff --git a/contrib/coccinelle/tests/free.c b/contrib/coccinelle/tests/free.c
new file mode 100644
index 0000000..96d4abc
--- /dev/null
+++ b/contrib/coccinelle/tests/free.c
@@ -0,0 +1,11 @@
+int use_FREE_AND_NULL(int *v)
+{
+ free(*v);
+ *v = NULL;
+}
+
+int need_no_if(int *v)
+{
+ if (v)
+ free(v);
+}
diff --git a/contrib/coccinelle/tests/free.res b/contrib/coccinelle/tests/free.res
new file mode 100644
index 0000000..f90fd9f
--- /dev/null
+++ b/contrib/coccinelle/tests/free.res
@@ -0,0 +1,9 @@
+int use_FREE_AND_NULL(int *v)
+{
+ FREE_AND_NULL(*v);
+}
+
+int need_no_if(int *v)
+{
+ free(v);
+}
diff --git a/contrib/coccinelle/the_repository.cocci b/contrib/coccinelle/the_repository.cocci
new file mode 100644
index 0000000..765ad68
--- /dev/null
+++ b/contrib/coccinelle/the_repository.cocci
@@ -0,0 +1,123 @@
+// Fully migrated "the_repository" additions
+@@
+@@
+(
+// cache.h
+- get_oid
++ repo_get_oid
+|
+- get_oid_commit
++ repo_get_oid_commit
+|
+- get_oid_committish
++ repo_get_oid_committish
+|
+- get_oid_tree
++ repo_get_oid_tree
+|
+- get_oid_treeish
++ repo_get_oid_treeish
+|
+- get_oid_blob
++ repo_get_oid_blob
+|
+- get_oid_mb
++ repo_get_oid_mb
+|
+- find_unique_abbrev
++ repo_find_unique_abbrev
+|
+- find_unique_abbrev_r
++ repo_find_unique_abbrev_r
+|
+- for_each_abbrev
++ repo_for_each_abbrev
+|
+- interpret_branch_name
++ repo_interpret_branch_name
+|
+- peel_to_type
++ repo_peel_to_type
+// commit-reach.h
+|
+- get_merge_bases
++ repo_get_merge_bases
+|
+- get_merge_bases_many
++ repo_get_merge_bases_many
+|
+- get_merge_bases_many_dirty
++ repo_get_merge_bases_many_dirty
+|
+- in_merge_bases
++ repo_in_merge_bases
+|
+- in_merge_bases_many
++ repo_in_merge_bases_many
+// commit.h
+|
+- parse_commit_internal
++ repo_parse_commit_internal
+|
+- parse_commit
++ repo_parse_commit
+|
+- get_commit_buffer
++ repo_get_commit_buffer
+|
+- unuse_commit_buffer
++ repo_unuse_commit_buffer
+|
+- logmsg_reencode
++ repo_logmsg_reencode
+|
+- get_commit_tree
++ repo_get_commit_tree
+// diff.h
+|
+- diff_setup
++ repo_diff_setup
+// object-store.h
+|
+- read_object_file
++ repo_read_object_file
+|
+- has_object_file
++ repo_has_object_file
+|
+- has_object_file_with_flags
++ repo_has_object_file_with_flags
+// pretty.h
+|
+- format_commit_message
++ repo_format_commit_message
+// packfile.h
+|
+- approximate_object_count
++ repo_approximate_object_count
+// promisor-remote.h
+|
+- promisor_remote_reinit
++ repo_promisor_remote_reinit
+|
+- promisor_remote_find
++ repo_promisor_remote_find
+|
+- has_promisor_remote
++ repo_has_promisor_remote
+// refs.h
+|
+- dwim_ref
++ repo_dwim_ref
+// rerere.h
+|
+- rerere
++ repo_rerere
+// revision.h
+|
+- init_revisions
++ repo_init_revisions
+)
+ (
++ the_repository,
+ ...)
diff --git a/contrib/coccinelle/the_repository.pending.cocci b/contrib/coccinelle/the_repository.pending.cocci
deleted file mode 100644
index 072ea0d..0000000
--- a/contrib/coccinelle/the_repository.pending.cocci
+++ /dev/null
@@ -1,129 +0,0 @@
-// This file is used for the ongoing refactoring of
-// bringing the index or repository struct in all of
-// our code base.
-
-@@
-expression E;
-expression F;
-expression G;
-@@
-- read_object_file(
-+ repo_read_object_file(the_repository,
- E, F, G)
-
-@@
-expression E;
-@@
-- has_object_file(
-+ repo_has_object_file(the_repository,
- E)
-
-@@
-expression E;
-expression F;
-@@
-- has_object_file_with_flags(
-+ repo_has_object_file_with_flags(the_repository,
- E)
-
-@@
-expression E;
-expression F;
-expression G;
-@@
-- parse_commit_internal(
-+ repo_parse_commit_internal(the_repository,
- E, F, G)
-
-@@
-expression E;
-expression F;
-@@
-- parse_commit_gently(
-+ repo_parse_commit_gently(the_repository,
- E, F)
-
-@@
-expression E;
-@@
-- parse_commit(
-+ repo_parse_commit(the_repository,
- E)
-
-@@
-expression E;
-expression F;
-@@
-- get_merge_bases(
-+ repo_get_merge_bases(the_repository,
- E, F);
-
-@@
-expression E;
-expression F;
-expression G;
-@@
-- get_merge_bases_many(
-+ repo_get_merge_bases_many(the_repository,
- E, F, G);
-
-@@
-expression E;
-expression F;
-expression G;
-@@
-- get_merge_bases_many_dirty(
-+ repo_get_merge_bases_many_dirty(the_repository,
- E, F, G);
-
-@@
-expression E;
-expression F;
-@@
-- in_merge_bases(
-+ repo_in_merge_bases(the_repository,
- E, F);
-
-@@
-expression E;
-expression F;
-expression G;
-@@
-- in_merge_bases_many(
-+ repo_in_merge_bases_many(the_repository,
- E, F, G);
-
-@@
-expression E;
-expression F;
-@@
-- get_commit_buffer(
-+ repo_get_commit_buffer(the_repository,
- E, F);
-
-@@
-expression E;
-expression F;
-@@
-- unuse_commit_buffer(
-+ repo_unuse_commit_buffer(the_repository,
- E, F);
-
-@@
-expression E;
-expression F;
-expression G;
-@@
-- logmsg_reencode(
-+ repo_logmsg_reencode(the_repository,
- E, F, G);
-
-@@
-expression E;
-expression F;
-expression G;
-expression H;
-@@
-- format_commit_message(
-+ repo_format_commit_message(the_repository,
- E, F, G, H);
diff --git a/contrib/coccinelle/xstrncmpz.cocci b/contrib/coccinelle/xstrncmpz.cocci
new file mode 100644
index 0000000..ccb39e2
--- /dev/null
+++ b/contrib/coccinelle/xstrncmpz.cocci
@@ -0,0 +1,28 @@
+@@
+expression S, T, L;
+@@
+(
+- strncmp(S, T, L) || S[L]
++ !!xstrncmpz(S, T, L)
+|
+- strncmp(S, T, L) || S[L] != '\0'
++ !!xstrncmpz(S, T, L)
+|
+- strncmp(S, T, L) || T[L]
++ !!xstrncmpz(T, S, L)
+|
+- strncmp(S, T, L) || T[L] != '\0'
++ !!xstrncmpz(T, S, L)
+|
+- !strncmp(S, T, L) && !S[L]
++ !xstrncmpz(S, T, L)
+|
+- !strncmp(S, T, L) && S[L] == '\0'
++ !xstrncmpz(S, T, L)
+|
+- !strncmp(S, T, L) && !T[L]
++ !xstrncmpz(T, S, L)
+|
+- !strncmp(S, T, L) && T[L] == '\0'
++ !xstrncmpz(T, S, L)
+)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index ba5c395..75193de 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -28,6 +28,8 @@
# completion style. For example '!f() { : git commit ; ... }; f' will
# tell the completion to use commit completion. This also works with aliases
# of form "!sh -c '...'". For example, "!sh -c ': git commit ; ... '".
+# Note that "git" is optional --- '!f() { : commit; ...}; f' would complete
+# just like the 'git commit' command.
#
# If you have a command that is not part of git, but you would still
# like completion, you can use __git_complete:
@@ -58,6 +60,12 @@
#
# When set to "1" suggest all options, including options which are
# typically hidden (e.g. '--allow-empty' for 'git commit').
+#
+# GIT_COMPLETION_IGNORE_CASE
+#
+# When set, uses for-each-ref '--ignore-case' to find refs that match
+# case insensitively, even on systems with case sensitive file systems
+# (e.g., completing tag name "FOO" on "git checkout f<TAB>").
case "$COMP_WORDBREAKS" in
*:*) : great ;;
@@ -114,6 +122,40 @@ __git ()
${__git_dir:+--git-dir="$__git_dir"} "$@" 2>/dev/null
}
+# Helper function to read the first line of a file into a variable.
+# __git_eread requires 2 arguments, the file path and the name of the
+# variable, in that order.
+#
+# This is taken from git-prompt.sh.
+__git_eread ()
+{
+ test -r "$1" && IFS=$'\r\n' read -r "$2" <"$1"
+}
+
+# Runs git in $__git_repo_path to determine whether a pseudoref exists.
+# 1: The pseudo-ref to search
+__git_pseudoref_exists ()
+{
+ local ref=$1
+ local head
+
+ __git_find_repo_path
+
+ # If the reftable is in use, we have to shell out to 'git rev-parse'
+ # to determine whether the ref exists instead of looking directly in
+ # the filesystem to determine whether the ref exists. Otherwise, use
+ # Bash builtins since executing Git commands are expensive on some
+ # platforms.
+ if __git_eread "$__git_repo_path/HEAD" head; then
+ if [ "$head" == "ref: refs/heads/.invalid" ]; then
+ __git show-ref --exists "$ref"
+ return $?
+ fi
+ fi
+
+ [ -f "$__git_repo_path/$ref" ]
+}
+
# Removes backslash escaping, single quotes and double quotes from a word,
# stores the result in the variable $dequoted_word.
# 1: The word to dequote.
@@ -412,16 +454,18 @@ fi
# This function is equivalent to
#
-# __gitcomp "$(git xxx --git-completion-helper) ..."
+# ___git_resolved_builtins=$(git xxx --git-completion-helper)
#
-# except that the output is cached. Accept 1-3 arguments:
+# except that the result of the execution is cached.
+#
+# Accept 1-3 arguments:
# 1: the git command to execute, this is also the cache key
+# (use "_" when the command contains spaces, e.g. "remote add"
+# becomes "remote_add")
# 2: extra options to be added on top (e.g. negative forms)
# 3: options to be excluded
-__gitcomp_builtin ()
+__git_resolve_builtins ()
{
- # spaces must be replaced with underscore for multi-word
- # commands, e.g. "git remote add" becomes remote_add.
local cmd="$1"
local incl="${2-}"
local excl="${3-}"
@@ -447,7 +491,24 @@ __gitcomp_builtin ()
eval "$var=\"$options\""
fi
- __gitcomp "$options"
+ ___git_resolved_builtins="$options"
+}
+
+# This function is equivalent to
+#
+# __gitcomp "$(git xxx --git-completion-helper) ..."
+#
+# except that the output is cached. Accept 1-3 arguments:
+# 1: the git command to execute, this is also the cache key
+# (use "_" when the command contains spaces, e.g. "remote add"
+# becomes "remote_add")
+# 2: extra options to be added on top (e.g. negative forms)
+# 3: options to be excluded
+__gitcomp_builtin ()
+{
+ __git_resolve_builtins "$1" "$2" "$3"
+
+ __gitcomp "$___git_resolved_builtins"
}
# Variation of __gitcomp_nl () that appends to the existing list of
@@ -514,6 +575,26 @@ __gitcomp_file ()
true
}
+# Find the current subcommand for commands that follow the syntax:
+#
+# git <command> <subcommand>
+#
+# 1: List of possible subcommands.
+# 2: Optional subcommand to return when none is found.
+__git_find_subcommand ()
+{
+ local subcommand subcommands="$1" default_subcommand="$2"
+
+ for subcommand in $subcommands; do
+ if [ "$subcommand" = "${words[__git_cmd_idx+1]}" ]; then
+ echo $subcommand
+ return
+ fi
+ done
+
+ echo $default_subcommand
+}
+
# Execute 'git ls-files', unless the --committable option is specified, in
# which case it runs 'git diff-index' to find out the files that can be
# committed. It return paths relative to the directory specified in the first
@@ -646,6 +727,7 @@ __git_heads ()
local pfx="${1-}" cur_="${2-}" sfx="${3-}"
__git for-each-ref --format="${pfx//\%/%%}%(refname:strip=2)$sfx" \
+ ${GIT_COMPLETION_IGNORE_CASE+--ignore-case} \
"refs/heads/$cur_*" "refs/heads/$cur_*/**"
}
@@ -659,6 +741,7 @@ __git_remote_heads ()
local pfx="${1-}" cur_="${2-}" sfx="${3-}"
__git for-each-ref --format="${pfx//\%/%%}%(refname:strip=2)$sfx" \
+ ${GIT_COMPLETION_IGNORE_CASE+--ignore-case} \
"refs/remotes/$cur_*" "refs/remotes/$cur_*/**"
}
@@ -669,6 +752,7 @@ __git_tags ()
local pfx="${1-}" cur_="${2-}" sfx="${3-}"
__git for-each-ref --format="${pfx//\%/%%}%(refname:strip=2)$sfx" \
+ ${GIT_COMPLETION_IGNORE_CASE+--ignore-case} \
"refs/tags/$cur_*" "refs/tags/$cur_*/**"
}
@@ -688,6 +772,7 @@ __git_dwim_remote_heads ()
# but only output if the branch name is unique
__git for-each-ref --format="$fer_pfx%(refname:strip=3)$sfx" \
--sort="refname:strip=3" \
+ ${GIT_COMPLETION_IGNORE_CASE+--ignore-case} \
"refs/remotes/*/$cur_*" "refs/remotes/*/$cur_*/**" | \
uniq -u
}
@@ -712,6 +797,7 @@ __git_refs ()
local format refs
local pfx="${3-}" cur_="${4-$cur}" sfx="${5-}"
local match="${4-}"
+ local umatch="${4-}"
local fer_pfx="${pfx//\%/%%}" # "escape" for-each-ref format specifiers
__git_find_repo_path
@@ -735,12 +821,19 @@ __git_refs ()
fi
fi
+ if test "${GIT_COMPLETION_IGNORE_CASE:+1}" = "1"
+ then
+ # uppercase with tr instead of ${match,^^} for bash 3.2 compatibility
+ umatch=$(echo "$match" | tr a-z A-Z 2>/dev/null || echo "$match")
+ fi
+
if [ "$list_refs_from" = path ]; then
if [[ "$cur_" == ^* ]]; then
pfx="$pfx^"
fer_pfx="$fer_pfx^"
cur_=${cur_#^}
match=${match#^}
+ umatch=${umatch#^}
fi
case "$cur_" in
refs|refs/*)
@@ -749,9 +842,9 @@ __git_refs ()
track=""
;;
*)
- for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD CHERRY_PICK_HEAD; do
+ for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD CHERRY_PICK_HEAD REVERT_HEAD BISECT_HEAD AUTO_MERGE; do
case "$i" in
- $match*)
+ $match*|$umatch*)
if [ -e "$dir/$i" ]; then
echo "$pfx$i$sfx"
fi
@@ -765,6 +858,7 @@ __git_refs ()
;;
esac
__git_dir="$dir" __git for-each-ref --format="$fer_pfx%($format)$sfx" \
+ ${GIT_COMPLETION_IGNORE_CASE+--ignore-case} \
"${refs[@]}"
if [ -n "$track" ]; then
__git_dwim_remote_heads "$pfx" "$match" "$sfx"
@@ -784,15 +878,16 @@ __git_refs ()
*)
if [ "$list_refs_from" = remote ]; then
case "HEAD" in
- $match*) echo "${pfx}HEAD$sfx" ;;
+ $match*|$umatch*) echo "${pfx}HEAD$sfx" ;;
esac
__git for-each-ref --format="$fer_pfx%(refname:strip=3)$sfx" \
+ ${GIT_COMPLETION_IGNORE_CASE+--ignore-case} \
"refs/remotes/$remote/$match*" \
"refs/remotes/$remote/$match*/**"
else
local query_symref
case "HEAD" in
- $match*) query_symref="HEAD" ;;
+ $match*|$umatch*) query_symref="HEAD" ;;
esac
__git ls-remote "$remote" $query_symref \
"refs/tags/$match*" "refs/heads/$match*" \
@@ -1162,7 +1257,7 @@ __git_aliased_command ()
:) : skip null command ;;
\'*) : skip opening quote after sh -c ;;
*)
- cur="$word"
+ cur="${word%;}"
break
esac
done
@@ -1427,12 +1522,32 @@ _git_bisect ()
{
__git_has_doubledash && return
- local subcommands="start bad good skip reset visualize replay log run"
- local subcommand="$(__git_find_on_cmdline "$subcommands")"
+ __git_find_repo_path
+
+ # If a bisection is in progress get the terms being used.
+ local term_bad term_good
+ if [ -f "$__git_repo_path"/BISECT_TERMS ]; then
+ term_bad=$(__git bisect terms --term-bad)
+ term_good=$(__git bisect terms --term-good)
+ fi
+
+ # We will complete any custom terms, but still always complete the
+ # more usual bad/new/good/old because git bisect gives a good error
+ # message if these are given when not in use, and that's better than
+ # silent refusal to complete if the user is confused.
+ #
+ # We want to recognize 'view' but not complete it, because it overlaps
+ # with 'visualize' too much and is just an alias for it.
+ #
+ local completable_subcommands="start bad new $term_bad good old $term_good terms skip reset visualize replay log run help"
+ local all_subcommands="$completable_subcommands view"
+
+ local subcommand="$(__git_find_on_cmdline "$all_subcommands")"
+
if [ -z "$subcommand" ]; then
__git_find_repo_path
if [ -f "$__git_repo_path"/BISECT_START ]; then
- __gitcomp "$subcommands"
+ __gitcomp "$completable_subcommands"
else
__gitcomp "replay start"
fi
@@ -1440,7 +1555,26 @@ _git_bisect ()
fi
case "$subcommand" in
- bad|good|reset|skip|start)
+ start)
+ case "$cur" in
+ --*)
+ __gitcomp "--first-parent --no-checkout --term-new --term-bad --term-old --term-good"
+ return
+ ;;
+ *)
+ __git_complete_refs
+ ;;
+ esac
+ ;;
+ terms)
+ __gitcomp "--term-good --term-old --term-bad --term-new"
+ return
+ ;;
+ visualize|view)
+ __git_complete_log_opts
+ return
+ ;;
+ bad|new|"$term_bad"|good|old|"$term_good"|reset|skip)
__git_complete_refs
;;
*)
@@ -1587,7 +1721,7 @@ _git_checkout ()
if [ -n "$(__git_find_on_cmdline "-b -B -d --detach --orphan")" ]; then
__git_complete_refs --mode="refs"
- elif [ -n "$(__git_find_on_cmdline "--track")" ]; then
+ elif [ -n "$(__git_find_on_cmdline "-t --track")" ]; then
__git_complete_refs --mode="remote-heads"
else
__git_complete_refs $dwim_opt --mode="refs"
@@ -1602,8 +1736,7 @@ __git_cherry_pick_inprogress_options=$__git_sequencer_inprogress_options
_git_cherry_pick ()
{
- __git_find_repo_path
- if [ -f "$__git_repo_path"/CHERRY_PICK_HEAD ]; then
+ if __git_pseudoref_exists CHERRY_PICK_HEAD; then
__gitcomp "$__git_cherry_pick_inprogress_options"
return
fi
@@ -1657,6 +1790,11 @@ _git_clone ()
__git_untracked_file_modes="all no normal"
+__git_trailer_tokens ()
+{
+ __git config --name-only --get-regexp '^trailer\..*\.key$' | cut -d. -f 2- | rev | cut -d. -f2- | rev
+}
+
_git_commit ()
{
case "$prev" in
@@ -1681,6 +1819,10 @@ _git_commit ()
__gitcomp "$__git_untracked_file_modes" "" "${cur##--untracked-files=}"
return
;;
+ --trailer=*)
+ __gitcomp_nl "$(__git_trailer_tokens)" "" "${cur##--trailer=}" ":"
+ return
+ ;;
--*)
__gitcomp_builtin commit
return
@@ -1713,32 +1855,44 @@ __git_color_moved_opts="no default plain blocks zebra dimmed-zebra"
__git_color_moved_ws_opts="no ignore-space-at-eol ignore-space-change
ignore-all-space allow-indentation-change"
+__git_ws_error_highlight_opts="context old new all default"
+
+# Options for the diff machinery (diff, log, show, stash, range-diff, ...)
__git_diff_common_options="--stat --numstat --shortstat --summary
--patch-with-stat --name-only --name-status --color
--no-color --color-words --no-renames --check
--color-moved --color-moved= --no-color-moved
--color-moved-ws= --no-color-moved-ws
--full-index --binary --abbrev --diff-filter=
+ --find-copies --find-object --find-renames
+ --no-relative --relative
--find-copies-harder --ignore-cr-at-eol
--text --ignore-space-at-eol --ignore-space-change
--ignore-all-space --ignore-blank-lines --exit-code
- --quiet --ext-diff --no-ext-diff
+ --quiet --ext-diff --no-ext-diff --unified=
--no-prefix --src-prefix= --dst-prefix=
- --inter-hunk-context=
+ --inter-hunk-context= --function-context
--patience --histogram --minimal
--raw --word-diff --word-diff-regex=
--dirstat --dirstat= --dirstat-by-file
--dirstat-by-file= --cumulative
- --diff-algorithm=
+ --diff-algorithm= --default-prefix
--submodule --submodule= --ignore-submodules
--indent-heuristic --no-indent-heuristic
- --textconv --no-textconv
- --patch --no-patch
- --anchored=
+ --textconv --no-textconv --break-rewrites
+ --patch --no-patch --cc --combined-all-paths
+ --anchored= --compact-summary --ignore-matching-lines=
+ --irreversible-delete --line-prefix --no-stat
+ --output= --output-indicator-context=
+ --output-indicator-new= --output-indicator-old=
+ --ws-error-highlight=
+ --pickaxe-all --pickaxe-regex --patch-with-raw
"
-__git_diff_difftool_options="--cached --staged --pickaxe-all --pickaxe-regex
- --base --ours --theirs --no-index --relative --merge-base
+# Options for diff/difftool
+__git_diff_difftool_options="--cached --staged
+ --base --ours --theirs --no-index --merge-base
+ --ita-invisible-in-index --ita-visible-in-index
$__git_diff_common_options"
_git_diff ()
@@ -1762,6 +1916,10 @@ _git_diff ()
__gitcomp "$__git_color_moved_ws_opts" "" "${cur##--color-moved-ws=}"
return
;;
+ --ws-error-highlight=*)
+ __gitcomp "$__git_ws_error_highlight_opts" "" "${cur##--ws-error-highlight=}"
+ return
+ ;;
--*)
__gitcomp "$__git_diff_difftool_options"
return
@@ -1992,6 +2150,16 @@ __git_log_common_options="
--min-age= --until= --before=
--min-parents= --max-parents=
--no-min-parents --no-max-parents
+ --alternate-refs --ancestry-path
+ --author-date-order --basic-regexp
+ --bisect --boundary --exclude-first-parent-only
+ --exclude-hidden --extended-regexp
+ --fixed-strings --grep-reflog
+ --ignore-missing --left-only --perl-regexp
+ --reflog --regexp-ignore-case --remove-empty
+ --right-only --show-linear-break
+ --show-notes-by-default --show-pulls
+ --since-as-filter --single-worktree
"
# Options that go well for log and gitk (not shortlog)
__git_log_gitk_options="
@@ -2004,17 +2172,26 @@ __git_log_shortlog_options="
--author= --committer= --grep=
--all-match --invert-grep
"
+# Options accepted by log and show
+__git_log_show_options="
+ --diff-merges --diff-merges= --no-diff-merges --dd --remerge-diff
+ --encoding=
+"
+
+__git_diff_merges_opts="off none on first-parent 1 separate m combined c dense-combined cc remerge r"
__git_log_pretty_formats="oneline short medium full fuller reference email raw format: tformat: mboxrd"
__git_log_date_formats="relative iso8601 iso8601-strict rfc2822 short local default human raw unix auto: format:"
-_git_log ()
+# Complete porcelain (i.e. not git-rev-list) options and at least some
+# option arguments accepted by git-log. Note that this same set of options
+# are also accepted by some other git commands besides git-log.
+__git_complete_log_opts ()
{
- __git_has_doubledash && return
- __git_find_repo_path
+ COMPREPLY=()
local merge=""
- if [ -f "$__git_repo_path/MERGE_HEAD" ]; then
+ if __git_pseudoref_exists MERGE_HEAD; then
merge="--merge"
fi
case "$prev,$cur" in
@@ -2052,15 +2229,24 @@ _git_log ()
__gitcomp "$__git_diff_submodule_formats" "" "${cur##--submodule=}"
return
;;
+ --ws-error-highlight=*)
+ __gitcomp "$__git_ws_error_highlight_opts" "" "${cur##--ws-error-highlight=}"
+ return
+ ;;
--no-walk=*)
__gitcomp "sorted unsorted" "" "${cur##--no-walk=}"
return
;;
+ --diff-merges=*)
+ __gitcomp "$__git_diff_merges_opts" "" "${cur##--diff-merges=}"
+ return
+ ;;
--*)
__gitcomp "
$__git_log_common_options
$__git_log_shortlog_options
$__git_log_gitk_options
+ $__git_log_show_options
--root --topo-order --date-order --reverse
--follow --full-diff
--abbrev-commit --no-abbrev-commit --abbrev=
@@ -2075,9 +2261,10 @@ _git_log ()
--no-walk --no-walk= --do-walk
--parents --children
--expand-tabs --expand-tabs= --no-expand-tabs
+ --clear-decorations --decorate-refs=
+ --decorate-refs-exclude=
$merge
$__git_diff_common_options
- --pickaxe-all --pickaxe-regex
"
return
;;
@@ -2097,6 +2284,16 @@ _git_log ()
return
;;
esac
+}
+
+_git_log ()
+{
+ __git_has_doubledash && return
+ __git_find_repo_path
+
+ __git_complete_log_opts
+ [ ${#COMPREPLY[@]} -eq 0 ] || return
+
__git_complete_revlist
}
@@ -2313,13 +2510,30 @@ _git_rebase ()
_git_reflog ()
{
- local subcommands="show delete expire"
- local subcommand="$(__git_find_on_cmdline "$subcommands")"
+ local subcommands subcommand
- if [ -z "$subcommand" ]; then
- __gitcomp "$subcommands"
- else
- __git_complete_refs
+ __git_resolve_builtins "reflog"
+
+ subcommands="$___git_resolved_builtins"
+ subcommand="$(__git_find_subcommand "$subcommands" "show")"
+
+ case "$subcommand,$cur" in
+ show,--*)
+ __gitcomp "
+ $__git_log_common_options
+ "
+ return
+ ;;
+ $subcommand,--*)
+ __gitcomp_builtin "reflog_$subcommand"
+ return
+ ;;
+ esac
+
+ __git_complete_refs
+
+ if [ $((cword - __git_cmd_idx)) -eq 1 ]; then
+ __gitcompappend "$subcommands" "" "$cur" " "
fi
}
@@ -2464,7 +2678,7 @@ _git_switch ()
if [ -n "$(__git_find_on_cmdline "-c -C -d --detach")" ]; then
__git_complete_refs --mode="refs"
- elif [ -n "$(__git_find_on_cmdline "--track")" ]; then
+ elif [ -n "$(__git_find_on_cmdline "-t --track")" ]; then
__git_complete_refs --mode="remote-heads"
else
__git_complete_refs $dwim_opt --mode="heads"
@@ -2502,6 +2716,33 @@ __git_compute_config_vars ()
__git_config_vars="$(git help --config-for-completion)"
}
+__git_config_vars_all=
+__git_compute_config_vars_all ()
+{
+ test -n "$__git_config_vars_all" ||
+ __git_config_vars_all="$(git --no-pager help --config)"
+}
+
+__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}" ||
+ printf -v "__git_first_level_config_vars_for_section_${section}" %s \
+ "$(echo "$__git_config_vars" | awk -F. "/^${section}\.[a-z]/ { print \$2 }")"
+}
+
+__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}" ||
+ printf -v "__git_second_level_config_vars_for_section_${section}" %s \
+ "$(echo "$__git_config_vars_all" | awk -F. "/^${section}\.</ { print \$3 }")"
+}
+
__git_config_sections=
__git_compute_config_sections ()
{
@@ -2646,73 +2887,50 @@ __git_complete_config_variable_name ()
done
case "$cur_" in
- branch.*.*)
+ branch.*.*|guitool.*.*|difftool.*.*|man.*.*|mergetool.*.*|remote.*.*|submodule.*.*|url.*.*)
local pfx="${cur_%.*}."
cur_="${cur_##*.}"
- __gitcomp "remote pushRemote merge mergeOptions rebase" "$pfx" "$cur_" "$sfx"
+ 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"
return
;;
branch.*)
local pfx="${cur_%.*}."
cur_="${cur_#*.}"
+ local section="${pfx%.}"
__gitcomp_direct "$(__git_heads "$pfx" "$cur_" ".")"
- __gitcomp_nl_append $'autoSetupMerge\nautoSetupRebase\n' "$pfx" "$cur_" "${sfx- }"
- return
- ;;
- guitool.*.*)
- local pfx="${cur_%.*}."
- cur_="${cur_##*.}"
- __gitcomp "
- argPrompt cmd confirm needsFile noConsole noRescan
- prompt revPrompt revUnmerged title
- " "$pfx" "$cur_" "$sfx"
- return
- ;;
- difftool.*.*)
- local pfx="${cur_%.*}."
- cur_="${cur_##*.}"
- __gitcomp "cmd path" "$pfx" "$cur_" "$sfx"
- return
- ;;
- man.*.*)
- local pfx="${cur_%.*}."
- cur_="${cur_##*.}"
- __gitcomp "cmd path" "$pfx" "$cur_" "$sfx"
- return
- ;;
- mergetool.*.*)
- local pfx="${cur_%.*}."
- cur_="${cur_##*.}"
- __gitcomp "cmd path trustExitCode" "$pfx" "$cur_" "$sfx"
+ __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:- }"
return
;;
pager.*)
local pfx="${cur_%.*}."
cur_="${cur_#*.}"
__git_compute_all_commands
- __gitcomp_nl "$__git_all_commands" "$pfx" "$cur_" "${sfx- }"
- return
- ;;
- remote.*.*)
- local pfx="${cur_%.*}."
- cur_="${cur_##*.}"
- __gitcomp "
- url proxy fetch push mirror skipDefaultUpdate
- receivepack uploadpack tagOpt pushurl
- " "$pfx" "$cur_" "$sfx"
+ __gitcomp_nl "$__git_all_commands" "$pfx" "$cur_" "${sfx:- }"
return
;;
remote.*)
local pfx="${cur_%.*}."
cur_="${cur_#*.}"
+ local section="${pfx%.}"
__gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "."
- __gitcomp_nl_append "pushDefault" "$pfx" "$cur_" "${sfx- }"
+ __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:- }"
return
;;
- url.*.*)
+ submodule.*)
local pfx="${cur_%.*}."
- cur_="${cur_##*.}"
- __gitcomp "insteadOf pushInsteadOf" "$pfx" "$cur_" "$sfx"
+ cur_="${cur_#*.}"
+ local section="${pfx%.}"
+ __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:- }"
return
;;
*.*)
@@ -2891,7 +3109,7 @@ _git_restore ()
__gitcomp_builtin restore
;;
*)
- if __git rev-parse --verify --quiet HEAD >/dev/null; then
+ if __git_pseudoref_exists HEAD; then
__git_complete_index_file "--modified"
fi
esac
@@ -2901,8 +3119,7 @@ __git_revert_inprogress_options=$__git_sequencer_inprogress_options
_git_revert ()
{
- __git_find_repo_path
- if [ -f "$__git_repo_path"/REVERT_HEAD ]; then
+ if __git_pseudoref_exists REVERT_HEAD; then
__gitcomp "$__git_revert_inprogress_options"
return
fi
@@ -2972,10 +3189,19 @@ _git_show ()
__gitcomp "$__git_color_moved_ws_opts" "" "${cur##--color-moved-ws=}"
return
;;
+ --ws-error-highlight=*)
+ __gitcomp "$__git_ws_error_highlight_opts" "" "${cur##--ws-error-highlight=}"
+ return
+ ;;
+ --diff-merges=*)
+ __gitcomp "$__git_diff_merges_opts" "" "${cur##--diff-merges=}"
+ return
+ ;;
--*)
__gitcomp "--pretty= --format= --abbrev-commit --no-abbrev-commit
--oneline --show-signature
--expand-tabs --expand-tabs= --no-expand-tabs
+ $__git_log_show_options
$__git_diff_common_options
"
return
@@ -3014,12 +3240,119 @@ __gitcomp_directories ()
COMPREPLY+=("$c/")
_found=1
fi
- done < <(git ls-tree -z -d --name-only HEAD $_tmp_dir)
+ done < <(__git ls-tree -z -d --name-only HEAD $_tmp_dir)
if [[ $_found == 0 ]] && [[ "$cur" =~ /$ ]]; then
# No possible further completions any deeper, so assume we're at
# a leaf directory and just consider it complete
__gitcomp_direct_append "$cur "
+ elif [[ $_found == 0 ]]; then
+ # No possible completions found. Avoid falling back to
+ # bash's default file and directory completion, because all
+ # valid completions have already been searched and the
+ # fallbacks can do nothing but mislead. In fact, they can
+ # mislead in three different ways:
+ # 1) Fallback file completion makes no sense when asking
+ # for directory completions, as this function does.
+ # 2) Fallback directory completion is bad because
+ # e.g. "/pro" is invalid and should NOT complete to
+ # "/proc".
+ # 3) Fallback file/directory completion only completes
+ # on paths that exist in the current working tree,
+ # i.e. which are *already* part of their
+ # sparse-checkout. Thus, normal file and directory
+ # completion is always useless for "git
+ # sparse-checkout add" and is also probelmatic for
+ # "git sparse-checkout set" unless using it to
+ # strictly narrow the checkout.
+ COMPREPLY=( "" )
+ fi
+}
+
+# In non-cone mode, the arguments to {set,add} are supposed to be
+# patterns, relative to the toplevel directory. These can be any kind
+# of general pattern, like 'subdir/*.c' and we can't complete on all
+# of those. However, if the user presses Tab to get tab completion, we
+# presume that they are trying to provide a pattern that names a specific
+# path.
+__gitcomp_slash_leading_paths ()
+{
+ local dequoted_word pfx="" cur_ toplevel
+
+ # Since we are dealing with a sparse-checkout, subdirectories may not
+ # exist in the local working copy. Therefore, we want to run all
+ # ls-files commands relative to the repository toplevel.
+ toplevel="$(git rev-parse --show-toplevel)/"
+
+ __git_dequote "$cur"
+
+ # If the paths provided by the user already start with '/', then
+ # they are considered relative to the toplevel of the repository
+ # already. If they do not start with /, then we need to adjust
+ # them to start with the appropriate prefix.
+ case "$cur" in
+ /*)
+ cur="${cur:1}"
+ ;;
+ *)
+ pfx="$(__git rev-parse --show-prefix)"
+ esac
+
+ # Since sparse-index is limited to cone-mode, in non-cone-mode the
+ # list of valid paths is precisely the cached files in the index.
+ #
+ # NEEDSWORK:
+ # 1) We probably need to take care of cases where ls-files
+ # responds with special quoting.
+ # 2) We probably need to take care of cases where ${cur} has
+ # some kind of special quoting.
+ # 3) On top of any quoting from 1 & 2, we have to provide an extra
+ # level of quoting for any paths that contain a '*', '?', '\',
+ # '[', ']', or leading '#' or '!' since those will be
+ # interpreted by sparse-checkout as something other than a
+ # literal path character.
+ # Since there are two types of quoting here, this might get really
+ # complex. For now, just punt on all of this...
+ completions="$(__git -C "${toplevel}" -c core.quotePath=false \
+ ls-files --cached -- "${pfx}${cur}*" \
+ | sed -e s%^%/% -e 's%$% %')"
+ # Note, above, though that we needed all of the completions to be
+ # prefixed with a '/', and we want to add a space so that bash
+ # completion will actually complete an entry and let us move on to
+ # the next one.
+
+ # Return what we've found.
+ if test -n "$completions"; then
+ # We found some completions; return them
+ local IFS=$'\n'
+ COMPREPLY=($completions)
+ else
+ # Do NOT fall back to bash-style all-local-files-and-dirs
+ # when we find no match. Such options are worse than
+ # useless:
+ # 1. "git sparse-checkout add" needs paths that are NOT
+ # currently in the working copy. "git
+ # sparse-checkout set" does as well, except in the
+ # special cases when users are only trying to narrow
+ # their sparse checkout to a subset of what they
+ # already have.
+ #
+ # 2. A path like '.config' is ambiguous as to whether
+ # the user wants all '.config' files throughout the
+ # tree, or just the one under the current directory.
+ # It would result in a warning from the
+ # sparse-checkout command due to this. As such, all
+ # completions of paths should be prefixed with a
+ # '/'.
+ #
+ # 3. We don't want paths prefixed with a '/' to
+ # complete files in the system root directory, we
+ # want it to complete on files relative to the
+ # repository root.
+ #
+ # As such, make sure that NO completions are offered rather
+ # than falling back to bash's default completions.
+ COMPREPLY=( "" )
fi
}
@@ -3027,6 +3360,7 @@ _git_sparse_checkout ()
{
local subcommands="list init set disable add reapply"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
+ local using_cone=true
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
@@ -3037,9 +3371,18 @@ _git_sparse_checkout ()
__gitcomp_builtin sparse-checkout_$subcommand "" "--"
;;
set,*|add,*)
- if [ "$(__git config core.sparseCheckoutCone)" == "true" ] ||
- [ -n "$(__git_find_on_cmdline --cone)" ]; then
+ if [[ "$(__git config core.sparseCheckout)" == "true" &&
+ "$(__git config core.sparseCheckoutCone)" == "false" &&
+ -z "$(__git_find_on_cmdline --cone)" ]]; then
+ using_cone=false
+ fi
+ if [[ -n "$(__git_find_on_cmdline --no-cone)" ]]; then
+ using_cone=false
+ fi
+ if [[ "$using_cone" == "true" ]]; then
__gitcomp_directories
+ else
+ __gitcomp_slash_leading_paths
fi
esac
}
@@ -3286,7 +3629,7 @@ __git_complete_worktree_paths ()
# Generate completion reply from worktree list skipping the first
# entry: it's the path of the main worktree, which can't be moved,
# removed, locked, etc.
- __gitcomp_nl "$(git worktree list --porcelain |
+ __gitcomp_nl "$(__git worktree list --porcelain |
sed -n -e '2,$ s/^worktree //p')"
}
@@ -3522,7 +3865,7 @@ __gitk_main ()
__git_find_repo_path
local merge=""
- if [ -f "$__git_repo_path/MERGE_HEAD" ]; then
+ if __git_pseudoref_exists MERGE_HEAD; then
merge="--merge"
fi
case "$cur" in
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index 1435548..5330e76 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@ -84,6 +84,10 @@
# single '?' character by setting GIT_PS1_COMPRESSSPARSESTATE, or omitted
# by setting GIT_PS1_OMITSPARSESTATE.
#
+# If you would like to see a notification on the prompt when there are
+# unresolved conflicts, set GIT_PS1_SHOWCONFLICTSTATE to "yes". The
+# prompt will include "|CONFLICT".
+#
# If you would like to see more information about the identity of
# commits checked out as a detached HEAD, set GIT_PS1_DESCRIBE_STYLE
# to one of these values:
@@ -96,9 +100,7 @@
#
# If you would like a colored hint about the current dirty state, set
# GIT_PS1_SHOWCOLORHINTS to a nonempty value. The colors are based on
-# the colored output of "git status -sb" and are available only when
-# using __git_ps1 for PROMPT_COMMAND or precmd in Bash,
-# but always available in Zsh.
+# the colored output of "git status -sb".
#
# If you would like __git_ps1 to do nothing in the case when the current
# directory is set up to be ignored by git, then set
@@ -139,7 +141,7 @@ __git_ps1_show_upstream ()
# parse configuration values
local option
- for option in ${GIT_PS1_SHOWUPSTREAM}; do
+ for option in ${GIT_PS1_SHOWUPSTREAM-}; do
case "$option" in
git|svn) upstream_type="$option" ;;
verbose) verbose=1 ;;
@@ -255,12 +257,12 @@ __git_ps1_colorize_gitstring ()
local c_lblue='%F{blue}'
local c_clear='%f'
else
- # Using \[ and \] around colors is necessary to prevent
+ # Using \001 and \002 around colors is necessary to prevent
# issues with command line editing/browsing/completion!
- local c_red='\[\e[31m\]'
- local c_green='\[\e[32m\]'
- local c_lblue='\[\e[1;34m\]'
- local c_clear='\[\e[0m\]'
+ local c_red=$'\001\e[31m\002'
+ local c_green=$'\001\e[32m\002'
+ local c_lblue=$'\001\e[1;34m\002'
+ local c_clear=$'\001\e[0m\002'
fi
local bad_color=$c_red
local ok_color=$c_green
@@ -296,7 +298,7 @@ __git_ps1_colorize_gitstring ()
# variable, in that order.
__git_eread ()
{
- test -r "$1" && IFS=$'\r\n' read "$2" <"$1"
+ test -r "$1" && IFS=$'\r\n' read -r "$2" <"$1"
}
# see if a cherry-pick or revert is in progress, if the user has committed a
@@ -406,7 +408,7 @@ __git_ps1 ()
local repo_info rev_parse_exit_code
repo_info="$(git rev-parse --git-dir --is-inside-git-dir \
- --is-bare-repository --is-inside-work-tree \
+ --is-bare-repository --is-inside-work-tree --show-ref-format \
--short HEAD 2>/dev/null)"
rev_parse_exit_code="$?"
@@ -419,6 +421,8 @@ __git_ps1 ()
short_sha="${repo_info##*$'\n'}"
repo_info="${repo_info%$'\n'*}"
fi
+ local ref_format="${repo_info##*$'\n'}"
+ repo_info="${repo_info%$'\n'*}"
local inside_worktree="${repo_info##*$'\n'}"
repo_info="${repo_info%$'\n'*}"
local bare_repo="${repo_info##*$'\n'}"
@@ -477,12 +481,25 @@ __git_ps1 ()
b="$(git symbolic-ref HEAD 2>/dev/null)"
else
local head=""
- if ! __git_eread "$g/HEAD" head; then
- return $exit
- fi
- # is it a symbolic ref?
- b="${head#ref: }"
- if [ "$head" = "$b" ]; then
+
+ case "$ref_format" in
+ files)
+ if ! __git_eread "$g/HEAD" head; then
+ return $exit
+ fi
+
+ if [[ $head == "ref: "* ]]; then
+ head="${head#ref: }"
+ else
+ head=""
+ fi
+ ;;
+ *)
+ head="$(git symbolic-ref HEAD 2>/dev/null)"
+ ;;
+ esac
+
+ if test -z "$head"; then
detached=yes
b="$(
case "${GIT_PS1_DESCRIBE_STYLE-}" in
@@ -500,6 +517,8 @@ __git_ps1 ()
b="$short_sha..."
b="($b)"
+ else
+ b="$head"
fi
fi
fi
@@ -508,6 +527,12 @@ __git_ps1 ()
r="$r $step/$total"
fi
+ local conflict="" # state indicator for unresolved conflicts
+ if [[ "${GIT_PS1_SHOWCONFLICTSTATE-}" == "yes" ]] &&
+ [[ $(git ls-files --unmerged 2>/dev/null) ]]; then
+ conflict="|CONFLICT"
+ fi
+
local w=""
local i=""
local s=""
@@ -564,15 +589,12 @@ __git_ps1 ()
b="\${__git_ps1_branch_name}"
fi
- # NO color option unless in PROMPT_COMMAND mode or it's Zsh
if [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
- if [ $pcmode = yes ] || [ -n "${ZSH_VERSION-}" ]; then
- __git_ps1_colorize_gitstring
- fi
+ __git_ps1_colorize_gitstring
fi
local f="$h$w$i$s$u$p"
- local gitstring="$c$b${f:+$z$f}${sparse}$r${upstream}"
+ local gitstring="$c$b${f:+$z$f}${sparse}$r${upstream}${conflict}"
if [ $pcmode = yes ]; then
if [ "${__git_printf_supports_v-}" != yes ]; then
diff --git a/contrib/coverage-diff.sh b/contrib/coverage-diff.sh
index 4ec419f..6ce9603 100755
--- a/contrib/coverage-diff.sh
+++ b/contrib/coverage-diff.sh
@@ -74,8 +74,7 @@ do
sort >uncovered_lines.txt
comm -12 uncovered_lines.txt new_lines.txt |
- sed -e 's/$/\)/' |
- sed -e 's/^/ /' >uncovered_new_lines.txt
+ sed -e 's/$/\)/' -e 's/^/ /' >uncovered_new_lines.txt
grep -q '[^[:space:]]' <uncovered_new_lines.txt &&
echo $file >>coverage-data.txt &&
@@ -91,11 +90,7 @@ cat coverage-data.txt
echo "Commits introducing uncovered code:"
-commit_list=$(cat coverage-data.txt |
- grep -E '^[0-9a-f]{7,} ' |
- awk '{print $1;}' |
- sort |
- uniq)
+commit_list=$(awk '/^[0-9a-f]{7,}/ { print $1 }' coverage-data.txt | sort -u)
(
for commit in $commit_list
diff --git a/contrib/credential/gnome-keyring/.gitignore b/contrib/credential/gnome-keyring/.gitignore
deleted file mode 100644
index 88d8fcd..0000000
--- a/contrib/credential/gnome-keyring/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-git-credential-gnome-keyring
diff --git a/contrib/credential/gnome-keyring/Makefile b/contrib/credential/gnome-keyring/Makefile
deleted file mode 100644
index 22c19df..0000000
--- a/contrib/credential/gnome-keyring/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-MAIN:=git-credential-gnome-keyring
-all:: $(MAIN)
-
-CC = gcc
-RM = rm -f
-CFLAGS = -g -O2 -Wall
-PKG_CONFIG = pkg-config
-
--include ../../../config.mak.autogen
--include ../../../config.mak
-
-INCS:=$(shell $(PKG_CONFIG) --cflags gnome-keyring-1 glib-2.0)
-LIBS:=$(shell $(PKG_CONFIG) --libs gnome-keyring-1 glib-2.0)
-
-SRCS:=$(MAIN).c
-OBJS:=$(SRCS:.c=.o)
-
-%.o: %.c
- $(CC) $(CFLAGS) $(CPPFLAGS) $(INCS) -o $@ -c $<
-
-$(MAIN): $(OBJS)
- $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
-
-clean:
- @$(RM) $(MAIN) $(OBJS)
diff --git a/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c b/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
deleted file mode 100644
index 5927e27..0000000
--- a/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
+++ /dev/null
@@ -1,470 +0,0 @@
-/*
- * Copyright (C) 2011 John Szakmeister <john@szakmeister.net>
- * 2012 Philipp A. Hartmann <pah@qo.cx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * Credits:
- * - GNOME Keyring API handling originally written by John Szakmeister
- * - ported to credential helper API by Philipp A. Hartmann
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <glib.h>
-#include <gnome-keyring.h>
-
-#ifdef GNOME_KEYRING_DEFAULT
-
- /* Modern gnome-keyring */
-
-#include <gnome-keyring-memory.h>
-
-#else
-
- /*
- * Support ancient gnome-keyring, circ. RHEL 5.X.
- * GNOME_KEYRING_DEFAULT seems to have been introduced with Gnome 2.22,
- * and the other features roughly around Gnome 2.20, 6 months before.
- * Ubuntu 8.04 used Gnome 2.22 (I think). Not sure any distro used 2.20.
- * So the existence/non-existence of GNOME_KEYRING_DEFAULT seems like
- * a decent thing to use as an indicator.
- */
-
-#define GNOME_KEYRING_DEFAULT NULL
-
-/*
- * ancient gnome-keyring returns DENIED when an entry is not found.
- * Setting NO_MATCH to DENIED will prevent us from reporting DENIED
- * errors during get and erase operations, but we will still report
- * DENIED errors during a store.
- */
-#define GNOME_KEYRING_RESULT_NO_MATCH GNOME_KEYRING_RESULT_DENIED
-
-#define gnome_keyring_memory_alloc g_malloc
-#define gnome_keyring_memory_free gnome_keyring_free_password
-#define gnome_keyring_memory_strdup g_strdup
-
-static const char *gnome_keyring_result_to_message(GnomeKeyringResult result)
-{
- switch (result) {
- case GNOME_KEYRING_RESULT_OK:
- return "OK";
- case GNOME_KEYRING_RESULT_DENIED:
- return "Denied";
- case GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON:
- return "No Keyring Daemon";
- case GNOME_KEYRING_RESULT_ALREADY_UNLOCKED:
- return "Already UnLocked";
- case GNOME_KEYRING_RESULT_NO_SUCH_KEYRING:
- return "No Such Keyring";
- case GNOME_KEYRING_RESULT_BAD_ARGUMENTS:
- return "Bad Arguments";
- case GNOME_KEYRING_RESULT_IO_ERROR:
- return "IO Error";
- case GNOME_KEYRING_RESULT_CANCELLED:
- return "Cancelled";
- case GNOME_KEYRING_RESULT_ALREADY_EXISTS:
- return "Already Exists";
- default:
- return "Unknown Error";
- }
-}
-
-/*
- * Support really ancient gnome-keyring, circ. RHEL 4.X.
- * Just a guess for the Glib version. Glib 2.8 was roughly Gnome 2.12 ?
- * Which was released with gnome-keyring 0.4.3 ??
- */
-#if GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 8
-
-static void gnome_keyring_done_cb(GnomeKeyringResult result, gpointer user_data)
-{
- gpointer *data = (gpointer *)user_data;
- int *done = (int *)data[0];
- GnomeKeyringResult *r = (GnomeKeyringResult *)data[1];
-
- *r = result;
- *done = 1;
-}
-
-static void wait_for_request_completion(int *done)
-{
- GMainContext *mc = g_main_context_default();
- while (!*done)
- g_main_context_iteration(mc, TRUE);
-}
-
-static GnomeKeyringResult gnome_keyring_item_delete_sync(const char *keyring, guint32 id)
-{
- int done = 0;
- GnomeKeyringResult result;
- gpointer data[] = { &done, &result };
-
- gnome_keyring_item_delete(keyring, id, gnome_keyring_done_cb, data,
- NULL);
-
- wait_for_request_completion(&done);
-
- return result;
-}
-
-#endif
-#endif
-
-/*
- * This credential struct and API is simplified from git's credential.{h,c}
- */
-struct credential {
- char *protocol;
- char *host;
- unsigned short port;
- char *path;
- char *username;
- char *password;
-};
-
-#define CREDENTIAL_INIT { 0 }
-
-typedef int (*credential_op_cb)(struct credential *);
-
-struct credential_operation {
- char *name;
- credential_op_cb op;
-};
-
-#define CREDENTIAL_OP_END { NULL, NULL }
-
-/* ----------------- GNOME Keyring functions ----------------- */
-
-/* create a special keyring option string, if path is given */
-static char *keyring_object(struct credential *c)
-{
- if (!c->path)
- return NULL;
-
- if (c->port)
- return g_strdup_printf("%s:%hd/%s", c->host, c->port, c->path);
-
- return g_strdup_printf("%s/%s", c->host, c->path);
-}
-
-static int keyring_get(struct credential *c)
-{
- char *object = NULL;
- GList *entries;
- GnomeKeyringNetworkPasswordData *password_data;
- GnomeKeyringResult result;
-
- if (!c->protocol || !(c->host || c->path))
- return EXIT_FAILURE;
-
- object = keyring_object(c);
-
- result = gnome_keyring_find_network_password_sync(
- c->username,
- NULL /* domain */,
- c->host,
- object,
- c->protocol,
- NULL /* authtype */,
- c->port,
- &entries);
-
- g_free(object);
-
- if (result == GNOME_KEYRING_RESULT_NO_MATCH)
- return EXIT_SUCCESS;
-
- if (result == GNOME_KEYRING_RESULT_CANCELLED)
- return EXIT_SUCCESS;
-
- if (result != GNOME_KEYRING_RESULT_OK) {
- g_critical("%s", gnome_keyring_result_to_message(result));
- return EXIT_FAILURE;
- }
-
- /* pick the first one from the list */
- password_data = (GnomeKeyringNetworkPasswordData *)entries->data;
-
- gnome_keyring_memory_free(c->password);
- c->password = gnome_keyring_memory_strdup(password_data->password);
-
- if (!c->username)
- c->username = g_strdup(password_data->user);
-
- gnome_keyring_network_password_list_free(entries);
-
- return EXIT_SUCCESS;
-}
-
-
-static int keyring_store(struct credential *c)
-{
- guint32 item_id;
- char *object = NULL;
- GnomeKeyringResult result;
-
- /*
- * Sanity check that what we are storing is actually sensible.
- * In particular, we can't make a URL without a protocol field.
- * Without either a host or pathname (depending on the scheme),
- * we have no primary key. And without a username and password,
- * we are not actually storing a credential.
- */
- if (!c->protocol || !(c->host || c->path) ||
- !c->username || !c->password)
- return EXIT_FAILURE;
-
- object = keyring_object(c);
-
- result = gnome_keyring_set_network_password_sync(
- GNOME_KEYRING_DEFAULT,
- c->username,
- NULL /* domain */,
- c->host,
- object,
- c->protocol,
- NULL /* authtype */,
- c->port,
- c->password,
- &item_id);
-
- g_free(object);
-
- if (result != GNOME_KEYRING_RESULT_OK &&
- result != GNOME_KEYRING_RESULT_CANCELLED) {
- g_critical("%s", gnome_keyring_result_to_message(result));
- return EXIT_FAILURE;
- }
-
- return EXIT_SUCCESS;
-}
-
-static int keyring_erase(struct credential *c)
-{
- char *object = NULL;
- GList *entries;
- GnomeKeyringNetworkPasswordData *password_data;
- GnomeKeyringResult result;
-
- /*
- * Sanity check that we actually have something to match
- * against. The input we get is a restrictive pattern,
- * so technically a blank credential means "erase everything".
- * But it is too easy to accidentally send this, since it is equivalent
- * to empty input. So explicitly disallow it, and require that the
- * pattern have some actual content to match.
- */
- if (!c->protocol && !c->host && !c->path && !c->username)
- return EXIT_FAILURE;
-
- object = keyring_object(c);
-
- result = gnome_keyring_find_network_password_sync(
- c->username,
- NULL /* domain */,
- c->host,
- object,
- c->protocol,
- NULL /* authtype */,
- c->port,
- &entries);
-
- g_free(object);
-
- if (result == GNOME_KEYRING_RESULT_NO_MATCH)
- return EXIT_SUCCESS;
-
- if (result == GNOME_KEYRING_RESULT_CANCELLED)
- return EXIT_SUCCESS;
-
- if (result != GNOME_KEYRING_RESULT_OK) {
- g_critical("%s", gnome_keyring_result_to_message(result));
- return EXIT_FAILURE;
- }
-
- /* pick the first one from the list (delete all matches?) */
- password_data = (GnomeKeyringNetworkPasswordData *)entries->data;
-
- result = gnome_keyring_item_delete_sync(
- password_data->keyring, password_data->item_id);
-
- gnome_keyring_network_password_list_free(entries);
-
- if (result != GNOME_KEYRING_RESULT_OK) {
- g_critical("%s", gnome_keyring_result_to_message(result));
- return EXIT_FAILURE;
- }
-
- return EXIT_SUCCESS;
-}
-
-/*
- * Table with helper operation callbacks, used by generic
- * credential helper main function.
- */
-static struct credential_operation const credential_helper_ops[] = {
- { "get", keyring_get },
- { "store", keyring_store },
- { "erase", keyring_erase },
- CREDENTIAL_OP_END
-};
-
-/* ------------------ credential functions ------------------ */
-
-static void credential_init(struct credential *c)
-{
- memset(c, 0, sizeof(*c));
-}
-
-static void credential_clear(struct credential *c)
-{
- g_free(c->protocol);
- g_free(c->host);
- g_free(c->path);
- g_free(c->username);
- gnome_keyring_memory_free(c->password);
-
- credential_init(c);
-}
-
-static int credential_read(struct credential *c)
-{
- char *buf;
- size_t line_len;
- char *key;
- char *value;
-
- key = buf = gnome_keyring_memory_alloc(1024);
-
- while (fgets(buf, 1024, stdin)) {
- line_len = strlen(buf);
-
- if (line_len && buf[line_len-1] == '\n')
- buf[--line_len] = '\0';
-
- if (!line_len)
- break;
-
- value = strchr(buf, '=');
- if (!value) {
- g_warning("invalid credential line: %s", key);
- gnome_keyring_memory_free(buf);
- return -1;
- }
- *value++ = '\0';
-
- if (!strcmp(key, "protocol")) {
- g_free(c->protocol);
- c->protocol = g_strdup(value);
- } else if (!strcmp(key, "host")) {
- g_free(c->host);
- c->host = g_strdup(value);
- value = strrchr(c->host, ':');
- if (value) {
- *value++ = '\0';
- c->port = atoi(value);
- }
- } else if (!strcmp(key, "path")) {
- g_free(c->path);
- c->path = g_strdup(value);
- } else if (!strcmp(key, "username")) {
- g_free(c->username);
- c->username = g_strdup(value);
- } else if (!strcmp(key, "password")) {
- gnome_keyring_memory_free(c->password);
- c->password = gnome_keyring_memory_strdup(value);
- while (*value)
- *value++ = '\0';
- }
- /*
- * Ignore other lines; we don't know what they mean, but
- * this future-proofs us when later versions of git do
- * learn new lines, and the helpers are updated to match.
- */
- }
-
- gnome_keyring_memory_free(buf);
-
- return 0;
-}
-
-static void credential_write_item(FILE *fp, const char *key, const char *value)
-{
- if (!value)
- return;
- fprintf(fp, "%s=%s\n", key, value);
-}
-
-static void credential_write(const struct credential *c)
-{
- /* only write username/password, if set */
- credential_write_item(stdout, "username", c->username);
- credential_write_item(stdout, "password", c->password);
-}
-
-static void usage(const char *name)
-{
- struct credential_operation const *try_op = credential_helper_ops;
- const char *basename = strrchr(name, '/');
-
- basename = (basename) ? basename + 1 : name;
- fprintf(stderr, "usage: %s <", basename);
- while (try_op->name) {
- fprintf(stderr, "%s", (try_op++)->name);
- if (try_op->name)
- fprintf(stderr, "%s", "|");
- }
- fprintf(stderr, "%s", ">\n");
-}
-
-int main(int argc, char *argv[])
-{
- int ret = EXIT_SUCCESS;
-
- struct credential_operation const *try_op = credential_helper_ops;
- struct credential cred = CREDENTIAL_INIT;
-
- if (!argv[1]) {
- usage(argv[0]);
- exit(EXIT_FAILURE);
- }
-
- g_set_application_name("Git Credential Helper");
-
- /* lookup operation callback */
- while (try_op->name && strcmp(argv[1], try_op->name))
- try_op++;
-
- /* unsupported operation given -- ignore silently */
- if (!try_op->name || !try_op->op)
- goto out;
-
- ret = credential_read(&cred);
- if (ret)
- goto out;
-
- /* perform credential operation */
- ret = (*try_op->op)(&cred);
-
- credential_write(&cred);
-
-out:
- credential_clear(&cred);
- return ret;
-}
diff --git a/contrib/credential/libsecret/.gitignore b/contrib/credential/libsecret/.gitignore
new file mode 100644
index 0000000..4fa2235
--- /dev/null
+++ b/contrib/credential/libsecret/.gitignore
@@ -0,0 +1 @@
+git-credential-libsecret
diff --git a/contrib/credential/libsecret/git-credential-libsecret.c b/contrib/credential/libsecret/git-credential-libsecret.c
index 2c5d76d..90034d0 100644
--- a/contrib/credential/libsecret/git-credential-libsecret.c
+++ b/contrib/credential/libsecret/git-credential-libsecret.c
@@ -39,6 +39,8 @@ struct credential {
char *path;
char *username;
char *password;
+ char *password_expiry_utc;
+ char *oauth_refresh_token;
};
#define CREDENTIAL_INIT { 0 }
@@ -52,8 +54,29 @@ struct credential_operation {
#define CREDENTIAL_OP_END { NULL, NULL }
+static void credential_clear(struct credential *c);
+
/* ----------------- Secret Service functions ----------------- */
+static const SecretSchema schema = {
+ "org.git.Password",
+ /* Ignore schema name during search for backwards compatibility */
+ SECRET_SCHEMA_DONT_MATCH_NAME,
+ {
+ /*
+ * libsecret assumes attribute values are non-confidential and
+ * unchanging, so we can't include oauth_refresh_token or
+ * password_expiry_utc.
+ */
+ { "user", SECRET_SCHEMA_ATTRIBUTE_STRING },
+ { "object", SECRET_SCHEMA_ATTRIBUTE_STRING },
+ { "protocol", SECRET_SCHEMA_ATTRIBUTE_STRING },
+ { "port", SECRET_SCHEMA_ATTRIBUTE_INTEGER },
+ { "server", SECRET_SCHEMA_ATTRIBUTE_STRING },
+ { NULL, 0 },
+ }
+};
+
static char *make_label(struct credential *c)
{
if (c->port)
@@ -101,7 +124,7 @@ static int keyring_get(struct credential *c)
attributes = make_attr_list(c);
items = secret_service_search_sync(service,
- SECRET_SCHEMA_COMPAT_NETWORK,
+ &schema,
attributes,
SECRET_SEARCH_LOAD_SECRETS | SECRET_SEARCH_UNLOCK,
NULL,
@@ -117,6 +140,7 @@ static int keyring_get(struct credential *c)
SecretItem *item;
SecretValue *secret;
const char *s;
+ gchar **parts;
item = items->data;
secret = secret_item_get_secret(item);
@@ -130,8 +154,30 @@ static int keyring_get(struct credential *c)
s = secret_value_get_text(secret);
if (s) {
- g_free(c->password);
- c->password = g_strdup(s);
+ /*
+ * Passwords and other attributes encoded in following format:
+ * hunter2
+ * password_expiry_utc=1684189401
+ * oauth_refresh_token=xyzzy
+ */
+ parts = g_strsplit(s, "\n", 0);
+ if (g_strv_length(parts) >= 1) {
+ g_free(c->password);
+ c->password = g_strdup(parts[0]);
+ } else {
+ g_free(c->password);
+ c->password = g_strdup("");
+ }
+ for (int i = 1; i < g_strv_length(parts); i++) {
+ if (g_str_has_prefix(parts[i], "password_expiry_utc=")) {
+ g_free(c->password_expiry_utc);
+ c->password_expiry_utc = g_strdup(&parts[i][20]);
+ } else if (g_str_has_prefix(parts[i], "oauth_refresh_token=")) {
+ g_free(c->oauth_refresh_token);
+ c->oauth_refresh_token = g_strdup(&parts[i][20]);
+ }
+ }
+ g_strfreev(parts);
}
g_hash_table_unref(attributes);
@@ -148,6 +194,7 @@ static int keyring_store(struct credential *c)
char *label = NULL;
GHashTable *attributes = NULL;
GError *error = NULL;
+ GString *secret = NULL;
/*
* Sanity check that what we are storing is actually sensible.
@@ -162,13 +209,23 @@ static int keyring_store(struct credential *c)
label = make_label(c);
attributes = make_attr_list(c);
- secret_password_storev_sync(SECRET_SCHEMA_COMPAT_NETWORK,
+ secret = g_string_new(c->password);
+ if (c->password_expiry_utc) {
+ g_string_append_printf(secret, "\npassword_expiry_utc=%s",
+ c->password_expiry_utc);
+ }
+ if (c->oauth_refresh_token) {
+ g_string_append_printf(secret, "\noauth_refresh_token=%s",
+ c->oauth_refresh_token);
+ }
+ secret_password_storev_sync(&schema,
attributes,
NULL,
label,
- c->password,
+ secret->str,
NULL,
&error);
+ g_string_free(secret, TRUE);
g_free(label);
g_hash_table_unref(attributes);
@@ -185,6 +242,7 @@ static int keyring_erase(struct credential *c)
{
GHashTable *attributes = NULL;
GError *error = NULL;
+ struct credential existing = CREDENTIAL_INIT;
/*
* Sanity check that we actually have something to match
@@ -197,8 +255,22 @@ static int keyring_erase(struct credential *c)
if (!c->protocol && !c->host && !c->path && !c->username)
return EXIT_FAILURE;
+ if (c->password) {
+ existing.host = g_strdup(c->host);
+ existing.path = g_strdup(c->path);
+ existing.port = c->port;
+ existing.protocol = g_strdup(c->protocol);
+ existing.username = g_strdup(c->username);
+ keyring_get(&existing);
+ if (existing.password && strcmp(c->password, existing.password)) {
+ credential_clear(&existing);
+ return EXIT_SUCCESS;
+ }
+ credential_clear(&existing);
+ }
+
attributes = make_attr_list(c);
- secret_password_clearv_sync(SECRET_SCHEMA_COMPAT_NETWORK,
+ secret_password_clearv_sync(&schema,
attributes,
NULL,
&error);
@@ -238,23 +310,24 @@ static void credential_clear(struct credential *c)
g_free(c->path);
g_free(c->username);
g_free(c->password);
+ g_free(c->password_expiry_utc);
+ g_free(c->oauth_refresh_token);
credential_init(c);
}
static int credential_read(struct credential *c)
{
- char *buf;
- size_t line_len;
+ char *buf = NULL;
+ size_t alloc;
+ ssize_t line_len;
char *key;
char *value;
- key = buf = g_malloc(1024);
-
- while (fgets(buf, 1024, stdin)) {
- line_len = strlen(buf);
+ while ((line_len = getline(&buf, &alloc, stdin)) > 0) {
+ key = buf;
- if (line_len && buf[line_len-1] == '\n')
+ if (buf[line_len-1] == '\n')
buf[--line_len] = '\0';
if (!line_len)
@@ -285,11 +358,19 @@ static int credential_read(struct credential *c)
} else if (!strcmp(key, "username")) {
g_free(c->username);
c->username = g_strdup(value);
+ } else if (!strcmp(key, "password_expiry_utc")) {
+ g_free(c->password_expiry_utc);
+ c->password_expiry_utc = g_strdup(value);
} else if (!strcmp(key, "password")) {
g_free(c->password);
c->password = g_strdup(value);
while (*value)
*value++ = '\0';
+ } else if (!strcmp(key, "oauth_refresh_token")) {
+ g_free(c->oauth_refresh_token);
+ c->oauth_refresh_token = g_strdup(value);
+ while (*value)
+ *value++ = '\0';
}
/*
* Ignore other lines; we don't know what they mean, but
@@ -298,7 +379,7 @@ static int credential_read(struct credential *c)
*/
}
- g_free(buf);
+ free(buf);
return 0;
}
@@ -315,6 +396,10 @@ static void credential_write(const struct credential *c)
/* only write username/password, if set */
credential_write_item(stdout, "username", c->username);
credential_write_item(stdout, "password", c->password);
+ credential_write_item(stdout, "password_expiry_utc",
+ c->password_expiry_utc);
+ credential_write_item(stdout, "oauth_refresh_token",
+ c->oauth_refresh_token);
}
static void usage(const char *name)
diff --git a/contrib/credential/netrc/git-credential-netrc.perl b/contrib/credential/netrc/git-credential-netrc.perl
index bc57cc6..9fb998a 100755
--- a/contrib/credential/netrc/git-credential-netrc.perl
+++ b/contrib/credential/netrc/git-credential-netrc.perl
@@ -356,7 +356,10 @@ sub read_credential_data_from_stdin {
next unless m/^([^=]+)=(.+)/;
my ($token, $value) = ($1, $2);
- die "Unknown search token $token" unless exists $q{$token};
+
+ # skip any unknown tokens
+ next unless exists $q{$token};
+
$q{$token} = $value;
log_debug("We were given search token $token and value $value");
}
diff --git a/contrib/credential/netrc/t-git-credential-netrc.sh b/contrib/credential/netrc/t-git-credential-netrc.sh
index 07227d0..bf27773 100755
--- a/contrib/credential/netrc/t-git-credential-netrc.sh
+++ b/contrib/credential/netrc/t-git-credential-netrc.sh
@@ -3,16 +3,9 @@
cd ../../../t
test_description='git-credential-netrc'
. ./test-lib.sh
+ . "$TEST_DIRECTORY"/lib-perl.sh
- if ! test_have_prereq PERL; then
- skip_all='skipping perl interface tests, perl not available'
- test_done
- fi
-
- perl -MTest::More -e 0 2>/dev/null || {
- skip_all="Perl Test::More unavailable, skipping test"
- test_done
- }
+ skip_all_if_no_Test_More
# set up test repository
@@ -20,13 +13,10 @@
'set up test repository' \
'git config --add gpg.program test.git-config-gpg'
- # The external test will outputs its own plan
- test_external_has_tap=1
-
export PERL5LIB="$GITPERLLIB"
- test_external \
- 'git-credential-netrc' \
+ test_expect_success 'git-credential-netrc' '
perl "$GIT_BUILD_DIR"/contrib/credential/netrc/test.pl
+ '
test_done
)
diff --git a/contrib/credential/osxkeychain/Makefile b/contrib/credential/osxkeychain/Makefile
index 4b3a08a..238f5f8 100644
--- a/contrib/credential/osxkeychain/Makefile
+++ b/contrib/credential/osxkeychain/Makefile
@@ -8,7 +8,8 @@ CFLAGS = -g -O2 -Wall
-include ../../../config.mak
git-credential-osxkeychain: git-credential-osxkeychain.o
- $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -Wl,-framework -Wl,Security
+ $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) \
+ -framework Security -framework CoreFoundation
git-credential-osxkeychain.o: git-credential-osxkeychain.c
$(CC) -c $(CFLAGS) $<
diff --git a/contrib/credential/osxkeychain/git-credential-osxkeychain.c b/contrib/credential/osxkeychain/git-credential-osxkeychain.c
index bf77748..6a40917 100644
--- a/contrib/credential/osxkeychain/git-credential-osxkeychain.c
+++ b/contrib/credential/osxkeychain/git-credential-osxkeychain.c
@@ -3,14 +3,51 @@
#include <stdlib.h>
#include <Security/Security.h>
-static SecProtocolType protocol;
-static char *host;
-static char *path;
-static char *username;
-static char *password;
-static UInt16 port;
-
-__attribute__((format (printf, 1, 2)))
+#define ENCODING kCFStringEncodingUTF8
+static CFStringRef protocol; /* Stores constant strings - not memory managed */
+static CFStringRef host;
+static CFNumberRef port;
+static CFStringRef path;
+static CFStringRef username;
+static CFDataRef password;
+static CFDataRef password_expiry_utc;
+static CFDataRef oauth_refresh_token;
+
+static void clear_credential(void)
+{
+ if (host) {
+ CFRelease(host);
+ host = NULL;
+ }
+ if (port) {
+ CFRelease(port);
+ port = NULL;
+ }
+ if (path) {
+ CFRelease(path);
+ path = NULL;
+ }
+ if (username) {
+ CFRelease(username);
+ username = NULL;
+ }
+ if (password) {
+ CFRelease(password);
+ password = NULL;
+ }
+ if (password_expiry_utc) {
+ CFRelease(password_expiry_utc);
+ password_expiry_utc = NULL;
+ }
+ if (oauth_refresh_token) {
+ CFRelease(oauth_refresh_token);
+ oauth_refresh_token = NULL;
+ }
+}
+
+#define STRING_WITH_LENGTH(s) s, sizeof(s) - 1
+
+__attribute__((format (printf, 1, 2), __noreturn__))
static void die(const char *err, ...)
{
char msg[4096];
@@ -19,70 +56,199 @@ static void die(const char *err, ...)
vsnprintf(msg, sizeof(msg), err, params);
fprintf(stderr, "%s\n", msg);
va_end(params);
+ clear_credential();
exit(1);
}
-static void *xstrdup(const char *s1)
+static void *xmalloc(size_t len)
{
- void *ret = strdup(s1);
+ void *ret = malloc(len);
if (!ret)
die("Out of memory");
return ret;
}
-#define KEYCHAIN_ITEM(x) (x ? strlen(x) : 0), x
-#define KEYCHAIN_ARGS \
- NULL, /* default keychain */ \
- KEYCHAIN_ITEM(host), \
- 0, NULL, /* account domain */ \
- KEYCHAIN_ITEM(username), \
- KEYCHAIN_ITEM(path), \
- port, \
- protocol, \
- kSecAuthenticationTypeDefault
-
-static void write_item(const char *what, const char *buf, int len)
+static CFDictionaryRef create_dictionary(CFAllocatorRef allocator, ...)
+{
+ va_list args;
+ const void *key;
+ CFMutableDictionaryRef result;
+
+ result = CFDictionaryCreateMutable(allocator,
+ 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+
+
+ va_start(args, allocator);
+ while ((key = va_arg(args, const void *)) != NULL) {
+ const void *value;
+ value = va_arg(args, const void *);
+ if (value)
+ CFDictionarySetValue(result, key, value);
+ }
+ va_end(args);
+
+ return result;
+}
+
+#define CREATE_SEC_ATTRIBUTES(...) \
+ create_dictionary(kCFAllocatorDefault, \
+ kSecClass, kSecClassInternetPassword, \
+ kSecAttrServer, host, \
+ kSecAttrAccount, username, \
+ kSecAttrPath, path, \
+ kSecAttrPort, port, \
+ kSecAttrProtocol, protocol, \
+ kSecAttrAuthenticationType, \
+ kSecAttrAuthenticationTypeDefault, \
+ __VA_ARGS__);
+
+static void write_item(const char *what, const char *buf, size_t len)
{
printf("%s=", what);
fwrite(buf, 1, len, stdout);
putchar('\n');
}
-static void find_username_in_item(SecKeychainItemRef item)
+static void find_username_in_item(CFDictionaryRef item)
{
- SecKeychainAttributeList list;
- SecKeychainAttribute attr;
+ CFStringRef account_ref;
+ char *username_buf;
+ CFIndex buffer_len;
- list.count = 1;
- list.attr = &attr;
- attr.tag = kSecAccountItemAttr;
+ account_ref = CFDictionaryGetValue(item, kSecAttrAccount);
+ if (!account_ref)
+ {
+ write_item("username", "", 0);
+ return;
+ }
- if (SecKeychainItemCopyContent(item, NULL, &list, NULL, NULL))
+ username_buf = (char *)CFStringGetCStringPtr(account_ref, ENCODING);
+ if (username_buf)
+ {
+ write_item("username", username_buf, strlen(username_buf));
return;
+ }
- write_item("username", attr.data, attr.length);
- SecKeychainItemFreeContent(&list, NULL);
+ /* If we can't get a CString pointer then
+ * we need to allocate our own buffer */
+ buffer_len = CFStringGetMaximumSizeForEncoding(
+ CFStringGetLength(account_ref), ENCODING) + 1;
+ username_buf = xmalloc(buffer_len);
+ if (CFStringGetCString(account_ref,
+ username_buf,
+ buffer_len,
+ ENCODING)) {
+ write_item("username", username_buf, buffer_len - 1);
+ }
+ free(username_buf);
}
-static void find_internet_password(void)
+static OSStatus find_internet_password(void)
{
- void *buf;
- UInt32 len;
- SecKeychainItemRef item;
+ CFDictionaryRef attrs;
+ CFDictionaryRef item;
+ CFDataRef data;
+ OSStatus result;
- if (SecKeychainFindInternetPassword(KEYCHAIN_ARGS, &len, &buf, &item))
- return;
+ attrs = CREATE_SEC_ATTRIBUTES(kSecMatchLimit, kSecMatchLimitOne,
+ kSecReturnAttributes, kCFBooleanTrue,
+ kSecReturnData, kCFBooleanTrue,
+ NULL);
+ result = SecItemCopyMatching(attrs, (CFTypeRef *)&item);
+ if (result) {
+ goto out;
+ }
- write_item("password", buf, len);
+ data = CFDictionaryGetValue(item, kSecValueData);
+
+ write_item("password",
+ (const char *)CFDataGetBytePtr(data),
+ CFDataGetLength(data));
if (!username)
find_username_in_item(item);
- SecKeychainItemFreeContent(NULL, buf);
+ CFRelease(item);
+
+out:
+ CFRelease(attrs);
+
+ /* We consider not found to not be an error */
+ if (result == errSecItemNotFound)
+ result = errSecSuccess;
+
+ return result;
}
-static void delete_internet_password(void)
+static OSStatus delete_ref(const void *itemRef)
{
- SecKeychainItemRef item;
+ CFArrayRef item_ref_list;
+ CFDictionaryRef delete_query;
+ OSStatus result;
+
+ item_ref_list = CFArrayCreate(kCFAllocatorDefault,
+ &itemRef,
+ 1,
+ &kCFTypeArrayCallBacks);
+ delete_query = create_dictionary(kCFAllocatorDefault,
+ kSecClass, kSecClassInternetPassword,
+ kSecMatchItemList, item_ref_list,
+ NULL);
+
+ if (password) {
+ /* We only want to delete items with a matching password */
+ CFIndex capacity;
+ CFMutableDictionaryRef query;
+ CFDataRef data;
+
+ capacity = CFDictionaryGetCount(delete_query) + 1;
+ query = CFDictionaryCreateMutableCopy(kCFAllocatorDefault,
+ capacity,
+ delete_query);
+ CFDictionarySetValue(query, kSecReturnData, kCFBooleanTrue);
+ result = SecItemCopyMatching(query, (CFTypeRef *)&data);
+ if (!result) {
+ CFDataRef kc_password;
+ const UInt8 *raw_data;
+ const UInt8 *line;
+
+ /* Don't match appended metadata */
+ raw_data = CFDataGetBytePtr(data);
+ line = memchr(raw_data, '\n', CFDataGetLength(data));
+ if (line)
+ kc_password = CFDataCreateWithBytesNoCopy(
+ kCFAllocatorDefault,
+ raw_data,
+ line - raw_data,
+ kCFAllocatorNull);
+ else
+ kc_password = data;
+
+ if (CFEqual(kc_password, password))
+ result = SecItemDelete(delete_query);
+
+ if (line)
+ CFRelease(kc_password);
+ CFRelease(data);
+ }
+
+ CFRelease(query);
+ } else {
+ result = SecItemDelete(delete_query);
+ }
+
+ CFRelease(delete_query);
+ CFRelease(item_ref_list);
+
+ return result;
+}
+
+static OSStatus delete_internet_password(void)
+{
+ CFDictionaryRef attrs;
+ CFArrayRef refs;
+ OSStatus result;
/*
* Require at least a protocol and host for removal, which is what git
@@ -90,37 +256,83 @@ static void delete_internet_password(void)
* Keychain manager.
*/
if (!protocol || !host)
- return;
+ return -1;
- if (SecKeychainFindInternetPassword(KEYCHAIN_ARGS, 0, NULL, &item))
- return;
+ attrs = CREATE_SEC_ATTRIBUTES(kSecMatchLimit, kSecMatchLimitAll,
+ kSecReturnRef, kCFBooleanTrue,
+ NULL);
+ result = SecItemCopyMatching(attrs, (CFTypeRef *)&refs);
+ CFRelease(attrs);
+
+ if (!result) {
+ for (CFIndex i = 0; !result && i < CFArrayGetCount(refs); i++)
+ result = delete_ref(CFArrayGetValueAtIndex(refs, i));
+
+ CFRelease(refs);
+ }
+
+ /* We consider not found to not be an error */
+ if (result == errSecItemNotFound)
+ result = errSecSuccess;
- SecKeychainItemDelete(item);
+ return result;
}
-static void add_internet_password(void)
+static OSStatus add_internet_password(void)
{
+ CFMutableDataRef data;
+ CFDictionaryRef attrs;
+ OSStatus result;
+
/* Only store complete credentials */
if (!protocol || !host || !username || !password)
- return;
+ return -1;
- if (SecKeychainAddInternetPassword(
- KEYCHAIN_ARGS,
- KEYCHAIN_ITEM(password),
- NULL))
- return;
+ data = CFDataCreateMutableCopy(kCFAllocatorDefault, 0, password);
+ if (password_expiry_utc) {
+ CFDataAppendBytes(data,
+ (const UInt8 *)STRING_WITH_LENGTH("\npassword_expiry_utc="));
+ CFDataAppendBytes(data,
+ CFDataGetBytePtr(password_expiry_utc),
+ CFDataGetLength(password_expiry_utc));
+ }
+ if (oauth_refresh_token) {
+ CFDataAppendBytes(data,
+ (const UInt8 *)STRING_WITH_LENGTH("\noauth_refresh_token="));
+ CFDataAppendBytes(data,
+ CFDataGetBytePtr(oauth_refresh_token),
+ CFDataGetLength(oauth_refresh_token));
+ }
+
+ attrs = CREATE_SEC_ATTRIBUTES(kSecValueData, data,
+ NULL);
+
+ result = SecItemAdd(attrs, NULL);
+ if (result == errSecDuplicateItem) {
+ CFDictionaryRef query;
+ query = CREATE_SEC_ATTRIBUTES(NULL);
+ result = SecItemUpdate(query, attrs);
+ CFRelease(query);
+ }
+
+ CFRelease(data);
+ CFRelease(attrs);
+
+ return result;
}
static void read_credential(void)
{
- char buf[1024];
+ char *buf = NULL;
+ size_t alloc;
+ ssize_t line_len;
- while (fgets(buf, sizeof(buf), stdin)) {
+ while ((line_len = getline(&buf, &alloc, stdin)) > 0) {
char *v;
if (!strcmp(buf, "\n"))
break;
- buf[strlen(buf)-1] = '\0';
+ buf[line_len-1] = '\0';
v = strchr(buf, '=');
if (!v)
@@ -129,41 +341,73 @@ static void read_credential(void)
if (!strcmp(buf, "protocol")) {
if (!strcmp(v, "imap"))
- protocol = kSecProtocolTypeIMAP;
+ protocol = kSecAttrProtocolIMAP;
else if (!strcmp(v, "imaps"))
- protocol = kSecProtocolTypeIMAPS;
+ protocol = kSecAttrProtocolIMAPS;
else if (!strcmp(v, "ftp"))
- protocol = kSecProtocolTypeFTP;
+ protocol = kSecAttrProtocolFTP;
else if (!strcmp(v, "ftps"))
- protocol = kSecProtocolTypeFTPS;
+ protocol = kSecAttrProtocolFTPS;
else if (!strcmp(v, "https"))
- protocol = kSecProtocolTypeHTTPS;
+ protocol = kSecAttrProtocolHTTPS;
else if (!strcmp(v, "http"))
- protocol = kSecProtocolTypeHTTP;
+ protocol = kSecAttrProtocolHTTP;
else if (!strcmp(v, "smtp"))
- protocol = kSecProtocolTypeSMTP;
- else /* we don't yet handle other protocols */
+ protocol = kSecAttrProtocolSMTP;
+ else {
+ /* we don't yet handle other protocols */
+ clear_credential();
exit(0);
+ }
}
else if (!strcmp(buf, "host")) {
char *colon = strchr(v, ':');
if (colon) {
+ UInt16 port_i;
*colon++ = '\0';
- port = atoi(colon);
+ port_i = atoi(colon);
+ port = CFNumberCreate(kCFAllocatorDefault,
+ kCFNumberShortType,
+ &port_i);
}
- host = xstrdup(v);
+ host = CFStringCreateWithCString(kCFAllocatorDefault,
+ v,
+ ENCODING);
}
else if (!strcmp(buf, "path"))
- path = xstrdup(v);
+ path = CFStringCreateWithCString(kCFAllocatorDefault,
+ v,
+ ENCODING);
else if (!strcmp(buf, "username"))
- username = xstrdup(v);
+ username = CFStringCreateWithCString(
+ kCFAllocatorDefault,
+ v,
+ ENCODING);
else if (!strcmp(buf, "password"))
- password = xstrdup(v);
+ password = CFDataCreate(kCFAllocatorDefault,
+ (UInt8 *)v,
+ strlen(v));
+ else if (!strcmp(buf, "password_expiry_utc"))
+ password_expiry_utc = CFDataCreate(kCFAllocatorDefault,
+ (UInt8 *)v,
+ strlen(v));
+ else if (!strcmp(buf, "oauth_refresh_token"))
+ oauth_refresh_token = CFDataCreate(kCFAllocatorDefault,
+ (UInt8 *)v,
+ strlen(v));
+ /*
+ * Ignore other lines; we don't know what they mean, but
+ * this future-proofs us when later versions of git do
+ * learn new lines, and the helpers are updated to match.
+ */
}
+
+ free(buf);
}
int main(int argc, const char **argv)
{
+ OSStatus result = 0;
const char *usage =
"usage: git credential-osxkeychain <get|store|erase>";
@@ -173,12 +417,17 @@ int main(int argc, const char **argv)
read_credential();
if (!strcmp(argv[1], "get"))
- find_internet_password();
+ result = find_internet_password();
else if (!strcmp(argv[1], "store"))
- add_internet_password();
+ result = add_internet_password();
else if (!strcmp(argv[1], "erase"))
- delete_internet_password();
+ result = delete_internet_password();
/* otherwise, ignore unknown action */
+ if (result)
+ die("failed to %s: %d", argv[1], (int)result);
+
+ clear_credential();
+
return 0;
}
diff --git a/contrib/credential/wincred/git-credential-wincred.c b/contrib/credential/wincred/git-credential-wincred.c
index 5091048..4be0d58 100644
--- a/contrib/credential/wincred/git-credential-wincred.c
+++ b/contrib/credential/wincred/git-credential-wincred.c
@@ -6,6 +6,7 @@
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
+#include <wincred.h>
/* common helpers */
@@ -33,65 +34,8 @@ static void *xmalloc(size_t size)
return ret;
}
-/* MinGW doesn't have wincred.h, so we need to define stuff */
-
-typedef struct _CREDENTIAL_ATTRIBUTEW {
- LPWSTR Keyword;
- DWORD Flags;
- DWORD ValueSize;
- LPBYTE Value;
-} CREDENTIAL_ATTRIBUTEW, *PCREDENTIAL_ATTRIBUTEW;
-
-typedef struct _CREDENTIALW {
- DWORD Flags;
- DWORD Type;
- LPWSTR TargetName;
- LPWSTR Comment;
- FILETIME LastWritten;
- DWORD CredentialBlobSize;
- LPBYTE CredentialBlob;
- DWORD Persist;
- DWORD AttributeCount;
- PCREDENTIAL_ATTRIBUTEW Attributes;
- LPWSTR TargetAlias;
- LPWSTR UserName;
-} CREDENTIALW, *PCREDENTIALW;
-
-#define CRED_TYPE_GENERIC 1
-#define CRED_PERSIST_LOCAL_MACHINE 2
-#define CRED_MAX_ATTRIBUTES 64
-
-typedef BOOL (WINAPI *CredWriteWT)(PCREDENTIALW, DWORD);
-typedef BOOL (WINAPI *CredEnumerateWT)(LPCWSTR, DWORD, DWORD *,
- PCREDENTIALW **);
-typedef VOID (WINAPI *CredFreeT)(PVOID);
-typedef BOOL (WINAPI *CredDeleteWT)(LPCWSTR, DWORD, DWORD);
-
-static HMODULE advapi;
-static CredWriteWT CredWriteW;
-static CredEnumerateWT CredEnumerateW;
-static CredFreeT CredFree;
-static CredDeleteWT CredDeleteW;
-
-static void load_cred_funcs(void)
-{
- /* load DLLs */
- advapi = LoadLibraryExA("advapi32.dll", NULL,
- LOAD_LIBRARY_SEARCH_SYSTEM32);
- if (!advapi)
- die("failed to load advapi32.dll");
-
- /* get function pointers */
- CredWriteW = (CredWriteWT)GetProcAddress(advapi, "CredWriteW");
- CredEnumerateW = (CredEnumerateWT)GetProcAddress(advapi,
- "CredEnumerateW");
- CredFree = (CredFreeT)GetProcAddress(advapi, "CredFree");
- CredDeleteW = (CredDeleteWT)GetProcAddress(advapi, "CredDeleteW");
- if (!CredWriteW || !CredEnumerateW || !CredFree || !CredDeleteW)
- die("failed to load functions");
-}
-
-static WCHAR *wusername, *password, *protocol, *host, *path, target[1024];
+static WCHAR *wusername, *password, *protocol, *host, *path, target[1024],
+ *password_expiry_utc, *oauth_refresh_token;
static void write_item(const char *what, LPCWSTR wbuf, int wlen)
{
@@ -165,7 +109,18 @@ static int match_part_last(LPCWSTR *ptarget, LPCWSTR want, LPCWSTR delim)
return match_part_with_last(ptarget, want, delim, 1);
}
-static int match_cred(const CREDENTIALW *cred)
+static int match_cred_password(const CREDENTIALW *cred) {
+ int ret;
+ WCHAR *cred_password = xmalloc(cred->CredentialBlobSize);
+ wcsncpy_s(cred_password, cred->CredentialBlobSize,
+ (LPCWSTR)cred->CredentialBlob,
+ cred->CredentialBlobSize / sizeof(WCHAR));
+ ret = !wcscmp(cred_password, password);
+ free(cred_password);
+ return ret;
+}
+
+static int match_cred(const CREDENTIALW *cred, int match_password)
{
LPCWSTR target = cred->TargetName;
if (wusername && wcscmp(wusername, cred->UserName ? cred->UserName : L""))
@@ -175,7 +130,8 @@ static int match_cred(const CREDENTIALW *cred)
match_part(&target, protocol, L"://") &&
match_part_last(&target, wusername, L"@") &&
match_part(&target, host, L"/") &&
- match_part(&target, path, L"");
+ match_part(&target, path, L"") &&
+ (!match_password || match_cred_password(cred));
}
static void get_credential(void)
@@ -183,18 +139,47 @@ static void get_credential(void)
CREDENTIALW **creds;
DWORD num_creds;
int i;
+ CREDENTIAL_ATTRIBUTEW *attr;
+ WCHAR *secret;
+ WCHAR *line;
+ WCHAR *remaining_lines;
+ WCHAR *part;
+ WCHAR *remaining_parts;
if (!CredEnumerateW(L"git:*", 0, &num_creds, &creds))
return;
/* search for the first credential that matches username */
for (i = 0; i < num_creds; ++i)
- if (match_cred(creds[i])) {
+ if (match_cred(creds[i], 0)) {
write_item("username", creds[i]->UserName,
creds[i]->UserName ? wcslen(creds[i]->UserName) : 0);
- write_item("password",
- (LPCWSTR)creds[i]->CredentialBlob,
- creds[i]->CredentialBlobSize / sizeof(WCHAR));
+ if (creds[i]->CredentialBlobSize > 0) {
+ secret = xmalloc(creds[i]->CredentialBlobSize);
+ wcsncpy_s(secret, creds[i]->CredentialBlobSize, (LPCWSTR)creds[i]->CredentialBlob, creds[i]->CredentialBlobSize / sizeof(WCHAR));
+ line = wcstok_s(secret, L"\r\n", &remaining_lines);
+ write_item("password", line, line ? wcslen(line) : 0);
+ while(line != NULL) {
+ part = wcstok_s(line, L"=", &remaining_parts);
+ if (!wcscmp(part, L"oauth_refresh_token")) {
+ write_item("oauth_refresh_token", remaining_parts, remaining_parts ? wcslen(remaining_parts) : 0);
+ }
+ line = wcstok_s(NULL, L"\r\n", &remaining_lines);
+ }
+ free(secret);
+ } else {
+ write_item("password",
+ (LPCWSTR)creds[i]->CredentialBlob,
+ creds[i]->CredentialBlobSize / sizeof(WCHAR));
+ }
+ for (int j = 0; j < creds[i]->AttributeCount; j++) {
+ attr = creds[i]->Attributes + j;
+ if (!wcscmp(attr->Keyword, L"git_password_expiry_utc")) {
+ write_item("password_expiry_utc", (LPCWSTR)attr->Value,
+ attr->ValueSize / sizeof(WCHAR));
+ break;
+ }
+ }
break;
}
@@ -204,22 +189,43 @@ static void get_credential(void)
static void store_credential(void)
{
CREDENTIALW cred;
+ CREDENTIAL_ATTRIBUTEW expiry_attr;
+ WCHAR *secret;
+ int wlen;
if (!wusername || !password)
return;
+ if (oauth_refresh_token) {
+ wlen = _scwprintf(L"%s\r\noauth_refresh_token=%s", password, oauth_refresh_token);
+ secret = xmalloc(sizeof(WCHAR) * wlen);
+ _snwprintf_s(secret, sizeof(WCHAR) * wlen, wlen, L"%s\r\noauth_refresh_token=%s", password, oauth_refresh_token);
+ } else {
+ secret = _wcsdup(password);
+ }
+
cred.Flags = 0;
cred.Type = CRED_TYPE_GENERIC;
cred.TargetName = target;
cred.Comment = L"saved by git-credential-wincred";
- cred.CredentialBlobSize = (wcslen(password)) * sizeof(WCHAR);
- cred.CredentialBlob = (LPVOID)password;
+ cred.CredentialBlobSize = wcslen(secret) * sizeof(WCHAR);
+ cred.CredentialBlob = (LPVOID)_wcsdup(secret);
cred.Persist = CRED_PERSIST_LOCAL_MACHINE;
cred.AttributeCount = 0;
cred.Attributes = NULL;
+ if (password_expiry_utc != NULL) {
+ expiry_attr.Keyword = L"git_password_expiry_utc";
+ expiry_attr.Value = (LPVOID)password_expiry_utc;
+ expiry_attr.ValueSize = (wcslen(password_expiry_utc)) * sizeof(WCHAR);
+ expiry_attr.Flags = 0;
+ cred.Attributes = &expiry_attr;
+ cred.AttributeCount = 1;
+ }
cred.TargetAlias = NULL;
cred.UserName = wusername;
+ free(secret);
+
if (!CredWriteW(&cred, 0))
die("CredWrite failed");
}
@@ -234,7 +240,7 @@ static void erase_credential(void)
return;
for (i = 0; i < num_creds; ++i) {
- if (match_cred(creds[i]))
+ if (match_cred(creds[i], password != NULL))
CredDeleteW(creds[i]->TargetName, creds[i]->Type, 0);
}
@@ -249,17 +255,28 @@ static WCHAR *utf8_to_utf16_dup(const char *str)
return wstr;
}
+#define KB (1024)
+
static void read_credential(void)
{
- char buf[1024];
+ size_t alloc = 100 * KB;
+ char *buf = calloc(alloc, sizeof(*buf));
- while (fgets(buf, sizeof(buf), stdin)) {
+ while (fgets(buf, alloc, stdin)) {
char *v;
- int len = strlen(buf);
+ size_t len = strlen(buf);
+ int ends_in_newline = 0;
/* strip trailing CR / LF */
- while (len && strchr("\r\n", buf[len - 1]))
+ if (len && buf[len - 1] == '\n') {
+ buf[--len] = 0;
+ ends_in_newline = 1;
+ }
+ if (len && buf[len - 1] == '\r')
buf[--len] = 0;
+ if (!ends_in_newline)
+ die("bad input: %s", buf);
+
if (!*buf)
break;
@@ -278,9 +295,18 @@ static void read_credential(void)
wusername = utf8_to_utf16_dup(v);
} else if (!strcmp(buf, "password"))
password = utf8_to_utf16_dup(v);
- else
- die("unrecognized input");
+ else if (!strcmp(buf, "password_expiry_utc"))
+ password_expiry_utc = utf8_to_utf16_dup(v);
+ else if (!strcmp(buf, "oauth_refresh_token"))
+ oauth_refresh_token = utf8_to_utf16_dup(v);
+ /*
+ * Ignore other lines; we don't know what they mean, but
+ * this future-proofs us when later versions of git do
+ * learn new lines, and the helpers are updated to match.
+ */
}
+
+ free(buf);
}
int main(int argc, char *argv[])
@@ -289,7 +315,7 @@ int main(int argc, char *argv[])
"usage: git credential-wincred <get|store|erase>\n";
if (!argv[1])
- die(usage);
+ die("%s", usage);
/* git use binary pipes to avoid CRLF-issues */
_setmode(_fileno(stdin), _O_BINARY);
@@ -297,8 +323,6 @@ int main(int argc, char *argv[])
read_credential();
- load_cred_funcs();
-
if (!protocol || !(host || path))
return 0;
diff --git a/contrib/diff-highlight/DiffHighlight.pm b/contrib/diff-highlight/DiffHighlight.pm
index 376f577..636add6 100644
--- a/contrib/diff-highlight/DiffHighlight.pm
+++ b/contrib/diff-highlight/DiffHighlight.pm
@@ -1,6 +1,6 @@
package DiffHighlight;
-use 5.008;
+use 5.008001;
use warnings FATAL => 'all';
use strict;
diff --git a/contrib/git-jump/README b/contrib/git-jump/README
index 8bcace2..3211841 100644
--- a/contrib/git-jump/README
+++ b/contrib/git-jump/README
@@ -79,6 +79,14 @@ git jump grep -i foo_bar
git config jump.grepCmd "ag --column"
--------------------------------------------------
+You can use the optional argument '--stdout' to print the listing to
+standard output instead of feeding it to the editor. You can use the
+argument with M-x grep on Emacs:
+
+--------------------------------------------------
+# In Emacs, M-x grep and invoke "git jump --stdout <mode>"
+M-x grep<RET>git jump --stdout diff<RET>
+--------------------------------------------------
Related Programs
----------------
@@ -100,7 +108,7 @@ Limitations
-----------
This script was written and tested with vim. Given that the quickfix
-format is the same as what gcc produces, I expect emacs users have a
+format is the same as what gcc produces, I expect other tools have a
similar feature for iterating through the list, but I know nothing about
how to activate it.
diff --git a/contrib/git-jump/git-jump b/contrib/git-jump/git-jump
index 92dbd4c..47e0c55 100755
--- a/contrib/git-jump/git-jump
+++ b/contrib/git-jump/git-jump
@@ -2,25 +2,43 @@
usage() {
cat <<\EOF
-usage: git jump <mode> [<args>]
+usage: git jump [--stdout] <mode> [<args>]
Jump to interesting elements in an editor.
The <mode> parameter is one of:
diff: elements are diff hunks. Arguments are given to diff.
-merge: elements are merge conflicts. Arguments are ignored.
+merge: elements are merge conflicts. Arguments are given to ls-files -u.
grep: elements are grep hits. Arguments are given to git grep or, if
configured, to the command in `jump.grepCmd`.
ws: elements are whitespace errors. Arguments are given to diff --check.
+
+If the optional argument `--stdout` is given, print the quickfix
+lines to standard output instead of feeding it to the editor.
EOF
}
open_editor() {
editor=`git var GIT_EDITOR`
- eval "$editor -q \$1"
+ case "$editor" in
+ *emacs*)
+ # Supported editor values are:
+ # - emacs
+ # - emacsclient
+ # - emacsclient -t
+ #
+ # Wait for completion of the asynchronously executed process
+ # to avoid race conditions in case of "emacsclient".
+ eval "$editor --eval \"(let ((buf (grep \\\"cat \$1\\\"))) (pop-to-buffer buf) (select-frame-set-input-focus (selected-frame)) (while (get-buffer-process buf) (sleep-for 0.1)))\""
+ ;;
+ *)
+ # assume anything else is vi-compatible
+ eval "$editor -q \$1"
+ ;;
+ esac
}
mode_diff() {
@@ -64,15 +82,36 @@ mode_ws() {
git diff --check "$@"
}
+use_stdout=
+while test $# -gt 0; do
+ case "$1" in
+ --stdout)
+ use_stdout=t
+ ;;
+ --*)
+ usage >&2
+ exit 1
+ ;;
+ *)
+ break
+ ;;
+ esac
+ shift
+done
if test $# -lt 1; then
usage >&2
exit 1
fi
mode=$1; shift
+type "mode_$mode" >/dev/null 2>&1 || { usage >&2; exit 1; }
+
+if test "$use_stdout" = "t"; then
+ "mode_$mode" "$@"
+ exit 0
+fi
trap 'rm -f "$tmp"' 0 1 2 3 15
tmp=`mktemp -t git-jump.XXXXXX` || exit 1
-type "mode_$mode" >/dev/null 2>&1 || { usage >&2; exit 1; }
"mode_$mode" "$@" >"$tmp"
test -s "$tmp" || exit 0
open_editor "$tmp"
diff --git a/contrib/hg-to-git/hg-to-git.py b/contrib/hg-to-git/hg-to-git.py
deleted file mode 100755
index 7eb1b24..0000000
--- a/contrib/hg-to-git/hg-to-git.py
+++ /dev/null
@@ -1,254 +0,0 @@
-#!/usr/bin/env python
-
-""" hg-to-git.py - A Mercurial to GIT converter
-
- Copyright (C)2007 Stelian Pop <stelian@popies.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
-"""
-
-import os, os.path, sys
-import tempfile, pickle, getopt
-import re
-
-if sys.hexversion < 0x02030000:
- # The behavior of the pickle module changed significantly in 2.3
- sys.stderr.write("hg-to-git.py: requires Python 2.3 or later.\n")
- sys.exit(1)
-
-# Maps hg version -> git version
-hgvers = {}
-# List of children for each hg revision
-hgchildren = {}
-# List of parents for each hg revision
-hgparents = {}
-# Current branch for each hg revision
-hgbranch = {}
-# Number of new changesets converted from hg
-hgnewcsets = 0
-
-#------------------------------------------------------------------------------
-
-def usage():
-
- print("""\
-%s: [OPTIONS] <hgprj>
-
-options:
- -s, --gitstate=FILE: name of the state to be saved/read
- for incrementals
- -n, --nrepack=INT: number of changesets that will trigger
- a repack (default=0, -1 to deactivate)
- -v, --verbose: be verbose
-
-required:
- hgprj: name of the HG project to import (directory)
-""" % sys.argv[0])
-
-#------------------------------------------------------------------------------
-
-def getgitenv(user, date):
- env = ''
- elems = re.compile('(.*?)\s+<(.*)>').match(user)
- if elems:
- env += 'export GIT_AUTHOR_NAME="%s" ;' % elems.group(1)
- env += 'export GIT_COMMITTER_NAME="%s" ;' % elems.group(1)
- env += 'export GIT_AUTHOR_EMAIL="%s" ;' % elems.group(2)
- env += 'export GIT_COMMITTER_EMAIL="%s" ;' % elems.group(2)
- else:
- env += 'export GIT_AUTHOR_NAME="%s" ;' % user
- env += 'export GIT_COMMITTER_NAME="%s" ;' % user
- env += 'export GIT_AUTHOR_EMAIL= ;'
- env += 'export GIT_COMMITTER_EMAIL= ;'
-
- env += 'export GIT_AUTHOR_DATE="%s" ;' % date
- env += 'export GIT_COMMITTER_DATE="%s" ;' % date
- return env
-
-#------------------------------------------------------------------------------
-
-state = ''
-opt_nrepack = 0
-verbose = False
-
-try:
- opts, args = getopt.getopt(sys.argv[1:], 's:t:n:v', ['gitstate=', 'tempdir=', 'nrepack=', 'verbose'])
- for o, a in opts:
- if o in ('-s', '--gitstate'):
- state = a
- state = os.path.abspath(state)
- if o in ('-n', '--nrepack'):
- opt_nrepack = int(a)
- if o in ('-v', '--verbose'):
- verbose = True
- if len(args) != 1:
- raise Exception('params')
-except:
- usage()
- sys.exit(1)
-
-hgprj = args[0]
-os.chdir(hgprj)
-
-if state:
- if os.path.exists(state):
- if verbose:
- print('State does exist, reading')
- f = open(state, 'r')
- hgvers = pickle.load(f)
- else:
- print('State does not exist, first run')
-
-sock = os.popen('hg tip --template "{rev}"')
-tip = sock.read()
-if sock.close():
- sys.exit(1)
-if verbose:
- print('tip is', tip)
-
-# Calculate the branches
-if verbose:
- print('analysing the branches...')
-hgchildren["0"] = ()
-hgparents["0"] = (None, None)
-hgbranch["0"] = "master"
-for cset in range(1, int(tip) + 1):
- hgchildren[str(cset)] = ()
- prnts = os.popen('hg log -r %d --template "{parents}"' % cset).read().strip().split(' ')
- prnts = map(lambda x: x[:x.find(':')], prnts)
- if prnts[0] != '':
- parent = prnts[0].strip()
- else:
- parent = str(cset - 1)
- hgchildren[parent] += ( str(cset), )
- if len(prnts) > 1:
- mparent = prnts[1].strip()
- hgchildren[mparent] += ( str(cset), )
- else:
- mparent = None
-
- hgparents[str(cset)] = (parent, mparent)
-
- if mparent:
- # For merge changesets, take either one, preferably the 'master' branch
- if hgbranch[mparent] == 'master':
- hgbranch[str(cset)] = 'master'
- else:
- hgbranch[str(cset)] = hgbranch[parent]
- else:
- # Normal changesets
- # For first children, take the parent branch, for the others create a new branch
- if hgchildren[parent][0] == str(cset):
- hgbranch[str(cset)] = hgbranch[parent]
- else:
- hgbranch[str(cset)] = "branch-" + str(cset)
-
-if "0" not in hgvers:
- print('creating repository')
- os.system('git init')
-
-# loop through every hg changeset
-for cset in range(int(tip) + 1):
-
- # incremental, already seen
- if str(cset) in hgvers:
- continue
- hgnewcsets += 1
-
- # get info
- log_data = os.popen('hg log -r %d --template "{tags}\n{date|date}\n{author}\n"' % cset).readlines()
- tag = log_data[0].strip()
- date = log_data[1].strip()
- user = log_data[2].strip()
- parent = hgparents[str(cset)][0]
- mparent = hgparents[str(cset)][1]
-
- #get comment
- (fdcomment, filecomment) = tempfile.mkstemp()
- csetcomment = os.popen('hg log -r %d --template "{desc}"' % cset).read().strip()
- os.write(fdcomment, csetcomment)
- os.close(fdcomment)
-
- print('-----------------------------------------')
- print('cset:', cset)
- print('branch:', hgbranch[str(cset)])
- print('user:', user)
- print('date:', date)
- print('comment:', csetcomment)
- if parent:
- print('parent:', parent)
- if mparent:
- print('mparent:', mparent)
- if tag:
- print('tag:', tag)
- print('-----------------------------------------')
-
- # checkout the parent if necessary
- if cset != 0:
- if hgbranch[str(cset)] == "branch-" + str(cset):
- print('creating new branch', hgbranch[str(cset)])
- os.system('git checkout -b %s %s' % (hgbranch[str(cset)], hgvers[parent]))
- else:
- print('checking out branch', hgbranch[str(cset)])
- os.system('git checkout %s' % hgbranch[str(cset)])
-
- # merge
- if mparent:
- if hgbranch[parent] == hgbranch[str(cset)]:
- otherbranch = hgbranch[mparent]
- else:
- otherbranch = hgbranch[parent]
- print('merging', otherbranch, 'into', hgbranch[str(cset)])
- os.system(getgitenv(user, date) + 'git merge --no-commit -s ours "" %s %s' % (hgbranch[str(cset)], otherbranch))
-
- # remove everything except .git and .hg directories
- os.system('find . \( -path "./.hg" -o -path "./.git" \) -prune -o ! -name "." -print | xargs rm -rf')
-
- # repopulate with checkouted files
- os.system('hg update -C %d' % cset)
-
- # add new files
- os.system('git ls-files -x .hg --others | git update-index --add --stdin')
- # delete removed files
- os.system('git ls-files -x .hg --deleted | git update-index --remove --stdin')
-
- # commit
- os.system(getgitenv(user, date) + 'git commit --allow-empty --allow-empty-message -a -F %s' % filecomment)
- os.unlink(filecomment)
-
- # tag
- if tag and tag != 'tip':
- os.system(getgitenv(user, date) + 'git tag %s' % tag)
-
- # delete branch if not used anymore...
- if mparent and len(hgchildren[str(cset)]):
- print("Deleting unused branch:", otherbranch)
- os.system('git branch -d %s' % otherbranch)
-
- # retrieve and record the version
- vvv = os.popen('git show --quiet --pretty=format:%H').read()
- print('record', cset, '->', vvv)
- hgvers[str(cset)] = vvv
-
-if hgnewcsets >= opt_nrepack and opt_nrepack != -1:
- os.system('git repack -a -d')
-
-# write the state for incrementals
-if state:
- if verbose:
- print('Writing state')
- f = open(state, 'w')
- pickle.dump(hgvers, f)
-
-# vim: et ts=8 sw=4 sts=4
diff --git a/contrib/hg-to-git/hg-to-git.txt b/contrib/hg-to-git/hg-to-git.txt
deleted file mode 100644
index 91f8fe6..0000000
--- a/contrib/hg-to-git/hg-to-git.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-hg-to-git.py is able to convert a Mercurial repository into a git one,
-and preserves the branches in the process (unlike tailor)
-
-hg-to-git.py can probably be greatly improved (it's a rather crude
-combination of shell and python) but it does already work quite well for
-me. Features:
- - supports incremental conversion
- (for keeping a git repo in sync with a hg one)
- - supports hg branches
- - converts hg tags
-
-Note that the git repository will be created 'in place' (at the same
-location as the source hg repo). You will have to manually remove the
-'.hg' directory after the conversion.
-
-Also note that the incremental conversion uses 'simple' hg changesets
-identifiers (ordinals, as opposed to SHA-1 ids), and since these ids
-are not stable across different repositories the hg-to-git.py state file
-is forever tied to one hg repository.
-
-Stelian Pop <stelian@popies.net>
diff --git a/contrib/mw-to-git/Git/Mediawiki.pm b/contrib/mw-to-git/Git/Mediawiki.pm
index 917d9e2..ff78112 100644
--- a/contrib/mw-to-git/Git/Mediawiki.pm
+++ b/contrib/mw-to-git/Git/Mediawiki.pm
@@ -1,6 +1,6 @@
package Git::Mediawiki;
-use 5.008;
+use 5.008001;
use strict;
use POSIX;
use Git;
diff --git a/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh b/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh
index 6187ec6..7139995 100755
--- a/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh
+++ b/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh
@@ -161,7 +161,7 @@ test_expect_success 'git push properly warns about insufficient permissions' '
git add foo.forbidden &&
git commit -m "add a file" &&
git push 2>actual &&
- test_i18ngrep "foo.forbidden is not a permitted file" actual
+ test_grep "foo.forbidden is not a permitted file" actual
)
'
diff --git a/contrib/scalar/.gitignore b/contrib/scalar/.gitignore
deleted file mode 100644
index ff3d47e..0000000
--- a/contrib/scalar/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/*.exe
-/scalar
diff --git a/contrib/scalar/Makefile b/contrib/scalar/Makefile
deleted file mode 100644
index 37f283f..0000000
--- a/contrib/scalar/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-# The default target of this Makefile is...
-all::
-
-# Import tree-wide shared Makefile behavior and libraries
-include ../../shared.mak
-
-include ../../config.mak.uname
--include ../../config.mak.autogen
--include ../../config.mak
-
-TARGETS = scalar$(X) scalar.o
-GITLIBS = ../../common-main.o ../../libgit.a ../../xdiff/lib.a
-
-all:: scalar$(X) ../../bin-wrappers/scalar
-
-$(GITLIBS):
- $(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) $(subst ../../,,$@)
-
-$(TARGETS): $(GITLIBS) scalar.c
- $(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) $(patsubst %,contrib/scalar/%,$@)
-
-clean:
- $(RM) $(TARGETS) ../../bin-wrappers/scalar
-
-../../bin-wrappers/scalar: ../../wrap-for-bin.sh Makefile
- @mkdir -p ../../bin-wrappers
- $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
- -e 's|@@BUILD_DIR@@|$(shell cd ../.. && pwd)|' \
- -e 's|@@PROG@@|contrib/scalar/scalar$(X)|' < $< > $@ && \
- chmod +x $@
-
-test: all
- $(MAKE) -C t
-
-.PHONY: $(GITLIBS) all clean test FORCE
diff --git a/contrib/scalar/README.md b/contrib/scalar/README.md
deleted file mode 100644
index 634b577..0000000
--- a/contrib/scalar/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-# Scalar - an opinionated repository management tool
-
-Scalar is an add-on to Git that helps users take advantage of advanced
-performance features in Git. Originally implemented in C# using .NET Core,
-based on the learnings from the VFS for Git project, most of the techniques
-developed by the Scalar project have been integrated into core Git already:
-
-* partial clone,
-* commit graphs,
-* multi-pack index,
-* sparse checkout (cone mode),
-* scheduled background maintenance,
-* etc
-
-This directory contains the remaining parts of Scalar that are not (yet) in
-core Git.
-
-## Roadmap
-
-The idea is to populate this directory via incremental patch series and
-eventually move to a top-level directory next to `gitk-git/` and to `git-gui/`. The
-current plan involves the following patch series:
-
-- `scalar-the-beginning`: The initial patch series which sets up
- `contrib/scalar/` and populates it with a minimal `scalar` command that
- demonstrates the fundamental ideas.
-
-- `scalar-c-and-C`: The `scalar` command learns about two options that can be
- specified before the command, `-c <key>=<value>` and `-C <directory>`.
-
-- `scalar-diagnose`: The `scalar` command is taught the `diagnose` subcommand.
-
-- `scalar-and-builtin-fsmonitor`: The built-in FSMonitor is enabled in `scalar
- register` and in `scalar clone`, for an enormous performance boost when
- working in large worktrees. This patch series necessarily depends on Jeff
- Hostetler's FSMonitor patch series to be integrated into Git.
-
-- `scalar-gentler-config-locking`: Scalar enlistments are registered in the
- user's Git config. This usually does not represent any problem because it is
- rare for a user to register an enlistment. However, in Scalar's functional
- tests, Scalar enlistments are created galore, and in parallel, which can lead
- to lock contention. This patch series works around that problem by re-trying
- to lock the config file in a gentle fashion.
-
-- `scalar-extra-docs`: Add some extensive documentation that has been written
- in the original Scalar project (all subject to discussion, of course).
-
-- `optionally-install-scalar`: Now that Scalar is feature (and documentation)
- complete and is verified in CI builds, let's offer to install it.
-
-- `move-scalar-to-toplevel`: Now that Scalar is complete, let's move it next to
- `gitk-git/` and to `git-gui/`, making it a top-level command.
-
-The following two patch series exist in Microsoft's fork of Git and are
-publicly available. There is no current plan to upstream them, not because I
-want to withhold these patches, but because I don't think the Git community is
-interested in these patches.
-
-There are some interesting ideas there, but the implementation is too specific
-to Azure Repos and/or VFS for Git to be of much help in general (and also: my
-colleagues tried to upstream some patches already and the enthusiasm for
-integrating things related to Azure Repos and VFS for Git can be summarized in
-very, very few words).
-
-These still exist mainly because the GVFS protocol is what Azure Repos has
-instead of partial clone, while Git is focused on improving partial clone:
-
-- `scalar-with-gvfs`: The primary purpose of this patch series is to support
- existing Scalar users whose repositories are hosted in Azure Repos (which
- does not support Git's partial clones, but supports its predecessor, the GVFS
- protocol, which is used by Scalar to emulate the partial clone).
-
- Since the GVFS protocol will never be supported by core Git, this patch
- series will remain in Microsoft's fork of Git.
-
-- `run-scalar-functional-tests`: The Scalar project developed a quite
- comprehensive set of integration tests (or, "Functional Tests"). They are the
- sole remaining part of the original C#-based Scalar project, and this patch
- adds a GitHub workflow that runs them all.
-
- Since the tests partially depend on features that are only provided in the
- `scalar-with-gvfs` patch series, this patch cannot be upstreamed.
diff --git a/contrib/scalar/t/Makefile b/contrib/scalar/t/Makefile
deleted file mode 100644
index 01e82e5..0000000
--- a/contrib/scalar/t/Makefile
+++ /dev/null
@@ -1,81 +0,0 @@
-# Import tree-wide shared Makefile behavior and libraries
-include ../../../shared.mak
-
-# Run scalar tests
-#
-# Copyright (c) 2005,2021 Junio C Hamano, Johannes Schindelin
-#
-
--include ../../../config.mak.autogen
--include ../../../config.mak
-
-SHELL_PATH ?= $(SHELL)
-PERL_PATH ?= /usr/bin/perl
-RM ?= rm -f
-PROVE ?= prove
-DEFAULT_TEST_TARGET ?= test
-TEST_LINT ?= test-lint
-
-ifdef TEST_OUTPUT_DIRECTORY
-TEST_RESULTS_DIRECTORY = $(TEST_OUTPUT_DIRECTORY)/test-results
-else
-TEST_RESULTS_DIRECTORY = ../../../t/test-results
-endif
-
-# Shell quote;
-SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
-PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
-TEST_RESULTS_DIRECTORY_SQ = $(subst ','\'',$(TEST_RESULTS_DIRECTORY))
-
-T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
-
-all: $(DEFAULT_TEST_TARGET)
-
-test: $(TEST_LINT)
- $(MAKE) aggregate-results-and-cleanup
-
-prove: $(TEST_LINT)
- @echo "*** prove ***"; GIT_CONFIG=.git/config $(PROVE) --exec '$(SHELL_PATH_SQ)' $(GIT_PROVE_OPTS) $(T) :: $(GIT_TEST_OPTS)
- $(MAKE) clean-except-prove-cache
-
-$(T):
- @echo "*** $@ ***"; GIT_CONFIG=.git/config '$(SHELL_PATH_SQ)' $@ $(GIT_TEST_OPTS)
-
-clean-except-prove-cache:
- $(RM) -r 'trash directory'.* '$(TEST_RESULTS_DIRECTORY_SQ)'
- $(RM) -r valgrind/bin
-
-clean: clean-except-prove-cache
- $(RM) .prove
-
-test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax
-
-test-lint-duplicates:
- @dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
- test -z "$$dups" || { \
- echo >&2 "duplicate test numbers:" $$dups; exit 1; }
-
-test-lint-executable:
- @bad=`for i in $(T); do test -x "$$i" || echo $$i; done` && \
- test -z "$$bad" || { \
- echo >&2 "non-executable tests:" $$bad; exit 1; }
-
-test-lint-shell-syntax:
- @'$(PERL_PATH_SQ)' ../../../t/check-non-portable-shell.pl $(T)
-
-aggregate-results-and-cleanup: $(T)
- $(MAKE) aggregate-results
- $(MAKE) clean
-
-aggregate-results:
- for f in '$(TEST_RESULTS_DIRECTORY_SQ)'/t*-*.counts; do \
- echo "$$f"; \
- done | '$(SHELL_PATH_SQ)' ../../../t/aggregate-results.sh
-
-valgrind:
- $(MAKE) GIT_TEST_OPTS="$(GIT_TEST_OPTS) --valgrind"
-
-test-results:
- mkdir -p test-results
-
-.PHONY: $(T) aggregate-results clean valgrind
diff --git a/contrib/scalar/t/t9099-scalar.sh b/contrib/scalar/t/t9099-scalar.sh
deleted file mode 100755
index 10b1172..0000000
--- a/contrib/scalar/t/t9099-scalar.sh
+++ /dev/null
@@ -1,123 +0,0 @@
-#!/bin/sh
-
-test_description='test the `scalar` command'
-
-TEST_DIRECTORY=$PWD/../../../t
-export TEST_DIRECTORY
-
-# Make it work with --no-bin-wrappers
-PATH=$PWD/..:$PATH
-
-. ../../../t/test-lib.sh
-
-GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab ../cron.txt,launchctl:true,schtasks:true"
-export GIT_TEST_MAINT_SCHEDULER
-
-test_expect_success 'scalar shows a usage' '
- test_expect_code 129 scalar -h
-'
-
-test_expect_success 'scalar unregister' '
- git init vanish/src &&
- scalar register vanish/src &&
- git config --get --global --fixed-value \
- maintenance.repo "$(pwd)/vanish/src" &&
- scalar list >scalar.repos &&
- grep -F "$(pwd)/vanish/src" scalar.repos &&
- rm -rf vanish/src/.git &&
- scalar unregister vanish &&
- test_must_fail git config --get --global --fixed-value \
- maintenance.repo "$(pwd)/vanish/src" &&
- scalar list >scalar.repos &&
- ! grep -F "$(pwd)/vanish/src" scalar.repos
-'
-
-test_expect_success 'set up repository to clone' '
- test_commit first &&
- test_commit second &&
- test_commit third &&
- git switch -c parallel first &&
- mkdir -p 1/2 &&
- test_commit 1/2/3 &&
- git config uploadPack.allowFilter true &&
- git config uploadPack.allowAnySHA1InWant true
-'
-
-test_expect_success 'scalar clone' '
- second=$(git rev-parse --verify second:second.t) &&
- scalar clone "file://$(pwd)" cloned --single-branch &&
- (
- cd cloned/src &&
-
- git config --get --global --fixed-value maintenance.repo \
- "$(pwd)" &&
-
- git for-each-ref --format="%(refname)" refs/remotes/origin/ >actual &&
- echo "refs/remotes/origin/parallel" >expect &&
- test_cmp expect actual &&
-
- test_path_is_missing 1/2 &&
- test_must_fail git rev-list --missing=print $second &&
- git rev-list $second &&
- git cat-file blob $second >actual &&
- echo "second" >expect &&
- test_cmp expect actual
- )
-'
-
-test_expect_success 'scalar reconfigure' '
- git init one/src &&
- scalar register one &&
- git -C one/src config core.preloadIndex false &&
- scalar reconfigure one &&
- test true = "$(git -C one/src config core.preloadIndex)" &&
- git -C one/src config core.preloadIndex false &&
- scalar reconfigure -a &&
- test true = "$(git -C one/src config core.preloadIndex)"
-'
-
-test_expect_success 'scalar delete without enlistment shows a usage' '
- test_expect_code 129 scalar delete
-'
-
-test_expect_success 'scalar delete with enlistment' '
- scalar delete cloned &&
- test_path_is_missing cloned
-'
-
-test_expect_success 'scalar supports -c/-C' '
- test_when_finished "scalar delete sub" &&
- git init sub &&
- scalar -C sub -c status.aheadBehind=bogus register &&
- test -z "$(git -C sub config --local status.aheadBehind)" &&
- test true = "$(git -C sub config core.preloadIndex)"
-'
-
-test_expect_success '`scalar [...] <dir>` errors out when dir is missing' '
- ! scalar run config cloned 2>err &&
- grep "cloned. does not exist" err
-'
-
-SQ="'"
-test_expect_success UNZIP 'scalar diagnose' '
- scalar clone "file://$(pwd)" cloned --single-branch &&
- git repack &&
- echo "$(pwd)/.git/objects/" >>cloned/src/.git/objects/info/alternates &&
- test_commit -C cloned/src loose &&
- scalar diagnose cloned >out 2>err &&
- grep "Available space" out &&
- sed -n "s/.*$SQ\\(.*\\.zip\\)$SQ.*/\\1/p" <err >zip_path &&
- zip_path=$(cat zip_path) &&
- test -n "$zip_path" &&
- unzip -v "$zip_path" &&
- folder=${zip_path%.zip} &&
- test_path_is_missing "$folder" &&
- unzip -p "$zip_path" diagnostics.log >out &&
- test_file_not_empty out &&
- unzip -p "$zip_path" packs-local.txt >out &&
- grep "$(pwd)/.git/objects" out &&
- unzip -p "$zip_path" objects-local.txt >out &&
- grep "^Total: [1-9]" out
-'
-
-test_done
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 1af1d96..5dab3f5 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -33,23 +33,31 @@ git subtree split --prefix=<prefix> [<commit>]
git subtree pull --prefix=<prefix> <repository> <ref>
git subtree push --prefix=<prefix> <repository> <refspec>
--
-h,help show the help
-q quiet
-d show debug messages
+h,help! show the help
+q,quiet! quiet
+d,debug! show debug messages
P,prefix= the name of the subdir to split out
options for 'split' (also: 'push')
annotate= add a prefix to commit message of new commits
-b,branch= create a new branch from the split subtree
+b,branch!= create a new branch from the split subtree
ignore-joins ignore prior --rejoin commits
onto= try connecting new tree to an existing one
rejoin merge the new branch back into HEAD
options for 'add' and 'merge' (also: 'pull', 'split --rejoin', and 'push --rejoin')
squash merge subtree changes as a single commit
-m,message= use the given message as the commit message for the merge commit
+m,message!= use the given message as the commit message for the merge commit
"
indent=0
+# Usage: say [MSG...]
+say () {
+ if test -z "$arg_quiet"
+ then
+ printf '%s\n' "$*"
+ fi
+}
+
# Usage: debug [MSG...]
debug () {
if test -n "$arg_debug"
@@ -60,7 +68,7 @@ debug () {
# Usage: progress [MSG...]
progress () {
- if test -z "$GIT_QUIET"
+ if test -z "$arg_quiet"
then
if test -z "$arg_debug"
then
@@ -90,10 +98,18 @@ progress () {
assert () {
if ! "$@"
then
- die "assertion failed: $*"
+ die "fatal: assertion failed: $*"
fi
}
+# Usage: die_incompatible_opt OPTION COMMAND
+die_incompatible_opt () {
+ assert test "$#" = 2
+ opt="$1"
+ arg_command="$2"
+ die "fatal: the '$opt' flag does not make sense with 'git subtree $arg_command'."
+}
+
main () {
if test $# -eq 0
then
@@ -139,13 +155,14 @@ main () {
allow_addmerge=$arg_split_rejoin
;;
*)
- die "Unknown command '$arg_command'"
+ die "fatal: unknown command '$arg_command'"
;;
esac
# Reset the arguments array for "real" flag parsing.
eval "$set_args"
# Begin "real" flag parsing.
+ arg_quiet=
arg_debug=
arg_prefix=
arg_split_branch=
@@ -161,22 +178,22 @@ main () {
case "$opt" in
-q)
- GIT_QUIET=1
+ arg_quiet=1
;;
-d)
arg_debug=1
;;
--annotate)
- test -n "$allow_split" || die "The '$opt' flag does not make sense with 'git subtree $arg_command'."
+ test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command"
arg_split_annotate="$1"
shift
;;
--no-annotate)
- test -n "$allow_split" || die "The '$opt' flag does not make sense with 'git subtree $arg_command'."
+ test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command"
arg_split_annotate=
;;
-b)
- test -n "$allow_split" || die "The '$opt' flag does not make sense with 'git subtree $arg_command'."
+ test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command"
arg_split_branch="$1"
shift
;;
@@ -185,7 +202,7 @@ main () {
shift
;;
-m)
- test -n "$allow_addmerge" || die "The '$opt' flag does not make sense with 'git subtree $arg_command'."
+ test -n "$allow_addmerge" || die_incompatible_opt "$opt" "$arg_command"
arg_addmerge_message="$1"
shift
;;
@@ -193,41 +210,41 @@ main () {
arg_prefix=
;;
--onto)
- test -n "$allow_split" || die "The '$opt' flag does not make sense with 'git subtree $arg_command'."
+ test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command"
arg_split_onto="$1"
shift
;;
--no-onto)
- test -n "$allow_split" || die "The '$opt' flag does not make sense with 'git subtree $arg_command'."
+ test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command"
arg_split_onto=
;;
--rejoin)
- test -n "$allow_split" || die "The '$opt' flag does not make sense with 'git subtree $arg_command'."
+ test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command"
;;
--no-rejoin)
- test -n "$allow_split" || die "The '$opt' flag does not make sense with 'git subtree $arg_command'."
+ test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command"
;;
--ignore-joins)
- test -n "$allow_split" || die "The '$opt' flag does not make sense with 'git subtree $arg_command'."
+ test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command"
arg_split_ignore_joins=1
;;
--no-ignore-joins)
- test -n "$allow_split" || die "The '$opt' flag does not make sense with 'git subtree $arg_command'."
+ test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command"
arg_split_ignore_joins=
;;
--squash)
- test -n "$allow_addmerge" || die "The '$opt' flag does not make sense with 'git subtree $arg_command'."
+ test -n "$allow_addmerge" || die_incompatible_opt "$opt" "$arg_command"
arg_addmerge_squash=1
;;
--no-squash)
- test -n "$allow_addmerge" || die "The '$opt' flag does not make sense with 'git subtree $arg_command'."
+ test -n "$allow_addmerge" || die_incompatible_opt "$opt" "$arg_command"
arg_addmerge_squash=
;;
--)
break
;;
*)
- die "Unexpected option: $opt"
+ die "fatal: unexpected option: $opt"
;;
esac
done
@@ -235,24 +252,24 @@ main () {
if test -z "$arg_prefix"
then
- die "You must provide the --prefix option."
+ die "fatal: you must provide the --prefix option."
fi
case "$arg_command" in
add)
test -e "$arg_prefix" &&
- die "prefix '$arg_prefix' already exists."
+ die "fatal: prefix '$arg_prefix' already exists."
;;
*)
test -e "$arg_prefix" ||
- die "'$arg_prefix' does not exist; use 'git subtree add'"
+ die "fatal: '$arg_prefix' does not exist; use 'git subtree add'"
;;
esac
dir="$(dirname "$arg_prefix/.")"
debug "command: {$arg_command}"
- debug "quiet: {$GIT_QUIET}"
+ debug "quiet: {$arg_quiet}"
debug "dir: {$dir}"
debug "opts: {$*}"
debug
@@ -265,11 +282,11 @@ cache_setup () {
assert test $# = 0
cachedir="$GIT_DIR/subtree-cache/$$"
rm -rf "$cachedir" ||
- die "Can't delete old cachedir: $cachedir"
+ die "fatal: can't delete old cachedir: $cachedir"
mkdir -p "$cachedir" ||
- die "Can't create new cachedir: $cachedir"
+ die "fatal: can't create new cachedir: $cachedir"
mkdir -p "$cachedir/notree" ||
- die "Can't create new cachedir: $cachedir/notree"
+ die "fatal: can't create new cachedir: $cachedir/notree"
debug "Using cachedir: $cachedir" >&2
}
@@ -325,7 +342,7 @@ cache_set () {
test "$oldrev" != "latest_new" &&
test -e "$cachedir/$oldrev"
then
- die "cache for $oldrev already exists!"
+ die "fatal: cache for $oldrev already exists!"
fi
echo "$newrev" >"$cachedir/$oldrev"
}
@@ -354,13 +371,49 @@ try_remove_previous () {
fi
}
-# Usage: find_latest_squash DIR
+# Usage: process_subtree_split_trailer SPLIT_HASH MAIN_HASH [REPOSITORY]
+process_subtree_split_trailer () {
+ assert test $# -ge 2
+ assert test $# -le 3
+ b="$1"
+ sq="$2"
+ repository=""
+ if test "$#" = 3
+ then
+ repository="$3"
+ fi
+ fail_msg="fatal: could not rev-parse split hash $b from commit $sq"
+ if ! sub="$(git rev-parse --verify --quiet "$b^{commit}")"
+ then
+ # if 'repository' was given, try to fetch the 'git-subtree-split' hash
+ # before 'rev-parse'-ing it again, as it might be a tag that we do not have locally
+ if test -n "${repository}"
+ then
+ git fetch "$repository" "$b"
+ sub="$(git rev-parse --verify --quiet "$b^{commit}")" ||
+ die "$fail_msg"
+ else
+ hint1=$(printf "hint: hash might be a tag, try fetching it from the subtree repository:")
+ hint2=$(printf "hint: git fetch <subtree-repository> $b")
+ fail_msg=$(printf "$fail_msg\n$hint1\n$hint2")
+ die "$fail_msg"
+ fi
+ fi
+}
+
+# Usage: find_latest_squash DIR [REPOSITORY]
find_latest_squash () {
- assert test $# = 1
- debug "Looking for latest squash ($dir)..."
+ assert test $# -ge 1
+ assert test $# -le 2
+ dir="$1"
+ repository=""
+ if test "$#" = 2
+ then
+ repository="$2"
+ fi
+ debug "Looking for latest squash (dir=$dir, repository=$repository)..."
local indent=$(($indent + 1))
- dir="$1"
sq=
main=
sub=
@@ -378,8 +431,7 @@ find_latest_squash () {
main="$b"
;;
git-subtree-split:)
- sub="$(git rev-parse "$b^{commit}")" ||
- die "could not rev-parse split hash $b from commit $sq"
+ process_subtree_split_trailer "$b" "$sq" "$repository"
;;
END)
if test -n "$sub"
@@ -403,14 +455,20 @@ find_latest_squash () {
done || exit $?
}
-# Usage: find_existing_splits DIR REV
+# Usage: find_existing_splits DIR REV [REPOSITORY]
find_existing_splits () {
- assert test $# = 2
+ assert test $# -ge 2
+ assert test $# -le 3
debug "Looking for prior splits..."
local indent=$(($indent + 1))
dir="$1"
rev="$2"
+ repository=""
+ if test "$#" = 3
+ then
+ repository="$3"
+ fi
main=
sub=
local grep_format="^git-subtree-dir: $dir/*\$"
@@ -430,18 +488,17 @@ find_existing_splits () {
main="$b"
;;
git-subtree-split:)
- sub="$(git rev-parse "$b^{commit}")" ||
- die "could not rev-parse split hash $b from commit $sq"
+ process_subtree_split_trailer "$b" "$sq" "$repository"
;;
END)
debug "Main is: '$main'"
- if test -z "$main" -a -n "$sub"
+ if test -z "$main" && test -n "$sub"
then
# squash commits refer to a subtree
debug " Squash: $sq from $sub"
cache_set "$sq" "$sub"
fi
- if test -n "$main" -a -n "$sub"
+ if test -n "$main" && test -n "$sub"
then
debug " Prior: $main -> $sub"
cache_set $main $sub
@@ -481,7 +538,7 @@ copy_commit () {
cat
) |
git commit-tree "$2" $3 # reads the rest of stdin
- ) || die "Can't copy commit $1"
+ ) || die "fatal: can't copy commit $1"
}
# Usage: add_msg DIR LATEST_OLD LATEST_NEW
@@ -584,10 +641,16 @@ subtree_for_commit () {
while read mode type tree name
do
assert test "$name" = "$dir"
- assert test "$type" = "tree" -o "$type" = "commit"
- test "$type" = "commit" && continue # ignore submodules
- echo $tree
- break
+
+ case "$type" in
+ commit)
+ continue;; # ignore submodules
+ tree)
+ echo $tree
+ break;;
+ *)
+ die "fatal: tree entry is of type ${type}, expected tree or commit";;
+ esac
done || exit $?
}
@@ -709,11 +772,11 @@ ensure_clean () {
assert test $# = 0
if ! git diff-index HEAD --exit-code --quiet 2>&1
then
- die "Working tree has modifications. Cannot add."
+ die "fatal: working tree has modifications. Cannot add."
fi
if ! git diff-index --cached HEAD --exit-code --quiet 2>&1
then
- die "Index has modifications. Cannot add."
+ die "fatal: index has modifications. Cannot add."
fi
}
@@ -721,7 +784,23 @@ ensure_clean () {
ensure_valid_ref_format () {
assert test $# = 1
git check-ref-format "refs/heads/$1" ||
- die "'$1' does not look like a ref"
+ die "fatal: '$1' does not look like a ref"
+}
+
+# Usage: check if a commit from another subtree should be
+# ignored from processing for splits
+should_ignore_subtree_split_commit () {
+ assert test $# = 1
+ local rev="$1"
+ if test -n "$(git log -1 --grep="git-subtree-dir:" $rev)"
+ then
+ if test -z "$(git log -1 --grep="git-subtree-mainline:" $rev)" &&
+ test -z "$(git log -1 --grep="git-subtree-dir: $arg_prefix$" $rev)"
+ then
+ return 0
+ fi
+ fi
+ return 1
}
# Usage: process_split_commit REV PARENTS
@@ -787,7 +866,7 @@ cmd_add () {
if test $# -eq 1
then
git rev-parse -q --verify "$1^{commit}" >/dev/null ||
- die "'$1' does not refer to a commit"
+ die "fatal: '$1' does not refer to a commit"
cmd_add_commit "$@"
@@ -802,7 +881,7 @@ cmd_add () {
cmd_add_repository "$@"
else
- say >&2 "error: parameters were '$*'"
+ say >&2 "fatal: parameters were '$*'"
die "Provide either a commit or a repository and commit."
fi
}
@@ -834,7 +913,7 @@ cmd_add_commit () {
git checkout -- "$dir" || exit $?
tree=$(git write-tree) || exit $?
- headrev=$(git rev-parse HEAD) || exit $?
+ headrev=$(git rev-parse --verify HEAD) || exit $?
if test -n "$headrev" && test "$headrev" != "$rev"
then
headp="-p $headrev"
@@ -857,17 +936,22 @@ cmd_add_commit () {
say >&2 "Added dir '$dir'"
}
-# Usage: cmd_split [REV]
+# Usage: cmd_split [REV] [REPOSITORY]
cmd_split () {
if test $# -eq 0
then
rev=$(git rev-parse HEAD)
- elif test $# -eq 1
+ elif test $# -eq 1 || test $# -eq 2
then
rev=$(git rev-parse -q --verify "$1^{commit}") ||
- die "'$1' does not refer to a commit"
+ die "fatal: '$1' does not refer to a commit"
else
- die "You must provide exactly one revision. Got: '$*'"
+ die "fatal: you must provide exactly one revision, and optionnally a repository. Got: '$*'"
+ fi
+ repository=""
+ if test "$#" = 2
+ then
+ repository="$2"
fi
if test -n "$arg_split_rejoin"
@@ -891,7 +975,7 @@ cmd_split () {
done || exit $?
fi
- unrevs="$(find_existing_splits "$dir" "$rev")" || exit $?
+ unrevs="$(find_existing_splits "$dir" "$rev" "$repository")" || exit $?
# We can't restrict rev-list to only $dir here, because some of our
# parents have the $dir contents the root, and those won't match.
@@ -904,13 +988,25 @@ cmd_split () {
eval "$grl" |
while read rev parents
do
- process_split_commit "$rev" "$parents"
+ if should_ignore_subtree_split_commit "$rev"
+ then
+ continue
+ fi
+ parsedparents=''
+ for parent in $parents
+ do
+ if ! should_ignore_subtree_split_commit "$parent"
+ then
+ parsedparents="$parsedparents$parent "
+ fi
+ done
+ process_split_commit "$rev" "$parsedparents"
done || exit $?
latest_new=$(cache_get latest_new) || exit $?
if test -z "$latest_new"
then
- die "No new revisions were found"
+ die "fatal: no new revisions were found"
fi
if test -n "$arg_split_rejoin"
@@ -931,7 +1027,7 @@ cmd_split () {
then
if ! git merge-base --is-ancestor "$arg_split_branch" "$latest_new"
then
- die "Branch '$arg_split_branch' is not an ancestor of commit '$latest_new'."
+ die "fatal: branch '$arg_split_branch' is not an ancestor of commit '$latest_new'."
fi
action='Updated'
else
@@ -945,20 +1041,28 @@ cmd_split () {
exit 0
}
-# Usage: cmd_merge REV
+# Usage: cmd_merge REV [REPOSITORY]
cmd_merge () {
- test $# -eq 1 ||
- die "You must provide exactly one revision. Got: '$*'"
+ if test $# -lt 1 || test $# -gt 2
+ then
+ die "fatal: you must provide exactly one revision, and optionally a repository. Got: '$*'"
+ fi
+
rev=$(git rev-parse -q --verify "$1^{commit}") ||
- die "'$1' does not refer to a commit"
+ die "fatal: '$1' does not refer to a commit"
+ repository=""
+ if test "$#" = 2
+ then
+ repository="$2"
+ fi
ensure_clean
if test -n "$arg_addmerge_squash"
then
- first_split="$(find_latest_squash "$dir")" || exit $?
+ first_split="$(find_latest_squash "$dir" "$repository")" || exit $?
if test -z "$first_split"
then
- die "Can't squash-merge: '$dir' was never added."
+ die "fatal: can't squash-merge: '$dir' was never added."
fi
set $first_split
old=$1
@@ -986,19 +1090,21 @@ cmd_merge () {
cmd_pull () {
if test $# -ne 2
then
- die "You must provide <repository> <ref>"
+ die "fatal: you must provide <repository> <ref>"
fi
+ repository="$1"
+ ref="$2"
ensure_clean
- ensure_valid_ref_format "$2"
- git fetch "$@" || exit $?
- cmd_merge FETCH_HEAD
+ ensure_valid_ref_format "$ref"
+ git fetch "$repository" "$ref" || exit $?
+ cmd_merge FETCH_HEAD "$repository"
}
# Usage: cmd_push REPOSITORY [+][LOCALREV:]REMOTEREF
cmd_push () {
if test $# -ne 2
then
- die "You must provide <repository> <refspec>"
+ die "fatal: you must provide <repository> <refspec>"
fi
if test -e "$dir"
then
@@ -1013,13 +1119,13 @@ cmd_push () {
fi
ensure_valid_ref_format "$remoteref"
localrev_presplit=$(git rev-parse -q --verify "$localrevname_presplit^{commit}") ||
- die "'$localrevname_presplit' does not refer to a commit"
+ die "fatal: '$localrevname_presplit' does not refer to a commit"
echo "git push using: " "$repository" "$refspec"
- localrev=$(cmd_split "$localrev_presplit") || die
+ localrev=$(cmd_split "$localrev_presplit" "$repository") || die
git push "$repository" "$localrev":"refs/heads/$remoteref"
else
- die "'$dir' must already exist. Try 'git subtree add'."
+ die "fatal: '$dir' must already exist. Try 'git subtree add'."
fi
}
diff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt
index 9cddfa2..004abf4 100644
--- a/contrib/subtree/git-subtree.txt
+++ b/contrib/subtree/git-subtree.txt
@@ -11,7 +11,7 @@ SYNOPSIS
[verse]
'git subtree' [<options>] -P <prefix> add <local-commit>
'git subtree' [<options>] -P <prefix> add <repository> <remote-ref>
-'git subtree' [<options>] -P <prefix> merge <local-commit>
+'git subtree' [<options>] -P <prefix> merge <local-commit> [<repository>]
'git subtree' [<options>] -P <prefix> split [<local-commit>]
[verse]
@@ -76,7 +76,7 @@ add <repository> <remote-ref>::
only a single commit from the subproject, rather than its
entire history.
-merge <local-commit>::
+merge <local-commit> [<repository>]::
Merge recent changes up to <local-commit> into the <prefix>
subtree. As with normal 'git merge', this doesn't
remove your own local changes; it just merges those
@@ -88,8 +88,13 @@ If you use '--squash', the merge direction doesn't always have to be
forward; you can use this command to go back in time from v2.5 to v2.4,
for example. If your merge introduces a conflict, you can resolve it in
the usual ways.
++
+When using '--squash', and the previous merge with '--squash' merged an
+annotated tag of the subtree repository, that tag needs to be available locally.
+If <repository> is given, a missing tag will automatically be fetched from that
+repository.
-split [<local-commit>]::
+split [<local-commit>] [<repository>]::
Extract a new, synthetic project history from the
history of the <prefix> subtree of <local-commit>, or of
HEAD if no <local-commit> is given. The new history
@@ -109,6 +114,11 @@ settings passed to 'split' (such as '--annotate') are the same.
Because of this, if you add new commits and then re-split, the new
commits will be attached as commits on top of the history you
generated last time, so 'git merge' and friends will work as expected.
++
+When a previous merge with '--squash' merged an annotated tag of the
+subtree repository, that tag needs to be available locally.
+If <repository> is given, a missing tag will automatically be fetched from that
+repository.
pull <repository> <remote-ref>::
Exactly like 'merge', but parallels 'git pull' in that
diff --git a/contrib/subtree/t/Makefile b/contrib/subtree/t/Makefile
index 276898e..093399c 100644
--- a/contrib/subtree/t/Makefile
+++ b/contrib/subtree/t/Makefile
@@ -47,10 +47,11 @@ pre-clean:
$(RM) -r '$(TEST_RESULTS_DIRECTORY_SQ)'
clean-except-prove-cache:
- $(RM) -r 'trash directory'.* '$(TEST_RESULTS_DIRECTORY_SQ)'
+ $(RM) -r 'trash directory'.*
$(RM) -r valgrind/bin
clean: clean-except-prove-cache
+ $(RM) -r '$(TEST_RESULTS_DIRECTORY_SQ)'
$(RM) .prove
test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax
@@ -73,9 +74,7 @@ aggregate-results-and-cleanup: $(T)
$(MAKE) clean
aggregate-results:
- for f in '$(TEST_RESULTS_DIRECTORY_SQ)'/t*-*.counts; do \
- echo "$$f"; \
- done | '$(SHELL_PATH_SQ)' ../../../t/aggregate-results.sh
+ @'$(SHELL_PATH_SQ)' ../../../t/aggregate-results.sh '$(TEST_RESULTS_DIRECTORY_SQ)'
valgrind:
$(MAKE) GIT_TEST_OPTS="$(GIT_TEST_OPTS) --valgrind"
diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh
index 1c1f76f..c3bd2a5 100755
--- a/contrib/subtree/t/t7900-subtree.sh
+++ b/contrib/subtree/t/t7900-subtree.sh
@@ -43,11 +43,35 @@ last_commit_subject () {
git log --pretty=format:%s -1
}
+# Upon 'git subtree add|merge --squash' of an annotated tag,
+# pre-2.32.0 versions of 'git subtree' would write the hash of the tag
+# (sub1 below), instead of the commit (sub1^{commit}) in the
+# "git-subtree-split" trailer.
+# We immitate this behaviour below using a replace ref.
+# This function creates 3 repositories:
+# - $1
+# - $1-sub (added as subtree "sub" in $1)
+# - $1-clone (clone of $1)
+test_create_pre2_32_repo () {
+ subtree_test_create_repo "$1" &&
+ subtree_test_create_repo "$1-sub" &&
+ test_commit -C "$1" main1 &&
+ test_commit -C "$1-sub" --annotate sub1 &&
+ git -C "$1" subtree add --prefix="sub" --squash "../$1-sub" sub1 &&
+ tag=$(git -C "$1" rev-parse FETCH_HEAD) &&
+ commit=$(git -C "$1" rev-parse FETCH_HEAD^{commit}) &&
+ git -C "$1" log -1 --format=%B HEAD^2 >msg &&
+ test_commit -C "$1-sub" --annotate sub2 &&
+ git clone --no-local "$1" "$1-clone" &&
+ new_commit=$(sed -e "s/$commit/$tag/" msg | git -C "$1-clone" commit-tree HEAD^2^{tree}) &&
+ git -C "$1-clone" replace HEAD^2 $new_commit
+}
+
test_expect_success 'shows short help text for -h' '
test_expect_code 129 git subtree -h >out 2>err &&
test_must_be_empty err &&
grep -e "^ *or: git subtree pull" out &&
- grep -e --annotate out
+ grep -F -e "--[no-]annotate" out
'
#
@@ -264,6 +288,13 @@ test_expect_success 'merge new subproj history into subdir/ with a slash appende
)
'
+test_expect_success 'merge with --squash after annotated tag was added/merged with --squash pre-v2.32.0 ' '
+ test_create_pre2_32_repo "$test_count" &&
+ git -C "$test_count-clone" fetch "../$test_count-sub" sub2 &&
+ test_must_fail git -C "$test_count-clone" subtree merge --prefix="sub" --squash FETCH_HEAD &&
+ git -C "$test_count-clone" subtree merge --prefix="sub" --squash FETCH_HEAD "../$test_count-sub"
+'
+
#
# Tests for 'git subtree split'
#
@@ -277,7 +308,7 @@ test_expect_success 'split requires option --prefix' '
cd "$test_count" &&
git fetch ./"sub proj" HEAD &&
git subtree add --prefix="sub dir" FETCH_HEAD &&
- echo "You must provide the --prefix option." >expected &&
+ echo "fatal: you must provide the --prefix option." >expected &&
test_must_fail git subtree split >actual 2>&1 &&
test_debug "printf '"expected: "'" &&
test_debug "cat expected" &&
@@ -296,7 +327,7 @@ test_expect_success 'split requires path given by option --prefix must exist' '
cd "$test_count" &&
git fetch ./"sub proj" HEAD &&
git subtree add --prefix="sub dir" FETCH_HEAD &&
- echo "'\''non-existent-directory'\'' does not exist; use '\''git subtree add'\''" >expected &&
+ echo "fatal: '\''non-existent-directory'\'' does not exist; use '\''git subtree add'\''" >expected &&
test_must_fail git subtree split --prefix=non-existent-directory >actual 2>&1 &&
test_debug "printf '"expected: "'" &&
test_debug "cat expected" &&
@@ -354,6 +385,46 @@ test_expect_success 'split sub dir/ with --rejoin' '
)
'
+# Tests that commits from other subtrees are not processed as
+# part of a split.
+#
+# This test performs the following:
+# - Creates Repo with subtrees 'subA' and 'subB'
+# - Creates commits in the repo including changes to subtrees
+# - Runs the following 'split' and commit' commands in order:
+# - Perform 'split' on subtree A
+# - Perform 'split' on subtree B
+# - Create new commits with changes to subtree A and B
+# - Perform split on subtree A
+# - Check that the commits in subtree B are not processed
+# as part of the subtree A split
+test_expect_success 'split with multiple subtrees' '
+ subtree_test_create_repo "$test_count" &&
+ subtree_test_create_repo "$test_count/subA" &&
+ subtree_test_create_repo "$test_count/subB" &&
+ test_create_commit "$test_count" main1 &&
+ test_create_commit "$test_count/subA" subA1 &&
+ test_create_commit "$test_count/subA" subA2 &&
+ test_create_commit "$test_count/subA" subA3 &&
+ test_create_commit "$test_count/subB" subB1 &&
+ git -C "$test_count" fetch ./subA HEAD &&
+ git -C "$test_count" subtree add --prefix=subADir FETCH_HEAD &&
+ git -C "$test_count" fetch ./subB HEAD &&
+ git -C "$test_count" subtree add --prefix=subBDir FETCH_HEAD &&
+ test_create_commit "$test_count" subADir/main-subA1 &&
+ test_create_commit "$test_count" subBDir/main-subB1 &&
+ git -C "$test_count" subtree split --prefix=subADir \
+ --squash --rejoin -m "Sub A Split 1" &&
+ git -C "$test_count" subtree split --prefix=subBDir \
+ --squash --rejoin -m "Sub B Split 1" &&
+ test_create_commit "$test_count" subADir/main-subA2 &&
+ test_create_commit "$test_count" subBDir/main-subB2 &&
+ git -C "$test_count" subtree split --prefix=subADir \
+ --squash --rejoin -m "Sub A Split 2" &&
+ test "$(git -C "$test_count" subtree split --prefix=subBDir \
+ --squash --rejoin -d -m "Sub B Split 1" 2>&1 | grep -w "\[1\]")" = ""
+'
+
test_expect_success 'split sub dir/ with --rejoin from scratch' '
subtree_test_create_repo "$test_count" &&
test_create_commit "$test_count" main1 &&
@@ -551,6 +622,12 @@ test_expect_success 'split "sub dir"/ with --branch for an incompatible branch'
)
'
+test_expect_success 'split after annotated tag was added/merged with --squash pre-v2.32.0' '
+ test_create_pre2_32_repo "$test_count" &&
+ test_must_fail git -C "$test_count-clone" subtree split --prefix="sub" HEAD &&
+ git -C "$test_count-clone" subtree split --prefix="sub" HEAD "../$test_count-sub"
+'
+
#
# Tests for 'git subtree pull'
#
@@ -570,7 +647,7 @@ test_expect_success 'pull requires option --prefix' '
cd "$test_count" &&
test_must_fail git subtree pull ./"sub proj" HEAD >out 2>err &&
- echo "You must provide the --prefix option." >expected &&
+ echo "fatal: you must provide the --prefix option." >expected &&
test_must_be_empty out &&
test_cmp expected err
)
@@ -584,7 +661,7 @@ test_expect_success 'pull requires path given by option --prefix must exist' '
(
test_must_fail git subtree pull --prefix="sub dir" ./"sub proj" HEAD >out 2>err &&
- echo "'\''sub dir'\'' does not exist; use '\''git subtree add'\''" >expected &&
+ echo "fatal: '\''sub dir'\'' does not exist; use '\''git subtree add'\''" >expected &&
test_must_be_empty out &&
test_cmp expected err
)
@@ -630,6 +707,11 @@ test_expect_success 'pull rejects flags for split' '
)
'
+test_expect_success 'pull with --squash after annotated tag was added/merged with --squash pre-v2.32.0 ' '
+ test_create_pre2_32_repo "$test_count" &&
+ git -C "$test_count-clone" subtree -d pull --prefix="sub" --squash "../$test_count-sub" sub2
+'
+
#
# Tests for 'git subtree push'
#
@@ -643,7 +725,7 @@ test_expect_success 'push requires option --prefix' '
cd "$test_count" &&
git fetch ./"sub proj" HEAD &&
git subtree add --prefix="sub dir" FETCH_HEAD &&
- echo "You must provide the --prefix option." >expected &&
+ echo "fatal: you must provide the --prefix option." >expected &&
test_must_fail git subtree push "./sub proj" from-mainline >actual 2>&1 &&
test_debug "printf '"expected: "'" &&
test_debug "cat expected" &&
@@ -662,7 +744,7 @@ test_expect_success 'push requires path given by option --prefix must exist' '
cd "$test_count" &&
git fetch ./"sub proj" HEAD &&
git subtree add --prefix="sub dir" FETCH_HEAD &&
- echo "'\''non-existent-directory'\'' does not exist; use '\''git subtree add'\''" >expected &&
+ echo "fatal: '\''non-existent-directory'\'' does not exist; use '\''git subtree add'\''" >expected &&
test_must_fail git subtree push --prefix=non-existent-directory "./sub proj" from-mainline >actual 2>&1 &&
test_debug "printf '"expected: "'" &&
test_debug "cat expected" &&
@@ -953,6 +1035,12 @@ test_expect_success 'push "sub dir"/ with a local rev' '
)
'
+test_expect_success 'push after annotated tag was added/merged with --squash pre-v2.32.0' '
+ test_create_pre2_32_repo "$test_count" &&
+ test_create_commit "$test_count-clone" sub/main-sub1 &&
+ git -C "$test_count-clone" subtree push --prefix="sub" "../$test_count-sub" from-mainline
+'
+
#
# Validity checking
#
diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh
index 521d303..f2d61bb 100755
--- a/contrib/vscode/init.sh
+++ b/contrib/vscode/init.sh
@@ -92,7 +92,6 @@ cat >.vscode/settings.json.new <<\EOF ||
"isexe",
"iskeychar",
"kompare",
- "mksnpath",
"mktag",
"mktree",
"mmblob",
diff --git a/contrib/workdir/git-new-workdir b/contrib/workdir/git-new-workdir
index 888c34a..989197a 100755
--- a/contrib/workdir/git-new-workdir
+++ b/contrib/workdir/git-new-workdir
@@ -79,7 +79,7 @@ trap cleanup $siglist
# create the links to the original repo. explicitly exclude index, HEAD and
# logs/HEAD from the list since they are purely related to the current working
# directory, and should not be shared.
-for x in config refs logs/refs objects info hooks packed-refs remotes rr-cache svn
+for x in config refs logs/refs objects info hooks packed-refs remotes rr-cache svn reftable
do
# create a containing directory if needed
case $x in
diff --git a/convert.c b/convert.c
index 4d15372..35b25eb 100644
--- a/convert.c
+++ b/convert.c
@@ -1,14 +1,21 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "advice.h"
#include "config.h"
-#include "object-store.h"
+#include "convert.h"
+#include "copy.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-store-ll.h"
#include "attr.h"
#include "run-command.h"
#include "quote.h"
+#include "read-cache-ll.h"
#include "sigchain.h"
#include "pkt-line.h"
#include "sub-process.h"
+#include "trace.h"
#include "utf8.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
/*
* convert.c - convert a file when checking it out and checking it in.
@@ -619,30 +626,28 @@ struct filter_params {
const char *path;
};
-static int filter_buffer_or_fd(int in, int out, void *data)
+static int filter_buffer_or_fd(int in UNUSED, int out, void *data)
{
/*
* Spawn cmd and feed the buffer contents through its stdin.
*/
struct child_process child_process = CHILD_PROCESS_INIT;
struct filter_params *params = (struct filter_params *)data;
+ const char *format = params->cmd;
int write_err, status;
/* apply % substitution to cmd */
struct strbuf cmd = STRBUF_INIT;
- struct strbuf path = STRBUF_INIT;
- struct strbuf_expand_dict_entry dict[] = {
- { "f", NULL, },
- { NULL, NULL, },
- };
-
- /* quote the path to preserve spaces, etc. */
- sq_quote_buf(&path, params->path);
- dict[0].value = path.buf;
- /* expand all %f with the quoted path */
- strbuf_expand(&cmd, params->cmd, strbuf_expand_dict_cb, &dict);
- strbuf_release(&path);
+ /* expand all %f with the quoted path; quote to preserve space, etc. */
+ while (strbuf_expand_step(&cmd, &format)) {
+ if (skip_prefix(format, "%", &format))
+ strbuf_addch(&cmd, '%');
+ else if (skip_prefix(format, "f", &format))
+ sq_quote_buf(&cmd, params->path);
+ else
+ strbuf_addch(&cmd, '%');
+ }
strvec_push(&child_process.args, cmd.buf);
child_process.use_shell = 1;
@@ -1008,7 +1013,9 @@ static int apply_filter(const char *path, const char *src, size_t len,
return 0;
}
-static int read_convert_config(const char *var, const char *value, void *cb)
+static int read_convert_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *cb UNUSED)
{
const char *key, *name;
size_t namelen;
@@ -1021,7 +1028,7 @@ static int read_convert_config(const char *var, const char *value, void *cb)
if (parse_config_key(var, "filter", &name, &namelen, &key) < 0 || !name)
return 0;
for (drv = user_convert; drv; drv = drv->next)
- if (!strncmp(drv->name, name, namelen) && !drv->name[namelen])
+ if (!xstrncmpz(drv->name, name, namelen))
break;
if (!drv) {
CALLOC_ARRAY(drv, 1);
@@ -1549,7 +1556,7 @@ struct stream_filter {
struct stream_filter_vtbl *vtbl;
};
-static int null_filter_fn(struct stream_filter *filter,
+static int null_filter_fn(struct stream_filter *filter UNUSED,
const char *input, size_t *isize_p,
char *output, size_t *osize_p)
{
@@ -1568,7 +1575,7 @@ static int null_filter_fn(struct stream_filter *filter,
return 0;
}
-static void null_free_fn(struct stream_filter *filter)
+static void null_free_fn(struct stream_filter *filter UNUSED)
{
; /* nothing -- null instances are shared */
}
diff --git a/convert.h b/convert.h
index 0a6e408..ab8b4fa 100644
--- a/convert.h
+++ b/convert.h
@@ -4,7 +4,7 @@
#ifndef CONVERT_H
#define CONVERT_H
-#include "hash.h"
+#include "hash-ll.h"
#include "string-list.h"
struct index_state;
@@ -92,7 +92,7 @@ void convert_attrs(struct index_state *istate,
struct conv_attrs *ca, const char *path);
extern enum eol core_eol;
-extern char *check_roundtrip_encoding;
+extern const char *check_roundtrip_encoding;
const char *get_cached_convert_stats_ascii(struct index_state *istate,
const char *path);
const char *get_wt_convert_stats_ascii(const char *path);
diff --git a/copy.c b/copy.c
index 4de6a11..23d84c6 100644
--- a/copy.c
+++ b/copy.c
@@ -1,4 +1,6 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "copy.h"
+#include "path.h"
int copy_fd(int ifd, int ofd)
{
diff --git a/copy.h b/copy.h
new file mode 100644
index 0000000..2af77cb
--- /dev/null
+++ b/copy.h
@@ -0,0 +1,10 @@
+#ifndef COPY_H
+#define COPY_H
+
+#define COPY_READ_ERROR (-2)
+#define COPY_WRITE_ERROR (-3)
+int copy_fd(int ifd, int ofd);
+int copy_file(const char *dst, const char *src, int mode);
+int copy_file_with_time(const char *dst, const char *src, int mode);
+
+#endif /* COPY_H */
diff --git a/credential.c b/credential.c
index f6389a5..18098bd 100644
--- a/credential.c
+++ b/credential.c
@@ -1,12 +1,16 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
#include "config.h"
#include "credential.h"
+#include "gettext.h"
#include "string-list.h"
#include "run-command.h"
#include "url.h"
#include "prompt.h"
#include "sigchain.h"
+#include "strbuf.h"
#include "urlmatch.h"
+#include "git-compat-util.h"
void credential_init(struct credential *c)
{
@@ -21,19 +25,22 @@ void credential_clear(struct credential *c)
free(c->path);
free(c->username);
free(c->password);
+ free(c->oauth_refresh_token);
string_list_clear(&c->helpers, 0);
+ strvec_clear(&c->wwwauth_headers);
credential_init(c);
}
int credential_match(const struct credential *want,
- const struct credential *have)
+ const struct credential *have, int match_password)
{
#define CHECK(x) (!want->x || (have->x && !strcmp(want->x, have->x)))
return CHECK(protocol) &&
CHECK(host) &&
CHECK(path) &&
- CHECK(username);
+ CHECK(username) &&
+ (!match_password || CHECK(password));
#undef CHECK
}
@@ -42,6 +49,7 @@ static int credential_from_potentially_partial_url(struct credential *c,
const char *url);
static int credential_config_callback(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
void *data)
{
struct credential *c = data;
@@ -80,8 +88,8 @@ static int proto_is_http(const char *s)
static void credential_describe(struct credential *c, struct strbuf *out);
static void credential_format(struct credential *c, struct strbuf *out);
-static int select_all(const struct urlmatch_item *a,
- const struct urlmatch_item *b)
+static int select_all(const struct urlmatch_item *a UNUSED,
+ const struct urlmatch_item *b UNUSED)
{
return 0;
}
@@ -96,7 +104,7 @@ static int match_partial_url(const char *url, void *cb)
warning(_("skipping credential lookup for key: credential.%s"),
url);
else
- matches = credential_match(&want, c);
+ matches = credential_match(&want, c, 0);
credential_clear(&want);
return matches;
@@ -234,6 +242,16 @@ int credential_read(struct credential *c, FILE *fp)
} else if (!strcmp(key, "path")) {
free(c->path);
c->path = xstrdup(value);
+ } else if (!strcmp(key, "wwwauth[]")) {
+ strvec_push(&c->wwwauth_headers, value);
+ } else if (!strcmp(key, "password_expiry_utc")) {
+ errno = 0;
+ c->password_expiry_utc = parse_timestamp(value, NULL, 10);
+ if (c->password_expiry_utc == 0 || errno == ERANGE)
+ c->password_expiry_utc = TIME_MAX;
+ } else if (!strcmp(key, "oauth_refresh_token")) {
+ free(c->oauth_refresh_token);
+ c->oauth_refresh_token = xstrdup(value);
} else if (!strcmp(key, "url")) {
credential_from_url(c, value);
} else if (!strcmp(key, "quit")) {
@@ -269,6 +287,14 @@ void credential_write(const struct credential *c, FILE *fp)
credential_write_item(fp, "path", c->path, 0);
credential_write_item(fp, "username", c->username, 0);
credential_write_item(fp, "password", c->password, 0);
+ credential_write_item(fp, "oauth_refresh_token", c->oauth_refresh_token, 0);
+ if (c->password_expiry_utc != TIME_MAX) {
+ char *s = xstrfmt("%"PRItime, c->password_expiry_utc);
+ credential_write_item(fp, "password_expiry_utc", s, 0);
+ free(s);
+ }
+ for (size_t i = 0; i < c->wwwauth_headers.nr; i++)
+ credential_write_item(fp, "wwwauth[]", c->wwwauth_headers.v[i], 0);
}
static int run_credential_helper(struct credential *c,
@@ -342,6 +368,12 @@ void credential_fill(struct credential *c)
for (i = 0; i < c->helpers.nr; i++) {
credential_do(c, c->helpers.items[i].string, "get");
+ if (c->password_expiry_utc < time(NULL)) {
+ /* Discard expired password */
+ FREE_AND_NULL(c->password);
+ /* Reset expiry to maintain consistency */
+ c->password_expiry_utc = TIME_MAX;
+ }
if (c->username && c->password)
return;
if (c->quit)
@@ -360,7 +392,7 @@ void credential_approve(struct credential *c)
if (c->approved)
return;
- if (!c->username || !c->password)
+ if (!c->username || !c->password || c->password_expiry_utc < time(NULL))
return;
credential_apply_config(c);
@@ -381,6 +413,8 @@ void credential_reject(struct credential *c)
FREE_AND_NULL(c->username);
FREE_AND_NULL(c->password);
+ FREE_AND_NULL(c->oauth_refresh_token);
+ c->password_expiry_utc = TIME_MAX;
c->approved = 0;
}
diff --git a/credential.h b/credential.h
index f430e77..acc41ad 100644
--- a/credential.h
+++ b/credential.h
@@ -2,6 +2,7 @@
#define CREDENTIAL_H
#include "string-list.h"
+#include "strvec.h"
/**
* The credentials API provides an abstracted way of gathering username and
@@ -115,6 +116,20 @@ struct credential {
*/
struct string_list helpers;
+ /**
+ * A `strvec` of WWW-Authenticate header values. Each string
+ * is the value of a WWW-Authenticate header in an HTTP response,
+ * in the order they were received in the response.
+ */
+ struct strvec wwwauth_headers;
+
+ /**
+ * Internal use only. Keeps track of if we previously matched against a
+ * WWW-Authenticate header line in order to re-fold future continuation
+ * lines into one value.
+ */
+ unsigned header_is_last_match:1;
+
unsigned approved:1,
configured:1,
quit:1,
@@ -126,10 +141,14 @@ struct credential {
char *protocol;
char *host;
char *path;
+ char *oauth_refresh_token;
+ timestamp_t password_expiry_utc;
};
#define CREDENTIAL_INIT { \
.helpers = STRING_LIST_INIT_DUP, \
+ .password_expiry_utc = TIME_MAX, \
+ .wwwauth_headers = STRVEC_INIT, \
}
/* Initialize a credential structure, setting all fields to empty. */
@@ -192,6 +211,6 @@ void credential_from_url(struct credential *, const char *url);
int credential_from_url_gently(struct credential *, const char *url, int quiet);
int credential_match(const struct credential *want,
- const struct credential *have);
+ const struct credential *have, int match_password);
#endif /* CREDENTIAL_H */
diff --git a/csum-file.c b/csum-file.c
index 59ef339..870748e 100644
--- a/csum-file.c
+++ b/csum-file.c
@@ -7,9 +7,10 @@
* files. Useful when you write a file that you want to be
* able to verify hasn't been messed with afterwards.
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "progress.h"
#include "csum-file.h"
+#include "hash.h"
static void verify_buffer_or_die(struct hashfile *f,
const void *buf,
@@ -45,7 +46,8 @@ void hashflush(struct hashfile *f)
unsigned offset = f->offset;
if (offset) {
- the_hash_algo->update_fn(&f->ctx, f->buffer, offset);
+ if (!f->skip_hash)
+ the_hash_algo->update_fn(&f->ctx, f->buffer, offset);
flush(f, f->buffer, offset);
f->offset = 0;
}
@@ -64,7 +66,12 @@ int finalize_hashfile(struct hashfile *f, unsigned char *result,
int fd;
hashflush(f);
- the_hash_algo->final_fn(f->buffer, &f->ctx);
+
+ if (f->skip_hash)
+ hashclr(f->buffer);
+ else
+ the_hash_algo->final_fn(f->buffer, &f->ctx);
+
if (result)
hashcpy(result, f->buffer);
if (flags & CSUM_HASH_IN_STREAM)
@@ -108,7 +115,8 @@ void hashwrite(struct hashfile *f, const void *buf, unsigned int count)
* the hashfile's buffer. In this block,
* f->offset is necessarily zero.
*/
- the_hash_algo->update_fn(&f->ctx, buf, nr);
+ if (!f->skip_hash)
+ the_hash_algo->update_fn(&f->ctx, buf, nr);
flush(f, buf, nr);
} else {
/*
@@ -153,6 +161,7 @@ static struct hashfile *hashfd_internal(int fd, const char *name,
f->tp = tp;
f->name = name;
f->do_crc = 0;
+ f->skip_hash = 0;
the_hash_algo->init_fn(&f->ctx);
f->buffer_len = buffer_len;
@@ -198,7 +207,7 @@ int hashfile_truncate(struct hashfile *f, struct hashfile_checkpoint *checkpoint
lseek(f->fd, offset, SEEK_SET) != offset)
return -1;
f->total = offset;
- f->ctx = checkpoint->ctx;
+ the_hash_algo->clone_fn(&f->ctx, &checkpoint->ctx);
f->offset = 0; /* hashflush() was called in checkpoint */
return 0;
}
diff --git a/csum-file.h b/csum-file.h
index 0d29f52..bc5bec2 100644
--- a/csum-file.h
+++ b/csum-file.h
@@ -1,8 +1,8 @@
#ifndef CSUM_FILE_H
#define CSUM_FILE_H
-#include "cache.h"
-#include "hash.h"
+#include "hash-ll.h"
+#include "write-or-die.h"
struct progress;
@@ -20,6 +20,13 @@ struct hashfile {
size_t buffer_len;
unsigned char *buffer;
unsigned char *check_buffer;
+
+ /**
+ * If non-zero, skip_hash indicates that we should
+ * not actually compute the hash for this hashfile and
+ * instead only use it as a buffered write.
+ */
+ int skip_hash;
};
/* Checkpoint */
diff --git a/ctype.c b/ctype.c
index fc0225c..3451745 100644
--- a/ctype.c
+++ b/ctype.c
@@ -28,39 +28,3 @@ const unsigned char sane_ctype[256] = {
A, A, A, A, A, A, A, A, A, A, A, R, R, U, P, X, /* 112..127 */
/* Nothing in the 128.. range */
};
-
-/* For case-insensitive kwset */
-const unsigned char tolower_trans_tbl[256] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- ' ', '!', '"', '#', '$', '%', '&', 0x27,
- '(', ')', '*', '+', ',', '-', '.', '/',
- '0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', ':', ';', '<', '=', '>', '?',
- '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
- 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
- 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
- 'x', 'y', 'z', '[', 0x5c, ']', '^', '_',
- '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
- 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
- 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
- 'x', 'y', 'z', '{', '|', '}', '~', 0x7f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
- 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
- 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
- 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
- 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
- 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
- 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
- 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
- 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
-};
diff --git a/daemon.c b/daemon.c
index 0ae7d12..17d331b 100644
--- a/daemon.c
+++ b/daemon.c
@@ -1,7 +1,12 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
#include "config.h"
+#include "environment.h"
+#include "path.h"
#include "pkt-line.h"
+#include "protocol.h"
#include "run-command.h"
+#include "setup.h"
#include "strbuf.h"
#include "string-list.h"
@@ -137,42 +142,6 @@ static void NORETURN daemon_die(const char *err, va_list params)
exit(1);
}
-struct expand_path_context {
- const char *directory;
- struct hostinfo *hostinfo;
-};
-
-static size_t expand_path(struct strbuf *sb, const char *placeholder, void *ctx)
-{
- struct expand_path_context *context = ctx;
- struct hostinfo *hi = context->hostinfo;
-
- switch (placeholder[0]) {
- case 'H':
- strbuf_addbuf(sb, &hi->hostname);
- return 1;
- case 'C':
- if (placeholder[1] == 'H') {
- strbuf_addstr(sb, get_canon_hostname(hi));
- return 2;
- }
- break;
- case 'I':
- if (placeholder[1] == 'P') {
- strbuf_addstr(sb, get_ip_address(hi));
- return 2;
- }
- break;
- case 'P':
- strbuf_addbuf(sb, &hi->tcp_port);
- return 1;
- case 'D':
- strbuf_addstr(sb, context->directory);
- return 1;
- }
- return 0;
-}
-
static const char *path_ok(const char *directory, struct hostinfo *hi)
{
static char rpath[PATH_MAX];
@@ -216,10 +185,7 @@ static const char *path_ok(const char *directory, struct hostinfo *hi)
}
else if (interpolated_path && hi->saw_extended_args) {
struct strbuf expanded_path = STRBUF_INIT;
- struct expand_path_context context;
-
- context.directory = directory;
- context.hostinfo = hi;
+ const char *format = interpolated_path;
if (*dir != '/') {
/* Allow only absolute */
@@ -227,8 +193,24 @@ static const char *path_ok(const char *directory, struct hostinfo *hi)
return NULL;
}
- strbuf_expand(&expanded_path, interpolated_path,
- expand_path, &context);
+ while (strbuf_expand_step(&expanded_path, &format)) {
+ if (skip_prefix(format, "%", &format))
+ strbuf_addch(&expanded_path, '%');
+ else if (skip_prefix(format, "H", &format))
+ strbuf_addbuf(&expanded_path, &hi->hostname);
+ else if (skip_prefix(format, "CH", &format))
+ strbuf_addstr(&expanded_path,
+ get_canon_hostname(hi));
+ else if (skip_prefix(format, "IP", &format))
+ strbuf_addstr(&expanded_path,
+ get_ip_address(hi));
+ else if (skip_prefix(format, "P", &format))
+ strbuf_addbuf(&expanded_path, &hi->tcp_port);
+ else if (skip_prefix(format, "D", &format))
+ strbuf_addstr(&expanded_path, directory);
+ else
+ strbuf_addch(&expanded_path, '%');
+ }
rlen = strlcpy(interp_path, expanded_path.buf,
sizeof(interp_path));
@@ -928,7 +910,7 @@ static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)
add_child(&cld, addr, addrlen);
}
-static void child_handler(int signo)
+static void child_handler(int signo UNUSED)
{
/*
* Otherwise empty handler because systemcalls will get interrupted
@@ -1261,19 +1243,20 @@ static int serve(struct string_list *listen_addr, int listen_port,
int cmd_main(int argc, const char **argv)
{
int listen_port = 0;
- struct string_list listen_addr = STRING_LIST_INIT_NODUP;
+ struct string_list listen_addr = STRING_LIST_INIT_DUP;
int serve_mode = 0, inetd_mode = 0;
const char *pid_file = NULL, *user_name = NULL, *group_name = NULL;
int detach = 0;
struct credentials *cred = NULL;
int i;
+ int ret;
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
const char *v;
if (skip_prefix(arg, "--listen=", &v)) {
- string_list_append(&listen_addr, xstrdup_tolower(v));
+ string_list_append_nodup(&listen_addr, xstrdup_tolower(v));
continue;
}
if (skip_prefix(arg, "--port=", &v)) {
@@ -1455,22 +1438,26 @@ int cmd_main(int argc, const char **argv)
die_errno("failed to redirect stderr to /dev/null");
}
- if (inetd_mode || serve_mode)
- return execute();
+ if (inetd_mode || serve_mode) {
+ ret = execute();
+ } else {
+ if (detach) {
+ if (daemonize())
+ die("--detach not supported on this platform");
+ }
- if (detach) {
- if (daemonize())
- die("--detach not supported on this platform");
- }
+ if (pid_file)
+ write_file(pid_file, "%"PRIuMAX, (uintmax_t) getpid());
- if (pid_file)
- write_file(pid_file, "%"PRIuMAX, (uintmax_t) getpid());
+ /* prepare argv for serving-processes */
+ strvec_push(&cld_argv, argv[0]); /* git-daemon */
+ strvec_push(&cld_argv, "--serve");
+ for (i = 1; i < argc; ++i)
+ strvec_push(&cld_argv, argv[i]);
- /* prepare argv for serving-processes */
- strvec_push(&cld_argv, argv[0]); /* git-daemon */
- strvec_push(&cld_argv, "--serve");
- for (i = 1; i < argc; ++i)
- strvec_push(&cld_argv, argv[i]);
+ ret = serve(&listen_addr, listen_port, cred);
+ }
- return serve(&listen_addr, listen_port, cred);
+ string_list_clear(&listen_addr, 0);
+ return ret;
}
diff --git a/date.c b/date.c
index 68a260c..7365a4a 100644
--- a/date.c
+++ b/date.c
@@ -4,8 +4,11 @@
* Copyright (C) Linus Torvalds, 2005
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "date.h"
+#include "gettext.h"
+#include "pager.h"
+#include "strbuf.h"
/*
* This is like mktime, but without normalization of tm_wday and tm_yday.
@@ -204,13 +207,13 @@ void show_date_relative(timestamp_t time, struct strbuf *timebuf)
(diff + 183) / 365);
}
-struct date_mode *date_mode_from_type(enum date_mode_type type)
+struct date_mode date_mode_from_type(enum date_mode_type type)
{
- static struct date_mode mode = DATE_MODE_INIT;
+ struct date_mode mode = DATE_MODE_INIT;
if (type == DATE_STRFTIME)
BUG("cannot create anonymous strftime date_mode struct");
mode.type = type;
- return &mode;
+ return mode;
}
static void show_date_normal(struct strbuf *buf, timestamp_t time, struct tm *tm, int tz, struct tm *human_tm, int human_tz, int local)
@@ -280,7 +283,7 @@ static void show_date_normal(struct strbuf *buf, timestamp_t time, struct tm *tm
strbuf_addf(buf, " %+05d", tz);
}
-const char *show_date(timestamp_t time, int tz, const struct date_mode *mode)
+const char *show_date(timestamp_t time, int tz, struct date_mode mode)
{
struct tm *tm;
struct tm tmbuf = { 0 };
@@ -288,13 +291,13 @@ const char *show_date(timestamp_t time, int tz, const struct date_mode *mode)
int human_tz = -1;
static struct strbuf timebuf = STRBUF_INIT;
- if (mode->type == DATE_UNIX) {
+ if (mode.type == DATE_UNIX) {
strbuf_reset(&timebuf);
strbuf_addf(&timebuf, "%"PRItime, time);
return timebuf.buf;
}
- if (mode->type == DATE_HUMAN) {
+ if (mode.type == DATE_HUMAN) {
struct timeval now;
get_time(&now);
@@ -303,22 +306,22 @@ const char *show_date(timestamp_t time, int tz, const struct date_mode *mode)
human_tz = local_time_tzoffset(now.tv_sec, &human_tm);
}
- if (mode->local)
+ if (mode.local)
tz = local_tzoffset(time);
- if (mode->type == DATE_RAW) {
+ if (mode.type == DATE_RAW) {
strbuf_reset(&timebuf);
strbuf_addf(&timebuf, "%"PRItime" %+05d", time, tz);
return timebuf.buf;
}
- if (mode->type == DATE_RELATIVE) {
+ if (mode.type == DATE_RELATIVE) {
strbuf_reset(&timebuf);
show_date_relative(time, &timebuf);
return timebuf.buf;
}
- if (mode->local)
+ if (mode.local)
tm = time_to_tm_local(time, &tmbuf);
else
tm = time_to_tm(time, tz, &tmbuf);
@@ -328,35 +331,39 @@ const char *show_date(timestamp_t time, int tz, const struct date_mode *mode)
}
strbuf_reset(&timebuf);
- if (mode->type == DATE_SHORT)
+ if (mode.type == DATE_SHORT)
strbuf_addf(&timebuf, "%04d-%02d-%02d", tm->tm_year + 1900,
tm->tm_mon + 1, tm->tm_mday);
- else if (mode->type == DATE_ISO8601)
+ else if (mode.type == DATE_ISO8601)
strbuf_addf(&timebuf, "%04d-%02d-%02d %02d:%02d:%02d %+05d",
tm->tm_year + 1900,
tm->tm_mon + 1,
tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec,
tz);
- else if (mode->type == DATE_ISO8601_STRICT) {
- char sign = (tz >= 0) ? '+' : '-';
- tz = abs(tz);
- strbuf_addf(&timebuf, "%04d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d",
+ else if (mode.type == DATE_ISO8601_STRICT) {
+ strbuf_addf(&timebuf, "%04d-%02d-%02dT%02d:%02d:%02d",
tm->tm_year + 1900,
tm->tm_mon + 1,
tm->tm_mday,
- tm->tm_hour, tm->tm_min, tm->tm_sec,
- sign, tz / 100, tz % 100);
- } else if (mode->type == DATE_RFC2822)
+ tm->tm_hour, tm->tm_min, tm->tm_sec);
+ if (tz == 0) {
+ strbuf_addch(&timebuf, 'Z');
+ } else {
+ strbuf_addch(&timebuf, tz >= 0 ? '+' : '-');
+ tz = abs(tz);
+ strbuf_addf(&timebuf, "%02d:%02d", tz / 100, tz % 100);
+ }
+ } else if (mode.type == DATE_RFC2822)
strbuf_addf(&timebuf, "%.3s, %d %.3s %d %02d:%02d:%02d %+05d",
weekday_names[tm->tm_wday], tm->tm_mday,
month_names[tm->tm_mon], tm->tm_year + 1900,
tm->tm_hour, tm->tm_min, tm->tm_sec, tz);
- else if (mode->type == DATE_STRFTIME)
- strbuf_addftime(&timebuf, mode->strftime_fmt, tm, tz,
- !mode->local);
+ else if (mode.type == DATE_STRFTIME)
+ strbuf_addftime(&timebuf, mode.strftime_fmt, tm, tz,
+ !mode.local);
else
- show_date_normal(&timebuf, time, tm, tz, &human_tm, human_tz, mode->local);
+ show_date_normal(&timebuf, time, tm, tz, &human_tm, human_tz, mode.local);
return timebuf.buf;
}
@@ -493,6 +500,12 @@ static int match_alpha(const char *date, struct tm *tm, int *offset)
return 2;
}
+ /* ISO-8601 allows yyyymmDD'T'HHMMSS, with less precision */
+ if (*date == 'T' && isdigit(date[1]) && tm->tm_hour == -1) {
+ tm->tm_min = tm->tm_sec = 0;
+ return 1;
+ }
+
/* BAD CRAP */
return skip_alpha(date);
}
@@ -639,6 +652,18 @@ static inline int nodate(struct tm *tm)
}
/*
+ * Have we seen an ISO-8601-alike date, i.e. 20220101T0,
+ * In which, hour is still unset,
+ * and minutes and second has been set to 0.
+ */
+static inline int maybeiso8601(struct tm *tm)
+{
+ return tm->tm_hour == -1 &&
+ tm->tm_min == 0 &&
+ tm->tm_sec == 0;
+}
+
+/*
* We've seen a digit. Time? Year? Date?
*/
static int match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt)
@@ -701,6 +726,25 @@ static int match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt
return end - date;
}
+ /* reduced precision of ISO-8601's time: HHMM or HH */
+ if (maybeiso8601(tm)) {
+ unsigned int num1 = num;
+ unsigned int num2 = 0;
+ if (n == 4) {
+ num1 = num / 100;
+ num2 = num % 100;
+ }
+ if ((n == 4 || n == 2) && !nodate(tm) &&
+ set_time(num1, num2, 0, tm) == 0)
+ return n;
+ /*
+ * We thought this is an ISO-8601 time string,
+ * we set minutes and seconds to 0,
+ * turn out it isn't, rollback the change.
+ */
+ tm->tm_min = tm->tm_sec = -1;
+ }
+
/* Four-digit year or a timezone? */
if (n == 4) {
if (num <= 1400 && *offset == -1) {
@@ -1101,7 +1145,7 @@ static void date_tea(struct tm *tm, struct tm *now, int *num)
date_time(tm, now, 17);
}
-static void date_pm(struct tm *tm, struct tm *now, int *num)
+static void date_pm(struct tm *tm, struct tm *now UNUSED, int *num)
{
int hour, n = *num;
*num = 0;
@@ -1115,7 +1159,7 @@ static void date_pm(struct tm *tm, struct tm *now, int *num)
tm->tm_hour = (hour % 12) + 12;
}
-static void date_am(struct tm *tm, struct tm *now, int *num)
+static void date_am(struct tm *tm, struct tm *now UNUSED, int *num)
{
int hour, n = *num;
*num = 0;
@@ -1129,7 +1173,7 @@ static void date_am(struct tm *tm, struct tm *now, int *num)
tm->tm_hour = (hour % 12);
}
-static void date_never(struct tm *tm, struct tm *now, int *num)
+static void date_never(struct tm *tm, struct tm *now UNUSED, int *num)
{
time_t n = 0;
localtime_r(&n, tm);
@@ -1328,20 +1372,6 @@ static timestamp_t approxidate_str(const char *date,
return (timestamp_t)update_tm(&tm, &now, 0);
}
-timestamp_t approxidate_relative(const char *date)
-{
- struct timeval tv;
- timestamp_t timestamp;
- int offset;
- int errors = 0;
-
- if (!parse_date_basic(date, &timestamp, &offset))
- return timestamp;
-
- get_time(&tv);
- return approxidate_str(date, (const struct timeval *) &tv, &errors);
-}
-
timestamp_t approxidate_careful(const char *date, int *error_ret)
{
struct timeval tv;
diff --git a/date.h b/date.h
index 5d4eaba..0747864 100644
--- a/date.h
+++ b/date.h
@@ -22,8 +22,8 @@ enum date_mode_type {
struct date_mode {
enum date_mode_type type;
- const char *strftime_fmt;
int local;
+ const char *strftime_fmt;
};
#define DATE_MODE_INIT { \
@@ -36,14 +36,14 @@ struct date_mode {
* show_date(t, tz, DATE_MODE(NORMAL));
*/
#define DATE_MODE(t) date_mode_from_type(DATE_##t)
-struct date_mode *date_mode_from_type(enum date_mode_type type);
+struct date_mode date_mode_from_type(enum date_mode_type type);
/**
* Format <'time', 'timezone'> into static memory according to 'mode'
* and return it. The mode is an initialized "struct date_mode"
* (usually from the DATE_MODE() macro).
*/
-const char *show_date(timestamp_t time, int timezone, const struct date_mode *mode);
+const char *show_date(timestamp_t time, int timezone, struct date_mode mode);
/**
* Parse a date format for later use with show_date().
@@ -68,7 +68,6 @@ int parse_expiry_date(const char *date, timestamp_t *timestamp);
void datestamp(struct strbuf *out);
#define approxidate(s) approxidate_careful((s), NULL)
timestamp_t approxidate_careful(const char *, int *);
-timestamp_t approxidate_relative(const char *date);
int date_overflows(timestamp_t date);
time_t tm_to_time_t(const struct tm *tm);
#endif
diff --git a/decorate.c b/decorate.c
index 2036d15..69aeb14 100644
--- a/decorate.c
+++ b/decorate.c
@@ -2,7 +2,7 @@
* decorate.c - decorate a git object with some arbitrary
* data.
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "object.h"
#include "decorate.h"
@@ -81,3 +81,18 @@ void *lookup_decoration(struct decoration *n, const struct object *obj)
j = 0;
}
}
+
+void clear_decoration(struct decoration *n, void (*free_cb)(void *))
+{
+ if (free_cb) {
+ unsigned int i;
+ for (i = 0; i < n->size; i++) {
+ void *d = n->entries[i].decoration;
+ if (d)
+ free_cb(d);
+ }
+ }
+
+ FREE_AND_NULL(n->entries);
+ n->size = n->nr = 0;
+}
diff --git a/decorate.h b/decorate.h
index ee43dee..cdeb17c 100644
--- a/decorate.h
+++ b/decorate.h
@@ -58,4 +58,14 @@ void *add_decoration(struct decoration *n, const struct object *obj, void *decor
*/
void *lookup_decoration(struct decoration *n, const struct object *obj);
+/*
+ * Clear all decoration entries, releasing any memory used by the structure.
+ * If free_cb is not NULL, it is called for every decoration value currently
+ * stored.
+ *
+ * After clearing, the decoration struct can be used again. The "name" field is
+ * retained.
+ */
+void clear_decoration(struct decoration *n, void (*free_cb)(void *));
+
#endif
diff --git a/delta-islands.c b/delta-islands.c
index aa98b2e..f7e0794 100644
--- a/delta-islands.c
+++ b/delta-islands.c
@@ -1,16 +1,13 @@
-#include "cache.h"
-#include "attr.h"
+#include "git-compat-util.h"
#include "object.h"
-#include "blob.h"
#include "commit.h"
+#include "gettext.h"
+#include "hex.h"
#include "tag.h"
#include "tree.h"
-#include "delta.h"
#include "pack.h"
#include "tree-walk.h"
#include "diff.h"
-#include "revision.h"
-#include "list-objects.h"
#include "progress.h"
#include "refs.h"
#include "khash.h"
@@ -26,8 +23,6 @@ static kh_oid_map_t *island_marks;
static unsigned island_counter;
static unsigned island_counter_core;
-static kh_str_t *remote_islands;
-
struct remote_island {
uint64_t hash;
struct oid_array oids;
@@ -289,7 +284,7 @@ void resolve_tree_islands(struct repository *r,
if (!tree || parse_tree(tree) < 0)
die(_("bad tree object %s"), oid_to_hex(&ent->idx.oid));
- init_tree_desc(&desc, tree->buffer, tree->size);
+ init_tree_desc(&desc, &tree->object.oid, tree->buffer, tree->size);
while (tree_entry(&desc, &entry)) {
struct object *obj;
@@ -312,29 +307,57 @@ void resolve_tree_islands(struct repository *r,
free(todo);
}
-static regex_t *island_regexes;
-static unsigned int island_regexes_alloc, island_regexes_nr;
+struct island_load_data {
+ kh_str_t *remote_islands;
+ regex_t *rx;
+ size_t nr;
+ size_t alloc;
+};
static const char *core_island_name;
-static int island_config_callback(const char *k, const char *v, void *cb)
+static void free_config_regexes(struct island_load_data *ild)
+{
+ for (size_t i = 0; i < ild->nr; i++)
+ regfree(&ild->rx[i]);
+ free(ild->rx);
+}
+
+static void free_remote_islands(kh_str_t *remote_islands)
+{
+ const char *island_name;
+ struct remote_island *rl;
+
+ kh_foreach(remote_islands, island_name, rl, {
+ free((void *)island_name);
+ oid_array_clear(&rl->oids);
+ free(rl);
+ });
+ kh_destroy_str(remote_islands);
+}
+
+static int island_config_callback(const char *k, const char *v,
+ const struct config_context *ctx UNUSED,
+ void *cb)
{
+ struct island_load_data *ild = cb;
+
if (!strcmp(k, "pack.island")) {
struct strbuf re = STRBUF_INIT;
if (!v)
return config_error_nonbool(k);
- ALLOC_GROW(island_regexes, island_regexes_nr + 1, island_regexes_alloc);
+ ALLOC_GROW(ild->rx, ild->nr + 1, ild->alloc);
if (*v != '^')
strbuf_addch(&re, '^');
strbuf_addstr(&re, v);
- if (regcomp(&island_regexes[island_regexes_nr], re.buf, REG_EXTENDED))
+ if (regcomp(&ild->rx[ild->nr], re.buf, REG_EXTENDED))
die(_("failed to load island regex for '%s': %s"), k, re.buf);
strbuf_release(&re);
- island_regexes_nr++;
+ ild->nr++;
return 0;
}
@@ -344,7 +367,8 @@ static int island_config_callback(const char *k, const char *v, void *cb)
return 0;
}
-static void add_ref_to_island(const char *island_name, const struct object_id *oid)
+static void add_ref_to_island(kh_str_t *remote_islands, const char *island_name,
+ const struct object_id *oid)
{
uint64_t sha_core;
struct remote_island *rl = NULL;
@@ -365,8 +389,10 @@ static void add_ref_to_island(const char *island_name, const struct object_id *o
}
static int find_island_for_ref(const char *refname, const struct object_id *oid,
- int flags, void *data)
+ int flags UNUSED, void *cb)
{
+ struct island_load_data *ild = cb;
+
/*
* We should advertise 'ARRAY_SIZE(matches) - 2' as the max,
* so we can diagnose below a config with more capture groups
@@ -377,8 +403,8 @@ static int find_island_for_ref(const char *refname, const struct object_id *oid,
struct strbuf island_name = STRBUF_INIT;
/* walk backwards to get last-one-wins ordering */
- for (i = island_regexes_nr - 1; i >= 0; i--) {
- if (!regexec(&island_regexes[i], refname,
+ for (i = ild->nr - 1; i >= 0; i--) {
+ if (!regexec(&ild->rx[i], refname,
ARRAY_SIZE(matches), matches, 0))
break;
}
@@ -403,12 +429,12 @@ static int find_island_for_ref(const char *refname, const struct object_id *oid,
strbuf_add(&island_name, refname + match->rm_so, match->rm_eo - match->rm_so);
}
- add_ref_to_island(island_name.buf, oid);
+ add_ref_to_island(ild->remote_islands, island_name.buf, oid);
strbuf_release(&island_name);
return 0;
}
-static struct remote_island *get_core_island(void)
+static struct remote_island *get_core_island(kh_str_t *remote_islands)
{
if (core_island_name) {
khiter_t pos = kh_get_str(remote_islands, core_island_name);
@@ -419,7 +445,7 @@ static struct remote_island *get_core_island(void)
return NULL;
}
-static void deduplicate_islands(struct repository *r)
+static void deduplicate_islands(kh_str_t *remote_islands, struct repository *r)
{
struct remote_island *island, *core = NULL, **list;
unsigned int island_count, dst, src, ref, i = 0;
@@ -445,7 +471,7 @@ static void deduplicate_islands(struct repository *r)
}
island_bitmap_size = (island_count / 32) + 1;
- core = get_core_island();
+ core = get_core_island(remote_islands);
for (i = 0; i < island_count; ++i) {
mark_remote_island_1(r, list[i], core && list[i]->hash == core->hash);
@@ -456,12 +482,16 @@ static void deduplicate_islands(struct repository *r)
void load_delta_islands(struct repository *r, int progress)
{
+ struct island_load_data ild = { 0 };
+
island_marks = kh_init_oid_map();
- remote_islands = kh_init_str();
- git_config(island_config_callback, NULL);
- for_each_ref(find_island_for_ref, NULL);
- deduplicate_islands(r);
+ git_config(island_config_callback, &ild);
+ ild.remote_islands = kh_init_str();
+ for_each_ref(find_island_for_ref, &ild);
+ free_config_regexes(&ild);
+ deduplicate_islands(ild.remote_islands, r);
+ free_remote_islands(ild.remote_islands);
if (progress)
fprintf(stderr, _("Marked %d islands, done.\n"), island_counter);
@@ -475,13 +505,30 @@ void propagate_island_marks(struct commit *commit)
struct commit_list *p;
struct island_bitmap *root_marks = kh_value(island_marks, pos);
- parse_commit(commit);
- set_island_marks(&get_commit_tree(commit)->object, root_marks);
+ repo_parse_commit(the_repository, commit);
+ set_island_marks(&repo_get_commit_tree(the_repository, commit)->object,
+ root_marks);
for (p = commit->parents; p; p = p->next)
set_island_marks(&p->item->object, root_marks);
}
}
+void free_island_marks(void)
+{
+ struct island_bitmap *bitmap;
+
+ if (island_marks) {
+ kh_foreach_value(island_marks, bitmap, {
+ if (!--bitmap->refcount)
+ free(bitmap);
+ });
+ kh_destroy_oid_map(island_marks);
+ }
+
+ /* detect use-after-free with a an address which is never valid: */
+ island_marks = (void *)-1;
+}
+
int compute_pack_layers(struct packing_data *to_pack)
{
uint32_t i;
diff --git a/delta-islands.h b/delta-islands.h
index eb0f952..8d1591a 100644
--- a/delta-islands.h
+++ b/delta-islands.h
@@ -14,5 +14,6 @@ void resolve_tree_islands(struct repository *r,
void load_delta_islands(struct repository *r, int progress);
void propagate_island_marks(struct commit *commit);
int compute_pack_layers(struct packing_data *to_pack);
+void free_island_marks(void);
#endif /* DELTA_ISLANDS_H */
diff --git a/detect-compiler b/detect-compiler
index 50087f5..a87650b 100755
--- a/detect-compiler
+++ b/detect-compiler
@@ -17,7 +17,15 @@ get_family() {
}
get_version() {
- get_version_line | sed 's/^.* version \([0-9][^ ]*\).*/\1/'
+ # A string that begins with a digit up to the next SP
+ ver=$(get_version_line | sed 's/^.* version \([0-9][^ ]*\).*/\1/')
+
+ # There are known -variant suffixes that do not affect the
+ # meaning of the main version number. Strip them.
+ ver=${ver%-win32}
+ ver=${ver%-posix}
+
+ echo "$ver"
}
print_flags() {
diff --git a/diagnose.c b/diagnose.c
new file mode 100644
index 0000000..4d096c8
--- /dev/null
+++ b/diagnose.c
@@ -0,0 +1,280 @@
+#include "git-compat-util.h"
+#include "diagnose.h"
+#include "compat/disk.h"
+#include "archive.h"
+#include "dir.h"
+#include "help.h"
+#include "gettext.h"
+#include "hex.h"
+#include "strvec.h"
+#include "object-store-ll.h"
+#include "packfile.h"
+#include "parse-options.h"
+#include "write-or-die.h"
+
+struct archive_dir {
+ const char *path;
+ int recursive;
+};
+
+struct diagnose_option {
+ enum diagnose_mode mode;
+ const char *option_name;
+};
+
+static struct diagnose_option diagnose_options[] = {
+ { DIAGNOSE_STATS, "stats" },
+ { DIAGNOSE_ALL, "all" },
+};
+
+int option_parse_diagnose(const struct option *opt, const char *arg, int unset)
+{
+ int i;
+ enum diagnose_mode *diagnose = opt->value;
+
+ if (!arg) {
+ *diagnose = unset ? DIAGNOSE_NONE : DIAGNOSE_STATS;
+ return 0;
+ }
+
+ for (i = 0; i < ARRAY_SIZE(diagnose_options); i++) {
+ if (!strcmp(arg, diagnose_options[i].option_name)) {
+ *diagnose = diagnose_options[i].mode;
+ return 0;
+ }
+ }
+
+ return error(_("invalid --%s value '%s'"), opt->long_name, arg);
+}
+
+static void dir_file_stats_objects(const char *full_path,
+ size_t full_path_len UNUSED,
+ const char *file_name, void *data)
+{
+ struct strbuf *buf = data;
+ struct stat st;
+
+ if (!stat(full_path, &st))
+ strbuf_addf(buf, "%-70s %16" PRIuMAX "\n", file_name,
+ (uintmax_t)st.st_size);
+}
+
+static int dir_file_stats(struct object_directory *object_dir, void *data)
+{
+ struct strbuf *buf = data;
+
+ strbuf_addf(buf, "Contents of %s:\n", object_dir->path);
+
+ for_each_file_in_pack_dir(object_dir->path, dir_file_stats_objects,
+ data);
+
+ return 0;
+}
+
+static int count_files(struct strbuf *path)
+{
+ DIR *dir = opendir(path->buf);
+ struct dirent *e;
+ int count = 0;
+
+ if (!dir)
+ return 0;
+
+ while ((e = readdir_skip_dot_and_dotdot(dir)) != NULL)
+ if (get_dtype(e, path, 0) == DT_REG)
+ count++;
+
+ closedir(dir);
+ return count;
+}
+
+static void loose_objs_stats(struct strbuf *buf, const char *path)
+{
+ DIR *dir = opendir(path);
+ struct dirent *e;
+ int count;
+ int total = 0;
+ unsigned char c;
+ struct strbuf count_path = STRBUF_INIT;
+ size_t base_path_len;
+
+ if (!dir)
+ return;
+
+ strbuf_addstr(buf, "Object directory stats for ");
+ strbuf_add_absolute_path(buf, path);
+ strbuf_addstr(buf, ":\n");
+
+ strbuf_add_absolute_path(&count_path, path);
+ strbuf_addch(&count_path, '/');
+ base_path_len = count_path.len;
+
+ while ((e = readdir_skip_dot_and_dotdot(dir)) != NULL)
+ if (get_dtype(e, &count_path, 0) == DT_DIR &&
+ strlen(e->d_name) == 2 &&
+ !hex_to_bytes(&c, e->d_name, 1)) {
+ strbuf_setlen(&count_path, base_path_len);
+ strbuf_addf(&count_path, "%s/", e->d_name);
+ total += (count = count_files(&count_path));
+ strbuf_addf(buf, "%s : %7d files\n", e->d_name, count);
+ }
+
+ strbuf_addf(buf, "Total: %d loose objects", total);
+
+ strbuf_release(&count_path);
+ closedir(dir);
+}
+
+static int add_directory_to_archiver(struct strvec *archiver_args,
+ const char *path, int recurse)
+{
+ int at_root = !*path;
+ DIR *dir;
+ struct dirent *e;
+ struct strbuf buf = STRBUF_INIT;
+ size_t len;
+ int res = 0;
+
+ dir = opendir(at_root ? "." : path);
+ if (!dir) {
+ if (errno == ENOENT) {
+ warning(_("could not archive missing directory '%s'"), path);
+ return 0;
+ }
+ return error_errno(_("could not open directory '%s'"), path);
+ }
+
+ if (!at_root)
+ strbuf_addf(&buf, "%s/", path);
+ len = buf.len;
+ strvec_pushf(archiver_args, "--prefix=%s", buf.buf);
+
+ while (!res && (e = readdir_skip_dot_and_dotdot(dir))) {
+ struct strbuf abspath = STRBUF_INIT;
+ unsigned char dtype;
+
+ strbuf_add_absolute_path(&abspath, at_root ? "." : path);
+ strbuf_addch(&abspath, '/');
+ dtype = get_dtype(e, &abspath, 0);
+
+ strbuf_setlen(&buf, len);
+ strbuf_addstr(&buf, e->d_name);
+
+ if (dtype == DT_REG)
+ strvec_pushf(archiver_args, "--add-file=%s", buf.buf);
+ else if (dtype != DT_DIR)
+ warning(_("skipping '%s', which is neither file nor "
+ "directory"), buf.buf);
+ else if (recurse &&
+ add_directory_to_archiver(archiver_args,
+ buf.buf, recurse) < 0)
+ res = -1;
+
+ strbuf_release(&abspath);
+ }
+
+ closedir(dir);
+ strbuf_release(&buf);
+ return res;
+}
+
+int create_diagnostics_archive(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;
+ struct archive_dir archive_dirs[] = {
+ { ".git", 0 },
+ { ".git/hooks", 0 },
+ { ".git/info", 0 },
+ { ".git/logs", 1 },
+ { ".git/objects/info", 0 }
+ };
+
+ if (mode == DIAGNOSE_NONE) {
+ res = 0;
+ goto diagnose_cleanup;
+ }
+
+ stdout_fd = dup(STDOUT_FILENO);
+ if (stdout_fd < 0) {
+ res = error_errno(_("could not duplicate stdout"));
+ goto diagnose_cleanup;
+ }
+
+ archiver_fd = xopen(zip_path->buf, O_CREAT | O_WRONLY | O_TRUNC, 0666);
+ if (dup2(archiver_fd, STDOUT_FILENO) < 0) {
+ res = error_errno(_("could not redirect output"));
+ goto diagnose_cleanup;
+ }
+
+ init_zip_archiver();
+ strvec_pushl(&archiver_args, "git-diagnose", "--format=zip", NULL);
+
+ strbuf_reset(&buf);
+ strbuf_addstr(&buf, "Collecting diagnostic info\n\n");
+ get_version_info(&buf, 1);
+
+ strbuf_addf(&buf, "Repository root: %s\n", the_repository->worktree);
+ get_disk_info(&buf);
+ write_or_die(stdout_fd, buf.buf, buf.len);
+ strvec_pushf(&archiver_args,
+ "--add-virtual-file=diagnostics.log:%.*s",
+ (int)buf.len, buf.buf);
+
+ strbuf_reset(&buf);
+ strbuf_addstr(&buf, "--add-virtual-file=packs-local.txt:");
+ dir_file_stats(the_repository->objects->odb, &buf);
+ foreach_alt_odb(dir_file_stats, &buf);
+ strvec_push(&archiver_args, buf.buf);
+
+ strbuf_reset(&buf);
+ strbuf_addstr(&buf, "--add-virtual-file=objects-local.txt:");
+ loose_objs_stats(&buf, ".git/objects");
+ strvec_push(&archiver_args, buf.buf);
+
+ /* Only include this if explicitly requested */
+ if (mode == DIAGNOSE_ALL) {
+ for (i = 0; i < ARRAY_SIZE(archive_dirs); i++) {
+ if (add_directory_to_archiver(&archiver_args,
+ archive_dirs[i].path,
+ archive_dirs[i].recursive)) {
+ res = error_errno(_("could not add directory '%s' to archiver"),
+ archive_dirs[i].path);
+ goto diagnose_cleanup;
+ }
+ }
+ }
+
+ strvec_pushl(&archiver_args, "--prefix=",
+ oid_to_hex(the_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);
+ if (res) {
+ error(_("failed to write archive"));
+ goto diagnose_cleanup;
+ }
+
+ fprintf(stderr, "\n"
+ "Diagnostics complete.\n"
+ "All of the gathered info is captured in '%s'\n",
+ zip_path->buf);
+
+diagnose_cleanup:
+ if (archiver_fd >= 0) {
+ dup2(stdout_fd, STDOUT_FILENO);
+ close(stdout_fd);
+ close(archiver_fd);
+ }
+ free(argv_copy);
+ strvec_clear(&archiver_args);
+ strbuf_release(&buf);
+
+ return res;
+}
diff --git a/diagnose.h b/diagnose.h
new file mode 100644
index 0000000..f525219
--- /dev/null
+++ b/diagnose.h
@@ -0,0 +1,18 @@
+#ifndef DIAGNOSE_H
+#define DIAGNOSE_H
+
+#include "strbuf.h"
+
+struct option;
+
+enum diagnose_mode {
+ DIAGNOSE_NONE,
+ DIAGNOSE_STATS,
+ DIAGNOSE_ALL
+};
+
+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);
+
+#endif /* DIAGNOSE_H */
diff --git a/diff-lib.c b/diff-lib.c
index 7eb66a4..683f11e 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -1,16 +1,23 @@
/*
* Copyright (C) 2005 Junio C Hamano
*/
-#include "cache.h"
-#include "quote.h"
+#include "git-compat-util.h"
#include "commit.h"
#include "diff.h"
#include "diffcore.h"
+#include "gettext.h"
+#include "hash.h"
+#include "hex.h"
+#include "object-name.h"
+#include "read-cache.h"
#include "revision.h"
#include "cache-tree.h"
#include "unpack-trees.h"
#include "refs.h"
+#include "repository.h"
#include "submodule.h"
+#include "symlinks.h"
+#include "trace.h"
#include "dir.h"
#include "fsmonitor.h"
#include "commit-reach.h"
@@ -28,14 +35,20 @@
* exists for ce that is a submodule -- it is a submodule that is not
* checked out). Return negative for an error.
*/
-static int check_removed(const struct index_state *istate, const struct cache_entry *ce, struct stat *st)
+static int check_removed(const struct cache_entry *ce, struct stat *st)
{
- assert(is_fsmonitor_refreshed(istate));
- if (!(ce->ce_flags & CE_FSMONITOR_VALID) && lstat(ce->name, st) < 0) {
+ int stat_err;
+
+ if (!(ce->ce_flags & CE_FSMONITOR_VALID))
+ stat_err = lstat(ce->name, st);
+ else
+ stat_err = fake_lstat(ce, st);
+ if (stat_err < 0) {
if (!is_missing_file_error(errno))
return -1;
return 1;
}
+
if (has_symlink_leading_path(ce->name, ce_namelen(ce)))
return 1;
if (S_ISDIR(st->st_mode)) {
@@ -88,7 +101,7 @@ static int match_stat_with_submodule(struct diff_options *diffopt,
return changed;
}
-int run_diff_files(struct rev_info *revs, unsigned int option)
+void run_diff_files(struct rev_info *revs, unsigned int option)
{
int entries, i;
int diff_unmerged_stage = revs->max_count;
@@ -114,7 +127,16 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
if (diff_can_quit_early(&revs->diffopt))
break;
- if (!ce_path_match(istate, ce, &revs->prune_data, NULL))
+ /*
+ * NEEDSWORK:
+ * Here we filter with pathspec but the result is further
+ * filtered out when --relative is in effect. To end-users,
+ * a pathspec element that matched only to paths outside the
+ * current directory is like not matching anything at all;
+ * the handling of ps_matched[] here may become problematic
+ * if/when we add the "--error-unmatch" option to "git diff".
+ */
+ if (!ce_path_match(istate, ce, &revs->prune_data, revs->ps_matched))
continue;
if (revs->diffopt.prefix &&
@@ -141,7 +163,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
memset(&(dpath->parent[0]), 0,
sizeof(struct combine_diff_parent)*5);
- changed = check_removed(istate, ce, &st);
+ changed = check_removed(ce, &st);
if (!changed)
wt_mode = ce_mode_from_stat(ce, st.st_mode);
else {
@@ -221,7 +243,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
} else {
struct stat st;
- changed = check_removed(istate, ce, &st);
+ changed = check_removed(ce, &st);
if (changed) {
if (changed < 0) {
perror(ce->name);
@@ -264,7 +286,6 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
diffcore_std(&revs->diffopt);
diff_flush(&revs->diffopt);
trace_performance_since(start, "diff-files");
- return 0;
}
/*
@@ -296,7 +317,7 @@ static int get_stat_data(const struct index_state *istate,
if (!cached && !ce_uptodate(ce)) {
int changed;
struct stat st;
- changed = check_removed(istate, ce, &st);
+ changed = check_removed(ce, &st);
if (changed < 0)
return -1;
else if (changed) {
@@ -466,6 +487,11 @@ static void do_oneway_diff(struct unpack_trees_options *o,
* Something removed from the tree?
*/
if (!idx) {
+ if (S_ISSPARSEDIR(tree->ce_mode)) {
+ diff_tree_oid(&tree->oid, NULL, tree->name, &revs->diffopt);
+ return;
+ }
+
diff_index_show_file(revs, "-", tree, &tree->oid, 1,
tree->ce_mode, 0);
return;
@@ -545,7 +571,7 @@ static int diff_cache(struct rev_info *revs,
opts.pathspec = &revs->diffopt.pathspec;
opts.pathspec->recursive = 1;
- init_tree_desc(&t, tree->buffer, tree->size);
+ init_tree_desc(&t, &tree->object.oid, tree->buffer, tree->size);
return unpack_trees(1, &t, &opts);
}
@@ -553,14 +579,12 @@ void diff_get_merge_base(const struct rev_info *revs, struct object_id *mb)
{
int i;
struct commit *mb_child[2] = {0};
- struct commit_list *merge_bases;
+ struct commit_list *merge_bases = NULL;
for (i = 0; i < revs->pending.nr; i++) {
struct object *obj = revs->pending.objects[i].item;
if (obj->flags)
die(_("--merge-base does not work with ranges"));
- if (obj->type != OBJ_COMMIT)
- die(_("--merge-base only works with commits"));
}
/*
@@ -576,13 +600,14 @@ void diff_get_merge_base(const struct rev_info *revs, struct object_id *mb)
if (revs->pending.nr == 1) {
struct object_id oid;
- if (get_oid("HEAD", &oid))
+ if (repo_get_oid(the_repository, "HEAD", &oid))
die(_("unable to get HEAD"));
mb_child[1] = lookup_commit_reference(the_repository, &oid);
}
- merge_bases = repo_get_merge_bases(the_repository, mb_child[0], mb_child[1]);
+ if (repo_get_merge_bases(the_repository, mb_child[0], mb_child[1], &merge_bases) < 0)
+ exit(128);
if (!merge_bases)
die(_("no merge base found"));
if (merge_bases->next)
@@ -593,7 +618,7 @@ void diff_get_merge_base(const struct rev_info *revs, struct object_id *mb)
free_commit_list(merge_bases);
}
-int run_diff_index(struct rev_info *revs, unsigned int option)
+void run_diff_index(struct rev_info *revs, unsigned int option)
{
struct object_array_entry *ent;
int cached = !!(option & DIFF_INDEX_CACHED);
@@ -627,7 +652,6 @@ int run_diff_index(struct rev_info *revs, unsigned int option)
diffcore_std(&revs->diffopt);
diff_flush(&revs->diffopt);
trace_performance_leave("diff-index");
- return 0;
}
int do_diff_cache(const struct object_id *tree_oid, struct diff_options *opt)
@@ -659,16 +683,23 @@ int index_differs_from(struct repository *r,
setup_revisions(0, NULL, &rev, &opt);
rev.diffopt.flags.quick = 1;
rev.diffopt.flags.exit_with_status = 1;
- if (flags)
+ if (flags) {
diff_flags_or(&rev.diffopt.flags, flags);
+ /*
+ * Now that flags are merged, honor override_submodule_config
+ * and ignore_submodules from passed flags.
+ */
+ if (flags->override_submodule_config)
+ rev.diffopt.flags.ignore_submodules = flags->ignore_submodules;
+ }
rev.diffopt.ita_invisible_in_index = ita_invisible_in_index;
- run_diff_index(&rev, 1);
+ run_diff_index(&rev, DIFF_INDEX_CACHED);
has_changes = rev.diffopt.flags.has_changes;
release_revisions(&rev);
return (has_changes != 0);
}
-static struct strbuf *idiff_prefix_cb(struct diff_options *opt, void *data)
+static struct strbuf *idiff_prefix_cb(struct diff_options *opt UNUSED, void *data)
{
return data;
}
diff --git a/diff-merges.c b/diff-merges.c
index 7f64156..4550758 100644
--- a/diff-merges.c
+++ b/diff-merges.c
@@ -1,5 +1,7 @@
+#include "git-compat-util.h"
#include "diff-merges.h"
+#include "gettext.h"
#include "revision.h"
typedef void (*diff_merges_setup_func_t)(struct rev_info *);
@@ -20,9 +22,20 @@ static void suppress(struct rev_info *revs)
revs->remerge_diff = 0;
}
-static void set_separate(struct rev_info *revs)
+static void common_setup(struct rev_info *revs)
+{
+ suppress(revs);
+ revs->merges_need_diff = 1;
+}
+
+static void set_none(struct rev_info *revs)
{
suppress(revs);
+}
+
+static void set_separate(struct rev_info *revs)
+{
+ common_setup(revs);
revs->separate_merges = 1;
revs->simplify_history = 0;
}
@@ -35,21 +48,21 @@ static void set_first_parent(struct rev_info *revs)
static void set_combined(struct rev_info *revs)
{
- suppress(revs);
+ common_setup(revs);
revs->combine_merges = 1;
revs->dense_combined_merges = 0;
}
static void set_dense_combined(struct rev_info *revs)
{
- suppress(revs);
+ common_setup(revs);
revs->combine_merges = 1;
revs->dense_combined_merges = 1;
}
static void set_remerge_diff(struct rev_info *revs)
{
- suppress(revs);
+ common_setup(revs);
revs->remerge_diff = 1;
revs->simplify_history = 0;
}
@@ -57,18 +70,18 @@ static void set_remerge_diff(struct rev_info *revs)
static diff_merges_setup_func_t func_by_opt(const char *optarg)
{
if (!strcmp(optarg, "off") || !strcmp(optarg, "none"))
- return suppress;
+ return set_none;
if (!strcmp(optarg, "1") || !strcmp(optarg, "first-parent"))
return set_first_parent;
- else if (!strcmp(optarg, "separate"))
+ if (!strcmp(optarg, "separate"))
return set_separate;
- else if (!strcmp(optarg, "c") || !strcmp(optarg, "combined"))
+ if (!strcmp(optarg, "c") || !strcmp(optarg, "combined"))
return set_combined;
- else if (!strcmp(optarg, "cc") || !strcmp(optarg, "dense-combined"))
+ if (!strcmp(optarg, "cc") || !strcmp(optarg, "dense-combined"))
return set_dense_combined;
- else if (!strcmp(optarg, "r") || !strcmp(optarg, "remerge"))
+ if (!strcmp(optarg, "r") || !strcmp(optarg, "remerge"))
return set_remerge_diff;
- else if (!strcmp(optarg, "m") || !strcmp(optarg, "on"))
+ if (!strcmp(optarg, "m") || !strcmp(optarg, "on"))
return set_to_default;
return NULL;
}
@@ -81,10 +94,6 @@ static void set_diff_merges(struct rev_info *revs, const char *optarg)
die(_("invalid value for '%s': '%s'"), "--diff-merges", optarg);
func(revs);
-
- /* NOTE: the merges_need_diff flag is cleared by func() call */
- if (func != suppress)
- revs->merges_need_diff = 1;
}
/*
@@ -115,17 +124,21 @@ int diff_merges_parse_opts(struct rev_info *revs, const char **argv)
if (!suppress_m_parsing && !strcmp(arg, "-m")) {
set_to_default(revs);
+ revs->merges_need_diff = 0;
} else if (!strcmp(arg, "-c")) {
set_combined(revs);
revs->merges_imply_patch = 1;
} else if (!strcmp(arg, "--cc")) {
set_dense_combined(revs);
revs->merges_imply_patch = 1;
+ } else if (!strcmp(arg, "--dd")) {
+ set_first_parent(revs);
+ revs->merges_imply_patch = 1;
} else if (!strcmp(arg, "--remerge-diff")) {
set_remerge_diff(revs);
revs->merges_imply_patch = 1;
} else if (!strcmp(arg, "--no-diff-merges")) {
- suppress(revs);
+ set_none(revs);
} else if (!strcmp(arg, "--combined-all-paths")) {
revs->combined_all_paths = 1;
} else if ((argcount = parse_long_opt("diff-merges", argv, &optarg))) {
@@ -139,7 +152,7 @@ int diff_merges_parse_opts(struct rev_info *revs, const char **argv)
void diff_merges_suppress(struct rev_info *revs)
{
- suppress(revs);
+ set_none(revs);
}
void diff_merges_default_to_first_parent(struct rev_info *revs)
diff --git a/diff-no-index.c b/diff-no-index.c
index 9a8b093..3a89656 100644
--- a/diff-no-index.c
+++ b/diff-no-index.c
@@ -4,16 +4,14 @@
* Copyright (c) 2008 by Junio C Hamano
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
#include "color.h"
#include "commit.h"
-#include "blob.h"
-#include "tag.h"
#include "diff.h"
#include "diffcore.h"
+#include "gettext.h"
#include "revision.h"
-#include "log-tree.h"
-#include "builtin.h"
#include "parse-options.h"
#include "string-list.h"
#include "dir.h"
@@ -40,42 +38,81 @@ static int read_directory_contents(const char *path, struct string_list *list)
*/
static const char file_from_standard_input[] = "-";
-static int get_mode(const char *path, int *mode)
+/*
+ * For paths given on the command-line we treat "-" as stdin and named
+ * pipes and symbolic links to named pipes specially.
+ */
+enum special {
+ SPECIAL_NONE,
+ SPECIAL_STDIN,
+ SPECIAL_PIPE,
+};
+
+static int get_mode(const char *path, int *mode, enum special *special)
{
struct stat st;
- if (!path || !strcmp(path, "/dev/null"))
+ if (!path || !strcmp(path, "/dev/null")) {
*mode = 0;
#ifdef GIT_WINDOWS_NATIVE
- else if (!strcasecmp(path, "nul"))
+ } else if (!strcasecmp(path, "nul")) {
*mode = 0;
#endif
- else if (path == file_from_standard_input)
+ } else if (path == file_from_standard_input) {
*mode = create_ce_mode(0666);
- else if (lstat(path, &st))
+ *special = SPECIAL_STDIN;
+ } else if (lstat(path, &st)) {
return error("Could not access '%s'", path);
- else
+ } else {
*mode = st.st_mode;
+ }
+ /*
+ * For paths on the command-line treat named pipes and symbolic
+ * links that resolve to a named pipe specially.
+ */
+ if (special &&
+ (S_ISFIFO(*mode) ||
+ (S_ISLNK(*mode) && !stat(path, &st) && S_ISFIFO(st.st_mode)))) {
+ *mode = create_ce_mode(0666);
+ *special = SPECIAL_PIPE;
+ }
+
return 0;
}
-static int populate_from_stdin(struct diff_filespec *s)
+static void populate_common(struct diff_filespec *s, struct strbuf *buf)
{
- struct strbuf buf = STRBUF_INIT;
size_t size = 0;
- if (strbuf_read(&buf, 0, 0) < 0)
- return error_errno("error while reading from stdin");
-
s->should_munmap = 0;
- s->data = strbuf_detach(&buf, &size);
+ s->data = strbuf_detach(buf, &size);
s->size = size;
s->should_free = 1;
s->is_stdin = 1;
- return 0;
}
-static struct diff_filespec *noindex_filespec(const char *name, int mode)
+static void populate_from_pipe(struct diff_filespec *s)
+{
+ struct strbuf buf = STRBUF_INIT;
+ int fd = xopen(s->path, O_RDONLY);
+
+ if (strbuf_read(&buf, fd, 0) < 0)
+ die_errno("error while reading from '%s'", s->path);
+ close(fd);
+ populate_common(s, &buf);
+}
+
+static void populate_from_stdin(struct diff_filespec *s)
+{
+ struct strbuf buf = STRBUF_INIT;
+
+ if (strbuf_read(&buf, 0, 0) < 0)
+ die_errno("error while reading from stdin");
+ populate_common(s, &buf);
+}
+
+static struct diff_filespec *noindex_filespec(const char *name, int mode,
+ enum special special)
{
struct diff_filespec *s;
@@ -83,17 +120,22 @@ static struct diff_filespec *noindex_filespec(const char *name, int mode)
name = "/dev/null";
s = alloc_filespec(name);
fill_filespec(s, null_oid(), 0, mode);
- if (name == file_from_standard_input)
+ if (special == SPECIAL_STDIN)
populate_from_stdin(s);
+ else if (special == SPECIAL_PIPE)
+ populate_from_pipe(s);
return s;
}
static int queue_diff(struct diff_options *o,
- const char *name1, const char *name2)
+ const char *name1, const char *name2, int recursing)
{
int mode1 = 0, mode2 = 0;
+ enum special special1 = SPECIAL_NONE, special2 = SPECIAL_NONE;
- if (get_mode(name1, &mode1) || get_mode(name2, &mode2))
+ /* Paths can only be special if we're not recursing. */
+ if (get_mode(name1, &mode1, recursing ? NULL : &special1) ||
+ get_mode(name2, &mode2, recursing ? NULL : &special2))
return -1;
if (mode1 && mode2 && S_ISDIR(mode1) != S_ISDIR(mode2)) {
@@ -101,14 +143,14 @@ static int queue_diff(struct diff_options *o,
if (S_ISDIR(mode1)) {
/* 2 is file that is created */
- d1 = noindex_filespec(NULL, 0);
- d2 = noindex_filespec(name2, mode2);
+ d1 = noindex_filespec(NULL, 0, SPECIAL_NONE);
+ d2 = noindex_filespec(name2, mode2, special2);
name2 = NULL;
mode2 = 0;
} else {
/* 1 is file that is deleted */
- d1 = noindex_filespec(name1, mode1);
- d2 = noindex_filespec(NULL, 0);
+ d1 = noindex_filespec(name1, mode1, special1);
+ d2 = noindex_filespec(NULL, 0, SPECIAL_NONE);
name1 = NULL;
mode1 = 0;
}
@@ -173,7 +215,7 @@ static int queue_diff(struct diff_options *o,
n2 = buffer2.buf;
}
- ret = queue_diff(o, n1, n2);
+ ret = queue_diff(o, n1, n2, 1);
}
string_list_clear(&p1, 0);
string_list_clear(&p2, 0);
@@ -187,10 +229,11 @@ static int queue_diff(struct diff_options *o,
if (o->flags.reverse_diff) {
SWAP(mode1, mode2);
SWAP(name1, name2);
+ SWAP(special1, special2);
}
- d1 = noindex_filespec(name1, mode1);
- d2 = noindex_filespec(name2, mode2);
+ d1 = noindex_filespec(name1, mode1, special1);
+ d2 = noindex_filespec(name2, mode2, special2);
diff_queue(&diff_queued_diff, d1, d2);
return 0;
}
@@ -215,13 +258,27 @@ static void append_basename(struct strbuf *path, const char *dir, const char *fi
*/
static void fixup_paths(const char **path, struct strbuf *replacement)
{
- unsigned int isdir0, isdir1;
+ struct stat st;
+ unsigned int isdir0 = 0, isdir1 = 0;
+ unsigned int ispipe0 = 0, ispipe1 = 0;
+
+ if (path[0] != file_from_standard_input && !stat(path[0], &st)) {
+ isdir0 = S_ISDIR(st.st_mode);
+ ispipe0 = S_ISFIFO(st.st_mode);
+ }
+
+ if (path[1] != file_from_standard_input && !stat(path[1], &st)) {
+ isdir1 = S_ISDIR(st.st_mode);
+ ispipe1 = S_ISFIFO(st.st_mode);
+ }
+
+ if ((path[0] == file_from_standard_input && isdir1) ||
+ (isdir0 && path[1] == file_from_standard_input))
+ die(_("cannot compare stdin to a directory"));
+
+ if ((isdir0 && ispipe1) || (ispipe0 && isdir1))
+ die(_("cannot compare a named pipe to a directory"));
- if (path[0] == file_from_standard_input ||
- path[1] == file_from_standard_input)
- return;
- isdir0 = is_directory(path[0]);
- isdir1 = is_directory(path[1]);
if (isdir0 == isdir1)
return;
if (isdir0) {
@@ -243,7 +300,9 @@ int diff_no_index(struct rev_info *revs,
int argc, const char **argv)
{
int i, no_index;
+ int ret = 1;
const char *paths[2];
+ char *to_free[ARRAY_SIZE(paths)] = { 0 };
struct strbuf replacement = STRBUF_INIT;
const char *prefix = revs->prefix;
struct option no_index_options[] = {
@@ -253,8 +312,7 @@ int diff_no_index(struct rev_info *revs,
};
struct option *options;
- options = parse_options_concat(no_index_options,
- revs->diffopt.parseopts);
+ options = add_diff_options(no_index_options, &revs->diffopt);
argc = parse_options(argc, argv, revs->prefix, options,
diff_no_index_usage, 0);
if (argc != 2) {
@@ -265,7 +323,7 @@ int diff_no_index(struct rev_info *revs,
}
FREE_AND_NULL(options);
for (i = 0; i < 2; i++) {
- const char *p = argv[argc - 2 + i];
+ const char *p = argv[i];
if (!strcmp(p, "-"))
/*
* stdin should be spelled as "-"; if you have
@@ -273,7 +331,7 @@ int diff_no_index(struct rev_info *revs,
*/
p = file_from_standard_input;
else if (prefix)
- p = prefix_filename(prefix, p);
+ p = to_free[i] = prefix_filename(prefix, p);
paths[i] = p;
}
@@ -294,17 +352,21 @@ int diff_no_index(struct rev_info *revs,
setup_diff_pager(&revs->diffopt);
revs->diffopt.flags.exit_with_status = 1;
- if (queue_diff(&revs->diffopt, paths[0], paths[1]))
- return 1;
+ if (queue_diff(&revs->diffopt, paths[0], paths[1], 0))
+ goto out;
diff_set_mnemonic_prefix(&revs->diffopt, "1/", "2/");
diffcore_std(&revs->diffopt);
diff_flush(&revs->diffopt);
- strbuf_release(&replacement);
-
/*
* The return code for --no-index imitates diff(1):
* 0 = no changes, 1 = changes, else error
*/
- return diff_result_code(&revs->diffopt, 0);
+ ret = diff_result_code(&revs->diffopt);
+
+out:
+ for (i = 0; i < ARRAY_SIZE(to_free); i++)
+ free(to_free[i]);
+ strbuf_release(&replacement);
+ return ret;
}
diff --git a/diff.c b/diff.c
index e71cf75..108c187 100644
--- a/diff.c
+++ b/diff.c
@@ -1,34 +1,45 @@
/*
* Copyright (C) 2005 Junio C Hamano
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "base85.h"
#include "config.h"
+#include "convert.h"
+#include "environment.h"
+#include "gettext.h"
#include "tempfile.h"
#include "quote.h"
#include "diff.h"
#include "diffcore.h"
#include "delta.h"
+#include "hex.h"
#include "xdiff-interface.h"
#include "color.h"
-#include "attr.h"
#include "run-command.h"
#include "utf8.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "userdiff.h"
-#include "submodule-config.h"
#include "submodule.h"
#include "hashmap.h"
#include "mem-pool.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
#include "string-list.h"
#include "strvec.h"
#include "graph.h"
+#include "oid-array.h"
#include "packfile.h"
+#include "pager.h"
#include "parse-options.h"
#include "help.h"
#include "promisor-remote.h"
#include "dir.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "read-cache-ll.h"
+#include "setup.h"
#include "strmap.h"
+#include "ws.h"
#ifdef NO_FAST_WORKING_DIRECTORY
#define FAST_WORKING_DIRECTORY 0
@@ -51,7 +62,10 @@ static const char *diff_order_file_cfg;
int diff_auto_refresh_index = 1;
static int diff_mnemonic_prefix;
static int diff_no_prefix;
+static const char *diff_src_prefix = "a/";
+static const char *diff_dst_prefix = "b/";
static int diff_relative;
+static int diff_stat_name_width;
static int diff_stat_graph_width;
static int diff_dirstat_permille_default = 30;
static struct diff_options default_diff_options;
@@ -127,7 +141,7 @@ static int parse_dirstat_params(struct diff_options *options, const char *params
int i;
if (*params_copy)
- string_list_split_in_place(&params, params_copy, ',', -1);
+ string_list_split_in_place(&params, params_copy, ",", -1);
for (i = 0; i < params.nr; i++) {
const char *p = params.items[i].string;
if (!strcmp(p, "changes")) {
@@ -264,7 +278,8 @@ void init_diff_ui_defaults(void)
diff_detect_rename_default = DIFF_DETECT_RENAME;
}
-int git_diff_heuristic_config(const char *var, const char *value, void *cb)
+int git_diff_heuristic_config(const char *var, const char *value,
+ void *cb UNUSED)
{
if (!strcmp(var, "diff.indentheuristic"))
diff_indent_heuristic = git_config_bool(var, value);
@@ -342,7 +357,8 @@ static unsigned parse_color_moved_ws(const char *arg)
return ret;
}
-int git_diff_ui_config(const char *var, const char *value, void *cb)
+int git_diff_ui_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
diff_use_color_default = git_config_colorbool(var, value);
@@ -356,20 +372,24 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
return 0;
}
if (!strcmp(var, "diff.colormovedws")) {
- unsigned cm = parse_color_moved_ws(value);
+ unsigned cm;
+ if (!value)
+ return config_error_nonbool(var);
+ cm = parse_color_moved_ws(value);
if (cm & COLOR_MOVED_WS_ERROR)
return -1;
diff_color_moved_ws_default = cm;
return 0;
}
if (!strcmp(var, "diff.context")) {
- diff_context_default = git_config_int(var, value);
+ diff_context_default = git_config_int(var, value, ctx->kvi);
if (diff_context_default < 0)
return -1;
return 0;
}
if (!strcmp(var, "diff.interhunkcontext")) {
- diff_interhunk_context_default = git_config_int(var, value);
+ diff_interhunk_context_default = git_config_int(var, value,
+ ctx->kvi);
if (diff_interhunk_context_default < 0)
return -1;
return 0;
@@ -390,12 +410,22 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
diff_no_prefix = git_config_bool(var, value);
return 0;
}
+ if (!strcmp(var, "diff.srcprefix")) {
+ return git_config_string(&diff_src_prefix, var, value);
+ }
+ if (!strcmp(var, "diff.dstprefix")) {
+ return git_config_string(&diff_dst_prefix, var, value);
+ }
if (!strcmp(var, "diff.relative")) {
diff_relative = git_config_bool(var, value);
return 0;
}
+ if (!strcmp(var, "diff.statnamewidth")) {
+ diff_stat_name_width = git_config_int(var, value, ctx->kvi);
+ return 0;
+ }
if (!strcmp(var, "diff.statgraphwidth")) {
- diff_stat_graph_width = git_config_int(var, value);
+ diff_stat_graph_width = git_config_int(var, value, ctx->kvi);
return 0;
}
if (!strcmp(var, "diff.external"))
@@ -405,10 +435,15 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
if (!strcmp(var, "diff.orderfile"))
return git_config_pathname(&diff_order_file_cfg, var, value);
- if (!strcmp(var, "diff.ignoresubmodules"))
+ if (!strcmp(var, "diff.ignoresubmodules")) {
+ if (!value)
+ return config_error_nonbool(var);
handle_ignore_submodules_arg(&default_diff_options, value);
+ }
if (!strcmp(var, "diff.submodule")) {
+ if (!value)
+ return config_error_nonbool(var);
if (parse_submodule_params(&default_diff_options, value))
warning(_("Unknown value for 'diff.submodule' config variable: '%s'"),
value);
@@ -416,24 +451,28 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
}
if (!strcmp(var, "diff.algorithm")) {
+ if (!value)
+ return config_error_nonbool(var);
diff_algorithm = parse_algorithm_value(value);
if (diff_algorithm < 0)
- return -1;
+ return error(_("unknown value for config '%s': %s"),
+ var, value);
return 0;
}
if (git_color_config(var, value, cb) < 0)
return -1;
- return git_diff_basic_config(var, value, cb);
+ return git_diff_basic_config(var, value, ctx, cb);
}
-int git_diff_basic_config(const char *var, const char *value, void *cb)
+int git_diff_basic_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
const char *name;
if (!strcmp(var, "diff.renamelimit")) {
- diff_rename_limit_default = git_config_int(var, value);
+ diff_rename_limit_default = git_config_int(var, value, ctx->kvi);
return 0;
}
@@ -451,9 +490,13 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
}
if (!strcmp(var, "diff.wserrorhighlight")) {
- int val = parse_ws_error_highlight(value);
+ int val;
+ if (!value)
+ return config_error_nonbool(var);
+ val = parse_ws_error_highlight(value);
if (val < 0)
- return -1;
+ return error(_("unknown value for config '%s': %s"),
+ var, value);
ws_error_highlight_default = val;
return 0;
}
@@ -468,6 +511,8 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
if (!strcmp(var, "diff.dirstat")) {
struct strbuf errmsg = STRBUF_INIT;
+ if (!value)
+ return config_error_nonbool(var);
default_diff_options.dirstat_permille = diff_dirstat_permille_default;
if (parse_dirstat_params(&default_diff_options, value, &errmsg))
warning(_("Found errors in 'diff.dirstat' config variable:\n%s"),
@@ -480,7 +525,7 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
if (git_diff_heuristic_config(var, value, cb) < 0)
return -1;
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
static char *quote_two(const char *one, const char *two)
@@ -603,7 +648,7 @@ static unsigned long diff_filespec_size(struct repository *r,
return one->size;
}
-static int count_trailing_blank(mmfile_t *mf, unsigned ws_rule)
+static int count_trailing_blank(mmfile_t *mf)
{
char *ptr = mf->ptr;
long size = mf->size;
@@ -621,7 +666,7 @@ static int count_trailing_blank(mmfile_t *mf, unsigned ws_rule)
for (prev_eol = ptr; mf->ptr <= prev_eol; prev_eol--)
if (*prev_eol == '\n')
break;
- if (!ws_blank_line(prev_eol + 1, ptr - prev_eol, ws_rule))
+ if (!ws_blank_line(prev_eol + 1, ptr - prev_eol))
break;
cnt++;
ptr = prev_eol - 1;
@@ -633,9 +678,8 @@ static void check_blank_at_eof(mmfile_t *mf1, mmfile_t *mf2,
struct emit_callback *ecbdata)
{
int l1, l2, at;
- unsigned ws_rule = ecbdata->ws_rule;
- l1 = count_trailing_blank(mf1, ws_rule);
- l2 = count_trailing_blank(mf2, ws_rule);
+ l1 = count_trailing_blank(mf1);
+ l2 = count_trailing_blank(mf2);
if (l2 <= l1) {
ecbdata->blank_at_eof_in_preimage = 0;
ecbdata->blank_at_eof_in_postimage = 0;
@@ -916,7 +960,7 @@ struct interned_diff_symbol {
static int interned_diff_symbol_cmp(const void *hashmap_cmp_fn_data,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
- const void *keydata)
+ const void *keydata UNUSED)
{
const struct diff_options *diffopt = hashmap_cmp_fn_data;
const struct emitted_diff_symbol *a, *b;
@@ -1289,7 +1333,6 @@ static void emit_diff_symbol_from_struct(struct diff_options *o,
{
static const char *nneof = " No newline at end of file\n";
const char *context, *reset, *set, *set_sign, *meta, *fraginfo;
- struct strbuf sb = STRBUF_INIT;
enum diff_symbol s = eds->s;
const char *line = eds->line;
@@ -1521,7 +1564,6 @@ static void emit_diff_symbol_from_struct(struct diff_options *o,
default:
BUG("unknown diff symbol");
}
- strbuf_release(&sb);
}
static void emit_diff_symbol(struct diff_options *o, enum diff_symbol s,
@@ -1584,7 +1626,7 @@ static int new_blank_line_at_eof(struct emit_callback *ecbdata, const char *line
ecbdata->blank_at_eof_in_preimage <= ecbdata->lno_in_preimage &&
ecbdata->blank_at_eof_in_postimage <= ecbdata->lno_in_postimage))
return 0;
- return ws_blank_line(line, len, ecbdata->ws_rule);
+ return ws_blank_line(line, len);
}
static void emit_add_line(struct emit_callback *ecbdata,
@@ -1956,7 +1998,7 @@ static int color_words_output_graph_prefix(struct diff_words_data *diff_words)
static void fn_out_diff_words_aux(void *priv,
long minus_first, long minus_len,
long plus_first, long plus_len,
- const char *func, long funclen)
+ const char *func UNUSED, long funclen UNUSED)
{
struct diff_words_data *diff_words = priv;
struct diff_words_style *style = diff_words->style;
@@ -2489,6 +2531,9 @@ static int diffstat_consume(void *priv, char *line, unsigned long len)
struct diffstat_t *diffstat = priv;
struct diffstat_file *x = diffstat->files[diffstat->nr - 1];
+ if (!len)
+ BUG("xdiff fed us an empty line");
+
if (line[0] == '+')
x->added++;
else if (line[0] == '-')
@@ -2622,7 +2667,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
continue;
}
fill_print_name(file);
- len = strlen(file->print_name);
+ len = utf8_strwidth(file->print_name);
if (max_len < len)
max_len = len;
@@ -2675,6 +2720,11 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
* making the line longer than the maximum width.
*/
+ /*
+ * NEEDSWORK: line_prefix is often used for "log --graph" output
+ * and contains ANSI-colored string. utf8_strnwidth() should be
+ * used to correctly count the display width instead of strlen().
+ */
if (options->stat_width == -1)
width = term_columns() - strlen(line_prefix);
else
@@ -2682,12 +2732,14 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
number_width = decimal_width(max_change) > number_width ?
decimal_width(max_change) : number_width;
+ if (options->stat_name_width == -1)
+ options->stat_name_width = diff_stat_name_width;
if (options->stat_graph_width == -1)
options->stat_graph_width = diff_stat_graph_width;
/*
- * Guarantee 3/8*16==6 for the graph part
- * and 5/8*16==10 for the filename part
+ * Guarantee 3/8*16 == 6 for the graph part
+ * and 5/8*16 == 10 for the filename part
*/
if (width < 16 + 6 + number_width)
width = 16 + 6 + number_width;
@@ -2736,7 +2788,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
char *name = file->print_name;
uintmax_t added = file->added;
uintmax_t deleted = file->deleted;
- int name_len;
+ int name_len, padding;
if (!file->is_interesting && (added + deleted == 0))
continue;
@@ -2745,20 +2797,34 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
* "scale" the filename
*/
len = name_width;
- name_len = strlen(name);
+ name_len = utf8_strwidth(name);
if (name_width < name_len) {
char *slash;
prefix = "...";
len -= 3;
+ /*
+ * NEEDSWORK: (name_len - len) counts the display
+ * width, which would be shorter than the byte
+ * length of the corresponding substring.
+ * Advancing "name" by that number of bytes does
+ * *NOT* skip over that many columns, so it is
+ * very likely that chomping the pathname at the
+ * slash we will find starting from "name" will
+ * leave the resulting string still too long.
+ */
name += name_len - len;
slash = strchr(name, '/');
if (slash)
name = slash;
}
+ padding = len - utf8_strwidth(name);
+ if (padding < 0)
+ padding = 0;
if (file->is_binary) {
- strbuf_addf(&out, " %s%-*s |", prefix, len, name);
- strbuf_addf(&out, " %*s", number_width, "Bin");
+ strbuf_addf(&out, " %s%s%*s | %*s",
+ prefix, name, padding, "",
+ number_width, "Bin");
if (!added && !deleted) {
strbuf_addch(&out, '\n');
emit_diff_symbol(options, DIFF_SYMBOL_STATS_LINE,
@@ -2778,8 +2844,9 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
continue;
}
else if (file->is_unmerged) {
- strbuf_addf(&out, " %s%-*s |", prefix, len, name);
- strbuf_addstr(&out, " Unmerged\n");
+ strbuf_addf(&out, " %s%s%*s | %*s",
+ prefix, name, padding, "",
+ number_width, "Unmerged\n");
emit_diff_symbol(options, DIFF_SYMBOL_STATS_LINE,
out.buf, out.len, 0);
strbuf_reset(&out);
@@ -2805,10 +2872,10 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
add = total - del;
}
}
- strbuf_addf(&out, " %s%-*s |", prefix, len, name);
- strbuf_addf(&out, " %*"PRIuMAX"%s",
- number_width, added + deleted,
- added + deleted ? " " : "");
+ strbuf_addf(&out, " %s%s%*s | %*"PRIuMAX"%s",
+ prefix, name, padding, "",
+ number_width, added + deleted,
+ added + deleted ? " " : "");
show_graph(&out, '+', add, add_c, reset);
show_graph(&out, '-', del, del_c, reset);
strbuf_addch(&out, '\n');
@@ -2972,6 +3039,24 @@ static int dirstat_compare(const void *_a, const void *_b)
return strcmp(a->name, b->name);
}
+static void conclude_dirstat(struct diff_options *options,
+ struct dirstat_dir *dir,
+ unsigned long changed)
+{
+ struct dirstat_file *to_free = dir->files;
+
+ if (!changed) {
+ /* This can happen even with many files, if everything was renames */
+ ;
+ } else {
+ /* Show all directories with more than x% of the changes */
+ QSORT(dir->files, dir->nr, dirstat_compare);
+ gather_dirstat(options, dir, changed, "", 0);
+ }
+
+ free(to_free);
+}
+
static void show_dirstat(struct diff_options *options)
{
int i;
@@ -3061,13 +3146,7 @@ found_damage:
dir.nr++;
}
- /* This can happen even with many files, if everything was renames */
- if (!changed)
- return;
-
- /* Show all directories with more than x% of the changes */
- QSORT(dir.files, dir.nr, dirstat_compare);
- gather_dirstat(options, &dir, changed, "", 0);
+ conclude_dirstat(options, &dir, changed);
}
static void show_dirstat_by_line(struct diffstat_t *data, struct diff_options *options)
@@ -3105,13 +3184,7 @@ static void show_dirstat_by_line(struct diffstat_t *data, struct diff_options *o
dir.nr++;
}
- /* This can happen even with many files, if everything was renames */
- if (!changed)
- return;
-
- /* Show all directories with more than x% of the changes */
- QSORT(dir.files, dir.nr, dirstat_compare);
- gather_dirstat(options, &dir, changed, "", 0);
+ conclude_dirstat(options, &dir, changed);
}
static void free_diffstat_file(struct diffstat_file *f)
@@ -3163,8 +3236,9 @@ static int is_conflict_marker(const char *line, int marker_size, unsigned long l
}
static void checkdiff_consume_hunk(void *priv,
- long ob, long on, long nb, long nn,
- const char *func, long funclen)
+ long ob UNUSED, long on UNUSED,
+ long nb, long nn UNUSED,
+ const char *func UNUSED, long funclen UNUSED)
{
struct checkdiff_t *data = priv;
@@ -3352,6 +3426,17 @@ void diff_set_mnemonic_prefix(struct diff_options *options, const char *a, const
options->b_prefix = b;
}
+void diff_set_noprefix(struct diff_options *options)
+{
+ options->a_prefix = options->b_prefix = "";
+}
+
+void diff_set_default_prefix(struct diff_options *options)
+{
+ options->a_prefix = diff_src_prefix;
+ options->b_prefix = diff_dst_prefix;
+}
+
struct userdiff_driver *get_textconv(struct repository *r,
struct diff_filespec *one)
{
@@ -3362,23 +3447,23 @@ struct userdiff_driver *get_textconv(struct repository *r,
return userdiff_get_textconv(r, one->driver);
}
-static struct strbuf *additional_headers(struct diff_options *o,
- const char *path)
+static struct string_list *additional_headers(struct diff_options *o,
+ const char *path)
{
if (!o->additional_path_headers)
return NULL;
return strmap_get(o->additional_path_headers, path);
}
-static void add_formatted_headers(struct strbuf *msg,
- struct strbuf *more_headers,
+static void add_formatted_header(struct strbuf *msg,
+ const char *header,
const char *line_prefix,
const char *meta,
const char *reset)
{
- char *next, *newline;
+ const char *next, *newline;
- for (next = more_headers->buf; *next; next = newline) {
+ for (next = header; *next; next = newline) {
newline = strchrnul(next, '\n');
strbuf_addf(msg, "%s%s%.*s%s\n", line_prefix, meta,
(int)(newline - next), next, reset);
@@ -3387,6 +3472,50 @@ static void add_formatted_headers(struct strbuf *msg,
}
}
+static void add_formatted_headers(struct strbuf *msg,
+ struct string_list *more_headers,
+ const char *line_prefix,
+ const char *meta,
+ const char *reset)
+{
+ int i;
+
+ for (i = 0; i < more_headers->nr; i++)
+ add_formatted_header(msg, more_headers->items[i].string,
+ line_prefix, meta, reset);
+}
+
+static int diff_filepair_is_phoney(struct diff_filespec *one,
+ struct diff_filespec *two)
+{
+ /*
+ * This function specifically looks for pairs injected by
+ * create_filepairs_for_header_only_notifications(). Such
+ * pairs are "phoney" in that they do not represent any
+ * content or even mode difference, but were inserted because
+ * diff_queued_diff previously had no pair associated with
+ * that path but we needed some pair to avoid losing the
+ * "remerge CONFLICT" header associated with the path.
+ */
+ return !DIFF_FILE_VALID(one) && !DIFF_FILE_VALID(two);
+}
+
+static int set_diff_algorithm(struct diff_options *opts,
+ const char *alg)
+{
+ long value = parse_algorithm_value(alg);
+
+ if (value < 0)
+ return -1;
+
+ /* clear out previous settings */
+ DIFF_XDL_CLR(opts, NEED_MINIMAL);
+ opts->xdl_opts &= ~XDF_DIFF_ALGORITHM_MASK;
+ opts->xdl_opts |= value;
+
+ return 0;
+}
+
static void builtin_diff(const char *name_a,
const char *name_b,
struct diff_filespec *one,
@@ -3418,14 +3547,16 @@ static void builtin_diff(const char *name_a,
if (o->submodule_format == DIFF_SUBMODULE_LOG &&
(!one->mode || S_ISGITLINK(one->mode)) &&
- (!two->mode || S_ISGITLINK(two->mode))) {
+ (!two->mode || S_ISGITLINK(two->mode)) &&
+ (!diff_filepair_is_phoney(one, two))) {
show_submodule_diff_summary(o, one->path ? one->path : two->path,
&one->oid, &two->oid,
two->dirty_submodule);
return;
} else if (o->submodule_format == DIFF_SUBMODULE_INLINE_DIFF &&
(!one->mode || S_ISGITLINK(one->mode)) &&
- (!two->mode || S_ISGITLINK(two->mode))) {
+ (!two->mode || S_ISGITLINK(two->mode)) &&
+ (!diff_filepair_is_phoney(one, two))) {
show_submodule_inline_diff(o, one->path ? one->path : two->path,
&one->oid, &two->oid,
two->dirty_submodule);
@@ -3445,12 +3576,12 @@ static void builtin_diff(const char *name_a,
b_two = quote_two(b_prefix, name_b + (*name_b == '/'));
lbl[0] = DIFF_FILE_VALID(one) ? a_one : "/dev/null";
lbl[1] = DIFF_FILE_VALID(two) ? b_two : "/dev/null";
- if (!DIFF_FILE_VALID(one) && !DIFF_FILE_VALID(two)) {
+ if (diff_filepair_is_phoney(one, two)) {
/*
- * We should only reach this point for pairs from
+ * We should only reach this point for pairs generated from
* create_filepairs_for_header_only_notifications(). For
- * these, we should avoid the "/dev/null" special casing
- * above, meaning we avoid showing such pairs as either
+ * these, we want to avoid the "/dev/null" special casing
+ * above, because we do not want such pairs shown as either
* "new file" or "deleted file" below.
*/
lbl[0] = a_one;
@@ -3462,18 +3593,21 @@ static void builtin_diff(const char *name_a,
strbuf_addf(&header, "%s%snew file mode %06o%s\n", line_prefix, meta, two->mode, reset);
if (xfrm_msg)
strbuf_addstr(&header, xfrm_msg);
+ o->found_changes = 1;
must_show_header = 1;
}
else if (lbl[1][0] == '/') {
strbuf_addf(&header, "%s%sdeleted file mode %06o%s\n", line_prefix, meta, one->mode, reset);
if (xfrm_msg)
strbuf_addstr(&header, xfrm_msg);
+ o->found_changes = 1;
must_show_header = 1;
}
else {
if (one->mode != two->mode) {
strbuf_addf(&header, "%s%sold mode %06o%s\n", line_prefix, meta, one->mode, reset);
strbuf_addf(&header, "%s%snew mode %06o%s\n", line_prefix, meta, two->mode, reset);
+ o->found_changes = 1;
must_show_header = 1;
}
if (xfrm_msg)
@@ -4161,7 +4295,6 @@ static void prep_temp_blob(struct index_state *istate,
}
static struct diff_tempfile *prepare_temp_file(struct repository *r,
- const char *name,
struct diff_filespec *one)
{
struct diff_tempfile *temp = claim_diff_tempfile();
@@ -4179,18 +4312,18 @@ static struct diff_tempfile *prepare_temp_file(struct repository *r,
if (!S_ISGITLINK(one->mode) &&
(!one->oid_valid ||
- reuse_worktree_file(r->index, name, &one->oid, 1))) {
+ reuse_worktree_file(r->index, one->path, &one->oid, 1))) {
struct stat st;
- if (lstat(name, &st) < 0) {
+ if (lstat(one->path, &st) < 0) {
if (errno == ENOENT)
goto not_a_valid_file;
- die_errno("stat(%s)", name);
+ die_errno("stat(%s)", one->path);
}
if (S_ISLNK(st.st_mode)) {
struct strbuf sb = STRBUF_INIT;
- if (strbuf_readlink(&sb, name, st.st_size) < 0)
- die_errno("readlink(%s)", name);
- prep_temp_blob(r->index, name, temp, sb.buf, sb.len,
+ if (strbuf_readlink(&sb, one->path, st.st_size) < 0)
+ die_errno("readlink(%s)", one->path);
+ prep_temp_blob(r->index, one->path, temp, sb.buf, sb.len,
(one->oid_valid ?
&one->oid : null_oid()),
(one->oid_valid ?
@@ -4199,7 +4332,7 @@ static struct diff_tempfile *prepare_temp_file(struct repository *r,
}
else {
/* we can borrow from the file in the work tree */
- temp->name = name;
+ temp->name = one->path;
if (!one->oid_valid)
oid_to_hex_r(temp->hex, null_oid());
else
@@ -4217,7 +4350,7 @@ static struct diff_tempfile *prepare_temp_file(struct repository *r,
else {
if (diff_populate_filespec(r, one, NULL))
die("cannot read data blob for %s", one->path);
- prep_temp_blob(r->index, name, temp,
+ prep_temp_blob(r->index, one->path, temp,
one->data, one->size,
&one->oid, one->mode);
}
@@ -4226,10 +4359,9 @@ static struct diff_tempfile *prepare_temp_file(struct repository *r,
static void add_external_diff_name(struct repository *r,
struct strvec *argv,
- const char *name,
struct diff_filespec *df)
{
- struct diff_tempfile *temp = prepare_temp_file(r, name, df);
+ struct diff_tempfile *temp = prepare_temp_file(r, df);
strvec_push(argv, temp->name);
strvec_push(argv, temp->hex);
strvec_push(argv, temp->mode);
@@ -4249,35 +4381,33 @@ static void run_external_diff(const char *pgm,
const char *xfrm_msg,
struct diff_options *o)
{
- struct strvec argv = STRVEC_INIT;
- struct strvec env = STRVEC_INIT;
+ struct child_process cmd = CHILD_PROCESS_INIT;
struct diff_queue_struct *q = &diff_queued_diff;
- strvec_push(&argv, pgm);
- strvec_push(&argv, name);
+ strvec_push(&cmd.args, pgm);
+ strvec_push(&cmd.args, name);
if (one && two) {
- add_external_diff_name(o->repo, &argv, name, one);
- if (!other)
- add_external_diff_name(o->repo, &argv, name, two);
- else {
- add_external_diff_name(o->repo, &argv, other, two);
- strvec_push(&argv, other);
- strvec_push(&argv, xfrm_msg);
+ add_external_diff_name(o->repo, &cmd.args, one);
+ add_external_diff_name(o->repo, &cmd.args, two);
+ if (other) {
+ strvec_push(&cmd.args, other);
+ if (xfrm_msg)
+ strvec_push(&cmd.args, xfrm_msg);
}
}
- strvec_pushf(&env, "GIT_DIFF_PATH_COUNTER=%d", ++o->diff_path_counter);
- strvec_pushf(&env, "GIT_DIFF_PATH_TOTAL=%d", q->nr);
+ strvec_pushf(&cmd.env, "GIT_DIFF_PATH_COUNTER=%d",
+ ++o->diff_path_counter);
+ strvec_pushf(&cmd.env, "GIT_DIFF_PATH_TOTAL=%d", q->nr);
diff_free_filespec_data(one);
diff_free_filespec_data(two);
- if (run_command_v_opt_cd_env(argv.v, RUN_USING_SHELL, NULL, env.v))
+ cmd.use_shell = 1;
+ if (run_command(&cmd))
die(_("external diff died, stopping at %s"), name);
remove_tempfile();
- strvec_clear(&argv);
- strvec_clear(&env);
}
static int similarity_index(struct diff_filepair *p)
@@ -4288,7 +4418,7 @@ static int similarity_index(struct diff_filepair *p)
static const char *diff_abbrev_oid(const struct object_id *oid, int abbrev)
{
if (startup_info->have_repository)
- return find_unique_abbrev(oid, abbrev);
+ return repo_find_unique_abbrev(the_repository, oid, abbrev);
else {
char *hex = oid_to_hex(oid);
if (abbrev < 0)
@@ -4314,7 +4444,7 @@ static void fill_metainfo(struct strbuf *msg,
const char *set = diff_get_color(use_color, DIFF_METAINFO);
const char *reset = diff_get_color(use_color, DIFF_RESET);
const char *line_prefix = diff_line_prefix(o);
- struct strbuf *more_headers = NULL;
+ struct string_list *more_headers = NULL;
*must_show_header = 1;
strbuf_init(msg, PATH_MAX * 2 + 300);
@@ -4393,15 +4523,13 @@ static void run_diff_cmd(const char *pgm,
const char *xfrm_msg = NULL;
int complete_rewrite = (p->status == DIFF_STATUS_MODIFIED) && p->score;
int must_show_header = 0;
+ struct userdiff_driver *drv = NULL;
-
- if (o->flags.allow_external) {
- struct userdiff_driver *drv;
-
+ if (o->flags.allow_external || !o->ignore_driver_algorithm)
drv = userdiff_find_by_path(o->repo->index, attr_path);
- if (drv && drv->external)
- pgm = drv->external;
- }
+
+ if (o->flags.allow_external && drv && drv->external)
+ pgm = drv->external;
if (msg) {
/*
@@ -4418,12 +4546,16 @@ static void run_diff_cmd(const char *pgm,
run_external_diff(pgm, name, other, one, two, xfrm_msg, o);
return;
}
- if (one && two)
+ if (one && two) {
+ if (!o->ignore_driver_algorithm && drv && drv->algorithm)
+ set_diff_algorithm(o, drv->algorithm);
+
builtin_diff(name, other ? other : name,
one, two, xfrm_msg, must_show_header,
o, complete_rewrite);
- else
+ } else {
fprintf(o->file, "* Unmerged path %s\n", name);
+ }
}
static void diff_fill_oid_info(struct diff_filespec *one, struct index_state *istate)
@@ -4520,6 +4652,14 @@ static void run_diffstat(struct diff_filepair *p, struct diff_options *o,
const char *name;
const char *other;
+ if (!o->ignore_driver_algorithm) {
+ struct userdiff_driver *drv = userdiff_find_by_path(o->repo->index,
+ p->one->path);
+
+ if (drv && drv->algorithm)
+ set_diff_algorithm(o, drv->algorithm);
+ }
+
if (DIFF_PAIR_UNMERGED(p)) {
/* unmerged */
builtin_diffstat(p->one->path, NULL, NULL, NULL,
@@ -4564,8 +4704,6 @@ static void run_checkdiff(struct diff_filepair *p, struct diff_options *o)
builtin_checkdiff(name, other, attr_path, p->one, p->two, o);
}
-static void prep_parse_options(struct diff_options *options);
-
void repo_diff_setup(struct repository *r, struct diff_options *options)
{
memcpy(options, &default_diff_options, sizeof(*options));
@@ -4603,16 +4741,13 @@ void repo_diff_setup(struct repository *r, struct diff_options *options)
options->flags.ignore_untracked_in_submodules = 1;
if (diff_no_prefix) {
- options->a_prefix = options->b_prefix = "";
+ diff_set_noprefix(options);
} else if (!diff_mnemonic_prefix) {
- options->a_prefix = "a/";
- options->b_prefix = "b/";
+ diff_set_default_prefix(options);
}
options->color_moved = diff_color_moved_default;
options->color_moved_ws_handling = diff_color_moved_ws_default;
-
- prep_parse_options(options);
}
static const char diff_status_letters[] = {
@@ -4652,6 +4787,31 @@ unsigned diff_filter_bit(char status)
return filter_bit[(int) status];
}
+int diff_check_follow_pathspec(struct pathspec *ps, int die_on_error)
+{
+ unsigned forbidden_magic;
+
+ if (ps->nr != 1) {
+ if (die_on_error)
+ die(_("--follow requires exactly one pathspec"));
+ return 0;
+ }
+
+ forbidden_magic = ps->items[0].magic & ~(PATHSPEC_FROMTOP |
+ PATHSPEC_LITERAL);
+ if (forbidden_magic) {
+ if (die_on_error) {
+ struct strbuf sb = STRBUF_INIT;
+ pathspec_magic_names(forbidden_magic, &sb);
+ die(_("pathspec magic not supported by --follow: %s"),
+ sb.buf);
+ }
+ return 0;
+ }
+
+ return 1;
+}
+
void diff_setup_done(struct diff_options *options)
{
unsigned check_mask = DIFF_FORMAT_NAME |
@@ -4706,6 +4866,10 @@ void diff_setup_done(struct diff_options *options)
else
options->prefix_length = 0;
+ /*
+ * --name-only, --name-status, --checkdiff, and -s
+ * turn other output format off.
+ */
if (options->output_format & (DIFF_FORMAT_NAME |
DIFF_FORMAT_NAME_STATUS |
DIFF_FORMAT_CHECKDIFF |
@@ -4759,8 +4923,8 @@ void diff_setup_done(struct diff_options *options)
options->diff_path_counter = 0;
- if (options->flags.follow_renames && options->pathspec.nr != 1)
- die(_("--follow requires exactly one pathspec"));
+ if (options->flags.follow_renames)
+ diff_check_follow_pathspec(&options->pathspec, 1);
if (!options->use_color || external_diff())
options->color_moved = 0;
@@ -4770,8 +4934,6 @@ void diff_setup_done(struct diff_options *options)
options->filter = ~filter_bit[DIFF_STATUS_FILTER_AON];
options->filter &= ~options->filter_not;
}
-
- FREE_AND_NULL(options->parseopts);
}
int parse_long_opt(const char *opt, const char **argv,
@@ -4839,6 +5001,7 @@ static int diff_opt_stat(const struct option *opt, const char *value, int unset)
} else
BUG("%s should not get here", opt->long_name);
+ options->output_format &= ~DIFF_FORMAT_NO_OUTPUT;
options->output_format |= DIFF_FORMAT_DIFFSTAT;
options->stat_name_width = name_width;
options->stat_graph_width = graph_width;
@@ -4858,6 +5021,7 @@ static int parse_dirstat_opt(struct diff_options *options, const char *params)
* The caller knows a dirstat-related option is given from the command
* line; allow it to say "return this_function();"
*/
+ options->output_format &= ~DIFF_FORMAT_NO_OUTPUT;
options->output_format |= DIFF_FORMAT_DIRSTAT;
return 1;
}
@@ -4921,7 +5085,7 @@ static int diff_opt_find_object(const struct option *option,
struct object_id oid;
BUG_ON_OPT_NEG(unset);
- if (get_oid(arg, &oid))
+ if (repo_get_oid(the_repository, arg, &oid))
return error(_("unable to resolve '%s'"), arg);
if (!opt->objfind)
@@ -5057,6 +5221,7 @@ static int diff_opt_compact_summary(const struct option *opt,
options->flags.stat_with_summary = 0;
} else {
options->flags.stat_with_summary = 1;
+ options->output_format &= ~DIFF_FORMAT_NO_OUTPUT;
options->output_format |= DIFF_FORMAT_DIFFSTAT;
}
return 0;
@@ -5066,17 +5231,32 @@ static int diff_opt_diff_algorithm(const struct option *opt,
const char *arg, int unset)
{
struct diff_options *options = opt->value;
- long value = parse_algorithm_value(arg);
BUG_ON_OPT_NEG(unset);
- if (value < 0)
+
+ if (set_diff_algorithm(options, arg))
return error(_("option diff-algorithm accepts \"myers\", "
"\"minimal\", \"patience\" and \"histogram\""));
- /* clear out previous settings */
- DIFF_XDL_CLR(options, NEED_MINIMAL);
- options->xdl_opts &= ~XDF_DIFF_ALGORITHM_MASK;
- options->xdl_opts |= value;
+ options->ignore_driver_algorithm = 1;
+
+ return 0;
+}
+
+static int diff_opt_diff_algorithm_no_arg(const struct option *opt,
+ const char *arg, int unset)
+{
+ struct diff_options *options = opt->value;
+
+ BUG_ON_OPT_NEG(unset);
+ BUG_ON_OPT_ARG(arg);
+
+ if (set_diff_algorithm(options, opt->long_name))
+ BUG("available diff algorithms include \"myers\", "
+ "\"minimal\", \"patience\" and \"histogram\"");
+
+ options->ignore_driver_algorithm = 1;
+
return 0;
}
@@ -5179,8 +5359,20 @@ static int diff_opt_no_prefix(const struct option *opt,
BUG_ON_OPT_NEG(unset);
BUG_ON_OPT_ARG(optarg);
- options->a_prefix = "";
- options->b_prefix = "";
+ diff_set_noprefix(options);
+ return 0;
+}
+
+static int diff_opt_default_prefix(const struct option *opt,
+ const char *optarg, int unset)
+{
+ struct diff_options *options = opt->value;
+
+ BUG_ON_OPT_NEG(unset);
+ BUG_ON_OPT_ARG(optarg);
+ diff_src_prefix = "a/";
+ diff_dst_prefix = "b/";
+ diff_set_default_prefix(options);
return 0;
}
@@ -5209,7 +5401,6 @@ static int diff_opt_patience(const struct option *opt,
BUG_ON_OPT_NEG(unset);
BUG_ON_OPT_ARG(arg);
- options->xdl_opts = DIFF_WITH_ALG(options, PATIENCE_DIFF);
/*
* Both --patience and --anchored use PATIENCE_DIFF
* internally, so remove any anchors previously
@@ -5218,7 +5409,9 @@ static int diff_opt_patience(const struct option *opt,
for (i = 0; i < options->anchors_nr; i++)
free(options->anchors[i]);
options->anchors_nr = 0;
- return 0;
+ options->ignore_driver_algorithm = 1;
+
+ return set_diff_algorithm(options, "patience");
}
static int diff_opt_ignore_regex(const struct option *opt,
@@ -5368,16 +5561,20 @@ static int diff_opt_rotate_to(const struct option *opt, const char *arg, int uns
return 0;
}
-static void prep_parse_options(struct diff_options *options)
+/*
+ * Consider adding new flags to __git_diff_common_options
+ * in contrib/completion/git-completion.bash
+ */
+struct option *add_diff_options(const struct option *opts,
+ struct diff_options *options)
{
struct option parseopts[] = {
OPT_GROUP(N_("Diff output format options")),
OPT_BITOP('p', "patch", &options->output_format,
N_("generate patch"),
DIFF_FORMAT_PATCH, DIFF_FORMAT_NO_OUTPUT),
- OPT_BIT_F('s', "no-patch", &options->output_format,
- N_("suppress diff output"),
- DIFF_FORMAT_NO_OUTPUT, PARSE_OPT_NONEG),
+ OPT_SET_INT('s', "no-patch", &options->output_format,
+ N_("suppress diff output"), DIFF_FORMAT_NO_OUTPUT),
OPT_BITOP('u', NULL, &options->output_format,
N_("generate patch"),
DIFF_FORMAT_PATCH, DIFF_FORMAT_NO_OUTPUT),
@@ -5386,9 +5583,9 @@ static void prep_parse_options(struct diff_options *options)
PARSE_OPT_NONEG | PARSE_OPT_OPTARG, diff_opt_unified),
OPT_BOOL('W', "function-context", &options->flags.funccontext,
N_("generate diffs with <n> lines context")),
- OPT_BIT_F(0, "raw", &options->output_format,
+ OPT_BITOP(0, "raw", &options->output_format,
N_("generate the diff in raw format"),
- DIFF_FORMAT_RAW, PARSE_OPT_NONEG),
+ DIFF_FORMAT_RAW, DIFF_FORMAT_NO_OUTPUT),
OPT_BITOP(0, "patch-with-raw", &options->output_format,
N_("synonym for '-p --raw'"),
DIFF_FORMAT_PATCH | DIFF_FORMAT_RAW,
@@ -5397,13 +5594,13 @@ static void prep_parse_options(struct diff_options *options)
N_("synonym for '-p --stat'"),
DIFF_FORMAT_PATCH | DIFF_FORMAT_DIFFSTAT,
DIFF_FORMAT_NO_OUTPUT),
- OPT_BIT_F(0, "numstat", &options->output_format,
+ OPT_BITOP(0, "numstat", &options->output_format,
N_("machine friendly --stat"),
- DIFF_FORMAT_NUMSTAT, PARSE_OPT_NONEG),
- OPT_BIT_F(0, "shortstat", &options->output_format,
+ DIFF_FORMAT_NUMSTAT, DIFF_FORMAT_NO_OUTPUT),
+ OPT_BITOP(0, "shortstat", &options->output_format,
N_("output only the last line of --stat"),
- DIFF_FORMAT_SHORTSTAT, PARSE_OPT_NONEG),
- OPT_CALLBACK_F('X', "dirstat", options, N_("<param1,param2>..."),
+ DIFF_FORMAT_SHORTSTAT, DIFF_FORMAT_NO_OUTPUT),
+ OPT_CALLBACK_F('X', "dirstat", options, N_("<param1>,<param2>..."),
N_("output the distribution of relative amount of changes for each sub-directory"),
PARSE_OPT_NONEG | PARSE_OPT_OPTARG,
diff_opt_dirstat),
@@ -5411,16 +5608,16 @@ static void prep_parse_options(struct diff_options *options)
N_("synonym for --dirstat=cumulative"),
PARSE_OPT_NONEG | PARSE_OPT_NOARG,
diff_opt_dirstat),
- OPT_CALLBACK_F(0, "dirstat-by-file", options, N_("<param1,param2>..."),
- N_("synonym for --dirstat=files,param1,param2..."),
+ OPT_CALLBACK_F(0, "dirstat-by-file", options, N_("<param1>,<param2>..."),
+ N_("synonym for --dirstat=files,<param1>,<param2>..."),
PARSE_OPT_NONEG | PARSE_OPT_OPTARG,
diff_opt_dirstat),
OPT_BIT_F(0, "check", &options->output_format,
N_("warn if changes introduce conflict markers or whitespace errors"),
DIFF_FORMAT_CHECKDIFF, PARSE_OPT_NONEG),
- OPT_BIT_F(0, "summary", &options->output_format,
+ OPT_BITOP(0, "summary", &options->output_format,
N_("condensed summary such as creations, renames and mode changes"),
- DIFF_FORMAT_SUMMARY, PARSE_OPT_NONEG),
+ DIFF_FORMAT_SUMMARY, DIFF_FORMAT_NO_OUTPUT),
OPT_BIT_F(0, "name-only", &options->output_format,
N_("show only names of changed files"),
DIFF_FORMAT_NAME, PARSE_OPT_NONEG),
@@ -5471,6 +5668,9 @@ static void prep_parse_options(struct diff_options *options)
OPT_CALLBACK_F(0, "no-prefix", options, NULL,
N_("do not show any source or destination prefix"),
PARSE_OPT_NONEG | PARSE_OPT_NOARG, diff_opt_no_prefix),
+ OPT_CALLBACK_F(0, "default-prefix", options, NULL,
+ N_("use default prefixes a/ and b/"),
+ PARSE_OPT_NONEG | PARSE_OPT_NOARG, diff_opt_default_prefix),
OPT_INTEGER_F(0, "inter-hunk-context", &options->interhunkcontext,
N_("show context between diff hunks up to the specified number of lines"),
PARSE_OPT_NONEG),
@@ -5520,9 +5720,10 @@ static void prep_parse_options(struct diff_options *options)
N_("prevent rename/copy detection if the number of rename/copy targets exceeds given limit")),
OPT_GROUP(N_("Diff algorithm options")),
- OPT_BIT(0, "minimal", &options->xdl_opts,
- N_("produce the smallest possible diff"),
- XDF_NEED_MINIMAL),
+ OPT_CALLBACK_F(0, "minimal", options, NULL,
+ N_("produce the smallest possible diff"),
+ PARSE_OPT_NONEG | PARSE_OPT_NOARG,
+ diff_opt_diff_algorithm_no_arg),
OPT_BIT_F('w', "ignore-all-space", &options->xdl_opts,
N_("ignore whitespace when comparing lines"),
XDF_IGNORE_WHITESPACE, PARSE_OPT_NONEG),
@@ -5548,9 +5749,10 @@ static void prep_parse_options(struct diff_options *options)
N_("generate diff using the \"patience diff\" algorithm"),
PARSE_OPT_NONEG | PARSE_OPT_NOARG,
diff_opt_patience),
- OPT_BITOP(0, "histogram", &options->xdl_opts,
- N_("generate diff using the \"histogram diff\" algorithm"),
- XDF_HISTOGRAM_DIFF, XDF_DIFF_ALGORITHM_MASK),
+ OPT_CALLBACK_F(0, "histogram", options, NULL,
+ N_("generate diff using the \"histogram diff\" algorithm"),
+ PARSE_OPT_NONEG | PARSE_OPT_NOARG,
+ diff_opt_diff_algorithm_no_arg),
OPT_CALLBACK_F(0, "diff-algorithm", options, N_("<algorithm>"),
N_("choose a diff algorithm"),
PARSE_OPT_NONEG, diff_opt_diff_algorithm),
@@ -5638,22 +5840,25 @@ static void prep_parse_options(struct diff_options *options)
OPT_END()
};
- ALLOC_ARRAY(options->parseopts, ARRAY_SIZE(parseopts));
- memcpy(options->parseopts, parseopts, sizeof(parseopts));
+ return parse_options_concat(opts, parseopts);
}
int diff_opt_parse(struct diff_options *options,
const char **av, int ac, const char *prefix)
{
+ struct option no_options[] = { OPT_END() };
+ struct option *parseopts = add_diff_options(no_options, options);
+
if (!prefix)
prefix = "";
- ac = parse_options(ac, av, prefix, options->parseopts, NULL,
+ ac = parse_options(ac, av, prefix, parseopts, NULL,
PARSE_OPT_KEEP_DASHDASH |
- PARSE_OPT_KEEP_UNKNOWN |
+ PARSE_OPT_KEEP_UNKNOWN_OPT |
PARSE_OPT_NO_INTERNAL_HELP |
PARSE_OPT_ONE_SHOT |
PARSE_OPT_STOP_AT_NON_OPTION);
+ free(parseopts);
return ac;
}
@@ -5721,6 +5926,13 @@ void diff_free_filepair(struct diff_filepair *p)
free(p);
}
+void diff_free_queue(struct diff_queue_struct *q)
+{
+ for (int i = 0; i < q->nr; i++)
+ diff_free_filepair(q->queue[i]);
+ free(q->queue);
+}
+
const char *diff_aligned_abbrev(const struct object_id *oid, int len)
{
int abblen;
@@ -5841,6 +6053,7 @@ static void diff_flush_patch(struct diff_filepair *p, struct diff_options *o)
{
int include_conflict_headers =
(additional_headers(o, p->one->path) &&
+ !o->pickaxe_opts &&
(!o->filter || filter_bit_tst(DIFF_STATUS_UNMERGED, o)));
/*
@@ -5896,6 +6109,8 @@ int diff_queue_is_empty(struct diff_options *o)
int i;
int include_conflict_headers =
(o->additional_path_headers &&
+ strmap_get_size(o->additional_path_headers) &&
+ !o->pickaxe_opts &&
(!o->filter || filter_bit_tst(DIFF_STATUS_UNMERGED, o)));
if (include_conflict_headers)
@@ -6031,6 +6246,8 @@ static void flush_one_pair(struct diff_filepair *p, struct diff_options *opt)
fprintf(opt->file, "%s", diff_line_prefix(opt));
write_name_quoted(name_a, opt->file, opt->line_termination);
}
+
+ opt->found_changes = 1;
}
static void show_file_mode_name(struct diff_options *opt, const char *newdelete, struct diff_filespec *fs)
@@ -6174,7 +6391,7 @@ static void patch_id_add_mode(git_hash_ctx *ctx, unsigned mode)
}
/* returns 0 upon success, and writes result into oid */
-static int diff_get_patch_id(struct diff_options *options, struct object_id *oid, int diff_header_only, int stable)
+static int diff_get_patch_id(struct diff_options *options, struct object_id *oid, int diff_header_only)
{
struct diff_queue_struct *q = &diff_queued_diff;
int i;
@@ -6221,66 +6438,63 @@ static int diff_get_patch_id(struct diff_options *options, struct object_id *oid
if (p->one->mode == 0) {
patch_id_add_string(&ctx, "newfilemode");
patch_id_add_mode(&ctx, p->two->mode);
- patch_id_add_string(&ctx, "---/dev/null");
- patch_id_add_string(&ctx, "+++b/");
- the_hash_algo->update_fn(&ctx, p->two->path, len2);
} else if (p->two->mode == 0) {
patch_id_add_string(&ctx, "deletedfilemode");
patch_id_add_mode(&ctx, p->one->mode);
- patch_id_add_string(&ctx, "---a/");
- the_hash_algo->update_fn(&ctx, p->one->path, len1);
- patch_id_add_string(&ctx, "+++/dev/null");
- } else {
- patch_id_add_string(&ctx, "---a/");
- the_hash_algo->update_fn(&ctx, p->one->path, len1);
- patch_id_add_string(&ctx, "+++b/");
- the_hash_algo->update_fn(&ctx, p->two->path, len2);
+ } else if (p->one->mode != p->two->mode) {
+ patch_id_add_string(&ctx, "oldmode");
+ patch_id_add_mode(&ctx, p->one->mode);
+ patch_id_add_string(&ctx, "newmode");
+ patch_id_add_mode(&ctx, p->two->mode);
}
- if (diff_header_only)
- continue;
-
- if (fill_mmfile(options->repo, &mf1, p->one) < 0 ||
- fill_mmfile(options->repo, &mf2, p->two) < 0)
- return error("unable to read files to diff");
-
- if (diff_filespec_is_binary(options->repo, p->one) ||
+ if (diff_header_only) {
+ /* don't do anything since we're only populating header info */
+ } else if (diff_filespec_is_binary(options->repo, p->one) ||
diff_filespec_is_binary(options->repo, p->two)) {
the_hash_algo->update_fn(&ctx, oid_to_hex(&p->one->oid),
the_hash_algo->hexsz);
the_hash_algo->update_fn(&ctx, oid_to_hex(&p->two->oid),
the_hash_algo->hexsz);
- continue;
- }
-
- xpp.flags = 0;
- xecfg.ctxlen = 3;
- xecfg.flags = XDL_EMIT_NO_HUNK_HDR;
- if (xdi_diff_outf(&mf1, &mf2, NULL,
- patch_id_consume, &data, &xpp, &xecfg))
- return error("unable to generate patch-id diff for %s",
- p->one->path);
+ } else {
+ if (p->one->mode == 0) {
+ patch_id_add_string(&ctx, "---/dev/null");
+ patch_id_add_string(&ctx, "+++b/");
+ the_hash_algo->update_fn(&ctx, p->two->path, len2);
+ } else if (p->two->mode == 0) {
+ patch_id_add_string(&ctx, "---a/");
+ the_hash_algo->update_fn(&ctx, p->one->path, len1);
+ patch_id_add_string(&ctx, "+++/dev/null");
+ } else {
+ patch_id_add_string(&ctx, "---a/");
+ the_hash_algo->update_fn(&ctx, p->one->path, len1);
+ patch_id_add_string(&ctx, "+++b/");
+ the_hash_algo->update_fn(&ctx, p->two->path, len2);
+ }
- if (stable)
- flush_one_hunk(oid, &ctx);
+ if (fill_mmfile(options->repo, &mf1, p->one) < 0 ||
+ fill_mmfile(options->repo, &mf2, p->two) < 0)
+ return error("unable to read files to diff");
+ xpp.flags = 0;
+ xecfg.ctxlen = 3;
+ xecfg.flags = XDL_EMIT_NO_HUNK_HDR;
+ if (xdi_diff_outf(&mf1, &mf2, NULL,
+ patch_id_consume, &data, &xpp, &xecfg))
+ return error("unable to generate patch-id diff for %s",
+ p->one->path);
+ }
+ flush_one_hunk(oid, &ctx);
}
- if (!stable)
- the_hash_algo->final_oid_fn(oid, &ctx);
-
return 0;
}
-int diff_flush_patch_id(struct diff_options *options, struct object_id *oid, int diff_header_only, int stable)
+int diff_flush_patch_id(struct diff_options *options, struct object_id *oid, int diff_header_only)
{
struct diff_queue_struct *q = &diff_queued_diff;
- int i;
- int result = diff_get_patch_id(options, oid, diff_header_only, stable);
-
- for (i = 0; i < q->nr; i++)
- diff_free_filepair(q->queue[i]);
+ int result = diff_get_patch_id(options, oid, diff_header_only);
- free(q->queue);
+ diff_free_queue(q);
DIFF_QUEUE_CLEAR(q);
return result;
@@ -6455,7 +6669,6 @@ void diff_free(struct diff_options *options)
diff_free_file(options);
diff_free_ignore_regex(options);
clear_pathspec(&options->pathspec);
- FREE_AND_NULL(options->parseopts);
}
void diff_flush(struct diff_options *options)
@@ -6513,6 +6726,21 @@ void diff_flush(struct diff_options *options)
separator++;
}
+ if (output_format & DIFF_FORMAT_PATCH) {
+ if (separator) {
+ emit_diff_symbol(options, DIFF_SYMBOL_SEPARATOR, NULL, 0, 0);
+ if (options->stat_sep)
+ /* attach patch instead of inline */
+ emit_diff_symbol(options, DIFF_SYMBOL_STAT_SEP,
+ NULL, 0, 0);
+ }
+
+ diff_flush_patch_all_file_pairs(options);
+ }
+
+ if (output_format & DIFF_FORMAT_CALLBACK)
+ options->format_callback(q, options, options->format_callback_data);
+
if (output_format & DIFF_FORMAT_NO_OUTPUT &&
options->flags.exit_with_status &&
options->flags.diff_from_contents) {
@@ -6534,25 +6762,8 @@ void diff_flush(struct diff_options *options)
}
}
- if (output_format & DIFF_FORMAT_PATCH) {
- if (separator) {
- emit_diff_symbol(options, DIFF_SYMBOL_SEPARATOR, NULL, 0, 0);
- if (options->stat_sep)
- /* attach patch instead of inline */
- emit_diff_symbol(options, DIFF_SYMBOL_STAT_SEP,
- NULL, 0, 0);
- }
-
- diff_flush_patch_all_file_pairs(options);
- }
-
- if (output_format & DIFF_FORMAT_CALLBACK)
- options->format_callback(q, options, options->format_callback_data);
-
- for (i = 0; i < q->nr; i++)
- diff_free_filepair(q->queue[i]);
free_queue:
- free(q->queue);
+ diff_free_queue(q);
DIFF_QUEUE_CLEAR(q);
diff_free(options);
@@ -6751,6 +6962,13 @@ void diff_queued_diff_prefetch(void *repository)
oid_array_clear(&to_fetch);
}
+void init_diffstat_widths(struct diff_options *options)
+{
+ options->stat_width = -1; /* use full terminal width */
+ options->stat_name_width = -1; /* respect diff.statNameWidth config */
+ options->stat_graph_width = -1; /* respect diff.statGraphWidth config */
+}
+
void diffcore_std(struct diff_options *options)
{
int output_formats_to_prefetch = DIFF_FORMAT_DIFFSTAT |
@@ -6767,7 +6985,7 @@ void diffcore_std(struct diff_options *options)
* If no prefetching occurs, diffcore_rename() will prefetch if it
* decides that it needs inexact rename detection.
*/
- if (options->repo == the_repository && has_promisor_remote() &&
+ if (options->repo == the_repository && repo_has_promisor_remote(the_repository) &&
(options->output_format & output_formats_to_prefetch ||
options->pickaxe_opts & DIFF_PICKAXE_KINDS_MASK))
diff_queued_diff_prefetch(options->repo);
@@ -6804,16 +7022,14 @@ void diffcore_std(struct diff_options *options)
options->found_follow = 0;
}
-int diff_result_code(struct diff_options *opt, int status)
+int diff_result_code(struct diff_options *opt)
{
int result = 0;
diff_warn_rename_limit("diff.renameLimit",
opt->needed_rename_limit,
opt->degraded_cc_to_c);
- if (!opt->flags.exit_with_status &&
- !(opt->output_format & DIFF_FORMAT_CHECKDIFF))
- return status;
+
if (opt->flags.exit_with_status &&
opt->flags.has_changes)
result |= 01;
@@ -6860,6 +7076,7 @@ void compute_diffstat(struct diff_options *options,
if (check_pair_status(p))
diff_flush_stat(p, options, diffstat);
}
+ options->found_changes = !!diffstat->nr;
}
void diff_addremove(struct diff_options *options,
@@ -6981,7 +7198,7 @@ static char *run_textconv(struct repository *r,
struct strbuf buf = STRBUF_INIT;
int err = 0;
- temp = prepare_temp_file(r, spec->path, spec);
+ temp = prepare_temp_file(r, spec);
strvec_push(&child.args, pgm);
strvec_push(&child.args, temp->name);
diff --git a/diff.h b/diff.h
index 8ae18e5..66bd8ae 100644
--- a/diff.h
+++ b/diff.h
@@ -4,10 +4,11 @@
#ifndef DIFF_H
#define DIFF_H
-#include "tree-walk.h"
+#include "hash-ll.h"
#include "pathspec.h"
-#include "object.h"
-#include "oidset.h"
+#include "strbuf.h"
+
+struct oidset;
/**
* The diff API is for programs that compare two sets of files (e.g. two trees,
@@ -71,7 +72,6 @@ struct oid_array;
struct option;
struct repository;
struct rev_info;
-struct strbuf;
struct userdiff_driver;
typedef int (*pathchange_fn_t)(struct diff_options *options,
@@ -333,6 +333,7 @@ struct diff_options {
int prefix_length;
const char *stat_sep;
int xdl_opts;
+ int ignore_driver_algorithm;
/* see Documentation/diff-options.txt */
char **anchors;
@@ -394,7 +395,6 @@ struct diff_options {
unsigned color_moved_ws_handling;
struct repository *repo;
- struct option *parseopts;
struct strmap *additional_path_headers;
int no_free;
@@ -497,6 +497,8 @@ void diff_tree_combined(const struct object_id *oid, const struct oid_array *par
void diff_tree_combined_merge(const struct commit *commit, struct rev_info *rev);
void diff_set_mnemonic_prefix(struct diff_options *options, const char *a, const char *b);
+void diff_set_noprefix(struct diff_options *options);
+void diff_set_default_prefix(struct diff_options *options);
int diff_can_quit_early(struct diff_options *);
@@ -531,16 +533,24 @@ void free_diffstat_info(struct diffstat_t *diffstat);
int parse_long_opt(const char *opt, const char **argv,
const char **optarg);
-int git_diff_basic_config(const char *var, const char *value, void *cb);
+struct config_context;
+int git_diff_basic_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb);
int git_diff_heuristic_config(const char *var, const char *value, void *cb);
void init_diff_ui_defaults(void);
-int git_diff_ui_config(const char *var, const char *value, void *cb);
-#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
-#define diff_setup(diffopts) repo_diff_setup(the_repository, diffopts)
-#endif
+int git_diff_ui_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb);
void repo_diff_setup(struct repository *, struct diff_options *);
+struct option *add_diff_options(const struct option *, struct diff_options *);
int diff_opt_parse(struct diff_options *, const char **, int, const char *);
void diff_setup_done(struct diff_options *);
+
+/*
+ * Returns true if the pathspec can work with --follow mode. If die_on_error is
+ * set, die() with a specific error message rather than returning false.
+ */
+int diff_check_follow_pathspec(struct pathspec *ps, int die_on_error);
+
int git_config_rename(const char *var, const char *value);
#define DIFF_DETECT_RENAME 1
@@ -563,6 +573,7 @@ int git_config_rename(const char *var, const char *value);
#define DIFF_PICKAXE_IGNORE_CASE 32
+void init_diffstat_widths(struct diff_options *);
void diffcore_std(struct diff_options *);
void diffcore_fix_diff_index(void);
@@ -616,7 +627,7 @@ void diff_warn_rename_limit(const char *varname, int needed, int degraded_cc);
#define DIFF_STATUS_FILTER_BROKEN 'B'
/*
- * This is different from find_unique_abbrev() in that
+ * This is different from repo_find_unique_abbrev() in that
* it stuffs the result with dots for alignment.
*/
const char *diff_aligned_abbrev(const struct object_id *sha1, int);
@@ -627,17 +638,17 @@ void diff_get_merge_base(const struct rev_info *revs, struct object_id *mb);
#define DIFF_SILENT_ON_REMOVED 01
/* report racily-clean paths as modified */
#define DIFF_RACY_IS_MODIFIED 02
-int run_diff_files(struct rev_info *revs, unsigned int option);
+void run_diff_files(struct rev_info *revs, unsigned int option);
#define DIFF_INDEX_CACHED 01
#define DIFF_INDEX_MERGE_BASE 02
-int run_diff_index(struct rev_info *revs, unsigned int option);
+void run_diff_index(struct rev_info *revs, unsigned int option);
int do_diff_cache(const struct object_id *, struct diff_options *);
-int diff_flush_patch_id(struct diff_options *, struct object_id *, int, int);
+int diff_flush_patch_id(struct diff_options *, struct object_id *, int);
void flush_one_hunk(struct object_id *result, git_hash_ctx *ctx);
-int diff_result_code(struct diff_options *, int);
+int diff_result_code(struct diff_options *);
int diff_no_index(struct rev_info *,
int implicit_no_index, int, const char **);
@@ -696,4 +707,6 @@ void print_stat_summary(FILE *fp, int files,
int insertions, int deletions);
void setup_diff_pager(struct diff_options *);
+extern int diff_auto_refresh_index;
+
#endif /* DIFF_H */
diff --git a/diffcore-break.c b/diffcore-break.c
index 0d4a149..49ba38a 100644
--- a/diffcore-break.c
+++ b/diffcore-break.c
@@ -1,9 +1,10 @@
/*
* Copyright (C) 2005 Junio C Hamano
*/
-#include "cache.h"
-#include "diff.h"
+#include "git-compat-util.h"
#include "diffcore.h"
+#include "hash.h"
+#include "object.h"
#include "promisor-remote.h"
static int should_break(struct repository *r,
@@ -65,7 +66,7 @@ static int should_break(struct repository *r,
oideq(&src->oid, &dst->oid))
return 0; /* they are the same */
- if (r == the_repository && has_promisor_remote()) {
+ if (r == the_repository && repo_has_promisor_remote(the_repository)) {
options.missing_object_cb = diff_queued_diff_prefetch;
options.missing_object_data = r;
}
diff --git a/diffcore-delta.c b/diffcore-delta.c
index 18d8f76..ba6cbee 100644
--- a/diffcore-delta.c
+++ b/diffcore-delta.c
@@ -1,5 +1,4 @@
-#include "cache.h"
-#include "diff.h"
+#include "git-compat-util.h"
#include "diffcore.h"
/*
@@ -159,6 +158,10 @@ static struct spanhash_top *hash_chars(struct repository *r,
n = 0;
accum1 = accum2 = 0;
}
+ if (n > 0) {
+ hashval = (accum1 + accum2 * 0x61) % HASHBASE;
+ hash = add_spanhash(hash, hashval, n);
+ }
QSORT(hash->data, (size_t)1ul << hash->alloc_log2, spanhash_cmp);
return hash;
}
diff --git a/diffcore-order.c b/diffcore-order.c
index 19e7331..e7d20eb 100644
--- a/diffcore-order.c
+++ b/diffcore-order.c
@@ -1,9 +1,11 @@
/*
* Copyright (C) 2005 Junio C Hamano
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "gettext.h"
#include "diff.h"
#include "diffcore.h"
+#include "wildmatch.h"
static char **order;
static int order_cnt;
diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c
index c88e50c..b195fa4 100644
--- a/diffcore-pickaxe.c
+++ b/diffcore-pickaxe.c
@@ -2,12 +2,13 @@
* Copyright (C) 2005 Junio C Hamano
* Copyright (C) 2010 Google Inc.
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "diff.h"
#include "diffcore.h"
#include "xdiff-interface.h"
#include "kwset.h"
-#include "commit.h"
+#include "oidset.h"
+#include "pretty.h"
#include "quote.h"
typedef int (*pickaxe_fn)(mmfile_t *one, mmfile_t *two,
@@ -38,7 +39,7 @@ static int diffgrep_consume(void *priv, char *line, unsigned long len)
static int diff_grep(mmfile_t *one, mmfile_t *two,
struct diff_options *o,
- regex_t *regexp, kwset_t kws)
+ regex_t *regexp, kwset_t kws UNUSED)
{
struct diffgrep_cb ecbdata;
xpparam_t xpp;
@@ -114,7 +115,7 @@ static unsigned int contains(mmfile_t *mf, regex_t *regexp, kwset_t kws,
}
static int has_changes(mmfile_t *one, mmfile_t *two,
- struct diff_options *o,
+ struct diff_options *o UNUSED,
regex_t *regexp, kwset_t kws)
{
unsigned int c1 = one ? contains(one, regexp, kws, 0) : 0;
diff --git a/diffcore-rename.c b/diffcore-rename.c
index c0422d9..5a6e2bc 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -2,14 +2,18 @@
*
* Copyright (C) 2005 Junio C Hamano
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "diff.h"
#include "diffcore.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "hashmap.h"
+#include "mem-pool.h"
+#include "oid-array.h"
#include "progress.h"
#include "promisor-remote.h"
+#include "string-list.h"
#include "strmap.h"
+#include "trace2.h"
/* Table of rename/copy destinations */
@@ -981,7 +985,7 @@ static int find_basename_matches(struct diff_options *options,
strintmap_set(&dests, base, i);
}
- if (options->repo == the_repository && has_promisor_remote()) {
+ if (options->repo == the_repository && repo_has_promisor_remote(the_repository)) {
dpf_options.missing_object_cb = basename_prefetch;
dpf_options.missing_object_data = &prefetch_options;
}
@@ -1567,7 +1571,7 @@ void diffcore_rename_extended(struct diff_options *options,
/* Finish setting up dpf_options */
prefetch_options.skip_unmodified = skip_unmodified;
- if (options->repo == the_repository && has_promisor_remote()) {
+ if (options->repo == the_repository && repo_has_promisor_remote(the_repository)) {
dpf_options.missing_object_cb = inexact_prefetch;
dpf_options.missing_object_data = &prefetch_options;
}
diff --git a/diffcore-rotate.c b/diffcore-rotate.c
index 445f060..533986c 100644
--- a/diffcore-rotate.c
+++ b/diffcore-rotate.c
@@ -2,7 +2,8 @@
* Copyright (C) 2021, Google LLC.
* Based on diffcore-order.c, which is Copyright (C) 2005, Junio C Hamano
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "gettext.h"
#include "diff.h"
#include "diffcore.h"
diff --git a/diffcore.h b/diffcore.h
index badc226..5ffe4ec 100644
--- a/diffcore.h
+++ b/diffcore.h
@@ -4,9 +4,11 @@
#ifndef DIFFCORE_H
#define DIFFCORE_H
-#include "cache.h"
+#include "hash-ll.h"
struct diff_options;
+struct mem_pool;
+struct oid_array;
struct repository;
struct strintmap;
struct strmap;
@@ -162,6 +164,7 @@ struct diff_filepair *diff_queue(struct diff_queue_struct *,
struct diff_filespec *,
struct diff_filespec *);
void diff_q(struct diff_queue_struct *, struct diff_filepair *);
+void diff_free_queue(struct diff_queue_struct *q);
/* dir_rename_relevance: the reason we want rename information for a dir */
enum dir_rename_relevance {
diff --git a/dir-iterator.c b/dir-iterator.c
index b17e9f9..de61984 100644
--- a/dir-iterator.c
+++ b/dir-iterator.c
@@ -1,12 +1,21 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "dir.h"
#include "iterator.h"
#include "dir-iterator.h"
+#include "string-list.h"
struct dir_iterator_level {
DIR *dir;
/*
+ * The directory entries of the current level. This list will only be
+ * populated when the iterator is ordered. In that case, `dir` will be
+ * set to `NULL`.
+ */
+ struct string_list entries;
+ size_t entries_idx;
+
+ /*
* The length of the directory part of path at this level
* (including a trailing '/'):
*/
@@ -43,6 +52,31 @@ struct dir_iterator_int {
unsigned int flags;
};
+static int next_directory_entry(DIR *dir, const char *path,
+ struct dirent **out)
+{
+ struct dirent *de;
+
+repeat:
+ errno = 0;
+ de = readdir(dir);
+ if (!de) {
+ if (errno) {
+ warning_errno("error reading directory '%s'",
+ path);
+ return -1;
+ }
+
+ return 1;
+ }
+
+ if (is_dot_or_dotdot(de->d_name))
+ goto repeat;
+
+ *out = de;
+ return 0;
+}
+
/*
* Push a level in the iter stack and initialize it with information from
* the directory pointed by iter->base->path. It is assumed that this
@@ -72,6 +106,35 @@ static int push_level(struct dir_iterator_int *iter)
return -1;
}
+ string_list_init_dup(&level->entries);
+ level->entries_idx = 0;
+
+ /*
+ * When the iterator is sorted we read and sort all directory entries
+ * directly.
+ */
+ if (iter->flags & DIR_ITERATOR_SORTED) {
+ struct dirent *de;
+
+ while (1) {
+ int ret = next_directory_entry(level->dir, iter->base.path.buf, &de);
+ if (ret < 0) {
+ if (errno != ENOENT &&
+ iter->flags & DIR_ITERATOR_PEDANTIC)
+ return -1;
+ continue;
+ } else if (ret > 0) {
+ break;
+ }
+
+ string_list_append(&level->entries, de->d_name);
+ }
+ string_list_sort(&level->entries);
+
+ closedir(level->dir);
+ level->dir = NULL;
+ }
+
return 0;
}
@@ -88,21 +151,22 @@ static int pop_level(struct dir_iterator_int *iter)
warning_errno("error closing directory '%s'",
iter->base.path.buf);
level->dir = NULL;
+ string_list_clear(&level->entries, 0);
return --iter->levels_nr;
}
/*
* Populate iter->base with the necessary information on the next iteration
- * entry, represented by the given dirent de. Return 0 on success and -1
+ * entry, represented by the given name. Return 0 on success and -1
* otherwise, setting errno accordingly.
*/
static int prepare_next_entry_data(struct dir_iterator_int *iter,
- struct dirent *de)
+ const char *name)
{
int err, saved_errno;
- strbuf_addstr(&iter->base.path, de->d_name);
+ strbuf_addstr(&iter->base.path, name);
/*
* We have to reset these because the path strbuf might have
* been realloc()ed at the previous strbuf_addstr().
@@ -112,10 +176,7 @@ static int prepare_next_entry_data(struct dir_iterator_int *iter,
iter->base.basename = iter->base.path.buf +
iter->levels[iter->levels_nr - 1].prefix_len;
- if (iter->flags & DIR_ITERATOR_FOLLOW_SYMLINKS)
- err = stat(iter->base.path.buf, &iter->base.st);
- else
- err = lstat(iter->base.path.buf, &iter->base.st);
+ err = lstat(iter->base.path.buf, &iter->base.st);
saved_errno = errno;
if (err && errno != ENOENT)
@@ -142,27 +203,34 @@ int dir_iterator_advance(struct dir_iterator *dir_iterator)
struct dirent *de;
struct dir_iterator_level *level =
&iter->levels[iter->levels_nr - 1];
+ const char *name;
strbuf_setlen(&iter->base.path, level->prefix_len);
- errno = 0;
- de = readdir(level->dir);
- if (!de) {
- if (errno) {
- warning_errno("error reading directory '%s'",
- iter->base.path.buf);
+ if (level->dir) {
+ int ret = next_directory_entry(level->dir, iter->base.path.buf, &de);
+ if (ret < 0) {
if (iter->flags & DIR_ITERATOR_PEDANTIC)
goto error_out;
- } else if (pop_level(iter) == 0) {
- return dir_iterator_abort(dir_iterator);
+ continue;
+ } else if (ret > 0) {
+ if (pop_level(iter) == 0)
+ return dir_iterator_abort(dir_iterator);
+ continue;
}
- continue;
- }
- if (is_dot_or_dotdot(de->d_name))
- continue;
+ name = de->d_name;
+ } else {
+ if (level->entries_idx >= level->entries.nr) {
+ if (pop_level(iter) == 0)
+ return dir_iterator_abort(dir_iterator);
+ continue;
+ }
- if (prepare_next_entry_data(iter, de)) {
+ name = level->entries.items[level->entries_idx++].string;
+ }
+
+ if (prepare_next_entry_data(iter, name)) {
if (errno != ENOENT && iter->flags & DIR_ITERATOR_PEDANTIC)
goto error_out;
continue;
@@ -191,6 +259,8 @@ int dir_iterator_abort(struct dir_iterator *dir_iterator)
warning_errno("error closing directory '%s'",
iter->base.path.buf);
}
+
+ string_list_clear(&level->entries, 0);
}
free(iter->levels);
@@ -203,7 +273,7 @@ struct dir_iterator *dir_iterator_begin(const char *path, unsigned int flags)
{
struct dir_iterator_int *iter = xcalloc(1, sizeof(*iter));
struct dir_iterator *dir_iterator = &iter->base;
- int saved_errno;
+ int saved_errno, err;
strbuf_init(&iter->base.path, PATH_MAX);
strbuf_addstr(&iter->base.path, path);
@@ -213,10 +283,12 @@ struct dir_iterator *dir_iterator_begin(const char *path, unsigned int flags)
iter->flags = flags;
/*
- * Note: stat already checks for NULL or empty strings and
- * inexistent paths.
+ * Note: lstat already checks for NULL or empty strings and
+ * nonexistent paths.
*/
- if (stat(iter->base.path.buf, &iter->base.st) < 0) {
+ err = lstat(iter->base.path.buf, &iter->base.st);
+
+ if (err < 0) {
saved_errno = errno;
goto error_out;
}
diff --git a/dir-iterator.h b/dir-iterator.h
index 0822915..6d43880 100644
--- a/dir-iterator.h
+++ b/dir-iterator.h
@@ -55,18 +55,10 @@
* warning is emitted. Note: ENOENT errors are always ignored so that
* the API users may remove files during iteration.
*
- * - DIR_ITERATOR_FOLLOW_SYMLINKS: make dir-iterator follow symlinks.
- * i.e., linked directories' contents will be iterated over and
- * iter->base.st will contain information on the referred files,
- * not the symlinks themselves, which is the default behavior. Broken
- * symlinks are ignored.
- *
- * Warning: circular symlinks are also followed when
- * DIR_ITERATOR_FOLLOW_SYMLINKS is set. The iteration may end up with
- * an ELOOP if they happen and DIR_ITERATOR_PEDANTIC is set.
+ * - DIR_ITERATOR_SORTED: sort directory entries alphabetically.
*/
#define DIR_ITERATOR_PEDANTIC (1 << 0)
-#define DIR_ITERATOR_FOLLOW_SYMLINKS (1 << 1)
+#define DIR_ITERATOR_SORTED (1 << 1)
struct dir_iterator {
/* The current path: */
@@ -83,9 +75,7 @@ struct dir_iterator {
const char *basename;
/*
- * The result of calling lstat() on path; or stat(), if the
- * DIR_ITERATOR_FOLLOW_SYMLINKS flag was set at
- * dir_iterator's initialization.
+ * The result of calling lstat() on path.
*/
struct stat st;
};
diff --git a/dir.c b/dir.c
index d7cfb08..20ebe4c 100644
--- a/dir.c
+++ b/dir.c
@@ -5,19 +5,31 @@
* Copyright (C) Linus Torvalds, 2005-2006
* Junio Hamano, 2005-2006
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
#include "config.h"
+#include "convert.h"
#include "dir.h"
-#include "object-store.h"
-#include "attr.h"
+#include "environment.h"
+#include "gettext.h"
+#include "name-hash.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "path.h"
#include "refs.h"
#include "wildmatch.h"
#include "pathspec.h"
#include "utf8.h"
#include "varint.h"
#include "ewah/ewok.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
+#include "read-cache-ll.h"
+#include "setup.h"
+#include "sparse-index.h"
#include "submodule-config.h"
+#include "symlinks.h"
+#include "trace2.h"
+#include "tree.h"
/*
* Tells read_directory_recursive how a file or directory should be treated.
@@ -267,7 +279,7 @@ static int do_read_blob(const struct object_id *oid, struct oid_stat *oid_stat,
*size_out = 0;
*data_out = NULL;
- data = read_object_file(oid, &type, &sz);
+ data = repo_read_object_file(the_repository, oid, &type, &sz);
if (!data || type != OBJ_BLOB) {
free(data);
return -1;
@@ -363,7 +375,7 @@ static int match_pathspec_item(struct index_state *istate,
return 0;
if (item->attr_match_nr &&
- !match_pathspec_attrs(istate, name, namelen, item))
+ !match_pathspec_attrs(istate, name - prefix, namelen + prefix, item))
return 0;
/* If the match was just the prefix, we matched */
@@ -655,10 +667,10 @@ void parse_path_pattern(const char **pattern,
*patternlen = len;
}
-int pl_hashmap_cmp(const void *unused_cmp_data,
+int pl_hashmap_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *a,
const struct hashmap_entry *b,
- const void *key)
+ const void *key UNUSED)
{
const struct pattern_entry *ee1 =
container_of(a, struct pattern_entry, ent);
@@ -669,9 +681,7 @@ int pl_hashmap_cmp(const void *unused_cmp_data,
? ee1->patternlen
: ee2->patternlen;
- if (ignore_case)
- return strncasecmp(ee1->pattern, ee2->pattern, min_len);
- return strncmp(ee1->pattern, ee2->pattern, min_len);
+ return fspathncmp(ee1->pattern, ee2->pattern, min_len);
}
static char *dup_and_filter_pattern(const char *pattern)
@@ -734,6 +744,13 @@ static void add_pattern_to_hashsets(struct pattern_list *pl, struct path_pattern
goto clear_hashmaps;
}
+ if (!(given->flags & PATTERN_FLAG_MUSTBEDIR) &&
+ strcmp(given->pattern, "/*")) {
+ /* Not a cone pattern. */
+ warning(_("unrecognized pattern: '%s'"), given->pattern);
+ goto clear_hashmaps;
+ }
+
prev = given->pattern;
cur = given->pattern + 1;
next = given->pattern + 2;
@@ -1185,7 +1202,7 @@ struct pattern_list *add_pattern_list(struct dir_struct *dir,
struct pattern_list *pl;
struct exclude_list_group *group;
- group = &dir->exclude_list_group[group_type];
+ group = &dir->internal.exclude_list_group[group_type];
ALLOC_GROW(group->pl, group->nr + 1, group->alloc);
pl = &group->pl[group->nr++];
memset(pl, 0, sizeof(*pl));
@@ -1206,7 +1223,7 @@ static void add_patterns_from_file_1(struct dir_struct *dir, const char *fname,
* differently when dir->untracked is non-NULL.
*/
if (!dir->untracked)
- dir->unmanaged_exclude_files++;
+ dir->internal.unmanaged_exclude_files++;
pl = add_pattern_list(dir, EXC_FILE, fname);
if (add_patterns(fname, "", 0, pl, NULL, 0, oid_stat) < 0)
die(_("cannot use %s as an exclude file"), fname);
@@ -1214,7 +1231,7 @@ static void add_patterns_from_file_1(struct dir_struct *dir, const char *fname,
void add_patterns_from_file(struct dir_struct *dir, const char *fname)
{
- dir->unmanaged_exclude_files++; /* see validate_untracked_cache() */
+ dir->internal.unmanaged_exclude_files++; /* see validate_untracked_cache() */
add_patterns_from_file_1(dir, fname, NULL);
}
@@ -1244,8 +1261,7 @@ int match_basename(const char *basename, int basenamelen,
int match_pathname(const char *pathname, int pathlen,
const char *base, int baselen,
- const char *pattern, int prefix, int patternlen,
- unsigned flags)
+ const char *pattern, int prefix, int patternlen)
{
const char *name;
int namelen;
@@ -1347,8 +1363,7 @@ static struct path_pattern *last_matching_pattern_from_list(const char *pathname
if (match_pathname(pathname, pathlen,
pattern->base,
pattern->baselen ? pattern->baselen - 1 : 0,
- exclude, prefix, pattern->patternlen,
- pattern->flags)) {
+ exclude, prefix, pattern->patternlen)) {
res = pattern;
break;
}
@@ -1516,7 +1531,7 @@ static struct path_pattern *last_matching_pattern_from_lists(
struct exclude_list_group *group;
struct path_pattern *pattern;
for (i = EXC_CMDL; i <= EXC_FILE; i++) {
- group = &dir->exclude_list_group[i];
+ group = &dir->internal.exclude_list_group[i];
for (j = group->nr - 1; j >= 0; j--) {
pattern = last_matching_pattern_from_list(
pathname, pathlen, basename, dtype_p,
@@ -1542,20 +1557,20 @@ static void prep_exclude(struct dir_struct *dir,
struct untracked_cache_dir *untracked;
int current;
- group = &dir->exclude_list_group[EXC_DIRS];
+ group = &dir->internal.exclude_list_group[EXC_DIRS];
/*
* Pop the exclude lists from the EXCL_DIRS exclude_list_group
* which originate from directories not in the prefix of the
* path being checked.
*/
- while ((stk = dir->exclude_stack) != NULL) {
+ while ((stk = dir->internal.exclude_stack) != NULL) {
if (stk->baselen <= baselen &&
- !strncmp(dir->basebuf.buf, base, stk->baselen))
+ !strncmp(dir->internal.basebuf.buf, base, stk->baselen))
break;
- pl = &group->pl[dir->exclude_stack->exclude_ix];
- dir->exclude_stack = stk->prev;
- dir->pattern = NULL;
+ pl = &group->pl[dir->internal.exclude_stack->exclude_ix];
+ dir->internal.exclude_stack = stk->prev;
+ dir->internal.pattern = NULL;
free((char *)pl->src); /* see strbuf_detach() below */
clear_pattern_list(pl);
free(stk);
@@ -1563,7 +1578,7 @@ static void prep_exclude(struct dir_struct *dir,
}
/* Skip traversing into sub directories if the parent is excluded */
- if (dir->pattern)
+ if (dir->internal.pattern)
return;
/*
@@ -1571,12 +1586,12 @@ static void prep_exclude(struct dir_struct *dir,
* memset(dir, 0, sizeof(*dir)) before use. Changing all of
* them seems lots of work for little benefit.
*/
- if (!dir->basebuf.buf)
- strbuf_init(&dir->basebuf, PATH_MAX);
+ if (!dir->internal.basebuf.buf)
+ strbuf_init(&dir->internal.basebuf, PATH_MAX);
/* Read from the parent directories and push them down. */
current = stk ? stk->baselen : -1;
- strbuf_setlen(&dir->basebuf, current < 0 ? 0 : current);
+ strbuf_setlen(&dir->internal.basebuf, current < 0 ? 0 : current);
if (dir->untracked)
untracked = stk ? stk->ucd : dir->untracked->root;
else
@@ -1596,32 +1611,33 @@ static void prep_exclude(struct dir_struct *dir,
die("oops in prep_exclude");
cp++;
untracked =
- lookup_untracked(dir->untracked, untracked,
+ lookup_untracked(dir->untracked,
+ untracked,
base + current,
cp - base - current);
}
- stk->prev = dir->exclude_stack;
+ stk->prev = dir->internal.exclude_stack;
stk->baselen = cp - base;
stk->exclude_ix = group->nr;
stk->ucd = untracked;
pl = add_pattern_list(dir, EXC_DIRS, NULL);
- strbuf_add(&dir->basebuf, base + current, stk->baselen - current);
- assert(stk->baselen == dir->basebuf.len);
+ strbuf_add(&dir->internal.basebuf, base + current, stk->baselen - current);
+ assert(stk->baselen == dir->internal.basebuf.len);
/* Abort if the directory is excluded */
if (stk->baselen) {
int dt = DT_DIR;
- dir->basebuf.buf[stk->baselen - 1] = 0;
- dir->pattern = last_matching_pattern_from_lists(dir,
+ dir->internal.basebuf.buf[stk->baselen - 1] = 0;
+ dir->internal.pattern = last_matching_pattern_from_lists(dir,
istate,
- dir->basebuf.buf, stk->baselen - 1,
- dir->basebuf.buf + current, &dt);
- dir->basebuf.buf[stk->baselen - 1] = '/';
- if (dir->pattern &&
- dir->pattern->flags & PATTERN_FLAG_NEGATIVE)
- dir->pattern = NULL;
- if (dir->pattern) {
- dir->exclude_stack = stk;
+ dir->internal.basebuf.buf, stk->baselen - 1,
+ dir->internal.basebuf.buf + current, &dt);
+ dir->internal.basebuf.buf[stk->baselen - 1] = '/';
+ if (dir->internal.pattern &&
+ dir->internal.pattern->flags & PATTERN_FLAG_NEGATIVE)
+ dir->internal.pattern = NULL;
+ if (dir->internal.pattern) {
+ dir->internal.exclude_stack = stk;
return;
}
}
@@ -1644,15 +1660,15 @@ static void prep_exclude(struct dir_struct *dir,
*/
!is_null_oid(&untracked->exclude_oid))) {
/*
- * dir->basebuf gets reused by the traversal, but we
- * need fname to remain unchanged to ensure the src
- * member of each struct path_pattern correctly
+ * dir->internal.basebuf gets reused by the traversal,
+ * but we need fname to remain unchanged to ensure the
+ * src member of each struct path_pattern correctly
* back-references its source file. Other invocations
* of add_pattern_list provide stable strings, so we
* strbuf_detach() and free() here in the caller.
*/
struct strbuf sb = STRBUF_INIT;
- strbuf_addbuf(&sb, &dir->basebuf);
+ strbuf_addbuf(&sb, &dir->internal.basebuf);
strbuf_addstr(&sb, dir->exclude_per_dir);
pl->src = strbuf_detach(&sb, NULL);
add_patterns(pl->src, pl->src, stk->baselen, pl, istate,
@@ -1678,10 +1694,10 @@ static void prep_exclude(struct dir_struct *dir,
invalidate_gitignore(dir->untracked, untracked);
oidcpy(&untracked->exclude_oid, &oid_stat.oid);
}
- dir->exclude_stack = stk;
+ dir->internal.exclude_stack = stk;
current = stk->baselen;
}
- strbuf_setlen(&dir->basebuf, baselen);
+ strbuf_setlen(&dir->internal.basebuf, baselen);
}
/*
@@ -1701,8 +1717,8 @@ struct path_pattern *last_matching_pattern(struct dir_struct *dir,
prep_exclude(dir, istate, pathname, basename-pathname);
- if (dir->pattern)
- return dir->pattern;
+ if (dir->internal.pattern)
+ return dir->internal.pattern;
return last_matching_pattern_from_lists(dir, istate, pathname, pathlen,
basename, dtype_p);
@@ -1739,7 +1755,7 @@ static struct dir_entry *dir_add_name(struct dir_struct *dir,
if (index_file_exists(istate, pathname, len, ignore_case))
return NULL;
- ALLOC_GROW(dir->entries, dir->nr+1, dir->alloc);
+ ALLOC_GROW(dir->entries, dir->nr+1, dir->internal.alloc);
return dir->entries[dir->nr++] = dir_entry_new(pathname, len);
}
@@ -1750,7 +1766,7 @@ struct dir_entry *dir_add_ignored(struct dir_struct *dir,
if (!index_name_is_other(istate, pathname, len))
return NULL;
- ALLOC_GROW(dir->ignored, dir->ignored_nr+1, dir->ignored_alloc);
+ ALLOC_GROW(dir->ignored, dir->ignored_nr+1, dir->internal.ignored_alloc);
return dir->ignored[dir->ignored_nr++] = dir_entry_new(pathname, len);
}
@@ -2162,7 +2178,8 @@ static int exclude_matches_pathspec(const char *path, int pathlen,
PATHSPEC_LITERAL |
PATHSPEC_GLOB |
PATHSPEC_ICASE |
- PATHSPEC_EXCLUDE);
+ PATHSPEC_EXCLUDE |
+ PATHSPEC_ATTR);
for (i = 0; i < pathspec->nr; i++) {
const struct pathspec_item *item = &pathspec->items[i];
@@ -2218,6 +2235,39 @@ static int get_index_dtype(struct index_state *istate,
return DT_UNKNOWN;
}
+unsigned char get_dtype(struct dirent *e, struct strbuf *path,
+ int follow_symlink)
+{
+ struct stat st;
+ unsigned char dtype = DTYPE(e);
+ size_t base_path_len;
+
+ if (dtype != DT_UNKNOWN && !(follow_symlink && dtype == DT_LNK))
+ return dtype;
+
+ /*
+ * d_type unknown or unfollowed symlink, try to fall back on [l]stat
+ * results. If [l]stat fails, explicitly set DT_UNKNOWN.
+ */
+ base_path_len = path->len;
+ strbuf_addstr(path, e->d_name);
+ if ((follow_symlink && stat(path->buf, &st)) ||
+ (!follow_symlink && lstat(path->buf, &st)))
+ goto cleanup;
+
+ /* determine d_type from st_mode */
+ if (S_ISREG(st.st_mode))
+ dtype = DT_REG;
+ else if (S_ISDIR(st.st_mode))
+ dtype = DT_DIR;
+ else if (S_ISLNK(st.st_mode))
+ dtype = DT_LNK;
+
+cleanup:
+ strbuf_setlen(path, base_path_len);
+ return dtype;
+}
+
static int resolve_dtype(int dtype, struct index_state *istate,
const char *path, int len)
{
@@ -2566,7 +2616,7 @@ static enum path_treatment read_directory_recursive(struct dir_struct *dir,
if (open_cached_dir(&cdir, dir, untracked, istate, &path, check_only))
goto out;
- dir->visited_directories++;
+ dir->internal.visited_directories++;
if (untracked)
untracked->check_only = !!check_only;
@@ -2575,7 +2625,7 @@ static enum path_treatment read_directory_recursive(struct dir_struct *dir,
/* check how the file or directory should be treated */
state = treat_path(dir, untracked, &cdir, istate, &path,
baselen, pathspec);
- dir->visited_paths++;
+ dir->internal.visited_paths++;
if (state > dir_state)
dir_state = state;
@@ -2583,7 +2633,8 @@ static enum path_treatment read_directory_recursive(struct dir_struct *dir,
/* recurse into subdir if instructed by treat_path */
if (state == path_recurse) {
struct untracked_cache_dir *ud;
- ud = lookup_untracked(dir->untracked, untracked,
+ ud = lookup_untracked(dir->untracked,
+ untracked,
path.buf + baselen,
path.len - baselen);
subdir_state =
@@ -2843,7 +2894,7 @@ static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *d
* condition also catches running setup_standard_excludes()
* before setting dir->untracked!
*/
- if (dir->unmanaged_exclude_files)
+ if (dir->internal.unmanaged_exclude_files)
return NULL;
/*
@@ -2872,7 +2923,7 @@ static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *d
* EXC_CMDL is not considered in the cache. If people set it,
* skip the cache.
*/
- if (dir->exclude_list_group[EXC_CMDL].nr)
+ if (dir->internal.exclude_list_group[EXC_CMDL].nr)
return NULL;
if (!ident_in_untracked(dir->untracked)) {
@@ -2932,15 +2983,15 @@ static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *d
/* Validate $GIT_DIR/info/exclude and core.excludesfile */
root = dir->untracked->root;
- if (!oideq(&dir->ss_info_exclude.oid,
+ if (!oideq(&dir->internal.ss_info_exclude.oid,
&dir->untracked->ss_info_exclude.oid)) {
invalidate_gitignore(dir->untracked, root);
- dir->untracked->ss_info_exclude = dir->ss_info_exclude;
+ dir->untracked->ss_info_exclude = dir->internal.ss_info_exclude;
}
- if (!oideq(&dir->ss_excludes_file.oid,
+ if (!oideq(&dir->internal.ss_excludes_file.oid,
&dir->untracked->ss_excludes_file.oid)) {
invalidate_gitignore(dir->untracked, root);
- dir->untracked->ss_excludes_file = dir->ss_excludes_file;
+ dir->untracked->ss_excludes_file = dir->internal.ss_excludes_file;
}
/* Make sure this directory is not dropped out at saving phase */
@@ -2966,9 +3017,9 @@ static void emit_traversal_statistics(struct dir_struct *dir,
}
trace2_data_intmax("read_directory", repo,
- "directories-visited", dir->visited_directories);
+ "directories-visited", dir->internal.visited_directories);
trace2_data_intmax("read_directory", repo,
- "paths-visited", dir->visited_paths);
+ "paths-visited", dir->internal.visited_paths);
if (!dir->untracked)
return;
@@ -2990,8 +3041,8 @@ int read_directory(struct dir_struct *dir, struct index_state *istate,
struct untracked_cache_dir *untracked;
trace2_region_enter("dir", "read_directory", istate->repo);
- dir->visited_paths = 0;
- dir->visited_directories = 0;
+ dir->internal.visited_paths = 0;
+ dir->internal.visited_directories = 0;
if (has_symlink_leading_path(path, len)) {
trace2_region_leave("dir", "read_directory", istate->repo);
@@ -3339,14 +3390,14 @@ void setup_standard_excludes(struct dir_struct *dir)
excludes_file = xdg_config_home("ignore");
if (excludes_file && !access_or_warn(excludes_file, R_OK, 0))
add_patterns_from_file_1(dir, excludes_file,
- dir->untracked ? &dir->ss_excludes_file : NULL);
+ dir->untracked ? &dir->internal.ss_excludes_file : NULL);
/* per repository user preference */
if (startup_info->have_repository) {
const char *path = git_path_info_exclude();
if (!access_or_warn(path, R_OK, 0))
add_patterns_from_file_1(dir, path,
- dir->untracked ? &dir->ss_info_exclude : NULL);
+ dir->untracked ? &dir->internal.ss_info_exclude : NULL);
}
}
@@ -3402,7 +3453,7 @@ void dir_clear(struct dir_struct *dir)
struct dir_struct new = DIR_INIT;
for (i = EXC_CMDL; i <= EXC_FILE; i++) {
- group = &dir->exclude_list_group[i];
+ group = &dir->internal.exclude_list_group[i];
for (j = 0; j < group->nr; j++) {
pl = &group->pl[j];
if (i == EXC_DIRS)
@@ -3419,13 +3470,13 @@ void dir_clear(struct dir_struct *dir)
free(dir->ignored);
free(dir->entries);
- stk = dir->exclude_stack;
+ stk = dir->internal.exclude_stack;
while (stk) {
struct exclude_stack *prev = stk->prev;
free(stk);
stk = prev;
}
- strbuf_release(&dir->basebuf);
+ strbuf_release(&dir->internal.basebuf);
memcpy(dir, &new, sizeof(*dir));
}
@@ -3585,8 +3636,12 @@ static void free_untracked(struct untracked_cache_dir *ucd)
void free_untracked_cache(struct untracked_cache *uc)
{
- if (uc)
- free_untracked(uc->root);
+ if (!uc)
+ return;
+
+ free(uc->exclude_per_dir_to_free);
+ strbuf_release(&uc->ident);
+ free_untracked(uc->root);
free(uc);
}
@@ -3743,7 +3798,7 @@ struct untracked_cache *read_untracked_extension(const void *data, unsigned long
next + offset + hashsz);
uc->dir_flags = get_be32(next + ouc_offset(dir_flags));
exclude_per_dir = (const char *)next + exclude_per_dir_offset;
- uc->exclude_per_dir = xstrdup(exclude_per_dir);
+ uc->exclude_per_dir = uc->exclude_per_dir_to_free = xstrdup(exclude_per_dir);
/* NUL after exclude_per_dir is covered by sizeof(*ouc) */
next += exclude_per_dir_offset + strlen(exclude_per_dir) + 1;
if (next >= end)
@@ -3863,6 +3918,26 @@ void untracked_cache_invalidate_path(struct index_state *istate,
path, strlen(path));
}
+void untracked_cache_invalidate_trimmed_path(struct index_state *istate,
+ const char *path,
+ int safe_path)
+{
+ size_t len = strlen(path);
+
+ if (!len)
+ BUG("untracked_cache_invalidate_trimmed_path given zero length path");
+
+ if (path[len - 1] != '/') {
+ untracked_cache_invalidate_path(istate, path, safe_path);
+ } else {
+ struct strbuf tmp = STRBUF_INIT;
+
+ strbuf_add(&tmp, path, len - 1);
+ untracked_cache_invalidate_path(istate, tmp.buf, safe_path);
+ strbuf_release(&tmp);
+ }
+}
+
void untracked_cache_remove_from_index(struct index_state *istate,
const char *path)
{
diff --git a/dir.h b/dir.h
index 7bc8620..45a7b9e 100644
--- a/dir.h
+++ b/dir.h
@@ -1,10 +1,14 @@
#ifndef DIR_H
#define DIR_H
-#include "cache.h"
+#include "hash-ll.h"
#include "hashmap.h"
+#include "pathspec.h"
+#include "statinfo.h"
#include "strbuf.h"
+struct repository;
+
/**
* The directory listing API is used to enumerate paths in the work tree,
* optionally taking `.git/info/exclude` and `.gitignore` files per directory
@@ -39,6 +43,8 @@
*
*/
+struct repository;
+
struct dir_entry {
unsigned int len;
char name[FLEX_ARRAY]; /* more */
@@ -188,6 +194,7 @@ struct untracked_cache {
struct oid_stat ss_info_exclude;
struct oid_stat ss_excludes_file;
const char *exclude_per_dir;
+ char *exclude_per_dir_to_free;
struct strbuf ident;
/*
* dir_struct#flags must match dir_flags or the untracked
@@ -211,17 +218,6 @@ struct untracked_cache {
*/
struct dir_struct {
- /* The number of members in `entries[]` array. */
- int nr;
-
- /* Internal use; keeps track of allocation of `entries[]` array.*/
- int alloc;
-
- /* The number of members in `ignored[]` array. */
- int ignored_nr;
-
- int ignored_alloc;
-
/* bit-field of options */
enum {
@@ -286,66 +282,103 @@ struct dir_struct {
DIR_SKIP_NESTED_GIT = 1<<9
} flags;
+ /* The number of members in `entries[]` array. */
+ int nr; /* output only */
+
+ /* The number of members in `ignored[]` array. */
+ int ignored_nr; /* output only */
+
/* An array of `struct dir_entry`, each element of which describes a path. */
- struct dir_entry **entries;
+ struct dir_entry **entries; /* output only */
/**
* used for ignored paths with the `DIR_SHOW_IGNORED_TOO` and
* `DIR_COLLECT_IGNORED` flags.
*/
- struct dir_entry **ignored;
+ struct dir_entry **ignored; /* output only */
+
+ /* Enable/update untracked file cache if set */
+ struct untracked_cache *untracked;
/**
- * The name of the file to be read in each directory for excluded files
- * (typically `.gitignore`).
+ * Deprecated: ls-files is the only allowed caller; all other callers
+ * should leave this as NULL; it pre-dated the
+ * setup_standard_excludes() mechanism that replaces this.
+ *
+ * This field tracks the name of the file to be read in each directory
+ * for excluded files (typically `.gitignore`).
*/
const char *exclude_per_dir;
- /*
- * We maintain three groups of exclude pattern lists:
- *
- * EXC_CMDL lists patterns explicitly given on the command line.
- * EXC_DIRS lists patterns obtained from per-directory ignore files.
- * EXC_FILE lists patterns from fallback ignore files, e.g.
- * - .git/info/exclude
- * - core.excludesfile
- *
- * Each group contains multiple exclude lists, a single list
- * per source.
- */
+ struct dir_struct_internal {
+ /* Keeps track of allocation of `entries[]` array.*/
+ int alloc;
+
+ /* Keeps track of allocation of `ignored[]` array. */
+ int ignored_alloc;
+
+ /*
+ * We maintain three groups of exclude pattern lists:
+ *
+ * EXC_CMDL lists patterns explicitly given on the command line.
+ * EXC_DIRS lists patterns obtained from per-directory ignore
+ * files.
+ * EXC_FILE lists patterns from fallback ignore files, e.g.
+ * - .git/info/exclude
+ * - core.excludesfile
+ *
+ * Each group contains multiple exclude lists, a single list
+ * per source.
+ */
#define EXC_CMDL 0
#define EXC_DIRS 1
#define EXC_FILE 2
- struct exclude_list_group exclude_list_group[3];
-
- /*
- * Temporary variables which are used during loading of the
- * per-directory exclude lists.
- *
- * exclude_stack points to the top of the exclude_stack, and
- * basebuf contains the full path to the current
- * (sub)directory in the traversal. Exclude points to the
- * matching exclude struct if the directory is excluded.
- */
- struct exclude_stack *exclude_stack;
- struct path_pattern *pattern;
- struct strbuf basebuf;
+ struct exclude_list_group exclude_list_group[3];
- /* Enable untracked file cache if set */
- struct untracked_cache *untracked;
- struct oid_stat ss_info_exclude;
- struct oid_stat ss_excludes_file;
- unsigned unmanaged_exclude_files;
-
- /* Stats about the traversal */
- unsigned visited_paths;
- unsigned visited_directories;
+ /*
+ * Temporary variables which are used during loading of the
+ * per-directory exclude lists.
+ *
+ * exclude_stack points to the top of the exclude_stack, and
+ * basebuf contains the full path to the current
+ * (sub)directory in the traversal. Exclude points to the
+ * matching exclude struct if the directory is excluded.
+ */
+ struct exclude_stack *exclude_stack;
+ struct path_pattern *pattern;
+ struct strbuf basebuf;
+
+ /* Additional metadata related to 'untracked' */
+ struct oid_stat ss_info_exclude;
+ struct oid_stat ss_excludes_file;
+ unsigned unmanaged_exclude_files;
+
+ /* Stats about the traversal */
+ unsigned visited_paths;
+ unsigned visited_directories;
+ } internal;
};
#define DIR_INIT { 0 }
struct dirent *readdir_skip_dot_and_dotdot(DIR *dirp);
+/*
+ * Get the d_type of a dirent. If the d_type is unknown, derive it from
+ * stat.st_mode using the path to the dirent's containing directory (path) and
+ * the name of the dirent itself.
+ *
+ * If 'follow_symlink' is 1, this function will attempt to follow DT_LNK types
+ * using 'stat'. Links are *not* followed recursively, so a symlink pointing
+ * to another symlink will still resolve to 'DT_LNK'.
+ *
+ * Note that 'path' is assumed to have a trailing slash. It is also modified
+ * in-place during the execution of the function, but is then reverted to its
+ * original value before returning.
+ */
+unsigned char get_dtype(struct dirent *e, struct strbuf *path,
+ int follow_symlink);
+
/*Count the number of slashes for string s*/
int count_slashes(const char *s);
@@ -362,10 +395,6 @@ int count_slashes(const char *s);
int simple_length(const char *match);
int no_wildcard(const char *string);
char *common_prefix(const struct pathspec *pathspec);
-int match_pathspec(struct index_state *istate,
- const struct pathspec *pathspec,
- const char *name, int namelen,
- int prefix, char *seen, int is_dir);
int report_path_error(const char *ps_matched, const struct pathspec *pathspec);
int within_depth(const char *name, int namelen, int depth, int max_depth);
@@ -414,7 +443,7 @@ int match_basename(const char *, int,
const char *, int, int, unsigned);
int match_pathname(const char *, int,
const char *, int,
- const char *, int, int, unsigned);
+ const char *, int, int);
struct path_pattern *last_matching_pattern(struct dir_struct *dir,
struct index_state *istate,
@@ -532,15 +561,6 @@ int submodule_path_match(struct index_state *istate,
const char *submodule_name,
char *seen);
-static inline int ce_path_match(struct index_state *istate,
- const struct cache_entry *ce,
- const struct pathspec *pathspec,
- char *seen)
-{
- return match_pathspec(istate, pathspec, ce->name, ce_namelen(ce), 0, seen,
- S_ISDIR(ce->ce_mode) || S_ISGITLINK(ce->ce_mode));
-}
-
static inline int dir_path_match(struct index_state *istate,
const struct dir_entry *ent,
const struct pathspec *pathspec,
@@ -556,6 +576,13 @@ int cmp_dir_entry(const void *p1, const void *p2);
int check_dir_entry_contains(const struct dir_entry *out, const struct dir_entry *in);
void untracked_cache_invalidate_path(struct index_state *, const char *, int safe_path);
+/*
+ * Invalidate the untracked-cache for this path, but first strip
+ * off a trailing slash, if present.
+ */
+void untracked_cache_invalidate_trimmed_path(struct index_state *,
+ const char *path,
+ int safe_path);
void untracked_cache_remove_from_index(struct index_state *, const char *);
void untracked_cache_add_to_index(struct index_state *, const char *);
@@ -641,4 +668,5 @@ static inline int starts_with_dot_dot_slash_native(const char *const path)
return path_match_flags(path, what | PATH_MATCH_NATIVE);
}
+
#endif
diff --git a/editor.c b/editor.c
index 008c04f..b67b802 100644
--- a/editor.c
+++ b/editor.c
@@ -1,5 +1,12 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "advice.h"
#include "config.h"
+#include "editor.h"
+#include "environment.h"
+#include "gettext.h"
+#include "pager.h"
+#include "path.h"
#include "strbuf.h"
#include "strvec.h"
#include "run-command.h"
@@ -126,3 +133,31 @@ int launch_sequence_editor(const char *path, struct strbuf *buffer,
{
return launch_specified_editor(git_sequence_editor(), path, buffer, env);
}
+
+int strbuf_edit_interactively(struct strbuf *buffer, const char *path,
+ const char *const *env)
+{
+ char *path2 = NULL;
+ int fd, res = 0;
+
+ if (!is_absolute_path(path))
+ path = path2 = xstrdup(git_path("%s", path));
+
+ fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0666);
+ if (fd < 0)
+ res = error_errno(_("could not open '%s' for writing"), path);
+ else if (write_in_full(fd, buffer->buf, buffer->len) < 0) {
+ res = error_errno(_("could not write to '%s'"), path);
+ close(fd);
+ } else if (close(fd) < 0)
+ res = error_errno(_("could not close '%s'"), path);
+ else {
+ strbuf_reset(buffer);
+ if (launch_editor(path, buffer, env) < 0)
+ res = error_errno(_("could not edit '%s'"), path);
+ unlink(path);
+ }
+
+ free(path2);
+ return res;
+}
diff --git a/editor.h b/editor.h
new file mode 100644
index 0000000..8016bb5
--- /dev/null
+++ b/editor.h
@@ -0,0 +1,34 @@
+#ifndef EDITOR_H
+#define EDITOR_H
+
+struct strbuf;
+
+const char *git_editor(void);
+const char *git_sequence_editor(void);
+int is_terminal_dumb(void);
+
+/**
+ * Launch the user preferred editor to edit a file and fill the buffer
+ * with the file's contents upon the user completing their editing. The
+ * third argument can be used to set the environment which the editor is
+ * run in. If the buffer is NULL the editor is launched as usual but the
+ * file's contents are not read into the buffer upon completion.
+ */
+int launch_editor(const char *path, struct strbuf *buffer,
+ const char *const *env);
+
+int launch_sequence_editor(const char *path, struct strbuf *buffer,
+ const char *const *env);
+
+/*
+ * In contrast to `launch_editor()`, this function writes out the contents
+ * of the specified file first, then clears the `buffer`, then launches
+ * the editor and reads back in the file contents into the `buffer`.
+ * Finally, it deletes the temporary file.
+ *
+ * If `path` is relative, it refers to a file in the `.git` directory.
+ */
+int strbuf_edit_interactively(struct strbuf *buffer, const char *path,
+ const char *const *env);
+
+#endif
diff --git a/entry.c b/entry.c
index 616e4f0..f918a3a 100644
--- a/entry.c
+++ b/entry.c
@@ -1,9 +1,14 @@
-#include "cache.h"
-#include "blob.h"
-#include "object-store.h"
+#include "git-compat-util.h"
+#include "object-store-ll.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
+#include "name-hash.h"
+#include "sparse-index.h"
#include "streaming.h"
#include "submodule.h"
+#include "symlinks.h"
#include "progress.h"
#include "fsmonitor.h"
#include "entry.h"
@@ -86,7 +91,8 @@ void *read_blob_entry(const struct cache_entry *ce, size_t *size)
{
enum object_type type;
unsigned long ul;
- void *blob_data = read_object_file(&ce->oid, &type, &ul);
+ void *blob_data = repo_read_object_file(the_repository, &ce->oid,
+ &type, &ul);
*size = ul;
if (blob_data) {
@@ -383,7 +389,7 @@ static int write_entry(struct cache_entry *ce, char *path, struct conv_attrs *ca
return error("cannot create submodule directory %s", path);
sub = submodule_from_ce(ce);
if (sub)
- return submodule_move_head(ce->name,
+ return submodule_move_head(ce->name, state->super_prefix,
NULL, oid_to_hex(&ce->oid),
state->force ? SUBMODULE_MOVE_HEAD_FORCE : 0);
break;
@@ -476,7 +482,7 @@ int checkout_entry_ca(struct cache_entry *ce, struct conv_attrs *ca,
* no pathname to return.
*/
BUG("Can't remove entry to a path");
- unlink_entry(ce);
+ unlink_entry(ce, state->super_prefix);
return 0;
}
@@ -510,10 +516,10 @@ int checkout_entry_ca(struct cache_entry *ce, struct conv_attrs *ca,
if (!(st.st_mode & S_IFDIR))
unlink_or_warn(ce->name);
- return submodule_move_head(ce->name,
+ return submodule_move_head(ce->name, state->super_prefix,
NULL, oid_to_hex(&ce->oid), 0);
} else
- return submodule_move_head(ce->name,
+ return submodule_move_head(ce->name, state->super_prefix,
"HEAD", oid_to_hex(&ce->oid),
state->force ? SUBMODULE_MOVE_HEAD_FORCE : 0);
}
@@ -560,12 +566,12 @@ int checkout_entry_ca(struct cache_entry *ce, struct conv_attrs *ca,
return write_entry(ce, path.buf, ca, state, 0, nr_checkouts);
}
-void unlink_entry(const struct cache_entry *ce)
+void unlink_entry(const struct cache_entry *ce, const char *super_prefix)
{
const struct submodule *sub = submodule_from_ce(ce);
if (sub) {
/* state.force is set at the caller. */
- submodule_move_head(ce->name, "HEAD", NULL,
+ submodule_move_head(ce->name, super_prefix, "HEAD", NULL,
SUBMODULE_MOVE_HEAD_FORCE);
}
if (check_leading_path(ce->name, ce_namelen(ce), 1) >= 0)
@@ -574,3 +580,8 @@ void unlink_entry(const struct cache_entry *ce)
return;
schedule_dir_for_removal(ce->name, ce_namelen(ce));
}
+
+int remove_or_warn(unsigned int mode, const char *file)
+{
+ return S_ISGITLINK(mode) ? rmdir_or_warn(file) : unlink_or_warn(file);
+}
diff --git a/entry.h b/entry.h
index 9be4659..ca3ed35 100644
--- a/entry.h
+++ b/entry.h
@@ -1,13 +1,16 @@
#ifndef ENTRY_H
#define ENTRY_H
-#include "cache.h"
#include "convert.h"
+struct cache_entry;
+struct index_state;
+
struct checkout {
struct index_state *istate;
const char *base_dir;
int base_dir_len;
+ const char *super_prefix;
struct delayed_checkout *delayed_checkout;
struct checkout_metadata meta;
unsigned force:1,
@@ -48,12 +51,21 @@ int finish_delayed_checkout(struct checkout *state, int show_progress);
/*
* Unlink the last component and schedule the leading directories for
* removal, such that empty directories get removed.
+ *
+ * The "super_prefix" is either NULL, or the "--super-prefix" passed
+ * down from "read-tree" et al.
*/
-void unlink_entry(const struct cache_entry *ce);
+void unlink_entry(const struct cache_entry *ce, const char *super_prefix);
void *read_blob_entry(const struct cache_entry *ce, size_t *size);
int fstat_checkout_output(int fd, const struct checkout *state, struct stat *st);
void update_ce_after_write(const struct checkout *state, struct cache_entry *ce,
struct stat *st);
+/*
+ * Calls the correct function out of {unlink,rmdir}_or_warn based on
+ * the supplied file mode.
+ */
+int remove_or_warn(unsigned int mode, const char *path);
+
#endif /* ENTRY_H */
diff --git a/environment.c b/environment.c
index b3296ce..a73ba9c 100644
--- a/environment.c
+++ b/environment.c
@@ -7,19 +7,28 @@
* even if you might want to know where the git directory etc
* are.
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
#include "branch.h"
+#include "convert.h"
#include "environment.h"
+#include "gettext.h"
#include "repository.h"
#include "config.h"
#include "refs.h"
#include "fmt-merge-msg.h"
#include "commit.h"
#include "strvec.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "path.h"
+#include "replace-object.h"
#include "tmp-objdir.h"
#include "chdir-notify.h"
+#include "setup.h"
#include "shallow.h"
+#include "trace.h"
+#include "write-or-die.h"
int trust_executable_bit = 1;
int trust_ctime = 1;
@@ -33,7 +42,6 @@ int is_bare_repository_cfg = -1; /* unspecified */
int warn_ambiguous_refs = 1;
int warn_on_object_refname_ambiguity = 1;
int repository_format_precious_objects;
-int repository_format_worktree_config;
const char *git_commit_encoding;
const char *git_log_output_encoding;
char *apply_default_whitespace;
@@ -50,17 +58,13 @@ size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE;
size_t packed_git_limit = DEFAULT_PACKED_GIT_LIMIT;
size_t delta_base_cache_limit = 96 * 1024 * 1024;
unsigned long big_file_threshold = 512 * 1024 * 1024;
-int pager_use_color = 1;
const char *editor_program;
const char *askpass_program;
const char *excludes_file;
enum auto_crlf auto_crlf = AUTO_CRLF_FALSE;
-int read_replace_refs = 1;
-char *git_replace_ref_base;
enum eol core_eol = EOL_UNSET;
int global_conv_flags_eol = CONV_EOL_RNDTRP_WARN;
-char *check_roundtrip_encoding = "SHIFT-JIS";
-unsigned whitespace_rule_cfg = WS_DEFAULT_RULE;
+const char *check_roundtrip_encoding = "SHIFT-JIS";
enum branch_track git_branch_track = BRANCH_TRACK_REMOTE;
enum rebase_setup_type autorebase = AUTOREBASE_NEVER;
enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED;
@@ -69,7 +73,7 @@ enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED;
#endif
enum object_creation_mode object_creation_mode = OBJECT_CREATION_MODE;
char *notes_ref_name;
-int grafts_replace_parents = 1;
+int grafts_keep_true_parents;
int core_apply_sparse_checkout;
int core_sparse_checkout_cone;
int sparse_expect_files_outside_of_patterns;
@@ -77,6 +81,20 @@ int merge_log_config = -1;
int precomposed_unicode = -1; /* see probe_utf8_pathname_composition() */
unsigned long pack_size_limit_cfg;
enum log_refs_config log_all_ref_updates = LOG_REFS_UNSET;
+int max_allowed_tree_depth =
+#ifdef _MSC_VER
+ /*
+ * When traversing into too-deep trees, Visual C-compiled Git seems to
+ * run into some internal stack overflow detection in the
+ * `RtlpAllocateHeap()` function that is called from within
+ * `git_inflate_init()`'s call tree. The following value seems to be
+ * low enough to avoid that by letting Git exit with an error before
+ * the stack overflow can occur.
+ */
+ 512;
+#else
+ 2048;
+#endif
#ifndef PROTECT_HFS_DEFAULT
#define PROTECT_HFS_DEFAULT 0
@@ -92,7 +110,7 @@ int protect_ntfs = PROTECT_NTFS_DEFAULT;
* The character that begins a commented line in user-editable file
* that is subject to stripspace.
*/
-char comment_line_char = '#';
+const char *comment_line_str = "#";
int auto_comment_line_char;
/* Parallel index stat data preload? */
@@ -103,10 +121,8 @@ char *git_work_tree_cfg;
static char *git_namespace;
-static char *super_prefix;
-
/*
- * Repository-local GIT_* environment variables; see cache.h for details.
+ * Repository-local GIT_* environment variables; see environment.h for details.
*/
const char * const local_repo_env[] = {
ALTERNATE_DB_ENVIRONMENT,
@@ -122,7 +138,6 @@ const char * const local_repo_env[] = {
NO_REPLACE_OBJECTS_ENVIRONMENT,
GIT_REPLACE_REF_BASE_ENVIRONMENT,
GIT_PREFIX_ENVIRONMENT,
- GIT_SUPER_PREFIX_ENVIRONMENT,
GIT_SHALLOW_FILE_ENVIRONMENT,
GIT_COMMON_DIR_ENVIRONMENT,
NULL
@@ -162,6 +177,7 @@ const char *getenv_safe(struct strvec *argv, const char *name)
void setup_git_env(const char *git_dir)
{
+ char *git_replace_ref_base;
const char *shallow_file;
const char *replace_ref_base;
struct set_gitdir_args args = { NULL };
@@ -180,16 +196,20 @@ void setup_git_env(const char *git_dir)
strvec_clear(&to_free);
if (getenv(NO_REPLACE_OBJECTS_ENVIRONMENT))
- read_replace_refs = 0;
+ disable_replace_refs();
replace_ref_base = getenv(GIT_REPLACE_REF_BASE_ENVIRONMENT);
- free(git_replace_ref_base);
git_replace_ref_base = xstrdup(replace_ref_base ? replace_ref_base
: "refs/replace/");
+ update_ref_namespace(NAMESPACE_REPLACE, git_replace_ref_base);
+
free(git_namespace);
git_namespace = expand_namespace(getenv(GIT_NAMESPACE_ENVIRONMENT));
shallow_file = getenv(GIT_SHALLOW_FILE_ENVIRONMENT);
if (shallow_file)
set_alternate_shallow_file(the_repository, shallow_file, 0);
+
+ if (git_env_bool(NO_LAZY_FETCH_ENVIRONMENT, 0))
+ fetch_if_missing = 0;
}
int is_bare_repository(void)
@@ -233,16 +253,6 @@ const char *strip_namespace(const char *namespaced_ref)
return NULL;
}
-const char *get_super_prefix(void)
-{
- static int initialized;
- if (!initialized) {
- super_prefix = xstrdup_or_null(getenv(GIT_SUPER_PREFIX_ENVIRONMENT));
- initialized = 1;
- }
- return super_prefix;
-}
-
static int git_work_tree_initialized;
/*
@@ -333,10 +343,10 @@ static void set_git_dir_1(const char *path)
setup_git_env(path);
}
-static void update_relative_gitdir(const char *name,
+static void update_relative_gitdir(const char *name UNUSED,
const char *old_cwd,
const char *new_cwd,
- void *data)
+ void *data UNUSED)
{
char *path = reparent_relative_path(old_cwd, new_cwd, get_git_dir());
struct tmp_objdir *tmp_objdir = tmp_objdir_unapply_primary_odb();
diff --git a/environment.h b/environment.h
index d438b5c..05fd94d 100644
--- a/environment.h
+++ b/environment.h
@@ -1,7 +1,15 @@
#ifndef ENVIRONMENT_H
#define ENVIRONMENT_H
-#include "strvec.h"
+struct repository;
+struct strvec;
+
+/*
+ * The character that begins a commented line in user-editable file
+ * that is subject to stripspace.
+ */
+extern const char *comment_line_str;
+extern int auto_comment_line_char;
/*
* Wrapper of getenv() that returns a strdup value. This value is kept
@@ -9,4 +17,217 @@
*/
const char *getenv_safe(struct strvec *argv, const char *name);
+/* Double-check local_repo_env below if you add to this list. */
+#define GIT_DIR_ENVIRONMENT "GIT_DIR"
+#define GIT_COMMON_DIR_ENVIRONMENT "GIT_COMMON_DIR"
+#define GIT_NAMESPACE_ENVIRONMENT "GIT_NAMESPACE"
+#define GIT_WORK_TREE_ENVIRONMENT "GIT_WORK_TREE"
+#define GIT_PREFIX_ENVIRONMENT "GIT_PREFIX"
+#define DEFAULT_GIT_DIR_ENVIRONMENT ".git"
+#define DB_ENVIRONMENT "GIT_OBJECT_DIRECTORY"
+#define INDEX_ENVIRONMENT "GIT_INDEX_FILE"
+#define GRAFT_ENVIRONMENT "GIT_GRAFT_FILE"
+#define GIT_SHALLOW_FILE_ENVIRONMENT "GIT_SHALLOW_FILE"
+#define TEMPLATE_DIR_ENVIRONMENT "GIT_TEMPLATE_DIR"
+#define CONFIG_ENVIRONMENT "GIT_CONFIG"
+#define CONFIG_DATA_ENVIRONMENT "GIT_CONFIG_PARAMETERS"
+#define CONFIG_COUNT_ENVIRONMENT "GIT_CONFIG_COUNT"
+#define EXEC_PATH_ENVIRONMENT "GIT_EXEC_PATH"
+#define CEILING_DIRECTORIES_ENVIRONMENT "GIT_CEILING_DIRECTORIES"
+#define NO_REPLACE_OBJECTS_ENVIRONMENT "GIT_NO_REPLACE_OBJECTS"
+#define GIT_REPLACE_REF_BASE_ENVIRONMENT "GIT_REPLACE_REF_BASE"
+#define NO_LAZY_FETCH_ENVIRONMENT "GIT_NO_LAZY_FETCH"
+#define GITATTRIBUTES_FILE ".gitattributes"
+#define INFOATTRIBUTES_FILE "info/attributes"
+#define ATTRIBUTE_MACRO_PREFIX "[attr]"
+#define GITMODULES_FILE ".gitmodules"
+#define GITMODULES_INDEX ":.gitmodules"
+#define GITMODULES_HEAD "HEAD:.gitmodules"
+#define GIT_NOTES_REF_ENVIRONMENT "GIT_NOTES_REF"
+#define GIT_NOTES_DEFAULT_REF "refs/notes/commits"
+#define GIT_NOTES_DISPLAY_REF_ENVIRONMENT "GIT_NOTES_DISPLAY_REF"
+#define GIT_NOTES_REWRITE_REF_ENVIRONMENT "GIT_NOTES_REWRITE_REF"
+#define GIT_NOTES_REWRITE_MODE_ENVIRONMENT "GIT_NOTES_REWRITE_MODE"
+#define GIT_LITERAL_PATHSPECS_ENVIRONMENT "GIT_LITERAL_PATHSPECS"
+#define GIT_GLOB_PATHSPECS_ENVIRONMENT "GIT_GLOB_PATHSPECS"
+#define GIT_NOGLOB_PATHSPECS_ENVIRONMENT "GIT_NOGLOB_PATHSPECS"
+#define GIT_ICASE_PATHSPECS_ENVIRONMENT "GIT_ICASE_PATHSPECS"
+#define GIT_QUARANTINE_ENVIRONMENT "GIT_QUARANTINE_PATH"
+#define GIT_OPTIONAL_LOCKS_ENVIRONMENT "GIT_OPTIONAL_LOCKS"
+#define GIT_TEXT_DOMAIN_DIR_ENVIRONMENT "GIT_TEXTDOMAINDIR"
+#define GIT_ATTR_SOURCE_ENVIRONMENT "GIT_ATTR_SOURCE"
+
+/*
+ * Environment variable used in handshaking the wire protocol.
+ * Contains a colon ':' separated list of keys with optional values
+ * 'key[=value]'. Presence of unknown keys and values must be
+ * ignored.
+ */
+#define GIT_PROTOCOL_ENVIRONMENT "GIT_PROTOCOL"
+/* HTTP header used to handshake the wire protocol */
+#define GIT_PROTOCOL_HEADER "Git-Protocol"
+
+/*
+ * This environment variable is expected to contain a boolean indicating
+ * whether we should or should not treat:
+ *
+ * GIT_DIR=foo.git git ...
+ *
+ * as if GIT_WORK_TREE=. was given. It's not expected that users will make use
+ * of this, but we use it internally to communicate to sub-processes that we
+ * are in a bare repo. If not set, defaults to true.
+ */
+#define GIT_IMPLICIT_WORK_TREE_ENVIRONMENT "GIT_IMPLICIT_WORK_TREE"
+
+/*
+ * Repository-local GIT_* environment variables; these will be cleared
+ * when git spawns a sub-process that runs inside another repository.
+ * The array is NULL-terminated, which makes it easy to pass in the "env"
+ * parameter of a run-command invocation, or to do a simple walk.
+ */
+extern const char * const local_repo_env[];
+
+void setup_git_env(const char *git_dir);
+
+/*
+ * Returns true iff we have a configured git repository (either via
+ * setup_git_directory, or in the environment via $GIT_DIR).
+ */
+int have_git_dir(void);
+
+extern int is_bare_repository_cfg;
+int is_bare_repository(void);
+extern char *git_work_tree_cfg;
+const char *get_git_dir(void);
+const char *get_git_common_dir(void);
+const char *get_object_directory(void);
+char *get_index_file(void);
+char *get_graft_file(struct repository *r);
+void set_git_dir(const char *path, int make_realpath);
+const char *get_git_namespace(void);
+const char *strip_namespace(const char *namespaced_ref);
+const char *get_git_work_tree(void);
+void set_git_work_tree(const char *tree);
+
+#define ALTERNATE_DB_ENVIRONMENT "GIT_ALTERNATE_OBJECT_DIRECTORIES"
+
+/* Environment bits from configuration mechanism */
+extern int trust_executable_bit;
+extern int trust_ctime;
+extern int check_stat;
+extern int has_symlinks;
+extern int minimum_abbrev, default_abbrev;
+extern int ignore_case;
+extern int assume_unchanged;
+extern int prefer_symlink_refs;
+extern int warn_ambiguous_refs;
+extern int warn_on_object_refname_ambiguity;
+extern char *apply_default_whitespace;
+extern char *apply_default_ignorewhitespace;
+extern const char *git_attributes_file;
+extern const char *git_hooks_path;
+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;
+
+/*
+ * Accessors for the core.sharedrepository config which lazy-load the value
+ * from the config (if not already set). The "reset" function can be
+ * used to unset "set" or cached value, meaning that the value will be loaded
+ * fresh from the config file on the next call to get_shared_repository().
+ */
+void set_shared_repository(int value);
+int get_shared_repository(void);
+void reset_shared_repository(void);
+
+extern int core_preload_index;
+extern int precomposed_unicode;
+extern int protect_hfs;
+extern int protect_ntfs;
+
+extern int core_apply_sparse_checkout;
+extern int core_sparse_checkout_cone;
+extern int sparse_expect_files_outside_of_patterns;
+
+/*
+ * Returns the boolean value of $GIT_OPTIONAL_LOCKS (or the default value).
+ */
+int use_optional_locks(void);
+
+enum log_refs_config {
+ LOG_REFS_UNSET = -1,
+ LOG_REFS_NONE = 0,
+ LOG_REFS_NORMAL,
+ LOG_REFS_ALWAYS
+};
+extern enum log_refs_config log_all_ref_updates;
+
+enum rebase_setup_type {
+ AUTOREBASE_NEVER = 0,
+ AUTOREBASE_LOCAL,
+ AUTOREBASE_REMOTE,
+ AUTOREBASE_ALWAYS
+};
+
+enum push_default_type {
+ PUSH_DEFAULT_NOTHING = 0,
+ PUSH_DEFAULT_MATCHING,
+ PUSH_DEFAULT_SIMPLE,
+ PUSH_DEFAULT_UPSTREAM,
+ PUSH_DEFAULT_CURRENT,
+ PUSH_DEFAULT_UNSPECIFIED
+};
+
+extern enum rebase_setup_type autorebase;
+extern enum push_default_type push_default;
+
+enum object_creation_mode {
+ OBJECT_CREATION_USES_HARDLINKS = 0,
+ OBJECT_CREATION_USES_RENAMES = 1
+};
+
+extern enum object_creation_mode object_creation_mode;
+
+extern char *notes_ref_name;
+
+extern int grafts_keep_true_parents;
+
+extern int repository_format_precious_objects;
+
+/*
+ * Create a temporary file rooted in the object database directory, or
+ * die on failure. The filename is taken from "pattern", which should have the
+ * usual "XXXXXX" trailer, and the resulting filename is written into the
+ * "template" buffer. Returns the open descriptor.
+ */
+int odb_mkstemp(struct strbuf *temp_filename, const char *pattern);
+
+/*
+ * Create a pack .keep file named "name" (which should generally be the output
+ * of odb_pack_name). Returns a file descriptor opened for writing, or -1 on
+ * error.
+ */
+int odb_pack_keep(const char *name);
+
+const char *get_log_output_encoding(void);
+const char *get_commit_output_encoding(void);
+
+extern const char *git_commit_encoding;
+extern const char *git_log_output_encoding;
+
+extern const char *editor_program;
+extern const char *askpass_program;
+extern const char *excludes_file;
+
+/*
+ * Should we print an ellipsis after an abbreviated SHA-1 value
+ * when doing diff-raw output or indicating a detached HEAD?
+ */
+int print_sha1_ellipsis(void);
+
#endif
diff --git a/ewah/bitmap.c b/ewah/bitmap.c
index ac61864..ac7e0af 100644
--- a/ewah/bitmap.c
+++ b/ewah/bitmap.c
@@ -16,7 +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 "cache.h"
+#include "git-compat-util.h"
#include "ewok.h"
#define EWAH_MASK(x) ((eword_t)1 << (x % BITS_IN_EWORD))
@@ -169,6 +169,15 @@ size_t bitmap_popcount(struct bitmap *self)
return count;
}
+int bitmap_is_empty(struct bitmap *self)
+{
+ size_t i;
+ for (i = 0; i < self->word_alloc; i++)
+ if (self->words[i])
+ return 0;
+ return 1;
+}
+
int bitmap_equals(struct bitmap *self, struct bitmap *other)
{
struct bitmap *big, *small;
diff --git a/ewah/ewah_bitmap.c b/ewah/ewah_bitmap.c
index 6fe48d3..8785cbc 100644
--- a/ewah/ewah_bitmap.c
+++ b/ewah/ewah_bitmap.c
@@ -19,7 +19,6 @@
#include "git-compat-util.h"
#include "ewok.h"
#include "ewok_rlw.h"
-#include "cache.h"
static inline size_t min_size(size_t a, size_t b)
{
diff --git a/ewah/ewok.h b/ewah/ewok.h
index 7eb8b9b..c11d76c 100644
--- a/ewah/ewok.h
+++ b/ewah/ewok.h
@@ -189,5 +189,6 @@ void bitmap_or_ewah(struct bitmap *self, struct ewah_bitmap *other);
void bitmap_or(struct bitmap *self, const struct bitmap *other);
size_t bitmap_popcount(struct bitmap *self);
+int bitmap_is_empty(struct bitmap *self);
#endif
diff --git a/exec-cmd.c b/exec-cmd.c
index eeb2ee5..909777f 100644
--- a/exec-cmd.c
+++ b/exec-cmd.c
@@ -1,7 +1,13 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "environment.h"
#include "exec-cmd.h"
-#include "quote.h"
+#include "gettext.h"
+#include "path.h"
+#include "run-command.h"
#include "strvec.h"
+#include "trace.h"
+#include "trace2.h"
#if defined(RUNTIME_PREFIX)
@@ -252,7 +258,7 @@ static const char *system_prefix(void)
* This is called during initialization, but No work needs to be done here when
* runtime prefix is not being used.
*/
-void git_resolve_executable_dir(const char *argv0)
+void git_resolve_executable_dir(const char *argv0 UNUSED)
{
}
diff --git a/fetch-pack.c b/fetch-pack.c
index cb6647d..091f9a8 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -1,24 +1,28 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "repository.h"
#include "config.h"
+#include "date.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "lockfile.h"
#include "refs.h"
#include "pkt-line.h"
#include "commit.h"
#include "tag.h"
-#include "exec-cmd.h"
#include "pack.h"
#include "sideband.h"
#include "fetch-pack.h"
#include "remote.h"
#include "run-command.h"
#include "connect.h"
-#include "transport.h"
+#include "trace2.h"
#include "version.h"
#include "oid-array.h"
#include "oidset.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
+#include "path.h"
#include "connected.h"
#include "fetch-negotiator.h"
#include "fsck.h"
@@ -26,6 +30,7 @@
#include "commit-reach.h"
#include "commit-graph.h"
#include "sigchain.h"
+#include "mergesort.h"
static int transfer_unpack_limit = -1;
static int fetch_unpack_limit = -1;
@@ -175,8 +180,10 @@ static int rev_list_insert_ref(struct fetch_negotiator *negotiator,
return 0;
}
-static int rev_list_insert_ref_oid(const char *refname, const struct object_id *oid,
- int flag, void *cb_data)
+static int rev_list_insert_ref_oid(const char *refname UNUSED,
+ const struct object_id *oid,
+ int flag UNUSED,
+ void *cb_data)
{
return rev_list_insert_ref(cb_data, oid);
}
@@ -292,6 +299,29 @@ static void mark_tips(struct fetch_negotiator *negotiator,
return;
}
+static void send_filter(struct fetch_pack_args *args,
+ struct strbuf *req_buf,
+ int server_supports_filter)
+{
+ if (args->filter_options.choice) {
+ const char *spec =
+ expand_list_objects_filter_spec(&args->filter_options);
+ if (server_supports_filter) {
+ print_verbose(args, _("Server supports filter"));
+ packet_buf_write(req_buf, "filter %s", spec);
+ trace2_data_string("fetch", the_repository,
+ "filter/effective", spec);
+ } else {
+ warning("filtering not recognized by server, ignoring");
+ trace2_data_string("fetch", the_repository,
+ "filter/unsupported", spec);
+ }
+ } else {
+ trace2_data_string("fetch", the_repository,
+ "filter/none", "");
+ }
+}
+
static int find_common(struct fetch_negotiator *negotiator,
struct fetch_pack_args *args,
int fd[2], struct object_id *result_oid,
@@ -299,6 +329,7 @@ static int find_common(struct fetch_negotiator *negotiator,
{
int fetching;
int count = 0, flushes = 0, flush_at = INITIAL_FLUSH, retval;
+ int negotiation_round = 0, haves = 0;
const struct object_id *oid;
unsigned in_vain = 0;
int got_continue = 0;
@@ -389,11 +420,7 @@ static int find_common(struct fetch_negotiator *negotiator,
packet_buf_write(&req_buf, "deepen-not %s", s->string);
}
}
- if (server_supports_filtering && args->filter_options.choice) {
- const char *spec =
- expand_list_objects_filter_spec(&args->filter_options);
- packet_buf_write(&req_buf, "filter %s", spec);
- }
+ send_filter(args, &req_buf, server_supports_filtering);
packet_buf_flush(&req_buf);
state_len = req_buf.len;
@@ -441,9 +468,19 @@ static int find_common(struct fetch_negotiator *negotiator,
packet_buf_write(&req_buf, "have %s\n", oid_to_hex(oid));
print_verbose(args, "have %s", oid_to_hex(oid));
in_vain++;
+ haves++;
if (flush_at <= ++count) {
int ack;
+ negotiation_round++;
+ trace2_region_enter_printf("negotiation_v0_v1", "round",
+ the_repository, "%d",
+ negotiation_round);
+ trace2_data_intmax("negotiation_v0_v1", the_repository,
+ "haves_added", haves);
+ trace2_data_intmax("negotiation_v0_v1", the_repository,
+ "in_vain", in_vain);
+ haves = 0;
packet_buf_flush(&req_buf);
send_request(args, fd[1], &req_buf);
strbuf_setlen(&req_buf, state_len);
@@ -465,6 +502,9 @@ static int find_common(struct fetch_negotiator *negotiator,
ack, oid_to_hex(result_oid));
switch (ack) {
case ACK:
+ trace2_region_leave_printf("negotiation_v0_v1", "round",
+ the_repository, "%d",
+ negotiation_round);
flushes = 0;
multi_ack = 0;
retval = 0;
@@ -490,6 +530,7 @@ static int find_common(struct fetch_negotiator *negotiator,
const char *hex = oid_to_hex(result_oid);
packet_buf_write(&req_buf, "have %s\n", hex);
state_len = req_buf.len;
+ haves++;
/*
* Reset in_vain because an ack
* for this commit has not been
@@ -508,6 +549,9 @@ static int find_common(struct fetch_negotiator *negotiator,
}
} while (ack);
flushes--;
+ trace2_region_leave_printf("negotiation_v0_v1", "round",
+ the_repository, "%d",
+ negotiation_round);
if (got_continue && MAX_IN_VAIN < in_vain) {
print_verbose(args, _("giving up"));
break; /* give up */
@@ -518,6 +562,8 @@ static int find_common(struct fetch_negotiator *negotiator,
}
done:
trace2_region_leave("fetch-pack", "negotiation_v0_v1", the_repository);
+ trace2_data_intmax("negotiation_v0_v1", the_repository, "total_rounds",
+ negotiation_round);
if (!got_ready || !no_done) {
packet_buf_write(&req_buf, "done\n");
send_request(args, fd[1], &req_buf);
@@ -560,8 +606,10 @@ static int mark_complete(const struct object_id *oid)
return 0;
}
-static int mark_complete_oid(const char *refname, const struct object_id *oid,
- int flag, void *cb_data)
+static int mark_complete_oid(const char *refname UNUSED,
+ const struct object_id *oid,
+ int flag UNUSED,
+ void *cb_data UNUSED)
{
return mark_complete(oid);
}
@@ -678,7 +726,7 @@ static void filter_refs(struct fetch_pack_args *args,
*refs = newlist;
}
-static void mark_alternate_complete(struct fetch_negotiator *unused,
+static void mark_alternate_complete(struct fetch_negotiator *negotiator UNUSED,
struct object *obj)
{
mark_complete(&obj->oid);
@@ -718,9 +766,9 @@ static void mark_complete_and_common_ref(struct fetch_negotiator *negotiator,
if (!commit) {
struct object *o;
- if (!has_object_file_with_flags(&ref->old_oid,
- OBJECT_INFO_QUICK |
- OBJECT_INFO_SKIP_FETCH_OBJECT))
+ if (!repo_has_object_file_with_flags(the_repository, &ref->old_oid,
+ OBJECT_INFO_QUICK |
+ OBJECT_INFO_SKIP_FETCH_OBJECT))
continue;
o = parse_object(the_repository, &ref->old_oid);
if (!o || o->type != OBJ_COMMIT)
@@ -799,7 +847,7 @@ static int everything_local(struct fetch_pack_args *args,
return retval;
}
-static int sideband_demux(int in, int out, void *data)
+static int sideband_demux(int in UNUSED, int out, void *data)
{
int *xd = data;
int ret;
@@ -1025,6 +1073,13 @@ static int get_pack(struct fetch_pack_args *args,
return 0;
}
+static int ref_compare_name(const struct ref *a, const struct ref *b)
+{
+ return strcmp(a->name, b->name);
+}
+
+DEFINE_LIST_SORT(static, sort_ref_list, struct ref, next);
+
static int cmp_ref_by_name(const void *a_, const void *b_)
{
const struct ref *a = *((const struct ref **)a_);
@@ -1043,7 +1098,7 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
struct ref *ref = copy_ref_list(orig_ref);
struct object_id oid;
const char *agent_feature;
- int agent_len;
+ size_t agent_len;
struct fetch_negotiator negotiator_alloc;
struct fetch_negotiator *negotiator;
@@ -1061,7 +1116,7 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
agent_supported = 1;
if (agent_len)
print_verbose(args, _("Server version is %.*s"),
- agent_len, agent_feature);
+ (int)agent_len, agent_feature);
}
if (!server_supports("session-id"))
@@ -1266,15 +1321,15 @@ static void write_fetch_command_and_capabilities(struct strbuf *req_buf,
{
const char *hash_name;
- if (server_supports_v2("fetch", 1))
- packet_buf_write(req_buf, "command=fetch");
- if (server_supports_v2("agent", 0))
+ ensure_server_supports_v2("fetch");
+ packet_buf_write(req_buf, "command=fetch");
+ if (server_supports_v2("agent"))
packet_buf_write(req_buf, "agent=%s", git_user_agent_sanitized());
- if (advertise_sid && server_supports_v2("session-id", 0))
+ if (advertise_sid && server_supports_v2("session-id"))
packet_buf_write(req_buf, "session-id=%s", trace2_session_id());
- if (server_options && server_options->nr &&
- server_supports_v2("server-option", 1)) {
+ if (server_options && server_options->nr) {
int i;
+ ensure_server_supports_v2("server-option");
for (i = 0; i < server_options->nr; i++)
packet_buf_write(req_buf, "server-option=%s",
server_options->items[i].string);
@@ -1323,15 +1378,8 @@ static int send_fetch_request(struct fetch_negotiator *negotiator, int fd_out,
die(_("Server does not support shallow requests"));
/* Add filter */
- if (server_supports_feature("fetch", "filter", 0) &&
- args->filter_options.choice) {
- const char *spec =
- expand_list_objects_filter_spec(&args->filter_options);
- print_verbose(args, _("Server supports filter"));
- packet_buf_write(&req_buf, "filter %s", spec);
- } else if (args->filter_options.choice) {
- warning("filtering not recognized by server, ignoring");
- }
+ send_filter(args, &req_buf,
+ server_supports_feature("fetch", "filter", 0));
if (server_supports_feature("fetch", "packfile-uris", 0)) {
int i;
@@ -1361,6 +1409,8 @@ static int send_fetch_request(struct fetch_negotiator *negotiator, int fd_out,
haves_added = add_haves(negotiator, &req_buf, haves_to_send);
*in_vain += haves_added;
+ trace2_data_intmax("negotiation_v2", the_repository, "haves_added", haves_added);
+ trace2_data_intmax("negotiation_v2", the_repository, "in_vain", *in_vain);
if (!haves_added || (seen_ack && *in_vain >= MAX_IN_VAIN)) {
/* Send Done */
packet_buf_write(&req_buf, "done\n");
@@ -1603,6 +1653,7 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
struct oidset common = OIDSET_INIT;
struct packet_reader reader;
int in_vain = 0, negotiation_started = 0;
+ int negotiation_round = 0;
int haves_to_send = INITIAL_FLUSH;
struct fetch_negotiator negotiator_alloc;
struct fetch_negotiator *negotiator;
@@ -1659,12 +1710,20 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
"negotiation_v2",
the_repository);
}
+ negotiation_round++;
+ trace2_region_enter_printf("negotiation_v2", "round",
+ the_repository, "%d",
+ negotiation_round);
if (send_fetch_request(negotiator, fd[1], args, ref,
&common,
&haves_to_send, &in_vain,
reader.use_sideband,
- seen_ack))
+ seen_ack)) {
+ trace2_region_leave_printf("negotiation_v2", "round",
+ the_repository, "%d",
+ negotiation_round);
state = FETCH_GET_PACK;
+ }
else
state = FETCH_PROCESS_ACKS;
break;
@@ -1677,6 +1736,9 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
seen_ack = 1;
oidset_insert(&common, &common_oid);
}
+ trace2_region_leave_printf("negotiation_v2", "round",
+ the_repository, "%d",
+ negotiation_round);
if (received_ready) {
/*
* Don't check for response delimiter; get_pack() will
@@ -1692,6 +1754,8 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
trace2_region_leave("fetch-pack",
"negotiation_v2",
the_repository);
+ trace2_data_intmax("negotiation_v2", the_repository,
+ "total_rounds", negotiation_round);
/* Check for shallow-info section */
if (process_section_header(&reader, "shallow-info", 1))
receive_shallow_info(args, &reader, shallows, si);
@@ -1793,8 +1857,11 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
return ref;
}
-static int fetch_pack_config_cb(const char *var, const char *value, void *cb)
+static int fetch_pack_config_cb(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
+ const char *msg_id;
+
if (strcmp(var, "fetch.fsck.skiplist") == 0) {
const char *path;
@@ -1806,16 +1873,18 @@ static int fetch_pack_config_cb(const char *var, const char *value, void *cb)
return 0;
}
- if (skip_prefix(var, "fetch.fsck.", &var)) {
- if (is_valid_msg_type(var, value))
+ if (skip_prefix(var, "fetch.fsck.", &msg_id)) {
+ 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 ? ',' : '=', var, value);
+ fsck_msg_types.len ? ',' : '=', msg_id, value);
else
- warning("Skipping unknown msg id '%s'", var);
+ warning("Skipping unknown msg id '%s'", msg_id);
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
static void fetch_pack_config(void)
@@ -1844,10 +1913,10 @@ static void fetch_pack_setup(void)
if (did_setup)
return;
fetch_pack_config();
- if (0 <= transfer_unpack_limit)
- unpack_limit = transfer_unpack_limit;
- else if (0 <= fetch_unpack_limit)
+ if (0 <= fetch_unpack_limit)
unpack_limit = fetch_unpack_limit;
+ else if (0 <= transfer_unpack_limit)
+ unpack_limit = transfer_unpack_limit;
did_setup = 1;
}
@@ -1903,7 +1972,7 @@ static void update_shallow(struct fetch_pack_args *args,
struct oid_array extra = OID_ARRAY_INIT;
struct object_id *oid = si->shallow->oid;
for (i = 0; i < si->shallow->nr; i++)
- if (has_object_file(&oid[i]))
+ if (repo_has_object_file(the_repository, &oid[i]))
oid_array_append(&extra, &oid[i]);
if (extra.nr) {
setup_alternate_shallow(&shallow_lock,
@@ -2071,6 +2140,7 @@ void negotiate_using_fetch(const struct oid_array *negotiation_tips,
int in_vain = 0;
int seen_ack = 0;
int last_iteration = 0;
+ int negotiation_round = 0;
timestamp_t min_generation = GENERATION_NUMBER_INFINITY;
fetch_negotiator_init(the_repository, &negotiator);
@@ -2084,11 +2154,17 @@ void negotiate_using_fetch(const struct oid_array *negotiation_tips,
add_to_object_array,
&nt_object_array);
+ trace2_region_enter("fetch-pack", "negotiate_using_fetch", the_repository);
while (!last_iteration) {
int haves_added;
struct object_id common_oid;
int received_ready = 0;
+ negotiation_round++;
+
+ trace2_region_enter_printf("negotiate_using_fetch", "round",
+ the_repository, "%d",
+ negotiation_round);
strbuf_reset(&req_buf);
write_fetch_command_and_capabilities(&req_buf, server_options);
@@ -2099,6 +2175,11 @@ void negotiate_using_fetch(const struct oid_array *negotiation_tips,
if (!haves_added || (seen_ack && in_vain >= MAX_IN_VAIN))
last_iteration = 1;
+ trace2_data_intmax("negotiate_using_fetch", the_repository,
+ "haves_added", haves_added);
+ trace2_data_intmax("negotiate_using_fetch", the_repository,
+ "in_vain", in_vain);
+
/* Send request */
packet_buf_flush(&req_buf);
if (write_in_full(fd[1], req_buf.buf, req_buf.len) < 0)
@@ -2131,7 +2212,13 @@ void negotiate_using_fetch(const struct oid_array *negotiation_tips,
REACH_SCRATCH, 0,
min_generation))
last_iteration = 1;
+ trace2_region_leave_printf("negotiation", "round",
+ the_repository, "%d",
+ negotiation_round);
}
+ trace2_region_leave("fetch-pack", "negotiate_using_fetch", the_repository);
+ trace2_data_intmax("negotiate_using_fetch", the_repository,
+ "total_rounds", negotiation_round);
clear_common_flag(acked_commits);
strbuf_release(&req_buf);
}
diff --git a/fetch-pack.h b/fetch-pack.h
index 8c7752f..6775d26 100644
--- a/fetch-pack.h
+++ b/fetch-pack.h
@@ -2,7 +2,6 @@
#define FETCH_PACK_H
#include "string-list.h"
-#include "run-command.h"
#include "protocol.h"
#include "list-objects-filter-options.h"
#include "oidset.h"
diff --git a/fmt-merge-msg.c b/fmt-merge-msg.c
index f48f44f..ae201e2 100644
--- a/fmt-merge-msg.c
+++ b/fmt-merge-msg.c
@@ -1,8 +1,12 @@
+#include "git-compat-util.h"
#include "config.h"
+#include "environment.h"
#include "refs.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "diff.h"
#include "diff-merges.h"
+#include "hex.h"
#include "revision.h"
#include "tag.h"
#include "string-list.h"
@@ -10,18 +14,18 @@
#include "fmt-merge-msg.h"
#include "commit-reach.h"
#include "gpg-interface.h"
+#include "wildmatch.h"
static int use_branch_desc;
static int suppress_dest_pattern_seen;
static struct string_list suppress_dest_patterns = STRING_LIST_INIT_DUP;
-int fmt_merge_msg_config(const char *key, const char *value, void *cb)
+int fmt_merge_msg_config(const char *key, const char *value,
+ const struct config_context *ctx, void *cb)
{
- int status = 0;
-
if (!strcmp(key, "merge.log") || !strcmp(key, "merge.summary")) {
int is_bool;
- merge_log_config = git_config_bool_or_int(key, value, &is_bool);
+ merge_log_config = git_config_bool_or_int(key, value, ctx->kvi, &is_bool);
if (!is_bool && merge_log_config < 0)
return error("%s: negative length %s", key, value);
if (is_bool && merge_log_config)
@@ -37,10 +41,7 @@ int fmt_merge_msg_config(const char *key, const char *value, void *cb)
string_list_append(&suppress_dest_patterns, value);
suppress_dest_pattern_seen = 1;
} else {
- status = git_gpg_config(key, value, NULL);
- if (status)
- return status;
- return git_default_config(key, value, cb);
+ return git_default_config(key, value, ctx, cb);
}
return 0;
}
@@ -271,9 +272,10 @@ static void record_person_from_buf(int which, struct string_list *people,
static void record_person(int which, struct string_list *people,
struct commit *commit)
{
- const char *buffer = get_commit_buffer(commit, NULL);
+ const char *buffer = repo_get_commit_buffer(the_repository, commit,
+ NULL);
record_person_from_buf(which, people, buffer);
- unuse_commit_buffer(commit, buffer);
+ repo_unuse_commit_buffer(the_repository, commit, buffer);
}
static int cmp_string_list_util_as_integral(const void *a_, const void *b_)
@@ -319,7 +321,7 @@ static void credit_people(struct strbuf *out,
skip_prefix(me, them->items->string, &me) &&
starts_with(me, " <")))
return;
- strbuf_addf(out, "\n%c %s ", comment_line_char, label);
+ strbuf_addf(out, "\n%s %s ", comment_line_str, label);
add_people_count(out, them);
}
@@ -384,7 +386,8 @@ static void shortlog(const char *name,
if (subjects.nr > limit)
continue;
- format_commit_message(commit, "%s", &sb, &ctx);
+ repo_format_commit_message(the_repository, commit, "%s", &sb,
+ &ctx);
strbuf_ltrim(&sb);
if (!sb.len)
@@ -506,7 +509,8 @@ static void fmt_tag_signature(struct strbuf *tagbuf,
strbuf_complete_line(tagbuf);
if (sig->len) {
strbuf_addch(tagbuf, '\n');
- strbuf_add_commented_lines(tagbuf, sig->buf, sig->len);
+ strbuf_add_commented_lines(tagbuf, sig->buf, sig->len,
+ comment_line_str);
}
}
@@ -519,7 +523,8 @@ static void fmt_merge_msg_sigs(struct strbuf *out)
struct object_id *oid = origins.items[i].util;
enum object_type type;
unsigned long size;
- char *buf = read_object_file(oid, &type, &size);
+ char *buf = repo_read_object_file(the_repository, oid, &type,
+ &size);
char *origbuf = buf;
unsigned long len = size;
struct signature_check sigc = { NULL };
@@ -551,7 +556,8 @@ static void fmt_merge_msg_sigs(struct strbuf *out)
strbuf_addch(&tagline, '\n');
strbuf_add_commented_lines(&tagline,
origins.items[first_tag].string,
- strlen(origins.items[first_tag].string));
+ strlen(origins.items[first_tag].string),
+ comment_line_str);
strbuf_insert(&tagbuf, 0, tagline.buf,
tagline.len);
strbuf_release(&tagline);
@@ -559,7 +565,8 @@ static void fmt_merge_msg_sigs(struct strbuf *out)
strbuf_addch(&tagbuf, '\n');
strbuf_add_commented_lines(&tagbuf,
origins.items[i].string,
- strlen(origins.items[i].string));
+ strlen(origins.items[i].string),
+ comment_line_str);
fmt_tag_signature(&tagbuf, &sig, buf, len);
}
strbuf_release(&payload);
@@ -605,7 +612,9 @@ static void find_merge_parents(struct merge_parents *result,
* util field yet.
*/
obj = parse_object(the_repository, &oid);
- parent = (struct commit *)peel_to_type(NULL, 0, obj, OBJ_COMMIT);
+ parent = (struct commit *)repo_peel_to_type(the_repository,
+ NULL, 0, obj,
+ OBJ_COMMIT);
if (!parent)
continue;
commit_list_insert(parent, &parents);
diff --git a/fmt-merge-msg.h b/fmt-merge-msg.h
index 9905404..73ca3e4 100644
--- a/fmt-merge-msg.h
+++ b/fmt-merge-msg.h
@@ -13,7 +13,8 @@ struct fmt_merge_msg_opts {
};
extern int merge_log_config;
-int fmt_merge_msg_config(const char *key, const char *value, void *cb);
+int fmt_merge_msg_config(const char *key, const char *value,
+ const struct config_context *ctx, void *cb);
int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
struct fmt_merge_msg_opts *);
diff --git a/fsck.c b/fsck.c
index dd4822b..78af29d 100644
--- a/fsck.c
+++ b/fsck.c
@@ -1,7 +1,12 @@
-#include "cache.h"
-#include "object-store.h"
+#include "git-compat-util.h"
+#include "date.h"
+#include "dir.h"
+#include "hex.h"
+#include "object-store-ll.h"
+#include "path.h"
#include "repository.h"
#include "object.h"
+#include "attr.h"
#include "blob.h"
#include "tree.h"
#include "tree-walk.h"
@@ -11,14 +16,14 @@
#include "refs.h"
#include "url.h"
#include "utf8.h"
-#include "decorate.h"
#include "oidset.h"
#include "packfile.h"
#include "submodule-config.h"
#include "config.h"
-#include "credential.h"
#include "help.h"
+static ssize_t max_tree_entry_len = 4096;
+
#define STR(x) #x
#define MSG_ID(id, msg_type) { STR(id), NULL, NULL, FSCK_##msg_type },
static struct {
@@ -149,15 +154,29 @@ void fsck_set_msg_type(struct fsck_options *options,
const char *msg_id_str, const char *msg_type_str)
{
int msg_id = parse_msg_id(msg_id_str);
- enum fsck_msg_type msg_type = parse_msg_type(msg_type_str);
+ char *to_free = NULL;
+ enum fsck_msg_type msg_type;
if (msg_id < 0)
die("Unhandled message id: %s", msg_id_str);
+ if (msg_id == FSCK_MSG_LARGE_PATHNAME) {
+ const char *colon = strchr(msg_type_str, ':');
+ if (colon) {
+ msg_type_str = to_free =
+ xmemdupz(msg_type_str, colon - msg_type_str);
+ colon++;
+ if (!git_parse_ssize_t(colon, &max_tree_entry_len))
+ die("unable to parse max tree entry len: %s", colon);
+ }
+ }
+ msg_type = parse_msg_type(msg_type_str);
+
if (msg_type != FSCK_ERROR && msg_id_info[msg_id].msg_type == FSCK_FATAL)
die("Cannot demote %s to %s", msg_id_str, msg_type_str);
fsck_set_msg_type_from_ids(options, msg_id, msg_type);
+ free(to_free);
}
void fsck_set_msg_types(struct fsck_options *options, const char *values)
@@ -308,7 +327,8 @@ static int fsck_walk_tree(struct tree *tree, void *data, struct fsck_options *op
return -1;
name = fsck_get_object_name(options, &tree->object.oid);
- if (init_tree_desc_gently(&desc, tree->buffer, tree->size))
+ if (init_tree_desc_gently(&desc, &tree->object.oid,
+ tree->buffer, tree->size, 0))
return -1;
while (tree_entry_gently(&desc, &entry)) {
struct object *obj;
@@ -352,7 +372,7 @@ static int fsck_walk_commit(struct commit *commit, void *data, struct fsck_optio
int result;
const char *name;
- if (parse_commit(commit))
+ if (repo_parse_commit(the_repository, commit))
return -1;
name = fsck_get_object_name(options, &commit->object.oid);
@@ -360,7 +380,7 @@ static int fsck_walk_commit(struct commit *commit, void *data, struct fsck_optio
fsck_put_object_name(options, get_commit_tree_oid(commit),
"%s:", name);
- result = options->walk((struct object *)get_commit_tree(commit),
+ result = options->walk((struct object *) repo_get_commit_tree(the_repository, commit),
OBJ_TREE, data, options);
if (result < 0)
return result;
@@ -573,12 +593,14 @@ static int fsck_tree(const struct object_id *tree_oid,
int has_bad_modes = 0;
int has_dup_entries = 0;
int not_properly_sorted = 0;
+ int has_large_name = 0;
struct tree_desc desc;
unsigned o_mode;
const char *o_name;
struct name_stack df_dup_candidates = { NULL };
- if (init_tree_desc_gently(&desc, buffer, size)) {
+ if (init_tree_desc_gently(&desc, tree_oid, buffer, size,
+ TREE_DESC_RAW_MODES)) {
retval += report(options, tree_oid, OBJ_TREE,
FSCK_MSG_BAD_TREE,
"cannot be parsed as a tree");
@@ -602,6 +624,7 @@ static int fsck_tree(const struct object_id *tree_oid,
has_dotdot |= !strcmp(name, "..");
has_dotgit |= is_hfs_dotgit(name) || is_ntfs_dotgit(name);
has_zero_pad |= *(char *)desc.buffer == '0';
+ has_large_name |= tree_entry_len(&desc.entry) > max_tree_entry_len;
if (is_hfs_dotgitmodules(name) || is_ntfs_dotgitmodules(name)) {
if (!S_ISLNK(mode))
@@ -614,17 +637,22 @@ static int fsck_tree(const struct object_id *tree_oid,
".gitmodules is a symbolic link");
}
+ if (is_hfs_dotgitattributes(name) || is_ntfs_dotgitattributes(name)) {
+ if (!S_ISLNK(mode))
+ oidset_insert(&options->gitattributes_found,
+ entry_oid);
+ else
+ retval += report(options, tree_oid, OBJ_TREE,
+ FSCK_MSG_GITATTRIBUTES_SYMLINK,
+ ".gitattributes is a symlink");
+ }
+
if (S_ISLNK(mode)) {
if (is_hfs_dotgitignore(name) ||
is_ntfs_dotgitignore(name))
retval += report(options, tree_oid, OBJ_TREE,
FSCK_MSG_GITIGNORE_SYMLINK,
".gitignore is a symlink");
- if (is_hfs_dotgitattributes(name) ||
- is_ntfs_dotgitattributes(name))
- retval += report(options, tree_oid, OBJ_TREE,
- FSCK_MSG_GITATTRIBUTES_SYMLINK,
- ".gitattributes is a symlink");
if (is_hfs_dotmailmap(name) ||
is_ntfs_dotmailmap(name))
retval += report(options, tree_oid, OBJ_TREE,
@@ -739,9 +767,30 @@ static int fsck_tree(const struct object_id *tree_oid,
retval += report(options, tree_oid, OBJ_TREE,
FSCK_MSG_TREE_NOT_SORTED,
"not properly sorted");
+ if (has_large_name)
+ retval += report(options, tree_oid, OBJ_TREE,
+ FSCK_MSG_LARGE_PATHNAME,
+ "contains excessively large pathname");
return retval;
}
+/*
+ * Confirm that the headers of a commit or tag object end in a reasonable way,
+ * either with the usual "\n\n" separator, or at least with a trailing newline
+ * on the final header line.
+ *
+ * This property is important for the memory safety of our callers. It allows
+ * them to scan the buffer linewise without constantly checking the remaining
+ * size as long as:
+ *
+ * - they check that there are bytes left in the buffer at the start of any
+ * line (i.e., that the last newline they saw was not the final one we
+ * found here)
+ *
+ * - any intra-line scanning they do will stop at a newline, which will worst
+ * case hit the newline we found here as the end-of-header. This makes it
+ * OK for them to use helpers like parse_oid_hex(), or even skip_prefix().
+ */
static int verify_headers(const void *data, unsigned long size,
const struct object_id *oid, enum object_type type,
struct fsck_options *options)
@@ -802,6 +851,20 @@ static int fsck_ident(const char **ident,
if (*p != ' ')
return report(options, oid, type, FSCK_MSG_MISSING_SPACE_BEFORE_DATE, "invalid author/committer line - missing space before date");
p++;
+ /*
+ * Our timestamp parser is based on the C strto*() functions, which
+ * will happily eat whitespace, including the newline that is supposed
+ * to prevent us walking past the end of the buffer. So do our own
+ * scan, skipping linear whitespace but not newlines, and then
+ * confirming we found a digit. We _could_ be even more strict here,
+ * as we really expect only a single space, but since we have
+ * traditionally allowed extra whitespace, we'll continue to do so.
+ */
+ while (*p == ' ' || *p == '\t')
+ p++;
+ if (!isdigit(*p))
+ return report(options, oid, type, FSCK_MSG_BAD_DATE,
+ "invalid author/committer line - bad date");
if (*p == '0' && p[1] != ' ')
return report(options, oid, type, FSCK_MSG_ZERO_PADDED_DATE, "invalid author/committer line - zero-padded date");
if (date_overflows(parse_timestamp(p, &end, 10)))
@@ -828,12 +891,18 @@ static int fsck_commit(const struct object_id *oid,
unsigned author_count;
int err;
const char *buffer_begin = buffer;
+ const char *buffer_end = buffer + size;
const char *p;
+ /*
+ * We _must_ stop parsing immediately if this reports failure, as the
+ * memory safety of the rest of the function depends on it. See the
+ * comment above the definition of verify_headers() for more details.
+ */
if (verify_headers(buffer, size, oid, OBJ_COMMIT, options))
return -1;
- if (!skip_prefix(buffer, "tree ", &buffer))
+ if (buffer >= buffer_end || !skip_prefix(buffer, "tree ", &buffer))
return report(options, oid, OBJ_COMMIT, FSCK_MSG_MISSING_TREE, "invalid format - expected 'tree' line");
if (parse_oid_hex(buffer, &tree_oid, &p) || *p != '\n') {
err = report(options, oid, OBJ_COMMIT, FSCK_MSG_BAD_TREE_SHA1, "invalid 'tree' line format - bad sha1");
@@ -841,7 +910,7 @@ static int fsck_commit(const struct object_id *oid,
return err;
}
buffer = p + 1;
- while (skip_prefix(buffer, "parent ", &buffer)) {
+ while (buffer < buffer_end && skip_prefix(buffer, "parent ", &buffer)) {
if (parse_oid_hex(buffer, &parent_oid, &p) || *p != '\n') {
err = report(options, oid, OBJ_COMMIT, FSCK_MSG_BAD_PARENT_SHA1, "invalid 'parent' line format - bad sha1");
if (err)
@@ -850,7 +919,7 @@ static int fsck_commit(const struct object_id *oid,
buffer = p + 1;
}
author_count = 0;
- while (skip_prefix(buffer, "author ", &buffer)) {
+ while (buffer < buffer_end && skip_prefix(buffer, "author ", &buffer)) {
author_count++;
err = fsck_ident(&buffer, oid, OBJ_COMMIT, options);
if (err)
@@ -862,7 +931,7 @@ static int fsck_commit(const struct object_id *oid,
err = report(options, oid, OBJ_COMMIT, FSCK_MSG_MULTIPLE_AUTHORS, "invalid format - multiple 'author' lines");
if (err)
return err;
- if (!skip_prefix(buffer, "committer ", &buffer))
+ if (buffer >= buffer_end || !skip_prefix(buffer, "committer ", &buffer))
return report(options, oid, OBJ_COMMIT, FSCK_MSG_MISSING_COMMITTER, "invalid format - expected 'committer' line");
err = fsck_ident(&buffer, oid, OBJ_COMMIT, options);
if (err)
@@ -893,13 +962,19 @@ int fsck_tag_standalone(const struct object_id *oid, const char *buffer,
int ret = 0;
char *eol;
struct strbuf sb = STRBUF_INIT;
+ const char *buffer_end = buffer + size;
const char *p;
+ /*
+ * We _must_ stop parsing immediately if this reports failure, as the
+ * memory safety of the rest of the function depends on it. See the
+ * comment above the definition of verify_headers() for more details.
+ */
ret = verify_headers(buffer, size, oid, OBJ_TAG, options);
if (ret)
goto done;
- if (!skip_prefix(buffer, "object ", &buffer)) {
+ if (buffer >= buffer_end || !skip_prefix(buffer, "object ", &buffer)) {
ret = report(options, oid, OBJ_TAG, FSCK_MSG_MISSING_OBJECT, "invalid format - expected 'object' line");
goto done;
}
@@ -910,11 +985,11 @@ int fsck_tag_standalone(const struct object_id *oid, const char *buffer,
}
buffer = p + 1;
- if (!skip_prefix(buffer, "type ", &buffer)) {
+ if (buffer >= buffer_end || !skip_prefix(buffer, "type ", &buffer)) {
ret = report(options, oid, OBJ_TAG, FSCK_MSG_MISSING_TYPE_ENTRY, "invalid format - expected 'type' line");
goto done;
}
- eol = strchr(buffer, '\n');
+ eol = memchr(buffer, '\n', buffer_end - buffer);
if (!eol) {
ret = report(options, oid, OBJ_TAG, FSCK_MSG_MISSING_TYPE, "invalid format - unexpected end after 'type' line");
goto done;
@@ -926,11 +1001,11 @@ int fsck_tag_standalone(const struct object_id *oid, const char *buffer,
goto done;
buffer = eol + 1;
- if (!skip_prefix(buffer, "tag ", &buffer)) {
+ if (buffer >= buffer_end || !skip_prefix(buffer, "tag ", &buffer)) {
ret = report(options, oid, OBJ_TAG, FSCK_MSG_MISSING_TAG_ENTRY, "invalid format - expected 'tag' line");
goto done;
}
- eol = strchr(buffer, '\n');
+ eol = memchr(buffer, '\n', buffer_end - buffer);
if (!eol) {
ret = report(options, oid, OBJ_TAG, FSCK_MSG_MISSING_TAG, "invalid format - unexpected end after 'type' line");
goto done;
@@ -946,7 +1021,7 @@ int fsck_tag_standalone(const struct object_id *oid, const char *buffer,
}
buffer = eol + 1;
- if (!skip_prefix(buffer, "tagger ", &buffer)) {
+ if (buffer >= buffer_end || !skip_prefix(buffer, "tagger ", &buffer)) {
/* early tags do not contain 'tagger' lines; warn only */
ret = report(options, oid, OBJ_TAG, FSCK_MSG_MISSING_TAGGER_ENTRY, "invalid format - expected 'tagger' line");
if (ret)
@@ -954,10 +1029,8 @@ int fsck_tag_standalone(const struct object_id *oid, const char *buffer,
}
else
ret = fsck_ident(&buffer, oid, OBJ_TAG, options);
- if (!*buffer)
- goto done;
- if (!starts_with(buffer, "\n")) {
+ if (buffer < buffer_end && !starts_with(buffer, "\n")) {
/*
* The verify_headers() check will allow
* e.g. "[...]tagger <tagger>\nsome
@@ -975,145 +1048,15 @@ done:
return ret;
}
-static int starts_with_dot_slash(const char *const path)
-{
- return path_match_flags(path, PATH_MATCH_STARTS_WITH_DOT_SLASH |
- PATH_MATCH_XPLATFORM);
-}
-
-static int starts_with_dot_dot_slash(const char *const path)
-{
- return path_match_flags(path, PATH_MATCH_STARTS_WITH_DOT_DOT_SLASH |
- PATH_MATCH_XPLATFORM);
-}
-
-static int submodule_url_is_relative(const char *url)
-{
- return starts_with_dot_slash(url) || starts_with_dot_dot_slash(url);
-}
-
-/*
- * Count directory components that a relative submodule URL should chop
- * from the remote_url it is to be resolved against.
- *
- * In other words, this counts "../" components at the start of a
- * submodule URL.
- *
- * Returns the number of directory components to chop and writes a
- * pointer to the next character of url after all leading "./" and
- * "../" components to out.
- */
-static int count_leading_dotdots(const char *url, const char **out)
-{
- int result = 0;
- while (1) {
- if (starts_with_dot_dot_slash(url)) {
- result++;
- url += strlen("../");
- continue;
- }
- if (starts_with_dot_slash(url)) {
- url += strlen("./");
- continue;
- }
- *out = url;
- return result;
- }
-}
-/*
- * Check whether a transport is implemented by git-remote-curl.
- *
- * If it is, returns 1 and writes the URL that would be passed to
- * git-remote-curl to the "out" parameter.
- *
- * Otherwise, returns 0 and leaves "out" untouched.
- *
- * Examples:
- * http::https://example.com/repo.git -> 1, https://example.com/repo.git
- * https://example.com/repo.git -> 1, https://example.com/repo.git
- * git://example.com/repo.git -> 0
- *
- * This is for use in checking for previously exploitable bugs that
- * required a submodule URL to be passed to git-remote-curl.
- */
-static int url_to_curl_url(const char *url, const char **out)
-{
- /*
- * We don't need to check for case-aliases, "http.exe", and so
- * on because in the default configuration, is_transport_allowed
- * prevents URLs with those schemes from being cloned
- * automatically.
- */
- if (skip_prefix(url, "http::", out) ||
- skip_prefix(url, "https::", out) ||
- skip_prefix(url, "ftp::", out) ||
- skip_prefix(url, "ftps::", out))
- return 1;
- if (starts_with(url, "http://") ||
- starts_with(url, "https://") ||
- starts_with(url, "ftp://") ||
- starts_with(url, "ftps://")) {
- *out = url;
- return 1;
- }
- return 0;
-}
-
-static int check_submodule_url(const char *url)
-{
- const char *curl_url;
-
- if (looks_like_command_line_option(url))
- return -1;
-
- if (submodule_url_is_relative(url) || starts_with(url, "git://")) {
- char *decoded;
- const char *next;
- int has_nl;
-
- /*
- * This could be appended to an http URL and url-decoded;
- * check for malicious characters.
- */
- decoded = url_decode(url);
- has_nl = !!strchr(decoded, '\n');
-
- free(decoded);
- if (has_nl)
- return -1;
-
- /*
- * URLs which escape their root via "../" can overwrite
- * the host field and previous components, resolving to
- * URLs like https::example.com/submodule.git and
- * https:///example.com/submodule.git that were
- * susceptible to CVE-2020-11008.
- */
- if (count_leading_dotdots(url, &next) > 0 &&
- (*next == ':' || *next == '/'))
- return -1;
- }
-
- else if (url_to_curl_url(url, &curl_url)) {
- struct credential c = CREDENTIAL_INIT;
- int ret = 0;
- if (credential_from_url_gently(&c, curl_url, 1) ||
- !*c.host)
- ret = -1;
- credential_clear(&c);
- return ret;
- }
-
- return 0;
-}
-
struct fsck_gitmodules_data {
const struct object_id *oid;
struct fsck_options *options;
int ret;
};
-static int fsck_gitmodules_fn(const char *var, const char *value, void *vdata)
+static int fsck_gitmodules_fn(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *vdata)
{
struct fsck_gitmodules_data *data = vdata;
const char *subsection, *key;
@@ -1159,38 +1102,71 @@ static int fsck_gitmodules_fn(const char *var, const char *value, void *vdata)
static int fsck_blob(const struct object_id *oid, const char *buf,
unsigned long size, struct fsck_options *options)
{
- struct fsck_gitmodules_data data;
- struct config_options config_opts = { 0 };
-
- if (!oidset_contains(&options->gitmodules_found, oid))
- return 0;
- oidset_insert(&options->gitmodules_done, oid);
+ int ret = 0;
if (object_on_skiplist(options, oid))
return 0;
- if (!buf) {
- /*
- * A missing buffer here is a sign that the caller found the
- * blob too gigantic to load into memory. Let's just consider
- * that an error.
- */
- return report(options, oid, OBJ_BLOB,
- FSCK_MSG_GITMODULES_LARGE,
- ".gitmodules too large to parse");
+ if (oidset_contains(&options->gitmodules_found, oid)) {
+ struct config_options config_opts = { 0 };
+ struct fsck_gitmodules_data data;
+
+ oidset_insert(&options->gitmodules_done, oid);
+
+ if (!buf) {
+ /*
+ * A missing buffer here is a sign that the caller found the
+ * blob too gigantic to load into memory. Let's just consider
+ * that an error.
+ */
+ return report(options, oid, OBJ_BLOB,
+ FSCK_MSG_GITMODULES_LARGE,
+ ".gitmodules too large to parse");
+ }
+
+ data.oid = oid;
+ data.options = options;
+ data.ret = 0;
+ config_opts.error_action = CONFIG_ERROR_SILENT;
+ if (git_config_from_mem(fsck_gitmodules_fn, CONFIG_ORIGIN_BLOB,
+ ".gitmodules", buf, size, &data,
+ CONFIG_SCOPE_UNKNOWN, &config_opts))
+ data.ret |= report(options, oid, OBJ_BLOB,
+ FSCK_MSG_GITMODULES_PARSE,
+ "could not parse gitmodules blob");
+ ret |= data.ret;
}
- data.oid = oid;
- data.options = options;
- data.ret = 0;
- config_opts.error_action = CONFIG_ERROR_SILENT;
- if (git_config_from_mem(fsck_gitmodules_fn, CONFIG_ORIGIN_BLOB,
- ".gitmodules", buf, size, &data, &config_opts))
- data.ret |= report(options, oid, OBJ_BLOB,
- FSCK_MSG_GITMODULES_PARSE,
- "could not parse gitmodules blob");
-
- return data.ret;
+ if (oidset_contains(&options->gitattributes_found, oid)) {
+ const char *ptr;
+
+ oidset_insert(&options->gitattributes_done, oid);
+
+ if (!buf || size > ATTR_MAX_FILE_SIZE) {
+ /*
+ * A missing buffer here is a sign that the caller found the
+ * blob too gigantic to load into memory. Let's just consider
+ * that an error.
+ */
+ return report(options, oid, OBJ_BLOB,
+ FSCK_MSG_GITATTRIBUTES_LARGE,
+ ".gitattributes too large to parse");
+ }
+
+ for (ptr = buf; *ptr; ) {
+ const char *eol = strchrnul(ptr, '\n');
+ if (eol - ptr >= ATTR_MAX_LINE_LENGTH) {
+ ret |= report(options, oid, OBJ_BLOB,
+ FSCK_MSG_GITATTRIBUTES_LINE_LENGTH,
+ ".gitattributes has too long lines to parse");
+ break;
+ }
+
+ ptr = *eol ? eol + 1 : eol;
+ }
+ }
+
+ return ret;
}
int fsck_object(struct object *obj, void *data, unsigned long size,
@@ -1199,26 +1175,33 @@ int fsck_object(struct object *obj, void *data, unsigned long size,
if (!obj)
return report(options, NULL, OBJ_NONE, FSCK_MSG_BAD_OBJECT_SHA1, "no valid object to fsck");
- if (obj->type == OBJ_BLOB)
- return fsck_blob(&obj->oid, data, size, options);
- if (obj->type == OBJ_TREE)
- return fsck_tree(&obj->oid, data, size, options);
- if (obj->type == OBJ_COMMIT)
- return fsck_commit(&obj->oid, data, size, options);
- if (obj->type == OBJ_TAG)
- return fsck_tag(&obj->oid, data, size, options);
+ return fsck_buffer(&obj->oid, obj->type, data, size, options);
+}
- return report(options, &obj->oid, obj->type,
+int fsck_buffer(const struct object_id *oid, enum object_type type,
+ void *data, unsigned long size,
+ struct fsck_options *options)
+{
+ if (type == OBJ_BLOB)
+ return fsck_blob(oid, data, size, options);
+ if (type == OBJ_TREE)
+ return fsck_tree(oid, data, size, options);
+ if (type == OBJ_COMMIT)
+ return fsck_commit(oid, data, size, options);
+ if (type == OBJ_TAG)
+ return fsck_tag(oid, data, size, options);
+
+ return report(options, oid, type,
FSCK_MSG_UNKNOWN_TYPE,
"unknown type '%d' (internal fsck error)",
- obj->type);
+ type);
}
int fsck_error_function(struct fsck_options *o,
const struct object_id *oid,
- enum object_type object_type,
+ enum object_type object_type UNUSED,
enum fsck_msg_type msg_type,
- enum fsck_msg_id msg_id,
+ enum fsck_msg_id msg_id UNUSED,
const char *message)
{
if (msg_type == FSCK_WARN) {
@@ -1229,51 +1212,67 @@ int fsck_error_function(struct fsck_options *o,
return 1;
}
-int fsck_finish(struct fsck_options *options)
+static int fsck_blobs(struct oidset *blobs_found, struct oidset *blobs_done,
+ enum fsck_msg_id msg_missing, enum fsck_msg_id msg_type,
+ struct fsck_options *options, const char *blob_type)
{
int ret = 0;
struct oidset_iter iter;
const struct object_id *oid;
- oidset_iter_init(&options->gitmodules_found, &iter);
+ oidset_iter_init(blobs_found, &iter);
while ((oid = oidset_iter_next(&iter))) {
enum object_type type;
unsigned long size;
char *buf;
- if (oidset_contains(&options->gitmodules_done, oid))
+ if (oidset_contains(blobs_done, oid))
continue;
- buf = read_object_file(oid, &type, &size);
+ buf = repo_read_object_file(the_repository, oid, &type, &size);
if (!buf) {
if (is_promisor_object(oid))
continue;
ret |= report(options,
- oid, OBJ_BLOB,
- FSCK_MSG_GITMODULES_MISSING,
- "unable to read .gitmodules blob");
+ oid, OBJ_BLOB, msg_missing,
+ "unable to read %s blob", blob_type);
continue;
}
if (type == OBJ_BLOB)
ret |= fsck_blob(oid, buf, size, options);
else
- ret |= report(options,
- oid, type,
- FSCK_MSG_GITMODULES_BLOB,
- "non-blob found at .gitmodules");
+ ret |= report(options, oid, type, msg_type,
+ "non-blob found at %s", blob_type);
free(buf);
}
+ oidset_clear(blobs_found);
+ oidset_clear(blobs_done);
+
+ return ret;
+}
+
+int fsck_finish(struct fsck_options *options)
+{
+ int ret = 0;
+
+ ret |= fsck_blobs(&options->gitmodules_found, &options->gitmodules_done,
+ FSCK_MSG_GITMODULES_MISSING, FSCK_MSG_GITMODULES_BLOB,
+ options, ".gitmodules");
+ ret |= fsck_blobs(&options->gitattributes_found, &options->gitattributes_done,
+ FSCK_MSG_GITATTRIBUTES_MISSING, FSCK_MSG_GITATTRIBUTES_BLOB,
+ options, ".gitattributes");
- oidset_clear(&options->gitmodules_found);
- oidset_clear(&options->gitmodules_done);
return ret;
}
-int git_fsck_config(const char *var, const char *value, void *cb)
+int git_fsck_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
struct fsck_options *options = cb;
+ const char *msg_id;
+
if (strcmp(var, "fsck.skiplist") == 0) {
const char *path;
struct strbuf sb = STRBUF_INIT;
@@ -1287,12 +1286,14 @@ int git_fsck_config(const char *var, const char *value, void *cb)
return 0;
}
- if (skip_prefix(var, "fsck.", &var)) {
- fsck_set_msg_type(options, var, value);
+ if (skip_prefix(var, "fsck.", &msg_id)) {
+ if (!value)
+ return config_error_nonbool(var);
+ fsck_set_msg_type(options, msg_id, value);
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
/*
diff --git a/fsck.h b/fsck.h
index d07f7a2..e3adf9d 100644
--- a/fsck.h
+++ b/fsck.h
@@ -1,6 +1,7 @@
#ifndef GIT_FSCK_H
#define GIT_FSCK_H
+#include "object.h"
#include "oidset.h"
enum fsck_msg_type {
@@ -13,6 +14,12 @@ enum fsck_msg_type {
FSCK_WARN,
};
+/*
+ * Documentation/fsck-msgids.txt documents these; when
+ * modifying this list in any way, make sure to keep the
+ * two in sync.
+ */
+
#define FOREACH_FSCK_MSG_ID(FUNC) \
/* fatal errors */ \
FUNC(NUL_IN_HEADER, FATAL) \
@@ -24,7 +31,6 @@ enum fsck_msg_type {
FUNC(BAD_NAME, ERROR) \
FUNC(BAD_OBJECT_SHA1, ERROR) \
FUNC(BAD_PARENT_SHA1, ERROR) \
- FUNC(BAD_TAG_OBJECT, ERROR) \
FUNC(BAD_TIMEZONE, ERROR) \
FUNC(BAD_TREE, ERROR) \
FUNC(BAD_TREE_SHA1, ERROR) \
@@ -40,7 +46,6 @@ enum fsck_msg_type {
FUNC(MISSING_TAG, ERROR) \
FUNC(MISSING_TAG_ENTRY, ERROR) \
FUNC(MISSING_TREE, ERROR) \
- FUNC(MISSING_TREE_OBJECT, ERROR) \
FUNC(MISSING_TYPE, ERROR) \
FUNC(MISSING_TYPE_ENTRY, ERROR) \
FUNC(MULTIPLE_AUTHORS, ERROR) \
@@ -55,8 +60,11 @@ enum fsck_msg_type {
FUNC(GITMODULES_URL, ERROR) \
FUNC(GITMODULES_PATH, ERROR) \
FUNC(GITMODULES_UPDATE, ERROR) \
+ FUNC(GITATTRIBUTES_MISSING, ERROR) \
+ FUNC(GITATTRIBUTES_LARGE, ERROR) \
+ FUNC(GITATTRIBUTES_LINE_LENGTH, ERROR) \
+ FUNC(GITATTRIBUTES_BLOB, ERROR) \
/* warnings */ \
- FUNC(BAD_FILEMODE, WARN) \
FUNC(EMPTY_NAME, WARN) \
FUNC(FULL_PATHNAME, WARN) \
FUNC(HAS_DOT, WARN) \
@@ -65,7 +73,9 @@ enum fsck_msg_type {
FUNC(NULL_SHA1, WARN) \
FUNC(ZERO_PADDED_FILEMODE, WARN) \
FUNC(NUL_IN_COMMIT, WARN) \
+ FUNC(LARGE_PATHNAME, WARN) \
/* infos (reported as warnings, but ignored by default) */ \
+ FUNC(BAD_FILEMODE, INFO) \
FUNC(GITMODULES_PARSE, INFO) \
FUNC(GITIGNORE_SYMLINK, INFO) \
FUNC(GITATTRIBUTES_SYMLINK, INFO) \
@@ -129,6 +139,8 @@ struct fsck_options {
struct oidset skiplist;
struct oidset gitmodules_found;
struct oidset gitmodules_done;
+ struct oidset gitattributes_found;
+ struct oidset gitattributes_done;
kh_oid_map_t *object_names;
};
@@ -136,18 +148,24 @@ struct fsck_options {
.skiplist = OIDSET_INIT, \
.gitmodules_found = OIDSET_INIT, \
.gitmodules_done = OIDSET_INIT, \
+ .gitattributes_found = OIDSET_INIT, \
+ .gitattributes_done = OIDSET_INIT, \
.error_func = fsck_error_function \
}
#define FSCK_OPTIONS_STRICT { \
.strict = 1, \
.gitmodules_found = OIDSET_INIT, \
.gitmodules_done = OIDSET_INIT, \
+ .gitattributes_found = OIDSET_INIT, \
+ .gitattributes_done = OIDSET_INIT, \
.error_func = fsck_error_function, \
}
#define FSCK_OPTIONS_MISSING_GITMODULES { \
.strict = 1, \
.gitmodules_found = OIDSET_INIT, \
.gitmodules_done = OIDSET_INIT, \
+ .gitattributes_found = OIDSET_INIT, \
+ .gitattributes_done = OIDSET_INIT, \
.error_func = fsck_error_cb_print_missing_gitmodules, \
}
@@ -168,6 +186,14 @@ int fsck_object(struct object *obj, void *data, unsigned long size,
struct fsck_options *options);
/*
+ * Same as fsck_object(), but for when the caller doesn't have an object
+ * struct.
+ */
+int fsck_buffer(const struct object_id *oid, enum object_type,
+ void *data, unsigned long size,
+ struct fsck_options *options);
+
+/*
* fsck a tag, and pass info about it back to the caller. This is
* exposed fsck_object() internals for git-mktag(1).
*/
@@ -208,10 +234,12 @@ void fsck_put_object_name(struct fsck_options *options,
const char *fsck_describe_object(struct fsck_options *options,
const struct object_id *oid);
+struct key_value_info;
/*
* git_config() callback for use by fsck-y tools that want to support
* fsck.<msg> fsck.skipList etc.
*/
-int git_fsck_config(const char *var, const char *value, void *cb);
+int git_fsck_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb);
#endif
diff --git a/fsmonitor--daemon.h b/fsmonitor--daemon.h
index 2102a5c..5cbbec8 100644
--- a/fsmonitor--daemon.h
+++ b/fsmonitor--daemon.h
@@ -3,11 +3,9 @@
#ifdef HAVE_FSMONITOR_DAEMON_BACKEND
-#include "cache.h"
-#include "dir.h"
-#include "run-command.h"
-#include "simple-ipc.h"
+#include "hashmap.h"
#include "thread-utils.h"
+#include "fsmonitor-path-utils.h"
struct fsmonitor_batch;
struct fsmonitor_token_data;
@@ -43,6 +41,7 @@ struct fsmonitor_daemon_state {
struct strbuf path_worktree_watch;
struct strbuf path_gitdir_watch;
+ struct alias_info alias;
int nr_paths_watching;
struct fsmonitor_token_data *current_token_data;
@@ -59,6 +58,7 @@ struct fsmonitor_daemon_state {
struct ipc_server_data *ipc_server_data;
struct strbuf path_ipc;
+
};
/*
@@ -97,7 +97,7 @@ struct fsmonitor_daemon_state {
* to only mean an external GITDIR referenced by a ".git" file.
*
* The platform FS event backends will receive watch-specific
- * relative paths (except for those OS's that always emit absolute
+ * relative paths (except for those OSes that always emit absolute
* paths). We use the following enum and routines to classify each
* path so that we know how to handle it. There is a slight asymmetry
* here because ".git/" is inside the working directory and the
diff --git a/fsmonitor-ipc.c b/fsmonitor-ipc.c
index 789e739..45471b5 100644
--- a/fsmonitor-ipc.c
+++ b/fsmonitor-ipc.c
@@ -1,7 +1,8 @@
-#include "cache.h"
-#include "fsmonitor.h"
+#include "git-compat-util.h"
+#include "gettext.h"
#include "simple-ipc.h"
#include "fsmonitor-ipc.h"
+#include "repository.h"
#include "run-command.h"
#include "strbuf.h"
#include "trace2.h"
@@ -18,7 +19,7 @@ int fsmonitor_ipc__is_supported(void)
return 0;
}
-const char *fsmonitor_ipc__get_path(void)
+const char *fsmonitor_ipc__get_path(struct repository *r UNUSED)
{
return NULL;
}
@@ -28,14 +29,14 @@ enum ipc_active_state fsmonitor_ipc__get_state(void)
return IPC_STATE__OTHER_ERROR;
}
-int fsmonitor_ipc__send_query(const char *since_token,
- struct strbuf *answer)
+int fsmonitor_ipc__send_query(const char *since_token UNUSED,
+ struct strbuf *answer UNUSED)
{
return -1;
}
-int fsmonitor_ipc__send_command(const char *command,
- struct strbuf *answer)
+int fsmonitor_ipc__send_command(const char *command UNUSED,
+ struct strbuf *answer UNUSED)
{
return -1;
}
@@ -47,19 +48,21 @@ int fsmonitor_ipc__is_supported(void)
return 1;
}
-GIT_PATH_FUNC(fsmonitor_ipc__get_path, "fsmonitor--daemon.ipc")
-
enum ipc_active_state fsmonitor_ipc__get_state(void)
{
- return ipc_get_active_state(fsmonitor_ipc__get_path());
+ return ipc_get_active_state(fsmonitor_ipc__get_path(the_repository));
}
static int spawn_daemon(void)
{
- const char *args[] = { "fsmonitor--daemon", "start", NULL };
+ struct child_process cmd = CHILD_PROCESS_INIT;
+
+ cmd.git_cmd = 1;
+ cmd.no_stdin = 1;
+ cmd.trace2_child_class = "fsmonitor";
+ strvec_pushl(&cmd.args, "fsmonitor--daemon", "start", NULL);
- return run_command_v_opt_tr2(args, RUN_COMMAND_NO_STDIN | RUN_GIT_CMD,
- "fsmonitor");
+ return run_command(&cmd);
}
int fsmonitor_ipc__send_query(const char *since_token,
@@ -81,8 +84,8 @@ int fsmonitor_ipc__send_query(const char *since_token,
trace2_data_string("fsm_client", NULL, "query/command", tok);
try_again:
- state = ipc_client_try_connect(fsmonitor_ipc__get_path(), &options,
- &connection);
+ state = ipc_client_try_connect(fsmonitor_ipc__get_path(the_repository),
+ &options, &connection);
switch (state) {
case IPC_STATE__LISTENING:
@@ -117,13 +120,13 @@ try_again:
case IPC_STATE__INVALID_PATH:
ret = error(_("fsmonitor_ipc__send_query: invalid path '%s'"),
- fsmonitor_ipc__get_path());
+ fsmonitor_ipc__get_path(the_repository));
goto done;
case IPC_STATE__OTHER_ERROR:
default:
ret = error(_("fsmonitor_ipc__send_query: unspecified error on '%s'"),
- fsmonitor_ipc__get_path());
+ fsmonitor_ipc__get_path(the_repository));
goto done;
}
@@ -149,8 +152,8 @@ int fsmonitor_ipc__send_command(const char *command,
options.wait_if_busy = 1;
options.wait_if_not_found = 0;
- state = ipc_client_try_connect(fsmonitor_ipc__get_path(), &options,
- &connection);
+ state = ipc_client_try_connect(fsmonitor_ipc__get_path(the_repository),
+ &options, &connection);
if (state != IPC_STATE__LISTENING) {
die(_("fsmonitor--daemon is not running"));
return -1;
diff --git a/fsmonitor-ipc.h b/fsmonitor-ipc.h
index b6a7067..8b489da 100644
--- a/fsmonitor-ipc.h
+++ b/fsmonitor-ipc.h
@@ -3,6 +3,8 @@
#include "simple-ipc.h"
+struct repository;
+
/*
* Returns true if built-in file system monitor daemon is defined
* for this platform.
@@ -16,7 +18,7 @@ int fsmonitor_ipc__is_supported(void);
*
* Returns NULL if the daemon is not supported on this platform.
*/
-const char *fsmonitor_ipc__get_path(void);
+const char *fsmonitor_ipc__get_path(struct repository *r);
/*
* Try to determine whether there is a `git-fsmonitor--daemon` process
diff --git a/fsmonitor-ll.h b/fsmonitor-ll.h
new file mode 100644
index 0000000..0504ca0
--- /dev/null
+++ b/fsmonitor-ll.h
@@ -0,0 +1,52 @@
+#ifndef FSMONITOR_LL_H
+#define FSMONITOR_LL_H
+
+struct index_state;
+struct strbuf;
+
+extern struct trace_key trace_fsmonitor;
+
+/*
+ * Read the fsmonitor index extension and (if configured) restore the
+ * CE_FSMONITOR_VALID state.
+ */
+int read_fsmonitor_extension(struct index_state *istate, const void *data, unsigned long sz);
+
+/*
+ * Fill the fsmonitor_dirty ewah bits with their state from the index,
+ * before it is split during writing.
+ */
+void fill_fsmonitor_bitmap(struct index_state *istate);
+
+/*
+ * Write the CE_FSMONITOR_VALID state into the fsmonitor index
+ * extension. Reads from the fsmonitor_dirty ewah in the index.
+ */
+void write_fsmonitor_extension(struct strbuf *sb, struct index_state *istate);
+
+/*
+ * Add/remove the fsmonitor index extension
+ */
+void add_fsmonitor(struct index_state *istate);
+void remove_fsmonitor(struct index_state *istate);
+
+/*
+ * Add/remove the fsmonitor index extension as necessary based on the current
+ * core.fsmonitor setting.
+ */
+void tweak_fsmonitor(struct index_state *istate);
+
+/*
+ * Run the configured fsmonitor integration script and clear the
+ * CE_FSMONITOR_VALID bit for any files returned as dirty. Also invalidate
+ * any corresponding untracked cache directory structures. Optimized to only
+ * run the first time it is called.
+ */
+void refresh_fsmonitor(struct index_state *istate);
+
+/*
+ * Does the received result contain the "trivial" response?
+ */
+int fsmonitor_is_trivial_response(const struct strbuf *query_result);
+
+#endif /* FSMONITOR_LL_H */
diff --git a/fsmonitor-path-utils.h b/fsmonitor-path-utils.h
new file mode 100644
index 0000000..5bfdfb8
--- /dev/null
+++ b/fsmonitor-path-utils.h
@@ -0,0 +1,60 @@
+#ifndef FSM_PATH_UTILS_H
+#define FSM_PATH_UTILS_H
+
+#include "strbuf.h"
+
+struct alias_info
+{
+ struct strbuf alias;
+ struct strbuf points_to;
+};
+
+struct fs_info {
+ int is_remote;
+ char *typename;
+};
+
+/*
+ * Get some basic filesystem information for the given path
+ *
+ * The caller owns the storage that is occupied by fs_info and
+ * is responsible for releasing it.
+ *
+ * Returns -1 on error, zero otherwise.
+ */
+int fsmonitor__get_fs_info(const char *path, struct fs_info *fs_info);
+
+/*
+ * Determines if the filesystem that path resides on is remote.
+ *
+ * Returns -1 on error, 0 if not remote, 1 if remote.
+ */
+int fsmonitor__is_fs_remote(const char *path);
+
+/*
+ * Get the alias in given path, if any.
+ *
+ * Sets alias to the first alias that matches any part of the path.
+ *
+ * If an alias is found, info.alias and info.points_to are set to the
+ * found mapping.
+ *
+ * Returns -1 on error, 0 otherwise.
+ *
+ * The caller owns the storage that is occupied by info.alias and
+ * info.points_to and is responsible for releasing it.
+ */
+int fsmonitor__get_alias(const char *path, struct alias_info *info);
+
+/*
+ * Resolve the path against the given alias.
+ *
+ * Returns the resolved path if there is one, NULL otherwise.
+ *
+ * The caller owns the storage that the returned string occupies and
+ * is responsible for releasing it.
+ */
+char *fsmonitor__resolve_alias(const char *path,
+ const struct alias_info *info);
+
+#endif
diff --git a/fsmonitor-settings.c b/fsmonitor-settings.c
index 464424a..a6a9e6b 100644
--- a/fsmonitor-settings.c
+++ b/fsmonitor-settings.c
@@ -1,7 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "gettext.h"
#include "repository.h"
+#include "fsmonitor-ipc.h"
#include "fsmonitor-settings.h"
+#include "fsmonitor-path-utils.h"
/*
* We keep this structure defintion private and have getters
@@ -13,7 +16,54 @@ struct fsmonitor_settings {
char *hook_path;
};
-static enum fsmonitor_reason check_for_incompatible(struct repository *r)
+/*
+ * Remote working directories are problematic for FSMonitor.
+ *
+ * The underlying file system on the server machine and/or the remote
+ * mount type dictates whether notification events are available at
+ * all to remote client machines.
+ *
+ * Kernel differences between the server and client machines also
+ * dictate the how (buffering, frequency, de-dup) the events are
+ * delivered to client machine processes.
+ *
+ * A client machine (such as a laptop) may choose to suspend/resume
+ * and it is unclear (without lots of testing) whether the watcher can
+ * resync after a resume. We might be able to treat this as a normal
+ * "events were dropped by the kernel" event and do our normal "flush
+ * and resync" --or-- we might need to close the existing (zombie?)
+ * notification fd and create a new one.
+ *
+ * In theory, the above issues need to be addressed whether we are
+ * using the Hook or IPC API.
+ *
+ * So (for now at least), mark remote working directories as
+ * incompatible unless 'fsmonitor.allowRemote' is true.
+ *
+ */
+#ifdef HAVE_FSMONITOR_OS_SETTINGS
+static enum fsmonitor_reason check_remote(struct repository *r)
+{
+ int allow_remote = -1; /* -1 unset, 0 not allowed, 1 allowed */
+ int is_remote = fsmonitor__is_fs_remote(r->worktree);
+
+ switch (is_remote) {
+ case 0:
+ return FSMONITOR_REASON_OK;
+ case 1:
+ repo_config_get_bool(r, "fsmonitor.allowremote", &allow_remote);
+ if (allow_remote < 1)
+ return FSMONITOR_REASON_REMOTE;
+ else
+ return FSMONITOR_REASON_OK;
+ default:
+ return FSMONITOR_REASON_ERROR;
+ }
+}
+#endif
+
+static enum fsmonitor_reason check_for_incompatible(struct repository *r,
+ int ipc MAYBE_UNUSED)
{
if (!r->worktree) {
/*
@@ -27,7 +77,10 @@ static enum fsmonitor_reason check_for_incompatible(struct repository *r)
{
enum fsmonitor_reason reason;
- reason = fsm_os__incompatible(r);
+ reason = check_remote(r);
+ if (reason != FSMONITOR_REASON_OK)
+ return reason;
+ reason = fsm_os__incompatible(r, ipc);
if (reason != FSMONITOR_REASON_OK)
return reason;
}
@@ -92,8 +145,6 @@ static void lookup_fsmonitor_settings(struct repository *r)
enum fsmonitor_mode fsm_settings__get_mode(struct repository *r)
{
- if (!r)
- r = the_repository;
if (!r->settings.fsmonitor)
lookup_fsmonitor_settings(r);
@@ -102,8 +153,6 @@ enum fsmonitor_mode fsm_settings__get_mode(struct repository *r)
const char *fsm_settings__get_hook_path(struct repository *r)
{
- if (!r)
- r = the_repository;
if (!r->settings.fsmonitor)
lookup_fsmonitor_settings(r);
@@ -112,7 +161,7 @@ const char *fsm_settings__get_hook_path(struct repository *r)
void fsm_settings__set_ipc(struct repository *r)
{
- enum fsmonitor_reason reason = check_for_incompatible(r);
+ enum fsmonitor_reason reason = check_for_incompatible(r, 1);
if (reason != FSMONITOR_REASON_OK) {
fsm_settings__set_incompatible(r, reason);
@@ -123,8 +172,6 @@ void fsm_settings__set_ipc(struct repository *r)
* Caller requested IPC explicitly, so avoid (possibly
* recursive) config lookup.
*/
- if (!r)
- r = the_repository;
if (!r->settings.fsmonitor)
r->settings.fsmonitor = alloc_settings();
@@ -135,7 +182,7 @@ void fsm_settings__set_ipc(struct repository *r)
void fsm_settings__set_hook(struct repository *r, const char *path)
{
- enum fsmonitor_reason reason = check_for_incompatible(r);
+ enum fsmonitor_reason reason = check_for_incompatible(r, 0);
if (reason != FSMONITOR_REASON_OK) {
fsm_settings__set_incompatible(r, reason);
@@ -146,8 +193,6 @@ void fsm_settings__set_hook(struct repository *r, const char *path)
* Caller requested hook explicitly, so avoid (possibly
* recursive) config lookup.
*/
- if (!r)
- r = the_repository;
if (!r->settings.fsmonitor)
r->settings.fsmonitor = alloc_settings();
@@ -159,8 +204,6 @@ void fsm_settings__set_hook(struct repository *r, const char *path)
void fsm_settings__set_disabled(struct repository *r)
{
- if (!r)
- r = the_repository;
if (!r->settings.fsmonitor)
r->settings.fsmonitor = alloc_settings();
@@ -172,8 +215,6 @@ void fsm_settings__set_disabled(struct repository *r)
void fsm_settings__set_incompatible(struct repository *r,
enum fsmonitor_reason reason)
{
- if (!r)
- r = the_repository;
if (!r->settings.fsmonitor)
r->settings.fsmonitor = alloc_settings();
@@ -184,18 +225,17 @@ void fsm_settings__set_incompatible(struct repository *r,
enum fsmonitor_reason fsm_settings__get_reason(struct repository *r)
{
- if (!r)
- r = the_repository;
if (!r->settings.fsmonitor)
lookup_fsmonitor_settings(r);
return r->settings.fsmonitor->reason;
}
-char *fsm_settings__get_incompatible_msg(const struct repository *r,
+char *fsm_settings__get_incompatible_msg(struct repository *r,
enum fsmonitor_reason reason)
{
struct strbuf msg = STRBUF_INIT;
+ const char *socket_dir;
switch (reason) {
case FSMONITOR_REASON_UNTESTED:
@@ -231,9 +271,11 @@ char *fsm_settings__get_incompatible_msg(const struct repository *r,
goto done;
case FSMONITOR_REASON_NOSOCKETS:
+ socket_dir = dirname((char *)fsmonitor_ipc__get_path(r));
strbuf_addf(&msg,
- _("repository '%s' is incompatible with fsmonitor due to lack of Unix sockets"),
- r->worktree);
+ _("socket directory '%s' is incompatible with fsmonitor due"
+ " to lack of Unix sockets support"),
+ socket_dir);
goto done;
}
diff --git a/fsmonitor-settings.h b/fsmonitor-settings.h
index d9c2605..ab02e39 100644
--- a/fsmonitor-settings.h
+++ b/fsmonitor-settings.h
@@ -33,7 +33,7 @@ enum fsmonitor_mode fsm_settings__get_mode(struct repository *r);
const char *fsm_settings__get_hook_path(struct repository *r);
enum fsmonitor_reason fsm_settings__get_reason(struct repository *r);
-char *fsm_settings__get_incompatible_msg(const struct repository *r,
+char *fsm_settings__get_incompatible_msg(struct repository *r,
enum fsmonitor_reason reason);
struct fsmonitor_settings;
@@ -48,7 +48,7 @@ struct fsmonitor_settings;
* fsm_os__* routines should considered private to fsm_settings__
* routines.
*/
-enum fsmonitor_reason fsm_os__incompatible(struct repository *r);
+enum fsmonitor_reason fsm_os__incompatible(struct repository *r, int ipc);
#endif /* HAVE_FSMONITOR_OS_SETTINGS */
#endif /* FSMONITOR_SETTINGS_H */
diff --git a/fsmonitor.c b/fsmonitor.c
index 57d6a48..2b17d60 100644
--- a/fsmonitor.c
+++ b/fsmonitor.c
@@ -1,11 +1,14 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "dir.h"
+#include "environment.h"
#include "ewah/ewok.h"
#include "fsmonitor.h"
#include "fsmonitor-ipc.h"
+#include "name-hash.h"
#include "run-command.h"
#include "strbuf.h"
+#include "trace2.h"
#define INDEX_EXTENSION_VERSION1 (1)
#define INDEX_EXTENSION_VERSION2 (2)
@@ -181,79 +184,282 @@ static int query_fsmonitor_hook(struct repository *r,
return result;
}
-static void fsmonitor_refresh_callback(struct index_state *istate, char *name)
+/*
+ * Invalidate the FSM bit on this CE. This is like mark_fsmonitor_invalid()
+ * but we've already handled the untracked-cache, so let's not repeat that
+ * work. This also lets us have a different trace message so that we can
+ * see everything that was done as part of the refresh-callback.
+ */
+static void invalidate_ce_fsm(struct cache_entry *ce)
{
- int i, len = strlen(name);
- int pos = index_name_pos(istate, name, len);
+ if (ce->ce_flags & CE_FSMONITOR_VALID) {
+ trace_printf_key(&trace_fsmonitor,
+ "fsmonitor_refresh_callback INV: '%s'",
+ ce->name);
+ ce->ce_flags &= ~CE_FSMONITOR_VALID;
+ }
+}
+
+static size_t handle_path_with_trailing_slash(
+ struct index_state *istate, const char *name, int pos);
+/*
+ * Use the name-hash to do a case-insensitive cache-entry lookup with
+ * the pathname and invalidate the cache-entry.
+ *
+ * Returns the number of cache-entries that we invalidated.
+ */
+static size_t handle_using_name_hash_icase(
+ struct index_state *istate, const char *name)
+{
+ struct cache_entry *ce = NULL;
+
+ ce = index_file_exists(istate, name, strlen(name), 1);
+ if (!ce)
+ return 0;
+
+ /*
+ * A case-insensitive search in the name-hash using the
+ * observed pathname found a cache-entry, so the observed path
+ * is case-incorrect. Invalidate the cache-entry and use the
+ * correct spelling from the cache-entry to invalidate the
+ * untracked-cache. Since we now have sparse-directories in
+ * the index, the observed pathname may represent a regular
+ * file or a sparse-index directory.
+ *
+ * Note that we should not have seen FSEvents for a
+ * sparse-index directory, but we handle it just in case.
+ *
+ * Either way, we know that there are not any cache-entries for
+ * children inside the cone of the directory, so we don't need to
+ * do the usual scan.
+ */
trace_printf_key(&trace_fsmonitor,
- "fsmonitor_refresh_callback '%s' (pos %d)",
- name, pos);
+ "fsmonitor_refresh_callback MAP: '%s' '%s'",
+ name, ce->name);
- if (name[len - 1] == '/') {
- /*
- * The daemon can decorate directory events, such as
- * moves or renames, with a trailing slash if the OS
- * FS Event contains sufficient information, such as
- * MacOS.
- *
- * Use this to invalidate the entire cone under that
- * directory.
- *
- * We do not expect an exact match because the index
- * does not normally contain directory entries, so we
- * start at the insertion point and scan.
- */
- if (pos < 0)
- pos = -pos - 1;
+ /*
+ * NEEDSWORK: We used the name-hash to find the correct
+ * case-spelling of the pathname in the cache-entry[], so
+ * technically this is a tracked file or a sparse-directory.
+ * It should not have any entries in the untracked-cache, so
+ * we should not need to use the case-corrected spelling to
+ * invalidate the the untracked-cache. So we may not need to
+ * do this. For now, I'm going to be conservative and always
+ * do it; we can revisit this later.
+ */
+ untracked_cache_invalidate_trimmed_path(istate, ce->name, 0);
- /* Mark all entries for the folder invalid */
- for (i = pos; i < istate->cache_nr; i++) {
- if (!starts_with(istate->cache[i]->name, name))
- break;
- istate->cache[i]->ce_flags &= ~CE_FSMONITOR_VALID;
- }
+ invalidate_ce_fsm(ce);
+ return 1;
+}
+
+/*
+ * Use the dir-name-hash to find the correct-case spelling of the
+ * directory. Use the canonical spelling to invalidate all of the
+ * cache-entries within the matching cone.
+ *
+ * Returns the number of cache-entries that we invalidated.
+ */
+static size_t handle_using_dir_name_hash_icase(
+ struct index_state *istate, const char *name)
+{
+ struct strbuf canonical_path = STRBUF_INIT;
+ int pos;
+ size_t len = strlen(name);
+ size_t nr_in_cone;
+ if (name[len - 1] == '/')
+ len--;
+
+ if (!index_dir_find(istate, name, len, &canonical_path))
+ return 0; /* name is untracked */
+
+ if (!memcmp(name, canonical_path.buf, canonical_path.len)) {
+ strbuf_release(&canonical_path);
/*
- * We need to remove the traling "/" from the path
- * for the untracked cache.
+ * NEEDSWORK: Our caller already tried an exact match
+ * and failed to find one. They called us to do an
+ * ICASE match, so we should never get an exact match,
+ * so we could promote this to a BUG() here if we
+ * wanted to. It doesn't hurt anything to just return
+ * 0 and go on because we should never get here. Or we
+ * could just get rid of the memcmp() and this "if"
+ * clause completely.
*/
- name[len - 1] = '\0';
- } else if (pos >= 0) {
+ BUG("handle_using_dir_name_hash_icase(%s) did not exact match",
+ name);
+ }
+
+ trace_printf_key(&trace_fsmonitor,
+ "fsmonitor_refresh_callback MAP: '%s' '%s'",
+ name, canonical_path.buf);
+
+ /*
+ * The dir-name-hash only tells us the corrected spelling of
+ * the prefix. We have to use this canonical path to do a
+ * lookup in the cache-entry array so that we repeat the
+ * original search using the case-corrected spelling.
+ */
+ strbuf_addch(&canonical_path, '/');
+ pos = index_name_pos(istate, canonical_path.buf,
+ canonical_path.len);
+ nr_in_cone = handle_path_with_trailing_slash(
+ istate, canonical_path.buf, pos);
+ strbuf_release(&canonical_path);
+ return nr_in_cone;
+}
+
+/*
+ * The daemon sent an observed pathname without a trailing slash.
+ * (This is the normal case.) We do not know if it is a tracked or
+ * untracked file, a sparse-directory, or a populated directory (on a
+ * platform such as Windows where FSEvents are not qualified).
+ *
+ * The pathname contains the observed case reported by the FS. We
+ * do not know it is case-correct or -incorrect.
+ *
+ * Assume it is case-correct and try an exact match.
+ *
+ * Return the number of cache-entries that we invalidated.
+ */
+static size_t handle_path_without_trailing_slash(
+ struct index_state *istate, const char *name, int pos)
+{
+ /*
+ * Mark the untracked cache dirty for this path (regardless of
+ * whether or not we find an exact match for it in the index).
+ * Since the path is unqualified (no trailing slash hint in the
+ * FSEvent), it may refer to a file or directory. So we should
+ * not assume one or the other and should always let the untracked
+ * cache decide what needs to invalidated.
+ */
+ untracked_cache_invalidate_trimmed_path(istate, name, 0);
+
+ if (pos >= 0) {
/*
- * We have an exact match for this path and can just
- * invalidate it.
+ * An exact match on a tracked file. We assume that we
+ * do not need to scan forward for a sparse-directory
+ * cache-entry with the same pathname, nor for a cone
+ * at that directory. (That is, assume no D/F conflicts.)
*/
- istate->cache[pos]->ce_flags &= ~CE_FSMONITOR_VALID;
+ invalidate_ce_fsm(istate->cache[pos]);
+ return 1;
} else {
+ size_t nr_in_cone;
+ struct strbuf work_path = STRBUF_INIT;
+
/*
- * The path is not a tracked file -or- it is a
- * directory event on a platform that cannot
- * distinguish between file and directory events in
- * the event handler, such as Windows.
- *
- * Scan as if it is a directory and invalidate the
- * cone under it. (But remember to ignore items
- * between "name" and "name/", such as "name-" and
- * "name.".
+ * The negative "pos" gives us the suggested insertion
+ * point for the pathname (without the trailing slash).
+ * We need to see if there is a directory with that
+ * prefix, but there can be lots of pathnames between
+ * "foo" and "foo/" like "foo-" or "foo-bar", so we
+ * don't want to do our own scan.
*/
+ strbuf_add(&work_path, name, strlen(name));
+ strbuf_addch(&work_path, '/');
+ pos = index_name_pos(istate, work_path.buf, work_path.len);
+ nr_in_cone = handle_path_with_trailing_slash(
+ istate, work_path.buf, pos);
+ strbuf_release(&work_path);
+ return nr_in_cone;
+ }
+}
+
+/*
+ * The daemon can decorate directory events, such as a move or rename,
+ * by adding a trailing slash to the observed name. Use this to
+ * explicitly invalidate the entire cone under that directory.
+ *
+ * The daemon can only reliably do that if the OS FSEvent contains
+ * sufficient information in the event.
+ *
+ * macOS FSEvents have enough information.
+ *
+ * Other platforms may or may not be able to do it (and it might
+ * depend on the type of event (for example, a daemon could lstat() an
+ * observed pathname after a rename, but not after a delete)).
+ *
+ * If we find an exact match in the index for a path with a trailing
+ * slash, it means that we matched a sparse-index directory in a
+ * cone-mode sparse-checkout (since that's the only time we have
+ * directories in the index). We should never see this in practice
+ * (because sparse directories should not be present and therefore
+ * not generating FS events). Either way, we can treat them in the
+ * same way and just invalidate the cache-entry and the untracked
+ * cache (and in this case, the forward cache-entry scan won't find
+ * anything and it doesn't hurt to let it run).
+ *
+ * Return the number of cache-entries that we invalidated. We will
+ * use this later to determine if we need to attempt a second
+ * case-insensitive search on case-insensitive file systems. That is,
+ * if the search using the observed-case in the FSEvent yields any
+ * results, we assume the prefix is case-correct. If there are no
+ * matches, we still don't know if the observed path is simply
+ * untracked or case-incorrect.
+ */
+static size_t handle_path_with_trailing_slash(
+ struct index_state *istate, const char *name, int pos)
+{
+ int i;
+ size_t nr_in_cone = 0;
+
+ /*
+ * Mark the untracked cache dirty for this directory path
+ * (regardless of whether or not we find an exact match for it
+ * in the index or find it to be proper prefix of one or more
+ * files in the index), since the FSEvent is hinting that
+ * there may be changes on or within the directory.
+ */
+ untracked_cache_invalidate_trimmed_path(istate, name, 0);
+
+ if (pos < 0)
pos = -pos - 1;
- for (i = pos; i < istate->cache_nr; i++) {
- if (!starts_with(istate->cache[i]->name, name))
- break;
- if ((unsigned char)istate->cache[i]->name[len] > '/')
- break;
- if (istate->cache[i]->name[len] == '/')
- istate->cache[i]->ce_flags &= ~CE_FSMONITOR_VALID;
- }
+ /* Mark all entries for the folder invalid */
+ for (i = pos; i < istate->cache_nr; i++) {
+ if (!starts_with(istate->cache[i]->name, name))
+ break;
+ invalidate_ce_fsm(istate->cache[i]);
+ nr_in_cone++;
}
+ return nr_in_cone;
+}
+
+static void fsmonitor_refresh_callback(struct index_state *istate, char *name)
+{
+ int len = strlen(name);
+ int pos = index_name_pos(istate, name, len);
+ size_t nr_in_cone;
+
+ trace_printf_key(&trace_fsmonitor,
+ "fsmonitor_refresh_callback '%s' (pos %d)",
+ name, pos);
+
+ if (name[len - 1] == '/')
+ nr_in_cone = handle_path_with_trailing_slash(istate, name, pos);
+ else
+ nr_in_cone = handle_path_without_trailing_slash(istate, name, pos);
+
/*
- * Mark the untracked cache dirty even if it wasn't found in the index
- * as it could be a new untracked file.
+ * If we did not find an exact match for this pathname or any
+ * cache-entries with this directory prefix and we're on a
+ * case-insensitive file system, try again using the name-hash
+ * and dir-name-hash.
*/
- untracked_cache_invalidate_path(istate, name, 0);
+ if (!nr_in_cone && ignore_case) {
+ nr_in_cone = handle_using_name_hash_icase(istate, name);
+ if (!nr_in_cone)
+ nr_in_cone = handle_using_dir_name_hash_icase(
+ istate, name);
+ }
+
+ if (nr_in_cone)
+ trace_printf_key(&trace_fsmonitor,
+ "fsmonitor_refresh_callback CNT: %d",
+ (int)nr_in_cone);
}
/*
@@ -295,6 +501,7 @@ static int fsmonitor_force_update_threshold = 100;
void refresh_fsmonitor(struct index_state *istate)
{
+ static int warn_once = 0;
struct strbuf query_result = STRBUF_INIT;
int query_success = 0, hook_version = -1;
size_t bol = 0; /* beginning of line */
@@ -303,8 +510,16 @@ void refresh_fsmonitor(struct index_state *istate)
char *buf;
unsigned int i;
int is_trivial = 0;
- struct repository *r = istate->repo ? istate->repo : the_repository;
+ struct repository *r = istate->repo;
enum fsmonitor_mode fsm_mode = fsm_settings__get_mode(r);
+ enum fsmonitor_reason reason = fsm_settings__get_reason(r);
+
+ if (!warn_once && reason > FSMONITOR_REASON_OK) {
+ char *msg = fsm_settings__get_incompatible_msg(r, reason);
+ warn_once = 1;
+ warning("%s", msg);
+ free(msg);
+ }
if (fsm_mode <= FSMONITOR_MODE_DISABLED ||
istate->fsmonitor_has_run_once)
diff --git a/fsmonitor.h b/fsmonitor.h
index edf7ce5..5195a86 100644
--- a/fsmonitor.h
+++ b/fsmonitor.h
@@ -1,54 +1,12 @@
#ifndef FSMONITOR_H
#define FSMONITOR_H
-#include "cache.h"
+#include "fsmonitor-ll.h"
#include "dir.h"
#include "fsmonitor-settings.h"
-
-extern struct trace_key trace_fsmonitor;
-
-/*
- * Read the fsmonitor index extension and (if configured) restore the
- * CE_FSMONITOR_VALID state.
- */
-int read_fsmonitor_extension(struct index_state *istate, const void *data, unsigned long sz);
-
-/*
- * Fill the fsmonitor_dirty ewah bits with their state from the index,
- * before it is split during writing.
- */
-void fill_fsmonitor_bitmap(struct index_state *istate);
-
-/*
- * Write the CE_FSMONITOR_VALID state into the fsmonitor index
- * extension. Reads from the fsmonitor_dirty ewah in the index.
- */
-void write_fsmonitor_extension(struct strbuf *sb, struct index_state *istate);
-
-/*
- * Add/remove the fsmonitor index extension
- */
-void add_fsmonitor(struct index_state *istate);
-void remove_fsmonitor(struct index_state *istate);
-
-/*
- * Add/remove the fsmonitor index extension as necessary based on the current
- * core.fsmonitor setting.
- */
-void tweak_fsmonitor(struct index_state *istate);
-
-/*
- * Run the configured fsmonitor integration script and clear the
- * CE_FSMONITOR_VALID bit for any files returned as dirty. Also invalidate
- * any corresponding untracked cache directory structures. Optimized to only
- * run the first time it is called.
- */
-void refresh_fsmonitor(struct index_state *istate);
-
-/*
- * Does the received result contain the "trivial" response?
- */
-int fsmonitor_is_trivial_response(const struct strbuf *query_result);
+#include "object.h"
+#include "read-cache-ll.h"
+#include "trace.h"
/*
* Check if refresh_fsmonitor has been called at least once.
@@ -86,7 +44,7 @@ static inline void mark_fsmonitor_valid(struct index_state *istate, struct cache
!(ce->ce_flags & CE_FSMONITOR_VALID)) {
if (S_ISGITLINK(ce->ce_mode))
return;
- istate->cache_changed = 1;
+ istate->cache_changed |= FSMONITOR_CHANGED;
ce->ce_flags |= CE_FSMONITOR_VALID;
trace_printf_key(&trace_fsmonitor, "mark_fsmonitor_clean '%s'", ce->name);
}
diff --git a/fuzz-commit-graph.c b/fuzz-commit-graph.c
deleted file mode 100644
index e7cf6d5..0000000
--- a/fuzz-commit-graph.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "commit-graph.h"
-#include "repository.h"
-
-struct commit_graph *parse_commit_graph(struct repository *r,
- void *graph_map, size_t graph_size);
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
-{
- struct commit_graph *g;
-
- initialize_the_repository();
- g = parse_commit_graph(the_repository, (void *)data, size);
- repo_clear(the_repository);
- free_commit_graph(g);
-
- return 0;
-}
diff --git a/gettext.c b/gettext.c
index bb5ba1f..57facbc 100644
--- a/gettext.c
+++ b/gettext.c
@@ -2,15 +2,14 @@
* Copyright (c) 2010 Ævar Arnfjörð Bjarmason
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "environment.h"
#include "exec-cmd.h"
#include "gettext.h"
-#include "strbuf.h"
#include "utf8.h"
-#include "config.h"
#ifndef NO_GETTEXT
-# include <locale.h>
# include <libintl.h>
# ifdef GIT_WINDOWS_NATIVE
@@ -80,7 +79,6 @@ static int test_vsnprintf(const char *fmt, ...)
static void init_gettext_charset(const char *domain)
{
- setlocale(LC_CTYPE, "");
charset = locale_charset();
bind_textdomain_codeset(domain, charset);
@@ -102,6 +100,8 @@ static void init_gettext_charset(const char *domain)
setlocale(LC_CTYPE, "C");
}
+int git_gettext_enabled = 0;
+
void git_setup_gettext(void)
{
const char *podir = getenv(GIT_TEXT_DOMAIN_DIR_ENVIRONMENT);
@@ -121,6 +121,8 @@ void git_setup_gettext(void)
init_gettext_charset("git");
textdomain("git");
+ git_gettext_enabled = 1;
+
free(p);
}
diff --git a/gettext.h b/gettext.h
index d209911..484cafa 100644
--- a/gettext.h
+++ b/gettext.h
@@ -29,9 +29,11 @@
#define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
#ifndef NO_GETTEXT
+extern int git_gettext_enabled;
void git_setup_gettext(void);
int gettext_width(const char *s);
#else
+#define git_gettext_enabled (0)
static inline void git_setup_gettext(void)
{
}
@@ -45,12 +47,16 @@ static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
{
if (!*msgid)
return "";
+ if (!git_gettext_enabled)
+ return msgid;
return gettext(msgid);
}
static inline FORMAT_PRESERVING(1) FORMAT_PRESERVING(2)
const char *Q_(const char *msgid, const char *plu, unsigned long n)
{
+ if (!git_gettext_enabled)
+ return n == 1 ? msgid : plu;
return ngettext(msgid, plu, n);
}
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
deleted file mode 100755
index 95887fd..0000000
--- a/git-add--interactive.perl
+++ /dev/null
@@ -1,1920 +0,0 @@
-#!/usr/bin/perl
-
-use 5.008;
-use strict;
-use warnings;
-use Git qw(unquote_path);
-use Git::I18N;
-
-binmode(STDOUT, ":raw");
-
-my $repo = Git->repository();
-
-my $menu_use_color = $repo->get_colorbool('color.interactive');
-my ($prompt_color, $header_color, $help_color) =
- $menu_use_color ? (
- $repo->get_color('color.interactive.prompt', 'bold blue'),
- $repo->get_color('color.interactive.header', 'bold'),
- $repo->get_color('color.interactive.help', 'red bold'),
- ) : ();
-my $error_color = ();
-if ($menu_use_color) {
- my $help_color_spec = ($repo->config('color.interactive.help') or
- 'red bold');
- $error_color = $repo->get_color('color.interactive.error',
- $help_color_spec);
-}
-
-my $diff_use_color = $repo->get_colorbool('color.diff');
-my ($fraginfo_color) =
- $diff_use_color ? (
- $repo->get_color('color.diff.frag', 'cyan'),
- ) : ();
-my ($diff_context_color) =
- $diff_use_color ? (
- $repo->get_color($repo->config('color.diff.context') ? 'color.diff.context' : 'color.diff.plain', ''),
- ) : ();
-my ($diff_old_color) =
- $diff_use_color ? (
- $repo->get_color('color.diff.old', 'red'),
- ) : ();
-my ($diff_new_color) =
- $diff_use_color ? (
- $repo->get_color('color.diff.new', 'green'),
- ) : ();
-
-my $normal_color = $repo->get_color("", "reset");
-
-my $diff_algorithm = $repo->config('diff.algorithm');
-my $diff_filter = $repo->config('interactive.difffilter');
-
-my $use_readkey = 0;
-my $use_termcap = 0;
-my %term_escapes;
-
-sub ReadMode;
-sub ReadKey;
-if ($repo->config_bool("interactive.singlekey")) {
- eval {
- require Term::ReadKey;
- Term::ReadKey->import;
- $use_readkey = 1;
- };
- if (!$use_readkey) {
- print STDERR "missing Term::ReadKey, disabling interactive.singlekey\n";
- }
- eval {
- require Term::Cap;
- my $termcap = Term::Cap->Tgetent;
- foreach (values %$termcap) {
- $term_escapes{$_} = 1 if /^\e/;
- }
- $use_termcap = 1;
- };
-}
-
-sub colored {
- my $color = shift;
- my $string = join("", @_);
-
- if (defined $color) {
- # Put a color code at the beginning of each line, a reset at the end
- # color after newlines that are not at the end of the string
- $string =~ s/(\n+)(.)/$1$color$2/g;
- # reset before newlines
- $string =~ s/(\n+)/$normal_color$1/g;
- # codes at beginning and end (if necessary):
- $string =~ s/^/$color/;
- $string =~ s/$/$normal_color/ unless $string =~ /\n$/;
- }
- return $string;
-}
-
-# command line options
-my $patch_mode_only;
-my $patch_mode;
-my $patch_mode_revision;
-
-sub apply_patch;
-sub apply_patch_for_checkout_commit;
-sub apply_patch_for_stash;
-
-my %patch_modes = (
- 'stage' => {
- DIFF => 'diff-files -p',
- APPLY => sub { apply_patch 'apply --cached', @_; },
- APPLY_CHECK => 'apply --cached',
- FILTER => 'file-only',
- IS_REVERSE => 0,
- },
- 'stash' => {
- DIFF => 'diff-index -p HEAD',
- APPLY => sub { apply_patch 'apply --cached', @_; },
- APPLY_CHECK => 'apply --cached',
- FILTER => undef,
- IS_REVERSE => 0,
- },
- 'reset_head' => {
- DIFF => 'diff-index -p --cached',
- APPLY => sub { apply_patch 'apply -R --cached', @_; },
- APPLY_CHECK => 'apply -R --cached',
- FILTER => 'index-only',
- IS_REVERSE => 1,
- },
- 'reset_nothead' => {
- DIFF => 'diff-index -R -p --cached',
- APPLY => sub { apply_patch 'apply --cached', @_; },
- APPLY_CHECK => 'apply --cached',
- FILTER => 'index-only',
- IS_REVERSE => 0,
- },
- 'checkout_index' => {
- DIFF => 'diff-files -p',
- APPLY => sub { apply_patch 'apply -R', @_; },
- APPLY_CHECK => 'apply -R',
- FILTER => 'file-only',
- IS_REVERSE => 1,
- },
- 'checkout_head' => {
- DIFF => 'diff-index -p',
- APPLY => sub { apply_patch_for_checkout_commit '-R', @_ },
- APPLY_CHECK => 'apply -R',
- FILTER => undef,
- IS_REVERSE => 1,
- },
- 'checkout_nothead' => {
- DIFF => 'diff-index -R -p',
- APPLY => sub { apply_patch_for_checkout_commit '', @_ },
- APPLY_CHECK => 'apply',
- FILTER => undef,
- IS_REVERSE => 0,
- },
- 'worktree_head' => {
- DIFF => 'diff-index -p',
- APPLY => sub { apply_patch 'apply -R', @_ },
- APPLY_CHECK => 'apply -R',
- FILTER => undef,
- IS_REVERSE => 1,
- },
- 'worktree_nothead' => {
- DIFF => 'diff-index -R -p',
- APPLY => sub { apply_patch 'apply', @_ },
- APPLY_CHECK => 'apply',
- FILTER => undef,
- IS_REVERSE => 0,
- },
-);
-
-$patch_mode = 'stage';
-my %patch_mode_flavour = %{$patch_modes{$patch_mode}};
-
-sub run_cmd_pipe {
- if ($^O eq 'MSWin32') {
- my @invalid = grep {m/[":*]/} @_;
- die "$^O does not support: @invalid\n" if @invalid;
- my @args = map { m/ /o ? "\"$_\"": $_ } @_;
- return qx{@args};
- } else {
- my $fh = undef;
- open($fh, '-|', @_) or die;
- my @out = <$fh>;
- close $fh || die "Cannot close @_ ($!)";
- return @out;
- }
-}
-
-my ($GIT_DIR) = run_cmd_pipe(qw(git rev-parse --git-dir));
-
-if (!defined $GIT_DIR) {
- exit(1); # rev-parse would have already said "not a git repo"
-}
-chomp($GIT_DIR);
-
-sub refresh {
- my $fh;
- open $fh, 'git update-index --refresh |'
- or die;
- while (<$fh>) {
- ;# ignore 'needs update'
- }
- close $fh;
-}
-
-sub list_untracked {
- map {
- chomp $_;
- unquote_path($_);
- }
- run_cmd_pipe(qw(git ls-files --others --exclude-standard --), @ARGV);
-}
-
-# TRANSLATORS: you can adjust this to align "git add -i" status menu
-my $status_fmt = __('%12s %12s %s');
-my $status_head = sprintf($status_fmt, __('staged'), __('unstaged'), __('path'));
-
-{
- my $initial;
- sub is_initial_commit {
- $initial = system('git rev-parse HEAD -- >/dev/null 2>&1') != 0
- unless defined $initial;
- return $initial;
- }
-}
-
-{
- my $empty_tree;
- sub get_empty_tree {
- return $empty_tree if defined $empty_tree;
-
- ($empty_tree) = run_cmd_pipe(qw(git hash-object -t tree /dev/null));
- chomp $empty_tree;
- return $empty_tree;
- }
-}
-
-sub get_diff_reference {
- my $ref = shift;
- if (defined $ref and $ref ne 'HEAD') {
- return $ref;
- } elsif (is_initial_commit()) {
- return get_empty_tree();
- } else {
- return 'HEAD';
- }
-}
-
-# Returns list of hashes, contents of each of which are:
-# VALUE: pathname
-# BINARY: is a binary path
-# INDEX: is index different from HEAD?
-# FILE: is file different from index?
-# INDEX_ADDDEL: is it add/delete between HEAD and index?
-# FILE_ADDDEL: is it add/delete between index and file?
-# UNMERGED: is the path unmerged
-
-sub list_modified {
- my ($only) = @_;
- my (%data, @return);
- my ($add, $del, $adddel, $file);
-
- my $reference = get_diff_reference($patch_mode_revision);
- for (run_cmd_pipe(qw(git diff-index --cached
- --numstat --summary), $reference,
- '--', @ARGV)) {
- if (($add, $del, $file) =
- /^([-\d]+) ([-\d]+) (.*)/) {
- my ($change, $bin);
- $file = unquote_path($file);
- if ($add eq '-' && $del eq '-') {
- $change = __('binary');
- $bin = 1;
- }
- else {
- $change = "+$add/-$del";
- }
- $data{$file} = {
- INDEX => $change,
- BINARY => $bin,
- FILE => __('nothing'),
- }
- }
- elsif (($adddel, $file) =
- /^ (create|delete) mode [0-7]+ (.*)$/) {
- $file = unquote_path($file);
- $data{$file}{INDEX_ADDDEL} = $adddel;
- }
- }
-
- for (run_cmd_pipe(qw(git diff-files --ignore-submodules=dirty --numstat --summary --raw --), @ARGV)) {
- if (($add, $del, $file) =
- /^([-\d]+) ([-\d]+) (.*)/) {
- $file = unquote_path($file);
- my ($change, $bin);
- if ($add eq '-' && $del eq '-') {
- $change = __('binary');
- $bin = 1;
- }
- else {
- $change = "+$add/-$del";
- }
- $data{$file}{FILE} = $change;
- if ($bin) {
- $data{$file}{BINARY} = 1;
- }
- }
- elsif (($adddel, $file) =
- /^ (create|delete) mode [0-7]+ (.*)$/) {
- $file = unquote_path($file);
- $data{$file}{FILE_ADDDEL} = $adddel;
- }
- elsif (/^:[0-7]+ [0-7]+ [0-9a-f]+ [0-9a-f]+ (.) (.*)$/) {
- $file = unquote_path($2);
- if (!exists $data{$file}) {
- $data{$file} = +{
- INDEX => __('unchanged'),
- BINARY => 0,
- };
- }
- if ($1 eq 'U') {
- $data{$file}{UNMERGED} = 1;
- }
- }
- }
-
- for (sort keys %data) {
- my $it = $data{$_};
-
- if ($only) {
- if ($only eq 'index-only') {
- next if ($it->{INDEX} eq __('unchanged'));
- }
- if ($only eq 'file-only') {
- next if ($it->{FILE} eq __('nothing'));
- }
- }
- push @return, +{
- VALUE => $_,
- %$it,
- };
- }
- return @return;
-}
-
-sub find_unique {
- my ($string, @stuff) = @_;
- my $found = undef;
- for (my $i = 0; $i < @stuff; $i++) {
- my $it = $stuff[$i];
- my $hit = undef;
- if (ref $it) {
- if ((ref $it) eq 'ARRAY') {
- $it = $it->[0];
- }
- else {
- $it = $it->{VALUE};
- }
- }
- eval {
- if ($it =~ /^$string/) {
- $hit = 1;
- };
- };
- if (defined $hit && defined $found) {
- return undef;
- }
- if ($hit) {
- $found = $i + 1;
- }
- }
- return $found;
-}
-
-# inserts string into trie and updates count for each character
-sub update_trie {
- my ($trie, $string) = @_;
- foreach (split //, $string) {
- $trie = $trie->{$_} ||= {COUNT => 0};
- $trie->{COUNT}++;
- }
-}
-
-# returns an array of tuples (prefix, remainder)
-sub find_unique_prefixes {
- my @stuff = @_;
- my @return = ();
-
- # any single prefix exceeding the soft limit is omitted
- # if any prefix exceeds the hard limit all are omitted
- # 0 indicates no limit
- my $soft_limit = 0;
- my $hard_limit = 3;
-
- # build a trie modelling all possible options
- my %trie;
- foreach my $print (@stuff) {
- if ((ref $print) eq 'ARRAY') {
- $print = $print->[0];
- }
- elsif ((ref $print) eq 'HASH') {
- $print = $print->{VALUE};
- }
- update_trie(\%trie, $print);
- push @return, $print;
- }
-
- # use the trie to find the unique prefixes
- for (my $i = 0; $i < @return; $i++) {
- my $ret = $return[$i];
- my @letters = split //, $ret;
- my %search = %trie;
- my ($prefix, $remainder);
- my $j;
- for ($j = 0; $j < @letters; $j++) {
- my $letter = $letters[$j];
- if ($search{$letter}{COUNT} == 1) {
- $prefix = substr $ret, 0, $j + 1;
- $remainder = substr $ret, $j + 1;
- last;
- }
- else {
- my $prefix = substr $ret, 0, $j;
- return ()
- if ($hard_limit && $j + 1 > $hard_limit);
- }
- %search = %{$search{$letter}};
- }
- if (ord($letters[0]) > 127 ||
- ($soft_limit && $j + 1 > $soft_limit)) {
- $prefix = undef;
- $remainder = $ret;
- }
- $return[$i] = [$prefix, $remainder];
- }
- return @return;
-}
-
-# filters out prefixes which have special meaning to list_and_choose()
-sub is_valid_prefix {
- my $prefix = shift;
- return (defined $prefix) &&
- !($prefix =~ /[\s,]/) && # separators
- !($prefix =~ /^-/) && # deselection
- !($prefix =~ /^\d+/) && # selection
- ($prefix ne '*') && # "all" wildcard
- ($prefix ne '?'); # prompt help
-}
-
-# given a prefix/remainder tuple return a string with the prefix highlighted
-# for now use square brackets; later might use ANSI colors (underline, bold)
-sub highlight_prefix {
- my $prefix = shift;
- my $remainder = shift;
-
- if (!defined $prefix) {
- return $remainder;
- }
-
- if (!is_valid_prefix($prefix)) {
- return "$prefix$remainder";
- }
-
- if (!$menu_use_color) {
- return "[$prefix]$remainder";
- }
-
- return "$prompt_color$prefix$normal_color$remainder";
-}
-
-sub error_msg {
- print STDERR colored $error_color, @_;
-}
-
-sub list_and_choose {
- my ($opts, @stuff) = @_;
- my (@chosen, @return);
- if (!@stuff) {
- return @return;
- }
- my $i;
- my @prefixes = find_unique_prefixes(@stuff) unless $opts->{LIST_ONLY};
-
- TOPLOOP:
- while (1) {
- my $last_lf = 0;
-
- if ($opts->{HEADER}) {
- my $indent = $opts->{LIST_FLAT} ? "" : " ";
- print colored $header_color, "$indent$opts->{HEADER}\n";
- }
- for ($i = 0; $i < @stuff; $i++) {
- my $chosen = $chosen[$i] ? '*' : ' ';
- my $print = $stuff[$i];
- my $ref = ref $print;
- my $highlighted = highlight_prefix(@{$prefixes[$i]})
- if @prefixes;
- if ($ref eq 'ARRAY') {
- $print = $highlighted || $print->[0];
- }
- elsif ($ref eq 'HASH') {
- my $value = $highlighted || $print->{VALUE};
- $print = sprintf($status_fmt,
- $print->{INDEX},
- $print->{FILE},
- $value);
- }
- else {
- $print = $highlighted || $print;
- }
- printf("%s%2d: %s", $chosen, $i+1, $print);
- if (($opts->{LIST_FLAT}) &&
- (($i + 1) % ($opts->{LIST_FLAT}))) {
- print "\t";
- $last_lf = 0;
- }
- else {
- print "\n";
- $last_lf = 1;
- }
- }
- if (!$last_lf) {
- print "\n";
- }
-
- return if ($opts->{LIST_ONLY});
-
- print colored $prompt_color, $opts->{PROMPT};
- if ($opts->{SINGLETON}) {
- print "> ";
- }
- else {
- print ">> ";
- }
- my $line = <STDIN>;
- if (!$line) {
- print "\n";
- $opts->{ON_EOF}->() if $opts->{ON_EOF};
- last;
- }
- chomp $line;
- last if $line eq '';
- if ($line eq '?') {
- $opts->{SINGLETON} ?
- singleton_prompt_help_cmd() :
- prompt_help_cmd();
- next TOPLOOP;
- }
- for my $choice (split(/[\s,]+/, $line)) {
- my $choose = 1;
- my ($bottom, $top);
-
- # Input that begins with '-'; unchoose
- if ($choice =~ s/^-//) {
- $choose = 0;
- }
- # A range can be specified like 5-7 or 5-.
- if ($choice =~ /^(\d+)-(\d*)$/) {
- ($bottom, $top) = ($1, length($2) ? $2 : 1 + @stuff);
- }
- elsif ($choice =~ /^\d+$/) {
- $bottom = $top = $choice;
- }
- elsif ($choice eq '*') {
- $bottom = 1;
- $top = 1 + @stuff;
- }
- else {
- $bottom = $top = find_unique($choice, @stuff);
- if (!defined $bottom) {
- error_msg sprintf(__("Huh (%s)?\n"), $choice);
- next TOPLOOP;
- }
- }
- if ($opts->{SINGLETON} && $bottom != $top) {
- error_msg sprintf(__("Huh (%s)?\n"), $choice);
- next TOPLOOP;
- }
- for ($i = $bottom-1; $i <= $top-1; $i++) {
- next if (@stuff <= $i || $i < 0);
- $chosen[$i] = $choose;
- }
- }
- last if ($opts->{IMMEDIATE} || $line eq '*');
- }
- for ($i = 0; $i < @stuff; $i++) {
- if ($chosen[$i]) {
- push @return, $stuff[$i];
- }
- }
- return @return;
-}
-
-sub singleton_prompt_help_cmd {
- print colored $help_color, __ <<'EOF' ;
-Prompt help:
-1 - select a numbered item
-foo - select item based on unique prefix
- - (empty) select nothing
-EOF
-}
-
-sub prompt_help_cmd {
- print colored $help_color, __ <<'EOF' ;
-Prompt help:
-1 - select a single item
-3-5 - select a range of items
-2-3,6-9 - select multiple ranges
-foo - select item based on unique prefix
--... - unselect specified items
-* - choose all items
- - (empty) finish selecting
-EOF
-}
-
-sub status_cmd {
- list_and_choose({ LIST_ONLY => 1, HEADER => $status_head },
- list_modified());
- print "\n";
-}
-
-sub say_n_paths {
- my $did = shift @_;
- my $cnt = scalar @_;
- if ($did eq 'added') {
- printf(__n("added %d path\n", "added %d paths\n",
- $cnt), $cnt);
- } elsif ($did eq 'updated') {
- printf(__n("updated %d path\n", "updated %d paths\n",
- $cnt), $cnt);
- } elsif ($did eq 'reverted') {
- printf(__n("reverted %d path\n", "reverted %d paths\n",
- $cnt), $cnt);
- } else {
- printf(__n("touched %d path\n", "touched %d paths\n",
- $cnt), $cnt);
- }
-}
-
-sub update_cmd {
- my @mods = list_modified('file-only');
- return if (!@mods);
-
- my @update = list_and_choose({ PROMPT => __('Update'),
- HEADER => $status_head, },
- @mods);
- if (@update) {
- system(qw(git update-index --add --remove --),
- map { $_->{VALUE} } @update);
- say_n_paths('updated', @update);
- }
- print "\n";
-}
-
-sub revert_cmd {
- my @update = list_and_choose({ PROMPT => __('Revert'),
- HEADER => $status_head, },
- list_modified());
- if (@update) {
- if (is_initial_commit()) {
- system(qw(git rm --cached),
- map { $_->{VALUE} } @update);
- }
- else {
- my @lines = run_cmd_pipe(qw(git ls-tree HEAD --),
- map { $_->{VALUE} } @update);
- my $fh;
- open $fh, '| git update-index --index-info'
- or die;
- for (@lines) {
- print $fh $_;
- }
- close($fh);
- for (@update) {
- if ($_->{INDEX_ADDDEL} &&
- $_->{INDEX_ADDDEL} eq 'create') {
- system(qw(git update-index --force-remove --),
- $_->{VALUE});
- printf(__("note: %s is untracked now.\n"), $_->{VALUE});
- }
- }
- }
- refresh();
- say_n_paths('reverted', @update);
- }
- print "\n";
-}
-
-sub add_untracked_cmd {
- my @add = list_and_choose({ PROMPT => __('Add untracked') },
- list_untracked());
- if (@add) {
- system(qw(git update-index --add --), @add);
- say_n_paths('added', @add);
- } else {
- print __("No untracked files.\n");
- }
- print "\n";
-}
-
-sub run_git_apply {
- my $cmd = shift;
- my $fh;
- open $fh, '| git ' . $cmd . " --allow-overlap";
- print $fh @_;
- return close $fh;
-}
-
-sub parse_diff {
- my ($path) = @_;
- my @diff_cmd = split(" ", $patch_mode_flavour{DIFF});
- if (defined $diff_algorithm) {
- splice @diff_cmd, 1, 0, "--diff-algorithm=${diff_algorithm}";
- }
- if (defined $patch_mode_revision) {
- push @diff_cmd, get_diff_reference($patch_mode_revision);
- }
- my @diff = run_cmd_pipe("git", @diff_cmd, qw(--no-color --), $path);
- my @colored = ();
- if ($diff_use_color) {
- my @display_cmd = ("git", @diff_cmd, qw(--color --), $path);
- if (defined $diff_filter) {
- # quotemeta is overkill, but sufficient for shell-quoting
- my $diff = join(' ', map { quotemeta } @display_cmd);
- @display_cmd = ("$diff | $diff_filter");
- }
-
- @colored = run_cmd_pipe(@display_cmd);
- }
- my (@hunk) = { TEXT => [], DISPLAY => [], TYPE => 'header' };
-
- if (@colored && @colored != @diff) {
- print STDERR
- "fatal: mismatched output from interactive.diffFilter\n",
- "hint: Your filter must maintain a one-to-one correspondence\n",
- "hint: between its input and output lines.\n";
- exit 1;
- }
-
- for (my $i = 0; $i < @diff; $i++) {
- if ($diff[$i] =~ /^@@ /) {
- push @hunk, { TEXT => [], DISPLAY => [],
- TYPE => 'hunk' };
- }
- push @{$hunk[-1]{TEXT}}, $diff[$i];
- push @{$hunk[-1]{DISPLAY}},
- (@colored ? $colored[$i] : $diff[$i]);
- }
- return @hunk;
-}
-
-sub parse_diff_header {
- my $src = shift;
-
- my $head = { TEXT => [], DISPLAY => [], TYPE => 'header' };
- my $mode = { TEXT => [], DISPLAY => [], TYPE => 'mode' };
- my $deletion = { TEXT => [], DISPLAY => [], TYPE => 'deletion' };
- my $addition;
-
- for (my $i = 0; $i < @{$src->{TEXT}}; $i++) {
- if ($src->{TEXT}->[$i] =~ /^new file/) {
- $addition = 1;
- $head->{TYPE} = 'addition';
- }
- my $dest =
- $src->{TEXT}->[$i] =~ /^(old|new) mode (\d+)$/ ? $mode :
- $src->{TEXT}->[$i] =~ /^deleted file/ ? $deletion :
- $head;
- push @{$dest->{TEXT}}, $src->{TEXT}->[$i];
- push @{$dest->{DISPLAY}}, $src->{DISPLAY}->[$i];
- }
- return ($head, $mode, $deletion, $addition);
-}
-
-sub hunk_splittable {
- my ($text) = @_;
-
- my @s = split_hunk($text);
- return (1 < @s);
-}
-
-sub parse_hunk_header {
- my ($line) = @_;
- my ($o_ofs, $o_cnt, $n_ofs, $n_cnt) =
- $line =~ /^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;
- $o_cnt = 1 unless defined $o_cnt;
- $n_cnt = 1 unless defined $n_cnt;
- return ($o_ofs, $o_cnt, $n_ofs, $n_cnt);
-}
-
-sub format_hunk_header {
- my ($o_ofs, $o_cnt, $n_ofs, $n_cnt) = @_;
- return ("@@ -$o_ofs" .
- (($o_cnt != 1) ? ",$o_cnt" : '') .
- " +$n_ofs" .
- (($n_cnt != 1) ? ",$n_cnt" : '') .
- " @@\n");
-}
-
-sub split_hunk {
- my ($text, $display) = @_;
- my @split = ();
- if (!defined $display) {
- $display = $text;
- }
- # If there are context lines in the middle of a hunk,
- # it can be split, but we would need to take care of
- # overlaps later.
-
- my ($o_ofs, undef, $n_ofs) = parse_hunk_header($text->[0]);
- my $hunk_start = 1;
-
- OUTER:
- while (1) {
- my $next_hunk_start = undef;
- my $i = $hunk_start - 1;
- my $this = +{
- TEXT => [],
- DISPLAY => [],
- TYPE => 'hunk',
- OLD => $o_ofs,
- NEW => $n_ofs,
- OCNT => 0,
- NCNT => 0,
- ADDDEL => 0,
- POSTCTX => 0,
- USE => undef,
- };
-
- while (++$i < @$text) {
- my $line = $text->[$i];
- my $display = $display->[$i];
- if ($line =~ /^\\/) {
- push @{$this->{TEXT}}, $line;
- push @{$this->{DISPLAY}}, $display;
- next;
- }
- if ($line =~ /^ /) {
- if ($this->{ADDDEL} &&
- !defined $next_hunk_start) {
- # We have seen leading context and
- # adds/dels and then here is another
- # context, which is trailing for this
- # split hunk and leading for the next
- # one.
- $next_hunk_start = $i;
- }
- push @{$this->{TEXT}}, $line;
- push @{$this->{DISPLAY}}, $display;
- $this->{OCNT}++;
- $this->{NCNT}++;
- if (defined $next_hunk_start) {
- $this->{POSTCTX}++;
- }
- next;
- }
-
- # add/del
- if (defined $next_hunk_start) {
- # We are done with the current hunk and
- # this is the first real change for the
- # next split one.
- $hunk_start = $next_hunk_start;
- $o_ofs = $this->{OLD} + $this->{OCNT};
- $n_ofs = $this->{NEW} + $this->{NCNT};
- $o_ofs -= $this->{POSTCTX};
- $n_ofs -= $this->{POSTCTX};
- push @split, $this;
- redo OUTER;
- }
- push @{$this->{TEXT}}, $line;
- push @{$this->{DISPLAY}}, $display;
- $this->{ADDDEL}++;
- if ($line =~ /^-/) {
- $this->{OCNT}++;
- }
- else {
- $this->{NCNT}++;
- }
- }
-
- push @split, $this;
- last;
- }
-
- for my $hunk (@split) {
- $o_ofs = $hunk->{OLD};
- $n_ofs = $hunk->{NEW};
- my $o_cnt = $hunk->{OCNT};
- my $n_cnt = $hunk->{NCNT};
-
- my $head = format_hunk_header($o_ofs, $o_cnt, $n_ofs, $n_cnt);
- my $display_head = $head;
- unshift @{$hunk->{TEXT}}, $head;
- if ($diff_use_color) {
- $display_head = colored($fraginfo_color, $head);
- }
- unshift @{$hunk->{DISPLAY}}, $display_head;
- }
- return @split;
-}
-
-sub find_last_o_ctx {
- my ($it) = @_;
- my $text = $it->{TEXT};
- my ($o_ofs, $o_cnt) = parse_hunk_header($text->[0]);
- my $i = @{$text};
- my $last_o_ctx = $o_ofs + $o_cnt;
- while (0 < --$i) {
- my $line = $text->[$i];
- if ($line =~ /^ /) {
- $last_o_ctx--;
- next;
- }
- last;
- }
- return $last_o_ctx;
-}
-
-sub merge_hunk {
- my ($prev, $this) = @_;
- my ($o0_ofs, $o0_cnt, $n0_ofs, $n0_cnt) =
- parse_hunk_header($prev->{TEXT}[0]);
- my ($o1_ofs, $o1_cnt, $n1_ofs, $n1_cnt) =
- parse_hunk_header($this->{TEXT}[0]);
-
- my (@line, $i, $ofs, $o_cnt, $n_cnt);
- $ofs = $o0_ofs;
- $o_cnt = $n_cnt = 0;
- for ($i = 1; $i < @{$prev->{TEXT}}; $i++) {
- my $line = $prev->{TEXT}[$i];
- if ($line =~ /^\+/) {
- $n_cnt++;
- push @line, $line;
- next;
- } elsif ($line =~ /^\\/) {
- push @line, $line;
- next;
- }
-
- last if ($o1_ofs <= $ofs);
-
- $o_cnt++;
- $ofs++;
- if ($line =~ /^ /) {
- $n_cnt++;
- }
- push @line, $line;
- }
-
- for ($i = 1; $i < @{$this->{TEXT}}; $i++) {
- my $line = $this->{TEXT}[$i];
- if ($line =~ /^\+/) {
- $n_cnt++;
- push @line, $line;
- next;
- } elsif ($line =~ /^\\/) {
- push @line, $line;
- next;
- }
- $ofs++;
- $o_cnt++;
- if ($line =~ /^ /) {
- $n_cnt++;
- }
- push @line, $line;
- }
- my $head = format_hunk_header($o0_ofs, $o_cnt, $n0_ofs, $n_cnt);
- @{$prev->{TEXT}} = ($head, @line);
-}
-
-sub coalesce_overlapping_hunks {
- my (@in) = @_;
- my @out = ();
-
- my ($last_o_ctx, $last_was_dirty);
- my $ofs_delta = 0;
-
- for (@in) {
- if ($_->{TYPE} ne 'hunk') {
- push @out, $_;
- next;
- }
- my $text = $_->{TEXT};
- my ($o_ofs, $o_cnt, $n_ofs, $n_cnt) =
- parse_hunk_header($text->[0]);
- unless ($_->{USE}) {
- $ofs_delta += $o_cnt - $n_cnt;
- # If this hunk has been edited then subtract
- # the delta that is due to the edit.
- if ($_->{OFS_DELTA}) {
- $ofs_delta -= $_->{OFS_DELTA};
- }
- next;
- }
- if ($ofs_delta) {
- if ($patch_mode_flavour{IS_REVERSE}) {
- $o_ofs -= $ofs_delta;
- } else {
- $n_ofs += $ofs_delta;
- }
- $_->{TEXT}->[0] = format_hunk_header($o_ofs, $o_cnt,
- $n_ofs, $n_cnt);
- }
- # If this hunk was edited then adjust the offset delta
- # to reflect the edit.
- if ($_->{OFS_DELTA}) {
- $ofs_delta += $_->{OFS_DELTA};
- }
- if (defined $last_o_ctx &&
- $o_ofs <= $last_o_ctx &&
- !$_->{DIRTY} &&
- !$last_was_dirty) {
- merge_hunk($out[-1], $_);
- }
- else {
- push @out, $_;
- }
- $last_o_ctx = find_last_o_ctx($out[-1]);
- $last_was_dirty = $_->{DIRTY};
- }
- return @out;
-}
-
-sub reassemble_patch {
- my $head = shift;
- my @patch;
-
- # Include everything in the header except the beginning of the diff.
- push @patch, (grep { !/^[-+]{3}/ } @$head);
-
- # Then include any headers from the hunk lines, which must
- # come before any actual hunk.
- while (@_ && $_[0] !~ /^@/) {
- push @patch, shift;
- }
-
- # Then begin the diff.
- push @patch, grep { /^[-+]{3}/ } @$head;
-
- # And then the actual hunks.
- push @patch, @_;
-
- return @patch;
-}
-
-sub color_diff {
- return map {
- colored((/^@/ ? $fraginfo_color :
- /^\+/ ? $diff_new_color :
- /^-/ ? $diff_old_color :
- $diff_context_color),
- $_);
- } @_;
-}
-
-my %edit_hunk_manually_modes = (
- stage => N__(
-"If the patch applies cleanly, the edited hunk will immediately be
-marked for staging."),
- stash => N__(
-"If the patch applies cleanly, the edited hunk will immediately be
-marked for stashing."),
- reset_head => N__(
-"If the patch applies cleanly, the edited hunk will immediately be
-marked for unstaging."),
- reset_nothead => N__(
-"If the patch applies cleanly, the edited hunk will immediately be
-marked for applying."),
- checkout_index => N__(
-"If the patch applies cleanly, the edited hunk will immediately be
-marked for discarding."),
- checkout_head => N__(
-"If the patch applies cleanly, the edited hunk will immediately be
-marked for discarding."),
- checkout_nothead => N__(
-"If the patch applies cleanly, the edited hunk will immediately be
-marked for applying."),
- worktree_head => N__(
-"If the patch applies cleanly, the edited hunk will immediately be
-marked for discarding."),
- worktree_nothead => N__(
-"If the patch applies cleanly, the edited hunk will immediately be
-marked for applying."),
-);
-
-sub recount_edited_hunk {
- local $_;
- my ($oldtext, $newtext) = @_;
- my ($o_cnt, $n_cnt) = (0, 0);
- for (@{$newtext}[1..$#{$newtext}]) {
- my $mode = substr($_, 0, 1);
- if ($mode eq '-') {
- $o_cnt++;
- } elsif ($mode eq '+') {
- $n_cnt++;
- } elsif ($mode eq ' ' or $mode eq "\n") {
- $o_cnt++;
- $n_cnt++;
- }
- }
- my ($o_ofs, undef, $n_ofs, undef) =
- parse_hunk_header($newtext->[0]);
- $newtext->[0] = format_hunk_header($o_ofs, $o_cnt, $n_ofs, $n_cnt);
- my (undef, $orig_o_cnt, undef, $orig_n_cnt) =
- parse_hunk_header($oldtext->[0]);
- # Return the change in the number of lines inserted by this hunk
- return $orig_o_cnt - $orig_n_cnt - $o_cnt + $n_cnt;
-}
-
-sub edit_hunk_manually {
- my ($oldtext) = @_;
-
- my $hunkfile = $repo->repo_path . "/addp-hunk-edit.diff";
- my $fh;
- open $fh, '>', $hunkfile
- or die sprintf(__("failed to open hunk edit file for writing: %s"), $!);
- print $fh Git::comment_lines __("Manual hunk edit mode -- see bottom for a quick guide.\n");
- print $fh @$oldtext;
- my $is_reverse = $patch_mode_flavour{IS_REVERSE};
- my ($remove_plus, $remove_minus) = $is_reverse ? ('-', '+') : ('+', '-');
- my $comment_line_char = Git::get_comment_line_char;
- print $fh Git::comment_lines sprintf(__ <<EOF, $remove_minus, $remove_plus, $comment_line_char),
----
-To remove '%s' lines, make them ' ' lines (context).
-To remove '%s' lines, delete them.
-Lines starting with %s will be removed.
-EOF
-__($edit_hunk_manually_modes{$patch_mode}),
-# TRANSLATORS: 'it' refers to the patch mentioned in the previous messages.
-__ <<EOF2 ;
-If it does not apply cleanly, you will be given an opportunity to
-edit again. If all lines of the hunk are removed, then the edit is
-aborted and the hunk is left unchanged.
-EOF2
- close $fh;
-
- chomp(my ($editor) = run_cmd_pipe(qw(git var GIT_EDITOR)));
- system('sh', '-c', $editor.' "$@"', $editor, $hunkfile);
-
- if ($? != 0) {
- return undef;
- }
-
- open $fh, '<', $hunkfile
- or die sprintf(__("failed to open hunk edit file for reading: %s"), $!);
- my @newtext = grep { !/^\Q$comment_line_char\E/ } <$fh>;
- close $fh;
- unlink $hunkfile;
-
- # Abort if nothing remains
- if (!grep { /\S/ } @newtext) {
- return undef;
- }
-
- # Reinsert the first hunk header if the user accidentally deleted it
- if ($newtext[0] !~ /^@/) {
- unshift @newtext, $oldtext->[0];
- }
- return \@newtext;
-}
-
-sub diff_applies {
- return run_git_apply($patch_mode_flavour{APPLY_CHECK} . ' --check',
- map { @{$_->{TEXT}} } @_);
-}
-
-sub _restore_terminal_and_die {
- ReadMode 'restore';
- print "\n";
- exit 1;
-}
-
-sub prompt_single_character {
- if ($use_readkey) {
- local $SIG{TERM} = \&_restore_terminal_and_die;
- local $SIG{INT} = \&_restore_terminal_and_die;
- ReadMode 'cbreak';
- my $key = ReadKey 0;
- ReadMode 'restore';
- if (defined $key) {
- if ($use_termcap and $key eq "\e") {
- while (!defined $term_escapes{$key}) {
- my $next = ReadKey 0.5;
- last if (!defined $next);
- $key .= $next;
- }
- $key =~ s/\e/^[/;
- }
- print "$key";
- }
- print "\n";
- return $key;
- } else {
- return <STDIN>;
- }
-}
-
-sub prompt_yesno {
- my ($prompt) = @_;
- while (1) {
- print colored $prompt_color, $prompt;
- my $line = prompt_single_character;
- return undef unless defined $line;
- return 0 if $line =~ /^n/i;
- return 1 if $line =~ /^y/i;
- }
-}
-
-sub edit_hunk_loop {
- my ($head, $hunks, $ix) = @_;
- my $hunk = $hunks->[$ix];
- my $text = $hunk->{TEXT};
-
- while (1) {
- my $newtext = edit_hunk_manually($text);
- if (!defined $newtext) {
- return undef;
- }
- my $newhunk = {
- TEXT => $newtext,
- TYPE => $hunk->{TYPE},
- USE => 1,
- DIRTY => 1,
- };
- $newhunk->{OFS_DELTA} = recount_edited_hunk($text, $newtext);
- # If this hunk has already been edited then add the
- # offset delta of the previous edit to get the real
- # delta from the original unedited hunk.
- $hunk->{OFS_DELTA} and
- $newhunk->{OFS_DELTA} += $hunk->{OFS_DELTA};
- if (diff_applies($head,
- @{$hunks}[0..$ix-1],
- $newhunk,
- @{$hunks}[$ix+1..$#{$hunks}])) {
- $newhunk->{DISPLAY} = [color_diff(@{$newtext})];
- return $newhunk;
- }
- else {
- prompt_yesno(
- # TRANSLATORS: do not translate [y/n]
- # The program will only accept that input
- # at this point.
- # Consider translating (saying "no" discards!) as
- # (saying "n" for "no" discards!) if the translation
- # of the word "no" does not start with n.
- __('Your edited hunk does not apply. Edit again '
- . '(saying "no" discards!) [y/n]? ')
- ) or return undef;
- }
- }
-}
-
-my %help_patch_modes = (
- stage => N__(
-"y - stage this hunk
-n - do not stage this hunk
-q - quit; do not stage this hunk or any of the remaining ones
-a - stage this hunk and all later hunks in the file
-d - do not stage this hunk or any of the later hunks in the file"),
- stash => N__(
-"y - stash this hunk
-n - do not stash this hunk
-q - quit; do not stash this hunk or any of the remaining ones
-a - stash this hunk and all later hunks in the file
-d - do not stash this hunk or any of the later hunks in the file"),
- reset_head => N__(
-"y - unstage this hunk
-n - do not unstage this hunk
-q - quit; do not unstage this hunk or any of the remaining ones
-a - unstage this hunk and all later hunks in the file
-d - do not unstage this hunk or any of the later hunks in the file"),
- reset_nothead => N__(
-"y - apply this hunk to index
-n - do not apply this hunk to index
-q - quit; do not apply this hunk or any of the remaining ones
-a - apply this hunk and all later hunks in the file
-d - do not apply this hunk or any of the later hunks in the file"),
- checkout_index => N__(
-"y - discard this hunk from worktree
-n - do not discard this hunk from worktree
-q - quit; do not discard this hunk or any of the remaining ones
-a - discard this hunk and all later hunks in the file
-d - do not discard this hunk or any of the later hunks in the file"),
- checkout_head => N__(
-"y - discard this hunk from index and worktree
-n - do not discard this hunk from index and worktree
-q - quit; do not discard this hunk or any of the remaining ones
-a - discard this hunk and all later hunks in the file
-d - do not discard this hunk or any of the later hunks in the file"),
- checkout_nothead => N__(
-"y - apply this hunk to index and worktree
-n - do not apply this hunk to index and worktree
-q - quit; do not apply this hunk or any of the remaining ones
-a - apply this hunk and all later hunks in the file
-d - do not apply this hunk or any of the later hunks in the file"),
- worktree_head => N__(
-"y - discard this hunk from worktree
-n - do not discard this hunk from worktree
-q - quit; do not discard this hunk or any of the remaining ones
-a - discard this hunk and all later hunks in the file
-d - do not discard this hunk or any of the later hunks in the file"),
- worktree_nothead => N__(
-"y - apply this hunk to worktree
-n - do not apply this hunk to worktree
-q - quit; do not apply this hunk or any of the remaining ones
-a - apply this hunk and all later hunks in the file
-d - do not apply this hunk or any of the later hunks in the file"),
-);
-
-sub help_patch_cmd {
- local $_;
- my $other = $_[0] . ",?";
- print colored $help_color, __($help_patch_modes{$patch_mode}), "\n",
- map { "$_\n" } grep {
- my $c = quotemeta(substr($_, 0, 1));
- $other =~ /,$c/
- } split "\n", __ <<EOF ;
-g - select a hunk to go to
-/ - search for a hunk matching the given regex
-j - leave this hunk undecided, see next undecided hunk
-J - leave this hunk undecided, see next hunk
-k - leave this hunk undecided, see previous undecided hunk
-K - leave this hunk undecided, see previous hunk
-s - split the current hunk into smaller hunks
-e - manually edit the current hunk
-? - print help
-EOF
-}
-
-sub apply_patch {
- my $cmd = shift;
- my $ret = run_git_apply $cmd, @_;
- if (!$ret) {
- print STDERR @_;
- }
- return $ret;
-}
-
-sub apply_patch_for_checkout_commit {
- my $reverse = shift;
- my $applies_index = run_git_apply 'apply '.$reverse.' --cached --check', @_;
- my $applies_worktree = run_git_apply 'apply '.$reverse.' --check', @_;
-
- if ($applies_worktree && $applies_index) {
- run_git_apply 'apply '.$reverse.' --cached', @_;
- run_git_apply 'apply '.$reverse, @_;
- return 1;
- } elsif (!$applies_index) {
- print colored $error_color, __("The selected hunks do not apply to the index!\n");
- if (prompt_yesno __("Apply them to the worktree anyway? ")) {
- return run_git_apply 'apply '.$reverse, @_;
- } else {
- print colored $error_color, __("Nothing was applied.\n");
- return 0;
- }
- } else {
- print STDERR @_;
- return 0;
- }
-}
-
-sub patch_update_cmd {
- my @all_mods = list_modified($patch_mode_flavour{FILTER});
- error_msg sprintf(__("ignoring unmerged: %s\n"), $_->{VALUE})
- for grep { $_->{UNMERGED} } @all_mods;
- @all_mods = grep { !$_->{UNMERGED} } @all_mods;
-
- my @mods = grep { !($_->{BINARY}) } @all_mods;
- my @them;
-
- if (!@mods) {
- if (@all_mods) {
- print STDERR __("Only binary files changed.\n");
- } else {
- print STDERR __("No changes.\n");
- }
- return 0;
- }
- if ($patch_mode_only) {
- @them = @mods;
- }
- else {
- @them = list_and_choose({ PROMPT => __('Patch update'),
- HEADER => $status_head, },
- @mods);
- }
- for (@them) {
- return 0 if patch_update_file($_->{VALUE});
- }
-}
-
-# Generate a one line summary of a hunk.
-sub summarize_hunk {
- my $rhunk = shift;
- my $summary = $rhunk->{TEXT}[0];
-
- # Keep the line numbers, discard extra context.
- $summary =~ s/@@(.*?)@@.*/$1 /s;
- $summary .= " " x (20 - length $summary);
-
- # Add some user context.
- for my $line (@{$rhunk->{TEXT}}) {
- if ($line =~ m/^[+-].*\w/) {
- $summary .= $line;
- last;
- }
- }
-
- chomp $summary;
- return substr($summary, 0, 80) . "\n";
-}
-
-
-# Print a one-line summary of each hunk in the array ref in
-# the first argument, starting with the index in the 2nd.
-sub display_hunks {
- my ($hunks, $i) = @_;
- my $ctr = 0;
- $i ||= 0;
- for (; $i < @$hunks && $ctr < 20; $i++, $ctr++) {
- my $status = " ";
- if (defined $hunks->[$i]{USE}) {
- $status = $hunks->[$i]{USE} ? "+" : "-";
- }
- printf "%s%2d: %s",
- $status,
- $i + 1,
- summarize_hunk($hunks->[$i]);
- }
- return $i;
-}
-
-my %patch_update_prompt_modes = (
- stage => {
- mode => N__("Stage mode change [y,n,q,a,d%s,?]? "),
- deletion => N__("Stage deletion [y,n,q,a,d%s,?]? "),
- addition => N__("Stage addition [y,n,q,a,d%s,?]? "),
- hunk => N__("Stage this hunk [y,n,q,a,d%s,?]? "),
- },
- stash => {
- mode => N__("Stash mode change [y,n,q,a,d%s,?]? "),
- deletion => N__("Stash deletion [y,n,q,a,d%s,?]? "),
- addition => N__("Stash addition [y,n,q,a,d%s,?]? "),
- hunk => N__("Stash this hunk [y,n,q,a,d%s,?]? "),
- },
- reset_head => {
- mode => N__("Unstage mode change [y,n,q,a,d%s,?]? "),
- deletion => N__("Unstage deletion [y,n,q,a,d%s,?]? "),
- addition => N__("Unstage addition [y,n,q,a,d%s,?]? "),
- hunk => N__("Unstage this hunk [y,n,q,a,d%s,?]? "),
- },
- reset_nothead => {
- mode => N__("Apply mode change to index [y,n,q,a,d%s,?]? "),
- deletion => N__("Apply deletion to index [y,n,q,a,d%s,?]? "),
- addition => N__("Apply addition to index [y,n,q,a,d%s,?]? "),
- hunk => N__("Apply this hunk to index [y,n,q,a,d%s,?]? "),
- },
- checkout_index => {
- mode => N__("Discard mode change from worktree [y,n,q,a,d%s,?]? "),
- deletion => N__("Discard deletion from worktree [y,n,q,a,d%s,?]? "),
- addition => N__("Discard addition from worktree [y,n,q,a,d%s,?]? "),
- hunk => N__("Discard this hunk from worktree [y,n,q,a,d%s,?]? "),
- },
- checkout_head => {
- mode => N__("Discard mode change from index and worktree [y,n,q,a,d%s,?]? "),
- deletion => N__("Discard deletion from index and worktree [y,n,q,a,d%s,?]? "),
- addition => N__("Discard addition from index and worktree [y,n,q,a,d%s,?]? "),
- hunk => N__("Discard this hunk from index and worktree [y,n,q,a,d%s,?]? "),
- },
- checkout_nothead => {
- mode => N__("Apply mode change to index and worktree [y,n,q,a,d%s,?]? "),
- deletion => N__("Apply deletion to index and worktree [y,n,q,a,d%s,?]? "),
- addition => N__("Apply addition to index and worktree [y,n,q,a,d%s,?]? "),
- hunk => N__("Apply this hunk to index and worktree [y,n,q,a,d%s,?]? "),
- },
- worktree_head => {
- mode => N__("Discard mode change from worktree [y,n,q,a,d%s,?]? "),
- deletion => N__("Discard deletion from worktree [y,n,q,a,d%s,?]? "),
- addition => N__("Discard addition from worktree [y,n,q,a,d%s,?]? "),
- hunk => N__("Discard this hunk from worktree [y,n,q,a,d%s,?]? "),
- },
- worktree_nothead => {
- mode => N__("Apply mode change to worktree [y,n,q,a,d%s,?]? "),
- deletion => N__("Apply deletion to worktree [y,n,q,a,d%s,?]? "),
- addition => N__("Apply addition to worktree [y,n,q,a,d%s,?]? "),
- hunk => N__("Apply this hunk to worktree [y,n,q,a,d%s,?]? "),
- },
-);
-
-sub patch_update_file {
- my $quit = 0;
- my ($ix, $num);
- my $path = shift;
- my ($head, @hunk) = parse_diff($path);
- ($head, my $mode, my $deletion, my $addition) = parse_diff_header($head);
- for (@{$head->{DISPLAY}}) {
- print;
- }
-
- if (@{$mode->{TEXT}}) {
- unshift @hunk, $mode;
- }
- if (@{$deletion->{TEXT}}) {
- foreach my $hunk (@hunk) {
- push @{$deletion->{TEXT}}, @{$hunk->{TEXT}};
- push @{$deletion->{DISPLAY}}, @{$hunk->{DISPLAY}};
- }
- @hunk = ($deletion);
- }
-
- $num = scalar @hunk;
- $ix = 0;
-
- while (1) {
- my ($prev, $next, $other, $undecided, $i);
- $other = '';
-
- last if ($ix and !$num);
- if ($num <= $ix) {
- $ix = 0;
- }
- for ($i = 0; $i < $ix; $i++) {
- if (!defined $hunk[$i]{USE}) {
- $prev = 1;
- $other .= ',k';
- last;
- }
- }
- if ($ix) {
- $other .= ',K';
- }
- for ($i = $ix + 1; $i < $num; $i++) {
- if (!defined $hunk[$i]{USE}) {
- $next = 1;
- $other .= ',j';
- last;
- }
- }
- if ($ix < $num - 1) {
- $other .= ',J';
- }
- if ($num > 1) {
- $other .= ',g,/';
- }
- for ($i = 0; $i < $num; $i++) {
- if (!defined $hunk[$i]{USE}) {
- $undecided = 1;
- last;
- }
- }
- last if (!$undecided && ($num || !$addition));
-
- if ($num) {
- if ($hunk[$ix]{TYPE} eq 'hunk' &&
- hunk_splittable($hunk[$ix]{TEXT})) {
- $other .= ',s';
- }
- if ($hunk[$ix]{TYPE} eq 'hunk') {
- $other .= ',e';
- }
- for (@{$hunk[$ix]{DISPLAY}}) {
- print;
- }
- }
- my $type = $num ? $hunk[$ix]{TYPE} : $head->{TYPE};
- print colored $prompt_color, "(", ($ix+1), "/", ($num ? $num : 1), ") ",
- sprintf(__($patch_update_prompt_modes{$patch_mode}{$type}), $other);
-
- my $line = prompt_single_character;
- last unless defined $line;
- if ($line) {
- if ($line =~ /^y/i) {
- if ($num) {
- $hunk[$ix]{USE} = 1;
- } else {
- $head->{USE} = 1;
- }
- }
- elsif ($line =~ /^n/i) {
- if ($num) {
- $hunk[$ix]{USE} = 0;
- } else {
- $head->{USE} = 0;
- }
- }
- elsif ($line =~ /^a/i) {
- if ($num) {
- while ($ix < $num) {
- if (!defined $hunk[$ix]{USE}) {
- $hunk[$ix]{USE} = 1;
- }
- $ix++;
- }
- } else {
- $head->{USE} = 1;
- $ix++;
- }
- next;
- }
- elsif ($line =~ /^g(.*)/) {
- my $response = $1;
- unless ($other =~ /g/) {
- error_msg __("No other hunks to goto\n");
- next;
- }
- my $no = $ix > 10 ? $ix - 10 : 0;
- while ($response eq '') {
- $no = display_hunks(\@hunk, $no);
- if ($no < $num) {
- print __("go to which hunk (<ret> to see more)? ");
- } else {
- print __("go to which hunk? ");
- }
- $response = <STDIN>;
- if (!defined $response) {
- $response = '';
- }
- chomp $response;
- }
- if ($response !~ /^\s*\d+\s*$/) {
- error_msg sprintf(__("Invalid number: '%s'\n"),
- $response);
- } elsif (0 < $response && $response <= $num) {
- $ix = $response - 1;
- } else {
- error_msg sprintf(__n("Sorry, only %d hunk available.\n",
- "Sorry, only %d hunks available.\n", $num), $num);
- }
- next;
- }
- elsif ($line =~ /^d/i) {
- if ($num) {
- while ($ix < $num) {
- if (!defined $hunk[$ix]{USE}) {
- $hunk[$ix]{USE} = 0;
- }
- $ix++;
- }
- } else {
- $head->{USE} = 0;
- $ix++;
- }
- next;
- }
- elsif ($line =~ /^q/i) {
- if ($num) {
- for ($i = 0; $i < $num; $i++) {
- if (!defined $hunk[$i]{USE}) {
- $hunk[$i]{USE} = 0;
- }
- }
- } elsif (!defined $head->{USE}) {
- $head->{USE} = 0;
- }
- $quit = 1;
- last;
- }
- elsif ($line =~ m|^/(.*)|) {
- my $regex = $1;
- unless ($other =~ m|/|) {
- error_msg __("No other hunks to search\n");
- next;
- }
- if ($regex eq "") {
- print colored $prompt_color, __("search for regex? ");
- $regex = <STDIN>;
- if (defined $regex) {
- chomp $regex;
- }
- }
- my $search_string;
- eval {
- $search_string = qr{$regex}m;
- };
- if ($@) {
- my ($err,$exp) = ($@, $1);
- $err =~ s/ at .*git-add--interactive line \d+, <STDIN> line \d+.*$//;
- error_msg sprintf(__("Malformed search regexp %s: %s\n"), $exp, $err);
- next;
- }
- my $iy = $ix;
- while (1) {
- my $text = join ("", @{$hunk[$iy]{TEXT}});
- last if ($text =~ $search_string);
- $iy++;
- $iy = 0 if ($iy >= $num);
- if ($ix == $iy) {
- error_msg __("No hunk matches the given pattern\n");
- last;
- }
- }
- $ix = $iy;
- next;
- }
- elsif ($line =~ /^K/) {
- if ($other =~ /K/) {
- $ix--;
- }
- else {
- error_msg __("No previous hunk\n");
- }
- next;
- }
- elsif ($line =~ /^J/) {
- if ($other =~ /J/) {
- $ix++;
- }
- else {
- error_msg __("No next hunk\n");
- }
- next;
- }
- elsif ($line =~ /^k/) {
- if ($other =~ /k/) {
- while (1) {
- $ix--;
- last if (!$ix ||
- !defined $hunk[$ix]{USE});
- }
- }
- else {
- error_msg __("No previous hunk\n");
- }
- next;
- }
- elsif ($line =~ /^j/) {
- if ($other !~ /j/) {
- error_msg __("No next hunk\n");
- next;
- }
- }
- elsif ($line =~ /^s/) {
- unless ($other =~ /s/) {
- error_msg __("Sorry, cannot split this hunk\n");
- next;
- }
- my @split = split_hunk($hunk[$ix]{TEXT}, $hunk[$ix]{DISPLAY});
- if (1 < @split) {
- print colored $header_color, sprintf(
- __n("Split into %d hunk.\n",
- "Split into %d hunks.\n",
- scalar(@split)), scalar(@split));
- }
- splice (@hunk, $ix, 1, @split);
- $num = scalar @hunk;
- next;
- }
- elsif ($line =~ /^e/) {
- unless ($other =~ /e/) {
- error_msg __("Sorry, cannot edit this hunk\n");
- next;
- }
- my $newhunk = edit_hunk_loop($head, \@hunk, $ix);
- if (defined $newhunk) {
- splice @hunk, $ix, 1, $newhunk;
- }
- }
- else {
- help_patch_cmd($other);
- next;
- }
- # soft increment
- while (1) {
- $ix++;
- last if ($ix >= $num ||
- !defined $hunk[$ix]{USE});
- }
- }
- }
-
- @hunk = coalesce_overlapping_hunks(@hunk) if ($num);
-
- my $n_lofs = 0;
- my @result = ();
- for (@hunk) {
- if ($_->{USE}) {
- push @result, @{$_->{TEXT}};
- }
- }
-
- if (@result or $head->{USE}) {
- my @patch = reassemble_patch($head->{TEXT}, @result);
- my $apply_routine = $patch_mode_flavour{APPLY};
- &$apply_routine(@patch);
- refresh();
- }
-
- print "\n";
- return $quit;
-}
-
-sub diff_cmd {
- my @mods = list_modified('index-only');
- @mods = grep { !($_->{BINARY}) } @mods;
- return if (!@mods);
- my (@them) = list_and_choose({ PROMPT => __('Review diff'),
- IMMEDIATE => 1,
- HEADER => $status_head, },
- @mods);
- return if (!@them);
- my $reference = (is_initial_commit()) ? get_empty_tree() : 'HEAD';
- system(qw(git diff -p --cached), $reference, '--',
- map { $_->{VALUE} } @them);
-}
-
-sub quit_cmd {
- print __("Bye.\n");
- exit(0);
-}
-
-sub help_cmd {
-# TRANSLATORS: please do not translate the command names
-# 'status', 'update', 'revert', etc.
- print colored $help_color, __ <<'EOF' ;
-status - show paths with changes
-update - add working tree state to the staged set of changes
-revert - revert staged set of changes back to the HEAD version
-patch - pick hunks and update selectively
-diff - view diff between HEAD and index
-add untracked - add contents of untracked files to the staged set of changes
-EOF
-}
-
-sub process_args {
- return unless @ARGV;
- my $arg = shift @ARGV;
- if ($arg =~ /--patch(?:=(.*))?/) {
- if (defined $1) {
- if ($1 eq 'reset') {
- $patch_mode = 'reset_head';
- $patch_mode_revision = 'HEAD';
- $arg = shift @ARGV or die __("missing --");
- if ($arg ne '--') {
- $patch_mode_revision = $arg;
-
- # NEEDSWORK: Instead of comparing to the literal "HEAD",
- # compare the commit objects instead so that other ways of
- # saying the same thing (such as "@") are also handled
- # appropriately.
- #
- # This applies to the cases below too.
- $patch_mode = ($arg eq 'HEAD' ?
- 'reset_head' : 'reset_nothead');
- $arg = shift @ARGV or die __("missing --");
- }
- } elsif ($1 eq 'checkout') {
- $arg = shift @ARGV or die __("missing --");
- if ($arg eq '--') {
- $patch_mode = 'checkout_index';
- } else {
- $patch_mode_revision = $arg;
- $patch_mode = ($arg eq 'HEAD' ?
- 'checkout_head' : 'checkout_nothead');
- $arg = shift @ARGV or die __("missing --");
- }
- } elsif ($1 eq 'worktree') {
- $arg = shift @ARGV or die __("missing --");
- if ($arg eq '--') {
- $patch_mode = 'checkout_index';
- } else {
- $patch_mode_revision = $arg;
- $patch_mode = ($arg eq 'HEAD' ?
- 'worktree_head' : 'worktree_nothead');
- $arg = shift @ARGV or die __("missing --");
- }
- } elsif ($1 eq 'stage' or $1 eq 'stash') {
- $patch_mode = $1;
- $arg = shift @ARGV or die __("missing --");
- } else {
- die sprintf(__("unknown --patch mode: %s"), $1);
- }
- } else {
- $patch_mode = 'stage';
- $arg = shift @ARGV or die __("missing --");
- }
- die sprintf(__("invalid argument %s, expecting --"),
- $arg) unless $arg eq "--";
- %patch_mode_flavour = %{$patch_modes{$patch_mode}};
- $patch_mode_only = 1;
- }
- elsif ($arg ne "--") {
- die sprintf(__("invalid argument %s, expecting --"), $arg);
- }
-}
-
-sub main_loop {
- my @cmd = ([ 'status', \&status_cmd, ],
- [ 'update', \&update_cmd, ],
- [ 'revert', \&revert_cmd, ],
- [ 'add untracked', \&add_untracked_cmd, ],
- [ 'patch', \&patch_update_cmd, ],
- [ 'diff', \&diff_cmd, ],
- [ 'quit', \&quit_cmd, ],
- [ 'help', \&help_cmd, ],
- );
- while (1) {
- my ($it) = list_and_choose({ PROMPT => __('What now'),
- SINGLETON => 1,
- LIST_FLAT => 4,
- HEADER => __('*** Commands ***'),
- ON_EOF => \&quit_cmd,
- IMMEDIATE => 1 }, @cmd);
- if ($it) {
- eval {
- $it->[1]->();
- };
- if ($@) {
- print "$@";
- }
- }
- }
-}
-
-process_args();
-refresh();
-if ($patch_mode_only) {
- patch_update_cmd();
-}
-else {
- status_cmd();
- main_loop();
-}
diff --git a/git-archimport.perl b/git-archimport.perl
index b7c173c..f5a317b 100755
--- a/git-archimport.perl
+++ b/git-archimport.perl
@@ -54,7 +54,7 @@ and can contain multiple, unrelated branches.
=cut
-use 5.008;
+use 5.008001;
use strict;
use warnings;
use Getopt::Std;
diff --git a/git-bisect.sh b/git-bisect.sh
deleted file mode 100755
index 405cf76..0000000
--- a/git-bisect.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/sh
-
-USAGE='[help|start|bad|good|new|old|terms|skip|next|reset|visualize|view|replay|log|run]'
-LONG_USAGE='git bisect help
- print this long help message.
-git bisect start [--term-{new,bad}=<term> --term-{old,good}=<term>]
- [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]
- reset bisect state and start bisection.
-git bisect (bad|new) [<rev>]
- mark <rev> a known-bad revision/
- a revision after change in a given property.
-git bisect (good|old) [<rev>...]
- mark <rev>... known-good revisions/
- revisions before change in a given property.
-git bisect terms [--term-good | --term-bad]
- show the terms used for old and new commits (default: bad, good)
-git bisect skip [(<rev>|<range>)...]
- mark <rev>... untestable revisions.
-git bisect next
- find next bisection to test and check it out.
-git bisect reset [<commit>]
- finish bisection search and go back to commit.
-git bisect (visualize|view)
- show bisect status in gitk.
-git bisect replay <logfile>
- replay bisection log.
-git bisect log
- show bisect log.
-git bisect run <cmd>...
- use <cmd>... to automatically bisect.
-
-Please use "git help bisect" to get the full man page.'
-
-OPTIONS_SPEC=
-. git-sh-setup
-
-TERM_BAD=bad
-TERM_GOOD=good
-
-get_terms () {
- if test -s "$GIT_DIR/BISECT_TERMS"
- then
- {
- read TERM_BAD
- read TERM_GOOD
- } <"$GIT_DIR/BISECT_TERMS"
- fi
-}
-
-case "$#" in
-0)
- usage ;;
-*)
- cmd="$1"
- get_terms
- shift
- case "$cmd" in
- help)
- git bisect -h ;;
- start)
- git bisect--helper --bisect-start "$@" ;;
- bad|good|new|old|"$TERM_BAD"|"$TERM_GOOD")
- git bisect--helper --bisect-state "$cmd" "$@" ;;
- skip)
- git bisect--helper --bisect-skip "$@" || exit;;
- next)
- # Not sure we want "next" at the UI level anymore.
- git bisect--helper --bisect-next "$@" || exit ;;
- visualize|view)
- git bisect--helper --bisect-visualize "$@" || exit;;
- reset)
- git bisect--helper --bisect-reset "$@" ;;
- replay)
- git bisect--helper --bisect-replay "$@" || exit;;
- log)
- git bisect--helper --bisect-log || exit ;;
- run)
- git bisect--helper --bisect-run "$@" || exit;;
- terms)
- git bisect--helper --bisect-terms "$@" || exit;;
- *)
- usage ;;
- esac
-esac
diff --git a/git-compat-util.h b/git-compat-util.h
index 58d7708..044f874 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -23,6 +23,9 @@
#include <crtdbg.h>
#endif
+struct strbuf;
+
+
#define _FILE_OFFSET_BITS 64
@@ -94,8 +97,14 @@
# define BARF_UNLESS_AN_ARRAY(arr) \
BUILD_ASSERT_OR_ZERO(!__builtin_types_compatible_p(__typeof__(arr), \
__typeof__(&(arr)[0])))
+# define BARF_UNLESS_COPYABLE(dst, src) \
+ BUILD_ASSERT_OR_ZERO(__builtin_types_compatible_p(__typeof__(*(dst)), \
+ __typeof__(*(src))))
#else
# define BARF_UNLESS_AN_ARRAY(arr) 0
+# define BARF_UNLESS_COPYABLE(dst, src) \
+ BUILD_ASSERT_OR_ZERO(0 ? ((*(dst) = *(src)), 0) : \
+ sizeof(*(dst)) == sizeof(*(src)))
#endif
/*
* ARRAY_SIZE - get the number of elements in a visible array
@@ -186,6 +195,16 @@
#define _NETBSD_SOURCE 1
#define _SGI_SOURCE 1
+#if GIT_GNUC_PREREQ(4, 5)
+#define UNUSED __attribute__((unused)) \
+ __attribute__((deprecated ("parameter declared as UNUSED")))
+#elif defined(__GNUC__)
+#define UNUSED __attribute__((unused)) \
+ __attribute__((deprecated))
+#else
+#define UNUSED
+#endif
+
#if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */
# if !defined(_WIN32_WINNT)
# define _WIN32_WINNT 0x0600
@@ -199,6 +218,18 @@
#define GIT_WINDOWS_NATIVE
#endif
+#if defined(NO_UNIX_SOCKETS) || !defined(GIT_WINDOWS_NATIVE)
+static inline int _have_unix_sockets(void)
+{
+#if defined(NO_UNIX_SOCKETS)
+ return 0;
+#else
+ return 1;
+#endif
+}
+#define have_unix_sockets _have_unix_sockets
+#endif
+
#include <unistd.h>
#include <stdio.h>
#include <sys/stat.h>
@@ -206,12 +237,14 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdarg.h>
+#include <stdbool.h>
#include <string.h>
#ifdef HAVE_STRINGS_H
#include <strings.h> /* for strcasecmp() */
#endif
#include <errno.h>
#include <limits.h>
+#include <locale.h>
#ifdef NEEDS_SYS_PARAM_H
#include <sys/param.h>
#endif
@@ -258,6 +291,7 @@ static inline int is_xplatform_dir_sep(int c)
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
+#include <sys/statvfs.h>
#include <termios.h>
#ifndef NO_SYS_SELECT_H
#include <sys/select.h>
@@ -299,7 +333,9 @@ typedef unsigned long uintptr_t;
#ifdef PRECOMPOSE_UNICODE
#include "compat/precompose_utf8.h"
#else
-static inline const char *precompose_argv_prefix(int argc, const char **argv, const char *prefix)
+static inline const char *precompose_argv_prefix(int argc UNUSED,
+ const char **argv UNUSED,
+ const char *prefix)
{
return prefix;
}
@@ -316,6 +352,25 @@ static inline const char *precompose_string_if_needed(const char *in)
int compat_mkdir_wo_trailing_slash(const char*, mode_t);
#endif
+#ifdef time
+#undef time
+#endif
+static inline time_t git_time(time_t *tloc)
+{
+ struct timeval tv;
+
+ /*
+ * Avoid time(NULL), which can disagree with gettimeofday(2)
+ * and filesystem timestamps.
+ */
+ gettimeofday(&tv, NULL);
+
+ if (tloc)
+ *tloc = tv.tv_sec;
+ return tv.tv_sec;
+}
+#define time git_time
+
#ifdef NO_STRUCT_ITIMERVAL
struct itimerval {
struct timeval it_interval;
@@ -324,9 +379,13 @@ struct itimerval {
#endif
#ifdef NO_SETITIMER
-static inline int setitimer(int which, const struct itimerval *value, struct itimerval *newvalue) {
+static inline int git_setitimer(int which UNUSED,
+ const struct itimerval *value UNUSED,
+ struct itimerval *newvalue UNUSED) {
return 0; /* pretend success */
}
+#undef setitimer
+#define setitimer(which,value,ovalue) git_setitimer(which,value,ovalue)
#endif
#ifndef NO_LIBGEN_H
@@ -376,6 +435,10 @@ char *gitdirname(char *);
#define PATH_MAX 4096
#endif
+#ifndef NAME_MAX
+#define NAME_MAX 255
+#endif
+
typedef uintmax_t timestamp_t;
#define PRItime PRIuMAX
#define parse_timestamp strtoumax
@@ -394,7 +457,11 @@ typedef uintmax_t timestamp_t;
#endif
#ifndef platform_core_config
-static inline int noop_core_config(const char *var, const char *value, void *cb)
+struct config_context;
+static inline int noop_core_config(const char *var UNUSED,
+ const char *value UNUSED,
+ const struct config_context *ctx UNUSED,
+ void *cb UNUSED)
{
return 0;
}
@@ -407,7 +474,7 @@ int lstat_cache_aware_rmdir(const char *path);
#endif
#ifndef has_dos_drive_prefix
-static inline int git_has_dos_drive_prefix(const char *path)
+static inline int git_has_dos_drive_prefix(const char *path UNUSED)
{
return 0;
}
@@ -415,7 +482,7 @@ static inline int git_has_dos_drive_prefix(const char *path)
#endif
#ifndef skip_dos_drive_prefix
-static inline int git_skip_dos_drive_prefix(char **path)
+static inline int git_skip_dos_drive_prefix(char **path UNUSED)
{
return 0;
}
@@ -487,7 +554,8 @@ static inline void extract_id_from_env(const char *env, uid_t *id)
}
}
-static inline int is_path_owned_by_current_uid(const char *path)
+static inline int is_path_owned_by_current_uid(const char *path,
+ struct strbuf *report UNUSED)
{
struct stat st;
uid_t euid;
@@ -565,17 +633,18 @@ static inline int git_has_dir_sep(const char *path)
/* The sentinel attribute is valid from gcc version 4.0 */
#if defined(__GNUC__) && (__GNUC__ >= 4)
#define LAST_ARG_MUST_BE_NULL __attribute__((sentinel))
+/* warn_unused_result exists as of gcc 3.4.0, but be lazy and check 4.0 */
+#define RESULT_MUST_BE_USED __attribute__ ((warn_unused_result))
#else
#define LAST_ARG_MUST_BE_NULL
+#define RESULT_MUST_BE_USED
#endif
#define MAYBE_UNUSED __attribute__((__unused__))
#include "compat/bswap.h"
-#include "wildmatch.h"
-
-struct strbuf;
+#include "wrapper.h"
/* General helper functions */
NORETURN void usage(const char *err);
@@ -627,15 +696,12 @@ void set_warn_routine(report_fn routine);
report_fn get_warn_routine(void);
void set_die_is_recursing_routine(int (*routine)(void));
-int starts_with(const char *str, const char *prefix);
-int istarts_with(const char *str, const char *prefix);
-
/*
- * If the string "str" begins with the string found in "prefix", return 1.
+ * If the string "str" begins with the string found in "prefix", return true.
* The "out" parameter is set to "str + strlen(prefix)" (i.e., to the point in
* the string right after the prefix).
*
- * Otherwise, return 0 and leave "out" untouched.
+ * Otherwise, return false and leave "out" untouched.
*
* Examples:
*
@@ -646,91 +712,63 @@ int istarts_with(const char *str, const char *prefix);
* [skip prefix if present, otherwise use whole string]
* skip_prefix(name, "refs/heads/", &name);
*/
-static inline int skip_prefix(const char *str, const char *prefix,
- const char **out)
+static inline bool skip_prefix(const char *str, const char *prefix,
+ const char **out)
{
do {
if (!*prefix) {
*out = str;
- return 1;
+ return true;
}
} while (*str++ == *prefix++);
- return 0;
-}
-
-/*
- * If the string "str" is the same as the string in "prefix", then the "arg"
- * parameter is set to the "def" parameter and 1 is returned.
- * If the string "str" begins with the string found in "prefix" and then a
- * "=" sign, then the "arg" parameter is set to "str + strlen(prefix) + 1"
- * (i.e., to the point in the string right after the prefix and the "=" sign),
- * and 1 is returned.
- *
- * Otherwise, return 0 and leave "arg" untouched.
- *
- * When we accept both a "--key" and a "--key=<val>" option, this function
- * can be used instead of !strcmp(arg, "--key") and then
- * skip_prefix(arg, "--key=", &arg) to parse such an option.
- */
-int skip_to_optional_arg_default(const char *str, const char *prefix,
- const char **arg, const char *def);
-
-static inline int skip_to_optional_arg(const char *str, const char *prefix,
- const char **arg)
-{
- return skip_to_optional_arg_default(str, prefix, arg, "");
+ return false;
}
/*
* Like skip_prefix, but promises never to read past "len" bytes of the input
* buffer, and returns the remaining number of bytes in "out" via "outlen".
*/
-static inline int skip_prefix_mem(const char *buf, size_t len,
- const char *prefix,
- const char **out, size_t *outlen)
+static inline bool skip_prefix_mem(const char *buf, size_t len,
+ const char *prefix,
+ const char **out, size_t *outlen)
{
size_t prefix_len = strlen(prefix);
if (prefix_len <= len && !memcmp(buf, prefix, prefix_len)) {
*out = buf + prefix_len;
*outlen = len - prefix_len;
- return 1;
+ return true;
}
- return 0;
+ return false;
}
/*
- * If buf ends with suffix, return 1 and subtract the length of the suffix
- * from *len. Otherwise, return 0 and leave *len untouched.
+ * If buf ends with suffix, return true and subtract the length of the suffix
+ * from *len. Otherwise, return false and leave *len untouched.
*/
-static inline int strip_suffix_mem(const char *buf, size_t *len,
- const char *suffix)
+static inline bool strip_suffix_mem(const char *buf, size_t *len,
+ const char *suffix)
{
size_t suflen = strlen(suffix);
if (*len < suflen || memcmp(buf + (*len - suflen), suffix, suflen))
- return 0;
+ return false;
*len -= suflen;
- return 1;
+ return true;
}
/*
- * If str ends with suffix, return 1 and set *len to the size of the string
- * without the suffix. Otherwise, return 0 and set *len to the size of the
+ * If str ends with suffix, return true and set *len to the size of the string
+ * without the suffix. Otherwise, return false and set *len to the size of the
* string.
*
* Note that we do _not_ NUL-terminate str to the new length.
*/
-static inline int strip_suffix(const char *str, const char *suffix, size_t *len)
+static inline bool strip_suffix(const char *str, const char *suffix,
+ size_t *len)
{
*len = strlen(str);
return strip_suffix_mem(str, len, suffix);
}
-static inline int ends_with(const char *str, const char *suffix)
-{
- size_t len;
- return strip_suffix(str, suffix, &len);
-}
-
#define SWAP(a, b) do { \
void *_swap_a_ptr = &(a); \
void *_swap_b_ptr = &(b); \
@@ -826,12 +864,6 @@ int git_lstat(const char *, struct stat *);
#define pread git_pread
ssize_t git_pread(int fd, void *buf, size_t count, off_t offset);
#endif
-/*
- * Forward decl that will remind us if its twin in cache.h changes.
- * This function is used in compat/pread.c. But we can't include
- * cache.h there.
- */
-ssize_t read_in_full(int fd, void *buf, size_t count);
#ifdef NO_SETENV
#define setenv gitsetenv
@@ -995,6 +1027,45 @@ static inline unsigned long cast_size_t_to_ulong(size_t a)
return (unsigned long)a;
}
+static inline uint32_t cast_size_t_to_uint32_t(size_t a)
+{
+ if (a != (uint32_t)a)
+ die("object too large to read on this platform: %"
+ PRIuMAX" is cut off to %u",
+ (uintmax_t)a, (uint32_t)a);
+ return (uint32_t)a;
+}
+
+static inline int cast_size_t_to_int(size_t a)
+{
+ if (a > INT_MAX)
+ die("number too large to represent as int on this platform: %"PRIuMAX,
+ (uintmax_t)a);
+ return (int)a;
+}
+
+/*
+ * Limit size of IO chunks, because huge chunks only cause pain. OS X
+ * 64-bit is buggy, returning EINVAL if len >= INT_MAX; and even in
+ * the absence of bugs, large chunks can result in bad latencies when
+ * you decide to kill the process.
+ *
+ * We pick 8 MiB as our default, but if the platform defines SSIZE_MAX
+ * that is smaller than that, clip it to SSIZE_MAX, as a call to
+ * read(2) or write(2) larger than that is allowed to fail. As the last
+ * resort, we allow a port to pass via CFLAGS e.g. "-DMAX_IO_SIZE=value"
+ * to override this, if the definition of SSIZE_MAX given by the platform
+ * is broken.
+ */
+#ifndef MAX_IO_SIZE
+# define MAX_IO_SIZE_DEFAULT (8*1024*1024)
+# if defined(SSIZE_MAX) && (SSIZE_MAX < MAX_IO_SIZE_DEFAULT)
+# define MAX_IO_SIZE SSIZE_MAX
+# else
+# define MAX_IO_SIZE MAX_IO_SIZE_DEFAULT
+# endif
+#endif
+
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
# define xalloca(size) (alloca(size))
@@ -1003,36 +1074,6 @@ static inline unsigned long cast_size_t_to_ulong(size_t a)
# define xalloca(size) (xmalloc(size))
# define xalloca_free(p) (free(p))
#endif
-char *xstrdup(const char *str);
-void *xmalloc(size_t size);
-void *xmallocz(size_t size);
-void *xmallocz_gently(size_t size);
-void *xmemdupz(const void *data, size_t len);
-char *xstrndup(const char *str, size_t len);
-void *xrealloc(void *ptr, size_t size);
-void *xcalloc(size_t nmemb, size_t size);
-void xsetenv(const char *name, const char *value, int overwrite);
-void *xmmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);
-const char *mmap_os_err(void);
-void *xmmap_gently(void *start, size_t length, int prot, int flags, int fd, off_t offset);
-int xopen(const char *path, int flags, ...);
-ssize_t xread(int fd, void *buf, size_t len);
-ssize_t xwrite(int fd, const void *buf, size_t len);
-ssize_t xpread(int fd, void *buf, size_t len, off_t offset);
-int xdup(int fd);
-FILE *xfopen(const char *path, const char *mode);
-FILE *xfdopen(int fd, const char *mode);
-int xmkstemp(char *temp_filename);
-int xmkstemp_mode(char *temp_filename, int mode);
-char *xgetcwd(void);
-FILE *fopen_for_writing(const char *path);
-FILE *fopen_or_warn(const char *path, const char *mode);
-
-/*
- * Like strncmp, but only return zero if s is NUL-terminated and exactly len
- * characters long. If it is not, consider it greater than t.
- */
-int xstrncmpz(const char *s, const char *t, size_t len);
/*
* FREE_AND_NULL(ptr) is like free(ptr) followed by ptr = NULL. Note
@@ -1045,7 +1086,7 @@ int xstrncmpz(const char *s, const char *t, size_t len);
#define REALLOC_ARRAY(x, alloc) (x) = xrealloc((x), st_mult(sizeof(*(x)), (alloc)))
#define COPY_ARRAY(dst, src, n) copy_array((dst), (src), (n), sizeof(*(dst)) + \
- BUILD_ASSERT_OR_ZERO(sizeof(*(dst)) == sizeof(*(src))))
+ BARF_UNLESS_COPYABLE((dst), (src)))
static inline void copy_array(void *dst, const void *src, size_t n, size_t size)
{
if (n)
@@ -1053,13 +1094,18 @@ static inline void copy_array(void *dst, const void *src, size_t n, size_t size)
}
#define MOVE_ARRAY(dst, src, n) move_array((dst), (src), (n), sizeof(*(dst)) + \
- BUILD_ASSERT_OR_ZERO(sizeof(*(dst)) == sizeof(*(src))))
+ BARF_UNLESS_COPYABLE((dst), (src)))
static inline void move_array(void *dst, const void *src, size_t n, size_t size)
{
if (n)
memmove(dst, src, st_mult(size, n));
}
+#define DUP_ARRAY(dst, src, n) do { \
+ size_t dup_array_n_ = (n); \
+ COPY_ARRAY(ALLOC_ARRAY((dst), dup_array_n_), (src), dup_array_n_); \
+} while (0)
+
/*
* These functions help you allocate structs with flex arrays, and copy
* the data directly into the array. For example, if you had:
@@ -1117,6 +1163,81 @@ static inline void move_array(void *dst, const void *src, size_t n, size_t size)
#define FLEXPTR_ALLOC_STR(x, ptrname, str) \
FLEXPTR_ALLOC_MEM((x), ptrname, (str), strlen(str))
+#define alloc_nr(x) (((x)+16)*3/2)
+
+/**
+ * Dynamically growing an array using realloc() is error prone and boring.
+ *
+ * Define your array with:
+ *
+ * - a pointer (`item`) that points at the array, initialized to `NULL`
+ * (although please name the variable based on its contents, not on its
+ * type);
+ *
+ * - an integer variable (`alloc`) that keeps track of how big the current
+ * allocation is, initialized to `0`;
+ *
+ * - another integer variable (`nr`) to keep track of how many elements the
+ * array currently has, initialized to `0`.
+ *
+ * Then before adding `n`th element to the item, call `ALLOC_GROW(item, n,
+ * alloc)`. This ensures that the array can hold at least `n` elements by
+ * calling `realloc(3)` and adjusting `alloc` variable.
+ *
+ * ------------
+ * sometype *item;
+ * size_t nr;
+ * size_t alloc
+ *
+ * for (i = 0; i < nr; i++)
+ * if (we like item[i] already)
+ * return;
+ *
+ * // we did not like any existing one, so add one
+ * ALLOC_GROW(item, nr + 1, alloc);
+ * item[nr++] = value you like;
+ * ------------
+ *
+ * You are responsible for updating the `nr` variable.
+ *
+ * If you need to specify the number of elements to allocate explicitly
+ * then use the macro `REALLOC_ARRAY(item, alloc)` instead of `ALLOC_GROW`.
+ *
+ * Consider using ALLOC_GROW_BY instead of ALLOC_GROW as it has some
+ * added niceties.
+ *
+ * DO NOT USE any expression with side-effect for 'x', 'nr', or 'alloc'.
+ */
+#define ALLOC_GROW(x, nr, alloc) \
+ do { \
+ if ((nr) > alloc) { \
+ if (alloc_nr(alloc) < (nr)) \
+ alloc = (nr); \
+ else \
+ alloc = alloc_nr(alloc); \
+ REALLOC_ARRAY(x, alloc); \
+ } \
+ } while (0)
+
+/*
+ * Similar to ALLOC_GROW but handles updating of the nr value and
+ * zeroing the bytes of the newly-grown array elements.
+ *
+ * DO NOT USE any expression with side-effect for any of the
+ * arguments.
+ */
+#define ALLOC_GROW_BY(x, nr, increase, alloc) \
+ do { \
+ if (increase) { \
+ size_t new_nr = nr + (increase); \
+ if (new_nr < nr) \
+ BUG("negative growth in ALLOC_GROW_BY"); \
+ ALLOC_GROW(x, new_nr, alloc); \
+ memset((x) + nr, 0, sizeof(*(x)) * (increase)); \
+ nr = new_nr; \
+ } \
+ } while (0)
+
static inline char *xstrdup_or_null(const char *str)
{
return str ? xstrdup(str) : NULL;
@@ -1129,78 +1250,11 @@ static inline size_t xsize_t(off_t len)
return (size_t) len;
}
-__attribute__((format (printf, 3, 4)))
-int xsnprintf(char *dst, size_t max, const char *fmt, ...);
-
#ifndef HOST_NAME_MAX
#define HOST_NAME_MAX 256
#endif
-int xgethostname(char *buf, size_t len);
-
-/* in ctype.c, for kwset users */
-extern const unsigned char tolower_trans_tbl[256];
-
-/* Sane ctype - no locale, and works with signed chars */
-#undef isascii
-#undef isspace
-#undef isdigit
-#undef isalpha
-#undef isalnum
-#undef isprint
-#undef islower
-#undef isupper
-#undef tolower
-#undef toupper
-#undef iscntrl
-#undef ispunct
-#undef isxdigit
-
-extern const unsigned char sane_ctype[256];
-#define GIT_SPACE 0x01
-#define GIT_DIGIT 0x02
-#define GIT_ALPHA 0x04
-#define GIT_GLOB_SPECIAL 0x08
-#define GIT_REGEX_SPECIAL 0x10
-#define GIT_PATHSPEC_MAGIC 0x20
-#define GIT_CNTRL 0x40
-#define GIT_PUNCT 0x80
-#define sane_istest(x,mask) ((sane_ctype[(unsigned char)(x)] & (mask)) != 0)
-#define isascii(x) (((x) & ~0x7f) == 0)
-#define isspace(x) sane_istest(x,GIT_SPACE)
-#define isdigit(x) sane_istest(x,GIT_DIGIT)
-#define isalpha(x) sane_istest(x,GIT_ALPHA)
-#define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT)
-#define isprint(x) ((x) >= 0x20 && (x) <= 0x7e)
-#define islower(x) sane_iscase(x, 1)
-#define isupper(x) sane_iscase(x, 0)
-#define is_glob_special(x) sane_istest(x,GIT_GLOB_SPECIAL)
-#define is_regex_special(x) sane_istest(x,GIT_GLOB_SPECIAL | GIT_REGEX_SPECIAL)
-#define iscntrl(x) (sane_istest(x,GIT_CNTRL))
-#define ispunct(x) sane_istest(x, GIT_PUNCT | GIT_REGEX_SPECIAL | \
- GIT_GLOB_SPECIAL | GIT_PATHSPEC_MAGIC)
-#define isxdigit(x) (hexval_table[(unsigned char)(x)] != -1)
-#define tolower(x) sane_case((unsigned char)(x), 0x20)
-#define toupper(x) sane_case((unsigned char)(x), 0)
-#define is_pathspec_magic(x) sane_istest(x,GIT_PATHSPEC_MAGIC)
-
-static inline int sane_case(int x, int high)
-{
- if (sane_istest(x, GIT_ALPHA))
- x = (x & ~0x20) | high;
- return x;
-}
-
-static inline int sane_iscase(int x, int is_lower)
-{
- if (!sane_istest(x, GIT_ALPHA))
- return 0;
-
- if (is_lower)
- return (x & 0x20) != 0;
- else
- return (x & 0x20) == 0;
-}
+#include "sane-ctype.h"
/*
* Like skip_prefix, but compare case-insensitively. Note that the comparison
@@ -1219,6 +1273,25 @@ static inline int skip_iprefix(const char *str, const char *prefix,
return 0;
}
+/*
+ * Like skip_prefix_mem, but compare case-insensitively. Note that the
+ * comparison is done via tolower(), so it is strictly ASCII (no multi-byte
+ * characters or locale-specific conversions).
+ */
+static inline int skip_iprefix_mem(const char *buf, size_t len,
+ const char *prefix,
+ const char **out, size_t *outlen)
+{
+ do {
+ if (!*prefix) {
+ *out = buf;
+ *outlen = len;
+ return 1;
+ }
+ } while (len-- > 0 && tolower(*buf++) == tolower(*prefix++));
+ return 0;
+}
+
static inline int strtoul_ui(char const *s, int base, unsigned int *result)
{
unsigned long ul;
@@ -1289,6 +1362,11 @@ static inline int regexec_buf(const regex_t *preg, const char *buf, size_t size,
return regexec(preg, buf, nmatch, pmatch, eflags | REG_STARTEND);
}
+#ifdef USE_ENHANCED_BASIC_REGULAR_EXPRESSIONS
+int git_regcomp(regex_t *preg, const char *pattern, int cflags);
+#define regcomp git_regcomp
+#endif
+
#ifndef DIR_HAS_BSD_GROUP_SEMANTICS
# define FORCE_DIR_SET_GID S_ISGID
#else
@@ -1353,85 +1431,24 @@ void bug_fl(const char *file, int line, const char *fmt, ...);
#endif
#endif
-enum fsync_action {
- FSYNC_WRITEOUT_ONLY,
- FSYNC_HARDWARE_FLUSH
-};
-
-/*
- * Issues an fsync against the specified file according to the specified mode.
- *
- * FSYNC_WRITEOUT_ONLY attempts to use interfaces available on some operating
- * systems to flush the OS cache without issuing a flush command to the storage
- * controller. If those interfaces are unavailable, the function fails with
- * ENOSYS.
- *
- * FSYNC_HARDWARE_FLUSH does an OS writeout and hardware flush to ensure that
- * changes are durable. It is not expected to fail.
- */
-int git_fsync(int fd, enum fsync_action action);
-
-/*
- * Writes out trace statistics for fsync using the trace2 API.
- */
-void trace_git_fsync_stats(void);
-
-/*
- * Preserves errno, prints a message, but gives no warning for ENOENT.
- * Returns 0 on success, which includes trying to unlink an object that does
- * not exist.
- */
-int unlink_or_warn(const char *path);
- /*
- * Tries to unlink file. Returns 0 if unlink succeeded
- * or the file already didn't exist. Returns -1 and
- * appends a message to err suitable for
- * 'error("%s", err->buf)' on error.
- */
-int unlink_or_msg(const char *file, struct strbuf *err);
-/*
- * Preserves errno, prints a message, but gives no warning for ENOENT.
- * Returns 0 on success, which includes trying to remove a directory that does
- * not exist.
- */
-int rmdir_or_warn(const char *path);
-/*
- * Calls the correct function out of {unlink,rmdir}_or_warn based on
- * the supplied file mode.
- */
-int remove_or_warn(unsigned int mode, const char *path);
-
-/*
- * Call access(2), but warn for any error except "missing file"
- * (ENOENT or ENOTDIR).
- */
-#define ACCESS_EACCES_OK (1U << 0)
-int access_or_warn(const char *path, int mode, unsigned flag);
-int access_or_die(const char *path, int mode, unsigned flag);
-
-/* Warn on an inaccessible file if errno indicates this is an error */
-int warn_on_fopen_errors(const char *path);
-
-/*
- * Open with O_NOFOLLOW, or equivalent. Note that the fallback equivalent
- * may be racy. Do not use this as protection against an attacker who can
- * simultaneously create paths.
- */
-int open_nofollow(const char *path, int flags);
-
#ifndef SHELL_PATH
# define SHELL_PATH "/bin/sh"
#endif
#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
-static inline void flockfile(FILE *fh)
+static inline void git_flockfile(FILE *fh UNUSED)
{
; /* nothing */
}
-static inline void funlockfile(FILE *fh)
+static inline void git_funlockfile(FILE *fh UNUSED)
{
; /* nothing */
}
+#undef flockfile
+#undef funlockfile
+#undef getc_unlocked
+#define flockfile(fh) git_flockfile(fh)
+#define funlockfile(fh) git_funlockfile(fh)
#define getc_unlocked(fh) getc(fh)
#endif
@@ -1553,13 +1570,4 @@ static inline void *container_of_or_null_offset(void *ptr, size_t offset)
((uintptr_t)&(ptr)->member - (uintptr_t)(ptr))
#endif /* !__GNUC__ */
-void sleep_millisec(int millisec);
-
-/*
- * Generate len bytes from the system cryptographically secure PRNG.
- * Returns 0 on success and -1 on error, setting errno. The inability to
- * satisfy the full request is an error.
- */
-int csprng_bytes(void *buf, size_t len);
-
#endif
diff --git a/git-curl-compat.h b/git-curl-compat.h
index 56a83b6..e1d0bdd 100644
--- a/git-curl-compat.h
+++ b/git-curl-compat.h
@@ -126,4 +126,21 @@
#define GIT_CURL_HAVE_CURLSSLSET_NO_BACKENDS
#endif
+/**
+ * Versions before curl 7.66.0 (September 2019) required manually setting the
+ * transfer-encoding for a streaming POST; after that this is handled
+ * automatically.
+ */
+#if LIBCURL_VERSION_NUM < 0x074200
+#define GIT_CURL_NEED_TRANSFER_ENCODING_HEADER
+#endif
+
+/**
+ * CURLOPT_PROTOCOLS_STR and CURLOPT_REDIR_PROTOCOLS_STR were added in 7.85.0,
+ * released in August 2022.
+ */
+#if LIBCURL_VERSION_NUM >= 0x075500
+#define GIT_CURL_HAVE_CURLOPT_PROTOCOLS_STR 1
+#endif
+
#endif
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index 289d4bc..1e03ba9 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-use 5.008;
+use 5.008001;
use strict;
use warnings;
use Getopt::Std;
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 7bf3c12..211ec84 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -13,7 +13,7 @@
# The head revision is on branch "origin" by default.
# You can change that with the '-o' option.
-use 5.008;
+use 5.008001;
use strict;
use warnings;
use Getopt::Long;
@@ -329,7 +329,7 @@ sub conn {
# Use a HTTP Proxy. Only works for HTTP proxies that
# don't require user authentication
#
- # See: http://www.ietf.org/rfc/rfc2817.txt
+ # See: https://www.ietf.org/rfc/rfc2817.txt
$s = IO::Socket::INET->new(PeerHost => $proxyhost, PeerPort => $proxyport);
die "Socket to $proxyhost: $!\n" unless defined $s;
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 7b75736..124f598 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -15,7 +15,7 @@
####
####
-use 5.008;
+use 5.008001;
use strict;
use warnings;
use bytes;
diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index 992124c..dd0c9a5 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -75,6 +75,11 @@ then
merge_tool="$GIT_DIFF_TOOL"
else
merge_tool="$(get_merge_tool)"
+ subshell_exit_status=$?
+ if test $subshell_exit_status -gt 1
+ then
+ exit $subshell_exit_status
+ fi
fi
fi
@@ -86,6 +91,19 @@ then
# ignore the error from the above --- run_merge_tool
# will diagnose unusable tool by itself
run_merge_tool "$merge_tool" false
+
+ status=$?
+ if test $status -ge 126
+ then
+ # Command not found (127), not executable (126) or
+ # exited via a signal (>= 128).
+ exit $status
+ fi
+
+ if test "$GIT_DIFFTOOL_TRUST_EXIT_CODE" = true
+ then
+ exit $status
+ fi
else
# Launch the merge tool on each path provided by 'git diff'
while test $# -gt 6
diff --git a/git-gui/.gitattributes b/git-gui/.gitattributes
index 59cd41d..118d56c 100644
--- a/git-gui/.gitattributes
+++ b/git-gui/.gitattributes
@@ -3,3 +3,4 @@
git-gui.sh encoding=UTF-8
/po/*.po encoding=UTF-8
/GIT-VERSION-GEN eol=lf
+Makefile whitespace=!indent,trail,space
diff --git a/git-gui/Makefile b/git-gui/Makefile
index 56c85a8..667c39e 100644
--- a/git-gui/Makefile
+++ b/git-gui/Makefile
@@ -107,16 +107,16 @@ endif
ifeq ($(uname_S),Darwin)
TKFRAMEWORK = /Library/Frameworks/Tk.framework/Resources/Wish.app
- ifeq ($(shell echo "$(uname_R)" | awk -F. '{if ($$1 >= 9) print "y"}')_$(shell test -d $(TKFRAMEWORK) || echo n),y_n)
+ ifeq ($(shell echo "$(uname_R)" | awk -F. '{if ($$1 >= 9) print "y"}')_$(shell test -d $(TKFRAMEWORK) || echo n),y_n)
TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish.app
- ifeq ($(shell test -d $(TKFRAMEWORK) || echo n),n)
+ ifeq ($(shell test -d $(TKFRAMEWORK) || echo n),n)
TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish\ Shell.app
- endif
- endif
+ endif
+ endif
TKEXECUTABLE = $(shell basename "$(TKFRAMEWORK)" .app)
endif
-ifeq ($(findstring $(MAKEFLAGS),s),s)
+ifeq ($(findstring $(firstword -$(MAKEFLAGS)),s),s)
QUIET_GEN =
endif
@@ -138,29 +138,14 @@ GITGUI_SCRIPT := $$0
GITGUI_RELATIVE :=
GITGUI_MACOSXAPP :=
-ifeq ($(uname_O),Cygwin)
- GITGUI_SCRIPT := `cygpath --windows --absolute "$(GITGUI_SCRIPT)"`
-
- # Is this a Cygwin Tcl/Tk binary? If so it knows how to do
- # POSIX path translation just like cygpath does and we must
- # keep libdir in POSIX format so Cygwin packages of git-gui
- # work no matter where the user installs them.
- #
- ifeq ($(shell echo 'puts [file normalize /]' | '$(TCL_PATH_SQ)'),$(shell cygpath --mixed --absolute /))
- gg_libdir_sed_in := $(gg_libdir)
- else
- gg_libdir_sed_in := $(shell cygpath --windows --absolute "$(gg_libdir)")
- endif
-else
- ifeq ($(exedir),$(gg_libdir))
- GITGUI_RELATIVE := 1
- endif
- gg_libdir_sed_in := $(gg_libdir)
+ifeq ($(exedir),$(gg_libdir))
+ GITGUI_RELATIVE := 1
endif
+gg_libdir_sed_in := $(gg_libdir)
ifeq ($(uname_S),Darwin)
- ifeq ($(shell test -d $(TKFRAMEWORK) && echo y),y)
+ ifeq ($(shell test -d $(TKFRAMEWORK) && echo y),y)
GITGUI_MACOSXAPP := YesPlease
- endif
+ endif
endif
ifneq (,$(findstring MINGW,$(uname_S)))
ifeq ($(shell expr "$(uname_R)" : '1\.'),2)
@@ -235,9 +220,9 @@ ifdef NO_MSGFMT
MSGFMT ?= $(TCL_PATH) po/po2msg.sh
else
MSGFMT ?= msgfmt
- ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0)
+ ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0)
MSGFMT := $(TCL_PATH) po/po2msg.sh
- endif
+ endif
endif
msgsdir = $(gg_libdir)/msgs
diff --git a/git-gui/README.md b/git-gui/README.md
index 5ce2122..b460b64 100644
--- a/git-gui/README.md
+++ b/git-gui/README.md
@@ -88,7 +88,7 @@ that you first use `git-format-patch` to generate the emails, audit them, and
then send them via `git-send-email`.
A pretty good guide to configuring and using `git-send-email` can be found
-[here](https://www.freedesktop.org/wiki/Software/PulseAudio/HowToUseGitSendEmail/)
+[here](https://www.freedesktop.org/wiki/Software/PulseAudio/HowToUseGitSendEmail/).
### Using your email client
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 201524c..507fb2b 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -24,7 +24,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this program; if not, see <http://www.gnu.org/licenses/>.}]
+along with this program; if not, see <https://www.gnu.org/licenses/>.}]
######################################################################
##
@@ -46,6 +46,132 @@ catch {rename send {}} ; # What an evil concept...
######################################################################
##
+## Enabling platform-specific code paths
+
+proc is_MacOSX {} {
+ if {[tk windowingsystem] eq {aqua}} {
+ return 1
+ }
+ return 0
+}
+
+proc is_Windows {} {
+ if {$::tcl_platform(platform) eq {windows}} {
+ return 1
+ }
+ return 0
+}
+
+set _iscygwin {}
+proc is_Cygwin {} {
+ global _iscygwin
+ if {$_iscygwin eq {}} {
+ if {[string match "CYGWIN_*" $::tcl_platform(os)]} {
+ set _iscygwin 1
+ } else {
+ set _iscygwin 0
+ }
+ }
+ return $_iscygwin
+}
+
+######################################################################
+##
+## PATH lookup
+
+set _search_path {}
+proc _which {what args} {
+ global env _search_exe _search_path
+
+ if {$_search_path eq {}} {
+ if {[is_Windows]} {
+ set gitguidir [file dirname [info script]]
+ regsub -all ";" $gitguidir "\\;" gitguidir
+ set env(PATH) "$gitguidir;$env(PATH)"
+ set _search_path [split $env(PATH) {;}]
+ # Skip empty `PATH` elements
+ set _search_path [lsearch -all -inline -not -exact \
+ $_search_path ""]
+ set _search_exe .exe
+ } else {
+ set _search_path [split $env(PATH) :]
+ set _search_exe {}
+ }
+ }
+
+ if {[is_Windows] && [lsearch -exact $args -script] >= 0} {
+ set suffix {}
+ } else {
+ set suffix $_search_exe
+ }
+
+ foreach p $_search_path {
+ set p [file join $p $what$suffix]
+ if {[file exists $p]} {
+ return [file normalize $p]
+ }
+ }
+ return {}
+}
+
+proc sanitize_command_line {command_line from_index} {
+ set i $from_index
+ while {$i < [llength $command_line]} {
+ set cmd [lindex $command_line $i]
+ if {[llength [file split $cmd]] < 2} {
+ set fullpath [_which $cmd]
+ if {$fullpath eq ""} {
+ throw {NOT-FOUND} "$cmd not found in PATH"
+ }
+ lset command_line $i $fullpath
+ }
+
+ # handle piped commands, e.g. `exec A | B`
+ for {incr i} {$i < [llength $command_line]} {incr i} {
+ if {[lindex $command_line $i] eq "|"} {
+ incr i
+ break
+ }
+ }
+ }
+ return $command_line
+}
+
+# Override `exec` to avoid unsafe PATH lookup
+
+rename exec real_exec
+
+proc exec {args} {
+ # skip options
+ for {set i 0} {$i < [llength $args]} {incr i} {
+ set arg [lindex $args $i]
+ if {$arg eq "--"} {
+ incr i
+ break
+ }
+ if {[string range $arg 0 0] ne "-"} {
+ break
+ }
+ }
+ set args [sanitize_command_line $args $i]
+ uplevel 1 real_exec $args
+}
+
+# Override `open` to avoid unsafe PATH lookup
+
+rename open real_open
+
+proc open {args} {
+ set arg0 [lindex $args 0]
+ if {[string range $arg0 0 0] eq "|"} {
+ set command_line [string trim [string range $arg0 1 end]]
+ lset args 0 "| [sanitize_command_line $command_line 0]"
+ }
+ uplevel 1 real_open $args
+}
+
+######################################################################
+##
## locate our library
if { [info exists ::env(GIT_GUI_LIB_DIR) ] } {
@@ -163,8 +289,6 @@ set _isbare {}
set _gitexec {}
set _githtmldir {}
set _reponame {}
-set _iscygwin {}
-set _search_path {}
set _shellpath {@@SHELL_PATH@@}
set _trace [lsearch -exact $argv --trace]
@@ -211,14 +335,7 @@ proc gitexec {args} {
if {[catch {set _gitexec [git --exec-path]} err]} {
error "Git not installed?\n\n$err"
}
- if {[is_Cygwin]} {
- set _gitexec [exec cygpath \
- --windows \
- --absolute \
- $_gitexec]
- } else {
- set _gitexec [file normalize $_gitexec]
- }
+ set _gitexec [file normalize $_gitexec]
}
if {$args eq {}} {
return $_gitexec
@@ -233,14 +350,7 @@ proc githtmldir {args} {
# Git not installed or option not yet supported
return {}
}
- if {[is_Cygwin]} {
- set _githtmldir [exec cygpath \
- --windows \
- --absolute \
- $_githtmldir]
- } else {
- set _githtmldir [file normalize $_githtmldir]
- }
+ set _githtmldir [file normalize $_githtmldir]
}
if {$args eq {}} {
return $_githtmldir
@@ -252,40 +362,6 @@ proc reponame {} {
return $::_reponame
}
-proc is_MacOSX {} {
- if {[tk windowingsystem] eq {aqua}} {
- return 1
- }
- return 0
-}
-
-proc is_Windows {} {
- if {$::tcl_platform(platform) eq {windows}} {
- return 1
- }
- return 0
-}
-
-proc is_Cygwin {} {
- global _iscygwin
- if {$_iscygwin eq {}} {
- if {$::tcl_platform(platform) eq {windows}} {
- if {[catch {set p [exec cygpath --windir]} err]} {
- set _iscygwin 0
- } else {
- set _iscygwin 1
- # Handle MSys2 which is only cygwin when MSYSTEM is MSYS.
- if {[info exists ::env(MSYSTEM)] && $::env(MSYSTEM) ne "MSYS"} {
- set _iscygwin 0
- }
- }
- } else {
- set _iscygwin 0
- }
- }
- return $_iscygwin
-}
-
proc is_enabled {option} {
global enabled_options
if {[catch {set on $enabled_options($option)}]} {return 0}
@@ -448,44 +524,6 @@ proc _git_cmd {name} {
return $v
}
-proc _which {what args} {
- global env _search_exe _search_path
-
- if {$_search_path eq {}} {
- if {[is_Cygwin] && [regexp {^(/|\.:)} $env(PATH)]} {
- set _search_path [split [exec cygpath \
- --windows \
- --path \
- --absolute \
- $env(PATH)] {;}]
- set _search_exe .exe
- } elseif {[is_Windows]} {
- set gitguidir [file dirname [info script]]
- regsub -all ";" $gitguidir "\\;" gitguidir
- set env(PATH) "$gitguidir;$env(PATH)"
- set _search_path [split $env(PATH) {;}]
- set _search_exe .exe
- } else {
- set _search_path [split $env(PATH) :]
- set _search_exe {}
- }
- }
-
- if {[is_Windows] && [lsearch -exact $args -script] >= 0} {
- set suffix {}
- } else {
- set suffix $_search_exe
- }
-
- foreach p $_search_path {
- set p [file join $p $what$suffix]
- if {[file exists $p]} {
- return [file normalize $p]
- }
- }
- return {}
-}
-
# Test a file for a hashbang to identify executable scripts on Windows.
proc is_shellscript {filename} {
if {![file exists $filename]} {return 0}
@@ -623,31 +661,8 @@ proc git_write {args} {
}
proc githook_read {hook_name args} {
- set pchook [gitdir hooks $hook_name]
- lappend args 2>@1
-
- # On Windows [file executable] might lie so we need to ask
- # the shell if the hook is executable. Yes that's annoying.
- #
- if {[is_Windows]} {
- upvar #0 _sh interp
- if {![info exists interp]} {
- set interp [_which sh]
- }
- if {$interp eq {}} {
- error "hook execution requires sh (not in PATH)"
- }
-
- set scr {if test -x "$1";then exec "$@";fi}
- set sh_c [list $interp -c $scr $interp $pchook]
- return [_open_stdout_stderr [concat $sh_c $args]]
- }
-
- if {[file executable $pchook]} {
- return [_open_stdout_stderr [concat [list $pchook] $args]]
- }
-
- return {}
+ set cmd [concat git hook run --ignore-missing $hook_name -- $args 2>@1]
+ return [_open_stdout_stderr $cmd]
}
proc kill_file_process {fd} {
@@ -1259,9 +1274,6 @@ if {$_gitdir eq "."} {
set _gitdir [pwd]
}
-if {![file isdirectory $_gitdir] && [is_Cygwin]} {
- catch {set _gitdir [exec cygpath --windows $_gitdir]}
-}
if {![file isdirectory $_gitdir]} {
catch {wm withdraw .}
error_popup [strcat [mc "Git directory not found:"] "\n\n$_gitdir"]
@@ -1273,11 +1285,7 @@ apply_config
# v1.7.0 introduced --show-toplevel to return the canonical work-tree
if {[package vcompare $_git_version 1.7.0] >= 0} {
- if { [is_Cygwin] } {
- catch {set _gitworktree [exec cygpath --windows [git rev-parse --show-toplevel]]}
- } else {
- set _gitworktree [git rev-parse --show-toplevel]
- }
+ set _gitworktree [git rev-parse --show-toplevel]
} else {
# try to set work tree from environment, core.worktree or use
# cdup to obtain a relative path to the top of the worktree. If
@@ -1502,24 +1510,8 @@ proc rescan {after {honor_trustmtime 1}} {
}
}
-if {[is_Cygwin]} {
- set is_git_info_exclude {}
- proc have_info_exclude {} {
- global is_git_info_exclude
-
- if {$is_git_info_exclude eq {}} {
- if {[catch {exec test -f [gitdir info exclude]}]} {
- set is_git_info_exclude 0
- } else {
- set is_git_info_exclude 1
- }
- }
- return $is_git_info_exclude
- }
-} else {
- proc have_info_exclude {} {
- return [file readable [gitdir info exclude]]
- }
+proc have_info_exclude {} {
+ return [file readable [gitdir info exclude]]
}
proc rescan_stage2 {fd after} {
@@ -2259,7 +2251,9 @@ proc do_git_gui {} {
# Get the system-specific explorer app/command.
proc get_explorer {} {
- if {[is_Cygwin] || [is_Windows]} {
+ if {[is_Cygwin]} {
+ set explorer "/bin/cygstart.exe --explore"
+ } elseif {[is_Windows]} {
set explorer "explorer.exe"
} elseif {[is_MacOSX]} {
set explorer "open"
@@ -2373,7 +2367,7 @@ proc do_quit {{rc {1}}} {
set ret_code $rc
# Briefly enable send again, working around Tk bug
- # http://sourceforge.net/tracker/?func=detail&atid=112997&aid=1821174&group_id=12997
+ # https://sourceforge.net/p/tktoolkit/bugs/2343/
tk appname [appname]
destroy .
@@ -3053,16 +3047,12 @@ if {[is_MacOSX]} {
set doc_path [githtmldir]
if {$doc_path ne {}} {
set doc_path [file join $doc_path index.html]
-
- if {[is_Cygwin]} {
- set doc_path [exec cygpath --mixed $doc_path]
- }
}
if {[file isfile $doc_path]} {
set doc_url "file:$doc_path"
} else {
- set doc_url {http://www.kernel.org/pub/software/scm/git/docs/}
+ set doc_url {https://www.kernel.org/pub/software/scm/git/docs/}
}
proc start_browser {url} {
@@ -4028,60 +4018,6 @@ set file_lists($ui_workdir) [list]
wm title . "[appname] ([reponame]) [file normalize $_gitworktree]"
focus -force $ui_comm
-# -- Warn the user about environmental problems. Cygwin's Tcl
-# does *not* pass its env array onto any processes it spawns.
-# This means that git processes get none of our environment.
-#
-if {[is_Cygwin]} {
- set ignored_env 0
- set suggest_user {}
- set msg [mc "Possible environment issues exist.
-
-The following environment variables are probably
-going to be ignored by any Git subprocess run
-by %s:
-
-" [appname]]
- foreach name [array names env] {
- switch -regexp -- $name {
- {^GIT_INDEX_FILE$} -
- {^GIT_OBJECT_DIRECTORY$} -
- {^GIT_ALTERNATE_OBJECT_DIRECTORIES$} -
- {^GIT_DIFF_OPTS$} -
- {^GIT_EXTERNAL_DIFF$} -
- {^GIT_PAGER$} -
- {^GIT_TRACE$} -
- {^GIT_CONFIG$} -
- {^GIT_(AUTHOR|COMMITTER)_DATE$} {
- append msg " - $name\n"
- incr ignored_env
- }
- {^GIT_(AUTHOR|COMMITTER)_(NAME|EMAIL)$} {
- append msg " - $name\n"
- incr ignored_env
- set suggest_user $name
- }
- }
- }
- if {$ignored_env > 0} {
- append msg [mc "
-This is due to a known issue with the
-Tcl binary distributed by Cygwin."]
-
- if {$suggest_user ne {}} {
- append msg [mc "
-
-A good replacement for %s
-is placing values for the user.name and
-user.email settings into your personal
-~/.gitconfig file.
-" $suggest_user]
- }
- warn_popup $msg
- }
- unset ignored_env msg suggest_user name
-}
-
# -- Only initialize complex UI if we are going to stay running.
#
if {[is_enabled transport]} {
diff --git a/git-gui/lib/choose_repository.tcl b/git-gui/lib/choose_repository.tcl
index af1fee7..d23abed 100644
--- a/git-gui/lib/choose_repository.tcl
+++ b/git-gui/lib/choose_repository.tcl
@@ -174,9 +174,6 @@ constructor pick {} {
-foreground blue \
-underline 1
set home $::env(HOME)
- if {[is_Cygwin]} {
- set home [exec cygpath --windows --absolute $home]
- }
set home "[file normalize $home]/"
set hlen [string length $home]
foreach p $sorted_recent {
@@ -374,18 +371,6 @@ proc _objdir {path} {
return $objdir
}
- if {[is_Cygwin]} {
- set objdir [file join $path .git objects.lnk]
- if {[file isfile $objdir]} {
- return [win32_read_lnk $objdir]
- }
-
- set objdir [file join $path objects.lnk]
- if {[file isfile $objdir]} {
- return [win32_read_lnk $objdir]
- }
- }
-
return {}
}
@@ -623,12 +608,6 @@ method _do_clone2 {} {
}
set giturl $origin_url
- if {[is_Cygwin] && [file isdirectory $giturl]} {
- set giturl [exec cygpath --unix --absolute $giturl]
- if {$clone_type eq {shared}} {
- set objdir [exec cygpath --unix --absolute $objdir]
- }
- }
if {[file exists $local_path]} {
error_popup [mc "Location %s already exists." $local_path]
@@ -668,11 +647,7 @@ method _do_clone2 {} {
fconfigure $f_cp -translation binary -encoding binary
cd $objdir
while {[gets $f_in line] >= 0} {
- if {[is_Cygwin]} {
- puts $f_cp [exec cygpath --unix --absolute $line]
- } else {
- puts $f_cp [file normalize $line]
- }
+ puts $f_cp [file normalize $line]
}
close $f_in
close $f_cp
diff --git a/git-gui/lib/encoding.tcl b/git-gui/lib/encoding.tcl
index 32668fc..d2e0fa6 100644
--- a/git-gui/lib/encoding.tcl
+++ b/git-gui/lib/encoding.tcl
@@ -3,7 +3,7 @@
# (Copied from gitk, commit fd8ccbec4f0161)
# This list of encoding names and aliases is distilled from
-# http://www.iana.org/assignments/character-sets.
+# https://www.iana.org/assignments/character-sets.
# Not all of them are supported by Tcl.
set encoding_aliases {
{ ANSI_X3.4-1968 iso-ir-6 ANSI_X3.4-1986 ISO_646.irv:1991 ASCII
diff --git a/git-gui/lib/shortcut.tcl b/git-gui/lib/shortcut.tcl
index 97d1d7a..674a41f 100644
--- a/git-gui/lib/shortcut.tcl
+++ b/git-gui/lib/shortcut.tcl
@@ -27,13 +27,10 @@ proc do_windows_shortcut {} {
}
proc do_cygwin_shortcut {} {
- global argv0 _gitworktree
+ global argv0 _gitworktree oguilib
if {[catch {
set desktop [exec cygpath \
- --windows \
- --absolute \
- --long-name \
--desktop]
}]} {
set desktop .
@@ -48,19 +45,19 @@ proc do_cygwin_shortcut {} {
set fn ${fn}.lnk
}
if {[catch {
- set sh [exec cygpath \
- --windows \
- --absolute \
- /bin/sh.exe]
- set me [exec cygpath \
- --unix \
- --absolute \
- $argv0]
- win32_create_lnk $fn [list \
- $sh -c \
- "CHERE_INVOKING=1 source /etc/profile;[sq $me] &" \
- ] \
- [file normalize $_gitworktree]
+ set repodir [file normalize $_gitworktree]
+ set shargs {-c \
+ "CHERE_INVOKING=1 \
+ source /etc/profile; \
+ git gui"}
+ exec /bin/mkshortcut.exe \
+ --arguments $shargs \
+ --desc "git-gui on $repodir" \
+ --icon $oguilib/git-gui.ico \
+ --name $fn \
+ --show min \
+ --workingdir $repodir \
+ /bin/sh.exe
} err]} {
error_popup [strcat [mc "Cannot write shortcut:"] "\n\n$err"]
}
diff --git a/git-gui/po/README b/git-gui/po/README
index 2514bc2..1162331 100644
--- a/git-gui/po/README
+++ b/git-gui/po/README
@@ -39,7 +39,7 @@ in your language?
If you do not know what your language should be named, you need to find
it. This currently follows ISO 639-1 two letter codes:
- http://www.loc.gov/standards/iso639-2/php/code_list.php
+ https://www.loc.gov/standards/iso639-2/php/code_list.php
For example, if you are preparing a translation for Afrikaans, the
language code is "af". If there already is a translation for your
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 4349566..994431c 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -102,7 +102,7 @@ resolve_full_httpd () {
start_httpd () {
if test -f "$fqgitdir/pid"; then
- say "Instance already running. Restarting..."
+ echo "Instance already running. Restarting..."
stop_httpd
fi
@@ -432,7 +432,7 @@ mongoose_conf() {
# Mongoose web server configuration file.
# Lines starting with '#' and empty lines are ignored.
# For detailed description of every option, visit
-# http://code.google.com/p/mongoose/wiki/MongooseManual
+# https://code.google.com/p/mongoose/wiki/MongooseManual
root $root
ports $port
@@ -458,7 +458,7 @@ plackup_conf () {
#!$PERL
# gitweb - simple web interface to track changes in git repositories
-# PSGI wrapper and server starter (see http://plackperl.org)
+# PSGI wrapper and server starter (see https://plackperl.org)
use strict;
diff --git a/git-merge-resolve.sh b/git-merge-resolve.sh
index 343fe7b..77e9312 100755
--- a/git-merge-resolve.sh
+++ b/git-merge-resolve.sh
@@ -5,6 +5,16 @@
#
# Resolve two trees, using enhanced multi-base read-tree.
+. git-sh-setup
+
+# Abort if index does not match HEAD
+if ! git diff-index --quiet --cached HEAD --
+then
+ gettextln "Error: Your local changes to the following files would be overwritten by merge"
+ git diff-index --cached --name-only HEAD -- | sed -e 's/^/ /'
+ exit 2
+fi
+
# The first parameters up to -- are merge bases; the rest are heads.
bases= head= remotes= sep_seen=
for arg
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index 9f99201..1ff2617 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -97,7 +97,42 @@ merge_mode () {
test "$TOOL_MODE" = merge
}
+get_gui_default () {
+ if diff_mode
+ then
+ GUI_DEFAULT_KEY="difftool.guiDefault"
+ else
+ GUI_DEFAULT_KEY="mergetool.guiDefault"
+ fi
+ GUI_DEFAULT_CONFIG_LCASE=$(git config --default false --get "$GUI_DEFAULT_KEY" | tr 'A-Z' 'a-z')
+ if test "$GUI_DEFAULT_CONFIG_LCASE" = "auto"
+ then
+ if test -n "$DISPLAY"
+ then
+ GUI_DEFAULT=true
+ else
+ GUI_DEFAULT=false
+ fi
+ else
+ GUI_DEFAULT=$(git config --default false --bool --get "$GUI_DEFAULT_KEY")
+ subshell_exit_status=$?
+ if test $subshell_exit_status -ne 0
+ then
+ exit $subshell_exit_status
+ fi
+ fi
+ echo $GUI_DEFAULT
+}
+
gui_mode () {
+ if test -z "$GIT_MERGETOOL_GUI"
+ then
+ GIT_MERGETOOL_GUI=$(get_gui_default)
+ if test $? -ne 0
+ then
+ exit 2
+ fi
+ fi
test "$GIT_MERGETOOL_GUI" = true
}
@@ -467,6 +502,11 @@ get_merge_tool () {
is_guessed=false
# Check if a merge tool has been configured
merge_tool=$(get_configured_merge_tool)
+ subshell_exit_status=$?
+ if test $subshell_exit_status -gt "1"
+ then
+ exit $subshell_exit_status
+ fi
# Try to guess an appropriate merge tool if no tool has been set.
if test -z "$merge_tool"
then
diff --git a/git-mergetool.sh b/git-mergetool.sh
index f751d9c..8a92289 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -451,7 +451,7 @@ print_noop_and_exit () {
main () {
prompt=$(git config --bool mergetool.prompt)
- GIT_MERGETOOL_GUI=false
+ GIT_MERGETOOL_GUI=
guessed_merge_tool=false
orderfile=
@@ -511,9 +511,14 @@ main () {
if test -z "$merge_tool"
then
- if ! merge_tool=$(get_merge_tool)
+ merge_tool=$(get_merge_tool)
+ subshell_exit_status=$?
+ if test $subshell_exit_status = 1
then
guessed_merge_tool=true
+ elif test $subshell_exit_status -gt 1
+ then
+ exit $subshell_exit_status
fi
fi
merge_keep_backup="$(git config --bool mergetool.keepBackup || echo true)"
diff --git a/git-p4.py b/git-p4.py
index 77dc19d..28ab12c 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -689,8 +689,8 @@ def setP4ExecBit(file, mode):
if not isModeExec(mode):
p4Type = getP4OpenedType(file)
- p4Type = re.sub('^([cku]?)x(.*)', '\\1\\2', p4Type)
- p4Type = re.sub('(.*?\+.*?)x(.*?)', '\\1\\2', p4Type)
+ p4Type = re.sub(r'^([cku]?)x(.*)', r'\1\2', p4Type)
+ p4Type = re.sub(r'(.*?\+.*?)x(.*?)', r'\1\2', p4Type)
if p4Type[-1] == "+":
p4Type = p4Type[0:-1]
@@ -701,7 +701,7 @@ def getP4OpenedType(file):
"""Returns the perforce file type for the given file."""
result = p4_read_pipe(["opened", wildcard_encode(file)])
- match = re.match(".*\((.+)\)( \*exclusive\*)?\r?$", result)
+ match = re.match(r".*\((.+)\)( \*exclusive\*)?\r?$", result)
if match:
return match.group(1)
else:
@@ -757,7 +757,7 @@ def parseDiffTreeEntry(entry):
global _diff_tree_pattern
if not _diff_tree_pattern:
- _diff_tree_pattern = re.compile(':(\d+) (\d+) (\w+) (\w+) ([A-Z])(\d+)?\t(.*?)((\t(.*))|$)')
+ _diff_tree_pattern = re.compile(r':(\d+) (\d+) (\w+) (\w+) ([A-Z])(\d+)?\t(.*?)((\t(.*))|$)')
match = _diff_tree_pattern.match(entry)
if match:
@@ -918,9 +918,9 @@ def p4CmdList(cmd, stdin=None, stdin_mode='w+b', cb=None, skip_info=False,
if len(result) > 0:
data = result[0].get('data')
if data:
- m = re.search('Too many rows scanned \(over (\d+)\)', data)
+ m = re.search(r'Too many rows scanned \(over (\d+)\)', data)
if not m:
- m = re.search('Request too large \(over (\d+)\)', data)
+ m = re.search(r'Request too large \(over (\d+)\)', data)
if m:
limit = int(m.group(1))
@@ -1452,7 +1452,7 @@ def wildcard_encode(path):
def wildcard_present(path):
- m = re.search("[*#@%]", path)
+ m = re.search(r"[*#@%]", path)
return m is not None
@@ -1522,6 +1522,10 @@ class LargeFileSystem(object):
file is stored in the large file system and handles all necessary
steps.
"""
+ # symlinks aren't processed by smudge/clean filters
+ if git_mode == "120000":
+ return (git_mode, contents)
+
if self.exceedsLargeFileThreshold(relPath, contents) or self.hasLargeFileExtension(relPath):
contentTempFile = self.generateTempFile(contents)
pointer_git_mode, contents, localLargeFile = self.generatePointer(contentTempFile)
@@ -2259,7 +2263,7 @@ class P4Submit(Command, P4UserMap):
raw=True):
if regexp.search(line):
if verbose:
- print("got keyword match on %s in %s in %s" % (regex.pattern, line, file))
+ print("got keyword match on %s in %s in %s" % (regexp.pattern, line, file))
kwfiles[file] = regexp
break
@@ -3044,7 +3048,7 @@ class P4Sync(Command, P4UserMap):
# Preserve everything in relative path name except leading
# //depot/; just look at first prefix as they all should
# be in the same depot.
- depot = re.sub("^(//[^/]+/).*", r'\1', prefixes[0])
+ depot = re.sub(r"^(//[^/]+/).*", r'\1', prefixes[0])
if p4PathStartsWith(path, depot):
path = path[len(depot):]
@@ -3599,7 +3603,7 @@ class P4Sync(Command, P4UserMap):
commitFound = True
else:
gitCommit = read_pipe(["git", "rev-list", "--max-count=1",
- "--reverse", ":/\[git-p4:.*change = %d\]" % changelist], ignore_error=True)
+ "--reverse", r":/\[git-p4:.*change = %d\]" % changelist], ignore_error=True)
if len(gitCommit) == 0:
print("importing label %s: could not find git commit for changelist %d" % (name, changelist))
else:
@@ -4178,7 +4182,7 @@ class P4Sync(Command, P4UserMap):
if len(self.changesFile) == 0:
revision = "#head"
- p = re.sub("\.\.\.$", "", p)
+ p = re.sub(r"\.\.\.$", "", p)
if not p.endswith("/"):
p += "/"
@@ -4247,7 +4251,8 @@ class P4Sync(Command, P4UserMap):
if self.tempBranches != []:
for branch in self.tempBranches:
read_pipe(["git", "update-ref", "-d", branch])
- os.rmdir(os.path.join(os.environ.get("GIT_DIR", ".git"), self.tempBranchLocation))
+ if len(read_pipe(["git", "for-each-ref", self.tempBranchLocation])) > 0:
+ die("There are unexpected temporary branches")
# Create a symbolic ref p4/HEAD pointing to p4/<branch> to allow
# a convenient shortcut refname "p4".
@@ -4287,7 +4292,7 @@ class P4Rebase(Command):
die("Cannot find upstream branchpoint for rebase")
# the branchpoint may be p4/foo~3, so strip off the parent
- upstream = re.sub("~[0-9]+$", "", upstream)
+ upstream = re.sub(r"~[0-9]+$", "", upstream)
print("Rebasing the current branch onto %s" % upstream)
oldHead = read_pipe(["git", "rev-parse", "HEAD"]).strip()
@@ -4316,8 +4321,8 @@ class P4Clone(P4Sync):
def defaultDestination(self, args):
# TODO: use common prefix of args?
depotPath = args[0]
- depotDir = re.sub("(@[^@]*)$", "", depotPath)
- depotDir = re.sub("(#[^#]*)$", "", depotDir)
+ depotDir = re.sub(r"(@[^@]*)$", "", depotPath)
+ depotDir = re.sub(r"(#[^#]*)$", "", depotDir)
depotDir = re.sub(r"\.\.\.$", "", depotDir)
depotDir = re.sub(r"/$", "", depotDir)
return os.path.split(depotDir)[1]
@@ -4402,19 +4407,16 @@ class P4Unshelve(Command):
def renameBranch(self, branch_name):
"""Rename the existing branch to branch_name.N ."""
- found = True
for i in range(0, 1000):
backup_branch_name = "{0}.{1}".format(branch_name, i)
if not gitBranchExists(backup_branch_name):
# Copy ref to backup
gitUpdateRef(backup_branch_name, branch_name)
gitDeleteRef(branch_name)
- found = True
print("renamed old unshelve branch to {0}".format(backup_branch_name))
break
-
- if not found:
- sys.exit("gave up trying to rename existing branch {0}".format(sync.branch))
+ else:
+ sys.exit("gave up trying to rename existing branch {0}".format(branch_name))
def findLastP4Revision(self, starting_point):
"""Look back from starting_point for the first commit created by git-p4
diff --git a/git-quiltimport.sh b/git-quiltimport.sh
index e3d3909..eb34cda 100755
--- a/git-quiltimport.sh
+++ b/git-quiltimport.sh
@@ -148,7 +148,7 @@ do
if [ -z "$dry_run" ] ; then
git apply --index -C1 ${level:+"$level"} "$tmp_patch" &&
tree=$(git write-tree) &&
- commit=$( (echo "$SUBJECT"; echo; cat "$tmp_msg") | git commit-tree $tree -p $commit) &&
+ commit=$( { echo "$SUBJECT"; echo; cat "$tmp_msg"; } | git commit-tree $tree -p $commit) &&
git update-ref -m "quiltimport: $patch_name" HEAD $commit || exit 4
fi
done 3<"$QUILT_SERIES"
diff --git a/git-request-pull.sh b/git-request-pull.sh
index 2d0e446..01640a0 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -153,7 +153,7 @@ for you to fetch changes up to %H:
if test $(git cat-file -t "$head") = tag
then
git cat-file tag "$head" |
- sed -n -e '1,/^$/d' -e '/^-----BEGIN PGP /q' -e p
+ sed -n -e '1,/^$/d' -e '/^-----BEGIN \(PGP\|SSH\|SIGNED\) /q' -e p
echo
echo "----------------------------------------------------------------"
fi &&
diff --git a/git-send-email.perl b/git-send-email.perl
index 5861e99..821b2b3 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -16,7 +16,7 @@
# and second line is the subject of the message.
#
-use 5.008;
+use 5.008001;
use strict;
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use Getopt::Long;
@@ -26,22 +26,10 @@ use Git::I18N;
Getopt::Long::Configure qw/ pass_through /;
-package FakeTerm;
-sub new {
- my ($class, $reason) = @_;
- return bless \$reason, shift;
-}
-sub readline {
- my $self = shift;
- die "Cannot use readline on FakeTerm: $$self";
-}
-package main;
-
-
sub usage {
print <<EOT;
-git send-email' [<options>] <file|directory>
-git send-email' [<options>] <format-patch options>
+git send-email [<options>] <file|directory>
+git send-email [<options>] <format-patch options>
git send-email --dump-aliases
Composing:
@@ -87,8 +75,10 @@ git send-email --dump-aliases
Automating:
--identity <str> * Use the sendemail.<id> options.
- --to-cmd <str> * Email To: via `<str> \$patch_path`
- --cc-cmd <str> * Email Cc: via `<str> \$patch_path`
+ --to-cmd <str> * Email To: via `<str> \$patch_path`.
+ --cc-cmd <str> * Email Cc: via `<str> \$patch_path`.
+ --header-cmd <str> * Add headers via `<str> \$patch_path`.
+ --no-header-cmd * Disable any header command in use.
--suppress-cc <str> * author, self, sob, cc, cccmd, body, bodycc, misc-by, all.
--[no-]cc-cover * Email Cc: addresses in the cover letter.
--[no-]to-cover * Email To: addresses in the cover letter.
@@ -129,13 +119,16 @@ sub completion_helper {
foreach my $key (keys %$original_opts) {
unless (exists $not_for_completion{$key}) {
- $key =~ s/!$//;
+ my $negatable = ($key =~ s/!$//);
if ($key =~ /[:=][si]$/) {
$key =~ s/[:=][si]$//;
push (@send_email_opts, "--$_=") foreach (split (/\|/, $key));
} else {
push (@send_email_opts, "--$_") foreach (split (/\|/, $key));
+ if ($negatable) {
+ push (@send_email_opts, "--no-$_") foreach (split (/\|/, $key));
+ }
}
}
}
@@ -202,7 +195,7 @@ my (@to,@cc,@xh,$envelope_sender,
$author,$sender,$smtp_authpass,$annotate,$compose,$time);
# Things we either get from config, *or* are overridden on the
# command-line.
-my ($no_cc, $no_to, $no_bcc, $no_identity);
+my ($no_cc, $no_to, $no_bcc, $no_identity, $no_header_cmd);
my (@config_to, @getopt_to);
my (@config_cc, @getopt_cc);
my (@config_bcc, @getopt_bcc);
@@ -220,6 +213,10 @@ my $compose_filename;
my $force = 0;
my $dump_aliases = 0;
+# Variables to prevent short format-patch options from being captured
+# as abbreviated send-email options
+my $reroll_count;
+
# Handle interactive edition of files.
my $multiedit;
my $editor;
@@ -234,7 +231,7 @@ sub system_or_msg {
my @sprintf_args = ($cmd_name ? $cmd_name : $args->[0], $exit_code);
if (defined $msg) {
# Quiet the 'redundant' warning category, except we
- # need to support down to Perl 5.8, so we can't do a
+ # need to support down to Perl 5.8.1, so we can't do a
# "no warnings 'redundant'", since that category was
# introduced in perl 5.22, and asking for it will die
# on older perls.
@@ -265,7 +262,7 @@ sub do_edit {
# Variables with corresponding config settings
my ($suppress_from, $signed_off_by_cc);
my ($cover_cc, $cover_to);
-my ($to_cmd, $cc_cmd);
+my ($to_cmd, $cc_cmd, $header_cmd);
my ($smtp_server, $smtp_server_port, @smtp_server_options);
my ($smtp_authuser, $smtp_encryption, $smtp_ssl_cert_path);
my ($batch_size, $relogin_delay);
@@ -314,6 +311,7 @@ my %config_settings = (
"tocmd" => \$to_cmd,
"cc" => \@config_cc,
"cccmd" => \$cc_cmd,
+ "headercmd" => \$header_cmd,
"aliasfiletype" => \$aliasfiletype,
"bcc" => \@config_bcc,
"suppresscc" => \@suppress_cc,
@@ -496,7 +494,6 @@ my %options = (
"bcc=s" => \@getopt_bcc,
"no-bcc" => \$no_bcc,
"chain-reply-to!" => \$chain_reply_to,
- "no-chain-reply-to" => sub {$chain_reply_to = 0},
"sendmail-cmd=s" => \$sendmail_cmd,
"smtp-server=s" => \$smtp_server,
"smtp-server-option=s" => \@smtp_server_options,
@@ -511,37 +508,31 @@ my %options = (
"smtp-auth=s" => \$smtp_auth,
"no-smtp-auth" => sub {$smtp_auth = 'none'},
"annotate!" => \$annotate,
- "no-annotate" => sub {$annotate = 0},
"compose" => \$compose,
"quiet" => \$quiet,
"cc-cmd=s" => \$cc_cmd,
+ "header-cmd=s" => \$header_cmd,
+ "no-header-cmd" => \$no_header_cmd,
"suppress-from!" => \$suppress_from,
- "no-suppress-from" => sub {$suppress_from = 0},
"suppress-cc=s" => \@suppress_cc,
"signed-off-cc|signed-off-by-cc!" => \$signed_off_by_cc,
- "no-signed-off-cc|no-signed-off-by-cc" => sub {$signed_off_by_cc = 0},
- "cc-cover|cc-cover!" => \$cover_cc,
- "no-cc-cover" => sub {$cover_cc = 0},
- "to-cover|to-cover!" => \$cover_to,
- "no-to-cover" => sub {$cover_to = 0},
+ "cc-cover!" => \$cover_cc,
+ "to-cover!" => \$cover_to,
"confirm=s" => \$confirm,
"dry-run" => \$dry_run,
"envelope-sender=s" => \$envelope_sender,
"thread!" => \$thread,
- "no-thread" => sub {$thread = 0},
"validate!" => \$validate,
- "no-validate" => sub {$validate = 0},
"transfer-encoding=s" => \$target_xfer_encoding,
"format-patch!" => \$format_patch,
- "no-format-patch" => sub {$format_patch = 0},
"8bit-encoding=s" => \$auto_8bit_encoding,
"compose-encoding=s" => \$compose_encoding,
"force" => \$force,
"xmailer!" => \$use_xmailer,
- "no-xmailer" => sub {$use_xmailer = 0},
"batch-size=i" => \$batch_size,
"relogin-delay=i" => \$relogin_delay,
"git-completion-helper" => \$git_completion_helper,
+ "v=s" => \$reroll_count,
);
$rc = GetOptions(%options);
@@ -782,19 +773,27 @@ if (@rev_list_opts) {
die __("Cannot run git format-patch from outside a repository\n")
unless $repo;
require File::Temp;
- push @files, $repo->command('format-patch', '-o', File::Temp::tempdir(CLEANUP => 1), @rev_list_opts);
+ push @files, $repo->command('format-patch', '-o', File::Temp::tempdir(CLEANUP => 1),
+ defined $reroll_count ? ('-v', $reroll_count) : (),
+ @rev_list_opts);
}
-@files = handle_backup_files(@files);
-
-if ($validate) {
- foreach my $f (@files) {
- unless (-p $f) {
- validate_patch($f, $target_xfer_encoding);
- }
- }
+if (defined $sender) {
+ $sender =~ s/^\s+|\s+$//g;
+ ($sender) = expand_aliases($sender);
+} else {
+ $sender = $repoauthor->() || $repocommitter->() || '';
}
+# $sender could be an already sanitized address
+# (e.g. sendemail.from could be manually sanitized by user).
+# But it's a no-op to run sanitize_address on an already sanitized address.
+$sender = sanitize_address($sender);
+
+$time = time - scalar $#files;
+
+@files = handle_backup_files(@files);
+
if (@files) {
unless ($quiet) {
print $_,"\n" for (@files);
@@ -831,6 +830,9 @@ if ($compose) {
my $tpl_subject = $initial_subject || '';
my $tpl_in_reply_to = $initial_in_reply_to || '';
my $tpl_reply_to = $reply_to || '';
+ my $tpl_to = join(',', @initial_to);
+ my $tpl_cc = join(',', @initial_cc);
+ my $tpl_bcc = join(', ', @initial_bcc);
print $c <<EOT1, Git::prefix_lines("GIT: ", __(<<EOT2)), <<EOT3;
From $tpl_sender # This line is ignored.
@@ -842,6 +844,9 @@ for the patch you are writing.
Clear the body content if you don't wish to send a summary.
EOT2
From: $tpl_sender
+To: $tpl_to
+Cc: $tpl_cc
+Bcc: $tpl_bcc
Reply-To: $tpl_reply_to
Subject: $tpl_subject
In-Reply-To: $tpl_in_reply_to
@@ -858,88 +863,82 @@ EOT3
do_edit($compose_filename);
}
+ open my $c2, ">", $compose_filename . ".final"
+ or die sprintf(__("Failed to open %s.final: %s"), $compose_filename, $!);
+
open $c, "<", $compose_filename
or die sprintf(__("Failed to open %s: %s"), $compose_filename, $!);
+ my $need_8bit_cte = file_has_nonascii($compose_filename);
+ my $in_body = 0;
+ my $summary_empty = 1;
if (!defined $compose_encoding) {
$compose_encoding = "UTF-8";
}
-
- my %parsed_email;
- while (my $line = <$c>) {
- next if $line =~ m/^GIT:/;
- parse_header_line($line, \%parsed_email);
- if ($line =~ /^$/) {
- $parsed_email{'body'} = filter_body($c);
+ while(<$c>) {
+ next if m/^GIT:/;
+ if ($in_body) {
+ $summary_empty = 0 unless (/^\n$/);
+ } elsif (/^\n$/) {
+ $in_body = 1;
+ if ($need_8bit_cte) {
+ print $c2 "MIME-Version: 1.0\n",
+ "Content-Type: text/plain; ",
+ "charset=$compose_encoding\n",
+ "Content-Transfer-Encoding: 8bit\n";
+ }
+ } elsif (/^MIME-Version:/i) {
+ $need_8bit_cte = 0;
+ } elsif (/^Subject:\s*(.+)\s*$/i) {
+ $initial_subject = $1;
+ my $subject = $initial_subject;
+ $_ = "Subject: " .
+ quote_subject($subject, $compose_encoding) .
+ "\n";
+ } elsif (/^In-Reply-To:\s*(.+)\s*$/i) {
+ $initial_in_reply_to = $1;
+ next;
+ } elsif (/^Reply-To:\s*(.+)\s*$/i) {
+ $reply_to = $1;
+ } elsif (/^From:\s*(.+)\s*$/i) {
+ $sender = $1;
+ next;
+ } elsif (/^To:\s*(.+)\s*$/i) {
+ @initial_to = parse_address_line($1);
+ next;
+ } elsif (/^Cc:\s*(.+)\s*$/i) {
+ @initial_cc = parse_address_line($1);
+ next;
+ } elsif (/^Bcc:/i) {
+ @initial_bcc = parse_address_line($1);
+ next;
}
+ print $c2 $_;
}
close $c;
+ close $c2;
- open my $c2, ">", $compose_filename . ".final"
- or die sprintf(__("Failed to open %s.final: %s"), $compose_filename, $!);
-
-
- if ($parsed_email{'From'}) {
- $sender = delete($parsed_email{'From'});
- }
- if ($parsed_email{'In-Reply-To'}) {
- $initial_in_reply_to = delete($parsed_email{'In-Reply-To'});
- }
- if ($parsed_email{'Reply-To'}) {
- $reply_to = delete($parsed_email{'Reply-To'});
- }
- if ($parsed_email{'Subject'}) {
- $initial_subject = delete($parsed_email{'Subject'});
- print $c2 "Subject: " .
- quote_subject($initial_subject, $compose_encoding) .
- "\n";
- }
-
- if ($parsed_email{'MIME-Version'}) {
- print $c2 "MIME-Version: $parsed_email{'MIME-Version'}\n",
- "Content-Type: $parsed_email{'Content-Type'};\n",
- "Content-Transfer-Encoding: $parsed_email{'Content-Transfer-Encoding'}\n";
- delete($parsed_email{'MIME-Version'});
- delete($parsed_email{'Content-Type'});
- delete($parsed_email{'Content-Transfer-Encoding'});
- } elsif (file_has_nonascii($compose_filename)) {
- my $content_type = (delete($parsed_email{'Content-Type'}) or
- "text/plain; charset=$compose_encoding");
- print $c2 "MIME-Version: 1.0\n",
- "Content-Type: $content_type\n",
- "Content-Transfer-Encoding: 8bit\n";
- }
- # Preserve unknown headers
- foreach my $key (keys %parsed_email) {
- next if $key eq 'body';
- print $c2 "$key: $parsed_email{$key}";
- }
-
- if ($parsed_email{'body'}) {
- print $c2 "\n$parsed_email{'body'}\n";
- delete($parsed_email{'body'});
- } else {
+ if ($summary_empty) {
print __("Summary email is empty, skipping it\n");
$compose = -1;
}
-
- close $c2;
-
} elsif ($annotate) {
do_edit(@files);
}
-sub term {
- my $term = eval {
+{
+ # Only instantiate one $term per program run, since some
+ # Term::ReadLine providers refuse to create a second instance.
+ my $term;
+ sub term {
require Term::ReadLine;
- $ENV{"GIT_SEND_EMAIL_NOTTY"}
- ? Term::ReadLine->new('git-send-email', \*STDIN, \*STDOUT)
- : Term::ReadLine->new('git-send-email');
- };
- if ($@) {
- $term = FakeTerm->new("$@: going non-interactive");
+ if (!defined $term) {
+ $term = $ENV{"GIT_SEND_EMAIL_NOTTY"}
+ ? Term::ReadLine->new('git-send-email', \*STDIN, \*STDOUT)
+ : Term::ReadLine->new('git-send-email');
+ }
+ return $term;
}
- return $term;
}
sub ask {
@@ -977,32 +976,6 @@ sub ask {
return;
}
-sub parse_header_line {
- my $lines = shift;
- my $parsed_line = shift;
- my $addr_pat = join "|", qw(To Cc Bcc);
-
- foreach (split(/\n/, $lines)) {
- if (/^($addr_pat):\s*(.+)$/i) {
- $parsed_line->{$1} = [ parse_address_line($2) ];
- } elsif (/^([^:]*):\s*(.+)\s*$/i) {
- $parsed_line->{$1} = $2;
- }
- }
-}
-
-sub filter_body {
- my $c = shift;
- my $body = "";
- while (my $body_line = <$c>) {
- if ($body_line !~ m/^GIT:/) {
- $body .= $body_line;
- }
- }
- return $body;
-}
-
-
my %broken_encoding;
sub file_declares_8bit_cte {
@@ -1043,18 +1016,6 @@ if (!$force) {
}
}
-if (defined $sender) {
- $sender =~ s/^\s+|\s+$//g;
- ($sender) = expand_aliases($sender);
-} else {
- $sender = $repoauthor->() || $repocommitter->() || '';
-}
-
-# $sender could be an already sanitized address
-# (e.g. sendemail.from could be manually sanitized by user).
-# But it's a no-op to run sanitize_address on an already sanitized address.
-$sender = sanitize_address($sender);
-
my $to_whom = __("To whom should the emails be sent (if anyone)?");
my $prompting = 0;
if (!@initial_to && !defined $to_cmd) {
@@ -1146,10 +1107,10 @@ sub extract_valid_address {
sub extract_valid_address_or_die {
my $address = shift;
- $address = extract_valid_address($address);
+ my $valid_address = extract_valid_address($address);
die sprintf(__("error: unable to extract a valid address from: %s\n"), $address)
- if !$address;
- return $address;
+ if !$valid_address;
+ return $valid_address;
}
sub validate_address {
@@ -1214,10 +1175,6 @@ sub make_message_id {
#print "new message id = $message_id\n"; # Was useful for debugging
}
-
-
-$time = time - scalar $#files;
-
sub unquote_rfc2047 {
local ($_) = @_;
my $charset;
@@ -1495,16 +1452,7 @@ sub file_name_is_absolute {
return File::Spec::Functions::file_name_is_absolute($path);
}
-# Prepares the email, then asks the user what to do.
-#
-# If the user chooses to send the email, it's sent and 1 is returned.
-# If the user chooses not to send the email, 0 is returned.
-# If the user decides they want to make further edits, -1 is returned and the
-# caller is expected to call send_message again after the edits are performed.
-#
-# If an error occurs sending the email, this just dies.
-
-sub send_message {
+sub gen_header {
my @recipients = unique_email_list(@to);
@cc = (grep { my $cc = extract_valid_address_or_die($_);
not grep { $cc eq $_ || $_ =~ /<\Q${cc}\E>$/ } @recipients
@@ -1530,7 +1478,7 @@ sub send_message {
To: $to${ccline}
Subject: $subject
Date: $date
-Message-Id: $message_id
+Message-ID: $message_id
";
if ($use_xmailer) {
$header .= "X-Mailer: git-send-email $gitversion\n";
@@ -1546,6 +1494,22 @@ Message-Id: $message_id
if (@xh) {
$header .= join("\n", @xh) . "\n";
}
+ my $recipients_ref = \@recipients;
+ return ($recipients_ref, $to, $date, $gitversion, $cc, $ccline, $header);
+}
+
+# Prepares the email, then asks the user what to do.
+#
+# If the user chooses to send the email, it's sent and 1 is returned.
+# If the user chooses not to send the email, 0 is returned.
+# If the user decides they want to make further edits, -1 is returned and the
+# caller is expected to call send_message again after the edits are performed.
+#
+# If an error occurs sending the email, this just dies.
+
+sub send_message {
+ my ($recipients_ref, $to, $date, $gitversion, $cc, $ccline, $header) = gen_header();
+ my @recipients = @$recipients_ref;
my @sendmail_parameters = ('-i', @recipients);
my $raw_from = $sender;
@@ -1731,15 +1695,8 @@ EOF
return 1;
}
-$in_reply_to = $initial_in_reply_to;
-$references = $initial_in_reply_to || '';
-$message_num = 0;
-
-# Prepares the email, prompts the user, sends it out
-# Returns 0 if an edit was done and the function should be called again, or 1
-# otherwise.
-sub process_file {
- my ($t) = @_;
+sub pre_process_file {
+ my ($t, $quiet) = @_;
open my $fh, "<", $t or die sprintf(__("can't open file %s"), $t);
@@ -1758,16 +1715,17 @@ sub process_file {
$subject = $initial_subject;
$message = "";
$message_num++;
- # First unfold multiline header fields
+ undef $message_id;
+ # Retrieve and unfold header fields.
+ my @header_lines = ();
while(<$fh>) {
last if /^\s*$/;
- if (/^\s+\S/ and @header) {
- chomp($header[$#header]);
- s/^\s+/ /;
- $header[$#header] .= $_;
- } else {
- push(@header, $_);
- }
+ push(@header_lines, $_);
+ }
+ @header = unfold_headers(@header_lines);
+ # Add computed headers, if applicable.
+ unless ($no_header_cmd || ! $header_cmd) {
+ push @header, invoke_header_cmd($header_cmd, $t);
}
# Now parse the header
foreach(@header) {
@@ -1825,7 +1783,7 @@ sub process_file {
$has_mime_version = 1;
push @xh, $_;
}
- elsif (/^Message-Id: (.*)/i) {
+ elsif (/^Message-ID: (.*)/i) {
$message_id = $1;
}
elsif (/^Content-Transfer-Encoding: (.*)/i) {
@@ -1893,9 +1851,9 @@ sub process_file {
}
close $fh;
- push @to, recipients_cmd("to-cmd", "to", $to_cmd, $t)
+ push @to, recipients_cmd("to-cmd", "to", $to_cmd, $t, $quiet)
if defined $to_cmd;
- push @cc, recipients_cmd("cc-cmd", "cc", $cc_cmd, $t)
+ push @cc, recipients_cmd("cc-cmd", "cc", $cc_cmd, $t, $quiet)
if defined $cc_cmd && !$suppress_cc{'cccmd'};
if ($broken_encoding{$t} && !$has_content_type) {
@@ -1954,6 +1912,15 @@ sub process_file {
@initial_to = @to;
}
}
+}
+
+# Prepares the email, prompts the user, and sends it out
+# Returns 0 if an edit was done and the function should be called again, or 1
+# on the email being successfully sent out.
+sub process_file {
+ my ($t) = @_;
+
+ pre_process_file($t, $quiet);
my $message_was_sent = send_message();
if ($message_was_sent == -1) {
@@ -1993,21 +1960,102 @@ sub process_file {
return 1;
}
+sub initialize_modified_loop_vars {
+ $in_reply_to = $initial_in_reply_to;
+ $references = $initial_in_reply_to || '';
+ $message_num = 0;
+}
+
+if ($validate) {
+ # FIFOs can only be read once, exclude them from validation.
+ my @real_files = ();
+ foreach my $f (@files) {
+ unless (-p $f) {
+ push(@real_files, $f);
+ }
+ }
+
+ # Run the loop once again to avoid gaps in the counter due to FIFO
+ # arguments provided by the user.
+ my $num = 1;
+ my $num_files = scalar @real_files;
+ $ENV{GIT_SENDEMAIL_FILE_TOTAL} = "$num_files";
+ initialize_modified_loop_vars();
+ foreach my $r (@real_files) {
+ $ENV{GIT_SENDEMAIL_FILE_COUNTER} = "$num";
+ pre_process_file($r, 1);
+ validate_patch($r, $target_xfer_encoding);
+ $num += 1;
+ }
+ delete $ENV{GIT_SENDEMAIL_FILE_COUNTER};
+ delete $ENV{GIT_SENDEMAIL_FILE_TOTAL};
+}
+
+initialize_modified_loop_vars();
foreach my $t (@files) {
while (!process_file($t)) {
# user edited the file
}
}
+# Execute a command and return its output lines as an array. Blank
+# lines which do not appear at the end of the output are reported as
+# errors.
+sub execute_cmd {
+ my ($prefix, $cmd, $file) = @_;
+ my @lines = ();
+ my $seen_blank_line = 0;
+ open my $fh, "-|", "$cmd \Q$file\E"
+ or die sprintf(__("(%s) Could not execute '%s'"), $prefix, $cmd);
+ while (my $line = <$fh>) {
+ die sprintf(__("(%s) Malformed output from '%s'"), $prefix, $cmd)
+ if $seen_blank_line;
+ if ($line =~ /^$/) {
+ $seen_blank_line = $line =~ /^$/;
+ next;
+ }
+ push @lines, $line;
+ }
+ close $fh
+ or die sprintf(__("(%s) failed to close pipe to '%s'"), $prefix, $cmd);
+ return @lines;
+}
+
+# Process headers lines, unfolding multiline headers as defined by RFC
+# 2822.
+sub unfold_headers {
+ my @headers;
+ foreach(@_) {
+ last if /^\s*$/;
+ if (/^\s+\S/ and @headers) {
+ chomp($headers[$#headers]);
+ s/^\s+/ /;
+ $headers[$#headers] .= $_;
+ } else {
+ push(@headers, $_);
+ }
+ }
+ return @headers;
+}
+
+# Invoke the provided CMD with FILE as an argument, which should
+# output RFC 2822 email headers. Fold multiline headers and return the
+# headers as an array.
+sub invoke_header_cmd {
+ my ($cmd, $file) = @_;
+ my @lines = execute_cmd("header-cmd", $header_cmd, $file);
+ return unfold_headers(@lines);
+}
+
# Execute a command (e.g. $to_cmd) to get a list of email addresses
# and return a results array
sub recipients_cmd {
- my ($prefix, $what, $cmd, $file) = @_;
-
+ my ($prefix, $what, $cmd, $file, $quiet) = @_;
+ my @lines = ();
my @addresses = ();
- open my $fh, "-|", "$cmd \Q$file\E"
- or die sprintf(__("(%s) Could not execute '%s'"), $prefix, $cmd);
- while (my $address = <$fh>) {
+
+ @lines = execute_cmd($prefix, $cmd, $file);
+ for my $address (@lines) {
$address =~ s/^\s*//g;
$address =~ s/\s*$//g;
$address = sanitize_address($address);
@@ -2016,8 +2064,6 @@ sub recipients_cmd {
printf(__("(%s) Adding %s: %s from: '%s'\n"),
$prefix, $what, $address, $cmd) unless $quiet;
}
- close $fh
- or die sprintf(__("(%s) failed to close pipe to '%s'"), $prefix, $cmd);
return @addresses;
}
@@ -2088,10 +2134,21 @@ sub validate_patch {
chdir($repo->wc_path() or $repo->repo_path())
or die("chdir: $!");
local $ENV{"GIT_DIR"} = $repo->repo_path();
+
+ my ($recipients_ref, $to, $date, $gitversion, $cc, $ccline, $header) = gen_header();
+
+ require File::Temp;
+ my ($header_filehandle, $header_filename) = File::Temp::tempfile(
+ TEMPLATE => ".gitsendemail.header.XXXXXX",
+ DIR => $repo->repo_path(),
+ UNLINK => 1,
+ );
+ print $header_filehandle $header;
+
my @cmd = ("git", "hook", "run", "--ignore-missing",
$hook_name, "--");
- my @cmd_msg = (@cmd, "<patch>");
- my @cmd_run = (@cmd, $target);
+ my @cmd_msg = (@cmd, "<patch>", "<header>");
+ my @cmd_run = (@cmd, $target, $header_filename);
$hook_error = system_or_msg(\@cmd_run, undef, "@cmd_msg");
chdir($cwd_save) or die("chdir: $!");
}
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index d92df37..ce273fe 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -57,15 +57,6 @@ die_with_status () {
exit "$status"
}
-GIT_QUIET=
-
-say () {
- if test -z "$GIT_QUIET"
- then
- printf '%s\n' "$*"
- fi
-}
-
if test -n "$OPTIONS_SPEC"; then
usage() {
"$0" -h
@@ -285,13 +276,6 @@ get_author_ident_from_commit () {
parse_ident_from_commit author AUTHOR
}
-# Clear repo-local GIT_* environment variables. Useful when switching to
-# another repository (e.g. when entering a submodule). See also the env
-# list in git_connect()
-clear_local_git_env() {
- unset $(git rev-parse --local-env-vars)
-}
-
# Generate a virtual base file for a two-file merge. Uses git apply to
# remove lines from $1 that are not in $2, leaving only common lines.
create_virtual_base() {
diff --git a/git-submodule.sh b/git-submodule.sh
index fd0b4a2..7f9582d 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -30,6 +30,7 @@ GIT_PROTOCOL_FROM_USER=0
export GIT_PROTOCOL_FROM_USER
command=
+quiet=
branch=
force=
reference=
@@ -40,8 +41,9 @@ require_init=
files=
remote=
nofetch=
-update=
-prefix=
+rebase=
+merge=
+checkout=
custom_name=
depth=
progress=
@@ -56,17 +58,6 @@ isnumber()
n=$(($1 + 0)) 2>/dev/null && test "$n" = "$1"
}
-# Sanitize the local git environment for use within a submodule. We
-# can't simply use clear_local_git_env since we want to preserve some
-# of the settings from GIT_CONFIG_PARAMETERS.
-sanitize_submodule_env()
-{
- save_config=$GIT_CONFIG_PARAMETERS
- clear_local_git_env
- GIT_CONFIG_PARAMETERS=$save_config
- export GIT_CONFIG_PARAMETERS
-}
-
#
# Add a new submodule to the working tree, .gitmodules and the index
#
@@ -90,7 +81,7 @@ cmd_add()
force=$1
;;
-q|--quiet)
- GIT_QUIET=1
+ quiet=1
;;
--progress)
progress=1
@@ -138,7 +129,7 @@ cmd_add()
usage
fi
- git ${wt_prefix:+-C "$wt_prefix"} ${prefix:+--super-prefix "$prefix"} submodule--helper add ${GIT_QUIET:+--quiet} ${force:+--force} ${progress:+"--progress"} ${branch:+--branch "$branch"} ${reference_path:+--reference "$reference_path"} ${dissociate:+--dissociate} ${custom_name:+--name "$custom_name"} ${depth:+"$depth"} -- "$@"
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper add ${quiet:+--quiet} ${force:+--force} ${progress:+"--progress"} ${branch:+--branch "$branch"} ${reference_path:+--reference "$reference_path"} ${dissociate:+--dissociate} ${custom_name:+--name "$custom_name"} ${depth:+"$depth"} -- "$@"
}
#
@@ -154,7 +145,7 @@ cmd_foreach()
do
case "$1" in
-q|--quiet)
- GIT_QUIET=1
+ quiet=1
;;
--recursive)
recursive=1
@@ -169,7 +160,7 @@ cmd_foreach()
shift
done
- git ${wt_prefix:+-C "$wt_prefix"} submodule--helper foreach ${GIT_QUIET:+--quiet} ${recursive:+--recursive} -- "$@"
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper foreach ${quiet:+--quiet} ${recursive:+--recursive} -- "$@"
}
#
@@ -184,7 +175,7 @@ cmd_init()
do
case "$1" in
-q|--quiet)
- GIT_QUIET=1
+ quiet=1
;;
--)
shift
@@ -200,7 +191,7 @@ cmd_init()
shift
done
- git ${wt_prefix:+-C "$wt_prefix"} ${prefix:+--super-prefix "$prefix"} submodule--helper init ${GIT_QUIET:+--quiet} -- "$@"
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper init ${quiet:+--quiet} -- "$@"
}
#
@@ -217,7 +208,7 @@ cmd_deinit()
force=$1
;;
-q|--quiet)
- GIT_QUIET=1
+ quiet=1
;;
--all)
deinit_all=t
@@ -236,7 +227,7 @@ cmd_deinit()
shift
done
- git ${wt_prefix:+-C "$wt_prefix"} submodule--helper deinit ${GIT_QUIET:+--quiet} ${force:+--force} ${deinit_all:+--all} -- "$@"
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper deinit ${quiet:+--quiet} ${force:+--force} ${deinit_all:+--all} -- "$@"
}
#
@@ -251,10 +242,10 @@ cmd_update()
do
case "$1" in
-q|--quiet)
- GIT_QUIET=1
+ quiet=1
;;
- -v)
- unset GIT_QUIET
+ -v|--verbose)
+ quiet=0
;;
--progress)
progress=1
@@ -263,7 +254,6 @@ cmd_update()
init=1
;;
--require-init)
- init=1
require_init=1
;;
--remote)
@@ -276,7 +266,7 @@ cmd_update()
force=$1
;;
-r|--rebase)
- update="rebase"
+ rebase=1
;;
--reference)
case "$2" in '') usage ;; esac
@@ -290,13 +280,13 @@ cmd_update()
dissociate=1
;;
-m|--merge)
- update="merge"
+ merge=1
;;
--recursive)
recursive=1
;;
--checkout)
- update="checkout"
+ checkout=1
;;
--recommend-shallow)
recommend_shallow="--recommend-shallow"
@@ -349,16 +339,16 @@ cmd_update()
done
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper update \
- ${GIT_QUIET:+--quiet} \
+ ${quiet:+--quiet} \
${force:+--force} \
${progress:+"--progress"} \
${remote:+--remote} \
${recursive:+--recursive} \
${init:+--init} \
${nofetch:+--no-fetch} \
- ${wt_prefix:+--prefix "$wt_prefix"} \
- ${prefix:+--recursive-prefix "$prefix"} \
- ${update:+--update "$update"} \
+ ${rebase:+--rebase} \
+ ${merge:+--merge} \
+ ${checkout:+--checkout} \
${reference:+"$reference"} \
${dissociate:+"--dissociate"} \
${depth:+"$depth"} \
@@ -409,7 +399,7 @@ cmd_set_branch() {
shift
done
- git ${wt_prefix:+-C "$wt_prefix"} submodule--helper set-branch ${GIT_QUIET:+--quiet} ${branch:+--branch "$branch"} ${default:+--default} -- "$@"
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper set-branch ${quiet:+--quiet} ${branch:+--branch "$branch"} ${default:+--default} -- "$@"
}
#
@@ -422,7 +412,7 @@ cmd_set_url() {
do
case "$1" in
-q|--quiet)
- GIT_QUIET=1
+ quiet=1
;;
--)
shift
@@ -438,7 +428,7 @@ cmd_set_url() {
shift
done
- git ${wt_prefix:+-C "$wt_prefix"} submodule--helper set-url ${GIT_QUIET:+--quiet} -- "$@"
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper set-url ${quiet:+--quiet} -- "$@"
}
#
@@ -459,7 +449,7 @@ cmd_summary() {
do
case "$1" in
--cached)
- cached="$1"
+ cached=1
;;
--files)
files="$1"
@@ -509,7 +499,7 @@ cmd_status()
do
case "$1" in
-q|--quiet)
- GIT_QUIET=1
+ quiet=1
;;
--cached)
cached=1
@@ -531,7 +521,7 @@ cmd_status()
shift
done
- git ${wt_prefix:+-C "$wt_prefix"} submodule--helper status ${GIT_QUIET:+--quiet} ${cached:+--cached} ${recursive:+--recursive} -- "$@"
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper status ${quiet:+--quiet} ${cached:+--cached} ${recursive:+--recursive} -- "$@"
}
#
# Sync remote urls for submodules
@@ -544,7 +534,7 @@ cmd_sync()
do
case "$1" in
-q|--quiet)
- GIT_QUIET=1
+ quiet=1
shift
;;
--recursive)
@@ -564,12 +554,12 @@ cmd_sync()
esac
done
- git ${wt_prefix:+-C "$wt_prefix"} submodule--helper sync ${GIT_QUIET:+--quiet} ${recursive:+--recursive} -- "$@"
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper sync ${quiet:+--quiet} ${recursive:+--recursive} -- "$@"
}
cmd_absorbgitdirs()
{
- git submodule--helper absorb-git-dirs --prefix "$wt_prefix" "$@"
+ git ${wt_prefix:+-C "$wt_prefix"} submodule--helper absorbgitdirs "$@"
}
# This loop parses the command line arguments to find the
@@ -585,18 +575,10 @@ do
command=$1
;;
-q|--quiet)
- GIT_QUIET=1
- ;;
- -b|--branch)
- case "$2" in
- '')
- usage
- ;;
- esac
- branch="$2"; shift
+ quiet=1
;;
--cached)
- cached="$1"
+ cached=1
;;
--)
break
@@ -622,12 +604,6 @@ then
fi
fi
-# "-b branch" is accepted only by "add" and "set-branch"
-if test -n "$branch" && (test "$command" != add || test "$command" != set-branch)
-then
- usage
-fi
-
# "--cached" is accepted only by "status" and "summary"
if test -n "$cached" && test "$command" != status && test "$command" != summary
then
diff --git a/git-svn.perl b/git-svn.perl
index be987e3..b0d0a50 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# Copyright (C) 2006, Eric Wong <normalperson@yhbt.net>
# License: GPL v2 or later
-use 5.008;
+use 5.008001;
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use strict;
use vars qw/ $AUTHOR $VERSION
@@ -297,28 +297,12 @@ my %cmd = (
{} ],
);
-package FakeTerm;
-sub new {
- my ($class, $reason) = @_;
- return bless \$reason, shift;
-}
-sub readline {
- my $self = shift;
- die "Cannot use readline on FakeTerm: $$self";
-}
-package main;
-
my $term;
sub term_init {
- $term = eval {
- require Term::ReadLine;
- $ENV{"GIT_SVN_NOTTY"}
+ require Term::ReadLine;
+ $term = $ENV{"GIT_SVN_NOTTY"}
? new Term::ReadLine 'git-svn', \*STDIN, \*STDOUT
: new Term::ReadLine 'git-svn';
- };
- if ($@) {
- $term = new FakeTerm "$@: going non-interactive";
- }
}
my $cmd;
diff --git a/zlib.c b/git-zlib.c
index d594cba..d43bbeb 100644
--- a/zlib.c
+++ b/git-zlib.c
@@ -2,7 +2,8 @@
* zlib wrappers to make sure we don't silently miss errors
* at init time.
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "git-zlib.h"
static const char *zerr_to_string(int status)
{
diff --git a/git-zlib.h b/git-zlib.h
new file mode 100644
index 0000000..d8a670a
--- /dev/null
+++ b/git-zlib.h
@@ -0,0 +1,28 @@
+#ifndef GIT_ZLIB_H
+#define GIT_ZLIB_H
+
+typedef struct git_zstream {
+ z_stream z;
+ unsigned long avail_in;
+ unsigned long avail_out;
+ unsigned long total_in;
+ unsigned long total_out;
+ unsigned char *next_in;
+ unsigned char *next_out;
+} git_zstream;
+
+void git_inflate_init(git_zstream *);
+void git_inflate_init_gzip_only(git_zstream *);
+void git_inflate_end(git_zstream *);
+int git_inflate(git_zstream *, int flush);
+
+void git_deflate_init(git_zstream *, int level);
+void git_deflate_init_gzip(git_zstream *, int level);
+void git_deflate_init_raw(git_zstream *, int level);
+void git_deflate_end(git_zstream *);
+int git_deflate_abort(git_zstream *);
+int git_deflate_end_gently(git_zstream *);
+int git_deflate(git_zstream *, int flush);
+unsigned long git_deflate_bound(git_zstream *, unsigned long);
+
+#endif /* GIT_ZLIB_H */
diff --git a/git.c b/git.c
index d7a7a82..654d615 100644
--- a/git.c
+++ b/git.c
@@ -1,10 +1,20 @@
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "exec-cmd.h"
+#include "gettext.h"
#include "help.h"
+#include "object-file.h"
+#include "pager.h"
+#include "read-cache-ll.h"
#include "run-command.h"
#include "alias.h"
+#include "replace-object.h"
+#include "setup.h"
+#include "attr.h"
#include "shallow.h"
+#include "trace.h"
+#include "trace2.h"
#define RUN_SETUP (1<<0)
#define RUN_SETUP_GENTLY (1<<1)
@@ -14,9 +24,8 @@
* RUN_SETUP for reading from the configuration file.
*/
#define NEED_WORK_TREE (1<<3)
-#define SUPPORT_SUPER_PREFIX (1<<4)
-#define DELAY_PAGER_CONFIG (1<<5)
-#define NO_PARSEOPT (1<<6) /* parse-options is not used */
+#define DELAY_PAGER_CONFIG (1<<4)
+#define NO_PARSEOPT (1<<5) /* parse-options is not used */
struct cmd_struct {
const char *cmd;
@@ -29,8 +38,7 @@ const char git_usage_string[] =
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
- " [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
- " <command> [<args>]");
+ " [--config-env=<name>=<envvar>] <command> [<args>]");
const char git_more_info_string[] =
N_("'git help -a' and 'git help -g' list available subcommands and some\n"
@@ -179,8 +187,13 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
use_pager = 0;
if (envchanged)
*envchanged = 1;
+ } else if (!strcmp(cmd, "--no-lazy-fetch")) {
+ fetch_if_missing = 0;
+ setenv(NO_LAZY_FETCH_ENVIRONMENT, "1", 1);
+ if (envchanged)
+ *envchanged = 1;
} else if (!strcmp(cmd, "--no-replace-objects")) {
- read_replace_refs = 0;
+ disable_replace_refs();
setenv(NO_REPLACE_OBJECTS_ENVIRONMENT, "1", 1);
if (envchanged)
*envchanged = 1;
@@ -226,20 +239,6 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
setenv(GIT_WORK_TREE_ENVIRONMENT, cmd, 1);
if (envchanged)
*envchanged = 1;
- } else if (!strcmp(cmd, "--super-prefix")) {
- if (*argc < 2) {
- fprintf(stderr, _("no prefix given for --super-prefix\n" ));
- usage(git_usage_string);
- }
- setenv(GIT_SUPER_PREFIX_ENVIRONMENT, (*argv)[1], 1);
- if (envchanged)
- *envchanged = 1;
- (*argv)++;
- (*argc)--;
- } else if (skip_prefix(cmd, "--super-prefix=", &cmd)) {
- setenv(GIT_SUPER_PREFIX_ENVIRONMENT, cmd, 1);
- if (envchanged)
- *envchanged = 1;
} else if (!strcmp(cmd, "--bare")) {
char *cwd = xgetcwd();
is_bare_repository_cfg = 1;
@@ -323,6 +322,21 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
} else {
exit(list_cmds(cmd));
}
+ } else if (!strcmp(cmd, "--attr-source")) {
+ if (*argc < 2) {
+ fprintf(stderr, _("no attribute source given for --attr-source\n" ));
+ usage(git_usage_string);
+ }
+ setenv(GIT_ATTR_SOURCE_ENVIRONMENT, (*argv)[1], 1);
+ if (envchanged)
+ *envchanged = 1;
+ (*argv)++;
+ (*argc)--;
+ } else if (skip_prefix(cmd, "--attr-source=", &cmd)) {
+ set_git_attr_source(cmd);
+ setenv(GIT_ATTR_SOURCE_ENVIRONMENT, cmd, 1);
+ if (envchanged)
+ *envchanged = 1;
} else {
fprintf(stderr, _("unknown option: %s\n"), cmd);
usage(git_usage_string);
@@ -365,8 +379,6 @@ static int handle_alias(int *argcp, const char ***argv)
strvec_pushv(&child.args, (*argv) + 1);
trace2_cmd_alias(alias_command, child.args.v);
- trace2_cmd_list_config();
- trace2_cmd_list_env_vars();
trace2_cmd_name("_run_shell_alias_");
ret = run_command(&child);
@@ -403,8 +415,6 @@ static int handle_alias(int *argcp, const char ***argv)
COPY_ARRAY(new_argv + count, *argv + 1, *argcp);
trace2_cmd_alias(alias_command, new_argv);
- trace2_cmd_list_config();
- trace2_cmd_list_env_vars();
*argv = new_argv;
*argcp += count - 1;
@@ -446,21 +456,14 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
use_pager = 1;
if (run_setup && startup_info->have_repository)
/* get_git_dir() may set up repo, avoid that */
- trace_repo_setup(prefix);
+ trace_repo_setup();
commit_pager_choice();
- if (!help && get_super_prefix()) {
- if (!(p->option & SUPPORT_SUPER_PREFIX))
- die(_("%s doesn't support --super-prefix"), p->cmd);
- }
-
if (!help && p->option & NEED_WORK_TREE)
setup_work_tree();
trace_argv_printf(argv, "trace: built-in: git");
trace2_cmd_name(p->cmd);
- trace2_cmd_list_config();
- trace2_cmd_list_env_vars();
validate_cache_entries(the_repository->index);
status = p->fn(argc, argv, prefix);
@@ -489,14 +492,14 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
static struct cmd_struct commands[] = {
{ "add", cmd_add, RUN_SETUP | NEED_WORK_TREE },
{ "am", cmd_am, RUN_SETUP | NEED_WORK_TREE },
- { "annotate", cmd_annotate, RUN_SETUP | NO_PARSEOPT },
+ { "annotate", cmd_annotate, RUN_SETUP },
{ "apply", cmd_apply, RUN_SETUP_GENTLY },
{ "archive", cmd_archive, RUN_SETUP_GENTLY },
- { "bisect--helper", cmd_bisect__helper, RUN_SETUP },
+ { "bisect", cmd_bisect, RUN_SETUP },
{ "blame", cmd_blame, RUN_SETUP },
{ "branch", cmd_branch, RUN_SETUP | DELAY_PAGER_CONFIG },
{ "bugreport", cmd_bugreport, RUN_SETUP_GENTLY },
- { "bundle", cmd_bundle, RUN_SETUP_GENTLY | NO_PARSEOPT },
+ { "bundle", cmd_bundle, RUN_SETUP_GENTLY },
{ "cat-file", cmd_cat_file, RUN_SETUP },
{ "check-attr", cmd_check_attr, RUN_SETUP },
{ "check-ignore", cmd_check_ignore, RUN_SETUP | NEED_WORK_TREE },
@@ -504,7 +507,7 @@ static struct cmd_struct commands[] = {
{ "check-ref-format", cmd_check_ref_format, NO_PARSEOPT },
{ "checkout", cmd_checkout, RUN_SETUP | NEED_WORK_TREE },
{ "checkout--worker", cmd_checkout__worker,
- RUN_SETUP | NEED_WORK_TREE | SUPPORT_SUPER_PREFIX },
+ RUN_SETUP | NEED_WORK_TREE },
{ "checkout-index", cmd_checkout_index,
RUN_SETUP | NEED_WORK_TREE},
{ "cherry", cmd_cherry, RUN_SETUP },
@@ -514,7 +517,7 @@ static struct cmd_struct commands[] = {
{ "column", cmd_column, RUN_SETUP_GENTLY },
{ "commit", cmd_commit, RUN_SETUP | NEED_WORK_TREE },
{ "commit-graph", cmd_commit_graph, RUN_SETUP },
- { "commit-tree", cmd_commit_tree, RUN_SETUP | NO_PARSEOPT },
+ { "commit-tree", cmd_commit_tree, RUN_SETUP },
{ "config", cmd_config, RUN_SETUP_GENTLY | DELAY_PAGER_CONFIG },
{ "count-objects", cmd_count_objects, RUN_SETUP },
{ "credential", cmd_credential, RUN_SETUP_GENTLY | NO_PARSEOPT },
@@ -522,12 +525,12 @@ static struct cmd_struct commands[] = {
{ "credential-cache--daemon", cmd_credential_cache_daemon },
{ "credential-store", cmd_credential_store },
{ "describe", cmd_describe, RUN_SETUP },
+ { "diagnose", cmd_diagnose, RUN_SETUP_GENTLY },
{ "diff", cmd_diff, NO_PARSEOPT },
{ "diff-files", cmd_diff_files, RUN_SETUP | NEED_WORK_TREE | NO_PARSEOPT },
{ "diff-index", cmd_diff_index, RUN_SETUP | NO_PARSEOPT },
{ "diff-tree", cmd_diff_tree, RUN_SETUP | NO_PARSEOPT },
{ "difftool", cmd_difftool, RUN_SETUP_GENTLY },
- { "env--helper", cmd_env__helper },
{ "fast-export", cmd_fast_export, RUN_SETUP },
{ "fast-import", cmd_fast_import, RUN_SETUP | NO_PARSEOPT },
{ "fetch", cmd_fetch, RUN_SETUP },
@@ -538,7 +541,7 @@ static struct cmd_struct commands[] = {
{ "format-patch", cmd_format_patch, RUN_SETUP },
{ "fsck", cmd_fsck, RUN_SETUP },
{ "fsck-objects", cmd_fsck, RUN_SETUP },
- { "fsmonitor--daemon", cmd_fsmonitor__daemon, SUPPORT_SUPER_PREFIX | RUN_SETUP },
+ { "fsmonitor--daemon", cmd_fsmonitor__daemon, RUN_SETUP },
{ "gc", cmd_gc, RUN_SETUP },
{ "get-tar-commit-id", cmd_get_tar_commit_id, NO_PARSEOPT },
{ "grep", cmd_grep, RUN_SETUP_GENTLY },
@@ -553,9 +556,9 @@ static struct cmd_struct commands[] = {
{ "ls-files", cmd_ls_files, RUN_SETUP },
{ "ls-remote", cmd_ls_remote, RUN_SETUP_GENTLY },
{ "ls-tree", cmd_ls_tree, RUN_SETUP },
- { "mailinfo", cmd_mailinfo, RUN_SETUP_GENTLY | NO_PARSEOPT },
+ { "mailinfo", cmd_mailinfo, RUN_SETUP_GENTLY },
{ "mailsplit", cmd_mailsplit, NO_PARSEOPT },
- { "maintenance", cmd_maintenance, RUN_SETUP | NO_PARSEOPT },
+ { "maintenance", cmd_maintenance, RUN_SETUP },
{ "merge", cmd_merge, RUN_SETUP | NEED_WORK_TREE },
{ "merge-base", cmd_merge_base, RUN_SETUP },
{ "merge-file", cmd_merge_file, RUN_SETUP_GENTLY },
@@ -565,8 +568,8 @@ static struct cmd_struct commands[] = {
{ "merge-recursive-ours", cmd_merge_recursive, RUN_SETUP | NEED_WORK_TREE | NO_PARSEOPT },
{ "merge-recursive-theirs", cmd_merge_recursive, RUN_SETUP | NEED_WORK_TREE | NO_PARSEOPT },
{ "merge-subtree", cmd_merge_recursive, RUN_SETUP | NEED_WORK_TREE | NO_PARSEOPT },
- { "merge-tree", cmd_merge_tree, RUN_SETUP | NO_PARSEOPT },
- { "mktag", cmd_mktag, RUN_SETUP | NO_PARSEOPT },
+ { "merge-tree", cmd_merge_tree, RUN_SETUP },
+ { "mktag", cmd_mktag, RUN_SETUP },
{ "mktree", cmd_mktree, RUN_SETUP },
{ "multi-pack-index", cmd_multi_pack_index, RUN_SETUP },
{ "mv", cmd_mv, RUN_SETUP | NEED_WORK_TREE },
@@ -582,7 +585,7 @@ static struct cmd_struct commands[] = {
{ "pull", cmd_pull, RUN_SETUP | NEED_WORK_TREE },
{ "push", cmd_push, RUN_SETUP },
{ "range-diff", cmd_range_diff, RUN_SETUP | USE_PAGER },
- { "read-tree", cmd_read_tree, RUN_SETUP | SUPPORT_SUPER_PREFIX},
+ { "read-tree", cmd_read_tree, RUN_SETUP },
{ "rebase", cmd_rebase, RUN_SETUP | NEED_WORK_TREE },
{ "receive-pack", cmd_receive_pack },
{ "reflog", cmd_reflog, RUN_SETUP },
@@ -591,6 +594,7 @@ static struct cmd_struct commands[] = {
{ "remote-fd", cmd_remote_fd, NO_PARSEOPT },
{ "repack", cmd_repack, RUN_SETUP },
{ "replace", cmd_replace, RUN_SETUP },
+ { "replay", cmd_replay, RUN_SETUP },
{ "rerere", cmd_rerere, RUN_SETUP },
{ "reset", cmd_reset, RUN_SETUP },
{ "restore", cmd_restore, RUN_SETUP | NEED_WORK_TREE },
@@ -604,12 +608,12 @@ static struct cmd_struct commands[] = {
{ "show-branch", cmd_show_branch, RUN_SETUP },
{ "show-index", cmd_show_index, RUN_SETUP_GENTLY },
{ "show-ref", cmd_show_ref, RUN_SETUP },
- { "sparse-checkout", cmd_sparse_checkout, RUN_SETUP | NEED_WORK_TREE },
+ { "sparse-checkout", cmd_sparse_checkout, RUN_SETUP },
{ "stage", cmd_add, RUN_SETUP | NEED_WORK_TREE },
{ "stash", cmd_stash, RUN_SETUP | NEED_WORK_TREE },
{ "status", cmd_status, RUN_SETUP | NEED_WORK_TREE },
{ "stripspace", cmd_stripspace },
- { "submodule--helper", cmd_submodule__helper, RUN_SETUP | SUPPORT_SUPER_PREFIX | NO_PARSEOPT },
+ { "submodule--helper", cmd_submodule__helper, RUN_SETUP },
{ "switch", cmd_switch, RUN_SETUP | NEED_WORK_TREE },
{ "symbolic-ref", cmd_symbolic_ref, RUN_SETUP },
{ "tag", cmd_tag, RUN_SETUP | DELAY_PAGER_CONFIG },
@@ -627,7 +631,7 @@ static struct cmd_struct commands[] = {
{ "verify-tag", cmd_verify_tag, RUN_SETUP },
{ "version", cmd_version },
{ "whatchanged", cmd_whatchanged, RUN_SETUP },
- { "worktree", cmd_worktree, RUN_SETUP | NO_PARSEOPT },
+ { "worktree", cmd_worktree, RUN_SETUP },
{ "write-tree", cmd_write_tree, RUN_SETUP },
};
@@ -726,9 +730,6 @@ static void execv_dashed_external(const char **argv)
struct child_process cmd = CHILD_PROCESS_INIT;
int status;
- if (get_super_prefix())
- die(_("%s doesn't support --super-prefix"), argv[0]);
-
if (use_pager == -1 && !is_builtin(argv[0]))
use_pager = check_pager_config(argv[0]);
commit_pager_choice();
@@ -786,7 +787,7 @@ static int run_argv(int *argcp, const char ***argv)
if (!done_alias)
handle_builtin(*argcp, *argv);
else if (get_builtin(**argv)) {
- struct strvec args = STRVEC_INIT;
+ struct child_process cmd = CHILD_PROCESS_INIT;
int i;
/*
@@ -798,23 +799,23 @@ static int run_argv(int *argcp, const char ***argv)
*/
trace2_cmd_name("_run_git_alias_");
- if (get_super_prefix())
- die("%s doesn't support --super-prefix", **argv);
-
commit_pager_choice();
- strvec_push(&args, "git");
+ strvec_push(&cmd.args, "git");
for (i = 0; i < *argcp; i++)
- strvec_push(&args, (*argv)[i]);
+ strvec_push(&cmd.args, (*argv)[i]);
- trace_argv_printf(args.v, "trace: exec:");
+ trace_argv_printf(cmd.args.v, "trace: exec:");
/*
* if we fail because the command is not found, it is
* OK to return. Otherwise, we just pass along the status code.
*/
- i = run_command_v_opt_tr2(args.v, RUN_SILENT_EXEC_FAILURE |
- RUN_CLEAN_ON_EXIT | RUN_WAIT_AFTER_CLEAN, "git_alias");
+ cmd.silent_exec_failure = 1;
+ 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);
die("could not execute builtin %s", **argv);
@@ -893,12 +894,8 @@ int cmd_main(int argc, const char **argv)
argv++;
argc--;
handle_options(&argv, &argc, NULL);
- if (argc > 0) {
- if (!strcmp("--version", argv[0]) || !strcmp("-v", argv[0]))
- argv[0] = "version";
- else if (!strcmp("--help", argv[0]) || !strcmp("-h", argv[0]))
- argv[0] = "help";
- } else {
+
+ if (!argc) {
/* The user didn't specify a command; give them help */
commit_pager_choice();
printf(_("usage: %s\n\n"), git_usage_string);
@@ -906,6 +903,12 @@ int cmd_main(int argc, const char **argv)
printf("\n%s\n", _(git_more_info_string));
exit(1);
}
+
+ if (!strcmp("--version", argv[0]) || !strcmp("-v", argv[0]))
+ argv[0] = "version";
+ else if (!strcmp("--help", argv[0]) || !strcmp("-h", argv[0]))
+ argv[0] = "help";
+
cmd = argv[0];
/*
diff --git a/gitk-git/Makefile b/gitk-git/Makefile
index 5bdd52a..e1f0aff 100644
--- a/gitk-git/Makefile
+++ b/gitk-git/Makefile
@@ -33,9 +33,9 @@ ifdef NO_MSGFMT
MSGFMT ?= $(TCL_PATH) po/po2msg.sh
else
MSGFMT ?= msgfmt
- ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0)
+ ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0)
MSGFMT := $(TCL_PATH) po/po2msg.sh
- endif
+ endif
endif
PO_TEMPLATE = po/gitk.pot
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 0ae7d68..7a087f1 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -353,6 +353,16 @@ proc parseviewrevs {view revs} {
return $ret
}
+# Escapes a list of filter paths to be passed to git log via stdin. Note that
+# paths must not be quoted.
+proc escape_filter_paths {paths} {
+ set escaped [list]
+ foreach path $paths {
+ lappend escaped [string map {\\ \\\\ "\ " "\\\ "} $path]
+ }
+ return $escaped
+}
+
# Start off a git log process and arrange to read its output
proc start_rev_list {view} {
global startmsecs commitidx viewcomplete curview
@@ -405,14 +415,17 @@ proc start_rev_list {view} {
if {$revs eq {}} {
return 0
}
- set args [concat $vflags($view) $revs]
+ set args $vflags($view)
} else {
+ set revs {}
set args $vorigargs($view)
}
if {[catch {
set fd [open [concat | git log --no-color -z --pretty=raw $show_notes \
- --parents --boundary $args "--" $files] r]
+ --parents --boundary $args --stdin \
+ "<<[join [concat $revs "--" \
+ [escape_filter_paths $files]] "\\n"]"] r]
} err]} {
error_popup "[mc "Error executing git log:"] $err"
return 0
@@ -554,13 +567,20 @@ proc updatecommits {} {
set revs $newrevs
set vposids($view) [lsort -unique [concat $oldpos $vposids($view)]]
}
- set args [concat $vflags($view) $revs --not $oldpos]
+ set args $vflags($view)
+ foreach r $oldpos {
+ lappend revs "^$r"
+ }
} else {
+ set revs {}
set args $vorigargs($view)
}
if {[catch {
set fd [open [concat | git log --no-color -z --pretty=raw $show_notes \
- --parents --boundary $args "--" $vfilelimit($view)] r]
+ --parents --boundary $args --stdin \
+ "<<[join [concat $revs "--" \
+ [escape_filter_paths \
+ $vfilelimit($view)]] "\\n"]"] r]
} err]} {
error_popup "[mc "Error executing git log:"] $err"
return
@@ -10231,10 +10251,16 @@ proc getallcommits {} {
foreach id $seeds {
lappend ids "^$id"
}
+ lappend ids "--"
}
}
if {$ids ne {}} {
- set fd [open [concat $cmd $ids] r]
+ if {$ids eq "--all"} {
+ set cmd [concat $cmd "--all"]
+ } else {
+ set cmd [concat $cmd --stdin "<<[join $ids "\\n"]"]
+ }
+ set fd [open $cmd r]
fconfigure $fd -blocking 0
incr allcommits
nowbusy allcommits
@@ -11930,7 +11956,7 @@ proc formatdate {d} {
}
# This list of encoding names and aliases is distilled from
-# http://www.iana.org/assignments/character-sets.
+# https://www.iana.org/assignments/character-sets.
# Not all of them are supported by Tcl.
set encoding_aliases {
{ ANSI_X3.4-1968 iso-ir-6 ANSI_X3.4-1986 ISO_646.irv:1991 ASCII
@@ -12446,7 +12472,7 @@ if {[tk windowingsystem] eq "aqua"} {
catch {
# follow the XDG base directory specification by default. See
- # http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+ # https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
if {[info exists env(XDG_CONFIG_HOME)] && $env(XDG_CONFIG_HOME) ne ""} {
# XDG_CONFIG_HOME environment variable is set
set config_file [file join $env(XDG_CONFIG_HOME) git gitk]
diff --git a/gitweb/INSTALL b/gitweb/INSTALL
index a58e6b3..5bfa496 100644
--- a/gitweb/INSTALL
+++ b/gitweb/INSTALL
@@ -29,7 +29,7 @@ Requirements
------------
- Core git tools
- - Perl 5.8
+ - Perl 5.8.1
- Perl modules: CGI, Encode, Fcntl, File::Find, File::Basename.
- web server
@@ -203,7 +203,7 @@ You can specify the following configuration variables when building GIT:
created. [Default: /etc/gitweb.conf]
* HIGHLIGHT_BIN
Path to the highlight executable to use (must be the one from
- http://www.andre-simon.de due to assumptions about parameters and output).
+ 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]
diff --git a/gitweb/Makefile b/gitweb/Makefile
index f13e23c..3b68ab2 100644
--- a/gitweb/Makefile
+++ b/gitweb/Makefile
@@ -1,8 +1,8 @@
-# The default target of this Makefile is...
-all::
+ifndef MAK_DIR_GITWEB
+$(error do not run gitweb/Makefile stand-alone anymore. The "gitweb" and \
+"install-gitweb" targets now live in the top-level Makefile)
+endif
-# Define V=1 to have a more verbose compile.
-#
# Define JSMIN to point to JavaScript minifier that functions as
# a filter to have static/gitweb.js minified.
#
@@ -10,13 +10,6 @@ all::
# version of static/gitweb.css
#
-prefix ?= $(HOME)
-bindir ?= $(prefix)/bin
-gitwebdir ?= /var/www/cgi-bin
-
-RM ?= rm -f
-INSTALL ?= install
-
# default configuration for gitweb
GITWEB_CONFIG = gitweb_config.perl
GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf
@@ -30,89 +23,45 @@ GITWEB_STRICT_EXPORT =
GITWEB_BASE_URL =
GITWEB_LIST =
GITWEB_HOMETEXT = indextext.html
-GITWEB_CSS = static/gitweb.css
+GITWEB_CSS_IN = static/gitweb.css
+GITWEB_CSS = $(GITWEB_CSS_IN)
GITWEB_LOGO = static/git-logo.png
GITWEB_FAVICON = static/git-favicon.png
-GITWEB_JS = static/gitweb.js
+GITWEB_JS_IN = static/gitweb.js
+GITWEB_JS = $(GITWEB_JS_IN)
GITWEB_SITE_HTML_HEAD_STRING =
GITWEB_SITE_HEADER =
GITWEB_SITE_FOOTER =
HIGHLIGHT_BIN = highlight
-# include user config
--include ../config.mak.autogen
--include ../config.mak
--include config.mak
-
-# determine version
-../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
- $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE
-
-ifneq ($(MAKECMDGOALS),clean)
--include ../GIT-VERSION-FILE
-endif
-
-### Build rules
-
-SHELL_PATH ?= $(SHELL)
-PERL_PATH ?= /usr/bin/perl
+# What targets we'll add to 'all' for "make gitweb"
+GITWEB_ALL =
+GITWEB_ALL += gitweb.cgi
+GITWEB_ALL += $(GITWEB_JS)
-# Shell quote;
-bindir_SQ = $(subst ','\'',$(bindir))#'
-gitwebdir_SQ = $(subst ','\'',$(gitwebdir))#'
-gitwebstaticdir_SQ = $(subst ','\'',$(gitwebdir)/static)#'
-SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))#'
-PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))#'
-DESTDIR_SQ = $(subst ','\'',$(DESTDIR))#'
-
-# Quiet generation (unless V=1)
-QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
-QUIET_SUBDIR1 =
-
-ifneq ($(findstring $(MAKEFLAGS),w),w)
-PRINT_DIR = --no-print-directory
-else # "make -w"
-NO_SUBDIR = :
-endif
-
-ifneq ($(findstring $(MAKEFLAGS),s),s)
-ifndef V
- QUIET = @
- QUIET_GEN = $(QUIET)echo ' ' GEN $@;
- QUIET_SUBDIR0 = +@subdir=
- QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
- $(MAKE) $(PRINT_DIR) -C $$subdir
- export V
- export QUIET
- export QUIET_GEN
- export QUIET_SUBDIR0
- export QUIET_SUBDIR1
-endif
-endif
-
-all:: gitweb.cgi static/gitweb.js
+MAK_DIR_GITWEB_ALL = $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_ALL))
GITWEB_PROGRAMS = gitweb.cgi
+GITWEB_JS_MIN = static/gitweb.min.js
ifdef JSMIN
-GITWEB_FILES += static/gitweb.min.js
-GITWEB_JS = static/gitweb.min.js
-all:: static/gitweb.min.js
-static/gitweb.min.js: static/gitweb.js GITWEB-BUILD-OPTIONS
+GITWEB_JS = $(GITWEB_JS_MIN)
+GITWEB_ALL += $(MAK_DIR_GITWEB)$(GITWEB_JS_MIN)
+$(MAK_DIR_GITWEB)$(GITWEB_JS_MIN): $(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS
+$(MAK_DIR_GITWEB)$(GITWEB_JS_MIN): $(MAK_DIR_GITWEB)$(GITWEB_JS_IN)
$(QUIET_GEN)$(JSMIN) <$< >$@
-else
-GITWEB_FILES += static/gitweb.js
endif
+GITWEB_FILES += $(GITWEB_JS)
+GITWEB_CSS_MIN = static/gitweb.min.css
ifdef CSSMIN
-GITWEB_FILES += static/gitweb.min.css
-GITWEB_CSS = static/gitweb.min.css
-all:: static/gitweb.min.css
-static/gitweb.min.css: static/gitweb.css GITWEB-BUILD-OPTIONS
+GITWEB_CSS = $(GITWEB_CSS_MIN)
+GITWEB_ALL += $(MAK_DIR_GITWEB)$(GITWEB_CSS_MIN)
+$(MAK_DIR_GITWEB)$(GITWEB_CSS_MIN): $(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS
+$(MAK_DIR_GITWEB)$(GITWEB_CSS_MIN): $(MAK_DIR_GITWEB)$(GITWEB_CSS_IN)
$(QUIET_GEN)$(CSSMIN) <$< >$@
-else
-GITWEB_FILES += static/gitweb.css
endif
+GITWEB_FILES += $(GITWEB_CSS)
GITWEB_FILES += static/git-logo.png static/git-favicon.png
@@ -120,6 +69,7 @@ GITWEB_FILES += static/git-logo.png static/git-favicon.png
#
# js/lib/common-lib.js should be always first, then js/lib/*.js,
# then the rest of files; js/gitweb.js should be last (if it exists)
+GITWEB_JSLIB_FILES =
GITWEB_JSLIB_FILES += static/js/lib/common-lib.js
GITWEB_JSLIB_FILES += static/js/lib/datetime.js
GITWEB_JSLIB_FILES += static/js/lib/cookies.js
@@ -152,46 +102,45 @@ GITWEB_REPLACE = \
-e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \
-e 's|++HIGHLIGHT_BIN++|$(HIGHLIGHT_BIN)|g'
-GITWEB-BUILD-OPTIONS: FORCE
+.PHONY: FORCE
+$(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS: FORCE
@rm -f $@+
@echo "x" '$(PERL_PATH_SQ)' $(GITWEB_REPLACE) "$(JSMIN)|$(CSSMIN)" >$@+
@cmp -s $@+ $@ && rm -f $@+ || mv -f $@+ $@
-gitweb.cgi: gitweb.perl GITWEB-BUILD-OPTIONS
+$(MAK_DIR_GITWEB)gitweb.cgi: $(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS
+$(MAK_DIR_GITWEB)gitweb.cgi: $(MAK_DIR_GITWEB)gitweb.perl
$(QUIET_GEN)$(RM) $@ $@+ && \
sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
$(GITWEB_REPLACE) $< >$@+ && \
chmod +x $@+ && \
mv $@+ $@
-static/gitweb.js: $(GITWEB_JSLIB_FILES)
+$(MAK_DIR_GITWEB)static/gitweb.js: $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_FILES))
$(QUIET_GEN)$(RM) $@ $@+ && \
cat $^ >$@+ && \
mv $@+ $@
-### Testing rules
-
-test:
- $(MAKE) -C ../t gitweb-test
-
-test-installed:
- GITWEB_TEST_INSTALLED='$(DESTDIR_SQ)$(gitwebdir_SQ)' \
- $(MAKE) -C ../t gitweb-test
-
### Installation rules
-install: all
+.PHONY: install-gitweb
+install-gitweb: $(MAK_DIR_GITWEB_ALL)
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitwebdir_SQ)'
- $(INSTALL) -m 755 $(GITWEB_PROGRAMS) '$(DESTDIR_SQ)$(gitwebdir_SQ)'
+ $(INSTALL) -m 755 $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_PROGRAMS)) '$(DESTDIR_SQ)$(gitwebdir_SQ)'
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)'
- $(INSTALL) -m 644 $(GITWEB_FILES) '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)'
+ $(INSTALL) -m 644 $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_FILES)) \
+ '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)'
+ifndef NO_GITWEB
+ifndef NO_PERL
+install: install-gitweb
+endif
+endif
### Cleaning rules
-clean:
- $(RM) gitweb.cgi static/gitweb.js \
- static/gitweb.min.js static/gitweb.min.css \
- GITWEB-BUILD-OPTIONS
-
-.PHONY: all clean install test test-installed .FORCE-GIT-VERSION-FILE FORCE
-
+.PHONY: gitweb-clean
+gitweb-clean:
+ $(RM) $(addprefix $(MAK_DIR_GITWEB),gitweb.cgi $(GITWEB_JS_IN) \
+ $(GITWEB_JS_MIN) $(GITWEB_CSS_MIN) \
+ GITWEB-BUILD-OPTIONS)
+clean: gitweb-clean
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 1835487..ccd14e0 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -7,7 +7,7 @@
#
# This program is licensed under the GPLv2
-use 5.008;
+use 5.008001;
use strict;
use warnings;
# handle ACL in file access tests
@@ -122,9 +122,9 @@ our $favicon = "++GITWEB_FAVICON++";
our $javascript = "++GITWEB_JS++";
# URI and label (title) of GIT logo link
-#our $logo_url = "http://www.kernel.org/pub/software/scm/git/docs/";
+#our $logo_url = "https://www.kernel.org/pub/software/scm/git/docs/";
#our $logo_label = "git documentation";
-our $logo_url = "http://git-scm.com/";
+our $logo_url = "https://git-scm.com/";
our $logo_label = "git homepage";
# source of projects list
@@ -197,7 +197,7 @@ our @diff_opts = ('-M'); # taken from git_commit
our $prevent_xss = 0;
# Path to the highlight executable to use (must be the one from
-# http://www.andre-simon.de due to assumptions about parameters and output).
+# 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++";
@@ -269,7 +269,7 @@ our %avatar_size = (
# Leave it undefined (or set to 'undef') to turn off load checking.
our $maxload = 300;
-# configuration for 'highlight' (http://www.andre-simon.de/)
+# configuration for 'highlight' (http://andre-simon.de/doku/highlight/en/highlight.php)
# match by basename
our %highlight_basename = (
#'Program' => 'py',
@@ -728,9 +728,11 @@ our $per_request_config = 1;
sub read_config_file {
my $filename = shift;
return unless defined $filename;
- # die if there are errors parsing config file
if (-e $filename) {
do $filename;
+ # die if there is a problem accessing the file
+ die $! if $!;
+ # die if there are errors parsing config file
die $@ if $@;
return 1;
}
@@ -3560,23 +3562,6 @@ sub parse_commit_text {
$title =~ s/^ //;
if ($title ne "") {
$co{'title'} = chop_str($title, 80, 5);
- # remove leading stuff of merges to make the interesting part visible
- if (length($title) > 50) {
- $title =~ s/^Automatic //;
- $title =~ s/^merge (of|with) /Merge ... /i;
- if (length($title) > 50) {
- $title =~ s/(http|rsync):\/\///;
- }
- if (length($title) > 50) {
- $title =~ s/(master|www|rsync)\.//;
- }
- if (length($title) > 50) {
- $title =~ s/kernel.org:?//;
- }
- if (length($title) > 50) {
- $title =~ s/\/pub\/scm//;
- }
- }
$co{'title_short'} = chop_str($title, 50, 5);
last;
}
@@ -8210,7 +8195,7 @@ sub git_feed {
my $have_blame = gitweb_check_feature('blame');
# Atom: http://www.atomenabled.org/developers/syndication/
- # RSS: http://www.notestips.com/80256B3A007F2692/1/NAMO5P9UPQ
+ # RSS: https://web.archive.org/web/20030729001534/http://www.notestips.com/80256B3A007F2692/1/NAMO5P9UPQ
if ($format ne 'rss' && $format ne 'atom') {
die_error(400, "Unknown web feed format");
}
diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css
index 3212601..48d2e51 100644
--- a/gitweb/static/gitweb.css
+++ b/gitweb/static/gitweb.css
@@ -667,7 +667,7 @@ div.remote {
}
-/* Style definition generated by highlight 2.4.5, http://www.andre-simon.de/ */
+/* Style definition generated by highlight 2.4.5, http://andre-simon.de/doku/highlight/en/highlight.php */
/* Highlighting theme definition: */
diff --git a/gitweb/static/js/lib/common-lib.js b/gitweb/static/js/lib/common-lib.js
index 018bbb7..99e3eb8 100644
--- a/gitweb/static/js/lib/common-lib.js
+++ b/gitweb/static/js/lib/common-lib.js
@@ -123,8 +123,8 @@ function addCssRule(selector, style) {
* NOTE that there are limits and differences compared to native
* getElementsByClassName as defined by e.g.:
* https://developer.mozilla.org/en/DOM/document.getElementsByClassName
- * http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#dom-getelementsbyclassname
- * http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#dom-document-getelementsbyclassname
+ * https://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#dom-getelementsbyclassname
+ * https://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#dom-document-getelementsbyclassname
*
* Namely, this implementation supports only single class name as
* argument and not set of space-separated tokens representing classes,
@@ -133,11 +133,11 @@ function addCssRule(selector, style) {
* (via getElementsByTagName).
*
* Based on
- * http://code.google.com/p/getelementsbyclassname/
+ * https://code.google.com/p/getelementsbyclassname/
* http://www.dustindiaz.com/getelementsbyclass/
- * http://stackoverflow.com/questions/1818865/do-we-have-getelementsbyclassname-in-javascript
+ * https://stackoverflow.com/questions/1818865/do-we-have-getelementsbyclassname-in-javascript
*
- * See also http://ejohn.org/blog/getelementsbyclassname-speed-comparison/
+ * See also https://johnresig.com/blog/getelementsbyclassname-speed-comparison/
*
* @param {String} class: name of _single_ class to find
* @param {String} [taghint] limit search to given tags
diff --git a/gpg-interface.c b/gpg-interface.c
index 947b58a..1ff9426 100644
--- a/gpg-interface.c
+++ b/gpg-interface.c
@@ -1,14 +1,31 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "commit.h"
#include "config.h"
+#include "date.h"
+#include "gettext.h"
#include "run-command.h"
#include "strbuf.h"
#include "dir.h"
+#include "ident.h"
#include "gpg-interface.h"
+#include "path.h"
#include "sigchain.h"
#include "tempfile.h"
#include "alias.h"
+static int git_gpg_config(const char *, const char *,
+ const struct config_context *, void *);
+
+static void gpg_interface_lazy_init(void)
+{
+ static int done;
+
+ if (done)
+ return;
+ done = 1;
+ git_config(git_gpg_config, NULL);
+}
+
static char *configured_signing_key;
static const char *ssh_default_key_command, *ssh_allowed_signers, *ssh_revocation_file;
static enum signature_trust_level configured_min_trust_level = TRUST_UNDEFINED;
@@ -165,15 +182,17 @@ static struct {
{ 0, "TRUST_", GPG_STATUS_TRUST_LEVEL },
};
-static struct {
+/* Keep the order same as enum signature_trust_level */
+static struct sigcheck_gpg_trust_level {
const char *key;
+ const char *display_key;
enum signature_trust_level value;
} sigcheck_gpg_trust_level[] = {
- { "UNDEFINED", TRUST_UNDEFINED },
- { "NEVER", TRUST_NEVER },
- { "MARGINAL", TRUST_MARGINAL },
- { "FULLY", TRUST_FULLY },
- { "ULTIMATE", TRUST_ULTIMATE },
+ { "UNDEFINED", "undefined", TRUST_UNDEFINED },
+ { "NEVER", "never", TRUST_NEVER },
+ { "MARGINAL", "marginal", TRUST_MARGINAL },
+ { "FULLY", "fully", TRUST_FULLY },
+ { "ULTIMATE", "ultimate", TRUST_ULTIMATE },
};
static void replace_cstring(char **field, const char *line, const char *next)
@@ -464,7 +483,7 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,
if (sigc->payload_timestamp)
strbuf_addf(&verify_time, "-Overify-time=%s",
- show_date(sigc->payload_timestamp, 0, &verify_date_mode));
+ show_date(sigc->payload_timestamp, 0, verify_date_mode));
/* Find the principal from the signers */
strvec_pushl(&ssh_keygen.args, fmt->program,
@@ -567,8 +586,8 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,
}
}
- strbuf_stripspace(&ssh_keygen_out, 0);
- strbuf_stripspace(&ssh_keygen_err, 0);
+ strbuf_stripspace(&ssh_keygen_out, NULL);
+ strbuf_stripspace(&ssh_keygen_err, NULL);
/* Add stderr outputs to show the user actual ssh-keygen errors */
strbuf_add(&ssh_keygen_out, ssh_principals_err.buf, ssh_principals_err.len);
strbuf_add(&ssh_keygen_out, ssh_keygen_err.buf, ssh_keygen_err.len);
@@ -630,8 +649,10 @@ int check_signature(struct signature_check *sigc,
struct gpg_format *fmt;
int status;
+ gpg_interface_lazy_init();
+
sigc->result = 'N';
- sigc->trust_level = -1;
+ sigc->trust_level = TRUST_UNDEFINED;
fmt = get_format_by_sig(signature);
if (!fmt)
@@ -693,11 +714,15 @@ int parse_signature(const char *buf, size_t size, struct strbuf *payload, struct
void set_signing_key(const char *key)
{
+ gpg_interface_lazy_init();
+
free(configured_signing_key);
configured_signing_key = xstrdup(key);
}
-int git_gpg_config(const char *var, const char *value, void *cb)
+static int git_gpg_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *cb UNUSED)
{
struct gpg_format *fmt = NULL;
char *fmtname = NULL;
@@ -736,23 +761,14 @@ int git_gpg_config(const char *var, const char *value, void *cb)
return 0;
}
- if (!strcmp(var, "gpg.ssh.defaultkeycommand")) {
- if (!value)
- return config_error_nonbool(var);
+ if (!strcmp(var, "gpg.ssh.defaultkeycommand"))
return git_config_string(&ssh_default_key_command, var, value);
- }
- if (!strcmp(var, "gpg.ssh.allowedsignersfile")) {
- if (!value)
- return config_error_nonbool(var);
+ if (!strcmp(var, "gpg.ssh.allowedsignersfile"))
return git_config_pathname(&ssh_allowed_signers, var, value);
- }
- if (!strcmp(var, "gpg.ssh.revocationfile")) {
- if (!value)
- return config_error_nonbool(var);
+ if (!strcmp(var, "gpg.ssh.revocationfile"))
return git_config_pathname(&ssh_revocation_file, var, value);
- }
if (!strcmp(var, "gpg.program") || !strcmp(var, "gpg.openpgp.program"))
fmtname = "openpgp";
@@ -886,6 +902,8 @@ static const char *get_ssh_key_id(void) {
/* Returns a textual but unique representation of the signing key */
const char *get_signing_key_id(void)
{
+ gpg_interface_lazy_init();
+
if (use_format->get_key_id) {
return use_format->get_key_id();
}
@@ -896,6 +914,8 @@ const char *get_signing_key_id(void)
const char *get_signing_key(void)
{
+ gpg_interface_lazy_init();
+
if (configured_signing_key)
return configured_signing_key;
if (use_format->get_default_key) {
@@ -905,8 +925,24 @@ const char *get_signing_key(void)
return git_committer_info(IDENT_STRICT | IDENT_NO_DATE);
}
+const char *gpg_trust_level_to_str(enum signature_trust_level level)
+{
+ struct sigcheck_gpg_trust_level *trust;
+
+ if (level < 0 || level >= ARRAY_SIZE(sigcheck_gpg_trust_level))
+ BUG("invalid trust level requested %d", level);
+
+ trust = &sigcheck_gpg_trust_level[level];
+ if (trust->value != level)
+ BUG("sigcheck_gpg_trust_level[] unsorted");
+
+ return sigcheck_gpg_trust_level[level].display_key;
+}
+
int sign_buffer(struct strbuf *buffer, struct strbuf *signature, const char *signing_key)
{
+ gpg_interface_lazy_init();
+
return use_format->sign_buffer(buffer, signature, signing_key);
}
@@ -961,9 +997,13 @@ static int sign_buffer_gpg(struct strbuf *buffer, struct strbuf *signature,
break; /* found */
}
ret |= !cp;
+ if (ret) {
+ error(_("gpg failed to sign the data:\n%s"),
+ gpg_status.len ? gpg_status.buf : "(no gpg output)");
+ strbuf_release(&gpg_status);
+ return -1;
+ }
strbuf_release(&gpg_status);
- if (ret)
- return error(_("gpg failed to sign the data"));
/* Strip CR from the line endings, in case we are on Windows. */
remove_cr_after(signature, bottom);
@@ -982,6 +1022,7 @@ static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature,
char *ssh_signing_key_file = NULL;
struct strbuf ssh_signature_filename = STRBUF_INIT;
const char *literal_key = NULL;
+ int literal_ssh_key = 0;
if (!signing_key || signing_key[0] == '\0')
return error(
@@ -989,6 +1030,7 @@ static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature,
if (is_literal_ssh_key(signing_key, &literal_key)) {
/* A literal ssh key */
+ literal_ssh_key = 1;
key_file = mks_tempfile_t(".git_signing_key_tmpXXXXXX");
if (!key_file)
return error_errno(
@@ -1003,7 +1045,7 @@ static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature,
ssh_signing_key_file = strbuf_detach(&key_file->filename, NULL);
} else {
/* We assume a file */
- ssh_signing_key_file = expand_user_path(signing_key, 1);
+ ssh_signing_key_file = interpolate_path(signing_key, 1);
}
buffer_file = mks_tempfile_t(".git_signing_buffer_tmpXXXXXX");
@@ -1023,8 +1065,10 @@ static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature,
"-Y", "sign",
"-n", "git",
"-f", ssh_signing_key_file,
- buffer_file->filename.buf,
NULL);
+ if (literal_ssh_key)
+ strvec_push(&signer.args, "-U");
+ strvec_push(&signer.args, buffer_file->filename.buf);
sigchain_push(SIGPIPE, SIG_IGN);
ret = pipe_command(&signer, NULL, 0, NULL, 0, &signer_stderr, 0);
@@ -1034,7 +1078,7 @@ static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature,
if (strstr(signer_stderr.buf, "usage:"))
error(_("ssh-keygen -Y sign is needed for ssh signing (available in openssh version 8.2p1+)"));
- error("%s", signer_stderr.buf);
+ ret = error("%s", signer_stderr.buf);
goto out;
}
@@ -1043,12 +1087,11 @@ static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature,
strbuf_addbuf(&ssh_signature_filename, &buffer_file->filename);
strbuf_addstr(&ssh_signature_filename, ".sig");
if (strbuf_read_file(signature, ssh_signature_filename.buf, 0) < 0) {
- error_errno(
+ ret = error_errno(
_("failed reading ssh signing data buffer from '%s'"),
ssh_signature_filename.buf);
+ goto out;
}
- unlink_or_warn(ssh_signature_filename.buf);
-
/* Strip CR from the line endings, in case we are on Windows. */
remove_cr_after(signature, bottom);
@@ -1057,6 +1100,8 @@ out:
delete_tempfile(&key_file);
if (buffer_file)
delete_tempfile(&buffer_file);
+ if (ssh_signature_filename.len)
+ unlink_or_warn(ssh_signature_filename.buf);
strbuf_release(&signer_stderr);
strbuf_release(&ssh_signature_filename);
FREE_AND_NULL(ssh_signing_key_file);
diff --git a/gpg-interface.h b/gpg-interface.h
index b30cbdc..7cd9816 100644
--- a/gpg-interface.h
+++ b/gpg-interface.h
@@ -66,12 +66,19 @@ size_t parse_signed_buffer(const char *buf, size_t size);
* Create a detached signature for the contents of "buffer" and append
* it after "signature"; "buffer" and "signature" can be the same
* strbuf instance, which would cause the detached signature appended
- * at the end.
+ * at the end. Returns 0 on success, non-zero on failure.
*/
int sign_buffer(struct strbuf *buffer, struct strbuf *signature,
const char *signing_key);
-int git_gpg_config(const char *, const char *, void *);
+
+/*
+ * Returns corresponding string in lowercase for a given member of
+ * enum signature_trust_level. For example, `TRUST_ULTIMATE` will
+ * return "ultimate".
+ */
+const char *gpg_trust_level_to_str(enum signature_trust_level level);
+
void set_signing_key(const char *);
const char *get_signing_key(void);
diff --git a/graph.c b/graph.c
index 568b6e7..1ca3477 100644
--- a/graph.c
+++ b/graph.c
@@ -1,4 +1,5 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "gettext.h"
#include "config.h"
#include "commit.h"
#include "color.h"
@@ -338,7 +339,6 @@ void graph_setup_line_prefix(struct diff_options *diffopt)
diffopt->output_prefix = diff_output_prefix_callback;
}
-
struct git_graph *graph_init(struct rev_info *opt)
{
struct git_graph *graph = xmalloc(sizeof(struct git_graph));
diff --git a/graph.h b/graph.h
index e88632a..3fd1dcb 100644
--- a/graph.h
+++ b/graph.h
@@ -130,7 +130,7 @@ void graph_setup_line_prefix(struct diff_options *diffopt);
* This functions must be called BEFORE graph_init() is called.
*
* NOTE: This function isn't used in Git outside graph.c but it is used
- * by CGit (http://git.zx2c4.com/cgit/) to use HTML for colors.
+ * by CGit (https://git.zx2c4.com/cgit/) to use HTML for colors.
*/
void graph_set_column_colors(const char **colors, unsigned short colors_max);
@@ -196,7 +196,7 @@ int graph_is_commit_finished(struct git_graph const *graph);
* graph_update() is called.
*
* NOTE: This function isn't used in Git outside graph.c but it is used
- * by CGit (http://git.zx2c4.com/cgit/) to wrap HTML around graph lines.
+ * by CGit (https://git.zx2c4.com/cgit/) to wrap HTML around graph lines.
*/
int graph_next_line(struct git_graph *graph, struct strbuf *sb);
diff --git a/grep.c b/grep.c
index 82eb7da..ac34bfe 100644
--- a/grep.c
+++ b/grep.c
@@ -1,12 +1,14 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "gettext.h"
#include "grep.h"
-#include "object-store.h"
+#include "hex.h"
+#include "object-store-ll.h"
+#include "pretty.h"
#include "userdiff.h"
#include "xdiff-interface.h"
#include "diff.h"
#include "diffcore.h"
-#include "commit.h"
#include "quote.h"
#include "help.h"
@@ -14,7 +16,7 @@ static int grep_source_load(struct grep_source *gs);
static int grep_source_is_binary(struct grep_source *gs,
struct index_state *istate);
-static void std_output(struct grep_opt *opt, const void *buf, size_t size)
+static void std_output(struct grep_opt *opt UNUSED, const void *buf, size_t size)
{
fwrite(buf, size, 1, stdout);
}
@@ -52,7 +54,8 @@ define_list_config_array_extra(color_grep_slots, {"match"});
* Read the configuration file once and store it in
* the grep_defaults template.
*/
-int grep_config(const char *var, const char *value, void *cb)
+int grep_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
struct grep_opt *opt = cb;
const char *slot;
@@ -87,9 +90,9 @@ int grep_config(const char *var, const char *value, void *cb)
if (!strcmp(var, "color.grep"))
opt->color = git_config_colorbool(var, value);
if (!strcmp(var, "color.grep.match")) {
- if (grep_config("color.grep.matchcontext", value, cb) < 0)
+ if (grep_config("color.grep.matchcontext", value, ctx, cb) < 0)
return -1;
- if (grep_config("color.grep.matchselected", value, cb) < 0)
+ if (grep_config("color.grep.matchselected", value, ctx, cb) < 0)
return -1;
} else if (skip_prefix(var, "color.grep.", &slot)) {
int i = LOOKUP_CONFIG(color_grep_slots, slot);
@@ -262,6 +265,31 @@ static void pcre2_free(void *pointer, MAYBE_UNUSED void *memory_data)
free(pointer);
}
+static int pcre2_jit_functional(void)
+{
+ static int jit_working = -1;
+ pcre2_code *code;
+ size_t off;
+ int err;
+
+ if (jit_working != -1)
+ return jit_working;
+
+ /*
+ * Try to JIT compile a simple pattern to probe if the JIT is
+ * working in general. It might fail for systems where creating
+ * memory mappings for runtime code generation is restricted.
+ */
+ code = pcre2_compile((PCRE2_SPTR)".", 1, 0, &err, &off, NULL);
+ if (!code)
+ return 0;
+
+ jit_working = pcre2_jit_compile(code, PCRE2_JIT_COMPLETE) == 0;
+ pcre2_code_free(code);
+
+ return jit_working;
+}
+
static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt)
{
int error;
@@ -293,7 +321,16 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt
options |= PCRE2_CASELESS;
}
if (!opt->ignore_locale && is_utf8_locale() && !literal)
- options |= (PCRE2_UTF | PCRE2_MATCH_INVALID_UTF);
+ options |= (PCRE2_UTF | PCRE2_UCP | PCRE2_MATCH_INVALID_UTF);
+
+#ifndef GIT_PCRE2_VERSION_10_35_OR_HIGHER
+ /*
+ * Work around a JIT bug related to invalid Unicode character handling
+ * fixed in 10.35:
+ * https://github.com/PCRE2Project/pcre2/commit/c21bd977547d
+ */
+ options &= ~PCRE2_UCP;
+#endif
#ifndef GIT_PCRE2_VERSION_10_36_OR_HIGHER
/* Work around https://bugs.exim.org/show_bug.cgi?id=2642 fixed in 10.36 */
@@ -317,8 +354,29 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt
pcre2_config(PCRE2_CONFIG_JIT, &p->pcre2_jit_on);
if (p->pcre2_jit_on) {
jitret = pcre2_jit_compile(p->pcre2_pattern, PCRE2_JIT_COMPLETE);
- if (jitret)
- die("Couldn't JIT the PCRE2 pattern '%s', got '%d'\n", p->pattern, jitret);
+ if (jitret == PCRE2_ERROR_NOMEMORY && !pcre2_jit_functional()) {
+ /*
+ * Even though pcre2_config(PCRE2_CONFIG_JIT, ...)
+ * indicated JIT support, the library might still
+ * fail to generate JIT code for various reasons,
+ * e.g. when SELinux's 'deny_execmem' or PaX's
+ * MPROTECT prevent creating W|X memory mappings.
+ *
+ * Instead of faling hard, fall back to interpreter
+ * mode, just as if the pattern was prefixed with
+ * '(*NO_JIT)'.
+ */
+ p->pcre2_jit_on = 0;
+ return;
+ } else if (jitret) {
+ int need_clip = p->patternlen > 64;
+ int clip_len = need_clip ? 64 : p->patternlen;
+ die("Couldn't JIT the PCRE2 pattern '%.*s'%s, got '%d'%s",
+ clip_len, p->pattern, need_clip ? "..." : "", jitret,
+ pcre2_jit_functional()
+ ? "\nPerhaps prefix (*NO_JIT) to your pattern?"
+ : "");
+ }
/*
* The pcre2_config(PCRE2_CONFIG_JIT, ...) call just
@@ -393,18 +451,20 @@ static void free_pcre2_pattern(struct grep_pat *p)
pcre2_general_context_free(p->pcre2_general_context);
}
#else /* !USE_LIBPCRE2 */
-static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt)
+static void compile_pcre2_pattern(struct grep_pat *p UNUSED,
+ const struct grep_opt *opt UNUSED)
{
die("cannot use Perl-compatible regexes when not compiled with USE_LIBPCRE");
}
-static int pcre2match(struct grep_pat *p, const char *line, const char *eol,
- regmatch_t *match, int eflags)
+static int pcre2match(struct grep_pat *p UNUSED, const char *line UNUSED,
+ const char *eol UNUSED, regmatch_t *match UNUSED,
+ int eflags UNUSED)
{
return 1;
}
-static void free_pcre2_pattern(struct grep_pat *p)
+static void free_pcre2_pattern(struct grep_pat *p UNUSED)
{
}
@@ -561,7 +621,7 @@ static struct grep_expr *compile_pattern_atom(struct grep_pat **list)
*list = p->next;
x = compile_pattern_or(list);
if (!*list || (*list)->token != GREP_CLOSE_PAREN)
- die("unmatched parenthesis");
+ die("unmatched ( for expression group");
*list = (*list)->next;
return x;
default:
@@ -708,6 +768,7 @@ void compile_grep_patterns(struct grep_opt *opt)
{
struct grep_pat *p;
struct grep_expr *header_expr = prep_header_patterns(opt);
+ int extended = 0;
for (p = opt->pattern_list; p; p = p->next) {
switch (p->token) {
@@ -717,21 +778,21 @@ void compile_grep_patterns(struct grep_opt *opt)
compile_regexp(p, opt);
break;
default:
- opt->extended = 1;
+ extended = 1;
break;
}
}
if (opt->all_match || opt->no_body_match || header_expr)
- opt->extended = 1;
- else if (!opt->extended)
+ extended = 1;
+ else if (!extended)
return;
p = opt->pattern_list;
if (p)
opt->pattern_expression = compile_pattern_expr(&p);
if (p)
- die("incomplete pattern expression: %s", p->pattern);
+ die("incomplete pattern expression group: %s", p->pattern);
if (opt->no_body_match && opt->pattern_expression)
opt->pattern_expression = grep_not_expr(opt->pattern_expression);
@@ -768,11 +829,11 @@ static void free_pattern_expr(struct grep_expr *x)
free(x);
}
-void free_grep_patterns(struct grep_opt *opt)
+static void free_grep_pat(struct grep_pat *pattern)
{
struct grep_pat *p, *n;
- for (p = opt->pattern_list; p; p = n) {
+ for (p = pattern; p; p = n) {
n = p->next;
switch (p->token) {
case GREP_PATTERN: /* atom */
@@ -789,10 +850,15 @@ void free_grep_patterns(struct grep_opt *opt)
}
free(p);
}
+}
- if (!opt->extended)
- return;
- free_pattern_expr(opt->pattern_expression);
+void free_grep_patterns(struct grep_opt *opt)
+{
+ free_grep_pat(opt->pattern_list);
+ free_grep_pat(opt->header_list);
+
+ if (opt->pattern_expression)
+ free_pattern_expr(opt->pattern_expression);
}
static const char *end_of_line(const char *cp, unsigned long *left)
@@ -971,8 +1037,6 @@ static int match_expr_eval(struct grep_opt *opt, struct grep_expr *x,
{
int h = 0;
- if (!x)
- die("Not a valid grep expression");
switch (x->node) {
case GREP_NODE_TRUE:
h = 1;
@@ -1052,7 +1116,7 @@ static int match_line(struct grep_opt *opt,
struct grep_pat *p;
int hit = 0;
- if (opt->extended)
+ if (opt->pattern_expression)
return match_expr(opt, bol, eol, ctx, col, icol,
collect_hits);
@@ -1370,7 +1434,7 @@ static int should_lookahead(struct grep_opt *opt)
{
struct grep_pat *p;
- if (opt->extended)
+ if (opt->pattern_expression)
return 0; /* punt for too complex stuff */
if (opt->invert)
return 0;
@@ -1615,7 +1679,7 @@ static int grep_source_1(struct grep_opt *opt, struct grep_source *gs, int colle
return 0;
goto next_line;
}
- if (hit) {
+ if (hit && (opt->max_count < 0 || count < opt->max_count)) {
count++;
if (opt->status_only)
return 1;
diff --git a/grep.h b/grep.h
index c722d25..926c087 100644
--- a/grep.h
+++ b/grep.h
@@ -7,6 +7,9 @@
#if (PCRE2_MAJOR >= 10 && PCRE2_MINOR >= 36) || PCRE2_MAJOR >= 11
#define GIT_PCRE2_VERSION_10_36_OR_HIGHER
#endif
+#if (PCRE2_MAJOR >= 10 && PCRE2_MINOR >= 35) || PCRE2_MAJOR >= 11
+#define GIT_PCRE2_VERSION_10_35_OR_HIGHER
+#endif
#if (PCRE2_MAJOR >= 10 && PCRE2_MINOR >= 34) || PCRE2_MAJOR >= 11
#define GIT_PCRE2_VERSION_10_34_OR_HIGHER
#endif
@@ -151,7 +154,6 @@ struct grep_opt {
#define GREP_BINARY_TEXT 2
int binary;
int allow_textconv;
- int extended;
int use_reflog_filter;
int relative;
int pathname;
@@ -171,6 +173,7 @@ struct grep_opt {
int show_hunk_mark;
int file_break;
int heading;
+ int max_count;
void *priv;
void (*output)(struct grep_opt *opt, const void *data, size_t size);
@@ -181,6 +184,7 @@ struct grep_opt {
.relative = 1, \
.pathname = 1, \
.max_depth = -1, \
+ .max_count = -1, \
.pattern_type_option = GREP_PATTERN_TYPE_UNSPECIFIED, \
.colors = { \
[GREP_COLOR_CONTEXT] = "", \
@@ -198,7 +202,9 @@ struct grep_opt {
.output = std_output, \
}
-int grep_config(const char *var, const char *value, void *);
+struct config_context;
+int grep_config(const char *var, const char *value,
+ const struct config_context *ctx, void *data);
void grep_init(struct grep_opt *, struct repository *repo);
void append_grep_pat(struct grep_opt *opt, const char *pat, size_t patlen, const char *origin, int no, enum grep_pat_token t);
diff --git a/hash-ll.h b/hash-ll.h
new file mode 100644
index 0000000..2cfde63
--- /dev/null
+++ b/hash-ll.h
@@ -0,0 +1,310 @@
+#ifndef HASH_LL_H
+#define HASH_LL_H
+
+#if defined(SHA1_APPLE)
+#include <CommonCrypto/CommonDigest.h>
+#elif defined(SHA1_OPENSSL)
+# include <openssl/sha.h>
+# if defined(OPENSSL_API_LEVEL) && OPENSSL_API_LEVEL >= 3
+# define SHA1_NEEDS_CLONE_HELPER
+# include "sha1/openssl.h"
+# endif
+#elif defined(SHA1_DC)
+#include "sha1dc_git.h"
+#else /* SHA1_BLK */
+#include "block-sha1/sha1.h"
+#endif
+
+#if defined(SHA256_NETTLE)
+#include "sha256/nettle.h"
+#elif defined(SHA256_GCRYPT)
+#define SHA256_NEEDS_CLONE_HELPER
+#include "sha256/gcrypt.h"
+#elif defined(SHA256_OPENSSL)
+# include <openssl/sha.h>
+# if defined(OPENSSL_API_LEVEL) && OPENSSL_API_LEVEL >= 3
+# define SHA256_NEEDS_CLONE_HELPER
+# include "sha256/openssl.h"
+# endif
+#else
+#include "sha256/block/sha256.h"
+#endif
+
+#ifndef platform_SHA_CTX
+/*
+ * platform's underlying implementation of SHA-1; could be OpenSSL,
+ * blk_SHA, Apple CommonCrypto, etc... Note that the relevant
+ * SHA-1 header may have already defined platform_SHA_CTX for our
+ * own implementations like block-sha1, so we list
+ * the default for OpenSSL compatible SHA-1 implementations here.
+ */
+#define platform_SHA_CTX SHA_CTX
+#define platform_SHA1_Init SHA1_Init
+#define platform_SHA1_Update SHA1_Update
+#define platform_SHA1_Final SHA1_Final
+#endif
+
+#define git_SHA_CTX platform_SHA_CTX
+#define git_SHA1_Init platform_SHA1_Init
+#define git_SHA1_Update platform_SHA1_Update
+#define git_SHA1_Final platform_SHA1_Final
+
+#ifdef platform_SHA1_Clone
+#define git_SHA1_Clone platform_SHA1_Clone
+#endif
+
+#ifndef platform_SHA256_CTX
+#define platform_SHA256_CTX SHA256_CTX
+#define platform_SHA256_Init SHA256_Init
+#define platform_SHA256_Update SHA256_Update
+#define platform_SHA256_Final SHA256_Final
+#endif
+
+#define git_SHA256_CTX platform_SHA256_CTX
+#define git_SHA256_Init platform_SHA256_Init
+#define git_SHA256_Update platform_SHA256_Update
+#define git_SHA256_Final platform_SHA256_Final
+
+#ifdef platform_SHA256_Clone
+#define git_SHA256_Clone platform_SHA256_Clone
+#endif
+
+#ifdef SHA1_MAX_BLOCK_SIZE
+#include "compat/sha1-chunked.h"
+#undef git_SHA1_Update
+#define git_SHA1_Update git_SHA1_Update_Chunked
+#endif
+
+#ifndef SHA1_NEEDS_CLONE_HELPER
+static inline void git_SHA1_Clone(git_SHA_CTX *dst, const git_SHA_CTX *src)
+{
+ memcpy(dst, src, sizeof(*dst));
+}
+#endif
+
+#ifndef SHA256_NEEDS_CLONE_HELPER
+static inline void git_SHA256_Clone(git_SHA256_CTX *dst, const git_SHA256_CTX *src)
+{
+ memcpy(dst, src, sizeof(*dst));
+}
+#endif
+
+/*
+ * Note that these constants are suitable for indexing the hash_algos array and
+ * comparing against each other, but are otherwise arbitrary, so they should not
+ * be exposed to the user or serialized to disk. To know whether a
+ * git_hash_algo struct points to some usable hash function, test the format_id
+ * field for being non-zero. Use the name field for user-visible situations and
+ * the format_id field for fixed-length fields on disk.
+ */
+/* An unknown hash function. */
+#define GIT_HASH_UNKNOWN 0
+/* SHA-1 */
+#define GIT_HASH_SHA1 1
+/* SHA-256 */
+#define GIT_HASH_SHA256 2
+/* Number of algorithms supported (including unknown). */
+#define GIT_HASH_NALGOS (GIT_HASH_SHA256 + 1)
+
+/* "sha1", big-endian */
+#define GIT_SHA1_FORMAT_ID 0x73686131
+
+/* The length in bytes and in hex digits of an object name (SHA-1 value). */
+#define GIT_SHA1_RAWSZ 20
+#define GIT_SHA1_HEXSZ (2 * GIT_SHA1_RAWSZ)
+/* The block size of SHA-1. */
+#define GIT_SHA1_BLKSZ 64
+
+/* "s256", big-endian */
+#define GIT_SHA256_FORMAT_ID 0x73323536
+
+/* The length in bytes and in hex digits of an object name (SHA-256 value). */
+#define GIT_SHA256_RAWSZ 32
+#define GIT_SHA256_HEXSZ (2 * GIT_SHA256_RAWSZ)
+/* The block size of SHA-256. */
+#define GIT_SHA256_BLKSZ 64
+
+/* The length in byte and in hex digits of the largest possible hash value. */
+#define GIT_MAX_RAWSZ GIT_SHA256_RAWSZ
+#define GIT_MAX_HEXSZ GIT_SHA256_HEXSZ
+/* The largest possible block size for any supported hash. */
+#define GIT_MAX_BLKSZ GIT_SHA256_BLKSZ
+
+struct object_id {
+ unsigned char hash[GIT_MAX_RAWSZ];
+ int algo; /* XXX requires 4-byte alignment */
+};
+
+#define GET_OID_QUIETLY 01
+#define GET_OID_COMMIT 02
+#define GET_OID_COMMITTISH 04
+#define GET_OID_TREE 010
+#define GET_OID_TREEISH 020
+#define GET_OID_BLOB 040
+#define GET_OID_FOLLOW_SYMLINKS 0100
+#define GET_OID_RECORD_PATH 0200
+#define GET_OID_ONLY_TO_DIE 04000
+#define GET_OID_REQUIRE_PATH 010000
+#define GET_OID_HASH_ANY 020000
+
+#define GET_OID_DISAMBIGUATORS \
+ (GET_OID_COMMIT | GET_OID_COMMITTISH | \
+ GET_OID_TREE | GET_OID_TREEISH | \
+ GET_OID_BLOB)
+
+enum get_oid_result {
+ FOUND = 0,
+ MISSING_OBJECT = -1, /* The requested object is missing */
+ SHORT_NAME_AMBIGUOUS = -2,
+ /* The following only apply when symlinks are followed */
+ DANGLING_SYMLINK = -4, /*
+ * The initial symlink is there, but
+ * (transitively) points to a missing
+ * in-tree file
+ */
+ SYMLINK_LOOP = -5,
+ NOT_DIR = -6, /*
+ * Somewhere along the symlink chain, a path is
+ * requested which contains a file as a
+ * non-final element.
+ */
+};
+
+/* A suitably aligned type for stack allocations of hash contexts. */
+union git_hash_ctx {
+ git_SHA_CTX sha1;
+ git_SHA256_CTX sha256;
+};
+typedef union git_hash_ctx git_hash_ctx;
+
+typedef void (*git_hash_init_fn)(git_hash_ctx *ctx);
+typedef void (*git_hash_clone_fn)(git_hash_ctx *dst, const git_hash_ctx *src);
+typedef void (*git_hash_update_fn)(git_hash_ctx *ctx, const void *in, size_t len);
+typedef void (*git_hash_final_fn)(unsigned char *hash, git_hash_ctx *ctx);
+typedef void (*git_hash_final_oid_fn)(struct object_id *oid, git_hash_ctx *ctx);
+
+struct git_hash_algo {
+ /*
+ * The name of the algorithm, as appears in the config file and in
+ * messages.
+ */
+ const char *name;
+
+ /* A four-byte version identifier, used in pack indices. */
+ uint32_t format_id;
+
+ /* The length of the hash in binary. */
+ size_t rawsz;
+
+ /* The length of the hash in hex characters. */
+ size_t hexsz;
+
+ /* The block size of the hash. */
+ size_t blksz;
+
+ /* The hash initialization function. */
+ git_hash_init_fn init_fn;
+
+ /* The hash context cloning function. */
+ git_hash_clone_fn clone_fn;
+
+ /* The hash update function. */
+ git_hash_update_fn update_fn;
+
+ /* The hash finalization function. */
+ git_hash_final_fn final_fn;
+
+ /* The hash finalization function for object IDs. */
+ git_hash_final_oid_fn final_oid_fn;
+
+ /* The OID of the empty tree. */
+ const struct object_id *empty_tree;
+
+ /* The OID of the empty blob. */
+ const struct object_id *empty_blob;
+
+ /* The all-zeros OID. */
+ const struct object_id *null_oid;
+};
+extern const struct git_hash_algo hash_algos[GIT_HASH_NALGOS];
+
+/*
+ * Return a GIT_HASH_* constant based on the name. Returns GIT_HASH_UNKNOWN if
+ * the name doesn't match a known algorithm.
+ */
+int hash_algo_by_name(const char *name);
+/* Identical, except based on the format ID. */
+int hash_algo_by_id(uint32_t format_id);
+/* Identical, except based on the length. */
+int hash_algo_by_length(int len);
+/* Identical, except for a pointer to struct git_hash_algo. */
+static inline int hash_algo_by_ptr(const struct git_hash_algo *p)
+{
+ return p - hash_algos;
+}
+
+const struct object_id *null_oid(void);
+
+static inline int hashcmp_algop(const unsigned char *sha1, const unsigned char *sha2, const struct git_hash_algo *algop)
+{
+ /*
+ * Teach the compiler that there are only two possibilities of hash size
+ * here, so that it can optimize for this case as much as possible.
+ */
+ if (algop->rawsz == GIT_MAX_RAWSZ)
+ return memcmp(sha1, sha2, GIT_MAX_RAWSZ);
+ return memcmp(sha1, sha2, GIT_SHA1_RAWSZ);
+}
+
+static inline int hasheq_algop(const unsigned char *sha1, const unsigned char *sha2, const struct git_hash_algo *algop)
+{
+ /*
+ * We write this here instead of deferring to hashcmp so that the
+ * compiler can properly inline it and avoid calling memcmp.
+ */
+ if (algop->rawsz == GIT_MAX_RAWSZ)
+ return !memcmp(sha1, sha2, GIT_MAX_RAWSZ);
+ return !memcmp(sha1, sha2, GIT_SHA1_RAWSZ);
+}
+
+static inline void oidcpy(struct object_id *dst, const struct object_id *src)
+{
+ memcpy(dst->hash, src->hash, GIT_MAX_RAWSZ);
+ dst->algo = src->algo;
+}
+
+static inline struct object_id *oiddup(const struct object_id *src)
+{
+ struct object_id *dst = xmalloc(sizeof(struct object_id));
+ oidcpy(dst, src);
+ return dst;
+}
+
+static inline void oid_set_algo(struct object_id *oid, const struct git_hash_algo *algop)
+{
+ oid->algo = hash_algo_by_ptr(algop);
+}
+
+/*
+ * Converts a cryptographic hash (e.g. SHA-1) into an int-sized hash code
+ * for use in hash tables. Cryptographic hashes are supposed to have
+ * uniform distribution, so in contrast to `memhash()`, this just copies
+ * the first `sizeof(int)` bytes without shuffling any bits. Note that
+ * the results will be different on big-endian and little-endian
+ * platforms, so they should not be stored or transferred over the net.
+ */
+static inline unsigned int oidhash(const struct object_id *oid)
+{
+ /*
+ * Equivalent to 'return *(unsigned int *)oid->hash;', but safe on
+ * platforms that don't support unaligned reads.
+ */
+ unsigned int hash;
+ memcpy(&hash, oid->hash, sizeof(hash));
+ return hash;
+}
+
+const char *empty_tree_oid_hex(void);
+const char *empty_blob_oid_hex(void);
+
+#endif
diff --git a/hash-lookup.c b/hash-lookup.c
index b98ed5e..9f0f95e 100644
--- a/hash-lookup.c
+++ b/hash-lookup.c
@@ -1,5 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "hash.h"
#include "hash-lookup.h"
+#include "read-cache-ll.h"
static uint32_t take2(const struct object_id *oid, size_t ofs)
{
diff --git a/hash.h b/hash.h
index 5d40368..e064807 100644
--- a/hash.h
+++ b/hash.h
@@ -1,217 +1,11 @@
#ifndef HASH_H
#define HASH_H
-#include "git-compat-util.h"
+#include "hash-ll.h"
#include "repository.h"
-#if defined(SHA1_PPC)
-#include "ppc/sha1.h"
-#elif defined(SHA1_APPLE)
-#include <CommonCrypto/CommonDigest.h>
-#elif defined(SHA1_OPENSSL)
-#include <openssl/sha.h>
-#elif defined(SHA1_DC)
-#include "sha1dc_git.h"
-#else /* SHA1_BLK */
-#include "block-sha1/sha1.h"
-#endif
-
-#if defined(SHA256_GCRYPT)
-#define SHA256_NEEDS_CLONE_HELPER
-#include "sha256/gcrypt.h"
-#elif defined(SHA256_OPENSSL)
-#include <openssl/sha.h>
-#else
-#include "sha256/block/sha256.h"
-#endif
-
-#ifndef platform_SHA_CTX
-/*
- * platform's underlying implementation of SHA-1; could be OpenSSL,
- * blk_SHA, Apple CommonCrypto, etc... Note that the relevant
- * SHA-1 header may have already defined platform_SHA_CTX for our
- * own implementations like block-sha1 and ppc-sha1, so we list
- * the default for OpenSSL compatible SHA-1 implementations here.
- */
-#define platform_SHA_CTX SHA_CTX
-#define platform_SHA1_Init SHA1_Init
-#define platform_SHA1_Update SHA1_Update
-#define platform_SHA1_Final SHA1_Final
-#endif
-
-#define git_SHA_CTX platform_SHA_CTX
-#define git_SHA1_Init platform_SHA1_Init
-#define git_SHA1_Update platform_SHA1_Update
-#define git_SHA1_Final platform_SHA1_Final
-
-#ifndef platform_SHA256_CTX
-#define platform_SHA256_CTX SHA256_CTX
-#define platform_SHA256_Init SHA256_Init
-#define platform_SHA256_Update SHA256_Update
-#define platform_SHA256_Final SHA256_Final
-#endif
-
-#define git_SHA256_CTX platform_SHA256_CTX
-#define git_SHA256_Init platform_SHA256_Init
-#define git_SHA256_Update platform_SHA256_Update
-#define git_SHA256_Final platform_SHA256_Final
-
-#ifdef platform_SHA256_Clone
-#define git_SHA256_Clone platform_SHA256_Clone
-#endif
-
-#ifdef SHA1_MAX_BLOCK_SIZE
-#include "compat/sha1-chunked.h"
-#undef git_SHA1_Update
-#define git_SHA1_Update git_SHA1_Update_Chunked
-#endif
-
-static inline void git_SHA1_Clone(git_SHA_CTX *dst, const git_SHA_CTX *src)
-{
- memcpy(dst, src, sizeof(*dst));
-}
-
-#ifndef SHA256_NEEDS_CLONE_HELPER
-static inline void git_SHA256_Clone(git_SHA256_CTX *dst, const git_SHA256_CTX *src)
-{
- memcpy(dst, src, sizeof(*dst));
-}
-#endif
-
-/*
- * Note that these constants are suitable for indexing the hash_algos array and
- * comparing against each other, but are otherwise arbitrary, so they should not
- * be exposed to the user or serialized to disk. To know whether a
- * git_hash_algo struct points to some usable hash function, test the format_id
- * field for being non-zero. Use the name field for user-visible situations and
- * the format_id field for fixed-length fields on disk.
- */
-/* An unknown hash function. */
-#define GIT_HASH_UNKNOWN 0
-/* SHA-1 */
-#define GIT_HASH_SHA1 1
-/* SHA-256 */
-#define GIT_HASH_SHA256 2
-/* Number of algorithms supported (including unknown). */
-#define GIT_HASH_NALGOS (GIT_HASH_SHA256 + 1)
-
-/* "sha1", big-endian */
-#define GIT_SHA1_FORMAT_ID 0x73686131
-
-/* The length in bytes and in hex digits of an object name (SHA-1 value). */
-#define GIT_SHA1_RAWSZ 20
-#define GIT_SHA1_HEXSZ (2 * GIT_SHA1_RAWSZ)
-/* The block size of SHA-1. */
-#define GIT_SHA1_BLKSZ 64
-
-/* "s256", big-endian */
-#define GIT_SHA256_FORMAT_ID 0x73323536
-
-/* The length in bytes and in hex digits of an object name (SHA-256 value). */
-#define GIT_SHA256_RAWSZ 32
-#define GIT_SHA256_HEXSZ (2 * GIT_SHA256_RAWSZ)
-/* The block size of SHA-256. */
-#define GIT_SHA256_BLKSZ 64
-
-/* The length in byte and in hex digits of the largest possible hash value. */
-#define GIT_MAX_RAWSZ GIT_SHA256_RAWSZ
-#define GIT_MAX_HEXSZ GIT_SHA256_HEXSZ
-/* The largest possible block size for any supported hash. */
-#define GIT_MAX_BLKSZ GIT_SHA256_BLKSZ
-
-struct object_id {
- unsigned char hash[GIT_MAX_RAWSZ];
- int algo; /* XXX requires 4-byte alignment */
-};
-
-/* A suitably aligned type for stack allocations of hash contexts. */
-union git_hash_ctx {
- git_SHA_CTX sha1;
- git_SHA256_CTX sha256;
-};
-typedef union git_hash_ctx git_hash_ctx;
-
-typedef void (*git_hash_init_fn)(git_hash_ctx *ctx);
-typedef void (*git_hash_clone_fn)(git_hash_ctx *dst, const git_hash_ctx *src);
-typedef void (*git_hash_update_fn)(git_hash_ctx *ctx, const void *in, size_t len);
-typedef void (*git_hash_final_fn)(unsigned char *hash, git_hash_ctx *ctx);
-typedef void (*git_hash_final_oid_fn)(struct object_id *oid, git_hash_ctx *ctx);
-
-struct git_hash_algo {
- /*
- * The name of the algorithm, as appears in the config file and in
- * messages.
- */
- const char *name;
-
- /* A four-byte version identifier, used in pack indices. */
- uint32_t format_id;
-
- /* The length of the hash in binary. */
- size_t rawsz;
-
- /* The length of the hash in hex characters. */
- size_t hexsz;
-
- /* The block size of the hash. */
- size_t blksz;
-
- /* The hash initialization function. */
- git_hash_init_fn init_fn;
-
- /* The hash context cloning function. */
- git_hash_clone_fn clone_fn;
-
- /* The hash update function. */
- git_hash_update_fn update_fn;
-
- /* The hash finalization function. */
- git_hash_final_fn final_fn;
-
- /* The hash finalization function for object IDs. */
- git_hash_final_oid_fn final_oid_fn;
-
- /* The OID of the empty tree. */
- const struct object_id *empty_tree;
-
- /* The OID of the empty blob. */
- const struct object_id *empty_blob;
-
- /* The all-zeros OID. */
- const struct object_id *null_oid;
-};
-extern const struct git_hash_algo hash_algos[GIT_HASH_NALGOS];
-
-/*
- * Return a GIT_HASH_* constant based on the name. Returns GIT_HASH_UNKNOWN if
- * the name doesn't match a known algorithm.
- */
-int hash_algo_by_name(const char *name);
-/* Identical, except based on the format ID. */
-int hash_algo_by_id(uint32_t format_id);
-/* Identical, except based on the length. */
-int hash_algo_by_length(int len);
-/* Identical, except for a pointer to struct git_hash_algo. */
-static inline int hash_algo_by_ptr(const struct git_hash_algo *p)
-{
- return p - hash_algos;
-}
-
#define the_hash_algo the_repository->hash_algo
-const struct object_id *null_oid(void);
-
-static inline int hashcmp_algop(const unsigned char *sha1, const unsigned char *sha2, const struct git_hash_algo *algop)
-{
- /*
- * Teach the compiler that there are only two possibilities of hash size
- * here, so that it can optimize for this case as much as possible.
- */
- if (algop->rawsz == GIT_MAX_RAWSZ)
- return memcmp(sha1, sha2, GIT_MAX_RAWSZ);
- return memcmp(sha1, sha2, GIT_SHA1_RAWSZ);
-}
-
static inline int hashcmp(const unsigned char *sha1, const unsigned char *sha2)
{
return hashcmp_algop(sha1, sha2, the_hash_algo);
@@ -227,17 +21,6 @@ static inline int oidcmp(const struct object_id *oid1, const struct object_id *o
return hashcmp_algop(oid1->hash, oid2->hash, algop);
}
-static inline int hasheq_algop(const unsigned char *sha1, const unsigned char *sha2, const struct git_hash_algo *algop)
-{
- /*
- * We write this here instead of deferring to hashcmp so that the
- * compiler can properly inline it and avoid calling memcmp.
- */
- if (algop->rawsz == GIT_MAX_RAWSZ)
- return !memcmp(sha1, sha2, GIT_MAX_RAWSZ);
- return !memcmp(sha1, sha2, GIT_SHA1_RAWSZ);
-}
-
static inline int hasheq(const unsigned char *sha1, const unsigned char *sha2)
{
return hasheq_algop(sha1, sha2, the_hash_algo);
@@ -263,12 +46,6 @@ static inline void hashcpy(unsigned char *sha_dst, const unsigned char *sha_src)
memcpy(sha_dst, sha_src, the_hash_algo->rawsz);
}
-static inline void oidcpy(struct object_id *dst, const struct object_id *src)
-{
- memcpy(dst->hash, src->hash, GIT_MAX_RAWSZ);
- dst->algo = src->algo;
-}
-
/* Like oidcpy() but zero-pads the unused bytes in dst's hash array. */
static inline void oidcpy_with_padding(struct object_id *dst,
const struct object_id *src)
@@ -285,13 +62,6 @@ static inline void oidcpy_with_padding(struct object_id *dst,
dst->algo = src->algo;
}
-static inline struct object_id *oiddup(const struct object_id *src)
-{
- struct object_id *dst = xmalloc(sizeof(struct object_id));
- oidcpy(dst, src);
- return dst;
-}
-
static inline void hashclr(unsigned char *hash)
{
memset(hash, 0, the_hash_algo->rawsz);
@@ -303,10 +73,15 @@ static inline void oidclr(struct object_id *oid)
oid->algo = hash_algo_by_ptr(the_hash_algo);
}
+static inline void oidread_algop(struct object_id *oid, const unsigned char *hash, const struct git_hash_algo *algop)
+{
+ memcpy(oid->hash, hash, algop->rawsz);
+ oid->algo = hash_algo_by_ptr(algop);
+}
+
static inline void oidread(struct object_id *oid, const unsigned char *hash)
{
- memcpy(oid->hash, hash, the_hash_algo->rawsz);
- oid->algo = hash_algo_by_ptr(the_hash_algo);
+ oidread_algop(oid, hash, the_hash_algo);
}
static inline int is_empty_blob_sha1(const unsigned char *sha1)
@@ -329,12 +104,4 @@ static inline int is_empty_tree_oid(const struct object_id *oid)
return oideq(oid, the_hash_algo->empty_tree);
}
-static inline void oid_set_algo(struct object_id *oid, const struct git_hash_algo *algop)
-{
- oid->algo = hash_algo_by_ptr(algop);
-}
-
-const char *empty_tree_oid_hex(void);
-const char *empty_blob_oid_hex(void);
-
#endif
diff --git a/hashmap.c b/hashmap.c
index 134d2ee..ee45ef0 100644
--- a/hashmap.c
+++ b/hashmap.c
@@ -1,7 +1,7 @@
/*
* Generic implementation of hash-based key value mappings.
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "hashmap.h"
#define FNV32_BASE ((unsigned int) 0x811c9dc5)
@@ -142,10 +142,10 @@ static inline struct hashmap_entry **find_entry_ptr(const struct hashmap *map,
return e;
}
-static int always_equal(const void *unused_cmp_data,
- const struct hashmap_entry *unused1,
- const struct hashmap_entry *unused2,
- const void *unused_keydata)
+static int always_equal(const void *cmp_data UNUSED,
+ const struct hashmap_entry *entry1 UNUSED,
+ const struct hashmap_entry *entry2 UNUSED,
+ const void *keydata UNUSED)
{
return 0;
}
@@ -313,7 +313,7 @@ struct pool_entry {
unsigned char data[FLEX_ARRAY];
};
-static int pool_entry_cmp(const void *unused_cmp_data,
+static int pool_entry_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *keydata)
diff --git a/hashmap.h b/hashmap.h
index 7251687..c8216e4 100644
--- a/hashmap.h
+++ b/hashmap.h
@@ -1,8 +1,6 @@
#ifndef HASHMAP_H
#define HASHMAP_H
-#include "hash.h"
-
/*
* Generic implementation of hash-based key-value mappings.
*
@@ -121,25 +119,6 @@ unsigned int memihash(const void *buf, size_t len);
unsigned int memihash_cont(unsigned int hash_seed, const void *buf, size_t len);
/*
- * Converts a cryptographic hash (e.g. SHA-1) into an int-sized hash code
- * for use in hash tables. Cryptographic hashes are supposed to have
- * uniform distribution, so in contrast to `memhash()`, this just copies
- * the first `sizeof(int)` bytes without shuffling any bits. Note that
- * the results will be different on big-endian and little-endian
- * platforms, so they should not be stored or transferred over the net.
- */
-static inline unsigned int oidhash(const struct object_id *oid)
-{
- /*
- * Equivalent to 'return *(unsigned int *)oid->hash;', but safe on
- * platforms that don't support unaligned reads.
- */
- unsigned int hash;
- memcpy(&hash, oid->hash, sizeof(hash));
- return hash;
-}
-
-/*
* struct hashmap_entry is an opaque structure representing an entry in the
* hash table.
* Ideally it should be followed by an int-sized member to prevent unused
@@ -270,7 +249,7 @@ void hashmap_clear_(struct hashmap *map, ssize_t offset);
#define hashmap_clear(map) hashmap_clear_(map, -1)
/*
- * Similar to hashmap_clear(), except that the table is no deallocated; it
+ * Similar to hashmap_clear(), except that the table is not deallocated; it
* is merely zeroed out but left the same size as before. If the hashmap
* will be reused, this avoids the overhead of deallocating and
* reallocating map->table. As with hashmap_clear(), you may need to free
diff --git a/help.c b/help.c
index 41c41c2..2dbe57b 100644
--- a/help.c
+++ b/help.c
@@ -1,9 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "builtin.h"
#include "exec-cmd.h"
#include "run-command.h"
#include "levenshtein.h"
+#include "gettext.h"
#include "help.h"
#include "command-list.h"
#include "string-list.h"
@@ -38,19 +39,30 @@ static struct category_description main_categories[] = {
{ CAT_plumbinginterrogators, N_("Low-level Commands / Interrogators") },
{ CAT_synchingrepositories, N_("Low-level Commands / Syncing Repositories") },
{ CAT_purehelpers, N_("Low-level Commands / Internal Helpers") },
+ { CAT_userinterfaces, N_("User-facing repository, command and file interfaces") },
+ { CAT_developerinterfaces, N_("Developer-facing file formats, protocols and other interfaces") },
{ 0, NULL }
};
static const char *drop_prefix(const char *name, uint32_t category)
{
const char *new_name;
-
- if (skip_prefix(name, "git-", &new_name))
- return new_name;
- if (category == CAT_guide && skip_prefix(name, "git", &new_name))
+ const char *prefix;
+
+ switch (category) {
+ case CAT_guide:
+ case CAT_userinterfaces:
+ case CAT_developerinterfaces:
+ prefix = "git";
+ break;
+ default:
+ prefix = "git-";
+ break;
+ }
+ if (skip_prefix(name, prefix, &new_name))
return new_name;
- return name;
+ return name;
}
static void extract_cmds(struct cmdname_help **p_cmds, uint32_t mask)
@@ -296,7 +308,8 @@ void load_command_list(const char *prefix,
exclude_cmds(other_cmds, main_cmds);
}
-static int get_colopts(const char *var, const char *value, void *data)
+static int get_colopts(const char *var, const char *value,
+ const struct config_context *ctx UNUSED, void *data)
{
unsigned int *colopts = data;
@@ -426,12 +439,36 @@ void list_guides_help(void)
putchar('\n');
}
-static int get_alias(const char *var, const char *value, void *data)
+void list_user_interfaces_help(void)
+{
+ struct category_description catdesc[] = {
+ { CAT_userinterfaces, N_("User-facing repository, command and file interfaces:") },
+ { 0, NULL }
+ };
+ print_cmd_by_category(catdesc, NULL);
+ putchar('\n');
+}
+
+void list_developer_interfaces_help(void)
+{
+ struct category_description catdesc[] = {
+ { CAT_developerinterfaces, N_("File formats, protocols and other developer interfaces:") },
+ { 0, NULL }
+ };
+ print_cmd_by_category(catdesc, NULL);
+ putchar('\n');
+}
+
+static int get_alias(const char *var, const char *value,
+ const struct config_context *ctx UNUSED, void *data)
{
struct string_list *list = data;
- if (skip_prefix(var, "alias.", &var))
+ if (skip_prefix(var, "alias.", &var)) {
+ if (!value)
+ return config_error_nonbool(var);
string_list_append(list, var)->util = xstrdup(value);
+ }
return 0;
}
@@ -509,7 +546,9 @@ static struct cmdnames aliases;
#define AUTOCORRECT_NEVER (-2)
#define AUTOCORRECT_IMMEDIATELY (-1)
-static int git_unknown_cmd_config(const char *var, const char *value, void *cb)
+static int git_unknown_cmd_config(const char *var, const char *value,
+ const struct config_context *ctx,
+ void *cb UNUSED)
{
const char *p;
@@ -523,7 +562,7 @@ static int git_unknown_cmd_config(const char *var, const char *value, void *cb)
} else if (!strcmp(value, "prompt")) {
autocorrect = AUTOCORRECT_PROMPT;
} else {
- int v = git_config_int(var, value);
+ int v = git_config_int(var, value, ctx->kvi);
autocorrect = (v < 0)
? AUTOCORRECT_IMMEDIATELY : v;
}
@@ -532,7 +571,7 @@ static int git_unknown_cmd_config(const char *var, const char *value, void *cb)
if (skip_prefix(var, "alias.", &p))
add_cmdname(&aliases, p, strlen(p));
- return git_default_config(var, value, cb);
+ return 0;
}
static int levenshtein_compare(const void *p1, const void *p2)
@@ -726,7 +765,7 @@ int cmd_version(int argc, const char **argv, const char *prefix)
struct strbuf buf = STRBUF_INIT;
int build_options = 0;
const char * const usage[] = {
- N_("git version [<options>]"),
+ N_("git version [--build-options]"),
NULL
};
struct option options[] = {
@@ -750,8 +789,9 @@ struct similar_ref_cb {
struct string_list *similar_refs;
};
-static int append_similar_ref(const char *refname, const struct object_id *oid,
- int flags, void *cb_data)
+static int append_similar_ref(const char *refname,
+ const struct object_id *oid UNUSED,
+ int flags UNUSED, void *cb_data)
{
struct similar_ref_cb *cb = (struct similar_ref_cb *)(cb_data);
char *branch = strrchr(refname, '/') + 1;
diff --git a/help.h b/help.h
index 971a3ad..af073a7 100644
--- a/help.h
+++ b/help.h
@@ -22,6 +22,8 @@ static inline void mput_char(char c, unsigned int num)
void list_common_cmds_help(void);
void list_all_cmds_help(int show_external_commands, int show_aliases);
void list_guides_help(void);
+void list_user_interfaces_help(void);
+void list_developer_interfaces_help(void);
void list_all_main_cmds(struct string_list *list);
void list_all_other_cmds(struct string_list *list);
diff --git a/hex-ll.c b/hex-ll.c
new file mode 100644
index 0000000..4d7ece1
--- /dev/null
+++ b/hex-ll.c
@@ -0,0 +1,49 @@
+#include "git-compat-util.h"
+#include "hex-ll.h"
+
+const signed char hexval_table[256] = {
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 00-07 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 08-0f */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 10-17 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 18-1f */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 20-27 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 28-2f */
+ 0, 1, 2, 3, 4, 5, 6, 7, /* 30-37 */
+ 8, 9, -1, -1, -1, -1, -1, -1, /* 38-3f */
+ -1, 10, 11, 12, 13, 14, 15, -1, /* 40-47 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 48-4f */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 50-57 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 58-5f */
+ -1, 10, 11, 12, 13, 14, 15, -1, /* 60-67 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 68-67 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 70-77 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 78-7f */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 80-87 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 88-8f */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 90-97 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* 98-9f */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* a0-a7 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* a8-af */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* b0-b7 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* b8-bf */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* c0-c7 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* c8-cf */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* d0-d7 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* d8-df */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* e0-e7 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* e8-ef */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* f0-f7 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* f8-ff */
+};
+
+int hex_to_bytes(unsigned char *binary, const char *hex, size_t len)
+{
+ for (; len; len--, hex += 2) {
+ unsigned int val = (hexval(hex[0]) << 4) | hexval(hex[1]);
+
+ if (val & ~0xff)
+ return -1;
+ *binary++ = val;
+ }
+ return 0;
+}
diff --git a/hex-ll.h b/hex-ll.h
new file mode 100644
index 0000000..a381fa8
--- /dev/null
+++ b/hex-ll.h
@@ -0,0 +1,27 @@
+#ifndef HEX_LL_H
+#define HEX_LL_H
+
+extern const signed char hexval_table[256];
+static inline unsigned int hexval(unsigned char c)
+{
+ return hexval_table[c];
+}
+
+/*
+ * Convert two consecutive hexadecimal digits into a char. Return a
+ * negative value on error. Don't run over the end of short strings.
+ */
+static inline int hex2chr(const char *s)
+{
+ unsigned int val = hexval(s[0]);
+ return (val & ~0xf) ? val : (val << 4) | hexval(s[1]);
+}
+
+/*
+ * Read `len` pairs of hexadecimal digits from `hex` and write the
+ * values to `binary` as `len` bytes. Return 0 on success, or -1 if
+ * the input does not consist of hex digits).
+ */
+int hex_to_bytes(unsigned char *binary, const char *hex, size_t len);
+
+#endif
diff --git a/hex.c b/hex.c
index 4f64d34..d42262b 100644
--- a/hex.c
+++ b/hex.c
@@ -1,51 +1,6 @@
-#include "cache.h"
-
-const signed char hexval_table[256] = {
- -1, -1, -1, -1, -1, -1, -1, -1, /* 00-07 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* 08-0f */
- -1, -1, -1, -1, -1, -1, -1, -1, /* 10-17 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* 18-1f */
- -1, -1, -1, -1, -1, -1, -1, -1, /* 20-27 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* 28-2f */
- 0, 1, 2, 3, 4, 5, 6, 7, /* 30-37 */
- 8, 9, -1, -1, -1, -1, -1, -1, /* 38-3f */
- -1, 10, 11, 12, 13, 14, 15, -1, /* 40-47 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* 48-4f */
- -1, -1, -1, -1, -1, -1, -1, -1, /* 50-57 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* 58-5f */
- -1, 10, 11, 12, 13, 14, 15, -1, /* 60-67 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* 68-67 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* 70-77 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* 78-7f */
- -1, -1, -1, -1, -1, -1, -1, -1, /* 80-87 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* 88-8f */
- -1, -1, -1, -1, -1, -1, -1, -1, /* 90-97 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* 98-9f */
- -1, -1, -1, -1, -1, -1, -1, -1, /* a0-a7 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* a8-af */
- -1, -1, -1, -1, -1, -1, -1, -1, /* b0-b7 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* b8-bf */
- -1, -1, -1, -1, -1, -1, -1, -1, /* c0-c7 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* c8-cf */
- -1, -1, -1, -1, -1, -1, -1, -1, /* d0-d7 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* d8-df */
- -1, -1, -1, -1, -1, -1, -1, -1, /* e0-e7 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* e8-ef */
- -1, -1, -1, -1, -1, -1, -1, -1, /* f0-f7 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* f8-ff */
-};
-
-int hex_to_bytes(unsigned char *binary, const char *hex, size_t len)
-{
- for (; len; len--, hex += 2) {
- unsigned int val = (hexval(hex[0]) << 4) | hexval(hex[1]);
-
- if (val & ~0xff)
- return -1;
- *binary++ = val;
- }
- return 0;
-}
+#include "git-compat-util.h"
+#include "hash.h"
+#include "hex.h"
static int get_hash_hex_algop(const char *hex, unsigned char *hash,
const struct git_hash_algo *algop)
@@ -61,7 +16,7 @@ static int get_hash_hex_algop(const char *hex, unsigned char *hash,
return 0;
}
-int get_sha1_hex(const char *hex, unsigned char *sha1)
+int get_hash_hex(const char *hex, unsigned char *sha1)
{
return get_hash_hex_algop(hex, sha1, the_hash_algo);
}
diff --git a/hex.h b/hex.h
new file mode 100644
index 0000000..e0b83f7
--- /dev/null
+++ b/hex.h
@@ -0,0 +1,64 @@
+#ifndef HEX_H
+#define HEX_H
+
+#include "hash-ll.h"
+#include "hex-ll.h"
+
+/*
+ * Try to read a hash (specified by the_hash_algo) in hexadecimal
+ * format from the 40 (or whatever length the hash algorithm uses)
+ * characters starting at hex. Write the 20-byte (or the length of
+ * the hash) result to hash in binary form.
+ * Return 0 on success. Reading stops if a NUL is encountered in the
+ * input, so it is safe to pass this function an arbitrary
+ * null-terminated string.
+ */
+int get_hash_hex(const char *hex, unsigned char *hash);
+int get_oid_hex(const char *hex, struct object_id *oid);
+
+/* Like get_oid_hex, but for an arbitrary hash algorithm. */
+int get_oid_hex_algop(const char *hex, struct object_id *oid, const struct git_hash_algo *algop);
+
+/*
+ * Convert a binary hash in "unsigned char []" or an object name in
+ * "struct object_id *" to its hex equivalent. The `_r` variant is reentrant,
+ * and writes the NUL-terminated output to the buffer `out`, which must be at
+ * least `GIT_MAX_HEXSZ + 1` bytes, and returns a pointer to out for
+ * convenience.
+ *
+ * The non-`_r` variant returns a static buffer, but uses a ring of 4
+ * buffers, making it safe to make multiple calls for a single statement, like:
+ *
+ * printf("%s -> %s", hash_to_hex(one), hash_to_hex(two));
+ * printf("%s -> %s", oid_to_hex(one), oid_to_hex(two));
+ */
+char *hash_to_hex_algop_r(char *buffer, const unsigned char *hash, const struct git_hash_algo *);
+char *oid_to_hex_r(char *out, const struct object_id *oid);
+char *hash_to_hex_algop(const unsigned char *hash, const struct git_hash_algo *); /* static buffer result! */
+char *hash_to_hex(const unsigned char *hash); /* same static buffer */
+char *oid_to_hex(const struct object_id *oid); /* same static buffer */
+
+/*
+ * Parse a 40-character hexadecimal object ID starting from hex, updating the
+ * pointer specified by end when parsing stops. The resulting object ID is
+ * stored in oid. Returns 0 on success. Parsing will stop on the first NUL or
+ * other invalid character. end is only updated on success; otherwise, it is
+ * unmodified.
+ */
+int parse_oid_hex(const char *hex, struct object_id *oid, const char **end);
+
+/* Like parse_oid_hex, but for an arbitrary hash algorithm. */
+int parse_oid_hex_algop(const char *hex, struct object_id *oid, const char **end,
+ const struct git_hash_algo *algo);
+
+
+/*
+ * These functions work like get_oid_hex and parse_oid_hex, but they will parse
+ * a hex value for any algorithm. The algorithm is detected based on the length
+ * and the algorithm in use is returned. If this is not a hex object ID in any
+ * algorithm, returns GIT_HASH_UNKNOWN.
+ */
+int get_oid_hex_any(const char *hex, struct object_id *oid);
+int parse_oid_hex_any(const char *hex, struct object_id *oid, const char **end);
+
+#endif
diff --git a/hook.c b/hook.c
index d113ee7..f6306d7 100644
--- a/hook.c
+++ b/hook.c
@@ -1,7 +1,12 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "advice.h"
+#include "gettext.h"
#include "hook.h"
+#include "path.h"
#include "run-command.h"
#include "config.h"
+#include "strbuf.h"
const char *find_hook(const char *name)
{
@@ -43,9 +48,9 @@ int hook_exists(const char *name)
}
static int pick_next_hook(struct child_process *cp,
- struct strbuf *out,
+ struct strbuf *out UNUSED,
void *pp_cb,
- void **pp_task_cb)
+ void **pp_task_cb UNUSED)
{
struct hook_cb_data *hook_cb = pp_cb;
const char *hook_path = hook_cb->hook_path;
@@ -55,6 +60,11 @@ static int pick_next_hook(struct child_process *cp,
cp->no_stdin = 1;
strvec_pushv(&cp->env, hook_cb->options->env.v);
+ /* reopen the file for stdin; run_command closes it. */
+ if (hook_cb->options->path_to_stdin) {
+ cp->no_stdin = 0;
+ cp->in = xopen(hook_cb->options->path_to_stdin, O_RDONLY);
+ }
cp->stdout_to_stderr = 1;
cp->trace2_hook_name = hook_cb->hook_name;
cp->dir = hook_cb->options->dir;
@@ -62,9 +72,6 @@ static int pick_next_hook(struct child_process *cp,
strvec_push(&cp->args, hook_path);
strvec_pushv(&cp->args, hook_cb->options->args.v);
- /* Provide context for errors if necessary */
- *pp_task_cb = (char *)hook_path;
-
/*
* This pick_next_hook() will be called again, we're only
* running one hook, so indicate that no more work will be
@@ -75,25 +82,21 @@ static int pick_next_hook(struct child_process *cp,
return 1;
}
-static int notify_start_failure(struct strbuf *out,
+static int notify_start_failure(struct strbuf *out UNUSED,
void *pp_cb,
- void *pp_task_cp)
+ void *pp_task_cp UNUSED)
{
struct hook_cb_data *hook_cb = pp_cb;
- const char *hook_path = pp_task_cp;
hook_cb->rc |= 1;
- strbuf_addf(out, _("Couldn't start hook '%s'\n"),
- hook_path);
-
return 1;
}
static int notify_hook_finished(int result,
- struct strbuf *out,
+ struct strbuf *out UNUSED,
void *pp_cb,
- void *pp_task_cb)
+ void *pp_task_cb UNUSED)
{
struct hook_cb_data *hook_cb = pp_cb;
struct run_hooks_opt *opt = hook_cb->options;
@@ -121,8 +124,20 @@ int run_hooks_opt(const char *hook_name, struct run_hooks_opt *options)
.options = options,
};
const char *const hook_path = find_hook(hook_name);
- int jobs = 1;
int ret = 0;
+ const struct run_process_parallel_opts opts = {
+ .tr2_category = "hook",
+ .tr2_label = hook_name,
+
+ .processes = 1,
+ .ungroup = 1,
+
+ .get_next_task = pick_next_hook,
+ .start_failure = notify_start_failure,
+ .task_finished = notify_hook_finished,
+
+ .data = &cb_data,
+ };
if (!options)
BUG("a struct run_hooks_opt must be provided to run_hooks");
@@ -144,14 +159,7 @@ int run_hooks_opt(const char *hook_name, struct run_hooks_opt *options)
cb_data.hook_path = abs_path.buf;
}
- run_processes_parallel_ungroup = 1;
- run_processes_parallel_tr2(jobs,
- pick_next_hook,
- notify_start_failure,
- notify_hook_finished,
- &cb_data,
- "hook",
- hook_name);
+ run_processes_parallel(&opts);
ret = cb_data.rc;
cleanup:
strbuf_release(&abs_path);
diff --git a/hook.h b/hook.h
index 4258b13..19ab9a5 100644
--- a/hook.h
+++ b/hook.h
@@ -30,6 +30,11 @@ struct run_hooks_opt
* was invoked.
*/
int *invoked_hook;
+
+ /**
+ * Path to file which should be piped to stdin for each hook.
+ */
+ const char *path_to_stdin;
};
#define RUN_HOOKS_OPT_INIT { \
diff --git a/http-backend.c b/http-backend.c
index 58b83a9..1ed1e29 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -1,5 +1,9 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "environment.h"
+#include "git-zlib.h"
+#include "hex.h"
+#include "path.h"
#include "repository.h"
#include "refs.h"
#include "pkt-line.h"
@@ -11,9 +15,10 @@
#include "url.h"
#include "strvec.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "protocol.h"
#include "date.h"
+#include "write-or-die.h"
static const char content_type[] = "Content-Type";
static const char content_length[] = "Content-Length";
@@ -33,6 +38,7 @@ struct rpc_service {
static struct rpc_service rpc_service[] = {
{ "upload-pack", "uploadpack", 1, 1 },
{ "receive-pack", "receivepack", 0, -1 },
+ { "upload-archive", "uploadarchive", 0, -1 },
};
static struct string_list *get_parameters(void)
@@ -505,7 +511,7 @@ static void run_service(const char **argv, int buffer_input)
}
static int show_text_ref(const char *name, const struct object_id *oid,
- int flag, void *cb_data)
+ int flag UNUSED, void *cb_data)
{
const char *name_nons = strip_namespace(name);
struct strbuf *buf = cb_data;
@@ -524,7 +530,7 @@ static int show_text_ref(const char *name, const struct object_id *oid,
return 0;
}
-static void get_info_refs(struct strbuf *hdr, char *arg)
+static void get_info_refs(struct strbuf *hdr, char *arg UNUSED)
{
const char *service_name = get_parameter("service");
struct strbuf buf = STRBUF_INIT;
@@ -553,7 +559,7 @@ static void get_info_refs(struct strbuf *hdr, char *arg)
} else {
select_getanyfile(hdr);
- for_each_namespaced_ref(show_text_ref, &buf);
+ for_each_namespaced_ref(NULL, show_text_ref, &buf);
send_strbuf(hdr, "text/plain", &buf);
}
strbuf_release(&buf);
@@ -578,7 +584,7 @@ static int show_head_ref(const char *refname, const struct object_id *oid,
return 0;
}
-static void get_head(struct strbuf *hdr, char *arg)
+static void get_head(struct strbuf *hdr, char *arg UNUSED)
{
struct strbuf buf = STRBUF_INIT;
@@ -588,7 +594,7 @@ static void get_head(struct strbuf *hdr, char *arg)
strbuf_release(&buf);
}
-static void get_info_packs(struct strbuf *hdr, char *arg)
+static void get_info_packs(struct strbuf *hdr, char *arg UNUSED)
{
size_t objdirlen = strlen(get_object_directory());
struct strbuf buf = STRBUF_INIT;
@@ -634,10 +640,15 @@ static void check_content_type(struct strbuf *hdr, const char *accepted_type)
static void service_rpc(struct strbuf *hdr, char *service_name)
{
- const char *argv[] = {NULL, "--stateless-rpc", ".", NULL};
+ struct strvec argv = STRVEC_INIT;
struct rpc_service *svc = select_service(hdr, service_name);
struct strbuf buf = STRBUF_INIT;
+ strvec_push(&argv, svc->name);
+ if (strcmp(service_name, "git-upload-archive"))
+ strvec_push(&argv, "--stateless-rpc");
+ strvec_push(&argv, ".");
+
strbuf_reset(&buf);
strbuf_addf(&buf, "application/x-git-%s-request", svc->name);
check_content_type(hdr, buf.buf);
@@ -650,9 +661,9 @@ static void service_rpc(struct strbuf *hdr, char *service_name)
end_headers(hdr);
- argv[0] = svc->name;
- run_service(argv, svc->buffer_input);
+ run_service(argv.v, svc->buffer_input);
strbuf_release(&buf);
+ strvec_clear(&argv);
}
static int dead;
@@ -718,6 +729,7 @@ static struct service_cmd {
{"GET", "/objects/pack/pack-[0-9a-f]{64}\\.idx$", get_idx_file},
{"POST", "/git-upload-pack$", service_rpc},
+ {"POST", "/git-upload-archive$", service_rpc},
{"POST", "/git-receive-pack$", service_rpc}
};
@@ -736,7 +748,7 @@ static int bad_request(struct strbuf *hdr, const struct service_cmd *c)
return 0;
}
-int cmd_main(int argc, const char **argv)
+int cmd_main(int argc UNUSED, const char **argv UNUSED)
{
char *method = getenv("REQUEST_METHOD");
const char *proto_header;
@@ -759,10 +771,14 @@ int cmd_main(int argc, const char **argv)
struct service_cmd *c = &services[i];
regex_t re;
regmatch_t out[1];
+ int ret;
if (regcomp(&re, c->pattern, REG_EXTENDED))
die("Bogus regex in service table: %s", c->pattern);
- if (!regexec(&re, dir, 1, out, 0)) {
+ ret = regexec(&re, dir, 1, out, 0);
+ regfree(&re);
+
+ if (!ret) {
size_t n;
if (strcmp(method, c->method))
@@ -774,7 +790,6 @@ int cmd_main(int argc, const char **argv)
dir[out[0].rm_so] = 0;
break;
}
- regfree(&re);
}
if (!cmd)
@@ -786,6 +801,7 @@ int cmd_main(int argc, const char **argv)
if (!getenv("GIT_HTTP_EXPORT_ALL") &&
access("git-daemon-export-ok", F_OK) )
not_found(&hdr, "Repository not exported: '%s'", dir);
+ free(dir);
http_config();
max_request_buffer = git_env_ulong("GIT_HTTP_MAX_REQUEST_BUFFER",
@@ -795,5 +811,6 @@ int cmd_main(int argc, const char **argv)
setenv(GIT_PROTOCOL_ENVIRONMENT, proto_header, 0);
cmd->imp(&hdr, cmd_arg);
+ free(cmd_arg);
return 0;
}
diff --git a/http-fetch.c b/http-fetch.c
index 31bc5c7..bec9498 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -1,10 +1,14 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
-#include "exec-cmd.h"
+#include "gettext.h"
+#include "hex.h"
#include "http.h"
#include "walker.h"
+#include "setup.h"
#include "strvec.h"
+#include "url.h"
#include "urlmatch.h"
+#include "trace2.h"
static const char http_fetch_usage[] = "git http-fetch "
"[-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin | --packfile=hash | commit-id] url";
@@ -137,6 +141,8 @@ int cmd_main(int argc, const char **argv)
if (nongit)
die(_("not a git repository"));
+ trace2_cmd_name("http-fetch");
+
git_config(git_default_config, NULL);
if (packfile) {
diff --git a/http-push.c b/http-push.c
index 5f4340a..1fe5122 100644
--- a/http-push.c
+++ b/http-push.c
@@ -1,19 +1,23 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "environment.h"
+#include "hex.h"
#include "repository.h"
#include "commit.h"
#include "tag.h"
#include "blob.h"
#include "http.h"
-#include "refs.h"
#include "diff.h"
#include "revision.h"
-#include "exec-cmd.h"
#include "remote.h"
#include "list-objects.h"
+#include "setup.h"
#include "sigchain.h"
#include "strvec.h"
+#include "tree.h"
+#include "tree-walk.h"
+#include "url.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "commit-reach.h"
#ifdef EXPAT_NEEDS_XMLPARSE_H
@@ -198,13 +202,13 @@ static void curl_setup_http(CURL *curl, const char *url,
const char *custom_req, struct buffer *buffer,
curl_write_callback write_fn)
{
- curl_easy_setopt(curl, CURLOPT_PUT, 1);
+ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_INFILE, buffer);
curl_easy_setopt(curl, CURLOPT_INFILESIZE, buffer->buf.len);
curl_easy_setopt(curl, CURLOPT_READFUNCTION, fread_buffer);
- curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctl_buffer);
- curl_easy_setopt(curl, CURLOPT_IOCTLDATA, buffer);
+ curl_easy_setopt(curl, CURLOPT_SEEKFUNCTION, seek_buffer);
+ curl_easy_setopt(curl, CURLOPT_SEEKDATA, buffer);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_fn);
curl_easy_setopt(curl, CURLOPT_NOBODY, 0);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, custom_req);
@@ -362,7 +366,8 @@ static void start_put(struct transfer_request *request)
ssize_t size;
git_zstream stream;
- unpacked = read_object_file(&request->obj->oid, &type, &len);
+ unpacked = repo_read_object_file(the_repository, &request->obj->oid,
+ &type, &len);
hdrlen = format_object_header(hdr, sizeof(hdr), type, len);
/* Set it up */
@@ -601,7 +606,7 @@ static void finish_request(struct transfer_request *request)
}
static int is_running_queue;
-static int fill_active_slot(void *unused)
+static int fill_active_slot(void *data UNUSED)
{
struct transfer_request *request;
@@ -777,7 +782,7 @@ static void handle_new_lock_ctx(struct xml_ctx *ctx, int tag_closed)
static void one_remote_ref(const char *refname);
static void
-xml_start_tag(void *userData, const char *name, const char **atts)
+xml_start_tag(void *userData, const char *name, const char **atts UNUSED)
{
struct xml_ctx *ctx = (struct xml_ctx *)userData;
const char *c = strchr(name, ':');
@@ -1302,7 +1307,7 @@ static struct object_list **process_tree(struct tree *tree,
obj->flags |= SEEN;
p = add_one_object(obj, p);
- init_tree_desc(&desc, tree->buffer, tree->size);
+ init_tree_desc(&desc, &tree->object.oid, tree->buffer, tree->size);
while (tree_entry(&desc, &entry))
switch (object_type(entry.mode)) {
@@ -1331,7 +1336,8 @@ static int get_delta(struct rev_info *revs, struct remote_lock *lock)
int count = 0;
while ((commit = get_revision(revs)) != NULL) {
- p = process_tree(get_commit_tree(commit), p);
+ p = process_tree(repo_get_commit_tree(the_repository, commit),
+ p);
commit->object.flags |= LOCAL;
if (!(commit->object.flags & UNINTERESTING))
count += add_send_request(&commit->object, lock);
@@ -1426,7 +1432,7 @@ static void one_remote_ref(const char *refname)
* Fetch a copy of the object if it doesn't exist locally - it
* may be required for updating server info later.
*/
- if (repo->can_update_info_refs && !has_object_file(&ref->old_oid)) {
+ if (repo->can_update_info_refs && !repo_has_object_file(the_repository, &ref->old_oid)) {
obj = lookup_unknown_object(the_repository, &ref->old_oid);
fprintf(stderr, " fetch %s for %s\n",
oid_to_hex(&ref->old_oid), refname);
@@ -1569,8 +1575,11 @@ static int verify_merge_base(struct object_id *head_oid, struct ref *remote)
struct commit *head = lookup_commit_or_die(head_oid, "HEAD");
struct commit *branch = lookup_commit_or_die(&remote->old_oid,
remote->name);
+ int ret = repo_in_merge_bases(the_repository, branch, head);
- return in_merge_bases(branch, head);
+ if (ret < 0)
+ exit(128);
+ return ret;
}
static int delete_remote_branch(const char *pattern, int force)
@@ -1627,14 +1636,14 @@ static int delete_remote_branch(const char *pattern, int force)
return error("Remote HEAD symrefs too deep");
if (is_null_oid(&head_oid))
return error("Unable to resolve remote HEAD");
- if (!has_object_file(&head_oid))
+ if (!repo_has_object_file(the_repository, &head_oid))
return error("Remote HEAD resolves to object %s\nwhich does not exist locally, perhaps you need to fetch?", oid_to_hex(&head_oid));
/* Remote branch must resolve to a known object */
if (is_null_oid(&remote_ref->old_oid))
return error("Unable to resolve remote branch %s",
remote_ref->name);
- if (!has_object_file(&remote_ref->old_oid))
+ if (!repo_has_object_file(the_repository, &remote_ref->old_oid))
return error("Remote branch %s resolves to object %s\nwhich does not exist locally, perhaps you need to fetch?", remote_ref->name, oid_to_hex(&remote_ref->old_oid));
/* Remote branch must be an ancestor of remote HEAD */
@@ -1845,6 +1854,7 @@ int cmd_main(int argc, const char **argv)
if (oideq(&ref->old_oid, &ref->peer_ref->new_oid)) {
if (push_verbosely)
+ /* stable plumbing output; do not modify or localize */
fprintf(stderr, "'%s': up-to-date\n", ref->name);
if (helper_status)
printf("ok %s up to date\n", ref->name);
@@ -1854,7 +1864,7 @@ int cmd_main(int argc, const char **argv)
if (!force_all &&
!is_null_oid(&ref->old_oid) &&
!ref->force) {
- if (!has_object_file(&ref->old_oid) ||
+ if (!repo_has_object_file(the_repository, &ref->old_oid) ||
!ref_newer(&ref->peer_ref->new_oid,
&ref->old_oid)) {
/*
@@ -1865,6 +1875,7 @@ int cmd_main(int argc, const char **argv)
* commits at the remote end and likely
* we were not up to date to begin with.
*/
+ /* stable plumbing output; do not modify or localize */
error("remote '%s' is not an ancestor of\n"
"local '%s'.\n"
"Maybe you are not up-to-date and "
diff --git a/http-walker.c b/http-walker.c
index b8f0f98..b395ef1 100644
--- a/http-walker.c
+++ b/http-walker.c
@@ -1,12 +1,12 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "repository.h"
-#include "commit.h"
+#include "hex.h"
#include "walker.h"
#include "http.h"
#include "list.h"
#include "transport.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
struct alt_base {
char *base;
@@ -52,8 +52,7 @@ static void fetch_alternates(struct walker *walker, const char *base);
static void process_object_response(void *callback_data);
-static void start_object_request(struct walker *walker,
- struct object_request *obj_req)
+static void start_object_request(struct object_request *obj_req)
{
struct active_request_slot *slot;
struct http_object_request *req;
@@ -110,7 +109,7 @@ static void process_object_response(void *callback_data)
obj_req->repo =
obj_req->repo->next;
release_http_object_request(obj_req->req);
- start_object_request(walker, obj_req);
+ start_object_request(obj_req);
return;
}
}
@@ -127,7 +126,7 @@ static void release_object_request(struct object_request *obj_req)
free(obj_req);
}
-static int fill_active_slot(struct walker *walker)
+static int fill_active_slot(void *data UNUSED)
{
struct object_request *obj_req;
struct list_head *pos, *tmp, *head = &object_queue_head;
@@ -135,10 +134,10 @@ static int fill_active_slot(struct walker *walker)
list_for_each_safe(pos, tmp, head) {
obj_req = list_entry(pos, struct object_request, node);
if (obj_req->state == WAITING) {
- if (has_object_file(&obj_req->oid))
+ if (repo_has_object_file(the_repository, &obj_req->oid))
obj_req->state = COMPLETE;
else {
- start_object_request(walker, obj_req);
+ start_object_request(obj_req);
return 1;
}
}
@@ -492,7 +491,7 @@ static int fetch_object(struct walker *walker, unsigned char *hash)
if (!obj_req)
return error("Couldn't find request for %s in the queue", hex);
- if (has_object_file(&obj_req->oid)) {
+ if (repo_has_object_file(the_repository, &obj_req->oid)) {
if (obj_req->req)
abort_http_object_request(obj_req->req);
abort_object_request(obj_req);
@@ -613,7 +612,7 @@ struct walker *get_http_walker(const char *url)
walker->cleanup = cleanup;
walker->data = data;
- add_fill_function(walker, (int (*)(void *)) fill_active_slot);
+ add_fill_function(NULL, fill_active_slot);
return walker;
}
diff --git a/http.c b/http.c
index 168ca30..3d80bd6 100644
--- a/http.c
+++ b/http.c
@@ -1,9 +1,9 @@
#include "git-compat-util.h"
#include "git-curl-compat.h"
+#include "hex.h"
#include "http.h"
#include "config.h"
#include "pack.h"
-#include "sideband.h"
#include "run-command.h"
#include "url.h"
#include "urlmatch.h"
@@ -11,11 +11,12 @@
#include "version.h"
#include "pkt-line.h"
#include "gettext.h"
+#include "trace.h"
#include "transport.h"
#include "packfile.h"
-#include "protocol.h"
#include "string-list.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
static struct trace_key trace_curl = TRACE_KEY_INIT(CURL);
static int trace_curl_data = 1;
@@ -39,6 +40,7 @@ static int curl_ssl_verify = -1;
static int curl_ssl_try;
static const char *curl_http_version = NULL;
static const char *ssl_cert;
+static const char *ssl_cert_type;
static const char *ssl_cipherlist;
static const char *ssl_version;
static struct {
@@ -58,6 +60,7 @@ static struct {
#endif
};
static const char *ssl_key;
+static const char *ssl_key_type;
static const char *ssl_capath;
static const char *curl_no_proxy;
#ifdef GIT_CURL_HAVE_CURLOPT_PINNEDPUBLICKEY
@@ -157,21 +160,19 @@ size_t fread_buffer(char *ptr, size_t eltsize, size_t nmemb, void *buffer_)
return size / eltsize;
}
-curlioerr ioctl_buffer(CURL *handle, int cmd, void *clientp)
+int seek_buffer(void *clientp, curl_off_t offset, int origin)
{
struct buffer *buffer = clientp;
- switch (cmd) {
- case CURLIOCMD_NOP:
- return CURLIOE_OK;
-
- case CURLIOCMD_RESTARTREAD:
- buffer->posn = 0;
- return CURLIOE_OK;
-
- default:
- return CURLIOE_UNKNOWNCMD;
+ if (origin != SEEK_SET)
+ BUG("seek_buffer only handles SEEK_SET");
+ if (offset < 0 || offset >= buffer->buf.len) {
+ error("curl seek would be outside of buffer");
+ return CURL_SEEKFUNC_FAIL;
}
+
+ buffer->posn = offset;
+ return CURL_SEEKFUNC_OK;
}
size_t fwrite_buffer(char *ptr, size_t eltsize, size_t nmemb, void *buffer_)
@@ -183,7 +184,117 @@ size_t fwrite_buffer(char *ptr, size_t eltsize, size_t nmemb, void *buffer_)
return nmemb;
}
-size_t fwrite_null(char *ptr, size_t eltsize, size_t nmemb, void *strbuf)
+/*
+ * A folded header continuation line starts with any number of spaces or
+ * horizontal tab characters (SP or HTAB) as per RFC 7230 section 3.2.
+ * It is not a continuation line if the line starts with any other character.
+ */
+static inline int is_hdr_continuation(const char *ptr, const size_t size)
+{
+ return size && (*ptr == ' ' || *ptr == '\t');
+}
+
+static size_t fwrite_wwwauth(char *ptr, size_t eltsize, size_t nmemb, void *p UNUSED)
+{
+ size_t size = eltsize * nmemb;
+ struct strvec *values = &http_auth.wwwauth_headers;
+ struct strbuf buf = STRBUF_INIT;
+ const char *val;
+ size_t val_len;
+
+ /*
+ * Header lines may not come NULL-terminated from libcurl so we must
+ * limit all scans to the maximum length of the header line, or leverage
+ * strbufs for all operations.
+ *
+ * In addition, it is possible that header values can be split over
+ * multiple lines as per RFC 7230. 'Line folding' has been deprecated
+ * but older servers may still emit them. A continuation header field
+ * value is identified as starting with a space or horizontal tab.
+ *
+ * The formal definition of a header field as given in RFC 7230 is:
+ *
+ * header-field = field-name ":" OWS field-value OWS
+ *
+ * field-name = token
+ * field-value = *( field-content / obs-fold )
+ * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
+ * field-vchar = VCHAR / obs-text
+ *
+ * obs-fold = CRLF 1*( SP / HTAB )
+ * ; obsolete line folding
+ * ; see Section 3.2.4
+ */
+
+ /* Start of a new WWW-Authenticate header */
+ if (skip_iprefix_mem(ptr, size, "www-authenticate:", &val, &val_len)) {
+ strbuf_add(&buf, val, val_len);
+
+ /*
+ * Strip the CRLF that should be present at the end of each
+ * field as well as any trailing or leading whitespace from the
+ * value.
+ */
+ strbuf_trim(&buf);
+
+ strvec_push(values, buf.buf);
+ http_auth.header_is_last_match = 1;
+ goto exit;
+ }
+
+ /*
+ * This line could be a continuation of the previously matched header
+ * field. If this is the case then we should append this value to the
+ * end of the previously consumed value.
+ */
+ if (http_auth.header_is_last_match && is_hdr_continuation(ptr, size)) {
+ /*
+ * Trim the CRLF and any leading or trailing from this line.
+ */
+ strbuf_add(&buf, ptr, size);
+ strbuf_trim(&buf);
+
+ /*
+ * At this point we should always have at least one existing
+ * value, even if it is empty. Do not bother appending the new
+ * value if this continuation header is itself empty.
+ */
+ if (!values->nr) {
+ BUG("should have at least one existing header value");
+ } else if (buf.len) {
+ char *prev = xstrdup(values->v[values->nr - 1]);
+
+ /* Join two non-empty values with a single space. */
+ const char *const sp = *prev ? " " : "";
+
+ strvec_pop(values);
+ strvec_pushf(values, "%s%s%s", prev, sp, buf.buf);
+ free(prev);
+ }
+
+ goto exit;
+ }
+
+ /* Not a continuation of a previously matched auth header line. */
+ http_auth.header_is_last_match = 0;
+
+ /*
+ * If this is a HTTP status line and not a header field, this signals
+ * a different HTTP response. libcurl writes all the output of all
+ * response headers of all responses, including redirects.
+ * We only care about the last HTTP request response's headers so clear
+ * the existing array.
+ */
+ if (skip_iprefix_mem(ptr, size, "http/", &val, &val_len))
+ strvec_clear(values);
+
+exit:
+ strbuf_release(&buf);
+ return size;
+}
+
+size_t fwrite_null(char *ptr UNUSED, size_t eltsize UNUSED, size_t nmemb,
+ void *data UNUSED)
{
return nmemb;
}
@@ -251,7 +362,8 @@ static void process_curl_messages(void)
}
}
-static int http_options(const char *var, const char *value, void *cb)
+static int http_options(const char *var, const char *value,
+ const struct config_context *ctx, void *data)
{
if (!strcmp("http.version", var)) {
return git_config_string(&curl_http_version, var, value);
@@ -266,8 +378,12 @@ static int http_options(const char *var, const char *value, void *cb)
return git_config_string(&ssl_version, var, value);
if (!strcmp("http.sslcert", var))
return git_config_pathname(&ssl_cert, var, value);
+ if (!strcmp("http.sslcerttype", var))
+ return git_config_string(&ssl_cert_type, var, value);
if (!strcmp("http.sslkey", var))
return git_config_pathname(&ssl_key, var, value);
+ if (!strcmp("http.sslkeytype", var))
+ return git_config_string(&ssl_key_type, var, value);
if (!strcmp("http.sslcapath", var))
return git_config_pathname(&ssl_capath, var, value);
if (!strcmp("http.sslcainfo", var))
@@ -297,21 +413,21 @@ static int http_options(const char *var, const char *value, void *cb)
}
if (!strcmp("http.minsessions", var)) {
- min_curl_sessions = git_config_int(var, value);
+ min_curl_sessions = git_config_int(var, value, ctx->kvi);
if (min_curl_sessions > 1)
min_curl_sessions = 1;
return 0;
}
if (!strcmp("http.maxrequests", var)) {
- max_requests = git_config_int(var, value);
+ max_requests = git_config_int(var, value, ctx->kvi);
return 0;
}
if (!strcmp("http.lowspeedlimit", var)) {
- curl_low_speed_limit = (long)git_config_int(var, value);
+ curl_low_speed_limit = (long)git_config_int(var, value, ctx->kvi);
return 0;
}
if (!strcmp("http.lowspeedtime", var)) {
- curl_low_speed_time = (long)git_config_int(var, value);
+ curl_low_speed_time = (long)git_config_int(var, value, ctx->kvi);
return 0;
}
@@ -347,7 +463,7 @@ static int http_options(const char *var, const char *value, void *cb)
}
if (!strcmp("http.postbuffer", var)) {
- http_post_buffer = git_config_ssize_t(var, value);
+ http_post_buffer = git_config_ssize_t(var, value, ctx->kvi);
if (http_post_buffer < 0)
warning(_("negative value for http.postBuffer; defaulting to %d"), LARGE_PACKET_MAX);
if (http_post_buffer < LARGE_PACKET_MAX)
@@ -418,7 +534,7 @@ static int http_options(const char *var, const char *value, void *cb)
}
/* Fall back on the default ones */
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, data);
}
static int curl_empty_auth_enabled(void)
@@ -560,13 +676,15 @@ static void set_curl_keepalive(CURL *c)
}
#endif
-static void redact_sensitive_header(struct strbuf *header)
+/* Return 1 if redactions have been made, 0 otherwise. */
+static int redact_sensitive_header(struct strbuf *header, size_t offset)
{
+ int ret = 0;
const char *sensitive_header;
if (trace_curl_redact &&
- (skip_iprefix(header->buf, "Authorization:", &sensitive_header) ||
- skip_iprefix(header->buf, "Proxy-Authorization:", &sensitive_header))) {
+ (skip_iprefix(header->buf + offset, "Authorization:", &sensitive_header) ||
+ skip_iprefix(header->buf + offset, "Proxy-Authorization:", &sensitive_header))) {
/* The first token is the type, which is OK to log */
while (isspace(*sensitive_header))
sensitive_header++;
@@ -575,8 +693,9 @@ static void redact_sensitive_header(struct strbuf *header)
/* Everything else is opaque and possibly sensitive */
strbuf_setlen(header, sensitive_header - header->buf);
strbuf_addstr(header, " <redacted>");
+ ret = 1;
} else if (trace_curl_redact &&
- skip_iprefix(header->buf, "Cookie:", &sensitive_header)) {
+ skip_iprefix(header->buf + offset, "Cookie:", &sensitive_header)) {
struct strbuf redacted_header = STRBUF_INIT;
const char *cookie;
@@ -612,6 +731,52 @@ static void redact_sensitive_header(struct strbuf *header)
strbuf_setlen(header, sensitive_header - header->buf);
strbuf_addbuf(header, &redacted_header);
+ ret = 1;
+ }
+ return ret;
+}
+
+static int match_curl_h2_trace(const char *line, const char **out)
+{
+ const char *p;
+
+ /*
+ * curl prior to 8.1.0 gives us:
+ *
+ * h2h3 [<header-name>: <header-val>]
+ *
+ * Starting in 8.1.0, the first token became just "h2".
+ */
+ if (skip_iprefix(line, "h2h3 [", out) ||
+ skip_iprefix(line, "h2 [", out))
+ return 1;
+
+ /*
+ * curl 8.3.0 uses:
+ * [HTTP/2] [<stream-id>] [<header-name>: <header-val>]
+ * where <stream-id> is numeric.
+ */
+ if (skip_iprefix(line, "[HTTP/2] [", &p)) {
+ while (isdigit(*p))
+ p++;
+ if (skip_prefix(p, "] [", out))
+ return 1;
+ }
+
+ return 0;
+}
+
+/* Redact headers in info */
+static void redact_sensitive_info_header(struct strbuf *header)
+{
+ const char *sensitive_header;
+
+ if (trace_curl_redact &&
+ match_curl_h2_trace(header->buf, &sensitive_header)) {
+ if (redact_sensitive_header(header, sensitive_header - header->buf)) {
+ /* redaction ate our closing bracket */
+ strbuf_addch(header, ']');
+ }
}
}
@@ -629,7 +794,7 @@ static void curl_dump_header(const char *text, unsigned char *ptr, size_t size,
for (header = headers; *header; header++) {
if (hide_sensitive_header)
- redact_sensitive_header(*header);
+ redact_sensitive_header(*header, 0);
strbuf_insertstr((*header), 0, text);
strbuf_insertstr((*header), strlen(text), ": ");
strbuf_rtrim((*header));
@@ -668,14 +833,28 @@ static void curl_dump_data(const char *text, unsigned char *ptr, size_t size)
strbuf_release(&out);
}
-static int curl_trace(CURL *handle, curl_infotype type, char *data, size_t size, void *userp)
+static void curl_dump_info(char *data, size_t size)
+{
+ struct strbuf buf = STRBUF_INIT;
+
+ strbuf_add(&buf, data, size);
+
+ redact_sensitive_info_header(&buf);
+ trace_printf_key(&trace_curl, "== Info: %s", buf.buf);
+
+ strbuf_release(&buf);
+}
+
+static int curl_trace(CURL *handle UNUSED, curl_infotype type,
+ char *data, size_t size,
+ void *userp UNUSED)
{
const char *text;
enum { NO_FILTER = 0, DO_FILTER = 1 };
switch (type) {
case CURLINFO_TEXT:
- trace_printf_key(&trace_curl, "== Info: %s", data);
+ curl_dump_info(data, size);
break;
case CURLINFO_HEADER_OUT:
text = "=> Send header";
@@ -731,20 +910,37 @@ void setup_curl_trace(CURL *handle)
curl_easy_setopt(handle, CURLOPT_DEBUGDATA, NULL);
}
-static long get_curl_allowed_protocols(int from_user)
+static void proto_list_append(struct strbuf *list, const char *proto)
{
- long allowed_protocols = 0;
+ if (!list)
+ return;
+ if (list->len)
+ strbuf_addch(list, ',');
+ strbuf_addstr(list, proto);
+}
- if (is_transport_allowed("http", from_user))
- allowed_protocols |= CURLPROTO_HTTP;
- if (is_transport_allowed("https", from_user))
- allowed_protocols |= CURLPROTO_HTTPS;
- if (is_transport_allowed("ftp", from_user))
- allowed_protocols |= CURLPROTO_FTP;
- if (is_transport_allowed("ftps", from_user))
- allowed_protocols |= CURLPROTO_FTPS;
+static long get_curl_allowed_protocols(int from_user, struct strbuf *list)
+{
+ long bits = 0;
- return allowed_protocols;
+ if (is_transport_allowed("http", from_user)) {
+ bits |= CURLPROTO_HTTP;
+ proto_list_append(list, "http");
+ }
+ if (is_transport_allowed("https", from_user)) {
+ bits |= CURLPROTO_HTTPS;
+ proto_list_append(list, "https");
+ }
+ if (is_transport_allowed("ftp", from_user)) {
+ bits |= CURLPROTO_FTP;
+ proto_list_append(list, "ftp");
+ }
+ if (is_transport_allowed("ftps", from_user)) {
+ bits |= CURLPROTO_FTPS;
+ proto_list_append(list, "ftps");
+ }
+
+ return bits;
}
#ifdef GIT_CURL_HAVE_CURL_HTTP_VERSION_2
@@ -854,10 +1050,14 @@ static CURL *get_curl_handle(void)
if (ssl_cert)
curl_easy_setopt(result, CURLOPT_SSLCERT, ssl_cert);
+ if (ssl_cert_type)
+ curl_easy_setopt(result, CURLOPT_SSLCERTTYPE, ssl_cert_type);
if (has_cert_password())
curl_easy_setopt(result, CURLOPT_KEYPASSWD, cert_auth.password);
if (ssl_key)
curl_easy_setopt(result, CURLOPT_SSLKEY, ssl_key);
+ if (ssl_key_type)
+ curl_easy_setopt(result, CURLOPT_SSLKEYTYPE, ssl_key_type);
if (ssl_capath)
curl_easy_setopt(result, CURLOPT_CAPATH, ssl_capath);
#ifdef GIT_CURL_HAVE_CURLOPT_PINNEDPUBLICKEY
@@ -888,10 +1088,26 @@ static CURL *get_curl_handle(void)
curl_easy_setopt(result, CURLOPT_MAXREDIRS, 20);
curl_easy_setopt(result, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL);
+
+#ifdef GIT_CURL_HAVE_CURLOPT_PROTOCOLS_STR
+ {
+ struct strbuf buf = STRBUF_INIT;
+
+ get_curl_allowed_protocols(0, &buf);
+ curl_easy_setopt(result, CURLOPT_REDIR_PROTOCOLS_STR, buf.buf);
+ strbuf_reset(&buf);
+
+ get_curl_allowed_protocols(-1, &buf);
+ curl_easy_setopt(result, CURLOPT_PROTOCOLS_STR, buf.buf);
+ strbuf_release(&buf);
+ }
+#else
curl_easy_setopt(result, CURLOPT_REDIR_PROTOCOLS,
- get_curl_allowed_protocols(0));
+ get_curl_allowed_protocols(0, NULL));
curl_easy_setopt(result, CURLOPT_PROTOCOLS,
- get_curl_allowed_protocols(-1));
+ get_curl_allowed_protocols(-1, NULL));
+#endif
+
if (getenv("GIT_CURL_VERBOSE"))
http_trace_curl_no_data();
setup_curl_trace(result);
@@ -1076,7 +1292,9 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
curl_ssl_verify = 0;
set_from_env(&ssl_cert, "GIT_SSL_CERT");
+ set_from_env(&ssl_cert_type, "GIT_SSL_CERT_TYPE");
set_from_env(&ssl_key, "GIT_SSL_KEY");
+ set_from_env(&ssl_key_type, "GIT_SSL_KEY_TYPE");
set_from_env(&ssl_capath, "GIT_SSL_CAPATH");
set_from_env(&ssl_cainfo, "GIT_SSL_CAINFO");
@@ -1234,6 +1452,7 @@ struct active_request_slot *get_active_slot(void)
curl_easy_setopt(slot->curl, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, NULL);
curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDS, NULL);
+ curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE, -1L);
curl_easy_setopt(slot->curl, CURLOPT_UPLOAD, 0);
curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1);
curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 1);
@@ -1682,7 +1901,7 @@ static void write_accept_language(struct strbuf *buf)
* MAX_DECIMAL_PLACES must not be larger than 3. If it is larger than
* that, q-value will be smaller than 0.001, the minimum q-value the
* HTTP specification allows. See
- * http://tools.ietf.org/html/rfc7231#section-5.3.1 for q-value.
+ * https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.1 for q-value.
*/
const int MAX_DECIMAL_PLACES = 3;
const int MAX_LANGUAGE_TAGS = 1000;
@@ -1775,7 +1994,7 @@ static void write_accept_language(struct strbuf *buf)
* LANGUAGE= LANG=en_US.UTF-8 -> "Accept-Language: en-US, *; q=0.1"
* LANGUAGE= LANG=C -> ""
*/
-static const char *get_accept_language(void)
+const char *http_get_accept_language_header(void)
{
if (!cached_accept_language) {
struct strbuf buf = STRBUF_INIT;
@@ -1829,7 +2048,9 @@ static int http_request(const char *url,
fwrite_buffer);
}
- accept_language = get_accept_language();
+ curl_easy_setopt(slot->curl, CURLOPT_HEADERFUNCTION, fwrite_wwwauth);
+
+ accept_language = http_get_accept_language_header();
if (accept_language)
headers = curl_slist_append(headers, accept_language);
diff --git a/http.h b/http.h
index ba303cf..3af19a8 100644
--- a/http.h
+++ b/http.h
@@ -1,14 +1,15 @@
#ifndef HTTP_H
#define HTTP_H
-#include "cache.h"
+struct packed_git;
+
+#include "git-zlib.h"
#include <curl/curl.h>
#include <curl/easy.h>
#include "strbuf.h"
#include "remote.h"
-#include "url.h"
#define DEFAULT_MAX_REQUESTS 5
@@ -40,7 +41,7 @@ struct buffer {
size_t fread_buffer(char *ptr, size_t eltsize, size_t nmemb, void *strbuf);
size_t fwrite_buffer(char *ptr, size_t eltsize, size_t nmemb, void *strbuf);
size_t fwrite_null(char *ptr, size_t eltsize, size_t nmemb, void *strbuf);
-curlioerr ioctl_buffer(CURL *handle, int cmd, void *clientp);
+int seek_buffer(void *clientp, curl_off_t offset, int origin);
/* Slot lifecycle functions */
struct active_request_slot *get_active_slot(void);
@@ -178,6 +179,9 @@ int http_fetch_ref(const char *base, struct ref *ref);
int http_get_info_packs(const char *base_url,
struct packed_git **packs_head);
+/* Helper for getting Accept-Language header */
+const char *http_get_accept_language_header(void);
+
struct http_pack_request {
char *url;
diff --git a/ident.c b/ident.c
index 89ca5b4..cc7afdb 100644
--- a/ident.c
+++ b/ident.c
@@ -5,9 +5,13 @@
*
* Copyright (C) 2005 Linus Torvalds
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "ident.h"
#include "config.h"
#include "date.h"
+#include "gettext.h"
+#include "mailmap.h"
+#include "strbuf.h"
static struct strbuf git_default_name = STRBUF_INIT;
static struct strbuf git_default_email = STRBUF_INIT;
@@ -199,7 +203,6 @@ void reset_ident_date(void)
static int crud(unsigned char c)
{
return c <= 32 ||
- c == '.' ||
c == ',' ||
c == ':' ||
c == ';' ||
@@ -346,6 +349,79 @@ person_only:
return 0;
}
+/*
+ * Returns the difference between the new and old length of the ident line.
+ */
+static ssize_t rewrite_ident_line(const char *person, size_t len,
+ struct strbuf *buf,
+ struct string_list *mailmap)
+{
+ size_t namelen, maillen;
+ const char *name;
+ const char *mail;
+ struct ident_split ident;
+
+ if (split_ident_line(&ident, person, len))
+ return 0;
+
+ mail = ident.mail_begin;
+ maillen = ident.mail_end - ident.mail_begin;
+ name = ident.name_begin;
+ namelen = ident.name_end - ident.name_begin;
+
+ if (map_user(mailmap, &mail, &maillen, &name, &namelen)) {
+ struct strbuf namemail = STRBUF_INIT;
+ size_t newlen;
+
+ strbuf_addf(&namemail, "%.*s <%.*s>",
+ (int)namelen, name, (int)maillen, mail);
+
+ strbuf_splice(buf, ident.name_begin - buf->buf,
+ ident.mail_end - ident.name_begin + 1,
+ namemail.buf, namemail.len);
+ newlen = namemail.len;
+
+ strbuf_release(&namemail);
+
+ return newlen - (ident.mail_end - ident.name_begin);
+ }
+
+ return 0;
+}
+
+void apply_mailmap_to_header(struct strbuf *buf, const char **header,
+ struct string_list *mailmap)
+{
+ size_t buf_offset = 0;
+
+ if (!mailmap)
+ return;
+
+ for (;;) {
+ const char *person, *line;
+ size_t i;
+ int found_header = 0;
+
+ line = buf->buf + buf_offset;
+ if (!*line || *line == '\n')
+ return; /* End of headers */
+
+ for (i = 0; header[i]; i++)
+ if (skip_prefix(line, header[i], &person)) {
+ const char *endp = strchrnul(person, '\n');
+ found_header = 1;
+ buf_offset += endp - line;
+ buf_offset += rewrite_ident_line(person, endp - person, buf, mailmap);
+ break;
+ }
+
+ if (!found_header) {
+ buf_offset = strchrnul(line, '\n') - buf->buf;
+ if (buf->buf[buf_offset] == '\n')
+ buf_offset++;
+ }
+ }
+}
static void ident_env_hint(enum want_ident whose_ident)
{
@@ -594,7 +670,9 @@ static int set_ident(const char *var, const char *value)
return 0;
}
-int git_ident_config(const char *var, const char *value, void *data)
+int git_ident_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *data UNUSED)
{
if (!strcmp(var, "user.useconfigonly")) {
ident_use_config_only = git_config_bool(var, value);
diff --git a/ident.h b/ident.h
new file mode 100644
index 0000000..6a79feb
--- /dev/null
+++ b/ident.h
@@ -0,0 +1,69 @@
+#ifndef IDENT_H
+#define IDENT_H
+
+#include "string-list.h"
+
+struct ident_split {
+ const char *name_begin;
+ const char *name_end;
+ const char *mail_begin;
+ const char *mail_end;
+ const char *date_begin;
+ const char *date_end;
+ const char *tz_begin;
+ const char *tz_end;
+};
+
+#define IDENT_STRICT 1
+#define IDENT_NO_DATE 2
+#define IDENT_NO_NAME 4
+
+enum want_ident {
+ WANT_BLANK_IDENT,
+ WANT_AUTHOR_IDENT,
+ WANT_COMMITTER_IDENT
+};
+
+const char *ident_default_name(void);
+const char *ident_default_email(void);
+/*
+ * Prepare an ident to fall back on if the user didn't configure it.
+ */
+void prepare_fallback_ident(const char *name, const char *email);
+void reset_ident_date(void);
+/*
+ * Signals an success with 0, but time part of the result may be NULL
+ * if the input lacks timestamp and zone
+ */
+int split_ident_line(struct ident_split *, const char *, int);
+
+/*
+ * Given a commit or tag object buffer and the commit or tag headers, replaces
+ * the idents in the headers with their canonical versions using the mailmap mechanism.
+ */
+void apply_mailmap_to_header(struct strbuf *, const char **, struct string_list *);
+
+/*
+ * Compare split idents for equality or strict ordering. Note that we
+ * compare only the ident part of the line, ignoring any timestamp.
+ *
+ * Because there are two fields, we must choose one as the primary key; we
+ * currently arbitrarily pick the email.
+ */
+int ident_cmp(const struct ident_split *, const struct ident_split *);
+
+const char *git_author_info(int);
+const char *git_committer_info(int);
+const char *fmt_ident(const char *name, const char *email,
+ enum want_ident whose_ident,
+ const char *date_str, int);
+const char *fmt_name(enum want_ident);
+
+int committer_ident_sufficiently_given(void);
+int author_ident_sufficiently_given(void);
+
+struct config_context;
+int git_ident_config(const char *, const char *, const struct config_context *,
+ void *);
+
+#endif
diff --git a/imap-send.c b/imap-send.c
index a50af56..4caa866 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -18,15 +18,17 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "credential.h"
-#include "exec-cmd.h"
+#include "gettext.h"
#include "run-command.h"
#include "parse-options.h"
+#include "setup.h"
+#include "strbuf.h"
#if defined(NO_OPENSSL) && !defined(HAVE_OPENSSL_CSPRNG)
typedef void *SSL;
#endif
@@ -66,9 +68,6 @@ static void imap_warn(const char *, ...);
static char *next_arg(char **);
-__attribute__((format (printf, 3, 4)))
-static int nfsnprintf(char *buf, int blen, const char *fmt, ...);
-
static int nfvasprintf(char **strp, const char *fmt, va_list ap)
{
int len;
@@ -133,12 +132,10 @@ struct imap_store {
};
struct imap_cmd_cb {
- int (*cont)(struct imap_store *ctx, struct imap_cmd *cmd, const char *prompt);
- void (*done)(struct imap_store *ctx, struct imap_cmd *cmd, int response);
+ int (*cont)(struct imap_store *ctx, const char *prompt);
void *ctx;
char *data;
int dlen;
- int uid;
};
struct imap_cmd {
@@ -205,10 +202,14 @@ static void socket_perror(const char *func, struct imap_socket *sock, int ret)
else
fprintf(stderr, "%s: unexpected EOF\n", func);
}
+ /* mark as used to appease -Wunused-parameter with NO_OPENSSL */
+ (void)sock;
}
#ifdef NO_OPENSSL
-static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int verify)
+static int ssl_socket_connect(struct imap_socket *sock UNUSED,
+ int use_tls_only UNUSED,
+ int verify UNUSED)
{
fprintf(stderr, "SSL requested but SSL support not compiled in\n");
return -1;
@@ -496,19 +497,6 @@ static char *next_arg(char **s)
return ret;
}
-__attribute__((format (printf, 3, 4)))
-static int nfsnprintf(char *buf, int blen, const char *fmt, ...)
-{
- int ret;
- va_list va;
-
- va_start(va, fmt);
- if (blen <= 0 || (unsigned)(ret = vsnprintf(buf, blen, fmt, va)) >= (unsigned)blen)
- BUG("buffer too small. Please report a bug.");
- va_end(va);
- return ret;
-}
-
static struct imap_cmd *issue_imap_cmd(struct imap_store *ctx,
struct imap_cmd_cb *cb,
const char *fmt, va_list ap)
@@ -531,11 +519,11 @@ static struct imap_cmd *issue_imap_cmd(struct imap_store *ctx,
get_cmd_result(ctx, NULL);
if (!cmd->cb.data)
- bufl = nfsnprintf(buf, sizeof(buf), "%d %s\r\n", cmd->tag, cmd->cmd);
+ bufl = xsnprintf(buf, sizeof(buf), "%d %s\r\n", cmd->tag, cmd->cmd);
else
- bufl = nfsnprintf(buf, sizeof(buf), "%d %s{%d%s}\r\n",
- cmd->tag, cmd->cmd, cmd->cb.dlen,
- CAP(LITERALPLUS) ? "+" : "");
+ bufl = xsnprintf(buf, sizeof(buf), "%d %s{%d%s}\r\n",
+ cmd->tag, cmd->cmd, cmd->cb.dlen,
+ CAP(LITERALPLUS) ? "+" : "");
if (0 < verbosity) {
if (imap->num_in_progress)
@@ -782,7 +770,7 @@ static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd)
if (n != (int)cmdp->cb.dlen)
return RESP_BAD;
} else if (cmdp->cb.cont) {
- if (cmdp->cb.cont(ctx, cmdp, cmd))
+ if (cmdp->cb.cont(ctx, cmd))
return RESP_BAD;
} else {
fprintf(stderr, "IMAP error: unexpected command continuation request\n");
@@ -824,8 +812,6 @@ static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd)
}
if ((resp2 = parse_response_code(ctx, &cmdp->cb, cmd)) > resp)
resp = resp2;
- if (cmdp->cb.done)
- cmdp->cb.done(ctx, cmdp, resp);
free(cmdp->cb.data);
free(cmdp->cmd);
free(cmdp);
@@ -857,7 +843,7 @@ static void imap_close_store(struct imap_store *ctx)
/*
* hexchar() and cram() functions are based on the code from the isync
- * project (http://isync.sf.net/).
+ * project (https://isync.sourceforge.io/).
*/
static char hexchar(unsigned int b)
{
@@ -905,7 +891,9 @@ static char *cram(const char *challenge_64, const char *user, const char *pass)
#else
-static char *cram(const char *challenge_64, const char *user, const char *pass)
+static char *cram(const char *challenge_64 UNUSED,
+ const char *user UNUSED,
+ const char *pass UNUSED)
{
die("If you want to use CRAM-MD5 authenticate method, "
"you have to build git-imap-send with OpenSSL library.");
@@ -913,7 +901,7 @@ static char *cram(const char *challenge_64, const char *user, const char *pass)
#endif
-static int auth_cram_md5(struct imap_store *ctx, struct imap_cmd *cmd, const char *prompt)
+static int auth_cram_md5(struct imap_store *ctx, const char *prompt)
{
int ret;
char *response;
@@ -1319,7 +1307,8 @@ static int split_msg(struct strbuf *all_msgs, struct strbuf *msg, int *ofs)
return 1;
}
-static int git_imap_config(const char *var, const char *val, void *cb)
+static int git_imap_config(const char *var, const char *val,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp("imap.sslverify", var))
@@ -1337,10 +1326,10 @@ static int git_imap_config(const char *var, const char *val, void *cb)
else if (!strcmp("imap.authmethod", var))
return git_config_string(&server.auth_method, var, val);
else if (!strcmp("imap.port", var))
- server.port = git_config_int(var, val);
+ server.port = git_config_int(var, val, ctx->kvi);
else if (!strcmp("imap.host", var)) {
if (!val) {
- git_die_config("imap.host", "Missing value for 'imap.host'");
+ return config_error_nonbool(var);
} else {
if (starts_with(val, "imap:"))
val += 5;
@@ -1353,7 +1342,7 @@ static int git_imap_config(const char *var, const char *val, void *cb)
server.host = xstrdup(val);
}
} else
- return git_default_config(var, val, cb);
+ return git_default_config(var, val, ctx, cb);
return 0;
}
@@ -1411,16 +1400,16 @@ static CURL *setup_curl(struct imap_server_conf *srvc, struct credential *cred)
if (!curl)
die("curl_easy_init failed");
- server_fill_credential(&server, cred);
- curl_easy_setopt(curl, CURLOPT_USERNAME, server.user);
- curl_easy_setopt(curl, CURLOPT_PASSWORD, server.pass);
+ server_fill_credential(srvc, cred);
+ curl_easy_setopt(curl, CURLOPT_USERNAME, srvc->user);
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, srvc->pass);
- strbuf_addstr(&path, server.use_ssl ? "imaps://" : "imap://");
- strbuf_addstr(&path, server.host);
+ strbuf_addstr(&path, srvc->use_ssl ? "imaps://" : "imap://");
+ strbuf_addstr(&path, srvc->host);
if (!path.len || path.buf[path.len - 1] != '/')
strbuf_addch(&path, '/');
- uri_encoded_folder = curl_easy_escape(curl, server.folder, 0);
+ uri_encoded_folder = curl_easy_escape(curl, srvc->folder, 0);
if (!uri_encoded_folder)
die("failed to encode server folder");
strbuf_addstr(&path, uri_encoded_folder);
@@ -1428,25 +1417,25 @@ static CURL *setup_curl(struct imap_server_conf *srvc, struct credential *cred)
curl_easy_setopt(curl, CURLOPT_URL, path.buf);
strbuf_release(&path);
- curl_easy_setopt(curl, CURLOPT_PORT, server.port);
+ curl_easy_setopt(curl, CURLOPT_PORT, srvc->port);
- if (server.auth_method) {
+ if (srvc->auth_method) {
#ifndef GIT_CURL_HAVE_CURLOPT_LOGIN_OPTIONS
warning("No LOGIN_OPTIONS support in this cURL version");
#else
struct strbuf auth = STRBUF_INIT;
strbuf_addstr(&auth, "AUTH=");
- strbuf_addstr(&auth, server.auth_method);
+ strbuf_addstr(&auth, srvc->auth_method);
curl_easy_setopt(curl, CURLOPT_LOGIN_OPTIONS, auth.buf);
strbuf_release(&auth);
#endif
}
- if (!server.use_ssl)
+ if (!srvc->use_ssl)
curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_TRY);
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, server.ssl_verify);
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, server.ssl_verify);
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, srvc->ssl_verify);
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, srvc->ssl_verify);
curl_easy_setopt(curl, CURLOPT_READFUNCTION, fread_buffer);
diff --git a/json-writer.c b/json-writer.c
index f1cfd8f..005c820 100644
--- a/json-writer.c
+++ b/json-writer.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "json-writer.h"
void jw_init(struct json_writer *jw)
diff --git a/json-writer.h b/json-writer.h
index 209355e..04413bd 100644
--- a/json-writer.h
+++ b/json-writer.h
@@ -3,8 +3,8 @@
/*
* JSON data structures are defined at:
- * [1] http://www.ietf.org/rfc/rfc7159.txt
- * [2] http://json.org/
+ * [1] https://www.ietf.org/rfc/rfc7159.txt
+ * [2] https://www.json.org/
*
* The JSON-writer API allows one to build JSON data structures using a
* simple wrapper around a "struct strbuf" buffer. It is intended as a
diff --git a/khash.h b/khash.h
index cb79bf8..ff88163 100644
--- a/khash.h
+++ b/khash.h
@@ -26,8 +26,7 @@
#ifndef __AC_KHASH_H
#define __AC_KHASH_H
-#include "cache.h"
-#include "hashmap.h"
+#include "hash.h"
#define AC_VERSION_KHASH_H "0.2.8"
@@ -62,7 +61,7 @@ static inline khint_t __ac_X31_hash_string(const char *s)
static const double __ac_HASH_UPPER = 0.77;
#define __KHASH_TYPE(name, khkey_t, khval_t) \
- typedef struct { \
+ typedef struct kh_##name { \
khint_t n_buckets, size, n_occupied, upper_bound; \
khint32_t *flags; \
khkey_t *keys; \
diff --git a/kwset.c b/kwset.c
index 08aadf0..695e47b 100644
--- a/kwset.c
+++ b/kwset.c
@@ -18,7 +18,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, see <https://www.gnu.org/licenses/>. */
/* Written August 1989 by Mike Haertel.
The author may be reached (Email) at the address mike@ai.mit.edu,
@@ -32,7 +32,7 @@
String Matching: An Aid to Bibliographic Search," CACM June 1975,
Vol. 18, No. 6, which describes the failure function used below. */
-#include "cache.h"
+#include "git-compat-util.h"
#include "kwset.h"
#include "compat/obstack.h"
@@ -49,6 +49,42 @@ static void *obstack_chunk_alloc(long size)
#define U(c) ((unsigned char) (c))
+/* For case-insensitive kwset */
+const unsigned char tolower_trans_tbl[256] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+ ' ', '!', '"', '#', '$', '%', '&', 0x27,
+ '(', ')', '*', '+', ',', '-', '.', '/',
+ '0', '1', '2', '3', '4', '5', '6', '7',
+ '8', '9', ':', ';', '<', '=', '>', '?',
+ '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
+ 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
+ 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
+ 'x', 'y', 'z', '[', 0x5c, ']', '^', '_',
+ '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
+ 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
+ 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
+ 'x', 'y', 'z', '{', '|', '}', '~', 0x7f,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
+ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
+ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
+ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
+ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
+ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
+ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
+};
+
/* Balanced tree of edges and labels leaving a given trie node. */
struct tree
{
diff --git a/kwset.h b/kwset.h
index f50ecae..c722664 100644
--- a/kwset.h
+++ b/kwset.h
@@ -20,12 +20,14 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, see <https://www.gnu.org/licenses/>. */
/* Written August 1989 by Mike Haertel.
The author may be reached (Email) at the address mike@ai.mit.edu,
or (US mail) as Mike Haertel c/o Free Software Foundation. */
+extern const unsigned char tolower_trans_tbl[256];
+
struct kwsmatch
{
int index; /* Index number of matching keyword. */
diff --git a/levenshtein.c b/levenshtein.c
index d263269..fd8026f 100644
--- a/levenshtein.c
+++ b/levenshtein.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "levenshtein.h"
/*
diff --git a/line-log.c b/line-log.c
index 51d9331..8ff6ccb 100644
--- a/line-log.c
+++ b/line-log.c
@@ -1,21 +1,22 @@
#include "git-compat-util.h"
+#include "diffcore.h"
#include "line-range.h"
-#include "cache.h"
+#include "hex.h"
#include "tag.h"
-#include "blob.h"
#include "tree.h"
#include "diff.h"
#include "commit.h"
#include "decorate.h"
+#include "repository.h"
#include "revision.h"
#include "xdiff-interface.h"
#include "strbuf.h"
#include "log-tree.h"
-#include "graph.h"
-#include "userdiff.h"
#include "line-log.h"
+#include "setup.h"
#include "strvec.h"
#include "bloom.h"
+#include "tree-walk.h"
static void range_set_grow(struct range_set *rs, size_t extra)
{
@@ -1089,10 +1090,8 @@ static struct diff_filepair *diff_filepair_dup(struct diff_filepair *pair)
static void free_diffqueues(int n, struct diff_queue_struct *dq)
{
- int i, j;
- for (i = 0; i < n; i++)
- for (j = 0; j < dq[i].nr; j++)
- diff_free_filepair(dq[i].queue[j]);
+ for (int i = 0; i < n; i++)
+ diff_free_queue(&dq[i]);
free(dq);
}
@@ -1195,6 +1194,7 @@ static int process_ranges_ordinary_commit(struct rev_info *rev, struct commit *c
if (parent)
add_line_range(rev, parent, parent_range);
free_line_log_data(parent_range);
+ diff_free_queue(&queue);
return changed;
}
@@ -1282,7 +1282,8 @@ int line_log_process_ranges_arbitrary_commit(struct rev_info *rev, struct commit
return changed;
}
-static enum rewrite_result line_log_rewrite_one(struct rev_info *rev, struct commit **pp)
+static enum rewrite_result line_log_rewrite_one(struct rev_info *rev UNUSED,
+ struct commit **pp)
{
for (;;) {
struct commit *p = *pp;
@@ -1324,3 +1325,13 @@ int line_log_filter(struct rev_info *rev)
return 0;
}
+
+static void free_void_line_log_data(void *data)
+{
+ free_line_log_data(data);
+}
+
+void line_log_free(struct rev_info *rev)
+{
+ clear_decoration(&rev->line_log_data, free_void_line_log_data);
+}
diff --git a/line-log.h b/line-log.h
index 82ae8d9..e9dadbc 100644
--- a/line-log.h
+++ b/line-log.h
@@ -1,10 +1,9 @@
#ifndef LINE_LOG_H
#define LINE_LOG_H
-#include "diffcore.h"
-
struct rev_info;
struct commit;
+struct string_list;
/* A range [start,end]. Lines are numbered starting at 0, and the
* ranges include start but exclude end. */
@@ -59,4 +58,6 @@ int line_log_process_ranges_arbitrary_commit(struct rev_info *rev,
int line_log_print(struct rev_info *rev, struct commit *commit);
+void line_log_free(struct rev_info *rev);
+
#endif /* LINE_LOG_H */
diff --git a/line-range.c b/line-range.c
index 955a8a9..60f0e5a 100644
--- a/line-range.c
+++ b/line-range.c
@@ -1,7 +1,6 @@
#include "git-compat-util.h"
#include "line-range.h"
#include "xdiff-interface.h"
-#include "strbuf.h"
#include "userdiff.h"
/*
@@ -135,7 +134,7 @@ static const char *find_funcname_matching_regexp(xdemitconf_t *xecfg, const char
{
int reg_error;
regmatch_t match[1];
- while (1) {
+ while (*start) {
const char *bol, *eol;
reg_error = regexec(regexp, start, 1, match, 0);
if (reg_error == REG_NOMATCH)
@@ -148,8 +147,8 @@ static const char *find_funcname_matching_regexp(xdemitconf_t *xecfg, const char
/* determine extent of line matched */
bol = start+match[0].rm_so;
eol = start+match[0].rm_eo;
- while (bol > start && *bol != '\n')
- bol--;
+ while (bol > start && *--bol != '\n')
+ ; /* nothing */
if (*bol == '\n')
bol++;
while (*eol && *eol != '\n')
@@ -161,6 +160,7 @@ static const char *find_funcname_matching_regexp(xdemitconf_t *xecfg, const char
return bol;
start = eol;
}
+ return NULL;
}
static const char *parse_range_funcname(
diff --git a/linear-assignment.c b/linear-assignment.c
index ecffc09..5416cbc 100644
--- a/linear-assignment.c
+++ b/linear-assignment.c
@@ -3,7 +3,7 @@
* algorithm for dense and sparse linear assignment problems</i>. Computing,
* 38(4), 325-340.
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "linear-assignment.h"
#define COST(column, row) cost[(column) + column_count * (row)]
diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c
index 4b25287..c5f363c 100644
--- a/list-objects-filter-options.c
+++ b/list-objects-filter-options.c
@@ -1,14 +1,11 @@
-#include "cache.h"
-#include "commit.h"
+#include "git-compat-util.h"
#include "config.h"
-#include "revision.h"
-#include "strvec.h"
-#include "list-objects.h"
-#include "list-objects-filter.h"
+#include "gettext.h"
#include "list-objects-filter-options.h"
#include "promisor-remote.h"
#include "trace.h"
#include "url.h"
+#include "parse-options.h"
static int parse_combine_filter(
struct list_objects_filter_options *filter_options,
@@ -108,7 +105,7 @@ int gently_parse_list_objects_filter(
strbuf_addf(errbuf, _("invalid filter-spec '%s'"), arg);
- memset(filter_options, 0, sizeof(*filter_options));
+ list_objects_filter_init(filter_options);
return 1;
}
@@ -143,6 +140,7 @@ static int parse_combine_subfilter(
ALLOC_GROW_BY(filter_options->sub, filter_options->sub_nr, 1,
filter_options->sub_alloc);
+ list_objects_filter_init(&filter_options->sub[new_index]);
decoded = url_percent_decode(subspec->buf);
@@ -187,10 +185,8 @@ static int parse_combine_filter(
cleanup:
strbuf_list_free(subspecs);
- if (result) {
+ if (result)
list_objects_filter_release(filter_options);
- memset(filter_options, 0, sizeof(*filter_options));
- }
return result;
}
@@ -204,10 +200,10 @@ static int allow_unencoded(char ch)
static void filter_spec_append_urlencode(
struct list_objects_filter_options *filter, const char *raw)
{
- struct strbuf buf = STRBUF_INIT;
- strbuf_addstr_urlencode(&buf, raw, allow_unencoded);
- trace_printf("Add to combine filter-spec: %s\n", buf.buf);
- string_list_append(&filter->filter_spec, strbuf_detach(&buf, NULL));
+ size_t orig_len = filter->filter_spec.len;
+ strbuf_addstr_urlencode(&filter->filter_spec, raw, allow_unencoded);
+ trace_printf("Add to combine filter-spec: %s\n",
+ filter->filter_spec.buf + orig_len);
}
/*
@@ -225,13 +221,13 @@ static void transform_to_combine_type(
struct list_objects_filter_options *sub_array =
xcalloc(initial_sub_alloc, sizeof(*sub_array));
sub_array[0] = *filter_options;
- memset(filter_options, 0, sizeof(*filter_options));
+ list_objects_filter_init(filter_options);
filter_options->sub = sub_array;
filter_options->sub_alloc = initial_sub_alloc;
}
filter_options->sub_nr = 1;
filter_options->choice = LOFC_COMBINE;
- string_list_append(&filter_options->filter_spec, xstrdup("combine:"));
+ strbuf_addstr(&filter_options->filter_spec, "combine:");
filter_spec_append_urlencode(
filter_options,
list_objects_filter_spec(&filter_options->sub[0]));
@@ -239,7 +235,7 @@ static void transform_to_combine_type(
* We don't need the filter_spec strings for subfilter specs, only the
* top level.
*/
- string_list_clear(&filter_options->sub[0].filter_spec, /*free_util=*/0);
+ strbuf_release(&filter_options->sub[0].filter_spec);
}
void list_objects_filter_die_if_populated(
@@ -256,26 +252,32 @@ void parse_list_objects_filter(
struct strbuf errbuf = STRBUF_INIT;
int parse_error;
+ if (!filter_options->filter_spec.buf)
+ BUG("filter_options not properly initialized");
+
if (!filter_options->choice) {
- string_list_append(&filter_options->filter_spec, xstrdup(arg));
+ strbuf_addstr(&filter_options->filter_spec, arg);
parse_error = gently_parse_list_objects_filter(
filter_options, arg, &errbuf);
} else {
+ struct list_objects_filter_options *sub;
+
/*
* Make filter_options an LOFC_COMBINE spec so we can trivially
* add subspecs to it.
*/
transform_to_combine_type(filter_options);
- string_list_append(&filter_options->filter_spec, xstrdup("+"));
+ strbuf_addch(&filter_options->filter_spec, '+');
filter_spec_append_urlencode(filter_options, arg);
ALLOC_GROW_BY(filter_options->sub, filter_options->sub_nr, 1,
filter_options->sub_alloc);
+ sub = &filter_options->sub[filter_options->sub_nr - 1];
- parse_error = gently_parse_list_objects_filter(
- &filter_options->sub[filter_options->sub_nr - 1], arg,
- &errbuf);
+ list_objects_filter_init(sub);
+ parse_error = gently_parse_list_objects_filter(sub, arg,
+ &errbuf);
}
if (parse_error)
die("%s", errbuf.buf);
@@ -285,10 +287,6 @@ int opt_parse_list_objects_filter(const struct option *opt,
const char *arg, int unset)
{
struct list_objects_filter_options *filter_options = opt->value;
- opt_lof_init init = (opt_lof_init)opt->defval;
-
- if (init)
- filter_options = init(opt->value);
if (unset || !arg)
list_objects_filter_set_no_filter(filter_options);
@@ -299,31 +297,18 @@ int opt_parse_list_objects_filter(const struct option *opt,
const char *list_objects_filter_spec(struct list_objects_filter_options *filter)
{
- if (!filter->filter_spec.nr)
+ if (!filter->filter_spec.len)
BUG("no filter_spec available for this filter");
- if (filter->filter_spec.nr != 1) {
- struct strbuf concatted = STRBUF_INIT;
- strbuf_add_separated_string_list(
- &concatted, "", &filter->filter_spec);
- string_list_clear(&filter->filter_spec, /*free_util=*/0);
- string_list_append(
- &filter->filter_spec, strbuf_detach(&concatted, NULL));
- }
-
- return filter->filter_spec.items[0].string;
+ return filter->filter_spec.buf;
}
const char *expand_list_objects_filter_spec(
struct list_objects_filter_options *filter)
{
if (filter->choice == LOFC_BLOB_LIMIT) {
- struct strbuf expanded_spec = STRBUF_INIT;
- strbuf_addf(&expanded_spec, "blob:limit=%lu",
+ strbuf_release(&filter->filter_spec);
+ strbuf_addf(&filter->filter_spec, "blob:limit=%lu",
filter->blob_limit_value);
- string_list_clear(&filter->filter_spec, /*free_util=*/0);
- string_list_append(
- &filter->filter_spec,
- strbuf_detach(&expanded_spec, NULL));
}
return list_objects_filter_spec(filter);
@@ -336,12 +321,12 @@ void list_objects_filter_release(
if (!filter_options)
return;
- string_list_clear(&filter_options->filter_spec, /*free_util=*/0);
+ strbuf_release(&filter_options->filter_spec);
free(filter_options->sparse_oid_name);
for (sub = 0; sub < filter_options->sub_nr; sub++)
list_objects_filter_release(&filter_options->sub[sub]);
free(filter_options->sub);
- memset(filter_options, 0, sizeof(*filter_options));
+ list_objects_filter_init(filter_options);
}
void partial_clone_register(
@@ -353,7 +338,7 @@ void partial_clone_register(
char *filter_name;
/* Check if it is already registered */
- if ((promisor_remote = promisor_remote_find(remote))) {
+ if ((promisor_remote = repo_promisor_remote_find(the_repository, remote))) {
if (promisor_remote->partial_clone_filter)
/*
* Remote is already registered and a filter is already
@@ -381,24 +366,25 @@ void partial_clone_register(
free(filter_name);
/* Make sure the config info are reset */
- promisor_remote_reinit();
+ repo_promisor_remote_reinit(the_repository);
}
void partial_clone_get_default_filter_spec(
struct list_objects_filter_options *filter_options,
const char *remote)
{
- struct promisor_remote *promisor = promisor_remote_find(remote);
+ struct promisor_remote *promisor = repo_promisor_remote_find(the_repository,
+ remote);
struct strbuf errbuf = STRBUF_INIT;
/*
* Parse default value, but silently ignore it if it is invalid.
*/
- if (!promisor)
+ if (!promisor || !promisor->partial_clone_filter)
return;
- string_list_append(&filter_options->filter_spec,
- promisor->partial_clone_filter);
+ strbuf_addstr(&filter_options->filter_spec,
+ promisor->partial_clone_filter);
gently_parse_list_objects_filter(filter_options,
promisor->partial_clone_filter,
&errbuf);
@@ -410,16 +396,21 @@ void list_objects_filter_copy(
const struct list_objects_filter_options *src)
{
int i;
- struct string_list_item *item;
/* Copy everything. We will overwrite the pointers shortly. */
memcpy(dest, src, sizeof(struct list_objects_filter_options));
- string_list_init_dup(&dest->filter_spec);
- for_each_string_list_item(item, &src->filter_spec)
- string_list_append(&dest->filter_spec, item->string);
+ strbuf_init(&dest->filter_spec, 0);
+ strbuf_addbuf(&dest->filter_spec, &src->filter_spec);
+ 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++)
list_objects_filter_copy(&dest->sub[i], &src->sub[i]);
}
+
+void list_objects_filter_init(struct list_objects_filter_options *filter_options)
+{
+ struct list_objects_filter_options blank = LIST_OBJECTS_FILTER_INIT;
+ memcpy(filter_options, &blank, sizeof(*filter_options));
+}
diff --git a/list-objects-filter-options.h b/list-objects-filter-options.h
index ffc02d7..55fab85 100644
--- a/list-objects-filter-options.h
+++ b/list-objects-filter-options.h
@@ -1,9 +1,11 @@
#ifndef LIST_OBJECTS_FILTER_OPTIONS_H
#define LIST_OBJECTS_FILTER_OPTIONS_H
-#include "cache.h"
-#include "parse-options.h"
-#include "string-list.h"
+#include "gettext.h"
+#include "object.h"
+#include "strbuf.h"
+
+struct option;
/*
* The list of defined filters for list-objects.
@@ -35,7 +37,7 @@ struct list_objects_filter_options {
* To get the raw filter spec given by the user, use the result of
* list_objects_filter_spec().
*/
- struct string_list filter_spec;
+ struct strbuf filter_spec;
/*
* 'choice' is determined by parsing the filter-spec. This indicates
@@ -69,6 +71,9 @@ struct list_objects_filter_options {
*/
};
+#define LIST_OBJECTS_FILTER_INIT { .filter_spec = STRBUF_INIT }
+void list_objects_filter_init(struct list_objects_filter_options *filter_options);
+
/*
* Parse value of the argument to the "filter" keyword.
* On the command line this looks like:
@@ -108,27 +113,13 @@ void parse_list_objects_filter(
* The opt->value to opt_parse_list_objects_filter() is either a
* "struct list_objects_filter_option *" when using
* OPT_PARSE_LIST_OBJECTS_FILTER().
- *
- * Or, if using no "struct option" field is used by the callback,
- * except the "defval" which is expected to be an "opt_lof_init"
- * function, which is called with the "opt->value" and must return a
- * pointer to the ""struct list_objects_filter_option *" to be used.
- *
- * The OPT_PARSE_LIST_OBJECTS_FILTER_INIT() can be used e.g. the
- * "struct list_objects_filter_option" is embedded in a "struct
- * rev_info", which the "defval" could be tasked with lazily
- * initializing. See cmd_pack_objects() for an example.
*/
int opt_parse_list_objects_filter(const struct option *opt,
const char *arg, int unset);
-typedef struct list_objects_filter_options *(*opt_lof_init)(void *);
-#define OPT_PARSE_LIST_OBJECTS_FILTER_INIT(fo, init) \
- { OPTION_CALLBACK, 0, "filter", (fo), N_("args"), \
- N_("object filtering"), 0, opt_parse_list_objects_filter, \
- (intptr_t)(init) }
#define OPT_PARSE_LIST_OBJECTS_FILTER(fo) \
- OPT_PARSE_LIST_OBJECTS_FILTER_INIT((fo), NULL)
+ OPT_CALLBACK(0, "filter", (fo), N_("args"), \
+ N_("object filtering"), opt_parse_list_objects_filter)
/*
* Translates abbreviated numbers in the filter's filter_spec into their
diff --git a/list-objects-filter.c b/list-objects-filter.c
index 1c1ee3d..4346f8d 100644
--- a/list-objects-filter.c
+++ b/list-objects-filter.c
@@ -1,18 +1,16 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "dir.h"
-#include "tag.h"
+#include "gettext.h"
+#include "hex.h"
#include "commit.h"
-#include "tree.h"
-#include "blob.h"
#include "diff.h"
-#include "tree-walk.h"
#include "revision.h"
-#include "list-objects.h"
#include "list-objects-filter.h"
#include "list-objects-filter-options.h"
#include "oidmap.h"
#include "oidset.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
/* Remember to update object flag allocation in object.h */
/*
@@ -70,13 +68,13 @@ struct filter {
};
static enum list_objects_filter_result filter_blobs_none(
- struct repository *r,
+ struct repository *r UNUSED,
enum list_objects_filter_situation filter_situation,
struct object *obj,
- const char *pathname,
- const char *filename,
+ const char *pathname UNUSED,
+ const char *filename UNUSED,
struct oidset *omits,
- void *filter_data_)
+ void *filter_data_ UNUSED)
{
switch (filter_situation) {
default:
@@ -112,7 +110,7 @@ static enum list_objects_filter_result filter_blobs_none(
}
static void filter_blobs_none__init(
- struct list_objects_filter_options *filter_options,
+ struct list_objects_filter_options *filter_options UNUSED,
struct filter *filter)
{
filter->filter_object_fn = filter_blobs_none;
@@ -159,11 +157,11 @@ static int filter_trees_update_omits(
}
static enum list_objects_filter_result filter_trees_depth(
- struct repository *r,
+ struct repository *r UNUSED,
enum list_objects_filter_situation filter_situation,
struct object *obj,
- const char *pathname,
- const char *filename,
+ const char *pathname UNUSED,
+ const char *filename UNUSED,
struct oidset *omits,
void *filter_data_)
{
@@ -274,8 +272,8 @@ static enum list_objects_filter_result filter_blobs_limit(
struct repository *r,
enum list_objects_filter_situation filter_situation,
struct object *obj,
- const char *pathname,
- const char *filename,
+ const char *pathname UNUSED,
+ const char *filename UNUSED,
struct oidset *omits,
void *filter_data_)
{
@@ -514,6 +512,7 @@ static enum list_objects_filter_result filter_sparse(
static void filter_sparse_free(void *filter_data)
{
struct filter_sparse_data *d = filter_data;
+ clear_pattern_list(&d->pl);
free(d->array_frame);
free(d);
}
@@ -554,12 +553,12 @@ struct filter_object_type_data {
};
static enum list_objects_filter_result filter_object_type(
- struct repository *r,
+ struct repository *r UNUSED,
enum list_objects_filter_situation filter_situation,
struct object *obj,
- const char *pathname,
- const char *filename,
- struct oidset *omits,
+ const char *pathname UNUSED,
+ const char *filename UNUSED,
+ struct oidset *omits UNUSED,
void *filter_data_)
{
struct filter_object_type_data *filter_data = filter_data_;
@@ -675,7 +674,7 @@ static enum list_objects_filter_result filter_combine(
struct object *obj,
const char *pathname,
const char *filename,
- struct oidset *omits,
+ struct oidset *omits UNUSED,
void *filter_data)
{
struct combine_filter_data *d = filter_data;
@@ -709,15 +708,7 @@ static void filter_combine__free(void *filter_data)
BUG("expected oidset to be cleared already");
}
free(d->sub);
-}
-
-static void add_all(struct oidset *dest, struct oidset *src) {
- struct oidset_iter iter;
- struct object_id *src_oid;
-
- oidset_iter_init(src, &iter);
- while ((src_oid = oidset_iter_next(&iter)) != NULL)
- oidset_insert(dest, src_oid);
+ free(d);
}
static void filter_combine__finalize_omits(
@@ -728,7 +719,7 @@ static void filter_combine__finalize_omits(
size_t sub;
for (sub = 0; sub < d->nr; sub++) {
- add_all(omits, &d->sub[sub].omits);
+ oidset_insert_from_set(omits, &d->sub[sub].omits);
oidset_clear(&d->sub[sub].omits);
}
}
diff --git a/list-objects.c b/list-objects.c
index 250d9de..11ad8be 100644
--- a/list-objects.c
+++ b/list-objects.c
@@ -1,6 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "tag.h"
#include "commit.h"
+#include "gettext.h"
+#include "hex.h"
#include "tree.h"
#include "blob.h"
#include "diff.h"
@@ -10,8 +12,9 @@
#include "list-objects-filter.h"
#include "list-objects-filter-options.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "trace.h"
+#include "environment.h"
struct traversal_context {
struct rev_info *revs;
@@ -19,6 +22,7 @@ struct traversal_context {
show_commit_fn show_commit;
void *show_data;
struct filter *filter;
+ int depth;
};
static void show_commit(struct traversal_context *ctx,
@@ -35,6 +39,9 @@ static void show_object(struct traversal_context *ctx,
{
if (!ctx->show_object)
return;
+ if (ctx->revs->unpacked && has_object_pack(&object->oid))
+ return;
+
ctx->show_object(object, name, ctx->show_data);
}
@@ -64,7 +71,7 @@ static void process_blob(struct traversal_context *ctx,
* of missing objects.
*/
if (ctx->revs->exclude_promisor_objects &&
- !has_object_file(&obj->oid) &&
+ !repo_has_object_file(the_repository, &obj->oid) &&
is_promisor_object(&obj->oid))
return;
@@ -81,36 +88,6 @@ static void process_blob(struct traversal_context *ctx,
strbuf_setlen(path, pathlen);
}
-/*
- * Processing a gitlink entry currently does nothing, since
- * we do not recurse into the subproject.
- *
- * We *could* eventually add a flag that actually does that,
- * which would involve:
- * - is the subproject actually checked out?
- * - if so, see if the subproject has already been added
- * to the alternates list, and add it if not.
- * - process the commit (or tag) the gitlink points to
- * recursively.
- *
- * However, it's unclear whether there is really ever any
- * reason to see superprojects and subprojects as such a
- * "unified" object pool (potentially resulting in a totally
- * humongous pack - avoiding which was the whole point of
- * having gitlinks in the first place!).
- *
- * So for now, there is just a note that we *could* follow
- * the link, and how to do it. Whether it necessarily makes
- * any sense what-so-ever to ever do that is another issue.
- */
-static void process_gitlink(struct traversal_context *ctx,
- const unsigned char *sha1,
- struct strbuf *path,
- const char *name)
-{
- /* Nothing to do */
-}
-
static void process_tree(struct traversal_context *ctx,
struct tree *tree,
struct strbuf *base,
@@ -125,12 +102,12 @@ static void process_tree_contents(struct traversal_context *ctx,
enum interesting match = ctx->revs->diffopt.pathspec.nr == 0 ?
all_entries_interesting : entry_not_interesting;
- init_tree_desc(&desc, tree->buffer, tree->size);
+ init_tree_desc(&desc, &tree->object.oid, tree->buffer, tree->size);
while (tree_entry(&desc, &entry)) {
if (match != all_entries_interesting) {
match = tree_entry_interesting(ctx->revs->repo->index,
- &entry, base, 0,
+ &entry, base,
&ctx->revs->diffopt.pathspec);
if (match == all_entries_not_interesting)
break;
@@ -146,11 +123,12 @@ static void process_tree_contents(struct traversal_context *ctx,
entry.path, oid_to_hex(&tree->object.oid));
}
t->object.flags |= NOT_USER_GIVEN;
+ ctx->depth++;
process_tree(ctx, t, base, entry.path);
+ ctx->depth--;
}
else if (S_ISGITLINK(entry.mode))
- process_gitlink(ctx, entry.oid.hash,
- base, entry.path);
+ ; /* ignore gitlink */
else {
struct blob *b = lookup_blob(ctx->revs->repo, &entry.oid);
if (!b) {
@@ -185,6 +163,9 @@ static void process_tree(struct traversal_context *ctx,
!revs->include_check_obj(&tree->object, revs->include_check_data))
return;
+ if (ctx->depth > max_allowed_tree_depth)
+ die("exceeded maximum allowed tree depth");
+
failed_parse = parse_tree_gently(tree, 1);
if (failed_parse) {
if (revs->ignore_missing_links)
@@ -199,7 +180,7 @@ static void process_tree(struct traversal_context *ctx,
is_promisor_object(&obj->oid))
return;
- if (!revs->do_not_die_on_missing_tree)
+ if (!revs->do_not_die_on_missing_objects)
die("bad tree object %s", oid_to_hex(&obj->oid));
}
@@ -258,7 +239,8 @@ static void mark_edge_parents_uninteresting(struct commit *commit,
struct commit *parent = parents->item;
if (!(parent->object.flags & UNINTERESTING))
continue;
- mark_tree_uninteresting(revs->repo, get_commit_tree(parent));
+ mark_tree_uninteresting(revs->repo,
+ repo_get_commit_tree(the_repository, parent));
if (revs->edge_hint && !(parent->object.flags & SHOWN)) {
parent->object.flags |= SHOWN;
show_edge(parent);
@@ -275,7 +257,8 @@ static void add_edge_parents(struct commit *commit,
for (parents = commit->parents; parents; parents = parents->next) {
struct commit *parent = parents->item;
- struct tree *tree = get_commit_tree(parent);
+ struct tree *tree = repo_get_commit_tree(the_repository,
+ parent);
if (!tree)
continue;
@@ -306,7 +289,8 @@ void mark_edges_uninteresting(struct rev_info *revs,
for (list = revs->commits; list; list = list->next) {
struct commit *commit = list->item;
- struct tree *tree = get_commit_tree(commit);
+ struct tree *tree = repo_get_commit_tree(the_repository,
+ commit);
if (commit->object.flags & UNINTERESTING)
tree->object.flags |= UNINTERESTING;
@@ -322,7 +306,7 @@ void mark_edges_uninteresting(struct rev_info *revs,
struct commit *commit = list->item;
if (commit->object.flags & UNINTERESTING) {
mark_tree_uninteresting(revs->repo,
- get_commit_tree(commit));
+ repo_get_commit_tree(the_repository, commit));
if (revs->edge_hint_aggressive && !(commit->object.flags & SHOWN)) {
commit->object.flags |= SHOWN;
show_edge(commit);
@@ -340,7 +324,7 @@ void mark_edges_uninteresting(struct rev_info *revs,
if (obj->type != OBJ_COMMIT || !(obj->flags & UNINTERESTING))
continue;
mark_tree_uninteresting(revs->repo,
- get_commit_tree(commit));
+ repo_get_commit_tree(the_repository, commit));
if (!(obj->flags & SHOWN)) {
obj->flags |= SHOWN;
show_edge(commit);
@@ -375,6 +359,7 @@ static void traverse_non_commits(struct traversal_context *ctx,
if (!path)
path = "";
if (obj->type == OBJ_TREE) {
+ ctx->depth = 0;
process_tree(ctx, (struct tree *)obj, base, path);
continue;
}
@@ -407,8 +392,12 @@ static void do_traverse(struct traversal_context *ctx)
*/
if (!ctx->revs->tree_objects)
; /* do not bother loading tree */
- else if (get_commit_tree(commit)) {
- struct tree *tree = get_commit_tree(commit);
+ else if (ctx->revs->do_not_die_on_missing_objects &&
+ oidset_contains(&ctx->revs->missing_commits, &commit->object.oid))
+ ;
+ else if (repo_get_commit_tree(the_repository, commit)) {
+ struct tree *tree = repo_get_commit_tree(the_repository,
+ commit);
tree->object.flags |= NOT_USER_GIVEN;
add_pending_tree(ctx->revs, tree);
} else if (commit->object.parsed) {
diff --git a/list.h b/list.h
index 362a4cd..9842801 100644
--- a/list.h
+++ b/list.h
@@ -19,7 +19,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see
- * <http://www.gnu.org/licenses/>.
+ * <https://www.gnu.org/licenses/>.
*/
#ifndef LIST_H
diff --git a/lockfile.c b/lockfile.c
index cc9a4b8..1d5ed01 100644
--- a/lockfile.c
+++ b/lockfile.c
@@ -2,7 +2,9 @@
* Copyright (c) 2005, Junio C Hamano
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "gettext.h"
#include "lockfile.h"
/*
diff --git a/lockfile.h b/lockfile.h
index 90af4e6..1bb9926 100644
--- a/lockfile.h
+++ b/lockfile.h
@@ -321,11 +321,11 @@ static inline int commit_lock_file_to(struct lock_file *lk, const char *path)
* Roll back `lk`: close the file descriptor and/or file pointer and
* remove the lockfile. It is a NOOP to call `rollback_lock_file()`
* for a `lock_file` object that has already been committed or rolled
- * back.
+ * back. No error will be returned in this case.
*/
-static inline void rollback_lock_file(struct lock_file *lk)
+static inline int rollback_lock_file(struct lock_file *lk)
{
- delete_tempfile(&lk->tempfile);
+ return delete_tempfile(&lk->tempfile);
}
#endif /* LOCKFILE_H */
diff --git a/log-tree.c b/log-tree.c
index d0ac0a6..16031b4 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -1,8 +1,12 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "commit-reach.h"
#include "config.h"
#include "diff.h"
-#include "object-store.h"
+#include "diffcore.h"
+#include "environment.h"
+#include "hex.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "repository.h"
#include "tmp-objdir.h"
#include "commit.h"
@@ -12,6 +16,8 @@
#include "merge-ort.h"
#include "reflog-walk.h"
#include "refs.h"
+#include "replace-object.h"
+#include "revision.h"
#include "string-list.h"
#include "color.h"
#include "gpg-interface.h"
@@ -20,6 +26,9 @@
#include "help.h"
#include "range-diff.h"
#include "strmap.h"
+#include "tree.h"
+#include "wildmatch.h"
+#include "write-or-die.h"
static struct decoration name_decoration = { "object names" };
static int decoration_loaded;
@@ -135,19 +144,22 @@ static int ref_filter_match(const char *refname,
}
static int add_ref_decoration(const char *refname, const struct object_id *oid,
- int flags, void *cb_data)
+ int flags UNUSED,
+ void *cb_data)
{
+ int i;
struct object *obj;
enum object_type objtype;
enum decoration_type deco_type = DECORATION_NONE;
struct decoration_filter *filter = (struct decoration_filter *)cb_data;
+ const char *git_replace_ref_base = ref_namespace[NAMESPACE_REPLACE].ref;
if (filter && !ref_filter_match(refname, filter))
return 0;
if (starts_with(refname, git_replace_ref_base)) {
struct object_id original_oid;
- if (!read_replace_refs)
+ if (!replace_refs_enabled(the_repository))
return 0;
if (get_oid_hex(refname + strlen(git_replace_ref_base),
&original_oid)) {
@@ -165,16 +177,21 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid,
return 0;
obj = lookup_object_by_type(the_repository, oid, objtype);
- if (starts_with(refname, "refs/heads/"))
- deco_type = DECORATION_REF_LOCAL;
- else if (starts_with(refname, "refs/remotes/"))
- deco_type = DECORATION_REF_REMOTE;
- else if (starts_with(refname, "refs/tags/"))
- deco_type = DECORATION_REF_TAG;
- else if (!strcmp(refname, "refs/stash"))
- deco_type = DECORATION_REF_STASH;
- else if (!strcmp(refname, "HEAD"))
- deco_type = DECORATION_REF_HEAD;
+ for (i = 0; i < ARRAY_SIZE(ref_namespace); i++) {
+ struct ref_namespace_info *info = &ref_namespace[i];
+
+ if (!info->decoration)
+ continue;
+ if (info->exact) {
+ if (!strcmp(refname, info->ref)) {
+ deco_type = info->decoration;
+ break;
+ }
+ } else if (starts_with(refname, info->ref)) {
+ deco_type = info->decoration;
+ break;
+ }
+ }
add_name_decoration(deco_type, refname, obj);
while (obj->type == OBJ_TAG) {
@@ -188,7 +205,8 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid,
return 0;
}
-static int add_graft_decoration(const struct commit_graft *graft, void *cb_data)
+static int add_graft_decoration(const struct commit_graft *graft,
+ void *cb_data UNUSED)
{
struct commit *commit = lookup_commit(the_repository, &graft->oid);
if (!commit)
@@ -225,7 +243,8 @@ static void show_parents(struct commit *commit, int abbrev, FILE *file)
struct commit_list *p;
for (p = commit->parents; p ; p = p->next) {
struct commit *parent = p->item;
- fprintf(file, " %s", find_unique_abbrev(&parent->object.oid, abbrev));
+ fprintf(file, " %s",
+ repo_find_unique_abbrev(the_repository, &parent->object.oid, abbrev));
}
}
@@ -233,7 +252,8 @@ static void show_children(struct rev_info *opt, struct commit *commit, int abbre
{
struct commit_list *p = lookup_decoration(&opt->children, &commit->object);
for ( ; p; p = p->next) {
- fprintf(opt->diffopt.file, " %s", find_unique_abbrev(&p->item->object.oid, abbrev));
+ fprintf(opt->diffopt.file, " %s",
+ repo_find_unique_abbrev(the_repository, &p->item->object.oid, abbrev));
}
}
@@ -284,26 +304,43 @@ static void show_name(struct strbuf *sb, const struct name_decoration *decoratio
/*
* The caller makes sure there is no funny color before calling.
- * format_decorations_extended makes sure the same after return.
+ * format_decorations ensures the same after return.
*/
-void format_decorations_extended(struct strbuf *sb,
+void format_decorations(struct strbuf *sb,
const struct commit *commit,
int use_color,
- const char *prefix,
- const char *separator,
- const char *suffix)
+ const struct decoration_options *opts)
{
const struct name_decoration *decoration;
const struct name_decoration *current_and_HEAD;
- const char *color_commit =
- diff_get_color(use_color, DIFF_COMMIT);
- const char *color_reset =
- decorate_get_color(use_color, DECORATION_NONE);
+ const char *color_commit, *color_reset;
+
+ const char *prefix = " (";
+ const char *suffix = ")";
+ const char *separator = ", ";
+ const char *pointer = " -> ";
+ const char *tag = "tag: ";
decoration = get_name_decoration(&commit->object);
if (!decoration)
return;
+ if (opts) {
+ if (opts->prefix)
+ prefix = opts->prefix;
+ if (opts->suffix)
+ suffix = opts->suffix;
+ if (opts->separator)
+ separator = opts->separator;
+ if (opts->pointer)
+ pointer = opts->pointer;
+ if (opts->tag)
+ tag = opts->tag;
+ }
+
+ color_commit = diff_get_color(use_color, DIFF_COMMIT);
+ color_reset = decorate_get_color(use_color, DECORATION_NONE);
+
current_and_HEAD = current_pointed_by_HEAD(decoration);
while (decoration) {
/*
@@ -312,31 +349,44 @@ void format_decorations_extended(struct strbuf *sb,
* appeared, skipping the entry for current.
*/
if (decoration != current_and_HEAD) {
- strbuf_addstr(sb, color_commit);
- strbuf_addstr(sb, prefix);
- strbuf_addstr(sb, color_reset);
- strbuf_addstr(sb, decorate_get_color(use_color, decoration->type));
- if (decoration->type == DECORATION_REF_TAG)
- strbuf_addstr(sb, "tag: ");
+ const char *color =
+ decorate_get_color(use_color, decoration->type);
+
+ if (*prefix) {
+ strbuf_addstr(sb, color_commit);
+ strbuf_addstr(sb, prefix);
+ strbuf_addstr(sb, color_reset);
+ }
+
+ if (*tag && decoration->type == DECORATION_REF_TAG) {
+ strbuf_addstr(sb, color);
+ strbuf_addstr(sb, tag);
+ strbuf_addstr(sb, color_reset);
+ }
+ strbuf_addstr(sb, color);
show_name(sb, decoration);
+ strbuf_addstr(sb, color_reset);
if (current_and_HEAD &&
decoration->type == DECORATION_REF_HEAD) {
- strbuf_addstr(sb, " -> ");
+ strbuf_addstr(sb, color_commit);
+ strbuf_addstr(sb, pointer);
strbuf_addstr(sb, color_reset);
strbuf_addstr(sb, decorate_get_color(use_color, current_and_HEAD->type));
show_name(sb, current_and_HEAD);
+ strbuf_addstr(sb, color_reset);
}
- strbuf_addstr(sb, color_reset);
prefix = separator;
}
decoration = decoration->next;
}
- strbuf_addstr(sb, color_commit);
- strbuf_addstr(sb, suffix);
- strbuf_addstr(sb, color_reset);
+ if (*suffix) {
+ strbuf_addstr(sb, color_commit);
+ strbuf_addstr(sb, suffix);
+ strbuf_addstr(sb, color_reset);
+ }
}
void show_decorations(struct rev_info *opt, struct commit *commit)
@@ -351,7 +401,7 @@ void show_decorations(struct rev_info *opt, struct commit *commit)
}
if (!opt->show_decorations)
return;
- format_decorations(&sb, commit, opt->diffopt.use_color);
+ format_decorations(&sb, commit, opt->diffopt.use_color, NULL);
fputs(sb.buf, opt->diffopt.file);
strbuf_release(&sb);
}
@@ -397,7 +447,8 @@ void fmt_output_commit(struct strbuf *filename,
struct pretty_print_context ctx = {0};
struct strbuf subject = STRBUF_INIT;
- format_commit_message(commit, "%f", &subject, &ctx);
+ repo_format_commit_message(the_repository, commit, "%f", &subject,
+ &ctx);
fmt_output_subject(filename, subject.buf, info);
strbuf_release(&subject);
}
@@ -419,20 +470,23 @@ void fmt_output_email_subject(struct strbuf *sb, struct rev_info *opt)
}
void log_write_email_headers(struct rev_info *opt, struct commit *commit,
- const char **extra_headers_p,
+ char **extra_headers_p,
int *need_8bit_cte_p,
int maybe_multipart)
{
- const char *extra_headers = opt->extra_headers;
+ struct strbuf headers = STRBUF_INIT;
const char *name = oid_to_hex(opt->zero_commit ?
null_oid() : &commit->object.oid);
*need_8bit_cte_p = 0; /* unknown */
+ if (opt->extra_headers && *opt->extra_headers)
+ strbuf_addstr(&headers, opt->extra_headers);
+
fprintf(opt->diffopt.file, "From %s Mon Sep 17 00:00:00 2001\n", name);
graph_show_oneline(opt->graph);
if (opt->message_id) {
- fprintf(opt->diffopt.file, "Message-Id: <%s>\n", opt->message_id);
+ fprintf(opt->diffopt.file, "Message-ID: <%s>\n", opt->message_id);
graph_show_oneline(opt->graph);
}
if (opt->ref_message_ids && opt->ref_message_ids->nr > 0) {
@@ -445,16 +499,13 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit,
graph_show_oneline(opt->graph);
}
if (opt->mime_boundary && maybe_multipart) {
- static struct strbuf subject_buffer = STRBUF_INIT;
static struct strbuf buffer = STRBUF_INIT;
struct strbuf filename = STRBUF_INIT;
*need_8bit_cte_p = -1; /* NEVER */
- strbuf_reset(&subject_buffer);
strbuf_reset(&buffer);
- strbuf_addf(&subject_buffer,
- "%s"
+ strbuf_addf(&headers,
"MIME-Version: 1.0\n"
"Content-Type: multipart/mixed;"
" boundary=\"%s%s\"\n"
@@ -465,10 +516,8 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit,
"Content-Type: text/plain; "
"charset=UTF-8; format=fixed\n"
"Content-Transfer-Encoding: 8bit\n\n",
- extra_headers ? extra_headers : "",
mime_boundary_leader, opt->mime_boundary,
mime_boundary_leader, opt->mime_boundary);
- extra_headers = subject_buffer.buf;
if (opt->numbered_files)
strbuf_addf(&filename, "%d", opt->nr);
@@ -488,7 +537,7 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit,
opt->diffopt.stat_sep = buffer.buf;
strbuf_release(&filename);
}
- *extra_headers_p = extra_headers;
+ *extra_headers_p = headers.len ? strbuf_detach(&headers, NULL) : NULL;
}
static void show_sig_lines(struct rev_info *opt, int status, const char *bol)
@@ -627,7 +676,6 @@ void show_log(struct rev_info *opt)
struct log_info *log = opt->loginfo;
struct commit *commit = log->commit, *parent = log->parent;
int abbrev_commit = opt->abbrev_commit ? opt->abbrev : the_hash_algo->hexsz;
- const char *extra_headers = opt->extra_headers;
struct pretty_print_context ctx = {0};
opt->loginfo = NULL;
@@ -636,7 +684,8 @@ void show_log(struct rev_info *opt)
if (!opt->graph)
put_revision_mark(opt, commit);
- fputs(find_unique_abbrev(&commit->object.oid, abbrev_commit), opt->diffopt.file);
+ fputs(repo_find_unique_abbrev(the_repository, &commit->object.oid, abbrev_commit),
+ opt->diffopt.file);
if (opt->print_parents)
show_parents(commit, abbrev_commit, opt->diffopt.file);
if (opt->children.name)
@@ -687,10 +736,9 @@ void show_log(struct rev_info *opt)
*/
if (cmit_fmt_is_mail(opt->commit_format)) {
- log_write_email_headers(opt, commit, &extra_headers,
+ log_write_email_headers(opt, commit, &ctx.after_subject,
&ctx.need_8bit_cte, 1);
ctx.rev = opt;
- ctx.print_email_subject = 1;
} else if (opt->commit_format != CMIT_FMT_USERFORMAT) {
fputs(diff_get_color_opt(&opt->diffopt, DIFF_COMMIT), opt->diffopt.file);
if (opt->commit_format != CMIT_FMT_ONELINE)
@@ -698,8 +746,8 @@ void show_log(struct rev_info *opt)
if (!opt->graph)
put_revision_mark(opt, commit);
- fputs(find_unique_abbrev(&commit->object.oid,
- abbrev_commit),
+ fputs(repo_find_unique_abbrev(the_repository, &commit->object.oid,
+ abbrev_commit),
opt->diffopt.file);
if (opt->print_parents)
show_parents(commit, abbrev_commit, opt->diffopt.file);
@@ -707,7 +755,7 @@ void show_log(struct rev_info *opt)
show_children(opt, commit, abbrev_commit);
if (parent)
fprintf(opt->diffopt.file, " (from %s)",
- find_unique_abbrev(&parent->object.oid, abbrev_commit));
+ repo_find_unique_abbrev(the_repository, &parent->object.oid, abbrev_commit));
fputs(diff_get_color_opt(&opt->diffopt, DIFF_RESET), opt->diffopt.file);
show_decorations(opt, commit);
if (opt->commit_format == CMIT_FMT_ONELINE) {
@@ -725,7 +773,7 @@ void show_log(struct rev_info *opt)
*/
show_reflog_message(opt->reflog_info,
opt->commit_format == CMIT_FMT_ONELINE,
- &opt->date_mode,
+ opt->date_mode,
opt->date_mode_explicit);
if (opt->commit_format == CMIT_FMT_ONELINE)
return;
@@ -756,7 +804,6 @@ void show_log(struct rev_info *opt)
ctx.date_mode = opt->date_mode;
ctx.date_mode_explicit = opt->date_mode_explicit;
ctx.abbrev = opt->diffopt.abbrev;
- ctx.after_subject = extra_headers;
ctx.preserve_subject = opt->preserve_subject;
ctx.encode_email_headers = opt->encode_email_headers;
ctx.reflog_info = opt->reflog_info;
@@ -805,6 +852,7 @@ void show_log(struct rev_info *opt)
strbuf_release(&msgbuf);
free(ctx.notes_message);
+ free(ctx.after_subject);
if (cmit_fmt_is_mail(ctx.fmt) && opt->idiff_oid1) {
struct diff_queue_struct dq;
@@ -838,7 +886,7 @@ void show_log(struct rev_info *opt)
* Pass minimum required diff-options to range-diff; others
* can be added later if deemed desirable.
*/
- diff_setup(&opts);
+ repo_diff_setup(the_repository, &opts);
opts.file = opt->diffopt.file;
opts.use_color = opt->diffopt.use_color;
diff_setup_done(&opts);
@@ -956,11 +1004,10 @@ static void cleanup_additional_headers(struct diff_options *o)
static int do_remerge_diff(struct rev_info *opt,
struct commit_list *parents,
- struct object_id *oid,
- struct commit *commit)
+ struct object_id *oid)
{
struct merge_options o;
- struct commit_list *bases;
+ struct commit_list *bases = NULL;
struct merge_result res = {0};
struct pretty_print_context ctx = {0};
struct commit *parent1 = parents->item;
@@ -975,15 +1022,18 @@ static int do_remerge_diff(struct rev_info *opt,
o.msg_header_prefix = "remerge";
ctx.abbrev = DEFAULT_ABBREV;
- format_commit_message(parent1, "%h (%s)", &parent1_desc, &ctx);
- format_commit_message(parent2, "%h (%s)", &parent2_desc, &ctx);
+ repo_format_commit_message(the_repository, parent1, "%h (%s)",
+ &parent1_desc, &ctx);
+ repo_format_commit_message(the_repository, parent2, "%h (%s)",
+ &parent2_desc, &ctx);
o.branch1 = parent1_desc.buf;
o.branch2 = parent2_desc.buf;
/* Parse the relevant commits and get the merge bases */
parse_commit_or_die(parent1);
parse_commit_or_die(parent2);
- bases = get_merge_bases(parent1, parent2);
+ if (repo_get_merge_bases(the_repository, parent1, parent2, &bases) < 0)
+ exit(128);
/* Re-merge the parents */
merge_incore_recursive(&o, bases, parent1, parent2, &res);
@@ -1052,7 +1102,7 @@ static int log_tree_diff(struct rev_info *opt, struct commit *commit, struct log
"for octopus merges.\n");
return 1;
}
- return do_remerge_diff(opt, parents, oid, commit);
+ return do_remerge_diff(opt, parents, oid);
}
if (opt->combine_merges)
return do_diff_combined(opt, commit);
diff --git a/log-tree.h b/log-tree.h
index e7e4641..94978e2 100644
--- a/log-tree.h
+++ b/log-tree.h
@@ -1,7 +1,7 @@
#ifndef LOG_TREE_H
#define LOG_TREE_H
-#include "revision.h"
+struct rev_info;
struct log_info {
struct commit *commit, *parent;
@@ -13,20 +13,23 @@ struct decoration_filter {
struct string_list *exclude_ref_config_pattern;
};
+struct decoration_options {
+ char *prefix;
+ char *suffix;
+ char *separator;
+ char *pointer;
+ char *tag;
+};
+
int parse_decorate_color_config(const char *var, const char *slot_name, const char *value);
int log_tree_diff_flush(struct rev_info *);
int log_tree_commit(struct rev_info *, struct commit *);
void show_log(struct rev_info *opt);
-void format_decorations_extended(struct strbuf *sb, const struct commit *commit,
- int use_color,
- const char *prefix,
- const char *separator,
- const char *suffix);
-#define format_decorations(strbuf, commit, color) \
- format_decorations_extended((strbuf), (commit), (color), " (", ", ", ")")
+void format_decorations(struct strbuf *sb, const struct commit *commit,
+ int use_color, const struct decoration_options *opts);
void show_decorations(struct rev_info *opt, struct commit *commit);
void log_write_email_headers(struct rev_info *opt, struct commit *commit,
- const char **extra_headers_p,
+ char **extra_headers_p,
int *need_8bit_cte_p,
int maybe_multipart);
void load_ref_decorations(struct decoration_filter *filter, int flags);
diff --git a/loose.c b/loose.c
new file mode 100644
index 0000000..f6faa62
--- /dev/null
+++ b/loose.c
@@ -0,0 +1,259 @@
+#include "git-compat-util.h"
+#include "hash.h"
+#include "path.h"
+#include "object-store.h"
+#include "hex.h"
+#include "wrapper.h"
+#include "gettext.h"
+#include "loose.h"
+#include "lockfile.h"
+#include "oidtree.h"
+
+static const char *loose_object_header = "# loose-object-idx\n";
+
+static inline int should_use_loose_object_map(struct repository *repo)
+{
+ return repo->compat_hash_algo && repo->gitdir;
+}
+
+void loose_object_map_init(struct loose_object_map **map)
+{
+ struct loose_object_map *m;
+ m = xmalloc(sizeof(**map));
+ m->to_compat = kh_init_oid_map();
+ m->to_storage = kh_init_oid_map();
+ *map = m;
+}
+
+static int insert_oid_pair(kh_oid_map_t *map, const struct object_id *key, const struct object_id *value)
+{
+ khiter_t pos;
+ int ret;
+ struct object_id *stored;
+
+ pos = kh_put_oid_map(map, *key, &ret);
+
+ /* This item already exists in the map. */
+ if (ret == 0)
+ return 0;
+
+ stored = xmalloc(sizeof(*stored));
+ oidcpy(stored, value);
+ kh_value(map, pos) = stored;
+ return 1;
+}
+
+static int insert_loose_map(struct object_directory *odb,
+ const struct object_id *oid,
+ const struct object_id *compat_oid)
+{
+ struct loose_object_map *map = odb->loose_map;
+ int inserted = 0;
+
+ inserted |= insert_oid_pair(map->to_compat, oid, compat_oid);
+ inserted |= insert_oid_pair(map->to_storage, compat_oid, oid);
+ if (inserted)
+ oidtree_insert(odb->loose_objects_cache, compat_oid);
+
+ return inserted;
+}
+
+static int load_one_loose_object_map(struct repository *repo, struct object_directory *dir)
+{
+ struct strbuf buf = STRBUF_INIT, path = STRBUF_INIT;
+ FILE *fp;
+
+ if (!dir->loose_map)
+ loose_object_map_init(&dir->loose_map);
+ if (!dir->loose_objects_cache) {
+ ALLOC_ARRAY(dir->loose_objects_cache, 1);
+ oidtree_init(dir->loose_objects_cache);
+ }
+
+ insert_loose_map(dir, repo->hash_algo->empty_tree, repo->compat_hash_algo->empty_tree);
+ insert_loose_map(dir, repo->hash_algo->empty_blob, repo->compat_hash_algo->empty_blob);
+ insert_loose_map(dir, repo->hash_algo->null_oid, repo->compat_hash_algo->null_oid);
+
+ strbuf_git_common_path(&path, repo, "objects/loose-object-idx");
+ fp = fopen(path.buf, "rb");
+ if (!fp) {
+ strbuf_release(&path);
+ return 0;
+ }
+
+ errno = 0;
+ if (strbuf_getwholeline(&buf, fp, '\n') || strcmp(buf.buf, loose_object_header))
+ goto err;
+ while (!strbuf_getline_lf(&buf, fp)) {
+ const char *p;
+ struct object_id oid, compat_oid;
+ if (parse_oid_hex_algop(buf.buf, &oid, &p, repo->hash_algo) ||
+ *p++ != ' ' ||
+ parse_oid_hex_algop(p, &compat_oid, &p, repo->compat_hash_algo) ||
+ p != buf.buf + buf.len)
+ goto err;
+ insert_loose_map(dir, &oid, &compat_oid);
+ }
+
+ strbuf_release(&buf);
+ strbuf_release(&path);
+ return errno ? -1 : 0;
+err:
+ strbuf_release(&buf);
+ strbuf_release(&path);
+ return -1;
+}
+
+int repo_read_loose_object_map(struct repository *repo)
+{
+ struct object_directory *dir;
+
+ if (!should_use_loose_object_map(repo))
+ return 0;
+
+ prepare_alt_odb(repo);
+
+ for (dir = repo->objects->odb; dir; dir = dir->next) {
+ if (load_one_loose_object_map(repo, dir) < 0) {
+ return -1;
+ }
+ }
+ return 0;
+}
+
+int repo_write_loose_object_map(struct repository *repo)
+{
+ kh_oid_map_t *map = repo->objects->odb->loose_map->to_compat;
+ struct lock_file lock;
+ int fd;
+ khiter_t iter;
+ struct strbuf buf = STRBUF_INIT, path = STRBUF_INIT;
+
+ if (!should_use_loose_object_map(repo))
+ return 0;
+
+ strbuf_git_common_path(&path, repo, "objects/loose-object-idx");
+ fd = hold_lock_file_for_update_timeout(&lock, path.buf, LOCK_DIE_ON_ERROR, -1);
+ iter = kh_begin(map);
+ if (write_in_full(fd, loose_object_header, strlen(loose_object_header)) < 0)
+ goto errout;
+
+ for (; iter != kh_end(map); iter++) {
+ if (kh_exist(map, iter)) {
+ if (oideq(&kh_key(map, iter), the_hash_algo->empty_tree) ||
+ oideq(&kh_key(map, iter), the_hash_algo->empty_blob))
+ continue;
+ strbuf_addf(&buf, "%s %s\n", oid_to_hex(&kh_key(map, iter)), oid_to_hex(kh_value(map, iter)));
+ if (write_in_full(fd, buf.buf, buf.len) < 0)
+ goto errout;
+ strbuf_reset(&buf);
+ }
+ }
+ strbuf_release(&buf);
+ if (commit_lock_file(&lock) < 0) {
+ error_errno(_("could not write loose object index %s"), path.buf);
+ strbuf_release(&path);
+ return -1;
+ }
+ strbuf_release(&path);
+ return 0;
+errout:
+ rollback_lock_file(&lock);
+ strbuf_release(&buf);
+ error_errno(_("failed to write loose object index %s\n"), path.buf);
+ strbuf_release(&path);
+ return -1;
+}
+
+static int write_one_object(struct repository *repo, const struct object_id *oid,
+ const struct object_id *compat_oid)
+{
+ struct lock_file lock;
+ int fd;
+ struct stat st;
+ struct strbuf buf = STRBUF_INIT, path = STRBUF_INIT;
+
+ strbuf_git_common_path(&path, repo, "objects/loose-object-idx");
+ hold_lock_file_for_update_timeout(&lock, path.buf, LOCK_DIE_ON_ERROR, -1);
+
+ fd = open(path.buf, O_WRONLY | O_CREAT | O_APPEND, 0666);
+ if (fd < 0)
+ goto errout;
+ if (fstat(fd, &st) < 0)
+ goto errout;
+ if (!st.st_size && write_in_full(fd, loose_object_header, strlen(loose_object_header)) < 0)
+ goto errout;
+
+ strbuf_addf(&buf, "%s %s\n", oid_to_hex(oid), oid_to_hex(compat_oid));
+ if (write_in_full(fd, buf.buf, buf.len) < 0)
+ goto errout;
+ if (close(fd))
+ goto errout;
+ adjust_shared_perm(path.buf);
+ rollback_lock_file(&lock);
+ strbuf_release(&buf);
+ strbuf_release(&path);
+ return 0;
+errout:
+ error_errno(_("failed to write loose object index %s\n"), path.buf);
+ close(fd);
+ rollback_lock_file(&lock);
+ strbuf_release(&buf);
+ strbuf_release(&path);
+ return -1;
+}
+
+int repo_add_loose_object_map(struct repository *repo, const struct object_id *oid,
+ const struct object_id *compat_oid)
+{
+ int inserted = 0;
+
+ if (!should_use_loose_object_map(repo))
+ return 0;
+
+ inserted = insert_loose_map(repo->objects->odb, oid, compat_oid);
+ if (inserted)
+ return write_one_object(repo, oid, compat_oid);
+ return 0;
+}
+
+int repo_loose_object_map_oid(struct repository *repo,
+ const struct object_id *src,
+ const struct git_hash_algo *to,
+ struct object_id *dest)
+{
+ struct object_directory *dir;
+ kh_oid_map_t *map;
+ khiter_t pos;
+
+ for (dir = repo->objects->odb; dir; dir = dir->next) {
+ struct loose_object_map *loose_map = dir->loose_map;
+ if (!loose_map)
+ continue;
+ map = (to == repo->compat_hash_algo) ?
+ loose_map->to_compat :
+ loose_map->to_storage;
+ pos = kh_get_oid_map(map, *src);
+ if (pos < kh_end(map)) {
+ oidcpy(dest, kh_value(map, pos));
+ return 0;
+ }
+ }
+ return -1;
+}
+
+void loose_object_map_clear(struct loose_object_map **map)
+{
+ struct loose_object_map *m = *map;
+ struct object_id *oid;
+
+ if (!m)
+ return;
+
+ kh_foreach_value(m->to_compat, oid, free(oid));
+ kh_foreach_value(m->to_storage, oid, free(oid));
+ kh_destroy_oid_map(m->to_compat);
+ kh_destroy_oid_map(m->to_storage);
+ free(m);
+ *map = NULL;
+}
diff --git a/loose.h b/loose.h
new file mode 100644
index 0000000..2c29570
--- /dev/null
+++ b/loose.h
@@ -0,0 +1,22 @@
+#ifndef LOOSE_H
+#define LOOSE_H
+
+#include "khash.h"
+
+struct loose_object_map {
+ kh_oid_map_t *to_compat;
+ kh_oid_map_t *to_storage;
+};
+
+void loose_object_map_init(struct loose_object_map **map);
+void loose_object_map_clear(struct loose_object_map **map);
+int repo_loose_object_map_oid(struct repository *repo,
+ const struct object_id *src,
+ const struct git_hash_algo *dest_algo,
+ struct object_id *dest);
+int repo_add_loose_object_map(struct repository *repo, const struct object_id *oid,
+ const struct object_id *compat_oid);
+int repo_read_loose_object_map(struct repository *repo);
+int repo_write_loose_object_map(struct repository *repo);
+
+#endif
diff --git a/ls-refs.c b/ls-refs.c
index 98e6937..819cbef 100644
--- a/ls-refs.c
+++ b/ls-refs.c
@@ -1,44 +1,42 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hash.h"
+#include "hex.h"
#include "repository.h"
#include "refs.h"
-#include "remote.h"
#include "strvec.h"
#include "ls-refs.h"
#include "pkt-line.h"
#include "config.h"
+#include "string-list.h"
-static int config_read;
-static int advertise_unborn;
-static int allow_unborn;
-
-static void ensure_config_read(void)
+static enum {
+ UNBORN_IGNORE = 0,
+ UNBORN_ALLOW,
+ UNBORN_ADVERTISE /* implies ALLOW */
+} unborn_config(struct repository *r)
{
const char *str = NULL;
- if (config_read)
- return;
-
- if (repo_config_get_string_tmp(the_repository, "lsrefs.unborn", &str)) {
+ if (repo_config_get_string_tmp(r, "lsrefs.unborn", &str)) {
/*
* If there is no such config, advertise and allow it by
* default.
*/
- advertise_unborn = 1;
- allow_unborn = 1;
+ return UNBORN_ADVERTISE;
} else {
if (!strcmp(str, "advertise")) {
- advertise_unborn = 1;
- allow_unborn = 1;
+ return UNBORN_ADVERTISE;
} else if (!strcmp(str, "allow")) {
- allow_unborn = 1;
+ return UNBORN_ALLOW;
} else if (!strcmp(str, "ignore")) {
- /* do nothing */
+ return UNBORN_IGNORE;
} else {
die(_("invalid value for '%s': '%s'"),
"lsrefs.unborn", str);
}
}
- config_read = 1;
}
/*
@@ -73,6 +71,7 @@ struct ls_refs_data {
unsigned symrefs;
struct strvec prefixes;
struct strbuf buf;
+ struct strvec hidden_refs;
unsigned unborn : 1;
};
@@ -84,7 +83,7 @@ static int send_ref(const char *refname, const struct object_id *oid,
strbuf_reset(&data->buf);
- if (ref_is_hidden(refname_nons, refname))
+ if (ref_is_hidden(refname_nons, refname, &data->hidden_refs))
return 0;
if (!ref_match(&data->prefixes, refname_nons))
@@ -136,14 +135,17 @@ static void send_possibly_unborn_head(struct ls_refs_data *data)
strbuf_release(&namespaced);
}
-static int ls_refs_config(const char *var, const char *value, void *data)
+static int ls_refs_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *cb_data)
{
+ struct ls_refs_data *data = cb_data;
/*
* We only serve fetches over v2 for now, so respect only "uploadpack"
* config. This may need to eventually be expanded to "receive", but we
* don't yet know how that information will be passed to ls-refs.
*/
- return parse_hide_refs_config(var, value, "uploadpack");
+ return parse_hide_refs_config(var, value, "uploadpack", &data->hidden_refs);
}
int ls_refs(struct repository *r, struct packet_reader *request)
@@ -153,9 +155,9 @@ int ls_refs(struct repository *r, struct packet_reader *request)
memset(&data, 0, sizeof(data));
strvec_init(&data.prefixes);
strbuf_init(&data.buf, 0);
+ strvec_init(&data.hidden_refs);
- ensure_config_read();
- git_config(ls_refs_config, NULL);
+ git_config(ls_refs_config, &data);
while (packet_reader_read(request) == PACKET_READ_NORMAL) {
const char *arg = request->line;
@@ -170,7 +172,7 @@ int ls_refs(struct repository *r, struct packet_reader *request)
strvec_push(&data.prefixes, out);
}
else if (!strcmp("unborn", arg))
- data.unborn = allow_unborn;
+ data.unborn = !!unborn_config(r);
else
die(_("unexpected line: '%s'"), arg);
}
@@ -189,21 +191,21 @@ int ls_refs(struct repository *r, struct packet_reader *request)
send_possibly_unborn_head(&data);
if (!data.prefixes.nr)
strvec_push(&data.prefixes, "");
- for_each_fullref_in_prefixes(get_git_namespace(), data.prefixes.v,
- send_ref, &data);
+ refs_for_each_fullref_in_prefixes(get_main_ref_store(r),
+ get_git_namespace(), data.prefixes.v,
+ hidden_refs_to_excludes(&data.hidden_refs),
+ send_ref, &data);
packet_fflush(stdout);
strvec_clear(&data.prefixes);
strbuf_release(&data.buf);
+ strvec_clear(&data.hidden_refs);
return 0;
}
int ls_refs_advertise(struct repository *r, struct strbuf *value)
{
- if (value) {
- ensure_config_read();
- if (advertise_unborn)
- strbuf_addstr(value, "unborn");
- }
+ if (value && unborn_config(r) == UNBORN_ADVERTISE)
+ strbuf_addstr(value, "unborn");
return 1;
}
diff --git a/mailinfo.c b/mailinfo.c
index 9621ba6..94b9b0a 100644
--- a/mailinfo.c
+++ b/mailinfo.c
@@ -1,5 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "gettext.h"
+#include "hex-ll.h"
#include "utf8.h"
#include "strbuf.h"
#include "mailinfo.h"
@@ -56,12 +58,13 @@ static void parse_bogus_from(struct mailinfo *mi, const struct strbuf *line)
static const char *unquote_comment(struct strbuf *outbuf, const char *in)
{
- int c;
int take_next_literally = 0;
+ int depth = 1;
strbuf_addch(outbuf, '(');
- while ((c = *in++) != 0) {
+ while (*in) {
+ int c = *in++;
if (take_next_literally == 1) {
take_next_literally = 0;
} else {
@@ -70,11 +73,14 @@ static const char *unquote_comment(struct strbuf *outbuf, const char *in)
take_next_literally = 1;
continue;
case '(':
- in = unquote_comment(outbuf, in);
+ strbuf_addch(outbuf, '(');
+ depth++;
continue;
case ')':
strbuf_addch(outbuf, ')');
- return in;
+ if (!--depth)
+ return in;
+ continue;
}
}
@@ -86,10 +92,10 @@ static const char *unquote_comment(struct strbuf *outbuf, const char *in)
static const char *unquote_quoted_string(struct strbuf *outbuf, const char *in)
{
- int c;
int take_next_literally = 0;
- while ((c = *in++) != 0) {
+ while (*in) {
+ int c = *in++;
if (take_next_literally == 1) {
take_next_literally = 0;
} else {
@@ -317,7 +323,7 @@ static void cleanup_subject(struct mailinfo *mi, struct strbuf *subject)
pos = strchr(subject->buf + at, ']');
if (!pos)
break;
- remove = pos - subject->buf + at + 1;
+ remove = pos - (subject->buf + at) + 1;
if (!mi->keep_non_patch_brackets_in_subject ||
(7 <= remove &&
memmem(subject->buf + at, remove, "PATCH", 5)))
@@ -597,7 +603,7 @@ static int check_header(struct mailinfo *mi,
ret = 1;
goto check_header_out;
}
- if (parse_header(line, "Message-Id", mi, &sb)) {
+ if (parse_header(line, "Message-ID", mi, &sb)) {
if (mi->add_message_id)
mi->message_id = strbuf_detach(&sb, NULL);
ret = 1;
@@ -829,7 +835,7 @@ static int handle_commit_msg(struct mailinfo *mi, struct strbuf *line)
if (patchbreak(line)) {
if (mi->message_id)
strbuf_addf(&mi->log_message,
- "Message-Id: %s\n", mi->message_id);
+ "Message-ID: %s\n", mi->message_id);
return 1;
}
@@ -1239,17 +1245,20 @@ int mailinfo_parse_quoted_cr_action(const char *actionstr, int *action)
return 0;
}
-static int git_mailinfo_config(const char *var, const char *value, void *mi_)
+static int git_mailinfo_config(const char *var, const char *value,
+ const struct config_context *ctx, void *mi_)
{
struct mailinfo *mi = mi_;
if (!starts_with(var, "mailinfo."))
- return git_default_config(var, value, NULL);
+ return git_default_config(var, value, ctx, NULL);
if (!strcmp(var, "mailinfo.scissors")) {
mi->use_scissors = git_config_bool(var, value);
return 0;
}
if (!strcmp(var, "mailinfo.quotedcr")) {
+ if (!value)
+ return config_error_nonbool(var);
if (mailinfo_parse_quoted_cr_action(value, &mi->quoted_cr) != 0)
return error(_("bad action '%s' for '%s'"), value, var);
return 0;
diff --git a/mailmap.c b/mailmap.c
index da2589b..3d6a5e9 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -1,17 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "environment.h"
#include "string-list.h"
#include "mailmap.h"
-#include "object-store.h"
-
-#define DEBUG_MAILMAP 0
-#if DEBUG_MAILMAP
-#define debug_mm(...) fprintf(stderr, __VA_ARGS__)
-#define debug_str(X) ((X) ? (X) : "(none)")
-#else
-__attribute__((format (printf, 1, 2)))
-static inline void debug_mm(const char *format, ...) {}
-static inline const char *debug_str(const char *s) { return s; }
-#endif
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "setup.h"
const char *git_mailmap_file;
const char *git_mailmap_blob;
@@ -30,23 +23,17 @@ struct mailmap_entry {
struct string_list namemap;
};
-static void free_mailmap_info(void *p, const char *s)
+static void free_mailmap_info(void *p, const char *s UNUSED)
{
struct mailmap_info *mi = (struct mailmap_info *)p;
- debug_mm("mailmap: -- complex: '%s' -> '%s' <%s>\n",
- s, debug_str(mi->name), debug_str(mi->email));
free(mi->name);
free(mi->email);
free(mi);
}
-static void free_mailmap_entry(void *p, const char *s)
+static void free_mailmap_entry(void *p, const char *s UNUSED)
{
struct mailmap_entry *me = (struct mailmap_entry *)p;
- debug_mm("mailmap: removing entries for <%s>, with %"PRIuMAX" sub-entries\n",
- s, (uintmax_t)me->namemap.nr);
- debug_mm("mailmap: - simple: '%s' <%s>\n",
- debug_str(me->name), debug_str(me->email));
free(me->name);
free(me->email);
@@ -93,8 +80,6 @@ static void add_mapping(struct string_list *map,
}
if (!old_name) {
- debug_mm("mailmap: adding (simple) entry for '%s'\n", old_email);
-
/* Replace current name and new email for simple entry */
if (new_name) {
free(me->name);
@@ -106,15 +91,10 @@ static void add_mapping(struct string_list *map,
}
} else {
struct mailmap_info *mi = xcalloc(1, sizeof(struct mailmap_info));
- debug_mm("mailmap: adding (complex) entry for '%s'\n", old_email);
mi->name = xstrdup_or_null(new_name);
mi->email = xstrdup_or_null(new_email);
string_list_insert(&me->namemap, old_name)->util = mi;
}
-
- debug_mm("mailmap: '%s' <%s> -> '%s' <%s>\n",
- debug_str(old_name), old_email,
- debug_str(new_name), debug_str(new_email));
}
static char *parse_name_and_email(char *buffer, char **name,
@@ -213,10 +193,10 @@ static int read_mailmap_blob(struct string_list *map, const char *name)
if (!name)
return 0;
- if (get_oid(name, &oid) < 0)
+ if (repo_get_oid(the_repository, name, &oid) < 0)
return 0;
- buf = read_object_file(&oid, &type, &size);
+ buf = repo_read_object_file(the_repository, &oid, &type, &size);
if (!buf)
return error("unable to read mailmap object at %s", name);
if (type != OBJ_BLOB)
@@ -250,11 +230,8 @@ int read_mailmap(struct string_list *map)
void clear_mailmap(struct string_list *map)
{
- debug_mm("mailmap: clearing %"PRIuMAX" entries...\n",
- (uintmax_t)map->nr);
map->strdup_strings = 1;
string_list_clear_func(map, free_mailmap_entry);
- debug_mm("mailmap: cleared\n");
}
/*
@@ -315,10 +292,6 @@ int map_user(struct string_list *map,
struct string_list_item *item;
struct mailmap_entry *me;
- debug_mm("map_user: map '%.*s' <%.*s>\n",
- (int)*namelen, debug_str(*name),
- (int)*emaillen, debug_str(*email));
-
item = lookup_prefix(map, *email, *emaillen);
if (item) {
me = (struct mailmap_entry *)item->util;
@@ -336,10 +309,8 @@ int map_user(struct string_list *map,
}
if (item) {
struct mailmap_info *mi = (struct mailmap_info *)item->util;
- if (mi->name == NULL && mi->email == NULL) {
- debug_mm("map_user: -- (no simple mapping)\n");
+ if (mi->name == NULL && mi->email == NULL)
return 0;
- }
if (mi->email) {
*email = mi->email;
*emaillen = strlen(*email);
@@ -348,11 +319,7 @@ int map_user(struct string_list *map,
*name = mi->name;
*namelen = strlen(*name);
}
- debug_mm("map_user: to '%.*s' <%.*s>\n",
- (int)*namelen, debug_str(*name),
- (int)*emaillen, debug_str(*email));
return 1;
}
- debug_mm("map_user: --\n");
return 0;
}
diff --git a/mailmap.h b/mailmap.h
index 7e99fcc..0f8fd2c 100644
--- a/mailmap.h
+++ b/mailmap.h
@@ -3,6 +3,9 @@
struct string_list;
+extern const char *git_mailmap_file;
+extern const char *git_mailmap_blob;
+
int read_mailmap(struct string_list *map);
void clear_mailmap(struct string_list *map);
diff --git a/match-trees.c b/match-trees.c
index 49398e5..3412b6a 100644
--- a/match-trees.c
+++ b/match-trees.c
@@ -1,7 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "hex.h"
+#include "match-trees.h"
+#include "strbuf.h"
#include "tree.h"
#include "tree-walk.h"
-#include "object-store.h"
+#include "object-store-ll.h"
static int score_missing(unsigned mode)
{
@@ -55,12 +58,12 @@ static void *fill_tree_desc_strict(struct tree_desc *desc,
enum object_type type;
unsigned long size;
- buffer = read_object_file(hash, &type, &size);
+ buffer = repo_read_object_file(the_repository, hash, &type, &size);
if (!buffer)
die("unable to read tree (%s)", oid_to_hex(hash));
if (type != OBJ_TREE)
die("%s is not a tree", oid_to_hex(hash));
- init_tree_desc(desc, buffer, size);
+ init_tree_desc(desc, hash, buffer, size);
return buffer;
}
@@ -188,10 +191,10 @@ static int splice_tree(const struct object_id *oid1, const char *prefix,
if (*subpath)
subpath++;
- buf = read_object_file(oid1, &type, &sz);
+ buf = repo_read_object_file(the_repository, oid1, &type, &sz);
if (!buf)
die("cannot read tree %s", oid_to_hex(oid1));
- init_tree_desc(&desc, buf, sz);
+ init_tree_desc(&desc, oid1, buf, sz);
rewrite_here = NULL;
while (desc.size) {
diff --git a/match-trees.h b/match-trees.h
new file mode 100644
index 0000000..e3877ac
--- /dev/null
+++ b/match-trees.h
@@ -0,0 +1,10 @@
+#ifndef MATCH_TREES_H
+#define MATCH_TREES_H
+
+struct object_id;
+struct repository;
+
+void shift_tree(struct repository *, const struct object_id *, const struct object_id *, struct object_id *, int);
+void shift_tree_by(struct repository *, const struct object_id *, const struct object_id *, struct object_id *, const char *);
+
+#endif /* MATCH_TREES_H */
diff --git a/mem-pool.c b/mem-pool.c
index 599d8e8..3065b12 100644
--- a/mem-pool.c
+++ b/mem-pool.c
@@ -2,7 +2,7 @@
* Memory Pool implementation logic.
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "mem-pool.h"
#define BLOCK_GROWTH_SIZE (1024 * 1024 - sizeof(struct mp_block))
@@ -89,9 +89,7 @@ void *mem_pool_alloc(struct mem_pool *pool, size_t len)
struct mp_block *p = NULL;
void *r;
- /* round up to a 'GIT_MAX_ALIGNMENT' alignment */
- if (len & (GIT_MAX_ALIGNMENT - 1))
- len += GIT_MAX_ALIGNMENT - (len & (GIT_MAX_ALIGNMENT - 1));
+ len = DIV_ROUND_UP(len, GIT_MAX_ALIGNMENT) * GIT_MAX_ALIGNMENT;
if (pool->mp_block &&
pool->mp_block->end - pool->mp_block->next_free >= len)
@@ -99,9 +97,9 @@ void *mem_pool_alloc(struct mem_pool *pool, size_t len)
if (!p) {
if (len >= (pool->block_alloc / 2))
- return mem_pool_alloc_block(pool, len, pool->mp_block);
-
- p = mem_pool_alloc_block(pool, pool->block_alloc, NULL);
+ p = mem_pool_alloc_block(pool, len, pool->mp_block);
+ else
+ p = mem_pool_alloc_block(pool, pool->block_alloc, NULL);
}
r = p->next_free;
@@ -109,6 +107,47 @@ void *mem_pool_alloc(struct mem_pool *pool, size_t len)
return r;
}
+static char *mem_pool_strvfmt(struct mem_pool *pool, const char *fmt,
+ va_list ap)
+{
+ struct mp_block *block = pool->mp_block;
+ char *next_free = block ? block->next_free : NULL;
+ size_t available = block ? block->end - block->next_free : 0;
+ va_list cp;
+ int len, len2;
+ size_t size;
+ char *ret;
+
+ va_copy(cp, ap);
+ len = vsnprintf(next_free, available, fmt, cp);
+ va_end(cp);
+ if (len < 0)
+ BUG("your vsnprintf is broken (returned %d)", len);
+
+ size = st_add(len, 1); /* 1 for NUL */
+ ret = mem_pool_alloc(pool, size);
+
+ /* Shortcut; relies on mem_pool_alloc() not touching buffer contents. */
+ if (ret == next_free)
+ return ret;
+
+ len2 = vsnprintf(ret, size, fmt, ap);
+ if (len2 != len)
+ BUG("your vsnprintf is broken (returns inconsistent lengths)");
+ return ret;
+}
+
+char *mem_pool_strfmt(struct mem_pool *pool, const char *fmt, ...)
+{
+ va_list ap;
+ char *ret;
+
+ va_start(ap, fmt);
+ ret = mem_pool_strvfmt(pool, fmt, ap);
+ va_end(ap);
+ return ret;
+}
+
void *mem_pool_calloc(struct mem_pool *pool, size_t count, size_t size)
{
size_t len = st_mult(count, size);
diff --git a/mem-pool.h b/mem-pool.h
index fe7507f..d1c6641 100644
--- a/mem-pool.h
+++ b/mem-pool.h
@@ -48,6 +48,11 @@ char *mem_pool_strdup(struct mem_pool *pool, const char *str);
char *mem_pool_strndup(struct mem_pool *pool, const char *str, size_t len);
/*
+ * Allocate memory from the memory pool and format a string into it.
+ */
+char *mem_pool_strfmt(struct mem_pool *pool, const char *fmt, ...);
+
+/*
* Move the memory associated with the 'src' pool to the 'dst' pool. The 'src'
* pool will be empty and not contain any memory. It still needs to be free'd
* with a call to `mem_pool_discard`.
diff --git a/merge-blobs.c b/merge-blobs.c
index 8138090..2f659fd 100644
--- a/merge-blobs.c
+++ b/merge-blobs.c
@@ -1,10 +1,8 @@
-#include "cache.h"
-#include "run-command.h"
-#include "xdiff-interface.h"
-#include "ll-merge.h"
+#include "git-compat-util.h"
+#include "merge-ll.h"
#include "blob.h"
#include "merge-blobs.h"
-#include "object-store.h"
+#include "object-store-ll.h"
static int fill_mmfile_blob(mmfile_t *f, struct blob *obj)
{
@@ -12,7 +10,8 @@ static int fill_mmfile_blob(mmfile_t *f, struct blob *obj)
unsigned long size;
enum object_type type;
- buf = read_object_file(&obj->object.oid, &type, &size);
+ buf = repo_read_object_file(the_repository, &obj->object.oid, &type,
+ &size);
if (!buf)
return -1;
if (type != OBJ_BLOB) {
@@ -78,7 +77,8 @@ void *merge_blobs(struct index_state *istate, const char *path,
return NULL;
if (!our)
our = their;
- return read_object_file(&our->object.oid, &type, size);
+ return repo_read_object_file(the_repository, &our->object.oid,
+ &type, size);
}
if (fill_mmfile_blob(&f1, our) < 0)
diff --git a/ll-merge.c b/merge-ll.c
index 14b8362..bf1077a 100644
--- a/ll-merge.c
+++ b/merge-ll.c
@@ -4,13 +4,15 @@
* Copyright (c) 2007 Junio C Hamano
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "convert.h"
#include "attr.h"
#include "xdiff-interface.h"
#include "run-command.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
#include "quote.h"
+#include "strbuf.h"
struct ll_merge_driver;
@@ -49,14 +51,14 @@ void reset_merge_attributes(void)
/*
* Built-in low-levels
*/
-static enum ll_merge_result ll_binary_merge(const struct ll_merge_driver *drv_unused,
+static enum ll_merge_result ll_binary_merge(const struct ll_merge_driver *drv UNUSED,
mmbuffer_t *result,
- const char *path,
- mmfile_t *orig, const char *orig_name,
- mmfile_t *src1, const char *name1,
- mmfile_t *src2, const char *name2,
+ const char *path UNUSED,
+ mmfile_t *orig, const char *orig_name UNUSED,
+ mmfile_t *src1, const char *name1 UNUSED,
+ mmfile_t *src2, const char *name2 UNUSED,
const struct ll_merge_options *opts,
- int marker_size)
+ int marker_size UNUSED)
{
enum ll_merge_result ret;
mmfile_t *stolen;
@@ -126,7 +128,9 @@ static enum ll_merge_result ll_xdl_merge(const struct ll_merge_driver *drv_unuse
xmp.level = XDL_MERGE_ZEALOUS;
xmp.favor = opts->variant;
xmp.xpp.flags = opts->xdl_opts;
- if (git_xmerge_style >= 0)
+ if (opts->conflict_style >= 0)
+ xmp.style = opts->conflict_style;
+ else if (git_xmerge_style >= 0)
xmp.style = git_xmerge_style;
if (marker_size > 0)
xmp.marker_size = marker_size;
@@ -189,24 +193,15 @@ static enum ll_merge_result ll_ext_merge(const struct ll_merge_driver *fn,
const struct ll_merge_options *opts,
int marker_size)
{
- char temp[4][50];
+ char temp[3][50];
struct strbuf cmd = STRBUF_INIT;
- struct strbuf_expand_dict_entry dict[6];
- struct strbuf path_sq = STRBUF_INIT;
- const char *args[] = { NULL, NULL };
+ const char *format = fn->cmdline;
+ struct child_process child = CHILD_PROCESS_INIT;
int status, fd, i;
struct stat st;
enum ll_merge_result ret;
assert(opts);
- sq_quote_buf(&path_sq, path);
- dict[0].placeholder = "O"; dict[0].value = temp[0];
- dict[1].placeholder = "A"; dict[1].value = temp[1];
- dict[2].placeholder = "B"; dict[2].value = temp[2];
- dict[3].placeholder = "L"; dict[3].value = temp[3];
- dict[4].placeholder = "P"; dict[4].value = path_sq.buf;
- dict[5].placeholder = NULL; dict[5].value = NULL;
-
if (!fn->cmdline)
die("custom merge driver %s lacks command line.", fn->name);
@@ -215,12 +210,33 @@ static enum ll_merge_result ll_ext_merge(const struct ll_merge_driver *fn,
create_temp(orig, temp[0], sizeof(temp[0]));
create_temp(src1, temp[1], sizeof(temp[1]));
create_temp(src2, temp[2], sizeof(temp[2]));
- xsnprintf(temp[3], sizeof(temp[3]), "%d", marker_size);
- strbuf_expand(&cmd, fn->cmdline, strbuf_expand_dict_cb, &dict);
+ while (strbuf_expand_step(&cmd, &format)) {
+ if (skip_prefix(format, "%", &format))
+ strbuf_addch(&cmd, '%');
+ else if (skip_prefix(format, "O", &format))
+ strbuf_addstr(&cmd, temp[0]);
+ else if (skip_prefix(format, "A", &format))
+ strbuf_addstr(&cmd, temp[1]);
+ else if (skip_prefix(format, "B", &format))
+ strbuf_addstr(&cmd, temp[2]);
+ else if (skip_prefix(format, "L", &format))
+ strbuf_addf(&cmd, "%d", marker_size);
+ else if (skip_prefix(format, "P", &format))
+ sq_quote_buf(&cmd, path);
+ else if (skip_prefix(format, "S", &format))
+ sq_quote_buf(&cmd, orig_name ? orig_name : "");
+ else if (skip_prefix(format, "X", &format))
+ sq_quote_buf(&cmd, name1 ? name1 : "");
+ else if (skip_prefix(format, "Y", &format))
+ sq_quote_buf(&cmd, name2 ? name2 : "");
+ else
+ strbuf_addch(&cmd, '%');
+ }
- args[0] = cmd.buf;
- status = run_command_v_opt(args, RUN_USING_SHELL);
+ child.use_shell = 1;
+ strvec_push(&child.args, cmd.buf);
+ status = run_command(&child);
fd = open(temp[1], O_RDONLY);
if (fd < 0)
goto bad;
@@ -238,8 +254,13 @@ static enum ll_merge_result ll_ext_merge(const struct ll_merge_driver *fn,
for (i = 0; i < 3; i++)
unlink_or_warn(temp[i]);
strbuf_release(&cmd);
- strbuf_release(&path_sq);
- ret = (status > 0) ? LL_MERGE_CONFLICT : status;
+ if (!status)
+ ret = LL_MERGE_OK;
+ else if (status <= 128)
+ ret = LL_MERGE_CONFLICT;
+ else
+ /* died due to a signal: WTERMSIG(status) + 128 */
+ ret = LL_MERGE_ERROR;
return ret;
}
@@ -249,7 +270,9 @@ static enum ll_merge_result ll_ext_merge(const struct ll_merge_driver *fn,
static struct ll_merge_driver *ll_user_merge, **ll_user_merge_tail;
static const char *default_ll_merge;
-static int read_merge_config(const char *var, const char *value, void *cb)
+static int read_merge_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *cb UNUSED)
{
struct ll_merge_driver *fn;
const char *key, *name;
@@ -271,7 +294,7 @@ static int read_merge_config(const char *var, const char *value, void *cb)
* after seeing merge.<name>.var1.
*/
for (fn = ll_user_merge; fn; fn = fn->next)
- if (!strncmp(fn->name, name, namelen) && !fn->name[namelen])
+ if (!xstrncmpz(fn->name, name, namelen))
break;
if (!fn) {
CALLOC_ARRAY(fn, 1);
@@ -286,7 +309,7 @@ static int read_merge_config(const char *var, const char *value, void *cb)
if (!strcmp("driver", key)) {
if (!value)
- return error("%s: lacks value", var);
+ return config_error_nonbool(var);
/*
* merge.<name>.driver specifies the command line:
*
@@ -300,7 +323,12 @@ static int read_merge_config(const char *var, const char *value, void *cb)
* %B - temporary file name for the other branches' version.
* %L - conflict marker length
* %P - the original path (safely quoted for the shell)
+ * %S - the revision for the merge base
+ * %X - the revision for our version
+ * %Y - the revision for their version
*
+ * If the file is not named indentically in all versions, then each
+ * revision is joined with the corresponding path, separated by a colon.
* The external merge driver should write the results in the
* file named by %A, and signal that it has done with zero exit
* status.
@@ -375,7 +403,7 @@ enum ll_merge_result ll_merge(mmbuffer_t *result_buf,
const struct ll_merge_options *opts)
{
struct attr_check *check = load_merge_attributes();
- static const struct ll_merge_options default_opts;
+ static const struct ll_merge_options default_opts = LL_MERGE_OPTIONS_INIT;
const char *ll_driver_name = NULL;
int marker_size = DEFAULT_CONFLICT_MARKER_SIZE;
const struct ll_merge_driver *driver;
diff --git a/ll-merge.h b/merge-ll.h
index e4a20e8..d038ee0 100644
--- a/ll-merge.h
+++ b/merge-ll.h
@@ -78,10 +78,15 @@ struct ll_merge_options {
*/
unsigned extra_marker_size;
+ /* Override the global conflict style. */
+ int conflict_style;
+
/* Extra xpparam_t flags as defined in xdiff/xdiff.h. */
long xdl_opts;
};
+#define LL_MERGE_OPTIONS_INIT { .conflict_style = -1 }
+
enum ll_merge_result {
LL_MERGE_ERROR = -1,
LL_MERGE_OK = 0,
diff --git a/merge-ort-wrappers.c b/merge-ort-wrappers.c
index ad04106..4acedf3 100644
--- a/merge-ort-wrappers.c
+++ b/merge-ort-wrappers.c
@@ -1,6 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "gettext.h"
+#include "hash.h"
#include "merge-ort.h"
#include "merge-ort-wrappers.h"
+#include "read-cache-ll.h"
+#include "tree.h"
#include "commit.h"
@@ -10,8 +14,8 @@ static int unclean(struct merge_options *opt, struct tree *head)
struct strbuf sb = STRBUF_INIT;
if (head && repo_index_has_changes(opt->repo, head, &sb)) {
- fprintf(stderr, _("Your local changes to the following files would be overwritten by merge:\n %s"),
- sb.buf);
+ error(_("Your local changes to the following files would be overwritten by merge:\n %s"),
+ sb.buf);
strbuf_release(&sb);
return -1;
}
diff --git a/merge-ort.c b/merge-ort.c
index 8c4927f..eaede6c 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -14,26 +14,36 @@
* "cale", "peedy", or "ins" instead of "ort"?)
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "merge-ort.h"
#include "alloc.h"
+#include "advice.h"
#include "attr.h"
-#include "blob.h"
#include "cache-tree.h"
#include "commit.h"
#include "commit-reach.h"
#include "diff.h"
#include "diffcore.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "entry.h"
-#include "ll-merge.h"
-#include "object-store.h"
+#include "merge-ll.h"
+#include "match-trees.h"
+#include "mem-pool.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "oid-array.h"
+#include "path.h"
#include "promisor-remote.h"
+#include "read-cache-ll.h"
+#include "refs.h"
#include "revision.h"
+#include "sparse-index.h"
#include "strmap.h"
-#include "submodule-config.h"
-#include "submodule.h"
+#include "trace2.h"
#include "tree.h"
#include "unpack-trees.h"
#include "xdiff-interface.h"
@@ -349,13 +359,15 @@ struct merge_options_internal {
struct mem_pool pool;
/*
- * output: special messages and conflict notices for various paths
+ * conflicts: logical conflicts and messages stored by _primary_ path
*
* This is a map of pathnames (a subset of the keys in "paths" above)
- * to strbufs. It gathers various warning/conflict/notice messages
- * for later processing.
+ * to struct string_list, with each item's `util` containing a
+ * `struct logical_conflict_info`. Note, though, that for each path,
+ * it only stores the logical conflicts for which that path is the
+ * primary path; the path might be part of additional conflicts.
*/
- struct strmap output;
+ struct strmap conflicts;
/*
* renames: various data relating to rename detection
@@ -385,8 +397,24 @@ struct merge_options_internal {
/* call_depth: recursion level counter for merging merge bases */
int call_depth;
+
+ /* field that holds submodule conflict information */
+ struct string_list conflicted_submodules;
+};
+
+struct conflicted_submodule_item {
+ char *abbrev;
+ int flag;
};
+static void conflicted_submodule_item_free(void *util, const char *str UNUSED)
+{
+ struct conflicted_submodule_item *item = util;
+
+ free(item->abbrev);
+ free(item);
+}
+
struct version_info {
struct object_id oid;
unsigned short mode;
@@ -481,6 +509,103 @@ struct conflict_info {
unsigned match_mask:3;
};
+enum conflict_and_info_types {
+ /* "Simple" conflicts and informational messages */
+ INFO_AUTO_MERGING = 0,
+ CONFLICT_CONTENTS, /* text file that failed to merge */
+ CONFLICT_BINARY,
+ CONFLICT_FILE_DIRECTORY,
+ CONFLICT_DISTINCT_MODES,
+ CONFLICT_MODIFY_DELETE,
+
+ /* Regular rename */
+ CONFLICT_RENAME_RENAME, /* same file renamed differently */
+ CONFLICT_RENAME_COLLIDES, /* rename/add or two files renamed to 1 */
+ CONFLICT_RENAME_DELETE,
+
+ /* Basic directory rename */
+ CONFLICT_DIR_RENAME_SUGGESTED,
+ INFO_DIR_RENAME_APPLIED,
+
+ /* Special directory rename cases */
+ INFO_DIR_RENAME_SKIPPED_DUE_TO_RERENAME,
+ CONFLICT_DIR_RENAME_FILE_IN_WAY,
+ CONFLICT_DIR_RENAME_COLLISION,
+ CONFLICT_DIR_RENAME_SPLIT,
+
+ /* Basic submodule */
+ INFO_SUBMODULE_FAST_FORWARDING,
+ CONFLICT_SUBMODULE_FAILED_TO_MERGE,
+
+ /* Special submodule cases broken out from FAILED_TO_MERGE */
+ CONFLICT_SUBMODULE_FAILED_TO_MERGE_BUT_POSSIBLE_RESOLUTION,
+ CONFLICT_SUBMODULE_NOT_INITIALIZED,
+ CONFLICT_SUBMODULE_HISTORY_NOT_AVAILABLE,
+ CONFLICT_SUBMODULE_MAY_HAVE_REWINDS,
+ CONFLICT_SUBMODULE_NULL_MERGE_BASE,
+ CONFLICT_SUBMODULE_CORRUPT,
+
+ /* Keep this entry _last_ in the list */
+ NB_CONFLICT_TYPES,
+};
+
+/*
+ * Short description of conflict type, relied upon by external tools.
+ *
+ * We can add more entries, but DO NOT change any of these strings. Also,
+ * Order MUST match conflict_info_and_types.
+ */
+static const char *type_short_descriptions[] = {
+ /*** "Simple" conflicts and informational messages ***/
+ [INFO_AUTO_MERGING] = "Auto-merging",
+ [CONFLICT_CONTENTS] = "CONFLICT (contents)",
+ [CONFLICT_BINARY] = "CONFLICT (binary)",
+ [CONFLICT_FILE_DIRECTORY] = "CONFLICT (file/directory)",
+ [CONFLICT_DISTINCT_MODES] = "CONFLICT (distinct modes)",
+ [CONFLICT_MODIFY_DELETE] = "CONFLICT (modify/delete)",
+
+ /*** Regular rename ***/
+ [CONFLICT_RENAME_RENAME] = "CONFLICT (rename/rename)",
+ [CONFLICT_RENAME_COLLIDES] = "CONFLICT (rename involved in collision)",
+ [CONFLICT_RENAME_DELETE] = "CONFLICT (rename/delete)",
+
+ /*** Basic directory rename ***/
+ [CONFLICT_DIR_RENAME_SUGGESTED] =
+ "CONFLICT (directory rename suggested)",
+ [INFO_DIR_RENAME_APPLIED] = "Path updated due to directory rename",
+
+ /*** Special directory rename cases ***/
+ [INFO_DIR_RENAME_SKIPPED_DUE_TO_RERENAME] =
+ "Directory rename skipped since directory was renamed on both sides",
+ [CONFLICT_DIR_RENAME_FILE_IN_WAY] =
+ "CONFLICT (file in way of directory rename)",
+ [CONFLICT_DIR_RENAME_COLLISION] = "CONFLICT(directory rename collision)",
+ [CONFLICT_DIR_RENAME_SPLIT] = "CONFLICT(directory rename unclear split)",
+
+ /*** Basic submodule ***/
+ [INFO_SUBMODULE_FAST_FORWARDING] = "Fast forwarding submodule",
+ [CONFLICT_SUBMODULE_FAILED_TO_MERGE] = "CONFLICT (submodule)",
+
+ /*** Special submodule cases broken out from FAILED_TO_MERGE ***/
+ [CONFLICT_SUBMODULE_FAILED_TO_MERGE_BUT_POSSIBLE_RESOLUTION] =
+ "CONFLICT (submodule with possible resolution)",
+ [CONFLICT_SUBMODULE_NOT_INITIALIZED] =
+ "CONFLICT (submodule not initialized)",
+ [CONFLICT_SUBMODULE_HISTORY_NOT_AVAILABLE] =
+ "CONFLICT (submodule history not available)",
+ [CONFLICT_SUBMODULE_MAY_HAVE_REWINDS] =
+ "CONFLICT (submodule may have rewinds)",
+ [CONFLICT_SUBMODULE_NULL_MERGE_BASE] =
+ "CONFLICT (submodule lacks merge base)",
+ [CONFLICT_SUBMODULE_CORRUPT] =
+ "CONFLICT (submodule corrupt)"
+};
+
+struct logical_conflict_info {
+ enum conflict_and_info_types type;
+ struct strvec paths;
+};
+
/*** Function Grouping: various utility functions ***/
/*
@@ -567,46 +692,37 @@ static void clear_or_reinit_internal_opts(struct merge_options_internal *opti,
struct strmap_entry *e;
/* Release and free each strbuf found in output */
- strmap_for_each_entry(&opti->output, &iter, e) {
- struct strbuf *sb = e->value;
- strbuf_release(sb);
+ strmap_for_each_entry(&opti->conflicts, &iter, e) {
+ struct string_list *list = e->value;
+ for (int i = 0; i < list->nr; i++) {
+ struct logical_conflict_info *info =
+ list->items[i].util;
+ strvec_clear(&info->paths);
+ }
/*
- * While strictly speaking we don't need to free(sb)
- * here because we could pass free_values=1 when
- * calling strmap_clear() on opti->output, that would
- * require strmap_clear to do another
- * strmap_for_each_entry() loop, so we just free it
- * while we're iterating anyway.
+ * While strictly speaking we don't need to
+ * free(conflicts) here because we could pass
+ * free_values=1 when calling strmap_clear() on
+ * opti->conflicts, that would require strmap_clear
+ * to do another strmap_for_each_entry() loop, so we
+ * just free it while we're iterating anyway.
*/
- free(sb);
+ string_list_clear(list, 1);
+ free(list);
}
- strmap_clear(&opti->output, 0);
+ strmap_clear(&opti->conflicts, 0);
}
mem_pool_discard(&opti->pool, 0);
+ string_list_clear_func(&opti->conflicted_submodules,
+ conflicted_submodule_item_free);
+
/* Clean out callback_data as well. */
FREE_AND_NULL(renames->callback_data);
renames->callback_data_nr = renames->callback_data_alloc = 0;
}
-__attribute__((format (printf, 2, 3)))
-static int err(struct merge_options *opt, const char *err, ...)
-{
- va_list params;
- struct strbuf sb = STRBUF_INIT;
-
- strbuf_addstr(&sb, "error: ");
- va_start(params, err);
- strbuf_vaddf(&sb, err, params);
- va_end(params);
-
- error("%s", sb.buf);
- strbuf_release(&sb);
-
- return -1;
-}
-
static void format_commit(struct strbuf *sb,
int indent,
struct repository *repo,
@@ -627,29 +743,57 @@ static void format_commit(struct strbuf *sb,
strbuf_addch(sb, '\n');
}
-__attribute__((format (printf, 4, 5)))
+__attribute__((format (printf, 8, 9)))
static void path_msg(struct merge_options *opt,
- const char *path,
+ enum conflict_and_info_types type,
int omittable_hint, /* skippable under --remerge-diff */
+ const char *primary_path,
+ const char *other_path_1, /* may be NULL */
+ const char *other_path_2, /* may be NULL */
+ struct string_list *other_paths, /* may be NULL */
const char *fmt, ...)
{
va_list ap;
- struct strbuf *sb, *dest;
+ struct string_list *path_conflicts;
+ struct logical_conflict_info *info;
+ struct strbuf buf = STRBUF_INIT;
+ struct strbuf *dest;
struct strbuf tmp = STRBUF_INIT;
+ /* Sanity checks */
+ assert(omittable_hint ==
+ !starts_with(type_short_descriptions[type], "CONFLICT") ||
+ type == CONFLICT_DIR_RENAME_SUGGESTED);
if (opt->record_conflict_msgs_as_headers && omittable_hint)
return; /* Do not record mere hints in headers */
if (opt->priv->call_depth && opt->verbosity < 5)
return; /* Ignore messages from inner merges */
- sb = strmap_get(&opt->priv->output, path);
- if (!sb) {
- sb = xmalloc(sizeof(*sb));
- strbuf_init(sb, 0);
- strmap_put(&opt->priv->output, path, sb);
+ /* Ensure path_conflicts (ptr to array of logical_conflict) allocated */
+ path_conflicts = strmap_get(&opt->priv->conflicts, primary_path);
+ if (!path_conflicts) {
+ path_conflicts = xmalloc(sizeof(*path_conflicts));
+ string_list_init_dup(path_conflicts);
+ strmap_put(&opt->priv->conflicts, primary_path, path_conflicts);
}
- dest = (opt->record_conflict_msgs_as_headers ? &tmp : sb);
+ /* Add a logical_conflict at the end to store info from this call */
+ info = xcalloc(1, sizeof(*info));
+ info->type = type;
+ strvec_init(&info->paths);
+
+ /* Handle the list of paths */
+ strvec_push(&info->paths, primary_path);
+ if (other_path_1)
+ strvec_push(&info->paths, other_path_1);
+ if (other_path_2)
+ strvec_push(&info->paths, other_path_2);
+ if (other_paths)
+ for (int i = 0; i < other_paths->nr; i++)
+ strvec_push(&info->paths, other_paths->items[i].string);
+
+ /* Handle message and its format, in normal case */
+ dest = (opt->record_conflict_msgs_as_headers ? &tmp : &buf);
va_start(ap, fmt);
if (opt->priv->call_depth) {
@@ -660,32 +804,32 @@ static void path_msg(struct merge_options *opt,
strbuf_vaddf(dest, fmt, ap);
va_end(ap);
+ /* Handle specialized formatting of message under --remerge-diff */
if (opt->record_conflict_msgs_as_headers) {
int i_sb = 0, i_tmp = 0;
/* Start with the specified prefix */
if (opt->msg_header_prefix)
- strbuf_addf(sb, "%s ", opt->msg_header_prefix);
+ strbuf_addf(&buf, "%s ", opt->msg_header_prefix);
/* Copy tmp to sb, adding spaces after newlines */
- strbuf_grow(sb, sb->len + 2*tmp.len); /* more than sufficient */
+ strbuf_grow(&buf, buf.len + 2*tmp.len); /* more than sufficient */
for (; i_tmp < tmp.len; i_tmp++, i_sb++) {
/* Copy next character from tmp to sb */
- sb->buf[sb->len + i_sb] = tmp.buf[i_tmp];
+ buf.buf[buf.len + i_sb] = tmp.buf[i_tmp];
/* If we copied a newline, add a space */
if (tmp.buf[i_tmp] == '\n')
- sb->buf[++i_sb] = ' ';
+ buf.buf[++i_sb] = ' ';
}
/* Update length and ensure it's NUL-terminated */
- sb->len += i_sb;
- sb->buf[sb->len] = '\0';
+ buf.len += i_sb;
+ buf.buf[buf.len] = '\0';
strbuf_release(&tmp);
}
-
- /* Add final newline character to sb */
- strbuf_addch(sb, '\n');
+ string_list_append_nodup(path_conflicts, strbuf_detach(&buf, NULL))
+ ->util = info;
}
static struct diff_filespec *pool_alloc_filespec(struct mem_pool *pool,
@@ -1517,12 +1661,14 @@ static int collect_merge_info(struct merge_options *opt,
info.data = opt;
info.show_all_errors = 1;
- parse_tree(merge_base);
- parse_tree(side1);
- parse_tree(side2);
- init_tree_desc(t + 0, merge_base->buffer, merge_base->size);
- init_tree_desc(t + 1, side1->buffer, side1->size);
- init_tree_desc(t + 2, side2->buffer, side2->size);
+ if (parse_tree(merge_base) < 0 ||
+ parse_tree(side1) < 0 ||
+ parse_tree(side2) < 0)
+ return -1;
+ init_tree_desc(t + 0, &merge_base->object.oid,
+ merge_base->buffer, merge_base->size);
+ init_tree_desc(t + 1, &side1->object.oid, side1->buffer, side1->size);
+ init_tree_desc(t + 2, &side2->object.oid, side2->buffer, side2->size);
trace2_region_enter("merge", "traverse_trees", opt->repo);
ret = traverse_trees(NULL, 3, t, &info);
@@ -1568,7 +1714,14 @@ static int find_first_merges(struct repository *repo,
die("revision walk setup failed");
while ((commit = get_revision(&revs)) != NULL) {
struct object *o = &(commit->object);
- if (repo_in_merge_bases(repo, b, commit))
+ int ret = repo_in_merge_bases(repo, b, commit);
+
+ if (ret < 0) {
+ object_array_clear(&merges);
+ release_revisions(&revs);
+ return ret;
+ }
+ if (ret > 0)
add_object_array(o, NULL, &merges);
}
reset_revision_walk();
@@ -1583,9 +1736,17 @@ static int find_first_merges(struct repository *repo,
contains_another = 0;
for (j = 0; j < merges.nr; j++) {
struct commit *m2 = (struct commit *) merges.objects[j].item;
- if (i != j && repo_in_merge_bases(repo, m2, m1)) {
- contains_another = 1;
- break;
+ if (i != j) {
+ int ret = repo_in_merge_bases(repo, m2, m1);
+ if (ret < 0) {
+ object_array_clear(&merges);
+ release_revisions(&revs);
+ return ret;
+ }
+ if (ret > 0) {
+ contains_another = 1;
+ break;
+ }
}
}
@@ -1607,45 +1768,77 @@ static int merge_submodule(struct merge_options *opt,
{
struct repository subrepo;
struct strbuf sb = STRBUF_INIT;
- int ret = 0;
+ int ret = 0, ret2;
struct commit *commit_o, *commit_a, *commit_b;
int parent_count;
struct object_array merges;
int i;
int search = !opt->priv->call_depth;
+ int sub_not_initialized = 1;
+ int sub_flag = CONFLICT_SUBMODULE_FAILED_TO_MERGE;
/* store fallback answer in result in case we fail */
oidcpy(result, opt->priv->call_depth ? o : a);
/* we can not handle deletion conflicts */
- if (is_null_oid(o))
- return 0;
- if (is_null_oid(a))
- return 0;
- if (is_null_oid(b))
- return 0;
+ if (is_null_oid(a) || is_null_oid(b))
+ BUG("submodule deleted on one side; this should be handled outside of merge_submodule()");
+
+ if ((sub_not_initialized = repo_submodule_init(&subrepo,
+ opt->repo, path, null_oid()))) {
+ path_msg(opt, CONFLICT_SUBMODULE_NOT_INITIALIZED, 0,
+ path, NULL, NULL, NULL,
+ _("Failed to merge submodule %s (not checked out)"),
+ path);
+ sub_flag = CONFLICT_SUBMODULE_NOT_INITIALIZED;
+ goto cleanup;
+ }
- if (repo_submodule_init(&subrepo, opt->repo, path, null_oid())) {
- path_msg(opt, path, 0,
- _("Failed to merge submodule %s (not checked out)"),
- path);
- return 0;
+ if (is_null_oid(o)) {
+ path_msg(opt, CONFLICT_SUBMODULE_NULL_MERGE_BASE, 0,
+ path, NULL, NULL, NULL,
+ _("Failed to merge submodule %s (no merge base)"),
+ path);
+ goto cleanup;
}
if (!(commit_o = lookup_commit_reference(&subrepo, o)) ||
!(commit_a = lookup_commit_reference(&subrepo, a)) ||
!(commit_b = lookup_commit_reference(&subrepo, b))) {
- path_msg(opt, path, 0,
+ path_msg(opt, CONFLICT_SUBMODULE_HISTORY_NOT_AVAILABLE, 0,
+ path, NULL, NULL, NULL,
_("Failed to merge submodule %s (commits not present)"),
path);
+ sub_flag = CONFLICT_SUBMODULE_HISTORY_NOT_AVAILABLE;
goto cleanup;
}
/* check whether both changes are forward */
- if (!repo_in_merge_bases(&subrepo, commit_o, commit_a) ||
- !repo_in_merge_bases(&subrepo, commit_o, commit_b)) {
- path_msg(opt, path, 0,
+ ret2 = repo_in_merge_bases(&subrepo, commit_o, commit_a);
+ if (ret2 < 0) {
+ path_msg(opt, CONFLICT_SUBMODULE_CORRUPT, 0,
+ path, NULL, NULL, NULL,
+ _("Failed to merge submodule %s "
+ "(repository corrupt)"),
+ path);
+ ret = -1;
+ goto cleanup;
+ }
+ if (ret2 > 0)
+ ret2 = repo_in_merge_bases(&subrepo, commit_o, commit_b);
+ if (ret2 < 0) {
+ path_msg(opt, CONFLICT_SUBMODULE_CORRUPT, 0,
+ path, NULL, NULL, NULL,
+ _("Failed to merge submodule %s "
+ "(repository corrupt)"),
+ path);
+ ret = -1;
+ goto cleanup;
+ }
+ if (!ret2) {
+ path_msg(opt, CONFLICT_SUBMODULE_MAY_HAVE_REWINDS, 0,
+ path, NULL, NULL, NULL,
_("Failed to merge submodule %s "
"(commits don't follow merge-base)"),
path);
@@ -1653,17 +1846,39 @@ static int merge_submodule(struct merge_options *opt,
}
/* Case #1: a is contained in b or vice versa */
- if (repo_in_merge_bases(&subrepo, commit_a, commit_b)) {
+ ret2 = repo_in_merge_bases(&subrepo, commit_a, commit_b);
+ if (ret2 < 0) {
+ path_msg(opt, CONFLICT_SUBMODULE_CORRUPT, 0,
+ path, NULL, NULL, NULL,
+ _("Failed to merge submodule %s "
+ "(repository corrupt)"),
+ path);
+ ret = -1;
+ goto cleanup;
+ }
+ if (ret2 > 0) {
oidcpy(result, b);
- path_msg(opt, path, 1,
+ path_msg(opt, INFO_SUBMODULE_FAST_FORWARDING, 1,
+ path, NULL, NULL, NULL,
_("Note: Fast-forwarding submodule %s to %s"),
path, oid_to_hex(b));
ret = 1;
goto cleanup;
}
- if (repo_in_merge_bases(&subrepo, commit_b, commit_a)) {
+ ret2 = repo_in_merge_bases(&subrepo, commit_b, commit_a);
+ if (ret2 < 0) {
+ path_msg(opt, CONFLICT_SUBMODULE_CORRUPT, 0,
+ path, NULL, NULL, NULL,
+ _("Failed to merge submodule %s "
+ "(repository corrupt)"),
+ path);
+ ret = -1;
+ goto cleanup;
+ }
+ if (ret2 > 0) {
oidcpy(result, a);
- path_msg(opt, path, 1,
+ path_msg(opt, INFO_SUBMODULE_FAST_FORWARDING, 1,
+ path, NULL, NULL, NULL,
_("Note: Fast-forwarding submodule %s to %s"),
path, oid_to_hex(a));
ret = 1;
@@ -1685,31 +1900,36 @@ static int merge_submodule(struct merge_options *opt,
parent_count = find_first_merges(&subrepo, path, commit_a, commit_b,
&merges);
switch (parent_count) {
+ case -1:
+ path_msg(opt, CONFLICT_SUBMODULE_CORRUPT, 0,
+ path, NULL, NULL, NULL,
+ _("Failed to merge submodule %s "
+ "(repository corrupt)"),
+ path);
+ ret = -1;
+ break;
case 0:
- path_msg(opt, path, 0, _("Failed to merge submodule %s"), path);
+ path_msg(opt, CONFLICT_SUBMODULE_FAILED_TO_MERGE, 0,
+ path, NULL, NULL, NULL,
+ _("Failed to merge submodule %s"), path);
break;
case 1:
format_commit(&sb, 4, &subrepo,
(struct commit *)merges.objects[0].item);
- path_msg(opt, path, 0,
+ path_msg(opt, CONFLICT_SUBMODULE_FAILED_TO_MERGE_BUT_POSSIBLE_RESOLUTION, 0,
+ path, NULL, NULL, NULL,
_("Failed to merge submodule %s, but a possible merge "
- "resolution exists:\n%s\n"),
+ "resolution exists: %s"),
path, sb.buf);
- path_msg(opt, path, 1,
- _("If this is correct simply add it to the index "
- "for example\n"
- "by using:\n\n"
- " git update-index --cacheinfo 160000 %s \"%s\"\n\n"
- "which will accept this suggestion.\n"),
- oid_to_hex(&merges.objects[0].item->oid), path);
strbuf_release(&sb);
break;
default:
for (i = 0; i < merges.nr; i++)
format_commit(&sb, 4, &subrepo,
(struct commit *)merges.objects[i].item);
- path_msg(opt, path, 0,
+ path_msg(opt, CONFLICT_SUBMODULE_FAILED_TO_MERGE_BUT_POSSIBLE_RESOLUTION, 0,
+ path, NULL, NULL, NULL,
_("Failed to merge submodule %s, but multiple "
"possible merges exist:\n%s"), path, sb.buf);
strbuf_release(&sb);
@@ -1717,7 +1937,23 @@ static int merge_submodule(struct merge_options *opt,
object_array_clear(&merges);
cleanup:
- repo_clear(&subrepo);
+ if (!opt->priv->call_depth && !ret) {
+ struct string_list *csub = &opt->priv->conflicted_submodules;
+ struct conflicted_submodule_item *util;
+ const char *abbrev;
+
+ util = xmalloc(sizeof(*util));
+ util->flag = sub_flag;
+ util->abbrev = NULL;
+ if (!sub_not_initialized) {
+ abbrev = repo_find_unique_abbrev(&subrepo, b, DEFAULT_ABBREV);
+ util->abbrev = xstrdup(abbrev);
+ }
+ string_list_append(csub, path)->util = util;
+ }
+
+ if (!sub_not_initialized)
+ repo_clear(&subrepo);
return ret;
}
@@ -1733,6 +1969,7 @@ static void initialize_attr_index(struct merge_options *opt)
struct index_state *attr_index = &opt->priv->attr_index;
struct cache_entry *ce;
+ attr_index->repo = opt->repo;
attr_index->initialized = 1;
if (!opt->renormalize)
@@ -1788,7 +2025,7 @@ static int merge_3way(struct merge_options *opt,
mmbuffer_t *result_buf)
{
mmfile_t orig, src1, src2;
- struct ll_merge_options ll_opts = {0};
+ struct ll_merge_options ll_opts = LL_MERGE_OPTIONS_INIT;
char *base, *name1, *name2;
enum ll_merge_result merge_status;
@@ -1798,6 +2035,7 @@ static int merge_3way(struct merge_options *opt,
ll_opts.renormalize = opt->renormalize;
ll_opts.extra_marker_size = extra_marker_size;
ll_opts.xdl_opts = opt->xdl_opts;
+ ll_opts.conflict_style = opt->conflict_style;
if (opt->priv->call_depth) {
ll_opts.virtual_ancestor = 1;
@@ -1835,7 +2073,8 @@ static int merge_3way(struct merge_options *opt,
&src1, name1, &src2, name2,
&opt->priv->attr_index, &ll_opts);
if (merge_status == LL_MERGE_BINARY_CONFLICT)
- path_msg(opt, path, 0,
+ path_msg(opt, CONFLICT_BINARY, 0,
+ path, NULL, NULL, NULL,
"warning: Cannot merge binary files: %s (%s vs. %s)",
path, name1, name2);
@@ -1866,7 +2105,7 @@ static int handle_content_merge(struct merge_options *opt,
* the three blobs to merge on various sides of history.
*
* extra_marker_size is the amount to extend conflict markers in
- * ll_merge; this is neeed if we have content merges of content
+ * ll_merge; this is needed if we have content merges of content
* merges, which happens for example with rename/rename(2to1) and
* rename/add conflicts.
*/
@@ -1935,19 +2174,19 @@ static int handle_content_merge(struct merge_options *opt,
&result_buf);
if ((merge_status < 0) || !result_buf.ptr)
- ret = err(opt, _("Failed to execute internal merge"));
+ ret = error(_("failed to execute internal merge"));
if (!ret &&
write_object_file(result_buf.ptr, result_buf.size,
OBJ_BLOB, &result->oid))
- ret = err(opt, _("Unable to add %s to database"),
- path);
+ ret = error(_("unable to add %s to database"), path);
free(result_buf.ptr);
if (ret)
return -1;
clean &= (merge_status == 0);
- path_msg(opt, path, 1, _("Auto-merging %s"), path);
+ path_msg(opt, INFO_AUTO_MERGING, 1, path, NULL, NULL, NULL,
+ _("Auto-merging %s"), path);
} else if (S_ISGITLINK(a->mode)) {
int two_way = ((S_IFMT & o->mode) != (S_IFMT & a->mode));
clean = merge_submodule(opt, pathnames[0],
@@ -2085,21 +2324,24 @@ static char *handle_path_level_conflicts(struct merge_options *opt,
c_info->reported_already = 1;
strbuf_add_separated_string_list(&collision_paths, ", ",
&c_info->source_files);
- path_msg(opt, new_path, 0,
- _("CONFLICT (implicit dir rename): Existing file/dir "
- "at %s in the way of implicit directory rename(s) "
- "putting the following path(s) there: %s."),
- new_path, collision_paths.buf);
+ path_msg(opt, CONFLICT_DIR_RENAME_FILE_IN_WAY, 0,
+ new_path, NULL, NULL, &c_info->source_files,
+ _("CONFLICT (implicit dir rename): Existing "
+ "file/dir at %s in the way of implicit "
+ "directory rename(s) putting the following "
+ "path(s) there: %s."),
+ new_path, collision_paths.buf);
clean = 0;
} else if (c_info->source_files.nr > 1) {
c_info->reported_already = 1;
strbuf_add_separated_string_list(&collision_paths, ", ",
&c_info->source_files);
- path_msg(opt, new_path, 0,
- _("CONFLICT (implicit dir rename): Cannot map more "
- "than one path to %s; implicit directory renames "
- "tried to put these paths there: %s"),
- new_path, collision_paths.buf);
+ path_msg(opt, CONFLICT_DIR_RENAME_COLLISION, 0,
+ new_path, NULL, NULL, &c_info->source_files,
+ _("CONFLICT (implicit dir rename): Cannot map "
+ "more than one path to %s; implicit directory "
+ "renames tried to put these paths there: %s"),
+ new_path, collision_paths.buf);
clean = 0;
}
@@ -2153,13 +2395,14 @@ static void get_provisional_directory_renames(struct merge_options *opt,
continue;
if (bad_max == max) {
- path_msg(opt, source_dir, 0,
- _("CONFLICT (directory rename split): "
- "Unclear where to rename %s to; it was "
- "renamed to multiple other directories, with "
- "no destination getting a majority of the "
- "files."),
- source_dir);
+ path_msg(opt, CONFLICT_DIR_RENAME_SPLIT, 0,
+ source_dir, NULL, NULL, NULL,
+ _("CONFLICT (directory rename split): "
+ "Unclear where to rename %s to; it was "
+ "renamed to multiple other directories, "
+ "with no destination getting a majority of "
+ "the files."),
+ source_dir);
*clean = 0;
} else {
strmap_put(&renames->dir_renames[side],
@@ -2334,7 +2577,8 @@ static char *check_for_directory_rename(struct merge_options *opt,
new_dir = rename_info->value; /* old_dir = rename_info->key; */
otherinfo = strmap_get_entry(dir_rename_exclusions, new_dir);
if (otherinfo) {
- path_msg(opt, rename_info->key, 1,
+ path_msg(opt, INFO_DIR_RENAME_SKIPPED_DUE_TO_RERENAME, 1,
+ rename_info->key, path, new_dir, NULL,
_("WARNING: Avoiding applying %s -> %s rename "
"to %s, because %s itself was renamed."),
rename_info->key, new_dir, path, new_dir);
@@ -2437,8 +2681,40 @@ static void apply_directory_rename_modifications(struct merge_options *opt,
}
assert(ci->filemask == 2 || ci->filemask == 4);
- assert(ci->dirmask == 0);
- strmap_remove(&opt->priv->paths, old_path, 0);
+ assert(ci->dirmask == 0 || ci->dirmask == 1);
+ if (ci->dirmask == 0)
+ strmap_remove(&opt->priv->paths, old_path, 0);
+ else {
+ /*
+ * This file exists on one side, but we still had a directory
+ * at the old location that we can't remove until after
+ * processing all paths below it. So, make a copy of ci in
+ * new_ci and only put the file information into it.
+ */
+ new_ci = mem_pool_calloc(&opt->priv->pool, 1, sizeof(*new_ci));
+ memcpy(new_ci, ci, sizeof(*ci));
+ assert(!new_ci->match_mask);
+ new_ci->dirmask = 0;
+ new_ci->stages[1].mode = 0;
+ oidcpy(&new_ci->stages[1].oid, null_oid());
+
+ /*
+ * Now that we have the file information in new_ci, make sure
+ * ci only has the directory information.
+ */
+ ci->filemask = 0;
+ ci->merged.clean = 1;
+ for (i = MERGE_BASE; i <= MERGE_SIDE2; i++) {
+ if (ci->dirmask & (1 << i))
+ continue;
+ /* zero out any entries related to files */
+ ci->stages[i].mode = 0;
+ oidcpy(&ci->stages[i].oid, null_oid());
+ }
+
+ /* Now we want to focus on new_ci, so reassign ci to it. */
+ ci = new_ci;
+ }
branch_with_new_path = (ci->filemask == 2) ? opt->branch1 : opt->branch2;
branch_with_dir_rename = (ci->filemask == 2) ? opt->branch2 : opt->branch1;
@@ -2475,14 +2751,16 @@ static void apply_directory_rename_modifications(struct merge_options *opt,
if (opt->detect_directory_renames == MERGE_DIRECTORY_RENAMES_TRUE) {
/* Notify user of updated path */
if (pair->status == 'A')
- path_msg(opt, new_path, 1,
+ path_msg(opt, INFO_DIR_RENAME_APPLIED, 1,
+ new_path, old_path, NULL, NULL,
_("Path updated: %s added in %s inside a "
"directory that was renamed in %s; moving "
"it to %s."),
old_path, branch_with_new_path,
branch_with_dir_rename, new_path);
else
- path_msg(opt, new_path, 1,
+ path_msg(opt, INFO_DIR_RENAME_APPLIED, 1,
+ new_path, old_path, NULL, NULL,
_("Path updated: %s renamed to %s in %s, "
"inside a directory that was renamed in %s; "
"moving it to %s."),
@@ -2495,7 +2773,8 @@ static void apply_directory_rename_modifications(struct merge_options *opt,
*/
ci->path_conflict = 1;
if (pair->status == 'A')
- path_msg(opt, new_path, 1,
+ path_msg(opt, CONFLICT_DIR_RENAME_SUGGESTED, 1,
+ new_path, old_path, NULL, NULL,
_("CONFLICT (file location): %s added in %s "
"inside a directory that was renamed in %s, "
"suggesting it should perhaps be moved to "
@@ -2503,7 +2782,8 @@ static void apply_directory_rename_modifications(struct merge_options *opt,
old_path, branch_with_new_path,
branch_with_dir_rename, new_path);
else
- path_msg(opt, new_path, 1,
+ path_msg(opt, CONFLICT_DIR_RENAME_SUGGESTED, 1,
+ new_path, old_path, NULL, NULL,
_("CONFLICT (file location): %s renamed to %s "
"in %s, inside a directory that was renamed "
"in %s, suggesting it should perhaps be "
@@ -2621,6 +2901,8 @@ static int process_renames(struct merge_options *opt,
pathnames,
1 + 2 * opt->priv->call_depth,
&merged);
+ if (clean_merge < 0)
+ return -1;
if (!clean_merge &&
merged.mode == side1->stages[1].mode &&
oideq(&merged.oid, &side1->stages[1].oid))
@@ -2659,7 +2941,8 @@ static int process_renames(struct merge_options *opt,
* and remove the setting of base->path_conflict to 1.
*/
base->path_conflict = 1;
- path_msg(opt, oldpath, 0,
+ path_msg(opt, CONFLICT_RENAME_RENAME, 0,
+ pathnames[0], pathnames[1], pathnames[2], NULL,
_("CONFLICT (rename/rename): %s renamed to "
"%s in %s and to %s in %s."),
pathnames[0],
@@ -2729,7 +3012,7 @@ static int process_renames(struct merge_options *opt,
struct version_info merged;
struct conflict_info *base, *side1, *side2;
- unsigned clean;
+ int clean;
pathnames[0] = oldpath;
pathnames[other_source_index] = oldpath;
@@ -2750,11 +3033,14 @@ static int process_renames(struct merge_options *opt,
pathnames,
1 + 2 * opt->priv->call_depth,
&merged);
+ if (clean < 0)
+ return -1;
memcpy(&newinfo->stages[target_index], &merged,
sizeof(merged));
if (!clean) {
- path_msg(opt, newpath, 0,
+ path_msg(opt, CONFLICT_RENAME_COLLIDES, 0,
+ newpath, oldpath, NULL, NULL,
_("CONFLICT (rename involved in "
"collision): rename of %s -> %s has "
"content conflicts AND collides "
@@ -2773,7 +3059,8 @@ static int process_renames(struct merge_options *opt,
*/
newinfo->path_conflict = 1;
- path_msg(opt, newpath, 0,
+ path_msg(opt, CONFLICT_RENAME_DELETE, 0,
+ newpath, oldpath, NULL, NULL,
_("CONFLICT (rename/delete): %s renamed "
"to %s in %s, but deleted in %s."),
oldpath, newpath, rename_branch, delete_branch);
@@ -2797,7 +3084,8 @@ static int process_renames(struct merge_options *opt,
} else if (source_deleted) {
/* rename/delete */
newinfo->path_conflict = 1;
- path_msg(opt, newpath, 0,
+ path_msg(opt, CONFLICT_RENAME_DELETE, 0,
+ newpath, oldpath, NULL, NULL,
_("CONFLICT (rename/delete): %s renamed"
" to %s in %s, but deleted in %s."),
oldpath, newpath,
@@ -3105,10 +3393,7 @@ static int collect_renames(struct merge_options *opt,
return clean;
}
-static int detect_and_process_renames(struct merge_options *opt,
- struct tree *merge_base,
- struct tree *side1,
- struct tree *side2)
+static int detect_and_process_renames(struct merge_options *opt)
{
struct diff_queue_struct combined = { 0 };
struct rename_info *renames = &opt->priv->renames;
@@ -3272,19 +3557,18 @@ static int sort_dirs_next_to_their_children(const char *one, const char *two)
return c1 - c2;
}
-static int read_oid_strbuf(struct merge_options *opt,
- const struct object_id *oid,
+static int read_oid_strbuf(const struct object_id *oid,
struct strbuf *dst)
{
void *buf;
enum object_type type;
unsigned long size;
- buf = read_object_file(oid, &type, &size);
+ buf = repo_read_object_file(the_repository, oid, &type, &size);
if (!buf)
- return err(opt, _("cannot read object %s"), oid_to_hex(oid));
+ return error(_("cannot read object %s"), oid_to_hex(oid));
if (type != OBJ_BLOB) {
free(buf);
- return err(opt, _("object %s is not a blob"), oid_to_hex(oid));
+ return error(_("object %s is not a blob"), oid_to_hex(oid));
}
strbuf_attach(dst, buf, size, size + 1);
return 0;
@@ -3308,8 +3592,8 @@ static int blob_unchanged(struct merge_options *opt,
if (oideq(&base->oid, &side->oid))
return 1;
- if (read_oid_strbuf(opt, &base->oid, &basebuf) ||
- read_oid_strbuf(opt, &side->oid, &sidebuf))
+ if (read_oid_strbuf(&base->oid, &basebuf) ||
+ read_oid_strbuf(&side->oid, &sidebuf))
goto error_return;
/*
* Note: binary | is used so that both renormalizations are
@@ -3381,15 +3665,15 @@ static int tree_entry_order(const void *a_, const void *b_)
b->string, strlen(b->string), bmi->result.mode);
}
-static void write_tree(struct object_id *result_oid,
- struct string_list *versions,
- unsigned int offset,
- size_t hash_size)
+static int write_tree(struct object_id *result_oid,
+ struct string_list *versions,
+ unsigned int offset,
+ size_t hash_size)
{
size_t maxlen = 0, extra;
unsigned int nr;
struct strbuf buf = STRBUF_INIT;
- int i;
+ int i, ret = 0;
assert(offset <= versions->nr);
nr = versions->nr - offset;
@@ -3415,8 +3699,10 @@ static void write_tree(struct object_id *result_oid,
}
/* Write this object file out, and record in result_oid */
- write_object_file(buf.buf, buf.len, OBJ_TREE, result_oid);
+ if (write_object_file(buf.buf, buf.len, OBJ_TREE, result_oid))
+ ret = -1;
strbuf_release(&buf);
+ return ret;
}
static void record_entry_for_tree(struct directory_versions *dir_metadata,
@@ -3435,13 +3721,13 @@ static void record_entry_for_tree(struct directory_versions *dir_metadata,
basename)->util = &mi->result;
}
-static void write_completed_directory(struct merge_options *opt,
- const char *new_directory_name,
- struct directory_versions *info)
+static int write_completed_directory(struct merge_options *opt,
+ const char *new_directory_name,
+ struct directory_versions *info)
{
const char *prev_dir;
struct merged_info *dir_info = NULL;
- unsigned int offset;
+ unsigned int offset, ret = 0;
/*
* Some explanation of info->versions and info->offsets...
@@ -3527,7 +3813,7 @@ static void write_completed_directory(struct merge_options *opt,
* strcmp here.)
*/
if (new_directory_name == info->last_directory)
- return;
+ return 0;
/*
* If we are just starting (last_directory is NULL), or last_directory
@@ -3549,7 +3835,7 @@ static void write_completed_directory(struct merge_options *opt,
*/
string_list_append(&info->offsets,
info->last_directory)->util = (void*)offset;
- return;
+ return 0;
}
/*
@@ -3579,8 +3865,9 @@ static void write_completed_directory(struct merge_options *opt,
*/
dir_info->is_null = 0;
dir_info->result.mode = S_IFDIR;
- write_tree(&dir_info->result.oid, &info->versions, offset,
- opt->repo->hash_algo->rawsz);
+ if (write_tree(&dir_info->result.oid, &info->versions, offset,
+ opt->repo->hash_algo->rawsz) < 0)
+ ret = -1;
}
/*
@@ -3608,13 +3895,15 @@ static void write_completed_directory(struct merge_options *opt,
/* And, of course, we need to update last_directory to match. */
info->last_directory = new_directory_name;
info->last_directory_len = strlen(info->last_directory);
+
+ return ret;
}
/* Per entry merge function */
-static void process_entry(struct merge_options *opt,
- const char *path,
- struct conflict_info *ci,
- struct directory_versions *dir_metadata)
+static int process_entry(struct merge_options *opt,
+ const char *path,
+ struct conflict_info *ci,
+ struct directory_versions *dir_metadata)
{
int df_file_index = 0;
@@ -3628,7 +3917,7 @@ static void process_entry(struct merge_options *opt,
record_entry_for_tree(dir_metadata, path, &ci->merged);
if (ci->filemask == 0)
/* nothing else to handle */
- return;
+ return 0;
assert(ci->df_conflict);
}
@@ -3675,7 +3964,7 @@ static void process_entry(struct merge_options *opt,
*/
if (ci->filemask == 1) {
ci->filemask = 0;
- return;
+ return 0;
}
/*
@@ -3712,7 +4001,8 @@ static void process_entry(struct merge_options *opt,
path = unique_path(opt, path, branch);
strmap_put(&opt->priv->paths, path, new_ci);
- path_msg(opt, path, 0,
+ path_msg(opt, CONFLICT_FILE_DIRECTORY, 0,
+ path, old_path, NULL, NULL,
_("CONFLICT (file/directory): directory in the way "
"of %s from %s; moving it to %s instead."),
old_path, branch, path);
@@ -3788,15 +4078,23 @@ static void process_entry(struct merge_options *opt,
rename_b = 1;
}
+ if (rename_a)
+ a_path = unique_path(opt, path, opt->branch1);
+ if (rename_b)
+ b_path = unique_path(opt, path, opt->branch2);
+
if (rename_a && rename_b) {
- path_msg(opt, path, 0,
+ path_msg(opt, CONFLICT_DISTINCT_MODES, 0,
+ path, a_path, b_path, NULL,
_("CONFLICT (distinct types): %s had "
"different types on each side; "
"renamed both of them so each can "
"be recorded somewhere."),
path);
} else {
- path_msg(opt, path, 0,
+ path_msg(opt, CONFLICT_DISTINCT_MODES, 0,
+ path, rename_a ? a_path : b_path,
+ NULL, NULL,
_("CONFLICT (distinct types): %s had "
"different types on each side; "
"renamed one of them so each can be "
@@ -3833,14 +4131,10 @@ static void process_entry(struct merge_options *opt,
/* Insert entries into opt->priv_paths */
assert(rename_a || rename_b);
- if (rename_a) {
- a_path = unique_path(opt, path, opt->branch1);
+ if (rename_a)
strmap_put(&opt->priv->paths, a_path, ci);
- }
- if (rename_b)
- b_path = unique_path(opt, path, opt->branch2);
- else
+ if (!rename_b)
b_path = path;
strmap_put(&opt->priv->paths, b_path, new_ci);
@@ -3865,7 +4159,7 @@ static void process_entry(struct merge_options *opt,
} else if (ci->filemask >= 6) {
/* Need a two-way or three-way content merge */
struct version_info merged_file;
- unsigned clean_merge;
+ int clean_merge;
struct version_info *o = &ci->stages[0];
struct version_info *a = &ci->stages[1];
struct version_info *b = &ci->stages[2];
@@ -3874,6 +4168,8 @@ static void process_entry(struct merge_options *opt,
ci->pathnames,
opt->priv->call_depth * 2,
&merged_file);
+ if (clean_merge < 0)
+ return -1;
ci->merged.clean = clean_merge &&
!ci->df_conflict && !ci->path_conflict;
ci->merged.result.mode = merged_file.mode;
@@ -3891,7 +4187,8 @@ static void process_entry(struct merge_options *opt,
reason = _("add/add");
if (S_ISGITLINK(merged_file.mode))
reason = _("submodule");
- path_msg(opt, path, 0,
+ path_msg(opt, CONFLICT_CONTENTS, 0,
+ path, NULL, NULL, NULL,
_("CONFLICT (%s): Merge conflict in %s"),
reason, path);
}
@@ -3935,7 +4232,8 @@ static void process_entry(struct merge_options *opt,
* since the contents were not modified.
*/
} else {
- path_msg(opt, path, 0,
+ path_msg(opt, CONFLICT_MODIFY_DELETE, 0,
+ path, NULL, NULL, NULL,
_("CONFLICT (modify/delete): %s deleted in %s "
"and modified in %s. Version %s of %s left "
"in tree."),
@@ -3967,6 +4265,7 @@ static void process_entry(struct merge_options *opt,
/* Record metadata for ci->merged in dir_metadata */
record_entry_for_tree(dir_metadata, path, &ci->merged);
+ return 0;
}
static void prefetch_for_content_merges(struct merge_options *opt,
@@ -3975,7 +4274,7 @@ static void prefetch_for_content_merges(struct merge_options *opt,
struct string_list_item *e;
struct oid_array to_fetch = OID_ARRAY_INIT;
- if (opt->repo != the_repository || !has_promisor_remote())
+ if (opt->repo != the_repository || !repo_has_promisor_remote(the_repository))
return;
for (e = &plist->items[plist->nr-1]; e >= plist->items; --e) {
@@ -4017,8 +4316,8 @@ static void prefetch_for_content_merges(struct merge_options *opt,
oid_array_clear(&to_fetch);
}
-static void process_entries(struct merge_options *opt,
- struct object_id *result_oid)
+static int process_entries(struct merge_options *opt,
+ struct object_id *result_oid)
{
struct hashmap_iter iter;
struct strmap_entry *e;
@@ -4027,11 +4326,12 @@ static void process_entries(struct merge_options *opt,
struct directory_versions dir_metadata = { STRING_LIST_INIT_NODUP,
STRING_LIST_INIT_NODUP,
NULL, 0 };
+ int ret = 0;
trace2_region_enter("merge", "process_entries setup", opt->repo);
if (strmap_empty(&opt->priv->paths)) {
oidcpy(result_oid, opt->repo->hash_algo->empty_tree);
- return;
+ return 0;
}
/* Hack to pre-allocate plist to the desired size */
@@ -4073,13 +4373,19 @@ static void process_entries(struct merge_options *opt,
*/
struct merged_info *mi = entry->util;
- write_completed_directory(opt, mi->directory_name,
- &dir_metadata);
+ if (write_completed_directory(opt, mi->directory_name,
+ &dir_metadata) < 0) {
+ ret = -1;
+ goto cleanup;
+ }
if (mi->clean)
record_entry_for_tree(&dir_metadata, path, mi);
else {
struct conflict_info *ci = (struct conflict_info *)mi;
- process_entry(opt, path, ci, &dir_metadata);
+ if (process_entry(opt, path, ci, &dir_metadata) < 0) {
+ ret = -1;
+ goto cleanup;
+ };
}
}
trace2_region_leave("merge", "processing", opt->repo);
@@ -4094,12 +4400,16 @@ static void process_entries(struct merge_options *opt,
fflush(stdout);
BUG("dir_metadata accounting completely off; shouldn't happen");
}
- write_tree(result_oid, &dir_metadata.versions, 0,
- opt->repo->hash_algo->rawsz);
+ if (write_tree(result_oid, &dir_metadata.versions, 0,
+ opt->repo->hash_algo->rawsz) < 0)
+ ret = -1;
+cleanup:
string_list_clear(&plist, 0);
string_list_clear(&dir_metadata.versions, 0);
string_list_clear(&dir_metadata.offsets, 0);
trace2_region_leave("merge", "process_entries cleanup", opt->repo);
+
+ return ret;
}
/*** Function Grouping: functions related to merge_switch_to_result() ***/
@@ -4136,10 +4446,12 @@ static int checkout(struct merge_options *opt,
unpack_opts.verbose_update = (opt->verbosity > 2);
unpack_opts.fn = twoway_merge;
unpack_opts.preserve_ignored = 0; /* FIXME: !opts->overwrite_ignore */
- parse_tree(prev);
- init_tree_desc(&trees[0], prev->buffer, prev->size);
- parse_tree(next);
- init_tree_desc(&trees[1], next->buffer, next->size);
+ if (parse_tree(prev) < 0)
+ return -1;
+ init_tree_desc(&trees[0], &prev->object.oid, prev->buffer, prev->size);
+ if (parse_tree(next) < 0)
+ return -1;
+ init_tree_desc(&trees[1], &next->object.oid, next->buffer, next->size);
ret = unpack_trees(2, trees, &unpack_opts);
clear_unpack_trees_porcelain(&unpack_opts);
@@ -4223,21 +4535,8 @@ static int record_conflicted_index_entries(struct merge_options *opt)
* the CE_SKIP_WORKTREE bit and manually write those
* files to the working disk here.
*/
- if (ce_skip_worktree(ce)) {
- struct stat st;
-
- if (!lstat(path, &st)) {
- char *new_name = unique_path(opt,
- path,
- "cruft");
-
- path_msg(opt, path, 1,
- _("Note: %s not up to date and in way of checking out conflicted version; old copy renamed to %s"),
- path, new_name);
- errs |= rename(path, new_name);
- }
+ if (ce_skip_worktree(ce))
errs |= checkout_entry(ce, &state, NULL, NULL);
- }
/*
* Mark this cache entry for removal and instead add
@@ -4279,6 +4578,152 @@ static int record_conflicted_index_entries(struct merge_options *opt)
return errs;
}
+static void print_submodule_conflict_suggestion(struct string_list *csub) {
+ struct string_list_item *item;
+ struct strbuf msg = STRBUF_INIT;
+ struct strbuf tmp = STRBUF_INIT;
+ struct strbuf subs = STRBUF_INIT;
+
+ if (!csub->nr)
+ return;
+
+ strbuf_add_separated_string_list(&subs, " ", csub);
+ for_each_string_list_item(item, csub) {
+ struct conflicted_submodule_item *util = item->util;
+
+ /*
+ * NEEDSWORK: The steps to resolve these errors deserve a more
+ * detailed explanation than what is currently printed below.
+ */
+ if (util->flag == CONFLICT_SUBMODULE_NOT_INITIALIZED ||
+ util->flag == CONFLICT_SUBMODULE_HISTORY_NOT_AVAILABLE)
+ continue;
+
+ /*
+ * TRANSLATORS: This is a line of advice to resolve a merge
+ * conflict in a submodule. The first argument is the submodule
+ * name, and the second argument is the abbreviated id of the
+ * commit that needs to be merged. For example:
+ * - go to submodule (mysubmodule), and either merge commit abc1234"
+ */
+ strbuf_addf(&tmp, _(" - go to submodule (%s), and either merge commit %s\n"
+ " or update to an existing commit which has merged those changes\n"),
+ item->string, util->abbrev);
+ }
+
+ /*
+ * TRANSLATORS: This is a detailed message for resolving submodule
+ * conflicts. The first argument is string containing one step per
+ * submodule. The second is a space-separated list of submodule names.
+ */
+ strbuf_addf(&msg,
+ _("Recursive merging with submodules currently only supports trivial cases.\n"
+ "Please manually handle the merging of each conflicted submodule.\n"
+ "This can be accomplished with the following steps:\n"
+ "%s"
+ " - come back to superproject and run:\n\n"
+ " git add %s\n\n"
+ " to record the above merge or update\n"
+ " - resolve any other conflicts in the superproject\n"
+ " - commit the resulting index in the superproject\n"),
+ tmp.buf, subs.buf);
+
+ advise_if_enabled(ADVICE_SUBMODULE_MERGE_CONFLICT, "%s", msg.buf);
+
+ strbuf_release(&subs);
+ strbuf_release(&tmp);
+ strbuf_release(&msg);
+}
+
+void merge_display_update_messages(struct merge_options *opt,
+ int detailed,
+ struct merge_result *result)
+{
+ struct merge_options_internal *opti = result->priv;
+ struct hashmap_iter iter;
+ struct strmap_entry *e;
+ struct string_list olist = STRING_LIST_INIT_NODUP;
+
+ if (opt->record_conflict_msgs_as_headers)
+ BUG("Either display conflict messages or record them as headers, not both");
+
+ trace2_region_enter("merge", "display messages", opt->repo);
+
+ /* Hack to pre-allocate olist to the desired size */
+ ALLOC_GROW(olist.items, strmap_get_size(&opti->conflicts),
+ olist.alloc);
+
+ /* Put every entry from output into olist, then sort */
+ strmap_for_each_entry(&opti->conflicts, &iter, e) {
+ string_list_append(&olist, e->key)->util = e->value;
+ }
+ string_list_sort(&olist);
+
+ /* Iterate over the items, printing them */
+ for (int path_nr = 0; path_nr < olist.nr; ++path_nr) {
+ struct string_list *conflicts = olist.items[path_nr].util;
+ for (int i = 0; i < conflicts->nr; i++) {
+ struct logical_conflict_info *info =
+ conflicts->items[i].util;
+
+ if (detailed) {
+ printf("%lu", (unsigned long)info->paths.nr);
+ putchar('\0');
+ for (int n = 0; n < info->paths.nr; n++) {
+ fputs(info->paths.v[n], stdout);
+ putchar('\0');
+ }
+ fputs(type_short_descriptions[info->type],
+ stdout);
+ putchar('\0');
+ }
+ puts(conflicts->items[i].string);
+ if (detailed)
+ putchar('\0');
+ }
+ }
+ string_list_clear(&olist, 0);
+
+ print_submodule_conflict_suggestion(&opti->conflicted_submodules);
+
+ /* Also include needed rename limit adjustment now */
+ diff_warn_rename_limit("merge.renamelimit",
+ opti->renames.needed_limit, 0);
+
+ trace2_region_leave("merge", "display messages", opt->repo);
+}
+
+void merge_get_conflicted_files(struct merge_result *result,
+ struct string_list *conflicted_files)
+{
+ struct hashmap_iter iter;
+ struct strmap_entry *e;
+ struct merge_options_internal *opti = result->priv;
+
+ strmap_for_each_entry(&opti->conflicted, &iter, e) {
+ const char *path = e->key;
+ struct conflict_info *ci = e->value;
+ int i;
+
+ VERIFY_CI(ci);
+
+ for (i = MERGE_BASE; i <= MERGE_SIDE2; i++) {
+ struct stage_info *si;
+
+ if (!(ci->filemask & (1ul << i)))
+ continue;
+
+ si = xmalloc(sizeof(*si));
+ si->stage = i+1;
+ si->mode = ci->stages[i].mode;
+ oidcpy(&si->oid, &ci->stages[i].oid);
+ string_list_append(conflicted_files, path)->util = si;
+ }
+ }
+ /* string_list_sort() uses a stable sort, so we're good */
+ string_list_sort(conflicted_files);
+}
+
void merge_switch_to_result(struct merge_options *opt,
struct tree *head,
struct merge_result *result,
@@ -4287,13 +4732,12 @@ void merge_switch_to_result(struct merge_options *opt,
{
assert(opt->priv == NULL);
if (result->clean >= 0 && update_worktree_and_index) {
- const char *filename;
- FILE *fp;
-
trace2_region_enter("merge", "checkout", opt->repo);
if (checkout(opt, head, result->tree)) {
/* failure to function */
result->clean = -1;
+ merge_finalize(opt, result);
+ trace2_region_leave("merge", "checkout", opt->repo);
return;
}
trace2_region_leave("merge", "checkout", opt->repo);
@@ -4304,55 +4748,30 @@ void merge_switch_to_result(struct merge_options *opt,
/* failure to function */
opt->priv = NULL;
result->clean = -1;
+ merge_finalize(opt, result);
+ trace2_region_leave("merge", "record_conflicted",
+ opt->repo);
return;
}
opt->priv = NULL;
trace2_region_leave("merge", "record_conflicted", opt->repo);
trace2_region_enter("merge", "write_auto_merge", opt->repo);
- filename = git_path_auto_merge(opt->repo);
- fp = xfopen(filename, "w");
- fprintf(fp, "%s\n", oid_to_hex(&result->tree->object.oid));
- fclose(fp);
- trace2_region_leave("merge", "write_auto_merge", opt->repo);
- }
-
- if (display_update_msgs) {
- struct merge_options_internal *opti = result->priv;
- struct hashmap_iter iter;
- struct strmap_entry *e;
- struct string_list olist = STRING_LIST_INIT_NODUP;
- int i;
-
- if (opt->record_conflict_msgs_as_headers)
- BUG("Either display conflict messages or record them as headers, not both");
-
- trace2_region_enter("merge", "display messages", opt->repo);
-
- /* Hack to pre-allocate olist to the desired size */
- ALLOC_GROW(olist.items, strmap_get_size(&opti->output),
- olist.alloc);
-
- /* Put every entry from output into olist, then sort */
- strmap_for_each_entry(&opti->output, &iter, e) {
- string_list_append(&olist, e->key)->util = e->value;
- }
- string_list_sort(&olist);
-
- /* Iterate over the items, printing them */
- for (i = 0; i < olist.nr; ++i) {
- struct strbuf *sb = olist.items[i].util;
-
- printf("%s", sb->buf);
+ if (refs_update_ref(get_main_ref_store(opt->repo), "", "AUTO_MERGE",
+ &result->tree->object.oid, NULL, REF_NO_DEREF,
+ UPDATE_REFS_MSG_ON_ERR)) {
+ /* failure to function */
+ opt->priv = NULL;
+ result->clean = -1;
+ merge_finalize(opt, result);
+ trace2_region_leave("merge", "write_auto_merge",
+ opt->repo);
+ return;
}
- string_list_clear(&olist, 0);
-
- /* Also include needed rename limit adjustment now */
- diff_warn_rename_limit("merge.renamelimit",
- opti->renames.needed_limit, 0);
-
- trace2_region_leave("merge", "display messages", opt->repo);
+ trace2_region_leave("merge", "write_auto_merge", opt->repo);
}
+ if (display_update_msgs)
+ merge_display_update_messages(opt, /* detailed */ 0, result);
merge_finalize(opt, result);
}
@@ -4360,14 +4779,14 @@ void merge_switch_to_result(struct merge_options *opt,
void merge_finalize(struct merge_options *opt,
struct merge_result *result)
{
- struct merge_options_internal *opti = result->priv;
-
if (opt->renormalize)
git_attr_set_direction(GIT_ATTR_CHECKIN);
assert(opt->priv == NULL);
- clear_or_reinit_internal_opts(opti, 0);
- FREE_AND_NULL(opti);
+ if (result->priv) {
+ clear_or_reinit_internal_opts(result->priv, 0);
+ FREE_AND_NULL(result->priv);
+ }
}
/*** Function Grouping: helper functions for merge_incore_*() ***/
@@ -4472,6 +4891,7 @@ static void merge_start(struct merge_options *opt, struct merge_result *result)
trace2_region_enter("merge", "allocate/init", opt->repo);
if (opt->priv) {
clear_or_reinit_internal_opts(opt->priv, 1);
+ string_list_init_nodup(&opt->priv->conflicted_submodules);
trace2_region_leave("merge", "allocate/init", opt->repo);
return;
}
@@ -4526,17 +4946,16 @@ static void merge_start(struct merge_options *opt, struct merge_result *result)
strmap_init_with_options(&opt->priv->conflicted, pool, 0);
/*
- * keys & strbufs in output will sometimes need to outlive "paths",
- * so it will have a copy of relevant keys. It's probably a small
- * subset of the overall paths that have special output.
+ * keys & string_lists in conflicts will sometimes need to outlive
+ * "paths", so it will have a copy of relevant keys. It's probably
+ * a small subset of the overall paths that have special output.
*/
- strmap_init(&opt->priv->output);
+ strmap_init(&opt->priv->conflicts);
trace2_region_leave("merge", "allocate/init", opt->repo);
}
-static void merge_check_renames_reusable(struct merge_options *opt,
- struct merge_result *result,
+static void merge_check_renames_reusable(struct merge_result *result,
struct tree *merge_base,
struct tree *side1,
struct tree *side2)
@@ -4606,7 +5025,7 @@ redo:
* TRANSLATORS: The %s arguments are: 1) tree hash of a merge
* base, and 2-3) the trees for the two trees we're merging.
*/
- err(opt, _("collecting merge info failed for trees %s, %s, %s"),
+ error(_("collecting merge info failed for trees %s, %s, %s"),
oid_to_hex(&merge_base->object.oid),
oid_to_hex(&side1->object.oid),
oid_to_hex(&side2->object.oid));
@@ -4616,8 +5035,7 @@ redo:
trace2_region_leave("merge", "collect_merge_info", opt->repo);
trace2_region_enter("merge", "renames", opt->repo);
- result->clean = detect_and_process_renames(opt, merge_base,
- side1, side2);
+ result->clean = detect_and_process_renames(opt);
trace2_region_leave("merge", "renames", opt->repo);
if (opt->priv->renames.redo_after_renames == 2) {
trace2_region_enter("merge", "reset_maps", opt->repo);
@@ -4627,14 +5045,21 @@ redo:
}
trace2_region_enter("merge", "process_entries", opt->repo);
- process_entries(opt, &working_tree_oid);
+ if (process_entries(opt, &working_tree_oid) < 0)
+ result->clean = -1;
trace2_region_leave("merge", "process_entries", opt->repo);
/* Set return values */
- result->path_messages = &opt->priv->output;
- result->tree = parse_tree_indirect(&working_tree_oid);
- /* existence of conflicted entries implies unclean */
- result->clean &= strmap_empty(&opt->priv->conflicted);
+ result->path_messages = &opt->priv->conflicts;
+
+ if (result->clean >= 0) {
+ result->tree = parse_tree_indirect(&working_tree_oid);
+ if (!result->tree)
+ die(_("unable to read tree (%s)"),
+ oid_to_hex(&working_tree_oid));
+ /* existence of conflicted entries implies unclean */
+ result->clean &= strmap_empty(&opt->priv->conflicted);
+ }
if (!opt->priv->call_depth) {
result->priv = opt->priv;
result->_properly_initialized = RESULT_INITIALIZED;
@@ -4657,7 +5082,11 @@ static void merge_ort_internal(struct merge_options *opt,
struct strbuf merge_base_abbrev = STRBUF_INIT;
if (!merge_bases) {
- merge_bases = get_merge_bases(h1, h2);
+ if (repo_get_merge_bases(the_repository, h1, h2,
+ &merge_bases) < 0) {
+ result->clean = -1;
+ return;
+ }
/* See merge-ort.h:merge_incore_recursive() declaration NOTE */
merge_bases = reverse_commit_list(merge_bases);
}
@@ -4735,7 +5164,7 @@ void merge_incore_nonrecursive(struct merge_options *opt,
trace2_region_enter("merge", "merge_start", opt->repo);
assert(opt->ancestor != NULL);
- merge_check_renames_reusable(opt, result, merge_base, side1, side2);
+ merge_check_renames_reusable(result, merge_base, side1, side2);
merge_start(opt, result);
/*
* Record the trees used in this merge, so if there's a next merge in
diff --git a/merge-ort.h b/merge-ort.h
index fe599b8..ce56ec1 100644
--- a/merge-ort.h
+++ b/merge-ort.h
@@ -2,6 +2,7 @@
#define MERGE_ORT_H
#include "merge-recursive.h"
+#include "hash-ll.h"
struct commit;
struct tree;
@@ -27,7 +28,7 @@ struct merge_result {
/*
* Special messages and conflict notices for various paths
*
- * This is a map of pathnames to strbufs. It contains various
+ * This is a map of pathnames to a string_list. It contains various
* warning/conflict/notice messages (possibly multiple per path)
* that callers may want to use.
*/
@@ -80,6 +81,35 @@ void merge_switch_to_result(struct merge_options *opt,
int update_worktree_and_index,
int display_update_msgs);
+/*
+ * Display messages about conflicts and which files were 3-way merged.
+ * Automatically called by merge_switch_to_result() with stream == stdout,
+ * so only call this when bypassing merge_switch_to_result().
+ */
+void merge_display_update_messages(struct merge_options *opt,
+ int detailed,
+ struct merge_result *result);
+
+struct stage_info {
+ struct object_id oid;
+ int mode;
+ int stage;
+};
+
+/*
+ * Provide a list of path -> {struct stage_info*} mappings for
+ * all conflicted files. Note that each path could appear up to three
+ * times in the list, corresponding to 3 different stage entries. In short,
+ * this basically provides the info that would be printed by `ls-files -u`.
+ *
+ * result should have been populated by a call to
+ * one of the merge_incore_[non]recursive() functions.
+ *
+ * conflicted_files should be empty before calling this function.
+ */
+void merge_get_conflicted_files(struct merge_result *result,
+ struct string_list *conflicted_files);
+
/* Do needed cleanup when not calling merge_switch_to_result() */
void merge_finalize(struct merge_options *opt,
struct merge_result *result);
diff --git a/merge-recursive.c b/merge-recursive.c
index b83a129..8ff29ed 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -3,14 +3,10 @@
* Fredrik Kuivinen.
* The thieves were Alex Riesen and Johannes Schindelin, in June/July 2006
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "merge-recursive.h"
-#include "advice.h"
#include "alloc.h"
-#include "attr.h"
-#include "blob.h"
-#include "builtin.h"
#include "cache-tree.h"
#include "commit.h"
#include "commit-reach.h"
@@ -18,14 +14,22 @@
#include "diff.h"
#include "diffcore.h"
#include "dir.h"
-#include "ll-merge.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
+#include "merge-ll.h"
#include "lockfile.h"
-#include "object-store.h"
+#include "match-trees.h"
+#include "name-hash.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "path.h"
#include "repository.h"
#include "revision.h"
+#include "sparse-index.h"
#include "string-list.h"
-#include "submodule-config.h"
-#include "submodule.h"
+#include "symlinks.h"
#include "tag.h"
#include "tree-walk.h"
#include "unpack-trees.h"
@@ -45,7 +49,7 @@ struct path_hashmap_entry {
char path[FLEX_ARRAY];
};
-static int path_hashmap_cmp(const void *cmp_data,
+static int path_hashmap_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *keydata)
@@ -89,10 +93,10 @@ static struct dir_rename_entry *dir_rename_find_entry(struct hashmap *hashmap,
return hashmap_get_entry(hashmap, &key, ent, NULL);
}
-static int dir_rename_cmp(const void *unused_cmp_data,
+static int dir_rename_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
- const void *unused_keydata)
+ const void *keydata UNUSED)
{
const struct dir_rename_entry *e1, *e2;
@@ -134,10 +138,10 @@ static struct collision_entry *collision_find_entry(struct hashmap *hashmap,
return hashmap_get_entry(hashmap, &key, ent, NULL);
}
-static int collision_cmp(const void *unused_cmp_data,
+static int collision_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
- const void *unused_keydata)
+ const void *keydata UNUSED)
{
const struct collision_entry *e1, *e2;
@@ -401,8 +405,9 @@ static inline int merge_detect_rename(struct merge_options *opt)
static void init_tree_desc_from_tree(struct tree_desc *desc, struct tree *tree)
{
- parse_tree(tree);
- init_tree_desc(desc, tree->buffer, tree->size);
+ if (parse_tree(tree) < 0)
+ exit(128);
+ init_tree_desc(desc, &tree->object.oid, tree->buffer, tree->size);
}
static int unpack_trees_start(struct merge_options *opt,
@@ -412,7 +417,7 @@ static int unpack_trees_start(struct merge_options *opt,
{
int rc;
struct tree_desc t[3];
- struct index_state tmp_index = { NULL };
+ struct index_state tmp_index = INDEX_STATE_INIT(opt->repo);
memset(&opt->priv->unpack_opts, 0, sizeof(opt->priv->unpack_opts));
if (opt->priv->call_depth)
@@ -456,7 +461,7 @@ static void unpack_trees_finish(struct merge_options *opt)
clear_unpack_trees_porcelain(&opt->priv->unpack_opts);
}
-static int save_files_dirs(const struct object_id *oid,
+static int save_files_dirs(const struct object_id *oid UNUSED,
struct strbuf *base, const char *path,
unsigned int mode, void *context)
{
@@ -951,7 +956,8 @@ static int update_file_flags(struct merge_options *opt,
goto update_index;
}
- buf = read_object_file(&contents->oid, &type, &size);
+ buf = repo_read_object_file(the_repository, &contents->oid,
+ &type, &size);
if (!buf) {
ret = err(opt, _("cannot read object %s '%s'"),
oid_to_hex(&contents->oid), path);
@@ -1042,13 +1048,14 @@ static int merge_3way(struct merge_options *opt,
const int extra_marker_size)
{
mmfile_t orig, src1, src2;
- struct ll_merge_options ll_opts = {0};
+ struct ll_merge_options ll_opts = LL_MERGE_OPTIONS_INIT;
char *base, *name1, *name2;
enum ll_merge_result merge_status;
ll_opts.renormalize = opt->renormalize;
ll_opts.extra_marker_size = extra_marker_size;
ll_opts.xdl_opts = opt->xdl_opts;
+ ll_opts.conflict_style = opt->conflict_style;
if (opt->priv->call_depth) {
ll_opts.virtual_ancestor = 1;
@@ -1134,7 +1141,13 @@ static int find_first_merges(struct repository *repo,
die("revision walk setup failed");
while ((commit = get_revision(&revs)) != NULL) {
struct object *o = &(commit->object);
- if (repo_in_merge_bases(repo, b, commit))
+ int ret = repo_in_merge_bases(repo, b, commit);
+ if (ret < 0) {
+ object_array_clear(&merges);
+ release_revisions(&revs);
+ return ret;
+ }
+ if (ret)
add_object_array(o, NULL, &merges);
}
reset_revision_walk();
@@ -1149,9 +1162,17 @@ static int find_first_merges(struct repository *repo,
contains_another = 0;
for (j = 0; j < merges.nr; j++) {
struct commit *m2 = (struct commit *) merges.objects[j].item;
- if (i != j && repo_in_merge_bases(repo, m2, m1)) {
- contains_another = 1;
- break;
+ if (i != j) {
+ int ret = repo_in_merge_bases(repo, m2, m1);
+ if (ret < 0) {
+ object_array_clear(&merges);
+ release_revisions(&revs);
+ return ret;
+ }
+ if (ret > 0) {
+ contains_another = 1;
+ break;
+ }
}
}
@@ -1187,7 +1208,7 @@ static int merge_submodule(struct merge_options *opt,
const struct object_id *b)
{
struct repository subrepo;
- int ret = 0;
+ int ret = 0, ret2;
struct commit *commit_base, *commit_a, *commit_b;
int parent_count;
struct object_array merges;
@@ -1224,14 +1245,32 @@ static int merge_submodule(struct merge_options *opt,
}
/* check whether both changes are forward */
- if (!repo_in_merge_bases(&subrepo, commit_base, commit_a) ||
- !repo_in_merge_bases(&subrepo, commit_base, commit_b)) {
+ ret2 = repo_in_merge_bases(&subrepo, commit_base, commit_a);
+ if (ret2 < 0) {
+ output(opt, 1, _("Failed to merge submodule %s (repository corrupt)"), path);
+ ret = -1;
+ goto cleanup;
+ }
+ if (ret2 > 0)
+ ret2 = repo_in_merge_bases(&subrepo, commit_base, commit_b);
+ if (ret2 < 0) {
+ output(opt, 1, _("Failed to merge submodule %s (repository corrupt)"), path);
+ ret = -1;
+ goto cleanup;
+ }
+ if (!ret2) {
output(opt, 1, _("Failed to merge submodule %s (commits don't follow merge-base)"), path);
goto cleanup;
}
/* Case #1: a is contained in b or vice versa */
- if (repo_in_merge_bases(&subrepo, commit_a, commit_b)) {
+ ret2 = repo_in_merge_bases(&subrepo, commit_a, commit_b);
+ if (ret2 < 0) {
+ output(opt, 1, _("Failed to merge submodule %s (repository corrupt)"), path);
+ ret = -1;
+ goto cleanup;
+ }
+ if (ret2) {
oidcpy(result, b);
if (show(opt, 3)) {
output(opt, 3, _("Fast-forwarding submodule %s to the following commit:"), path);
@@ -1244,7 +1283,13 @@ static int merge_submodule(struct merge_options *opt,
ret = 1;
goto cleanup;
}
- if (repo_in_merge_bases(&subrepo, commit_b, commit_a)) {
+ ret2 = repo_in_merge_bases(&subrepo, commit_b, commit_a);
+ if (ret2 < 0) {
+ output(opt, 1, _("Failed to merge submodule %s (repository corrupt)"), path);
+ ret = -1;
+ goto cleanup;
+ }
+ if (ret2) {
oidcpy(result, a);
if (show(opt, 3)) {
output(opt, 3, _("Fast-forwarding submodule %s to the following commit:"), path);
@@ -1273,6 +1318,10 @@ static int merge_submodule(struct merge_options *opt,
parent_count = find_first_merges(&subrepo, &merges, path,
commit_a, commit_b);
switch (parent_count) {
+ case -1:
+ output(opt, 1,_("Failed to merge submodule %s (repository corrupt)"), path);
+ ret = -1;
+ break;
case 0:
output(opt, 1, _("Failed to merge submodule %s (merge following commits not found)"), path);
break;
@@ -1373,12 +1422,12 @@ static int merge_mode_and_contents(struct merge_options *opt,
extra_marker_size);
if ((merge_status < 0) || !result_buf.ptr)
- ret = err(opt, _("Failed to execute internal merge"));
+ ret = err(opt, _("failed to execute internal merge"));
if (!ret &&
write_object_file(result_buf.ptr, result_buf.size,
OBJ_BLOB, &result->blob.oid))
- ret = err(opt, _("Unable to add %s to database"),
+ ret = err(opt, _("unable to add %s to database"),
a->path);
free(result_buf.ptr);
@@ -1387,11 +1436,14 @@ static int merge_mode_and_contents(struct merge_options *opt,
/* FIXME: bug, what if modes didn't match? */
result->clean = (merge_status == 0);
} else if (S_ISGITLINK(a->mode)) {
- result->clean = merge_submodule(opt, &result->blob.oid,
- o->path,
- &o->oid,
- &a->oid,
- &b->oid);
+ int clean = merge_submodule(opt, &result->blob.oid,
+ o->path,
+ &o->oid,
+ &a->oid,
+ &b->oid);
+ if (clean < 0)
+ return -1;
+ result->clean = clean;
} else if (S_ISLNK(a->mode)) {
switch (opt->recursive_variant) {
case MERGE_VARIANT_NORMAL:
@@ -2100,7 +2152,7 @@ static char *handle_path_level_conflicts(struct merge_options *opt,
if (!new_path) {
/* This should only happen when entry->non_unique_new_dir set */
if (!entry->non_unique_new_dir)
- BUG("entry->non_unqiue_dir not set and !new_path");
+ BUG("entry->non_unique_new_dir not set and !new_path");
output(opt, 1, _("CONFLICT (directory rename split): "
"Unclear where to place %s because directory "
"%s was renamed to multiple other directories, "
@@ -3021,7 +3073,7 @@ static int read_oid_strbuf(struct merge_options *opt,
void *buf;
enum object_type type;
unsigned long size;
- buf = read_object_file(oid, &type, &size);
+ buf = repo_read_object_file(the_repository, oid, &type, &size);
if (!buf)
return err(opt, _("cannot read object %s"), oid_to_hex(oid));
if (type != OBJ_BLOB) {
@@ -3592,7 +3644,9 @@ static int merge_recursive_internal(struct merge_options *opt,
}
if (!merge_bases) {
- merge_bases = get_merge_bases(h1, h2);
+ if (repo_get_merge_bases(the_repository, h1, h2,
+ &merge_bases) < 0)
+ return -1;
merge_bases = reverse_commit_list(merge_bases);
}
@@ -3797,7 +3851,7 @@ static struct commit *get_ref(struct repository *repo,
return make_virtual_commit(repo, (struct tree*)object, name);
if (object->type != OBJ_COMMIT)
return NULL;
- if (parse_commit((struct commit *)object))
+ if (repo_parse_commit(repo, (struct commit *)object))
return NULL;
return (struct commit *)object;
}
@@ -3894,6 +3948,8 @@ void init_merge_options(struct merge_options *opt,
opt->renormalize = 0;
+ opt->conflict_style = -1;
+
merge_recursive_config(opt);
merge_verbosity = getenv("GIT_MERGE_VERBOSITY");
if (merge_verbosity)
@@ -3902,6 +3958,22 @@ void init_merge_options(struct merge_options *opt,
opt->buffer_output = 0;
}
+/*
+ * For now, members of merge_options do not need deep copying, but
+ * it may change in the future, in which case we would need to update
+ * this, and also make a matching change to clear_merge_options() to
+ * release the resources held by a copied instance.
+ */
+void copy_merge_options(struct merge_options *dst, struct merge_options *src)
+{
+ *dst = *src;
+}
+
+void clear_merge_options(struct merge_options *opt UNUSED)
+{
+ ; /* no-op as our copy is shallow right now */
+}
+
int parse_merge_opt(struct merge_options *opt, const char *s)
{
const char *arg;
diff --git a/merge-recursive.h b/merge-recursive.h
index b88000e..e67d38c 100644
--- a/merge-recursive.h
+++ b/merge-recursive.h
@@ -31,6 +31,7 @@ struct merge_options {
/* xdiff-related options (patience, ignore whitespace, ours/theirs) */
long xdl_opts;
+ int conflict_style;
enum {
MERGE_VARIANT_NORMAL = 0,
MERGE_VARIANT_OURS,
@@ -55,6 +56,9 @@ struct merge_options {
void init_merge_options(struct merge_options *opt, struct repository *repo);
+void copy_merge_options(struct merge_options *dst, struct merge_options *src);
+void clear_merge_options(struct merge_options *opt);
+
/* parse the option in s and update the relevant field of opt */
int parse_merge_opt(struct merge_options *opt, const char *s);
diff --git a/merge.c b/merge.c
index 2382ff6..752a937 100644
--- a/merge.c
+++ b/merge.c
@@ -1,13 +1,16 @@
-#include "cache.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "git-compat-util.h"
+#include "gettext.h"
+#include "hash.h"
+#include "hex.h"
#include "lockfile.h"
+#include "merge.h"
#include "commit.h"
+#include "repository.h"
#include "run-command.h"
#include "resolve-undo.h"
+#include "tree.h"
#include "tree-walk.h"
#include "unpack-trees.h"
-#include "dir.h"
static const char *merge_argument(struct commit *commit)
{
@@ -19,22 +22,22 @@ int try_merge_command(struct repository *r,
const char **xopts, struct commit_list *common,
const char *head_arg, struct commit_list *remotes)
{
- struct strvec args = STRVEC_INIT;
+ struct child_process cmd = CHILD_PROCESS_INIT;
int i, ret;
struct commit_list *j;
- strvec_pushf(&args, "merge-%s", strategy);
+ strvec_pushf(&cmd.args, "merge-%s", strategy);
for (i = 0; i < xopts_nr; i++)
- strvec_pushf(&args, "--%s", xopts[i]);
+ strvec_pushf(&cmd.args, "--%s", xopts[i]);
for (j = common; j; j = j->next)
- strvec_push(&args, merge_argument(j->item));
- strvec_push(&args, "--");
- strvec_push(&args, head_arg);
+ strvec_push(&cmd.args, merge_argument(j->item));
+ strvec_push(&cmd.args, "--");
+ strvec_push(&cmd.args, head_arg);
for (j = remotes; j; j = j->next)
- strvec_push(&args, merge_argument(j->item));
+ strvec_push(&cmd.args, merge_argument(j->item));
- ret = run_command_v_opt(args.v, RUN_GIT_CMD);
- strvec_clear(&args);
+ cmd.git_cmd = 1;
+ ret = run_command(&cmd);
discard_index(r->index);
if (repo_read_index(r) < 0)
@@ -74,8 +77,12 @@ int checkout_fast_forward(struct repository *r,
return -1;
}
for (i = 0; i < nr_trees; i++) {
- parse_tree(trees[i]);
- init_tree_desc(t+i, trees[i]->buffer, trees[i]->size);
+ if (parse_tree(trees[i]) < 0) {
+ rollback_lock_file(&lock_file);
+ return -1;
+ }
+ init_tree_desc(t+i, &trees[i]->object.oid,
+ trees[i]->buffer, trees[i]->size);
}
memset(&opts, 0, sizeof(opts));
diff --git a/merge.h b/merge.h
new file mode 100644
index 0000000..21ac7ef
--- /dev/null
+++ b/merge.h
@@ -0,0 +1,17 @@
+#ifndef MERGE_H
+#define MERGE_H
+
+struct commit_list;
+struct object_id;
+struct repository;
+
+int try_merge_command(struct repository *r,
+ const char *strategy, size_t xopts_nr,
+ const char **xopts, struct commit_list *common,
+ const char *head_arg, struct commit_list *remotes);
+int checkout_fast_forward(struct repository *r,
+ const struct object_id *from,
+ const struct object_id *to,
+ int overwrite_ignore);
+
+#endif /* MERGE_H */
diff --git a/mergesort.c b/mergesort.c
deleted file mode 100644
index bd9c6ef..0000000
--- a/mergesort.c
+++ /dev/null
@@ -1,84 +0,0 @@
-#include "cache.h"
-#include "mergesort.h"
-
-/* Combine two sorted lists. Take from `list` on equality. */
-static void *llist_merge(void *list, void *other,
- void *(*get_next_fn)(const void *),
- void (*set_next_fn)(void *, void *),
- int (*compare_fn)(const void *, const void *))
-{
- void *result = list, *tail;
-
- if (compare_fn(list, other) > 0) {
- result = other;
- goto other;
- }
- for (;;) {
- do {
- tail = list;
- list = get_next_fn(list);
- if (!list) {
- set_next_fn(tail, other);
- return result;
- }
- } while (compare_fn(list, other) <= 0);
- set_next_fn(tail, other);
- other:
- do {
- tail = other;
- other = get_next_fn(other);
- if (!other) {
- set_next_fn(tail, list);
- return result;
- }
- } while (compare_fn(list, other) > 0);
- set_next_fn(tail, list);
- }
-}
-
-/*
- * Perform an iterative mergesort using an array of sublists.
- *
- * n is the number of items.
- * ranks[i] is undefined if n & 2^i == 0, and assumed empty.
- * ranks[i] contains a sublist of length 2^i otherwise.
- *
- * The number of bits in a void pointer limits the number of objects
- * that can be created, and thus the number of array elements necessary
- * to be able to sort any valid list.
- *
- * Adding an item to this array is like incrementing a binary number;
- * positional values for set bits correspond to sublist lengths.
- */
-void *llist_mergesort(void *list,
- void *(*get_next_fn)(const void *),
- void (*set_next_fn)(void *, void *),
- int (*compare_fn)(const void *, const void *))
-{
- void *ranks[bitsizeof(void *)];
- size_t n = 0;
- int i;
-
- while (list) {
- void *next = get_next_fn(list);
- if (next)
- set_next_fn(list, NULL);
- for (i = 0; n & ((size_t)1 << i); i++)
- list = llist_merge(ranks[i], list, get_next_fn,
- set_next_fn, compare_fn);
- n++;
- ranks[i] = list;
- list = next;
- }
-
- for (i = 0; n; i++, n >>= 1) {
- if (!(n & 1))
- continue;
- if (list)
- list = llist_merge(ranks[i], list, get_next_fn,
- set_next_fn, compare_fn);
- else
- list = ranks[i];
- }
- return list;
-}
diff --git a/mergesort.h b/mergesort.h
index 644cff1..7c36f08 100644
--- a/mergesort.h
+++ b/mergesort.h
@@ -1,17 +1,105 @@
#ifndef MERGESORT_H
#define MERGESORT_H
+/* Combine two sorted lists. Take from `list` on equality. */
+#define DEFINE_LIST_MERGE_INTERNAL(name, type) \
+static type *name##__merge(type *list, type *other, \
+ int (*compare_fn)(const type *, const type *))\
+{ \
+ type *result = list, *tail; \
+ int prefer_list = compare_fn(list, other) <= 0; \
+ \
+ if (!prefer_list) { \
+ result = other; \
+ SWAP(list, other); \
+ } \
+ for (;;) { \
+ do { \
+ tail = list; \
+ list = name##__get_next(list); \
+ if (!list) { \
+ name##__set_next(tail, other); \
+ return result; \
+ } \
+ } while (compare_fn(list, other) < prefer_list); \
+ name##__set_next(tail, other); \
+ prefer_list ^= 1; \
+ SWAP(list, other); \
+ } \
+}
+
/*
- * Sort linked list in place.
- * - get_next_fn() returns the next element given an element of a linked list.
- * - set_next_fn() takes two elements A and B, and makes B the "next" element
- * of A on the list.
- * - compare_fn() takes two elements A and B, and returns negative, 0, positive
- * as the same sign as "subtracting" B from A.
+ * Perform an iterative mergesort using an array of sublists.
+ *
+ * n is the number of items.
+ * ranks[i] is undefined if n & 2^i == 0, and assumed empty.
+ * ranks[i] contains a sublist of length 2^i otherwise.
+ *
+ * The number of bits in a void pointer limits the number of objects
+ * that can be created, and thus the number of array elements necessary
+ * to be able to sort any valid list.
+ *
+ * Adding an item to this array is like incrementing a binary number;
+ * positional values for set bits correspond to sublist lengths.
*/
-void *llist_mergesort(void *list,
- void *(*get_next_fn)(const void *),
- void (*set_next_fn)(void *, void *),
- int (*compare_fn)(const void *, const void *));
+#define DEFINE_LIST_SORT_INTERNAL(scope, name, type) \
+scope void name(type **listp, \
+ int (*compare_fn)(const type *, const type *)) \
+{ \
+ type *list = *listp; \
+ type *ranks[bitsizeof(type *)]; \
+ size_t n = 0; \
+ \
+ if (!list) \
+ return; \
+ \
+ for (;;) { \
+ int i; \
+ size_t m; \
+ type *next = name##__get_next(list); \
+ if (next) \
+ name##__set_next(list, NULL); \
+ for (i = 0, m = n;; i++, m >>= 1) { \
+ if (m & 1) { \
+ list = name##__merge(ranks[i], list, \
+ compare_fn); \
+ } else if (next) { \
+ break; \
+ } else if (!m) { \
+ *listp = list; \
+ return; \
+ } \
+ } \
+ n++; \
+ ranks[i] = list; \
+ list = next; \
+ } \
+}
+
+#define DECLARE_LIST_SORT(scope, name, type) \
+scope void name(type **listp, \
+ int (*compare_fn)(const type *, const type *))
+
+#define DEFINE_LIST_SORT_DEBUG(scope, name, type, next_member, \
+ on_get_next, on_set_next) \
+ \
+static inline type *name##__get_next(const type *elem) \
+{ \
+ on_get_next; \
+ return elem->next_member; \
+} \
+ \
+static inline void name##__set_next(type *elem, type *next) \
+{ \
+ on_set_next; \
+ elem->next_member = next; \
+} \
+ \
+DEFINE_LIST_MERGE_INTERNAL(name, type) \
+DEFINE_LIST_SORT_INTERNAL(scope, name, type) \
+DECLARE_LIST_SORT(scope, name, type)
+
+#define DEFINE_LIST_SORT(scope, name, type, next_member) \
+DEFINE_LIST_SORT_DEBUG(scope, name, type, next_member, (void)0, (void)0)
#endif
diff --git a/mergetools/vimdiff b/mergetools/vimdiff
index f770b8f..97e3763 100644
--- a/mergetools/vimdiff
+++ b/mergetools/vimdiff
@@ -29,8 +29,8 @@
################################################################################
debug_print () {
- # Send message to stderr if global variable GIT_MERGETOOL_VIMDIFF is set
- # to "true"
+ # Send message to stderr if global variable GIT_MERGETOOL_VIMDIFF_DEBUG
+ # is set.
if test -n "$GIT_MERGETOOL_VIMDIFF_DEBUG"
then
@@ -66,11 +66,6 @@ gen_cmd_aux () {
debug_print "LAYOUT : $LAYOUT"
debug_print "CMD : $CMD"
- if test -z "$CMD"
- then
- CMD="echo" # vim "nop" operator
- fi
-
start=0
end=${#LAYOUT}
@@ -144,11 +139,10 @@ gen_cmd_aux () {
# Step 2:
#
- # Search for all valid separators ("+", "/" or ",") which are *not*
+ # Search for all valid separators ("/" or ",") which are *not*
# inside parenthesis. Save the index at which each of them makes the
# first appearance.
- index_new_tab=""
index_horizontal_split=""
index_vertical_split=""
@@ -182,14 +176,7 @@ gen_cmd_aux () {
then
current=$c
- if test "$current" = "+"
- then
- if test -z "$index_new_tab"
- then
- index_new_tab=$i
- fi
-
- elif test "$current" = "/"
+ if test "$current" = "/"
then
if test -z "$index_horizontal_split"
then
@@ -219,14 +206,7 @@ gen_cmd_aux () {
terminate="false"
- if ! test -z "$index_new_tab"
- then
- before="-tabnew"
- after="tabnext"
- index=$index_new_tab
- terminate="true"
-
- elif ! test -z "$index_horizontal_split"
+ if ! test -z "$index_horizontal_split"
then
before="leftabove split"
after="wincmd j"
@@ -333,25 +313,31 @@ gen_cmd () {
# Obtain the first part of vim "-c" option to obtain the desired layout
- CMD=$(gen_cmd_aux "$LAYOUT")
-
-
- # Adjust the just obtained script depending on whether more than one
- # windows are visible or not
+ CMD=
+ oldIFS=$IFS
+ IFS=+
+ for tab in $LAYOUT
+ do
+ if test -z "$CMD"
+ then
+ CMD="echo" # vim "nop" operator
+ else
+ CMD="$CMD | tabnew"
+ fi
- if echo "$LAYOUT" | grep ",\|/" >/dev/null
- then
- CMD="$CMD | tabdo windo diffthis"
- else
- CMD="$CMD | bufdo diffthis"
- fi
+ # If this is a single window diff with all the buffers
+ if ! echo "$tab" | grep ",\|/" >/dev/null
+ then
+ CMD="$CMD | silent execute 'bufdo diffthis'"
+ fi
+ CMD=$(gen_cmd_aux "$tab" "$CMD")
+ done
+ IFS=$oldIFS
- # Add an extra "-c" option to move to the first tab (notice that we
- # can't simply append the command to the previous "-c" string as
- # explained here: https://github.com/vim/vim/issues/9076
+ CMD="$CMD | execute 'tabdo windo diffthis'"
- FINAL_CMD="-c \"$CMD\" -c \"tabfirst\""
+ FINAL_CMD="-c \"set hidden diffopt-=hiddenoff | $CMD | tabfirst\""
}
@@ -385,9 +371,17 @@ diff_cmd_help () {
merge_cmd () {
- layout=$(git config mergetool.vimdiff.layout)
+ TOOL=$1
- case "$1" in
+ layout=$(git config "mergetool.$TOOL.layout")
+
+ # backward compatibility:
+ if test -z "$layout"
+ then
+ layout=$(git config mergetool.vimdiff.layout)
+ fi
+
+ case "$TOOL" in
*vimdiff)
if test -z "$layout"
then
@@ -555,22 +549,22 @@ run_unit_tests () {
TEST_CASE_15=" (( (LOCAL , BASE , REMOTE) / MERGED)) +(BASE) , LOCAL+ BASE , REMOTE+ (((LOCAL / BASE / REMOTE)) , MERGED ) "
TEST_CASE_16="LOCAL,BASE,REMOTE / MERGED + BASE,LOCAL + BASE,REMOTE + (LOCAL / BASE / REMOTE),MERGED"
- EXPECTED_CMD_01="-c \"echo | leftabove split | leftabove vertical split | 1b | wincmd l | leftabove vertical split | 2b | wincmd l | 3b | wincmd j | 4b | tabdo windo diffthis\" -c \"tabfirst\""
- EXPECTED_CMD_02="-c \"echo | leftabove vertical split | 1b | wincmd l | 3b | tabdo windo diffthis\" -c \"tabfirst\""
- EXPECTED_CMD_03="-c \"echo | leftabove vertical split | 1b | wincmd l | leftabove vertical split | 4b | wincmd l | 3b | tabdo windo diffthis\" -c \"tabfirst\""
- EXPECTED_CMD_04="-c \"echo | 4b | bufdo diffthis\" -c \"tabfirst\""
- EXPECTED_CMD_05="-c \"echo | leftabove split | 1b | wincmd j | leftabove split | 4b | wincmd j | 3b | tabdo windo diffthis\" -c \"tabfirst\""
- EXPECTED_CMD_06="-c \"echo | leftabove vertical split | leftabove split | 1b | wincmd j | 3b | wincmd l | 4b | tabdo windo diffthis\" -c \"tabfirst\""
- EXPECTED_CMD_07="-c \"echo | leftabove vertical split | 4b | wincmd l | leftabove split | 1b | wincmd j | 3b | tabdo windo diffthis\" -c \"tabfirst\""
- EXPECTED_CMD_08="-c \"echo | leftabove split | leftabove vertical split | 1b | wincmd l | 3b | wincmd j | 4b | tabdo windo diffthis\" -c \"tabfirst\""
- EXPECTED_CMD_09="-c \"echo | leftabove split | 4b | wincmd j | leftabove vertical split | 1b | wincmd l | 3b | tabdo windo diffthis\" -c \"tabfirst\""
- EXPECTED_CMD_10="-c \"echo | leftabove vertical split | leftabove split | 1b | wincmd j | leftabove split | 2b | wincmd j | 3b | wincmd l | 4b | tabdo windo diffthis\" -c \"tabfirst\""
- EXPECTED_CMD_11="-c \"echo | -tabnew | leftabove split | leftabove vertical split | 1b | wincmd l | leftabove vertical split | 2b | wincmd l | 3b | wincmd j | 4b | tabnext | -tabnew | leftabove vertical split | 2b | wincmd l | 1b | tabnext | -tabnew | leftabove vertical split | 2b | wincmd l | 3b | tabnext | leftabove vertical split | leftabove split | 1b | wincmd j | leftabove split | 2b | wincmd j | 3b | wincmd l | 4b | tabdo windo diffthis\" -c \"tabfirst\""
- EXPECTED_CMD_12="-c \"echo | leftabove vertical split | leftabove split | leftabove vertical split | 1b | wincmd l | 3b | wincmd j | 2b | wincmd l | 4b | tabdo windo diffthis\" -c \"tabfirst\""
- EXPECTED_CMD_13="-c \"echo | leftabove vertical split | leftabove split | leftabove vertical split | 1b | wincmd l | 3b | wincmd j | 2b | wincmd l | leftabove vertical split | leftabove split | 1b | wincmd j | 3b | wincmd l | 4b | tabdo windo diffthis\" -c \"tabfirst\""
- EXPECTED_CMD_14="-c \"echo | -tabnew | leftabove vertical split | 2b | wincmd l | 3b | tabnext | leftabove vertical split | 2b | wincmd l | 1b | tabdo windo diffthis\" -c \"tabfirst\""
- EXPECTED_CMD_15="-c \"echo | -tabnew | leftabove split | leftabove vertical split | 1b | wincmd l | leftabove vertical split | 2b | wincmd l | 3b | wincmd j | 4b | tabnext | -tabnew | leftabove vertical split | 2b | wincmd l | 1b | tabnext | -tabnew | leftabove vertical split | 2b | wincmd l | 3b | tabnext | leftabove vertical split | leftabove split | 1b | wincmd j | leftabove split | 2b | wincmd j | 3b | wincmd l | 4b | tabdo windo diffthis\" -c \"tabfirst\""
- EXPECTED_CMD_16="-c \"echo | -tabnew | leftabove split | leftabove vertical split | 1b | wincmd l | leftabove vertical split | 2b | wincmd l | 3b | wincmd j | 4b | tabnext | -tabnew | leftabove vertical split | 2b | wincmd l | 1b | tabnext | -tabnew | leftabove vertical split | 2b | wincmd l | 3b | tabnext | leftabove vertical split | leftabove split | 1b | wincmd j | leftabove split | 2b | wincmd j | 3b | wincmd l | 4b | tabdo windo diffthis\" -c \"tabfirst\""
+ EXPECTED_CMD_01="-c \"set hidden diffopt-=hiddenoff | echo | leftabove split | leftabove vertical split | 1b | wincmd l | leftabove vertical split | 2b | wincmd l | 3b | wincmd j | 4b | execute 'tabdo windo diffthis' | tabfirst\""
+ EXPECTED_CMD_02="-c \"set hidden diffopt-=hiddenoff | echo | leftabove vertical split | 1b | wincmd l | 3b | execute 'tabdo windo diffthis' | tabfirst\""
+ EXPECTED_CMD_03="-c \"set hidden diffopt-=hiddenoff | echo | leftabove vertical split | 1b | wincmd l | leftabove vertical split | 4b | wincmd l | 3b | execute 'tabdo windo diffthis' | tabfirst\""
+ EXPECTED_CMD_04="-c \"set hidden diffopt-=hiddenoff | echo | silent execute 'bufdo diffthis' | 4b | execute 'tabdo windo diffthis' | tabfirst\""
+ EXPECTED_CMD_05="-c \"set hidden diffopt-=hiddenoff | echo | leftabove split | 1b | wincmd j | leftabove split | 4b | wincmd j | 3b | execute 'tabdo windo diffthis' | tabfirst\""
+ EXPECTED_CMD_06="-c \"set hidden diffopt-=hiddenoff | echo | leftabove vertical split | leftabove split | 1b | wincmd j | 3b | wincmd l | 4b | execute 'tabdo windo diffthis' | tabfirst\""
+ EXPECTED_CMD_07="-c \"set hidden diffopt-=hiddenoff | echo | leftabove vertical split | 4b | wincmd l | leftabove split | 1b | wincmd j | 3b | execute 'tabdo windo diffthis' | tabfirst\""
+ EXPECTED_CMD_08="-c \"set hidden diffopt-=hiddenoff | echo | leftabove split | leftabove vertical split | 1b | wincmd l | 3b | wincmd j | 4b | execute 'tabdo windo diffthis' | tabfirst\""
+ EXPECTED_CMD_09="-c \"set hidden diffopt-=hiddenoff | echo | leftabove split | 4b | wincmd j | leftabove vertical split | 1b | wincmd l | 3b | execute 'tabdo windo diffthis' | tabfirst\""
+ EXPECTED_CMD_10="-c \"set hidden diffopt-=hiddenoff | echo | leftabove vertical split | leftabove split | 1b | wincmd j | leftabove split | 2b | wincmd j | 3b | wincmd l | 4b | execute 'tabdo windo diffthis' | tabfirst\""
+ EXPECTED_CMD_11="-c \"set hidden diffopt-=hiddenoff | echo | leftabove split | leftabove vertical split | 1b | wincmd l | leftabove vertical split | 2b | wincmd l | 3b | wincmd j | 4b | tabnew | leftabove vertical split | 2b | wincmd l | 1b | tabnew | leftabove vertical split | 2b | wincmd l | 3b | tabnew | leftabove vertical split | leftabove split | 1b | wincmd j | leftabove split | 2b | wincmd j | 3b | wincmd l | 4b | execute 'tabdo windo diffthis' | tabfirst\""
+ EXPECTED_CMD_12="-c \"set hidden diffopt-=hiddenoff | echo | leftabove vertical split | leftabove split | leftabove vertical split | 1b | wincmd l | 3b | wincmd j | 2b | wincmd l | 4b | execute 'tabdo windo diffthis' | tabfirst\""
+ EXPECTED_CMD_13="-c \"set hidden diffopt-=hiddenoff | echo | leftabove vertical split | leftabove split | leftabove vertical split | 1b | wincmd l | 3b | wincmd j | 2b | wincmd l | leftabove vertical split | leftabove split | 1b | wincmd j | 3b | wincmd l | 4b | execute 'tabdo windo diffthis' | tabfirst\""
+ EXPECTED_CMD_14="-c \"set hidden diffopt-=hiddenoff | echo | leftabove vertical split | 2b | wincmd l | 3b | tabnew | leftabove vertical split | 2b | wincmd l | 1b | execute 'tabdo windo diffthis' | tabfirst\""
+ EXPECTED_CMD_15="-c \"set hidden diffopt-=hiddenoff | echo | leftabove split | leftabove vertical split | 1b | wincmd l | leftabove vertical split | 2b | wincmd l | 3b | wincmd j | 4b | tabnew | leftabove vertical split | 2b | wincmd l | 1b | tabnew | leftabove vertical split | 2b | wincmd l | 3b | tabnew | leftabove vertical split | leftabove split | 1b | wincmd j | leftabove split | 2b | wincmd j | 3b | wincmd l | 4b | execute 'tabdo windo diffthis' | tabfirst\""
+ EXPECTED_CMD_16="-c \"set hidden diffopt-=hiddenoff | echo | leftabove split | leftabove vertical split | 1b | wincmd l | leftabove vertical split | 2b | wincmd l | 3b | wincmd j | 4b | tabnew | leftabove vertical split | 2b | wincmd l | 1b | tabnew | leftabove vertical split | 2b | wincmd l | 3b | tabnew | leftabove vertical split | leftabove split | 1b | wincmd j | leftabove split | 2b | wincmd j | 3b | wincmd l | 4b | execute 'tabdo windo diffthis' | tabfirst\""
EXPECTED_TARGET_01="MERGED"
EXPECTED_TARGET_02="LOCAL"
@@ -635,9 +629,7 @@ run_unit_tests () {
cat >expect <<-\EOF
-f
-c
- echo | leftabove split | leftabove vertical split | 1b | wincmd l | leftabove vertical split | quit | wincmd l | 2b | wincmd j | 3b | tabdo windo diffthis
- -c
- tabfirst
+ set hidden diffopt-=hiddenoff | echo | leftabove split | leftabove vertical split | 1b | wincmd l | leftabove vertical split | quit | wincmd l | 2b | wincmd j | 3b | execute 'tabdo windo diffthis' | tabfirst
lo cal
' '
mer ged
diff --git a/midx-write.c b/midx-write.c
new file mode 100644
index 0000000..65e69d2
--- /dev/null
+++ b/midx-write.c
@@ -0,0 +1,1525 @@
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "config.h"
+#include "hex.h"
+#include "lockfile.h"
+#include "packfile.h"
+#include "object-file.h"
+#include "hash-lookup.h"
+#include "midx.h"
+#include "progress.h"
+#include "trace2.h"
+#include "run-command.h"
+#include "chunk-format.h"
+#include "pack-bitmap.h"
+#include "refs.h"
+#include "revision.h"
+#include "list-objects.h"
+
+#define PACK_EXPIRED UINT_MAX
+#define BITMAP_POS_UNKNOWN (~((uint32_t)0))
+#define MIDX_CHUNK_FANOUT_SIZE (sizeof(uint32_t) * 256)
+#define MIDX_CHUNK_LARGE_OFFSET_WIDTH (sizeof(uint64_t))
+
+extern int midx_checksum_valid(struct multi_pack_index *m);
+extern void clear_midx_files_ext(const char *object_dir, const char *ext,
+ unsigned char *keep_hash);
+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,
+ 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, num_chunks);
+ hashwrite_u8(f, 0); /* unused */
+ hashwrite_be32(f, num_packs);
+
+ return MIDX_HEADER_SIZE;
+}
+
+struct pack_info {
+ uint32_t orig_pack_int_id;
+ char *pack_name;
+ struct packed_git *p;
+
+ uint32_t bitmap_pos;
+ uint32_t bitmap_nr;
+
+ unsigned expired : 1;
+};
+
+static void fill_pack_info(struct pack_info *info,
+ struct packed_git *p, const char *pack_name,
+ uint32_t orig_pack_int_id)
+{
+ memset(info, 0, sizeof(struct pack_info));
+
+ info->orig_pack_int_id = orig_pack_int_id;
+ info->pack_name = xstrdup(pack_name);
+ info->p = p;
+ info->bitmap_pos = BITMAP_POS_UNKNOWN;
+}
+
+static int pack_info_compare(const void *_a, const void *_b)
+{
+ struct pack_info *a = (struct pack_info *)_a;
+ struct pack_info *b = (struct pack_info *)_b;
+ return strcmp(a->pack_name, b->pack_name);
+}
+
+static int idx_or_pack_name_cmp(const void *_va, const void *_vb)
+{
+ const char *pack_name = _va;
+ const struct pack_info *compar = _vb;
+
+ return cmp_idx_or_pack_name(pack_name, compar->pack_name);
+}
+
+struct write_midx_context {
+ struct pack_info *info;
+ size_t nr;
+ size_t alloc;
+ struct multi_pack_index *m;
+ struct progress *progress;
+ unsigned pack_paths_checked;
+
+ struct pack_midx_entry *entries;
+ size_t entries_nr;
+
+ uint32_t *pack_perm;
+ uint32_t *pack_order;
+ unsigned large_offsets_needed:1;
+ uint32_t num_large_offsets;
+
+ int preferred_pack_idx;
+
+ struct string_list *to_include;
+};
+
+static void add_pack_to_midx(const char *full_path, size_t full_path_len,
+ const char *file_name, void *data)
+{
+ struct write_midx_context *ctx = data;
+ struct packed_git *p;
+
+ if (ends_with(file_name, ".idx")) {
+ display_progress(ctx->progress, ++ctx->pack_paths_checked);
+ /*
+ * Note that at most one of ctx->m and ctx->to_include are set,
+ * so we are testing midx_contains_pack() and
+ * string_list_has_string() independently (guarded by the
+ * appropriate NULL checks).
+ *
+ * We could support passing to_include while reusing an existing
+ * MIDX, but don't currently since the reuse process drags
+ * forward all packs from an existing MIDX (without checking
+ * whether or not they appear in the to_include list).
+ *
+ * If we added support for that, these next two conditional
+ * should be performed independently (likely checking
+ * to_include before the existing MIDX).
+ */
+ if (ctx->m && midx_contains_pack(ctx->m, file_name))
+ return;
+ else if (ctx->to_include &&
+ !string_list_has_string(ctx->to_include, file_name))
+ return;
+
+ ALLOC_GROW(ctx->info, ctx->nr + 1, ctx->alloc);
+
+ p = add_packed_git(full_path, full_path_len, 0);
+ if (!p) {
+ warning(_("failed to add packfile '%s'"),
+ full_path);
+ return;
+ }
+
+ if (open_pack_index(p)) {
+ warning(_("failed to open pack-index '%s'"),
+ full_path);
+ close_pack(p);
+ free(p);
+ return;
+ }
+
+ fill_pack_info(&ctx->info[ctx->nr], p, file_name, ctx->nr);
+ ctx->nr++;
+ }
+}
+
+struct pack_midx_entry {
+ struct object_id oid;
+ uint32_t pack_int_id;
+ time_t pack_mtime;
+ uint64_t offset;
+ unsigned preferred : 1;
+};
+
+static int midx_oid_compare(const void *_a, const void *_b)
+{
+ const struct pack_midx_entry *a = (const struct pack_midx_entry *)_a;
+ const struct pack_midx_entry *b = (const struct pack_midx_entry *)_b;
+ int cmp = oidcmp(&a->oid, &b->oid);
+
+ if (cmp)
+ return cmp;
+
+ /* Sort objects in a preferred pack first when multiple copies exist. */
+ if (a->preferred > b->preferred)
+ return -1;
+ if (a->preferred < b->preferred)
+ return 1;
+
+ if (a->pack_mtime > b->pack_mtime)
+ return -1;
+ else if (a->pack_mtime < b->pack_mtime)
+ return 1;
+
+ return a->pack_int_id - b->pack_int_id;
+}
+
+static int nth_midxed_pack_midx_entry(struct multi_pack_index *m,
+ struct pack_midx_entry *e,
+ uint32_t pos)
+{
+ if (pos >= m->num_objects)
+ return 1;
+
+ nth_midxed_object_oid(&e->oid, m, pos);
+ e->pack_int_id = nth_midxed_pack_int_id(m, pos);
+ e->offset = nth_midxed_offset(m, pos);
+
+ /* consider objects in midx to be from "old" packs */
+ e->pack_mtime = 0;
+ return 0;
+}
+
+static void fill_pack_entry(uint32_t pack_int_id,
+ struct packed_git *p,
+ uint32_t cur_object,
+ struct pack_midx_entry *entry,
+ int preferred)
+{
+ if (nth_packed_object_id(&entry->oid, p, cur_object) < 0)
+ die(_("failed to locate object %d in packfile"), cur_object);
+
+ entry->pack_int_id = pack_int_id;
+ entry->pack_mtime = p->mtime;
+
+ entry->offset = nth_packed_object_offset(p, cur_object);
+ entry->preferred = !!preferred;
+}
+
+struct midx_fanout {
+ struct pack_midx_entry *entries;
+ size_t nr, alloc;
+};
+
+static void midx_fanout_grow(struct midx_fanout *fanout, size_t nr)
+{
+ if (nr < fanout->nr)
+ BUG("negative growth in midx_fanout_grow() (%"PRIuMAX" < %"PRIuMAX")",
+ (uintmax_t)nr, (uintmax_t)fanout->nr);
+ ALLOC_GROW(fanout->entries, nr, fanout->alloc);
+}
+
+static void midx_fanout_sort(struct midx_fanout *fanout)
+{
+ QSORT(fanout->entries, fanout->nr, midx_oid_compare);
+}
+
+static void midx_fanout_add_midx_fanout(struct midx_fanout *fanout,
+ struct multi_pack_index *m,
+ uint32_t cur_fanout,
+ int preferred_pack)
+{
+ uint32_t start = 0, end;
+ uint32_t cur_object;
+
+ if (cur_fanout)
+ start = ntohl(m->chunk_oid_fanout[cur_fanout - 1]);
+ end = ntohl(m->chunk_oid_fanout[cur_fanout]);
+
+ for (cur_object = start; cur_object < end; cur_object++) {
+ if ((preferred_pack > -1) &&
+ (preferred_pack == nth_midxed_pack_int_id(m, cur_object))) {
+ /*
+ * Objects from preferred packs are added
+ * separately.
+ */
+ continue;
+ }
+
+ midx_fanout_grow(fanout, fanout->nr + 1);
+ nth_midxed_pack_midx_entry(m,
+ &fanout->entries[fanout->nr],
+ cur_object);
+ fanout->entries[fanout->nr].preferred = 0;
+ fanout->nr++;
+ }
+}
+
+static void midx_fanout_add_pack_fanout(struct midx_fanout *fanout,
+ struct pack_info *info,
+ uint32_t cur_pack,
+ int preferred,
+ uint32_t cur_fanout)
+{
+ struct packed_git *pack = info[cur_pack].p;
+ uint32_t start = 0, end;
+ uint32_t cur_object;
+
+ if (cur_fanout)
+ start = get_pack_fanout(pack, cur_fanout - 1);
+ end = get_pack_fanout(pack, cur_fanout);
+
+ for (cur_object = start; cur_object < end; cur_object++) {
+ midx_fanout_grow(fanout, fanout->nr + 1);
+ fill_pack_entry(cur_pack,
+ info[cur_pack].p,
+ cur_object,
+ &fanout->entries[fanout->nr],
+ preferred);
+ fanout->nr++;
+ }
+}
+
+/*
+ * It is possible to artificially get into a state where there are many
+ * duplicate copies of objects. That can create high memory pressure if
+ * we are to create a list of all objects before de-duplication. To reduce
+ * this memory pressure without a significant performance drop, automatically
+ * group objects by the first byte of their object id. Use the IDX fanout
+ * tables to group the data, copy to a local array, then sort.
+ *
+ * Copy only the de-duplicated entries (selected by most-recent modified time
+ * of a packfile containing the object).
+ */
+static struct pack_midx_entry *get_sorted_entries(struct multi_pack_index *m,
+ struct pack_info *info,
+ uint32_t nr_packs,
+ size_t *nr_objects,
+ int preferred_pack)
+{
+ uint32_t cur_fanout, cur_pack, cur_object;
+ size_t alloc_objects, total_objects = 0;
+ struct midx_fanout fanout = { 0 };
+ struct pack_midx_entry *deduplicated_entries = NULL;
+ uint32_t start_pack = m ? m->num_packs : 0;
+
+ for (cur_pack = start_pack; cur_pack < nr_packs; cur_pack++)
+ total_objects = st_add(total_objects,
+ info[cur_pack].p->num_objects);
+
+ /*
+ * As we de-duplicate by fanout value, we expect the fanout
+ * slices to be evenly distributed, with some noise. Hence,
+ * allocate slightly more than one 256th.
+ */
+ alloc_objects = fanout.alloc = total_objects > 3200 ? total_objects / 200 : 16;
+
+ ALLOC_ARRAY(fanout.entries, fanout.alloc);
+ ALLOC_ARRAY(deduplicated_entries, alloc_objects);
+ *nr_objects = 0;
+
+ for (cur_fanout = 0; cur_fanout < 256; cur_fanout++) {
+ fanout.nr = 0;
+
+ if (m)
+ midx_fanout_add_midx_fanout(&fanout, m, cur_fanout,
+ preferred_pack);
+
+ for (cur_pack = start_pack; cur_pack < nr_packs; cur_pack++) {
+ int preferred = cur_pack == preferred_pack;
+ midx_fanout_add_pack_fanout(&fanout,
+ info, cur_pack,
+ preferred, cur_fanout);
+ }
+
+ if (-1 < preferred_pack && preferred_pack < start_pack)
+ midx_fanout_add_pack_fanout(&fanout, info,
+ preferred_pack, 1,
+ cur_fanout);
+
+ midx_fanout_sort(&fanout);
+
+ /*
+ * The batch is now sorted by OID and then mtime (descending).
+ * Take only the first duplicate.
+ */
+ for (cur_object = 0; cur_object < fanout.nr; cur_object++) {
+ if (cur_object && oideq(&fanout.entries[cur_object - 1].oid,
+ &fanout.entries[cur_object].oid))
+ continue;
+
+ ALLOC_GROW(deduplicated_entries, st_add(*nr_objects, 1),
+ alloc_objects);
+ memcpy(&deduplicated_entries[*nr_objects],
+ &fanout.entries[cur_object],
+ sizeof(struct pack_midx_entry));
+ (*nr_objects)++;
+ }
+ }
+
+ free(fanout.entries);
+ return deduplicated_entries;
+}
+
+static int write_midx_pack_names(struct hashfile *f, void *data)
+{
+ struct write_midx_context *ctx = data;
+ uint32_t i;
+ unsigned char padding[MIDX_CHUNK_ALIGNMENT];
+ size_t written = 0;
+
+ for (i = 0; i < ctx->nr; i++) {
+ size_t writelen;
+
+ if (ctx->info[i].expired)
+ continue;
+
+ if (i && strcmp(ctx->info[i].pack_name, ctx->info[i - 1].pack_name) <= 0)
+ BUG("incorrect pack-file order: %s before %s",
+ ctx->info[i - 1].pack_name,
+ ctx->info[i].pack_name);
+
+ writelen = strlen(ctx->info[i].pack_name) + 1;
+ hashwrite(f, ctx->info[i].pack_name, writelen);
+ written += writelen;
+ }
+
+ /* add padding to be aligned */
+ i = MIDX_CHUNK_ALIGNMENT - (written % MIDX_CHUNK_ALIGNMENT);
+ if (i < MIDX_CHUNK_ALIGNMENT) {
+ memset(padding, 0, sizeof(padding));
+ hashwrite(f, padding, i);
+ }
+
+ return 0;
+}
+
+static int write_midx_bitmapped_packs(struct hashfile *f, void *data)
+{
+ struct write_midx_context *ctx = data;
+ size_t i;
+
+ for (i = 0; i < ctx->nr; i++) {
+ struct pack_info *pack = &ctx->info[i];
+ if (pack->expired)
+ continue;
+
+ if (pack->bitmap_pos == BITMAP_POS_UNKNOWN && pack->bitmap_nr)
+ BUG("pack '%s' has no bitmap position, but has %d bitmapped object(s)",
+ pack->pack_name, pack->bitmap_nr);
+
+ hashwrite_be32(f, pack->bitmap_pos);
+ hashwrite_be32(f, pack->bitmap_nr);
+ }
+ return 0;
+}
+
+static int write_midx_oid_fanout(struct hashfile *f,
+ void *data)
+{
+ struct write_midx_context *ctx = data;
+ struct pack_midx_entry *list = ctx->entries;
+ struct pack_midx_entry *last = ctx->entries + ctx->entries_nr;
+ uint32_t count = 0;
+ uint32_t i;
+
+ /*
+ * Write the first-level table (the list is sorted,
+ * but we use a 256-entry lookup to be able to avoid
+ * having to do eight extra binary search iterations).
+ */
+ for (i = 0; i < 256; i++) {
+ struct pack_midx_entry *next = list;
+
+ while (next < last && next->oid.hash[0] == i) {
+ count++;
+ next++;
+ }
+
+ hashwrite_be32(f, count);
+ list = next;
+ }
+
+ return 0;
+}
+
+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;
+ struct pack_midx_entry *list = ctx->entries;
+ uint32_t i;
+
+ for (i = 0; i < ctx->entries_nr; i++) {
+ struct pack_midx_entry *obj = list++;
+
+ if (i < ctx->entries_nr - 1) {
+ struct pack_midx_entry *next = list;
+ if (oidcmp(&obj->oid, &next->oid) >= 0)
+ BUG("OIDs not in order: %s >= %s",
+ oid_to_hex(&obj->oid),
+ oid_to_hex(&next->oid));
+ }
+
+ hashwrite(f, obj->oid.hash, (int)hash_len);
+ }
+
+ return 0;
+}
+
+static int write_midx_object_offsets(struct hashfile *f,
+ void *data)
+{
+ struct write_midx_context *ctx = data;
+ struct pack_midx_entry *list = ctx->entries;
+ uint32_t i, nr_large_offset = 0;
+
+ for (i = 0; i < ctx->entries_nr; i++) {
+ struct pack_midx_entry *obj = list++;
+
+ if (ctx->pack_perm[obj->pack_int_id] == PACK_EXPIRED)
+ BUG("object %s is in an expired pack with int-id %d",
+ oid_to_hex(&obj->oid),
+ obj->pack_int_id);
+
+ hashwrite_be32(f, ctx->pack_perm[obj->pack_int_id]);
+
+ if (ctx->large_offsets_needed && obj->offset >> 31)
+ hashwrite_be32(f, MIDX_LARGE_OFFSET_NEEDED | nr_large_offset++);
+ else if (!ctx->large_offsets_needed && obj->offset >> 32)
+ BUG("object %s requires a large offset (%"PRIx64") but the MIDX is not writing large offsets!",
+ oid_to_hex(&obj->oid),
+ obj->offset);
+ else
+ hashwrite_be32(f, (uint32_t)obj->offset);
+ }
+
+ return 0;
+}
+
+static int write_midx_large_offsets(struct hashfile *f,
+ void *data)
+{
+ struct write_midx_context *ctx = data;
+ struct pack_midx_entry *list = ctx->entries;
+ struct pack_midx_entry *end = ctx->entries + ctx->entries_nr;
+ uint32_t nr_large_offset = ctx->num_large_offsets;
+
+ while (nr_large_offset) {
+ struct pack_midx_entry *obj;
+ uint64_t offset;
+
+ if (list >= end)
+ BUG("too many large-offset objects");
+
+ obj = list++;
+ offset = obj->offset;
+
+ if (!(offset >> 31))
+ continue;
+
+ hashwrite_be64(f, offset);
+
+ nr_large_offset--;
+ }
+
+ return 0;
+}
+
+static int write_midx_revindex(struct hashfile *f,
+ void *data)
+{
+ struct write_midx_context *ctx = data;
+ uint32_t i;
+
+ for (i = 0; i < ctx->entries_nr; i++)
+ hashwrite_be32(f, ctx->pack_order[i]);
+
+ return 0;
+}
+
+struct midx_pack_order_data {
+ uint32_t nr;
+ uint32_t pack;
+ off_t offset;
+};
+
+static int midx_pack_order_cmp(const void *va, const void *vb)
+{
+ const struct midx_pack_order_data *a = va, *b = vb;
+ if (a->pack < b->pack)
+ return -1;
+ else if (a->pack > b->pack)
+ return 1;
+ else if (a->offset < b->offset)
+ return -1;
+ else if (a->offset > b->offset)
+ return 1;
+ else
+ return 0;
+}
+
+static uint32_t *midx_pack_order(struct write_midx_context *ctx)
+{
+ struct midx_pack_order_data *data;
+ uint32_t *pack_order;
+ uint32_t i;
+
+ trace2_region_enter("midx", "midx_pack_order", the_repository);
+
+ ALLOC_ARRAY(data, ctx->entries_nr);
+ for (i = 0; i < ctx->entries_nr; i++) {
+ struct pack_midx_entry *e = &ctx->entries[i];
+ data[i].nr = i;
+ data[i].pack = ctx->pack_perm[e->pack_int_id];
+ if (!e->preferred)
+ data[i].pack |= (1U << 31);
+ data[i].offset = e->offset;
+ }
+
+ QSORT(data, ctx->entries_nr, midx_pack_order_cmp);
+
+ ALLOC_ARRAY(pack_order, ctx->entries_nr);
+ for (i = 0; i < ctx->entries_nr; i++) {
+ struct pack_midx_entry *e = &ctx->entries[data[i].nr];
+ struct pack_info *pack = &ctx->info[ctx->pack_perm[e->pack_int_id]];
+ if (pack->bitmap_pos == BITMAP_POS_UNKNOWN)
+ pack->bitmap_pos = i;
+ pack->bitmap_nr++;
+ pack_order[i] = data[i].nr;
+ }
+ for (i = 0; i < ctx->nr; i++) {
+ struct pack_info *pack = &ctx->info[ctx->pack_perm[i]];
+ if (pack->bitmap_pos == BITMAP_POS_UNKNOWN)
+ pack->bitmap_pos = 0;
+ }
+ free(data);
+
+ trace2_region_leave("midx", "midx_pack_order", the_repository);
+
+ return pack_order;
+}
+
+static void write_midx_reverse_index(char *midx_name, unsigned char *midx_hash,
+ struct write_midx_context *ctx)
+{
+ struct strbuf buf = STRBUF_INIT;
+ const char *tmp_file;
+
+ trace2_region_enter("midx", "write_midx_reverse_index", the_repository);
+
+ strbuf_addf(&buf, "%s-%s.rev", midx_name, hash_to_hex(midx_hash));
+
+ tmp_file = write_rev_file_order(NULL, ctx->pack_order, ctx->entries_nr,
+ midx_hash, WRITE_REV);
+
+ if (finalize_object_file(tmp_file, buf.buf))
+ die(_("cannot store reverse index file"));
+
+ strbuf_release(&buf);
+
+ trace2_region_leave("midx", "write_midx_reverse_index", the_repository);
+}
+
+static void prepare_midx_packing_data(struct packing_data *pdata,
+ struct write_midx_context *ctx)
+{
+ uint32_t i;
+
+ trace2_region_enter("midx", "prepare_midx_packing_data", the_repository);
+
+ memset(pdata, 0, sizeof(struct packing_data));
+ prepare_packing_data(the_repository, pdata);
+
+ for (i = 0; i < ctx->entries_nr; i++) {
+ struct pack_midx_entry *from = &ctx->entries[ctx->pack_order[i]];
+ struct object_entry *to = packlist_alloc(pdata, &from->oid);
+
+ oe_set_in_pack(pdata, to,
+ ctx->info[ctx->pack_perm[from->pack_int_id]].p);
+ }
+
+ trace2_region_leave("midx", "prepare_midx_packing_data", the_repository);
+}
+
+static int add_ref_to_pending(const char *refname,
+ const struct object_id *oid,
+ int flag, void *cb_data)
+{
+ struct rev_info *revs = (struct rev_info*)cb_data;
+ struct object_id peeled;
+ struct object *object;
+
+ if ((flag & REF_ISSYMREF) && (flag & REF_ISBROKEN)) {
+ warning("symbolic ref is dangling: %s", refname);
+ return 0;
+ }
+
+ if (!peel_iterated_oid(oid, &peeled))
+ oid = &peeled;
+
+ object = parse_object_or_die(oid, refname);
+ if (object->type != OBJ_COMMIT)
+ return 0;
+
+ add_pending_object(revs, object, "");
+ if (bitmap_is_preferred_refname(revs->repo, refname))
+ object->flags |= NEEDS_BITMAP;
+ return 0;
+}
+
+struct bitmap_commit_cb {
+ struct commit **commits;
+ size_t commits_nr, commits_alloc;
+
+ struct write_midx_context *ctx;
+};
+
+static const struct object_id *bitmap_oid_access(size_t index,
+ const void *_entries)
+{
+ const struct pack_midx_entry *entries = _entries;
+ return &entries[index].oid;
+}
+
+static void bitmap_show_commit(struct commit *commit, void *_data)
+{
+ struct bitmap_commit_cb *data = _data;
+ int pos = oid_pos(&commit->object.oid, data->ctx->entries,
+ data->ctx->entries_nr,
+ bitmap_oid_access);
+ if (pos < 0)
+ return;
+
+ ALLOC_GROW(data->commits, data->commits_nr + 1, data->commits_alloc);
+ data->commits[data->commits_nr++] = commit;
+}
+
+static int read_refs_snapshot(const char *refs_snapshot,
+ struct rev_info *revs)
+{
+ struct strbuf buf = STRBUF_INIT;
+ struct object_id oid;
+ FILE *f = xfopen(refs_snapshot, "r");
+
+ while (strbuf_getline(&buf, f) != EOF) {
+ struct object *object;
+ int preferred = 0;
+ char *hex = buf.buf;
+ const char *end = NULL;
+
+ if (buf.len && *buf.buf == '+') {
+ preferred = 1;
+ hex = &buf.buf[1];
+ }
+
+ if (parse_oid_hex(hex, &oid, &end) < 0)
+ die(_("could not parse line: %s"), buf.buf);
+ if (*end)
+ die(_("malformed line: %s"), buf.buf);
+
+ object = parse_object_or_die(&oid, NULL);
+ if (preferred)
+ object->flags |= NEEDS_BITMAP;
+
+ add_pending_object(revs, object, "");
+ }
+
+ fclose(f);
+ 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)
+{
+ struct rev_info revs;
+ struct bitmap_commit_cb cb = {0};
+
+ trace2_region_enter("midx", "find_commits_for_midx_bitmap",
+ the_repository);
+
+ cb.ctx = ctx;
+
+ repo_init_revisions(the_repository, &revs, NULL);
+ if (refs_snapshot) {
+ read_refs_snapshot(refs_snapshot, &revs);
+ } else {
+ setup_revisions(0, NULL, &revs, NULL);
+ for_each_ref(add_ref_to_pending, &revs);
+ }
+
+ /*
+ * Skipping promisor objects here is intentional, since it only excludes
+ * them from the list of reachable commits that we want to select from
+ * when computing the selection of MIDX'd commits to receive bitmaps.
+ *
+ * Reachability bitmaps do require that their objects be closed under
+ * reachability, but fetching any objects missing from promisors at this
+ * point is too late. But, if one of those objects can be reached from
+ * an another object that is included in the bitmap, then we will
+ * complain later that we don't have reachability closure (and fail
+ * appropriately).
+ */
+ fetch_if_missing = 0;
+ revs.exclude_promisor_objects = 1;
+
+ if (prepare_revision_walk(&revs))
+ die(_("revision walk setup failed"));
+
+ traverse_commit_list(&revs, bitmap_show_commit, NULL, &cb);
+ if (indexed_commits_nr_p)
+ *indexed_commits_nr_p = cb.commits_nr;
+
+ release_revisions(&revs);
+
+ trace2_region_leave("midx", "find_commits_for_midx_bitmap",
+ the_repository);
+
+ return cb.commits;
+}
+
+static int write_midx_bitmap(const char *midx_name,
+ const unsigned char *midx_hash,
+ struct packing_data *pdata,
+ struct commit **commits,
+ uint32_t commits_nr,
+ uint32_t *pack_order,
+ unsigned flags)
+{
+ int ret, i;
+ uint16_t options = 0;
+ struct pack_idx_entry **index;
+ char *bitmap_name = xstrfmt("%s-%s.bitmap", midx_name,
+ hash_to_hex(midx_hash));
+
+ trace2_region_enter("midx", "write_midx_bitmap", the_repository);
+
+ if (flags & MIDX_WRITE_BITMAP_HASH_CACHE)
+ options |= BITMAP_OPT_HASH_CACHE;
+
+ if (flags & MIDX_WRITE_BITMAP_LOOKUP_TABLE)
+ options |= BITMAP_OPT_LOOKUP_TABLE;
+
+ /*
+ * Build the MIDX-order index based on pdata.objects (which is already
+ * in MIDX order; c.f., 'midx_pack_order_cmp()' for the definition of
+ * this order).
+ */
+ ALLOC_ARRAY(index, pdata->nr_objects);
+ for (i = 0; i < pdata->nr_objects; i++)
+ index[i] = &pdata->objects[i].idx;
+
+ bitmap_writer_show_progress(flags & MIDX_PROGRESS);
+ bitmap_writer_build_type_index(pdata, index, pdata->nr_objects);
+
+ /*
+ * bitmap_writer_finish expects objects in lex order, but pack_order
+ * gives us exactly that. use it directly instead of re-sorting the
+ * array.
+ *
+ * This changes the order of objects in 'index' between
+ * bitmap_writer_build_type_index and bitmap_writer_finish.
+ *
+ * The same re-ordering takes place in the single-pack bitmap code via
+ * write_idx_file(), which is called by finish_tmp_packfile(), which
+ * happens between bitmap_writer_build_type_index() and
+ * bitmap_writer_finish().
+ */
+ for (i = 0; i < pdata->nr_objects; i++)
+ index[pack_order[i]] = &pdata->objects[i].idx;
+
+ bitmap_writer_select_commits(commits, commits_nr, -1);
+ ret = bitmap_writer_build(pdata);
+ if (ret < 0)
+ goto cleanup;
+
+ bitmap_writer_set_checksum(midx_hash);
+ bitmap_writer_finish(index, pdata->nr_objects, bitmap_name, options);
+
+cleanup:
+ free(index);
+ free(bitmap_name);
+
+ trace2_region_leave("midx", "write_midx_bitmap", the_repository);
+
+ return ret;
+}
+
+static struct multi_pack_index *lookup_multi_pack_index(struct repository *r,
+ const char *object_dir)
+{
+ struct multi_pack_index *result = NULL;
+ struct multi_pack_index *cur;
+ char *obj_dir_real = real_pathdup(object_dir, 1);
+ struct strbuf cur_path_real = STRBUF_INIT;
+
+ /* Ensure the given object_dir is local, or a known alternate. */
+ find_odb(r, obj_dir_real);
+
+ for (cur = get_multi_pack_index(r); cur; cur = cur->next) {
+ strbuf_realpath(&cur_path_real, cur->object_dir, 1);
+ if (!strcmp(obj_dir_real, cur_path_real.buf)) {
+ result = cur;
+ goto cleanup;
+ }
+ }
+
+cleanup:
+ free(obj_dir_real);
+ strbuf_release(&cur_path_real);
+ return result;
+}
+
+static int write_midx_internal(const char *object_dir,
+ struct string_list *packs_to_include,
+ struct string_list *packs_to_drop,
+ const char *preferred_pack_name,
+ const char *refs_snapshot,
+ unsigned flags)
+{
+ struct strbuf midx_name = STRBUF_INIT;
+ unsigned char midx_hash[GIT_MAX_RAWSZ];
+ uint32_t i;
+ struct hashfile *f = NULL;
+ struct lock_file lk;
+ struct write_midx_context ctx = { 0 };
+ int bitmapped_packs_concat_len = 0;
+ int pack_name_concat_len = 0;
+ int dropped_packs = 0;
+ int result = 0;
+ struct chunkfile *cf;
+
+ trace2_region_enter("midx", "write_midx_internal", the_repository);
+
+ get_midx_filename(&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) {
+ /*
+ * Only reference an existing MIDX when not filtering which
+ * packs to include, since all packs and objects are copied
+ * blindly from an existing MIDX if one is present.
+ */
+ ctx.m = lookup_multi_pack_index(the_repository, object_dir);
+ }
+
+ if (ctx.m && !midx_checksum_valid(ctx.m)) {
+ warning(_("ignoring existing multi-pack-index; checksum mismatch"));
+ ctx.m = NULL;
+ }
+
+ ctx.nr = 0;
+ ctx.alloc = ctx.m ? ctx.m->num_packs : 16;
+ ctx.info = NULL;
+ ALLOC_ARRAY(ctx.info, ctx.alloc);
+
+ if (ctx.m) {
+ for (i = 0; i < ctx.m->num_packs; i++) {
+ ALLOC_GROW(ctx.info, ctx.nr + 1, ctx.alloc);
+
+ if (flags & MIDX_WRITE_REV_INDEX) {
+ /*
+ * If generating a reverse index, need to have
+ * packed_git's loaded to compare their
+ * mtimes and object count.
+ */
+ if (prepare_midx_pack(the_repository, ctx.m, i)) {
+ error(_("could not load pack"));
+ result = 1;
+ goto cleanup;
+ }
+
+ if (open_pack_index(ctx.m->packs[i]))
+ die(_("could not open index for %s"),
+ ctx.m->packs[i]->pack_name);
+ }
+
+ fill_pack_info(&ctx.info[ctx.nr++], ctx.m->packs[i],
+ ctx.m->pack_names[i], i);
+ }
+ }
+
+ ctx.pack_paths_checked = 0;
+ if (flags & MIDX_PROGRESS)
+ ctx.progress = start_delayed_progress(_("Adding packfiles to multi-pack-index"), 0);
+ else
+ ctx.progress = NULL;
+
+ ctx.to_include = packs_to_include;
+
+ for_each_file_in_pack_dir(object_dir, add_pack_to_midx, &ctx);
+ stop_progress(&ctx.progress);
+
+ if ((ctx.m && ctx.nr == ctx.m->num_packs) &&
+ !(packs_to_include || packs_to_drop)) {
+ struct bitmap_index *bitmap_git;
+ int bitmap_exists;
+ int want_bitmap = flags & MIDX_WRITE_BITMAP;
+
+ bitmap_git = prepare_midx_bitmap_git(ctx.m);
+ bitmap_exists = bitmap_git && bitmap_is_midx(bitmap_git);
+ free_bitmap_index(bitmap_git);
+
+ if (bitmap_exists || !want_bitmap) {
+ /*
+ * The correct MIDX already exists, and so does a
+ * corresponding bitmap (or one wasn't requested).
+ */
+ if (!want_bitmap)
+ clear_midx_files_ext(object_dir, ".bitmap",
+ NULL);
+ goto cleanup;
+ }
+ }
+
+ if (preferred_pack_name) {
+ ctx.preferred_pack_idx = -1;
+
+ for (i = 0; i < ctx.nr; i++) {
+ if (!cmp_idx_or_pack_name(preferred_pack_name,
+ ctx.info[i].pack_name)) {
+ ctx.preferred_pack_idx = i;
+ break;
+ }
+ }
+
+ if (ctx.preferred_pack_idx == -1)
+ warning(_("unknown preferred pack: '%s'"),
+ preferred_pack_name);
+ } else if (ctx.nr &&
+ (flags & (MIDX_WRITE_REV_INDEX | MIDX_WRITE_BITMAP))) {
+ struct packed_git *oldest = ctx.info[ctx.preferred_pack_idx].p;
+ ctx.preferred_pack_idx = 0;
+
+ if (packs_to_drop && packs_to_drop->nr)
+ BUG("cannot write a MIDX bitmap during expiration");
+
+ /*
+ * set a preferred pack when writing a bitmap to ensure that
+ * the pack from which the first object is selected in pseudo
+ * pack-order has all of its objects selected from that pack
+ * (and not another pack containing a duplicate)
+ */
+ for (i = 1; i < ctx.nr; i++) {
+ struct packed_git *p = ctx.info[i].p;
+
+ if (!oldest->num_objects || p->mtime < oldest->mtime) {
+ oldest = p;
+ ctx.preferred_pack_idx = i;
+ }
+ }
+
+ if (!oldest->num_objects) {
+ /*
+ * If all packs are empty; unset the preferred index.
+ * This is acceptable since there will be no duplicate
+ * objects to resolve, so the preferred value doesn't
+ * matter.
+ */
+ ctx.preferred_pack_idx = -1;
+ }
+ } else {
+ /*
+ * otherwise don't mark any pack as preferred to avoid
+ * interfering with expiration logic below
+ */
+ ctx.preferred_pack_idx = -1;
+ }
+
+ if (ctx.preferred_pack_idx > -1) {
+ struct packed_git *preferred = ctx.info[ctx.preferred_pack_idx].p;
+ if (!preferred->num_objects) {
+ error(_("cannot select preferred pack %s with no objects"),
+ preferred->pack_name);
+ result = 1;
+ goto cleanup;
+ }
+ }
+
+ ctx.entries = get_sorted_entries(ctx.m, ctx.info, ctx.nr, &ctx.entries_nr,
+ ctx.preferred_pack_idx);
+
+ ctx.large_offsets_needed = 0;
+ for (i = 0; i < ctx.entries_nr; i++) {
+ if (ctx.entries[i].offset > 0x7fffffff)
+ ctx.num_large_offsets++;
+ if (ctx.entries[i].offset > 0xffffffff)
+ ctx.large_offsets_needed = 1;
+ }
+
+ QSORT(ctx.info, ctx.nr, pack_info_compare);
+
+ if (packs_to_drop && packs_to_drop->nr) {
+ int drop_index = 0;
+ int missing_drops = 0;
+
+ for (i = 0; i < ctx.nr && drop_index < packs_to_drop->nr; i++) {
+ int cmp = strcmp(ctx.info[i].pack_name,
+ packs_to_drop->items[drop_index].string);
+
+ if (!cmp) {
+ drop_index++;
+ ctx.info[i].expired = 1;
+ } else if (cmp > 0) {
+ error(_("did not see pack-file %s to drop"),
+ packs_to_drop->items[drop_index].string);
+ drop_index++;
+ missing_drops++;
+ i--;
+ } else {
+ ctx.info[i].expired = 0;
+ }
+ }
+
+ if (missing_drops) {
+ result = 1;
+ goto cleanup;
+ }
+ }
+
+ /*
+ * pack_perm stores a permutation between pack-int-ids from the
+ * previous multi-pack-index to the new one we are writing:
+ *
+ * pack_perm[old_id] = new_id
+ */
+ ALLOC_ARRAY(ctx.pack_perm, ctx.nr);
+ for (i = 0; i < ctx.nr; i++) {
+ if (ctx.info[i].expired) {
+ dropped_packs++;
+ ctx.pack_perm[ctx.info[i].orig_pack_int_id] = PACK_EXPIRED;
+ } else {
+ ctx.pack_perm[ctx.info[i].orig_pack_int_id] = i - dropped_packs;
+ }
+ }
+
+ for (i = 0; i < ctx.nr; i++) {
+ if (ctx.info[i].expired)
+ continue;
+ pack_name_concat_len += strlen(ctx.info[i].pack_name) + 1;
+ bitmapped_packs_concat_len += 2 * sizeof(uint32_t);
+ }
+
+ /* Check that the preferred pack wasn't expired (if given). */
+ if (preferred_pack_name) {
+ struct pack_info *preferred = bsearch(preferred_pack_name,
+ ctx.info, ctx.nr,
+ sizeof(*ctx.info),
+ idx_or_pack_name_cmp);
+ if (preferred) {
+ uint32_t perm = ctx.pack_perm[preferred->orig_pack_int_id];
+ if (perm == PACK_EXPIRED)
+ warning(_("preferred pack '%s' is expired"),
+ preferred_pack_name);
+ }
+ }
+
+ if (pack_name_concat_len % MIDX_CHUNK_ALIGNMENT)
+ pack_name_concat_len += MIDX_CHUNK_ALIGNMENT -
+ (pack_name_concat_len % MIDX_CHUNK_ALIGNMENT);
+
+ hold_lock_file_for_update(&lk, midx_name.buf, LOCK_DIE_ON_ERROR);
+ f = hashfd(get_lock_file_fd(&lk), get_lock_file_path(&lk));
+
+ if (ctx.nr - dropped_packs == 0) {
+ error(_("no pack files to index."));
+ result = 1;
+ goto cleanup;
+ }
+
+ if (!ctx.entries_nr) {
+ if (flags & MIDX_WRITE_BITMAP)
+ warning(_("refusing to write multi-pack .bitmap without any objects"));
+ flags &= ~(MIDX_WRITE_REV_INDEX | MIDX_WRITE_BITMAP);
+ }
+
+ cf = init_chunkfile(f);
+
+ add_chunk(cf, MIDX_CHUNKID_PACKNAMES, pack_name_concat_len,
+ write_midx_pack_names);
+ 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),
+ write_midx_oid_lookup);
+ add_chunk(cf, MIDX_CHUNKID_OBJECTOFFSETS,
+ st_mult(ctx.entries_nr, MIDX_CHUNK_OFFSET_WIDTH),
+ write_midx_object_offsets);
+
+ if (ctx.large_offsets_needed)
+ add_chunk(cf, MIDX_CHUNKID_LARGEOFFSETS,
+ st_mult(ctx.num_large_offsets,
+ MIDX_CHUNK_LARGE_OFFSET_WIDTH),
+ write_midx_large_offsets);
+
+ if (flags & (MIDX_WRITE_REV_INDEX | MIDX_WRITE_BITMAP)) {
+ ctx.pack_order = midx_pack_order(&ctx);
+ add_chunk(cf, MIDX_CHUNKID_REVINDEX,
+ st_mult(ctx.entries_nr, sizeof(uint32_t)),
+ write_midx_revindex);
+ add_chunk(cf, MIDX_CHUNKID_BITMAPPEDPACKS,
+ bitmapped_packs_concat_len,
+ write_midx_bitmapped_packs);
+ }
+
+ write_midx_header(f, get_num_chunks(cf), ctx.nr - dropped_packs);
+ write_chunkfile(cf, &ctx);
+
+ finalize_hashfile(f, midx_hash, FSYNC_COMPONENT_PACK_METADATA,
+ CSUM_FSYNC | CSUM_HASH_IN_STREAM);
+ free_chunkfile(cf);
+
+ if (flags & MIDX_WRITE_REV_INDEX &&
+ git_env_bool("GIT_TEST_MIDX_WRITE_REV", 0))
+ write_midx_reverse_index(midx_name.buf, midx_hash, &ctx);
+
+ if (flags & MIDX_WRITE_BITMAP) {
+ struct packing_data pdata;
+ struct commit **commits;
+ uint32_t commits_nr;
+
+ if (!ctx.entries_nr)
+ BUG("cannot write a bitmap without any objects");
+
+ prepare_midx_packing_data(&pdata, &ctx);
+
+ commits = find_commits_for_midx_bitmap(&commits_nr, refs_snapshot, &ctx);
+
+ /*
+ * The previous steps translated the information from
+ * 'entries' into information suitable for constructing
+ * bitmaps. We no longer need that array, so clear it to
+ * reduce memory pressure.
+ */
+ FREE_AND_NULL(ctx.entries);
+ ctx.entries_nr = 0;
+
+ if (write_midx_bitmap(midx_name.buf, midx_hash, &pdata,
+ commits, commits_nr, ctx.pack_order,
+ flags) < 0) {
+ error(_("could not write multi-pack bitmap"));
+ result = 1;
+ clear_packing_data(&pdata);
+ free(commits);
+ goto cleanup;
+ }
+
+ clear_packing_data(&pdata);
+ free(commits);
+ }
+ /*
+ * NOTE: Do not use ctx.entries beyond this point, since it might
+ * have been freed in the previous if block.
+ */
+
+ if (ctx.m)
+ close_object_store(the_repository->objects);
+
+ if (commit_lock_file(&lk) < 0)
+ die_errno(_("could not write multi-pack-index"));
+
+ clear_midx_files_ext(object_dir, ".bitmap", midx_hash);
+ clear_midx_files_ext(object_dir, ".rev", midx_hash);
+
+cleanup:
+ for (i = 0; i < ctx.nr; i++) {
+ if (ctx.info[i].p) {
+ close_pack(ctx.info[i].p);
+ free(ctx.info[i].p);
+ }
+ free(ctx.info[i].pack_name);
+ }
+
+ free(ctx.info);
+ free(ctx.entries);
+ free(ctx.pack_perm);
+ free(ctx.pack_order);
+ strbuf_release(&midx_name);
+
+ trace2_region_leave("midx", "write_midx_internal", the_repository);
+
+ return result;
+}
+
+int write_midx_file(const char *object_dir,
+ const char *preferred_pack_name,
+ const char *refs_snapshot,
+ unsigned flags)
+{
+ return write_midx_internal(object_dir, NULL, NULL, preferred_pack_name,
+ refs_snapshot, flags);
+}
+
+int write_midx_file_only(const char *object_dir,
+ struct string_list *packs_to_include,
+ const char *preferred_pack_name,
+ const char *refs_snapshot,
+ unsigned flags)
+{
+ return write_midx_internal(object_dir, packs_to_include, NULL,
+ preferred_pack_name, refs_snapshot, flags);
+}
+
+int expire_midx_packs(struct repository *r, const char *object_dir, unsigned flags)
+{
+ uint32_t i, *count, result = 0;
+ struct string_list packs_to_drop = STRING_LIST_INIT_DUP;
+ struct multi_pack_index *m = lookup_multi_pack_index(r, object_dir);
+ struct progress *progress = NULL;
+
+ if (!m)
+ return 0;
+
+ CALLOC_ARRAY(count, m->num_packs);
+
+ if (flags & MIDX_PROGRESS)
+ progress = start_delayed_progress(_("Counting referenced objects"),
+ m->num_objects);
+ for (i = 0; i < m->num_objects; i++) {
+ int pack_int_id = nth_midxed_pack_int_id(m, i);
+ count[pack_int_id]++;
+ display_progress(progress, i + 1);
+ }
+ stop_progress(&progress);
+
+ if (flags & MIDX_PROGRESS)
+ progress = start_delayed_progress(_("Finding and deleting unreferenced packfiles"),
+ m->num_packs);
+ for (i = 0; i < m->num_packs; i++) {
+ char *pack_name;
+ display_progress(progress, i + 1);
+
+ if (count[i])
+ continue;
+
+ if (prepare_midx_pack(r, m, i))
+ continue;
+
+ if (m->packs[i]->pack_keep || m->packs[i]->is_cruft)
+ continue;
+
+ pack_name = xstrdup(m->packs[i]->pack_name);
+ close_pack(m->packs[i]);
+
+ string_list_insert(&packs_to_drop, m->pack_names[i]);
+ unlink_pack_path(pack_name, 0);
+ free(pack_name);
+ }
+ stop_progress(&progress);
+
+ free(count);
+
+ if (packs_to_drop.nr)
+ result = write_midx_internal(object_dir, NULL, &packs_to_drop, NULL, NULL, flags);
+
+ string_list_clear(&packs_to_drop, 0);
+
+ return result;
+}
+
+struct repack_info {
+ timestamp_t mtime;
+ uint32_t referenced_objects;
+ uint32_t pack_int_id;
+};
+
+static int compare_by_mtime(const void *a_, const void *b_)
+{
+ const struct repack_info *a, *b;
+
+ a = (const struct repack_info *)a_;
+ b = (const struct repack_info *)b_;
+
+ if (a->mtime < b->mtime)
+ return -1;
+ if (a->mtime > b->mtime)
+ return 1;
+ return 0;
+}
+
+static int want_included_pack(struct repository *r,
+ struct multi_pack_index *m,
+ int pack_kept_objects,
+ uint32_t pack_int_id)
+{
+ struct packed_git *p;
+ if (prepare_midx_pack(r, m, pack_int_id))
+ return 0;
+ p = m->packs[pack_int_id];
+ if (!pack_kept_objects && p->pack_keep)
+ return 0;
+ if (p->is_cruft)
+ return 0;
+ if (open_pack_index(p) || !p->num_objects)
+ return 0;
+ return 1;
+}
+
+static void fill_included_packs_all(struct repository *r,
+ struct multi_pack_index *m,
+ unsigned char *include_pack)
+{
+ uint32_t i;
+ int pack_kept_objects = 0;
+
+ repo_config_get_bool(r, "repack.packkeptobjects", &pack_kept_objects);
+
+ for (i = 0; i < m->num_packs; i++) {
+ if (!want_included_pack(r, m, pack_kept_objects, i))
+ continue;
+
+ include_pack[i] = 1;
+ }
+}
+
+static void fill_included_packs_batch(struct repository *r,
+ struct multi_pack_index *m,
+ unsigned char *include_pack,
+ size_t batch_size)
+{
+ uint32_t i;
+ size_t total_size;
+ struct repack_info *pack_info;
+ int pack_kept_objects = 0;
+
+ CALLOC_ARRAY(pack_info, m->num_packs);
+
+ repo_config_get_bool(r, "repack.packkeptobjects", &pack_kept_objects);
+
+ for (i = 0; i < m->num_packs; i++) {
+ pack_info[i].pack_int_id = i;
+
+ if (prepare_midx_pack(r, m, i))
+ continue;
+
+ pack_info[i].mtime = m->packs[i]->mtime;
+ }
+
+ for (i = 0; i < m->num_objects; i++) {
+ uint32_t pack_int_id = nth_midxed_pack_int_id(m, i);
+ pack_info[pack_int_id].referenced_objects++;
+ }
+
+ QSORT(pack_info, m->num_packs, compare_by_mtime);
+
+ total_size = 0;
+ for (i = 0; total_size < batch_size && i < m->num_packs; i++) {
+ int pack_int_id = pack_info[i].pack_int_id;
+ struct packed_git *p = m->packs[pack_int_id];
+ size_t expected_size;
+
+ if (!want_included_pack(r, m, pack_kept_objects, pack_int_id))
+ continue;
+
+ expected_size = st_mult(p->pack_size,
+ pack_info[i].referenced_objects);
+ expected_size /= p->num_objects;
+
+ if (expected_size >= batch_size)
+ continue;
+
+ total_size += expected_size;
+ include_pack[pack_int_id] = 1;
+ }
+
+ free(pack_info);
+}
+
+int midx_repack(struct repository *r, const char *object_dir, size_t batch_size, unsigned flags)
+{
+ int result = 0;
+ uint32_t i, packs_to_repack = 0;
+ unsigned char *include_pack;
+ struct child_process cmd = CHILD_PROCESS_INIT;
+ FILE *cmd_in;
+ struct multi_pack_index *m = lookup_multi_pack_index(r, object_dir);
+
+ /*
+ * When updating the default for these configuration
+ * variables in builtin/repack.c, these must be adjusted
+ * to match.
+ */
+ int delta_base_offset = 1;
+ int use_delta_islands = 0;
+
+ if (!m)
+ return 0;
+
+ CALLOC_ARRAY(include_pack, m->num_packs);
+
+ if (batch_size)
+ fill_included_packs_batch(r, m, include_pack, batch_size);
+ else
+ fill_included_packs_all(r, m, include_pack);
+
+ for (i = 0; i < m->num_packs; i++) {
+ if (include_pack[i])
+ packs_to_repack++;
+ }
+ if (packs_to_repack <= 1)
+ goto cleanup;
+
+ repo_config_get_bool(r, "repack.usedeltabaseoffset", &delta_base_offset);
+ repo_config_get_bool(r, "repack.usedeltaislands", &use_delta_islands);
+
+ strvec_pushl(&cmd.args, "pack-objects", "--stdin-packs", "--non-empty",
+ NULL);
+
+ strvec_pushf(&cmd.args, "%s/pack/pack", object_dir);
+
+ if (delta_base_offset)
+ strvec_push(&cmd.args, "--delta-base-offset");
+ if (use_delta_islands)
+ strvec_push(&cmd.args, "--delta-islands");
+
+ if (flags & MIDX_PROGRESS)
+ strvec_push(&cmd.args, "--progress");
+ else
+ strvec_push(&cmd.args, "-q");
+
+ cmd.git_cmd = 1;
+ cmd.in = cmd.out = -1;
+
+ if (start_command(&cmd)) {
+ error(_("could not start pack-objects"));
+ result = 1;
+ goto cleanup;
+ }
+
+ cmd_in = xfdopen(cmd.in, "w");
+ for (i = 0; i < m->num_packs; i++) {
+ struct packed_git *p = m->packs[i];
+ if (!p)
+ continue;
+
+ if (include_pack[i])
+ fprintf(cmd_in, "%s\n", pack_basename(p));
+ else
+ fprintf(cmd_in, "^%s\n", pack_basename(p));
+ }
+ fclose(cmd_in);
+
+ if (finish_command(&cmd)) {
+ error(_("could not finish pack-objects"));
+ result = 1;
+ goto cleanup;
+ }
+
+ result = write_midx_internal(object_dir, NULL, NULL, NULL, NULL, flags);
+
+cleanup:
+ free(include_pack);
+ return result;
+}
diff --git a/midx.c b/midx.c
index 5f0dd38..ae3b491 100644
--- a/midx.c
+++ b/midx.c
@@ -1,45 +1,22 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
-#include "csum-file.h"
#include "dir.h"
-#include "lockfile.h"
+#include "hex.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-file.h"
#include "hash-lookup.h"
#include "midx.h"
#include "progress.h"
#include "trace2.h"
-#include "run-command.h"
-#include "repository.h"
#include "chunk-format.h"
-#include "pack.h"
#include "pack-bitmap.h"
-#include "refs.h"
-#include "revision.h"
-#include "list-objects.h"
-
-#define MIDX_SIGNATURE 0x4d494458 /* "MIDX" */
-#define MIDX_VERSION 1
-#define MIDX_BYTE_FILE_VERSION 4
-#define MIDX_BYTE_HASH_VERSION 5
-#define MIDX_BYTE_NUM_CHUNKS 6
-#define MIDX_BYTE_NUM_PACKS 8
-#define MIDX_HEADER_SIZE 12
-#define MIDX_MIN_SIZE (MIDX_HEADER_SIZE + the_hash_algo->rawsz)
-
-#define MIDX_CHUNK_ALIGNMENT 4
-#define MIDX_CHUNKID_PACKNAMES 0x504e414d /* "PNAM" */
-#define MIDX_CHUNKID_OIDFANOUT 0x4f494446 /* "OIDF" */
-#define MIDX_CHUNKID_OIDLOOKUP 0x4f49444c /* "OIDL" */
-#define MIDX_CHUNKID_OBJECTOFFSETS 0x4f4f4646 /* "OOFF" */
-#define MIDX_CHUNKID_LARGEOFFSETS 0x4c4f4646 /* "LOFF" */
-#define MIDX_CHUNKID_REVINDEX 0x52494458 /* "RIDX" */
-#define MIDX_CHUNK_FANOUT_SIZE (sizeof(uint32_t) * 256)
-#define MIDX_CHUNK_OFFSET_WIDTH (2 * sizeof(uint32_t))
-#define MIDX_CHUNK_LARGE_OFFSET_WIDTH (sizeof(uint64_t))
-#define MIDX_LARGE_OFFSET_NEEDED 0x80000000
+#include "pack-revindex.h"
-#define PACK_EXPIRED UINT_MAX
+int midx_checksum_valid(struct multi_pack_index *m);
+void clear_midx_files_ext(const char *object_dir, const char *ext,
+ unsigned char *keep_hash);
+int cmp_idx_or_pack_name(const char *idx_or_pack_name,
+ const char *idx_name);
const unsigned char *get_midx_checksum(struct multi_pack_index *m)
{
@@ -60,6 +37,7 @@ void get_midx_rev_filename(struct strbuf *out, struct multi_pack_index *m)
static int midx_read_oid_fanout(const unsigned char *chunk_start,
size_t chunk_size, void *data)
{
+ int i;
struct multi_pack_index *m = data;
m->chunk_oid_fanout = (uint32_t *)chunk_start;
@@ -67,9 +45,48 @@ static int midx_read_oid_fanout(const unsigned char *chunk_start,
error(_("multi-pack-index OID fanout is of the wrong size"));
return 1;
}
+ for (i = 0; i < 255; i++) {
+ uint32_t oid_fanout1 = ntohl(m->chunk_oid_fanout[i]);
+ uint32_t oid_fanout2 = ntohl(m->chunk_oid_fanout[i+1]);
+
+ if (oid_fanout1 > oid_fanout2) {
+ error(_("oid fanout out of order: fanout[%d] = %"PRIx32" > %"PRIx32" = fanout[%d]"),
+ i, oid_fanout1, oid_fanout2, i + 1);
+ return 1;
+ }
+ }
+ m->num_objects = ntohl(m->chunk_oid_fanout[255]);
return 0;
}
+static int midx_read_oid_lookup(const unsigned char *chunk_start,
+ size_t chunk_size, void *data)
+{
+ struct multi_pack_index *m = data;
+ m->chunk_oid_lookup = chunk_start;
+
+ if (chunk_size != st_mult(m->hash_len, m->num_objects)) {
+ error(_("multi-pack-index OID lookup chunk is the wrong size"));
+ return 1;
+ }
+ return 0;
+}
+
+static int midx_read_object_offsets(const unsigned char *chunk_start,
+ size_t chunk_size, void *data)
+{
+ struct multi_pack_index *m = data;
+ m->chunk_object_offsets = chunk_start;
+
+ if (chunk_size != st_mult(m->num_objects, MIDX_CHUNK_OFFSET_WIDTH)) {
+ error(_("multi-pack-index object offset chunk is the wrong size"));
+ return 1;
+ }
+ return 0;
+}
+
+#define MIDX_MIN_SIZE (MIDX_HEADER_SIZE + the_hash_algo->rawsz)
+
struct multi_pack_index *load_multi_pack_index(const char *object_dir, int local)
{
struct multi_pack_index *m = NULL;
@@ -133,36 +150,49 @@ struct multi_pack_index *load_multi_pack_index(const char *object_dir, int local
m->num_packs = get_be32(m->data + MIDX_BYTE_NUM_PACKS);
+ m->preferred_pack_idx = -1;
+
cf = init_chunkfile(NULL);
if (read_table_of_contents(cf, m->data, midx_size,
- MIDX_HEADER_SIZE, m->num_chunks))
+ MIDX_HEADER_SIZE, m->num_chunks,
+ MIDX_CHUNK_ALIGNMENT))
goto cleanup_fail;
- if (pair_chunk(cf, MIDX_CHUNKID_PACKNAMES, &m->chunk_pack_names) == CHUNK_NOT_FOUND)
- die(_("multi-pack-index missing required pack-name chunk"));
- if (read_chunk(cf, MIDX_CHUNKID_OIDFANOUT, midx_read_oid_fanout, m) == CHUNK_NOT_FOUND)
- die(_("multi-pack-index missing required OID fanout chunk"));
- if (pair_chunk(cf, MIDX_CHUNKID_OIDLOOKUP, &m->chunk_oid_lookup) == CHUNK_NOT_FOUND)
- die(_("multi-pack-index missing required OID lookup chunk"));
- if (pair_chunk(cf, MIDX_CHUNKID_OBJECTOFFSETS, &m->chunk_object_offsets) == CHUNK_NOT_FOUND)
- die(_("multi-pack-index missing required object offsets chunk"));
-
- pair_chunk(cf, MIDX_CHUNKID_LARGEOFFSETS, &m->chunk_large_offsets);
+ if (pair_chunk(cf, MIDX_CHUNKID_PACKNAMES, &m->chunk_pack_names, &m->chunk_pack_names_len))
+ die(_("multi-pack-index required pack-name chunk missing or corrupted"));
+ if (read_chunk(cf, MIDX_CHUNKID_OIDFANOUT, midx_read_oid_fanout, m))
+ die(_("multi-pack-index required OID fanout chunk missing or corrupted"));
+ if (read_chunk(cf, MIDX_CHUNKID_OIDLOOKUP, midx_read_oid_lookup, m))
+ die(_("multi-pack-index required OID lookup chunk missing or corrupted"));
+ if (read_chunk(cf, MIDX_CHUNKID_OBJECTOFFSETS, midx_read_object_offsets, m))
+ die(_("multi-pack-index required object offsets chunk missing or corrupted"));
+
+ pair_chunk(cf, MIDX_CHUNKID_LARGEOFFSETS, &m->chunk_large_offsets,
+ &m->chunk_large_offsets_len);
+ pair_chunk(cf, MIDX_CHUNKID_BITMAPPEDPACKS,
+ (const unsigned char **)&m->chunk_bitmapped_packs,
+ &m->chunk_bitmapped_packs_len);
if (git_env_bool("GIT_TEST_MIDX_READ_RIDX", 1))
- pair_chunk(cf, MIDX_CHUNKID_REVINDEX, &m->chunk_revindex);
-
- m->num_objects = ntohl(m->chunk_oid_fanout[255]);
+ pair_chunk(cf, MIDX_CHUNKID_REVINDEX, &m->chunk_revindex,
+ &m->chunk_revindex_len);
CALLOC_ARRAY(m->pack_names, m->num_packs);
CALLOC_ARRAY(m->packs, m->num_packs);
cur_pack_name = (const char *)m->chunk_pack_names;
for (i = 0; i < m->num_packs; i++) {
+ const char *end;
+ size_t avail = m->chunk_pack_names_len -
+ (cur_pack_name - (const char *)m->chunk_pack_names);
+
m->pack_names[i] = cur_pack_name;
- cur_pack_name += strlen(cur_pack_name) + 1;
+ end = memchr(cur_pack_name, '\0', avail);
+ if (!end)
+ die(_("multi-pack-index pack-name chunk is too short"));
+ cur_pack_name = end + 1;
if (i && strcmp(m->pack_names[i], m->pack_names[i - 1]) <= 0)
die(_("multi-pack-index pack names out of order: '%s' before '%s'"),
@@ -236,6 +266,28 @@ int prepare_midx_pack(struct repository *r, struct multi_pack_index *m, uint32_t
return 0;
}
+#define MIDX_CHUNK_BITMAPPED_PACKS_WIDTH (2 * sizeof(uint32_t))
+
+int nth_bitmapped_pack(struct repository *r, struct multi_pack_index *m,
+ struct bitmapped_pack *bp, uint32_t pack_int_id)
+{
+ if (!m->chunk_bitmapped_packs)
+ return error(_("MIDX does not contain the BTMP chunk"));
+
+ if (prepare_midx_pack(r, m, pack_int_id))
+ return error(_("could not load bitmapped pack %"PRIu32), pack_int_id);
+
+ bp->p = m->packs[pack_int_id];
+ bp->bitmap_pos = get_be32((char *)m->chunk_bitmapped_packs +
+ MIDX_CHUNK_BITMAPPED_PACKS_WIDTH * pack_int_id);
+ bp->bitmap_nr = get_be32((char *)m->chunk_bitmapped_packs +
+ MIDX_CHUNK_BITMAPPED_PACKS_WIDTH * pack_int_id +
+ sizeof(uint32_t));
+ bp->pack_int_id = pack_int_id;
+
+ return 0;
+}
+
int bsearch_midx(const struct object_id *oid, struct multi_pack_index *m, uint32_t *result)
{
return bsearch_hash(oid->hash, m->chunk_oid_fanout, m->chunk_oid_lookup,
@@ -249,7 +301,7 @@ struct object_id *nth_midxed_object_oid(struct object_id *oid,
if (n >= m->num_objects)
return NULL;
- oidread(oid, m->chunk_oid_lookup + m->hash_len * n);
+ oidread(oid, m->chunk_oid_lookup + st_mult(m->hash_len, n));
return oid;
}
@@ -266,6 +318,8 @@ off_t nth_midxed_offset(struct multi_pack_index *m, uint32_t pos)
die(_("multi-pack-index stores a 64-bit offset, but off_t is too small"));
offset32 ^= MIDX_LARGE_OFFSET_NEEDED;
+ if (offset32 >= m->chunk_large_offsets_len / sizeof(uint64_t))
+ die(_("multi-pack-index large offset out of bounds"));
return get_be64(m->chunk_large_offsets + sizeof(uint64_t) * offset32);
}
@@ -278,7 +332,7 @@ uint32_t nth_midxed_pack_int_id(struct multi_pack_index *m, uint32_t pos)
(off_t)pos * MIDX_CHUNK_OFFSET_WIDTH);
}
-int fill_midx_entry(struct repository * r,
+int fill_midx_entry(struct repository *r,
const struct object_id *oid,
struct pack_entry *e,
struct multi_pack_index *m)
@@ -320,8 +374,8 @@ int fill_midx_entry(struct repository * r,
}
/* Match "foo.idx" against either "foo.pack" _or_ "foo.idx". */
-static int cmp_idx_or_pack_name(const char *idx_or_pack_name,
- const char *idx_name)
+int cmp_idx_or_pack_name(const char *idx_or_pack_name,
+ const char *idx_name)
{
/* Skip past any initial matching prefix. */
while (*idx_name && *idx_name == *idx_or_pack_name) {
@@ -351,7 +405,8 @@ static int cmp_idx_or_pack_name(const char *idx_or_pack_name,
return strcmp(idx_or_pack_name, idx_name);
}
-int midx_contains_pack(struct multi_pack_index *m, const char *idx_or_pack_name)
+int midx_locate_pack(struct multi_pack_index *m, const char *idx_or_pack_name,
+ uint32_t *pos)
{
uint32_t first = 0, last = m->num_packs;
@@ -362,8 +417,11 @@ int midx_contains_pack(struct multi_pack_index *m, const char *idx_or_pack_name)
current = m->pack_names[mid];
cmp = cmp_idx_or_pack_name(idx_or_pack_name, current);
- if (!cmp)
+ if (!cmp) {
+ if (pos)
+ *pos = mid;
return 1;
+ }
if (cmp > 0) {
first = mid + 1;
continue;
@@ -374,6 +432,28 @@ int midx_contains_pack(struct multi_pack_index *m, const char *idx_or_pack_name)
return 0;
}
+int midx_contains_pack(struct multi_pack_index *m, const char *idx_or_pack_name)
+{
+ return midx_locate_pack(m, idx_or_pack_name, NULL);
+}
+
+int midx_preferred_pack(struct multi_pack_index *m, uint32_t *pack_int_id)
+{
+ if (m->preferred_pack_idx == -1) {
+ if (load_midx_revindex(m) < 0) {
+ m->preferred_pack_idx = -2;
+ return -1;
+ }
+
+ m->preferred_pack_idx =
+ nth_midxed_pack_int_id(m, pack_pos_to_midx(m, 0));
+ } else if (m->preferred_pack_idx == -2)
+ return -1; /* no revindex */
+
+ *pack_int_id = m->preferred_pack_idx;
+ return 0;
+}
+
int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, int local)
{
struct multi_pack_index *m;
@@ -402,1108 +482,17 @@ int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, i
return 0;
}
-static size_t write_midx_header(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, num_chunks);
- hashwrite_u8(f, 0); /* unused */
- hashwrite_be32(f, num_packs);
-
- return MIDX_HEADER_SIZE;
-}
-
-struct pack_info {
- uint32_t orig_pack_int_id;
- char *pack_name;
- struct packed_git *p;
- unsigned expired : 1;
-};
-
-static int pack_info_compare(const void *_a, const void *_b)
-{
- struct pack_info *a = (struct pack_info *)_a;
- struct pack_info *b = (struct pack_info *)_b;
- return strcmp(a->pack_name, b->pack_name);
-}
-
-static int idx_or_pack_name_cmp(const void *_va, const void *_vb)
-{
- const char *pack_name = _va;
- const struct pack_info *compar = _vb;
-
- return cmp_idx_or_pack_name(pack_name, compar->pack_name);
-}
-
-struct write_midx_context {
- struct pack_info *info;
- uint32_t nr;
- uint32_t alloc;
- struct multi_pack_index *m;
- struct progress *progress;
- unsigned pack_paths_checked;
-
- struct pack_midx_entry *entries;
- uint32_t entries_nr;
-
- uint32_t *pack_perm;
- uint32_t *pack_order;
- unsigned large_offsets_needed:1;
- uint32_t num_large_offsets;
-
- int preferred_pack_idx;
-
- struct string_list *to_include;
-};
-
-static void add_pack_to_midx(const char *full_path, size_t full_path_len,
- const char *file_name, void *data)
-{
- struct write_midx_context *ctx = data;
-
- if (ends_with(file_name, ".idx")) {
- display_progress(ctx->progress, ++ctx->pack_paths_checked);
- /*
- * Note that at most one of ctx->m and ctx->to_include are set,
- * so we are testing midx_contains_pack() and
- * string_list_has_string() independently (guarded by the
- * appropriate NULL checks).
- *
- * We could support passing to_include while reusing an existing
- * MIDX, but don't currently since the reuse process drags
- * forward all packs from an existing MIDX (without checking
- * whether or not they appear in the to_include list).
- *
- * If we added support for that, these next two conditional
- * should be performed independently (likely checking
- * to_include before the existing MIDX).
- */
- if (ctx->m && midx_contains_pack(ctx->m, file_name))
- return;
- else if (ctx->to_include &&
- !string_list_has_string(ctx->to_include, file_name))
- return;
-
- ALLOC_GROW(ctx->info, ctx->nr + 1, ctx->alloc);
-
- ctx->info[ctx->nr].p = add_packed_git(full_path,
- full_path_len,
- 0);
-
- if (!ctx->info[ctx->nr].p) {
- warning(_("failed to add packfile '%s'"),
- full_path);
- return;
- }
-
- if (open_pack_index(ctx->info[ctx->nr].p)) {
- warning(_("failed to open pack-index '%s'"),
- full_path);
- close_pack(ctx->info[ctx->nr].p);
- FREE_AND_NULL(ctx->info[ctx->nr].p);
- return;
- }
-
- ctx->info[ctx->nr].pack_name = xstrdup(file_name);
- ctx->info[ctx->nr].orig_pack_int_id = ctx->nr;
- ctx->info[ctx->nr].expired = 0;
- ctx->nr++;
- }
-}
-
-struct pack_midx_entry {
- struct object_id oid;
- uint32_t pack_int_id;
- time_t pack_mtime;
- uint64_t offset;
- unsigned preferred : 1;
-};
-
-static int midx_oid_compare(const void *_a, const void *_b)
-{
- const struct pack_midx_entry *a = (const struct pack_midx_entry *)_a;
- const struct pack_midx_entry *b = (const struct pack_midx_entry *)_b;
- int cmp = oidcmp(&a->oid, &b->oid);
-
- if (cmp)
- return cmp;
-
- /* Sort objects in a preferred pack first when multiple copies exist. */
- if (a->preferred > b->preferred)
- return -1;
- if (a->preferred < b->preferred)
- return 1;
-
- if (a->pack_mtime > b->pack_mtime)
- return -1;
- else if (a->pack_mtime < b->pack_mtime)
- return 1;
-
- return a->pack_int_id - b->pack_int_id;
-}
-
-static int nth_midxed_pack_midx_entry(struct multi_pack_index *m,
- struct pack_midx_entry *e,
- uint32_t pos)
-{
- if (pos >= m->num_objects)
- return 1;
-
- nth_midxed_object_oid(&e->oid, m, pos);
- e->pack_int_id = nth_midxed_pack_int_id(m, pos);
- e->offset = nth_midxed_offset(m, pos);
-
- /* consider objects in midx to be from "old" packs */
- e->pack_mtime = 0;
- return 0;
-}
-
-static void fill_pack_entry(uint32_t pack_int_id,
- struct packed_git *p,
- uint32_t cur_object,
- struct pack_midx_entry *entry,
- int preferred)
-{
- if (nth_packed_object_id(&entry->oid, p, cur_object) < 0)
- die(_("failed to locate object %d in packfile"), cur_object);
-
- entry->pack_int_id = pack_int_id;
- entry->pack_mtime = p->mtime;
-
- entry->offset = nth_packed_object_offset(p, cur_object);
- entry->preferred = !!preferred;
-}
-
-/*
- * It is possible to artificially get into a state where there are many
- * duplicate copies of objects. That can create high memory pressure if
- * we are to create a list of all objects before de-duplication. To reduce
- * this memory pressure without a significant performance drop, automatically
- * group objects by the first byte of their object id. Use the IDX fanout
- * tables to group the data, copy to a local array, then sort.
- *
- * Copy only the de-duplicated entries (selected by most-recent modified time
- * of a packfile containing the object).
- */
-static struct pack_midx_entry *get_sorted_entries(struct multi_pack_index *m,
- struct pack_info *info,
- uint32_t nr_packs,
- uint32_t *nr_objects,
- int preferred_pack)
-{
- uint32_t cur_fanout, cur_pack, cur_object;
- uint32_t alloc_fanout, alloc_objects, total_objects = 0;
- struct pack_midx_entry *entries_by_fanout = NULL;
- struct pack_midx_entry *deduplicated_entries = NULL;
- uint32_t start_pack = m ? m->num_packs : 0;
-
- for (cur_pack = start_pack; cur_pack < nr_packs; cur_pack++)
- total_objects += info[cur_pack].p->num_objects;
-
- /*
- * As we de-duplicate by fanout value, we expect the fanout
- * slices to be evenly distributed, with some noise. Hence,
- * allocate slightly more than one 256th.
- */
- alloc_objects = alloc_fanout = total_objects > 3200 ? total_objects / 200 : 16;
-
- ALLOC_ARRAY(entries_by_fanout, alloc_fanout);
- ALLOC_ARRAY(deduplicated_entries, alloc_objects);
- *nr_objects = 0;
-
- for (cur_fanout = 0; cur_fanout < 256; cur_fanout++) {
- uint32_t nr_fanout = 0;
-
- if (m) {
- uint32_t start = 0, end;
-
- if (cur_fanout)
- start = ntohl(m->chunk_oid_fanout[cur_fanout - 1]);
- end = ntohl(m->chunk_oid_fanout[cur_fanout]);
-
- for (cur_object = start; cur_object < end; cur_object++) {
- ALLOC_GROW(entries_by_fanout, nr_fanout + 1, alloc_fanout);
- nth_midxed_pack_midx_entry(m,
- &entries_by_fanout[nr_fanout],
- cur_object);
- if (nth_midxed_pack_int_id(m, cur_object) == preferred_pack)
- entries_by_fanout[nr_fanout].preferred = 1;
- else
- entries_by_fanout[nr_fanout].preferred = 0;
- nr_fanout++;
- }
- }
-
- for (cur_pack = start_pack; cur_pack < nr_packs; cur_pack++) {
- uint32_t start = 0, end;
- int preferred = cur_pack == preferred_pack;
-
- if (cur_fanout)
- start = get_pack_fanout(info[cur_pack].p, cur_fanout - 1);
- end = get_pack_fanout(info[cur_pack].p, cur_fanout);
-
- for (cur_object = start; cur_object < end; cur_object++) {
- ALLOC_GROW(entries_by_fanout, nr_fanout + 1, alloc_fanout);
- fill_pack_entry(cur_pack,
- info[cur_pack].p,
- cur_object,
- &entries_by_fanout[nr_fanout],
- preferred);
- nr_fanout++;
- }
- }
-
- QSORT(entries_by_fanout, nr_fanout, midx_oid_compare);
-
- /*
- * The batch is now sorted by OID and then mtime (descending).
- * Take only the first duplicate.
- */
- for (cur_object = 0; cur_object < nr_fanout; cur_object++) {
- if (cur_object && oideq(&entries_by_fanout[cur_object - 1].oid,
- &entries_by_fanout[cur_object].oid))
- continue;
-
- ALLOC_GROW(deduplicated_entries, *nr_objects + 1, alloc_objects);
- memcpy(&deduplicated_entries[*nr_objects],
- &entries_by_fanout[cur_object],
- sizeof(struct pack_midx_entry));
- (*nr_objects)++;
- }
- }
-
- free(entries_by_fanout);
- return deduplicated_entries;
-}
-
-static int write_midx_pack_names(struct hashfile *f, void *data)
-{
- struct write_midx_context *ctx = data;
- uint32_t i;
- unsigned char padding[MIDX_CHUNK_ALIGNMENT];
- size_t written = 0;
-
- for (i = 0; i < ctx->nr; i++) {
- size_t writelen;
-
- if (ctx->info[i].expired)
- continue;
-
- if (i && strcmp(ctx->info[i].pack_name, ctx->info[i - 1].pack_name) <= 0)
- BUG("incorrect pack-file order: %s before %s",
- ctx->info[i - 1].pack_name,
- ctx->info[i].pack_name);
-
- writelen = strlen(ctx->info[i].pack_name) + 1;
- hashwrite(f, ctx->info[i].pack_name, writelen);
- written += writelen;
- }
-
- /* add padding to be aligned */
- i = MIDX_CHUNK_ALIGNMENT - (written % MIDX_CHUNK_ALIGNMENT);
- if (i < MIDX_CHUNK_ALIGNMENT) {
- memset(padding, 0, sizeof(padding));
- hashwrite(f, padding, i);
- }
-
- return 0;
-}
-
-static int write_midx_oid_fanout(struct hashfile *f,
- void *data)
-{
- struct write_midx_context *ctx = data;
- struct pack_midx_entry *list = ctx->entries;
- struct pack_midx_entry *last = ctx->entries + ctx->entries_nr;
- uint32_t count = 0;
- uint32_t i;
-
- /*
- * Write the first-level table (the list is sorted,
- * but we use a 256-entry lookup to be able to avoid
- * having to do eight extra binary search iterations).
- */
- for (i = 0; i < 256; i++) {
- struct pack_midx_entry *next = list;
-
- while (next < last && next->oid.hash[0] == i) {
- count++;
- next++;
- }
-
- hashwrite_be32(f, count);
- list = next;
- }
-
- return 0;
-}
-
-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;
- struct pack_midx_entry *list = ctx->entries;
- uint32_t i;
-
- for (i = 0; i < ctx->entries_nr; i++) {
- struct pack_midx_entry *obj = list++;
-
- if (i < ctx->entries_nr - 1) {
- struct pack_midx_entry *next = list;
- if (oidcmp(&obj->oid, &next->oid) >= 0)
- BUG("OIDs not in order: %s >= %s",
- oid_to_hex(&obj->oid),
- oid_to_hex(&next->oid));
- }
-
- hashwrite(f, obj->oid.hash, (int)hash_len);
- }
-
- return 0;
-}
-
-static int write_midx_object_offsets(struct hashfile *f,
- void *data)
-{
- struct write_midx_context *ctx = data;
- struct pack_midx_entry *list = ctx->entries;
- uint32_t i, nr_large_offset = 0;
-
- for (i = 0; i < ctx->entries_nr; i++) {
- struct pack_midx_entry *obj = list++;
-
- if (ctx->pack_perm[obj->pack_int_id] == PACK_EXPIRED)
- BUG("object %s is in an expired pack with int-id %d",
- oid_to_hex(&obj->oid),
- obj->pack_int_id);
-
- hashwrite_be32(f, ctx->pack_perm[obj->pack_int_id]);
-
- if (ctx->large_offsets_needed && obj->offset >> 31)
- hashwrite_be32(f, MIDX_LARGE_OFFSET_NEEDED | nr_large_offset++);
- else if (!ctx->large_offsets_needed && obj->offset >> 32)
- BUG("object %s requires a large offset (%"PRIx64") but the MIDX is not writing large offsets!",
- oid_to_hex(&obj->oid),
- obj->offset);
- else
- hashwrite_be32(f, (uint32_t)obj->offset);
- }
-
- return 0;
-}
-
-static int write_midx_large_offsets(struct hashfile *f,
- void *data)
-{
- struct write_midx_context *ctx = data;
- struct pack_midx_entry *list = ctx->entries;
- struct pack_midx_entry *end = ctx->entries + ctx->entries_nr;
- uint32_t nr_large_offset = ctx->num_large_offsets;
-
- while (nr_large_offset) {
- struct pack_midx_entry *obj;
- uint64_t offset;
-
- if (list >= end)
- BUG("too many large-offset objects");
-
- obj = list++;
- offset = obj->offset;
-
- if (!(offset >> 31))
- continue;
-
- hashwrite_be64(f, offset);
-
- nr_large_offset--;
- }
-
- return 0;
-}
-
-static int write_midx_revindex(struct hashfile *f,
- void *data)
-{
- struct write_midx_context *ctx = data;
- uint32_t i;
-
- for (i = 0; i < ctx->entries_nr; i++)
- hashwrite_be32(f, ctx->pack_order[i]);
-
- return 0;
-}
-
-struct midx_pack_order_data {
- uint32_t nr;
- uint32_t pack;
- off_t offset;
-};
-
-static int midx_pack_order_cmp(const void *va, const void *vb)
-{
- const struct midx_pack_order_data *a = va, *b = vb;
- if (a->pack < b->pack)
- return -1;
- else if (a->pack > b->pack)
- return 1;
- else if (a->offset < b->offset)
- return -1;
- else if (a->offset > b->offset)
- return 1;
- else
- return 0;
-}
-
-static uint32_t *midx_pack_order(struct write_midx_context *ctx)
-{
- struct midx_pack_order_data *data;
- uint32_t *pack_order;
- uint32_t i;
-
- ALLOC_ARRAY(data, ctx->entries_nr);
- for (i = 0; i < ctx->entries_nr; i++) {
- struct pack_midx_entry *e = &ctx->entries[i];
- data[i].nr = i;
- data[i].pack = ctx->pack_perm[e->pack_int_id];
- if (!e->preferred)
- data[i].pack |= (1U << 31);
- data[i].offset = e->offset;
- }
-
- QSORT(data, ctx->entries_nr, midx_pack_order_cmp);
-
- ALLOC_ARRAY(pack_order, ctx->entries_nr);
- for (i = 0; i < ctx->entries_nr; i++)
- pack_order[i] = data[i].nr;
- free(data);
-
- return pack_order;
-}
-
-static void write_midx_reverse_index(char *midx_name, unsigned char *midx_hash,
- struct write_midx_context *ctx)
-{
- struct strbuf buf = STRBUF_INIT;
- const char *tmp_file;
-
- strbuf_addf(&buf, "%s-%s.rev", midx_name, hash_to_hex(midx_hash));
-
- tmp_file = write_rev_file_order(NULL, ctx->pack_order, ctx->entries_nr,
- midx_hash, WRITE_REV);
-
- if (finalize_object_file(tmp_file, buf.buf))
- die(_("cannot store reverse index file"));
-
- strbuf_release(&buf);
-}
-
-static void clear_midx_files_ext(const char *object_dir, const char *ext,
- unsigned char *keep_hash);
-
-static int midx_checksum_valid(struct multi_pack_index *m)
+int midx_checksum_valid(struct multi_pack_index *m)
{
return hashfile_checksum_valid(m->data, m->data_len);
}
-static void prepare_midx_packing_data(struct packing_data *pdata,
- struct write_midx_context *ctx)
-{
- uint32_t i;
-
- memset(pdata, 0, sizeof(struct packing_data));
- prepare_packing_data(the_repository, pdata);
-
- for (i = 0; i < ctx->entries_nr; i++) {
- struct pack_midx_entry *from = &ctx->entries[ctx->pack_order[i]];
- struct object_entry *to = packlist_alloc(pdata, &from->oid);
-
- oe_set_in_pack(pdata, to,
- ctx->info[ctx->pack_perm[from->pack_int_id]].p);
- }
-}
-
-static int add_ref_to_pending(const char *refname,
- const struct object_id *oid,
- int flag, void *cb_data)
-{
- struct rev_info *revs = (struct rev_info*)cb_data;
- struct object *object;
-
- if ((flag & REF_ISSYMREF) && (flag & REF_ISBROKEN)) {
- warning("symbolic ref is dangling: %s", refname);
- return 0;
- }
-
- object = parse_object_or_die(oid, refname);
- if (object->type != OBJ_COMMIT)
- return 0;
-
- add_pending_object(revs, object, "");
- if (bitmap_is_preferred_refname(revs->repo, refname))
- object->flags |= NEEDS_BITMAP;
- return 0;
-}
-
-struct bitmap_commit_cb {
- struct commit **commits;
- size_t commits_nr, commits_alloc;
-
- struct write_midx_context *ctx;
-};
-
-static const struct object_id *bitmap_oid_access(size_t index,
- const void *_entries)
-{
- const struct pack_midx_entry *entries = _entries;
- return &entries[index].oid;
-}
-
-static void bitmap_show_commit(struct commit *commit, void *_data)
-{
- struct bitmap_commit_cb *data = _data;
- int pos = oid_pos(&commit->object.oid, data->ctx->entries,
- data->ctx->entries_nr,
- bitmap_oid_access);
- if (pos < 0)
- return;
-
- ALLOC_GROW(data->commits, data->commits_nr + 1, data->commits_alloc);
- data->commits[data->commits_nr++] = commit;
-}
-
-static int read_refs_snapshot(const char *refs_snapshot,
- struct rev_info *revs)
-{
- struct strbuf buf = STRBUF_INIT;
- struct object_id oid;
- FILE *f = xfopen(refs_snapshot, "r");
-
- while (strbuf_getline(&buf, f) != EOF) {
- struct object *object;
- int preferred = 0;
- char *hex = buf.buf;
- const char *end = NULL;
-
- if (buf.len && *buf.buf == '+') {
- preferred = 1;
- hex = &buf.buf[1];
- }
-
- if (parse_oid_hex(hex, &oid, &end) < 0)
- die(_("could not parse line: %s"), buf.buf);
- if (*end)
- die(_("malformed line: %s"), buf.buf);
-
- object = parse_object_or_die(&oid, NULL);
- if (preferred)
- object->flags |= NEEDS_BITMAP;
-
- add_pending_object(revs, object, "");
- }
-
- fclose(f);
- 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)
-{
- struct rev_info revs;
- struct bitmap_commit_cb cb = {0};
-
- cb.ctx = ctx;
-
- repo_init_revisions(the_repository, &revs, NULL);
- if (refs_snapshot) {
- read_refs_snapshot(refs_snapshot, &revs);
- } else {
- setup_revisions(0, NULL, &revs, NULL);
- for_each_ref(add_ref_to_pending, &revs);
- }
-
- /*
- * Skipping promisor objects here is intentional, since it only excludes
- * them from the list of reachable commits that we want to select from
- * when computing the selection of MIDX'd commits to receive bitmaps.
- *
- * Reachability bitmaps do require that their objects be closed under
- * reachability, but fetching any objects missing from promisors at this
- * point is too late. But, if one of those objects can be reached from
- * an another object that is included in the bitmap, then we will
- * complain later that we don't have reachability closure (and fail
- * appropriately).
- */
- fetch_if_missing = 0;
- revs.exclude_promisor_objects = 1;
-
- if (prepare_revision_walk(&revs))
- die(_("revision walk setup failed"));
-
- traverse_commit_list(&revs, bitmap_show_commit, NULL, &cb);
- if (indexed_commits_nr_p)
- *indexed_commits_nr_p = cb.commits_nr;
-
- release_revisions(&revs);
- return cb.commits;
-}
-
-static int write_midx_bitmap(char *midx_name, unsigned char *midx_hash,
- struct write_midx_context *ctx,
- const char *refs_snapshot,
- unsigned flags)
-{
- struct packing_data pdata;
- struct pack_idx_entry **index;
- struct commit **commits = NULL;
- uint32_t i, commits_nr;
- uint16_t options = 0;
- char *bitmap_name = xstrfmt("%s-%s.bitmap", midx_name, hash_to_hex(midx_hash));
- int ret;
-
- if (!ctx->entries_nr)
- BUG("cannot write a bitmap without any objects");
-
- if (flags & MIDX_WRITE_BITMAP_HASH_CACHE)
- options |= BITMAP_OPT_HASH_CACHE;
-
- prepare_midx_packing_data(&pdata, ctx);
-
- commits = find_commits_for_midx_bitmap(&commits_nr, refs_snapshot, ctx);
-
- /*
- * Build the MIDX-order index based on pdata.objects (which is already
- * in MIDX order; c.f., 'midx_pack_order_cmp()' for the definition of
- * this order).
- */
- ALLOC_ARRAY(index, pdata.nr_objects);
- for (i = 0; i < pdata.nr_objects; i++)
- index[i] = &pdata.objects[i].idx;
-
- bitmap_writer_show_progress(flags & MIDX_PROGRESS);
- bitmap_writer_build_type_index(&pdata, index, pdata.nr_objects);
-
- /*
- * bitmap_writer_finish expects objects in lex order, but pack_order
- * gives us exactly that. use it directly instead of re-sorting the
- * array.
- *
- * This changes the order of objects in 'index' between
- * bitmap_writer_build_type_index and bitmap_writer_finish.
- *
- * The same re-ordering takes place in the single-pack bitmap code via
- * write_idx_file(), which is called by finish_tmp_packfile(), which
- * happens between bitmap_writer_build_type_index() and
- * bitmap_writer_finish().
- */
- for (i = 0; i < pdata.nr_objects; i++)
- index[ctx->pack_order[i]] = &pdata.objects[i].idx;
-
- bitmap_writer_select_commits(commits, commits_nr, -1);
- ret = bitmap_writer_build(&pdata);
- if (ret < 0)
- goto cleanup;
-
- bitmap_writer_set_checksum(midx_hash);
- bitmap_writer_finish(index, pdata.nr_objects, bitmap_name, options);
-
-cleanup:
- free(index);
- free(bitmap_name);
- return ret;
-}
-
-static struct multi_pack_index *lookup_multi_pack_index(struct repository *r,
- const char *object_dir)
-{
- struct multi_pack_index *result = NULL;
- struct multi_pack_index *cur;
- char *obj_dir_real = real_pathdup(object_dir, 1);
- struct strbuf cur_path_real = STRBUF_INIT;
-
- /* Ensure the given object_dir is local, or a known alternate. */
- find_odb(r, obj_dir_real);
-
- for (cur = get_multi_pack_index(r); cur; cur = cur->next) {
- strbuf_realpath(&cur_path_real, cur->object_dir, 1);
- if (!strcmp(obj_dir_real, cur_path_real.buf)) {
- result = cur;
- goto cleanup;
- }
- }
-
-cleanup:
- free(obj_dir_real);
- strbuf_release(&cur_path_real);
- return result;
-}
-
-static int write_midx_internal(const char *object_dir,
- struct string_list *packs_to_include,
- struct string_list *packs_to_drop,
- const char *preferred_pack_name,
- const char *refs_snapshot,
- unsigned flags)
-{
- struct strbuf midx_name = STRBUF_INIT;
- unsigned char midx_hash[GIT_MAX_RAWSZ];
- uint32_t i;
- struct hashfile *f = NULL;
- struct lock_file lk;
- struct write_midx_context ctx = { 0 };
- int pack_name_concat_len = 0;
- int dropped_packs = 0;
- int result = 0;
- struct chunkfile *cf;
-
- get_midx_filename(&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) {
- /*
- * Only reference an existing MIDX when not filtering which
- * packs to include, since all packs and objects are copied
- * blindly from an existing MIDX if one is present.
- */
- ctx.m = lookup_multi_pack_index(the_repository, object_dir);
- }
-
- if (ctx.m && !midx_checksum_valid(ctx.m)) {
- warning(_("ignoring existing multi-pack-index; checksum mismatch"));
- ctx.m = NULL;
- }
-
- ctx.nr = 0;
- ctx.alloc = ctx.m ? ctx.m->num_packs : 16;
- ctx.info = NULL;
- ALLOC_ARRAY(ctx.info, ctx.alloc);
-
- if (ctx.m) {
- for (i = 0; i < ctx.m->num_packs; i++) {
- ALLOC_GROW(ctx.info, ctx.nr + 1, ctx.alloc);
-
- ctx.info[ctx.nr].orig_pack_int_id = i;
- ctx.info[ctx.nr].pack_name = xstrdup(ctx.m->pack_names[i]);
- ctx.info[ctx.nr].p = ctx.m->packs[i];
- ctx.info[ctx.nr].expired = 0;
-
- if (flags & MIDX_WRITE_REV_INDEX) {
- /*
- * If generating a reverse index, need to have
- * packed_git's loaded to compare their
- * mtimes and object count.
- */
- if (prepare_midx_pack(the_repository, ctx.m, i)) {
- error(_("could not load pack"));
- result = 1;
- goto cleanup;
- }
-
- if (open_pack_index(ctx.m->packs[i]))
- die(_("could not open index for %s"),
- ctx.m->packs[i]->pack_name);
- ctx.info[ctx.nr].p = ctx.m->packs[i];
- }
-
- ctx.nr++;
- }
- }
-
- ctx.pack_paths_checked = 0;
- if (flags & MIDX_PROGRESS)
- ctx.progress = start_delayed_progress(_("Adding packfiles to multi-pack-index"), 0);
- else
- ctx.progress = NULL;
-
- ctx.to_include = packs_to_include;
-
- for_each_file_in_pack_dir(object_dir, add_pack_to_midx, &ctx);
- stop_progress(&ctx.progress);
-
- if ((ctx.m && ctx.nr == ctx.m->num_packs) &&
- !(packs_to_include || packs_to_drop)) {
- struct bitmap_index *bitmap_git;
- int bitmap_exists;
- int want_bitmap = flags & MIDX_WRITE_BITMAP;
-
- bitmap_git = prepare_midx_bitmap_git(ctx.m);
- bitmap_exists = bitmap_git && bitmap_is_midx(bitmap_git);
- free_bitmap_index(bitmap_git);
-
- if (bitmap_exists || !want_bitmap) {
- /*
- * The correct MIDX already exists, and so does a
- * corresponding bitmap (or one wasn't requested).
- */
- if (!want_bitmap)
- clear_midx_files_ext(object_dir, ".bitmap",
- NULL);
- goto cleanup;
- }
- }
-
- if (preferred_pack_name) {
- int found = 0;
- for (i = 0; i < ctx.nr; i++) {
- if (!cmp_idx_or_pack_name(preferred_pack_name,
- ctx.info[i].pack_name)) {
- ctx.preferred_pack_idx = i;
- found = 1;
- break;
- }
- }
-
- if (!found)
- warning(_("unknown preferred pack: '%s'"),
- preferred_pack_name);
- } else if (ctx.nr &&
- (flags & (MIDX_WRITE_REV_INDEX | MIDX_WRITE_BITMAP))) {
- struct packed_git *oldest = ctx.info[ctx.preferred_pack_idx].p;
- ctx.preferred_pack_idx = 0;
-
- if (packs_to_drop && packs_to_drop->nr)
- BUG("cannot write a MIDX bitmap during expiration");
-
- /*
- * set a preferred pack when writing a bitmap to ensure that
- * the pack from which the first object is selected in pseudo
- * pack-order has all of its objects selected from that pack
- * (and not another pack containing a duplicate)
- */
- for (i = 1; i < ctx.nr; i++) {
- struct packed_git *p = ctx.info[i].p;
-
- if (!oldest->num_objects || p->mtime < oldest->mtime) {
- oldest = p;
- ctx.preferred_pack_idx = i;
- }
- }
-
- if (!oldest->num_objects) {
- /*
- * If all packs are empty; unset the preferred index.
- * This is acceptable since there will be no duplicate
- * objects to resolve, so the preferred value doesn't
- * matter.
- */
- ctx.preferred_pack_idx = -1;
- }
- } else {
- /*
- * otherwise don't mark any pack as preferred to avoid
- * interfering with expiration logic below
- */
- ctx.preferred_pack_idx = -1;
- }
-
- if (ctx.preferred_pack_idx > -1) {
- struct packed_git *preferred = ctx.info[ctx.preferred_pack_idx].p;
- if (!preferred->num_objects) {
- error(_("cannot select preferred pack %s with no objects"),
- preferred->pack_name);
- result = 1;
- goto cleanup;
- }
- }
-
- ctx.entries = get_sorted_entries(ctx.m, ctx.info, ctx.nr, &ctx.entries_nr,
- ctx.preferred_pack_idx);
-
- ctx.large_offsets_needed = 0;
- for (i = 0; i < ctx.entries_nr; i++) {
- if (ctx.entries[i].offset > 0x7fffffff)
- ctx.num_large_offsets++;
- if (ctx.entries[i].offset > 0xffffffff)
- ctx.large_offsets_needed = 1;
- }
-
- QSORT(ctx.info, ctx.nr, pack_info_compare);
-
- if (packs_to_drop && packs_to_drop->nr) {
- int drop_index = 0;
- int missing_drops = 0;
-
- for (i = 0; i < ctx.nr && drop_index < packs_to_drop->nr; i++) {
- int cmp = strcmp(ctx.info[i].pack_name,
- packs_to_drop->items[drop_index].string);
-
- if (!cmp) {
- drop_index++;
- ctx.info[i].expired = 1;
- } else if (cmp > 0) {
- error(_("did not see pack-file %s to drop"),
- packs_to_drop->items[drop_index].string);
- drop_index++;
- missing_drops++;
- i--;
- } else {
- ctx.info[i].expired = 0;
- }
- }
-
- if (missing_drops) {
- result = 1;
- goto cleanup;
- }
- }
-
- /*
- * pack_perm stores a permutation between pack-int-ids from the
- * previous multi-pack-index to the new one we are writing:
- *
- * pack_perm[old_id] = new_id
- */
- ALLOC_ARRAY(ctx.pack_perm, ctx.nr);
- for (i = 0; i < ctx.nr; i++) {
- if (ctx.info[i].expired) {
- dropped_packs++;
- ctx.pack_perm[ctx.info[i].orig_pack_int_id] = PACK_EXPIRED;
- } else {
- ctx.pack_perm[ctx.info[i].orig_pack_int_id] = i - dropped_packs;
- }
- }
-
- for (i = 0; i < ctx.nr; i++) {
- if (!ctx.info[i].expired)
- pack_name_concat_len += strlen(ctx.info[i].pack_name) + 1;
- }
-
- /* Check that the preferred pack wasn't expired (if given). */
- if (preferred_pack_name) {
- struct pack_info *preferred = bsearch(preferred_pack_name,
- ctx.info, ctx.nr,
- sizeof(*ctx.info),
- idx_or_pack_name_cmp);
- if (preferred) {
- uint32_t perm = ctx.pack_perm[preferred->orig_pack_int_id];
- if (perm == PACK_EXPIRED)
- warning(_("preferred pack '%s' is expired"),
- preferred_pack_name);
- }
- }
-
- if (pack_name_concat_len % MIDX_CHUNK_ALIGNMENT)
- pack_name_concat_len += MIDX_CHUNK_ALIGNMENT -
- (pack_name_concat_len % MIDX_CHUNK_ALIGNMENT);
-
- hold_lock_file_for_update(&lk, midx_name.buf, LOCK_DIE_ON_ERROR);
- f = hashfd(get_lock_file_fd(&lk), get_lock_file_path(&lk));
-
- if (ctx.nr - dropped_packs == 0) {
- error(_("no pack files to index."));
- result = 1;
- goto cleanup;
- }
-
- if (!ctx.entries_nr) {
- if (flags & MIDX_WRITE_BITMAP)
- warning(_("refusing to write multi-pack .bitmap without any objects"));
- flags &= ~(MIDX_WRITE_REV_INDEX | MIDX_WRITE_BITMAP);
- }
-
- cf = init_chunkfile(f);
-
- add_chunk(cf, MIDX_CHUNKID_PACKNAMES, pack_name_concat_len,
- write_midx_pack_names);
- add_chunk(cf, MIDX_CHUNKID_OIDFANOUT, MIDX_CHUNK_FANOUT_SIZE,
- write_midx_oid_fanout);
- add_chunk(cf, MIDX_CHUNKID_OIDLOOKUP,
- (size_t)ctx.entries_nr * the_hash_algo->rawsz,
- write_midx_oid_lookup);
- add_chunk(cf, MIDX_CHUNKID_OBJECTOFFSETS,
- (size_t)ctx.entries_nr * MIDX_CHUNK_OFFSET_WIDTH,
- write_midx_object_offsets);
-
- if (ctx.large_offsets_needed)
- add_chunk(cf, MIDX_CHUNKID_LARGEOFFSETS,
- (size_t)ctx.num_large_offsets * MIDX_CHUNK_LARGE_OFFSET_WIDTH,
- write_midx_large_offsets);
-
- if (flags & (MIDX_WRITE_REV_INDEX | MIDX_WRITE_BITMAP)) {
- ctx.pack_order = midx_pack_order(&ctx);
- add_chunk(cf, MIDX_CHUNKID_REVINDEX,
- ctx.entries_nr * sizeof(uint32_t),
- write_midx_revindex);
- }
-
- write_midx_header(f, get_num_chunks(cf), ctx.nr - dropped_packs);
- write_chunkfile(cf, &ctx);
-
- finalize_hashfile(f, midx_hash, FSYNC_COMPONENT_PACK_METADATA,
- CSUM_FSYNC | CSUM_HASH_IN_STREAM);
- free_chunkfile(cf);
-
- if (flags & MIDX_WRITE_REV_INDEX &&
- git_env_bool("GIT_TEST_MIDX_WRITE_REV", 0))
- write_midx_reverse_index(midx_name.buf, midx_hash, &ctx);
- if (flags & MIDX_WRITE_BITMAP) {
- if (write_midx_bitmap(midx_name.buf, midx_hash, &ctx,
- refs_snapshot, flags) < 0) {
- error(_("could not write multi-pack bitmap"));
- result = 1;
- goto cleanup;
- }
- }
-
- if (ctx.m)
- close_object_store(the_repository->objects);
-
- if (commit_lock_file(&lk) < 0)
- die_errno(_("could not write multi-pack-index"));
-
- clear_midx_files_ext(object_dir, ".bitmap", midx_hash);
- clear_midx_files_ext(object_dir, ".rev", midx_hash);
-
-cleanup:
- for (i = 0; i < ctx.nr; i++) {
- if (ctx.info[i].p) {
- close_pack(ctx.info[i].p);
- free(ctx.info[i].p);
- }
- free(ctx.info[i].pack_name);
- }
-
- free(ctx.info);
- free(ctx.entries);
- free(ctx.pack_perm);
- free(ctx.pack_order);
- strbuf_release(&midx_name);
-
- return result;
-}
-
-int write_midx_file(const char *object_dir,
- const char *preferred_pack_name,
- const char *refs_snapshot,
- unsigned flags)
-{
- return write_midx_internal(object_dir, NULL, NULL, preferred_pack_name,
- refs_snapshot, flags);
-}
-
-int write_midx_file_only(const char *object_dir,
- struct string_list *packs_to_include,
- const char *preferred_pack_name,
- const char *refs_snapshot,
- unsigned flags)
-{
- return write_midx_internal(object_dir, packs_to_include, NULL,
- preferred_pack_name, refs_snapshot, flags);
-}
-
struct clear_midx_data {
char *keep;
const char *ext;
};
-static void clear_midx_file_ext(const char *full_path, size_t full_path_len,
+static void clear_midx_file_ext(const char *full_path, size_t full_path_len UNUSED,
const char *file_name, void *_data)
{
struct clear_midx_data *data = _data;
@@ -1518,8 +507,8 @@ static void clear_midx_file_ext(const char *full_path, size_t full_path_len,
die_errno(_("failed to remove %s"), full_path);
}
-static void clear_midx_files_ext(const char *object_dir, const char *ext,
- unsigned char *keep_hash)
+void clear_midx_files_ext(const char *object_dir, const char *ext,
+ unsigned char *keep_hash)
{
struct clear_midx_data data;
memset(&data, 0, sizeof(struct clear_midx_data));
@@ -1632,15 +621,6 @@ int verify_midx_file(struct repository *r, const char *object_dir, unsigned flag
}
stop_progress(&progress);
- for (i = 0; i < 255; i++) {
- uint32_t oid_fanout1 = ntohl(m->chunk_oid_fanout[i]);
- uint32_t oid_fanout2 = ntohl(m->chunk_oid_fanout[i + 1]);
-
- if (oid_fanout1 > oid_fanout2)
- midx_report(_("oid fanout out of order: fanout[%d] = %"PRIx32" > %"PRIx32" = fanout[%d]"),
- i, oid_fanout1, oid_fanout2, i + 1);
- }
-
if (m->num_objects == 0) {
midx_report(_("the midx contains no oid"));
/*
@@ -1731,250 +711,3 @@ cleanup:
return verify_midx_error;
}
-
-int expire_midx_packs(struct repository *r, const char *object_dir, unsigned flags)
-{
- uint32_t i, *count, result = 0;
- struct string_list packs_to_drop = STRING_LIST_INIT_DUP;
- struct multi_pack_index *m = lookup_multi_pack_index(r, object_dir);
- struct progress *progress = NULL;
-
- if (!m)
- return 0;
-
- CALLOC_ARRAY(count, m->num_packs);
-
- if (flags & MIDX_PROGRESS)
- progress = start_delayed_progress(_("Counting referenced objects"),
- m->num_objects);
- for (i = 0; i < m->num_objects; i++) {
- int pack_int_id = nth_midxed_pack_int_id(m, i);
- count[pack_int_id]++;
- display_progress(progress, i + 1);
- }
- stop_progress(&progress);
-
- if (flags & MIDX_PROGRESS)
- progress = start_delayed_progress(_("Finding and deleting unreferenced packfiles"),
- m->num_packs);
- for (i = 0; i < m->num_packs; i++) {
- char *pack_name;
- display_progress(progress, i + 1);
-
- if (count[i])
- continue;
-
- if (prepare_midx_pack(r, m, i))
- continue;
-
- if (m->packs[i]->pack_keep)
- continue;
-
- pack_name = xstrdup(m->packs[i]->pack_name);
- close_pack(m->packs[i]);
-
- string_list_insert(&packs_to_drop, m->pack_names[i]);
- unlink_pack_path(pack_name, 0);
- free(pack_name);
- }
- stop_progress(&progress);
-
- free(count);
-
- if (packs_to_drop.nr)
- result = write_midx_internal(object_dir, NULL, &packs_to_drop, NULL, NULL, flags);
-
- string_list_clear(&packs_to_drop, 0);
-
- return result;
-}
-
-struct repack_info {
- timestamp_t mtime;
- uint32_t referenced_objects;
- uint32_t pack_int_id;
-};
-
-static int compare_by_mtime(const void *a_, const void *b_)
-{
- const struct repack_info *a, *b;
-
- a = (const struct repack_info *)a_;
- b = (const struct repack_info *)b_;
-
- if (a->mtime < b->mtime)
- return -1;
- if (a->mtime > b->mtime)
- return 1;
- return 0;
-}
-
-static int fill_included_packs_all(struct repository *r,
- struct multi_pack_index *m,
- unsigned char *include_pack)
-{
- uint32_t i, count = 0;
- int pack_kept_objects = 0;
-
- repo_config_get_bool(r, "repack.packkeptobjects", &pack_kept_objects);
-
- for (i = 0; i < m->num_packs; i++) {
- if (prepare_midx_pack(r, m, i))
- continue;
- if (!pack_kept_objects && m->packs[i]->pack_keep)
- continue;
-
- include_pack[i] = 1;
- count++;
- }
-
- return count < 2;
-}
-
-static int fill_included_packs_batch(struct repository *r,
- struct multi_pack_index *m,
- unsigned char *include_pack,
- size_t batch_size)
-{
- uint32_t i, packs_to_repack;
- size_t total_size;
- struct repack_info *pack_info = xcalloc(m->num_packs, sizeof(struct repack_info));
- int pack_kept_objects = 0;
-
- repo_config_get_bool(r, "repack.packkeptobjects", &pack_kept_objects);
-
- for (i = 0; i < m->num_packs; i++) {
- pack_info[i].pack_int_id = i;
-
- if (prepare_midx_pack(r, m, i))
- continue;
-
- pack_info[i].mtime = m->packs[i]->mtime;
- }
-
- for (i = 0; batch_size && i < m->num_objects; i++) {
- uint32_t pack_int_id = nth_midxed_pack_int_id(m, i);
- pack_info[pack_int_id].referenced_objects++;
- }
-
- QSORT(pack_info, m->num_packs, compare_by_mtime);
-
- total_size = 0;
- packs_to_repack = 0;
- for (i = 0; total_size < batch_size && i < m->num_packs; i++) {
- int pack_int_id = pack_info[i].pack_int_id;
- struct packed_git *p = m->packs[pack_int_id];
- size_t expected_size;
-
- if (!p)
- continue;
- if (!pack_kept_objects && p->pack_keep)
- continue;
- if (open_pack_index(p) || !p->num_objects)
- continue;
-
- expected_size = (size_t)(p->pack_size
- * pack_info[i].referenced_objects);
- expected_size /= p->num_objects;
-
- if (expected_size >= batch_size)
- continue;
-
- packs_to_repack++;
- total_size += expected_size;
- include_pack[pack_int_id] = 1;
- }
-
- free(pack_info);
-
- if (packs_to_repack < 2)
- return 1;
-
- return 0;
-}
-
-int midx_repack(struct repository *r, const char *object_dir, size_t batch_size, unsigned flags)
-{
- int result = 0;
- uint32_t i;
- unsigned char *include_pack;
- struct child_process cmd = CHILD_PROCESS_INIT;
- FILE *cmd_in;
- struct strbuf base_name = STRBUF_INIT;
- struct multi_pack_index *m = lookup_multi_pack_index(r, object_dir);
-
- /*
- * When updating the default for these configuration
- * variables in builtin/repack.c, these must be adjusted
- * to match.
- */
- int delta_base_offset = 1;
- int use_delta_islands = 0;
-
- if (!m)
- return 0;
-
- CALLOC_ARRAY(include_pack, m->num_packs);
-
- if (batch_size) {
- if (fill_included_packs_batch(r, m, include_pack, batch_size))
- goto cleanup;
- } else if (fill_included_packs_all(r, m, include_pack))
- goto cleanup;
-
- repo_config_get_bool(r, "repack.usedeltabaseoffset", &delta_base_offset);
- repo_config_get_bool(r, "repack.usedeltaislands", &use_delta_islands);
-
- strvec_push(&cmd.args, "pack-objects");
-
- strbuf_addstr(&base_name, object_dir);
- strbuf_addstr(&base_name, "/pack/pack");
- strvec_push(&cmd.args, base_name.buf);
-
- if (delta_base_offset)
- strvec_push(&cmd.args, "--delta-base-offset");
- if (use_delta_islands)
- strvec_push(&cmd.args, "--delta-islands");
-
- if (flags & MIDX_PROGRESS)
- strvec_push(&cmd.args, "--progress");
- else
- strvec_push(&cmd.args, "-q");
-
- strbuf_release(&base_name);
-
- cmd.git_cmd = 1;
- cmd.in = cmd.out = -1;
-
- if (start_command(&cmd)) {
- error(_("could not start pack-objects"));
- result = 1;
- goto cleanup;
- }
-
- cmd_in = xfdopen(cmd.in, "w");
-
- for (i = 0; i < m->num_objects; i++) {
- struct object_id oid;
- uint32_t pack_int_id = nth_midxed_pack_int_id(m, i);
-
- if (!include_pack[pack_int_id])
- continue;
-
- nth_midxed_object_oid(&oid, m, i);
- fprintf(cmd_in, "%s\n", oid_to_hex(&oid));
- }
- fclose(cmd_in);
-
- if (finish_command(&cmd)) {
- error(_("could not finish pack-objects"));
- result = 1;
- goto cleanup;
- }
-
- result = write_midx_internal(object_dir, NULL, NULL, NULL, NULL, flags);
-
-cleanup:
- free(include_pack);
- return result;
-}
diff --git a/midx.h b/midx.h
index 22e8e53..dc477df 100644
--- a/midx.h
+++ b/midx.h
@@ -1,12 +1,31 @@
#ifndef MIDX_H
#define MIDX_H
-#include "repository.h"
#include "string-list.h"
struct object_id;
struct pack_entry;
struct repository;
+struct bitmapped_pack;
+
+#define MIDX_SIGNATURE 0x4d494458 /* "MIDX" */
+#define MIDX_VERSION 1
+#define MIDX_BYTE_FILE_VERSION 4
+#define MIDX_BYTE_HASH_VERSION 5
+#define MIDX_BYTE_NUM_CHUNKS 6
+#define MIDX_BYTE_NUM_PACKS 8
+#define MIDX_HEADER_SIZE 12
+
+#define MIDX_CHUNK_ALIGNMENT 4
+#define MIDX_CHUNKID_PACKNAMES 0x504e414d /* "PNAM" */
+#define MIDX_CHUNKID_BITMAPPEDPACKS 0x42544d50 /* "BTMP" */
+#define MIDX_CHUNKID_OIDFANOUT 0x4f494446 /* "OIDF" */
+#define MIDX_CHUNKID_OIDLOOKUP 0x4f49444c /* "OIDL" */
+#define MIDX_CHUNKID_OBJECTOFFSETS 0x4f4f4646 /* "OOFF" */
+#define MIDX_CHUNKID_LARGEOFFSETS 0x4c4f4646 /* "LOFF" */
+#define MIDX_CHUNKID_REVINDEX 0x52494458 /* "RIDX" */
+#define MIDX_CHUNK_OFFSET_WIDTH (2 * sizeof(uint32_t))
+#define MIDX_LARGE_OFFSET_NEEDED 0x80000000
#define GIT_TEST_MULTI_PACK_INDEX "GIT_TEST_MULTI_PACK_INDEX"
#define GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP \
@@ -28,15 +47,21 @@ struct multi_pack_index {
unsigned char num_chunks;
uint32_t num_packs;
uint32_t num_objects;
+ int preferred_pack_idx;
int local;
const unsigned char *chunk_pack_names;
+ size_t chunk_pack_names_len;
+ const uint32_t *chunk_bitmapped_packs;
+ size_t chunk_bitmapped_packs_len;
const uint32_t *chunk_oid_fanout;
const unsigned char *chunk_oid_lookup;
const unsigned char *chunk_object_offsets;
const unsigned char *chunk_large_offsets;
+ size_t chunk_large_offsets_len;
const unsigned char *chunk_revindex;
+ size_t chunk_revindex_len;
const char **pack_names;
struct packed_git **packs;
@@ -47,6 +72,7 @@ struct multi_pack_index {
#define MIDX_WRITE_REV_INDEX (1 << 1)
#define MIDX_WRITE_BITMAP (1 << 2)
#define MIDX_WRITE_BITMAP_HASH_CACHE (1 << 3)
+#define MIDX_WRITE_BITMAP_LOOKUP_TABLE (1 << 4)
const unsigned char *get_midx_checksum(struct multi_pack_index *m);
void get_midx_filename(struct strbuf *out, const char *object_dir);
@@ -54,6 +80,8 @@ void get_midx_rev_filename(struct strbuf *out, struct multi_pack_index *m);
struct multi_pack_index *load_multi_pack_index(const char *object_dir, int local);
int prepare_midx_pack(struct repository *r, struct multi_pack_index *m, uint32_t pack_int_id);
+int nth_bitmapped_pack(struct repository *r, struct multi_pack_index *m,
+ struct bitmapped_pack *bp, uint32_t pack_int_id);
int bsearch_midx(const struct object_id *oid, struct multi_pack_index *m, uint32_t *result);
off_t nth_midxed_offset(struct multi_pack_index *m, uint32_t pos);
uint32_t nth_midxed_pack_int_id(struct multi_pack_index *m, uint32_t pos);
@@ -61,7 +89,11 @@ struct object_id *nth_midxed_object_oid(struct object_id *oid,
struct multi_pack_index *m,
uint32_t n);
int fill_midx_entry(struct repository *r, const struct object_id *oid, struct pack_entry *e, struct multi_pack_index *m);
-int midx_contains_pack(struct multi_pack_index *m, const char *idx_or_pack_name);
+int midx_contains_pack(struct multi_pack_index *m,
+ const char *idx_or_pack_name);
+int midx_locate_pack(struct multi_pack_index *m, const char *idx_or_pack_name,
+ uint32_t *pos);
+int midx_preferred_pack(struct multi_pack_index *m, uint32_t *pack_int_id);
int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, int local);
/*
diff --git a/name-hash.c b/name-hash.c
index 7487d33..3a58ce0 100644
--- a/name-hash.c
+++ b/name-hash.c
@@ -5,8 +5,14 @@
*
* Copyright (C) 2008 Linus Torvalds
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "environment.h"
+#include "gettext.h"
+#include "name-hash.h"
+#include "object.h"
+#include "read-cache-ll.h"
#include "thread-utils.h"
+#include "trace.h"
#include "trace2.h"
#include "sparse-index.h"
@@ -18,7 +24,7 @@ struct dir_entry {
char name[FLEX_ARRAY];
};
-static int dir_entry_cmp(const void *unused_cmp_data,
+static int dir_entry_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *keydata)
@@ -120,7 +126,7 @@ static void hash_index_entry(struct index_state *istate, struct cache_entry *ce)
add_dir_entry(istate, ce);
}
-static int cache_entry_cmp(const void *unused_cmp_data,
+static int cache_entry_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *remove)
@@ -679,13 +685,20 @@ static int same_name(const struct cache_entry *ce, const char *name, int namelen
return slow_same_name(name, namelen, ce->name, len);
}
-int index_dir_exists(struct index_state *istate, const char *name, int namelen)
+int index_dir_find(struct index_state *istate, const char *name, int namelen,
+ struct strbuf *canonical_path)
{
struct dir_entry *dir;
lazy_init_name_hash(istate);
expand_to_path(istate, name, namelen, 0);
dir = find_dir_entry(istate, name, namelen);
+
+ if (canonical_path && dir && dir->nr) {
+ strbuf_reset(canonical_path);
+ strbuf_add(canonical_path, dir->name, dir->namelen);
+ }
+
return dir && dir->nr;
}
diff --git a/name-hash.h b/name-hash.h
new file mode 100644
index 0000000..0cbfc42
--- /dev/null
+++ b/name-hash.h
@@ -0,0 +1,21 @@
+#ifndef NAME_HASH_H
+#define NAME_HASH_H
+
+struct cache_entry;
+struct index_state;
+
+
+int index_dir_find(struct index_state *istate, const char *name, int namelen,
+ struct strbuf *canonical_path);
+
+#define index_dir_exists(i, n, l) index_dir_find((i), (n), (l), NULL)
+
+void adjust_dirname_case(struct index_state *istate, char *name);
+struct cache_entry *index_file_exists(struct index_state *istate, const char *name, int namelen, int igncase);
+
+int test_lazy_init_name_hash(struct index_state *istate, int try_threaded);
+void add_name_hash(struct index_state *istate, struct cache_entry *ce);
+void remove_name_hash(struct index_state *istate, struct cache_entry *ce);
+void free_name_hash(struct index_state *istate);
+
+#endif /* NAME_HASH_H */
diff --git a/negotiator/default.c b/negotiator/default.c
index 434189a..9a5b696 100644
--- a/negotiator/default.c
+++ b/negotiator/default.c
@@ -1,9 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "default.h"
#include "../commit.h"
#include "../fetch-negotiator.h"
#include "../prio-queue.h"
#include "../refs.h"
+#include "../repository.h"
#include "../tag.h"
/* Remember to update object flag allocation in object.h */
@@ -25,7 +26,7 @@ static void rev_list_push(struct negotiation_state *ns,
if (!(commit->object.flags & mark)) {
commit->object.flags |= mark;
- if (parse_commit(commit))
+ if (repo_parse_commit(the_repository, commit))
return;
prio_queue_put(&ns->rev_list, commit);
@@ -36,7 +37,8 @@ static void rev_list_push(struct negotiation_state *ns,
}
static int clear_marks(const char *refname, const struct object_id *oid,
- int flag, void *cb_data)
+ int flag UNUSED,
+ void *cb_data UNUSED)
{
struct object *o = deref_tag(the_repository, parse_object(the_repository, oid), refname, 0);
@@ -54,30 +56,49 @@ static int clear_marks(const char *refname, const struct object_id *oid,
static void mark_common(struct negotiation_state *ns, struct commit *commit,
int ancestors_only, int dont_parse)
{
- if (commit != NULL && !(commit->object.flags & COMMON)) {
- struct object *o = (struct object *)commit;
+ struct prio_queue queue = { NULL };
+
+ if (!commit || (commit->object.flags & COMMON))
+ return;
+
+ prio_queue_put(&queue, commit);
+ if (!ancestors_only) {
+ commit->object.flags |= COMMON;
- if (!ancestors_only)
- o->flags |= COMMON;
+ if ((commit->object.flags & SEEN) && !(commit->object.flags & POPPED))
+ ns->non_common_revs--;
+ }
+ while ((commit = prio_queue_get(&queue))) {
+ struct object *o = (struct object *)commit;
if (!(o->flags & SEEN))
rev_list_push(ns, commit, SEEN);
else {
struct commit_list *parents;
- if (!ancestors_only && !(o->flags & POPPED))
- ns->non_common_revs--;
if (!o->parsed && !dont_parse)
- if (parse_commit(commit))
- return;
+ if (repo_parse_commit(the_repository, commit))
+ continue;
for (parents = commit->parents;
parents;
- parents = parents->next)
- mark_common(ns, parents->item, 0,
- dont_parse);
+ parents = parents->next) {
+ struct commit *p = parents->item;
+
+ if (p->object.flags & COMMON)
+ continue;
+
+ p->object.flags |= COMMON;
+
+ if ((p->object.flags & SEEN) && !(p->object.flags & POPPED))
+ ns->non_common_revs--;
+
+ prio_queue_put(&queue, parents->item);
+ }
}
}
+
+ clear_prio_queue(&queue);
}
/*
@@ -95,7 +116,7 @@ static const struct object_id *get_rev(struct negotiation_state *ns)
return NULL;
commit = prio_queue_get(&ns->rev_list);
- parse_commit(commit);
+ repo_parse_commit(the_repository, commit);
parents = commit->parents;
commit->object.flags |= POPPED;
diff --git a/negotiator/noop.c b/negotiator/noop.c
index 60569b8..65e3c20 100644
--- a/negotiator/noop.c
+++ b/negotiator/noop.c
@@ -1,24 +1,25 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "noop.h"
-#include "../commit.h"
#include "../fetch-negotiator.h"
-static void known_common(struct fetch_negotiator *n, struct commit *c)
+static void known_common(struct fetch_negotiator *n UNUSED,
+ struct commit *c UNUSED)
{
/* do nothing */
}
-static void add_tip(struct fetch_negotiator *n, struct commit *c)
+static void add_tip(struct fetch_negotiator *n UNUSED,
+ struct commit *c UNUSED)
{
/* do nothing */
}
-static const struct object_id *next(struct fetch_negotiator *n)
+static const struct object_id *next(struct fetch_negotiator *n UNUSED)
{
return NULL;
}
-static int ack(struct fetch_negotiator *n, struct commit *c)
+static int ack(struct fetch_negotiator *n UNUSED, struct commit *c UNUSED)
{
/*
* This negotiator does not emit any commits, so there is no commit to
@@ -28,7 +29,7 @@ static int ack(struct fetch_negotiator *n, struct commit *c)
return 0;
}
-static void release(struct fetch_negotiator *n)
+static void release(struct fetch_negotiator *n UNUSED)
{
/* nothing to release */
}
diff --git a/negotiator/skipping.c b/negotiator/skipping.c
index 1236e79..5b91520 100644
--- a/negotiator/skipping.c
+++ b/negotiator/skipping.c
@@ -1,9 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "skipping.h"
#include "../commit.h"
#include "../fetch-negotiator.h"
+#include "../hex.h"
#include "../prio-queue.h"
#include "../refs.h"
+#include "../repository.h"
#include "../tag.h"
/* Remember to update object flag allocation in object.h */
@@ -50,7 +52,7 @@ struct data {
int non_common_revs;
};
-static int compare(const void *a_, const void *b_, void *unused)
+static int compare(const void *a_, const void *b_, void *data UNUSED)
{
const struct entry *a = a_;
const struct entry *b = b_;
@@ -72,7 +74,8 @@ static struct entry *rev_list_push(struct data *data, struct commit *commit, int
}
static int clear_marks(const char *refname, const struct object_id *oid,
- int flag, void *cb_data)
+ int flag UNUSED,
+ void *cb_data UNUSED)
{
struct object *o = deref_tag(the_repository, parse_object(the_repository, oid), refname, 0);
@@ -83,24 +86,37 @@ static int clear_marks(const char *refname, const struct object_id *oid,
}
/*
- * Mark this SEEN commit and all its SEEN ancestors as COMMON.
+ * Mark this SEEN commit and all its parsed SEEN ancestors as COMMON.
*/
-static void mark_common(struct data *data, struct commit *c)
+static void mark_common(struct data *data, struct commit *seen_commit)
{
- struct commit_list *p;
+ struct prio_queue queue = { NULL };
+ struct commit *c;
- if (c->object.flags & COMMON)
+ if (seen_commit->object.flags & COMMON)
return;
- c->object.flags |= COMMON;
- if (!(c->object.flags & POPPED))
- data->non_common_revs--;
- if (!c->object.parsed)
- return;
- for (p = c->parents; p; p = p->next) {
- if (p->item->object.flags & SEEN)
- mark_common(data, p->item);
+ prio_queue_put(&queue, seen_commit);
+ seen_commit->object.flags |= COMMON;
+ while ((c = prio_queue_get(&queue))) {
+ struct commit_list *p;
+
+ if (!(c->object.flags & POPPED))
+ data->non_common_revs--;
+
+ if (!c->object.parsed)
+ continue;
+ for (p = c->parents; p; p = p->next) {
+ if (!(p->item->object.flags & SEEN) ||
+ (p->item->object.flags & COMMON))
+ continue;
+
+ p->item->object.flags |= COMMON;
+ prio_queue_put(&queue, p->item);
+ }
}
+
+ clear_prio_queue(&queue);
}
/*
@@ -177,7 +193,7 @@ static const struct object_id *get_rev(struct data *data)
if (!(commit->object.flags & COMMON) && !entry->ttl)
to_send = commit;
- parse_commit(commit);
+ repo_parse_commit(the_repository, commit);
for (p = commit->parents; p; p = p->next)
parent_pushed |= push_parent(data, entry, p->item);
diff --git a/notes-cache.c b/notes-cache.c
index 9dfd251..0e1d5b1 100644
--- a/notes-cache.c
+++ b/notes-cache.c
@@ -1,9 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "notes-cache.h"
-#include "object-store.h"
+#include "object-store-ll.h"
+#include "pretty.h"
#include "repository.h"
#include "commit.h"
#include "refs.h"
+#include "strbuf.h"
static int notes_cache_match_validity(struct repository *r,
const char *ref,
@@ -23,7 +25,8 @@ static int notes_cache_match_validity(struct repository *r,
return 0;
memset(&pretty_ctx, 0, sizeof(pretty_ctx));
- format_commit_message(commit, "%s", &msg, &pretty_ctx);
+ repo_format_commit_message(r, commit, "%s", &msg,
+ &pretty_ctx);
strbuf_trim(&msg);
ret = !strcmp(msg.buf, validity);
@@ -81,7 +84,7 @@ char *notes_cache_get(struct notes_cache *c, struct object_id *key_oid,
value_oid = get_note(&c->tree, key_oid);
if (!value_oid)
return NULL;
- value = read_object_file(value_oid, &type, &size);
+ value = repo_read_object_file(the_repository, value_oid, &type, &size);
*outsize = size;
return value;
diff --git a/notes-merge.c b/notes-merge.c
index b4cc594..5128293 100644
--- a/notes-merge.c
+++ b/notes-merge.c
@@ -1,16 +1,23 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "advice.h"
#include "commit.h"
+#include "gettext.h"
#include "refs.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "path.h"
#include "repository.h"
#include "diff.h"
#include "diffcore.h"
+#include "hex.h"
#include "xdiff-interface.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
#include "dir.h"
#include "notes.h"
#include "notes-merge.h"
#include "strbuf.h"
+#include "trace.h"
#include "notes-utils.h"
#include "commit-reach.h"
@@ -326,7 +333,7 @@ static void write_note_to_worktree(const struct object_id *obj,
{
enum object_type type;
unsigned long size;
- void *buf = read_object_file(note, &type, &size);
+ void *buf = repo_read_object_file(the_repository, note, &type, &size);
if (!buf)
die("cannot read note %s for object %s",
@@ -566,7 +573,7 @@ int notes_merge(struct notes_merge_options *o,
trace_printf("\tlocal commit: %.7s\n", oid_to_hex(&local_oid));
/* Dereference o->remote_ref into remote_oid */
- if (get_oid(o->remote_ref, &remote_oid)) {
+ if (repo_get_oid(the_repository, o->remote_ref, &remote_oid)) {
/*
* Failed to get remote_oid. If o->remote_ref looks like an
* unborn ref, perform the merge using an empty notes tree.
@@ -600,7 +607,8 @@ int notes_merge(struct notes_merge_options *o,
assert(local && remote);
/* Find merge bases */
- bases = get_merge_bases(local, remote);
+ if (repo_get_merge_bases(the_repository, local, remote, &bases) < 0)
+ exit(128);
if (!bases) {
base_oid = null_oid();
base_tree_oid = the_hash_algo->empty_tree;
@@ -678,7 +686,8 @@ int notes_merge_commit(struct notes_merge_options *o,
DIR *dir;
struct dirent *e;
struct strbuf path = STRBUF_INIT;
- const char *buffer = get_commit_buffer(partial_commit, NULL);
+ const char *buffer = repo_get_commit_buffer(the_repository,
+ partial_commit, NULL);
const char *msg = strstr(buffer, "\n\n");
int baselen;
@@ -725,7 +734,7 @@ int notes_merge_commit(struct notes_merge_options *o,
create_notes_commit(o->repo, partial_tree, partial_commit->parents, msg,
strlen(msg), result_oid);
- unuse_commit_buffer(partial_commit, buffer);
+ repo_unuse_commit_buffer(the_repository, partial_commit, buffer);
if (o->verbosity >= 4)
printf("Finalized notes merge commit: %s\n",
oid_to_hex(result_oid));
diff --git a/notes-utils.c b/notes-utils.c
index d7d18e3..6197a5a 100644
--- a/notes-utils.c
+++ b/notes-utils.c
@@ -1,9 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "commit.h"
+#include "environment.h"
+#include "gettext.h"
#include "refs.h"
#include "notes-utils.h"
-#include "repository.h"
+#include "strbuf.h"
void create_notes_commit(struct repository *r,
struct notes_tree *t,
@@ -23,7 +25,7 @@ void create_notes_commit(struct repository *r,
struct object_id parent_oid;
if (!read_ref(t->ref, &parent_oid)) {
struct commit *parent = lookup_commit(r, &parent_oid);
- if (parse_commit(parent))
+ if (repo_parse_commit(r, parent))
die("Failed to find/parse commit %s", t->ref);
commit_list_insert(parent, &parents);
}
@@ -91,7 +93,9 @@ static combine_notes_fn parse_combine_notes_fn(const char *v)
return NULL;
}
-static int notes_rewrite_config(const char *k, const char *v, void *cb)
+static int notes_rewrite_config(const char *k, const char *v,
+ const struct config_context *ctx UNUSED,
+ void *cb)
{
struct notes_rewrite_cfg *c = cb;
if (starts_with(k, "notes.rewrite.") && !strcmp(k+14, c->cmd)) {
@@ -107,6 +111,8 @@ static int notes_rewrite_config(const char *k, const char *v, void *cb)
}
return 0;
} else if (!c->refs_from_env && !strcmp(k, "notes.rewriteref")) {
+ if (!v)
+ return config_error_nonbool(k);
/* note that a refs/ prefix is implied in the
* underlying for_each_glob_ref */
if (starts_with(v, "refs/notes/"))
diff --git a/notes.c b/notes.c
index 7452e71..fed1eda 100644
--- a/notes.c
+++ b/notes.c
@@ -1,9 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "environment.h"
+#include "hex.h"
#include "notes.h"
-#include "object-store.h"
-#include "blob.h"
-#include "tree.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "utf8.h"
#include "strbuf.h"
#include "tree-walk.h"
@@ -752,7 +753,7 @@ static int write_each_non_note_until(const char *note_path,
return 0;
}
-static int write_each_note(const struct object_id *object_oid,
+static int write_each_note(const struct object_id *object_oid UNUSED,
const struct object_id *note_oid, char *note_path,
void *cb_data)
{
@@ -780,13 +781,14 @@ struct note_delete_list {
};
static int prune_notes_helper(const struct object_id *object_oid,
- const struct object_id *note_oid, char *note_path,
- void *cb_data)
+ const struct object_id *note_oid UNUSED,
+ char *note_path UNUSED,
+ void *cb_data)
{
struct note_delete_list **l = (struct note_delete_list **) cb_data;
struct note_delete_list *n;
- if (has_object_file(object_oid))
+ if (repo_has_object_file(the_repository, object_oid))
return 0; /* nothing to do for this note */
/* failed to find object => prune this note */
@@ -807,13 +809,15 @@ int combine_notes_concatenate(struct object_id *cur_oid,
/* read in both note blob objects */
if (!is_null_oid(new_oid))
- new_msg = read_object_file(new_oid, &new_type, &new_len);
+ new_msg = repo_read_object_file(the_repository, new_oid,
+ &new_type, &new_len);
if (!new_msg || !new_len || new_type != OBJ_BLOB) {
free(new_msg);
return 0;
}
if (!is_null_oid(cur_oid))
- cur_msg = read_object_file(cur_oid, &cur_type, &cur_len);
+ cur_msg = repo_read_object_file(the_repository, cur_oid,
+ &cur_type, &cur_len);
if (!cur_msg || !cur_len || cur_type != OBJ_BLOB) {
free(cur_msg);
free(new_msg);
@@ -848,8 +852,8 @@ int combine_notes_overwrite(struct object_id *cur_oid,
return 0;
}
-int combine_notes_ignore(struct object_id *cur_oid,
- const struct object_id *new_oid)
+int combine_notes_ignore(struct object_id *cur_oid UNUSED,
+ const struct object_id *new_oid UNUSED)
{
return 0;
}
@@ -869,7 +873,7 @@ static int string_list_add_note_lines(struct string_list *list,
return 0;
/* read_sha1_file NUL-terminates */
- data = read_object_file(oid, &t, &len);
+ data = repo_read_object_file(the_repository, oid, &t, &len);
if (t != OBJ_BLOB || !data || !len) {
free(data);
return t != OBJ_BLOB || !data;
@@ -924,8 +928,9 @@ out:
return ret;
}
-static int string_list_add_one_ref(const char *refname, const struct object_id *oid,
- int flag, void *cb)
+static int string_list_add_one_ref(const char *refname,
+ const struct object_id *oid UNUSED,
+ int flag UNUSED, void *cb)
{
struct string_list *refs = cb;
if (!unsorted_string_list_has_string(refs, refname))
@@ -943,7 +948,7 @@ void string_list_add_refs_by_glob(struct string_list *list, const char *glob)
for_each_glob_ref(string_list_add_one_ref, glob, list);
} else {
struct object_id oid;
- if (get_oid(glob, &oid))
+ if (repo_get_oid(the_repository, glob, &oid))
warning("notes ref %s is invalid", glob);
if (!unsorted_string_list_has_string(list, glob))
string_list_append(list, glob);
@@ -957,7 +962,7 @@ void string_list_add_refs_from_colon_sep(struct string_list *list,
char *globs_copy = xstrdup(globs);
int i;
- string_list_split_in_place(&split, globs_copy, ':', -1);
+ string_list_split_in_place(&split, globs_copy, ":", -1);
string_list_remove_empty_items(&split, 0);
for (i = 0; i < split.nr; i++)
@@ -967,7 +972,9 @@ void string_list_add_refs_from_colon_sep(struct string_list *list,
free(globs_copy);
}
-static int notes_display_config(const char *k, const char *v, void *cb)
+static int notes_display_config(const char *k, const char *v,
+ const struct config_context *ctx UNUSED,
+ void *cb)
{
int *load_refs = cb;
@@ -1005,6 +1012,7 @@ void init_notes(struct notes_tree *t, const char *notes_ref,
if (!notes_ref)
notes_ref = default_notes_ref();
+ update_ref_namespace(NAMESPACE_NOTES, xstrdup(notes_ref));
if (!combine_notes)
combine_notes = combine_notes_concatenate;
@@ -1012,14 +1020,14 @@ void init_notes(struct notes_tree *t, const char *notes_ref,
t->root = (struct int_node *) xcalloc(1, sizeof(struct int_node));
t->first_non_note = NULL;
t->prev_non_note = NULL;
- t->ref = xstrdup_or_null(notes_ref);
+ t->ref = xstrdup(notes_ref);
t->update_ref = (flags & NOTES_INIT_WRITABLE) ? t->ref : NULL;
t->combine_notes = combine_notes;
t->initialized = 1;
t->dirty = 0;
- if (flags & NOTES_INIT_EMPTY || !notes_ref ||
- get_oid_treeish(notes_ref, &object_oid))
+ if (flags & NOTES_INIT_EMPTY ||
+ repo_get_oid_treeish(the_repository, notes_ref, &object_oid))
return;
if (flags & NOTES_INIT_WRITABLE && read_ref(notes_ref, &object_oid))
die("Cannot use notes ref %s", notes_ref);
@@ -1262,7 +1270,7 @@ static void format_note(struct notes_tree *t, const struct object_id *object_oid
if (!oid)
return;
- if (!(msg = read_object_file(oid, &type, &msglen)) || type != OBJ_BLOB) {
+ if (!(msg = repo_read_object_file(the_repository, oid, &type, &msglen)) || type != OBJ_BLOB) {
free(msg);
return;
}
@@ -1346,7 +1354,7 @@ void expand_loose_notes_ref(struct strbuf *sb)
{
struct object_id object;
- if (get_oid(sb->buf, &object)) {
+ if (repo_get_oid(the_repository, sb->buf, &object)) {
/* fallback to expand_notes_ref */
expand_notes_ref(sb);
}
diff --git a/notes.h b/notes.h
index c1682c3..064fd71 100644
--- a/notes.h
+++ b/notes.h
@@ -256,7 +256,17 @@ void free_notes(struct notes_tree *t);
struct string_list;
struct display_notes_opt {
+ /*
+ * Less than `0` is "unset", which means that the default notes
+ * are shown iff no other notes are given. Otherwise,
+ * treat it like a boolean.
+ */
int use_default_notes;
+
+ /*
+ * A list of globs (in the same style as notes.displayRef) where
+ * notes should be loaded from.
+ */
struct string_list extra_notes_refs;
};
@@ -283,14 +293,7 @@ void disable_display_notes(struct display_notes_opt *opt, int *show_notes);
/*
* Load the notes machinery for displaying several notes trees.
*
- * If 'opt' is not NULL, then it specifies additional settings for the
- * displaying:
- *
- * - suppress_default_notes indicates that the notes from
- * core.notesRef and notes.displayRef should not be loaded.
- *
- * - extra_notes_refs may contain a list of globs (in the same style
- * as notes.displayRef) where notes should be loaded from.
+ * 'opt' may be NULL.
*/
void load_display_notes(struct display_notes_opt *opt);
diff --git a/object-file-convert.c b/object-file-convert.c
new file mode 100644
index 0000000..4f61890
--- /dev/null
+++ b/object-file-convert.c
@@ -0,0 +1,277 @@
+#include "git-compat-util.h"
+#include "gettext.h"
+#include "strbuf.h"
+#include "hex.h"
+#include "repository.h"
+#include "hash-ll.h"
+#include "hash.h"
+#include "object.h"
+#include "loose.h"
+#include "commit.h"
+#include "gpg-interface.h"
+#include "object-file-convert.h"
+
+int repo_oid_to_algop(struct repository *repo, const struct object_id *src,
+ const struct git_hash_algo *to, struct object_id *dest)
+{
+ /*
+ * If the source algorithm is not set, then we're using the
+ * default hash algorithm for that object.
+ */
+ const struct git_hash_algo *from =
+ src->algo ? &hash_algos[src->algo] : repo->hash_algo;
+
+ if (from == to) {
+ if (src != dest)
+ oidcpy(dest, src);
+ return 0;
+ }
+ if (repo_loose_object_map_oid(repo, src, to, dest)) {
+ /*
+ * We may have loaded the object map at repo initialization but
+ * another process (perhaps upstream of a pipe from us) may have
+ * written a new object into the map. If the object is missing,
+ * let's reload the map to see if the object has appeared.
+ */
+ repo_read_loose_object_map(repo);
+ if (repo_loose_object_map_oid(repo, src, to, dest))
+ return -1;
+ }
+ return 0;
+}
+
+static int decode_tree_entry_raw(struct object_id *oid, const char **path,
+ size_t *len, const struct git_hash_algo *algo,
+ const char *buf, unsigned long size)
+{
+ uint16_t mode;
+ const unsigned hashsz = algo->rawsz;
+
+ if (size < hashsz + 3 || buf[size - (hashsz + 1)]) {
+ return -1;
+ }
+
+ *path = parse_mode(buf, &mode);
+ if (!*path || !**path)
+ return -1;
+ *len = strlen(*path) + 1;
+
+ oidread_algop(oid, (const unsigned char *)*path + *len, algo);
+ return 0;
+}
+
+static int convert_tree_object(struct strbuf *out,
+ const struct git_hash_algo *from,
+ const struct git_hash_algo *to,
+ const char *buffer, size_t size)
+{
+ const char *p = buffer, *end = buffer + size;
+
+ while (p < end) {
+ struct object_id entry_oid, mapped_oid;
+ const char *path = NULL;
+ size_t pathlen;
+
+ if (decode_tree_entry_raw(&entry_oid, &path, &pathlen, from, p,
+ end - p))
+ return error(_("failed to decode tree entry"));
+ if (repo_oid_to_algop(the_repository, &entry_oid, to, &mapped_oid))
+ return error(_("failed to map tree entry for %s"), oid_to_hex(&entry_oid));
+ strbuf_add(out, p, path - p);
+ strbuf_add(out, path, pathlen);
+ strbuf_add(out, mapped_oid.hash, to->rawsz);
+ p = path + pathlen + from->rawsz;
+ }
+ return 0;
+}
+
+static int convert_tag_object(struct strbuf *out,
+ const struct git_hash_algo *from,
+ const struct git_hash_algo *to,
+ const char *buffer, size_t size)
+{
+ struct strbuf payload = STRBUF_INIT, oursig = STRBUF_INIT, othersig = STRBUF_INIT;
+ const int entry_len = from->hexsz + 7;
+ size_t payload_size;
+ struct object_id oid, mapped_oid;
+ const char *p;
+
+ /* Consume the object line */
+ if ((entry_len >= size) ||
+ memcmp(buffer, "object ", 7) || buffer[entry_len] != '\n')
+ return error("bogus tag object");
+ if (parse_oid_hex_algop(buffer + 7, &oid, &p, from) < 0)
+ return error("bad tag object ID");
+ if (repo_oid_to_algop(the_repository, &oid, to, &mapped_oid))
+ return error("unable to map tree %s in tag object",
+ oid_to_hex(&oid));
+ size -= ((p + 1) - buffer);
+ buffer = p + 1;
+
+ /* Is there a signature for our algorithm? */
+ payload_size = parse_signed_buffer(buffer, size);
+ if (payload_size != size) {
+ /* Yes, there is. */
+ strbuf_add(&oursig, buffer + payload_size, size - payload_size);
+ }
+
+ /* Now, is there a signature for the other algorithm? */
+ parse_buffer_signed_by_header(buffer, payload_size, &payload, &othersig, to);
+ /*
+ * Our payload is now in payload and we may have up to two signatrures
+ * in oursig and othersig.
+ */
+
+ /* Add some slop for longer signature header in the new algorithm. */
+ strbuf_grow(out, (7 + to->hexsz + 1) + size + 7);
+ strbuf_addf(out, "object %s\n", oid_to_hex(&mapped_oid));
+ strbuf_addbuf(out, &payload);
+ if (oursig.len)
+ add_header_signature(out, &oursig, from);
+ strbuf_addbuf(out, &othersig);
+
+ strbuf_release(&payload);
+ strbuf_release(&othersig);
+ strbuf_release(&oursig);
+ return 0;
+}
+
+static int convert_commit_object(struct strbuf *out,
+ const struct git_hash_algo *from,
+ const struct git_hash_algo *to,
+ const char *buffer, size_t size)
+{
+ const char *tail = buffer;
+ const char *bufptr = buffer;
+ const int tree_entry_len = from->hexsz + 5;
+ const int parent_entry_len = from->hexsz + 7;
+ struct object_id oid, mapped_oid;
+ const char *p, *eol;
+
+ tail += size;
+
+ while ((bufptr < tail) && (*bufptr != '\n')) {
+ eol = memchr(bufptr, '\n', tail - bufptr);
+ if (!eol)
+ return error(_("bad %s in commit"), "line");
+
+ if (((bufptr + 5) < eol) && !memcmp(bufptr, "tree ", 5))
+ {
+ if (((bufptr + tree_entry_len) != eol) ||
+ parse_oid_hex_algop(bufptr + 5, &oid, &p, from) ||
+ (p != eol))
+ return error(_("bad %s in commit"), "tree");
+
+ if (repo_oid_to_algop(the_repository, &oid, to, &mapped_oid))
+ return error(_("unable to map %s %s in commit object"),
+ "tree", oid_to_hex(&oid));
+ strbuf_addf(out, "tree %s\n", oid_to_hex(&mapped_oid));
+ }
+ else if (((bufptr + 7) < eol) && !memcmp(bufptr, "parent ", 7))
+ {
+ if (((bufptr + parent_entry_len) != eol) ||
+ parse_oid_hex_algop(bufptr + 7, &oid, &p, from) ||
+ (p != eol))
+ return error(_("bad %s in commit"), "parent");
+
+ if (repo_oid_to_algop(the_repository, &oid, to, &mapped_oid))
+ return error(_("unable to map %s %s in commit object"),
+ "parent", oid_to_hex(&oid));
+
+ strbuf_addf(out, "parent %s\n", oid_to_hex(&mapped_oid));
+ }
+ else if (((bufptr + 9) < eol) && !memcmp(bufptr, "mergetag ", 9))
+ {
+ struct strbuf tag = STRBUF_INIT, new_tag = STRBUF_INIT;
+
+ /* Recover the tag object from the mergetag */
+ strbuf_add(&tag, bufptr + 9, (eol - (bufptr + 9)) + 1);
+
+ bufptr = eol + 1;
+ while ((bufptr < tail) && (*bufptr == ' ')) {
+ eol = memchr(bufptr, '\n', tail - bufptr);
+ if (!eol) {
+ strbuf_release(&tag);
+ return error(_("bad %s in commit"), "mergetag continuation");
+ }
+ strbuf_add(&tag, bufptr + 1, (eol - (bufptr + 1)) + 1);
+ bufptr = eol + 1;
+ }
+
+ /* Compute the new tag object */
+ if (convert_tag_object(&new_tag, from, to, tag.buf, tag.len)) {
+ strbuf_release(&tag);
+ strbuf_release(&new_tag);
+ return -1;
+ }
+
+ /* Write the new mergetag */
+ strbuf_addstr(out, "mergetag");
+ strbuf_add_lines(out, " ", new_tag.buf, new_tag.len);
+ strbuf_release(&tag);
+ strbuf_release(&new_tag);
+ }
+ else if (((bufptr + 7) < tail) && !memcmp(bufptr, "author ", 7))
+ strbuf_add(out, bufptr, (eol - bufptr) + 1);
+ else if (((bufptr + 10) < tail) && !memcmp(bufptr, "committer ", 10))
+ strbuf_add(out, bufptr, (eol - bufptr) + 1);
+ else if (((bufptr + 9) < tail) && !memcmp(bufptr, "encoding ", 9))
+ strbuf_add(out, bufptr, (eol - bufptr) + 1);
+ else if (((bufptr + 6) < tail) && !memcmp(bufptr, "gpgsig", 6))
+ strbuf_add(out, bufptr, (eol - bufptr) + 1);
+ else {
+ /* Unknown line fail it might embed an oid */
+ return -1;
+ }
+ /* Consume any trailing continuation lines */
+ bufptr = eol + 1;
+ while ((bufptr < tail) && (*bufptr == ' ')) {
+ eol = memchr(bufptr, '\n', tail - bufptr);
+ if (!eol)
+ return error(_("bad %s in commit"), "continuation");
+ strbuf_add(out, bufptr, (eol - bufptr) + 1);
+ bufptr = eol + 1;
+ }
+ }
+ if (bufptr < tail)
+ strbuf_add(out, bufptr, tail - bufptr);
+ return 0;
+}
+
+int convert_object_file(struct strbuf *outbuf,
+ const struct git_hash_algo *from,
+ const struct git_hash_algo *to,
+ const void *buf, size_t len,
+ enum object_type type,
+ int gentle)
+{
+ int ret;
+
+ /* Don't call this function when no conversion is necessary */
+ if ((from == to) || (type == OBJ_BLOB))
+ BUG("Refusing noop object file conversion");
+
+ switch (type) {
+ case OBJ_COMMIT:
+ ret = convert_commit_object(outbuf, from, to, buf, len);
+ break;
+ case OBJ_TREE:
+ ret = convert_tree_object(outbuf, from, to, buf, len);
+ break;
+ case OBJ_TAG:
+ ret = convert_tag_object(outbuf, from, to, buf, len);
+ break;
+ default:
+ /* Not implemented yet, so fail. */
+ ret = -1;
+ break;
+ }
+ if (!ret)
+ return 0;
+ if (gentle) {
+ strbuf_release(outbuf);
+ return ret;
+ }
+ die(_("Failed to convert object from %s to %s"),
+ from->name, to->name);
+}
diff --git a/object-file-convert.h b/object-file-convert.h
new file mode 100644
index 0000000..a4f802a
--- /dev/null
+++ b/object-file-convert.h
@@ -0,0 +1,24 @@
+#ifndef OBJECT_CONVERT_H
+#define OBJECT_CONVERT_H
+
+struct repository;
+struct object_id;
+struct git_hash_algo;
+struct strbuf;
+#include "object.h"
+
+int repo_oid_to_algop(struct repository *repo, const struct object_id *src,
+ const struct git_hash_algo *to, struct object_id *dest);
+
+/*
+ * Convert an object file from one hash algorithm to another algorithm.
+ * Return -1 on failure, 0 on success.
+ */
+int convert_object_file(struct strbuf *outbuf,
+ const struct git_hash_algo *from,
+ const struct git_hash_algo *to,
+ const void *buf, size_t len,
+ enum object_type type,
+ int gentle);
+
+#endif /* OBJECT_CONVERT_H */
diff --git a/object-file.c b/object-file.c
index 6c8e3b1..610b1f4 100644
--- a/object-file.c
+++ b/object-file.c
@@ -6,33 +6,37 @@
* This handles basic git object files - packing, unpacking,
* creation etc.
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
#include "config.h"
+#include "convert.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "string-list.h"
#include "lockfile.h"
-#include "delta.h"
#include "pack.h"
-#include "blob.h"
#include "commit.h"
#include "run-command.h"
-#include "tag.h"
-#include "tree.h"
-#include "tree-walk.h"
#include "refs.h"
-#include "pack-revindex.h"
-#include "hash-lookup.h"
#include "bulk-checkin.h"
#include "repository.h"
#include "replace-object.h"
#include "streaming.h"
#include "dir.h"
#include "list.h"
-#include "mergesort.h"
#include "quote.h"
#include "packfile.h"
+#include "object-file.h"
#include "object-store.h"
+#include "oidtree.h"
+#include "path.h"
#include "promisor-remote.h"
+#include "setup.h"
#include "submodule.h"
+#include "fsck.h"
+#include "loose.h"
+#include "object-file-convert.h"
/* The maximum size for an object header. */
#define MAX_HEADER_LEN 32
@@ -140,27 +144,32 @@ static void git_hash_sha256_final_oid(struct object_id *oid, git_hash_ctx *ctx)
oid->algo = GIT_HASH_SHA256;
}
-static void git_hash_unknown_init(git_hash_ctx *ctx)
+static void git_hash_unknown_init(git_hash_ctx *ctx UNUSED)
{
BUG("trying to init unknown hash");
}
-static void git_hash_unknown_clone(git_hash_ctx *dst, const git_hash_ctx *src)
+static void git_hash_unknown_clone(git_hash_ctx *dst UNUSED,
+ const git_hash_ctx *src UNUSED)
{
BUG("trying to clone unknown hash");
}
-static void git_hash_unknown_update(git_hash_ctx *ctx, const void *data, size_t len)
+static void git_hash_unknown_update(git_hash_ctx *ctx UNUSED,
+ const void *data UNUSED,
+ size_t len UNUSED)
{
BUG("trying to update unknown hash");
}
-static void git_hash_unknown_final(unsigned char *hash, git_hash_ctx *ctx)
+static void git_hash_unknown_final(unsigned char *hash UNUSED,
+ git_hash_ctx *ctx UNUSED)
{
BUG("trying to finalize unknown hash");
}
-static void git_hash_unknown_final_oid(struct object_id *oid, git_hash_ctx *ctx)
+static void git_hash_unknown_final_oid(struct object_id *oid UNUSED,
+ git_hash_ctx *ctx UNUSED)
{
BUG("trying to finalize unknown hash");
}
@@ -261,7 +270,7 @@ int hash_algo_by_length(int len)
/*
* This is meant to hold a *small* number of objects that you would
- * want read_object_file() to be able to return, but yet you do not want
+ * want repo_read_object_file() to be able to return, but yet you do not want
* to write them into the object store (e.g. a browse-only
* application).
*/
@@ -503,7 +512,9 @@ static int link_alt_odb_entry(struct repository *r, const struct strbuf *entry,
{
struct object_directory *ent;
struct strbuf pathbuf = STRBUF_INIT;
+ struct strbuf tmp = STRBUF_INIT;
khiter_t pos;
+ int ret = -1;
if (!is_absolute_path(entry->buf) && relative_base) {
strbuf_realpath(&pathbuf, relative_base, 1);
@@ -511,12 +522,12 @@ static int link_alt_odb_entry(struct repository *r, const struct strbuf *entry,
}
strbuf_addbuf(&pathbuf, entry);
- if (strbuf_normalize_path(&pathbuf) < 0 && relative_base) {
+ if (!strbuf_realpath(&tmp, pathbuf.buf, 0)) {
error(_("unable to normalize alternate object path: %s"),
pathbuf.buf);
- strbuf_release(&pathbuf);
- return -1;
+ goto error;
}
+ strbuf_swap(&pathbuf, &tmp);
/*
* The trailing slash after the directory name is given by
@@ -525,10 +536,8 @@ static int link_alt_odb_entry(struct repository *r, const struct strbuf *entry,
while (pathbuf.len && pathbuf.buf[pathbuf.len - 1] == '/')
strbuf_setlen(&pathbuf, pathbuf.len - 1);
- if (!alt_odb_usable(r->objects, &pathbuf, normalized_objdir, &pos)) {
- strbuf_release(&pathbuf);
- return -1;
- }
+ if (!alt_odb_usable(r->objects, &pathbuf, normalized_objdir, &pos))
+ goto error;
CALLOC_ARRAY(ent, 1);
/* pathbuf.buf is already in r->objects->odb_by_path */
@@ -543,8 +552,11 @@ static int link_alt_odb_entry(struct repository *r, const struct strbuf *entry,
/* recursively add alternates */
read_info_alternates(r, ent->path, depth + 1);
-
- return 0;
+ ret = 0;
+ error:
+ strbuf_release(&tmp);
+ strbuf_release(&pathbuf);
+ return ret;
}
static const char *parse_alt_odb_entry(const char *string,
@@ -591,10 +603,7 @@ static void link_alt_odb_entries(struct repository *r, const char *alt,
return;
}
- strbuf_add_absolute_path(&objdirbuf, r->objects->odb->path);
- if (strbuf_normalize_path(&objdirbuf) < 0)
- die(_("unable to normalize object directory: %s"),
- objdirbuf.buf);
+ strbuf_realpath(&objdirbuf, r->objects->odb->path, 1);
while (*alt) {
alt = parse_alt_odb_entry(alt, sep, &entry);
@@ -938,6 +947,12 @@ void prepare_alt_odb(struct repository *r)
r->objects->loaded_alternates = 1;
}
+int has_alt_odb(struct repository *r)
+{
+ prepare_alt_odb(r);
+ return !!r->objects->odb->next;
+}
+
/* Returns 1 if we have successfully freshened the file, 0 otherwise. */
static int freshen_file(const char *fn)
{
@@ -1071,9 +1086,11 @@ int check_object_signature(struct repository *r, const struct object_id *oid,
void *buf, unsigned long size,
enum object_type type)
{
+ const struct git_hash_algo *algo =
+ oid->algo ? &hash_algos[oid->algo] : r->hash_algo;
struct object_id real_oid;
- hash_object_file(r->hash_algo, buf, size, type, &real_oid);
+ hash_object_file(algo, buf, size, type, &real_oid);
return !oideq(oid, &real_oid) ? -1 : 0;
}
@@ -1206,35 +1223,25 @@ static int quick_has_loose(struct repository *r,
}
/*
- * Map the loose object at "path" if it is not NULL, or the path found by
- * searching for a loose object named "oid".
+ * Map and close the given loose object fd. The path argument is used for
+ * error reporting.
*/
-static void *map_loose_object_1(struct repository *r, const char *path,
- const struct object_id *oid, unsigned long *size)
+static void *map_fd(int fd, const char *path, unsigned long *size)
{
- void *map;
- int fd;
-
- if (path)
- fd = git_open(path);
- else
- fd = open_loose_object(r, oid, &path);
- map = NULL;
- if (fd >= 0) {
- struct stat st;
+ void *map = NULL;
+ struct stat st;
- if (!fstat(fd, &st)) {
- *size = xsize_t(st.st_size);
- if (!*size) {
- /* mmap() is forbidden on empty files */
- error(_("object file %s is empty"), path);
- close(fd);
- return NULL;
- }
- map = xmmap(NULL, *size, PROT_READ, MAP_PRIVATE, fd, 0);
+ if (!fstat(fd, &st)) {
+ *size = xsize_t(st.st_size);
+ if (!*size) {
+ /* mmap() is forbidden on empty files */
+ error(_("object file %s is empty"), path);
+ close(fd);
+ return NULL;
}
- close(fd);
+ map = xmmap(NULL, *size, PROT_READ, MAP_PRIVATE, fd, 0);
}
+ close(fd);
return map;
}
@@ -1242,7 +1249,12 @@ void *map_loose_object(struct repository *r,
const struct object_id *oid,
unsigned long *size)
{
- return map_loose_object_1(r, NULL, oid, size);
+ const char *p;
+ int fd = open_loose_object(r, oid, &p);
+
+ if (fd < 0)
+ return NULL;
+ return map_fd(fd, p, size);
}
enum unpack_loose_header_result unpack_loose_header(git_zstream *stream,
@@ -1422,7 +1434,9 @@ static int loose_object_info(struct repository *r,
struct object_info *oi, int flags)
{
int status = 0;
+ int fd;
unsigned long mapsize;
+ const char *path;
void *map;
git_zstream stream;
char hdr[MAX_HEADER_LEN];
@@ -1443,7 +1457,6 @@ static int loose_object_info(struct repository *r,
* object even exists.
*/
if (!oi->typep && !oi->type_name && !oi->sizep && !oi->contentp) {
- const char *path;
struct stat st;
if (!oi->disk_sizep && (flags & OBJECT_INFO_QUICK))
return quick_has_loose(r, oid) ? 0 : -1;
@@ -1454,7 +1467,13 @@ static int loose_object_info(struct repository *r,
return 0;
}
- map = map_loose_object(r, oid, &mapsize);
+ fd = open_loose_object(r, oid, &path);
+ if (fd < 0) {
+ if (errno != ENOENT)
+ error_errno(_("unable to open loose object %s"), oid_to_hex(oid));
+ return -1;
+ }
+ map = map_fd(fd, path, &mapsize);
if (!map)
return -1;
@@ -1492,6 +1511,10 @@ static int loose_object_info(struct repository *r,
break;
}
+ if (status && (flags & OBJECT_INFO_DIE_IF_CORRUPT))
+ die(_("loose object %s (stored in %s) is corrupt"),
+ oid_to_hex(oid), path);
+
git_inflate_end(&stream);
cleanup:
munmap(map, mapsize);
@@ -1570,9 +1593,6 @@ static int do_oid_object_info_extended(struct repository *r,
if (find_pack_entry(r, real, &e))
break;
- if (flags & OBJECT_INFO_IGNORE_LOOSE)
- return -1;
-
/* Most likely it's a loose object. */
if (!loose_object_info(r, real, oi, flags))
return 0;
@@ -1599,15 +1619,20 @@ static int do_oid_object_info_extended(struct repository *r,
if (fetch_if_missing && repo_has_promisor_remote(r) &&
!already_retried &&
!(flags & OBJECT_INFO_SKIP_FETCH_OBJECT)) {
- /*
- * TODO Investigate checking promisor_remote_get_direct()
- * TODO return value and stopping on error here.
- */
promisor_remote_get_direct(r, real, 1);
already_retried = 1;
continue;
}
+ if (flags & OBJECT_INFO_DIE_IF_CORRUPT) {
+ const struct packed_git *p;
+ if ((flags & OBJECT_INFO_LOOKUP_REPLACE) && !oideq(real, oid))
+ die(_("replacement %s not found for %s"),
+ oid_to_hex(real), oid_to_hex(oid));
+ if ((p = has_packed_and_bad(r, real)))
+ die(_("packed object %s (stored in %s) is corrupt"),
+ oid_to_hex(real), p->pack_name);
+ }
return -1;
}
@@ -1631,10 +1656,101 @@ static int do_oid_object_info_extended(struct repository *r,
return 0;
}
+static int oid_object_info_convert(struct repository *r,
+ const struct object_id *input_oid,
+ struct object_info *input_oi, unsigned flags)
+{
+ const struct git_hash_algo *input_algo = &hash_algos[input_oid->algo];
+ int do_die = flags & OBJECT_INFO_DIE_IF_CORRUPT;
+ struct strbuf type_name = STRBUF_INIT;
+ struct object_id oid, delta_base_oid;
+ struct object_info new_oi, *oi;
+ unsigned long size;
+ void *content;
+ int ret;
+
+ if (repo_oid_to_algop(r, input_oid, the_hash_algo, &oid)) {
+ if (do_die)
+ die(_("missing mapping of %s to %s"),
+ oid_to_hex(input_oid), the_hash_algo->name);
+ return -1;
+ }
+
+ /* Is new_oi needed? */
+ oi = input_oi;
+ if (input_oi && (input_oi->delta_base_oid || input_oi->sizep ||
+ input_oi->contentp)) {
+ new_oi = *input_oi;
+ /* Does delta_base_oid need to be converted? */
+ if (input_oi->delta_base_oid)
+ new_oi.delta_base_oid = &delta_base_oid;
+ /* Will the attributes differ when converted? */
+ if (input_oi->sizep || input_oi->contentp) {
+ new_oi.contentp = &content;
+ new_oi.sizep = &size;
+ new_oi.type_name = &type_name;
+ }
+ oi = &new_oi;
+ }
+
+ ret = oid_object_info_extended(r, &oid, oi, flags);
+ if (ret)
+ return -1;
+ if (oi == input_oi)
+ return ret;
+
+ if (new_oi.contentp) {
+ struct strbuf outbuf = STRBUF_INIT;
+ enum object_type type;
+
+ type = type_from_string_gently(type_name.buf, type_name.len,
+ !do_die);
+ if (type == -1)
+ return -1;
+ if (type != OBJ_BLOB) {
+ ret = convert_object_file(&outbuf,
+ the_hash_algo, input_algo,
+ content, size, type, !do_die);
+ if (ret == -1)
+ return -1;
+ free(content);
+ size = outbuf.len;
+ content = strbuf_detach(&outbuf, NULL);
+ }
+ if (input_oi->sizep)
+ *input_oi->sizep = size;
+ if (input_oi->contentp)
+ *input_oi->contentp = content;
+ else
+ free(content);
+ if (input_oi->type_name)
+ *input_oi->type_name = type_name;
+ else
+ strbuf_release(&type_name);
+ }
+ if (new_oi.delta_base_oid == &delta_base_oid) {
+ if (repo_oid_to_algop(r, &delta_base_oid, input_algo,
+ input_oi->delta_base_oid)) {
+ if (do_die)
+ die(_("missing mapping of %s to %s"),
+ oid_to_hex(&delta_base_oid),
+ input_algo->name);
+ return -1;
+ }
+ }
+ input_oi->whence = new_oi.whence;
+ input_oi->u = new_oi.u;
+ return ret;
+}
+
int oid_object_info_extended(struct repository *r, const struct object_id *oid,
struct object_info *oi, unsigned flags)
{
int ret;
+
+ if (oid->algo && (hash_algo_by_ptr(r->hash_algo) != oid->algo))
+ return oid_object_info_convert(r, oid, oi, flags);
+
obj_read_lock();
ret = do_oid_object_info_extended(r, oid, oi, flags);
obj_read_unlock();
@@ -1658,28 +1774,13 @@ int oid_object_info(struct repository *r,
return type;
}
-static void *read_object(struct repository *r,
- const struct object_id *oid, enum object_type *type,
- unsigned long *size)
-{
- struct object_info oi = OBJECT_INFO_INIT;
- void *content;
- oi.typep = type;
- oi.sizep = size;
- oi.contentp = &content;
-
- if (oid_object_info_extended(r, oid, &oi, 0) < 0)
- return NULL;
- return content;
-}
-
int pretend_object_file(void *buf, unsigned long len, enum object_type type,
struct object_id *oid)
{
struct cached_object *co;
hash_object_file(the_hash_algo, buf, len, type, oid);
- if (has_object_file_with_flags(oid, OBJECT_INFO_QUICK | OBJECT_INFO_SKIP_FETCH_OBJECT) ||
+ if (repo_has_object_file_with_flags(the_repository, oid, OBJECT_INFO_QUICK | OBJECT_INFO_SKIP_FETCH_OBJECT) ||
find_cached_object(oid))
return 0;
ALLOC_GROW(cached_objects, cached_object_nr + 1, cached_object_alloc);
@@ -1694,46 +1795,25 @@ int pretend_object_file(void *buf, unsigned long len, enum object_type type,
/*
* This function dies on corrupt objects; the callers who want to
- * deal with them should arrange to call read_object() and give error
- * messages themselves.
+ * deal with them should arrange to call oid_object_info_extended() and give
+ * error messages themselves.
*/
-void *read_object_file_extended(struct repository *r,
- const struct object_id *oid,
- enum object_type *type,
- unsigned long *size,
- int lookup_replace)
+void *repo_read_object_file(struct repository *r,
+ const struct object_id *oid,
+ enum object_type *type,
+ unsigned long *size)
{
+ struct object_info oi = OBJECT_INFO_INIT;
+ unsigned flags = OBJECT_INFO_DIE_IF_CORRUPT | OBJECT_INFO_LOOKUP_REPLACE;
void *data;
- const struct packed_git *p;
- const char *path;
- struct stat st;
- const struct object_id *repl = lookup_replace ?
- lookup_replace_object(r, oid) : oid;
-
- errno = 0;
- data = read_object(r, repl, type, size);
- if (data)
- return data;
-
- obj_read_lock();
- if (errno && errno != ENOENT)
- die_errno(_("failed to read object %s"), oid_to_hex(oid));
-
- /* die if we replaced an object with one that does not exist */
- if (repl != oid)
- die(_("replacement %s not found for %s"),
- oid_to_hex(repl), oid_to_hex(oid));
-
- if (!stat_loose_object(r, repl, &st, &path))
- die(_("loose object %s (stored in %s) is corrupt"),
- oid_to_hex(repl), path);
- if ((p = has_packed_and_bad(r, repl)))
- die(_("packed object %s (stored in %s) is corrupt"),
- oid_to_hex(repl), p->pack_name);
- obj_read_unlock();
+ oi.typep = type;
+ oi.sizep = size;
+ oi.contentp = &data;
+ if (oid_object_info_extended(r, oid, &oi, flags))
+ return NULL;
- return NULL;
+ return data;
}
void *read_object_with_reference(struct repository *r,
@@ -1863,13 +1943,6 @@ out:
return 0;
}
-static int write_buffer(int fd, const void *buf, size_t len)
-{
- if (write_in_full(fd, buf, len) < 0)
- return error_errno(_("file write error"));
- return 0;
-}
-
static void hash_object_file_literally(const struct git_hash_algo *algo,
const void *buf, unsigned long len,
const char *type, struct object_id *oid)
@@ -1951,6 +2024,114 @@ static int create_tmpfile(struct strbuf *tmp, const char *filename)
return fd;
}
+/**
+ * Common steps for loose object writers to start writing loose
+ * objects:
+ *
+ * - Create tmpfile for the loose object.
+ * - Setup zlib stream for compression.
+ * - Start to feed header to zlib stream.
+ *
+ * Returns a "fd", which should later be provided to
+ * end_loose_object_common().
+ */
+static int start_loose_object_common(struct strbuf *tmp_file,
+ const char *filename, unsigned flags,
+ git_zstream *stream,
+ unsigned char *buf, size_t buflen,
+ git_hash_ctx *c, git_hash_ctx *compat_c,
+ char *hdr, int hdrlen)
+{
+ struct repository *repo = the_repository;
+ const struct git_hash_algo *algo = repo->hash_algo;
+ const struct git_hash_algo *compat = repo->compat_hash_algo;
+ int fd;
+
+ fd = create_tmpfile(tmp_file, filename);
+ if (fd < 0) {
+ if (flags & HASH_SILENT)
+ return -1;
+ else if (errno == EACCES)
+ return error(_("insufficient permission for adding "
+ "an object to repository database %s"),
+ get_object_directory());
+ else
+ return error_errno(
+ _("unable to create temporary file"));
+ }
+
+ /* Setup zlib stream for compression */
+ git_deflate_init(stream, zlib_compression_level);
+ stream->next_out = buf;
+ stream->avail_out = buflen;
+ algo->init_fn(c);
+ if (compat && compat_c)
+ compat->init_fn(compat_c);
+
+ /* Start to feed header to zlib stream */
+ stream->next_in = (unsigned char *)hdr;
+ stream->avail_in = hdrlen;
+ while (git_deflate(stream, 0) == Z_OK)
+ ; /* nothing */
+ algo->update_fn(c, hdr, hdrlen);
+ if (compat && compat_c)
+ compat->update_fn(compat_c, hdr, hdrlen);
+
+ return fd;
+}
+
+/**
+ * Common steps for the inner git_deflate() loop for writing loose
+ * objects. Returns what git_deflate() returns.
+ */
+static int write_loose_object_common(git_hash_ctx *c, git_hash_ctx *compat_c,
+ git_zstream *stream, const int flush,
+ unsigned char *in0, const int fd,
+ unsigned char *compressed,
+ const size_t compressed_len)
+{
+ struct repository *repo = the_repository;
+ const struct git_hash_algo *algo = repo->hash_algo;
+ const struct git_hash_algo *compat = repo->compat_hash_algo;
+ int ret;
+
+ ret = git_deflate(stream, flush ? Z_FINISH : 0);
+ algo->update_fn(c, in0, stream->next_in - in0);
+ if (compat && compat_c)
+ compat->update_fn(compat_c, in0, stream->next_in - in0);
+ if (write_in_full(fd, compressed, stream->next_out - compressed) < 0)
+ die_errno(_("unable to write loose object file"));
+ stream->next_out = compressed;
+ stream->avail_out = compressed_len;
+
+ return ret;
+}
+
+/**
+ * Common steps for loose object writers to end writing loose objects:
+ *
+ * - End the compression of zlib stream.
+ * - Get the calculated oid to "oid".
+ */
+static int end_loose_object_common(git_hash_ctx *c, git_hash_ctx *compat_c,
+ git_zstream *stream, struct object_id *oid,
+ struct object_id *compat_oid)
+{
+ struct repository *repo = the_repository;
+ const struct git_hash_algo *algo = repo->hash_algo;
+ const struct git_hash_algo *compat = repo->compat_hash_algo;
+ int ret;
+
+ ret = git_deflate_end_gently(stream);
+ if (ret != Z_OK)
+ return ret;
+ algo->final_oid_fn(oid, c);
+ if (compat && compat_c)
+ compat->final_oid_fn(compat_oid, compat_c);
+
+ return Z_OK;
+}
+
static int write_loose_object(const struct object_id *oid, char *hdr,
int hdrlen, const void *buf, unsigned long len,
time_t mtime, unsigned flags)
@@ -1968,50 +2149,29 @@ static int write_loose_object(const struct object_id *oid, char *hdr,
loose_object_path(the_repository, &filename, oid);
- fd = create_tmpfile(&tmp_file, filename.buf);
- if (fd < 0) {
- if (flags & HASH_SILENT)
- return -1;
- else if (errno == EACCES)
- return error(_("insufficient permission for adding an object to repository database %s"), get_object_directory());
- else
- return error_errno(_("unable to create temporary file"));
- }
-
- /* Set it up */
- git_deflate_init(&stream, zlib_compression_level);
- stream.next_out = compressed;
- stream.avail_out = sizeof(compressed);
- the_hash_algo->init_fn(&c);
-
- /* First header.. */
- stream.next_in = (unsigned char *)hdr;
- stream.avail_in = hdrlen;
- while (git_deflate(&stream, 0) == Z_OK)
- ; /* nothing */
- the_hash_algo->update_fn(&c, hdr, hdrlen);
+ fd = start_loose_object_common(&tmp_file, filename.buf, flags,
+ &stream, compressed, sizeof(compressed),
+ &c, NULL, hdr, hdrlen);
+ if (fd < 0)
+ return -1;
/* Then the data itself.. */
stream.next_in = (void *)buf;
stream.avail_in = len;
do {
unsigned char *in0 = stream.next_in;
- ret = git_deflate(&stream, Z_FINISH);
- the_hash_algo->update_fn(&c, in0, stream.next_in - in0);
- if (write_buffer(fd, compressed, stream.next_out - compressed) < 0)
- die(_("unable to write loose object file"));
- stream.next_out = compressed;
- stream.avail_out = sizeof(compressed);
+
+ ret = write_loose_object_common(&c, NULL, &stream, 1, in0, fd,
+ compressed, sizeof(compressed));
} while (ret == Z_OK);
if (ret != Z_STREAM_END)
die(_("unable to deflate new object %s (%d)"), oid_to_hex(oid),
ret);
- ret = git_deflate_end_gently(&stream);
+ ret = end_loose_object_common(&c, NULL, &stream, &parano_oid, NULL);
if (ret != Z_OK)
die(_("deflateEnd on object %s failed (%d)"), oid_to_hex(oid),
ret);
- the_hash_algo->final_oid_fn(&parano_oid, &c);
if (!oideq(oid, &parano_oid))
die(_("confused by unstable object source data for %s"),
oid_to_hex(oid));
@@ -2050,21 +2210,152 @@ static int freshen_packed_object(const struct object_id *oid)
return 1;
}
+int stream_loose_object(struct input_stream *in_stream, size_t len,
+ struct object_id *oid)
+{
+ const struct git_hash_algo *compat = the_repository->compat_hash_algo;
+ struct object_id compat_oid;
+ int fd, ret, err = 0, flush = 0;
+ unsigned char compressed[4096];
+ git_zstream stream;
+ git_hash_ctx c, compat_c;
+ struct strbuf tmp_file = STRBUF_INIT;
+ struct strbuf filename = STRBUF_INIT;
+ int dirlen;
+ char hdr[MAX_HEADER_LEN];
+ int hdrlen;
+
+ if (batch_fsync_enabled(FSYNC_COMPONENT_LOOSE_OBJECT))
+ prepare_loose_object_bulk_checkin();
+
+ /* Since oid is not determined, save tmp file to odb path. */
+ strbuf_addf(&filename, "%s/", get_object_directory());
+ hdrlen = format_object_header(hdr, sizeof(hdr), OBJ_BLOB, len);
+
+ /*
+ * Common steps for write_loose_object and stream_loose_object to
+ * start writing loose objects:
+ *
+ * - Create tmpfile for the loose object.
+ * - Setup zlib stream for compression.
+ * - Start to feed header to zlib stream.
+ */
+ fd = start_loose_object_common(&tmp_file, filename.buf, 0,
+ &stream, compressed, sizeof(compressed),
+ &c, &compat_c, hdr, hdrlen);
+ if (fd < 0) {
+ err = -1;
+ goto cleanup;
+ }
+
+ /* Then the data itself.. */
+ do {
+ unsigned char *in0 = stream.next_in;
+
+ if (!stream.avail_in && !in_stream->is_finished) {
+ const void *in = in_stream->read(in_stream, &stream.avail_in);
+ stream.next_in = (void *)in;
+ in0 = (unsigned char *)in;
+ /* All data has been read. */
+ if (in_stream->is_finished)
+ flush = 1;
+ }
+ ret = write_loose_object_common(&c, &compat_c, &stream, flush, in0, fd,
+ compressed, sizeof(compressed));
+ /*
+ * Unlike write_loose_object(), we do not have the entire
+ * buffer. If we get Z_BUF_ERROR due to too few input bytes,
+ * then we'll replenish them in the next input_stream->read()
+ * call when we loop.
+ */
+ } while (ret == Z_OK || ret == Z_BUF_ERROR);
+
+ if (stream.total_in != len + hdrlen)
+ die(_("write stream object %ld != %"PRIuMAX), stream.total_in,
+ (uintmax_t)len + hdrlen);
+
+ /*
+ * Common steps for write_loose_object and stream_loose_object to
+ * end writing loose oject:
+ *
+ * - End the compression of zlib stream.
+ * - Get the calculated oid.
+ */
+ if (ret != Z_STREAM_END)
+ die(_("unable to stream deflate new object (%d)"), ret);
+ ret = end_loose_object_common(&c, &compat_c, &stream, oid, &compat_oid);
+ if (ret != Z_OK)
+ die(_("deflateEnd on stream object failed (%d)"), ret);
+ close_loose_object(fd, tmp_file.buf);
+
+ if (freshen_packed_object(oid) || freshen_loose_object(oid)) {
+ unlink_or_warn(tmp_file.buf);
+ goto cleanup;
+ }
+
+ loose_object_path(the_repository, &filename, oid);
+
+ /* We finally know the object path, and create the missing dir. */
+ dirlen = directory_size(filename.buf);
+ if (dirlen) {
+ struct strbuf dir = STRBUF_INIT;
+ strbuf_add(&dir, filename.buf, dirlen);
+
+ if (mkdir_in_gitdir(dir.buf) && errno != EEXIST) {
+ err = error_errno(_("unable to create directory %s"), dir.buf);
+ strbuf_release(&dir);
+ goto cleanup;
+ }
+ strbuf_release(&dir);
+ }
+
+ err = finalize_object_file(tmp_file.buf, filename.buf);
+ if (!err && compat)
+ err = repo_add_loose_object_map(the_repository, oid, &compat_oid);
+cleanup:
+ strbuf_release(&tmp_file);
+ strbuf_release(&filename);
+ return err;
+}
+
int write_object_file_flags(const void *buf, unsigned long len,
enum object_type type, struct object_id *oid,
- unsigned flags)
+ struct object_id *compat_oid_in, unsigned flags)
{
+ struct repository *repo = the_repository;
+ const struct git_hash_algo *algo = repo->hash_algo;
+ const struct git_hash_algo *compat = repo->compat_hash_algo;
+ struct object_id compat_oid;
char hdr[MAX_HEADER_LEN];
int hdrlen = sizeof(hdr);
+ /* Generate compat_oid */
+ if (compat) {
+ if (compat_oid_in)
+ oidcpy(&compat_oid, compat_oid_in);
+ else if (type == OBJ_BLOB)
+ hash_object_file(compat, buf, len, type, &compat_oid);
+ else {
+ struct strbuf converted = STRBUF_INIT;
+ convert_object_file(&converted, algo, compat,
+ buf, len, type, 0);
+ hash_object_file(compat, converted.buf, converted.len,
+ type, &compat_oid);
+ strbuf_release(&converted);
+ }
+ }
+
/* Normally if we have it in the pack then we do not bother writing
* it out into .git/objects/??/?{38} file.
*/
- write_object_file_prepare(the_hash_algo, buf, len, type, oid, hdr,
- &hdrlen);
+ write_object_file_prepare(algo, buf, len, type, oid, hdr, &hdrlen);
if (freshen_packed_object(oid) || freshen_loose_object(oid))
return 0;
- return write_loose_object(oid, hdr, hdrlen, buf, len, 0, flags);
+ if (write_loose_object(oid, hdr, hdrlen, buf, len, 0, flags))
+ return -1;
+ if (compat)
+ return repo_add_loose_object_map(repo, oid, &compat_oid);
+ return 0;
}
int write_object_file_literally(const void *buf, unsigned long len,
@@ -2072,7 +2363,27 @@ int write_object_file_literally(const void *buf, unsigned long len,
unsigned flags)
{
char *header;
+ struct repository *repo = the_repository;
+ const struct git_hash_algo *algo = repo->hash_algo;
+ const struct git_hash_algo *compat = repo->compat_hash_algo;
+ struct object_id compat_oid;
int hdrlen, status = 0;
+ int compat_type = -1;
+
+ if (compat) {
+ compat_type = type_from_string_gently(type, -1, 1);
+ if (compat_type == OBJ_BLOB)
+ hash_object_file(compat, buf, len, compat_type,
+ &compat_oid);
+ else if (compat_type != -1) {
+ struct strbuf converted = STRBUF_INIT;
+ convert_object_file(&converted, algo, compat,
+ buf, len, compat_type, 0);
+ hash_object_file(compat, converted.buf, converted.len,
+ compat_type, &compat_oid);
+ strbuf_release(&converted);
+ }
+ }
/* type string, SP, %lu of the length plus NUL must fit this */
hdrlen = strlen(type) + MAX_HEADER_LEN;
@@ -2085,6 +2396,8 @@ int write_object_file_literally(const void *buf, unsigned long len,
if (freshen_packed_object(oid) || freshen_loose_object(oid))
goto cleanup;
status = write_loose_object(oid, header, hdrlen, buf, len, 0, 0);
+ if (compat_type != -1)
+ return repo_add_loose_object_map(repo, oid, &compat_oid);
cleanup:
free(header);
@@ -2093,8 +2406,12 @@ cleanup:
int force_object_loose(const struct object_id *oid, time_t mtime)
{
+ struct repository *repo = the_repository;
+ const struct git_hash_algo *compat = repo->compat_hash_algo;
void *buf;
unsigned long len;
+ struct object_info oi = OBJECT_INFO_INIT;
+ struct object_id compat_oid;
enum object_type type;
char hdr[MAX_HEADER_LEN];
int hdrlen;
@@ -2102,11 +2419,20 @@ int force_object_loose(const struct object_id *oid, time_t mtime)
if (has_loose_object(oid))
return 0;
- buf = read_object(the_repository, oid, &type, &len);
- if (!buf)
+ oi.typep = &type;
+ oi.sizep = &len;
+ oi.contentp = &buf;
+ if (oid_object_info_extended(the_repository, oid, &oi, 0))
return error(_("cannot read object for %s"), oid_to_hex(oid));
+ if (compat) {
+ if (repo_oid_to_algop(repo, oid, compat, &compat_oid))
+ return error(_("cannot map object %s to %s"),
+ oid_to_hex(oid), compat->name);
+ }
hdrlen = format_object_header(hdr, sizeof(hdr), type, len);
ret = write_loose_object(oid, hdr, hdrlen, buf, len, mtime, 0);
+ if (!ret && compat)
+ ret = repo_add_loose_object_map(the_repository, oid, &compat_oid);
free(buf);
return ret;
@@ -2138,32 +2464,21 @@ int repo_has_object_file(struct repository *r,
return repo_has_object_file_with_flags(r, oid, 0);
}
-static void check_tree(const void *buf, size_t size)
-{
- struct tree_desc desc;
- struct name_entry entry;
-
- init_tree_desc(&desc, buf, size);
- while (tree_entry(&desc, &entry))
- /* do nothing
- * tree_entry() will die() on malformed entries */
- ;
-}
-
-static void check_commit(const void *buf, size_t size)
-{
- struct commit c;
- memset(&c, 0, sizeof(c));
- if (parse_commit_buffer(the_repository, &c, buf, size, 0))
- die(_("corrupt commit"));
-}
-
-static void check_tag(const void *buf, size_t size)
-{
- struct tag t;
- memset(&t, 0, sizeof(t));
- if (parse_tag_buffer(the_repository, &t, buf, size))
- die(_("corrupt tag"));
+/*
+ * We can't use the normal fsck_error_function() for index_mem(),
+ * because we don't yet have a valid oid for it to report. Instead,
+ * report the minimal fsck error here, and rely on the caller to
+ * give more context.
+ */
+static int hash_format_check_report(struct fsck_options *opts UNUSED,
+ const struct object_id *oid UNUSED,
+ enum object_type object_type UNUSED,
+ enum fsck_msg_type msg_type UNUSED,
+ enum fsck_msg_id msg_id UNUSED,
+ const char *message)
+{
+ error(_("object fails fsck: %s"), message);
+ return 1;
}
static int index_mem(struct index_state *istate,
@@ -2190,12 +2505,13 @@ static int index_mem(struct index_state *istate,
}
}
if (flags & HASH_FORMAT_CHECK) {
- if (type == OBJ_TREE)
- check_tree(buf, size);
- if (type == OBJ_COMMIT)
- check_commit(buf, size);
- if (type == OBJ_TAG)
- check_tag(buf, size);
+ struct fsck_options opts = FSCK_OPTIONS_DEFAULT;
+
+ opts.strict = 1;
+ opts.error_func = hash_format_check_report;
+ if (fsck_buffer(null_oid(), type, buf, size, &opts))
+ die(_("refusing to create malformed object"));
+ fsck_finish(&opts);
}
if (write_object)
@@ -2294,11 +2610,11 @@ static int index_core(struct index_state *istate,
* binary blobs, they generally do not want to get any conversion, and
* callers should avoid this code path when filters are requested.
*/
-static int index_stream(struct object_id *oid, int fd, size_t size,
- enum object_type type, const char *path,
- unsigned flags)
+static int index_blob_stream(struct object_id *oid, int fd, size_t size,
+ const char *path,
+ unsigned flags)
{
- return index_bulk_checkin(oid, fd, size, type, path, flags);
+ return index_blob_bulk_checkin(oid, fd, size, path, flags);
}
int index_fd(struct index_state *istate, struct object_id *oid,
@@ -2320,8 +2636,8 @@ int index_fd(struct index_state *istate, struct object_id *oid,
ret = index_core(istate, oid, fd, xsize_t(st->st_size),
type, path, flags);
else
- ret = index_stream(oid, fd, xsize_t(st->st_size), type, path,
- flags);
+ ret = index_blob_stream(oid, fd, xsize_t(st->st_size), path,
+ flags);
close(fd);
return ret;
}
@@ -2507,7 +2823,8 @@ int for_each_loose_object(each_loose_object_fn cb, void *data,
return 0;
}
-static int append_loose_object(const struct object_id *oid, const char *path,
+static int append_loose_object(const struct object_id *oid,
+ const char *path UNUSED,
void *data)
{
oidtree_insert(data, oid);
@@ -2618,13 +2935,16 @@ int read_loose_object(const char *path,
struct object_info *oi)
{
int ret = -1;
+ int fd;
void *map = NULL;
unsigned long mapsize;
git_zstream stream;
char hdr[MAX_HEADER_LEN];
unsigned long *size = oi->sizep;
- map = map_loose_object_1(the_repository, path, NULL, &mapsize);
+ fd = git_open(path);
+ if (fd >= 0)
+ map = map_fd(fd, path, &mapsize);
if (!map) {
error_errno(_("unable to mmap %s"), path);
goto out;
diff --git a/object-file.h b/object-file.h
new file mode 100644
index 0000000..d641461
--- /dev/null
+++ b/object-file.h
@@ -0,0 +1,131 @@
+#ifndef OBJECT_FILE_H
+#define OBJECT_FILE_H
+
+#include "git-zlib.h"
+#include "object.h"
+
+struct index_state;
+
+/*
+ * Set this to 0 to prevent oid_object_info_extended() from fetching missing
+ * blobs. This has a difference only if extensions.partialClone is set.
+ *
+ * Its default value is 1.
+ */
+extern int fetch_if_missing;
+
+#define HASH_WRITE_OBJECT 1
+#define HASH_FORMAT_CHECK 2
+#define HASH_RENORMALIZE 4
+#define HASH_SILENT 8
+int index_fd(struct index_state *istate, struct object_id *oid, int fd, struct stat *st, enum object_type type, const char *path, unsigned flags);
+int index_path(struct index_state *istate, struct object_id *oid, const char *path, struct stat *st, unsigned flags);
+
+/*
+ * Create the directory containing the named path, using care to be
+ * somewhat safe against races. Return one of the scld_error values to
+ * indicate success/failure. On error, set errno to describe the
+ * problem.
+ *
+ * SCLD_VANISHED indicates that one of the ancestor directories of the
+ * path existed at one point during the function call and then
+ * suddenly vanished, probably because another process pruned the
+ * directory while we were working. To be robust against this kind of
+ * race, callers might want to try invoking the function again when it
+ * returns SCLD_VANISHED.
+ *
+ * safe_create_leading_directories() temporarily changes path while it
+ * is working but restores it before returning.
+ * safe_create_leading_directories_const() doesn't modify path, even
+ * temporarily. Both these variants adjust the permissions of the
+ * created directories to honor core.sharedRepository, so they are best
+ * suited for files inside the git dir. For working tree files, use
+ * safe_create_leading_directories_no_share() instead, as it ignores
+ * the core.sharedRepository setting.
+ */
+enum scld_error {
+ SCLD_OK = 0,
+ SCLD_FAILED = -1,
+ SCLD_PERMS = -2,
+ SCLD_EXISTS = -3,
+ SCLD_VANISHED = -4
+};
+enum scld_error safe_create_leading_directories(char *path);
+enum scld_error safe_create_leading_directories_const(const char *path);
+enum scld_error safe_create_leading_directories_no_share(char *path);
+
+int mkdir_in_gitdir(const char *path);
+
+int git_open_cloexec(const char *name, int flags);
+#define git_open(name) git_open_cloexec(name, O_RDONLY)
+
+/**
+ * unpack_loose_header() initializes the data stream needed to unpack
+ * a loose object header.
+ *
+ * Returns:
+ *
+ * - ULHR_OK on success
+ * - ULHR_BAD on error
+ * - ULHR_TOO_LONG if the header was too long
+ *
+ * It will only parse up to MAX_HEADER_LEN bytes unless an optional
+ * "hdrbuf" argument is non-NULL. This is intended for use with
+ * OBJECT_INFO_ALLOW_UNKNOWN_TYPE to extract the bad type for (error)
+ * reporting. The full header will be extracted to "hdrbuf" for use
+ * with parse_loose_header(), ULHR_TOO_LONG will still be returned
+ * from this function to indicate that the header was too long.
+ */
+enum unpack_loose_header_result {
+ ULHR_OK,
+ ULHR_BAD,
+ ULHR_TOO_LONG,
+};
+enum unpack_loose_header_result unpack_loose_header(git_zstream *stream,
+ unsigned char *map,
+ unsigned long mapsize,
+ void *buffer,
+ unsigned long bufsiz,
+ struct strbuf *hdrbuf);
+
+/**
+ * parse_loose_header() parses the starting "<type> <len>\0" of an
+ * object. If it doesn't follow that format -1 is returned. To check
+ * the validity of the <type> populate the "typep" in the "struct
+ * object_info". It will be OBJ_BAD if the object type is unknown. The
+ * parsed <len> can be retrieved via "oi->sizep", and from there
+ * passed to unpack_loose_rest().
+ */
+struct object_info;
+int parse_loose_header(const char *hdr, struct object_info *oi);
+
+/**
+ * With in-core object data in "buf", rehash it to make sure the
+ * object name actually matches "oid" to detect object corruption.
+ *
+ * A negative value indicates an error, usually that the OID is not
+ * what we expected, but it might also indicate another error.
+ */
+int check_object_signature(struct repository *r, const struct object_id *oid,
+ void *map, unsigned long size,
+ enum object_type type);
+
+/**
+ * A streaming version of check_object_signature().
+ * Try reading the object named with "oid" using
+ * the streaming interface and rehash it to do the same.
+ */
+int stream_object_signature(struct repository *r, const struct object_id *oid);
+
+int finalize_object_file(const char *tmpfile, const char *filename);
+
+/* Helper to check and "touch" a file */
+int check_and_freshen_file(const char *fn, int freshen);
+
+void *read_object_with_reference(struct repository *r,
+ const struct object_id *oid,
+ enum object_type required_type,
+ unsigned long *size,
+ struct object_id *oid_ret);
+
+#endif /* OBJECT_FILE_H */
diff --git a/object-name.c b/object-name.c
index 4d27465..523af6f 100644
--- a/object-name.c
+++ b/object-name.c
@@ -1,21 +1,29 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "object-name.h"
+#include "advice.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "tag.h"
#include "commit.h"
#include "tree.h"
-#include "blob.h"
#include "tree-walk.h"
#include "refs.h"
#include "remote.h"
#include "dir.h"
#include "oid-array.h"
+#include "oidtree.h"
#include "packfile.h"
-#include "object-store.h"
+#include "pretty.h"
+#include "object-store-ll.h"
+#include "read-cache-ll.h"
#include "repository.h"
-#include "submodule.h"
+#include "setup.h"
#include "midx.h"
#include "commit-reach.h"
#include "date.h"
+#include "object-file-convert.h"
static int get_oid_oneline(struct repository *r, const char *, struct object_id *, struct commit_list *);
@@ -40,6 +48,7 @@ struct disambiguate_state {
static void update_candidates(struct disambiguate_state *ds, const struct object_id *current)
{
+ /* The hash algorithm of current has already been filtered */
if (ds->always_call_fn) {
ds->ambiguous = ds->fn(ds->repo, current, ds->cb_data) ? 1 : 0;
return;
@@ -125,6 +134,8 @@ static void unique_in_midx(struct multi_pack_index *m,
{
uint32_t num, i, first = 0;
const struct object_id *current = NULL;
+ int len = ds->len > ds->repo->hash_algo->hexsz ?
+ ds->repo->hash_algo->hexsz : ds->len;
num = m->num_objects;
if (!num)
@@ -140,7 +151,7 @@ static void unique_in_midx(struct multi_pack_index *m,
for (i = first; i < num && !ds->ambiguous; i++) {
struct object_id oid;
current = nth_midxed_object_oid(&oid, m, i);
- if (!match_hash(ds->len, ds->bin_pfx.hash, current->hash))
+ if (!match_hash(len, ds->bin_pfx.hash, current->hash))
break;
update_candidates(ds, current);
}
@@ -150,6 +161,8 @@ static void unique_in_pack(struct packed_git *p,
struct disambiguate_state *ds)
{
uint32_t num, i, first = 0;
+ int len = ds->len > ds->repo->hash_algo->hexsz ?
+ ds->repo->hash_algo->hexsz : ds->len;
if (p->multi_pack_index)
return;
@@ -168,7 +181,7 @@ static void unique_in_pack(struct packed_git *p,
for (i = first; i < num && !ds->ambiguous; i++) {
struct object_id oid;
nth_packed_object_id(&oid, p, i);
- if (!match_hash(ds->len, ds->bin_pfx.hash, oid.hash))
+ if (!match_hash(len, ds->bin_pfx.hash, oid.hash))
break;
update_candidates(ds, &oid);
}
@@ -179,6 +192,10 @@ static void find_short_packed_object(struct disambiguate_state *ds)
struct multi_pack_index *m;
struct packed_git *p;
+ /* Skip, unless oids from the storage hash algorithm are wanted */
+ if (ds->bin_pfx.algo && (&hash_algos[ds->bin_pfx.algo] != ds->repo->hash_algo))
+ return;
+
for (m = get_multi_pack_index(ds->repo); m && !ds->ambiguous;
m = m->next)
unique_in_midx(m, ds);
@@ -223,7 +240,7 @@ static int finish_object_disambiguation(struct disambiguate_state *ds,
static int disambiguate_commit_only(struct repository *r,
const struct object_id *oid,
- void *cb_data_unused)
+ void *cb_data UNUSED)
{
int kind = oid_object_info(r, oid, NULL);
return kind == OBJ_COMMIT;
@@ -231,7 +248,7 @@ static int disambiguate_commit_only(struct repository *r,
static int disambiguate_committish_only(struct repository *r,
const struct object_id *oid,
- void *cb_data_unused)
+ void *cb_data UNUSED)
{
struct object *obj;
int kind;
@@ -251,7 +268,7 @@ static int disambiguate_committish_only(struct repository *r,
static int disambiguate_tree_only(struct repository *r,
const struct object_id *oid,
- void *cb_data_unused)
+ void *cb_data UNUSED)
{
int kind = oid_object_info(r, oid, NULL);
return kind == OBJ_TREE;
@@ -259,7 +276,7 @@ static int disambiguate_tree_only(struct repository *r,
static int disambiguate_treeish_only(struct repository *r,
const struct object_id *oid,
- void *cb_data_unused)
+ void *cb_data UNUSED)
{
struct object *obj;
int kind;
@@ -279,7 +296,7 @@ static int disambiguate_treeish_only(struct repository *r,
static int disambiguate_blob_only(struct repository *r,
const struct object_id *oid,
- void *cb_data_unused)
+ void *cb_data UNUSED)
{
int kind = oid_object_info(r, oid, NULL);
return kind == OBJ_BLOB;
@@ -317,11 +334,12 @@ int set_disambiguate_hint_config(const char *var, const char *value)
static int init_object_disambiguation(struct repository *r,
const char *name, int len,
+ const struct git_hash_algo *algo,
struct disambiguate_state *ds)
{
int i;
- if (len < MINIMUM_ABBREV || len > the_hash_algo->hexsz)
+ if (len < MINIMUM_ABBREV || len > GIT_MAX_HEXSZ)
return -1;
memset(ds, 0, sizeof(*ds));
@@ -348,6 +366,7 @@ static int init_object_disambiguation(struct repository *r,
ds->len = len;
ds->hex_pfx[len] = '\0';
ds->repo = r;
+ ds->bin_pfx.algo = algo ? hash_algo_by_ptr(algo) : GIT_HASH_UNKNOWN;
prepare_alt_odb(r);
return 0;
}
@@ -394,8 +413,10 @@ static int show_ambiguous_object(const struct object_id *oid, void *data)
if (commit) {
struct pretty_print_context pp = {0};
pp.date_mode.type = DATE_SHORT;
- format_commit_message(commit, "%ad", &date, &pp);
- format_commit_message(commit, "%s", &msg, &pp);
+ repo_format_commit_message(the_repository, commit,
+ "%ad", &date, &pp);
+ repo_format_commit_message(the_repository, commit,
+ "%s", &msg, &pp);
}
/*
@@ -473,16 +494,17 @@ static int collect_ambiguous(const struct object_id *oid, void *data)
return 0;
}
-static int repo_collect_ambiguous(struct repository *r,
+static int repo_collect_ambiguous(struct repository *r UNUSED,
const struct object_id *oid,
void *data)
{
return collect_ambiguous(oid, data);
}
-static int sort_ambiguous(const void *a, const void *b, void *ctx)
+static int sort_ambiguous(const void *va, const void *vb, void *ctx)
{
struct repository *sort_ambiguous_repo = ctx;
+ const struct object_id *a = va, *b = vb;
int a_type = oid_object_info(sort_ambiguous_repo, a, NULL);
int b_type = oid_object_info(sort_ambiguous_repo, b, NULL);
int a_type_sort;
@@ -492,8 +514,12 @@ static int sort_ambiguous(const void *a, const void *b, void *ctx)
* Sorts by hash within the same object type, just as
* oid_array_for_each_unique() would do.
*/
- if (a_type == b_type)
- return oidcmp(a, b);
+ if (a_type == b_type) {
+ if (a->algo == b->algo)
+ return oidcmp(a, b);
+ else
+ return a->algo > b->algo ? 1 : -1;
+ }
/*
* Between object types show tags, then commits, and finally
@@ -522,8 +548,12 @@ static enum get_oid_result get_short_oid(struct repository *r,
int status;
struct disambiguate_state ds;
int quietly = !!(flags & GET_OID_QUIETLY);
+ const struct git_hash_algo *algo = r->hash_algo;
- if (init_object_disambiguation(r, name, len, &ds) < 0)
+ if (flags & GET_OID_HASH_ANY)
+ algo = NULL;
+
+ if (init_object_disambiguation(r, name, len, algo, &ds) < 0)
return -1;
if (HAS_MULTI_BITS(flags & GET_OID_DISAMBIGUATORS))
@@ -577,7 +607,7 @@ static enum get_oid_result get_short_oid(struct repository *r,
if (!ds.ambiguous)
ds.fn = NULL;
- repo_for_each_abbrev(r, ds.hex_pfx, collect_ambiguous, &collect);
+ repo_for_each_abbrev(r, ds.hex_pfx, algo, collect_ambiguous, &collect);
sort_ambiguous_oid_array(r, &collect);
if (oid_array_for_each(&collect, show_ambiguous_object, &out))
@@ -599,13 +629,14 @@ static enum get_oid_result get_short_oid(struct repository *r,
}
int repo_for_each_abbrev(struct repository *r, const char *prefix,
+ const struct git_hash_algo *algo,
each_abbrev_fn fn, void *cb_data)
{
struct oid_array collect = OID_ARRAY_INIT;
struct disambiguate_state ds;
int ret;
- if (init_object_disambiguation(r, prefix, strlen(prefix), &ds) < 0)
+ if (init_object_disambiguation(r, prefix, strlen(prefix), algo, &ds) < 0)
return -1;
ds.always_call_fn = 1;
@@ -665,7 +696,7 @@ static int extend_abbrev_len(const struct object_id *oid, void *cb_data)
return 0;
}
-static int repo_extend_abbrev_len(struct repository *r,
+static int repo_extend_abbrev_len(struct repository *r UNUSED,
const struct object_id *oid,
void *cb_data)
{
@@ -758,13 +789,30 @@ static void find_abbrev_len_packed(struct min_abbrev_data *mad)
find_abbrev_len_for_pack(p, mad);
}
+void strbuf_repo_add_unique_abbrev(struct strbuf *sb, struct repository *repo,
+ const struct object_id *oid, int abbrev_len)
+{
+ int r;
+ strbuf_grow(sb, GIT_MAX_HEXSZ + 1);
+ r = repo_find_unique_abbrev_r(repo, sb->buf + sb->len, oid, abbrev_len);
+ strbuf_setlen(sb, sb->len + r);
+}
+
+void strbuf_add_unique_abbrev(struct strbuf *sb, const struct object_id *oid,
+ int abbrev_len)
+{
+ strbuf_repo_add_unique_abbrev(sb, the_repository, oid, abbrev_len);
+}
+
int repo_find_unique_abbrev_r(struct repository *r, char *hex,
const struct object_id *oid, int len)
{
+ const struct git_hash_algo *algo =
+ oid->algo ? &hash_algos[oid->algo] : r->hash_algo;
struct disambiguate_state ds;
struct min_abbrev_data mad;
struct object_id oid_ret;
- const unsigned hexsz = r->hash_algo->hexsz;
+ const unsigned hexsz = algo->hexsz;
if (len < 0) {
unsigned long count = repo_approximate_object_count(r);
@@ -800,7 +848,7 @@ int repo_find_unique_abbrev_r(struct repository *r, char *hex,
find_abbrev_len_packed(&mad);
- if (init_object_disambiguation(r, hex, mad.cur_len, &ds) < 0)
+ if (init_object_disambiguation(r, hex, mad.cur_len, algo, &ds) < 0)
return -1;
ds.fn = repo_extend_abbrev_len;
@@ -898,6 +946,7 @@ static int get_oid_basic(struct repository *r, const char *str, int len,
char *real_ref = NULL;
int refs_found = 0;
int at, reflog_len, nth_prior = 0;
+ int fatal = !(flags & GET_OID_QUIETLY);
if (len == r->hash_algo->hexsz && !get_oid_hex(str, oid)) {
if (warn_ambiguous_refs && warn_on_object_refname_ambiguity) {
@@ -952,11 +1001,11 @@ static int get_oid_basic(struct repository *r, const char *str, int len,
if (!len && reflog_len)
/* allow "@{...}" to mean the current branch reflog */
- refs_found = repo_dwim_ref(r, "HEAD", 4, oid, &real_ref, 0);
+ refs_found = repo_dwim_ref(r, "HEAD", 4, oid, &real_ref, !fatal);
else if (reflog_len)
refs_found = repo_dwim_log(r, str, len, oid, &real_ref);
else
- refs_found = repo_dwim_ref(r, str, len, oid, &real_ref, 0);
+ refs_found = repo_dwim_ref(r, str, len, oid, &real_ref, !fatal);
if (!refs_found)
return -1;
@@ -1009,6 +1058,15 @@ static int get_oid_basic(struct repository *r, const char *str, int len,
len, str,
show_date(co_time, co_tz, DATE_MODE(RFC2822)));
}
+ } else if (nth == co_cnt && !is_null_oid(oid)) {
+ /*
+ * We were asked for the Nth reflog (counting
+ * from 0), but there were only N entries.
+ * read_ref_at() will have returned "1" to tell
+ * us it did not find an entry, but it did
+ * still fill in the oid with the "old" value,
+ * which we can use.
+ */
} else {
if (flags & GET_OID_QUIETLY) {
exit(128);
@@ -1036,7 +1094,7 @@ static enum get_oid_result get_parent(struct repository *r,
if (ret)
return ret;
commit = lookup_commit_reference(r, &oid);
- if (parse_commit(commit))
+ if (repo_parse_commit(r, commit))
return MISSING_OBJECT;
if (!idx) {
oidcpy(result, &commit->object.oid);
@@ -1070,7 +1128,7 @@ static enum get_oid_result get_nth_ancestor(struct repository *r,
return MISSING_OBJECT;
while (generation--) {
- if (parse_commit(commit) || !commit->parents)
+ if (repo_parse_commit(r, commit) || !commit->parents)
return MISSING_OBJECT;
commit = commit->parents->item;
}
@@ -1306,7 +1364,8 @@ struct handle_one_ref_cb {
};
static int handle_one_ref(const char *path, const struct object_id *oid,
- int flag, void *cb_data)
+ int flag UNUSED,
+ void *cb_data)
{
struct handle_one_ref_cb *cb = cb_data;
struct commit_list **list = cb->list;
@@ -1360,10 +1419,10 @@ static int get_oid_oneline(struct repository *r,
commit = pop_most_recent_commit(&list, ONELINE_SEEN);
if (!parse_object(r, &commit->object.oid))
continue;
- buf = get_commit_buffer(commit, NULL);
+ buf = repo_get_commit_buffer(r, commit, NULL);
p = strstr(buf, "\n\n");
matches = negative ^ (p && !regexec(&regex, p + 2, 0, NULL, 0));
- unuse_commit_buffer(commit, buf);
+ repo_unuse_commit_buffer(r, commit, buf);
if (matches) {
oidcpy(oid, &commit->object.oid);
@@ -1384,8 +1443,11 @@ struct grab_nth_branch_switch_cbdata {
struct strbuf *sb;
};
-static int grab_nth_branch_switch(struct object_id *ooid, struct object_id *noid,
- const char *email, timestamp_t timestamp, int tz,
+static int grab_nth_branch_switch(struct object_id *ooid UNUSED,
+ struct object_id *noid UNUSED,
+ const char *email UNUSED,
+ timestamp_t timestamp UNUSED,
+ int tz UNUSED,
const char *message, void *cb_data)
{
struct grab_nth_branch_switch_cbdata *cb = cb_data;
@@ -1450,7 +1512,7 @@ int repo_get_oid_mb(struct repository *r,
struct object_id *oid)
{
struct commit *one, *two;
- struct commit_list *mbs;
+ struct commit_list *mbs = NULL;
struct object_id oid_tmp;
const char *dots;
int st;
@@ -1478,7 +1540,10 @@ int repo_get_oid_mb(struct repository *r,
two = lookup_commit_reference_gently(r, &oid_tmp, 0);
if (!two)
return -1;
- mbs = repo_get_merge_bases(r, one, two);
+ if (repo_get_merge_bases(r, one, two, &mbs) < 0) {
+ free_commit_list(mbs);
+ return -1;
+ }
if (!mbs || mbs->next)
st = -1;
else {
@@ -1662,7 +1727,8 @@ void strbuf_branchname(struct strbuf *sb, const char *name, unsigned allowed)
struct interpret_branch_name_options options = {
.allowed = allowed
};
- int used = interpret_branch_name(name, len, sb, &options);
+ int used = repo_interpret_branch_name(the_repository, name, len, sb,
+ &options);
if (used < 0)
used = 0;
@@ -1715,7 +1781,7 @@ int get_oidf(struct object_id *oid, const char *fmt, ...)
strbuf_vaddf(&sb, fmt, ap);
va_end(ap);
- ret = get_oid(sb.buf, oid);
+ ret = repo_get_oid(the_repository, sb.buf, oid);
strbuf_release(&sb);
return ret;
diff --git a/object-name.h b/object-name.h
new file mode 100644
index 0000000..064ddc9
--- /dev/null
+++ b/object-name.h
@@ -0,0 +1,131 @@
+#ifndef OBJECT_NAME_H
+#define OBJECT_NAME_H
+
+#include "object.h"
+#include "strbuf.h"
+
+struct object_id;
+struct repository;
+
+struct object_context {
+ unsigned short mode;
+ /*
+ * symlink_path is only used by get_tree_entry_follow_symlinks,
+ * and only for symlinks that point outside the repository.
+ */
+ struct strbuf symlink_path;
+ /*
+ * If GET_OID_RECORD_PATH is set, this will record path (if any)
+ * found when resolving the name. The caller is responsible for
+ * releasing the memory.
+ */
+ char *path;
+};
+
+/*
+ * Return an abbreviated sha1 unique within this repository's object database.
+ * The result will be at least `len` characters long, and will be NUL
+ * terminated.
+ *
+ * The non-`_r` version returns a static buffer which remains valid until 4
+ * more calls to repo_find_unique_abbrev are made.
+ *
+ * The `_r` variant writes to a buffer supplied by the caller, which must be at
+ * least `GIT_MAX_HEXSZ + 1` bytes. The return value is the number of bytes
+ * written (excluding the NUL terminator).
+ *
+ * Note that while this version avoids the static buffer, it is not fully
+ * reentrant, as it calls into other non-reentrant git code.
+ */
+const char *repo_find_unique_abbrev(struct repository *r, const struct object_id *oid, int len);
+int repo_find_unique_abbrev_r(struct repository *r, char *hex, const struct object_id *oid, int len);
+
+/**
+ * Add the abbreviation, as generated by repo_find_unique_abbrev(), of `sha1` to
+ * the strbuf `sb`.
+ */
+void strbuf_repo_add_unique_abbrev(struct strbuf *sb, struct repository *repo,
+ const struct object_id *oid, int abbrev_len);
+void strbuf_add_unique_abbrev(struct strbuf *sb, const struct object_id *oid,
+ int abbrev_len);
+
+int repo_get_oid(struct repository *r, const char *str, struct object_id *oid);
+__attribute__((format (printf, 2, 3)))
+int get_oidf(struct object_id *oid, const char *fmt, ...);
+int repo_get_oid_commit(struct repository *r, const char *str, struct object_id *oid);
+int repo_get_oid_committish(struct repository *r, const char *str, struct object_id *oid);
+int repo_get_oid_tree(struct repository *r, const char *str, struct object_id *oid);
+int repo_get_oid_treeish(struct repository *r, const char *str, struct object_id *oid);
+int repo_get_oid_blob(struct repository *r, const char *str, struct object_id *oid);
+int repo_get_oid_mb(struct repository *r, const char *str, struct object_id *oid);
+void maybe_die_on_misspelt_object_name(struct repository *repo,
+ const char *name,
+ const char *prefix);
+enum get_oid_result get_oid_with_context(struct repository *repo, const char *str,
+ unsigned flags, struct object_id *oid,
+ struct object_context *oc);
+
+
+typedef int each_abbrev_fn(const struct object_id *oid, void *);
+int repo_for_each_abbrev(struct repository *r, const char *prefix,
+ const struct git_hash_algo *algo, each_abbrev_fn, void *);
+
+int set_disambiguate_hint_config(const char *var, const char *value);
+
+/*
+ * This reads short-hand syntax that not only evaluates to a commit
+ * object name, but also can act as if the end user spelled the name
+ * of the branch from the command line.
+ *
+ * - "@{-N}" finds the name of the Nth previous branch we were on, and
+ * places the name of the branch in the given buf and returns the
+ * number of characters parsed if successful.
+ *
+ * - "<branch>@{upstream}" finds the name of the other ref that
+ * <branch> is configured to merge with (missing <branch> defaults
+ * to the current branch), and places the name of the branch in the
+ * given buf and returns the number of characters parsed if
+ * successful.
+ *
+ * If the input is not of the accepted format, it returns a negative
+ * number to signal an error.
+ *
+ * If the input was ok but there are not N branch switches in the
+ * reflog, it returns 0.
+ */
+#define INTERPRET_BRANCH_LOCAL (1<<0)
+#define INTERPRET_BRANCH_REMOTE (1<<1)
+#define INTERPRET_BRANCH_HEAD (1<<2)
+struct interpret_branch_name_options {
+ /*
+ * If "allowed" is non-zero, it is a treated as a bitfield of allowable
+ * expansions: local branches ("refs/heads/"), remote branches
+ * ("refs/remotes/"), or "HEAD". If no "allowed" bits are set, any expansion is
+ * allowed, even ones to refs outside of those namespaces.
+ */
+ unsigned allowed;
+
+ /*
+ * If ^{upstream} or ^{push} (or equivalent) is requested, and the
+ * branch in question does not have such a reference, return -1 instead
+ * of die()-ing.
+ */
+ unsigned nonfatal_dangling_mark : 1;
+};
+int repo_interpret_branch_name(struct repository *r,
+ const char *str, int len,
+ struct strbuf *buf,
+ const struct interpret_branch_name_options *options);
+
+struct object *repo_peel_to_type(struct repository *r,
+ const char *name, int namelen,
+ struct object *o, enum object_type);
+
+/* Convert to/from hex/sha1 representation */
+#define MINIMUM_ABBREV minimum_abbrev
+#define DEFAULT_ABBREV default_abbrev
+
+/* used when the code does not know or care what the default abbrev is */
+#define FALLBACK_DEFAULT_ABBREV 7
+
+#endif /* OBJECT_NAME_H */
diff --git a/object-store-ll.h b/object-store-ll.h
new file mode 100644
index 0000000..c5f2bb2
--- /dev/null
+++ b/object-store-ll.h
@@ -0,0 +1,536 @@
+#ifndef OBJECT_STORE_LL_H
+#define OBJECT_STORE_LL_H
+
+#include "hashmap.h"
+#include "object.h"
+#include "list.h"
+#include "thread-utils.h"
+#include "oidset.h"
+
+struct oidmap;
+struct oidtree;
+struct strbuf;
+
+struct object_directory {
+ struct object_directory *next;
+
+ /*
+ * Used to store the results of readdir(3) calls when we are OK
+ * sacrificing accuracy due to races for speed. That includes
+ * object existence with OBJECT_INFO_QUICK, as well as
+ * our search for unique abbreviated hashes. Don't use it for tasks
+ * requiring greater accuracy!
+ *
+ * Be sure to call odb_load_loose_cache() before using.
+ */
+ uint32_t loose_objects_subdir_seen[8]; /* 256 bits */
+ struct oidtree *loose_objects_cache;
+
+ /* Map between object IDs for loose objects. */
+ struct loose_object_map *loose_map;
+
+ /*
+ * This is a temporary object store created by the tmp_objdir
+ * facility. Disable ref updates since the objects in the store
+ * might be discarded on rollback.
+ */
+ int disable_ref_updates;
+
+ /*
+ * This object store is ephemeral, so there is no need to fsync.
+ */
+ int will_destroy;
+
+ /*
+ * Path to the alternative object store. If this is a relative path,
+ * it is relative to the current working directory.
+ */
+ char *path;
+};
+
+struct input_stream {
+ const void *(*read)(struct input_stream *, unsigned long *len);
+ void *data;
+ int is_finished;
+};
+
+void prepare_alt_odb(struct repository *r);
+int has_alt_odb(struct repository *r);
+char *compute_alternate_path(const char *path, struct strbuf *err);
+struct object_directory *find_odb(struct repository *r, const char *obj_dir);
+typedef int alt_odb_fn(struct object_directory *, void *);
+int foreach_alt_odb(alt_odb_fn, void*);
+typedef void alternate_ref_fn(const struct object_id *oid, void *);
+void for_each_alternate_ref(alternate_ref_fn, void *);
+
+/*
+ * Add the directory to the on-disk alternates file; the new entry will also
+ * take effect in the current process.
+ */
+void add_to_alternates_file(const char *dir);
+
+/*
+ * Add the directory to the in-memory list of alternates (along with any
+ * recursive alternates it points to), but do not modify the on-disk alternates
+ * file.
+ */
+void add_to_alternates_memory(const char *dir);
+
+/*
+ * Replace the current writable object directory with the specified temporary
+ * object directory; returns the former primary object directory.
+ */
+struct object_directory *set_temporary_primary_odb(const char *dir, int will_destroy);
+
+/*
+ * Restore a previous ODB replaced by set_temporary_main_odb.
+ */
+void restore_primary_odb(struct object_directory *restore_odb, const char *old_path);
+
+/*
+ * Populate and return the loose object cache array corresponding to the
+ * given object ID.
+ */
+struct oidtree *odb_loose_cache(struct object_directory *odb,
+ const struct object_id *oid);
+
+/* Empty the loose object cache for the specified object directory. */
+void odb_clear_loose_cache(struct object_directory *odb);
+
+/* Clear and free the specified object directory */
+void free_object_directory(struct object_directory *odb);
+
+struct packed_git {
+ struct hashmap_entry packmap_ent;
+ struct packed_git *next;
+ struct list_head mru;
+ struct pack_window *windows;
+ off_t pack_size;
+ const void *index_data;
+ size_t index_size;
+ uint32_t num_objects;
+ size_t crc_offset;
+ struct oidset bad_objects;
+ int index_version;
+ time_t mtime;
+ int pack_fd;
+ int index; /* for builtin/pack-objects.c */
+ unsigned pack_local:1,
+ pack_keep:1,
+ pack_keep_in_core:1,
+ freshened:1,
+ do_not_close:1,
+ pack_promisor:1,
+ multi_pack_index:1,
+ is_cruft:1;
+ unsigned char hash[GIT_MAX_RAWSZ];
+ struct revindex_entry *revindex;
+ const uint32_t *revindex_data;
+ const uint32_t *revindex_map;
+ size_t revindex_size;
+ /*
+ * mtimes_map points at the beginning of the memory mapped region of
+ * this pack's corresponding .mtimes file, and mtimes_size is the size
+ * of that .mtimes file
+ */
+ const uint32_t *mtimes_map;
+ size_t mtimes_size;
+ /* something like ".git/objects/pack/xxxxx.pack" */
+ char pack_name[FLEX_ARRAY]; /* more */
+};
+
+struct multi_pack_index;
+
+static inline int pack_map_entry_cmp(const void *cmp_data UNUSED,
+ const struct hashmap_entry *entry,
+ const struct hashmap_entry *entry2,
+ const void *keydata)
+{
+ const char *key = keydata;
+ const struct packed_git *pg1, *pg2;
+
+ pg1 = container_of(entry, const struct packed_git, packmap_ent);
+ pg2 = container_of(entry2, const struct packed_git, packmap_ent);
+
+ return strcmp(pg1->pack_name, key ? key : pg2->pack_name);
+}
+
+struct raw_object_store {
+ /*
+ * Set of all object directories; the main directory is first (and
+ * cannot be NULL after initialization). Subsequent directories are
+ * alternates.
+ */
+ struct object_directory *odb;
+ struct object_directory **odb_tail;
+ struct kh_odb_path_map *odb_by_path;
+
+ int loaded_alternates;
+
+ /*
+ * A list of alternate object directories loaded from the environment;
+ * this should not generally need to be accessed directly, but will
+ * populate the "odb" list when prepare_alt_odb() is run.
+ */
+ char *alternate_db;
+
+ /*
+ * Objects that should be substituted by other objects
+ * (see git-replace(1)).
+ */
+ struct oidmap *replace_map;
+ unsigned replace_map_initialized : 1;
+ pthread_mutex_t replace_mutex; /* protect object replace functions */
+
+ struct commit_graph *commit_graph;
+ unsigned commit_graph_attempted : 1; /* if loading has been attempted */
+
+ /*
+ * private data
+ *
+ * should only be accessed directly by packfile.c and midx.c
+ */
+ struct multi_pack_index *multi_pack_index;
+
+ /*
+ * private data
+ *
+ * should only be accessed directly by packfile.c
+ */
+
+ struct packed_git *packed_git;
+ /* A most-recently-used ordered version of the packed_git list. */
+ struct list_head packed_git_mru;
+
+ struct {
+ struct packed_git **packs;
+ unsigned flags;
+ } kept_pack_cache;
+
+ /*
+ * A map of packfiles to packed_git structs for tracking which
+ * packs have been loaded already.
+ */
+ struct hashmap pack_map;
+
+ /*
+ * A fast, rough count of the number of objects in the repository.
+ * These two fields are not meant for direct access. Use
+ * repo_approximate_object_count() instead.
+ */
+ unsigned long approximate_object_count;
+ unsigned approximate_object_count_valid : 1;
+
+ /*
+ * Whether packed_git has already been populated with this repository's
+ * packs.
+ */
+ unsigned packed_git_initialized : 1;
+};
+
+struct raw_object_store *raw_object_store_new(void);
+void raw_object_store_clear(struct raw_object_store *o);
+
+/*
+ * Put in `buf` the name of the file in the local object database that
+ * would be used to store a loose object with the specified oid.
+ */
+const char *loose_object_path(struct repository *r, struct strbuf *buf,
+ const struct object_id *oid);
+
+void *map_loose_object(struct repository *r, const struct object_id *oid,
+ unsigned long *size);
+
+void *repo_read_object_file(struct repository *r,
+ const struct object_id *oid,
+ enum object_type *type,
+ unsigned long *size);
+
+/* Read and unpack an object file into memory, write memory to an object file */
+int oid_object_info(struct repository *r, const struct object_id *, unsigned long *);
+
+void hash_object_file(const struct git_hash_algo *algo, const void *buf,
+ unsigned long len, enum object_type type,
+ struct object_id *oid);
+
+int write_object_file_flags(const void *buf, unsigned long len,
+ enum object_type type, struct object_id *oid,
+ struct object_id *comapt_oid_in, unsigned flags);
+static inline int write_object_file(const void *buf, unsigned long len,
+ enum object_type type, struct object_id *oid)
+{
+ return write_object_file_flags(buf, len, type, oid, NULL, 0);
+}
+
+int write_object_file_literally(const void *buf, unsigned long len,
+ const char *type, struct object_id *oid,
+ unsigned flags);
+int stream_loose_object(struct input_stream *in_stream, size_t len,
+ struct object_id *oid);
+
+/*
+ * Add an object file to the in-memory object store, without writing it
+ * to disk.
+ *
+ * Callers are responsible for calling write_object_file to record the
+ * object in persistent storage before writing any other new objects
+ * that reference it.
+ */
+int pretend_object_file(void *, unsigned long, enum object_type,
+ struct object_id *oid);
+
+int force_object_loose(const struct object_id *oid, time_t mtime);
+
+struct object_info {
+ /* Request */
+ enum object_type *typep;
+ unsigned long *sizep;
+ off_t *disk_sizep;
+ struct object_id *delta_base_oid;
+ struct strbuf *type_name;
+ void **contentp;
+
+ /* Response */
+ enum {
+ OI_CACHED,
+ OI_LOOSE,
+ OI_PACKED,
+ OI_DBCACHED
+ } whence;
+ union {
+ /*
+ * struct {
+ * ... Nothing to expose in this case
+ * } cached;
+ * struct {
+ * ... Nothing to expose in this case
+ * } loose;
+ */
+ struct {
+ struct packed_git *pack;
+ off_t offset;
+ unsigned int is_delta;
+ } packed;
+ } u;
+};
+
+/*
+ * Initializer for a "struct object_info" that wants no items. You may
+ * also memset() the memory to all-zeroes.
+ */
+#define OBJECT_INFO_INIT { 0 }
+
+/* Invoke lookup_replace_object() on the given hash */
+#define OBJECT_INFO_LOOKUP_REPLACE 1
+/* Allow reading from a loose object file of unknown/bogus type */
+#define OBJECT_INFO_ALLOW_UNKNOWN_TYPE 2
+/* Do not retry packed storage after checking packed and loose storage */
+#define OBJECT_INFO_QUICK 8
+/*
+ * Do not attempt to fetch the object if missing (even if fetch_is_missing is
+ * nonzero).
+ */
+#define OBJECT_INFO_SKIP_FETCH_OBJECT 16
+/*
+ * This is meant for bulk prefetching of missing blobs in a partial
+ * clone. Implies OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK
+ */
+#define OBJECT_INFO_FOR_PREFETCH (OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK)
+
+/* Die if object corruption (not just an object being missing) was detected. */
+#define OBJECT_INFO_DIE_IF_CORRUPT 32
+
+int oid_object_info_extended(struct repository *r,
+ const struct object_id *,
+ struct object_info *, unsigned flags);
+
+/*
+ * Open the loose object at path, check its hash, and return the contents,
+ * use the "oi" argument to assert things about the object, or e.g. populate its
+ * type, and size. If the object is a blob, then "contents" may return NULL,
+ * to allow streaming of large blobs.
+ *
+ * Returns 0 on success, negative on error (details may be written to stderr).
+ */
+int read_loose_object(const char *path,
+ const struct object_id *expected_oid,
+ struct object_id *real_oid,
+ void **contents,
+ struct object_info *oi);
+
+/* Retry packed storage after checking packed and loose storage */
+#define HAS_OBJECT_RECHECK_PACKED 1
+
+/*
+ * Returns 1 if the object exists. This function will not lazily fetch objects
+ * in a partial clone.
+ */
+int has_object(struct repository *r, const struct object_id *oid,
+ unsigned flags);
+
+/*
+ * These macros and functions are deprecated. If checking existence for an
+ * object that is likely to be missing and/or whose absence is relatively
+ * inconsequential (or is consequential but the caller is prepared to handle
+ * it), use has_object(), which has better defaults (no lazy fetch in a partial
+ * clone and no rechecking of packed storage). In the unlikely event that a
+ * caller needs to assert existence of an object that it fully expects to
+ * exist, and wants to trigger a lazy fetch in a partial clone, use
+ * oid_object_info_extended() with a NULL struct object_info.
+ *
+ * These functions can be removed once all callers have migrated to
+ * has_object() and/or oid_object_info_extended().
+ */
+int repo_has_object_file(struct repository *r, const struct object_id *oid);
+int repo_has_object_file_with_flags(struct repository *r,
+ const struct object_id *oid, int flags);
+
+/*
+ * Return true iff an alternate object database has a loose object
+ * with the specified name. This function does not respect replace
+ * references.
+ */
+int has_loose_object_nonlocal(const struct object_id *);
+
+int has_loose_object(const struct object_id *);
+
+/**
+ * format_object_header() is a thin wrapper around s xsnprintf() that
+ * writes the initial "<type> <obj-len>" part of the loose object
+ * header. It returns the size that snprintf() returns + 1.
+ */
+int format_object_header(char *str, size_t size, enum object_type type,
+ size_t objsize);
+
+void assert_oid_type(const struct object_id *oid, enum object_type expect);
+
+/*
+ * Enabling the object read lock allows multiple threads to safely call the
+ * following functions in parallel: repo_read_object_file(),
+ * read_object_with_reference(), oid_object_info() and oid_object_info_extended().
+ *
+ * obj_read_lock() and obj_read_unlock() may also be used to protect other
+ * section which cannot execute in parallel with object reading. Since the used
+ * lock is a recursive mutex, these sections can even contain calls to object
+ * reading functions. However, beware that in these cases zlib inflation won't
+ * be performed in parallel, losing performance.
+ *
+ * TODO: oid_object_info_extended()'s call stack has a recursive behavior. If
+ * any of its callees end up calling it, this recursive call won't benefit from
+ * parallel inflation.
+ */
+void enable_obj_read_lock(void);
+void disable_obj_read_lock(void);
+
+extern int obj_read_use_lock;
+extern pthread_mutex_t obj_read_mutex;
+
+static inline void obj_read_lock(void)
+{
+ if(obj_read_use_lock)
+ pthread_mutex_lock(&obj_read_mutex);
+}
+
+static inline void obj_read_unlock(void)
+{
+ if(obj_read_use_lock)
+ pthread_mutex_unlock(&obj_read_mutex);
+}
+
+/*
+ * Iterate over the files in the loose-object parts of the object
+ * directory "path", triggering the following callbacks:
+ *
+ * - loose_object is called for each loose object we find.
+ *
+ * - loose_cruft is called for any files that do not appear to be
+ * loose objects. Note that we only look in the loose object
+ * directories "objects/[0-9a-f]{2}/", so we will not report
+ * "objects/foobar" as cruft.
+ *
+ * - loose_subdir is called for each top-level hashed subdirectory
+ * of the object directory (e.g., "$OBJDIR/f0"). It is called
+ * after the objects in the directory are processed.
+ *
+ * Any callback that is NULL will be ignored. Callbacks returning non-zero
+ * will end the iteration.
+ *
+ * In the "buf" variant, "path" is a strbuf which will also be used as a
+ * scratch buffer, but restored to its original contents before
+ * the function returns.
+ */
+typedef int each_loose_object_fn(const struct object_id *oid,
+ const char *path,
+ void *data);
+typedef int each_loose_cruft_fn(const char *basename,
+ const char *path,
+ void *data);
+typedef int each_loose_subdir_fn(unsigned int nr,
+ const char *path,
+ void *data);
+int for_each_file_in_obj_subdir(unsigned int subdir_nr,
+ struct strbuf *path,
+ each_loose_object_fn obj_cb,
+ each_loose_cruft_fn cruft_cb,
+ each_loose_subdir_fn subdir_cb,
+ void *data);
+int for_each_loose_file_in_objdir(const char *path,
+ each_loose_object_fn obj_cb,
+ each_loose_cruft_fn cruft_cb,
+ each_loose_subdir_fn subdir_cb,
+ void *data);
+int for_each_loose_file_in_objdir_buf(struct strbuf *path,
+ each_loose_object_fn obj_cb,
+ each_loose_cruft_fn cruft_cb,
+ each_loose_subdir_fn subdir_cb,
+ void *data);
+
+/* Flags for for_each_*_object() below. */
+enum for_each_object_flags {
+ /* Iterate only over local objects, not alternates. */
+ FOR_EACH_OBJECT_LOCAL_ONLY = (1<<0),
+
+ /* Only iterate over packs obtained from the promisor remote. */
+ FOR_EACH_OBJECT_PROMISOR_ONLY = (1<<1),
+
+ /*
+ * Visit objects within a pack in packfile order rather than .idx order
+ */
+ FOR_EACH_OBJECT_PACK_ORDER = (1<<2),
+
+ /* Only iterate over packs that are not marked as kept in-core. */
+ FOR_EACH_OBJECT_SKIP_IN_CORE_KEPT_PACKS = (1<<3),
+
+ /* Only iterate over packs that do not have .keep files. */
+ FOR_EACH_OBJECT_SKIP_ON_DISK_KEPT_PACKS = (1<<4),
+};
+
+/*
+ * Iterate over all accessible loose objects without respect to
+ * reachability. By default, this includes both local and alternate objects.
+ * The order in which objects are visited is unspecified.
+ *
+ * Any flags specific to packs are ignored.
+ */
+int for_each_loose_object(each_loose_object_fn, void *,
+ enum for_each_object_flags flags);
+
+/*
+ * Iterate over all accessible packed objects without respect to reachability.
+ * By default, this includes both local and alternate packs.
+ *
+ * Note that some objects may appear twice if they are found in multiple packs.
+ * Each pack is visited in an unspecified order. By default, objects within a
+ * pack are visited in pack-idx order (i.e., sorted by oid).
+ */
+typedef int each_packed_object_fn(const struct object_id *oid,
+ struct packed_git *pack,
+ uint32_t pos,
+ void *data);
+int for_each_object_in_pack(struct packed_git *p,
+ each_packed_object_fn, void *data,
+ enum for_each_object_flags flags);
+int for_each_packed_object(each_packed_object_fn, void *,
+ enum for_each_object_flags flags);
+
+#endif /* OBJECT_STORE_LL_H */
diff --git a/object-store.h b/object-store.h
index 539ea43..1b3e3d7 100644
--- a/object-store.h
+++ b/object-store.h
@@ -1,542 +1,11 @@
#ifndef OBJECT_STORE_H
#define OBJECT_STORE_H
-#include "cache.h"
-#include "oidmap.h"
-#include "list.h"
-#include "oid-array.h"
-#include "strbuf.h"
-#include "thread-utils.h"
#include "khash.h"
#include "dir.h"
-#include "oidtree.h"
-#include "oidset.h"
-
-struct object_directory {
- struct object_directory *next;
-
- /*
- * Used to store the results of readdir(3) calls when we are OK
- * sacrificing accuracy due to races for speed. That includes
- * object existence with OBJECT_INFO_QUICK, as well as
- * our search for unique abbreviated hashes. Don't use it for tasks
- * requiring greater accuracy!
- *
- * Be sure to call odb_load_loose_cache() before using.
- */
- uint32_t loose_objects_subdir_seen[8]; /* 256 bits */
- struct oidtree *loose_objects_cache;
-
- /*
- * This is a temporary object store created by the tmp_objdir
- * facility. Disable ref updates since the objects in the store
- * might be discarded on rollback.
- */
- int disable_ref_updates;
-
- /*
- * This object store is ephemeral, so there is no need to fsync.
- */
- int will_destroy;
-
- /*
- * Path to the alternative object store. If this is a relative path,
- * it is relative to the current working directory.
- */
- char *path;
-};
+#include "object-store-ll.h"
KHASH_INIT(odb_path_map, const char * /* key: odb_path */,
struct object_directory *, 1, fspathhash, fspatheq)
-void prepare_alt_odb(struct repository *r);
-char *compute_alternate_path(const char *path, struct strbuf *err);
-struct object_directory *find_odb(struct repository *r, const char *obj_dir);
-typedef int alt_odb_fn(struct object_directory *, void *);
-int foreach_alt_odb(alt_odb_fn, void*);
-typedef void alternate_ref_fn(const struct object_id *oid, void *);
-void for_each_alternate_ref(alternate_ref_fn, void *);
-
-/*
- * Add the directory to the on-disk alternates file; the new entry will also
- * take effect in the current process.
- */
-void add_to_alternates_file(const char *dir);
-
-/*
- * Add the directory to the in-memory list of alternates (along with any
- * recursive alternates it points to), but do not modify the on-disk alternates
- * file.
- */
-void add_to_alternates_memory(const char *dir);
-
-/*
- * Replace the current writable object directory with the specified temporary
- * object directory; returns the former primary object directory.
- */
-struct object_directory *set_temporary_primary_odb(const char *dir, int will_destroy);
-
-/*
- * Restore a previous ODB replaced by set_temporary_main_odb.
- */
-void restore_primary_odb(struct object_directory *restore_odb, const char *old_path);
-
-/*
- * Populate and return the loose object cache array corresponding to the
- * given object ID.
- */
-struct oidtree *odb_loose_cache(struct object_directory *odb,
- const struct object_id *oid);
-
-/* Empty the loose object cache for the specified object directory. */
-void odb_clear_loose_cache(struct object_directory *odb);
-
-/* Clear and free the specified object directory */
-void free_object_directory(struct object_directory *odb);
-
-struct packed_git {
- struct hashmap_entry packmap_ent;
- struct packed_git *next;
- struct list_head mru;
- struct pack_window *windows;
- off_t pack_size;
- const void *index_data;
- size_t index_size;
- uint32_t num_objects;
- uint32_t crc_offset;
- struct oidset bad_objects;
- int index_version;
- time_t mtime;
- int pack_fd;
- int index; /* for builtin/pack-objects.c */
- unsigned pack_local:1,
- pack_keep:1,
- pack_keep_in_core:1,
- freshened:1,
- do_not_close:1,
- pack_promisor:1,
- multi_pack_index:1,
- is_cruft:1;
- unsigned char hash[GIT_MAX_RAWSZ];
- struct revindex_entry *revindex;
- const uint32_t *revindex_data;
- const uint32_t *revindex_map;
- size_t revindex_size;
- /*
- * mtimes_map points at the beginning of the memory mapped region of
- * this pack's corresponding .mtimes file, and mtimes_size is the size
- * of that .mtimes file
- */
- const uint32_t *mtimes_map;
- size_t mtimes_size;
- /* something like ".git/objects/pack/xxxxx.pack" */
- char pack_name[FLEX_ARRAY]; /* more */
-};
-
-struct multi_pack_index;
-
-static inline int pack_map_entry_cmp(const void *unused_cmp_data,
- const struct hashmap_entry *entry,
- const struct hashmap_entry *entry2,
- const void *keydata)
-{
- const char *key = keydata;
- const struct packed_git *pg1, *pg2;
-
- pg1 = container_of(entry, const struct packed_git, packmap_ent);
- pg2 = container_of(entry2, const struct packed_git, packmap_ent);
-
- return strcmp(pg1->pack_name, key ? key : pg2->pack_name);
-}
-
-struct raw_object_store {
- /*
- * Set of all object directories; the main directory is first (and
- * cannot be NULL after initialization). Subsequent directories are
- * alternates.
- */
- struct object_directory *odb;
- struct object_directory **odb_tail;
- kh_odb_path_map_t *odb_by_path;
-
- int loaded_alternates;
-
- /*
- * A list of alternate object directories loaded from the environment;
- * this should not generally need to be accessed directly, but will
- * populate the "odb" list when prepare_alt_odb() is run.
- */
- char *alternate_db;
-
- /*
- * Objects that should be substituted by other objects
- * (see git-replace(1)).
- */
- struct oidmap *replace_map;
- unsigned replace_map_initialized : 1;
- pthread_mutex_t replace_mutex; /* protect object replace functions */
-
- struct commit_graph *commit_graph;
- unsigned commit_graph_attempted : 1; /* if loading has been attempted */
-
- /*
- * private data
- *
- * should only be accessed directly by packfile.c and midx.c
- */
- struct multi_pack_index *multi_pack_index;
-
- /*
- * private data
- *
- * should only be accessed directly by packfile.c
- */
-
- struct packed_git *packed_git;
- /* A most-recently-used ordered version of the packed_git list. */
- struct list_head packed_git_mru;
-
- struct {
- struct packed_git **packs;
- unsigned flags;
- } kept_pack_cache;
-
- /*
- * A map of packfiles to packed_git structs for tracking which
- * packs have been loaded already.
- */
- struct hashmap pack_map;
-
- /*
- * A fast, rough count of the number of objects in the repository.
- * These two fields are not meant for direct access. Use
- * approximate_object_count() instead.
- */
- unsigned long approximate_object_count;
- unsigned approximate_object_count_valid : 1;
-
- /*
- * Whether packed_git has already been populated with this repository's
- * packs.
- */
- unsigned packed_git_initialized : 1;
-};
-
-struct raw_object_store *raw_object_store_new(void);
-void raw_object_store_clear(struct raw_object_store *o);
-
-/*
- * Put in `buf` the name of the file in the local object database that
- * would be used to store a loose object with the specified oid.
- */
-const char *loose_object_path(struct repository *r, struct strbuf *buf,
- const struct object_id *oid);
-
-void *map_loose_object(struct repository *r, const struct object_id *oid,
- unsigned long *size);
-
-void *read_object_file_extended(struct repository *r,
- const struct object_id *oid,
- enum object_type *type,
- unsigned long *size, int lookup_replace);
-static inline void *repo_read_object_file(struct repository *r,
- const struct object_id *oid,
- enum object_type *type,
- unsigned long *size)
-{
- return read_object_file_extended(r, oid, type, size, 1);
-}
-#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
-#define read_object_file(oid, type, size) repo_read_object_file(the_repository, oid, type, size)
-#endif
-
-/* Read and unpack an object file into memory, write memory to an object file */
-int oid_object_info(struct repository *r, const struct object_id *, unsigned long *);
-
-void hash_object_file(const struct git_hash_algo *algo, const void *buf,
- unsigned long len, enum object_type type,
- struct object_id *oid);
-
-int write_object_file_flags(const void *buf, unsigned long len,
- enum object_type type, struct object_id *oid,
- unsigned flags);
-static inline int write_object_file(const void *buf, unsigned long len,
- enum object_type type, struct object_id *oid)
-{
- return write_object_file_flags(buf, len, type, oid, 0);
-}
-
-int write_object_file_literally(const void *buf, unsigned long len,
- const char *type, struct object_id *oid,
- unsigned flags);
-
-/*
- * Add an object file to the in-memory object store, without writing it
- * to disk.
- *
- * Callers are responsible for calling write_object_file to record the
- * object in persistent storage before writing any other new objects
- * that reference it.
- */
-int pretend_object_file(void *, unsigned long, enum object_type,
- struct object_id *oid);
-
-int force_object_loose(const struct object_id *oid, time_t mtime);
-
-/*
- * Open the loose object at path, check its hash, and return the contents,
- * use the "oi" argument to assert things about the object, or e.g. populate its
- * type, and size. If the object is a blob, then "contents" may return NULL,
- * to allow streaming of large blobs.
- *
- * Returns 0 on success, negative on error (details may be written to stderr).
- */
-int read_loose_object(const char *path,
- const struct object_id *expected_oid,
- struct object_id *real_oid,
- void **contents,
- struct object_info *oi);
-
-/* Retry packed storage after checking packed and loose storage */
-#define HAS_OBJECT_RECHECK_PACKED 1
-
-/*
- * Returns 1 if the object exists. This function will not lazily fetch objects
- * in a partial clone.
- */
-int has_object(struct repository *r, const struct object_id *oid,
- unsigned flags);
-
-/*
- * These macros and functions are deprecated. If checking existence for an
- * object that is likely to be missing and/or whose absence is relatively
- * inconsequential (or is consequential but the caller is prepared to handle
- * it), use has_object(), which has better defaults (no lazy fetch in a partial
- * clone and no rechecking of packed storage). In the unlikely event that a
- * caller needs to assert existence of an object that it fully expects to
- * exist, and wants to trigger a lazy fetch in a partial clone, use
- * oid_object_info_extended() with a NULL struct object_info.
- *
- * These functions can be removed once all callers have migrated to
- * has_object() and/or oid_object_info_extended().
- */
-int repo_has_object_file(struct repository *r, const struct object_id *oid);
-int repo_has_object_file_with_flags(struct repository *r,
- const struct object_id *oid, int flags);
-#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
-#define has_object_file(oid) repo_has_object_file(the_repository, oid)
-#define has_object_file_with_flags(oid, flags) repo_has_object_file_with_flags(the_repository, oid, flags)
-#endif
-
-/*
- * Return true iff an alternate object database has a loose object
- * with the specified name. This function does not respect replace
- * references.
- */
-int has_loose_object_nonlocal(const struct object_id *);
-
-int has_loose_object(const struct object_id *);
-
-/**
- * format_object_header() is a thin wrapper around s xsnprintf() that
- * writes the initial "<type> <obj-len>" part of the loose object
- * header. It returns the size that snprintf() returns + 1.
- */
-int format_object_header(char *str, size_t size, enum object_type type,
- size_t objsize);
-
-void assert_oid_type(const struct object_id *oid, enum object_type expect);
-
-/*
- * Enabling the object read lock allows multiple threads to safely call the
- * following functions in parallel: repo_read_object_file(), read_object_file(),
- * read_object_file_extended(), read_object_with_reference(), read_object(),
- * oid_object_info() and oid_object_info_extended().
- *
- * obj_read_lock() and obj_read_unlock() may also be used to protect other
- * section which cannot execute in parallel with object reading. Since the used
- * lock is a recursive mutex, these sections can even contain calls to object
- * reading functions. However, beware that in these cases zlib inflation won't
- * be performed in parallel, losing performance.
- *
- * TODO: oid_object_info_extended()'s call stack has a recursive behavior. If
- * any of its callees end up calling it, this recursive call won't benefit from
- * parallel inflation.
- */
-void enable_obj_read_lock(void);
-void disable_obj_read_lock(void);
-
-extern int obj_read_use_lock;
-extern pthread_mutex_t obj_read_mutex;
-
-static inline void obj_read_lock(void)
-{
- if(obj_read_use_lock)
- pthread_mutex_lock(&obj_read_mutex);
-}
-
-static inline void obj_read_unlock(void)
-{
- if(obj_read_use_lock)
- pthread_mutex_unlock(&obj_read_mutex);
-}
-
-struct object_info {
- /* Request */
- enum object_type *typep;
- unsigned long *sizep;
- off_t *disk_sizep;
- struct object_id *delta_base_oid;
- struct strbuf *type_name;
- void **contentp;
-
- /* Response */
- enum {
- OI_CACHED,
- OI_LOOSE,
- OI_PACKED,
- OI_DBCACHED
- } whence;
- union {
- /*
- * struct {
- * ... Nothing to expose in this case
- * } cached;
- * struct {
- * ... Nothing to expose in this case
- * } loose;
- */
- struct {
- struct packed_git *pack;
- off_t offset;
- unsigned int is_delta;
- } packed;
- } u;
-};
-
-/*
- * Initializer for a "struct object_info" that wants no items. You may
- * also memset() the memory to all-zeroes.
- */
-#define OBJECT_INFO_INIT { 0 }
-
-/* Invoke lookup_replace_object() on the given hash */
-#define OBJECT_INFO_LOOKUP_REPLACE 1
-/* Allow reading from a loose object file of unknown/bogus type */
-#define OBJECT_INFO_ALLOW_UNKNOWN_TYPE 2
-/* Do not retry packed storage after checking packed and loose storage */
-#define OBJECT_INFO_QUICK 8
-/* Do not check loose object */
-#define OBJECT_INFO_IGNORE_LOOSE 16
-/*
- * Do not attempt to fetch the object if missing (even if fetch_is_missing is
- * nonzero).
- */
-#define OBJECT_INFO_SKIP_FETCH_OBJECT 32
-/*
- * This is meant for bulk prefetching of missing blobs in a partial
- * clone. Implies OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK
- */
-#define OBJECT_INFO_FOR_PREFETCH (OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK)
-
-int oid_object_info_extended(struct repository *r,
- const struct object_id *,
- struct object_info *, unsigned flags);
-
-/*
- * Iterate over the files in the loose-object parts of the object
- * directory "path", triggering the following callbacks:
- *
- * - loose_object is called for each loose object we find.
- *
- * - loose_cruft is called for any files that do not appear to be
- * loose objects. Note that we only look in the loose object
- * directories "objects/[0-9a-f]{2}/", so we will not report
- * "objects/foobar" as cruft.
- *
- * - loose_subdir is called for each top-level hashed subdirectory
- * of the object directory (e.g., "$OBJDIR/f0"). It is called
- * after the objects in the directory are processed.
- *
- * Any callback that is NULL will be ignored. Callbacks returning non-zero
- * will end the iteration.
- *
- * In the "buf" variant, "path" is a strbuf which will also be used as a
- * scratch buffer, but restored to its original contents before
- * the function returns.
- */
-typedef int each_loose_object_fn(const struct object_id *oid,
- const char *path,
- void *data);
-typedef int each_loose_cruft_fn(const char *basename,
- const char *path,
- void *data);
-typedef int each_loose_subdir_fn(unsigned int nr,
- const char *path,
- void *data);
-int for_each_file_in_obj_subdir(unsigned int subdir_nr,
- struct strbuf *path,
- each_loose_object_fn obj_cb,
- each_loose_cruft_fn cruft_cb,
- each_loose_subdir_fn subdir_cb,
- void *data);
-int for_each_loose_file_in_objdir(const char *path,
- each_loose_object_fn obj_cb,
- each_loose_cruft_fn cruft_cb,
- each_loose_subdir_fn subdir_cb,
- void *data);
-int for_each_loose_file_in_objdir_buf(struct strbuf *path,
- each_loose_object_fn obj_cb,
- each_loose_cruft_fn cruft_cb,
- each_loose_subdir_fn subdir_cb,
- void *data);
-
-/* Flags for for_each_*_object() below. */
-enum for_each_object_flags {
- /* Iterate only over local objects, not alternates. */
- FOR_EACH_OBJECT_LOCAL_ONLY = (1<<0),
-
- /* Only iterate over packs obtained from the promisor remote. */
- FOR_EACH_OBJECT_PROMISOR_ONLY = (1<<1),
-
- /*
- * Visit objects within a pack in packfile order rather than .idx order
- */
- FOR_EACH_OBJECT_PACK_ORDER = (1<<2),
-
- /* Only iterate over packs that are not marked as kept in-core. */
- FOR_EACH_OBJECT_SKIP_IN_CORE_KEPT_PACKS = (1<<3),
-
- /* Only iterate over packs that do not have .keep files. */
- FOR_EACH_OBJECT_SKIP_ON_DISK_KEPT_PACKS = (1<<4),
-};
-
-/*
- * Iterate over all accessible loose objects without respect to
- * reachability. By default, this includes both local and alternate objects.
- * The order in which objects are visited is unspecified.
- *
- * Any flags specific to packs are ignored.
- */
-int for_each_loose_object(each_loose_object_fn, void *,
- enum for_each_object_flags flags);
-
-/*
- * Iterate over all accessible packed objects without respect to reachability.
- * By default, this includes both local and alternate packs.
- *
- * Note that some objects may appear twice if they are found in multiple packs.
- * Each pack is visited in an unspecified order. By default, objects within a
- * pack are visited in pack-idx order (i.e., sorted by oid).
- */
-typedef int each_packed_object_fn(const struct object_id *oid,
- struct packed_git *pack,
- uint32_t pos,
- void *data);
-int for_each_object_in_pack(struct packed_git *p,
- each_packed_object_fn, void *data,
- enum for_each_object_flags flags);
-int for_each_packed_object(each_packed_object_fn, void *,
- enum for_each_object_flags flags);
-
#endif /* OBJECT_STORE_H */
diff --git a/object.c b/object.c
index 588b815..51e3848 100644
--- a/object.c
+++ b/object.c
@@ -1,14 +1,19 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "gettext.h"
+#include "hex.h"
#include "object.h"
#include "replace-object.h"
+#include "object-file.h"
#include "object-store.h"
#include "blob.h"
+#include "statinfo.h"
#include "tree.h"
#include "commit.h"
#include "tag.h"
#include "alloc.h"
#include "packfile.h"
#include "commit-graph.h"
+#include "loose.h"
unsigned int get_max_object_index(void)
{
@@ -43,8 +48,7 @@ int type_from_string_gently(const char *str, ssize_t len, int gentle)
len = strlen(str);
for (i = 1; i < ARRAY_SIZE(object_type_strings); i++)
- if (!strncmp(str, object_type_strings[i], len) &&
- object_type_strings[i][len] == '\0')
+ if (!xstrncmpz(object_type_strings[i], str, len))
return i;
if (gentle)
@@ -212,8 +216,7 @@ struct object *parse_object_buffer(struct repository *r, const struct object_id
if (type == OBJ_BLOB) {
struct blob *blob = lookup_blob(r, oid);
if (blob) {
- if (parse_blob_buffer(blob, buffer, size))
- return NULL;
+ parse_blob_buffer(blob);
obj = &blob->object;
}
} else if (type == OBJ_TREE) {
@@ -233,7 +236,8 @@ struct object *parse_object_buffer(struct repository *r, const struct object_id
if (commit) {
if (parse_commit_buffer(r, commit, buffer, size, 1))
return NULL;
- if (!get_cached_commit_buffer(r, commit, NULL)) {
+ if (save_commit_buffer &&
+ !get_cached_commit_buffer(r, commit, NULL)) {
set_commit_buffer(r, commit, buffer, size);
*eaten_p = 1;
}
@@ -263,8 +267,12 @@ struct object *parse_object_or_die(const struct object_id *oid,
die(_("unable to parse object: %s"), name ? name : oid_to_hex(oid));
}
-struct object *parse_object(struct repository *r, const struct object_id *oid)
+struct object *parse_object_with_flags(struct repository *r,
+ const struct object_id *oid,
+ enum parse_object_flags flags)
{
+ int skip_hash = !!(flags & PARSE_OBJECT_SKIP_HASH_CHECK);
+ int discard_tree = !!(flags & PARSE_OBJECT_DISCARD_TREE);
unsigned long size;
enum object_type type;
int eaten;
@@ -276,20 +284,37 @@ struct object *parse_object(struct repository *r, const struct object_id *oid)
if (obj && obj->parsed)
return obj;
- if ((obj && obj->type == OBJ_BLOB && repo_has_object_file(r, oid)) ||
- (!obj && repo_has_object_file(r, oid) &&
- oid_object_info(r, oid, NULL) == OBJ_BLOB)) {
- if (stream_object_signature(r, repl) < 0) {
+ if (skip_hash) {
+ struct commit *commit = lookup_commit_in_graph(r, repl);
+ if (commit)
+ return &commit->object;
+ }
+
+ if ((!obj || obj->type == OBJ_BLOB) &&
+ oid_object_info(r, oid, NULL) == OBJ_BLOB) {
+ if (!skip_hash && stream_object_signature(r, repl) < 0) {
error(_("hash mismatch %s"), oid_to_hex(oid));
return NULL;
}
- parse_blob_buffer(lookup_blob(r, oid), NULL, 0);
+ parse_blob_buffer(lookup_blob(r, oid));
return lookup_object(r, oid);
}
+ /*
+ * If the caller does not care about the tree buffer and does not
+ * care about checking the hash, we can simply verify that we
+ * have the on-disk object with the correct type.
+ */
+ if (skip_hash && discard_tree &&
+ (!obj || obj->type == OBJ_TREE) &&
+ oid_object_info(r, oid, NULL) == OBJ_TREE) {
+ return &lookup_tree(r, oid)->object;
+ }
+
buffer = repo_read_object_file(r, oid, &type, &size);
if (buffer) {
- if (check_object_signature(r, repl, buffer, size, type) < 0) {
+ if (!skip_hash &&
+ check_object_signature(r, repl, buffer, size, type) < 0) {
free(buffer);
error(_("hash mismatch %s"), oid_to_hex(repl));
return NULL;
@@ -299,11 +324,18 @@ struct object *parse_object(struct repository *r, const struct object_id *oid)
buffer, &eaten);
if (!eaten)
free(buffer);
+ if (discard_tree && type == OBJ_TREE)
+ free_tree_buffer((struct tree *)obj);
return obj;
}
return NULL;
}
+struct object *parse_object(struct repository *r, const struct object_id *oid)
+{
+ return parse_object_with_flags(r, oid, 0);
+}
+
struct object_list *object_list_insert(struct object *item,
struct object_list **list_p)
{
@@ -339,6 +371,12 @@ void object_list_free(struct object_list **list)
*/
static char object_array_slopbuf[1];
+void object_array_init(struct object_array *array)
+{
+ struct object_array blank = OBJECT_ARRAY_INIT;
+ memcpy(array, &blank, sizeof(*array));
+}
+
void add_object_array_with_path(struct object *obj, const char *name,
struct object_array *array,
unsigned mode, const char *path)
@@ -516,6 +554,7 @@ void free_object_directory(struct object_directory *odb)
{
free(odb->path);
odb_clear_loose_cache(odb);
+ loose_object_map_clear(&odb->loose_map);
free(odb);
}
diff --git a/object.h b/object.h
index a221946..9293e70 100644
--- a/object.h
+++ b/object.h
@@ -1,9 +1,10 @@
#ifndef OBJECT_H
#define OBJECT_H
-#include "cache.h"
+#include "hash-ll.h"
struct buffer_slab;
+struct repository;
struct parsed_object_pool {
struct object **obj_hash;
@@ -57,9 +58,11 @@ struct object_array {
#define OBJECT_ARRAY_INIT { 0 }
+void object_array_init(struct object_array *array);
+
/*
* object flag allocation:
- * revision.h: 0---------10 15 23------26
+ * revision.h: 0---------10 15 23------27
* fetch-pack.c: 01 67
* negotiator/default.c: 2--5
* walker.c: 0-2
@@ -81,6 +84,70 @@ struct object_array {
*/
#define FLAG_BITS 28
+#define TYPE_BITS 3
+
+/*
+ * Values in this enum (except those outside the 3 bit range) are part
+ * of pack file format. See gitformat-pack(5) for more information.
+ */
+enum object_type {
+ OBJ_BAD = -1,
+ OBJ_NONE = 0,
+ OBJ_COMMIT = 1,
+ OBJ_TREE = 2,
+ OBJ_BLOB = 3,
+ OBJ_TAG = 4,
+ /* 5 for future expansion */
+ OBJ_OFS_DELTA = 6,
+ OBJ_REF_DELTA = 7,
+ OBJ_ANY,
+ OBJ_MAX
+};
+
+/* unknown mode (impossible combination S_IFIFO|S_IFCHR) */
+#define S_IFINVALID 0030000
+
+/*
+ * A "directory link" is a link to another git directory.
+ *
+ * The value 0160000 is not normally a valid mode, and
+ * also just happens to be S_IFDIR + S_IFLNK
+ */
+#define S_IFGITLINK 0160000
+#define S_ISGITLINK(m) (((m) & S_IFMT) == S_IFGITLINK)
+
+#define S_ISSPARSEDIR(m) ((m) == S_IFDIR)
+
+static inline enum object_type object_type(unsigned int mode)
+{
+ return S_ISDIR(mode) ? OBJ_TREE :
+ S_ISGITLINK(mode) ? OBJ_COMMIT :
+ OBJ_BLOB;
+}
+
+#define ce_permissions(mode) (((mode) & 0100) ? 0755 : 0644)
+static inline unsigned int create_ce_mode(unsigned int mode)
+{
+ if (S_ISLNK(mode))
+ return S_IFLNK;
+ if (S_ISSPARSEDIR(mode))
+ return S_IFDIR;
+ if (S_ISDIR(mode) || S_ISGITLINK(mode))
+ return S_IFGITLINK;
+ return S_IFREG | ce_permissions(mode);
+}
+
+static inline unsigned int canon_mode(unsigned int mode)
+{
+ if (S_ISREG(mode))
+ return S_IFREG | ce_permissions(mode);
+ if (S_ISLNK(mode))
+ return S_IFLNK;
+ if (S_ISDIR(mode))
+ return S_IFDIR;
+ return S_IFGITLINK;
+}
+
/*
* The object type is stored in 3 bits.
*/
@@ -123,12 +190,37 @@ void *create_object(struct repository *r, const struct object_id *oid, void *obj
void *object_as_type(struct object *obj, enum object_type type, int quiet);
+
+static inline const char *parse_mode(const char *str, uint16_t *modep)
+{
+ unsigned char c;
+ unsigned int mode = 0;
+
+ if (*str == ' ')
+ return NULL;
+
+ while ((c = *str++) != ' ') {
+ if (c < '0' || c > '7')
+ return NULL;
+ mode = (mode << 3) + (c - '0');
+ }
+ *modep = mode;
+ return str;
+}
+
/*
* Returns the object, having parsed it to find out what it is.
*
* Returns NULL if the object is missing or corrupt.
*/
+enum parse_object_flags {
+ PARSE_OBJECT_SKIP_HASH_CHECK = 1 << 0,
+ PARSE_OBJECT_DISCARD_TREE = 1 << 1,
+};
struct object *parse_object(struct repository *r, const struct object_id *oid);
+struct object *parse_object_with_flags(struct repository *r,
+ const struct object_id *oid,
+ enum parse_object_flags flags);
/*
* Like parse_object, but will die() instead of returning NULL. If the
diff --git a/oid-array.c b/oid-array.c
index 73ba76e..1f36651 100644
--- a/oid-array.c
+++ b/oid-array.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "oid-array.h"
#include "hash-lookup.h"
@@ -6,12 +6,20 @@ void oid_array_append(struct oid_array *array, const struct object_id *oid)
{
ALLOC_GROW(array->oid, array->nr + 1, array->alloc);
oidcpy(&array->oid[array->nr++], oid);
+ if (!oid->algo)
+ oid_set_algo(&array->oid[array->nr - 1], the_hash_algo);
array->sorted = 0;
}
-static int void_hashcmp(const void *a, const void *b)
+static int void_hashcmp(const void *va, const void *vb)
{
- return oidcmp(a, b);
+ const struct object_id *a = va, *b = vb;
+ int ret;
+ if (a->algo == b->algo)
+ ret = oidcmp(a, b);
+ else
+ ret = a->algo > b->algo ? 1 : -1;
+ return ret;
}
void oid_array_sort(struct oid_array *array)
diff --git a/oidmap.c b/oidmap.c
index 286a04a..8b1bc4d 100644
--- a/oidmap.c
+++ b/oidmap.c
@@ -1,7 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "hash.h"
#include "oidmap.h"
-static int oidmap_neq(const void *hashmap_cmp_fn_data,
+static int oidmap_neq(const void *hashmap_cmp_fn_data UNUSED,
const struct hashmap_entry *e1,
const struct hashmap_entry *e2,
const void *keydata)
diff --git a/oidmap.h b/oidmap.h
index c66a83a..05c673e 100644
--- a/oidmap.h
+++ b/oidmap.h
@@ -1,7 +1,7 @@
#ifndef OIDMAP_H
#define OIDMAP_H
-#include "cache.h"
+#include "hash-ll.h"
#include "hashmap.h"
/*
diff --git a/oidset.c b/oidset.c
index b36a2ba..91d1385 100644
--- a/oidset.c
+++ b/oidset.c
@@ -1,5 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "oidset.h"
+#include "hex.h"
+#include "strbuf.h"
void oidset_init(struct oidset *set, size_t initial_size)
{
@@ -21,6 +23,16 @@ int oidset_insert(struct oidset *set, const struct object_id *oid)
return !added;
}
+void oidset_insert_from_set(struct oidset *dest, struct oidset *src)
+{
+ struct oidset_iter iter;
+ struct object_id *src_oid;
+
+ oidset_iter_init(src, &iter);
+ while ((src_oid = oidset_iter_next(&iter)))
+ oidset_insert(dest, src_oid);
+}
+
int oidset_remove(struct oidset *set, const struct object_id *oid)
{
khiter_t pos = kh_get_oid_set(&set->set, *oid);
diff --git a/oidset.h b/oidset.h
index ba4a5a2..262f425 100644
--- a/oidset.h
+++ b/oidset.h
@@ -48,6 +48,12 @@ int oidset_contains(const struct oidset *set, const struct object_id *oid);
int oidset_insert(struct oidset *set, const struct object_id *oid);
/**
+ * Insert all the oids that are in set 'src' into set 'dest'; a copy
+ * is made of each oid inserted into set 'dest'.
+ */
+void oidset_insert_from_set(struct oidset *dest, struct oidset *src);
+
+/**
* Remove the oid from the set.
*
* Returns 1 if the oid was present in the set, 0 otherwise.
diff --git a/oidtree.c b/oidtree.c
index 0d39389..daef175 100644
--- a/oidtree.c
+++ b/oidtree.c
@@ -2,8 +2,8 @@
* A wrapper around cbtree which stores oids
* May be used to replace oid-array for prefix (abbreviation) matches
*/
+#include "git-compat-util.h"
#include "oidtree.h"
-#include "alloc.h"
#include "hash.h"
struct oidtree_iter_data {
diff --git a/oidtree.h b/oidtree.h
index 77898f5..55c8351 100644
--- a/oidtree.h
+++ b/oidtree.h
@@ -2,7 +2,7 @@
#define OIDTREE_H
#include "cbtree.h"
-#include "hash.h"
+#include "hash-ll.h"
#include "mem-pool.h"
struct oidtree {
diff --git a/oss-fuzz/.gitignore b/oss-fuzz/.gitignore
new file mode 100644
index 0000000..a877c11
--- /dev/null
+++ b/oss-fuzz/.gitignore
@@ -0,0 +1,5 @@
+fuzz-commit-graph
+fuzz-config
+fuzz-date
+fuzz-pack-headers
+fuzz-pack-idx
diff --git a/oss-fuzz/dummy-cmd-main.c b/oss-fuzz/dummy-cmd-main.c
new file mode 100644
index 0000000..071cb23
--- /dev/null
+++ b/oss-fuzz/dummy-cmd-main.c
@@ -0,0 +1,14 @@
+#include "git-compat-util.h"
+
+/*
+ * When linking the fuzzers, we link against common-main.o to pick up some
+ * symbols. However, even though we ignore common-main:main(), we still need to
+ * provide all the symbols it references. In the fuzzers' case, we need to
+ * provide a dummy cmd_main() for the linker to be happy. It will never be
+ * executed.
+ */
+
+int cmd_main(int argc, const char **argv) {
+ BUG("We should not execute cmd_main() from a fuzz target");
+ return 1;
+}
diff --git a/oss-fuzz/fuzz-commit-graph.c b/oss-fuzz/fuzz-commit-graph.c
new file mode 100644
index 0000000..2992079
--- /dev/null
+++ b/oss-fuzz/fuzz-commit-graph.c
@@ -0,0 +1,28 @@
+#include "git-compat-util.h"
+#include "commit-graph.h"
+#include "repository.h"
+
+struct commit_graph *parse_commit_graph(struct repo_settings *s,
+ void *graph_map, size_t graph_size);
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
+{
+ struct commit_graph *g;
+
+ initialize_the_repository();
+ /*
+ * Initialize the_repository with commit-graph settings that would
+ * normally be read from the repository's gitdir. We want to avoid
+ * touching the disk to keep the individual fuzz-test cases as fast as
+ * possible.
+ */
+ the_repository->settings.commit_graph_generation_version = 2;
+ the_repository->settings.commit_graph_read_changed_paths = 1;
+ g = parse_commit_graph(&the_repository->settings, (void *)data, size);
+ repo_clear(the_repository);
+ free_commit_graph(g);
+
+ return 0;
+}
diff --git a/oss-fuzz/fuzz-config.c b/oss-fuzz/fuzz-config.c
new file mode 100644
index 0000000..94027f5
--- /dev/null
+++ b/oss-fuzz/fuzz-config.c
@@ -0,0 +1,33 @@
+#include "git-compat-util.h"
+#include "config.h"
+
+int LLVMFuzzerTestOneInput(const uint8_t *, size_t);
+static int config_parser_callback(const char *, const char *,
+ const struct config_context *, void *);
+
+static int config_parser_callback(const char *key, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *data UNUSED)
+{
+ /*
+ * Visit every byte of memory we are given to make sure the parser
+ * gave it to us appropriately. We need to unconditionally return 0,
+ * but we also want to prevent the strlen from being optimized away.
+ */
+ size_t c = strlen(key);
+
+ if (value)
+ c += strlen(value);
+ return c == SIZE_MAX;
+}
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, const size_t size)
+{
+ struct config_options config_opts = { 0 };
+
+ config_opts.error_action = CONFIG_ERROR_SILENT;
+ git_config_from_mem(config_parser_callback, CONFIG_ORIGIN_BLOB,
+ "fuzztest-config", (const char *)data, size, NULL,
+ CONFIG_SCOPE_UNKNOWN, &config_opts);
+ return 0;
+}
diff --git a/oss-fuzz/fuzz-date.c b/oss-fuzz/fuzz-date.c
new file mode 100644
index 0000000..9619dae
--- /dev/null
+++ b/oss-fuzz/fuzz-date.c
@@ -0,0 +1,49 @@
+#include "git-compat-util.h"
+#include "date.h"
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
+{
+ int local;
+ int num;
+ char *str;
+ int16_t tz;
+ timestamp_t ts;
+ enum date_mode_type dmtype;
+ struct date_mode dm;
+
+ if (size <= 4)
+ /*
+ * we use the first byte to fuzz dmtype and the
+ * second byte to fuzz local, then the next two
+ * bytes to fuzz tz offset. The remainder
+ * (at least one byte) is fed as input to
+ * approxidate_careful().
+ */
+ return 0;
+
+ local = !!(*data++ & 0x10);
+ num = *data++ % DATE_UNIX;
+ if (num >= DATE_STRFTIME)
+ num++;
+ dmtype = (enum date_mode_type)num;
+ size -= 2;
+
+ tz = *data++;
+ tz = (tz << 8) | *data++;
+ size -= 2;
+
+ str = xmemdupz(data, size);
+
+ ts = approxidate_careful(str, &num);
+ free(str);
+
+ dm = date_mode_from_type(dmtype);
+ dm.local = local;
+ show_date(ts, (int)tz, dm);
+
+ date_mode_release(&dm);
+
+ return 0;
+}
diff --git a/fuzz-pack-headers.c b/oss-fuzz/fuzz-pack-headers.c
index 99da1d0..150c0f5 100644
--- a/fuzz-pack-headers.c
+++ b/oss-fuzz/fuzz-pack-headers.c
@@ -1,3 +1,4 @@
+#include "git-compat-util.h"
#include "packfile.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
diff --git a/fuzz-pack-idx.c b/oss-fuzz/fuzz-pack-idx.c
index 0c3d777..3e19021 100644
--- a/fuzz-pack-idx.c
+++ b/oss-fuzz/fuzz-pack-idx.c
@@ -1,4 +1,5 @@
-#include "object-store.h"
+#include "git-compat-util.h"
+#include "object-store-ll.h"
#include "packfile.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
index c43375b..c6c8f94 100644
--- a/pack-bitmap-write.c
+++ b/pack-bitmap-write.c
@@ -1,18 +1,22 @@
-#include "cache.h"
-#include "object-store.h"
+#include "git-compat-util.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-store-ll.h"
#include "commit.h"
-#include "tag.h"
#include "diff.h"
#include "revision.h"
-#include "list-objects.h"
#include "progress.h"
-#include "pack-revindex.h"
#include "pack.h"
#include "pack-bitmap.h"
#include "hash-lookup.h"
#include "pack-objects.h"
+#include "path.h"
#include "commit-reach.h"
#include "prio-queue.h"
+#include "trace2.h"
+#include "tree.h"
+#include "tree-walk.h"
struct bitmapped_commit {
struct commit *commit;
@@ -191,6 +195,13 @@ struct bb_commit {
unsigned idx; /* within selected array */
};
+static void clear_bb_commit(struct bb_commit *commit)
+{
+ free_commit_list(commit->reverse_edges);
+ bitmap_free(commit->commit_mask);
+ bitmap_free(commit->bitmap);
+}
+
define_commit_slab(bb_data, struct bb_commit);
struct bitmap_builder {
@@ -332,7 +343,7 @@ next:
static void bitmap_builder_clear(struct bitmap_builder *bb)
{
- clear_bb_data(&bb->data);
+ deep_clear_bb_data(&bb->data, clear_bb_commit);
free(bb->commits);
bb->commits_nr = bb->commits_alloc = 0;
}
@@ -359,7 +370,7 @@ static int fill_bitmap_tree(struct bitmap *bitmap,
if (parse_tree(tree) < 0)
die("unable to load tree object %s",
oid_to_hex(&tree->object.oid));
- init_tree_desc(&desc, tree->buffer, tree->size);
+ init_tree_desc(&desc, &tree->object.oid, tree->buffer, tree->size);
while (tree_entry(&desc, &entry)) {
switch (object_type(entry.mode)) {
@@ -384,6 +395,8 @@ static int fill_bitmap_tree(struct bitmap *bitmap,
return 0;
}
+static int reused_bitmaps_nr;
+
static int fill_bitmap_commit(struct bb_commit *ent,
struct commit *commit,
struct prio_queue *queue,
@@ -404,13 +417,19 @@ static int fill_bitmap_commit(struct bb_commit *ent,
if (old_bitmap && mapping) {
struct ewah_bitmap *old = bitmap_for_commit(old_bitmap, c);
+ struct bitmap *remapped = bitmap_new();
/*
* If this commit has an old bitmap, then translate that
* bitmap and add its bits to this one. No need to walk
* parents or the tree for this commit.
*/
- if (old && !rebuild_bitmap(mapping, old, ent->bitmap))
+ if (old && !rebuild_bitmap(mapping, old, remapped)) {
+ bitmap_or(ent->bitmap, remapped);
+ bitmap_free(remapped);
+ reused_bitmaps_nr++;
continue;
+ }
+ bitmap_free(remapped);
}
/*
@@ -421,7 +440,8 @@ static int fill_bitmap_commit(struct bb_commit *ent,
if (!found)
return -1;
bitmap_set(ent->bitmap, pos);
- prio_queue_put(tree_queue, get_commit_tree(c));
+ prio_queue_put(tree_queue,
+ repo_get_commit_tree(the_repository, c));
for (p = c->parents; p; p = p->next) {
pos = find_object_pos(&p->item->object.oid, &found);
@@ -526,6 +546,8 @@ int bitmap_writer_build(struct packing_data *to_pack)
trace2_region_leave("pack-bitmap-write", "building_bitmaps_total",
the_repository);
+ trace2_data_intmax("pack-bitmap-write", the_repository,
+ "building_bitmaps_reused", reused_bitmaps_nr);
stop_progress(&writer.progress);
@@ -649,21 +671,18 @@ static const struct object_id *oid_access(size_t pos, const void *table)
}
static void write_selected_commits_v1(struct hashfile *f,
- struct pack_idx_entry **index,
- uint32_t index_nr)
+ uint32_t *commit_positions,
+ off_t *offsets)
{
int i;
for (i = 0; i < writer.selected_nr; ++i) {
struct bitmapped_commit *stored = &writer.selected[i];
- int commit_pos =
- oid_pos(&stored->commit->object.oid, index, index_nr, oid_access);
+ if (offsets)
+ offsets[i] = hashfile_total(f);
- if (commit_pos < 0)
- BUG("trying to write commit not in index");
-
- hashwrite_be32(f, commit_pos);
+ hashwrite_be32(f, commit_positions[i]);
hashwrite_u8(f, stored->xor_offset);
hashwrite_u8(f, stored->flags);
@@ -671,6 +690,79 @@ static void write_selected_commits_v1(struct hashfile *f,
}
}
+static int table_cmp(const void *_va, const void *_vb, void *_data)
+{
+ uint32_t *commit_positions = _data;
+ uint32_t a = commit_positions[*(uint32_t *)_va];
+ uint32_t b = commit_positions[*(uint32_t *)_vb];
+
+ if (a > b)
+ return 1;
+ else if (a < b)
+ return -1;
+
+ return 0;
+}
+
+static void write_lookup_table(struct hashfile *f,
+ uint32_t *commit_positions,
+ off_t *offsets)
+{
+ uint32_t i;
+ uint32_t *table, *table_inv;
+
+ ALLOC_ARRAY(table, writer.selected_nr);
+ ALLOC_ARRAY(table_inv, writer.selected_nr);
+
+ for (i = 0; i < writer.selected_nr; i++)
+ table[i] = i;
+
+ /*
+ * At the end of this sort table[j] = i means that the i'th
+ * bitmap corresponds to j'th bitmapped commit (among the selected
+ * commits) in lex order of OIDs.
+ */
+ QSORT_S(table, writer.selected_nr, table_cmp, commit_positions);
+
+ /* table_inv helps us discover that relationship (i'th bitmap
+ * to j'th commit by j = table_inv[i])
+ */
+ for (i = 0; i < writer.selected_nr; i++)
+ table_inv[table[i]] = i;
+
+ trace2_region_enter("pack-bitmap-write", "writing_lookup_table", the_repository);
+ for (i = 0; i < writer.selected_nr; i++) {
+ struct bitmapped_commit *selected = &writer.selected[table[i]];
+ uint32_t xor_offset = selected->xor_offset;
+ uint32_t xor_row;
+
+ if (xor_offset) {
+ /*
+ * xor_index stores the index (in the bitmap entries)
+ * of the corresponding xor bitmap. But we need to convert
+ * this index into lookup table's index. So, table_inv[xor_index]
+ * gives us the index position w.r.t. the lookup table.
+ *
+ * If "k = table[i] - xor_offset" then the xor base is the k'th
+ * bitmap. `table_inv[k]` gives us the position of that bitmap
+ * in the lookup table.
+ */
+ uint32_t xor_index = table[i] - xor_offset;
+ xor_row = table_inv[xor_index];
+ } else {
+ xor_row = 0xffffffff;
+ }
+
+ hashwrite_be32(f, commit_positions[table[i]]);
+ hashwrite_be64(f, (uint64_t)offsets[table[i]]);
+ hashwrite_be32(f, xor_row);
+ }
+ trace2_region_leave("pack-bitmap-write", "writing_lookup_table", the_repository);
+
+ free(table);
+ free(table_inv);
+}
+
static void write_hash_cache(struct hashfile *f,
struct pack_idx_entry **index,
uint32_t index_nr)
@@ -683,7 +775,7 @@ static void write_hash_cache(struct hashfile *f,
}
}
-void bitmap_writer_set_checksum(unsigned char *sha1)
+void bitmap_writer_set_checksum(const unsigned char *sha1)
{
hashcpy(writer.pack_checksum, sha1);
}
@@ -697,6 +789,9 @@ void bitmap_writer_finish(struct pack_idx_entry **index,
static uint16_t flags = BITMAP_OPT_FULL_DAG;
struct strbuf tmp_file = STRBUF_INIT;
struct hashfile *f;
+ uint32_t *commit_positions = NULL;
+ off_t *offsets = NULL;
+ uint32_t i;
struct bitmap_disk_header header;
@@ -715,7 +810,26 @@ void bitmap_writer_finish(struct pack_idx_entry **index,
dump_bitmap(f, writer.trees);
dump_bitmap(f, writer.blobs);
dump_bitmap(f, writer.tags);
- write_selected_commits_v1(f, index, index_nr);
+
+ if (options & BITMAP_OPT_LOOKUP_TABLE)
+ CALLOC_ARRAY(offsets, index_nr);
+
+ ALLOC_ARRAY(commit_positions, writer.selected_nr);
+
+ for (i = 0; i < writer.selected_nr; i++) {
+ struct bitmapped_commit *stored = &writer.selected[i];
+ int commit_pos = oid_pos(&stored->commit->object.oid, index, index_nr, oid_access);
+
+ if (commit_pos < 0)
+ BUG(_("trying to write commit not in index"));
+
+ commit_positions[i] = commit_pos;
+ }
+
+ write_selected_commits_v1(f, commit_positions, offsets);
+
+ if (options & BITMAP_OPT_LOOKUP_TABLE)
+ write_lookup_table(f, commit_positions, offsets);
if (options & BITMAP_OPT_HASH_CACHE)
write_hash_cache(f, index, index_nr);
@@ -730,4 +844,6 @@ void bitmap_writer_finish(struct pack_idx_entry **index,
die_errno("unable to rename temporary bitmap file to '%s'", filename);
strbuf_release(&tmp_file);
+ free(commit_positions);
+ free(offsets);
}
diff --git a/pack-bitmap.c b/pack-bitmap.c
index 3613422..2baeaba 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -1,5 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "commit.h"
+#include "gettext.h"
+#include "hex.h"
+#include "strbuf.h"
#include "tag.h"
#include "diff.h"
#include "revision.h"
@@ -11,7 +14,9 @@
#include "pack-objects.h"
#include "packfile.h"
#include "repository.h"
-#include "object-store.h"
+#include "trace2.h"
+#include "object-file.h"
+#include "object-store-ll.h"
#include "list-objects-filter-options.h"
#include "midx.h"
#include "config.h"
@@ -46,13 +51,6 @@ struct bitmap_index {
struct packed_git *pack;
struct multi_pack_index *midx;
- /*
- * Mark the first `reuse_objects` in the packfile as reused:
- * they will be sent as-is without using them for repacking
- * calculations
- */
- uint32_t reuse_objects;
-
/* mmapped buffer of the whole bitmap index */
unsigned char *map;
size_t map_size; /* size of the mmaped buffer */
@@ -83,6 +81,12 @@ struct bitmap_index {
const unsigned char *checksum;
/*
+ * If not NULL, this point into the commit table extension
+ * (within the memory mapped region `map`).
+ */
+ unsigned char *table_lookup;
+
+ /*
* Extended index.
*
* When trying to perform bitmap operations with objects that are not
@@ -138,7 +142,7 @@ static struct ewah_bitmap *read_bitmap_1(struct bitmap_index *index)
index->map_size - index->map_pos);
if (bitmap_size < 0) {
- error("Failed to load bitmap index (corrupted?)");
+ error(_("failed to load bitmap index (corrupted?)"));
ewah_pool_free(b);
return NULL;
}
@@ -160,14 +164,14 @@ static int load_bitmap_header(struct bitmap_index *index)
size_t header_size = sizeof(*header) - GIT_MAX_RAWSZ + the_hash_algo->rawsz;
if (index->map_size < header_size + the_hash_algo->rawsz)
- return error("Corrupted bitmap index (too small)");
+ return error(_("corrupted bitmap index (too small)"));
if (memcmp(header->magic, BITMAP_IDX_SIGNATURE, sizeof(BITMAP_IDX_SIGNATURE)) != 0)
- return error("Corrupted bitmap index file (wrong header)");
+ return error(_("corrupted bitmap index file (wrong header)"));
index->version = ntohs(header->version);
if (index->version != 1)
- return error("Unsupported version for bitmap index file (%d)", index->version);
+ return error(_("unsupported version '%d' for bitmap index file"), index->version);
/* Parse known bitmap format options */
{
@@ -176,15 +180,25 @@ static int load_bitmap_header(struct bitmap_index *index)
unsigned char *index_end = index->map + index->map_size - the_hash_algo->rawsz;
if ((flags & BITMAP_OPT_FULL_DAG) == 0)
- return error("Unsupported options for bitmap index file "
+ BUG("unsupported options for bitmap index file "
"(Git requires BITMAP_OPT_FULL_DAG)");
if (flags & BITMAP_OPT_HASH_CACHE) {
if (cache_size > index_end - index->map - header_size)
- return error("corrupted bitmap index file (too short to fit hash cache)");
+ return error(_("corrupted bitmap index file (too short to fit hash cache)"));
index->hashes = (void *)(index_end - cache_size);
index_end -= cache_size;
}
+
+ if (flags & BITMAP_OPT_LOOKUP_TABLE) {
+ size_t table_size = st_mult(ntohl(header->entry_count),
+ BITMAP_LOOKUP_TABLE_TRIPLET_WIDTH);
+ if (table_size > index_end - index->map - header_size)
+ return error(_("corrupted bitmap index file (too short to fit lookup table)"));
+ if (git_env_bool("GIT_TEST_READ_COMMIT_TABLE", 1))
+ index->table_lookup = (void *)(index_end - table_size);
+ index_end -= table_size;
+ }
}
index->entry_count = ntohl(header->entry_count);
@@ -211,11 +225,13 @@ static struct stored_bitmap *store_bitmap(struct bitmap_index *index,
hash_pos = kh_put_oid_map(index->bitmaps, stored->oid, &ret);
- /* a 0 return code means the insertion succeeded with no changes,
- * because the SHA1 already existed on the map. this is bad, there
- * shouldn't be duplicated commits in the index */
+ /*
+ * A 0 return code means the insertion succeeded with no changes,
+ * because the SHA1 already existed on the map. This is bad, there
+ * shouldn't be duplicated commits in the index.
+ */
if (ret == 0) {
- error("Duplicate entry in bitmap index: %s", oid_to_hex(oid));
+ error(_("duplicate entry in bitmap index: '%s'"), oid_to_hex(oid));
return NULL;
}
@@ -259,14 +275,14 @@ static int load_bitmap_entries_v1(struct bitmap_index *index)
struct object_id oid;
if (index->map_size - index->map_pos < 6)
- return error("corrupt ewah bitmap: truncated header for entry %d", i);
+ return error(_("corrupt ewah bitmap: truncated header for entry %d"), i);
commit_idx_pos = read_be32(index->map, &index->map_pos);
xor_offset = read_u8(index->map, &index->map_pos);
flags = read_u8(index->map, &index->map_pos);
if (nth_bitmap_object_oid(index, &oid, commit_idx_pos) < 0)
- return error("corrupt ewah bitmap: commit index %u out of range",
+ return error(_("corrupt ewah bitmap: commit index %u out of range"),
(unsigned)commit_idx_pos);
bitmap = read_bitmap_1(index);
@@ -274,13 +290,13 @@ static int load_bitmap_entries_v1(struct bitmap_index *index)
return -1;
if (xor_offset > MAX_XOR_OFFSET || xor_offset > i)
- return error("Corrupted bitmap pack index");
+ return error(_("corrupted bitmap pack index"));
if (xor_offset > 0) {
xor_bitmap = recent_bitmaps[(i - xor_offset) % MAX_XOR_OFFSET];
if (!xor_bitmap)
- return error("Invalid XOR offset in bitmap pack index");
+ return error(_("invalid XOR offset in bitmap pack index"));
}
recent_bitmaps[i % MAX_XOR_OFFSET] = store_bitmap(
@@ -313,17 +329,21 @@ static int open_midx_bitmap_1(struct bitmap_index *bitmap_git,
struct multi_pack_index *midx)
{
struct stat st;
- char *idx_name = midx_bitmap_filename(midx);
- int fd = git_open(idx_name);
- uint32_t i;
+ char *bitmap_name = midx_bitmap_filename(midx);
+ int fd = git_open(bitmap_name);
+ uint32_t i, preferred_pack;
struct packed_git *preferred;
- free(idx_name);
-
- if (fd < 0)
+ if (fd < 0) {
+ if (errno != ENOENT)
+ warning_errno("cannot open '%s'", bitmap_name);
+ free(bitmap_name);
return -1;
+ }
+ free(bitmap_name);
if (fstat(fd, &st)) {
+ error_errno(_("cannot fstat bitmap file"));
close(fd);
return -1;
}
@@ -331,8 +351,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);
- /* ignore extra bitmap file; we can only handle one */
- warning("ignoring extra bitmap file: %s", buf.buf);
+ trace2_data_string("bitmap", the_repository,
+ "ignoring extra midx bitmap file", buf.buf);
close(fd);
strbuf_release(&buf);
return -1;
@@ -348,21 +368,30 @@ static int open_midx_bitmap_1(struct bitmap_index *bitmap_git,
if (load_bitmap_header(bitmap_git) < 0)
goto cleanup;
- if (!hasheq(get_midx_checksum(bitmap_git->midx), bitmap_git->checksum))
+ if (!hasheq(get_midx_checksum(bitmap_git->midx), bitmap_git->checksum)) {
+ error(_("checksum doesn't match in MIDX and bitmap"));
goto cleanup;
+ }
- if (load_midx_revindex(bitmap_git->midx) < 0) {
+ if (load_midx_revindex(bitmap_git->midx)) {
warning(_("multi-pack bitmap is missing required reverse index"));
goto cleanup;
}
for (i = 0; i < bitmap_git->midx->num_packs; i++) {
- if (prepare_midx_pack(the_repository, bitmap_git->midx, i))
- die(_("could not open pack %s"),
- bitmap_git->midx->pack_names[i]);
+ if (prepare_midx_pack(the_repository, bitmap_git->midx, i)) {
+ warning(_("could not open pack %s"),
+ bitmap_git->midx->pack_names[i]);
+ goto cleanup;
+ }
}
- preferred = bitmap_git->midx->packs[midx_preferred_pack(bitmap_git)];
+ 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);
@@ -384,26 +413,28 @@ static int open_pack_bitmap_1(struct bitmap_index *bitmap_git, struct packed_git
{
int fd;
struct stat st;
- char *idx_name;
-
- if (open_pack_index(packfile))
- return -1;
+ char *bitmap_name;
- idx_name = pack_bitmap_filename(packfile);
- fd = git_open(idx_name);
- free(idx_name);
+ bitmap_name = pack_bitmap_filename(packfile);
+ fd = git_open(bitmap_name);
- if (fd < 0)
+ if (fd < 0) {
+ if (errno != ENOENT)
+ warning_errno("cannot open '%s'", bitmap_name);
+ free(bitmap_name);
return -1;
+ }
+ free(bitmap_name);
if (fstat(fd, &st)) {
+ error_errno(_("cannot fstat bitmap file"));
close(fd);
return -1;
}
if (bitmap_git->pack || bitmap_git->midx) {
- /* ignore extra bitmap file; we can only handle one */
- warning("ignoring extra bitmap file: %s", packfile->pack_name);
+ trace2_data_string("bitmap", the_repository,
+ "ignoring extra bitmap file", packfile->pack_name);
close(fd);
return -1;
}
@@ -428,10 +459,12 @@ 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);
return 0;
}
-static int load_reverse_index(struct bitmap_index *bitmap_git)
+static int load_reverse_index(struct repository *r, struct bitmap_index *bitmap_git)
{
if (bitmap_is_midx(bitmap_git)) {
uint32_t i;
@@ -445,23 +478,23 @@ static int load_reverse_index(struct bitmap_index *bitmap_git)
* since we will need to make use of them in pack-objects.
*/
for (i = 0; i < bitmap_git->midx->num_packs; i++) {
- ret = load_pack_revindex(bitmap_git->midx->packs[i]);
+ ret = load_pack_revindex(r, bitmap_git->midx->packs[i]);
if (ret)
return ret;
}
return 0;
}
- return load_pack_revindex(bitmap_git->pack);
+ return load_pack_revindex(r, bitmap_git->pack);
}
-static int load_bitmap(struct bitmap_index *bitmap_git)
+static int load_bitmap(struct repository *r, struct bitmap_index *bitmap_git)
{
assert(bitmap_git->map);
bitmap_git->bitmaps = kh_init_oid_map();
bitmap_git->ext_index.positions = kh_init_oid_pos();
- if (load_reverse_index(bitmap_git))
+ if (load_reverse_index(r, bitmap_git))
goto failed;
if (!(bitmap_git->commits = read_bitmap_1(bitmap_git)) ||
@@ -470,7 +503,7 @@ static int load_bitmap(struct bitmap_index *bitmap_git)
!(bitmap_git->tags = read_bitmap_1(bitmap_git)))
goto failed;
- if (load_bitmap_entries_v1(bitmap_git) < 0)
+ if (!bitmap_git->table_lookup && load_bitmap_entries_v1(bitmap_git) < 0)
goto failed;
return 0;
@@ -495,11 +528,16 @@ static int open_pack_bitmap(struct repository *r,
struct packed_git *p;
int ret = -1;
- assert(!bitmap_git->map);
-
for (p = get_all_packs(r); p; p = p->next) {
- if (open_pack_bitmap_1(bitmap_git, p) == 0)
+ if (open_pack_bitmap_1(bitmap_git, p) == 0) {
ret = 0;
+ /*
+ * The only reason to keep looking is to report
+ * duplicates.
+ */
+ if (!trace2_is_enabled())
+ break;
+ }
}
return ret;
@@ -508,32 +546,42 @@ static int open_pack_bitmap(struct repository *r,
static int open_midx_bitmap(struct repository *r,
struct bitmap_index *bitmap_git)
{
+ int ret = -1;
struct multi_pack_index *midx;
assert(!bitmap_git->map);
for (midx = get_multi_pack_index(r); midx; midx = midx->next) {
if (!open_midx_bitmap_1(bitmap_git, midx))
- return 0;
+ ret = 0;
}
- return -1;
+ return ret;
}
static int open_bitmap(struct repository *r,
struct bitmap_index *bitmap_git)
{
+ int found;
+
assert(!bitmap_git->map);
- if (!open_midx_bitmap(r, bitmap_git))
- return 0;
- return open_pack_bitmap(r, bitmap_git);
+ found = !open_midx_bitmap(r, bitmap_git);
+
+ /*
+ * these will all be skipped if we opened a midx bitmap; but run it
+ * anyway if tracing is enabled to report the duplicates
+ */
+ if (!found || trace2_is_enabled())
+ found |= !open_pack_bitmap(r, bitmap_git);
+
+ return found ? 0 : -1;
}
struct bitmap_index *prepare_bitmap_git(struct repository *r)
{
struct bitmap_index *bitmap_git = xcalloc(1, sizeof(*bitmap_git));
- if (!open_bitmap(r, bitmap_git) && !load_bitmap(bitmap_git))
+ if (!open_bitmap(r, bitmap_git) && !load_bitmap(r, bitmap_git))
return bitmap_git;
free_bitmap_index(bitmap_git);
@@ -542,9 +590,10 @@ struct bitmap_index *prepare_bitmap_git(struct repository *r)
struct bitmap_index *prepare_midx_bitmap_git(struct multi_pack_index *midx)
{
+ struct repository *r = the_repository;
struct bitmap_index *bitmap_git = xcalloc(1, sizeof(*bitmap_git));
- if (!open_midx_bitmap_1(bitmap_git, midx) && !load_bitmap(bitmap_git))
+ if (!open_midx_bitmap_1(bitmap_git, midx) && !load_bitmap(r, bitmap_git))
return bitmap_git;
free_bitmap_index(bitmap_git);
@@ -557,13 +606,255 @@ struct include_data {
struct bitmap *seen;
};
+struct bitmap_lookup_table_triplet {
+ uint32_t commit_pos;
+ uint64_t offset;
+ uint32_t xor_row;
+};
+
+struct bitmap_lookup_table_xor_item {
+ struct object_id oid;
+ uint64_t offset;
+};
+
+/*
+ * Given a `triplet` struct pointer and pointer `p`, this
+ * function reads the triplet beginning at `p` into the struct.
+ * Note that this function assumes that there is enough memory
+ * left for filling the `triplet` struct from `p`.
+ */
+static int bitmap_lookup_table_get_triplet_by_pointer(struct bitmap_lookup_table_triplet *triplet,
+ const unsigned char *p)
+{
+ if (!triplet)
+ return -1;
+
+ triplet->commit_pos = get_be32(p);
+ p += sizeof(uint32_t);
+ triplet->offset = get_be64(p);
+ p += sizeof(uint64_t);
+ triplet->xor_row = get_be32(p);
+ return 0;
+}
+
+/*
+ * This function gets the raw triplet from `row`'th row in the
+ * lookup table and fills that data to the `triplet`.
+ */
+static int bitmap_lookup_table_get_triplet(struct bitmap_index *bitmap_git,
+ uint32_t pos,
+ struct bitmap_lookup_table_triplet *triplet)
+{
+ unsigned char *p = NULL;
+ if (pos >= bitmap_git->entry_count)
+ return error(_("corrupt bitmap lookup table: triplet position out of index"));
+
+ p = bitmap_git->table_lookup + st_mult(pos, BITMAP_LOOKUP_TABLE_TRIPLET_WIDTH);
+
+ return bitmap_lookup_table_get_triplet_by_pointer(triplet, p);
+}
+
+/*
+ * Searches for a matching triplet. `commit_pos` is a pointer
+ * to the wanted commit position value. `table_entry` points to
+ * a triplet in lookup table. The first 4 bytes of each
+ * triplet (pointed by `table_entry`) are compared with `*commit_pos`.
+ */
+static int triplet_cmp(const void *commit_pos, const void *table_entry)
+{
+
+ uint32_t a = *(uint32_t *)commit_pos;
+ uint32_t b = get_be32(table_entry);
+ if (a > b)
+ return 1;
+ else if (a < b)
+ return -1;
+
+ return 0;
+}
+
+static uint32_t bitmap_bsearch_pos(struct bitmap_index *bitmap_git,
+ struct object_id *oid,
+ uint32_t *result)
+{
+ int found;
+
+ if (bitmap_is_midx(bitmap_git))
+ found = bsearch_midx(oid, bitmap_git->midx, result);
+ else
+ found = bsearch_pack(oid, bitmap_git->pack, result);
+
+ return found;
+}
+
+/*
+ * `bsearch_triplet_by_pos` function searches for the raw triplet
+ * having commit position same as `commit_pos` and fills `triplet`
+ * object from the raw triplet. Returns 1 on success and 0 on
+ * failure.
+ */
+static int bitmap_bsearch_triplet_by_pos(uint32_t commit_pos,
+ struct bitmap_index *bitmap_git,
+ struct bitmap_lookup_table_triplet *triplet)
+{
+ unsigned char *p = bsearch(&commit_pos, bitmap_git->table_lookup, bitmap_git->entry_count,
+ BITMAP_LOOKUP_TABLE_TRIPLET_WIDTH, triplet_cmp);
+
+ if (!p)
+ return -1;
+
+ return bitmap_lookup_table_get_triplet_by_pointer(triplet, p);
+}
+
+static struct stored_bitmap *lazy_bitmap_for_commit(struct bitmap_index *bitmap_git,
+ struct commit *commit)
+{
+ uint32_t commit_pos, xor_row;
+ uint64_t offset;
+ int flags;
+ struct bitmap_lookup_table_triplet triplet;
+ struct object_id *oid = &commit->object.oid;
+ struct ewah_bitmap *bitmap;
+ struct stored_bitmap *xor_bitmap = NULL;
+ const int bitmap_header_size = 6;
+ static struct bitmap_lookup_table_xor_item *xor_items = NULL;
+ static size_t xor_items_nr = 0, xor_items_alloc = 0;
+ static int is_corrupt = 0;
+ int xor_flags;
+ khiter_t hash_pos;
+ struct bitmap_lookup_table_xor_item *xor_item;
+
+ if (is_corrupt)
+ return NULL;
+
+ if (!bitmap_bsearch_pos(bitmap_git, oid, &commit_pos))
+ return NULL;
+
+ if (bitmap_bsearch_triplet_by_pos(commit_pos, bitmap_git, &triplet) < 0)
+ return NULL;
+
+ xor_items_nr = 0;
+ offset = triplet.offset;
+ xor_row = triplet.xor_row;
+
+ while (xor_row != 0xffffffff) {
+ ALLOC_GROW(xor_items, xor_items_nr + 1, xor_items_alloc);
+
+ if (xor_items_nr + 1 >= bitmap_git->entry_count) {
+ error(_("corrupt bitmap lookup table: xor chain exceeds entry count"));
+ goto corrupt;
+ }
+
+ if (bitmap_lookup_table_get_triplet(bitmap_git, xor_row, &triplet) < 0)
+ goto corrupt;
+
+ xor_item = &xor_items[xor_items_nr];
+ xor_item->offset = triplet.offset;
+
+ if (nth_bitmap_object_oid(bitmap_git, &xor_item->oid, triplet.commit_pos) < 0) {
+ error(_("corrupt bitmap lookup table: commit index %u out of range"),
+ triplet.commit_pos);
+ goto corrupt;
+ }
+
+ hash_pos = kh_get_oid_map(bitmap_git->bitmaps, xor_item->oid);
+
+ /*
+ * If desired bitmap is already stored, we don't need
+ * to iterate further. Because we know that bitmaps
+ * that are needed to be parsed to parse this bitmap
+ * has already been stored. So, assign this stored bitmap
+ * to the xor_bitmap.
+ */
+ if (hash_pos < kh_end(bitmap_git->bitmaps) &&
+ (xor_bitmap = kh_value(bitmap_git->bitmaps, hash_pos)))
+ break;
+ xor_items_nr++;
+ xor_row = triplet.xor_row;
+ }
+
+ while (xor_items_nr) {
+ xor_item = &xor_items[xor_items_nr - 1];
+ bitmap_git->map_pos = xor_item->offset;
+ if (bitmap_git->map_size - bitmap_git->map_pos < bitmap_header_size) {
+ error(_("corrupt ewah bitmap: truncated header for bitmap of commit \"%s\""),
+ oid_to_hex(&xor_item->oid));
+ goto corrupt;
+ }
+
+ bitmap_git->map_pos += sizeof(uint32_t) + sizeof(uint8_t);
+ xor_flags = read_u8(bitmap_git->map, &bitmap_git->map_pos);
+ bitmap = read_bitmap_1(bitmap_git);
+
+ if (!bitmap)
+ goto corrupt;
+
+ xor_bitmap = store_bitmap(bitmap_git, bitmap, &xor_item->oid, xor_bitmap, xor_flags);
+ xor_items_nr--;
+ }
+
+ bitmap_git->map_pos = offset;
+ if (bitmap_git->map_size - bitmap_git->map_pos < bitmap_header_size) {
+ error(_("corrupt ewah bitmap: truncated header for bitmap of commit \"%s\""),
+ oid_to_hex(oid));
+ goto corrupt;
+ }
+
+ /*
+ * Don't bother reading the commit's index position or its xor
+ * offset:
+ *
+ * - The commit's index position is irrelevant to us, since
+ * load_bitmap_entries_v1 only uses it to learn the object
+ * id which is used to compute the hashmap's key. We already
+ * have an object id, so no need to look it up again.
+ *
+ * - The xor_offset is unusable for us, since it specifies how
+ * many entries previous to ours we should look at. This
+ * makes sense when reading the bitmaps sequentially (as in
+ * load_bitmap_entries_v1()), since we can keep track of
+ * each bitmap as we read them.
+ *
+ * But it can't work for us, since the bitmap's don't have a
+ * fixed size. So we learn the position of the xor'd bitmap
+ * from the commit table (and resolve it to a bitmap in the
+ * above if-statement).
+ *
+ * Instead, we can skip ahead and immediately read the flags and
+ * ewah bitmap.
+ */
+ bitmap_git->map_pos += sizeof(uint32_t) + sizeof(uint8_t);
+ flags = read_u8(bitmap_git->map, &bitmap_git->map_pos);
+ bitmap = read_bitmap_1(bitmap_git);
+
+ if (!bitmap)
+ goto corrupt;
+
+ return store_bitmap(bitmap_git, bitmap, oid, xor_bitmap, flags);
+
+corrupt:
+ free(xor_items);
+ is_corrupt = 1;
+ return NULL;
+}
+
struct ewah_bitmap *bitmap_for_commit(struct bitmap_index *bitmap_git,
struct commit *commit)
{
khiter_t hash_pos = kh_get_oid_map(bitmap_git->bitmaps,
commit->object.oid);
- if (hash_pos >= kh_end(bitmap_git->bitmaps))
- return NULL;
+ if (hash_pos >= kh_end(bitmap_git->bitmaps)) {
+ struct stored_bitmap *bitmap = NULL;
+ if (!bitmap_git->table_lookup)
+ return NULL;
+
+ /* this is a fairly hot codepath - no trace2_region please */
+ /* NEEDSWORK: cache misses aren't recorded */
+ bitmap = lazy_bitmap_for_commit(bitmap_git, commit);
+ if (!bitmap)
+ return NULL;
+ return lookup_stored_bitmap(bitmap);
+ }
return lookup_stored_bitmap(kh_value(bitmap_git->bitmaps, hash_pos));
}
@@ -665,7 +956,8 @@ static void show_object(struct object *object, const char *name, void *data_)
bitmap_set(data->base, bitmap_pos);
}
-static void show_commit(struct commit *commit, void *data)
+static void show_commit(struct commit *commit UNUSED,
+ void *data UNUSED)
{
}
@@ -750,6 +1042,161 @@ static int add_commit_to_bitmap(struct bitmap_index *bitmap_git,
return 1;
}
+static struct bitmap *fill_in_bitmap(struct bitmap_index *bitmap_git,
+ struct rev_info *revs,
+ struct bitmap *base,
+ struct bitmap *seen)
+{
+ struct include_data incdata;
+ struct bitmap_show_data show_data;
+
+ if (!base)
+ base = bitmap_new();
+
+ incdata.bitmap_git = bitmap_git;
+ incdata.base = base;
+ incdata.seen = seen;
+
+ revs->include_check = should_include;
+ revs->include_check_obj = should_include_obj;
+ revs->include_check_data = &incdata;
+
+ if (prepare_revision_walk(revs))
+ die(_("revision walk setup failed"));
+
+ show_data.bitmap_git = bitmap_git;
+ show_data.base = base;
+
+ traverse_commit_list(revs, show_commit, show_object, &show_data);
+
+ revs->include_check = NULL;
+ revs->include_check_obj = NULL;
+ revs->include_check_data = NULL;
+
+ return base;
+}
+
+struct bitmap_boundary_cb {
+ struct bitmap_index *bitmap_git;
+ struct bitmap *base;
+
+ struct object_array boundary;
+};
+
+static void show_boundary_commit(struct commit *commit, void *_data)
+{
+ struct bitmap_boundary_cb *data = _data;
+
+ if (commit->object.flags & BOUNDARY)
+ add_object_array(&commit->object, "", &data->boundary);
+
+ if (commit->object.flags & UNINTERESTING) {
+ if (bitmap_walk_contains(data->bitmap_git, data->base,
+ &commit->object.oid))
+ return;
+
+ add_commit_to_bitmap(data->bitmap_git, &data->base, commit);
+ }
+}
+
+static void show_boundary_object(struct object *object UNUSED,
+ const char *name UNUSED,
+ void *data UNUSED)
+{
+ BUG("should not be called");
+}
+
+static struct bitmap *find_boundary_objects(struct bitmap_index *bitmap_git,
+ struct rev_info *revs,
+ struct object_list *roots)
+{
+ struct bitmap_boundary_cb cb;
+ struct object_list *root;
+ unsigned int i;
+ unsigned int tmp_blobs, tmp_trees, tmp_tags;
+ int any_missing = 0;
+
+ cb.bitmap_git = bitmap_git;
+ cb.base = bitmap_new();
+ object_array_init(&cb.boundary);
+
+ revs->ignore_missing_links = 1;
+
+ /*
+ * OR in any existing reachability bitmaps among `roots` into
+ * `cb.base`.
+ */
+ for (root = roots; root; root = root->next) {
+ struct object *object = root->item;
+ if (object->type != OBJ_COMMIT ||
+ bitmap_walk_contains(bitmap_git, cb.base, &object->oid))
+ continue;
+
+ if (add_commit_to_bitmap(bitmap_git, &cb.base,
+ (struct commit *)object))
+ continue;
+
+ any_missing = 1;
+ }
+
+ if (!any_missing)
+ goto cleanup;
+
+ tmp_blobs = revs->blob_objects;
+ tmp_trees = revs->tree_objects;
+ tmp_tags = revs->blob_objects;
+ revs->blob_objects = 0;
+ revs->tree_objects = 0;
+ revs->tag_objects = 0;
+
+ /*
+ * We didn't have complete coverage of the roots. First setup a
+ * revision walk to (a) OR in any bitmaps that are UNINTERESTING
+ * between the tips and boundary, and (b) record the boundary.
+ */
+ trace2_region_enter("pack-bitmap", "boundary-prepare", the_repository);
+ if (prepare_revision_walk(revs))
+ die("revision walk setup failed");
+ trace2_region_leave("pack-bitmap", "boundary-prepare", the_repository);
+
+ trace2_region_enter("pack-bitmap", "boundary-traverse", the_repository);
+ revs->boundary = 1;
+ traverse_commit_list_filtered(revs,
+ show_boundary_commit,
+ show_boundary_object,
+ &cb, NULL);
+ revs->boundary = 0;
+ trace2_region_leave("pack-bitmap", "boundary-traverse", the_repository);
+
+ revs->blob_objects = tmp_blobs;
+ revs->tree_objects = tmp_trees;
+ revs->tag_objects = tmp_tags;
+
+ reset_revision_walk();
+ clear_object_flags(UNINTERESTING);
+
+ /*
+ * Then add the boundary commit(s) as fill-in traversal tips.
+ */
+ trace2_region_enter("pack-bitmap", "boundary-fill-in", the_repository);
+ for (i = 0; i < cb.boundary.nr; i++) {
+ struct object *obj = cb.boundary.objects[i].item;
+ if (bitmap_walk_contains(bitmap_git, cb.base, &obj->oid))
+ obj->flags |= SEEN;
+ else
+ add_pending_object(revs, obj, "");
+ }
+ if (revs->pending.nr)
+ cb.base = fill_in_bitmap(bitmap_git, revs, cb.base, NULL);
+ trace2_region_leave("pack-bitmap", "boundary-fill-in", the_repository);
+
+cleanup:
+ object_array_clear(&cb.boundary);
+ revs->ignore_missing_links = 0;
+
+ return cb.base;
+}
+
static struct bitmap *find_objects(struct bitmap_index *bitmap_git,
struct rev_info *revs,
struct object_list *roots,
@@ -816,35 +1263,23 @@ static struct bitmap *find_objects(struct bitmap_index *bitmap_git,
}
if (needs_walk) {
- struct include_data incdata;
- struct bitmap_show_data show_data;
-
- if (!base)
- base = bitmap_new();
-
- incdata.bitmap_git = bitmap_git;
- incdata.base = base;
- incdata.seen = seen;
-
- revs->include_check = should_include;
- revs->include_check_obj = should_include_obj;
- revs->include_check_data = &incdata;
-
- if (prepare_revision_walk(revs))
- die("revision walk setup failed");
-
- show_data.bitmap_git = bitmap_git;
- show_data.base = base;
-
- traverse_commit_list(revs,
- show_commit, show_object,
- &show_data);
-
- revs->include_check = NULL;
- revs->include_check_obj = NULL;
- revs->include_check_data = NULL;
+ /*
+ * This fill-in traversal may walk over some objects
+ * again, since we have already traversed in order to
+ * find the boundary.
+ *
+ * But this extra walk should be extremely cheap, since
+ * all commit objects are loaded into memory, and
+ * because we skip walking to parents that are
+ * UNINTERESTING, since it will be marked in the haves
+ * bitmap already (or it has an on-disk bitmap, since
+ * OR-ing it in covers all of its ancestors).
+ */
+ base = fill_in_bitmap(bitmap_git, revs, base, seen);
}
+ object_list_free(&not_mapped);
+
return base;
}
@@ -859,7 +1294,7 @@ static void show_extended_objects(struct bitmap_index *bitmap_git,
for (i = 0; i < eindex->count; ++i) {
struct object *obj;
- if (!bitmap_get(objects, bitmap_num_objects(bitmap_git) + i))
+ if (!bitmap_get(objects, st_add(bitmap_num_objects(bitmap_git), i)))
continue;
obj = eindex->objects[i];
@@ -1038,7 +1473,7 @@ static void filter_bitmap_exclude_type(struct bitmap_index *bitmap_git,
* them individually.
*/
for (i = 0; i < eindex->count; i++) {
- uint32_t pos = i + bitmap_num_objects(bitmap_git);
+ size_t pos = st_add(i, bitmap_num_objects(bitmap_git));
if (eindex->objects[i]->type == type &&
bitmap_get(to_filter, pos) &&
!bitmap_get(tips, pos))
@@ -1129,7 +1564,7 @@ static void filter_bitmap_blob_limit(struct bitmap_index *bitmap_git,
}
for (i = 0; i < eindex->count; i++) {
- uint32_t pos = i + bitmap_num_objects(bitmap_git);
+ size_t pos = st_add(i, bitmap_num_objects(bitmap_git));
if (eindex->objects[i]->type == OBJ_BLOB &&
bitmap_get(to_filter, pos) &&
!bitmap_get(tips, pos) &&
@@ -1231,10 +1666,35 @@ static int can_filter_bitmap(struct list_objects_filter_options *filter)
return !filter_bitmap(NULL, NULL, NULL, filter);
}
+
+static void filter_packed_objects_from_bitmap(struct bitmap_index *bitmap_git,
+ struct bitmap *result)
+{
+ struct eindex *eindex = &bitmap_git->ext_index;
+ uint32_t objects_nr;
+ size_t i, pos;
+
+ objects_nr = bitmap_num_objects(bitmap_git);
+ pos = objects_nr / BITS_IN_EWORD;
+
+ if (pos > result->word_alloc)
+ pos = result->word_alloc;
+
+ memset(result->words, 0x00, sizeof(eword_t) * pos);
+ for (i = pos * BITS_IN_EWORD; i < objects_nr; i++)
+ bitmap_unset(result, i);
+
+ for (i = 0; i < eindex->count; ++i) {
+ if (has_object_pack(&eindex->objects[i]->oid))
+ bitmap_unset(result, objects_nr + i);
+ }
+}
+
struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
int filter_provided_objects)
{
unsigned int i;
+ int use_boundary_traversal;
struct object_list *wants = NULL;
struct object_list *haves = NULL;
@@ -1285,13 +1745,21 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
object_list_insert(object, &wants);
}
- /*
- * if we have a HAVES list, but none of those haves is contained
- * in the packfile that has a bitmap, we don't have anything to
- * optimize here
- */
- if (haves && !in_bitmapped_pack(bitmap_git, haves))
- goto cleanup;
+ use_boundary_traversal = git_env_bool(GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL, -1);
+ if (use_boundary_traversal < 0) {
+ prepare_repo_settings(revs->repo);
+ use_boundary_traversal = revs->repo->settings.pack_use_bitmap_boundary_traversal;
+ }
+
+ if (!use_boundary_traversal) {
+ /*
+ * if we have a HAVES list, but none of those haves is contained
+ * in the packfile that has a bitmap, we don't have anything to
+ * optimize here
+ */
+ if (haves && !in_bitmapped_pack(bitmap_git, haves))
+ goto cleanup;
+ }
/* if we don't want anything, we're done here */
if (!wants)
@@ -1302,21 +1770,35 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
* from disk. this is the point of no return; after this the rev_list
* becomes invalidated and we must perform the revwalk through bitmaps
*/
- if (load_bitmap(bitmap_git) < 0)
+ if (load_bitmap(revs->repo, bitmap_git) < 0)
goto cleanup;
- object_array_clear(&revs->pending);
+ if (!use_boundary_traversal)
+ object_array_clear(&revs->pending);
if (haves) {
- revs->ignore_missing_links = 1;
- haves_bitmap = find_objects(bitmap_git, revs, haves, NULL);
- reset_revision_walk();
- revs->ignore_missing_links = 0;
+ if (use_boundary_traversal) {
+ trace2_region_enter("pack-bitmap", "haves/boundary", the_repository);
+ haves_bitmap = find_boundary_objects(bitmap_git, revs, haves);
+ trace2_region_leave("pack-bitmap", "haves/boundary", the_repository);
+ } else {
+ trace2_region_enter("pack-bitmap", "haves/classic", the_repository);
+ revs->ignore_missing_links = 1;
+ haves_bitmap = find_objects(bitmap_git, revs, haves, NULL);
+ reset_revision_walk();
+ revs->ignore_missing_links = 0;
+ trace2_region_leave("pack-bitmap", "haves/classic", the_repository);
+ }
if (!haves_bitmap)
BUG("failed to perform bitmap walk");
}
+ if (use_boundary_traversal) {
+ object_array_clear(&revs->pending);
+ reset_revision_walk();
+ }
+
wants_bitmap = find_objects(bitmap_git, revs, wants, haves_bitmap);
if (!wants_bitmap)
@@ -1330,6 +1812,9 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
wants_bitmap,
&revs->filter);
+ if (revs->unpacked)
+ filter_packed_objects_from_bitmap(bitmap_git, wants_bitmap);
+
bitmap_git->result = wants_bitmap;
bitmap_git->haves = haves_bitmap;
@@ -1349,8 +1834,10 @@ cleanup:
* -1 means "stop trying further objects"; 0 means we may or may not have
* reused, but you can keep feeding bits.
*/
-static int try_partial_reuse(struct packed_git *pack,
- size_t pos,
+static int try_partial_reuse(struct bitmap_index *bitmap_git,
+ struct bitmapped_pack *pack,
+ size_t bitmap_pos,
+ uint32_t pack_pos,
struct bitmap *reuse,
struct pack_window **w_curs)
{
@@ -1358,40 +1845,18 @@ static int try_partial_reuse(struct packed_git *pack,
enum object_type type;
unsigned long size;
- /*
- * try_partial_reuse() is called either on (a) objects in the
- * bitmapped pack (in the case of a single-pack bitmap) or (b)
- * objects in the preferred pack of a multi-pack bitmap.
- * Importantly, the latter can pretend as if only a single pack
- * exists because:
- *
- * - The first pack->num_objects bits of a MIDX bitmap are
- * reserved for the preferred pack, and
- *
- * - Ties due to duplicate objects are always resolved in
- * favor of the preferred pack.
- *
- * Therefore we do not need to ever ask the MIDX for its copy of
- * an object by OID, since it will always select it from the
- * preferred pack. Likewise, the selected copy of the base
- * object for any deltas will reside in the same pack.
- *
- * This means that we can reuse pos when looking up the bit in
- * the reuse bitmap, too, since bits corresponding to the
- * preferred pack precede all bits from other packs.
- */
-
- if (pos >= pack->num_objects)
- return -1; /* not actually in the pack or MIDX preferred pack */
+ if (pack_pos >= pack->p->num_objects)
+ return -1; /* not actually in the pack */
- offset = delta_obj_offset = pack_pos_to_offset(pack, pos);
- type = unpack_object_header(pack, w_curs, &offset, &size);
+ offset = delta_obj_offset = pack_pos_to_offset(pack->p, pack_pos);
+ type = unpack_object_header(pack->p, w_curs, &offset, &size);
if (type < 0)
return -1; /* broken packfile, punt */
if (type == OBJ_REF_DELTA || type == OBJ_OFS_DELTA) {
off_t base_offset;
uint32_t base_pos;
+ uint32_t base_bitmap_pos;
/*
* Find the position of the base object so we can look it up
@@ -1401,24 +1866,48 @@ static int try_partial_reuse(struct packed_git *pack,
* and the normal slow path will complain about it in
* more detail.
*/
- base_offset = get_delta_base(pack, w_curs, &offset, type,
+ base_offset = get_delta_base(pack->p, w_curs, &offset, type,
delta_obj_offset);
if (!base_offset)
return 0;
- if (offset_to_pack_pos(pack, base_offset, &base_pos) < 0)
- return 0;
- /*
- * We assume delta dependencies always point backwards. This
- * lets us do a single pass, and is basically always true
- * due to the way OFS_DELTAs work. You would not typically
- * find REF_DELTA in a bitmapped pack, since we only bitmap
- * packs we write fresh, and OFS_DELTA is the default). But
- * let's double check to make sure the pack wasn't written with
- * odd parameters.
- */
- if (base_pos >= pos)
- return 0;
+ offset_to_pack_pos(pack->p, base_offset, &base_pos);
+
+ if (bitmap_is_midx(bitmap_git)) {
+ /*
+ * Cross-pack deltas are rejected for now, but could
+ * theoretically be supported in the future.
+ *
+ * We would need to ensure that we're sending both
+ * halves of the delta/base pair, regardless of whether
+ * or not the two cross a pack boundary. If they do,
+ * then we must convert the delta to an REF_DELTA to
+ * refer back to the base in the other pack.
+ * */
+ if (midx_pair_to_pack_pos(bitmap_git->midx,
+ pack->pack_int_id,
+ base_offset,
+ &base_bitmap_pos) < 0) {
+ return 0;
+ }
+ } else {
+ if (offset_to_pack_pos(pack->p, base_offset,
+ &base_pos) < 0)
+ return 0;
+ /*
+ * We assume delta dependencies always point backwards.
+ * This lets us do a single pass, and is basically
+ * always true due to the way OFS_DELTAs work. You would
+ * not typically find REF_DELTA in a bitmapped pack,
+ * since we only bitmap packs we write fresh, and
+ * OFS_DELTA is the default). But let's double check to
+ * make sure the pack wasn't written with odd
+ * parameters.
+ */
+ if (base_pos >= pack_pos)
+ return 0;
+ base_bitmap_pos = pack->bitmap_pos + base_pos;
+ }
/*
* And finally, if we're not sending the base as part of our
@@ -1428,76 +1917,89 @@ static int try_partial_reuse(struct packed_git *pack,
* to REF_DELTA on the fly. Better to just let the normal
* object_entry code path handle it.
*/
- if (!bitmap_get(reuse, base_pos))
+ if (!bitmap_get(reuse, base_bitmap_pos))
return 0;
}
/*
* If we got here, then the object is OK to reuse. Mark it.
*/
- bitmap_set(reuse, pos);
+ bitmap_set(reuse, bitmap_pos);
return 0;
}
-uint32_t midx_preferred_pack(struct bitmap_index *bitmap_git)
+static void reuse_partial_packfile_from_bitmap_1(struct bitmap_index *bitmap_git,
+ struct bitmapped_pack *pack,
+ struct bitmap *reuse)
{
- struct multi_pack_index *m = bitmap_git->midx;
- if (!m)
- BUG("midx_preferred_pack: requires non-empty MIDX");
- return nth_midxed_pack_int_id(m, pack_pos_to_midx(bitmap_git->midx, 0));
-}
-
-int reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
- struct packed_git **packfile_out,
- uint32_t *entries,
- struct bitmap **reuse_out)
-{
- struct packed_git *pack;
struct bitmap *result = bitmap_git->result;
- struct bitmap *reuse;
struct pack_window *w_curs = NULL;
- size_t i = 0;
- uint32_t offset;
- uint32_t objects_nr;
+ size_t pos = pack->bitmap_pos / BITS_IN_EWORD;
- assert(result);
+ if (!pack->bitmap_pos) {
+ /*
+ * If we're processing the first (in the case of a MIDX, the
+ * preferred pack) or the only (in the case of single-pack
+ * bitmaps) pack, then we can reuse whole words at a time.
+ *
+ * This is because we know that any deltas in this range *must*
+ * have their bases chosen from the same pack, since:
+ *
+ * - In the single pack case, there is no other pack to choose
+ * them from.
+ *
+ * - In the MIDX case, the first pack is the preferred pack, so
+ * all ties are broken in favor of that pack (i.e. the one
+ * we're currently processing). So any duplicate bases will be
+ * resolved in favor of the pack we're processing.
+ */
+ while (pos < result->word_alloc &&
+ pos < pack->bitmap_nr / BITS_IN_EWORD &&
+ result->words[pos] == (eword_t)~0)
+ pos++;
+ memset(reuse->words, 0xFF, pos * sizeof(eword_t));
+ }
- load_reverse_index(bitmap_git);
+ for (; pos < result->word_alloc; pos++) {
+ eword_t word = result->words[pos];
+ size_t offset;
- if (bitmap_is_midx(bitmap_git))
- pack = bitmap_git->midx->packs[midx_preferred_pack(bitmap_git)];
- else
- pack = bitmap_git->pack;
- objects_nr = pack->num_objects;
+ for (offset = 0; offset < BITS_IN_EWORD; offset++) {
+ size_t bit_pos;
+ uint32_t pack_pos;
- while (i < result->word_alloc && result->words[i] == (eword_t)~0)
- i++;
+ if (word >> offset == 0)
+ break;
- /*
- * Don't mark objects not in the packfile or preferred pack. This bitmap
- * marks objects eligible for reuse, but the pack-reuse code only
- * understands how to reuse a single pack. Since the preferred pack is
- * guaranteed to have all bases for its deltas (in a multi-pack bitmap),
- * we use it instead of another pack. In single-pack bitmaps, the choice
- * is made for us.
- */
- if (i > objects_nr / BITS_IN_EWORD)
- i = objects_nr / BITS_IN_EWORD;
+ offset += ewah_bit_ctz64(word >> offset);
- reuse = bitmap_word_alloc(i);
- memset(reuse->words, 0xFF, i * sizeof(eword_t));
+ bit_pos = pos * BITS_IN_EWORD + offset;
+ if (bit_pos < pack->bitmap_pos)
+ continue;
+ if (bit_pos >= pack->bitmap_pos + pack->bitmap_nr)
+ goto done;
- for (; i < result->word_alloc; ++i) {
- eword_t word = result->words[i];
- size_t pos = (i * BITS_IN_EWORD);
+ if (bitmap_is_midx(bitmap_git)) {
+ uint32_t midx_pos;
+ off_t ofs;
- for (offset = 0; offset < BITS_IN_EWORD; ++offset) {
- if ((word >> offset) == 0)
- break;
+ midx_pos = pack_pos_to_midx(bitmap_git->midx, bit_pos);
+ ofs = nth_midxed_offset(bitmap_git->midx, midx_pos);
- offset += ewah_bit_ctz64(word >> offset);
- if (try_partial_reuse(pack, pos + offset,
- reuse, &w_curs) < 0) {
+ if (offset_to_pack_pos(pack->p, ofs, &pack_pos) < 0)
+ BUG("could not find object in pack %s "
+ "at offset %"PRIuMAX" in MIDX",
+ pack_basename(pack->p), (uintmax_t)ofs);
+ } else {
+ pack_pos = cast_size_t_to_uint32_t(st_sub(bit_pos, pack->bitmap_pos));
+ if (pack_pos >= pack->p->num_objects)
+ BUG("advanced beyond the end of pack %s (%"PRIuMAX" > %"PRIu32")",
+ pack_basename(pack->p), (uintmax_t)pack_pos,
+ pack->p->num_objects);
+ }
+
+ if (try_partial_reuse(bitmap_git, pack, bit_pos,
+ pack_pos, reuse, &w_curs) < 0) {
/*
* try_partial_reuse indicated we couldn't reuse
* any bits, so there is no point in trying more
@@ -1514,11 +2016,97 @@ int reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
done:
unuse_pack(&w_curs);
+}
- *entries = bitmap_popcount(reuse);
- if (!*entries) {
- bitmap_free(reuse);
+static int bitmapped_pack_cmp(const void *va, const void *vb)
+{
+ const struct bitmapped_pack *a = va;
+ const struct bitmapped_pack *b = vb;
+
+ if (a->bitmap_pos < b->bitmap_pos)
return -1;
+ if (a->bitmap_pos > b->bitmap_pos)
+ return 1;
+ return 0;
+}
+
+void reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
+ struct bitmapped_pack **packs_out,
+ size_t *packs_nr_out,
+ struct bitmap **reuse_out,
+ int multi_pack_reuse)
+{
+ struct repository *r = the_repository;
+ struct bitmapped_pack *packs = NULL;
+ struct bitmap *result = bitmap_git->result;
+ struct bitmap *reuse;
+ size_t i;
+ size_t packs_nr = 0, packs_alloc = 0;
+ size_t word_alloc;
+ uint32_t objects_nr = 0;
+
+ assert(result);
+
+ load_reverse_index(r, bitmap_git);
+
+ if (bitmap_is_midx(bitmap_git)) {
+ for (i = 0; i < bitmap_git->midx->num_packs; i++) {
+ struct bitmapped_pack pack;
+ if (nth_bitmapped_pack(r, bitmap_git->midx, &pack, i) < 0) {
+ warning(_("unable to load pack: '%s', disabling pack-reuse"),
+ bitmap_git->midx->pack_names[i]);
+ free(packs);
+ return;
+ }
+
+ if (!pack.bitmap_nr)
+ continue;
+
+ if (!multi_pack_reuse && pack.bitmap_pos) {
+ /*
+ * If we're only reusing a single pack, skip
+ * over any packs which are not positioned at
+ * the beginning of the MIDX bitmap.
+ *
+ * This is consistent with the existing
+ * single-pack reuse behavior, which only reuses
+ * parts of the MIDX's preferred pack.
+ */
+ continue;
+ }
+
+ ALLOC_GROW(packs, packs_nr + 1, packs_alloc);
+ memcpy(&packs[packs_nr++], &pack, sizeof(pack));
+
+ objects_nr += pack.p->num_objects;
+
+ if (!multi_pack_reuse)
+ break;
+ }
+
+ QSORT(packs, packs_nr, bitmapped_pack_cmp);
+ } else {
+ ALLOC_GROW(packs, packs_nr + 1, packs_alloc);
+
+ packs[packs_nr].p = bitmap_git->pack;
+ packs[packs_nr].bitmap_nr = bitmap_git->pack->num_objects;
+ packs[packs_nr].bitmap_pos = 0;
+
+ objects_nr = packs[packs_nr++].bitmap_nr;
+ }
+
+ word_alloc = objects_nr / BITS_IN_EWORD;
+ if (objects_nr % BITS_IN_EWORD)
+ word_alloc++;
+ reuse = bitmap_word_alloc(word_alloc);
+
+ for (i = 0; i < packs_nr; i++)
+ reuse_partial_packfile_from_bitmap_1(bitmap_git, &packs[i], reuse);
+
+ if (bitmap_is_empty(reuse)) {
+ free(packs);
+ bitmap_free(reuse);
+ return;
}
/*
@@ -1526,9 +2114,9 @@ done:
* need to be handled separately.
*/
bitmap_and_not(result, reuse);
- *packfile_out = pack;
+ *packs_out = packs;
+ *packs_nr_out = packs_nr;
*reuse_out = reuse;
- return 0;
}
int bitmap_walk_contains(struct bitmap_index *bitmap_git,
@@ -1579,7 +2167,8 @@ static uint32_t count_object_type(struct bitmap_index *bitmap_git,
for (i = 0; i < eindex->count; ++i) {
if (eindex->objects[i]->type == type &&
- bitmap_get(objects, bitmap_num_objects(bitmap_git) + i))
+ bitmap_get(objects,
+ st_add(bitmap_num_objects(bitmap_git), i)))
count++;
}
@@ -1640,21 +2229,22 @@ static void test_bitmap_type(struct bitmap_test_data *tdata,
}
if (bitmap_type == OBJ_NONE)
- die("object %s not found in type bitmaps",
+ die(_("object '%s' not found in type bitmaps"),
oid_to_hex(&obj->oid));
if (bitmaps_nr > 1)
- die("object %s does not have a unique type",
+ die(_("object '%s' does not have a unique type"),
oid_to_hex(&obj->oid));
if (bitmap_type != obj->type)
- die("object %s: real type %s, expected: %s",
+ die(_("object '%s': real type '%s', expected: '%s'"),
oid_to_hex(&obj->oid),
type_name(obj->type),
type_name(bitmap_type));
}
-static void test_show_object(struct object *object, const char *name,
+static void test_show_object(struct object *object,
+ const char *name UNUSED,
void *data)
{
struct bitmap_test_data *tdata = data;
@@ -1662,7 +2252,7 @@ static void test_show_object(struct object *object, const char *name,
bitmap_pos = bitmap_position(tdata->bitmap_git, &object->oid);
if (bitmap_pos < 0)
- die("Object not in bitmap: %s\n", oid_to_hex(&object->oid));
+ die(_("object not in bitmap: '%s'"), oid_to_hex(&object->oid));
test_bitmap_type(tdata, object, bitmap_pos);
bitmap_set(tdata->base, bitmap_pos);
@@ -1677,7 +2267,7 @@ static void test_show_commit(struct commit *commit, void *data)
bitmap_pos = bitmap_position(tdata->bitmap_git,
&commit->object.oid);
if (bitmap_pos < 0)
- die("Object not in bitmap: %s\n", oid_to_hex(&commit->object.oid));
+ die(_("object not in bitmap: '%s'"), oid_to_hex(&commit->object.oid));
test_bitmap_type(tdata, &commit->object, bitmap_pos);
bitmap_set(tdata->base, bitmap_pos);
@@ -1694,26 +2284,28 @@ void test_bitmap_walk(struct rev_info *revs)
struct ewah_bitmap *bm;
if (!(bitmap_git = prepare_bitmap_git(revs->repo)))
- die("failed to load bitmap indexes");
+ die(_("failed to load bitmap indexes"));
if (revs->pending.nr != 1)
- die("you must specify exactly one commit to test");
+ die(_("you must specify exactly one commit to test"));
- fprintf(stderr, "Bitmap v%d test (%d entries loaded)\n",
- bitmap_git->version, bitmap_git->entry_count);
+ fprintf_ln(stderr, "Bitmap v%d test (%d entries%s)",
+ bitmap_git->version,
+ bitmap_git->entry_count,
+ bitmap_git->table_lookup ? "" : " loaded");
root = revs->pending.objects[0].item;
bm = bitmap_for_commit(bitmap_git, (struct commit *)root);
if (bm) {
- fprintf(stderr, "Found bitmap for %s. %d bits / %08x checksum\n",
+ fprintf_ln(stderr, "Found bitmap for '%s'. %d bits / %08x checksum",
oid_to_hex(&root->oid), (int)bm->bit_size, ewah_checksum(bm));
result = ewah_to_bitmap(bm);
}
if (!result)
- die("Commit %s doesn't have an indexed bitmap", oid_to_hex(&root->oid));
+ die(_("commit '%s' doesn't have an indexed bitmap"), oid_to_hex(&root->oid));
revs->tag_objects = 1;
revs->tree_objects = 1;
@@ -1722,7 +2314,7 @@ void test_bitmap_walk(struct rev_info *revs)
result_popcnt = bitmap_popcount(result);
if (prepare_revision_walk(revs))
- die("revision walk setup failed");
+ die(_("revision walk setup failed"));
tdata.bitmap_git = bitmap_git;
tdata.base = bitmap_new();
@@ -1738,9 +2330,9 @@ void test_bitmap_walk(struct rev_info *revs)
stop_progress(&tdata.prg);
if (bitmap_equals(result, tdata.base))
- fprintf(stderr, "OK!\n");
+ fprintf_ln(stderr, "OK!");
else
- die("mismatch in bitmap results");
+ die(_("mismatch in bitmap results"));
bitmap_free(result);
bitmap_free(tdata.base);
@@ -1753,15 +2345,24 @@ void test_bitmap_walk(struct rev_info *revs)
int test_bitmap_commits(struct repository *r)
{
- struct bitmap_index *bitmap_git = prepare_bitmap_git(r);
struct object_id oid;
MAYBE_UNUSED void *value;
+ struct bitmap_index *bitmap_git = prepare_bitmap_git(r);
if (!bitmap_git)
- die("failed to load bitmap indexes");
+ die(_("failed to load bitmap indexes"));
+
+ /*
+ * As this function is only used to print bitmap selected
+ * commits, we don't have to read the commit table.
+ */
+ if (bitmap_git->table_lookup) {
+ if (load_bitmap_entries_v1(bitmap_git) < 0)
+ die(_("failed to load bitmap indexes"));
+ }
kh_foreach(bitmap_git->bitmaps, oid, value, {
- printf("%s\n", oid_to_hex(&oid));
+ printf_ln("%s", oid_to_hex(&oid));
});
free_bitmap_index(bitmap_git);
@@ -1786,7 +2387,7 @@ int test_bitmap_hashes(struct repository *r)
nth_bitmap_object_oid(bitmap_git, &oid, index_pos);
- printf("%s %"PRIu32"\n",
+ printf_ln("%s %"PRIu32"",
oid_to_hex(&oid), get_be32(bitmap_git->hashes + index_pos));
}
@@ -1830,12 +2431,13 @@ int rebuild_bitmap(const uint32_t *reposition,
uint32_t *create_bitmap_mapping(struct bitmap_index *bitmap_git,
struct packing_data *mapping)
{
+ struct repository *r = the_repository;
uint32_t i, num_objects;
uint32_t *reposition;
if (!bitmap_is_midx(bitmap_git))
- load_reverse_index(bitmap_git);
- else if (load_midx_revindex(bitmap_git->midx) < 0)
+ load_reverse_index(r, bitmap_git);
+ else if (load_midx_revindex(bitmap_git->midx))
BUG("rebuild_existing_bitmaps: missing required rev-cache "
"extension");
@@ -1948,7 +2550,7 @@ static off_t get_disk_usage_for_type(struct bitmap_index *bitmap_git,
struct object_id oid;
nth_midxed_object_oid(&oid, bitmap_git->midx, midx_pos);
- die(_("could not find %s in pack %s at offset %"PRIuMAX),
+ die(_("could not find '%s' in pack '%s' at offset %"PRIuMAX),
oid_to_hex(&oid),
pack->pack_name,
(uintmax_t)offset);
@@ -1980,11 +2582,12 @@ static off_t get_disk_usage_for_extended(struct bitmap_index *bitmap_git)
for (i = 0; i < eindex->count; i++) {
struct object *obj = eindex->objects[i];
- if (!bitmap_get(result, bitmap_num_objects(bitmap_git) + i))
+ if (!bitmap_get(result,
+ st_add(bitmap_num_objects(bitmap_git), i)))
continue;
if (oid_object_info_extended(the_repository, &obj->oid, &oi, 0) < 0)
- die(_("unable to get disk usage of %s"),
+ die(_("unable to get disk usage of '%s'"),
oid_to_hex(&obj->oid));
total += object_size;
@@ -2017,7 +2620,11 @@ int bitmap_is_midx(struct bitmap_index *bitmap_git)
const struct string_list *bitmap_preferred_tips(struct repository *r)
{
- return repo_config_get_value_multi(r, "pack.preferbitmaptips");
+ const struct string_list *dest;
+
+ if (!repo_config_get_string_multi(r, "pack.preferbitmaptips", &dest))
+ return dest;
+ return NULL;
}
int bitmap_is_preferred_refname(struct repository *r, const char *refname)
@@ -2035,3 +2642,48 @@ int bitmap_is_preferred_refname(struct repository *r, const char *refname)
return 0;
}
+
+static int verify_bitmap_file(const char *name)
+{
+ struct stat st;
+ unsigned char *data;
+ int fd = git_open(name);
+ int res = 0;
+
+ /* It is OK to not have the file. */
+ if (fd < 0 || fstat(fd, &st)) {
+ if (fd >= 0)
+ close(fd);
+ return 0;
+ }
+
+ data = xmmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+ close(fd);
+ if (!hashfile_checksum_valid(data, st.st_size))
+ res = error(_("bitmap file '%s' has invalid checksum"),
+ name);
+
+ munmap(data, st.st_size);
+ return res;
+}
+
+int verify_bitmap_files(struct repository *r)
+{
+ int res = 0;
+
+ for (struct multi_pack_index *m = get_multi_pack_index(r);
+ m; m = m->next) {
+ char *midx_bitmap_name = midx_bitmap_filename(m);
+ res |= verify_bitmap_file(midx_bitmap_name);
+ free(midx_bitmap_name);
+ }
+
+ for (struct packed_git *p = get_all_packs(r);
+ p; p = p->next) {
+ char *pack_bitmap_name = pack_bitmap_filename(p);
+ res |= verify_bitmap_file(pack_bitmap_name);
+ free(pack_bitmap_name);
+ }
+
+ return res;
+}
diff --git a/pack-bitmap.h b/pack-bitmap.h
index 3d3ddd7..c7dea13 100644
--- a/pack-bitmap.h
+++ b/pack-bitmap.h
@@ -23,9 +23,19 @@ struct bitmap_disk_header {
#define NEEDS_BITMAP (1u<<22)
+/*
+ * The width in bytes of a single triplet in the lookup table
+ * extension:
+ * (commit_pos, offset, xor_row)
+ *
+ * whose fields ar 32-, 64-, 32- bits wide, respectively.
+ */
+#define BITMAP_LOOKUP_TABLE_TRIPLET_WIDTH (16)
+
enum pack_bitmap_opts {
- BITMAP_OPT_FULL_DAG = 1,
- BITMAP_OPT_HASH_CACHE = 4,
+ BITMAP_OPT_FULL_DAG = 0x1,
+ BITMAP_OPT_HASH_CACHE = 0x4,
+ BITMAP_OPT_LOOKUP_TABLE = 0x10,
};
enum pack_bitmap_flags {
@@ -42,6 +52,15 @@ typedef int (*show_reachable_fn)(
struct bitmap_index;
+struct bitmapped_pack {
+ struct packed_git *p;
+
+ uint32_t bitmap_pos;
+ uint32_t bitmap_nr;
+
+ uint32_t pack_int_id; /* MIDX only */
+};
+
struct bitmap_index *prepare_bitmap_git(struct repository *r);
struct bitmap_index *prepare_midx_bitmap_git(struct multi_pack_index *midx);
void count_bitmap_commit_list(struct bitmap_index *, uint32_t *commits,
@@ -52,13 +71,17 @@ void traverse_bitmap_commit_list(struct bitmap_index *,
void test_bitmap_walk(struct rev_info *revs);
int test_bitmap_commits(struct repository *r);
int test_bitmap_hashes(struct repository *r);
+
+#define GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL \
+ "GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL"
+
struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
int filter_provided_objects);
-uint32_t midx_preferred_pack(struct bitmap_index *bitmap_git);
-int reuse_partial_packfile_from_bitmap(struct bitmap_index *,
- struct packed_git **packfile,
- uint32_t *entries,
- struct bitmap **reuse_out);
+void reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
+ struct bitmapped_pack **packs_out,
+ size_t *packs_nr_out,
+ struct bitmap **reuse_out,
+ int multi_pack_reuse);
int rebuild_existing_bitmaps(struct bitmap_index *, struct packing_data *mapping,
kh_oid_map_t *reused_bitmaps, int show_progress);
void free_bitmap_index(struct bitmap_index *);
@@ -75,7 +98,7 @@ int bitmap_has_oid_in_uninteresting(struct bitmap_index *, const struct object_i
off_t get_disk_usage_from_bitmap(struct bitmap_index *, struct rev_info *);
void bitmap_writer_show_progress(int show);
-void bitmap_writer_set_checksum(unsigned char *sha1);
+void bitmap_writer_set_checksum(const unsigned char *sha1);
void bitmap_writer_build_type_index(struct packing_data *to_pack,
struct pack_idx_entry **index,
uint32_t index_nr);
@@ -101,4 +124,6 @@ int bitmap_is_midx(struct bitmap_index *bitmap_git);
const struct string_list *bitmap_preferred_tips(struct repository *r);
int bitmap_is_preferred_refname(struct repository *r, const char *refname);
+int verify_bitmap_files(struct repository *r);
+
#endif
diff --git a/pack-check.c b/pack-check.c
index bfb593b..25104d5 100644
--- a/pack-check.c
+++ b/pack-check.c
@@ -1,10 +1,12 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "environment.h"
+#include "hex.h"
#include "repository.h"
#include "pack.h"
-#include "pack-revindex.h"
#include "progress.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
struct idx_entry {
off_t offset;
diff --git a/pack-mtimes.c b/pack-mtimes.c
index 0f9785f..cdf30b8 100644
--- a/pack-mtimes.c
+++ b/pack-mtimes.c
@@ -1,7 +1,10 @@
#include "git-compat-util.h"
+#include "gettext.h"
#include "pack-mtimes.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
#include "packfile.h"
+#include "strbuf.h"
static char *pack_mtimes_filename(struct packed_git *p)
{
diff --git a/pack-mtimes.h b/pack-mtimes.h
index cc957b3..107327c 100644
--- a/pack-mtimes.h
+++ b/pack-mtimes.h
@@ -1,8 +1,6 @@
#ifndef PACK_MTIMES_H
#define PACK_MTIMES_H
-#include "git-compat-util.h"
-
#define MTIMES_SIGNATURE 0x4d544d45 /* "MTME" */
#define MTIMES_VERSION 1
diff --git a/pack-objects.c b/pack-objects.c
index 272e8d4..a9d9855 100644
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -1,9 +1,9 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "object.h"
#include "pack.h"
#include "pack-objects.h"
#include "packfile.h"
-#include "config.h"
+#include "parse.h"
static uint32_t locate_object_entry_hash(struct packing_data *pdata,
const struct object_id *oid,
@@ -151,6 +151,21 @@ void prepare_packing_data(struct repository *r, struct packing_data *pdata)
init_recursive_mutex(&pdata->odb_lock);
}
+void clear_packing_data(struct packing_data *pdata)
+{
+ if (!pdata)
+ return;
+
+ free(pdata->cruft_mtime);
+ free(pdata->in_pack);
+ free(pdata->in_pack_by_idx);
+ free(pdata->in_pack_pos);
+ free(pdata->index);
+ free(pdata->layer);
+ free(pdata->objects);
+ free(pdata->tree_depth);
+}
+
struct object_entry *packlist_alloc(struct packing_data *pdata,
const struct object_id *oid)
{
diff --git a/pack-objects.h b/pack-objects.h
index 5794766..b9898a4 100644
--- a/pack-objects.h
+++ b/pack-objects.h
@@ -1,7 +1,7 @@
#ifndef PACK_OBJECTS_H
#define PACK_OBJECTS_H
-#include "object-store.h"
+#include "object-store-ll.h"
#include "thread-utils.h"
#include "pack.h"
@@ -169,6 +169,7 @@ struct packing_data {
};
void prepare_packing_data(struct repository *r, struct packing_data *pdata);
+void clear_packing_data(struct packing_data *pdata);
/* Protect access to object database */
static inline void packing_data_lock(struct packing_data *pdata)
diff --git a/pack-revindex.c b/pack-revindex.c
index 08dc160..a7624d8 100644
--- a/pack-revindex.c
+++ b/pack-revindex.c
@@ -1,9 +1,14 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "gettext.h"
#include "pack-revindex.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
#include "packfile.h"
-#include "config.h"
+#include "strbuf.h"
+#include "trace2.h"
+#include "parse.h"
#include "midx.h"
+#include "csum-file.h"
struct revindex_entry {
off_t offset;
@@ -204,10 +209,14 @@ static int load_revindex_from_disk(char *revindex_name,
size_t revindex_size;
struct revindex_header *hdr;
+ if (git_env_bool(GIT_TEST_REV_INDEX_DIE_ON_DISK, 0))
+ die("dying as requested by '%s'", GIT_TEST_REV_INDEX_DIE_ON_DISK);
+
fd = git_open(revindex_name);
if (fd < 0) {
- ret = -1;
+ /* "No file" means return 1. */
+ ret = 1;
goto cleanup;
}
if (fstat(fd, &st)) {
@@ -259,7 +268,7 @@ cleanup:
return ret;
}
-static int load_pack_revindex_from_disk(struct packed_git *p)
+int load_pack_revindex_from_disk(struct packed_git *p)
{
char *revindex_name;
int ret;
@@ -282,18 +291,69 @@ cleanup:
return ret;
}
-int load_pack_revindex(struct packed_git *p)
+int load_pack_revindex(struct repository *r, struct packed_git *p)
{
if (p->revindex || p->revindex_data)
return 0;
- if (!load_pack_revindex_from_disk(p))
+ prepare_repo_settings(r);
+
+ if (r->settings.pack_read_reverse_index &&
+ !load_pack_revindex_from_disk(p))
return 0;
else if (!create_pack_revindex_in_memory(p))
return 0;
return -1;
}
+/*
+ * verify_pack_revindex verifies that the on-disk rev-index for the given
+ * pack-file is the same that would be created if written from scratch.
+ *
+ * A negative number is returned on error.
+ */
+int verify_pack_revindex(struct packed_git *p)
+{
+ int res = 0;
+
+ /* Do not bother checking if not initialized. */
+ if (!p->revindex_map || !p->revindex_data)
+ return res;
+
+ if (!hashfile_checksum_valid((const unsigned char *)p->revindex_map, p->revindex_size)) {
+ error(_("invalid checksum"));
+ res = -1;
+ }
+
+ /* This may fail due to a broken .idx. */
+ if (create_pack_revindex_in_memory(p))
+ return res;
+
+ for (size_t i = 0; i < p->num_objects; i++) {
+ uint32_t nr = p->revindex[i].nr;
+ uint32_t rev_val = get_be32(p->revindex_data + i);
+
+ if (nr != rev_val) {
+ error(_("invalid rev-index position at %"PRIu64": %"PRIu32" != %"PRIu32""),
+ (uint64_t)i, nr, rev_val);
+ res = -1;
+ }
+ }
+
+ return res;
+}
+
+static int can_use_midx_ridx_chunk(struct multi_pack_index *m)
+{
+ if (!m->chunk_revindex)
+ return 0;
+ if (m->chunk_revindex_len != st_mult(sizeof(uint32_t), m->num_objects)) {
+ error(_("multi-pack-index reverse-index chunk is the wrong size"));
+ return 0;
+ }
+ return 1;
+}
+
int load_midx_revindex(struct multi_pack_index *m)
{
struct strbuf revindex_name = STRBUF_INIT;
@@ -302,7 +362,7 @@ int load_midx_revindex(struct multi_pack_index *m)
if (m->revindex_data)
return 0;
- if (m->chunk_revindex) {
+ if (can_use_midx_ridx_chunk(m)) {
/*
* If the MIDX `m` has a `RIDX` chunk, then use its contents for
* the reverse index instead of trying to load a separate `.rev`
@@ -355,7 +415,7 @@ int offset_to_pack_pos(struct packed_git *p, off_t ofs, uint32_t *pos)
{
unsigned lo, hi;
- if (load_pack_revindex(p) < 0)
+ if (load_pack_revindex(the_repository, p) < 0)
return -1;
lo = 0;
@@ -460,19 +520,12 @@ static int midx_pack_order_cmp(const void *va, const void *vb)
return 0;
}
-int midx_to_pack_pos(struct multi_pack_index *m, uint32_t at, uint32_t *pos)
+static int midx_key_to_pack_pos(struct multi_pack_index *m,
+ struct midx_pack_key *key,
+ uint32_t *pos)
{
- struct midx_pack_key key;
uint32_t *found;
- if (!m->revindex_data)
- BUG("midx_to_pack_pos: reverse index not yet loaded");
- if (m->num_objects <= at)
- BUG("midx_to_pack_pos: out-of-bounds object at %"PRIu32, at);
-
- key.pack = nth_midxed_pack_int_id(m, at);
- key.offset = nth_midxed_offset(m, at);
- key.midx = m;
/*
* The preferred pack sorts first, so determine its identifier by
* looking at the first object in pseudo-pack order.
@@ -482,14 +535,43 @@ int midx_to_pack_pos(struct multi_pack_index *m, uint32_t at, uint32_t *pos)
* implicitly is preferred (and includes all its objects, since ties are
* broken first by pack identifier).
*/
- key.preferred_pack = nth_midxed_pack_int_id(m, pack_pos_to_midx(m, 0));
+ if (midx_preferred_pack(key->midx, &key->preferred_pack) < 0)
+ return error(_("could not determine preferred pack"));
- found = bsearch(&key, m->revindex_data, m->num_objects,
- sizeof(*m->revindex_data), midx_pack_order_cmp);
+ found = bsearch(key, m->revindex_data, m->num_objects,
+ sizeof(*m->revindex_data),
+ midx_pack_order_cmp);
if (!found)
- return error("bad offset for revindex");
+ return -1;
*pos = found - m->revindex_data;
return 0;
}
+
+int midx_to_pack_pos(struct multi_pack_index *m, uint32_t at, uint32_t *pos)
+{
+ struct midx_pack_key key;
+
+ if (!m->revindex_data)
+ BUG("midx_to_pack_pos: reverse index not yet loaded");
+ if (m->num_objects <= at)
+ BUG("midx_to_pack_pos: out-of-bounds object at %"PRIu32, at);
+
+ key.pack = nth_midxed_pack_int_id(m, at);
+ key.offset = nth_midxed_offset(m, at);
+ key.midx = m;
+
+ return midx_key_to_pack_pos(m, &key, pos);
+}
+
+int midx_pair_to_pack_pos(struct multi_pack_index *m, uint32_t pack_int_id,
+ off_t ofs, uint32_t *pos)
+{
+ struct midx_pack_key key = {
+ .pack = pack_int_id,
+ .offset = ofs,
+ .midx = m,
+ };
+ return midx_key_to_pack_pos(m, &key, pos);
+}
diff --git a/pack-revindex.h b/pack-revindex.h
index 74f4eae..422c248 100644
--- a/pack-revindex.h
+++ b/pack-revindex.h
@@ -22,7 +22,7 @@
*
* - pack position refers to an object's position within a non-existent pack
* described by the MIDX. The pack structure is described in
- * Documentation/technical/pack-format.txt.
+ * gitformat-pack(5).
*
* It is effectively a concatanation of all packs in the MIDX (ordered by
* their numeric ID within the MIDX) in their original order within each
@@ -34,11 +34,13 @@
#define RIDX_SIGNATURE 0x52494458 /* "RIDX" */
#define RIDX_VERSION 1
-#define GIT_TEST_WRITE_REV_INDEX "GIT_TEST_WRITE_REV_INDEX"
+#define GIT_TEST_NO_WRITE_REV_INDEX "GIT_TEST_NO_WRITE_REV_INDEX"
#define GIT_TEST_REV_INDEX_DIE_IN_MEMORY "GIT_TEST_REV_INDEX_DIE_IN_MEMORY"
+#define GIT_TEST_REV_INDEX_DIE_ON_DISK "GIT_TEST_REV_INDEX_DIE_ON_DISK"
struct packed_git;
struct multi_pack_index;
+struct repository;
/*
* load_pack_revindex populates the revindex's internal data-structures for the
@@ -47,7 +49,23 @@ struct multi_pack_index;
* If a '.rev' file is present it is mmap'd, and pointers are assigned into it
* (instead of using the in-memory variant).
*/
-int load_pack_revindex(struct packed_git *p);
+int load_pack_revindex(struct repository *r, struct packed_git *p);
+
+/*
+ * Specifically load a pack revindex from disk.
+ *
+ * Returns 0 on success, 1 on "no .rev file", and -1 when there is an
+ * error parsing the .rev file.
+ */
+int load_pack_revindex_from_disk(struct packed_git *p);
+
+/*
+ * verify_pack_revindex verifies that the on-disk rev-index for the given
+ * pack-file is the same that would be created if written from scratch.
+ *
+ * A negative number is returned on error.
+ */
+int verify_pack_revindex(struct packed_git *p);
/*
* load_midx_revindex loads the '.rev' file corresponding to the given
@@ -124,4 +142,7 @@ uint32_t pack_pos_to_midx(struct multi_pack_index *m, uint32_t pos);
*/
int midx_to_pack_pos(struct multi_pack_index *midx, uint32_t at, uint32_t *pos);
+int midx_pair_to_pack_pos(struct multi_pack_index *midx, uint32_t pack_id,
+ off_t ofs, uint32_t *pos);
+
#endif
diff --git a/pack-write.c b/pack-write.c
index 00787e3..80ecfa5 100644
--- a/pack-write.c
+++ b/pack-write.c
@@ -1,12 +1,16 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "pack.h"
#include "csum-file.h"
#include "remote.h"
#include "chunk-format.h"
#include "pack-mtimes.h"
-#include "oidmap.h"
-#include "chunk-format.h"
#include "pack-objects.h"
+#include "pack-revindex.h"
+#include "path.h"
+#include "strbuf.h"
void reset_pack_idx_option(struct pack_idx_option *opts)
{
@@ -310,13 +314,13 @@ static void write_mtimes_trailer(struct hashfile *f, const unsigned char *hash)
hashwrite(f, hash, the_hash_algo->rawsz);
}
-static const char *write_mtimes_file(struct packing_data *to_pack,
- struct pack_idx_entry **objects,
- uint32_t nr_objects,
- const unsigned char *hash)
+static char *write_mtimes_file(struct packing_data *to_pack,
+ struct pack_idx_entry **objects,
+ uint32_t nr_objects,
+ const unsigned char *hash)
{
struct strbuf tmp_file = STRBUF_INIT;
- const char *mtimes_name;
+ char *mtimes_name;
struct hashfile *f;
int fd;
@@ -542,7 +546,7 @@ void stage_tmp_packfiles(struct strbuf *name_buffer,
char **idx_tmp_name)
{
const char *rev_tmp_name = NULL;
- const char *mtimes_tmp_name = NULL;
+ char *mtimes_tmp_name = NULL;
if (adjust_shared_perm(pack_tmp_name))
die_errno("unable to make temporary pack file readable");
@@ -566,6 +570,9 @@ void stage_tmp_packfiles(struct strbuf *name_buffer,
rename_tmp_packfile(name_buffer, rev_tmp_name, "rev");
if (mtimes_tmp_name)
rename_tmp_packfile(name_buffer, mtimes_tmp_name, "mtimes");
+
+ free((char *)rev_tmp_name);
+ free(mtimes_tmp_name);
}
void write_promisor_file(const char *promisor_name, struct ref **sought, int nr_sought)
diff --git a/pack.h b/pack.h
index 01d3859..3ab9e3f 100644
--- a/pack.h
+++ b/pack.h
@@ -4,6 +4,8 @@
#include "object.h"
#include "csum-file.h"
+struct packed_git;
+struct pack_window;
struct repository;
/*
diff --git a/packfile.c b/packfile.c
index 8e812a8..d4df7fd 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1,4 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "list.h"
#include "pack.h"
#include "repository.h"
@@ -6,16 +9,18 @@
#include "mergesort.h"
#include "packfile.h"
#include "delta.h"
-#include "streaming.h"
#include "hash-lookup.h"
#include "commit.h"
#include "object.h"
#include "tag.h"
+#include "trace.h"
#include "tree-walk.h"
#include "tree.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
#include "midx.h"
#include "commit-graph.h"
+#include "pack-revindex.h"
#include "promisor-remote.h"
char *odb_pack_name(struct strbuf *buf,
@@ -178,7 +183,7 @@ int load_idx(const char *path, const unsigned int hashsz, void *idx_map,
*/
(sizeof(off_t) <= 4))
return error("pack too large for current definition of off_t in %s", path);
- p->crc_offset = 8 + 4 * 256 + nr * hashsz;
+ p->crc_offset = st_add(8 + 4 * 256, st_mult(nr, hashsz));
}
p->index_version = version;
@@ -373,7 +378,7 @@ void close_object_store(struct raw_object_store *o)
void unlink_pack_path(const char *pack_name, int force_delete)
{
- static const char *exts[] = {".pack", ".idx", ".rev", ".keep", ".bitmap", ".promisor", ".mtimes"};
+ static const char *exts[] = {".idx", ".pack", ".rev", ".keep", ".bitmap", ".promisor", ".mtimes"};
int i;
struct strbuf buf = STRBUF_INIT;
size_t plen;
@@ -745,7 +750,7 @@ struct packed_git *add_packed_git(const char *path, size_t path_len, int local)
p->pack_local = local;
p->mtime = st.st_mtime;
if (path_len < the_hash_algo->hexsz ||
- get_sha1_hex(path + path_len - the_hash_algo->hexsz, p->hash))
+ get_hash_hex(path + path_len - the_hash_algo->hexsz, p->hash))
hashclr(p->hash);
return p;
}
@@ -941,20 +946,10 @@ unsigned long repo_approximate_object_count(struct repository *r)
return r->objects->approximate_object_count;
}
-static void *get_next_packed_git(const void *p)
-{
- return ((const struct packed_git *)p)->next;
-}
-
-static void set_next_packed_git(void *p, void *next)
-{
- ((struct packed_git *)p)->next = next;
-}
+DEFINE_LIST_SORT(static, sort_packs, struct packed_git, next);
-static int sort_pack(const void *a_, const void *b_)
+static int sort_pack(const struct packed_git *a, const struct packed_git *b)
{
- const struct packed_git *a = a_;
- const struct packed_git *b = b_;
int st;
/*
@@ -981,9 +976,7 @@ static int sort_pack(const void *a_, const void *b_)
static void rearrange_packed_git(struct repository *r)
{
- r->objects->packed_git = llist_mergesort(
- r->objects->packed_git, get_next_packed_git,
- set_next_packed_git, sort_pack);
+ sort_packs(&r->objects->packed_git, sort_pack);
}
static void prepare_packed_git_mru(struct repository *r)
@@ -1020,6 +1013,16 @@ void reprepare_packed_git(struct repository *r)
struct object_directory *odb;
obj_read_lock();
+
+ /*
+ * Reprepare alt odbs, in case the alternates file was modified
+ * during the course of this process. This only _adds_ odbs to
+ * the linked list, so existing odbs will continue to exist for
+ * the lifetime of the process.
+ */
+ r->objects->loaded_alternates = 0;
+ prepare_alt_odb(r);
+
for (odb = r->objects->odb; odb; odb = odb->next)
odb_clear_loose_cache(odb);
@@ -1404,7 +1407,7 @@ static int delta_base_cache_key_eq(const struct delta_base_cache_key *a,
return a->p == b->p && a->base_offset == b->base_offset;
}
-static int delta_base_cache_hash_cmp(const void *unused_cmp_data,
+static int delta_base_cache_hash_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *va,
const struct hashmap_entry *vb,
const void *vkey)
@@ -1662,22 +1665,6 @@ struct unpack_entry_stack_ent {
unsigned long size;
};
-static void *read_object(struct repository *r,
- const struct object_id *oid,
- enum object_type *type,
- unsigned long *size)
-{
- struct object_info oi = OBJECT_INFO_INIT;
- void *content;
- oi.typep = type;
- oi.sizep = size;
- oi.contentp = &content;
-
- if (oid_object_info_extended(r, oid, &oi, 0) < 0)
- return NULL;
- return content;
-}
-
void *unpack_entry(struct repository *r, struct packed_git *p, off_t obj_offset,
enum object_type *final_type, unsigned long *final_size)
{
@@ -1810,6 +1797,8 @@ void *unpack_entry(struct repository *r, struct packed_git *p, off_t obj_offset,
uint32_t pos;
struct object_id base_oid;
if (!(offset_to_pack_pos(p, obj_offset, &pos))) {
+ struct object_info oi = OBJECT_INFO_INIT;
+
nth_packed_object_id(&base_oid, p,
pack_pos_to_index(p, pos));
error("failed to read delta base object %s"
@@ -1817,7 +1806,13 @@ void *unpack_entry(struct repository *r, struct packed_git *p, off_t obj_offset,
oid_to_hex(&base_oid), (uintmax_t)obj_offset,
p->pack_name);
mark_bad_packed_object(p, &base_oid);
- base = read_object(r, &base_oid, &type, &base_size);
+
+ oi.typep = &type;
+ oi.sizep = &base_size;
+ oi.contentp = &base;
+ if (oid_object_info_extended(r, &base_oid, &oi, 0) < 0)
+ base = NULL;
+
external_base = base;
}
}
@@ -1922,10 +1917,10 @@ int nth_packed_object_id(struct object_id *oid,
return -1;
index += 4 * 256;
if (p->index_version == 1) {
- oidread(oid, index + (hashsz + 4) * n + 4);
+ oidread(oid, index + st_add(st_mult(hashsz + 4, n), 4));
} else {
index += 8;
- oidread(oid, index + hashsz * n);
+ oidread(oid, index + st_mult(hashsz, n));
}
return 0;
}
@@ -1950,14 +1945,15 @@ off_t nth_packed_object_offset(const struct packed_git *p, uint32_t n)
const unsigned int hashsz = the_hash_algo->rawsz;
index += 4 * 256;
if (p->index_version == 1) {
- return ntohl(*((uint32_t *)(index + (hashsz + 4) * (size_t)n)));
+ return ntohl(*((uint32_t *)(index + st_mult(hashsz + 4, n))));
} else {
uint32_t off;
- index += 8 + (size_t)p->num_objects * (hashsz + 4);
- off = ntohl(*((uint32_t *)(index + 4 * n)));
+ index += st_add(8, st_mult(p->num_objects, hashsz + 4));
+ off = ntohl(*((uint32_t *)(index + st_mult(4, n))));
if (!(off & 0x80000000))
return off;
- index += (size_t)p->num_objects * 4 + (off & 0x7fffffff) * 8;
+ index += st_add(st_mult(p->num_objects, 4),
+ st_mult(off & 0x7fffffff, 8));
check_pack_index_ptr(p, index);
return get_be64(index);
}
@@ -2156,7 +2152,7 @@ int for_each_object_in_pack(struct packed_git *p,
int r = 0;
if (flags & FOR_EACH_OBJECT_PACK_ORDER) {
- if (load_pack_revindex(p))
+ if (load_pack_revindex(the_repository, p))
return -1;
}
@@ -2224,12 +2220,22 @@ 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,
- uint32_t pos,
+ struct packed_git *pack UNUSED,
+ uint32_t pos UNUSED,
void *set_)
{
struct oidset *set = set_;
- struct object *obj = parse_object(the_repository, oid);
+ struct object *obj;
+ int we_parsed_object;
+
+ obj = lookup_object(the_repository, oid);
+ if (obj && obj->parsed) {
+ we_parsed_object = 0;
+ } else {
+ we_parsed_object = 1;
+ obj = parse_object(the_repository, oid);
+ }
+
if (!obj)
return 1;
@@ -2243,7 +2249,8 @@ static int add_promisor_object(const struct object_id *oid,
struct tree *tree = (struct tree *)obj;
struct tree_desc desc;
struct name_entry entry;
- if (init_tree_desc_gently(&desc, tree->buffer, tree->size))
+ if (init_tree_desc_gently(&desc, &tree->object.oid,
+ tree->buffer, tree->size, 0))
/*
* Error messages are given when packs are
* verified, so do not print any here.
@@ -2251,7 +2258,8 @@ static int add_promisor_object(const struct object_id *oid,
return 0;
while (tree_entry_gently(&desc, &entry))
oidset_insert(set, &entry.oid);
- free_tree_buffer(tree);
+ if (we_parsed_object)
+ free_tree_buffer(tree);
} else if (obj->type == OBJ_COMMIT) {
struct commit *commit = (struct commit *) obj;
struct commit_list *parents = commit->parents;
@@ -2272,10 +2280,11 @@ int is_promisor_object(const struct object_id *oid)
static int promisor_objects_prepared;
if (!promisor_objects_prepared) {
- if (has_promisor_remote()) {
+ if (repo_has_promisor_remote(the_repository)) {
for_each_packed_object(add_promisor_object,
&promisor_objects,
- FOR_EACH_OBJECT_PROMISOR_ONLY);
+ FOR_EACH_OBJECT_PROMISOR_ONLY |
+ FOR_EACH_OBJECT_PACK_ORDER);
}
promisor_objects_prepared = 1;
}
diff --git a/packfile.h b/packfile.h
index a3f6723..28c8fd3 100644
--- a/packfile.h
+++ b/packfile.h
@@ -1,13 +1,27 @@
#ifndef PACKFILE_H
#define PACKFILE_H
-#include "cache.h"
+#include "object.h"
#include "oidset.h"
/* in object-store.h */
struct packed_git;
struct object_info;
+struct pack_window {
+ struct pack_window *next;
+ unsigned char *base;
+ off_t offset;
+ size_t len;
+ unsigned int last_used;
+ unsigned int inuse_cnt;
+};
+
+struct pack_entry {
+ off_t offset;
+ struct packed_git *p;
+};
+
/*
* Generate the filename to be used for a pack file with checksum "sha1" and
* extension "ext". The result is written into the strbuf "buf", overwriting
@@ -40,7 +54,7 @@ const char *pack_basename(struct packed_git *p);
struct packed_git *parse_pack_index(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_pach, void *data);
+ const char *file_name, void *data);
void for_each_file_in_pack_dir(const char *objdir,
each_file_in_pack_dir_fn fn,
void *data);
@@ -65,7 +79,6 @@ struct packed_git *get_all_packs(struct repository *r);
* for speed.
*/
unsigned long repo_approximate_object_count(struct repository *r);
-#define approximate_object_count() repo_approximate_object_count(the_repository)
struct packed_git *find_sha1_pack(const unsigned char *sha1,
struct packed_git *packs);
diff --git a/pager.c b/pager.c
index 5cfe23b..b8822a9 100644
--- a/pager.c
+++ b/pager.c
@@ -1,9 +1,13 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "editor.h"
+#include "pager.h"
#include "run-command.h"
#include "sigchain.h"
#include "alias.h"
+int pager_use_color = 1;
+
#ifndef DEFAULT_PAGER
#define DEFAULT_PAGER "less"
#endif
@@ -38,7 +42,9 @@ static void wait_for_pager_signal(int signo)
raise(signo);
}
-static int core_pager_config(const char *var, const char *value, void *data)
+static int core_pager_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *data UNUSED)
{
if (!strcmp(var, "core.pager"))
return git_config_string(&pager_program, var, value);
@@ -223,7 +229,9 @@ struct pager_command_config_data {
char *value;
};
-static int pager_command_config(const char *var, const char *value, void *vdata)
+static int pager_command_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *vdata)
{
struct pager_command_config_data *data = vdata;
const char *cmd;
diff --git a/pager.h b/pager.h
new file mode 100644
index 0000000..b774330
--- /dev/null
+++ b/pager.h
@@ -0,0 +1,17 @@
+#ifndef PAGER_H
+#define PAGER_H
+
+struct child_process;
+
+const char *git_pager(int stdout_is_tty);
+void setup_pager(void);
+int pager_in_use(void);
+int term_columns(void);
+void term_clear_line(void);
+int decimal_width(uintmax_t);
+int check_pager_config(const char *cmd);
+void prepare_pager_args(struct child_process *, const char *pager);
+
+extern int pager_use_color;
+
+#endif /* PAGER_H */
diff --git a/parallel-checkout.c b/parallel-checkout.c
index 4f6819f..b5a714c 100644
--- a/parallel-checkout.c
+++ b/parallel-checkout.c
@@ -1,12 +1,17 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "entry.h"
+#include "gettext.h"
+#include "hash.h"
+#include "hex.h"
#include "parallel-checkout.h"
#include "pkt-line.h"
#include "progress.h"
+#include "read-cache-ll.h"
#include "run-command.h"
#include "sigchain.h"
#include "streaming.h"
+#include "symlinks.h"
#include "thread-utils.h"
#include "trace2.h"
diff --git a/parse-options-cb.c b/parse-options-cb.c
index d346dbe..bdc7fae 100644
--- a/parse-options-cb.c
+++ b/parse-options-cb.c
@@ -1,9 +1,12 @@
#include "git-compat-util.h"
#include "parse-options.h"
#include "branch.h"
-#include "cache.h"
#include "commit.h"
#include "color.h"
+#include "date.h"
+#include "environment.h"
+#include "gettext.h"
+#include "object-name.h"
#include "string-list.h"
#include "strvec.h"
#include "oid-array.h"
@@ -91,7 +94,7 @@ int parse_opt_commits(const struct option *opt, const char *arg, int unset)
if (!arg)
return -1;
- if (get_oid(arg, &oid))
+ if (repo_get_oid(the_repository, arg, &oid))
return error("malformed object name %s", arg);
commit = lookup_commit_reference(the_repository, &oid);
if (!commit)
@@ -110,7 +113,7 @@ int parse_opt_commit(const struct option *opt, const char *arg, int unset)
if (!arg)
return -1;
- if (get_oid(arg, &oid))
+ if (repo_get_oid(the_repository, arg, &oid))
return error("malformed object name %s", arg);
commit = lookup_commit_reference(the_repository, &oid);
if (!commit)
@@ -129,7 +132,7 @@ int parse_opt_object_name(const struct option *opt, const char *arg, int unset)
}
if (!arg)
return -1;
- if (get_oid(arg, &oid))
+ if (repo_get_oid(the_repository, arg, &oid))
return error(_("malformed object name '%s'"), arg);
oid_array_append(opt->value, &oid);
return 0;
@@ -146,7 +149,7 @@ int parse_opt_object_id(const struct option *opt, const char *arg, int unset)
}
if (!arg)
return -1;
- if (get_oid(arg, &oid))
+ if (repo_get_oid(the_repository, arg, &oid))
return error(_("malformed object name '%s'"), arg);
*target = oid;
return 0;
@@ -208,24 +211,27 @@ int parse_opt_string_list(const struct option *opt, const char *arg, int unset)
return 0;
}
-int parse_opt_noop_cb(const struct option *opt, const char *arg, int unset)
+int parse_opt_strvec(const struct option *opt, const char *arg, int unset)
{
+ struct strvec *v = opt->value;
+
+ if (unset) {
+ strvec_clear(v);
+ return 0;
+ }
+
+ if (!arg)
+ return -1;
+
+ strvec_push(v, arg);
return 0;
}
-/**
- * Report that the option is unknown, so that other code can handle
- * it. This can be used as a callback together with
- * OPTION_LOWLEVEL_CALLBACK to allow an option to be documented in the
- * "-h" output even if it's not being handled directly by
- * parse_options().
- */
-enum parse_opt_result parse_opt_unknown_cb(struct parse_opt_ctx_t *ctx,
- const struct option *opt,
- const char *arg, int unset)
+int parse_opt_noop_cb(const struct option *opt UNUSED,
+ const char *arg UNUSED,
+ int unset UNUSED)
{
- BUG_ON_OPT_ARG(arg);
- return PARSE_OPT_UNKNOWN;
+ return 0;
}
/**
diff --git a/parse-options.c b/parse-options.c
index edf55d3..30b9e68 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -1,9 +1,10 @@
#include "git-compat-util.h"
#include "parse-options.h"
-#include "cache.h"
-#include "config.h"
-#include "commit.h"
-#include "color.h"
+#include "abspath.h"
+#include "parse.h"
+#include "gettext.h"
+#include "strbuf.h"
+#include "string-list.h"
#include "utf8.h"
static int disallow_abbreviated_options;
@@ -59,50 +60,18 @@ static enum parse_opt_result get_arg(struct parse_opt_ctx_t *p,
return 0;
}
-static void fix_filename(const char *prefix, const char **file)
+static void fix_filename(const char *prefix, char **file)
{
- if (!file || !*file || !prefix || is_absolute_path(*file)
- || !strcmp("-", *file))
- return;
- *file = prefix_filename(prefix, *file);
-}
-
-static enum parse_opt_result opt_command_mode_error(
- const struct option *opt,
- const struct option *all_opts,
- enum opt_parsed flags)
-{
- const struct option *that;
- struct strbuf that_name = STRBUF_INIT;
-
- /*
- * Find the other option that was used to set the variable
- * already, and report that this is not compatible with it.
- */
- for (that = all_opts; that->type != OPTION_END; that++) {
- if (that == opt ||
- !(that->flags & PARSE_OPT_CMDMODE) ||
- that->value != opt->value ||
- that->defval != *(int *)opt->value)
- continue;
-
- if (that->long_name)
- strbuf_addf(&that_name, "--%s", that->long_name);
- else
- strbuf_addf(&that_name, "-%c", that->short_name);
- error(_("%s is incompatible with %s"),
- optname(opt, flags), that_name.buf);
- strbuf_release(&that_name);
- return PARSE_OPT_ERROR;
- }
- return error(_("%s : incompatible with something else"),
- optname(opt, flags));
+ if (!file || !*file)
+ ; /* leave as NULL */
+ else
+ *file = prefix_filename_except_for_dash(prefix, *file);
}
-static enum parse_opt_result get_value(struct parse_opt_ctx_t *p,
- const struct option *opt,
- const struct option *all_opts,
- enum opt_parsed flags)
+static enum parse_opt_result do_get_value(struct parse_opt_ctx_t *p,
+ const struct option *opt,
+ enum opt_parsed flags,
+ const char **argp)
{
const char *s, *arg;
const int unset = flags & OPT_UNSET;
@@ -115,14 +84,6 @@ static enum parse_opt_result get_value(struct parse_opt_ctx_t *p,
if (!(flags & OPT_SHORT) && p->opt && (opt->flags & PARSE_OPT_NOARG))
return error(_("%s takes no value"), optname(opt, flags));
- /*
- * Giving the same mode option twice, although unnecessary,
- * is not a grave error, so let it pass.
- */
- if ((opt->flags & PARSE_OPT_CMDMODE) &&
- *(int *)opt->value && *(int *)opt->value != opt->defval)
- return opt_command_mode_error(opt, all_opts, flags);
-
switch (opt->type) {
case OPTION_LOWLEVEL_CALLBACK:
return opt->ll_callback(p, opt, NULL, unset);
@@ -177,7 +138,7 @@ static enum parse_opt_result get_value(struct parse_opt_ctx_t *p,
err = get_arg(p, opt, flags, (const char **)opt->value);
if (!err)
- fix_filename(p->prefix, (const char **)opt->value);
+ fix_filename(p->prefix, (char **)opt->value);
return err;
case OPTION_CALLBACK:
@@ -197,6 +158,8 @@ static enum parse_opt_result get_value(struct parse_opt_ctx_t *p,
p_unset = 0;
p_arg = arg;
}
+ if (opt->flags & PARSE_OPT_CMDMODE)
+ *argp = p_arg;
if (opt->callback)
return (*opt->callback)(opt, p_arg, p_unset) ? (-1) : 0;
else
@@ -244,16 +207,92 @@ static enum parse_opt_result get_value(struct parse_opt_ctx_t *p,
}
}
+struct parse_opt_cmdmode_list {
+ int value, *value_ptr;
+ const struct option *opt;
+ const char *arg;
+ enum opt_parsed flags;
+ struct parse_opt_cmdmode_list *next;
+};
+
+static void build_cmdmode_list(struct parse_opt_ctx_t *ctx,
+ const struct option *opts)
+{
+ ctx->cmdmode_list = NULL;
+
+ for (; opts->type != OPTION_END; opts++) {
+ struct parse_opt_cmdmode_list *elem = ctx->cmdmode_list;
+ int *value_ptr = opts->value;
+
+ if (!(opts->flags & PARSE_OPT_CMDMODE) || !value_ptr)
+ continue;
+
+ while (elem && elem->value_ptr != value_ptr)
+ elem = elem->next;
+ if (elem)
+ continue;
+
+ CALLOC_ARRAY(elem, 1);
+ elem->value_ptr = value_ptr;
+ elem->value = *value_ptr;
+ elem->next = ctx->cmdmode_list;
+ ctx->cmdmode_list = elem;
+ }
+}
+
+static char *optnamearg(const struct option *opt, const char *arg,
+ enum opt_parsed flags)
+{
+ if (flags & OPT_SHORT)
+ return xstrfmt("-%c%s", opt->short_name, arg ? arg : "");
+ return xstrfmt("--%s%s%s%s", flags & OPT_UNSET ? "no-" : "",
+ opt->long_name, arg ? "=" : "", arg ? arg : "");
+}
+
+static enum parse_opt_result get_value(struct parse_opt_ctx_t *p,
+ const struct option *opt,
+ enum opt_parsed flags)
+{
+ const char *arg = NULL;
+ enum parse_opt_result result = do_get_value(p, opt, flags, &arg);
+ struct parse_opt_cmdmode_list *elem = p->cmdmode_list;
+ char *opt_name, *other_opt_name;
+
+ for (; elem; elem = elem->next) {
+ if (*elem->value_ptr == elem->value)
+ continue;
+
+ if (elem->opt &&
+ (elem->opt->flags | opt->flags) & PARSE_OPT_CMDMODE)
+ break;
+
+ elem->opt = opt;
+ elem->arg = arg;
+ elem->flags = flags;
+ elem->value = *elem->value_ptr;
+ }
+
+ if (result || !elem)
+ return result;
+
+ opt_name = optnamearg(opt, arg, flags);
+ other_opt_name = optnamearg(elem->opt, elem->arg, elem->flags);
+ error(_("options '%s' and '%s' cannot be used together"),
+ opt_name, other_opt_name);
+ free(opt_name);
+ free(other_opt_name);
+ return -1;
+}
+
static enum parse_opt_result parse_short_opt(struct parse_opt_ctx_t *p,
const struct option *options)
{
- const struct option *all_opts = options;
const struct option *numopt = NULL;
for (; options->type != OPTION_END; options++) {
if (options->short_name == *p->opt) {
p->opt = p->opt[1] ? p->opt + 1 : NULL;
- return get_value(p, options, all_opts, OPT_SHORT);
+ return get_value(p, options, OPT_SHORT);
}
/*
@@ -311,96 +350,107 @@ static int is_alias(struct parse_opt_ctx_t *ctx,
return 0;
}
+struct parsed_option {
+ const struct option *option;
+ enum opt_parsed flags;
+};
+
+static void register_abbrev(struct parse_opt_ctx_t *p,
+ const struct option *option, enum opt_parsed flags,
+ struct parsed_option *abbrev,
+ struct parsed_option *ambiguous)
+{
+ if (p->flags & PARSE_OPT_KEEP_UNKNOWN_OPT)
+ return;
+ if (abbrev->option &&
+ !(abbrev->flags == flags && is_alias(p, abbrev->option, option))) {
+ /*
+ * If this is abbreviated, it is
+ * ambiguous. So when there is no
+ * exact match later, we need to
+ * error out.
+ */
+ ambiguous->option = abbrev->option;
+ ambiguous->flags = abbrev->flags;
+ }
+ abbrev->option = option;
+ abbrev->flags = flags;
+}
+
static enum parse_opt_result parse_long_opt(
struct parse_opt_ctx_t *p, const char *arg,
const struct option *options)
{
- const struct option *all_opts = options;
const char *arg_end = strchrnul(arg, '=');
- const struct option *abbrev_option = NULL, *ambiguous_option = NULL;
- enum opt_parsed abbrev_flags = OPT_LONG, ambiguous_flags = OPT_LONG;
+ const char *arg_start = arg;
+ enum opt_parsed flags = OPT_LONG;
+ int arg_starts_with_no_no = 0;
+ struct parsed_option abbrev = { .option = NULL, .flags = OPT_LONG };
+ struct parsed_option ambiguous = { .option = NULL, .flags = OPT_LONG };
+
+ if (skip_prefix(arg_start, "no-", &arg_start)) {
+ if (skip_prefix(arg_start, "no-", &arg_start))
+ arg_starts_with_no_no = 1;
+ else
+ flags |= OPT_UNSET;
+ }
for (; options->type != OPTION_END; options++) {
const char *rest, *long_name = options->long_name;
- enum opt_parsed flags = OPT_LONG, opt_flags = OPT_LONG;
+ enum opt_parsed opt_flags = OPT_LONG;
+ int allow_unset = !(options->flags & PARSE_OPT_NONEG);
+ if (options->type == OPTION_SUBCOMMAND)
+ continue;
if (!long_name)
continue;
-again:
- if (!skip_prefix(arg, long_name, &rest))
- rest = NULL;
- if (!rest) {
- /* abbreviated? */
- if (!(p->flags & PARSE_OPT_KEEP_UNKNOWN) &&
- !strncmp(long_name, arg, arg_end - arg)) {
-is_abbreviated:
- if (abbrev_option &&
- !is_alias(p, abbrev_option, options)) {
- /*
- * If this is abbreviated, it is
- * ambiguous. So when there is no
- * exact match later, we need to
- * error out.
- */
- ambiguous_option = abbrev_option;
- ambiguous_flags = abbrev_flags;
- }
- if (!(flags & OPT_UNSET) && *arg_end)
- p->opt = arg_end + 1;
- abbrev_option = options;
- abbrev_flags = flags ^ opt_flags;
- continue;
- }
- /* negation allowed? */
- if (options->flags & PARSE_OPT_NONEG)
- continue;
- /* negated and abbreviated very much? */
- if (starts_with("no-", arg)) {
- flags |= OPT_UNSET;
- goto is_abbreviated;
- }
- /* negated? */
- if (!starts_with(arg, "no-")) {
- if (skip_prefix(long_name, "no-", &long_name)) {
- opt_flags |= OPT_UNSET;
- goto again;
- }
- continue;
- }
- flags |= OPT_UNSET;
- if (!skip_prefix(arg + 3, long_name, &rest)) {
- /* abbreviated and negated? */
- if (starts_with(long_name, arg + 3))
- goto is_abbreviated;
- else
- continue;
- }
- }
- if (*rest) {
- if (*rest != '=')
+ if (skip_prefix(long_name, "no-", &long_name))
+ opt_flags |= OPT_UNSET;
+ else if (arg_starts_with_no_no)
+ continue;
+
+ if (((flags ^ opt_flags) & OPT_UNSET) && !allow_unset)
+ continue;
+
+ if (skip_prefix(arg_start, long_name, &rest)) {
+ if (*rest == '=')
+ p->opt = rest + 1;
+ else if (*rest)
continue;
- p->opt = rest + 1;
+ return get_value(p, options, flags ^ opt_flags);
}
- return get_value(p, options, all_opts, flags ^ opt_flags);
+
+ /* abbreviated? */
+ if (!strncmp(long_name, arg_start, arg_end - arg_start))
+ register_abbrev(p, options, flags ^ opt_flags,
+ &abbrev, &ambiguous);
+
+ /* negated and abbreviated very much? */
+ if (allow_unset && starts_with("no-", arg))
+ register_abbrev(p, options, OPT_UNSET ^ opt_flags,
+ &abbrev, &ambiguous);
}
- if (disallow_abbreviated_options && (ambiguous_option || abbrev_option))
+ if (disallow_abbreviated_options && (ambiguous.option || abbrev.option))
die("disallowed abbreviated or ambiguous option '%.*s'",
(int)(arg_end - arg), arg);
- if (ambiguous_option) {
+ if (ambiguous.option) {
error(_("ambiguous option: %s "
"(could be --%s%s or --%s%s)"),
arg,
- (ambiguous_flags & OPT_UNSET) ? "no-" : "",
- ambiguous_option->long_name,
- (abbrev_flags & OPT_UNSET) ? "no-" : "",
- abbrev_option->long_name);
+ (ambiguous.flags & OPT_UNSET) ? "no-" : "",
+ ambiguous.option->long_name,
+ (abbrev.flags & OPT_UNSET) ? "no-" : "",
+ abbrev.option->long_name);
return PARSE_OPT_HELP;
}
- if (abbrev_option)
- return get_value(p, abbrev_option, all_opts, abbrev_flags);
+ if (abbrev.option) {
+ if (*arg_end)
+ p->opt = arg_end + 1;
+ return get_value(p, abbrev.option, abbrev.flags);
+ }
return PARSE_OPT_UNKNOWN;
}
@@ -408,17 +458,28 @@ static enum parse_opt_result parse_nodash_opt(struct parse_opt_ctx_t *p,
const char *arg,
const struct option *options)
{
- const struct option *all_opts = options;
-
for (; options->type != OPTION_END; options++) {
if (!(options->flags & PARSE_OPT_NODASH))
continue;
if (options->short_name == arg[0] && arg[1] == '\0')
- return get_value(p, options, all_opts, OPT_SHORT);
+ return get_value(p, options, OPT_SHORT);
}
return PARSE_OPT_ERROR;
}
+static enum parse_opt_result parse_subcommand(const char *arg,
+ const struct option *options)
+{
+ for (; options->type != OPTION_END; options++)
+ if (options->type == OPTION_SUBCOMMAND &&
+ !strcmp(options->long_name, arg)) {
+ *(parse_opt_subcommand_fn **)options->value = options->subcommand_fn;
+ return PARSE_OPT_SUBCOMMAND;
+ }
+
+ return PARSE_OPT_UNKNOWN;
+}
+
static void check_typos(const char *arg, const struct option *options)
{
if (strlen(arg) < 3)
@@ -442,6 +503,7 @@ static void check_typos(const char *arg, const struct option *options)
static void parse_options_check(const struct option *opts)
{
char short_opts[128];
+ void *subcommand_value = NULL;
memset(short_opts, '\0', sizeof(short_opts));
for (; opts->type != OPTION_END; opts++) {
@@ -462,6 +524,9 @@ static void parse_options_check(const struct option *opts)
opts->long_name))
optbug(opts, "uses feature "
"not supported for dashless options");
+ if (opts->type == OPTION_SET_INT && !opts->defval &&
+ opts->long_name && !(opts->flags & PARSE_OPT_NONEG))
+ optbug(opts, "OPTION_SET_INT 0 should not be negatable");
switch (opts->type) {
case OPTION_COUNTUP:
case OPTION_BIT:
@@ -489,6 +554,14 @@ static void parse_options_check(const struct option *opts)
"Are you using parse_options_step() directly?\n"
"That case is not supported yet.");
break;
+ case OPTION_SUBCOMMAND:
+ if (!opts->value || !opts->subcommand_fn)
+ optbug(opts, "OPTION_SUBCOMMAND needs a value and a subcommand function");
+ if (!subcommand_value)
+ subcommand_value = opts->value;
+ else if (subcommand_value != opts->value)
+ optbug(opts, "all OPTION_SUBCOMMANDs need the same value");
+ break;
default:
; /* ok. (usually accepts an argument) */
}
@@ -499,6 +572,14 @@ static void parse_options_check(const struct option *opts)
BUG_if_bug("invalid 'struct option'");
}
+static int has_subcommands(const struct option *options)
+{
+ for (; options->type != OPTION_END; options++)
+ if (options->type == OPTION_SUBCOMMAND)
+ return 1;
+ return 0;
+}
+
static void parse_options_start_1(struct parse_opt_ctx_t *ctx,
int argc, const char **argv, const char *prefix,
const struct option *options,
@@ -515,7 +596,20 @@ static void parse_options_start_1(struct parse_opt_ctx_t *ctx,
ctx->prefix = prefix;
ctx->cpidx = ((flags & PARSE_OPT_KEEP_ARGV0) != 0);
ctx->flags = flags;
- if ((flags & PARSE_OPT_KEEP_UNKNOWN) &&
+ ctx->has_subcommands = has_subcommands(options);
+ if (!ctx->has_subcommands && (flags & PARSE_OPT_SUBCOMMAND_OPTIONAL))
+ BUG("Using PARSE_OPT_SUBCOMMAND_OPTIONAL without subcommands");
+ if (ctx->has_subcommands) {
+ if (flags & PARSE_OPT_STOP_AT_NON_OPTION)
+ BUG("subcommands are incompatible with PARSE_OPT_STOP_AT_NON_OPTION");
+ if (!(flags & PARSE_OPT_SUBCOMMAND_OPTIONAL)) {
+ if (flags & PARSE_OPT_KEEP_UNKNOWN_OPT)
+ BUG("subcommands are incompatible with PARSE_OPT_KEEP_UNKNOWN_OPT unless in combination with PARSE_OPT_SUBCOMMAND_OPTIONAL");
+ if (flags & PARSE_OPT_KEEP_DASHDASH)
+ BUG("subcommands are incompatible with PARSE_OPT_KEEP_DASHDASH unless in combination with PARSE_OPT_SUBCOMMAND_OPTIONAL");
+ }
+ }
+ if ((flags & PARSE_OPT_KEEP_UNKNOWN_OPT) &&
(flags & PARSE_OPT_STOP_AT_NON_OPTION) &&
!(flags & PARSE_OPT_ONE_SHOT))
BUG("STOP_AT_NON_OPTION and KEEP_UNKNOWN don't go together");
@@ -523,6 +617,7 @@ static void parse_options_start_1(struct parse_opt_ctx_t *ctx,
(flags & PARSE_OPT_KEEP_ARGV0))
BUG("Can't keep argv0 if you don't have it");
parse_options_check(options);
+ build_cmdmode_list(ctx, options);
}
void parse_options_start(struct parse_opt_ctx_t *ctx,
@@ -589,6 +684,7 @@ static int show_gitcomp(const struct option *opts, int show_all)
int nr_noopts = 0;
for (; opts->type != OPTION_END; opts++) {
+ const char *prefix = "--";
const char *suffix = "";
if (!opts->long_name)
@@ -598,6 +694,9 @@ static int show_gitcomp(const struct option *opts, int show_all)
continue;
switch (opts->type) {
+ case OPTION_SUBCOMMAND:
+ prefix = "";
+ break;
case OPTION_GROUP:
continue;
case OPTION_STRING:
@@ -620,7 +719,8 @@ static int show_gitcomp(const struct option *opts, int show_all)
suffix = "=";
if (starts_with(opts->long_name, "no-"))
nr_noopts++;
- printf(" --%s%s", opts->long_name, suffix);
+ printf("%s%s%s%s", opts == original_opts ? "" : " ",
+ prefix, opts->long_name, suffix);
}
show_negated_gitcomp(original_opts, show_all, -1);
show_negated_gitcomp(original_opts, show_all, nr_noopts);
@@ -652,8 +752,7 @@ static struct option *preprocess_options(struct parse_opt_ctx_t *ctx,
if (!nr_aliases)
return NULL;
- ALLOC_ARRAY(newopt, nr + 1);
- COPY_ARRAY(newopt, options, nr + 1);
+ DUP_ARRAY(newopt, options, nr + 1);
/* each alias has two string pointers and NULL */
CALLOC_ARRAY(ctx->alias_groups, 3 * (nr_aliases + 1));
@@ -743,10 +842,38 @@ enum parse_opt_result parse_options_step(struct parse_opt_ctx_t *ctx,
if (*arg != '-' || !arg[1]) {
if (parse_nodash_opt(ctx, arg, options) == 0)
continue;
- if (ctx->flags & PARSE_OPT_STOP_AT_NON_OPTION)
- return PARSE_OPT_NON_OPTION;
- ctx->out[ctx->cpidx++] = ctx->argv[0];
- continue;
+ if (!ctx->has_subcommands) {
+ if (ctx->flags & PARSE_OPT_STOP_AT_NON_OPTION)
+ return PARSE_OPT_NON_OPTION;
+ ctx->out[ctx->cpidx++] = ctx->argv[0];
+ continue;
+ }
+ switch (parse_subcommand(arg, options)) {
+ case PARSE_OPT_SUBCOMMAND:
+ return PARSE_OPT_SUBCOMMAND;
+ case PARSE_OPT_UNKNOWN:
+ if (ctx->flags & PARSE_OPT_SUBCOMMAND_OPTIONAL)
+ /*
+ * arg is neither a short or long
+ * option nor a subcommand. Since
+ * this command has a default
+ * operation mode, we have to treat
+ * this arg and all remaining args
+ * as args meant to that default
+ * operation mode.
+ * So we are done parsing.
+ */
+ return PARSE_OPT_DONE;
+ error(_("unknown subcommand: `%s'"), arg);
+ usage_with_options(usagestr, options);
+ case PARSE_OPT_COMPLETE:
+ case PARSE_OPT_HELP:
+ case PARSE_OPT_ERROR:
+ case PARSE_OPT_DONE:
+ case PARSE_OPT_NON_OPTION:
+ /* Impossible. */
+ BUG("parse_subcommand() cannot return these");
+ }
}
/* lone -h asks for help */
@@ -774,6 +901,7 @@ enum parse_opt_result parse_options_step(struct parse_opt_ctx_t *ctx,
goto show_usage;
goto unknown;
case PARSE_OPT_NON_OPTION:
+ case PARSE_OPT_SUBCOMMAND:
case PARSE_OPT_HELP:
case PARSE_OPT_COMPLETE:
BUG("parse_short_opt() cannot return these");
@@ -799,6 +927,7 @@ enum parse_opt_result parse_options_step(struct parse_opt_ctx_t *ctx,
*(char *)ctx->argv[0] = '-';
goto unknown;
case PARSE_OPT_NON_OPTION:
+ case PARSE_OPT_SUBCOMMAND:
case PARSE_OPT_COMPLETE:
case PARSE_OPT_HELP:
BUG("parse_short_opt() cannot return these");
@@ -809,13 +938,18 @@ enum parse_opt_result parse_options_step(struct parse_opt_ctx_t *ctx,
continue;
}
- if (!arg[2] /* "--" */ ||
- !strcmp(arg + 2, "end-of-options")) {
+ if (!arg[2] /* "--" */) {
if (!(ctx->flags & PARSE_OPT_KEEP_DASHDASH)) {
ctx->argc--;
ctx->argv++;
}
break;
+ } else if (!strcmp(arg + 2, "end-of-options")) {
+ if (!(ctx->flags & PARSE_OPT_KEEP_UNKNOWN_OPT)) {
+ ctx->argc--;
+ ctx->argv++;
+ }
+ break;
}
if (internal_help && !strcmp(arg + 2, "help-all"))
@@ -830,6 +964,7 @@ enum parse_opt_result parse_options_step(struct parse_opt_ctx_t *ctx,
case PARSE_OPT_HELP:
goto show_usage;
case PARSE_OPT_NON_OPTION:
+ case PARSE_OPT_SUBCOMMAND:
case PARSE_OPT_COMPLETE:
BUG("parse_long_opt() cannot return these");
case PARSE_OPT_DONE:
@@ -839,7 +974,19 @@ enum parse_opt_result parse_options_step(struct parse_opt_ctx_t *ctx,
unknown:
if (ctx->flags & PARSE_OPT_ONE_SHOT)
break;
- if (!(ctx->flags & PARSE_OPT_KEEP_UNKNOWN))
+ if (ctx->has_subcommands &&
+ (ctx->flags & PARSE_OPT_SUBCOMMAND_OPTIONAL) &&
+ (ctx->flags & PARSE_OPT_KEEP_UNKNOWN_OPT)) {
+ /*
+ * Found an unknown option given to a command with
+ * subcommands that has a default operation mode:
+ * we treat this option and all remaining args as
+ * arguments meant to that default operation mode.
+ * So we are done parsing.
+ */
+ return PARSE_OPT_DONE;
+ }
+ if (!(ctx->flags & PARSE_OPT_KEEP_UNKNOWN_OPT))
return PARSE_OPT_UNKNOWN;
ctx->out[ctx->cpidx++] = ctx->argv[0];
ctx->opt = NULL;
@@ -884,7 +1031,14 @@ int parse_options(int argc, const char **argv,
case PARSE_OPT_COMPLETE:
exit(0);
case PARSE_OPT_NON_OPTION:
+ case PARSE_OPT_SUBCOMMAND:
+ break;
case PARSE_OPT_DONE:
+ if (ctx.has_subcommands &&
+ !(flags & PARSE_OPT_SUBCOMMAND_OPTIONAL)) {
+ error(_("need a subcommand"));
+ usage_with_options(usagestr, options);
+ }
break;
case PARSE_OPT_UNKNOWN:
if (ctx.argv[0][1] == '-') {
@@ -901,6 +1055,11 @@ int parse_options(int argc, const char **argv,
precompose_argv_prefix(argc, argv, NULL);
free_preprocessed_options(real_options);
free(ctx.alias_groups);
+ for (struct parse_opt_cmdmode_list *elem = ctx.cmdmode_list; elem;) {
+ struct parse_opt_cmdmode_list *next = elem->next;
+ free(elem);
+ elem = next;
+ }
return parse_options_end(&ctx);
}
@@ -919,14 +1078,37 @@ static int usage_argh(const struct option *opts, FILE *outfile)
return utf8_fprintf(outfile, s, opts->argh ? _(opts->argh) : _("..."));
}
-#define USAGE_OPTS_WIDTH 24
-#define USAGE_GAP 2
+static int usage_indent(FILE *outfile)
+{
+ return fprintf(outfile, " ");
+}
+
+#define USAGE_OPTS_WIDTH 26
+
+static void usage_padding(FILE *outfile, size_t pos)
+{
+ if (pos < USAGE_OPTS_WIDTH)
+ fprintf(outfile, "%*s", USAGE_OPTS_WIDTH - (int)pos, "");
+ else
+ fprintf(outfile, "\n%*s", USAGE_OPTS_WIDTH, "");
+}
+
+static const struct option *find_option_by_long_name(const struct option *opts,
+ const char *long_name)
+{
+ for (; opts->type != OPTION_END; opts++) {
+ if (opts->long_name && !strcmp(opts->long_name, long_name))
+ return opts;
+ }
+ return NULL;
+}
static enum parse_opt_result usage_with_options_internal(struct parse_opt_ctx_t *ctx,
const char * const *usagestr,
const struct option *opts,
int full, int err)
{
+ const struct option *all_opts = opts;
FILE *outfile = err ? stderr : stdout;
int need_newline;
@@ -1007,8 +1189,11 @@ static enum parse_opt_result usage_with_options_internal(struct parse_opt_ctx_t
for (; opts->type != OPTION_END; opts++) {
size_t pos;
- int pad;
+ const char *cp, *np;
+ const char *positive_name = NULL;
+ if (opts->type == OPTION_SUBCOMMAND)
+ continue;
if (opts->type == OPTION_GROUP) {
fputc('\n', outfile);
need_newline = 0;
@@ -1024,7 +1209,7 @@ static enum parse_opt_result usage_with_options_internal(struct parse_opt_ctx_t
need_newline = 0;
}
- pos = fprintf(outfile, " ");
+ pos = usage_indent(outfile);
if (opts->short_name) {
if (opts->flags & PARSE_OPT_NODASH)
pos += fprintf(outfile, "%c", opts->short_name);
@@ -1033,8 +1218,15 @@ static enum parse_opt_result usage_with_options_internal(struct parse_opt_ctx_t
}
if (opts->long_name && opts->short_name)
pos += fprintf(outfile, ", ");
- if (opts->long_name)
- pos += fprintf(outfile, "--%s", opts->long_name);
+ if (opts->long_name) {
+ const char *long_name = opts->long_name;
+ if ((opts->flags & PARSE_OPT_NONEG) ||
+ skip_prefix(long_name, "no-", &positive_name))
+ pos += fprintf(outfile, "--%s", long_name);
+ else
+ pos += fprintf(outfile, "--[no-]%s", long_name);
+ }
+
if (opts->type == OPTION_NUMBER)
pos += utf8_fprintf(outfile, _("-NUM"));
@@ -1042,19 +1234,32 @@ static enum parse_opt_result usage_with_options_internal(struct parse_opt_ctx_t
!(opts->flags & PARSE_OPT_NOARG))
pos += usage_argh(opts, outfile);
- if (pos <= USAGE_OPTS_WIDTH)
- pad = USAGE_OPTS_WIDTH - pos;
- else {
- fputc('\n', outfile);
- pad = USAGE_OPTS_WIDTH;
- }
if (opts->type == OPTION_ALIAS) {
- fprintf(outfile, "%*s", pad + USAGE_GAP, "");
+ usage_padding(outfile, pos);
fprintf_ln(outfile, _("alias of --%s"),
(const char *)opts->value);
continue;
}
- fprintf(outfile, "%*s%s\n", pad + USAGE_GAP, "", _(opts->help));
+
+ for (cp = opts->help ? _(opts->help) : ""; *cp; cp = np) {
+ np = strchrnul(cp, '\n');
+ if (*np)
+ np++;
+ usage_padding(outfile, pos);
+ fwrite(cp, 1, np - cp, outfile);
+ pos = 0;
+ }
+ fputc('\n', outfile);
+
+ if (positive_name) {
+ if (find_option_by_long_name(all_opts, positive_name))
+ continue;
+ pos = usage_indent(outfile);
+ pos += fprintf(outfile, "--%s", positive_name);
+ usage_padding(outfile, pos);
+ fprintf_ln(outfile, _("opposite of --no-%s"),
+ positive_name);
+ }
}
fputc('\n', outfile);
diff --git a/parse-options.h b/parse-options.h
index 685fcca..bd62e20 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -1,6 +1,8 @@
#ifndef PARSE_OPTIONS_H
#define PARSE_OPTIONS_H
+#include "gettext.h"
+
/**
* Refer to Documentation/technical/api-parse-options.txt for the API doc.
*/
@@ -11,6 +13,7 @@ enum parse_opt_type {
OPTION_GROUP,
OPTION_NUMBER,
OPTION_ALIAS,
+ OPTION_SUBCOMMAND,
/* options with no arguments */
OPTION_BIT,
OPTION_NEGBIT,
@@ -30,10 +33,11 @@ enum parse_opt_flags {
PARSE_OPT_KEEP_DASHDASH = 1 << 0,
PARSE_OPT_STOP_AT_NON_OPTION = 1 << 1,
PARSE_OPT_KEEP_ARGV0 = 1 << 2,
- PARSE_OPT_KEEP_UNKNOWN = 1 << 3,
+ PARSE_OPT_KEEP_UNKNOWN_OPT = 1 << 3,
PARSE_OPT_NO_INTERNAL_HELP = 1 << 4,
PARSE_OPT_ONE_SHOT = 1 << 5,
PARSE_OPT_SHELL_EVAL = 1 << 6,
+ PARSE_OPT_SUBCOMMAND_OPTIONAL = 1 << 7,
};
enum parse_opt_option_flags {
@@ -56,6 +60,7 @@ enum parse_opt_result {
PARSE_OPT_ERROR = -1, /* must be the same as error() */
PARSE_OPT_DONE = 0, /* fixed so that "return 0" works */
PARSE_OPT_NON_OPTION,
+ PARSE_OPT_SUBCOMMAND,
PARSE_OPT_UNKNOWN
};
@@ -67,6 +72,9 @@ typedef enum parse_opt_result parse_opt_ll_cb(struct parse_opt_ctx_t *ctx,
const struct option *opt,
const char *arg, int unset);
+typedef int parse_opt_subcommand_fn(int argc, const char **argv,
+ const char *prefix);
+
/*
* `type`::
* holds the type of the option, you must have an OPTION_END last in your
@@ -76,7 +84,8 @@ typedef enum parse_opt_result parse_opt_ll_cb(struct parse_opt_ctx_t *ctx,
* the character to use as a short option name, '\0' if none.
*
* `long_name`::
- * the long option name, without the leading dashes, NULL if none.
+ * the long option (without the leading dashes) or subcommand name,
+ * NULL if none.
*
* `value`::
* stores pointers to the values to be filled.
@@ -93,7 +102,7 @@ typedef enum parse_opt_result parse_opt_ll_cb(struct parse_opt_ctx_t *ctx,
*
* `help`::
* the short help associated to what the option does.
- * Must never be NULL (except for OPTION_END).
+ * Must never be NULL (except for OPTION_END and OPTION_SUBCOMMAND).
* OPTION_GROUP uses this pointer to store the group header.
* Should be wrapped by N_() for translation.
*
@@ -109,7 +118,8 @@ typedef enum parse_opt_result parse_opt_ll_cb(struct parse_opt_ctx_t *ctx,
* is last on the command line. If the option is
* not last it will require an argument.
* Should not be used with PARSE_OPT_OPTARG.
- * PARSE_OPT_NODASH: this option doesn't start with a dash.
+ * PARSE_OPT_NODASH: this option doesn't start with a dash; can only be a
+ * short option and can't accept arguments.
* PARSE_OPT_LITERAL_ARGHELP: says that argh shouldn't be enclosed in brackets
* (i.e. '<argh>') in the help message.
* Useful for options with multiple parameters.
@@ -130,6 +140,9 @@ typedef enum parse_opt_result parse_opt_ll_cb(struct parse_opt_ctx_t *ctx,
* `ll_callback`::
* pointer to the callback to use for OPTION_LOWLEVEL_CALLBACK
*
+ * `subcommand_fn`::
+ * pointer to a function to use for OPTION_SUBCOMMAND.
+ * It will be put in value when the subcommand is given on the command line.
*/
struct option {
enum parse_opt_type type;
@@ -144,66 +157,215 @@ struct option {
intptr_t defval;
parse_opt_ll_cb *ll_callback;
intptr_t extra;
+ parse_opt_subcommand_fn *subcommand_fn;
};
-#define OPT_BIT_F(s, l, v, h, b, f) { OPTION_BIT, (s), (l), (v), NULL, (h), \
- PARSE_OPT_NOARG|(f), NULL, (b) }
-#define OPT_COUNTUP_F(s, l, v, h, f) { OPTION_COUNTUP, (s), (l), (v), NULL, \
- (h), PARSE_OPT_NOARG|(f) }
-#define OPT_SET_INT_F(s, l, v, h, i, f) { OPTION_SET_INT, (s), (l), (v), NULL, \
- (h), PARSE_OPT_NOARG | (f), NULL, (i) }
+#define OPT_BIT_F(s, l, v, h, b, f) { \
+ .type = OPTION_BIT, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .help = (h), \
+ .flags = PARSE_OPT_NOARG|(f), \
+ .callback = NULL, \
+ .defval = (b), \
+}
+#define OPT_COUNTUP_F(s, l, v, h, f) { \
+ .type = OPTION_COUNTUP, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .help = (h), \
+ .flags = PARSE_OPT_NOARG|(f), \
+}
+#define OPT_SET_INT_F(s, l, v, h, i, f) { \
+ .type = OPTION_SET_INT, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .help = (h), \
+ .flags = PARSE_OPT_NOARG | (f), \
+ .defval = (i), \
+}
#define OPT_BOOL_F(s, l, v, h, f) OPT_SET_INT_F(s, l, v, h, 1, f)
-#define OPT_CALLBACK_F(s, l, v, a, h, f, cb) \
- { OPTION_CALLBACK, (s), (l), (v), (a), (h), (f), (cb) }
-#define OPT_STRING_F(s, l, v, a, h, f) { OPTION_STRING, (s), (l), (v), (a), (h), (f) }
-#define OPT_INTEGER_F(s, l, v, h, f) { OPTION_INTEGER, (s), (l), (v), N_("n"), (h), (f) }
+#define OPT_CALLBACK_F(s, l, v, a, h, f, cb) { \
+ .type = OPTION_CALLBACK, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .argh = (a), \
+ .help = (h), \
+ .flags = (f), \
+ .callback = (cb), \
+}
+#define OPT_STRING_F(s, l, v, a, h, f) { \
+ .type = OPTION_STRING, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .argh = (a), \
+ .help = (h), \
+ .flags = (f), \
+}
+#define OPT_INTEGER_F(s, l, v, h, f) { \
+ .type = OPTION_INTEGER, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .argh = N_("n"), \
+ .help = (h), \
+ .flags = (f), \
+}
-#define OPT_END() { OPTION_END }
-#define OPT_GROUP(h) { OPTION_GROUP, 0, NULL, NULL, NULL, (h) }
+#define OPT_END() { \
+ .type = OPTION_END, \
+}
+#define OPT_GROUP(h) { \
+ .type = OPTION_GROUP, \
+ .help = (h), \
+}
#define OPT_BIT(s, l, v, h, b) OPT_BIT_F(s, l, v, h, b, 0)
-#define OPT_BITOP(s, l, v, h, set, clear) { OPTION_BITOP, (s), (l), (v), NULL, (h), \
- PARSE_OPT_NOARG|PARSE_OPT_NONEG, NULL, \
- (set), NULL, (clear) }
-#define OPT_NEGBIT(s, l, v, h, b) { OPTION_NEGBIT, (s), (l), (v), NULL, \
- (h), PARSE_OPT_NOARG, NULL, (b) }
+#define OPT_BITOP(s, l, v, h, set, clear) { \
+ .type = OPTION_BITOP, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .help = (h), \
+ .flags = PARSE_OPT_NOARG|PARSE_OPT_NONEG, \
+ .defval = (set), \
+ .extra = (clear), \
+}
+#define OPT_NEGBIT(s, l, v, h, b) { \
+ .type = OPTION_NEGBIT, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .help = (h), \
+ .flags = PARSE_OPT_NOARG, \
+ .defval = (b), \
+}
#define OPT_COUNTUP(s, l, v, h) OPT_COUNTUP_F(s, l, v, h, 0)
#define OPT_SET_INT(s, l, v, h, i) OPT_SET_INT_F(s, l, v, h, i, 0)
#define OPT_BOOL(s, l, v, h) OPT_BOOL_F(s, l, v, h, 0)
-#define OPT_HIDDEN_BOOL(s, l, v, h) { OPTION_SET_INT, (s), (l), (v), NULL, \
- (h), PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1}
-#define OPT_CMDMODE_F(s, l, v, h, i, f) { OPTION_SET_INT, (s), (l), (v), NULL, \
- (h), PARSE_OPT_CMDMODE|PARSE_OPT_NOARG|PARSE_OPT_NONEG | (f), NULL, (i) }
+#define OPT_HIDDEN_BOOL(s, l, v, h) { \
+ .type = OPTION_SET_INT, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .help = (h), \
+ .flags = PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, \
+ .defval = 1, \
+}
+#define OPT_CMDMODE_F(s, l, v, h, i, f) { \
+ .type = OPTION_SET_INT, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .help = (h), \
+ .flags = PARSE_OPT_CMDMODE|PARSE_OPT_NOARG|PARSE_OPT_NONEG | (f), \
+ .defval = (i), \
+}
#define OPT_CMDMODE(s, l, v, h, i) OPT_CMDMODE_F(s, l, v, h, i, 0)
#define OPT_INTEGER(s, l, v, h) OPT_INTEGER_F(s, l, v, h, 0)
-#define OPT_MAGNITUDE(s, l, v, h) { OPTION_MAGNITUDE, (s), (l), (v), \
- N_("n"), (h), PARSE_OPT_NONEG }
+#define OPT_MAGNITUDE(s, l, v, h) { \
+ .type = OPTION_MAGNITUDE, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .argh = N_("n"), \
+ .help = (h), \
+ .flags = PARSE_OPT_NONEG, \
+}
#define OPT_STRING(s, l, v, a, h) OPT_STRING_F(s, l, v, a, h, 0)
-#define OPT_STRING_LIST(s, l, v, a, h) \
- { OPTION_CALLBACK, (s), (l), (v), (a), \
- (h), 0, &parse_opt_string_list }
-#define OPT_UYN(s, l, v, h) { OPTION_CALLBACK, (s), (l), (v), NULL, \
- (h), PARSE_OPT_NOARG, &parse_opt_tertiary }
-#define OPT_EXPIRY_DATE(s, l, v, h) \
- { OPTION_CALLBACK, (s), (l), (v), N_("expiry-date"),(h), 0, \
- parse_opt_expiry_date_cb }
-#define OPT_CALLBACK(s, l, v, a, h, f) OPT_CALLBACK_F(s, l, v, a, h, 0, f)
-#define OPT_NUMBER_CALLBACK(v, h, f) \
- { OPTION_NUMBER, 0, NULL, (v), NULL, (h), \
- PARSE_OPT_NOARG | PARSE_OPT_NONEG, (f) }
-#define OPT_FILENAME(s, l, v, h) { OPTION_FILENAME, (s), (l), (v), \
- N_("file"), (h) }
-#define OPT_COLOR_FLAG(s, l, v, h) \
- { OPTION_CALLBACK, (s), (l), (v), N_("when"), (h), PARSE_OPT_OPTARG, \
- parse_opt_color_flag_cb, (intptr_t)"always" }
-
-#define OPT_NOOP_NOARG(s, l) \
- { OPTION_CALLBACK, (s), (l), NULL, NULL, \
- N_("no-op (backward compatibility)"), \
- PARSE_OPT_HIDDEN | PARSE_OPT_NOARG, parse_opt_noop_cb }
-
-#define OPT_ALIAS(s, l, source_long_name) \
- { OPTION_ALIAS, (s), (l), (source_long_name) }
+#define OPT_STRING_LIST(s, l, v, a, h) { \
+ .type = OPTION_CALLBACK, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .argh = (a), \
+ .help = (h), \
+ .callback = &parse_opt_string_list, \
+}
+#define OPT_STRVEC(s, l, v, a, h) { \
+ .type = OPTION_CALLBACK, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .argh = (a), \
+ .help = (h), \
+ .callback = &parse_opt_strvec, \
+}
+#define OPT_UYN(s, l, v, h) { \
+ .type = OPTION_CALLBACK, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .help = (h), \
+ .flags = PARSE_OPT_NOARG, \
+ .callback = &parse_opt_tertiary, \
+}
+#define OPT_EXPIRY_DATE(s, l, v, h) { \
+ .type = OPTION_CALLBACK, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .argh = N_("expiry-date"), \
+ .help = (h), \
+ .callback = parse_opt_expiry_date_cb, \
+}
+#define OPT_CALLBACK(s, l, v, a, h, cb) OPT_CALLBACK_F(s, l, v, a, h, 0, cb)
+#define OPT_NUMBER_CALLBACK(v, h, cb) { \
+ .type = OPTION_NUMBER, \
+ .value = (v), \
+ .help = (h), \
+ .flags = PARSE_OPT_NOARG | PARSE_OPT_NONEG, \
+ .callback = (cb), \
+}
+#define OPT_FILENAME(s, l, v, h) { \
+ .type = OPTION_FILENAME, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .argh = N_("file"), \
+ .help = (h), \
+}
+#define OPT_COLOR_FLAG(s, l, v, h) { \
+ .type = OPTION_CALLBACK, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .argh = N_("when"), \
+ .help = (h), \
+ .flags = PARSE_OPT_OPTARG, \
+ .callback = parse_opt_color_flag_cb, \
+ .defval = (intptr_t)"always", \
+}
+
+#define OPT_NOOP_NOARG(s, l) { \
+ .type = OPTION_CALLBACK, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .help = N_("no-op (backward compatibility)"), \
+ .flags = PARSE_OPT_HIDDEN | PARSE_OPT_NOARG, \
+ .callback = parse_opt_noop_cb, \
+}
+
+#define OPT_ALIAS(s, l, source_long_name) { \
+ .type = OPTION_ALIAS, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (source_long_name), \
+}
+
+#define OPT_SUBCOMMAND_F(l, v, fn, f) { \
+ .type = OPTION_SUBCOMMAND, \
+ .long_name = (l), \
+ .value = (v), \
+ .flags = (f), \
+ .subcommand_fn = (fn), \
+}
+#define OPT_SUBCOMMAND(l, v, fn) OPT_SUBCOMMAND_F((l), (v), (fn), 0)
/*
* parse_options() will filter out the processed options and leave the
@@ -283,6 +445,8 @@ static inline void die_for_incompatible_opt3(int opt1, const char *opt1_name,
/*----- incremental advanced APIs -----*/
+struct parse_opt_cmdmode_list;
+
/*
* It's okay for the caller to consume argv/argc in the usual way.
* Other fields of that structure are private to parse-options and should not
@@ -294,9 +458,10 @@ struct parse_opt_ctx_t {
int argc, cpidx, total;
const char *opt;
enum parse_opt_flags flags;
+ unsigned has_subcommands;
const char *prefix;
const char **alias_groups; /* must be in groups of 3 elements! */
- struct option *updated_options;
+ struct parse_opt_cmdmode_list *cmdmode_list;
};
void parse_options_start(struct parse_opt_ctx_t *ctx,
@@ -326,10 +491,8 @@ int parse_opt_commits(const struct option *, const char *, int);
int parse_opt_commit(const struct option *, const char *, int);
int parse_opt_tertiary(const struct option *, const char *, int);
int parse_opt_string_list(const struct option *, const char *, int);
+int parse_opt_strvec(const struct option *, const char *, int);
int parse_opt_noop_cb(const struct option *, const char *, int);
-enum parse_opt_result parse_opt_unknown_cb(struct parse_opt_ctx_t *ctx,
- const struct option *,
- const char *, int);
int parse_opt_passthru(const struct option *, const char *, int);
int parse_opt_passthru_argv(const struct option *, const char *, int);
/* value is enum branch_track* */
@@ -337,30 +500,80 @@ int parse_opt_tracking_mode(const struct option *, const char *, int);
#define OPT__VERBOSE(var, h) OPT_COUNTUP('v', "verbose", (var), (h))
#define OPT__QUIET(var, h) OPT_COUNTUP('q', "quiet", (var), (h))
-#define OPT__VERBOSITY(var) \
- { OPTION_CALLBACK, 'v', "verbose", (var), NULL, N_("be more verbose"), \
- PARSE_OPT_NOARG, &parse_opt_verbosity_cb, 0 }, \
- { OPTION_CALLBACK, 'q', "quiet", (var), NULL, N_("be more quiet"), \
- PARSE_OPT_NOARG, &parse_opt_verbosity_cb, 0 }
+#define OPT__VERBOSITY(var) { \
+ .type = OPTION_CALLBACK, \
+ .short_name = 'v', \
+ .long_name = "verbose", \
+ .value = (var), \
+ .help = N_("be more verbose"), \
+ .flags = PARSE_OPT_NOARG, \
+ .callback = &parse_opt_verbosity_cb, \
+}, { \
+ .type = OPTION_CALLBACK, \
+ .short_name = 'q', \
+ .long_name = "quiet", \
+ .value = (var), \
+ .help = N_("be more quiet"), \
+ .flags = PARSE_OPT_NOARG, \
+ .callback = &parse_opt_verbosity_cb, \
+}
#define OPT__DRY_RUN(var, h) OPT_BOOL('n', "dry-run", (var), (h))
#define OPT__FORCE(var, h, f) OPT_COUNTUP_F('f', "force", (var), (h), (f))
-#define OPT__ABBREV(var) \
- { OPTION_CALLBACK, 0, "abbrev", (var), N_("n"), \
- N_("use <n> digits to display object names"), \
- PARSE_OPT_OPTARG, &parse_opt_abbrev_cb, 0 }
+#define OPT__ABBREV(var) { \
+ .type = OPTION_CALLBACK, \
+ .long_name = "abbrev", \
+ .value = (var), \
+ .argh = N_("n"), \
+ .help = N_("use <n> digits to display object names"), \
+ .flags = PARSE_OPT_OPTARG, \
+ .callback = &parse_opt_abbrev_cb, \
+}
+#define OPT__SUPER_PREFIX(var) \
+ OPT_STRING_F(0, "super-prefix", (var), N_("prefix"), \
+ N_("prefixed path to initial superproject"), PARSE_OPT_HIDDEN)
+
#define OPT__COLOR(var, h) \
OPT_COLOR_FLAG(0, "color", (var), (h))
-#define OPT_COLUMN(s, l, v, h) \
- { OPTION_CALLBACK, (s), (l), (v), N_("style"), (h), PARSE_OPT_OPTARG, parseopt_column_callback }
-#define OPT_PASSTHRU(s, l, v, a, h, f) \
- { OPTION_CALLBACK, (s), (l), (v), (a), (h), (f), parse_opt_passthru }
-#define OPT_PASSTHRU_ARGV(s, l, v, a, h, f) \
- { OPTION_CALLBACK, (s), (l), (v), (a), (h), (f), parse_opt_passthru_argv }
-#define _OPT_CONTAINS_OR_WITH(name, variable, help, flag) \
- { OPTION_CALLBACK, 0, name, (variable), N_("commit"), (help), \
- PARSE_OPT_LASTARG_DEFAULT | flag, \
- parse_opt_commits, (intptr_t) "HEAD" \
- }
+#define OPT_COLUMN(s, l, v, h) { \
+ .type = OPTION_CALLBACK, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .argh = N_("style"), \
+ .help = (h), \
+ .flags = PARSE_OPT_OPTARG, \
+ .callback = parseopt_column_callback, \
+}
+#define OPT_PASSTHRU(s, l, v, a, h, f) { \
+ .type = OPTION_CALLBACK, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .argh = (a), \
+ .help = (h), \
+ .flags = (f), \
+ .callback = parse_opt_passthru, \
+}
+#define OPT_PASSTHRU_ARGV(s, l, v, a, h, f) { \
+ .type = OPTION_CALLBACK, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = (v), \
+ .argh = (a), \
+ .help = (h), \
+ .flags = (f), \
+ .callback = parse_opt_passthru_argv, \
+}
+#define _OPT_CONTAINS_OR_WITH(l, v, h, f) { \
+ .type = OPTION_CALLBACK, \
+ .long_name = (l), \
+ .value = (v), \
+ .argh = N_("commit"), \
+ .help = (h), \
+ .flags = PARSE_OPT_LASTARG_DEFAULT | (f), \
+ .callback = parse_opt_commits, \
+ .defval = (intptr_t) "HEAD", \
+}
#define OPT_CONTAINS(v, h) _OPT_CONTAINS_OR_WITH("contains", v, h, PARSE_OPT_NONEG)
#define OPT_NO_CONTAINS(v, h) _OPT_CONTAINS_OR_WITH("no-contains", v, h, PARSE_OPT_NONEG)
#define OPT_WITH(v, h) _OPT_CONTAINS_OR_WITH("with", v, h, PARSE_OPT_HIDDEN | PARSE_OPT_NONEG)
@@ -370,4 +583,10 @@ int parse_opt_tracking_mode(const struct option *, const char *, int);
#define OPT_PATHSPEC_FILE_NUL(v) OPT_BOOL(0, "pathspec-file-nul", v, N_("with --pathspec-from-file, pathspec elements are separated with NUL character"))
#define OPT_AUTOSTASH(v) OPT_BOOL(0, "autostash", v, N_("automatically stash/stash pop before and after"))
+#define OPT_IPVERSION(v) \
+ OPT_SET_INT_F('4', "ipv4", (v), N_("use IPv4 addresses only"), \
+ TRANSPORT_FAMILY_IPV4, PARSE_OPT_NONEG), \
+ OPT_SET_INT_F('6', "ipv6", (v), N_("use IPv6 addresses only"), \
+ TRANSPORT_FAMILY_IPV6, PARSE_OPT_NONEG)
+
#endif
diff --git a/parse.c b/parse.c
new file mode 100644
index 0000000..42d691a
--- /dev/null
+++ b/parse.c
@@ -0,0 +1,182 @@
+#include "git-compat-util.h"
+#include "gettext.h"
+#include "parse.h"
+
+static uintmax_t get_unit_factor(const char *end)
+{
+ if (!*end)
+ return 1;
+ else if (!strcasecmp(end, "k"))
+ return 1024;
+ else if (!strcasecmp(end, "m"))
+ return 1024 * 1024;
+ else if (!strcasecmp(end, "g"))
+ return 1024 * 1024 * 1024;
+ return 0;
+}
+
+int git_parse_signed(const char *value, intmax_t *ret, intmax_t max)
+{
+ if (value && *value) {
+ char *end;
+ intmax_t val;
+ intmax_t factor;
+
+ if (max < 0)
+ BUG("max must be a positive integer");
+
+ errno = 0;
+ val = strtoimax(value, &end, 0);
+ if (errno == ERANGE)
+ return 0;
+ if (end == value) {
+ errno = EINVAL;
+ return 0;
+ }
+ factor = get_unit_factor(end);
+ if (!factor) {
+ errno = EINVAL;
+ return 0;
+ }
+ if ((val < 0 && -max / factor > val) ||
+ (val > 0 && max / factor < val)) {
+ errno = ERANGE;
+ return 0;
+ }
+ val *= factor;
+ *ret = val;
+ return 1;
+ }
+ errno = EINVAL;
+ return 0;
+}
+
+static int git_parse_unsigned(const char *value, uintmax_t *ret, uintmax_t max)
+{
+ if (value && *value) {
+ char *end;
+ uintmax_t val;
+ uintmax_t factor;
+
+ /* negative values would be accepted by strtoumax */
+ if (strchr(value, '-')) {
+ errno = EINVAL;
+ return 0;
+ }
+ errno = 0;
+ val = strtoumax(value, &end, 0);
+ if (errno == ERANGE)
+ return 0;
+ if (end == value) {
+ errno = EINVAL;
+ return 0;
+ }
+ factor = get_unit_factor(end);
+ if (!factor) {
+ errno = EINVAL;
+ return 0;
+ }
+ if (unsigned_mult_overflows(factor, val) ||
+ factor * val > max) {
+ errno = ERANGE;
+ return 0;
+ }
+ val *= factor;
+ *ret = val;
+ return 1;
+ }
+ errno = EINVAL;
+ return 0;
+}
+
+int git_parse_int(const char *value, int *ret)
+{
+ intmax_t tmp;
+ if (!git_parse_signed(value, &tmp, maximum_signed_value_of_type(int)))
+ return 0;
+ *ret = tmp;
+ return 1;
+}
+
+int git_parse_int64(const char *value, int64_t *ret)
+{
+ intmax_t tmp;
+ if (!git_parse_signed(value, &tmp, maximum_signed_value_of_type(int64_t)))
+ return 0;
+ *ret = tmp;
+ return 1;
+}
+
+int git_parse_ulong(const char *value, unsigned long *ret)
+{
+ uintmax_t tmp;
+ if (!git_parse_unsigned(value, &tmp, maximum_unsigned_value_of_type(long)))
+ return 0;
+ *ret = tmp;
+ return 1;
+}
+
+int git_parse_ssize_t(const char *value, ssize_t *ret)
+{
+ intmax_t tmp;
+ if (!git_parse_signed(value, &tmp, maximum_signed_value_of_type(ssize_t)))
+ return 0;
+ *ret = tmp;
+ return 1;
+}
+
+int git_parse_maybe_bool_text(const char *value)
+{
+ if (!value)
+ return 1;
+ if (!*value)
+ return 0;
+ if (!strcasecmp(value, "true")
+ || !strcasecmp(value, "yes")
+ || !strcasecmp(value, "on"))
+ return 1;
+ if (!strcasecmp(value, "false")
+ || !strcasecmp(value, "no")
+ || !strcasecmp(value, "off"))
+ return 0;
+ return -1;
+}
+
+int git_parse_maybe_bool(const char *value)
+{
+ int v = git_parse_maybe_bool_text(value);
+ if (0 <= v)
+ return v;
+ if (git_parse_int(value, &v))
+ return !!v;
+ return -1;
+}
+
+/*
+ * Parse environment variable 'k' as a boolean (in various
+ * possible spellings); if missing, use the default value 'def'.
+ */
+int git_env_bool(const char *k, int def)
+{
+ const char *v = getenv(k);
+ int val;
+ if (!v)
+ return def;
+ val = git_parse_maybe_bool(v);
+ if (val < 0)
+ die(_("bad boolean environment value '%s' for '%s'"),
+ v, k);
+ return val;
+}
+
+/*
+ * Parse environment variable 'k' as ulong with possibly a unit
+ * suffix; if missing, use the default value 'val'.
+ */
+unsigned long git_env_ulong(const char *k, unsigned long val)
+{
+ const char *v = getenv(k);
+ if (v && !git_parse_ulong(v, &val))
+ die(_("failed to parse %s"), k);
+ return val;
+}
diff --git a/parse.h b/parse.h
new file mode 100644
index 0000000..07d2193
--- /dev/null
+++ b/parse.h
@@ -0,0 +1,20 @@
+#ifndef PARSE_H
+#define PARSE_H
+
+int git_parse_signed(const char *value, intmax_t *ret, intmax_t max);
+int git_parse_ssize_t(const char *, ssize_t *);
+int git_parse_ulong(const char *, unsigned long *);
+int git_parse_int(const char *value, int *ret);
+int git_parse_int64(const char *value, int64_t *ret);
+
+/**
+ * Same as `git_config_bool`, except that it returns -1 on error rather
+ * than dying.
+ */
+int git_parse_maybe_bool(const char *);
+int git_parse_maybe_bool_text(const char *value);
+
+int git_env_bool(const char *, int);
+unsigned long git_env_ulong(const char *, unsigned long);
+
+#endif /* PARSE_H */
diff --git a/patch-ids.c b/patch-ids.c
index 8bf4255..a5683b4 100644
--- a/patch-ids.c
+++ b/patch-ids.c
@@ -1,7 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "diff.h"
#include "commit.h"
-#include "hash-lookup.h"
+#include "hash.h"
+#include "hex.h"
#include "patch-ids.h"
static int patch_id_defined(struct commit *commit)
@@ -11,7 +12,7 @@ static int patch_id_defined(struct commit *commit)
}
int commit_patch_id(struct commit *commit, struct diff_options *options,
- struct object_id *oid, int diff_header_only, int stable)
+ struct object_id *oid, int diff_header_only)
{
if (!patch_id_defined(commit))
return -1;
@@ -22,7 +23,7 @@ int commit_patch_id(struct commit *commit, struct diff_options *options,
else
diff_root_tree_oid(&commit->object.oid, "", options);
diffcore_std(options);
- return diff_flush_patch_id(options, oid, diff_header_only, stable);
+ return diff_flush_patch_id(options, oid, diff_header_only);
}
/*
@@ -38,7 +39,7 @@ int commit_patch_id(struct commit *commit, struct diff_options *options,
static int patch_id_neq(const void *cmpfn_data,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
- const void *unused_keydata)
+ const void *keydata UNUSED)
{
/* NEEDSWORK: const correctness? */
struct diff_options *opt = (void *)cmpfn_data;
@@ -48,11 +49,11 @@ static int patch_id_neq(const void *cmpfn_data,
b = container_of(entry_or_key, struct patch_id, ent);
if (is_null_oid(&a->patch_id) &&
- commit_patch_id(a->commit, opt, &a->patch_id, 0, 0))
+ commit_patch_id(a->commit, opt, &a->patch_id, 0))
return error("Could not get patch ID for %s",
oid_to_hex(&a->commit->object.oid));
if (is_null_oid(&b->patch_id) &&
- commit_patch_id(b->commit, opt, &b->patch_id, 0, 0))
+ commit_patch_id(b->commit, opt, &b->patch_id, 0))
return error("Could not get patch ID for %s",
oid_to_hex(&b->commit->object.oid));
return !oideq(&a->patch_id, &b->patch_id);
@@ -82,7 +83,7 @@ static int init_patch_id_entry(struct patch_id *patch,
struct object_id header_only_patch_id;
patch->commit = commit;
- if (commit_patch_id(commit, &ids->diffopts, &header_only_patch_id, 1, 0))
+ if (commit_patch_id(commit, &ids->diffopts, &header_only_patch_id, 1))
return -1;
hashmap_entry_init(&patch->ent, oidhash(&header_only_patch_id));
diff --git a/patch-ids.h b/patch-ids.h
index ab6c6a6..490d739 100644
--- a/patch-ids.h
+++ b/patch-ids.h
@@ -20,7 +20,7 @@ struct patch_ids {
};
int commit_patch_id(struct commit *commit, struct diff_options *options,
- struct object_id *oid, int, int);
+ struct object_id *oid, int);
int init_patch_ids(struct repository *, struct patch_ids *);
int free_patch_ids(struct patch_ids *);
diff --git a/path.c b/path.c
index a3cfcd8..67229ed 100644
--- a/path.c
+++ b/path.c
@@ -1,16 +1,21 @@
/*
* Utilities for paths and pathnames
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "repository.h"
#include "strbuf.h"
#include "string-list.h"
#include "dir.h"
#include "worktree.h"
+#include "setup.h"
#include "submodule-config.h"
#include "path.h"
#include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "lockfile.h"
#include "exec-cmd.h"
@@ -23,8 +28,6 @@ static int get_st_mode_bits(const char *path, int *mode)
return 0;
}
-static char bad_path[] = "/bad-path/";
-
static struct strbuf *get_pathname(void)
{
static struct strbuf pathname_array[4] = {
@@ -54,21 +57,6 @@ static void strbuf_cleanup_path(struct strbuf *sb)
strbuf_remove(sb, 0, path - sb->buf);
}
-char *mksnpath(char *buf, size_t n, const char *fmt, ...)
-{
- va_list args;
- unsigned len;
-
- va_start(args, fmt);
- len = vsnprintf(buf, n, fmt, args);
- va_end(args);
- if (len >= n) {
- strlcpy(buf, bad_path, n);
- return buf;
- }
- return (char *)cleanup_path(buf);
-}
-
static int dir_prefix(const char *buf, const char *dir)
{
int len = strlen(dir);
@@ -347,7 +335,8 @@ static void init_common_trie(void)
* Helper function for update_common_dir: returns 1 if the dir
* prefix is common.
*/
-static int check_common(const char *unmatched, void *value, void *baton)
+static int check_common(const char *unmatched, void *value,
+ void *baton UNUSED)
{
struct common_dir *dir = value;
@@ -865,7 +854,7 @@ const char *enter_repo(const char *path, int strict)
return NULL;
}
-static int calc_shared_perm(int mode)
+int calc_shared_perm(int mode)
{
int tweak;
@@ -901,7 +890,13 @@ int adjust_shared_perm(const char *path)
if (S_ISDIR(old_mode)) {
/* Copy read bits to execute bits */
new_mode |= (new_mode & 0444) >> 2;
- new_mode |= FORCE_DIR_SET_GID;
+
+ /*
+ * g+s matters only if any extra access is granted
+ * based on group membership.
+ */
+ if (FORCE_DIR_SET_GID && (new_mode & 060))
+ new_mode |= FORCE_DIR_SET_GID;
}
if (((old_mode ^ new_mode) & ~S_IFMT) &&
@@ -1200,6 +1195,26 @@ int normalize_path_copy(char *dst, const char *src)
return normalize_path_copy_len(dst, src, NULL);
}
+int strbuf_normalize_path(struct strbuf *src)
+{
+ struct strbuf dst = STRBUF_INIT;
+
+ strbuf_grow(&dst, src->len);
+ if (normalize_path_copy(dst.buf, src->buf) < 0) {
+ strbuf_release(&dst);
+ return -1;
+ }
+
+ /*
+ * normalize_path does not tell us the new length, so we have to
+ * compute it by looking for the new NUL it placed
+ */
+ strbuf_setlen(&dst, strlen(dst.buf));
+ strbuf_swap(src, &dst);
+ strbuf_release(&dst);
+ return 0;
+}
+
/*
* path = Canonical absolute path
* prefixes = string_list containing normalized, absolute paths without
@@ -1556,7 +1571,5 @@ REPO_GIT_PATH_FUNC(merge_msg, "MERGE_MSG")
REPO_GIT_PATH_FUNC(merge_rr, "MERGE_RR")
REPO_GIT_PATH_FUNC(merge_mode, "MERGE_MODE")
REPO_GIT_PATH_FUNC(merge_head, "MERGE_HEAD")
-REPO_GIT_PATH_FUNC(merge_autostash, "MERGE_AUTOSTASH")
-REPO_GIT_PATH_FUNC(auto_merge, "AUTO_MERGE")
REPO_GIT_PATH_FUNC(fetch_head, "FETCH_HEAD")
REPO_GIT_PATH_FUNC(shallow, "shallow")
diff --git a/path.h b/path.h
index 0a59c85..ea96487 100644
--- a/path.h
+++ b/path.h
@@ -3,6 +3,7 @@
struct repository;
struct strbuf;
+struct string_list;
/*
* The result to all functions which return statically allocated memory may be
@@ -23,12 +24,6 @@ char *mkpathdup(const char *fmt, ...)
__attribute__((format (printf, 1, 2)));
/*
- * Construct a path and place the result in the provided buffer `buf`.
- */
-char *mksnpath(char *buf, size_t n, const char *fmt, ...)
- __attribute__((format (printf, 3, 4)));
-
-/*
* The `git_common_path` family of functions will construct a path into a
* repository's common git directory, which is shared by all worktrees.
*/
@@ -174,12 +169,75 @@ const char *git_path_merge_msg(struct repository *r);
const char *git_path_merge_rr(struct repository *r);
const char *git_path_merge_mode(struct repository *r);
const char *git_path_merge_head(struct repository *r);
-const char *git_path_merge_autostash(struct repository *r);
-const char *git_path_auto_merge(struct repository *r);
const char *git_path_fetch_head(struct repository *r);
const char *git_path_shallow(struct repository *r);
-
int ends_with_path_components(const char *path, const char *components);
+int validate_headref(const char *ref);
+
+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);
+const char *remove_leading_path(const char *in, const char *prefix);
+const char *relative_path(const char *in, const char *prefix, struct strbuf *sb);
+int normalize_path_copy_len(char *dst, const char *src, int *prefix_len);
+int normalize_path_copy(char *dst, const char *src);
+/**
+ * Normalize in-place the path contained in the strbuf. If an error occurs,
+ * the contents of "sb" are left untouched, and -1 is returned.
+ */
+int strbuf_normalize_path(struct strbuf *src);
+int longest_ancestor_length(const char *path, struct string_list *prefixes);
+char *strip_path_suffix(const char *path, const char *suffix);
+int daemon_avoid_alias(const char *path);
+
+/*
+ * These functions match their is_hfs_dotgit() counterparts; see utf8.h for
+ * details.
+ */
+int is_ntfs_dotgit(const char *name);
+int is_ntfs_dotgitmodules(const char *name);
+int is_ntfs_dotgitignore(const char *name);
+int is_ntfs_dotgitattributes(const char *name);
+int is_ntfs_dotmailmap(const char *name);
+
+/*
+ * Returns true iff "str" could be confused as a command-line option when
+ * passed to a sub-program like "ssh". Note that this has nothing to do with
+ * shell-quoting, which should be handled separately; we're assuming here that
+ * the string makes it verbatim to the sub-program.
+ */
+int looks_like_command_line_option(const char *str);
+
+/**
+ * Return a newly allocated string with the evaluation of
+ * "$XDG_CONFIG_HOME/$subdir/$filename" if $XDG_CONFIG_HOME is non-empty, otherwise
+ * "$HOME/.config/$subdir/$filename". Return NULL upon error.
+ */
+char *xdg_config_home_for(const char *subdir, const char *filename);
+
+/**
+ * Return a newly allocated string with the evaluation of
+ * "$XDG_CONFIG_HOME/git/$filename" if $XDG_CONFIG_HOME is non-empty, otherwise
+ * "$HOME/.config/git/$filename". Return NULL upon error.
+ */
+char *xdg_config_home(const char *filename);
+
+/**
+ * Return a newly allocated string with the evaluation of
+ * "$XDG_CACHE_HOME/git/$filename" if $XDG_CACHE_HOME is non-empty, otherwise
+ * "$HOME/.cache/git/$filename". Return NULL upon error.
+ */
+char *xdg_cache_home(const char *filename);
+
+/*
+ * Create a directory and (if share is nonzero) adjust its permissions
+ * according to the shared_repository setting. Only use this for
+ * directories under $GIT_DIR. Don't use it for working tree
+ * directories.
+ */
+void safe_create_dir(const char *dir, int share);
#endif /* PATH_H */
diff --git a/pathspec.c b/pathspec.c
index 84ad9c7..2133b9f 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -1,10 +1,18 @@
-#include "cache.h"
-#include "config.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "parse.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
#include "pathspec.h"
#include "attr.h"
+#include "read-cache.h"
+#include "repository.h"
+#include "setup.h"
#include "strvec.h"
+#include "symlinks.h"
#include "quote.h"
+#include "wildmatch.h"
/*
* Finds which of the given pathspecs match items in the index.
@@ -101,16 +109,37 @@ static struct pathspec_magic {
{ PATHSPEC_ATTR, '\0', "attr" },
};
-static void prefix_magic(struct strbuf *sb, int prefixlen, unsigned magic)
+static void prefix_magic(struct strbuf *sb, int prefixlen,
+ unsigned magic, const char *element)
{
- int i;
- strbuf_addstr(sb, ":(");
- for (i = 0; i < ARRAY_SIZE(pathspec_magic); i++)
- if (magic & pathspec_magic[i].bit) {
- if (sb->buf[sb->len - 1] != '(')
- strbuf_addch(sb, ',');
- strbuf_addstr(sb, pathspec_magic[i].name);
+ /* No magic was found in element, just add prefix magic */
+ if (!magic) {
+ strbuf_addf(sb, ":(prefix:%d)", prefixlen);
+ return;
+ }
+
+ /*
+ * At this point, we know that parse_element_magic() was able
+ * to extract some pathspec magic from element. So we know
+ * element is correctly formatted in either shorthand or
+ * longhand form
+ */
+ if (element[1] != '(') {
+ /* Process an element in shorthand form (e.g. ":!/<match>") */
+ strbuf_addstr(sb, ":(");
+ for (int i = 0; i < ARRAY_SIZE(pathspec_magic); i++) {
+ if ((magic & pathspec_magic[i].bit) &&
+ pathspec_magic[i].mnemonic) {
+ if (sb->buf[sb->len - 1] != '(')
+ strbuf_addch(sb, ',');
+ strbuf_addstr(sb, pathspec_magic[i].name);
+ }
}
+ } else {
+ /* For the longhand form, we copy everything up to the final ')' */
+ size_t len = strchr(element, ')') - element;
+ strbuf_add(sb, element, len);
+ }
strbuf_addf(sb, ",prefix:%d)", prefixlen);
}
@@ -459,7 +488,12 @@ static void init_pathspec_item(struct pathspec_item *item, unsigned flags,
match = prefix_path_gently(prefix, prefixlen,
&prefixlen, copyfrom);
if (!match) {
- const char *hint_path = get_git_work_tree();
+ const char *hint_path;
+
+ if (!have_git_dir())
+ die(_("'%s' is outside the directory tree"),
+ copyfrom);
+ hint_path = get_git_work_tree();
if (!hint_path)
hint_path = get_git_dir();
die(_("%s: '%s' is outside repository at '%s'"), elt,
@@ -480,7 +514,7 @@ static void init_pathspec_item(struct pathspec_item *item, unsigned flags,
struct strbuf sb = STRBUF_INIT;
/* Preserve the actual prefix length of each pattern */
- prefix_magic(&sb, prefixlen, element_magic);
+ prefix_magic(&sb, prefixlen, element_magic, elt);
strbuf_addstr(&sb, match);
item->original = strbuf_detach(&sb, NULL);
@@ -525,27 +559,32 @@ static int pathspec_item_cmp(const void *a_, const void *b_)
return strcmp(a->match, b->match);
}
-static void NORETURN unsupported_magic(const char *pattern,
- unsigned magic)
+void pathspec_magic_names(unsigned magic, struct strbuf *out)
{
- struct strbuf sb = STRBUF_INIT;
int i;
for (i = 0; i < ARRAY_SIZE(pathspec_magic); i++) {
const struct pathspec_magic *m = pathspec_magic + i;
if (!(magic & m->bit))
continue;
- if (sb.len)
- strbuf_addstr(&sb, ", ");
+ if (out->len)
+ strbuf_addstr(out, ", ");
if (m->mnemonic)
- strbuf_addf(&sb, _("'%s' (mnemonic: '%c')"),
+ strbuf_addf(out, _("'%s' (mnemonic: '%c')"),
m->name, m->mnemonic);
else
- strbuf_addf(&sb, "'%s'", m->name);
+ strbuf_addf(out, "'%s'", m->name);
}
+}
+
+static void NORETURN unsupported_magic(const char *pattern,
+ unsigned magic)
+{
+ struct strbuf sb = STRBUF_INIT;
+ pathspec_magic_names(magic, &sb);
/*
* We may want to substitute "this command" with a command
- * name. E.g. when add--interactive dies when running
+ * name. E.g. when "git add -p" or "git add -i" dies when running
* "checkout -p"
*/
die(_("%s: pathspec magic not supported by this command: %s"),
@@ -681,8 +720,7 @@ void copy_pathspec(struct pathspec *dst, const struct pathspec *src)
int i, j;
*dst = *src;
- ALLOC_ARRAY(dst->items, dst->nr);
- COPY_ARRAY(dst->items, src->items, dst->nr);
+ DUP_ARRAY(dst->items, src->items, dst->nr);
for (i = 0; i < dst->nr; i++) {
struct pathspec_item *d = &dst->items[i];
@@ -691,8 +729,7 @@ void copy_pathspec(struct pathspec *dst, const struct pathspec *src)
d->match = xstrdup(s->match);
d->original = xstrdup(s->original);
- ALLOC_ARRAY(d->attr_match, d->attr_match_nr);
- COPY_ARRAY(d->attr_match, s->attr_match, d->attr_match_nr);
+ DUP_ARRAY(d->attr_match, s->attr_match, d->attr_match_nr);
for (j = 0; j < d->attr_match_nr; j++) {
const char *value = s->attr_match[j].value;
d->attr_match[j].value = xstrdup_or_null(value);
@@ -759,3 +796,92 @@ int match_pathspec_attrs(struct index_state *istate,
return 1;
}
+
+int pathspec_needs_expanded_index(struct index_state *istate,
+ const struct pathspec *pathspec)
+{
+ unsigned int i, pos;
+ int res = 0;
+ char *skip_worktree_seen = NULL;
+
+ /*
+ * If index is not sparse, no index expansion is needed.
+ */
+ if (!istate->sparse_index)
+ return 0;
+
+ /*
+ * When using a magic pathspec, assume for the sake of simplicity that
+ * the index needs to be expanded to match all matchable files.
+ */
+ if (pathspec->magic)
+ return 1;
+
+ for (i = 0; i < pathspec->nr; i++) {
+ struct pathspec_item item = pathspec->items[i];
+
+ /*
+ * If the pathspec item has a wildcard, the index should be expanded
+ * if the pathspec has the possibility of matching a subset of entries inside
+ * of a sparse directory (but not the entire directory).
+ *
+ * If the pathspec item is a literal path, the index only needs to be expanded
+ * if a) the pathspec isn't in the sparse checkout cone (to make sure we don't
+ * expand for in-cone files) and b) it doesn't match any sparse directories
+ * (since we can reset whole sparse directories without expanding them).
+ */
+ if (item.nowildcard_len < item.len) {
+ /*
+ * Special case: if the pattern is a path inside the cone
+ * followed by only wildcards, the pattern cannot match
+ * partial sparse directories, so we know we don't need to
+ * expand the index.
+ *
+ * Examples:
+ * - in-cone/foo***: doesn't need expanded index
+ * - not-in-cone/bar*: may need expanded index
+ * - **.c: may need expanded index
+ */
+ if (strspn(item.original + item.nowildcard_len, "*") == item.len - item.nowildcard_len &&
+ path_in_cone_mode_sparse_checkout(item.original, istate))
+ continue;
+
+ for (pos = 0; pos < istate->cache_nr; pos++) {
+ struct cache_entry *ce = istate->cache[pos];
+
+ if (!S_ISSPARSEDIR(ce->ce_mode))
+ continue;
+
+ /*
+ * If the pre-wildcard length is longer than the sparse
+ * directory name and the sparse directory is the first
+ * component of the pathspec, need to expand the index.
+ */
+ if (item.nowildcard_len > ce_namelen(ce) &&
+ !strncmp(item.original, ce->name, ce_namelen(ce))) {
+ res = 1;
+ break;
+ }
+
+ /*
+ * If the pre-wildcard length is shorter than the sparse
+ * directory and the pathspec does not match the whole
+ * directory, need to expand the index.
+ */
+ if (!strncmp(item.original, ce->name, item.nowildcard_len) &&
+ wildmatch(item.original, ce->name, 0)) {
+ res = 1;
+ break;
+ }
+ }
+ } else if (!path_in_cone_mode_sparse_checkout(item.original, istate) &&
+ !matches_skip_worktree(pathspec, i, &skip_worktree_seen))
+ res = 1;
+
+ if (res > 0)
+ break;
+ }
+
+ free(skip_worktree_seen);
+ return res;
+}
diff --git a/pathspec.h b/pathspec.h
index 402ebb8..fec4399 100644
--- a/pathspec.h
+++ b/pathspec.h
@@ -130,6 +130,14 @@ void parse_pathspec_file(struct pathspec *pathspec,
void copy_pathspec(struct pathspec *dst, const struct pathspec *src);
void clear_pathspec(struct pathspec *);
+/*
+ * Add a human-readable string to "out" representing the PATHSPEC_* flags set
+ * in "magic". The result is suitable for error messages, but not for
+ * parsing as pathspec magic itself (you get 'icase' with quotes, not
+ * :(icase)).
+ */
+void pathspec_magic_names(unsigned magic, struct strbuf *out);
+
static inline int ps_strncmp(const struct pathspec_item *item,
const char *s1, const char *s2, size_t n)
{
@@ -171,4 +179,21 @@ int match_pathspec_attrs(struct index_state *istate,
const char *name, int namelen,
const struct pathspec_item *item);
+int match_pathspec(struct index_state *istate,
+ const struct pathspec *pathspec,
+ const char *name, int namelen,
+ int prefix, char *seen, int is_dir);
+
+/*
+ * Determine whether a pathspec will match only entire index entries (non-sparse
+ * files and/or entire sparse directories). If the pathspec has the potential to
+ * match partial contents of a sparse directory, return 1 to indicate the index
+ * should be expanded to match the appropriate index entries.
+ *
+ * For the sake of simplicity, always return 1 if using a more complex "magic"
+ * pathspec.
+ */
+int pathspec_needs_expanded_index(struct index_state *istate,
+ const struct pathspec *pathspec);
+
#endif /* PATHSPEC_H */
diff --git a/perl/FromCPAN/Error.pm b/perl/FromCPAN/Error.pm
index d82b713..5b97e03 100644
--- a/perl/FromCPAN/Error.pm
+++ b/perl/FromCPAN/Error.pm
@@ -1025,7 +1025,7 @@ C<:warndie> handlers added by Paul Evans <leonerd@leonerd.org.uk>
=head1 MAINTAINER
-Shlomi Fish, L<http://www.shlomifish.org/> .
+Shlomi Fish, L<https://www.shlomifish.org/> .
=head1 PAST MAINTAINERS
diff --git a/perl/Git.pm b/perl/Git.pm
index 080cdc2..03bf570 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -7,7 +7,7 @@ Git - Perl interface to the Git version control system
package Git;
-use 5.008;
+use 5.008001;
use strict;
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
@@ -177,16 +177,27 @@ sub repository {
-d $opts{Directory} or throw Error::Simple("Directory not found: $opts{Directory} $!");
my $search = Git->repository(WorkingCopy => $opts{Directory});
- my $dir;
+
+ # This rev-parse will throw an exception if we're not in a
+ # repository, which is what we want, but it's kind of noisy.
+ # Ideally we'd capture stderr and relay it, but doing so is
+ # awkward without depending on it fitting in a pipe buffer. So
+ # we just reproduce a plausible error message ourselves.
+ my $out;
try {
- $dir = $search->command_oneline(['rev-parse', '--git-dir'],
- STDERR => 0);
+ # Note that "--is-bare-repository" must come first, as
+ # --git-dir output could contain newlines.
+ $out = $search->command([qw(rev-parse --is-bare-repository --git-dir)],
+ STDERR => 0);
} catch Git::Error::Command with {
- $dir = undef;
+ throw Error::Simple("fatal: not a git repository: $opts{Directory}");
};
+ chomp $out;
+ my ($bare, $dir) = split /\n/, $out, 2;
+
require Cwd;
- if ($dir) {
+ if ($bare ne 'true') {
require File::Spec;
File::Spec->file_name_is_absolute($dir) or $dir = $opts{Directory} . '/' . $dir;
$opts{Repository} = Cwd::abs_path($dir);
@@ -204,21 +215,6 @@ sub repository {
$opts{WorkingSubdir} = $prefix;
} else {
- # A bare repository? Let's see...
- $dir = $opts{Directory};
-
- unless (-d "$dir/refs" and -d "$dir/objects" and -e "$dir/HEAD") {
- # Mimic git-rev-parse --git-dir error message:
- throw Error::Simple("fatal: Not a git repository: $dir");
- }
- my $search = Git->repository(Repository => $dir);
- try {
- $search->command('symbolic-ref', 'HEAD');
- } catch Git::Error::Command with {
- # Mimic git-rev-parse --git-dir error message:
- throw Error::Simple("fatal: Not a git repository: $dir");
- }
-
$opts{Repository} = Cwd::abs_path($dir);
}
diff --git a/perl/Git/I18N.pm b/perl/Git/I18N.pm
index 895e759..5454c3a 100644
--- a/perl/Git/I18N.pm
+++ b/perl/Git/I18N.pm
@@ -1,5 +1,5 @@
package Git::I18N;
-use 5.008;
+use 5.008001;
use strict;
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
BEGIN {
diff --git a/perl/Git/LoadCPAN.pm b/perl/Git/LoadCPAN.pm
index 0c360bc..8c7fa80 100644
--- a/perl/Git/LoadCPAN.pm
+++ b/perl/Git/LoadCPAN.pm
@@ -1,5 +1,5 @@
package Git::LoadCPAN;
-use 5.008;
+use 5.008001;
use strict;
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
diff --git a/perl/Git/LoadCPAN/Error.pm b/perl/Git/LoadCPAN/Error.pm
index 5d84c20..5cecb0f 100644
--- a/perl/Git/LoadCPAN/Error.pm
+++ b/perl/Git/LoadCPAN/Error.pm
@@ -1,5 +1,5 @@
package Git::LoadCPAN::Error;
-use 5.008;
+use 5.008001;
use strict;
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use Git::LoadCPAN (
diff --git a/perl/Git/LoadCPAN/Mail/Address.pm b/perl/Git/LoadCPAN/Mail/Address.pm
index 340e88a..9f80809 100644
--- a/perl/Git/LoadCPAN/Mail/Address.pm
+++ b/perl/Git/LoadCPAN/Mail/Address.pm
@@ -1,5 +1,5 @@
package Git::LoadCPAN::Mail::Address;
-use 5.008;
+use 5.008001;
use strict;
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use Git::LoadCPAN (
diff --git a/perl/Git/Packet.pm b/perl/Git/Packet.pm
index d144f51..d896e69 100644
--- a/perl/Git/Packet.pm
+++ b/perl/Git/Packet.pm
@@ -1,5 +1,5 @@
package Git::Packet;
-use 5.008;
+use 5.008001;
use strict;
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
BEGIN {
diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
index 6ce2e28..7721708 100644
--- a/perl/Git/SVN.pm
+++ b/perl/Git/SVN.pm
@@ -1752,7 +1752,7 @@ sub tie_for_persistent_memoization {
END {
# Force cache writeout explicitly instead of waiting for
# global destruction to avoid segfault in Storable:
- # http://rt.cpan.org/Public/Bug/Display.html?id=36087
+ # https://rt.cpan.org/Public/Bug/Display.html?id=36087
unmemoize_svn_mergeinfo_functions();
}
diff --git a/pkt-line.c b/pkt-line.c
index 8e43c2d..24479ea 100644
--- a/pkt-line.c
+++ b/pkt-line.c
@@ -1,6 +1,12 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "copy.h"
#include "pkt-line.h"
+#include "gettext.h"
+#include "hex.h"
#include "run-command.h"
+#include "sideband.h"
+#include "trace.h"
+#include "write-or-die.h"
char packet_buffer[LARGE_PACKET_MAX];
static const char *packet_trace_prefix = "git";
@@ -309,7 +315,8 @@ int write_packetized_from_fd_no_flush(int fd_in, int fd_out)
return err;
}
-int write_packetized_from_buf_no_flush(const char *src_in, size_t len, int fd_out)
+int write_packetized_from_buf_no_flush_count(const char *src_in, size_t len,
+ int fd_out, int *packet_counter)
{
int err = 0;
size_t bytes_written = 0;
@@ -324,6 +331,8 @@ int write_packetized_from_buf_no_flush(const char *src_in, size_t len, int fd_ou
break;
err = packet_write_gently(fd_out, src_in + bytes_written, bytes_to_write);
bytes_written += bytes_to_write;
+ if (packet_counter)
+ (*packet_counter)++;
}
return err;
}
@@ -364,10 +373,14 @@ static int get_packet_data(int fd, char **src_buf, size_t *src_size,
return ret;
}
-int packet_length(const char lenbuf_hex[4])
+int packet_length(const char lenbuf_hex[4], size_t size)
{
- int val = hex2chr(lenbuf_hex);
- return (val < 0) ? val : (val << 8) | hex2chr(lenbuf_hex + 2);
+ if (size < 4)
+ BUG("buffer too small");
+ return hexval(lenbuf_hex[0]) << 12 |
+ hexval(lenbuf_hex[1]) << 8 |
+ hexval(lenbuf_hex[2]) << 4 |
+ hexval(lenbuf_hex[3]);
}
static char *find_packfile_uri_path(const char *buffer)
@@ -410,7 +423,7 @@ enum packet_read_status packet_read_with_status(int fd, char **src_buffer,
return PACKET_READ_EOF;
}
- len = packet_length(linelen);
+ len = packet_length(linelen, sizeof(linelen));
if (len < 0) {
if (options & PACKET_READ_GENTLE_ON_READ_ERROR)
@@ -450,8 +463,32 @@ enum packet_read_status packet_read_with_status(int fd, char **src_buffer,
}
if ((options & PACKET_READ_CHOMP_NEWLINE) &&
- len && buffer[len-1] == '\n')
- len--;
+ len && buffer[len-1] == '\n') {
+ if (options & PACKET_READ_USE_SIDEBAND) {
+ int band = *buffer & 0xff;
+ switch (band) {
+ case 1:
+ /* Chomp newline for payload */
+ len--;
+ break;
+ case 2:
+ case 3:
+ /*
+ * Do not chomp newline for progress and error
+ * message.
+ */
+ break;
+ default:
+ /*
+ * Bad sideband, let's leave it to
+ * demultiplex_sideband() to catch this error.
+ */
+ break;
+ }
+ } else {
+ len--;
+ }
+ }
buffer[len] = 0;
if (options & PACKET_READ_REDACT_URI_PATH &&
@@ -580,17 +617,19 @@ void packet_reader_init(struct packet_reader *reader, int fd,
reader->options = options;
reader->me = "git";
reader->hash_algo = &hash_algos[GIT_HASH_SHA1];
+ strbuf_init(&reader->scratch, 0);
}
enum packet_read_status packet_reader_read(struct packet_reader *reader)
{
- struct strbuf scratch = STRBUF_INIT;
-
if (reader->line_peeked) {
reader->line_peeked = 0;
return reader->status;
}
+ if (reader->use_sideband)
+ reader->options |= PACKET_READ_USE_SIDEBAND;
+
/*
* Consume all progress packets until a primary payload packet is
* received
@@ -608,7 +647,7 @@ enum packet_read_status packet_reader_read(struct packet_reader *reader)
break;
if (demultiplex_sideband(reader->me, reader->status,
reader->buffer, reader->pktlen, 1,
- &scratch, &sideband_type))
+ &reader->scratch, &sideband_type))
break;
}
diff --git a/pkt-line.h b/pkt-line.h
index 1f623de..3b33cc6 100644
--- a/pkt-line.h
+++ b/pkt-line.h
@@ -1,9 +1,7 @@
#ifndef PKTLINE_H
#define PKTLINE_H
-#include "git-compat-util.h"
#include "strbuf.h"
-#include "sideband.h"
/*
* Write a packetized stream, where each line is preceded by
@@ -32,7 +30,13 @@ void packet_buf_write(struct strbuf *buf, const char *fmt, ...) __attribute__((f
int packet_flush_gently(int fd);
int packet_write_fmt_gently(int fd, const char *fmt, ...) __attribute__((format (printf, 2, 3)));
int write_packetized_from_fd_no_flush(int fd_in, int fd_out);
-int write_packetized_from_buf_no_flush(const char *src_in, size_t len, int fd_out);
+int write_packetized_from_buf_no_flush_count(const char *src_in, size_t len,
+ int fd_out, int *packet_counter);
+static inline int write_packetized_from_buf_no_flush(const char *src_in,
+ size_t len, int fd_out)
+{
+ return write_packetized_from_buf_no_flush_count(src_in, len, fd_out, NULL);
+}
/*
* Stdio versions of packet_write functions. When mixing these with fd
@@ -80,6 +84,7 @@ void packet_fflush(FILE *f);
#define PACKET_READ_DIE_ON_ERR_PACKET (1u<<2)
#define PACKET_READ_GENTLE_ON_READ_ERROR (1u<<3)
#define PACKET_READ_REDACT_URI_PATH (1u<<4)
+#define PACKET_READ_USE_SIDEBAND (1u<<5)
int packet_read(int fd, char *buffer, unsigned size, int options);
/*
@@ -89,7 +94,7 @@ int packet_read(int fd, char *buffer, unsigned size, int options);
* If lenbuf_hex contains non-hex characters, return -1. Otherwise, return the
* numeric value of the length header.
*/
-int packet_length(const char lenbuf_hex[4]);
+int packet_length(const char lenbuf_hex[4], size_t size);
/*
* Read a packetized line into a buffer like the 'packet_read()' function but
@@ -189,6 +194,9 @@ struct packet_reader {
/* hash algorithm in use */
const struct git_hash_algo *hash_algo;
+
+ /* hold temporary sideband message */
+ struct strbuf scratch;
};
/*
@@ -241,4 +249,6 @@ void packet_writer_error(struct packet_writer *writer, const char *fmt, ...);
void packet_writer_delim(struct packet_writer *writer);
void packet_writer_flush(struct packet_writer *writer);
+void packet_trace_identity(const char *prog);
+
#endif
diff --git a/po/README.md b/po/README.md
index 3e4f897..ec08aa2 100644
--- a/po/README.md
+++ b/po/README.md
@@ -412,7 +412,7 @@ There are some conventions that l10n contributors must follow:
- Do not use non-ASCII characters in the subject of a commit.
- The length of commit subject (first line of the commit log) should
- be less than 50 characters, and the length of other lines of the
+ be no more than 50 characters, and the length of other lines of the
commit log should be no more than 72 characters.
- Add "Signed-off-by" trailer to your commit log, like other commits
diff --git a/po/TEAMS b/po/TEAMS
index 5a63397..87df7c6 100644
--- a/po/TEAMS
+++ b/po/TEAMS
@@ -51,7 +51,7 @@ Repository: https://github.com/Arusekk/git-po
Leader: Arusekk <arek_koz@o2.pl>
Language: pt_PT (Portuguese - Portugal)
-Repository: https://codeberg.org/git-pt/Git-PO-pt_PT/
+Repository: https://gitlab.com/alexandre1985/git-pt/
Leader: Daniel Santos <dacs.git@brilhante.top>
Language: ru (Russian)
@@ -67,16 +67,22 @@ Language: tr (Turkish)
Repository: https://github.com/bitigchi/git-po/
Leader: Emir SARI <bitigchi@me.com>
+Language: uk (Ukrainian)
+Repository: https://github.com/arkid15r/git-ukrainian-l10n/
+Leader: Arkadii Yakovets <ark@cho.red>
+Members: Kateryna Golovanova <kate@kgthreads.com>
+
Language: vi (Vietnamese)
Repository: https://github.com/vnwildman/git/
Leader: Trần Ngá»c Quân <vnwildman AT gmail.com>
Members: Nguyá»…n Thái Ngá»c Duy <pclouds AT gmail.com>
Language: zh_CN (Simplified Chinese)
-Repository: https://github.com/fangyi-zhou/git-po/
-Leader: Fangyi Zhou <me AT fangyi.io>
+Repository: https://github.com/dyrone/git/
+Leader: Teng Long <dyroneteng AT gmail.com>
Members: Ray Chen <oldsharp AT gmail.com>
ä¾äº‘ <lilydjwg AT gmail.com>
+ Fangyi Zhou <me AT fangyi.io>
Jiang Xin <worldhello.net AT gmail.com>
Language: zh_TW (Traditional Chinese)
diff --git a/po/bg.po b/po/bg.po
index 934784f..6b95add 100644
--- a/po/bg.po
+++ b/po/bg.po
@@ -1,8 +1,7 @@
# Bulgarian translation of git po-file.
-# Copyright (C) 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Alexander Shopov <ash@kambanaria.org>.
+# Copyright (C) 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 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, 2016, 2017, 2018, 2019, 2020, 2021, 2022.
-#
+# Alexander Shopov <ash@kambanaria.org>, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024.
# ========================
# DICTIONARY TO MERGE IN GIT GUI
# ------------------------
@@ -64,6 +63,8 @@
# pathspec magic Ð¾Ð¿Ñ†Ð¸Ñ Ð·Ð° магичеÑки пътища
# bitmap index Ð¸Ð½Ð´ÐµÐºÑ Ð½Ð° база битови маÑки
# multi-pack bitmap многопакетната битова маÑка
+# ewah bitmap битова маÑка във формат EWAH
+# type bitmap битова маÑка на видовете
# mark маркер
# plumbing команди от ÑиÑтемно ниво
# porcelain команди от потребителÑко ниво
@@ -135,11 +136,13 @@
# island marks граници на групите
# reflog журнал на указателите
# hash контролна Ñума, изчиÑлÑване на контролна Ñума
-# fanout Ð¾Ñ‚ÐºÑŠÑ (разперване???)
+# fanout Ð¾Ñ‚ÐºÑŠÑ Ð·Ð° разпределÑне
# idx - index of pack file, 1 index per 1 packfile
# midx, multi-pack index - файл Ñ Ð¸Ð½Ð´ÐµÐºÑа за множеÑтво пакети
# overlay mode - припокриващ режим (при изтеглÑнe)
# incremental file нараÑтващ файл
+# commit-graph граф Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ
+# commit-graph chain верига на гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ
# split (commit-graphr) раздробен (граф Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ)
# clobber (a tag) презапиÑвам (етикет)
# blame извеждане на авторÑтво
@@ -165,6 +168,7 @@
# scheduler планиращ модул
# snapshot Ñнимка
# enlistment зачиÑлена директориÑ
+# remove enlistment отчиÑлÑвам директориÑ
# zealous merge заÑилено Ñливане
# unregister отчиÑлÑвам
# marked counting изброÑване
@@ -184,14 +188,53 @@
# traverse обхождам
# timestamp времево клеймо
# bare repository голо хранилище
+# resolve-undo отмÑна на разрешените подаваниÑ
+# resolve conflict коригирам конфликт
+# resolve reference уÑтановÑване на обекта, Ñочен от указателÑ, проÑледÑване на указателÑ
+# cannot resolve reference не може да Ñее открие към какво Ñочи указателÑÑ‚
+# maintenance задачи по поддръжка
+# GLE поÑледна грешка в нишката - от GetLatError: https://learn.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-getlasterror
+# lookup table таблица ÑÑŠÑ ÑъответÑтвиÑ
+# out of range извън диапазона
+# checksum Ñума за проверка
+# superproject обхващащ проект
+# scalar repo Ñкаларно хранилище
+# unclean завършвам работа/задача Ñ Ð³Ñ€ÐµÑˆÐºÐ°
+# cache tree кеш за обекти-дървета
+# gitattributes file файл Ñ Ð°Ñ‚Ñ€Ð¸Ð±ÑƒÑ‚Ð¸ на git
+# advertised обÑвен за наличен
+# superproject Ñвръхпроект
+# rev-index обратен Ð¸Ð½Ð´ÐµÐºÑ (reverse index)
+# dererging branches раздалечили Ñе клони
+# master/main branch оÑновен клон
+# unborn/orphan branch неродѐн клон (а не неÑъздаден) - клон без никакви подаваниÑ, включително и началното
+# parse анализ, анализирам
+# reinitialize repository занулÑване на хранилището и инициализиране
+# replay изпълнÑване/прилагане наново
+# BTMP chunk Ð¾Ñ‚ÐºÑŠÑ Ð·Ð° побитова маÑка
+# OID fanout chunk Ð¾Ñ‚ÐºÑŠÑ Ð·Ð° разпределÑнето
+# OID lookup chunk Ð¾Ñ‚ÐºÑŠÑ Ð·Ð° Ñ‚ÑŠÑ€Ñенето
+# autostash автоматично Ñкатано
+# symref файл Ñ ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ» (regular file that stores a string that begins with ref: refs/)
+#
+#
#
# ------------------------
# „$var“ - може да не Ñработва за shell има gettext и eval_gettext - проверка - намират Ñе леÑно по „$
# ------------------------
+# Ñ‚Ð°Ð±ÑƒÐ»Ð°Ñ†Ð¸Ñ Ð² началото на реда Ñе Ð·Ð°Ð¼ÐµÐ½Ñ Ñ Ñ‡ÐµÑ‚Ð¸Ñ€Ð¸ интервала
+# по подобен начин отÑтъпът на примерна команда е четири интервала
+# ------------------------
+#
# FIXME
-# HEAD as a reference vs head of a branch
-# git update-index -h извежда Ñамо един ред, а не цÑлата помощ за опциите
# git fetch --al работи подобно на --all
+#
+# ----
+#
+# TODO
+# ПричаÑтно-Ñтрадателни форми (бъде отворен) -> Възвратно-Ñтрадателни форми (Ñе отвори)
+# <ТЕРМИÐ> -> ТЕРМИÐ
+#
# ------------------------
# export PO_FILE=bg.po
# msgattrib --only-fuzzy $PO_FILE > todo1.po
@@ -199,13 +242,12 @@
# msgcat todo1.po todo2.po > todo.po
# grep '^#: ' todo.po | sed 's/^#: //' | tr ' ' '\n' | sed 's/:[0-9]*$//' > FILES
# 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.37\n"
+"Project-Id-Version: git 2.44\n"
"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2022-06-22 15:43+0200\n"
-"PO-Revision-Date: 2022-06-22 15:44+0200\n"
+"POT-Creation-Date: 2024-02-16 09:33+0100\n"
+"PO-Revision-Date: 2024-02-16 09:38+0100\n"
"Last-Translator: Alexander Shopov <ash@kambanaria.org>\n"
"Language-Team: Bulgarian <dict@fsa-bg.org>\n"
"Language: bg\n"
@@ -219,7 +261,7 @@ msgid "Huh (%s)?"
msgstr "ÐеуÑпешен анализ — „%s“."
msgid "could not read index"
-msgstr "индекÑÑŠÑ‚ не може да бъде прочетен"
+msgstr "индекÑÑŠÑ‚ не може да Ñе прочете"
msgid "binary"
msgstr "двоично"
@@ -238,15 +280,15 @@ msgid "could not stage '%s'"
msgstr "неуÑпешно добавÑне в индекÑа на „%s“"
msgid "could not write index"
-msgstr "индекÑÑŠÑ‚ не може да бъде запиÑан"
+msgstr "индекÑÑŠÑ‚ не може да Ñе запише"
-#, c-format, perl-format
+#, c-format
msgid "updated %d path\n"
msgid_plural "updated %d paths\n"
msgstr[0] "%d файл обновен\n"
msgstr[1] "%d файла обновени\n"
-#, c-format, perl-format
+#, c-format
msgid "note: %s is untracked now.\n"
msgstr "БЕЛЕЖКÐ: „%s“ вече не Ñе Ñледи.\n"
@@ -258,9 +300,9 @@ msgid "Revert"
msgstr "ОтмÑна"
msgid "Could not parse HEAD^{tree}"
-msgstr "УказателÑÑ‚ „HEAD^{tree}“ не може да бъде анализиран"
+msgstr "УказателÑÑ‚ „HEAD^{tree}“ не може да Ñе анализира"
-#, c-format, perl-format
+#, c-format
msgid "reverted %d path\n"
msgid_plural "reverted %d paths\n"
msgstr[0] "%d файл Ñ Ð¾Ñ‚Ð¼ÐµÐ½ÐµÐ½Ð¸ промѐни\n"
@@ -273,7 +315,7 @@ msgstr "ÐÑма неÑледени файлове.\n"
msgid "Add untracked"
msgstr "ДобавÑне на неÑледени"
-#, c-format, perl-format
+#, c-format
msgid "added %d path\n"
msgid_plural "added %d paths\n"
msgstr[0] "%d файл добавен\n"
@@ -361,26 +403,25 @@ msgid "path"
msgstr "път"
msgid "could not refresh index"
-msgstr "индекÑÑŠÑ‚ не може да бъде обновен"
+msgstr "индекÑÑŠÑ‚ не може да Ñе обнови"
-#
#, c-format
msgid "Bye.\n"
msgstr "Изход.\n"
-#, c-format, perl-format
+#, c-format
msgid "Stage mode change [y,n,q,a,d%s,?]? "
-msgstr "ДобавÑне на промÑната на правата за доÑтъп [y,n,q,a,d%s,?]? "
+msgstr "ДобавÑне на промÑната на права̀та за доÑтъп [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage deletion [y,n,q,a,d%s,?]? "
msgstr "ДобавÑне на изтриването [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage addition [y,n,q,a,d%s,?]? "
msgstr "ДобавÑне на добавÑнето [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage this hunk [y,n,q,a,d%s,?]? "
msgstr "ДобавÑне на това парче [y,n,q,a,d%s,?]? "
@@ -388,8 +429,8 @@ msgid ""
"If the patch applies cleanly, the edited hunk will immediately be marked for "
"staging."
msgstr ""
-"Ðко кръпката може да Ñе приложи чиÑто, редактираното парче ще бъде незабавно "
-"добавено към индекÑа."
+"Ðко кръпката може да Ñе приложи чиÑто, редактираното парче незабавно ще Ñе "
+"добави към индекÑа."
msgid ""
"y - stage this hunk\n"
@@ -404,19 +445,19 @@ msgstr ""
"a — добавÑне на това и вÑички Ñледващи парчета от файла в индекÑа\n"
"d — без добавÑне на това и вÑички Ñледващи парчета от файла в индекÑа\n"
-#, c-format, perl-format
+#, c-format
msgid "Stash mode change [y,n,q,a,d%s,?]? "
-msgstr "Скатаване на промÑната на правата за доÑтъп [y,n,q,a,d%s,?]? "
+msgstr "Скатаване на промÑната на права̀та за доÑтъп [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash deletion [y,n,q,a,d%s,?]? "
msgstr "Скатаване на изтриването [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash addition [y,n,q,a,d%s,?]? "
msgstr "Скатаване на добавÑнето [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash this hunk [y,n,q,a,d%s,?]? "
msgstr "Скатаване на това парче [y,n,q,a,d%s,?]? "
@@ -424,8 +465,8 @@ msgid ""
"If the patch applies cleanly, the edited hunk will immediately be marked for "
"stashing."
msgstr ""
-"Ðко кръпката може да Ñе приложи чиÑто, редактираното парче ще бъде незабавно "
-"Ñкътано."
+"Ðко кръпката може да Ñе приложи чиÑто, редактираното парче незабавно ще Ñе "
+"Ñкатае."
msgid ""
"y - stash this hunk\n"
@@ -440,19 +481,19 @@ msgstr ""
"a — Ñкатаване на това и вÑички Ñледващи парчета от файла\n"
"d — без Ñкатаване на това и вÑички Ñледващи парчета от файла\n"
-#, c-format, perl-format
+#, c-format
msgid "Unstage mode change [y,n,q,a,d%s,?]? "
-msgstr "Изваждане на промÑната на правата за доÑтъп [y,n,q,a,d%s,?]? "
+msgstr "Изваждане на промÑната на права̀та за доÑтъп [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage deletion [y,n,q,a,d%s,?]? "
msgstr "Изваждане на изтриването [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage addition [y,n,q,a,d%s,?]? "
msgstr "Изваждане на добавÑнето [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage this hunk [y,n,q,a,d%s,?]? "
msgstr "Изваждане на това парче [y,n,q,a,d%s,?]? "
@@ -460,8 +501,8 @@ msgid ""
"If the patch applies cleanly, the edited hunk will immediately be marked for "
"unstaging."
msgstr ""
-"Ðко кръпката може да Ñе приложи чиÑто, редактираното парче ще бъде незабавно "
-"извадено от индекÑа."
+"Ðко кръпката може да Ñе приложи чиÑто, редактираното парче незабавно ще Ñе "
+"извади от индекÑа."
msgid ""
"y - unstage this hunk\n"
@@ -476,20 +517,20 @@ msgstr ""
"a — изваждане на това и вÑички Ñледващи парчета от файла от индекÑа\n"
"d — без изваждане на това и вÑички Ñледващи парчета от файла от индекÑа\n"
-#, c-format, perl-format
+#, c-format
msgid "Apply mode change to index [y,n,q,a,d%s,?]? "
msgstr ""
-"Прилагане на промÑната на правата за доÑтъп към индекÑа [y,n,q,a,d%s,?]? "
+"Прилагане на промÑната на права̀та за доÑтъп към индекÑа [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply deletion to index [y,n,q,a,d%s,?]? "
msgstr "Прилагане на изтриването към индекÑа [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply addition to index [y,n,q,a,d%s,?]? "
msgstr "Прилагане на добавÑнето към индекÑа [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply this hunk to index [y,n,q,a,d%s,?]? "
msgstr "Прилагане на това парче към индекÑа [y,n,q,a,d%s,?]? "
@@ -497,8 +538,8 @@ msgid ""
"If the patch applies cleanly, the edited hunk will immediately be marked for "
"applying."
msgstr ""
-"Ðко кръпката може да Ñе приложи чиÑто, редактираното парче ще бъде незабавно "
-"набелÑзано за прилагане."
+"Ðко кръпката може да Ñе приложи чиÑто, редактираното парче незабавно ще Ñе "
+"набележи за прилагане."
msgid ""
"y - apply this hunk to index\n"
@@ -513,21 +554,21 @@ msgstr ""
"a — прилагане на това и вÑички Ñледващи парчета от файла към индекÑа\n"
"d — без прилагане на това и вÑички Ñледващи парчета от файла към индекÑа\n"
-#, c-format, perl-format
+#, 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, perl-format
+#, c-format
msgid "Discard deletion from worktree [y,n,q,a,d%s,?]? "
msgstr "Премахване на изтриването от работното дърво [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard addition from worktree [y,n,q,a,d%s,?]? "
msgstr "Премахване на добавÑнето от работното дърво [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard this hunk from worktree [y,n,q,a,d%s,?]? "
msgstr "Премахване на парчето от работното дърво [y,n,q,a,d%s,?]? "
@@ -535,8 +576,8 @@ msgid ""
"If the patch applies cleanly, the edited hunk will immediately be marked for "
"discarding."
msgstr ""
-"Ðко кръпката може да Ñе приложи чиÑто, редактираното парче ще бъде незабавно "
-"набелÑзано за занулÑване."
+"Ðко кръпката може да Ñе приложи чиÑто, редактираното парче незабавно ще Ñе "
+"набележи за занулÑване."
msgid ""
"y - discard this hunk from worktree\n"
@@ -554,23 +595,23 @@ msgstr ""
"d — без премахване на това и вÑички Ñледващи парчета от файла от работното "
"дърво\n"
-#, c-format, perl-format
+#, c-format
msgid "Discard mode change from index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
-"Премахване на промÑната в правата за доÑтъп от индекÑа и работното дърво [y,"
+"Премахване на промÑната в права̀та за доÑтъп от индекÑа и работното дърво [y,"
"n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard deletion from index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
"Премахване на изтриването от индекÑа и работното дърво [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard addition from index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
"Премахване на добавÑнето от индекÑа и работното дърво [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard this hunk from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Премахване на парчето от индекÑа и работното дърво [y,n,q,a,d%s,?]? "
@@ -590,22 +631,22 @@ msgstr ""
"d — без премахване на това и вÑички Ñледващи парчета от файла от индекÑа и "
"работното дърво\n"
-#, c-format, perl-format
+#, c-format
msgid "Apply mode change to index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
-"Прилагане на промÑната в правата за доÑтъп от индекÑа и работното дърво [y,n,"
+"Прилагане на промÑната в права̀та за доÑтъп от индекÑа и работното дърво [y,n,"
"q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply deletion to index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
"Прилагане на изтриването от индекÑа и работното дърво [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply addition to index and worktree [y,n,q,a,d%s,?]? "
msgstr "Прилагане на добавÑнето от индекÑа и работното дърво [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply this hunk to index and worktree [y,n,q,a,d%s,?]? "
msgstr "Прилагане на парчето от индекÑа и работното дърво [y,n,q,a,d%s,?]? "
@@ -625,6 +666,24 @@ msgstr ""
"d — без прилагане на това и вÑички Ñледващи парчета от файла от индекÑа и "
"работното дърво\n"
+#, c-format
+msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
+msgstr ""
+"Прилагане на промÑната в права̀та за доÑтъп към работното дърво [y,n,q,a,"
+"d%s,?]? "
+
+#, c-format
+msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
+msgstr "Прилагане на изтриването към работното дърво [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
+msgstr "Прилагане на добавÑнето към работното дърво [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
+msgstr "Прилагане на парчето към работното дърво [y,n,q,a,d%s,?]? "
+
msgid ""
"y - apply this hunk to worktree\n"
"n - do not apply this hunk to worktree\n"
@@ -642,10 +701,6 @@ msgstr ""
msgid "could not parse hunk header '%.*s'"
msgstr "заглавната чаÑÑ‚ на парчето „%.*s“ не може да Ñе анализира"
-#, c-format
-msgid "could not parse colored hunk header '%.*s'"
-msgstr "заглавната чаÑÑ‚ на оцветеното парче „%.*s“ не може да Ñе анализира"
-
msgid "could not parse diff"
msgstr "разликата не може да Ñе анализира"
@@ -700,17 +755,15 @@ msgstr ""
"За да пропуÑнете редовете, започващи Ñ â€ž%c“: заменете знака Ñ â€ž “ (Ñтават "
"контекÑÑ‚)\n"
"За да пропуÑнете редовете, започващи Ñ â€ž%c“: изтрийте ги.\n"
-"Редовете, които започват Ñ â€ž%c“ ще бъдат пропуÑнати.\n"
+"Редовете, които започват Ñ â€ž%c“ ще Ñе пропуÑнат.\n"
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: 'it' refers to the patch mentioned in the previous messages.
msgid ""
"If it does not apply cleanly, you will be given an opportunity to\n"
"edit again. If all lines of the hunk are removed, then the edit is\n"
"aborted and the hunk is left unchanged.\n"
msgstr ""
"Ðко е невъзможно чиÑто прилагане на кода, ще може пак да редактирате. Ðко\n"
-"изтриете вÑички редове от парчето код, то ще бъде оÑтавено непроменено, а\n"
+"изтриете вÑички редове от парчето код, то ще Ñе оÑтави непроменено, а\n"
"редактирането — отказано.\n"
msgid "could not parse hunk header"
@@ -719,20 +772,12 @@ msgstr "заглавната чаÑÑ‚ парчето не може да Ñе аÐ
msgid "'git apply --cached' failed"
msgstr "неуÑпешно изпълнение на „git apply --cached“"
-#. #-#-#-#-# add-patch.c.po #-#-#-#-#
#. TRANSLATORS: do not translate [y/n]
#. The program will only accept that input at this point.
#. Consider translating (saying "no" discards!) as
#. (saying "n" for "no" discards!) if the translation
#. of the word "no" does not start with n.
#.
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: do not translate [y/n]
-#. The program will only accept that input
-#. at this point.
-#. Consider translating (saying "no" discards!) as
-#. (saying "n" for "no" discards!) if the translation
-#. of the word "no" does not start with n.
msgid ""
"Your edited hunk does not apply. Edit again (saying \"no\" discards!) [y/n]? "
msgstr ""
@@ -809,14 +854,14 @@ msgid "No hunk matches the given pattern"
msgstr "Ðикое парче не напаÑва на регулÑÑ€Ð½Ð¸Ñ Ð¸Ð·Ñ€Ð°Ð·"
msgid "Sorry, cannot split this hunk"
-msgstr "Това парче не може да бъде разделено"
+msgstr "Това парче не може да Ñе раздели"
#, c-format
msgid "Split into %d hunks."
msgstr "РазделÑне на %d парчета."
msgid "Sorry, cannot edit this hunk"
-msgstr "Това парче не може да бъде редактирано"
+msgstr "Това парче не може да Ñе редактира"
msgid "'git apply' failed"
msgstr "неуÑпешно изпълнение на „git apply“"
@@ -850,9 +895,8 @@ msgstr "Издърпването е блокирано от неÑлети фаÐ
msgid "Reverting is not possible because you have unmerged files."
msgstr "ОтмÑната е блокирана от неÑлети файлове."
-#, c-format
-msgid "It is not possible to %s because you have unmerged files."
-msgstr "ДейÑтвието „%s“ е блокирано от неÑлети файлове."
+msgid "Rebasing is not possible because you have unmerged files."
+msgstr "Пребазирането е блокирано от неÑлети файлове."
msgid ""
"Fix them up in the work tree, and then use 'git add/rm <file>'\n"
@@ -873,6 +917,23 @@ msgstr "Промѐните Ñ‚Ñ€Ñбва да Ñе подадат преди Ñ
msgid "Exiting because of unfinished merge."
msgstr "Изход от програмата заради незавършено Ñливане."
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"Раздалечили Ñе клони не може да Ñе превъртÑÑ‚. Ползвайте:\n"
+"\n"
+" git merge --no-ff\n"
+"\n"
+"или:\n"
+"\n"
+" git rebase\n"
+
msgid "Not possible to fast-forward, aborting."
msgstr "Ðе може да Ñе извърши превъртане, преуÑтановÑване на дейÑтвието."
@@ -918,9 +979,8 @@ msgstr ""
"Бележка: преминаване към „%s“.\n"
"\n"
"УказателÑÑ‚ „HEAD“ не е Ñвързан. Може да разглеждате, да правите произволни\n"
-"промѐни и да ги подавате. Ðко изтеглите нещо друго, вÑички промѐни ще "
-"бъдат\n"
-"забравени и никой клон нÑма да Ñе промѐни.\n"
+"промѐни и да ги подавате. Ðко изтеглите нещо друго, вÑички промѐни ще Ñе\n"
+"забравÑÑ‚ и никой клон нÑма да Ñе промѐни.\n"
"\n"
"Ðко иÑкате да Ñъздадете нов клон, за да запазите подаваниÑта Ñи, може да\n"
"направите това като зададете име на клон към опциÑта „-c“ на командата\n"
@@ -936,12 +996,38 @@ msgstr ""
"detachedHead“\n"
"да е „false“ (лъжа̀).\n"
+#, c-format
+msgid ""
+"The following paths have been moved outside the\n"
+"sparse-checkout definition but are not sparse due to local\n"
+"modifications.\n"
+msgstr ""
+"Следните пътища Ñа премеÑтени извън дефинициите за чаÑтично\n"
+"изтеглÑне, но вече не Ñа чаÑтични заради локални промени.\n"
+
+msgid ""
+"To correct the sparsity of these paths, do the following:\n"
+"* Use \"git add --sparse <paths>\" to update the index\n"
+"* Use \"git sparse-checkout reapply\" to apply the sparsity rules"
+msgstr ""
+"Ðко иÑкате да ги обновите, пробвайте едно от Ñледните:\n"
+" ⃠обновете индекÑа Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð°Ñ‚Ð°:\n"
+"\n"
+" git add --sparse ПЪТ…\n"
+"\n"
+" ⃠приложете правилата за чаÑтичноÑÑ‚ Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð°Ñ‚Ð°:\n"
+"\n"
+" git sparse-checkout reapply"
+
msgid "cmdline ends with \\"
msgstr "командниÑÑ‚ ред завършва Ñ â€ž/“"
msgid "unclosed quote"
msgstr "кавичка без еш"
+msgid "too many arguments"
+msgstr "прекалено много аргументи"
+
#, c-format
msgid "unrecognized whitespace option '%s'"
msgstr "непозната Ð¾Ð¿Ñ†Ð¸Ñ Ð·Ð° знаците за интервали „%s“"
@@ -958,9 +1044,15 @@ msgstr "опциите „%s“ и „%s“ Ñа неÑъвмеÑтими"
msgid "'%s' outside a repository"
msgstr "„%s“ извън хранилище"
+msgid "failed to read patch"
+msgstr "кръпката не може да Ñе прочете"
+
+msgid "patch too large"
+msgstr "твърде голÑма кръпка"
+
#, c-format
msgid "Cannot prepare timestamp regexp %s"
-msgstr "РегулÑрниÑÑ‚ израз за времевото клеймо „%s“ не може за бъде компилиран"
+msgstr "РегулÑрниÑÑ‚ израз за времевото клеймо „%s“ не може да Ñе компилира "
#, c-format
msgid "regexec returned %d for input: %s"
@@ -1065,11 +1157,11 @@ msgstr "кръпката е Ñ Ð¸Ð·Ñ†Ñло повредени данни на Ñ
#, c-format
msgid "unable to read symlink %s"
-msgstr "Ñимволната връзка „%s“ не може да бъде прочетена"
+msgstr "Ñимволната връзка „%s“ не може да Ñе прочете"
#, c-format
msgid "unable to open or read %s"
-msgstr "файлът „%s“ не може да бъде отворен или прочетен"
+msgstr "файлът „%s“ не може да Ñе отвори или прочете"
#, c-format
msgid "invalid start of line: '%c'"
@@ -1122,12 +1214,11 @@ msgstr "кръпката ÑъответÑтва на „%s“, който Ñ‚Ñ€Ñ
#, c-format
msgid "the necessary postimage %s for '%s' cannot be read"
msgstr ""
-"необходимиÑÑ‚ резултат Ñлед операциÑта — „%s“ за „%s“ не може да бъде "
-"прочетен"
+"необходимиÑÑ‚ резултат Ñлед операциÑта — „%s“ за „%s“ не може да Ñе прочете"
#, c-format
msgid "binary patch does not apply to '%s'"
-msgstr "двоичната кръпка не може да бъде приложена върху „%s“"
+msgstr "двоичната кръпка не може да Ñе приложи върху „%s“"
#, c-format
msgid "binary patch to '%s' creates incorrect result (expecting %s, got %s)"
@@ -1145,7 +1236,7 @@ msgstr "„%s“ не може да Ñе изтегли"
#, c-format
msgid "failed to read %s"
-msgstr "файлът „%s“ не може да бъде прочетен"
+msgstr "файлът „%s“ не може да Ñе прочете"
#, c-format
msgid "reading from '%s' beyond a symbolic link"
@@ -1172,7 +1263,7 @@ msgstr "Тройно Ñливане…\n"
#, c-format
msgid "cannot read the current contents of '%s'"
-msgstr "текущото Ñъдържание на „%s“ не може да бъде прочетено"
+msgstr "текущото Ñъдържание на „%s“ не може да Ñе прочете"
#, c-format
msgid "Failed to perform three-way merge...\n"
@@ -1215,12 +1306,12 @@ msgstr "„%s“: вече ÑъщеÑтвува в работното дърво
#, c-format
msgid "new mode (%o) of %s does not match old mode (%o)"
-msgstr "новите права за доÑтъп (%o) на „%s“ не Ñъвпадат ÑÑŠÑ Ñтарите (%o)"
+msgstr "новите права̀ за доÑтъп (%o) на „%s“ не Ñъвпадат ÑÑŠÑ Ñтарите (%o)"
#, c-format
msgid "new mode (%o) of %s does not match old mode (%o) of %s"
msgstr ""
-"новите права за доÑтъп (%o) на „%s“ не Ñъвпадат ÑÑŠÑ Ñтарите (%o) на „%s“"
+"новите права̀ за доÑтъп (%o) на „%s“ не Ñъвпадат ÑÑŠÑ Ñтарите (%o) на „%s“"
#, c-format
msgid "affected file '%s' is beyond a symbolic link"
@@ -1228,7 +1319,7 @@ msgstr "заÑегнатиÑÑ‚ файл „%s“ е Ñлед Ñимволна в
#, c-format
msgid "%s: patch does not apply"
-msgstr "Кръпката „%s“ не може да бъде приложена"
+msgstr "Кръпката „%s“ не може да Ñе приложи"
#, c-format
msgid "Checking patch %s..."
@@ -1308,7 +1399,11 @@ msgstr "Ñъкращаване на името на файла Ñ Ð¾Ñ‚Ñ…Ð²ÑŠÑ€Ð»
#, c-format
msgid "cannot open %s"
-msgstr "„%s“ не може да бъде отворен"
+msgstr "„%s“ не може да Ñе отвори"
+
+#, c-format
+msgid "cannot unlink '%s'"
+msgstr "„%s“ не може да Ñе изтрие"
#, c-format
msgid "Hunk #%d applied cleanly."
@@ -1327,11 +1422,11 @@ msgstr ""
"Ðа входа нÑма непразни кръпки (те Ñе приемат при Ð¾Ð¿Ñ†Ð¸Ñ â€ž--allow-empty“)"
msgid "unable to read index file"
-msgstr "индекÑÑŠÑ‚ не може да бъде запиÑан"
+msgstr "индекÑÑŠÑ‚ не може да Ñе запише"
#, c-format
msgid "can't open patch '%s': %s"
-msgstr "кръпката „%s“ не може да бъде отворена: %s"
+msgstr "кръпката „%s“ не може да Ñе отвори: %s"
#, c-format
msgid "squelched %d whitespace error"
@@ -1354,7 +1449,7 @@ msgstr[1] ""
"Добавени Ñа %d реда Ñлед корекциÑта на грешките в знаците за интервали."
msgid "Unable to write new index file"
-msgstr "ÐовиÑÑ‚ Ð¸Ð½Ð´ÐµÐºÑ Ð½Ðµ може да бъде запиÑан"
+msgstr "ÐовиÑÑ‚ Ð¸Ð½Ð´ÐµÐºÑ Ð½Ðµ може да Ñе запише"
msgid "don't apply changes matching the given path"
msgstr "без прилагане на промѐните напаÑващи на Ð´Ð°Ð´ÐµÐ½Ð¸Ñ Ð¿ÑŠÑ‚"
@@ -1384,7 +1479,7 @@ msgid "instead of applying the patch, see if the patch is applicable"
msgstr "проверка дали кръпката може да Ñе приложи, без дейÑтвително прилагане"
msgid "make sure the patch is applicable to the current index"
-msgstr "проверка дали кръпката може да бъде приложена към Ñ‚ÐµÐºÑƒÑ‰Ð¸Ñ Ð¸Ð½Ð´ÐµÐºÑ"
+msgstr "проверка дали кръпката може да Ñе приложи към Ñ‚ÐµÐºÑƒÑ‰Ð¸Ñ Ð¸Ð½Ð´ÐµÐºÑ"
msgid "mark new files with `git add --intent-to-add`"
msgstr "отбелÑзване на новите файлове Ñ â€žgit add --intent-to-add“"
@@ -1397,8 +1492,7 @@ msgstr "прилагане на кръпка, коÑто Ð¿Ñ€Ð¾Ð¼ÐµÐ½Ñ Ð¸ фаÐ
msgid "also apply the patch (use with --stat/--summary/--check)"
msgstr ""
-"кръпката да бъде приложена. ОпциÑта Ñе комбинира Ñ â€ž--check“/„--stat“/„--"
-"summary“"
+"кръпката Ñе приложи. ОпциÑта Ñе комбинира Ñ â€ž--check“/„--stat“/„--summary“"
msgid "attempt three-way merge, fall back on normal patch if that fails"
msgstr ""
@@ -1454,18 +1548,22 @@ msgstr "да не Ñе връща грешка при празни кръпки"
#, c-format
msgid "cannot stream blob %s"
-msgstr "обектът-BLOB „%s“ не може да бъде обработен"
+msgstr "обектът-BLOB „%s“ не може да Ñе обработи"
#, c-format
msgid "unsupported file mode: 0%o (SHA1: %s)"
-msgstr "неподдържани права за доÑтъп до файл: 0%o (SHA1: %s)"
+msgstr "неподдържани права̀ за доÑтъп до файл: 0%o (SHA1: %s)"
+
+#, c-format
+msgid "deflate error (%d)"
+msgstr "грешка при декомпреÑиране Ñ â€ždeflate“ (%d)"
#, c-format
msgid "unable to start '%s' filter"
-msgstr "филтърът „%s“ не може да бъде Ñтартиран"
+msgstr "филтърът „%s“ не може да Ñе Ñтартира"
msgid "unable to redirect descriptor"
-msgstr "деÑкрипторът не може да бъде пренаÑочен"
+msgstr "деÑкрипторът не може да Ñе пренаÑочи"
#, c-format
msgid "'%s' filter reported error"
@@ -1480,10 +1578,6 @@ msgid "path too long (%d chars, SHA1: %s): %s"
msgstr "твърде дълъг път (%d знака, SHA1: %s): %s"
#, c-format
-msgid "deflate error (%d)"
-msgstr "грешка при декомпреÑиране Ñ â€ždeflate“ (%d)"
-
-#, c-format
msgid "timestamp too large for this system: %<PRIuMAX>"
msgstr "времевото клеймо е твърде голÑмо за тази ÑиÑтема: %<PRIuMAX>"
@@ -1501,7 +1595,11 @@ msgstr "git archive --remote ХРÐÐИЛИЩЕ [--exec КОМÐÐДÐ] --list"
#, c-format
msgid "cannot read '%s'"
-msgstr "файлът „%s“ не може да бъде прочетен"
+msgstr "файлът „%s“ не може да Ñе прочете"
+
+#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr "пътÑÑ‚ „%s“ Ñъвпада Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð²Ðµ извън текущата директориÑ"
#, c-format
msgid "pathspec '%s' did not match any files"
@@ -1519,9 +1617,6 @@ msgstr "неправилно име на обект: „%s“"
msgid "not a tree object: %s"
msgstr "не е обект-дърво: %s"
-msgid "current working directory is untracked"
-msgstr "текущата работна Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð½Ðµ е Ñледена"
-
#, c-format
msgid "File not found: %s"
msgstr "Файлът „%s“ липÑва"
@@ -1572,6 +1667,12 @@ msgstr "изчитане на „.gitattributes“ в работната дирÐ
msgid "report archived files on stderr"
msgstr "извеждане на архивираните файлове на Ñтандартната грешка"
+msgid "time"
+msgstr "ВРЕМЕ"
+
+msgid "set modification time of archive entries"
+msgstr "задаване на ВРЕМЕ на промÑна на елементите в архива"
+
msgid "set compression level"
msgstr "задаване на нивото на компреÑиране"
@@ -1601,6 +1702,10 @@ msgid "Unexpected option --output"
msgstr "Ðеочаквана Ð¾Ð¿Ñ†Ð¸Ñ â€ž--output“"
#, c-format
+msgid "extra command line parameter '%s'"
+msgstr "излишна Ð¾Ð¿Ñ†Ð¸Ñ Ð¸Ð»Ð¸ ÑтойноÑÑ‚ на ÐºÐ¾Ð¼Ð°Ð½Ð´Ð½Ð¸Ñ Ñ€ÐµÐ´: „%s“"
+
+#, c-format
msgid "Unknown archive format '%s'"
msgstr "Ðепознат формат на архив: „%s“"
@@ -1612,6 +1717,13 @@ msgstr "Ðргументът не Ñе поддържа за форма̀та â€
msgid "%.*s is not a valid attribute name"
msgstr "„%.*s“ е неправилно име за атрибут"
+msgid "unable to add additional attribute"
+msgstr "не може да Ñе добави нов атрибут"
+
+#, c-format
+msgid "ignoring overly long attributes line %d"
+msgstr "преÑкачане на прекалено дълъг ред за атрибути: %d"
+
#, c-format
msgid "%s not allowed: %s:%d"
msgstr "%s: командата не е позволена: „%s:%d“"
@@ -1624,6 +1736,31 @@ msgstr ""
"Ðко ви Ñ‚Ñ€Ñбва начална удивителна, ползвайте „\\!“."
#, c-format
+msgid "cannot fstat gitattributes file '%s'"
+msgstr "неуÑпешно изпълнение на „fstat“ върху файла за атрибути на git „%s“"
+
+#, c-format
+msgid "ignoring overly large gitattributes file '%s'"
+msgstr "преÑкачане на прекалено Ð³Ð¾Ð»ÐµÐ¼Ð¸Ñ Ñ„Ð°Ð¹Ð» за атрибути на git: „%s“"
+
+#, c-format
+msgid "ignoring overly large gitattributes blob '%s'"
+msgstr "преÑкачане на прекалено Ð³Ð¾Ð»ÐµÐ¼Ð¸Ñ Ð¾Ð±ÐµÐºÑ‚-BLOB за атрибути на git: „%s“"
+
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr ""
+"неправилна ÑтойноÑÑ‚ за опциÑта „--attr-source“ или променливата "
+"„GIT_ATTR_SOURCE“"
+
+#, c-format
+msgid "unable to stat '%s'"
+msgstr "„stat“ не може да Ñе изпълни върху „%s“"
+
+#, c-format
+msgid "unable to read %s"
+msgstr "обектът „%s“ не може да бъде прочетен"
+
+#, c-format
msgid "Badly quoted content in file '%s': %s"
msgstr "Ðеправилно цитирано Ñъдържание във файла „%s“: %s"
@@ -1675,7 +1812,7 @@ msgid ""
"So we cannot be sure the first %s commit is between %s and %s.\n"
"We continue anyway."
msgstr ""
-"базата за Ñливане между „%s“ и [%s] Ñ‚Ñ€Ñбва да бъде преÑкочена.\n"
+"базата за Ñливане между „%s“ и [%s] Ñ‚Ñ€Ñбва да Ñе преÑкочи.\n"
"Ðе може да Ñме Ñигурни, че първото %s подаване е между „%s“ и „%s“.\n"
"Двоичното Ñ‚ÑŠÑ€Ñене продължава."
@@ -1689,11 +1826,11 @@ msgstr "необходима е верÑÐ¸Ñ â€ž%s“"
#, c-format
msgid "could not create file '%s'"
-msgstr "файлът „%s“ не може да бъде Ñъздаден"
+msgstr "файлът „%s“ не може да Ñе Ñъздаде"
#, c-format
msgid "could not read file '%s'"
-msgstr "файлът „%s“ не може да бъде прочетен"
+msgstr "файлът „%s“ не може да Ñе прочете"
msgid "reading bisect refs failed"
msgstr "неуÑпешно прочитане на указателите за двоично Ñ‚ÑŠÑ€Ñене"
@@ -1728,9 +1865,6 @@ msgstr[1] "Двоично Ñ‚ÑŠÑ€Ñене: оÑтават %d верÑии ÑлеÐ
msgid "--contents and --reverse do not blend well."
msgstr "опциите „--contents“ и „--reverse“ Ñа неÑъвмеÑтими"
-msgid "cannot use --contents with final commit object name"
-msgstr "опциÑта „--contents“ е неÑъвмеÑтима Ñ Ð¸Ð¼Ðµ на обект от крайно подаване"
-
msgid "--reverse and --first-parent together require specified latest commit"
msgstr ""
"Едновременното задаване на опциите „--reverse“ и „--first-parent“ изиÑква "
@@ -1751,7 +1885,7 @@ msgstr "нÑма път на име „%s“ в „%s“"
#, c-format
msgid "cannot read blob %s for path %s"
-msgstr "обектът-BLOB „%s“ в Ð¿ÑŠÑ‚Ñ %s не може да бъде прочетен"
+msgstr "обектът-BLOB „%s“ в Ð¿ÑŠÑ‚Ñ %s не може да Ñе прочете"
msgid ""
"cannot inherit upstream tracking configuration of multiple refs when "
@@ -1778,7 +1912,7 @@ msgid "branch '%s' set up to track:"
msgstr "клонът „%s“ ще Ñледи:"
msgid "unable to write upstream branch configuration"
-msgstr "наÑтройките за ÑÐ»ÐµÐ´ÐµÐ½Ð¸Ñ ÐºÐ»Ð¾Ð½ не може да бъдат запиÑани"
+msgstr "наÑтройките за ÑÐ»ÐµÐ´ÐµÐ½Ð¸Ñ ÐºÐ»Ð¾Ð½ не може да Ñе запишат"
msgid ""
"\n"
@@ -1851,11 +1985,11 @@ msgstr "„%s“ не е позволено име за клон"
msgid "a branch named '%s' already exists"
msgstr "вече ÑъщеÑтвува клон Ñ Ð¸Ð¼Ðµ „%s“."
-# FIXME
#, c-format
-msgid "cannot force update the branch '%s' checked out at '%s'"
+msgid "cannot force update the branch '%s' used by worktree at '%s'"
msgstr ""
-"не може принудително да обновите клона „%s“, който е изтеглен в Ð¿ÑŠÑ‚Ñ â€ž%s“"
+"не може принудително да обновите клона „%s“, който Ñе ползва от работното "
+"дърво в „%s“"
#, c-format
msgid "cannot set up tracking information; starting point '%s' is not a branch"
@@ -1902,69 +2036,58 @@ msgstr "подмодул „%s“: подмодулът липÑва"
#, c-format
msgid ""
-"You may try updating the submodules using 'git checkout %s && git submodule "
-"update --init'"
+"You may try updating the submodules using 'git checkout --no-recurse-"
+"submodules %s && git submodule update --init'"
msgstr ""
"Може да обновите подмодулите Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð°Ñ‚Ð°:\n"
"\n"
-" git checkout %s && git submodule update --init"
+" git checkout --no-recurse-submodules %s && git submodule update --init"
#, c-format
msgid "submodule '%s': cannot create branch '%s'"
msgstr "подмодул „%s“: клонът „%s“ не може да Ñе Ñъздаде"
#, c-format
-msgid "'%s' is already checked out at '%s'"
-msgstr "„%s“ вече е изтеглен в „%s“"
-
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "УказателÑÑ‚ „HEAD“ на работното дърво „%s“ не е обновен"
+msgid "'%s' is already used by worktree at '%s'"
+msgstr "„%s“ вече Ñе ползва от работното дърво в „%s“"
msgid "git add [<options>] [--] <pathspec>..."
msgstr "git add [ОПЦИЯ…] [--] ПЪТ…"
#, c-format
msgid "cannot chmod %cx '%s'"
-msgstr "правата на „%2$s“ не може да Ñе зададат да Ñа %1$cx"
-
-#, c-format
-msgid "unexpected diff status %c"
-msgstr "неочакван изходен код при генериране на разлика: %c"
-
-msgid "updating files failed"
-msgstr "неуÑпешно обновÑване на файловете"
-
-#, c-format
-msgid "remove '%s'\n"
-msgstr "изтриване на „%s“\n"
+msgstr "права̀та на „%2$s“ не може да Ñе зададат да Ñа %1$cx"
msgid "Unstaged changes after refreshing the index:"
msgstr "Промѐни, които и Ñлед обновÑването на индекÑа не Ñа добавени към него:"
-msgid "Could not read the index"
-msgstr "ИндекÑÑŠÑ‚ не може да бъде прочетен"
+msgid ""
+"the add.interactive.useBuiltin setting has been removed!\n"
+"See its entry in 'git help config' for details."
+msgstr ""
+"ÐаÑтройката „add.interactive.useBuiltin“ е премахната!\n"
+"За подробноÑти Ñ Ð¿Ð¾Ñ‚ÑŠÑ€Ñете в изхода от „git help config“."
-msgid "Could not write patch"
-msgstr "Кръпката не може да бъде запиÑана"
+msgid "could not read the index"
+msgstr "индекÑÑŠÑ‚ не може да Ñе прочете"
msgid "editing patch failed"
msgstr "неуÑпешно редактиране на кръпка"
#, c-format
-msgid "Could not stat '%s'"
-msgstr "Ðе може да Ñе получи Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ñ‡Ñ€ÐµÐ· „stat“ за файла „%s“"
+msgid "could not stat '%s'"
+msgstr "неуÑпешно изпълнение на „stat“ върху „%s“"
-msgid "Empty patch. Aborted."
-msgstr "Празна кръпка, преуÑтановÑване на дейÑтвието."
+msgid "empty patch. aborted"
+msgstr "празна кръпка, преуÑтановÑване на дейÑтвието"
#, c-format
-msgid "Could not apply '%s'"
-msgstr "Кръпката „%s“ не може да бъде приложена"
+msgid "could not apply '%s'"
+msgstr "кръпката „%s“ не може да Ñе приложи"
msgid "The following paths are ignored by one of your .gitignore files:\n"
msgstr ""
-"Следните пътища ще бъдат игнорирани Ñпоред нÑкой от файловете „.gitignore“:\n"
+"Следните пътища ще Ñе игнорират Ñпоред нÑкой от файловете „.gitignore“:\n"
msgid "dry run"
msgstr "пробно изпълнение"
@@ -1991,7 +2114,7 @@ msgid "renormalize EOL of tracked files (implies -u)"
msgstr "уеднаквÑване на знаците за край на файл (включва опциÑта „-u“)"
msgid "record only the fact that the path will be added later"
-msgstr "отбелÑзване Ñамо на факта, че пътÑÑ‚ ще бъде добавен по-къÑно"
+msgstr "отбелÑзване Ñамо на факта, че пътÑÑ‚ ще Ñе добави по-къÑно"
msgid "add changes from all tracked and untracked files"
msgstr "добавÑне на вÑички промѐни в Ñледените и неÑледените файлове"
@@ -2005,7 +2128,7 @@ msgid "don't add, only refresh the index"
msgstr "без добавÑне на нови файлове, Ñамо обновÑване на индекÑа"
msgid "just skip files which cannot be added because of errors"
-msgstr "преÑкачане на файловете, които не може да бъдат добавени поради грешки"
+msgstr "преÑкачане на файловете, които не може да Ñе добавÑÑ‚ поради грешки"
msgid "check if - even missing - files are ignored in dry run"
msgstr ""
@@ -2094,6 +2217,9 @@ msgstr ""
msgid "index file corrupt"
msgstr "файлът Ñ Ð¸Ð½Ð´ÐµÐºÑа е повреден"
+msgid "unable to write new index file"
+msgstr "неуÑпешно запиÑване на Ð½Ð¾Ð²Ð¸Ñ Ð¸Ð½Ð´ÐµÐºÑ"
+
#, c-format
msgid "bad action '%s' for '%s'"
msgstr "неправилно дейÑтвие „%s“ за „%s“"
@@ -2104,7 +2230,7 @@ msgstr "неправилна ÑтойноÑÑ‚ за „%s“: „%s“"
#, c-format
msgid "could not read '%s'"
-msgstr "файлът „%s“ не може да бъде прочетен"
+msgstr "файлът „%s“ не може да Ñе прочете"
msgid "could not parse author script"
msgstr "Ñкриптът за автор не може да Ñе анализира"
@@ -2130,11 +2256,11 @@ msgstr "неуÑпешно изпълнение на „fseek“"
#, c-format
msgid "could not open '%s' for reading"
-msgstr "файлът не може да бъде прочетен: „%s“"
+msgstr "файлът не може да Ñе прочете: „%s“"
#, c-format
msgid "could not open '%s' for writing"
-msgstr "„%s“ не може да бъде отворен за запиÑ"
+msgstr "„%s“ не може да Ñе отвори за запиÑ"
#, c-format
msgid "could not parse patch '%s'"
@@ -2142,7 +2268,7 @@ msgstr "кръпката „%s“ не може да Ñе анализира"
msgid "Only one StGIT patch series can be applied at once"
msgstr ""
-"Само една поредица от кръпки от „StGIT“ може да бъде прилагана в даден момент"
+"Само една поредица от кръпки от „StGIT“ може да Ñе приложи в даден момент"
msgid "invalid timestamp"
msgstr "неправилна ÑтойноÑÑ‚ за времево клеймо"
@@ -2154,14 +2280,14 @@ msgid "invalid timezone offset"
msgstr "неправилно отмеÑтване на чаÑÐ¾Ð²Ð¸Ñ Ð¿Ð¾ÑÑ"
msgid "Patch format detection failed."
-msgstr "Форматът на кръпката не може да бъде определен."
+msgstr "Форматът на кръпката не може да Ñе определи."
#, c-format
msgid "failed to create directory '%s'"
-msgstr "директориÑта „%s“ не може да бъде Ñъздадена"
+msgstr "директориÑта „%s“ не може да Ñе Ñъздаде"
msgid "Failed to split patches."
-msgstr "Кръпките не може да бъдат разделени."
+msgstr "Кръпките не може да Ñе разделÑÑ‚."
#, c-format
msgid "When you have resolved this problem, run \"%s --continue\"."
@@ -2206,7 +2332,7 @@ msgstr "грешен ред Ñ Ð¸Ð´ÐµÐ½Ñ‚Ð¸Ñ‡Ð½Ð¾ÑÑ‚: %.*s"
#, c-format
msgid "unable to parse commit %s"
-msgstr "подаването не може да бъде анализирано: %s"
+msgstr "подаването не може да Ñе анализира: %s"
msgid "Repository lacks necessary blobs to fall back on 3-way merge."
msgstr ""
@@ -2236,7 +2362,7 @@ msgid "applying to an empty history"
msgstr "прилагане върху празна иÑториÑ"
msgid "failed to write commit object"
-msgstr "обектът за подаването не може да бъде запиÑан"
+msgstr "обектът за подаването не може да Ñе запише"
#, c-format
msgid "cannot resume: %s does not exist."
@@ -2256,12 +2382,11 @@ msgstr ""
"на вÑичко:"
msgid "unable to write index file"
-msgstr "индекÑÑŠÑ‚ не може да бъде запиÑан"
+msgstr "индекÑÑŠÑ‚ не може да Ñе запише"
#, c-format
msgid "Dirty index: cannot apply patches (dirty: %s)"
-msgstr ""
-"ИндекÑÑŠÑ‚ не е чиÑÑ‚: кръпките не може да бъдат приложени (замърÑени Ñа: %s)"
+msgstr "ИндекÑÑŠÑ‚ не е чиÑÑ‚: кръпките не може да Ñе приложат (замърÑени Ñа: %s)"
#, c-format
msgid "Skipping: %.*s"
@@ -2313,15 +2438,12 @@ msgstr ""
"След ÐºÐ¾Ñ€ÐµÐºÑ†Ð¸Ñ Ð½Ð° конфликтите изпълнете „git add“ върху поправените файлове.\n"
"За да приемете „изтрити от Ñ‚Ñх“, изпълнете „git rm“ върху изтритите файлове."
-msgid "unable to write new index file"
-msgstr "неуÑпешно запиÑване на Ð½Ð¾Ð²Ð¸Ñ Ð¸Ð½Ð´ÐµÐºÑ"
-
#, c-format
msgid "Could not parse object '%s'."
msgstr "„%s“ не е разпознат като обект."
msgid "failed to clean index"
-msgstr "индекÑÑŠÑ‚ не може да бъде изчиÑтен"
+msgstr "индекÑÑŠÑ‚ не може да Ñе изчиÑти"
msgid ""
"You seem to have moved HEAD since the last 'am' failure.\n"
@@ -2335,21 +2457,22 @@ msgstr ""
#, c-format
msgid "failed to read '%s'"
-msgstr "„%s“ не може да бъде прочетен"
-
-#, c-format
-msgid "options '%s=%s' and '%s=%s' cannot be used together"
-msgstr "опциите „%s=%s“ и „%s=%s“ Ñа неÑъвмеÑтими"
+msgstr "„%s“ не може да Ñе прочете"
msgid "git am [<options>] [(<mbox> | <Maildir>)...]"
msgstr "git am [ОПЦИЯ…] [(ФÐЙЛ_С_ПОЩÐ|ДИРЕКТОРИЯ_С_ПОЩÐ)…]"
msgid "git am [<options>] (--continue | --skip | --abort)"
-msgstr "git am [ОПЦИЯ…] (--continue | --skip | --abort)"
+msgstr "git am [ОПЦИЯ…] (--continue|--skip|--abort)"
msgid "run interactively"
msgstr "интерактивна работа"
+msgid "bypass pre-applypatch and applypatch-msg hooks"
+msgstr ""
+"без изпълнение на куките преди прилагане на кръпка и Ñъобщение преди "
+"прилагане на кръпка"
+
msgid "historical option -- no-op"
msgstr "изоÑтавена опциÑ, ÑъщеÑтвува по иÑторичеÑки причини, нищо не прави"
@@ -2378,11 +2501,6 @@ msgid "pass --keep-cr flag to git-mailsplit for mbox format"
msgstr ""
"подаване на опциÑта „--keep-cr“ на командата „git-mailsplit“ за формат „mbox“"
-msgid "do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"
-msgstr ""
-"без подаване на опциÑта „--keep-cr“ на командата „git-mailsplit“ незавиÑимо "
-"от „am.keepcr“"
-
msgid "strip everything before a scissors line"
msgstr "пропуÑкане на вÑичко преди реда за отрÑзване"
@@ -2480,7 +2598,7 @@ msgid "git apply [<options>] [<patch>...]"
msgstr "git apply [ОПЦИЯ…] [КРЪПКÐ…]"
msgid "could not redirect output"
-msgstr "изходът не може да бъде пренаÑочен"
+msgstr "изходът не може да Ñе пренаÑочи"
msgid "git archive: Remote with no URL"
msgstr "git archive: ЛипÑва Ð°Ð´Ñ€ÐµÑ Ð·Ð° отдалеченото хранилище"
@@ -2499,31 +2617,28 @@ msgstr "git archive: протоколна грешка"
msgid "git archive: expected a flush"
msgstr "git archive: очакваше Ñе изчиÑтване на буферите чрез „flush“"
-msgid "git bisect--helper --bisect-reset [<commit>]"
-msgstr "git bisect--helper --bisect-reset [ПОДÐÐ’ÐÐЕ]"
-
msgid ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<term> --term-{old,good}"
-"=<term>] [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] "
-"[<paths>...]"
+"git bisect start [--term-(new|bad)=<term> --term-(old|good)=<term>] [--no-"
+"checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]"
msgstr ""
-"git bisect--helper --bisect-start [--term-{new,bad}=ЛОШО --term-{old,good}"
-"=ДОБРО] [--no-checkout] [--first-parent] [ЛОШО [ДОБРО…]] [--] [ПЪТ…]"
+"git bisect start [--term-(new,bad)=УПРÐВЛЯВÐЩÐ_ДУМР--term-(old,"
+"good)=УПРÐВЛЯВÐЩÐ_ДУМÐ] [--no-checkout] [--first-parent] [ЛОШО [ДОБРО…]] "
+"[--] [ПЪТ…]"
-msgid "git bisect--helper --bisect-state (bad|new) [<rev>]"
-msgstr "git bisect--helper --bisect-state (ЛОШО) [ВЕРСИЯ]"
+msgid "git bisect (good|bad) [<rev>...]"
+msgstr "git bisect (good|bad) [ВЕРСИЯ…]"
-msgid "git bisect--helper --bisect-state (good|old) [<rev>...]"
-msgstr "git bisect--helper --bisect-state (ДОБРО) [ВЕРСИЯ…]"
+msgid "git bisect skip [(<rev>|<range>)...]"
+msgstr "git bisect skip [(ВЕРСИЯ|ДИÐПÐЗОÐ)…]"
-msgid "git bisect--helper --bisect-replay <filename>"
-msgstr "git bisect--helper --bisect-replay ИМЕ_ÐÐ_ФÐЙЛ"
+msgid "git bisect reset [<commit>]"
+msgstr "git bisect reset [ПОДÐÐ’ÐÐЕ]"
-msgid "git bisect--helper --bisect-skip [(<rev>|<range>)...]"
-msgstr "git bisect--helper --bisect-skip [(ВЕРСИЯ|ДИÐПÐЗОÐ)…]"
+msgid "git bisect replay <logfile>"
+msgstr "git bisect replay ИМЕ_ÐÐ_ФÐЙЛ"
-msgid "git bisect--helper --bisect-run <cmd>..."
-msgstr "git bisect--helper --bisect-run КОМÐÐДÐ…"
+msgid "git bisect run <cmd> [<arg>...]"
+msgstr "git bisect run КОМÐÐДÐ… [ÐРГУМЕÐТ…]"
#, c-format
msgid "cannot open file '%s' in mode '%s'"
@@ -2535,7 +2650,7 @@ msgstr "във файла „%s“ не може да Ñе пише"
#, c-format
msgid "cannot open file '%s' for reading"
-msgstr "файлът „%s“ не може да бъде отворен за четене"
+msgstr "файлът „%s“ не може да Ñе отвори за четене"
#, c-format
msgid "'%s' is not a valid term"
@@ -2564,8 +2679,8 @@ msgstr "„%s“ не е подаване"
msgid ""
"could not check out original HEAD '%s'. Try 'git bisect reset <commit>'."
msgstr ""
-"първоначално указаното „%s“ в ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ â€žHEAD“ не може да бъде\n"
-"изтеглено. Пробвайте да изпълните командата „git bisect reset ПОДÐÐ’ÐÐЕ“."
+"първоначално указаното „%s“ в ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ â€žHEAD“ не може да Ñе\n"
+"изтегли. Пробвайте да изпълните командата „git bisect reset ПОДÐÐ’ÐÐЕ“."
#, c-format
msgid "Bad bisect_write argument: %s"
@@ -2672,11 +2787,6 @@ msgstr ""
"ÐеуÑпешно преминаване към „%s“. Изпълнете командата „git bisect start "
"СЪЩЕСТВУВÐЩ_КЛОГ."
-msgid "won't bisect on cg-seek'ed tree"
-msgstr ""
-"не може да Ñе Ñ‚ÑŠÑ€Ñи двоично, когато е изпълнена командата „cg-seek“ от "
-"„cogito“"
-
msgid "bad HEAD - strange symbolic ref"
msgstr "Ðеправилен указател „HEAD“ — необичаен Ñимволен указател"
@@ -2732,7 +2842,7 @@ msgid "bisect run failed: no command provided."
msgstr "неуÑпешно двоично Ñ‚ÑŠÑ€Ñене, не е зададена команда."
#, c-format
-msgid "unable to verify '%s' on good revision"
+msgid "unable to verify %s on good revision"
msgstr "„%s“ не може да провери Ñ Ð´Ð¾Ð±Ñ€Ð° верÑиÑ"
#, c-format
@@ -2740,7 +2850,7 @@ msgid "bogus exit code %d for good revision"
msgstr "неправилен изходен код %d за добро подаване"
#, c-format
-msgid "bisect run failed: exit code %d from '%s' is < 0 or >= 128"
+msgid "bisect run failed: exit code %d from %s is < 0 or >= 128"
msgstr ""
"неуÑпешно двоично Ñ‚ÑŠÑ€Ñене: изходниÑÑ‚ код от командата „%2$s“ е %1$d — това е "
"извън интервала [0, 128)"
@@ -2752,76 +2862,48 @@ msgstr "файлът „%s“ не може да бъде отворен за з
msgid "bisect run cannot continue any more"
msgstr "двоичното Ñ‚ÑŠÑ€Ñене не може да продължи"
-#, c-format
msgid "bisect run success"
msgstr "уÑпешно двоично Ñ‚ÑŠÑ€Ñене"
-#, c-format
msgid "bisect found first bad commit"
msgstr "двоичното Ñ‚ÑŠÑ€Ñене откри първото лошо подаване"
#, c-format
-msgid ""
-"bisect run failed: 'git bisect--helper --bisect-state %s' exited with error "
-"code %d"
-msgstr ""
-"неуÑпешно двоично Ñ‚ÑŠÑ€Ñене: „git bisect--helper --bisect-state %s“ завърши Ñ "
-"код за грешка: %d"
-
-msgid "reset the bisection state"
-msgstr "изчиÑтване на ÑÑŠÑтоÑнието на двоичното Ñ‚ÑŠÑ€Ñене"
-
-msgid "check whether bad or good terms exist"
-msgstr "проверка дали ÑъщеÑтвуват одобрÑващи/отхвърлÑщи управлÑващи думи"
-
-msgid "print out the bisect terms"
-msgstr "извеждане на управлÑващите думи"
-
-msgid "start the bisect session"
-msgstr "начало на двоично Ñ‚ÑŠÑ€Ñене"
+msgid "bisect run failed: 'git bisect %s' exited with error code %d"
+msgstr "неуÑпешно двоично Ñ‚ÑŠÑ€Ñене: „git bisect %s“ завърши Ñ ÐºÐ¾Ð´ за грешка: %d"
-msgid "find the next bisection commit"
-msgstr "откриване на Ñледващото подаване при двоично Ñ‚ÑŠÑ€Ñене"
-
-msgid "mark the state of ref (or refs)"
-msgstr "задаване на ÑÑŠÑтоÑнието на указателÑ/ите"
-
-msgid "list the bisection steps so far"
-msgstr "извеждане на Ñтъпките на двоичното Ñ‚ÑŠÑ€Ñене доÑега"
-
-msgid "replay the bisection process from the given file"
-msgstr "наново изпълнение на двоичното Ñ‚ÑŠÑ€Ñене чрез Ð´Ð°Ð´ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»"
-
-msgid "skip some commits for checkout"
-msgstr "преÑкачане на нÑкои Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ Ð¿Ñ€Ð¸ изтеглÑне"
-
-msgid "visualize the bisection"
-msgstr "визуализиране на двоичното Ñ‚ÑŠÑ€Ñене"
-
-msgid "use <cmd>... to automatically bisect"
-msgstr "за автоматично двоично Ñ‚ÑŠÑ€Ñене да Ñе ползва тази КОМÐÐДÐ…"
+#, c-format
+msgid "'%s' requires either no argument or a commit"
+msgstr "„%s“ изиÑква или 0 аргументи, или едно подаване"
-msgid "no log for BISECT_WRITE"
-msgstr "липÑва Ð·Ð°Ð¿Ð¸Ñ Ð·Ð° „BISECT_WRITE“"
+#, c-format
+msgid "'%s' requires 0 or 1 argument"
+msgstr "„%s“ изиÑква 0 или 1 аргумент"
-msgid "--bisect-reset requires either no argument or a commit"
-msgstr "опциÑта „--bisect-reset“ изиÑква или 0 аргументи, или 1 — подаване"
+#, c-format
+msgid "'%s' requires 0 arguments"
+msgstr "„%s“ изиÑква 0 аргументи"
-msgid "--bisect-terms requires 0 or 1 argument"
-msgstr "опциÑта „--bisect-terms“ изиÑква 0 или 1 аргумента"
+msgid "no logfile given"
+msgstr "не е зададен журнален файл"
-msgid "--bisect-next requires 0 arguments"
-msgstr "опциÑта „--bisect-next“ не приема аргументи"
+#, c-format
+msgid "'%s' failed: no command provided."
+msgstr "неуÑпешно изпълнение на „%s“: не е зададена команда."
-msgid "--bisect-log requires 0 arguments"
-msgstr "опциÑта „--bisect-log“ не приема аргументи"
+msgid "need a command"
+msgstr "необходима е команда"
-msgid "no logfile given"
-msgstr "не е зададен журнален файл"
+#, c-format
+msgid "unknown command: '%s'"
+msgstr "непозната команда: „%s“"
msgid "git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"
msgstr "git blame [ОПЦИЯ…] [ОПЦИЯ_ЗÐ_ВЕРСИЯТÐ…] [ВЕРСИЯ] [--] ФÐЙЛ"
+msgid "git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"
+msgstr "git annotate [ОПЦИЯ…] [ОПЦИЯ_ЗÐ_ВЕРСИЯТÐ…] [ВЕРСИЯ] [--] ФÐЙЛ"
+
msgid "<rev-opts> are documented in git-rev-list(1)"
msgstr "ОПЦИИте_ЗÐ_ВЕРСИЯТРÑа документирани в ръководÑтвото git-rev-list(1)"
@@ -2969,7 +3051,7 @@ msgid "Blaming lines"
msgstr "Редове Ñ Ð°Ð²Ñ‚Ð¾Ñ€Ñтво"
msgid "git branch [<options>] [-r | -a] [--merged] [--no-merged]"
-msgstr "git branch [ОПЦИЯ…] [-r | -a] [--merged] [--no-merged]"
+msgstr "git branch [ОПЦИЯ…] [-r|-a] [--merged] [--no-merged]"
msgid ""
"git branch [<options>] [-f] [--recurse-submodules] <branch-name> [<start-"
@@ -2980,68 +3062,77 @@ msgid "git branch [<options>] [-l] [<pattern>...]"
msgstr "git branch [ОПЦИЯ…] [-l] [ШÐБЛОÐ…]"
msgid "git branch [<options>] [-r] (-d | -D) <branch-name>..."
-msgstr "git branch [ОПЦИЯ…] [-r] (-d | -D) ИМЕ_ÐÐ_КЛОÐ…"
+msgstr "git branch [ОПЦИЯ…] [-r] (-d|-D) ИМЕ_ÐÐ_КЛОÐ…"
msgid "git branch [<options>] (-m | -M) [<old-branch>] <new-branch>"
-msgstr "git branch [ОПЦИЯ…] (-m | -M) [СТÐР_КЛОÐ] ÐОВ_КЛОÐ"
+msgstr "git branch [ОПЦИЯ…] (-m|-M) [СТÐР_КЛОÐ] ÐОВ_КЛОÐ"
msgid "git branch [<options>] (-c | -C) [<old-branch>] <new-branch>"
-msgstr "git branch [ОПЦИЯ…] (-c | -C) [СТÐР_КЛОÐ] ÐОВ_КЛОÐ"
+msgstr "git branch [ОПЦИЯ…] (-c|-C) [СТÐР_КЛОÐ] ÐОВ_КЛОÐ"
msgid "git branch [<options>] [-r | -a] [--points-at]"
-msgstr "git branch [ОПЦИЯ…] [-r | -a] [--points-at]"
+msgstr "git branch [ОПЦИЯ…] [-r|-a] [--points-at]"
msgid "git branch [<options>] [-r | -a] [--format]"
-msgstr "git branch [ОПЦИЯ…] [-r | -a] [--format]"
+msgstr "git branch [ОПЦИЯ…] [-r|-a] [--format]"
#, c-format
msgid ""
"deleting branch '%s' that has been merged to\n"
-" '%s', but not yet merged to HEAD."
+" '%s', but not yet merged to HEAD"
msgstr ""
"изтриване на клона „%s“, който е ÑлÑÑ‚ към „%s“,\n"
-" но още не е ÑлÑÑ‚ към върха „HEAD“."
+" но още не е ÑлÑÑ‚ към върха „HEAD“"
#, c-format
msgid ""
"not deleting branch '%s' that is not yet merged to\n"
-" '%s', even though it is merged to HEAD."
+" '%s', even though it is merged to HEAD"
msgstr ""
"отказване на изтриване на клона „%s“, който не е ÑлÑÑ‚ към\n"
-" „%s“, но е ÑлÑÑ‚ към върха „HEAD“."
+" „%s“, но е ÑлÑÑ‚ към върха „HEAD“"
#, c-format
-msgid "Couldn't look up commit object for '%s'"
-msgstr "Обектът-подаване за „%s“ не може да бъде открит"
+msgid "couldn't look up commit object for '%s'"
+msgstr "обектът-подаване за „%s“ не може да Ñе открие"
#, c-format
-msgid ""
-"The branch '%s' is not fully merged.\n"
-"If you are sure you want to delete it, run 'git branch -D %s'."
+msgid "the branch '%s' is not fully merged"
+msgstr "клонът „%s“ не е ÑлÑÑ‚ напълно"
+
+#, c-format
+msgid "If you are sure you want to delete it, run 'git branch -D %s'"
msgstr ""
-"Клонът „%s“ не е ÑлÑÑ‚ напълно. Ðко Ñте Ñигурни, че иÑкате\n"
-"да го изтриете, изпълнете „git branch -D %s“."
+"Ðко Ñте Ñигурни, че иÑкате да го изтриете, изпълнете:\n"
+"\n"
+" git branch -D %s"
-msgid "Update of config-file failed"
-msgstr "ÐеуÑпешно обновÑване на ÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ð¾Ð½Ð½Ð¸Ñ Ñ„Ð°Ð¹Ð»"
+msgid "update of config-file failed"
+msgstr "неуÑпешно обновÑване на ÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ð¾Ð½Ð½Ð¸Ñ Ñ„Ð°Ð¹Ð»"
msgid "cannot use -a with -d"
msgstr "опциите „-a“ и „-d“ Ñа неÑъвмеÑтими"
-msgid "Couldn't look up commit object for HEAD"
-msgstr "Обектът-подаване, Ñочен от ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ â€žHEAD“, не може да бъде открит"
+#, c-format
+msgid "cannot delete branch '%s' used by worktree at '%s'"
+msgstr ""
+"не може да изтриете клона „%s“, който Ñе ползва от работното дърво в „%s“"
#, c-format
-msgid "Cannot delete branch '%s' checked out at '%s'"
-msgstr "Ðе може да изтриете клона „%s“, който е изтеглен в Ð¿ÑŠÑ‚Ñ â€ž%s“"
+msgid "remote-tracking branch '%s' not found"
+msgstr "ÑледÑщиÑÑ‚ клон „%s“ липÑва"
#, c-format
-msgid "remote-tracking branch '%s' not found."
-msgstr "ÑледÑщиÑÑ‚ клон „%s“ не може да бъде открит."
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"клонът „%s“ не може да бъде открит.\n"
+"Пробвахте ли опциÑта „--remote“?"
#, c-format
-msgid "branch '%s' not found."
-msgstr "клонът „%s“ не може да бъде открит."
+msgid "branch '%s' not found"
+msgstr "клонът „%s“ липÑва"
#, c-format
msgid "Deleted remote-tracking branch %s (was %s).\n"
@@ -3059,50 +3150,55 @@ msgstr "подаването, Ñочено от ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ â€žHEAD“, Ð
#, c-format
msgid "HEAD (%s) points outside of refs/heads/"
-msgstr "„HEAD“ (%s) Ñочи извън директориÑта „refs/heads“"
+msgstr "„HEAD“ (%s) Ñочи извън директориÑта „refs/heads/“"
#, c-format
-msgid "Branch %s is being rebased at %s"
-msgstr "Клонът „%s“ Ñе пребазира върху „%s“"
+msgid "branch %s is being rebased at %s"
+msgstr "клонът „%s“ Ñе пребазира върху „%s“"
#, c-format
-msgid "Branch %s is being bisected at %s"
-msgstr "ТърÑи Ñе двоично в клона „%s“ при „%s“"
+msgid "branch %s is being bisected at %s"
+msgstr "Ñ‚ÑŠÑ€Ñи Ñе двоично в клона „%s“ при „%s“"
-msgid "cannot copy the current branch while not on any."
-msgstr "не може да копирате Ñ‚ÐµÐºÑƒÑ‰Ð¸Ñ ÐºÐ»Ð¾Ð½, защото Ñте извън който и да е клон"
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "УказателÑÑ‚ „HEAD“ на работното дърво „%s“ не е обновен"
-msgid "cannot rename the current branch while not on any."
-msgstr ""
-"не може да преименувате Ñ‚ÐµÐºÑƒÑ‰Ð¸Ñ ÐºÐ»Ð¾Ð½, защото Ñте извън който и да е клон"
+#, c-format
+msgid "invalid branch name: '%s'"
+msgstr "неправилно име на клон: „%s“"
+
+#, c-format
+msgid "no commit on branch '%s' yet"
+msgstr "в клона „%s“ вÑе още нÑма подаваниÑ"
#, c-format
-msgid "Invalid branch name: '%s'"
-msgstr "Ðеправилно име на клон: „%s“"
+msgid "no branch named '%s'"
+msgstr "липÑва клон на име „%s“"
-msgid "Branch rename failed"
-msgstr "ÐеуÑпешно преименуване на клон"
+msgid "branch rename failed"
+msgstr "неуÑпешно преименуване на клон"
-msgid "Branch copy failed"
-msgstr "ÐеуÑпешно копиране на клон"
+msgid "branch copy failed"
+msgstr "неуÑпешно копиране на клон"
#, c-format
-msgid "Created a copy of a misnamed branch '%s'"
-msgstr "Клонът Ñ Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»Ð½Ð¾ име „%s“ е копиран"
+msgid "created a copy of a misnamed branch '%s'"
+msgstr "клонът Ñ Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»Ð½Ð¾ име „%s“ е копиран"
#, c-format
-msgid "Renamed a misnamed branch '%s' away"
-msgstr "Клонът Ñ Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»Ð½Ð¾ име „%s“ е преименуван"
+msgid "renamed a misnamed branch '%s' away"
+msgstr "клонът Ñ Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»Ð½Ð¾ име „%s“ е преименуван"
#, c-format
-msgid "Branch renamed to %s, but HEAD is not updated!"
-msgstr "Клонът е преименуван на „%s“, но указателÑÑ‚ „HEAD“ не е обновен"
+msgid "branch renamed to %s, but HEAD is not updated"
+msgstr "клонът е преименуван на „%s“, но указателÑÑ‚ „HEAD“ не е обновен"
-msgid "Branch is renamed, but update of config-file failed"
-msgstr "Клонът е преименуван, но конфигурационниÑÑ‚ файл не е обновен"
+msgid "branch is renamed, but update of config-file failed"
+msgstr "клонът е преименуван, но конфигурационниÑÑ‚ файл не е обновен"
-msgid "Branch is copied, but update of config-file failed"
-msgstr "Клонът е копиран, но конфигурационниÑÑ‚ файл не е обновен"
+msgid "branch is copied, but update of config-file failed"
+msgstr "клонът е копиран, но конфигурационниÑÑ‚ файл не е обновен"
#, c-format
msgid ""
@@ -3171,6 +3267,9 @@ msgstr ""
msgid "move/rename a branch, even if target exists"
msgstr "премеÑтване/преименуване на клон, дори ако има вече клон Ñ Ñ‚Ð°ÐºÐ¾Ð²Ð° име"
+msgid "do not output a newline after empty formatted refs"
+msgstr "без извеждане на нов ред Ñлед празен форматиран указател"
+
msgid "copy a branch and its reflog"
msgstr "копиране на клон и Ð¿Ñ€Ð¸Ð½Ð°Ð´Ð»ÐµÐ¶Ð°Ñ‰Ð¸Ñ Ð¼Ñƒ журнал на указателите"
@@ -3216,8 +3315,8 @@ msgstr "рекурÑивно обхождане подмодулите"
msgid "format to use for the output"
msgstr "ФОРМÐТ за изхода"
-msgid "Failed to resolve HEAD as a valid ref."
-msgstr "Ðе може да Ñе открие към какво Ñочи указателÑÑ‚ „HEAD“"
+msgid "failed to resolve HEAD as a valid ref"
+msgstr "указателÑÑ‚ „HEAD“ не Ñочи към обект"
msgid "HEAD not found below refs/heads!"
msgstr "Ð’ директориÑта „refs/heads“ липÑва файл „HEAD“"
@@ -3236,19 +3335,18 @@ msgstr ""
msgid "branch name required"
msgstr "Ðеобходимо е име на клон"
-msgid "Cannot give description to detached HEAD"
-msgstr "Ðе може да зададете опиÑание на неÑвързан „HEAD“"
+msgid "cannot give description to detached HEAD"
+msgstr "не може да зададете опиÑание на неÑвързан „HEAD“"
msgid "cannot edit description of more than one branch"
-msgstr "Ðе може да редактирате опиÑанието на повече от един клон едновременно"
+msgstr "не може да редактирате опиÑанието на повече от един клон едновременно"
-#, c-format
-msgid "No commit on branch '%s' yet."
-msgstr "Ð’ клона „%s“ вÑе още нÑма подаваниÑ."
+msgid "cannot copy the current branch while not on any"
+msgstr "не може да копирате Ñ‚ÐµÐºÑƒÑ‰Ð¸Ñ ÐºÐ»Ð¾Ð½, защото Ñте извън който и да е клон"
-#, c-format
-msgid "No branch named '%s'."
-msgstr "ЛипÑва клон на име „%s“."
+msgid "cannot rename the current branch while not on any"
+msgstr ""
+"не може да преименувате Ñ‚ÐµÐºÑƒÑ‰Ð¸Ñ ÐºÐ»Ð¾Ð½, защото Ñте извън който и да е клон"
msgid "too many branches for a copy operation"
msgstr "прекалено много клони за копиране"
@@ -3261,32 +3359,31 @@ msgstr "прекалено много аргументи към командат
#, c-format
msgid ""
-"could not set upstream of HEAD to %s when it does not point to any branch."
+"could not set upstream of HEAD to %s when it does not point to any branch"
msgstr ""
-"Следеното от „HEAD“ не може да Ñе зададе да е „%s“, защото то не Ñочи към "
-"никой клон."
+"Ñледеното от „HEAD“ не може да Ñе зададе да е „%s“, защото то не Ñочи към "
+"никой клон"
#, c-format
msgid "no such branch '%s'"
-msgstr "ÐÑма клон на име „%s“."
+msgstr "нÑма клон на име „%s“."
#, c-format
msgid "branch '%s' does not exist"
-msgstr "Ðе ÑъщеÑтвува клон на име „%s“."
+msgstr "не ÑъщеÑтвува клон на име „%s“."
msgid "too many arguments to unset upstream"
msgstr "прекалено много аргументи към командата за Ñпиране на Ñледене"
-msgid "could not unset upstream of HEAD when it does not point to any branch."
-msgstr ""
-"Следеното от „HEAD“ не може да махне, защото то не Ñочи към никой клон."
+msgid "could not unset upstream of HEAD when it does not point to any branch"
+msgstr "Ñледеното от „HEAD“ не може да махне, защото то не Ñочи към никой клон"
#, c-format
-msgid "Branch '%s' has no upstream information"
-msgstr "ÐÑма Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ ÐºÐ»Ð¾Ð½ÑŠÑ‚ „%s“ да Ñледи нÑкой друг"
+msgid "branch '%s' has no upstream information"
+msgstr "нÑма Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ ÐºÐ»Ð¾Ð½ÑŠÑ‚ „%s“ да Ñледи нÑкой друг"
msgid ""
-"The -a, and -r, options to 'git branch' do not take a branch name.\n"
+"the -a, and -r, options to 'git branch' do not take a branch name.\n"
"Did you mean to use: -a|-r --list <pattern>?"
msgstr ""
"опциите „-a“ и „-r“ на „git branch“ Ñа неÑъвмеÑтими Ñ Ð¸Ð¼Ðµ на клон.\n"
@@ -3294,7 +3391,7 @@ msgstr ""
msgid ""
"the '--set-upstream' option is no longer supported. Please use '--track' or "
-"'--set-upstream-to' instead."
+"'--set-upstream-to' instead"
msgstr ""
"опциÑта „--set-upstream“ вече не Ñе поддържа. Използвайте „--track“ или „--"
"set-upstream-to“"
@@ -3315,8 +3412,12 @@ msgstr "библиотека на C: "
msgid "not run from a git repository - no hooks to show\n"
msgstr "командата е Ñтартирана извън хранилище на Git, затова нÑма куки\n"
-msgid "git bugreport [-o|--output-directory <file>] [-s|--suffix <format>]"
-msgstr "git bugreport [-o|--output-directory ФÐЙЛ] [-s|--suffix ФОРМÐТ]"
+msgid ""
+"git bugreport [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--diagnose[=<mode>]]"
+msgstr ""
+"git bugreport [(-o|--output-directory) ПЪТ] [(-s|--suffix) ФОРМÐТ]\n"
+" [--diagnose[=РЕЖИМ]]"
msgid ""
"Thank you for filling out a Git bug report!\n"
@@ -3353,16 +3454,33 @@ msgstr ""
"Разгледайте оÑтаналата чаÑÑ‚ от доклада за грешка по-долу.\n"
"Може да изтриете редовете, които не иÑкате да Ñподелите.\n"
-msgid "specify a destination for the bugreport file"
-msgstr "укажете файла, в който да Ñе запази докладът за грешка"
+msgid "mode"
+msgstr "РЕЖИМ"
-msgid "specify a strftime format suffix for the filename"
-msgstr "укажете ÑуфикÑа на файла във формат за „strftime“"
+msgid ""
+"create an additional zip archive of detailed diagnostics (default 'stats')"
+msgstr ""
+"Ñъздаване на допълнителен архив във формат zip Ñ Ð¿Ð¾Ð´Ñ€Ð¾Ð±Ð½Ð¸ диагноÑтични "
+"ÑÑŠÐ¾Ð±Ñ‰ÐµÐ½Ð¸Ñ (Ñтандартно е „stats“ — ÑтатиÑтика)"
+
+msgid "specify a destination for the bugreport file(s)"
+msgstr "укажете меÑтоположение, в което да Ñе запазÑÑ‚ докладите за грешка"
+
+msgid "specify a strftime format suffix for the filename(s)"
+msgstr "укажете ÑуфикÑа на файловете във формат за „strftime“"
+
+#, c-format
+msgid "unknown argument `%s'"
+msgstr "непозната Ð¾Ð¿Ñ†Ð¸Ñ â€ž%s“"
#, c-format
msgid "could not create leading directories for '%s'"
msgstr "родителÑките директории на „%s“ не може да бъдат Ñъздадени"
+#, c-format
+msgid "unable to create diagnostics archive %s"
+msgstr "не може да Ñе Ñъздаде архив за диагноÑтичните ÑъобщениÑ: %s"
+
msgid "System Info"
msgstr "Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð·Ð° ÑиÑтемата"
@@ -3377,17 +3495,24 @@ msgstr "в „%s“ не може да Ñе пише"
msgid "Created new report at '%s'.\n"
msgstr "ÐовиÑÑ‚ доклад е Ñъздаден в „%s“.\n"
-msgid "git bundle create [<options>] <file> <git-rev-list args>"
-msgstr "git bundle create [ОПЦИЯ…] ФÐЙЛ ÐРГУМЕÐТ_ЗÐ_git_rev-list…"
+msgid ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<version>] <file> <git-rev-list-args>"
+msgstr ""
+"git bundle create [-q|--quiet|--progress ]\n"
+" [--version=ВЕРСИЯ] ФÐЙЛ ОПЦИЯ_ЗÐ_git-rev-list…"
-msgid "git bundle verify [<options>] <file>"
-msgstr "git bundle verify [ОПЦИЯ…] ФÐЙЛ…"
+msgid "git bundle verify [-q | --quiet] <file>"
+msgstr "git bundle verify [-q|--quiet] ФÐЙЛ"
msgid "git bundle list-heads <file> [<refname>...]"
msgstr "git bundle list-heads ФÐЙЛ [ИМЕ_ÐÐ_УКÐЗÐТЕЛ…]"
-msgid "git bundle unbundle <file> [<refname>...]"
-msgstr "git bundle unbundle ФÐЙЛ [ИМЕ_ÐÐ_УКÐЗÐТЕЛ…]"
+msgid "git bundle unbundle [--progress] <file> [<refname>...]"
+msgstr "git bundle unbundle [--progress] ФÐЙЛ [ИМЕ_ÐÐ_УКÐЗÐТЕЛ…]"
+
+msgid "need a <file> argument"
+msgstr "необходим е аргумент ФÐЙЛ"
msgid "do not show progress meter"
msgstr "без извеждане на напредъка"
@@ -3395,12 +3520,11 @@ msgstr "без извеждане на напредъка"
msgid "show progress meter"
msgstr "извеждане на напредъка"
-msgid "show progress meter during object writing phase"
-msgstr "извеждане на напредъка във фазата на запазване на обектите"
+msgid "historical; same as --progress"
+msgstr "изоÑтавена опциÑ, Ñъщото като „--progress“"
-msgid "similar to --all-progress when progress meter is shown"
-msgstr ""
-"Ñъщото дейÑтвие като опциÑта „--all-progress“ при извеждането на напредъка"
+msgid "historical; does nothing"
+msgstr "изоÑтавена опциÑ, нищо не прави"
msgid "specify bundle format version"
msgstr "верÑÐ¸Ñ Ð½Ð° пратката"
@@ -3422,10 +3546,6 @@ msgid "Unbundling objects"
msgstr "Разпакетиране на пратки от обекти"
#, c-format
-msgid "Unknown subcommand: %s"
-msgstr "Ðепозната подкоманда: %s"
-
-#, c-format
msgid "cannot read object %s '%s'"
msgstr "обектът „%s“ (%s) не може да бъде прочетен"
@@ -3447,10 +3567,6 @@ msgstr "командата „%s“ изиÑква аргумент"
msgid "%s takes no arguments"
msgstr "командата „%s“ не приема аргументи"
-#, c-format
-msgid "unknown command: '%s'"
-msgstr "непозната команда: „%s“"
-
msgid "only one batch option may be specified"
msgstr "може да укажете Ñамо една пакетна опциÑ"
@@ -3458,28 +3574,27 @@ msgid "git cat-file <type> <object>"
msgstr "git cat-file ВИД ОБЕКТ"
msgid "git cat-file (-e | -p) <object>"
-msgstr "git cat-file (-e | -p) ОБЕКТ"
+msgstr "git cat-file (-e|-p) ОБЕКТ"
msgid "git cat-file (-t | -s) [--allow-unknown-type] <object>"
-msgstr "git cat-file (-t | -s) [--allow-unknown-type] ОБЕКТ"
+msgstr "git cat-file (-t|-s) [--allow-unknown-type] ОБЕКТ"
msgid ""
-"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
-"objects]\n"
-" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
+"git cat-file (--textconv | --filters)\n"
+" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
msgstr ""
+"git cat-file (--textconv|--filters)\n"
+" [ВЕРСИЯ:ПЪТ|ДЪРВО|--path=ПЪТ|ДЪРВО ВЕРСИЯ]"
+
+msgid ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
-
-msgid ""
-"git cat-file (--textconv | --filters)\n"
-" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
+" [--textconv | --filters] [-Z]"
msgstr ""
-"git cat-file (--textconv | --filters)\n"
-" [ВЕРСИЯ:ПЪТ|ДЪРВО | --path=ПЪТ|ДЪРВО ВЕРСИЯ]"
+"git cat-file (--batch|--batch-check|--batch-command) [--batch-all-objects]\n"
+" [--buffer] [--follow-symlinks] [--unordered]\n"
+" [--textconv|--filters] [-Z]"
msgid "Check object existence or emit object contents"
msgstr "Проверка за ÑъщеÑтвуването на обекта или извеждане на Ñъдържанието му"
@@ -3504,6 +3619,11 @@ msgstr "извеждане на размера на обект"
msgid "allow -s and -t to work with broken/corrupt objects"
msgstr "позволÑване на опциите „-s“ и „-t“ да работÑÑ‚ Ñ Ð¿Ð¾Ð²Ñ€ÐµÐ´ÐµÐ½Ð¸ обекти"
+msgid "use mail map file"
+msgstr ""
+"използване на файл за ÑъответÑтвиÑта на имената и адреÑите на е-поща („."
+"mailmap“)"
+
msgid "Batch objects requested on stdin (or --batch-all-objects)"
msgstr ""
"Пакетно извеждане на заÑвените обекти на ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ Ð¸Ð·Ñ…Ð¾Ð´ (или „--batch-all-"
@@ -3515,6 +3635,12 @@ msgstr "извеждане на пълното Ñъдържание на ОБЕÐ
msgid "like --batch, but don't emit <contents>"
msgstr "като „--batch“, но без извеждане на Ñъдържанието"
+msgid "stdin is NUL-terminated"
+msgstr "ÑтандартниÑÑ‚ вход да ползва Ð½ÑƒÐ»ÐµÐ²Ð¸Ñ Ð·Ð½Ð°Ðº „NUL“ за разделител"
+
+msgid "stdin and stdout is NUL-terminated"
+msgstr "Ñтандартните вход и изход да ползват Ð½ÑƒÐ»ÐµÐ²Ð¸Ñ Ð·Ð½Ð°Ðº „NUL“ за разделител"
+
msgid "read commands from stdin"
msgstr "изчитане на командите от ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ Ð²Ñ…Ð¾Ð´"
@@ -3581,18 +3707,20 @@ msgstr "опциÑта „%s“ изиÑква верÑиÑ"
msgid "<object> required with '-%c'"
msgstr "опциÑта „-%c“ изиÑква обект"
-msgid "too many arguments"
-msgstr "прекалено много аргументи"
-
#, c-format
msgid "only two arguments allowed in <type> <object> mode, not %d"
msgstr "в режим Ñ Ð¿Ð¾Ñочен ВИД ОБЕКТ Ñе изиÑкват точно два аргумента, а не %d"
-msgid "git check-attr [-a | --all | <attr>...] [--] <pathname>..."
-msgstr "git check-attr [-a | --all | ÐТРИБУТ…] [--] ПЪТ…"
+msgid ""
+"git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] "
+"<pathname>..."
+msgstr ""
+"git check-attr [--source УКÐЗÐТЕЛ_КЪМ_ДЪРВО] [-a|--all|ÐТРИБУТ…] [--] ПЪТ…"
-msgid "git check-attr --stdin [-z] [-a | --all | <attr>...]"
-msgstr "git check-attr --stdin [-z] [-a | --all | ÐТРИБУТ…]"
+msgid ""
+"git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"
+msgstr ""
+"git check-attr --stdin [-z] [--source УКÐЗÐТЕЛ_КЪМ_ДЪРВО] [-a|--all|ÐТРИБУТ…]"
msgid "report all attributes set on file"
msgstr "извеждане на вÑички атрибути, зададени върху файл"
@@ -3606,6 +3734,12 @@ msgstr "изчитане на имената на файловете от Ñта
msgid "terminate input and output records by a NUL character"
msgstr "разделÑне на входните и изходните запиÑи Ñ Ð½ÑƒÐ»ÐµÐ²Ð¸Ñ Ð·Ð½Ð°Ðº „NUL“"
+msgid "<tree-ish>"
+msgstr "УКÐЗÐТЕЛ_КЪМ_ДЪРВО"
+
+msgid "which tree-ish to check attributes at"
+msgstr "към кой УКÐЗÐТЕЛ_КЪМ_ДЪРВО да Ñе премине"
+
msgid "suppress progress reporting"
msgstr "без показване на напредъка"
@@ -3766,6 +3900,10 @@ msgid "'%s' or '%s' cannot be used with %s"
msgstr "опциÑта „%3$s“ е неÑъвмеÑтима както Ñ â€ž%1$s“, така и Ñ â€ž%2$s“"
#, c-format
+msgid "'%s', '%s', or '%s' cannot be used when checking out of a tree"
+msgstr "„%s“, „%s“ и „%s“ Ñа неÑъвмеÑтими Ñ Ð¸Ð·Ñ‚ÐµÐ³Ð»Ñнето на дърво"
+
+#, c-format
msgid "path '%s' is unmerged"
msgstr "пътÑÑ‚ „%s“ не е ÑлÑÑ‚"
@@ -4024,8 +4162,8 @@ msgstr "принудително изтеглÑне (вашите промѐн
msgid "new-branch"
msgstr "ÐОВ_КЛОÐ"
-msgid "new unparented branch"
-msgstr "нов клон без родител"
+msgid "new unborn branch"
+msgstr "нов неродѐн клон"
msgid "update ignored files (default)"
msgstr "обновÑване на игнорираните файлове (Ñтандартно)"
@@ -4055,7 +4193,7 @@ msgstr "липÑва име на клон, използвайте опциÑта
#, c-format
msgid "could not resolve %s"
-msgstr "„%s“ не може да бъде открит"
+msgstr "„%s“ не може да бъде проÑледен"
msgid "invalid path specification"
msgstr "указан е неправилен път"
@@ -4128,8 +4266,9 @@ msgid "use overlay mode"
msgstr "използване на припокриващ режим"
msgid ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <paths>..."
-msgstr "git clean [-d] [-f] [-i] [-n] [-q] [-e ШÐБЛОÐ] [-x | -X] [--] ПЪТ…"
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] "
+"[<pathspec>...]"
+msgstr "git clean [-d] [-f] [-i] [-n] [-q] [-e ШÐБЛОÐ] [-x|-X] [--] [ПЪТ…]"
#, c-format
msgid "Removing %s\n"
@@ -4193,7 +4332,7 @@ msgstr ""
"* — избиране на вÑички обекти\n"
" — (празно) завършване на избирането\n"
-#, c-format, perl-format
+#, c-format
msgid "Huh (%s)?\n"
msgstr "Ðеправилен избор (%s).\n"
@@ -4277,9 +4416,6 @@ msgstr ""
"което изиÑква нÑÐºÐ¾Ñ Ð¾Ñ‚ опциите „-i“, „-n“ или „-f“. ÐÑма да Ñе извърши "
"изчиÑтване"
-msgid "-x and -X cannot be used together"
-msgstr "опциите „-x“ и „-X“ Ñа неÑъвмеÑтими"
-
msgid "git clone [<options>] [--] <repo> [<dir>]"
msgstr "git clone [ОПЦИЯ…] [--] ХРÐÐИЛИЩЕ [ДИРЕКТОРИЯ]"
@@ -4344,9 +4480,6 @@ msgstr "ДЪЛБОЧИÐÐ"
msgid "create a shallow clone of that depth"
msgstr "плитко клониране до тази ДЪЛБОЧИÐÐ"
-msgid "time"
-msgstr "ВРЕМЕ"
-
msgid "create a shallow clone since a specific time"
msgstr "плитко клониране до момент във времето"
@@ -4374,6 +4507,9 @@ msgstr "СЛУЖЕБÐÐ_ДИРЕКТОРИЯ"
msgid "separate git dir from working tree"
msgstr "отделна СЛУЖЕБÐÐ_ДИРЕКТОРИЯ за git извън работното дърво"
+msgid "specify the reference format to use"
+msgstr "указване на форма̀та за указател"
+
msgid "key=value"
msgstr "КЛЮЧ=СТОЙÐОСТ"
@@ -4386,12 +4522,6 @@ msgstr "Ñпецифични за Ñървъра"
msgid "option to transmit"
msgstr "Ð¾Ð¿Ñ†Ð¸Ñ Ð·Ð° преноÑ"
-msgid "use IPv4 addresses only"
-msgstr "Ñамо адреÑи IPv4"
-
-msgid "use IPv6 addresses only"
-msgstr "Ñамо адреÑи IPv6"
-
msgid "apply partial clone filters to submodules"
msgstr "прилагане на филтрите за непълно хранилище към подмодулите"
@@ -4403,6 +4533,13 @@ msgstr ""
"инициализиране на файла за чаÑтично изтеглÑне („.git/info/sparse-checkout“) "
"да Ñъдържа Ñамо файловете в оÑновната директориÑ"
+msgid "uri"
+msgstr "ÐДРЕС"
+
+msgid "a URI for downloading bundles before fetching from origin remote"
+msgstr ""
+"ÐДРЕС за доÑтавÑне на пратки на git преди доÑтавÑне от отдалеченото хранилище"
+
#, c-format
msgid "info: Could not add alternate for '%s': %s\n"
msgstr ""
@@ -4417,10 +4554,19 @@ msgid "%s exists and is not a directory"
msgstr "„%s“ ÑъщеÑтвува и не е директориÑ"
#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "„%s“ е Ñимволна връзка, не може да Ñе клонира Ñ Ð¾Ð¿Ñ†Ð¸Ñта „--local“"
+
+#, c-format
msgid "failed to start iterator over '%s'"
msgstr "неуÑпешно итериране по „%s“"
#, c-format
+msgid "symlink '%s' exists, refusing to clone with --local"
+msgstr ""
+"Ñимволната връзка „%s“ ÑъщеÑтвува, не може да Ñе клонира Ñ Ð¾Ð¿Ñ†Ð¸Ñта „--local“"
+
+#, c-format
msgid "failed to unlink '%s'"
msgstr "неуÑпешно изтриване на „%s“"
@@ -4468,10 +4614,10 @@ msgstr "обектът „%s“ не може да бъде обновен"
msgid "failed to initialize sparse-checkout"
msgstr "чаÑтичното изтеглÑне не може да Ñе инициализира"
-msgid "remote HEAD refers to nonexistent ref, unable to checkout.\n"
+msgid "remote HEAD refers to nonexistent ref, unable to checkout"
msgstr ""
-"указателÑÑ‚ „HEAD“ от отдалеченото хранилище Ñочи към нещо,\n"
-"което не ÑъщеÑтвува. Ðе може да Ñе изтегли определен клон.\n"
+"указателÑÑ‚ „HEAD“ от отдалеченото хранилище Ñочи към нещо, което не "
+"ÑъщеÑтвува. ИзтеглÑне не може да Ñе извърши"
msgid "unable to checkout working tree"
msgstr "работното дърво не може да бъде подготвено"
@@ -4492,8 +4638,8 @@ msgid "You must specify a repository to clone."
msgstr "ТрÑбва да укажете кое хранилище иÑкате да клонирате."
#, c-format
-msgid "options '%s' and '%s %s' cannot be used together"
-msgstr "опциите „%s“ и „%s %s“ Ñа неÑъвмеÑтими"
+msgid "unknown ref storage format '%s'"
+msgstr "непознат формат на Ñъхранение: „%s“"
#, c-format
msgid "repository '%s' does not exist"
@@ -4574,6 +4720,17 @@ msgstr "опциÑта „--local“ Ñе преÑкача"
msgid "cannot clone from filtered bundle"
msgstr "не може да Ñе клонира от филтрирана пратка"
+msgid "failed to initialize the repo, skipping bundle URI"
+msgstr ""
+"хранилището не може да Ñе инициализира, адреÑÑŠÑ‚ на пратката Ñе преÑкача"
+
+#, c-format
+msgid "failed to fetch objects from bundle URI '%s'"
+msgstr "неуÑпешно доÑтавÑне на обекти от пратка на Ð°Ð´Ñ€ÐµÑ â€ž%s“"
+
+msgid "failed to fetch advertised bundles"
+msgstr "неуÑпешно доÑтавÑне на обÑвените за налични пратки"
+
msgid "remote transport reported error"
msgstr "отдалечениÑÑ‚ транÑпорт върна грешка"
@@ -4609,19 +4766,25 @@ msgid "--command must be the first argument"
msgstr "опциÑта „--command“ Ñ‚Ñ€Ñбва да е първиÑÑ‚ аргумент"
msgid ""
-"git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]"
+"git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]"
msgstr ""
-"git commit-graph verify [--object-dir ДИР_ОБЕКТИ] [--shallow] [--"
+"git commit-graph verify [--object-dir ДИРЕКТОРИЯ] [--shallow] [--"
"[no-]progress]"
msgid ""
-"git commit-graph write [--object-dir <objdir>] [--append] [--"
-"split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <n>] [--[no-]progress] <split options>"
+"git commit-graph write [--object-dir <dir>] [--append]\n"
+" [--split[=<strategy>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <split-options>"
msgstr ""
-"git commit-graph write [--object-dir ДИР_ОБЕКТИ] [--append] [--"
-"split[=СТРÐТЕГИЯ]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <n>] [--[no-]progress] ОПЦИИ_ЗÐ_РÐЗДЕЛЯÐЕ"
+"git commit-graph write [--object-dir ДИРЕКТОРИЯ] [--append]\n"
+" [--split[=СТРÐТЕГИЯ]] [--reachable|--stdin-packs|--"
+"stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters БРОЙ] [--"
+"[no-]progress]\n"
+" ОПЦИИ_ЗÐ_РÐЗДЕЛЯÐЕ"
msgid "dir"
msgstr "директориÑ"
@@ -4631,13 +4794,17 @@ msgstr "ДИРекториÑта_Ñ_ОБЕКТИ за запазване на г
msgid "if the commit-graph is split, only verify the tip file"
msgstr ""
-"ако гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта е раздробен, да Ñе проверÑва Ñамо файлът на върха"
+"ако графът Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта е раздробен, да Ñе проверÑва Ñамо файлът на върха"
#, c-format
msgid "Could not open commit-graph '%s'"
msgstr "Графът Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта не може да Ñе отвори: „%s“"
#, c-format
+msgid "could not open commit-graph chain '%s'"
+msgstr "веригата на гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта не може да Ñе отвори: „%s“"
+
+#, c-format
msgid "unrecognized --split argument, %s"
msgstr "непознат аргумент към „--split“: %s"
@@ -4694,16 +4861,16 @@ msgstr ""
msgid "Collecting commits from input"
msgstr "Получаване на подаваниÑта от входа"
-#, c-format
-msgid "unrecognized subcommand: %s"
-msgstr "непозната подкоманда: %s"
+msgid "git commit-tree <tree> [(-p <parent>)...]"
+msgstr "git commit-tree ДЪРВО [(-p РОДИТЕЛ)…]"
msgid ""
-"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...] [(-F "
-"<file>)...] <tree>"
+"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]\n"
+" [(-F <file>)...] <tree>"
msgstr ""
-"git commit-tree [(-p РОДИТЕЛ)…] [-S[ИДЕÐТИФИКÐТОР]] [(-m СЪОБЩЕÐИЕ)…] [(-F "
-"ФÐЙЛ)…] ДЪРВО"
+"git commit-tree [(-p РОДИТЕЛ)…] [-S[ИДЕÐТИФИКÐТОР_ÐÐ_КЛЮЧ]] [(-m "
+"СЪОБЩЕÐИЕ)…]\n"
+" [(-F ФÐЙЛ)…] ДЪРВО"
#, c-format
msgid "duplicate parent %s ignored"
@@ -4745,11 +4912,30 @@ msgstr "Ñ‚Ñ€Ñбва да е точно едно дърво"
msgid "git commit-tree: failed to read"
msgstr "git commit-tree: не може да Ñе прочете"
-msgid "git commit [<options>] [--] <pathspec>..."
-msgstr "git commit [ОПЦИЯ…] [--] ПЪТ…"
+msgid ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|"
+"reword):]<commit>)]\n"
+" [-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n"
+" [--date=<date>] [--cleanup=<mode>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git commit [-a|--interactive|--patch] [-s] [-v] [-u РЕЖИМ] [--amend]\n"
+" [--dry-run] [(-c|-C|--squash) ПОДÐÐ’ÐÐЕ |--fixup [(amend|"
+"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[ИДЕÐТИФИКÐТОР_ÐÐ_КЛЮЧ]]\n"
+" [--] [ПЪТ…]"
-msgid "git status [<options>] [--] <pathspec>..."
-msgstr "git status [ОПЦИЯ…] [--] ПЪТ…"
+msgid "git status [<options>] [--] [<pathspec>...]"
+msgstr "git status [ОПЦИЯ…] [--] [ПЪТ…]"
msgid ""
"You asked to amend the most recent commit, but doing so would make\n"
@@ -4809,6 +4995,9 @@ msgstr ""
" git cherry-pick --skip\n"
"\n"
+msgid "updating files failed"
+msgstr "неуÑпешно обновÑване на файловете"
+
msgid "failed to unpack HEAD tree object"
msgstr "върховото дърво (HEAD tree object) не може да бъде извадено от пакет"
@@ -4825,10 +5014,7 @@ msgid "unable to update temporary index"
msgstr "временниÑÑ‚ Ð¸Ð½Ð´ÐµÐºÑ Ð½Ðµ може да бъде обновен"
msgid "Failed to update main cache tree"
-msgstr "Дървото на оÑÐ½Ð¾Ð²Ð½Ð¸Ñ ÐºÐµÑˆ не може да бъде обновено"
-
-msgid "unable to write new_index file"
-msgstr "новиÑÑ‚ Ð¸Ð½Ð´ÐµÐºÑ (new_index) не може да бъде запиÑан"
+msgstr "Кешът за обектите-дървета не може да бъде обновен"
msgid "cannot do a partial commit during a merge."
msgstr "по време на Ñливане не може да Ñе извърши чаÑтично подаване."
@@ -4868,7 +5054,7 @@ msgstr ""
"използвани вÑички подобни знаци"
#, c-format
-msgid "could not lookup commit %s"
+msgid "could not lookup commit '%s'"
msgstr "Ñледното подаване не може да бъде открито: %s"
#, c-format
@@ -5066,9 +5252,6 @@ msgstr "подробна Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð·Ð° ÑÑŠÑтоÑнието (ÑÑ‚Ð
msgid "terminate entries with NUL"
msgstr "разделÑне на елементите Ñ Ð½ÑƒÐ»ÐµÐ²Ð¸Ñ Ð·Ð½Ð°Ðº „NUL“"
-msgid "mode"
-msgstr "РЕЖИМ"
-
msgid "show untracked files, optional modes: all, normal, no. (Default: all)"
msgstr ""
"извеждане на неÑледените файлове. Възможните РЕЖИМи Ñа „all“ (подробна "
@@ -5244,12 +5427,12 @@ msgstr "Ðеизвършване на подаване поради празно
msgid ""
"repository has been updated, but unable to write\n"
-"new_index file. Check that disk is not full and quota is\n"
+"new index file. Check that disk is not full and quota is\n"
"not exceeded, and then \"git restore --staged :/\" to recover."
msgstr ""
-"хранилището е обновено, но новиÑÑ‚ файл за Ð¸Ð½Ð´ÐµÐºÑ â€žnew_index“\n"
-"не е запиÑан. Проверете дали диÑкът не е препълнен или не Ñте\n"
-"превишили диÑковата Ñи квота. За възÑтановÑване изпълнете:\n"
+"хранилището е обновено, но новиÑÑ‚ файл за Ð¸Ð½Ð´ÐµÐºÑ Ð½Ðµ е запиÑан.\n"
+"Проверете дали диÑкът не е препълнен или не Ñте превишили\n"
+"диÑковата Ñи квота. За възÑтановÑване изпълнете:\n"
"\n"
" git restore --staged :/"
@@ -5533,7 +5716,7 @@ msgid ""
"\n"
"\tchmod 0700 %s"
msgstr ""
-"Правата за доÑтъп до директориÑта за програмните гнезда Ñа прекалено "
+"Права̀та за доÑтъп до директориÑта за програмните гнезда Ñа прекалено "
"Ñвободни —\n"
"другите потребители може да получат доÑтъп до кешираните ви пароли. За да\n"
"коригирате това, изпълнете:\n"
@@ -5558,11 +5741,19 @@ msgstr ""
"ключалката на хранилището на идентификациите не бе получена в рамките на %d "
"ms"
-msgid "git describe [<options>] [<commit-ish>...]"
-msgstr "git describe [ОПЦИЯ…] [УКÐЗÐТЕЛ_КЪМ_ПОДÐÐ’ÐÐЕ…]"
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=БРОЙ] "
+"[УКÐЗÐТЕЛ_КЪМ_ПОДÐÐ’ÐÐЕ…]"
+
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=БРОЙ] --dirty[=ÐœÐРКЕР]"
-msgid "git describe [<options>] --dirty"
-msgstr "git describe [ОПЦИЯ…] --dirty"
+msgid "git describe <blob>"
+msgstr "git describe обект-BLOB"
msgid "head"
msgstr "оÑновно"
@@ -5685,6 +5876,22 @@ msgstr "Ðе Ñа открити имена — нищо не може да бъ
msgid "option '%s' and commit-ishes cannot be used together"
msgstr "опциите „%s“ и указателите към обекти Ñа неÑъвмеÑтими"
+msgid ""
+"git diagnose [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--mode=<mode>]"
+msgstr ""
+"git diagnose [(-o|--output-directory) ПЪТ] [(-s|--suffix) ФОРМÐТ]\n"
+" [--diagnose[=РЕЖИМ]]"
+
+msgid "specify a destination for the diagnostics archive"
+msgstr "укажете меÑтоположение на архива Ñ Ð´Ð¸Ð°Ð³Ð½Ð¾Ñтичната информациÑ"
+
+msgid "specify a strftime format suffix for the filename"
+msgstr "укажете ÑуфикÑа на файла във формат за „strftime“"
+
+msgid "specify the content of the diagnostic archive"
+msgstr "указване на Ñъдържанието на диагноÑÑ‚Ð¸Ñ‡Ð½Ð¸Ñ Ð°Ñ€Ñ…Ð¸Ð²"
+
msgid "--merge-base only works with two commits"
msgstr "опциÑта „--merge-base“ изиÑква точно две подаваниÑ"
@@ -5692,6 +5899,9 @@ msgstr "опциÑта „--merge-base“ изиÑква точно две поÐ
msgid "'%s': not a regular file or symlink"
msgstr "„%s“: не е нито обикновен файл, нито Ñимволна връзка"
+msgid "no merge given, only parents."
+msgstr "липÑва Ñливане, зададени Ñа Ñамо родителÑки подаваниÑ."
+
#, c-format
msgid "invalid option: %s"
msgstr "неправилна опциÑ: %s"
@@ -5808,29 +6018,6 @@ msgstr "не е зададена програма за „--tool=ПРОГРÐÐœÐ
msgid "no <cmd> given for --extcmd=<cmd>"
msgstr "не е зададена команда за „--extcmd=КОМÐÐДГ"
-msgid "git env--helper --type=[bool|ulong] <options> <env-var>"
-msgstr "git env--helper --type=[bool|ulong] ОПЦИИ ПРОМЕÐЛИВИ"
-
-msgid "default for git_env_*(...) to fall back on"
-msgstr "Ñтандартна, резервна ÑтойноÑÑ‚ за „git_env_*(…)“"
-
-msgid "be quiet only use git_env_*() value as exit code"
-msgstr ""
-"без извеждане на Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ â€” ÑтойноÑтта на „git_env_*()“ да е изходен код"
-
-#, c-format
-msgid "option `--default' expects a boolean value with `--type=bool`, not `%s`"
-msgstr ""
-"опциÑта „--default“ изиÑква булева ÑтойноÑÑ‚ при „--type=bool“, а не „%s“"
-
-#, c-format
-msgid ""
-"option `--default' expects an unsigned long value with `--type=ulong`, not `"
-"%s`"
-msgstr ""
-"опциÑта „--default“ изиÑква целочиÑлена ÑтойноÑÑ‚ без знак при „--"
-"type=ulong“, а не „%s“"
-
msgid "git fast-export [<rev-list-opts>]"
msgstr "git fast-export [ОПЦИЯ_ЗÐ_СПИСЪКÐ_С_ВЕРСИИ…]"
@@ -5936,7 +6123,7 @@ msgid "git fetch [<options>] <group>"
msgstr "git fetch [ОПЦИЯ…] ГРУПÐ"
msgid "git fetch --multiple [<options>] [(<repository> | <group>)...]"
-msgstr "git fetch --multiple [ОПЦИЯ…] [(ХРÐÐИЛИЩЕ | ГРУПÐ)…]"
+msgstr "git fetch --multiple [ОПЦИЯ…] [(ХРÐÐИЛИЩЕ|ГРУПÐ)…]"
msgid "git fetch --all [<options>]"
msgstr "git fetch --all [ОПЦИЯ…]"
@@ -5944,119 +6131,14 @@ msgstr "git fetch --all [ОПЦИЯ…]"
msgid "fetch.parallel cannot be negative"
msgstr "опциÑта „fetch.parallel“ Ñ‚Ñ€Ñбва да е неотрицателна"
-msgid "fetch from all remotes"
-msgstr "доÑтавÑне от вÑички отдалечени хранилища"
-
-msgid "set upstream for git pull/fetch"
-msgstr "задаване на клон за Ñледене за издърпване/доÑтавÑне"
-
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "добавÑне към „.git/FETCH_HEAD“ вмеÑто замÑна"
-
-msgid "use atomic transaction to update references"
-msgstr "изиÑкване на атомарни операции за обновÑване на указателите"
-
-msgid "path to upload pack on remote end"
-msgstr "отдалечен път, където да Ñе качи пакетът"
-
-msgid "force overwrite of local reference"
-msgstr "принудително презапиÑване на локален указател"
-
-msgid "fetch from multiple remotes"
-msgstr "доÑтавÑне от множеÑтво отдалечени хранилища"
-
-msgid "fetch all tags and associated objects"
-msgstr "доÑтавÑне на вÑички етикети и принадлежащи обекти"
-
-msgid "do not fetch all tags (--no-tags)"
-msgstr "без доÑтавÑнето на вÑички етикети „--no-tags“"
-
-msgid "number of submodules fetched in parallel"
-msgstr "брой подмодули доÑтавени паралелно"
-
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr ""
-"промÑна на указателÑ, така че и той, както оÑтаналите, да бъде в „refs/"
-"prefetch/“"
-
-msgid "prune remote-tracking branches no longer on remote"
-msgstr "окаÑÑ‚Ñ€Ñне на клоните ÑледÑщи вече неÑъщеÑтвуващи отдалечени клони"
-
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr ""
-"окаÑÑ‚Ñ€Ñне на локалните етикети, които вече не ÑъщеÑтвуват в отдалеченото "
-"хранилище и презапиÑване на променените"
-
-msgid "on-demand"
-msgstr "ПРИ ÐУЖДÐ"
-
-msgid "control recursive fetching of submodules"
-msgstr "управление на рекурÑивното доÑтавÑне на подмодулите"
-
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "запазване на доÑтавените указатели във файла „FETCH_HEAD“"
-
-msgid "keep downloaded pack"
-msgstr "запазване на изтеглените пакети Ñ Ð¾Ð±ÐµÐºÑ‚Ð¸"
-
-msgid "allow updating of HEAD ref"
-msgstr "позволÑване на обновÑването на ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ â€žHEAD“"
-
-msgid "deepen history of shallow clone"
-msgstr "задълбочаване на иÑториÑта на плитко хранилище"
-
-msgid "deepen history of shallow repository based on time"
-msgstr "задълбочаване на иÑториÑта на плитко хранилище до определено време"
-
-msgid "convert to a complete repository"
-msgstr "превръщане в пълно хранилище"
-
-msgid "re-fetch without negotiating common commits"
-msgstr "повторно доÑтавÑне без договарÑне на общите подаваниÑ"
-
-msgid "prepend this to submodule path output"
-msgstr "добавÑне на това пред Ð¿ÑŠÑ‚Ñ Ð½Ð° подмодула"
-
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr ""
-"Ñтандартно рекурÑивно изтеглÑне на подмодулите (файловете Ñ Ð½Ð°Ñтройки Ñа Ñ "
-"приоритет)"
-
-msgid "accept refs that update .git/shallow"
-msgstr "приемане на указатели, които обновÑват „.git/shallow“"
-
-msgid "refmap"
-msgstr "КÐРТÐ_С_УКÐЗÐТЕЛИ"
-
-msgid "specify fetch refmap"
-msgstr "указване на КÐРТÐта_С_УКÐЗÐТЕЛИ за доÑтавÑне"
-
-msgid "report that we have only objects reachable from this object"
-msgstr "докладване, че вÑички обекти може Ñа доÑтижими при започване от този"
-
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr ""
-"без доÑтавÑне на пакетни файлове, вмеÑто това да Ñе извеждат предшеÑтвеници "
-"на договорните върхове"
-
-msgid "run 'maintenance --auto' after fetching"
-msgstr "изпълнÑване на „maintenance --auto“ Ñлед доÑтавÑне"
-
-msgid "check for forced-updates on all updated branches"
-msgstr "проверка за принудителни обновÑÐ²Ð°Ð½Ð¸Ñ Ð½Ð° вÑички клони"
-
-msgid "write the commit-graph after fetching"
-msgstr "запазване на гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта Ñлед доÑтавÑне"
-
-msgid "accept refspecs from stdin"
-msgstr "четене на указателите от ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ Ð²Ñ…Ð¾Ð´"
-
msgid "couldn't find remote ref HEAD"
msgstr "указателÑÑ‚ „HEAD“ в отдалеченото хранилище не може да бъде открит"
#, c-format
+msgid "From %.*s\n"
+msgstr "От %.*s\n"
+
+#, c-format
msgid "object %s not found"
msgstr "обектът „%s“ липÑва"
@@ -6066,12 +6148,9 @@ msgstr "[актуален]"
msgid "[rejected]"
msgstr "[отхвърлен]"
-msgid "can't fetch in current branch"
+msgid "can't fetch into checked-out branch"
msgstr "в Ñ‚ÐµÐºÑƒÑ‰Ð¸Ñ ÐºÐ»Ð¾Ð½ не може да Ñе доÑтавÑ"
-msgid "checked out in another worktree"
-msgstr "изтеглен в друго работно дърво"
-
msgid "[tag update]"
msgstr "[обновÑване на етикетите]"
@@ -6135,10 +6214,6 @@ msgstr ""
"отхвърлÑне на „%s“, защото плитките върхове не може да бъдат обновÑвани"
#, c-format
-msgid "From %.*s\n"
-msgstr "От %.*s\n"
-
-#, c-format
msgid ""
"some local refs could not be updated; try running\n"
" 'git remote prune %s' to remove any old, conflicting branches"
@@ -6231,6 +6306,115 @@ msgstr ""
msgid "you need to specify a tag name"
msgstr "Ñ‚Ñ€Ñбва да укажете име на етикет"
+msgid "fetch from all remotes"
+msgstr "доÑтавÑне от вÑички отдалечени хранилища"
+
+msgid "set upstream for git pull/fetch"
+msgstr "задаване на клон за Ñледене за издърпване/доÑтавÑне"
+
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "добавÑне към „.git/FETCH_HEAD“ вмеÑто замÑна"
+
+msgid "use atomic transaction to update references"
+msgstr "изиÑкване на атомарни операции за обновÑване на указателите"
+
+msgid "path to upload pack on remote end"
+msgstr "отдалечен път, където да Ñе качи пакетът"
+
+msgid "force overwrite of local reference"
+msgstr "принудително презапиÑване на локален указател"
+
+msgid "fetch from multiple remotes"
+msgstr "доÑтавÑне от множеÑтво отдалечени хранилища"
+
+msgid "fetch all tags and associated objects"
+msgstr "доÑтавÑне на вÑички етикети и принадлежащи обекти"
+
+msgid "do not fetch all tags (--no-tags)"
+msgstr "без доÑтавÑнето на вÑички етикети „--no-tags“"
+
+msgid "number of submodules fetched in parallel"
+msgstr "брой подмодули доÑтавени паралелно"
+
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+"промÑна на указателÑ, така че и той, както оÑтаналите, да бъде в „refs/"
+"prefetch/“"
+
+msgid "prune remote-tracking branches no longer on remote"
+msgstr "окаÑÑ‚Ñ€Ñне на клоните ÑледÑщи вече неÑъщеÑтвуващи отдалечени клони"
+
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr ""
+"окаÑÑ‚Ñ€Ñне на локалните етикети, които вече не ÑъщеÑтвуват в отдалеченото "
+"хранилище и презапиÑване на променените"
+
+msgid "on-demand"
+msgstr "ПРИ ÐУЖДÐ"
+
+msgid "control recursive fetching of submodules"
+msgstr "управление на рекурÑивното доÑтавÑне на подмодулите"
+
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "запазване на доÑтавените указатели във файла „FETCH_HEAD“"
+
+msgid "keep downloaded pack"
+msgstr "запазване на изтеглените пакети Ñ Ð¾Ð±ÐµÐºÑ‚Ð¸"
+
+msgid "allow updating of HEAD ref"
+msgstr "позволÑване на обновÑването на ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ â€žHEAD“"
+
+msgid "deepen history of shallow clone"
+msgstr "задълбочаване на иÑториÑта на плитко хранилище"
+
+msgid "deepen history of shallow repository based on time"
+msgstr "задълбочаване на иÑториÑта на плитко хранилище до определено време"
+
+msgid "convert to a complete repository"
+msgstr "превръщане в пълно хранилище"
+
+msgid "re-fetch without negotiating common commits"
+msgstr "повторно доÑтавÑне без договарÑне на общите подаваниÑ"
+
+msgid "prepend this to submodule path output"
+msgstr "добавÑне на това пред Ð¿ÑŠÑ‚Ñ Ð½Ð° подмодула"
+
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+"Ñтандартно рекурÑивно изтеглÑне на подмодулите (файловете Ñ Ð½Ð°Ñтройки Ñа Ñ "
+"приоритет)"
+
+msgid "accept refs that update .git/shallow"
+msgstr "приемане на указатели, които обновÑват „.git/shallow“"
+
+msgid "refmap"
+msgstr "КÐРТÐ_С_УКÐЗÐТЕЛИ"
+
+msgid "specify fetch refmap"
+msgstr "указване на КÐРТÐта_С_УКÐЗÐТЕЛИ за доÑтавÑне"
+
+msgid "report that we have only objects reachable from this object"
+msgstr "докладване, че вÑички обекти може Ñа доÑтижими при започване от този"
+
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr ""
+"без доÑтавÑне на пакетни файлове, вмеÑто това да Ñе извеждат предшеÑтвеници "
+"на договорните върхове"
+
+msgid "run 'maintenance --auto' after fetching"
+msgstr "изпълнÑване на „maintenance --auto“ Ñлед доÑтавÑне"
+
+msgid "check for forced-updates on all updated branches"
+msgstr "проверка за принудителни обновÑÐ²Ð°Ð½Ð¸Ñ Ð½Ð° вÑички клони"
+
+msgid "write the commit-graph after fetching"
+msgstr "запазване на гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта Ñлед доÑтавÑне"
+
+msgid "accept refspecs from stdin"
+msgstr "четене на указателите от ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ Ð²Ñ…Ð¾Ð´"
+
msgid "--negotiate-only needs one or more --negotiation-tip=*"
msgstr ""
"ОпциÑта „--negotiate-only“ изиÑква една или повече опции „--negotiation-"
@@ -6242,6 +6426,10 @@ msgstr "отрицателна дълбочина като аргумент на
msgid "--unshallow on a complete repository does not make sense"
msgstr "не може да използвате опциÑта „--unshallow“ върху пълно хранилище"
+#, c-format
+msgid "failed to fetch bundles from '%s'"
+msgstr "неуÑпешно доÑтавÑне на пратки от „%s“"
+
msgid "fetch --all does not take a repository argument"
msgstr "към „git fetch --all“ не може да добавите аргумент-хранилище"
@@ -6277,8 +6465,7 @@ msgstr "опциÑта „--stdin“ поддържа доÑтавÑне ÑамÐ
msgid ""
"git fmt-merge-msg [-m <message>] [--log[=<n>] | --no-log] [--file <file>]"
-msgstr ""
-"git fmt-merge-msg [-m СЪОБЩЕÐИЕ] [--log[=БРОЙ] | --no-log] [--file ФÐЙЛ]"
+msgstr "git fmt-merge-msg [-m СЪОБЩЕÐИЕ] [--log[=БРОЙ]|--no-log] [--file ФÐЙЛ]"
msgid "populate log with at most <n> entries from shortlog"
msgstr ""
@@ -6345,8 +6532,14 @@ msgstr "извеждане Ñамо на указателите, които ÑÑŠ
msgid "print only refs which don't contain the commit"
msgstr "извеждане Ñамо на указателите, които не Ñъдържат това ПОДÐÐ’ÐÐЕ"
-msgid "git for-each-repo --config=<config> <command-args>"
-msgstr "git for-each-repo --config=ÐÐСТРОЙКРÐРГУМЕÐТ…"
+msgid "read reference patterns from stdin"
+msgstr "изчитане на шаблоните за указатели от ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ Ð²Ñ…Ð¾Ð´"
+
+msgid "unknown arguments supplied with --stdin"
+msgstr "непознат аргумент към опциÑта „--stdin“"
+
+msgid "git for-each-repo --config=<config> [--] <arguments>"
+msgstr "git for-each-repo --config=ÐÐСТРОЙКР[--] ÐРГУМЕÐТ…"
msgid "config"
msgstr "наÑтройка"
@@ -6357,6 +6550,10 @@ msgstr "наÑтройка, коÑто Ñъдържа ÑпиÑък Ñ Ð¿ÑŠÑ‚Ð¸Ñ‰
msgid "missing --config=<config>"
msgstr "липÑва --config=ÐÐСТРОЙКÐ"
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "получена е неправилена наÑтройка „--config=%s“"
+
msgid "unknown"
msgstr "непознат"
@@ -6487,7 +6684,6 @@ msgstr "Проверка на директориите Ñ Ð¾Ð±ÐµÐºÑ‚Ð¸"
msgid "Checking %s link"
msgstr "Проверка на връзките на „%s“"
-#
#, c-format
msgid "invalid %s"
msgstr "неправилен указател „%s“"
@@ -6502,20 +6698,41 @@ msgstr "%s: неÑвързаниÑÑ‚ връх „HEAD“ не Ñочи към н
#, c-format
msgid "notice: %s points to an unborn branch (%s)"
-msgstr "предупреждение: „%s“ Ñочи към вÑе още неÑъщеÑтвуващ клон (%s)"
+msgstr "предупреждение: „%s“ Ñочи към неродѐн клон (%s)"
-msgid "Checking cache tree"
-msgstr "Проверка на дървото на кеша"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "Проверка на кеша на обектите-дървета на „%s“"
#, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "„%s“: неправилен указател за SHA1 в дървото на кеша"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "„%s“: неправилен указател за SHA1 в кеша на обектите-дървета на „%s“"
msgid "non-tree in cache-tree"
-msgstr "в дървото на кеша има нещо, което не е дърво"
+msgstr "в кеша на обектите-дървета има нещо, което не е дърво"
-msgid "git fsck [<options>] [<object>...]"
-msgstr "git fsck [ОПЦИЯ…] [ОБЕКТ…]"
+#, c-format
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "„%s“: неправилен указател за отмÑна на разрешените Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ Ð½Ð° „%s“"
+
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "обратниÑÑ‚ Ð¸Ð½Ð´ÐµÐºÑ Ð½Ð° пакета „%s“ не може да бъде зареден"
+
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "неправилен обратен Ð¸Ð½Ð´ÐµÐºÑ Ð·Ð° пакета „%s“"
+
+msgid ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<object>...]"
+msgstr ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [ОБЕКТ…]"
msgid "show unreachable objects"
msgstr "показване на недоÑтижимите обекти"
@@ -6570,15 +6787,9 @@ msgstr "git fsmonitor--daemon start [ОПЦИЯ…]"
msgid "git fsmonitor--daemon run [<options>]"
msgstr "git fsmonitor--daemon run [ОПЦИЯ…]"
-msgid "git fsmonitor--daemon stop"
-msgstr "git fsmonitor--daemon stop"
-
-msgid "git fsmonitor--daemon status"
-msgstr "git fsmonitor--daemon status"
-
#, c-format
msgid "value of '%s' out of range: %d"
-msgstr "дължината на „%s“ e извън интервала: %d"
+msgstr "дължината на „%s“ e извън диапазона: %d"
#, c-format
msgid "value of '%s' not bool or int: %d"
@@ -6699,6 +6910,9 @@ msgstr "окаÑÑ‚Ñ€Ñне на обектите, към които нищо нÐ
msgid "pack unreferenced objects separately"
msgstr "пакетиране на обектите, към които нищо не Ñочи, отделно"
+msgid "with --cruft, limit the size of new cruft packs"
+msgstr "Ñ â€ž--cruft“ размерът на новите ненужни пакети Ñе ограничава"
+
msgid "be more thorough (increased runtime)"
msgstr "изчерпателно Ñ‚ÑŠÑ€Ñене на боклука (за Ñметка на повече време работа)"
@@ -6827,8 +7041,20 @@ msgstr "изпълнение на определена задача"
msgid "use at most one of --auto and --schedule=<frequency>"
msgstr "опциите „--auto“ и „--schedule=ЧЕСТОТГ Ñа неÑъвмеÑтими"
-msgid "failed to run 'git config'"
-msgstr "неуÑпешно изпълнение на „git config“"
+#, c-format
+msgid "unable to add '%s' value of '%s'"
+msgstr "неуÑпешно добавÑне на ÑтойноÑÑ‚ на „%s“ за „%s“"
+
+msgid "return success even if repository was not registered"
+msgstr "уÑпешно завършване, дори ако хранилището не бъде региÑтрирано"
+
+#, c-format
+msgid "unable to unset '%s' value of '%s'"
+msgstr "неуÑпешно изчиÑтване на ÑтойноÑÑ‚ на „%s“ за „%s“"
+
+#, c-format
+msgid "repository '%s' is not registered"
+msgstr "хранилището „%s“ не е региÑтрирано"
#, c-format
msgid "failed to expand path '%s'"
@@ -6856,22 +7082,19 @@ msgstr ""
"неуÑпешно изпълнение на „crontab -l“. СиÑтемата ви може да не поддържа "
"„cron“"
+msgid "failed to create crontab temporary file"
+msgstr "не може да Ñе Ñъздаде временен файл за crontab"
+
+msgid "failed to open temporary file"
+msgstr "временниÑÑ‚ файл не може да Ñе отвори"
+
msgid "failed to run 'crontab'; your system might not support 'cron'"
msgstr ""
"неуÑпешно изпълнение на „crontab“. СиÑтемата ви може да не поддържа „cron“"
-msgid "failed to open stdin of 'crontab'"
-msgstr "ÑтандартниÑÑ‚ вход на „crontab“ не може да Ñе отвори"
-
msgid "'crontab' died"
msgstr "процеÑÑŠÑ‚ на „crontab“ умрÑ"
-msgid "failed to start systemctl"
-msgstr "неуÑпешно Ñтартиране на „systemctl“"
-
-msgid "failed to run systemctl"
-msgstr "неуÑпешно изпълнение на „systemctl“"
-
#, c-format
msgid "failed to delete '%s'"
msgstr "неуÑпешно изтриване на „%s“"
@@ -6880,6 +7103,12 @@ msgstr "неуÑпешно изтриване на „%s“"
msgid "failed to flush '%s'"
msgstr "грешка при изчиÑтването на буферите при запиÑването на „%s“"
+msgid "failed to start systemctl"
+msgstr "неуÑпешно Ñтартиране на „systemctl“"
+
+msgid "failed to run systemctl"
+msgstr "неуÑпешно изпълнение на „systemctl“"
+
#, c-format
msgid "unrecognized --scheduler argument '%s'"
msgstr "непознат аргумент към „--scheduler“: %s"
@@ -6903,16 +7132,15 @@ msgstr "ПЛÐÐИРÐЩ_МОДУЛ"
msgid "scheduler to trigger git maintenance run"
msgstr "ПЛÐÐИРÐЩиÑÑ‚_МОДУЛ, който да изпълнÑва задачите"
+msgid "failed to set up maintenance schedule"
+msgstr "неуÑпешно наÑрочване на задачите по поддръжка"
+
msgid "failed to add repo to global config"
msgstr "неуÑпешно добавÑне на хранилище към файла Ñ Ð³Ð»Ð¾Ð±Ð°Ð»Ð½Ð¸ наÑтройки"
msgid "git maintenance <subcommand> [<options>]"
msgstr "git maintenance ПОДКОМÐÐДР[ОПЦИЯ…]"
-#, c-format
-msgid "invalid subcommand: %s"
-msgstr "неправилна подкоманда: „%s“"
-
msgid "git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]"
msgstr "git grep [ОПЦИЯ…] [-e] ШÐБЛОР[ВЕРСИЯ…] [[--] ПЪТ…]"
@@ -6938,6 +7166,10 @@ msgid "unable to read tree (%s)"
msgstr "дървото не може да бъде прочетено (%s)"
#, c-format
+msgid "unable to read tree %s"
+msgstr "дървото не може да бъде прочетено: %s"
+
+#, c-format
msgid "unable to grep from object of type %s"
msgstr "не може да Ñе изпълни „grep“ от обект от вида %s"
@@ -6982,7 +7214,7 @@ msgstr ""
msgid "search in subdirectories (default)"
msgstr "Ñ‚ÑŠÑ€Ñене в поддиректориите (Ñтандартно)"
-msgid "descend at most <depth> levels"
+msgid "descend at most <n> levels"
msgstr "навлизане макÑимално на тази ДЪЛБОЧИÐРв дървото"
msgid "use extended POSIX regular expressions"
@@ -7094,6 +7326,9 @@ msgstr ""
"позволÑване на Ñтартирането на grep(1) (текущиÑÑ‚ компилат пренебрегва тази "
"опциÑ)"
+msgid "maximum number of results per file"
+msgstr "макÑимален брой резултати във файл"
+
msgid "no pattern given"
msgstr "не Ñте задали шаблон"
@@ -7129,11 +7364,14 @@ msgid "both --cached and trees are given"
msgstr "опциÑта „--cached“ е неÑъвмеÑтима ÑÑŠÑ Ð·Ð°Ð´Ð°Ð²Ð°Ð½Ðµ на дърво"
msgid ""
-"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] "
-"[--] <file>..."
+"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
+" [--stdin [--literally]] [--] <file>..."
msgstr ""
-"git hash-object [-t ВИД] [-w] [--path=ФÐЙЛ | --no-filters] [--stdin] [--] "
-"ФÐЙЛ…"
+"git hash-object [-t ВИД] [-w] [--path=ФÐЙЛ|--no-filters]\n"
+" [--stdin [--literally]] [--] ФÐЙЛ…"
+
+msgid "git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]"
+msgstr "git hash-object [-t ВИД] [-w] --stdin-paths [--no-filters]"
msgid "object type"
msgstr "ВИД на обекта"
@@ -7178,16 +7416,22 @@ msgid "show info page"
msgstr "показване на информационна Ñтраница"
msgid "print command description"
-msgstr "извеждане на опиÑанието на команда"
+msgstr "показване на опиÑанието на команда"
msgid "print list of useful guides"
msgstr "показване на ÑпиÑък Ñ Ð²ÑŠÐ²ÐµÐ´ÐµÐ½Ð¸Ñ"
+msgid "print list of user-facing repository, command and file interfaces"
+msgstr "показване на ÑпиÑък Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¸Ñ‚Ðµ за файлове и хранилища за потребители"
+
+msgid "print list of file formats, protocols and other developer interfaces"
+msgstr "показване на ÑпиÑък Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð²Ð¸ формати, протоколи и др. за програмиÑти"
+
msgid "print all configuration variable names"
msgstr "показване на имената на вÑички конфигуриращи променливи"
-msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>]"
-msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [КОМÐÐДÐ…]"
+msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"
+msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [КОМÐÐДÐ|ДОКУМЕÐТ]"
#, c-format
msgid "unrecognized help format '%s'"
@@ -7258,12 +7502,18 @@ msgstr "употреба: %s%s"
msgid "'git help config' for more information"
msgstr "За повече Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¸Ð·Ð¿ÑŠÐ»Ð½ÐµÑ‚Ðµ „git help config“"
-msgid "git hook run [--ignore-missing] <hook-name> [-- <hook-args>]"
-msgstr "git hook run [--ignore-missing] КУКР[-- ÐРГУМЕÐТ_ЗÐ_КУКÐ…]"
+msgid ""
+"git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-"
+"args>]"
+msgstr ""
+"git hook run [--ignore-missing] [--to-stdin=ПЪТ] КУКР[-- ÐРГУМЕÐТ_ЗÐ_КУКÐ…]"
msgid "silently ignore missing requested <hook-name>"
msgstr "преÑкачане на заÑвена КУКÐ, коÑто липÑва"
+msgid "file to read into hooks' stdin"
+msgstr "файл за изчитане от ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ Ð²Ñ…Ð¾Ð´ на куката"
+
#, c-format
msgid "object type mismatch at %s"
msgstr "неправилен вид на обекта „%s“"
@@ -7341,10 +7591,6 @@ msgstr ""
"СЪВПÐДЕÐИЕ ÐРСТОЙÐОСТИТЕ ЗРСУМИТЕ ЗРSHA1: „%s“ ÐРДВРРÐЗЛИЧÐИ ОБЕКТÐ!"
#, c-format
-msgid "unable to read %s"
-msgstr "обектът „%s“ не може да бъде прочетен"
-
-#, c-format
msgid "cannot read existing object info %s"
msgstr "ÑъщеÑтвуващиÑÑ‚ обект в „%s“ не може да бъде прочетен"
@@ -7403,7 +7649,7 @@ msgstr[1] "дейÑтвието завърши Ñ %d локални обекта
#, c-format
msgid "Unexpected tail checksum for %s (disk corruption?)"
msgstr ""
-"Ðеочаквана поÑледваща Ñума за грешки за „%s“ (причината може да е грешка в "
+"Ðеочаквана поÑледваща Ñума за проверка на „%s“ (причината може да е грешка в "
"диÑка)"
#, c-format
@@ -7483,89 +7729,20 @@ msgstr "опциÑта „--verify“ изиÑква име на пакетен
msgid "fsck error in pack objects"
msgstr "грешка при проверка Ñ â€žfsck“ на пакетните обекти"
-#, c-format
-msgid "cannot stat template '%s'"
-msgstr "не може да Ñе получи Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ñ‡Ñ€ÐµÐ· „stat“ за шаблона „%s“"
-
-#, c-format
-msgid "cannot opendir '%s'"
-msgstr "директориÑта „%s“ не може да бъде отворена"
-
-#, c-format
-msgid "cannot readlink '%s'"
-msgstr "връзката „%s“ не може да бъде прочетена"
-
-#, c-format
-msgid "cannot symlink '%s' '%s'"
-msgstr "не може да Ñе Ñъздаде Ñимволна връзка „%s“ в „%s“"
-
-#, c-format
-msgid "cannot copy '%s' to '%s'"
-msgstr "„%s“ не може да Ñе копира в „%s“"
-
-#, c-format
-msgid "ignoring template %s"
-msgstr "игнориране на шаблона „%s“"
-
-#, c-format
-msgid "templates not found in %s"
-msgstr "нÑма шаблони в „%s“"
-
-#, c-format
-msgid "not copying templates from '%s': %s"
-msgstr "шаблоните нÑма да бъдат копирани от „%s“: „%s“"
-
-#, c-format
-msgid "invalid initial branch name: '%s'"
-msgstr "неправилно име на Ð¿ÑŠÑ€Ð²Ð¾Ð½Ð°Ñ‡Ð°Ð»Ð½Ð¸Ñ ÐºÐ»Ð¾Ð½: „%s“"
-
-#, c-format
-msgid "unable to handle file type %d"
-msgstr "файлове от вид %d не Ñе поддържат"
-
-#, c-format
-msgid "unable to move %s to %s"
-msgstr "„%s“ не може да Ñе премеÑти в „%s“"
-
-msgid "attempt to reinitialize repository with different hash"
-msgstr ""
-"опит за повторно задаване на първото подаване в хранилището Ñ Ñ€Ð°Ð·Ð»Ð¸Ñ‡Ð½Ð° "
-"контролна Ñума"
-
-#, c-format
-msgid "%s already exists"
-msgstr "ДиректориÑта „%s“ вече ÑъщеÑтвува"
-
-#, c-format
-msgid "re-init: ignored --initial-branch=%s"
-msgstr "re-init: „--initial-branch=%s“ Ñе пропуÑка"
-
-#, c-format
-msgid "Reinitialized existing shared Git repository in %s%s\n"
-msgstr ""
-"Инициализиране наново на ÑъщеÑтвуващо, Ñподелено хранилище на Git в „%s%s“\n"
-
-#, c-format
-msgid "Reinitialized existing Git repository in %s%s\n"
-msgstr "Инициализиране наново на ÑъщеÑтвуващо хранилище на Git в „%s%s“\n"
-
-#, c-format
-msgid "Initialized empty shared Git repository in %s%s\n"
-msgstr "Инициализиране на празно, Ñподелено хранилище на Git в „%s%s“\n"
-
-#, c-format
-msgid "Initialized empty Git repository in %s%s\n"
-msgstr "Инициализиране на празно хранилище на Git в „%s%s“\n"
-
msgid ""
-"git init [-q | --quiet] [--bare] [--template=<template-directory>] [--"
-"shared[=<permissions>]] [<directory>]"
+"git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
+" [--separate-git-dir <git-dir>] [--object-format=<format>]\n"
+" [--ref-format=<format>]\n"
+" [-b <branch-name> | --initial-branch=<branch-name>]\n"
+" [--shared[=<permissions>]] [<directory>]"
msgstr ""
-"git init [-q | --quiet] [--bare] [--template=ДИРЕКТОРИЯ_С_ШÐБЛОÐИ] [--"
-"shared[=ПРÐÐ’Ð]] [ДИРЕКТОРИЯ]"
+"git init [-q|--quiet] [--bare] [--template=ДИРЕКТОРИЯ_С_ШÐБЛОÐИ]\n"
+" [--separate-git-dir ДИРЕКТОРИЯ_ÐÐ_GIT] [--object-format=ФОРМÐТ]\n"
+" [-b КЛОÐ|--initial-branch=КЛОÐ]\n"
+" [--shared[=ПРÐÐ’ÐÌ€]] [ДИРЕКТОРИЯ]"
msgid "permissions"
-msgstr "права"
+msgstr "права̀"
msgid "specify that the git repository is to be shared amongst several users"
msgstr ""
@@ -7605,11 +7782,13 @@ msgid "--separate-git-dir incompatible with bare repository"
msgstr "опциÑта „--separate-git-dir“ е неÑъвмеÑтима Ñ Ð³Ð¾Ð»Ð¾ хранилище"
msgid ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"<token>[(=|:)<value>])...] [<file>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<key>|<keyAlias>)[(=|:)<value>])...]\n"
+" [--parse] [<file>...]"
msgstr ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"ЛЕКСЕМÐ[(=|:)СТОЙÐОСТ])…] [ФÐЙЛ…]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (КЛЮЧ|СИÐОÐИМ)[(=|:)СТОЙÐОСТ])…]\n"
+" [--parse] [ФÐЙЛ…]"
msgid "edit files in place"
msgstr "директно редактиране на файловете"
@@ -7617,6 +7796,9 @@ msgstr "директно редактиране на файловете"
msgid "trim empty trailers"
msgstr "изчиÑтване на празните епилози"
+msgid "placement"
+msgstr "меÑтоположение"
+
msgid "where to place the new trailer"
msgstr "къде да Ñе поÑтави новиÑÑ‚ епилог"
@@ -7629,17 +7811,19 @@ msgstr "дейÑтвие при липÑващ епилог"
msgid "output only the trailers"
msgstr "извеждане Ñамо на епилозите"
-msgid "do not apply config rules"
-msgstr "без прилагане на правилата за наÑтройките"
+msgid "do not apply trailer.* configuration variables"
+msgstr "без прилагане на конфигуриращи променливи, завършващи Ñ ÐµÐ¿Ð¸Ð»Ð¾Ð³.*"
-msgid "join whitespace-continued values"
-msgstr "Ñливане на ÑтойноÑтите поÑледване от знаци за интервали"
+msgid "reformat multiline trailer values as single-line values"
+msgstr ""
+"форматиране на епилози, които заемат повече от един ред, в ÑтойноÑти на един "
+"ред"
-msgid "set parsing options"
-msgstr "опции при анализ"
+msgid "alias for --only-trailers --only-input --unfold"
+msgstr "пÑевдоним на комбинациÑта „--only-trailers --only-input --unfold“"
-msgid "do not treat --- specially"
-msgstr "„---“ нÑма Ñпециално значение"
+msgid "do not treat \"---\" as the end of input"
+msgstr "„---“ не отбелÑзва ÐºÑ€Ð°Ñ Ð½Ð° входа"
msgid "trailer(s) to add"
msgstr "епилози за добавÑне"
@@ -7666,10 +7850,8 @@ msgstr "без извеждане на разликите"
msgid "show source"
msgstr "извеждане на Ð¸Ð·Ñ…Ð¾Ð´Ð½Ð¸Ñ ÐºÐ¾Ð´"
-msgid "use mail map file"
-msgstr ""
-"използване на файл за ÑъответÑтвиÑта на имената и адреÑите на е-поща („."
-"mailmap“)"
+msgid "clear all previously-defined decoration filters"
+msgstr "изчиÑтване на зададените филтри за форма̀та на извежданата информациÑ"
msgid "only decorate refs that match <pattern>"
msgstr "Ñпециален формат Ñамо на указателите напаÑващи на ШÐБЛОÐа"
@@ -7730,6 +7912,10 @@ msgstr "Ñ‚Ñ€Ñбва да зададете точно един диапазон"
msgid "not a range"
msgstr "не е диапазон"
+#, c-format
+msgid "unable to read branch description file '%s'"
+msgstr "файлът Ñ Ð¾Ð¿Ð¸Ñанието на клона „%s“ не може да бъде прочетен"
+
msgid "cover letter needs email format"
msgstr "придружаващото пиÑмо Ñ‚Ñ€Ñбва да е форматирано като е-пиÑмо"
@@ -7741,7 +7927,7 @@ msgid "insane in-reply-to: %s"
msgstr "неправилен формат на заглавната чаÑÑ‚ за отговор „in-reply-to“: %s"
msgid "git format-patch [<options>] [<since> | <revision-range>]"
-msgstr "git format-patch [ОПЦИЯ…] [ОТ | ДИÐПÐЗОÐ_ÐÐ_ВЕРСИИТЕ]"
+msgstr "git format-patch [ОПЦИЯ…] [ОТ|ДИÐПÐЗОÐ_ÐÐ_ВЕРСИИТЕ]"
msgid "two output directories?"
msgstr "може да укажете макÑимум една Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð·Ð° изход"
@@ -7832,6 +8018,9 @@ msgstr ""
"генериране на чаÑтите на придружаващото пиÑмо на базата на опиÑанието на "
"клона"
+msgid "use branch description from file"
+msgstr "ползване на опиÑание на клон от файл"
+
msgid "use [<prefix>] instead of [PATCH]"
msgstr "използване на този „[ПРЕФИКС]“ вмеÑто „[PATCH]“"
@@ -7936,6 +8125,11 @@ msgstr ""
msgid "percentage by which creation is weighted"
msgstr "процент за претеглÑне при оценка на Ñъздаването"
+msgid "show in-body From: even if identical to the e-mail header"
+msgstr ""
+"показване на заглавната чаÑÑ‚ „From:“ в Ñ‚Ñлото на пиÑмото дори и да е Ñъщата "
+"като тази на плика на пиÑмото"
+
#, c-format
msgid "invalid ident line: %s"
msgstr "грешна идентичноÑÑ‚: %s"
@@ -7998,6 +8192,22 @@ msgstr ""
"СледениÑÑ‚ отдалечен клон не бе открит, затова изрично задайте "
"ОТДÐЛЕЧЕÐ_КЛОÐ.\n"
+#, c-format
+msgid "could not get object info about '%s'"
+msgstr "не може да Ñе получи Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð·Ð° обекта „%s“"
+
+#, c-format
+msgid "bad ls-files format: element '%s' does not start with '('"
+msgstr "неправилен формат за „ls-tree“: елементът „%s“ не започва Ñ â€ž(“"
+
+#, c-format
+msgid "bad ls-files format: element '%s' does not end in ')'"
+msgstr "неправилен формат за „ls-tree“: елементът „%s“ не завършва Ñ â€ž)“"
+
+#, c-format
+msgid "bad ls-files format: %%%.*s"
+msgstr "неправилен формат за „ls-tree“: %%%.*s"
+
msgid "git ls-files [<options>] [<file>...]"
msgstr "git ls-files [ОПЦИЯ…] [ФÐЙЛ…]"
@@ -8086,13 +8296,20 @@ msgstr ""
"указване на чаÑтично изтеглените директории при наличието на чаÑтичен индекÑ"
msgid ""
-"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<repository> [<refs>...]]"
+"--format cannot be used with -s, -o, -k, -t, --resolve-undo, --deduplicate, "
+"--eol"
msgstr ""
+"опциÑта „--format“ е неÑъвмеÑтима Ñ â€ž-s“/„-o“/„-k“/„-t“/„--resolve-undo“/„--"
+"deduplicate“/„--eol“"
+
+msgid ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [ХРÐÐИЛИЩЕ [УКÐЗÐТЕЛ…]]"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
+" [--symref] [<repository> [<patterns>...]]"
+msgstr ""
+"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=КОМÐÐДÐ]\n"
+" [-q|--quiet] [--exit-code] [--get-url] [--sort=КЛЮЧ]\n"
+" [--symref] [ХРÐÐИЛИЩЕ [ШÐБЛОÐ]]"
msgid "do not print remote URL"
msgstr "без извеждане на адреÑите на отдалечените хранилища"
@@ -8125,10 +8342,6 @@ msgid "git ls-tree [<options>] <tree-ish> [<path>...]"
msgstr "git ls-tree [ОПЦИЯ…] УКÐЗÐТЕЛ_КЪМ_ДЪРВО [ПЪТ…]"
#, c-format
-msgid "could not get object info about '%s'"
-msgstr "не може да Ñе получи Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð·Ð° обекта „%s“"
-
-#, c-format
msgid "bad ls-tree format: element '%s' does not start with '('"
msgstr "неправилен формат за „ls-tree“: елементът „%s“ не започва Ñ â€ž(“"
@@ -8221,17 +8434,17 @@ msgid "empty mbox: '%s'"
msgstr "празна пощенÑка ÐºÑƒÑ‚Ð¸Ñ mbox: „%s“"
msgid "git merge-base [-a | --all] <commit> <commit>..."
-msgstr "git merge-base [-a | --all] ПОДÐÐ’ÐÐЕ ПОДÐÐ’ÐÐЕ…"
+msgstr "git merge-base [-a|--all] ПОДÐÐ’ÐÐЕ ПОДÐÐ’ÐÐЕ…"
msgid "git merge-base [-a | --all] --octopus <commit>..."
-msgstr "git merge-base [-a | --all] --octopus ПОДÐÐ’ÐÐЕ…"
-
-msgid "git merge-base --independent <commit>..."
-msgstr "git merge-base --independent ПОДÐÐ’ÐÐЕ…"
+msgstr "git merge-base [-a|--all] --octopus ПОДÐÐ’ÐÐЕ…"
msgid "git merge-base --is-ancestor <commit> <commit>"
msgstr "git merge-base --is-ancestor ПОДÐÐ’ÐÐЕ_1 ПОДÐÐ’ÐÐЕ_2"
+msgid "git merge-base --independent <commit>..."
+msgstr "git merge-base --independent ПОДÐÐ’ÐÐЕ…"
+
msgid "git merge-base --fork-point <ref> [<commit>]"
msgstr "git merge-base --fork-point УКÐЗÐТЕЛ [ПОДÐÐ’ÐÐЕ]"
@@ -8258,9 +8471,20 @@ msgstr ""
"git merge-file [ОПЦИЯ…] [-L ИМЕ_1 [-L ОРИГИÐÐЛ [-L ИМЕ_2]]] ФÐЙЛ_1 ОРИГ_ФÐЙЛ "
"ФÐЙЛ_2"
+msgid ""
+"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
+"\"histogram\""
+msgstr ""
+"опциÑта приема Ñледните варианти за алгоритъм за разлики: „myers“ (по "
+"МайерÑ), „minimal“ (минимизиране на разликите), „patience“ (паÑианÑ) и "
+"„histogram“ (хиÑтограмен)"
+
msgid "send results to standard output"
msgstr "извеждане на резултатите на ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ Ð¸Ð·Ñ…Ð¾Ð´"
+msgid "use object IDs instead of filenames"
+msgstr "ползване на идентификатори на обекти вмеÑто имена на файлове"
+
msgid "use a diff3 based merge"
msgstr "Ñливане на базата на „diff3“"
@@ -8276,6 +8500,12 @@ msgstr "при конфликти да Ñе ползва чуждата верÑ
msgid "for conflicts, use a union version"
msgstr "при конфликти да Ñе ползва обединена верÑиÑ"
+msgid "<algorithm>"
+msgstr "ÐЛГОРИТЪМ"
+
+msgid "choose a diff algorithm"
+msgstr "избор на ÐЛГОРИТЪМа за разлики"
+
msgid "for conflicts, use this marker size"
msgstr "при конфликти да Ñе ползва маркер Ñ Ñ‚Ð°ÐºÑŠÐ² БРОЙ знаци"
@@ -8286,6 +8516,13 @@ msgid "set labels for file1/orig-file/file2"
msgstr "задаване на етикети за ФÐЙЛ_1/ОРИГИÐÐЛ/ФÐЙЛ_2"
#, c-format
+msgid "object '%s' does not exist"
+msgstr "обектът „%s“ не ÑъщеÑтвува"
+
+msgid "Could not write object file"
+msgstr "Файлът Ñ Ð¾Ð±ÐµÐºÑ‚Ð¸ не може да Ñе запише"
+
+#, c-format
msgid "unknown option %s"
msgstr "непозната опциÑ: „%s“"
@@ -8304,12 +8541,70 @@ msgstr "поддържа Ñе Ñамо Ñливане на точно две иÑ
#, c-format
msgid "could not resolve ref '%s'"
-msgstr "указателÑÑ‚ „%s“ не може да бъде изтрит"
+msgstr "указателÑÑ‚ „%s“ не може да бъде проÑледен"
#, c-format
msgid "Merging %s with %s\n"
msgstr "Сливане на „%s“ Ñ â€ž%s“\n"
+msgid "not something we can merge"
+msgstr "не може да Ñе Ñлее"
+
+msgid "refusing to merge unrelated histories"
+msgstr "незавиÑими иÑтории не може да Ñе ÑлеÑÑ‚"
+
+msgid "failure to merge"
+msgstr "неуÑпешно Ñливане"
+
+msgid "git merge-tree [--write-tree] [<options>] <branch1> <branch2>"
+msgstr "git merge-tree [--write-tree] [ОПЦИЯ…] КЛОÐ_1 КЛОÐ_2"
+
+msgid "git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"
+msgstr "git merge-tree [--trivial-merge] БÐЗОВО_ДЪРВО КЛОÐ_1 КЛОÐ_2"
+
+msgid "do a real merge instead of a trivial merge"
+msgstr "ÑъщинÑко, а не тривиално Ñливане"
+
+msgid "do a trivial merge only"
+msgstr "Ñамо тривиално Ñливане"
+
+msgid "also show informational/conflict messages"
+msgstr "показване и информационните ÑъобщениÑ, и тези при конфликт"
+
+msgid "list filenames without modes/oids/stages"
+msgstr ""
+"извеждане на имената на файлове без режими/идентификатори на обекти/етапи"
+
+msgid "allow merging unrelated histories"
+msgstr "позволÑване на Ñливане на незавиÑими иÑтории"
+
+msgid "perform multiple merges, one per line of input"
+msgstr "извършване на множеÑтво ÑливаниÑ, по едно на ред"
+
+msgid "specify a merge-base for the merge"
+msgstr "база за Ñливането"
+
+msgid "option=value"
+msgstr "ОПЦИЯ=СТОЙÐОСТ"
+
+msgid "option for selected merge strategy"
+msgstr "ОПЦИЯ за избраната ÑÑ‚Ñ€Ð°Ñ‚ÐµÐ³Ð¸Ñ Ð·Ð° Ñливане"
+
+msgid "--trivial-merge is incompatible with all other options"
+msgstr "„--trivial-merge“ е неÑъвмеÑтима Ñ Ð´Ñ€ÑƒÐ³Ð¸Ñ‚Ðµ опции"
+
+#, c-format
+msgid "unknown strategy option: -X%s"
+msgstr "непозната Ð¾Ð¿Ñ†Ð¸Ñ Ð·Ð° ÑтратегиÑ: -X%s"
+
+#, c-format
+msgid "malformed input line: '%s'."
+msgstr "входен ред Ñ Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»ÐµÐ½ формат: „%s“."
+
+#, c-format
+msgid "merging cannot continue; got unclean result of %d"
+msgstr "Ñливането не може да продължи — %d-тото завърши Ñ Ð³Ñ€ÐµÑˆÐºÐ°"
+
msgid "git merge [<options>] [<commit>...]"
msgstr "git merge [ОПЦИЯ…] [ПОДÐÐ’ÐÐЕ…]"
@@ -8344,7 +8639,7 @@ msgstr "(пÑевдоним на „--stat“)"
msgid "add (at most <n>) entries from shortlog to merge commit message"
msgstr ""
"добавÑне (на макÑимум такъв БРОЙ) запиÑи от ÑÑŠÐºÑ€Ð°Ñ‚ÐµÐ½Ð¸Ñ Ð¶ÑƒÑ€Ð½Ð°Ð» в Ñъобщението "
-"за подаване"
+"за подаване ÑÑŠÑ Ñливане"
msgid "create a single commit instead of doing a merge"
msgstr "Ñъздаване на едно подаване вмеÑто извършване на Ñливане"
@@ -8370,12 +8665,6 @@ msgstr "СТРÐТЕГИЯ"
msgid "merge strategy to use"
msgstr "СТРÐТЕГИЯ за Ñливане, коÑто да Ñе ползва"
-msgid "option=value"
-msgstr "ОПЦИЯ=СТОЙÐОСТ"
-
-msgid "option for selected merge strategy"
-msgstr "ОПЦИЯ за избраната ÑÑ‚Ñ€Ð°Ñ‚ÐµÐ³Ð¸Ñ Ð·Ð° Ñливане"
-
msgid "merge commit message (for a non-fast-forward merge)"
msgstr "СЪОБЩЕÐИЕ при подаването ÑÑŠÑ Ñливане (при ÑъщинÑки ÑливаниÑ)"
@@ -8391,9 +8680,6 @@ msgstr "преуÑтановÑване (--abort) без промÑна на ин
msgid "continue the current in-progress merge"
msgstr "продължаване на текущото Ñливане"
-msgid "allow merging unrelated histories"
-msgstr "позволÑване на Ñливане на незавиÑими иÑтории"
-
msgid "bypass pre-merge-commit and commit-msg hooks"
msgstr ""
"без изпълнение на куките преди подаване и Ñливане и при промÑна на "
@@ -8442,10 +8728,6 @@ msgid "Not handling anything other than two heads merge."
msgstr "Поддържа Ñе Ñамо Ñливане на точно две иÑтории."
#, c-format
-msgid "unknown strategy option: -X%s"
-msgstr "непозната Ð¾Ð¿Ñ†Ð¸Ñ Ð·Ð° ÑтратегиÑ: -X%s"
-
-#, c-format
msgid "unable to write %s"
msgstr "„%s“ не може да бъде запиÑан"
@@ -8516,9 +8798,6 @@ msgstr "„%s“ не може да Ñе затвори"
msgid "not something we can merge in %s: %s"
msgstr "не може да Ñе Ñлее в „%s“: %s"
-msgid "not something we can merge"
-msgstr "не може да Ñе Ñлее"
-
msgid "--abort expects no arguments"
msgstr "опциÑта „--abort“ не приема аргументи"
@@ -8573,14 +8852,19 @@ msgstr "„%s“ — не е нещо, което може да Ñе Ñлее"
msgid "Can merge only exactly one commit into empty head"
msgstr "Може да Ñлеете точно едно подаване във връх без иÑториÑ"
-msgid "refusing to merge unrelated histories"
-msgstr "незавиÑими иÑтории не може да Ñе ÑлеÑÑ‚"
-
#, c-format
msgid "Updating %s..%s\n"
msgstr "ОбновÑване „%s..%s“\n"
#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+" %s"
+msgstr ""
+"Сливането ще презапише локалните промѐни на тези файлове:\n"
+" %s"
+
+#, c-format
msgid "Trying really trivial in-index merge...\n"
msgstr "Проба ÑÑŠÑ Ñливане в рамките на индекÑа…\n"
@@ -8616,6 +8900,10 @@ msgstr ""
"Ðвтоматичното Ñливане завърши уÑпешно. Самото подаване не е извършено\n"
#, c-format
+msgid "When finished, apply stashed changes with `git stash pop`\n"
+msgstr "При завършване Ñкатаните промени да Ñе приложат Ñ â€žgit stash pop“\n"
+
+#, c-format
msgid "warning: tag input does not pass fsck: %s"
msgstr "ПРЕДУПРЕЖДЕÐИЕ: аргументът-етикет не минава проверка Ñ â€žfsck“: %s"
@@ -8738,11 +9026,14 @@ msgstr "Проверка на преименуването на обект от
msgid "bad source"
msgstr "неправилен обект"
+msgid "destination exists"
+msgstr "целта ÑъщеÑтвува"
+
msgid "can not move directory into itself"
msgstr "Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð½Ðµ може да Ñе премеÑти в Ñебе Ñи"
-msgid "cannot move directory over file"
-msgstr "Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð½Ðµ може да Ñе премеÑти върху файл"
+msgid "destination already exists"
+msgstr "целта ÑъщеÑтвува"
msgid "source directory is empty"
msgstr "първоначалната Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ðµ празна"
@@ -8753,9 +9044,6 @@ msgstr "не е под контрола на Git"
msgid "conflicted"
msgstr "конфликт"
-msgid "destination exists"
-msgstr "целта ÑъщеÑтвува"
-
#, c-format
msgid "overwriting '%s'"
msgstr "презапиÑване на „%s“"
@@ -8769,6 +9057,9 @@ msgstr "множеÑтво източници за една цел"
msgid "destination directory does not exist"
msgstr "целевата Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð½Ðµ ÑъщеÑтвува"
+msgid "destination exists in the index"
+msgstr "целта ÑъщеÑтвува в индекÑа"
+
#, c-format
msgid "%s, source=%s, destination=%s"
msgstr "%s, обект: „%s“, цел: „%s“"
@@ -8823,22 +9114,26 @@ msgid "git notes [--ref <notes-ref>] [list [<object>]]"
msgstr "git notes [--ref УКÐЗÐТЕЛ_ЗÐ_БЕЛЕЖКÐ] [list [ОБЕКТ]]"
msgid ""
-"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [-m <msg> | -F <file> "
-"| (-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref УКÐЗÐТЕЛ_ЗÐ_БЕЛЕЖКÐ] add [-f] [--allow-empty] [-m СЪОБЩЕÐИЕ "
-"| -F ФÐЙЛ | (-c | -C) ОБЕКТ] [ОБЕКТ]"
+"git notes [--ref УКÐЗÐТЕЛ_ЗÐ_БЕЛЕЖКÐ] add [-f] [--allow-empty] [--"
+"[no-]separator|--separator=<paragraph-break>] [--[no-]stripspace] [-m "
+"СЪОБЩЕÐИЕ|-F ФÐЙЛ|(-c|-C) ОБЕКТ] [ОБЕКТ]"
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
msgstr ""
"git notes [--ref УКÐЗÐТЕЛ_ЗÐ_БЕЛЕЖКÐ] copy [-f] ОБЕКТ_ИЗТОЧÐИК ОБЕКТ_ЦЕЛ"
msgid ""
-"git notes [--ref <notes-ref>] append [--allow-empty] [-m <msg> | -F <file> | "
-"(-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref УКÐЗÐТЕЛ_ЗÐ_БЕЛЕЖКÐ] append [--allow-empty] [-m СЪОБЩЕÐИЕ | "
-"-F ФÐЙЛ | (-c | -C) ОБЕКТ] [ОБЕКТ]"
+"git notes [--ref УКÐЗÐТЕЛ_ЗÐ_БЕЛЕЖКÐ] append [--allow-empty] [--"
+"[no-]separator|--separator=КРÐЙ_ÐÐ_ÐБЗÐЦ] [--[no-]stripspace] [-m СЪОБЩЕÐИЕ "
+"| -F ФÐЙЛ|(-c|-C) ОБЕКТ] [ОБЕКТ]"
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
msgstr "git notes [--ref УКÐЗÐТЕЛ_ЗÐ_БЕЛЕЖКÐ] edit [--allow-empty] [ОБЕКТ]"
@@ -8849,7 +9144,7 @@ msgstr "git notes [--ref УКÐЗÐТЕЛ_ЗÐ_БЕЛЕЖКÐ] show [ОБЕКТ]
msgid ""
"git notes [--ref <notes-ref>] merge [-v | -q] [-s <strategy>] <notes-ref>"
msgstr ""
-"git notes [--ref УКÐЗÐТЕЛ_ЗÐ_БЕЛЕЖКÐ] merge [-v | -q] [-s СТРÐТЕГИЯ] "
+"git notes [--ref УКÐЗÐТЕЛ_ЗÐ_БЕЛЕЖКÐ] merge [-v|-q] [-s СТРÐТЕГИЯ] "
"УКÐЗÐТЕЛ_ЗÐ_БЕЛЕЖКÐ"
msgid "git notes [--ref <notes-ref>] remove [<object>...]"
@@ -8939,10 +9234,6 @@ msgstr ""
"Ñъдържанието на бележка не може да Ñе вземе от обект, който не е BLOB: „%s“."
#, c-format
-msgid "malformed input line: '%s'."
-msgstr "входен ред Ñ Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»ÐµÐ½ формат: „%s“."
-
-#, c-format
msgid "failed to copy notes from '%s' to '%s'"
msgstr "бележката не може да Ñе копира от „%s“ към „%s“"
@@ -8977,6 +9268,15 @@ msgstr "приемане и на празни бележки"
msgid "replace existing notes"
msgstr "замÑна на ÑъщеÑтвуващите бележки"
+msgid "<paragraph-break>"
+msgstr "КРÐЙ_ÐÐ_ÐБЗÐЦ"
+
+msgid "insert <paragraph-break> between paragraphs"
+msgstr "вмъкване на такъв КРÐЙ_ÐÐ_ÐБЗÐЦ между абзаците"
+
+msgid "remove unnecessary whitespace"
+msgstr "премахване на излишните знаци за интервали"
+
#, c-format
msgid ""
"Cannot add notes. Found existing notes for object %s. Use '-f' to overwrite "
@@ -9136,18 +9436,17 @@ msgid "use notes from <notes-ref>"
msgstr "да Ñе използва бележката Ñочена от този УКÐЗÐТЕЛ_ЗÐ_БЕЛЕЖКÐ"
#, c-format
-msgid "unknown subcommand: %s"
-msgstr "непозната подкоманда: %s"
+msgid "unknown subcommand: `%s'"
+msgstr "непозната подкоманда: „%s“"
-msgid ""
-"git pack-objects --stdout [<options>...] [< <ref-list> | < <object-list>]"
+msgid "git pack-objects --stdout [<options>] [< <ref-list> | < <object-list>]"
msgstr ""
-"git pack-objects --stdout [ОПЦИЯ…] [< СПИСЪК_С_УКÐЗÐТЕЛИ | < СПИСЪК_С_ОБЕКТИ]"
+"git pack-objects --stdout [ОПЦИЯ…] [< СПИСЪК_С_УКÐЗÐТЕЛИ|< СПИСЪК_С_ОБЕКТИ]"
msgid ""
-"git pack-objects [<options>...] <base-name> [< <ref-list> | < <object-list>]"
+"git pack-objects [<options>] <base-name> [< <ref-list> | < <object-list>]"
msgstr ""
-"git pack-objects [ОПЦИЯ…] ПРЕФИКС_ÐÐ_ИМЕТО [< СПИСЪК_С_УКÐЗÐТЕЛИ | < "
+"git pack-objects [ОПЦИЯ…] ПРЕФИКС_ÐÐ_ИМЕТО [< СПИСЪК_С_УКÐЗÐТЕЛИ|< "
"СПИСЪК_С_ОБЕКТИ]"
#, c-format
@@ -9257,6 +9556,11 @@ msgid "inconsistency with delta count"
msgstr "неправилен брой разлики"
#, c-format
+msgid "invalid pack.allowPackReuse value: '%s'"
+msgstr ""
+"неправилна ÑтойноÑÑ‚ за преизползването на пакети „pack.allowPackReuse“: „%s“"
+
+#, c-format
msgid ""
"value of uploadpack.blobpackfileuri must be of the form '<object-hash> <pack-"
"hash> <uri>' (got '%s')"
@@ -9284,13 +9588,13 @@ msgid "packfile %s cannot be accessed"
msgstr "пакетниÑÑ‚ файл „%s“ не може да бъде доÑтъпен"
msgid "Enumerating cruft objects"
-msgstr "ИзброÑване на излишните обекти"
+msgstr "ИзброÑване на ненужните обекти"
msgid "unable to add cruft objects"
-msgstr "неуÑпешно добавÑне на излишни обекти"
+msgstr "неуÑпешно добавÑне на ненужни обекти"
msgid "Traversing cruft objects"
-msgstr "Обхождане на излишните обекти"
+msgstr "Обхождане на ненужните обекти"
#, c-format
msgid ""
@@ -9310,7 +9614,7 @@ msgstr ""
msgid "could not load cruft pack .mtimes"
msgstr ""
-"времената на промÑна (.mtimes) на пакета Ñ Ð¸Ð·Ð»Ð¸ÑˆÐ½Ð¸ файлове не може да Ñе "
+"времената на промÑна (.mtimes) на пакета Ñ Ð½ÐµÐ½ÑƒÐ¶Ð½Ð¸ файлове не може да Ñе "
"заредÑÑ‚"
msgid "cannot open pack index"
@@ -9342,6 +9646,13 @@ msgstr "неподдържана верÑÐ¸Ñ Ð½Ð° индекÑа „%s“"
msgid "bad index version '%s'"
msgstr "неправилна верÑÐ¸Ñ Ð½Ð° индекÑа „%s“"
+msgid "show progress meter during object writing phase"
+msgstr "извеждане на напредъка във фазата на запазване на обектите"
+
+msgid "similar to --all-progress when progress meter is shown"
+msgstr ""
+"Ñъщото дейÑтвие като опциÑта „--all-progress“ при извеждането на напредъка"
+
msgid "<version>[,<offset>]"
msgstr "ВЕРСИЯ[,ОТМЕСТВÐÐЕ]"
@@ -9422,10 +9733,10 @@ msgid "unpack unreachable objects newer than <time>"
msgstr "разпакетиране на недоÑтижимите обекти, които Ñа по-нови от това ВРЕМЕ"
msgid "create a cruft pack"
-msgstr "Ñъздаване на пакет Ñ Ð¸Ð·Ð»Ð¸ÑˆÐ½Ð¸Ñ‚Ðµ обекти"
+msgstr "Ñъздаване на пакет Ñ Ð½ÐµÐ½ÑƒÐ¶Ð½Ð¸Ñ‚Ðµ обекти"
msgid "expire cruft objects older than <time>"
-msgstr "обÑвÑване на излишните обекти по-Ñтари от това ВРЕМЕ за оÑтарели"
+msgstr "обÑвÑване на ненужните обекти по-Ñтари от това ВРЕМЕ за оÑтарели"
msgid "use the sparse reachability algorithm"
msgstr "използване на алгоритъм за чаÑтична доÑтижимоÑÑ‚"
@@ -9503,9 +9814,6 @@ msgstr ""
"опциÑта „--thin“не може да Ñе използва за Ñъздаване на пакетни файлове Ñ "
"индекÑ"
-msgid "cannot use --filter without --stdout"
-msgstr "опциÑта „--filter“ изиÑква „--stdout“"
-
msgid "cannot use --filter with --stdin-packs"
msgstr "опциите „--filter“ и „--stdin-packs“ Ñа неÑъвмеÑтими"
@@ -9519,19 +9827,16 @@ msgstr "вътрешниÑÑ‚ ÑпиÑък на верÑии и опциÑта â€
msgid "cannot use --stdin-packs with --cruft"
msgstr "опциите „--stdin-packs“ и „--cruft“ Ñа неÑъвмеÑтими"
-msgid "cannot use --max-pack-size with --cruft"
-msgstr "опциите „--max-pack-size“ и „--cruft“ Ñа неÑъвмеÑтими"
-
msgid "Enumerating objects"
msgstr "ИзброÑване на обектите"
#, c-format
msgid ""
"Total %<PRIu32> (delta %<PRIu32>), reused %<PRIu32> (delta %<PRIu32>), pack-"
-"reused %<PRIu32>"
+"reused %<PRIu32> (from %<PRIuMAX>)"
msgstr ""
"Общо: %<PRIu32> (разлики: %<PRIu32>), преизползвани: %<PRIu32> (разлики: "
-"%<PRIu32>), преизползвани при пакетиране: %<PRIu32>"
+"%<PRIu32>), преизползвани при пакетиране: %<PRIu32> (от %<PRIuMAX>)"
msgid ""
"'git pack-redundant' is nominated for removal.\n"
@@ -9546,8 +9851,14 @@ msgstr ""
"ни извеÑтите Ñ Ðµ-пиÑмо до пощенÑÐºÐ¸Ñ ÑпиÑък:\n"
"<git@vger.kernel.org>.\n"
-msgid "git pack-refs [<options>]"
-msgstr "git pack-refs [ОПЦИЯ…]"
+msgid "refusing to run without --i-still-use-this"
+msgstr "Ñ‚Ñ€Ñбва да добавите и опциÑта „--i-still-use-this“"
+
+msgid ""
+"git pack-refs [--all] [--no-prune] [--include <pattern>] [--exclude "
+"<pattern>]"
+msgstr ""
+"git pack-refs [--all] [--no-prune] [--include ШÐБЛОÐ] [--exclude ШÐБЛОÐ]"
msgid "pack everything"
msgstr "пакетиране на вÑичко"
@@ -9555,6 +9866,24 @@ msgstr "пакетиране на вÑичко"
msgid "prune loose refs (default)"
msgstr "окаÑÑ‚Ñ€Ñне на недоÑтижимите указатели (Ñтандартно)"
+msgid "references to include"
+msgstr "кои указатели да Ñе включат"
+
+msgid "references to exclude"
+msgstr "кои указатели да Ñе преÑкочат"
+
+msgid "git patch-id [--stable | --unstable | --verbatim]"
+msgstr "git patch-id [--stable|--unstable|--verbatim]"
+
+msgid "use the unstable patch-id algorithm"
+msgstr "използване на неÑÑ‚Ð°Ð±Ð¸Ð»Ð½Ð¸Ñ Ð°Ð»Ð³Ð¾Ñ€Ð¸Ñ‚ÑŠÐ¼ за идентифициране на кръпка"
+
+msgid "use the stable patch-id algorithm"
+msgstr "използване на ÑÑ‚Ð°Ð±Ð¸Ð»Ð½Ð¸Ñ Ð°Ð»Ð³Ð¾Ñ€Ð¸Ñ‚ÑŠÐ¼ за идентифициране на кръпка"
+
+msgid "don't strip whitespace from the patch"
+msgstr "без махане на празните знаци в кръпката"
+
msgid "git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"
msgstr "git prune [-n] [-v] [--progress] [--expire ВРЕМЕ] [--] [ВРЪХ…]"
@@ -9602,6 +9931,12 @@ msgstr "принудително презапиÑване на локалниÑ
msgid "number of submodules pulled in parallel"
msgstr "брой подмодули издърпани паралелно"
+msgid "use IPv4 addresses only"
+msgstr "Ñамо адреÑи IPv4"
+
+msgid "use IPv6 addresses only"
+msgstr "Ñамо адреÑи IPv6"
+
msgid ""
"There is no candidate for rebasing against among the refs that you just "
"fetched."
@@ -9703,13 +10038,13 @@ msgstr ""
"приоритет пред наÑтройките.\n"
msgid "Updating an unborn branch with changes added to the index."
-msgstr "ОбновÑване на вÑе още неÑъздаден клон Ñ Ð¿Ñ€Ð¾Ð¼ÐµÌ€Ð½Ð¸Ñ‚Ðµ от индекÑа"
+msgstr "ОбновÑване на неродѐн клон Ñ Ð¿Ñ€Ð¾Ð¼ÐµÌ€Ð½Ð¸Ñ‚Ðµ от индекÑа"
msgid "pull with rebase"
msgstr "издърпване Ñ Ð¿Ñ€ÐµÐ±Ð°Ð·Ð¸Ñ€Ð°Ð½Ðµ"
-msgid "please commit or stash them."
-msgstr "Ñ‚Ñ€Ñбва да подадете или Ñкатаете промѐните."
+msgid "Please commit or stash them."
+msgstr "Промѐните Ñ‚Ñ€Ñбва или да Ñе подадат, или да Ñе ÑкатаÑÑ‚."
#, c-format
msgid ""
@@ -9747,7 +10082,7 @@ msgstr "Ðе може да превъртите към повече от едиÐ
msgid "Need to specify how to reconcile divergent branches."
msgstr ""
-"ТрÑбва да укажете как да Ñе решават разликите при разминаване на клоните."
+"ТрÑбва да укажете как да Ñе решават разликите при раздалечаване на клоните."
msgid "cannot rebase with locally recorded submodule modifications"
msgstr ""
@@ -9772,14 +10107,13 @@ msgstr ""
msgid ""
"\n"
-"To avoid automatically configuring upstream branches when their name\n"
-"doesn't match the local branch, see option 'simple' of branch."
-"autoSetupMerge\n"
+"To avoid automatically configuring an upstream branch when its name\n"
+"won't match the local branch, see option 'simple' of branch.autoSetupMerge\n"
"in 'git help config'.\n"
msgstr ""
"\n"
-"За да избегнете автоматичното задаване на Ñледени клони, когато името им не "
-"Ñъвпада Ñ Ñ‚Ð¾Ð²Ð° на Ð»Ð¾ÐºÐ°Ð»Ð½Ð¸Ñ ÐºÐ»Ð¾Ð½, погледнете документациÑта за ÑтойноÑтта "
+"За да избегнете автоматичното задаване на Ñледени клони, когато името им\n"
+"не Ñъвпада Ñ Ñ‚Ð¾Ð²Ð° на Ð»Ð¾ÐºÐ°Ð»Ð½Ð¸Ñ ÐºÐ»Ð¾Ð½, погледнете документациÑта за ÑтойноÑтта\n"
"„simple“ на наÑтройката „branch.autoSetupMerge“ в „git help config“.\n"
#, c-format
@@ -9868,35 +10202,37 @@ msgstr ""
msgid ""
"Updates were rejected because the tip of your current branch is behind\n"
-"its remote counterpart. Integrate the remote changes (e.g.\n"
-"'git pull ...') before pushing again.\n"
+"its remote counterpart. If you want to integrate the remote changes,\n"
+"use 'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"ОбновÑването е отхвърлено, защото върхът на Ñ‚ÐµÐºÑƒÑ‰Ð¸Ñ Ð²Ð¸ клон е преди върха "
-"на\n"
+"ОбновÑването е отхвърлено, защото върхът на Ñ‚ÐµÐºÑƒÑ‰Ð¸Ñ Ð²Ð¸ клон Ñледва върха на\n"
"Ð¾Ñ‚Ð´Ð°Ð»ÐµÑ‡ÐµÐ½Ð¸Ñ ÐºÐ»Ð¾Ð½. ВнеÑете отдалечените промѐни (напр. Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð°Ñ‚Ð° „git "
"pull…“),\n"
-"преди отново да изтлаÑкате промѐните. За повече Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð²Ð¸Ð¶Ñ‚Ðµ раздела\n"
-"„Note about fast-forwards“ в Ñтраницата от ръководÑтвото „git push --help“."
+"преди отново да изтлаÑкате промѐните.\n"
+"За повече Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð²Ð¸Ð¶Ñ‚Ðµ раздела „Note about fast-forwards“ в Ñтраницата "
+"от\n"
+"ръководÑтвото „git push --help“."
msgid ""
"Updates were rejected because a pushed branch tip is behind its remote\n"
-"counterpart. Check out this branch and integrate the remote changes\n"
-"(e.g. 'git pull ...') before pushing again.\n"
+"counterpart. If you want to integrate the remote changes, use 'git pull'\n"
+"before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"ОбновÑването е отхвърлено, защото върхът на изтлаÑÐºÐ²Ð°Ð½Ð¸Ñ ÐºÐ»Ð¾Ð½ е преди върха\n"
+"ОбновÑването е отхвърлено, защото върхът на изтлаÑÐºÐ²Ð°Ð½Ð¸Ñ ÐºÐ»Ð¾Ð½ Ñледва върха\n"
"на Ð¾Ñ‚Ð´Ð°Ð»ÐµÑ‡ÐµÐ½Ð¸Ñ ÐºÐ»Ð¾Ð½. Преминете към клона и внеÑете отдалечените промѐни "
"(напр.\n"
-"Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð°Ñ‚Ð° „git pull…“), преди отново да изтлаÑкате промѐните. За повече\n"
-"Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¿Ð¾Ð³Ð»ÐµÐ´Ð½ÐµÑ‚Ðµ раздела „Note about fast-forwards“ в Ñтраницата от\n"
+"Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð°Ñ‚Ð° „git pull…“), преди отново да изтлаÑкате промѐните.\n"
+"За повече Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð²Ð¸Ð¶Ñ‚Ðµ раздела „Note about fast-forwards“ в Ñтраницата "
+"от\n"
"ръководÑтвото „git push --help“."
msgid ""
-"Updates were rejected because the remote contains work that you do\n"
-"not have locally. This is usually caused by another repository pushing\n"
-"to the same ref. You may want to first integrate the remote changes\n"
-"(e.g., 'git pull ...') before pushing again.\n"
+"Updates were rejected because the remote contains work that you do not\n"
+"have locally. This is usually caused by another repository pushing to\n"
+"the same ref. If you want to integrate the remote changes, use\n"
+"'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"ОбновÑването е отхвърлено, защото хранилището, към което изтлаÑквате, "
@@ -9926,14 +10262,17 @@ msgstr ""
"да го променÑте да Ñочи към подобен обект.\n"
msgid ""
-"Updates were rejected because the tip of the remote-tracking\n"
-"branch has been updated since the last checkout. You may want\n"
-"to integrate those changes locally (e.g., 'git pull ...')\n"
-"before forcing an update.\n"
+"Updates were rejected because the tip of the remote-tracking branch has\n"
+"been updated since the last checkout. If you want to integrate the\n"
+"remote changes, use 'git pull' before pushing again.\n"
+"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"ОбновÑването е отхвърлено, защото върхът на ÑледÑÑ‰Ð¸Ñ ÐºÐ»Ð¾Ð½ е обновÑван Ñлед\n"
-"поÑледното изтеглÑне. ВнеÑете отдалечените промѐни (напр. Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð°Ñ‚Ð°\n"
-"„git pull…“), преди отново принудително да изтлаÑкате промѐните.\n"
+"ОбновÑването е отхвърлено, защото върхът на Ð¾Ñ‚Ð´Ð°Ð»ÐµÑ‡ÐµÐ½Ð¸Ñ ÐºÐ»Ð¾Ð½ Ñъдържа "
+"промени\n"
+"Ñлед поÑледното изтеглÑне. ВнеÑете отдалечените промѐни (напр. Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð°Ñ‚Ð°\n"
+"„git pull…“), преди отново да изтлаÑкате промѐните.\n"
+"За повече Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð²Ð¸Ð¶Ñ‚Ðµ раздела „Note about fast-forwards“ в Ñтраницата\n"
+"от ръководÑтвото „git push --help“."
#, c-format
msgid "Pushing to %s\n"
@@ -9943,6 +10282,13 @@ msgstr "ИзтлаÑкване към „%s“\n"
msgid "failed to push some refs to '%s'"
msgstr "чаÑÑ‚ от указателите не бÑха изтлаÑкани към „%s“"
+msgid ""
+"recursing into submodule with push.recurseSubmodules=only; using on-demand "
+"instead"
+msgstr ""
+"рекурÑивно обхождане на подмодулите чрез „push.recurseSubmodules=only“. "
+"ВмеÑто това Ñе ползва ПРИ ÐУЖДÐ"
+
#, c-format
msgid "invalid value for '%s'"
msgstr "Ðеправилна ÑтойноÑÑ‚ за „%s“"
@@ -9950,8 +10296,8 @@ msgstr "Ðеправилна ÑтойноÑÑ‚ за „%s“"
msgid "repository"
msgstr "хранилище"
-msgid "push all refs"
-msgstr "изтлаÑкване на вÑички указатели"
+msgid "push all branches"
+msgstr "изтлаÑкване на вÑички клони"
msgid "mirror all refs"
msgstr "огледално копие на вÑички указатели"
@@ -9959,8 +10305,10 @@ msgstr "огледално копие на вÑички указатели"
msgid "delete refs"
msgstr "изтриване на указателите"
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "изтлаÑкване на етикетите (неÑъвмеÑтимо Ñ Ð¾Ð¿Ñ†Ð¸Ð¸Ñ‚Ðµ „--all“ и „--mirror“)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr ""
+"изтлаÑкване на етикетите (неÑъвмеÑтимо Ñ Ð¾Ð¿Ñ†Ð¸Ð¸Ñ‚Ðµ „--all“, „--branches“ и „--"
+"mirror“)"
msgid "force updates"
msgstr "принудително обновÑване"
@@ -10066,23 +10414,30 @@ msgid "only emit output related to the second range"
msgstr "извеждане Ñамо на информациÑта за Ð²Ñ‚Ð¾Ñ€Ð¸Ñ Ð´Ð¸Ð°Ð¿Ð°Ð·Ð¾Ð½"
#, c-format
+msgid "not a revision: '%s'"
+msgstr "„%s“ не е верÑиÑ"
+
+#, c-format
msgid "not a commit range: '%s'"
msgstr "не е диапазон Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ: „%s“"
-msgid "single arg format must be symmetric range"
-msgstr "вариантът Ñ ÐµÐ´Ð¸Ð½Ñтвен аргумент изиÑква Ñиметричен диапазон"
+#, c-format
+msgid "not a symmetric range: '%s'"
+msgstr "не е Ñиметричен диапазон: „%s“"
msgid "need two commit ranges"
msgstr "необходими Ñа два диапазона Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ"
msgid ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>) "
-"[-u | -i]] [--no-sparse-checkout] [--index-output=<file>] (--empty | <tree-"
-"ish1> [<tree-ish2> [<tree-ish3>]])"
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<prefix>)\n"
+" [-u | -i]] [--index-output=<file>] [--no-sparse-checkout]\n"
+" (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"
msgstr ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=ПРЕФИКС) "
-"[-u | -i]] [--no-sparse-checkout] [--index-output=ФÐЙЛ] (--empty | "
-"УКÐЗÐТЕЛ_КЪМ_ДЪРВО_1 [УКÐЗÐТЕЛ_КЪМ_ДЪРВО_2 [УКÐЗÐТЕЛ_КЪМ_ДЪРВО_3]])"
+"git read-tree [(-m [--trivial] [--aggressive]|--reset|--prefix=ПРЕФИКС)\n"
+" [-u|-i]] [--index-output=ФÐЙЛ] [--no-sparse-checkout]\n"
+" (--empty|УКÐЗÐТЕЛ_КЪМ_ДЪРВО_1 [УКÐЗÐТЕЛ_КЪМ_ДЪРВО_2 "
+"[УКÐЗÐТЕЛ_КЪМ_ДЪРВО_3]])"
msgid "write resulting index to <file>"
msgstr "запазване на индекÑа в този ФÐЙЛ"
@@ -10142,7 +10497,7 @@ msgid ""
"git rebase [-i] [options] [--exec <cmd>] [--onto <newbase> | --keep-base] "
"[<upstream> [<branch>]]"
msgstr ""
-"git rebase [-i] [ОПЦИЯ…] [--exec КОМÐÐДÐ] [--onto ÐОВÐ_БÐЗР| --keep-base] "
+"git rebase [-i] [ОПЦИЯ…] [--exec КОМÐÐДÐ] [--onto ÐОВÐ_БÐЗÐ|--keep-base] "
"[КЛОÐ_ИЗТОЧÐИК [КЛОÐ]]"
msgid ""
@@ -10172,8 +10527,8 @@ msgid "%s requires the merge backend"
msgstr "„%s“ изиÑква пребазиране"
#, c-format
-msgid "could not get 'onto': '%s'"
-msgstr "не може да Ñе премине към новата база, зададена Ñ â€žonto“: „%s“"
+msgid "invalid onto: '%s'"
+msgstr "неправилен указател върху какво да Ñе пребазира: „%s“"
#, c-format
msgid "invalid orig-head: '%s'"
@@ -10218,17 +10573,33 @@ msgstr ""
"Ð’ резултат те не може да Ñе пребазират."
#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "Ðеправилен режим за „--rebase-merges“: %s"
+
+#, c-format
msgid "could not switch to %s"
msgstr "не може да Ñе премине към „%s“"
+msgid "apply options and merge options cannot be used together"
+msgstr "опциите за прилагане и Ñливане Ñа неÑъвмеÑтими"
+
#, c-format
msgid ""
-"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and \"ask"
-"\"."
+"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and "
+"\"ask\"."
msgstr ""
"неправилна ÑтойноÑÑ‚ „%s“: вариантите Ñа „drop“ (преÑкачане), "
"„keep“ (запазване) и „ask“ (питане)"
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"ползването на „--rebase-merges“ Ñ Ð¿Ñ€Ð°Ð·ÐµÐ½ низ за аргумент е оÑтарÑло и в "
+"бъдеще ще Ñпре да работи. Ползвайте опциÑта „--rebase-merges“ без аргумент, "
+"за да поÑтигнете ÑÑŠÑ‰Ð¸Ñ Ñ€ÐµÐ·ÑƒÐ»Ñ‚Ð°Ñ‚."
+
#, c-format
msgid ""
"%s\n"
@@ -10344,6 +10715,9 @@ msgid "move commits that begin with squash!/fixup! under -i"
msgstr ""
"премеÑтване на подаваниÑта, които започват ÑÑŠÑ â€žsquash!“/“fixup!“ при „-i“"
+msgid "update branches that point to commits that are being rebased"
+msgstr "обновÑване на клоните, които Ñочат към пребазирани подаваниÑ"
+
msgid "add exec lines after each commit of the editable list"
msgstr ""
"добавÑне на редове Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¸ за изпълнение Ñлед вÑÑко подаване в "
@@ -10455,16 +10829,19 @@ msgstr ""
msgid "switch `C' expects a numerical value"
msgstr "опциÑта „C“ очаква чиÑло за аргумент"
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "ÐеизвеÑтна ÑтратегиÑ: „%s“"
-
-msgid "--strategy requires --merge or --interactive"
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges. Consider adding --"
+"no-rebase-merges"
msgstr ""
-"опциÑта „--strategy“ изиÑква нÑÐºÐ¾Ñ Ð¾Ñ‚ опциите „--merge“ или „--interactive“"
+"опциите за прилагане Ñа неÑъвмеÑтими Ñ â€žrebase.rebaseMerges“. Пробвайте да "
+"добавите опциÑта „--no-rebase-merges“"
-msgid "apply options and merge options cannot be used together"
-msgstr "опциите за прилагане и Ñливане Ñа неÑъвмеÑтими"
+msgid ""
+"apply options are incompatible with rebase.updateRefs. Consider adding --no-"
+"update-refs"
+msgstr ""
+"опциите за прилагане Ñа неÑъвмеÑтими Ñ â€žrebase.updateRefs“. Пробвайте да "
+"добавите опциÑта „--no-update-refs“"
#, c-format
msgid "Unknown rebase backend: %s"
@@ -10490,7 +10867,7 @@ msgstr "не ÑъщеÑтвува клон/подаване „%s“"
msgid "No such ref: %s"
msgstr "Такъв указател нÑма: %s"
-msgid "Could not resolve HEAD to a revision"
+msgid "Could not resolve HEAD to a commit"
msgstr "Подаването, Ñочено от ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ â€žHEAD“, не може да бъде открито"
#, c-format
@@ -10505,9 +10882,6 @@ msgstr "„%s“: изиÑква Ñе точно една база за преб
msgid "Does not point to a valid commit '%s'"
msgstr "УказателÑÑ‚ „%s“ не Ñочи към подаване"
-msgid "Please commit or stash them."
-msgstr "Промѐните Ñ‚Ñ€Ñбва или да Ñе подадат, или да Ñе ÑкатаÑÑ‚."
-
msgid "HEAD is up to date."
msgstr "УказателÑÑ‚ „HEAD“ е напълно актуален."
@@ -10618,7 +10992,7 @@ msgid ""
msgstr ""
"git reflog expire [--expire=ВРЕМЕ] [--expire-unreachable=ВРЕМЕ]\n"
" [--rewrite] [--updateref] [--stale-fix]\n"
-" [--dry-run | -n] [--verbose] [--all [--single-worktree] | "
+" [--dry-run|-n] [--verbose] [--all [--single-worktree]|"
"УКÐЗÐТЕЛ…]"
msgid ""
@@ -10626,7 +11000,7 @@ msgid ""
" [--dry-run | -n] [--verbose] <ref>@{<specifier>}..."
msgstr ""
"git reflog delete [--rewrite] [--updateref]\n"
-" [--dry-run | -n] [--verbose] УКÐЗÐТЕЛ@{УТОЧÐЕÐИЕ}…"
+" [--dry-run|-n] [--verbose] УКÐЗÐТЕЛ@{УТОЧÐЕÐИЕ}…"
msgid "git reflog exists <ref>"
msgstr "git reflog exists УКÐЗÐТЕЛ"
@@ -10694,7 +11068,7 @@ msgid ""
"git remote add [-t <branch>] [-m <master>] [-f] [--tags | --no-tags] [--"
"mirror=<fetch|push>] <name> <url>"
msgstr ""
-"git remote add [-t КЛОÐ] [-m ОСÐОВЕÐ_КЛОÐ] [-f] [--tags | --no-tags] [--"
+"git remote add [-t КЛОÐ] [-m ОСÐОВЕÐ_КЛОÐ] [-f] [--tags|--no-tags] [--"
"mirror=<fetch|push>] ИМЕ ÐДРЕС"
msgid "git remote rename [--[no-]progress] <old> <new>"
@@ -10704,19 +11078,18 @@ msgid "git remote remove <name>"
msgstr "git remote remove ИМЕ"
msgid "git remote set-head <name> (-a | --auto | -d | --delete | <branch>)"
-msgstr "git remote set-head ИМЕ (-a | --auto | -d | --delete | КЛОÐ)"
+msgstr "git remote set-head ИМЕ (-a|--auto|-d|--delete|КЛОÐ)"
msgid "git remote [-v | --verbose] show [-n] <name>"
-msgstr "git remote [-v | --verbose] show [-n] ИМЕ"
+msgstr "git remote [-v|--verbose] show [-n] ИМЕ"
msgid "git remote prune [-n | --dry-run] <name>"
-msgstr "git remote prune [-n | --dry-run] ИМЕ"
+msgstr "git remote prune [-n|--dry-run] ИМЕ"
msgid ""
"git remote [-v | --verbose] update [-p | --prune] [(<group> | <remote>)...]"
msgstr ""
-"git remote [-v | --verbose] update [-p | --prune] [(ГРУПР| "
-"ОТДÐЛЕЧЕÐО_ХРÐÐИЛИЩЕ)…]"
+"git remote [-v|--verbose] update [-p|--prune] [(ГРУПÐ|ОТДÐЛЕЧЕÐО_ХРÐÐИЛИЩЕ)…]"
msgid "git remote set-branches [--add] <name> <branch>..."
msgstr "git remote set-branches [--add] ИМЕ КЛОÐ…"
@@ -10749,7 +11122,7 @@ msgid "git remote prune [<options>] <name>"
msgstr "git remote prune [ОПЦИЯ…] ИМЕ"
msgid "git remote update [<options>] [<group> | <remote>]..."
-msgstr "git remote update [ОПЦИЯ…] [ГРУПР| ОТДÐЛЕЧЕÐО_ХРÐÐИЛИЩЕ…]"
+msgstr "git remote update [ОПЦИЯ…] [ГРУПÐ|ОТДÐЛЕЧЕÐО_ХРÐÐИЛИЩЕ…]"
#, c-format
msgid "Updating %s"
@@ -10773,11 +11146,12 @@ msgstr "неправилна ÑтойноÑÑ‚ за „--mirror“: %s"
msgid "fetch the remote branches"
msgstr "отдалечените клони не може да бъдат доÑтавени"
-msgid "import all tags and associated objects when fetching"
-msgstr "внаÑÑне на вÑички етикети и принадлежащите им обекти при доÑтавÑне"
-
-msgid "or do not fetch any tag at all (--no-tags)"
-msgstr "може и да не Ñе доÑтавÑÑ‚ никакви етикети (чрез опциÑта „--no-tags“)"
+msgid ""
+"import all tags and associated objects when fetching\n"
+"or do not fetch any tag at all (--no-tags)"
+msgstr ""
+"внаÑÑне на вÑички етикети и принадлежащите им обекти при доÑтавÑне\n"
+"или да не Ñе доÑтавÑÑ‚ никакви етикети (чрез опциÑта „--no-tags“)"
msgid "branch(es) to track"
msgstr "клон/и за Ñледене"
@@ -10895,6 +11269,9 @@ msgstr " нов (Ñледващото доÑтавÑне ще го разполÐ
msgid " tracked"
msgstr " Ñледен"
+msgid " skipped"
+msgstr " преÑкочен"
+
msgid " stale (use 'git remote prune' to remove)"
msgstr " Ñтар (изтрийте чрез „git remote prune“)"
@@ -11169,6 +11546,14 @@ msgstr "временниÑÑ‚ файл „%s“ не може да бъде отÐ
msgid "could not close refs snapshot tempfile"
msgstr "временниÑÑ‚ файл ÑÑŠÑ Ñнимка на указателите не може да Ñе затвори"
+#, c-format
+msgid "could not remove stale bitmap: %s"
+msgstr "изтриването на оÑтарÑлата битова маÑка „%s“ е невъзможно"
+
+#, c-format
+msgid "pack prefix %s does not begin with objdir %s"
+msgstr "името на Ð¿Ð°ÐºÐµÑ‚Ð½Ð¸Ñ Ñ„Ð°Ð¹Ð» „%s“ не започва Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñта за обекти Ñ â€ž%s“"
+
msgid "pack everything in a single pack"
msgstr "пакетиране на вÑичко в пакет"
@@ -11179,15 +11564,15 @@ msgstr ""
msgid "same as -a, pack unreachable cruft objects separately"
msgstr ""
-"Ñъщото като опциÑта „-a“. ÐедоÑтижимите излишни обекти да Ñе пакетират "
+"Ñъщото като опциÑта „-a“. ÐедоÑтижимите ненужни обекти да Ñе пакетират "
"отделно"
msgid "approxidate"
msgstr "евриÑтична дата"
-msgid "with -C, expire objects older than this"
+msgid "with --cruft, expire objects older than this"
msgstr ""
-"Ñ Ð¾Ð¿Ñ†Ð¸Ñта „-C“: обÑвÑване на обектите по-Ñтари от това ВРЕМЕ за оÑтарели"
+"Ñ Ð¾Ð¿Ñ†Ð¸Ñта „--cruft“: обÑвÑване на обектите по-Ñтари от това ВРЕМЕ за оÑтарели"
msgid "remove redundant packs, and run git-prune-packed"
msgstr ""
@@ -11253,19 +11638,29 @@ msgstr "откриване на геометрична прогреÑÐ¸Ñ Ñ Ñ‡Ð
msgid "write a multi-pack index of the resulting packs"
msgstr "запазване на многопакетен Ð¸Ð½Ð´ÐµÐºÑ Ð·Ð° Ñъздадените пакети"
+msgid "pack prefix to store a pack containing pruned objects"
+msgstr "Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ Ð½Ð° имената на пакетите за окаÑтрени обекти"
+
+msgid "pack prefix to store a pack containing filtered out objects"
+msgstr "Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ Ð½Ð° имената на пакетите за филтрирани обекти"
+
msgid "cannot delete packs in a precious-objects repo"
msgstr "пакетите в хранилище Ñ Ð²Ð°Ð¶Ð½Ð¸ обекти не може да Ñе триÑÑ‚"
+#, c-format
+msgid "option '%s' can only be used along with '%s'"
+msgstr "опциÑта „%s“ изиÑква „%s“"
+
msgid "Nothing new to pack."
msgstr "Ðищо ново за пакетиране"
#, c-format
-msgid "pack prefix %s does not begin with objdir %s"
-msgstr "името на Ð¿Ð°ÐºÐµÑ‚Ð½Ð¸Ñ Ñ„Ð°Ð¹Ð» „%s“ не започва Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñта за обекти Ñ â€ž%s“"
+msgid "renaming pack to '%s' failed"
+msgstr "неуÑпешно преименуване на Ð¿Ð°ÐºÐµÑ‚Ð½Ð¸Ñ Ñ„Ð°Ð¹Ð» на „%s“"
#, c-format
-msgid "missing required file: %s"
-msgstr "липÑва Ð·Ð°Ð´ÑŠÐ»Ð¶Ð¸Ñ‚ÐµÐ»Ð½Ð¸Ñ Ñ„Ð°Ð¹Ð» „%s“"
+msgid "pack-objects did not write a '%s' file for pack %s-%s"
+msgstr "Командата „git pack-objects“ не запиÑа файл „%s“ за пакета „%s-%s“"
#, c-format
msgid "could not unlink: %s"
@@ -11459,8 +11854,79 @@ msgstr "опциÑта „--convert-graft-file“ не приема аргуме
msgid "only one pattern can be given with -l"
msgstr "опциÑта „-l“ приема точно един шаблон"
-msgid "git rerere [clear | forget <path>... | status | remaining | diff | gc]"
-msgstr "git rerere [clear | forget ПЪТ… | status | remaining | diff | gc]"
+msgid "need some commits to replay"
+msgstr "необходимо е да има Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ Ð·Ð° прилагане отново"
+
+msgid "--onto and --advance are incompatible"
+msgstr "опциите „--onto“ и „--advance“ Ñа неÑъвмеÑтими"
+
+msgid "all positive revisions given must be references"
+msgstr "вÑички зададени положителни верÑии Ñ‚Ñ€Ñбва да Ñа указатели"
+
+msgid "argument to --advance must be a reference"
+msgstr "аргументът към „--advance“ Ñ‚Ñ€Ñбва да е указател"
+
+msgid ""
+"cannot advance target with multiple sources because ordering would be ill-"
+"defined"
+msgstr ""
+"цели Ñ Ð¼Ð½Ð¾Ð¶ÐµÑтво източници не може да Ñе придвижат напред, защото подредбата "
+"не е добре дефинирана"
+
+msgid ""
+"cannot implicitly determine whether this is an --advance or --onto operation"
+msgstr ""
+"не може да Ñе определи дали това дейÑтвие е за „--advance“ или „--onto“"
+
+msgid ""
+"cannot advance target with multiple source branches because ordering would "
+"be ill-defined"
+msgstr ""
+"цели Ñ Ð¼Ð½Ð¾Ð¶ÐµÑтво клони-източници не може да Ñе придвижат напред, защото "
+"подредбата не е добре дефинирана"
+
+msgid "cannot implicitly determine correct base for --onto"
+msgstr "правилната база за „--onto“ не може да Ñе определи"
+
+msgid ""
+"(EXPERIMENTAL!) git replay ([--contained] --onto <newbase> | --advance "
+"<branch>) <revision-range>..."
+msgstr ""
+"(ЕКСПЕРИМЕÐТÐЛÐО!) git replay ([--contained] --onto ÐОВÐ_БÐЗР| --advance "
+"КЛОÐ) ДИÐПÐЗОÐ_ПОДÐÐ’ÐÐИЯ…"
+
+msgid "make replay advance given branch"
+msgstr "прилагането наново придвижва Ð´Ð°Ð´ÐµÐ½Ð¸Ñ ÐšÐ›ÐžÐ Ð½Ð°Ð¿Ñ€ÐµÐ´"
+
+msgid "replay onto given commit"
+msgstr "прилагането наново върху даденото ПОДÐÐ’ÐÐЕ"
+
+msgid "advance all branches contained in revision-range"
+msgstr "придвижване на вÑички КЛОÐи в ДИÐПÐЗОÐа_ПОДÐÐ’ÐÐИЯ"
+
+msgid "option --onto or --advance is mandatory"
+msgstr "изиÑква Ñе нÑÐºÐ¾Ñ Ð¾Ñ‚ опциите „--onto“ или „--advance“"
+
+#, c-format
+msgid ""
+"some rev walking options will be overridden as '%s' bit in 'struct rev_info' "
+"will be forced"
+msgstr ""
+"нÑкои опции за проÑледÑване на указатели ще бъдат променени, защото битът "
+"„%s“ в Ñтруктурата „struct rev_info“ има превеÑ"
+
+msgid "error preparing revisions"
+msgstr "грешка при подготовката на верÑии"
+
+msgid "replaying down to root commit is not supported yet!"
+msgstr "не Ñе поддържа прилагане наново и на началното подаване!"
+
+msgid "replaying merge commits is not supported yet!"
+msgstr "не Ñе поддържа прилагане наново и на Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ ÑÑŠÑ Ñливане!"
+
+msgid ""
+"git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]"
+msgstr "git rerere [clear|forget ПЪТ…|diff|status|remaining|gc]"
msgid "register clean resolutions in index"
msgstr "региÑтриране на чиÑти корекции на конфликти в индекÑа"
@@ -11474,8 +11940,7 @@ msgstr "неуÑпешно генериране на разлика за „%sâ€
msgid ""
"git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]"
-msgstr ""
-"git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [ПОДÐÐ’ÐÐЕ]"
+msgstr "git reset [--mixed|--soft|--hard|--merge|--keep] [-q] [ПОДÐÐ’ÐÐЕ]"
msgid "git reset [-q] [<tree-ish>] [--] <pathspec>..."
msgstr "git reset [-q] [УКÐЗÐТЕЛ_КЪМ_ДЪРВО] [--] ПЪТИЩÐ…"
@@ -11587,6 +12052,10 @@ msgstr "ÐовиÑÑ‚ Ð¸Ð½Ð´ÐµÐºÑ Ð½Ðµ може да бъде запиÑан."
msgid "unable to get disk usage of %s"
msgstr "използваното мÑÑто за „%s“ не може да бъде получено"
+#, c-format
+msgid "invalid value for '%s': '%s', the only allowed format is '%s'"
+msgstr "неправилна ÑтойноÑÑ‚ за „%s“: „%s“, единÑтвениÑÑ‚ позволен формат е „%s“"
+
msgid "rev-list does not support display of notes"
msgstr "командата „rev-list“ не поддържа извеждането на бележки"
@@ -11612,6 +12081,9 @@ msgstr "неочакван край на входа"
msgid "no usage string given before the `--' separator"
msgstr "липÑва низ преди Ñ€Ð°Ð·Ð´ÐµÐ»Ð¸Ñ‚ÐµÐ»Ñ â€ž--“"
+msgid "missing opt-spec before option flags"
+msgstr "липÑват опции пред флаговете за опции"
+
msgid "Needed a single revision"
msgstr "ИзиÑква точно една верÑиÑ"
@@ -11662,21 +12134,32 @@ msgstr "непознат режим за „--abbrev-ref“: „%s“"
msgid "this operation must be run in a work tree"
msgstr "тази команда Ñ‚Ñ€Ñбва да Ñе изпълни в работно дърво"
+msgid "Could not read the index"
+msgstr "ИндекÑÑŠÑ‚ не може да бъде прочетен"
+
#, c-format
msgid "unknown mode for --show-object-format: %s"
msgstr "непознат режим за „--show-object-format“: „%s“"
-msgid "git revert [<options>] <commit-ish>..."
-msgstr "git revert [ОПЦИЯ…] УКÐЗÐТЕЛ_КЪМ_ПОДÐÐ’ÐÐЕ…"
+msgid ""
+"git revert [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] "
+"<commit>..."
+msgstr ""
+"git revert [--[no-]edit] [-n] [-m ÐОМЕР_ÐÐ_РОДИТЕЛ] [-s]\n"
+" [-S[ИДЕÐТИФИКÐТОР_ÐÐ_КЛЮЧ]] ПОДÐÐ’ÐÐЕ…"
-msgid "git revert <subcommand>"
-msgstr "git revert ПОДКОМÐÐДÐ"
+msgid "git revert (--continue | --skip | --abort | --quit)"
+msgstr "git revert (--continue|--skip|--abort|--quit)"
-msgid "git cherry-pick [<options>] <commit-ish>..."
-msgstr "git cherry-pick [ОПЦИЯ…] УКÐЗÐТЕЛ_КЪМ_ПОДÐÐ’ÐÐЕ…"
+msgid ""
+"git cherry-pick [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff]\n"
+" [-S[<keyid>]] <commit>..."
+msgstr ""
+"git cherry-pick [--edit] [-n] [-m ÐОМЕР_ÐÐ_РОДИТЕЛ] [-s] [-x] [--ff]\n"
+" [-S[ИДЕÐТИФИКÐТОР_ÐÐ_КЛЮЧ]] ПОДÐÐ’ÐÐЕ…"
-msgid "git cherry-pick <subcommand>"
-msgstr "git cherry-pick ПОДКОМÐÐДÐ"
+msgid "git cherry-pick (--continue | --skip | --abort | --quit)"
+msgstr "git cherry-pick (--continue|--skip|--abort|--quit)"
#, c-format
msgid "option `%s' expects a number greater than zero"
@@ -11705,7 +12188,7 @@ msgid "edit the commit message"
msgstr "редактиране на Ñъобщението при подаване"
msgid "parent-number"
-msgstr "номер на родителÑ"
+msgstr "номер на родител"
msgid "select mainline parent"
msgstr "избор на оÑÐ½Ð¾Ð²Ð½Ð¸Ñ Ñ€Ð¾Ð´Ð¸Ñ‚ÐµÐ»"
@@ -11737,8 +12220,14 @@ msgstr "неуÑпешна отмÑна"
msgid "cherry-pick failed"
msgstr "неуÑпешно отбиране"
-msgid "git rm [<options>] [--] <file>..."
-msgstr "git rm [ОПЦИЯ…] [--] ФÐЙЛ…"
+msgid ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git rm [-f|--force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=ФÐЙЛ [--pathspec-file-nul]]\n"
+" [--] [ПЪТ…]"
msgid ""
"the following file has staged content different from both the\n"
@@ -11817,16 +12306,21 @@ msgid ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
" [<host>:]<directory> (--all | <ref>...)"
msgstr ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=ПÐКЕТ]\n"
" [--verbose] [--thin] [--atomic]\n"
-" [ХОСТ:]ДИРЕКТОРИЯ (--all | УКÐЗÐТЕЛ…])"
+" [--[no-]signed|--signed=(true|false|if-asked)]\n"
+" [ХОСТ:]ДИРЕКТОРИЯ (--all|УКÐЗÐТЕЛ…)"
msgid "remote name"
msgstr "име на отдалечено хранилище"
+msgid "push all refs"
+msgstr "изтлаÑкване на вÑички указатели"
+
msgid "use stateless RPC protocol"
msgstr "използване на протокол без запазване на ÑÑŠÑтоÑнието за RPC"
@@ -11845,8 +12339,9 @@ msgstr "git log --pretty=short | git shortlog [ОПЦИЯ…]"
msgid "using multiple --group options with stdin is not supported"
msgstr "повече от една опции „--group“ Ñа неÑъвмеÑтими ÑÑŠÑ ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ Ð²Ñ…Ð¾Ð´"
-msgid "using --group=trailer with stdin is not supported"
-msgstr "опциÑта „--group=trailer“ е неÑъвмеÑтима ÑÑŠÑ ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ Ð²Ñ…Ð¾Ð´"
+#, c-format
+msgid "using %s with stdin is not supported"
+msgstr "„%s“ не поддържа ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ Ð²Ñ…Ð¾Ð´"
#, c-format
msgid "unknown group type: %s"
@@ -11883,15 +12378,17 @@ msgid ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
" [--current] [--color[=<when>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<rev> | <glob>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<rev> | <glob>)...]"
msgstr ""
-"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
-" [--current] [--color[=КОГÐ] | --no-color] [--sparse]\n"
-" [--more=БРОЙ | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(РЕВИЗИЯ | УКÐЗÐТЕЛ)…]"
+"git show-branch [-a|--all] [-r|--remotes] [--topo-order|--date-order]\n"
+" [--current] [--color[=КОГÐ]|--no-color] [--sparse]\n"
+" [--more=<n>|--list|--independent|--merge-base]\n"
+" [--no-name|--sha1-name] [--topics]\n"
+" [(РЕВИЗИЯ|УКÐЗÐТЕЛ)…]"
msgid "git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]"
-msgstr "git show-branch (-g | --reflog)[=БРОЙ[,БÐЗÐ]] [--list] [УКÐЗÐТЕЛ]"
+msgstr "git show-branch (-g|--reflog)[=БРОЙ[,БÐЗÐ]] [--list] [УКÐЗÐТЕЛ]"
#, c-format
msgid "ignoring %s; cannot handle more than %d ref"
@@ -11934,7 +12431,7 @@ msgid "show refs unreachable from any other ref"
msgstr "извеждане на недоÑтижимите указатели"
msgid "show commits in topological order"
-msgstr "извеждане на подаваниÑта в топологичеÑка подредба"
+msgstr "извеждане на подаваниÑта в топологична подредба"
msgid "show only commits not on the first branch"
msgstr "извеждане Ñамо на подаваниÑта, които не Ñа от Ð¿ÑŠÑ€Ð²Ð¸Ñ ÐºÐ»Ð¾Ð½"
@@ -11944,7 +12441,7 @@ msgstr "извеждане на ÑливаниÑта, които може да Ñ
msgid "topologically sort, maintaining date order where possible"
msgstr ""
-"топологичеÑка подредба, при запазване на подредбата по дата, доколкото е\n"
+"топологична подредба, при запазване на подредбата по дата, доколкото е\n"
"възможно"
msgid "<n>[,<base>]"
@@ -11990,23 +12487,46 @@ msgid "Unknown hash algorithm"
msgstr "Ðепознат алгоритъм за контролни Ñуми"
msgid ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...]"
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<pattern>...]"
msgstr ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=ЧИСЛО]] [--abbrev[=ЧИСЛО]] [--tags] [--heads] [--] [ШÐБЛОÐ…]"
+"git show-ref [--head] [-d|--dereference]\n"
+" [-s|--hash[=БРОЙ]] [--abbrev[=БРОЙ]] [--tags]\n"
+" [--heads] [--] [ШÐБЛОÐ…]"
+
+msgid ""
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<ref>...]"
+msgstr ""
+"git show-ref --verify [-q|--quiet] [-d|--dereference]\n"
+" [-s|--hash[=БРОЙ]] [--abbrev[=БРОЙ]]\n"
+" [--] [ШÐБЛОÐ…]"
msgid "git show-ref --exclude-existing[=<pattern>]"
msgstr "git show-ref --exclude-existing[=ШÐБЛОÐ]"
+msgid "git show-ref --exists <ref>"
+msgstr "git show-ref --exists УКÐЗÐТЕЛ"
+
+msgid "reference does not exist"
+msgstr "указателÑÑ‚ не ÑъщеÑтвува"
+
+msgid "failed to look up reference"
+msgstr "Ñоченото от ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ Ð»Ð¸Ð¿Ñва"
+
msgid "only show tags (can be combined with heads)"
msgstr "извеждане на етикетите (може да Ñе комбинира Ñ Ð²ÑŠÑ€Ñ…Ð¾Ð²ÐµÑ‚Ðµ)"
msgid "only show heads (can be combined with tags)"
msgstr "извеждане на върховете (може да Ñе комбинира Ñ ÐµÑ‚Ð¸ÐºÐµÑ‚Ð¸Ñ‚Ðµ)"
+msgid "check for reference existence without resolving"
+msgstr "проверка за ÑъщеÑтвуване на указател без проÑледÑването му"
+
msgid "stricter reference checking, requires exact ref path"
-msgstr "Ñтрога проверка на указателите, изиÑква Ñе указател Ñ Ð¿ÑŠÐ»ÐµÐ½ път"
+msgstr "по-Ñтрога проверка за указатели, изиÑква точен път на указател"
msgid "show the HEAD reference, even if it would be filtered out"
msgstr "задължително извеждане и на ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ HEAD"
@@ -12027,8 +12547,11 @@ msgstr ""
"извеждане на указателите приети от ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ Ð²Ñ…Ð¾Ð´, които липÑват в "
"локалното хранилище"
-msgid "git sparse-checkout (init|list|set|add|reapply|disable) <options>"
-msgstr "git sparse-checkout (init|list|set|add|reapply|disable) ОПЦИЯ…"
+msgid ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
+msgstr ""
+"git sparse-checkout (init|list|set|add|reapply|disable|check-rules) ОПЦИЯ…"
msgid "this worktree is not sparse"
msgstr "това работно дърво не е чаÑтично"
@@ -12125,7 +12648,7 @@ msgstr ""
"ръководÑтвото на командата „git-sparse-checkout“)."
msgid "git sparse-checkout add [--skip-checks] (--stdin | <patterns>)"
-msgstr "git sparse-checkout add [--skip-checks] (--stdin | ШÐБЛОÐ…)"
+msgstr "git sparse-checkout add [--skip-checks] (--stdin|ШÐБЛОÐ…)"
msgid ""
"skip some sanity checks on the given paths that might give false positives"
@@ -12144,7 +12667,7 @@ msgid ""
"(--stdin | <patterns>)"
msgstr ""
"git sparse-checkout set [--[no-]cone] [--[no-]sparse-index] [--skip-checks] "
-"(--stdin | ШÐБЛОÐ…)"
+"(--stdin|ШÐБЛОÐ…)"
msgid "must be in a sparse-checkout to reapply sparsity patterns"
msgstr ""
@@ -12154,67 +12677,74 @@ msgstr ""
msgid "error while refreshing working directory"
msgstr "грешка при обновÑване на работната директориÑ"
-msgid "git stash list [<options>]"
-msgstr "git stash list [ОПЦИЯ…]"
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks] [--[no-]cone] [--rules-"
+"file ФÐЙЛ]"
-msgid "git stash show [<options>] [<stash>]"
-msgstr "git stash show [ОПЦИЯ…] [СКÐТÐÐО]"
+msgid "terminate input and output files by a NUL character"
+msgstr "разделÑне на входните и изходните файлове Ñ Ð½ÑƒÐ»ÐµÐ²Ð¸Ñ Ð·Ð½Ð°Ðº „NUL“"
-msgid "git stash drop [-q|--quiet] [<stash>]"
-msgstr "git stash drop [-q|--quiet] [СКÐТÐÐО]"
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
+"когато е придружено Ñ â€ž--rules-file“ шаблоните Ñе третират като шаблони в "
+"пътеводен режим"
-msgid "git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash ( pop | apply ) [--index] [-q|--quiet] [СКÐТÐÐО]"
+msgid "use patterns in <file> instead of the current ones."
+msgstr "ползване на шаблоните във ФÐЙЛа вмеÑто текущите."
-msgid "git stash branch <branchname> [<stash>]"
-msgstr "git stash branch КЛОР[СКÐТÐÐО]"
+msgid "git stash list [<log-options>]"
+msgstr "git stash list [ОПЦИЯ_ЗÐ_ЖУРÐÐЛ…]"
msgid ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
-" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
-" [--] [<pathspec>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<diff-"
+"options>] [<stash>]"
msgstr ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message СЪОБЩЕÐИЕ]\n"
-" [--pathspec-from-file=ФÐЙЛ [--pathspec-file-nul]]\n"
-" [--] [ПЪТ…]]"
+"git stash show [-u|--include-untracked|--only-untracked] [ОПЦИЯ_ЗÐ_РÐЗЛИКÐ…] "
+"[СКÐТÐÐО]"
-msgid ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
-msgstr ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [СЪОБЩЕÐИЕ]"
+msgid "git stash drop [-q | --quiet] [<stash>]"
+msgstr "git stash drop [-q|--quiet] [СКÐТÐÐО]"
-msgid "git stash pop [--index] [-q|--quiet] [<stash>]"
+msgid "git stash pop [--index] [-q | --quiet] [<stash>]"
msgstr "git stash pop [--index] [-q|--quiet] [СКÐТÐÐО]"
-msgid "git stash apply [--index] [-q|--quiet] [<stash>]"
+msgid "git stash apply [--index] [-q | --quiet] [<stash>]"
msgstr "git stash apply [--index] [-q|--quiet] [СКÐТÐÐО]"
-msgid "git stash store [-m|--message <message>] [-q|--quiet] <commit>"
+msgid "git stash branch <branchname> [<stash>]"
+msgstr "git stash branch КЛОР[СКÐТÐÐО]"
+
+msgid "git stash store [(-m | --message) <message>] [-q | --quiet] <commit>"
msgstr "git stash store [-m|--message СЪОБЩЕÐИЕ] [-q|--quiet] ПОДÐÐ’ÐÐЕ"
msgid ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<message>]\n"
+" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
" [--] [<pathspec>...]]"
msgstr ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message СЪОБЩЕÐИЕ]\n"
+"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q | --"
+"quiet]\n"
+" [-u|--include-untracked] [-a|--all] [(-m|--message) СЪОБЩЕÐИЕ]\n"
+" [--pathspec-from-file=ФÐЙЛ [--pathspec-file-nul]]\n"
" [--] [ПЪТ…]]"
msgid ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<message>]"
msgstr ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [СЪОБЩЕÐИЕ]]"
+"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
+"quiet]\n"
+" [-u|--include-untracked] [-a|--all] [СЪОБЩЕÐИЕ]"
+
+msgid "git stash create [<message>]"
+msgstr "git stash create [СЪОБЩЕÐИЕ]"
#, c-format
msgid "'%s' is not a stash-like commit"
@@ -12392,6 +12922,10 @@ msgid "Expecting a full ref name, got %s"
msgstr "Очаква Ñе пълно име на указател, а не „%s“"
#, c-format
+msgid "could not get a repository handle for submodule '%s'"
+msgstr "не може да Ñе получи връзка към хранилище за подмодула „%s“"
+
+#, c-format
msgid ""
"could not look up configuration '%s'. Assuming this repository is its own "
"authoritative upstream."
@@ -12399,12 +12933,6 @@ msgstr ""
"наÑтройката „%s“ липÑва. Приема Ñе, че това хранилище е правилниÑÑ‚ източник "
"за Ñебе Ñи."
-msgid "alternative anchor for relative paths"
-msgstr "Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð·Ð° определÑнето на отноÑителните пътища"
-
-msgid "git submodule--helper list [--prefix=<path>] [<path>...]"
-msgstr "git submodule--helper list [--prefix=ПЪТ] [ПЪТ…]"
-
#, c-format
msgid "No url found for submodule path '%s' in .gitmodules"
msgstr "Във файла „.gitmodules“ не е открит Ð°Ð´Ñ€ÐµÑ Ð·Ð° Ð¿ÑŠÑ‚Ñ ÐºÑŠÐ¼ подмодул „%s“"
@@ -12437,8 +12965,8 @@ msgstr "без извеждане на изход при въвеждането
msgid "recurse into nested submodules"
msgstr "рекурÑивно обхождане на подмодулите"
-msgid "git submodule--helper foreach [--quiet] [--recursive] [--] <command>"
-msgstr "git submodule--helper foreach [--quiet] [--recursive] [--] КОМÐÐДÐ"
+msgid "git submodule foreach [--quiet] [--recursive] [--] <command>"
+msgstr "git submodule foreach [--quiet] [--recursive] [--] КОМÐÐДÐ"
#, c-format
msgid "Failed to register url for submodule path '%s'"
@@ -12460,8 +12988,8 @@ msgstr ""
msgid "suppress output for initializing a submodule"
msgstr "без извеждане на Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¿Ñ€Ð¸ инициализирането на подмодул"
-msgid "git submodule--helper init [<options>] [<path>]"
-msgstr "git submodule--helper init [ОПЦИЯ…] [ПЪТ]"
+msgid "git submodule init [<options>] [<path>]"
+msgstr "git submodule init [ОПЦИЯ…] [ПЪТ]"
#, c-format
msgid "no submodule mapping found in .gitmodules for path '%s'"
@@ -12488,9 +13016,6 @@ msgstr ""
msgid "git submodule status [--quiet] [--cached] [--recursive] [<path>...]"
msgstr "git submodule status [--quiet] [--cached] [--recursive] [ПЪТ…]"
-msgid "git submodule--helper name <path>"
-msgstr "git submodule--helper name ПЪТ"
-
#, c-format
msgid "* %s %s(blob)->%s(submodule)"
msgstr "◠%s %s(обект-BLOB)→%s(подмодул)"
@@ -12527,8 +13052,8 @@ msgstr "преÑкачане на подмодули, чиÑто наÑтройÐ
msgid "limit the summary size"
msgstr "ограничаване на размера на обобщението"
-msgid "git submodule--helper summary [<options>] [<commit>] [--] [<path>]"
-msgstr "git submodule--helper summary [ОПЦИЯ…] [ПОДÐÐ’ÐÐЕ] [--] [ПЪТ]"
+msgid "git submodule summary [<options>] [<commit>] [--] [<path>]"
+msgstr "git submodule summary [ОПЦИЯ…] [ПОДÐÐ’ÐÐЕ] [--] [ПЪТ]"
msgid "could not fetch a revision for HEAD"
msgstr "не може да Ñе доÑтави верÑÐ¸Ñ Ð·Ð° „HEAD“"
@@ -12542,18 +13067,14 @@ msgid "failed to register url for submodule path '%s'"
msgstr "неуÑпешно региÑтриране на Ð°Ð´Ñ€ÐµÑ Ð·Ð° Ð¿ÑŠÑ‚Ñ ÐºÑŠÐ¼ подмодул „%s“"
#, c-format
-msgid "failed to get the default remote for submodule '%s'"
-msgstr "отдалечениÑÑ‚ Ð°Ð´Ñ€ÐµÑ Ð½Ð° подмодула „%s“ не може да бъде получен"
-
-#, c-format
msgid "failed to update remote for submodule '%s'"
msgstr "отдалечениÑÑ‚ Ð°Ð´Ñ€ÐµÑ Ð½Ð° подмодула „%s“ не може да бъде променен"
msgid "suppress output of synchronizing submodule url"
msgstr "без извеждане на Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¿Ñ€Ð¸ Ñинхронизирането на подмодул"
-msgid "git submodule--helper sync [--quiet] [--recursive] [<path>]"
-msgstr "git submodule--helper sync [--quiet] [--recursive] [ПЪТ]"
+msgid "git submodule sync [--quiet] [--recursive] [<path>]"
+msgstr "git submodule sync [--quiet] [--recursive] [ПЪТ]"
#, c-format
msgid ""
@@ -12599,7 +13120,7 @@ msgstr "премахване на региÑтрациите на вÑички Ð
msgid ""
"git submodule deinit [--quiet] [-f | --force] [--all | [--] [<path>...]]"
-msgstr "git submodule deinit [--quiet] [-f | --force] [--all | [--] [ПЪТ…]]"
+msgstr "git submodule deinit [--quiet] [-f|--force] [--all|[--] [ПЪТ…]]"
msgid "Use '--all' if you really want to deinitialize all submodules"
msgstr "Използвайте „--all“, за да премахнете вÑички подмодули"
@@ -12616,6 +13137,10 @@ msgstr ""
"при клониране ползвайте опциÑта „--reference-if-able“ вмеÑто „--reference“."
#, c-format
+msgid "could not get a repository handle for gitdir '%s'"
+msgstr "не може да Ñе получи връзка към хранилище за директориÑта на git „%s“"
+
+#, c-format
msgid "submodule '%s' cannot add alternate: %s"
msgstr "към подмодула „%s“ не може да Ñе добави алтернативен източник: %s"
@@ -12646,6 +13171,9 @@ msgstr "директориÑта не е празна: „%s“"
msgid "could not get submodule directory for '%s'"
msgstr "директориÑта на подмодула „%s“ не може да бъде получена"
+msgid "alternative anchor for relative paths"
+msgstr "Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð·Ð° определÑнето на отноÑителните пътища"
+
msgid "where the new submodule will be cloned to"
msgstr "къде да Ñе клонира новиÑÑ‚ подмодул"
@@ -12674,10 +13202,6 @@ msgstr ""
"ÐДРЕС --path ПЪТ"
#, c-format
-msgid "Invalid update mode '%s' for submodule path '%s'"
-msgstr "Ðеправилен режим на обновÑване „%s“ за Ð¿ÑŠÑ‚Ñ ÐºÑŠÐ¼ подмодул „%s“"
-
-#, c-format
msgid "Invalid update mode '%s' configured for submodule path '%s'"
msgstr ""
"ÐаÑтроен е неправилен режим на обновÑване „%s“ за Ð¿ÑŠÑ‚Ñ ÐºÑŠÐ¼ подмодул „%s“"
@@ -12698,6 +13222,10 @@ msgid "Skipping submodule '%s'"
msgstr "ПреÑкачане на подмодула „%s“"
#, c-format
+msgid "cannot clone submodule '%s' without a URL"
+msgstr "не може да Ñе клонира подмодул „%s“ без адреÑ"
+
+#, c-format
msgid "Failed to clone '%s'. Retry scheduled"
msgstr "ÐеуÑпешен опит за клониране на „%s“. ÐаÑрочен е втори опит"
@@ -12753,6 +13281,10 @@ msgstr ""
"„%s“. Директното доÑтавÑне на това подаване е неуÑпешно."
#, c-format
+msgid "could not initialize submodule at path '%s'"
+msgstr "подмодулът в „%s“ не може да Ñе инициализира"
+
+#, c-format
msgid ""
"Submodule (%s) branch configured to inherit branch from superproject, but "
"the superproject is not on any branch"
@@ -12761,10 +13293,6 @@ msgstr ""
"но той не е на никой клон"
#, c-format
-msgid "could not get a repository handle for submodule '%s'"
-msgstr "не може да Ñе получи връзка към хранилище за подмодула „%s“"
-
-#, c-format
msgid "Unable to find current revision in submodule path '%s'"
msgstr "Текущата верÑÐ¸Ñ Ð·Ð° подмодула в „%s“ липÑва"
@@ -12795,16 +13323,15 @@ msgstr "рекурÑивно обхождане на подмодулите"
msgid "don't fetch new objects from the remote site"
msgstr "без доÑтавÑне на новите обекти от отдалеченото хранилище"
-msgid "path into the working tree"
-msgstr "път към работното дърво"
+msgid "use the 'checkout' update strategy (default)"
+msgstr ""
+"използване на ÑтратегиÑта за обновÑване „checkout“ (изтеглÑне — Ñтандартно)"
-msgid "path into the working tree, across nested submodule boundaries"
-msgstr "път към работното дърво, през границите на вложените подмодули"
+msgid "use the 'merge' update strategy"
+msgstr "използване на ÑтратегиÑта за обновÑване „merge“ (Ñливане)"
-msgid "rebase, merge, checkout or none"
-msgstr ""
-"„rebase“ (пребазиране), „merge“ (Ñливане), „checkout“ (изтеглÑне) или "
-"„none“ (нищо да не Ñе прави)"
+msgid "use the 'rebase' update strategy"
+msgstr "използване на ÑтратегиÑта за обновÑване „rebase“ (пребазиране)"
msgid "create a shallow clone truncated to the specified number of revisions"
msgstr "извършване на плитко клониране, отрÑзано до ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ñ Ð±Ñ€Ð¾Ð¹ верÑии"
@@ -12818,6 +13345,9 @@ msgstr "дали първоначалното клониране да е плиÑ
msgid "don't print cloning progress"
msgstr "без извеждане на напредъка на клонирането"
+msgid "disallow cloning into non-empty directory, implies --init"
+msgstr "предотвратÑване на клониране в непразна иÑториÑ, включва „--init“"
+
msgid ""
"git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] "
"[-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-"
@@ -12829,35 +13359,17 @@ msgstr ""
"shallow] [--reference <repository>] [--recursive] [--[no-]single-branch] "
"[--] [ПЪТ…]"
-msgid "bad value for update parameter"
-msgstr "неправилен параметър към опциÑта „--update“"
-
-msgid "recurse into submodules"
-msgstr "рекурÑивно обхождане подмодулите"
-
-msgid "git submodule--helper absorb-git-dirs [<options>] [<path>...]"
-msgstr "git submodule--helper absorb-git-dirs [ОПЦИЯ…] [ПЪТ…]"
-
-msgid "check if it is safe to write to the .gitmodules file"
-msgstr "проверка дали пиÑането във файла „.gitmodules“ е безопаÑно"
-
-msgid "unset the config in the .gitmodules file"
-msgstr "изтриване на наÑтройка във файла „.gitmodules“"
-
-msgid "git submodule--helper config <name> [<value>]"
-msgstr "git submodule--helper config ИМЕ [СТОЙÐОСТ]"
+msgid "Failed to resolve HEAD as a valid ref."
+msgstr "Ðе може да Ñе открие към какво Ñочи указателÑÑ‚ „HEAD“"
-msgid "git submodule--helper config --unset <name>"
-msgstr "git submodule--helper config --unset ИМЕ"
-
-msgid "please make sure that the .gitmodules file is in the working tree"
-msgstr "файлът „.gitmodules“ Ñ‚Ñ€Ñбва да е в работното дърво"
+msgid "git submodule absorbgitdirs [<options>] [<path>...]"
+msgstr "git submodule absorbgitdirs [ОПЦИЯ…] [ПЪТ…]"
msgid "suppress output for setting url of a submodule"
msgstr "без извеждане на Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¿Ñ€Ð¸ задаването на адреÑа на подмодул"
-msgid "git submodule--helper set-url [--quiet] <path> <newurl>"
-msgstr "git submodule--helper set-url [--quiet] [ПЪТ] [ÐОВ_ПЪТ]"
+msgid "git submodule set-url [--quiet] <path> <newurl>"
+msgstr "git submodule set-url [--quiet] [ПЪТ] [ÐОВ_ПЪТ]"
msgid "set the default tracking branch to master"
msgstr "задаване на ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ ÑледÑщ клон да е „master“"
@@ -12865,12 +13377,11 @@ msgstr "задаване на ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ ÑледÑщ клон да
msgid "set the default tracking branch"
msgstr "задаване на ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ ÑледÑщ клон"
-msgid "git submodule--helper set-branch [-q|--quiet] (-d|--default) <path>"
-msgstr "git submodule--helper set-branch [-q|--quiet] (-d|--default) ПЪТ"
+msgid "git submodule set-branch [-q|--quiet] (-d|--default) <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-d|--default) ПЪТ"
-msgid ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
-msgstr "git submodule--helper set-branch [-q|--quiet] (-b|--branch) КЛОРПЪТ"
+msgid "git submodule set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-b|--branch) КЛОРПЪТ"
msgid "--branch or --default required"
msgstr "необходимо е една от опциите „--branch“ и „--default“"
@@ -12933,6 +13444,9 @@ msgstr "Ðктивиране на локалното хранилище за пÐ
msgid "unable to checkout submodule '%s'"
msgstr "Подмодулът „%s“ не може да бъде изтеглен"
+msgid "please make sure that the .gitmodules file is in the working tree"
+msgstr "файлът „.gitmodules“ Ñ‚Ñ€Ñбва да е в работното дърво"
+
#, c-format
msgid "Failed to add submodule '%s'"
msgstr "ÐеуÑпешно добавÑне на подмодула „%s“"
@@ -12968,8 +13482,8 @@ msgid ""
msgstr ""
"името на подмодула да е указаното, а не да е автоматично Ñъщото като пътÑ"
-msgid "git submodule--helper add [<options>] [--] <repository> [<path>]"
-msgstr "git submodule--helper add [ОПЦИЯ…] [--] ХРÐÐИЛИЩЕ [ПЪТ]"
+msgid "git submodule add [<options>] [--] <repository> [<path>]"
+msgstr "git submodule add [ОПЦИЯ…] [--] ХРÐÐИЛИЩЕ [ПЪТ]"
msgid "Relative path can only be used from the toplevel of the working tree"
msgstr ""
@@ -12986,19 +13500,17 @@ msgstr ""
msgid "'%s' is not a valid submodule name"
msgstr "„%s“ е неправилно име за подмодул"
-#, c-format
-msgid "%s doesn't support --super-prefix"
-msgstr "„%s“ не поддържа опциÑта „--super-prefix“"
+msgid "git submodule--helper <command>"
+msgstr "git submodule--helper КОМÐÐДÐ"
-#, c-format
-msgid "'%s' is not a valid submodule--helper subcommand"
-msgstr "„%s“ не е подкоманда на „submodule--helper“"
+msgid "git symbolic-ref [-m <reason>] <name> <ref>"
+msgstr "git symbolic-ref [-m ПРИЧИÐÐ] ИМЕ УКÐЗÐТЕЛ"
-msgid "git symbolic-ref [<options>] <name> [<ref>]"
-msgstr "git symbolic-ref [ОПЦИЯ…] ИМЕ [УКÐЗÐТЕЛ]"
+msgid "git symbolic-ref [-q] [--short] [--no-recurse] <name>"
+msgstr "git symbolic-ref [-q] [--short] [--no-recurse] ИМЕ"
-msgid "git symbolic-ref -d [-q] <name>"
-msgstr "git symbolic-ref -d [-q] ИМЕ"
+msgid "git symbolic-ref --delete [-q] <name>"
+msgstr "git symbolic-ref --delete [-q] ИМЕ"
msgid "suppress error message for non-symbolic (detached) refs"
msgstr "без извеждане на грешка за неÑвързани (неÑимволни) указатели"
@@ -13009,6 +13521,9 @@ msgstr "изтриване на Ñимволен указател"
msgid "shorten ref output"
msgstr "кратка Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð·Ð° указателÑ"
+msgid "recursively dereference (default)"
+msgstr "рекурÑивно извеждане на идентификатори (Ñтандартно)"
+
msgid "reason"
msgstr "причина"
@@ -13016,24 +13531,25 @@ msgid "reason of the update"
msgstr "причина за обновÑването"
msgid ""
-"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]\n"
-" <tagname> [<head>]"
+"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
+" <tagname> [<commit> | <object>]"
msgstr ""
-"git tag [-a | -s | -u ИДЕÐТИФИКÐТОР_ÐÐ_КЛЮЧ] [-f] [-m СЪОБЩЕÐИЕ | -F ФÐЙЛ]\n"
-" ЕТИКЕТ [ВРЪХ]"
+"git tag [-a|-s|-u ИДЕÐТИФИКÐТОР_ÐÐ_КЛЮЧ] [-f] [-m СЪОБЩЕÐИЕ|-F ФÐЙЛ] [-e]\n"
+" ЕТИКЕТ [ПОДÐÐ’ÐÐЕ|ОБЕКТ]"
msgid "git tag -d <tagname>..."
msgstr "git tag -d ЕТИКЕТ…"
msgid ""
-"git tag -l [-n[<num>]] [--contains <commit>] [--no-contains <commit>] [--"
-"points-at <object>]\n"
-" [--format=<format>] [--merged <commit>] [--no-merged <commit>] "
-"[<pattern>...]"
+"git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]\n"
+" [--points-at <object>] [--column[=<options>] | --no-column]\n"
+" [--create-reflog] [--sort=<key>] [--format=<format>]\n"
+" [--merged <commit>] [--no-merged <commit>] [<pattern>...]"
msgstr ""
-"git tag -l [-n[БРОЙ]] [--contains ПОДÐÐ’ÐÐЕ] [--no-contains ПОДÐÐ’ÐÐЕ]\n"
-" [--points-at ОБЕКТ] [--format=ФОРМÐТ] [--merged ПОДÐÐ’ÐÐЕ]\n"
-" [--no-merged ПОДÐÐ’ÐÐЕ] [ШÐБЛОÐ…]"
+"git tag [-n[БРОЙ]] -l [--contains ПОДÐÐ’ÐÐЕ] [--no-contains ПОДÐÐ’ÐÐЕ]\n"
+" [--points-at ОБЕКТ] [--column[=ОПЦИЯ…]|--no-column]\n"
+" [--create-reflog] [--sort=<key>] [--format=ФОРМÐТ]\n"
+" [--merged ПОДÐÐ’ÐÐЕ] [--no-merged ПОДÐÐ’ÐÐЕ] [ШÐБЛОÐ…]"
msgid "git tag -v [--format=<format>] <tagname>..."
msgstr "git tag -v [--format=ФОРМÐТ] ЕТИКЕТ…"
@@ -13178,6 +13694,16 @@ msgstr "Обновен етикет „%s“ (бе „%s“)\n"
msgid "pack exceeds maximum allowed size"
msgstr "пакетниÑÑ‚ файл надвишава макÑÐ¸Ð¼Ð°Ð»Ð½Ð¸Ñ Ð²ÑŠÐ·Ð¼Ð¾Ð¶ÐµÐ½ размер"
+msgid "failed to write object in stream"
+msgstr "нÑкой обект не може да Ñе запише в потока"
+
+#, c-format
+msgid "inflate returned (%d)"
+msgstr "декомпреÑирането Ñ â€žinflate“ завърши (%d)"
+
+msgid "invalid blob object from stream"
+msgstr "неправилен обект-BLOB от потока"
+
msgid "Unpacking objects"
msgstr "Разпакетиране на обектите"
@@ -13322,6 +13848,9 @@ msgstr ""
msgid "write index in this format"
msgstr "запиÑване на индекÑа в този формат"
+msgid "report on-disk index format version"
+msgstr "извеждане на верÑиÑта на форма̀та на индекÑа на диÑка"
+
msgid "enable or disable split index"
msgstr "включване или изключване на разделÑнето на индекÑа"
@@ -13347,6 +13876,14 @@ msgstr "отбелÑзване на файловете, че може да Ñе
msgid "clear fsmonitor valid bit"
msgstr "изчиÑтване на флага за Ñледенето чрез файловата ÑиÑтема"
+#, c-format
+msgid "%d\n"
+msgstr "%d\n"
+
+#, c-format
+msgid "index-version: was %d, set to %d"
+msgstr "верÑÐ¸Ñ Ð½Ð° индекÑ: бе %d, променена на %d"
+
msgid ""
"core.splitIndex is set to false; remove or change it, if you really want to "
"enable split index"
@@ -13425,8 +13962,12 @@ msgstr "изчитане на указателите от ÑтандартниÑ
msgid "update the info files from scratch"
msgstr "обновÑване на информационните файлове от нулата"
-msgid "git upload-pack [<options>] <dir>"
-msgstr "git upload-pack [ОПЦИЯ…] ДИРЕКТОРИЯ"
+msgid ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <directory>"
+msgstr ""
+"git-upload-pack [--[no-]strict] [--timeout=БРОЙ] [--stateless-rpc]\n"
+" [--advertise-refs] ДИРЕКТОРИЯ"
msgid "quit after a single request/response exchange"
msgstr "изход Ñлед първоначалната размÑна на заÑвка и отговор"
@@ -13441,8 +13982,8 @@ msgstr ""
msgid "interrupt transfer after <n> seconds of inactivity"
msgstr "транÑферът да Ñе преуÑтанови Ñлед този БРОЙ Ñекунди"
-msgid "git verify-commit [-v | --verbose] <commit>..."
-msgstr "git verify-commit [-v | --verbose] ПОДÐÐ’ÐÐЕ…"
+msgid "git verify-commit [-v | --verbose] [--raw] <commit>..."
+msgstr "git verify-commit [-v|--verbose] [--raw] ПОДÐÐ’ÐÐЕ…"
msgid "print commit contents"
msgstr "извеждане на Ñъдържанието на подаването"
@@ -13450,8 +13991,8 @@ msgstr "извеждане на Ñъдържанието на подаванет
msgid "print raw gpg status output"
msgstr "извеждане на Ð½ÐµÐ¾Ð±Ñ€Ð°Ð±Ð¾Ñ‚ÐµÐ½Ð¸Ñ Ð¸Ð·Ñ…Ð¾Ð´ от ÑÑŠÑтоÑнието на „gpg“"
-msgid "git verify-pack [-v | --verbose] [-s | --stat-only] <pack>..."
-msgstr "git verify-pack [-v | --verbose] [-s | --stat-only] ПÐКЕТ…"
+msgid "git verify-pack [-v | --verbose] [-s | --stat-only] [--] <pack>.idx..."
+msgstr "git verify-pack [-v|--verbose] [-s|--stat-only] [--] ПÐКЕТ.idx…"
msgid "verbose"
msgstr "извеждане на подробна информациÑ"
@@ -13459,35 +14000,70 @@ msgstr "извеждане на подробна информациÑ"
msgid "show statistics only"
msgstr "извеждане Ñамо на ÑтатиÑтиката"
-msgid "git verify-tag [-v | --verbose] [--format=<format>] <tag>..."
-msgstr "git verify-tag [-v | --verbose] [--format=ФОРМÐТ] ЕТИКЕТ…"
+msgid "git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."
+msgstr "git verify-tag [-v|--verbose] [--format=ФОРМÐТ] [--raw] ЕТИКЕТ…"
msgid "print tag contents"
msgstr "извеждане на Ñъдържанието на ЕТИКЕТи"
-msgid "git worktree add [<options>] <path> [<commit-ish>]"
-msgstr "git worktree add [ОПЦИЯ…] ПЪТ [УКÐЗÐТЕЛ_КЪМ_ПОДÐÐ’ÐÐЕ]"
+msgid ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <string>]]\n"
+" [--orphan] [(-b | -B) <new-branch>] <path> [<commit-ish>]"
+msgstr ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason ÐИЗ]]\n"
+" [--orphan] [(-b|-B) ÐОВ_КЛОÐ] ПЪТ [УКÐЗÐТЕЛ_КЪМ_ПОДÐÐ’ÐÐЕ]"
-msgid "git worktree list [<options>]"
-msgstr "git worktree list [ОПЦИЯ…]"
+msgid "git worktree list [-v | --porcelain [-z]]"
+msgstr "git worktree list [-v|--porcelain [-z]]"
-msgid "git worktree lock [<options>] <path>"
-msgstr "git worktree lock [ОПЦИЯ…] [ПЪТ]"
+msgid "git worktree lock [--reason <string>] <worktree>"
+msgstr "git worktree lock [--reason ПРИЧИÐÐ] ФОРМÐТ"
msgid "git worktree move <worktree> <new-path>"
msgstr "git worktree move [ДЪРВО] [ÐОВ_ПЪТ]"
-msgid "git worktree prune [<options>]"
-msgstr "git worktree prune [ОПЦИЯ…]"
+msgid "git worktree prune [-n] [-v] [--expire <expire>]"
+msgstr "git worktree prune [-n] [-v] [--expire ВРЕМЕ]"
-msgid "git worktree remove [<options>] <worktree>"
-msgstr "git worktree remove [ОПЦИЯ…] [ДЪРВО]"
+msgid "git worktree remove [-f] <worktree>"
+msgstr "git worktree remove [-f] ДЪРВО"
msgid "git worktree repair [<path>...]"
msgstr "git worktree repair [ПЪТ…]"
-msgid "git worktree unlock <path>"
-msgstr "git worktree unlock [ПЪТ]"
+msgid "git worktree unlock <worktree>"
+msgstr "git worktree unlock ДЪРВО"
+
+msgid "No possible source branch, inferring '--orphan'"
+msgstr "ЛипÑва клон-източник, затова Ñе приема „--orphan“"
+
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+msgstr ""
+"За да Ñъздадете работно дърво за това хранилище\n"
+"Ñ Ð½Ð¾Ð² неродѐн клон — който нÑма дори и начално подаване,\n"
+"ползвайте опциÑта „--orphan“:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan %s\n"
+msgstr ""
+"За да Ñъздадете работно дърво за това хранилище\n"
+"Ñ Ð½Ð¾Ð² неродѐн клон — който нÑма дори и начално подаване,\n"
+"ползвайте опциÑта „--orphan“:\n"
+"\n"
+" git worktree add --orphan %s\n"
#, c-format
msgid "Removing %s/%s: %s"
@@ -13547,6 +14123,10 @@ msgid "initializing"
msgstr "инициализациÑ"
#, c-format
+msgid "could not find created worktree '%s'"
+msgstr "Ñъздаденото в „%s“ работно дърво липÑва"
+
+#, c-format
msgid "Preparing worktree (new branch '%s')"
msgstr "ПриготвÑне на работното дърво (нов клон „%s“)"
@@ -13561,9 +14141,33 @@ msgid "Preparing worktree (checking out '%s')"
msgstr "ПриготвÑне на работното дърво (изтеглÑне на „%s“)"
#, c-format
+msgid "unreachable: invalid reference: %s"
+msgstr "недоÑтижим обект: неправилен указател: %s"
+
+#, c-format
msgid "Preparing worktree (detached HEAD %s)"
msgstr "ПодготвÑне на работно дърво (указателÑÑ‚ „HEAD“ не Ñвързан: %s)"
+#, c-format
+msgid ""
+"HEAD points to an invalid (or orphaned) reference.\n"
+"HEAD path: '%s'\n"
+"HEAD contents: '%s'"
+msgstr ""
+"HEAD Ñочи към неправилен или неродѐн указател.\n"
+"HEAD path: „%s“\n"
+"HEAD contents: „%s“"
+
+msgid ""
+"No local or remote refs exist despite at least one remote\n"
+"present, stopping; use 'add -f' to override or fetch a remote first"
+msgstr ""
+"Ðе ÑъщеÑтвуват никакви локални или отдалечени указатели, въпреки че има\n"
+"поне едно Ñледено хранилище. Работата Ñпира.\n"
+"Ползвайте комбинациÑта „add -f“ за принудително дейÑтвие или първо "
+"доÑтавете\n"
+"обектите от отдалеченото хранилище"
+
msgid "checkout <branch> even if already checked out in other worktree"
msgstr "ИзтеглÑне КЛОÐа, дори и да е изтеглен в друго работно дърво"
@@ -13573,6 +14177,9 @@ msgstr "Ñъздаване на нов клон"
msgid "create or reset a branch"
msgstr "Ñъздаване или занулÑване на клони"
+msgid "create unborn branch"
+msgstr "Ñъздаване на неродѐн клон"
+
msgid "populate the new working tree"
msgstr "подготвÑне на новото работно дърво"
@@ -13592,6 +14199,10 @@ msgstr "опит за напаÑване на името на Ð½Ð¾Ð²Ð¸Ñ ÐºÐ»Ð¾Ð
msgid "options '%s', '%s', and '%s' cannot be used together"
msgstr "опциите „%s“, „%s“ и „%s“ Ñа неÑъвмеÑтими"
+#, c-format
+msgid "option '%s' and commit-ish cannot be used together"
+msgstr "опциите „%s“ и указателите към Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ Ñа неÑъвмеÑтими"
+
msgid "added with --lock"
msgstr "добавена Ñ â€ž--lock“"
@@ -13726,6 +14337,64 @@ msgstr "Ð·Ð°Ð¿Ð¸Ñ Ð½Ð° обект-дърво за поддиректориÑÑ‚Ð
msgid "only useful for debugging"
msgstr "Ñамо за изчиÑтване на грешки"
+msgid "core.fsyncMethod = batch is unsupported on this platform"
+msgstr "„core.fsyncMethod = batch“ не Ñе поддържа на тази платформа"
+
+#, c-format
+msgid "could not parse bundle list key %s with value '%s'"
+msgstr ""
+"ключът за ÑпиÑък Ñ Ð¿Ñ€Ð°Ñ‚ÐºÐ¸ „%s“ не може да Ñе анализира ÑÑŠÑ ÑтойноÑÑ‚ „%s“"
+
+#, c-format
+msgid "bundle list at '%s' has no mode"
+msgstr "липÑва режим в ÑпиÑъка от пратки „%s“"
+
+msgid "failed to create temporary file"
+msgstr "не може да Ñе Ñъздаде временен файл"
+
+msgid "insufficient capabilities"
+msgstr "недоÑтатъчно възможноÑти"
+
+#, c-format
+msgid "file downloaded from '%s' is not a bundle"
+msgstr "изтеглениÑÑ‚ от Ð°Ð´Ñ€ÐµÑ â€ž%s“ файл не е пратка"
+
+msgid "failed to store maximum creation token"
+msgstr "неуÑпешно запазване на данните за поÑледно Ñъздаденото"
+
+#, c-format
+msgid "unrecognized bundle mode from URI '%s'"
+msgstr "непознат режим на пратки от Ð°Ð´Ñ€ÐµÑ â€ž%s“"
+
+#, c-format
+msgid "exceeded bundle URI recursion limit (%d)"
+msgstr ""
+"преминато е ограничениeто за рекурÑивно обхождане на адреÑи на пратки (%d)"
+
+#, c-format
+msgid "failed to download bundle from URI '%s'"
+msgstr "неуÑпешно изтеглÑне на пратка от адреÑ: „%s“"
+
+#, c-format
+msgid "file at URI '%s' is not a bundle or bundle list"
+msgstr "файлът на Ð°Ð´Ñ€ÐµÑ â€ž%s“ не е нито пратка, нито ÑпиÑък Ñ Ð¿Ñ€Ð°Ñ‚ÐºÐ¸"
+
+#, c-format
+msgid "bundle-uri: unexpected argument: '%s'"
+msgstr "bundle-uri: непознат аргумент: %s"
+
+msgid "bundle-uri: expected flush after arguments"
+msgstr "bundle-uri: Ñлед аргументите Ñе очаква изчиÑтване на буферите"
+
+msgid "bundle-uri: got an empty line"
+msgstr "bundle-uri: получен е празен ред"
+
+msgid "bundle-uri: line is not of the form 'key=value'"
+msgstr "bundle-uri: редът не е във формат „КЛЮЧ=СТОЙÐОСТ“"
+
+msgid "bundle-uri: line has empty key or value"
+msgstr "bundle-uri: редът Ñъдържа празен ключ или ÑтойноÑÑ‚"
+
#, c-format
msgid "unrecognized bundle hash algorithm: %s"
msgstr "непознат алгоритъм за контролни Ñуми за пратки „%s“"
@@ -13748,6 +14417,13 @@ msgstr "Ð’ хранилището липÑват Ñледните необход
msgid "need a repository to verify a bundle"
msgstr "за проверката на пратка е необходимо хранилище"
+msgid ""
+"some prerequisite commits exist in the object store, but are not connected "
+"to the repository's history"
+msgstr ""
+"в хранилището на обекти ÑъщеÑтвуват необходими подаваниÑ, които не Ñа "
+"Ñвързани Ñ Ð¸ÑториÑта на хранилището"
+
#, c-format
msgid "The bundle contains this ref:"
msgid_plural "The bundle contains these %<PRIuMAX> refs:"
@@ -13763,6 +14439,14 @@ msgid_plural "The bundle requires these %<PRIuMAX> refs:"
msgstr[0] "Пратката изиÑква ÑÐ»ÐµÐ´Ð½Ð¸Ñ ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»:"
msgstr[1] "Пратката изиÑква Ñледните %<PRIuMAX> указатели:"
+#, c-format
+msgid "The bundle uses this hash algorithm: %s"
+msgstr "Пратката ползва ÑÐ»ÐµÐ´Ð½Ð¸Ñ Ð°Ð»Ð³Ð¾Ñ€Ð¸Ñ‚ÑŠÐ¼ за контролни Ñуми „%s“"
+
+#, c-format
+msgid "The bundle uses this filter: %s"
+msgstr "Пратката изиÑква ÑÐ»ÐµÐ´Ð½Ð¸Ñ Ñ„Ð¸Ð»Ñ‚ÑŠÑ€: %s"
+
msgid "unable to dup bundle descriptor"
msgstr "неуÑпешно дублиране на деÑкриптора на пратката Ñ â€ždup“"
@@ -13799,6 +14483,10 @@ msgid "terminating chunk id appears earlier than expected"
msgstr "идентификаторът за краен Ð¾Ñ‚ÐºÑŠÑ Ñе ÑвÑва по-рано от очакваното"
#, c-format
+msgid "chunk id %<PRIx32> not %d-byte aligned"
+msgstr "откъÑÑŠÑ‚ Ñ Ð¸Ð´ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ‚Ð¾Ñ€ %<PRIx32> не е подравнен по %d-байта"
+
+#, c-format
msgid "improper chunk offset(s) %<PRIx64> and %<PRIx64>"
msgstr "неправилно отмеÑтване на откъÑ/и %<PRIx64> и %<PRIx64>"
@@ -13852,9 +14540,9 @@ msgstr "Събиране на Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð·Ð° Ð¿Ð¾Ñ‚Ñ€ÐµÐ±Ð¸Ñ‚ÐµÐ»Ñ Ð
msgid "Move objects and refs by archive"
msgstr "МеÑтене на обекти и указатели по архиви"
-msgid "Provide content or type and size information for repository objects"
+msgid "Provide contents or details of repository objects"
msgstr ""
-"ПредоÑтавÑне на Ñъдържанието или вида и размерите на обекти от хранилище"
+"ПредоÑтавÑне на Ñъдържанието или друга Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð½Ð° обекти от хранилище"
msgid "Display gitattributes information"
msgstr "Извеждане на информациÑта за атрибутите на git (gitattributes)"
@@ -13939,6 +14627,9 @@ msgstr ""
"Задаване на име удобно за потребителите на обект въз оÑнова на наличен "
"указател"
+msgid "Generate a zip archive of diagnostic information"
+msgstr "Създаване на архив във формат zip Ñ Ð´Ð¸Ð°Ð³Ð½Ð¾Ñтична информациÑ"
+
msgid "Show changes between commits, commit and working tree, etc"
msgstr "Извеждане на разликите между подаваниÑта, верÑиите, работното дърво"
@@ -13950,7 +14641,7 @@ msgstr "СравнÑване на обекти-дърво Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ð½Ð¾Ñ‚Ð¾
msgid "Compares the content and mode of blobs found via two tree objects"
msgstr ""
-"СравнÑване на Ñъдържанието и правата за доÑтъп на обектите-BLOB чрез два "
+"СравнÑване на Ñъдържанието и права̀та за доÑтъп на обектите-BLOB чрез два "
"обекта-дърво"
msgid "Show changes using common diff tools"
@@ -13998,10 +14689,9 @@ msgstr "Извеждане на редовете напаÑващи на шабÐ
msgid "A portable graphical interface to Git"
msgstr "Графичен Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ ÐºÑŠÐ¼ Git"
-msgid "Compute object ID and optionally creates a blob from a file"
+msgid "Compute object ID and optionally create an object from a file"
msgstr ""
-"ИзчиÑлÑване на идентификатор на обект и евентуално Ñъздаване на обект-BLOB "
-"от файл"
+"ИзчиÑлÑване на идентификатор на обект и евентуално Ñъздаване на обект от файл"
msgid "Display help information about Git"
msgstr "Извеждане на помощта за Git"
@@ -14070,8 +14760,8 @@ msgstr "Сливане на файловете, които Ñе нуждаÑÑ‚ Ð
msgid "The standard helper program to use with git-merge-index"
msgstr "Стандартната помощна програма за „git-merge-index“"
-msgid "Show three-way merge without touching index"
-msgstr "Извеждане на тройно Ñливане без промÑна на индекÑа"
+msgid "Perform merge without touching index or working tree"
+msgstr "Извършване на Ñливането без промени по индекÑа или работното време"
msgid "Run merge conflict resolution tools to resolve merge conflicts"
msgstr "Изпълнение на програмите за коригиране на конфликтите при Ñливане"
@@ -14148,6 +14838,11 @@ msgstr "Пакетиране на непакетираните обекти в Ñ
msgid "Create, list, delete refs to replace objects"
msgstr "Създаване, извеждане, изтриване на указатели за замÑна на обекти"
+msgid "EXPERIMENTAL: Replay commits on a new base, works with bare repos too"
+msgstr ""
+"ЕКСПЕРИМЕÐТÐЛÐО: прилагане на Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ Ð²ÑŠÑ€Ñ…Ñƒ нова база, работи и Ñ Ð³Ð¾Ð»Ð¸ "
+"хранилища"
+
msgid "Generates a summary of pending changes"
msgstr "Обобщение на предÑтоÑщите промѐни"
@@ -14266,7 +14961,10 @@ msgstr "Проверка на пакетираните архивни файло
msgid "Check the GPG signature of tags"
msgstr "Проверка на подпиÑите GPG върху етикетите"
-msgid "Show logs with difference each commit introduces"
+msgid "Display version information about Git"
+msgstr "Извеждане на верÑиÑта на Git"
+
+msgid "Show logs with differences each commit introduces"
msgstr "Извеждане на журнал Ñ Ñ€Ð°Ð·Ð»Ð¸ÐºÐ¸Ñ‚Ðµ, въведени Ñ Ð²ÑÑко подаване"
msgid "Manage multiple working trees"
@@ -14299,6 +14997,24 @@ msgstr "Полезен минимален набор от команди за е
msgid "Frequently asked questions about using Git"
msgstr "ЧеÑто задавани въпроÑи за употребата на Git"
+msgid "The bundle file format"
+msgstr "Формат на пратките"
+
+msgid "Chunk-based file formats"
+msgstr "Формати на откъÑите"
+
+msgid "Git commit-graph format"
+msgstr "Формат на гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта"
+
+msgid "Git index format"
+msgstr "Формат на индекÑа"
+
+msgid "Git pack format"
+msgstr "Формат на пакетите"
+
+msgid "Git cryptographic signature formats"
+msgstr "Формати на криптографÑките подпиÑи"
+
msgid "A Git Glossary"
msgstr "Речник Ñ Ñ‚ÐµÑ€Ð¼Ð¸Ð½Ð¸Ñ‚Ðµ на Git"
@@ -14320,6 +15036,21 @@ msgstr "Дефиниране на ÑвойÑтвата на подмодулит
msgid "Git namespaces"
msgstr "ПроÑтранÑтва от имена на Git"
+msgid "Protocol v0 and v1 capabilities"
+msgstr "ВъзможноÑти на протоколи, верÑÐ¸Ñ 1 и 2"
+
+msgid "Things common to various protocols"
+msgstr "Общи за различните протоколи възможноÑти"
+
+msgid "Git HTTP-based protocols"
+msgstr "Протоколи на Git на оÑнова на HTTP"
+
+msgid "How packs are transferred over-the-wire"
+msgstr "Как пакетите Ñе пренаÑÑÑ‚ по мрежата"
+
+msgid "Git Wire Protocol, Version 2"
+msgstr "Мрежов протокол на Git, верÑÐ¸Ñ 2"
+
msgid "Helper programs to interact with remote repositories"
msgstr "Помощни програми за работа Ñ Ð¾Ñ‚Ð´Ð°Ð»ÐµÑ‡ÐµÐ½Ð¸Ñ‚Ðµ хранилища"
@@ -14344,9 +15075,42 @@ msgstr "Уеб Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð½Ð° Git"
msgid "An overview of recommended workflows with Git"
msgstr "Общ преглед на препоръчваните начини за работа Ñ Git"
+msgid "A tool for managing large Git repositories"
+msgstr "ИнÑтрумент за управление на големи хранилища на Git "
+
msgid "commit-graph file is too small"
msgstr "файлът за гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта е твърде малък"
+msgid "commit-graph oid fanout chunk is wrong size"
+msgstr "откъÑÑŠÑ‚ за разпределÑнето в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта е прекалено малък"
+
+msgid "commit-graph fanout values out of order"
+msgstr ""
+"ÑтойноÑтите за Ð¾Ñ‚ÐºÑŠÑ Ð·Ð° разпределÑне в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта не Ñа подредени"
+
+msgid "commit-graph OID lookup chunk is the wrong size"
+msgstr "откъÑÑŠÑ‚ за Ñ‚ÑŠÑ€Ñенето в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта е прекалено малък"
+
+msgid "commit-graph commit data chunk is wrong size"
+msgstr ""
+"откъÑÑŠÑ‚ за данните за подаваниÑта в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта е Ñ Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»ÐµÐ½ размер"
+
+msgid "commit-graph generations chunk is wrong size"
+msgstr "откъÑÑŠÑ‚ за поколениÑта в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта е Ñ Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»ÐµÐ½ размер"
+
+msgid "commit-graph changed-path index chunk is too small"
+msgstr ""
+"откъÑÑŠÑ‚ за индекÑа Ñ Ð¿Ñ€Ð¾Ð¼ÐµÌ€Ð½Ð¸ в пътищата в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта е прекалено "
+"малък"
+
+#, c-format
+msgid ""
+"ignoring too-small changed-path chunk (%<PRIuMAX> < %<PRIuMAX>) in commit-"
+"graph file"
+msgstr ""
+"преÑкачане на прекалено малък Ð¾Ñ‚ÐºÑŠÑ Ð·Ð° индекÑа Ñ Ð¿Ñ€Ð¾Ð¼ÐµÌ€Ð½Ð¸ (%<PRIuMAX> < "
+"%<PRIuMAX>) в пътищата в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта"
+
#, c-format
msgid "commit-graph signature %X does not match signature %X"
msgstr "отпечатъкът на гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта %X не Ñъвпада Ñ %X"
@@ -14363,13 +15127,36 @@ msgstr "верÑиÑта на контролната Ñума на гра̀фа
msgid "commit-graph file is too small to hold %u chunks"
msgstr "файлът Ñ Ð³Ñ€Ð°Ì€Ñ„Ð° на подаваниÑта е твърде малък, за да Ñъдържа %u откъÑи"
+msgid "commit-graph required OID fanout chunk missing or corrupted"
+msgstr ""
+"откъÑÑŠÑ‚ за разпределÑнето необходимо на гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта липÑва или е "
+"повреден"
+
+msgid "commit-graph required OID lookup chunk missing or corrupted"
+msgstr ""
+"откъÑÑŠÑ‚ за Ñ‚ÑŠÑ€Ñенето необходимо на гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта липÑва или е повреден"
+
+msgid "commit-graph required commit data chunk missing or corrupted"
+msgstr ""
+"откъÑÑŠÑ‚ за данните необходими на гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта липÑва или е повреден"
+
msgid "commit-graph has no base graphs chunk"
msgstr "базовиÑÑ‚ Ð¾Ñ‚ÐºÑŠÑ Ð»Ð¸Ð¿Ñва в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта"
+msgid "commit-graph base graphs chunk is too small"
+msgstr "базовиÑÑ‚ Ð¾Ñ‚ÐºÑŠÑ Ð² гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта е прекалено малък"
+
msgid "commit-graph chain does not match"
msgstr "веригата на гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта не Ñъвпада"
#, c-format
+msgid "commit count in base graph too high: %<PRIuMAX>"
+msgstr "броÑÑ‚ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ Ð² оÑÐ½Ð¾Ð²Ð½Ð¸Ñ Ð³Ñ€Ð°Ñ„ е прекалено голÑм: %<PRIuMAX>"
+
+msgid "commit-graph chain file too small"
+msgstr "веригата на гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта е твърде малка"
+
+#, c-format
msgid "invalid commit-graph chain: line '%s' not a hash"
msgstr ""
"грешка във веригата на гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта: ред „%s“ не е контролна Ñума"
@@ -14387,8 +15174,15 @@ msgstr "подаването „%s“ не може да бъде открито
msgid "commit-graph requires overflow generation data but has none"
msgstr ""
-"графът Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта изиÑква генериране на данни за отмеÑтването, но такива "
-"липÑват"
+"графът Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта изиÑква данни за прелелите поколениÑ, но такива липÑват"
+
+msgid "commit-graph overflow generation data is too small"
+msgstr "прекалено малко данни за прелелите Ð¿Ð¾ÐºÐ¾Ð»ÐµÐ½Ð¸Ñ Ð² гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта"
+
+msgid "commit-graph extra-edges pointer out of bounds"
+msgstr ""
+"указателÑÑ‚ за допълнителните ребра в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта е извън Ð¿Ð¾Ð·Ð²Ð¾Ð»ÐµÐ½Ð¸Ñ "
+"диапазон"
msgid "Loading known commits in commit graph"
msgstr "Зареждане на познатите Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ Ð² гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта"
@@ -14432,14 +15226,15 @@ msgid "Finding extra edges in commit graph"
msgstr "Откриване на още върхове в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта"
msgid "failed to write correct number of base graph ids"
-msgstr "правилниÑÑ‚ брой на базовите идентификатори не може да Ñе запише"
+msgstr ""
+"правилниÑÑ‚ брой на идентификаторите в оÑÐ½Ð¾Ð²Ð½Ð¸Ñ Ð³Ñ€Ð°Ñ„ не може да Ñе запише"
msgid "unable to create temporary graph layer"
msgstr "не може да бъде Ñъздаден временен Ñлой за гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта"
#, c-format
msgid "unable to adjust shared permissions for '%s'"
-msgstr "правата за Ñподелен доÑтъп до „%s“ не може да бъдат зададени"
+msgstr "права̀та за Ñподелен доÑтъп до „%s“ не може да бъдат зададени"
#, c-format
msgid "Writing out commit graph in %d pass"
@@ -14456,6 +15251,15 @@ msgstr "оÑновниÑÑ‚ файл на гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта
msgid "failed to rename temporary commit-graph file"
msgstr "временниÑÑ‚ файл на гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта не може да бъде преименуван"
+#, c-format
+msgid "cannot merge graphs with %<PRIuMAX>, %<PRIuMAX> commits"
+msgstr ""
+"не може да Ñе ÑлеÑÑ‚ графове Ñ %<PRIuMAX> и %<PRIuMAX> Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ (Ñъответно)"
+
+#, c-format
+msgid "cannot merge graph %s, too many commits: %<PRIuMAX>"
+msgstr "графът „%s“ не може да Ñе Ñлее, прекалено много подаваниÑ: %<PRIuMAX>"
+
msgid "Scanning merged commits"
msgstr "ТърÑене на подаваниÑта ÑÑŠÑ ÑливаниÑ"
@@ -14482,16 +15286,13 @@ msgstr ""
#, c-format
msgid "commit-graph has incorrect fanout value: fanout[%d] = %u != %u"
msgstr ""
-"неправилна ÑтойноÑÑ‚ за Ð¾Ñ‚ÐºÑŠÑ Ð² гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта: fanout[%d] = %u, а "
-"Ñ‚Ñ€Ñбва да е %u"
+"неправилна ÑтойноÑÑ‚ за Ð¾Ñ‚ÐºÑŠÑ Ð·Ð° разпределÑне в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта: "
+"fanout[%d] = %u, а Ñ‚Ñ€Ñбва да е %u"
#, c-format
msgid "failed to parse commit %s from commit-graph"
msgstr "подаване „%s“ в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта не може да Ñе анализира"
-msgid "Verifying commits in commit graph"
-msgstr "Проверка на подаваниÑта в гра̀фа"
-
#, c-format
msgid "failed to parse commit %s from object database for commit-graph"
msgstr ""
@@ -14517,20 +15318,6 @@ msgid "commit-graph parent list for commit %s terminates early"
msgstr "ÑпиÑъкът Ñ Ñ€Ð¾Ð´Ð¸Ñ‚ÐµÐ»Ð¸ на „%s“ в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта е прекалено къÑ"
#, c-format
-msgid ""
-"commit-graph has generation number zero for commit %s, but non-zero elsewhere"
-msgstr ""
-"номерът на поколението на подаване „%s“ в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта е 0, а другаде "
-"не е"
-
-#, c-format
-msgid ""
-"commit-graph has non-zero generation number for commit %s, but zero elsewhere"
-msgstr ""
-"номерът на поколението на подаване „%s“ в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта не е 0, а "
-"другаде е"
-
-#, c-format
msgid "commit-graph generation for commit %s is %<PRIuMAX> < %<PRIuMAX>"
msgstr ""
"номерът на поколението на подаване „%s“ в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта е %<PRIuMAX> < "
@@ -14543,6 +15330,17 @@ msgstr ""
"%<PRIuMAX>"
#, c-format
+msgid ""
+"commit-graph has both zero and non-zero generations (e.g., commits '%s' and "
+"'%s')"
+msgstr ""
+"гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта Ñъдържа както нулеви, така и ненулеви Ð¿Ð¾ÐºÐ¾Ð»ÐµÐ½Ð¸Ñ (напр. "
+"подаваниÑта „%s“ и „%s“)"
+
+msgid "Verifying commits in commit graph"
+msgstr "Проверка на подаваниÑта в гра̀фа"
+
+#, c-format
msgid "%s %s is not a commit!"
msgstr "%s %s не е подаване!"
@@ -14569,6 +15367,12 @@ msgstr ""
" git config advice.graftFileDeprecated false"
#, c-format
+msgid "commit %s exists in commit-graph but not in the object database"
+msgstr ""
+"подаването „%s“ приÑÑŠÑтва в гра̀фа Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта, но липÑва в базата от данни "
+"за обектите"
+
+#, c-format
msgid "Commit %s has an untrusted GPG signature, allegedly by %s."
msgstr ""
"Подаването „%s“ е Ñ Ð½ÐµÐ´Ð¾Ð²ÐµÑ€ÐµÐ½ Ð¿Ð¾Ð´Ð¿Ð¸Ñ Ð¾Ñ‚ GPG, който твърди, че е на „%s“."
@@ -14602,6 +15406,14 @@ msgid "no libc information available\n"
msgstr "липÑва Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð·Ð° библиотеката на C\n"
#, c-format
+msgid "could not determine free disk size for '%s'"
+msgstr "не може да Ñе определи Ñвободното диÑково проÑтранÑтво за „%s“"
+
+#, c-format
+msgid "could not get info for '%s'"
+msgstr "не може да Ñе получи информациÑта за „%s“"
+
+#, c-format
msgid "[GLE %ld] health thread could not open '%ls'"
msgstr ""
"нишката за Ñледенето на ÑÑŠÑтоÑнието не може да отвори „%2$ls“ [поÑледна "
@@ -14628,8 +15440,12 @@ msgstr "необработен Ñлучай в „has_worktree_moved“: %d"
#, c-format
msgid "health thread wait failed [GLE %ld]"
msgstr ""
-"грешка в нишката за Ñледене на ÑÑŠÑтоÑнието [поÑледна грешка в нишката: GLE="
-"%1$ld]"
+"грешка в нишката за Ñледене на ÑÑŠÑтоÑнието [поÑледна грешка в нишката: "
+"GLE=%1$ld]"
+
+#, c-format
+msgid "Invalid path: %s"
+msgstr "Ðеправилен път: „%s“"
msgid "Unable to create FSEventStream."
msgstr "ÐеуÑпешно Ñъздаване на „FSEventStream“."
@@ -14651,8 +15467,8 @@ msgstr "„%2$s“ не може да Ñе наблюдава [поÑледна
#, c-format
msgid "[GLE %ld] could not get longname of '%s'"
msgstr ""
-"дългото име на „%2$s“ те може да Ñе получи [поÑледна грешка в нишката: GLE="
-"%1$ld]"
+"дългото име на „%2$s“ те може да Ñе получи [поÑледна грешка в нишката: "
+"GLE=%1$ld]"
#, c-format
msgid "ReadDirectoryChangedW failed on '%s' [GLE %ld]"
@@ -14673,6 +15489,34 @@ msgstr ""
"нишката: GLE=%ld]"
#, c-format
+msgid "opendir('%s') failed"
+msgstr "неуÑпешно изпълнение на opendir(„%s“)"
+
+#, c-format
+msgid "lstat('%s') failed"
+msgstr "неуÑпешно изпълнение на lstat(„%s“)"
+
+#, c-format
+msgid "strbuf_readlink('%s') failed"
+msgstr "неуÑпешно изпълнение на strbuf_readlink(„%s“)"
+
+#, c-format
+msgid "closedir('%s') failed"
+msgstr "неуÑпешно изпълнение на closedir(„%s“)"
+
+#, c-format
+msgid "[GLE %ld] unable to open for read '%ls'"
+msgstr ""
+"файлът „%2$ls“ не може да бъде отворен за четене [поÑледна грешка в нишката: "
+"GLE=%1$ld]"
+
+#, c-format
+msgid "[GLE %ld] unable to get protocol information for '%ls'"
+msgstr ""
+"информациÑта за протокола на „%2$ls“ не може да Ñе получи [поÑледна грешка в "
+"нишката: GLE=%1$ld]"
+
+#, c-format
msgid "failed to copy SID (%ld)"
msgstr "идентификаторът за ÑигурноÑÑ‚ (SID=%ld) не може да бъде копиран"
@@ -14942,14 +15786,14 @@ msgstr "„%s“ не е правилна ÑтойноÑÑ‚ за време за
#, c-format
msgid "abbrev length out of range: %d"
-msgstr "дължината на Ñъкращаване е извън интервала ([4; 40]): %d"
+msgstr "дължината на Ñъкращаване е извън диапазона ([4; 40]): %d"
#, c-format
msgid "bad zlib compression level %d"
msgstr "неправилно ниво на компреÑиране: %d"
-msgid "core.commentChar should only be one character"
-msgstr "наÑтройката „core.commentChar“ Ñ‚Ñ€Ñбва да е Ñамо един знак"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "наÑтройката „core.commentChar“ Ñ‚Ñ€Ñбва да е Ñамо един знак от ASCII"
#, c-format
msgid "ignoring unknown core.fsyncMethod value '%s'"
@@ -14990,10 +15834,6 @@ msgstr "указателÑÑ‚ „%s“ не Ñочи към обект-BLOB"
msgid "unable to resolve config blob '%s'"
msgstr "обектът-BLOB „%s“ Ñ ÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ð¸ не може да бъде открит"
-#, c-format
-msgid "failed to parse %s"
-msgstr "„%s“ не може да бъде анализиран"
-
msgid "unable to parse command-line config"
msgstr "неправилни наÑтройки от ÐºÐ¾Ð¼Ð°Ð½Ð´Ð½Ð¸Ñ Ñ€ÐµÐ´"
@@ -15052,7 +15892,7 @@ msgstr "неуÑпешно изпълнение на „mmap“ върху „%s
#, c-format
msgid "chmod on %s failed"
-msgstr "неуÑпешна ÑмÑна на права Ñ â€žchmod“ върху „%s“"
+msgstr "неуÑпешна ÑмÑна на права̀ Ñ â€žchmod“ върху „%s“"
#, c-format
msgid "could not write config file %s"
@@ -15067,6 +15907,10 @@ msgid "invalid section name: %s"
msgstr "неправилно име на раздел: %s"
#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr "ред %2$<PRIuMAX> в „%1$s“ е прекалено дълъг"
+
+#, c-format
msgid "missing value for '%s'"
msgstr "липÑва ÑтойноÑÑ‚ за „%s“"
@@ -15081,7 +15925,7 @@ msgid ""
msgstr ""
"Ðе може да Ñе чете от отдалеченото хранилище.\n"
"\n"
-"Проверете дали то ÑъщеÑтвува и дали имате права\n"
+"Проверете дали то ÑъщеÑтвува и дали имате права̀\n"
"за доÑтъп."
#, c-format
@@ -15122,15 +15966,23 @@ msgid "unknown object format '%s' specified by server"
msgstr "Ñървърът указа непознат формат на обект: „%s“"
#, c-format
+msgid "error on bundle-uri response line %d: %s"
+msgstr "грешка на ред %d в отговора на командата „bundle-uri“: %s"
+
+msgid "expected flush after bundle-uri listing"
+msgstr ""
+"Ñлед изброÑването на адреÑите на пратките Ñе очаква изчиÑтване на буферите"
+
+msgid "expected response end packet after ref listing"
+msgstr "Ñлед изброÑването на указателите Ñе очаква пакет за край"
+
+#, c-format
msgid "invalid ls-refs response: %s"
msgstr "неправилен отговор на „ls-refs“: „%s“"
msgid "expected flush after ref listing"
msgstr "Ñлед изброÑването на указателите Ñе очаква изчиÑтване на буферите"
-msgid "expected response end packet after ref listing"
-msgstr "Ñлед изброÑването на указателите Ñе очаква пакет за край"
-
#, c-format
msgid "protocol '%s' is not supported"
msgstr "протокол „%s“ не Ñе поддържа"
@@ -15225,182 +16077,6 @@ msgid "failed to close rev-list's stdin"
msgstr "ÑтандартниÑÑ‚ вход на ÑпиÑъка Ñ Ð²ÐµÑ€Ñиите не може да бъде затворен"
#, c-format
-msgid "'%s' does not exist"
-msgstr "„%s“ не ÑъщеÑтвува."
-
-msgid "need a working directory"
-msgstr "необходима е работна директориÑ"
-
-msgid "could not find enlistment root"
-msgstr "началната зачиÑлена Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð½Ðµ може да бъде открита"
-
-#, c-format
-msgid "could not switch to '%s'"
-msgstr "не може да Ñе премине към „%s“"
-
-#, c-format
-msgid "could not configure %s=%s"
-msgstr "наÑтройката „%s=%s“ не може да Ñе зададе"
-
-msgid "could not configure log.excludeDecoration"
-msgstr "„log.excludeDecoration“ не може да Ñе наÑтрои"
-
-msgid "Scalar enlistments require a worktree"
-msgstr "ЗачиÑлÑването на директории чрез „scalar“ изиÑква работно дърво"
-
-#, c-format
-msgid "could not open directory '%s'"
-msgstr "директориÑта „%s“ не може да бъде отворена"
-
-#, c-format
-msgid "skipping '%s', which is neither file nor directory"
-msgstr "„%s“ Ñе преÑкача, защото не е нито файл, нито директориÑ"
-
-#, c-format
-msgid "could not determine free disk size for '%s'"
-msgstr "не може да Ñе определи Ñвободното диÑково проÑтранÑтво за „%s“"
-
-#, c-format
-msgid "could not get info for '%s'"
-msgstr "не може да Ñе получи информациÑта за „%s“"
-
-#, c-format
-msgid "remote HEAD is not a branch: '%.*s'"
-msgstr "отдалечениÑÑ‚ указател „HEAD“ не Ñочи към клон: „%.*s“"
-
-msgid "failed to get default branch name from remote; using local default"
-msgstr ""
-"името на ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ ÐºÐ»Ð¾Ð½ на отдалеченото хранилище не може да Ñе получи, "
-"затова ще Ñе ползва локално наÑтроеното име на ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ ÐºÐ»Ð¾Ð½"
-
-msgid "failed to get default branch name"
-msgstr "неуÑпешно получаване на името на ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ ÐºÐ»Ð¾Ð½"
-
-msgid "failed to unregister repository"
-msgstr "хранилището не може да бъде отчиÑлено"
-
-msgid "failed to delete enlistment directory"
-msgstr "зачиÑлената Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð½Ðµ може да бъде изтрита"
-
-msgid "branch to checkout after clone"
-msgstr "към кой клон да Ñе премине Ñлед клониране"
-
-msgid "when cloning, create full working directory"
-msgstr "при клониране да Ñе Ñъздава пълна работна директориÑ"
-
-msgid "only download metadata for the branch that will be checked out"
-msgstr "да Ñе ÑвалÑÑ‚ метаданните Ñамо за изтеглÑÐ½Ð¸Ñ ÐºÐ»Ð¾Ð½"
-
-msgid "scalar clone [<options>] [--] <repo> [<dir>]"
-msgstr "scalar clone [ОПЦИЯ…] [--] ХРÐÐИЛИЩЕ [ДИРЕКТОРИЯ]"
-
-#, c-format
-msgid "cannot deduce worktree name from '%s'"
-msgstr "името на работното дърво не може да Ñе извлече от „%s“"
-
-#, c-format
-msgid "directory '%s' exists already"
-msgstr "директориÑта „%s“ вече ÑъщеÑтвува"
-
-#, c-format
-msgid "failed to get default branch for '%s'"
-msgstr "оÑновниÑÑ‚ клон на „%s“ не може да бъде получен"
-
-#, c-format
-msgid "could not configure remote in '%s'"
-msgstr "отдалеченото хранилище в „%s“ не може да Ñе наÑтрои"
-
-#, c-format
-msgid "could not configure '%s'"
-msgstr "„%s“ не може да Ñе наÑтрои"
-
-msgid "partial clone failed; attempting full clone"
-msgstr "неуÑпешно Ñъздаване на непълно хранилище, ще Ñе опита пълно хранилище"
-
-msgid "could not configure for full clone"
-msgstr "не може да Ñе наÑтрои пълно клониране"
-
-msgid "scalar diagnose [<enlistment>]"
-msgstr "scalar diagnose [ЗÐЧИСЛЕÐÐ_ДИРЕКТОРИЯ]"
-
-#, c-format
-msgid "could not create directory for '%s'"
-msgstr "директориÑта за „%s“ не може да Ñе Ñъздадe"
-
-msgid "could not duplicate stdout"
-msgstr "ÑтандартниÑÑ‚ изход не може да Ñе дублира"
-
-msgid "failed to write archive"
-msgstr "неуÑпешен Ð·Ð°Ð¿Ð¸Ñ Ð½Ð° архива"
-
-msgid "`scalar list` does not take arguments"
-msgstr "„scalar list“ не приема аргументи"
-
-msgid "scalar register [<enlistment>]"
-msgstr "scalar register [ЗÐЧИСЛЕÐÐ_ДИРЕКТОРИЯ]"
-
-msgid "reconfigure all registered enlistments"
-msgstr "пренаÑтройване на вÑички зачиÑлени директории"
-
-msgid "scalar reconfigure [--all | <enlistment>]"
-msgstr "scalar reconfigure [--all | ЗÐЧИСЛЕÐÐ_ДИРЕКТОРИЯ]"
-
-msgid "--all or <enlistment>, but not both"
-msgstr "опциÑта „--all“ и указването на зачиÑлена Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð½Ðµ Ñа ÑъвмеÑтими"
-
-#, c-format
-msgid "git repository gone in '%s'"
-msgstr "вече нÑма хранилище на git в „%s“"
-
-msgid ""
-"scalar run <task> [<enlistment>]\n"
-"Tasks:\n"
-msgstr ""
-"scalar run ЗÐДÐЧР[ЗÐЧИСЛЕÐÐ_ДИРЕКТОРИЯ]\n"
-"Задачи:\n"
-
-#, c-format
-msgid "no such task: '%s'"
-msgstr "нÑма задача Ñ Ð¸Ð¼Ðµ „%s“"
-
-msgid "scalar unregister [<enlistment>]"
-msgstr "scalar unregister [ЗÐЧИСЛЕÐÐ_ДИРЕКТОРИЯ]"
-
-msgid "scalar delete <enlistment>"
-msgstr "scalar delete ЗÐЧИСЛЕÐÐ_ДИРЕКТОРИЯ"
-
-msgid "refusing to delete current working directory"
-msgstr "текущата работна Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð½Ñма да бъде изтрита"
-
-msgid "include Git version"
-msgstr "включване и на верÑиÑта на git"
-
-msgid "include Git's build options"
-msgstr "включване и на опциите за компилиране на git"
-
-msgid "scalar verbose [-v | --verbose] [--build-options]"
-msgstr "scalar verbose [-v | --verbose] [--build-options]"
-
-msgid "-C requires a <directory>"
-msgstr "„-C“ изиÑква ДИРЕКТОРИЯ"
-
-#, c-format
-msgid "could not change to '%s'"
-msgstr "не може да Ñе влезе в директориÑта „%s“"
-
-msgid "-c requires a <key>=<value> argument"
-msgstr "опциÑта „-c“ изиÑква аргумент във вид КЛЮЧ=СТОЙÐОСТ"
-
-msgid ""
-"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
-"\n"
-"Commands:\n"
-msgstr ""
-"scalar [-C ДИРЕКТОРИЯ] [-c КЛЮЧ=СТОЙÐОСТ] КОМÐÐДР[ОПЦИЯ…]<\n"
-"\n"
-"Команди:\n"
-
-#, c-format
msgid "illegal crlf_action %d"
msgstr "неправилно дейÑтвие за край на ред (crlf_action): %d"
@@ -15613,12 +16289,35 @@ msgstr ""
msgid "Marked %d islands, done.\n"
msgstr "ОтбелÑзани Ñа %d групи, работата приключи.\n"
+#, c-format
+msgid "invalid --%s value '%s'"
+msgstr "неправилна ÑтойноÑÑ‚ за „--%s“: „%s“"
+
+#, c-format
+msgid "could not archive missing directory '%s'"
+msgstr "директориÑта „%s“ липÑва и не може да Ñе архивира"
+
+#, c-format
+msgid "could not open directory '%s'"
+msgstr "директориÑта „%s“ не може да бъде отворена"
+
+#, c-format
+msgid "skipping '%s', which is neither file nor directory"
+msgstr "„%s“ Ñе преÑкача, защото не е нито файл, нито директориÑ"
+
+msgid "could not duplicate stdout"
+msgstr "ÑтандартниÑÑ‚ изход не може да Ñе дублира"
+
+#, c-format
+msgid "could not add directory '%s' to archiver"
+msgstr "директориÑта „%s“ не може да бъде добавена към архива"
+
+msgid "failed to write archive"
+msgstr "неуÑпешен Ð·Ð°Ð¿Ð¸Ñ Ð½Ð° архива"
+
msgid "--merge-base does not work with ranges"
msgstr "опциÑта „--merge-base“ не работи Ñ Ð´Ð¸Ð°Ð¿Ð°Ð·Ð¾Ð½Ð¸"
-msgid "--merge-base only works with commits"
-msgstr "опциÑта „--merge-base“ работи Ñамо Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ"
-
msgid "unable to get HEAD"
msgstr "УказателÑÑ‚ „HEAD“ не може да бъде получен"
@@ -15628,6 +16327,12 @@ msgstr "липÑва база за Ñливане"
msgid "multiple merge bases found"
msgstr "много бази за Ñливане"
+msgid "cannot compare stdin to a directory"
+msgstr "ÑтандартниÑÑ‚ вход не може да Ñе Ñравни Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ"
+
+msgid "cannot compare a named pipe to a directory"
+msgstr "именован канал не може да Ñе Ñравни Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ"
+
msgid "git diff --no-index [<options>] <path> <path>"
msgstr "git diff --no-index [ОПЦИЯ…] ПЪТ ПЪТ"
@@ -15680,6 +16385,10 @@ msgid "Unknown value for 'diff.submodule' config variable: '%s'"
msgstr "Ðепозната ÑтойноÑÑ‚ „%s“ за наÑтройката „diff.submodule“"
#, c-format
+msgid "unknown value for config '%s': %s"
+msgstr "непозната ÑтойноÑÑ‚ за наÑтройката „%s“: „%s“"
+
+#, c-format
msgid ""
"Found errors in 'diff.dirstat' config variable:\n"
"%s"
@@ -15692,6 +16401,13 @@ msgid "external diff died, stopping at %s"
msgstr ""
"външната програма за разлики завърши неуÑпешно. Спиране на работата при „%s“"
+msgid "--follow requires exactly one pathspec"
+msgstr "опциÑта „--follow“ изиÑква точно един път"
+
+#, c-format
+msgid "pathspec magic not supported by --follow: %s"
+msgstr "магичеÑките пътища не Ñе поддържат от „--follow“: %s"
+
#, c-format
msgid "options '%s', '%s', '%s', and '%s' cannot be used together"
msgstr "опциите „%s“, „%s“, „%s“ и „%s“ Ñа неÑъвмеÑтими"
@@ -15705,9 +16421,6 @@ msgid ""
"options '%s' and '%s' cannot be used together, use '%s' with '%s' and '%s'"
msgstr "опциите „%s“ и „%s“ Ñа неÑъвмеÑтими, използвайте „%s“ Ñ â€ž%s“ и „%s“"
-msgid "--follow requires exactly one pathspec"
-msgstr "опциÑта „--follow“ изиÑква точно един път"
-
#, c-format
msgid "invalid --stat value: %s"
msgstr "неправилна ÑтойноÑÑ‚ за „--stat“: %s"
@@ -15754,14 +16467,6 @@ msgstr "неправилен аргумент за „--color-moved“: „%s“
msgid "invalid mode '%s' in --color-moved-ws"
msgstr "неправилен режим „%s“ за „ --color-moved-ws“"
-msgid ""
-"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
-"\"histogram\""
-msgstr ""
-"опциÑта приема Ñледните варианти за алгоритъм за разлики: „myers“ (по "
-"МайерÑ), „minimal“ (минимизиране на разликите), „patience“ (паÑианÑ) и "
-"„histogram“ (хиÑтограмен)"
-
#, c-format
msgid "invalid argument to %s"
msgstr "неправилен аргумент към „%s“"
@@ -15805,8 +16510,8 @@ msgstr "„--stat“ във формат за четене от програма
msgid "output only the last line of --stat"
msgstr "извеждане Ñамо на поÑÐ»ÐµÐ´Ð½Ð¸Ñ Ñ€ÐµÐ´ на „--stat“"
-msgid "<param1,param2>..."
-msgstr "ПÐРÐМЕТЪР_1, ПÐРÐМЕТЪР_2, …"
+msgid "<param1>,<param2>..."
+msgstr "ПÐРÐМЕТЪР_1,ПÐРÐМЕТЪР_2,…"
msgid ""
"output the distribution of relative amount of changes for each sub-directory"
@@ -15815,8 +16520,8 @@ msgstr "извеждане на разпределението на промѐ
msgid "synonym for --dirstat=cumulative"
msgstr "пÑевдоним на „--dirstat=cumulative“"
-msgid "synonym for --dirstat=files,param1,param2..."
-msgstr "пÑевдоним на „--dirstat=ФÐЙЛ…,ПÐРÐМЕТЪР_1,ПÐРÐМЕТЪР_2,…“"
+msgid "synonym for --dirstat=files,<param1>,<param2>..."
+msgstr "пÑевдоним на „--dirstat=files,ПÐРÐМЕТЪР_1,ПÐРÐМЕТЪР_2,…“"
msgid "warn if changes introduce conflict markers or whitespace errors"
msgstr ""
@@ -15904,6 +16609,9 @@ msgstr "добавÑне на допълнителен Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ Ð·Ð° вÑÐ
msgid "do not show any source or destination prefix"
msgstr "без Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ Ð·Ð° източника и целта"
+msgid "use default prefixes a/ and b/"
+msgstr "ползване на Ñтандартните префикÑи „a/“ и „b/“"
+
msgid "show context between diff hunks up to the specified number of lines"
msgstr ""
"извеждане на контекÑÑ‚ между поÑледователните парчета Ñ Ñ€Ð°Ð·Ð»Ð¸ÐºÐ¸ от ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ñ "
@@ -15997,12 +16705,6 @@ msgstr "разлика чрез алгоритъм за подредба катÐ
msgid "generate diff using the \"histogram diff\" algorithm"
msgstr "разлика по хиÑÑ‚Ð¾Ð³Ñ€Ð°Ð¼Ð½Ð¸Ñ Ð°Ð»Ð³Ð¾Ñ€Ð¸Ñ‚ÑŠÐ¼"
-msgid "<algorithm>"
-msgstr "ÐЛГОРИТЪМ"
-
-msgid "choose a diff algorithm"
-msgstr "избор на ÐЛГОРИТЪМа за разлики"
-
msgid "<text>"
msgstr "ТЕКСТ"
@@ -16210,6 +16912,14 @@ msgstr "директориÑта на git не може да Ñе мигрира
msgid "hint: Waiting for your editor to close the file...%c"
msgstr "ПодÑказка: чака Ñе редакторът ви да затвори файла …%c"
+#, c-format
+msgid "could not write to '%s'"
+msgstr "в „%s“ не може да Ñе пише"
+
+#, c-format
+msgid "could not edit '%s'"
+msgstr "„%s“ не може да Ñе редактира"
+
msgid "Filtering content"
msgstr "Филтриране на Ñъдържанието"
@@ -16242,6 +16952,9 @@ msgstr "git fetch-pack: очаква Ñе „ACK“/„NAK“, а бе полуÑ
msgid "unable to write to remote"
msgstr "невъзможно пиÑане към отдалечено хранилище"
+msgid "Server supports filter"
+msgstr "Сървърът поддържа филтри"
+
#, c-format
msgid "invalid shallow line: %s"
msgstr "неправилен плитък ред: „%s“"
@@ -16352,9 +17065,6 @@ msgstr "Ñървърът не поддържа алгоритъм „%s“"
msgid "Server does not support shallow requests"
msgstr "Сървърът не поддържа плитки заÑвки"
-msgid "Server supports filter"
-msgstr "Сървърът поддържа филтри"
-
msgid "unable to write request to remote"
msgstr "невъзможно пиÑане към отдалечено хранилище"
@@ -16419,7 +17129,7 @@ msgstr "такъв отдалечен указател нÑма: %s"
#, c-format
msgid "Server does not allow request for unadvertised object %s"
-msgstr "Сървърът не позволÑва заÑвка за необÑвен обект „%s“"
+msgstr "Сървърът не позволÑва заÑвка за необÑвен за наличен обект „%s“"
#, c-format
msgid "fsmonitor_ipc__send_query: invalid path '%s'"
@@ -16454,9 +17164,11 @@ msgstr "виртуалното хранилище „%s“ е неÑъвмеÑÑ‚
#, c-format
msgid ""
-"repository '%s' is incompatible with fsmonitor due to lack of Unix sockets"
+"socket directory '%s' is incompatible with fsmonitor due to lack of Unix "
+"sockets support"
msgstr ""
-"хранилището „%s“ е неÑъвмеÑтимо Ñ fsmonitor заради липÑата на гнезда на unix"
+"директориÑта за гнезда „%s“ е неÑъвмеÑтима Ñ fsmonitor заради липÑата на "
+"гнезда на Unix"
msgid ""
"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
@@ -16464,16 +17176,13 @@ msgid ""
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
-" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
-" <command> [<args>]"
+" [--config-env=<name>=<envvar>] <command> [<args>]"
msgstr ""
-"git [-v | --version] [-h | --help] [-C ПЪТ] [-c ИМЕ=СТОЙÐОСТ]\n"
+"git [-v|--version] [-h|--help] [-C ПЪТ] [-c ИМЕ=СТОЙÐОСТ]\n"
" [--exec-path[=ПЪТ]] [--html-path] [--man-path] [--info-path]\n"
-" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
-"bare]\n"
+" [-p|--paginate|-P|--no-pager] [--no-replace-objects] [--bare]\n"
" [--git-dir=ПЪТ] [--work-tree=ПЪТ] [--namespace=ИМЕ]\n"
-" [--super-prefix=ПЪТ] [--config-env=ИМЕ=ПРОМЕÐЛИВÐ_ÐÐ_СРЕДÐТÐ]\n"
-" КОМÐÐДР[ÐРГ…]"
+" [--config-env=ИМЕ=ПРОМЕÐЛИВÐ_ÐÐ_СРЕДÐТÐ] КОМÐÐДР[ÐРГ…]"
msgid ""
"'git help -a' and 'git help -g' list available subcommands and some\n"
@@ -16501,10 +17210,6 @@ msgid "no namespace given for --namespace\n"
msgstr "опциÑта „--namespace“ изиÑква име\n"
#, c-format
-msgid "no prefix given for --super-prefix\n"
-msgstr "опциÑта „--super-prefix“ изиÑква префикÑ\n"
-
-#, c-format
msgid "-c expects a configuration string\n"
msgstr "опциÑта „-c“ изиÑква низ за наÑтройка\n"
@@ -16513,6 +17218,10 @@ msgid "no config key given for --config-env\n"
msgstr "опциÑта „--config-env“ изиÑква ключ\n"
#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "опциÑта „--attr-source“ изиÑква източник на атрибути\n"
+
+#, c-format
msgid "unknown option: %s\n"
msgstr "непозната опциÑ: „%s“\n"
@@ -16624,8 +17333,13 @@ msgstr ""
msgid "gpg.ssh.defaultKeyCommand failed: %s %s"
msgstr "неуÑпешно изпълнение на „gpg.ssh.defaultKeyCommand“: %s %s"
-msgid "gpg failed to sign the data"
-msgstr "Програмата „gpg“ не подпиÑа данните"
+#, c-format
+msgid ""
+"gpg failed to sign the data:\n"
+"%s"
+msgstr ""
+"Програмата „gpg“ не подпиÑа данните:\n"
+"%s"
msgid "user.signingKey needs to be set for ssh signing"
msgstr ""
@@ -16710,6 +17424,12 @@ msgstr "Команди от ниÑко ниво / Ð¡Ð¸Ð½Ñ…Ñ€Ð¾Ð½Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð½Ð
msgid "Low-level Commands / Internal Helpers"
msgstr "Команди от ниÑко ниво / Допълнителни инÑтрументи"
+msgid "User-facing repository, command and file interfaces"
+msgstr "Команди за хранилища, файлове и др. интерфейÑи за потребители:"
+
+msgid "Developer-facing file formats, protocols and other interfaces"
+msgstr "Файлови формати, протоколи и др. интерфейÑи за програмиÑти:"
+
#, c-format
msgid "available git commands in '%s'"
msgstr "налични команди на git от „%s“"
@@ -16723,6 +17443,12 @@ msgstr "Това Ñа най-чеÑто използваните команди
msgid "The Git concept guides are:"
msgstr "РъководÑтвата за концепциите в Git Ñа:"
+msgid "User-facing repository, command and file interfaces:"
+msgstr "Команди за хранилища, файлове и др. за потребители:"
+
+msgid "File formats, protocols and other developer interfaces:"
+msgstr "Файлови формати, протоколи и др. за програмиÑти:"
+
msgid "External commands"
msgstr "Външни команди"
@@ -16781,8 +17507,8 @@ msgstr[1] ""
"\n"
"Ðай-близките команди Ñа"
-msgid "git version [<options>]"
-msgstr "git version [ОПЦИЯ…]"
+msgid "git version [--build-options]"
+msgstr "git version [--build-options]"
#, c-format
msgid "%s: %s - %s"
@@ -16806,15 +17532,11 @@ msgid ""
"The '%s' hook was ignored because it's not set as executable.\n"
"You can disable this warning with `git config advice.ignoredHook false`."
msgstr ""
-"Куката „%s“ Ñе преÑкача, защото липÑват права за изпълнение.\n"
+"Куката „%s“ Ñе преÑкача, защото липÑват права̀ за изпълнение.\n"
"За да изключите това предупреждение, изпълнете:\n"
" git config advice.ignoredHook false"
#, c-format
-msgid "Couldn't start hook '%s'\n"
-msgstr "Куката „%s“ не може да Ñе Ñтартира\n"
-
-#, c-format
msgid "argument to --packfile must be a valid hash (got '%s')"
msgstr "опциÑта „--packfile“ изиÑква валидна контролна Ñума (а не „%s“)"
@@ -17006,18 +17728,14 @@ msgid "quoted CRLF detected"
msgstr "цитирани знаци CRLF"
#, c-format
-msgid ""
-"Your local changes to the following files would be overwritten by merge:\n"
-" %s"
-msgstr ""
-"Сливането ще презапише локалните промѐни на тези файлове:\n"
-" %s"
-
-#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "ÐеуÑпешно Ñливане на подмодула „%s“ (не е изтеглен)"
#, c-format
+msgid "Failed to merge submodule %s (no merge base)"
+msgstr "ÐеуÑпешно Ñливане на подмодула „%s“ (нÑма база за Ñливане)"
+
+#, c-format
msgid "Failed to merge submodule %s (commits not present)"
msgstr "ÐеуÑпешно Ñливане на подмодула „%s“ (нÑма подаваниÑ)"
@@ -17037,26 +17755,8 @@ msgstr "ÐеуÑпешно Ñливане на подмодула „%s“"
#, c-format
msgid ""
-"Failed to merge submodule %s, but a possible merge resolution exists:\n"
-"%s\n"
-msgstr ""
-"ÐеуÑпешно Ñливане на подмодула „%s“, но е открито възможно решение:\n"
-"%s\n"
-
-#, c-format
-msgid ""
-"If this is correct simply add it to the index for example\n"
-"by using:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"which will accept this suggestion.\n"
-msgstr ""
-"Ðко това е така, добавете го към индекÑа Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° като Ñледната:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"Това приема предложеното.\n"
+"Failed to merge submodule %s, but a possible merge resolution exists: %s"
+msgstr "ÐеуÑпешно Ñливане на подмодула „%s“, но е открито възможно решение: %s"
#, c-format
msgid ""
@@ -17066,12 +17766,12 @@ msgstr ""
"ÐеуÑпешно Ñливане на подмодула „%s“, но Ñа открити множеÑтво решениÑ:\n"
"%s"
-msgid "Failed to execute internal merge"
-msgstr "ÐеуÑпешно вътрешно Ñливане"
+msgid "failed to execute internal merge"
+msgstr "неуÑпешно вътрешно Ñливане"
#, c-format
-msgid "Unable to add %s to database"
-msgstr "„%s“ не може да Ñе добави в базата Ñ Ð´Ð°Ð½Ð½Ð¸"
+msgid "unable to add %s to database"
+msgstr "„%s“ не може да Ñе добави в базата от данни"
#, c-format
msgid "Auto-merging %s"
@@ -17219,13 +17919,45 @@ msgstr ""
"КОÐФЛИКТ (промÑна/изтриване): „%s“ е изтрит в %s, а е променен в %s. ВерÑÐ¸Ñ "
"%s на „%s“ е оÑтавена в дървото."
+#. TRANSLATORS: This is a line of advice to resolve a merge
+#. conflict in a submodule. The first argument is the submodule
+#. name, and the second argument is the abbreviated id of the
+#. commit that needs to be merged. For example:
+#. - go to submodule (mysubmodule), and either merge commit abc1234"
+#.
#, c-format
msgid ""
-"Note: %s not up to date and in way of checking out conflicted version; old "
-"copy renamed to %s"
+" - go to submodule (%s), and either merge commit %s\n"
+" or update to an existing commit which has merged those changes\n"
msgstr ""
-"Бележка: „%s“ не е актуален и пречи за преминаването към верÑиÑта Ñ "
-"конфликт. СтариÑÑ‚ вариант е преименуван на „%s“"
+" ⃠преминаване към подмодула (%s), Ñлед които или де Ñе Ñлее подаването\n"
+" „%s“, или да Ñе обнови към ÑъщеÑтвуващо подаване, в които\n"
+" тези промени Ñа Ñлети\n"
+
+#, c-format
+msgid ""
+"Recursive merging with submodules currently only supports trivial cases.\n"
+"Please manually handle the merging of each conflicted submodule.\n"
+"This can be accomplished with the following steps:\n"
+"%s - come back to superproject and run:\n"
+"\n"
+" git add %s\n"
+"\n"
+" to record the above merge or update\n"
+" - resolve any other conflicts in the superproject\n"
+" - commit the resulting index in the superproject\n"
+msgstr ""
+"Ð’ момента рекурÑивното Ñливане Ñ Ð¼Ð¾Ð´ÑƒÐ»Ð¸ поддържа Ñамо тривиалните Ñлучаи.\n"
+"Ще Ñ‚Ñ€Ñбва ръчно да разрешавате конфликтите във вÑеки модул, в който Ñе "
+"поÑвÑÑ‚.\n"
+"Това може да Ñе поÑтигне чрез Ñледните Ñтъпки:\n"
+"%s — върнете Ñе към Ð¾Ð±Ñ…Ð²Ð°Ñ‰Ð°Ñ‰Ð¸Ñ Ð¿Ñ€Ð¾ÐµÐºÑ‚ и изпълнете:\n"
+"\n"
+" git add %s\n"
+"\n"
+" за да отбележите Ñливането или обновÑването\n"
+" ⃠решете конфликтите в Ð¾Ð±Ñ…Ð²Ð°Ñ‰Ð°Ñ‰Ð¸Ñ Ð¿Ñ€Ð¾ÐµÐºÑ‚\n"
+" ⃠подайте индекÑа в Ð¾Ð±Ñ…Ð²Ð°Ñ‰Ð°Ñ‰Ð¸Ñ Ð¿Ñ€Ð¾ÐµÐºÑ‚\n"
#. TRANSLATORS: The %s arguments are: 1) tree hash of a merge
#. base, and 2-3) the trees for the two trees we're merging.
@@ -17280,7 +18012,7 @@ msgstr "неуÑпешно Ñъздаване на Ñимволната връз
#, c-format
msgid "do not know what to do with %06o %s '%s'"
msgstr ""
-"не е ÑÑно какво да Ñе прави Ñ Ð¾Ð±ÐµÐºÑ‚Ð° „%2$s“ (%3$s) Ñ Ð¿Ñ€Ð°Ð²Ð° за доÑтъп „%1$06o“"
+"не е ÑÑно какво да Ñе прави Ñ Ð¾Ð±ÐµÐºÑ‚Ð° „%2$s“ (%3$s) Ñ Ð¿Ñ€Ð°Ð²Ð°Ì€ за доÑтъп „%1$06o“"
#, c-format
msgid "Fast-forwarding submodule %s to the following commit:"
@@ -17306,6 +18038,21 @@ msgstr ""
"подмодула:\n"
#, c-format
+msgid ""
+"If this is correct simply add it to the index for example\n"
+"by using:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"which will accept this suggestion.\n"
+msgstr ""
+"Ðко това е така, добавете го към индекÑа Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° като Ñледната:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"Това приема предложеното.\n"
+
+#, c-format
msgid "Failed to merge submodule %s (multiple merges found)"
msgstr "ÐеуÑпешно Ñливане на подмодула „%s“ (открити Ñа множеÑтво ÑливаниÑ)"
@@ -17378,8 +18125,8 @@ msgstr ""
#, c-format
msgid ""
-"CONFLICT (rename/rename): Rename \"%s\"->\"%s\" in branch \"%s\" rename \"%s"
-"\"->\"%s\" in \"%s\"%s"
+"CONFLICT (rename/rename): Rename \"%s\"->\"%s\" in branch \"%s\" rename "
+"\"%s\"->\"%s\" in \"%s\"%s"
msgstr ""
"КОÐФЛИКТ (преименуване/преименуване): „%s“ е преименуван на „%s“ в клон "
"„%s“, а „%s“ е преименуван на „%s“ в „%s“/%s."
@@ -17473,7 +18220,22 @@ msgid "failed to read the cache"
msgstr "кешът не може да бъде прочетен"
msgid "multi-pack-index OID fanout is of the wrong size"
-msgstr "неправилен размер на Ð¾Ñ‚ÐºÑŠÑ (OID fanout) на индекÑа за множеÑтво пакети"
+msgstr ""
+"неправилен размер на откъÑа за разпределÑнето в индекÑа за множеÑтво пакети"
+
+#, c-format
+msgid ""
+"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
+msgstr ""
+"неправилна подредба на откъÑи (OID fanout): fanout[%d] = %<PRIx32> > "
+"%<PRIx32> = fanout[%d]"
+
+msgid "multi-pack-index OID lookup chunk is the wrong size"
+msgstr "неправилен размер на откъÑа за Ñ‚ÑŠÑ€Ñенето в индекÑа за множеÑтво пакети"
+
+msgid "multi-pack-index object offset chunk is the wrong size"
+msgstr ""
+"неправилен размер на откъÑа за отмеÑтваниÑта в индекÑа за множеÑтво пакети"
#, c-format
msgid "multi-pack-index file %s is too small"
@@ -17493,17 +18255,25 @@ msgstr ""
"верÑиÑта на контролната Ñума на индекÑа за множеÑтво пакети %u не Ñъвпада Ñ "
"%u"
-msgid "multi-pack-index missing required pack-name chunk"
-msgstr "липÑва Ð¾Ñ‚ÐºÑŠÑ (pack-name) от Ð¸Ð½Ð´ÐµÐºÑ Ð·Ð° множеÑтво пакети"
+msgid "multi-pack-index required pack-name chunk missing or corrupted"
+msgstr ""
+"откъÑÑŠÑ‚ за имена на пакети в индекÑа за множеÑтво пакети липÑва или е "
+"повреден"
+
+msgid "multi-pack-index required OID fanout chunk missing or corrupted"
+msgstr ""
+"откъÑÑŠÑ‚ за разпределÑнето в индекÑа за множеÑтво пакети липÑва или е повреден"
-msgid "multi-pack-index missing required OID fanout chunk"
-msgstr "липÑва Ð¾Ñ‚ÐºÑŠÑ (OID fanout) от Ð¸Ð½Ð´ÐµÐºÑ Ð·Ð° множеÑтво пакети"
+msgid "multi-pack-index required OID lookup chunk missing or corrupted"
+msgstr "откъÑÑŠÑ‚ за Ñ‚ÑŠÑ€Ñене в Ð¸Ð½Ð´ÐµÐºÑ Ð·Ð° множеÑтво пакети липÑва или е повреден"
-msgid "multi-pack-index missing required OID lookup chunk"
-msgstr "липÑва Ð¾Ñ‚ÐºÑŠÑ (OID lookup) от Ð¸Ð½Ð´ÐµÐºÑ Ð·Ð° множеÑтво пакети"
+msgid "multi-pack-index required object offsets chunk missing or corrupted"
+msgstr ""
+"откъÑÑŠÑ‚ за отмеÑÑ‚Ð²Ð°Ð½Ð¸Ñ Ð² Ð¸Ð½Ð´ÐµÐºÑ Ð·Ð° множеÑтво пакети липÑва или е повреден"
-msgid "multi-pack-index missing required object offsets chunk"
-msgstr "липÑва Ð¾Ñ‚ÐºÑŠÑ Ð·Ð° отмеÑтваниÑта на обекти от Ð¸Ð½Ð´ÐµÐºÑ Ð·Ð° множеÑтво пакети"
+msgid "multi-pack-index pack-name chunk is too short"
+msgstr ""
+"откъÑÑŠÑ‚ за име на пакет в Ð¸Ð½Ð´ÐµÐºÑ Ð·Ð° множеÑтво пакети липÑва или е повреден"
#, c-format
msgid "multi-pack-index pack names out of order: '%s' before '%s'"
@@ -17516,11 +18286,23 @@ msgid "bad pack-int-id: %u (%u total packs)"
msgstr ""
"неправилен идентификатор на пакет (pack-int-id): %u (от общо %u пакети)"
+msgid "MIDX does not contain the BTMP chunk"
+msgstr ""
+"липÑва Ð¾Ñ‚ÐºÑŠÑ Ð·Ð° побитова маÑка във файла за индекÑа за множеÑтво пакети"
+
+#, c-format
+msgid "could not load bitmapped pack %<PRIu32>"
+msgstr "пакетът за битови маÑки %<PRIu32> не може да Ñе отвори"
+
msgid "multi-pack-index stores a 64-bit offset, but off_t is too small"
msgstr ""
"индекÑÑŠÑ‚ за множеÑтво пакети Ñъдържа 64-битови отмеÑтваниÑ, но размерът на "
"„off_t“ е недоÑтатъчен"
+msgid "multi-pack-index large offset out of bounds"
+msgstr ""
+"ÑтойноÑтта на отмеÑтването в индекÑа за множеÑтво пакети е извън диапазона"
+
#, c-format
msgid "failed to add packfile '%s'"
msgstr "пакетниÑÑ‚ файл „%s“ не може да бъде добавен"
@@ -17546,7 +18328,8 @@ msgstr "неправилен ред: „%s“."
msgid "ignoring existing multi-pack-index; checksum mismatch"
msgstr ""
-"индекÑÑŠÑ‚ за множеÑтво пакети Ñе преÑкача, защото контролната Ñума не Ñъвпада"
+"индекÑÑŠÑ‚ за множеÑтво пакети Ñе преÑкача, защото Ñумата за проверка не "
+"Ñъвпада"
msgid "could not load pack"
msgstr "пакетът не може да Ñе зареди"
@@ -17593,21 +18376,16 @@ msgid "failed to clear multi-pack-index at %s"
msgstr "индекÑÑŠÑ‚ за множеÑтво пакети не може да бъде изчиÑтен при „%s“"
msgid "multi-pack-index file exists, but failed to parse"
-msgstr "файлът Ñ Ð¸Ð½Ð´ÐµÐºÑа за множеÑтво пакети, но не може да бъде анализиран"
+msgstr ""
+"файлът Ñ Ð¸Ð½Ð´ÐµÐºÑа за множеÑтво пакети ÑъщеÑтвува, но не може да бъде "
+"анализиран"
msgid "incorrect checksum"
-msgstr "неправилна контролна Ñума"
+msgstr "неправилна Ñума за проверка"
msgid "Looking for referenced packfiles"
msgstr "ТърÑене на указаните пакетни файлове"
-#, c-format
-msgid ""
-"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
-msgstr ""
-"неправилна подредба на откъÑи (OID fanout): fanout[%d] = %<PRIx32> > "
-"%<PRIx32> = fanout[%d]"
-
msgid "the midx contains no oid"
msgstr "във файла Ñ Ð¸Ð½Ð´ÐµÐºÑа за множеÑтво пакети нÑма идентификатори на обекти"
@@ -17721,10 +18499,6 @@ msgstr ""
"%s: алтернативните хранилища за обекти Ñе пренебрегват поради прекалено "
"дълбоко влагане"
-#, c-format
-msgid "unable to normalize object directory: %s"
-msgstr "директориÑта за обекти „%s“ не може да бъде нормализирана"
-
msgid "unable to fdopen alternates lockfile"
msgstr "заключващиÑÑ‚ файл за алтернативите не може да Ñе отвори Ñ â€žfdopen“"
@@ -17784,6 +18558,10 @@ msgid "garbage at end of loose object '%s'"
msgstr "грешни данни в ÐºÑ€Ð°Ñ Ð½Ð° Ð½ÐµÐ¿Ð°ÐºÐµÑ‚Ð¸Ñ€Ð°Ð½Ð¸Ñ Ð¾Ð±ÐµÐºÑ‚ „%s“"
#, c-format
+msgid "unable to open loose object %s"
+msgstr "непакетираниÑÑ‚ обект „%s“ не може да Ñе отвори"
+
+#, c-format
msgid "unable to parse %s header"
msgstr "заглавната чаÑÑ‚ на „%s“ не може да бъде анализирана"
@@ -17799,18 +18577,14 @@ msgid "header for %s too long, exceeds %d bytes"
msgstr "заглавната чаÑÑ‚ на „%s“ е прекалено дълга — Ð½Ð°Ð´Ñ…Ð²ÑŠÑ€Ð»Ñ %d байта"
#, c-format
-msgid "failed to read object %s"
-msgstr "обектът „%s“ не може да бъде прочетен"
+msgid "loose object %s (stored in %s) is corrupt"
+msgstr "непакетираниÑÑ‚ обект „%s“ (в „%s“) е повреден"
#, c-format
msgid "replacement %s not found for %s"
msgstr "замеÑтителÑÑ‚ „%s“ на „%s“ не може да бъде открит"
#, c-format
-msgid "loose object %s (stored in %s) is corrupt"
-msgstr "непакетираниÑÑ‚ обект „%s“ (в „%s“) е повреден"
-
-#, c-format
msgid "packed object %s (stored in %s) is corrupt"
msgstr "пакетираниÑÑ‚ обект „%s“ (в „%s“) е повреден"
@@ -17820,10 +18594,7 @@ msgstr "файлът „%s“ не може да бъде запиÑан"
#, c-format
msgid "unable to set permission to '%s'"
-msgstr "правата за доÑтъп до „%s“ не може да бъдат зададени"
-
-msgid "file write error"
-msgstr "грешка при Ð·Ð°Ð¿Ð¸Ñ Ð½Ð° файл"
+msgstr "права̀та за доÑтъп до „%s“ не може да бъдат зададени"
msgid "error when closing loose object file"
msgstr "грешка при затварÑнето на файла Ñ Ð½ÐµÐ¿Ð°ÐºÐµÑ‚Ð¸Ñ€Ð°Ð½ обект"
@@ -17831,7 +18602,7 @@ msgstr "грешка при затварÑнето на файла Ñ Ð½ÐµÐ¿Ð°Ðº
#, c-format
msgid "insufficient permission for adding an object to repository database %s"
msgstr ""
-"нÑма права за добавÑне на обект към базата от данни на хранилището „%s“"
+"нÑма права̀ за добавÑне на обект към базата от данни на хранилището „%s“"
msgid "unable to create temporary file"
msgstr "не може да бъде Ñъздаден временен файл"
@@ -17852,14 +18623,31 @@ msgid "confused by unstable object source data for %s"
msgstr "грешка поради неÑÑ‚Ð°Ð±Ð¸Ð»Ð½Ð¸Ñ Ð¸Ð·Ñ‚Ð¾Ñ‡Ð½Ð¸Ðº данни за обектите „%s“"
#, c-format
+msgid "write stream object %ld != %<PRIuMAX>"
+msgstr "при запиÑа на обект в потока: %ld != %<PRIuMAX>"
+
+#, c-format
+msgid "unable to stream deflate new object (%d)"
+msgstr "новиÑÑ‚ обект не може да Ñе компреÑира поточно Ñ â€ždeflate“ (%d)"
+
+#, c-format
+msgid "deflateEnd on stream object failed (%d)"
+msgstr "неуÑпешно изпълнение на „deflateEnd“ върху Ð¿Ð¾Ñ‚Ð¾Ñ‡Ð½Ð¸Ñ Ð¾Ð±ÐµÐºÑ‚: %d"
+
+#, c-format
+msgid "unable to create directory %s"
+msgstr "директориÑта „%s“ не може да бъде Ñъздадена"
+
+#, c-format
msgid "cannot read object for %s"
msgstr "обектът за „%s“ не може да Ñе прочете"
-msgid "corrupt commit"
-msgstr "повредено подаване"
+#, c-format
+msgid "object fails fsck: %s"
+msgstr "„fsck“ откри грешка в обект: „%s“"
-msgid "corrupt tag"
-msgstr "повреден етикет"
+msgid "refusing to create malformed object"
+msgstr "не може да Ñе Ñъздаде Ñгрешен обект"
#, c-format
msgid "read error while indexing %s"
@@ -18079,6 +18867,62 @@ msgstr "обектът „%s“ не може да бъде анализиран
msgid "hash mismatch %s"
msgstr "разлика в контролната Ñума: „%s“"
+msgid "trying to write commit not in index"
+msgstr "опит за запиÑване на обект за подаване извън индекÑа"
+
+msgid "failed to load bitmap index (corrupted?)"
+msgstr ""
+"индекÑÑŠÑ‚ на база битови маÑки не може да Ñе зареди (възможно е да е повреден)"
+
+msgid "corrupted bitmap index (too small)"
+msgstr "повреден Ð¸Ð½Ð´ÐµÐºÑ Ð½Ð° база битови маÑки (прекалено малък)"
+
+msgid "corrupted bitmap index file (wrong header)"
+msgstr "повреден Ð¸Ð½Ð´ÐµÐºÑ Ð½Ð° база битови маÑки (неправилна заглавна чаÑÑ‚)"
+
+#, c-format
+msgid "unsupported version '%d' for bitmap index file"
+msgstr "верÑÐ¸Ñ â€ž%d“ на файла за индекÑа на база битови маÑки не Ñе поддържа"
+
+msgid "corrupted bitmap index file (too short to fit hash cache)"
+msgstr ""
+"повреден Ð¸Ð½Ð´ÐµÐºÑ Ð½Ð° база битови маÑки (прекалено малък, за да напаÑне на кеша "
+"за контролните Ñуми)"
+
+msgid "corrupted bitmap index file (too short to fit lookup table)"
+msgstr ""
+"повреден файл за Ð¸Ð½Ð´ÐµÐºÑ Ð½Ð° база битови маÑки (прекалено е малък дори и за "
+"таблицата ÑÑŠÑ ÑъответÑтвиÑ)"
+
+#, c-format
+msgid "duplicate entry in bitmap index: '%s'"
+msgstr "повтарÑщ Ñе Ð·Ð°Ð¿Ð¸Ñ Ð² Ð¸Ð½Ð´ÐµÐºÑ Ð½Ð° база битови маÑки: „%s“"
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for entry %d"
+msgstr ""
+"повредена битова маÑка във формат EWAH: отрÑзана заглавна чаÑÑ‚ за Ð·Ð°Ð¿Ð¸Ñ %d"
+
+#, c-format
+msgid "corrupt ewah bitmap: commit index %u out of range"
+msgstr ""
+"повредена битова маÑка във формат EWAH: индекÑÑŠÑ‚ на подаването %u е извън "
+"диапазона"
+
+msgid "corrupted bitmap pack index"
+msgstr "повреден пакетен Ð¸Ð½Ð´ÐµÐºÑ Ð½Ð° база битови маÑки"
+
+msgid "invalid XOR offset in bitmap pack index"
+msgstr "неправилно отмеÑтване по XOR в пакетен Ð¸Ð½Ð´ÐµÐºÑ Ð½Ð° база битови маÑки"
+
+msgid "cannot fstat bitmap file"
+msgstr "не може да Ñе получи Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð·Ð° файла Ñ Ð±Ð¸Ñ‚Ð¾Ð²Ð¸ маÑки Ñ â€žfstat“"
+
+msgid "checksum doesn't match in MIDX and bitmap"
+msgstr ""
+"Ñумата за проверка Ñе различава във файла Ñ Ð¸Ð½Ð´ÐµÐºÑа за множеÑтво пакети и "
+"битовата маÑка"
+
msgid "multi-pack bitmap is missing required reverse index"
msgstr "задължителниÑÑ‚ обратен Ð¸Ð½Ð´ÐµÐºÑ Ð»Ð¸Ð¿Ñва в многопакетната битова маÑка"
@@ -18086,15 +18930,84 @@ 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 ""
+"повредена таблица ÑÑŠÑ ÑъответÑтвиÑ: меÑтоположението на тройката е извън "
+"индекÑа"
+
+msgid "corrupt bitmap lookup table: xor chain exceeds entry count"
+msgstr ""
+"повредена таблица ÑÑŠÑ ÑъответÑтвиÑ: веригата за XOR е по-дълга от Ð±Ñ€Ð¾Ñ Ð½Ð° "
+"запиÑите"
+
#, c-format
-msgid "could not find %s in pack %s at offset %<PRIuMAX>"
+msgid "corrupt bitmap lookup table: commit index %u out of range"
+msgstr ""
+"повредена таблица ÑÑŠÑ ÑъответÑтвиÑ: индекÑÑŠÑ‚ на подаването %u е извън "
+"диапазона"
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for bitmap of commit \"%s\""
+msgstr ""
+"повредена битова маÑка във формат EWAH: отрÑзана заглавна чаÑÑ‚ за битовата "
+"маÑка на подаване „%s“"
+
+#, c-format
+msgid "unable to load pack: '%s', disabling pack-reuse"
+msgstr ""
+"пакетът не може да Ñе зареди: „%s“, преизползването на пакети Ñе изключва"
+
+#, c-format
+msgid "object '%s' not found in type bitmaps"
+msgstr "обектът „%s“ липÑва в битовата маÑка на видовете"
+
+#, c-format
+msgid "object '%s' does not have a unique type"
+msgstr "обектът „%s“ нÑма уникален вид"
+
+#, c-format
+msgid "object '%s': real type '%s', expected: '%s'"
+msgstr "обект „%s“: иÑтинÑкиÑÑ‚ му вид е „%s“, а Ñе очакваше „%s“"
+
+#, c-format
+msgid "object not in bitmap: '%s'"
+msgstr "обектът „%s“ липÑва в индекÑа на база битови маÑки"
+
+msgid "failed to load bitmap indexes"
+msgstr "неуÑпешно зареждане на индекÑи на база битови маÑки"
+
+msgid "you must specify exactly one commit to test"
+msgstr "Ñ‚Ñ€Ñбва да укажете точно едно подаване за теÑтване"
+
+#, c-format
+msgid "commit '%s' doesn't have an indexed bitmap"
+msgstr "подаването „%s“ нÑма Ð¸Ð½Ð´ÐµÐºÑ Ð½Ð° база битови маÑки"
+
+msgid "mismatch in bitmap results"
+msgstr "различие в резултатите от битовите маÑки"
+
+#, c-format
+msgid "could not find '%s' in pack '%s' at offset %<PRIuMAX>"
msgstr "„%s“ липÑва в пакет „%s“ при отмеÑтване %<PRIuMAX>"
#, c-format
+msgid "unable to get disk usage of '%s'"
+msgstr "използваното мÑÑто за Ñъхранение на „%s“ не може да бъде получено"
+
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "неправилна Ñума за проверка за файла Ñ Ð±Ð¸Ñ‚Ð¾Ð²Ð¸ маÑки „%s“"
+
+#, c-format
msgid "mtimes file %s is too small"
msgstr "файлът Ñ Ð²Ñ€ÐµÐ¼ÐµÑ‚Ð¾ на промÑна (mtime) „%s“ е твърде малък"
@@ -18140,6 +19053,21 @@ msgstr ""
"идентификатор на контролна Ñума %2$<PRIu32> на файла Ñ Ð¾Ð±Ñ€Ð°Ñ‚ÐµÐ½ Ð¸Ð½Ð´ÐµÐºÑ â€ž%1$s“ "
"не Ñе поддържа"
+msgid "invalid checksum"
+msgstr "неправилна Ñума за проверка"
+
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr ""
+"неправилна Ð¿Ð¾Ð·Ð¸Ñ†Ð¸Ñ Ð² Ð¾Ð±Ñ€Ð°Ñ‚Ð½Ð¸Ñ Ð¸Ð½Ð´ÐµÐºÑ Ð¿Ñ€Ð¸ %<PRIu64>: %<PRIu32> != %<PRIu32>"
+
+msgid "multi-pack-index reverse-index chunk is the wrong size"
+msgstr ""
+"неправилен размер на Ð¾Ñ‚ÐºÑŠÑ Ð·Ð° обратен Ð¸Ð½Ð´ÐµÐºÑ Ð² индекÑа за множеÑтво пакети"
+
+msgid "could not determine preferred pack"
+msgstr "предпочитаниÑÑ‚ пакет не може да Ñе определи"
+
msgid "cannot both write and verify reverse index"
msgstr "обратниÑÑ‚ Ð¸Ð½Ð´ÐµÐºÑ Ð½Ðµ може едновременно да Ñе запиÑва и да Ñе проверÑва"
@@ -18149,7 +19077,7 @@ msgstr "не може да Ñе получи Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ñ‡Ñ€ÐµÐ· „st
#, c-format
msgid "failed to make %s readable"
-msgstr "не може да Ñе дадат права за четене на „%s“"
+msgstr "не може да Ñе дадат права̀ за четене на „%s“"
#, c-format
msgid "could not write '%s' promisor file"
@@ -18198,14 +19126,6 @@ msgid "%s requires a value"
msgstr "опциÑта „%s“ изиÑква аргумент"
#, c-format
-msgid "%s is incompatible with %s"
-msgstr "опциите „%s“ и „%s“ Ñа неÑъвмеÑтими"
-
-#, c-format
-msgid "%s : incompatible with something else"
-msgstr "опциÑта „%s“ е неÑъвмеÑтима Ñ Ð½ÐµÑ‰Ð¾"
-
-#, c-format
msgid "%s takes no value"
msgstr "опциÑта „%s“ не приема аргументи"
@@ -18230,6 +19150,9 @@ msgstr "„--%s“ (Ñ 2 тирета) ли имахте предвид?"
msgid "alias of --%s"
msgstr "пÑевдоним на „--%s“"
+msgid "need a subcommand"
+msgstr "необходима е подкоманда"
+
#, c-format
msgid "unknown option `%s'"
msgstr "непозната опциÑ: „%s“"
@@ -18286,6 +19209,10 @@ msgstr " %s"
msgid "-NUM"
msgstr "-ЧИСЛО"
+#, c-format
+msgid "opposite of --no-%s"
+msgstr "обратното на „--no-%s“"
+
msgid "expiry-date"
msgstr "период на валидноÑÑ‚/запазване"
@@ -18301,6 +19228,9 @@ msgstr "по-малко подробноÑти"
msgid "use <n> digits to display object names"
msgstr "да Ñе показват такъв БРОЙ цифри от имената на обектите"
+msgid "prefixed path to initial superproject"
+msgstr "път Ñ Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ ÐºÑŠÐ¼ Ð¿ÑŠÑ€Ð²Ð¾Ð½Ð°Ñ‡Ð°Ð»Ð½Ð¸Ñ Ñвръхпроект"
+
msgid "how to strip spaces and #comments from message"
msgstr "кои празни знаци и #коментари да Ñе махат от ÑъобщениÑта"
@@ -18314,8 +19244,16 @@ msgstr ""
"знак „NUL“"
#, c-format
+msgid "bad boolean environment value '%s' for '%s'"
+msgstr "неправилна булева ÑтойноÑÑ‚ „%s“ за „%s“"
+
+#, c-format
+msgid "failed to parse %s"
+msgstr "„%s“ не може да бъде анализиран"
+
+#, c-format
msgid "Could not make %s writable by group"
-msgstr "Ðе може да Ñе дадат права за Ð·Ð°Ð¿Ð¸Ñ Ð² директориÑта „%s“ на групата"
+msgstr "Ðе може да Ñе дадат права̀ за Ð·Ð°Ð¿Ð¸Ñ Ð² директориÑта „%s“ на групата"
msgid "Escape character '\\' not allowed as last character in attr value"
msgstr ""
@@ -18361,6 +19299,10 @@ msgid "%s: 'literal' and 'glob' are incompatible"
msgstr "%s: опциите „literal“ и „glob“ Ñа неÑъвмеÑтими"
#, c-format
+msgid "'%s' is outside the directory tree"
+msgstr "„%s“ е извън дървото на директориите"
+
+#, c-format
msgid "%s: '%s' is outside repository at '%s'"
msgstr "%s: „%s“ е извън хранилището при „%s“"
@@ -18451,6 +19393,10 @@ msgid "promisor remote name cannot begin with '/': %s"
msgstr ""
"името отдалеченото хранилище-гарант не може за започва ÑÑŠÑ Ð·Ð½Ð°ÐºÐ° „/“: %s"
+#, c-format
+msgid "could not fetch %s from promisor remote"
+msgstr "„%s“ не може да Ñе доÑтави от гарантиращото хранилище"
+
msgid "object-info: expected flush after arguments"
msgstr "object-info: Ñлед аргументите Ñе очаква изчиÑтване на буферите"
@@ -18488,6 +19434,13 @@ msgid "could not parse log for '%s'"
msgstr "журналът Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñта на „%s“ не може да бъде анализиран"
#, c-format
+msgid "invalid extra cruft tip: '%s'"
+msgstr "неправилен ненужен връх: „%s“"
+
+msgid "unable to enumerate additional recent objects"
+msgstr "допълнителните Ñкорошни обекти не може да Ñе изброÑÑ‚"
+
+#, c-format
msgid "will not add file alias '%s' ('%s' already exists in index)"
msgstr ""
"нÑма да бъде добавен пÑевдоним за файл „%s“ („%s“ вече ÑъщеÑтвува в индекÑа)"
@@ -18510,10 +19463,6 @@ msgid "unable to add '%s' to index"
msgstr "„%s“ не може да Ñе добави в индекÑа"
#, c-format
-msgid "unable to stat '%s'"
-msgstr "„stat“ не може да Ñе изпълни върху „%s“"
-
-#, c-format
msgid "'%s' appears as both a file and as a directory"
msgstr "„%s“ ÑъщеÑтвува и като файл, и като директориÑ"
@@ -18631,10 +19580,6 @@ msgid "failed to convert to a sparse-index"
msgstr "индекÑÑŠÑ‚ не може да бъде превърнат в чаÑтичен"
#, c-format
-msgid "could not stat '%s'"
-msgstr "неуÑпешно изпълнение на „stat“ върху „%s“"
-
-#, c-format
msgid "unable to open git dir: %s"
msgstr "не може да Ñе отвори директориÑта на git: %s"
@@ -18644,12 +19589,20 @@ msgstr "неуÑпешно изтриване на „%s“"
#, c-format
msgid "cannot fix permission bits on '%s'"
-msgstr "правата за доÑтъп до „%s“ не може да бъдат поправени"
+msgstr "права̀та за доÑтъп до „%s“ не може да бъдат поправени"
#, c-format
msgid "%s: cannot drop to stage #0"
msgstr "%s: не може да Ñе премине към етап â„–0"
+#, c-format
+msgid "unexpected diff status %c"
+msgstr "неочакван изходен код при генериране на разлика: %c"
+
+#, c-format
+msgid "remove '%s'\n"
+msgstr "изтриване на „%s“\n"
+
msgid ""
"You can fix this with 'git rebase --edit-todo' and then run 'git rebase --"
"continue'.\n"
@@ -18683,9 +19636,12 @@ msgid ""
"l, label <label> = label current HEAD with a name\n"
"t, reset <label> = reset HEAD to a label\n"
"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
-". create a merge commit using the original merge commit's\n"
-". message (or the oneline, if no original merge commit was\n"
-". specified); use -c <commit> to reword the commit message\n"
+" create a merge commit using the original merge commit's\n"
+" message (or the oneline, if no original merge commit was\n"
+" specified); use -c <commit> to reword the commit message\n"
+"u, update-ref <ref> = track a placeholder for the <ref> to be updated\n"
+" to this position in the new commits. The <ref> is\n"
+" updated at the end of the rebase\n"
"\n"
"These lines can be re-ordered; they are executed from top to bottom.\n"
msgstr ""
@@ -18696,7 +19652,7 @@ msgstr ""
" e, edit ПОДÐÐ’ÐÐЕ — прилагане на подаването и Ñпиране при него за още "
"промѐни\n"
" s, squash ПОДÐÐ’ÐÐЕ — вкарване на подаването в предходното му\n"
-" f, fixup [-C | -c] ПОДÐÐ’ÐÐЕ\n"
+" f, fixup [-C|-c] ПОДÐÐ’ÐÐЕ\n"
" — вкарване на подаването в предходното му, без ÑмÑна на\n"
" Ñъобщението. С „-C“ Ñе използва Ñамо Ñъобщението на\n"
" наÑтоÑщото, а Ñ â€ž-c“ оÑвен това Ñе Ð¾Ñ‚Ð²Ð°Ñ€Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¾Ñ€ÑŠÑ‚\n"
@@ -18708,11 +19664,16 @@ msgstr ""
" d, drop ПОДÐÐ’ÐÐЕ — преÑкачане на подаването\n"
" l, label ЕТИКЕТ — задаване на етикет на указаното от HEAD\n"
" t, reset ЕТИКЕТ — занулÑване на HEAD към ЕТИКЕТа\n"
-" m, merge [-C ПОДÐÐ’ÐÐЕ | -c ПОДÐÐ’ÐÐЕ] ЕТИКЕТ [# ЕДИÐ_РЕД]\n"
+" m, merge [-C ПОДÐÐ’ÐÐЕ|-c ПОДÐÐ’ÐÐЕ] ЕТИКЕТ [# ЕДИÐ_РЕД]\n"
" — Ñъздаване на подаване ÑÑŠÑ Ñливане ÑÑŠÑ Ñъобщението от\n"
" първоначалното подаване (или Ñъобщението от ЕДИÐ_РЕД,\n"
" ако не е зададено подаване ÑÑŠÑ Ñливане. С опциÑта\n"
-" „-c ПОДÐÐ’ÐÐЕ“, може да Ñмените Ñъобщението.\n"
+" „-c ПОДÐÐ’ÐÐЕ“, може да Ñмените Ñъобщението\n"
+"u, update-ref УКÐЗÐТЕЛ\n"
+" — проÑледÑване на замеÑтител на УКÐЗÐТЕЛÑ, който Ñ‚Ñ€Ñбва\n"
+" да Ñе обнови до това положение в новите подаваниÑ.\n"
+" УКÐЗÐТЕЛÑÑ‚ Ñе обновÑва в ÐºÑ€Ð°Ñ Ð½Ð° пребазирането\n"
+"\n"
"\n"
"Може да променÑте поÑледователноÑтта на редовете — те Ñе изпълнÑват\n"
"поÑледователно отгоре-надолу.\n"
@@ -18808,6 +19769,14 @@ msgid "ahead %d, behind %d"
msgstr "напред Ñ %d, назад Ñ %d"
#, c-format
+msgid "%%(%.*s) does not take arguments"
+msgstr "%%(%.*s) не приема аргументи"
+
+#, c-format
+msgid "unrecognized %%(%.*s) argument: %s"
+msgstr "непознат аргумент за „%%(%.*s)“: %s"
+
+#, c-format
msgid "expected format: %%(color:<color>)"
msgstr "очакван формат: %%(color:ЦВЯТ)"
@@ -18824,42 +19793,38 @@ msgid "Integer value expected refname:rstrip=%s"
msgstr "очаква Ñе цÑло чиÑло за „refname:rstrip=%s“"
#, c-format
-msgid "unrecognized %%(%s) argument: %s"
-msgstr "непознат аргумент за „%%(%s)“: %s"
+msgid "expected %%(trailers:key=<value>)"
+msgstr "очаква Ñе %%(trailers:key=ЕПИЛОГ)"
#, c-format
-msgid "%%(objecttype) does not take arguments"
-msgstr "%%(objecttype) не приема аргументи"
+msgid "unknown %%(trailers) argument: %s"
+msgstr "непознат аргумент „%%(trailers)“: %s"
#, c-format
-msgid "%%(deltabase) does not take arguments"
-msgstr "%%(deltabase) не приема аргументи"
+msgid "positive value expected contents:lines=%s"
+msgstr "очаква Ñе положителна ÑтойноÑÑ‚ за „contents:lines=%s“"
#, c-format
-msgid "%%(body) does not take arguments"
-msgstr "%%(body) не приема аргументи"
+msgid "argument expected for %s"
+msgstr "„%s“ изиÑква аргумент"
#, c-format
-msgid "expected %%(trailers:key=<value>)"
-msgstr "очаква Ñе %%(trailers:key=ЕПИЛОГ)"
+msgid "positive value expected %s=%s"
+msgstr "очаква Ñе положителна ÑтойноÑÑ‚ за „%s=%s“"
#, c-format
-msgid "unknown %%(trailers) argument: %s"
-msgstr "непознат аргумент „%%(trailers)“: %s"
+msgid "cannot fully parse %s=%s"
+msgstr "„%s=%s“ не може да Ñе анализира докрай"
#, c-format
-msgid "positive value expected contents:lines=%s"
-msgstr "очаква Ñе положителна ÑтойноÑÑ‚ за „contents:lines=%s“"
+msgid "value expected %s="
+msgstr "очаква Ñе ÑтойноÑÑ‚ за „%s=“"
#, c-format
msgid "positive value expected '%s' in %%(%s)"
msgstr "очаква Ñе положителна ÑтойноÑÑ‚ за „%s“ в %%(%s)"
#, c-format
-msgid "unrecognized email option: %s"
-msgstr "непозната Ð¾Ð¿Ñ†Ð¸Ñ Ð·Ð° е-поща: %s"
-
-#, c-format
msgid "expected format: %%(align:<width>,<position>)"
msgstr "очакван формат: %%(align:ШИРОЧИÐÐ,ПОЗИЦИЯ)"
@@ -18872,12 +19837,16 @@ msgid "unrecognized width:%s"
msgstr "непозната широчина: %s"
#, c-format
+msgid "unrecognized %%(%s) argument: %s"
+msgstr "непознат аргумент за „%%(%s)“: %s"
+
+#, c-format
msgid "positive width expected with the %%(align) atom"
msgstr "очаква Ñе положителна широчина Ñ Ð»ÐµÐºÑемата „%%(align)“"
#, c-format
-msgid "%%(rest) does not take arguments"
-msgstr "%%(rest) не приема аргументи"
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "очакван формат: %%(ahead-behind:ПОДÐÐ’ÐÐЕ)"
#, c-format
msgid "malformed field name: %.*s"
@@ -18925,6 +19894,9 @@ msgid "--format=%.*s cannot be used with --python, --shell, --tcl"
msgstr ""
"опциÑта „--format=%.*s“ е неÑъвмеÑтима Ñ â€ž--python“, „--shell“, „--tcl“"
+msgid "failed to run 'describe'"
+msgstr "неуÑпешно изпълнение на „describe“"
+
#, c-format
msgid "(no branch, rebasing %s)"
msgstr "(извън клон, пребазиране на „%s“)"
@@ -18986,6 +19958,9 @@ msgstr "КЛЮЧ"
msgid "field name to sort on"
msgstr "име на полето, по което да е подредбата"
+msgid "exclude refs which match pattern"
+msgstr "преÑкачана на указателите напаÑващи на ШÐБЛОÐа"
+
#, c-format
msgid "not a reflog: %s"
msgstr "„%s“ не е журнал Ñ Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ"
@@ -19032,7 +20007,7 @@ msgstr "неправилно име на клон: „%s = %s“"
#, c-format
msgid "ignoring dangling symref %s"
-msgstr "игнориране на указател на обект извън клон „%s“"
+msgstr "игнориране на файл Ñ ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ» на обект извън клон „%s“"
#, c-format
msgid "log for ref %s has gap after %s"
@@ -19073,10 +20048,6 @@ msgid "cannot process '%s' and '%s' at the same time"
msgstr "невъзможно е едновременно да Ñе обработват „%s“ и „%s“"
#, c-format
-msgid "could not remove reference %s"
-msgstr "УказателÑÑ‚ „%s“ не може да бъде изтрит"
-
-#, c-format
msgid "could not delete reference %s: %s"
msgstr "УказателÑÑ‚ „%s“ не може да бъде изтрит: %s"
@@ -19188,6 +20159,13 @@ msgstr "протоколна грешка: очаква Ñе SHA1 или укаÐ
msgid "http transport does not support %s"
msgstr "транÑпортът по http не поддържа „%s“"
+msgid "protocol error: expected '<url> <path>', missing space"
+msgstr "протоколна грешка: очаква Ñе „ÐДРЕС ПЪТ“, липÑва интервал"
+
+#, c-format
+msgid "failed to download file at URL '%s'"
+msgstr "файлът на Ð°Ð´Ñ€ÐµÑ â€ž%s“ не може да Ñе Ñвали"
+
msgid "git-http-push failed"
msgstr "неуÑпешно изпълнение на „git-http-push“"
@@ -19423,13 +20401,14 @@ msgid_plural ""
"Your branch and '%s' have diverged,\n"
"and have %d and %d different commits each, respectively.\n"
msgstr[0] ""
-"ТекущиÑÑ‚ клон Ñе е отделил от „%s“,\n"
+"ТекущиÑÑ‚ клон Ñе е раздалечил от „%s“,\n"
"двата имат Ñъответно по %d и %d неÑъвпадащи подаваниÑ.\n"
msgstr[1] ""
-"ТекущиÑÑ‚ клон Ñе е отделил от „%s“,\n"
+"ТекущиÑÑ‚ клон Ñе е раздалечил от „%s“,\n"
"двата имат Ñъответно по %d и %d неÑъвпадащи подаваниÑ.\n"
-msgid " (use \"git pull\" to merge the remote branch into yours)\n"
+msgid ""
+" (use \"git pull\" if you want to integrate the remote branch with yours)\n"
msgstr " (Ñлейте Ð¾Ñ‚Ð´Ð°Ð»ÐµÑ‡ÐµÐ½Ð¸Ñ ÐºÐ»Ð¾Ð½ в Ð»Ð¾ÐºÐ°Ð»Ð½Ð¸Ñ Ñ‡Ñ€ÐµÐ· „git pull“)\n"
#, c-format
@@ -19506,10 +20485,6 @@ msgid "no remembered resolution for '%s'"
msgstr "липÑва запазена ÐºÐ¾Ñ€ÐµÐºÑ†Ð¸Ñ Ð½Ð° конфликт при „%s“"
#, c-format
-msgid "cannot unlink '%s'"
-msgstr "„%s“ не може да Ñе изтрие"
-
-#, c-format
msgid "Updated preimage for '%s'"
msgstr "ПредварителниÑÑ‚ вариант на „%s“ е обновен"
@@ -19532,9 +20507,30 @@ msgstr "не може да Ñе определи към какво да Ñочи
msgid "failed to find tree of %s"
msgstr "дървото, Ñочено от „%s“, не може да бъде открито"
+#, c-format
+msgid "unsupported section for hidden refs: %s"
+msgstr "неподдържан раздел за Ñкрити указатели: „%s“"
+
+msgid "--exclude-hidden= passed more than once"
+msgstr "опциÑта „--exclude-hidden=“ не може да Ñе подава повече от веднъж"
+
+#, c-format
+msgid "resolve-undo records `%s` which is missing"
+msgstr ""
+"в информациÑта за отмÑна на разрешените Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ Ð¿Ñ€Ð¸ÑÑŠÑтва „%s“, който "
+"липÑва"
+
+#, c-format
+msgid "could not get commit for ancestry-path argument %s"
+msgstr "подаването „%s“ към опциÑта „--ancestry-path“ не може да бъде получено"
+
msgid "--unpacked=<packfile> no longer supported"
msgstr "опциÑта „--unpacked=ПÐКЕТЕÐ_ФÐЙЛ“ вече не Ñе поддържа"
+#, c-format
+msgid "invalid option '%s' in --stdin mode"
+msgstr "опциите „%s“ и „--stdin“ Ñа неÑъвмеÑтими"
+
msgid "your current branch appears to be broken"
msgstr "ТекущиÑÑ‚ клон е повреден"
@@ -19554,6 +20550,206 @@ msgstr ""
msgid "cannot create async thread: %s"
msgstr "не може да Ñе Ñъздаде аÑинхронна нишка: %s"
+#, c-format
+msgid "'%s' does not exist"
+msgstr "„%s“ не ÑъщеÑтвува."
+
+#, c-format
+msgid "could not switch to '%s'"
+msgstr "не може да Ñе премине към „%s“"
+
+msgid "need a working directory"
+msgstr "необходима е работна директориÑ"
+
+msgid "Scalar enlistments require a worktree"
+msgstr "ЗачиÑлÑването на директории чрез „scalar“ изиÑква работно дърво"
+
+#, c-format
+msgid "could not configure %s=%s"
+msgstr "наÑтройката „%s=%s“ не може да Ñе зададе"
+
+msgid "could not configure log.excludeDecoration"
+msgstr "„log.excludeDecoration“ не може да Ñе наÑтрои"
+
+msgid "could not add enlistment"
+msgstr "Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð½Ðµ може да Ñе зачиÑли"
+
+msgid "could not set recommended config"
+msgstr "препоръчаните наÑтройки не може да Ñе зададат"
+
+msgid "could not turn on maintenance"
+msgstr "задачите по поддръжка не може да Ñе включат"
+
+msgid "could not start the FSMonitor daemon"
+msgstr "фоновиÑÑ‚ Ð¿Ñ€Ð¾Ñ†ÐµÑ Ð½Ð° FSMonitor не може да бъде ÑпрÑн"
+
+msgid "could not turn off maintenance"
+msgstr "задачите по поддръжка не може да Ñе изключат"
+
+msgid "could not remove enlistment"
+msgstr "директориÑта не може да Ñе отчиÑли"
+
+#, c-format
+msgid "remote HEAD is not a branch: '%.*s'"
+msgstr "отдалечениÑÑ‚ указател „HEAD“ не Ñочи към клон: „%.*s“"
+
+msgid "failed to get default branch name from remote; using local default"
+msgstr ""
+"името на ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ ÐºÐ»Ð¾Ð½ на отдалеченото хранилище не може да Ñе получи, "
+"затова ще Ñе ползва локално наÑтроеното име на ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ ÐºÐ»Ð¾Ð½"
+
+msgid "failed to get default branch name"
+msgstr "неуÑпешно получаване на името на ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ ÐºÐ»Ð¾Ð½"
+
+msgid "failed to unregister repository"
+msgstr "хранилището не може да бъде отчиÑлено"
+
+msgid "failed to stop the FSMonitor daemon"
+msgstr "фоновиÑÑ‚ Ð¿Ñ€Ð¾Ñ†ÐµÑ FSMonitor не може да бъде ÑпрÑн"
+
+msgid "failed to delete enlistment directory"
+msgstr "зачиÑлената Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð½Ðµ може да бъде изтрита"
+
+msgid "branch to checkout after clone"
+msgstr "към кой клон да Ñе премине Ñлед клониране"
+
+msgid "when cloning, create full working directory"
+msgstr "при клониране да Ñе Ñъздава пълна работна директориÑ"
+
+msgid "only download metadata for the branch that will be checked out"
+msgstr "да Ñе ÑвалÑÑ‚ метаданните Ñамо за изтеглÑÐ½Ð¸Ñ ÐºÐ»Ð¾Ð½"
+
+msgid "create repository within 'src' directory"
+msgstr "Ñъздаване на хранилище в Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ â€žsrc“"
+
+msgid ""
+"scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n"
+"\t[--[no-]src] <url> [<enlistment>]"
+msgstr ""
+"scalar clone [--single-branch] [--branch ОСÐОВЕÐ_КЛОÐ] [--full-clone]\n"
+" [--[no-]src] ÐДРЕС [ЗÐЧИСЛЕÐÐ_ДИРЕКТОРИЯ]"
+
+#, c-format
+msgid "cannot deduce worktree name from '%s'"
+msgstr "името на работното дърво не може да Ñе извлече от „%s“"
+
+#, c-format
+msgid "directory '%s' exists already"
+msgstr "директориÑта „%s“ вече ÑъщеÑтвува"
+
+#, c-format
+msgid "failed to get default branch for '%s'"
+msgstr "оÑновниÑÑ‚ клон на „%s“ не може да бъде получен"
+
+#, c-format
+msgid "could not configure remote in '%s'"
+msgstr "отдалеченото хранилище в „%s“ не може да Ñе наÑтрои"
+
+#, c-format
+msgid "could not configure '%s'"
+msgstr "„%s“ не може да Ñе наÑтрои"
+
+msgid "partial clone failed; attempting full clone"
+msgstr "неуÑпешно Ñъздаване на непълно хранилище, ще Ñе опита пълно хранилище"
+
+msgid "could not configure for full clone"
+msgstr "не може да Ñе наÑтрои пълно клониране"
+
+msgid "scalar diagnose [<enlistment>]"
+msgstr "scalar diagnose [ЗÐЧИСЛЕÐÐ_ДИРЕКТОРИЯ]"
+
+msgid "`scalar list` does not take arguments"
+msgstr "„scalar list“ не приема аргументи"
+
+msgid "scalar register [<enlistment>]"
+msgstr "scalar register [ЗÐЧИСЛЕÐÐ_ДИРЕКТОРИЯ]"
+
+msgid "reconfigure all registered enlistments"
+msgstr "пренаÑтройване на вÑички зачиÑлени директории"
+
+msgid "scalar reconfigure [--all | <enlistment>]"
+msgstr "scalar reconfigure [--all|ЗÐЧИСЛЕÐÐ_ДИРЕКТОРИЯ]"
+
+msgid "--all or <enlistment>, but not both"
+msgstr "опциÑта „--all“ и указването на зачиÑлена Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð½Ðµ Ñа ÑъвмеÑтими"
+
+#, c-format
+msgid "could not remove stale scalar.repo '%s'"
+msgstr "оÑтарÑлото Ñкаларно хранилище (scalar.repo) „%s“ не може да Ñе изтрие"
+
+#, c-format
+msgid "removed stale scalar.repo '%s'"
+msgstr "изтриване на оÑтарÑлото Ñкаларно хранилище (scalar.repo) „%s“"
+
+#, c-format
+msgid "repository at '%s' has different owner"
+msgstr "хранилището „%s“ Ñе притежава от друг"
+
+#, c-format
+msgid "repository at '%s' has a format issue"
+msgstr "хранилището в „%s“ е Ñ Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»ÐµÐ½ формат"
+
+#, c-format
+msgid "repository not found in '%s'"
+msgstr "в „%s“ липÑва хранилище на git"
+
+#, c-format
+msgid ""
+"to unregister this repository from Scalar, run\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+msgstr ""
+"за да преуÑтановите региÑтрациÑта на хранилището в Scalar, изпълнете\n"
+"\n"
+" git config --global --unset --fixed-value scalar.repo \"%s\""
+
+msgid ""
+"scalar run <task> [<enlistment>]\n"
+"Tasks:\n"
+msgstr ""
+"scalar run ЗÐДÐЧР[ЗÐЧИСЛЕÐÐ_ДИРЕКТОРИЯ]\n"
+"Задачи:\n"
+
+#, c-format
+msgid "no such task: '%s'"
+msgstr "нÑма задача Ñ Ð¸Ð¼Ðµ „%s“"
+
+msgid "scalar unregister [<enlistment>]"
+msgstr "scalar unregister [ЗÐЧИСЛЕÐÐ_ДИРЕКТОРИЯ]"
+
+msgid "scalar delete <enlistment>"
+msgstr "scalar delete ЗÐЧИСЛЕÐÐ_ДИРЕКТОРИЯ"
+
+msgid "refusing to delete current working directory"
+msgstr "текущата работна Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð½Ñма да бъде изтрита"
+
+msgid "include Git version"
+msgstr "включване и на верÑиÑта на git"
+
+msgid "include Git's build options"
+msgstr "включване и на опциите за компилиране на git"
+
+msgid "scalar verbose [-v | --verbose] [--build-options]"
+msgstr "scalar verbose [-v|--verbose] [--build-options]"
+
+msgid "-C requires a <directory>"
+msgstr "„-C“ изиÑква ДИРЕКТОРИЯ"
+
+#, c-format
+msgid "could not change to '%s'"
+msgstr "не може да Ñе влезе в директориÑта „%s“"
+
+msgid "-c requires a <key>=<value> argument"
+msgstr "опциÑта „-c“ изиÑква аргумент във вид КЛЮЧ=СТОЙÐОСТ"
+
+msgid ""
+"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
+"\n"
+"Commands:\n"
+msgstr ""
+"scalar [-C ДИРЕКТОРИЯ] [-c КЛЮЧ=СТОЙÐОСТ] КОМÐÐДР[ОПЦИЯ…]<\n"
+"\n"
+"Команди:\n"
+
msgid "unexpected flush packet while reading remote unpack status"
msgstr ""
"неочакван изчиÑтващ пакет „flush“ при изчитане на ÑÑŠÑтоÑнието от "
@@ -19685,10 +20881,6 @@ msgid "could not lock '%s'"
msgstr "„%s“ не може да Ñе заключи"
#, c-format
-msgid "could not write to '%s'"
-msgstr "в „%s“ не може да Ñе пише"
-
-#, c-format
msgid "could not write eol to '%s'"
msgstr "краÑÑ‚ на ред не може да Ñе запише в „%s“"
@@ -19703,10 +20895,6 @@ msgstr "локалните промѐни ще бъдат презапиÑан
msgid "commit your changes or stash them to proceed."
msgstr "подайте или Ñкатайте промѐните, за да продължите"
-#, c-format
-msgid "%s: fast-forward"
-msgstr "%s: превъртане"
-
#. TRANSLATORS: %s will be "revert", "cherry-pick" or
#. "rebase".
#.
@@ -19715,7 +20903,7 @@ msgid "%s: Unable to write new index file"
msgstr "%s: новиÑÑ‚ Ð¸Ð½Ð´ÐµÐºÑ Ð½Ðµ може да бъде запазен"
msgid "unable to update cache tree"
-msgstr "дървото на кеша не може да бъде обновено"
+msgstr "кешът на обектите-дървета не може да бъде обновен"
msgid "could not resolve HEAD commit"
msgstr "подаването, Ñочено от ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ â€žHEAD“, не може да бъде открито"
@@ -19949,10 +21137,6 @@ msgid "%s: cannot parse parent commit %s"
msgstr "%s: неразпозната ÑтойноÑÑ‚ за родителÑкото подаване „%s“"
#, c-format
-msgid "could not rename '%s' to '%s'"
-msgstr "„%s“ не може да Ñе преименува на „%s“"
-
-#, c-format
msgid "could not revert %s... %s"
msgstr "подаването „%s“… не може да бъде отменено: „%s“"
@@ -19973,6 +21157,23 @@ msgid "git %s: failed to refresh the index"
msgstr "git %s: неуÑпешно обновÑване на индекÑа"
#, c-format
+msgid "'%s' is not a valid label"
+msgstr "„%s“ е неправилен етикет"
+
+#, c-format
+msgid "'%s' is not a valid refname"
+msgstr "„%s“ е неправилно име на указател"
+
+#, c-format
+msgid "update-ref requires a fully qualified refname e.g. refs/heads/%s"
+msgstr ""
+"командата „update-ref“ изиÑква пълно име на указател, напр. „refs/heads/%s“"
+
+#, c-format
+msgid "invalid command '%.*s'"
+msgstr "неправилна команда „%.*s“"
+
+#, c-format
msgid "%s does not accept arguments: '%s'"
msgstr "„%s“ не приема аргументи: „%s“"
@@ -20030,14 +21231,14 @@ msgstr "в момента вече Ñе извършва отмÑна на поÐ
#, c-format
msgid "try \"git revert (--continue | %s--abort | --quit)\""
-msgstr "използвайте „git revert (--continue | %s--abort | --quit)“"
+msgstr "използвайте „git revert (--continue|%s--abort|--quit)“"
msgid "cherry-pick is already in progress"
msgstr "в момента вече Ñе извършва отбиране на подаваниÑ"
#, c-format
msgid "try \"git cherry-pick (--continue | %s--abort | --quit)\""
-msgstr "използвайте „git cherry-pick (--continue | %s--abort | --quit)“"
+msgstr "използвайте „git cherry-pick (--continue|%s--abort|--quit)“"
#, c-format
msgid "could not create sequencer directory '%s'"
@@ -20045,9 +21246,6 @@ msgstr ""
"директориÑта за определÑнето на поÑледователноÑтта „%s“ не може да бъде "
"Ñъздадена"
-msgid "could not lock HEAD"
-msgstr "указателÑÑ‚ „HEAD“ не може да Ñе заключи"
-
msgid "no cherry-pick or revert in progress"
msgstr ""
"в момента не Ñе извършва отбиране на Ð¿Ð¾Ð´Ð°Ð²Ð°Ð½Ð¸Ñ Ð¸Ð»Ð¸ пребазиране на клона"
@@ -20150,13 +21348,13 @@ msgstr ""
" git rebase --continue\n"
"\n"
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "и Ð¿Ñ€Ð¾Ð¼ÐµÐ½Ñ Ð¸Ð½Ð´ÐµÐºÑа и/или работното дърво\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "и Ð¿Ñ€Ð¾Ð¼ÐµÐ½Ñ Ð¸Ð½Ð´ÐµÐºÑа и/или работното дърво.\n"
#, c-format
msgid ""
"execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
"Commit or stash your changes, and then run\n"
"\n"
" git rebase --continue\n"
@@ -20173,16 +21371,16 @@ msgstr ""
msgid "illegal label name: '%.*s'"
msgstr "неправилно име на етикет: „%.*s“"
+#, c-format
+msgid "could not resolve '%s'"
+msgstr "„%s“ не може да бъде открит"
+
msgid "writing fake root commit"
msgstr "запазване на фалшиво начално подаване"
msgid "writing squash-onto"
msgstr "запазване на подаването, в което другите да Ñе вкарат"
-#, c-format
-msgid "could not resolve '%s'"
-msgstr "„%s“ не може да бъде открит"
-
msgid "cannot merge without a current revision"
msgstr "без текущо подаване не може да Ñе Ñлива"
@@ -20208,6 +21406,29 @@ msgstr "Ñливането на „%.*s“ не може даже да запоÑ
msgid "merge: Unable to write new index file"
msgstr "Ñливане: новиÑÑ‚ Ð¸Ð½Ð´ÐµÐºÑ Ð½Ðµ може да бъде запазен"
+#, c-format
+msgid ""
+"another 'rebase' process appears to be running; '%s.lock' already exists"
+msgstr ""
+"изглежда в момента тече друг Ð¿Ñ€Ð¾Ñ†ÐµÑ Ð·Ð° пребазиране; файлът „%s.lock“ вече "
+"ÑъщеÑтвува"
+
+#, c-format
+msgid ""
+"Updated the following refs with %s:\n"
+"%s"
+msgstr ""
+"Следните указатели Ñа обновени Ñ %s:\n"
+"%s"
+
+#, c-format
+msgid ""
+"Failed to update the following refs with %s:\n"
+"%s"
+msgstr ""
+"ÐеуÑпешно обновÑване на Ñледните указатели Ñ %s:\n"
+"%s"
+
msgid "Cannot autostash"
msgstr "Ðе може да Ñе Ñкатае автоматично"
@@ -20251,6 +21472,9 @@ msgstr "Конфликти при прилагането на автоматич
msgid "Autostash exists; creating a new stash entry."
msgstr "Вече има Ð·Ð°Ð¿Ð¸Ñ Ð·Ð° автоматично Ñкатано, затова Ñе Ñъздава нов запиÑ."
+msgid "autostash reference is a symref"
+msgstr "указателÑÑ‚ за автоматично Ñкатано e файл Ñ ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»"
+
msgid "could not detach HEAD"
msgstr "указателÑÑ‚ „HEAD“ не може да Ñе отдели"
@@ -20285,14 +21509,14 @@ msgstr ""
" git rebase --continue\n"
#, c-format
-msgid "Rebasing (%d/%d)%s"
-msgstr "Пребазиране (%d/%d)%s"
-
-#, c-format
msgid "Stopped at %s... %.*s\n"
msgstr "Спиране при „%s“… %.*s\n"
#, c-format
+msgid "Rebasing (%d/%d)%s"
+msgstr "Пребазиране (%d/%d)%s"
+
+#, c-format
msgid "unknown command %d"
msgstr "непозната команда %d"
@@ -20378,6 +21602,10 @@ msgid "the script was already rearranged."
msgstr "Ñкриптът вече е преподреден."
#, c-format
+msgid "update-refs file at '%s' is invalid"
+msgstr "файлът за обновÑване на указателите „%s“ е неправилен"
+
+#, c-format
msgid "'%s' is outside repository at '%s'"
msgstr "„%s“ е извън хранилището при „%s“"
@@ -20504,24 +21732,29 @@ msgstr ""
#, c-format
msgid ""
-"unsafe repository ('%s' is owned by someone else)\n"
-"To add an exception for this directory, call:\n"
+"detected dubious ownership in repository at '%s'\n"
+"%sTo add an exception for this directory, call:\n"
"\n"
"\tgit config --global --add safe.directory %s"
msgstr ""
-"хранилището не е безопаÑно („%s“ Ñе притежава от нÑкой друг)\n"
-"За да зададете изключение за тази директориÑ, изпълнете:\n"
+"заÑечено е проблемно притежание на хранилището „%s“\n"
+"%sЗа да зададете изключение за тази директориÑ, изпълнете:\n"
"\n"
" git config --global --add safe.directory %s"
#, c-format
+msgid "cannot use bare repository '%s' (safe.bareRepository is '%s')"
+msgstr ""
+"голото хранилище „%s“ не може да Ñе ползва („safe.bareRepository“ е „%s“)"
+
+#, c-format
msgid ""
"problem with core.sharedRepository filemode value (0%.3o).\n"
"The owner of files must always have read and write permissions."
msgstr ""
"зададениÑÑ‚ в „core.sharedRepository“ режим за доÑтъп до файлове е неправилен "
"(0%.3o).\n"
-"СобÑтвеникът на файла Ñ‚Ñ€Ñбва да има права за пиÑане и четене."
+"СобÑтвеникът на файла Ñ‚Ñ€Ñбва да има права̀ за пиÑане и четене."
msgid "fork failed"
msgstr "неуÑпешно Ñъздаване на Ð¿Ñ€Ð¾Ñ†ÐµÑ Ñ‡Ñ€ÐµÐ· „fork“"
@@ -20530,6 +21763,85 @@ msgid "setsid failed"
msgstr "неуÑпешно изпълнение на „setsid“"
#, c-format
+msgid "cannot stat template '%s'"
+msgstr "не може да Ñе получи Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ñ‡Ñ€ÐµÐ· „stat“ за шаблона „%s“"
+
+#, c-format
+msgid "cannot opendir '%s'"
+msgstr "директориÑта „%s“ не може да бъде отворена"
+
+#, c-format
+msgid "cannot readlink '%s'"
+msgstr "връзката „%s“ не може да бъде прочетена"
+
+#, c-format
+msgid "cannot symlink '%s' '%s'"
+msgstr "не може да Ñе Ñъздаде Ñимволна връзка „%s“ в „%s“"
+
+#, c-format
+msgid "cannot copy '%s' to '%s'"
+msgstr "„%s“ не може да Ñе копира в „%s“"
+
+#, c-format
+msgid "ignoring template %s"
+msgstr "игнориране на шаблона „%s“"
+
+#, c-format
+msgid "templates not found in %s"
+msgstr "нÑма шаблони в „%s“"
+
+#, c-format
+msgid "not copying templates from '%s': %s"
+msgstr "шаблоните нÑма да бъдат копирани от „%s“: „%s“"
+
+#, c-format
+msgid "invalid initial branch name: '%s'"
+msgstr "неправилно име на Ð¿ÑŠÑ€Ð²Ð¾Ð½Ð°Ñ‡Ð°Ð»Ð½Ð¸Ñ ÐºÐ»Ð¾Ð½: „%s“"
+
+#, c-format
+msgid "re-init: ignored --initial-branch=%s"
+msgstr "re-init: „--initial-branch=%s“ Ñе пропуÑка"
+
+#, c-format
+msgid "unable to handle file type %d"
+msgstr "файлове от вид %d не Ñе поддържат"
+
+#, c-format
+msgid "unable to move %s to %s"
+msgstr "„%s“ не може да Ñе премеÑти в „%s“"
+
+msgid "attempt to reinitialize repository with different hash"
+msgstr ""
+"опит за занулÑване на хранилището и инициализиране Ñ Ñ€Ð°Ð·Ð»Ð¸Ñ‡Ð½Ð° контролна Ñума"
+
+msgid ""
+"attempt to reinitialize repository with different reference storage format"
+msgstr ""
+"опит за занулÑване на хранилището и инициализиране Ñ Ñ€Ð°Ð·Ð»Ð¸Ñ‡ÐµÐ½ формат на "
+"ÑъхранÑване"
+
+#, c-format
+msgid "%s already exists"
+msgstr "ДиректориÑта „%s“ вече ÑъщеÑтвува"
+
+#, c-format
+msgid "Reinitialized existing shared Git repository in %s%s\n"
+msgstr ""
+"Инициализиране наново на ÑъщеÑтвуващо, Ñподелено хранилище на Git в „%s%s“\n"
+
+#, c-format
+msgid "Reinitialized existing Git repository in %s%s\n"
+msgstr "Инициализиране наново на ÑъщеÑтвуващо хранилище на Git в „%s%s“\n"
+
+#, c-format
+msgid "Initialized empty shared Git repository in %s%s\n"
+msgstr "Инициализиране на празно, Ñподелено хранилище на Git в „%s%s“\n"
+
+#, c-format
+msgid "Initialized empty Git repository in %s%s\n"
+msgstr "Инициализиране на празно хранилище на Git в „%s%s“\n"
+
+#, c-format
msgid "index entry is a directory, but not sparse (%08x)"
msgstr "обектът в индекÑа е директориÑ, но не чаÑтично изтеглена (%08x)"
@@ -20581,10 +21893,6 @@ msgstr[0] "%u байт/Ñек."
msgstr[1] "%u байта/Ñек."
#, c-format
-msgid "could not edit '%s'"
-msgstr "„%s“ не може да Ñе редактира"
-
-#, c-format
msgid "ignoring suspicious submodule name: %s"
msgstr "игнориране на подозрително име на подмодул: „%s“"
@@ -20766,11 +22074,26 @@ msgstr "„ls-tree“ завърши Ñ Ð½ÐµÐ¾Ñ‡Ð°ÐºÐ²Ð°Ð½ изходен код
msgid "failed to lstat '%s'"
msgstr "не може да бъде получена Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ñ‡Ñ€ÐµÐ· „lstat“ за „%s“"
-msgid "unhandled options"
-msgstr "неподдържани опции"
+msgid "no remote configured to get bundle URIs from"
+msgstr "не е наÑтроено отдалечено хранилище за ÑпиÑъците Ñ Ð°Ð´Ñ€ÐµÑи на пратки"
-msgid "error preparing revisions"
-msgstr "грешка при подготовката на верÑии"
+#, c-format
+msgid "remote '%s' has no configured URL"
+msgstr "не е зададен никакъв Ð°Ð´Ñ€ÐµÑ Ð·Ð° отдалеченото хранилище„%s“"
+
+msgid "could not get the bundle-uri list"
+msgstr "ÑпиÑъкът Ñ Ð°Ð´Ñ€ÐµÑи на пратки не може да Ñе получи"
+
+msgid "test-tool cache-tree <options> (control|prime|update)"
+msgstr "test-tool cache-tree ОПЦИЯ… (control|prime|update)"
+
+msgid "clear the cache tree before each iteration"
+msgstr "изчиÑтване на кеша на обектите-дървета преди вÑÑка итерациÑ"
+
+msgid "number of entries in the cache tree to invalidate (default 0)"
+msgstr ""
+"какъв брой запиÑи в кеша на обектите-дървета да Ñе отбележат като невалидни "
+"(Ñтандартно е 0)"
#, c-format
msgid "commit %s is not marked reachable"
@@ -20866,7 +22189,7 @@ msgstr "„%s“ не е обикновен файл"
#, c-format
msgid "file %s is not writable by user"
-msgstr "„%s“: нÑма права за запиÑване на файла"
+msgstr "„%s“: нÑма права̀ за запиÑване на файла"
msgid "could not open temporary file"
msgstr "временниÑÑ‚ файл не може да Ñе отвори"
@@ -20928,9 +22251,6 @@ msgstr "протоколът не поддържа задаването на пÑ
msgid "invalid remote service path"
msgstr "неправилен път на отдалечената уÑлуга"
-msgid "operation not supported by protocol"
-msgstr "опциÑта не Ñе поддържа от протокола"
-
#, c-format
msgid "can't connect to subservice %s"
msgstr "неуÑпешно Ñвързване към подуÑлугата „%s“"
@@ -21066,10 +22386,6 @@ msgid "support for protocol v2 not implemented yet"
msgstr "протокол верÑÐ¸Ñ 2 вÑе още не Ñе поддържа"
#, c-format
-msgid "unknown value for config '%s': %s"
-msgstr "непозната ÑтойноÑÑ‚ за наÑтройката „%s“: „%s“"
-
-#, c-format
msgid "transport '%s' not allowed"
msgstr "преноÑÑŠÑ‚ по „%s“ не е позволен"
@@ -21114,11 +22430,22 @@ msgstr "ПреуÑтановÑване на дейÑтвието."
msgid "failed to push all needed submodules"
msgstr "неуÑпешно изтлаÑкване на вÑички необходими подмодули"
+msgid "bundle-uri operation not supported by protocol"
+msgstr "операциÑта „bundle-uri“ (адреÑи на пратки) не Ñе поддържа от протокола"
+
+msgid "could not retrieve server-advertised bundle-uri list"
+msgstr ""
+"ÑпъÑъкът Ñ Ð°Ð´Ñ€ÐµÑи на пратки обÑвени за налични от Ñървъра не може да Ñе "
+"получи "
+
+msgid "operation not supported by protocol"
+msgstr "опциÑта не Ñе поддържа от протокола"
+
msgid "too-short tree object"
msgstr "прекалено кратък обект-дърво"
msgid "malformed mode in tree entry"
-msgstr "неправилни права за доÑтъп в Ð·Ð°Ð¿Ð¸Ñ Ð² дърво"
+msgstr "неправилни права̀ за доÑтъп в Ð·Ð°Ð¿Ð¸Ñ Ð² дърво"
msgid "empty filename in tree entry"
msgstr "празно име на файл в Ð·Ð°Ð¿Ð¸Ñ Ð² дърво"
@@ -21388,6 +22715,18 @@ msgstr "неправилен номер на порт"
msgid "invalid '..' path segment"
msgstr "неправилна чаÑÑ‚ от Ð¿ÑŠÑ‚Ñ â€ž..“"
+msgid "usage: "
+msgstr "употреба: "
+
+msgid "fatal: "
+msgstr "фатална грешка: "
+
+msgid "error: "
+msgstr "грешка: "
+
+msgid "warning: "
+msgstr "предупреждение: "
+
msgid "Fetching objects"
msgstr "ДоÑтавÑне на обектите"
@@ -21490,6 +22829,9 @@ msgstr "нÑма доÑтъп до „%s“"
msgid "unable to get current working directory"
msgstr "текущата работна Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ðµ недоÑтъпна"
+msgid "unable to get random bytes"
+msgstr "не може да Ñе получат Ñлучайни байтове"
+
msgid "Unmerged paths:"
msgstr "ÐеÑлети пътища:"
@@ -21850,14 +23192,18 @@ msgstr "Игнорирани файлове"
#, c-format
msgid ""
-"It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
-"may speed it up, but you have to be careful not to forget to add\n"
-"new files yourself (see 'git help status')."
+"It took %.2f seconds to enumerate untracked files,\n"
+"but the results were cached, and subsequent runs may be faster."
msgstr ""
-"БÑха необходими %.2f Ñекунди за изброÑването на неÑледените файлове.\n"
-"ДобавÑнето на опциÑта „-uno“ към командата „git status“ ще уÑкори\n"
-"изпълнението, но ще Ñ‚Ñ€Ñбва да добавÑте новите файлове ръчно.\n"
-"За повече подробноÑти погледнете „git status help“."
+"ИзброÑването на неÑледените файлове отне %.2f Ñекунди, но\n"
+"резултатите Ñа запомнени и може да забързат поÑледващиге изброÑваниÑ."
+
+#, c-format
+msgid "It took %.2f seconds to enumerate untracked files."
+msgstr "ИзброÑването на неÑледените файлове отне %.2f Ñекунди."
+
+msgid "See 'git help status' for information on how to improve this."
+msgstr "Вижте в „git help status“ за начините да подобрите това."
#, c-format
msgid "Untracked files not listed%s"
@@ -21938,6 +23284,10 @@ msgstr "оÑвен това в индекÑа има неподадени про
msgid "cannot %s: Your index contains uncommitted changes."
msgstr "не може да извършите „%s“, защото в индекÑа има неподадени промѐни."
+#, c-format
+msgid "unknown style '%s' given for '%s'"
+msgstr "непознат Ñтил „%s“ за „%s“"
+
msgid ""
"Error: Your local changes to the following files would be overwritten by "
"merge"
@@ -22006,312 +23356,6 @@ msgstr ""
msgid "Unable to determine absolute path of git directory"
msgstr "ÐбÑолютниÑÑ‚ път на работното дърво не може да Ñе определи"
-#. TRANSLATORS: you can adjust this to align "git add -i" status menu
-#, perl-format
-msgid "%12s %12s %s"
-msgstr "%14s %14s %s"
-
-#, perl-format
-msgid "touched %d path\n"
-msgid_plural "touched %d paths\n"
-msgstr[0] "%d файл заÑегнат\n"
-msgstr[1] "%d файла заÑегнати\n"
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for staging."
-msgstr ""
-"Ðко кръпката може да Ñе приложи чиÑто, редактираното парче ще бъде "
-"незабавно\n"
-"добавено към индекÑа"
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for stashing."
-msgstr ""
-"Ðко кръпката може да Ñе приложи чиÑто, редактираното парче ще бъде "
-"незабавно\n"
-"Ñкътано"
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for unstaging."
-msgstr ""
-"Ðко кръпката може да Ñе приложи чиÑто, редактираното парче ще бъде "
-"незабавно\n"
-"извадено от индекÑа."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for applying."
-msgstr ""
-"Ðко кръпката може да Ñе приложи чиÑто, редактираното парче ще бъде "
-"незабавно\n"
-"набелÑзано за прилагане."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for discarding."
-msgstr ""
-"Ðко кръпката може да Ñе приложи чиÑто, редактираното парче ще бъде "
-"незабавно\n"
-"набелÑзано за занулÑване."
-
-#, perl-format
-msgid "failed to open hunk edit file for writing: %s"
-msgstr "файлът за редактиране на парчето код не може да бъде отворен: „%s“"
-
-#, perl-format
-msgid ""
-"---\n"
-"To remove '%s' lines, make them ' ' lines (context).\n"
-"To remove '%s' lines, delete them.\n"
-"Lines starting with %s will be removed.\n"
-msgstr ""
-"———\n"
-"За да пропуÑнете редовете започващи Ñ â€ž%s“ — заменете знака ÑÑŠÑ â€ž “ (Ñтават "
-"контекÑÑ‚)\n"
-"За да пропуÑнете редовете започващи Ñ â€ž%s“ — изтрийте ги.\n"
-"Редовете, които започват Ñ â€ž%s“ ще бъдат пропуÑнати.\n"
-
-#, perl-format
-msgid "failed to open hunk edit file for reading: %s"
-msgstr ""
-"файлът за редактиране на парчето код не може да бъде отворен за четене: „%s“"
-
-msgid ""
-"y - stage this hunk\n"
-"n - do not stage this hunk\n"
-"q - quit; do not stage this hunk or any of the remaining ones\n"
-"a - stage this hunk and all later hunks in the file\n"
-"d - do not stage this hunk or any of the later hunks in the file"
-msgstr ""
-"y — добавÑне на парчето в индекÑа\n"
-"n — без добавÑне на парчето в индекÑа\n"
-"q — изход, без добавÑне на това и вÑички оÑтаващи парчета от файла\n"
-"a — добавÑне на това и вÑички Ñледващи парчета от файла в индекÑа\n"
-"d — без добавÑне на това и вÑички Ñледващи парчета от файла в индекÑа"
-
-msgid ""
-"y - stash this hunk\n"
-"n - do not stash this hunk\n"
-"q - quit; do not stash this hunk or any of the remaining ones\n"
-"a - stash this hunk and all later hunks in the file\n"
-"d - do not stash this hunk or any of the later hunks in the file"
-msgstr ""
-"y — Ñкатаване на парчето\n"
-"n — без Ñкатаване на парчето\n"
-"q — изход, без Ñкатаване на това и вÑички оÑтаващи парчета\n"
-"a — Ñкатаване на това и вÑички Ñледващи парчета от файла\n"
-"d — без Ñкатаване на това и вÑички Ñледващи парчета от файла"
-
-msgid ""
-"y - unstage this hunk\n"
-"n - do not unstage this hunk\n"
-"q - quit; do not unstage this hunk or any of the remaining ones\n"
-"a - unstage this hunk and all later hunks in the file\n"
-"d - do not unstage this hunk or any of the later hunks in the file"
-msgstr ""
-"y — изваждане на парчето от индекÑа\n"
-"n — без изваждане на парчето от индекÑа\n"
-"q — изход, без изваждане на това и вÑички оÑтаващи парчета от индекÑа\n"
-"a — изваждане на това и вÑички Ñледващи парчета от файла от индекÑа\n"
-"d — без изваждане на това и вÑички Ñледващи парчета от файла от индекÑа"
-
-msgid ""
-"y - apply this hunk to index\n"
-"n - do not apply this hunk to index\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y — прилагане на парчето към индекÑа\n"
-"n — без прилагане на парчето към индекÑа\n"
-"q — изход, без прилагане на това и вÑички оÑтаващи парчета към индекÑа\n"
-"a — прилагане на това и вÑички Ñледващи парчета от файла към индекÑа\n"
-"d — без прилагане на това и вÑички Ñледващи парчета от файла към индекÑа"
-
-msgid ""
-"y - discard this hunk from worktree\n"
-"n - do not discard this hunk from worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y — премахване на парчето от работното дърво\n"
-"n — без премахване на парчето от работното дърво\n"
-"q — изход, без премахване на това и вÑички оÑтаващи парчета от работното "
-"дърво\n"
-"a — премахване на това и вÑички Ñледващи парчета от файла от работното "
-"дърво\n"
-"d — без премахване на това и вÑички Ñледващи парчета от файла от работното "
-"дърво"
-
-msgid ""
-"y - discard this hunk from index and worktree\n"
-"n - do not discard this hunk from index and worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y — премахване на парчето от индекÑа и работното дърво\n"
-"n — без премахване на парчето от индекÑа и работното дърво\n"
-"q — изход, без премахване на това и вÑички оÑтаващи парчета от индекÑа и "
-"работното дърво\n"
-"a — премахване на това и вÑички Ñледващи парчета от файла от индекÑа и "
-"работното дърво\n"
-"d — без премахване на това и вÑички Ñледващи парчета от файла от индекÑа и "
-"работното дърво"
-
-msgid ""
-"y - apply this hunk to index and worktree\n"
-"n - do not apply this hunk to index and worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y — прилагане на парчето от индекÑа и работното дърво\n"
-"n — без прилагане на парчето от индекÑа и работното дърво\n"
-"q — изход, без прилагане на това и вÑички оÑтаващи парчета от индекÑа и "
-"работното дърво\n"
-"a — прилагане на това и вÑички Ñледващи парчета от файла от индекÑа и "
-"работното дърво\n"
-"d — без прилагане на това и вÑички Ñледващи парчета от файла от индекÑа и "
-"работното дърво"
-
-msgid ""
-"y - apply this hunk to worktree\n"
-"n - do not apply this hunk to worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y — прилагане на парчето към работното дърво\n"
-"n — без прилагане на парчето към работното дърво\n"
-"q — изход, без прилагане на това и вÑички оÑтаващи парчета\n"
-"a — прилагане на това и вÑички Ñледващи парчета от файла\n"
-"d — без прилагане на това и вÑички Ñледващи парчета от файла"
-
-msgid ""
-"g - select a hunk to go to\n"
-"/ - search for a hunk matching the given regex\n"
-"j - leave this hunk undecided, see next undecided hunk\n"
-"J - leave this hunk undecided, see next hunk\n"
-"k - leave this hunk undecided, see previous undecided hunk\n"
-"K - leave this hunk undecided, see previous hunk\n"
-"s - split the current hunk into smaller hunks\n"
-"e - manually edit the current hunk\n"
-"? - print help\n"
-msgstr ""
-"g — избор към кое парче да Ñе премине\n"
-"/ — Ñ‚ÑŠÑ€Ñене на парче, напаÑващо към даден регулÑрен израз\n"
-"j — без решение за парчето, към Ñледващото парче без решение\n"
-"J — без решение за парчето, към Ñледващото парче\n"
-"k — без решение за парчето, към предишното парче без решение\n"
-"K — без решение за парчето, към предишното парче\n"
-"s — разделÑне на текущото парче на по-малки\n"
-"e — ръчно редактиране на текущото парче\n"
-"? — извеждане не помощта\n"
-
-msgid "The selected hunks do not apply to the index!\n"
-msgstr "Избраните парчета не може да Ñе добавÑÑ‚ в индекÑа!\n"
-
-#, perl-format
-msgid "ignoring unmerged: %s\n"
-msgstr "пренебрегване на неÑлÑтото: „%s“\n"
-
-#, perl-format
-msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
-msgstr ""
-"Прилагане на промÑната в правата за доÑтъп към работното дърво [y,n,q,a,d"
-"%s,?]? "
-
-#, perl-format
-msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
-msgstr "Прилагане на изтриването към работното дърво [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
-msgstr "Прилагане на добавÑнето към работното дърво [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
-msgstr "Прилагане на парчето към работното дърво [y,n,q,a,d%s,?]? "
-
-msgid "No other hunks to goto\n"
-msgstr "ÐÑма други парчета\n"
-
-#, perl-format
-msgid "Invalid number: '%s'\n"
-msgstr "Ðеправилен номер: „%s“\n"
-
-#, perl-format
-msgid "Sorry, only %d hunk available.\n"
-msgid_plural "Sorry, only %d hunks available.\n"
-msgstr[0] "Има Ñамо %d парче.\n"
-msgstr[1] "Има Ñамо %d парчета.\n"
-
-msgid "No other hunks to search\n"
-msgstr "ÐÑма други парчета за Ñ‚ÑŠÑ€Ñене\n"
-
-#, perl-format
-msgid "Malformed search regexp %s: %s\n"
-msgstr "Сгрешен регулÑрен израз „%s“: %s\n"
-
-msgid "No hunk matches the given pattern\n"
-msgstr "Ðикое парче не напаÑва на регулÑÑ€Ð½Ð¸Ñ Ð¸Ð·Ñ€Ð°Ð·\n"
-
-msgid "No previous hunk\n"
-msgstr "ÐÑма друго парче преди това\n"
-
-msgid "No next hunk\n"
-msgstr "ÐÑма друго парче Ñлед това\n"
-
-msgid "Sorry, cannot split this hunk\n"
-msgstr "Това парче не може да бъде разделено\n"
-
-#, perl-format
-msgid "Split into %d hunk.\n"
-msgid_plural "Split into %d hunks.\n"
-msgstr[0] "РазделÑне на %d парче.\n"
-msgstr[1] "РазделÑне на %d парчета.\n"
-
-msgid "Sorry, cannot edit this hunk\n"
-msgstr "Това парче не може да бъде редактирано\n"
-
-#. TRANSLATORS: please do not translate the command names
-#. 'status', 'update', 'revert', etc.
-msgid ""
-"status - show paths with changes\n"
-"update - add working tree state to the staged set of changes\n"
-"revert - revert staged set of changes back to the HEAD version\n"
-"patch - pick hunks and update selectively\n"
-"diff - view diff between HEAD and index\n"
-"add untracked - add contents of untracked files to the staged set of "
-"changes\n"
-msgstr ""
-"status — извеждане на пътищата Ñ Ð¿Ñ€Ð¾Ð¼ÐµÌ€Ð½Ð¸Ñ‚Ðµ\n"
-"update — добавÑне на ÑÑŠÑтоÑнието на работното дърво към промѐните в\n"
-" индекÑа\n"
-"revert — отмÑна на промѐните в индекÑа към ÑÑŠÑтоÑнието Ñочено от "
-"„HEAD“\n"
-"patch — избиране на парчета код и обновÑване поединично\n"
-"diff — извеждане на разликата между ÑÑŠÑтоÑнието на Ñоченото от "
-"„HEAD“\n"
-" и индекÑа\n"
-"add untracked — добавÑне на неÑледените файлове към промѐните в индекÑа\n"
-
-msgid "missing --"
-msgstr "„--“ липÑва"
-
-#, perl-format
-msgid "unknown --patch mode: %s"
-msgstr "неизвеÑтна ÑÑ‚Ñ€Ð°Ñ‚ÐµÐ³Ð¸Ñ Ð·Ð° прилагане на кръпка към „--patch“: „%s“"
-
-#, perl-format
-msgid "invalid argument %s, expecting --"
-msgstr "указан е неправилен аргумент „%s“, а Ñе очаква „--“."
-
msgid "local zone differs from GMT by a non-minute interval\n"
msgstr ""
"разликата между меÑÑ‚Ð½Ð¸Ñ Ñ‡Ð°Ñови поÑÑ Ð¸ GMT Ñъдържа дробна чаÑÑ‚ от минута\n"
@@ -22437,13 +23481,13 @@ msgstr ""
"Изтрийте вÑичко, ако не иÑкате да изпратите обобщаващо пиÑмо.\n"
#, perl-format
-msgid "Failed to open %s: %s"
-msgstr "„%s“ не може да Ñе отвори: %s"
-
-#, perl-format
msgid "Failed to open %s.final: %s"
msgstr "„%s.final“ не може да Ñе отвори: %s"
+#, perl-format
+msgid "Failed to open %s: %s"
+msgstr "„%s“ не може да Ñе отвори: %s"
+
msgid "Summary email is empty, skipping it\n"
msgstr "Обобщаващото пиÑмо е празно и Ñе преÑкача\n"
@@ -22602,13 +23646,17 @@ msgid "(%s) Could not execute '%s'"
msgstr "(%s) Ðе може да бъде Ñе изпълни „%s“"
#, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) ДобавÑне на „%s: %s“ от: „%s“\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) Ðеправилен изход от: „%s“."
#, perl-format
msgid "(%s) failed to close pipe to '%s'"
msgstr "(%s) програмниÑÑ‚ канал не може да Ñе затвори за изпълнението на „%s“"
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) ДобавÑне на „%s: %s“ от: „%s“\n"
+
msgid "cannot send message as 7bit"
msgstr "Ñъобщението не може да Ñе изпрати чрез 7 битови знаци"
diff --git a/po/ca.po b/po/ca.po
index 80c430d..bcb4da8 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -1,18 +1,22 @@
# Catalan translations for Git.
# This file is distributed under the same license as the Git package.
# Alex Henrie <alexhenrie24@gmail.com>, 2014-2016.
-# Jordi Mas i Hernàndez <jmas@softcatala.org>, 2016-2022
+# Jordi Mas i Hernàndez <jmas@softcatala.org>, 2016-2024
#
-# Terminologia i criteris utilitzats
+# Terminologia
#
# Anglès | Català
# -----------------+---------------------------------
# ahead | davant per
# amend | esmenar
+# branch | branca
# broken | malmès
# bundle | farcell
+# check out | agafar
# chunk | fragment
+# commit | comissió
# cover letter | carta de presentació
+# cruft | superflu
# delta | diferència
# deprecated | en desús
# detached | separat
@@ -21,12 +25,15 @@
# fetch | obtenir
# flush | buidar / buidatge
# graph | graf
+# hash | resum
# hint | consell
# hook | lligam
# hunk | tros
+# multi-pack-index | índex multipaquet
# not supported | no està admès
# pull | baixar
# push | pujar
+# quote | cometes (ortogràfiques)
# repository | repositori
# setting | paràmetre
# shallow | superficial
@@ -49,6 +56,7 @@
# Anglès | Català
# -----------------+---------------------------------
# blame | «blame»
+# fanout | «fanout»
# HEAD | HEAD (f, la branca actual) - (no s'apostrofa)
# cherry pick | «cherry pick»
# promisor | «promisor»
@@ -61,12 +69,16 @@
#
# Vegeu també https://git.github.io/htmldocs/gitglossary.html
#
+# Criteris
+# - Mantingueu en anglès les referències a seccions de la documentació, ja que no està traduïda.
+# - Usem la convenció valenciana per a «per / per a», que inclou l'ús de «per a» davant d'infinitiu
+#
msgid ""
msgstr ""
"Project-Id-Version: Git\n"
"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2022-06-24 13:30+0200\n"
-"PO-Revision-Date: 2022-06-03 19:00-0600\n"
+"POT-Creation-Date: 2024-02-16 07:14+0100\n"
+"PO-Revision-Date: 2024-02-16 07:16+0100\n"
"Last-Translator: Jordi Mas i Hernàndez <jmas@softcatala.org>\n"
"Language-Team: Catalan\n"
"Language: ca\n"
@@ -102,13 +114,13 @@ msgstr "no s'ha pogut fer «stage» «%s»"
msgid "could not write index"
msgstr "no s'ha pogut escriure l'índex"
-#, c-format, perl-format
+#, c-format
msgid "updated %d path\n"
msgid_plural "updated %d paths\n"
msgstr[0] "actualitzat %d camí\n"
msgstr[1] "actualitzats %d camins\n"
-#, c-format, perl-format
+#, c-format
msgid "note: %s is untracked now.\n"
msgstr "nota: %s està ara sense seguiment.\n"
@@ -122,7 +134,7 @@ msgstr "Reverteix"
msgid "Could not parse HEAD^{tree}"
msgstr "No s'ha pogut analitzar HEAD^{tree}"
-#, c-format, perl-format
+#, c-format
msgid "reverted %d path\n"
msgid_plural "reverted %d paths\n"
msgstr[0] "revertit %d camí\n"
@@ -135,7 +147,7 @@ msgstr "Sense fitxers no seguits.\n"
msgid "Add untracked"
msgstr "Afegeix sense seguiment"
-#, c-format, perl-format
+#, c-format
msgid "added %d path\n"
msgid_plural "added %d paths\n"
msgstr[0] "afegit %d camí\n"
@@ -229,19 +241,19 @@ msgstr "no s'ha pogut actualitzar l'índex"
msgid "Bye.\n"
msgstr "Adeu.\n"
-#, c-format, perl-format
+#, c-format
msgid "Stage mode change [y,n,q,a,d%s,?]? "
msgstr "Canvia el mode de «stage» [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage deletion [y,n,q,a,d%s,?]? "
msgstr "Suprimeix «stage» [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage addition [y,n,q,a,d%s,?]? "
msgstr "Afegeix a «stage» [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage this hunk [y,n,q,a,d%s,?]? "
msgstr "Fer un «stage» d'aquest tros [y,n,q,a,d%s,?]? "
@@ -265,19 +277,19 @@ msgstr ""
"a - fes «stage» d'aquest tros i de tota la resta de trossos del fitxer\n"
"d - no facis «stage» d'aquest tros ni de cap altre restant del fitxer\n"
-#, c-format, perl-format
+#, c-format
msgid "Stash mode change [y,n,q,a,d%s,?]? "
msgstr "Canvia el mode de «stash» [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash deletion [y,n,q,a,d%s,?]? "
msgstr "Suprimeix «stash» [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash addition [y,n,q,a,d%s,?]? "
msgstr "Afegeix a «stash» [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash this hunk [y,n,q,a,d%s,?]? "
msgstr "Fer un «stash» d'aquest tros [y,n,q,a,d%s,?]? "
@@ -301,19 +313,19 @@ msgstr ""
"a - fes «stash» d'aquest tros i de tota la resta de trossos del fitxer\n"
"d - no facis «stash» d'aquest tros ni de cap altre restant del fitxer\n"
-#, c-format, perl-format
+#, c-format
msgid "Unstage mode change [y,n,q,a,d%s,?]? "
msgstr "Canvia el mode de «unstage» [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage deletion [y,n,q,a,d%s,?]? "
msgstr "Suprimeix «Unstage» [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage addition [y,n,q,a,d%s,?]? "
msgstr "Afegeix a «unstage» [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage this hunk [y,n,q,a,d%s,?]? "
msgstr "Fer un «unstage» d'aquest tros [y,n,q,a,d%s,?]? "
@@ -337,19 +349,19 @@ msgstr ""
"a - fes «unstage» d'aquest tros i de tota la resta de trossos del fitxer\n"
"d - no facis «unstage» d'aquest tros ni de cap altre restant del fitxer\n"
-#, c-format, perl-format
+#, c-format
msgid "Apply mode change to index [y,n,q,a,d%s,?]? "
msgstr "Aplica el canvi de mode a l'índex [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply deletion to index [y,n,q,a,d%s,?]? "
msgstr "Aplica la supressió a l'índex [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply addition to index [y,n,q,a,d%s,?]? "
msgstr "Aplica l'addició a l'índex [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply this hunk to index [y,n,q,a,d%s,?]? "
msgstr "Aplica aquest tros a l'índex [y,n,q,a,d%s,?]? "
@@ -373,19 +385,19 @@ msgstr ""
"a - aplica aquest tros i tots els trossos posteriors en el fitxer\n"
"d - no apliquis aquest tros ni cap dels trossos posteriors en el fitxer\n"
-#, c-format, perl-format
+#, c-format
msgid "Discard mode change from worktree [y,n,q,a,d%s,?]? "
msgstr "Descarta el canvi de mode de l'arbre de treball [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard deletion from worktree [y,n,q,a,d%s,?]? "
msgstr "Descarta suprimir de l'arbre de treball [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard addition from worktree [y,n,q,a,d%s,?]? "
msgstr "Descarta l'addició de l'arbre de treball [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard this hunk from worktree [y,n,q,a,d%s,?]? "
msgstr "Descarta aquest tros de l'arbre de treball [y,n,q,a,d%s,?]? "
@@ -409,22 +421,22 @@ msgstr ""
"a - descarta aquest tros i tots els trossos posteriors en el fitxer\n"
"d - no descartis aquest tros ni cap dels trossos posteriors en el fitxer\n"
-#, c-format, perl-format
+#, c-format
msgid "Discard mode change from index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
"Descarta el canvi de mode de l'índex i de l'arbre de treball [y,n,q,a,"
"d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard deletion from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Descarta suprimir de l'índex i de l'arbre de treball [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard addition from index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
"Descarta l'addició de l'índex i de l'arbre de treball [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard this hunk from index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
"Descarta aquest tros de l'índex i de l'arbre de treball [y,n,q,a,d%s,?]? "
@@ -442,20 +454,20 @@ msgstr ""
"a - descarta aquest tros i tots els trossos posteriors en el fitxer\n"
"d - no descartis aquest tros ni cap dels trossos posteriors en el fitxer\n"
-#, c-format, perl-format
+#, c-format
msgid "Apply mode change to index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
"Aplica el canvi de mode a l'índex i a l'arbre de treball [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply deletion to index and worktree [y,n,q,a,d%s,?]? "
msgstr "Aplica la supressió a l'índex i a l'arbre de treball [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply addition to index and worktree [y,n,q,a,d%s,?]? "
msgstr "Aplica l'addició a l'índex i a l'arbre de treball [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply this hunk to index and worktree [y,n,q,a,d%s,?]? "
msgstr "Aplica aquest tros a l'índex i a l'arbre de treball [y,n,q,a,d%s,?]? "
@@ -472,6 +484,22 @@ msgstr ""
"a - aplica aquest tros i tots els trossos posteriors en el fitxer\n"
"d - no apliquis aquest tros ni cap dels trossos posteriors en el fitxer\n"
+#, c-format
+msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
+msgstr "Aplica el canvi de mode a l'arbre de treball [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
+msgstr "Aplica la supressió a l'arbre de treball [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
+msgstr "Aplica l'addició a l'arbre de treball [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
+msgstr "Aplica aquest tros a l'arbre de treball [y,n,q,a,d%s,?]? "
+
msgid ""
"y - apply this hunk to worktree\n"
"n - do not apply this hunk to worktree\n"
@@ -489,10 +517,6 @@ msgstr ""
msgid "could not parse hunk header '%.*s'"
msgstr "no s'ha pogut analitzar la capçalera del tros «%.*s»"
-#, c-format
-msgid "could not parse colored hunk header '%.*s'"
-msgstr "no s'ha pogut analitzar la capçalera del tros acolorida «%.*s»"
-
msgid "could not parse diff"
msgstr "no s'ha pogut analitzar el diff"
@@ -549,8 +573,6 @@ msgstr ""
"Per a eliminar les línies «%c», suprimiu-les.\n"
"Les línies que comencin per %c s'eliminaran.\n"
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: 'it' refers to the patch mentioned in the previous messages.
msgid ""
"If it does not apply cleanly, you will be given an opportunity to\n"
"edit again. If all lines of the hunk are removed, then the edit is\n"
@@ -566,20 +588,12 @@ msgstr "no s'ha pogut analitzar la capçalera del tros"
msgid "'git apply --cached' failed"
msgstr "«git apply --cached» ha fallat"
-#. #-#-#-#-# add-patch.c.po #-#-#-#-#
#. TRANSLATORS: do not translate [y/n]
#. The program will only accept that input at this point.
#. Consider translating (saying "no" discards!) as
#. (saying "n" for "no" discards!) if the translation
#. of the word "no" does not start with n.
#.
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: do not translate [y/n]
-#. The program will only accept that input
-#. at this point.
-#. Consider translating (saying "no" discards!) as
-#. (saying "n" for "no" discards!) if the translation
-#. of the word "no" does not start with n.
msgid ""
"Your edited hunk does not apply. Edit again (saying \"no\" discards!) [y/n]? "
msgstr ""
@@ -694,9 +708,8 @@ msgstr "Baixar no és possible perquè teniu fitxers sense fusionar."
msgid "Reverting is not possible because you have unmerged files."
msgstr "Revertir no és possible perquè teniu fitxers sense fusionar."
-#, c-format
-msgid "It is not possible to %s because you have unmerged files."
-msgstr "No és possible %s perquè teniu fitxers sense fusionar."
+msgid "Rebasing is not possible because you have unmerged files."
+msgstr "Fer «rebase» no és possible perquè teniu fitxers sense fusionar."
msgid ""
"Fix them up in the work tree, and then use 'git add/rm <file>'\n"
@@ -718,6 +731,23 @@ msgstr "Cometeu els vostres canvis abans de fusionar."
msgid "Exiting because of unfinished merge."
msgstr "S'està sortint a causa d'una fusió no terminada."
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"Les branques divergents no es poden avançar ràpidament, cal que feu:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"o:\n"
+"\n"
+"\tgit rebase\n"
+
msgid "Not possible to fast-forward, aborting."
msgstr "No és possible avançar ràpidament, s'està avortant."
@@ -780,11 +810,33 @@ msgstr ""
"«false»\n"
"\n"
+#, c-format
+msgid ""
+"The following paths have been moved outside the\n"
+"sparse-checkout definition but are not sparse due to local\n"
+"modifications.\n"
+msgstr ""
+"Els camins següents s'han mogut fora de la\n"
+"definició de sparse-checkout però no són dispersos\n"
+"a causa de modificacions en local.\n"
+
+msgid ""
+"To correct the sparsity of these paths, do the following:\n"
+"* Use \"git add --sparse <paths>\" to update the index\n"
+"* Use \"git sparse-checkout reapply\" to apply the sparsity rules"
+msgstr ""
+"Per a corregir la dispersió d'aquests camins, feu el següent:\n"
+"* Useu «git add --sparse <paths>» per a actualitzar l'índex\n"
+"* Useu «git sparse-checkout reapply» per a aplicar les regles de dispersió"
+
msgid "cmdline ends with \\"
msgstr "la línia d'ordres acaba amb \\"
msgid "unclosed quote"
-msgstr "cita no tancada"
+msgstr "cometes no tancades"
+
+msgid "too many arguments"
+msgstr "hi ha massa arguments"
#, c-format
msgid "unrecognized whitespace option '%s'"
@@ -802,6 +854,12 @@ msgstr "les opcions «%s» i «%s» no es poden usar juntes"
msgid "'%s' outside a repository"
msgstr "«%s» fora d'un repositori"
+msgid "failed to read patch"
+msgstr "s'ha produït un error en llegir el pedaç"
+
+msgid "patch too large"
+msgstr "el pedaç és massa gran"
+
#, c-format
msgid "Cannot prepare timestamp regexp %s"
msgstr "No es pot preparar l'expressió regular de marca de temps %s"
@@ -1147,6 +1205,10 @@ msgid "cannot open %s"
msgstr "no es pot obrir %s"
#, c-format
+msgid "cannot unlink '%s'"
+msgstr "no es pot fer «unlink» de «%s»"
+
+#, c-format
msgid "Hunk #%d applied cleanly."
msgstr "El tros #%d s'ha aplicat netament."
@@ -1219,7 +1281,7 @@ msgid "instead of applying the patch, output a summary for the input"
msgstr "en lloc d'aplicar el pedaç, emet un resum de l'entrada"
msgid "instead of applying the patch, see if the patch is applicable"
-msgstr "en lloc d'aplicar el pedaç, veges si el pedaç és aplicable"
+msgstr "en lloc d'aplicar el pedaç, determina si el pedaç és aplicable"
msgid "make sure the patch is applicable to the current index"
msgstr "assegura que el pedaç sigui aplicable a l'índex actual"
@@ -1295,6 +1357,10 @@ msgid "unsupported file mode: 0%o (SHA1: %s)"
msgstr "mode de fitxer no compatible: 0%o (SHA1: %s)"
#, c-format
+msgid "deflate error (%d)"
+msgstr "error de deflació (%d)"
+
+#, c-format
msgid "unable to start '%s' filter"
msgstr "no s'ha pogut iniciar el filtre «%s»"
@@ -1314,10 +1380,6 @@ msgid "path too long (%d chars, SHA1: %s): %s"
msgstr "el camí és massa llarg (%d caràcters, SHA1: %s): %s"
#, c-format
-msgid "deflate error (%d)"
-msgstr "error de deflació (%d)"
-
-#, c-format
msgid "timestamp too large for this system: %<PRIuMAX>"
msgstr "marca de temps massa gran per a aquest sistema: %<PRIuMAX>"
@@ -1338,6 +1400,11 @@ msgid "cannot read '%s'"
msgstr "no es pot llegir «%s»"
#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr ""
+"l'especificació de camí «%s» coincideix amb fitxers fora del directori actual"
+
+#, c-format
msgid "pathspec '%s' did not match any files"
msgstr "l'especificació de camí «%s» no ha coincidit amb cap fitxer"
@@ -1353,9 +1420,6 @@ msgstr "no és un nom d'objecte vàlid: %s"
msgid "not a tree object: %s"
msgstr "no és un objecte d'arbre: %s"
-msgid "current working directory is untracked"
-msgstr "no se segueix el directori de treball actual"
-
#, c-format
msgid "File not found: %s"
msgstr "Fitxer no trobat: %s"
@@ -1364,17 +1428,17 @@ msgstr "Fitxer no trobat: %s"
msgid "Not a regular file: %s"
msgstr "No és un fitxer normal: %s"
-#, fuzzy, c-format
+#, c-format
msgid "unclosed quote: '%s'"
-msgstr "cita no tancada"
+msgstr "cometes no tancades: «%s»"
-#, fuzzy, c-format
+#, c-format
msgid "missing colon: '%s'"
-msgstr "falta el valor per «%s»"
+msgstr "falten els dos punts: «%s»"
-#, fuzzy, c-format
+#, c-format
msgid "empty file name: '%s'"
-msgstr "mbox buit: «%s»"
+msgstr "nom de fitxer buit: «%s»"
msgid "fmt"
msgstr "format"
@@ -1394,9 +1458,8 @@ msgstr "fitxer"
msgid "add untracked file to archive"
msgstr "inclou els fitxers no seguits a l'arxiu"
-#, fuzzy
msgid "path:content"
-msgstr "contingut"
+msgstr "camí: contingut"
msgid "write the archive to this file"
msgstr "escriu l'arxiu a aquest fitxer"
@@ -1407,6 +1470,12 @@ msgstr "llegeix .gitattributes en el directori de treball"
msgid "report archived files on stderr"
msgstr "informa de fitxers arxivats en stderr"
+msgid "time"
+msgstr "data"
+
+msgid "set modification time of archive entries"
+msgstr "estableix l'hora de modificació de les entrades de l'arxiu"
+
msgid "set compression level"
msgstr "estableix el nivell de compressió"
@@ -1436,6 +1505,10 @@ msgid "Unexpected option --output"
msgstr "Opció inesperada --output"
#, c-format
+msgid "extra command line parameter '%s'"
+msgstr "paràmetre extra de la línia d'ordres «%s»"
+
+#, c-format
msgid "Unknown archive format '%s'"
msgstr "Format d'arxiu desconegut «%s»"
@@ -1447,6 +1520,13 @@ msgstr "Argument no admès per al format «%s»: -%d"
msgid "%.*s is not a valid attribute name"
msgstr "%.*s no és un nom d'atribut vàlid"
+msgid "unable to add additional attribute"
+msgstr "no s'ha pogut afegir l'atribut addicional"
+
+#, c-format
+msgid "ignoring overly long attributes line %d"
+msgstr "s'ignorarà la línia d'atributs massa llarga %d"
+
#, c-format
msgid "%s not allowed: %s:%d"
msgstr "%s no està permès: %s:%d"
@@ -1459,6 +1539,29 @@ msgstr ""
"Useu «\\!» per exclamació capdavantera literal."
#, c-format
+msgid "cannot fstat gitattributes file '%s'"
+msgstr "no es pot fer fstat gitattributes al fitxer «%s»"
+
+#, c-format
+msgid "ignoring overly large gitattributes file '%s'"
+msgstr "s'ignorarà el fitxer «%s» gitattributes per a ser massa gran"
+
+#, c-format
+msgid "ignoring overly large gitattributes blob '%s'"
+msgstr "s'ignorarà el blob «%s» gitattributes per a ser massa gran"
+
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "--attr-source incorrecte o GIT_ATTR_SOURCE"
+
+#, c-format
+msgid "unable to stat '%s'"
+msgstr "no s'ha pogut fer «stat» a «%s»"
+
+#, c-format
+msgid "unable to read %s"
+msgstr "no s'ha pogut llegir %s"
+
+#, c-format
msgid "Badly quoted content in file '%s': %s"
msgstr "Comentari amb cometes errònies en el fitxer «%s»: %s"
@@ -1564,9 +1667,6 @@ msgstr[1] "Bisecant: manquen %d revisions a provar després d'aquesta %s\n"
msgid "--contents and --reverse do not blend well."
msgstr "--contents i --reverse no funcionen bé juntes."
-msgid "cannot use --contents with final commit object name"
-msgstr "no es pot usar --contents amb el nom d'objecte de la comissió final"
-
msgid "--reverse and --first-parent together require specified latest commit"
msgstr ""
"--reverse i --first-parent junts requereixen una última comissió especificada"
@@ -1686,8 +1786,10 @@ msgid "a branch named '%s' already exists"
msgstr "ja existeix una branca amb nom «%s»"
#, c-format
-msgid "cannot force update the branch '%s' checked out at '%s'"
-msgstr "no es pot forçar l'actualització de la branca «%s», agafada a «%s»"
+msgid "cannot force update the branch '%s' used by worktree at '%s'"
+msgstr ""
+"no es pot forçar l'actualització de la branca «%s» utilitzada per l'arbre de "
+"treball a «%s»"
#, c-format
msgid "cannot set up tracking information; starting point '%s' is not a branch"
@@ -1737,23 +1839,19 @@ msgstr "submòdul «%s»: no es pot trobar el submòdul"
#, c-format
msgid ""
-"You may try updating the submodules using 'git checkout %s && git submodule "
-"update --init'"
+"You may try updating the submodules using 'git checkout --no-recurse-"
+"submodules %s && git submodule update --init'"
msgstr ""
-"Podeu provar d'actualitzar els submòduls utilitzant «git checkout %s && git "
-"submodule update --init»"
+"Podeu provar d'actualitzar els submòduls utilitzant «git checkout --no-"
+"recurse-submodules %s && git submodule update --init»"
#, c-format
msgid "submodule '%s': cannot create branch '%s'"
msgstr "submòdul «%s»: no es pot crear la branca: «%s»"
#, c-format
-msgid "'%s' is already checked out at '%s'"
-msgstr "«%s» ja s'ha agafat a «%s»"
-
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "HEAD de l'arbre de treball %s no està actualitzat"
+msgid "'%s' is already used by worktree at '%s'"
+msgstr "«%s» ja s'utilitza en l'arbre de treball a «%s»"
msgid "git add [<options>] [--] <pathspec>..."
msgstr "git add [<opcions>] [--] <especificació-de-camí>..."
@@ -1762,39 +1860,32 @@ msgstr "git add [<opcions>] [--] <especificació-de-camí>..."
msgid "cannot chmod %cx '%s'"
msgstr "no es pot fer chmod %cx «%s»"
-#, c-format
-msgid "unexpected diff status %c"
-msgstr "estat de diff inesperat %c"
-
-msgid "updating files failed"
-msgstr "s'ha produït un error en actualitzar els fitxers"
-
-#, c-format
-msgid "remove '%s'\n"
-msgstr "elimina «%s»\n"
-
msgid "Unstaged changes after refreshing the index:"
msgstr "Canvis «unstaged» després d'actualitzar l'índex:"
-msgid "Could not read the index"
-msgstr "No s'ha pogut llegir l'índex"
+msgid ""
+"the add.interactive.useBuiltin setting has been removed!\n"
+"See its entry in 'git help config' for details."
+msgstr ""
+"s'ha eliminat la configuració add.interactive.useBuiltin\n"
+"Per a més detalls, vegeu la seva entrada a «git help config»."
-msgid "Could not write patch"
-msgstr "No s'ha pogut escriure el pedaç"
+msgid "could not read the index"
+msgstr "no s'ha pogut llegir l'índex"
msgid "editing patch failed"
msgstr "l'edició del pedaç ha fallat"
#, c-format
-msgid "Could not stat '%s'"
-msgstr "No s'ha pogut fer stat a «%s»"
+msgid "could not stat '%s'"
+msgstr "no s'ha pogut fer stat a «%s»"
-msgid "Empty patch. Aborted."
-msgstr "El pedaç és buit. S'ha avortat."
+msgid "empty patch. aborted"
+msgstr "pedaç buit. interromput"
#, c-format
-msgid "Could not apply '%s'"
-msgstr "No s'ha pogut aplicar «%s»"
+msgid "could not apply '%s'"
+msgstr "no s'ha pogut aplicar «%s»"
msgid "The following paths are ignored by one of your .gitignore files:\n"
msgstr ""
@@ -1845,7 +1936,7 @@ msgstr ""
"comprova si els fitxers, fins i tot els absents, s'ignoren en fer una prova"
msgid "allow updating entries outside of the sparse-checkout cone"
-msgstr "permet actualitzar entrada fora del con del «sparse-checkout»"
+msgstr "permet actualitzar les entrades fora del con del «sparse-checkout»"
msgid "override the executable bit of the listed files"
msgstr "sobreescriu el bit executable dels fitxers llistats"
@@ -1923,6 +2014,9 @@ msgstr ""
msgid "index file corrupt"
msgstr "fitxer d'índex malmès"
+msgid "unable to write new index file"
+msgstr "no s'ha pogut escriure un fitxer d'índex nou"
+
#, c-format
msgid "bad action '%s' for '%s'"
msgstr "acció «%s» incorrecta per a «%s»"
@@ -2131,9 +2225,6 @@ msgstr ""
"Podeu executar «git rm» en un fitxer per a acceptar «suprimit per ells» pel "
"fitxer."
-msgid "unable to write new index file"
-msgstr "no s'ha pogut escriure un fitxer d'índex nou"
-
#, c-format
msgid "Could not parse object '%s'."
msgstr "No s'ha pogut analitzar l'objecte «%s»."
@@ -2152,10 +2243,6 @@ msgstr ""
msgid "failed to read '%s'"
msgstr "s'ha produït un error en llegir «%s»"
-#, c-format
-msgid "options '%s=%s' and '%s=%s' cannot be used together"
-msgstr "les opcions «%s=%s» i «%s=%s» no es poden usar juntes"
-
msgid "git am [<options>] [(<mbox> | <Maildir>)...]"
msgstr "git am [<opcions>] [(<bústia> | <directori-de-correu>)...]"
@@ -2165,6 +2252,9 @@ msgstr "git am [<opcions>] (--continue | --skip | --abort)"
msgid "run interactively"
msgstr "executa interactivament"
+msgid "bypass pre-applypatch and applypatch-msg hooks"
+msgstr "evita els lligams pre-applypatch i applypatch-msg"
+
msgid "historical option -- no-op"
msgstr "opció històrica -- no-op"
@@ -2192,10 +2282,6 @@ msgstr "passa l'indicador -m a git-mailinfo"
msgid "pass --keep-cr flag to git-mailsplit for mbox format"
msgstr "passa l'indicador --keep-cr a git-mailsplit per al format mbox"
-msgid "do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"
-msgstr ""
-"no passis l'indicador --keep-cr a git-mailsplit independentment d'am.keepcr"
-
msgid "strip everything before a scissors line"
msgstr "elimina tot abans d'una línia de tisores"
@@ -2308,32 +2394,27 @@ msgstr "git archive: error de protocol"
msgid "git archive: expected a flush"
msgstr "git archive: s'esperava una neteja"
-msgid "git bisect--helper --bisect-reset [<commit>]"
-msgstr "git bisect--helper --bisect-reset [<comissió>]"
-
msgid ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<term> --term-{old,good}"
-"=<term>] [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] "
-"[<paths>...]"
+"git bisect start [--term-(new|bad)=<term> --term-(old|good)=<term>] [--no-"
+"checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]"
msgstr ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<term> --term-{old,good}"
-"=<term>] [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] "
-"[<paths>...]"
+"git bisect start [--term-(new|bad)=<term> --term-(old|good)=<term>] [--no-"
+"checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]"
-msgid "git bisect--helper --bisect-state (bad|new) [<rev>]"
-msgstr "git bisect--helper --bisect-state (bad|new) [<rev>]"
+msgid "git bisect (good|bad) [<rev>...]"
+msgstr "git bisect (good|bad) [<rev>...]"
-msgid "git bisect--helper --bisect-state (good|old) [<rev>...]"
-msgstr "git bisect--helper --bisect-state (good|old) [<rev>...]"
+msgid "git bisect skip [(<rev>|<range>)...]"
+msgstr "git bisect skip [(<rev>|<range>)...]"
-msgid "git bisect--helper --bisect-replay <filename>"
-msgstr "git bisect--helper --bisect-replay <filename>"
+msgid "git bisect reset [<commit>]"
+msgstr "git bisect reset [<comissió>]"
-msgid "git bisect--helper --bisect-skip [(<rev>|<range>)...]"
-msgstr "git bisect--helper --bisect-skip [(<rev>|<range>)...]"
+msgid "git bisect replay <logfile>"
+msgstr "git bisect replay <logfile>"
-msgid "git bisect--helper --bisect-run <cmd>..."
-msgstr "git bisect--helper --bisect-run <ordre>..."
+msgid "git bisect run <cmd> [<arg>...]"
+msgstr "git bisect run <cmd> [<arg>...]"
#, c-format
msgid "cannot open file '%s' in mode '%s'"
@@ -2375,7 +2456,7 @@ msgid ""
"could not check out original HEAD '%s'. Try 'git bisect reset <commit>'."
msgstr ""
"no s'ha pogut agafar la HEAD original «%s». Proveu «git bisect reset "
-"<commit>»."
+"<comissió>»."
#, c-format
msgid "Bad bisect_write argument: %s"
@@ -2423,16 +2504,20 @@ msgid "Are you sure [Y/n]? "
msgstr "N'esteu segur [Y/n]? "
msgid "status: waiting for both good and bad commits\n"
-msgstr ""
+msgstr "estat: s'estan esperant les comissions bones i dolentes\n"
#, c-format
msgid "status: waiting for bad commit, %d good commit known\n"
msgid_plural "status: waiting for bad commit, %d good commits known\n"
msgstr[0] ""
+"estat: s'està esperant una comissió incorrecta, es coneix %d comissió bona\n"
msgstr[1] ""
+"estat: s'està esperant una comissió incorrecta, es coneixen %d comissions "
+"bones\n"
msgid "status: waiting for good commit(s), bad commit known\n"
msgstr ""
+"estat: s'està esperant comissions bones, es coneix una comissió incorrecta\n"
msgid "no terms defined"
msgstr "cap terme definit"
@@ -2472,16 +2557,13 @@ msgid "'%s' does not appear to be a valid revision"
msgstr "«%s» no sembla ser una revisió vàlida"
msgid "bad HEAD - I need a HEAD"
-msgstr "HEAD incorrecte - cal un HEAD"
+msgstr "HEAD incorrecte - cal una HEAD"
#, c-format
msgid "checking out '%s' failed. Try 'git bisect start <valid-branch>'."
msgstr ""
"l'agafament de «%s» ha fallat. Proveu «git bisect start <branca-vàlida>»."
-msgid "won't bisect on cg-seek'ed tree"
-msgstr "no es bisecarà en un arbre en el qual s'ha fet cg-seek"
-
msgid "bad HEAD - strange symbolic ref"
msgstr "HEAD incorrecte - referència simbòlica estranya"
@@ -2533,7 +2615,7 @@ msgid "bisect run failed: no command provided."
msgstr "ha fallat l'execució de bisect: no s'ha proporcionat cap ordre."
#, c-format
-msgid "unable to verify '%s' on good revision"
+msgid "unable to verify %s on good revision"
msgstr "no s'ha pogut verificar «%s» en una bona revisió"
#, c-format
@@ -2541,10 +2623,10 @@ msgid "bogus exit code %d for good revision"
msgstr "codi d'error de sortida %d per a una bona revisió"
#, c-format
-msgid "bisect run failed: exit code %d from '%s' is < 0 or >= 128"
+msgid "bisect run failed: exit code %d from %s is < 0 or >= 128"
msgstr ""
-"l'execució de la de bisecció ha fallat: codi de sortida %d de «%s» és < 0 o "
-">= 128"
+"l'execució de la de bisecció ha fallat: codi de sortida %d de %s és < 0 o >= "
+"128"
#, c-format
msgid "cannot open file '%s' for writing"
@@ -2553,76 +2635,50 @@ msgstr "no es pot obrir «%s» per a escriptura"
msgid "bisect run cannot continue any more"
msgstr "l'execució de la bisecció no pot continuar més"
-#, c-format
msgid "bisect run success"
msgstr "execució de bisecció amb èxit"
-#, c-format
msgid "bisect found first bad commit"
msgstr "la bisecció ha trobat una primera comissió errònia"
#, c-format
-msgid ""
-"bisect run failed: 'git bisect--helper --bisect-state %s' exited with error "
-"code %d"
+msgid "bisect run failed: 'git bisect %s' exited with error code %d"
msgstr ""
-"l'execució de la bisecció ha fallat: «git bisect--helper --bisect-state %s» "
-"ha sortit amb el codi d'error %d"
-
-msgid "reset the bisection state"
-msgstr "restableix l'estat de la bisecció"
-
-msgid "check whether bad or good terms exist"
-msgstr "comprova si existeixen termes correctes o incorrectes"
-
-msgid "print out the bisect terms"
-msgstr "imprimeix els termes de la bisecció"
-
-msgid "start the bisect session"
-msgstr "inicia la sessió bisecció"
-
-msgid "find the next bisection commit"
-msgstr "troba la comissió de bisecció següent"
+"ha fallat l'execució del bisect: «git bisect %s» ha sortit amb el codi "
+"d'error %d"
-msgid "mark the state of ref (or refs)"
-msgstr "marca l'estat de la referència o referències"
-
-msgid "list the bisection steps so far"
-msgstr "mostra les passes de la bisecció fins ara"
-
-msgid "replay the bisection process from the given file"
-msgstr "torna a reproduir el procés de bisecció des del fitxer donat"
-
-msgid "skip some commits for checkout"
-msgstr "omet algunes comissions en agafar"
-
-msgid "visualize the bisection"
-msgstr "visualitza la bisecció"
-
-msgid "use <cmd>... to automatically bisect"
-msgstr "useu <cmd>... per a fer una bisecció automàticament"
+#, c-format
+msgid "'%s' requires either no argument or a commit"
+msgstr "«%s» no requereix cap argument ni comissió"
-msgid "no log for BISECT_WRITE"
-msgstr "no hi ha registre per a BISECT_WRITE"
+#, c-format
+msgid "'%s' requires 0 or 1 argument"
+msgstr "%s requereix 0 o 1 arguments"
-msgid "--bisect-reset requires either no argument or a commit"
-msgstr "--bisect-reset no requereix cap argument ni comissió"
+#, c-format
+msgid "'%s' requires 0 arguments"
+msgstr "«%s» requereix 0 arguments"
-msgid "--bisect-terms requires 0 or 1 argument"
-msgstr "--bisect-terms requereix 0 o 1 argument"
+msgid "no logfile given"
+msgstr "no s'ha donat cap fitxer de registre"
-msgid "--bisect-next requires 0 arguments"
-msgstr "--bisect-next no requereix cap argument"
+#, c-format
+msgid "'%s' failed: no command provided."
+msgstr "«%s» ha fallat: no s'ha proporcionat cap ordre."
-msgid "--bisect-log requires 0 arguments"
-msgstr "--bisect-log no requereix cap argument"
+msgid "need a command"
+msgstr "cal una subordre"
-msgid "no logfile given"
-msgstr "no s'ha donat cap fitxer de registre"
+#, c-format
+msgid "unknown command: '%s'"
+msgstr "ordre desconeguda: «%s»"
msgid "git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"
msgstr "git blame [<opcions>] [<opcions-de-revisió>] [<revisió>] [--] fitxer"
+msgid "git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"
+msgstr "git annotate [<opcions>] [<rev-opts>] [<rev>] [--] <fitxer>"
+
msgid "<rev-opts> are documented in git-rev-list(1)"
msgstr "es documenten les <opcions-de-revisió> en git-rev-list(1)"
@@ -2650,7 +2706,7 @@ msgstr ""
"no tractis les comissions arrel com de frontera (per defecte: desactivat)"
msgid "show work cost statistics"
-msgstr "mostra les estadístiques de preu de treball"
+msgstr "mostra les estadístiques del cost de treball"
msgid "force progress reporting"
msgstr "força l'informe de progrés"
@@ -2678,7 +2734,7 @@ msgid "show raw timestamp (Default: off)"
msgstr "mostra la marca de temps en cru (per defecte: desactivat)"
msgid "show long commit SHA1 (Default: off)"
-msgstr "mostra l'SHA1 de comissió llarg (per defecte: desactivat)"
+msgstr "mostra l'SHA1 de la comissió en format llarg (per defecte: desactivat)"
msgid "suppress author name and timestamp (Default: off)"
msgstr "omet el nom d'autor i la marca de temps (per defecte: desactivat)"
@@ -2762,11 +2818,11 @@ msgid ""
"git branch [<options>] [-f] [--recurse-submodules] <branch-name> [<start-"
"point>]"
msgstr ""
-"git branch [<options>] [-f] [--recurse-submodules] <branch-name> [<start-"
+"git branch [<opcions>] [-f] [--recurse-submodules] <branch-name> [<start-"
"point>]"
msgid "git branch [<options>] [-l] [<pattern>...]"
-msgstr "git branch [<options>] [-l] [<pattern>...]"
+msgstr "git branch [<opcions>] [-l] [<patró>...]"
msgid "git branch [<options>] [-r] (-d | -D) <branch-name>..."
msgstr "git branch [<opcions>] [-r] (-d | -D) <nom-de-branca>..."
@@ -2786,53 +2842,57 @@ msgstr "git branch [<opcions>] [-r | -a] [--format]"
#, c-format
msgid ""
"deleting branch '%s' that has been merged to\n"
-" '%s', but not yet merged to HEAD."
+" '%s', but not yet merged to HEAD"
msgstr ""
-"s'està suprimint la branca «%s» que s'ha\n"
-" fusionat a «%s», però encara no\n"
-" s'ha fusionat a HEAD."
+"s'està suprimint la branca «%s» que s'ha fusionat a\n"
+" «%s», però encara no s'ha fusionat a HEAD"
#, c-format
msgid ""
"not deleting branch '%s' that is not yet merged to\n"
-" '%s', even though it is merged to HEAD."
+" '%s', even though it is merged to HEAD"
msgstr ""
-"no s'està suprimint la branca «%s» que encara no\n"
-" s'ha fusionat a «%s», encara que està\n"
-" fusionada a HEAD."
+"no s'està suprimint la branca «%s» que encara no s'ha fusionat a\n"
+" «%s», encara que s'hagi fusionat a HEAD"
#, c-format
-msgid "Couldn't look up commit object for '%s'"
-msgstr "No s'ha pogut trobar l'objecte de comissió de «%s»"
+msgid "couldn't look up commit object for '%s'"
+msgstr "no s'ha pogut cercar l'objecte de comissió per a «%s»"
#, c-format
-msgid ""
-"The branch '%s' is not fully merged.\n"
-"If you are sure you want to delete it, run 'git branch -D %s'."
-msgstr ""
-"La branca «%s» no està totalment fusionada.\n"
-"Si esteu segur que la voleu suprimir, executeu «git branch -D %s»."
+msgid "the branch '%s' is not fully merged"
+msgstr "la branca «%s» no està completament fusionada"
+
+#, c-format
+msgid "If you are sure you want to delete it, run 'git branch -D %s'"
+msgstr "Si esteu segur que voleu suprimir-la, executeu «git branch -D %s»"
-msgid "Update of config-file failed"
-msgstr "L'actualització del fitxer de configuració ha fallat"
+msgid "update of config-file failed"
+msgstr "ha fallat l'actualització del fitxer de configuració"
msgid "cannot use -a with -d"
msgstr "no es pot usar -a amb -d"
-msgid "Couldn't look up commit object for HEAD"
-msgstr "No s'ha pogut trobar l'objecte de comissió de HEAD"
+#, c-format
+msgid "cannot delete branch '%s' used by worktree at '%s'"
+msgstr ""
+"no es pot suprimir la branca «%s» utilitzada per l'arbre de treball a «%s»"
#, c-format
-msgid "Cannot delete branch '%s' checked out at '%s'"
-msgstr "No es pot suprimir la branca «%s» agafada a «%s»"
+msgid "remote-tracking branch '%s' not found"
+msgstr "no s'ha trobat la branca de seguiment remot «%s»"
#, c-format
-msgid "remote-tracking branch '%s' not found."
-msgstr "no s'ha trobat la branca amb seguiment remot «%s»."
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"no s'ha trobat la branca «%s».\n"
+"Us heu oblidat de --remote?"
#, c-format
-msgid "branch '%s' not found."
-msgstr "no s'ha trobat la branca «%s»."
+msgid "branch '%s' not found"
+msgstr "no s'ha trobat la branca «%s»"
#, c-format
msgid "Deleted remote-tracking branch %s (was %s).\n"
@@ -2853,50 +2913,56 @@ msgid "HEAD (%s) points outside of refs/heads/"
msgstr "HEAD (%s) apunta fora de refs/heads/"
#, c-format
-msgid "Branch %s is being rebased at %s"
-msgstr "S'està fent «rebase» en la branca %s a %s"
+msgid "branch %s is being rebased at %s"
+msgstr "a la branca %s se li està fent a «rebase» a %s"
#, c-format
-msgid "Branch %s is being bisected at %s"
-msgstr "La branca %s s'està bisecant a %s"
+msgid "branch %s is being bisected at %s"
+msgstr "la branca %s s'està bisecant a %s"
-msgid "cannot copy the current branch while not on any."
-msgstr "no es pot copiar branca actual mentre no s'és a cap."
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "HEAD de l'arbre de treball %s no està actualitzat"
-msgid "cannot rename the current branch while not on any."
-msgstr "no es pot canviar el nom de la branca actual mentre no s'és a cap."
+#, c-format
+msgid "invalid branch name: '%s'"
+msgstr "el nom de la branca no és vàlid: «%s»"
+
+#, c-format
+msgid "no commit on branch '%s' yet"
+msgstr "encara no hi ha cap comissió a la branca «%s»"
#, c-format
-msgid "Invalid branch name: '%s'"
-msgstr "Nom de branca no vàlid: «%s»"
+msgid "no branch named '%s'"
+msgstr "no hi ha cap branca anomenada «%s»"
-msgid "Branch rename failed"
-msgstr "El canvi de nom de branca ha fallat"
+msgid "branch rename failed"
+msgstr "ha fallat el canvi de nom de la branca"
-msgid "Branch copy failed"
-msgstr "La còpia de la branca ha fallat"
+msgid "branch copy failed"
+msgstr "ha fallat la còpia de la branca"
#, c-format
-msgid "Created a copy of a misnamed branch '%s'"
-msgstr "S'ha creat una còpia d'una branca mal anomenada «%s»"
+msgid "created a copy of a misnamed branch '%s'"
+msgstr "s'ha creat una còpia d'una branca mal anomenada «%s»"
#, c-format
-msgid "Renamed a misnamed branch '%s' away"
-msgstr "S'ha canviat el nom de la branca mal anomenada «%s»"
+msgid "renamed a misnamed branch '%s' away"
+msgstr "s'ha canviat el nom d'una branca «%s» mal anomenada"
#, c-format
-msgid "Branch renamed to %s, but HEAD is not updated!"
-msgstr "S'ha canviat el nom de la branca a %s, però HEAD no està actualitzat!"
+msgid "branch renamed to %s, but HEAD is not updated"
+msgstr "s'ha canviat el nom de la branca a %s, però HEAD no s'ha actualitzat"
-msgid "Branch is renamed, but update of config-file failed"
+msgid "branch is renamed, but update of config-file failed"
msgstr ""
-"La branca està canviada de nom, però l'actualització del fitxer de "
-"configuració ha fallat"
+"s'ha canviat el nom de la branca, però ha fallat l'actualització del fitxer "
+"de configuració"
-msgid "Branch is copied, but update of config-file failed"
+msgid "branch is copied, but update of config-file failed"
msgstr ""
-"La branca està copiada, però l'actualització del fitxer de configuració ha "
-"fallat"
+"s'ha copiat la branca, però ha fallat l'actualització del fitxer de "
+"configuració"
#, c-format
msgid ""
@@ -2912,7 +2978,7 @@ msgid "Generic options"
msgstr "Opcions genèriques"
msgid "show hash and subject, give twice for upstream branch"
-msgstr "mostra el hash i l'assumpte, doneu dues vegades per a la branca font"
+msgstr "mostra el hash i l'assumpte, useu-lo dues vegades per a la branca font"
msgid "suppress informational messages"
msgstr "omet els missatges informatius"
@@ -2962,6 +3028,9 @@ msgstr "mou/canvia de nom una branca i el seu registre de referència"
msgid "move/rename a branch, even if target exists"
msgstr "mou/canvia de nom una branca, encara que el destí existeixi"
+msgid "do not output a newline after empty formatted refs"
+msgstr "no emetis cap línia nova després de refs amb format buit"
+
msgid "copy a branch and its reflog"
msgstr "copia una branca i el seu registre de referència"
@@ -2999,16 +3068,16 @@ msgid "print only branches of the object"
msgstr "imprimeix només les branques de l'objecte"
msgid "sorting and filtering are case insensitive"
-msgstr "l'ordenació i el filtratge distingeixen entre majúscules i minúscules"
+msgstr "ordenació i filtratge distingeixen entre majúscules i minúscules"
msgid "recurse through submodules"
-msgstr "inclou recursivament als submòduls"
+msgstr "inclou recursivament els submòduls"
msgid "format to use for the output"
msgstr "format a usar en la sortida"
-msgid "Failed to resolve HEAD as a valid ref."
-msgstr "S'ha produït un error en resoldre HEAD com a referència vàlida."
+msgid "failed to resolve HEAD as a valid ref"
+msgstr "no s'ha pogut resoldre HEAD com a referència vàlida"
msgid "HEAD not found below refs/heads!"
msgstr "HEAD no trobat sota refs/heads!"
@@ -3026,19 +3095,18 @@ msgstr "--recurse-submodules només es pot utilitzar per a crear branques"
msgid "branch name required"
msgstr "cal el nom de branca"
-msgid "Cannot give description to detached HEAD"
-msgstr "No es pot donar descripció a un HEAD separat"
+msgid "cannot give description to detached HEAD"
+msgstr "no s'ha pogut donar la descripció al HEAD separat"
msgid "cannot edit description of more than one branch"
msgstr "no es pot editar la descripció de més d'una branca"
-#, c-format
-msgid "No commit on branch '%s' yet."
-msgstr "Encara no hi ha cap comissió en la branca «%s»."
+msgid "cannot copy the current branch while not on any"
+msgstr "no es pot copiar la branca actual mentre no pertanyi a cap"
-#, c-format
-msgid "No branch named '%s'."
-msgstr "No hi ha cap branca amb nom «%s»."
+msgid "cannot rename the current branch while not on any"
+msgstr ""
+"no s'ha pogut canviar el nom de la branca actual mentre no pertanyi a cap"
msgid "too many branches for a copy operation"
msgstr "hi ha massa branques per a una operació de còpia"
@@ -3051,9 +3119,9 @@ msgstr "hi ha massa arguments per a establir una nova font"
#, c-format
msgid ""
-"could not set upstream of HEAD to %s when it does not point to any branch."
+"could not set upstream of HEAD to %s when it does not point to any branch"
msgstr ""
-"no s'ha pogut establir la font de HEAD com a %s quan no assenyala cap branca."
+"no s'ha pogut configurar la font de HEAD a %s quan no apunta a cap branca"
#, c-format
msgid "no such branch '%s'"
@@ -3066,27 +3134,26 @@ msgstr "la branca «%s» no existeix"
msgid "too many arguments to unset upstream"
msgstr "hi ha massa arguments per a desassignar la font"
-msgid "could not unset upstream of HEAD when it does not point to any branch."
-msgstr ""
-"no s'ha pogut desassignar la font de HEAD perquè no assenyala cap branca."
+msgid "could not unset upstream of HEAD when it does not point to any branch"
+msgstr "no s'ha pogut desassignar la font del HEAD quan no apunta a cap branca"
#, c-format
-msgid "Branch '%s' has no upstream information"
-msgstr "La branca «%s» no té informació de font"
+msgid "branch '%s' has no upstream information"
+msgstr "la branca «%s» no té informació de la font"
msgid ""
-"The -a, and -r, options to 'git branch' do not take a branch name.\n"
+"the -a, and -r, options to 'git branch' do not take a branch name.\n"
"Did you mean to use: -a|-r --list <pattern>?"
msgstr ""
-"Les opcions -a i -r a «git branch» no prenen un nom de branca.\n"
-"Volíeu usar -a|-r --list <pattern>?"
+"les opcions -a, i -r, a «git branch» no prenen un nom de branca.\n"
+"Volíeu utilitzar: -a|-r --list <patró>?"
msgid ""
"the '--set-upstream' option is no longer supported. Please use '--track' or "
-"'--set-upstream-to' instead."
+"'--set-upstream-to' instead"
msgstr ""
-"l'opció --set-upstream ja no s'admet. En lloc seu, useu «--track» o «--set-"
-"upstream-to»."
+"l'opció «--set-upstream» ja no és admesa. Utilitzeu en comptes «--track» o "
+"«--set-upstream-to»"
msgid "git version:\n"
msgstr "versió de git:\n"
@@ -3105,8 +3172,12 @@ msgid "not run from a git repository - no hooks to show\n"
msgstr ""
"no s'està executant en un repositori de git - no hi ha lligams a mostrar\n"
-msgid "git bugreport [-o|--output-directory <file>] [-s|--suffix <format>]"
-msgstr "git bugreport [-o|--output-directory <file>] [-s|--suffix <format>]"
+msgid ""
+"git bugreport [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--diagnose[=<mode>]]"
+msgstr ""
+"git bugreport [(-o | --output-directory) <camí>] [(-s | --suffix) <format>]\n"
+" [--diagnose[=<mode>]]"
msgid ""
"Thank you for filling out a Git bug report!\n"
@@ -3141,16 +3212,32 @@ msgstr ""
"Reviseu la resta de l'informe d'error de sota.\n"
"Podeu eliminar qualsevol línia que vulgueu.\n"
-msgid "specify a destination for the bugreport file"
-msgstr "especifiqueu una destinació per al fitxer d'informe d'error"
+msgid "mode"
+msgstr "mode"
+
+msgid ""
+"create an additional zip archive of detailed diagnostics (default 'stats')"
+msgstr ""
+"crea un arxiu zip addicional amb diagnòstics detallats (per defecte «stats»)"
-msgid "specify a strftime format suffix for the filename"
+msgid "specify a destination for the bugreport file(s)"
+msgstr "especifiqueu una destinació per al fitxer de l'informe d'error"
+
+msgid "specify a strftime format suffix for the filename(s)"
msgstr "especifiqueu un sufix en format strftime per al nom de fitxer"
#, c-format
+msgid "unknown argument `%s'"
+msgstr "argument desconegut «%s»"
+
+#, c-format
msgid "could not create leading directories for '%s'"
msgstr "no s'han pogut crear els directoris principals de «%s»"
+#, c-format
+msgid "unable to create diagnostics archive %s"
+msgstr "no s'ha pogut crear l'arxiu de diagnòstic %s"
+
msgid "System Info"
msgstr "Informació del sistema"
@@ -3165,17 +3252,24 @@ msgstr "no s'ha pogut escriure a %s"
msgid "Created new report at '%s'.\n"
msgstr "S'ha creat un nou informe a «%s».\n"
-msgid "git bundle create [<options>] <file> <git-rev-list args>"
-msgstr "git bundle create [<opcions>] <fitxer> <git-rev-list args>"
+msgid ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<version>] <file> <git-rev-list-args>"
+msgstr ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<versió>] <fitxer> <git-rev-list-args>"
-msgid "git bundle verify [<options>] <file>"
-msgstr "git bundle verify [<opcions>] <fitxer>"
+msgid "git bundle verify [-q | --quiet] <file>"
+msgstr "git bundle verify [-q | --quiet] <fitxer>"
msgid "git bundle list-heads <file> [<refname>...]"
msgstr "git bundle list-heads <fitxer> [<refname>...]"
-msgid "git bundle unbundle <file> [<refname>...]"
-msgstr "git bundle unbundle <fitxer> [<refname>...]"
+msgid "git bundle unbundle [--progress] <file> [<refname>...]"
+msgstr "git bundle unbundle [--progress] <fitxer> [<refname>...]"
+
+msgid "need a <file> argument"
+msgstr "necessita un argument <fitxer>"
msgid "do not show progress meter"
msgstr "no mostris l'indicador de progrés"
@@ -3183,11 +3277,11 @@ msgstr "no mostris l'indicador de progrés"
msgid "show progress meter"
msgstr "mostra l'indicador de progrés"
-msgid "show progress meter during object writing phase"
-msgstr "mostra l'indicador de progrés durant la fase d'escriptura d'objectes"
+msgid "historical; same as --progress"
+msgstr "històric; el mateix que --progress"
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "similar a --all-progress quan l'indicador de progrés es mostra"
+msgid "historical; does nothing"
+msgstr "històric; no fa res"
msgid "specify bundle format version"
msgstr "especifica la versió del format del farcell"
@@ -3209,10 +3303,6 @@ msgid "Unbundling objects"
msgstr "S'estan desagrupant objectes"
#, c-format
-msgid "Unknown subcommand: %s"
-msgstr "Subordre desconeguda: %s"
-
-#, c-format
msgid "cannot read object %s '%s'"
msgstr "no es pot llegir l'objecte %s «%s»"
@@ -3234,57 +3324,52 @@ msgstr "%s requereix arguments"
msgid "%s takes no arguments"
msgstr "%s no accepta cap valor"
-#, c-format
-msgid "unknown command: '%s'"
-msgstr "ordre desconeguda: «%s»"
-
msgid "only one batch option may be specified"
msgstr "només es pot especificar una opció per lots"
msgid "git cat-file <type> <object>"
-msgstr "git cat-file <type> <object>"
+msgstr "git cat-file <tipus> <objecte>"
msgid "git cat-file (-e | -p) <object>"
-msgstr "git cat-file (-e | -p) <object>"
+msgstr "git cat-file (-e | -p) <objecte>"
msgid "git cat-file (-t | -s) [--allow-unknown-type] <object>"
-msgstr "git cat-file (-t | -s) [--allow-unknown-type] <object>"
+msgstr "git cat-file (-t | -s) [--allow-unknown-type] <objecte>"
+
+msgid ""
+"git cat-file (--textconv | --filters)\n"
+" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
+msgstr ""
+"git cat-file (--textconv | --filters)\n"
+" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
msgid ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
+" [--textconv | --filters] [-Z]"
msgstr ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
-
-msgid ""
-"git cat-file (--textconv | --filters)\n"
-" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
-msgstr ""
-"git cat-file (--textconv | --filters)\n"
-" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
+" [--textconv | --filters] [-Z]"
msgid "Check object existence or emit object contents"
msgstr "Comprova l'existència de l'objecte o emet el contingut de l'objecte"
msgid "check if <object> exists"
-msgstr "comprova si <object> existeix"
+msgstr "comprova si <objecte> existeix"
-#, fuzzy
msgid "pretty-print <object> content"
-msgstr "empremta de <object> contingut"
+msgstr "impressió embellida del contingut de l'<objecte>"
-#, fuzzy
msgid "Emit [broken] object attributes"
-msgstr "Emet els atributs de l'objecte objectbroken]"
+msgstr "Emet els atributs [broken] de l'objecte"
-#, fuzzy
msgid "show object type (one of 'blob', 'tree', 'commit', 'tag', ...)"
-msgstr "mostra el tipus d'objecte (un de 'blob', 'tree', 'commit', 'tag', ...)"
+msgstr ""
+"mostra el tipus d'objecte (un dels següents: «blob», «tree», «commit», "
+"«tag», ...)"
msgid "show object size"
msgstr "mostra la mida de l'objecte"
@@ -3292,62 +3377,60 @@ msgstr "mostra la mida de l'objecte"
msgid "allow -s and -t to work with broken/corrupt objects"
msgstr "permet que -s i -t funcionin amb objectes trencats/malmesos"
-#, fuzzy
+msgid "use mail map file"
+msgstr "usa el fitxer de mapa de correu"
+
msgid "Batch objects requested on stdin (or --batch-all-objects)"
-msgstr "Objectes lots sol·licitats a stdin (o --batch-all-objects)"
+msgstr "Objectes de lots sol·licitats a stdin (o --batch-all-objects)"
-#, fuzzy
msgid "show full <object> or <rev> contents"
-msgstr "mostra el contingut complet de <object> o <rev>"
+msgstr "mostra el contingut complet de <objecte> o <rev>"
-#, fuzzy
msgid "like --batch, but don't emit <contents>"
-msgstr "com --batch, però no emeti <contents>"
+msgstr "com a --batch, però no emetis <contents>"
+
+msgid "stdin is NUL-terminated"
+msgstr "l'entrada és acabada amb NUL"
+
+msgid "stdin and stdout is NUL-terminated"
+msgstr "stdin i stdout estan terminats amb NUL"
-#, fuzzy
msgid "read commands from stdin"
msgstr "llegeix les ordres de stdin"
-#, fuzzy
msgid "with --batch[-check]: ignores stdin, batches all known objects"
-msgstr "amb --batch--check:: ignora stdin, bateja tots els objectes coneguts"
+msgstr ""
+"amb --batch[-check]: ignora stdin, posa en lots tots els objectes coneguts"
-#, fuzzy
msgid "Change or optimize batch output"
msgstr "Canvia o optimitza la sortida per lots"
msgid "buffer --batch output"
msgstr "posa la sortida de --batch en memòria intermèdia"
-#, fuzzy
msgid "follow in-tree symlinks"
msgstr "segueix els enllaços simbòlics en l'arbre"
-#, fuzzy
msgid "do not order objects before emitting them"
-msgstr "no ordena objectes abans d'emetre'ls"
+msgstr "no ordenis els objectes abans d'emetre'ls"
-#, fuzzy
msgid ""
"Emit object (blob or tree) with conversion or filter (stand-alone, or with "
"batch)"
msgstr ""
"Emet l'objecte (blob o arbre) amb conversió o filtre (stand-alone, o amb lot)"
-#, fuzzy
msgid "run textconv on object's content"
msgstr "executar textconv al contingut de l'objecte"
-#, fuzzy
msgid "run filters on object's content"
msgstr "executa els filtres al contingut de l'objecte"
msgid "blob|tree"
msgstr "blob|tree"
-#, fuzzy
msgid "use a <path> for (--textconv | --filters); Not with 'batch'"
-msgstr "useu un <path> per a (--textconv | --filters); No amb 'batch'"
+msgstr "useu un <camí> per a (--textconv | --filters); no amb «batch»"
#, c-format
msgid "'%s=<%s>' needs '%s' or '%s'"
@@ -3358,7 +3441,7 @@ msgstr "path|tree-ish"
#, c-format
msgid "'%s' requires a batch mode"
-msgstr "%s requereix un mode batch"
+msgstr "«%s» requereix un mode batch"
#, c-format
msgid "'-%c' is incompatible with batch mode"
@@ -3373,22 +3456,23 @@ msgstr "<rev> requerida amb «%s»"
#, c-format
msgid "<object> required with '-%c'"
-msgstr "<object> requerit amb «-%c»"
+msgstr "<objecte> requerit amb «-%c»"
-msgid "too many arguments"
-msgstr "hi ha massa arguments"
-
-#, fuzzy, c-format
+#, c-format
msgid "only two arguments allowed in <type> <object> mode, not %d"
-msgstr ""
-"només es permeten dos arguments en el mode <type> <object>, no en un "
-"percentatge"
+msgstr "només es permeten dos arguments en el mode <tipus> <objecte>, no %d"
-msgid "git check-attr [-a | --all | <attr>...] [--] <pathname>..."
-msgstr "git check-attr [-a | --all | <atribut>...] [--] <nom-de-camí>..."
+msgid ""
+"git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] "
+"<pathname>..."
+msgstr ""
+"git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] "
+"<pathname>..."
-msgid "git check-attr --stdin [-z] [-a | --all | <attr>...]"
-msgstr "git check-attr --stdin [-z] [-a | --all | <atribut>...]"
+msgid ""
+"git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"
+msgstr ""
+"git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"
msgid "report all attributes set on file"
msgstr "informa de tots els atributs establerts en el fitxer"
@@ -3402,6 +3486,12 @@ msgstr "llegeix els noms de fitxer de stdin"
msgid "terminate input and output records by a NUL character"
msgstr "acaba els registres d'entrada i de sortida amb un caràcter NUL"
+msgid "<tree-ish>"
+msgstr "<tree-ish>"
+
+msgid "which tree-ish to check attributes at"
+msgstr "a quin tree-ish s'han de comprovar els atributs"
+
msgid "suppress progress reporting"
msgstr "omet els informes de progrés"
@@ -3460,9 +3550,8 @@ msgstr "«stage» ha de ser entre 1 i 3 o all"
msgid "check out all files in the index"
msgstr "agafa tots els fitxers en l'índex"
-#, fuzzy
msgid "do not skip files with skip-worktree set"
-msgstr "no ometis els fitxers amb el conjunt d'arbres de salt"
+msgstr "no ometis els fitxers amb skip-worktree establert"
msgid "force overwrite of existing files"
msgstr "força la sobreescriptura de fitxers existents"
@@ -3493,7 +3582,7 @@ msgid "git checkout [<options>] [<branch>] -- <file>..."
msgstr "git checkout [<opcions>] [<branca>] -- <fitxer>..."
msgid "git switch [<options>] [<branch>]"
-msgstr "git switch [<options>] [<branch>]"
+msgstr "git switch [<opcions>] [<branca>]"
msgid "git restore [<options>] [--source=<branch>] <file>..."
msgstr "git restore [<opcions>] [--source=<branca>] <fitxer>..."
@@ -3562,6 +3651,10 @@ msgid "'%s' or '%s' cannot be used with %s"
msgstr "«%s» o «%s» no poden utilitzar-se amb %s"
#, c-format
+msgid "'%s', '%s', or '%s' cannot be used when checking out of a tree"
+msgstr "«%s», «%s» o «%s» no es poden utilitzar en agafar un arbre"
+
+#, c-format
msgid "path '%s' is unmerged"
msgstr "el camí «%s» està sense fusionar"
@@ -3813,8 +3906,8 @@ msgstr "agafa a la força (descarta qualsevol modificació local)"
msgid "new-branch"
msgstr "branca-nova"
-msgid "new unparented branch"
-msgstr "branca òrfena nova"
+msgid "new unborn branch"
+msgstr "branca no nascuda nova"
msgid "update ignored files (default)"
msgstr "actualitza els fitxers ignorats (per defecte)"
@@ -3915,9 +4008,11 @@ msgid "use overlay mode"
msgstr "utilitza el mode de superposició"
msgid ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <paths>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] "
+"[<pathspec>...]"
msgstr ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <patró>] [-x | -X] [--] <camins>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <patró>] [-x | -X] [--] "
+"[<pathspec>...]"
#, c-format
msgid "Removing %s\n"
@@ -3981,7 +4076,7 @@ msgstr ""
"* - tria tots els ítems\n"
" - (buit) finalitza la selecció\n"
-#, c-format, perl-format
+#, c-format
msgid "Huh (%s)?\n"
msgstr "Perdó (%s)?\n"
@@ -4016,7 +4111,7 @@ msgstr ""
"ask each - confirma cada supressió (com «rm -i»)\n"
"quit - deixa de netejar\n"
"help - aquesta pantalla\n"
-"? - ajuda de selecció de l'avís"
+"? - ajuda de selecció manual"
msgid "Would remove the following item:"
msgid_plural "Would remove the following items:"
@@ -4064,9 +4159,6 @@ msgstr ""
"clean.requireForce és per defecte cert i ni -i, -n ni -f s'han indicat; "
"refusant netejar"
-msgid "-x and -X cannot be used together"
-msgstr "-x i -X no es poden usar junts"
-
msgid "git clone [<options>] [--] <repo> [<dir>]"
msgstr "git clone [<opcions>] [--] <repositori> [<directori>]"
@@ -4130,9 +4222,6 @@ msgstr "profunditat"
msgid "create a shallow clone of that depth"
msgstr "crea un clon superficial d'aquesta profunditat"
-msgid "time"
-msgstr "data"
-
msgid "create a shallow clone since a specific time"
msgstr "crea un clon superficial des d'una data específica"
@@ -4158,6 +4247,9 @@ msgstr "directori de git"
msgid "separate git dir from working tree"
msgstr "separa el directori de git de l'arbre de treball"
+msgid "specify the reference format to use"
+msgstr "especifiqueu el format de referència a usar"
+
msgid "key=value"
msgstr "clau=valor"
@@ -4170,15 +4262,8 @@ msgstr "específic al servidor"
msgid "option to transmit"
msgstr "opció a transmetre"
-msgid "use IPv4 addresses only"
-msgstr "usa només adreces IPv4"
-
-msgid "use IPv6 addresses only"
-msgstr "usa només adreces IPv6"
-
-#, fuzzy
msgid "apply partial clone filters to submodules"
-msgstr "Aplica els filtres de clonatge parcial als submòduls"
+msgstr "aplica els filtres de clonatge parcial als submòduls"
msgid "any cloned submodules will use their remote-tracking branch"
msgstr "qualsevol submòdul clonat utilitzarà la seva branca de seguiment remot"
@@ -4188,6 +4273,12 @@ msgstr ""
"inicialitza el fitxer «sparse-checkout» per a incloure només els fitxers a "
"l'arrel"
+msgid "uri"
+msgstr "uri"
+
+msgid "a URI for downloading bundles before fetching from origin remote"
+msgstr "un URI per a baixar paquets abans d'obtenir des del remot origen"
+
#, c-format
msgid "info: Could not add alternate for '%s': %s\n"
msgstr "info: No s'ha pogut afegir un alternatiu per a «%s»: %s\n"
@@ -4201,10 +4292,18 @@ msgid "%s exists and is not a directory"
msgstr "%s existeix i no és directori"
#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "«%s» és un enllaç simbòlic, es rebutja clonar amb --local"
+
+#, c-format
msgid "failed to start iterator over '%s'"
msgstr "no s'ha pogut iniciar l'iterador sobre «%s»"
#, c-format
+msgid "symlink '%s' exists, refusing to clone with --local"
+msgstr "l'enllaç simbòlic «%s» existeix, es rebutja a clonar amb --local"
+
+#, c-format
msgid "failed to unlink '%s'"
msgstr "s'ha produït un error en desenllaçar «%s»"
@@ -4247,10 +4346,10 @@ msgstr "no s'ha pogut actualitzar %s"
msgid "failed to initialize sparse-checkout"
msgstr "no s'ha pogut inicialitzar «sparse-checkout»"
-msgid "remote HEAD refers to nonexistent ref, unable to checkout.\n"
+msgid "remote HEAD refers to nonexistent ref, unable to checkout"
msgstr ""
-"la HEAD remot es refereix a una referència que no existeix; no s'ha pogut "
-"agafar.\n"
+"la HEAD remot es refereix a una referència que no existeix, no s'ha pogut "
+"agafar"
msgid "unable to checkout working tree"
msgstr "no s'ha pogut agafar l'arbre de treball"
@@ -4271,8 +4370,8 @@ msgid "You must specify a repository to clone."
msgstr "Heu d'especificar un repositori per a clonar."
#, c-format
-msgid "options '%s' and '%s %s' cannot be used together"
-msgstr "les opcions «%s» i «%s %s» no es poden usar juntes"
+msgid "unknown ref storage format '%s'"
+msgstr "el format d'emmagatzematge de referència «%s» és desconegut"
#, c-format
msgid "repository '%s' does not exist"
@@ -4347,6 +4446,16 @@ msgstr "--local s'ignora"
msgid "cannot clone from filtered bundle"
msgstr "no es pot clonar des del farell filtrat"
+msgid "failed to initialize the repo, skipping bundle URI"
+msgstr "no s'ha pogut inicialitzar el repositori, s'omet l'URI del paquet"
+
+#, c-format
+msgid "failed to fetch objects from bundle URI '%s'"
+msgstr "no s'han pogut obtenir els objectes de l'URI del paquet «%s»"
+
+msgid "failed to fetch advertised bundles"
+msgstr "no s'han pogut obtenir els paquets anunciats"
+
msgid "remote transport reported error"
msgstr "el transport remot ha informat d'un error"
@@ -4382,18 +4491,24 @@ msgid "--command must be the first argument"
msgstr "--command ha de ser el primer argument"
msgid ""
-"git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]"
+"git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]"
msgstr ""
-"git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]"
+"git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]"
msgid ""
-"git commit-graph write [--object-dir <objdir>] [--append] [--"
-"split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <n>] [--[no-]progress] <split options>"
+"git commit-graph write [--object-dir <dir>] [--append]\n"
+" [--split[=<strategy>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <split-options>"
msgstr ""
-"git commit-graph write [--object-dir <objdir>] [--append] [--"
-"split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <n>] [--[no-]progress] <split options>"
+"git commit-graph write [--object-dir <dir>] [--append]\n"
+" [--split[=<strategy>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <split-options>"
msgid "dir"
msgstr "directori"
@@ -4410,6 +4525,10 @@ msgid "Could not open commit-graph '%s'"
msgstr "No s'ha pogut obrir el graf de comissions «%s»"
#, c-format
+msgid "could not open commit-graph chain '%s'"
+msgstr "no s'ha pogut obrir la cadena «%s» del graf de comissions"
+
+#, c-format
msgid "unrecognized --split argument, %s"
msgstr "argument --split no reconegut, %s"
@@ -4462,16 +4581,15 @@ msgstr "usa com a màxim un --reachable, --stdin-commits, o --stdin-packs"
msgid "Collecting commits from input"
msgstr "S'estan recollint les comissions de l'entrada"
-#, c-format
-msgid "unrecognized subcommand: %s"
-msgstr "subordre no reconeguda: %s"
+msgid "git commit-tree <tree> [(-p <parent>)...]"
+msgstr "git commit-tree <tree> [(-p <pare>)...]"
msgid ""
-"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...] [(-F "
-"<file>)...] <tree>"
+"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]\n"
+" [(-F <file>)...] <tree>"
msgstr ""
-"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...] [(-F "
-"<file>)...] <tree>"
+"git commit-tree [(-p <pare>)...] [-S[<keyid>]] [(-m <missatge>)...]\n"
+" [(-F <fitxer>)...] <tree>"
#, c-format
msgid "duplicate parent %s ignored"
@@ -4513,11 +4631,29 @@ msgstr "ha de donar exactament un arbre"
msgid "git commit-tree: failed to read"
msgstr "git commit-tree: ha fallat en llegir"
-msgid "git commit [<options>] [--] <pathspec>..."
-msgstr "git commit [<opcions>] [--] <especificació-de-camí>..."
+msgid ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|"
+"reword):]<commit>)]\n"
+" [-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n"
+" [--date=<date>] [--cleanup=<mode>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <comissió> | --fixup [(amend|"
+"reword):]<comissió>)]\n"
+" [-F <fitxer> | -m <msg>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n"
+" [--date=<date>] [--cleanup=<mode>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<fitxer> [--pathspec-file-nul]]\n"
+" [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n"
+" [--] [<pathspec>...]"
-msgid "git status [<options>] [--] <pathspec>..."
-msgstr "git status [<opcions>] [--] <especificació-de-camí>..."
+msgid "git status [<options>] [--] [<pathspec>...]"
+msgstr "git status [<opcions>] [--] [<pathspec>...]"
msgid ""
"You asked to amend the most recent commit, but doing so would make\n"
@@ -4569,6 +4705,9 @@ msgstr ""
" git cherry-pick --skip\n"
"\n"
+msgid "updating files failed"
+msgstr "s'ha produït un error en actualitzar els fitxers"
+
msgid "failed to unpack HEAD tree object"
msgstr "s'ha produït un error en desempaquetar l'objecte d'arbre HEAD"
@@ -4587,9 +4726,6 @@ msgstr "no s'ha pogut actualitzar l'índex temporal"
msgid "Failed to update main cache tree"
msgstr "S'ha produït un error en actualitzar l'arbre principal de memòria cau"
-msgid "unable to write new_index file"
-msgstr "no s'ha pogut escriure el fitxer new_index"
-
msgid "cannot do a partial commit during a merge."
msgstr "no es pot fer una comissió parcial durant una fusió."
@@ -4628,8 +4764,8 @@ msgstr ""
"no sigui usat en el missatge de comissió actual"
#, c-format
-msgid "could not lookup commit %s"
-msgstr "no s'ha pogut cercar la comissió %s"
+msgid "could not lookup commit '%s'"
+msgstr "no s'ha pogut cercar la comissió «%s»"
#, c-format
msgid "(reading log message from standard input)\n"
@@ -4821,9 +4957,6 @@ msgstr "mostra l'estat en format llarg (per defecte)"
msgid "terminate entries with NUL"
msgstr "acaba les entrades amb NUL"
-msgid "mode"
-msgstr "mode"
-
msgid "show untracked files, optional modes: all, normal, no. (Default: all)"
msgstr ""
"mostra els fitxers no seguits, modes opcionals: all, normal, no. (Per "
@@ -4869,7 +5002,7 @@ msgid "Commit message options"
msgstr "Opcions de missatge de comissió"
msgid "read message from file"
-msgstr "llegiu el missatge des d'un fitxer"
+msgstr "llegeix el missatge des d'un fitxer"
msgid "author"
msgstr "autor"
@@ -4995,13 +5128,13 @@ msgstr ""
msgid ""
"repository has been updated, but unable to write\n"
-"new_index file. Check that disk is not full and quota is\n"
+"new index file. Check that disk is not full and quota is\n"
"not exceeded, and then \"git restore --staged :/\" to recover."
msgstr ""
"s'ha actualitzat el repositori, però no s'ha pogut escriure\n"
-" el fitxer «new_index». Comproveu que el disc no està ple i\n"
-"que la quota no s'ha excedit, i després, feu\n"
-"«git restore --staged :/» per a recuperar-lo."
+"el fitxer d'índex nou. Comproveu que el disc no està ple i\n"
+"la quota no s'ha excedit, i després feu «git restore --staged :/n»\n"
+"per a recuperar-ho."
msgid "git config [<options>]"
msgstr "git config [<opcions>]"
@@ -5072,7 +5205,7 @@ msgid "remove a section: name"
msgstr "elimina una secció: nom"
msgid "list all"
-msgstr "llista tots"
+msgstr "llista'ls tots"
msgid "use string equality when comparing values to 'value-pattern'"
msgstr ""
@@ -5095,7 +5228,7 @@ msgid "type"
msgstr "tipus"
msgid "value is given this type"
-msgstr "el valor té donat aquest tipus"
+msgstr "el valor és d'aquest tipus que s'ha donat"
msgid "value is \"true\" or \"false\""
msgstr "el valor és «true» o «false»"
@@ -5178,7 +5311,7 @@ msgid "writing to stdin is not supported"
msgstr "no s'admet escriure a stdin"
msgid "writing config blobs is not supported"
-msgstr "no s'ha admet l'escriptura de blobs de configuració"
+msgstr "no s'admet l'escriptura de blobs de configuració"
#, c-format
msgid ""
@@ -5301,11 +5434,18 @@ msgid "unable to get credential storage lock in %d ms"
msgstr ""
"no s'ha pogut obtenir el bloqueig de l'emmagatzematge de credencials en %d ms"
-msgid "git describe [<options>] [<commit-ish>...]"
-msgstr "git describe [<opcions>] [<comissió>...]"
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"
+
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]"
-msgid "git describe [<options>] --dirty"
-msgstr "git describe [<opcions>] --dirty"
+msgid "git describe <blob>"
+msgstr "git describe <blob>"
msgid "head"
msgstr "davant per"
@@ -5344,7 +5484,7 @@ msgid ""
"However, there were unannotated tags: try --tags."
msgstr ""
"Cap etiqueta anotada pot descriure «%s».\n"
-"No obstant, hi havia etiquetes no anotades: proveu --tags."
+"No obstant això, hi havia etiquetes no anotades: proveu --tags."
#, c-format
msgid ""
@@ -5356,7 +5496,7 @@ msgstr ""
#, c-format
msgid "traversed %lu commits\n"
-msgstr "%lu comissions travessades\n"
+msgstr "%lu comissions recorregudes\n"
#, c-format
msgid ""
@@ -5425,7 +5565,23 @@ msgstr "No s'ha trobat cap nom, no es pot descriure res."
#, c-format
msgid "option '%s' and commit-ishes cannot be used together"
-msgstr "les opcions «%s» i de comissió no es poden usar juntes"
+msgstr "opció «%s» i les de comissió no es poden usar juntes"
+
+msgid ""
+"git diagnose [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--mode=<mode>]"
+msgstr ""
+"git diagnose [(-o | --output-directory) <camí>] [(-s | --suffix) <format>]\n"
+" [--mode=<mode>]"
+
+msgid "specify a destination for the diagnostics archive"
+msgstr "especifiqueu una destinació per a l'arxiu de diagnòstic"
+
+msgid "specify a strftime format suffix for the filename"
+msgstr "especifiqueu un sufix en format strftime per al nom de fitxer"
+
+msgid "specify the content of the diagnostic archive"
+msgstr "especifica el contingut de l'arxiu de diagnòstic"
msgid "--merge-base only works with two commits"
msgstr "--merge-base només funciona amb dues comissions"
@@ -5434,6 +5590,9 @@ msgstr "--merge-base només funciona amb dues comissions"
msgid "'%s': not a regular file or symlink"
msgstr "«%s»: no és ni fitxer regular ni enllaç simbòlic"
+msgid "no merge given, only parents."
+msgstr "no s'ha donat cap fusió, només els pares."
+
#, c-format
msgid "invalid option: %s"
msgstr "opció no vàlida: %s"
@@ -5462,7 +5621,7 @@ msgid "%s...%s: multiple merge bases, using %s"
msgstr "%s...%s: múltiples bases de fusió, utilitzant %s"
msgid "git difftool [<options>] [<commit> [<commit>]] [--] [<path>...]"
-msgstr "git difftool [<opcions>] [<commit> [<commit>]] [--] [<camí>...]"
+msgstr "git difftool [<opcions>] [<comissió> [<comissió>]] [--] [<camí>...]"
#, c-format
msgid "could not read symlink %s"
@@ -5549,27 +5708,6 @@ msgstr "no s'ha proporcionat l'<eina> per a --tool=<eina>"
msgid "no <cmd> given for --extcmd=<cmd>"
msgstr "no s'ha proporcionat l'<ordre> per a --extcmd=<ordre>"
-msgid "git env--helper --type=[bool|ulong] <options> <env-var>"
-msgstr "git env--helper --type=[bool|ulong] <opcions> <env-var>"
-
-msgid "default for git_env_*(...) to fall back on"
-msgstr "valor per defecte per a git_env_*(...) en cas d'absència"
-
-msgid "be quiet only use git_env_*() value as exit code"
-msgstr "silenciós només utilitza el valor git_env_*() com a codi de sortida"
-
-#, c-format
-msgid "option `--default' expects a boolean value with `--type=bool`, not `%s`"
-msgstr "l'opció «--default» espera un valor booleà amb «--type=bool», no «%s»"
-
-#, c-format
-msgid ""
-"option `--default' expects an unsigned long value with `--type=ulong`, not "
-"`%s`"
-msgstr ""
-"l'opció «--default» espera un valor llarg sense signe amb «--type=ulong», no "
-"«%s»"
-
msgid "git fast-export [<rev-list-opts>]"
msgstr "git fast-export [<rev-list-opts>]"
@@ -5592,7 +5730,7 @@ msgstr "selecciona la gestió de les etiquetes que etiquetin objectes filtrats"
msgid "select handling of commit messages in an alternate encoding"
msgstr ""
-"selecciona la gestió dels missatges de publicació en una codificació "
+"selecciona la gestió dels missatges de comissió en una codificació "
"alternativa"
msgid "dump marks to this file"
@@ -5688,121 +5826,14 @@ msgstr "git fetch --all [<opcions>]"
msgid "fetch.parallel cannot be negative"
msgstr "fetch.parallel no pot ser negatiu"
-msgid "fetch from all remotes"
-msgstr "obtén de tots els remots"
-
-msgid "set upstream for git pull/fetch"
-msgstr "estableix la font per a git pull/fetch"
-
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "annexa a .git/FETCH_HEAD en lloc de sobreescriure"
-
-msgid "use atomic transaction to update references"
-msgstr "usa una transacció atòmica per a actualitzar les referències"
-
-msgid "path to upload pack on remote end"
-msgstr "camí al qual pujar el paquet al costat remot"
-
-msgid "force overwrite of local reference"
-msgstr "força la sobreescriptura de la referència local"
-
-msgid "fetch from multiple remotes"
-msgstr "obtén de múltiples remots"
-
-msgid "fetch all tags and associated objects"
-msgstr "obtén totes les etiquetes i tots els objectes associats"
-
-msgid "do not fetch all tags (--no-tags)"
-msgstr "no obtinguis les etiquetes (--no-tags)"
-
-msgid "number of submodules fetched in parallel"
-msgstr "nombre de submòduls obtinguts en paral·lel"
-
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr ""
-"modifica l'especificació de referència per a col·locar totes les referències "
-"dins de refs/prefetch/"
-
-msgid "prune remote-tracking branches no longer on remote"
-msgstr "poda les branques amb seguiment remot que ja no estiguin en el remot"
-
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr ""
-"poda les etiquetes locals que ja no existeixen al remot i adjunta les "
-"etiquetes que han canviat"
-
-msgid "on-demand"
-msgstr "sota demanda"
-
-msgid "control recursive fetching of submodules"
-msgstr "controla l'obtenció recursiva de submòduls"
-
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "escriu les referències obtingudes al fitxer FETCH_HEAD"
-
-msgid "keep downloaded pack"
-msgstr "retén el paquet baixat"
-
-msgid "allow updating of HEAD ref"
-msgstr "permet l'actualització de la referència HEAD"
-
-msgid "deepen history of shallow clone"
-msgstr "aprofundeix la història d'un clon superficial"
-
-msgid "deepen history of shallow repository based on time"
-msgstr "aprofundeix la història d'un clon superficial basat en una data"
-
-msgid "convert to a complete repository"
-msgstr "converteix en un repositori complet"
-
-#, fuzzy
-msgid "re-fetch without negotiating common commits"
-msgstr "tornar a capturar sense negociar comissions comunes"
-
-msgid "prepend this to submodule path output"
-msgstr "anteposa això a la sortida de camí del submòdul"
-
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr ""
-"per defecte per a l'obtenció recursiva de submòduls (prioritat més baixa que "
-"els fitxers de configuració)"
-
-msgid "accept refs that update .git/shallow"
-msgstr "accepta les referències que actualitzin .git/shallow"
-
-msgid "refmap"
-msgstr "mapa de referències"
-
-msgid "specify fetch refmap"
-msgstr "específica l'obtenció del mapa de referències"
-
-msgid "report that we have only objects reachable from this object"
-msgstr "informa que només hi ha objectes abastables des d'aquest objecte"
-
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr ""
-"no obtinguis un fitxer de paquet; en canvi, mostra els avantpassats dels "
-"consells de negociació"
-
-msgid "run 'maintenance --auto' after fetching"
-msgstr "executa «maintenance --auto» després d'obtenir"
-
-msgid "check for forced-updates on all updated branches"
-msgstr ""
-"comprova si hi ha actualitzacions forçades a totes les branques actualitzades"
-
-msgid "write the commit-graph after fetching"
-msgstr "escriu el graf de comissions després de recollir"
-
-msgid "accept refspecs from stdin"
-msgstr "llegeix les especificacions de referència des de stdin"
-
msgid "couldn't find remote ref HEAD"
msgstr "no s'ha pogut trobar la referència HEAD remota"
#, c-format
+msgid "From %.*s\n"
+msgstr "De %.*s\n"
+
+#, c-format
msgid "object %s not found"
msgstr "objecte %s no trobat"
@@ -5812,12 +5843,9 @@ msgstr "[al dia]"
msgid "[rejected]"
msgstr "[rebutjat]"
-msgid "can't fetch in current branch"
+msgid "can't fetch into checked-out branch"
msgstr "no es pot obtenir en la branca actual"
-msgid "checked out in another worktree"
-msgstr "s'ha agafat en un altre arbre de treball"
-
msgid "[tag update]"
msgstr "[actualització d'etiqueta]"
@@ -5878,10 +5906,6 @@ msgstr ""
"s'ha rebutjat %s perquè no es permeten actualitzar les arrels superficials"
#, c-format
-msgid "From %.*s\n"
-msgstr "De %.*s\n"
-
-#, c-format
msgid ""
"some local refs could not be updated; try running\n"
" 'git remote prune %s' to remove any old, conflicting branches"
@@ -5974,7 +5998,116 @@ msgstr ""
msgid "you need to specify a tag name"
msgstr "necessiteu especificar un nom d'etiqueta"
-#, fuzzy
+msgid "fetch from all remotes"
+msgstr "obtén de tots els remots"
+
+msgid "set upstream for git pull/fetch"
+msgstr "estableix la font per a git pull/fetch"
+
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "annexa a .git/FETCH_HEAD en lloc de sobreescriure'l"
+
+msgid "use atomic transaction to update references"
+msgstr "usa una transacció atòmica per a actualitzar les referències"
+
+msgid "path to upload pack on remote end"
+msgstr "camí al qual pujar el paquet al costat remot"
+
+msgid "force overwrite of local reference"
+msgstr "força la sobreescriptura de la referència local"
+
+msgid "fetch from multiple remotes"
+msgstr "obtén de múltiples remots"
+
+msgid "fetch all tags and associated objects"
+msgstr "obtén totes les etiquetes i tots els objectes associats"
+
+msgid "do not fetch all tags (--no-tags)"
+msgstr "no obtinguis les etiquetes (--no-tags)"
+
+msgid "number of submodules fetched in parallel"
+msgstr "nombre de submòduls obtinguts en paral·lel"
+
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+"modifica l'especificació de referència per a col·locar totes les referències "
+"dins de refs/prefetch/"
+
+msgid "prune remote-tracking branches no longer on remote"
+msgstr "poda les branques amb seguiment remot que ja no estiguin en el remot"
+
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr ""
+"poda les etiquetes locals que ja no existeixen al remot i adjunta les "
+"etiquetes que han canviat"
+
+msgid "on-demand"
+msgstr "sota demanda"
+
+msgid "control recursive fetching of submodules"
+msgstr "controla l'obtenció recursiva de submòduls"
+
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "escriu les referències obtingudes al fitxer FETCH_HEAD"
+
+msgid "keep downloaded pack"
+msgstr "retén el paquet baixat"
+
+msgid "allow updating of HEAD ref"
+msgstr "permet l'actualització de la referència HEAD"
+
+msgid "deepen history of shallow clone"
+msgstr "aprofundeix la història d'un clon superficial"
+
+msgid "deepen history of shallow repository based on time"
+msgstr "aprofundeix la història d'un clon superficial basat en una data"
+
+msgid "convert to a complete repository"
+msgstr "converteix en un repositori complet"
+
+msgid "re-fetch without negotiating common commits"
+msgstr "tornar a obtenir sense negociar comissions comunes"
+
+msgid "prepend this to submodule path output"
+msgstr "anteposa això a la sortida de camí del submòdul"
+
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+"per defecte per a l'obtenció recursiva de submòduls (prioritat més baixa que "
+"els fitxers de configuració)"
+
+msgid "accept refs that update .git/shallow"
+msgstr "accepta les referències que actualitzin .git/shallow"
+
+msgid "refmap"
+msgstr "mapa de referències"
+
+msgid "specify fetch refmap"
+msgstr "específica l'obtenció del mapa de referències"
+
+msgid "report that we have only objects reachable from this object"
+msgstr "informa que només hi ha objectes abastables des d'aquest objecte"
+
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr ""
+"no obtinguis un fitxer de paquet; en canvi, mostra els avantpassats dels "
+"consells de negociació"
+
+msgid "run 'maintenance --auto' after fetching"
+msgstr "executa «maintenance --auto» després d'obtenir"
+
+msgid "check for forced-updates on all updated branches"
+msgstr ""
+"comprova si hi ha actualitzacions forçades a totes les branques actualitzades"
+
+msgid "write the commit-graph after fetching"
+msgstr "escriu el graf de comissions després de recollir"
+
+msgid "accept refspecs from stdin"
+msgstr "llegeix les especificacions de referència des de stdin"
+
msgid "--negotiate-only needs one or more --negotiation-tip=*"
msgstr "--negotiate-only necessita un o més --negotiation-tip=*"
@@ -5984,6 +6117,10 @@ msgstr "no s'admet una profunditat negativa en --deepen"
msgid "--unshallow on a complete repository does not make sense"
msgstr "--unshallow en un repositori complet no té sentit"
+#, c-format
+msgid "failed to fetch bundles from '%s'"
+msgstr "no s'han pogut obtenir els paquets de «%s»"
+
msgid "fetch --all does not take a repository argument"
msgstr "fetch --all no accepta un argument de repositori"
@@ -6025,7 +6162,7 @@ msgid "populate log with at most <n> entries from shortlog"
msgstr "emplena el registre amb <n> entrades del registre curt com a màxim"
msgid "alias for --log (deprecated)"
-msgstr "àlies per --log (en desús)"
+msgstr "àlies per a --log (en desús)"
msgid "text"
msgstr "text"
@@ -6046,7 +6183,7 @@ msgid "git for-each-ref [--points-at <object>]"
msgstr "git for-each-ref [--points-at <objecte>]"
msgid "git for-each-ref [--merged [<commit>]] [--no-merged [<commit>]]"
-msgstr "git for-each-ref [--merged [<commit>]] [--no-merged [<commit>]]"
+msgstr "git for-each-ref [--merged [<comissió>]] [--no-merged [<comissió>]]"
msgid "git for-each-ref [--contains [<commit>]] [--no-contains [<commit>]]"
msgstr ""
@@ -6054,7 +6191,8 @@ msgstr ""
msgid "quote placeholders suitably for shells"
msgstr ""
-"posa els marcadors de posició de forma adequada per a intèrprets d'ordres"
+"posa els marcadors de posició entre cometes adequades per a intèrprets "
+"d'ordres"
msgid "quote placeholders suitably for perl"
msgstr "posa els marcadors de posició entre cometes adequades per al perl"
@@ -6086,8 +6224,14 @@ msgstr "imprimeix només les referències que continguin la comissió"
msgid "print only refs which don't contain the commit"
msgstr "imprimeix només les referències que no continguin la comissió"
-msgid "git for-each-repo --config=<config> <command-args>"
-msgstr "git for-each-repo --config=<config> <command-args>"
+msgid "read reference patterns from stdin"
+msgstr "llegeix els patrons de referència de l'entrada estàndard"
+
+msgid "unknown arguments supplied with --stdin"
+msgstr "s'han proporcionat arguments desconeguts amb --stdin"
+
+msgid "git for-each-repo --config=<config> [--] <arguments>"
+msgstr "git for-each-repo --config=<config> [--] <arguments>"
msgid "config"
msgstr "config"
@@ -6098,6 +6242,10 @@ msgstr "clau de configuració emmagatzemant una llista de camins de repositori"
msgid "missing --config=<config>"
msgstr "falta --config=<config>"
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "s'ha obtingut una configuració incorrecta --config=%s"
+
msgid "unknown"
msgstr "desconegut"
@@ -6131,15 +6279,15 @@ msgstr "S'està comprovant la connectivitat"
#, c-format
msgid "missing %s %s"
-msgstr "manca %s %s"
+msgstr "%s %s manca"
#, c-format
msgid "unreachable %s %s"
-msgstr "inabastable %s %s"
+msgstr "%s %s inabastable"
#, c-format
msgid "dangling %s %s"
-msgstr "sense assignació %s %s"
+msgstr "%s %s sense assignació"
msgid "could not create lost-found"
msgstr "no s'ha pogut crear el trobat-perdut"
@@ -6238,24 +6386,45 @@ msgstr "%s apunta a una cosa estranya (%s)"
#, c-format
msgid "%s: detached HEAD points at nothing"
-msgstr "%s: el HEAD separat no apunta a res"
+msgstr "%s: la HEAD separada no apunta a res"
#, c-format
msgid "notice: %s points to an unborn branch (%s)"
msgstr "avís: %s apunta a una branca no nascuda (%s)"
-msgid "Checking cache tree"
-msgstr "S'està comprovant l'arbre de la memòria cau"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "S'està comprovant l'arbre de la memòria cau %s"
#, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "%s: apuntador sha1 no vàlid a l'arbre de la memòria cau"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s: punter sha1 no vàlid a l'arbre de la memòria cau %s"
msgid "non-tree in cache-tree"
msgstr "un no arbre en l'arbre de la memòria cau"
-msgid "git fsck [<options>] [<object>...]"
-msgstr "git fsck [<opcions>] [<objecte>...]"
+#, c-format
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s: punter sha1 no vàlid a «resolve-undo» de %s"
+
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "no s'ha pogut carregar l'índex de reversió per al paquet «%s»"
+
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "rev-index no vàlid per al paquet «%s»"
+
+msgid ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<object>...]"
+msgstr ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<objecte>...]"
msgid "show unreachable objects"
msgstr "mostra els objectes inabastables"
@@ -6305,64 +6474,54 @@ msgid "invalid parameter: expected sha1, got '%s'"
msgstr "paràmetre no vàlid: s'esperava sha1, s'ha obtingut «%s»"
msgid "git fsmonitor--daemon start [<options>]"
-msgstr "git fsmonitor--daemon start [<options>]"
+msgstr "git fsmonitor--daemon start [<opcions>]"
msgid "git fsmonitor--daemon run [<options>]"
-msgstr "git fsmonitor--daemon run [<options>]"
-
-msgid "git fsmonitor--daemon stop"
-msgstr "git fsmonitor--daemon stop"
-
-msgid "git fsmonitor--daemon status"
-msgstr "git fsmonitor--daemon status"
+msgstr "git fsmonitor--daemon run [<opcions>]"
#, c-format
msgid "value of '%s' out of range: %d"
msgstr "el valor de «%s» està fora de rang: %d"
-#, fuzzy, c-format
+#, c-format
msgid "value of '%s' not bool or int: %d"
-msgstr "valor de \"%s\" no bool ni int: el percentatge"
+msgstr "valor de «%s» no és booleà ni enter: %d"
#, c-format
msgid "fsmonitor-daemon is watching '%s'\n"
-msgstr "fsmonitor-daemon està veient '%s'\n"
+msgstr "fsmonitor-daemon està veient «%s»\n"
#, c-format
msgid "fsmonitor-daemon is not watching '%s'\n"
msgstr "fsmonitor-daemon no està vigilant «%s»\n"
-#, fuzzy, c-format
+#, c-format
msgid "could not create fsmonitor cookie '%s'"
-msgstr "no s'ha pogut crear la galeta fsmonitor '%s'"
+msgstr "no s'ha pogut crear la galeta fsmonitor «%s»"
#, c-format
msgid "fsmonitor: cookie_result '%d' != SEEN"
-msgstr "fsmonitor: cookie_result '%d' != SEEN"
+msgstr "fsmonitor: cookie_result «%d» != SEEN"
-#, fuzzy, c-format
+#, c-format
msgid "could not start IPC thread pool on '%s'"
msgstr "no s'ha pogut iniciar el grup de fils IPC a «%s»"
-#, fuzzy
msgid "could not start fsmonitor listener thread"
-msgstr "no s'ha pogut iniciar el fil d'oient del fsmonitor"
+msgstr "no s'ha pogut iniciar el fil receptor del fsmonitor"
-#, fuzzy
msgid "could not start fsmonitor health thread"
-msgstr "no s'ha pogut iniciar el fil d'oient del fsmonitor"
+msgstr "no s'ha pogut iniciar el fil de salut del fsmonitor"
-#, fuzzy
msgid "could not initialize listener thread"
-msgstr "no s'ha pogut inicialitzar el fil d'oient"
+msgstr "no s'ha pogut inicialitzar el fil receptor"
-#, fuzzy
msgid "could not initialize health thread"
-msgstr "no s'ha pogut inicialitzar el fil d'oient"
+msgstr "no s'ha pogut inicialitzar el fil de salut"
-#, fuzzy, c-format
+#, c-format
msgid "could not cd home '%s'"
-msgstr "no s'ha pogut tancar «%s»"
+msgstr "no s'ha pogut fer cd home «%s»"
#, c-format
msgid "fsmonitor--daemon is already running '%s'"
@@ -6372,15 +6531,13 @@ msgstr "fsmonitor--daemon is already running «%s»"
msgid "running fsmonitor-daemon in '%s'\n"
msgstr "s'està executant fsmonitor-daemon en «%s»\n"
-#, fuzzy, c-format
+#, c-format
msgid "starting fsmonitor-daemon in '%s'\n"
-msgstr "s'està iniciant fsmonitor-daemon a «%s»"
+msgstr "s'està iniciant fsmonitor-daemon a «%s»\n"
-#, fuzzy
msgid "daemon failed to start"
msgstr "el dimoni ha fallat en iniciar"
-#, fuzzy
msgid "daemon not online yet"
msgstr "el dimoni encara no està en línia"
@@ -6393,19 +6550,17 @@ msgstr "separat de la consola"
msgid "use <n> ipc worker threads"
msgstr "usa <n> fils de treball ipc"
-#, fuzzy
msgid "max seconds to wait for background daemon startup"
-msgstr "màxim de segons a esperar a l'inici del dimoni de fons"
+msgstr "màxim de segons a esperar a l'inici del dimoni en segon pla"
-#, fuzzy, c-format
+#, c-format
msgid "invalid 'ipc-threads' value (%d)"
-msgstr "valor «ipc-threads» no vàlid (%)"
+msgstr "valor «ipc-threads» no vàlid (%d)"
-#, fuzzy, c-format
+#, c-format
msgid "Unhandled subcommand '%s'"
-msgstr "Subordre no gestionada '%s'"
+msgstr "Subordre no gestionada «%s»"
-#, fuzzy
msgid "fsmonitor--daemon not supported on this platform"
msgstr "fsmonitor--daemon no és compatible amb aquesta plataforma"
@@ -6441,9 +6596,11 @@ msgstr ""
msgid "prune unreferenced objects"
msgstr "poda objectes sense referència"
-#, fuzzy
msgid "pack unreferenced objects separately"
-msgstr "poda objectes sense referència"
+msgstr "empaqueta els objectes no referenciats de forma separada"
+
+msgid "with --cruft, limit the size of new cruft packs"
+msgstr "amb --cruft, limiteu la mida dels paquets cruft nous"
msgid "be more thorough (increased runtime)"
msgstr "sigues més exhaustiu (el temps d'execució augmenta)"
@@ -6458,9 +6615,9 @@ msgstr ""
msgid "repack all other packs except the largest pack"
msgstr "reempaqueta tots els altres paquets excepte el paquet més gran"
-#, fuzzy, c-format
+#, c-format
msgid "failed to parse gc.logExpiry value %s"
-msgstr "no s'ha pogut analitzar el valor %s de gc.logexpiry"
+msgstr "no s'ha pogut analitzar el valor %s de gc.logExpiry"
#, c-format
msgid "failed to parse prune expiry value %s"
@@ -6518,7 +6675,7 @@ msgid "failed to finish 'git pack-objects' process"
msgstr "no s'ha pogut finalitzar el procés «git pack-objects»"
msgid "failed to write multi-pack-index"
-msgstr "no s'han pogut escriu l'índex del multipaquet"
+msgstr "no s'ha pogut escriure l'índex del multipaquet"
msgid "'git multi-pack-index expire' failed"
msgstr "ha fallat el venciment de «git multi-pack-index expire»"
@@ -6569,8 +6726,20 @@ msgstr "executa una tasca específica"
msgid "use at most one of --auto and --schedule=<frequency>"
msgstr "usa com a màxim un entre --auto i --schedule=<frequency>"
-msgid "failed to run 'git config'"
-msgstr "no s'ha pogut executar «git config»"
+#, c-format
+msgid "unable to add '%s' value of '%s'"
+msgstr "no es pot afegir el valor «%s» de «%s»"
+
+msgid "return success even if repository was not registered"
+msgstr "retorna èxit encara que el repositori no estigui registrat"
+
+#, c-format
+msgid "unable to unset '%s' value of '%s'"
+msgstr "no es pot desassignar el valor «%s» de «%s»"
+
+#, c-format
+msgid "repository '%s' is not registered"
+msgstr "el repositori «%s» no està registrat"
#, c-format
msgid "failed to expand path '%s'"
@@ -6598,22 +6767,19 @@ msgstr ""
"no s'ha pogut executar «crontab -l»; el vostre sistema podria no admetre "
"«cron»"
+msgid "failed to create crontab temporary file"
+msgstr "no s'ha pogut crear un fitxer temporal crontab"
+
+msgid "failed to open temporary file"
+msgstr "no s'ha pogut obrir el fitxer temporal"
+
msgid "failed to run 'crontab'; your system might not support 'cron'"
msgstr ""
"no s'ha pogut executar «crontab»; el vostre sistema podria no admetre «cron»"
-msgid "failed to open stdin of 'crontab'"
-msgstr "s'ha produït un error en obrir stdin de «crontab»"
-
msgid "'crontab' died"
msgstr "«crontab» ha mort"
-msgid "failed to start systemctl"
-msgstr "s'ha produït un error en iniciar systemctl"
-
-msgid "failed to run systemctl"
-msgstr "s'ha produït un error en executar systemctl"
-
#, c-format
msgid "failed to delete '%s'"
msgstr "s'ha produït un error en suprimir «%s»"
@@ -6622,6 +6788,12 @@ msgstr "s'ha produït un error en suprimir «%s»"
msgid "failed to flush '%s'"
msgstr "no s'ha pogut buidar «%s»"
+msgid "failed to start systemctl"
+msgstr "s'ha produït un error en iniciar systemctl"
+
+msgid "failed to run systemctl"
+msgstr "s'ha produït un error en executar systemctl"
+
#, c-format
msgid "unrecognized --scheduler argument '%s'"
msgstr "l'argument --scheduler no reconegut «%s»"
@@ -6645,15 +6817,14 @@ msgstr "planificador"
msgid "scheduler to trigger git maintenance run"
msgstr "planificador per a activar l'execució de manteniment del git"
+msgid "failed to set up maintenance schedule"
+msgstr "no s'ha pogut configurar la planificació del manteniment"
+
msgid "failed to add repo to global config"
msgstr "no s'ha pogut afegir un repositori a la configuració global"
msgid "git maintenance <subcommand> [<options>]"
-msgstr "git maintenance <subcommand> [<options>]"
-
-#, c-format
-msgid "invalid subcommand: %s"
-msgstr "subordre no vàlida: %s"
+msgstr "git maintenance <subcommand> [<opcions>]"
msgid "git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]"
msgstr "git grep [<opcions>] [-e] <patró> [<revisió>...] [[--] <camí>...]"
@@ -6680,6 +6851,10 @@ msgid "unable to read tree (%s)"
msgstr "no s'ha pogut llegir l'arbre (%s)"
#, c-format
+msgid "unable to read tree %s"
+msgstr "no s'ha pogut llegir l'arbre %s"
+
+#, c-format
msgid "unable to grep from object of type %s"
msgstr "no es pot fer grep des d'un objecte de tipus %s"
@@ -6715,7 +6890,7 @@ msgid "process binary files as text"
msgstr "processa els fitxers binaris com a text"
msgid "don't match patterns in binary files"
-msgstr "no coincideixis amb els patrons en els fitxers binaris"
+msgstr "no cerquis els patrons en els fitxers binaris"
msgid "process binary files with textconv filters"
msgstr "processa els fitxers binaris amb filtres de textconv"
@@ -6723,8 +6898,8 @@ msgstr "processa els fitxers binaris amb filtres de textconv"
msgid "search in subdirectories (default)"
msgstr "cerca als subdirectoris (per defecte)"
-msgid "descend at most <depth> levels"
-msgstr "descendeix com a màxim <profunditat> nivells"
+msgid "descend at most <n> levels"
+msgstr "descendeix com a màxim <n> nivells"
msgid "use extended POSIX regular expressions"
msgstr "usa les expressions regulars POSIX ampliades"
@@ -6829,6 +7004,9 @@ msgstr "mostra els fitxers coincidents en el paginador"
msgid "allow calling of grep(1) (ignored by this build)"
msgstr "permet la invocació de grep(1) (ignorat per aquesta compilació)"
+msgid "maximum number of results per file"
+msgstr "nombre màxim de resultats per fitxer"
+
msgid "no pattern given"
msgstr "no s'ha donat cap patró"
@@ -6862,11 +7040,14 @@ msgid "both --cached and trees are given"
msgstr "ambdós --cached i arbres venen donats"
msgid ""
-"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] "
-"[--] <file>..."
+"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
+" [--stdin [--literally]] [--] <file>..."
msgstr ""
-"git hash-object [-t <tipus>] [-w] [--path=<fitxer> | --no-filters] [--stdin] "
-"[--] <fitxer>..."
+"git hash-object [-t <tipus>] [-w] [--path=<fitxer> | --no-filters]\n"
+" [--stdin [--literally]] [--] <fitxer>..."
+
+msgid "git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]"
+msgstr "git hash-object [-t <tipus>] [-w] --stdin-paths [--no-filters]"
msgid "object type"
msgstr "tipus d'objecte"
@@ -6892,11 +7073,9 @@ msgstr "processa el fitxer com si fos d'aquest camí"
msgid "print all available commands"
msgstr "imprimeix totes les ordres disponibles"
-#, fuzzy
msgid "show external commands in --all"
msgstr "mostra les ordres externes a --all"
-#, fuzzy
msgid "show aliases in --all"
msgstr "mostra els àlies a --all"
@@ -6918,11 +7097,21 @@ msgstr "imprimeix la descripció de l'ordre"
msgid "print list of useful guides"
msgstr "imprimeix la llista de guies útils"
+msgid "print list of user-facing repository, command and file interfaces"
+msgstr ""
+"imprimeix la llista de repositoris, ordres i interfícies de fitxers que veu "
+"l'usuari"
+
+msgid "print list of file formats, protocols and other developer interfaces"
+msgstr ""
+"mostra la llista de formats de fitxer, protocols i altres interfícies de "
+"desenvolupador"
+
msgid "print all configuration variable names"
msgstr "imprimeix tots els noms de les variables de configuració"
-msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>]"
-msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>]"
+msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"
+msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"
#, c-format
msgid "unrecognized help format '%s'"
@@ -6976,16 +7165,15 @@ msgstr "«%s» és un àlies de «%s»"
msgid "bad alias.%s string: %s"
msgstr "cadena «alias.%s» incorrecte: %s"
-#, fuzzy, c-format
+#, c-format
msgid "the '%s' option doesn't take any non-option arguments"
msgstr "l'opció «%s» no pren cap argument que no sigui una opció"
-#, fuzzy
msgid ""
"the '--no-[external-commands|aliases]' options can only be used with '--all'"
msgstr ""
-"les opcions «--no-exexternal-commands|aliases with» només es poden utilitzar "
-"amb «--all»"
+"les opcions «--no-[external-commands|aliases]» només es poden utilitzar amb "
+"«--all»"
#, c-format
msgid "usage: %s%s"
@@ -6994,12 +7182,19 @@ msgstr "ús: %s%s"
msgid "'git help config' for more information"
msgstr "«git help config» per a més informació"
-msgid "git hook run [--ignore-missing] <hook-name> [-- <hook-args>]"
-msgstr "git hook run [--ignore-missing] <hook-name> [-- <hook-args>]"
+msgid ""
+"git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-"
+"args>]"
+msgstr ""
+"git hook run [--ignore-missing] [--to-stdin=<camí>] <hook-name> [-- <hook-"
+"args>]"
msgid "silently ignore missing requested <hook-name>"
msgstr "ignora silenciosament la sol·licitud <hook-name> perduda"
+msgid "file to read into hooks' stdin"
+msgstr "fitxer per a llegir a l'entrada estàndard dels lligams"
+
#, c-format
msgid "object type mismatch at %s"
msgstr "hi ha una discordança de tipus d'objecte a %s"
@@ -7078,10 +7273,6 @@ msgid "SHA1 COLLISION FOUND WITH %s !"
msgstr "S'HA TROBAT UNA COL·LISIÓ SHA1 AMB %s !"
#, c-format
-msgid "unable to read %s"
-msgstr "no s'ha pogut llegir %s"
-
-#, c-format
msgid "cannot read existing object info %s"
msgstr "no es pot llegir la informació d'objecte existent %s"
@@ -7144,8 +7335,8 @@ msgstr "Suma de verificació final no esperada per a %s (corrupció de disc?)"
#, c-format
msgid "pack has %d unresolved delta"
msgid_plural "pack has %d unresolved deltas"
-msgstr[0] "El paquet té %d diferència no resolta"
-msgstr[1] "El paquet té %d diferències no resoltes"
+msgstr[0] "el paquet té %d diferència no resolta"
+msgstr[1] "el paquet té %d diferències no resoltes"
#, c-format
msgid "unable to deflate appended object (%d)"
@@ -7174,9 +7365,9 @@ msgstr "no s'ha pogut canviar el nom del fitxer temporal «*.%s» a «%s»"
msgid "error while closing pack file"
msgstr "error en tancar el fitxer empaquetat"
-#, fuzzy, c-format
+#, c-format
msgid "bad pack.indexVersion=%<PRIu32>"
-msgstr "pack.indexversion=%<PRIu32> incorrecte"
+msgstr "bad pack.indexVersion=%<PRIu32>"
#, c-format
msgid "Cannot open existing pack file '%s'"
@@ -7207,7 +7398,7 @@ msgstr "%s incorrecte"
#, c-format
msgid "unknown hash algorithm '%s'"
-msgstr "algorisme hash desconegut «%s»"
+msgstr "algorisme de resum desconegut «%s»"
msgid "--stdin requires a git repository"
msgstr "--stdin requereix un repositori git"
@@ -7218,83 +7409,18 @@ msgstr "s'ha donat --verify sense nom de fitxer de paquet"
msgid "fsck error in pack objects"
msgstr "error fsck als objectes del paquet"
-#, c-format
-msgid "cannot stat template '%s'"
-msgstr "no es pot fer stat en la plantilla «%s»"
-
-#, c-format
-msgid "cannot opendir '%s'"
-msgstr "no es pot fer opendir en el directori «%s»"
-
-#, c-format
-msgid "cannot readlink '%s'"
-msgstr "no es pot fer readlink en «%s»"
-
-#, c-format
-msgid "cannot symlink '%s' '%s'"
-msgstr "no es pot fer symlink en «%s» «%s»"
-
-#, c-format
-msgid "cannot copy '%s' to '%s'"
-msgstr "no es pot copiar «%s» a «%s»"
-
-#, c-format
-msgid "ignoring template %s"
-msgstr "s'està ignorant la plantilla %s"
-
-#, c-format
-msgid "templates not found in %s"
-msgstr "plantilles no trobades a %s"
-
-#, c-format
-msgid "not copying templates from '%s': %s"
-msgstr "no s'estan copiant plantilles de «%s»: %s"
-
-#, c-format
-msgid "invalid initial branch name: '%s'"
-msgstr "nom de branca inicial no vàlid: «%s»"
-
-#, c-format
-msgid "unable to handle file type %d"
-msgstr "no s'ha pogut gestionar el tipus de fitxer %d"
-
-#, c-format
-msgid "unable to move %s to %s"
-msgstr "no s'ha pogut moure %s a %s"
-
-msgid "attempt to reinitialize repository with different hash"
-msgstr "s'ha intentat reinicialitzar el repositori amb un hash diferent"
-
-#, c-format
-msgid "%s already exists"
-msgstr "%s ja existeix"
-
-#, c-format
-msgid "re-init: ignored --initial-branch=%s"
-msgstr "reinicialització: s'ha ignorat --initial-branch=%s"
-
-#, c-format
-msgid "Reinitialized existing shared Git repository in %s%s\n"
-msgstr "S'ha reinicialitzat el repositori compartit existent del Git en %s%s\n"
-
-#, c-format
-msgid "Reinitialized existing Git repository in %s%s\n"
-msgstr "S'ha reinicialitzat el repositori existent del Git en %s%s\n"
-
-#, c-format
-msgid "Initialized empty shared Git repository in %s%s\n"
-msgstr "S'ha inicialitzat un repositori compartit buit del Git en %s%s\n"
-
-#, c-format
-msgid "Initialized empty Git repository in %s%s\n"
-msgstr "S'ha inicialitzat un repositori buit del Git en %s%s\n"
-
msgid ""
-"git init [-q | --quiet] [--bare] [--template=<template-directory>] [--"
-"shared[=<permissions>]] [<directory>]"
+"git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
+" [--separate-git-dir <git-dir>] [--object-format=<format>]\n"
+" [--ref-format=<format>]\n"
+" [-b <branch-name> | --initial-branch=<branch-name>]\n"
+" [--shared[=<permissions>]] [<directory>]"
msgstr ""
-"git init [-q | --quiet] [--bare] [--template=<directori-de-plantilla>] [--"
-"shared[=<permisos>]] [<directori>]"
+"git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
+" [--separate-git-dir <git-dir>] [--object-format=<format>]\n"
+" [--ref-format=<format>]\n"
+" [-b <branch-name> | --initial-branch=<branch-name>]\n"
+" [--shared[=<permissions>]] [<directory>]"
msgid "permissions"
msgstr "permisos"
@@ -7307,7 +7433,7 @@ msgid "override the name of the initial branch"
msgstr "sobreescriu el nom de la branca inicial"
msgid "hash"
-msgstr "hash"
+msgstr "resum"
msgid "specify the hash algorithm to use"
msgstr "especifiqueu l'algorisme de resum a usar"
@@ -7336,11 +7462,13 @@ msgid "--separate-git-dir incompatible with bare repository"
msgstr "--separate-git-dir és incompatible amb un repositori nu"
msgid ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"<token>[(=|:)<value>])...] [<file>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<key>|<keyAlias>)[(=|:)<value>])...]\n"
+" [--parse] [<file>...]"
msgstr ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"<testimoni>[(=|:)<valor>])...] [<fitxer>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<key>|<keyAlias>)[(=|:)<value>])...]\n"
+" [--parse] [<file>...]"
msgid "edit files in place"
msgstr "edita els fitxers in situ"
@@ -7348,6 +7476,9 @@ msgstr "edita els fitxers in situ"
msgid "trim empty trailers"
msgstr "escurça els remolcs buits"
+msgid "placement"
+msgstr "posicionament"
+
msgid "where to place the new trailer"
msgstr "on ubicar el «trailer» nou"
@@ -7360,17 +7491,18 @@ msgstr "acció si el «trailer» falta"
msgid "output only the trailers"
msgstr "mostra només els «trailer»"
-msgid "do not apply config rules"
-msgstr "no apliquis les regles de configuració"
+msgid "do not apply trailer.* configuration variables"
+msgstr "no apliquis les variables de configuració trailer.*"
-msgid "join whitespace-continued values"
-msgstr "uneix els valors continus amb espais en blanc"
+msgid "reformat multiline trailer values as single-line values"
+msgstr ""
+"reformata els valors del tràiler multilínia com a valors de línia única"
-msgid "set parsing options"
-msgstr "estableix les opcions d'anàlisi"
+msgid "alias for --only-trailers --only-input --unfold"
+msgstr "àlies per a --only-trailers --only-input --unfold"
-msgid "do not treat --- specially"
-msgstr "no tractis --- especialment"
+msgid "do not treat \"---\" as the end of input"
+msgstr "no tractis «---» com el final de l'entrada"
msgid "trailer(s) to add"
msgstr "remolcs a afegir"
@@ -7397,8 +7529,8 @@ msgstr "omet la sortida de diferències"
msgid "show source"
msgstr "mostra la font"
-msgid "use mail map file"
-msgstr "usa el fitxer de mapa de correu"
+msgid "clear all previously-defined decoration filters"
+msgstr "neteja tots els filtres de decoració prèviament definits"
msgid "only decorate refs that match <pattern>"
msgstr "només decora les referències que coincideixin amb <patró>"
@@ -7414,20 +7546,19 @@ msgid ""
"<file>"
msgstr ""
"traça l'evolució del rang de línia <start>,<end> o funcions :<funcname> a "
-"<file>"
+"<fitxer>"
#, c-format
msgid "unrecognized argument: %s"
msgstr "argument no reconegut: %s"
msgid "-L<range>:<file> cannot be used with pathspec"
-msgstr "-L<range>:<file> no es pot usar amb una especificació de camí"
+msgstr "-L<range>:<fitxer> no es pot usar amb una especificació de camí"
#, c-format
msgid "Final output: %d %s\n"
msgstr "Sortida final: %d %s\n"
-#, fuzzy
msgid "unable to create temporary object directory"
msgstr "no s'ha pogut crear el directori temporal de l'objecte"
@@ -7460,6 +7591,10 @@ msgstr "necessita exactament un interval"
msgid "not a range"
msgstr "no és un interval"
+#, c-format
+msgid "unable to read branch description file '%s'"
+msgstr "no es pot llegir el fitxer de descripció de la branca «%s»"
+
msgid "cover letter needs email format"
msgstr "la carta de presentació necessita un format de correu electrònic"
@@ -7494,7 +7629,7 @@ msgid ""
msgstr ""
"no s'ha pogut obtenir la font, si voleu registrar la comissió base\n"
"automàticament, useu git branch --set-upstream-to per a seguir una\n"
-"una branca remota. També podeu especificar la comissió base amb --base=<base-"
+"branca remota. També podeu especificar la comissió base amb --base=<base-"
"commit-id> manualment"
msgid "failed to find exact merge base"
@@ -7561,6 +7696,9 @@ msgstr ""
"genera parts d'una carta de presentació basant-se en la descripció d'una "
"branca"
+msgid "use branch description from file"
+msgstr "utilitza la descripció de la branca des del fitxer"
+
msgid "use [<prefix>] instead of [PATCH]"
msgstr "useu [<prefix>] en comptes de [PATCH]"
@@ -7574,7 +7712,7 @@ msgid "don't output binary diffs"
msgstr "no emetis diferències binàries"
msgid "output all-zero hash in From header"
-msgstr "emet un hash de tots zeros en la capçalera From"
+msgstr "emet un resum de tots zeros en la capçalera From"
msgid "don't include a patch matching a commit upstream"
msgstr "no incloguis pedaços que coincideixin amb comissions a la font"
@@ -7658,6 +7796,11 @@ msgstr ""
msgid "percentage by which creation is weighted"
msgstr "percentatge pel qual la creació és ponderada"
+msgid "show in-body From: even if identical to the e-mail header"
+msgstr ""
+"mostra en el cos el remitent: encara que sigui idèntic a la capçalera del "
+"correu electrònic"
+
#, c-format
msgid "invalid ident line: %s"
msgstr "línia d'identitat no vàlida: %s"
@@ -7718,6 +7861,22 @@ msgstr ""
"No s'ha pogut trobar una branca remota seguida. Especifiqueu <font> "
"manualment.\n"
+#, c-format
+msgid "could not get object info about '%s'"
+msgstr "no s'ha pogut obtenir la informació sobre l'objecte «%s»"
+
+#, c-format
+msgid "bad ls-files format: element '%s' does not start with '('"
+msgstr "format incorrecte del ls-files: l'element «%s» no comença amb «(»"
+
+#, c-format
+msgid "bad ls-files format: element '%s' does not end in ')'"
+msgstr "format incorrecte del ls-files: l'element «%s» no acaba amb «)»"
+
+#, c-format
+msgid "bad ls-files format: %%%.*s"
+msgstr "format incorrecte de ls-files: %%%.*s"
+
msgid "git ls-files [<options>] [<file>...]"
msgstr "git ls-files [<opcions>] [<fitxer>...]"
@@ -7774,7 +7933,7 @@ msgid "skip files matching pattern"
msgstr "omet els fitxers coincidents amb el patró"
msgid "read exclude patterns from <file>"
-msgstr "llegeix els patrons des de <file>"
+msgstr "llegeix els patrons des de <fitxer>"
msgid "read additional per-directory exclude patterns in <file>"
msgstr "llegeix els patrons addicionals d'exclusió per directori en <fitxer>"
@@ -7805,13 +7964,20 @@ msgid "show sparse directories in the presence of a sparse index"
msgstr "mostra els directoris dispersos en presència d'un índex dispers"
msgid ""
+"--format cannot be used with -s, -o, -k, -t, --resolve-undo, --deduplicate, "
+"--eol"
+msgstr ""
+"--format no es pot usar amb -s, -o, -k, -t, --resolve-undo, --deduplicate, --"
+"eol"
+
+msgid ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<repository> [<refs>...]]"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
+" [--symref] [<repository> [<patterns>...]]"
msgstr ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<repository> [<refs>...]]"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
+" [--symref] [<repository> [<patterns>...]]"
msgid "do not print remote URL"
msgstr "no imprimeixis l'URL remot"
@@ -7826,7 +7992,7 @@ msgid "limit to tags"
msgstr "limita a etiquetes"
msgid "limit to heads"
-msgstr "limita a caps"
+msgstr "limita a «heads»"
msgid "do not show peeled tags"
msgstr "no mostris les etiquetes pelades"
@@ -7843,21 +8009,17 @@ msgstr "mostra la referència subjacent a més de l'objecte que assenyali"
msgid "git ls-tree [<options>] <tree-ish> [<path>...]"
msgstr "git ls-tree [<opcions>] <arbre> [<camí>...]"
-#, fuzzy, c-format
-msgid "could not get object info about '%s'"
-msgstr "no s'ha pogut obtenir la informació de l'objecte sobre «%s»"
-
-#, fuzzy, c-format
+#, c-format
msgid "bad ls-tree format: element '%s' does not start with '('"
-msgstr "format ls-tree dolent: l'element '%s' no comença amb '('"
+msgstr "format incorrecte del ls-tree: l'element '%s' no comença amb «(»"
-#, fuzzy, c-format
+#, c-format
msgid "bad ls-tree format: element '%s' does not end in ')'"
-msgstr "format ls-tree dolent: l'element '%s' no acaba en ')'"
+msgstr "format incorrecte del ls-tree: l'element '%s' no acaba en «(»"
-#, fuzzy, c-format
+#, c-format
msgid "bad ls-tree format: %%%.*s"
-msgstr "format incorrecte de ls-tree:%%.*s"
+msgstr "format incorrecte de ls-tree: %%%.*s"
msgid "only show trees"
msgstr "mostra només els arbres"
@@ -7877,7 +8039,6 @@ msgstr "mida de l'objecte d'inclusió"
msgid "list only filenames"
msgstr "llista només els noms de fitxer"
-#, fuzzy
msgid "list only objects"
msgstr "llista només els objectes"
@@ -7888,13 +8049,12 @@ msgid "list entire tree; not just current directory (implies --full-name)"
msgstr ""
"llista l'arbre sencer; no només el directori actual (implica --full-name)"
-#, fuzzy
msgid "--format can't be combined with other format-altering options"
msgstr "--format no es pot combinar amb altres opcions d'alteració de format"
#. TRANSLATORS: keep <> in "<" mail ">" info.
msgid "git mailinfo [<options>] <msg> <patch> < mail >info"
-msgstr "git mailinfo [<options>] <msg> <patch> < mail >info"
+msgstr "git mailinfo [<opcions>] <msg> <pedaç> < mail >info"
msgid "keep subject"
msgstr "mantén l'assumpte"
@@ -7924,14 +8084,13 @@ msgid "<action>"
msgstr "<acció>"
msgid "action when quoted CR is found"
-msgstr "acció quan es troba un CR en una cita"
+msgstr "acció quan es troba un CR entre cometes"
msgid "use headers in message's body"
msgstr "utilitza les capçaleres en el cos del missatge"
-#, fuzzy
msgid "reading patches from stdin/tty..."
-msgstr "llegir pedaços de stdin/tty..."
+msgstr "s'estan llegint pedaços de stdin/tty..."
#, c-format
msgid "empty mbox: '%s'"
@@ -7943,12 +8102,12 @@ msgstr "git merge-base [-a | --all] <comissió> <comissió>..."
msgid "git merge-base [-a | --all] --octopus <commit>..."
msgstr "git merge-base [-a | --all] --octopus <comissió>..."
-msgid "git merge-base --independent <commit>..."
-msgstr "git merge-base --independent <comissió>..."
-
msgid "git merge-base --is-ancestor <commit> <commit>"
msgstr "git merge-base --is-ancestor <comissió> <comissió>"
+msgid "git merge-base --independent <commit>..."
+msgstr "git merge-base --independent <comissió>..."
+
msgid "git merge-base --fork-point <ref> [<commit>]"
msgstr "git merge-base --fork-point <referència> [<comissió>]"
@@ -7975,9 +8134,18 @@ msgstr ""
"git merge-file [<opcions>] [-L <nom1> [-L <original> [-L <nom2>]]] <fitxer1> "
"<fitxer-original> <fitxer2>"
+msgid ""
+"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
+"\"histogram\""
+msgstr ""
+"l'opció diff-algorithm accepta «myers», «minimal», «patience» i «histogram»"
+
msgid "send results to standard output"
msgstr "envia els resultats a la sortida estàndard"
+msgid "use object IDs instead of filenames"
+msgstr "utilitza els ID dels objectes en comptes dels noms de fitxer"
+
msgid "use a diff3 based merge"
msgstr "usa una fusió basada en diff3"
@@ -7993,6 +8161,12 @@ msgstr "en conflictes, usa la seva versió"
msgid "for conflicts, use a union version"
msgstr "en conflictes, usa una versió d'unió"
+msgid "<algorithm>"
+msgstr "<algorisme>"
+
+msgid "choose a diff algorithm"
+msgstr "trieu un algorisme per al diff"
+
msgid "for conflicts, use this marker size"
msgstr "en conflictes, usa aquesta mida de marcador"
@@ -8003,6 +8177,13 @@ msgid "set labels for file1/orig-file/file2"
msgstr "estableix les etiquetes per a fitxer1/fitxer-original/fitxer2"
#, c-format
+msgid "object '%s' does not exist"
+msgstr "l'objecte «%s» no existeix"
+
+msgid "Could not write object file"
+msgstr "No s'ha pogut escriure el fitxer de l'objecte"
+
+#, c-format
msgid "unknown option %s"
msgstr "opció desconeguda %s"
@@ -8027,6 +8208,63 @@ msgstr "no s'ha pogut resoldre la referència «%s»"
msgid "Merging %s with %s\n"
msgstr "S'està fusionant %s amb %s\n"
+msgid "not something we can merge"
+msgstr "no és quelcom que puguem fusionar"
+
+msgid "refusing to merge unrelated histories"
+msgstr "s'està refusant fusionar històries no relacionades"
+
+msgid "failure to merge"
+msgstr "s'ha produït un error en fusionar"
+
+msgid "git merge-tree [--write-tree] [<options>] <branch1> <branch2>"
+msgstr "git merge-tree [--write-tree] [<opcions>] <branch1> <branch2>"
+
+msgid "git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"
+msgstr "git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"
+
+msgid "do a real merge instead of a trivial merge"
+msgstr "fes una fusió real en lloc d'una fusió trivial"
+
+msgid "do a trivial merge only"
+msgstr "fes només una fusió trivial"
+
+msgid "also show informational/conflict messages"
+msgstr "també mostra missatges informatius i de conflictes"
+
+msgid "list filenames without modes/oids/stages"
+msgstr "llista els noms de fitxer sense modes/oids/stages"
+
+msgid "allow merging unrelated histories"
+msgstr "permet fusionar històries no relacionades"
+
+msgid "perform multiple merges, one per line of input"
+msgstr "realitza múltiples fusions, una per línia d'entrada"
+
+msgid "specify a merge-base for the merge"
+msgstr "cal especificar una referència base per a la fusió"
+
+msgid "option=value"
+msgstr "opció=valor"
+
+msgid "option for selected merge strategy"
+msgstr "opció per a l'estratègia de fusió seleccionada"
+
+msgid "--trivial-merge is incompatible with all other options"
+msgstr "--trivial-merge és incompatible amb totes les altres opcions"
+
+#, c-format
+msgid "unknown strategy option: -X%s"
+msgstr "opció d'estratègia desconeguda: -X%s"
+
+#, c-format
+msgid "malformed input line: '%s'."
+msgstr "línia d'entrada mal formada: «%s»."
+
+#, c-format
+msgid "merging cannot continue; got unclean result of %d"
+msgstr "la fusió no pot continuar; s'ha obtingut un resultat no net de %d"
+
msgid "git merge [<options>] [<commit>...]"
msgstr "git merge [<opcions>] [<comissió>...]"
@@ -8087,12 +8325,6 @@ msgstr "estratègia"
msgid "merge strategy to use"
msgstr "estratègia de fusió a usar"
-msgid "option=value"
-msgstr "opció=valor"
-
-msgid "option for selected merge strategy"
-msgstr "opció per a l'estratègia de fusió seleccionada"
-
msgid "merge commit message (for a non-fast-forward merge)"
msgstr "missatge de comissió de fusió (per a una fusió no d'avanç ràpid)"
@@ -8106,10 +8338,7 @@ msgid "--abort but leave index and working tree alone"
msgstr "--abort però deixa l'índex i l'arbre de treball intactes"
msgid "continue the current in-progress merge"
-msgstr "continua la fusió en curs actual"
-
-msgid "allow merging unrelated histories"
-msgstr "permet fusionar històries no relacionades"
+msgstr "continua la fusió actual en curs"
msgid "bypass pre-merge-commit and commit-msg hooks"
msgstr "evita els lligams pre-merge-commit i commit-msg"
@@ -8156,10 +8385,6 @@ msgid "Not handling anything other than two heads merge."
msgstr "No s'està gestionant res a part de la fusió de dos caps."
#, c-format
-msgid "unknown strategy option: -X%s"
-msgstr "opció d'estratègia desconeguda: -X%s"
-
-#, c-format
msgid "unable to write %s"
msgstr "no s'ha pogut escriure %s"
@@ -8230,9 +8455,6 @@ msgstr "no s'ha pogut tancar «%s»"
msgid "not something we can merge in %s: %s"
msgstr "no és quelcom que puguem fusionar en %s: %s"
-msgid "not something we can merge"
-msgstr "no és quelcom que puguem fusionar"
-
msgid "--abort expects no arguments"
msgstr "--abort no espera cap argument"
@@ -8271,26 +8493,31 @@ msgstr ""
"establert."
msgid "Squash commit into empty head not supported yet"
-msgstr "Una comissió «squash» a un HEAD buit encara no es permet"
+msgstr "Una comissió «squash» a una HEAD buida encara no es permet"
msgid "Non-fast-forward commit does not make sense into an empty head"
-msgstr "Una comissió no d'avanç ràpid no té sentit a un HEAD buit"
+msgstr "Una comissió no d'avanç ràpid no té sentit a una HEAD buida"
#, c-format
msgid "%s - not something we can merge"
msgstr "%s - no és una cosa que puguem fusionar"
msgid "Can merge only exactly one commit into empty head"
-msgstr "Es pot fusionar només una comissió a un HEAD buit"
-
-msgid "refusing to merge unrelated histories"
-msgstr "s'està refusant fusionar històries no relacionades"
+msgstr "Es pot fusionar només una comissió a una HEAD buida"
#, c-format
msgid "Updating %s..%s\n"
msgstr "S'estan actualitzant %s..%s\n"
#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+" %s"
+msgstr ""
+"Els canvis locals als fitxers següents se sobreescriuran per la fusió:\n"
+" %s"
+
+#, c-format
msgid "Trying really trivial in-index merge...\n"
msgstr "S'està intentant una fusió molt trivial en l'índex...\n"
@@ -8325,6 +8552,10 @@ msgstr ""
"demanat\n"
#, c-format
+msgid "When finished, apply stashed changes with `git stash pop`\n"
+msgstr "Quan acabi, aplica els canvis «stashed» amb «git stash pop»\n"
+
+#, c-format
msgid "warning: tag input does not pass fsck: %s"
msgstr "avís: l'entrada d'etiqueta no passa fsck: %s"
@@ -8369,8 +8600,8 @@ msgid ""
"git multi-pack-index [<options>] write [--preferred-pack=<pack>][--refs-"
"snapshot=<path>]"
msgstr ""
-"git multi-pack-index [<options>] write [--preferred-pack=<pack>][--refs-"
-"snapshot=<path>]"
+"git multi-pack-index [<opcions>] write [--preferred-pack=<pack>][--refs-"
+"snapshot=<camí>]"
msgid "git multi-pack-index [<options>] verify"
msgstr "git multi-pack-index [<opcions>] verify"
@@ -8381,9 +8612,8 @@ msgstr "git multi-pack-index [<opcions>] expire"
msgid "git multi-pack-index [<options>] repack [--batch-size=<size>]"
msgstr "git multi-pack-index [<opcions>] repack [--batch-size=<mida>]"
-#, fuzzy
msgid "directory"
-msgstr "fitxer/directori"
+msgstr "directori"
msgid "object directory containing set of packfile and pack-index pairs"
msgstr ""
@@ -8447,11 +8677,14 @@ msgstr "S'està comprovant el canvi de nom de «%s» a «%s»\n"
msgid "bad source"
msgstr "origen incorrecte"
+msgid "destination exists"
+msgstr "el destí existeix"
+
msgid "can not move directory into itself"
msgstr "no es pot moure un directori a dins d'ell mateix"
-msgid "cannot move directory over file"
-msgstr "no es pot moure un directori sobre un fitxer"
+msgid "destination already exists"
+msgstr "la destinació ja existeix"
msgid "source directory is empty"
msgstr "el directori d'origen està buit"
@@ -8462,9 +8695,6 @@ msgstr "no està sota control de versions"
msgid "conflicted"
msgstr "en conflicte"
-msgid "destination exists"
-msgstr "el destí existeix"
-
#, c-format
msgid "overwriting '%s'"
msgstr "s'està sobreescrivint «%s»"
@@ -8478,6 +8708,9 @@ msgstr "múltiples orígens per al mateix destí"
msgid "destination directory does not exist"
msgstr "el directori destí no existeix"
+msgid "destination exists in the index"
+msgstr "el destí existeix a l'índex"
+
#, c-format
msgid "%s, source=%s, destination=%s"
msgstr "%s, origen=%s, destí=%s"
@@ -8497,7 +8730,7 @@ msgid "git name-rev [<options>] --all"
msgstr "git name-rev [<opcions>] --all"
msgid "git name-rev [<options>] --annotate-stdin"
-msgstr "git name-rev [<options>] --annotate-stdin"
+msgstr "git name-rev [<opcions>] --annotate-stdin"
msgid "print only ref-based names (no object names)"
msgstr "imprimeix només els noms basats en referències (no els noms d'objecte)"
@@ -8514,11 +8747,9 @@ msgstr "ignora les referències que coincideixin amb <patró>"
msgid "list all commits reachable from all refs"
msgstr "llista totes les comissions abastables de totes les referències"
-#, fuzzy
msgid "deprecated: use --annotate-stdin instead"
-msgstr "obsolet: useu annotate-stdin"
+msgstr "obsolet: useu en comptes --annotate-stdin"
-#, fuzzy
msgid "annotate text from stdin"
msgstr "anota el text de stdin"
@@ -8532,22 +8763,26 @@ msgid "git notes [--ref <notes-ref>] [list [<object>]]"
msgstr "git notes [--ref <referència-de-notes>] [llista [<objecte>]]"
msgid ""
-"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [-m <msg> | -F <file> "
-"| (-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref <referència-de-notes>] add [-f] [--allow-empty] [-m "
-"<missatge> | -F <fitxer> | (-c | -C) <objecte>] [<objecte>]"
+"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
msgstr ""
"git notes [--ref <referència-de-notes>] copy [-f] <d'objecte> <a-objecte>"
msgid ""
-"git notes [--ref <notes-ref>] append [--allow-empty] [-m <msg> | -F <file> | "
-"(-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref <referència-de-notes>] append [--allow-empty] [-m "
-"<missatge> | -F <fitxer> | (-c | -C) <objecte>] [<objecte>]"
+"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
msgstr ""
@@ -8649,10 +8884,6 @@ msgid "cannot read note data from non-blob object '%s'."
msgstr "no es poden llegir les dades de node de l'objecte no de blob «%s»."
#, c-format
-msgid "malformed input line: '%s'."
-msgstr "línia d'entrada mal formada: «%s»."
-
-#, c-format
msgid "failed to copy notes from '%s' to '%s'"
msgstr "s'ha produït un error en copiar les notes de «%s» a «%s»"
@@ -8685,6 +8916,15 @@ msgstr "permet l'emmagatzematge d'una nota buida"
msgid "replace existing notes"
msgstr "reemplaça les notes existents"
+msgid "<paragraph-break>"
+msgstr "<paragraph-break>"
+
+msgid "insert <paragraph-break> between paragraphs"
+msgstr "insereix <paragraph-break> entre paràgrafs"
+
+msgid "remove unnecessary whitespace"
+msgstr "elimina l'espai en blanc innecessari"
+
#, c-format
msgid ""
"Cannot add notes. Found existing notes for object %s. Use '-f' to overwrite "
@@ -8842,20 +9082,16 @@ msgid "use notes from <notes-ref>"
msgstr "usa les notes de <referència-de-notes>"
#, c-format
-msgid "unknown subcommand: %s"
-msgstr "subordre desconeguda: %s"
+msgid "unknown subcommand: `%s'"
+msgstr "subordre desconeguda: «%s»"
-msgid ""
-"git pack-objects --stdout [<options>...] [< <ref-list> | < <object-list>]"
-msgstr ""
-"git pack-objects --stdout [<opcions>...] [< <llista-de-referències> | < "
-"<llista-de-objectes>]"
+msgid "git pack-objects --stdout [<options>] [< <ref-list> | < <object-list>]"
+msgstr "git pack-objects --stdout [<opcions>] [< <ref-list> | < <object-list>]"
msgid ""
-"git pack-objects [<options>...] <base-name> [< <ref-list> | < <object-list>]"
+"git pack-objects [<options>] <base-name> [< <ref-list> | < <object-list>]"
msgstr ""
-"git pack-objects [<opcions>...] <nom-base> [< <llista-de-referències> | < "
-"<llista-de-objectes>]"
+"git pack-objects [<opcions>] <base-name> [< <ref-list> | < <object-list>]"
#, c-format
msgid ""
@@ -8964,6 +9200,10 @@ msgid "inconsistency with delta count"
msgstr "inconsistència amb el comptador de diferències"
#, c-format
+msgid "invalid pack.allowPackReuse value: '%s'"
+msgstr "valor pack.allowPackReuse value no vàlid: «%s»"
+
+#, c-format
msgid ""
"value of uploadpack.blobpackfileuri must be of the form '<object-hash> <pack-"
"hash> <uri>' (got '%s')"
@@ -8986,21 +9226,18 @@ msgstr "no s'ha pogut obtenir el tipus de l'objecte %s al paquet %s"
msgid "could not find pack '%s'"
msgstr "no s'ha pogut trobar el paquet «%s»"
-#, fuzzy, c-format
+#, c-format
msgid "packfile %s cannot be accessed"
-msgstr "el fitxer de paquet %s no es pot mapar%s"
+msgstr "no es pot accedir al fitxer de paquet %s"
-#, fuzzy
msgid "Enumerating cruft objects"
-msgstr "S'estan enumerant els objectes"
+msgstr "S'estan enumerant els objectes superflus"
-#, fuzzy
msgid "unable to add cruft objects"
-msgstr "no s'han pogut afegir els objectes recents"
+msgstr "no s'han pogut afegir els objectes superflus"
-#, fuzzy
msgid "Traversing cruft objects"
-msgstr "S'estan comprimint els objectes"
+msgstr "S'estan recorrent els objectes superflus"
#, c-format
msgid ""
@@ -9018,9 +9255,8 @@ msgstr ""
"s'esperava un identificador d'objecte, s'ha rebut brossa:\n"
" %s"
-#, fuzzy
msgid "could not load cruft pack .mtimes"
-msgstr "no s'ha pogut carregar el paquet"
+msgstr "no s'ha pogut carregar superflus del paquet superflu"
msgid "cannot open pack index"
msgstr "no s'ha pogut obrir l'índex del paquet"
@@ -9051,6 +9287,12 @@ msgstr "versió d'índex no compatible %s"
msgid "bad index version '%s'"
msgstr "versió d'índex incorrecta «%s»"
+msgid "show progress meter during object writing phase"
+msgstr "mostra l'indicador de progrés durant la fase d'escriptura d'objectes"
+
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "similar a --all-progress quan l'indicador de progrés es mostra"
+
msgid "<version>[,<offset>]"
msgstr "<versió>[,<desplaçament>]"
@@ -9090,16 +9332,16 @@ msgid "use OFS_DELTA objects"
msgstr "usa objectes OFS_DELTA"
msgid "use threads when searching for best delta matches"
-msgstr "usa fils en cercar les millores coincidències de diferències"
+msgstr "usa fils en cercar les millors coincidències de diferències"
msgid "do not create an empty pack output"
-msgstr "no creïs una emissió de paquet buida"
+msgstr "no creïs una emissió de paquet buit"
msgid "read revision arguments from standard input"
msgstr "llegeix els arguments de revisió des de l'entrada estàndard"
msgid "limit the objects to those that are not yet packed"
-msgstr "limita els objectes als quals encara no s'hagin empaquetat"
+msgstr "limita els objectes a aquells que encara no estan empaquetats"
msgid "include objects reachable from any reference"
msgstr "inclou els objectes abastables de qualsevol referència"
@@ -9131,13 +9373,11 @@ msgstr "empaqueta els objectes inabastables solts"
msgid "unpack unreachable objects newer than <time>"
msgstr "desempaqueta els objectes inabastables més nous que <data>"
-#, fuzzy
msgid "create a cruft pack"
-msgstr "crea paquets prims"
+msgstr "crea un paquet superflu"
-#, fuzzy
msgid "expire cruft objects older than <time>"
-msgstr "fes caducar els objectes més antics que <data>"
+msgstr "fes caducar els objectes superflus més antics que <data>"
msgid "use the sparse reachability algorithm"
msgstr "utilitza l'algorisme d'accessibilitat dispers"
@@ -9175,7 +9415,7 @@ msgid "handling for missing objects"
msgstr "gestió dels objectes absents"
msgid "do not pack objects in promisor packfiles"
-msgstr "empaquetis els objectes als fitxers de paquet «promisor»"
+msgstr "no empaquetis els objectes als fitxers de paquet «promisor»"
msgid "respect islands during delta compression"
msgstr "respecta les illes durant la compressió delta"
@@ -9210,26 +9450,17 @@ msgstr "el límit mínim de mida del paquet és 1 MiB"
msgid "--thin cannot be used to build an indexable pack"
msgstr "--thin no es pot utilitzar per a construir un paquet indexable"
-msgid "cannot use --filter without --stdout"
-msgstr "no es pot utilitzar --filter sense --stdout"
-
msgid "cannot use --filter with --stdin-packs"
msgstr "no es pot utilitzar --filter sense --stdin-packs"
msgid "cannot use internal rev list with --stdin-packs"
msgstr "no es pot utilitzar la llista de revisió interna amb --stdin-packs"
-#, fuzzy
msgid "cannot use internal rev list with --cruft"
-msgstr "no es pot utilitzar la llista de revisió interna amb --stdin-packs"
+msgstr "no es pot utilitzar la llista de revisió interna amb --cruft"
-#, fuzzy
msgid "cannot use --stdin-packs with --cruft"
-msgstr "no es pot usar -a amb -d"
-
-#, fuzzy
-msgid "cannot use --max-pack-size with --cruft"
-msgstr "no es pot usar -a amb -d"
+msgstr "no es pot --stdin-packs amb --cruft"
msgid "Enumerating objects"
msgstr "S'estan enumerant els objectes"
@@ -9237,10 +9468,10 @@ msgstr "S'estan enumerant els objectes"
#, c-format
msgid ""
"Total %<PRIu32> (delta %<PRIu32>), reused %<PRIu32> (delta %<PRIu32>), pack-"
-"reused %<PRIu32>"
+"reused %<PRIu32> (from %<PRIuMAX>)"
msgstr ""
"Total %<PRIu32> (%<PRIu32> diferències), reusats %<PRIu32> (%<PRIu32> "
-"diferències), paquets reusats %<PRIu32>"
+"diferències), paquets reusats %<PRIu32> (de %<PRIuMAX>)"
msgid ""
"'git pack-redundant' is nominated for removal.\n"
@@ -9255,8 +9486,14 @@ msgstr ""
"i feu-nos saber que encara l'useu enviant un correu electrònic\n"
"a <git@vger.kernel.org>. Gràcies.\n"
-msgid "git pack-refs [<options>]"
-msgstr "git pack-refs [<opcions>]"
+msgid "refusing to run without --i-still-use-this"
+msgstr "es rebutja a executar sense --i-still-use-this"
+
+msgid ""
+"git pack-refs [--all] [--no-prune] [--include <pattern>] [--exclude "
+"<pattern>]"
+msgstr ""
+"git pack-refs [--all] [--no-prune] [--include <patró>] [--exclude <patró>]"
msgid "pack everything"
msgstr "empaqueta-ho tot"
@@ -9264,6 +9501,24 @@ msgstr "empaqueta-ho tot"
msgid "prune loose refs (default)"
msgstr "poda les referències soltes (per defecte)"
+msgid "references to include"
+msgstr "referències a incloure"
+
+msgid "references to exclude"
+msgstr "referències a excloure"
+
+msgid "git patch-id [--stable | --unstable | --verbatim]"
+msgstr "git patch-id [--stable | --unstable | --verbatim]"
+
+msgid "use the unstable patch-id algorithm"
+msgstr "utilitza l'algorisme inestable de patch-id"
+
+msgid "use the stable patch-id algorithm"
+msgstr "utilitza l'algorisme estable de patch-id"
+
+msgid "don't strip whitespace from the patch"
+msgstr "no eliminis els espais en blanc del pedaç"
+
msgid "git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"
msgstr "git prune [-n] [-v] [--progress] [--expire <data>] [--] [<head>...]"
@@ -9310,6 +9565,12 @@ msgstr "força la sobreescriptura de la branca local"
msgid "number of submodules pulled in parallel"
msgstr "nombre de submòduls baixats en paral·lel"
+msgid "use IPv4 addresses only"
+msgstr "usa només adreces IPv4"
+
+msgid "use IPv6 addresses only"
+msgstr "usa només adreces IPv6"
+
msgid ""
"There is no candidate for rebasing against among the refs that you just "
"fetched."
@@ -9408,7 +9669,7 @@ msgstr ""
"preferència per defecte per a tots els repositoris. Podeu també usar --"
"rebase,\n"
"--no-rebase o --ff-only en la línia d'ordres per a sobreescriure el valor\n"
-"per defecte configuració en aquesta execució.\n"
+"per defecte de la configuració en aquesta execució.\n"
msgid "Updating an unborn branch with changes added to the index."
msgstr ""
@@ -9417,8 +9678,8 @@ msgstr ""
msgid "pull with rebase"
msgstr "baixar fent «rebase»"
-msgid "please commit or stash them."
-msgstr "cometeu-los o emmagatzemeu-los."
+msgid "Please commit or stash them."
+msgstr "Cometeu-los o emmagatzemeu-los."
#, c-format
msgid ""
@@ -9448,7 +9709,7 @@ msgstr ""
"per a recuperar."
msgid "Cannot merge multiple branches into empty head."
-msgstr "No es poden fusionar múltiples branques a un HEAD buit."
+msgstr "No es poden fusionar múltiples branques a una HEAD buida."
msgid "Cannot rebase onto multiple branches."
msgstr "No es pot fer «rebase» sobre múltiples branques."
@@ -9473,24 +9734,26 @@ msgstr "abreviatura d'etiqueta sense <tag>"
msgid "--delete only accepts plain target ref names"
msgstr "--delete només accepta noms de referència de destí senzills"
-#, fuzzy
msgid ""
"\n"
"To choose either option permanently, see push.default in 'git help config'.\n"
msgstr ""
"\n"
-"Per a triar qualsevol opció permanentment, vegeu push.default a «git help "
-"config»."
+"Per a triar qualsevol de les opcions permanentment, vegeu push.default a "
+"«git help config».\n"
msgid ""
"\n"
-"To avoid automatically configuring upstream branches when their name\n"
-"doesn't match the local branch, see option 'simple' of branch."
-"autoSetupMerge\n"
+"To avoid automatically configuring an upstream branch when its name\n"
+"won't match the local branch, see option 'simple' of branch.autoSetupMerge\n"
"in 'git help config'.\n"
msgstr ""
+"\n"
+"Per a evitar configurar automàticament les branques font quan el seu nom\n"
+"no coincideix amb el de la branca local, vegeu l'opció «simple» de\n"
+"«branch.autoSetupMerge» a «git help config».\n"
-#, fuzzy, c-format
+#, c-format
msgid ""
"The upstream branch of your current branch does not match\n"
"the name of your current branch. To push to the upstream branch\n"
@@ -9512,7 +9775,7 @@ msgstr ""
"Per a pujar a la branca del mateix nom en el remot, useu\n"
"\n"
" git push %s HEAD\n"
-"%s"
+"%s%s"
#, c-format
msgid ""
@@ -9533,8 +9796,12 @@ msgid ""
"To have this happen automatically for branches without a tracking\n"
"upstream, see 'push.autoSetupRemote' in 'git help config'.\n"
msgstr ""
+"\n"
+"Per fer que això succeeixi automàticament per a les branques sense "
+"seguiment\n"
+"font, vegeu «push.autoSetupRemote» a «git help config».\n"
-#, fuzzy, c-format
+#, c-format
msgid ""
"The current branch %s has no upstream branch.\n"
"To push the current branch and set the remote as upstream, use\n"
@@ -9546,6 +9813,7 @@ msgstr ""
"Per a pujar la branca actual i establir el remot com a font, useu\n"
"\n"
" git push --set-upstream %s %s\n"
+"%s"
#, c-format
msgid "The current branch %s has multiple upstream branches, refusing to push."
@@ -9570,43 +9838,39 @@ msgstr ""
msgid ""
"Updates were rejected because the tip of your current branch is behind\n"
-"its remote counterpart. Integrate the remote changes (e.g.\n"
-"'git pull ...') before pushing again.\n"
+"its remote counterpart. If you want to integrate the remote changes,\n"
+"use 'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"S'han rebutjat les actualitzacions perquè el punt de la vostra branca\n"
-"actual està darrere de la seva branca remota corresponent. Integreu\n"
-"els canvis remots (per exemple, «git pull ...») abans de pujar de nou.\n"
-"Vegeu la «Nota sobre avanços ràpids» a «git push --help» per a més "
-"informació."
+"S'han rebutjat les actualitzacions perquè la punta de la branca actual\n"
+"està darrere de la seva contrapart remota. Si voleu integrar els canvis,\n"
+"remots useu «git pull» abans de tornar a pujar.\n"
+"Vegeu «Note about fast-forwards» a «git push --help» per a més detalls."
msgid ""
"Updates were rejected because a pushed branch tip is behind its remote\n"
-"counterpart. Check out this branch and integrate the remote changes\n"
-"(e.g. 'git pull ...') before pushing again.\n"
+"counterpart. If you want to integrate the remote changes, use 'git pull'\n"
+"before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"S'han rebutjat les actualitzacions perquè un punt de branca pujada\n"
-"està darrere de la seva branca remota corresponent. Agafeu aquesta\n"
-"branca i integreu els canvis remots (per exemple, «git pull ...»)\n"
-"abans de pujar de nou.\n"
-"Vegeu la «Nota sobre avanços ràpids» a «git push --help» per a més "
-"informació."
+"Les actualitzacions s'han rebutjat perquè la branca pujada està darrere\n"
+"de la seva contrapart remota. Si voleu integrar els canvis remots,\n"
+"utilitzeu «git pull» abans de tornar a pujar.\n"
+"Vegeu «Note about fast-forwards» a «git push --help» per a més detalls."
msgid ""
-"Updates were rejected because the remote contains work that you do\n"
-"not have locally. This is usually caused by another repository pushing\n"
-"to the same ref. You may want to first integrate the remote changes\n"
-"(e.g., 'git pull ...') before pushing again.\n"
+"Updates were rejected because the remote contains work that you do not\n"
+"have locally. This is usually caused by another repository pushing to\n"
+"the same ref. If you want to integrate the remote changes, use\n"
+"'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"S'han rebutjat les actualitzacions perquè el remot conté canvis\n"
-"que no teniu localment. Això acostuma a ser causat per un altre repositori\n"
-"que ha pujat a la mateixa referència. Pot ser que primer vulgueu\n"
-"integrar els canvis remots (per exemple, «git pull ...») abans de\n"
-"pujar de nou.\n"
-"Vegeu la «Nota sobre avanços ràpids» a «git push --help» per a més "
-"informació."
+"Les actualitzacions s'han rebutjat perquè el remot conté canvis que no "
+"teniu\n"
+"localment. Això sol ser causat per un altre repositori que a pujat a\n"
+"la mateixa referència. Si voleu integrar els canvis remots, utilitzeu\n"
+"«git pull» abans de tornar a pujar.\n"
+"Vegeu «Note about fast-forwards» a «git push --help» per a més detalls."
msgid "Updates were rejected because the tag already exists in the remote."
msgstr ""
@@ -9623,15 +9887,15 @@ msgstr ""
"«--force».\n"
msgid ""
-"Updates were rejected because the tip of the remote-tracking\n"
-"branch has been updated since the last checkout. You may want\n"
-"to integrate those changes locally (e.g., 'git pull ...')\n"
-"before forcing an update.\n"
+"Updates were rejected because the tip of the remote-tracking branch has\n"
+"been updated since the last checkout. If you want to integrate the\n"
+"remote changes, use 'git pull' before pushing again.\n"
+"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"S'han rebutjat les actualitzacions perquè el punt actual de la vostra\n"
-"branca està darrere de la seva branca remota corresponent. Integreu\n"
-"els canvis localment (per exemple, «git pull ...») abans de forçar\n"
-"una pujada.\n"
+"Les actualitzacions s'han rebutjat perquè la branca de seguiment remot\n"
+"s'ha actualitzat des de l'última baixada. Si voleu integrar els\n"
+"canvis remots, utilitzeu «git pull» abans de tornar a pujar.\n"
+"Vegeu «Note about fast-forwards» a «git push --help» per a més detalls."
#, c-format
msgid "Pushing to %s\n"
@@ -9641,6 +9905,13 @@ msgstr "S'està pujant a %s\n"
msgid "failed to push some refs to '%s'"
msgstr "s'ha produït un error en pujar algunes referències a «%s»"
+msgid ""
+"recursing into submodule with push.recurseSubmodules=only; using on-demand "
+"instead"
+msgstr ""
+"cerca recursivament en el submòdul amb push.recurseSubmodules=only; "
+"utilitzant «on-demand» en el seu lloc"
+
#, c-format
msgid "invalid value for '%s'"
msgstr "valor no vàlid per a «%s»"
@@ -9648,7 +9919,7 @@ msgstr "valor no vàlid per a «%s»"
msgid "repository"
msgstr "repositori"
-msgid "push all refs"
+msgid "push all branches"
msgstr "puja totes les referències"
msgid "mirror all refs"
@@ -9657,8 +9928,8 @@ msgstr "reflecteix totes les referències"
msgid "delete refs"
msgstr "suprimeix les referències"
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "puja les etiquetes (no es pot usar amb --all o --mirror)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr "puja les etiquetes (no es pot usar amb --all, --branches o --mirror)"
msgid "force updates"
msgstr "força les actualitzacions"
@@ -9761,23 +10032,30 @@ msgid "only emit output related to the second range"
msgstr "emet només la sortida relacionada amb el segon interval"
#, c-format
+msgid "not a revision: '%s'"
+msgstr "«%s» no és una revisió"
+
+#, c-format
msgid "not a commit range: '%s'"
msgstr "no és un rang de comissions: «%s»"
-msgid "single arg format must be symmetric range"
-msgstr "el format de l'argument únic ha de ser de rang simètric"
+#, c-format
+msgid "not a symmetric range: '%s'"
+msgstr "no és un rang simètric: «%s»"
msgid "need two commit ranges"
msgstr "calen dos rangs de comissió"
msgid ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>) "
-"[-u | -i]] [--no-sparse-checkout] [--index-output=<file>] (--empty | <tree-"
-"ish1> [<tree-ish2> [<tree-ish3>]])"
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<prefix>)\n"
+" [-u | -i]] [--index-output=<file>] [--no-sparse-checkout]\n"
+" (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"
msgstr ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>) "
-"[-u | -i]] [--no-sparse-checkout] [--index-output=<file>] (--empty | <tree-"
-"ish1> [<tree-ish2> [<tree-ish3>]])"
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<prefix>)\n"
+" [-u | -i]] [--index-output=<fitxer>] [--no-sparse-checkout]\n"
+" (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"
msgid "write resulting index to <file>"
msgstr "escriu l'índex resultant al <fitxer>"
@@ -9804,7 +10082,7 @@ msgid "<subdirectory>/"
msgstr "<subdirectori>/"
msgid "read the tree into the index under <subdirectory>/"
-msgstr "llegiu l'arbre a l'índex sota <subdirectori>/"
+msgstr "llegeix l'arbre a l'índex sota <subdirectori>/"
msgid "update working tree with merge result"
msgstr "actualitza l'arbre de treball amb el resultat de fusió"
@@ -9837,13 +10115,14 @@ msgid ""
"git rebase [-i] [options] [--exec <cmd>] [--onto <newbase> | --keep-base] "
"[<upstream> [<branch>]]"
msgstr ""
-"git rebase [-i] [options] [--exec <cmd>] [--onto <newbase> | --keep-base] "
-"[<upstream> [<branch>]]"
+"git rebase [-i] [options] [--exec <ordre>] [--onto <newbase> | --keep-base] "
+"[<upstream> [<branca>]]"
msgid ""
"git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]"
msgstr ""
-"git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]"
+"git rebase [-i] [options] [--exec <ordre>] [--onto <newbase>] --root "
+"[<branca>]"
#, c-format
msgid "could not read '%s'."
@@ -9867,8 +10146,8 @@ msgid "%s requires the merge backend"
msgstr "%s requereix un rerefons de fusió"
#, c-format
-msgid "could not get 'onto': '%s'"
-msgstr "no s'ha pogut obtenir «onto»: «%s»"
+msgid "invalid onto: '%s'"
+msgstr "no vàlid a: «%s»"
#, c-format
msgid "invalid orig-head: '%s'"
@@ -9916,9 +10195,16 @@ msgstr ""
"Com a resultat, git no pot fer un «rebase» d'elles."
#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "Mode de fusió de rebase desconegut: %s"
+
+#, c-format
msgid "could not switch to %s"
msgstr "no s'ha pogut commutar a %s"
+msgid "apply options and merge options cannot be used together"
+msgstr "les opcions apply i merge no es poden usar juntes"
+
#, c-format
msgid ""
"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and "
@@ -9926,6 +10212,15 @@ msgid ""
msgstr ""
"tipus buit no reconegut «%s»; els valors vàlids són «drop», «keep» i «ask»."
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"--rebase-merges amb un argument de cadena buit està obsolet i deixarà de "
+"funcionar en una versió futura del Git. Utilitzeu --rebase-merges sense un "
+"argument, que fa el mateix."
+
#, c-format
msgid ""
"%s\n"
@@ -9983,7 +10278,7 @@ msgid "add a Signed-off-by trailer to each commit"
msgstr "afegeix un «trailer» tipus «Signed-off-by» a cada comissió"
msgid "make committer date match author date"
-msgstr "fes que la data del «comitter» coincideixi amb la data de l'autor"
+msgstr "fes que la data del «committer» coincideixi amb la data de l'autor"
msgid "ignore author date and use current date"
msgstr "ignora la data de l'autor i utilitza la data actual"
@@ -10027,9 +10322,8 @@ msgstr "utilitza estratègies de fusió per a fer «rebase»"
msgid "let the user edit the list of commits to rebase"
msgstr "permet a l'usuari editar la llista de comissions a fer «rebase»"
-#, fuzzy
msgid "(REMOVED) was: try to recreate merges instead of ignoring them"
-msgstr "(EN DESÚS) intenta recrear fusions en lloc d'ignorar-les"
+msgstr "(SUPRIMIT) era: intenta recrear fusions en lloc d'ignorar-les"
msgid "how to handle commits that become empty"
msgstr "com gestionar les comissions que queden buides"
@@ -10040,6 +10334,11 @@ msgstr "manté les comissions que comencen en blanc"
msgid "move commits that begin with squash!/fixup! under -i"
msgstr "mou les comissions que comencen amb squash!/fixup! sota -i"
+msgid "update branches that point to commits that are being rebased"
+msgstr ""
+"actualitza les branques que apunten a comissions a les quals se'ls està fent "
+"«rebase»"
+
msgid "add exec lines after each commit of the editable list"
msgstr "afegeix línies d'exec després de cada comissió de la llista editable"
@@ -10078,12 +10377,18 @@ msgid ""
"Use `git rebase --abort` to terminate current rebase.\n"
"Or downgrade to v2.33, or earlier, to complete the rebase."
msgstr ""
+"«rebase --preserve-merges» (-p) ja no és admès.\n"
+"Utilitzeu «git rebase --abort» per a finalitzar el «rebase» actual.\n"
+"O bé baixeu a la versió v2.33, o anterior, per a completar el «rebase»."
msgid ""
"--preserve-merges was replaced by --rebase-merges\n"
"Note: Your `pull.rebase` configuration may also be set to 'preserve',\n"
"which is no longer supported; use 'merges' instead"
msgstr ""
+"--preserve-merges s'ha substituït per --rebase-merges\n"
+"Nota: la configuració «pull.rebase» també podria estar establerta a\n"
+"+-«preserve», que ja no s'admet; utilitzeu «merge» en el seu lloc"
msgid "No rebase in progress?"
msgstr "No hi ha un «rebase» en curs?"
@@ -10119,7 +10424,7 @@ msgid ""
"and run me again. I am stopping in case you still have something\n"
"valuable there.\n"
msgstr ""
-"Sembla que ja exigeix un directori %s, i em pregunto\n"
+"Sembla que ja existeix un directori %s, i em pregunto\n"
"si esteu enmig d'un altre «rebase». Si aquest és el cas, proveu\n"
"\t%s\n"
"Si no és cas, feu:\n"
@@ -10130,15 +10435,19 @@ msgstr ""
msgid "switch `C' expects a numerical value"
msgstr "«switch» «c» espera un valor numèric"
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "Mode desconegut: %s"
-
-msgid "--strategy requires --merge or --interactive"
-msgstr "--strategy requereix --merge o --interactive"
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges. Consider adding --"
+"no-rebase-merges"
+msgstr ""
+"les opcions «apply» són incompatibles amb rebase.rebaseMerges. Considereu "
+"afegir-hi --no-rebase-merges"
-msgid "apply options and merge options cannot be used together"
-msgstr "les opcions apply i merge no es poden usar juntes"
+msgid ""
+"apply options are incompatible with rebase.updateRefs. Consider adding --no-"
+"update-refs"
+msgstr ""
+"les opcions «apply» són incompatibles amb rebase.updateRefs. Considereu "
+"afegir-hi --no-update-refs"
#, c-format
msgid "Unknown rebase backend: %s"
@@ -10162,8 +10471,8 @@ msgstr "no existeix aquesta branca o comissió «%s»"
msgid "No such ref: %s"
msgstr "No hi ha tal referència: %s"
-msgid "Could not resolve HEAD to a revision"
-msgstr "No s'ha pogut resoldre HEAD a una revisió"
+msgid "Could not resolve HEAD to a commit"
+msgstr "No s'ha pogut resoldre HEAD com a una comissió"
#, c-format
msgid "'%s': need exactly one merge base with branch"
@@ -10177,9 +10486,6 @@ msgstr "«%s»: necessita exactament una base de fusió"
msgid "Does not point to a valid commit '%s'"
msgstr "No apunta a una comissió vàlida «%s»"
-msgid "Please commit or stash them."
-msgstr "Cometeu-los o emmagatzemeu-los."
-
msgid "HEAD is up to date."
msgstr "HEAD està al dia."
@@ -10195,7 +10501,7 @@ msgid "Current branch %s is up to date, rebase forced.\n"
msgstr "La branca actual %s està al dia; «rebase» forçat.\n"
msgid "The pre-rebase hook refused to rebase."
-msgstr "El lligam pre-«rebase» ha refusat a fer «rebase»."
+msgstr "El lligam pre-rebase ha refusat a fer «rebase»."
#, c-format
msgid "Changes to %s:\n"
@@ -10302,13 +10608,12 @@ msgstr ""
msgid "git reflog exists <ref>"
msgstr "git reflog exists <referència>"
-#, fuzzy, c-format
+#, c-format
msgid "invalid timestamp '%s' given to '--%s'"
-msgstr "el codi de temps «%s» no és vàlid donat a «--%s»"
+msgstr "marca de temps «%s» donada a «--%s» no és vàlida"
-#, fuzzy
msgid "do not actually prune any entries"
-msgstr "no practiquis cap entrada"
+msgstr "no eliminis cap entrada"
msgid ""
"rewrite the old SHA1 with the new SHA1 of the entry that now precedes it"
@@ -10317,34 +10622,28 @@ msgstr "reescriu l'antic SHA1 amb el nou SHA1 de l'entrada que ara precedeix"
msgid "update the reference to the value of the top reflog entry"
msgstr "actualitza la referència al valor de l'entrada de reflog superior"
-#, fuzzy
msgid "print extra information on screen"
msgstr "imprimeix informació extra a la pantalla"
msgid "timestamp"
msgstr "marca de temps"
-#, fuzzy
msgid "prune entries older than the specified time"
msgstr "poda les entrades més antigues que el temps especificat"
-#, fuzzy
msgid ""
"prune entries older than <time> that are not reachable from the current tip "
"of the branch"
msgstr ""
-"poda les entrades més antigues de <time> que no es poden accedir des de la "
+"poda les entrades més antigues de <data> que no es poden accedir des de la "
"punta actual de la branca"
-#, fuzzy
msgid "prune any reflog entries that point to broken commits"
msgstr "poda qualsevol entrada de reflog que apunti a comissions trencades"
-#, fuzzy
msgid "process the reflogs of all references"
msgstr "processa els reflogs de totes les referències"
-#, fuzzy
msgid "limits processing to reflogs from the current worktree only"
msgstr "limita el processament a reflogs només de l'arbre de treball actual"
@@ -10367,7 +10666,7 @@ msgid ""
"git remote add [-t <branch>] [-m <master>] [-f] [--tags | --no-tags] [--"
"mirror=<fetch|push>] <name> <url>"
msgstr ""
-"git remote add [-t <branca>] [-m <mestra>] [-f] [--tags | --no-tags] [--"
+"git remote add [-t <branca>] [-m <master>] [-f] [--tags | --no-tags] [--"
"mirror=<fetch|push>] <nom> <url>"
msgid "git remote rename [--[no-]progress] <old> <new>"
@@ -10446,11 +10745,12 @@ msgstr "argument de «mirror» desconegut: %s"
msgid "fetch the remote branches"
msgstr "obtén les branques remotes"
-msgid "import all tags and associated objects when fetching"
-msgstr "en obtenir, importa totes les etiquetes i tots els objectes"
-
-msgid "or do not fetch any tag at all (--no-tags)"
-msgstr "o no obtinguis cap etiqueta (--no-tags)"
+msgid ""
+"import all tags and associated objects when fetching\n"
+"or do not fetch any tag at all (--no-tags)"
+msgstr ""
+"importa totes les etiquetes i objectes associats en obtenir\n"
+"o no obtingueu cap etiqueta (--no-tags)"
msgid "branch(es) to track"
msgstr "branques a seguir"
@@ -10532,9 +10832,8 @@ msgstr ""
"\t%s\n"
"\tActualitzeu la configuració manualment si és necessari."
-#, fuzzy
msgid "Renaming remote references"
-msgstr "Canviant el nom de les referències remotes"
+msgstr "S'està canviant el nom de les referències remotes"
#, c-format
msgid "deleting '%s' failed"
@@ -10569,6 +10868,9 @@ msgstr " nou (la pròxima obtenció emmagatzemarà a remotes/%s)"
msgid " tracked"
msgstr " seguit"
+msgid " skipped"
+msgstr " omès"
+
msgid " stale (use 'git remote prune' to remove)"
msgstr " estancat (useu «git remote prune» per a eliminar)"
@@ -10795,7 +11097,6 @@ msgstr "sigues detallat; s'ha de col·locar abans d'una subordre"
msgid "git repack [<options>]"
msgstr "git repack [<opcions>]"
-#, fuzzy
msgid ""
"Incremental repacks are incompatible with bitmap indexes. Use\n"
"--no-write-bitmap-index or disable the pack.writeBitmaps configuration."
@@ -10803,7 +11104,7 @@ msgstr ""
"Els reempaquetaments incrementals són incompatibles amb els índexs de mapes "
"de bits. Useu\n"
"--no-write-bitmap-index o inhabiliteu el paràmetre de configuració pack."
-"writebitmaps."
+"writeBitmaps."
msgid "could not start pack-objects to repack promisor objects"
msgstr ""
@@ -10841,22 +11142,30 @@ msgid "could not close refs snapshot tempfile"
msgstr ""
"no s'ha pogut tancar el fitxer temporal amb la instantània de referències"
+#, c-format
+msgid "could not remove stale bitmap: %s"
+msgstr "no s'ha pogut eliminar el mapa de bits estancat: %s"
+
+#, c-format
+msgid "pack prefix %s does not begin with objdir %s"
+msgstr "el prefix de paquet %s no comença amb objdir %s"
+
msgid "pack everything in a single pack"
msgstr "empaqueta-ho tot en un únic paquet"
msgid "same as -a, and turn unreachable objects loose"
msgstr "el mateix que -a, i solta els objectes inabastables"
-#, fuzzy
msgid "same as -a, pack unreachable cruft objects separately"
-msgstr "el mateix que -a, i solta els objectes inabastables"
+msgstr ""
+"el mateix que -a, empaqueta els objectes superflus inabastables de forma "
+"separada"
msgid "approxidate"
msgstr "data aproximada"
-#, fuzzy
-msgid "with -C, expire objects older than this"
-msgstr "fes caducar els objectes més antics que <data>"
+msgid "with --cruft, expire objects older than this"
+msgstr "amb --cruft, vencen els objectes més antics que aquest"
msgid "remove redundant packs, and run git-prune-packed"
msgstr "elimina els paquets redundants, i executeu git-prune-packed"
@@ -10917,19 +11226,33 @@ msgstr "troba una progressió geomètrica amb el factor <N>"
msgid "write a multi-pack index of the resulting packs"
msgstr "escriu un índex multipaquet dels paquets resultants"
+msgid "pack prefix to store a pack containing pruned objects"
+msgstr ""
+"prefix del paquet per a emmagatzemar un paquet que contingui objectes podats"
+
+msgid "pack prefix to store a pack containing filtered out objects"
+msgstr ""
+"prefix del paquet per a emmagatzemar un paquet que contingui objectes "
+"filtrats"
+
msgid "cannot delete packs in a precious-objects repo"
msgstr "no es poden suprimir paquets en un repositori d'objectes preciosos"
+#, c-format
+msgid "option '%s' can only be used along with '%s'"
+msgstr "l'opció «%s» només es pot utilitzar juntament amb «%s»"
+
msgid "Nothing new to pack."
msgstr "Res nou a empaquetar."
-#, fuzzy, c-format
-msgid "pack prefix %s does not begin with objdir %s"
-msgstr "el nom del fitxer de paquet «%s» no acaba amb «.%s»"
+#, c-format
+msgid "renaming pack to '%s' failed"
+msgstr "el canvi del nom a «%s» ha fallat"
#, c-format
-msgid "missing required file: %s"
-msgstr "falta el fitxer requerit: %s"
+msgid "pack-objects did not write a '%s' file for pack %s-%s"
+msgstr ""
+"els objectes de paquet no han escrit a un fitxer «%s» per al paquet %s-%s"
#, c-format
msgid "could not unlink: %s"
@@ -10942,7 +11265,7 @@ msgid "git replace [-f] --edit <object>"
msgstr "git replace [-f] --edit <objecte>"
msgid "git replace [-f] --graft <commit> [<parent>...]"
-msgstr "git replace [-f] --graft <comissió> [<parent>...]"
+msgstr "git replace [-f] --graft <comissió> [<pare>...]"
msgid "git replace -d <object>..."
msgstr "git replace -d <objecte>..."
@@ -11123,8 +11446,81 @@ msgstr "--convert-graft-file arguments"
msgid "only one pattern can be given with -l"
msgstr "només es pot especificar un patró amb -l"
-msgid "git rerere [clear | forget <path>... | status | remaining | diff | gc]"
-msgstr "git rerere [clear | forget <camí>... | status | remaining | diff | gc]"
+msgid "need some commits to replay"
+msgstr "calen algunes comissions per tornar a reproduir"
+
+msgid "--onto and --advance are incompatible"
+msgstr "--onto i --advance són incompatibles"
+
+msgid "all positive revisions given must be references"
+msgstr "totes les revisions positives que s'han donat han de ser referències"
+
+msgid "argument to --advance must be a reference"
+msgstr "l'argument per a --advance ha de ser una referència"
+
+msgid ""
+"cannot advance target with multiple sources because ordering would be ill-"
+"defined"
+msgstr ""
+"no es pot avançar l'objectiu amb múltiples fonts perquè l'ordenació no "
+"estaria definida correctament"
+
+msgid ""
+"cannot implicitly determine whether this is an --advance or --onto operation"
+msgstr ""
+"no es pot determinar implícitament si aquesta és una operació --advance o --"
+"onto"
+
+msgid ""
+"cannot advance target with multiple source branches because ordering would "
+"be ill-defined"
+msgstr ""
+"no es pot avançar l'objectiu amb múltiples branques d'origen perquè "
+"l'ordenació no estaria definida correctament"
+
+msgid "cannot implicitly determine correct base for --onto"
+msgstr "no es pot determinar implícitament la base correcta per a --onto"
+
+msgid ""
+"(EXPERIMENTAL!) git replay ([--contained] --onto <newbase> | --advance "
+"<branch>) <revision-range>..."
+msgstr ""
+"(EXPERIMENTAL!) git replay ([--contained] --onto <newbase> | --advance "
+"<branch>) <revision-range>..."
+
+msgid "make replay advance given branch"
+msgstr "fes avançar la repetició de la branca donada"
+
+msgid "replay onto given commit"
+msgstr "torna a reproduir a la comissió donada"
+
+msgid "advance all branches contained in revision-range"
+msgstr "avança totes les branques contingudes a l'interval de revisions"
+
+msgid "option --onto or --advance is mandatory"
+msgstr "l'opció --onto o --advance és obligatòria"
+
+#, c-format
+msgid ""
+"some rev walking options will be overridden as '%s' bit in 'struct rev_info' "
+"will be forced"
+msgstr ""
+"algunes opcions de referència se sobreescriuran de forma forçada com a «%s» "
+"bits a «struct rev_info»"
+
+msgid "error preparing revisions"
+msgstr "s'ha produït un error en preparar les revisions"
+
+msgid "replaying down to root commit is not supported yet!"
+msgstr "encara no s'admet la reproducció cap avall en una comissió arrel"
+
+msgid "replaying merge commits is not supported yet!"
+msgstr "encara no s'admet la repetició de les comissió de fusió"
+
+msgid ""
+"git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]"
+msgstr ""
+"git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]"
msgid "register clean resolutions in index"
msgstr "registra les resolucions netes en l'índex"
@@ -11168,7 +11564,7 @@ msgid "keep"
msgstr "reteniment"
msgid "You do not have a valid HEAD."
-msgstr "No teniu un HEAD vàlid."
+msgstr "No teniu una HEAD vàlida."
msgid "Failed to find tree of HEAD."
msgstr "S'ha produït un error en trobar l'arbre de HEAD."
@@ -11230,14 +11626,14 @@ msgstr "el restabliment de %s no es permet en un repositori nu"
msgid "Unstaged changes after reset:"
msgstr "Canvis «unstaged» després del restabliment:"
-#, fuzzy, c-format
+#, c-format
msgid ""
"It took %.2f seconds to refresh the index after reset. You can use\n"
"'--no-refresh' to avoid this."
msgstr ""
-"Es van trigar un temps de,2f segons a actualitzar l'índex després de "
-"reiniciar. Pots utilitzar\n"
-".--no-refresh' per evitar això."
+"Es van trigar %.2f segons a actualitzar l'índex després de reiniciar. Podeu "
+"usar\n"
+".--no-refresh' per a evitar això."
#, c-format
msgid "Could not reset index file to revision '%s'."
@@ -11250,6 +11646,10 @@ msgstr "No s'ha pogut escriure el fitxer d'índex nou."
msgid "unable to get disk usage of %s"
msgstr "no s'ha pogut obtenir l'ús del disc de %s"
+#, c-format
+msgid "invalid value for '%s': '%s', the only allowed format is '%s'"
+msgstr "valor no vàlid per a «%s»: «%s», l'únic format permès és «%s»"
+
msgid "rev-list does not support display of notes"
msgstr "el rev-list no permet mostrar notes"
@@ -11275,6 +11675,9 @@ msgstr "final prematur de l'entrada"
msgid "no usage string given before the `--' separator"
msgstr "no s'ha indicat cap cadena d'ús abans del separador «--»"
+msgid "missing opt-spec before option flags"
+msgstr "manca l'opció opt-spec abans de les altres opcions"
+
msgid "Needed a single revision"
msgstr "Cal una sola revisió"
@@ -11285,9 +11688,9 @@ msgid ""
"\n"
"Run \"git rev-parse --parseopt -h\" for more information on the first usage."
msgstr ""
-"git rev-parse --parseopt [<options>] -- [<args>...]\n"
+"git rev-parse --parseopt [<opcions>] -- [<args>...]\n"
" o bé: git rev-parse --sq-quote [<arg>...]\n"
-" o bé: git rev-parse [<options>] [<arg>...]\n"
+" o bé: git rev-parse [<opcions>] [<arg>...]\n"
"\n"
"Executeu «git rev-parse --parseopt -h» per a més informació sobre el primer "
"ús."
@@ -11325,21 +11728,32 @@ msgstr "mode desconegut per a --abbrev-ref: %s"
msgid "this operation must be run in a work tree"
msgstr "aquesta operació s'ha d'executar en un arbre de treball"
+msgid "Could not read the index"
+msgstr "No s'ha pogut llegir l'índex"
+
#, c-format
msgid "unknown mode for --show-object-format: %s"
msgstr "mode desconegut per a --show-object-format: %s"
-msgid "git revert [<options>] <commit-ish>..."
-msgstr "git revert [<opcions>] <comissió>..."
+msgid ""
+"git revert [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] "
+"<commit>..."
+msgstr ""
+"git revert [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] "
+"<comissió>..."
-msgid "git revert <subcommand>"
-msgstr "git revert <subordre>"
+msgid "git revert (--continue | --skip | --abort | --quit)"
+msgstr "git revert (--continue | --skip | --abort | --quit)"
-msgid "git cherry-pick [<options>] <commit-ish>..."
-msgstr "git cherry-pick [<opcions>] <comissió>..."
+msgid ""
+"git cherry-pick [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff]\n"
+" [-S[<keyid>]] <commit>..."
+msgstr ""
+"git cherry-pick [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff]\n"
+" [-S[<keyid>]] <comissió>..."
-msgid "git cherry-pick <subcommand>"
-msgstr "git cherry-pick <subordre>"
+msgid "git cherry-pick (--continue | --skip | --abort | --quit)"
+msgstr "git cherry-pick (--continue | --skip | --abort | --quit)"
#, c-format
msgid "option `%s' expects a number greater than zero"
@@ -11392,7 +11806,7 @@ msgid "keep redundant, empty commits"
msgstr "retén les comissions redundants i buides"
msgid "use the 'reference' format to refer to commits"
-msgstr ""
+msgstr "useu el format «referència» per a referir-vos a les comissions"
msgid "revert failed"
msgstr "la reversió ha fallat"
@@ -11400,8 +11814,14 @@ msgstr "la reversió ha fallat"
msgid "cherry-pick failed"
msgstr "el «cherry pick» ha fallat"
-msgid "git rm [<options>] [--] <file>..."
-msgstr "git rm [<opcions>] [--] <fitxer>..."
+msgid ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<fitxer> [--pathspec-file-nul]]\n"
+" [--] [<pathspec>...]"
msgid ""
"the following file has staged content different from both the\n"
@@ -11475,16 +11895,21 @@ msgid ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
" [<host>:]<directory> (--all | <ref>...)"
msgstr ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
" [<host>:]<directory> (--all | <ref>...)"
msgid "remote name"
msgstr "nom del remot"
+msgid "push all refs"
+msgstr "puja totes les referències"
+
msgid "use stateless RPC protocol"
msgstr "usa el protocol RPC sense estat"
@@ -11503,15 +11928,16 @@ msgstr "git log --pretty=short | git shortlog [<opcions>]"
msgid "using multiple --group options with stdin is not supported"
msgstr "no s'admet l'ús de múltiples opcions --group amb stdin"
-msgid "using --group=trailer with stdin is not supported"
-msgstr "no s'admet l'ús de --group=trailer amb stdin"
+#, c-format
+msgid "using %s with stdin is not supported"
+msgstr "no s'admet l'ús de %s amb stdin"
#, c-format
msgid "unknown group type: %s"
msgstr "tipus de grup desconegut: %s"
msgid "group by committer rather than author"
-msgstr "agrupa per «comitter» en comptes de per autor"
+msgstr "agrupa per «committer» en comptes de per autor"
msgid "sort output according to the number of commits per author"
msgstr "ordena la sortida segons el nombre de comissions per autor"
@@ -11543,12 +11969,14 @@ msgid ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
" [--current] [--color[=<when>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<rev> | <glob>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<rev> | <glob>)...]"
msgstr ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
" [--current] [--color[=<when>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<rev> | <glob>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<rev> | <glob>)...]"
msgid "git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]"
msgstr "git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<referència>]"
@@ -11648,21 +12076,44 @@ msgid "Unknown hash algorithm"
msgstr "Algorisme de resum desconegut"
msgid ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...]"
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<pattern>...]"
msgstr ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<patró>...]"
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<pattern>...]"
+
+msgid ""
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<ref>...]"
+msgstr ""
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<ref>...]"
msgid "git show-ref --exclude-existing[=<pattern>]"
msgstr "git show-ref --exclude-existing[=<patró>]"
+msgid "git show-ref --exists <ref>"
+msgstr "git show-ref --exists <ref>"
+
+msgid "reference does not exist"
+msgstr "la referència no existeix"
+
+msgid "failed to look up reference"
+msgstr "s'ha produït en cercar la referència"
+
msgid "only show tags (can be combined with heads)"
msgstr "mostra només les etiquetes (es pot combinar amb heads)"
msgid "only show heads (can be combined with tags)"
msgstr "mostra només els caps (es pot combinar amb tags)"
+msgid "check for reference existence without resolving"
+msgstr "comprova l'existència de referència sense resoldre"
+
msgid "stricter reference checking, requires exact ref path"
msgstr ""
"comprovació de referència més estricta, requereix el camí de referència "
@@ -11675,7 +12126,7 @@ msgid "dereference tags into object IDs"
msgstr "desreferencia les etiquetes a ID d'objecte"
msgid "only show SHA1 hash using <n> digits"
-msgstr "mostra el hash SHA1 usant només <n> xifres"
+msgstr "mostra el resum SHA1 usant només <n> xifres"
msgid "do not print results to stdout (useful with --verify)"
msgstr "no imprimeixis els resultats a stdout (útil amb --verify)"
@@ -11683,8 +12134,12 @@ msgstr "no imprimeixis els resultats a stdout (útil amb --verify)"
msgid "show refs from stdin that aren't in local repository"
msgstr "mostra les referències de stdin que no siguin en el repositori local"
-msgid "git sparse-checkout (init|list|set|add|reapply|disable) <options>"
-msgstr "git sparse-checkout (init|list|set|add|reapply|disable) <opcions>"
+msgid ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
+msgstr ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<opcions>]"
msgid "this worktree is not sparse"
msgstr "aquest arbre de treball no és dispers"
@@ -11709,9 +12164,8 @@ msgstr "s'ha produït un error en suprimir el directori «%s»"
msgid "failed to create directory for sparse-checkout file"
msgstr "no s'ha pogut crear el directori per al fitxer sparse-checkout"
-#, fuzzy
msgid "failed to initialize worktree config"
-msgstr "no s'ha pogut inicialitzar l'arbre de treball to"
+msgstr "no s'ha pogut inicialitzar la configuració de l'arbre de treball"
msgid "failed to modify sparse-index config"
msgstr "no s'ha pogut modificar la configuració de l'índex dispers"
@@ -11736,7 +12190,7 @@ msgstr "no s'ha pogut normalitzar el camí %s"
#, c-format
msgid "unable to unquote C-style string '%s'"
-msgstr "no s'ha pogut treure la cita a la cadena amb estil C «%s»"
+msgstr "no s'han pogut treure les cometes a la cadena amb estil C «%s»"
msgid "unable to load existing sparse-checkout patterns"
msgstr "no s'han pogut carregar els patrons de «sparse-checkout» existents"
@@ -11744,51 +12198,45 @@ msgstr "no s'han pogut carregar els patrons de «sparse-checkout» existents"
msgid "existing sparse-checkout patterns do not use cone mode"
msgstr "els patrons de «sparse-checkout» existents no usen el mode con"
-#, fuzzy
msgid "please run from the toplevel directory in non-cone mode"
-msgstr ""
-"executeu des del directori de nivell superior en mode que no sigui compatible"
+msgstr "executeu des del directori de nivell superior en mode que no sigui con"
-#, fuzzy
msgid "specify directories rather than patterns (no leading slash)"
msgstr "especifica els directoris en lloc dels patrons (sense barra inclinada)"
-#, fuzzy
msgid ""
"specify directories rather than patterns. If your directory starts with a "
"'!', pass --skip-checks"
msgstr ""
"especifica els directoris en lloc dels patrons. Si el vostre directori "
-"comença amb un '!', passeu --skip-checks"
+"comença amb un «!», passeu --skip-checks"
-#, fuzzy
msgid ""
"specify directories rather than patterns. If your directory really has any "
"of '*?[]\\' in it, pass --skip-checks"
msgstr ""
"especifica els directoris en lloc dels patrons. Si el vostre directori "
-"realment té alguna de '*?\\\\', passeu --skip-checks"
+"realment té alguna de «*?[]\\», useu --skip-checks"
-#, fuzzy, c-format
+#, c-format
msgid ""
"'%s' is not a directory; to treat it as a directory anyway, rerun with --"
"skip-checks"
msgstr ""
-"%%s' no és un directori; per tractar-lo com un directori de totes maneres, "
-"torneu a executar amb --skip-checks"
+"«%s» no és un directori; per a tractar-lo com un directori, torneu a "
+"executar amb --skip-checks"
-#, fuzzy, c-format
+#, c-format
msgid ""
"pass a leading slash before paths such as '%s' if you want a single file "
"(see NON-CONE PROBLEMS in the git-sparse-checkout manual)."
msgstr ""
"passa una barra d'inici abans dels camins com ara «%s» si voleu un sol "
-"fitxer (vegeu els problemes NO CONE al manual de git-sparse-checkout)."
+"fitxer (vegeu «NON-CONE PROBLEMS» al manual de git-sparse-checkout)."
msgid "git sparse-checkout add [--skip-checks] (--stdin | <patterns>)"
msgstr "git sparse-checkout add [--skip-checks] (--stdin | <patterns>)"
-#, fuzzy
msgid ""
"skip some sanity checks on the given paths that might give false positives"
msgstr ""
@@ -11815,67 +12263,76 @@ msgstr ""
msgid "error while refreshing working directory"
msgstr "s'ha produït un error en actualitzar el directori de treball"
-msgid "git stash list [<options>]"
-msgstr "git stash list [<opcions>]"
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <fitxer>]"
-msgid "git stash show [<options>] [<stash>]"
-msgstr "git stash show [<opcions>] [<stash>]"
+msgid "terminate input and output files by a NUL character"
+msgstr "acaba els fitxers d'entrada i de sortida amb un caràcter NUL"
-msgid "git stash drop [-q|--quiet] [<stash>]"
-msgstr "git stash drop [-q|--quiet] [<stash>]"
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
+"quan s'utilitza amb --rules-file, interpreta els patrons com a patrons del "
+"mode con"
-msgid "git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"
+msgid "use patterns in <file> instead of the current ones."
+msgstr "utilitza patrons en <file> en lloc dels actuals."
-msgid "git stash branch <branchname> [<stash>]"
-msgstr "git stash branch <nom-de-branca> [<stash>]"
+msgid "git stash list [<log-options>]"
+msgstr "git stash list [<log-options>]"
msgid ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
-" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
-" [--] [<pathspec>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<diff-"
+"options>] [<stash>]"
msgstr ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <missatge>]\n"
-" [--pathspec-from-file=<fitxer> [--pathspec-file-nul]]\n"
-" [--] [<pathspec>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<diff-"
+"options>] [<stash>]"
-msgid ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
-msgstr ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<missatge>]"
+msgid "git stash drop [-q | --quiet] [<stash>]"
+msgstr "git stash drop [-q | --quiet] [<stash>]"
+
+msgid "git stash pop [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash pop [--index] [-q | --quiet] [<stash>]"
-msgid "git stash pop [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash pop [--index] [-q|--quiet] [<stash>]"
+msgid "git stash apply [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash apply [--index] [-q | --quiet] [<stash>]"
-msgid "git stash apply [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash apply [--index] [-q|--quiet] [<stash>]"
+msgid "git stash branch <branchname> [<stash>]"
+msgstr "git stash branch <nom-de-branca> [<stash>]"
-msgid "git stash store [-m|--message <message>] [-q|--quiet] <commit>"
-msgstr "git stash store [-m|--message <missatge>] [-q|--quiet] <commit>"
+msgid "git stash store [(-m | --message) <message>] [-q | --quiet] <commit>"
+msgstr ""
+"git stash store [(-m | --message) <missatge>] [-q | --quiet] <comissió>"
msgid ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<message>]\n"
+" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
" [--] [<pathspec>...]]"
msgstr ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <missatge>]\n"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<missatge>]\n"
+" [--pathspec-from-file=<fitxer> [--pathspec-file-nul]]\n"
" [--] [<pathspec>...]]"
msgid ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<message>]"
msgstr ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<missatge>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<missatge>]"
+
+msgid "git stash create [<message>]"
+msgstr "git stash create [<missatge>]"
#, c-format
msgid "'%s' is not a stash-like commit"
@@ -12050,6 +12507,10 @@ msgid "Expecting a full ref name, got %s"
msgstr "S'espera un nom de referència ple, s'ha rebut %s"
#, c-format
+msgid "could not get a repository handle for submodule '%s'"
+msgstr "no s'ha pogut obtenir el gestor del repositori pel submòdul «%s»"
+
+#, c-format
msgid ""
"could not look up configuration '%s'. Assuming this repository is its own "
"authoritative upstream."
@@ -12057,12 +12518,6 @@ msgstr ""
"no s'ha pogut trobar la configuració «%s». S'assumeix que aquest repositori "
"és el seu repositori font autoritzat."
-msgid "alternative anchor for relative paths"
-msgstr "àncora alternativa per als camins relatius"
-
-msgid "git submodule--helper list [--prefix=<path>] [<path>...]"
-msgstr "git submodule--helper list [--prefix=<camí>] [<camí>...]"
-
#, c-format
msgid "No url found for submodule path '%s' in .gitmodules"
msgstr "No s'ha trobat cap url per al camí de submòdul «%s» a .gitmodules"
@@ -12093,10 +12548,10 @@ msgid "suppress output of entering each submodule command"
msgstr "omet la sortida en entrar a cada ordre del submòdul"
msgid "recurse into nested submodules"
-msgstr "inclou recursivament els submòduls imbricats"
+msgstr "cerca recursivament als submòduls imbricats"
-msgid "git submodule--helper foreach [--quiet] [--recursive] [--] <command>"
-msgstr "git submodule--helper foreach [--quiet] [--recursive] [--] <ordre>"
+msgid "git submodule foreach [--quiet] [--recursive] [--] <command>"
+msgstr "git submodule foreach [--quiet] [--recursive] [--] <ordre>"
#, c-format
msgid "Failed to register url for submodule path '%s'"
@@ -12121,8 +12576,8 @@ msgstr ""
msgid "suppress output for initializing a submodule"
msgstr "omet la sortida en inicialitzar un submòdul"
-msgid "git submodule--helper init [<options>] [<path>]"
-msgstr "git submodule--helper init [<opcions>] [<camí>]"
+msgid "git submodule init [<options>] [<path>]"
+msgstr "git submodule init [<opcions>] [<camí>]"
#, c-format
msgid "no submodule mapping found in .gitmodules for path '%s'"
@@ -12149,9 +12604,6 @@ msgstr ""
msgid "git submodule status [--quiet] [--cached] [--recursive] [<path>...]"
msgstr "git submodule status [--quiet] [--cached] [--recursive] [<camí>...]"
-msgid "git submodule--helper name <path>"
-msgstr "git submodule--helper name <camí>"
-
#, c-format
msgid "* %s %s(blob)->%s(submodule)"
msgstr "* %s %s(blob)->%s(submòdul)"
@@ -12188,8 +12640,8 @@ msgstr "omet els submòduls amb el valor «ignore_config» establert a «all»"
msgid "limit the summary size"
msgstr "limita la mida del resum"
-msgid "git submodule--helper summary [<options>] [<commit>] [--] [<path>]"
-msgstr "git submodule--helper summary [<options>] [<commit>] [--] [<path>]"
+msgid "git submodule summary [<options>] [<commit>] [--] [<path>]"
+msgstr "git submodule summary [<opcions>] [<comissió>] [--] [<camí>]"
msgid "could not fetch a revision for HEAD"
msgstr "no s'ha pogut obtenir una revisió per a HEAD"
@@ -12203,19 +12655,14 @@ msgid "failed to register url for submodule path '%s'"
msgstr "s'ha produït un error en registrar l'url per al camí del submòdul «%s»"
#, c-format
-msgid "failed to get the default remote for submodule '%s'"
-msgstr ""
-"s'ha produït un error en obtenir el remot per defecte pel submòdul «%s»"
-
-#, c-format
msgid "failed to update remote for submodule '%s'"
msgstr "s'ha produït un error en actualitzar el remot pel submòdul «%s»"
msgid "suppress output of synchronizing submodule url"
msgstr "omet la sortida de la sincronització de l'URL del submòdul"
-msgid "git submodule--helper sync [--quiet] [--recursive] [<path>]"
-msgstr "git submodule--helper sync [--quiet] [--recursive] [<camí>]"
+msgid "git submodule sync [--quiet] [--recursive] [<path>]"
+msgstr "git submodule sync [--quiet] [--recursive] [<camí>]"
#, c-format
msgid ""
@@ -12278,6 +12725,10 @@ msgstr ""
"«--reference-if-able' en comptes de «--reference»."
#, c-format
+msgid "could not get a repository handle for gitdir '%s'"
+msgstr "no s'ha pogut obtenir el gestor del repositori per al gitdir «%s»"
+
+#, c-format
msgid "submodule '%s' cannot add alternate: %s"
msgstr "el submòdul «%s» no pot afegir un alternatiu: %s"
@@ -12305,6 +12756,9 @@ msgstr "directori no buit: «%s»"
msgid "could not get submodule directory for '%s'"
msgstr "no s'ha pogut obtenir el directori de submòdul per a «%s»"
+msgid "alternative anchor for relative paths"
+msgstr "àncora alternativa per als camins relatius"
+
msgid "where the new submodule will be cloned to"
msgstr "a on es clonarà el submòdul nou"
@@ -12323,19 +12777,14 @@ msgstr "força el progrés del clonatge"
msgid "disallow cloning into non-empty directory"
msgstr "no permetis clonar en un directori no buit"
-#, fuzzy
msgid ""
"git submodule--helper clone [--prefix=<path>] [--quiet] [--reference "
"<repository>] [--name <name>] [--depth <depth>] [--single-branch] [--filter "
"<filter-spec>] --url <url> --path <path>"
msgstr ""
-"git submodule--helper clone [--prefix=<path>] [--quiet] [--reference "
+"git submodule--helper clone [--prefix=<camí>] [--quiet] [--reference "
"<repository>] [--name <name>] [--depth <depth>] [--single-branch] [--filter "
-"<filter-spec>]--url <url> --path <path>"
-
-#, c-format
-msgid "Invalid update mode '%s' for submodule path '%s'"
-msgstr "Mode d'actualització «%s» no vàlid per al camí de submòdul «%s»"
+"<filter-spec>] --url <url> --path <camí>"
#, c-format
msgid "Invalid update mode '%s' configured for submodule path '%s'"
@@ -12358,6 +12807,10 @@ msgid "Skipping submodule '%s'"
msgstr "S'està ometent el submòdul «%s»"
#, c-format
+msgid "cannot clone submodule '%s' without a URL"
+msgstr "no es pot clonar el submòdul «%s» sense un URL"
+
+#, c-format
msgid "Failed to clone '%s'. Retry scheduled"
msgstr "S'ha produït un error en clonar «%s». S'ha programat un reintent"
@@ -12412,6 +12865,10 @@ msgstr ""
"directa d'aquesta comissió ha fallat."
#, c-format
+msgid "could not initialize submodule at path '%s'"
+msgstr "no s'ha pogut inicialitzar el submòdul al camí «%s»"
+
+#, c-format
msgid ""
"Submodule (%s) branch configured to inherit branch from superproject, but "
"the superproject is not on any branch"
@@ -12420,25 +12877,21 @@ msgstr ""
"superprojecte, però el superprojecte no és en cap branca"
#, c-format
-msgid "could not get a repository handle for submodule '%s'"
-msgstr "no s'ha pogut obtenir el gestor del repositori pel submòdul «%s»"
-
-#, fuzzy, c-format
msgid "Unable to find current revision in submodule path '%s'"
msgstr "No s'ha pogut trobar la revisió actual al camí del submòdul «%s»"
-#, fuzzy, c-format
+#, c-format
msgid "Unable to fetch in submodule path '%s'"
-msgstr "No s'ha pogut recuperar el camí del submòdul «%s»"
+msgstr "No s'ha pogut obtenir el camí del submòdul «%s»"
-#, fuzzy, c-format
+#, c-format
msgid "Unable to find %s revision in submodule path '%s'"
-msgstr ""
-"No s'ha pogut trobar la revisió de percentatges en el camí del submòdul «%s»"
+msgstr "No s'ha pogut trobar la revisió %s en el camí del submòdul «%s»"
-#, fuzzy, c-format
+#, c-format
msgid "Failed to recurse into submodule path '%s'"
-msgstr "No s'ha pogut tornar a repetir al camí del submòdul «%s»"
+msgstr ""
+"s'ha produït un error en cercar recursivament al camí del submòdul «%s»"
msgid "force checkout updates"
msgstr "força les actualitzacions"
@@ -12446,25 +12899,23 @@ msgstr "força les actualitzacions"
msgid "initialize uninitialized submodules before update"
msgstr "inicialitza els submòduls sense inicialitzar abans d'actualitzar"
-#, fuzzy
msgid "use SHA-1 of submodule's remote tracking branch"
-msgstr "utilitza SHA-1 de la branca de seguiment remota del submòdul"
+msgstr "usa el SHA-1 de la branca de seguiment remota del submòdul"
-#, fuzzy
msgid "traverse submodules recursively"
-msgstr "traverteix els submòduls recursivament"
+msgstr "recorre els submòduls recursivament"
msgid "don't fetch new objects from the remote site"
msgstr "no obtinguis els objectes nous del lloc remot"
-msgid "path into the working tree"
-msgstr "camí a l'arbre de treball"
+msgid "use the 'checkout' update strategy (default)"
+msgstr "utilitza l'estratègia d'actualització «checkout» (predeterminada)"
-msgid "path into the working tree, across nested submodule boundaries"
-msgstr "camí a l'arbre de treball, a través de fronteres de submòduls niats"
+msgid "use the 'merge' update strategy"
+msgstr "utilitza l'estratègia d'actualització de «merge»"
-msgid "rebase, merge, checkout or none"
-msgstr "rebase, merge, checkout o none"
+msgid "use the 'rebase' update strategy"
+msgstr "utilitza l'estratègia d'actualització de «rebase»"
msgid "create a shallow clone truncated to the specified number of revisions"
msgstr "crea un clon superficial truncat al nombre de revisions especificat"
@@ -12478,6 +12929,9 @@ msgstr "si el clonatge inicial ha de seguir la recomanació de superficialitat"
msgid "don't print cloning progress"
msgstr "no imprimeixis el progrés del clonatge"
+msgid "disallow cloning into non-empty directory, implies --init"
+msgstr "no permetis clonar en un directori no buit, implica --init"
+
msgid ""
"git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] "
"[-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-"
@@ -12487,37 +12941,19 @@ msgstr ""
"git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] "
"[-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-"
"shallow] [--reference <repository>] [--recursive] [--[no-]single-branch] "
-"[--] [<path>...]"
-
-msgid "bad value for update parameter"
-msgstr "valor incorrecte per al paràmetre update"
-
-msgid "recurse into submodules"
-msgstr "inclou recursivament als submòduls"
-
-msgid "git submodule--helper absorb-git-dirs [<options>] [<path>...]"
-msgstr "git submodule--helper absorb-git-dirs [<opcions>] [<camí>...]"
+"[--] [<camí>...]"
-msgid "check if it is safe to write to the .gitmodules file"
-msgstr "comprova si és segur escriure al fitxer .gitmodules"
-
-msgid "unset the config in the .gitmodules file"
-msgstr "desconfigura l'opció de configuració al fitxer .gitmodules"
-
-msgid "git submodule--helper config <name> [<value>]"
-msgstr "git submodule--helper config <nom> [<valor>]"
+msgid "Failed to resolve HEAD as a valid ref."
+msgstr "S'ha produït un error en resoldre HEAD com a referència vàlida."
-msgid "git submodule--helper config --unset <name>"
-msgstr "git submodule--helper config --unset <nom>"
-
-msgid "please make sure that the .gitmodules file is in the working tree"
-msgstr "assegureu-vos que el fitxer .gitmodules és a l'arbre de treball"
+msgid "git submodule absorbgitdirs [<options>] [<path>...]"
+msgstr "git submodule absorbgitdirs [<opcions>] [<camí>...]"
msgid "suppress output for setting url of a submodule"
msgstr "omet la sortida en configurar un URL d'un submòdul"
-msgid "git submodule--helper set-url [--quiet] <path> <newurl>"
-msgstr "git submodule--helper set-url [--quiet] <path> <newurl>"
+msgid "git submodule set-url [--quiet] <path> <newurl>"
+msgstr "git submodule set-url [--quiet] <camí> <newurl>"
msgid "set the default tracking branch to master"
msgstr "estableix la branca de seguiment per defecte a «master»"
@@ -12525,13 +12961,11 @@ msgstr "estableix la branca de seguiment per defecte a «master»"
msgid "set the default tracking branch"
msgstr "estableix la branca de seguiment per defecte"
-msgid "git submodule--helper set-branch [-q|--quiet] (-d|--default) <path>"
-msgstr "git submodule--helper set-branch [-q|--quiet] (-d|--default) <path>"
+msgid "git submodule set-branch [-q|--quiet] (-d|--default) <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-d|--default) <camí>"
-msgid ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
-msgstr ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
+msgid "git submodule set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-b|--branch) <branca> <camí>"
msgid "--branch or --default required"
msgstr "cal --branch o --default"
@@ -12542,17 +12976,15 @@ msgstr "mostra només els missatges d'error"
msgid "force creation"
msgstr "força la creació"
-#, fuzzy
msgid "show whether the branch would be created"
msgstr "mostra si es crearà la branca"
-#, fuzzy
msgid ""
"git submodule--helper create-branch [-f|--force] [--create-reflog] [-q|--"
"quiet] [-t|--track] [-n|--dry-run] <name> <start-oid> <start-name>"
msgstr ""
"git submodule--helper create-branch [-f|--force] [--create-reflog] [-q|--"
-"quiet] [-t|--track] [-n|--dry-run] <name> <start_oid> <start_name>"
+"quiet] [-t|--track] [-n|--dry-run] <name> <start-oid> <start-name>"
#, c-format
msgid "creating branch '%s'"
@@ -12595,6 +13027,9 @@ msgstr "S'està reactivant el directori de git local per al submòdul «%s»\n"
msgid "unable to checkout submodule '%s'"
msgstr "no s'ha pogut agafar el submòdul «%s»"
+msgid "please make sure that the .gitmodules file is in the working tree"
+msgstr "assegureu-vos que el fitxer .gitmodules és a l'arbre de treball"
+
#, c-format
msgid "Failed to add submodule '%s'"
msgstr "S'ha produït un error en afegir el submòdul «%s»"
@@ -12624,7 +13059,6 @@ msgstr "permet afegir un camí de submòdul que si no s'hagués ignorat"
msgid "borrow the objects from reference repositories"
msgstr "manlleva els objectes dels repositoris de referències"
-#, fuzzy
msgid ""
"sets the submodule's name to the given string instead of defaulting to its "
"path"
@@ -12632,8 +13066,8 @@ msgstr ""
"estableix el nom del submòdul a la cadena donada en lloc de per defecte al "
"seu camí"
-msgid "git submodule--helper add [<options>] [--] <repository> [<path>]"
-msgstr "git submodule--helper add [<opcions>] [--] <repositori> [<camí>]"
+msgid "git submodule add [<options>] [--] <repository> [<path>]"
+msgstr "git submodule add [<opcions>] [--] <repository> [<camí>]"
msgid "Relative path can only be used from the toplevel of the working tree"
msgstr ""
@@ -12648,19 +13082,17 @@ msgstr "URL de repositori: «%s» ha de ser absolut o començar amb ./|../"
msgid "'%s' is not a valid submodule name"
msgstr "«%s» no és un nom de submòdul vàlid"
-#, c-format
-msgid "%s doesn't support --super-prefix"
-msgstr "%s no admet --super-prefix"
+msgid "git submodule--helper <command>"
+msgstr "git submodule--helper <command>"
-#, c-format
-msgid "'%s' is not a valid submodule--helper subcommand"
-msgstr "«%s» no és una subordre vàlida de submodule--helper"
+msgid "git symbolic-ref [-m <reason>] <name> <ref>"
+msgstr "git symbolic-ref [-m <reason>] <name> <ref>"
-msgid "git symbolic-ref [<options>] <name> [<ref>]"
-msgstr "git symbolic-ref [<opcions>] <nom> [<referència>]"
+msgid "git symbolic-ref [-q] [--short] [--no-recurse] <name>"
+msgstr "git symbolic-ref [-q] [--short] [--no-recurse] <name>"
-msgid "git symbolic-ref -d [-q] <name>"
-msgstr "git symbolic-ref -d [-q] <nom>"
+msgid "git symbolic-ref --delete [-q] <name>"
+msgstr "git symbolic-ref --delete [-q] <name>"
msgid "suppress error message for non-symbolic (detached) refs"
msgstr "omet el missatge d'error de referències no simbòliques (separades)"
@@ -12671,6 +13103,9 @@ msgstr "suprimeix la referència simbòlica"
msgid "shorten ref output"
msgstr "escurça la sortida de referències"
+msgid "recursively dereference (default)"
+msgstr "desreferencia recursivament (per defecte)"
+
msgid "reason"
msgstr "raó"
@@ -12678,25 +13113,25 @@ msgid "reason of the update"
msgstr "raó de l'actualització"
msgid ""
-"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]\n"
-" <tagname> [<head>]"
+"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
+" <tagname> [<commit> | <object>]"
msgstr ""
-"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <fitxer>]\n"
-" <tagname> [<head>]"
+"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <fitxer>] [-e]\n"
+" <tagname> [<comissió> | <objecte>]"
msgid "git tag -d <tagname>..."
msgstr "git tag -d <nom-d'etiqueta>..."
msgid ""
-"git tag -l [-n[<num>]] [--contains <commit>] [--no-contains <commit>] [--"
-"points-at <object>]\n"
-" [--format=<format>] [--merged <commit>] [--no-merged <commit>] "
-"[<pattern>...]"
+"git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]\n"
+" [--points-at <object>] [--column[=<options>] | --no-column]\n"
+" [--create-reflog] [--sort=<key>] [--format=<format>]\n"
+" [--merged <commit>] [--no-merged <commit>] [<pattern>...]"
msgstr ""
-"git tag -l [-n[<num>]] [--contains <commit>] [--no-contains <commit>] [--"
-"points-at <object>]\n"
-" [--format=<format>] [--merged <comissió>] [--no-merged <comissió>] "
-"[<patró>...]"
+"git tag [-n[<num>]] -l [--contains <comissió>] [--no-contains <comissió>]\n"
+" [--points-at <objecte>] [--column[=<opcions>] | --no-column]\n"
+" [--create-reflog] [--sort=<key>] [--format=<format>]\n"
+" [--merged <comissió>] [--no-merged <comissió>] [<patró>...]"
msgid "git tag -v [--format=<format>] <tagname>..."
msgstr "git tag -v [--format=<format>] <nom-d'etiqueta>..."
@@ -12841,6 +13276,16 @@ msgstr "Etiqueta «%s» actualitzada (era %s)\n"
msgid "pack exceeds maximum allowed size"
msgstr "el paquet supera la mida màxima permesa"
+msgid "failed to write object in stream"
+msgstr "no s'ha pogut escriure l'objecte al flux"
+
+#, c-format
+msgid "inflate returned (%d)"
+msgstr "inflate ha retornat (%d)"
+
+msgid "invalid blob object from stream"
+msgstr "l'objecte blob del flux no és vàlid"
+
msgid "Unpacking objects"
msgstr "S'estan desempaquetant els objectes"
@@ -12975,6 +13420,9 @@ msgstr "(per a porcellanes) oblida't dels conflictes no resolts ni desats"
msgid "write index in this format"
msgstr "escriu l'índex en aquest format"
+msgid "report on-disk index format version"
+msgstr "informa sobre la versió del format de l'índex del disc"
+
msgid "enable or disable split index"
msgstr "habilita o inhabilita l'índex dividit"
@@ -12999,6 +13447,14 @@ msgstr "marca els fitxers com a vàlids pel fsmonitor"
msgid "clear fsmonitor valid bit"
msgstr "esborra el bit de validesa del fsmonitor"
+#, c-format
+msgid "%d\n"
+msgstr "%d\n"
+
+#, c-format
+msgid "index-version: was %d, set to %d"
+msgstr "index-version: era %d, s'ha establert a %d"
+
msgid ""
"core.splitIndex is set to false; remove or change it, if you really want to "
"enable split index"
@@ -13076,8 +13532,12 @@ msgstr "llegeix les actualitzacions des de stdin"
msgid "update the info files from scratch"
msgstr "actualitza els fitxers d'informació des de zero"
-msgid "git upload-pack [<options>] <dir>"
-msgstr "git upload-pack [<opcions>] <directori>"
+msgid ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <directory>"
+msgstr ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <directory>"
msgid "quit after a single request/response exchange"
msgstr "surt després d'un sol intercanvi de sol·licitud/resposta"
@@ -13092,8 +13552,8 @@ msgstr ""
msgid "interrupt transfer after <n> seconds of inactivity"
msgstr "interromp la transferència després de <n> segons d'inactivitat"
-msgid "git verify-commit [-v | --verbose] <commit>..."
-msgstr "git verify-commit [-v | --verbose] <comissió>..."
+msgid "git verify-commit [-v | --verbose] [--raw] <commit>..."
+msgstr "git verify-commit [-v | --verbose] [--raw] <comissió>..."
msgid "print commit contents"
msgstr "imprimeix els continguts de la comissió"
@@ -13101,8 +13561,8 @@ msgstr "imprimeix els continguts de la comissió"
msgid "print raw gpg status output"
msgstr "imprimeix la sortida crua de l'estat gpg"
-msgid "git verify-pack [-v | --verbose] [-s | --stat-only] <pack>..."
-msgstr "git verify-pack [-v | --verbose] [-s | --stat-only] <paquet>..."
+msgid "git verify-pack [-v | --verbose] [-s | --stat-only] [--] <pack>.idx..."
+msgstr "git verify-pack [-v | --verbose] [-s | --stat-only] [--] <pack>.idx..."
msgid "verbose"
msgstr "detallat"
@@ -13110,35 +13570,70 @@ msgstr "detallat"
msgid "show statistics only"
msgstr "mostra només estadístiques"
-msgid "git verify-tag [-v | --verbose] [--format=<format>] <tag>..."
-msgstr "git verify-tag [-v | --verbose] [--format=<format>] <etiqueta>..."
+msgid "git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."
+msgstr "git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."
msgid "print tag contents"
msgstr "imprimeix els continguts de l'etiqueta"
-msgid "git worktree add [<options>] <path> [<commit-ish>]"
-msgstr "git worktree add [<opcions>] <camí> [<commit-ish>]"
+msgid ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <string>]]\n"
+" [--orphan] [(-b | -B) <new-branch>] <path> [<commit-ish>]"
+msgstr ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <cadena>]]\n"
+" [--orphan] [(-b | -B) <new-branch>] <camí> [<commit-ish>]"
-msgid "git worktree list [<options>]"
-msgstr "git worktree list [<opcions>]"
+msgid "git worktree list [-v | --porcelain [-z]]"
+msgstr "git worktree list [-v | --porcelain [-z]]"
-msgid "git worktree lock [<options>] <path>"
-msgstr "git worktree lock [<opcions>] <camí>"
+msgid "git worktree lock [--reason <string>] <worktree>"
+msgstr "git worktree lock [--reason <string>] <worktree>"
msgid "git worktree move <worktree> <new-path>"
msgstr "git worktree move <arbre de treball> <camí-nou>"
-msgid "git worktree prune [<options>]"
-msgstr "git worktree prune [<opcions>]"
+msgid "git worktree prune [-n] [-v] [--expire <expire>]"
+msgstr "git worktree prune [-n] [-v] [--expire <expire>]"
-msgid "git worktree remove [<options>] <worktree>"
-msgstr "git worktree remove [<opcions>] <arbre de treball>"
+msgid "git worktree remove [-f] <worktree>"
+msgstr "git worktree remove [-f] <worktree>"
msgid "git worktree repair [<path>...]"
-msgstr "git worktree repair [<path>...]"
+msgstr "git worktree repair [<camí>...]"
+
+msgid "git worktree unlock <worktree>"
+msgstr "git worktree unlock <worktree>"
+
+msgid "No possible source branch, inferring '--orphan'"
+msgstr "No hi ha cap branca d'origen possible, inferint «--orphan»"
-msgid "git worktree unlock <path>"
-msgstr "git worktree unlock <camí>"
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+msgstr ""
+"Si voleu crear un arbre de treball que contingui una branca no nascuda\n"
+"nova (branca sense comissions) per a aquest repositori, podeu fer-ho\n"
+"utilitzant l'argument --orphan:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan %s\n"
+msgstr ""
+"Si voleu crear un arbre de treball que contingui una branca no nascuda\n"
+"nova (branca sense comissions) per a aquest repositori, podeu fer-ho\n"
+"utilitzant l'argument --orphan:\n"
+"\n"
+" git worktree add --orphan %s\n"
#, c-format
msgid "Removing %s/%s: %s"
@@ -13198,6 +13693,10 @@ msgid "initializing"
msgstr "s'està inicialitzant"
#, c-format
+msgid "could not find created worktree '%s'"
+msgstr "no s'ha pogut trobar l'arbre de treball creat «%s»"
+
+#, c-format
msgid "Preparing worktree (new branch '%s')"
msgstr "S'està preparant l'arbre de treball (branca nova «%s»)"
@@ -13212,9 +13711,30 @@ msgid "Preparing worktree (checking out '%s')"
msgstr "S'està preparant l'arbre de treball (s'està agafant «%s»)"
#, c-format
+msgid "unreachable: invalid reference: %s"
+msgstr "no accessible: referència no vàlida: %s"
+
+#, c-format
msgid "Preparing worktree (detached HEAD %s)"
msgstr "S'està preparant l'arbre de treball (HEAD %s separat)"
+#, c-format
+msgid ""
+"HEAD points to an invalid (or orphaned) reference.\n"
+"HEAD path: '%s'\n"
+"HEAD contents: '%s'"
+msgstr ""
+"HEAD apunta a una referència no vàlida (o òrfena).\n"
+"Camí HEAD: «%s»\n"
+"Contingut HEAD: «%s»"
+
+msgid ""
+"No local or remote refs exist despite at least one remote\n"
+"present, stopping; use 'add -f' to override or fetch a remote first"
+msgstr ""
+"No hi ha referències locals o remotes malgrat hi existeix almenys un\n"
+"remot, aturada; useu «add -f» per a anul·lar o obtenir primer un remot"
+
msgid "checkout <branch> even if already checked out in other worktree"
msgstr "agafa <branca> encara que sigui agafada en altre arbre de treball"
@@ -13224,6 +13744,9 @@ msgstr "crea una branca nova"
msgid "create or reset a branch"
msgstr "crea o restableix una branca"
+msgid "create unborn branch"
+msgstr "crea una branca no nascuda"
+
msgid "populate the new working tree"
msgstr "emplena l'arbre de treball nou"
@@ -13245,6 +13768,10 @@ msgstr ""
msgid "options '%s', '%s', and '%s' cannot be used together"
msgstr "les opcions «%s», «%s», i «%s» no es poden usar juntes"
+#, c-format
+msgid "option '%s' and commit-ish cannot be used together"
+msgstr "opció «%s» i les de comissió no es poden usar juntes"
+
msgid "added with --lock"
msgstr "afegit amb --lock"
@@ -13353,7 +13880,7 @@ msgstr ""
#, c-format
msgid "validation failed, cannot remove working tree: %s"
-msgstr "la validació ha fallat, no es pot suprmir l'arbre de treball: %s"
+msgstr "la validació ha fallat, no es pot suprimir l'arbre de treball: %s"
#, c-format
msgid "repair: %s: %s"
@@ -13375,9 +13902,66 @@ msgstr "escriu l'objecte d'arbre per a un subdirectori <prefix>"
msgid "only useful for debugging"
msgstr "només útil per a la depuració"
+msgid "core.fsyncMethod = batch is unsupported on this platform"
+msgstr "core.fsyncMethod = batch no és compatible amb aquesta plataforma"
+
+#, c-format
+msgid "could not parse bundle list key %s with value '%s'"
+msgstr ""
+"no s'ha pogut analitzar la clau de llista de paquets %s amb el valor «%s»"
+
+#, c-format
+msgid "bundle list at '%s' has no mode"
+msgstr "la llista de farcells a «%s» no té mode"
+
+msgid "failed to create temporary file"
+msgstr "no s'ha pogut crear un fitxer temporal"
+
+msgid "insufficient capabilities"
+msgstr "capacitats insuficients"
+
+#, c-format
+msgid "file downloaded from '%s' is not a bundle"
+msgstr "el fitxer baixat de «%s» no és un paquet"
+
+msgid "failed to store maximum creation token"
+msgstr "no s'ha pogut emmagatzemar el testimoni de creació màxim"
+
+#, c-format
+msgid "unrecognized bundle mode from URI '%s'"
+msgstr "no s'ha reconegut el model del farcell de l'URI «%s»"
+
+#, c-format
+msgid "exceeded bundle URI recursion limit (%d)"
+msgstr "s'ha excedit el límit de recursió URI del paquet (%d)"
+
+#, c-format
+msgid "failed to download bundle from URI '%s'"
+msgstr "no s'ha pogut baixar el paquet de l'URI «%s»"
+
+#, c-format
+msgid "file at URI '%s' is not a bundle or bundle list"
+msgstr "el fitxer a l'URI «%s» no és farcell o una llista de farcells"
+
+#, c-format
+msgid "bundle-uri: unexpected argument: '%s'"
+msgstr "bundle-uri: argument inesperat: «%s»"
+
+msgid "bundle-uri: expected flush after arguments"
+msgstr "bundle-uri: s'esperava una neteja després dels arguments"
+
+msgid "bundle-uri: got an empty line"
+msgstr "bundle-uri: té una línia buida"
+
+msgid "bundle-uri: line is not of the form 'key=value'"
+msgstr "bundle-uri: la línia no és de la forma «key=value»"
+
+msgid "bundle-uri: line has empty key or value"
+msgstr "bundle-uri: la línia té una clau o un valor buit"
+
#, c-format
msgid "unrecognized bundle hash algorithm: %s"
-msgstr "algoritme de hash del farcell desconegut: %s"
+msgstr "algoritme de resum del farcell desconegut: %s"
#, c-format
msgid "unknown capability '%s'"
@@ -13397,6 +13981,13 @@ msgstr "Al repositori li manquen aquestes comissions prerequerides:"
msgid "need a repository to verify a bundle"
msgstr "cal un repositori per a verificar un farcell"
+msgid ""
+"some prerequisite commits exist in the object store, but are not connected "
+"to the repository's history"
+msgstr ""
+"hi ha algunes comissions requerides al magatzem d'objectes, però no estan "
+"connectades a l'historial del repositori"
+
#, c-format
msgid "The bundle contains this ref:"
msgid_plural "The bundle contains these %<PRIuMAX> refs:"
@@ -13412,6 +14003,14 @@ msgid_plural "The bundle requires these %<PRIuMAX> refs:"
msgstr[0] "El farcell requereix aquesta referència:"
msgstr[1] "El farcell requereix aquestes %<PRIuMAX> referències:"
+#, c-format
+msgid "The bundle uses this hash algorithm: %s"
+msgstr "El farcell utilitza aquest algoritme de resum: %s"
+
+#, c-format
+msgid "The bundle uses this filter: %s"
+msgstr "El farcell utilitza aquest filtre: %s"
+
msgid "unable to dup bundle descriptor"
msgstr "no s'ha pogut duplicar el descriptor del farcell"
@@ -13448,6 +14047,10 @@ msgstr ""
"l'identificador de fragment de finalització apareix abans del que s'esperava"
#, c-format
+msgid "chunk id %<PRIx32> not %d-byte aligned"
+msgstr "ID del fragment %<PRIx32> no alineat %d-byte"
+
+#, c-format
msgid "improper chunk offset(s) %<PRIx64> and %<PRIx64>"
msgstr "desplaçament incorrecte del fragment %<PRIx64> i %<PRIx64>"
@@ -13460,7 +14063,7 @@ msgid "final chunk has non-zero id %<PRIx32>"
msgstr "el fragment final té un id %<PRIx32> que no és zero"
msgid "invalid hash version"
-msgstr "especificació de hash no vàlida"
+msgstr "especificació de resum no vàlida"
#, c-format
msgid "invalid color value: %.*s"
@@ -13501,10 +14104,8 @@ msgstr "Recopila la informació per a l'usuari per a enviar un informe d'error"
msgid "Move objects and refs by archive"
msgstr "Mou els objectes i les referències per arxiu"
-msgid "Provide content or type and size information for repository objects"
-msgstr ""
-"Proveeix contingut o informació del tipus i mida per als objectes del "
-"repositori"
+msgid "Provide contents or details of repository objects"
+msgstr "Proporcioneu el contingut o els detalls dels objectes del repositori"
msgid "Display gitattributes information"
msgstr "Mostra la informació de .gitattributes"
@@ -13582,6 +14183,9 @@ msgid "Give an object a human readable name based on an available ref"
msgstr ""
"Dona un nom llegible per a humans basant-se en les referències disponibles"
+msgid "Generate a zip archive of diagnostic information"
+msgstr "Genera un arxiu zip d'informació de diagnòstic"
+
msgid "Show changes between commits, commit and working tree, etc"
msgstr ""
"Mostra els canvis entre comissions, la comissió i l'arbre de treball, etc"
@@ -13642,8 +14246,9 @@ msgstr "Imprimeix les línies coincidents amb un patró"
msgid "A portable graphical interface to Git"
msgstr "Una interfície gràfica portable per al Git"
-msgid "Compute object ID and optionally creates a blob from a file"
-msgstr "Calcula l'ID de l'objecte i opcionalment crea un blob des del fitxer"
+msgid "Compute object ID and optionally create an object from a file"
+msgstr ""
+"Calcula l'ID de l'objecte i opcionalment crea un objecte des del fitxer"
msgid "Display help information about Git"
msgstr "Mostra informació d'ajuda del Git"
@@ -13714,8 +14319,8 @@ msgstr "Executa una fusió per als fitxers que cal fusionar"
msgid "The standard helper program to use with git-merge-index"
msgstr "El programa d'ajuda estàndard a utilitzar amb git-merge-index"
-msgid "Show three-way merge without touching index"
-msgstr "Mostra la fusió de tres vies sense tocar l'índex"
+msgid "Perform merge without touching index or working tree"
+msgstr "Realitza la fusió sense tocar l'índex o l'arbre de treball"
msgid "Run merge conflict resolution tools to resolve merge conflicts"
msgstr ""
@@ -13728,7 +14333,7 @@ msgid "Build a tree-object from ls-tree formatted text"
msgstr "Construeix un objecte en arbre a partir de text formatat amb ls-tree"
msgid "Write and verify multi-pack-indexes"
-msgstr "Escriu i verifica els índexs dels paquets multipaquet"
+msgstr "Escriu i verifica els índexs multipaquet"
msgid "Move or rename a file, a directory, or a symlink"
msgstr "Mou o canvia de nom a un fitxer, directori o enllaç simbòlic"
@@ -13795,6 +14400,11 @@ msgstr "Empaqueta els objectes desempaquetats en un repositori"
msgid "Create, list, delete refs to replace objects"
msgstr "Crea, llista i esborra referències per a substituir objectes"
+msgid "EXPERIMENTAL: Replay commits on a new base, works with bare repos too"
+msgstr ""
+"EXPERIMENTAL: torna a reproduir comissions sobre una nova base, també "
+"funciona amb repositoris nus"
+
msgid "Generates a summary of pending changes"
msgstr "Genera un resum dels canvis pendents"
@@ -13916,8 +14526,11 @@ msgstr "Valida els fitxers d'arxius Git empaquetats"
msgid "Check the GPG signature of tags"
msgstr "Verifica la signatura GPG de les etiquetes"
-msgid "Show logs with difference each commit introduces"
-msgstr "Mostra registres amb la diferència introduïda per cada comissió"
+msgid "Display version information about Git"
+msgstr "Mostra informació de la versió del Git"
+
+msgid "Show logs with differences each commit introduces"
+msgstr "Mostra els registres amb les diferències que introdueix cada comissió"
msgid "Manage multiple working trees"
msgstr "Gestiona múltiples arbres de treball"
@@ -13949,6 +14562,24 @@ msgstr "Un conjunt mínim útil d'ordres diàries del Git"
msgid "Frequently asked questions about using Git"
msgstr "Preguntes freqüents sobre l'ús del Git"
+msgid "The bundle file format"
+msgstr "El format del fitxer de farcell"
+
+msgid "Chunk-based file formats"
+msgstr "Formats de fitxer basats en blocs"
+
+msgid "Git commit-graph format"
+msgstr "Format de graf de comissions del Git"
+
+msgid "Git index format"
+msgstr "Format de l'índex del Git"
+
+msgid "Git pack format"
+msgstr "format de paquet del Git"
+
+msgid "Git cryptographic signature formats"
+msgstr "Formats de signatura criptogràfica del Git"
+
msgid "A Git Glossary"
msgstr "Un glossari de Git"
@@ -13970,6 +14601,21 @@ msgstr "La definició de les propietats de submòduls"
msgid "Git namespaces"
msgstr "Espais de noms del Git"
+msgid "Protocol v0 and v1 capabilities"
+msgstr "Capacitats de protocol v0 i v1"
+
+msgid "Things common to various protocols"
+msgstr "Coses comunes en diversos protocols"
+
+msgid "Git HTTP-based protocols"
+msgstr "Protocols basats en HTTP del Git"
+
+msgid "How packs are transferred over-the-wire"
+msgstr "Com es transfereixen els paquets en la xarxa"
+
+msgid "Git Wire Protocol, Version 2"
+msgstr "Protocol Git Wire, versió 2"
+
msgid "Helper programs to interact with remote repositories"
msgstr "Programes d'ajuda per a interactuar amb repositoris remots"
@@ -13994,9 +14640,41 @@ msgstr "Interfície web del Git (interfície web pels repositoris Git)"
msgid "An overview of recommended workflows with Git"
msgstr "Una visió de conjunt de fluxos de treball recomanats amb Git"
+msgid "A tool for managing large Git repositories"
+msgstr "Una eina per a gestionar dipòsits Git grans"
+
msgid "commit-graph file is too small"
msgstr "el fitxer del graf de comissions és massa petit"
+msgid "commit-graph oid fanout chunk is wrong size"
+msgstr ""
+"el fragment de «fanout» de l'oid del graf de comissions és de mida incorrecta"
+
+msgid "commit-graph fanout values out of order"
+msgstr "valors de graf de comissions de «fanout» estan fora d'ordre"
+
+msgid "commit-graph OID lookup chunk is the wrong size"
+msgstr "el fragment de cerca OID és de mida incorrecta"
+
+msgid "commit-graph commit data chunk is wrong size"
+msgstr "el fragment de dades del graf de comissions és de mida incorrecta"
+
+msgid "commit-graph generations chunk is wrong size"
+msgstr ""
+"el fragment de les generacions del graf de comissions és de mida incorrecta"
+
+msgid "commit-graph changed-path index chunk is too small"
+msgstr ""
+"el fragment d'índex del canvi del camí del graf de comissions és massa petit"
+
+#, c-format
+msgid ""
+"ignoring too-small changed-path chunk (%<PRIuMAX> < %<PRIuMAX>) in commit-"
+"graph file"
+msgstr ""
+"s'ignorarà un fragment massa petit de camí canviat (%<PRIuMAX> < %<PRIuMAX>) "
+"al fitxer del graf de comissions"
+
#, c-format
msgid "commit-graph signature %X does not match signature %X"
msgstr ""
@@ -14009,20 +14687,44 @@ msgstr "la versió del graf de comissions %X no coincideix amb la versió %X"
#, c-format
msgid "commit-graph hash version %X does not match version %X"
msgstr ""
-"la versió del hash del graf de comissions %X no coincideix amb la versió %X"
+"la versió del resum del graf de comissions %X no coincideix amb la versió %X"
#, c-format
msgid "commit-graph file is too small to hold %u chunks"
msgstr ""
"el fitxer del graf de comissions és massa petit per a guardar %u fragments"
+msgid "commit-graph required OID fanout chunk missing or corrupted"
+msgstr ""
+"manca o està malmès el fragment del «fanout» OID requerit al graf de "
+"comissions"
+
+msgid "commit-graph required OID lookup chunk missing or corrupted"
+msgstr ""
+"manca o està malmès el fragment de cerca d'OID requerit al graf de comissions"
+
+msgid "commit-graph required commit data chunk missing or corrupted"
+msgstr ""
+"manca o està corromput el fragment de dades de publicació requerit al graf "
+"de comissions"
+
msgid "commit-graph has no base graphs chunk"
msgstr "el fragment del graf de comissions no té grafs de base"
+msgid "commit-graph base graphs chunk is too small"
+msgstr "el fragment de grafs base de la gràfica de comissió és massa petit"
+
msgid "commit-graph chain does not match"
msgstr "la cadena del graf de comissions no coincideix"
#, c-format
+msgid "commit count in base graph too high: %<PRIuMAX>"
+msgstr "el nombre de comissions en el graf base és massa alt: %<PRIuMAX>"
+
+msgid "commit-graph chain file too small"
+msgstr "el fitxer de cadena del graf de comissions és massa petit"
+
+#, c-format
msgid "invalid commit-graph chain: line '%s' not a hash"
msgstr ""
"la cadena del graf de comissions no és vàlida: la línia «%s» no és un hash"
@@ -14044,6 +14746,14 @@ msgstr ""
"el graf de comissions requereix dades de generació de desbordaments però no "
"en té cap"
+msgid "commit-graph overflow generation data is too small"
+msgstr ""
+"les dades de generació de desbordament del graf de comissions són massa "
+"petites"
+
+msgid "commit-graph extra-edges pointer out of bounds"
+msgstr "punter de vores extra del graf de comissió està fora dels límits"
+
msgid "Loading known commits in commit graph"
msgstr "S'estan carregant comissions conegudes al graf de comissions"
@@ -14117,6 +14827,14 @@ msgid "failed to rename temporary commit-graph file"
msgstr ""
"no s'ha pogut canviar el nom del fitxer temporal del graf de comissions"
+#, c-format
+msgid "cannot merge graphs with %<PRIuMAX>, %<PRIuMAX> commits"
+msgstr "no es poden fusionar els gràfics amb %<PRIuMAX>, %<PRIuMAX>entregues"
+
+#, c-format
+msgid "cannot merge graph %s, too many commits: %<PRIuMAX>"
+msgstr "no es pot fusionar el graf %s, hi ha massa comissions: %<PRIuMAX>"
+
msgid "Scanning merged commits"
msgstr "S'estan escanejant les comissions fusionades"
@@ -14151,9 +14869,6 @@ msgid "failed to parse commit %s from commit-graph"
msgstr ""
"s'ha produït un error en analitzar la comissió %s del graf de comissions"
-msgid "Verifying commits in commit graph"
-msgstr "S'estan verificant les comissions al graf de comissions"
-
#, c-format
msgid "failed to parse commit %s from object database for commit-graph"
msgstr ""
@@ -14180,20 +14895,6 @@ msgid "commit-graph parent list for commit %s terminates early"
msgstr "la llista pare del graf de comissions per %s acaba aviat"
#, c-format
-msgid ""
-"commit-graph has generation number zero for commit %s, but non-zero elsewhere"
-msgstr ""
-"el graf de comissions té nombre de generació zero per a la comissió %s, però "
-"té no zero en altres llocs"
-
-#, c-format
-msgid ""
-"commit-graph has non-zero generation number for commit %s, but zero elsewhere"
-msgstr ""
-"el graf de comissions té un nombre de generació diferent de zero per a "
-"comissió %s però té zero en altres llocs"
-
-#, c-format
msgid "commit-graph generation for commit %s is %<PRIuMAX> < %<PRIuMAX>"
msgstr ""
"generació del graf de comissions per a la comissió %s és %<PRIuMAX> < "
@@ -14206,6 +14907,17 @@ msgstr ""
"%<PRIuMAX> != %<PRIuMAX>"
#, c-format
+msgid ""
+"commit-graph has both zero and non-zero generations (e.g., commits '%s' and "
+"'%s')"
+msgstr ""
+"El graf de comissió té tant generacions zero com no nul·les (p. ex., "
+"comissions «%s» i «%s»)"
+
+msgid "Verifying commits in commit graph"
+msgstr "S'estan verificant les comissions al graf de comissions"
+
+#, c-format
msgid "%s %s is not a commit!"
msgstr "%s %s no és una comissió!"
@@ -14229,6 +14941,12 @@ msgstr ""
"«git config advice.graftFileDeprecated false»"
#, c-format
+msgid "commit %s exists in commit-graph but not in the object database"
+msgstr ""
+"la comissió %s existeix al graf de comissions però no a la base de dades "
+"d'objectes"
+
+#, c-format
msgid "Commit %s has an untrusted GPG signature, allegedly by %s."
msgstr "La comissió %s té una signatura GPG no fiable, suposadament de %s."
@@ -14244,13 +14962,12 @@ msgstr "La comissió %s no té signatura GPG."
msgid "Commit %s has a good GPG signature by %s\n"
msgstr "La comissió %s té una signatura GPG bona de %s\n"
-#, fuzzy
msgid ""
"Warning: commit message did not conform to UTF-8.\n"
"You may want to amend it after fixing the message, or set the config\n"
"variable i18n.commitEncoding to the encoding your project uses.\n"
msgstr ""
-"Advertència: el missatge de comissió no és compatible amb UTF-8.\n"
+"Avís: el missatge de comissió no és compatible amb UTF-8.\n"
"Potser voleu esmenar-lo després de corregir el missatge, o establir\n"
"la variable de configuració i18n.commitencoding a la codificació que\n"
"usi el vostre projecte.\n"
@@ -14261,31 +14978,41 @@ msgstr "no hi ha informació disponible del compilador\n"
msgid "no libc information available\n"
msgstr "no hi ha informació disponible de libc\n"
-#, fuzzy, c-format
+#, c-format
+msgid "could not determine free disk size for '%s'"
+msgstr "no s'ha pogut determinar l'espai de disc lliure per a «%s»"
+
+#, c-format
+msgid "could not get info for '%s'"
+msgstr "no s'ha pogut obtenir la informació per a «%s»"
+
+#, c-format
msgid "[GLE %ld] health thread could not open '%ls'"
-msgstr "no s'ha pogut commutar a «%s»"
+msgstr "[GLE %ld] el fil de salut no ha pogut obrir «%ls»"
#, c-format
msgid "[GLE %ld] health thread getting BHFI for '%ls'"
-msgstr ""
+msgstr "[GLE %ld] s'està obtenint BHFI del fil de salut per a «%ls»"
-#, fuzzy, c-format
+#, c-format
msgid "could not convert to wide characters: '%s'"
-msgstr ""
-"no s'han pogut convertir els següents «grafts»:\n"
-"%s"
+msgstr "no s'ha pogut convertir a caràcters amples: «%s»"
-#, fuzzy, c-format
+#, c-format
msgid "BHFI changed '%ls'"
-msgstr "no es pot canviar a «%s»"
+msgstr "S'ha canviat BHFI «%ls»"
#, c-format
msgid "unhandled case in 'has_worktree_moved': %d"
-msgstr ""
+msgstr "cas no gestionat a «has_worktree_moved»: %d"
#, c-format
msgid "health thread wait failed [GLE %ld]"
-msgstr ""
+msgstr "ha fallat l'espera del fil de salut [GLE %ld]"
+
+#, c-format
+msgid "Invalid path: %s"
+msgstr "Camí no vàlid: «%s»"
msgid "Unable to create FSEventStream."
msgstr "No s'ha pogut crear el FSEventStream."
@@ -14295,102 +15022,116 @@ msgstr "No s'ha pogut iniciar el FSEventStream"
#, c-format
msgid "[GLE %ld] could not convert path to UTF-8: '%.*ls'"
-msgstr ""
+msgstr "[GLE %ld] no s'ha pogut convertir el camí a UTF-8: «%.*ls»"
-#, fuzzy, c-format
+#, c-format
msgid "[GLE %ld] could not watch '%s'"
-msgstr "no s'ha pogut commutar a «%s»"
+msgstr "[GLE %ld] no s'ha pogut vigilar «%s»"
-#, fuzzy, c-format
+#, c-format
msgid "[GLE %ld] could not get longname of '%s'"
-msgstr "no s'ha pogut commutar a «%s»"
+msgstr "[GLE %ld] no s'ha pogut obtenir el nom llarg de «%s»"
#, c-format
msgid "ReadDirectoryChangedW failed on '%s' [GLE %ld]"
-msgstr ""
+msgstr "Ha fallat ReadDirectoryChangedW a «%s» [GLE %ld]"
#, c-format
msgid "GetOverlappedResult failed on '%s' [GLE %ld]"
-msgstr ""
+msgstr "Ha fallat GetOverlappedResult a «%s» [GLE %ld]"
-#, fuzzy, c-format
+#, c-format
msgid "could not read directory changes [GLE %ld]"
-msgstr "no s'han pogut crear directoris per %s"
+msgstr "no s'han pogut llegir els canvis de directori [GLE %ld]"
+
+#, c-format
+msgid "opendir('%s') failed"
+msgstr "ha fallat opendir(«%s»)"
+
+#, c-format
+msgid "lstat('%s') failed"
+msgstr "ha fallat lstat(«%s»)"
+
+#, c-format
+msgid "strbuf_readlink('%s') failed"
+msgstr "ha fallat strbuf_readlink(«%s»)"
-#, fuzzy, c-format
+#, c-format
+msgid "closedir('%s') failed"
+msgstr "ha fallat closedir(«%s»)"
+
+#, c-format
+msgid "[GLE %ld] unable to open for read '%ls'"
+msgstr "[GLE %ld] no s'ha pogut obrir per a llegir «%ls»"
+
+#, c-format
+msgid "[GLE %ld] unable to get protocol information for '%ls'"
+msgstr "[GLE %ld] no s'ha pogut obtenir la informació del protocol per a «%ls»"
+
+#, c-format
msgid "failed to copy SID (%ld)"
-msgstr "s'ha produït un error en copiar el fitxer a «%s»"
+msgstr "no s'ha pogut copiar el SID (%ld)"
-#, fuzzy, c-format
+#, c-format
msgid "failed to get owner for '%s' (%ld)"
-msgstr "s'ha produït un error en obtenir la branca per defecte per a «%s»"
+msgstr "no s'ha pogut obtenir el propietari de «%s» (%ld)"
msgid "memory exhausted"
msgstr "memòria esgotada"
msgid "Success"
-msgstr ""
+msgstr "Èxit"
msgid "No match"
-msgstr ""
+msgstr "Cap coincidència"
-#, fuzzy
msgid "Invalid regular expression"
-msgstr "usa les expressions regulars POSIX ampliades"
+msgstr "Expressió regular no vàlida"
-#, fuzzy
msgid "Invalid collation character"
-msgstr "caràcter de llast"
+msgstr "El caràcter de col·lació no és vàlid"
-#, fuzzy
msgid "Invalid character class name"
-msgstr "hi ha caràcters no vàlids en el nom de màquina"
+msgstr "Nom de la classe del caràcter no vàlid"
msgid "Trailing backslash"
-msgstr ""
+msgstr "Barra inversa del final"
-#, fuzzy
msgid "Invalid back reference"
-msgstr "referència no vàlida: %s"
+msgstr "Referència anterior no vàlida"
msgid "Unmatched [ or [^"
-msgstr ""
+msgstr "[ o [^ no emparellat"
msgid "Unmatched ( or \\("
-msgstr ""
+msgstr "( o \\( no emparellat"
msgid "Unmatched \\{"
-msgstr ""
+msgstr "\\{ no emparellat"
-#, fuzzy
msgid "Invalid content of \\{\\}"
-msgstr "contingut no vàlid: «%s»"
+msgstr "Contingut no vàlid de \\{\\}"
-#, fuzzy
msgid "Invalid range end"
-msgstr "codificació de transferència no vàlida"
+msgstr "Fi d'interval no vàlid"
-#, fuzzy
msgid "Memory exhausted"
-msgstr "memòria esgotada"
+msgstr "Memòria esgotada"
-#, fuzzy
msgid "Invalid preceding regular expression"
-msgstr "usa les expressions regulars POSIX ampliades"
+msgstr "Expressió regular anterior no vàlida"
-#, fuzzy
msgid "Premature end of regular expression"
-msgstr "usa les expressions regulars POSIX ampliades"
+msgstr "Fi prematur d'expressió regular"
msgid "Regular expression too big"
-msgstr ""
+msgstr "Expressió regular és massa gran"
msgid "Unmatched ) or \\)"
-msgstr ""
+msgstr ") o \\) no emparellat"
-#, fuzzy
msgid "No previous regular expression"
-msgstr "usa les expressions regulars compatibles amb Perl"
+msgstr "No hi ha expressió regular anterior"
msgid "could not send IPC command"
msgstr "no s'ha pogut enviar l'ordre IPC"
@@ -14406,21 +15147,21 @@ msgstr "no s'ha pogut començar un fil «accept_thread» «%s»"
msgid "could not start worker[0] for '%s'"
msgstr "no s'ha pogut iniciar el fil[0] per a «%s»"
-#, fuzzy, c-format
+#, c-format
msgid "ConnectNamedPipe failed for '%s' (%lu)"
-msgstr "uname() ha fallat amb l'error «%s» (%d)\n"
+msgstr "Ha fallat ConnectNamedPipe per a «%s» (%lu)"
-#, fuzzy, c-format
+#, c-format
msgid "could not create fd from pipe for '%s'"
-msgstr "no s'han pogut crear directoris per %s"
+msgstr "no s'ha pogut crear un fd a partir de la canonada per a «%s»"
-#, fuzzy, c-format
+#, c-format
msgid "could not start thread[0] for '%s'"
msgstr "no s'ha pogut iniciar el fil[0] per a «%s»"
-#, fuzzy, c-format
+#, c-format
msgid "wait for hEvent failed for '%s'"
-msgstr "S'ha produït un error en autenticar per «%s»"
+msgstr "ha fallat l'espera de hEvent per a «%s»"
msgid "cannot resume in the background, please use 'fg' to resume"
msgstr "no es pot reprendre en segon pla, si us plau useu «fg» per a reprendre"
@@ -14606,8 +15347,8 @@ msgstr "la longitud d'«abbrev» està fora de rang: %d"
msgid "bad zlib compression level %d"
msgstr "nivell de compressió de zlib incorrecte %d"
-msgid "core.commentChar should only be one character"
-msgstr "core.commentChar només hauria de ser un caràcter"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar només hauria de ser un caràcter ASCII"
#, c-format
msgid "ignoring unknown core.fsyncMethod value '%s'"
@@ -14645,10 +15386,6 @@ msgstr "la referència «%s» no assenyala a un blob"
msgid "unable to resolve config blob '%s'"
msgstr "no s'ha pogut resoldre el blob de configuració: «%s»"
-#, c-format
-msgid "failed to parse %s"
-msgstr "s'ha produït un error en analitzar %s"
-
msgid "unable to parse command-line config"
msgstr "no s'ha pogut analitzar la configuració de la línia d'ordres"
@@ -14720,6 +15457,11 @@ msgid "invalid section name: %s"
msgstr "nom de secció no vàlida: %s"
#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr ""
+"es rebutja treballar amb una línia massa llarga a «%s» a la línia %<PRIuMAX>"
+
+#, c-format
msgid "missing value for '%s'"
msgstr "falta el valor per «%s»"
@@ -14775,17 +15517,24 @@ msgid "unknown object format '%s' specified by server"
msgstr "format d'objecte «%s» especificat pel servidor desconegut"
#, c-format
-msgid "invalid ls-refs response: %s"
-msgstr "resposta de ls-refs no vàlida: %s"
+msgid "error on bundle-uri response line %d: %s"
+msgstr "error a la línia de resposta de bundle-uri %d: %s"
-msgid "expected flush after ref listing"
-msgstr "s'esperava una neteja després del llistat de referències"
+msgid "expected flush after bundle-uri listing"
+msgstr "s'esperava un buidatge després del llistat de bundle-uri"
msgid "expected response end packet after ref listing"
msgstr ""
"s'esperava un paquet de final de resposta després del llistat de referències"
#, c-format
+msgid "invalid ls-refs response: %s"
+msgstr "resposta de ls-refs no vàlida: %s"
+
+msgid "expected flush after ref listing"
+msgstr "s'esperava una neteja després del llistat de referències"
+
+#, c-format
msgid "protocol '%s' is not supported"
msgstr "el protocol «%s» no és compatible"
@@ -14877,185 +15626,6 @@ msgid "failed to close rev-list's stdin"
msgstr "s'ha produït un error en tancar l'stdin del rev-list"
#, c-format
-msgid "'%s' does not exist"
-msgstr "«%s» no existeix"
-
-msgid "need a working directory"
-msgstr "cal un directori de treball"
-
-msgid "could not find enlistment root"
-msgstr "no s'ha pogut trobar un arrel d'allistament"
-
-#, c-format
-msgid "could not switch to '%s'"
-msgstr "no s'ha pogut commutar a «%s»"
-
-#, c-format
-msgid "could not configure %s=%s"
-msgstr "no s'ha pogut configurar %s=%s"
-
-msgid "could not configure log.excludeDecoration"
-msgstr "no s'ha pogut configurar log.excludeDecoration"
-
-msgid "Scalar enlistments require a worktree"
-msgstr "Els allistaments escalars requereixen un arbre de treball"
-
-#, c-format
-msgid "could not open directory '%s'"
-msgstr "no s'ha pogut obrir el directori «%s»"
-
-#, fuzzy, c-format
-msgid "skipping '%s', which is neither file nor directory"
-msgstr "el destí «%s» no és un directori"
-
-#, fuzzy, c-format
-msgid "could not determine free disk size for '%s'"
-msgstr "no s'ha pogut crear el directori d'arbre de treball «%s»"
-
-#, fuzzy, c-format
-msgid "could not get info for '%s'"
-msgstr "no s'ha pogut llegir el fitxer de registre per a «%s»"
-
-#, c-format
-msgid "remote HEAD is not a branch: '%.*s'"
-msgstr "el HEAD remot no és una branca: «%.*s»"
-
-msgid "failed to get default branch name from remote; using local default"
-msgstr ""
-"no s'ha pogut obtenir el nom de la branca per defecte del remot; s'usa ela "
-"predeterminada localment"
-
-msgid "failed to get default branch name"
-msgstr "s'ha produït un error en obtenir el nom de branca predeterminada"
-
-msgid "failed to unregister repository"
-msgstr "s'ha produït un error en desregistrar el repositori"
-
-msgid "failed to delete enlistment directory"
-msgstr "s'ha produït un error en suprimir l'allistament del directori"
-
-msgid "branch to checkout after clone"
-msgstr "branca a agafar després de clonar"
-
-msgid "when cloning, create full working directory"
-msgstr "quan es clona, crear un directori de treball complet"
-
-msgid "only download metadata for the branch that will be checked out"
-msgstr "només baixa les metadades per a la branca que s'agafarà"
-
-msgid "scalar clone [<options>] [--] <repo> [<dir>]"
-msgstr "scalar clone [<opcions>] [--] <repo> [<dir>]"
-
-#, c-format
-msgid "cannot deduce worktree name from '%s'"
-msgstr "no es pot deduir el nom de l'arbre de treball de «%s»"
-
-#, c-format
-msgid "directory '%s' exists already"
-msgstr "el directori «%s» ja existeix"
-
-#, c-format
-msgid "failed to get default branch for '%s'"
-msgstr "s'ha produït un error en obtenir la branca per defecte per a «%s»"
-
-#, c-format
-msgid "could not configure remote in '%s'"
-msgstr "no s'ha pogut configurar el remot a «%s»"
-
-#, c-format
-msgid "could not configure '%s'"
-msgstr "no s'ha pogut configurar «%s»"
-
-msgid "partial clone failed; attempting full clone"
-msgstr "ha fallat la clonació parcial; s'està intentant la clonació completa"
-
-msgid "could not configure for full clone"
-msgstr "no s'ha pogut configurar per a una clonació completa"
-
-#, fuzzy
-msgid "scalar diagnose [<enlistment>]"
-msgstr "scalar register [<enlistment>]"
-
-#, fuzzy, c-format
-msgid "could not create directory for '%s'"
-msgstr "No s'ha pogut crear el directori per a «%s»"
-
-#, fuzzy
-msgid "could not duplicate stdout"
-msgstr "no s'ha pogut actualitzar %s"
-
-#, fuzzy
-msgid "failed to write archive"
-msgstr "s'ha produït un error en llegir la memòria cau"
-
-msgid "`scalar list` does not take arguments"
-msgstr "«scalar list» no accepta arguments"
-
-msgid "scalar register [<enlistment>]"
-msgstr "scalar register [<enlistment>]"
-
-msgid "reconfigure all registered enlistments"
-msgstr "reconfigura tots els allistaments registrats"
-
-msgid "scalar reconfigure [--all | <enlistment>]"
-msgstr "scalar reconfigure [--all | <enlistment>]"
-
-msgid "--all or <enlistment>, but not both"
-msgstr "--all o <enlistment>, però no ambdós"
-
-#, c-format
-msgid "git repository gone in '%s'"
-msgstr "no existeix un repositori de git a: «%s»"
-
-msgid ""
-"scalar run <task> [<enlistment>]\n"
-"Tasks:\n"
-msgstr ""
-"scalar run <task> {<enlistment>]\n"
-"Tasques:\n"
-
-#, c-format
-msgid "no such task: '%s'"
-msgstr "no existeix la tasca: «%s»"
-
-msgid "scalar unregister [<enlistment>]"
-msgstr "scalar unregister [<enlistment>]"
-
-msgid "scalar delete <enlistment>"
-msgstr "supressió de l'escalar <enlistment>"
-
-msgid "refusing to delete current working directory"
-msgstr "s'ha rebutjat suprimir el directori de treball actual"
-
-msgid "include Git version"
-msgstr "inclou la versió del Git"
-
-msgid "include Git's build options"
-msgstr "inclou les opcions de construcció del Git"
-
-msgid "scalar verbose [-v | --verbose] [--build-options]"
-msgstr "scalar verbose [-v | --verbose] [--build-options]"
-
-msgid "-C requires a <directory>"
-msgstr "-C requereix un <directory>"
-
-#, c-format
-msgid "could not change to '%s'"
-msgstr "no s'ha pogut canviar a «%s»"
-
-msgid "-c requires a <key>=<value> argument"
-msgstr "-c requereix un argument <key>=<value>"
-
-msgid ""
-"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
-"\n"
-"Commands:\n"
-msgstr ""
-"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
-"\n"
-"Ordres:\n"
-
-#, c-format
msgid "illegal crlf_action %d"
msgstr "crlf_action %d il·legal"
@@ -15068,6 +15638,8 @@ msgid ""
"in the working copy of '%s', CRLF will be replaced by LF the next time Git "
"touches it"
msgstr ""
+"a la còpia de treball de «%s», CRLF serà substituït per LF, la propera "
+"vegada que el Git ho modifiqui"
#, c-format
msgid "LF would be replaced by CRLF in %s"
@@ -15078,6 +15650,8 @@ msgid ""
"in the working copy of '%s', LF will be replaced by CRLF the next time Git "
"touches it"
msgstr ""
+"a la còpia de treball de «%s», LF serà substituït per CRLF la propera vegada "
+"que Git ho modifiqui"
#, c-format
msgid "BOM is prohibited in '%s' if encoded as %s"
@@ -15260,12 +15834,35 @@ msgstr ""
msgid "Marked %d islands, done.\n"
msgstr "Marcades %d illes, fet.\n"
+#, c-format
+msgid "invalid --%s value '%s'"
+msgstr "no és vàlid --%s amb valor «%s»"
+
+#, c-format
+msgid "could not archive missing directory '%s'"
+msgstr "no s'ha pogut arxivar el directori que falta «%s»"
+
+#, c-format
+msgid "could not open directory '%s'"
+msgstr "no s'ha pogut obrir el directori «%s»"
+
+#, c-format
+msgid "skipping '%s', which is neither file nor directory"
+msgstr "s'omet «%s», que no és ni fitxer ni directori"
+
+msgid "could not duplicate stdout"
+msgstr "no s'ha pogut duplicar stdout"
+
+#, c-format
+msgid "could not add directory '%s' to archiver"
+msgstr "no s'ha pogut afegir el directori «%s» a l'arxivador"
+
+msgid "failed to write archive"
+msgstr "s'ha produït un error en escriure arxiu"
+
msgid "--merge-base does not work with ranges"
msgstr "--merge-base no funciona amb intervals"
-msgid "--merge-base only works with commits"
-msgstr "--merge-base només funciona amb comissions"
-
msgid "unable to get HEAD"
msgstr "no s'ha pogut obtenir HEAD"
@@ -15275,6 +15872,12 @@ msgstr "no s'ha trobat una base de fusió"
msgid "multiple merge bases found"
msgstr "s'han trobat múltiples bases de fusió"
+msgid "cannot compare stdin to a directory"
+msgstr "no es pot comparar stdin amb un directori"
+
+msgid "cannot compare a named pipe to a directory"
+msgstr "no es pot comparar una canonada amb nom amb un directori"
+
msgid "git diff --no-index [<options>] <path> <path>"
msgstr "git diff --no-index [<opcions>] <camí> <camí>"
@@ -15307,7 +15910,7 @@ msgid ""
"unknown color-moved-ws mode '%s', possible values are 'ignore-space-change', "
"'ignore-space-at-eol', 'ignore-all-space', 'allow-indentation-change'"
msgstr ""
-"el mode «%s» de «color-moved-ws» és desconegut, els valor possibles són "
+"el mode «%s» de «color-moved-ws» és desconegut, els valors possibles són "
"«ignore-space-change», «ignore-space-at-eol», «ignore-all-space», «allow-"
"indentation-change»"
@@ -15324,6 +15927,10 @@ msgstr ""
"Valor desconegut de la variable de configuració de «diff.submodule»: «%s»"
#, c-format
+msgid "unknown value for config '%s': %s"
+msgstr "valor desconegut per al config «%s»': %s"
+
+#, c-format
msgid ""
"Found errors in 'diff.dirstat' config variable:\n"
"%s"
@@ -15335,6 +15942,13 @@ msgstr ""
msgid "external diff died, stopping at %s"
msgstr "el diff external s'ha mort, s'està aturant a %s"
+msgid "--follow requires exactly one pathspec"
+msgstr "--follow requereix exactament una especificació de camí"
+
+#, c-format
+msgid "pathspec magic not supported by --follow: %s"
+msgstr "el «pathspec» màgic no està suportat per --follow: %s"
+
#, c-format
msgid "options '%s', '%s', '%s', and '%s' cannot be used together"
msgstr "les opcions «%s», «%s», «%s», i «%s» no es poden usar juntes"
@@ -15349,9 +15963,6 @@ msgid ""
msgstr ""
"les opcions «%s» i «%s» no es poden usar juntes, useu «%s» amb «%s» i «%s»"
-msgid "--follow requires exactly one pathspec"
-msgstr "--follow requereix exactament una especificació de camí"
-
#, c-format
msgid "invalid --stat value: %s"
msgstr "valor --stat no vàlid: %s"
@@ -15396,12 +16007,6 @@ msgstr "argument --color-moved incorrecte: %s"
msgid "invalid mode '%s' in --color-moved-ws"
msgstr "mode «%s» no vàlid en --color-moved-ws"
-msgid ""
-"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
-"\"histogram\""
-msgstr ""
-"l'opció diff-algorithm accepta «myers», «minimal», «patience» i «histogram»"
-
#, c-format
msgid "invalid argument to %s"
msgstr "argument no vàlid a %s"
@@ -15441,13 +16046,13 @@ msgid "synonym for '-p --stat'"
msgstr "sinònim de «-p --stat»"
msgid "machine friendly --stat"
-msgstr "llegible per màquina --stat"
+msgstr "llegible per una màquina --stat"
msgid "output only the last line of --stat"
msgstr "mostra només l'última línia de --stat"
-msgid "<param1,param2>..."
-msgstr "<param1,param2>..."
+msgid "<param1>,<param2>..."
+msgstr "<param1>,<param2>..."
msgid ""
"output the distribution of relative amount of changes for each sub-directory"
@@ -15458,8 +16063,8 @@ msgstr ""
msgid "synonym for --dirstat=cumulative"
msgstr "sinònim de --dirstat=cumulative"
-msgid "synonym for --dirstat=files,param1,param2..."
-msgstr "sinònim de --dirstat=files,param1,param2..."
+msgid "synonym for --dirstat=files,<param1>,<param2>..."
+msgstr "sinònim de --dirstat=files,<param1>,<param2>..."
msgid "warn if changes introduce conflict markers or whitespace errors"
msgstr ""
@@ -15544,6 +16149,9 @@ msgstr "afegir un prefix addicional per a cada línia de sortida"
msgid "do not show any source or destination prefix"
msgstr "no mostris cap prefix d'origen o destí"
+msgid "use default prefixes a/ and b/"
+msgstr "utilitza els prefixos per defecte a/ i b/"
+
msgid "show context between diff hunks up to the specified number of lines"
msgstr ""
"mostra el context entre trossos de diferència fins al nombre especificat de "
@@ -15639,12 +16247,6 @@ msgstr "genera diff usant l'algorisme «patience diff»"
msgid "generate diff using the \"histogram diff\" algorithm"
msgstr "genera diff usant l'algorisme «histogram diff»"
-msgid "<algorithm>"
-msgstr "<algorisme>"
-
-msgid "choose a diff algorithm"
-msgstr "trieu un algorisme per al diff"
-
msgid "<text>"
msgstr "<text>"
@@ -15666,7 +16268,7 @@ msgid "equivalent to --word-diff=color --word-diff-regex=<regex>"
msgstr "equivalent a --word-diff=color --word-diff-regex=<regex>"
msgid "moved lines of code are colored differently"
-msgstr "les línies de codi que s'ha mogut s'acoloreixen diferent"
+msgstr "les línies de codi que s'han mogut s'acoloreixen diferent"
msgid "how white spaces are ignored in --color-moved"
msgstr "com s'ignoren els espais en blanc a --color-moved"
@@ -15855,6 +16457,14 @@ msgstr "no s'ha pogut migrar el directori de «%s» a «%s»"
msgid "hint: Waiting for your editor to close the file...%c"
msgstr "consell: s'està esperant que el vostre editor tanqui el fitxer...%c"
+#, c-format
+msgid "could not write to '%s'"
+msgstr "no s'ha pogut escriure a «%s»"
+
+#, c-format
+msgid "could not edit '%s'"
+msgstr "no s'ha pogut editar «%s»"
+
msgid "Filtering content"
msgstr "S'està filtrant el contingut"
@@ -15887,6 +16497,9 @@ msgstr "git fetch-pack: s'esperava ACK/NAK, s'ha rebut «%s»"
msgid "unable to write to remote"
msgstr "no s'ha pogut escriure al remot"
+msgid "Server supports filter"
+msgstr "El servidor accepta filtratge"
+
#, c-format
msgid "invalid shallow line: %s"
msgstr "línia de shallow no vàlida: %s"
@@ -15998,9 +16611,6 @@ msgstr "el servidor no és compatible amb l'algorisme «%s»"
msgid "Server does not support shallow requests"
msgstr "El servidor no permet sol·licituds superficials"
-msgid "Server supports filter"
-msgstr "El servidor accepta filtratge"
-
msgid "unable to write request to remote"
msgstr "no s'ha pogut escriure la sol·licitud al remot"
@@ -16008,9 +16618,9 @@ msgstr "no s'ha pogut escriure la sol·licitud al remot"
msgid "expected '%s', received '%s'"
msgstr "s'esperava «%s», s'ha rebut «%s»"
-#, fuzzy, c-format
+#, c-format
msgid "expected '%s'"
-msgstr "línia inesperada: «%s»"
+msgstr "s'esperava «%s»"
#, c-format
msgid "unexpected acknowledgment line: '%s'"
@@ -16082,44 +16692,44 @@ msgstr "fsmonitor--daemon no s'està executant"
msgid "could not send '%s' command to fsmonitor--daemon"
msgstr "no s'ha pogut enviar l'ordre «%s» a fsmonitor--daemon"
-#, fuzzy, c-format
+#, c-format
msgid "bare repository '%s' is incompatible with fsmonitor"
-msgstr "%s és incompatible amb %s"
+msgstr "el repositori nu «%s» és incompatible amb fsmonitor"
#, c-format
msgid "repository '%s' is incompatible with fsmonitor due to errors"
-msgstr ""
+msgstr "el repositori «%s» és incompatible amb fsmonitor a causa d'errors"
-#, fuzzy, c-format
+#, c-format
msgid "remote repository '%s' is incompatible with fsmonitor"
-msgstr "%s és incompatible amb %s"
+msgstr "el repositori remot «%s» no és compatible amb fsmonitor"
-#, fuzzy, c-format
+#, c-format
msgid "virtual repository '%s' is incompatible with fsmonitor"
-msgstr "%s és incompatible amb %s"
+msgstr "el repositori virtual «%s» és incompatible amb fsmonitor"
#, c-format
msgid ""
-"repository '%s' is incompatible with fsmonitor due to lack of Unix sockets"
+"socket directory '%s' is incompatible with fsmonitor due to lack of Unix "
+"sockets support"
msgstr ""
+"el directori del sòcol «%s» és incompatible amb fsmonitor a causa de la "
+"manca de compatibilitat amb els sòcols Unix"
-#, fuzzy
msgid ""
"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
-" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
-" <command> [<args>]"
+" [--config-env=<name>=<envvar>] <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
-" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
-" <command> [<args>]"
+" [--config-env=<name>=<envvar>] <command> [<args>]"
msgid ""
"'git help -a' and 'git help -g' list available subcommands and some\n"
@@ -16145,10 +16755,6 @@ msgid "no namespace given for --namespace\n"
msgstr "no s'ha especificat un nom d'espai per --namespace\n"
#, c-format
-msgid "no prefix given for --super-prefix\n"
-msgstr "no s'ha especificat cap prefix per a --super-prefix\n"
-
-#, c-format
msgid "-c expects a configuration string\n"
msgstr "-c espera una cadena de configuració\n"
@@ -16157,6 +16763,10 @@ msgid "no config key given for --config-env\n"
msgstr "no s'ha indicat cap clau de configuració per a --config-env\n"
#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "no s'ha donat d'atribut font per a --attr-source\n"
+
+#, c-format
msgid "unknown option: %s\n"
msgstr "opció desconeguda: %s\n"
@@ -16260,12 +16870,16 @@ msgstr ""
msgid "gpg.ssh.defaultKeyCommand failed: %s %s"
msgstr "gpg.ssh.defaultKeyCommand ha fallat: %s %s"
-msgid "gpg failed to sign the data"
-msgstr "gpg ha fallat en signar les dades"
+#, c-format
+msgid ""
+"gpg failed to sign the data:\n"
+"%s"
+msgstr ""
+"gpg ha fallat en signar les dades:\n"
+"%s"
-#, fuzzy
msgid "user.signingKey needs to be set for ssh signing"
-msgstr "user.signingkey s'ha d'establir per a signar amb ssh"
+msgstr "user.signingKey s'ha d'establir per a signar amb ssh"
#, c-format
msgid "failed writing ssh signing key to '%s'"
@@ -16344,6 +16958,12 @@ msgstr "Ordres de baix nivell / Sincronització de repositoris"
msgid "Low-level Commands / Internal Helpers"
msgstr "Ordres de baix nivell / Ajudants interns"
+msgid "User-facing repository, command and file interfaces"
+msgstr "Repositori, ordre i interfície de fitxers que veu l'usuari"
+
+msgid "Developer-facing file formats, protocols and other interfaces"
+msgstr "Formats de fitxers, protocols i interfícies que veu el desenvolupador"
+
#, c-format
msgid "available git commands in '%s'"
msgstr "ordres de git disponibles en «%s»"
@@ -16357,6 +16977,12 @@ msgstr "Aquestes són ordres habituals del Git usades en diverses situacions:"
msgid "The Git concept guides are:"
msgstr "Les guies de Git de conceptes són:"
+msgid "User-facing repository, command and file interfaces:"
+msgstr "Repositori, ordre i interfície de fitxers que veu l'usuari:"
+
+msgid "File formats, protocols and other developer interfaces:"
+msgstr "Formats de fitxer, protocols i altres interfícies de desenvolupador:"
+
msgid "External commands"
msgstr "Ordres externes"
@@ -16412,8 +17038,8 @@ msgstr[1] ""
"\n"
"Les ordres més similars són"
-msgid "git version [<options>]"
-msgstr "git version [<opcions>]"
+msgid "git version [--build-options]"
+msgstr "git version [--build-options]"
#, c-format
msgid "%s: %s - %s"
@@ -16441,19 +17067,15 @@ msgstr ""
"Podeu desactivar aquest avís amb «git config advice.ignoredHook false»."
#, c-format
-msgid "Couldn't start hook '%s'\n"
-msgstr "No s'ha pogut iniciar el lligam «%s»'\n"
-
-#, c-format
msgid "argument to --packfile must be a valid hash (got '%s')"
msgstr "l'argument a --packfile ha de ser un resum vàlid (s'ha obtingut «%s»)"
msgid "not a git repository"
msgstr "no és un repositori de git"
-#, fuzzy, c-format
+#, c-format
msgid "negative value for http.postBuffer; defaulting to %d"
-msgstr "valor negatiu per http.postbuffer; utilitzant el valor %d"
+msgstr "valor negatiu per http.postBuffer; utilitzant el valor %d"
msgid "Delegation control is not supported with cURL < 7.22.0"
msgstr "No s'admet el control de delegació amb el cURL < 7.22.0"
@@ -16553,7 +17175,7 @@ msgstr "sparse: s'ha eliminat la implementació de filtres de camí sparse"
#, c-format
msgid "'%s' for 'object:type=<type>' is not a valid object type"
-msgstr "«%s» per a «object:type=<type>» no és un tipus d'objecte vàlid"
+msgstr "«%s» per a «object:type=<tipus>» no és un tipus d'objecte vàlid"
#, c-format
msgid "invalid filter-spec '%s'"
@@ -16612,7 +17234,7 @@ msgid ""
msgstr ""
"No s'ha pogut crear «%s.lock»: %s.\n"
"\n"
-"Sembla que un altre procés de git s'està executant en aquest\n"
+"Sembla que un altre procés git s'està executant en aquest\n"
"repositori, per exemple, un editor obert per «git commit». \n"
"Assegureu-vos que tots els processos s'hagin acabat i\n"
"llavors proveu de nou. Si encara falla, pot ser un procés git\n"
@@ -16631,21 +17253,17 @@ msgid "expected flush after ls-refs arguments"
msgstr "s'esperava una neteja després dels arguments ls-refs"
msgid "quoted CRLF detected"
-msgstr "CRLF citat detectat"
-
-#, c-format
-msgid ""
-"Your local changes to the following files would be overwritten by merge:\n"
-" %s"
-msgstr ""
-"Els canvis locals als fitxers següents se sobreescriuran per la fusió:\n"
-" %s"
+msgstr "CRLF entre cometes detectat"
#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "S'ha produït un error en fusionar el submòdul %s (no està agafat)"
#, c-format
+msgid "Failed to merge submodule %s (no merge base)"
+msgstr "S'ha produït un error en fusionar el submòdul %s (no hi ha fusió base)"
+
+#, c-format
msgid "Failed to merge submodule %s (commits not present)"
msgstr "S'ha produït un error en fusionar el submòdul %s (no hi ha comissions)"
@@ -16665,28 +17283,10 @@ msgstr "S'ha produït un error en fusionar el submòdul «%s»"
#, c-format
msgid ""
-"Failed to merge submodule %s, but a possible merge resolution exists:\n"
-"%s\n"
+"Failed to merge submodule %s, but a possible merge resolution exists: %s"
msgstr ""
"S'ha produït un error en fusionar el submòdul %s, però existeix una solució "
-"possible:\n"
-"%s\n"
-
-#, c-format
-msgid ""
-"If this is correct simply add it to the index for example\n"
-"by using:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"which will accept this suggestion.\n"
-msgstr ""
-"Si això és correcte simplement afegiu-ho a l'índex per exemple\n"
-"utilitzant:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s «%s»\n"
-"\n"
-"que acceptarà aquest suggeriment.\n"
+"possible: %s"
#, c-format
msgid ""
@@ -16697,12 +17297,12 @@ msgstr ""
"solucions possibles:\n"
"%s"
-msgid "Failed to execute internal merge"
-msgstr "S'ha produït un error en executar la fusió interna"
+msgid "failed to execute internal merge"
+msgstr "no s'ha pogut executar la fusió interna"
#, c-format
-msgid "Unable to add %s to database"
-msgstr "No s'ha pogut afegir %s a la base de dades"
+msgid "unable to add %s to database"
+msgstr "no s'ha pogut afegir %s a la base de dades"
#, c-format
msgid "Auto-merging %s"
@@ -16852,13 +17452,43 @@ msgstr ""
"CONFLICTE: (modificació/supressió): %s suprimit a %s i modificat a %s. La "
"versió %s de %s s'ha deixat en l'arbre."
+#. TRANSLATORS: This is a line of advice to resolve a merge
+#. conflict in a submodule. The first argument is the submodule
+#. name, and the second argument is the abbreviated id of the
+#. commit that needs to be merged. For example:
+#. - go to submodule (mysubmodule), and either merge commit abc1234"
+#.
#, c-format
msgid ""
-"Note: %s not up to date and in way of checking out conflicted version; old "
-"copy renamed to %s"
+" - go to submodule (%s), and either merge commit %s\n"
+" or update to an existing commit which has merged those changes\n"
msgstr ""
-"Nota: %s no està actualitzat i en forma de comprovar la versió en conflicte; "
-"còpia antiga reanomenada a %s"
+" - aneu al submòdul (%s), i fusioneu la comissió %s\n"
+" o actualitzeu-la a una comissió existent que ha fusionat aquests canvis\n"
+
+#, c-format
+msgid ""
+"Recursive merging with submodules currently only supports trivial cases.\n"
+"Please manually handle the merging of each conflicted submodule.\n"
+"This can be accomplished with the following steps:\n"
+"%s - come back to superproject and run:\n"
+"\n"
+" git add %s\n"
+"\n"
+" to record the above merge or update\n"
+" - resolve any other conflicts in the superproject\n"
+" - commit the resulting index in the superproject\n"
+msgstr ""
+"La fusió recursiva amb submòduls actualment només admet casos trivials.\n"
+"Si us plau, manegeu manualment la fusió de cada submòdul en conflicte.\n"
+"Això es pot aconseguir amb els passos següents:\n"
+"%s - torneu al superprojecte i executeu:\n"
+"\n"
+" git add %s\n"
+"\n"
+" per a enregistrar la fusió o actualització de dalt\n"
+" - resoleu qualsevol altre conflicte al superprojecte\n"
+" - publiqueu l'índex resultant al superprojecte\n"
#. TRANSLATORS: The %s arguments are: 1) tree hash of a merge
#. base, and 2-3) the trees for the two trees we're merging.
@@ -16933,6 +17563,22 @@ msgid "Found a possible merge resolution for the submodule:\n"
msgstr "S'ha trobat una possible resolució de fusió pel submòdul:\n"
#, c-format
+msgid ""
+"If this is correct simply add it to the index for example\n"
+"by using:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"which will accept this suggestion.\n"
+msgstr ""
+"Si això és correcte simplement afegiu-ho a l'índex per exemple\n"
+"utilitzant:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s «%s»\n"
+"\n"
+"que acceptarà aquest suggeriment.\n"
+
+#, c-format
msgid "Failed to merge submodule %s (multiple merges found)"
msgstr ""
"S'ha produït un error en fusionar el submòdul %s (s'han trobat múltiples "
@@ -17105,7 +17751,21 @@ msgid "failed to read the cache"
msgstr "s'ha produït un error en llegir la memòria cau"
msgid "multi-pack-index OID fanout is of the wrong size"
-msgstr "l'OID de l'índex multipaquet és d'una mida incorrecta"
+msgstr "l'OID «fanout» de l'índex multipaquet és d'una mida incorrecta"
+
+#, c-format
+msgid ""
+"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
+msgstr ""
+"oid «fanout» desordenat: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
+
+msgid "multi-pack-index OID lookup chunk is the wrong size"
+msgstr "El fragment de cerca OID índex multipaquet és de mida incorrecta"
+
+msgid "multi-pack-index object offset chunk is the wrong size"
+msgstr ""
+"el fragment de desplaçament de l'objecte índex multipaquet és d'una mida "
+"incorrecta"
#, c-format
msgid "multi-pack-index file %s is too small"
@@ -17123,19 +17783,31 @@ msgstr "no es reconeix la versió %d de l'índex multipaquet"
#, c-format
msgid "multi-pack-index hash version %u does not match version %u"
-msgstr "la versió del hash índex multipaquet %u no coincideix amb la versió %u"
+msgstr ""
+"la versió del resum índex multipaquet %u no coincideix amb la versió %u"
+
+msgid "multi-pack-index required pack-name chunk missing or corrupted"
+msgstr ""
+"manca o està malmès el fragment del nom de paquet requerit de l'índex "
+"multipaquet"
-msgid "multi-pack-index missing required pack-name chunk"
-msgstr "falta un fragment de nom de paquet necessari al multi-index"
+msgid "multi-pack-index required OID fanout chunk missing or corrupted"
+msgstr ""
+"manca o està malmès el fragment del «fanout» OID requerit a l'índex "
+"multipaquet"
-msgid "multi-pack-index missing required OID fanout chunk"
-msgstr "falta un fragment «fanout» OID necessari al multi-pack-index"
+msgid "multi-pack-index required OID lookup chunk missing or corrupted"
+msgstr ""
+"manca o està malmès el fragment de cerca d'OID necessari a l'índex "
+"multipaquet"
-msgid "multi-pack-index missing required OID lookup chunk"
-msgstr "falta un fragment de cerca «fanout» OID necessari al multi-pack-index"
+msgid "multi-pack-index required object offsets chunk missing or corrupted"
+msgstr ""
+"manca o està malmès el fragment de l'índex multipaquet dels objectes "
+"requerits"
-msgid "multi-pack-index missing required object offsets chunk"
-msgstr "falta un fragment necessari dels desplaçaments al multi-pack-index"
+msgid "multi-pack-index pack-name chunk is too short"
+msgstr "el fragment de nom de l'índex multipaquet és massa curt"
#, c-format
msgid "multi-pack-index pack names out of order: '%s' before '%s'"
@@ -17147,11 +17819,21 @@ msgstr ""
msgid "bad pack-int-id: %u (%u total packs)"
msgstr "pack-int-id: %u incorrecte (%u paquets en total)"
+msgid "MIDX does not contain the BTMP chunk"
+msgstr "MIDX no conté el fragment BTMP"
+
+#, c-format
+msgid "could not load bitmapped pack %<PRIu32>"
+msgstr "no s'ha pogut carregar el paquet amb bits %<PRIu32>"
+
msgid "multi-pack-index stores a 64-bit offset, but off_t is too small"
msgstr ""
"l'índex multipaquet emmagatzema un desplaçament de 64 bits, però off_t és "
"massa petit"
+msgid "multi-pack-index large offset out of bounds"
+msgstr "desplaçament gran de l'índex multipaquet està fora dels límits"
+
#, c-format
msgid "failed to add packfile '%s'"
msgstr "no s'ha pogut afegir el fitxer de paquet «%s»"
@@ -17232,11 +17914,6 @@ msgstr "suma de verificació incorrecta"
msgid "Looking for referenced packfiles"
msgstr "S'estan cercant fitxers empaquetats referenciats"
-#, c-format
-msgid ""
-"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
-msgstr "oid fanout desordenat: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
-
msgid "the midx contains no oid"
msgstr "el midx no conté cap oid"
@@ -17339,10 +18016,6 @@ msgstr ""
"%s: s'estan ignorant els emmagatzematges alternatius d'objectes, imbricació "
"massa profunda"
-#, c-format
-msgid "unable to normalize object directory: %s"
-msgstr "no s'ha pogut normalitzar el directori de l'objecte: %s"
-
msgid "unable to fdopen alternates lockfile"
msgstr "no s'ha pogut fer «fdopen» al fitxer de bloqueig alternatiu"
@@ -17403,6 +18076,10 @@ msgid "garbage at end of loose object '%s'"
msgstr "brossa al final de l'objecte solt «%s»"
#, c-format
+msgid "unable to open loose object %s"
+msgstr "no s'ha pogut obrir l'objecte solt %s"
+
+#, c-format
msgid "unable to parse %s header"
msgstr "no s'ha pogut analitzar la capçalera %s"
@@ -17418,18 +18095,14 @@ msgid "header for %s too long, exceeds %d bytes"
msgstr "la capçalera per a %s és massa llarga, supera els %d bytes"
#, c-format
-msgid "failed to read object %s"
-msgstr "s'ha produït un error en llegir l'objecte %s"
+msgid "loose object %s (stored in %s) is corrupt"
+msgstr "l'objecte solt %s (emmagatzemat a %s) és corrupte"
#, c-format
msgid "replacement %s not found for %s"
msgstr "no s'ha trobat el reemplaçament %s per a %s"
#, c-format
-msgid "loose object %s (stored in %s) is corrupt"
-msgstr "l'objecte solt %s (emmagatzemat a %s) és corrupte"
-
-#, c-format
msgid "packed object %s (stored in %s) is corrupt"
msgstr "l'objecte empaquetat %s (emmagatzemat a %s) és corrupte"
@@ -17441,9 +18114,6 @@ msgstr "no s'ha pogut escriure al fitxer %s"
msgid "unable to set permission to '%s'"
msgstr "no s'ha pogut establir el permís a «%s»"
-msgid "file write error"
-msgstr "s'ha produït un error en escriure al fitxer"
-
msgid "error when closing loose object file"
msgstr "error en tancar el fitxer d'objecte solt"
@@ -17472,14 +18142,31 @@ msgid "confused by unstable object source data for %s"
msgstr "confós per la font de dades inestable de l'objecte per a %s"
#, c-format
+msgid "write stream object %ld != %<PRIuMAX>"
+msgstr "escriu l'objecte de flux %ld != %<PRIuMAX>"
+
+#, c-format
+msgid "unable to stream deflate new object (%d)"
+msgstr "no s'ha pogut desinflar l'object nou (%d)"
+
+#, c-format
+msgid "deflateEnd on stream object failed (%d)"
+msgstr "ha fallat deflateEnd a l'objecte del flux (%d)"
+
+#, c-format
+msgid "unable to create directory %s"
+msgstr "s'ha produït un error en crear el directori %s"
+
+#, c-format
msgid "cannot read object for %s"
msgstr "no es pot llegir l'objecte per a %s"
-msgid "corrupt commit"
-msgstr "comissió corrupta"
+#, c-format
+msgid "object fails fsck: %s"
+msgstr "l'objecte ha fallat fsck: %s"
-msgid "corrupt tag"
-msgstr "etiqueta corrupta"
+msgid "refusing to create malformed object"
+msgstr "es rebutja crear un objecte mal format"
#, c-format
msgid "read error while indexing %s"
@@ -17507,7 +18194,7 @@ msgstr "no s'ha pogut obrir %s"
#, c-format
msgid "hash mismatch for %s (expected %s)"
-msgstr "no coincideix la suma per a %s (s'esperava %s)"
+msgstr "no coincideix el resum per a %s (s'esperava %s)"
#, c-format
msgid "unable to mmap %s"
@@ -17674,7 +18361,7 @@ msgstr ""
#, c-format
msgid "<object>:<path> required, only <object> '%s' given"
-msgstr "<object>:<path> requerit, només s'ha donat <object> «%s»"
+msgstr "<objecte>:<camí> requerit, només s'ha donat <objecte> «%s»"
#, c-format
msgid "invalid object name '%.*s'."
@@ -17700,40 +18387,158 @@ msgstr "no s'ha pogut analitzar l'objecte: %s"
msgid "hash mismatch %s"
msgstr "el resum no coincideix %s"
+msgid "trying to write commit not in index"
+msgstr "s'està intentant no escriure la comissió a l'índex"
+
+msgid "failed to load bitmap index (corrupted?)"
+msgstr ""
+"s'ha produït un error en carregar l'índex de mapa de bits (està malmès?)"
+
+msgid "corrupted bitmap index (too small)"
+msgstr "índex de mapa de bits malmès (massa petit)"
+
+msgid "corrupted bitmap index file (wrong header)"
+msgstr "fitxer d'índex de mapa de bits malmès (capçalera incorrecta)"
+
+#, c-format
+msgid "unsupported version '%d' for bitmap index file"
+msgstr "versió «%d» no admesa per al fitxer d'índex de mapa de bits"
+
+msgid "corrupted bitmap index file (too short to fit hash cache)"
+msgstr ""
+"fitxer d'índex de mapa de bits malmès (massa curt per a ajustar-se a la "
+"memòria cau de hash)"
+
+msgid "corrupted bitmap index file (too short to fit lookup table)"
+msgstr ""
+"fitxer d'índex de mapa de bits malmès (massa curt per a ajustar-se a la "
+"taula de cerca)"
+
+#, c-format
+msgid "duplicate entry in bitmap index: '%s'"
+msgstr "entrada duplicada a l'índex del mapa de bits: «%s»"
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for entry %d"
+msgstr "mapa de bits ewah malmès: capçalera truncada per a l'entrada %d"
+
+#, c-format
+msgid "corrupt ewah bitmap: commit index %u out of range"
+msgstr "mapa de bits ewah malmès: l'índex de comissió %u està fora de rang"
+
+msgid "corrupted bitmap pack index"
+msgstr "índex de paquets de mapa de bits malmès"
+
+msgid "invalid XOR offset in bitmap pack index"
+msgstr "el desplaçament XOR a l'índex de mapa de bits no és vàlid"
+
+msgid "cannot fstat bitmap file"
+msgstr "no es pot fer fstat en el fitxer de mapa de bits"
+
+msgid "checksum doesn't match in MIDX and bitmap"
+msgstr "la suma de verificació no coincideix amb el MIDX i el mapa de bits"
+
msgid "multi-pack bitmap is missing required reverse index"
msgstr "falta l'índex invers necessari al mapa de bits multipaquet"
-#, fuzzy, c-format
+#, c-format
msgid "could not open pack %s"
-msgstr "no s'ha pogut obrir «%s»"
+msgstr "no s'ha pogut obrir el paquet %s"
+
+msgid "could not determine MIDX preferred pack"
+msgstr "no s'ha pogut determinar el paquet preferit MIDX"
-#, fuzzy, c-format
+#, c-format
msgid "preferred pack (%s) is invalid"
-msgstr "el paquet preferit «%s» ha caducat"
+msgstr "el paquet preferit (%s) no és vàlid"
+
+msgid "corrupt bitmap lookup table: triplet position out of index"
+msgstr ""
+"taula de cerca de mapa de bits malmesa: posició la tripleta fora de l'índex"
+
+msgid "corrupt bitmap lookup table: xor chain exceeds entry count"
+msgstr ""
+"taula de cerca de mapa de bits malmesa: la cadena xor excedeix el nombre "
+"d'entrades"
+
+#, c-format
+msgid "corrupt bitmap lookup table: commit index %u out of range"
+msgstr ""
+"taula de cerca de mapa de bits malmesa: l'índex de comissió %u està fora de "
+"rang"
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for bitmap of commit \"%s\""
+msgstr ""
+"mapa de bits ewah malmès: capçalera truncada per al mapa de bits de la "
+"comissió «%s»"
+
+#, c-format
+msgid "unable to load pack: '%s', disabling pack-reuse"
+msgstr ""
+"no s'ha pogut carregar el paquet: «%s», s'està inhabilitant lareutilització "
+"de paquets"
+
+#, c-format
+msgid "object '%s' not found in type bitmaps"
+msgstr "no s'ha trobat l'objecte «%s» als tipus de mapes de bits"
#, c-format
-msgid "could not find %s in pack %s at offset %<PRIuMAX>"
-msgstr "no s'ha pogut trobar %s al paquet %s al desplaçament %<PRIuMAX>"
+msgid "object '%s' does not have a unique type"
+msgstr "l'objecte «%s» no té un tipus únic"
+
+#, c-format
+msgid "object '%s': real type '%s', expected: '%s'"
+msgstr "objecte «%s»: tipus real «%s», s'esperava: «%s»"
+
+#, c-format
+msgid "object not in bitmap: '%s'"
+msgstr "objecte no trobat al mapa de bits: «%s»"
+
+msgid "failed to load bitmap indexes"
+msgstr "s'ha produït un error en carregar l'índex de mapa de bits"
-#, fuzzy, c-format
+msgid "you must specify exactly one commit to test"
+msgstr "heu d'especificar exactament una comissió a provar"
+
+#, c-format
+msgid "commit '%s' doesn't have an indexed bitmap"
+msgstr "la comissió «%s» no té un mapa de bits indexat"
+
+msgid "mismatch in bitmap results"
+msgstr "no coincideix en els resultats del mapa de bits"
+
+#, c-format
+msgid "could not find '%s' in pack '%s' at offset %<PRIuMAX>"
+msgstr "no s'ha pogut trobar «%s» al paquet «%s» al desplaçament %<PRIuMAX>"
+
+#, c-format
+msgid "unable to get disk usage of '%s'"
+msgstr "no s'ha pogut obtenir l'ús del disc de «%s»"
+
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "el fitxer de mapa de bits «%s» té una suma de verificació no vàlida"
+
+#, c-format
msgid "mtimes file %s is too small"
-msgstr "el fitxer de l'índex multipaquet %s és massa petit"
+msgstr "el fitxer mtimes %s és massa petit"
-#, fuzzy, c-format
+#, c-format
msgid "mtimes file %s has unknown signature"
-msgstr "el fitxer d'índex invers %s té una signatura desconeguda"
+msgstr "el fitxer mtimes %s té una signatura desconeguda"
-#, fuzzy, c-format
+#, c-format
msgid "mtimes file %s has unsupported version %<PRIu32>"
-msgstr "el fitxer d'índex invers %s té la versió %<PRIu32> no admesa"
+msgstr "el fitxer mtimes %s té la versió %<PRIu32> no admesa"
-#, fuzzy, c-format
+#, c-format
msgid "mtimes file %s has unsupported hash id %<PRIu32>"
-msgstr "el fitxer d'índex invers %s té un ID de resum %<PRIu32> no admès"
+msgstr "el fitxer mtimes %s té un ID de resum %<PRIu32> no admès"
-#, fuzzy, c-format
+#, c-format
msgid "mtimes file %s is corrupt"
-msgstr "el fitxer d'índex invers %s està malmès"
+msgstr "el fitxer mtimes %s està malmès"
#, c-format
msgid "reverse-index file %s is too small"
@@ -17755,6 +18560,21 @@ msgstr "el fitxer d'índex invers %s té la versió %<PRIu32> no admesa"
msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
msgstr "el fitxer d'índex invers %s té un ID de resum %<PRIu32> no admès"
+msgid "invalid checksum"
+msgstr "suma de verificació no vàlida"
+
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr ""
+"posició no vàlida de l'índex de reversió a %<PRIu64>: %<PRIu32> != %<PRIu32>"
+
+msgid "multi-pack-index reverse-index chunk is the wrong size"
+msgstr ""
+"el fragment de l'index invers de l'índex multipaquet és de mida incorrecta"
+
+msgid "could not determine preferred pack"
+msgstr "no s'ha pogut determinar el paquet preferit"
+
msgid "cannot both write and verify reverse index"
msgstr "no es pot escriure i verificar l'índex invers"
@@ -17808,14 +18628,6 @@ msgid "%s requires a value"
msgstr "%s requereix un valor"
#, c-format
-msgid "%s is incompatible with %s"
-msgstr "%s és incompatible amb %s"
-
-#, c-format
-msgid "%s : incompatible with something else"
-msgstr "%s: és incompatible amb alguna altra cosa"
-
-#, c-format
msgid "%s takes no value"
msgstr "%s no accepta cap valor"
@@ -17839,6 +18651,9 @@ msgstr "voleu dir «--%s» (amb dos guionets)?"
msgid "alias of --%s"
msgstr "àlies de --%s"
+msgid "need a subcommand"
+msgstr "cal una subordre"
+
#, c-format
msgid "unknown option `%s'"
msgstr "opció desconeguda «%s»"
@@ -17895,6 +18710,10 @@ msgstr " %s"
msgid "-NUM"
msgstr "-NUM"
+#, c-format
+msgid "opposite of --no-%s"
+msgstr "oposat a --no-%s"
+
msgid "expiry-date"
msgstr "data-de-caducitat"
@@ -17910,6 +18729,9 @@ msgstr "sigues més discret"
msgid "use <n> digits to display object names"
msgstr "usa <n> xifres per a mostrar els noms d'objecte"
+msgid "prefixed path to initial superproject"
+msgstr "camí prefixat al superprojecte inicial"
+
msgid "how to strip spaces and #comments from message"
msgstr "com suprimir els espais i #comentaris del missatge"
@@ -17923,6 +18745,14 @@ msgstr ""
"separats amb el caràcter NUL"
#, c-format
+msgid "bad boolean environment value '%s' for '%s'"
+msgstr "el valor «%s» booleà de l'entorn és incorrecte per a «%s»"
+
+#, c-format
+msgid "failed to parse %s"
+msgstr "s'ha produït un error en analitzar %s"
+
+#, c-format
msgid "Could not make %s writable by group"
msgstr "No s'ha pogut fer %s escrivible pel grup"
@@ -17973,6 +18803,10 @@ msgid "%s: 'literal' and 'glob' are incompatible"
msgstr "%s: «literal» i «glob» són incompatibles"
#, c-format
+msgid "'%s' is outside the directory tree"
+msgstr "«%s» és fora de l'arbre de directoris"
+
+#, c-format
msgid "%s: '%s' is outside repository at '%s'"
msgstr "%s: «%s» està fora del repositori en «%s»"
@@ -17991,7 +18825,7 @@ msgstr "l'especificació de camí «%s» és més enllà d'un enllaç simbòlic"
#, c-format
msgid "line is badly quoted: %s"
-msgstr "la línia està mal citada: %s"
+msgstr "la línia no està ben envoltada per cometes: %s"
msgid "unable to write flush packet"
msgstr "no s'ha pogut escriure el paquet de buidatge"
@@ -18061,6 +18895,10 @@ msgstr "promisor-remote: no s'ha pogut tancar stdin al subprocés d'obtenció"
msgid "promisor remote name cannot begin with '/': %s"
msgstr "el nom remot «promisor» no pot començar amb «/»: %s"
+#, c-format
+msgid "could not fetch %s from promisor remote"
+msgstr "no s'ha pogut obtenir «%s» del «promisor» remot"
+
msgid "object-info: expected flush after arguments"
msgstr "object-info: s'esperava una neteja després dels arguments"
@@ -18097,6 +18935,13 @@ msgid "could not parse log for '%s'"
msgstr "no s'ha pogut llegir el fitxer de registre per a «%s»"
#, c-format
+msgid "invalid extra cruft tip: '%s'"
+msgstr "punta extra extra no vàlida: «%s»"
+
+msgid "unable to enumerate additional recent objects"
+msgstr "no s'han pogut enumerar els objectes recents addicionals"
+
+#, c-format
msgid "will not add file alias '%s' ('%s' already exists in index)"
msgstr "no s'afegirà l'àlies «%s»: («%s» ja existeix en l'índex)"
@@ -18117,10 +18962,6 @@ msgid "unable to add '%s' to index"
msgstr "no s'ha pogut afegir «%s» a l'índex"
#, c-format
-msgid "unable to stat '%s'"
-msgstr "no s'ha pogut fer «stat» a «%s»"
-
-#, c-format
msgid "'%s' appears as both a file and as a directory"
msgstr "«%s» apareix com a fitxer i com a directori"
@@ -18228,10 +19069,6 @@ msgid "failed to convert to a sparse-index"
msgstr "s'ha produït un error en convertir a un índex dispers"
#, c-format
-msgid "could not stat '%s'"
-msgstr "no s'ha pogut fer stat a «%s»"
-
-#, c-format
msgid "unable to open git dir: %s"
msgstr "no s'ha pogut obrir el directori git: %s"
@@ -18247,6 +19084,14 @@ msgstr "no s'han pogut corregir els bits de permisos en «%s»"
msgid "%s: cannot drop to stage #0"
msgstr "%s: no es pot baixar fins al «stage» #0"
+#, c-format
+msgid "unexpected diff status %c"
+msgstr "estat de diff inesperat %c"
+
+#, c-format
+msgid "remove '%s'\n"
+msgstr "elimina «%s»\n"
+
msgid ""
"You can fix this with 'git rebase --edit-todo' and then run 'git rebase --"
"continue'.\n"
@@ -18280,9 +19125,12 @@ msgid ""
"l, label <label> = label current HEAD with a name\n"
"t, reset <label> = reset HEAD to a label\n"
"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
-". create a merge commit using the original merge commit's\n"
-". message (or the oneline, if no original merge commit was\n"
-". specified); use -c <commit> to reword the commit message\n"
+" create a merge commit using the original merge commit's\n"
+" message (or the oneline, if no original merge commit was\n"
+" specified); use -c <commit> to reword the commit message\n"
+"u, update-ref <ref> = track a placeholder for the <ref> to be updated\n"
+" to this position in the new commits. The <ref> is\n"
+" updated at the end of the rebase\n"
"\n"
"These lines can be re-ordered; they are executed from top to bottom.\n"
msgstr ""
@@ -18293,7 +19141,8 @@ msgstr ""
"e, edit <comissió> = usa la comissió, però atura't per a esmenar-la\n"
"s, squash <comissió> = usa la comissió, però fusiona-la a la comissió "
"prèvia\n"
-"f, fixup [-C | -c] <commit> = com a «squash», però manté només el missatge\n"
+"f, fixup [-C | -c] <comissió> = com a «squash», però manté només el "
+"missatge\n"
" de comissió previ, a menys que s'usi -C, en aquest cas\n"
" manté només el missatge d'aquesta comissió; -c és el "
"mateix\n"
@@ -18306,11 +19155,16 @@ msgstr ""
"l, label <etiqueta> = etiqueta la HEAD actual amb un nom\n"
"t, reset <etiqueta> = reinicia HEAD a una etiqueta\n"
"m, merge [-C <comissió> | -c <comissió>] <etiqueta> [# <oneline>]\n"
-". crea una comissió de fusió usant el missatge de la comissió\n"
-". de fusió original (o línia única, si no hi ha cap comissió de fusió "
+" crea una comissió de fusió usant el missatge de la comissió de fusió "
"original\n"
-". especificada). Useu -c <comissió> per a reescriure el missatge de la "
-"comissió.\n"
+" (o línia única, si no hi ha cap comissió de fusió original "
+"especificada).\n"
+" Useu -c <comissió> per a reescriure el missatge de la comissió.\n"
+"u, update-ref <ref> = segueix un marcador de posició per a actualitzar "
+"<ref>\n"
+" a aquesta posició en les comissions noves. La <ref> "
+"s'actualitza\n"
+" al final del «rebase»\n"
"\n"
"Es pot canviar l'ordre d'aquestes línies; s'executen de dalt a baix.\n"
@@ -18354,7 +19208,7 @@ msgid ""
"\n"
msgstr ""
"\n"
-"No obstant, si elimineu tot, s'avortarà el «rebase».\n"
+"No obstant això, si elimineu tot, s'avortarà el «rebase».\n"
"\n"
#, c-format
@@ -18406,6 +19260,14 @@ msgid "ahead %d, behind %d"
msgstr "davant per %d, darrere per %d"
#, c-format
+msgid "%%(%.*s) does not take arguments"
+msgstr "%%(%.*s) no accepta arguments"
+
+#, c-format
+msgid "unrecognized %%(%.*s) argument: %s"
+msgstr "argument %%(%.*s) desconegut: %s"
+
+#, c-format
msgid "expected format: %%(color:<color>)"
msgstr "format esperat: %%(color:<color>)"
@@ -18422,42 +19284,38 @@ msgid "Integer value expected refname:rstrip=%s"
msgstr "Valor enter esperat pel nom de referència:rstrip=%s"
#, c-format
-msgid "unrecognized %%(%s) argument: %s"
-msgstr "argument %%(%s) desconegut: %s"
+msgid "expected %%(trailers:key=<value>)"
+msgstr "s'esperava %%(trailers:key=<value>)"
#, c-format
-msgid "%%(objecttype) does not take arguments"
-msgstr "%%(objecttype) no accepta arguments"
+msgid "unknown %%(trailers) argument: %s"
+msgstr "argument %%(trailers) desconegut: %s"
#, c-format
-msgid "%%(deltabase) does not take arguments"
-msgstr "%%(deltabase) no accepta arguments"
+msgid "positive value expected contents:lines=%s"
+msgstr "valor positiu esperat conté:lines=%s"
#, c-format
-msgid "%%(body) does not take arguments"
-msgstr "%%(body) no accepta arguments"
+msgid "argument expected for %s"
+msgstr "s'esperava un argument per a %s"
#, c-format
-msgid "expected %%(trailers:key=<value>)"
-msgstr "s'esperava %%(trailers:key=<value>)"
+msgid "positive value expected %s=%s"
+msgstr "valor positiu esperat %s=%s"
#, c-format
-msgid "unknown %%(trailers) argument: %s"
-msgstr "argument %%(trailers) desconegut: %s"
+msgid "cannot fully parse %s=%s"
+msgstr "no es pot analitzar completament %s=%s"
#, c-format
-msgid "positive value expected contents:lines=%s"
-msgstr "valor positiu esperat conté:lines=%s"
+msgid "value expected %s="
+msgstr "s'esperava un valor %s="
#, c-format
msgid "positive value expected '%s' in %%(%s)"
msgstr "valor positiu esperat «%s» a %%(%s)"
#, c-format
-msgid "unrecognized email option: %s"
-msgstr "opció del correu electrònic no reconeguda: «%s»"
-
-#, c-format
msgid "expected format: %%(align:<width>,<position>)"
msgstr "format esperat: %%(align:<amplada>,<posició>)"
@@ -18470,12 +19328,16 @@ msgid "unrecognized width:%s"
msgstr "amplada no reconeguda:%s"
#, c-format
+msgid "unrecognized %%(%s) argument: %s"
+msgstr "argument %%(%s) desconegut: %s"
+
+#, c-format
msgid "positive width expected with the %%(align) atom"
msgstr "amplada positiva esperada amb l'àtom %%(align)"
#, c-format
-msgid "%%(rest) does not take arguments"
-msgstr "%%(rest) no accepta arguments"
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "format esperat: %%(ahead-behind:<committish>)"
#, c-format
msgid "malformed field name: %.*s"
@@ -18524,6 +19386,9 @@ msgstr "aquesta ordre rebutja l'àtom %%(%.*s)"
msgid "--format=%.*s cannot be used with --python, --shell, --tcl"
msgstr "no es pot usar --format=%.*s amb --python, --shell, --tcl"
+msgid "failed to run 'describe'"
+msgstr "no s'ha pogut executar «describe»"
+
#, c-format
msgid "(no branch, rebasing %s)"
msgstr "(sense branca, s'està fent «rebase» %s)"
@@ -18585,6 +19450,9 @@ msgstr "clau"
msgid "field name to sort on"
msgstr "nom del camp en el qual ordenar"
+msgid "exclude refs which match pattern"
+msgstr "exclou refs que coincideixin amb el patró"
+
#, c-format
msgid "not a reflog: %s"
msgstr "no és un registre de referència: %s"
@@ -18675,10 +19543,6 @@ msgid "cannot process '%s' and '%s' at the same time"
msgstr "no es poden processar «%s» i «%s» a la vegada"
#, c-format
-msgid "could not remove reference %s"
-msgstr "no s'ha pogut eliminar la referència %s"
-
-#, c-format
msgid "could not delete reference %s: %s"
msgstr "no s'ha pogut suprimir la referència %s: %s"
@@ -18786,6 +19650,14 @@ msgstr "error de protocol: s'esperava sha/ref, s'ha obtingut «%s»"
msgid "http transport does not support %s"
msgstr "El transport http no admet %s"
+msgid "protocol error: expected '<url> <path>', missing space"
+msgstr ""
+"s'ha produït un error de protocol: s'esperava «<url> <camí>», falta espai"
+
+#, c-format
+msgid "failed to download file at URL '%s'"
+msgstr "no s'ha pogut baixar el fitxer a l'URL «%s»"
+
msgid "git-http-push failed"
msgstr "git-http-push ha fallat"
@@ -18796,7 +19668,7 @@ msgid "remote-curl: error reading command stream from git"
msgstr "remote-curl: error en llegir el flux d'ordres del git"
msgid "remote-curl: fetch attempted without a local repo"
-msgstr "remote-curl: s'ha intentat l'obtenció sense un dipòsit local"
+msgstr "remote-curl: s'ha intentat l'obtenció sense un repositori local"
#, c-format
msgid "remote-curl: unknown command '%s' from git"
@@ -18813,13 +19685,13 @@ msgstr "més d'un paquet de recepció donat, usant el primer"
msgid "more than one uploadpack given, using the first"
msgstr "més d'un paquet de càrrega donat, usant el primer"
-#, fuzzy, c-format
+#, c-format
msgid "unrecognized value transfer.credentialsInUrl: '%s'"
-msgstr "patró no reconegut: «%s»"
+msgstr "valor no conegut per a transfer.credentialsInUrl: «%s»"
#, c-format
msgid "URL '%s' uses plaintext credentials"
-msgstr ""
+msgstr "L'URL «%s» utilitza credencials en text pla"
#, c-format
msgid "Cannot fetch both %s and %s to %s"
@@ -18843,12 +19715,12 @@ msgstr "el valor «%s» del patró no té «*»"
#, c-format
msgid "src refspec %s does not match any"
-msgstr "l'especificació de referència src %s no coincideix amb cap referència"
+msgstr "l'especificació de referència font %s no coincideix amb cap referència"
#, c-format
msgid "src refspec %s matches more than one"
msgstr ""
-"l'especificació de referència de src %s coincideix amb més d'una referència"
+"l'especificació de referència de font %s coincideix amb més d'una referència"
#. TRANSLATORS: "matches '%s'%" is the <dst> part of "git push
#. <remote> <src>:<dst>" push, and "being pushed ('%s')" is
@@ -18894,7 +19766,7 @@ msgid ""
"'%s:refs/tags/%s'?"
msgstr ""
"La part <src> de l'especificació de la referència és un objecte d'etiqueta.\n"
-"Voleu crear una etiqueta pujant-la a «%srefs/tags/%s»?"
+"Voleu crear una etiqueta pujant-la a «%s:refs/tags/%s»?"
#, c-format
msgid ""
@@ -18903,7 +19775,7 @@ msgid ""
"'%s:refs/tags/%s'?"
msgstr ""
"La part <src> de l'especificació de la referència és un objecte d'arbre.\n"
-"Voleu crear una etiqueta pujant-la a «%srefs/tags/%s»?"
+"Voleu crear una etiqueta pujant-la a «%s:refs/tags/%s»?"
#, c-format
msgid ""
@@ -19030,8 +19902,10 @@ msgstr[1] ""
"La vostra branca i «%s» han divergit,\n"
"i tenen %d i %d comissions distintes cada una, respectivament.\n"
-msgid " (use \"git pull\" to merge the remote branch into yours)\n"
-msgstr " (useu «git pull» per a fusionar la branca remota amb la vostra)\n"
+msgid ""
+" (use \"git pull\" if you want to integrate the remote branch with yours)\n"
+msgstr ""
+" (utilitzeu «git pull» si voleu integrar la branca remota amb la vostra)\n"
#, c-format
msgid "cannot parse expected object name '%s'"
@@ -19104,10 +19978,6 @@ msgid "no remembered resolution for '%s'"
msgstr "no hi ha cap resolució recordada per a «%s»"
#, c-format
-msgid "cannot unlink '%s'"
-msgstr "no es pot fer «unlink» de «%s»"
-
-#, c-format
msgid "Updated preimage for '%s'"
msgstr "Imatge prèvia actualitzada per a «%s»"
@@ -19129,9 +19999,28 @@ msgstr "no s'ha pogut determinar la revisió de HEAD"
msgid "failed to find tree of %s"
msgstr "s'ha produït un error en cercar l'arbre de %s"
+#, c-format
+msgid "unsupported section for hidden refs: %s"
+msgstr "secció d'índex no compatible per a les referències ocultes: %s"
+
+msgid "--exclude-hidden= passed more than once"
+msgstr "--exclude-hidden= passat més d'una vegada"
+
+#, c-format
+msgid "resolve-undo records `%s` which is missing"
+msgstr "resolve-undo indica «%s» que manquen"
+
+#, c-format
+msgid "could not get commit for ancestry-path argument %s"
+msgstr "no s'ha pogut obtenir la comissió per a l'argument d'ancestry-path %s"
+
msgid "--unpacked=<packfile> no longer supported"
msgstr "--unpacked=<packfile> ja no s'admet"
+#, c-format
+msgid "invalid option '%s' in --stdin mode"
+msgstr "opció no vàlida: «%s» en mode --stdin"
+
msgid "your current branch appears to be broken"
msgstr "la vostra branca actual sembla malmesa"
@@ -19149,6 +20038,205 @@ msgstr "-L no és encara compatible amb formats que no siguin «-p» o «-s»"
msgid "cannot create async thread: %s"
msgstr "no s'ha pogut crear fil «async»: %s"
+#, c-format
+msgid "'%s' does not exist"
+msgstr "«%s» no existeix"
+
+#, c-format
+msgid "could not switch to '%s'"
+msgstr "no s'ha pogut commutar a «%s»"
+
+msgid "need a working directory"
+msgstr "cal un directori de treball"
+
+msgid "Scalar enlistments require a worktree"
+msgstr "Els allistaments escalars requereixen un arbre de treball"
+
+#, c-format
+msgid "could not configure %s=%s"
+msgstr "no s'ha pogut configurar %s=%s"
+
+msgid "could not configure log.excludeDecoration"
+msgstr "no s'ha pogut configurar log.excludeDecoration"
+
+msgid "could not add enlistment"
+msgstr "no s'ha afegit a l'allistament"
+
+msgid "could not set recommended config"
+msgstr "no s'ha pogut establir la configuració recomanada"
+
+msgid "could not turn on maintenance"
+msgstr "no s'ha pogut activar el manteniment"
+
+msgid "could not start the FSMonitor daemon"
+msgstr "no s'ha pogut iniciar el dimoni del fsmonitor"
+
+msgid "could not turn off maintenance"
+msgstr "no s'ha pogut desactivar el manteniment"
+
+msgid "could not remove enlistment"
+msgstr "no s'ha pogut eliminar l'allistament"
+
+#, c-format
+msgid "remote HEAD is not a branch: '%.*s'"
+msgstr "la HEAD remota no és una branca: «%.*s»"
+
+msgid "failed to get default branch name from remote; using local default"
+msgstr ""
+"no s'ha pogut obtenir el nom de la branca per defecte del remot; s'usa ela "
+"predeterminada localment"
+
+msgid "failed to get default branch name"
+msgstr "s'ha produït un error en obtenir el nom de branca predeterminada"
+
+msgid "failed to unregister repository"
+msgstr "s'ha produït un error en desregistrar el repositori"
+
+msgid "failed to stop the FSMonitor daemon"
+msgstr "no s'ha pogut aturar el dimoni del FSMonitor"
+
+msgid "failed to delete enlistment directory"
+msgstr "s'ha produït un error en suprimir l'allistament del directori"
+
+msgid "branch to checkout after clone"
+msgstr "branca a agafar després de clonar"
+
+msgid "when cloning, create full working directory"
+msgstr "quan es clona, crear un directori de treball complet"
+
+msgid "only download metadata for the branch that will be checked out"
+msgstr "només baixa les metadades per a la branca que s'agafarà"
+
+msgid "create repository within 'src' directory"
+msgstr "crea un repositori dins del directori «src»"
+
+msgid ""
+"scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n"
+"\t[--[no-]src] <url> [<enlistment>]"
+msgstr ""
+"scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n"
+"\t[--[no-]src] <url> [<enlistment>]"
+
+#, c-format
+msgid "cannot deduce worktree name from '%s'"
+msgstr "no es pot deduir el nom de l'arbre de treball de «%s»"
+
+#, c-format
+msgid "directory '%s' exists already"
+msgstr "el directori «%s» ja existeix"
+
+#, c-format
+msgid "failed to get default branch for '%s'"
+msgstr "s'ha produït un error en obtenir la branca per defecte per a «%s»"
+
+#, c-format
+msgid "could not configure remote in '%s'"
+msgstr "no s'ha pogut configurar el remot a «%s»"
+
+#, c-format
+msgid "could not configure '%s'"
+msgstr "no s'ha pogut configurar «%s»"
+
+msgid "partial clone failed; attempting full clone"
+msgstr "ha fallat la clonació parcial; s'està intentant la clonació completa"
+
+msgid "could not configure for full clone"
+msgstr "no s'ha pogut configurar per a una clonació completa"
+
+msgid "scalar diagnose [<enlistment>]"
+msgstr "scalar diagnose [<enlistment>]"
+
+msgid "`scalar list` does not take arguments"
+msgstr "«scalar list» no accepta arguments"
+
+msgid "scalar register [<enlistment>]"
+msgstr "scalar register [<enlistment>]"
+
+msgid "reconfigure all registered enlistments"
+msgstr "reconfigura tots els allistaments registrats"
+
+msgid "scalar reconfigure [--all | <enlistment>]"
+msgstr "scalar reconfigure [--all | <enlistment>]"
+
+msgid "--all or <enlistment>, but not both"
+msgstr "--all o <enlistment>, però no ambdós"
+
+#, c-format
+msgid "could not remove stale scalar.repo '%s'"
+msgstr "no s'ha pogut suprimir el scalar.repo «%s» estancat"
+
+#, c-format
+msgid "removed stale scalar.repo '%s'"
+msgstr "s'ha eliminat l'scalar.repo estancat «%s»"
+
+#, c-format
+msgid "repository at '%s' has different owner"
+msgstr "el dipòsit a «%s» té un propietari diferent"
+
+#, c-format
+msgid "repository at '%s' has a format issue"
+msgstr "el dipòsit a «%s» té un problema de format"
+
+#, c-format
+msgid "repository not found in '%s'"
+msgstr "no s'ha trobat el dipòsit a «%s»"
+
+#, c-format
+msgid ""
+"to unregister this repository from Scalar, run\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+msgstr ""
+"per a desregistrar aquest dipòsit de l'escalar, executeu\n"
+"\tgit config --global --unset --fixed-value scalar.repo «%s»"
+
+msgid ""
+"scalar run <task> [<enlistment>]\n"
+"Tasks:\n"
+msgstr ""
+"scalar run <task> {<enlistment>]\n"
+"Tasques:\n"
+
+#, c-format
+msgid "no such task: '%s'"
+msgstr "no existeix la tasca: «%s»"
+
+msgid "scalar unregister [<enlistment>]"
+msgstr "scalar unregister [<enlistment>]"
+
+msgid "scalar delete <enlistment>"
+msgstr "supressió de l'escalar <enlistment>"
+
+msgid "refusing to delete current working directory"
+msgstr "s'ha rebutjat suprimir el directori de treball actual"
+
+msgid "include Git version"
+msgstr "inclou la versió del Git"
+
+msgid "include Git's build options"
+msgstr "inclou les opcions de construcció del Git"
+
+msgid "scalar verbose [-v | --verbose] [--build-options]"
+msgstr "scalar verbose [-v | --verbose] [--build-options]"
+
+msgid "-C requires a <directory>"
+msgstr "-C requereix un <directory>"
+
+#, c-format
+msgid "could not change to '%s'"
+msgstr "no s'ha pogut canviar a «%s»"
+
+msgid "-c requires a <key>=<value> argument"
+msgstr "-c requereix un argument <key>=<value>"
+
+msgid ""
+"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
+"\n"
+"Commands:\n"
+msgstr ""
+"scalar [-C <directory>] [-c <key>=<value>] <command> [<opcions>]\n"
+"\n"
+"Ordres:\n"
+
msgid "unexpected flush packet while reading remote unpack status"
msgstr ""
"paquet de buidatge no esperat quan estava llegint l'estat del "
@@ -19174,7 +20262,7 @@ msgstr ""
"l'empenta"
msgid "the receiving end does not support this repository's hash algorithm"
-msgstr "el receptor de destí no admet l'algorisme de hash del repositori"
+msgstr "el receptor de destí no admet l'algorisme de resum del repositori"
msgid "the receiving end does not support --signed push"
msgstr "el destí receptor no admet pujar --signed"
@@ -19255,10 +20343,6 @@ msgid "could not lock '%s'"
msgstr "no s'ha pogut bloquejar «%s»"
#, c-format
-msgid "could not write to '%s'"
-msgstr "no s'ha pogut escriure a «%s»"
-
-#, c-format
msgid "could not write eol to '%s'"
msgstr "no s'ha pogut escriure el terminador de línia a «%s»"
@@ -19273,10 +20357,6 @@ msgstr "els vostres canvis locals se sobreescriurien per %s."
msgid "commit your changes or stash them to proceed."
msgstr "cometeu els vostres canvis o feu un «stash» per a procedir."
-#, c-format
-msgid "%s: fast-forward"
-msgstr "%s: avanç ràpid"
-
#. TRANSLATORS: %s will be "revert", "cherry-pick" or
#. "rebase".
#.
@@ -19366,7 +20446,7 @@ msgid ""
" git commit --amend --reset-author\n"
msgstr ""
"S'han configurat el vostre nom i adreça electrònica\n"
-"automàticament basant-se en el vostre nom d'usuari i nom de màquina. \n"
+"automàticament basant-se en el vostre nom d'usuari i nom de màquina.\n"
"Comproveu que siguin correctes. Podeu suprimir aquest\n"
"missatge establint-los explícitament. Executeu l'ordre següent i\n"
"seguiu les instruccions en l'editor per a editar el vostre\n"
@@ -19391,7 +20471,7 @@ msgid ""
" git commit --amend --reset-author\n"
msgstr ""
"S'han configurat el vostre nom i adreça electrònica\n"
-"automàticament basats en el vostre nom d'usuari i nom de màquina. \n"
+"automàticament basats en el vostre nom d'usuari i nom de màquina.\n"
"Comproveu que siguin correctes. Podeu suprimir aquest\n"
"missatge establint-los explícitament:\n"
"\n"
@@ -19456,7 +20536,7 @@ msgid "unknown command: %d"
msgstr "ordre desconeguda: %d"
msgid "This is the 1st commit message:"
-msgstr "Aquest és el missatge de la 1ra comissió:"
+msgstr "Aquest és el missatge de la 1a comissió:"
#, c-format
msgid "This is the commit message #%d:"
@@ -19515,10 +20595,6 @@ msgid "%s: cannot parse parent commit %s"
msgstr "%s: no es pot analitzar la comissió pare %s"
#, c-format
-msgid "could not rename '%s' to '%s'"
-msgstr "no s'ha pogut canviar el nom «%s» a «%s»"
-
-#, c-format
msgid "could not revert %s... %s"
msgstr "no s'ha pogut revertir %s... %s"
@@ -19539,6 +20615,23 @@ msgid "git %s: failed to refresh the index"
msgstr "git %s: s'ha produït un error en actualitzar l'índex"
#, c-format
+msgid "'%s' is not a valid label"
+msgstr "«%s» no és una etiqueta vàlida"
+
+#, c-format
+msgid "'%s' is not a valid refname"
+msgstr "«%s» no és un nom de referència vàlid"
+
+#, c-format
+msgid "update-ref requires a fully qualified refname e.g. refs/heads/%s"
+msgstr ""
+"«update-ref» requereix un refname plenament qualificat, p. ex. refs/heads/%s"
+
+#, c-format
+msgid "invalid command '%.*s'"
+msgstr "ordre no vàlida «%.*s»"
+
+#, c-format
msgid "%s does not accept arguments: '%s'"
msgstr "%s no accepta arguments: «%s»"
@@ -19608,9 +20701,6 @@ msgstr "intenteu «git cherry-pick (--continue | %s--abort | --quit)»"
msgid "could not create sequencer directory '%s'"
msgstr "no s'ha pogut crear el directori de seqüenciador «%s»"
-msgid "could not lock HEAD"
-msgstr "no s'ha pogut bloquejar HEAD"
-
msgid "no cherry-pick or revert in progress"
msgstr "ni hi ha cap «cherry pick» ni cap reversió en curs"
@@ -19705,13 +20795,13 @@ msgstr ""
" git rebase --continue\n"
"\n"
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "i ha fet canvis a l'índex i/o l'arbre de treball\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "i ha fet canvis a l'índex i/o a l'arbre de treball.\n"
#, c-format
msgid ""
"execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
"Commit or stash your changes, and then run\n"
"\n"
" git rebase --continue\n"
@@ -19721,22 +20811,23 @@ msgstr ""
"però ha deixat canvis a l'índex i/o l'arbre de treball\n"
"Cometeu o feu «stash» dels vostres canvis, i llavors executeu\n"
"\n"
-" git rebase --continue\n"
+" git rebase --continue\n"
+"\n"
#, c-format
msgid "illegal label name: '%.*s'"
msgstr "nom d'etiqueta no permès: «%.*s»"
+#, c-format
+msgid "could not resolve '%s'"
+msgstr "no s'ha pogut resoldre «%s»"
+
msgid "writing fake root commit"
msgstr "s'està escrivint una comissió arrel falsa"
msgid "writing squash-onto"
msgstr "s'està escrivint «squash-onto»"
-#, c-format
-msgid "could not resolve '%s'"
-msgstr "no s'ha pogut resoldre «%s»"
-
msgid "cannot merge without a current revision"
msgstr "no es pot fusionar sense una revisió actual"
@@ -19763,6 +20854,28 @@ msgstr "no s'ha pogut fusionar «%.*s»"
msgid "merge: Unable to write new index file"
msgstr "fusió: no s'ha pogut escriure un fitxer d'índex nou"
+#, c-format
+msgid ""
+"another 'rebase' process appears to be running; '%s.lock' already exists"
+msgstr ""
+"sembla que s'està executant un altre procés «rebase»: «%s.lock» ja existeix"
+
+#, c-format
+msgid ""
+"Updated the following refs with %s:\n"
+"%s"
+msgstr ""
+"S'han actualitzat els següents refs amb %s:\n"
+"%s"
+
+#, c-format
+msgid ""
+"Failed to update the following refs with %s:\n"
+"%s"
+msgstr ""
+"No s'han pogut actualitzar les referències següents amb %s:\n"
+"%s"
+
msgid "Cannot autostash"
msgstr "No es pot fer un «stash» automàticament"
@@ -19806,6 +20919,9 @@ msgid "Autostash exists; creating a new stash entry."
msgstr ""
"El «stash» automàtic ja existeix; s'està creant una entrada «stash» nova."
+msgid "autostash reference is a symref"
+msgstr "la referència d'autostash és un symref"
+
msgid "could not detach HEAD"
msgstr "no s'ha pogut separar HEAD"
@@ -19838,14 +20954,14 @@ msgstr ""
" git rebase --continue\n"
#, c-format
-msgid "Rebasing (%d/%d)%s"
-msgstr "S'està fent «rebase» (%d/%d)%s"
-
-#, c-format
msgid "Stopped at %s... %.*s\n"
msgstr "Aturat a %s... %.*s\n"
#, c-format
+msgid "Rebasing (%d/%d)%s"
+msgstr "S'està fent «rebase» (%d/%d)%s"
+
+#, c-format
msgid "unknown command %d"
msgstr "ordre %d desconeguda"
@@ -19930,6 +21046,10 @@ msgid "the script was already rearranged."
msgstr "l'script ja estava endreçat."
#, c-format
+msgid "update-refs file at '%s' is invalid"
+msgstr "el fitxer update-refs a «%s» no és vàlid"
+
+#, c-format
msgid "'%s' is outside repository at '%s'"
msgstr "«%s» està fora del repositori a «%s»"
@@ -20045,17 +21165,26 @@ msgid ""
"not a git repository (or any parent up to mount point %s)\n"
"Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set)."
msgstr ""
-"no és un repositori de git (ni cap pare fins al punt de muntatge %s)\n"
+"no és un repositori de git (ni existeix cap pare fins al punt de muntatge "
+"%s)\n"
"S'atura a la frontera de sistema de fitxers (GIT_DISCOVERY_ACROSS_FILESYSTEM "
"no està establert)."
#, c-format
msgid ""
-"unsafe repository ('%s' is owned by someone else)\n"
-"To add an exception for this directory, call:\n"
+"detected dubious ownership in repository at '%s'\n"
+"%sTo add an exception for this directory, call:\n"
"\n"
"\tgit config --global --add safe.directory %s"
msgstr ""
+"s'ha detectat una propietat dubtosa al repositori a «%s»\n"
+"%sPer a afegir una excepció per a aquest directori, executeu:\n"
+"\n"
+"\tgit config --global --add safe.directory %s"
+
+#, c-format
+msgid "cannot use bare repository '%s' (safe.bareRepository is '%s')"
+msgstr "no es pot utilitzar el dipòsit nu «%s» (safe.bareRepository és «%s»)"
#, c-format
msgid ""
@@ -20074,6 +21203,83 @@ msgid "setsid failed"
msgstr "«setsid» ha fallat"
#, c-format
+msgid "cannot stat template '%s'"
+msgstr "no es pot fer stat en la plantilla «%s»"
+
+#, c-format
+msgid "cannot opendir '%s'"
+msgstr "no es pot fer opendir en el directori «%s»"
+
+#, c-format
+msgid "cannot readlink '%s'"
+msgstr "no es pot fer readlink en «%s»"
+
+#, c-format
+msgid "cannot symlink '%s' '%s'"
+msgstr "no es pot fer symlink en «%s» «%s»"
+
+#, c-format
+msgid "cannot copy '%s' to '%s'"
+msgstr "no es pot copiar «%s» a «%s»"
+
+#, c-format
+msgid "ignoring template %s"
+msgstr "s'està ignorant la plantilla %s"
+
+#, c-format
+msgid "templates not found in %s"
+msgstr "plantilles no trobades a %s"
+
+#, c-format
+msgid "not copying templates from '%s': %s"
+msgstr "no s'estan copiant plantilles de «%s»: %s"
+
+#, c-format
+msgid "invalid initial branch name: '%s'"
+msgstr "nom de branca inicial no vàlid: «%s»"
+
+#, c-format
+msgid "re-init: ignored --initial-branch=%s"
+msgstr "reinicialització: s'ha ignorat --initial-branch=%s"
+
+#, c-format
+msgid "unable to handle file type %d"
+msgstr "no s'ha pogut gestionar el tipus de fitxer %d"
+
+#, c-format
+msgid "unable to move %s to %s"
+msgstr "no s'ha pogut moure %s a %s"
+
+msgid "attempt to reinitialize repository with different hash"
+msgstr "s'ha intentat reinicialitzar el repositori amb un resum diferent"
+
+msgid ""
+"attempt to reinitialize repository with different reference storage format"
+msgstr ""
+"s'ha intentat reactivar el repositori amb un format d'emmagatzematge de "
+"referència diferent"
+
+#, c-format
+msgid "%s already exists"
+msgstr "%s ja existeix"
+
+#, c-format
+msgid "Reinitialized existing shared Git repository in %s%s\n"
+msgstr "S'ha reinicialitzat el repositori compartit existent del Git en %s%s\n"
+
+#, c-format
+msgid "Reinitialized existing Git repository in %s%s\n"
+msgstr "S'ha reinicialitzat el repositori existent del Git en %s%s\n"
+
+#, c-format
+msgid "Initialized empty shared Git repository in %s%s\n"
+msgstr "S'ha inicialitzat un repositori compartit buit del Git en %s%s\n"
+
+#, c-format
+msgid "Initialized empty Git repository in %s%s\n"
+msgstr "S'ha inicialitzat un repositori buit del Git en %s%s\n"
+
+#, c-format
msgid "index entry is a directory, but not sparse (%08x)"
msgstr "l'entrada d'índex és un directori, però no dispers (%08x)"
@@ -20125,16 +21331,11 @@ msgstr[0] "%u byte/s"
msgstr[1] "%u bytes/s"
#, c-format
-msgid "could not edit '%s'"
-msgstr "no s'ha pogut editar «%s»"
-
-#, c-format
msgid "ignoring suspicious submodule name: %s"
msgstr "s'està ignorant el nom de submòdul sospitós %s"
-#, fuzzy
msgid "negative values not allowed for submodule.fetchJobs"
-msgstr "no es permeten els valors negatius a submodule.fetchjobs"
+msgstr "no es permeten els valors negatius a submodule.fetchJobs"
#, c-format
msgid "ignoring '%s' which may be interpreted as a command-line option: %s"
@@ -20311,11 +21512,25 @@ msgstr "ls-tree ha retornat un codi de retorn %d no esperat"
msgid "failed to lstat '%s'"
msgstr "s'ha produït un error en fer lstat a «%s»"
-msgid "unhandled options"
-msgstr "opcions no gestionades"
+msgid "no remote configured to get bundle URIs from"
+msgstr "no hi ha cap remot configurat per a obtenir els URI del paquet"
-msgid "error preparing revisions"
-msgstr "s'ha produït un error en preparar les revisions"
+#, c-format
+msgid "remote '%s' has no configured URL"
+msgstr "el remot «%s» no té cap URL configurat"
+
+msgid "could not get the bundle-uri list"
+msgstr "no s'ha pogut obtenir la llista bundle-uri"
+
+msgid "test-tool cache-tree <options> (control|prime|update)"
+msgstr "test-tool cache-tree <opcions> (control|prime|update)"
+
+msgid "clear the cache tree before each iteration"
+msgstr "neteja l'arbre de la memòria cau abans de cada iteració"
+
+msgid "number of entries in the cache tree to invalidate (default 0)"
+msgstr ""
+"nombre d'entrades a l'arbre de la memòria cau a invalidar (per defecte 0)"
#, c-format
msgid "commit %s is not marked reachable"
@@ -20469,9 +21684,6 @@ msgstr "el protocol no permet establir el camí del servei remot"
msgid "invalid remote service path"
msgstr "el camí del servei remot no és vàlid"
-msgid "operation not supported by protocol"
-msgstr "opció no admesa pel protocol"
-
#, c-format
msgid "can't connect to subservice %s"
msgstr "no es pot connectar al subservei %s"
@@ -20604,10 +21816,6 @@ msgstr ""
"encara no s'ha implementat la compatibilitat amb la versió v2 del protocol"
#, c-format
-msgid "unknown value for config '%s': %s"
-msgstr "valor desconegut per al config «%s»': %s"
-
-#, c-format
msgid "transport '%s' not allowed"
msgstr "no es permet el transport «%s»"
@@ -20653,6 +21861,16 @@ msgstr "S'està avortant."
msgid "failed to push all needed submodules"
msgstr "no s'han pogut pujar tots els submòduls necessaris"
+msgid "bundle-uri operation not supported by protocol"
+msgstr "L'operació bundle-uri no és compatible amb el protocol"
+
+msgid "could not retrieve server-advertised bundle-uri list"
+msgstr ""
+"no s'ha pogut recuperar la llista de paquets d'URI anunciats pel servidor"
+
+msgid "operation not supported by protocol"
+msgstr "opció no admesa pel protocol"
+
msgid "too-short tree object"
msgstr "objecte d'arbre massa curt"
@@ -20936,6 +22154,18 @@ msgstr "número de port no vàlid"
msgid "invalid '..' path segment"
msgstr "segment de camí «..» no vàlid"
+msgid "usage: "
+msgstr "ús: "
+
+msgid "fatal: "
+msgstr "fatal: "
+
+msgid "error: "
+msgstr "error: "
+
+msgid "warning: "
+msgstr "avís: "
+
msgid "Fetching objects"
msgstr "S'estan obtenint objectes"
@@ -20966,7 +22196,7 @@ msgid ".git file broken"
msgstr "fitxer .git malmès"
msgid ".git file incorrect"
-msgstr "fitxer .git malmès"
+msgstr "fitxer .git incorrecte"
msgid "not a valid path"
msgstr "no és un camí vàlid"
@@ -21038,6 +22268,9 @@ msgstr "no s'ha pogut accedir a «%s»"
msgid "unable to get current working directory"
msgstr "no s'ha pogut obtenir el directori de treball actual"
+msgid "unable to get random bytes"
+msgstr "no s'han pogut obtenir bytes aleatoris"
+
msgid "Unmerged paths:"
msgstr "Camins sense fusionar:"
@@ -21078,7 +22311,7 @@ msgstr " (useu «git add/rm <fitxer>...» per a actualitzar què es cometrà)"
msgid ""
" (use \"git restore <file>...\" to discard changes in working directory)"
msgstr ""
-" (useu «git restore <file>...» per a descartar canvis en el directori de "
+" (useu «git restore <fitxer>...» per a descartar canvis en el directori de "
"treball)"
msgid " (commit or discard the untracked or modified content in submodules)"
@@ -21388,14 +22621,20 @@ msgstr "Fitxers ignorats"
#, c-format
msgid ""
-"It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
-"may speed it up, but you have to be careful not to forget to add\n"
-"new files yourself (see 'git help status')."
+"It took %.2f seconds to enumerate untracked files,\n"
+"but the results were cached, and subsequent runs may be faster."
+msgstr ""
+"S'han trigat %.2f segons a enumerar els fitxers sense seguiment,\n"
+"però els resultats es van emmagatzemar a la memòria cau, i les\n"
+"execucions posteriors podrien ser més ràpides."
+
+#, c-format
+msgid "It took %.2f seconds to enumerate untracked files."
+msgstr "S'han trigat %.2f segons a enumerar els fitxers sense seguiment."
+
+msgid "See 'git help status' for information on how to improve this."
msgstr ""
-"S'ha trigat %.2f segons enumerar els fitxers no seguits.\n"
-"«status -uno» pot accelerar-ho, però heu d'anar amb compte de no\n"
-"oblidar-vos d'afegir fitxers nous vosaltres mateixos (vegeu\n"
-"«git help status»)."
+"Vegeu «git help status» per a obtenir informació sobre com millorar-ho."
#, c-format
msgid "Untracked files not listed%s"
@@ -21473,6 +22712,10 @@ msgstr "addicionalment, el vostre índex conté canvis sense cometre."
msgid "cannot %s: Your index contains uncommitted changes."
msgstr "no es pot %s: El vostre índex conté canvis sense cometre."
+#, c-format
+msgid "unknown style '%s' given for '%s'"
+msgstr "estil desconegut «%s» donat per a «%s»"
+
msgid ""
"Error: Your local changes to the following files would be overwritten by "
"merge"
@@ -21541,292 +22784,6 @@ msgstr ""
msgid "Unable to determine absolute path of git directory"
msgstr "No s'ha pogut determinar el camí absolut del directori de git"
-#. TRANSLATORS: you can adjust this to align "git add -i" status menu
-#, perl-format
-msgid "%12s %12s %s"
-msgstr "%12s %12s %s"
-
-#, perl-format
-msgid "touched %d path\n"
-msgid_plural "touched %d paths\n"
-msgstr[0] "modificat %d camí\n"
-msgstr[1] "modificat %d camins\n"
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for staging."
-msgstr ""
-"Si el pedaç s'aplica correctament, el tros editat es marcarà immediatament\n"
-"per «staging»."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for stashing."
-msgstr ""
-"Si el pedaç s'aplica correctament, el tros editat es marcarà immediatament\n"
-"per «stashing»."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for unstaging."
-msgstr ""
-"Si el pedaç s'aplica correctament, el tros editat es marcarà immediatament\n"
-"per «unstaging»."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for applying."
-msgstr ""
-"Si el pedaç s'aplica correctament, el tros editat es marcarà immediatament\n"
-"per a aplicar-se."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for discarding."
-msgstr ""
-"Si el pedaç s'aplica correctament, el tros editat es marcarà immediatament\n"
-"per a descartar-se."
-
-#, perl-format
-msgid "failed to open hunk edit file for writing: %s"
-msgstr "s'ha produït un error en escriure al fitxer d'edició del tros: %s"
-
-#, perl-format
-msgid ""
-"---\n"
-"To remove '%s' lines, make them ' ' lines (context).\n"
-"To remove '%s' lines, delete them.\n"
-"Lines starting with %s will be removed.\n"
-msgstr ""
-"---\n"
-"Per a eliminar les línies «%s», convertiu-les en línies ' ' (context).\n"
-"Per a eliminar les línies «%s», suprimiu-les.\n"
-"Les línies que comencin per %s s'eliminaran.\n"
-
-#, perl-format
-msgid "failed to open hunk edit file for reading: %s"
-msgstr "s'ha produït un error en llegir al fitxer d'edició del tros: %s"
-
-msgid ""
-"y - stage this hunk\n"
-"n - do not stage this hunk\n"
-"q - quit; do not stage this hunk or any of the remaining ones\n"
-"a - stage this hunk and all later hunks in the file\n"
-"d - do not stage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - fes «stage» d'aquest tros\n"
-"n - no facis «stage» d'aquest tros\n"
-"q - surt; no facis «stage» d'aquest tros o de cap altre restant\n"
-"a - fes «stage» d'aquest tros i tota la resta de trossos del fitxer\n"
-"d - no facis «stage» d'aquest tros o de cap altre restant del fitxer"
-
-msgid ""
-"y - stash this hunk\n"
-"n - do not stash this hunk\n"
-"q - quit; do not stash this hunk or any of the remaining ones\n"
-"a - stash this hunk and all later hunks in the file\n"
-"d - do not stash this hunk or any of the later hunks in the file"
-msgstr ""
-"y - fes «stash» d'aquest tros\n"
-"n - no facis «stash» d'aquest tros\n"
-"q - surt; no facis «stash» d'aquest tros o de cap altre restant\n"
-"a - fes «stash» d'aquest tros i tota la resta de trossos del fitxer\n"
-"d - no facis «stash» d'aquest tros o de cap altre restant del fitxer"
-
-msgid ""
-"y - unstage this hunk\n"
-"n - do not unstage this hunk\n"
-"q - quit; do not unstage this hunk or any of the remaining ones\n"
-"a - unstage this hunk and all later hunks in the file\n"
-"d - do not unstage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - fes «unstage» d'aquest tros\n"
-"n - no facis «unstage» d'aquest tros\n"
-"q - surt; no facis «unstage» d'aquest tros o de cap altre restant\n"
-"a - fes «unstage» d'aquest tros i tota la resta de trossos del fitxer\n"
-"d - no facis «unstage» d'aquest tros o de cap altre restant del fitxer"
-
-msgid ""
-"y - apply this hunk to index\n"
-"n - do not apply this hunk to index\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - aplica aquest tros a l'índex\n"
-"n - no apliquis aquest tros a l'índex\n"
-"q - surt; no apliquis aquest tros ni cap dels pendents\n"
-"a - aplica aquest tros i tots els trossos posteriors en el fitxer\n"
-"d - no apliquis aquest tros ni cap dels trossos posteriors en el fitxer"
-
-msgid ""
-"y - discard this hunk from worktree\n"
-"n - do not discard this hunk from worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - descarta aquest tros de l'arbre de treball\n"
-"n - no descartis aquest tros des de l'arbre de treball\n"
-"q - surt; no apliquis aquest tros ni cap dels pendents\n"
-"a - descarta aquest tros i tots els trossos posteriors en el fitxer\n"
-"d - no descartis aquest tros ni cap dels trossos posteriors en el fitxer"
-
-msgid ""
-"y - discard this hunk from index and worktree\n"
-"n - do not discard this hunk from index and worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - descarta aquest tros de l'índex i de l'arbre de treball\n"
-"n - no descartis aquest tros des de l'índex i de l'arbre de treball\n"
-"q - surt; no apliquis aquest tros ni cap dels pendents\n"
-"a - descarta aquest tros i tots els trossos posteriors en el fitxer\n"
-"d - no descartis aquest tros ni cap dels trossos posteriors en el fitxer"
-
-msgid ""
-"y - apply this hunk to index and worktree\n"
-"n - do not apply this hunk to index and worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - aplica aquest tros a l'índex i l'arbre de treball\n"
-"n - no apliquis aquest tros des de l'índex i de l'arbre de treball\n"
-"q - surt; no apliquis aquest tros ni cap dels pendents\n"
-"a - aplica aquest tros i tots els trossos posteriors en el fitxer\n"
-"d - no apliquis aquest tros ni cap dels trossos posteriors en el fitxer"
-
-msgid ""
-"y - apply this hunk to worktree\n"
-"n - do not apply this hunk to worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - aplica aquest tros a l'arbre de treball\n"
-"n - no apliquis aquest tros a l'arbre de treball\n"
-"q - surt; no apliquis aquest tros ni cap dels pendents\n"
-"a - aplica aquest tros i tots els trossos posteriors en el fitxer\n"
-"d - no apliquis aquest tros ni cap dels trossos posteriors en el fitxer"
-
-msgid ""
-"g - select a hunk to go to\n"
-"/ - search for a hunk matching the given regex\n"
-"j - leave this hunk undecided, see next undecided hunk\n"
-"J - leave this hunk undecided, see next hunk\n"
-"k - leave this hunk undecided, see previous undecided hunk\n"
-"K - leave this hunk undecided, see previous hunk\n"
-"s - split the current hunk into smaller hunks\n"
-"e - manually edit the current hunk\n"
-"? - print help\n"
-msgstr ""
-"g - selecciona el tros on voleu anar\n"
-"/ - cerca un tros que coincideixi amb l'expressió regular donada\n"
-"j - deixa aquest tros sense decidir, veure el tros sense decidir següent\n"
-"J - deixa aquest tros sense decidir, veure el tros següent\n"
-"k - deixa aquest tros sense decidir, veure el tros sense decidir anterior\n"
-"K - deixa aquest tros sense decidir, veure el tros anterior\n"
-"s - divideix el tros actual en trossos més petits\n"
-"e - edita manualment el tros actual\n"
-"? - mostra l'ajuda\n"
-
-msgid "The selected hunks do not apply to the index!\n"
-msgstr "Els trossos seleccionats no apliquen a l'índex\n"
-
-#, perl-format
-msgid "ignoring unmerged: %s\n"
-msgstr "s'està ignorant %s no fusionat\n"
-
-#, perl-format
-msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
-msgstr "Aplica el canvi de mode a l'arbre de treball [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
-msgstr "Aplica la supressió a l'arbre de treball [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
-msgstr "Aplica l'addició a l'arbre de treball [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
-msgstr "Aplica aquest tros a l'arbre de treball [y,n,q,a,d%s,?]? "
-
-msgid "No other hunks to goto\n"
-msgstr "No hi ha altres trossos on anar-hi\n"
-
-#, perl-format
-msgid "Invalid number: '%s'\n"
-msgstr "Número no vàlid: «%s»\n"
-
-#, perl-format
-msgid "Sorry, only %d hunk available.\n"
-msgid_plural "Sorry, only %d hunks available.\n"
-msgstr[0] "Només %d tros disponible.\n"
-msgstr[1] "Només %d trossos disponibles.\n"
-
-msgid "No other hunks to search\n"
-msgstr "No hi ha cap altre tros a cercar\n"
-
-#, perl-format
-msgid "Malformed search regexp %s: %s\n"
-msgstr "Expressió regular de cerca mal formada %s: %s\n"
-
-msgid "No hunk matches the given pattern\n"
-msgstr "No hi ha trossos que coincideixin amb el patró donat\n"
-
-msgid "No previous hunk\n"
-msgstr "Sense tros previ\n"
-
-msgid "No next hunk\n"
-msgstr "No hi ha tros següent\n"
-
-msgid "Sorry, cannot split this hunk\n"
-msgstr "No es pot dividir aquest tros\n"
-
-#, perl-format
-msgid "Split into %d hunk.\n"
-msgid_plural "Split into %d hunks.\n"
-msgstr[0] "Divideix en %d tros.\n"
-msgstr[1] "Divideix en %d trossos.\n"
-
-msgid "Sorry, cannot edit this hunk\n"
-msgstr "No es pot editar aquest tros\n"
-
-#. TRANSLATORS: please do not translate the command names
-#. 'status', 'update', 'revert', etc.
-msgid ""
-"status - show paths with changes\n"
-"update - add working tree state to the staged set of changes\n"
-"revert - revert staged set of changes back to the HEAD version\n"
-"patch - pick hunks and update selectively\n"
-"diff - view diff between HEAD and index\n"
-"add untracked - add contents of untracked files to the staged set of "
-"changes\n"
-msgstr ""
-"status - mostra els camins amb canvis\n"
-"update - afegeix l'estat de l'arbre de treball al conjunt de canvis "
-"«staged»\n"
-"revert - reverteix el conjunt de canvis de «staged» a la versió HEAD\n"
-"patch - selecciona trossos i actualitza'ls selectivament\n"
-"diff - mostra la diferència entre HEAD i l'índex\n"
-"add untracked - afegeix el contingut dels fitxers no seguits al conjunt de "
-"canvis «staged»\n"
-
-msgid "missing --"
-msgstr "manca --"
-
-#, perl-format
-msgid "unknown --patch mode: %s"
-msgstr "desconegut --patch mode: %s"
-
-#, perl-format
-msgid "invalid argument %s, expecting --"
-msgstr "argument %s no vàlid, s'esperava --"
-
msgid "local zone differs from GMT by a non-minute interval\n"
msgstr "la zona local difereix de GMT per un interval que no és de minuts\n"
@@ -21945,13 +22902,13 @@ msgstr ""
"Esborreu el contingut del cos si no voleu enviar cap resum.\n"
#, perl-format
-msgid "Failed to open %s: %s"
-msgstr "S'ha produït un error en obrir %s: %s"
-
-#, perl-format
msgid "Failed to open %s.final: %s"
msgstr "S'ha produït un error en obrir %s.final: %s"
+#, perl-format
+msgid "Failed to open %s: %s"
+msgstr "S'ha produït un error en obrir %s: %s"
+
msgid "Summary email is empty, skipping it\n"
msgstr "El correu electrònic de resum està buit, s'omet\n"
@@ -22107,26 +23064,30 @@ msgid "(%s) Could not execute '%s'"
msgstr "(%s) no s'ha pogut executar «%s»"
#, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) S'està afegint %s: %s des de: «%s»\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) Sortida mal formada de «%s»"
#, perl-format
msgid "(%s) failed to close pipe to '%s'"
msgstr "(%s) s'ha produït un error en tancar el conducte «%s»"
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) S'està afegint %s: %s des de: «%s»\n"
+
msgid "cannot send message as 7bit"
msgstr "no es pot enviar el missatge en 7 bits"
msgid "invalid transfer encoding"
msgstr "codificació de transferència no vàlida"
-#, fuzzy, perl-format
+#, perl-format
msgid ""
"fatal: %s: rejected by %s hook\n"
"%s\n"
"warning: no patches were sent\n"
msgstr ""
-"fatal: %s: rebutjat pel lligam sendemail-validate\n"
+"fatal: %s: rebutjat pel lligam %s\n"
"%s\n"
"avís: no s'ha enviat cap pedaç\n"
@@ -22150,303 +23111,3 @@ msgstr "S'està ometent %s amb el sufix de còpia de seguretat «%s».\n"
#, perl-format
msgid "Do you really want to send %s? [y|N]: "
msgstr "Esteu segur que voleu enviar %s? [y|N]: "
-
-#~ msgid "--preserve-merges was replaced by --rebase-merges"
-#~ msgstr "--preserve-merges ha estat substituït per --rebase-merges"
-
-#, c-format
-#~ msgid ""
-#~ "CRLF will be replaced by LF in %s.\n"
-#~ "The file will have its original line endings in your working directory"
-#~ msgstr ""
-#~ "CRLF serà reemplaçat per LF en %s.\n"
-#~ "El fitxer tindrà els seus terminadors de línia originals en el vostre "
-#~ "directori de treball"
-
-#, c-format
-#~ msgid ""
-#~ "LF will be replaced by CRLF in %s.\n"
-#~ "The file will have its original line endings in your working directory"
-#~ msgstr ""
-#~ "LF serà reemplaçat per CRLF en %s.\n"
-#~ "El fitxer tindrà els seus terminadors de línia originals en el vostre "
-#~ "directori de treball"
-
-#, c-format
-#~ msgid "error reading section header '%s'"
-#~ msgstr "error en llegir la capçalera de la secció «%s»"
-
-#~ msgid "load_reverse_index: could not open pack"
-#~ msgstr "load_reverse_index: no s'ha pogut obrir el paquet"
-
-#, perl-format
-#~ msgid "fatal: %s: rejected by %s hook\n"
-#~ msgstr "fatal: %s: rebutjat pel lligam %s\n"
-
-#~ msgid "git archive --list"
-#~ msgstr "git archive --list"
-
-#, c-format
-#~ msgid "unknown value for --diff-merges: %s"
-#~ msgstr "valor desconegut per a --diff-merges: %s"
-
-#, c-format
-#~ msgid "invalid value '%s' for lsrefs.unborn"
-#~ msgstr "valor «%s» no vàlid per a «lsrefs.unborn»"
-
-#~ msgid "backend for `git stash -p`"
-#~ msgstr "rerefons per a «git stash -p»"
-
-#, c-format
-#~ msgid "Invalid value for --empty: %s"
-#~ msgstr "Valor no vàlid per a --empty: %s"
-
-#, c-format
-#~ msgid "Invalid value for --patch-format: %s"
-#~ msgstr "Valor no vàlid per a --patch-format: %s"
-
-#, c-format
-#~ msgid "Invalid value for --show-current-patch: %s"
-#~ msgstr "Valor no vàlid per --show-current-patch: %s"
-
-#~ msgid ""
-#~ "git bisect--helper --bisect-terms [--term-good | --term-old | --term-bad "
-#~ "| --term-new]"
-#~ msgstr ""
-#~ "git bisect--helper --bisect-terms [--term-good | --term-old | --term-bad "
-#~ "| --term-new]"
-
-#~ msgid "git bisect--helper --bisect-next"
-#~ msgstr "git bisect--helper --bisect-next"
-
-#~ msgid "git bisect--helper --bisect-visualize"
-#~ msgstr "git bisect--helper --bisect-visualize"
-
-#, c-format
-#~ msgid "invalid color '%s' in color.blame.repeatedLines"
-#~ msgstr "color «%s» no vàlid en «color.blame.repeatedLines»"
-
-#~ msgid "invalid value for blame.coloring"
-#~ msgstr "valor no vàlid per a «blame.coloring»"
-
-#~ msgid ""
-#~ "git cat-file (-t [--allow-unknown-type] | -s [--allow-unknown-type] | -e "
-#~ "| -p | <type> | --textconv | --filters) [--path=<path>] <object>"
-#~ msgstr ""
-#~ "git cat-file (-t [--allow-unknown-type] | -s [--allow-unknown-type] | -e "
-#~ "| -p | <tipus> | --textconv | --filters [--path=<camí>]) <objecte>"
-
-#~ msgid "show object type"
-#~ msgstr "mostra el tipus de l'objecte"
-
-#~ msgid "exit with zero when there's no error"
-#~ msgstr "surt amb zero quan no hi ha error"
-
-#~ msgid "show info and content of objects fed from the standard input"
-#~ msgstr ""
-#~ "mostra la informació i contingut dels objectes rebuts de l'entrada "
-#~ "estàndard"
-
-#~ msgid "show info about objects fed from the standard input"
-#~ msgstr "mostra informació sobre els objectes rebuts de l'entrada estàndard"
-
-#~ msgid "follow in-tree symlinks (used with --batch or --batch-check)"
-#~ msgstr ""
-#~ "segueix els enllaços simbòlics en l'arbre (s'usa amb --batch o --batch-"
-#~ "check)"
-
-#~ msgid "show all objects with --batch or --batch-check"
-#~ msgstr "mostra tots els objectes amb --batch o --batch-check"
-
-#~ msgid "do not order --batch-all-objects output"
-#~ msgstr "no ordenar la sortida de --batch-all-objects"
-
-#~ msgid "set up tracking mode (see git-pull(1))"
-#~ msgstr "configura el mode de seguiment (vegeu git-pull(1))"
-
-#~ msgid "Using both --reset-author and --author does not make sense"
-#~ msgstr "Usar ambdós --reset-author i --author no té sentit"
-
-#~ msgid "Options --squash and --fixup cannot be used together"
-#~ msgstr "Les opcions --squash i --fixup no es poden usar juntes"
-
-#~ msgid "Only one of -c/-C/-F/--fixup can be used."
-#~ msgstr "Només un de -c/-C/-F/--fixup es pot usar."
-
-#~ msgid "Option -m cannot be combined with -c/-C/-F."
-#~ msgstr "l'opció -m no es pot combinar amb -c/-C/-F/."
-
-#~ msgid ""
-#~ "Only one of --include/--only/--all/--interactive/--patch can be used."
-#~ msgstr ""
-#~ "Només un de --include/--only/--all/--interactive/--patch es pot usar."
-
-#~ msgid "git count-objects [-v] [-H | --human-readable]"
-#~ msgstr "git count-objects [-v] [-H | --human-readable]"
-
-#, c-format
-#~ msgid "configuration fetch.output contains invalid value %s"
-#~ msgstr "la configuració fetch.output conté un valor no vàlid %s"
-
-#~ msgid "--cached or --untracked cannot be used with --no-index"
-#~ msgstr "--cached o --untracked no es pot usar amb --no-index"
-
-#~ msgid "--untracked cannot be used with --cached"
-#~ msgstr "--untracked no es pot usar amb --cached"
-
-#~ msgid "git hash-object --stdin-paths"
-#~ msgstr "git hash-object --stdin-paths"
-
-#~ msgid "git help [-g|--guides]"
-#~ msgstr "git help [-g|--guides]"
-
-#~ msgid "git help [-c|--config]"
-#~ msgstr "git help [-c|--config]"
-
-#~ msgid "git mktag"
-#~ msgstr "git mktag"
-
-#~ msgid "git mktree [-z] [--missing] [--batch]"
-#~ msgstr "git mktree [-z] [--missing] [--batch]"
-
-#~ msgid "read from stdin"
-#~ msgstr "llegeix de stdin"
-
-#~ msgid "git notes merge --commit [-v | -q]"
-#~ msgstr "git notes merge --commit [-v | -q]"
-
-#~ msgid "git notes merge --abort [-v | -q]"
-#~ msgstr "git notes merge --abort [-v | -q]"
-
-#~ msgid "git notes get-ref"
-#~ msgstr "git notes get-ref"
-
-#~ msgid "invalid value for --missing"
-#~ msgstr "valor no vàlid per a --missing"
-
-#~ msgid "git prune-packed [-n | --dry-run] [-q | --quiet]"
-#~ msgstr "git prune-packed [-n | --dry-run] [-q | --quiet]"
-
-#, c-format
-#~ msgid "Invalid value for %s: %s"
-#~ msgstr "Valor no vàlid per a %s: %s"
-
-#, c-format
-#~ msgid "Invalid value for pull.ff: %s"
-#~ msgstr "Valor no vàlid per a pull.ff: %s"
-
-#~ msgid "git rebase --continue | --abort | --skip | --edit-todo"
-#~ msgstr "git rebase --continue | --abort | --skip | --edit-todo"
-
-#, c-format
-#~ msgid "'%s' is not a valid timestamp"
-#~ msgstr "«%s» no és una marca de temps vàlida"
-
-#~ msgid "git reflog [ show | expire | delete | exists ]"
-#~ msgstr "git reflog [ show | expire | delete | exists ]"
-
-#~ msgid "git remote [-v | --verbose]"
-#~ msgstr "git remote [-v | --verbose]"
-
-#~ msgid "git replace [-f] --convert-graft-file"
-#~ msgstr "git replace [-f] --convert-graft-file"
-
-#, c-format
-#~ msgid ""
-#~ "\n"
-#~ "It took %.2f seconds to enumerate unstaged changes after reset. You can\n"
-#~ "use '--quiet' to avoid this. Set the config setting reset.quiet to true\n"
-#~ "to make this the default.\n"
-#~ msgstr ""
-#~ "\n"
-#~ "S'ha trigat %.2f segons a enumerar els canvis «unstaged» després del "
-#~ "reinici.\n"
-#~ "Podeu utilitzar «--quiet» per a evitar-ho. Establiu el paràmetre de "
-#~ "configuració\n"
-#~ "reset.quiet a true per a fer que aquesta configuració sigui "
-#~ "predeterminada.\n"
-
-#~ msgid "git sparse-checkout list"
-#~ msgstr "git sparse-checkout list"
-
-#~ msgid "unable to upgrade repository format to enable worktreeConfig"
-#~ msgstr ""
-#~ "no s'ha pogut actualitzar el format del repositori per a habilitar "
-#~ "worktreeConfig"
-
-#~ msgid "git sparse-checkout init [--cone] [--[no-]sparse-index]"
-#~ msgstr "git sparse-checkout init [--cone] [--[no-]sparse-index]"
-
-#~ msgid "git sparse-checkout reapply [--[no-]cone] [--[no-]sparse-index]"
-#~ msgstr "git sparse-checkout reapply [--[no-]cone] [--[no-]sparse-index]"
-
-#~ msgid "git sparse-checkout disable"
-#~ msgstr "git sparse-checkout disable"
-
-#~ msgid ""
-#~ "the stash.useBuiltin support has been removed!\n"
-#~ "See its entry in 'git help config' for details."
-#~ msgstr ""
-#~ "s'ha eliminat l'opció stash.useBuiltin.\n"
-#~ "Per a més detalls vegeu la seva entrada a «git help config»."
-
-#~ msgid "git stripspace [-s | --strip-comments]"
-#~ msgstr "git stripspace [-s | --strip-comments]"
-
-#~ msgid "git stripspace [-c | --comment-lines]"
-#~ msgstr "git stripspace [-c | --comment-lines]"
-
-#~ msgid "submodule--helper print-default-remote takes no arguments"
-#~ msgstr "submodule--helper print-default-remote no pren cap argument"
-
-#~ msgid "git submodule--helper update-clone [--prefix=<path>] [<path>...]"
-#~ msgstr "git submodule--helper update-clone [--prefix=<camí>] [<camí>...]"
-
-#~ msgid "suppress output for update by rebase or merge"
-#~ msgstr "omet la sortida per les actualitzacions per «rebase» o fusió"
-
-#~ msgid "overrides update mode in case the repository is a fresh clone"
-#~ msgstr ""
-#~ "sobreescriu el mode d'actualització en cas que el repositori sigui un "
-#~ "clon nou"
-
-#~ msgid "depth for shallow fetch"
-#~ msgstr "profunditat per a les obtencions superficials"
-
-#~ msgid "sha1"
-#~ msgstr "sha1"
-
-#~ msgid "SHA1 expected by superproject"
-#~ msgstr "SHA1 esperat per superproject"
-
-#~ msgid "subsha1"
-#~ msgstr "subsha1"
-
-#~ msgid "SHA1 of submodule's HEAD"
-#~ msgstr "SHA1 del HEAD del submòdul"
-
-#~ msgid "git submodule--helper run-update-procedure [<options>] <path>"
-#~ msgstr "git submodule--helper run-update-procedure [<options>] <path>"
-
-#~ msgid "git submodule--helper config --check-writeable"
-#~ msgstr "git submodule--helper config --check-writeable"
-
-#~ msgid "git update-server-info [--force]"
-#~ msgstr "git update-server-info [--force]"
-
-#~ msgid "Initialize and modify the sparse-checkout"
-#~ msgstr "Inicialitza i modifica el «sparse-checkout»"
-
-#, sh-format
-#~ msgid ""
-#~ "Unable to find current ${remote_name}/${branch} revision in submodule "
-#~ "path '$sm_path'"
-#~ msgstr ""
-#~ "No s'ha pogut trobar la revisió actual de ${remote_name}/${branch} en el "
-#~ "camí de submòdul «$sm_path»"
-
-#, sh-format
-#~ msgid "Failed to recurse into submodule path '$displaypath'"
-#~ msgstr ""
-#~ "S'ha produït un error en recórrer recursivament dins del camí de submòdul "
-#~ "«$displaypath»"
diff --git a/po/de.po b/po/de.po
index 76d6d3b..37d6c80 100644
--- a/po/de.po
+++ b/po/de.po
@@ -8,16 +8,16 @@ msgid ""
msgstr ""
"Project-Id-Version: Git\n"
"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2022-06-21 19:57+0000\n"
-"PO-Revision-Date: 2022-06-20 21:17+0200\n"
-"Last-Translator: Matthias Rüster <matthias.ruester@gmail.com>\n"
-"Language-Team: Matthias Rüster <matthias.ruester@gmail.com>\n"
+"POT-Creation-Date: 2024-02-17 18:07+0100\n"
+"PO-Revision-Date: 2024-02-17 18:14+0100\n"
+"Last-Translator: Ralf Thielow <ralf.thielow@gmail.com>\n"
+"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
-"X-Generator: Poedit 3.1\n"
+"X-Generator: Poedit 3.4.1\n"
#, c-format
msgid "Huh (%s)?"
@@ -45,13 +45,13 @@ msgstr "Konnte '%s' nicht zum Commit vormerken."
msgid "could not write index"
msgstr "konnte Index nicht schreiben"
-#, c-format, perl-format
+#, c-format
msgid "updated %d path\n"
msgid_plural "updated %d paths\n"
msgstr[0] "%d Pfad aktualisiert\n"
msgstr[1] "%d Pfade aktualisiert\n"
-#, c-format, perl-format
+#, c-format
msgid "note: %s is untracked now.\n"
msgstr "Hinweis: %s ist nun unversioniert.\n"
@@ -65,7 +65,7 @@ msgstr "Revert"
msgid "Could not parse HEAD^{tree}"
msgstr "Konnte HEAD^{tree} nicht parsen."
-#, c-format, perl-format
+#, c-format
msgid "reverted %d path\n"
msgid_plural "reverted %d paths\n"
msgstr[0] "%d Pfad wiederhergestellt\n"
@@ -78,7 +78,7 @@ msgstr "Keine unversionierten Dateien.\n"
msgid "Add untracked"
msgstr "Unversionierte Dateien hinzufügen"
-#, c-format, perl-format
+#, c-format
msgid "added %d path\n"
msgid_plural "added %d paths\n"
msgstr[0] "%d Pfad hinzugefügt\n"
@@ -172,19 +172,19 @@ msgstr "Index konnte nicht aktualisiert werden"
msgid "Bye.\n"
msgstr "Tschüss.\n"
-#, c-format, perl-format
+#, c-format
msgid "Stage mode change [y,n,q,a,d%s,?]? "
msgstr "Modusänderung der Staging-Area hinzufügen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage deletion [y,n,q,a,d%s,?]? "
msgstr "Löschung der Staging-Area hinzufügen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage addition [y,n,q,a,d%s,?]? "
msgstr "Ergänzung der Staging-Area hinzufügen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage this hunk [y,n,q,a,d%s,?]? "
msgstr "Diesen Patch-Block der Staging-Area hinzufügen [y,n,q,a,d%s,?]? "
@@ -210,19 +210,19 @@ msgstr ""
"d - diesen oder alle weiteren Patch-Blöcke in dieser Datei nicht zum Commit "
"vormerken\n"
-#, c-format, perl-format
+#, c-format
msgid "Stash mode change [y,n,q,a,d%s,?]? "
msgstr "Modusänderung stashen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash deletion [y,n,q,a,d%s,?]? "
msgstr "Löschung stashen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash addition [y,n,q,a,d%s,?]? "
msgstr "Ergänzung stashen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash this hunk [y,n,q,a,d%s,?]? "
msgstr "Diesen Patch-Block stashen [y,n,q,a,d%s,?]? "
@@ -246,19 +246,19 @@ msgstr ""
"a - diesen und alle weiteren Patch-Blöcke dieser Datei stashen\n"
"d - diesen oder alle weiteren Patch-Blöcke dieser Datei nicht stashen\n"
-#, c-format, perl-format
+#, c-format
msgid "Unstage mode change [y,n,q,a,d%s,?]? "
msgstr "Modusänderung aus der Staging-Area entfernen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage deletion [y,n,q,a,d%s,?]? "
msgstr "Löschung aus der Staging-Area entfernen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage addition [y,n,q,a,d%s,?]? "
msgstr "Ergänzung aus der Staging-Area entfernen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage this hunk [y,n,q,a,d%s,?]? "
msgstr "Diesen Patch-Block aus der Staging-Area entfernen [y,n,q,a,d%s,?]? "
@@ -285,19 +285,19 @@ msgstr ""
"d - diesen oder alle weiteren Patch-Blöcke dieser Datei nicht aus Staging-"
"Area entfernen\n"
-#, c-format, perl-format
+#, c-format
msgid "Apply mode change to index [y,n,q,a,d%s,?]? "
msgstr "Modusänderung auf Index anwenden [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply deletion to index [y,n,q,a,d%s,?]? "
msgstr "Löschung auf Index anwenden [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply addition to index [y,n,q,a,d%s,?]? "
msgstr "Ergänzung auf Index anwenden [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply this hunk to index [y,n,q,a,d%s,?]? "
msgstr "Diesen Patch-Block auf Index anwenden [y,n,q,a,d%s,?]? "
@@ -324,19 +324,19 @@ msgstr ""
"d - diesen oder alle weiteren Patch-Blöcke dieser Datei nicht auf den Index "
"anwenden\n"
-#, c-format, perl-format
+#, c-format
msgid "Discard mode change from worktree [y,n,q,a,d%s,?]? "
msgstr "Modusänderung im Arbeitsverzeichnis verwerfen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard deletion from worktree [y,n,q,a,d%s,?]? "
msgstr "Löschung im Arbeitsverzeichnis verwerfen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard addition from worktree [y,n,q,a,d%s,?]? "
msgstr "Ergänzung im Arbeitsverzeichnis verwerfen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard this hunk from worktree [y,n,q,a,d%s,?]? "
msgstr "Diesen Patch-Block im Arbeitsverzeichnis verwerfen [y,n,q,a,d%s,?]? "
@@ -363,20 +363,20 @@ msgstr ""
"d - diesen oder alle weiteren Patch-Blöcke dieser Datei nicht im "
"Arbeitsverzeichnis verwerfen\n"
-#, c-format, perl-format
+#, 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,?]? "
-#, c-format, perl-format
+#, 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,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard addition from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Ergänzung im Index und Arbeitsverzeichnis verwerfen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, 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,"
@@ -395,20 +395,20 @@ msgstr ""
"a - diesen und alle weiteren Patch-Blöcke in der Datei verwerfen\n"
"d - diesen oder alle weiteren Patch-Blöcke in der Datei nicht verwerfen\n"
-#, c-format, perl-format
+#, c-format
msgid "Apply mode change to index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
"Modusänderung auf Index und Arbeitsverzeichnis anwenden [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply deletion to index and worktree [y,n,q,a,d%s,?]? "
msgstr "Löschung auf Index und Arbeitsverzeichnis anwenden [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply addition to index and worktree [y,n,q,a,d%s,?]? "
msgstr "Ergänzung auf Index und Arbeitsverzeichnis anwenden [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply this hunk to index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
"Diesen Patch-Block auf Index und Arbeitsverzeichnis anwenden [y,n,q,a,"
@@ -428,6 +428,23 @@ msgstr ""
"a - diesen und alle weiteren Patch-Blöcke in der Datei anwenden\n"
"d - diesen oder alle weiteren Patch-Blöcke in der Datei nicht anwenden\n"
+#, c-format
+msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
+msgstr "Modusänderung auf Arbeitsverzeichnis anwenden [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
+msgstr "Löschung auf Arbeitsverzeichnis anwenden [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
+msgstr "Ergänzung auf Arbeitsverzeichnis anwenden [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
+msgstr ""
+"Diesen Patch-Block auf das Arbeitsverzeichnis anwenden [y,n,q,a,d%s,?]? "
+
msgid ""
"y - apply this hunk to worktree\n"
"n - do not apply this hunk to worktree\n"
@@ -445,10 +462,6 @@ msgstr ""
msgid "could not parse hunk header '%.*s'"
msgstr "Konnte Block-Header '%.*s' nicht parsen."
-#, c-format
-msgid "could not parse colored hunk header '%.*s'"
-msgstr "Konnte farbigen Block-Header '%.*s' nicht parsen."
-
msgid "could not parse diff"
msgstr "konnte Diff nicht parsen"
@@ -506,8 +519,6 @@ msgstr ""
"Um '%c' Zeilen zu entfernen, löschen Sie diese.\n"
"Zeilen, die mit %c beginnen, werden entfernt.\n"
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: 'it' refers to the patch mentioned in the previous messages.
msgid ""
"If it does not apply cleanly, you will be given an opportunity to\n"
"edit again. If all lines of the hunk are removed, then the edit is\n"
@@ -524,20 +535,12 @@ msgstr "konnte Block-Header nicht parsen"
msgid "'git apply --cached' failed"
msgstr "'git apply --cached' schlug fehl"
-#. #-#-#-#-# add-patch.c.po #-#-#-#-#
#. TRANSLATORS: do not translate [y/n]
#. The program will only accept that input at this point.
#. Consider translating (saying "no" discards!) as
#. (saying "n" for "no" discards!) if the translation
#. of the word "no" does not start with n.
#.
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: do not translate [y/n]
-#. The program will only accept that input
-#. at this point.
-#. Consider translating (saying "no" discards!) as
-#. (saying "n" for "no" discards!) if the translation
-#. of the word "no" does not start with n.
msgid ""
"Your edited hunk does not apply. Edit again (saying \"no\" discards!) [y/n]? "
msgstr ""
@@ -661,9 +664,9 @@ msgid "Reverting is not possible because you have unmerged files."
msgstr ""
"Reverten ist nicht möglich, weil Sie nicht zusammengeführte Dateien haben."
-#, c-format
-msgid "It is not possible to %s because you have unmerged files."
-msgstr "%s ist nicht möglich, weil Sie nicht zusammengeführte Dateien haben."
+msgid "Rebasing is not possible because you have unmerged files."
+msgstr ""
+"Rebase ist nicht möglich, weil Sie nicht zusammengeführte Dateien haben."
msgid ""
"Fix them up in the work tree, and then use 'git add/rm <file>'\n"
@@ -685,6 +688,24 @@ msgstr "Bitte committen Sie Ihre Änderungen, bevor Sie mergen."
msgid "Exiting because of unfinished merge."
msgstr "Beende wegen nicht abgeschlossenem Merge."
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"Abweichende Branches können nicht vorgespult werden, benutzen Sie "
+"stattdessen:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"oder:\n"
+"\n"
+"\tgit rebase\n"
+
msgid "Not possible to fast-forward, aborting."
msgstr "Vorspulen nicht möglich, breche ab."
@@ -750,12 +771,35 @@ msgstr ""
"'advice.detachedHead' auf 'false' setzen.\n"
"\n"
+#, c-format
+msgid ""
+"The following paths have been moved outside the\n"
+"sparse-checkout definition but are not sparse due to local\n"
+"modifications.\n"
+msgstr ""
+"Die folgenden Pfade wurden aus der partiellen Checkout-Definition\n"
+"verschoben, sind aber aufgrund lokaler Änderungen nicht partiell.\n"
+
+msgid ""
+"To correct the sparsity of these paths, do the following:\n"
+"* Use \"git add --sparse <paths>\" to update the index\n"
+"* Use \"git sparse-checkout reapply\" to apply the sparsity rules"
+msgstr ""
+"Um den partiellen Checkout dieser Pfade zu korrigieren, gehen Sie wie folgt "
+"vor:\n"
+"* Verwenden Sie \"git add --sparse <Pfade>\", um den Index zu aktualisieren\n"
+"* Verwenden Sie \"git sparse-checkout reapply\", um die Regeln für partielle "
+"Checkouts anzuwenden"
+
msgid "cmdline ends with \\"
msgstr "Befehlszeile endet mit \\"
msgid "unclosed quote"
msgstr "nicht geschlossene Anführungszeichen"
+msgid "too many arguments"
+msgstr "zu viele Argumente"
+
#, c-format
msgid "unrecognized whitespace option '%s'"
msgstr "Nicht erkannte Whitespace-Option: '%s'"
@@ -772,6 +816,12 @@ msgstr "die Optionen '%s' und '%s' können nicht gemeinsam verwendet werden"
msgid "'%s' outside a repository"
msgstr "'%s' außerhalb eines Repositories"
+msgid "failed to read patch"
+msgstr "Patch konnte nicht gelesen werden"
+
+msgid "patch too large"
+msgstr "Patch zu groß"
+
#, c-format
msgid "Cannot prepare timestamp regexp %s"
msgstr "Kann regulären Ausdruck für Zeitstempel %s nicht verarbeiten"
@@ -1118,6 +1168,10 @@ msgid "cannot open %s"
msgstr "kann '%s' nicht öffnen"
#, c-format
+msgid "cannot unlink '%s'"
+msgstr "Kann '%s' nicht löschen."
+
+#, c-format
msgid "Hunk #%d applied cleanly."
msgstr "Patch-Bereich #%d sauber angewendet."
@@ -1272,6 +1326,10 @@ msgid "unsupported file mode: 0%o (SHA1: %s)"
msgstr "Nicht unterstützter Dateimodus: 0%o (SHA1: %s)"
#, c-format
+msgid "deflate error (%d)"
+msgstr "Fehler beim Komprimieren (%d)"
+
+#, c-format
msgid "unable to start '%s' filter"
msgstr "konnte '%s' Filter nicht starten"
@@ -1291,10 +1349,6 @@ msgid "path too long (%d chars, SHA1: %s): %s"
msgstr "Pfad zu lang (%d Zeichen, SHA1: %s): %s"
#, c-format
-msgid "deflate error (%d)"
-msgstr "Fehler beim Komprimieren (%d)"
-
-#, c-format
msgid "timestamp too large for this system: %<PRIuMAX>"
msgstr "Timestamp zu groß für dieses System: %<PRIuMAX>"
@@ -1315,6 +1369,11 @@ msgid "cannot read '%s'"
msgstr "kann '%s' nicht lesen"
#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr ""
+"Pfadspezifikation '%s' findet Dateien außerhalb des aktuellen Verzeichnisses"
+
+#, c-format
msgid "pathspec '%s' did not match any files"
msgstr "Pfadspezifikation '%s' stimmt mit keinen Dateien überein"
@@ -1330,9 +1389,6 @@ msgstr "Kein gültiger Objektname: %s"
msgid "not a tree object: %s"
msgstr "Kein Tree-Objekt: %s"
-msgid "current working directory is untracked"
-msgstr "aktuelles Arbeitsverzeichnis ist unversioniert"
-
#, c-format
msgid "File not found: %s"
msgstr "Datei nicht gefunden: %s"
@@ -1383,6 +1439,12 @@ msgstr ".gitattributes aus dem Arbeitsverzeichnis lesen"
msgid "report archived files on stderr"
msgstr "archivierte Dateien in der Standard-Fehlerausgabe ausgeben"
+msgid "time"
+msgstr "Zeit"
+
+msgid "set modification time of archive entries"
+msgstr "Änderungszeitpunkt von Archiveinträgen festlegen"
+
msgid "set compression level"
msgstr "Komprimierungsgrad setzen"
@@ -1412,6 +1474,10 @@ msgid "Unexpected option --output"
msgstr "Unerwartete Option --output"
#, c-format
+msgid "extra command line parameter '%s'"
+msgstr "zusätzlicher Befehlszeilenparameter '%s'"
+
+#, c-format
msgid "Unknown archive format '%s'"
msgstr "Unbekanntes Archivformat '%s'"
@@ -1423,6 +1489,13 @@ msgstr "Argument für Format '%s' nicht unterstützt: -%d"
msgid "%.*s is not a valid attribute name"
msgstr "%.*s ist kein gültiger Attributname"
+msgid "unable to add additional attribute"
+msgstr "konnte kein zusätzliches Attribut hinzufügen"
+
+#, c-format
+msgid "ignoring overly long attributes line %d"
+msgstr "ignoriere übermäßig lange Attribut-Zeile %d"
+
#, c-format
msgid "%s not allowed: %s:%d"
msgstr "%s nicht erlaubt: %s:%d"
@@ -1435,6 +1508,29 @@ msgstr ""
"Benutzen Sie '\\!' für führende Ausrufezeichen."
#, c-format
+msgid "cannot fstat gitattributes file '%s'"
+msgstr "Kann gitattributes-Datei '%s' nicht lesen"
+
+#, c-format
+msgid "ignoring overly large gitattributes file '%s'"
+msgstr "ignoriere übermäßig große gitattributes-Datei '%s'"
+
+#, c-format
+msgid "ignoring overly large gitattributes blob '%s'"
+msgstr "ignoriere übermäßig großen gitattribute-Blob '%s'"
+
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "ungültiges --attr-source oder GIT_ATTR_SOURCE"
+
+#, c-format
+msgid "unable to stat '%s'"
+msgstr "konnte '%s' nicht lesen"
+
+#, c-format
+msgid "unable to read %s"
+msgstr "kann %s nicht lesen"
+
+#, c-format
msgid "Badly quoted content in file '%s': %s"
msgstr "Ungültiger Inhalt bzgl. Anführungszeichen in Datei '%s': %s"
@@ -1540,10 +1636,6 @@ msgstr[1] "Binäre Suche: danach noch %d Commits zum Testen übrig %s\n"
msgid "--contents and --reverse do not blend well."
msgstr "--contents und --reverse funktionieren gemeinsam nicht."
-msgid "cannot use --contents with final commit object name"
-msgstr ""
-"kann --contents nicht mit endgültigem Namen des Commit-Objektes benutzen"
-
msgid "--reverse and --first-parent together require specified latest commit"
msgstr ""
"--reverse und --first-parent zusammen erfordern die Angabe eines "
@@ -1618,12 +1710,10 @@ msgstr ""
msgid "not tracking: ambiguous information for ref '%s'"
msgstr "kein Tracking: mehrdeutige Informationen für Referenz '%s'"
-#. #-#-#-#-# branch.c.po #-#-#-#-#
#. TRANSLATORS: This is a line listing a remote with duplicate
#. refspecs in the advice message below. For RTL languages you'll
#. probably want to swap the "%s" and leading " " space around.
#.
-#. #-#-#-#-# object-name.c.po #-#-#-#-#
#. TRANSLATORS: This is line item of ambiguous object output
#. from describe_ambiguous_object() above. For RTL languages
#. you'll probably want to swap the "%s" and leading " " space
@@ -1666,9 +1756,10 @@ msgid "a branch named '%s' already exists"
msgstr "Branch '%s' existiert bereits"
#, c-format
-msgid "cannot force update the branch '%s' checked out at '%s'"
+msgid "cannot force update the branch '%s' used by worktree at '%s'"
msgstr ""
-"kann Aktualisierung des Branches '%s' nicht erzwingen, ausgecheckt in '%s'"
+"Aktualisierung des vom Arbeitsverzeichnis '%2$s' verwendete Branch '%1$s' "
+"kann nicht erzwungen werden"
#, c-format
msgid "cannot set up tracking information; starting point '%s' is not a branch"
@@ -1717,23 +1808,19 @@ msgstr "Submodul '%s': Submodul konnte nicht gefunden werden"
#, c-format
msgid ""
-"You may try updating the submodules using 'git checkout %s && git submodule "
-"update --init'"
+"You may try updating the submodules using 'git checkout --no-recurse-"
+"submodules %s && git submodule update --init'"
msgstr ""
-"Sie können versuchen die Submodule mit 'git checkout %s && git submodule "
-"update --init' zu aktualisieren"
+"Sie können versuchen, die Submodule mit \"git checkout --no-recurse-"
+"submodules %s && git submodule update --init\" zu aktualisieren."
#, c-format
msgid "submodule '%s': cannot create branch '%s'"
msgstr "Submodul '%s': kann Branch nicht erzeugen: '%s'"
#, c-format
-msgid "'%s' is already checked out at '%s'"
-msgstr "'%s' ist bereits in '%s' ausgecheckt"
-
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "HEAD des Arbeitsverzeichnisses %s ist nicht aktualisiert"
+msgid "'%s' is already used by worktree at '%s'"
+msgstr "'%s' wird bereits von Arbeitsverzeichnis in '%s' verwendet"
msgid "git add [<options>] [--] <pathspec>..."
msgstr "git add [<Optionen>] [--] <Pfadspezifikation>..."
@@ -1742,40 +1829,33 @@ msgstr "git add [<Optionen>] [--] <Pfadspezifikation>..."
msgid "cannot chmod %cx '%s'"
msgstr "kann chmod %cx '%s' nicht ausführen"
-#, c-format
-msgid "unexpected diff status %c"
-msgstr "unerwarteter Differenz-Status %c"
-
-msgid "updating files failed"
-msgstr "Aktualisierung der Dateien fehlgeschlagen"
-
-#, c-format
-msgid "remove '%s'\n"
-msgstr "lösche '%s'\n"
-
msgid "Unstaged changes after refreshing the index:"
msgstr ""
"Nicht zum Commit vorgemerkte Änderungen nach Aktualisierung der Staging-Area:"
-msgid "Could not read the index"
-msgstr "Konnte den Index nicht lesen"
+msgid ""
+"the add.interactive.useBuiltin setting has been removed!\n"
+"See its entry in 'git help config' for details."
+msgstr ""
+"Die Einstellung add.interactive.useBuiltin wurde entfernt!\n"
+"Siehe den Eintrag in 'git help config' für Details."
-msgid "Could not write patch"
-msgstr "Konnte Patch nicht schreiben"
+msgid "could not read the index"
+msgstr "konnte den Index nicht lesen"
msgid "editing patch failed"
msgstr "Bearbeitung des Patches fehlgeschlagen"
#, c-format
-msgid "Could not stat '%s'"
-msgstr "Konnte Verzeichnis '%s' nicht lesen"
+msgid "could not stat '%s'"
+msgstr "Konnte '%s' nicht lesen."
-msgid "Empty patch. Aborted."
-msgstr "Leerer Patch. Abgebrochen."
+msgid "empty patch. aborted"
+msgstr "leerer Patch. Abgebrochen"
#, c-format
-msgid "Could not apply '%s'"
-msgstr "Konnte '%s' nicht anwenden."
+msgid "could not apply '%s'"
+msgstr "konnte '%s' nicht anwenden"
msgid "The following paths are ignored by one of your .gitignore files:\n"
msgstr ""
@@ -1914,6 +1994,9 @@ msgstr ""
msgid "index file corrupt"
msgstr "Index-Datei beschädigt"
+msgid "unable to write new index file"
+msgstr "Konnte neue Index-Datei nicht schreiben."
+
#, c-format
msgid "bad action '%s' for '%s'"
msgstr "ungültige Aktion '%s' für '%s'"
@@ -2128,9 +2211,6 @@ msgstr ""
"Sie können `git rm` auf Dateien ausführen, um \"von denen gelöscht\" für\n"
"diese zu akzeptieren."
-msgid "unable to write new index file"
-msgstr "Konnte neue Index-Datei nicht schreiben."
-
#, c-format
msgid "Could not parse object '%s'."
msgstr "Konnte Objekt '%s' nicht parsen."
@@ -2149,11 +2229,6 @@ msgstr ""
msgid "failed to read '%s'"
msgstr "Fehler beim Lesen von '%s'"
-#, c-format
-msgid "options '%s=%s' and '%s=%s' cannot be used together"
-msgstr ""
-"die Optionen '%s=%s' und '%s=%s' können nicht gemeinsam verwendet werden"
-
msgid "git am [<options>] [(<mbox> | <Maildir>)...]"
msgstr "git am [<Optionen>] [(<mbox> | <E-Mail-Verzeichnis>)...]"
@@ -2163,6 +2238,9 @@ msgstr "git am [<Optionen>] (--continue | --skip | --abort)"
msgid "run interactively"
msgstr "interaktiv ausführen"
+msgid "bypass pre-applypatch and applypatch-msg hooks"
+msgstr "Hooks pre-applypatch und applypatch-msg umgehen"
+
msgid "historical option -- no-op"
msgstr "historische Option -- kein Effekt"
@@ -2190,9 +2268,6 @@ msgstr "-m an git-mailinfo übergeben"
msgid "pass --keep-cr flag to git-mailsplit for mbox format"
msgstr "--keep-cr an git-mailsplit für mbox-Format übergeben"
-msgid "do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"
-msgstr "kein --keep-cr an git-mailsplit übergeben, unabhängig von am.keepcr"
-
msgid "strip everything before a scissors line"
msgstr "alles vor einer Scheren-Zeile entfernen"
@@ -2304,32 +2379,28 @@ msgstr "git archive: Protokollfehler"
msgid "git archive: expected a flush"
msgstr "git archive: erwartete eine Spülung (flush)"
-msgid "git bisect--helper --bisect-reset [<commit>]"
-msgstr "git bisect--helper --bisect-reset [<Commit>]"
-
msgid ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<term> --term-{old,good}"
-"=<term>] [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] "
-"[<paths>...]"
+"git bisect start [--term-(new|bad)=<term> --term-(old|good)=<term>] [--no-"
+"checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]"
msgstr ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<Begriff> --term-{old,"
-"good}=<Begriff>] [--no-checkout] [--first-parent] [<schlecht> [<gut>...]] "
-"[--] [<Pfade>...]"
+"git bisect start [--term-(new|bad)=<Begriff> --term-(old|good)=<Begriff>] "
+"[--no-checkout] [--first-parent] [<schlecht> [<gut>...]] [--] "
+"[<Pfadspezifikation>...]"
-msgid "git bisect--helper --bisect-state (bad|new) [<rev>]"
-msgstr "git bisect--helper --bisect-state (bad|new) [<Commit>]"
+msgid "git bisect (good|bad) [<rev>...]"
+msgstr "git bisect (good|bad) [<Commit>...]"
-msgid "git bisect--helper --bisect-state (good|old) [<rev>...]"
-msgstr "git bisect--helper --bisect-state (good|old) [<Commit>...]"
+msgid "git bisect skip [(<rev>|<range>)...]"
+msgstr "git bisect skip [(<Commit>|<Bereich>)...]"
-msgid "git bisect--helper --bisect-replay <filename>"
-msgstr "git bisect--helper --bisect-replay <Dateiname>"
+msgid "git bisect reset [<commit>]"
+msgstr "git bisect reset [<Commit>]"
-msgid "git bisect--helper --bisect-skip [(<rev>|<range>)...]"
-msgstr "git bisect--helper --bisect-skip [(<Commit>|<Bereich>)...]"
+msgid "git bisect replay <logfile>"
+msgstr "git bisect replay <Logdatei>"
-msgid "git bisect--helper --bisect-run <cmd>..."
-msgstr "git bisect--helper --bisect-run <Programm>..."
+msgid "git bisect run <cmd> [<arg>...]"
+msgstr "git bisect run <Programm> [<Argument>...]"
#, c-format
msgid "cannot open file '%s' in mode '%s'"
@@ -2476,10 +2547,6 @@ msgstr ""
"Auschecken von '%s' fehlgeschlagen. Versuchen Sie 'git bisect start "
"<gültiger-Branch>'."
-msgid "won't bisect on cg-seek'ed tree"
-msgstr ""
-"binäre Suche auf einem durch 'cg-seek' geändertem Verzeichnis nicht möglich"
-
msgid "bad HEAD - strange symbolic ref"
msgstr "ungültiger HEAD - merkwürdige symbolische Referenz"
@@ -2531,16 +2598,16 @@ msgid "bisect run failed: no command provided."
msgstr "'bisect run' fehlgeschlagen: kein Befehl angegeben."
#, c-format
-msgid "unable to verify '%s' on good revision"
-msgstr "konnte '%s' nicht für guten Commit überprüfen"
+msgid "unable to verify %s on good revision"
+msgstr "kann %s bei gutem Commit nicht verifizieren"
#, c-format
msgid "bogus exit code %d for good revision"
msgstr "fehlerhafter Exit-Code %d für guten Commit"
#, c-format
-msgid "bisect run failed: exit code %d from '%s' is < 0 or >= 128"
-msgstr "'bisect run' fehlgeschlagen: Exit-Code %d von '%s' ist < 0 oder >= 128"
+msgid "bisect run failed: exit code %d from %s is < 0 or >= 128"
+msgstr "bisect-Lauf fehlgeschlagen: Exit-Code %d von %s ist < 0 oder >= 128"
#, c-format
msgid "cannot open file '%s' for writing"
@@ -2549,76 +2616,49 @@ msgstr "Datei '%s' kann nicht zum Schreiben geöffnet werden"
msgid "bisect run cannot continue any more"
msgstr "'bisect run' kann nicht mehr fortgesetzt werden"
-#, c-format
msgid "bisect run success"
msgstr "'bisect run' erfolgreich ausgeführt"
-#, c-format
msgid "bisect found first bad commit"
msgstr "binäre Suche fand ersten schlechten Commit"
#, c-format
-msgid ""
-"bisect run failed: 'git bisect--helper --bisect-state %s' exited with error "
-"code %d"
+msgid "bisect run failed: 'git bisect %s' exited with error code %d"
msgstr ""
-"'bisect run' fehlgeschlagen: 'git bisect--helper --bisect-state %s' mit "
-"Fehlercode %d beendet"
-
-msgid "reset the bisection state"
-msgstr "den Zustand der binären Suche zurücksetzen"
-
-msgid "check whether bad or good terms exist"
-msgstr "prüfen, ob Begriffe für gute und schlechte Commits existieren"
-
-msgid "print out the bisect terms"
-msgstr "die Begriffe für die binäre Suche ausgeben"
-
-msgid "start the bisect session"
-msgstr "Sitzung für binäre Suche starten"
-
-msgid "find the next bisection commit"
-msgstr "nächsten Commit für die binäre Suche finden"
-
-msgid "mark the state of ref (or refs)"
-msgstr "den Status der Referenz(en) markieren"
-
-msgid "list the bisection steps so far"
-msgstr "die bisherigen Schritte der binären Suche auflisten"
-
-msgid "replay the bisection process from the given file"
-msgstr "binäre Suche aus der angegebenen Datei wiederholen"
+"bisect-Lauf fehlgeschlagen: 'git bisect %s' wurde mit Fehlercode %d beendet"
-msgid "skip some commits for checkout"
-msgstr "einige Commits für das Auschecken überspringen"
-
-msgid "visualize the bisection"
-msgstr "binäre Suche visualisieren"
-
-msgid "use <cmd>... to automatically bisect"
-msgstr "verwende <Programm>... für die automatische binäre Suche"
+#, c-format
+msgid "'%s' requires either no argument or a commit"
+msgstr "'%s' erfordert entweder kein Argument oder einen Commit"
-msgid "no log for BISECT_WRITE"
-msgstr "kein Log für BISECT_WRITE"
+#, c-format
+msgid "'%s' requires 0 or 1 argument"
+msgstr "'%s' erfordert 0 oder 1 Argument"
-msgid "--bisect-reset requires either no argument or a commit"
-msgstr "--bisect-reset benötigt entweder kein Argument oder ein Commit"
+#, c-format
+msgid "'%s' requires 0 arguments"
+msgstr "'%s' erfordert 0 Argumente"
-msgid "--bisect-terms requires 0 or 1 argument"
-msgstr "--bisect-terms benötigt 0 oder 1 Argument"
+msgid "no logfile given"
+msgstr "keine Log-Datei angegeben"
-msgid "--bisect-next requires 0 arguments"
-msgstr "--bisect-next benötigt 0 Argumente"
+#, c-format
+msgid "'%s' failed: no command provided."
+msgstr "'%s' ist fehlgeschlagen: kein Befehl angegeben."
-msgid "--bisect-log requires 0 arguments"
-msgstr "--bisect-log benötigt 0 Argumente"
+msgid "need a command"
+msgstr "Befehl benötigt"
-msgid "no logfile given"
-msgstr "keine Log-Datei angegeben"
+#, c-format
+msgid "unknown command: '%s'"
+msgstr "unbekannter Befehl: '%s'"
msgid "git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"
msgstr "git blame [<Optionen>] [<rev-opts>] [<Commit>] [--] <Datei>"
+msgid "git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"
+msgstr "git annotate [<Optionen>] [<rev-opts>] [<Commit>] [--] <Datei>"
+
msgid "<rev-opts> are documented in git-rev-list(1)"
msgstr "<rev-opts> sind dokumentiert in git-rev-list(1)"
@@ -2782,52 +2822,59 @@ msgstr "git branch [<Optionen>] [-r | -a] [--format]"
#, c-format
msgid ""
"deleting branch '%s' that has been merged to\n"
-" '%s', but not yet merged to HEAD."
+" '%s', but not yet merged to HEAD"
msgstr ""
-"entferne Branch '%s', der zusammengeführt wurde mit\n"
-" '%s', aber noch nicht mit HEAD zusammengeführt wurde."
+"Löschen des Branches '%s', der mit\n"
+" '%s', aber noch nicht in HEAD zusammengeführt wurde"
#, c-format
msgid ""
"not deleting branch '%s' that is not yet merged to\n"
-" '%s', even though it is merged to HEAD."
+" '%s', even though it is merged to HEAD"
msgstr ""
"entferne Branch '%s' nicht, der noch nicht zusammengeführt wurde mit\n"
-" '%s', obwohl er mit HEAD zusammengeführt wurde."
+" '%s', obwohl er mit HEAD zusammengeführt wurde"
#, c-format
-msgid "Couldn't look up commit object for '%s'"
-msgstr "Konnte Commit-Objekt für '%s' nicht nachschlagen."
+msgid "couldn't look up commit object for '%s'"
+msgstr "konnte Commit-Objekt für '%s' nicht nachschlagen"
#, c-format
-msgid ""
-"The branch '%s' is not fully merged.\n"
-"If you are sure you want to delete it, run 'git branch -D %s'."
+msgid "the branch '%s' is not fully merged"
+msgstr "der Branch '%s' ist nicht vollständig zusammengeführt"
+
+#, c-format
+msgid "If you are sure you want to delete it, run 'git branch -D %s'"
msgstr ""
-"Der Branch '%s' ist nicht vollständig zusammengeführt.\n"
-"Wenn Sie sicher sind diesen Branch zu entfernen, führen Sie 'git branch -D "
-"%s' aus."
+"Wenn Sie sicher sind, dass Sie den Branch löschen wollen, führen Sie 'git "
+"branch -D %s' aus."
-msgid "Update of config-file failed"
+msgid "update of config-file failed"
msgstr "Aktualisierung der Konfigurationsdatei fehlgeschlagen."
msgid "cannot use -a with -d"
msgstr "kann -a nicht mit -d benutzen"
-msgid "Couldn't look up commit object for HEAD"
-msgstr "Konnte Commit-Objekt für HEAD nicht nachschlagen."
-
#, c-format
-msgid "Cannot delete branch '%s' checked out at '%s'"
-msgstr "Kann Branch '%s' nicht entfernen, ausgecheckt in '%s'."
+msgid "cannot delete branch '%s' used by worktree at '%s'"
+msgstr ""
+"kann Branch '%s' nicht löschen, der in Arbeitsverzeichnis '%s' verwendet wird"
#, c-format
-msgid "remote-tracking branch '%s' not found."
+msgid "remote-tracking branch '%s' not found"
msgstr "Remote-Tracking-Branch '%s' nicht gefunden"
#, c-format
-msgid "branch '%s' not found."
-msgstr "Branch '%s' nicht gefunden."
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"Branch '%s' nicht gefunden.\n"
+"Haben Sie --remote vergessen?"
+
+#, c-format
+msgid "branch '%s' not found"
+msgstr "Branch '%s' nicht gefunden"
#, c-format
msgid "Deleted remote-tracking branch %s (was %s).\n"
@@ -2848,53 +2895,56 @@ msgid "HEAD (%s) points outside of refs/heads/"
msgstr "HEAD (%s) wurde nicht unter \"refs/heads/\" gefunden!"
#, c-format
-msgid "Branch %s is being rebased at %s"
-msgstr "Branch %s wird auf %s umgesetzt"
+msgid "branch %s is being rebased at %s"
+msgstr "Rebase von Branch %s in %s im Gange"
#, c-format
-msgid "Branch %s is being bisected at %s"
-msgstr "Binäre Suche von Branch %s zu %s im Gange"
+msgid "branch %s is being bisected at %s"
+msgstr "Binäre Suche von Branch %s in %s im Gange"
-msgid "cannot copy the current branch while not on any."
-msgstr ""
-"Kann den aktuellen Branch nicht kopieren, solange Sie sich auf keinem "
-"befinden."
-
-msgid "cannot rename the current branch while not on any."
-msgstr ""
-"Kann aktuellen Branch nicht umbenennen, solange Sie sich auf keinem befinden."
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "HEAD des Arbeitsverzeichnisses %s ist nicht aktualisiert"
#, c-format
-msgid "Invalid branch name: '%s'"
+msgid "invalid branch name: '%s'"
msgstr "Ungültiger Branchname: '%s'"
-msgid "Branch rename failed"
+#, c-format
+msgid "no commit on branch '%s' yet"
+msgstr "Noch kein Commit in Branch '%s'"
+
+#, c-format
+msgid "no branch named '%s'"
+msgstr "kein Branch mit dem Namen '%s'"
+
+msgid "branch rename failed"
msgstr "Umbenennung des Branches fehlgeschlagen"
-msgid "Branch copy failed"
+msgid "branch copy failed"
msgstr "Kopie des Branches fehlgeschlagen"
#, c-format
-msgid "Created a copy of a misnamed branch '%s'"
-msgstr "Kopie eines falsch benannten Branches '%s' erstellt."
+msgid "created a copy of a misnamed branch '%s'"
+msgstr "Kopie eines falsch benannten Branches '%s' erstellt"
#, c-format
-msgid "Renamed a misnamed branch '%s' away"
+msgid "renamed a misnamed branch '%s' away"
msgstr "falsch benannten Branch '%s' umbenannt"
#, c-format
-msgid "Branch renamed to %s, but HEAD is not updated!"
-msgstr "Branch umbenannt zu %s, aber HEAD ist nicht aktualisiert!"
+msgid "branch renamed to %s, but HEAD is not updated"
+msgstr "Branch wird in %s umbenannt, aber HEAD wird nicht aktualisiert"
-msgid "Branch is renamed, but update of config-file failed"
+msgid "branch is renamed, but update of config-file failed"
msgstr ""
-"Branch ist umbenannt, aber die Aktualisierung der Konfigurationsdatei ist "
-"fehlgeschlagen."
+"Branch wurde umbenannt, aber die Aktualisierung der Konfigurationsdatei\n"
+"ist fehlgeschlagen"
-msgid "Branch is copied, but update of config-file failed"
+msgid "branch is copied, but update of config-file failed"
msgstr ""
-"Branch wurde kopiert, aber die Aktualisierung der Konfigurationsdatei ist\n"
-"fehlgeschlagen."
+"Branch wurde kopiert, aber die Aktualisierung der Konfigurationsdatei\n"
+"ist fehlgeschlagen"
#, c-format
msgid ""
@@ -2961,6 +3011,9 @@ msgid "move/rename a branch, even if target exists"
msgstr ""
"einen Branch verschieben/umbenennen, auch wenn das Ziel bereits existiert"
+msgid "do not output a newline after empty formatted refs"
+msgstr "keinen Zeilenumbruch nach leer formatierten Referenzen ausgeben"
+
msgid "copy a branch and its reflog"
msgstr "einen Branch und dessen Reflog kopieren"
@@ -3006,8 +3059,8 @@ msgstr "Rekursion in Submodulen durchführen"
msgid "format to use for the output"
msgstr "für die Ausgabe zu verwendendes Format"
-msgid "Failed to resolve HEAD as a valid ref."
-msgstr "Konnte HEAD nicht als gültige Referenz auflösen."
+msgid "failed to resolve HEAD as a valid ref"
+msgstr "HEAD konnte nicht als gültige Referenz aufgelöst werden"
msgid "HEAD not found below refs/heads!"
msgstr "HEAD wurde nicht unter \"refs/heads\" gefunden!"
@@ -3025,19 +3078,20 @@ msgstr "--recurse-submodules kann nur genutzt werden, um Branches zu erstellen"
msgid "branch name required"
msgstr "Branchname erforderlich"
-msgid "Cannot give description to detached HEAD"
+msgid "cannot give description to detached HEAD"
msgstr "zu losgelöstem HEAD kann keine Beschreibung hinterlegt werden"
msgid "cannot edit description of more than one branch"
msgstr "Beschreibung von mehr als einem Branch kann nicht bearbeitet werden"
-#, c-format
-msgid "No commit on branch '%s' yet."
-msgstr "Noch kein Commit in Branch '%s'."
+msgid "cannot copy the current branch while not on any"
+msgstr ""
+"Kann den aktuellen Branch nicht kopieren, solange Sie sich auf keinem "
+"befinden."
-#, c-format
-msgid "No branch named '%s'."
-msgstr "Branch '%s' nicht vorhanden."
+msgid "cannot rename the current branch while not on any"
+msgstr ""
+"Kann aktuellen Branch nicht umbenennen, solange Sie sich auf keinem befinden."
msgid "too many branches for a copy operation"
msgstr "zu viele Branches für eine Kopieroperation angegeben"
@@ -3050,10 +3104,10 @@ msgstr "zu viele Argumente angegeben, um Upstream-Branch zu setzen"
#, c-format
msgid ""
-"could not set upstream of HEAD to %s when it does not point to any branch."
+"could not set upstream of HEAD to %s when it does not point to any branch"
msgstr ""
-"Konnte keinen neuen Upstream-Branch von HEAD zu %s setzen, da dieser auf\n"
-"keinen Branch zeigt."
+"konnte den Upstream von HEAD nicht auf %s setzen, wenn er auf keinen Zweig "
+"verweist"
#, c-format
msgid "no such branch '%s'"
@@ -3068,17 +3122,17 @@ msgstr ""
"zu viele Argumente angegeben, um Konfiguration zu Upstream-Branch zu "
"entfernen"
-msgid "could not unset upstream of HEAD when it does not point to any branch."
+msgid "could not unset upstream of HEAD when it does not point to any branch"
msgstr ""
-"Konnte Konfiguration zu Upstream-Branch von HEAD nicht entfernen, da dieser\n"
-"auf keinen Branch zeigt."
+"konnte den Upstream von HEAD nicht aufheben, wenn er nicht auf einen Zweig "
+"verweist"
#, c-format
-msgid "Branch '%s' has no upstream information"
-msgstr "Branch '%s' hat keinen Upstream-Branch gesetzt"
+msgid "branch '%s' has no upstream information"
+msgstr "Branch '%s' hat keine Upstream-Informationen"
msgid ""
-"The -a, and -r, options to 'git branch' do not take a branch name.\n"
+"the -a, and -r, options to 'git branch' do not take a branch name.\n"
"Did you mean to use: -a|-r --list <pattern>?"
msgstr ""
"Die Optionen -a und -r bei 'git branch' können nicht mit einem Branchnamen "
@@ -3087,7 +3141,7 @@ msgstr ""
msgid ""
"the '--set-upstream' option is no longer supported. Please use '--track' or "
-"'--set-upstream-to' instead."
+"'--set-upstream-to' instead"
msgstr ""
"Die '--set-upstream' Option wird nicht länger unterstützt.\n"
"Bitte benutzen Sie stattdessen '--track' oder '--set-upstream-to'."
@@ -3108,8 +3162,12 @@ msgstr "libc Info: "
msgid "not run from a git repository - no hooks to show\n"
msgstr "nicht in einem Git-Repository ausgeführt - keine Hooks zum Anzeigen\n"
-msgid "git bugreport [-o|--output-directory <file>] [-s|--suffix <format>]"
-msgstr "git bugreport [-o|--output-directory <Datei>] [-s|--suffix <Format>]"
+msgid ""
+"git bugreport [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--diagnose[=<mode>]]"
+msgstr ""
+"git bugreport [(-o | --output-directory) <Pfad>] [(-s | --suffix) <Format>]\n"
+" [--diagnose[=<Modus>]]"
msgid ""
"Thank you for filling out a Git bug report!\n"
@@ -3147,16 +3205,33 @@ msgstr ""
"Bitte überprüfen Sie den restlichen Teil des Fehlerberichts unten.\n"
"Sie können jede Zeile löschen, die Sie nicht mitteilen möchten.\n"
-msgid "specify a destination for the bugreport file"
-msgstr "Speicherort für die Datei des Fehlerberichts angeben"
+msgid "mode"
+msgstr "Modus"
+
+msgid ""
+"create an additional zip archive of detailed diagnostics (default 'stats')"
+msgstr ""
+"ein zusätzliches Zip-Archiv mit detaillierten Diagnosen erstellen (Standard "
+"'stats')"
-msgid "specify a strftime format suffix for the filename"
-msgstr "Dateiendung im strftime-Format für den Dateinamen angeben"
+msgid "specify a destination for the bugreport file(s)"
+msgstr "einen Zielort für die Fehlerberichtsdatei(en) angeben"
+
+msgid "specify a strftime format suffix for the filename(s)"
+msgstr "ein Suffix im strftime-Format für den/die Dateinamen angeben"
+
+#, c-format
+msgid "unknown argument `%s'"
+msgstr "unbekanntes Argument `%s'"
#, c-format
msgid "could not create leading directories for '%s'"
msgstr "konnte vorangehende Verzeichnisse für '%s' nicht erstellen"
+#, c-format
+msgid "unable to create diagnostics archive %s"
+msgstr "Diagnosearchiv %s kann nicht erstellt werden"
+
msgid "System Info"
msgstr "System Info"
@@ -3171,17 +3246,24 @@ msgstr "konnte nicht nach %s schreiben"
msgid "Created new report at '%s'.\n"
msgstr "Neuer Bericht unter '%s' erstellt.\n"
-msgid "git bundle create [<options>] <file> <git-rev-list args>"
-msgstr "git bundle create [<Optionen>] <Datei> <git-rev-list Argumente>"
+msgid ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<version>] <file> <git-rev-list-args>"
+msgstr ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<Version>] <Datei> <git-rev-list-Argumente>"
-msgid "git bundle verify [<options>] <file>"
-msgstr "git bundle verify [<Optionen>] <Datei>"
+msgid "git bundle verify [-q | --quiet] <file>"
+msgstr "git bundle verify [-q | --quiet] <Datei>"
msgid "git bundle list-heads <file> [<refname>...]"
msgstr "git bundle list-heads <Datei> [<Referenzname>...]"
-msgid "git bundle unbundle <file> [<refname>...]"
-msgstr "git bundle unbundle <Datei> [<Referenzname>...]"
+msgid "git bundle unbundle [--progress] <file> [<refname>...]"
+msgstr "git bundle unbundle [--progress] <Datei> [<Referenzname>...]"
+
+msgid "need a <file> argument"
+msgstr "<Datei> Argument benötigt"
msgid "do not show progress meter"
msgstr "keine Fortschrittsanzeige anzeigen"
@@ -3189,11 +3271,11 @@ msgstr "keine Fortschrittsanzeige anzeigen"
msgid "show progress meter"
msgstr "Fortschrittsanzeige anzeigen"
-msgid "show progress meter during object writing phase"
-msgstr "Forschrittsanzeige während des Schreibens von Objekten anzeigen"
+msgid "historical; same as --progress"
+msgstr "historisch; dasselbe wie --progress"
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "ähnlich zu --all-progress wenn Fortschrittsanzeige darstellt wird"
+msgid "historical; does nothing"
+msgstr "historisch; kein Effekt"
msgid "specify bundle format version"
msgstr "Version des Paket-Formats angeben"
@@ -3215,10 +3297,6 @@ msgid "Unbundling objects"
msgstr "Entpacken von Objekten"
#, c-format
-msgid "Unknown subcommand: %s"
-msgstr "Unbekannter Unterbefehl: %s"
-
-#, c-format
msgid "cannot read object %s '%s'"
msgstr "kann Objekt %s '%s' nicht lesen"
@@ -3240,10 +3318,6 @@ msgstr "%s benötigt Argumente"
msgid "%s takes no arguments"
msgstr "%s braucht kein Argument"
-#, c-format
-msgid "unknown command: '%s'"
-msgstr "unbekannter Befehl: '%s'"
-
msgid "only one batch option may be specified"
msgstr "Nur eine Batch-Option erlaubt."
@@ -3257,23 +3331,23 @@ msgid "git cat-file (-t | -s) [--allow-unknown-type] <object>"
msgstr "git cat-file (-t | -s) [--allow-unknown-type] <Objekt>"
msgid ""
+"git cat-file (--textconv | --filters)\n"
+" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
+msgstr ""
+"git cat-file (--textconv | --filters)\n"
+" [<Commit>:<Pfad|Commit-Referenz> | --path=<Pfad|Commit-"
+"Referenz> <Commit>]"
+
+msgid ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
+" [--textconv | --filters] [-Z]"
msgstr ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
-
-msgid ""
-"git cat-file (--textconv | --filters)\n"
-" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
-msgstr ""
-"git cat-file (--textconv | --filters)\n"
-" [<Commit>:<Pfad|Commit-Referenz> | --path=<Pfad|Commit-"
-"Referenz> <Commit>]"
+" [--textconv | --filters] [-Z]"
msgid "Check object existence or emit object contents"
msgstr "Überprüfen von Objektexistenz oder Ausgeben von Objekt-Inhalten"
@@ -3296,6 +3370,9 @@ msgstr "Objektgröße anzeigen"
msgid "allow -s and -t to work with broken/corrupt objects"
msgstr "-s und -t mit beschädigten Objekten erlauben"
+msgid "use mail map file"
+msgstr "\"mailmap\"-Datei verwenden"
+
msgid "Batch objects requested on stdin (or --batch-all-objects)"
msgstr ""
"Batch-Objekte von Standard-Eingabe (oder --batch-all-objects) angefordert"
@@ -3306,6 +3383,12 @@ msgstr "vollständige Inhalte von <Objekt> oder <Commit> anzeigen"
msgid "like --batch, but don't emit <contents>"
msgstr "wie --batch, aber keine Ausgabe von <Inhalten>"
+msgid "stdin is NUL-terminated"
+msgstr "stdin endet mit NUL"
+
+msgid "stdin and stdout is NUL-terminated"
+msgstr "stdin und stdout sind NUL-beendet"
+
msgid "read commands from stdin"
msgstr "Befehle von der Standard-Eingabe lesen"
@@ -3372,18 +3455,22 @@ msgstr "<Commit> benötigt mit '%s'"
msgid "<object> required with '-%c'"
msgstr "<Objekt> benötigt mit '-%c'"
-msgid "too many arguments"
-msgstr "zu viele Argumente"
-
#, c-format
msgid "only two arguments allowed in <type> <object> mode, not %d"
msgstr "nur zwei Argumente im <Typ> <Objekt> Modus erlaubt, nicht %d"
-msgid "git check-attr [-a | --all | <attr>...] [--] <pathname>..."
-msgstr "git check-attr [-a | --all | <Attribut>...] [--] <Pfadname>..."
+msgid ""
+"git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] "
+"<pathname>..."
+msgstr ""
+"git check-attr [--source <Commit-Referenz>] [-a | --all | <Attribut>...] "
+"[--] <Pfadname>..."
-msgid "git check-attr --stdin [-z] [-a | --all | <attr>...]"
-msgstr "git check-attr --stdin [-z] [-a | --all | <Attribut>...]"
+msgid ""
+"git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"
+msgstr ""
+"git check-attr --stdin [-z] [--source <Commit-Referenz>] [-a | --all | "
+"<Attribut>...]"
msgid "report all attributes set on file"
msgstr "alle Attribute einer Datei ausgeben"
@@ -3397,6 +3484,12 @@ msgstr "Dateinamen von der Standard-Eingabe lesen"
msgid "terminate input and output records by a NUL character"
msgstr "Einträge von Ein- und Ausgabe mit NUL-Zeichen abschließen"
+msgid "<tree-ish>"
+msgstr "<Commit-Referenz>"
+
+msgid "which tree-ish to check attributes at"
+msgstr "in welchem Commit die Attribute zu prüfen sind"
+
msgid "suppress progress reporting"
msgstr "Fortschrittsanzeige unterdrücken"
@@ -3558,6 +3651,12 @@ msgid "'%s' or '%s' cannot be used with %s"
msgstr "'%s' oder '%s' kann nicht mit %s verwendet werden"
#, c-format
+msgid "'%s', '%s', or '%s' cannot be used when checking out of a tree"
+msgstr ""
+"'%s', '%s' oder '%s' können beim Auschecken aus einem Verzeichnis nicht "
+"verwendet werden"
+
+#, c-format
msgid "path '%s' is unmerged"
msgstr "Pfad '%s' ist nicht zusammengeführt"
@@ -3817,8 +3916,8 @@ msgstr "Auschecken erzwingen (verwirft lokale Änderungen)"
msgid "new-branch"
msgstr "neuer Branch"
-msgid "new unparented branch"
-msgstr "neuer Branch ohne Eltern-Commit"
+msgid "new unborn branch"
+msgstr "neuer ungeborener Branch"
msgid "update ignored files (default)"
msgstr "ignorierte Dateien aktualisieren (Standard)"
@@ -3921,9 +4020,11 @@ msgid "use overlay mode"
msgstr "benutze Overlay-Modus"
msgid ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <paths>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] "
+"[<pathspec>...]"
msgstr ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <Muster>] [-x | -X] [--] <Pfade>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <Muster>] [-x | -X] [--] "
+"[<Pfadspezifikation>...]"
#, c-format
msgid "Removing %s\n"
@@ -3987,7 +4088,7 @@ msgstr ""
"* - alle Elemente auswählen\n"
" - (leer) Auswahl beenden\n"
-#, c-format, perl-format
+#, c-format
msgid "Huh (%s)?\n"
msgstr "Wie bitte (%s)?\n"
@@ -4070,9 +4171,6 @@ msgstr ""
"clean.requireForce standardmäßig auf \"true\" gesetzt und weder -i, -n noch -"
"f gegeben; \"clean\" verweigert"
-msgid "-x and -X cannot be used together"
-msgstr "-x und -X können nicht gemeinsam verwendet werden"
-
msgid "git clone [<options>] [--] <repo> [<dir>]"
msgstr "git clone [<Optionen>] [--] <Repository> [<Verzeichnis>]"
@@ -4137,9 +4235,6 @@ msgid "create a shallow clone of that depth"
msgstr ""
"einen Klon mit unvollständiger Historie (shallow) in dieser Tiefe erstellen"
-msgid "time"
-msgstr "Zeit"
-
msgid "create a shallow clone since a specific time"
msgstr ""
"einen Klon mit unvollständiger Historie (shallow) seit einer bestimmten "
@@ -4169,6 +4264,9 @@ msgstr ".git-Verzeichnis"
msgid "separate git dir from working tree"
msgstr "Git-Verzeichnis vom Arbeitsverzeichnis separieren"
+msgid "specify the reference format to use"
+msgstr "das zu verwendende Referenzformat angeben"
+
msgid "key=value"
msgstr "Schlüssel=Wert"
@@ -4181,12 +4279,6 @@ msgstr "serverspezifisch"
msgid "option to transmit"
msgstr "Option übertragen"
-msgid "use IPv4 addresses only"
-msgstr "nur IPv4-Adressen benutzen"
-
-msgid "use IPv6 addresses only"
-msgstr "nur IPv6-Adressen benutzen"
-
msgid "apply partial clone filters to submodules"
msgstr "partielle Klonfilter auf Submodule anwenden"
@@ -4198,6 +4290,14 @@ msgstr ""
"Initialisiere Datei für partiellen Checkout, um nur Dateien im\n"
"Root-Verzeichnis einzubeziehen"
+msgid "uri"
+msgstr "uri"
+
+msgid "a URI for downloading bundles before fetching from origin remote"
+msgstr ""
+"eine URI für das Herunterladen von Bundles vor dem Abruf\n"
+"aus dem ursprünglichen Remote-Repository"
+
#, c-format
msgid "info: Could not add alternate for '%s': %s\n"
msgstr "info: Konnte Alternative für '%s' nicht hinzufügen: %s\n"
@@ -4211,10 +4311,20 @@ msgid "%s exists and is not a directory"
msgstr "%s existiert und ist kein Verzeichnis"
#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr ""
+"'%s' ist eine symbolische Verknüpfung, verweigere das Klonen mit --local"
+
+#, c-format
msgid "failed to start iterator over '%s'"
msgstr "Fehler beim Starten der Iteration über '%s'"
#, c-format
+msgid "symlink '%s' exists, refusing to clone with --local"
+msgstr ""
+"symbolische Verknüpfung '%s' existiert, verweigere das Klonen mit --local"
+
+#, c-format
msgid "failed to unlink '%s'"
msgstr "Konnte '%s' nicht entfernen."
@@ -4257,10 +4367,10 @@ msgstr "kann %s nicht aktualisieren"
msgid "failed to initialize sparse-checkout"
msgstr "Fehler beim Initialisieren vom partiellen Checkout."
-msgid "remote HEAD refers to nonexistent ref, unable to checkout.\n"
+msgid "remote HEAD refers to nonexistent ref, unable to checkout"
msgstr ""
-"Externer HEAD bezieht sich auf eine nicht existierende Referenz und kann "
-"nicht ausgecheckt werden.\n"
+"HEAD des Remote-Repositories verweist auf nicht existierende Referenz, kann "
+"nicht ausgecheckt werden"
msgid "unable to checkout working tree"
msgstr "Arbeitsverzeichnis konnte nicht ausgecheckt werden"
@@ -4281,8 +4391,8 @@ msgid "You must specify a repository to clone."
msgstr "Sie müssen ein Repository zum Klonen angeben."
#, c-format
-msgid "options '%s' and '%s %s' cannot be used together"
-msgstr "die Optionen '%s' und '%s %s' können nicht gemeinsam verwendet werden"
+msgid "unknown ref storage format '%s'"
+msgstr "unbekanntes Speicherformat für Referenzen '%s'"
#, c-format
msgid "repository '%s' does not exist"
@@ -4368,6 +4478,16 @@ msgstr "--local wird ignoriert"
msgid "cannot clone from filtered bundle"
msgstr "kann nicht von gefiltertem Bundle klonen"
+msgid "failed to initialize the repo, skipping bundle URI"
+msgstr "konnte das Repository nicht initialisieren, überspringe Bundle-URI"
+
+#, c-format
+msgid "failed to fetch objects from bundle URI '%s'"
+msgstr "Objekte aus Bundle-URI '%s' konnten nicht abgerufen werden"
+
+msgid "failed to fetch advertised bundles"
+msgstr "angekündigte Bundles konnten nicht abgerufen werden"
+
msgid "remote transport reported error"
msgstr "Remoteübertragung meldete Fehler"
@@ -4403,19 +4523,25 @@ msgid "--command must be the first argument"
msgstr "--command muss an erster Stelle stehen"
msgid ""
-"git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]"
+"git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]"
msgstr ""
-"git commit-graph verify [--object-dir <Objektverzeichnis>] [--shallow] [--"
+"git commit-graph verify [--object-dir <Verzeichnis>] [--shallow] [--"
"[no-]progress]"
msgid ""
-"git commit-graph write [--object-dir <objdir>] [--append] [--"
-"split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <n>] [--[no-]progress] <split options>"
+"git commit-graph write [--object-dir <dir>] [--append]\n"
+" [--split[=<strategy>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <split-options>"
msgstr ""
-"git commit-graph write [--object-dir <Objektverzeichnis>] [--append] [--"
-"split[=<Strategie>]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <Anzahl>] [--[no-]progress] <Split-Optionen>"
+"git commit-graph write [--object-dir <Verzeichnis>] [--append]\n"
+" [--split[=<Strategie>]] [--reachable | --stdin-packs "
+"| --stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <Split-Optionen>"
msgid "dir"
msgstr "Verzeichnis"
@@ -4432,6 +4558,10 @@ msgid "Could not open commit-graph '%s'"
msgstr "Konnte Commit-Graph '%s' nicht öffnen."
#, c-format
+msgid "could not open commit-graph chain '%s'"
+msgstr "konnte die Commit-Graph-Kette '%s' nicht öffnen"
+
+#, c-format
msgid "unrecognized --split argument, %s"
msgstr "nicht erkanntes --split Argument, %s"
@@ -4489,16 +4619,15 @@ msgstr ""
msgid "Collecting commits from input"
msgstr "Sammle Commits von der Standard-Eingabe"
-#, c-format
-msgid "unrecognized subcommand: %s"
-msgstr "Nicht erkannter Unterbefehl: %s"
+msgid "git commit-tree <tree> [(-p <parent>)...]"
+msgstr "git commit-tree <Tree-Objekt> [(-p <Elternteil>)...]"
msgid ""
-"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...] [(-F "
-"<file>)...] <tree>"
+"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]\n"
+" [(-F <file>)...] <tree>"
msgstr ""
-"git commit-tree [(-p <Eltern-Commit>)...] [-S[<Key-ID>]] [(-m "
-"<Nachricht>)...] [(-F <Datei>)...] <Tree-Objekt>"
+"git commit-tree [(-p <Elternteil>)...] [-S[<Key-ID>]] [(-m <Nachricht>)...]\n"
+" [(-F <Datei>)...] <Tree-Objekt>"
#, c-format
msgid "duplicate parent %s ignored"
@@ -4540,11 +4669,29 @@ msgstr "Brauche genau ein Tree-Objekt."
msgid "git commit-tree: failed to read"
msgstr "git commit-tree: Fehler beim Lesen"
-msgid "git commit [<options>] [--] <pathspec>..."
-msgstr "git commit [<Optionen>] [--] <Pfadspezifikation>..."
+msgid ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|"
+"reword):]<commit>)]\n"
+" [-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n"
+" [--date=<date>] [--cleanup=<mode>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<Modus>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <Commit> | --fixup [(amend|"
+"reword):]<Commit>)]\n"
+" [-F <Datei> | -m <Nachricht>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--author=<Autor>]\n"
+" [--date=<Datum>] [--cleanup=<Modus>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<Datei> [--pathspec-file-nul]]\n"
+" [(--trailer <Token>[(=|:)<Wert>])...] [-S[<Key-Id>]]\n"
+" [--] [<Pfadspezifikation>...]"
-msgid "git status [<options>] [--] <pathspec>..."
-msgstr "git status [<Optionen>] [--] <Pfadspezifikation>..."
+msgid "git status [<options>] [--] [<pathspec>...]"
+msgstr "git status [<Optionen>] [--] [<Pfadspezifikation>...]"
msgid ""
"You asked to amend the most recent commit, but doing so would make\n"
@@ -4596,6 +4743,9 @@ msgstr ""
" git cherry-pick --skip\n"
"\n"
+msgid "updating files failed"
+msgstr "Aktualisierung der Dateien fehlgeschlagen"
+
msgid "failed to unpack HEAD tree object"
msgstr "Fehler beim Entpacken des Tree-Objektes von HEAD."
@@ -4614,9 +4764,6 @@ msgstr "Konnte temporären Index nicht aktualisieren."
msgid "Failed to update main cache tree"
msgstr "Konnte Haupt-Cache-Verzeichnis nicht aktualisieren"
-msgid "unable to write new_index file"
-msgstr "Konnte new_index Datei nicht schreiben"
-
msgid "cannot do a partial commit during a merge."
msgstr "Kann keinen Teil-Commit durchführen, während ein Merge im Gange ist."
@@ -4656,8 +4803,8 @@ msgstr ""
"der aktuellen Commit-Beschreibung verwendet wird."
#, c-format
-msgid "could not lookup commit %s"
-msgstr "Konnte Commit %s nicht nachschlagen"
+msgid "could not lookup commit '%s'"
+msgstr "konnte Commit '%s' nicht nachschlagen"
#, c-format
msgid "(reading log message from standard input)\n"
@@ -4856,9 +5003,6 @@ msgstr "Status im Langformat anzeigen (Standard)"
msgid "terminate entries with NUL"
msgstr "Einträge mit NUL-Zeichen abschließen"
-msgid "mode"
-msgstr "Modus"
-
msgid "show untracked files, optional modes: all, normal, no. (Default: all)"
msgstr ""
"unversionierte Dateien anzeigen, optionale Modi: all, normal, no. (Standard: "
@@ -5029,13 +5173,13 @@ msgstr "Commit aufgrund leerer Commit-Beschreibung abgebrochen.\n"
msgid ""
"repository has been updated, but unable to write\n"
-"new_index file. Check that disk is not full and quota is\n"
+"new index file. Check that disk is not full and quota is\n"
"not exceeded, and then \"git restore --staged :/\" to recover."
msgstr ""
-"Das Repository wurde aktualisiert, aber die \"new_index\"-Datei\n"
+"Das Repository wurde aktualisiert, aber die neue Index-Datei\n"
"konnte nicht geschrieben werden. Prüfen Sie, dass Ihre Festplatte nicht\n"
"voll und Ihr Kontingent nicht aufgebraucht ist und führen Sie\n"
-"anschließend \"git restore HEAD --staged :/\" zur Wiederherstellung aus."
+"anschließend \"git restore --staged :/\" zur Wiederherstellung aus."
msgid "git config [<options>]"
msgstr "git config [<Optionen>]"
@@ -5334,11 +5478,20 @@ msgstr "credential-cache nicht verfügbar; Unix-Socket wird nicht unterstützt"
msgid "unable to get credential storage lock in %d ms"
msgstr "konnte Sperre für Zugangsdatenspeicher nicht in %d ms bekommen"
-msgid "git describe [<options>] [<commit-ish>...]"
-msgstr "git describe [<Optionen>] [<Commit-Angabe>...]"
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<Commit-"
+"Angabe>...]"
+
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --"
+"dirty[=<Markierung>]"
-msgid "git describe [<options>] --dirty"
-msgstr "git describe [<Optionen>] --dirty"
+msgid "git describe <blob>"
+msgstr "git describe <Blob>"
msgid "head"
msgstr "Branch"
@@ -5463,6 +5616,22 @@ msgstr "Keine Namen gefunden, kann nichts beschreiben."
msgid "option '%s' and commit-ishes cannot be used together"
msgstr "Option '%s' und Commit-Angaben können nicht gemeinsam verwendet werden"
+msgid ""
+"git diagnose [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--mode=<mode>]"
+msgstr ""
+"git diagnose [(-o | --output-directory) <Pfad>] [(-s | --suffix) <Format>]\n"
+" [--mode=<Modus>]"
+
+msgid "specify a destination for the diagnostics archive"
+msgstr "einen Zielort für das Diagnosearchiv angeben"
+
+msgid "specify a strftime format suffix for the filename"
+msgstr "Dateiendung im strftime-Format für den Dateinamen angeben"
+
+msgid "specify the content of the diagnostic archive"
+msgstr "den Inhalt des Diagnosearchivs angeben"
+
msgid "--merge-base only works with two commits"
msgstr "--merge-base funktioniert nur mit zwei Commits"
@@ -5470,6 +5639,9 @@ msgstr "--merge-base funktioniert nur mit zwei Commits"
msgid "'%s': not a regular file or symlink"
msgstr "'%s': keine reguläre Datei oder symbolische Verknüpfung"
+msgid "no merge given, only parents."
+msgstr "kein Merge gegeben, nur Eltern."
+
#, c-format
msgid "invalid option: %s"
msgstr "Ungültige Option: %s"
@@ -5585,29 +5757,6 @@ msgstr "kein <Tool> für --tool=<Tool> angegeben"
msgid "no <cmd> given for --extcmd=<cmd>"
msgstr "kein <Programm> für --extcmd=<Programm> angegeben"
-msgid "git env--helper --type=[bool|ulong] <options> <env-var>"
-msgstr "git env--helper --type=[bool|ulong] <Optionen> <Umgebungsvariable>"
-
-msgid "default for git_env_*(...) to fall back on"
-msgstr "Standard für git_env_*(...), um darauf zurückzugreifen"
-
-msgid "be quiet only use git_env_*() value as exit code"
-msgstr "Ausgaben unterdrücken; nur git_env_*() Werte als Exit-Code verwenden"
-
-#, c-format
-msgid "option `--default' expects a boolean value with `--type=bool`, not `%s`"
-msgstr ""
-"Option `--default' erwartet einen booleschen Wert bei `--type=bool`, nicht "
-"`%s`"
-
-#, c-format
-msgid ""
-"option `--default' expects an unsigned long value with `--type=ulong`, not "
-"`%s`"
-msgstr ""
-"Option `--default' erwartet einen vorzeichenlosen Long-Wert bei `--"
-"type=ulong`, nicht `%s`"
-
msgid "git fast-export [<rev-list-opts>]"
msgstr "git fast-export [<rev-list-opts>]"
@@ -5721,127 +5870,14 @@ msgstr "git fetch --all [<Optionen>]"
msgid "fetch.parallel cannot be negative"
msgstr "fetch.parallel kann nicht negativ sein"
-msgid "fetch from all remotes"
-msgstr "fordert von allen Remote-Repositories an"
-
-msgid "set upstream for git pull/fetch"
-msgstr "Upstream für \"git pull/fetch\" setzen"
-
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "an .git/FETCH_HEAD anhängen statt zu überschreiben"
-
-msgid "use atomic transaction to update references"
-msgstr "atomare Transaktionen nutzen, um Referenzen zu aktualisieren"
-
-msgid "path to upload pack on remote end"
-msgstr "Pfad des Programms zum Hochladen von Paketen auf der Gegenseite"
-
-msgid "force overwrite of local reference"
-msgstr "das Ãœberschreiben einer lokalen Referenz erzwingen"
-
-msgid "fetch from multiple remotes"
-msgstr "von mehreren Remote-Repositories anfordern"
-
-msgid "fetch all tags and associated objects"
-msgstr "alle Tags und verbundene Objekte anfordern"
-
-msgid "do not fetch all tags (--no-tags)"
-msgstr "nicht alle Tags anfordern (--no-tags)"
-
-msgid "number of submodules fetched in parallel"
-msgstr "Anzahl der parallel anzufordernden Submodule"
-
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr ""
-"Refspec verändern, damit alle Referenzen unter refs/prefetch/ platziert "
-"werden"
-
-msgid "prune remote-tracking branches no longer on remote"
-msgstr ""
-"Remote-Tracking-Branches entfernen, die sich nicht mehr im Remote-Repository "
-"befinden"
-
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr ""
-"lokale Tags entfernen, die sich nicht mehr im Remote-Repository befinden, "
-"und geänderte Tags aktualisieren"
-
-msgid "on-demand"
-msgstr "bei-Bedarf"
-
-msgid "control recursive fetching of submodules"
-msgstr "rekursive Anforderungen von Submodulen kontrollieren"
-
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "schreibe angeforderte Referenzen in die FETCH_HEAD-Datei"
-
-msgid "keep downloaded pack"
-msgstr "heruntergeladenes Paket behalten"
-
-msgid "allow updating of HEAD ref"
-msgstr "Aktualisierung der \"HEAD\"-Referenz erlauben"
-
-msgid "deepen history of shallow clone"
-msgstr ""
-"die Historie eines Klons mit unvollständiger Historie (shallow) vertiefen"
-
-msgid "deepen history of shallow repository based on time"
-msgstr ""
-"die Historie eines Klons mit unvollständiger Historie (shallow) auf "
-"Zeitbasis\n"
-"vertiefen"
-
-msgid "convert to a complete repository"
-msgstr "zu einem vollständigen Repository konvertieren"
-
-msgid "re-fetch without negotiating common commits"
-msgstr "erneutes Abrufen ohne Aushandeln gemeinsamer Commits"
-
-msgid "prepend this to submodule path output"
-msgstr "dies an die Ausgabe der Submodul-Pfade voranstellen"
-
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr ""
-"Standard für die rekursive Anforderung von Submodulen (geringere Priorität\n"
-"als Konfigurationsdateien)"
-
-msgid "accept refs that update .git/shallow"
-msgstr "Referenzen, die .git/shallow aktualisieren, akzeptieren"
-
-msgid "refmap"
-msgstr "Refmap"
-
-msgid "specify fetch refmap"
-msgstr "Refmap für 'fetch' angeben"
-
-msgid "report that we have only objects reachable from this object"
-msgstr ""
-"ausgeben, dass wir nur Objekte haben, die von diesem Objekt aus erreichbar "
-"sind"
-
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr ""
-"keine Packdatei anfordern; stattdessen die Vorgänger der Verhandlungstipps "
-"anzeigen"
-
-msgid "run 'maintenance --auto' after fetching"
-msgstr "führe 'maintenance --auto' nach \"fetch\" aus"
-
-msgid "check for forced-updates on all updated branches"
-msgstr "Prüfe auf erzwungene Aktualisierungen in allen aktualisierten Branches"
-
-msgid "write the commit-graph after fetching"
-msgstr "Schreibe den Commit-Graph nach \"fetch\""
-
-msgid "accept refspecs from stdin"
-msgstr "akzeptiere Refspecs von der Standard-Eingabe"
-
msgid "couldn't find remote ref HEAD"
msgstr "konnte Remote-Referenz von HEAD nicht finden"
#, c-format
+msgid "From %.*s\n"
+msgstr "Von %.*s\n"
+
+#, c-format
msgid "object %s not found"
msgstr "Objekt %s nicht gefunden"
@@ -5851,11 +5887,8 @@ msgstr "[aktuell]"
msgid "[rejected]"
msgstr "[zurückgewiesen]"
-msgid "can't fetch in current branch"
-msgstr "kann \"fetch\" im aktuellen Branch nicht ausführen"
-
-msgid "checked out in another worktree"
-msgstr "in einem anderen Arbeitsverzeichnis ausgecheckt"
+msgid "can't fetch into checked-out branch"
+msgstr "fetch kann in den ausgecheckten Branch nicht durchgeführt werden"
msgid "[tag update]"
msgstr "[Tag Aktualisierung]"
@@ -5918,10 +5951,6 @@ msgstr ""
"Historie (shallow) nicht aktualisiert werden dürfen."
#, c-format
-msgid "From %.*s\n"
-msgstr "Von %.*s\n"
-
-#, c-format
msgid ""
"some local refs could not be updated; try running\n"
" 'git remote prune %s' to remove any old, conflicting branches"
@@ -6013,6 +6042,123 @@ msgstr ""
msgid "you need to specify a tag name"
msgstr "Sie müssen den Namen des Tags angeben"
+msgid "fetch from all remotes"
+msgstr "fordert von allen Remote-Repositories an"
+
+msgid "set upstream for git pull/fetch"
+msgstr "Upstream für \"git pull/fetch\" setzen"
+
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "an .git/FETCH_HEAD anhängen statt zu überschreiben"
+
+msgid "use atomic transaction to update references"
+msgstr "atomare Transaktionen nutzen, um Referenzen zu aktualisieren"
+
+msgid "path to upload pack on remote end"
+msgstr "Pfad des Programms zum Hochladen von Paketen auf der Gegenseite"
+
+msgid "force overwrite of local reference"
+msgstr "das Ãœberschreiben einer lokalen Referenz erzwingen"
+
+msgid "fetch from multiple remotes"
+msgstr "von mehreren Remote-Repositories anfordern"
+
+msgid "fetch all tags and associated objects"
+msgstr "alle Tags und verbundene Objekte anfordern"
+
+msgid "do not fetch all tags (--no-tags)"
+msgstr "nicht alle Tags anfordern (--no-tags)"
+
+msgid "number of submodules fetched in parallel"
+msgstr "Anzahl der parallel anzufordernden Submodule"
+
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+"Refspec verändern, damit alle Referenzen unter refs/prefetch/ platziert "
+"werden"
+
+msgid "prune remote-tracking branches no longer on remote"
+msgstr ""
+"Remote-Tracking-Branches entfernen, die sich nicht mehr im Remote-Repository "
+"befinden"
+
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr ""
+"lokale Tags entfernen, die sich nicht mehr im Remote-Repository befinden, "
+"und geänderte Tags aktualisieren"
+
+msgid "on-demand"
+msgstr "bei-Bedarf"
+
+msgid "control recursive fetching of submodules"
+msgstr "rekursive Anforderungen von Submodulen kontrollieren"
+
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "schreibe angeforderte Referenzen in die FETCH_HEAD-Datei"
+
+msgid "keep downloaded pack"
+msgstr "heruntergeladenes Paket behalten"
+
+msgid "allow updating of HEAD ref"
+msgstr "Aktualisierung der \"HEAD\"-Referenz erlauben"
+
+msgid "deepen history of shallow clone"
+msgstr ""
+"die Historie eines Klons mit unvollständiger Historie (shallow) vertiefen"
+
+msgid "deepen history of shallow repository based on time"
+msgstr ""
+"die Historie eines Klons mit unvollständiger Historie (shallow) auf "
+"Zeitbasis\n"
+"vertiefen"
+
+msgid "convert to a complete repository"
+msgstr "zu einem vollständigen Repository konvertieren"
+
+msgid "re-fetch without negotiating common commits"
+msgstr "erneutes Abrufen ohne Aushandeln gemeinsamer Commits"
+
+msgid "prepend this to submodule path output"
+msgstr "dies an die Ausgabe der Submodul-Pfade voranstellen"
+
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+"Standard für die rekursive Anforderung von Submodulen (geringere Priorität\n"
+"als Konfigurationsdateien)"
+
+msgid "accept refs that update .git/shallow"
+msgstr "Referenzen, die .git/shallow aktualisieren, akzeptieren"
+
+msgid "refmap"
+msgstr "Refmap"
+
+msgid "specify fetch refmap"
+msgstr "Refmap für 'fetch' angeben"
+
+msgid "report that we have only objects reachable from this object"
+msgstr ""
+"ausgeben, dass wir nur Objekte haben, die von diesem Objekt aus erreichbar "
+"sind"
+
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr ""
+"keine Packdatei anfordern; stattdessen die Vorgänger der Verhandlungstipps "
+"anzeigen"
+
+msgid "run 'maintenance --auto' after fetching"
+msgstr "führe 'maintenance --auto' nach \"fetch\" aus"
+
+msgid "check for forced-updates on all updated branches"
+msgstr "Prüfe auf erzwungene Aktualisierungen in allen aktualisierten Branches"
+
+msgid "write the commit-graph after fetching"
+msgstr "Schreibe den Commit-Graph nach \"fetch\""
+
+msgid "accept refspecs from stdin"
+msgstr "akzeptiere Refspecs von der Standard-Eingabe"
+
msgid "--negotiate-only needs one or more --negotiation-tip=*"
msgstr "--negotiate-only benötigt einen oder mehrere --negotiation-tip=*"
@@ -6024,6 +6170,10 @@ msgstr ""
"--unshallow kann nicht in einem Repository mit vollständiger Historie "
"verwendet werden"
+#, c-format
+msgid "failed to fetch bundles from '%s'"
+msgstr "Bundles aus '%s' konnten nicht abgerufen werden"
+
msgid "fetch --all does not take a repository argument"
msgstr "fetch --all akzeptiert kein Repository als Argument"
@@ -6131,8 +6281,14 @@ msgstr "nur Referenzen ausgeben, die diesen Commit enthalten"
msgid "print only refs which don't contain the commit"
msgstr "nur Referenzen ausgeben, die diesen Commit nicht enthalten"
-msgid "git for-each-repo --config=<config> <command-args>"
-msgstr "git for-each-repo --config=<Konfiguration> <Befehlsargumente>"
+msgid "read reference patterns from stdin"
+msgstr "Referenzmuster von Standard-Eingabe lesen"
+
+msgid "unknown arguments supplied with --stdin"
+msgstr "unbekannte Argumente mit --stdin geliefert"
+
+msgid "git for-each-repo --config=<config> [--] <arguments>"
+msgstr "git for-each-repo --config=<Konfiguration> [--] <Argumente>"
msgid "config"
msgstr "Konfiguration"
@@ -6143,6 +6299,10 @@ msgstr "Konfigurationsschlüssel für eine Liste von Repository-Pfaden"
msgid "missing --config=<config>"
msgstr "Option --config=<Konfiguration> fehlt"
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "ungültige Konfiguration --config=%s"
+
msgid "unknown"
msgstr "unbekannt"
@@ -6289,18 +6449,39 @@ msgstr "%s: losgelöster HEAD zeigt auf nichts"
msgid "notice: %s points to an unborn branch (%s)"
msgstr "Notiz: %s zeigt auf einen ungeborenen Branch (%s)"
-msgid "Checking cache tree"
-msgstr "Prüfe Cache-Verzeichnis"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "Prüfe Cache-Verzeichnis von %s"
#, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "%s: Ungültiger SHA1-Zeiger in Cache-Verzeichnis"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s: ungültiger SHA1-Zeiger im Cache-Verzeichnis von %s"
msgid "non-tree in cache-tree"
msgstr "non-tree in Cache-Verzeichnis"
-msgid "git fsck [<options>] [<object>...]"
-msgstr "git fsck [<Optionen>] [<Objekt>...]"
+#, c-format
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s: ungültiger SHA1-Zeiger in resolve-undo von %s"
+
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "rev-Index für Pack-Datei '%s' kann nicht geladen werden"
+
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "ungültiger Rev-Index für Pack-Datei '%s'"
+
+msgid ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<object>...]"
+msgstr ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<Objekt>...]"
msgid "show unreachable objects"
msgstr "unerreichbare Objekte anzeigen"
@@ -6355,12 +6536,6 @@ msgstr "git fsmonitor--daemon start [<Optionen>]"
msgid "git fsmonitor--daemon run [<options>]"
msgstr "git fsmonitor--daemon run [<Optionen>]"
-msgid "git fsmonitor--daemon stop"
-msgstr "git fsmonitor--daemon stop"
-
-msgid "git fsmonitor--daemon status"
-msgstr "git fsmonitor--daemon status"
-
#, c-format
msgid "value of '%s' out of range: %d"
msgstr "Wert von '%s' außerhalb des Bereichs: %d"
@@ -6482,6 +6657,9 @@ msgstr "unreferenzierte Objekte entfernen"
msgid "pack unreferenced objects separately"
msgstr "unreferenzierte Objekte separat verpacken"
+msgid "with --cruft, limit the size of new cruft packs"
+msgstr "mit --cruft, die Größe neuer Cruft-Pakete begrenzen"
+
msgid "be more thorough (increased runtime)"
msgstr "mehr Gründlichkeit (erhöht Laufzeit)"
@@ -6610,8 +6788,20 @@ msgid "use at most one of --auto and --schedule=<frequency>"
msgstr ""
"nutzen Sie höchstens eine der Optionen --auto oder --schedule=<Häufigkeit>"
-msgid "failed to run 'git config'"
-msgstr "Fehler beim Ausführen von 'git config'"
+#, c-format
+msgid "unable to add '%s' value of '%s'"
+msgstr "Wert '%s' von '%s' kann nicht hinzugefügt werden"
+
+msgid "return success even if repository was not registered"
+msgstr "Erfolg zurückgeben, auch wenn das Repository nicht registriert wurde"
+
+#, c-format
+msgid "unable to unset '%s' value of '%s'"
+msgstr "Wert '%s' von '%s' kann nicht zurückgesetzt werden"
+
+#, c-format
+msgid "repository '%s' is not registered"
+msgstr "Repository '%s' ist nicht registriert"
#, c-format
msgid "failed to expand path '%s'"
@@ -6639,23 +6829,20 @@ msgstr ""
"Fehler beim Ausführen von 'crontab -l'; Ihr System unterstützt eventuell "
"'cron' nicht"
+msgid "failed to create crontab temporary file"
+msgstr "temporäre crontab Datei konnte nicht erstellt werden"
+
+msgid "failed to open temporary file"
+msgstr "temporäre Datei kann nicht geöffnet werden"
+
msgid "failed to run 'crontab'; your system might not support 'cron'"
msgstr ""
"Fehler beim Ausführen von 'crontab'; Ihr System unterstützt eventuell 'cron' "
"nicht"
-msgid "failed to open stdin of 'crontab'"
-msgstr "Fehler beim Öffnen der Standard-Eingabe von 'crontab'"
-
msgid "'crontab' died"
msgstr "'crontab' abgebrochen"
-msgid "failed to start systemctl"
-msgstr "Fehler beim Starten von systemctl"
-
-msgid "failed to run systemctl"
-msgstr "Fehler beim Ausführen von systemctl"
-
#, c-format
msgid "failed to delete '%s'"
msgstr "Fehler beim Löschen von '%s'"
@@ -6664,6 +6851,12 @@ msgstr "Fehler beim Löschen von '%s'"
msgid "failed to flush '%s'"
msgstr "Flush bei '%s' fehlgeschlagen."
+msgid "failed to start systemctl"
+msgstr "Fehler beim Starten von systemctl"
+
+msgid "failed to run systemctl"
+msgstr "Fehler beim Ausführen von systemctl"
+
#, c-format
msgid "unrecognized --scheduler argument '%s'"
msgstr "nicht erkanntes --scheduler Argument '%s'"
@@ -6687,16 +6880,15 @@ msgstr "Scheduler"
msgid "scheduler to trigger git maintenance run"
msgstr "Scheduler, um \"git maintenance run\" auzuführen"
+msgid "failed to set up maintenance schedule"
+msgstr "Fehler beim Einrichten des Wartungsplans"
+
msgid "failed to add repo to global config"
msgstr "Repository konnte nicht zur globalen Konfiguration hinzugefügt werden"
msgid "git maintenance <subcommand> [<options>]"
msgstr "git maintenance <Unterbefehl> [<Optionen>]"
-#, c-format
-msgid "invalid subcommand: %s"
-msgstr "ungültiger Unterbefehl: %s"
-
msgid "git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]"
msgstr "git grep [<Optionen>] [-e] <Muster> [<Commit>...] [[--] <Pfad>...]"
@@ -6708,7 +6900,6 @@ msgstr "grep: Fehler beim Erzeugen eines Thread: %s"
msgid "invalid number of threads specified (%d) for %s"
msgstr "ungültige Anzahl von Threads (%d) für %s angegeben"
-#. #-#-#-#-# grep.c.po #-#-#-#-#
#. TRANSLATORS: %s is the configuration
#. variable for tweaking threads, currently
#. grep.threads
@@ -6722,6 +6913,10 @@ msgid "unable to read tree (%s)"
msgstr "konnte \"Tree\"-Objekt (%s) nicht lesen"
#, c-format
+msgid "unable to read tree %s"
+msgstr "konnte \"Tree\"-Objekt (%s) nicht lesen"
+
+#, c-format
msgid "unable to grep from object of type %s"
msgstr "kann \"grep\" nicht mit Objekten des Typs %s durchführen"
@@ -6765,8 +6960,8 @@ msgstr "binäre Dateien mit \"textconv\"-Filtern verarbeiten"
msgid "search in subdirectories (default)"
msgstr "in Unterverzeichnissen suchen (Standard)"
-msgid "descend at most <depth> levels"
-msgstr "höchstens <Tiefe> Ebenen durchlaufen"
+msgid "descend at most <n> levels"
+msgstr "höchstens <n> Ebenen absteigen"
msgid "use extended POSIX regular expressions"
msgstr "erweiterte reguläre Ausdrücke aus POSIX verwenden"
@@ -6871,6 +7066,9 @@ msgstr "Dateien mit Ãœbereinstimmungen im Anzeigeprogramm anzeigen"
msgid "allow calling of grep(1) (ignored by this build)"
msgstr "den Aufruf von grep(1) erlauben (von dieser Programmversion ignoriert)"
+msgid "maximum number of results per file"
+msgstr "maximale Anzahl von Ergebnissen pro Datei"
+
msgid "no pattern given"
msgstr "Kein Muster angegeben."
@@ -6908,11 +7106,14 @@ msgid "both --cached and trees are given"
msgstr "--cached und \"Tree\"-Objekte angegeben"
msgid ""
-"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] "
-"[--] <file>..."
+"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
+" [--stdin [--literally]] [--] <file>..."
msgstr ""
-"git hash-object [-t <Art>] [-w] [--path=<Datei> | --no-filters] [--stdin] "
-"[--] <Datei>..."
+"git hash-object [-t <Art>] [-w] [--path=<Datei> | --no-filters]\n"
+" [--stdin [--literally]] [--] <Datei>..."
+
+msgid "git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]"
+msgstr "git hash-object [-t <Art>] [-w] --stdin-paths [--no-filters]"
msgid "object type"
msgstr "Art des Objektes"
@@ -6962,11 +7163,21 @@ msgstr "Beschreibung des Befehls ausgeben"
msgid "print list of useful guides"
msgstr "Liste von allgemein verwendeten Anleitungen anzeigen"
+msgid "print list of user-facing repository, command and file interfaces"
+msgstr ""
+"Liste der benutzerseitigen Repository-, Befehls- und Dateischnittstellen "
+"ausgeben"
+
+msgid "print list of file formats, protocols and other developer interfaces"
+msgstr ""
+"Liste von Dateiformaten, Protokollen und anderen Entwicklerschnittstellen "
+"ausgeben"
+
msgid "print all configuration variable names"
msgstr "alle Namen der Konfigurationsvariablen ausgeben"
-msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>]"
-msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<Befehl>]"
+msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"
+msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<Befehl>|<Dokument>]"
#, c-format
msgid "unrecognized help format '%s'"
@@ -7037,12 +7248,19 @@ msgstr "Verwendung: %s%s"
msgid "'git help config' for more information"
msgstr "'git help config' für weitere Informationen"
-msgid "git hook run [--ignore-missing] <hook-name> [-- <hook-args>]"
-msgstr "git hook run [--ignore-missing] <Hook-Name> [-- <Hook-Argumente>]"
+msgid ""
+"git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-"
+"args>]"
+msgstr ""
+"git hook run [--ignore-missing] [--to-stdin=<Pfad>] <Hook-Name> [-- <Hook-"
+"Argumente>]"
msgid "silently ignore missing requested <hook-name>"
msgstr "fehlende Anforderung <Hook-Name> stillschweigend ignorieren"
+msgid "file to read into hooks' stdin"
+msgstr "Datei zum Einlesen in das Hook-stdin"
+
#, c-format
msgid "object type mismatch at %s"
msgstr "Objekt-Typen passen bei %s nicht zusammen"
@@ -7120,10 +7338,6 @@ msgid "SHA1 COLLISION FOUND WITH %s !"
msgstr "SHA1 KOLLISION MIT %s GEFUNDEN !"
#, c-format
-msgid "unable to read %s"
-msgstr "kann %s nicht lesen"
-
-#, c-format
msgid "cannot read existing object info %s"
msgstr "Kann existierende Informationen zu Objekt %s nicht lesen."
@@ -7260,83 +7474,18 @@ msgstr "--verify wurde ohne Namen der Paketdatei angegeben"
msgid "fsck error in pack objects"
msgstr "fsck Fehler beim Packen von Objekten"
-#, c-format
-msgid "cannot stat template '%s'"
-msgstr "kann Vorlage '%s' nicht lesen"
-
-#, c-format
-msgid "cannot opendir '%s'"
-msgstr "kann Verzeichnis '%s' nicht öffnen"
-
-#, c-format
-msgid "cannot readlink '%s'"
-msgstr "kann Verweis '%s' nicht lesen"
-
-#, c-format
-msgid "cannot symlink '%s' '%s'"
-msgstr "kann symbolische Verknüpfung '%s' auf '%s' nicht erstellen"
-
-#, c-format
-msgid "cannot copy '%s' to '%s'"
-msgstr "kann '%s' nicht nach '%s' kopieren"
-
-#, c-format
-msgid "ignoring template %s"
-msgstr "ignoriere Vorlage %s"
-
-#, c-format
-msgid "templates not found in %s"
-msgstr "Keine Vorlagen in %s gefunden."
-
-#, c-format
-msgid "not copying templates from '%s': %s"
-msgstr "kopiere keine Vorlagen von '%s': %s"
-
-#, c-format
-msgid "invalid initial branch name: '%s'"
-msgstr "ungültiger initialer Branchname: '%s'"
-
-#, c-format
-msgid "unable to handle file type %d"
-msgstr "kann nicht mit Dateityp %d umgehen"
-
-#, c-format
-msgid "unable to move %s to %s"
-msgstr "Konnte %s nicht nach %s verschieben"
-
-msgid "attempt to reinitialize repository with different hash"
-msgstr "Versuch, das Repository mit einem anderen Hash zu reinitialisieren"
-
-#, c-format
-msgid "%s already exists"
-msgstr "%s existiert bereits"
-
-#, c-format
-msgid "re-init: ignored --initial-branch=%s"
-msgstr "Neu-Initialisierung: --initial-branch=%s ignoriert"
-
-#, c-format
-msgid "Reinitialized existing shared Git repository in %s%s\n"
-msgstr "Bestehendes verteiltes Git-Repository in %s%s neuinitialisiert\n"
-
-#, c-format
-msgid "Reinitialized existing Git repository in %s%s\n"
-msgstr "Bestehendes Git-Repository in %s%s neuinitialisiert\n"
-
-#, c-format
-msgid "Initialized empty shared Git repository in %s%s\n"
-msgstr "Leeres verteiltes Git-Repository in %s%s initialisiert\n"
-
-#, c-format
-msgid "Initialized empty Git repository in %s%s\n"
-msgstr "Leeres Git-Repository in %s%s initialisiert\n"
-
msgid ""
-"git init [-q | --quiet] [--bare] [--template=<template-directory>] [--"
-"shared[=<permissions>]] [<directory>]"
+"git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
+" [--separate-git-dir <git-dir>] [--object-format=<format>]\n"
+" [--ref-format=<format>]\n"
+" [-b <branch-name> | --initial-branch=<branch-name>]\n"
+" [--shared[=<permissions>]] [<directory>]"
msgstr ""
-"git init [-q | --quiet] [--bare] [--template=<Vorlagenverzeichnis>] [--"
-"shared[=<Berechtigungen>]] [<Verzeichnis>]"
+"git init [-q | --quiet] [--bare] [--template=<Vorlagenverzeichnis>]\n"
+" [--separate-git-dir <Git-Verzeichnis>] [--object-format=<Format>]\n"
+" [--ref-format=<Format>]\n"
+" [-b <Branchname> | --initial-branch=<Branchname>]\n"
+" [--shared[=<Berechtigungen>]] [<Verzeichnis>]"
msgid "permissions"
msgstr "Berechtigungen"
@@ -7377,11 +7526,14 @@ msgid "--separate-git-dir incompatible with bare repository"
msgstr "--separate-git-dir nicht kompatibel mit Bare-Repository"
msgid ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"<token>[(=|:)<value>])...] [<file>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<key>|<keyAlias>)[(=|:)<value>])...]\n"
+" [--parse] [<file>...]"
msgstr ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"<Token>[(=|:)<Wert>])...] [<Datei>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<Schlüssel>|<Schlüssel-Alias>)"
+"[(=|:)<Wert>])...]\n"
+" [--parse] [<Datei>...]"
msgid "edit files in place"
msgstr "vorhandene Dateien direkt bearbeiten"
@@ -7389,6 +7541,9 @@ msgstr "vorhandene Dateien direkt bearbeiten"
msgid "trim empty trailers"
msgstr "kürzt leere Anhänge"
+msgid "placement"
+msgstr "Platzierung"
+
msgid "where to place the new trailer"
msgstr "wo der neue Anhang platziert wird"
@@ -7401,17 +7556,17 @@ msgstr "Aktion, wenn Anhang fehlt"
msgid "output only the trailers"
msgstr "nur Anhänge ausgeben"
-msgid "do not apply config rules"
-msgstr "Regeln aus Konfiguration nicht anwenden"
+msgid "do not apply trailer.* configuration variables"
+msgstr "trailer.* Konfigurationsvariablen nicht anwenden"
-msgid "join whitespace-continued values"
-msgstr "durch Leerzeichen fortgesetzte Werte verbinden"
+msgid "reformat multiline trailer values as single-line values"
+msgstr "mehrzeilige Trailer als einzeilige Werte umformatieren"
-msgid "set parsing options"
-msgstr "Optionen für das Parsen setzen"
+msgid "alias for --only-trailers --only-input --unfold"
+msgstr "Alias für --only-trailers --only-input --unfold"
-msgid "do not treat --- specially"
-msgstr "--- nicht speziell behandeln"
+msgid "do not treat \"---\" as the end of input"
+msgstr "\"---\" nicht als Ende der Eingabe behandeln"
msgid "trailer(s) to add"
msgstr "Anhang/Anhänge hinzufügen"
@@ -7438,8 +7593,8 @@ msgstr "Ausgabe der Unterschiede unterdrücken"
msgid "show source"
msgstr "Quelle anzeigen"
-msgid "use mail map file"
-msgstr "\"mailmap\"-Datei verwenden"
+msgid "clear all previously-defined decoration filters"
+msgstr "alle zuvor definierten Dekorationsfilter löschen"
msgid "only decorate refs that match <pattern>"
msgstr "\"decorate\" nur bei Referenzen anwenden, die <Muster> entsprechen"
@@ -7501,6 +7656,10 @@ msgstr "Brauche genau einen Commit-Bereich."
msgid "not a range"
msgstr "Kein Commit-Bereich."
+#, c-format
+msgid "unable to read branch description file '%s'"
+msgstr "konnte Datei mit Branchbeschreibung '%s' nicht lesen"
+
msgid "cover letter needs email format"
msgstr "Anschreiben benötigt E-Mail-Format"
@@ -7600,6 +7759,9 @@ msgid "generate parts of a cover letter based on a branch's description"
msgstr ""
"Erzeuge Teile des Deckblattes basierend auf der Beschreibung des Branches"
+msgid "use branch description from file"
+msgstr "Branchbeschreibung aus Datei verwenden"
+
msgid "use [<prefix>] instead of [PATCH]"
msgstr "nutze [<Präfix>] statt [PATCH]"
@@ -7698,6 +7860,11 @@ msgstr ""
msgid "percentage by which creation is weighted"
msgstr "Prozentsatz mit welchem Erzeugung gewichtet wird"
+msgid "show in-body From: even if identical to the e-mail header"
+msgstr ""
+"From: aus E-Mail Text anzeigen, auch wenn es mit der Kopfzeile der E-Mail "
+"identisch ist"
+
#, c-format
msgid "invalid ident line: %s"
msgstr "Ungültige Identifikationszeile: %s"
@@ -7758,6 +7925,22 @@ msgstr ""
"Konnte gefolgten Remote-Branch nicht finden, bitte geben Sie <Upstream> "
"manuell an.\n"
+#, c-format
+msgid "could not get object info about '%s'"
+msgstr "konnte Objekt-Informationen über '%s' nicht bestimmen"
+
+#, c-format
+msgid "bad ls-files format: element '%s' does not start with '('"
+msgstr "ungültiges ls-files-Format: Element '%s' fängt nicht mit '(' an"
+
+#, c-format
+msgid "bad ls-files format: element '%s' does not end in ')'"
+msgstr "ungültiges ls-files-Format: Element '%s' endet nicht auf ')'"
+
+#, c-format
+msgid "bad ls-files format: %%%.*s"
+msgstr "ungültiges ls-files-Format: %%%.*s"
+
msgid "git ls-files [<options>] [<file>...]"
msgstr "git ls-files [<Optionen>] [<Datei>...]"
@@ -7848,13 +8031,20 @@ msgid "show sparse directories in the presence of a sparse index"
msgstr "zeige partielle Verzeichnisse, wenn ein partieller Index vorhanden ist"
msgid ""
+"--format cannot be used with -s, -o, -k, -t, --resolve-undo, --deduplicate, "
+"--eol"
+msgstr ""
+"--format kann nicht mit -s, -o, -k, -t, --resolve-undo, --deduplicate, --eol "
+"verwendet werden"
+
+msgid ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<repository> [<refs>...]]"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
+" [--symref] [<repository> [<patterns>...]]"
msgstr ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<Programm>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<Repository> [<Referenzen>...]]"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<Schlüssel>]\n"
+" [--symref] [<Repository> [<Muster>...]]"
msgid "do not print remote URL"
msgstr "URL des Remote-Repositories nicht ausgeben"
@@ -7889,10 +8079,6 @@ msgid "git ls-tree [<options>] <tree-ish> [<path>...]"
msgstr "git ls-tree [<Optionen>] <Commit-Referenz> [<Pfad>...]"
#, c-format
-msgid "could not get object info about '%s'"
-msgstr "konnte Objekt-Informationen über '%s' nicht bestimmen"
-
-#, c-format
msgid "bad ls-tree format: element '%s' does not start with '('"
msgstr "ungültiges ls-tree-Format: Element '%s' fängt nicht mit '(' an"
@@ -7987,12 +8173,12 @@ msgstr "git merge-base [-a | --all] <Commit> <Commit>..."
msgid "git merge-base [-a | --all] --octopus <commit>..."
msgstr "git merge-base [-a | --all] --octopus <Commit>..."
-msgid "git merge-base --independent <commit>..."
-msgstr "git merge-base --independent <Commit>..."
-
msgid "git merge-base --is-ancestor <commit> <commit>"
msgstr "git merge-base --is-ancestor <Commit> <Commit>"
+msgid "git merge-base --independent <commit>..."
+msgstr "git merge-base --independent <Commit>..."
+
msgid "git merge-base --fork-point <ref> [<commit>]"
msgstr "git merge-base --fork-point <Referenz> [<Commit>]"
@@ -8018,9 +8204,19 @@ msgstr ""
"git merge-file [<Optionen>] [-L <Name1> [-L <orig> [-L <Name2>]]] <Datei1> "
"<orig-Datei> <Datei2>"
+msgid ""
+"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
+"\"histogram\""
+msgstr ""
+"Option diff-algorithm akzeptiert: \"myers\", \"minimal\", \"patience\" and "
+"\"histogram\""
+
msgid "send results to standard output"
msgstr "Ergebnisse zur Standard-Ausgabe senden"
+msgid "use object IDs instead of filenames"
+msgstr "Objekt-IDs anstelle von Dateinamen verwenden"
+
msgid "use a diff3 based merge"
msgstr "einen diff3 basierten Merge verwenden"
@@ -8036,6 +8232,12 @@ msgstr "bei Konflikten ihre Variante verwenden"
msgid "for conflicts, use a union version"
msgstr "bei Konflikten eine gemeinsame Variante verwenden"
+msgid "<algorithm>"
+msgstr "<Algorithmus>"
+
+msgid "choose a diff algorithm"
+msgstr "einen Algorithmus für Änderungen wählen"
+
msgid "for conflicts, use this marker size"
msgstr "bei Konflikten diese Kennzeichnungslänge verwenden"
@@ -8046,6 +8248,13 @@ msgid "set labels for file1/orig-file/file2"
msgstr "Beschriftung für Datei1/orig-Datei/Datei2 setzen"
#, c-format
+msgid "object '%s' does not exist"
+msgstr "Objekt '%s' existiert nicht"
+
+msgid "Could not write object file"
+msgstr "konnte Objektdatei nicht schreiben"
+
+#, c-format
msgid "unknown option %s"
msgstr "unbekannte Option: %s"
@@ -8070,6 +8279,65 @@ msgstr "Konnte Referenz '%s' nicht auflösen"
msgid "Merging %s with %s\n"
msgstr "Führe %s mit %s zusammen\n"
+msgid "not something we can merge"
+msgstr "nichts was wir zusammenführen können"
+
+msgid "refusing to merge unrelated histories"
+msgstr "verweigere den Merge von nicht zusammenhängenden Historien"
+
+msgid "failure to merge"
+msgstr "Fehler beim Merge"
+
+msgid "git merge-tree [--write-tree] [<options>] <branch1> <branch2>"
+msgstr "git merge-tree [--write-tree] [<Optionen>] <Branch1> <Branch2>"
+
+msgid "git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"
+msgstr ""
+"git merge-tree [--trivial-merge] <Basis-Tree-Objekt> <Branch1> <Branch2>"
+
+msgid "do a real merge instead of a trivial merge"
+msgstr "einen echten Merge anstelle eines trivialen Merge durchführen"
+
+msgid "do a trivial merge only"
+msgstr "nur einen trivialen Merge durchführen"
+
+msgid "also show informational/conflict messages"
+msgstr "auch Informations-/Konfliktmeldungen anzeigen"
+
+msgid "list filenames without modes/oids/stages"
+msgstr "Dateinamen ohne Modi/Oids/Stufen auflisten"
+
+msgid "allow merging unrelated histories"
+msgstr "erlaube das Zusammenführen von nicht zusammenhängenden Historien"
+
+msgid "perform multiple merges, one per line of input"
+msgstr "mehrere Merges durchführen, eine pro Eingabezeile"
+
+msgid "specify a merge-base for the merge"
+msgstr "Merge-Basis für den Merge angeben"
+
+msgid "option=value"
+msgstr "Option=Wert"
+
+msgid "option for selected merge strategy"
+msgstr "Option für ausgewählte Merge-Strategie"
+
+msgid "--trivial-merge is incompatible with all other options"
+msgstr "--trivial-merge ist mit allen anderen Optionen inkompatibel"
+
+#, c-format
+msgid "unknown strategy option: -X%s"
+msgstr "unbekannte Strategie-Option: -X%s"
+
+#, c-format
+msgid "malformed input line: '%s'."
+msgstr "Fehlerhafte Eingabezeile: '%s'."
+
+#, c-format
+msgid "merging cannot continue; got unclean result of %d"
+msgstr ""
+"Merge kann nicht fortgesetzt werden; unsauberes Ergebnis von %d erhalten"
+
msgid "git merge [<options>] [<commit>...]"
msgstr "git merge [<Optionen>] [<Commit>...]"
@@ -8130,12 +8398,6 @@ msgstr "Strategie"
msgid "merge strategy to use"
msgstr "zu verwendende Merge-Strategie"
-msgid "option=value"
-msgstr "Option=Wert"
-
-msgid "option for selected merge strategy"
-msgstr "Option für ausgewählte Merge-Strategie"
-
msgid "merge commit message (for a non-fast-forward merge)"
msgstr ""
"Commit-Beschreibung zusammenführen (für einen Merge, der kein Vorspulen war)"
@@ -8152,9 +8414,6 @@ msgstr "--abort, aber Index und Arbeitsverzeichnis unverändert lassen"
msgid "continue the current in-progress merge"
msgstr "den sich im Gange befindlichen Merge fortsetzen"
-msgid "allow merging unrelated histories"
-msgstr "erlaube das Zusammenführen von nicht zusammenhängenden Historien"
-
msgid "bypass pre-merge-commit and commit-msg hooks"
msgstr "Hooks pre-merge-commit und commit-msg umgehen"
@@ -8200,10 +8459,6 @@ msgid "Not handling anything other than two heads merge."
msgstr "Es wird nur der Merge von zwei Branches behandelt."
#, c-format
-msgid "unknown strategy option: -X%s"
-msgstr "unbekannte Strategie-Option: -X%s"
-
-#, c-format
msgid "unable to write %s"
msgstr "konnte %s nicht schreiben"
@@ -8277,9 +8532,6 @@ msgstr "Konnte '%s' nicht schließen."
msgid "not something we can merge in %s: %s"
msgstr "nichts was wir in %s zusammenführen können: %s"
-msgid "not something we can merge"
-msgstr "nichts was wir zusammenführen können"
-
msgid "--abort expects no arguments"
msgstr "--abort akzeptiert keine Argumente"
@@ -8331,14 +8583,20 @@ msgstr "%s - nichts was wir zusammenführen können"
msgid "Can merge only exactly one commit into empty head"
msgstr "Kann nur exakt einen Commit in einem leeren Branch zusammenführen"
-msgid "refusing to merge unrelated histories"
-msgstr "verweigere den Merge von nicht zusammenhängenden Historien"
-
#, c-format
msgid "Updating %s..%s\n"
msgstr "Aktualisiere %s..%s\n"
#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+" %s"
+msgstr ""
+"Ihre lokalen Änderungen in den folgenden Dateien würden durch den Merge\n"
+"überschrieben werden:\n"
+" %s"
+
+#, c-format
msgid "Trying really trivial in-index merge...\n"
msgstr "Probiere wirklich trivialen \"in-index\"-Merge...\n"
@@ -8372,6 +8630,12 @@ msgstr ""
"Automatischer Merge abgeschlossen; halte, wie gewünscht, vor dem Commit an\n"
#, c-format
+msgid "When finished, apply stashed changes with `git stash pop`\n"
+msgstr ""
+"Wenn Sie fertig sind, wenden Sie die Änderungen aus dem Stash mit `git stash "
+"pop` an\n"
+
+#, c-format
msgid "warning: tag input does not pass fsck: %s"
msgstr "Warnung: Tag-Eingabe ungültig für fsck: %s"
@@ -8493,11 +8757,14 @@ msgstr "Prüfe Umbenennung von '%s' nach '%s'\n"
msgid "bad source"
msgstr "ungültige Quelle"
+msgid "destination exists"
+msgstr "Ziel existiert bereits"
+
msgid "can not move directory into itself"
msgstr "kann Verzeichnis nicht in sich selbst verschieben"
-msgid "cannot move directory over file"
-msgstr "kann Verzeichnis nicht über Datei verschieben"
+msgid "destination already exists"
+msgstr "Ziel existiert bereits"
msgid "source directory is empty"
msgstr "Quellverzeichnis ist leer"
@@ -8508,9 +8775,6 @@ msgstr "nicht unter Versionskontrolle"
msgid "conflicted"
msgstr "in Konflikt"
-msgid "destination exists"
-msgstr "Ziel existiert bereits"
-
#, c-format
msgid "overwriting '%s'"
msgstr "überschreibe '%s'"
@@ -8524,6 +8788,9 @@ msgstr "mehrere Quellen für dasselbe Ziel"
msgid "destination directory does not exist"
msgstr "Zielverzeichnis existiert nicht"
+msgid "destination exists in the index"
+msgstr "Ziel existiert im Index"
+
#, c-format
msgid "%s, source=%s, destination=%s"
msgstr "%s, Quelle=%s, Ziel=%s"
@@ -8576,22 +8843,26 @@ msgid "git notes [--ref <notes-ref>] [list [<object>]]"
msgstr "git notes [--ref <Notiz-Referenz>] [list [<Objekt>]]"
msgid ""
-"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [-m <msg> | -F <file> "
-"| (-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref <Notiz-Referenz>] add [-f] [--allow-empty] [-m "
-"<Beschreibung> | -F <Datei> | (-c | -C) <Objekt>] [<Objekt>]"
+"git notes [--ref <Notiz-Referenz>] add [-f] [--allow-empty] [--"
+"[no-]separator|--separator=<Absatz-Unterbrechung>] [--[no-]stripspace] [-m "
+"<Nachricht> | -F <Datei> | (-c | -C) <Objekt>] [<Objekt>]"
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
msgstr ""
"git notes [--ref <Notiz-Referenz>] copy [-f] <von-Objekt> <nach-Objekt>"
msgid ""
-"git notes [--ref <notes-ref>] append [--allow-empty] [-m <msg> | -F <file> | "
-"(-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref <Notiz-Referenz>] append [--allow-empty] [-m <Beschreibung> "
-"| -F <Datei> | (-c | -C) <Objekt>] [<Objekt>]"
+"git notes [--ref <Notiz-Referenz>] append [--allow-empty] [--"
+"[no-]separator|--separator=<Absatz-Unterbrechnung>] [--[no-]stripspace] [-m "
+"<Nachricht> | -F <Datei> | (-c | -C) <Objekt>] [<Object>]"
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
msgstr "git notes [--ref <Notiz-Referenz>] edit [--allow-empty] [<Objekt>]"
@@ -8692,10 +8963,6 @@ msgid "cannot read note data from non-blob object '%s'."
msgstr "Kann Notiz-Daten nicht von Nicht-Blob Objekt '%s' lesen."
#, c-format
-msgid "malformed input line: '%s'."
-msgstr "Fehlerhafte Eingabezeile: '%s'."
-
-#, c-format
msgid "failed to copy notes from '%s' to '%s'"
msgstr "Fehler beim Kopieren der Notizen von '%s' nach '%s'"
@@ -8730,6 +8997,15 @@ msgstr "Speichern leerer Notiz erlauben"
msgid "replace existing notes"
msgstr "existierende Notizen ersetzen"
+msgid "<paragraph-break>"
+msgstr "<Absatz-Unterbrechung>"
+
+msgid "insert <paragraph-break> between paragraphs"
+msgstr "<Absatz-Unterbrechung> zwischen Absätzen einfügen"
+
+msgid "remove unnecessary whitespace"
+msgstr "unnötigen Whitespace entfernen"
+
#, c-format
msgid ""
"Cannot add notes. Found existing notes for object %s. Use '-f' to overwrite "
@@ -8889,19 +9165,17 @@ msgid "use notes from <notes-ref>"
msgstr "Notizen von <Notiz-Referenz> verwenden"
#, c-format
-msgid "unknown subcommand: %s"
-msgstr "Unbekannter Unterbefehl: %s"
+msgid "unknown subcommand: `%s'"
+msgstr "unbekannter Unterbefehl: `%s'"
-msgid ""
-"git pack-objects --stdout [<options>...] [< <ref-list> | < <object-list>]"
+msgid "git pack-objects --stdout [<options>] [< <ref-list> | < <object-list>]"
msgstr ""
-"git pack-objects --stdout [<Optionen>...] [< <Referenzliste> | < "
-"<Objektliste>]"
+"git pack-objects --stdout [<Optionen>] [< <Referenzliste> | < <Objektliste>]"
msgid ""
-"git pack-objects [<options>...] <base-name> [< <ref-list> | < <object-list>]"
+"git pack-objects [<options>] <base-name> [< <ref-list> | < <object-list>]"
msgstr ""
-"git pack-objects [<Optionen>...] <Basis-Name> [< <Referenzliste> | < "
+"git pack-objects [<Optionen>] <Basis-Name> [< <Referenzliste> | < "
"<Objektliste>]"
#, c-format
@@ -9010,6 +9284,10 @@ msgid "inconsistency with delta count"
msgstr "Inkonsistenz mit der Anzahl von Deltas"
#, c-format
+msgid "invalid pack.allowPackReuse value: '%s'"
+msgstr "ungültiger Wert für pack.allowPackReuse: '%s'"
+
+#, c-format
msgid ""
"value of uploadpack.blobpackfileuri must be of the form '<object-hash> <pack-"
"hash> <uri>' (got '%s')"
@@ -9093,6 +9371,12 @@ msgstr "nicht unterstützte Index-Version %s"
msgid "bad index version '%s'"
msgstr "ungültige Index-Version '%s'"
+msgid "show progress meter during object writing phase"
+msgstr "Forschrittsanzeige während des Schreibens von Objekten anzeigen"
+
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "ähnlich zu --all-progress wenn Fortschrittsanzeige darstellt wird"
+
msgid "<version>[,<offset>]"
msgstr "<Version>[,<Offset>]"
@@ -9253,9 +9537,6 @@ msgid "--thin cannot be used to build an indexable pack"
msgstr ""
"--thin kann nicht benutzt werden, um ein indizierbares Paket zu erstellen."
-msgid "cannot use --filter without --stdout"
-msgstr "Kann --filter nicht ohne --stdout benutzen."
-
msgid "cannot use --filter with --stdin-packs"
msgstr "kann --filter nicht mit --stdin-packs benutzen"
@@ -9269,19 +9550,16 @@ msgstr "interne Commit-Liste kann nicht gemeinsam mit --cruft verwendet werden"
msgid "cannot use --stdin-packs with --cruft"
msgstr "kann --stdin-packs nicht mit --cruft benutzen"
-msgid "cannot use --max-pack-size with --cruft"
-msgstr "kann --max-pack-size nicht mit --cruft benutzen"
-
msgid "Enumerating objects"
msgstr "Objekte aufzählen"
#, c-format
msgid ""
"Total %<PRIu32> (delta %<PRIu32>), reused %<PRIu32> (delta %<PRIu32>), pack-"
-"reused %<PRIu32>"
+"reused %<PRIu32> (from %<PRIuMAX>)"
msgstr ""
"Gesamt %<PRIu32> (Delta %<PRIu32>), Wiederverwendet %<PRIu32> (Delta "
-"%<PRIu32>), Pack wiederverwendet %<PRIu32>"
+"%<PRIu32>), Paket wiederverwendet %<PRIu32> (von %<PRIuMAX>)"
msgid ""
"'git pack-redundant' is nominated for removal.\n"
@@ -9297,8 +9575,14 @@ msgstr ""
"Sie es immer noch verwenden, indem Sie eine E-Mail an\n"
"<git@vger.kernel.org> senden. Danke.\n"
-msgid "git pack-refs [<options>]"
-msgstr "git pack-refs [<Optionen>]"
+msgid "refusing to run without --i-still-use-this"
+msgstr "Ausführung ohne --i-still-use-this verweigert"
+
+msgid ""
+"git pack-refs [--all] [--no-prune] [--include <pattern>] [--exclude "
+"<pattern>]"
+msgstr ""
+"git pack-refs [--all] [--no-prune] [--include <Muster>] [--exclude <Muster>]"
msgid "pack everything"
msgstr "alles packen"
@@ -9306,6 +9590,24 @@ msgstr "alles packen"
msgid "prune loose refs (default)"
msgstr "lose Referenzen entfernen (Standard)"
+msgid "references to include"
+msgstr "einzubeziehende Referenzen"
+
+msgid "references to exclude"
+msgstr "Referenzen zum Ausschluss"
+
+msgid "git patch-id [--stable | --unstable | --verbatim]"
+msgstr "git patch-id [--stable | --unstable | --verbatim]"
+
+msgid "use the unstable patch-id algorithm"
+msgstr "den instabilen Patch-ID-Algorithmus verwenden"
+
+msgid "use the stable patch-id algorithm"
+msgstr "den stabilen Patch-ID-Algorithmus verwenden"
+
+msgid "don't strip whitespace from the patch"
+msgstr "keine Leerzeichen aus dem Patch entfernen"
+
msgid "git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"
msgstr "git prune [-n] [-v] [--progress] [--expire <Zeit>] [--] [<Branch>...]"
@@ -9353,6 +9655,12 @@ msgstr "das Ãœberschreiben von lokalen Branches erzwingen"
msgid "number of submodules pulled in parallel"
msgstr "Anzahl der parallel mit 'pull' zu verarbeitenden Submodule"
+msgid "use IPv4 addresses only"
+msgstr "nur IPv4-Adressen benutzen"
+
+msgid "use IPv6 addresses only"
+msgstr "nur IPv6-Adressen benutzen"
+
msgid ""
"There is no candidate for rebasing against among the refs that you just "
"fetched."
@@ -9467,7 +9775,7 @@ msgstr ""
msgid "pull with rebase"
msgstr "Pull mit Rebase"
-msgid "please commit or stash them."
+msgid "Please commit or stash them."
msgstr "Bitte committen Sie die Änderungen oder benutzen Sie \"stash\"."
#, c-format
@@ -9533,13 +9841,12 @@ msgstr ""
msgid ""
"\n"
-"To avoid automatically configuring upstream branches when their name\n"
-"doesn't match the local branch, see option 'simple' of branch."
-"autoSetupMerge\n"
+"To avoid automatically configuring an upstream branch when its name\n"
+"won't match the local branch, see option 'simple' of branch.autoSetupMerge\n"
"in 'git help config'.\n"
msgstr ""
"\n"
-"Um das automatische Konfigurieren von Upstream-Branches zu verhindern,\n"
+"Um das automatische Konfigurieren eines Upstream-Branches zu verhindern,\n"
"wenn deren Namen nicht mit dem lokalen Branch übereinstimmen, siehe\n"
"Option 'simple' bei branch.autoSetupMerge in 'git help config'.\n"
@@ -9629,35 +9936,37 @@ msgstr ""
msgid ""
"Updates were rejected because the tip of your current branch is behind\n"
-"its remote counterpart. Integrate the remote changes (e.g.\n"
-"'git pull ...') before pushing again.\n"
+"its remote counterpart. If you want to integrate the remote changes,\n"
+"use 'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"Aktualisierungen wurden zurückgewiesen, weil die Spitze Ihres aktuellen\n"
-"Branches hinter seinem externen Gegenstück zurückgefallen ist. Führen Sie\n"
-"die externen Änderungen zusammen (z. B. 'git pull ...') bevor Sie \"push\"\n"
-"erneut ausführen.\n"
-"Siehe auch die Sektion 'Note about fast-forwards' in 'git push --help'\n"
-"für weitere Details."
+"Branches hinter seinem externen Gegenstück zurückgefallen ist. Wenn Sie\n"
+"die externen Änderungen integrieren wollen, verwenden Sie 'git pull' bevor\n"
+"Sie erneut push ausführen.\n"
+"Siehe auch den Abschnitt 'Note about fast-forwards' in 'git push --help' "
+"für\n"
+"weitere Informationen."
msgid ""
"Updates were rejected because a pushed branch tip is behind its remote\n"
-"counterpart. Check out this branch and integrate the remote changes\n"
-"(e.g. 'git pull ...') before pushing again.\n"
+"counterpart. If you want to integrate the remote changes, use 'git pull'\n"
+"before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"Aktualisierungen wurden zurückgewiesen, weil die Spitze eines versendeten\n"
-"Branches hinter seinem externen Gegenstück zurückgefallen ist. Checken Sie\n"
-"diesen Branch aus und führen Sie die externen Änderungen zusammen\n"
-"(z. B. 'git pull ...') bevor Sie erneut \"push\" ausführen.\n"
-"Siehe auch die Sektion 'Note about fast-forwards' in 'git push --help'\n"
-"für weitere Details."
-
-msgid ""
-"Updates were rejected because the remote contains work that you do\n"
-"not have locally. This is usually caused by another repository pushing\n"
-"to the same ref. You may want to first integrate the remote changes\n"
-"(e.g., 'git pull ...') before pushing again.\n"
+"Branches hinter seinem externen Gegenstück zurückgefallen ist. Wenn Sie die\n"
+"externen Änderungen integrieren wollen, verwenden Sie 'git pull'\n"
+"bevor Sie erneut push ausführen.\n"
+"Siehe auch den Abschnitt 'Note about fast-forwards' in 'git push --help' "
+"für\n"
+"weitere Informationen."
+
+msgid ""
+"Updates were rejected because the remote contains work that you do not\n"
+"have locally. This is usually caused by another repository pushing to\n"
+"the same ref. If you want to integrate the remote changes, use\n"
+"'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"Aktualisierungen wurden zurückgewiesen, weil das Remote-Repository Commits "
@@ -9665,11 +9974,12 @@ msgstr ""
"die lokal nicht vorhanden sind. Das wird üblicherweise durch einen \"push\" "
"von\n"
"Commits auf dieselbe Referenz von einem anderen Repository aus verursacht.\n"
-"Vielleicht müssen Sie die externen Änderungen zusammenführen (z. B. 'git "
-"pull ...')\n"
-"bevor Sie erneut \"push\" ausführen.\n"
-"Siehe auch die Sektion 'Note about fast-forwards' in 'git push --help'\n"
-"für weitere Details."
+"Wenn Sie die externen Änderungen integrieren wollen, verwenden Sie 'git "
+"pull'\n"
+"bevor Sie erneut push ausführen.\n"
+"Siehe auch den Abschnitt 'Note about fast-forwards' in 'git push --help' "
+"für\n"
+"weitere Informationen."
msgid "Updates were rejected because the tag already exists in the remote."
msgstr ""
@@ -9686,15 +9996,21 @@ msgstr ""
"die Option '--force' zu verwenden.\n"
msgid ""
-"Updates were rejected because the tip of the remote-tracking\n"
-"branch has been updated since the last checkout. You may want\n"
-"to integrate those changes locally (e.g., 'git pull ...')\n"
-"before forcing an update.\n"
+"Updates were rejected because the tip of the remote-tracking branch has\n"
+"been updated since the last checkout. If you want to integrate the\n"
+"remote changes, use 'git pull' before pushing again.\n"
+"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"Aktualisierungen wurden zurückgewiesen, weil die Spitze des Remote-\n"
-"Tracking-Branches seit dem letzen Checkout aktualisiert wurde. Sie möchten\n"
-"diese Änderungen vielleicht lokal integrieren (z. B. 'git pull ...') bevor\n"
-"Sie die Änderungen erzwingen.\n"
+"Aktualisierungen wurden zurückgewiesen, weil die Spitze des Remote-"
+"Tracking-\n"
+"Branches seit dem letzten Auschecken aktualisiert wurde. Wenn Sie die "
+"externen\n"
+"Änderungen integrieren wollen, verwenden Sie 'git pull' bevor Sie erneut "
+"push\n"
+"ausführen.\n"
+"Siehe auch die Sektion 'Note about fast-forwards' in 'git push --help' für "
+"weitere\n"
+"Informationen."
#, c-format
msgid "Pushing to %s\n"
@@ -9704,6 +10020,13 @@ msgstr "Push nach %s\n"
msgid "failed to push some refs to '%s'"
msgstr "Fehler beim Versenden einiger Referenzen nach '%s'"
+msgid ""
+"recursing into submodule with push.recurseSubmodules=only; using on-demand "
+"instead"
+msgstr ""
+"Rekursion in Submodule mit push.recurseSubmodules=only; stattdessen "
+"Verwendung von on-demand"
+
#, c-format
msgid "invalid value for '%s'"
msgstr "ungültiger Wert für '%s'"
@@ -9711,8 +10034,8 @@ msgstr "ungültiger Wert für '%s'"
msgid "repository"
msgstr "Repository"
-msgid "push all refs"
-msgstr "alle Referenzen versenden"
+msgid "push all branches"
+msgstr "alle Branches versenden"
msgid "mirror all refs"
msgstr "alle Referenzen spiegeln"
@@ -9720,8 +10043,10 @@ msgstr "alle Referenzen spiegeln"
msgid "delete refs"
msgstr "Referenzen löschen"
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "Tags versenden (kann nicht mit --all oder --mirror verwendet werden)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr ""
+"Tags versenden (kann nicht mit --all, --branches oder --mirror verwendet "
+"werden)"
msgid "force updates"
msgstr "Aktualisierung erzwingen"
@@ -9826,23 +10151,31 @@ msgid "only emit output related to the second range"
msgstr "nur Ausgaben anzeigen, die sich auf den zweiten Bereich beziehen"
#, c-format
+msgid "not a revision: '%s'"
+msgstr "kein Commit: '%s'"
+
+#, c-format
msgid "not a commit range: '%s'"
msgstr "kein Commit-Bereich: '%s'"
-msgid "single arg format must be symmetric range"
-msgstr "Format mit einfachem Argument muss symmetrischer Bereich sein."
+#, c-format
+msgid "not a symmetric range: '%s'"
+msgstr "kein symmetrischer Bereich: '%s'"
msgid "need two commit ranges"
msgstr "Benötige zwei Commit-Bereiche."
msgid ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>) "
-"[-u | -i]] [--no-sparse-checkout] [--index-output=<file>] (--empty | <tree-"
-"ish1> [<tree-ish2> [<tree-ish3>]])"
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<prefix>)\n"
+" [-u | -i]] [--index-output=<file>] [--no-sparse-checkout]\n"
+" (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"
msgstr ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<Präfix>) "
-"[-u | -i]] [--no-sparse-checkout] [--index-output=<Datei>] (--empty | "
-"<Commit-Referenz1> [<Commit-Referenz2> [<Commit-Referenz3>]])"
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<Präfix>)\n"
+" [-u | -i]] [--index-output=<Datei>] [--no-sparse-checkout]\n"
+" (--empty | <Commit-Referenz1> [<Commit-Referenz2> [<Commit-"
+"Referenz3>]])"
msgid "write resulting index to <file>"
msgstr "resultierenden Index nach <Datei> schreiben"
@@ -9933,8 +10266,8 @@ msgid "%s requires the merge backend"
msgstr "%s erfordert das Merge-Backend"
#, c-format
-msgid "could not get 'onto': '%s'"
-msgstr "Konnte 'onto' nicht bestimmen: '%s'"
+msgid "invalid onto: '%s'"
+msgstr "ungültig auf: '%s'"
#, c-format
msgid "invalid orig-head: '%s'"
@@ -9983,9 +10316,18 @@ msgstr ""
"ausführen."
#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "Unbekannter rebase-merges Modus: %s"
+
+#, c-format
msgid "could not switch to %s"
msgstr "Konnte nicht zu %s wechseln."
+msgid "apply options and merge options cannot be used together"
+msgstr ""
+"Optionen für \"am\" und Optionen für \"merge\" können nicht gemeinsam "
+"verwendet werden"
+
#, c-format
msgid ""
"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and "
@@ -9994,6 +10336,15 @@ msgstr ""
"nicht erkannter leerer Typ '%s'; gültige Werte sind \"drop\", \"keep\", und "
"\"ask\"."
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"--rebase-merges mit einem leeren String-Argument ist veraltet und wird in "
+"einer zukünftigen Version von Git nicht mehr funktionieren. Verwenden Sie "
+"stattdessen --rebase-merges ohne ein Argument, was dasselbe bewirkt."
+
#, c-format
msgid ""
"%s\n"
@@ -10112,6 +10463,10 @@ msgstr "behalte Commits, die leer beginnen"
msgid "move commits that begin with squash!/fixup! under -i"
msgstr "bei -i Commits verschieben, die mit squash!/fixup! beginnen"
+msgid "update branches that point to commits that are being rebased"
+msgstr ""
+"Branches aktualisieren, die auf Commits verweisen, die gerade rebased werden"
+
msgid "add exec lines after each commit of the editable list"
msgstr "exec-Zeilen nach jedem Commit der editierbaren Liste hinzufügen"
@@ -10215,17 +10570,19 @@ msgstr ""
msgid "switch `C' expects a numerical value"
msgstr "Schalter `C' erwartet einen numerischen Wert."
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "Unbekannter Modus: %s"
-
-msgid "--strategy requires --merge or --interactive"
-msgstr "--strategy erfordert --merge oder --interactive"
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges. Consider adding --"
+"no-rebase-merges"
+msgstr ""
+"apply-Optionen sind nicht kompatibel mit rebase.rebaseMerges. Erwägen Sie "
+"das Hinzufügen von --no-rebase-merges"
-msgid "apply options and merge options cannot be used together"
+msgid ""
+"apply options are incompatible with rebase.updateRefs. Consider adding --no-"
+"update-refs"
msgstr ""
-"Optionen für \"am\" und Optionen für \"merge\" können nicht gemeinsam "
-"verwendet werden"
+"apply-Optionen sind nicht kompatibel mit rebase.updateRefs. Erwägen Sie das "
+"Hinzufügen von --no-update-refs"
#, c-format
msgid "Unknown rebase backend: %s"
@@ -10249,8 +10606,8 @@ msgstr "Branch/Commit '%s' nicht gefunden"
msgid "No such ref: %s"
msgstr "Referenz nicht gefunden: %s"
-msgid "Could not resolve HEAD to a revision"
-msgstr "Konnte HEAD zu keinem Commit auflösen."
+msgid "Could not resolve HEAD to a commit"
+msgstr "HEAD konnte nicht in einen Commit aufgelöst werden"
#, c-format
msgid "'%s': need exactly one merge base with branch"
@@ -10264,9 +10621,6 @@ msgstr "'%s': benötige genau eine Merge-Basis"
msgid "Does not point to a valid commit '%s'"
msgstr "'%s' zeigt auf keinen gültigen Commit."
-msgid "Please commit or stash them."
-msgstr "Bitte committen Sie die Änderungen oder benutzen Sie \"stash\"."
-
msgid "HEAD is up to date."
msgstr "HEAD ist aktuell."
@@ -10529,11 +10883,12 @@ msgstr "unbekanntes Argument für Option mirror: %s"
msgid "fetch the remote branches"
msgstr "die Remote-Branches anfordern"
-msgid "import all tags and associated objects when fetching"
-msgstr "alle Tags und verbundene Objekte beim Anfordern importieren"
-
-msgid "or do not fetch any tag at all (--no-tags)"
-msgstr "oder fordere gar keine Tags an (--no-tags)"
+msgid ""
+"import all tags and associated objects when fetching\n"
+"or do not fetch any tag at all (--no-tags)"
+msgstr ""
+"alle Tags und zugehörigen Objekte beim Abruf importieren\n"
+"oder überhaupt keine Tags abrufen (--no-tags)"
msgid "branch(es) to track"
msgstr "Branch(es) zur Ãœbernahme"
@@ -10654,6 +11009,9 @@ msgstr " neu (wird bei nächstem \"fetch\" in remotes/%s gespeichert)"
msgid " tracked"
msgstr " gefolgt"
+msgid " skipped"
+msgstr " übersprungen"
+
msgid " stale (use 'git remote prune' to remove)"
msgstr " veraltet (benutzen Sie 'git remote prune' zum Löschen)"
@@ -10925,6 +11283,14 @@ msgstr "konnte temporäre Datei '%s' nicht zum Schreiben öffnen"
msgid "could not close refs snapshot tempfile"
msgstr "konnte temporäre Referenzen-Snapshot-Datei nicht schließen"
+#, c-format
+msgid "could not remove stale bitmap: %s"
+msgstr "konnte veraltete Bitmap nicht entfernen: %s"
+
+#, c-format
+msgid "pack prefix %s does not begin with objdir %s"
+msgstr "Pack-Präfix %s fängt nicht mit objdir %s an"
+
msgid "pack everything in a single pack"
msgstr "alles in eine einzige Pack-Datei packen"
@@ -10937,8 +11303,8 @@ msgstr "genau wie -a, unerreichbare überflüssige Objekte separat packen"
msgid "approxidate"
msgstr "Datumsangabe"
-msgid "with -C, expire objects older than this"
-msgstr "mit -C, Objekte älter als angegeben verfallen lassen"
+msgid "with --cruft, expire objects older than this"
+msgstr "mit --cruft, Objekte verfallen lassen, die älter sind als das"
msgid "remove redundant packs, and run git-prune-packed"
msgstr "redundante Pakete entfernen und \"git-prune-packed\" ausführen"
@@ -11000,19 +11366,29 @@ msgstr "eine geometrische Progression mit Faktor <N> finden"
msgid "write a multi-pack index of the resulting packs"
msgstr "ein Multi-Pack-Index des resultierenden Pakets schreiben"
+msgid "pack prefix to store a pack containing pruned objects"
+msgstr "pack-Präfix zum Speichern eines Pakets mit gelöschten Objekten"
+
+msgid "pack prefix to store a pack containing filtered out objects"
+msgstr "Paketpräfix, um ein Paket mit herausgefilterten Objekten zu speichern"
+
msgid "cannot delete packs in a precious-objects repo"
msgstr "kann Pack-Dateien in precious-objects Repository nicht löschen"
+#, c-format
+msgid "option '%s' can only be used along with '%s'"
+msgstr "Option '%s' kann nur zusammen mit '%s' verwendet werden"
+
msgid "Nothing new to pack."
msgstr "Nichts Neues zum Packen."
#, c-format
-msgid "pack prefix %s does not begin with objdir %s"
-msgstr "Pack-Präfix %s fängt nicht mit objdir %s an"
+msgid "renaming pack to '%s' failed"
+msgstr "Umbenennung des Pakets in '%s' fehlgeschlagen"
#, c-format
-msgid "missing required file: %s"
-msgstr "benötigte Datei fehlt: %s"
+msgid "pack-objects did not write a '%s' file for pack %s-%s"
+msgstr "pack-objects hat keine '%s' Datei für Paket %s-%s geschrieben"
#, c-format
msgid "could not unlink: %s"
@@ -11207,8 +11583,82 @@ msgstr "--convert-graft-file erwartet keine Argumente"
msgid "only one pattern can be given with -l"
msgstr "Mit -l kann nur ein Muster angegeben werden"
-msgid "git rerere [clear | forget <path>... | status | remaining | diff | gc]"
-msgstr "git rerere [clean | forget <Pfad>... | status | remaining | diff | gc]"
+msgid "need some commits to replay"
+msgstr "zum erneuten Abspielen werden Commits benötigt"
+
+msgid "--onto and --advance are incompatible"
+msgstr "--onto und --advance sind inkompatibel"
+
+msgid "all positive revisions given must be references"
+msgstr "alle angegebenen positiven Commits müssen Referenzen sein"
+
+msgid "argument to --advance must be a reference"
+msgstr "Argument für --advance muss eine Referenz sein"
+
+msgid ""
+"cannot advance target with multiple sources because ordering would be ill-"
+"defined"
+msgstr ""
+"kann Ziel nicht mit mehreren Quellen erweitern, da die Reihenfolge unklar "
+"wäre"
+
+msgid ""
+"cannot implicitly determine whether this is an --advance or --onto operation"
+msgstr ""
+"kann nicht implizit bestimmen, ob es sich um eine --advance oder --onto "
+"Operation handelt"
+
+msgid ""
+"cannot advance target with multiple source branches because ordering would "
+"be ill-defined"
+msgstr ""
+"kann Ziel nicht mit mehreren Quell-Branches erweitern, da die Reihenfolge "
+"unklar wäre"
+
+msgid "cannot implicitly determine correct base for --onto"
+msgstr "kann nicht implizit die richtige Basis für --onto bestimmen"
+
+msgid ""
+"(EXPERIMENTAL!) git replay ([--contained] --onto <newbase> | --advance "
+"<branch>) <revision-range>..."
+msgstr ""
+"(EXPERIMENTELL!) git replay ([--contained] --onto <neue-Basis> | --advance "
+"<Branch>) <Commitbereich>..."
+
+msgid "make replay advance given branch"
+msgstr "angegebenen Branch durch neues Abspielen erweitern"
+
+msgid "replay onto given commit"
+msgstr "auf angegebenen Commit neu abspielen"
+
+msgid "advance all branches contained in revision-range"
+msgstr "alle Branches erweitern, die in Commitbereich liegen"
+
+msgid "option --onto or --advance is mandatory"
+msgstr "Option --onto oder --advance erforderlich"
+
+#, c-format
+msgid ""
+"some rev walking options will be overridden as '%s' bit in 'struct rev_info' "
+"will be forced"
+msgstr ""
+"einige Optionen für das Abgehen von Commits werden außer Kraft gesetzt, da "
+"das '%s' Bit in 'struct rev_info' erzwungen wird"
+
+msgid "error preparing revisions"
+msgstr "Fehler beim Vorbereiten der Commits"
+
+msgid "replaying down to root commit is not supported yet!"
+msgstr "erneutes Abspielen bis zum Root-Commit wird noch nicht unterstützt!"
+
+msgid "replaying merge commits is not supported yet!"
+msgstr "erneutes Abspielen von Merge-Commits wird noch nicht unterstützt!"
+
+msgid ""
+"git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]"
+msgstr ""
+"git rerere [clear | forget <Pfadspezifikation>... | diff | status | "
+"remaining | gc]"
msgid "register clean resolutions in index"
msgstr "saubere Auflösungen im Index registrieren"
@@ -11335,6 +11785,10 @@ msgstr "Konnte neue Index-Datei nicht schreiben."
msgid "unable to get disk usage of %s"
msgstr "konnte Festplattennutzung von %s nicht bekommen"
+#, c-format
+msgid "invalid value for '%s': '%s', the only allowed format is '%s'"
+msgstr "ungültiger Wert für '%s': '%s', das einzig zulässige Format ist '%s'"
+
msgid "rev-list does not support display of notes"
msgstr "rev-list unterstützt keine Anzeige von Notizen"
@@ -11361,6 +11815,9 @@ msgstr "frühzeitiges Ende der Eingabe"
msgid "no usage string given before the `--' separator"
msgstr "kein Verwendungstext vor dem `--' Separator angegeben"
+msgid "missing opt-spec before option flags"
+msgstr "fehlende opt-spec vor Optionsflags"
+
msgid "Needed a single revision"
msgstr "Benötigte einen einzelnen Commit"
@@ -11411,21 +11868,33 @@ msgstr "unbekannter Modus für --abbrev-ref: %s"
msgid "this operation must be run in a work tree"
msgstr "Diese Operation muss in einem Arbeitsverzeichnis ausgeführt werden."
+msgid "Could not read the index"
+msgstr "Konnte den Index nicht lesen"
+
#, c-format
msgid "unknown mode for --show-object-format: %s"
msgstr "unbekannter Modus für --show-object-format: %s"
-msgid "git revert [<options>] <commit-ish>..."
-msgstr "git revert [<Optionen>] <Commit-Angabe>..."
+msgid ""
+"git revert [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] "
+"<commit>..."
+msgstr ""
+"git revert [--[no-]edit] [-n] [-m <Nummer des Elterncommits>] [-s] [-S[<Key-"
+"ID>]] <Commit>…"
-msgid "git revert <subcommand>"
-msgstr "git revert <Unterbefehl>"
+msgid "git revert (--continue | --skip | --abort | --quit)"
+msgstr "git revert (--continue | --skip | --abort | --quit)"
-msgid "git cherry-pick [<options>] <commit-ish>..."
-msgstr "git cherry-pick [<Optionen>] <Commit-Angabe>..."
+msgid ""
+"git cherry-pick [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff]\n"
+" [-S[<keyid>]] <commit>..."
+msgstr ""
+"git cherry-pick [--edit] [-n] [-m <Nummer des Elterncommits>] [-s] [-x] [--"
+"ff]\n"
+" [-S[<Key-ID>]] <Commit>…"
-msgid "git cherry-pick <subcommand>"
-msgstr "git cherry-pick <Unterbefehl>"
+msgid "git cherry-pick (--continue | --skip | --abort | --quit)"
+msgstr "git cherry-pick (--continue | --skip | --abort | --quit)"
#, c-format
msgid "option `%s' expects a number greater than zero"
@@ -11486,8 +11955,14 @@ msgstr "\"revert\" fehlgeschlagen"
msgid "cherry-pick failed"
msgstr "\"cherry-pick\" fehlgeschlagen"
-msgid "git rm [<options>] [--] <file>..."
-msgstr "git rm [<Optionen>] [--] <Datei>..."
+msgid ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<Datei> [--pathspec-file-nul]]\n"
+" [--] [<Pfadspezifikation>...]"
msgid ""
"the following file has staged content different from both the\n"
@@ -11565,16 +12040,21 @@ msgid ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
" [<host>:]<directory> (--all | <ref>...)"
msgstr ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
" [<Host>:]<Verzeichnis> (--all | <Referenz>...)"
msgid "remote name"
msgstr "Name des Remote-Repositories"
+msgid "push all refs"
+msgstr "alle Referenzen versenden"
+
msgid "use stateless RPC protocol"
msgstr "zustandsloses RPC-Protokoll verwenden"
@@ -11593,9 +12073,9 @@ msgstr "git log --pretty=short | git shortlog [<Optionen>]"
msgid "using multiple --group options with stdin is not supported"
msgstr "mehrere Optionen --group mit Standard-Eingabe wird nicht unterstützt"
-msgid "using --group=trailer with stdin is not supported"
-msgstr ""
-"Nutzung von --group=trailer mit Standard-Eingabe wird nicht unterstützt"
+#, c-format
+msgid "using %s with stdin is not supported"
+msgstr "die Verwendung von %s mit stdin wird nicht unterstützt"
#, c-format
msgid "unknown group type: %s"
@@ -11632,12 +12112,14 @@ msgid ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
" [--current] [--color[=<when>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<rev> | <glob>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<rev> | <glob>)...]"
msgstr ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
-" [--current] [--color[=<Wann>] | --no-color] [--sparse]\n"
+" [--current] [--color[=<wann>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<Commit> | <glob>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<Commit> | <Glob>)...]"
msgid "git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]"
msgstr "git show-branch (-g | --reflog)[=<n>[,<Basis>]] [--list] [<Referenz>]"
@@ -11738,21 +12220,44 @@ msgid "Unknown hash algorithm"
msgstr "Unbekannter Hash-Algorithmus"
msgid ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...]"
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<pattern>...]"
msgstr ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<Muster>...] "
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<Muster>...]"
+
+msgid ""
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<ref>...]"
+msgstr ""
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<Referenz>...]"
msgid "git show-ref --exclude-existing[=<pattern>]"
msgstr "git show-ref --exclude-existing[=<Muster>]"
+msgid "git show-ref --exists <ref>"
+msgstr "git show-ref --exists <Referenz>"
+
+msgid "reference does not exist"
+msgstr "Referenz nicht vorhanden"
+
+msgid "failed to look up reference"
+msgstr "Fehler beim Nachschlagen der Referenz"
+
msgid "only show tags (can be combined with heads)"
msgstr "nur Tags anzeigen (kann mit \"heads\" kombiniert werden)"
msgid "only show heads (can be combined with tags)"
msgstr "nur Branches anzeigen (kann mit \"tags\" kombiniert werden)"
+msgid "check for reference existence without resolving"
+msgstr "Prüfung auf Vorhandensein einer Referenz, ohne diese aufzulösen"
+
msgid "stricter reference checking, requires exact ref path"
msgstr "strengere Referenzprüfung, erfordert exakten Referenzpfad"
@@ -11775,8 +12280,12 @@ msgstr ""
"Referenzen von der Standard-Eingabe anzeigen, die sich nicht im lokalen "
"Repository befinden"
-msgid "git sparse-checkout (init|list|set|add|reapply|disable) <options>"
-msgstr "git sparse-checkout (init|list|set|add|reapply|disable) <Optionen>"
+msgid ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
+msgstr ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<Optionen>]"
msgid "this worktree is not sparse"
msgstr "dieses Arbeitsverzeichnis ist nicht partiell"
@@ -11907,67 +12416,76 @@ msgstr ""
msgid "error while refreshing working directory"
msgstr "Fehler während der Aktualisierung des Arbeitsverzeichnisses."
-msgid "git stash list [<options>]"
-msgstr "git stash list [<Optionen>]"
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <Datei>]"
-msgid "git stash show [<options>] [<stash>]"
-msgstr "git stash show [<Optionen>] [<Stash>]"
+msgid "terminate input and output files by a NUL character"
+msgstr "Eingabe- und Ausgabedateien durch ein NUL-Zeichen abschließen"
-msgid "git stash drop [-q|--quiet] [<stash>]"
-msgstr "git stash drop [-q|--quiet] [<Stash>]"
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
+"bei Verwendung mit --rules-file werden die Muster als Cone-Modus Muster "
+"interpretiert"
-msgid "git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash ( pop | apply ) [--index] [-q|--quiet] [<Stash>]"
+msgid "use patterns in <file> instead of the current ones."
+msgstr "Muster aus <Datei> anstelle der aktuellen Muster verwenden"
-msgid "git stash branch <branchname> [<stash>]"
-msgstr "git stash branch <Branch> [<Stash>]"
+msgid "git stash list [<log-options>]"
+msgstr "git stash list [<log-Optionen>]"
msgid ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
-" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
-" [--] [<pathspec>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<diff-"
+"options>] [<stash>]"
msgstr ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <Nachricht>]\n"
-" [--pathspec-from-file=<Datei> [--pathspec-file-nul]]\n"
-" [--] [<Pfadspezifikation>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<Diff-"
+"Optionen>] [<Stash>]"
-msgid ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
-msgstr ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<Nachricht>]"
+msgid "git stash drop [-q | --quiet] [<stash>]"
+msgstr "git stash drop [-q | --quiet] [<Stash>]"
-msgid "git stash pop [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash pop [--index] [-q|--quiet] [<Stash>]"
+msgid "git stash pop [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash pop [--index] [-q | --quiet] [<Stash>]"
-msgid "git stash apply [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash apply [--index] [-q|--quiet] [<Stash>]"
+msgid "git stash apply [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash apply [--index] [-q | --quiet] [<Stash>]"
-msgid "git stash store [-m|--message <message>] [-q|--quiet] <commit>"
-msgstr "git stash store [-m|--message <Nachricht>] [-q|--quiet] <Commit>"
+msgid "git stash branch <branchname> [<stash>]"
+msgstr "git stash branch <Branch> [<Stash>]"
+
+msgid "git stash store [(-m | --message) <message>] [-q | --quiet] <commit>"
+msgstr ""
+"git stash store [(-m | --message) <Beschreibung>] [-q | --quiet] <Commit>"
msgid ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<message>]\n"
+" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
" [--] [<pathspec>...]]"
msgstr ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <Nachricht>]\n"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<Nachricht>]\n"
+" [--pathspec-from-file=<Datei> [--pathspec-file-nul]]\n"
" [--] [<Pfadspezifikation>...]]"
msgid ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<message>]"
msgstr ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<Nachricht>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<Beschreibung>]"
+
+msgid "git stash create [<message>]"
+msgstr "git stash create [<Beschreibung>]"
#, c-format
msgid "'%s' is not a stash-like commit"
@@ -12148,6 +12666,10 @@ msgid "Expecting a full ref name, got %s"
msgstr "Vollständiger Referenzname erwartet, %s erhalten"
#, c-format
+msgid "could not get a repository handle for submodule '%s'"
+msgstr "Konnte kein Repository-Handle für Submodul '%s' erhalten."
+
+#, c-format
msgid ""
"could not look up configuration '%s'. Assuming this repository is its own "
"authoritative upstream."
@@ -12155,12 +12677,6 @@ msgstr ""
"Konnte Konfiguration '%s' nicht nachschlagen. Nehme an, dass dieses\n"
"Repository sein eigenes verbindliches Upstream-Repository ist."
-msgid "alternative anchor for relative paths"
-msgstr "Alternativer Anker für relative Pfade"
-
-msgid "git submodule--helper list [--prefix=<path>] [<path>...]"
-msgstr "git submodule--helper list [--prefix=<Pfad>] [<Pfad>...]"
-
#, c-format
msgid "No url found for submodule path '%s' in .gitmodules"
msgstr "Keine URL für Submodul-Pfad '%s' in .gitmodules gefunden"
@@ -12194,8 +12710,8 @@ msgstr "Ausgaben beim Betreten eines Submodul-Befehls unterdrücken"
msgid "recurse into nested submodules"
msgstr "Rekursion in verschachtelte Submodule durchführen"
-msgid "git submodule--helper foreach [--quiet] [--recursive] [--] <command>"
-msgstr "git submodule--helper foreach [--quiet] [--recursive] [--] <Befehl>"
+msgid "git submodule foreach [--quiet] [--recursive] [--] <command>"
+msgstr "git submodule foreach [--quiet] [--recursive] [--] <Befehl>"
#, c-format
msgid "Failed to register url for submodule path '%s'"
@@ -12219,8 +12735,8 @@ msgstr ""
msgid "suppress output for initializing a submodule"
msgstr "Ausgaben bei Initialisierung eines Submoduls unterdrücken"
-msgid "git submodule--helper init [<options>] [<path>]"
-msgstr "git submodule--helper init [<Optionen>] [<Pfad>]"
+msgid "git submodule init [<options>] [<path>]"
+msgstr "git submodule init [<Optionen>] [<Pfad>]"
#, c-format
msgid "no submodule mapping found in .gitmodules for path '%s'"
@@ -12246,9 +12762,6 @@ msgstr ""
msgid "git submodule status [--quiet] [--cached] [--recursive] [<path>...]"
msgstr "git submodule status [--quiet] [--cached] [--recursive] [<Pfad>...]"
-msgid "git submodule--helper name <path>"
-msgstr "git submodule--helper name <Pfad>"
-
#, c-format
msgid "* %s %s(blob)->%s(submodule)"
msgstr "* %s %s(blob)->%s(submodule)"
@@ -12283,8 +12796,8 @@ msgstr ""
msgid "limit the summary size"
msgstr "Größe der Zusammenfassung begrenzen"
-msgid "git submodule--helper summary [<options>] [<commit>] [--] [<path>]"
-msgstr "git submodule--helper summary [<Optionen>] [<Commit>] [--] [<Pfad>]"
+msgid "git submodule summary [<options>] [<commit>] [--] [<path>]"
+msgstr "git submodule summary [<Optionen>] [<Commit>] [--] [<Pfad>]"
msgid "could not fetch a revision for HEAD"
msgstr "konnte keinen Commit für HEAD holen"
@@ -12298,18 +12811,14 @@ msgid "failed to register url for submodule path '%s'"
msgstr "Fehler beim Registrieren der URL für Submodul-Pfad '%s'"
#, c-format
-msgid "failed to get the default remote for submodule '%s'"
-msgstr "Fehler beim Lesen des Standard-Remote-Repositories für Submodul '%s'"
-
-#, c-format
msgid "failed to update remote for submodule '%s'"
msgstr "Fehler beim Aktualisieren des Remote-Repositories für Submodul '%s'"
msgid "suppress output of synchronizing submodule url"
msgstr "Ausgaben bei der Synchronisierung der Submodul-URLs unterdrücken"
-msgid "git submodule--helper sync [--quiet] [--recursive] [<path>]"
-msgstr "git submodule--helper sync [--quiet] [--recursive] [<Pfad>]"
+msgid "git submodule sync [--quiet] [--recursive] [<path>]"
+msgstr "git submodule sync [--quiet] [--recursive] [<Pfad>]"
#, c-format
msgid ""
@@ -12374,6 +12883,10 @@ msgstr ""
"'--reference-if-able' statt '--reference'."
#, c-format
+msgid "could not get a repository handle for gitdir '%s'"
+msgstr "konnte kein Repository-Handle für gitdir '%s' erhalten"
+
+#, c-format
msgid "submodule '%s' cannot add alternate: %s"
msgstr "Submodul '%s' kann Alternative nicht hinzufügen: %s"
@@ -12403,6 +12916,9 @@ msgstr "Verzeichnis ist nicht leer: '%s'"
msgid "could not get submodule directory for '%s'"
msgstr "Konnte Submodul-Verzeichnis '%s' nicht finden."
+msgid "alternative anchor for relative paths"
+msgstr "Alternativer Anker für relative Pfade"
+
msgid "where the new submodule will be cloned to"
msgstr "Pfad für neues Submodul"
@@ -12431,10 +12947,6 @@ msgstr ""
"<filter-spec>] --url <URL> --path <Pfad>"
#, c-format
-msgid "Invalid update mode '%s' for submodule path '%s'"
-msgstr "Ungültiger Aktualisierungsmodus '%s' für Submodul-Pfad '%s'."
-
-#, c-format
msgid "Invalid update mode '%s' configured for submodule path '%s'"
msgstr ""
"Ungültiger Aktualisierungsmodus '%s' für Submodul-Pfad '%s' konfiguriert."
@@ -12455,6 +12967,10 @@ msgid "Skipping submodule '%s'"
msgstr "Ãœberspringe Submodul '%s'"
#, c-format
+msgid "cannot clone submodule '%s' without a URL"
+msgstr "kann Submodul '%s' nicht ohne URL klonen"
+
+#, c-format
msgid "Failed to clone '%s'. Retry scheduled"
msgstr "Fehler beim Klonen von '%s'. Weiterer Versuch geplant"
@@ -12509,6 +13025,10 @@ msgstr ""
"Anfordern dieses Commits ist fehlgeschlagen."
#, c-format
+msgid "could not initialize submodule at path '%s'"
+msgstr "konnte das Submodul unter dem Pfad '%s' nicht initialisieren"
+
+#, c-format
msgid ""
"Submodule (%s) branch configured to inherit branch from superproject, but "
"the superproject is not on any branch"
@@ -12517,10 +13037,6 @@ msgstr ""
"zu erben, aber das Hauptprojekt befindet sich auf keinem Branch."
#, c-format
-msgid "could not get a repository handle for submodule '%s'"
-msgstr "Konnte kein Repository-Handle für Submodul '%s' erhalten."
-
-#, c-format
msgid "Unable to find current revision in submodule path '%s'"
msgstr "Konnte aktuellen Commit nicht in Submodul-Pfad '%s' finden"
@@ -12551,15 +13067,14 @@ msgstr "Submodule rekursiv durchlaufen"
msgid "don't fetch new objects from the remote site"
msgstr "keine neuen Objekte von Remote abrufen"
-msgid "path into the working tree"
-msgstr "Pfad zum Arbeitsverzeichnis"
+msgid "use the 'checkout' update strategy (default)"
+msgstr "die Aktualisierungsstrategie \"checkout\" verwenden (Standard)"
-msgid "path into the working tree, across nested submodule boundaries"
-msgstr ""
-"Pfad zum Arbeitsverzeichnis, über verschachtelte Submodul-Grenzen hinweg"
+msgid "use the 'merge' update strategy"
+msgstr "die Aktualisierungsstrategie 'merge' verwenden"
-msgid "rebase, merge, checkout or none"
-msgstr "rebase, merge, checkout oder none"
+msgid "use the 'rebase' update strategy"
+msgstr "die Aktualisierungsstrategie 'rebase' verwenden"
msgid "create a shallow clone truncated to the specified number of revisions"
msgstr ""
@@ -12577,6 +13092,10 @@ msgstr ""
msgid "don't print cloning progress"
msgstr "keine Fortschrittsanzeige beim Klonen"
+msgid "disallow cloning into non-empty directory, implies --init"
+msgstr ""
+"klonen in ein nicht leeres Verzeichnis nicht zulassen, impliziert --init"
+
msgid ""
"git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] "
"[-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-"
@@ -12588,37 +13107,17 @@ msgstr ""
"shallow] [--reference <Repository>] [--recursive] [--[no-]single-branch] "
"[--] [<Pfad>...]"
-msgid "bad value for update parameter"
-msgstr "Fehlerhafter Wert für update Parameter"
-
-msgid "recurse into submodules"
-msgstr "Rekursion in Submodule durchführen"
-
-msgid "git submodule--helper absorb-git-dirs [<options>] [<path>...]"
-msgstr "git submodule--helper absorb-git-dirs [<Optionen>] [<Pfad>...]"
-
-msgid "check if it is safe to write to the .gitmodules file"
-msgstr "prüfen, ob es sicher ist, in die Datei .gitmodules zu schreiben"
-
-msgid "unset the config in the .gitmodules file"
-msgstr "Konfiguration in der .gitmodules-Datei entfernen"
-
-msgid "git submodule--helper config <name> [<value>]"
-msgstr "git submodule--helper config <name> [<Wert>]"
-
-msgid "git submodule--helper config --unset <name>"
-msgstr "git submodule--helper config --unset <Name>"
+msgid "Failed to resolve HEAD as a valid ref."
+msgstr "Konnte HEAD nicht als gültige Referenz auflösen."
-msgid "please make sure that the .gitmodules file is in the working tree"
-msgstr ""
-"Bitte stellen Sie sicher, dass sich die Datei .gitmodules im "
-"Arbeitsverzeichnis befindet."
+msgid "git submodule absorbgitdirs [<options>] [<path>...]"
+msgstr "git submodule absorbgitdirs [<Optionen>] [<Pfad>...]"
msgid "suppress output for setting url of a submodule"
msgstr "Ausgaben beim Setzen der URL eines Submoduls unterdrücken"
-msgid "git submodule--helper set-url [--quiet] <path> <newurl>"
-msgstr "git submodule--helper set-url [--quiet] <Pfad> <neue URL>"
+msgid "git submodule set-url [--quiet] <path> <newurl>"
+msgstr "git submodule set-url [--quiet] <Pfad> <neue URL>"
msgid "set the default tracking branch to master"
msgstr "Standard-Tracking-Branch auf master setzen"
@@ -12626,13 +13125,11 @@ msgstr "Standard-Tracking-Branch auf master setzen"
msgid "set the default tracking branch"
msgstr "Standard-Tracking-Branch setzen"
-msgid "git submodule--helper set-branch [-q|--quiet] (-d|--default) <path>"
-msgstr "git submodule--helper set-branch [-q|--quiet] (-d|--default) [<Pfad>]"
+msgid "git submodule set-branch [-q|--quiet] (-d|--default) <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-d|--default) <Pfad>"
-msgid ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
-msgstr ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <Branch> <Pfad>"
+msgid "git submodule set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-b|--branch) <Branch> <Pfad>"
msgid "--branch or --default required"
msgstr "Option --branch oder --default erforderlich"
@@ -12696,6 +13193,11 @@ msgstr "Reaktiviere lokales Git-Verzeichnis für Submodul '%s'\n"
msgid "unable to checkout submodule '%s'"
msgstr "kann Submodul '%s' nicht auschecken"
+msgid "please make sure that the .gitmodules file is in the working tree"
+msgstr ""
+"Bitte stellen Sie sicher, dass sich die Datei .gitmodules im "
+"Arbeitsverzeichnis befindet."
+
#, c-format
msgid "Failed to add submodule '%s'"
msgstr "Hinzufügen von Submodul '%s' fehlgeschlagen"
@@ -12732,8 +13234,8 @@ msgstr ""
"setzt den Namen des Submoduls auf die angegebene Zeichenkette fest, statt "
"standardmäßig dessen Pfad zu nehmen"
-msgid "git submodule--helper add [<options>] [--] <repository> [<path>]"
-msgstr "git submodule--helper add [<Optionen>] [--] <Repository> [<Pfad>]"
+msgid "git submodule add [<options>] [--] <repository> [<path>]"
+msgstr "git submodule add [<Optionen>] [--] <Repository> [<Pfad>]"
msgid "Relative path can only be used from the toplevel of the working tree"
msgstr ""
@@ -12748,19 +13250,17 @@ msgstr "repo URL: '%s' muss absolut sein oder mit ./|../ beginnen"
msgid "'%s' is not a valid submodule name"
msgstr "'%s' ist kein gültiger Submodul-Name"
-#, c-format
-msgid "%s doesn't support --super-prefix"
-msgstr "%s unterstützt kein --super-prefix"
+msgid "git submodule--helper <command>"
+msgstr "git submodule--helper <Befehl>"
-#, c-format
-msgid "'%s' is not a valid submodule--helper subcommand"
-msgstr "'%s' ist kein gültiger Unterbefehl von submodule--helper"
+msgid "git symbolic-ref [-m <reason>] <name> <ref>"
+msgstr "git symbolic-ref [-m <Grund>] <Name> <Referenz>"
-msgid "git symbolic-ref [<options>] <name> [<ref>]"
-msgstr "git symbolic-ref [<Optionen>] <Name> [<Referenz>]"
+msgid "git symbolic-ref [-q] [--short] [--no-recurse] <name>"
+msgstr "git symbolic-ref [-q] [--short] [--no-recurse] <Name>"
-msgid "git symbolic-ref -d [-q] <name>"
-msgstr "git symbolic-ref -d [-q] <Name>"
+msgid "git symbolic-ref --delete [-q] <name>"
+msgstr "git symbolic-ref --delete [-q] <Name>"
msgid "suppress error message for non-symbolic (detached) refs"
msgstr ""
@@ -12772,6 +13272,9 @@ msgstr "symbolische Referenzen löschen"
msgid "shorten ref output"
msgstr "verkürzte Ausgabe der Referenzen"
+msgid "recursively dereference (default)"
+msgstr "rekursives Dereferenzieren (Standard)"
+
msgid "reason"
msgstr "Grund"
@@ -12779,25 +13282,25 @@ msgid "reason of the update"
msgstr "Grund für die Aktualisierung"
msgid ""
-"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]\n"
-" <tagname> [<head>]"
+"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
+" <tagname> [<commit> | <object>]"
msgstr ""
-"git tag [-a | -s | -u <Schlüssel-ID>] [-f] [-m <Beschreibung> | -F <Datei>]\n"
-" <Tagname> [<Commit>]"
+"git tag [-a | -s | -u <Key-ID>] [-f] [-m <Beschreibung> | -F <Datei>] [-e]\n"
+" <Tagname> [<Commit> | <Objekt>]"
msgid "git tag -d <tagname>..."
msgstr "git tag -d <Tagname>..."
msgid ""
-"git tag -l [-n[<num>]] [--contains <commit>] [--no-contains <commit>] [--"
-"points-at <object>]\n"
-" [--format=<format>] [--merged <commit>] [--no-merged <commit>] "
-"[<pattern>...]"
+"git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]\n"
+" [--points-at <object>] [--column[=<options>] | --no-column]\n"
+" [--create-reflog] [--sort=<key>] [--format=<format>]\n"
+" [--merged <commit>] [--no-merged <commit>] [<pattern>...]"
msgstr ""
-"git tag -l [-n[<Nummer>]] [--contains <Commit>] [--no-contains <Commit>] [--"
-"points-at <Objekt>]\n"
-" [--format=<format>] [--merged <Commit>] [--no-merged <Commit>] "
-"[<Muster>...]"
+"git tag [-n[<Nummer>]] -l [--contains <Commit>] [--no-contains <Commit>]\n"
+" [--points-at <Objekt>] [--column[=<Optionen>] | --no-column]\n"
+" [--create-reflog] [--sort=<Schlüssel>] [--format=<Format>]\n"
+" [--merged <Commit>] [--no-merged <Commit>] [<Muster>...]"
msgid "git tag -v [--format=<format>] <tagname>..."
msgstr "git tag -v [--format=<Format>] <Tagname>..."
@@ -12942,6 +13445,16 @@ msgstr "Tag '%s' aktualisiert (war %s)\n"
msgid "pack exceeds maximum allowed size"
msgstr "Paket überschreitet die maximal erlaubte Größe"
+msgid "failed to write object in stream"
+msgstr "Objekt kann nicht in Stream geschrieben werden"
+
+#, c-format
+msgid "inflate returned (%d)"
+msgstr "Dekomprimierung gab (%d) zurück"
+
+msgid "invalid blob object from stream"
+msgstr "ungültiges Blob-Objekt aus Stream"
+
msgid "Unpacking objects"
msgstr "Entpacke Objekte"
@@ -13080,6 +13593,9 @@ msgstr "(für Fremdprogramme) keine gespeicherten, nicht aufgelöste Konflikte"
msgid "write index in this format"
msgstr "Index-Datei in diesem Format schreiben"
+msgid "report on-disk index format version"
+msgstr "Bericht über die Version des Indexformats auf der Festplatte"
+
msgid "enable or disable split index"
msgstr "aufgeteilten Index aktivieren oder deaktivieren"
@@ -13106,6 +13622,14 @@ msgstr "Dateien als \"fsmonitor valid\" markieren"
msgid "clear fsmonitor valid bit"
msgstr "\"fsmonitor valid\"-Bit löschen"
+#, c-format
+msgid "%d\n"
+msgstr "%d\n"
+
+#, c-format
+msgid "index-version: was %d, set to %d"
+msgstr "index-version: war %d, wurde auf %d gesetzt"
+
msgid ""
"core.splitIndex is set to false; remove or change it, if you really want to "
"enable split index"
@@ -13186,8 +13710,12 @@ msgstr "Aktualisierungen von der Standard-Eingabe lesen"
msgid "update the info files from scratch"
msgstr "die Informationsdateien von Grund auf aktualisieren"
-msgid "git upload-pack [<options>] <dir>"
-msgstr "git upload-pack [<Optionen>] <Verzeichnis>"
+msgid ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <directory>"
+msgstr ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <directory>"
msgid "quit after a single request/response exchange"
msgstr "nach einem einzigen Request/Response-Austausch beenden"
@@ -13203,8 +13731,8 @@ msgstr ""
msgid "interrupt transfer after <n> seconds of inactivity"
msgstr "Übertragung nach <n> Sekunden Inaktivität unterbrechen"
-msgid "git verify-commit [-v | --verbose] <commit>..."
-msgstr "git verify-commit [-v | --verbose] <Commit>..."
+msgid "git verify-commit [-v | --verbose] [--raw] <commit>..."
+msgstr "git verify-commit [-v | --verbose] [--raw] <Commit>..."
msgid "print commit contents"
msgstr "Commit-Inhalte ausgeben"
@@ -13212,8 +13740,9 @@ msgstr "Commit-Inhalte ausgeben"
msgid "print raw gpg status output"
msgstr "unbearbeitete Ausgabe des Status von gpg ausgeben"
-msgid "git verify-pack [-v | --verbose] [-s | --stat-only] <pack>..."
-msgstr "git verify-pack [-v | --verbose] [-s | --stat-only] <Paket>..."
+msgid "git verify-pack [-v | --verbose] [-s | --stat-only] [--] <pack>.idx..."
+msgstr ""
+"git verify-pack [-v | --verbose] [-s | --stat-only] [--] <Paket>.idx..."
msgid "verbose"
msgstr "erweiterte Ausgaben"
@@ -13221,35 +13750,72 @@ msgstr "erweiterte Ausgaben"
msgid "show statistics only"
msgstr "nur Statistiken anzeigen"
-msgid "git verify-tag [-v | --verbose] [--format=<format>] <tag>..."
-msgstr "git verify-tag [-v | --verbose] [--format=<Format>] <Tag>..."
+msgid "git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."
+msgstr "git verify-tag [-v | --verbose] [--format=<Format>] [--raw] <Tag>..."
msgid "print tag contents"
msgstr "Tag-Inhalte ausgeben"
-msgid "git worktree add [<options>] <path> [<commit-ish>]"
-msgstr "git worktree add [<Optionen>] <Pfad> [<Commit-Angabe>]"
+msgid ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <string>]]\n"
+" [--orphan] [(-b | -B) <new-branch>] <path> [<commit-ish>]"
+msgstr ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason "
+"<Zeichenkette>]]\n"
+" [--orphan] [(-b | -B) <neuer-Branch>] <Pfad> [<Commit-"
+"Angabe>]"
-msgid "git worktree list [<options>]"
-msgstr "git worktree list [<Optionen>]"
+msgid "git worktree list [-v | --porcelain [-z]]"
+msgstr "git worktree list [-v | --porcelain [-z]]"
-msgid "git worktree lock [<options>] <path>"
-msgstr "git worktree lock [<Optionen>] <Pfad>"
+msgid "git worktree lock [--reason <string>] <worktree>"
+msgstr "git worktree lock [--reason <Zeichenkette>] <Arbeitsverzeichnis>"
msgid "git worktree move <worktree> <new-path>"
msgstr "git worktree move <Arbeitsverzeichnis> <neuer-Pfad>"
-msgid "git worktree prune [<options>]"
-msgstr "git worktree prune [<Optionen>]"
+msgid "git worktree prune [-n] [-v] [--expire <expire>]"
+msgstr "git worktree prune [-n] [-v] [--expire <Zeit>]"
-msgid "git worktree remove [<options>] <worktree>"
-msgstr "git worktree remove [<Optionen>] <Arbeitsverzeichnis>"
+msgid "git worktree remove [-f] <worktree>"
+msgstr "git worktree remove [-f] <Arbeitsverzeichnis>"
msgid "git worktree repair [<path>...]"
msgstr "git worktree repair [<Pfad>...]"
-msgid "git worktree unlock <path>"
-msgstr "git worktree unlock <Pfad>"
+msgid "git worktree unlock <worktree>"
+msgstr "git worktree unlock <Arbeitsverzeichnis>"
+
+msgid "No possible source branch, inferring '--orphan'"
+msgstr "Kein möglicher Quell-Branch, der auf '--orphan' schließen lässt"
+
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+msgstr ""
+"Wenn Sie ein Arbeitsverzeichnis erstellen möchten, welches einen neuen\n"
+"ungeborenen Branch (Branch ohne Commits) für dieses Repository erzeugt,\n"
+"können Sie dies mit der Option --orphan tun:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan %s\n"
+msgstr ""
+"Wenn Sie ein Arbeitsverzeichnis erstellen möchten, welches einen neuen\n"
+"ungeborenen Branch (Branch ohne Commits) für dieses Repository erzeugt,\n"
+"können Sie dies mit der Option --orphan tun:\n"
+"\n"
+" git worktree add --orphan %s\n"
#, c-format
msgid "Removing %s/%s: %s"
@@ -13310,6 +13876,10 @@ msgid "initializing"
msgstr "initialisiere"
#, c-format
+msgid "could not find created worktree '%s'"
+msgstr "konnte erstelltes Arbeitsverzeichnis '%s' nicht finden"
+
+#, c-format
msgid "Preparing worktree (new branch '%s')"
msgstr "Bereite Arbeitsverzeichnis vor (neuer Branch '%s')"
@@ -13322,9 +13892,33 @@ msgid "Preparing worktree (checking out '%s')"
msgstr "Bereite Arbeitsverzeichnis vor (checke '%s' aus)"
#, c-format
+msgid "unreachable: invalid reference: %s"
+msgstr "unerreichbar: ungültige Referenz: %s"
+
+#, c-format
msgid "Preparing worktree (detached HEAD %s)"
msgstr "Bereite Arbeitsverzeichnis vor (losgelöster HEAD %s)"
+#, c-format
+msgid ""
+"HEAD points to an invalid (or orphaned) reference.\n"
+"HEAD path: '%s'\n"
+"HEAD contents: '%s'"
+msgstr ""
+"HEAD zeigt auf eine ungültige (oder verwaiste) Referenz.\n"
+"HEAD-Pfad: '%s'\n"
+"HEAD Inhalte: '%s'"
+
+msgid ""
+"No local or remote refs exist despite at least one remote\n"
+"present, stopping; use 'add -f' to override or fetch a remote first"
+msgstr ""
+"Es gibt keine lokalen oder entfernten Referenzen, obwohl mindestens ein "
+"Remote-Repository\n"
+"vorhanden ist. Angehalten. Verwenden Sie 'add -f', um eine entfernte "
+"Referenz zu überschreiben\n"
+"oder rufen Sie diese zuerst ab"
+
msgid "checkout <branch> even if already checked out in other worktree"
msgstr ""
"<Branch> auschecken, auch wenn dieser bereits in einem anderen "
@@ -13336,6 +13930,9 @@ msgstr "neuen Branch erstellen"
msgid "create or reset a branch"
msgstr "Branch erstellen oder umsetzen"
+msgid "create unborn branch"
+msgstr "ungeborenen Branch erzeugen"
+
msgid "populate the new working tree"
msgstr "das neue Arbeitsverzeichnis auschecken"
@@ -13358,6 +13955,10 @@ msgid "options '%s', '%s', and '%s' cannot be used together"
msgstr ""
"die Optionen '%s', '%s' und '%s' können nicht gemeinsam verwendet werden"
+#, c-format
+msgid "option '%s' and commit-ish cannot be used together"
+msgstr "Option '%s' und commit-ish können nicht gemeinsam verwendet werden"
+
msgid "added with --lock"
msgstr "mit --lock hinzugefügt"
@@ -13497,6 +14098,62 @@ msgstr "das Tree-Objekt für ein Unterverzeichnis <Präfix> schreiben"
msgid "only useful for debugging"
msgstr "nur nützlich für Fehlersuche"
+msgid "core.fsyncMethod = batch is unsupported on this platform"
+msgstr "core.fsyncMethod = batch wird auf dieser Plattform nicht unterstützt"
+
+#, c-format
+msgid "could not parse bundle list key %s with value '%s'"
+msgstr "Konnte Bundle-Listenschlüssel %s mit Wert '%s' nicht parsen."
+
+#, c-format
+msgid "bundle list at '%s' has no mode"
+msgstr "Paketliste bei '%s' hat keinen Modus"
+
+msgid "failed to create temporary file"
+msgstr "temporäre Datei kann nicht erstellt werden"
+
+msgid "insufficient capabilities"
+msgstr "unzureichende Fähigkeiten"
+
+#, c-format
+msgid "file downloaded from '%s' is not a bundle"
+msgstr "die von '%s' heruntergeladene Datei ist kein Bundle"
+
+msgid "failed to store maximum creation token"
+msgstr "das maximale Erstellungs-Token konnte nicht gespeichert werden"
+
+#, c-format
+msgid "unrecognized bundle mode from URI '%s'"
+msgstr "nicht erkannter Bundle-Modus von URI '%s'"
+
+#, c-format
+msgid "exceeded bundle URI recursion limit (%d)"
+msgstr "Rekursionsgrenze für Bundle-URI überschritten (%d)"
+
+#, c-format
+msgid "failed to download bundle from URI '%s'"
+msgstr "Download des Bundles von URI '%s' fehlgeschlagen"
+
+#, c-format
+msgid "file at URI '%s' is not a bundle or bundle list"
+msgstr "Datei unter URI '%s' ist kein Paket oder keine Paketliste"
+
+#, c-format
+msgid "bundle-uri: unexpected argument: '%s'"
+msgstr "bundle-uri: unerwartetes Argument: '%s'"
+
+msgid "bundle-uri: expected flush after arguments"
+msgstr "bundle-uri: erwarteter Flush nach Argumenten"
+
+msgid "bundle-uri: got an empty line"
+msgstr "bundle-uri: erhielt eine leere Zeile"
+
+msgid "bundle-uri: line is not of the form 'key=value'"
+msgstr "bundle-uri: Zeile hat nicht die Form 'Schlüssel=Wert'"
+
+msgid "bundle-uri: line has empty key or value"
+msgstr "bundle-uri: Zeile hat leeren Schlüssel oder Wert"
+
#, c-format
msgid "unrecognized bundle hash algorithm: %s"
msgstr "unbekannter Paket-Hash-Algorithmus: %s"
@@ -13519,6 +14176,13 @@ msgstr "Dem Repository fehlen folgende vorausgesetzte Commits:"
msgid "need a repository to verify a bundle"
msgstr "um ein Paket zu überprüfen wird ein Repository benötigt"
+msgid ""
+"some prerequisite commits exist in the object store, but are not connected "
+"to the repository's history"
+msgstr ""
+"einige vorausgesetzte Commits sind im Objektspeicher vorhanden, aber sind "
+"nicht mit der Repository-Historie verbunden"
+
#, c-format
msgid "The bundle contains this ref:"
msgid_plural "The bundle contains these %<PRIuMAX> refs:"
@@ -13534,6 +14198,14 @@ msgid_plural "The bundle requires these %<PRIuMAX> refs:"
msgstr[0] "Das Paket benötigt diese Referenz:"
msgstr[1] "Das Paket benötigt diese %<PRIuMAX> Referenzen:"
+#, c-format
+msgid "The bundle uses this hash algorithm: %s"
+msgstr "Das Paket verwendet diesen Hash-Algorithmus: %s"
+
+#, c-format
+msgid "The bundle uses this filter: %s"
+msgstr "Das Paket verwendet diesen Filter: %s"
+
msgid "unable to dup bundle descriptor"
msgstr "konnte dup für Descriptor des Pakets nicht ausführen"
@@ -13569,6 +14241,10 @@ msgid "terminating chunk id appears earlier than expected"
msgstr "abschließende Chunk-ID erscheint eher als erwartet"
#, c-format
+msgid "chunk id %<PRIx32> not %d-byte aligned"
+msgstr "Chunk id %<PRIx32> nicht %d-byte-aligned"
+
+#, c-format
msgid "improper chunk offset(s) %<PRIx64> and %<PRIx64>"
msgstr "unzulässige(r) Chunk-Offset(s) %<PRIx64> und %<PRIx64>"
@@ -13625,10 +14301,8 @@ msgstr ""
msgid "Move objects and refs by archive"
msgstr "Objekte und Referenzen über ein Archiv verteilen"
-msgid "Provide content or type and size information for repository objects"
-msgstr ""
-"Inhalt oder Informationen zu Typ und Größe für Repository-Objekte "
-"bereitstellen"
+msgid "Provide contents or details of repository objects"
+msgstr "Bereitstellung von Inhalten oder Details von Repository-Objekten"
msgid "Display gitattributes information"
msgstr "gitattributes Informationen darstellen"
@@ -13709,6 +14383,9 @@ msgstr ""
"einem Objekt einen für Menschen lesbaren Namen basierend auf\n"
"einer verfügbaren Referenz geben"
+msgid "Generate a zip archive of diagnostic information"
+msgstr "Erzeugen eines Zip-Archivs mit Diagnoseinformationen"
+
msgid "Show changes between commits, commit and working tree, etc"
msgstr ""
"Änderungen zwischen Commits, Commit und Arbeitsverzeichnis, etc. anzeigen"
@@ -13770,9 +14447,10 @@ msgstr "Zeilen darstellen, die einem Muster entsprechen"
msgid "A portable graphical interface to Git"
msgstr "eine portable grafische Schnittstelle zu Git"
-msgid "Compute object ID and optionally creates a blob from a file"
+msgid "Compute object ID and optionally create an object from a file"
msgstr ""
-"von einer Datei die Objekt-ID berechnen und optional ein Blob erstellen"
+"Berechnung der Objekt-ID und optionales Erstellen eines Objekts aus einer "
+"Datei"
msgid "Display help information about Git"
msgstr "Hilfsinformationen über Git anzeigen"
@@ -13846,8 +14524,8 @@ msgstr "einen Merge für zusammenzuführende Dateien ausführen"
msgid "The standard helper program to use with git-merge-index"
msgstr "das Standard-Hilfsprogramm für die Verwendung mit git-merge-index"
-msgid "Show three-way merge without touching index"
-msgstr "3-Wege-Merge anzeigen ohne den Index zu verändern"
+msgid "Perform merge without touching index or working tree"
+msgstr "Merge ohne Berührung von Index oder Arbeitsverzeichnis durchführen"
msgid "Run merge conflict resolution tools to resolve merge conflicts"
msgstr ""
@@ -13930,6 +14608,11 @@ msgstr "ungepackte Objekte in einem Repository packen"
msgid "Create, list, delete refs to replace objects"
msgstr "Referenzen für ersetzende Objekte erstellen, auflisten, löschen"
+msgid "EXPERIMENTAL: Replay commits on a new base, works with bare repos too"
+msgstr ""
+"EXPERIMENTELL: Commits auf neuer Basis abspielen, funktioniert auch mit Bare-"
+"Repositories"
+
msgid "Generates a summary of pending changes"
msgstr "eine Übersicht über ausstehende Änderungen generieren"
@@ -14053,8 +14736,11 @@ msgstr "gepackte Git-Archivdateien validieren"
msgid "Check the GPG signature of tags"
msgstr "die GPG-Signatur von Tags prüfen"
-msgid "Show logs with difference each commit introduces"
-msgstr "Logs mit dem Unterschied, den jeder Commit einführt, anzeigen"
+msgid "Display version information about Git"
+msgstr "Versionsinformationen über Git anzeigen"
+
+msgid "Show logs with differences each commit introduces"
+msgstr "Logs mit den Unterschieden anzeigen, den jeder Commit einführt"
msgid "Manage multiple working trees"
msgstr "mehrere Arbeitsverzeichnisse verwalten"
@@ -14087,6 +14773,24 @@ msgstr ""
msgid "Frequently asked questions about using Git"
msgstr "Häufig gestellte Fragen über die Nutzung von Git"
+msgid "The bundle file format"
+msgstr "Das Bundle-Dateiformat"
+
+msgid "Chunk-based file formats"
+msgstr "Chunk-basierte Dateiformate"
+
+msgid "Git commit-graph format"
+msgstr "Git Commit-Graph Format"
+
+msgid "Git index format"
+msgstr "Git-Index-Format"
+
+msgid "Git pack format"
+msgstr "Git-Pack-Format"
+
+msgid "Git cryptographic signature formats"
+msgstr "Git kryptographische Signaturformate"
+
msgid "A Git Glossary"
msgstr "ein Git-Glossar"
@@ -14108,6 +14812,21 @@ msgstr "Definition von Submodul-Eigenschaften"
msgid "Git namespaces"
msgstr "Git Namensbereiche"
+msgid "Protocol v0 and v1 capabilities"
+msgstr "Fähigkeiten des Protokolls v0 und v1"
+
+msgid "Things common to various protocols"
+msgstr "Gemeinsamkeiten zwischen verschiedenen Protokollen"
+
+msgid "Git HTTP-based protocols"
+msgstr "Git HTTP-basierte Protokolle"
+
+msgid "How packs are transferred over-the-wire"
+msgstr "Wie Pakete über die Leitung übertragen werden"
+
+msgid "Git Wire Protocol, Version 2"
+msgstr "Git Wire Protokoll, Version 2"
+
msgid "Helper programs to interact with remote repositories"
msgstr "Hilfsprogramme zur Interaktion mit Remote-Repositories"
@@ -14132,9 +14851,38 @@ msgstr "Git Web Interface (Web-Frontend für Git-Repositories)"
msgid "An overview of recommended workflows with Git"
msgstr "Eine Übersicht über empfohlene Arbeitsabläufe mit Git"
+msgid "A tool for managing large Git repositories"
+msgstr "Ein Werkzeug zur Verwaltung großer Git-Repositories"
+
msgid "commit-graph file is too small"
msgstr "Commit-Graph-Datei ist zu klein"
+msgid "commit-graph oid fanout chunk is wrong size"
+msgstr "Commit-Graph OID fanout Chunk hat die falsche Größe"
+
+msgid "commit-graph fanout values out of order"
+msgstr "Commit-Graph fanout-Werte sind nicht in Ordnung"
+
+msgid "commit-graph OID lookup chunk is the wrong size"
+msgstr "Commit-Graph OID Lookup Chunk hat die falsche Größe"
+
+msgid "commit-graph commit data chunk is wrong size"
+msgstr "Commit-Graph Commit Daten Chunk hat die falsche Größe"
+
+msgid "commit-graph generations chunk is wrong size"
+msgstr "Commit-Graph Generations Chunk hat die falsche Größe"
+
+msgid "commit-graph changed-path index chunk is too small"
+msgstr "Commit-Graph changed-path Index Chunk ist zu klein"
+
+#, c-format
+msgid ""
+"ignoring too-small changed-path chunk (%<PRIuMAX> < %<PRIuMAX>) in commit-"
+"graph file"
+msgstr ""
+"ignoriere zu kleinen Chunk für geänderte Pfade (%<PRIuMAX> < %<PRIuMAX>) in "
+"Commit-Graph-Datei"
+
#, c-format
msgid "commit-graph signature %X does not match signature %X"
msgstr "Commit-Graph-Signatur %X stimmt nicht mit Signatur %X überein"
@@ -14151,13 +14899,33 @@ msgstr "Hash-Version des Commit-Graph %X stimmt nicht mit Version %X überein"
msgid "commit-graph file is too small to hold %u chunks"
msgstr "Commit-Graph-Datei ist zu klein, um %u Chunks zu enthalten"
+msgid "commit-graph required OID fanout chunk missing or corrupted"
+msgstr "Commit-Graph benötigter OID fanout Chunk fehlt oder ist beschädigt"
+
+msgid "commit-graph required OID lookup chunk missing or corrupted"
+msgstr "Commit-Graph benötigter OID lookup Chunk fehlt oder ist beschädigt"
+
+msgid "commit-graph required commit data chunk missing or corrupted"
+msgstr ""
+"Commit-Graph erforderlicher Commit-Daten Chunk fehlt oder ist beschädigt"
+
msgid "commit-graph has no base graphs chunk"
msgstr "Commit-Graph hat keinen Basis-Graph-Chunk"
+msgid "commit-graph base graphs chunk is too small"
+msgstr "Commit-Graph Basis-Graph-Chunk ist zu klein"
+
msgid "commit-graph chain does not match"
msgstr "Commit-Graph Verkettung stimmt nicht überein"
#, c-format
+msgid "commit count in base graph too high: %<PRIuMAX>"
+msgstr "Anzahl der Commits im Basisgraph zu hoch: %<PRIuMAX>"
+
+msgid "commit-graph chain file too small"
+msgstr "Commit-Graph Chain-Datei zu klein"
+
+#, c-format
msgid "invalid commit-graph chain: line '%s' not a hash"
msgstr "Ungültige Commit-Graph Verkettung: Zeile '%s' ist kein Hash"
@@ -14174,6 +14942,12 @@ msgstr "konnte Commit %s nicht finden"
msgid "commit-graph requires overflow generation data but has none"
msgstr "Commit-Graph erfordert Ãœberlaufgenerierungsdaten, aber hat keine"
+msgid "commit-graph overflow generation data is too small"
+msgstr "Commit-Graph Ãœberlaufgenerierungsdaten sind zu klein"
+
+msgid "commit-graph extra-edges pointer out of bounds"
+msgstr "commit-graph extra-edges Zeiger außerhalb der Grenzen"
+
msgid "Loading known commits in commit graph"
msgstr "Lade bekannte Commits in Commit-Graph"
@@ -14240,6 +15014,17 @@ msgstr "konnte Basis-Commit-Graph-Datei nicht umbenennen"
msgid "failed to rename temporary commit-graph file"
msgstr "konnte temporäre Commit-Graph-Datei nicht umbenennen"
+#, c-format
+msgid "cannot merge graphs with %<PRIuMAX>, %<PRIuMAX> commits"
+msgstr ""
+"Graphen mit %<PRIuMAX>, %<PRIuMAX> Commits können nicht zusammengeführt "
+"werden"
+
+#, c-format
+msgid "cannot merge graph %s, too many commits: %<PRIuMAX>"
+msgstr ""
+"Graph %s kann nicht zusammengeführt werden, zu viele Commits: %<PRIuMAX>"
+
msgid "Scanning merged commits"
msgstr "Durchsuche zusammengeführte Commits"
@@ -14271,9 +15056,6 @@ msgstr "Commit-Graph hat fehlerhaften Fanout-Wert: fanout[%d] = %u != %u"
msgid "failed to parse commit %s from commit-graph"
msgstr "konnte Commit %s von Commit-Graph nicht parsen"
-msgid "Verifying commits in commit graph"
-msgstr "Commit in Commit-Graph überprüfen"
-
#, c-format
msgid "failed to parse commit %s from object database for commit-graph"
msgstr ""
@@ -14297,20 +15079,6 @@ msgid "commit-graph parent list for commit %s terminates early"
msgstr "Commit-Graph Vorgänger-Liste für Commit %s endet zu früh"
#, c-format
-msgid ""
-"commit-graph has generation number zero for commit %s, but non-zero elsewhere"
-msgstr ""
-"Commit-Graph hat Generationsnummer null für Commit %s, aber sonst ungleich "
-"null"
-
-#, c-format
-msgid ""
-"commit-graph has non-zero generation number for commit %s, but zero elsewhere"
-msgstr ""
-"Commit-Graph hat Generationsnummer ungleich null für Commit %s, aber sonst "
-"null"
-
-#, c-format
msgid "commit-graph generation for commit %s is %<PRIuMAX> < %<PRIuMAX>"
msgstr "Commit-Graph Erstellung für Commit %s ist %<PRIuMAX> < %<PRIuMAX>"
@@ -14320,6 +15088,17 @@ msgstr ""
"Commit-Datum für Commit %s in Commit-Graph ist %<PRIuMAX> != %<PRIuMAX>"
#, c-format
+msgid ""
+"commit-graph has both zero and non-zero generations (e.g., commits '%s' and "
+"'%s')"
+msgstr ""
+"Commit-Graph hat sowohl Null- als auch Nicht-Null-Generationen (z. B. "
+"Commits '%s' und '%s')"
+
+msgid "Verifying commits in commit graph"
+msgstr "Commit in Commit-Graph überprüfen"
+
+#, c-format
msgid "%s %s is not a commit!"
msgstr "%s %s ist kein Commit!"
@@ -14344,6 +15123,11 @@ msgstr ""
"\"git config advice.graftFileDeprecated false\" ausführen."
#, c-format
+msgid "commit %s exists in commit-graph but not in the object database"
+msgstr ""
+"Commit %s existiert im Commit-Graphen, aber nicht in der Objektdatenbank"
+
+#, c-format
msgid "Commit %s has an untrusted GPG signature, allegedly by %s."
msgstr ""
"Commit %s hat eine nicht vertrauenswürdige GPG-Signatur, angeblich von %s."
@@ -14378,6 +15162,14 @@ msgid "no libc information available\n"
msgstr "keine libc Informationen verfügbar\n"
#, c-format
+msgid "could not determine free disk size for '%s'"
+msgstr "konnte freien Speicherplatz für '%s' nicht bestimmen"
+
+#, c-format
+msgid "could not get info for '%s'"
+msgstr "konnte keine Info für '%s' bekommen"
+
+#, c-format
msgid "[GLE %ld] health thread could not open '%ls'"
msgstr "[GLE %ld] health Thread konnte '%ls' nicht öffnen"
@@ -14401,6 +15193,10 @@ msgstr "unbehandelter Fall in 'has_worktree_moved': %d"
msgid "health thread wait failed [GLE %ld]"
msgstr "Warten des health Thread fehlgeschlagen [GLE %ld]"
+#, c-format
+msgid "Invalid path: %s"
+msgstr "Ungültiger Pfad: %s"
+
msgid "Unable to create FSEventStream."
msgstr "Konnte FSEventStream nicht erstellen."
@@ -14432,6 +15228,30 @@ msgid "could not read directory changes [GLE %ld]"
msgstr "konnte Verzeichnisveränderungen nicht lesen [GLE %ld]"
#, c-format
+msgid "opendir('%s') failed"
+msgstr "opendir('%s') fehlgeschlagen"
+
+#, c-format
+msgid "lstat('%s') failed"
+msgstr "lstat('%s') fehlgeschlagen"
+
+#, c-format
+msgid "strbuf_readlink('%s') failed"
+msgstr "strbuf_readlink('%s') fehlgeschlagen"
+
+#, c-format
+msgid "closedir('%s') failed"
+msgstr "closedir('%s') fehlgeschlagen"
+
+#, c-format
+msgid "[GLE %ld] unable to open for read '%ls'"
+msgstr "[GLE %ld] '%ls' kann nicht zum Lesen geöffnet werden"
+
+#, c-format
+msgid "[GLE %ld] unable to get protocol information for '%ls'"
+msgstr "[GLE %ld] kann keine Protokollinformationen für '%ls' erhalten"
+
+#, c-format
msgid "failed to copy SID (%ld)"
msgstr "Fehler beim Kopieren von SID (%ld)"
@@ -14717,8 +15537,8 @@ msgstr "Länge für Abkürzung von Commit-IDs außerhalb des Bereichs: %d"
msgid "bad zlib compression level %d"
msgstr "ungültiger zlib Komprimierungsgrad %d"
-msgid "core.commentChar should only be one character"
-msgstr "core.commentChar sollte nur ein Zeichen sein"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar sollte nur ein ASCII-Zeichen sein"
#, c-format
msgid "ignoring unknown core.fsyncMethod value '%s'"
@@ -14755,10 +15575,6 @@ msgstr "Referenz '%s' zeigt auf keinen Blob."
msgid "unable to resolve config blob '%s'"
msgstr "Konnte Blob '%s' für Konfiguration nicht auflösen."
-#, c-format
-msgid "failed to parse %s"
-msgstr "Fehler beim Parsen von %s."
-
msgid "unable to parse command-line config"
msgstr ""
"Konnte die über die Befehlszeile angegebene Konfiguration nicht parsen."
@@ -14836,6 +15652,11 @@ msgid "invalid section name: %s"
msgstr "Ungültiger Sektionsname: %s"
#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr ""
+"Ausführung mit übermäßig langer Zeile in '%s' bei Zeile %<PRIuMAX> verweigert"
+
+#, c-format
msgid "missing value for '%s'"
msgstr "Fehlender Wert für '%s'"
@@ -14893,15 +15714,22 @@ msgid "unknown object format '%s' specified by server"
msgstr "unbekanntes Objekt-Format '%s' vom Server angegeben"
#, c-format
+msgid "error on bundle-uri response line %d: %s"
+msgstr "Fehler in der bundle-uri-Antwortzeile %d: %s"
+
+msgid "expected flush after bundle-uri listing"
+msgstr "erwartete Flush nach Bundle-uri-Auflistung"
+
+msgid "expected response end packet after ref listing"
+msgstr "Antwort-Endpaket nach Auflistung der Referenzen erwartet"
+
+#, c-format
msgid "invalid ls-refs response: %s"
msgstr "ungültige ls-refs Antwort: %s"
msgid "expected flush after ref listing"
msgstr "Flush nach Auflistung der Referenzen erwartet"
-msgid "expected response end packet after ref listing"
-msgstr "Antwort-Endpaket nach Auflistung der Referenzen erwartet"
-
#, c-format
msgid "protocol '%s' is not supported"
msgstr "Protokoll '%s' wird nicht unterstützt"
@@ -14990,182 +15818,6 @@ msgid "failed to close rev-list's stdin"
msgstr "Fehler beim Schließen von rev-lists Standard-Eingabe"
#, c-format
-msgid "'%s' does not exist"
-msgstr "'%s' existiert nicht."
-
-msgid "need a working directory"
-msgstr "Arbeitsverzeichnis benötigt"
-
-msgid "could not find enlistment root"
-msgstr "konnte Root-Verzeichnis für Eintragungen nicht finden"
-
-#, c-format
-msgid "could not switch to '%s'"
-msgstr "konnte nicht zu '%s' wechseln"
-
-#, c-format
-msgid "could not configure %s=%s"
-msgstr "konnte %s=%s nicht konfigurieren"
-
-msgid "could not configure log.excludeDecoration"
-msgstr "konnte log.excludeDecoration nicht konfigurieren"
-
-msgid "Scalar enlistments require a worktree"
-msgstr "Skalare Eintragungen erfordern ein Arbeitsverzeichnis"
-
-#, c-format
-msgid "could not open directory '%s'"
-msgstr "konnte Verzeichnis '%s' nicht öffnen"
-
-#, c-format
-msgid "skipping '%s', which is neither file nor directory"
-msgstr "überspringe '%s', das weder Datei noch Verzeichnis ist"
-
-#, c-format
-msgid "could not determine free disk size for '%s'"
-msgstr "konnte freien Speicherplatz für '%s' nicht bestimmen"
-
-#, c-format
-msgid "could not get info for '%s'"
-msgstr "konnte keine Info für '%s' bekommen"
-
-#, c-format
-msgid "remote HEAD is not a branch: '%.*s'"
-msgstr "externer HEAD ist kein Branch: '%.*s'"
-
-msgid "failed to get default branch name from remote; using local default"
-msgstr ""
-"Fehler beim Abfragen des Standard-Branchnamens vom Remote-Repository; nutze "
-"lokalen Standardwert"
-
-msgid "failed to get default branch name"
-msgstr "Fehler beim Abfragen des Standard-Branchnamens"
-
-msgid "failed to unregister repository"
-msgstr "Fehler beim Austragen des Repositories"
-
-msgid "failed to delete enlistment directory"
-msgstr "Fehler beim Löschen des Eintragungs-Verzeichnisses"
-
-msgid "branch to checkout after clone"
-msgstr "Branch, der nach dem Klonen ausgecheckt werden soll"
-
-msgid "when cloning, create full working directory"
-msgstr "vollständiges Arbeitsverzeichnis beim Klonen erstellen"
-
-msgid "only download metadata for the branch that will be checked out"
-msgstr "lade nur Metadaten des Branches herunter, der ausgecheckt wird"
-
-msgid "scalar clone [<options>] [--] <repo> [<dir>]"
-msgstr "scalar clone [<Optionen>] [--] <Repository> [<Verzeichnis>]"
-
-#, c-format
-msgid "cannot deduce worktree name from '%s'"
-msgstr "konnte Name für Arbeitsverzeichnis nicht von '%s' ableiten"
-
-#, c-format
-msgid "directory '%s' exists already"
-msgstr "Verzeichnis '%s' existiert bereits"
-
-#, c-format
-msgid "failed to get default branch for '%s'"
-msgstr "Fehler beim Abfragen des Default-Branches für '%s'"
-
-#, c-format
-msgid "could not configure remote in '%s'"
-msgstr "konnte Remote-Repository in '%s' nicht konfigurieren"
-
-#, c-format
-msgid "could not configure '%s'"
-msgstr "konnte '%s' nicht konfigurieren"
-
-msgid "partial clone failed; attempting full clone"
-msgstr "partielles Klonen fehlgeschlagen; versuche vollständiges Klonen"
-
-msgid "could not configure for full clone"
-msgstr "konnte nicht für vollständiges Klonen konfigurieren"
-
-msgid "scalar diagnose [<enlistment>]"
-msgstr "scalar diagnose [<Eintragung>]"
-
-#, c-format
-msgid "could not create directory for '%s'"
-msgstr "konnte Verzeichnis für '%s' nicht erstellen"
-
-msgid "could not duplicate stdout"
-msgstr "konnte Standard-Ausgabe nicht duplizieren"
-
-msgid "failed to write archive"
-msgstr "Schreiben des Archivs fehlgeschlagen"
-
-msgid "`scalar list` does not take arguments"
-msgstr "`scalar list` akzeptiert keine Argumente"
-
-msgid "scalar register [<enlistment>]"
-msgstr "scalar register [<Eintragung>]"
-
-msgid "reconfigure all registered enlistments"
-msgstr "alle registrierten Eintragungen neu konfigurieren"
-
-msgid "scalar reconfigure [--all | <enlistment>]"
-msgstr "scalar reconfigure [--all | <Eintragung>]"
-
-msgid "--all or <enlistment>, but not both"
-msgstr "--all oder <Eintragung>, aber nicht beides"
-
-#, c-format
-msgid "git repository gone in '%s'"
-msgstr "Git-Repository entfernt in '%s'"
-
-msgid ""
-"scalar run <task> [<enlistment>]\n"
-"Tasks:\n"
-msgstr ""
-"scalar run <Aufgabe> [<Eintragung>]\n"
-"Aufgaben:\n"
-
-#, c-format
-msgid "no such task: '%s'"
-msgstr "Aufgabe nicht gefunden: '%s'"
-
-msgid "scalar unregister [<enlistment>]"
-msgstr "scalar unregister [<Eintragung>]"
-
-msgid "scalar delete <enlistment>"
-msgstr "scalar delete <Eintragung>"
-
-msgid "refusing to delete current working directory"
-msgstr "Löschen des aktuellen Arbeitsverzeichnisses wurde verweigert"
-
-msgid "include Git version"
-msgstr "Git-Version einbeziehen"
-
-msgid "include Git's build options"
-msgstr "Build-Optionen von Git einbeziehen"
-
-msgid "scalar verbose [-v | --verbose] [--build-options]"
-msgstr "scalar verbose [-v | --verbose] [--build-options]"
-
-msgid "-C requires a <directory>"
-msgstr "-C erfordert ein <Verzeichnis>"
-
-#, c-format
-msgid "could not change to '%s'"
-msgstr "konnte nicht zu '%s' wechseln"
-
-msgid "-c requires a <key>=<value> argument"
-msgstr "-c benötigt ein <Schlüssel>=<Wert> Argument"
-
-msgid ""
-"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
-"\n"
-"Commands:\n"
-msgstr ""
-"scalar [-C <Verzeichnis>] [-c <Schlüssel>=<Wert>] <Befehl> [<Optionen>]\n"
-"\n"
-"Befehle:\n"
-
-#, c-format
msgid "illegal crlf_action %d"
msgstr "Unerlaubte crlf_action %d"
@@ -15373,12 +16025,35 @@ msgstr ""
msgid "Marked %d islands, done.\n"
msgstr "%d Delta-Islands markiert, fertig.\n"
+#, c-format
+msgid "invalid --%s value '%s'"
+msgstr "ungültiger --%s Wert '%s'"
+
+#, c-format
+msgid "could not archive missing directory '%s'"
+msgstr "fehlendes Verzeichnis '%s' konnte nicht archiviert werden"
+
+#, c-format
+msgid "could not open directory '%s'"
+msgstr "konnte Verzeichnis '%s' nicht öffnen"
+
+#, c-format
+msgid "skipping '%s', which is neither file nor directory"
+msgstr "überspringe '%s', das weder Datei noch Verzeichnis ist"
+
+msgid "could not duplicate stdout"
+msgstr "konnte Standard-Ausgabe nicht duplizieren"
+
+#, c-format
+msgid "could not add directory '%s' to archiver"
+msgstr "konnte das Verzeichnis '%s' nicht zum Archivierungssystem hinzufügen"
+
+msgid "failed to write archive"
+msgstr "Schreiben des Archivs fehlgeschlagen"
+
msgid "--merge-base does not work with ranges"
msgstr "--merge-base funktioniert nicht mit Bereichen"
-msgid "--merge-base only works with commits"
-msgstr "--merge-base funktioniert nur mit Commits"
-
msgid "unable to get HEAD"
msgstr "konnte HEAD nicht bekommen"
@@ -15388,6 +16063,12 @@ msgstr "keine Merge-Basis gefunden"
msgid "multiple merge bases found"
msgstr "mehrere Merge-Basen gefunden"
+msgid "cannot compare stdin to a directory"
+msgstr "kann stdin nicht mit einem Verzeichnis vergleichen"
+
+msgid "cannot compare a named pipe to a directory"
+msgstr "kann eine benannte Pipe nicht mit einem Verzeichnis vergleichen"
+
msgid "git diff --no-index [<options>] <path> <path>"
msgstr "git diff --no-index [<Optionen>] <Pfad> <Pfad>"
@@ -15434,6 +16115,10 @@ msgid "Unknown value for 'diff.submodule' config variable: '%s'"
msgstr "Unbekannter Wert in Konfigurationsvariable 'diff.submodule': '%s'"
#, c-format
+msgid "unknown value for config '%s': %s"
+msgstr "Unbekannter Wert für Konfiguration '%s': %s"
+
+#, c-format
msgid ""
"Found errors in 'diff.dirstat' config variable:\n"
"%s"
@@ -15445,6 +16130,13 @@ msgstr ""
msgid "external diff died, stopping at %s"
msgstr "externes Diff-Programm unerwartet beendet, angehalten bei %s"
+msgid "--follow requires exactly one pathspec"
+msgstr "--follow erfordert genau eine Pfadspezifikation"
+
+#, c-format
+msgid "pathspec magic not supported by --follow: %s"
+msgstr "Magie von Pfadspezifikationen wird von --follow nicht unterstützt: %s"
+
#, c-format
msgid "options '%s', '%s', '%s', and '%s' cannot be used together"
msgstr ""
@@ -15464,9 +16156,6 @@ msgstr ""
"die Optionen '%s' und '%s' können nicht gemeinsam verwendet werden, nutzen "
"Sie '%s' mit '%s' und '%s'"
-msgid "--follow requires exactly one pathspec"
-msgstr "--follow erfordert genau eine Pfadspezifikation"
-
#, c-format
msgid "invalid --stat value: %s"
msgstr "Ungültiger --stat Wert: %s"
@@ -15511,13 +16200,6 @@ msgstr "ungültiges --color-moved Argument: %s"
msgid "invalid mode '%s' in --color-moved-ws"
msgstr "ungültiger Modus '%s' in --color-moved-ws"
-msgid ""
-"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
-"\"histogram\""
-msgstr ""
-"Option diff-algorithm akzeptiert: \"myers\", \"minimal\", \"patience\" and "
-"\"histogram\""
-
#, c-format
msgid "invalid argument to %s"
msgstr "ungültiges Argument für %s"
@@ -15561,8 +16243,8 @@ msgstr "maschinenlesbare Ausgabe von --stat"
msgid "output only the last line of --stat"
msgstr "nur die letzte Zeile von --stat ausgeben"
-msgid "<param1,param2>..."
-msgstr "<Parameter1,Parameter2>..."
+msgid "<param1>,<param2>..."
+msgstr "<Parameter1>,<Parameter2>..."
msgid ""
"output the distribution of relative amount of changes for each sub-directory"
@@ -15573,8 +16255,8 @@ msgstr ""
msgid "synonym for --dirstat=cumulative"
msgstr "Synonym für --dirstat=cumulative"
-msgid "synonym for --dirstat=files,param1,param2..."
-msgstr "Synonym für --dirstat=files,Parameter1,Parameter2..."
+msgid "synonym for --dirstat=files,<param1>,<param2>..."
+msgstr "Synonym für --dirstat=files,<Parameter1>,<Parameter2>..."
msgid "warn if changes introduce conflict markers or whitespace errors"
msgstr ""
@@ -15659,6 +16341,9 @@ msgstr "einen zusätzlichen Präfix bei jeder Ausgabezeile voranstellen"
msgid "do not show any source or destination prefix"
msgstr "keine Quell- oder Ziel-Präfixe anzeigen"
+msgid "use default prefixes a/ and b/"
+msgstr "Standardpräfixe a/ und b/ verwenden"
+
msgid "show context between diff hunks up to the specified number of lines"
msgstr ""
"Kontext zwischen Unterschied-Blöcken bis zur angegebenen Anzahl von Zeilen "
@@ -15754,12 +16439,6 @@ msgstr "Änderungen durch Nutzung des Algorithmus \"Patience Diff\" erzeugen"
msgid "generate diff using the \"histogram diff\" algorithm"
msgstr "Änderungen durch Nutzung des Algorithmus \"Histogram Diff\" erzeugen"
-msgid "<algorithm>"
-msgstr "<Algorithmus>"
-
-msgid "choose a diff algorithm"
-msgstr "einen Algorithmus für Änderungen wählen"
-
msgid "<text>"
msgstr "<Text>"
@@ -15973,6 +16652,14 @@ msgstr "Konnte Git-Verzeichnis nicht von '%s' nach '%s' migrieren"
msgid "hint: Waiting for your editor to close the file...%c"
msgstr "Hinweis: Warte auf das Schließen der Datei durch Ihren Editor...%c"
+#, c-format
+msgid "could not write to '%s'"
+msgstr "Konnte nicht nach '%s' schreiben."
+
+#, c-format
+msgid "could not edit '%s'"
+msgstr "Konnte '%s' nicht editieren."
+
msgid "Filtering content"
msgstr "Filtere Inhalt"
@@ -16004,6 +16691,9 @@ msgstr "git fetch-pack: ACK/NAK erwartet, '%s' bekommen"
msgid "unable to write to remote"
msgstr "konnte nicht zum Remote schreiben"
+msgid "Server supports filter"
+msgstr "Server unterstützt Filter"
+
#, c-format
msgid "invalid shallow line: %s"
msgstr "ungültige shallow-Zeile: %s"
@@ -16114,9 +16804,6 @@ msgstr "der Server unterstützt Algorithmus '%s' nicht"
msgid "Server does not support shallow requests"
msgstr "Server unterstützt keine shallow-Anfragen"
-msgid "Server supports filter"
-msgstr "Server unterstützt Filter"
-
msgid "unable to write request to remote"
msgstr "konnte Anfrage nicht zum Remote schreiben"
@@ -16216,9 +16903,11 @@ msgstr "virtuelles Repository '%s' ist inkompatibel mit fsmonitor"
#, c-format
msgid ""
-"repository '%s' is incompatible with fsmonitor due to lack of Unix sockets"
+"socket directory '%s' is incompatible with fsmonitor due to lack of Unix "
+"sockets support"
msgstr ""
-"Repository '%s' is inkompatibel mit fsmonitor wegen fehlender Unix sockets"
+"Socket-Verzeichnis '%s' ist mit fsmonitor inkompatibel, da es keine Unix-"
+"Sockets unterstützt"
msgid ""
"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
@@ -16226,16 +16915,14 @@ msgid ""
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
-" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
-" <command> [<args>]"
+" [--config-env=<name>=<envvar>] <command> [<args>]"
msgstr ""
"git [-v | --version] [-h | --help] [-C <Pfad>] [-c <Name>=<Wert>]\n"
" [--exec-path[=<Pfad>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<Pfad>] [--work-tree=<Pfad>] [--namespace=<Name>]\n"
-" [--super-prefix=<Pfad>] [--config-env=<Name>=<Variable>]\n"
-" <Befehl> [<Argumente>]"
+" [--config-env=<Name>=<Umgebungsvariable>] <Befehl> [<Argumente>]"
msgid ""
"'git help -a' and 'git help -g' list available subcommands and some\n"
@@ -16262,10 +16949,6 @@ msgid "no namespace given for --namespace\n"
msgstr "Kein Namespace für --namespace angegeben.\n"
#, c-format
-msgid "no prefix given for --super-prefix\n"
-msgstr "Kein Präfix für --super-prefix angegeben.\n"
-
-#, c-format
msgid "-c expects a configuration string\n"
msgstr "-c erwartet einen Konfigurationsstring.\n"
@@ -16274,6 +16957,10 @@ msgid "no config key given for --config-env\n"
msgstr "kein Konfigurationsschlüssel für --config-env angegeben\n"
#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "keine Attributquelle für --attr-source angegeben\n"
+
+#, c-format
msgid "unknown option: %s\n"
msgstr "Unbekannte Option: %s\n"
@@ -16379,8 +17066,13 @@ msgstr ""
msgid "gpg.ssh.defaultKeyCommand failed: %s %s"
msgstr "gpg.ssh.defaultKeyCommand fehlgeschlagen: %s %s"
-msgid "gpg failed to sign the data"
-msgstr "gpg beim Signieren der Daten fehlgeschlagen"
+#, c-format
+msgid ""
+"gpg failed to sign the data:\n"
+"%s"
+msgstr ""
+"gpg konnte die Daten nicht signieren:\n"
+"%s"
msgid "user.signingKey needs to be set for ssh signing"
msgstr "user.signingKey muss für die SSH-Signatur gesetzt sein"
@@ -16462,6 +17154,12 @@ msgstr "Systembefehle / Repositories synchronisieren"
msgid "Low-level Commands / Internal Helpers"
msgstr "Systembefehle / Interne Hilfsbefehle"
+msgid "User-facing repository, command and file interfaces"
+msgstr "Benutzerseitige Repository-, Befehls- und Dateischnittstellen"
+
+msgid "Developer-facing file formats, protocols and other interfaces"
+msgstr "Dateiformate, Protokolle und andere Schnittstellen für Entwickler"
+
#, c-format
msgid "available git commands in '%s'"
msgstr "Vorhandene Git-Befehle in '%s'"
@@ -16475,6 +17173,12 @@ msgstr "Allgemeine Git-Befehle, verwendet in verschiedenen Situationen:"
msgid "The Git concept guides are:"
msgstr "Die Git-Konzeptanleitungen sind:"
+msgid "User-facing repository, command and file interfaces:"
+msgstr "Benutzerseitige Repository-, Befehls- und Dateischnittstellen:"
+
+msgid "File formats, protocols and other developer interfaces:"
+msgstr "Dateiformate, Protokolle und andere Entwicklerschnittstellen:"
+
msgid "External commands"
msgstr "Externe Befehle"
@@ -16531,8 +17235,8 @@ msgstr[1] ""
"\n"
"Die ähnlichsten Befehle sind"
-msgid "git version [<options>]"
-msgstr "git version [<Optionen>]"
+msgid "git version [--build-options]"
+msgstr "git version [--build-options]"
#, c-format
msgid "%s: %s - %s"
@@ -16561,10 +17265,6 @@ msgstr ""
"deaktivieren."
#, c-format
-msgid "Couldn't start hook '%s'\n"
-msgstr "Konnte Hook '%s' nicht starten\n"
-
-#, c-format
msgid "argument to --packfile must be a valid hash (got '%s')"
msgstr "Argument für --packfile muss ein gültiger Hash sein ('%s' erhalten)"
@@ -16752,19 +17452,14 @@ msgid "quoted CRLF detected"
msgstr "angeführtes CRLF entdeckt"
#, c-format
-msgid ""
-"Your local changes to the following files would be overwritten by merge:\n"
-" %s"
-msgstr ""
-"Ihre lokalen Änderungen in den folgenden Dateien würden durch den Merge\n"
-"überschrieben werden:\n"
-" %s"
-
-#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "Fehler beim Merge von Submodul %s (nicht ausgecheckt)."
#, c-format
+msgid "Failed to merge submodule %s (no merge base)"
+msgstr "Merge von Submodul %s fehlgeschlagen (keine Merge-Basis)"
+
+#, c-format
msgid "Failed to merge submodule %s (commits not present)"
msgstr "Fehler beim Merge von Submodul %s (Commits nicht vorhanden)."
@@ -16782,28 +17477,10 @@ msgstr "Fehler beim Zusammenführen von Submodul %s"
#, c-format
msgid ""
-"Failed to merge submodule %s, but a possible merge resolution exists:\n"
-"%s\n"
+"Failed to merge submodule %s, but a possible merge resolution exists: %s"
msgstr ""
-"Fehler beim Zusammenführen von Submodul %s, aber es ist eine mögliche "
-"Auflösung des Merges vorhanden:\n"
-"%s\n"
-
-#, c-format
-msgid ""
-"If this is correct simply add it to the index for example\n"
-"by using:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"which will accept this suggestion.\n"
-msgstr ""
-"Falls das korrekt ist, fügen Sie es einfach der Staging-Area, zum Beispiel "
-"mit:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"hinzu, um diesen Vorschlag zu akzeptieren.\n"
+"Der Merge von Submodul %s ist fehlgeschlagen, aber es gibt eine mögliche "
+"Auflösung des Merges: %s"
#, c-format
msgid ""
@@ -16814,12 +17491,12 @@ msgstr ""
"sind vorhanden:\n"
"%s"
-msgid "Failed to execute internal merge"
+msgid "failed to execute internal merge"
msgstr "Fehler bei Ausführung des internen Merges"
#, c-format
-msgid "Unable to add %s to database"
-msgstr "Konnte %s nicht zur Datenbank hinzufügen"
+msgid "unable to add %s to database"
+msgstr "konnte %s nicht zur Datenbank hinzufügen"
#, c-format
msgid "Auto-merging %s"
@@ -16971,13 +17648,46 @@ msgstr ""
"KONFLIKT (ändern/löschen): %s gelöscht in %s und geändert in %s. Stand %s "
"von %s wurde im Arbeitsbereich gelassen."
+#. TRANSLATORS: This is a line of advice to resolve a merge
+#. conflict in a submodule. The first argument is the submodule
+#. name, and the second argument is the abbreviated id of the
+#. commit that needs to be merged. For example:
+#. - go to submodule (mysubmodule), and either merge commit abc1234"
+#.
+#, c-format
+msgid ""
+" - go to submodule (%s), and either merge commit %s\n"
+" or update to an existing commit which has merged those changes\n"
+msgstr ""
+" - gehen Sie zu Submodul (%s) und mergen Sie entweder Commit %s\n"
+" oder aktualisieren Sie zu einem bestehenden Commit, der diese Änderungen "
+"zusammengeführt hat\n"
+
#, c-format
msgid ""
-"Note: %s not up to date and in way of checking out conflicted version; old "
-"copy renamed to %s"
+"Recursive merging with submodules currently only supports trivial cases.\n"
+"Please manually handle the merging of each conflicted submodule.\n"
+"This can be accomplished with the following steps:\n"
+"%s - come back to superproject and run:\n"
+"\n"
+" git add %s\n"
+"\n"
+" to record the above merge or update\n"
+" - resolve any other conflicts in the superproject\n"
+" - commit the resulting index in the superproject\n"
msgstr ""
-"Hinweis: %s nicht aktuell und konfliktbehaftete Version während des "
-"Auscheckens; alte Kopie zu %s umbenannt"
+"Das rekursive Zusammenführen mit Submodulen unterstützt derzeit nur triviale "
+"Fälle.\n"
+"Bitte führen Sie die Zusammenführung der einzelnen konfliktbehafteten "
+"Submodule manuell durch.\n"
+"Dies kann mit den folgenden Schritten erreicht werden:\n"
+"%s - zurück zum Hauptprojekt und dann ausführen:\n"
+"\n"
+" git add %s\n"
+"\n"
+" um die obige Zusammenführung oder Aktualisierung aufzuzeichnen\n"
+" - lösen Sie alle anderen Konflikte im Hauptprojekt\n"
+" - committen Sie den resultierenden Index in das Hauptprojekt\n"
#. TRANSLATORS: The %s arguments are: 1) tree hash of a merge
#. base, and 2-3) the trees for the two trees we're merging.
@@ -17053,6 +17763,22 @@ msgid "Found a possible merge resolution for the submodule:\n"
msgstr "Mögliche Auflösung des Merges für Submodul gefunden:\n"
#, c-format
+msgid ""
+"If this is correct simply add it to the index for example\n"
+"by using:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"which will accept this suggestion.\n"
+msgstr ""
+"Falls das korrekt ist, fügen Sie es einfach der Staging-Area, zum Beispiel "
+"mit:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"hinzu, um diesen Vorschlag zu akzeptieren.\n"
+
+#, c-format
msgid "Failed to merge submodule %s (multiple merges found)"
msgstr "Fehler beim Merge von Submodul %s (mehrere Merges gefunden)"
@@ -17228,6 +17954,19 @@ msgid "multi-pack-index OID fanout is of the wrong size"
msgstr "Multi-Pack-Index OID fanout hat die falsche Größe"
#, c-format
+msgid ""
+"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
+msgstr ""
+"Ungültige oid fanout Reihenfolge: fanout[%d] = %<PRIx32> > %<PRIx32> = "
+"fanout[%d]"
+
+msgid "multi-pack-index OID lookup chunk is the wrong size"
+msgstr "multi-pack-index OID-Lookup-Chunk hat die falsche Größe"
+
+msgid "multi-pack-index object offset chunk is the wrong size"
+msgstr "multi-pack-index Object-Offset-Chunk hat die falsche Größe"
+
+#, c-format
msgid "multi-pack-index file %s is too small"
msgstr "Multi-Pack-Index-Datei %s ist zu klein."
@@ -17244,17 +17983,24 @@ msgstr "Multi-Pack-Index-Version %d nicht erkannt."
msgid "multi-pack-index hash version %u does not match version %u"
msgstr "Multi-Pack-Index Hash-Version %u stimmt nicht mit Version %u überein"
-msgid "multi-pack-index missing required pack-name chunk"
-msgstr "Multi-Pack-Index fehlt erforderlicher Pack-Namen Chunk"
+msgid "multi-pack-index required pack-name chunk missing or corrupted"
+msgstr ""
+"multi-pack-index erforderlicher Pack-Name Chunk fehlt oder ist beschädigt"
-msgid "multi-pack-index missing required OID fanout chunk"
-msgstr "Multi-Pack-Index fehlt erforderlicher OID fanout Chunk"
+msgid "multi-pack-index required OID fanout chunk missing or corrupted"
+msgstr ""
+"multi-pack-index erforderlicher OID-Fanout-Chunk fehlt oder ist beschädigt"
-msgid "multi-pack-index missing required OID lookup chunk"
-msgstr "Multi-Pack-Index fehlt erforderlicher OID lookup Chunk"
+msgid "multi-pack-index required OID lookup chunk missing or corrupted"
+msgstr ""
+"multi-pack-index erforderlicher OID Lookup Chunk fehlt oder ist beschädigt"
-msgid "multi-pack-index missing required object offsets chunk"
-msgstr "Multi-Pack-Index fehlt erforderlicher Objekt offset Chunk"
+msgid "multi-pack-index required object offsets chunk missing or corrupted"
+msgstr ""
+"multi-pack-index benötigte Objekt Offsets Chunk fehlt oder ist beschädigt"
+
+msgid "multi-pack-index pack-name chunk is too short"
+msgstr "multi-pack-index Pack-Name Chunk ist zu klein"
#, c-format
msgid "multi-pack-index pack names out of order: '%s' before '%s'"
@@ -17264,10 +18010,20 @@ msgstr "Falsche Reihenfolge bei Multi-Pack-Index Pack-Namen: '%s' vor '%s'"
msgid "bad pack-int-id: %u (%u total packs)"
msgstr "Ungültige pack-int-id: %u (%u Pakete insgesamt)"
+msgid "MIDX does not contain the BTMP chunk"
+msgstr "MIDX enthält keinen BTMP-Chunk"
+
+#, c-format
+msgid "could not load bitmapped pack %<PRIu32>"
+msgstr "konnte Bitmap-Paket nicht laden %<PRIu32>"
+
msgid "multi-pack-index stores a 64-bit offset, but off_t is too small"
msgstr ""
"Multi-Pack-Index speichert einen 64-Bit Offset, aber off_t ist zu klein"
+msgid "multi-pack-index large offset out of bounds"
+msgstr "multi-pack-index großer Offset außerhalb der Grenzen"
+
#, c-format
msgid "failed to add packfile '%s'"
msgstr "Fehler beim Hinzufügen von Packdatei '%s'"
@@ -17346,13 +18102,6 @@ msgstr "Prüfsumme nicht korrekt"
msgid "Looking for referenced packfiles"
msgstr "Suche nach referenzierten Pack-Dateien"
-#, c-format
-msgid ""
-"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
-msgstr ""
-"Ungültige oid fanout Reihenfolge: fanout[%d] = %<PRIx32> > %<PRIx32> = "
-"fanout[%d]"
-
msgid "the midx contains no oid"
msgstr "das midx enthält keine oid"
@@ -17457,10 +18206,6 @@ msgstr "Konnte alternativen Objektpfad '%s' nicht normalisieren."
msgid "%s: ignoring alternate object stores, nesting too deep"
msgstr "%s: ignoriere alternative Objektspeicher - Verschachtelung zu tief"
-#, c-format
-msgid "unable to normalize object directory: %s"
-msgstr "Konnte Objektverzeichnis '%s' nicht normalisieren."
-
msgid "unable to fdopen alternates lockfile"
msgstr "Konnte fdopen nicht auf Lock-Datei für \"alternates\" aufrufen."
@@ -17524,6 +18269,10 @@ msgid "garbage at end of loose object '%s'"
msgstr "Nutzlose Daten am Ende von losem Objekt '%s'."
#, c-format
+msgid "unable to open loose object %s"
+msgstr "loses Objekt %s kann nicht geöffnet werden"
+
+#, c-format
msgid "unable to parse %s header"
msgstr "Konnte %s Kopfbereich nicht parsen."
@@ -17539,18 +18288,14 @@ msgid "header for %s too long, exceeds %d bytes"
msgstr "Header für %s zu lang, überschreitet %d Bytes"
#, c-format
-msgid "failed to read object %s"
-msgstr "Konnte Objekt %s nicht lesen."
+msgid "loose object %s (stored in %s) is corrupt"
+msgstr "Loses Objekt %s (gespeichert in %s) ist beschädigt."
#, c-format
msgid "replacement %s not found for %s"
msgstr "Ersetzung %s für %s nicht gefunden."
#, c-format
-msgid "loose object %s (stored in %s) is corrupt"
-msgstr "Loses Objekt %s (gespeichert in %s) ist beschädigt."
-
-#, c-format
msgid "packed object %s (stored in %s) is corrupt"
msgstr "Gepacktes Objekt %s (gespeichert in %s) ist beschädigt."
@@ -17562,9 +18307,6 @@ msgstr "Konnte Datei %s nicht schreiben."
msgid "unable to set permission to '%s'"
msgstr "Konnte Zugriffsberechtigung auf '%s' nicht setzen."
-msgid "file write error"
-msgstr "Fehler beim Schreiben einer Datei."
-
msgid "error when closing loose object file"
msgstr "Fehler beim Schließen der Datei für lose Objekte."
@@ -17593,14 +18335,31 @@ msgid "confused by unstable object source data for %s"
msgstr "Fehler wegen instabilen Objektquelldaten für %s"
#, c-format
+msgid "write stream object %ld != %<PRIuMAX>"
+msgstr "stream-Objekt schreiben %ld!= %<PRIuMAX>"
+
+#, c-format
+msgid "unable to stream deflate new object (%d)"
+msgstr "neues Objekt kann nicht aus Stream entpackt werden (%d)"
+
+#, c-format
+msgid "deflateEnd on stream object failed (%d)"
+msgstr "deflateEnd auf Stream-Objekt fehlgeschlagen (%d)"
+
+#, c-format
+msgid "unable to create directory %s"
+msgstr "Verzeichnis %s kann nicht erstellt werden"
+
+#, c-format
msgid "cannot read object for %s"
msgstr "Kann Objekt für %s nicht lesen."
-msgid "corrupt commit"
-msgstr "fehlerhafter Commit"
+#, c-format
+msgid "object fails fsck: %s"
+msgstr "fsck schlägt bei Objekt fehl: %s"
-msgid "corrupt tag"
-msgstr "fehlerhaftes Tag"
+msgid "refusing to create malformed object"
+msgstr "verweigere Erstellung eines ungültigen Objekts"
#, c-format
msgid "read error while indexing %s"
@@ -17657,7 +18416,7 @@ msgstr "%s [ungültiges Objekt]"
#. TRANSLATORS: This is a line of ambiguous commit
#. object output. E.g.:
#. *
-#. "deadbeef commit 2021-01-01 - Some Commit Message"
+#. "deadbeef commit 2021-01-01 - Some Commit Message"
#.
#, c-format
msgid "%s commit %s - %s"
@@ -17666,7 +18425,7 @@ msgstr "%s Commit %s - %s"
#. TRANSLATORS: This is a line of ambiguous
#. tag object output. E.g.:
#. *
-#. "deadbeef tag 2022-01-01 - Some Tag Message"
+#. "deadbeef tag 2022-01-01 - Some Tag Message"
#. *
#. The second argument is the YYYY-MM-DD found
#. in the tag.
@@ -17682,7 +18441,7 @@ msgstr "%s Tag %s - %s"
#. tag object output where we couldn't parse
#. the tag itself. E.g.:
#. *
-#. "deadbeef [bad tag, could not parse it]"
+#. "deadbeef [bad tag, could not parse it]"
#.
#, c-format
msgid "%s [bad tag, could not parse it]"
@@ -17823,6 +18582,54 @@ msgstr "Konnte Objekt '%s' nicht parsen."
msgid "hash mismatch %s"
msgstr "Hash stimmt nicht mit %s überein."
+msgid "trying to write commit not in index"
+msgstr "Versuch, einen Commit zu schreiben, der nicht im Index steht"
+
+msgid "failed to load bitmap index (corrupted?)"
+msgstr "bitmap-Index kann nicht geladen werden (beschädigt?)"
+
+msgid "corrupted bitmap index (too small)"
+msgstr "beschädigter Bitmap-Index (zu klein)"
+
+msgid "corrupted bitmap index file (wrong header)"
+msgstr "beschädigte Bitmap-Indexdatei (falscher Header)"
+
+#, c-format
+msgid "unsupported version '%d' for bitmap index file"
+msgstr "nicht unterstützte Version '%d' für Bitmap-Indexdatei"
+
+msgid "corrupted bitmap index file (too short to fit hash cache)"
+msgstr ""
+"beschädigte Bitmap-Indexdatei (zu kurz, um in den Hash-Cache zu passen)"
+
+msgid "corrupted bitmap index file (too short to fit lookup table)"
+msgstr ""
+"beschädigte Bitmap-Indexdatei (zu kurz, um in die Lookup-Tabelle zu passen)"
+
+#, c-format
+msgid "duplicate entry in bitmap index: '%s'"
+msgstr "duplizierter Eintrag im Bitmap-Index: '%s'"
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for entry %d"
+msgstr "fehlerhafte ewah-Bitmap: abgeschnittener Header für Eintrag %d"
+
+#, c-format
+msgid "corrupt ewah bitmap: commit index %u out of range"
+msgstr "fehlerhafte ewah-Bitmap: Commit-Index %u außerhalb des Bereichs"
+
+msgid "corrupted bitmap pack index"
+msgstr "beschädigter Bitmap-Pack-Index"
+
+msgid "invalid XOR offset in bitmap pack index"
+msgstr "ungültiger XOR-Offset im Bitmap-Pack-Index"
+
+msgid "cannot fstat bitmap file"
+msgstr "kann Bitmap-Datei nicht lesen"
+
+msgid "checksum doesn't match in MIDX and bitmap"
+msgstr "Prüfsumme stimmt in MIDX und Bitmap nicht überein"
+
msgid "multi-pack bitmap is missing required reverse index"
msgstr "Multi-Pack-Bitmap fehlt erforderlicher Reverse-Index"
@@ -17830,13 +18637,77 @@ 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"
+
+msgid "corrupt bitmap lookup table: xor chain exceeds entry count"
+msgstr ""
+"fehlerhafte Bitmap-Lookup-Tabelle: XOR-Kette überschreitet die Anzahl der "
+"Einträge"
+
#, c-format
-msgid "could not find %s in pack %s at offset %<PRIuMAX>"
-msgstr "konnte %s nicht in Paket %s bei Offset %<PRIuMAX> finden"
+msgid "corrupt bitmap lookup table: commit index %u out of range"
+msgstr ""
+"Bitmap-Lookup-Tabelle beschädigt: Commit-Index %u außerhalb des Bereichs"
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for bitmap of commit \"%s\""
+msgstr ""
+"fehlerhafte ewah-Bitmap: abgeschnittener Header für Bitmap des Commits \"%s\""
+
+#, c-format
+msgid "unable to load pack: '%s', disabling pack-reuse"
+msgstr ""
+"Paket kann nicht geladen werden: '%s', Deaktivierung der Paket-"
+"Wiederverwendung"
+
+#, c-format
+msgid "object '%s' not found in type bitmaps"
+msgstr "Objekt '%s' nicht im Typ Bitmaps gefunden"
+
+#, c-format
+msgid "object '%s' does not have a unique type"
+msgstr "das Objekt '%s' hat keinen eindeutigen Typ"
+
+#, c-format
+msgid "object '%s': real type '%s', expected: '%s'"
+msgstr "Objekt '%s': reeller Typ '%s', erwartet: '%s'"
+
+#, c-format
+msgid "object not in bitmap: '%s'"
+msgstr "Objekt nicht in Bitmap: '%s'"
+
+msgid "failed to load bitmap indexes"
+msgstr "Bitmap-Indizes konnten nicht geladen werden"
+
+msgid "you must specify exactly one commit to test"
+msgstr "Sie müssen genau einen Commit zum Testen angeben"
+
+#, c-format
+msgid "commit '%s' doesn't have an indexed bitmap"
+msgstr "Commit '%s' hat keine indizierte Bitmap"
+
+msgid "mismatch in bitmap results"
+msgstr "Unstimmigkeiten bei Bitmap-Ergebnissen"
+
+#, c-format
+msgid "could not find '%s' in pack '%s' at offset %<PRIuMAX>"
+msgstr "konnte '%s' in Paket '%s' bei Offset %<PRIuMAX> nicht finden"
+
+#, c-format
+msgid "unable to get disk usage of '%s'"
+msgstr "Festplattennutzung von '%s' kann nicht abgerufen werden"
+
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "Bitmap-Datei '%s' hat eine ungültige Prüfsumme"
#, c-format
msgid "mtimes file %s is too small"
@@ -17878,6 +18749,19 @@ msgstr "Reverse-Index-Datei %s hat nicht unterstützte Version %<PRIu32>"
msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
msgstr "Reverse-Index-Datei %s hat nicht unterstützte Hash-ID %<PRIu32>"
+msgid "invalid checksum"
+msgstr "ungültige Prüfsumme"
+
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr "ungültige rev-index Position bei %<PRIu64>: %<PRIu32> != %<PRIu32>"
+
+msgid "multi-pack-index reverse-index chunk is the wrong size"
+msgstr "multi-pack-index Reverse-Index Chunk hat die falsche Größe"
+
+msgid "could not determine preferred pack"
+msgstr "konnte das bevorzugte Paket nicht bestimmen"
+
msgid "cannot both write and verify reverse index"
msgstr ""
"Reverse-Index kann nicht gleichzeitig geschrieben und verifiziert werden"
@@ -17930,14 +18814,6 @@ msgid "%s requires a value"
msgstr "%s erfordert einen Wert."
#, c-format
-msgid "%s is incompatible with %s"
-msgstr "%s ist inkompatibel mit %s."
-
-#, c-format
-msgid "%s : incompatible with something else"
-msgstr "%s: inkompatibel mit etwas anderem"
-
-#, c-format
msgid "%s takes no value"
msgstr "%s erwartet keinen Wert"
@@ -17963,6 +18839,9 @@ msgstr "Meinten Sie `--%s` (mit zwei Strichen)?"
msgid "alias of --%s"
msgstr "Alias für --%s"
+msgid "need a subcommand"
+msgstr "benötige einen Unterbefehl"
+
#, c-format
msgid "unknown option `%s'"
msgstr "Unbekannte Option: `%s'"
@@ -18019,6 +18898,10 @@ msgstr " %s"
msgid "-NUM"
msgstr "-NUM"
+#, c-format
+msgid "opposite of --no-%s"
+msgstr "Gegenteil von --no-%s"
+
msgid "expiry-date"
msgstr "Verfallsdatum"
@@ -18034,6 +18917,9 @@ msgstr "weniger Ausgaben"
msgid "use <n> digits to display object names"
msgstr "benutze <Anzahl> Ziffern zur Anzeige von Objektnamen"
+msgid "prefixed path to initial superproject"
+msgstr "vorangestellter Pfad zum ursprünglichen Superprojekt"
+
msgid "how to strip spaces and #comments from message"
msgstr ""
"wie Leerzeichen und #Kommentare von der Beschreibung getrennt werden sollen"
@@ -18047,6 +18933,14 @@ msgstr ""
"Mit der Option --pathspec-from-file sind Pfade durch NUL-Zeichen getrennt"
#, c-format
+msgid "bad boolean environment value '%s' for '%s'"
+msgstr "falscher boolescher Wert von Umgebungsvariable '%s' für '%s'"
+
+#, c-format
+msgid "failed to parse %s"
+msgstr "Fehler beim Parsen von %s."
+
+#, c-format
msgid "Could not make %s writable by group"
msgstr "Konnte Gruppenschreibrecht für %s nicht setzen."
@@ -18095,6 +18989,10 @@ msgid "%s: 'literal' and 'glob' are incompatible"
msgstr "%s: 'literal' und 'glob' sind inkompatibel"
#, c-format
+msgid "'%s' is outside the directory tree"
+msgstr "'%s' liegt außerhalb des Verzeichnisbaums"
+
+#, c-format
msgid "%s: '%s' is outside repository at '%s'"
msgstr "%s: '%s' liegt außerhalb des Repositories von '%s'"
@@ -18184,6 +19082,10 @@ msgstr ""
msgid "promisor remote name cannot begin with '/': %s"
msgstr "Promisor-Remote-Name kann nicht mit '/' beginnen: %s"
+#, c-format
+msgid "could not fetch %s from promisor remote"
+msgstr "konnte %s nicht von Promisor-Remote abrufen"
+
msgid "object-info: expected flush after arguments"
msgstr "object-info: erwartete Flush nach Argumenten"
@@ -18220,6 +19122,13 @@ msgid "could not parse log for '%s'"
msgstr "Konnte Log für '%s' nicht parsen."
#, c-format
+msgid "invalid extra cruft tip: '%s'"
+msgstr "ungültiger zusätzlicher Schrotthinweis: '%s'"
+
+msgid "unable to enumerate additional recent objects"
+msgstr "zusätzliche neue Objekte konnten nicht aufgezählt werden"
+
+#, c-format
msgid "will not add file alias '%s' ('%s' already exists in index)"
msgstr ""
"Dateialias '%s' wird nicht hinzugefügt ('%s' existiert bereits im Index)."
@@ -18242,10 +19151,6 @@ msgid "unable to add '%s' to index"
msgstr "Konnte '%s' nicht dem Index hinzufügen."
#, c-format
-msgid "unable to stat '%s'"
-msgstr "konnte '%s' nicht lesen"
-
-#, c-format
msgid "'%s' appears as both a file and as a directory"
msgstr "'%s' scheint eine Datei und ein Verzeichnis zu sein"
@@ -18353,10 +19258,6 @@ msgid "failed to convert to a sparse-index"
msgstr "Konvertierung zu einem Sparse-Index fehlgeschlagen"
#, c-format
-msgid "could not stat '%s'"
-msgstr "Konnte '%s' nicht lesen."
-
-#, c-format
msgid "unable to open git dir: %s"
msgstr "konnte Git-Verzeichnis nicht öffnen: %s"
@@ -18372,6 +19273,14 @@ msgstr "Konnte Zugriffsberechtigung auf '%s' nicht setzen."
msgid "%s: cannot drop to stage #0"
msgstr "%s: Kann nicht auf Stufe #0 wechseln."
+#, c-format
+msgid "unexpected diff status %c"
+msgstr "unerwarteter Differenz-Status %c"
+
+#, c-format
+msgid "remove '%s'\n"
+msgstr "lösche '%s'\n"
+
msgid ""
"You can fix this with 'git rebase --edit-todo' and then run 'git rebase --"
"continue'.\n"
@@ -18405,9 +19314,12 @@ msgid ""
"l, label <label> = label current HEAD with a name\n"
"t, reset <label> = reset HEAD to a label\n"
"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
-". create a merge commit using the original merge commit's\n"
-". message (or the oneline, if no original merge commit was\n"
-". specified); use -c <commit> to reword the commit message\n"
+" create a merge commit using the original merge commit's\n"
+" message (or the oneline, if no original merge commit was\n"
+" specified); use -c <commit> to reword the commit message\n"
+"u, update-ref <ref> = track a placeholder for the <ref> to be updated\n"
+" to this position in the new commits. The <ref> is\n"
+" updated at the end of the rebase\n"
"\n"
"These lines can be re-ordered; they are executed from top to bottom.\n"
msgstr ""
@@ -18429,11 +19341,16 @@ msgstr ""
"l, label <Label> = aktuellen HEAD mit Label versehen\n"
"t, reset <Label> = HEAD zu einem Label umsetzen\n"
"m, merge [-C <Commit> | -c <Commit>] <Label> [# <eineZeile>]\n"
-". Merge-Commit mit der originalen Merge-Commit-Beschreibung erstellen\n"
-". (oder die eine Zeile, wenn keine originale Merge-Commit-"
+" Merge-Commit mit der originalen Merge-Commit-Beschreibung erstellen\n"
+" (oder die eine Zeile, wenn keine originale Merge-Commit-"
"Beschreibung\n"
-". spezifiziert ist). Benutzen Sie -c <Commit> zum Bearbeiten der\n"
-". Commit-Beschreibung.\n"
+" spezifiziert ist). Benutzen Sie -c <Commit> zum Bearbeiten der\n"
+" Commit-Beschreibung.\n"
+"u, update-ref <Referenz>= einen Platzhalter für die zu aktualisierende "
+"<Referenz>\n"
+" zu dieser Position in den neuen Commits erstellen. Die "
+"<Referenz>wird\n"
+" am Ende des Rebase aktualisiert\n"
"\n"
"Diese Zeilen können umsortiert werden; sie werden von oben nach unten\n"
"ausgeführt.\n"
@@ -18529,6 +19446,14 @@ msgid "ahead %d, behind %d"
msgstr "%d voraus, %d hinterher"
#, c-format
+msgid "%%(%.*s) does not take arguments"
+msgstr "%%(%.*s) nimmt keine Argumente entgegen"
+
+#, c-format
+msgid "unrecognized %%(%.*s) argument: %s"
+msgstr "nicht erkanntes %%(%.*s) Argument: %s"
+
+#, c-format
msgid "expected format: %%(color:<color>)"
msgstr "Erwartetes Format: %%(color:<Farbe>)"
@@ -18545,42 +19470,38 @@ msgid "Integer value expected refname:rstrip=%s"
msgstr "Positiver Wert erwartet refname:rstrip=%s"
#, c-format
-msgid "unrecognized %%(%s) argument: %s"
-msgstr "nicht erkanntes %%(%s) Argument: %s"
+msgid "expected %%(trailers:key=<value>)"
+msgstr "%%(trailers:key=<Wert>) erwartet"
#, c-format
-msgid "%%(objecttype) does not take arguments"
-msgstr "%%(objecttype) akzeptiert keine Argumente"
+msgid "unknown %%(trailers) argument: %s"
+msgstr "unbekanntes %%(trailers) Argument: %s"
#, c-format
-msgid "%%(deltabase) does not take arguments"
-msgstr "%%(deltabase) akzeptiert keine Argumente"
+msgid "positive value expected contents:lines=%s"
+msgstr "Positiver Wert erwartet contents:lines=%s"
#, c-format
-msgid "%%(body) does not take arguments"
-msgstr "%%(body) akzeptiert keine Argumente"
+msgid "argument expected for %s"
+msgstr "Argument erwartet für %s"
#, c-format
-msgid "expected %%(trailers:key=<value>)"
-msgstr "%%(trailers:key=<Wert>) erwartet"
+msgid "positive value expected %s=%s"
+msgstr "positiver Wert erwartet %s=%s"
#, c-format
-msgid "unknown %%(trailers) argument: %s"
-msgstr "unbekanntes %%(trailers) Argument: %s"
+msgid "cannot fully parse %s=%s"
+msgstr "kann %s=%s nicht vollständig parsen"
#, c-format
-msgid "positive value expected contents:lines=%s"
-msgstr "Positiver Wert erwartet contents:lines=%s"
+msgid "value expected %s="
+msgstr "Wert erwartet %s="
#, c-format
msgid "positive value expected '%s' in %%(%s)"
msgstr "positiver Wert erwartet '%s' in %%(%s)"
#, c-format
-msgid "unrecognized email option: %s"
-msgstr "nicht erkannte E-Mail Option: %s"
-
-#, c-format
msgid "expected format: %%(align:<width>,<position>)"
msgstr "erwartetes Format: %%(align:<Breite>,<Position>)"
@@ -18593,12 +19514,16 @@ msgid "unrecognized width:%s"
msgstr "nicht erkannte Breite:%s"
#, c-format
+msgid "unrecognized %%(%s) argument: %s"
+msgstr "nicht erkanntes %%(%s) Argument: %s"
+
+#, c-format
msgid "positive width expected with the %%(align) atom"
msgstr "Positive Breitenangabe für %%(align) erwartet"
#, c-format
-msgid "%%(rest) does not take arguments"
-msgstr "%%(rest) akzeptiert keine Argumente"
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "erwartetes Format: %%(ahead-behind:<Commit>)"
#, c-format
msgid "malformed field name: %.*s"
@@ -18646,6 +19571,9 @@ msgstr "dieser Befehl lehnt Atom ab %%(%.*s)"
msgid "--format=%.*s cannot be used with --python, --shell, --tcl"
msgstr "--format=%.*s kann nicht mit --python, --shell, --tcl verwendet werden"
+msgid "failed to run 'describe'"
+msgstr "'describe' konnte nicht ausgeführt werden"
+
#, c-format
msgid "(no branch, rebasing %s)"
msgstr "(kein Branch, Rebase von %s)"
@@ -18707,6 +19635,9 @@ msgstr "Schüssel"
msgid "field name to sort on"
msgstr "sortiere nach diesem Feld"
+msgid "exclude refs which match pattern"
+msgstr "Ausschluss von Referenzen, die dem Muster entsprechen"
+
#, c-format
msgid "not a reflog: %s"
msgstr "Kein Reflog: %s"
@@ -18798,10 +19729,6 @@ msgid "cannot process '%s' and '%s' at the same time"
msgstr "kann '%s' und '%s' nicht zur selben Zeit verarbeiten"
#, c-format
-msgid "could not remove reference %s"
-msgstr "konnte Referenz %s nicht löschen"
-
-#, c-format
msgid "could not delete reference %s: %s"
msgstr "konnte Referenz %s nicht entfernen: %s"
@@ -18908,6 +19835,13 @@ msgstr "Protokollfehler: SHA-1/Referenz erwartet, '%s' bekommen"
msgid "http transport does not support %s"
msgstr "HTTP-Transport unterstützt nicht %s"
+msgid "protocol error: expected '<url> <path>', missing space"
+msgstr "Protokollfehler: erwartet '<url> <path>', fehlendes Leerzeichen"
+
+#, c-format
+msgid "failed to download file at URL '%s'"
+msgstr "Datei unter URL '%s' konnte nicht heruntergeladen werden"
+
msgid "git-http-push failed"
msgstr "\"git-http-push\" fehlgeschlagen"
@@ -18988,16 +19922,13 @@ msgid ""
"\n"
"Neither worked, so we gave up. You must fully qualify the ref."
msgstr ""
-"Das angegebene Ziel ist kein vollständiger Referenzname (startet mit \"refs/"
-"\").\n"
-"Wir versuchten zu erraten, was Sie meinten, mit:\n"
+"Das angegebene Ziel ist kein vollständiger Referenzname (startet mit\n"
+"\"refs/\"). Wir versuchten zu erraten, was Sie meinten, mit:\n"
"\n"
"- Suche einer Referenz, die mit '%s' übereinstimmt, auf der Remote-Seite\n"
-"- Prüfung, ob die versendete <Quelle> ('%s') eine Referenz in \"refs/{heads,"
-"tags}\"\n"
-" ist, in dessen Falle wir einen entsprechenden refs/{heads,tags} Präfix "
-"auf\n"
-" der Remote-Seite hinzufügen würden.\n"
+"- Prüfung, ob die versendete <Quelle> ('%s') eine Referenz in\n"
+" \"refs/{heads,tags}/\" ist, in dessen Falle wir einen entsprechenden\n"
+" refs/{heads,tags}/ Präfix auf der Remote-Seite hinzufügen würden.\n"
"\n"
"Keines hat funktioniert, sodass wir aufgegeben haben. Sie müssen die\n"
"Referenz mit vollqualifizierten Namen angeben."
@@ -19157,10 +20088,11 @@ msgstr[1] ""
"Ihr Branch und '%s' sind divergiert,\n"
"und haben jeweils %d und %d unterschiedliche Commits.\n"
-msgid " (use \"git pull\" to merge the remote branch into yours)\n"
+msgid ""
+" (use \"git pull\" if you want to integrate the remote branch with yours)\n"
msgstr ""
-" (benutzen Sie \"git pull\", um Ihren Branch mit dem Remote-Branch "
-"zusammenzuführen)\n"
+" (verwenden Sie \"git pull\", wenn Sie den Remote-Branch in Ihren "
+"integrieren wollen)\n"
#, c-format
msgid "cannot parse expected object name '%s'"
@@ -19233,10 +20165,6 @@ msgid "no remembered resolution for '%s'"
msgstr "Keine aufgezeichnete Konfliktauflösung für '%s'."
#, c-format
-msgid "cannot unlink '%s'"
-msgstr "Kann '%s' nicht löschen."
-
-#, c-format
msgid "Updated preimage for '%s'"
msgstr "Preimage für '%s' aktualisiert."
@@ -19258,9 +20186,28 @@ msgstr "Konnte HEAD-Commit nicht bestimmen."
msgid "failed to find tree of %s"
msgstr "Fehler beim Finden des \"Tree\"-Objektes von %s."
+#, c-format
+msgid "unsupported section for hidden refs: %s"
+msgstr "nicht unterstützter Abschnitt für versteckte Referenzen: %s"
+
+msgid "--exclude-hidden= passed more than once"
+msgstr "--exclude-hidden= mehr als einmal übergeben"
+
+#, c-format
+msgid "resolve-undo records `%s` which is missing"
+msgstr "resolve-undo zeichnet `%s` auf, das fehlt"
+
+#, c-format
+msgid "could not get commit for ancestry-path argument %s"
+msgstr "konnte kein Commit für das Argument ancestry-path %s erhalten"
+
msgid "--unpacked=<packfile> no longer supported"
msgstr "--unpacked=<Pack-Datei> wird nicht länger unterstützt"
+#, c-format
+msgid "invalid option '%s' in --stdin mode"
+msgstr "ungültige Option '%s' im Modus --stdin"
+
msgid "your current branch appears to be broken"
msgstr "Ihr aktueller Branch scheint fehlerhaft zu sein."
@@ -19278,6 +20225,205 @@ msgstr "-L unterstützt noch keine anderen Diff-Formate außer -p und -s"
msgid "cannot create async thread: %s"
msgstr "Konnte Thread für async nicht erzeugen: %s"
+#, c-format
+msgid "'%s' does not exist"
+msgstr "'%s' existiert nicht."
+
+#, c-format
+msgid "could not switch to '%s'"
+msgstr "konnte nicht zu '%s' wechseln"
+
+msgid "need a working directory"
+msgstr "Arbeitsverzeichnis benötigt"
+
+msgid "Scalar enlistments require a worktree"
+msgstr "Skalare Eintragungen erfordern ein Arbeitsverzeichnis"
+
+#, c-format
+msgid "could not configure %s=%s"
+msgstr "konnte %s=%s nicht konfigurieren"
+
+msgid "could not configure log.excludeDecoration"
+msgstr "konnte log.excludeDecoration nicht konfigurieren"
+
+msgid "could not add enlistment"
+msgstr "konnte keine Eintragung hinzufügen"
+
+msgid "could not set recommended config"
+msgstr "konnte die empfohlene Konfiguration nicht setzen"
+
+msgid "could not turn on maintenance"
+msgstr "konnte die Wartung nicht einschalten"
+
+msgid "could not start the FSMonitor daemon"
+msgstr "konnte den FSMonitor-Daemon nicht starten"
+
+msgid "could not turn off maintenance"
+msgstr "konnte die Wartung nicht abschalten"
+
+msgid "could not remove enlistment"
+msgstr "konnte die Eintragung nicht aufheben"
+
+#, c-format
+msgid "remote HEAD is not a branch: '%.*s'"
+msgstr "externer HEAD ist kein Branch: '%.*s'"
+
+msgid "failed to get default branch name from remote; using local default"
+msgstr ""
+"Fehler beim Abfragen des Standard-Branchnamens vom Remote-Repository; nutze "
+"lokalen Standardwert"
+
+msgid "failed to get default branch name"
+msgstr "Fehler beim Abfragen des Standard-Branchnamens"
+
+msgid "failed to unregister repository"
+msgstr "Fehler beim Austragen des Repositories"
+
+msgid "failed to stop the FSMonitor daemon"
+msgstr "der FSMonitor-Daemon konnte nicht gestoppt werden"
+
+msgid "failed to delete enlistment directory"
+msgstr "Fehler beim Löschen des Eintragungs-Verzeichnisses"
+
+msgid "branch to checkout after clone"
+msgstr "Branch, der nach dem Klonen ausgecheckt werden soll"
+
+msgid "when cloning, create full working directory"
+msgstr "vollständiges Arbeitsverzeichnis beim Klonen erstellen"
+
+msgid "only download metadata for the branch that will be checked out"
+msgstr "lade nur Metadaten des Branches herunter, der ausgecheckt wird"
+
+msgid "create repository within 'src' directory"
+msgstr "Repository im Verzeichnis 'src' erstellen"
+
+msgid ""
+"scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n"
+"\t[--[no-]src] <url> [<enlistment>]"
+msgstr ""
+"scalar clone [--single-branch] [--branch <Haupt-Branch>] [--full-clone]\n"
+"\t[--[no-]src] <URL> [<Eintragung>]"
+
+#, c-format
+msgid "cannot deduce worktree name from '%s'"
+msgstr "konnte Name für Arbeitsverzeichnis nicht von '%s' ableiten"
+
+#, c-format
+msgid "directory '%s' exists already"
+msgstr "Verzeichnis '%s' existiert bereits"
+
+#, c-format
+msgid "failed to get default branch for '%s'"
+msgstr "Fehler beim Abfragen des Default-Branches für '%s'"
+
+#, c-format
+msgid "could not configure remote in '%s'"
+msgstr "konnte Remote-Repository in '%s' nicht konfigurieren"
+
+#, c-format
+msgid "could not configure '%s'"
+msgstr "konnte '%s' nicht konfigurieren"
+
+msgid "partial clone failed; attempting full clone"
+msgstr "partielles Klonen fehlgeschlagen; versuche vollständiges Klonen"
+
+msgid "could not configure for full clone"
+msgstr "konnte nicht für vollständiges Klonen konfigurieren"
+
+msgid "scalar diagnose [<enlistment>]"
+msgstr "scalar diagnose [<Eintragung>]"
+
+msgid "`scalar list` does not take arguments"
+msgstr "`scalar list` akzeptiert keine Argumente"
+
+msgid "scalar register [<enlistment>]"
+msgstr "scalar register [<Eintragung>]"
+
+msgid "reconfigure all registered enlistments"
+msgstr "alle registrierten Eintragungen neu konfigurieren"
+
+msgid "scalar reconfigure [--all | <enlistment>]"
+msgstr "scalar reconfigure [--all | <Eintragung>]"
+
+msgid "--all or <enlistment>, but not both"
+msgstr "--all oder <Eintragung>, aber nicht beides"
+
+#, c-format
+msgid "could not remove stale scalar.repo '%s'"
+msgstr "konnte veraltetes scalar.repo '%s' nicht entfernen"
+
+#, c-format
+msgid "removed stale scalar.repo '%s'"
+msgstr "veraltetes scalar.repo '%s' entfernt"
+
+#, c-format
+msgid "repository at '%s' has different owner"
+msgstr "Repository bei '%s' hat anderen Eigentümer"
+
+#, c-format
+msgid "repository at '%s' has a format issue"
+msgstr "Repository bei '%s' hat ein Formatproblem"
+
+#, c-format
+msgid "repository not found in '%s'"
+msgstr "Kein Repository in '%s' gefunden"
+
+#, c-format
+msgid ""
+"to unregister this repository from Scalar, run\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+msgstr ""
+"um dieses Repository von Scalar abzumelden, führen Sie aus\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+
+msgid ""
+"scalar run <task> [<enlistment>]\n"
+"Tasks:\n"
+msgstr ""
+"scalar run <Aufgabe> [<Eintragung>]\n"
+"Aufgaben:\n"
+
+#, c-format
+msgid "no such task: '%s'"
+msgstr "Aufgabe nicht gefunden: '%s'"
+
+msgid "scalar unregister [<enlistment>]"
+msgstr "scalar unregister [<Eintragung>]"
+
+msgid "scalar delete <enlistment>"
+msgstr "scalar delete <Eintragung>"
+
+msgid "refusing to delete current working directory"
+msgstr "Löschen des aktuellen Arbeitsverzeichnisses wurde verweigert"
+
+msgid "include Git version"
+msgstr "Git-Version einbeziehen"
+
+msgid "include Git's build options"
+msgstr "Build-Optionen von Git einbeziehen"
+
+msgid "scalar verbose [-v | --verbose] [--build-options]"
+msgstr "scalar verbose [-v | --verbose] [--build-options]"
+
+msgid "-C requires a <directory>"
+msgstr "-C erfordert ein <Verzeichnis>"
+
+#, c-format
+msgid "could not change to '%s'"
+msgstr "konnte nicht zu '%s' wechseln"
+
+msgid "-c requires a <key>=<value> argument"
+msgstr "-c benötigt ein <Schlüssel>=<Wert> Argument"
+
+msgid ""
+"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
+"\n"
+"Commands:\n"
+msgstr ""
+"scalar [-C <Verzeichnis>] [-c <Schlüssel>=<Wert>] <Befehl> [<Optionen>]\n"
+"\n"
+"Befehle:\n"
+
msgid "unexpected flush packet while reading remote unpack status"
msgstr "Unerwartetes Flush-Paket beim Lesen des Remote-Unpack-Status."
@@ -19384,10 +20530,6 @@ msgid "could not lock '%s'"
msgstr "Konnte '%s' nicht sperren"
#, c-format
-msgid "could not write to '%s'"
-msgstr "Konnte nicht nach '%s' schreiben."
-
-#, c-format
msgid "could not write eol to '%s'"
msgstr "Konnte EOL nicht nach '%s' schreiben."
@@ -19403,10 +20545,6 @@ msgid "commit your changes or stash them to proceed."
msgstr ""
"Committen Sie Ihre Änderungen oder benutzen Sie \"stash\", um fortzufahren."
-#, c-format
-msgid "%s: fast-forward"
-msgstr "%s: Vorspulen"
-
#. TRANSLATORS: %s will be "revert", "cherry-pick" or
#. "rebase".
#.
@@ -19647,10 +20785,6 @@ msgid "%s: cannot parse parent commit %s"
msgstr "%s: kann Eltern-Commit %s nicht parsen"
#, c-format
-msgid "could not rename '%s' to '%s'"
-msgstr "Konnte '%s' nicht zu '%s' umbenennen."
-
-#, c-format
msgid "could not revert %s... %s"
msgstr "Konnte \"revert\" nicht auf %s... (%s) ausführen"
@@ -19671,6 +20805,24 @@ msgid "git %s: failed to refresh the index"
msgstr "git %s: Fehler beim Aktualisieren des Index"
#, c-format
+msgid "'%s' is not a valid label"
+msgstr "'%s' ist keine gültige Beschriftung"
+
+#, c-format
+msgid "'%s' is not a valid refname"
+msgstr "'%s' ist kein gültiger Referenzname"
+
+#, c-format
+msgid "update-ref requires a fully qualified refname e.g. refs/heads/%s"
+msgstr ""
+"update-ref erfordert einen vollständig qualifizierten Referenznamen, z. B. "
+"refs/heads/%s"
+
+#, c-format
+msgid "invalid command '%.*s'"
+msgstr "ungültiger Befehl '%.*s'"
+
+#, c-format
msgid "%s does not accept arguments: '%s'"
msgstr "%s akzeptiert keine Argumente: '%s'"
@@ -19741,9 +20893,6 @@ msgstr "versuchen Sie \"git cherry-pick (--continue | %s--abort | --quit)\""
msgid "could not create sequencer directory '%s'"
msgstr "konnte \"sequencer\"-Verzeichnis '%s' nicht erstellen"
-msgid "could not lock HEAD"
-msgstr "konnte HEAD nicht sperren"
-
msgid "no cherry-pick or revert in progress"
msgstr "kein \"cherry-pick\" oder \"revert\" im Gange"
@@ -19840,20 +20989,20 @@ msgstr ""
"\n"
"ausführen.\n"
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "Der Index und/oder das Arbeitsverzeichnis wurde geändert.\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "und Änderungen am Index und/oder am Arbeitsverzeichnis vorgenommen.\n"
#, c-format
msgid ""
"execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
"Commit or stash your changes, and then run\n"
"\n"
" git rebase --continue\n"
"\n"
msgstr ""
"Ausführung erfolgreich: %s\n"
-"Aber Änderungen in Index oder Arbeitsverzeichnis verblieben.\n"
+"Aber es sind Änderungen im Index oder Arbeitsverzeichnis verblieben.\n"
"Committen Sie Ihre Änderungen oder benutzen Sie \"stash\".\n"
"Führen Sie dann aus:\n"
"\n"
@@ -19864,16 +21013,16 @@ msgstr ""
msgid "illegal label name: '%.*s'"
msgstr "unerlaubter Beschriftungsname: '%.*s'"
+#, c-format
+msgid "could not resolve '%s'"
+msgstr "konnte '%s' nicht auflösen"
+
msgid "writing fake root commit"
msgstr "unechten Root-Commit schreiben"
msgid "writing squash-onto"
msgstr "squash-onto schreiben"
-#, c-format
-msgid "could not resolve '%s'"
-msgstr "konnte '%s' nicht auflösen"
-
msgid "cannot merge without a current revision"
msgstr "kann nicht ohne einen aktuellen Commit mergen"
@@ -19900,6 +21049,28 @@ msgstr "konnte nicht einmal versuchen '%.*s' zu mergen"
msgid "merge: Unable to write new index file"
msgstr "merge: Konnte neue Index-Datei nicht schreiben."
+#, c-format
+msgid ""
+"another 'rebase' process appears to be running; '%s.lock' already exists"
+msgstr ""
+"ein weiterer 'rebase'-Prozess scheint zu laufen; '%s.lock' existiert bereits"
+
+#, c-format
+msgid ""
+"Updated the following refs with %s:\n"
+"%s"
+msgstr ""
+"Die folgenden Referenzen wurden mit %s aktualisiert:\n"
+"%s"
+
+#, c-format
+msgid ""
+"Failed to update the following refs with %s:\n"
+"%s"
+msgstr ""
+"Die Aktualisierung der folgenden Referenzen mit %s ist fehlgeschlagen:\n"
+"%s"
+
msgid "Cannot autostash"
msgstr "Kann automatischen Stash nicht erzeugen"
@@ -19942,6 +21113,9 @@ msgstr "Beim Anwenden des automatischen Stash traten Konflikte auf."
msgid "Autostash exists; creating a new stash entry."
msgstr "Automatischer Stash existiert; ein neuer Stash-Eintrag wird erstellt."
+msgid "autostash reference is a symref"
+msgstr "Referenz für autostash ist eine symbolische Referenz"
+
msgid "could not detach HEAD"
msgstr "konnte HEAD nicht loslösen"
@@ -19975,14 +21149,14 @@ msgstr ""
" git rebase --continue\n"
#, c-format
-msgid "Rebasing (%d/%d)%s"
-msgstr "Rebase (%d/%d)%s"
-
-#, c-format
msgid "Stopped at %s... %.*s\n"
msgstr "Angehalten bei %s... %.*s\n"
#, c-format
+msgid "Rebasing (%d/%d)%s"
+msgstr "Rebase (%d/%d)%s"
+
+#, c-format
msgid "unknown command %d"
msgstr "Unbekannter Befehl %d"
@@ -20071,6 +21245,10 @@ msgid "the script was already rearranged."
msgstr "Das Script wurde bereits umgeordnet."
#, c-format
+msgid "update-refs file at '%s' is invalid"
+msgstr "update-refs-Datei bei '%s' ist ungültig"
+
+#, c-format
msgid "'%s' is outside repository at '%s'"
msgstr "'%s' liegt außerhalb des Repositories von '%s'"
@@ -20192,17 +21370,22 @@ msgstr ""
#, c-format
msgid ""
-"unsafe repository ('%s' is owned by someone else)\n"
-"To add an exception for this directory, call:\n"
+"detected dubious ownership in repository at '%s'\n"
+"%sTo add an exception for this directory, call:\n"
"\n"
"\tgit config --global --add safe.directory %s"
msgstr ""
-"unsicheres Repository ('%s' gehört jemand anderem)\n"
-"Um eine Ausnahme für dieses Repository hinzuzufügen, führen Sie aus:\n"
+"dubiose Besitzverhältnisse im Repository bei '%s' entdeckt\n"
+"%sUm eine Ausnahme für dieses Verzeichnis hinzuzufügen, rufen Sie auf:\n"
"\n"
"\tgit config --global --add safe.directory %s"
#, c-format
+msgid "cannot use bare repository '%s' (safe.bareRepository is '%s')"
+msgstr ""
+"kann Bare-Repository '%s' nicht verwenden (safe.bareRepository ist '%s')"
+
+#, c-format
msgid ""
"problem with core.sharedRepository filemode value (0%.3o).\n"
"The owner of files must always have read and write permissions."
@@ -20217,6 +21400,83 @@ msgid "setsid failed"
msgstr "setsid fehlgeschlagen"
#, c-format
+msgid "cannot stat template '%s'"
+msgstr "kann Vorlage '%s' nicht lesen"
+
+#, c-format
+msgid "cannot opendir '%s'"
+msgstr "kann Verzeichnis '%s' nicht öffnen"
+
+#, c-format
+msgid "cannot readlink '%s'"
+msgstr "kann Verweis '%s' nicht lesen"
+
+#, c-format
+msgid "cannot symlink '%s' '%s'"
+msgstr "kann symbolische Verknüpfung '%s' auf '%s' nicht erstellen"
+
+#, c-format
+msgid "cannot copy '%s' to '%s'"
+msgstr "kann '%s' nicht nach '%s' kopieren"
+
+#, c-format
+msgid "ignoring template %s"
+msgstr "ignoriere Vorlage %s"
+
+#, c-format
+msgid "templates not found in %s"
+msgstr "keine Vorlagen in %s gefunden"
+
+#, c-format
+msgid "not copying templates from '%s': %s"
+msgstr "kopiere keine Vorlagen von '%s': %s"
+
+#, c-format
+msgid "invalid initial branch name: '%s'"
+msgstr "ungültiger initialer Branchname: '%s'"
+
+#, c-format
+msgid "re-init: ignored --initial-branch=%s"
+msgstr "Neu-Initialisierung: --initial-branch=%s ignoriert"
+
+#, c-format
+msgid "unable to handle file type %d"
+msgstr "kann nicht mit Dateityp %d umgehen"
+
+#, c-format
+msgid "unable to move %s to %s"
+msgstr "konnte %s nicht nach %s verschieben"
+
+msgid "attempt to reinitialize repository with different hash"
+msgstr "Versuch, das Repository mit einem anderen Hash zu reinitialisieren"
+
+msgid ""
+"attempt to reinitialize repository with different reference storage format"
+msgstr ""
+"Versuch, das Repository mit einem anderen Referenzspeicherformat neu zu "
+"initialisieren"
+
+#, c-format
+msgid "%s already exists"
+msgstr "%s existiert bereits"
+
+#, c-format
+msgid "Reinitialized existing shared Git repository in %s%s\n"
+msgstr "Bestehendes verteiltes Git-Repository in %s%s neuinitialisiert\n"
+
+#, c-format
+msgid "Reinitialized existing Git repository in %s%s\n"
+msgstr "Bestehendes Git-Repository in %s%s neuinitialisiert\n"
+
+#, c-format
+msgid "Initialized empty shared Git repository in %s%s\n"
+msgstr "Leeres verteiltes Git-Repository in %s%s initialisiert\n"
+
+#, c-format
+msgid "Initialized empty Git repository in %s%s\n"
+msgstr "Leeres Git-Repository in %s%s initialisiert\n"
+
+#, c-format
msgid "index entry is a directory, but not sparse (%08x)"
msgstr "Index-Eintrag ist ein Verzeichnis, aber nicht partiell (%08x)"
@@ -20268,10 +21528,6 @@ msgstr[0] "%u Byte/s"
msgstr[1] "%u Bytes/s"
#, c-format
-msgid "could not edit '%s'"
-msgstr "Konnte '%s' nicht editieren."
-
-#, c-format
msgid "ignoring suspicious submodule name: %s"
msgstr "Ignoriere verdächtigen Submodulnamen: %s"
@@ -20452,11 +21708,26 @@ msgstr "ls-tree mit unerwartetem Rückgabewert %d beendet"
msgid "failed to lstat '%s'"
msgstr "'lstat' für '%s' fehlgeschlagen"
-msgid "unhandled options"
-msgstr "unbehandelte Optionen"
+msgid "no remote configured to get bundle URIs from"
+msgstr "kein Remote-Repository zum Erhalten von Bundle-URIs konfiguriert"
-msgid "error preparing revisions"
-msgstr "Fehler beim Vorbereiten der Commits"
+#, c-format
+msgid "remote '%s' has no configured URL"
+msgstr "Remote-Repository '%s' hat keine konfigurierte URL"
+
+msgid "could not get the bundle-uri list"
+msgstr "konnte die Bundle-uri-Liste nicht erhalten"
+
+msgid "test-tool cache-tree <options> (control|prime|update)"
+msgstr "test-tool cache-tree <Optionen> (control|prime|update)"
+
+msgid "clear the cache tree before each iteration"
+msgstr "das Cache-Verzeichnis vor jeder Iteration löschen"
+
+msgid "number of entries in the cache tree to invalidate (default 0)"
+msgstr ""
+"Anzahl der Einträge im Cache-Verzeichnis, die ungültig gemacht werden sollen "
+"(Standardwert 0)"
#, c-format
msgid "commit %s is not marked reachable"
@@ -20613,9 +21884,6 @@ msgstr ""
msgid "invalid remote service path"
msgstr "ungültiger Remote-Service Pfad."
-msgid "operation not supported by protocol"
-msgstr "die Operation wird von dem Protokoll nicht unterstützt"
-
#, c-format
msgid "can't connect to subservice %s"
msgstr "kann keine Verbindung zu Subservice %s herstellen"
@@ -20746,10 +22014,6 @@ msgid "support for protocol v2 not implemented yet"
msgstr "Unterstützung für Protokoll v2 noch nicht implementiert."
#, c-format
-msgid "unknown value for config '%s': %s"
-msgstr "Unbekannter Wert für Konfiguration '%s': %s"
-
-#, c-format
msgid "transport '%s' not allowed"
msgstr "Ãœbertragungsart '%s' nicht erlaubt."
@@ -20796,6 +22060,15 @@ msgstr "Abbruch."
msgid "failed to push all needed submodules"
msgstr "Fehler beim Versand aller erforderlichen Submodule."
+msgid "bundle-uri operation not supported by protocol"
+msgstr "bundle-uri Operation wird vom Protokoll nicht unterstützt"
+
+msgid "could not retrieve server-advertised bundle-uri list"
+msgstr "konnte die vom Server angekündigte bundle-uri-Liste nicht abrufen"
+
+msgid "operation not supported by protocol"
+msgstr "die Operation wird von dem Protokoll nicht unterstützt"
+
msgid "too-short tree object"
msgstr "zu kurzes Tree-Objekt"
@@ -21091,6 +22364,18 @@ msgstr "ungültige Portnummer"
msgid "invalid '..' path segment"
msgstr "ungültiges '..' Pfadsegment"
+msgid "usage: "
+msgstr "Verwendung: "
+
+msgid "fatal: "
+msgstr "Schwerwiegend: "
+
+msgid "error: "
+msgstr "Fehler: "
+
+msgid "warning: "
+msgstr "Warnung: "
+
msgid "Fetching objects"
msgstr "Anfordern der Objekte"
@@ -21191,6 +22476,9 @@ msgstr "konnte nicht auf '%s' zugreifen"
msgid "unable to get current working directory"
msgstr "konnte aktuelles Arbeitsverzeichnis nicht bekommen"
+msgid "unable to get random bytes"
+msgstr "konnte keine Zufallsbytes abrufen"
+
msgid "Unmerged paths:"
msgstr "Nicht zusammengeführte Pfade:"
@@ -21571,13 +22859,22 @@ msgstr "Ignorierte Dateien"
#, c-format
msgid ""
-"It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
-"may speed it up, but you have to be careful not to forget to add\n"
-"new files yourself (see 'git help status')."
+"It took %.2f seconds to enumerate untracked files,\n"
+"but the results were cached, and subsequent runs may be faster."
+msgstr ""
+"Es dauerte %.2f Sekunden, um die unversionierten Dateien aufzuzählen,\n"
+"aber die Ergebnisse wurden zwischengespeichert, sodass spätere Durchläufe "
+"schneller sein können."
+
+#, c-format
+msgid "It took %.2f seconds to enumerate untracked files."
+msgstr ""
+"Es hat %.2f Sekunden gedauert, um die unversionierten Dateien aufzuzählen."
+
+msgid "See 'git help status' for information on how to improve this."
msgstr ""
-"Es dauerte %.2f Sekunden die unversionierten Dateien zu bestimmen.\n"
-"'status -uno' könnte das beschleunigen, aber Sie müssen darauf achten,\n"
-"neue Dateien selbstständig hinzuzufügen (siehe 'git help status')."
+"Siehe 'git help status' für Informationen darüber, wie man dies verbessern "
+"kann."
#, c-format
msgid "Untracked files not listed%s"
@@ -21660,6 +22957,10 @@ msgid "cannot %s: Your index contains uncommitted changes."
msgstr ""
"%s nicht möglich: Die Staging-Area enthält nicht committete Änderungen."
+#, c-format
+msgid "unknown style '%s' given for '%s'"
+msgstr "unbekannter Stil '%s' für '%s' angegeben"
+
msgid ""
"Error: Your local changes to the following files would be overwritten by "
"merge"
@@ -21737,306 +23038,6 @@ msgstr ""
msgid "Unable to determine absolute path of git directory"
msgstr "Konnte absoluten Pfad des Git-Verzeichnisses nicht bestimmen"
-#. TRANSLATORS: you can adjust this to align "git add -i" status menu
-#, perl-format
-msgid "%12s %12s %s"
-msgstr "%28s %25s %s"
-
-#, perl-format
-msgid "touched %d path\n"
-msgid_plural "touched %d paths\n"
-msgstr[0] "%d Pfad angefasst\n"
-msgstr[1] "%d Pfade angefasst\n"
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for staging."
-msgstr ""
-"Wenn der Patch sauber angewendet werden kann, wird der bearbeitete\n"
-"Patch-Block direkt zum Hinzufügen zur Staging-Area markiert."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for stashing."
-msgstr ""
-"Wenn der Patch sauber angewendet werden kann, wird der bearbeitete\n"
-"Patch-Block direkt zum Hinzufügen zum Stash markiert."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for unstaging."
-msgstr ""
-"Wenn der Patch sauber angewendet werden kann, wird der bearbeitete\n"
-"Patch-Block direkt zum Entfernen aus der Staging-Area markiert."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for applying."
-msgstr ""
-"Wenn der Patch sauber angewendet werden kann, wird der bearbeitete\n"
-"Patch-Block direkt zum Anwenden markiert."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for discarding."
-msgstr ""
-"Wenn der Patch sauber angewendet werden kann, wird der bearbeitete\n"
-"Patch-Block direkt zum Verwerfen markiert."
-
-#, perl-format
-msgid "failed to open hunk edit file for writing: %s"
-msgstr ""
-"Fehler beim Öffnen von Editier-Datei eines Patch-Blocks zum Schreiben: %s"
-
-#, perl-format
-msgid ""
-"---\n"
-"To remove '%s' lines, make them ' ' lines (context).\n"
-"To remove '%s' lines, delete them.\n"
-"Lines starting with %s will be removed.\n"
-msgstr ""
-"---\n"
-"Um '%s' Zeilen zu entfernen, machen Sie aus diesen ' ' Zeilen (Kontext).\n"
-"Um '%s' Zeilen zu entfernen, löschen Sie diese.\n"
-"Zeilen, die mit %s beginnen, werden entfernt.\n"
-
-#, perl-format
-msgid "failed to open hunk edit file for reading: %s"
-msgstr "Fehler beim Öffnen von Editier-Datei eines Patch-Blocks zum Lesen: %s"
-
-msgid ""
-"y - stage this hunk\n"
-"n - do not stage this hunk\n"
-"q - quit; do not stage this hunk or any of the remaining ones\n"
-"a - stage this hunk and all later hunks in the file\n"
-"d - do not stage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - diesen Patch-Block zum Commit vormerken\n"
-"n - diesen Patch-Block nicht zum Commit vormerken\n"
-"q - Beenden; diesen oder alle verbleibenden Patch-Blöcke nicht zum Commit "
-"vormerken\n"
-"a - diesen und alle weiteren Patch-Blöcke dieser Datei zum Commit vormerken\n"
-"d - diesen oder alle weiteren Patch-Blöcke in dieser Datei nicht zum Commit "
-"vormerken"
-
-msgid ""
-"y - stash this hunk\n"
-"n - do not stash this hunk\n"
-"q - quit; do not stash this hunk or any of the remaining ones\n"
-"a - stash this hunk and all later hunks in the file\n"
-"d - do not stash this hunk or any of the later hunks in the file"
-msgstr ""
-"y - diesen Patch-Block stashen\n"
-"n - diesen Patch-Block nicht stashen\n"
-"q - Beenden; diesen oder alle verbleibenden Patch-Blöcke nicht stashen\n"
-"a - diesen und alle weiteren Patch-Blöcke dieser Datei stashen\n"
-"d - diesen oder alle weiteren Patch-Blöcke dieser Datei nicht stashen"
-
-msgid ""
-"y - unstage this hunk\n"
-"n - do not unstage this hunk\n"
-"q - quit; do not unstage this hunk or any of the remaining ones\n"
-"a - unstage this hunk and all later hunks in the file\n"
-"d - do not unstage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - diesen Patch-Block unstashen\n"
-"n - diesen Patch-Block nicht unstashen\n"
-"q - Beenden; diesen oder alle verbleibenden Patch-Blöcke nicht unstashen\n"
-"a - diesen und alle weiteren Patch-Blöcke dieser Datei unstashen\n"
-"d - diesen oder alle weiteren Patch-Blöcke dieser Datei nicht unstashen"
-
-msgid ""
-"y - apply this hunk to index\n"
-"n - do not apply this hunk to index\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - diesen Patch-Block auf den Index anwenden\n"
-"n - diesen Patch-Block nicht auf den Index anwenden\n"
-"q - Beenden; diesen oder alle verbleibenden Patch-Blöcke nicht auf den Index "
-"anwenden\n"
-"a - diesen und alle weiteren Patch-Blöcke dieser Datei auf den Index "
-"anwenden\n"
-"d - diesen oder alle weiteren Patch-Blöcke dieser Datei nicht auf den Index "
-"anwenden"
-
-msgid ""
-"y - discard this hunk from worktree\n"
-"n - do not discard this hunk from worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - diesen Patch-Block im Arbeitsverzeichnis verwerfen\n"
-"n - diesen Patch-Block im Arbeitsverzeichnis nicht verwerfen\n"
-"q - Beenden; diesen oder alle verbleibenden Patch-Blöcke nicht im "
-"Arbeitsverzeichnis verwerfen\n"
-"a - diesen und alle weiteren Patch-Blöcke dieser Datei im Arbeitsverzeichnis "
-"verwerfen\n"
-"d - diesen oder alle weiteren Patch-Blöcke dieser Datei nicht im "
-"Arbeitsverzeichnis verwerfen"
-
-msgid ""
-"y - discard this hunk from index and worktree\n"
-"n - do not discard this hunk from index and worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - diesen Patch-Block im Index und Arbeitsverzeichnis verwerfen\n"
-"n - diesen Patch-Block nicht im Index und Arbeitsverzeichnis verwerfen\n"
-"q - Beenden; diesen oder alle verbleibenden Patch-Blöcke nicht im Index und "
-"Arbeitsverzeichnis verwerfen\n"
-"a - diesen und alle weiteren Patch-Blöcke in der Datei verwerfen\n"
-"d - diesen oder alle weiteren Patch-Blöcke in der Datei nicht verwerfen"
-
-msgid ""
-"y - apply this hunk to index and worktree\n"
-"n - do not apply this hunk to index and worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - diesen Patch-Block im Index und auf Arbeitsverzeichnis anwenden\n"
-"n - diesen Patch-Block nicht im Index und auf Arbeitsverzeichnis anwenden\n"
-"q - Beenden; diesen oder alle verbleibenden Patch-Blöcke nicht anwenden\n"
-"a - diesen und alle weiteren Patch-Blöcke in der Datei anwenden\n"
-"d - diesen oder alle weiteren Patch-Blöcke in der Datei nicht anwenden"
-
-msgid ""
-"y - apply this hunk to worktree\n"
-"n - do not apply this hunk to worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - diesen Patch-Block auf das Arbeitsverzeichnis anwenden\n"
-"n - diesen Patch-Block nicht auf das Arbeitsverzeichnis anwenden\n"
-"q - Beenden; diesen und alle verbleibenden Patch-Blöcke nicht anwenden\n"
-"a - diesen und alle weiteren Patch-Blöcke in der Datei anwenden\n"
-"d - diesen und alle weiteren Patch-Blöcke in der Datei nicht anwenden"
-
-msgid ""
-"g - select a hunk to go to\n"
-"/ - search for a hunk matching the given regex\n"
-"j - leave this hunk undecided, see next undecided hunk\n"
-"J - leave this hunk undecided, see next hunk\n"
-"k - leave this hunk undecided, see previous undecided hunk\n"
-"K - leave this hunk undecided, see previous hunk\n"
-"s - split the current hunk into smaller hunks\n"
-"e - manually edit the current hunk\n"
-"? - print help\n"
-msgstr ""
-"g - Patch-Block zum Hinspringen auswählen\n"
-"/ - nach Patch-Block suchen, der gegebenem regulärem Ausdruck entspricht\n"
-"j - diesen Patch-Block unbestimmt lassen, nächsten unbestimmten Patch-Block "
-"anzeigen\n"
-"J - diesen Patch-Block unbestimmt lassen, nächsten Patch-Block anzeigen\n"
-"k - diesen Patch-Block unbestimmt lassen, vorherigen unbestimmten Patch-"
-"Block anzeigen\n"
-"K - diesen Patch-Block unbestimmt lassen, vorherigen Patch-Block anzeigen\n"
-"s - aktuellen Patch-Block in kleinere Patch-Blöcke aufteilen\n"
-"e - aktuellen Patch-Block manuell editieren\n"
-"? - Hilfe anzeigen\n"
-
-msgid "The selected hunks do not apply to the index!\n"
-msgstr ""
-"Die ausgewählten Patch-Blöcke können nicht auf den Index angewendet werden!\n"
-
-#, perl-format
-msgid "ignoring unmerged: %s\n"
-msgstr "ignoriere nicht zusammengeführte Datei: %s\n"
-
-#, perl-format
-msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
-msgstr "Modusänderung auf Arbeitsverzeichnis anwenden [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
-msgstr "Löschung auf Arbeitsverzeichnis anwenden [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
-msgstr "Ergänzung auf Arbeitsverzeichnis anwenden [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
-msgstr ""
-"Diesen Patch-Block auf das Arbeitsverzeichnis anwenden [y,n,q,a,d%s,?]? "
-
-msgid "No other hunks to goto\n"
-msgstr "Keine anderen Patch-Blöcke verbleibend\n"
-
-#, perl-format
-msgid "Invalid number: '%s'\n"
-msgstr "Ungültige Nummer: '%s'\n"
-
-#, perl-format
-msgid "Sorry, only %d hunk available.\n"
-msgid_plural "Sorry, only %d hunks available.\n"
-msgstr[0] "Entschuldigung, nur %d Patch-Block verfügbar.\n"
-msgstr[1] "Entschuldigung, nur %d Patch-Blöcke verfügbar.\n"
-
-msgid "No other hunks to search\n"
-msgstr "Keine anderen Patch-Blöcke zum Durchsuchen\n"
-
-#, perl-format
-msgid "Malformed search regexp %s: %s\n"
-msgstr "Fehlerhafter regulärer Ausdruck für Suche %s: %s\n"
-
-msgid "No hunk matches the given pattern\n"
-msgstr "Kein Patch-Block entspricht dem angegebenen Muster\n"
-
-msgid "No previous hunk\n"
-msgstr "Kein vorheriger Patch-Block\n"
-
-msgid "No next hunk\n"
-msgstr "Kein folgender Patch-Block\n"
-
-msgid "Sorry, cannot split this hunk\n"
-msgstr "Entschuldigung, kann diesen Patch-Block nicht aufteilen.\n"
-
-#, perl-format
-msgid "Split into %d hunk.\n"
-msgid_plural "Split into %d hunks.\n"
-msgstr[0] "In %d Patch-Block aufgeteilt.\n"
-msgstr[1] "In %d Patch-Blöcke aufgeteilt.\n"
-
-msgid "Sorry, cannot edit this hunk\n"
-msgstr "Entschuldigung, kann diesen Patch-Block nicht bearbeiten.\n"
-
-#. TRANSLATORS: please do not translate the command names
-#. 'status', 'update', 'revert', etc.
-msgid ""
-"status - show paths with changes\n"
-"update - add working tree state to the staged set of changes\n"
-"revert - revert staged set of changes back to the HEAD version\n"
-"patch - pick hunks and update selectively\n"
-"diff - view diff between HEAD and index\n"
-"add untracked - add contents of untracked files to the staged set of "
-"changes\n"
-msgstr ""
-"status - Pfade mit Änderungen anzeigen\n"
-"update - Zustand des Arbeitsverzeichnisses den zum Commit "
-"vorgemerkten Änderungen hinzufügen\n"
-"revert - zum Commit vorgemerkte Änderungen auf HEAD Version "
-"zurücksetzen\n"
-"patch - Patch-Blöcke auswählen und selektiv aktualisieren\n"
-"diff - Unterschiede zwischen HEAD und Index anzeigen\n"
-"add untracked - Inhalte von unversionierten Dateien zum Commit vormerken\n"
-
-msgid "missing --"
-msgstr "-- fehlt"
-
-#, perl-format
-msgid "unknown --patch mode: %s"
-msgstr "Unbekannter --patch Modus: %s"
-
-#, perl-format
-msgid "invalid argument %s, expecting --"
-msgstr "ungültiges Argument %s, erwarte --"
-
msgid "local zone differs from GMT by a non-minute interval\n"
msgstr ""
"lokale Zeitzone unterscheidet sich von GMT nicht um ein Minutenintervall\n"
@@ -22164,13 +23165,13 @@ msgstr ""
"möchten.\n"
#, perl-format
-msgid "Failed to open %s: %s"
-msgstr "Fehler beim Öffnen von %s: %s"
-
-#, perl-format
msgid "Failed to open %s.final: %s"
msgstr "Fehler beim Öffnen von %s.final: %s"
+#, perl-format
+msgid "Failed to open %s: %s"
+msgstr "Fehler beim Öffnen von %s: %s"
+
msgid "Summary email is empty, skipping it\n"
msgstr "E-Mail mit Zusammenfassung ist leer, wird ausgelassen\n"
@@ -22332,13 +23333,17 @@ msgid "(%s) Could not execute '%s'"
msgstr "(%s) Konnte '%s' nicht ausführen"
#, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) Füge %s: %s hinzu von: '%s'\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) Fehlerhafte Ausgabe von '%s'"
#, perl-format
msgid "(%s) failed to close pipe to '%s'"
msgstr "(%s) Fehler beim Schließen der Pipe nach '%s'"
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) Füge %s: %s hinzu von: '%s'\n"
+
msgid "cannot send message as 7bit"
msgstr "kann Nachricht nicht als 7bit versenden"
diff --git a/po/es.po b/po/es.po
index b219047..1ff5ff3 100644
--- a/po/es.po
+++ b/po/es.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: 2022-06-16 08:28-0600\n"
-"PO-Revision-Date: 2021-11-07 18:53-0500\n"
+"POT-Creation-Date: 2022-09-27 21:02-0600\n"
+"PO-Revision-Date: 2022-09-27 22:56-0600\n"
"Last-Translator: Alex Henrie <alexhenrie24@gmail.com>\n"
"Language-Team: CodeLabora <codelabora@gmail.com>\n"
"Language: es\n"
@@ -16,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 3.0\n"
+"X-Generator: Poedit 3.1\n"
#, c-format
msgid "Huh (%s)?"
@@ -420,6 +420,22 @@ msgstr ""
"a - aplicar este fragmento y todos los posteriores en el archivo\n"
"d - no aplicar este fragmento ni ninguno de los siguientes en este archivo\n"
+#, c-format, perl-format
+msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
+msgstr "¿Aplicar cambio de modo al árbol de trabajo [y,n,q,a,d%s,?]? "
+
+#, c-format, perl-format
+msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
+msgstr "¿Aplicar eliminación al árbol de trabajo [y,n,q,a,d%s,?]? "
+
+#, c-format, perl-format
+msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
+msgstr "¿Aplicar adición al árbol de trabajo [y,n,q,a,d%s,?]? "
+
+#, c-format, perl-format
+msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
+msgstr "¿Aplicar este fragmento al árbol de trabajo [y,n,q,a,d,/%s,?]? "
+
msgid ""
"y - apply this hunk to worktree\n"
"n - do not apply this hunk to worktree\n"
@@ -437,10 +453,6 @@ msgstr ""
msgid "could not parse hunk header '%.*s'"
msgstr "no se puede analizar hunk header '%.*s'"
-#, c-format
-msgid "could not parse colored hunk header '%.*s'"
-msgstr "no se puede analizar hunk header '%.*s'"
-
msgid "could not parse diff"
msgstr "no se puede analizar diff"
@@ -496,7 +508,6 @@ msgstr ""
"Para eliminar '%c' líneas, bórrelas.\n"
"Líneas comenzando con %c serán eliminadas.\n"
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
#. TRANSLATORS: 'it' refers to the patch mentioned in the previous messages.
msgid ""
"If it does not apply cleanly, you will be given an opportunity to\n"
@@ -514,14 +525,12 @@ msgstr "no se puede analizar hunk header"
msgid "'git apply --cached' failed"
msgstr "falló 'git apply --cached'"
-#. #-#-#-#-# add-patch.c.po #-#-#-#-#
#. TRANSLATORS: do not translate [y/n]
#. The program will only accept that input at this point.
#. Consider translating (saying "no" discards!) as
#. (saying "n" for "no" discards!) if the translation
#. of the word "no" does not start with n.
#.
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
#. TRANSLATORS: do not translate [y/n]
#. The program will only accept that input
#. at this point.
@@ -731,6 +740,25 @@ msgstr ""
"false\n"
"\n"
+#, c-format
+msgid ""
+"The following paths have been moved outside the\n"
+"sparse-checkout definition but are not sparse due to local\n"
+"modifications.\n"
+msgstr ""
+"Las rutas siguientes se han movido fuera de la definición\n"
+"de sparse-checkout pero no son escasas a causa de\n"
+"modificaciones locales.\n"
+
+msgid ""
+"To correct the sparsity of these paths, do the following:\n"
+"* Use \"git add --sparse <paths>\" to update the index\n"
+"* Use \"git sparse-checkout reapply\" to apply the sparsity rules"
+msgstr ""
+"Para corregir la escasez de estas rutas, haz lo siguiente:\n"
+"* Usa \"git add --sparse <rutas>\" para actualizar el índice\n"
+"* Usa \"git sparse-checkout reapply\" para aplicar las reglas de escasez"
+
msgid "cmdline ends with \\"
msgstr "cmdline termina en \\"
@@ -745,13 +773,13 @@ msgstr "opción de espacios en blanco no reconocida '%s'"
msgid "unrecognized whitespace ignore option '%s'"
msgstr "opción de ignorar espacios en blanco no reconocida '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "options '%s' and '%s' cannot be used together"
-msgstr "Opciones --squash y --fixup no pueden ser usadas juntas"
+msgstr "las opciones '%s' y '%s' no pueden ser usados juntos"
-#, fuzzy, c-format
+#, c-format
msgid "'%s' outside a repository"
-msgstr "--3way está fuera de un repositorio"
+msgstr "'%s' fuera de un repositorio"
#, c-format
msgid "Cannot prepare timestamp regexp %s"
@@ -836,7 +864,7 @@ msgstr "parche corrupto en la línea %d"
#, c-format
msgid "new file %s depends on old contents"
-msgstr "nuevo archivo %s depende en contenidos viejos"
+msgstr "nuevo archivo %s depende de contenidos viejos"
#, c-format
msgid "deleted file %s still has contents"
@@ -844,7 +872,7 @@ msgstr "el archivo borrado %s todavía tiene contenido"
#, c-format
msgid "** warning: file %s becomes empty but is not deleted"
-msgstr "** peligro: el archivo %s está vacío pero no es borrado"
+msgstr "** advertencia: el archivo %s se volverá vacío pero no se borrará"
#, c-format
msgid "corrupt binary patch at line %d: %.*s"
@@ -1113,7 +1141,7 @@ msgid "Skipped patch '%s'."
msgstr "Parche '%s' saltado."
msgid "No valid patches in input (allow with \"--allow-empty\")"
-msgstr ""
+msgstr "No hay parches válidos en la entrada (permitir con \"--allow-empty\")"
msgid "unable to read index file"
msgstr "no es posible leer el archivo índice"
@@ -1240,7 +1268,7 @@ msgid "prepend <root> to all filenames"
msgstr "anteponer <root> a todos los nombres de archivos"
msgid "don't return error for empty patches"
-msgstr ""
+msgstr "no devolver error por parches vacíos"
#, c-format
msgid "cannot stream blob %s"
@@ -1251,6 +1279,10 @@ msgid "unsupported file mode: 0%o (SHA1: %s)"
msgstr "modo de archivo no soportado: 0%o (SHA1: %s)"
#, c-format
+msgid "deflate error (%d)"
+msgstr "error al desinflar (%d)"
+
+#, c-format
msgid "unable to start '%s' filter"
msgstr "no se puede comenzar filtro '%s'"
@@ -1270,21 +1302,17 @@ msgid "path too long (%d chars, SHA1: %s): %s"
msgstr "ruta demasiada larga (%d chars, SHA1: %s): %s"
#, c-format
-msgid "deflate error (%d)"
-msgstr "error al desinflar (%d)"
-
-#, c-format
msgid "timestamp too large for this system: %<PRIuMAX>"
msgstr "timestamp demasiado grande para este sistema: %<PRIuMAX>"
msgid "git archive [<options>] <tree-ish> [<path>...]"
-msgstr "git archive [<opciones>] <parte-del-árbol> [<ruta>...]"
+msgstr "git archive [<opciones>] <árbol-ismo> [<ruta>...]"
msgid ""
"git archive --remote <repo> [--exec <cmd>] [<options>] <tree-ish> [<path>...]"
msgstr ""
-"git archive --remote <repo> [--exec <comando> ] [<opciones>] <parte-del-"
-"árbol> [<ruta>...]"
+"git archive --remote <repositorio> [--exec <comando> ] [<opciones>] <árbol-"
+"ismo> [<ruta>...]"
msgid "git archive --remote <repo> [--exec <cmd>] --list"
msgstr "git archive --remote <repo> [--exec <comando>] --list"
@@ -1320,17 +1348,17 @@ msgstr "Archivo no encontrado: %s"
msgid "Not a regular file: %s"
msgstr "No es un archivo regular: %s"
-#, fuzzy, c-format
+#, c-format
msgid "unclosed quote: '%s'"
-msgstr "comillas incompletas"
+msgstr "comilla sin pareja: '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "missing colon: '%s'"
-msgstr "valor faltante para '%s'"
+msgstr "falta un colon: '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "empty file name: '%s'"
-msgstr "mbox vacío: '%s'"
+msgstr "nombre vacío de archivo: '%s'"
msgid "fmt"
msgstr "fmt"
@@ -1350,9 +1378,8 @@ msgstr "archivo"
msgid "add untracked file to archive"
msgstr "incluir archivos sin seguimiento a la crónica"
-#, fuzzy
msgid "path:content"
-msgstr "contenido"
+msgstr "ruta:contenido"
msgid "write the archive to this file"
msgstr "escribe la crónica en este archivo"
@@ -1384,9 +1411,9 @@ msgstr "ruta para el comando git-upload-archive remoto"
msgid "Unexpected option --remote"
msgstr "Opción inesperada --remote"
-#, fuzzy, c-format
+#, c-format
msgid "the option '%s' requires '%s'"
-msgstr "opción `%s' requiere un valor"
+msgstr "la opción `%s' requiere '%s'"
msgid "Unexpected option --output"
msgstr "Opción inesperada --output"
@@ -1548,68 +1575,64 @@ msgid ""
"cannot inherit upstream tracking configuration of multiple refs when "
"rebasing is requested"
msgstr ""
+"no se puede heredar la configuración de rastreo upstream de múltiples "
+"referencias cuando se pide rebasar"
-#, fuzzy, c-format
+#, c-format
msgid "not setting branch '%s' as its own upstream"
-msgstr "La rama %s no se configura como su propio upstream."
+msgstr "no configurando la rama %s como su propio upstream"
-#, fuzzy, c-format
+#, c-format
msgid "branch '%s' set up to track '%s' by rebasing."
-msgstr ""
-"Rama '%s' configurada para hacer seguimiento a la referencia local '%s' por "
-"rebase."
+msgstr "rama '%s' configurada para rastrear '%s' por rebase."
-#, fuzzy, c-format
+#, c-format
msgid "branch '%s' set up to track '%s'."
-msgstr ""
-"Rama '%s' configurada para hacer seguimiento a la referencia local '%s'."
+msgstr "rama '%s' configurada para rastrear '%s'."
-#, fuzzy, c-format
+#, c-format
msgid "branch '%s' set up to track:"
-msgstr ""
-"Rama '%s' configurada para hacer seguimiento a la referencia local '%s'."
+msgstr "rama '%s' configurada para rastrear:"
-#, fuzzy
msgid "unable to write upstream branch configuration"
-msgstr "No es posible escribir la configuración de la rama upstream"
+msgstr "no es posible escribir la configuración de la rama upstream"
-#, fuzzy
msgid ""
"\n"
"After fixing the error cause you may try to fix up\n"
"the remote tracking information by invoking:"
msgstr ""
"\n"
-"Tras arreglar la causa del error puedes intentar arreglar\n"
-"la información del rastreo remoto invocando\n"
-"\"git branch --set-upstream-to=%s%s%s\"."
+"Tras arreglar la causa del error puedes intentar\n"
+"arreglar la información de rastreo remoto invocando:"
#, c-format
msgid "asked to inherit tracking from '%s', but no remote is set"
msgstr ""
+"se pidió heredar el rastreo de '%s', pero no se ha configurado ningún remoto"
#, c-format
msgid "asked to inherit tracking from '%s', but no merge configuration is set"
msgstr ""
+"se pidió heredar el rastreo de '%s', pero no se ha configurado ninguna "
+"configuración de fusión"
-#, fuzzy, c-format
+#, c-format
msgid "not tracking: ambiguous information for ref '%s'"
-msgstr "No rastreando: información ambigua para la referencia %s"
+msgstr "no rastreando: información ambigua para la referencia '%s'"
-#. #-#-#-#-# branch.c.po #-#-#-#-#
#. TRANSLATORS: This is a line listing a remote with duplicate
#. refspecs in the advice message below. For RTL languages you'll
#. probably want to swap the "%s" and leading " " space around.
#.
-#. #-#-#-#-# object-name.c.po #-#-#-#-#
#. TRANSLATORS: This is line item of ambiguous object output
#. from describe_ambiguous_object() above. For RTL languages
#. you'll probably want to swap the "%s" and leading " " space
#. around.
#.
-#, fuzzy, c-format
+#, c-format
msgid " %s\n"
-msgstr " %s"
+msgstr " %s\n"
#. TRANSLATORS: The second argument is a \n-delimited list of
#. duplicate refspecs, composed above.
@@ -1625,24 +1648,34 @@ msgid ""
"different remotes' fetch refspecs map into different\n"
"tracking namespaces."
msgstr ""
+"Hay múltiples remotos cuyas especificaciones de referencia de\n"
+"fetch corresponden a la referencia de rastreo remoto '%s':\n"
+"%s\n"
+"Esto es típicamente un error de configuración.\n"
+"\n"
+"Para soportar configuración de ramas que rastrean, asegura que\n"
+"las especificationes de referencia de fetch de remotos distintos\n"
+"mapeen a espacios de nombres de rastreo distintos."
-#, fuzzy, c-format
+#, c-format
msgid "'%s' is not a valid branch name"
-msgstr "'%s' no es un nombre válido de rama."
+msgstr "'%s' no es un nombre válido de rama"
-#, fuzzy, c-format
+#, c-format
msgid "a branch named '%s' already exists"
-msgstr "Una rama llamada '%s' ya existe."
+msgstr "una rama llamada '%s' ya existe"
-#, fuzzy, c-format
+#, c-format
msgid "cannot force update the branch '%s' checked out at '%s'"
-msgstr "No se puede borrar rama '%s' que cuenta con checkout en '%s'"
+msgstr ""
+"no se puede actualizar la rama '%s' a la fuerza que cuenta con checkout en "
+"'%s'"
-#, fuzzy, c-format
+#, c-format
msgid "cannot set up tracking information; starting point '%s' is not a branch"
msgstr ""
-"No se puede configurar el rastreo de información; el punto de partida '%s' "
-"no es una rama."
+"no se puede configurar la información de rastreo; el punto de partida '%s' "
+"no es una rama"
#, c-format
msgid "the requested upstream branch '%s' does not exist"
@@ -1672,27 +1705,29 @@ msgstr ""
msgid "not a valid object name: '%s'"
msgstr "nombre de objeto no válido: '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "ambiguous object name: '%s'"
-msgstr "Nombre de objeto ambiguo: '%s'."
+msgstr "nombre de objeto ambiguo: '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "not a valid branch point: '%s'"
-msgstr "Punto de rama no válido: '%s'."
+msgstr "punto de bifurcación no válido: '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "submodule '%s': unable to find submodule"
-msgstr "submódulo '%s' tiene un índice corrupto"
+msgstr "submódulo '%s': incapaz de encontrar el submódulo"
#, c-format
msgid ""
"You may try updating the submodules using 'git checkout %s && git submodule "
"update --init'"
msgstr ""
+"Se puede intentar actualizar los submódulos usando 'git checkout %s && git "
+"submodule update --init'"
-#, fuzzy, c-format
+#, c-format
msgid "submodule '%s': cannot create branch '%s'"
-msgstr "submódulo '%s' no puede agregar alterno: %s"
+msgstr "submódulo '%s': no se puede crear la rama '%s'"
#, c-format
msgid "'%s' is already checked out at '%s'"
@@ -1850,9 +1885,10 @@ msgstr "falló al agregar archivos"
msgid "--chmod param '%s' must be either -x or +x"
msgstr "El parámetro '%s' para --chmod debe ser -x o +x"
-#, fuzzy, c-format
+#, c-format
msgid "'%s' and pathspec arguments cannot be used together"
-msgstr "-x y -X no pueden ser usadas juntas"
+msgstr ""
+"'%s' y los argumentos de especificación de ruta no pueden ser usados juntos"
#, c-format
msgid "Nothing specified, nothing added.\n"
@@ -1874,9 +1910,9 @@ msgstr "archivo índice corrompido"
msgid "bad action '%s' for '%s'"
msgstr "mala acción '%s' para '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "invalid value for '%s': '%s'"
-msgstr "valor inválido para %s: %s"
+msgstr "valor inválido para '%s': '%s'"
#, c-format
msgid "could not read '%s'"
@@ -1946,10 +1982,11 @@ msgstr "Cuando hayas resuelto este problema, ejecuta \"%s --continue\"."
msgid "If you prefer to skip this patch, run \"%s --skip\" instead."
msgstr "Si prefieres saltar este parche, ejecuta \"%s --skip\"."
-#, fuzzy, c-format
+#, c-format
msgid "To record the empty patch as an empty commit, run \"%s --allow-empty\"."
msgstr ""
-"Para restaurar la rama original y detener el parcheo, ejecuta \"%s --abort\"."
+"Para registrar el parche vacío como un commit vacío, ejecuta \"%s --allow-"
+"empty\"."
#, c-format
msgid "To restore the original branch and stop patching, run \"%s --abort\"."
@@ -2025,13 +2062,13 @@ msgstr "no es posible escribir el archivo índice"
msgid "Dirty index: cannot apply patches (dirty: %s)"
msgstr "Ãndice sucio: no se puede aplicar parches (sucio: %s)"
-#, fuzzy, c-format
+#, c-format
msgid "Skipping: %.*s"
-msgstr "Aplicando: %.*s"
+msgstr "Saltando: %.*s"
-#, fuzzy, c-format
+#, c-format
msgid "Creating an empty commit: %.*s"
-msgstr "mantener commits redundantes, vacíos"
+msgstr "Creando un commit vacío: %.*s"
msgid "Patch is empty."
msgstr "El parche está vacío."
@@ -2050,9 +2087,8 @@ msgstr "El parche falló en %s %.*s"
msgid "Use 'git am --show-current-patch=diff' to see the failed patch"
msgstr "Usa 'git am --show-current-patch=diff' para ver el parche fallido"
-#, fuzzy
msgid "No changes - recorded it as an empty commit."
-msgstr "no se agregaron cambios al commit\n"
+msgstr "Sin cambios - se ha registrado como un commit vacío."
msgid ""
"No changes - did you forget to use 'git add'?\n"
@@ -2096,9 +2132,9 @@ msgstr ""
msgid "failed to read '%s'"
msgstr "falló al leer '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "options '%s=%s' and '%s=%s' cannot be used together"
-msgstr "Opciones --squash y --fixup no pueden ser usadas juntas"
+msgstr "las opciones '%s=%s' y '%s=%s' no pueden ser usadas juntas"
msgid "git am [<options>] [(<mbox> | <Maildir>)...]"
msgstr "git am [<opciones>] [(<mbox> | <Directorio-de-correo>)...]"
@@ -2180,7 +2216,7 @@ msgid "show the patch being applied"
msgstr "mostrar el parche siendo aplicado"
msgid "record the empty patch as an empty commit"
-msgstr ""
+msgstr "registrar el parche vacío como un commit vacío"
msgid "lie about committer date"
msgstr "mentir sobre la fecha del committer"
@@ -2194,9 +2230,8 @@ msgstr "key-id"
msgid "GPG-sign commits"
msgstr "firmar los commits con GPG"
-#, fuzzy
msgid "how to handle empty patches"
-msgstr "mostrar el parche actual"
+msgstr "cómo manejar parches vacíos"
msgid "(internal use for git-rebase)"
msgstr "(uso interno para git-rebase)"
@@ -2366,16 +2401,16 @@ msgid "Are you sure [Y/n]? "
msgstr "¿Estás seguro [Y/n]? "
msgid "status: waiting for both good and bad commits\n"
-msgstr ""
+msgstr "estado: esperando ambos commits buenos y malos\n"
#, c-format
msgid "status: waiting for bad commit, %d good commit known\n"
msgid_plural "status: waiting for bad commit, %d good commits known\n"
-msgstr[0] ""
-msgstr[1] ""
+msgstr[0] "estado: esperando commit malo, %d commit bueno conocido\n"
+msgstr[1] "estado: esperando commit malo, %d commits buenos conocidos\n"
msgid "status: waiting for good commit(s), bad commit known\n"
-msgstr ""
+msgstr "estado: esperando commit bueno, commit malo conocido\n"
msgid "no terms defined"
msgstr "no hay términos definidos"
@@ -2475,13 +2510,13 @@ msgstr "ejecutando %s\n"
msgid "bisect run failed: no command provided."
msgstr "bisect falló: no se proveyó comando."
-#, fuzzy, c-format
+#, c-format
msgid "unable to verify '%s' on good revision"
-msgstr "no es posible escribir el archivo '%s' modo %o"
+msgstr "no se puede verificar '%s' en la revisión buena"
#, c-format
msgid "bogus exit code %d for good revision"
-msgstr ""
+msgstr "código de salida malogrado %d de la revisión buena"
#, c-format
msgid "bisect run failed: exit code %d from '%s' is < 0 or >= 128"
@@ -2540,9 +2575,8 @@ msgstr "saltar algunos commits para checkout"
msgid "visualize the bisection"
msgstr "visualizar bisección"
-#, fuzzy
msgid "use <cmd>... to automatically bisect"
-msgstr "use <cmd>... para aplicar bisección automática."
+msgstr "usa <cmd>... para bisecar automáticamente"
msgid "no log for BISECT_WRITE"
msgstr "no hay log para BISECT_WRITE"
@@ -2695,15 +2729,15 @@ msgstr "Blaming a líneas"
msgid "git branch [<options>] [-r | -a] [--merged] [--no-merged]"
msgstr "git branch [<opciones>] [-r | -a] [--merged] [--no-merged]"
-#, fuzzy
msgid ""
"git branch [<options>] [-f] [--recurse-submodules] <branch-name> [<start-"
"point>]"
-msgstr "git branch [<opciones>] [-l] [-f] <nombre-de-rama> [<punto-inicial>]"
+msgstr ""
+"git branch [<opciones>] [-l] [-f] [--recurse-submodules] <nombre-de-rama> "
+"[<punto-de-partida>]"
-#, fuzzy
msgid "git branch [<options>] [-l] [<pattern>...]"
-msgstr "git for-each-ref [<opciones>] [<patrón>]"
+msgstr "git branch [<opciones>] [-l] [<patrón>...]"
msgid "git branch [<options>] [-r] (-d | -D) <branch-name>..."
msgstr "git branch [<opciones>] [-r] (-d | -D) <nombre-de-rama>..."
@@ -2852,9 +2886,8 @@ msgstr "mostrar hash y tema, dar dos veces para rama upstream"
msgid "suppress informational messages"
msgstr "suprimir mensajes informativos"
-#, fuzzy
msgid "set branch tracking configuration"
-msgstr "mostrar información de la rama"
+msgstr "configurar rastreo de rama"
msgid "do not use"
msgstr "no usar"
@@ -2953,9 +2986,11 @@ msgid ""
"branch with --recurse-submodules can only be used if submodule."
"propagateBranches is enabled"
msgstr ""
+"branch con --recurse-submodules solo se puede usar si submodule."
+"propagateBranches está habilitado"
msgid "--recurse-submodules can only be used to create branches"
-msgstr ""
+msgstr "--recurse-submodules solo se puede usar para crear ramas"
msgid "branch name required"
msgstr "se necesita el nombre de la rama"
@@ -3040,9 +3075,12 @@ msgstr "información de libc: "
msgid "not run from a git repository - no hooks to show\n"
msgstr "no ejecutado desde un repositorio git - no hay hooks para mostrar\n"
-msgid "git bugreport [-o|--output-directory <file>] [-s|--suffix <format>]"
+msgid ""
+"git bugreport [-o|--output-directory <file>] [-s|--suffix <format>] [--"
+"diagnose[=<mode>]"
msgstr ""
-"git bugreport [-o|--output-directory <archivo>] [-s|--suffix <formato>]"
+"git bugreport [-o|--output-directory <archivo>] [-s|--suffix <formato>] [--"
+"diagnose[=<modo>]"
msgid ""
"Thank you for filling out a Git bug report!\n"
@@ -3079,17 +3117,30 @@ msgstr ""
"Por favor revisa el resto del reporte abajo.\n"
"Puedes borrar cualquier línea que no desees compartir.\n"
-msgid "specify a destination for the bugreport file"
-msgstr "especificar el destino para el archivo de reporte de bug"
+msgid "mode"
+msgstr "modo"
-msgid "specify a strftime format suffix for the filename"
+msgid ""
+"create an additional zip archive of detailed diagnostics (default 'stats')"
msgstr ""
-"especificar el sufijo de formato de strftime para el nombre del archivo"
+"crear una crónica zip adicional con diagnósticos detallados (por defecto "
+"'stats')"
+
+msgid "specify a destination for the bugreport file(s)"
+msgstr "especificar un destino para los archivos de reporte de bug"
+
+msgid "specify a strftime format suffix for the filename(s)"
+msgstr ""
+"especificar un sufijo de formato de strftime para los nombres de los archivos"
#, c-format
msgid "could not create leading directories for '%s'"
msgstr "no se pudo crear directorios principales para '%s'"
+#, c-format
+msgid "unable to create diagnostics archive %s"
+msgstr "no se puede crear la crónica diagnóstica %s"
+
msgid "System Info"
msgstr "Información del sistema"
@@ -3148,83 +3199,76 @@ msgid "Unbundling objects"
msgstr "Desagrupando objetos"
#, c-format
-msgid "Unknown subcommand: %s"
-msgstr "Sub-comando desconocido: %s"
-
-#, c-format
msgid "cannot read object %s '%s'"
msgstr "no se puede leer el objeto %s '%s'"
msgid "flush is only for --buffer mode"
-msgstr ""
+msgstr "flush solo es para el modo --buffer"
-#, fuzzy
msgid "empty command in input"
-msgstr "comando exec vacío"
+msgstr "comando vacío en la entrada"
-#, fuzzy, c-format
+#, c-format
msgid "whitespace before command: '%s'"
-msgstr "editar mensaje antes de realizar commit"
+msgstr "espacio en blanco antes del comando: '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "%s requires arguments"
-msgstr "-n requiere un argumento"
+msgstr "%s requiere argumentos"
-#, fuzzy, c-format
+#, c-format
msgid "%s takes no arguments"
-msgstr "%s no toma valores"
+msgstr "%s no toma argumentos"
-#, fuzzy, c-format
+#, c-format
msgid "unknown command: '%s'"
-msgstr "comando desconocido: %d"
+msgstr "comando desconocido: '%s'"
msgid "only one batch option may be specified"
msgstr "solo se puede especificar una opción batch"
-#, fuzzy
msgid "git cat-file <type> <object>"
-msgstr "git notes edit [<objeto>]"
+msgstr "git cat-file <tipo> <objeto>"
-#, fuzzy
msgid "git cat-file (-e | -p) <object>"
-msgstr "git notes edit [<objeto>]"
+msgstr "git cat-file (-e | -p) <objeto>"
msgid "git cat-file (-t | -s) [--allow-unknown-type] <object>"
-msgstr ""
+msgstr "git cat-file (-t | -s) [--allow-unknown-type] <objeto>"
-#, fuzzy
msgid ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
" [--textconv | --filters]"
msgstr ""
-"git cat-file (--batch[=<formato>] | --batch-check[=<formato>]) [--follow-"
-"symlinks] [--textconv | --filters]"
+"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
+"objects]\n"
+" [--buffer] [--follow-symlinks] [--unordered]\n"
+" [--textconv | --filters]"
msgid ""
"git cat-file (--textconv | --filters)\n"
" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
msgstr ""
+"git cat-file (--textconv | --filters)\n"
+" [<revisión>:<ruta|árbol-ismo> | --path=<ruta|árbol-ismo> "
+"<revisión>]"
-#, fuzzy
msgid "Check object existence or emit object contents"
-msgstr "para objetos blob, ejecuta textconv en el contenido del objeto"
+msgstr "Comprobar la existencia de un objeto o emitir el contenido del objeto"
-#, fuzzy
msgid "check if <object> exists"
-msgstr "Revisando objetos"
+msgstr "comprobar si <objeto> existe"
-#, fuzzy
msgid "pretty-print <object> content"
-msgstr "realizar pretty-print del contenido del objeto"
+msgstr "realizar pretty-print del contenido de <objeto>"
msgid "Emit [broken] object attributes"
-msgstr ""
+msgstr "Emitir atributos de objeto [broken]"
-#, fuzzy
msgid "show object type (one of 'blob', 'tree', 'commit', 'tag', ...)"
-msgstr "<tipo> puede ser: blob, tree, commit, tag"
+msgstr "mostrar tipo de objeto (uno de 'blob', 'tree', 'commit', 'tag' ...)"
msgid "show object size"
msgstr "mostrar el tamaño del objeto"
@@ -3232,91 +3276,91 @@ msgstr "mostrar el tamaño del objeto"
msgid "allow -s and -t to work with broken/corrupt objects"
msgstr "permita que -s y -t funcionen con objetos rotos o corruptos"
+msgid "use mail map file"
+msgstr "usar archivo de mapa de correo"
+
msgid "Batch objects requested on stdin (or --batch-all-objects)"
-msgstr ""
+msgstr "Hacer batch a los objecos solicitados en stdin (o --batch-all-objects)"
msgid "show full <object> or <rev> contents"
-msgstr ""
+msgstr "mostrar el contenido completo de <objeto> o <revisión>"
msgid "like --batch, but don't emit <contents>"
-msgstr ""
+msgstr "como --batch, pero no emitir <contenido>"
+
+msgid "stdin is NUL-terminated"
+msgstr "stdin es terminada con NUL"
-#, fuzzy
msgid "read commands from stdin"
-msgstr "leer packs de stdin"
+msgstr "leer comandos de stdin"
msgid "with --batch[-check]: ignores stdin, batches all known objects"
msgstr ""
+"con --batch[-check]: ignora stdin, hace batch a todos los objetos conocidos"
msgid "Change or optimize batch output"
-msgstr ""
+msgstr "Cambia o optimiza la salida de batch"
msgid "buffer --batch output"
msgstr "salida buffer --batch"
-#, fuzzy
msgid "follow in-tree symlinks"
-msgstr "no se pudo leer el symlink %s"
+msgstr "seguir symlinks en el árbol"
-#, fuzzy
msgid "do not order objects before emitting them"
-msgstr "no se pudo leer el objeto %s para el symlink %s"
+msgstr "no ordenar objetos antes de emitirlos"
msgid ""
"Emit object (blob or tree) with conversion or filter (stand-alone, or with "
"batch)"
msgstr ""
+"Emitir objeto (blob o árbol) con conversión o filtro (independiente, o con "
+"batch)"
-#, fuzzy
msgid "run textconv on object's content"
-msgstr "para objetos blob, ejecuta textconv en el contenido del objeto"
+msgstr "ejecuta textconv en el contenido del objeto"
-#, fuzzy
msgid "run filters on object's content"
-msgstr "para objetos blob, ejecuta filters en el contenido del objeto"
+msgstr "ejecuta filtros en el contenido del objeto"
-#, fuzzy
msgid "blob|tree"
-msgstr "blob"
+msgstr "blob|árbol"
-#, fuzzy
msgid "use a <path> for (--textconv | --filters); Not with 'batch'"
-msgstr "usar una ruta específica para --textconv/--filters"
+msgstr "usar una <ruta> para (--textconv | --filters); No con 'batch'"
#, c-format
msgid "'%s=<%s>' needs '%s' or '%s'"
-msgstr ""
+msgstr "'%s=<%s>' necesita '%s' o '%s'"
-#, fuzzy
msgid "path|tree-ish"
-msgstr "árbol-ismo"
+msgstr "ruta|árbol-ismo"
-#, fuzzy, c-format
+#, c-format
msgid "'%s' requires a batch mode"
-msgstr "%s requiere un valor"
+msgstr "'%s' requiere un modo de batch"
-#, fuzzy, c-format
+#, c-format
msgid "'-%c' is incompatible with batch mode"
-msgstr "%s es incompatible con %s"
+msgstr "'-%c' es incompatible con el modo de batch"
-#, fuzzy
msgid "batch modes take no arguments"
-msgstr "esta opción no requiere argumentos"
+msgstr "los modos de batch no toman argumentos"
#, c-format
msgid "<rev> required with '%s'"
-msgstr ""
+msgstr "se requiere <revisión> con '%s'"
#, c-format
msgid "<object> required with '-%c'"
-msgstr ""
+msgstr "<objeto> requerido con '-%c'"
msgid "too many arguments"
msgstr "demasiados argumentos"
#, c-format
msgid "only two arguments allowed in <type> <object> mode, not %d"
-msgstr ""
+msgstr "solo se permiten dos argumentos en modo de <objeto> de <tipo>, no %d"
msgid "git check-attr [-a | --all | <attr>...] [--] <pathname>..."
msgstr "git check-attr [-a | --all | <attr>...] [--] <nombre-de-ruta>..."
@@ -3395,7 +3439,7 @@ msgid "check out all files in the index"
msgstr "revisar todos los archivos en el índice"
msgid "do not skip files with skip-worktree set"
-msgstr ""
+msgstr "no saltar archivos con skip-worktree configurado"
msgid "force overwrite of existing files"
msgstr "forzar sobreescritura de los archivos existentes"
@@ -3555,12 +3599,12 @@ msgid_plural ""
"\n"
"%s\n"
msgstr[0] ""
-"Peligro: estás dejando %d commit atrás, no está conectado\n"
+"Advertencia: estás dejando %d commit atrás, no está conectado\n"
"a ninguna rama:\n"
"\n"
"%s\n"
msgstr[1] ""
-"Peligro: estás dejando %d commits atrás, no están conectados\n"
+"Advertencia: estás dejando %d commits atrás, no están conectados\n"
"a ninguna rama:\n"
"\n"
"%s\n"
@@ -3618,7 +3662,7 @@ msgid ""
"one remote, e.g. the 'origin' remote, consider setting\n"
"checkout.defaultRemote=origin in your config."
msgstr ""
-"Si querías hacer un check out a una rama rastreada remota, como 'origin',\n"
+"Si querías hacer un check out a una rama remota rastreada, como 'origin',\n"
"puedes hacerlo proporcionando el nombre completo con la opción --track:\n"
"\n"
" git checkout --track origin/<nombre>\n"
@@ -3665,6 +3709,8 @@ msgstr "se espera una rama, se obtuvo commit '%s'"
msgid ""
"If you want to detach HEAD at the commit, try again with the --detach option."
msgstr ""
+"Si quieres desacoplar HEAD al commit, intenta de nuevo con la opción --"
+"detach."
msgid ""
"cannot switch branch while merging\n"
@@ -3732,9 +3778,8 @@ msgstr "realizar una fusión de tres vías con la rama nueva"
msgid "style"
msgstr "estilo"
-#, fuzzy
msgid "conflict style (merge, diff3, or zdiff3)"
-msgstr "estilo de conflictos (merge o diff3)"
+msgstr "estilo de conflictos (merge, diff3 o zdiff3)"
msgid "detach HEAD at named commit"
msgstr "desacoplar HEAD en el commit nombrado"
@@ -3763,9 +3808,9 @@ msgstr "hacer checkout a su versión para los archivos sin fusionar"
msgid "do not limit pathspecs to sparse entries only"
msgstr "no limitar pathspecs a entradas escasas solamente"
-#, fuzzy, c-format
+#, c-format
msgid "options '-%c', '-%c', and '%s' cannot be used together"
-msgstr "Opciones --squash y --fixup no pueden ser usadas juntas"
+msgstr "las opciones '-%c', '-%c' y '%s' no pueden ser usadas juntas"
msgid "--track needs a branch name"
msgstr "--track necesita el nombre de una rama"
@@ -3873,13 +3918,11 @@ msgstr "falló al borrar %s"
msgid "could not lstat %s\n"
msgstr "no se pudo lstat %s\n"
-#, fuzzy
msgid "Refusing to remove current working directory\n"
-msgstr "no es posible obtener el directorio de trabajo actual"
+msgstr "Rehusando eliminar el directorio de trabajo actual\n"
-#, fuzzy
msgid "Would refuse to remove current working directory\n"
-msgstr "no es posible obtener el directorio de trabajo actual"
+msgstr "Se rehusaría eliminar el directorio de trabajo actual\n"
#, c-format
msgid ""
@@ -3923,7 +3966,7 @@ msgstr "Ingresa los patrones que ignorar>> "
#, c-format
msgid "WARNING: Cannot find items matched by: %s"
-msgstr "PELIGRO: No se puede encontrar objetos que concuerden con: %s"
+msgstr "ADVERTENCIA: No se puede encontrar objetos que concuerden con: %s"
msgid "Select items to delete"
msgstr "Seleccionar objetos para borrar"
@@ -4108,7 +4151,7 @@ msgid "use IPv6 addresses only"
msgstr "solo usar direcciones IPv6"
msgid "apply partial clone filters to submodules"
-msgstr ""
+msgstr "aplicar filtros de clonación parcial a los submódulos"
msgid "any cloned submodules will use their remote-tracking branch"
msgstr "cualquier submódulo clonado usará su branch de rastreo remoto"
@@ -4117,6 +4160,13 @@ msgid "initialize sparse-checkout file to include only files at root"
msgstr ""
"inicializar archivo sparse-checkout para incluir solo archivos en la raíz"
+msgid "uri"
+msgstr "uri"
+
+msgid "a URI for downloading bundles before fetching from origin remote"
+msgstr ""
+"un URI para descargar bundles antes de hacer fetch del remoto de origen"
+
#, c-format
msgid "info: Could not add alternate for '%s': %s\n"
msgstr "info: No se pudo agregar un alterno para '%s': %s\n"
@@ -4176,9 +4226,10 @@ msgstr "incapaz de actualizar %s"
msgid "failed to initialize sparse-checkout"
msgstr "falló al inicializar sparse-checkout"
-msgid "remote HEAD refers to nonexistent ref, unable to checkout.\n"
+msgid "remote HEAD refers to nonexistent ref, unable to checkout"
msgstr ""
-"remoto HEAD refiere a un ref inexistente, no se puede hacer checkout.\n"
+"la HEAD remota refiere a una referencia inexistente, no se puede hacer "
+"checkout"
msgid "unable to checkout working tree"
msgstr "no es posible realizar checkout en el árbol de trabajo"
@@ -4198,9 +4249,15 @@ msgstr "Demasiados argumentos."
msgid "You must specify a repository to clone."
msgstr "Tienes que especificar un repositorio para clonar."
-#, fuzzy, c-format
+#, c-format
msgid "options '%s' and '%s %s' cannot be used together"
-msgstr "Opciones --squash y --fixup no pueden ser usadas juntas"
+msgstr "las opciones '%s' y '%s %s' no pueden ser usadas juntas"
+
+msgid ""
+"--bundle-uri is incompatible with --depth, --shallow-since, and --shallow-"
+"exclude"
+msgstr ""
+"--bundle-uri es incompatible con --depth, --shallow-since y --shallow-exclude"
#, c-format
msgid "repository '%s' does not exist"
@@ -4274,7 +4331,14 @@ msgid "--local is ignored"
msgstr "--local es ignorado"
msgid "cannot clone from filtered bundle"
-msgstr ""
+msgstr "no se puede clonar de un bundle filtrado"
+
+msgid "failed to initialize the repo, skipping bundle URI"
+msgstr "falló al inicializar el repositorio, saltando el URI de bundle"
+
+#, c-format
+msgid "failed to fetch objects from bundle URI '%s'"
+msgstr "falló al hacer fetch de objetos del URI de bundle '%s'"
msgid "remote transport reported error"
msgstr "transporte remoto reportó error"
@@ -4389,10 +4453,6 @@ msgstr "usa como máximo uno de --reachable, --stdin-commits, o --stdin-packs"
msgid "Collecting commits from input"
msgstr "Recolectando commits del input"
-#, c-format
-msgid "unrecognized subcommand: %s"
-msgstr "subcomando desconocido: %s"
-
msgid ""
"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...] [(-F "
"<file>)...] <tree>"
@@ -4569,9 +4629,9 @@ msgstr "no se pudo leer log desde standard input"
msgid "could not read log file '%s'"
msgstr "no se pudo leer el log '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "options '%s' and '%s:%s' cannot be used together"
-msgstr "Opciones --squash y --fixup no pueden ser usadas juntas"
+msgstr "las opciones '%s' y '%s:%s' no pueden ser usadas juntas"
msgid "could not read SQUASH_MSG"
msgstr "no se pudo leer SQUASH_MSG"
@@ -4694,13 +4754,13 @@ msgstr "Estás en medio de una fusión -- no se puede refrasear."
msgid "You are in the middle of a cherry-pick -- cannot reword."
msgstr "Estás en medio de un cherry-pick -- no se puede refrasear."
-#, fuzzy, c-format
+#, c-format
msgid "reword option of '%s' and path '%s' cannot be used together"
-msgstr "Opciones --squash y --fixup no pueden ser usadas juntas"
+msgstr "la opción reword de '%s' y la ruta '%s' no pueden ser usadas juntas"
-#, fuzzy, c-format
+#, c-format
msgid "reword option of '%s' and '%s' cannot be used together"
-msgstr "Opciones --squash y --fixup no pueden ser usadas juntas"
+msgstr "la opción reword de '%s' y '%s' no pueden ser usadas juntas"
msgid "You have nothing to amend."
msgstr "No tienes nada que enmendar."
@@ -4749,9 +4809,6 @@ msgstr "mostrar status en formato largo (default)"
msgid "terminate entries with NUL"
msgstr "terminar entradas con NUL"
-msgid "mode"
-msgstr "modo"
-
msgid "show untracked files, optional modes: all, normal, no. (Default: all)"
msgstr ""
"mostrar archivos sin seguimiento, modos opcionales: all, normal, no. "
@@ -5342,9 +5399,26 @@ msgstr "adjuntar <marca> en un árbol de trabajo roto (default: \"-broken\")"
msgid "No names found, cannot describe anything."
msgstr "No se encontraron nombres, no se puede describir nada."
-#, fuzzy, c-format
+#, c-format
msgid "option '%s' and commit-ishes cannot be used together"
-msgstr "Opciones --squash y --fixup no pueden ser usadas juntas"
+msgstr "la opción '%s' y los commit-ismos no pueden ser usados juntos"
+
+msgid ""
+"git diagnose [-o|--output-directory <path>] [-s|--suffix <format>] [--"
+"mode=<mode>]"
+msgstr ""
+"git diagnose [-o|--output-directory <ruta>] [-s|--suffix <formato>] [--"
+"mode=<modo>]"
+
+msgid "specify a destination for the diagnostics archive"
+msgstr "especificar un destino para la crónica diagnóstica"
+
+msgid "specify a strftime format suffix for the filename"
+msgstr ""
+"especificar el sufijo de formato de strftime para el nombre del archivo"
+
+msgid "specify the content of the diagnostic archive"
+msgstr "especificar el contenido de la crónica diagnóstica"
msgid "--merge-base only works with two commits"
msgstr "--merge-base solo funciona con dos commits"
@@ -5488,9 +5562,8 @@ msgid ""
msgstr ""
"opción `--default' espera un valor unsigned long con `--type=ulong`, no `%s`"
-#, fuzzy
msgid "git fast-export [<rev-list-opts>]"
-msgstr "git fast-export [rev-list-opts]"
+msgstr "git fast-export [<opciones-de-rev-list>]"
msgid "Error: Cannot export nested tags unless --mark-tags is specified."
msgstr ""
@@ -5669,7 +5742,7 @@ msgid "convert to a complete repository"
msgstr "convertir a un repositorio completo"
msgid "re-fetch without negotiating common commits"
-msgstr ""
+msgstr "hacer fetch de nuevo sin negociar commits en común"
msgid "prepend this to submodule path output"
msgstr "anteponer esto a la salida de ruta del submódulo"
@@ -5688,15 +5761,15 @@ msgid "refmap"
msgstr "refmap"
msgid "specify fetch refmap"
-msgstr "especificar extracción de refmap"
+msgstr "especificar el mapa de referencias de fetch"
msgid "report that we have only objects reachable from this object"
msgstr "reportar que solo tenemos objetos alcanzables de este objeto"
msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
msgstr ""
-"no realizar fetch al packfile; en lugar de eso, mostrar los ancestros de las "
-"puntas de negociación"
+"no realizar fetch de un archivo de pack; en lugar de eso, mostrar los "
+"ancestros de las puntas de negociación"
msgid "run 'maintenance --auto' after fetching"
msgstr "ejecutar 'maintenance --auto' después de buscar"
@@ -5710,9 +5783,8 @@ msgstr "escribir commit-graph luego del fetch"
msgid "accept refspecs from stdin"
msgstr "aceptar refspecs de stdin"
-#, fuzzy
msgid "couldn't find remote ref HEAD"
-msgstr "No se pudo encontrar ref remota HEAD"
+msgstr "no se pudo encontrar la referencia remota HEAD"
#, c-format
msgid "object %s not found"
@@ -5724,12 +5796,8 @@ msgstr "[actualizado]"
msgid "[rejected]"
msgstr "[rechazado]"
-msgid "can't fetch in current branch"
-msgstr "no se puede traer en la rama actual"
-
-#, fuzzy
-msgid "checked out in another worktree"
-msgstr "buscar en el índice en lugar del árbol de trabajo"
+msgid "can't fetch into checked-out branch"
+msgstr "no se puede hacer fetch a la rama actual"
msgid "[tag update]"
msgstr "[actualización de tag]"
@@ -5759,25 +5827,24 @@ msgstr "avance no rápido"
msgid "cannot open '%s'"
msgstr "no se puede abrir '%s'"
-#, fuzzy
msgid ""
"fetch normally indicates which branches had a forced update,\n"
"but that check has been disabled; to re-enable, use '--show-forced-updates'\n"
"flag or run 'git config fetch.showForcedUpdates true'"
msgstr ""
-"Fetch normalmente incida qué branches han tenido un update forzado,\n"
+"fetch normalmente indica cuáles ramas han tenido una actualización forzada,\n"
"pero esa validación ha sido deshabilitada. Para activarla de nuevo usa '--"
"show-forced-updates'\n"
-"o ejecuta 'git config fetch.showForcedUpdates true'."
+"o ejecuta 'git config fetch.showForcedUpdates true'"
-#, fuzzy, c-format
+#, c-format
msgid ""
"it took %.2f seconds to check forced updates; you can use\n"
"'--no-show-forced-updates' or run 'git config fetch.showForcedUpdates "
"false'\n"
"to avoid this check\n"
msgstr ""
-"Tomó %.2f segundos validar los updates forzados. Puedes usar\n"
+"tomó %.2f segundos validar las actualizaciones forzadas. Se puede usar\n"
"'--no-show-forced-updates' o ejecutar 'git config fetch.showForcedUpdates "
"false'\n"
"para evitar esta validación.\n"
@@ -5816,17 +5883,17 @@ msgstr "[eliminado]"
msgid "(none)"
msgstr "(nada)"
-#, fuzzy, c-format
+#, c-format
msgid "refusing to fetch into branch '%s' checked out at '%s'"
-msgstr "No se puede borrar rama '%s' que cuenta con checkout en '%s'"
+msgstr "rehusando hacer fetch a la rama '%s' que cuenta con checkout en '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "option \"%s\" value \"%s\" is not valid for %s"
-msgstr "Valor \"%2$s\" de opción \"%1$s\" no es válido para %3$s"
+msgstr "el valor \"%2$s\" de la opción \"%1$s\" no es válido para %3$s"
-#, fuzzy, c-format
+#, c-format
msgid "option \"%s\" is ignored for %s\n"
-msgstr "Opción \"%s\" es ignorada por %s\n"
+msgstr "la opción \"%s\" es ignorada por %s\n"
#, c-format
msgid "%s is not a valid object"
@@ -5839,13 +5906,13 @@ msgstr "el objeto %s no existe"
msgid "multiple branches detected, incompatible with --set-upstream"
msgstr "múltiples ramas detectadas, incompatible con --set-upstream"
-#, fuzzy, c-format
+#, c-format
msgid ""
"could not set upstream of HEAD to '%s' from '%s' when it does not point to "
"any branch."
msgstr ""
-"no se pudo configurar upstream de HEAD a %s cuando este no apunta a ninguna "
-"rama."
+"no se pudo cambiar el upstream de HEAD de '%s' a '%s' cuando este no apunta "
+"a ninguna rama."
msgid "not setting upstream for a remote remote-tracking branch"
msgstr "no configurar upstream para una rama de rastreo remoto"
@@ -5856,45 +5923,40 @@ msgstr "no configurar upstream para un tag remoto"
msgid "unknown branch type"
msgstr "tipo de branch desconocido"
-#, fuzzy
msgid ""
"no source branch found;\n"
"you need to specify exactly one branch with the --set-upstream option"
msgstr ""
"no se encontró rama fuente.\n"
-"tienes que especificar exactamente una rama con la opción --set-upstream."
+"hay que especificar exactamente una rama con la opción --set-upstream"
#, c-format
msgid "Fetching %s\n"
msgstr "Extrayendo %s\n"
-#, fuzzy, c-format
+#, c-format
msgid "could not fetch %s"
-msgstr "No se pudo extraer %s"
+msgstr "no se pudo hacer fetch de %s"
#, c-format
msgid "could not fetch '%s' (exit code: %d)\n"
msgstr "no se pudo hacer fetch a '%s' (código de salida: %d)\n"
-#, fuzzy
msgid ""
"no remote repository specified; please specify either a URL or a\n"
"remote name from which new revisions should be fetched"
msgstr ""
-"No hay repositorio remoto especificado. Por favor, especifica un URL o un\n"
-"nombre remoto del cual las nuevas revisiones deben ser extraídas."
+"no hay repositorio remoto especificado. Por favor, especifica un URL o un\n"
+"nombre remoto del cual hacer fetch de las nuevas revisiones"
-#, fuzzy
msgid "you need to specify a tag name"
-msgstr "Tienes que especificar un nombre de tag."
+msgstr "hay que especificar un nombre de etiqueta"
-#, fuzzy
msgid "--negotiate-only needs one or more --negotiation-tip=*"
-msgstr "--negotiate-only necesita uno o más --negotiate-tip=*"
+msgstr "--negotiate-only necesita uno o más --negotiation-tip=*"
-#, fuzzy
msgid "negative depth in --deepen is not supported"
-msgstr "Profundidad negativa en --deepen no soportada"
+msgstr "profundidad negativa en --deepen no es soportada"
msgid "--unshallow on a complete repository does not make sense"
msgstr "--unshallow no tiene sentido en un repositorio completo"
@@ -5905,20 +5967,20 @@ msgstr "fetch --all no toma un argumento de repositorio"
msgid "fetch --all does not make sense with refspecs"
msgstr "fetch --all no tiene sentido con refspecs"
-#, fuzzy, c-format
+#, c-format
msgid "no such remote or remote group: %s"
-msgstr "No existe el remoto o grupo remoto: %s"
+msgstr "no existe tal remoto o grupo remoto: %s"
-#, fuzzy
msgid "fetching a group and specifying refspecs does not make sense"
-msgstr "Extraer un grupo y especificar refspecs no tiene sentido"
+msgstr ""
+"hacer fetch de un grupo y especificar especificaciones de referencia no "
+"tiene sentido"
msgid "must supply remote when using --negotiate-only"
msgstr "tiene que proveer un remoto cuando usa --negotiate-only"
-#, fuzzy
msgid "protocol does not support --negotiate-only, exiting"
-msgstr "Protocolo no soporta --negotiate-only, saliendo."
+msgstr "el protocolo no soporta --negotiate-only, saliendo"
msgid ""
"--filter can only be used with the remote configured in extensions."
@@ -5950,9 +6012,8 @@ msgstr "texto"
msgid "use <text> as start of message"
msgstr "usar <text> como comienzo de mensaje"
-#, fuzzy
msgid "use <name> instead of the real target branch"
-msgstr "usar <nombre> en lugar de 'origin' para rastrear upstream"
+msgstr "usar <nombre> en lugar de la rama de destino real"
msgid "file to read from"
msgstr "archivo del cual leer"
@@ -6025,7 +6086,7 @@ msgstr "error en %s %s: %s"
#. TRANSLATORS: e.g. warning in tree 01bfda: <more explanation>
#, c-format
msgid "warning in %s %s: %s"
-msgstr "peligro en %s %s: %s"
+msgstr "advertencia en %s %s: %s"
#, c-format
msgid "broken link from %7s %s"
@@ -6093,11 +6154,11 @@ msgstr "tagged %s %s (%s) en %s"
#, c-format
msgid "%s: object corrupt or missing"
-msgstr "%s: objecto corrupto o faltante"
+msgstr "%s: objeto corrupto o faltante"
#, c-format
msgid "%s: invalid reflog entry %s"
-msgstr "%s: referencia inválida %s"
+msgstr "%s: entrada de log de referencias inválida %s"
#, c-format
msgid "Checking reflog %s->%s"
@@ -6170,6 +6231,10 @@ msgstr "%s: puntero inválido sha1 en cache-tree"
msgid "non-tree in cache-tree"
msgstr "non-tree en cache-tree"
+#, c-format
+msgid "%s: invalid sha1 pointer in resolve-undo"
+msgstr "%s: puntero inválido sha1 en resolve-undo"
+
msgid "git fsck [<options>] [<object>...]"
msgstr "git fsck [<opciones>] [<objeto>...]"
@@ -6220,79 +6285,73 @@ msgstr "%s: objeto faltante"
msgid "invalid parameter: expected sha1, got '%s'"
msgstr "parámetro inválido: sha1 esperado, se obtuvo '%s'"
-#, fuzzy
msgid "git fsmonitor--daemon start [<options>]"
-msgstr "git stash list [<opciones>]"
+msgstr "git fsmonitor--daemon start [<opciones>]"
-#, fuzzy
msgid "git fsmonitor--daemon run [<options>]"
-msgstr "git notes prune [<opciones>]"
+msgstr "git fsmonitor--daemon run [<opciones>]"
msgid "git fsmonitor--daemon stop"
-msgstr ""
+msgstr "git fsmonitor--daemon stop"
msgid "git fsmonitor--daemon status"
-msgstr ""
+msgstr "git fsmonitor--daemon status"
-#, fuzzy, c-format
+#, c-format
msgid "value of '%s' out of range: %d"
-msgstr "largo de abreviatura fuera de rango: %d"
+msgstr "valor de '%s' fuera de rango: %d"
-#, fuzzy, c-format
+#, c-format
msgid "value of '%s' not bool or int: %d"
-msgstr "valor es --bool o --int"
+msgstr "valor de '%s' no bool ni int: %d"
#, c-format
msgid "fsmonitor-daemon is watching '%s'\n"
-msgstr ""
+msgstr "fsmonitor-daemon está vigilando '%s'\n"
#, c-format
msgid "fsmonitor-daemon is not watching '%s'\n"
-msgstr ""
+msgstr "fsmonitor-daemon no está vigilando '%s'\n"
-#, fuzzy, c-format
+#, c-format
msgid "could not create fsmonitor cookie '%s'"
-msgstr "no se pudo crear el archivo '%s'"
+msgstr "no se pudo crear la galleta de fsmonitor '%s'"
#, c-format
msgid "fsmonitor: cookie_result '%d' != SEEN"
-msgstr ""
+msgstr "fsmonitor: cookie_result '%d' != SEEN"
-#, fuzzy, c-format
+#, c-format
msgid "could not start IPC thread pool on '%s'"
-msgstr "no se pudo iniciar el servidor en: '%s'"
+msgstr "no se pudo iniciar el pool de hilos IPC en '%s'"
-#, fuzzy
msgid "could not start fsmonitor listener thread"
-msgstr "no se pudo comenzar ls-files en .."
+msgstr "no se pudo iniciar el hilo escuchante de fsmonitor"
-#, fuzzy
msgid "could not start fsmonitor health thread"
-msgstr "no se pudo iniciar el accept_thread '%s'"
+msgstr "no se pudo iniciar el hilo de salud de fsmonitor"
-#, fuzzy
msgid "could not initialize listener thread"
-msgstr "no se pudo guardar el árbol de índice"
+msgstr "no se pudo inicializar el hilo escuchante"
-#, fuzzy
msgid "could not initialize health thread"
-msgstr "no se pudo normalizar la ruta %s"
+msgstr "no se pudo inicializar el hilo de salud"
-#, fuzzy, c-format
+#, c-format
msgid "could not cd home '%s'"
-msgstr "no se pudo cerrar '%s'"
+msgstr "no se pudo cambiar al directorio personal '%s'"
#, c-format
msgid "fsmonitor--daemon is already running '%s'"
-msgstr ""
+msgstr "fsmonitor--daemon ya está ejecutando '%s'"
#, c-format
msgid "running fsmonitor-daemon in '%s'\n"
-msgstr ""
+msgstr "ejecutando fsmonitor-daemon en '%s'\n"
-#, fuzzy, c-format
+#, c-format
msgid "starting fsmonitor-daemon in '%s'\n"
-msgstr "Probando mtime en '%s' "
+msgstr "iniciando fsmonitor-daemon en '%s'\n"
msgid "daemon failed to start"
msgstr "falló al iniciar demonio"
@@ -6300,32 +6359,28 @@ msgstr "falló al iniciar demonio"
msgid "daemon not online yet"
msgstr "demonio no está en línea todavía"
-#, fuzzy
msgid "daemon terminated"
-msgstr "no hay términos definidos"
+msgstr "demonio terminado"
-#, fuzzy
msgid "detach from console"
-msgstr "HEAD desacoplada de "
+msgstr "desacoplar de la consola"
-#, fuzzy
msgid "use <n> ipc worker threads"
-msgstr "usar <n> hilos de trabajo"
+msgstr "usar <n> hilos de trabajo ipc"
-#, fuzzy
msgid "max seconds to wait for background daemon startup"
-msgstr "segundos a esperar para que el dominio empiece o se detenga"
+msgstr "segundos máximos a esperar el inicio del demonio de fondo"
-#, fuzzy, c-format
+#, c-format
msgid "invalid 'ipc-threads' value (%d)"
-msgstr "valor --stat inválido: %s"
+msgstr "valor 'ipc-threads' inválido (%d)"
-#, fuzzy, c-format
+#, c-format
msgid "Unhandled subcommand '%s'"
-msgstr "subcomando no válido: %s"
+msgstr "Subcomando no manejado '%s'"
msgid "fsmonitor--daemon not supported on this platform"
-msgstr ""
+msgstr "fsmonitor--daemon no es soportado en este plataforma"
msgid "git gc [<options>]"
msgstr "git gc [<opciones>]"
@@ -6359,9 +6414,8 @@ msgstr ""
msgid "prune unreferenced objects"
msgstr "recortar objetos no referenciados"
-#, fuzzy
msgid "pack unreferenced objects separately"
-msgstr "recortar objetos no referenciados"
+msgstr "empacar separadamente objetos no referenciados"
msgid "be more thorough (increased runtime)"
msgstr "ser más exhaustivo (aumentar runtime)"
@@ -6376,8 +6430,8 @@ msgid "repack all other packs except the largest pack"
msgstr "reempaquetar todos los otros paquetes excepto el paquete más grande"
#, c-format
-msgid "failed to parse gc.logexpiry value %s"
-msgstr "falló al analizar valor %s de gc.logexpiry"
+msgid "failed to parse gc.logExpiry value %s"
+msgstr "falló al analizar el valor %s de gc.logExpiry"
#, c-format
msgid "failed to parse prune expiry value %s"
@@ -6514,13 +6568,16 @@ msgid "failed to run 'crontab -l'; your system might not support 'cron'"
msgstr ""
"no se pudo ejecutar 'crontab -l'; es posible que su sistema no soporte 'cron'"
+msgid "failed to create crontab temporary file"
+msgstr "falló al crear el archivo temporal de crontab"
+
+msgid "failed to open temporary file"
+msgstr "falló al abrir un archivo temporal"
+
msgid "failed to run 'crontab'; your system might not support 'cron'"
msgstr ""
"no se pudo ejecutar 'crontab'; es posible que su sistema no soporte 'cron'"
-msgid "failed to open stdin of 'crontab'"
-msgstr "no se pudo abrir stdin de 'crontab'"
-
msgid "'crontab' died"
msgstr "'crontab' murió"
@@ -6567,10 +6624,6 @@ msgstr "no se pudo agregar el repositorio a la configuración global"
msgid "git maintenance <subcommand> [<options>]"
msgstr "git maintenance <subcomando> [<opciones>]"
-#, c-format
-msgid "invalid subcommand: %s"
-msgstr "subcomando no válido: %s"
-
msgid "git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]"
msgstr "git grep [<opciones>] [-e] <patrón> [<rev>...] [[--] <ruta>...]"
@@ -6582,7 +6635,6 @@ msgstr "grep: falló al crear el hilo: %s"
msgid "invalid number of threads specified (%d) for %s"
msgstr "número inválido de hilos especificado (%d) para %s"
-#. #-#-#-#-# grep.c.po #-#-#-#-#
#. TRANSLATORS: %s is the configuration
#. variable for tweaking threads, currently
#. grep.threads
@@ -6745,6 +6797,9 @@ msgstr "mostrar archivos concordantes en el paginador"
msgid "allow calling of grep(1) (ignored by this build)"
msgstr "permitir el llamado de grep(1) (ignorado por esta build)"
+msgid "maximum number of results per file"
+msgstr "número máximo de resultados por archivo"
+
msgid "no pattern given"
msgstr "no se ha entregado ningún patrón"
@@ -6808,13 +6863,11 @@ msgstr "procesar el archivo como si fuera de esta ruta"
msgid "print all available commands"
msgstr "mostrar todos los comandos disponibles"
-#, fuzzy
msgid "show external commands in --all"
-msgstr "Comandos externos"
+msgstr "mostrar comandos externos en --all"
-#, fuzzy
msgid "show aliases in --all"
-msgstr "mostrar lista de tags en columnas"
+msgstr "mostrar aliases en --all"
msgid "exclude guides"
msgstr "excluir las guias"
@@ -6834,14 +6887,21 @@ msgstr "imprimir descripción del comando"
msgid "print list of useful guides"
msgstr "mostrar una lista de guías útiles"
+msgid "print list of user-facing repository, command and file interfaces"
+msgstr ""
+"imprimir lista de interfaces de repositorio, comando y archivo orientadas al "
+"usuario"
+
+msgid "print list of file formats, protocols and other developer interfaces"
+msgstr ""
+"imprimir lista de formatos de archivos, protocolos y otras interfaces para "
+"el desarrollador"
+
msgid "print all configuration variable names"
msgstr "imprimir todos los nombres de variables de configuración"
-#, fuzzy
-msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>]"
-msgstr ""
-"git help [-a|--all] [--[no-]verbose]]\n"
-" [[-i|--info] [-m|--man] [-w|--web]] [<command>]"
+msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"
+msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<comando>|<documento>]"
#, c-format
msgid "unrecognized help format '%s'"
@@ -6895,13 +6955,15 @@ msgstr "'%s' tiene el alias '%s'"
msgid "bad alias.%s string: %s"
msgstr "mal alias.%s string: %s"
-#, fuzzy, c-format
+#, c-format
msgid "the '%s' option doesn't take any non-option arguments"
-msgstr "esta opción no requiere argumentos"
+msgstr "la opción '%s' no toma ningún argumento aparte de opciones"
msgid ""
"the '--no-[external-commands|aliases]' options can only be used with '--all'"
msgstr ""
+"las opciones '--no-[external-commands|aliases]' solo pueden ser usadas con "
+"'--all'"
#, c-format
msgid "usage: %s%s"
@@ -6912,9 +6974,10 @@ msgstr "'git help config' para más información"
msgid "git hook run [--ignore-missing] <hook-name> [-- <hook-args>]"
msgstr ""
+"git hook run [--ignore-missing] <nombre-de-hook> [-- <argumentos-de-hook>]"
msgid "silently ignore missing requested <hook-name>"
-msgstr ""
+msgstr "ignorar silenciosamente <nombre-de-hook> solicitado y faltante"
#, c-format
msgid "object type mismatch at %s"
@@ -6946,9 +7009,9 @@ msgstr "se usaron más bytes de los disponibles"
msgid "pack too large for current definition of off_t"
msgstr "paquete demasiado grande para la definición actual de off_t"
-#, fuzzy, c-format
+#, c-format
msgid "pack exceeds maximum allowed size (%s)"
-msgstr "paquete excede el máximo tamaño permitido"
+msgstr "el pack excede el tamaño máximo permitido (%s)"
msgid "pack signature mismatch"
msgstr "firma del paquete no concuerda"
@@ -6981,8 +7044,8 @@ msgstr "no se puede hacer pread en el paquete"
#, c-format
msgid "premature end of pack file, %<PRIuMAX> byte missing"
msgid_plural "premature end of pack file, %<PRIuMAX> bytes missing"
-msgstr[0] "final prematuro de archivo de paquete, %<PRIuMAX> byte faltante"
-msgstr[1] "final prematuro de archivo de paquete, %<PRIuMAX> bytes faltantes"
+msgstr[0] "fin prematuro de archivo de paquete, %<PRIuMAX> byte faltante"
+msgstr[1] "fin prematuro de archivo de paquete, %<PRIuMAX> bytes faltantes"
msgid "serious inflate inconsistency"
msgstr "inconsistencia seria en inflate"
@@ -7089,8 +7152,8 @@ msgid "error while closing pack file"
msgstr "error mientras se cerraba el archivo paquete"
#, c-format
-msgid "bad pack.indexversion=%<PRIu32>"
-msgstr "mal pack.indexversion=%<PRIu32>"
+msgid "bad pack.indexVersion=%<PRIu32>"
+msgstr "mal pack.indexVersion=%<PRIu32>"
#, c-format
msgid "Cannot open existing pack file '%s'"
@@ -7311,8 +7374,8 @@ msgstr "suprimir salida de diff"
msgid "show source"
msgstr "mostrar fuente"
-msgid "use mail map file"
-msgstr "usar archivo de mapa de mail"
+msgid "clear all previously-defined decoration filters"
+msgstr "limpiar todos los filtros de decoración previamente definidos"
msgid "only decorate refs that match <pattern>"
msgstr "solo decorar refs que concuerden con <patrón>"
@@ -7341,9 +7404,8 @@ msgstr "-L<rango>:<archivo> no se puede usar con pathspec"
msgid "Final output: %d %s\n"
msgstr "Salida final: %d %s\n"
-#, fuzzy
msgid "unable to create temporary object directory"
-msgstr "no es posible crear un archivo temporal"
+msgstr "incapaz de crear directorio temporal de objetos"
#, c-format
msgid "git show %s: bad file"
@@ -7572,6 +7634,9 @@ msgstr "mostrar cambios contra <refspec> en cover letter o en un solo parche"
msgid "percentage by which creation is weighted"
msgstr "porcentaje por el cual la creación es pesada"
+msgid "show in-body From: even if identical to the e-mail header"
+msgstr "mostrar From: en el cuerpo aunque sea idéntico a la cabecera de e-mail"
+
#, c-format
msgid "invalid ident line: %s"
msgstr "línea de identificación inválida: %s"
@@ -7585,9 +7650,8 @@ msgstr "--name-status no tiene sentido"
msgid "--check does not make sense"
msgstr "--check no tiene sentido"
-#, fuzzy
msgid "--remerge-diff does not make sense"
-msgstr "--name-only no tiene sentido"
+msgstr "--remerge-diff no tiene sentido"
#, c-format
msgid "could not create directory '%s'"
@@ -7633,6 +7697,18 @@ msgstr ""
"No se pudo encontrar una rama remota rastreada, por favor especifica "
"<upstream> manualmente.\n"
+#, c-format
+msgid "bad ls-files format: element '%s' does not start with '('"
+msgstr "formato malo de ls-files: el elemento '%s' no comienza con '('"
+
+#, c-format
+msgid "bad ls-files format: element '%s' does not end in ')'"
+msgstr "formato malo de ls-files: el elemento '%s' no termina en ')'"
+
+#, c-format
+msgid "bad ls-files format: %%%.*s"
+msgstr "formato malo de ls-files: %%%.*s"
+
msgid "git ls-files [<options>] [<file>...]"
msgstr "git ls-files [<opciones>] [<archivo>...]"
@@ -7716,9 +7792,15 @@ msgstr "mostrar data de debug"
msgid "suppress duplicate entries"
msgstr "suprimir entradas duplicadas"
-#, fuzzy
msgid "show sparse directories in the presence of a sparse index"
-msgstr "activar el uso de un índice sparse"
+msgstr "mostrar directorios escasos en la presencia de un índice escaso"
+
+msgid ""
+"--format cannot be used with -s, -o, -k, -t, --resolve-undo, --deduplicate, "
+"--eol"
+msgstr ""
+"--format no puede ser usado con -s, -o, -k, -t, --resolve-undo, --"
+"deduplicate, --eol"
msgid ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
@@ -7759,21 +7841,21 @@ msgstr "mostrar ref subyacente en adición al objeto apuntado por él"
msgid "git ls-tree [<options>] <tree-ish> [<path>...]"
msgstr "git ls-tree [<opciones>] <árbol-ismo> [<ruta>...]"
-#, fuzzy, c-format
+#, c-format
msgid "could not get object info about '%s'"
-msgstr "no se pudo analizar el objeto '%s'"
+msgstr "no se pudo averiguar información sobre el objeto '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "bad ls-tree format: element '%s' does not start with '('"
-msgstr "el nombre del archivo de paquete '%s' no termina con '.%s'"
+msgstr "formato malo de ls-tree: el elemento '%s' no comienza con '('"
-#, fuzzy, c-format
+#, c-format
msgid "bad ls-tree format: element '%s' does not end in ')'"
-msgstr "el nombre del archivo de paquete '%s' no termina con '.%s'"
+msgstr "formato malo de ls-tree: el elemento '%s' no termina en ')'"
-#, fuzzy, c-format
+#, c-format
msgid "bad ls-tree format: %%%.*s"
-msgstr "formato inválido: %s"
+msgstr "formato malo de ls-tree: %%%.*s"
msgid "only show trees"
msgstr "solo mostrar árboles"
@@ -7793,9 +7875,8 @@ msgstr "incluir tamaño de objeto"
msgid "list only filenames"
msgstr "listar solo nombres de archivos"
-#, fuzzy
msgid "list only objects"
-msgstr "Escribiendo objetos"
+msgstr "listar solo objetos"
msgid "use full path names"
msgstr "usar rutas completas"
@@ -7804,9 +7885,9 @@ msgid "list entire tree; not just current directory (implies --full-name)"
msgstr ""
"mostrar todo el árbol; no solo el directorio actual (implica --full-name)"
-#, fuzzy
msgid "--format can't be combined with other format-altering options"
-msgstr "--mirror no puede ser combinado con refspecs"
+msgstr ""
+"--format no se puede combinar con otras opciones que alteren el formato"
#. TRANSLATORS: keep <> in "<" mail ">" info.
msgid "git mailinfo [<options>] <msg> <patch> < mail >info"
@@ -7845,9 +7926,8 @@ msgstr "actión cuando se encuentra un CR citado"
msgid "use headers in message's body"
msgstr "usar cabeceras en el cuerpo del mensaje"
-#, fuzzy
msgid "reading patches from stdin/tty..."
-msgstr "leer actualizaciones de stdin"
+msgstr "leyendo parches de stdin/tty..."
#, c-format
msgid "empty mbox: '%s'"
@@ -7896,9 +7976,8 @@ msgstr "mandar resultados a standard output"
msgid "use a diff3 based merge"
msgstr "usar una fusión basada en diff3"
-#, fuzzy
msgid "use a zealous diff3 based merge"
-msgstr "usar una fusión basada en diff3"
+msgstr "usar una fusión celosa basada en diff3"
msgid "for conflicts, use our version"
msgstr "por conflictos, usar nuestra versión"
@@ -7943,6 +8022,39 @@ msgstr "no se pudo resolver ref '%s'"
msgid "Merging %s with %s\n"
msgstr "Fusionando %s con %s\n"
+msgid "not something we can merge"
+msgstr "no es nada que se pueda fusionar"
+
+msgid "refusing to merge unrelated histories"
+msgstr "rehusando fusionar historias no relacionadas"
+
+msgid "failure to merge"
+msgstr "falló al fusionar"
+
+msgid "git merge-tree [--write-tree] [<options>] <branch1> <branch2>"
+msgstr "git merge-tree [--write-tree] [<opciones>] <rama1> <rama2>"
+
+msgid "git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"
+msgstr "git merge-tree [--trivial-merge] <árbol-base> <rama1> <rama2>"
+
+msgid "do a real merge instead of a trivial merge"
+msgstr "hacer una fusión real en vez de una fusión trivial"
+
+msgid "do a trivial merge only"
+msgstr "hacer solo una fusión trivial"
+
+msgid "also show informational/conflict messages"
+msgstr "también mostrar mensajes informativos o de conflictos"
+
+msgid "list filenames without modes/oids/stages"
+msgstr "listar nombres de archivo sin modos/oids/etapas"
+
+msgid "allow merging unrelated histories"
+msgstr "permitir fusionar historias no relacionadas"
+
+msgid "--trivial-merge is incompatible with all other options"
+msgstr "--trivial-merge es incompatible con cualquier otra opción"
+
msgid "git merge [<options>] [<commit>...]"
msgstr "git merge [<opciones>] [<commit>...]"
@@ -8012,9 +8124,8 @@ msgstr "opción para la estrategia de fusión seleccionada"
msgid "merge commit message (for a non-fast-forward merge)"
msgstr "fusionar mensaje de commit (para una fusión no fast-forward)"
-#, fuzzy
msgid "use <name> instead of the real target"
-msgstr "usar <nombre> en lugar de 'origin' para rastrear upstream"
+msgstr "usar <nombre> en lugar del destino real"
msgid "abort the current in-progress merge"
msgstr "abortar la fusión en progreso actual"
@@ -8025,9 +8136,6 @@ msgstr "--abort pero no tocar el índice ni el árbol de trabajo"
msgid "continue the current in-progress merge"
msgstr "continuar la fusión en progreso actual"
-msgid "allow merging unrelated histories"
-msgstr "permitir fusionar historias no relacionadas"
-
msgid "bypass pre-merge-commit and commit-msg hooks"
msgstr "hacer un bypass a hooks pre-merge-commit y commit-msg"
@@ -8149,9 +8257,6 @@ msgstr "no se pudo cerrar '%s'"
msgid "not something we can merge in %s: %s"
msgstr "nada que podamos fusionar en %s: %s"
-msgid "not something we can merge"
-msgstr "nada que podamos fusionar"
-
msgid "--abort expects no arguments"
msgstr "--abort no espera argumentos"
@@ -8201,14 +8306,20 @@ msgstr "%s - nada que podamos fusionar"
msgid "Can merge only exactly one commit into empty head"
msgstr "Solo se puede fusionar exactamente un commit en un head vacío"
-msgid "refusing to merge unrelated histories"
-msgstr "rehusando fusionar historias no relacionadas"
-
#, c-format
msgid "Updating %s..%s\n"
msgstr "Actualizando %s..%s\n"
#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+" %s"
+msgstr ""
+"Los cambios locales a los archivos siguientes serían sobreescritos al "
+"fusionar:\n"
+" %s"
+
+#, c-format
msgid "Trying really trivial in-index merge...\n"
msgstr "Intentando fusión en índice realmente trivial...\n"
@@ -8242,8 +8353,13 @@ msgstr ""
"Fusión automática fue bien; detenida antes del commit como se solicitó\n"
#, c-format
+msgid "When finished, apply stashed changes with `git stash pop`\n"
+msgstr ""
+"Cuando esté terminado, aplica los cambios en stash con `git stash pop`\n"
+
+#, c-format
msgid "warning: tag input does not pass fsck: %s"
-msgstr "peligro: información de tag no pasa fsck: %s"
+msgstr "advertencia: la información de etiqueta no pasa fsck: %s"
#, c-format
msgid "error: tag input does not pass fsck: %s"
@@ -8298,9 +8414,8 @@ msgstr "git multi-pack-index [<opciones>] expire"
msgid "git multi-pack-index [<options>] repack [--batch-size=<size>]"
msgstr "git multi-pack-index [<opciones>] repack [--batch-size=<tamaño>]"
-#, fuzzy
msgid "directory"
-msgstr "archivo/directorio"
+msgstr "directorio"
msgid "object directory containing set of packfile and pack-index pairs"
msgstr ""
@@ -8361,6 +8476,9 @@ msgstr "Revisando cambio de nombre de '%s' a '%s'\n"
msgid "bad source"
msgstr "mala fuente"
+msgid "destination exists"
+msgstr "el destino existe"
+
msgid "can not move directory into itself"
msgstr "no se puede mover un directorio en sí mismo"
@@ -8376,9 +8494,6 @@ msgstr "no se encuentra bajo control de versiones"
msgid "conflicted"
msgstr "en conflicto"
-msgid "destination exists"
-msgstr "destino existe"
-
#, c-format
msgid "overwriting '%s'"
msgstr "sobrescribiendo '%s'"
@@ -8392,6 +8507,9 @@ msgstr "múltiples fuentes para el mismo destino"
msgid "destination directory does not exist"
msgstr "el directorio de destino no existe"
+msgid "destination exists in the index"
+msgstr "el destino existe en el índice"
+
#, c-format
msgid "%s, source=%s, destination=%s"
msgstr "%s, fuente=%s, destino=%s"
@@ -8410,9 +8528,8 @@ msgstr "git name-rev [<opciones>] <commit>..."
msgid "git name-rev [<options>] --all"
msgstr "git name-rev [<opciones>] --all"
-#, fuzzy
msgid "git name-rev [<options>] --annotate-stdin"
-msgstr "git name-rev [<opciones>] --stdin"
+msgstr "git name-rev [<opciones>] --annotate-stdin"
msgid "print only ref-based names (no object names)"
msgstr "imprimir solo nombres basados en referencias (sin nombres de objetos)"
@@ -8429,12 +8546,11 @@ msgstr "ignorar refs que concuerden con <patrón>"
msgid "list all commits reachable from all refs"
msgstr "listar todos los commits alcanzables desde todas las referencias"
-msgid "deprecated: use annotate-stdin instead"
-msgstr ""
+msgid "deprecated: use --annotate-stdin instead"
+msgstr "deprecado: usa --annotate-stdin en su lugar"
-#, fuzzy
msgid "annotate text from stdin"
-msgstr "leer el objeto de stdin"
+msgstr "anotar el texto de stdin"
msgid "allow to print `undefined` names (default)"
msgstr "permitir imprimir nombres `undefined` (predeterminado)"
@@ -8753,8 +8869,8 @@ msgid "use notes from <notes-ref>"
msgstr "usar notas desde <referencia-de-notas>"
#, c-format
-msgid "unknown subcommand: %s"
-msgstr "subcomando desconocido: %s"
+msgid "unknown subcommand: `%s'"
+msgstr "subcomando desconocido: '%s'"
msgid ""
"git pack-objects --stdout [<options>...] [< <ref-list> | < <object-list>]"
@@ -8896,21 +9012,18 @@ msgstr "no se puede obtener el tipo de objeto %s en pack %s"
msgid "could not find pack '%s'"
msgstr "no se pudo encontrar pack '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "packfile %s cannot be accessed"
-msgstr "objeto %s no puede ser mapeado %s"
+msgstr "no se puede acceder al archivo de pack %s"
-#, fuzzy
msgid "Enumerating cruft objects"
-msgstr "Enumerando objetos"
+msgstr "Enumerando objetos inalcanzables"
-#, fuzzy
msgid "unable to add cruft objects"
-msgstr "incapaz de añadir objetos recientes"
+msgstr "incapaz de añadir objetos inalcanzables"
-#, fuzzy
msgid "Traversing cruft objects"
-msgstr "Comprimiendo objetos"
+msgstr "Atravesando objetos inalcanzables"
#, c-format
msgid ""
@@ -8928,9 +9041,8 @@ msgstr ""
"se esperaba ID de objeto, se obtuvo basura:\n"
"%s"
-#, fuzzy
msgid "could not load cruft pack .mtimes"
-msgstr "no se pudo cargar pack"
+msgstr "no se pudo cargar el .mtimes del pack de inalcanzables"
msgid "cannot open pack index"
msgstr "no se puede abrir índice de paquetes"
@@ -8940,7 +9052,7 @@ msgid "loose object at %s could not be examined"
msgstr "objeto suelto en %s no pudo ser examinado"
msgid "unable to force loose object"
-msgstr "incapaz de forzar que el objecto se suelte"
+msgstr "incapaz de forzar que el objeto se suelte"
#, c-format
msgid "not a rev '%s'"
@@ -9034,13 +9146,11 @@ msgstr "empaquetar objetos sueltos inalcanzables"
msgid "unpack unreachable objects newer than <time>"
msgstr "desempaquetar objetos inalcanzables más nuevos que <tiempo>"
-#, fuzzy
msgid "create a cruft pack"
-msgstr "crear paquetes delgados"
+msgstr "crear un pack de inalcanzables"
-#, fuzzy
msgid "expire cruft objects older than <time>"
-msgstr "caducar objetos más viejos a <tiempo>"
+msgstr "caducar objetos inalcanzables más viejos a <tiempo>"
msgid "use the sparse reachability algorithm"
msgstr "usar el algoritmo sparse reachability"
@@ -9119,19 +9229,16 @@ msgid "cannot use --filter with --stdin-packs"
msgstr "no se puede usar --filter con --stdin-packs"
msgid "cannot use internal rev list with --stdin-packs"
-msgstr "no se puede usar un lista interna de rev con --stdin-packs"
+msgstr "no se puede usar un lista interna de revisiones con --stdin-packs"
-#, fuzzy
msgid "cannot use internal rev list with --cruft"
-msgstr "no se puede usar un lista interna de rev con --stdin-packs"
+msgstr "no se puede usar un lista interna de revisiones con --cruft"
-#, fuzzy
msgid "cannot use --stdin-packs with --cruft"
-msgstr "no se puede usar -a con -d"
+msgstr "no se puede usar --stdin-packs con --cruft"
-#, fuzzy
msgid "cannot use --max-pack-size with --cruft"
-msgstr "no se puede usar -a con -d"
+msgstr "no se puede usar --max-pack-size con --cruft"
msgid "Enumerating objects"
msgstr "Enumerando objetos"
@@ -9197,9 +9304,8 @@ msgstr "incorporar cambios por rebase en lugar de fusión"
msgid "allow fast-forward"
msgstr "permitir fast-forward"
-#, fuzzy
msgid "control use of pre-merge-commit and commit-msg hooks"
-msgstr "hacer un bypass a hooks pre-merge-commit y commit-msg"
+msgstr "controlar el uso de los hooks pre-merge-commit y commit-msg"
msgid "automatically stash/stash pop before and after"
msgstr "ejecutar automáticamente stash/stash pop antes y después"
@@ -9283,7 +9389,6 @@ msgstr "no es posible acceder al commit %s"
msgid "ignoring --verify-signatures for rebase"
msgstr "ignorando --verify-signatures para rebase"
-#, fuzzy
msgid ""
"You have divergent branches and need to specify how to reconcile them.\n"
"You can do so by running one of the following commands sometime before\n"
@@ -9299,18 +9404,18 @@ msgid ""
"or --ff-only on the command line to override the configured default per\n"
"invocation.\n"
msgstr ""
-"Hacer un pull sin especificar cómo reconciliar las ramas es poco\n"
-"recomendable. Puedes eliminar este mensaje usando uno de los\n"
-"siguientes comandos antes de tu siguiente pull:\n"
+"Las ramas se han divergido y hay que especificar cómo reconciliarlas.\n"
+"Se puede hacerlo ejecutando uno de los comandos siguiente antes del\n"
+"próximo pull:\n"
"\n"
-" git config pull.rebase false # hacer merge (estrategia por defecto)\n"
-" git config pull.rebase true # aplicar rebase\n"
-" git config pull.ff only # aplicar solo fast-forward\n"
+" git config pull.rebase false # fusionar\n"
+" git config pull.rebase true # rebasar\n"
+" git config pull.ff only # solo avance rápido\n"
"\n"
-"Puedes reemplazar \"git config\" con \"git config --global\" para aplicar\n"
-"la preferencia en todos los repositorios. Puedes también pasar --rebase,\n"
-"--no-rebase, o --ff-only en el comando para sobrescribir la configuración\n"
-"por defecto en cada invocación.\n"
+"Se puede reemplazar \"git config\" con \"git config --global\" para aplicar\n"
+"la preferencia en todos los repositorios. También se puede pasar\n"
+"--rebase, --no-rebase o --ff-only en el comando para sobrescribir la\n"
+"configuración por defecto en cada invocación.\n"
msgid "Updating an unborn branch with changes added to the index."
msgstr "Actualizando una rama no nacida con cambios agregados al índice."
@@ -9373,14 +9478,13 @@ msgstr "taquigrafía de tag sin <tag>"
msgid "--delete only accepts plain target ref names"
msgstr "--delete solo acepta como objetivos nombres de ref planos"
-#, fuzzy
msgid ""
"\n"
"To choose either option permanently, see push.default in 'git help config'.\n"
msgstr ""
"\n"
-"Para elegir si la opción es permanente, mira push.default en 'git help "
-"config'."
+"Para elegir una de las opciones permanentemente, mira push.default en 'git "
+"help config'.\n"
msgid ""
"\n"
@@ -9389,8 +9493,12 @@ msgid ""
"autoSetupMerge\n"
"in 'git help config'.\n"
msgstr ""
+"\n"
+"Para evitar configurar una rama upstream automáticamente cuando su nombre\n"
+"no coincida con el de la rama local, mira la opción 'simple' de\n"
+"branch.autoSetupMerge en 'git help config'.\n"
-#, fuzzy, c-format
+#, c-format
msgid ""
"The upstream branch of your current branch does not match\n"
"the name of your current branch. To push to the upstream branch\n"
@@ -9412,7 +9520,7 @@ msgstr ""
"Para empujar a la rama del mismo nombre en el remoto, ejecuta\n"
"\n"
" git push %s HEAD\n"
-"%s"
+"%s%s"
#, c-format
msgid ""
@@ -9433,8 +9541,11 @@ msgid ""
"To have this happen automatically for branches without a tracking\n"
"upstream, see 'push.autoSetupRemote' in 'git help config'.\n"
msgstr ""
+"\n"
+"Para hacer que esto pase automáticamente para las ramas que no rastrean\n"
+"un upstream, mira 'push.autoSetupRemote' en 'git help config'.\n"
-#, fuzzy, c-format
+#, c-format
msgid ""
"The current branch %s has no upstream branch.\n"
"To push the current branch and set the remote as upstream, use\n"
@@ -9445,7 +9556,8 @@ msgstr ""
"La rama actual %s no tiene una rama upstream.\n"
"Para empujar la rama actual y configurar el remoto como upstream, usa\n"
"\n"
-"\tgit push --set-upstream %s %s\n"
+" git push --set-upstream %s %s\n"
+"%s"
#, c-format
msgid "The current branch %s has multiple upstream branches, refusing to push."
@@ -9536,9 +9648,9 @@ msgstr "Empujando a %s\n"
msgid "failed to push some refs to '%s'"
msgstr "falló el empuje de algunas referencias a '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "invalid value for '%s'"
-msgstr "valor inválido para %s"
+msgstr "valor inválido para '%s'"
msgid "repository"
msgstr "repositorio"
@@ -9658,11 +9770,16 @@ msgid "only emit output related to the second range"
msgstr "solo emite salida relacionada con el segundo rango"
#, c-format
+msgid "not a revision: '%s'"
+msgstr "no es una revisión: '%s'"
+
+#, c-format
msgid "not a commit range: '%s'"
msgstr "no es un rango de commit: '%s'"
-msgid "single arg format must be symmetric range"
-msgstr "argumento único de formato debe ser un rango simétrico"
+#, c-format
+msgid "not a symmetric range: '%s'"
+msgstr "no es un rango simétrico: '%s'"
msgid "need two commit ranges"
msgstr "se necesitan dos rangos de commits"
@@ -9923,9 +10040,8 @@ msgstr "usar estrategias de fusión para el rebase"
msgid "let the user edit the list of commits to rebase"
msgstr "permitir al usuario editar la lista de commits para rebasar"
-#, fuzzy
msgid "(REMOVED) was: try to recreate merges instead of ignoring them"
-msgstr "(DEPRECADO) intentar recrear merges en lugar de ignorarlos"
+msgstr "(DEPRECADO) era: intentar recrear fusiones en lugar de ignorarlas"
msgid "how to handle commits that become empty"
msgstr "como manejar commits que se vuelven vacíos"
@@ -9936,6 +10052,9 @@ msgstr "mantener commits que comiencen con vacío"
msgid "move commits that begin with squash!/fixup! under -i"
msgstr "mover commits que comiencen con squash!/fixup! bajo -i"
+msgid "update branches that point to commits that are being rebased"
+msgstr "actualizar ramas que apuntan a commits que se rebasan"
+
msgid "add exec lines after each commit of the editable list"
msgstr "agregar líneas exec tras cada commit de la lista editable"
@@ -9976,12 +10095,19 @@ msgid ""
"Use `git rebase --abort` to terminate current rebase.\n"
"Or downgrade to v2.33, or earlier, to complete the rebase."
msgstr ""
+"`rebase --preserve-merges` (-p) ya no es soportado.\n"
+"Usa `git rebase --abort` para terminar la rebase actual.\n"
+"O regresa a v2.33, o más antes, para completar la rebase."
msgid ""
"--preserve-merges was replaced by --rebase-merges\n"
-"Note: Your `pull.rebase` configuration may also be set to 'preserve',\n"
+"Note: Your `pull.rebase` configuration may also be set to 'preserve',\n"
"which is no longer supported; use 'merges' instead"
msgstr ""
+"--rebase-merges ha reemplazado --preserve-merges\n"
+"Nota: Tu configuración de `pull.rebase` también podría estar\n"
+"configurada a 'preserve', el cual ya no es soportado; usa 'merges' en\n"
+"su lugar"
msgid "No rebase in progress?"
msgstr "¿No hay rebase en progreso?"
@@ -10037,9 +10163,10 @@ msgstr "Modo desconocido: %s"
msgid "--strategy requires --merge or --interactive"
msgstr "--strategy requiere --merge o --interactive"
-#, fuzzy
msgid "apply options and merge options cannot be used together"
-msgstr "Opciones --add-file y --remote no pueden ser usadas juntas"
+msgstr ""
+"las opciones de aplicación y las opciones de fusión no pueden ser usadas "
+"juntas"
#, c-format
msgid "Unknown rebase backend: %s"
@@ -10176,82 +10303,80 @@ msgstr ""
msgid "quiet"
msgstr "silencioso"
-#, fuzzy
msgid "you must specify a directory"
-msgstr "Se tiene que especificar un directorio."
+msgstr "hay que especificar un directorio"
-#, fuzzy
msgid "git reflog [show] [<log-options>] [<ref>]"
-msgstr "git remote show [<opciones>] <nombre>"
+msgstr "git reflog [show] [<opciones-de-log>] [<referencia>]"
-#, fuzzy
msgid ""
"git reflog expire [--expire=<time>] [--expire-unreachable=<time>]\n"
" [--rewrite] [--updateref] [--stale-fix]\n"
" [--dry-run | -n] [--verbose] [--all [--single-worktree] | "
"<refs>...]"
msgstr ""
-"git reflog expire [--expire=<tiempo>] [--expire-unreachable=<tiempo>] [--"
-"rewrite] [--updateref] [--stale-fix] [--dry-run | -n] [--verbose] [--all] "
-"<refs>..."
+"git reflog expire [--expire=<tiempo>] [--expire-unreachable=<tiempo>]\n"
+" [--rewrite] [--updateref] [--stale-fix]\n"
+" [--dry-run | -n] [--verbose] [--all [--single-worktree] | "
+"<referencias>...]"
-#, fuzzy
msgid ""
"git reflog delete [--rewrite] [--updateref]\n"
" [--dry-run | -n] [--verbose] <ref>@{<specifier>}..."
msgstr ""
-"git reflog delete [--rewrite] [--updateref] [--dry-run | -n] [--verbose] "
-"<refs>..."
+"git reflog delete [--rewrite] [--updateref]\n"
+" [--dry-run | -n] [--verbose] "
+"<referencia>@{<especificador>}..."
msgid "git reflog exists <ref>"
-msgstr "git reflog existe <ref>"
+msgstr "git reflog exists <referencia>"
-#, fuzzy, c-format
+#, c-format
msgid "invalid timestamp '%s' given to '--%s'"
-msgstr "regex inválido para -I: '%s'"
+msgstr "marca de tiempo inválida '%s' pasada a '--%s'"
-#, fuzzy
msgid "do not actually prune any entries"
-msgstr "no tocar entradas index-only"
+msgstr "no recortar de verdad ninguna entrada"
msgid ""
"rewrite the old SHA1 with the new SHA1 of the entry that now precedes it"
msgstr ""
+"reescribir el SHA1 antiguo con el SHA1 nuevo de la entrada que ya lo precede"
msgid "update the reference to the value of the top reflog entry"
-msgstr ""
+msgstr "actualizar la referencia al valor de la entrada superior del reflog"
-#, fuzzy
msgid "print extra information on screen"
-msgstr "Información de output en cada ref"
+msgstr "imprimir información extra a la pantalla"
-#, fuzzy
msgid "timestamp"
-msgstr "timestamp inválido"
+msgstr "marca de tiempo"
-#, fuzzy
msgid "prune entries older than the specified time"
-msgstr "caducar árboles de trabajo más viejos a <tiempo>"
+msgstr "recortar entradas más viejas al tiempo especificado"
msgid ""
"prune entries older than <time> that are not reachable from the current tip "
"of the branch"
msgstr ""
+"recortar entradas más viejas de <tiempo> que están inalcanzables de la punta "
+"actual de la rama"
-#, fuzzy
msgid "prune any reflog entries that point to broken commits"
-msgstr "mostrar solo ramas que contengan el commit"
+msgstr ""
+"recortar cualquier entrada del log de referencias que apunte a un commit roto"
-#, fuzzy
msgid "process the reflogs of all references"
-msgstr "forzar sobrescritura de referencia local"
+msgstr "procesar los logs de referencias de todas las referencias"
msgid "limits processing to reflogs from the current worktree only"
msgstr ""
+"limita procesamiento a solo los logs de referencias del árbol de trabajo "
+"actual"
#, c-format
msgid "Marking reachable objects..."
-msgstr "Marcando objectos alcanzables..."
+msgstr "Marcando objetos alcanzables..."
#, c-format
msgid "%s points nowhere!"
@@ -10271,9 +10396,8 @@ msgstr ""
"git remote add [-t <rama>] [-m <master>] [-f] [--tags | --no-tags] [--"
"mirror=<fetch|push>] <nombre> <url>"
-#, fuzzy
msgid "git remote rename [--[no-]progress] <old> <new>"
-msgstr "git remote rename <viejo> <nuevo>"
+msgstr "git remote rename [--[no-]progress] <viejo> <nuevo>"
msgid "git remote remove <name>"
msgstr "git remote remove <nombre>"
@@ -10431,9 +10555,8 @@ msgstr ""
"\t%s\n"
"\tPor favor actualiza la configuración manualmente si es necesario."
-#, fuzzy
msgid "Renaming remote references"
-msgstr "no se pudo eliminar la referencia %s"
+msgstr "Renombrando referencias remotas"
#, c-format
msgid "deleting '%s' failed"
@@ -10468,6 +10591,9 @@ msgstr " nuevo (siguiente fetch se guardará en remotes/%s)"
msgid " tracked"
msgstr " rastreada"
+msgid " skipped"
+msgstr "saltado"
+
msgid " stale (use 'git remote prune' to remove)"
msgstr " viejo (usa 'git remote prune' para eliminar)"
@@ -10696,10 +10822,11 @@ msgstr "git repack [<opciones>]"
msgid ""
"Incremental repacks are incompatible with bitmap indexes. Use\n"
-"--no-write-bitmap-index or disable the pack.writebitmaps configuration."
+"--no-write-bitmap-index or disable the pack.writeBitmaps configuration."
msgstr ""
-"Reempaquetados incrementales son incompatibles con índices bitmap. Usa\n"
-"--no-write-bitmap-index o deshabilita la configuración pack.writebitmaps."
+"Los reempaquetados incrementales son incompatibles con las índices de "
+"bitmap.\n"
+"Usa --no-write-bitmap-index o deshabilita la configuración pack.writeBitmaps."
msgid "could not start pack-objects to repack promisor objects"
msgstr "no se puede iniciar pack-objects para reempaquetar objetos promisores"
@@ -10739,16 +10866,14 @@ msgstr "empaquetar todo en un único paquete"
msgid "same as -a, and turn unreachable objects loose"
msgstr "lo mismo que -a, y soltar objetos inalcanzables"
-#, fuzzy
msgid "same as -a, pack unreachable cruft objects separately"
-msgstr "lo mismo que -a, y soltar objetos inalcanzables"
+msgstr "lo mismo que -a, empacar objetos inalcanzables separadamente"
msgid "approxidate"
msgstr "approxidate"
-#, fuzzy
msgid "with -C, expire objects older than this"
-msgstr "caducar objetos más viejos a <tiempo>"
+msgstr "con -C, caducar objetos más viejos a esto"
msgid "remove redundant packs, and run git-prune-packed"
msgstr "eliminar paquetes redundantes, y ejecutar git-prune-packed"
@@ -10815,9 +10940,9 @@ msgstr "no se pueden borrar paquetes en un repositorio de objetos preciosos"
msgid "Nothing new to pack."
msgstr "Nada nuevo para empaquetar."
-#, fuzzy, c-format
+#, c-format
msgid "pack prefix %s does not begin with objdir %s"
-msgstr "el nombre del archivo de paquete '%s' no termina con '.%s'"
+msgstr "el prefijo %s de pack no comienza con el objdir %s"
#, c-format
msgid "missing required file: %s"
@@ -11081,7 +11206,7 @@ msgid "be quiet, only report errors"
msgstr "ser silencioso, solo reportar errores"
msgid "skip refreshing the index after reset"
-msgstr ""
+msgstr "saltar refrescar el índice después de hacer reset"
msgid "reset HEAD and index"
msgstr "reiniciar HEAD e índice"
@@ -11121,14 +11246,13 @@ msgstr "%s reset no está permitido en un repositorio vacío"
msgid "Unstaged changes after reset:"
msgstr "Cambios fuera del área de stage tras el reset:"
-#, fuzzy, c-format
+#, c-format
msgid ""
"It took %.2f seconds to refresh the index after reset. You can use\n"
"'--no-refresh' to avoid this."
msgstr ""
-"\n"
-"Tomó %.2f segundos para calcular los valores anterior/posterior del branch.\n"
-"Puedes usar '--no-ahead-behind' para evitar esto.\n"
+"Tomó %.2f segundos para refrescar el índice después de reiniciar.\n"
+"Se puede usar '--no-refresh' para evitar esto."
#, c-format
msgid "Could not reset index file to revision '%s'."
@@ -11141,12 +11265,16 @@ msgstr "No se puede escribir un nuevo archivo índice."
msgid "unable to get disk usage of %s"
msgstr "no se puede obtener el uso de disco de %s"
+#, c-format
+msgid "invalid value for '%s': '%s', the only allowed format is '%s'"
+msgstr "valor inválido para '%s': '%s', el único formato permitido es '%s'"
+
msgid "rev-list does not support display of notes"
msgstr "rev-list no soporta mostrar notas"
-#, fuzzy, c-format
+#, c-format
msgid "marked counting and '%s' cannot be used together"
-msgstr "--reject y --3way no se pueden utilizar juntas."
+msgstr "el conteo marcado y '%s' no pueden ser usados juntos"
msgid "git rev-parse --parseopt [<options>] -- [<args>...]"
msgstr "git rev-parse --parseopt [<opciones>] -- [<args>...]"
@@ -11166,6 +11294,9 @@ msgstr "fin de input prematuro"
msgid "no usage string given before the `--' separator"
msgstr "no se ha entregado cadena antes del separador`--'"
+msgid "missing opt-spec before option flags"
+msgstr "falta opt-spec antes de los flags de opción"
+
msgid "Needed a single revision"
msgstr "Se necesitó una revisión singular"
@@ -11283,7 +11414,7 @@ msgid "keep redundant, empty commits"
msgstr "mantener commits redundantes, vacíos"
msgid "use the 'reference' format to refer to commits"
-msgstr ""
+msgstr "usar el formato 'de referencia' para referir a los commits"
msgid "revert failed"
msgstr "falló al revertir"
@@ -11573,9 +11704,8 @@ msgstr "mostrar refs de stdin que no estén en el repositorio local"
msgid "git sparse-checkout (init|list|set|add|reapply|disable) <options>"
msgstr "git sparse-checkout (init|list|set|add|reapply|disable) <opciones>"
-#, fuzzy
msgid "this worktree is not sparse"
-msgstr "HEAD del árbol de trabajo %s no está actualizada"
+msgstr "este árbol de trabajo no es escaso"
msgid "this worktree is not sparse (sparse-checkout file may not exist)"
msgstr ""
@@ -11597,9 +11727,8 @@ msgstr "falló al borrar directorio '%s'"
msgid "failed to create directory for sparse-checkout file"
msgstr "falló al crear directorio para el archivo sparse-checkout"
-#, fuzzy
msgid "failed to initialize worktree config"
-msgstr "falló al inicializar sparse-checkout"
+msgstr "falló al inicializar la configuración del árbol de trabajo"
msgid "failed to modify sparse-index config"
msgstr "falló al modificar la configuración del índice sparse"
@@ -11629,61 +11758,70 @@ msgstr "no es posible dequote la cadena de estilo C '%s'"
msgid "unable to load existing sparse-checkout patterns"
msgstr "no se pudo cargar patrones de sparse-checkout existentes"
-#, fuzzy
msgid "existing sparse-checkout patterns do not use cone mode"
-msgstr "no se pudo cargar patrones de sparse-checkout existentes"
+msgstr "los patrones de checkout escaso existentes no usan el modo de cono"
msgid "please run from the toplevel directory in non-cone mode"
-msgstr ""
+msgstr "por favor ejecuta desde el directorio superior en el modo no de cono"
msgid "specify directories rather than patterns (no leading slash)"
-msgstr ""
+msgstr "especificar directorios en vez de patrones (sin slash inicial)"
msgid ""
"specify directories rather than patterns. If your directory starts with a "
"'!', pass --skip-checks"
msgstr ""
+"especificar directorios en vez de patrones. Si el directorio comienza con "
+"un '!', se necesita --skip-checks también"
msgid ""
"specify directories rather than patterns. If your directory really has any "
"of '*?[]\\' in it, pass --skip-checks"
msgstr ""
+"especificar directorios en vez de patrones. Si el directorio realmente "
+"lleva cualquier de '*?[]\\', se necesita --skip-checks también"
#, c-format
msgid ""
"'%s' is not a directory; to treat it as a directory anyway, rerun with --"
"skip-checks"
msgstr ""
+"'%s' no es un directorio; para tratarlo como directorio de todas maneras, "
+"ejecuta otra vez con --skip-checks"
#, c-format
msgid ""
"pass a leading slash before paths such as '%s' if you want a single file "
"(see NON-CONE PROBLEMS in the git-sparse-checkout manual)."
msgstr ""
+"pasa un slash inicial antes de rutas como '%s' si quieres un archivo soltero "
+"(mira NON-CONE PROBLEMS en el manual de git-sparse-checkout)."
-#, fuzzy
msgid "git sparse-checkout add [--skip-checks] (--stdin | <patterns>)"
-msgstr "git sparse-checkout (set|add) (--stdin | <patrones>)"
+msgstr "git sparse-checkout add [--skip-checks] (--stdin | <patrones>)"
msgid ""
"skip some sanity checks on the given paths that might give false positives"
msgstr ""
+"saltar algunas pruebas de sensatez en las rutas proporcionadas que podrían "
+"resultar en positivos falsos"
msgid "read patterns from standard in"
msgstr "leer patrones de standard in"
-#, fuzzy
msgid "no sparse-checkout to add to"
-msgstr "git sparse-checkout list"
+msgstr "no hay checkout escaso a que añadir"
-#, fuzzy
msgid ""
"git sparse-checkout set [--[no-]cone] [--[no-]sparse-index] [--skip-checks] "
"(--stdin | <patterns>)"
-msgstr "git sparse-checkout init [--cone] [--[no-]sparse-index]"
+msgstr ""
+"git sparse-checkout set [--[no-]cone] [--[no-]sparse-index] [--skip-checks] "
+"(--stdin | <patrones>)"
msgid "must be in a sparse-checkout to reapply sparsity patterns"
msgstr ""
+"hay que estar en un checkout escaso para volver a aplicar patrones de escasez"
msgid "error while refreshing working directory"
msgstr "error al refrescar directorio de trabajo"
@@ -11703,7 +11841,6 @@ msgstr "git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"
msgid "git stash branch <branchname> [<stash>]"
msgstr "git stash branch <nombre-de-rama> [<stash>]"
-#, fuzzy
msgid ""
"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
"quiet]\n"
@@ -11711,18 +11848,19 @@ msgid ""
" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
" [--] [<pathspec>...]]"
msgstr ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
+"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
+"quiet]\n"
" [-u|--include-untracked] [-a|--all] [-m|--message <mensaje>]\n"
" [--pathspec-from-file=<archivo> [--pathspec-file-nul]]\n"
" [--] [<pathspec>...]]"
-#, fuzzy
msgid ""
"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
"quiet]\n"
" [-u|--include-untracked] [-a|--all] [<message>]"
msgstr ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
+"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
+"quiet]\n"
" [-u|--include-untracked] [-a|--all] [<mensaje>]"
msgid "git stash pop [--index] [-q|--quiet] [<stash>]"
@@ -11845,9 +11983,8 @@ msgstr "mensaje de stash"
msgid "\"git stash store\" requires one <commit> argument"
msgstr "\"git stash store\" requiere un argumento <commit>"
-#, fuzzy
msgid "No staged changes"
-msgstr "Sin cambios"
+msgstr "No hay cambios en stage"
msgid "No changes selected"
msgstr "Sin cambios seleccionados"
@@ -11864,9 +12001,8 @@ msgstr "No se pueden guardar los archivos no rastreados"
msgid "Cannot save the current worktree state"
msgstr "No se puede guardar el estado actual del árbol de trabajo"
-#, fuzzy
msgid "Cannot save the current staged state"
-msgstr "No se puede guardar el estado actual del índice"
+msgstr "No se puede guardar el estado actualmente en stage"
msgid "Cannot record working tree state"
msgstr "No se puede grabar el estado del árbol de trabajo"
@@ -11874,9 +12010,9 @@ msgstr "No se puede grabar el estado del árbol de trabajo"
msgid "Can't use --patch and --include-untracked or --all at the same time"
msgstr "No se puede usar --patch y --include-untracked o --all al mismo tiempo"
-#, fuzzy
msgid "Can't use --staged and --include-untracked or --all at the same time"
-msgstr "No se puede usar --patch y --include-untracked o --all al mismo tiempo"
+msgstr ""
+"No se puede usar --staged y --include-untracked o --all al mismo tiempo"
msgid "Did you forget to 'git add'?"
msgstr "¿Olvidaste 'git add'?"
@@ -11901,7 +12037,7 @@ msgid "keep index"
msgstr "mantener index"
msgid "stash staged changes only"
-msgstr ""
+msgstr "hacer stash a solo los cambios en stage"
msgid "stash in patch mode"
msgstr "stash en modo patch"
@@ -11927,6 +12063,10 @@ msgid "Expecting a full ref name, got %s"
msgstr "Se esperaba un nombre de ref completo, se obtuvo %s"
#, c-format
+msgid "could not get a repository handle for submodule '%s'"
+msgstr "no se pudo conseguir un handle de repositorio para el submódulo '%s'"
+
+#, c-format
msgid ""
"could not look up configuration '%s'. Assuming this repository is its own "
"authoritative upstream."
@@ -11934,12 +12074,6 @@ msgstr ""
"no se pudo encontrar configuración '%s'. Asumiendo que este repositorio es "
"su propio upstream autoritario."
-msgid "alternative anchor for relative paths"
-msgstr "ancho alternativo para rutas relativas"
-
-msgid "git submodule--helper list [--prefix=<path>] [<path>...]"
-msgstr "git submodule--helper list [--prefix=<ruta>] [<ruta>...]"
-
#, c-format
msgid "No url found for submodule path '%s' in .gitmodules"
msgstr "No se encontró url para la ruta del submódulo '%s' en .gitmodules"
@@ -11972,12 +12106,12 @@ msgstr "suprime la salida de inicializar cada comando de submódulo"
msgid "recurse into nested submodules"
msgstr "recursar en submódulos anidados"
-msgid "git submodule--helper foreach [--quiet] [--recursive] [--] <command>"
-msgstr "git submodule--helper foreach [--quiet] [--recursive] [--] <comando>"
+msgid "git submodule foreach [--quiet] [--recursive] [--] <command>"
+msgstr "git submodule foreach [--quiet] [--recursive] [--] <comando>"
#, c-format
msgid "Failed to register url for submodule path '%s'"
-msgstr "Falló al registrar el url para la ruta del submódulo '%s'"
+msgstr "Falló al registrar el url para la ruta de submódulo '%s'"
#, c-format
msgid "Submodule '%s' (%s) registered for path '%s'\n"
@@ -11986,7 +12120,8 @@ msgstr "Submódulo '%s' (%s) registrado para ruta '%s'\n"
#, c-format
msgid "warning: command update mode suggested for submodule '%s'\n"
msgstr ""
-"peligro: modo de actualización de comandos sugerido para el submódulo '%s'\n"
+"advertencia: modo de actualización de comandos sugerido para el submódulo "
+"'%s'\n"
#, c-format
msgid "Failed to register update mode for submodule path '%s'"
@@ -11996,8 +12131,8 @@ msgstr ""
msgid "suppress output for initializing a submodule"
msgstr "suprime la salida de inicializar un submódulo"
-msgid "git submodule--helper init [<options>] [<path>]"
-msgstr "git submodule--helper init [<opciones>] [<path>]"
+msgid "git submodule init [<options>] [<path>]"
+msgstr "git submodule init [<opciones>] [<ruta>]"
#, c-format
msgid "no submodule mapping found in .gitmodules for path '%s'"
@@ -12025,9 +12160,6 @@ msgstr ""
msgid "git submodule status [--quiet] [--cached] [--recursive] [<path>...]"
msgstr "git submodule status [--quiet] [--cached] [--recursive] [<ruta>...]"
-msgid "git submodule--helper name <path>"
-msgstr "git submodule--helper name <ruta>"
-
#, c-format
msgid "* %s %s(blob)->%s(submodule)"
msgstr "* %s %s(blob)->%s(submodule)"
@@ -12064,8 +12196,8 @@ msgstr "omitir submódulos con el valor 'ignore_config' establecido en 'all'"
msgid "limit the summary size"
msgstr "limitar el tamaño de resumen"
-msgid "git submodule--helper summary [<options>] [<commit>] [--] [<path>]"
-msgstr "git submodule--helper summary [<options>] [<commit>] [--] [<path>]"
+msgid "git submodule summary [<options>] [<commit>] [--] [<path>]"
+msgstr "git submodule summary [<opciones>] [<commit>] [--] [<ruta>]"
msgid "could not fetch a revision for HEAD"
msgstr "no se puede obtener la revisión para HEAD"
@@ -12076,29 +12208,25 @@ msgstr "Sincronizando url del submódulo para '%s'\n"
#, c-format
msgid "failed to register url for submodule path '%s'"
-msgstr "falló al registrar el url para la ruta del submódulo '%s'"
-
-#, c-format
-msgid "failed to get the default remote for submodule '%s'"
-msgstr "error al conseguir el remoto por defecto para el submódulo '%s'"
+msgstr "falló al registrar el url para la ruta de submódulo '%s'"
#, c-format
msgid "failed to update remote for submodule '%s'"
msgstr "error al actualizar el remoto para el submódulo '%s'"
msgid "suppress output of synchronizing submodule url"
-msgstr "suprime la salida de sincronizar el url del submódulo"
+msgstr "suprimir la salida de sincronizar el url del submódulo"
-msgid "git submodule--helper sync [--quiet] [--recursive] [<path>]"
-msgstr "git submodule--helper sync [--quiet] [--recursive] [<ruta>]"
+msgid "git submodule sync [--quiet] [--recursive] [<path>]"
+msgstr "git submodule sync [--quiet] [--recursive] [<ruta>]"
-#, fuzzy, c-format
+#, c-format
msgid ""
"Submodule work tree '%s' contains a .git directory. This will be replaced "
"with a .git file by using absorbgitdirs."
msgstr ""
-"El árbol de trabajo de submódulo '%s' contiene un directorio .git (usa 'rm -"
-"rf' si realmente quieres eliminarlo incluyendo todo en su historia)"
+"El árbol de trabajo de submódulo '%s' contiene un directorio .git. Este será "
+"reemplazado con un archivo .git usando absorbgitdirs."
#, c-format
msgid ""
@@ -12153,6 +12281,11 @@ msgstr ""
"'--reference-if-able' en lugar de '--reference'."
#, c-format
+msgid "could not get a repository handle for gitdir '%s'"
+msgstr ""
+"no se pudo conseguir un handle de repositorio para el directorio de git '%s'"
+
+#, c-format
msgid "submodule '%s' cannot add alternate: %s"
msgstr "submódulo '%s' no puede agregar alterno: %s"
@@ -12180,6 +12313,9 @@ msgstr "directorio no está vacío: '%s'"
msgid "could not get submodule directory for '%s'"
msgstr "no se pudo obtener el directorio de submódulo para '%s'"
+msgid "alternative anchor for relative paths"
+msgstr "ancla alternativa para rutas relativas"
+
msgid "where the new submodule will be cloned to"
msgstr "a donde el nuevo submódulo será clonado"
@@ -12198,19 +12334,14 @@ msgstr "forzar el proceso de clonación"
msgid "disallow cloning into non-empty directory"
msgstr "no permitir clonar en directorios no vacíos"
-#, fuzzy
msgid ""
"git submodule--helper clone [--prefix=<path>] [--quiet] [--reference "
"<repository>] [--name <name>] [--depth <depth>] [--single-branch] [--filter "
"<filter-spec>] --url <url> --path <path>"
msgstr ""
"git submodule--helper clone [--prefix=<ruta>] [--quiet] [--reference "
-"<repositorio>] [--name <nombre>] [--depth <profundidad>] [--single-branch] --"
-"url <url> --path <ruta>"
-
-#, c-format
-msgid "Invalid update mode '%s' for submodule path '%s'"
-msgstr "Modo de actualización inválido '%s' para ruta de submódulo '%s'"
+"<repositorio>] [--name <nombre>] [--depth <profundidad>] [--single-branch] "
+"[--filter <especificación-de-filtro>] --url <url> --path <ruta>"
#, c-format
msgid "Invalid update mode '%s' configured for submodule path '%s'"
@@ -12287,6 +12418,10 @@ msgstr ""
"directo del commit falló."
#, c-format
+msgid "could not initialize submodule at path '%s'"
+msgstr "no se pudo inicializar el submódulo a la ruta '%s'"
+
+#, c-format
msgid ""
"Submodule (%s) branch configured to inherit branch from superproject, but "
"the superproject is not on any branch"
@@ -12295,42 +12430,32 @@ msgstr ""
"el superproyecto no está en ninguna rama"
#, c-format
-msgid "could not get a repository handle for submodule '%s'"
-msgstr "no se pudo conseguir un handle de repositorio para el submódulo '%s'"
-
-#, fuzzy, c-format
msgid "Unable to find current revision in submodule path '%s'"
-msgstr ""
-"No se pudo encontrar la revisión actual en la ruta de submódulo "
-"'$displaypath'"
+msgstr "Incapaz de encontrar la revisión actual en la ruta de submódulo '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "Unable to fetch in submodule path '%s'"
-msgstr "No es posible realizar fetch en la ruta de submódulo '$sm_path'"
+msgstr "Incapaz de realizar fetch en la ruta de submódulo '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "Unable to find %s revision in submodule path '%s'"
-msgstr ""
-"No se pudo encontrar la revisión actual en la ruta de submódulo "
-"'$displaypath'"
+msgstr "Incapaz de encontrar la revisión %s en la ruta de submódulo '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "Failed to recurse into submodule path '%s'"
-msgstr "falló al recursar en el submódulo '%s'"
+msgstr "Falló al recursar en la ruta de submódulo '%s'"
msgid "force checkout updates"
msgstr "forzar actualizaciones de checkout"
-#, fuzzy
msgid "initialize uninitialized submodules before update"
-msgstr "inicializar submódulos en el clon"
+msgstr "inicializar submódulos no inicializados antes de actualizar"
-#, fuzzy
msgid "use SHA-1 of submodule's remote tracking branch"
-msgstr "cualquier submódulo clonado usará su branch de rastreo remoto"
+msgstr "usar el SHA-1 de la rama remota que el submódulo rastrea"
msgid "traverse submodules recursively"
-msgstr ""
+msgstr "atravesar los submódulos recursivamente"
msgid "don't fetch new objects from the remote site"
msgstr "no recuperar objetos nuevos del sitio remoto"
@@ -12338,11 +12463,14 @@ msgstr "no recuperar objetos nuevos del sitio remoto"
msgid "path into the working tree"
msgstr "ruta al árbol de trabajo"
-msgid "path into the working tree, across nested submodule boundaries"
-msgstr "ruta al árbol de trabajo, a través de fronteras de submódulos anidados"
+msgid "use the 'checkout' update strategy (default)"
+msgstr "usar la estrategia de actualización 'checkout' (por defecto)"
-msgid "rebase, merge, checkout or none"
-msgstr "rebase, merge, checkout o none"
+msgid "use the 'merge' update strategy"
+msgstr "usar la estrategia de actualización 'merge'"
+
+msgid "use the 'rebase' update strategy"
+msgstr "usar la estrategia de actualización 'rebase'"
msgid "create a shallow clone truncated to the specified number of revisions"
msgstr "crea un clon superficial truncado al número especificado de revisiones"
@@ -12356,21 +12484,25 @@ msgstr "si el clon inicial debe seguir la recomendación de superficialidad"
msgid "don't print cloning progress"
msgstr "no mostrar el progreso de clonación"
+msgid "disallow cloning into non-empty directory, implies --init"
+msgstr "no permitir clonar en directorios no vacíos, implica --init"
+
msgid ""
"git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] "
"[-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-"
"shallow] [--reference <repository>] [--recursive] [--[no-]single-branch] "
"[--] [<path>...]"
msgstr ""
-
-msgid "bad value for update parameter"
-msgstr "mal valor para parámetro update"
+"git submodule [--quiet] update [--init [--filter=<especificación-de-"
+"filtro>]] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--"
+"rebase] [--[no-]recommend-shallow] [--reference <repositorio>] [--recursive] "
+"[--[no-]single-branch] [--] [<ruta>...]"
msgid "recurse into submodules"
msgstr "recurrir a submódulos"
-msgid "git submodule--helper absorb-git-dirs [<options>] [<path>...]"
-msgstr "git submodule--helper absorb-git-dirs [<opciones>] [<path>...]"
+msgid "git submodule absorbgitdirs [<options>] [<path>...]"
+msgstr "git submodule absorbgitdirs [<opciones>] [<ruta>...]"
msgid "check if it is safe to write to the .gitmodules file"
msgstr "revisar si es seguro escribir al archivo .gitmodules"
@@ -12391,8 +12523,8 @@ msgstr ""
msgid "suppress output for setting url of a submodule"
msgstr "suprime la salida de inicializar la url de un submódulo"
-msgid "git submodule--helper set-url [--quiet] <path> <newurl>"
-msgstr "git submodule--helper set-url [--quiet] <ruta> <nueva url>"
+msgid "git submodule set-url [--quiet] <path> <newurl>"
+msgstr "git submodule set-url [--quiet] <ruta> <url-nuevo>"
msgid "set the default tracking branch to master"
msgstr "configurar la rama de rastreo por defecto a master"
@@ -12400,13 +12532,11 @@ msgstr "configurar la rama de rastreo por defecto a master"
msgid "set the default tracking branch"
msgstr "configurar la rama de rastreo por defecto"
-msgid "git submodule--helper set-branch [-q|--quiet] (-d|--default) <path>"
-msgstr "git submodule--helper set-branch [-q|--quiet] (-d|--default) <ruta>"
+msgid "git submodule set-branch [-q|--quiet] (-d|--default) <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-d|--default) <ruta>"
-msgid ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
-msgstr ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <rama> <ruta>"
+msgid "git submodule set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-b|--branch) <rama> <ruta>"
msgid "--branch or --default required"
msgstr "--branch o --default requerido"
@@ -12415,20 +12545,21 @@ msgid "print only error messages"
msgstr "mostrar solo mensajes de error"
msgid "force creation"
-msgstr ""
+msgstr "forzar creación"
-#, fuzzy
msgid "show whether the branch would be created"
-msgstr "mostrar lo que sería incluido en el commit"
+msgstr "mostrar si la rama sería creada"
msgid ""
"git submodule--helper create-branch [-f|--force] [--create-reflog] [-q|--"
"quiet] [-t|--track] [-n|--dry-run] <name> <start-oid> <start-name>"
msgstr ""
+"git submodule--helper create-branch [-f|--force] [--create-reflog] [-q|--"
+"quiet] [-t|--track] [-n|--dry-run] <nombre> <oid-inicial> <nombre-inicial>"
-#, fuzzy, c-format
+#, c-format
msgid "creating branch '%s'"
-msgstr "Reiniciar rama '%s'\n"
+msgstr "creando la rama '%s'"
#, c-format
msgid "Adding existing repo at '%s' to the index\n"
@@ -12497,16 +12628,15 @@ msgstr "permitir agregar una ruta de submódulo que de otro modo se ignora"
msgid "borrow the objects from reference repositories"
msgstr "prestar los objetos de los repositorios de referencia"
-#, fuzzy
msgid ""
"sets the submodule's name to the given string instead of defaulting to its "
"path"
msgstr ""
-"configura el nombre del submódulo para el string dado en lugar de ir a la "
-"ruta por defecto"
+"configura el nombre del submódulo a la cadena proporcionada en lugar de usar "
+"por defecto la ruta suya"
-msgid "git submodule--helper add [<options>] [--] <repository> [<path>]"
-msgstr "git submodule--helper add [<options>] [--] <repository> [<path>]"
+msgid "git submodule add [<options>] [--] <repository> [<path>]"
+msgstr "git submodule add [<opciones>] [--] <repositorio> [<ruta>]"
msgid "Relative path can only be used from the toplevel of the working tree"
msgstr ""
@@ -12690,9 +12820,9 @@ msgstr "solo imprimir las tags que no estén fusionadas"
msgid "print only tags of the object"
msgstr "solo imprimir tags del objeto"
-#, fuzzy, c-format
+#, c-format
msgid "the '%s' option is only allowed in list mode"
-msgstr "opción -n solo es permitida en modo lista"
+msgstr "la opción '%s' solo es permitida en el modo de lista"
#, c-format
msgid "'%s' is not a valid tag name."
@@ -12713,6 +12843,16 @@ msgstr "Etiqueta '%s' actualizada (era %s)\n"
msgid "pack exceeds maximum allowed size"
msgstr "paquete excede el máximo tamaño permitido"
+msgid "failed to write object in stream"
+msgstr "falló al escribir objeto al stream"
+
+#, c-format
+msgid "inflate returned (%d)"
+msgstr "inflate devolvió (%d)"
+
+msgid "invalid blob object from stream"
+msgstr "objeto blob inválido del stream"
+
msgid "Unpacking objects"
msgstr "Desempaquetando objetos"
@@ -13000,9 +13140,8 @@ msgstr "git worktree prune [<opciones>]"
msgid "git worktree remove [<options>] <worktree>"
msgstr "git worktree remove [<opciones>] <worktree>"
-#, fuzzy
msgid "git worktree repair [<path>...]"
-msgstr "git worktree prune [<opciones>]"
+msgstr "git worktree repair [<ruta>...]"
msgid "git worktree unlock <path>"
msgstr "git worktree unlock <ruta>"
@@ -13045,14 +13184,16 @@ msgstr ""
#, c-format
msgid "failed to copy '%s' to '%s'; sparse-checkout may not work correctly"
msgstr ""
+"falló al copiar '%s' a '%s'; puede que el checkout escaso no funcione "
+"correctamente"
-#, fuzzy, c-format
+#, c-format
msgid "failed to copy worktree config from '%s' to '%s'"
-msgstr "falló al copiar notas de '%s' a '%s'"
+msgstr "falló al copiar la configuración del árbol de trabajo de '%s' a '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "failed to unset '%s' in '%s'"
-msgstr "falló al mover '%s' a '%s'"
+msgstr "falló al desconfigurar '%s' en '%s'"
#, c-format
msgid "could not create directory of '%s'"
@@ -13104,9 +13245,9 @@ msgid "try to match the new branch name with a remote-tracking branch"
msgstr ""
"intentar emparejar el nuevo nombre de rama con una rama de rastreo remoto"
-#, fuzzy, c-format
+#, c-format
msgid "options '%s', '%s', and '%s' cannot be used together"
-msgstr "Opciones --squash y --fixup no pueden ser usadas juntas"
+msgstr "las opciones '%s', '%s' y '%s' no pueden ser usadas juntas"
msgid "added with --lock"
msgstr "agregado con --lock"
@@ -13121,9 +13262,8 @@ msgid "add 'prunable' annotation to worktrees older than <time>"
msgstr ""
"agregar la anotación 'podable' a los árboles de trabajo anteriores a <tiempo>"
-#, fuzzy
msgid "terminate records with a NUL character"
-msgstr "terminar registros de entrada y salida con un carácter NUL"
+msgstr "terminar registros con un carácter NUL"
#, c-format
msgid "'%s' is not a working tree"
@@ -13238,6 +13378,27 @@ msgstr "escribir objeto de árbol para un subdirectorio <prefijo>"
msgid "only useful for debugging"
msgstr "solo útil para depurar"
+msgid "core.fsyncMethod = batch is unsupported on this platform"
+msgstr "core.fsyncMethod = batch no es soportado en este plataforma"
+
+msgid "failed to create temporary file"
+msgstr "falló al crear archivo temporal"
+
+msgid "insufficient capabilities"
+msgstr "capacidades insuficientes"
+
+#, c-format
+msgid "failed to download bundle from URI '%s'"
+msgstr "falló al descargar bundle del URI '%s'"
+
+#, c-format
+msgid "file at URI '%s' is not a bundle"
+msgstr "el archivo al URI '%s' no es un bundle"
+
+#, c-format
+msgid "failed to unbundle bundle from URI '%s'"
+msgstr "falló al extraer bundle del URI '%s'"
+
#, c-format
msgid "unrecognized bundle hash algorithm: %s"
msgstr "algoritmo bundle hash desconocido %s"
@@ -13260,20 +13421,20 @@ msgstr "Al repositorio le faltan estos commits prerrequisitos:"
msgid "need a repository to verify a bundle"
msgstr "se necesita un repositorio para verificar un bundle"
-#, fuzzy, c-format
+#, c-format
msgid "The bundle contains this ref:"
msgid_plural "The bundle contains these %<PRIuMAX> refs:"
msgstr[0] "El bundle contiene esta referencia:"
-msgstr[1] "El bundle contiene estas %d referencias:"
+msgstr[1] "El bundle contiene estas %<PRIuMAX> referencias:"
msgid "The bundle records a complete history."
msgstr "El bundle registra una historia completa."
-#, fuzzy, c-format
+#, c-format
msgid "The bundle requires this ref:"
msgid_plural "The bundle requires these %<PRIuMAX> refs:"
msgstr[0] "El bundle requiere esta referencia:"
-msgstr[1] "El bundle requiere estas %d referencias:"
+msgstr[1] "El bundle requiere estas %<PRIuMAX> referencias:"
msgid "unable to dup bundle descriptor"
msgstr "incapaz de duplicar bundle descriptor"
@@ -13445,6 +13606,9 @@ msgstr ""
"Dar a un objeto un nombre legible por humanos basado en una referencia "
"disponible"
+msgid "Generate a zip archive of diagnostic information"
+msgstr "Generar una crónica zip de información diagnóstica"
+
msgid "Show changes between commits, commit and working tree, etc"
msgstr "Mostrar los cambios entre commits, commit y árbol de trabajo, etc"
@@ -13512,7 +13676,7 @@ msgid "Display help information about Git"
msgstr "Mostrar información de ayuda sobre Git"
msgid "Run git hooks"
-msgstr ""
+msgstr "Ejecutar hooks de git"
msgid "Server side implementation of Git over HTTP"
msgstr "Implementación de lado de servidor de Git por HTTP"
@@ -13574,8 +13738,8 @@ msgstr "Ejecutar una fusión para archivos que la necesiten"
msgid "The standard helper program to use with git-merge-index"
msgstr "El programa de ayuda estándar para usar con git-merge-index"
-msgid "Show three-way merge without touching index"
-msgstr "Mostrar fusión de tres vías sin tocar el índice"
+msgid "Perform merge without touching index or working tree"
+msgstr "Realizar fusión sin tocar el índice o el árbol de trabajo"
msgid "Run merge conflict resolution tools to resolve merge conflicts"
msgstr ""
@@ -13709,9 +13873,8 @@ msgstr "Mostrar el índice de crónica empaquetado"
msgid "List references in a local repository"
msgstr "Listar referencias en el repositorio local"
-#, fuzzy
msgid "Reduce your working tree to a subset of tracked files"
-msgstr " (usa la opción -u para mostrar los archivos sin seguimiento)"
+msgstr "Reducir el árbol de trabajo a un subconjunto de archivos rastreados"
msgid "Add file contents to the staging area"
msgstr "Agregar contenidos de un archivo al área de staging"
@@ -13776,6 +13939,9 @@ msgstr "Validar crónicas Git empaquetadas"
msgid "Check the GPG signature of tags"
msgstr "Verificar la firma GPG de etiquetas"
+msgid "Display version information about Git"
+msgstr "Mostrar información de versión sobre Git"
+
msgid "Show logs with difference each commit introduces"
msgstr "Mostrar logs con las diferencias que cada commit introduce"
@@ -13809,6 +13975,24 @@ msgstr "Un conjunto mínimo útil de comandos cotidianos de Git"
msgid "Frequently asked questions about using Git"
msgstr "Preguntas frecuentes sobre el uso de Git"
+msgid "The bundle file format"
+msgstr "Formato de archivo de bundle"
+
+msgid "Chunk-based file formats"
+msgstr "Formatos de archivo basados en fragmentos"
+
+msgid "Git commit graph format"
+msgstr "Formato de grafo de commits de Git"
+
+msgid "Git index format"
+msgstr "Formato de índice de Git"
+
+msgid "Git pack format"
+msgstr "Formato de pack de Git"
+
+msgid "Git cryptographic signature formats"
+msgstr "Formatos de firma criptográfica de Git"
+
msgid "A Git Glossary"
msgstr "Un Glosario de Git"
@@ -13832,6 +14016,21 @@ msgstr "Definir las propiedades de submódulo"
msgid "Git namespaces"
msgstr "Namespaces de Git"
+msgid "Protocol v0 and v1 capabilities"
+msgstr "Capacidades de los protocolos v0 y v1"
+
+msgid "Things common to various protocols"
+msgstr "Cosas en común entre varios protocolos"
+
+msgid "Git HTTP-based protocols"
+msgstr "Protocolos de Git basados en HTTP"
+
+msgid "How packs are transferred over-the-wire"
+msgstr "Cómo los packs se transfieren en el alambre"
+
+msgid "Git Wire Protocol, Version 2"
+msgstr "Protocolo de alambre de Git, versión 2"
+
msgid "Helper programs to interact with remote repositories"
msgstr "Programas de ayuda para interactuar con repositorios remotos"
@@ -13856,6 +14055,9 @@ msgstr "Interfaz web Git (interfaz web para repositorios Git)"
msgid "An overview of recommended workflows with Git"
msgstr "Una visión general de flujos de trabajo recomendados con Git"
+msgid "A tool for managing large Git repositories"
+msgstr "Una herramienta para gestionar repositorios de Git grandes"
+
msgid "commit-graph file is too small"
msgstr "archivo commit-graph es demasiado pequeño"
@@ -13921,11 +14123,11 @@ msgstr "Calculando números de generación de commit graph"
msgid "Collecting referenced commits"
msgstr "Recolectando commits referenciados"
-#, fuzzy, c-format
+#, c-format
msgid "Finding commits for commit graph in %<PRIuMAX> pack"
msgid_plural "Finding commits for commit graph in %<PRIuMAX> packs"
-msgstr[0] "Encontrando commits para commit graph en %d pack"
-msgstr[1] "Encontrando commits para commit graph en %d packs"
+msgstr[0] "Encontrando commits para el grafo de commits en %<PRIuMAX> pack"
+msgstr[1] "Encontrando commits para el grafo de commits en %<PRIuMAX> packs"
#, c-format
msgid "error adding pack %s"
@@ -14087,12 +14289,12 @@ msgstr "El commit %s tiene una buena firma GPG por %s\n"
msgid ""
"Warning: commit message did not conform to UTF-8.\n"
"You may want to amend it after fixing the message, or set the config\n"
-"variable i18n.commitencoding to the encoding your project uses.\n"
+"variable i18n.commitEncoding to the encoding your project uses.\n"
msgstr ""
-"Peligro: el mensaje del commit no se ajusta a UTF-8.\n"
+"Advertencia: el mensaje del commit no se ajusta a UTF-8.\n"
"Tal vez quieras enmendarlo después de arreglar el mensaje, o arreglar la\n"
-"variable de configuración i18n.commitencoding para la codificación que use "
-"tu proyecto.\n"
+"variable de configuración i18n.commitEncoding para la codificación que el "
+"proyecto use.\n"
msgid "no compiler information available\n"
msgstr "no hay información disponible del compilador\n"
@@ -14100,138 +14302,140 @@ msgstr "no hay información disponible del compilador\n"
msgid "no libc information available\n"
msgstr "no hay información disponible de libc\n"
-#, fuzzy, c-format
+#, c-format
+msgid "could not determine free disk size for '%s'"
+msgstr "no se pudo determinar el espacio de disco libre de '%s'"
+
+#, c-format
+msgid "could not get info for '%s'"
+msgstr "no se pudo averiguar la información de '%s'"
+
+#, c-format
msgid "[GLE %ld] health thread could not open '%ls'"
-msgstr "no se pudo abrir '%s'"
+msgstr "[GLE %ld] el hilo de salud no pudo abrir '%ls'"
#, c-format
msgid "[GLE %ld] health thread getting BHFI for '%ls'"
-msgstr ""
+msgstr "[GLE %ld] hilo de salud averiguando BHFI de '%ls'"
-#, fuzzy, c-format
+#, c-format
msgid "could not convert to wide characters: '%s'"
-msgstr ""
-"no se pudo convertir el siguiente graft(s):\n"
-"%s"
+msgstr "no se pudo convertir a caracteres anchos: '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "BHFI changed '%ls'"
-msgstr "no se puede cambiar a '%s'"
+msgstr "BHFI cambió '%ls'"
#, c-format
msgid "unhandled case in 'has_worktree_moved': %d"
-msgstr ""
+msgstr "caso no manejado en 'has_worktree_moved': %d"
#, c-format
msgid "health thread wait failed [GLE %ld]"
-msgstr ""
+msgstr "falló la espera del hilo de salud [GLE %ld]"
-#, fuzzy
msgid "Unable to create FSEventStream."
-msgstr "no es posible crear hilo: %s"
+msgstr "Incapaz de crear FSEventStream."
-#, fuzzy
msgid "Failed to start the FSEventStream"
-msgstr "Falló al iniciar emacsclient."
+msgstr "Falló al iniciar el FSEventStream"
#, c-format
msgid "[GLE %ld] could not convert path to UTF-8: '%.*ls'"
-msgstr ""
+msgstr "[GLE %ld] no se pudo convertir la ruta a UTF-8: '%.*ls'"
-#, fuzzy, c-format
+#, c-format
msgid "[GLE %ld] could not watch '%s'"
-msgstr "no se pudo hacer stat en '%s'"
+msgstr "[GLE %ld] no se pudo vigilar '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "[GLE %ld] could not get longname of '%s'"
-msgstr "no se pudo conseguir 'onto': '%s'"
+msgstr "[GLE %ld] no se pudo averiguar el nombre largo de '%s'"
#, c-format
msgid "ReadDirectoryChangedW failed on '%s' [GLE %ld]"
-msgstr ""
+msgstr "Falló ReadDirectoryChangedW en '%s' [GLE %ld]"
#, c-format
msgid "GetOverlappedResult failed on '%s' [GLE %ld]"
-msgstr ""
+msgstr "Falló GetOverlappedResult en '%s' [GLE %ld]"
-#, fuzzy, c-format
+#, c-format
msgid "could not read directory changes [GLE %ld]"
-msgstr "no se pudo crear directorios para %s"
+msgstr "no se pudo leer los cambios de directorio [GLE %ld]"
+
+#, c-format
+msgid "[GLE %ld] unable to open for read '%ls'"
+msgstr "[GLE %ld] incapaz de abrir para leer '%ls'"
+
+#, c-format
+msgid "[GLE %ld] unable to get protocol information for '%ls'"
+msgstr "[GLE %ld] incapaz de averiguar la información de protocolo de '%ls'"
-#, fuzzy, c-format
+#, c-format
msgid "failed to copy SID (%ld)"
-msgstr "falló al copiar archivo a '%s'"
+msgstr "falló al copiar SID (%ld)"
-#, fuzzy, c-format
+#, c-format
msgid "failed to get owner for '%s' (%ld)"
-msgstr "falló al iterar sobre '%s'"
+msgstr "falló al averiguar el propietario de '%s' (%ld)"
msgid "memory exhausted"
msgstr "memoria agotada"
msgid "Success"
-msgstr ""
+msgstr "Éxito"
msgid "No match"
-msgstr ""
+msgstr "Ninguna coincidencia"
-#, fuzzy
msgid "Invalid regular expression"
-msgstr "usar expresiones regulares POSIX extendidas"
+msgstr "Expresión regular inválida"
-#, fuzzy
msgid "Invalid collation character"
-msgstr "carácter lastre"
+msgstr "Carácter de colación inválido"
-#, fuzzy
msgid "Invalid character class name"
-msgstr "carácter inválido en el nombre del host"
+msgstr "Nombre de clase de carácter inválido"
msgid "Trailing backslash"
-msgstr ""
+msgstr "Backslash al final"
-#, fuzzy
msgid "Invalid back reference"
-msgstr "referencia inválida: %s"
+msgstr "Referencia atrás inválida"
msgid "Unmatched [ or [^"
-msgstr ""
+msgstr "[ o [^ sin pareja"
msgid "Unmatched ( or \\("
-msgstr ""
+msgstr "( o \\( sin pareja"
msgid "Unmatched \\{"
-msgstr ""
+msgstr "\\{ sin pareja"
-#, fuzzy
msgid "Invalid content of \\{\\}"
-msgstr "contenido inválido: '%s'"
+msgstr "Contenido inválido de \\{\\}"
-#, fuzzy
msgid "Invalid range end"
-msgstr "codificación de transferencia inválida"
+msgstr "Fin inválido de rango"
-#, fuzzy
msgid "Memory exhausted"
-msgstr "memoria agotada"
+msgstr "Memoria agotada"
-#, fuzzy
msgid "Invalid preceding regular expression"
-msgstr "usar expresiones regulares POSIX extendidas"
+msgstr "Expresión regular precedente inválida"
-#, fuzzy
msgid "Premature end of regular expression"
-msgstr "usar expresiones regulares POSIX extendidas"
+msgstr "Fin prematuro de expresión regular"
msgid "Regular expression too big"
-msgstr ""
+msgstr "Expresión regular demasiada larga"
msgid "Unmatched ) or \\)"
-msgstr ""
+msgstr ") o \\) sin pareja"
-#, fuzzy
msgid "No previous regular expression"
-msgstr "usar expresiones regulares compatibles con Perl"
+msgstr "No hay expresión regular previa"
msgid "could not send IPC command"
msgstr "no se pudo enviar el comando IPC"
@@ -14247,28 +14451,27 @@ msgstr "no se pudo iniciar el accept_thread '%s'"
msgid "could not start worker[0] for '%s'"
msgstr "no se pudo iniciar el worker[0] para '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "ConnectNamedPipe failed for '%s' (%lu)"
-msgstr "uname() falló con error '%s' (%d)\n"
+msgstr "ConnectNamedPipe falló en '%s' (%lu)"
-#, fuzzy, c-format
+#, c-format
msgid "could not create fd from pipe for '%s'"
-msgstr "no se pudo crear directorios para %s"
+msgstr "no se pudo crear descriptor de archivo del pipe para '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "could not start thread[0] for '%s'"
-msgstr "no se pudo iniciar el worker[0] para '%s'"
+msgstr "no se pudo iniciar thread[0] para '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "wait for hEvent failed for '%s'"
-msgstr "Autenticación falló para '%s'"
+msgstr "espera de hEvent falló en '%s'"
msgid "cannot resume in the background, please use 'fg' to resume"
-msgstr ""
+msgstr "no se puede resumir en el fondo, por favor usa 'fg' para resumir"
-#, fuzzy
msgid "cannot restore terminal settings"
-msgstr "no se puede guardar el archivo índice"
+msgstr "no se puede restaurar la configuración de terminal"
#, c-format
msgid ""
@@ -14299,6 +14502,8 @@ msgid ""
"remote URLs cannot be configured in file directly or indirectly included by "
"includeIf.hasconfig:remote.*.url"
msgstr ""
+"no se pueden configurar URLs remotos en archivo incluido directa o "
+"indirectamente por includeIf.hasconfig:remote.*.url"
#, c-format
msgid "invalid config format: %s"
@@ -14415,13 +14620,13 @@ msgstr ""
msgid "bad numeric config value '%s' for '%s' in %s: %s"
msgstr "mal valor de config numérico '%s' para '%s' en %s: %s"
-#, fuzzy, c-format
+#, c-format
msgid "invalid value for variable %s"
-msgstr "valor inválido para %s"
+msgstr "valor inválido para la variable %s"
#, c-format
msgid "ignoring unknown core.fsync component '%s'"
-msgstr ""
+msgstr "ignorando componente desconocido de core.fsync '%s'"
#, c-format
msgid "bad boolean config value '%s' for '%s'"
@@ -14448,10 +14653,10 @@ msgstr "core.commentChar debería tener solo un carácter"
#, c-format
msgid "ignoring unknown core.fsyncMethod value '%s'"
-msgstr ""
+msgstr "ignorando valor desconocido de core.fsyncMethod '%s'"
msgid "core.fsyncObjectFiles is deprecated; use core.fsync instead"
-msgstr ""
+msgstr "core.fsyncObjectFiles es deprecado; usa core.fsync en su lugar"
#, c-format
msgid "invalid mode for object creation: %s"
@@ -14708,190 +14913,6 @@ msgid "failed to close rev-list's stdin"
msgstr "falló al cerrar la entrada standard de rev-list"
#, c-format
-msgid "'%s' does not exist"
-msgstr "'%s' no existe"
-
-#, fuzzy
-msgid "need a working directory"
-msgstr "Incapaz de leer el directorio de trabajo actual"
-
-#, fuzzy
-msgid "could not find enlistment root"
-msgstr "no se pudo encontrar commit %s"
-
-#, fuzzy, c-format
-msgid "could not switch to '%s'"
-msgstr "no se pudo cambiar a %s"
-
-#, fuzzy, c-format
-msgid "could not configure %s=%s"
-msgstr "no se pudo bloquear archivo de configuración %s"
-
-msgid "could not configure log.excludeDecoration"
-msgstr ""
-
-msgid "Scalar enlistments require a worktree"
-msgstr ""
-
-#, c-format
-msgid "could not open directory '%s'"
-msgstr "no se pudo abrir el directorio '%s'"
-
-#, fuzzy, c-format
-msgid "skipping '%s', which is neither file nor directory"
-msgstr "destino '%s' no es un directorio"
-
-#, fuzzy, c-format
-msgid "could not determine free disk size for '%s'"
-msgstr "no se pudo crear un árbol de trabajo '%s'"
-
-#, fuzzy, c-format
-msgid "could not get info for '%s'"
-msgstr "no se pudo leer el log para '%s'"
-
-#, fuzzy, c-format
-msgid "remote HEAD is not a branch: '%.*s'"
-msgstr " Rama HEAD: %s"
-
-msgid "failed to get default branch name from remote; using local default"
-msgstr ""
-
-#, fuzzy
-msgid "failed to get default branch name"
-msgstr "falló al formatear el valor por defecto de configuración: %s"
-
-#, fuzzy
-msgid "failed to unregister repository"
-msgstr "falló al crear directorio %s"
-
-#, fuzzy
-msgid "failed to delete enlistment directory"
-msgstr "falló al eliminar directorio %s"
-
-msgid "branch to checkout after clone"
-msgstr ""
-
-#, fuzzy
-msgid "when cloning, create full working directory"
-msgstr "no es posible obtener el directorio de trabajo actual"
-
-msgid "only download metadata for the branch that will be checked out"
-msgstr ""
-
-#, fuzzy
-msgid "scalar clone [<options>] [--] <repo> [<dir>]"
-msgstr "git clone [<opciones>] [--] <repo> [<directorio>]"
-
-#, fuzzy, c-format
-msgid "cannot deduce worktree name from '%s'"
-msgstr "No se puede acceder al árbol de trabajo '%s'"
-
-#, c-format
-msgid "directory '%s' exists already"
-msgstr ""
-
-#, fuzzy, c-format
-msgid "failed to get default branch for '%s'"
-msgstr "error al conseguir el remoto por defecto para el submódulo '%s'"
-
-#, fuzzy, c-format
-msgid "could not configure remote in '%s'"
-msgstr "no se pudo crear el archivo '%s'"
-
-#, fuzzy, c-format
-msgid "could not configure '%s'"
-msgstr "no se pudo cerrar '%s'"
-
-msgid "partial clone failed; attempting full clone"
-msgstr ""
-
-#, fuzzy
-msgid "could not configure for full clone"
-msgstr "no se pudo bloquear archivo de configuración %s"
-
-msgid "scalar diagnose [<enlistment>]"
-msgstr ""
-
-#, fuzzy, c-format
-msgid "could not create directory for '%s'"
-msgstr "No se pudo crear el directorio para '%s'"
-
-#, fuzzy
-msgid "could not duplicate stdout"
-msgstr "no se puede actualizar %s"
-
-#, fuzzy
-msgid "failed to write archive"
-msgstr "falló al leer la cache"
-
-#, fuzzy
-msgid "`scalar list` does not take arguments"
-msgstr "%%(rest) no toma ningún argumento"
-
-msgid "scalar register [<enlistment>]"
-msgstr ""
-
-msgid "reconfigure all registered enlistments"
-msgstr ""
-
-msgid "scalar reconfigure [--all | <enlistment>]"
-msgstr ""
-
-msgid "--all or <enlistment>, but not both"
-msgstr ""
-
-#, fuzzy, c-format
-msgid "git repository gone in '%s'"
-msgstr "no es un repositorio git: '%s'"
-
-msgid ""
-"scalar run <task> [<enlistment>]\n"
-"Tasks:\n"
-msgstr ""
-
-#, fuzzy, c-format
-msgid "no such task: '%s'"
-msgstr "no existe tal rama: '%s'"
-
-msgid "scalar unregister [<enlistment>]"
-msgstr ""
-
-msgid "scalar delete <enlistment>"
-msgstr ""
-
-#, fuzzy
-msgid "refusing to delete current working directory"
-msgstr "no es posible obtener el directorio de trabajo actual"
-
-#, fuzzy
-msgid "include Git version"
-msgstr "versión de hash inválida"
-
-msgid "include Git's build options"
-msgstr ""
-
-msgid "scalar verbose [-v | --verbose] [--build-options]"
-msgstr ""
-
-#, fuzzy
-msgid "-C requires a <directory>"
-msgstr "--stdin requiere un repositorio git"
-
-#, fuzzy, c-format
-msgid "could not change to '%s'"
-msgstr "no se puede cambiar a '%s'"
-
-#, fuzzy
-msgid "-c requires a <key>=<value> argument"
-msgstr "-n requiere un argumento"
-
-msgid ""
-"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
-"\n"
-"Commands:\n"
-msgstr ""
-
-#, c-format
msgid "illegal crlf_action %d"
msgstr "crlf_action %d ilegal"
@@ -14904,6 +14925,8 @@ msgid ""
"in the working copy of '%s', CRLF will be replaced by LF the next time Git "
"touches it"
msgstr ""
+"en la copia de trabajo de '%s', CRLF será reemplazado con LF la próxima vez "
+"que Git la toque"
#, c-format
msgid "LF would be replaced by CRLF in %s"
@@ -14914,6 +14937,8 @@ msgid ""
"in the working copy of '%s', LF will be replaced by CRLF the next time Git "
"touches it"
msgstr ""
+"en la copia de trabajo de '%s', LF será reemplazado con CRLF la próxima vez "
+"que Git la toque"
#, c-format
msgid "BOM is prohibited in '%s' if encoded as %s"
@@ -15092,6 +15117,32 @@ msgstr "regex isla de config tiene demasiados grupos de captura (max=%d)"
msgid "Marked %d islands, done.\n"
msgstr "%d islas marcadas, listo.\n"
+#, c-format
+msgid "invalid --%s value '%s'"
+msgstr "valor de --%s inválido '%s'"
+
+#, c-format
+msgid "could not archive missing directory '%s'"
+msgstr "no se pudo archivar el directorio faltante '%s'"
+
+#, c-format
+msgid "could not open directory '%s'"
+msgstr "no se pudo abrir el directorio '%s'"
+
+#, c-format
+msgid "skipping '%s', which is neither file nor directory"
+msgstr "saltando '%s', el cual no es ni archivo ni directorio"
+
+msgid "could not duplicate stdout"
+msgstr "no se pudo duplicar stdout"
+
+#, c-format
+msgid "could not add directory '%s' to archiver"
+msgstr "no se pudo añadir el directorio '%s' al cronista"
+
+msgid "failed to write archive"
+msgstr "falló al escribir crónica"
+
msgid "--merge-base does not work with ranges"
msgstr "--merge-base no funciona con rangos"
@@ -15165,18 +15216,21 @@ msgstr ""
msgid "external diff died, stopping at %s"
msgstr "diff externo murió, deteniendo en %s"
-#, fuzzy, c-format
+#, c-format
msgid "options '%s', '%s', '%s', and '%s' cannot be used together"
-msgstr "Opciones --squash y --fixup no pueden ser usadas juntas"
+msgstr "las opciones '%s', '%s', '%s' y '%s' no pueden ser usadas juntas"
-#, fuzzy, c-format
+#, c-format
msgid "options '%s' and '%s' cannot be used together, use '%s' with '%s'"
-msgstr "'%s' o '%s' no puede ser usado con %s"
+msgstr ""
+"las opciones '%s' y '%s' no pueden ser usadas juntas, usa '%s' con '%s'"
-#, fuzzy, c-format
+#, c-format
msgid ""
"options '%s' and '%s' cannot be used together, use '%s' with '%s' and '%s'"
-msgstr "'%s' o '%s' no puede ser usado con %s"
+msgstr ""
+"las opciones '%s' y '%s' no pueden ser usadas juntas, usa '%s' con '%s' y "
+"'%s'"
msgid "--follow requires exactly one pathspec"
msgstr "--follow requiere exactamente un pathspec"
@@ -15596,9 +15650,8 @@ msgstr "seleccionar archivos por tipo de diff"
msgid "<file>"
msgstr "<archivo>"
-#, fuzzy
msgid "output to a specific file"
-msgstr "Output a un archivo específico"
+msgstr "emitir a un archivo específico"
msgid "exhaustive rename detection was skipped due to too many files."
msgstr ""
@@ -15714,6 +15767,9 @@ msgstr "git fetch-pack: se esperaba ACK/NAK, se obtuvo '%s'"
msgid "unable to write to remote"
msgstr "no se puede escribir al remoto"
+msgid "Server supports filter"
+msgstr "El servidor soporta filtración"
+
#, c-format
msgid "invalid shallow line: %s"
msgstr "línea shallow inválida: %s"
@@ -15824,9 +15880,6 @@ msgstr "el servidor no soporta el algoritmo '%s'"
msgid "Server does not support shallow requests"
msgstr "El servidor no soporta peticiones superficiales"
-msgid "Server supports filter"
-msgstr "El servidor soporta filtración"
-
msgid "unable to write request to remote"
msgstr "no se puede escribir request al remoto"
@@ -15834,9 +15887,9 @@ msgstr "no se puede escribir request al remoto"
msgid "expected '%s', received '%s'"
msgstr "se esperaba '%s', se recibió '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "expected '%s'"
-msgstr "línea inesperada: '%s'"
+msgstr "se esperó '%s'"
#, c-format
msgid "unexpected acknowledgment line: '%s'"
@@ -15849,16 +15902,17 @@ msgstr "error al procesar acks: %d"
#. TRANSLATORS: The parameter will be 'ready', a protocol
#. keyword.
#.
-#, fuzzy, c-format
+#, c-format
msgid "expected packfile to be sent after '%s'"
-msgstr "se esperaba que el packfile fuera enviado luego del 'listo'"
+msgstr "se esperaba que el archivo de pack fuera enviado luego del '%s'"
#. TRANSLATORS: The parameter will be 'ready', a protocol
#. keyword.
#.
-#, fuzzy, c-format
+#, c-format
msgid "expected no other sections to be sent after no '%s'"
-msgstr "se esperaba que ninguna otra sección fuera enviada luego del 'listo'"
+msgstr ""
+"se esperaba que ninguna otra sección fuera enviada luego de la falta de '%s'"
#, c-format
msgid "error processing shallow info: %d"
@@ -15895,41 +15949,42 @@ msgstr "El servidor no permite solicitudes de objetos inadvertidos %s"
#, c-format
msgid "fsmonitor_ipc__send_query: invalid path '%s'"
-msgstr ""
+msgstr "fsmonitor_ipc__send_query: ruta inválida '%s'"
#, c-format
msgid "fsmonitor_ipc__send_query: unspecified error on '%s'"
-msgstr ""
+msgstr "fsmonitor_ipc__send_query: error no especificado en '%s'"
msgid "fsmonitor--daemon is not running"
-msgstr ""
+msgstr "fsmonitor--daemon no está ejecutándose"
-#, fuzzy, c-format
+#, c-format
msgid "could not send '%s' command to fsmonitor--daemon"
-msgstr "no se pudo enviar el comando IPC"
+msgstr "no se pudo enviar el comando '%s' a fsmonitor--daemon"
-#, fuzzy, c-format
+#, c-format
msgid "bare repository '%s' is incompatible with fsmonitor"
-msgstr "%s es incompatible con %s"
+msgstr "el repositorio desnudo '%s es incompatible con fsmonitor"
#, c-format
msgid "repository '%s' is incompatible with fsmonitor due to errors"
-msgstr ""
+msgstr "el repositorio '%s' es incompatible con fsmonitor a causa de errores"
-#, fuzzy, c-format
+#, c-format
msgid "remote repository '%s' is incompatible with fsmonitor"
-msgstr "%s es incompatible con %s"
+msgstr "el repositorio remoto '%s' es incompatible con fsmonitor"
-#, fuzzy, c-format
+#, c-format
msgid "virtual repository '%s' is incompatible with fsmonitor"
-msgstr "%s es incompatible con %s"
+msgstr "el repositorio virtual '%s' es incompatible con fsmonitor"
#, c-format
msgid ""
"repository '%s' is incompatible with fsmonitor due to lack of Unix sockets"
msgstr ""
+"el repositorio '%s' es incompatible con fsmonitor a causa de falta de "
+"sockets de Unix"
-#, fuzzy
msgid ""
"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
@@ -15939,14 +15994,14 @@ msgid ""
" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
" <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C <ruta>] [-c <nombre>=<valor>]\n"
-" [--exec-path [= <path>]] [--html-path] [--man-path] [--info-"
-"path]\n"
-" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
+"git [-v | --version] [-h | --help] [-C <ruta>] [-c <nombre>=<valor>]\n"
+" [--exec-path[=<ruta>]] [--html-path] [--man-path] [--info-path]\n"
+" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
-" [--git-dir=<ruta>] [--work-tree=<ruta>] [--namespace=<nombre>]\n"
-" [--super-prefix=<ruta>] [--config-env=<nombre>=<envvar>]\n"
-" <comando> [<args>]"
+" [--git-dir=<ruta>] [--work-tree=<ruta>] [--namespace=<nombre>]\n"
+" [--super-prefix=<ruta>] [--config-env=<nombre>=<variable-de-"
+"entorno>]\n"
+" <comando> [<argumentos>]"
msgid ""
"'git help -a' and 'git help -g' list available subcommands and some\n"
@@ -15963,9 +16018,9 @@ msgstr ""
msgid "unsupported command listing type '%s'"
msgstr "tipo de listado de comandos no soportado '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "no directory given for '%s' option\n"
-msgstr "no se entregó directorio para -C\n"
+msgstr "no se entregó un directorio para la opción '%s'\n"
#, c-format
msgid "no namespace given for --namespace\n"
@@ -16090,8 +16145,8 @@ msgstr "gpg.ssh.defaultKeyCommand falló: %s %s"
msgid "gpg failed to sign the data"
msgstr "gpg falló al firmar los datos"
-msgid "user.signingkey needs to be set for ssh signing"
-msgstr "user.signingkey necesita ser configurado para firmar con ssh"
+msgid "user.signingKey needs to be set for ssh signing"
+msgstr "user.signingKey necesita ser configurado para firmar con ssh"
#, c-format
msgid "failed writing ssh signing key to '%s'"
@@ -16170,6 +16225,14 @@ msgstr "Comandos de bajo nivel / Sincronización de repositorios"
msgid "Low-level Commands / Internal Helpers"
msgstr "Comandos de bajo nivel / Auxiliares internos"
+msgid "User-facing repository, command and file interfaces"
+msgstr "Interfaces de repositorio, comando y archivo orientadas al usuario"
+
+msgid "Developer-facing file formats, protocols and other interfaces"
+msgstr ""
+"Formatos de archivo, protocolos e otras interfaces orientados al "
+"desarrollador"
+
#, c-format
msgid "available git commands in '%s'"
msgstr "comandos disponibles de git en '%s'"
@@ -16183,6 +16246,13 @@ msgstr "Estos son comandos comunes de Git usados en varias situaciones:"
msgid "The Git concept guides are:"
msgstr "Las guías de conceptos de Git son:"
+msgid "User-facing repository, command and file interfaces:"
+msgstr "Interfaces de repositorio, comando y archivo orientadas al usuario:"
+
+msgid "File formats, protocols and other developer interfaces:"
+msgstr ""
+"Formatos de archivo, protocolos y otras interfaces para el desarrollador:"
+
msgid "External commands"
msgstr "Comandos externos"
@@ -16209,15 +16279,15 @@ msgstr "Oh oh. Tu sistema no reporta ningún comando de Git."
#, c-format
msgid "WARNING: You called a Git command named '%s', which does not exist."
-msgstr "PELIGRO: Has llamado a un comando de Git '%s', el cual no existe."
+msgstr "ADVERTENCIA: Has llamado a un comando de Git '%s', el cual no existe."
#, c-format
msgid "Continuing under the assumption that you meant '%s'."
msgstr "Continuando asumiendo que quisiste decir '%s'."
-#, fuzzy, c-format
+#, c-format
msgid "Run '%s' instead [y/N]? "
-msgstr "Ejecutar '%s' en su lugar? (y/N)"
+msgstr "¿Ejecutar '%s' en su lugar [y/N]? "
#, c-format
msgid "Continuing in %0.1f seconds, assuming that you meant '%s'."
@@ -16264,10 +16334,6 @@ msgstr ""
"El hook '%s' fue ignorado porque no ha sido configurado como ejecutable.\n"
"Puedes desactivar esta advertencia con `git config advice.ignoredHook false`."
-#, fuzzy, c-format
-msgid "Couldn't start hook '%s'\n"
-msgstr "No se pudo hacer stat en '%s'"
-
#, c-format
msgid "argument to --packfile must be a valid hash (got '%s')"
msgstr "argumento para --packfile tiene que se un hash válido (se obtuvo '%s')"
@@ -16276,8 +16342,8 @@ msgid "not a git repository"
msgstr "no es un repositorio git"
#, c-format
-msgid "negative value for http.postbuffer; defaulting to %d"
-msgstr "valor negativo para http.postbuffer; poniendo el default %d"
+msgid "negative value for http.postBuffer; defaulting to %d"
+msgstr "valor negativo de http.postBuffer; usando el valor por defecto %d"
msgid "Delegation control is not supported with cURL < 7.22.0"
msgstr "Delegación de control no es soportada con cURL < 7.22.0"
@@ -16454,19 +16520,14 @@ msgid "quoted CRLF detected"
msgstr "CRLF con comillas detectado"
#, c-format
-msgid ""
-"Your local changes to the following files would be overwritten by merge:\n"
-" %s"
-msgstr ""
-"Los cambios locales de los siguientes archivos serán sobreescritos por "
-"merge:\n"
-" %s"
-
-#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "Falló al fusionar el submódulo %s (no revisado)"
#, c-format
+msgid "Failed to merge submodule %s (no merge base)"
+msgstr "Falló al fusionar el submódulo %s (no hay base de fusión)"
+
+#, c-format
msgid "Failed to merge submodule %s (commits not present)"
msgstr "Falló al fusionar el submódulo %s (commits no presentes)"
@@ -16484,28 +16545,10 @@ msgstr "Falló al fusionar el submódulo %s"
#, c-format
msgid ""
-"Failed to merge submodule %s, but a possible merge resolution exists:\n"
-"%s\n"
+"Failed to merge submodule %s, but a possible merge resolution exists: %s"
msgstr ""
-"Falló al fusionar el submódulo %s, pero existen posibles soluciones de "
-"fusión:\n"
-"%s\n"
-
-#, c-format
-msgid ""
-"If this is correct simply add it to the index for example\n"
-"by using:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"which will accept this suggestion.\n"
-msgstr ""
-"Si esto es correcto simplemente agrégalo al índice por ejemplo\n"
-"usando:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"el cual aceptará esta sugerencia.\n"
+"Falló al fusionar el submódulo %s, pero existe una solución de fusión "
+"posible: %s"
#, c-format
msgid ""
@@ -16559,7 +16602,7 @@ msgid ""
"WARNING: Avoiding applying %s -> %s rename to %s, because %s itself was "
"renamed."
msgstr ""
-"PELIGRO: Evitando aplicar %s -> %s renombrado a %s, porque %s mismo fue "
+"ADVERTENCIA: Evitando aplicar %s -> %s renombrado a %s, porque %s mismo fue "
"renombrado."
#, c-format
@@ -16671,13 +16714,45 @@ msgstr ""
"CONFLICTO (modificar / eliminar): %s eliminado en %s y modificado en %s. "
"Versión %s de %s restante en el árbol."
+#. TRANSLATORS: This is a line of advice to resolve a merge
+#. conflict in a submodule. The first argument is the submodule
+#. name, and the second argument is the abbreviated id of the
+#. commit that needs to be merged. For example:
+#. - go to submodule (mysubmodule), and either merge commit abc1234"
+#.
#, c-format
msgid ""
-"Note: %s not up to date and in way of checking out conflicted version; old "
-"copy renamed to %s"
+" - go to submodule (%s), and either merge commit %s\n"
+" or update to an existing commit which has merged those changes\n"
msgstr ""
-"Nota: %s no está actualizado y en conflicto con la versión; la copia antigua "
-"fue renombrada a %s"
+" - ve al submódulo (%s), y después o fusiona el commit %s\n"
+" o actualiza a un commit existente en que ya se han fusionado esos "
+"cambios\n"
+
+#, c-format
+msgid ""
+"Recursive merging with submodules currently only supports trivial cases.\n"
+"Please manually handle the merging of each conflicted submodule.\n"
+"This can be accomplished with the following steps:\n"
+"%s - come back to superproject and run:\n"
+"\n"
+" git add %s\n"
+"\n"
+" to record the above merge or update\n"
+" - resolve any other conflicts in the superproject\n"
+" - commit the resulting index in the superproject\n"
+msgstr ""
+"La fusión recursiva con submódulos actualmente solo soporta casos "
+"triviales.\n"
+"Por favor, maneja manualmente la fusión de cada submódulo en conflicto.\n"
+"Esto se puede lograr con los pasos siguientes:\n"
+"%s - volver al superproyecto y ejecutar:\n"
+"\n"
+" git add %s\n"
+"\n"
+" para registrar la fusión de arriba o actualizar\n"
+" - resolver cualquier otro conflicto en el superproyecto\n"
+" - hace commit al índice resultante en el superproyecto\n"
#. TRANSLATORS: The %s arguments are: 1) tree hash of a merge
#. base, and 2-3) the trees for the two trees we're merging.
@@ -16750,6 +16825,22 @@ msgid "Found a possible merge resolution for the submodule:\n"
msgstr "Se encontró una posible solución de fusión para el submódulo:\n"
#, c-format
+msgid ""
+"If this is correct simply add it to the index for example\n"
+"by using:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"which will accept this suggestion.\n"
+msgstr ""
+"Si esto es correcto simplemente agrégalo al índice por ejemplo\n"
+"usando:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"el cual aceptará esta sugerencia.\n"
+
+#, c-format
msgid "Failed to merge submodule %s (multiple merges found)"
msgstr "Falló al fusionar el submódulo %s (múltiples fusiones encontradas)"
@@ -17020,9 +17111,8 @@ msgstr "pack de referencia '% s' ha expirado"
msgid "no pack files to index."
msgstr "no hay archivos pack para indexar."
-#, fuzzy
msgid "refusing to write multi-pack .bitmap without any objects"
-msgstr "no se pudo escribir bitmap multi-paquete"
+msgstr "rehusando escribir .bitmap de multi-pack sin ningún objeto"
msgid "could not write multi-pack bitmap"
msgstr "no se pudo escribir bitmap multi-paquete"
@@ -17283,6 +17373,22 @@ msgid "confused by unstable object source data for %s"
msgstr "confundido por fuente de data de objetos inestable para %s"
#, c-format
+msgid "write stream object %ld != %<PRIuMAX>"
+msgstr "objeto de stream de escritura %ld != %<PRIuMAX>"
+
+#, c-format
+msgid "unable to stream deflate new object (%d)"
+msgstr "incapaz de desinflar dinamicamente el objeto nuevo (%d)"
+
+#, c-format
+msgid "deflateEnd on stream object failed (%d)"
+msgstr "deflateEnd en el objeto de stream falló (%d)"
+
+#, c-format
+msgid "unable to create directory %s"
+msgstr "incapaz de crear directorio %s"
+
+#, c-format
msgid "cannot read object for %s"
msgstr "no se pudo leer el objeto para %s"
@@ -17340,23 +17446,23 @@ msgstr "no es posible desempaquetar contenidos de %s"
#. output shown when we cannot look up or parse the
#. object in question. E.g. "deadbeef [bad object]".
#.
-#, fuzzy, c-format
+#, c-format
msgid "%s [bad object]"
-msgstr "tipo de objeto erróneo."
+msgstr "%s [mal objeto]"
#. TRANSLATORS: This is a line of ambiguous commit
#. object output. E.g.:
#. *
-#. "deadbeef commit 2021-01-01 - Some Commit Message"
+#. "deadbeef commit 2021-01-01 - Some Commit Message"
#.
-#, fuzzy, c-format
+#, c-format
msgid "%s commit %s - %s"
-msgstr "%s: %s - %s"
+msgstr "%s commit %s - %s"
#. TRANSLATORS: This is a line of ambiguous
#. tag object output. E.g.:
#. *
-#. "deadbeef tag 2022-01-01 - Some Tag Message"
+#. "deadbeef tag 2022-01-01 - Some Tag Message"
#. *
#. The second argument is the YYYY-MM-DD found
#. in the tag.
@@ -17364,33 +17470,33 @@ msgstr "%s: %s - %s"
#. The third argument is the "tag" string
#. from object.c.
#.
-#, fuzzy, c-format
+#, c-format
msgid "%s tag %s - %s"
-msgstr "%s: %s - %s"
+msgstr "%s etiqueta %s - %s"
#. TRANSLATORS: This is a line of ambiguous
#. tag object output where we couldn't parse
#. the tag itself. E.g.:
#. *
-#. "deadbeef [bad tag, could not parse it]"
+#. "deadbeef [bad tag, could not parse it]"
#.
-#, fuzzy, c-format
+#, c-format
msgid "%s [bad tag, could not parse it]"
-msgstr "%s: no se pudo analizar objeto: %s"
+msgstr "%s [mala etiqueta, no se pudo analizar]"
#. TRANSLATORS: This is a line of ambiguous <type>
#. object output. E.g. "deadbeef tree".
#.
-#, fuzzy, c-format
+#, c-format
msgid "%s tree"
-msgstr "hilo %s falló"
+msgstr "árbol %s"
#. TRANSLATORS: This is a line of ambiguous <type>
#. object output. E.g. "deadbeef blob".
#.
-#, fuzzy, c-format
+#, c-format
msgid "%s blob"
-msgstr "blob"
+msgstr "blob %s"
#, c-format
msgid "short object ID %s is ambiguous"
@@ -17400,11 +17506,13 @@ msgstr "el ID de objeto corto %s es ambiguo"
#. objects composed in show_ambiguous_object(). See
#. its "TRANSLATORS" comments for details.
#.
-#, fuzzy, c-format
+#, c-format
msgid ""
"The candidates are:\n"
"%s"
-msgstr "Los candidatos son:"
+msgstr ""
+"Los candidatos son:\n"
+"%s"
msgid ""
"Git normally never creates a ref that ends with 40 hex characters\n"
@@ -17482,7 +17590,7 @@ msgstr ""
#, c-format
msgid "<object>:<path> required, only <object> '%s' given"
-msgstr ""
+msgstr "<objeto>:<ruta> requerido, solo <objeto> '%s' proporcionado"
#, c-format
msgid "invalid object name '%.*s'."
@@ -17508,40 +17616,144 @@ msgstr "incapaz de analizar objeto: %s"
msgid "hash mismatch %s"
msgstr "hash no concuerda %s"
+msgid "trying to write commit not in index"
+msgstr "intentando escribir un commit que no está en el índice"
+
+msgid "failed to load bitmap index (corrupted?)"
+msgstr "falló al cargar el índice de bitmap (¿corrupto?)"
+
+msgid "corrupted bitmap index (too small)"
+msgstr "índice de bitmap corrupto (demasiado pequeño)"
+
+msgid "corrupted bitmap index file (wrong header)"
+msgstr "archivo de índice de bitmap corrupto (cabecera errónea)"
+
+#, c-format
+msgid "unsupported version '%d' for bitmap index file"
+msgstr "versión no soportada '%d' de archivo de índice de bitmap"
+
+msgid "corrupted bitmap index file (too short to fit hash cache)"
+msgstr ""
+"archivo de índice de bitmap corrupto (demasiado corto para el cache de hash)"
+
+msgid "corrupted bitmap index file (too short to fit lookup table)"
+msgstr ""
+"archivo de índice de bitmap corrupto (demasiado corto para la tabla de "
+"consultación)"
+
+#, c-format
+msgid "duplicate entry in bitmap index: '%s'"
+msgstr "entrada duplicada en el índice de bitmap: '%s'"
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for entry %d"
+msgstr "bitmap ewah corrupto: cabecera truncada en la entrada %d"
+
+#, c-format
+msgid "corrupt ewah bitmap: commit index %u out of range"
+msgstr "bitmap ewah corrupto: índice de commit %u fuera de rango"
+
+msgid "corrupted bitmap pack index"
+msgstr "índice de pack de bitmap corrupto"
+
+msgid "invalid XOR offset in bitmap pack index"
+msgstr "offset XOR inválido en el índice de pack de bitmap"
+
+msgid "cannot fstat bitmap file"
+msgstr "no se puede hacer fstat en el archivo de bitmap"
+
+#, c-format
+msgid "ignoring extra bitmap file: '%s'"
+msgstr "ignorando el archivo extra de bitmap: '%s'"
+
+msgid "checksum doesn't match in MIDX and bitmap"
+msgstr "no se concuerden los checksums del MIDX y del bitmap"
+
msgid "multi-pack bitmap is missing required reverse index"
msgstr "a multi-pack-index le falta un índice reveretido"
-#, fuzzy, c-format
+#, c-format
msgid "could not open pack %s"
-msgstr "no se pudo abrir '%s'"
+msgstr "no se pudo abrir el pack %s"
-#, fuzzy, c-format
+#, c-format
msgid "preferred pack (%s) is invalid"
-msgstr "pack de referencia '% s' ha expirado"
+msgstr "el pack preferido (%s) es inválido"
+
+msgid "corrupt bitmap lookup table: triplet position out of index"
+msgstr "tabla de consultación corrupta: posición de trillizo fuera del índice"
+
+msgid "corrupt bitmap lookup table: xor chain exceeds entry count"
+msgstr ""
+"tabla de consultación de bitmap corrupta: la cadena xor excede el número de "
+"entradas"
+
+#, c-format
+msgid "corrupt bitmap lookup table: commit index %u out of range"
+msgstr ""
+"tabla de consultación de bitmap corrupta: índice de commit %u fuera de rango"
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for bitmap of commit \"%s\""
+msgstr "bitmap ewah corrupto: cabecera truncada del bitmap del commit \"%s\""
+
+#, c-format
+msgid "object '%s' not found in type bitmaps"
+msgstr "objeto '%s' no encontrado en bitmaps de tipo"
+
+#, c-format
+msgid "object '%s' does not have a unique type"
+msgstr "el objeto '%s' no tiene un tipo único"
+
+#, c-format
+msgid "object '%s': real type '%s', expected: '%s'"
+msgstr "objeto '%s': tipo real '%s', esperado: '%s'"
+
+#, c-format
+msgid "object not in bitmap: '%s'"
+msgstr "objeto no en bitmap: '%s'"
+
+msgid "failed to load bitmap indexes"
+msgstr "falló en cargar índices de bitmap"
+
+msgid "you must specify exactly one commit to test"
+msgstr "hay que especificar exactamente un commit para probar"
+
+#, c-format
+msgid "commit '%s' doesn't have an indexed bitmap"
+msgstr "el commit '%s' no tiene un bitmap indexado"
+
+msgid "mismatch in bitmap results"
+msgstr "discordancia en los resultados de bitmap"
#, c-format
-msgid "could not find %s in pack %s at offset %<PRIuMAX>"
-msgstr "no se pudo encontrar %s en paquete %s en el offset %<PRIuMAX>"
+msgid "could not find '%s' in pack '%s' at offset %<PRIuMAX>"
+msgstr "no se pudo encontrar '%s' en el pack '%s' al offset %<PRIuMAX>"
-#, fuzzy, c-format
+#, c-format
+msgid "unable to get disk usage of '%s'"
+msgstr "incapaz de obtener el uso de disco de '%s'"
+
+#, c-format
msgid "mtimes file %s is too small"
-msgstr "el archivo multi-pack-index %s es demasiado pequeño"
+msgstr "el archivo de mtimes %s es demasiado pequeño"
-#, fuzzy, c-format
+#, c-format
msgid "mtimes file %s has unknown signature"
-msgstr "el archivo de índice inverso %s tiene una firma desconocida"
+msgstr "el archivo de mtimes %s tiene una firma desconocida"
-#, fuzzy, c-format
+#, c-format
msgid "mtimes file %s has unsupported version %<PRIu32>"
-msgstr "archivo reverse-index %s tiene una versión no soportada %<PRIu32>"
+msgstr "el archivo de mtimes %s tiene una versión no soportada %<PRIu32>"
-#, fuzzy, c-format
+#, c-format
msgid "mtimes file %s has unsupported hash id %<PRIu32>"
-msgstr "archivo reverse-index %s tiene un id de hash no soportado %<PRIu32>"
+msgstr ""
+"el archivo de mtimes %s tiene un identificador de hash no soportado %<PRIu32>"
-#, fuzzy, c-format
+#, c-format
msgid "mtimes file %s is corrupt"
-msgstr "el archivo de índice inverso %s está dañado"
+msgstr "el archivo de mtimes %s es corrupto"
#, c-format
msgid "reverse-index file %s is too small"
@@ -17557,11 +17769,13 @@ msgstr "el archivo de índice inverso %s tiene una firma desconocida"
#, c-format
msgid "reverse-index file %s has unsupported version %<PRIu32>"
-msgstr "archivo reverse-index %s tiene una versión no soportada %<PRIu32>"
+msgstr "el archivo reverse-index %s tiene la versión no soportada %<PRIu32>"
#, c-format
msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
-msgstr "archivo reverse-index %s tiene un id de hash no soportado %<PRIu32>"
+msgstr ""
+"el archivo reverse-index %s tiene el identificador de hash no soportado "
+"%<PRIu32>"
msgid "cannot both write and verify reverse index"
msgstr "no puede escribir y verificar el índice inverso"
@@ -17607,9 +17821,9 @@ msgstr "opción `%s' puede usar \"always\", \"auto\", o \"never\""
msgid "malformed object name '%s'"
msgstr "nombre de objeto mal formado '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "option `%s' expects \"%s\" or \"%s\""
-msgstr "opción `%s' puede usar \"always\", \"auto\", o \"never\""
+msgstr "la opción `%s' espera \"%s\" o \"%s\""
#, c-format
msgid "%s requires a value"
@@ -17647,6 +17861,9 @@ msgstr "¿quisiste decir `--%s` (con dos guiones)?"
msgid "alias of --%s"
msgstr "alias de --%s"
+msgid "need a subcommand"
+msgstr "se necesita un subcomando"
+
#, c-format
msgid "unknown option `%s'"
msgstr "opción `%s' desconocida"
@@ -18025,9 +18242,8 @@ msgstr "no se pudo refrescar el índice compartido '%s'"
msgid "broken index, expect %s in %s, got %s"
msgstr "index roto, se esperaba %s en %s, se obtuvo %s"
-#, fuzzy
msgid "cannot write split index for a sparse index"
-msgstr "activar el uso de un índice sparse"
+msgstr "no se puede escribir un índice dividido para un índice escaso"
msgid "failed to convert to a sparse-index"
msgstr "falló al convertir a un índice sparse"
@@ -18084,9 +18300,12 @@ msgid ""
"l, label <label> = label current HEAD with a name\n"
"t, reset <label> = reset HEAD to a label\n"
"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
-". create a merge commit using the original merge commit's\n"
-". message (or the oneline, if no original merge commit was\n"
-". specified); use -c <commit> to reword the commit message\n"
+" create a merge commit using the original merge commit's\n"
+" message (or the oneline, if no original merge commit was\n"
+" specified); use -c <commit> to reword the commit message\n"
+"u, update-ref <ref> = track a placeholder for the <ref> to be updated\n"
+" to this position in the new commits. The <ref> is\n"
+" updated at the end of the rebase\n"
"\n"
"These lines can be re-ordered; they are executed from top to bottom.\n"
msgstr ""
@@ -18096,20 +18315,23 @@ msgstr ""
"r, reword <commit> = usar commit, pero refrasear el mensaje de commit\n"
"e, edit <commit> = usar commit, pero parar para enmendar\n"
"s, squash <commit> = usar commit, pero aplastarlo en el commit previo\n"
-"f, fixup <commit> = como \"squash\", pero descarta el mensaje del log de "
-"este commit\n"
-"\t, a menos que se use -C, en cuyo caso\n"
-"\tmantiene solo el mensaje del commit; -c es lo mismo que -C\n"
-"\tpero abre el editor\n"
+"f, fixup [-C | -c] <commit> = como \"squash\", pero descarta el mensaje del\n"
+" log de este commit, a menos que se use -C, en cuyo caso\n"
+" mantiene solo el mensaje del commit; -c es lo mismo que\n"
+" -C pero abre el editor\n"
"x, exec <commit> = ejecutar comando (el resto de la línea) usando un shell\n"
"b, break = parar aquí (continuar rebase luego con 'git rebase --continue')\n"
"d, drop <commit> = eliminar commit\n"
"l, label <label> = poner label al HEAD actual con un nombre\n"
"t, reset <label> = reiniciar HEAD al label\n"
"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
-". crear un commit de fusión usando el mensaje original de\n"
-". fusión (o la línea de oneline, si no se especifica un mensaje\n"
-". de commit). Use -c <commit> para reescribir el mensaje del commit.\n"
+" crear un commit de fusión usando el mensaje original de\n"
+" fusión (o la línea de oneline, si no se especifica un mensaje\n"
+" de commit). Use -c <commit> para reescribir el mensaje del commit.\n"
+"u, update-ref <referencia> = rasrear un marcador de posición para que la\n"
+" <referencia> sea actualizada a esta posición\n"
+" en los commits nuevos. Se actualiza la\n"
+" <referencia> al fin de la rebase\n"
"\n"
"Estas líneas pueden ser reordenadas; son ejecutadas desde arriba hacia "
"abajo.\n"
@@ -18165,7 +18387,8 @@ msgid ""
"Warning: some commits may have been dropped accidentally.\n"
"Dropped commits (newer to older):\n"
msgstr ""
-"Peligro: algunos commits pueden haber sido descartados de forma accidental.\n"
+"Advertencia: algunos commits pueden haber sido descartados de forma "
+"accidental.\n"
"Commits descartados (empezando con el más nuevo):\n"
#, c-format
@@ -18291,9 +18514,9 @@ msgstr ""
"no es un repositorio git, pero el campo '%.*s' requiere acceso a los datos "
"de objeto"
-#, fuzzy, c-format
+#, c-format
msgid "format: %%(%s) atom used without a %%(%s) atom"
-msgstr "formato: átomo %%(else) usado sin un átomo %%(if)"
+msgstr "formato: átomo %%(%s) usado sin un átomo %%(%s)"
#, c-format
msgid "format: %%(then) atom used more than once"
@@ -18584,6 +18807,13 @@ msgstr "error de protocolo: se esperaba sha/ref, se obtuvo '%s'"
msgid "http transport does not support %s"
msgstr "http transport no soporta %s"
+msgid "protocol error: expected '<url> <path>', missing space"
+msgstr "error de protocolo: se esperaba '<url> <ruta>', falta el espacio"
+
+#, c-format
+msgid "failed to download file at URL '%s'"
+msgstr "falló al descargar el archivo al URL '%s'"
+
msgid "git-http-push failed"
msgstr "git-http-push falló"
@@ -18610,13 +18840,13 @@ msgstr "más de un receivepack dado, usando el primero"
msgid "more than one uploadpack given, using the first"
msgstr "más de un uploadpack dado, usando el primero"
-#, fuzzy, c-format
-msgid "unrecognized value fetch.credentialsInURL: '%s'"
-msgstr "patrón desconocido: '%s'"
+#, c-format
+msgid "unrecognized value transfer.credentialsInUrl: '%s'"
+msgstr "valor desconocido de transfer.credentialsInUrl: '%s'"
#, c-format
msgid "URL '%s' uses plaintext credentials"
-msgstr ""
+msgstr "El URL '%s' usa credenciales de texto claro"
#, c-format
msgid "Cannot fetch both %s and %s to %s"
@@ -18925,6 +19155,14 @@ msgstr "no se pudo determinar revisión HEAD"
msgid "failed to find tree of %s"
msgstr "falló al encontrar árbol de %s"
+#, c-format
+msgid "resolve-undo records `%s` which is missing"
+msgstr "resolve-undo registra '%s' el cual falta"
+
+#, c-format
+msgid "could not get commit for ancestry-path argument %s"
+msgstr "no se pudo determinar el commit del argumento de ancestry-path %s"
+
msgid "--unpacked=<packfile> no longer supported"
msgstr "--unpacked=<packfile> ya no es soportado"
@@ -18945,6 +19183,174 @@ msgstr "-L no soporta todavía formatos de diff fuera de -p y -s"
msgid "cannot create async thread: %s"
msgstr "no es posible crear hilo async: %s"
+#, c-format
+msgid "'%s' does not exist"
+msgstr "'%s' no existe"
+
+#, c-format
+msgid "could not switch to '%s'"
+msgstr "no se pudo cambiar a '%s'"
+
+msgid "need a working directory"
+msgstr "se necesita un directorio de trabajo"
+
+msgid "Scalar enlistments require a worktree"
+msgstr "alistamientos de Scalar requieren un árbol de trabajo"
+
+#, c-format
+msgid "could not configure %s=%s"
+msgstr "no se pudo configurar %s=%s"
+
+msgid "could not configure log.excludeDecoration"
+msgstr "no se pudo configurar log.excludeDecoration"
+
+msgid "could not add enlistment"
+msgstr "no se pudo añadir alistamiento"
+
+msgid "could not set recommended config"
+msgstr "no se pudo establecer la configuración recomendada"
+
+msgid "could not turn on maintenance"
+msgstr "no se pudo activar mantenimiento"
+
+msgid "could not start the FSMonitor daemon"
+msgstr "no se pudo iniciar el demonio de FSMonitor"
+
+msgid "could not turn off maintenance"
+msgstr "no se pudo desactivar mantenimiento"
+
+msgid "could not remove enlistment"
+msgstr "no se pudo eliminar alistamiento"
+
+#, c-format
+msgid "remote HEAD is not a branch: '%.*s'"
+msgstr "la HEAD remota no es una rama: '%.*s'"
+
+msgid "failed to get default branch name from remote; using local default"
+msgstr ""
+"falló al obtener el nombre de rama por defecto del remoto; usando el valor "
+"local por defecto"
+
+msgid "failed to get default branch name"
+msgstr "falló al determinar el nombre de rama por defecto"
+
+msgid "failed to unregister repository"
+msgstr "falló al desregistrar repositorio"
+
+msgid "failed to stop the FSMonitor daemon"
+msgstr "falló al parar el demonio de FSMonitor"
+
+msgid "failed to delete enlistment directory"
+msgstr "falló al eliminar el directorio de alistamiento"
+
+msgid "branch to checkout after clone"
+msgstr "rama a que cambiar después de clonar"
+
+msgid "when cloning, create full working directory"
+msgstr "cuando se clona, crear un directorio pleno de trabajo"
+
+msgid "only download metadata for the branch that will be checked out"
+msgstr "solo descargar metadatos de la rama a que cambiar"
+
+msgid "scalar clone [<options>] [--] <repo> [<dir>]"
+msgstr "scalar clone [<opciones>] [--] <repositorio> [<directorio>]"
+
+#, c-format
+msgid "cannot deduce worktree name from '%s'"
+msgstr "no se puede deducir de '%s' el nombre del árbol de trabajo"
+
+#, c-format
+msgid "directory '%s' exists already"
+msgstr "el directorio '%s' ya existe"
+
+#, c-format
+msgid "failed to get default branch for '%s'"
+msgstr "falló al determinar la rama por defecto para '%s'"
+
+#, c-format
+msgid "could not configure remote in '%s'"
+msgstr "no se pudo configurar el remoto en '%s'"
+
+#, c-format
+msgid "could not configure '%s'"
+msgstr "no se pudo configurar '%s'"
+
+msgid "partial clone failed; attempting full clone"
+msgstr "falló la clonación parcial; intentando clonación plena"
+
+msgid "could not configure for full clone"
+msgstr "no se pudo configurar para una clonación plena"
+
+msgid "scalar diagnose [<enlistment>]"
+msgstr "scalar diagnose [<alistamiento>]"
+
+msgid "`scalar list` does not take arguments"
+msgstr "`scalar list` no toma ningún argumento"
+
+msgid "scalar register [<enlistment>]"
+msgstr "scalar register [<alistamiento>]"
+
+msgid "reconfigure all registered enlistments"
+msgstr "reconfigurar todos los alistamientos registrados"
+
+msgid "scalar reconfigure [--all | <enlistment>]"
+msgstr "scalar reconfigure [--all | <alistamiento>]"
+
+msgid "--all or <enlistment>, but not both"
+msgstr "--all o <alistamiento>, pero no los dos"
+
+#, c-format
+msgid "git repository gone in '%s'"
+msgstr "el repositorio de git en '%s' ya no está"
+
+msgid ""
+"scalar run <task> [<enlistment>]\n"
+"Tasks:\n"
+msgstr ""
+"scalar run <tarea> [<alistamiento>]\n"
+"Tareas:\n"
+
+#, c-format
+msgid "no such task: '%s'"
+msgstr "no existe tal tarea: '%s'"
+
+msgid "scalar unregister [<enlistment>]"
+msgstr "scalar unregister [<alistamiento>]"
+
+msgid "scalar delete <enlistment>"
+msgstr "scalar delete <alistamiento>"
+
+msgid "refusing to delete current working directory"
+msgstr "rehusando eliminar el directorio de trabajo actual"
+
+msgid "include Git version"
+msgstr "incluir la versión de Git"
+
+msgid "include Git's build options"
+msgstr "incluir las opciones de compilación de Git"
+
+msgid "scalar verbose [-v | --verbose] [--build-options]"
+msgstr "scalar verbose [-v | --verbose] [--build-options]"
+
+msgid "-C requires a <directory>"
+msgstr "-C requiere un <directorio>"
+
+#, c-format
+msgid "could not change to '%s'"
+msgstr "no se pudo cambiar a '%s'"
+
+msgid "-c requires a <key>=<value> argument"
+msgstr "-c requiere un argumento <clave>=<valor>"
+
+msgid ""
+"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
+"\n"
+"Commands:\n"
+msgstr ""
+"scalar [-C <directorio>] [-c <clave>=<valor>] <comando> [<opciones>]\n"
+"\n"
+"Comandos:\n"
+
msgid "unexpected flush packet while reading remote unpack status"
msgstr ""
"flush packet inesperado mientras se leía estatus de desempaquetado remoto"
@@ -19067,10 +19473,6 @@ msgstr "tus cambios locales serán sobreescritos por %s."
msgid "commit your changes or stash them to proceed."
msgstr "realiza un commit con tus cambios o haz un stash para proceder."
-#, c-format
-msgid "%s: fast-forward"
-msgstr "%s: avance rápido"
-
#. TRANSLATORS: %s will be "revert", "cherry-pick" or
#. "rebase".
#.
@@ -19421,7 +19823,7 @@ msgstr "final de archivo inesperado"
#, c-format
msgid "stored pre-cherry-pick HEAD file '%s' is corrupt"
-msgstr "archivo HEAD '%s' guardado antes de cherry-pick está corrupto"
+msgstr "archivo HEAD '%s' guardado antes de cherry-pick está corrupto"
msgid "You seem to have moved HEAD. Not rewinding, check your HEAD!"
msgstr "Parece que se ha movido HEAD. No se hace rebobinado, ¡revisa tu HEAD!"
@@ -19555,6 +19957,28 @@ msgstr "ni se pudo intentar fusionar '%.*s'"
msgid "merge: Unable to write new index file"
msgstr "fusión: No se puede escribir el nuevo archivo índice"
+#, c-format
+msgid ""
+"another 'rebase' process appears to be running; '%s.lock' already exists"
+msgstr ""
+"parece que otro proceso 'rebase' ya se está ejecutando; '%s.lock' ya existe"
+
+#, c-format
+msgid ""
+"Updated the following refs with %s:\n"
+"%s"
+msgstr ""
+"Se han actualizado las referencias siguientes con %s:\n"
+"%s"
+
+#, c-format
+msgid ""
+"Failed to update the following refs with %s:\n"
+"%s"
+msgstr ""
+"Falló al abrir las referencias siguientes con %s:\n"
+"%s"
+
msgid "Cannot autostash"
msgstr "No se puede ejecutar autostash"
@@ -19723,6 +20147,10 @@ msgid "the script was already rearranged."
msgstr "este script ya fue reorganizado."
#, c-format
+msgid "update-refs file at '%s' is invalid"
+msgstr "el archivo de update-refs a '%s' es inválido"
+
+#, c-format
msgid "'%s' is outside repository at '%s'"
msgstr "'%s' está fuera del repositorio en '%s'"
@@ -19845,11 +20273,20 @@ msgstr ""
#, c-format
msgid ""
-"unsafe repository ('%s' is owned by someone else)\n"
-"To add an exception for this directory, call:\n"
+"detected dubious ownership in repository at '%s'\n"
+"%sTo add an exception for this directory, call:\n"
"\n"
"\tgit config --global --add safe.directory %s"
msgstr ""
+"posesión dudosa detectada en el repositorio a '%s'\n"
+"%sPara añadir una excepción para este directorio, ejecuta:\n"
+"\n"
+"\tgit config --global --add safe.directory %s"
+
+#, c-format
+msgid "cannot use bare repository '%s' (safe.bareRepository is '%s')"
+msgstr ""
+"no se puede usar el repositorio desnudo '%s' (safe.bareRepository es '%s')"
#, c-format
msgid ""
@@ -19869,9 +20306,8 @@ msgstr "falló setsid"
msgid "index entry is a directory, but not sparse (%08x)"
msgstr "la entrada de índice es un directorio, pero no escaso (%08x)"
-#, fuzzy
msgid "cannot use split index with a sparse index"
-msgstr "no se puede leer el índice"
+msgstr "no se puede usar un índice dividido con un índice escaso"
#. TRANSLATORS: IEC 80000-13:2008 gibibyte
#, c-format
@@ -19925,8 +20361,8 @@ msgstr "no se pudo editar '%s'"
msgid "ignoring suspicious submodule name: %s"
msgstr "ignorando nombre de submódulo sospechoso: %s"
-msgid "negative values not allowed for submodule.fetchjobs"
-msgstr "no se permiten valores negativos para submodule.fetchjobs"
+msgid "negative values not allowed for submodule.fetchJobs"
+msgstr "no se permiten valores negativos para submodule.fetchJobs"
#, c-format
msgid "ignoring '%s' which may be interpreted as a command-line option: %s"
@@ -20006,13 +20442,13 @@ msgstr "Haciendo fetch al submódulo %s%s\n"
msgid "Could not access submodule '%s'\n"
msgstr "No se pudo acceder al submódulo '%s'\n"
-#, fuzzy, c-format
+#, c-format
msgid "Could not access submodule '%s' at commit %s\n"
-msgstr "No se pudo acceder al submódulo '%s'\n"
+msgstr "No se pudo acceder al submódulo '%s' al commit %s\n"
-#, fuzzy, c-format
+#, c-format
msgid "Fetching submodule %s%s at commit %s\n"
-msgstr "Haciendo fetch al submódulo %s%s\n"
+msgstr "Haciendo fetch al submódulo %s%s al commit %s\n"
#, c-format
msgid ""
@@ -20158,7 +20594,7 @@ msgid "number of threads in server thread pool"
msgstr "número de hilos en el pool de hilos del servidor"
msgid "seconds to wait for daemon to start or stop"
-msgstr "segundos a esperar para que el dominio empiece o se detenga"
+msgstr "segundos a esperar que el demonio se inicie o se detenga"
msgid "number of bytes"
msgstr "número de bytes"
@@ -20519,11 +20955,13 @@ msgstr ""
"seguimiento en ellos:\n"
"%s"
-#, fuzzy, c-format
+#, c-format
msgid ""
"Refusing to remove the current working directory:\n"
"%s"
-msgstr "no es posible obtener el directorio de trabajo actual"
+msgstr ""
+"Rehusando eliminar el directorio de trabajo actual:\n"
+"%s"
#, c-format
msgid ""
@@ -20712,7 +21150,7 @@ msgid "expected flush after fetch arguments"
msgstr "se espera flush tras argumentos fetch"
msgid "invalid URL scheme name or missing '://' suffix"
-msgstr "nombre de URL inválido o sufijo '://' faltante"
+msgstr "nombre de URL inválido o sufijo '://' faltante"
#, c-format
msgid "invalid %XX escape sequence"
@@ -20728,11 +21166,23 @@ msgid "invalid characters in host name"
msgstr "carácter inválido en el nombre del host"
msgid "invalid port number"
-msgstr "número de puerto inválido"
+msgstr "número de puerto inválido"
msgid "invalid '..' path segment"
msgstr "segmento de ruta '..' inválido"
+msgid "usage: "
+msgstr "uso: "
+
+msgid "fatal: "
+msgstr "fatal: "
+
+msgid "error: "
+msgstr "error: "
+
+msgid "warning: "
+msgstr "advertencia: "
+
msgid "Fetching objects"
msgstr "Haciendo fetch a objetos"
@@ -20807,13 +21257,13 @@ msgstr "archivo gitdir inválido"
msgid "gitdir file points to non-existent location"
msgstr "archivo gitdir apunta a una ubicación inexistente"
-#, fuzzy, c-format
+#, c-format
msgid "unable to set %s in '%s'"
-msgstr "incapaz de hacer stat en '%s'"
+msgstr "incapaz de configurar %s en '%s'"
-#, fuzzy, c-format
+#, c-format
msgid "unable to unset %s in '%s'"
-msgstr "no se pudo poner permisos a '%s'"
+msgstr "incapaz de desconfigurar %s en '%s'"
msgid "failed to set extensions.worktreeConfig setting"
msgstr "falló al configurar opción extensions.worktreeConfig"
@@ -20893,7 +21343,7 @@ msgstr ""
#, c-format
msgid " (use \"git %s <file>...\" to include in what will be committed)"
msgstr ""
-" (usa \"git %s <archivo>...\" para incluirlo a lo que se será confirmado)"
+" (usa \"git %s <archivo>...\" para incluirlo a lo que será confirmado)"
msgid "both deleted:"
msgstr "borrados por ambos:"
@@ -21005,10 +21455,11 @@ msgstr " (arregla los conflictos y luego ejecuta \"git am --continue\""
msgid " (use \"git am --skip\" to skip this patch)"
msgstr " (usa \"git am --skip\" para saltar este parche)"
-#, fuzzy
msgid ""
" (use \"git am --allow-empty\" to record this patch as an empty commit)"
-msgstr " (usa \"git commit --amend\" para enmendar el commit actual)"
+msgstr ""
+" (usa \"git am --allow-empty\" para registrar este parche como un commit "
+"vacío)"
msgid " (use \"git am --abort\" to restore the original branch)"
msgstr " (usa \"git am --abort\" para restaurar la rama original)"
@@ -21019,11 +21470,11 @@ msgstr "git-rebase-todo no está presente."
msgid "No commands done."
msgstr "No se realizaron los comandos."
-#, fuzzy, c-format
+#, c-format
msgid "Last command done (%<PRIuMAX> command done):"
msgid_plural "Last commands done (%<PRIuMAX> commands done):"
-msgstr[0] "El último comando realizado (%d comando realizado):"
-msgstr[1] "Los últimos comandos realizados (%d comandos realizados):"
+msgstr[0] "El último comando realizado (%<PRIuMAX> comando realizado):"
+msgstr[1] "Los últimos comandos realizados (%<PRIuMAX> comandos realizados):"
#, c-format
msgid " (see more in file %s)"
@@ -21032,11 +21483,11 @@ msgstr " (ver más en el archivo %s)"
msgid "No commands remaining."
msgstr "No quedan más comandos."
-#, fuzzy, c-format
+#, c-format
msgid "Next command to do (%<PRIuMAX> remaining command):"
msgid_plural "Next commands to do (%<PRIuMAX> remaining commands):"
-msgstr[0] "Siguiente comando a realizar (%d comando restante):"
-msgstr[1] "Siguientes comandos a realizar (%d comandos faltantes):"
+msgstr[0] "Siguiente comando a realizar (%<PRIuMAX> comando restante):"
+msgstr[1] "Siguientes comandos a realizar (%<PRIuMAX> comandos faltantes):"
msgid " (use \"git rebase --edit-todo\" to view and edit)"
msgstr " (usa \"git rebase --edit-todo\" para ver y editar)"
@@ -21547,22 +21998,6 @@ msgstr "¡Los hunks seleccionados no aplican al índice!\n"
msgid "ignoring unmerged: %s\n"
msgstr "ignorando lo no fusionado: %s\n"
-#, perl-format
-msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
-msgstr "¿Aplicar cambio de modo al árbol de trabajo [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
-msgstr "¿Aplicar eliminación al árbol de trabajo [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
-msgstr "¿Aplicar adición al árbol de trabajo [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
-msgstr "¿Aplicar este fragmento al árbol de trabajo [y,n,q,a,d,/%s,?]? "
-
msgid "No other hunks to goto\n"
msgstr "No hay más fragmentos a que ir\n"
@@ -21693,11 +22128,11 @@ msgstr "Configuración --confirm desconocida: '%s'\n"
#, perl-format
msgid "warning: sendmail alias with quotes is not supported: %s\n"
-msgstr "peligro: alias de sendmail con comillas no es soportado: %s\n"
+msgstr "advertencia: alias de sendmail con comillas no es soportado: %s\n"
#, perl-format
msgid "warning: `:include:` not supported: %s\n"
-msgstr "peligro: `:include:` no soportado: %s\n"
+msgstr "advertencia: `:include:` no soportado: %s\n"
#, perl-format
msgid "warning: `/file` or `|pipe` redirection not supported: %s\n"
@@ -21929,15 +22364,15 @@ msgstr "no se puede mandar mensaje como 7bit"
msgid "invalid transfer encoding"
msgstr "codificación de transferencia inválida"
-#, fuzzy, perl-format
+#, perl-format
msgid ""
"fatal: %s: rejected by %s hook\n"
"%s\n"
"warning: no patches were sent\n"
msgstr ""
-"fatal: %s: rechazado por hook sendmail-validate\n"
+"fatal: %s: rechazado por el hook %s\n"
"%s\n"
-"peligro: no se mandaron parches\n"
+"advertencia: no se mandó ningún parche\n"
#, perl-format
msgid "unable to open %s: %s\n"
@@ -21949,7 +22384,7 @@ msgid ""
"warning: no patches were sent\n"
msgstr ""
"fatal: %s: %d es más grande que 998 caracteres\n"
-"peligro: no se mandaron parches\n"
+"advertencia: no se mandó ningún parche\n"
#, perl-format
msgid "Skipping %s with backup suffix '%s'.\n"
diff --git a/po/fr.po b/po/fr.po
index f601f40..736a90f 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -1,5 +1,5 @@
# French translations for Git.
-# Copyright (C) 2019 Jean-Noël Avila <jn.avila@free.fr>
+# Copyright (C) 2023 Jean-Noël Avila <jn.avila@free.fr>
# This file is distributed under the same license as the Git package.
# Jean-Noël Avila <jn.avila@free.fr>, 2013-2019.
# Sébastien Helleu <flashcode@flashtux.org>, 2013.
@@ -21,6 +21,7 @@
# bypass | éviter d'utiliser
# to checkout | extraire
# cherry-pick | picorer
+# chunk | tronçon
# to commit | valider
# commit-ish | commit ou apparenté
# config file | fichier de configuration
@@ -29,6 +30,7 @@
# debugging | débogage
# to deflate | compresser
# email | courriel
+# enlistment | enrôlement
# entry | élément
# fanout | dispersion
# fast-forward | avance rapide
@@ -48,7 +50,7 @@
# pack | paquet
# patches | patchs
# pattern | motif
-# to prune | éliminer
+# to prune | élaguer
# to push | pousser
# to rebase | rebaser
# scheduler | planificateur
@@ -78,8 +80,8 @@ msgid ""
msgstr ""
"Project-Id-Version: git\n"
"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2022-06-24 21:43+0200\n"
-"PO-Revision-Date: 2022-06-24 21:58+0200\n"
+"POT-Creation-Date: 2024-02-16 19:18+0100\n"
+"PO-Revision-Date: 2024-02-16 19:19+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"
@@ -115,13 +117,13 @@ msgstr "impossible d'indexer '%s'"
msgid "could not write index"
msgstr "impossible d'écrire l'index"
-#, c-format, perl-format
+#, c-format
msgid "updated %d path\n"
msgid_plural "updated %d paths\n"
msgstr[0] "%d chemin mis à jour\n"
msgstr[1] "%d chemins mis à jour\n"
-#, c-format, perl-format
+#, c-format
msgid "note: %s is untracked now.\n"
msgstr "note : %s n'est plus suivi à présent.\n"
@@ -135,7 +137,7 @@ msgstr "Inverser"
msgid "Could not parse HEAD^{tree}"
msgstr "Impossible d'analyser HEAD^{tree}"
-#, c-format, perl-format
+#, c-format
msgid "reverted %d path\n"
msgid_plural "reverted %d paths\n"
msgstr[0] "%d chemin inversé\n"
@@ -148,7 +150,7 @@ msgstr "Aucun Fichier non suivi.\n"
msgid "Add untracked"
msgstr "Ajouter un fichier non-suivi"
-#, c-format, perl-format
+#, c-format
msgid "added %d path\n"
msgid_plural "added %d paths\n"
msgstr[0] "%d chemin ajouté\n"
@@ -245,19 +247,19 @@ msgstr "impossible de rafraîchir l'index"
msgid "Bye.\n"
msgstr "Au revoir.\n"
-#, c-format, perl-format
+#, c-format
msgid "Stage mode change [y,n,q,a,d%s,?]? "
msgstr "Indexer le changement de mode [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Stage deletion [y,n,q,a,d%s,?]? "
msgstr "Indexer la suppression [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Stage addition [y,n,q,a,d%s,?]? "
msgstr "Indexer l'ajout [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Stage this hunk [y,n,q,a,d%s,?]? "
msgstr "Indexer cette section [y,n,q,a,d%s,?] ? "
@@ -281,19 +283,19 @@ msgstr ""
"a - indexer cette section et toutes les suivantes de ce fichier\n"
"d - ne pas indexer cette section ni les suivantes de ce fichier\n"
-#, c-format, perl-format
+#, c-format
msgid "Stash mode change [y,n,q,a,d%s,?]? "
msgstr "Remiser le changement de mode [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Stash deletion [y,n,q,a,d%s,?]? "
msgstr "Remiser la suppression [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Stash addition [y,n,q,a,d%s,?]? "
msgstr "Remiser l'ajout [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Stash this hunk [y,n,q,a,d%s,?]? "
msgstr "Remiser cette section [y,n,q,a,d%s,?] ? "
@@ -317,19 +319,19 @@ msgstr ""
"a - remiser cette section et toutes les suivantes de ce fichier\n"
"d - ne pas remiser cette section ni les suivantes de ce fichier\n"
-#, c-format, perl-format
+#, c-format
msgid "Unstage mode change [y,n,q,a,d%s,?]? "
msgstr "Désindexer le changement de mode [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage deletion [y,n,q,a,d%s,?]? "
msgstr "Désindexer la suppression [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage addition [y,n,q,a,d%s,?]? "
msgstr "Désindexer l'ajout [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage this hunk [y,n,q,a,d%s,?]? "
msgstr "Désindexer cette section [y,n,q,a,d%s,?] ? "
@@ -353,19 +355,19 @@ msgstr ""
"a - désindexer cette section et toutes les suivantes de ce fichier\n"
"d - ne pas désindexer cette section ni les suivantes de ce fichier\n"
-#, c-format, perl-format
+#, c-format
msgid "Apply mode change to index [y,n,q,a,d%s,?]? "
msgstr "Appliquer le changement de mode à l'index [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Apply deletion to index [y,n,q,a,d%s,?]? "
msgstr "Appliquer la suppression à l'index [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Apply addition to index [y,n,q,a,d%s,?]? "
msgstr "Appliquer l'ajout à l'index [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Apply this hunk to index [y,n,q,a,d%s,?]? "
msgstr "Appliquer cette section à l'index [y,n,q,a,d%s,?] ? "
@@ -389,19 +391,19 @@ msgstr ""
"a - appliquer cette section et toutes les suivantes de ce fichier\n"
"d - ne pas appliquer cette section ni les suivantes de ce fichier\n"
-#, c-format, perl-format
+#, c-format
msgid "Discard mode change from worktree [y,n,q,a,d%s,?]? "
msgstr "Abandonner le changement de mode dans l'arbre [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Discard deletion from worktree [y,n,q,a,d%s,?]? "
msgstr "Abandonner la suppression dans l'arbre [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Discard addition from worktree [y,n,q,a,d%s,?]? "
msgstr "Abandonner l'ajout dans l'arbre [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Discard this hunk from worktree [y,n,q,a,d%s,?]? "
msgstr "Abandonner cette section dans l'arbre [y,n,q,a,d%s,?] ? "
@@ -425,20 +427,20 @@ msgstr ""
"a - supprimer cette section et toutes les suivantes de ce fichier\n"
"d - ne pas supprimer cette section ni les suivantes de ce fichier\n"
-#, c-format, perl-format
+#, c-format
msgid "Discard mode change from index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
"Abandonner le changement de mode dans l'index et l'arbre [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Discard deletion from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Abandonner la suppression de l'index et de l'arbre [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Discard addition from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Abandonner l'ajout de l'index et de l'arbre [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Discard this hunk from index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
"Supprimer la section dans l'index et l'arbre de travail [y,n,q,a,d%s,?] ? "
@@ -456,24 +458,24 @@ msgstr ""
"a - éliminer cette section et toutes les suivantes de ce fichier\n"
"d - ne pas éliminer cette section ni les suivantes de ce fichier\n"
-#, c-format, perl-format
+#, 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,?] ? "
-#, c-format, perl-format
+#, 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,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Apply addition to index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
"Appliquer l'ajout dans l'index et l'arbre de travail [y,n,q,a,d%s,?] ? "
-#, c-format, perl-format
+#, c-format
msgid "Apply this hunk to index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
"Appliquer la section à l'index et l'arbre de travail [y,n,q,a,d%s,?] ? "
@@ -491,6 +493,23 @@ msgstr ""
"a - appliquer cette section et toutes les suivantes de ce fichier\n"
"d - ne pas appliquer cette section ni les suivantes de ce fichier\n"
+#, c-format
+msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
+msgstr ""
+"Appliquer le changement de mode dans l'arbre de travail [y,n,q,a,d%s,?] ? "
+
+#, c-format
+msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
+msgstr "Appliquer la suppression dans l'arbre de travail [y,n,q,a,d%s,?] ? "
+
+#, c-format
+msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
+msgstr "Appliquer l'ajout dans l'arbre de travail [y,n,q,a,d%s,?] ? "
+
+#, c-format
+msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
+msgstr "Appliquer la section à l'arbre de travail [y,n,q,a,d%s,?] ? "
+
msgid ""
"y - apply this hunk to worktree\n"
"n - do not apply this hunk to worktree\n"
@@ -508,10 +527,6 @@ msgstr ""
msgid "could not parse hunk header '%.*s'"
msgstr "impossible d'analyser l'entête de section '%.*s'"
-#, c-format
-msgid "could not parse colored hunk header '%.*s'"
-msgstr "impossible d'analyser l'entête coloré de section '%.*s'"
-
msgid "could not parse diff"
msgstr "impossible d'analyser la diff"
@@ -568,8 +583,6 @@ msgstr ""
"Pour éliminer les lignes '%c', effacez-les.\n"
"Les lignes commençant par %c seront éliminées.\n"
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: 'it' refers to the patch mentioned in the previous messages.
msgid ""
"If it does not apply cleanly, you will be given an opportunity to\n"
"edit again. If all lines of the hunk are removed, then the edit is\n"
@@ -585,24 +598,16 @@ msgstr "impossible d'analyser l'entête de section"
msgid "'git apply --cached' failed"
msgstr "'git apply --cached' a échoué"
-#. #-#-#-#-# add-patch.c.po #-#-#-#-#
#. TRANSLATORS: do not translate [y/n]
#. The program will only accept that input at this point.
#. Consider translating (saying "no" discards!) as
#. (saying "n" for "no" discards!) if the translation
#. of the word "no" does not start with n.
#.
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: do not translate [y/n]
-#. The program will only accept that input
-#. at this point.
-#. Consider translating (saying "no" discards!) as
-#. (saying "n" for "no" discards!) if the translation
-#. of the word "no" does not start with n.
msgid ""
"Your edited hunk does not apply. Edit again (saying \"no\" discards!) [y/n]? "
msgstr ""
-"Votre section éditée ne s'applique pas. L'éditer à nouveau (\"no\" "
+"Votre section éditée ne s'applique pas. L'éditer à nouveau (\"n\" "
"l'élimine !) [y|n] ? "
msgid "The selected hunks do not apply to the index!"
@@ -713,9 +718,8 @@ msgstr "Impossible de tirer car vous avez des fichiers non fusionnés."
msgid "Reverting is not possible because you have unmerged files."
msgstr "Impossible d'annuler car vous avez des fichiers non fusionné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 "Rebasing is not possible because you have unmerged files."
+msgstr "Impossible de rebaser, car vous avez des fichiers non fusionnés."
msgid ""
"Fix them up in the work tree, and then use 'git add/rm <file>'\n"
@@ -736,6 +740,24 @@ msgstr "Veuillez valider vos changements avant de fusionner."
msgid "Exiting because of unfinished merge."
msgstr "Abandon à cause d'une fusion non terminée."
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"Des branches divergentes ne peuvent pas être gérées en avance rapide, vous "
+"devez soit :\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"ou :\n"
+"\n"
+"\tgit rebase\n"
+
msgid "Not possible to fast-forward, aborting."
msgstr "Pas possible d'avancer rapidement, abandon."
@@ -803,12 +825,34 @@ msgstr ""
"detachedHead à false\n"
"\n"
+#, c-format
+msgid ""
+"The following paths have been moved outside the\n"
+"sparse-checkout definition but are not sparse due to local\n"
+"modifications.\n"
+msgstr ""
+"Les chemins suivants ont été déplacés hors de\n"
+"la définition d'extraction clairsemée mai ne sont pas\n"
+"clairsemés à cause de modifications locales\n"
+
+msgid ""
+"To correct the sparsity of these paths, do the following:\n"
+"* Use \"git add --sparse <paths>\" to update the index\n"
+"* Use \"git sparse-checkout reapply\" to apply the sparsity rules"
+msgstr ""
+"Pour corriger l'état clairsemé de ces chemins, faites ceci :\n"
+"* Lancez \"git add --sparse <chemins>\" pour mettre l'index à jour\n"
+"* Lancez \"git sparse-checkout reapply\" pour réappliquer les règles"
+
msgid "cmdline ends with \\"
msgstr "cmdline se termine par \\"
msgid "unclosed quote"
msgstr "citation non fermée"
+msgid "too many arguments"
+msgstr "trop d'arguments"
+
#, c-format
msgid "unrecognized whitespace option '%s'"
msgstr "option d'espace non reconnue '%s'"
@@ -825,6 +869,12 @@ msgstr "les options '%s' et '%s' ne peuvent pas être utilisées ensemble"
msgid "'%s' outside a repository"
msgstr "'%s' hors d'un dépôt"
+msgid "failed to read patch"
+msgstr "impossible de lire la rustine"
+
+msgid "patch too large"
+msgstr "la rustine est trop grosse"
+
#, c-format
msgid "Cannot prepare timestamp regexp %s"
msgstr "Impossible de préparer la regexp d'horodatage %s"
@@ -1175,6 +1225,10 @@ msgid "cannot open %s"
msgstr "impossible d'ouvrir %s"
#, c-format
+msgid "cannot unlink '%s'"
+msgstr "impossible de délier '%s'"
+
+#, c-format
msgid "Hunk #%d applied cleanly."
msgstr "Section n°%d appliquée proprement."
@@ -1323,6 +1377,10 @@ msgid "unsupported file mode: 0%o (SHA1: %s)"
msgstr "mode de fichier non supporté :0%o (SHA1: %s)"
#, c-format
+msgid "deflate error (%d)"
+msgstr "erreur de compression (%d)"
+
+#, c-format
msgid "unable to start '%s' filter"
msgstr "impossible de démarrer le filtre '%s'"
@@ -1342,10 +1400,6 @@ msgid "path too long (%d chars, SHA1: %s): %s"
msgstr "le chemin est trop long (%d caractères, SHA1 : %s) : %s"
#, c-format
-msgid "deflate error (%d)"
-msgstr "erreur de compression (%d)"
-
-#, c-format
msgid "timestamp too large for this system: %<PRIuMAX>"
msgstr "l'horodatage est trop grand pour ce système : %<PRIuMAX>"
@@ -1366,6 +1420,12 @@ msgid "cannot read '%s'"
msgstr "impossible de lire '%s'"
#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr ""
+"le spécificateur de chemin '%s' correspond à des fichiers hors du répertoire "
+"actuel"
+
+#, c-format
msgid "pathspec '%s' did not match any files"
msgstr "le chemin '%s' ne correspond à aucun fichier"
@@ -1381,9 +1441,6 @@ msgstr "nom d'objet invalide : %s"
msgid "not a tree object: %s"
msgstr "objet arbre invalide : %s"
-msgid "current working directory is untracked"
-msgstr "l'arbre de travail actuel est non-suivi"
-
#, c-format
msgid "File not found: %s"
msgstr "Fichier non trouvé : %s"
@@ -1434,6 +1491,12 @@ msgstr "lire .gitattributes dans le répertoire de travail"
msgid "report archived files on stderr"
msgstr "afficher les fichiers archivés sur stderr"
+msgid "time"
+msgstr "heure"
+
+msgid "set modification time of archive entries"
+msgstr "régler la date de modification des entrées de l'archive"
+
msgid "set compression level"
msgstr "régler le niveau de compression"
@@ -1463,6 +1526,10 @@ msgid "Unexpected option --output"
msgstr "Option --output inattendue"
#, c-format
+msgid "extra command line parameter '%s'"
+msgstr "paramètre de commande supplémentaire '%s'"
+
+#, c-format
msgid "Unknown archive format '%s'"
msgstr "Format d'archive inconnu '%s'"
@@ -1474,6 +1541,13 @@ msgstr "Argument non supporté pour le format '%s' : -%d"
msgid "%.*s is not a valid attribute name"
msgstr "%.*s n'est pas un nom valide d'attribut"
+msgid "unable to add additional attribute"
+msgstr "Impossible d'ajouter l'attribut additionnel"
+
+#, c-format
+msgid "ignoring overly long attributes line %d"
+msgstr "ligne d'attribute trop longue ignorée %d"
+
#, c-format
msgid "%s not allowed: %s:%d"
msgstr "%s non permis : %s : %d"
@@ -1486,6 +1560,29 @@ msgstr ""
"Utilisez '\\!' pour un point d'exclamation littéral."
#, c-format
+msgid "cannot fstat gitattributes file '%s'"
+msgstr "impossible de fstat le fichier gitattributes '%s'"
+
+#, c-format
+msgid "ignoring overly large gitattributes file '%s'"
+msgstr "fichier gitattributes trop gros ignoré '%s'"
+
+#, c-format
+msgid "ignoring overly large gitattributes blob '%s'"
+msgstr "blob gitattributes trop gros ignoré '%s'"
+
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "mauvais --attr-source ou GIT_ATTR_SOURCE"
+
+#, c-format
+msgid "unable to stat '%s'"
+msgstr "fstat de '%s' impossible"
+
+#, c-format
+msgid "unable to read %s"
+msgstr "impossible de lire %s"
+
+#, c-format
msgid "Badly quoted content in file '%s': %s"
msgstr "Contenu mal cité dans le fichier '%s' : %s"
@@ -1591,9 +1688,6 @@ msgstr[1] "Bissection : %d révisions à tester après ceci %s\n"
msgid "--contents and --reverse do not blend well."
msgstr "--contents et --reverse ne font pas bon ménage."
-msgid "cannot use --contents with final commit object name"
-msgstr "on ne peut pas utiliser --contents avec un nom d'objet commit final"
-
msgid "--reverse and --first-parent together require specified latest commit"
msgstr ""
"--reverse et --first-parent ensemble nécessitent la spécification d'un "
@@ -1712,9 +1806,10 @@ msgid "a branch named '%s' already exists"
msgstr "Une branche nommée '%s' existe déjà"
#, c-format
-msgid "cannot force update the branch '%s' checked out at '%s'"
+msgid "cannot force update the branch '%s' used by worktree at '%s'"
msgstr ""
-"impossible de forcer la mise à jour de la branche '%s' extraite dans '%s'"
+"impossible de forcer la mise à jour de la branche '%s' utilisée par l'arbre-"
+"de-travail dans '%s'"
#, c-format
msgid "cannot set up tracking information; starting point '%s' is not a branch"
@@ -1763,23 +1858,19 @@ msgstr "sous-module '%s' : impossible de trouver le sous-module"
#, c-format
msgid ""
-"You may try updating the submodules using 'git checkout %s && git submodule "
-"update --init'"
+"You may try updating the submodules using 'git checkout --no-recurse-"
+"submodules %s && git submodule update --init'"
msgstr ""
"Vous pouvez essayer de mettre à jour les sous-modules en utilisant 'git "
-"checkout %s && git submodule update --init'"
+"checkout --no-recurse-submodules %s && git submodule update --init'"
#, c-format
msgid "submodule '%s': cannot create branch '%s'"
msgstr "sous-module '%s' : impossible de créer la branche '%s'"
#, c-format
-msgid "'%s' is already checked out at '%s'"
-msgstr "'%s' est déjà extrait dans '%s'"
-
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "la HEAD de la copie de travail %s n'est pas mise à jour"
+msgid "'%s' is already used by worktree at '%s'"
+msgstr "'%s' est déjà utilisé par l'arbre-de-travail dans '%s'"
msgid "git add [<options>] [--] <pathspec>..."
msgstr "git add [<options>] [--] <chemin>..."
@@ -1788,39 +1879,32 @@ msgstr "git add [<options>] [--] <chemin>..."
msgid "cannot chmod %cx '%s'"
msgstr "impossible de chmod %cx '%s'"
-#, c-format
-msgid "unexpected diff status %c"
-msgstr "état de diff inattendu %c"
-
-msgid "updating files failed"
-msgstr "échec de la mise à jour des fichiers"
-
-#, c-format
-msgid "remove '%s'\n"
-msgstr "suppression de '%s'\n"
-
msgid "Unstaged changes after refreshing the index:"
msgstr "Modifications non indexées après rafraîchissement de l'index :"
-msgid "Could not read the index"
-msgstr "Impossible de lire l'index"
+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 "Could not write patch"
-msgstr "Impossible d'écrire le patch"
+msgid "could not read the index"
+msgstr "impossible de lire l'index"
msgid "editing patch failed"
msgstr "échec de l'édition du patch"
#, c-format
-msgid "Could not stat '%s'"
-msgstr "Stat de '%s' impossible"
+msgid "could not stat '%s'"
+msgstr "impossible de stat '%s'"
-msgid "Empty patch. Aborted."
-msgstr "Patch vide. Abandon."
+msgid "empty patch. aborted"
+msgstr "rustine vide. abandon"
#, c-format
-msgid "Could not apply '%s'"
-msgstr "Impossible d'appliquer '%s'"
+msgid "could not apply '%s'"
+msgstr "impossible d'appliquer '%s'"
msgid "The following paths are ignored by one of your .gitignore files:\n"
msgstr ""
@@ -1954,6 +2038,9 @@ msgstr ""
msgid "index file corrupt"
msgstr "fichier d'index corrompu"
+msgid "unable to write new index file"
+msgstr "impossible d'écrire le nouveau fichier d'index"
+
#, c-format
msgid "bad action '%s' for '%s'"
msgstr "action invalide '%s' pour '%s'"
@@ -2163,9 +2250,6 @@ msgstr ""
"Vous pouvez lancer 'git rm' sur un fichier \"supprimé par eux\" pour "
"accepter son état."
-msgid "unable to write new index file"
-msgstr "impossible d'écrire le nouveau fichier d'index"
-
#, c-format
msgid "Could not parse object '%s'."
msgstr "Impossible d'analyser l'objet '%s'."
@@ -2184,10 +2268,6 @@ msgstr ""
msgid "failed to read '%s'"
msgstr "échec de la lecture de '%s'"
-#, 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"
-
msgid "git am [<options>] [(<mbox> | <Maildir>)...]"
msgstr "git am [<options>] [(<mbox> | <Maildir>)...]"
@@ -2197,6 +2277,9 @@ msgstr "git am [<options>] (--continue | --skip | --abort)"
msgid "run interactively"
msgstr "exécution interactive"
+msgid "bypass pre-applypatch and applypatch-msg hooks"
+msgstr "court-circuiter les crochets pre-applypatch and applypatch-msg"
+
msgid "historical option -- no-op"
msgstr "option historique -- no-op"
@@ -2224,10 +2307,6 @@ msgstr "passer l'option -m à git-mailinfo"
msgid "pass --keep-cr flag to git-mailsplit for mbox format"
msgstr "passer l'option --keep-cr à git-mailsplit fpour le format mbox"
-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 "strip everything before a scissors line"
msgstr "retirer tout le contenu avant la ligne des ciseaux"
@@ -2341,32 +2420,28 @@ msgstr "git archive : erreur de protocole"
msgid "git archive: expected a flush"
msgstr "git archive : vidage attendu"
-msgid "git bisect--helper --bisect-reset [<commit>]"
-msgstr "git bisect--helper --bisect-reset [<commit>]"
-
msgid ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<term> --term-{old,good}"
-"=<term>] [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] "
-"[<paths>...]"
+"git bisect start [--term-(new|bad)=<term> --term-(old|good)=<term>] [--no-"
+"checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]"
msgstr ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<terme> --term-{old,good}"
-"=<terme>][--no-checkout] [--first-parent] [<mauvais> [<bon>...]] [--] "
-"[<chemins>...]"
+"git bisect start [--term-{new,bad}=<terme> --term-{old,good}=<terme>] [--"
+"no-checkout] [--first-parent] [<mauvais> [<bon>...]] [--] [<spéc-de-"
+"chemin>...]"
-msgid "git bisect--helper --bisect-state (bad|new) [<rev>]"
-msgstr "git bisect--helper --bisect-state (bad|new) [<rév>]"
+msgid "git bisect (good|bad) [<rev>...]"
+msgstr "git bisect (good|bad) [<rév>...]"
-msgid "git bisect--helper --bisect-state (good|old) [<rev>...]"
-msgstr "git bisect--helper --bisect-state (good|old) [<rév>...]"
+msgid "git bisect skip [(<rev>|<range>)...]"
+msgstr "git bisect skip [(<rév>|<plage>)...]"
-msgid "git bisect--helper --bisect-replay <filename>"
-msgstr "git bisect--helper --bisect-replay <nom-de-fichier>"
+msgid "git bisect reset [<commit>]"
+msgstr "git bisect reset [<commit>]"
-msgid "git bisect--helper --bisect-skip [(<rev>|<range>)...]"
-msgstr "git bisect--helper --bisect-skip [(<rév>|<plage>)...]"
+msgid "git bisect replay <logfile>"
+msgstr "git bisect replay <fichier-journal>"
-msgid "git bisect--helper --bisect-run <cmd>..."
-msgstr "git bisect--helper --bisect-run <cmd>..."
+msgid "git bisect run <cmd> [<arg>...]"
+msgstr "git bisect run <cmd> [<arg>...]"
#, c-format
msgid "cannot open file '%s' in mode '%s'"
@@ -2513,9 +2588,6 @@ msgid "checking out '%s' failed. Try 'git bisect start <valid-branch>'."
msgstr ""
"l'extraction de '%s' a échoué. Essayez 'git bisect start <branche-valide>'."
-msgid "won't bisect on cg-seek'ed tree"
-msgstr "refus de bissecter sur un arbre 'cg-seeked'"
-
msgid "bad HEAD - strange symbolic ref"
msgstr "mauvaise HEAD - référence symbolique douteuse"
@@ -2567,16 +2639,16 @@ msgid "bisect run failed: no command provided."
msgstr "la bissection a échoué : aucune commande fournie."
#, c-format
-msgid "unable to verify '%s' on good revision"
-msgstr "impossible de vérifier '%s' sur une bonne révision"
+msgid "unable to verify %s on good revision"
+msgstr "impossible de vérifier %s sur une bonne révision"
#, c-format
msgid "bogus exit code %d for good revision"
msgstr "code de sortie %d erroné pour une bonne révision"
#, c-format
-msgid "bisect run failed: exit code %d from '%s' is < 0 or >= 128"
-msgstr "la bissection a échoué : le code retour %d de '%s' est < 0 ou >= 128"
+msgid "bisect run failed: exit code %d from %s is < 0 or >= 128"
+msgstr "la bissection a échoué : le code retour %d de %s est < 0 ou >= 128"
#, c-format
msgid "cannot open file '%s' for writing"
@@ -2585,76 +2657,48 @@ msgstr "impossible d'ouvrir '%s' en écriture"
msgid "bisect run cannot continue any more"
msgstr "la bissection ne peut plus continuer"
-#, c-format
msgid "bisect run success"
msgstr "succès de la bissection"
-#, c-format
msgid "bisect found first bad commit"
msgstr "la bissection a trouvé le premier mauvais commit"
#, c-format
-msgid ""
-"bisect run failed: 'git bisect--helper --bisect-state %s' exited with error "
-"code %d"
-msgstr ""
-"la bissection a échoué : 'git bisect--helper --bisect-state %s' a retourné "
-"le code erreur %d"
-
-msgid "reset the bisection state"
-msgstr "réinitialiser l'état de la bissection"
+msgid "bisect run failed: 'git bisect %s' exited with error code %d"
+msgstr "la bissection a échoué : 'git bisect %s' a retourné le code erreur %d"
-msgid "check whether bad or good terms exist"
-msgstr "vérifier si les termes bons ou mauvais existent"
-
-msgid "print out the bisect terms"
-msgstr "afficher les termes de bissection"
-
-msgid "start the bisect session"
-msgstr "démarrer une session de bissection"
-
-msgid "find the next bisection commit"
-msgstr "trouver le prochain commit de bissection"
-
-msgid "mark the state of ref (or refs)"
-msgstr "marquer l'état d'une références (ou plusieurs)"
-
-msgid "list the bisection steps so far"
-msgstr "lister les étapes de bissection jusqu'ici"
-
-msgid "replay the bisection process from the given file"
-msgstr "rejouer le processus de bissection depuis le fichier fourni"
-
-msgid "skip some commits for checkout"
-msgstr "sauter certains commits pour l'extraction"
-
-msgid "visualize the bisection"
-msgstr "visualiser la bissection"
-
-msgid "use <cmd>... to automatically bisect"
-msgstr "utiliser <cmd>... pour bissecter automatiquement"
+#, c-format
+msgid "'%s' requires either no argument or a commit"
+msgstr "%s supporte soit aucun argument, soit un commit"
-msgid "no log for BISECT_WRITE"
-msgstr "pas de journal pour BISECT_WRITE"
+#, c-format
+msgid "'%s' requires 0 or 1 argument"
+msgstr "'%s' nécessite 0 ou 1 argument"
-msgid "--bisect-reset requires either no argument or a commit"
-msgstr "--bisect-reset supporte soit aucun argument, soit un commit"
+#, c-format
+msgid "'%s' requires 0 arguments"
+msgstr "'%s' n'accepte aucun argument"
-msgid "--bisect-terms requires 0 or 1 argument"
-msgstr "--bisect-terms exige 0 ou 1 argument"
+msgid "no logfile given"
+msgstr "pas de fichier de log donné"
-msgid "--bisect-next requires 0 arguments"
-msgstr "--bisect-next exige 0 argument"
+#, c-format
+msgid "'%s' failed: no command provided."
+msgstr "'%s' a échoué : aucune commande fournie."
-msgid "--bisect-log requires 0 arguments"
-msgstr "--bisect-log exige 0 argument"
+msgid "need a command"
+msgstr "commande requise"
-msgid "no logfile given"
-msgstr "pas de fichier de log donné"
+#, c-format
+msgid "unknown command: '%s'"
+msgstr "commande inconnue : '%s'"
msgid "git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"
msgstr "git blame [<options>] [<rev-opts>] [<rev>] [--] <fichier>"
+msgid "git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"
+msgstr "git annotate [<options>] [<options-de-rev>] [<rev>] [--] <fichier>"
+
msgid "<rev-opts> are documented in git-rev-list(1)"
msgstr "<options-de-révision> sont documentés dans git-rev-list(1)"
@@ -2824,51 +2868,58 @@ msgstr "git branch [<options>] [-r | -a] [--format]"
#, c-format
msgid ""
"deleting branch '%s' that has been merged to\n"
-" '%s', but not yet merged to HEAD."
+" '%s', but not yet merged to HEAD"
msgstr ""
"suppression de la branche '%s' qui a été fusionnée dans\n"
-" '%s', mais pas dans HEAD."
+" '%s', mais pas encore dans HEAD"
#, c-format
msgid ""
"not deleting branch '%s' that is not yet merged to\n"
-" '%s', even though it is merged to HEAD."
+" '%s', even though it is merged to HEAD"
msgstr ""
-"branche '%s' non supprimée car elle n'a pas été fusionnée dans\n"
-" '%s', même si elle est fusionnée dans HEAD."
+"branche '%s' non supprimée car elle n'a pas encore été fusionnée dans\n"
+" '%s', même si elle est fusionnée dans HEAD"
#, c-format
-msgid "Couldn't look up commit object for '%s'"
-msgstr "Impossible de rechercher l'objet commit pour '%s'"
+msgid "couldn't look up commit object for '%s'"
+msgstr "impossible de rechercher l'objet commit pour '%s'"
#, c-format
-msgid ""
-"The branch '%s' is not fully merged.\n"
-"If you are sure you want to delete it, run 'git branch -D %s'."
-msgstr ""
-"La branche '%s' n'est pas totalement fusionnée.\n"
-"Si vous souhaitez réellement la supprimer, lancez 'git branch -D %s'."
+msgid "the branch '%s' is not fully merged"
+msgstr "la branche '%s' n'est pas complètement fusionnée"
-msgid "Update of config-file failed"
-msgstr "Échec de la mise à jour du fichier de configuration"
+#, c-format
+msgid "If you are sure you want to delete it, run 'git branch -D %s'"
+msgstr "Si vous souhaitez réellement la supprimer, lancez 'git branch -D %s'"
+
+msgid "update of config-file failed"
+msgstr "échec de la mise à jour du fichier de configuration"
msgid "cannot use -a with -d"
msgstr "impossible d'utiliser -a avec -d"
-msgid "Couldn't look up commit object for HEAD"
-msgstr "Impossible de rechercher l'objet commit pour HEAD"
+#, c-format
+msgid "cannot delete branch '%s' used by worktree at '%s'"
+msgstr ""
+"impossible de supprimer la branche '%s' utilisée par l'arbre-de-travail dans "
+"'%s'"
#, c-format
-msgid "Cannot delete branch '%s' checked out at '%s'"
-msgstr "Impossible de supprimer la branche '%s' extraite dans '%s'"
+msgid "remote-tracking branch '%s' not found"
+msgstr "branche de suivi '%s' non trouvée"
#, c-format
-msgid "remote-tracking branch '%s' not found."
-msgstr "branche de suivi '%s' non trouvée."
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"branche '%s' non trouvée.\n"
+"Avez-vous oublié --remote ?"
#, c-format
-msgid "branch '%s' not found."
-msgstr "branche '%s' non trouvée."
+msgid "branch '%s' not found"
+msgstr "branche '%s' non trouvée"
#, c-format
msgid "Deleted remote-tracking branch %s (was %s).\n"
@@ -2889,49 +2940,55 @@ msgid "HEAD (%s) points outside of refs/heads/"
msgstr "HEAD (%s) pointe hors de refs/heads/"
#, c-format
-msgid "Branch %s is being rebased at %s"
-msgstr "La branche %s est en cours de rebasage sur %s"
+msgid "branch %s is being rebased at %s"
+msgstr "la branche %s est en cours de rebasage sur %s"
#, c-format
-msgid "Branch %s is being bisected at %s"
-msgstr "La branche %s est en cours de bissection sur %s"
+msgid "branch %s is being bisected at %s"
+msgstr "la branche %s est en cours de bissection sur %s"
-msgid "cannot copy the current branch while not on any."
-msgstr "impossible de copier la branche actuelle, il n'y en a pas."
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "la HEAD de la copie de travail %s n'est pas mise à jour"
-msgid "cannot rename the current branch while not on any."
-msgstr "impossible de renommer la branche actuelle, il n'y en a pas."
+#, c-format
+msgid "invalid branch name: '%s'"
+msgstr "nom de branche invalide : '%s'"
+
+#, c-format
+msgid "no commit on branch '%s' yet"
+msgstr "aucun commit encore sur la branche '%s'"
#, c-format
-msgid "Invalid branch name: '%s'"
-msgstr "Nom de branche invalide : '%s'"
+msgid "no branch named '%s'"
+msgstr "aucune branche nommée '%s'"
-msgid "Branch rename failed"
-msgstr "Échec de renommage de la branche"
+msgid "branch rename failed"
+msgstr "échec de renommage de la branche"
-msgid "Branch copy failed"
-msgstr "Échec de copie de la branche"
+msgid "branch copy failed"
+msgstr "échec de copie de la branche"
#, c-format
-msgid "Created a copy of a misnamed branch '%s'"
-msgstr "Création d'une copie d'une branche mal nommée '%s'"
+msgid "created a copy of a misnamed branch '%s'"
+msgstr "création d'une copie d'une branche mal nommée '%s'"
#, c-format
-msgid "Renamed a misnamed branch '%s' away"
-msgstr "Renommage d'une branche mal nommée '%s'"
+msgid "renamed a misnamed branch '%s' away"
+msgstr "renommage d'une branche mal nommée '%s'"
#, c-format
-msgid "Branch renamed to %s, but HEAD is not updated!"
-msgstr "La branche a été renommée en %s, mais HEAD n'est pas mise à jour !"
+msgid "branch renamed to %s, but HEAD is not updated"
+msgstr "la branche a été renommée en %s, mais HEAD n'est pas mise à jour"
-msgid "Branch is renamed, but update of config-file failed"
+msgid "branch is renamed, but update of config-file failed"
msgstr ""
-"La branche est renommée, mais la mise à jour du fichier de configuration a "
+"la branche est renommée, mais la mise à jour du fichier de configuration a "
"échoué"
-msgid "Branch is copied, but update of config-file failed"
+msgid "branch is copied, but update of config-file failed"
msgstr ""
-"La branche est copiée, mais la mise à jour du fichier de configuration a "
+"la branche est copiée, mais la mise à jour du fichier de configuration a "
"échoué"
#, c-format
@@ -2998,6 +3055,9 @@ msgstr "déplacer/renommer une branche et son reflog"
msgid "move/rename a branch, even if target exists"
msgstr "déplacer/renommer une branche, même si la cible existe"
+msgid "do not output a newline after empty formatted refs"
+msgstr "ne pas générer de nouvelle ligne après des réfs formatées vides"
+
msgid "copy a branch and its reflog"
msgstr "copier une branche et son reflog"
@@ -3043,8 +3103,8 @@ msgstr "parcourir récursivement les sous-modules"
msgid "format to use for the output"
msgstr "format à utiliser pour la sortie"
-msgid "Failed to resolve HEAD as a valid ref."
-msgstr "Échec de résolution de HEAD comme référence valide."
+msgid "failed to resolve HEAD as a valid ref"
+msgstr "échec de résolution de HEAD comme référence valide"
msgid "HEAD not found below refs/heads!"
msgstr "HEAD non trouvée sous refs/heads !"
@@ -3062,19 +3122,17 @@ msgstr "--recurse-submodules ne peut être utilisé que pour créer des branches
msgid "branch name required"
msgstr "le nom de branche est requis"
-msgid "Cannot give description to detached HEAD"
-msgstr "Impossible de décrire une HEAD détachée"
+msgid "cannot give description to detached HEAD"
+msgstr "impossible de décrire une HEAD détachée"
msgid "cannot edit description of more than one branch"
msgstr "impossible d'éditer la description de plus d'une branche"
-#, c-format
-msgid "No commit on branch '%s' yet."
-msgstr "Aucun commit sur la branche '%s'."
+msgid "cannot copy the current branch while not on any"
+msgstr "impossible de copier la branche actuelle, il n'y en a pas"
-#, c-format
-msgid "No branch named '%s'."
-msgstr "Aucune branche nommée '%s'."
+msgid "cannot rename the current branch while not on any"
+msgstr "impossible de renommer la branche actuelle, il n'y en a pas"
msgid "too many branches for a copy operation"
msgstr "trop de branches pour une opération de copie"
@@ -3087,10 +3145,10 @@ msgstr "trop d'arguments pour spécifier une branche amont"
#, c-format
msgid ""
-"could not set upstream of HEAD to %s when it does not point to any branch."
+"could not set upstream of HEAD to %s when it does not point to any branch"
msgstr ""
"impossible de spécifier une branche amont de HEAD par %s qui ne pointe sur "
-"aucune branche."
+"aucune branche"
#, c-format
msgid "no such branch '%s'"
@@ -3103,29 +3161,29 @@ msgstr "la branche '%s' n'existe pas"
msgid "too many arguments to unset upstream"
msgstr "trop d'arguments pour désactiver un amont"
-msgid "could not unset upstream of HEAD when it does not point to any branch."
+msgid "could not unset upstream of HEAD when it does not point to any branch"
msgstr ""
"impossible de désactiver une branche amont de HEAD quand elle ne pointe sur "
-"aucune branche."
+"aucune branche"
#, c-format
-msgid "Branch '%s' has no upstream information"
-msgstr "La branche '%s' n'a aucune information de branche amont"
+msgid "branch '%s' has no upstream information"
+msgstr "la branche '%s' n'a aucune information de branche amont"
msgid ""
-"The -a, and -r, options to 'git branch' do not take a branch name.\n"
+"the -a, and -r, options to 'git branch' do not take a branch name.\n"
"Did you mean to use: -a|-r --list <pattern>?"
msgstr ""
-"Les options -a et -r de 'git branch' n'ont pas de sens avec un nom de "
+"les options -a et -r de 'git branch' n'ont pas de sens avec un nom de "
"branche.\n"
"Vouliez-vous plutôt dire -a|-r --list <motif> ?"
msgid ""
"the '--set-upstream' option is no longer supported. Please use '--track' or "
-"'--set-upstream-to' instead."
+"'--set-upstream-to' instead"
msgstr ""
"l'option '--set-upstream' est obsolète. Utilisez '--track' ou '--set-"
-"upstream-to' à la place."
+"upstream-to' à la place"
msgid "git version:\n"
msgstr "version git ::\n"
@@ -3143,8 +3201,13 @@ msgstr "info libc : "
msgid "not run from a git repository - no hooks to show\n"
msgstr "lancé hors d'un dépôt git - aucun crochet à montrer\n"
-msgid "git bugreport [-o|--output-directory <file>] [-s|--suffix <format>]"
-msgstr "git bugreport [-o|--output-directory <fichier>] [-s|--suffix <format>]"
+msgid ""
+"git bugreport [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--diagnose[=<mode>]]"
+msgstr ""
+"git bugreport [(-o | --output-directory) <chemin>] [(-s | --suffix) "
+"<format>]\n"
+" [--diagnose[=<mode>]]"
msgid ""
"Thank you for filling out a Git bug report!\n"
@@ -3182,16 +3245,33 @@ msgstr ""
"Veuillez relire le rapport de bogue ci-dessous.\n"
"Vous pouvez supprimer toute ligne que vous ne souhaitez pas envoyer.\n"
-msgid "specify a destination for the bugreport file"
-msgstr "spécifier la destination du fichier de rapport de bogue"
+msgid "mode"
+msgstr "mode"
-msgid "specify a strftime format suffix for the filename"
-msgstr "spécifier une suffixe au format strftime pour le nom de fichier"
+msgid ""
+"create an additional zip archive of detailed diagnostics (default 'stats')"
+msgstr ""
+"créer une archive zip supplémentaire de diagnostique détaillé (par défaut "
+"'stats')"
+
+msgid "specify a destination for the bugreport file(s)"
+msgstr "spécifier la destination du/des fichier(s) de rapport de bogue"
+
+msgid "specify a strftime format suffix for the filename(s)"
+msgstr "spécifier une suffixe au format strftime pour le(s) nom(s) de fichier"
+
+#, c-format
+msgid "unknown argument `%s'"
+msgstr "argument inconnu '%s'"
#, c-format
msgid "could not create leading directories for '%s'"
msgstr "impossible de créer les répertoires de premier niveau pour '%s'"
+#, c-format
+msgid "unable to create diagnostics archive %s"
+msgstr "impossible de créer l'archive de diagnostique %s"
+
msgid "System Info"
msgstr "Info système"
@@ -3206,17 +3286,24 @@ msgstr "impossible d'écrire dans %s"
msgid "Created new report at '%s'.\n"
msgstr "Nouveau rapport créé à '%s'.\n"
-msgid "git bundle create [<options>] <file> <git-rev-list args>"
-msgstr "git bundle create [<options>] <fichier> <args git-rev-list>"
+msgid ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<version>] <file> <git-rev-list-args>"
+msgstr ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<version>] <fichier> <args-de-git-rev-list>"
-msgid "git bundle verify [<options>] <file>"
-msgstr "git bundle verify [<options>] <fichier>"
+msgid "git bundle verify [-q | --quiet] <file>"
+msgstr "git bundle verify [-q | --quiet] <fichier>"
msgid "git bundle list-heads <file> [<refname>...]"
msgstr "git bundle list-heads <fichier> [<nom-de-ref>...]"
-msgid "git bundle unbundle <file> [<refname>...]"
-msgstr "git bundle unbundle <fichier> [<nom-de-ref>...]"
+msgid "git bundle unbundle [--progress] <file> [<refname>...]"
+msgstr "git bundle unbundle [--progress] <fichier> [<nom-de-ref>...]"
+
+msgid "need a <file> argument"
+msgstr "requiert un argument <fichier>"
msgid "do not show progress meter"
msgstr "ne pas afficher la barre de progression"
@@ -3224,11 +3311,11 @@ msgstr "ne pas afficher la barre de progression"
msgid "show progress meter"
msgstr "afficher la barre de progression"
-msgid "show progress meter during object writing phase"
-msgstr "afficher la barre de progression durant la phase d'écrite des objets"
+msgid "historical; same as --progress"
+msgstr "option historique ; identique à --progress"
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "similaire à --all-progress quand la barre de progression est affichée"
+msgid "historical; does nothing"
+msgstr "option historique ; ne fait rien"
msgid "specify bundle format version"
msgstr "spécifier la version du format de colis"
@@ -3250,10 +3337,6 @@ msgid "Unbundling objects"
msgstr "Dépaquetage d'objets"
#, c-format
-msgid "Unknown subcommand: %s"
-msgstr "Sous-commande inconnue : %s"
-
-#, c-format
msgid "cannot read object %s '%s'"
msgstr "impossible de lire l'objet %s '%s'"
@@ -3275,10 +3358,6 @@ msgstr "%s nécessite des arguments"
msgid "%s takes no arguments"
msgstr "%s n'accepte aucune argument"
-#, c-format
-msgid "unknown command: '%s'"
-msgstr "commande inconnue : %s"
-
msgid "only one batch option may be specified"
msgstr "une seule option de traitement ne peut être spécifiée à la fois"
@@ -3292,22 +3371,22 @@ msgid "git cat-file (-t | -s) [--allow-unknown-type] <object>"
msgstr "git cat-file (-t | -s) [--allow-unknown-type] <objet>"
msgid ""
+"git cat-file (--textconv | --filters)\n"
+" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
+msgstr ""
+"git cat-file (--textconv | --filters)\n"
+" [<rev>:<chemin|arbresque> | --path=<chemin|arbresque> <rev>]"
+
+msgid ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
+" [--textconv | --filters] [-Z]"
msgstr ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
-
-msgid ""
-"git cat-file (--textconv | --filters)\n"
-" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
-msgstr ""
-"git cat-file (--textconv | --filters)\n"
-" [<rev>:<chemin|arbresque> | --path=<chemin|arbresque> <rev>]"
+" [--textconv | --filters] [-Z]"
msgid "Check object existence or emit object contents"
msgstr "Vérifie l'existence d'un objet ou émettre le contenu de l'objet"
@@ -3330,6 +3409,9 @@ msgstr "afficher la taille de l'objet"
msgid "allow -s and -t to work with broken/corrupt objects"
msgstr "autoriser -s et -t à travailler sur des objets cassés/corrompus"
+msgid "use mail map file"
+msgstr "utiliser le fichier de correspondance de mail"
+
msgid "Batch objects requested on stdin (or --batch-all-objects)"
msgstr "Traiter par lot les objets demandés sur stdin (ou --batch-all-objects)"
@@ -3339,6 +3421,12 @@ msgstr "afficher tout le contenu de <objet> ou <rev>"
msgid "like --batch, but don't emit <contents>"
msgstr "comme --batch, mais ne pas émettre <contenu>"
+msgid "stdin is NUL-terminated"
+msgstr "l'entrée se termine par NUL"
+
+msgid "stdin and stdout is NUL-terminated"
+msgstr "l'entrée et la sortie standard se terminent par NUL"
+
msgid "read commands from stdin"
msgstr "lire les commandes depuis l'entrée standard"
@@ -3405,18 +3493,21 @@ msgstr "<rev> nécessaire avec '%s'"
msgid "<object> required with '-%c'"
msgstr "<objet> nécessaire avec '-%c'"
-msgid "too many arguments"
-msgstr "trop d'arguments"
-
#, c-format
msgid "only two arguments allowed in <type> <object> mode, not %d"
msgstr "deux arguments seulement permis dans le mode <type> <objet>, pas %d"
-msgid "git check-attr [-a | --all | <attr>...] [--] <pathname>..."
-msgstr "git check-attr [-a | --all | <attr>...] [--] <chemin>..."
+msgid ""
+"git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] "
+"<pathname>..."
+msgstr ""
+"git check-attr [--source <arbre-esque>] [-a | --all | <attr>...] [--] "
+"<chemin>..."
-msgid "git check-attr --stdin [-z] [-a | --all | <attr>...]"
-msgstr "git check-attr --stdin [-z] [-a | --all | <attr>...]"
+msgid ""
+"git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"
+msgstr ""
+"git check-attr --stdin [-z] [--source <arbre-esque>] [-a | --all | <attr>...]"
msgid "report all attributes set on file"
msgstr "afficher tous les attributs associés au fichier"
@@ -3431,6 +3522,12 @@ msgid "terminate input and output records by a NUL character"
msgstr ""
"terminer les enregistrements en entrée et en sortie par un caractère NUL"
+msgid "<tree-ish>"
+msgstr "<arbre-esque>"
+
+msgid "which tree-ish to check attributes at"
+msgstr "à quel <arbre-esque> vérifier les attributs"
+
msgid "suppress progress reporting"
msgstr "supprimer l'état d'avancement"
@@ -3592,6 +3689,12 @@ msgid "'%s' or '%s' cannot be used with %s"
msgstr "'%s' ou '%s' ne peut pas être utilisé avec %s"
#, c-format
+msgid "'%s', '%s', or '%s' cannot be used when checking out of a tree"
+msgstr ""
+"'%s', '%s' ou '%s' ne peuvent pas être utilisés lors de l'extraction d'un "
+"arbre"
+
+#, c-format
msgid "path '%s' is unmerged"
msgstr "le chemin '%s' n'est pas fusionné"
@@ -3846,8 +3949,8 @@ msgstr "forcer l'extraction (laisser tomber les modifications locales)"
msgid "new-branch"
msgstr "nouvelle branche"
-msgid "new unparented branch"
-msgstr "nouvelle branche sans parent"
+msgid "new unborn branch"
+msgstr "nouvelle branche non née"
msgid "update ignored files (default)"
msgstr "mettre à jour les fichiers ignorés (par défaut)"
@@ -3950,9 +4053,11 @@ msgid "use overlay mode"
msgstr "utiliser le mode de superposition"
msgid ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <paths>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] "
+"[<pathspec>...]"
msgstr ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <motif>] [-x | -X] [--] <chemins>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <motif>] [-x | -X] [--] [<spec-de-"
+"chemins>...]"
#, c-format
msgid "Removing %s\n"
@@ -4016,7 +4121,7 @@ msgstr ""
"* - choisir tous les éléments\n"
" - (vide) terminer la sélection\n"
-#, c-format, perl-format
+#, c-format
msgid "Huh (%s)?\n"
msgstr "Hein (%s) ?\n"
@@ -4099,9 +4204,6 @@ msgstr ""
"clean.requireForce à true par défaut et ni -i, -n ou -f fourni ; refus de "
"nettoyer"
-msgid "-x and -X cannot be used together"
-msgstr "-x et -X ne peuvent pas être utilisés ensemble"
-
msgid "git clone [<options>] [--] <repo> [<dir>]"
msgstr "git clone [<options>] [--] <dépôt> [<répertoire>]"
@@ -4165,9 +4267,6 @@ msgstr "profondeur"
msgid "create a shallow clone of that depth"
msgstr "créer un clone superficiel de cette profondeur"
-msgid "time"
-msgstr "heure"
-
msgid "create a shallow clone since a specific time"
msgstr "créer un clone superficiel depuis une date spécifique"
@@ -4195,6 +4294,9 @@ msgstr "gitdir"
msgid "separate git dir from working tree"
msgstr "séparer le répertoire git de la copie de travail"
+msgid "specify the reference format to use"
+msgstr "spécifier le format de réference à utiliser"
+
msgid "key=value"
msgstr "clé=valeur"
@@ -4207,12 +4309,6 @@ msgstr "spécifique au serveur"
msgid "option to transmit"
msgstr "option à transmettre"
-msgid "use IPv4 addresses only"
-msgstr "n'utiliser que des adresses IPv4"
-
-msgid "use IPv6 addresses only"
-msgstr "n'utiliser que des adresses IPv6"
-
msgid "apply partial clone filters to submodules"
msgstr "appliquer les filtres de clone partiel aux sous-modules"
@@ -4225,6 +4321,14 @@ msgstr ""
"initialiser le fichier d'extraction clairsemée pour n'inclure que les "
"fichiers à la racine"
+msgid "uri"
+msgstr "uri"
+
+msgid "a URI for downloading bundles before fetching from origin remote"
+msgstr ""
+"un URI pour télécharger des paquets avant de récupérer depuis le distant "
+"d'origine"
+
#, c-format
msgid "info: Could not add alternate for '%s': %s\n"
msgstr "info : impossible d'ajouter une alternative pour '%s' : %s\n"
@@ -4238,10 +4342,18 @@ msgid "%s exists and is not a directory"
msgstr "%s existe et n'est pas un répertoire"
#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "'%s' est un lien symbolique, refus de cloner avec --local"
+
+#, c-format
msgid "failed to start iterator over '%s'"
msgstr "échec du démarrage un itérateur sur '%s'"
#, c-format
+msgid "symlink '%s' exists, refusing to clone with --local"
+msgstr "le lien symbolique '%s' existe, refus de cloner avec --local"
+
+#, c-format
msgid "failed to unlink '%s'"
msgstr "échec pour délier '%s'"
@@ -4284,10 +4396,10 @@ msgstr "impossible de mettre à jour %s"
msgid "failed to initialize sparse-checkout"
msgstr "échec lors de l'initialisation l'extraction clairsemée"
-msgid "remote HEAD refers to nonexistent ref, unable to checkout.\n"
+msgid "remote HEAD refers to nonexistent ref, unable to checkout"
msgstr ""
"la HEAD distante réfère à une référence non existante, impossible de "
-"l'extraire.\n"
+"l'extraire"
msgid "unable to checkout working tree"
msgstr "impossible d'extraire la copie de travail"
@@ -4308,8 +4420,8 @@ msgid "You must specify a repository to clone."
msgstr "Vous devez spécifier un dépôt à cloner."
#, c-format
-msgid "options '%s' and '%s %s' cannot be used together"
-msgstr "les options '%s' et '%s %s' ne peuvent pas être utilisées ensemble"
+msgid "unknown ref storage format '%s'"
+msgstr "Format de stockage de réf inconnu '%s'"
#, c-format
msgid "repository '%s' does not exist"
@@ -4388,6 +4500,16 @@ msgstr "--local est ignoré"
msgid "cannot clone from filtered bundle"
msgstr "impossible de cloner depuis un colis filtré"
+msgid "failed to initialize the repo, skipping bundle URI"
+msgstr "échec lors de l'initialisation du dépôt, URI du paquet ignoré"
+
+#, c-format
+msgid "failed to fetch objects from bundle URI '%s'"
+msgstr "impossible de récupérer les objets depuis l'URI de paquet '%s'"
+
+msgid "failed to fetch advertised bundles"
+msgstr "échec de récupération des colis annoncés"
+
msgid "remote transport reported error"
msgstr "le transport distant a retourné une erreur"
@@ -4423,18 +4545,24 @@ msgid "--command must be the first argument"
msgstr "--command doit être le premier argument"
msgid ""
-"git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]"
+"git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]"
msgstr ""
-"git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]"
+"git commit-graph verify [--object-dir <rép>] [--shallow] [--[no-]progress]"
msgid ""
-"git commit-graph write [--object-dir <objdir>] [--append] [--"
-"split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <n>] [--[no-]progress] <split options>"
+"git commit-graph write [--object-dir <dir>] [--append]\n"
+" [--split[=<strategy>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <split-options>"
msgstr ""
-"git commit-graph write [--object-dir <répertoire-d'objet>] [--append] [--"
-"split[=<stratégie>]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <n>] [--[no-]progress] <options de division>"
+"git commit-graph write [--object-dir <rép>] [--append]\n"
+" [--split[=<stratégie>]] [--reachable | --stdin-packs "
+"| --stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <options-de-division>"
msgid "dir"
msgstr "répertoire"
@@ -4451,6 +4579,10 @@ msgid "Could not open commit-graph '%s'"
msgstr "Impossible d'ouvrir le graphe de commit '%s'"
#, c-format
+msgid "could not open commit-graph chain '%s'"
+msgstr "impossible d'ouvrir le graphe de commit '%s'"
+
+#, c-format
msgid "unrecognized --split argument, %s"
msgstr "argument de --split non reconnu, %s"
@@ -4504,16 +4636,15 @@ msgstr "utilisez un seul parmi --reachable, --stdin-commits ou --stdin-packs"
msgid "Collecting commits from input"
msgstr "Collecte des commits depuis l'entrée"
-#, c-format
-msgid "unrecognized subcommand: %s"
-msgstr "sous-commande non reconnue : %s"
+msgid "git commit-tree <tree> [(-p <parent>)...]"
+msgstr "git commit-tree <arbre> [(-p <parent>)...]"
msgid ""
-"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...] [(-F "
-"<file>)...] <tree>"
+"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]\n"
+" [(-F <file>)...] <tree>"
msgstr ""
-"git commit-tree [(-p <parent>)...] [-S[<idclé>]] [(-m <message>)...] [(-F "
-"<fichier>)...] <arbre>"
+"git commit-tree [(-p <parent>)...] [-S[<idclé>]] [(-m <message>)...]\n"
+" [(-F <fichier>)...] <arbre>"
#, c-format
msgid "duplicate parent %s ignored"
@@ -4555,11 +4686,29 @@ msgstr "exactement un arbre obligatoire"
msgid "git commit-tree: failed to read"
msgstr "git commit-tree : échec de la lecture"
-msgid "git commit [<options>] [--] <pathspec>..."
-msgstr "git commit [<options>] [--] <spécification-de-chemin>..."
+msgid ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|"
+"reword):]<commit>)]\n"
+" [-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n"
+" [--date=<date>] [--cleanup=<mode>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"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=<auteur>]\n"
+" [--date=<date>] [--cleanup=<mode>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<fichier> [--pathspec-file-nul]]\n"
+" [(--trailer <symbole>[(=|:)<valeur>])...] [-S[<id-clé>]]\n"
+" [--] [<spéc-de-chemin>...]"
-msgid "git status [<options>] [--] <pathspec>..."
-msgstr "git status [<options>] [--] <spécification-de-chemin>..."
+msgid "git status [<options>] [--] [<pathspec>...]"
+msgstr "git status [<options>] [--] [<spécification-de-chemin>...]"
msgid ""
"You asked to amend the most recent commit, but doing so would make\n"
@@ -4612,6 +4761,9 @@ msgstr ""
" git cherry-pick --skip\n"
"\n"
+msgid "updating files failed"
+msgstr "échec de la mise à jour des fichiers"
+
msgid "failed to unpack HEAD tree object"
msgstr "échec du dépaquetage de l'objet arbre HEAD"
@@ -4630,9 +4782,6 @@ msgstr "impossible de mettre à jour l'index temporaire"
msgid "Failed to update main cache tree"
msgstr "Impossible de mettre à jour l'arbre de cache principal"
-msgid "unable to write new_index file"
-msgstr "impossible d'écrire le fichier new_index"
-
msgid "cannot do a partial commit during a merge."
msgstr "impossible de faire une validation partielle pendant une fusion."
@@ -4671,8 +4820,8 @@ msgstr ""
"qui n'est pas utilisé dans le message de validation actuel"
#, c-format
-msgid "could not lookup commit %s"
-msgstr "impossible de rechercher le commit %s"
+msgid "could not lookup commit '%s'"
+msgstr "impossible de rechercher le commit '%s'"
#, c-format
msgid "(reading log message from standard input)\n"
@@ -4869,9 +5018,6 @@ msgstr "afficher l'état en format long (par défaut)"
msgid "terminate entries with NUL"
msgstr "terminer les éléments par NUL"
-msgid "mode"
-msgstr "mode"
-
msgid "show untracked files, optional modes: all, normal, no. (Default: all)"
msgstr ""
"afficher les fichiers non suivis, \"mode\" facultatif : all (tous), normal, "
@@ -5045,11 +5191,11 @@ msgstr ""
msgid ""
"repository has been updated, but unable to write\n"
-"new_index file. Check that disk is not full and quota is\n"
+"new index file. Check that disk is not full and quota is\n"
"not exceeded, and then \"git restore --staged :/\" to recover."
msgstr ""
-"le dépôt a été mis à jour, mais impossible d'écrire le fichier\n"
-"new_index. Vérifiez que le disque n'est pas plein ou que le quota\n"
+"le dépôt a été mis à jour, mais impossible d'écrire le nouveau fichier\n"
+"d'index. Vérifiez que le disque n'est pas plein ou que le quota\n"
"n'a pas été dépassé, puis lancez \"git restore --staged :/\" pour réparer."
msgid "git config [<options>]"
@@ -5346,11 +5492,18 @@ msgstr "credential-cache non disponible ; pas de gestion des socket unix"
msgid "unable to get credential storage lock in %d ms"
msgstr "impossible d'accéder au verrou de stockage d'identification en %d ms"
-msgid "git describe [<options>] [<commit-ish>...]"
-msgstr "git describe [<options>] <commit ou apparenté>*"
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-esque>...]"
-msgid "git describe [<options>] --dirty"
-msgstr "git describe [<options>] --dirty"
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<marque>]"
+
+msgid "git describe <blob>"
+msgstr "git describe <blob>"
msgid "head"
msgstr "tête"
@@ -5476,6 +5629,22 @@ msgid "option '%s' and commit-ishes cannot be used together"
msgstr ""
"l'option '%s' et des commit-esques ne peuvent pas être utilisées ensemble"
+msgid ""
+"git diagnose [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--mode=<mode>]"
+msgstr ""
+"git diagnose [-o | --output-directory <fichier>] [(-s | --suffix) <format>]\n"
+" [--mode=<mode>]"
+
+msgid "specify a destination for the diagnostics archive"
+msgstr "spécifier la destination de l'archive de diagnostique"
+
+msgid "specify a strftime format suffix for the filename"
+msgstr "spécifier une suffixe au format strftime pour le nom de fichier"
+
+msgid "specify the content of the diagnostic archive"
+msgstr "spécifier le contenu de l'archive de diagnostique"
+
msgid "--merge-base only works with two commits"
msgstr "--merge-base ne fonctionne qu'avec deux commits"
@@ -5483,6 +5652,9 @@ msgstr "--merge-base ne fonctionne qu'avec deux commits"
msgid "'%s': not a regular file or symlink"
msgstr "'%s' : n'est pas un fichier régulier ni un lien symbolique"
+msgid "no merge given, only parents."
+msgstr "pas de fusion fournie, seulement des parents."
+
#, c-format
msgid "invalid option: %s"
msgstr "option invalide : %s"
@@ -5597,30 +5769,6 @@ msgstr "pas d'<outil> spécifié pour --tool=<outil>"
msgid "no <cmd> given for --extcmd=<cmd>"
msgstr "pas de <commande> spécifié pour --extcmd=<commande>"
-msgid "git env--helper --type=[bool|ulong] <options> <env-var>"
-msgstr "git env--helper --type=[bool|ulong] <options> <var d'env>"
-
-msgid "default for git_env_*(...) to fall back on"
-msgstr "valeur par défaut pour git_env_*(...) en cas d'absence"
-
-msgid "be quiet only use git_env_*() value as exit code"
-msgstr ""
-"mode silencieux n'utilisant la valeur de git_env_*() que pour le code de "
-"sortie"
-
-#, c-format
-msgid "option `--default' expects a boolean value with `--type=bool`, not `%s`"
-msgstr ""
-"l'option `--default` attend une valeur booléenne avec `--type=bool`, pas `%s`"
-
-#, c-format
-msgid ""
-"option `--default' expects an unsigned long value with `--type=ulong`, not "
-"`%s`"
-msgstr ""
-"l'option `--default` attend une valeur entier long non signé avec `--"
-"type=ulong`, pas `%s`"
-
msgid "git fast-export [<rev-list-opts>]"
msgstr "git fast-export [<options-de-liste-de-révisions>]"
@@ -5739,123 +5887,14 @@ msgstr "git fetch --all [<options>]"
msgid "fetch.parallel cannot be negative"
msgstr "fetch.parallel ne peut pas être négatif"
-msgid "fetch from all remotes"
-msgstr "récupérer depuis tous les dépôts distants"
-
-msgid "set upstream for git pull/fetch"
-msgstr "définir la branche amont pour git pull/fetch"
-
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "ajouter à .git/FETCH_HEAD au lieu de l'écraser"
-
-msgid "use atomic transaction to update references"
-msgstr "utiliser une transaction atomique pour mettre à jour les références"
-
-msgid "path to upload pack on remote end"
-msgstr "chemin vers lequel télécharger le paquet sur le poste distant"
-
-msgid "force overwrite of local reference"
-msgstr "forcer l'écrasement de la branche locale"
-
-msgid "fetch from multiple remotes"
-msgstr "récupérer depuis plusieurs dépôts distants"
-
-msgid "fetch all tags and associated objects"
-msgstr "récupérer toutes les étiquettes et leurs objets associés"
-
-msgid "do not fetch all tags (--no-tags)"
-msgstr "ne pas récupérer toutes les étiquettes (--no-tags)"
-
-msgid "number of submodules fetched in parallel"
-msgstr "nombre de sous-modules récupérés en parallèle"
-
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr ""
-"modifier le spécificateur de référence pour placer les références dans refs/"
-"prefetch/"
-
-msgid "prune remote-tracking branches no longer on remote"
-msgstr ""
-"éliminer les branches de suivi distant si la branche n'existe plus dans le "
-"dépôt distant"
-
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr ""
-"éliminer les étiquettes locales qui ont disparu du dépôt distant et qui "
-"encombrent les étiquettes modifiées"
-
-msgid "on-demand"
-msgstr "à la demande"
-
-msgid "control recursive fetching of submodules"
-msgstr "contrôler la récupération récursive dans les sous-modules"
-
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "écrire les références récupérées dans le fichier FETCH_HEAD"
-
-msgid "keep downloaded pack"
-msgstr "conserver le paquet téléchargé"
-
-msgid "allow updating of HEAD ref"
-msgstr "permettre la mise à jour de la référence HEAD"
-
-msgid "deepen history of shallow clone"
-msgstr "approfondir l'historique d'un clone superficiel"
-
-msgid "deepen history of shallow repository based on time"
-msgstr "approfondir l'historique d'un clone superficiel en fonction d'une date"
-
-msgid "convert to a complete repository"
-msgstr "convertir en un dépôt complet"
-
-msgid "re-fetch without negotiating common commits"
-msgstr "re-récupérer sans négocier les commits communs"
-
-msgid "prepend this to submodule path output"
-msgstr "préfixer ceci à la sortie du chemin du sous-module"
-
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr ""
-"par défaut pour la récupération récursive de sous-modules (priorité plus "
-"basse que les fichiers de config)"
-
-msgid "accept refs that update .git/shallow"
-msgstr "accepter les références qui mettent à jour .git/shallow"
-
-msgid "refmap"
-msgstr "correspondance de référence"
-
-msgid "specify fetch refmap"
-msgstr "spécifier une correspondance de référence pour la récupération"
-
-msgid "report that we have only objects reachable from this object"
-msgstr "rapporte que nous n'avons que des objets joignables depuis cet objet"
-
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr ""
-"ne pas récupérer le fichier paquet ; à la place, afficher les ancêtres des "
-"sommets de négociation"
-
-msgid "run 'maintenance --auto' after fetching"
-msgstr "lancer 'maintenance --auto' après la récupération"
-
-msgid "check for forced-updates on all updated branches"
-msgstr ""
-"vérifier les mises à jour forcées (forced-updates) sur toutes les branches "
-"mises à jour"
-
-msgid "write the commit-graph after fetching"
-msgstr "écrire le graphe de commits après le rapatriement"
-
-msgid "accept refspecs from stdin"
-msgstr "lire les spécificateurs de référence depuis l'entrée standard"
-
msgid "couldn't find remote ref HEAD"
msgstr "impossible de trouver la référence HEAD distante"
#, c-format
+msgid "From %.*s\n"
+msgstr "Depuis %.*s\n"
+
+#, c-format
msgid "object %s not found"
msgstr "objet %s non trouvé"
@@ -5865,11 +5904,8 @@ msgstr "[à jour]"
msgid "[rejected]"
msgstr "[rejeté]"
-msgid "can't fetch in current branch"
-msgstr "impossible de récupérer dans la branche actuelle"
-
-msgid "checked out in another worktree"
-msgstr "extrait dans un autre arbre de travail"
+msgid "can't fetch into checked-out branch"
+msgstr "impossible de récupérer dans la branche extraite"
msgid "[tag update]"
msgstr "[mise à jour de l'étiquette]"
@@ -5930,10 +5966,6 @@ msgstr ""
"permises"
#, c-format
-msgid "From %.*s\n"
-msgstr "Depuis %.*s\n"
-
-#, c-format
msgid ""
"some local refs could not be updated; try running\n"
" 'git remote prune %s' to remove any old, conflicting branches"
@@ -6024,6 +6056,119 @@ msgstr ""
msgid "you need to specify a tag name"
msgstr "Vous devez spécifier un nom d'étiquette"
+msgid "fetch from all remotes"
+msgstr "récupérer depuis tous les dépôts distants"
+
+msgid "set upstream for git pull/fetch"
+msgstr "définir la branche amont pour git pull/fetch"
+
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "ajouter à .git/FETCH_HEAD au lieu de l'écraser"
+
+msgid "use atomic transaction to update references"
+msgstr "utiliser une transaction atomique pour mettre à jour les références"
+
+msgid "path to upload pack on remote end"
+msgstr "chemin vers lequel télécharger le paquet sur le poste distant"
+
+msgid "force overwrite of local reference"
+msgstr "forcer l'écrasement de la branche locale"
+
+msgid "fetch from multiple remotes"
+msgstr "récupérer depuis plusieurs dépôts distants"
+
+msgid "fetch all tags and associated objects"
+msgstr "récupérer toutes les étiquettes et leurs objets associés"
+
+msgid "do not fetch all tags (--no-tags)"
+msgstr "ne pas récupérer toutes les étiquettes (--no-tags)"
+
+msgid "number of submodules fetched in parallel"
+msgstr "nombre de sous-modules récupérés en parallèle"
+
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+"modifier le spécificateur de référence pour placer les références dans refs/"
+"prefetch/"
+
+msgid "prune remote-tracking branches no longer on remote"
+msgstr ""
+"élaguer les branches de suivi distant si la branche n'existe plus dans le "
+"dépôt distant"
+
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr ""
+"élaguer les étiquettes locales qui ont disparu du dépôt distant et qui "
+"encombrent les étiquettes modifiées"
+
+msgid "on-demand"
+msgstr "à la demande"
+
+msgid "control recursive fetching of submodules"
+msgstr "contrôler la récupération récursive dans les sous-modules"
+
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "écrire les références récupérées dans le fichier FETCH_HEAD"
+
+msgid "keep downloaded pack"
+msgstr "conserver le paquet téléchargé"
+
+msgid "allow updating of HEAD ref"
+msgstr "permettre la mise à jour de la référence HEAD"
+
+msgid "deepen history of shallow clone"
+msgstr "approfondir l'historique d'un clone superficiel"
+
+msgid "deepen history of shallow repository based on time"
+msgstr "approfondir l'historique d'un clone superficiel en fonction d'une date"
+
+msgid "convert to a complete repository"
+msgstr "convertir en un dépôt complet"
+
+msgid "re-fetch without negotiating common commits"
+msgstr "re-récupérer sans négocier les commits communs"
+
+msgid "prepend this to submodule path output"
+msgstr "préfixer ceci à la sortie du chemin du sous-module"
+
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+"par défaut pour la récupération récursive de sous-modules (priorité plus "
+"basse que les fichiers de config)"
+
+msgid "accept refs that update .git/shallow"
+msgstr "accepter les références qui mettent à jour .git/shallow"
+
+msgid "refmap"
+msgstr "correspondance de référence"
+
+msgid "specify fetch refmap"
+msgstr "spécifier une correspondance de référence pour la récupération"
+
+msgid "report that we have only objects reachable from this object"
+msgstr "rapporte que nous n'avons que des objets joignables depuis cet objet"
+
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr ""
+"ne pas récupérer le fichier paquet ; à la place, afficher les ancêtres des "
+"sommets de négociation"
+
+msgid "run 'maintenance --auto' after fetching"
+msgstr "lancer 'maintenance --auto' après la récupération"
+
+msgid "check for forced-updates on all updated branches"
+msgstr ""
+"vérifier les mises à jour forcées (forced-updates) sur toutes les branches "
+"mises à jour"
+
+msgid "write the commit-graph after fetching"
+msgstr "écrire le graphe de commits après le rapatriement"
+
+msgid "accept refspecs from stdin"
+msgstr "lire les spécificateurs de référence depuis l'entrée standard"
+
msgid "--negotiate-only needs one or more --negotiation-tip=*"
msgstr "--negotiate-only nécessite au moins un --negotiation-tip=*"
@@ -6033,6 +6178,10 @@ msgstr "une profondeur négative dans --deepen n'est pas supportée"
msgid "--unshallow on a complete repository does not make sense"
msgstr "--unshallow sur un dépôt complet n'a pas de sens"
+#, c-format
+msgid "failed to fetch bundles from '%s'"
+msgstr "échec de récupération des colis depuis '%s'"
+
msgid "fetch --all does not take a repository argument"
msgstr "fetch --all n'accepte pas d'argument de dépôt"
@@ -6135,8 +6284,14 @@ msgstr "afficher seulement les références qui contiennent le commit"
msgid "print only refs which don't contain the commit"
msgstr "afficher seulement les références qui ne contiennent pas le commit"
-msgid "git for-each-repo --config=<config> <command-args>"
-msgstr "git for-each-repo --config=<config> <arguments-de-commande>"
+msgid "read reference patterns from stdin"
+msgstr "lire les motifs de références depuis l'entrée standard"
+
+msgid "unknown arguments supplied with --stdin"
+msgstr "arguments inconnus fournis avec l'option --stdin"
+
+msgid "git for-each-repo --config=<config> [--] <arguments>"
+msgstr "git for-each-repo --config=<config> [--] <arguments>"
msgid "config"
msgstr "config"
@@ -6147,6 +6302,10 @@ msgstr "clé de config qui stocke la liste des chemins de dépôts"
msgid "missing --config=<config>"
msgstr "--config=<config> manquant"
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "config incorrecte --config=%s"
+
msgid "unknown"
msgstr "inconnu"
@@ -6293,18 +6452,39 @@ msgstr "%s : la HEAD détachée ne pointe sur rien"
msgid "notice: %s points to an unborn branch (%s)"
msgstr "note : %s pointe sur une branche non-née (%s)"
-msgid "Checking cache tree"
-msgstr "Vérification de l'arbre cache"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "Vérification de l'arbre cache de %s"
#, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "%s : pointer sha1 invalide dans l'arbre de cache"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s : pointer sha1 invalide dans l'arbre de cache de %s"
msgid "non-tree in cache-tree"
msgstr "non-arbre dans l'arbre de cache"
-msgid "git fsck [<options>] [<object>...]"
-msgstr "git fsck [<options>] [<objet>...]"
+#, c-format
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s : pointeur sha1 invalide dans resolve-undo de %s"
+
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "impossible de charger le rev-index pour le paquet '%s'"
+
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "rev-index invalide pour le paquet '%s'"
+
+msgid ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<object>...]"
+msgstr ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<objec>...]"
msgid "show unreachable objects"
msgstr "afficher les objets inaccessibles"
@@ -6360,12 +6540,6 @@ msgstr "git fsmonitor--daemon start [<options>]"
msgid "git fsmonitor--daemon run [<options>]"
msgstr "git fsmonitor--daemon run [<options>]"
-msgid "git fsmonitor--daemon stop"
-msgstr "git fsmonitor--daemon stop"
-
-msgid "git fsmonitor--daemon status"
-msgstr "git fsmonitor--daemon status"
-
#, c-format
msgid "value of '%s' out of range: %d"
msgstr "valeur de '%s' hors de gamme : %d"
@@ -6482,11 +6656,14 @@ msgstr ""
"%s"
msgid "prune unreferenced objects"
-msgstr "éliminer les objets non référencés"
+msgstr "élaguer les objets non référencés"
msgid "pack unreferenced objects separately"
msgstr "empaqueter les objets non référencés séparément"
+msgid "with --cruft, limit the size of new cruft packs"
+msgstr "avec --cruft, limiter la taille des nouveaux paquets déchets"
+
msgid "be more thorough (increased runtime)"
msgstr "être plus consciencieux (durée de traitement allongée)"
@@ -6611,8 +6788,20 @@ msgstr "lancer une tâche spécifique"
msgid "use at most one of --auto and --schedule=<frequency>"
msgstr "--auto et --schedule=<fréquence> sont mutuellement exclusifs"
-msgid "failed to run 'git config'"
-msgstr "échec du lancement de 'git config'"
+#, c-format
+msgid "unable to add '%s' value of '%s'"
+msgstr "impossible d'ajouter la valeur '%s' de '%s'"
+
+msgid "return success even if repository was not registered"
+msgstr "renvoyer un succès même si le dépôt n'était pas enregistré"
+
+#, c-format
+msgid "unable to unset '%s' value of '%s'"
+msgstr "impossible de retirer la valeur '%s' de '%s'"
+
+#, c-format
+msgid "repository '%s' is not registered"
+msgstr "le dépôt '%s' n'est pas enregistré"
#, c-format
msgid "failed to expand path '%s'"
@@ -6640,23 +6829,20 @@ msgstr ""
"echec du lancement de 'crontab -l' ; votre système n'a pas l'air de fournir "
"'cron'"
+msgid "failed to create crontab temporary file"
+msgstr "impossible de créer un fichier crontab temporaire"
+
+msgid "failed to open temporary file"
+msgstr "impossible d'ouvrir un fichier temporaire"
+
msgid "failed to run 'crontab'; your system might not support 'cron'"
msgstr ""
"echec du lancement de 'crontab' ; votre système n'a pas l'air de fournir "
"'cron'"
-msgid "failed to open stdin of 'crontab'"
-msgstr "échec à l'ouverture de stdin de 'crontab'"
-
msgid "'crontab' died"
msgstr "'crontab' est mort"
-msgid "failed to start systemctl"
-msgstr "échec du démarrage de systemctl"
-
-msgid "failed to run systemctl"
-msgstr "échec pour lancer systemctl"
-
#, c-format
msgid "failed to delete '%s'"
msgstr "échec de la suppression de '%s'"
@@ -6665,6 +6851,12 @@ msgstr "échec de la suppression de '%s'"
msgid "failed to flush '%s'"
msgstr "échec du flush de '%s'"
+msgid "failed to start systemctl"
+msgstr "échec du démarrage de systemctl"
+
+msgid "failed to run systemctl"
+msgstr "échec pour lancer systemctl"
+
#, c-format
msgid "unrecognized --scheduler argument '%s'"
msgstr "argument '%s' de --scheduler non reconnu"
@@ -6690,16 +6882,15 @@ msgstr "planificateur"
msgid "scheduler to trigger git maintenance run"
msgstr "planificateur qui lancera les maintenances git"
+msgid "failed to set up maintenance schedule"
+msgstr "impossible de mettre en place la planification de maintenance"
+
msgid "failed to add repo to global config"
msgstr "échec de l'ajout du dépôt à la config globale"
msgid "git maintenance <subcommand> [<options>]"
msgstr "git maintenance <subcommand> [<options>]"
-#, c-format
-msgid "invalid subcommand: %s"
-msgstr "sous-commande invalide : %s"
-
msgid "git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]"
msgstr "git grep [<options>] [-e] <motif> [<révision>...] [[--] <chemin>...]"
@@ -6725,6 +6916,10 @@ msgid "unable to read tree (%s)"
msgstr "impossible de lire l'arbre (%s)"
#, c-format
+msgid "unable to read tree %s"
+msgstr "impossible de lire l'arbre %s"
+
+#, c-format
msgid "unable to grep from object of type %s"
msgstr "impossible de faire un grep sur un objet de type %s"
@@ -6768,8 +6963,8 @@ msgstr "traiter les fichiers binaires avec les filtres textconv"
msgid "search in subdirectories (default)"
msgstr "rechercher dans les sous-répertoires (défaut)"
-msgid "descend at most <depth> levels"
-msgstr "descendre au plus de <profondeur> dans l'arborescence"
+msgid "descend at most <n> levels"
+msgstr "descendre au plus de <n> niveaux"
msgid "use extended POSIX regular expressions"
msgstr "utiliser des expressions régulières étendues POSIX"
@@ -6877,6 +7072,9 @@ msgstr "afficher les fichiers correspondant dans le pagineur"
msgid "allow calling of grep(1) (ignored by this build)"
msgstr "permettre l'appel de grep(1) (ignoré par ce build)"
+msgid "maximum number of results per file"
+msgstr "nombre maximum de résultats par fichier"
+
msgid "no pattern given"
msgstr "aucun motif fourni"
@@ -6911,11 +7109,14 @@ msgid "both --cached and trees are given"
msgstr "--cached et des arbres sont fournis en même temps"
msgid ""
-"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] "
-"[--] <file>..."
+"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
+" [--stdin [--literally]] [--] <file>..."
msgstr ""
-"git hash-object [-t <type>] [-w] [--path=<fichier> | --no-filters] [--stdin] "
-"[--] <fichier>..."
+"git hash-object [-t <type>] [-w] [--path=<fichier> | --no-filters]\n"
+" [--stdin [--literally]] [--] <fichier>..."
+
+msgid "git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]"
+msgstr "git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]"
msgid "object type"
msgstr "type d'objet"
@@ -6965,11 +7166,19 @@ msgstr "afficher la description de la commande"
msgid "print list of useful guides"
msgstr "afficher une liste de guides utiles"
+msgid "print list of user-facing repository, command and file interfaces"
+msgstr "afficher les liste des dépôts publics, des commandes et des interfaces"
+
+msgid "print list of file formats, protocols and other developer interfaces"
+msgstr ""
+"afficher la liste des formats de fichier, des protocoles et des autres "
+"interfaces pour développeur"
+
msgid "print all configuration variable names"
msgstr "afficher tous les noms de variables de configuration"
-msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>]"
-msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<commande>]"
+msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"
+msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<commande>|<doc>]"
#, c-format
msgid "unrecognized help format '%s'"
@@ -7040,13 +7249,19 @@ msgstr "usage : %s%s"
msgid "'git help config' for more information"
msgstr "'git help config' pour plus d'information"
-msgid "git hook run [--ignore-missing] <hook-name> [-- <hook-args>]"
+msgid ""
+"git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-"
+"args>]"
msgstr ""
-"git hook run [--ignore-missing] <nom-de-crochet> [-- <arguments-de-crochet>]"
+"git hook run [--ignore-missing] [--to-stdin=<chemin>] <nom-de-crochet> [-- "
+"<arguments-de-crochet>]"
msgid "silently ignore missing requested <hook-name>"
msgstr "ignorer silencieusement le <nom-de-crochet> requis manquant"
+msgid "file to read into hooks' stdin"
+msgstr "fichier à la lire dans l'entrée standard du crochet"
+
#, c-format
msgid "object type mismatch at %s"
msgstr "type d'objet non correspondant à %s"
@@ -7123,10 +7338,6 @@ msgid "SHA1 COLLISION FOUND WITH %s !"
msgstr "COLLISION SHA1 TROUVÉE AVEC %s !"
#, c-format
-msgid "unable to read %s"
-msgstr "impossible de lire %s"
-
-#, c-format
msgid "cannot read existing object info %s"
msgstr "impossible de lire l'information existante de l'objet %s"
@@ -7264,83 +7475,18 @@ msgstr "--verify sans nom de fichier paquet donné"
msgid "fsck error in pack objects"
msgstr "erreur de fsck dans les objets paquets"
-#, c-format
-msgid "cannot stat template '%s'"
-msgstr "impossible de faire un stat du modèle '%s'"
-
-#, c-format
-msgid "cannot opendir '%s'"
-msgstr "impossible d'ouvrir le répertoire '%s'"
-
-#, c-format
-msgid "cannot readlink '%s'"
-msgstr "impossible de lire le lien '%s'"
-
-#, c-format
-msgid "cannot symlink '%s' '%s'"
-msgstr "impossible de créer un lien symbolique de '%s' '%s'"
-
-#, c-format
-msgid "cannot copy '%s' to '%s'"
-msgstr "impossible de copier '%s' vers '%s'"
-
-#, c-format
-msgid "ignoring template %s"
-msgstr "modèle %s ignoré"
-
-#, c-format
-msgid "templates not found in %s"
-msgstr "modèles non trouvés dans %s"
-
-#, c-format
-msgid "not copying templates from '%s': %s"
-msgstr "pas de copie des modèles depuis '%s' : %s"
-
-#, c-format
-msgid "invalid initial branch name: '%s'"
-msgstr "nom de branche initiale invalide : '%s'"
-
-#, c-format
-msgid "unable to handle file type %d"
-msgstr "impossible de traiter le fichier de type %d"
-
-#, c-format
-msgid "unable to move %s to %s"
-msgstr "impossible de déplacer %s vers %s"
-
-msgid "attempt to reinitialize repository with different hash"
-msgstr "essai de réinitialisation du dépôt avec une empreinte différente"
-
-#, c-format
-msgid "%s already exists"
-msgstr "%s existe déjà"
-
-#, c-format
-msgid "re-init: ignored --initial-branch=%s"
-msgstr "re-initialisation : --initial-branch=%s ignoré"
-
-#, c-format
-msgid "Reinitialized existing shared Git repository in %s%s\n"
-msgstr "Dépôt Git existant partagé réinitialisé dans %s%s\n"
-
-#, c-format
-msgid "Reinitialized existing Git repository in %s%s\n"
-msgstr "Dépôt Git existant réinitialisé dans %s%s\n"
-
-#, c-format
-msgid "Initialized empty shared Git repository in %s%s\n"
-msgstr "Dépôt Git vide partagé initialisé dans %s%s\n"
-
-#, c-format
-msgid "Initialized empty Git repository in %s%s\n"
-msgstr "Dépôt Git vide initialisé dans %s%s\n"
-
msgid ""
-"git init [-q | --quiet] [--bare] [--template=<template-directory>] [--"
-"shared[=<permissions>]] [<directory>]"
+"git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
+" [--separate-git-dir <git-dir>] [--object-format=<format>]\n"
+" [--ref-format=<format>]\n"
+" [-b <branch-name> | --initial-branch=<branch-name>]\n"
+" [--shared[=<permissions>]] [<directory>]"
msgstr ""
-"git init [-q | --quiet] [--bare] [--template=<répertoire-modèle>] [--"
-"shared[=<permissions>]] [<répertoire>]"
+"git init [-q | --quiet] [--bare] [--template=<répertoire-de-modèles>]\n"
+" [--separate-git-dir <rép-git>] [--object-format=<format>]\n"
+" [--ref-format=<format>]\n"
+" [-b <nom-de-branch> | --initial-branch=<nom-de-branche>]\n"
+" [--shared[=<permissions>]] [<répertoire>]"
msgid "permissions"
msgstr "permissions"
@@ -7381,11 +7527,14 @@ msgid "--separate-git-dir incompatible with bare repository"
msgstr "--separate-git-dir est incompatible avec un dépôt nu"
msgid ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"<token>[(=|:)<value>])...] [<file>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<key>|<keyAlias>)[(=|:)<value>])...]\n"
+" [--parse] [<file>...]"
msgstr ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"<symbole>[(=|:)<valeur>])...] [<fichier>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<clé>|<alias-de-clé>)"
+"[(=|:)<valeur>])...]\n"
+" [--parse] [<fichier>...]"
msgid "edit files in place"
msgstr "éditer les fichiers sur place"
@@ -7393,6 +7542,9 @@ msgstr "éditer les fichiers sur place"
msgid "trim empty trailers"
msgstr "éliminer les lignes de fin vides"
+msgid "placement"
+msgstr "placement"
+
msgid "where to place the new trailer"
msgstr "où placer les nouvelles lignes terminales"
@@ -7405,17 +7557,19 @@ msgstr "action si les lignes terminales manquent"
msgid "output only the trailers"
msgstr "éliminer les lignes terminales vides"
-msgid "do not apply config rules"
-msgstr "ne pas appliquer les règles de la configuration"
+msgid "do not apply trailer.* configuration variables"
+msgstr "ne pas appliquer les variables de configuration trailer.*"
-msgid "join whitespace-continued values"
-msgstr "joindre les valeurs continuées avec des caractères blancs"
+msgid "reformat multiline trailer values as single-line values"
+msgstr ""
+"reformatter les valeurs de ligne terminales multi-lignes en valeurs sur une "
+"seule ligne"
-msgid "set parsing options"
-msgstr "paramètres d'analyse"
+msgid "alias for --only-trailers --only-input --unfold"
+msgstr "alias pour --only-trailers --only-input --unfold"
-msgid "do not treat --- specially"
-msgstr "ne pas traiter spécialement ---"
+msgid "do not treat \"---\" as the end of input"
+msgstr "ne pas traiter \"---\" comme la fin d'entrée"
msgid "trailer(s) to add"
msgstr "ligne(s) de fin à ajouter"
@@ -7442,8 +7596,8 @@ msgstr "supprimer la sortie des différences"
msgid "show source"
msgstr "afficher la source"
-msgid "use mail map file"
-msgstr "utiliser le fichier de correspondance de mail"
+msgid "clear all previously-defined decoration filters"
+msgstr "effacer tous les filtres de décoration précédemment définis"
msgid "only decorate refs that match <pattern>"
msgstr "décorer seulement les références correspondant à <motif>"
@@ -7505,6 +7659,10 @@ msgstr "exactement une plage nécessaire"
msgid "not a range"
msgstr "ceci n'est pas une plage"
+#, c-format
+msgid "unable to read branch description file '%s'"
+msgstr "lecture du fichier de description de branche '%s' impossible"
+
msgid "cover letter needs email format"
msgstr "la lettre de motivation doit être au format courriel"
@@ -7611,6 +7769,9 @@ msgstr ""
"générer des parties de la lettre d'introduction à partir de la description "
"de la branche"
+msgid "use branch description from file"
+msgstr "utiliser la description de branche dans le fichier"
+
msgid "use [<prefix>] instead of [PATCH]"
msgstr "utiliser [<préfixe>] au lieu de [PATCH]"
@@ -7711,6 +7872,11 @@ msgstr ""
msgid "percentage by which creation is weighted"
msgstr "pourcentage par lequel la création est pondérée"
+msgid "show in-body From: even if identical to the e-mail header"
+msgstr ""
+"montrer les From: inclus même s'ils sont identiques à celui de l'entête du "
+"courriel"
+
#, c-format
msgid "invalid ident line: %s"
msgstr "ligne d'identification invalide : %s"
@@ -7771,6 +7937,22 @@ msgstr ""
"Impossible de trouver une branche distante suivie, merci de spécifier "
"<branche_amont> manuellement.\n"
+#, c-format
+msgid "could not get object info about '%s'"
+msgstr "impossible d'obtenir l'information d'objet pour '%s'"
+
+#, 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 "git ls-files [<options>] [<file>...]"
msgstr "git ls-files [<options>] [<fichier>...]"
@@ -7842,7 +8024,7 @@ msgid "if any <file> is not in the index, treat this as an error"
msgstr "si un <fichier> n'est pas dans l'index, traiter cela comme une erreur"
msgid "tree-ish"
-msgstr "arbre ou apparenté"
+msgstr "arbre-esque"
msgid "pretend that paths removed since <tree-ish> are still present"
msgstr ""
@@ -7859,13 +8041,20 @@ msgid "show sparse directories in the presence of a sparse index"
msgstr "afficher les répertoires clairsemés en présence d'un index clairsemé"
msgid ""
+"--format cannot be used with -s, -o, -k, -t, --resolve-undo, --deduplicate, "
+"--eol"
+msgstr ""
+"--format ne peut pas être utilisé avec -s, -o, -k, -t, --resolve-undo, --"
+"deduplicate, --eol"
+
+msgid ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<repository> [<refs>...]]"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
+" [--symref] [<repository> [<patterns>...]]"
msgstr ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<dépôt> [<réf>...]]"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<clé>]\n"
+" [--symref] [<dépôt> [<motif>...]]"
msgid "do not print remote URL"
msgstr "ne pas afficher les URL distantes"
@@ -7900,10 +8089,6 @@ msgid "git ls-tree [<options>] <tree-ish> [<path>...]"
msgstr "git ls-tree [<options>] <arbre ou apparenté> [<chemin>...]"
#, c-format
-msgid "could not get object info about '%s'"
-msgstr "impossible d'obtenir l'information d'objet pour '%s'"
-
-#, c-format
msgid "bad ls-tree format: element '%s' does not start with '('"
msgstr "mauvais format ls-tree : l'élément '%s' ne commence pas par '('"
@@ -7999,12 +8184,12 @@ msgstr "git merge-base [-a | --all] <commit> <commit>..."
msgid "git merge-base [-a | --all] --octopus <commit>..."
msgstr "git merge-base [-a | --all] --octopus <commit>..."
-msgid "git merge-base --independent <commit>..."
-msgstr "git merge-base --independent <validation>..."
-
msgid "git merge-base --is-ancestor <commit> <commit>"
msgstr "git merge-base --is-ancestor <validation> <validation>"
+msgid "git merge-base --independent <commit>..."
+msgstr "git merge-base --independent <validation>..."
+
msgid "git merge-base --fork-point <ref> [<commit>]"
msgstr "git merge-base --fork-point <référence> [<validation>]"
@@ -8030,9 +8215,19 @@ msgstr ""
"git merge-file [<options>] [-L <nom1> [-L <orig> [-L <nom2>]]] <fichier1> "
"<fichier-orig> <fichier2>"
+msgid ""
+"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
+"\"histogram\""
+msgstr ""
+"l'option diff-algorithm accept \"myers\", \"minimal\", \"patience\" et "
+"\"histogram\""
+
msgid "send results to standard output"
msgstr "envoyer les résultats sur la sortie standard"
+msgid "use object IDs instead of filenames"
+msgstr "utiliser les IDs d'objet au lieu de noms de fichier"
+
msgid "use a diff3 based merge"
msgstr "utiliser une fusion basée sur diff3"
@@ -8048,6 +8243,12 @@ msgstr "pour les conflits, utiliser leur version (their)"
msgid "for conflicts, use a union version"
msgstr "pour les conflits, utiliser l'ensemble des versions"
+msgid "<algorithm>"
+msgstr "<algorithme>"
+
+msgid "choose a diff algorithm"
+msgstr "choisir un algorithme de différence"
+
msgid "for conflicts, use this marker size"
msgstr "pour les conflits, utiliser cette taille de marqueur"
@@ -8058,6 +8259,13 @@ msgid "set labels for file1/orig-file/file2"
msgstr "définir les labels pour fichier1/fichier-orig/fichier2"
#, c-format
+msgid "object '%s' does not exist"
+msgstr "l'objet '%s' n'existe pas"
+
+msgid "Could not write object file"
+msgstr "impossible d'écrire le fichier d'objet"
+
+#, c-format
msgid "unknown option %s"
msgstr "option inconnue %s"
@@ -8082,6 +8290,63 @@ msgstr "impossible de résoudre la référence '%s'"
msgid "Merging %s with %s\n"
msgstr "Fusion de %s avec %s\n"
+msgid "not something we can merge"
+msgstr "pas possible de fusionner ceci"
+
+msgid "refusing to merge unrelated histories"
+msgstr "refus de fusionner des historiques sans relation"
+
+msgid "failure to merge"
+msgstr "échec de la fusion"
+
+msgid "git merge-tree [--write-tree] [<options>] <branch1> <branch2>"
+msgstr "git merge-tree [--write-tree] [<options>] <branche1> <branche2>"
+
+msgid "git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"
+msgstr "git merge-tree [--trivial-merge] <arbre-de-base> <branche1> <branche2>"
+
+msgid "do a real merge instead of a trivial merge"
+msgstr "faire une fusion réelle au lieu d'une fusion triviale"
+
+msgid "do a trivial merge only"
+msgstr "faire seulement une fusion triviale"
+
+msgid "also show informational/conflict messages"
+msgstr "afficher aussi les messages d'information/de conflit"
+
+msgid "list filenames without modes/oids/stages"
+msgstr "lister les noms de fichier sans modes/oids/indexation"
+
+msgid "allow merging unrelated histories"
+msgstr "permettre la fusion d'historiques sans rapport"
+
+msgid "perform multiple merges, one per line of input"
+msgstr "réaliser des fusions multiples, une par ligne d'entrée"
+
+msgid "specify a merge-base for the merge"
+msgstr "spécifier une base de fusion pour la fusion"
+
+msgid "option=value"
+msgstr "option=valeur"
+
+msgid "option for selected merge strategy"
+msgstr "option pour la stratégie de fusion sélectionnée"
+
+msgid "--trivial-merge is incompatible with all other options"
+msgstr "--trivial-merge est incompatible avec d'autres options"
+
+#, c-format
+msgid "unknown strategy option: -X%s"
+msgstr "option de stratégie inconnue : -X%s"
+
+#, c-format
+msgid "malformed input line: '%s'."
+msgstr "ligne en entrée malformée : '%s'."
+
+#, c-format
+msgid "merging cannot continue; got unclean result of %d"
+msgstr "la fusion ne peut pas continuer ; résultat non propre retourné %d"
+
msgid "git merge [<options>] [<commit>...]"
msgstr "git merge [<options>] [<commit>...]"
@@ -8142,12 +8407,6 @@ msgstr "stratégie"
msgid "merge strategy to use"
msgstr "stratégie de fusion à utiliser"
-msgid "option=value"
-msgstr "option=valeur"
-
-msgid "option for selected merge strategy"
-msgstr "option pour la stratégie de fusion sélectionnée"
-
msgid "merge commit message (for a non-fast-forward merge)"
msgstr ""
"message de validation de la fusion (pour une fusion sans avance rapide)"
@@ -8164,9 +8423,6 @@ msgstr "--abort mais laisser l'index et l'arbre de travail inchangés"
msgid "continue the current in-progress merge"
msgstr "continuer la fusion en cours"
-msgid "allow merging unrelated histories"
-msgstr "permettre la fusion d'historiques sans rapport"
-
msgid "bypass pre-merge-commit and commit-msg hooks"
msgstr "ne pas utiliser les crochets pre-merge-commit et commit-msg"
@@ -8212,10 +8468,6 @@ msgid "Not handling anything other than two heads merge."
msgstr "Impossible de gérer autre chose que la fusion de deux têtes."
#, c-format
-msgid "unknown strategy option: -X%s"
-msgstr "option de stratégie inconnue : -X%s"
-
-#, c-format
msgid "unable to write %s"
msgstr "impossible d'écrire %s"
@@ -8289,9 +8541,6 @@ msgstr "impossible de fermer '%s'"
msgid "not something we can merge in %s: %s"
msgstr "pas possible de fusionner ceci dans %s : %s"
-msgid "not something we can merge"
-msgstr "pas possible de fusionner ceci"
-
msgid "--abort expects no arguments"
msgstr "--abort n'accepte pas d'argument"
@@ -8342,14 +8591,20 @@ msgid "Can merge only exactly one commit into empty head"
msgstr ""
"Possible de fusionner exactement une seule validation dans une tête vide"
-msgid "refusing to merge unrelated histories"
-msgstr "refus de fusionner des historiques sans relation"
-
#, c-format
msgid "Updating %s..%s\n"
msgstr "Mise à jour %s..%s\n"
#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+" %s"
+msgstr ""
+"Vos modifications locales aux fichiers suivants seraient écrasées par la "
+"fusion :\n"
+" %s"
+
+#, c-format
msgid "Trying really trivial in-index merge...\n"
msgstr "Essai de fusion vraiment triviale dans l'index...\n"
@@ -8383,6 +8638,11 @@ msgstr ""
"La fusion automatique a réussi ; stoppée avant la validation comme demandé\n"
#, c-format
+msgid "When finished, apply stashed changes with `git stash pop`\n"
+msgstr ""
+"Une fois terminé, appliquer les modifications remisées avec `git stash pop`\n"
+
+#, c-format
msgid "warning: tag input does not pass fsck: %s"
msgstr "attention : l'entrée d'étiquette ne passe pas fsck : %s"
@@ -8502,11 +8762,14 @@ msgstr "Vérification du renommage de '%s' en '%s'\n"
msgid "bad source"
msgstr "mauvaise source"
+msgid "destination exists"
+msgstr "la destination existe"
+
msgid "can not move directory into itself"
msgstr "impossible de déplacer un répertoire dans lui-même"
-msgid "cannot move directory over file"
-msgstr "impossible de déplacer un répertoire sur un fichier"
+msgid "destination already exists"
+msgstr "la destination existe déjà"
msgid "source directory is empty"
msgstr "le répertoire source est vide"
@@ -8517,9 +8780,6 @@ msgstr "pas sous le contrôle de version"
msgid "conflicted"
msgstr "en conflit"
-msgid "destination exists"
-msgstr "la destination existe"
-
#, c-format
msgid "overwriting '%s'"
msgstr "écrasement de '%s'"
@@ -8533,6 +8793,9 @@ msgstr "multiples sources pour la même destination"
msgid "destination directory does not exist"
msgstr "le répertoire de destination n'existe pas"
+msgid "destination exists in the index"
+msgstr "la destination existe dans l'index"
+
#, c-format
msgid "%s, source=%s, destination=%s"
msgstr "%s, source=%s, destination=%s"
@@ -8587,22 +8850,26 @@ msgid "git notes [--ref <notes-ref>] [list [<object>]]"
msgstr "git notes [--ref <références-notes>] [list [<object>]]"
msgid ""
-"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [-m <msg> | -F <file> "
-"| (-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref <références-notes>] add [-f] [--allow-empty] [-m <message> "
-"| -F <fichier> | (-c | -C) <objet>] [<objet>]"
+"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>]"
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
msgstr ""
"git notes [--ref <références-notes>] copy [-f] <depuis-objet> <vers-objet>"
msgid ""
-"git notes [--ref <notes-ref>] append [--allow-empty] [-m <msg> | -F <file> | "
-"(-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref <références-notes>] append [--allow-empty] [-m <message> | -"
-"F <fichier> | (-c | -C) <objet>] [<objet>]"
+"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>]"
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
msgstr "git notes [--ref <références-notes>] edit [--allow-empty] [<objet>]"
@@ -8702,10 +8969,6 @@ msgid "cannot read note data from non-blob object '%s'."
msgstr "impossible de lire les informations de note d'un objet non-blob '%s'."
#, c-format
-msgid "malformed input line: '%s'."
-msgstr "ligne en entrée malformée : '%s'."
-
-#, c-format
msgid "failed to copy notes from '%s' to '%s'"
msgstr "impossible de copier les notes de '%s' vers '%s'"
@@ -8738,6 +9001,15 @@ msgstr "permettre de stocker une note vide"
msgid "replace existing notes"
msgstr "remplacer les notes existantes"
+msgid "<paragraph-break>"
+msgstr "<séparateur-paragraphe>"
+
+msgid "insert <paragraph-break> between paragraphs"
+msgstr "insérer <séparateur-paragraphe> entre les paragraphes"
+
+msgid "remove unnecessary whitespace"
+msgstr "retirer les espaces inutiles"
+
#, c-format
msgid ""
"Cannot add notes. Found existing notes for object %s. Use '-f' to overwrite "
@@ -8894,19 +9166,18 @@ msgid "use notes from <notes-ref>"
msgstr "utiliser les notes depuis <références-notes>"
#, c-format
-msgid "unknown subcommand: %s"
-msgstr "sous-commande inconnue : %s"
+msgid "unknown subcommand: `%s'"
+msgstr "sous-commande inconnue : `%s'"
-msgid ""
-"git pack-objects --stdout [<options>...] [< <ref-list> | < <object-list>]"
+msgid "git pack-objects --stdout [<options>] [< <ref-list> | < <object-list>]"
msgstr ""
-"git pack-objects --stdout [options...] [< <liste-références> | < <liste-"
+"git pack-objects --stdout [<options>] [< <liste-références> | < <liste-"
"objets>]"
msgid ""
-"git pack-objects [<options>...] <base-name> [< <ref-list> | < <object-list>]"
+"git pack-objects [<options>] <base-name> [< <ref-list> | < <object-list>]"
msgstr ""
-"git pack-objects [options...] base-name [< <liste-références> | < <liste-"
+"git pack-objects [<options>] <nom-de-base> [< <liste-références> | < <liste-"
"objets>]"
#, c-format
@@ -9015,6 +9286,10 @@ msgid "inconsistency with delta count"
msgstr "inconsistance dans le compte de delta"
#, c-format
+msgid "invalid pack.allowPackReuse value: '%s'"
+msgstr "valeur invalide de pack.allowPackReuse : '%s'"
+
+#, c-format
msgid ""
"value of uploadpack.blobpackfileuri must be of the form '<object-hash> <pack-"
"hash> <uri>' (got '%s')"
@@ -9098,6 +9373,12 @@ msgstr "version d'index non supportée %s"
msgid "bad index version '%s'"
msgstr "mauvaise version d'index '%s'"
+msgid "show progress meter during object writing phase"
+msgstr "afficher la barre de progression durant la phase d'écrite des objets"
+
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "similaire à --all-progress quand la barre de progression est affichée"
+
msgid "<version>[,<offset>]"
msgstr "<version>[,<décalage>]"
@@ -9252,9 +9533,6 @@ msgstr "la taille limite minimale d'un paquet est 1 MiB"
msgid "--thin cannot be used to build an indexable pack"
msgstr "--thin ne peut pas être utilisé pour construire un paquet indexable"
-msgid "cannot use --filter without --stdout"
-msgstr "impossible d'utiliser --filter sans --stdout"
-
msgid "cannot use --filter with --stdin-packs"
msgstr "impossible d'utiliser --filter avec --stdin-packs"
@@ -9268,19 +9546,16 @@ msgstr "impossible d'utiliser une liste interne de révisions avec --cruft"
msgid "cannot use --stdin-packs with --cruft"
msgstr "impossible d'utiliser --stdin-packs avec --cruft"
-msgid "cannot use --max-pack-size with --cruft"
-msgstr "impossible d'utiliser --max-pack-size avec --cruft"
-
msgid "Enumerating objects"
msgstr "Énumération des objets"
#, c-format
msgid ""
"Total %<PRIu32> (delta %<PRIu32>), reused %<PRIu32> (delta %<PRIu32>), pack-"
-"reused %<PRIu32>"
+"reused %<PRIu32> (from %<PRIuMAX>)"
msgstr ""
"Total %<PRIu32> (delta %<PRIu32>), réutilisés %<PRIu32> (delta %<PRIu32>), "
-"réutilisés du pack %<PRIu32>"
+"réutilisés du paquet %<PRIu32> (depuis %<PRIuMAX>)"
msgid ""
"'git pack-redundant' is nominated for removal.\n"
@@ -9295,20 +9570,44 @@ msgstr ""
"sur la ligne de commande pour nous avertir par\n"
"un courriel à <git@vger.kernel.org>. Merci.\n"
-msgid "git pack-refs [<options>]"
-msgstr "git pack-refs [<options>]"
+msgid "refusing to run without --i-still-use-this"
+msgstr "refus de lancer sans --i-still-use-this"
+
+msgid ""
+"git pack-refs [--all] [--no-prune] [--include <pattern>] [--exclude "
+"<pattern>]"
+msgstr ""
+"git pack-refs [--all] [--no-prune] [--include <motif>] [--exclude <motif>]"
msgid "pack everything"
msgstr "empaqueter tout"
msgid "prune loose refs (default)"
-msgstr "éliminer les références perdues (défaut)"
+msgstr "élaguer les références perdues (défaut)"
+
+msgid "references to include"
+msgstr "références à inclure"
+
+msgid "references to exclude"
+msgstr "références à exclure"
+
+msgid "git patch-id [--stable | --unstable | --verbatim]"
+msgstr "git patch-id [--stable | --unstable | --verbatim]"
+
+msgid "use the unstable patch-id algorithm"
+msgstr "utiliser l'algorithme instable patch-id"
+
+msgid "use the stable patch-id algorithm"
+msgstr "utiliser l'algorithme stable patch-id"
+
+msgid "don't strip whitespace from the patch"
+msgstr "ne pas retirer les espaces blancs de la rustine"
msgid "git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"
msgstr "git prune [-n] [-v] [--progress] [--expire <heure>] [--] [<head>…]"
msgid "report pruned objects"
-msgstr "afficher les objets éliminés"
+msgstr "afficher les objets élagués"
msgid "expire objects older than <time>"
msgstr "faire expirer les objets plus vieux que <heure>"
@@ -9317,7 +9616,7 @@ msgid "limit traversal to objects outside promisor packfiles"
msgstr "limiter la traversée aux objets hors des fichiers paquets prometteurs"
msgid "cannot prune in a precious-objects repo"
-msgstr "impossible de nettoyer dans un dépôt d'objets précieux"
+msgstr "impossible d'élaguer dans un dépôt d'objets précieux"
msgid "git pull [<options>] [<repository> [<refspec>...]]"
msgstr "git pull [<options>] [<dépôt> [<spécification-de-référence>...]]"
@@ -9349,6 +9648,12 @@ msgstr "forcer l'écrasement de la branche locale"
msgid "number of submodules pulled in parallel"
msgstr "nombre de sous-modules tirés en parallèle"
+msgid "use IPv4 addresses only"
+msgstr "n'utiliser que des adresses IPv4"
+
+msgid "use IPv6 addresses only"
+msgstr "n'utiliser que des adresses IPv6"
+
msgid ""
"There is no candidate for rebasing against among the refs that you just "
"fetched."
@@ -9442,7 +9747,7 @@ msgstr ""
"les réconcilier. Vous pouvez le faire en lançant une des\n"
"commandes suivantes avant votre prochain tirage :\n"
"\n"
-" git config pull.rebase false # fusion (stratégie par défaut)\n"
+" git config pull.rebase false # fusion\n"
" git config pull.rebase true # rebasage\n"
" git config pull.ff only # avance rapide seulement\n"
"\n"
@@ -9459,8 +9764,8 @@ msgstr ""
msgid "pull with rebase"
msgstr "tirer avec un rebasage"
-msgid "please commit or stash them."
-msgstr "veuillez les valider ou les remiser."
+msgid "Please commit or stash them."
+msgstr "Veuillez les valider ou les remiser."
#, c-format
msgid ""
@@ -9524,9 +9829,8 @@ msgstr ""
msgid ""
"\n"
-"To avoid automatically configuring upstream branches when their name\n"
-"doesn't match the local branch, see option 'simple' of branch."
-"autoSetupMerge\n"
+"To avoid automatically configuring an upstream branch when its name\n"
+"won't match the local branch, see option 'simple' of branch.autoSetupMerge\n"
"in 'git help config'.\n"
msgstr ""
"\n"
@@ -9620,46 +9924,43 @@ msgstr ""
msgid ""
"Updates were rejected because the tip of your current branch is behind\n"
-"its remote counterpart. Integrate the remote changes (e.g.\n"
-"'git pull ...') before pushing again.\n"
+"its remote counterpart. If you want to integrate the remote changes,\n"
+"use 'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"Les mises à jour ont été rejetées car la pointe de la branche courante est "
+"Les mises à jour ont été rejetées car le sommet de la branche actuelle est "
"derrière\n"
-"son homologue distant. Intégrez les changements distants (par exemple 'git "
-"pull ...')\n"
-"avant de pousser à nouveau.\n"
+"son homologue distant. Si vous souhaitez intégrer les changements distants,\n"
+"utilisez 'git pull' avant de pousser à nouveau.\n"
"Voir la 'Note à propos des avances rapides' dans 'git push --help' pour plus "
"d'information."
msgid ""
"Updates were rejected because a pushed branch tip is behind its remote\n"
-"counterpart. Check out this branch and integrate the remote changes\n"
-"(e.g. 'git pull ...') before pushing again.\n"
+"counterpart. If you want to integrate the remote changes, use 'git pull'\n"
+"before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"Les mises à jour ont été rejetées car la pointe de la branche courante est "
+"Les mises à jour ont été rejetées, car le sommet d'une branche poussée est "
"derrière\n"
-"son homologue distant. Extrayez cette branche et intégrez les changements "
-"distants\n"
-"(par exemple 'git pull ...') avant de pousser à nouveau.\n"
+"son homologue distant. Si vous souhaitez intégrer les changements distants,\n"
+"\"utilisez 'git pull' avant de pousser à nouveau.\n"
"Voir la 'Note à propos des avances rapides' dans 'git push --help' pour plus "
"d'information."
msgid ""
-"Updates were rejected because the remote contains work that you do\n"
-"not have locally. This is usually caused by another repository pushing\n"
-"to the same ref. You may want to first integrate the remote changes\n"
-"(e.g., 'git pull ...') before pushing again.\n"
+"Updates were rejected because the remote contains work that you do not\n"
+"have locally. This is usually caused by another repository pushing to\n"
+"the same ref. If you want to integrate the remote changes, use\n"
+"'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"Les mises à jour ont été rejetées car la branche distante contient du "
-"travail que\n"
-"vous n'avez pas en local. Ceci est généralement causé par un autre dépôt "
-"poussé\n"
-"vers la même référence. Vous pourriez intégrer d'abord les changements "
-"distants\n"
-"(par exemple 'git pull ...') avant de pousser à nouveau.\n"
+"Les mises à jour ont été rejetées car le distant contient du travail que "
+"vous\n"
+"n'avez pas localement. La cause probable est que quelqu'un a déjà poussé sur "
+"la même réf.\n"
+"depuis un autre dépôt. Si vous souhaitez intégrer les changements distants,\n"
+"\"utilisez 'git pull' avant de pousser à nouveau.\n"
"Voir la 'Note à propos des avances rapides' dans 'git push --help' pour plus "
"d'information."
@@ -9680,15 +9981,18 @@ msgstr ""
"vers un objet qui n'est pas un commit, sans utiliser l'option '--force'.\n"
msgid ""
-"Updates were rejected because the tip of the remote-tracking\n"
-"branch has been updated since the last checkout. You may want\n"
-"to integrate those changes locally (e.g., 'git pull ...')\n"
-"before forcing an update.\n"
+"Updates were rejected because the tip of the remote-tracking branch has\n"
+"been updated since the last checkout. If you want to integrate the\n"
+"remote changes, use 'git pull' before pushing again.\n"
+"See the 'Note about fast-forwards' in 'git push --help' for details."
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"
+"Les mises à jour ont été rejetées, car le sommet de la branche de suivi à "
+"distance a\n"
+"été mis à jour depuis la dernière extraction. Si vous souhaitez intégrer les "
+"changements distants,\n"
+"\"utilisez 'git pull' avant de pousser à nouveau.\n"
+"Voir la 'Note à propos des avances rapides' dans 'git push --help' pour plus "
+"d'information."
#, c-format
msgid "Pushing to %s\n"
@@ -9698,6 +10002,13 @@ msgstr "Poussée vers %s\n"
msgid "failed to push some refs to '%s'"
msgstr "impossible de pousser des références vers '%s'"
+msgid ""
+"recursing into submodule with push.recurseSubmodules=only; using on-demand "
+"instead"
+msgstr ""
+"la récursion dans le sous-module avec push.recurseSubmodules=only ; "
+"utilisation de on-demande à la place"
+
#, c-format
msgid "invalid value for '%s'"
msgstr "valeur invalide pour '%s'"
@@ -9705,8 +10016,8 @@ msgstr "valeur invalide pour '%s'"
msgid "repository"
msgstr "dépôt"
-msgid "push all refs"
-msgstr "pousser toutes les références"
+msgid "push all branches"
+msgstr "pousser toutes les branches"
msgid "mirror all refs"
msgstr "refléter toutes les références"
@@ -9714,9 +10025,10 @@ msgstr "refléter toutes les références"
msgid "delete refs"
msgstr "supprimer les références"
-msgid "push tags (can't be used with --all or --mirror)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
msgstr ""
-"pousser les étiquettes (ne peut pas être utilisé avec --all ou --mirror)"
+"pousser les étiquettes (ne peut pas être utilisé avec --all, --branches ou --"
+"mirror)"
msgid "force updates"
msgstr "forcer les mises à jour"
@@ -9743,7 +10055,7 @@ msgid "set upstream for git pull/status"
msgstr "définir la branche amont pour git pull/status"
msgid "prune locally removed refs"
-msgstr "éliminer les références locales supprimées"
+msgstr "élaguer les références locales supprimées"
msgid "bypass pre-push hook"
msgstr "éviter d'utiliser le crochet pre-push"
@@ -9823,24 +10135,30 @@ msgid "only emit output related to the second range"
msgstr "afficher seulement les sorties liées à la deuxième plage"
#, c-format
+msgid "not a revision: '%s'"
+msgstr "'%s' n'est pas une révision"
+
+#, c-format
msgid "not a commit range: '%s'"
msgstr "pas une plage de commit : '%s'"
-msgid "single arg format must be symmetric range"
-msgstr "un format d'argument unique doit être une plage symétrique"
+#, c-format
+msgid "not a symmetric range: '%s'"
+msgstr "pas une plage symétrique : '%s'"
msgid "need two commit ranges"
msgstr "plage entre deux commits requise"
msgid ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>) "
-"[-u | -i]] [--no-sparse-checkout] [--index-output=<file>] (--empty | <tree-"
-"ish1> [<tree-ish2> [<tree-ish3>]])"
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<prefix>)\n"
+" [-u | -i]] [--index-output=<file>] [--no-sparse-checkout]\n"
+" (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"
msgstr ""
"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
-"prefix=<préfixe>) [-u | -i]] [--no-sparse-checkout] [--index-"
-"output=<fichier>] (--empty | <arbre-esque1> [<arbre-esque2> [<arbre-"
-"esque3>]])"
+"prefix=<préfixe>)\n"
+" [-u | -i]] [--index-output=<fichier>] [--no-sparse-checkout]\n"
+" (--empty | <arbre-esque1> [<arbre-esque2> [<arbre-esque3>]])"
msgid "write resulting index to <file>"
msgstr "écrire l'index résultant dans <fichier>"
@@ -9931,8 +10249,8 @@ msgid "%s requires the merge backend"
msgstr "%s requiert un moteur de fusion"
#, c-format
-msgid "could not get 'onto': '%s'"
-msgstr "impossible d'accéder 'onto' : '%s'"
+msgid "invalid onto: '%s'"
+msgstr "destination invalide : '%s'"
#, c-format
msgid "invalid orig-head: '%s'"
@@ -9978,9 +10296,17 @@ msgstr ""
"Résultat, git ne peut pas les rebaser."
#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "Mode de rebase-merges inconnu : %s"
+
+#, c-format
msgid "could not switch to %s"
msgstr "impossible de basculer vers %s"
+msgid "apply options and merge options cannot be used together"
+msgstr ""
+"Les options d'apply et celles de merge ne peuvent pas être utilisées ensemble"
+
#, c-format
msgid ""
"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and "
@@ -9989,6 +10315,15 @@ msgstr ""
"type vide non connu '%s' ; les valeurs valides sont \"drop\" (abandonner), "
"\"keep\" (garder) et \"ask\" (demander)."
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"--rebase-merges avec un argument chaîne vide est obsolète et cessera de "
+"fonctionner dans une version future de Git. Utilisez à la place --rebase-"
+"merges sans argument, qui a le même effet."
+
#, c-format
msgid ""
"%s\n"
@@ -10103,6 +10438,11 @@ msgstr "conserver les commits qui commencent vides"
msgid "move commits that begin with squash!/fixup! under -i"
msgstr "déplace les commits qui commencent par squash!/fixup! sous -i"
+msgid "update branches that point to commits that are being rebased"
+msgstr ""
+"mettre à jour les branches qui pointent sur les commits qui sont en cours de "
+"rebasage"
+
msgid "add exec lines after each commit of the editable list"
msgstr "ajouter les lignes exec après chaque commit de la liste éditable"
@@ -10204,16 +10544,19 @@ msgstr ""
msgid "switch `C' expects a numerical value"
msgstr "l'option `C' attend un valeur numérique"
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "Mode inconnu : %s"
-
-msgid "--strategy requires --merge or --interactive"
-msgstr "--strategy requiert --merge ou --interactive"
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges. Consider adding --"
+"no-rebase-merges"
+msgstr ""
+"les options d'application sont incompatibles avec rebase.rebaseMerges. "
+"Considérez l'ajout de --no-rebase-merges"
-msgid "apply options and merge options cannot be used together"
+msgid ""
+"apply options are incompatible with rebase.updateRefs. Consider adding --no-"
+"update-refs"
msgstr ""
-"Les options d'apply et celles de merge ne peuvent pas être utilisées ensemble"
+"les options d'application sont incompatibles avec rebase.updateRefs. "
+"Considérez l'ajout de --no-update-refs"
#, c-format
msgid "Unknown rebase backend: %s"
@@ -10237,8 +10580,8 @@ msgstr "pas de branche ou commit '%s'"
msgid "No such ref: %s"
msgstr "Référence inexistante : %s"
-msgid "Could not resolve HEAD to a revision"
-msgstr "Impossible de résoudre le commit HEAD vers un révision"
+msgid "Could not resolve HEAD to a commit"
+msgstr "impossible de résoudre HEAD en un commit"
#, c-format
msgid "'%s': need exactly one merge base with branch"
@@ -10252,9 +10595,6 @@ msgstr "'%s': exactement une base de fusion nécessaire"
msgid "Does not point to a valid commit '%s'"
msgstr "Ne pointe pas sur une validation valide : '%s'"
-msgid "Please commit or stash them."
-msgstr "Veuillez les valider ou les remiser."
-
msgid "HEAD is up to date."
msgstr "HEAD est à jour."
@@ -10514,12 +10854,13 @@ msgstr "argument miroir inconnu : %s"
msgid "fetch the remote branches"
msgstr "rapatrier les branches distantes"
-msgid "import all tags and associated objects when fetching"
+msgid ""
+"import all tags and associated objects when fetching\n"
+"or do not fetch any tag at all (--no-tags)"
msgstr ""
-"importer toutes les étiquettes et les objets associés lors du rapatriement"
-
-msgid "or do not fetch any tag at all (--no-tags)"
-msgstr "ou ne rapatrier aucune étiquette (--no-tags)"
+"importer toutes les étiquettes et les objets associés lors de la "
+"récupération\n"
+"ou ne récupérer aucune étiquette (--no-tags)"
msgid "branch(es) to track"
msgstr "branche(s) à suivre"
@@ -10639,6 +10980,9 @@ msgstr " nouveau (le prochain rapatriement (fetch) stockera dans remotes/%s)"
msgid " tracked"
msgstr " suivi"
+msgid " skipped"
+msgstr " sauté"
+
msgid " stale (use 'git remote prune' to remove)"
msgstr " dépassé (utilisez 'git remote prune' pour supprimer)"
@@ -10810,14 +11154,14 @@ msgstr "URL : %s"
#, c-format
msgid " * [would prune] %s"
-msgstr " * [serait éliminé] %s"
+msgstr " * [élaguerait] %s"
#, c-format
msgid " * [pruned] %s"
-msgstr " * [éliminé] %s"
+msgstr " * [élagué] %s"
msgid "prune remotes after fetching"
-msgstr "éliminer les distants après le rapatriement"
+msgstr "élagué les distants après la récupération"
#, c-format
msgid "No such remote '%s'"
@@ -10911,6 +11255,14 @@ msgstr "impossible d'ouvrir le fichier temporaire %s en écriture"
msgid "could not close refs snapshot tempfile"
msgstr "impossible de fermer le fichier temporaire d'instantané des réfs"
+#, c-format
+msgid "could not remove stale bitmap: %s"
+msgstr "impossible de revenir la bitmap obsolète : %s"
+
+#, c-format
+msgid "pack prefix %s does not begin with objdir %s"
+msgstr "le préfixe %s ne commence pas avec objdir %s"
+
msgid "pack everything in a single pack"
msgstr "empaqueter tout dans un seul paquet"
@@ -10924,8 +11276,8 @@ msgstr ""
msgid "approxidate"
msgstr "date approximative"
-msgid "with -C, expire objects older than this"
-msgstr "avec -C, faire expirer les objets plus vieux que celui-ci"
+msgid "with --cruft, expire objects older than this"
+msgstr "avec --cruft, faire expirer les objets plus vieux que celui-ci"
msgid "remove redundant packs, and run git-prune-packed"
msgstr "supprimer les paquets redondants et lancer git-prune-packed"
@@ -10985,19 +11337,29 @@ msgstr "trouver une progression géométrique avec un facteur <N>"
msgid "write a multi-pack index of the resulting packs"
msgstr "écrire un index de multi-paquet des paquets résultants"
+msgid "pack prefix to store a pack containing pruned objects"
+msgstr "préfixe de paquet pour stocker un paquet contenant les objets élagués"
+
+msgid "pack prefix to store a pack containing filtered out objects"
+msgstr "préfixe de paquet pour stocker un paquet contenant les objets filtrés"
+
msgid "cannot delete packs in a precious-objects repo"
msgstr "impossible de supprimer les paquets dans un dépôt d'objets précieux"
+#, c-format
+msgid "option '%s' can only be used along with '%s'"
+msgstr "l'option '%s' ne peut être utilisé qu'avec '%s'"
+
msgid "Nothing new to pack."
msgstr "Rien de neuf à empaqueter."
#, c-format
-msgid "pack prefix %s does not begin with objdir %s"
-msgstr "le préfixe %s ne commence pas avec objdir %s"
+msgid "renaming pack to '%s' failed"
+msgstr "le renommage du paquet en '%s' a échoué"
#, c-format
-msgid "missing required file: %s"
-msgstr "fichier nécessaire manquant : %s"
+msgid "pack-objects did not write a '%s' file for pack %s-%s"
+msgstr "pack-objects n'a pas écrit un fichier '%s' pour la paquet %s-%s"
#, c-format
msgid "could not unlink: %s"
@@ -11191,9 +11553,81 @@ msgstr "--convert-graft-file ne supporte aucun argument"
msgid "only one pattern can be given with -l"
msgstr "-l n'accepte qu'un motifs"
-msgid "git rerere [clear | forget <path>... | status | remaining | diff | gc]"
+msgid "need some commits to replay"
+msgstr "commits requis pour pouvoir rejouer"
+
+msgid "--onto and --advance are incompatible"
+msgstr "--onto et --advance sont incompatibles"
+
+msgid "all positive revisions given must be references"
+msgstr "toutes les révisions positives fournies doivent être des références"
+
+msgid "argument to --advance must be a reference"
+msgstr "l'argument de --advance doit être une référence"
+
+msgid ""
+"cannot advance target with multiple sources because ordering would be ill-"
+"defined"
+msgstr ""
+"impossible d'avancer la cible avec des sources multiples parce l'ordre ne "
+"serait pas total"
+
+msgid ""
+"cannot implicitly determine whether this is an --advance or --onto operation"
+msgstr ""
+"impossible de déterminer implicitement s'il y a une opération --advance ou --"
+"onto"
+
+msgid ""
+"cannot advance target with multiple source branches because ordering would "
+"be ill-defined"
msgstr ""
-"git rerere [clear | forget <chemin>... | status | remaining | diff | gc]"
+"impossible d'avancer la cible sur des branches sources multiples parce que "
+"l'ordre ne serait pas total"
+
+msgid "cannot implicitly determine correct base for --onto"
+msgstr "impossible de déterminer implicitement une base correcte pour --onto"
+
+msgid ""
+"(EXPERIMENTAL!) git replay ([--contained] --onto <newbase> | --advance "
+"<branch>) <revision-range>..."
+msgstr ""
+"(EXPERIMENTAL!) git replay ([--contained] --onto <nouvelle-base> | --advance "
+"<branche>) <plage-de-révision>..."
+
+msgid "make replay advance given branch"
+msgstr "faire rejouer en avançant la branche indiquée"
+
+msgid "replay onto given commit"
+msgstr "rejouer par-dessus le commit indiqué"
+
+msgid "advance all branches contained in revision-range"
+msgstr "avancer toutes les branches contenues dans la plage-de-révisions"
+
+msgid "option --onto or --advance is mandatory"
+msgstr "une option --onto ou --advance est obligatoire"
+
+#, c-format
+msgid ""
+"some rev walking options will be overridden as '%s' bit in 'struct rev_info' "
+"will be forced"
+msgstr ""
+"certaines options de parcours de révs seront surchargées car le bit '%s' "
+"dans 'struct rev_info' sera forcé"
+
+msgid "error preparing revisions"
+msgstr "erreur lors de la préparation des révisions"
+
+msgid "replaying down to root commit is not supported yet!"
+msgstr "rejouer jusqu'au commit racine n'est pas encore géré !"
+
+msgid "replaying merge commits is not supported yet!"
+msgstr "rejouer des commits de fusion n'est pas encore géré !"
+
+msgid ""
+"git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]"
+msgstr ""
+"git rerere [clear | forget <chemin>... | diff | status | remaining | gc]"
msgid "register clean resolutions in index"
msgstr "enregistrer des résolutions propres dans l'index"
@@ -11322,6 +11756,10 @@ msgstr "Impossible d'écrire le nouveau fichier d'index."
msgid "unable to get disk usage of %s"
msgstr "impossible de récupérer l'utilisation du disque de %s"
+#, c-format
+msgid "invalid value for '%s': '%s', the only allowed format is '%s'"
+msgstr "valeur invalide pour '%s' : '%s', le seul format permis est '%s'"
+
msgid "rev-list does not support display of notes"
msgstr "rev-list ne supporte l'affichage des notes"
@@ -11347,6 +11785,9 @@ msgstr "fin prématurée de l'entrée"
msgid "no usage string given before the `--' separator"
msgstr "pas de chaîne d'usage fournie avant le séparateur `--'"
+msgid "missing opt-spec before option flags"
+msgstr "opt-spec manquant avant les drapeaux d'option"
+
msgid "Needed a single revision"
msgstr "Une seule révision attendue"
@@ -11397,21 +11838,32 @@ msgstr "mode inconnu pour --abbrev-ref : %s"
msgid "this operation must be run in a work tree"
msgstr "cette opération doit être effectuée dans un arbre de travail"
+msgid "Could not read the index"
+msgstr "Impossible de lire l'index"
+
#, c-format
msgid "unknown mode for --show-object-format: %s"
msgstr "mode inconnu pour --show-object-format : %s"
-msgid "git revert [<options>] <commit-ish>..."
-msgstr "git revert [<options>] <commit ou apparenté>..."
+msgid ""
+"git revert [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] "
+"<commit>..."
+msgstr ""
+"git revert [--[no-]edit] [-n] [-m <numéro-de-parent>] [-s] [-S[<id-clé>]] "
+"<commit>..."
-msgid "git revert <subcommand>"
-msgstr "git revert <sous-commande>"
+msgid "git revert (--continue | --skip | --abort | --quit)"
+msgstr "git revert (--continue | --skip | --abort | --quit)"
-msgid "git cherry-pick [<options>] <commit-ish>..."
-msgstr "git cherry-pick [<options>] <commit ou apparenté>..."
+msgid ""
+"git cherry-pick [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff]\n"
+" [-S[<keyid>]] <commit>..."
+msgstr ""
+"git cherry-pick [--edit] [-n] [-m <numéro-de-parent>] [-s] [-x] [--ff]\n"
+" [-S[<clé-id>]] <commit>..."
-msgid "git cherry-pick <subcommand>"
-msgstr "git cherry-pick <sous-commande>"
+msgid "git cherry-pick (--continue | --skip | --abort | --quit)"
+msgstr "git cherry-pick (--continue | --skip | --abort | --quit)"
#, c-format
msgid "option `%s' expects a number greater than zero"
@@ -11472,8 +11924,14 @@ msgstr "revert a échoué"
msgid "cherry-pick failed"
msgstr "le picorage a échoué"
-msgid "git rm [<options>] [--] <file>..."
-msgstr "git rm [<options>] [--] <fichier>..."
+msgid ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<fichier> [--pathspec-file-nul]]\n"
+" [--] [<spéc-de-chemin>...]"
msgid ""
"the following file has staged content different from both the\n"
@@ -11548,16 +12006,21 @@ msgid ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
" [<host>:]<directory> (--all | <ref>...)"
msgstr ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true | false | if-asked)]\n"
" [<hôte>:]<répertoire> (--all | <réf>...)"
msgid "remote name"
msgstr "nom distant"
+msgid "push all refs"
+msgstr "pousser toutes les références"
+
msgid "use stateless RPC protocol"
msgstr "utiliser un protocole RPC sans état"
@@ -11577,8 +12040,9 @@ msgid "using multiple --group options with stdin is not supported"
msgstr ""
"l'utilisation de plusieurs options --group avec stdin n'est pas supportée"
-msgid "using --group=trailer with stdin is not supported"
-msgstr "l'utilisation de --group=trailer avec stdin n'est pas supportée"
+#, c-format
+msgid "using %s with stdin is not supported"
+msgstr "l'utilisation de %s avec stdin n'est pas supportée"
#, c-format
msgid "unknown group type: %s"
@@ -11617,12 +12081,14 @@ msgid ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
" [--current] [--color[=<when>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<rev> | <glob>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<rev> | <glob>)...]"
msgstr ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
" [--current] [--color[=<quand>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<rév> | <glob>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<rév> | <glob>)...]"
msgid "git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]"
msgstr "git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<référence>]"
@@ -11724,21 +12190,44 @@ msgid "Unknown hash algorithm"
msgstr "Algorithme d'empreinte inconnu"
msgid ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...]"
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<pattern>...]"
msgstr ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<motif>...]"
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<motif>...]"
+
+msgid ""
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<ref>...]"
+msgstr ""
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<ref>...]"
msgid "git show-ref --exclude-existing[=<pattern>]"
msgstr "git show-ref --exclude-existing[=<motif>]"
+msgid "git show-ref --exists <ref>"
+msgstr "git show-ref --exists <réf>"
+
+msgid "reference does not exist"
+msgstr "la référence n'existe pas"
+
+msgid "failed to look up reference"
+msgstr "échec de la recherche de la référence"
+
msgid "only show tags (can be combined with heads)"
msgstr "afficher seulement les étiquettes (peut être combiné avec heads)"
msgid "only show heads (can be combined with tags)"
msgstr "afficher seulement les têtes (peut être combiné avec tags)"
+msgid "check for reference existence without resolving"
+msgstr "vérifier l'existence de la référence sans la résoudre"
+
msgid "stricter reference checking, requires exact ref path"
msgstr ""
"vérification de référence plus stricte, nécessite un chemin de référence "
@@ -11762,8 +12251,12 @@ msgstr ""
"afficher les références de l'entrée standard qui ne sont pas dans le dépôt "
"local"
-msgid "git sparse-checkout (init|list|set|add|reapply|disable) <options>"
-msgstr "git sparse-checkout (init|list|set|add|reapply|disable) <options>"
+msgid ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
+msgstr ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
msgid "this worktree is not sparse"
msgstr "cet arbre de travail n'est pas clairsemé"
@@ -11893,67 +12386,75 @@ msgstr ""
msgid "error while refreshing working directory"
msgstr "erreur lors du rafraîchissement du répertoire de travail"
-msgid "git stash list [<options>]"
-msgstr "git stash list [<options>]"
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <fichier>]"
-msgid "git stash show [<options>] [<stash>]"
-msgstr "git stash show [<options>] [<remise>]"
+msgid "terminate input and output files by a NUL character"
+msgstr "terminer les fichiers en entrée et en sortie par un caractère NUL"
-msgid "git stash drop [-q|--quiet] [<stash>]"
-msgstr "git stash drop [-q|--quiet] [<remise>]"
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
+"quand utilisé avec --rules-file, interpréter les motifs comme des motifs en "
+"mode cone"
-msgid "git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash ( pop | apply ) [--index] [-q|--quiet] [<remise>]"
+msgid "use patterns in <file> instead of the current ones."
+msgstr "utiliser les motifs dans <fichier> plutôt que les actuels."
-msgid "git stash branch <branchname> [<stash>]"
-msgstr "git stash branch <nom-de-branche> [<remise>]"
+msgid "git stash list [<log-options>]"
+msgstr "git stash list [<options-de-log>]"
msgid ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
-" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
-" [--] [<pathspec>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<diff-"
+"options>] [<stash>]"
msgstr ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
-" [--pathspec-from-file=<fichier> [--pathspec-file-nul]]\n"
-" [--] [<spécificateur-de-chemin>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<options-de-"
+"diff>] [<stash>]"
-msgid ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
-msgstr ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
+msgid "git stash drop [-q | --quiet] [<stash>]"
+msgstr "git stash drop [-q | --quiet] [<remise>]"
+
+msgid "git stash pop [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash pop [--index] [-q | --quiet] [<remise>]"
-msgid "git stash pop [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash pop [--index] [-q|--quiet] [<remise>]"
+msgid "git stash apply [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash apply [--index] [-q | --quiet] [<remise>]"
-msgid "git stash apply [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash apply [--index] [-q|--quiet] [<remise>]"
+msgid "git stash branch <branchname> [<stash>]"
+msgstr "git stash branch <nom-de-branche> [<remise>]"
-msgid "git stash store [-m|--message <message>] [-q|--quiet] <commit>"
-msgstr "git stash store [-m|--message <message>] [-q|--quiet] <remise>"
+msgid "git stash store [(-m | --message) <message>] [-q | --quiet] <commit>"
+msgstr "git stash store [(-m | --message) <message>] [-q | --quiet] <remise>"
msgid ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<message>]\n"
+" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
" [--] [<pathspec>...]]"
msgstr ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<message>]\n"
+" [--pathspec-from-file=<fichier> [--pathspec-file-nul]]\n"
" [--] [<spécificateur-de-chemin>...]]"
msgid ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<message>]"
msgstr ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<message>]"
+
+msgid "git stash create [<message>]"
+msgstr "git stash create [<message>]"
#, c-format
msgid "'%s' is not a stash-like commit"
@@ -12109,7 +12610,7 @@ msgid "stash staged changes only"
msgstr "remiser seulement les modifications indexées"
msgid "stash in patch mode"
-msgstr "remiser une mode rustine"
+msgstr "remiser en mode rustine"
msgid "quiet mode"
msgstr "mode silencieux"
@@ -12133,6 +12634,10 @@ msgid "Expecting a full ref name, got %s"
msgstr "Nom de référence complet attendu, %s obtenu"
#, c-format
+msgid "could not get a repository handle for submodule '%s'"
+msgstr "impossible de trouver une poignée de dépôt pour le sous-module '%s'"
+
+#, c-format
msgid ""
"could not look up configuration '%s'. Assuming this repository is its own "
"authoritative upstream."
@@ -12140,12 +12645,6 @@ msgstr ""
"impossible de trouver la configuration '%s'. Ce dépôt est considéré comme "
"son propre amont d'autorité."
-msgid "alternative anchor for relative paths"
-msgstr "ancre alternative pour les chemins relatifs"
-
-msgid "git submodule--helper list [--prefix=<path>] [<path>...]"
-msgstr "git submodule--helper list [--prefix=<chemin>] [<chemin>...]"
-
#, c-format
msgid "No url found for submodule path '%s' in .gitmodules"
msgstr "URL non trouvée pour le chemin de sous-module '%s' dans .gitmodules"
@@ -12179,8 +12678,8 @@ msgstr ""
msgid "recurse into nested submodules"
msgstr "parcourir récursivement les sous-modules"
-msgid "git submodule--helper foreach [--quiet] [--recursive] [--] <command>"
-msgstr "git submodule--helper foreach [--quiet] [--recursive] [--] <commande>"
+msgid "git submodule foreach [--quiet] [--recursive] [--] <command>"
+msgstr "git submodule foreach [--quiet] [--recursive] [--] <commande>"
#, c-format
msgid "Failed to register url for submodule path '%s'"
@@ -12205,8 +12704,8 @@ msgstr ""
msgid "suppress output for initializing a submodule"
msgstr "supprimer la sortie lors de l'initialisation d'un sous-module"
-msgid "git submodule--helper init [<options>] [<path>]"
-msgstr "git submodule--helper init [<options>] [<chemin>]"
+msgid "git submodule init [<options>] [<path>]"
+msgstr "git submodule init [<options>] [<chemin>]"
#, c-format
msgid "no submodule mapping found in .gitmodules for path '%s'"
@@ -12235,9 +12734,6 @@ msgstr ""
msgid "git submodule status [--quiet] [--cached] [--recursive] [<path>...]"
msgstr "git submodule status [--quiet] [--cached] [--recursive] [<chemin>...]"
-msgid "git submodule--helper name <path>"
-msgstr "git submodule--helper <nom> <chemin>"
-
#, c-format
msgid "* %s %s(blob)->%s(submodule)"
msgstr "* %s %s(blob)->%s(submodule)"
@@ -12271,8 +12767,8 @@ msgstr "sauter les sous-modules avec la valeur 'ignore_config' à 'all'"
msgid "limit the summary size"
msgstr "limiter la taille du résumé"
-msgid "git submodule--helper summary [<options>] [<commit>] [--] [<path>]"
-msgstr "git submodule--helper summary [<options>] [<commit>] [--] [<chemin>]"
+msgid "git submodule summary [<options>] [<commit>] [--] [<path>]"
+msgstr "git submodule summary [<options>] [<commit>] [--] [<chemin>]"
msgid "could not fetch a revision for HEAD"
msgstr "impossible de récupérer une révision pour HEAD"
@@ -12286,10 +12782,6 @@ msgid "failed to register url for submodule path '%s'"
msgstr "échec d'enregistrement de l'URL pour le chemin de sous-module '%s'"
#, c-format
-msgid "failed to get the default remote for submodule '%s'"
-msgstr "échec d'obtention du dépôt distant par défaut pour le sous-module '%s'"
-
-#, c-format
msgid "failed to update remote for submodule '%s'"
msgstr "échec de mise à jour du dépôt distant pour le sous-module '%s'"
@@ -12297,8 +12789,8 @@ msgid "suppress output of synchronizing submodule url"
msgstr ""
"supprimer la sortie lors de la synchronisation de l'URL d'un sous-module"
-msgid "git submodule--helper sync [--quiet] [--recursive] [<path>]"
-msgstr "git submodule--helper sync [--quiet] [--recursive] [<chemin>]"
+msgid "git submodule sync [--quiet] [--recursive] [<path>]"
+msgstr "git submodule sync [--quiet] [--recursive] [<chemin>]"
#, c-format
msgid ""
@@ -12361,6 +12853,10 @@ msgstr ""
"clonez avec '--reference-if-able' au lieu de '--reference'."
#, c-format
+msgid "could not get a repository handle for gitdir '%s'"
+msgstr "impossible de trouver une poignée de dépôt pour le répertoire git '%s'"
+
+#, c-format
msgid "submodule '%s' cannot add alternate: %s"
msgstr "le sous-module '%s' ne peut pas ajouter d'alternative : %s"
@@ -12390,6 +12886,9 @@ msgstr "le répertoire n'est pas vide : '%s'"
msgid "could not get submodule directory for '%s'"
msgstr "impossible de créer le répertoire de sous-module pour '%s'"
+msgid "alternative anchor for relative paths"
+msgstr "ancre alternative pour les chemins relatifs"
+
msgid "where the new submodule will be cloned to"
msgstr "emplacement où le sous-module sera cloné"
@@ -12418,10 +12917,6 @@ msgstr ""
"<spécificateur-de-filtre>]--url <url> --path <chemin>"
#, c-format
-msgid "Invalid update mode '%s' for submodule path '%s'"
-msgstr "Mode de mise à jour '%s' invalide pour le chemin de sous-module '%s'"
-
-#, c-format
msgid "Invalid update mode '%s' configured for submodule path '%s'"
msgstr ""
"Mode de mise à jour '%s'invalide configuré pour le chemin de sous-module '%s'"
@@ -12442,6 +12937,10 @@ msgid "Skipping submodule '%s'"
msgstr "Sous-module '%s' non traité"
#, c-format
+msgid "cannot clone submodule '%s' without a URL"
+msgstr "impossible de cloner le sous-module '%s' sans une URL"
+
+#, c-format
msgid "Failed to clone '%s'. Retry scheduled"
msgstr "Impossible de cloner '%s'. Réessai prévu"
@@ -12496,6 +12995,10 @@ msgstr ""
"récupération directe de ce commit a échoué."
#, c-format
+msgid "could not initialize submodule at path '%s'"
+msgstr "impossible d'initialiser le sous-module dans le chemin '%s'"
+
+#, c-format
msgid ""
"Submodule (%s) branch configured to inherit branch from superproject, but "
"the superproject is not on any branch"
@@ -12504,10 +13007,6 @@ msgstr ""
"superprojet, mais le superprojet n'est sur aucune branche"
#, c-format
-msgid "could not get a repository handle for submodule '%s'"
-msgstr "impossible de trouver une poignée de dépôt pour le sous-module '%s'"
-
-#, c-format
msgid "Unable to find current revision in submodule path '%s'"
msgstr ""
"Impossible de trouver la révision actuelle dans le chemin de sous-module '%s'"
@@ -12540,15 +13039,14 @@ msgstr "traverser les sous-modules récursivement"
msgid "don't fetch new objects from the remote site"
msgstr "ne pas récupérer les nouveaux objets depuis le site distant"
-msgid "path into the working tree"
-msgstr "chemin dans la copie de travail"
+msgid "use the 'checkout' update strategy (default)"
+msgstr "utiliser la stratégie de mise à jour 'checkout' (valeur par défaut)"
-msgid "path into the working tree, across nested submodule boundaries"
-msgstr ""
-"chemin dans la copie de travail, traversant les frontières de sous-modules"
+msgid "use the 'merge' update strategy"
+msgstr "utiliser la stratégie de mise à jour par fusion"
-msgid "rebase, merge, checkout or none"
-msgstr "valeurs possibles : rebase, merge, checkout ou none"
+msgid "use the 'rebase' update strategy"
+msgstr "utiliser la stratégie de mise à jour par rebasage"
msgid "create a shallow clone truncated to the specified number of revisions"
msgstr "créer un clone superficiel tronqué au nombre de révisions spécifié"
@@ -12562,6 +13060,9 @@ msgstr "spécifie si le clonage initial doit être aussi superficiel"
msgid "don't print cloning progress"
msgstr "ne pas afficher la progression du clonage"
+msgid "disallow cloning into non-empty directory, implies --init"
+msgstr "interdire de cloner dans un répertoire non-vide, implique --init"
+
msgid ""
"git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] "
"[-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-"
@@ -12573,36 +13074,17 @@ msgstr ""
"[no-]recommend-shallow] [--reference <dépôt>] [--recursive] [--[no-]single-"
"branch] [--] [<chemin>...]"
-msgid "bad value for update parameter"
-msgstr "valeur invalide pour la mise à jour du paramètre"
-
-msgid "recurse into submodules"
-msgstr "parcourir récursivement les sous-modules"
-
-msgid "git submodule--helper absorb-git-dirs [<options>] [<path>...]"
-msgstr "git submodule--helper absorb-git-dirs [<options>] [<chemin>...]"
-
-msgid "check if it is safe to write to the .gitmodules file"
-msgstr "vérifier si écrire dans le fichier .gitmodules est sur"
-
-msgid "unset the config in the .gitmodules file"
-msgstr "désactiver la configuration dans le fichier .gitmodules"
-
-msgid "git submodule--helper config <name> [<value>]"
-msgstr "git submodule--helper config name [<valeur>]"
+msgid "Failed to resolve HEAD as a valid ref."
+msgstr "Échec de résolution de HEAD comme référence valide."
-msgid "git submodule--helper config --unset <name>"
-msgstr "git submodule--helper config --unset <nom>"
-
-msgid "please make sure that the .gitmodules file is in the working tree"
-msgstr ""
-"veuillez vous assurer que le fichier .gitmodules est dans l'arbre de travail"
+msgid "git submodule absorbgitdirs [<options>] [<path>...]"
+msgstr "git submodule absorbgitdirs [<options>] [<chemin>...]"
msgid "suppress output for setting url of a submodule"
msgstr "supprimer la sortie lors du paramétrage de l'url d'un sous-module"
-msgid "git submodule--helper set-url [--quiet] <path> <newurl>"
-msgstr "git submodule--helper sync [--quiet] <chemin> <nouvelle-url>"
+msgid "git submodule set-url [--quiet] <path> <newurl>"
+msgstr "git submodule set-url [--quiet] <chemin> <nouvelle-url>"
msgid "set the default tracking branch to master"
msgstr "régler la branche de suivi par défaut à master"
@@ -12610,14 +13092,11 @@ msgstr "régler la branche de suivi par défaut à master"
msgid "set the default tracking branch"
msgstr "régler la branche de suivi par défaut"
-msgid "git submodule--helper set-branch [-q|--quiet] (-d|--default) <path>"
-msgstr "git submodule--helper set-branch [-q|--quiet] (-d|--default) <chemin>"
+msgid "git submodule set-branch [-q|--quiet] (-d|--default) <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-d|--default) <chemin>"
-msgid ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
-msgstr ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <branche> "
-"<chemin>"
+msgid "git submodule set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-b|--branch) <branche> <chemin>"
msgid "--branch or --default required"
msgstr "--branch ou --default requis"
@@ -12680,6 +13159,10 @@ msgstr "Réactivation du répertoire git local pour le sous-module '%s'\n"
msgid "unable to checkout submodule '%s'"
msgstr "Impossible d'extraire le sous-module '%s'"
+msgid "please make sure that the .gitmodules file is in the working tree"
+msgstr ""
+"veuillez vous assurer que le fichier .gitmodules est dans l'arbre de travail"
+
#, c-format
msgid "Failed to add submodule '%s'"
msgstr "Échec d'ajout du sous-module '%s'"
@@ -12716,8 +13199,8 @@ msgstr ""
"configurer le nom du sous-module avec la chaîne passée au lieu d'utiliser "
"par défaut son chemin"
-msgid "git submodule--helper add [<options>] [--] <repository> [<path>]"
-msgstr "git submodule--helper add [<options>] [--] <dépôt> [<chemin>]"
+msgid "git submodule add [<options>] [--] <repository> [<path>]"
+msgstr "git submodule add [<options>] [--] <dépôt> [<chemin>]"
msgid "Relative path can only be used from the toplevel of the working tree"
msgstr ""
@@ -12732,19 +13215,17 @@ msgstr "l'URL de dépôt : '%s' doit être absolu ou commencer par ./|../"
msgid "'%s' is not a valid submodule name"
msgstr "'%s' n'est pas un nom valide de sous-module"
-#, c-format
-msgid "%s doesn't support --super-prefix"
-msgstr "%s ne gère pas --super-prefix"
+msgid "git submodule--helper <command>"
+msgstr "git submodule--helper <commande>"
-#, c-format
-msgid "'%s' is not a valid submodule--helper subcommand"
-msgstr "'%s' n'est pas une sous-commande valide de submodule--helper"
+msgid "git symbolic-ref [-m <reason>] <name> <ref>"
+msgstr "git symbolic-ref [-m <raison>] <nom> <réf>"
-msgid "git symbolic-ref [<options>] <name> [<ref>]"
-msgstr "git symbolic-ref [<options>] <nom> [<référence>]"
+msgid "git symbolic-ref [-q] [--short] [--no-recurse] <name>"
+msgstr "git symbolic-ref [-q] [--short] [--no-recurse] <nom>"
-msgid "git symbolic-ref -d [-q] <name>"
-msgstr "git symbolic-ref -d [-q] <nom>"
+msgid "git symbolic-ref --delete [-q] <name>"
+msgstr "git symbolic-ref --delete [-q] <nom>"
msgid "suppress error message for non-symbolic (detached) refs"
msgstr ""
@@ -12756,6 +13237,9 @@ msgstr "supprimer la référence symbolique"
msgid "shorten ref output"
msgstr "raccourcir l'affichage de la référence"
+msgid "recursively dereference (default)"
+msgstr "déréférencer récursivement (défaut)"
+
msgid "reason"
msgstr "raison"
@@ -12763,25 +13247,25 @@ msgid "reason of the update"
msgstr "raison de la mise à jour"
msgid ""
-"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]\n"
-" <tagname> [<head>]"
+"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
+" <tagname> [<commit> | <object>]"
msgstr ""
-"git tag [-a | -s | -u <id-clé>] [-f] [-m <msg> | -F <fichier>]\n"
-" <nom-d-étiquette> [<tête>]"
+"git tag [-a | -s | -u <id-clé>] [-f] [-m <msg> | -F <fichier>] [-e]\n"
+" <nom-d-étiquette> [<commit> | <objet>]"
msgid "git tag -d <tagname>..."
msgstr "git tag -d <nom-d-étiquette>..."
msgid ""
-"git tag -l [-n[<num>]] [--contains <commit>] [--no-contains <commit>] [--"
-"points-at <object>]\n"
-" [--format=<format>] [--merged <commit>] [--no-merged <commit>] "
-"[<pattern>...]"
+"git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]\n"
+" [--points-at <object>] [--column[=<options>] | --no-column]\n"
+" [--create-reflog] [--sort=<key>] [--format=<format>]\n"
+" [--merged <commit>] [--no-merged <commit>] [<pattern>...]"
msgstr ""
-"git tag -l [-n[<num>]] [--contains <commit>] [--no-contains <commit>] [--"
-"points-at <objet>]\n"
-" [--format=<format>] [--merged <commit>] [--no-merged <commit>] "
-"[<motif>...]"
+"git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]\n"
+" [--points-at <objet>] [--column[=<options>] | --no-column]\n"
+" [--create-reflog] [--sort=<clé>] [--format=<format>]\n"
+" [--merged <commit>] [--no-merged <commit>] [<motif>...]"
msgid "git tag -v [--format=<format>] <tagname>..."
msgstr "git tag -v [--format=<format>] <nom-d-étiquette>..."
@@ -12927,6 +13411,16 @@ msgstr "Étiquette '%s' mise à jour (elle était sur %s)\n"
msgid "pack exceeds maximum allowed size"
msgstr "le paquet dépasse la taille maximale permise"
+msgid "failed to write object in stream"
+msgstr "impossible d'écrire l'objet dans le flux"
+
+#, c-format
+msgid "inflate returned (%d)"
+msgstr "la décompression (inflate) a retourné (%d)"
+
+msgid "invalid blob object from stream"
+msgstr "objet blob invalide depuis le flux"
+
msgid "Unpacking objects"
msgstr "Dépaquetage des objets"
@@ -13061,6 +13555,9 @@ msgstr "(pour porcelaines) oublier les conflits sauvés et non résolus"
msgid "write index in this format"
msgstr "écrire l'index dans ce format"
+msgid "report on-disk index format version"
+msgstr "afficher la version du format d'index sur disque"
+
msgid "enable or disable split index"
msgstr "activer ou désactiver l'index scindé"
@@ -13086,6 +13583,14 @@ msgstr "marquer les fichiers comme valides pour fsmonitor"
msgid "clear fsmonitor valid bit"
msgstr "effacer le bit de validité fsmonitor"
+#, c-format
+msgid "%d\n"
+msgstr "%d\n"
+
+#, c-format
+msgid "index-version: was %d, set to %d"
+msgstr "index-version : précédemment %d, mis à %d"
+
msgid ""
"core.splitIndex is set to false; remove or change it, if you really want to "
"enable split index"
@@ -13164,8 +13669,12 @@ msgstr "lire les mises à jour depuis l'entrée standard"
msgid "update the info files from scratch"
msgstr "mettre à jour les fichiers d'information à partir de zéro"
-msgid "git upload-pack [<options>] <dir>"
-msgstr "git upload-pack [<options>] <répertoire>"
+msgid ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <directory>"
+msgstr ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <répertoire>"
msgid "quit after a single request/response exchange"
msgstr "quitter après un unique échange requête/réponse"
@@ -13180,8 +13689,8 @@ msgstr ""
msgid "interrupt transfer after <n> seconds of inactivity"
msgstr "interrompre le transfert après <n> secondes d'inactivité"
-msgid "git verify-commit [-v | --verbose] <commit>..."
-msgstr "git verify-commit [-v | --verbose] <commit>..."
+msgid "git verify-commit [-v | --verbose] [--raw] <commit>..."
+msgstr "git verify-commit [-v | --verbose] [--raw] <commit>..."
msgid "print commit contents"
msgstr "afficher le contenu du commit"
@@ -13189,8 +13698,9 @@ msgstr "afficher le contenu du commit"
msgid "print raw gpg status output"
msgstr "afficher les messages bruts de gpg"
-msgid "git verify-pack [-v | --verbose] [-s | --stat-only] <pack>..."
-msgstr "git verify-pack [-v | --verbose] [-s | --stat-only] <pack>..."
+msgid "git verify-pack [-v | --verbose] [-s | --stat-only] [--] <pack>.idx..."
+msgstr ""
+"git verify-pack [-v | --verbose] [-s | --stat-only] [--] <paquet>.idx..."
msgid "verbose"
msgstr "verbeux"
@@ -13198,42 +13708,79 @@ msgstr "verbeux"
msgid "show statistics only"
msgstr "afficher seulement les statistiques"
-msgid "git verify-tag [-v | --verbose] [--format=<format>] <tag>..."
-msgstr "git verify-tag [-v | --verbose] [--format=<format>] <étiquette>..."
+msgid "git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."
+msgstr ""
+"git verify-tag [-v | --verbose] [--format=<format>] [--raw] <étiquette>..."
msgid "print tag contents"
msgstr "afficher le contenu de l'étiquette"
-msgid "git worktree add [<options>] <path> [<commit-ish>]"
-msgstr "git worktree add [<options>] <chemin> [<commit>]"
+msgid ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <string>]]\n"
+" [--orphan] [(-b | -B) <new-branch>] <path> [<commit-ish>]"
+msgstr ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <chaîne>]]\n"
+" [--orphan] [(-b | -B) <nouvelle-branche>] <chemin> [<commit-"
+"esque>]"
-msgid "git worktree list [<options>]"
-msgstr "git worktree list [<options>]"
+msgid "git worktree list [-v | --porcelain [-z]]"
+msgstr "git worktree list [-v | --porcelain [-z]]"
-msgid "git worktree lock [<options>] <path>"
-msgstr "git worktree lock [<options>] <chemin>"
+msgid "git worktree lock [--reason <string>] <worktree>"
+msgstr "git worktree lock [--reason <chaîne>] <arbre-de-travail>"
msgid "git worktree move <worktree> <new-path>"
msgstr "git worktree move <arbre-de-travail> <nouveau-chemin>"
-msgid "git worktree prune [<options>]"
-msgstr "git worktree prune [<options>]"
+msgid "git worktree prune [-n] [-v] [--expire <expire>]"
+msgstr "git worktree prune [-n] [-v] [--expire <date>]"
-msgid "git worktree remove [<options>] <worktree>"
-msgstr "git worktree remove [<options>] <arbre-de-travail>"
+msgid "git worktree remove [-f] <worktree>"
+msgstr "git worktree remove [-f] <arbre-de-travail>"
msgid "git worktree repair [<path>...]"
msgstr "git worktree repair [<chemin>...]"
-msgid "git worktree unlock <path>"
-msgstr "git worktree unlock <chemin>"
+msgid "git worktree unlock <worktree>"
+msgstr "git worktree unlock <arbre-de-travail>"
+
+msgid "No possible source branch, inferring '--orphan'"
+msgstr "Aucune branche source possible, activation de '--orphan'"
+
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+msgstr ""
+"Si vous vouliez créer un arbre-de-travail contenant une nouvelle branche\n"
+"non-née (une branche sans commit) pour ce dépôt, vous pouvez le faire\n"
+"en utilisant le drapeau --orphan :\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan %s\n"
+msgstr ""
+"Si vous vouliez créer un arbre-de-travail contenant une nouvelle branche\n"
+"non-née (une branche sans commit) pour ce dépôt, vous pouvez le faire\n"
+"en utilisant le drapeau --orphan :\n"
+"\n"
+" git worktree add --orphan %s\n"
#, c-format
msgid "Removing %s/%s: %s"
msgstr "Suppression de %s/%s : %s"
msgid "report pruned working trees"
-msgstr "afficher les arbres de travail éliminés"
+msgstr "afficher les arbres de travail élagués"
msgid "expire working trees older than <time>"
msgstr "faire expirer les arbres de travail plus vieux que <temps>"
@@ -13286,6 +13833,10 @@ msgid "initializing"
msgstr "initialisation"
#, c-format
+msgid "could not find created worktree '%s'"
+msgstr "impossible de trouver l'arbre-de-travail créé '%s'"
+
+#, c-format
msgid "Preparing worktree (new branch '%s')"
msgstr "Préparation de l'arbre de travail (nouvelle branche '%s')"
@@ -13300,9 +13851,32 @@ msgid "Preparing worktree (checking out '%s')"
msgstr "Préparation de l'arbre de travail (extraction de '%s')"
#, c-format
+msgid "unreachable: invalid reference: %s"
+msgstr "non joignable : référence invalide : %s"
+
+#, c-format
msgid "Preparing worktree (detached HEAD %s)"
msgstr "Préparation de l'arbre de travail (HEAD détachée %s)"
+#, c-format
+msgid ""
+"HEAD points to an invalid (or orphaned) reference.\n"
+"HEAD path: '%s'\n"
+"HEAD contents: '%s'"
+msgstr ""
+"HEAD pointe sur une référence invalide (ou orpheline).\n"
+"chemin de HEAD '%s'\n"
+"contenu de HEAD : '%s'"
+
+msgid ""
+"No local or remote refs exist despite at least one remote\n"
+"present, stopping; use 'add -f' to override or fetch a remote first"
+msgstr ""
+"Aucune réf locale ou distant n'existe malgré la présence d'au moins un "
+"distant,\n"
+"on arrête ; utilisez 'add -f' pour passe outre ou récupérer le distant en "
+"premier"
+
msgid "checkout <branch> even if already checked out in other worktree"
msgstr ""
"extraire la <branche> même si elle est déjà extraite dans une autre copie de "
@@ -13314,6 +13888,9 @@ msgstr "créer une nouvelle branche"
msgid "create or reset a branch"
msgstr "créer ou réinitialiser une branche"
+msgid "create unborn branch"
+msgstr "créer une branche non née"
+
msgid "populate the new working tree"
msgstr "remplissage de la nouvelle copie de travail"
@@ -13333,6 +13910,11 @@ msgstr "essayer de nommer la nouvelle branche comme la branche amont"
msgid "options '%s', '%s', and '%s' cannot be used together"
msgstr "les options '%s', '%s' et '%s' ne peuvent pas être utilisées ensemble"
+#, c-format
+msgid "option '%s' and commit-ish cannot be used together"
+msgstr ""
+"l'option '%s' et des commit-esques ne peuvent pas être utilisés ensemble"
+
msgid "added with --lock"
msgstr "ajouté avec --lock"
@@ -13470,6 +14052,62 @@ msgstr "écrire l'objet arbre pour un sous-répertoire <préfixe>"
msgid "only useful for debugging"
msgstr "seulement utile pour le débogage"
+msgid "core.fsyncMethod = batch is unsupported on this platform"
+msgstr "core.fsyncMethod = batch non géré sur cette plateforme"
+
+#, c-format
+msgid "could not parse bundle list key %s with value '%s'"
+msgstr "impossible d'analyser la clé de liste de colis %s avec la valeur '%s'"
+
+#, c-format
+msgid "bundle list at '%s' has no mode"
+msgstr "la liste de colis n'a pas de mode à '%s'"
+
+msgid "failed to create temporary file"
+msgstr "impossible de créer un fichier temporaire"
+
+msgid "insufficient capabilities"
+msgstr "capacités insuffisantes"
+
+#, c-format
+msgid "file downloaded from '%s' is not a bundle"
+msgstr "le fichier téléchargé depuis '%s' n'est pas un colis"
+
+msgid "failed to store maximum creation token"
+msgstr "échec de stockage du jeton de création maximum"
+
+#, c-format
+msgid "unrecognized bundle mode from URI '%s'"
+msgstr "mode de colisage non reconnu depuis l'URI '%s'"
+
+#, c-format
+msgid "exceeded bundle URI recursion limit (%d)"
+msgstr "limite de récursion d'URI de colis dépassée (%d)"
+
+#, c-format
+msgid "failed to download bundle from URI '%s'"
+msgstr "impossible de télécharger le colis depuis l'URI '%s'"
+
+#, c-format
+msgid "file at URI '%s' is not a bundle or bundle list"
+msgstr "le fichier à l'URI '%s' n'est pas un colis ou une liste de colis"
+
+#, c-format
+msgid "bundle-uri: unexpected argument: '%s'"
+msgstr "bundle-uri :argument inattendu : '%s'"
+
+msgid "bundle-uri: expected flush after arguments"
+msgstr "bundle-uri : vidage attendu après les arguments"
+
+msgid "bundle-uri: got an empty line"
+msgstr "bundle-uri : ligne vide rencontrée"
+
+msgid "bundle-uri: line is not of the form 'key=value'"
+msgstr "bundle-uri : la ligne n'est pas de la forme 'clé=valeur'"
+
+msgid "bundle-uri: line has empty key or value"
+msgstr "bundle-uri : la ligne a une clé ou une valeur vide"
+
#, c-format
msgid "unrecognized bundle hash algorithm: %s"
msgstr "algorithme d'empreinte du colis inconnu : %s"
@@ -13492,6 +14130,13 @@ msgstr "Le dépôt ne dispose pas des commits prérequis suivants :"
msgid "need a repository to verify a bundle"
msgstr "la vérification d'un colis requiert un dépôt"
+msgid ""
+"some prerequisite commits exist in the object store, but are not connected "
+"to the repository's history"
+msgstr ""
+"des commits prérequis existent dans le stock d'objets, mais ne sont pas "
+"connectés à l'historique du dépôt"
+
#, c-format
msgid "The bundle contains this ref:"
msgid_plural "The bundle contains these %<PRIuMAX> refs:"
@@ -13507,6 +14152,14 @@ msgid_plural "The bundle requires these %<PRIuMAX> refs:"
msgstr[0] "Le colis exige cette référence :"
msgstr[1] "Le colis exige ces %<PRIuMAX> références :"
+#, c-format
+msgid "The bundle uses this hash algorithm: %s"
+msgstr "algorithme d'empreinte du colis : %s"
+
+#, c-format
+msgid "The bundle uses this filter: %s"
+msgstr "Le colis utilise ce filtre : %s"
+
msgid "unable to dup bundle descriptor"
msgstr "impossible de dupliquer le descripteur de liasse"
@@ -13542,16 +14195,20 @@ msgid "terminating chunk id appears earlier than expected"
msgstr "l'identifiant de terminaison de tronçon apparaît plus tôt qu'attendu"
#, c-format
+msgid "chunk id %<PRIx32> not %d-byte aligned"
+msgstr "id de tronçon %<PRIx32> non alignés sur %d octets"
+
+#, c-format
msgid "improper chunk offset(s) %<PRIx64> and %<PRIx64>"
-msgstr "décalage(s) de section incorrect(s) %<PRIx64> et %<PRIx64>"
+msgstr "décalage(s) de tronçon incorrect(s) %<PRIx64> et %<PRIx64>"
#, c-format
msgid "duplicate chunk ID %<PRIx32> found"
-msgstr "ID de section dupliqué %<PRIx32>"
+msgstr "ID de tronçon dupliqué %<PRIx32>"
#, c-format
msgid "final chunk has non-zero id %<PRIx32>"
-msgstr "la section finale a un id non nul %<PRIx32>"
+msgstr "le tronçon final a un id non nul %<PRIx32>"
msgid "invalid hash version"
msgstr "version d'empreinte invalide"
@@ -13596,10 +14253,8 @@ msgstr ""
msgid "Move objects and refs by archive"
msgstr "Déplacer les objets et références par archive"
-msgid "Provide content or type and size information for repository objects"
-msgstr ""
-"Fournir le contenu ou l'information de type et taille pour les objets du "
-"dépôt"
+msgid "Provide contents or details of repository objects"
+msgstr "Fournir le contenu ou les détails des objets du dépôt"
msgid "Display gitattributes information"
msgstr "Afficher les informations gitattributes"
@@ -13679,6 +14334,9 @@ msgid "Give an object a human readable name based on an available ref"
msgstr ""
"Baptiser un objet avec un nom lisible à partir d'une référence disponible"
+msgid "Generate a zip archive of diagnostic information"
+msgstr "Générer une archive zip d'information de diagnostic"
+
msgid "Show changes between commits, commit and working tree, etc"
msgstr ""
"Afficher les changements entre les validations, entre validation et copie de "
@@ -13739,9 +14397,9 @@ msgstr "Afficher les lignes correspondant à un motif"
msgid "A portable graphical interface to Git"
msgstr "Une interface graphique portable pour Git"
-msgid "Compute object ID and optionally creates a blob from a file"
+msgid "Compute object ID and optionally create an object from a file"
msgstr ""
-"Calculer l'ID d'objet et créer optionnellement un blob depuis un fichier"
+"Calculer l'ID d'objet et créer optionnellement un objet depuis un fichier"
msgid "Display help information about Git"
msgstr "Afficher l'information d'aide à propos de Git"
@@ -13815,8 +14473,8 @@ msgstr "Lancer une fusion à 3 points pour les fichiers à fusionner"
msgid "The standard helper program to use with git-merge-index"
msgstr "Le programme assistant standard à utiliser avec git-merge-index"
-msgid "Show three-way merge without touching index"
-msgstr "Afficher la fusion à trois points sans modifier l'index"
+msgid "Perform merge without touching index or working tree"
+msgstr "effectuer la fusion sans toucher à l'index ni à l'arbre de travail"
msgid "Run merge conflict resolution tools to resolve merge conflicts"
msgstr ""
@@ -13857,8 +14515,7 @@ msgid "Compute unique ID for a patch"
msgstr "Calculer l'ID unique d'un patch"
msgid "Prune all unreachable objects from the object database"
-msgstr ""
-"Éliminer les objets inatteignables depuis la base de données des objets"
+msgstr "Élaguer les objets inatteignables depuis la base de données des objets"
msgid "Remove extra objects that are already in pack files"
msgstr "Éliminer les objets qui sont déjà présents dans les fichiers pack"
@@ -13897,6 +14554,11 @@ msgstr "Empaqueter les objets non-empaquetés d'un dépôt"
msgid "Create, list, delete refs to replace objects"
msgstr "Créer, lister, supprimer des référence pour remplacer des objets"
+msgid "EXPERIMENTAL: Replay commits on a new base, works with bare repos too"
+msgstr ""
+"EXPÉRIMENTAL ; rejoue des commits sur une nouvelle base, fonctionne aussi "
+"avec les dépôts nus"
+
msgid "Generates a summary of pending changes"
msgstr "Générer une résumé des modifications en attentes"
@@ -14018,7 +14680,10 @@ msgstr "Valider des fichiers d'archive Git empaquetés"
msgid "Check the GPG signature of tags"
msgstr "Vérifier la signature GPG d'étiquettes"
-msgid "Show logs with difference each commit introduces"
+msgid "Display version information about Git"
+msgstr "Afficher l'information de version à propos de Git"
+
+msgid "Show logs with differences each commit introduces"
msgstr "Afficher les journaux avec la différence que chaque commit introduit"
msgid "Manage multiple working trees"
@@ -14051,6 +14716,24 @@ msgstr "Un ensemble minimal utile des commandes de Git pour tous les jours"
msgid "Frequently asked questions about using Git"
msgstr "Foire aux questions sur l'utilisation de Git"
+msgid "The bundle file format"
+msgstr "le format du fichier de colis"
+
+msgid "Chunk-based file formats"
+msgstr "format de fichier avec des tronçons"
+
+msgid "Git commit-graph format"
+msgstr "format de graphe de commit de Git"
+
+msgid "Git index format"
+msgstr "format d'index Git"
+
+msgid "Git pack format"
+msgstr "format de paquet Git"
+
+msgid "Git cryptographic signature formats"
+msgstr "formats de signature cryptographique Git"
+
msgid "A Git Glossary"
msgstr "Un glossaire Git"
@@ -14073,6 +14756,21 @@ msgstr "Définition des propriétés de sous-module"
msgid "Git namespaces"
msgstr "Espaces de nom de Git"
+msgid "Protocol v0 and v1 capabilities"
+msgstr "Capacités des protocoles v0 et v1"
+
+msgid "Things common to various protocols"
+msgstr "Choses communes aux différents protocoles"
+
+msgid "Git HTTP-based protocols"
+msgstr "protocoles Git basés sur HTTP"
+
+msgid "How packs are transferred over-the-wire"
+msgstr "Comment les paquets sont transférés sur le réseau"
+
+msgid "Git Wire Protocol, Version 2"
+msgstr "Protocole réseau Git, version 2"
+
msgid "Helper programs to interact with remote repositories"
msgstr "Programmes assistants pour interagir avec des dépôts distants"
@@ -14097,9 +14795,41 @@ msgstr "Interface web de Git"
msgid "An overview of recommended workflows with Git"
msgstr "Un aperçu des flux de travail recommandés avec Git"
+msgid "A tool for managing large Git repositories"
+msgstr "Un outil pour gérer les grands dépôts Git"
+
msgid "commit-graph file is too small"
msgstr "le graphe de commit est trop petit"
+msgid "commit-graph oid fanout chunk is wrong size"
+msgstr ""
+"le tronçon de distribution d'oid du graphe de commit n'a pas la bonne taille"
+
+msgid "commit-graph fanout values out of order"
+msgstr "les valeurs de distribution du graphe de commit sont désordonnées"
+
+msgid "commit-graph OID lookup chunk is the wrong size"
+msgstr ""
+"le tronçon de recherche de l'OID du graphe de commits n'a pas la bonne taille"
+
+msgid "commit-graph commit data chunk is wrong size"
+msgstr "le tronçon de données du graphe de commit n'a pas la bonne taille"
+
+msgid "commit-graph generations chunk is wrong size"
+msgstr "le tronçon des générations du graphe de commit n'a pas la bonne taille"
+
+msgid "commit-graph changed-path index chunk is too small"
+msgstr ""
+"le tronçon d'index des chemins modifiés du graphe de commit est trop petit"
+
+#, c-format
+msgid ""
+"ignoring too-small changed-path chunk (%<PRIuMAX> < %<PRIuMAX>) in commit-"
+"graph file"
+msgstr ""
+"tronçon de chemin modifié dans le fichier de graphe de commits trop petit "
+"((%<PRIuMAX> < %<PRIuMAX>)) ignoré"
+
#, c-format
msgid "commit-graph signature %X does not match signature %X"
msgstr ""
@@ -14117,15 +14847,40 @@ msgstr ""
#, c-format
msgid "commit-graph file is too small to hold %u chunks"
-msgstr "le graphe de commit est trop petit pour contenir %u sections"
+msgstr "le graphe de commit est trop petit pour contenir %u tronçons"
+
+msgid "commit-graph required OID fanout chunk missing or corrupted"
+msgstr ""
+"le tronçon de distribution des OID requis du graphe de commits est manquant "
+"ou corrompu"
+
+msgid "commit-graph required OID lookup chunk missing or corrupted"
+msgstr ""
+"le tronçon de recherche OID requis par le graphe de commits est manquant ou "
+"corrompu"
+
+msgid "commit-graph required commit data chunk missing or corrupted"
+msgstr ""
+"le tronçon d'étalement OID requis par le graphe de commits est manquant ou "
+"corrompu"
msgid "commit-graph has no base graphs chunk"
-msgstr "le graphe de commit n'a pas de section de graphes de base"
+msgstr "le graphe de commit n'a pas de tronçon de graphes de base"
+
+msgid "commit-graph base graphs chunk is too small"
+msgstr "le tronçon de graphes de base du graphe de commit est trop petit"
msgid "commit-graph chain does not match"
msgstr "la chaîne de graphe de commit ne correspond pas"
#, c-format
+msgid "commit count in base graph too high: %<PRIuMAX>"
+msgstr "nombre de commits dans le graphe de base trop haut : %<PRIuMAX>"
+
+msgid "commit-graph chain file too small"
+msgstr "la chaine du graphe de commit est trop petite"
+
+#, c-format
msgid "invalid commit-graph chain: line '%s' not a hash"
msgstr ""
"chaîne de graphe de commit invalide : la ligne '%s' n'est pas une empreinte"
@@ -14147,6 +14902,14 @@ msgstr ""
"le graphe de commits requiert des données de génération de débordement mais "
"n'en contient pas"
+msgid "commit-graph overflow generation data is too small"
+msgstr ""
+"les données de génération de débordement du graphe de commits sont trop "
+"petites"
+
+msgid "commit-graph extra-edges pointer out of bounds"
+msgstr "pointeur hors-gamme d'arêtes supplémentaires du graphe de commits"
+
msgid "Loading known commits in commit graph"
msgstr "Lecture des commits connus dans un graphe de commit"
@@ -14216,6 +14979,15 @@ msgstr "échec du renommage du fichier de graphe de commits"
msgid "failed to rename temporary commit-graph file"
msgstr "impossible de renommer le fichier temporaire de graphe de commits"
+#, c-format
+msgid "cannot merge graphs with %<PRIuMAX>, %<PRIuMAX> commits"
+msgstr ""
+"impossible de fusionner des graphes avec %<PRIuMAX>, %<PRIuMAX> commits"
+
+#, c-format
+msgid "cannot merge graph %s, too many commits: %<PRIuMAX>"
+msgstr "impossible de fusionner le graphe %s, trop de commits : %<PRIuMAX>"
+
msgid "Scanning merged commits"
msgstr "Analyse des commits de fusion"
@@ -14248,9 +15020,6 @@ msgstr ""
msgid "failed to parse commit %s from commit-graph"
msgstr "échec de l'analyse le commit %s depuis le graphe de commits"
-msgid "Verifying commits in commit graph"
-msgstr "Verification des commits dans le graphe de commits"
-
#, c-format
msgid "failed to parse commit %s from object database for commit-graph"
msgstr ""
@@ -14278,20 +15047,6 @@ msgstr ""
"la liste de parents du graphe de commit pour le commit %s se termine trop tôt"
#, 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"
-
-#, c-format
-msgid ""
-"commit-graph has non-zero generation number for commit %s, but zero elsewhere"
-msgstr ""
-"le graphe de commit a un numéro de génération non-nul pour le commit %s, "
-"mais nul ailleurs"
-
-#, c-format
msgid "commit-graph generation for commit %s is %<PRIuMAX> < %<PRIuMAX>"
msgstr ""
"la génération du graphe de commit pour le commit %s est %<PRIuMAX> < "
@@ -14304,6 +15059,17 @@ msgstr ""
"%<PRIuMAX> != %<PRIuMAX>"
#, c-format
+msgid ""
+"commit-graph has both zero and non-zero generations (e.g., commits '%s' and "
+"'%s')"
+msgstr ""
+"le graphe de commit a des numéros de génération à la fois nuls et non-nuls "
+"(par ex. les commits %s et %s)"
+
+msgid "Verifying commits in commit graph"
+msgstr "Verification des commits dans le graphe de commits"
+
+#, c-format
msgid "%s %s is not a commit!"
msgstr "%s %s n'est pas un commit !"
@@ -14327,6 +15093,12 @@ msgstr ""
"\"git config advice.graftFileDeprecated false\""
#, c-format
+msgid "commit %s exists in commit-graph but not in the object database"
+msgstr ""
+"le commit '%s' existe dans la graphe de commit mais pas dans la base de "
+"données d'objets"
+
+#, c-format
msgid "Commit %s has an untrusted GPG signature, allegedly by %s."
msgstr "La validation %s a une signature GPG non fiable, prétendument par %s."
@@ -14359,6 +15131,14 @@ msgid "no libc information available\n"
msgstr "aucune information de libc disponible\n"
#, c-format
+msgid "could not determine free disk size for '%s'"
+msgstr "impossible de déterminer l'espace libre du disque pour '%s'"
+
+#, c-format
+msgid "could not get info for '%s'"
+msgstr "impossible d'avoir des informations pour '%s'"
+
+#, c-format
msgid "[GLE %ld] health thread could not open '%ls'"
msgstr "[GLE %ld] le fil de santé n'a pas pu ouvrir '%ls'"
@@ -14382,6 +15162,10 @@ msgstr "cas non géré dans 'has_worktree_moved': %d"
msgid "health thread wait failed [GLE %ld]"
msgstr "l'attente du fil de santé a échoué [GLE %ld]"
+#, c-format
+msgid "Invalid path: %s"
+msgstr "chemin invalide : '%s'"
+
msgid "Unable to create FSEventStream."
msgstr "impossible de créer FSEVEntStream."
@@ -14413,6 +15197,30 @@ msgid "could not read directory changes [GLE %ld]"
msgstr "impossible de lire les modifications du répertoire [GLE %ld]"
#, c-format
+msgid "opendir('%s') failed"
+msgstr "échec de opendir(%s)"
+
+#, c-format
+msgid "lstat('%s') failed"
+msgstr "échec de lstat('%s')"
+
+#, c-format
+msgid "strbuf_readlink('%s') failed"
+msgstr "échec de strbuf_readlink('%s')"
+
+#, c-format
+msgid "closedir('%s') failed"
+msgstr "échec de closedir('%s')"
+
+#, c-format
+msgid "[GLE %ld] unable to open for read '%ls'"
+msgstr "[GLE %ld] impossible d'ouvrir pour lire '%ls'"
+
+#, c-format
+msgid "[GLE %ld] unable to get protocol information for '%ls'"
+msgstr "[GLE %ld] impossible d'obtenir l'information de protocole pour '%ls'"
+
+#, c-format
msgid "failed to copy SID (%ld)"
msgstr "échec de la copie du SID (%ld)"
@@ -14700,8 +15508,8 @@ msgstr "longueur d'abbrev hors plage : %d"
msgid "bad zlib compression level %d"
msgstr "niveau de compression zlib incorrect %d"
-msgid "core.commentChar should only be one character"
-msgstr "core.commentChar ne devrait être qu'un unique caractère"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar ne devrait être qu'un unique caractère ASCII"
#, c-format
msgid "ignoring unknown core.fsyncMethod value '%s'"
@@ -14737,10 +15545,6 @@ msgstr "la référence '%s' ne pointe pas sur un blob"
msgid "unable to resolve config blob '%s'"
msgstr "impossible de résoudre le blob de config '%s'"
-#, c-format
-msgid "failed to parse %s"
-msgstr "échec de l'analyse de %s"
-
msgid "unable to parse command-line config"
msgstr "lecture de la configuration de ligne de commande impossible"
@@ -14816,6 +15620,12 @@ msgid "invalid section name: %s"
msgstr "nom de section invalide : %s"
#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr ""
+"refus de travailler avec des lignes trop longues dans '%s' à la ligne "
+"%<PRIuMAX>"
+
+#, c-format
msgid "missing value for '%s'"
msgstr "valeur manquante pour '%s'"
@@ -14870,15 +15680,22 @@ msgid "unknown object format '%s' specified by server"
msgstr "format d'objet spécifié par le serveur inconnu '%s'"
#, c-format
+msgid "error on bundle-uri response line %d: %s"
+msgstr "erreur sur la ligne %d de réponse bundle-uri : %s"
+
+msgid "expected flush after bundle-uri listing"
+msgstr "vidage attendu après le listage des bundle-uri"
+
+msgid "expected response end packet after ref listing"
+msgstr "paquet de fin de réponse attendu après le listage de références"
+
+#, c-format
msgid "invalid ls-refs response: %s"
msgstr "réponse à ls-ref invalide : %s"
msgid "expected flush after ref listing"
msgstr "vidage attendu après le listage de références"
-msgid "expected response end packet after ref listing"
-msgstr "paquet de fin de réponse attendu après le listage de références"
-
#, c-format
msgid "protocol '%s' is not supported"
msgstr "le protocole '%s' n'est pas supporté"
@@ -14970,182 +15787,6 @@ msgid "failed to close rev-list's stdin"
msgstr "impossible de fermer l'entrée standard du rev-list"
#, c-format
-msgid "'%s' does not exist"
-msgstr "'%s' n'existe pas"
-
-msgid "need a working directory"
-msgstr "répertoire de travail nécessaire"
-
-msgid "could not find enlistment root"
-msgstr "impossible de trouver la racine d'enrôlement"
-
-#, c-format
-msgid "could not switch to '%s'"
-msgstr "impossible de basculer vers '%s'"
-
-#, c-format
-msgid "could not configure %s=%s"
-msgstr "impossible de configurer %s=%s"
-
-msgid "could not configure log.excludeDecoration"
-msgstr "impossible de configurer log.excludeDecoration"
-
-msgid "Scalar enlistments require a worktree"
-msgstr "Les enrôlements scalaires requièrent un arbre de travail"
-
-#, c-format
-msgid "could not open directory '%s'"
-msgstr "impossible d'ouvrir le répertoire '%s'"
-
-#, c-format
-msgid "skipping '%s', which is neither file nor directory"
-msgstr "'%s' sauté, qui n'est ni un fichier ni un répertoire"
-
-#, c-format
-msgid "could not determine free disk size for '%s'"
-msgstr "impossible de déterminer l'espace libre du disque pour '%s'"
-
-#, c-format
-msgid "could not get info for '%s'"
-msgstr "impossible d'avoir des informations pour '%s'"
-
-#, c-format
-msgid "remote HEAD is not a branch: '%.*s'"
-msgstr "la HEAD distante n'est pas une branche : '%.*s'"
-
-msgid "failed to get default branch name from remote; using local default"
-msgstr ""
-"échec de récupération de la branche par défaut depuis le distant ; "
-"utilisation de la valeur par défaut locale"
-
-msgid "failed to get default branch name"
-msgstr "échec de l'obtention du nom de branche par défaut"
-
-msgid "failed to unregister repository"
-msgstr "échec du désenregistrement du dépôt"
-
-msgid "failed to delete enlistment directory"
-msgstr "échec de la suppression du répertoire d'enrôlement"
-
-msgid "branch to checkout after clone"
-msgstr "branche à extraire après le clonage"
-
-msgid "when cloning, create full working directory"
-msgstr "lors d'un clonage, créer un répertoire de travail complet"
-
-msgid "only download metadata for the branch that will be checked out"
-msgstr "ne télécharger les méta-données que pour la branche qui sera extraite"
-
-msgid "scalar clone [<options>] [--] <repo> [<dir>]"
-msgstr "scalar clone [<options>] [--] <dépôt> [<répertoire>]"
-
-#, c-format
-msgid "cannot deduce worktree name from '%s'"
-msgstr "impossible de déduire le nom de l'arbre de travail depuis '%s'"
-
-#, c-format
-msgid "directory '%s' exists already"
-msgstr "le répertoire '%s' existe déjà"
-
-#, c-format
-msgid "failed to get default branch for '%s'"
-msgstr "échec d'obtention de la branche par défaut pour '%s'"
-
-#, c-format
-msgid "could not configure remote in '%s'"
-msgstr "impossible de paramétrer le distant dans '%s'"
-
-#, c-format
-msgid "could not configure '%s'"
-msgstr "impossible de configurer '%s'"
-
-msgid "partial clone failed; attempting full clone"
-msgstr "échec du clonage partiel ; tentative de clonage complet"
-
-msgid "could not configure for full clone"
-msgstr "impossible de configurer pour le clonage complet"
-
-msgid "scalar diagnose [<enlistment>]"
-msgstr "scalar diagnose [<enrôlement>]"
-
-#, c-format
-msgid "could not create directory for '%s'"
-msgstr "impossible de créer le répertoire pour '%s'"
-
-msgid "could not duplicate stdout"
-msgstr "impossible de dupliquer stdout"
-
-msgid "failed to write archive"
-msgstr "impossible d'écrire l'archive"
-
-msgid "`scalar list` does not take arguments"
-msgstr "`scalar list` n'accepte pas d'argument"
-
-msgid "scalar register [<enlistment>]"
-msgstr "scalar register [<enrôlement>]"
-
-msgid "reconfigure all registered enlistments"
-msgstr "reconfigurer tous les enrôlements enregistrés"
-
-msgid "scalar reconfigure [--all | <enlistment>]"
-msgstr "scala reconfigure [--all|<enrôlement>]"
-
-msgid "--all or <enlistment>, but not both"
-msgstr "--all ou <enrôlement>, mais pas les deux"
-
-#, c-format
-msgid "git repository gone in '%s'"
-msgstr "dépôt git parti dans '%s'"
-
-msgid ""
-"scalar run <task> [<enlistment>]\n"
-"Tasks:\n"
-msgstr ""
-"scalar run <tâche> [<enrôlement>]\n"
-"Tâches :\n"
-
-#, c-format
-msgid "no such task: '%s'"
-msgstr "pas de tâche : '%s'"
-
-msgid "scalar unregister [<enlistment>]"
-msgstr "scalar unregister [<enrôlement>]"
-
-msgid "scalar delete <enlistment>"
-msgstr "scalar delete <enrôlement>"
-
-msgid "refusing to delete current working directory"
-msgstr "refus de la suppression du répertoire de travail actuel"
-
-msgid "include Git version"
-msgstr "inclure la version Git"
-
-msgid "include Git's build options"
-msgstr "inclure les options de construction de Git"
-
-msgid "scalar verbose [-v | --verbose] [--build-options]"
-msgstr "scalar verbose [-v | --verbose] [--build-options]"
-
-msgid "-C requires a <directory>"
-msgstr "-C requiert un <répertoire>"
-
-#, c-format
-msgid "could not change to '%s'"
-msgstr "échec de modification en '%s'"
-
-msgid "-c requires a <key>=<value> argument"
-msgstr "-c exige un argument <clé>=<valeur>"
-
-msgid ""
-"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
-"\n"
-"Commands:\n"
-msgstr ""
-"scalar [-C <répertoire>] [-c <clé>=<valeur>] <commande> [<options>]\n"
-"\n"
-"Commandes :\n"
-
-#, c-format
msgid "illegal crlf_action %d"
msgstr "crlf_action illégal %d"
@@ -15357,12 +15998,35 @@ msgstr ""
msgid "Marked %d islands, done.\n"
msgstr "Marquage de %d îlots, fait.\n"
+#, c-format
+msgid "invalid --%s value '%s'"
+msgstr "valeur invalide de --%s : %s"
+
+#, c-format
+msgid "could not archive missing directory '%s'"
+msgstr "impossible d'archiver le répertoire manquant '%s'"
+
+#, c-format
+msgid "could not open directory '%s'"
+msgstr "impossible d'ouvrir le répertoire '%s'"
+
+#, c-format
+msgid "skipping '%s', which is neither file nor directory"
+msgstr "'%s' sauté, qui n'est ni un fichier ni un répertoire"
+
+msgid "could not duplicate stdout"
+msgstr "impossible de dupliquer stdout"
+
+#, c-format
+msgid "could not add directory '%s' to archiver"
+msgstr "impossible d'ajouter le répertoire '%s' à l'archiveur"
+
+msgid "failed to write archive"
+msgstr "impossible d'écrire l'archive"
+
msgid "--merge-base does not work with ranges"
msgstr "--merge-base ne fonctionne pas avec des plages"
-msgid "--merge-base only works with commits"
-msgstr "--merge-base ne fonctionne qu'avec des commits"
-
msgid "unable to get HEAD"
msgstr "impossible d'acquérir HEAD"
@@ -15372,6 +16036,12 @@ msgstr "aucune base de fusion trouvée"
msgid "multiple merge bases found"
msgstr "bases multiples de fusion trouvées"
+msgid "cannot compare stdin to a directory"
+msgstr "impossible de comparer stdin à un répertoire"
+
+msgid "cannot compare a named pipe to a directory"
+msgstr "impossible de réparer un tuyau nommé à un répertoire"
+
msgid "git diff --no-index [<options>] <path> <path>"
msgstr "git diff --no-index [<options>] <chemin> <chemin>"
@@ -15420,6 +16090,10 @@ msgstr ""
"Valeur inconnue pour la variable de configuration 'diff.submodule' : '%s'"
#, c-format
+msgid "unknown value for config '%s': %s"
+msgstr "valeur inconnue pour la config '%s' : %s"
+
+#, c-format
msgid ""
"Found errors in 'diff.dirstat' config variable:\n"
"%s"
@@ -15431,6 +16105,14 @@ msgstr ""
msgid "external diff died, stopping at %s"
msgstr "l'application de diff externe a disparu, arrêt à %s"
+msgid "--follow requires exactly one pathspec"
+msgstr "--follow a besoin d'une spécification de chemin unique"
+
+#, c-format
+msgid "pathspec magic not supported by --follow: %s"
+msgstr ""
+"le spécificateur magique de chemin n'est pas pris en charge par --follow : %s"
+
#, c-format
msgid "options '%s', '%s', '%s', and '%s' cannot be used together"
msgstr ""
@@ -15449,9 +16131,6 @@ msgstr ""
"les options '%s' et '%s' ne peuvent pas être utilisées ensemble, utilisez "
"'%s' avec '%s' et '%s'"
-msgid "--follow requires exactly one pathspec"
-msgstr "--follow a besoin d'une spécification de chemin unique"
-
#, c-format
msgid "invalid --stat value: %s"
msgstr "valeur invalide de --stat : %s"
@@ -15496,13 +16175,6 @@ msgstr "mauvais argument --color-moved : %s"
msgid "invalid mode '%s' in --color-moved-ws"
msgstr "mode invalide '%s' dans --color-moved-ws"
-msgid ""
-"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
-"\"histogram\""
-msgstr ""
-"l'option diff-algorithm accept \"myers\", \"minimal\", \"patience\" et "
-"\"histogram\""
-
#, c-format
msgid "invalid argument to %s"
msgstr "argument invalide pour %s"
@@ -15546,8 +16218,8 @@ msgstr "--stat pour traitement automatique"
msgid "output only the last line of --stat"
msgstr "afficher seulement la dernière ligne de --stat"
-msgid "<param1,param2>..."
-msgstr "<param1,param2>..."
+msgid "<param1>,<param2>..."
+msgstr "<param1>,<param2>..."
msgid ""
"output the distribution of relative amount of changes for each sub-directory"
@@ -15558,8 +16230,8 @@ msgstr ""
msgid "synonym for --dirstat=cumulative"
msgstr "synonyme pour --dirstat=cumulative"
-msgid "synonym for --dirstat=files,param1,param2..."
-msgstr "synonyme pour --dirstat=files,param1,param2..."
+msgid "synonym for --dirstat=files,<param1>,<param2>..."
+msgstr "synonyme pour --dirstat=files,<param1>,<param2>..."
msgid "warn if changes introduce conflict markers or whitespace errors"
msgstr ""
@@ -15647,6 +16319,9 @@ msgstr "préfixer toutes les lignes en sortie avec la chaîne indiquée"
msgid "do not show any source or destination prefix"
msgstr "n'afficher aucun préfixe, ni de source, ni de destination"
+msgid "use default prefixes a/ and b/"
+msgstr "utiliser les préfixes par défaut a/ et b/"
+
msgid "show context between diff hunks up to the specified number of lines"
msgstr ""
"afficher le contexte entre les sections à concurrence du nombre de ligne "
@@ -15744,12 +16419,6 @@ msgid "generate diff using the \"histogram diff\" algorithm"
msgstr ""
"générer un diff en utilisant l'algorithme de différence \"histogramme\""
-msgid "<algorithm>"
-msgstr "<algorithme>"
-
-msgid "choose a diff algorithm"
-msgstr "choisir un algorithme de différence"
-
msgid "<text>"
msgstr "<texte>"
@@ -15968,6 +16637,14 @@ msgstr ""
"suggestion : en attente de la fermeture du fichier par votre éditeur de "
"texte…%c"
+#, c-format
+msgid "could not write to '%s'"
+msgstr "impossible d'écrire dans '%s'"
+
+#, c-format
+msgid "could not edit '%s'"
+msgstr "impossible d'éditer '%s'"
+
msgid "Filtering content"
msgstr "Filtrage du contenu"
@@ -16000,6 +16677,9 @@ msgstr "git fetch-pack : ACK/NACK attendu, '%s' reçu"
msgid "unable to write to remote"
msgstr "impossible d'écrire sur un distant"
+msgid "Server supports filter"
+msgstr "Le serveur supporte filter"
+
#, c-format
msgid "invalid shallow line: %s"
msgstr "ligne de superficiel invalide : %s"
@@ -16110,9 +16790,6 @@ msgstr "le serveur ne supporte pas l'algorithme '%s'"
msgid "Server does not support shallow requests"
msgstr "Le serveur ne supporte pas les requêtes superficielles"
-msgid "Server supports filter"
-msgstr "Le serveur supporte filter"
-
msgid "unable to write request to remote"
msgstr "impossible d'écrire la requête sur le distant"
@@ -16192,11 +16869,11 @@ msgstr "fsmonitor--daemon n'est pas en cours d'exécution"
#, c-format
msgid "could not send '%s' command to fsmonitor--daemon"
-msgstr "impossible de lancer la commmand '%s' à fsmonitor--daemon"
+msgstr "impossible de lancer la commande '%s' à fsmonitor--daemon"
#, c-format
msgid "bare repository '%s' is incompatible with fsmonitor"
-msgstr "le dépôit nu '%s' est incompatible avec fsmonitor"
+msgstr "le dépôt nu '%s' est incompatible avec fsmonitor"
#, c-format
msgid "repository '%s' is incompatible with fsmonitor due to errors"
@@ -16212,9 +16889,11 @@ msgstr "le dépôt virtuel '%s' est incompatible avec fsmonitor"
#, c-format
msgid ""
-"repository '%s' is incompatible with fsmonitor due to lack of Unix sockets"
+"socket directory '%s' is incompatible with fsmonitor due to lack of Unix "
+"sockets support"
msgstr ""
-"le dépôt '%s' est incompatible avec fsmonitor par manque de sockets Unix"
+"le répertoire de socket '%s' est incompatible avec fsmonitor par manque de "
+"sockets Unix"
msgid ""
"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
@@ -16222,18 +16901,16 @@ msgid ""
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
-" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
-" <command> [<args>]"
+" [--config-env=<name>=<envvar>] <command> [<args>]"
msgstr ""
-"git [--version] [-h | --help] [-C <chemin>] [-c <nom>=<valeur>]\n"
+"git [-v | --version] [-h | --help] [-C <chemin>] [-c <nom>=<valeur>]\n"
" [--exec-path[=<chemin>]] [--html-path] [--man-path] [--info-"
"path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<chemin>] [--work-tree=<chemin>] [--namespace=<nom>]\n"
-" [--super-prefix=<chemin>] [--config-env=<nom>=<variable-d-"
-"environnement>]\n"
-" <commande> [<args>]"
+" [--config-env=<nom>=<variable-d-environnement>] <commande> "
+"[<args>]"
msgid ""
"'git help -a' and 'git help -g' list available subcommands and some\n"
@@ -16259,10 +16936,6 @@ msgid "no namespace given for --namespace\n"
msgstr "aucun espace de nom fournit pour --namespace\n"
#, c-format
-msgid "no prefix given for --super-prefix\n"
-msgstr "aucun préfixe fourni pour --super-prefix\n"
-
-#, c-format
msgid "-c expects a configuration string\n"
msgstr "-c requiert une chaîne de configuration\n"
@@ -16271,6 +16944,10 @@ msgid "no config key given for --config-env\n"
msgstr "aucune clé de configuration fournie pour --config-env\n"
#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "aucune source d'attribut fournie pour --attr-source\n"
+
+#, c-format
msgid "unknown option: %s\n"
msgstr "option inconnue : %s\n"
@@ -16374,8 +17051,13 @@ msgstr ""
msgid "gpg.ssh.defaultKeyCommand failed: %s %s"
msgstr "gpg.ssh.defaultKeyCommand a échoué : %s %s"
-msgid "gpg failed to sign the data"
-msgstr "gpg n'a pas pu signer les données"
+#, c-format
+msgid ""
+"gpg failed to sign the data:\n"
+"%s"
+msgstr ""
+"gpg n'a pas pu signer les données :\n"
+"%s"
msgid "user.signingKey needs to be set for ssh signing"
msgstr "user.signingKey doit être configuré pour signer avec ssh"
@@ -16458,6 +17140,12 @@ msgstr "Commandes bas niveau / Synchronisation de dépôts"
msgid "Low-level Commands / Internal Helpers"
msgstr "Commandes bas niveau / Assistants internes"
+msgid "User-facing repository, command and file interfaces"
+msgstr "dépôts publics, commandes et interfaces de fichier"
+
+msgid "Developer-facing file formats, protocols and other interfaces"
+msgstr "Formats de fichier, protocoles et interfaces de niveau développeur"
+
#, c-format
msgid "available git commands in '%s'"
msgstr "commandes git disponibles dans '%s'"
@@ -16471,6 +17159,12 @@ msgstr "Ci-dessous les commandes Git habituelles dans diverses situations :"
msgid "The Git concept guides are:"
msgstr "Les guides des concepts de Git sont :"
+msgid "User-facing repository, command and file interfaces:"
+msgstr "Dépôts publics, commandes et interfaces de fichier :"
+
+msgid "File formats, protocols and other developer interfaces:"
+msgstr "formats de fichiers, protocoles et interfaces de niveau développeur :"
+
msgid "External commands"
msgstr "Commandes externes"
@@ -16528,8 +17222,8 @@ msgstr[1] ""
"\n"
"Les commandes les plus ressemblantes sont"
-msgid "git version [<options>]"
-msgstr "git version [<options>]"
+msgid "git version [--build-options]"
+msgstr "git version [--build-options]"
#, c-format
msgid "%s: %s - %s"
@@ -16558,10 +17252,6 @@ msgstr ""
"false`."
#, c-format
-msgid "Couldn't start hook '%s'\n"
-msgstr "impossible de démarrer le crochet '%s'\n"
-
-#, c-format
msgid "argument to --packfile must be a valid hash (got '%s')"
msgstr "l'argument de --packfile doit être une empreinte valide ('%s' reçu)"
@@ -16750,19 +17440,14 @@ msgid "quoted CRLF detected"
msgstr "CRLF citées détectées"
#, c-format
-msgid ""
-"Your local changes to the following files would be overwritten by merge:\n"
-" %s"
-msgstr ""
-"Vos modifications locales aux fichiers suivants seraient écrasées par la "
-"fusion :\n"
-" %s"
-
-#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "Échec de la fusion du sous-module %s (non extrait)"
#, c-format
+msgid "Failed to merge submodule %s (no merge base)"
+msgstr "Échec de la fusion du sous-module %s (pas de base de fusion)"
+
+#, c-format
msgid "Failed to merge submodule %s (commits not present)"
msgstr "Échec de fusion du sous-module %s (commits non présents)"
@@ -16782,28 +17467,10 @@ msgstr "Échec de la fusion du sous-module %s"
#, c-format
msgid ""
-"Failed to merge submodule %s, but a possible merge resolution exists:\n"
-"%s\n"
+"Failed to merge submodule %s, but a possible merge resolution exists: %s"
msgstr ""
"Échec de fusion du sous-module %s mais une résolution possible de fusion "
-"existe :\n"
-"%s\n"
-
-#, c-format
-msgid ""
-"If this is correct simply add it to the index for example\n"
-"by using:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"which will accept this suggestion.\n"
-msgstr ""
-"Si c'est correct, ajoutez le simplement à l'index\n"
-"en utilisant par exemple :\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"qui acceptera cette suggestion.\n"
+"existe : %s"
#, c-format
msgid ""
@@ -16814,12 +17481,12 @@ msgstr ""
"existent :\n"
"%s"
-msgid "Failed to execute internal merge"
-msgstr "Échec à l'exécution de la fusion interne"
+msgid "failed to execute internal merge"
+msgstr "échec à l'exécution de la fusion interne"
#, c-format
-msgid "Unable to add %s to database"
-msgstr "Impossible d'ajouter %s à la base de données"
+msgid "unable to add %s to database"
+msgstr "impossible d'ajouter %s à la base de données"
#, c-format
msgid "Auto-merging %s"
@@ -16968,13 +17635,46 @@ msgstr ""
"CONFLIT (modification/suppression) : %s supprimé dans %s et modifié dans %s. "
"Version %s de %s laissée dans l'arbre."
+#. TRANSLATORS: This is a line of advice to resolve a merge
+#. conflict in a submodule. The first argument is the submodule
+#. name, and the second argument is the abbreviated id of the
+#. commit that needs to be merged. For example:
+#. - go to submodule (mysubmodule), and either merge commit abc1234"
+#.
#, c-format
msgid ""
-"Note: %s not up to date and in way of checking out conflicted version; old "
-"copy renamed to %s"
+" - go to submodule (%s), and either merge commit %s\n"
+" or update to an existing commit which has merged those changes\n"
msgstr ""
-"Note :%s pas à jour et au milieu de l'extraction d'une version "
-"conflictuelle ; la vielle copie a été renommée en %s"
+" - aller au sous-module (%s), et soit fusionner le commit %s,\n"
+" soit mettre à jour vers un commit exstant qui intègre déjà ces "
+"modifications\n"
+
+#, c-format
+msgid ""
+"Recursive merging with submodules currently only supports trivial cases.\n"
+"Please manually handle the merging of each conflicted submodule.\n"
+"This can be accomplished with the following steps:\n"
+"%s - come back to superproject and run:\n"
+"\n"
+" git add %s\n"
+"\n"
+" to record the above merge or update\n"
+" - resolve any other conflicts in the superproject\n"
+" - commit the resulting index in the superproject\n"
+msgstr ""
+"La fusion récursive des sous-modules ne gère actuellement que les cas "
+"triviaux.\n"
+"Veuillez procéder à la fusion manuellement pour chaque sous-module en "
+"conflit.\n"
+"Ceci peut être réalisé par les étapes suivantes :\n"
+"%s - revenir au super-projet et lancer :\n"
+"\n"
+" git add %s\n"
+"\n"
+" pour enregistrer la fusion ci-dessus et mettre à jour\n"
+" - résoudre tous les autres conflits dans le super-projet\n"
+" - valider l'index résultant dans le super-projet\n"
#. TRANSLATORS: The %s arguments are: 1) tree hash of a merge
#. base, and 2-3) the trees for the two trees we're merging.
@@ -17046,6 +17746,22 @@ msgid "Found a possible merge resolution for the submodule:\n"
msgstr "Résolution possible de fusion trouvée pour le sous-module :\n"
#, c-format
+msgid ""
+"If this is correct simply add it to the index for example\n"
+"by using:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"which will accept this suggestion.\n"
+msgstr ""
+"Si c'est correct, ajoutez le simplement à l'index\n"
+"en utilisant par exemple :\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"qui acceptera cette suggestion.\n"
+
+#, c-format
msgid "Failed to merge submodule %s (multiple merges found)"
msgstr "Échec de fusion du sous-module %s (plusieurs fusions trouvées)"
@@ -17213,6 +17929,21 @@ msgid "multi-pack-index OID fanout is of the wrong size"
msgstr "l'étalement de l'OID d'index multi-paquet n'a pas la bonne taille"
#, c-format
+msgid ""
+"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
+msgstr ""
+"étalement oid en désordre : étalement[%d] = %<PRIx32> > %<PRIx32> = "
+"étalement[%d]"
+
+msgid "multi-pack-index OID lookup chunk is the wrong size"
+msgstr ""
+"le tronçon de recherche de l'OID d'index multi-paquet n'a pas la bonne taille"
+
+msgid "multi-pack-index object offset chunk is the wrong size"
+msgstr ""
+"le tronçon de décalage de l'OID d'index multi-paquet n'a pas la bonne taille"
+
+#, c-format
msgid "multi-pack-index file %s is too small"
msgstr "le fichier d'index multi-paquet %s est trop petit"
@@ -17232,17 +17963,28 @@ msgstr ""
"la version d'empreinte d'index multi-paquet %u ne correspond pas à la "
"version %u"
-msgid "multi-pack-index missing required pack-name chunk"
-msgstr "index multi-paquet manque de tronçon de nom de paquet"
+msgid "multi-pack-index required pack-name chunk missing or corrupted"
+msgstr ""
+"le tronçon de nom de paquet requis par l'index multi-paquet est manquant ou "
+"corrompu"
-msgid "multi-pack-index missing required OID fanout chunk"
-msgstr "index multi-paquet manque de tronçon de d'étalement OID requis"
+msgid "multi-pack-index required OID fanout chunk missing or corrupted"
+msgstr ""
+"le tronçon d'étalement OID requis de l'index multi-paquet est manquant ou "
+"corrompu"
+
+msgid "multi-pack-index required OID lookup chunk missing or corrupted"
+msgstr ""
+"le tronçon de recherche OID requis de l'index multi-paquet est manquant ou "
+"corrompu"
-msgid "multi-pack-index missing required OID lookup chunk"
-msgstr "index multi-paquet manque de tronçon de recherche OID requis"
+msgid "multi-pack-index required object offsets chunk missing or corrupted"
+msgstr ""
+"le tronçon de décalage d'objet requis de l'index multi-paquet est manquant "
+"ou corrompu"
-msgid "multi-pack-index missing required object offsets chunk"
-msgstr "index multi-paquet manque de tronçon de décalage d'objet requis"
+msgid "multi-pack-index pack-name chunk is too short"
+msgstr "le tronçon de nom de paquet de l'index multi-paquet est trop petit"
#, c-format
msgid "multi-pack-index pack names out of order: '%s' before '%s'"
@@ -17253,9 +17995,19 @@ msgstr ""
msgid "bad pack-int-id: %u (%u total packs)"
msgstr "mauvais pack-int-id : %u (%u paquets au total)"
+msgid "MIDX does not contain the BTMP chunk"
+msgstr "le MIDX ne contient pas de tronçon BTMP"
+
+#, c-format
+msgid "could not load bitmapped pack %<PRIu32>"
+msgstr "impossible d'ouvrir le paquet bitmappé %<PRIu32>"
+
msgid "multi-pack-index stores a 64-bit offset, but off_t is too small"
msgstr ""
-"l'index multi-paquet stock un décalage en 64-bit, mais off_t est trop petit"
+"l'index multi-paquet stocke un décalage en 64-bit, mais off_t est trop petit"
+
+msgid "multi-pack-index large offset out of bounds"
+msgstr "le grand décalage de l'index-multi-paquet est hors limite"
#, c-format
msgid "failed to add packfile '%s'"
@@ -17335,13 +18087,6 @@ msgstr "somme de contrôle incorrecte"
msgid "Looking for referenced packfiles"
msgstr "Recherche de fichiers paquets référencés"
-#, c-format
-msgid ""
-"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
-msgstr ""
-"étalement oid en désordre : étalement[%d] = %<PRIx32> > %<PRIx32> = "
-"étalement[%d]"
-
msgid "the midx contains no oid"
msgstr "le midx ne contient aucun oid"
@@ -17440,10 +18185,6 @@ msgstr "impossible de normaliser le chemin d'objet alternatif : %s"
msgid "%s: ignoring alternate object stores, nesting too deep"
msgstr "%s : magasins d'objets alternatifs ignorés, récursion trop profonde"
-#, c-format
-msgid "unable to normalize object directory: %s"
-msgstr "impossible de normaliser le répertoire d'objet : %s"
-
msgid "unable to fdopen alternates lockfile"
msgstr "impossible d'ouvrir (fdopen) le fichier verrou des alternatives"
@@ -17504,6 +18245,10 @@ msgid "garbage at end of loose object '%s'"
msgstr "données incorrectes à la fin de l'objet libre '%s'"
#, c-format
+msgid "unable to open loose object %s"
+msgstr "impossible d'ouvrir l'objet libre %s"
+
+#, c-format
msgid "unable to parse %s header"
msgstr "impossible d'analyser l'entête %s"
@@ -17519,18 +18264,14 @@ msgid "header for %s too long, exceeds %d bytes"
msgstr "entête de %s trop long, attendu %d octets"
#, c-format
-msgid "failed to read object %s"
-msgstr "impossible de lire l'objet %s"
+msgid "loose object %s (stored in %s) is corrupt"
+msgstr "l'objet libre %s (stocké dans %s) est corrompu"
#, c-format
msgid "replacement %s not found for %s"
msgstr "remplacement %s non trouvé pour %s"
#, c-format
-msgid "loose object %s (stored in %s) is corrupt"
-msgstr "l'objet libre %s (stocké dans %s) est corrompu"
-
-#, c-format
msgid "packed object %s (stored in %s) is corrupt"
msgstr "l'objet empaqueté %s (stocké dans %s) est corrompu"
@@ -17542,9 +18283,6 @@ msgstr "impossible d'écrire le fichier %s"
msgid "unable to set permission to '%s'"
msgstr "impossible de régler les droits de '%s'"
-msgid "file write error"
-msgstr "erreur d'écriture d'un fichier"
-
msgid "error when closing loose object file"
msgstr "erreur en fermeture du fichier d'objet esseulé"
@@ -17572,14 +18310,31 @@ msgid "confused by unstable object source data for %s"
msgstr "données de source d'objet instable pour %s"
#, c-format
+msgid "write stream object %ld != %<PRIuMAX>"
+msgstr "écrire l'objet de flux %ld != %<PRIuMAX>"
+
+#, c-format
+msgid "unable to stream deflate new object (%d)"
+msgstr "impossible de compresser le nouvel objet dans le flux (%d)"
+
+#, c-format
+msgid "deflateEnd on stream object failed (%d)"
+msgstr "échec de deflateEnd sur l'objet (%d)"
+
+#, c-format
+msgid "unable to create directory %s"
+msgstr "échec de la création du répertoire %s"
+
+#, c-format
msgid "cannot read object for %s"
msgstr "impossible de lire l'objet pour %s"
-msgid "corrupt commit"
-msgstr "commit corrompu"
+#, c-format
+msgid "object fails fsck: %s"
+msgstr "l'objet est en échec de fsck : %s"
-msgid "corrupt tag"
-msgstr "étiquette corrompue"
+msgid "refusing to create malformed object"
+msgstr "Refus de créer un objet malformé"
#, c-format
msgid "read error while indexing %s"
@@ -17801,6 +18556,56 @@ msgstr "impossible d'analyser l'objet : %s"
msgid "hash mismatch %s"
msgstr "incohérence de hachage %s"
+msgid "trying to write commit not in index"
+msgstr "échec de l'écriture de l'objet commit absent de l'index"
+
+msgid "failed to load bitmap index (corrupted?)"
+msgstr "échec du chargement de l'index en bitmap (corruption ?)"
+
+msgid "corrupted bitmap index (too small)"
+msgstr "index en bitmap corrompu (trop court)"
+
+msgid "corrupted bitmap index file (wrong header)"
+msgstr "fichier d'index en bitmap corrompu (mauvais entête)"
+
+#, c-format
+msgid "unsupported version '%d' for bitmap index file"
+msgstr "version non gérée '%d' pour le fichier d'index en bitmap"
+
+msgid "corrupted bitmap index file (too short to fit hash cache)"
+msgstr ""
+"fichier d'index en bitmap corrompu (trop court pour correspondre à un cache "
+"d'empreinte)"
+
+msgid "corrupted bitmap index file (too short to fit lookup table)"
+msgstr ""
+"fichier d'index en bitmap corrompu (trop court pour correspondre à une table "
+"de recherche)"
+
+#, c-format
+msgid "duplicate entry in bitmap index: '%s'"
+msgstr "entrée dupliquée dans l'index en bitmap : '%s'"
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for entry %d"
+msgstr "bitmap ewah corrompu : entête tronqué pour l'entrée %d"
+
+#, c-format
+msgid "corrupt ewah bitmap: commit index %u out of range"
+msgstr "bitmap ewah corrompu : index de commit %u hors plage"
+
+msgid "corrupted bitmap pack index"
+msgstr "index de paquet en bitmap corrompu"
+
+msgid "invalid XOR offset in bitmap pack index"
+msgstr "décalage XOR invalide dans l'index de paquet en bitmap"
+
+msgid "cannot fstat bitmap file"
+msgstr "impossible d'obtenir le statut (fstat) du fichier de bitmap"
+
+msgid "checksum doesn't match in MIDX and bitmap"
+msgstr "la somme de contrôle ne correspond pas entre MIDX et bitmap"
+
msgid "multi-pack bitmap is missing required reverse index"
msgstr "l'index inverse requis manque dans l'index multi-paquet"
@@ -17808,13 +18613,74 @@ 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"
+
+msgid "corrupt bitmap lookup table: xor chain exceeds entry count"
+msgstr ""
+"table de recherche en bitmap corrompue : la chaîne de xor dépasse le nombre "
+"d'entrées"
+
+#, c-format
+msgid "corrupt bitmap lookup table: commit index %u out of range"
+msgstr "table de recherche en bitmap corrompue : index de commit %u hors plage"
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for bitmap of commit \"%s\""
+msgstr "bitmap ewah corrompue : entête tronqué pour la bitmap du commit '%s'"
+
+#, c-format
+msgid "unable to load pack: '%s', disabling pack-reuse"
+msgstr "impossible de charger le paquet : '%s', pack-reuse désactivé"
+
+#, c-format
+msgid "object '%s' not found in type bitmaps"
+msgstr "objet '%s' non trouvé dans les bitmaps de type"
+
+#, c-format
+msgid "object '%s' does not have a unique type"
+msgstr "l'objet '%s' n'a pas un type unique"
+
+#, c-format
+msgid "object '%s': real type '%s', expected: '%s'"
+msgstr "objet '%s' : type réel '%s', attendu : '%s'"
+
+#, c-format
+msgid "object not in bitmap: '%s'"
+msgstr "objet non trouvé dans la bitmap : '%s'"
+
+msgid "failed to load bitmap indexes"
+msgstr "échec de chargement des index de bitmap"
+
+msgid "you must specify exactly one commit to test"
+msgstr "vous devez spécifier un seul commit à tester"
+
+#, c-format
+msgid "commit '%s' doesn't have an indexed bitmap"
+msgstr "le commit '%s' n'a pas de bitmap indexée"
+
+msgid "mismatch in bitmap results"
+msgstr "décalage dans le résultats de bitmap"
+
+#, c-format
+msgid "could not find '%s' in pack '%s' at offset %<PRIuMAX>"
+msgstr "impossible de trouver '%s' dans le paquet '%s' à l'offset %<PRIuMAX>"
+
+#, c-format
+msgid "unable to get disk usage of '%s'"
+msgstr "impossible de récupérer l'utilisation du disque de '%s'"
+
#, c-format
-msgid "could not find %s in pack %s at offset %<PRIuMAX>"
-msgstr "impossible de trouver %s dans le paquet %s à l'offset %<PRIuMAX>"
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "le fichier bitmap '%s' a une somme de contrôle invalide"
#, c-format
msgid "mtimes file %s is too small"
@@ -17856,6 +18722,20 @@ msgstr "le fichier d'index inverse %s a une version non gérée %<PRIu32>"
msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
msgstr "le fichier d'index inverse %s a un id d'empreinte non géré %<PRIu32>"
+msgid "invalid checksum"
+msgstr "somme de contrôle invalide"
+
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr "position de rev-index invalide à %<PRIu64> : %<PRIu32> != %<PRIu32>"
+
+msgid "multi-pack-index reverse-index chunk is the wrong size"
+msgstr ""
+"le tronçon d'index inversé de l'index multi-paquet n'a pas la bonne taille"
+
+msgid "could not determine preferred pack"
+msgstr "impossible de déterminer le paquet préféré"
+
msgid "cannot both write and verify reverse index"
msgstr "impossible de lire et vérifier à la fois l'index inverse"
@@ -17908,14 +18788,6 @@ msgid "%s requires a value"
msgstr "%s a besoin d'une valeur"
#, c-format
-msgid "%s is incompatible with %s"
-msgstr "%s est incompatible avec %s"
-
-#, c-format
-msgid "%s : incompatible with something else"
-msgstr "%s est incompatible avec toute autre option"
-
-#, c-format
msgid "%s takes no value"
msgstr "%s n'accepte aucune valeur"
@@ -17939,6 +18811,9 @@ msgstr "vouliez-vous dire `--%s` (avec deux signes moins)?"
msgid "alias of --%s"
msgstr "alias pour --%s"
+msgid "need a subcommand"
+msgstr "sous-commande requise"
+
#, c-format
msgid "unknown option `%s'"
msgstr "option inconnue « %s »"
@@ -17995,6 +18870,10 @@ msgstr " %s"
msgid "-NUM"
msgstr "-NUM"
+#, c-format
+msgid "opposite of --no-%s"
+msgstr "opposé de --no-%s"
+
msgid "expiry-date"
msgstr "date-d'expiration"
@@ -18010,6 +18889,9 @@ msgstr "être plus silencieux"
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"
+
msgid "how to strip spaces and #comments from message"
msgstr "comment éliminer les espaces et les commentaires # du message"
@@ -18023,6 +18905,14 @@ msgstr ""
"caractère NUL"
#, c-format
+msgid "bad boolean environment value '%s' for '%s'"
+msgstr "valeur booléenne d'environnement invalide '%s' pour '%s'"
+
+#, c-format
+msgid "failed to parse %s"
+msgstr "échec de l'analyse de %s"
+
+#, c-format
msgid "Could not make %s writable by group"
msgstr "Impossible de rendre %s inscriptible pour le groupe"
@@ -18073,6 +18963,10 @@ msgid "%s: 'literal' and 'glob' are incompatible"
msgstr "%s : 'literal' et 'glob' sont incompatibles"
#, c-format
+msgid "'%s' is outside the directory tree"
+msgstr "'%s' est hors de l'arbre de répertoire"
+
+#, c-format
msgid "%s: '%s' is outside repository at '%s'"
msgstr "%s : '%s' est hors du dépôt à '%s'"
@@ -18166,6 +19060,10 @@ msgstr ""
msgid "promisor remote name cannot begin with '/': %s"
msgstr "un nom de prometteur distant ne peut pas commencer par '/' : %s"
+#, c-format
+msgid "could not fetch %s from promisor remote"
+msgstr "impossible de récupérer %s depuis le distant de prometteur"
+
msgid "object-info: expected flush after arguments"
msgstr "object-info : vidage attendu après les arguments"
@@ -18202,6 +19100,13 @@ msgid "could not parse log for '%s'"
msgstr "impossible d'analyser le journal pour '%s'"
#, c-format
+msgid "invalid extra cruft tip: '%s'"
+msgstr "sommet supplémentaire dégénéré invalide : '%s'"
+
+msgid "unable to enumerate additional recent objects"
+msgstr "impossible d'énumérer les objets récents additionnels"
+
+#, c-format
msgid "will not add file alias '%s' ('%s' already exists in index)"
msgstr "pas d'ajout d'alias de fichier '%s'(« %s » existe déjà dans l'index)"
@@ -18223,10 +19128,6 @@ msgid "unable to add '%s' to index"
msgstr "impossible d'ajouter '%s' à l'index"
#, c-format
-msgid "unable to stat '%s'"
-msgstr "fstat de '%s' impossible"
-
-#, c-format
msgid "'%s' appears as both a file and as a directory"
msgstr "'%s' existe à la fois comme un fichier et un répertoire"
@@ -18334,10 +19235,6 @@ msgid "failed to convert to a sparse-index"
msgstr "échec de conversion d'un index clairsemé"
#, c-format
-msgid "could not stat '%s'"
-msgstr "impossible de stat '%s'"
-
-#, c-format
msgid "unable to open git dir: %s"
msgstr "impossible d'ouvrir le répertoire git : %s"
@@ -18353,6 +19250,14 @@ msgstr "impossible de régler les bits de droit de '%s'"
msgid "%s: cannot drop to stage #0"
msgstr "%s : impossible de revenir à l'étape 0"
+#, c-format
+msgid "unexpected diff status %c"
+msgstr "état de diff inattendu %c"
+
+#, c-format
+msgid "remove '%s'\n"
+msgstr "suppression de '%s'\n"
+
msgid ""
"You can fix this with 'git rebase --edit-todo' and then run 'git rebase --"
"continue'.\n"
@@ -18385,9 +19290,12 @@ msgid ""
"l, label <label> = label current HEAD with a name\n"
"t, reset <label> = reset HEAD to a label\n"
"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
-". create a merge commit using the original merge commit's\n"
-". message (or the oneline, if no original merge commit was\n"
-". specified); use -c <commit> to reword the commit message\n"
+" create a merge commit using the original merge commit's\n"
+" message (or the oneline, if no original merge commit was\n"
+" specified); use -c <commit> to reword the commit message\n"
+"u, update-ref <ref> = track a placeholder for the <ref> to be updated\n"
+" to this position in the new commits. The <ref> is\n"
+" updated at the end of the rebase\n"
"\n"
"These lines can be re-ordered; they are executed from top to bottom.\n"
msgstr ""
@@ -18415,6 +19323,11 @@ msgstr ""
" créer un commit de fusion utilisant le message de fusion original\n"
" (ou l'uniligne, si aucun commit de fusion n'a été spécifié).\n"
" Utilisez -c <commit> pour reformuler le message de validation.\n"
+" u, update-ref <réf> = suivre un espace réservé pour la <réf> à mettre à "
+"jour\n"
+" à cette position dans les nouveaux commits. La <réf> "
+"est\n"
+" mise à jour à la fin du rebasage\n"
"\n"
"Vous pouvez réordonner ces lignes ; elles sont exécutées de haut en bas.\n"
@@ -18512,6 +19425,14 @@ msgid "ahead %d, behind %d"
msgstr "en avance de %d, en retard de %d"
#, c-format
+msgid "%%(%.*s) does not take arguments"
+msgstr "%%(%.*s) n'accepte pas d'argument"
+
+#, c-format
+msgid "unrecognized %%(%.*s) argument: %s"
+msgstr "argument %%(%.*s) non reconnu : %s"
+
+#, c-format
msgid "expected format: %%(color:<color>)"
msgstr "format attendu : %%(color:<couleur>)"
@@ -18528,42 +19449,38 @@ msgid "Integer value expected refname:rstrip=%s"
msgstr "Valeur entière attendue refname:rstrip=%s"
#, c-format
-msgid "unrecognized %%(%s) argument: %s"
-msgstr "argument %%(%s) non reconnu : %s"
+msgid "expected %%(trailers:key=<value>)"
+msgstr "%%(trailers:key=<value>) attendu"
#, c-format
-msgid "%%(objecttype) does not take arguments"
-msgstr "%%(objecttype) n'accepte pas d'argument"
+msgid "unknown %%(trailers) argument: %s"
+msgstr "argument %%(trailers) inconnu : %s"
#, c-format
-msgid "%%(deltabase) does not take arguments"
-msgstr "%%(deltabase) n'accepte pas d'argument"
+msgid "positive value expected contents:lines=%s"
+msgstr "valeur positive attendue contents:lines=%s"
#, c-format
-msgid "%%(body) does not take arguments"
-msgstr "%%(body) n'accepte pas d'argument"
+msgid "argument expected for %s"
+msgstr "argument attendu pour %s"
#, c-format
-msgid "expected %%(trailers:key=<value>)"
-msgstr "%%(trailers:key=<value>) attendu"
+msgid "positive value expected %s=%s"
+msgstr "valeur positive attendue %s=%s"
#, c-format
-msgid "unknown %%(trailers) argument: %s"
-msgstr "argument %%(trailers) inconnu : %s"
+msgid "cannot fully parse %s=%s"
+msgstr "impossible d'analyser complètement %s=%s"
#, c-format
-msgid "positive value expected contents:lines=%s"
-msgstr "valeur positive attendue contents:lines=%s"
+msgid "value expected %s="
+msgstr "valeur attendue %s="
#, c-format
msgid "positive value expected '%s' in %%(%s)"
msgstr "valeur positive attendue '%s' dans %%(%s)"
#, c-format
-msgid "unrecognized email option: %s"
-msgstr "option de courriel non reconnue : %s"
-
-#, c-format
msgid "expected format: %%(align:<width>,<position>)"
msgstr "format attendu : %%(align:<largeur>,<position>)"
@@ -18576,12 +19493,16 @@ msgid "unrecognized width:%s"
msgstr "largeur non reconnue : %s"
#, c-format
+msgid "unrecognized %%(%s) argument: %s"
+msgstr "argument %%(%s) non reconnu : %s"
+
+#, c-format
msgid "positive width expected with the %%(align) atom"
msgstr "valeur positive attendue avec l'atome %%(align)"
#, c-format
-msgid "%%(rest) does not take arguments"
-msgstr "%%(rest) n'accepte pas d'argument"
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "format attendu : %%(ahead-behind:<commit-esque>)"
#, c-format
msgid "malformed field name: %.*s"
@@ -18629,6 +19550,9 @@ msgstr "cette commande rejette l'atome %%(%.*s)"
msgid "--format=%.*s cannot be used with --python, --shell, --tcl"
msgstr "--format=%.*s ne peut pas être utilisé avec --python, --shell, --tcl"
+msgid "failed to run 'describe'"
+msgstr "échec pour lancer 'describe'"
+
#, c-format
msgid "(no branch, rebasing %s)"
msgstr "(aucune branche, rebasage de %s)"
@@ -18690,6 +19614,9 @@ msgstr "clé"
msgid "field name to sort on"
msgstr "nom du champ servant à trier"
+msgid "exclude refs which match pattern"
+msgstr "exclure les références correspondant à <motif>"
+
#, c-format
msgid "not a reflog: %s"
msgstr "'%s' n'est pas un journal de références"
@@ -18777,10 +19704,6 @@ msgid "cannot process '%s' and '%s' at the same time"
msgstr "impossible de traiter '%s' et '%s' en même temps"
#, c-format
-msgid "could not remove reference %s"
-msgstr "impossible de supprimer la référence %s"
-
-#, c-format
msgid "could not delete reference %s: %s"
msgstr "impossible de supprimer la référence %s : %s"
@@ -18886,6 +19809,13 @@ msgstr "erreur de protocole : sha/ref attendu, '%s' trouvé"
msgid "http transport does not support %s"
msgstr "le transport http ne supporte pas %s"
+msgid "protocol error: expected '<url> <path>', missing space"
+msgstr "erreur de protocole : '<url> <chemin>' attendu, espace manquant"
+
+#, c-format
+msgid "failed to download file at URL '%s'"
+msgstr "échec du téléchargement du fichier à l'URL '%s'"
+
msgid "git-http-push failed"
msgstr "échec de git-http-push"
@@ -18968,7 +19898,7 @@ msgid ""
"Neither worked, so we gave up. You must fully qualify the ref."
msgstr ""
"La destination que vous avez fournie n'est pas un nom de référence complète\n"
-"(c'est-à-dire commençant par \"ref/\"). Essai d'approximation par :\n"
+"(c'est-à-dire commençant par \"refs/\"). Essai d'approximation par :\n"
"\n"
"- Recherche d'une référence qui correspond à '%s' sur le serveur distant.\n"
"- Vérification si la <source> en cours de poussée ('%s')\n"
@@ -19136,9 +20066,10 @@ msgstr[1] ""
"Votre branche et '%s' ont divergé,\n"
"et ont %d et %d commits différents chacune respectivement.\n"
-msgid " (use \"git pull\" to merge the remote branch into yours)\n"
+msgid ""
+" (use \"git pull\" if you want to integrate the remote branch with yours)\n"
msgstr ""
-" (utilisez \"git pull\" pour fusionner la branche distante dans la vôtre)\n"
+" (utilisez \"git pull\" pour intégrer la branche distante avec la vôtre)\n"
#, c-format
msgid "cannot parse expected object name '%s'"
@@ -19211,10 +20142,6 @@ msgid "no remembered resolution for '%s'"
msgstr "aucune résolution enregistrée pour '%s'"
#, c-format
-msgid "cannot unlink '%s'"
-msgstr "impossible de délier '%s'"
-
-#, c-format
msgid "Updated preimage for '%s'"
msgstr "Pré-image mise à jour pour '%s'"
@@ -19236,9 +20163,29 @@ msgstr "impossible de déterminer la révision HEAD"
msgid "failed to find tree of %s"
msgstr "impossible de trouver l'arbre de %s"
+#, c-format
+msgid "unsupported section for hidden refs: %s"
+msgstr "section non géree pour les réfs cachées : %s"
+
+msgid "--exclude-hidden= passed more than once"
+msgstr "--exclude-hidden= présent plus d'une fois"
+
+#, c-format
+msgid "resolve-undo records `%s` which is missing"
+msgstr "resolve-undo enregistre `%s` qui manque"
+
+#, c-format
+msgid "could not get commit for ancestry-path argument %s"
+msgstr ""
+"impossible de récupérer le commit pour l'argument de chemin d'ascendance %s"
+
msgid "--unpacked=<packfile> no longer supported"
msgstr "--unpacked=<fichier-paquet> n'est plus géré"
+#, c-format
+msgid "invalid option '%s' in --stdin mode"
+msgstr "option invalide '%s' en mode --stdin"
+
msgid "your current branch appears to be broken"
msgstr "votre branche actuelle semble cassée"
@@ -19256,6 +20203,206 @@ msgstr "-L ne supporte pas encore les formats de diff autres que -p et -s"
msgid "cannot create async thread: %s"
msgstr "impossible de créer un fil asynchrone : %s"
+#, c-format
+msgid "'%s' does not exist"
+msgstr "'%s' n'existe pas"
+
+#, c-format
+msgid "could not switch to '%s'"
+msgstr "impossible de basculer vers '%s'"
+
+msgid "need a working directory"
+msgstr "répertoire de travail nécessaire"
+
+msgid "Scalar enlistments require a worktree"
+msgstr "Les enrôlements scalaires requièrent un arbre de travail"
+
+#, c-format
+msgid "could not configure %s=%s"
+msgstr "impossible de configurer %s=%s"
+
+msgid "could not configure log.excludeDecoration"
+msgstr "impossible de configurer log.excludeDecoration"
+
+msgid "could not add enlistment"
+msgstr "impossible d'ajouter l'enrôlement"
+
+msgid "could not set recommended config"
+msgstr "impossible de réglér la configuration recommandée"
+
+msgid "could not turn on maintenance"
+msgstr "impossible d'activer la maintenance"
+
+msgid "could not start the FSMonitor daemon"
+msgstr "impossible de démarrer le daemon FSMonitor"
+
+msgid "could not turn off maintenance"
+msgstr "impossible de désactiver la maintenance"
+
+msgid "could not remove enlistment"
+msgstr "impossible de supprimer l'enrôlement"
+
+#, c-format
+msgid "remote HEAD is not a branch: '%.*s'"
+msgstr "la HEAD distante n'est pas une branche : '%.*s'"
+
+msgid "failed to get default branch name from remote; using local default"
+msgstr ""
+"échec de récupération de la branche par défaut depuis le distant ; "
+"utilisation de la valeur par défaut locale"
+
+msgid "failed to get default branch name"
+msgstr "échec de l'obtention du nom de branche par défaut"
+
+msgid "failed to unregister repository"
+msgstr "échec du désenregistrement du dépôt"
+
+msgid "failed to stop the FSMonitor daemon"
+msgstr "Échec de l'arrêt de FSEVEntStream"
+
+msgid "failed to delete enlistment directory"
+msgstr "échec de la suppression du répertoire d'enrôlement"
+
+msgid "branch to checkout after clone"
+msgstr "branche à extraire après le clonage"
+
+msgid "when cloning, create full working directory"
+msgstr "lors d'un clonage, créer un répertoire de travail complet"
+
+msgid "only download metadata for the branch that will be checked out"
+msgstr "ne télécharger les méta-données que pour la branche qui sera extraite"
+
+msgid "create repository within 'src' directory"
+msgstr "Créer un dépôt dans le repertoire 'src'"
+
+msgid ""
+"scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n"
+"\t[--[no-]src] <url> [<enlistment>]"
+msgstr ""
+"scalar clone [--single-branch] [--branch <branche-principale>] [--full-"
+"clone]\n"
+"\t[--[no-]src] <url> [<enrôlement>]"
+
+#, c-format
+msgid "cannot deduce worktree name from '%s'"
+msgstr "impossible de déduire le nom de l'arbre de travail depuis '%s'"
+
+#, c-format
+msgid "directory '%s' exists already"
+msgstr "le répertoire '%s' existe déjà"
+
+#, c-format
+msgid "failed to get default branch for '%s'"
+msgstr "échec d'obtention de la branche par défaut pour '%s'"
+
+#, c-format
+msgid "could not configure remote in '%s'"
+msgstr "impossible de paramétrer le distant dans '%s'"
+
+#, c-format
+msgid "could not configure '%s'"
+msgstr "impossible de configurer '%s'"
+
+msgid "partial clone failed; attempting full clone"
+msgstr "échec du clonage partiel ; tentative de clonage complet"
+
+msgid "could not configure for full clone"
+msgstr "impossible de configurer pour le clonage complet"
+
+msgid "scalar diagnose [<enlistment>]"
+msgstr "scalar diagnose [<enrôlement>]"
+
+msgid "`scalar list` does not take arguments"
+msgstr "`scalar list` n'accepte pas d'argument"
+
+msgid "scalar register [<enlistment>]"
+msgstr "scalar register [<enrôlement>]"
+
+msgid "reconfigure all registered enlistments"
+msgstr "reconfigurer tous les enrôlements enregistrés"
+
+msgid "scalar reconfigure [--all | <enlistment>]"
+msgstr "scala reconfigure [--all|<enrôlement>]"
+
+msgid "--all or <enlistment>, but not both"
+msgstr "--all ou <enrôlement>, mais pas les deux"
+
+#, c-format
+msgid "could not remove stale scalar.repo '%s'"
+msgstr "impossible de supprimé le scalar.repo obsolète '%s'"
+
+#, c-format
+msgid "removed stale scalar.repo '%s'"
+msgstr "suppression du scalar.repo obsolète '%s'"
+
+#, c-format
+msgid "repository at '%s' has different owner"
+msgstr "le dépôt dans '%s' a un propriétaire différent"
+
+#, c-format
+msgid "repository at '%s' has a format issue"
+msgstr "le dépôt dans '%s' a un problème de format"
+
+#, c-format
+msgid "repository not found in '%s'"
+msgstr "dépôt non trouvé dans '%s'"
+
+#, c-format
+msgid ""
+"to unregister this repository from Scalar, run\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+msgstr ""
+"pour désinscrire ce dépôt de Scalar, lancez\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+
+msgid ""
+"scalar run <task> [<enlistment>]\n"
+"Tasks:\n"
+msgstr ""
+"scalar run <tâche> [<enrôlement>]\n"
+"Tâches :\n"
+
+#, c-format
+msgid "no such task: '%s'"
+msgstr "pas de tâche : '%s'"
+
+msgid "scalar unregister [<enlistment>]"
+msgstr "scalar unregister [<enrôlement>]"
+
+msgid "scalar delete <enlistment>"
+msgstr "scalar delete <enrôlement>"
+
+msgid "refusing to delete current working directory"
+msgstr "refus de la suppression du répertoire de travail actuel"
+
+msgid "include Git version"
+msgstr "inclure la version Git"
+
+msgid "include Git's build options"
+msgstr "inclure les options de construction de Git"
+
+msgid "scalar verbose [-v | --verbose] [--build-options]"
+msgstr "scalar verbose [-v | --verbose] [--build-options]"
+
+msgid "-C requires a <directory>"
+msgstr "-C requiert un <répertoire>"
+
+#, c-format
+msgid "could not change to '%s'"
+msgstr "échec de modification en '%s'"
+
+msgid "-c requires a <key>=<value> argument"
+msgstr "-c exige un argument <clé>=<valeur>"
+
+msgid ""
+"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
+"\n"
+"Commands:\n"
+msgstr ""
+"scalar [-C <répertoire>] [-c <clé>=<valeur>] <commande> [<options>]\n"
+"\n"
+"Commandes :\n"
+
msgid "unexpected flush packet while reading remote unpack status"
msgstr ""
"paquet de nettoyage inattendu pendant la lecture de l'état de dépaquetage "
@@ -19361,10 +20508,6 @@ msgid "could not lock '%s'"
msgstr "impossible de verrouiller '%s'"
#, c-format
-msgid "could not write to '%s'"
-msgstr "impossible d'écrire dans '%s'"
-
-#, c-format
msgid "could not write eol to '%s'"
msgstr "impossible d'écrire la fin de ligne dans '%s'"
@@ -19379,10 +20522,6 @@ msgstr "vos modifications locales seraient écrasées par %s."
msgid "commit your changes or stash them to proceed."
msgstr "validez vos modifications ou les remiser pour continuer."
-#, c-format
-msgid "%s: fast-forward"
-msgstr "%s : avance rapide"
-
#. TRANSLATORS: %s will be "revert", "cherry-pick" or
#. "rebase".
#.
@@ -19622,10 +20761,6 @@ msgid "%s: cannot parse parent commit %s"
msgstr "%s : impossible d'analyser le commit parent %s"
#, c-format
-msgid "could not rename '%s' to '%s'"
-msgstr "impossible de renommer '%s' en '%s'"
-
-#, c-format
msgid "could not revert %s... %s"
msgstr "impossible d'annuler %s... %s"
@@ -19646,6 +20781,24 @@ msgid "git %s: failed to refresh the index"
msgstr "git %s : échec du rafraîchissement de l'index"
#, c-format
+msgid "'%s' is not a valid label"
+msgstr "'%s' n'est pas un label valide"
+
+#, c-format
+msgid "'%s' is not a valid refname"
+msgstr "'%s' n'est pas un nom valide de référence"
+
+#, c-format
+msgid "update-ref requires a fully qualified refname e.g. refs/heads/%s"
+msgstr ""
+"update-ref requiert un nom de référence totalement qualifié par ex. refs/"
+"heads/%s"
+
+#, c-format
+msgid "invalid command '%.*s'"
+msgstr "commande '%.*s' invalide"
+
+#, c-format
msgid "%s does not accept arguments: '%s'"
msgstr "%s n'accepte pas d'argument : '%s'"
@@ -19715,9 +20868,6 @@ msgstr "essayez \"git cherry-pick (--continue | %s--abort | --quit)\""
msgid "could not create sequencer directory '%s'"
msgstr "impossible de créer le répertoire de séquenceur '%s'"
-msgid "could not lock HEAD"
-msgstr "impossible de verrouiller HEAD"
-
msgid "no cherry-pick or revert in progress"
msgstr "aucun picorage ou retour en cours"
@@ -19813,20 +20963,20 @@ msgstr ""
"git rebase --continue\n"
"\n"
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "et a mis à jour l'index ou l'arbre de travail\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "et a mis à jour l'index ou l'arbre de travail.\n"
#, c-format
msgid ""
"execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
"Commit or stash your changes, and then run\n"
"\n"
" git rebase --continue\n"
"\n"
msgstr ""
"l'exécution a réussi : %s\n"
-"mais a laissé des modifications dans l'index ou la copie de travail\n"
+"mais a laissé des modifications dans l'index ou la copie de travail.\n"
"Validez ou remisez vos modification, puis lancez\n"
"\n"
" git rebase --continue\n"
@@ -19836,16 +20986,16 @@ msgstr ""
msgid "illegal label name: '%.*s'"
msgstr "nom de label illégal '%.*s'"
+#, c-format
+msgid "could not resolve '%s'"
+msgstr "impossible de résoudre '%s'"
+
msgid "writing fake root commit"
msgstr "écriture d'un commit racine bidon"
msgid "writing squash-onto"
msgstr "écriture de 'écraser-sur'"
-#, c-format
-msgid "could not resolve '%s'"
-msgstr "impossible de résoudre '%s'"
-
msgid "cannot merge without a current revision"
msgstr "impossible de fusionner avec une révision courante"
@@ -19872,6 +21022,27 @@ msgstr "impossible de seulement essayer de fusionner '%.*s'"
msgid "merge: Unable to write new index file"
msgstr "fusion : Impossible d'écrire le nouveau fichier index"
+#, c-format
+msgid ""
+"another 'rebase' process appears to be running; '%s.lock' already exists"
+msgstr "un processu 'rebase' semble déjà lancé; '%s.lock' existe déjà"
+
+#, c-format
+msgid ""
+"Updated the following refs with %s:\n"
+"%s"
+msgstr ""
+"Les références suivantes ont été mises à jour avec %s :\n"
+"%s"
+
+#, c-format
+msgid ""
+"Failed to update the following refs with %s:\n"
+"%s"
+msgstr ""
+"Échec des mises à jour des références suivantes avec %s :\n"
+"%s"
+
msgid "Cannot autostash"
msgstr "Autoremisage impossible"
@@ -19915,6 +21086,9 @@ msgid "Autostash exists; creating a new stash entry."
msgstr ""
"Un remisage automatique existe ; création d'une nouvelle entrée de remisage."
+msgid "autostash reference is a symref"
+msgstr "la référence d'auto-remisage est une symref"
+
msgid "could not detach HEAD"
msgstr "impossible de détacher HEAD"
@@ -19947,14 +21121,14 @@ msgstr ""
" git rebase --continue\n"
#, c-format
-msgid "Rebasing (%d/%d)%s"
-msgstr "Rebasage (%d/%d)%s"
-
-#, c-format
msgid "Stopped at %s... %.*s\n"
msgstr "Arrêt à %s... %.*s\n"
#, c-format
+msgid "Rebasing (%d/%d)%s"
+msgstr "Rebasage (%d/%d)%s"
+
+#, c-format
msgid "unknown command %d"
msgstr "commande inconnue %d"
@@ -20039,6 +21213,10 @@ msgid "the script was already rearranged."
msgstr "le script a déjà été réarrangé."
#, c-format
+msgid "update-refs file at '%s' is invalid"
+msgstr "le fichier update-refs %s est invalide"
+
+#, c-format
msgid "'%s' is outside repository at '%s'"
msgstr "'%s' est hors du dépôt à '%s'"
@@ -20164,17 +21342,21 @@ msgstr ""
#, c-format
msgid ""
-"unsafe repository ('%s' is owned by someone else)\n"
-"To add an exception for this directory, call:\n"
+"detected dubious ownership in repository at '%s'\n"
+"%sTo add an exception for this directory, call:\n"
"\n"
"\tgit config --global --add safe.directory %s"
msgstr ""
-"dépôt non sécurisé ('%s' appartient à quelqu'un d'autre)\n"
-"Pour ajouter une exception pour ce dépôt, lancez :\n"
+"propriétaire douteux détecté dans le dépôt à '%s'\n"
+"%sPour ajouter une exception pour ce dépôt, lancez :\n"
"\n"
"\tgit config --global --add safe.directory %s"
#, c-format
+msgid "cannot use bare repository '%s' (safe.bareRepository is '%s')"
+msgstr "impossible d'utiliser le dépôt nu '%s' (safe.bareRepository vaut '%s')"
+
+#, c-format
msgid ""
"problem with core.sharedRepository filemode value (0%.3o).\n"
"The owner of files must always have read and write permissions."
@@ -20190,6 +21372,83 @@ msgid "setsid failed"
msgstr "échec du setsid"
#, c-format
+msgid "cannot stat template '%s'"
+msgstr "impossible de faire un stat du modèle '%s'"
+
+#, c-format
+msgid "cannot opendir '%s'"
+msgstr "impossible d'ouvrir le répertoire '%s'"
+
+#, c-format
+msgid "cannot readlink '%s'"
+msgstr "impossible de lire le lien '%s'"
+
+#, c-format
+msgid "cannot symlink '%s' '%s'"
+msgstr "impossible de créer un lien symbolique de '%s' '%s'"
+
+#, c-format
+msgid "cannot copy '%s' to '%s'"
+msgstr "impossible de copier '%s' vers '%s'"
+
+#, c-format
+msgid "ignoring template %s"
+msgstr "modèle %s ignoré"
+
+#, c-format
+msgid "templates not found in %s"
+msgstr "modèles non trouvés dans %s"
+
+#, c-format
+msgid "not copying templates from '%s': %s"
+msgstr "pas de copie des modèles depuis '%s' : %s"
+
+#, c-format
+msgid "invalid initial branch name: '%s'"
+msgstr "nom de branche initiale invalide : '%s'"
+
+#, c-format
+msgid "re-init: ignored --initial-branch=%s"
+msgstr "re-initialisation : --initial-branch=%s ignoré"
+
+#, c-format
+msgid "unable to handle file type %d"
+msgstr "impossible de traiter le fichier de type %d"
+
+#, c-format
+msgid "unable to move %s to %s"
+msgstr "impossible de déplacer %s vers %s"
+
+msgid "attempt to reinitialize repository with different hash"
+msgstr "essai de réinitialisation du dépôt avec une empreinte différente"
+
+msgid ""
+"attempt to reinitialize repository with different reference storage format"
+msgstr ""
+"essai de réinitialisation du dépôt avec un format de stockage de références "
+"différent"
+
+#, c-format
+msgid "%s already exists"
+msgstr "%s existe déjà"
+
+#, c-format
+msgid "Reinitialized existing shared Git repository in %s%s\n"
+msgstr "Dépôt Git existant partagé réinitialisé dans %s%s\n"
+
+#, c-format
+msgid "Reinitialized existing Git repository in %s%s\n"
+msgstr "Dépôt Git existant réinitialisé dans %s%s\n"
+
+#, c-format
+msgid "Initialized empty shared Git repository in %s%s\n"
+msgstr "Dépôt Git vide partagé initialisé dans %s%s\n"
+
+#, c-format
+msgid "Initialized empty Git repository in %s%s\n"
+msgstr "Dépôt Git vide initialisé dans %s%s\n"
+
+#, c-format
msgid "index entry is a directory, but not sparse (%08x)"
msgstr "l'entrée d'index est un répertoire, mais pas clairsemé (%08x)"
@@ -20241,10 +21500,6 @@ msgstr[0] "%u octet/s"
msgstr[1] "%u octets/s"
#, c-format
-msgid "could not edit '%s'"
-msgstr "impossible d'éditer '%s'"
-
-#, c-format
msgid "ignoring suspicious submodule name: %s"
msgstr "nom de sous-module suspicieux %s ignoré"
@@ -20427,11 +21682,24 @@ msgstr "ls-tree a renvoyé un code de retour inattendu %d"
msgid "failed to lstat '%s'"
msgstr "échec du lstat de '%s'"
-msgid "unhandled options"
-msgstr "options non gérées"
+msgid "no remote configured to get bundle URIs from"
+msgstr "aucun distant configuré depuis lequel récupérer des URIs de colis"
-msgid "error preparing revisions"
-msgstr "erreur lors de la préparation des révisions"
+#, c-format
+msgid "remote '%s' has no configured URL"
+msgstr "le distant '%s' n'a pas d'URL configuré"
+
+msgid "could not get the bundle-uri list"
+msgstr "impossible d'avoir la liste de bundle-uris"
+
+msgid "test-tool cache-tree <options> (control|prime|update)"
+msgstr "test-tool cache-tree <options> (control|prime|update)"
+
+msgid "clear the cache tree before each iteration"
+msgstr "effacer l'arbre de cache avant chaque itération"
+
+msgid "number of entries in the cache tree to invalidate (default 0)"
+msgstr "nombre d'entrées dans l'arbre de cache à invalider (par défaut, 0)"
#, c-format
msgid "commit %s is not marked reachable"
@@ -20592,9 +21860,6 @@ msgstr ""
msgid "invalid remote service path"
msgstr "chemin de service distant invalide"
-msgid "operation not supported by protocol"
-msgstr "option non supportée par le protocole"
-
#, c-format
msgid "can't connect to subservice %s"
msgstr "impossible de se connecter au sous-service %s"
@@ -20727,10 +21992,6 @@ msgid "support for protocol v2 not implemented yet"
msgstr "le support du protocole v2 n'est pas encore implanté"
#, c-format
-msgid "unknown value for config '%s': %s"
-msgstr "valeur inconnue pour la config '%s' : %s"
-
-#, c-format
msgid "transport '%s' not allowed"
msgstr "transport '%s' non permis"
@@ -20777,6 +22038,16 @@ msgstr "Abandon."
msgid "failed to push all needed submodules"
msgstr "échec de la poussée de tous les sous-modules nécessaires"
+msgid "bundle-uri operation not supported by protocol"
+msgstr "opération bundle-uri non supportée par le protocole"
+
+msgid "could not retrieve server-advertised bundle-uri list"
+msgstr ""
+"impossible de récupérer la liste de bundle-uris annoncée par le serveur"
+
+msgid "operation not supported by protocol"
+msgstr "option non supportée par le protocole"
+
msgid "too-short tree object"
msgstr "objet arbre trop court"
@@ -21061,6 +22332,18 @@ msgstr "numéro de port invalide"
msgid "invalid '..' path segment"
msgstr "segment de chemin '..' invalide"
+msgid "usage: "
+msgstr "usage : "
+
+msgid "fatal: "
+msgstr "fatal : "
+
+msgid "error: "
+msgstr "erreur : "
+
+msgid "warning: "
+msgstr "avertissement : "
+
msgid "Fetching objects"
msgstr "Récupération des objets"
@@ -21165,6 +22448,9 @@ msgstr "impossible d'accéder à '%s'"
msgid "unable to get current working directory"
msgstr "impossible d'accéder au répertoire de travail courant"
+msgid "unable to get random bytes"
+msgstr "impossible d'acquérir des octets aléatoires"
+
msgid "Unmerged paths:"
msgstr "Chemins non fusionnés :"
@@ -21502,7 +22788,7 @@ msgid "HEAD detached from "
msgstr "HEAD détachée depuis "
msgid "Not currently on any branch."
-msgstr "Actuellement sur aucun branche."
+msgstr "Actuellement sur aucune branche."
msgid "Initial commit"
msgstr "Validation initiale"
@@ -21518,14 +22804,19 @@ msgstr "Fichiers ignorés"
#, c-format
msgid ""
-"It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
-"may speed it up, but you have to be careful not to forget to add\n"
-"new files yourself (see 'git help status')."
+"It took %.2f seconds to enumerate untracked files,\n"
+"but the results were cached, and subsequent runs may be faster."
msgstr ""
-"L'énumération des fichiers non suivis a duré %.2f secondes. 'status -uno'\n"
-"peut l'accélérer, mais vous devez alors faire attention à ne pas\n"
-"oublier d'ajouter les nouveaux fichiers par vous-même (voir 'git help "
-"status')."
+"L'énumération des fichiers non-suivis a pris %.2f secondes,\n"
+"mais les resultats ont été mis en cache, et les lancements suivants seront "
+"plus rapides."
+
+#, c-format
+msgid "It took %.2f seconds to enumerate untracked files."
+msgstr "L'énumération des fichiers non-suivis a pris %.2f secondes."
+
+msgid "See 'git help status' for information on how to improve this."
+msgstr "Voir 'git help status' pour tout information pour améliorer ceci."
#, c-format
msgid "Untracked files not listed%s"
@@ -21606,6 +22897,10 @@ msgstr "de plus, votre index contient des modifications non validées."
msgid "cannot %s: Your index contains uncommitted changes."
msgstr "%s impossible : votre index contient des modifications non validées."
+#, c-format
+msgid "unknown style '%s' given for '%s'"
+msgstr "style inconnu '%s' pour '%s'"
+
msgid ""
"Error: Your local changes to the following files would be overwritten by "
"merge"
@@ -21676,292 +22971,6 @@ msgstr ""
msgid "Unable to determine absolute path of git directory"
msgstr "Impossible de déterminer le chemin absolu du répertoire git"
-#. TRANSLATORS: you can adjust this to align "git add -i" status menu
-#, perl-format
-msgid "%12s %12s %s"
-msgstr "%12s %s12s %s"
-
-#, perl-format
-msgid "touched %d path\n"
-msgid_plural "touched %d paths\n"
-msgstr[0] "%d chemin touché\n"
-msgstr[1] "%d chemins touchés\n"
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for staging."
-msgstr ""
-"Si le patch s'applique proprement, la section éditée sera\n"
-"immédiatement marquée comme indexée."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for stashing."
-msgstr ""
-"Si le patch s'applique proprement, la section éditée sera\n"
-"immédiatement marquée comme remisée."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for unstaging."
-msgstr ""
-"Si le patch s'applique proprement, la section éditée sera\n"
-"immédiatement marquée comme desindexée."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for applying."
-msgstr ""
-"Si le patch s'applique proprement, la section éditée sera\n"
-"immédiatement marquée comme appliquée."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for discarding."
-msgstr ""
-"Si le patch s'applique proprement, la section éditée sera\n"
-"immédiatement marquée comme éliminée."
-
-#, perl-format
-msgid "failed to open hunk edit file for writing: %s"
-msgstr "impossible d'ouvrir le fichier d'édition de section en écriture : %s"
-
-#, perl-format
-msgid ""
-"---\n"
-"To remove '%s' lines, make them ' ' lines (context).\n"
-"To remove '%s' lines, delete them.\n"
-"Lines starting with %s will be removed.\n"
-msgstr ""
-"---\n"
-"Pour éliminer les lignes '%s', rendez-les ' ' (contexte).\n"
-"Pour éliminer les lignes '%s', effacez-les.\n"
-"Les lignes commençant par %s seront éliminées.\n"
-
-#, perl-format
-msgid "failed to open hunk edit file for reading: %s"
-msgstr "échec de l'ouverture du fichier d'édition de section en lecture : %s"
-
-msgid ""
-"y - stage this hunk\n"
-"n - do not stage this hunk\n"
-"q - quit; do not stage this hunk or any of the remaining ones\n"
-"a - stage this hunk and all later hunks in the file\n"
-"d - do not stage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - indexer cette section\n"
-"n - ne pas indexer cette section\n"
-"q - quitter ; ne pas indexer cette section ni les autres restantes\n"
-"a - indexer cette section et toutes les suivantes de ce fichier\n"
-"d - ne pas indexer cette section ni les suivantes de ce fichier"
-
-msgid ""
-"y - stash this hunk\n"
-"n - do not stash this hunk\n"
-"q - quit; do not stash this hunk or any of the remaining ones\n"
-"a - stash this hunk and all later hunks in the file\n"
-"d - do not stash this hunk or any of the later hunks in the file"
-msgstr ""
-"y - remiser cette section\n"
-"n - ne pas remiser cette section\n"
-"q - quitter ; ne pas remiser cette section ni les autres restantes\n"
-"a - remiser cette section et toutes les suivantes de ce fichier\n"
-"d - ne pas remiser cette section ni les suivantes de ce fichier"
-
-msgid ""
-"y - unstage this hunk\n"
-"n - do not unstage this hunk\n"
-"q - quit; do not unstage this hunk or any of the remaining ones\n"
-"a - unstage this hunk and all later hunks in the file\n"
-"d - do not unstage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - désindexer cette section\n"
-"n - ne pas désindexer cette section\n"
-"q - quitter ; ne pas désindexer cette section ni les autres restantes\n"
-"a - désindexer cette section et toutes les suivantes de ce fichier\n"
-"d - ne pas désindexer cette section ni les suivantes de ce fichier"
-
-msgid ""
-"y - apply this hunk to index\n"
-"n - do not apply this hunk to index\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - appliquer cette section\n"
-"n - ne pas appliquer cette section\n"
-"q - quitter ; ne pas appliquer cette section ni les autres restantes\n"
-"a - appliquer cette section et toutes les suivantes de ce fichier\n"
-"d - ne pas appliquer cette section ni les suivantes de ce fichier"
-
-msgid ""
-"y - discard this hunk from worktree\n"
-"n - do not discard this hunk from worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - supprimer cette section\n"
-"n - ne pas supprimer cette section\n"
-"q - quitter ; ne pas supprimer cette section ni les autres restantes\n"
-"a - supprimer cette section et toutes les suivantes de ce fichier\n"
-"d - ne pas supprimer cette section ni les suivantes de ce fichier"
-
-msgid ""
-"y - discard this hunk from index and worktree\n"
-"n - do not discard this hunk from index and worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - éliminer cette section de l'index et de l'arbre de travail\n"
-"n - ne pas éliminer cette section\n"
-"q - quitter ; ne pas éliminer cette section ni les autres restantes\n"
-"a - éliminer cette section et toutes les suivantes de ce fichier\n"
-"d - ne pas éliminer cette section ni les suivantes de ce fichier"
-
-msgid ""
-"y - apply this hunk to index and worktree\n"
-"n - do not apply this hunk to index and worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - appliquer cette section à l'index et à l'arbre de travail\n"
-"n - ne pas appliquer cette section\n"
-"q - quitter ; ne pas appliquer cette section ni les autres restantes\n"
-"a - appliquer cette section et toutes les suivantes de ce fichier\n"
-"d - ne pas appliquer cette section ni les suivantes de ce fichier"
-
-msgid ""
-"y - apply this hunk to worktree\n"
-"n - do not apply this hunk to worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - appliquer cette section à l'arbre de travail\n"
-"n - ne pas appliquer cette section\n"
-"q - quitter ; ne pas appliquer cette section ni les autres restantes\n"
-"a - appliquer cette section et toutes les suivantes de ce fichier\n"
-"d - ne pas appliquer cette section ni les suivantes de ce fichier"
-
-msgid ""
-"g - select a hunk to go to\n"
-"/ - search for a hunk matching the given regex\n"
-"j - leave this hunk undecided, see next undecided hunk\n"
-"J - leave this hunk undecided, see next hunk\n"
-"k - leave this hunk undecided, see previous undecided hunk\n"
-"K - leave this hunk undecided, see previous hunk\n"
-"s - split the current hunk into smaller hunks\n"
-"e - manually edit the current hunk\n"
-"? - print help\n"
-msgstr ""
-"g - selectionner une section et s'y rendre\n"
-"/ - rechercher une section correspondant à une regex donnée\n"
-"j - laisser cette section non décidée et aller à la suivante non-décidée\n"
-"J - laisser cette section non décidée et aller à la suivante\n"
-"k - laisser cette section non décidée et aller à la précédente non-décidée\n"
-"K - laisser cette section non décidée et aller à la précédente\n"
-"s - découper la section en sections plus petites\n"
-"e - éditer manuellement la section actuelle\n"
-"? - afficher l'aide\n"
-
-msgid "The selected hunks do not apply to the index!\n"
-msgstr "Les sections sélectionnées ne s'applique pas à l'index !\n"
-
-#, perl-format
-msgid "ignoring unmerged: %s\n"
-msgstr "fichier non-fusionné ignoré : %s\n"
-
-#, perl-format
-msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
-msgstr ""
-"Appliquer le changement de mode dans l'arbre de travail [y,n,q,a,d%s,?] ? "
-
-#, perl-format
-msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
-msgstr "Appliquer la suppression dans l'arbre de travail [y,n,q,a,d%s,?] ? "
-
-#, perl-format
-msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
-msgstr "Appliquer l'ajout dans l'arbre de travail [y,n,q,a,d%s,?] ? "
-
-#, perl-format
-msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
-msgstr "Appliquer la section à l'arbre de travail [y,n,q,a,d%s,?] ? "
-
-msgid "No other hunks to goto\n"
-msgstr "Aucune autre section à atteindre\n"
-
-#, perl-format
-msgid "Invalid number: '%s'\n"
-msgstr "Nombre invalide : '%s'\n"
-
-#, perl-format
-msgid "Sorry, only %d hunk available.\n"
-msgid_plural "Sorry, only %d hunks available.\n"
-msgstr[0] "Désolé, %d seule section disponible.\n"
-msgstr[1] "Désolé, Seulement %d sections disponibles.\n"
-
-msgid "No other hunks to search\n"
-msgstr "Aucune autre section à rechercher\n"
-
-#, perl-format
-msgid "Malformed search regexp %s: %s\n"
-msgstr "Regex de recherche malformée %s : %s\n"
-
-msgid "No hunk matches the given pattern\n"
-msgstr "Aucune section ne correspond au motif donné\n"
-
-msgid "No previous hunk\n"
-msgstr "Pas de section précédente\n"
-
-msgid "No next hunk\n"
-msgstr "Pas de section suivante\n"
-
-msgid "Sorry, cannot split this hunk\n"
-msgstr "Désolé, impossible de découper cette section\n"
-
-#, perl-format
-msgid "Split into %d hunk.\n"
-msgid_plural "Split into %d hunks.\n"
-msgstr[0] "Découpée en %d section.\n"
-msgstr[1] "Découpée en %d sections.\n"
-
-msgid "Sorry, cannot edit this hunk\n"
-msgstr "Désolé, impossible d'éditer cette section\n"
-
-#. TRANSLATORS: please do not translate the command names
-#. 'status', 'update', 'revert', etc.
-msgid ""
-"status - show paths with changes\n"
-"update - add working tree state to the staged set of changes\n"
-"revert - revert staged set of changes back to the HEAD version\n"
-"patch - pick hunks and update selectively\n"
-"diff - view diff between HEAD and index\n"
-"add untracked - add contents of untracked files to the staged set of "
-"changes\n"
-msgstr ""
-"status - montrer les chemins modifiés\n"
-"update - ajouter l'état de l'arbre de travail aux modifications à "
-"indexer\n"
-"revert - faire revenir les modifications à indexer à la version HEAD\n"
-"patch - sélectionner les sections et mettre à jour sélectivement\n"
-"diff - visualiser les diff entre HEAD et l'index\n"
-"add untracked - ajouter les fichiers non-suivis aux modifications à indexer\n"
-
-msgid "missing --"
-msgstr "-- manquant"
-
-#, perl-format
-msgid "unknown --patch mode: %s"
-msgstr "mode de --patch inconnu : %s"
-
-#, perl-format
-msgid "invalid argument %s, expecting --"
-msgstr "argument invalide %s, -- attendu"
-
msgid "local zone differs from GMT by a non-minute interval\n"
msgstr ""
"la zone locale diffère du GMT par un intervalle supérieur à une minute\n"
@@ -22085,13 +23094,13 @@ msgstr ""
"Effacez le corps si vous ne souhaitez pas envoyer un résumé.\n"
#, perl-format
-msgid "Failed to open %s: %s"
-msgstr "Échec à l'ouverture de %s : %s"
-
-#, perl-format
msgid "Failed to open %s.final: %s"
msgstr "Échec à l'ouverture de %s.final : %s"
+#, perl-format
+msgid "Failed to open %s: %s"
+msgstr "Échec à l'ouverture de %s : %s"
+
msgid "Summary email is empty, skipping it\n"
msgstr "Le courriel de résumé étant vide, il a été ignoré\n"
@@ -22245,13 +23254,17 @@ msgid "(%s) Could not execute '%s'"
msgstr "(%s) Impossible d'exécuter '%s'"
#, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) Ajout de %s : %s depuis : '%s'\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) Sortie malformée depuis '%s'"
#, perl-format
msgid "(%s) failed to close pipe to '%s'"
msgstr "(%s) échec de la fermeture du pipe vers '%s'"
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) Ajout de %s : %s depuis : '%s'\n"
+
msgid "cannot send message as 7bit"
msgstr "impossible d'envoyer un message comme 7bit"
@@ -22289,5 +23302,158 @@ 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 "--preserve-merges was replaced by --rebase-merges"
-#~ msgstr "--preserve-merges a été remplacé par --rebase-merges"
+#~ msgid "-x and -X cannot be used together"
+#~ msgstr "-x et -X ne peuvent pas être utilisés ensemble"
+
+#~ 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"
+
+#, c-format
+#~ msgid "could not remove reference %s"
+#~ msgstr "impossible de supprimer la référence %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"
diff --git a/po/id.po b/po/id.po
index 794bf8f..3e8b212 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: 2022-06-21 20:20+0000\n"
-"PO-Revision-Date: 2022-06-18 16:30+0700\n"
+"POT-Creation-Date: 2024-02-16 09:36+0700\n"
+"PO-Revision-Date: 2024-02-16 10:45+0700\n"
"Last-Translator: Bagas Sanjaya <bagasdotme@gmail.com>\n"
"Language-Team: Indonesian\n"
"Language: id\n"
@@ -22,23 +22,23 @@ msgstr ""
msgid "Huh (%s)?"
msgstr "Huh (%s)?"
-#: add-interactive.c builtin/rebase.c reset.c sequencer.c
+#: add-interactive.c builtin/merge.c builtin/rebase.c reset.c sequencer.c
msgid "could not read index"
msgstr "tidak dapat membaca indeks"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "binary"
msgstr "biner"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "nothing"
msgstr "tidak ada"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "unchanged"
msgstr "tak berubah"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "Update"
msgstr "Perbarui"
@@ -51,15 +51,15 @@ msgstr "tidak dapat menggelar '%s'"
msgid "could not write index"
msgstr "tidak dapat menulis indeks"
-#: add-interactive.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-interactive.c
+#, c-format
msgid "updated %d path\n"
msgid_plural "updated %d paths\n"
msgstr[0] "%d jalur diperbarui\n"
msgstr[1] "%d jalur diperbarui\n"
-#: add-interactive.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-interactive.c
+#, c-format
msgid "note: %s is untracked now.\n"
msgstr "catatan: %s sekarang tak terlacak.\n"
@@ -68,7 +68,7 @@ msgstr "catatan: %s sekarang tak terlacak.\n"
msgid "make_cache_entry failed for path '%s'"
msgstr "make_cache_entry gagal untuk jalur '%s'"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "Revert"
msgstr "Kembalikan"
@@ -76,24 +76,24 @@ msgstr "Kembalikan"
msgid "Could not parse HEAD^{tree}"
msgstr "Tidak dapat menguraikan HEAD^{tree}"
-#: add-interactive.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-interactive.c
+#, c-format
msgid "reverted %d path\n"
msgid_plural "reverted %d paths\n"
msgstr[0] "%d jalur dikembalikan\n"
msgstr[1] "%d jalur dikembalikan\n"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
#, c-format
msgid "No untracked files.\n"
msgstr "Tidak ada berkas tak terlacak.\n"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "Add untracked"
msgstr "Tambahkan tak terlacak"
-#: add-interactive.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-interactive.c
+#, c-format
msgid "added %d path\n"
msgid_plural "added %d paths\n"
msgstr[0] "%d jalur ditambahkan\n"
@@ -104,21 +104,21 @@ msgstr[1] "%d jalur ditambahkan\n"
msgid "ignoring unmerged: %s"
msgstr "mengabaikan tak tergabung: %s"
-#: add-interactive.c add-patch.c git-add--interactive.perl
+#: add-interactive.c add-patch.c
#, c-format
msgid "Only binary files changed.\n"
msgstr "Hanya berkas biner yang berubah.\n"
-#: add-interactive.c add-patch.c git-add--interactive.perl
+#: add-interactive.c add-patch.c
#, c-format
msgid "No changes.\n"
msgstr "Tidak ada perubahan.\n"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "Patch update"
msgstr "Pembaruan tambalan"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "Review diff"
msgstr "Tinjau diff"
@@ -186,25 +186,25 @@ msgstr "pilih item bernomor"
msgid "(empty) select nothing"
msgstr "(empty) tidak pilih apapun"
-#: add-interactive.c builtin/clean.c git-add--interactive.perl
+#: add-interactive.c builtin/clean.c
msgid "*** Commands ***"
msgstr "*** Perintah ***"
-#: add-interactive.c builtin/clean.c git-add--interactive.perl
+#: add-interactive.c builtin/clean.c
msgid "What now"
msgstr "Apa sekarang"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "staged"
msgstr "tergelar"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "unstaged"
msgstr "tak tergelar"
#: add-interactive.c apply.c builtin/am.c builtin/bugreport.c builtin/clone.c
-#: builtin/fetch.c builtin/merge.c builtin/pull.c builtin/submodule--helper.c
-#: git-add--interactive.perl
+#: builtin/diagnose.c builtin/fetch.c builtin/hook.c builtin/merge.c
+#: builtin/pull.c builtin/submodule--helper.c
msgid "path"
msgstr "jalur"
@@ -212,28 +212,28 @@ msgstr "jalur"
msgid "could not refresh index"
msgstr "tidak dapat menyegarkan indeks"
-#: add-interactive.c builtin/clean.c git-add--interactive.perl
+#: add-interactive.c builtin/clean.c
#, c-format
msgid "Bye.\n"
msgstr "Sampai jumpa.\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stage mode change [y,n,q,a,d%s,?]? "
msgstr "Gelar perubahan mode [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stage deletion [y,n,q,a,d%s,?]? "
msgstr "Gelar penghapusan [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stage addition [y,n,q,a,d%s,?]? "
msgstr "Gelar penambahan [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stage this hunk [y,n,q,a,d%s,?]? "
msgstr "Gelar bingkah ini [y,n,q,a,d%s,?]? "
@@ -259,23 +259,23 @@ msgstr ""
"a - gelar bingkah ini dan semua bingkah selanjutnya dalam berkas\n"
"d - jangan gelar bingkah ini atau bingkah selanjutnya dalam berkas\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stash mode change [y,n,q,a,d%s,?]? "
msgstr "Stase perubahan mode [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stash deletion [y,n,q,a,d%s,?]? "
msgstr "Stase penghapusan [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stash addition [y,n,q,a,d%s,?]? "
msgstr "Stase penambahan [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stash this hunk [y,n,q,a,d%s,?]? "
msgstr "Stase bingkah ini [y,n,q,a,d%s,?]? "
@@ -301,23 +301,23 @@ msgstr ""
"a - stase bingkah ini dan semua bingkah selanjutnya dalam berkas\n"
"d - jangan stase bingkah ini atau bingkah selanjutnya dalam berkas\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Unstage mode change [y,n,q,a,d%s,?]? "
msgstr "Batal gelar perubahan mode [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Unstage deletion [y,n,q,a,d%s,?]? "
msgstr "Batal gelar penghapusan [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Unstage addition [y,n,q,a,d%s,?]? "
msgstr "Batal gelar penambahan [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Unstage this hunk [y,n,q,a,d%s,?]? "
msgstr "Batal gelar bingkah ini [y,n,q,a,d%s,?]? "
@@ -343,23 +343,23 @@ msgstr ""
"a - batal gelar bingkah ini dan semua bingkah selanjutnya dalam berkas\n"
"d - jangan batal gelar bingkah ini atau bingkah selanjutnya dalam berkas\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply mode change to index [y,n,q,a,d%s,?]? "
msgstr "Terapkan perubahan mode ke indeks [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply deletion to index [y,n,q,a,d%s,?]? "
msgstr "Terapkan penghapusan ke indeks [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply addition to index [y,n,q,a,d%s,?]? "
msgstr "Terapkan penambahan ke indeks [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply this hunk to index [y,n,q,a,d%s,?]? "
msgstr "Terapkan bingkah ini ke indeks [y,n,q,a,d%s,?]? "
@@ -385,23 +385,23 @@ msgstr ""
"a - terapkan bingkah ini dan semua bingkah selanjutnya dalam berkas\n"
"d - jangan terapkan bingkah ini atau bingkah selanjutnya dalam berkas\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard mode change from worktree [y,n,q,a,d%s,?]? "
msgstr "Buang perubahan mode dari pohon kerja [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard deletion from worktree [y,n,q,a,d%s,?]? "
msgstr "Buang penghapusan dari pohon kerja [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard addition from worktree [y,n,q,a,d%s,?]? "
msgstr "Buang penambahan dari pohon kerja [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard this hunk from worktree [y,n,q,a,d%s,?]? "
msgstr "Buang bingkah ini dari pohon kerja [y,n,q,a,d%s,?]? "
@@ -427,23 +427,23 @@ msgstr ""
"a - buang hunk ini dan semua bingkah selanjutnya dalam berkas\n"
"d - jangan buang hunk ini atau bingkah selanjutnya dalam berkas\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard mode change from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Buang perubahan mode dari indeks dan pohon kerja [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard deletion from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Buang penghapusan dari indeks dan pohon kerja [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard addition from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Buang penambahan dari indeks dan pohon kerja [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard this hunk from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Buang bingkah ini dari indeks dan pohon kerja [y,n,q,a,d%s,?]? "
@@ -461,25 +461,25 @@ msgstr ""
"a - buang bingkah ini dan semua bingkah selanjutnya dalam berkas\n"
"d - jangan buang bingkah ini atau bingkah selanjutnya dalam berkas\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply mode change to index and worktree [y,n,q,a,d%s,?]? "
-msgstr "Terapkan perubahan mode ke indeks dan pohon kerja [y,n,q,a,d%s,?]? "
+msgstr "Terapkan perubahan mode pada indeks dan pohon kerja [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply deletion to index and worktree [y,n,q,a,d%s,?]? "
-msgstr "Terapkan penghapusan ke indeks dan pohon kerja [y,n,q,a,d%s,?]? "
+msgstr "Terapkan penghapusan pada indeks dan pohon kerja [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply addition to index and worktree [y,n,q,a,d%s,?]? "
-msgstr "Terapkan penambahan ke indeks dan pohon kerja [y,n,q,a,d%s,?]? "
+msgstr "Terapkan penambahan pada indeks dan pohon kerja [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply this hunk to index and worktree [y,n,q,a,d%s,?]? "
-msgstr "Terapkan bingkah ini ke indeks dan pohon kerja [y,n,q,a,d%s,?]? "
+msgstr "Terapkan bingkah ini pada indeks dan pohon kerja [y,n,q,a,d%s,?]? "
#: add-patch.c
msgid ""
@@ -496,6 +496,26 @@ msgstr ""
"d - jangan terapkan bingkah ini atau bingkah selanjutnya dalam berkas\n"
#: add-patch.c
+#, c-format
+msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
+msgstr "Terapkan perubahan mode pada pohon kerja [y,n,q,a,d%s,?]?"
+
+#: add-patch.c
+#, c-format
+msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
+msgstr "Terapkan penghapusan pada pohon kerja [y,n,q,a,d%s,?]?"
+
+#: add-patch.c
+#, c-format
+msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
+msgstr "Terapkan penambahan pada pohon kerja [y,n,q,a,d%s,?]?"
+
+#: add-patch.c
+#, c-format
+msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
+msgstr "Terapkan bingkah ini pada pohon kerja [y,n,q,a,d%s,?]?"
+
+#: add-patch.c
msgid ""
"y - apply this hunk to worktree\n"
"n - do not apply this hunk to worktree\n"
@@ -515,11 +535,6 @@ msgid "could not parse hunk header '%.*s'"
msgstr "tidak dapat menguraikan kepala bingkah '%.*s'"
#: add-patch.c
-#, c-format
-msgid "could not parse colored hunk header '%.*s'"
-msgstr "tidak dapat menguraikan kepala bingkah berwarna '%.*s'"
-
-#: add-patch.c
msgid "could not parse diff"
msgstr "tidak dapat menguraikan diff"
@@ -566,7 +581,7 @@ msgstr ""
"tidak berakhir dengan:\n"
"%.*s"
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "Manual hunk edit mode -- see bottom for a quick guide.\n"
msgstr "Mode sunting bingkah manual -- lihat dibawah untuk panduan cepat.\n"
@@ -583,9 +598,7 @@ msgstr ""
"Untuk menghapus baris '%c', hapuslahnya.\n"
"Baris yang diawali dengan %c akan dihapus.\n"
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: 'it' refers to the patch mentioned in the previous messages.
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid ""
"If it does not apply cleanly, you will be given an opportunity to\n"
"edit again. If all lines of the hunk are removed, then the edit is\n"
@@ -603,21 +616,13 @@ msgstr "tidak dapat menguraikan kepala bingkah"
msgid "'git apply --cached' failed"
msgstr "'git apply --cached' gagal"
-#. #-#-#-#-# add-patch.c.po #-#-#-#-#
#. TRANSLATORS: do not translate [y/n]
#. The program will only accept that input at this point.
#. Consider translating (saying "no" discards!) as
#. (saying "n" for "no" discards!) if the translation
#. of the word "no" does not start with n.
#.
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: do not translate [y/n]
-#. The program will only accept that input
-#. at this point.
-#. Consider translating (saying "no" discards!) as
-#. (saying "n" for "no" discards!) if the translation
-#. of the word "no" does not start with n.
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid ""
"Your edited hunk does not apply. Edit again (saying \"no\" discards!) [y/n]? "
msgstr ""
@@ -626,13 +631,13 @@ msgstr ""
#: add-patch.c
msgid "The selected hunks do not apply to the index!"
-msgstr "Bingkah yang dipilih tidak diterapkan ke indeks!"
+msgstr "Bingkah yang dipilih tidak diterapkan pada indeks!"
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "Apply them to the worktree anyway? "
-msgstr "Tetap terapkan itu ke pohon kerja? "
+msgstr "Tetap terapkan pada pohon kerja? "
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "Nothing was applied.\n"
msgstr "Tidak ada yang diterapkan.\n"
@@ -670,11 +675,11 @@ msgstr "Tidak ada bingkah selanjutnya"
msgid "No other hunks to goto"
msgstr "Tidak ada bingkah lainnya untuk dikunjungi"
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "go to which hunk (<ret> to see more)? "
msgstr "pergi ke bingkah yang mana (<ret> untuk lihat lebih)? "
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "go to which hunk? "
msgstr "pergi ke bingkah yang mana?"
@@ -694,7 +699,7 @@ msgstr[1] "Maaf, hanya %d bingkah yang tersedia."
msgid "No other hunks to search"
msgstr "Tidak ada bingkah lainnya untuk dicari"
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "search for regex? "
msgstr "cari untuk regex? "
@@ -759,9 +764,8 @@ msgid "Reverting is not possible because you have unmerged files."
msgstr "Pembalikkan tidak mungkin sebab Anda punya berkas tak tergabung."
#: advice.c
-#, c-format
-msgid "It is not possible to %s because you have unmerged files."
-msgstr "Tidak mungkin untuk %s sebab Anda punya berkas tak tergabung."
+msgid "Rebasing is not possible because you have unmerged files."
+msgstr "Pendasaran ulang tidak mungkin sebab Anda punya berkas tak tergabung."
#: advice.c
msgid ""
@@ -788,6 +792,25 @@ msgid "Exiting because of unfinished merge."
msgstr "Keluar karena penggabungan belum selesai."
#: advice.c
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"Cabang yang menyebar tidak dapat dimajucepatkan, Anda perlu salah satu "
+"dari:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"atau:\n"
+"\n"
+"\tgit rebase\n"
+
+#: advice.c
msgid "Not possible to fast-forward, aborting."
msgstr "Tidak mungkin untuk maju cepat, batalkan."
@@ -857,6 +880,26 @@ msgstr ""
"ke false\n"
"\n"
+#: advice.c
+#, c-format
+msgid ""
+"The following paths have been moved outside the\n"
+"sparse-checkout definition but are not sparse due to local\n"
+"modifications.\n"
+msgstr ""
+"Jalur berikut sudah dipindahkan di luar definisi sparse-checkout\n"
+"tetapi bukan jarang karena perubahan lokal.\n"
+
+#: advice.c
+msgid ""
+"To correct the sparsity of these paths, do the following:\n"
+"* Use \"git add --sparse <paths>\" to update the index\n"
+"* Use \"git sparse-checkout reapply\" to apply the sparsity rules"
+msgstr ""
+"Untuk memperbaiki kejarangan jalur tersebut, lakukan hal-hal berikut:\n"
+"* Gunakan \"git add --sparse <jalur>\" untuk memperbarui indeks\n"
+"* Gunakan \"git sparse-checkout reapply\" untuk menerapkan aturan kejarangan"
+
#: alias.c
msgid "cmdline ends with \\"
msgstr "baris perintah diakhiri dengan \\"
@@ -865,6 +908,11 @@ msgstr "baris perintah diakhiri dengan \\"
msgid "unclosed quote"
msgstr "tanda kutip tak ditutup"
+#: alias.c builtin/cat-file.c builtin/notes.c builtin/prune-packed.c
+#: builtin/receive-pack.c builtin/tag.c t/helper/test-pkt-line.c
+msgid "too many arguments"
+msgstr "terlalu banyak argumen"
+
#: apply.c
#, c-format
msgid "unrecognized whitespace option '%s'"
@@ -875,14 +923,16 @@ msgstr "opsi spasi putih tidak dikenal '%s'"
msgid "unrecognized whitespace ignore option '%s'"
msgstr "opsi abai spasi putih tidak dikenal '%s'"
-#: apply.c archive.c builtin/add.c builtin/branch.c builtin/checkout.c
-#: builtin/clone.c builtin/commit.c builtin/describe.c builtin/diff-tree.c
-#: builtin/difftool.c builtin/fast-export.c builtin/fetch.c builtin/help.c
-#: builtin/index-pack.c builtin/init-db.c builtin/log.c builtin/ls-files.c
-#: builtin/merge-base.c builtin/merge.c builtin/pack-objects.c builtin/push.c
-#: builtin/rebase.c builtin/repack.c builtin/reset.c builtin/rev-list.c
-#: builtin/show-branch.c builtin/stash.c builtin/submodule--helper.c
-#: builtin/tag.c builtin/worktree.c parse-options.c range-diff.c revision.c
+#: 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
+#: builtin/describe.c builtin/diff-tree.c builtin/difftool.c
+#: builtin/fast-export.c builtin/fetch.c builtin/help.c builtin/index-pack.c
+#: builtin/init-db.c builtin/log.c builtin/ls-files.c builtin/merge-base.c
+#: builtin/merge-tree.c builtin/merge.c builtin/pack-objects.c builtin/rebase.c
+#: builtin/repack.c builtin/replay.c builtin/reset.c builtin/rev-list.c
+#: builtin/rev-parse.c builtin/show-branch.c builtin/stash.c
+#: builtin/submodule--helper.c builtin/tag.c builtin/worktree.c parse-options.c
+#: range-diff.c revision.c
#, c-format
msgid "options '%s' and '%s' cannot be used together"
msgstr "Opsi '%s' dan '%s' tidak dapat digunakan bersamaan"
@@ -893,6 +943,14 @@ msgid "'%s' outside a repository"
msgstr "'%s' di luar repositori"
#: apply.c
+msgid "failed to read patch"
+msgstr "gagal membaca tambalan"
+
+#: apply.c
+msgid "patch too large"
+msgstr "tambalan terlalu besar"
+
+#: apply.c
#, c-format
msgid "Cannot prepare timestamp regexp %s"
msgstr "Tidak dapat menyiapkan ekspresi reguler stempel waktu %s"
@@ -1097,7 +1155,7 @@ msgstr ""
msgid "patch failed: %s:%ld"
msgstr "tambalan gagal: %s:%ld"
-#: apply.c
+#: apply.c builtin/mv.c
#, c-format
msgid "cannot checkout %s"
msgstr "tidak dapat men-checkout %s"
@@ -1268,7 +1326,7 @@ msgstr ""
msgid "unable to add cache entry for %s"
msgstr "tidak dapat menambahkan entri tembolok untuk %s"
-#: apply.c builtin/bisect--helper.c builtin/gc.c
+#: apply.c builtin/bisect.c builtin/gc.c
#, c-format
msgid "failed to write to '%s'"
msgstr "gagal menulis ke '%s'"
@@ -1309,6 +1367,11 @@ msgstr "memotong nama berkas .rej ke %.*s.rej"
msgid "cannot open %s"
msgstr "tidak dapat membuka %s"
+#: apply.c rerere.c
+#, c-format
+msgid "cannot unlink '%s'"
+msgstr "tidak dapat batal taut '%s'"
+
#: apply.c
#, c-format
msgid "Hunk #%d applied cleanly."
@@ -1329,7 +1392,7 @@ msgid "No valid patches in input (allow with \"--allow-empty\")"
msgstr ""
"Tidak ada tambalan valid dalam masukan (perbolehkan dengan \"--allow-empty\")"
-#: apply.c
+#: apply.c t/helper/test-cache-tree.c
msgid "unable to read index file"
msgstr "tidak dapa membaca berkas indeks"
@@ -1359,7 +1422,7 @@ msgid_plural "%d lines applied after fixing whitespace errors."
msgstr[0] "%d baris diterapkan setelah memperbaiki kesalahan spasi putih."
msgstr[1] "%d baris diterapkan setelah memperbaiki kesalahan spasi putih."
-#: apply.c builtin/add.c builtin/mv.c builtin/rm.c
+#: apply.c builtin/mv.c builtin/rm.c
msgid "Unable to write new index file"
msgstr "Tidak dapat menulis berkas indeks baru"
@@ -1495,6 +1558,11 @@ msgstr "tidak dapat mengaruskan blob %s"
msgid "unsupported file mode: 0%o (SHA1: %s)"
msgstr "mode berkas tidak didukung: 0%o (SHA1: %s)"
+#: archive-tar.c archive-zip.c builtin/pack-objects.c
+#, c-format
+msgid "deflate error (%d)"
+msgstr "kesalahan deflasi (%d)"
+
#: archive-tar.c
#, c-format
msgid "unable to start '%s' filter"
@@ -1519,11 +1587,6 @@ msgstr "jalur bukan UTF-8 valid: %s"
msgid "path too long (%d chars, SHA1: %s): %s"
msgstr "jalur terlalu panjang (%d karakter, SHA1: %s): %s"
-#: archive-zip.c builtin/pack-objects.c
-#, c-format
-msgid "deflate error (%d)"
-msgstr "kesalahan deflasi (%d)"
-
#: archive-zip.c
#, c-format
msgid "timestamp too large for this system: %<PRIuMAX>"
@@ -1549,6 +1612,11 @@ msgstr "git archive --remote <repo> [--exec <perintah>] --list"
msgid "cannot read '%s'"
msgstr "tidak dapat membaca '%s'"
+#: archive.c
+#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr "spek jalur '%s' mencocoki berkas di luar direktori saat ini"
+
#: archive.c builtin/add.c builtin/rm.c
#, c-format
msgid "pathspec '%s' did not match any files"
@@ -1564,16 +1632,12 @@ msgstr "tidak ada referensi seperti: %.*s"
msgid "not a valid object name: %s"
msgstr "bukan nama objek valid: %s"
-#: archive.c
+#: archive.c t/helper/test-cache-tree.c
#, c-format
msgid "not a tree object: %s"
msgstr "bukan objek pohon: %s"
#: archive.c
-msgid "current working directory is untracked"
-msgstr "direktori kerja saat ini tak terlacak"
-
-#: archive.c
#, c-format
msgid "File not found: %s"
msgstr "Berkas tidak ditemukan: %s"
@@ -1606,7 +1670,7 @@ msgstr "fmt"
msgid "archive format"
msgstr "format arsip"
-#: archive.c builtin/log.c
+#: archive.c builtin/log.c parse-options.h
msgid "prefix"
msgstr "prefiks"
@@ -1615,7 +1679,7 @@ msgid "prepend prefix to each pathname in the archive"
msgstr "tambahkan prefiks di depan setiap nama jalur dalam arsip"
#: archive.c builtin/blame.c builtin/commit-tree.c builtin/config.c
-#: builtin/fast-export.c builtin/grep.c builtin/hash-object.c
+#: builtin/fast-export.c builtin/gc.c builtin/grep.c builtin/hash-object.c
#: builtin/ls-files.c builtin/notes.c builtin/read-tree.c parse-options.h
msgid "file"
msgstr "berkas"
@@ -1640,6 +1704,15 @@ msgstr "baca .gitattributes dalam direktori kerja"
msgid "report archived files on stderr"
msgstr "laporkan berkas terarsip ke error standar"
+#: archive.c builtin/clone.c builtin/fetch.c builtin/pack-objects.c
+#: builtin/pull.c
+msgid "time"
+msgstr "waktu"
+
+#: archive.c
+msgid "set modification time of archive entries"
+msgstr "setel waktu modifikasi entri arsip"
+
#: archive.c
msgid "set compression level"
msgstr "setel level kompresi"
@@ -1682,6 +1755,11 @@ msgstr "Opsi --output tak diharapkan"
#: archive.c
#, c-format
+msgid "extra command line parameter '%s'"
+msgstr "parameter konfigurasi tambahan: '%s'"
+
+#: archive.c
+#, c-format
msgid "Unknown archive format '%s'"
msgstr "Format arsip tidak dikenal '%s'"
@@ -1696,6 +1774,15 @@ msgid "%.*s is not a valid attribute name"
msgstr "%.*s bukan sebuah nama atribut valid"
#: attr.c
+msgid "unable to add additional attribute"
+msgstr "Tidak dapat menambahkan atribut tambahan"
+
+#: attr.c
+#, c-format
+msgid "ignoring overly long attributes line %d"
+msgstr "mengabaikan baris atribut ke-%d yang terlalu panjang"
+
+#: attr.c
#, c-format
msgid "%s not allowed: %s:%d"
msgstr "%s tidak diperbolehkan: %s:%d"
@@ -1708,6 +1795,36 @@ msgstr ""
"Pola negatif diabaikan di atribut git\n"
"Gunakan '\\!' untuk tanda seru awal literal."
+#: attr.c
+#, c-format
+msgid "cannot fstat gitattributes file '%s'"
+msgstr "tidak dapat menulis berkas gitattributes '%s'"
+
+#: attr.c
+#, c-format
+msgid "ignoring overly large gitattributes file '%s'"
+msgstr "mengabaikan berkas gitattributes yang terlalu besar '%s'"
+
+#: attr.c
+#, c-format
+msgid "ignoring overly large gitattributes blob '%s'"
+msgstr "mengabaikan blob gitattributes '%s' yang terlalu besar"
+
+#: attr.c
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "--attr-source atau GIT_ATTR_SOURCE jelek"
+
+#: attr.c read-cache.c
+#, c-format
+msgid "unable to stat '%s'"
+msgstr "tidak dapat men-stat '%s'"
+
+#: bisect.c builtin/cat-file.c builtin/index-pack.c builtin/notes.c
+#: builtin/pack-objects.c combine-diff.c rerere.c
+#, c-format
+msgid "unable to read %s"
+msgstr "tidak dapat membaca %s"
+
#: bisect.c
#, c-format
msgid "Badly quoted content in file '%s': %s"
@@ -1832,17 +1949,13 @@ msgid "--contents and --reverse do not blend well."
msgstr "--contents dan --reverse tidak dapat dipadu dengan baik."
#: blame.c
-msgid "cannot use --contents with final commit object name"
-msgstr "tidak dapat menggunakan --contents dengan nama objek komit final"
-
-#: blame.c
msgid "--reverse and --first-parent together require specified latest commit"
msgstr ""
"--reverse dan --first-parent bersama-sama butuh komit terbaru yang disebutkan"
#: blame.c builtin/commit.c builtin/log.c builtin/merge.c
-#: builtin/pack-objects.c builtin/shortlog.c bundle.c midx.c ref-filter.c
-#: remote.c sequencer.c submodule.c
+#: builtin/pack-objects.c builtin/shortlog.c midx.c pack-bitmap.c remote.c
+#: sequencer.c submodule.c
msgid "revision walk setup failed"
msgstr "persiapan jalan revisi gagal"
@@ -1937,7 +2050,7 @@ msgstr "tak melacak: informasi ambigu untuk referensi '%s'"
#: branch.c object-name.c
#, c-format
msgid " %s\n"
-msgstr ""
+msgstr " %s\n"
#. TRANSLATORS: The second argument is a \n-delimited list of
#. duplicate refspecs, composed above.
@@ -1954,6 +2067,13 @@ msgid ""
"different remotes' fetch refspecs map into different\n"
"tracking namespaces."
msgstr ""
+"Ada banyak remote yang spek referensi pengambilan terpetakan ke referensi\n"
+"pelacak remote '%s'\n"
+"%s\n"
+"Hal ini biasanya merupakan kesalahan konfigurasi.\n"
+"\n"
+"Untuk mendukung menyetel cabang pelacakan, pastikan bahwa spek referensi\n"
+"remote yang berbeda terpetakan ke ruang nama pelacakan yang berbeda."
#: branch.c
#, c-format
@@ -1967,8 +2087,10 @@ msgstr "sebuah cabang bernama '%s' sudah ada"
#: branch.c
#, c-format
-msgid "cannot force update the branch '%s' checked out at '%s'"
-msgstr "tidak dapat memperbarui paksa cabang '%s' yang ter-check out pada '%s'"
+msgid "cannot force update the branch '%s' used by worktree at '%s'"
+msgstr ""
+"tidak dapat memperbarui paksa cabang '%s' yang yang digunakan oleh pohon "
+"kerja pada '%s'"
#: branch.c
#, c-format
@@ -1993,6 +2115,14 @@ msgid ""
"will track its remote counterpart, you may want to use\n"
"\"git push -u\" to set the upstream config as you push."
msgstr ""
+"\n"
+"Jika Anda berencana mendasarkan karya Anda pada sebuah cabang hulu\n"
+"yang sudah ada pada remote, Anda mungkin perlu menjalankan\n"
+"\"git fetch\" untuk mendapatkannya.\n"
+"\n"
+"Jika Anda berencana mendorong sebuah cabang lokal baru yang akan melacak\n"
+"pasangan remotenya, Anda dapat menggunakan \"git push -u\" untuk menyetel\n"
+"konfigurasi hulu saat Anda dorong."
#: branch.c builtin/replace.c
#, c-format
@@ -2017,11 +2147,11 @@ msgstr "submodul '%s': tidak dapat menemukan submodul"
#: branch.c
#, c-format
msgid ""
-"You may try updating the submodules using 'git checkout %s && git submodule "
-"update --init'"
+"You may try updating the submodules using 'git checkout --no-recurse-"
+"submodules %s && git submodule update --init'"
msgstr ""
-"Anda dapat mencoba memperbarui submodul dengan 'git checkout %s && git "
-"submodule update --init'"
+"Anda dapat mencoba memperbarui submodul dengan 'git checkout --no-recurse-"
+"submodules %s && git submodule update --init'"
#: branch.c
#, c-format
@@ -2030,13 +2160,8 @@ msgstr "submodul '%s': tidak dapat membuat cabang '%s'"
#: branch.c
#, c-format
-msgid "'%s' is already checked out at '%s'"
-msgstr "'%s' sudah di-checkout pada '%s'"
-
-#: branch.c
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "HEAD dari pohon kerja %s tidak diperbarui"
+msgid "'%s' is already used by worktree at '%s'"
+msgstr "'%s' sudah digunakan oleh pohon kerja di '%s'"
#: builtin/add.c
msgid "git add [<options>] [--] <pathspec>..."
@@ -2048,48 +2173,38 @@ msgid "cannot chmod %cx '%s'"
msgstr "tidak dapat chmod %cx '%s'"
#: builtin/add.c
-#, c-format
-msgid "unexpected diff status %c"
-msgstr "status diff tak diharapkan %c"
-
-#: builtin/add.c builtin/commit.c
-msgid "updating files failed"
-msgstr "gagal memperbarui berkas"
-
-#: builtin/add.c
-#, c-format
-msgid "remove '%s'\n"
-msgstr "hapus '%s'\n"
-
-#: builtin/add.c
msgid "Unstaged changes after refreshing the index:"
msgstr "Perubahan tak tergelar setelah menyegarkan indeks:"
-#: builtin/add.c builtin/rev-parse.c
-msgid "Could not read the index"
-msgstr "Tidak dapat membaca indeks"
+#: builtin/add.c
+msgid ""
+"the add.interactive.useBuiltin setting has been removed!\n"
+"See its entry in 'git help config' for details."
+msgstr ""
+"setelan add.interactive.useBuiltin sudah dihapus!\n"
+"Selengkapnya lihat entrinya di 'git help config'."
#: builtin/add.c
-msgid "Could not write patch"
-msgstr "Tidak dapat menulis tambalan"
+msgid "could not read the index"
+msgstr "tidak dapat membaca indeks"
#: builtin/add.c
msgid "editing patch failed"
msgstr "Gagal menyunting tambalan"
-#: builtin/add.c
+#: builtin/add.c read-cache.c
#, c-format
-msgid "Could not stat '%s'"
-msgstr "Tidak dapat men-stat '%s'"
+msgid "could not stat '%s'"
+msgstr "tidak dapat men-stat '%s'"
#: builtin/add.c
-msgid "Empty patch. Aborted."
-msgstr "Tambalan kosong. Dibatalkan."
+msgid "empty patch. aborted"
+msgstr "tambalan kosong, dibatalkan"
#: builtin/add.c
#, c-format
-msgid "Could not apply '%s'"
-msgstr "Tidak dapat terapkan '%s'"
+msgid "could not apply '%s'"
+msgstr "tidak dapat menerapkan '%s'"
#: builtin/add.c
msgid "The following paths are ignored by one of your .gitignore files:\n"
@@ -2248,19 +2363,24 @@ msgstr ""
#: builtin/reset.c builtin/rm.c builtin/submodule--helper.c read-cache.c
#: rerere.c submodule.c
msgid "index file corrupt"
-msgstr ""
+msgstr "berkas indeks rusak"
+
+#: builtin/add.c builtin/am.c builtin/checkout.c builtin/clone.c
+#: builtin/commit.c builtin/stash.c merge.c rerere.c
+msgid "unable to write new index file"
+msgstr "gagal menulis berkas indeks baru"
#: builtin/am.c builtin/mailinfo.c mailinfo.c
#, c-format
msgid "bad action '%s' for '%s'"
-msgstr ""
+msgstr "tindakan jelek '%s' untuk '%s'"
#: builtin/am.c builtin/blame.c builtin/fetch.c builtin/pack-objects.c
-#: builtin/pull.c diff-merges.c gpg-interface.c ls-refs.c parallel-checkout.c
-#: sequencer.c setup.c
+#: builtin/pull.c config.c diff-merges.c gpg-interface.c ls-refs.c
+#: parallel-checkout.c sequencer.c setup.c
#, c-format
msgid "invalid value for '%s': '%s'"
-msgstr ""
+msgstr "nilai tidak valid untuk '%s': '%s'"
#: builtin/am.c builtin/commit.c builtin/merge.c sequencer.c
#, c-format
@@ -2274,7 +2394,7 @@ msgstr "tidak dapat mengurai skrip pengarang"
#: builtin/am.c builtin/replace.c commit.c sequencer.c
#, c-format
msgid "could not parse %s"
-msgstr ""
+msgstr "tidak dapat menguraikan %s"
#: builtin/am.c
#, c-format
@@ -2300,7 +2420,7 @@ msgstr "fseek gagal"
msgid "could not open '%s' for reading"
msgstr "tidak dapat membuka '%s' untuk dibaca"
-#: builtin/am.c builtin/rebase.c strbuf.c wrapper.c
+#: builtin/am.c builtin/rebase.c editor.c sequencer.c wrapper.c
#, c-format
msgid "could not open '%s' for writing"
msgstr "tidak dapat membuka '%s' untuk ditulis"
@@ -2384,7 +2504,7 @@ msgstr "baris identitas tidak valid: %.*s"
#: builtin/am.c builtin/checkout.c builtin/clone.c commit-graph.c
#, c-format
msgid "unable to parse commit %s"
-msgstr ""
+msgstr "tidak dapat menguraikan komit %s"
#: builtin/am.c
msgid "Repository lacks necessary blobs to fall back on 3-way merge."
@@ -2420,8 +2540,7 @@ msgstr "git write-tree gagal menulis sebuah pohon"
msgid "applying to an empty history"
msgstr "menerapkan ke sebuah riwayat kosong"
-#: builtin/am.c builtin/commit.c builtin/merge.c sequencer.c
-#: t/helper/test-fast-rebase.c
+#: builtin/am.c builtin/commit.c builtin/merge.c builtin/replay.c sequencer.c
msgid "failed to write commit object"
msgstr "gagal menulis objek komit"
@@ -2513,11 +2632,6 @@ msgstr ""
"Anda mungkin jalankan `git rm` pada berkas untuk menerima \"penghapusan oleh "
"mereka\" untuk itu."
-#: builtin/am.c builtin/checkout.c builtin/clone.c builtin/stash.c merge.c
-#: rerere.c
-msgid "unable to write new index file"
-msgstr "gagal menulis berkas indeks baru"
-
#: builtin/am.c builtin/reset.c
#, c-format
msgid "Could not parse object '%s'."
@@ -2535,17 +2649,12 @@ msgstr ""
"Sepertinya Anda telah memindahkan HEAD sejak kegagalan 'am' terakhir.\n"
"Tidak memutar ulang ke ORIG_HEAD"
-#: builtin/am.c builtin/bisect--helper.c worktree.c
+#: builtin/am.c builtin/bisect.c worktree.c
#, c-format
msgid "failed to read '%s'"
msgstr "gagal membaca '%s'"
#: builtin/am.c
-#, c-format
-msgid "options '%s=%s' and '%s=%s' cannot be used together"
-msgstr "Opsi '%s=%s' dan '%s=%s' tidak dapat digunakan bersamaan"
-
-#: builtin/am.c
msgid "git am [<options>] [(<mbox> | <Maildir>)...]"
msgstr "git am [<opsi>] [(<mbox> | <Maildir>)...]"
@@ -2558,6 +2667,10 @@ msgid "run interactively"
msgstr "jalankan secara interaktif"
#: builtin/am.c
+msgid "bypass pre-applypatch and applypatch-msg hooks"
+msgstr "lewati kail pre-applypatch dan applypatch-msg"
+
+#: builtin/am.c
msgid "historical option -- no-op"
msgstr "opsi bersejarah -- no-op"
@@ -2595,11 +2708,6 @@ msgid "pass --keep-cr flag to git-mailsplit for mbox format"
msgstr "lewatkan opsi --keep-cr ke git-mailsplit untuk format mbox"
#: builtin/am.c
-msgid "do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"
-msgstr ""
-"jangan lewatkan opsi --keep-cr ke git-mailsplit tak bergantung pada am.keepcr"
-
-#: builtin/am.c
msgid "strip everything before a scissors line"
msgstr "copot semuanya sebelum garis gunting"
@@ -2618,7 +2726,8 @@ msgid "n"
msgstr "n"
#: builtin/am.c builtin/branch.c builtin/bugreport.c builtin/cat-file.c
-#: builtin/for-each-ref.c builtin/ls-tree.c builtin/replace.c builtin/tag.c
+#: builtin/clone.c builtin/diagnose.c builtin/for-each-ref.c builtin/init-db.c
+#: builtin/ls-files.c builtin/ls-tree.c builtin/replace.c builtin/tag.c
#: builtin/verify-tag.c
msgid "format"
msgstr "format"
@@ -2723,7 +2832,7 @@ msgstr "mode interaktif butuh tambalan pada baris perintah"
msgid "git apply [<options>] [<patch>...]"
msgstr "git apply [<opsi>] [<tambalan>...]"
-#: builtin/archive.c contrib/scalar/scalar.c
+#: builtin/archive.c diagnose.c
msgid "could not redirect output"
msgstr "tidak dapat mengalihkan keluaran"
@@ -2748,112 +2857,106 @@ msgstr "git archive: kesalahan protokol"
msgid "git archive: expected a flush"
msgstr "git archive: sebuah bilasan diharapkan"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-reset [<commit>]"
-msgstr "git bisect--helper --bisect-reset [<komit>]"
-
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<term> --term-{old,good}"
-"=<term>] [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] "
-"[<paths>...]"
+"git bisect start [--term-(new|bad)=<term> --term-(old|good)=<term>] [--no-"
+"checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]"
msgstr ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<istilah> --term-{old,"
-"good}=<istilah>] [--no-checkout] [--first-parent] [<jelek> [<bagus>...]] "
-"[--] [<jalur>...]"
+"git bisect start [--term-(new,bad)=<istilah> --term-(old, good)=<istilah>] "
+"[--no-checkout] [--first-parent] [<jelek> [<bagus>...]] [--] [<jalur>...]"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-state (bad|new) [<rev>]"
-msgstr "git bisect--helper --bisect-state (bad|new) [<revisi>]"
+#: builtin/bisect.c
+msgid "git bisect (good|bad) [<rev>...]"
+msgstr "git bisect (good|bad) [<revisi>...]"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-state (good|old) [<rev>...]"
-msgstr "git bisect--helper --bisect-state (good|old) [<revisi>...]"
+#: builtin/bisect.c
+msgid "git bisect skip [(<rev>|<range>)...]"
+msgstr "git bisect skip [(<revisi>|<rentang>)...]"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-replay <filename>"
-msgstr "git bisect--helper --bisect-replay <nama berkas>"
+#: builtin/bisect.c
+msgid "git bisect reset [<commit>]"
+msgstr "git bisect reset [<komit>]"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-skip [(<rev>|<range>)...]"
-msgstr "git bisect--helper --bisect-skip [(<revisi>|<rentang>)...]"
+#: builtin/bisect.c
+msgid "git bisect replay <logfile>"
+msgstr "git bisect replay <berkas log>"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-run <cmd>..."
-msgstr "git bisect--helper --bisect-run <perintah>..."
+#: builtin/bisect.c
+msgid "git bisect run <cmd> [<arg>...]"
+msgstr "git bisect run <perintah> [<argumen>...]"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "cannot open file '%s' in mode '%s'"
msgstr "tidak dapat membuka berkas '%s' dalam mode '%s'"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "could not write to file '%s'"
msgstr "tidak dapat menulis ke berkas '%s'"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "cannot open file '%s' for reading"
msgstr "tidak dapat membuka berkas '%s' untuk dibaca"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "'%s' is not a valid term"
msgstr "'%s' bukan istilah yang valid"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "can't use the builtin command '%s' as a term"
msgstr "tidak dapat menggunakan perintah bawaan '%s' sebagai istilah"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "can't change the meaning of the term '%s'"
msgstr "tidak dapat mengubah makna istilah '%s'"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "please use two different terms"
msgstr "mohon gunakan dua istilah yang berbeda"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "We are not bisecting.\n"
msgstr "Kami tidak sedang membagi dua.\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "'%s' is not a valid commit"
msgstr "'%s' bukan sebuah komit yang valid"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid ""
"could not check out original HEAD '%s'. Try 'git bisect reset <commit>'."
msgstr ""
"tidak dapat men-checkout HEAD asli '%s'. Coba 'git bisect reset <komit>'."
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "Bad bisect_write argument: %s"
msgstr "argument bisect_write jelek: %s"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "couldn't get the oid of the rev '%s'"
msgstr "tidak dapat mendapatkan oid revisi '%s'"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "couldn't open the file '%s'"
msgstr "tidak dapat membuka berkas '%s'"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "Invalid command: you're currently in a %s/%s bisect"
msgstr "Perintah tidak valid: sekarang Anda berada dalam pembagian dua %s/%s"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid ""
"You need to give me at least one %s and %s revision.\n"
@@ -2862,7 +2965,7 @@ msgstr ""
"Anda perlu berikan saya setidaknya satu revisi %s dan %s.\n"
"Untuk itu Anda dapat menggunakan \"git bisect %s\" dan \"git bisect %s\"."
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid ""
"You need to start by \"git bisect start\".\n"
@@ -2873,7 +2976,7 @@ msgstr ""
"Lalu Anda perlu berikan saya setidaknya satu revisi %s dan %s.\n"
"Untuk itu Anda dapat menggunakan \"git bisect %s\" dan \"git bisect %s\"."
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "bisecting only with a %s commit"
msgstr "membagi dua hanya dengan sebuah komit %s"
@@ -2882,30 +2985,30 @@ msgstr "membagi dua hanya dengan sebuah komit %s"
#. translation. The program will only accept English input
#. at this point.
#.
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "Are you sure [Y/n]? "
msgstr "Anda yakin [Y/n]?"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "status: waiting for both good and bad commits\n"
msgstr "status: menunggu komit bagus dan jelek\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "status: waiting for bad commit, %d good commit known\n"
msgid_plural "status: waiting for bad commit, %d good commits known\n"
msgstr[0] "status: menunggu komit jelek, %d komit bagus diketahui\n"
msgstr[1] "status: menunggu komit jelek, %d komit bagus diketahui\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "status: waiting for good commit(s), bad commit known\n"
msgstr "status: menunggu komit bagus, komit jelek diketahui\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "no terms defined"
msgstr "tidak ada istilah yang didefinisikan"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid ""
"Your current terms are %s for the old state\n"
@@ -2914,7 +3017,7 @@ msgstr ""
"Istilah Anda saat ini adalah %s untuk keadaan lama\n"
"dan %s untuk keadaan baru.\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid ""
"invalid argument %s for 'git bisect terms'.\n"
@@ -2923,52 +3026,48 @@ msgstr ""
"argumen %s tidak valid untuk 'git bisect terms'.\n"
"Opsi yang didukung adalah: --term-good|--term-old dan --term-bad|--term-new."
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "revision walk setup failed\n"
msgstr "setup jalan revisi gagal\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "could not open '%s' for appending"
msgstr "tidak dapat membuka '%s' untuk menambahkan"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "'' is not a valid term"
msgstr "'' bukan istilah yang valid"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "unrecognized option: '%s'"
msgstr "opsi tidak dikenal: '%s'"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "'%s' does not appear to be a valid revision"
msgstr "'%s' sepertinya bukan revisi valid"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "bad HEAD - I need a HEAD"
msgstr "HEAD jelek - saya butuh HEAD"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "checking out '%s' failed. Try 'git bisect start <valid-branch>'."
msgstr "gagal men-checkout '%s'. Coba 'git bisect start <cabang valid>'."
-#: builtin/bisect--helper.c
-msgid "won't bisect on cg-seek'ed tree"
-msgstr "tidak akan membagi dua pada pohon yang di-cg-seek"
-
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "bad HEAD - strange symbolic ref"
msgstr "HEAD jelek - referensi simbolik aneh"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "invalid ref: '%s'"
msgstr "referensi tidak valid: '%s'"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "You need to start by \"git bisect start\"\n"
msgstr "Anda perlu memulai dengan \"git bisect start\"\n"
@@ -2976,168 +3075,131 @@ msgstr "Anda perlu memulai dengan \"git bisect start\"\n"
#. translation. The program will only accept English input
#. at this point.
#.
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "Do you want me to do it for you [Y/n]? "
msgstr "Anda ingin saya melakukannya untuk Anda [Y/n]"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "Please call `--bisect-state` with at least one argument"
msgstr "Mohon panggil `--bisect-state` dengan setidaknya satu argumen"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "'git bisect %s' can take only one argument."
msgstr "'git bisect %s' hanya dapat mengambil satu argumen."
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "Bad rev input: %s"
msgstr "Masukan revisi jelek: %s"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "Bad rev input (not a commit): %s"
msgstr "Masukan revisi jelek (bukan sebuah komit): %s"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "We are not bisecting."
msgstr "Kami tidak sedang membagi dua."
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "'%s'?? what are you talking about?"
msgstr "'%s'?? Anda bilang tentang apa?"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "cannot read file '%s' for replaying"
msgstr "tidak dapat membuka berkas '%s' untuk memainkan ulang"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "running %s\n"
msgstr "menjalankan %s\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "bisect run failed: no command provided."
msgstr "bisect run gagal: tidak ada perintah yang diberikan"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
-msgid "unable to verify '%s' on good revision"
-msgstr "tidak dapat memverifikasi '%s' pada revisi bagus"
+msgid "unable to verify %s on good revision"
+msgstr "tidak dapat memverifikasi %s pada revisi bagus"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "bogus exit code %d for good revision"
msgstr "kode keluar gadungan %d untuk revisi bagu"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
-msgid "bisect run failed: exit code %d from '%s' is < 0 or >= 128"
-msgstr "bisect run gagal: kode keluar %d dari '%s' < 0 atau >= 128"
+msgid "bisect run failed: exit code %d from %s is < 0 or >= 128"
+msgstr "bisect run gagal: kode keluar %d dari %s < 0 atau >= 128"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "cannot open file '%s' for writing"
msgstr "tidak dapat membuka berkas '%s' untuk ditulis"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "bisect run cannot continue any more"
msgstr "bisect run tidak dapat dilanjutkan lagi"
-#: builtin/bisect--helper.c
-#, c-format
+#: builtin/bisect.c
msgid "bisect run success"
msgstr "bisect run sukses"
-#: builtin/bisect--helper.c
-#, c-format
+#: builtin/bisect.c
msgid "bisect found first bad commit"
msgstr "pembagian dua menemukan komit jelek pertama"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
-msgid ""
-"bisect run failed: 'git bisect--helper --bisect-state %s' exited with error "
-"code %d"
-msgstr ""
-"bisect run gagal: 'git bisect--helper --bisect-state %s' keluar dengan kode "
-"keluar %d"
-
-#: builtin/bisect--helper.c
-msgid "reset the bisection state"
-msgstr "setel ulang keadaan pembagian dua"
+msgid "bisect run failed: 'git bisect %s' exited with error code %d"
+msgstr "bisect run gagal: 'git bisect %s' keluar dengan kode keluar %d"
-#: builtin/bisect--helper.c
-msgid "check whether bad or good terms exist"
-msgstr "periksa apakah ada istilah jelek atau bagus"
-
-#: builtin/bisect--helper.c
-msgid "print out the bisect terms"
-msgstr "cetak istilah pembagian dua"
-
-#: builtin/bisect--helper.c
-msgid "start the bisect session"
-msgstr "mulai sesi pembagian dua"
-
-#: builtin/bisect--helper.c
-msgid "find the next bisection commit"
-msgstr "temukan komit pembagian dua berikutnya"
-
-#: builtin/bisect--helper.c
-msgid "mark the state of ref (or refs)"
-msgstr "tandai keadaan referensi"
-
-#: builtin/bisect--helper.c
-msgid "list the bisection steps so far"
-msgstr "daftar langkah pembagian dua sejauh ini"
-
-#: builtin/bisect--helper.c
-msgid "replay the bisection process from the given file"
-msgstr "mainkan ulang proses pembagian dua dari berkas yang diberikan"
-
-#: builtin/bisect--helper.c
-msgid "skip some commits for checkout"
-msgstr "lewati beberapa komit untuk checkout"
-
-#: builtin/bisect--helper.c
-msgid "visualize the bisection"
-msgstr "visualisasikan pembagian dua"
-
-#: builtin/bisect--helper.c
-msgid "use <cmd>... to automatically bisect"
-msgstr "gunakan <cmd>... untuk bagi dua otomatis."
+#: builtin/bisect.c
+#, c-format
+msgid "'%s' requires either no argument or a commit"
+msgstr "'%s' perlu baik tanpa argumen atau sebuah komit"
-#: builtin/bisect--helper.c
-msgid "no log for BISECT_WRITE"
-msgstr "tidak ada log untuk BISECT_WRITE"
+#: builtin/bisect.c
+#, c-format
+msgid "'%s' requires 0 or 1 argument"
+msgstr "%s perlu sebuah argumen"
-#: builtin/bisect--helper.c
-msgid "--bisect-reset requires either no argument or a commit"
-msgstr "--bisect-reset butuh baik tanpa argumen atau sebuah komit"
+#: builtin/bisect.c
+#, c-format
+msgid "'%s' requires 0 arguments"
+msgstr "'%s' butuh tanpa argumen"
-#: builtin/bisect--helper.c
-msgid "--bisect-terms requires 0 or 1 argument"
-msgstr "--bisect-terms butuh 0 atau 1 argumen"
+#: builtin/bisect.c
+msgid "no logfile given"
+msgstr "tidak ada berkas log yang diberikan"
-#: builtin/bisect--helper.c
-msgid "--bisect-next requires 0 arguments"
-msgstr "--bisect-next butuh 0 argumen"
+#: builtin/bisect.c
+#, c-format
+msgid "'%s' failed: no command provided."
+msgstr "'%s' gagal: tidak ada perintah yang diberikan."
-#: builtin/bisect--helper.c
-msgid "--bisect-log requires 0 arguments"
-msgstr "--bisect-log butuh 0 argumen"
+#: builtin/bisect.c
+msgid "need a command"
+msgstr "butuh sebuah perintah"
-#: builtin/bisect--helper.c
-msgid "no logfile given"
-msgstr "tidak ada berkas log yang diberikan"
+#: builtin/bisect.c builtin/cat-file.c
+#, c-format
+msgid "unknown command: '%s'"
+msgstr "perintah tidak dikenal: '%s'"
#: builtin/blame.c
msgid "git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"
msgstr "git blame [<opsi>] [<opsi revisi>] [<revisi>] [--] <berkas>"
#: builtin/blame.c
+msgid "git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"
+msgstr "git annotate [<opsi>] [<opsi revisi>] [<revisi>] [--] <berkas>"
+
+#: builtin/blame.c
msgid "<rev-opts> are documented in git-rev-list(1)"
msgstr "<opsi revisi> didokumentasikan dalam git-rev-list(1)"
@@ -3340,60 +3402,67 @@ msgstr "git branch [<opsi>] [-r | -a] [--format]"
#, c-format
msgid ""
"deleting branch '%s' that has been merged to\n"
-" '%s', but not yet merged to HEAD."
+" '%s', but not yet merged to HEAD"
msgstr ""
"menghapus cabang '%s' yang sudah digabungkan ke\n"
-" '%s', tapi belum digabungkan ke HEAD."
+" '%s', tapi belum digabungkan ke HEAD"
#: builtin/branch.c
#, c-format
msgid ""
"not deleting branch '%s' that is not yet merged to\n"
-" '%s', even though it is merged to HEAD."
+" '%s', even though it is merged to HEAD"
msgstr ""
"tidak menghapus cabang '%s' yang belum digabungkan ke\n"
-" '%s', walaupun tergabung ke HEAD."
+" '%s', walaupun tergabung ke HEAD"
#: builtin/branch.c
#, c-format
-msgid "Couldn't look up commit object for '%s'"
-msgstr "Tidak dapat mencari objek komit untuk '%s'"
+msgid "couldn't look up commit object for '%s'"
+msgstr "tidak dapat mencari objek komit untuk '%s'"
#: builtin/branch.c
#, c-format
-msgid ""
-"The branch '%s' is not fully merged.\n"
-"If you are sure you want to delete it, run 'git branch -D %s'."
-msgstr ""
-"Cabang '%s' belum sepenuhnya tergabung.\n"
-"Kalau Anda yakin ingin menghapusnya, jalankan 'git branch -D %s'."
+msgid "the branch '%s' is not fully merged"
+msgstr "cabang '%s' belum sepenuhnya digabungkan"
#: builtin/branch.c
-msgid "Update of config-file failed"
-msgstr "Pembaruan berkas konfigurasi gagal"
+#, c-format
+msgid "If you are sure you want to delete it, run 'git branch -D %s'"
+msgstr "Jika anda yakin untuk menghapusnya, lakukan 'git branch -D %s'"
+
+#: builtin/branch.c
+msgid "update of config-file failed"
+msgstr "pembaruan berkas konfigurasi gagal"
#: builtin/branch.c
msgid "cannot use -a with -d"
msgstr "tidak dapat gunakan -a dengan -d"
#: builtin/branch.c
-msgid "Couldn't look up commit object for HEAD"
-msgstr "Tidak dapat mencari objek komit untuk HEAD"
+#, c-format
+msgid "cannot delete branch '%s' used by worktree at '%s'"
+msgstr ""
+"tidak dapat menghapus cabang '%s' yang digunakan oleh pohon kerja di '%s'"
#: builtin/branch.c
#, c-format
-msgid "Cannot delete branch '%s' checked out at '%s'"
-msgstr "Tidak dapat menghapus cabang '%s' yang ter-checkout pada '%s'"
+msgid "remote-tracking branch '%s' not found"
+msgstr "cabang pelacak remote '%s' tidak ditemukan"
#: builtin/branch.c
#, c-format
-msgid "remote-tracking branch '%s' not found."
-msgstr "cabang pelacak remote '%s' tidak ditemukan."
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"cabang '%s' tidak ditemukan.\n"
+"Mungkin anda lupa menambahkan --remote?"
#: builtin/branch.c
#, c-format
-msgid "branch '%s' not found."
-msgstr "cabang '%s' tidak ditemukan."
+msgid "branch '%s' not found"
+msgstr "cabang '%s' tidak ditemukan"
#: builtin/branch.c
#, c-format
@@ -3420,57 +3489,64 @@ msgstr "HEAD (%s) merujuk diluar refs/heads/"
#: builtin/branch.c
#, c-format
-msgid "Branch %s is being rebased at %s"
-msgstr "Cabang %s sedang didasarkan ulang pada %s"
+msgid "branch %s is being rebased at %s"
+msgstr "cabang %s sedang didasarkan ulang pada %s"
#: builtin/branch.c
#, c-format
-msgid "Branch %s is being bisected at %s"
-msgstr "Cabang %s sedang dibagi dua pada %s"
+msgid "branch %s is being bisected at %s"
+msgstr "cabang %s sedang dibagi dua pada %s"
+
+#: builtin/branch.c
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "HEAD dari pohon kerja %s tidak diperbarui"
#: builtin/branch.c
-msgid "cannot copy the current branch while not on any."
-msgstr "tidak dapat menyalin cabang saat ini ketika tidak ada."
+#, c-format
+msgid "invalid branch name: '%s'"
+msgstr "nama cabang tidak valid: '%s'"
#: builtin/branch.c
-msgid "cannot rename the current branch while not on any."
-msgstr "tidak dapat mengganti nama cabang saat ini ketika tidak ada."
+#, c-format
+msgid "no commit on branch '%s' yet"
+msgstr "belum ada komit pada cabang '%s'."
#: builtin/branch.c
#, c-format
-msgid "Invalid branch name: '%s'"
-msgstr "Nama cabang tidak valid: '%s'"
+msgid "no branch named '%s'"
+msgstr "tidak ada cabang bernama '%s'"
#: builtin/branch.c
-msgid "Branch rename failed"
-msgstr "Penggantian nama cabang gagal"
+msgid "branch rename failed"
+msgstr "penggantian nama cabang gagal"
#: builtin/branch.c
-msgid "Branch copy failed"
-msgstr "Penyalinan cabang gagal"
+msgid "branch copy failed"
+msgstr "penyalinan cabang gagal"
#: builtin/branch.c
#, c-format
-msgid "Created a copy of a misnamed branch '%s'"
-msgstr "Salinan cabang salah nama '%s' dibuat"
+msgid "created a copy of a misnamed branch '%s'"
+msgstr "salinan cabang salah nama '%s' dibuat"
#: builtin/branch.c
#, c-format
-msgid "Renamed a misnamed branch '%s' away"
-msgstr "Cabang salah nama '%s' berganti nama"
+msgid "renamed a misnamed branch '%s' away"
+msgstr "cabang salah nama '%s' berganti nama"
#: builtin/branch.c
#, c-format
-msgid "Branch renamed to %s, but HEAD is not updated!"
-msgstr "Cabang berganti nama ke %s, tapi HEAD tidak diperbarui!"
+msgid "branch renamed to %s, but HEAD is not updated"
+msgstr "cabang berganti nama ke %s, tapi HEAD tidak diperbarui"
#: builtin/branch.c
-msgid "Branch is renamed, but update of config-file failed"
-msgstr "Cabang berganti nama, tapi pembaruan berkas konfigurasi gagal"
+msgid "branch is renamed, but update of config-file failed"
+msgstr "cabang berganti nama, tapi pembaruan berkas konfigurasi gagal"
#: builtin/branch.c
-msgid "Branch is copied, but update of config-file failed"
-msgstr "Cabang disalin, tapi pembaruan berkas konfigurasi gagal"
+msgid "branch is copied, but update of config-file failed"
+msgstr "cabang disalin, tapi pembaruan berkas konfigurasi gagal"
#: builtin/branch.c
#, c-format
@@ -3555,6 +3631,10 @@ msgstr "pindah/ganti nama cabang dan reflog-nya"
msgid "move/rename a branch, even if target exists"
msgstr "pindah/ganti nama cabang, walaupun target ada"
+#: builtin/branch.c builtin/for-each-ref.c builtin/tag.c
+msgid "do not output a newline after empty formatted refs"
+msgstr "jangan keluarkan baris baru setelah referensi terformat kosong"
+
#: builtin/branch.c
msgid "copy a branch and its reflog"
msgstr "salin cabang dan reflog-nya"
@@ -3611,14 +3691,14 @@ msgstr "pengurutan dan penyaringan tak peka kapital"
msgid "recurse through submodules"
msgstr "rekursi melalui submodul"
-#: builtin/branch.c builtin/for-each-ref.c builtin/ls-tree.c builtin/tag.c
-#: builtin/verify-tag.c
+#: builtin/branch.c builtin/for-each-ref.c builtin/ls-files.c builtin/ls-tree.c
+#: builtin/tag.c builtin/verify-tag.c
msgid "format to use for the output"
msgstr "format yang digunakan untuk keluaran"
-#: builtin/branch.c builtin/submodule--helper.c submodule.c
-msgid "Failed to resolve HEAD as a valid ref."
-msgstr "Gagal menguraikan HEAD sebagai referensi valid."
+#: builtin/branch.c
+msgid "failed to resolve HEAD as a valid ref"
+msgstr "gagal menguraikan HEAD sebagai referensi valid."
#: builtin/branch.c builtin/clone.c
msgid "HEAD not found below refs/heads!"
@@ -3641,22 +3721,20 @@ msgid "branch name required"
msgstr "nama cabang diperlukan"
#: builtin/branch.c
-msgid "Cannot give description to detached HEAD"
-msgstr "Tidak dapat memberikan deskripsi ke HEAD terpisah"
+msgid "cannot give description to detached HEAD"
+msgstr "tidak dapat memberikan deskripsi ke HEAD terpisah"
#: builtin/branch.c
msgid "cannot edit description of more than one branch"
msgstr "tidak dapat menyunting deskripsi lebih dari satu cabang"
#: builtin/branch.c
-#, c-format
-msgid "No commit on branch '%s' yet."
-msgstr "Belum ada komit pada cabang '%s'."
+msgid "cannot copy the current branch while not on any"
+msgstr "tidak dapat menyalin cabang saat ini ketika tidak ada"
#: builtin/branch.c
-#, c-format
-msgid "No branch named '%s'."
-msgstr "Tidak ada cabang bernama '%s'."
+msgid "cannot rename the current branch while not on any"
+msgstr "tidak dapat mengganti nama cabang saat ini ketika tidak ada"
#: builtin/branch.c
msgid "too many branches for a copy operation"
@@ -3673,10 +3751,9 @@ msgstr "terlalu banyak argumen untuk menyetel hulu baru"
#: builtin/branch.c
#, c-format
msgid ""
-"could not set upstream of HEAD to %s when it does not point to any branch."
+"could not set upstream of HEAD to %s when it does not point to any branch"
msgstr ""
-"tidak dapat menyetel hulu HEAD ke %s ketika itu tak menunjuk pada cabang "
-"apapun."
+"tidak dapat menyetel hulu HEAD ke %s ketika tak menunjuk pada cabang apapun"
#: builtin/branch.c
#, c-format
@@ -3693,56 +3770,62 @@ msgid "too many arguments to unset upstream"
msgstr "terlalu banyak argumen untuk batal-setel hulu"
#: builtin/branch.c
-msgid "could not unset upstream of HEAD when it does not point to any branch."
+msgid "could not unset upstream of HEAD when it does not point to any branch"
msgstr ""
-"tidak dapat membatal-setel hulu HEAD ketika itu tak menunjuk pada cabang "
-"apapun."
+"tidak dapat membatal-setel hulu HEAD ketika tak menunjuk pada cabang apapun"
#: builtin/branch.c
#, c-format
-msgid "Branch '%s' has no upstream information"
-msgstr "Cabang '%s' tidak ada informasi hulu"
+msgid "branch '%s' has no upstream information"
+msgstr "cabang '%s' tidak ada informasi hulu"
#: builtin/branch.c
msgid ""
-"The -a, and -r, options to 'git branch' do not take a branch name.\n"
+"the -a, and -r, options to 'git branch' do not take a branch name.\n"
"Did you mean to use: -a|-r --list <pattern>?"
msgstr ""
-"Opsi -a dan -r tidak mengambil nama cabang.\n"
-"Mungkin maksud Anda gunakan: -a|-r --list <pola>?"
+"opsi -a dan -r tidak mengambil nama cabang.\n"
+"Mungkin maksud Anda menggunakan: -a|-r --list <pola>?"
#: builtin/branch.c
msgid ""
"the '--set-upstream' option is no longer supported. Please use '--track' or "
-"'--set-upstream-to' instead."
+"'--set-upstream-to' instead"
msgstr ""
"opsi '--set-upstream' tidak lagi didukung. Mohon gunakan '--track' atau '--"
-"set-upstream-to' sebagai gantinya."
+"set-upstream-to' sebagai gantinya"
#: builtin/bugreport.c
msgid "git version:\n"
-msgstr ""
+msgstr "versi git:\n"
#: builtin/bugreport.c
#, c-format
msgid "uname() failed with error '%s' (%d)\n"
-msgstr ""
+msgstr "uname() gagal dengan kesalahan '%s' (%d)\n"
#: builtin/bugreport.c
msgid "compiler info: "
-msgstr ""
+msgstr "info pengompilasi: "
#: builtin/bugreport.c
msgid "libc info: "
-msgstr ""
+msgstr "info pustaka c: "
#: builtin/bugreport.c
msgid "not run from a git repository - no hooks to show\n"
msgstr ""
+"tidak dijalankan dari sebuah repositori git - tidak ada kait yang "
+"diperlihatkan\n"
#: builtin/bugreport.c
-msgid "git bugreport [-o|--output-directory <file>] [-s|--suffix <format>]"
+msgid ""
+"git bugreport [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--diagnose[=<mode>]]"
msgstr ""
+"git bugreport [(-o | --output-directory) <berkas>] [(-s |-- suffix) "
+"<format>]\n"
+" [--diagnose[=<mode>]]"
#: builtin/bugreport.c
msgid ""
@@ -3762,53 +3845,96 @@ msgid ""
"Please review the rest of the bug report below.\n"
"You can delete any lines you don't wish to share.\n"
msgstr ""
+"Terima kasih telah mengisi laporan bug Git!\n"
+"Mohon jawab pertanyaan berikut untuk membantu memahami masalah Anda.\n"
+"\n"
+"Apa yang Anda lakukan sebelum bug terjadi? (Tahap-tahap untuk mereproduksi "
+"masalah Anda)\n"
+"Apa yang Anda harapkan? (Perilaku yang diharapkan)\n"
+"\n"
+"Apa yang terjadi? (Perilaku sebenarnya)\n"
+"\n"
+"Apa yang berbeda antara apa yang Anda harapkan dan yang sebenarnya terjadi?\n"
+"\n"
+"Apalagi yang Anda ingin tambahkan?\n"
+"\n"
+"Mohon tinjau sisa laporan bug di bawah ini.\n"
+"Anda dapat menghapus baris-baris yang Anda tidak ingin dibagi.\n"
+
+#: builtin/bugreport.c builtin/commit.c builtin/fast-export.c builtin/rebase.c
+#: parse-options.h
+msgid "mode"
+msgstr "mode"
#: builtin/bugreport.c
-msgid "specify a destination for the bugreport file"
-msgstr ""
+msgid ""
+"create an additional zip archive of detailed diagnostics (default 'stats')"
+msgstr "buat arsip zip tambahan dari diagnostik terperinci (asali 'stats')"
#: builtin/bugreport.c
-msgid "specify a strftime format suffix for the filename"
-msgstr ""
+msgid "specify a destination for the bugreport file(s)"
+msgstr "sebutkan tujuan untuk berkas(-berkas) laporan bug"
+
+#: builtin/bugreport.c
+msgid "specify a strftime format suffix for the filename(s)"
+msgstr "sebutkan akhiran format strftime untuk nama(-nama) berkas"
#: builtin/bugreport.c
#, c-format
+msgid "unknown argument `%s'"
+msgstr "argumen tidak dikenal `%s'"
+
+#: builtin/bugreport.c builtin/diagnose.c
+#, c-format
msgid "could not create leading directories for '%s'"
-msgstr ""
+msgstr "tidak dapat membuat direktori utama untuk '%s'"
+
+#: builtin/bugreport.c builtin/diagnose.c
+#, c-format
+msgid "unable to create diagnostics archive %s"
+msgstr "tidak dapat membuat arsip diagnostik %s"
#: builtin/bugreport.c
msgid "System Info"
-msgstr ""
+msgstr "Informasi Sistem"
#: builtin/bugreport.c
msgid "Enabled Hooks"
-msgstr ""
+msgstr "Kait Aktif"
#: builtin/bugreport.c
#, c-format
msgid "unable to write to %s"
-msgstr ""
+msgstr "tidak dapat menulis ke %s"
#: builtin/bugreport.c
#, c-format
msgid "Created new report at '%s'.\n"
-msgstr ""
+msgstr "Laporan baru dibuat pada '%s'.\n"
#: builtin/bundle.c
-msgid "git bundle create [<options>] <file> <git-rev-list args>"
-msgstr "git bundle create [<opsi>] <berkas> <argumen git-rev-list>"
+msgid ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<version>] <file> <git-rev-list-args>"
+msgstr ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<versi>] <berkas> <argumen git-rev-list>"
#: builtin/bundle.c
-msgid "git bundle verify [<options>] <file>"
-msgstr "git bundle verify [<opsi>] <berkas>"
+msgid "git bundle verify [-q | --quiet] <file>"
+msgstr "git bundle verify [-q | --quiet] <berkas>"
#: builtin/bundle.c
msgid "git bundle list-heads <file> [<refname>...]"
msgstr "git bundle list-heads <berkas> [<nama referensi>...]"
#: builtin/bundle.c
-msgid "git bundle unbundle <file> [<refname>...]"
-msgstr "git bundle unbundle <berkas> [<nama referensi>...]"
+msgid "git bundle unbundle [--progress] <file> [<refname>...]"
+msgstr "git bundle unbundle [--progress] <berkas> [<nama referensi>...]"
+
+#: builtin/bundle.c
+msgid "need a <file> argument"
+msgstr "butuh sebuah argumen <berkas>"
#: builtin/bundle.c builtin/pack-objects.c
msgid "do not show progress meter"
@@ -3818,13 +3944,13 @@ msgstr "jangan perlihatkan meteran perkembangan"
msgid "show progress meter"
msgstr "perlihatkan meteran perkembangan"
-#: builtin/bundle.c builtin/pack-objects.c
-msgid "show progress meter during object writing phase"
-msgstr "perlihatkan meteran perkembangan saat fase penulisan objek"
+#: builtin/bundle.c
+msgid "historical; same as --progress"
+msgstr "opsi bersejarah; sama dengan --progress"
-#: builtin/bundle.c builtin/pack-objects.c
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "sama seperti --all-progress ketika meteran perkembangan diperlihatkan"
+#: builtin/bundle.c
+msgid "historical; does nothing"
+msgstr "opsi bersejarah: tidak apa-apa"
#: builtin/bundle.c
msgid "specify bundle format version"
@@ -3851,11 +3977,6 @@ msgstr "Perlu sebuah repositori untuk membongkar bundel."
msgid "Unbundling objects"
msgstr "Membongkar bundel objek"
-#: builtin/bundle.c builtin/remote.c
-#, c-format
-msgid "Unknown subcommand: %s"
-msgstr "Subperintah tidak dikenal: %s"
-
#: builtin/cat-file.c merge-recursive.c
#, c-format
msgid "cannot read object %s '%s'"
@@ -3885,11 +4006,6 @@ msgid "%s takes no arguments"
msgstr "%s tidak mengambil argumen"
#: builtin/cat-file.c
-#, c-format
-msgid "unknown command: '%s'"
-msgstr "perintah tidak dikenal: '%s'"
-
-#: builtin/cat-file.c
msgid "only one batch option may be specified"
msgstr "hanya satu opsi setumpuk yang mungkin disebutkan"
@@ -3907,24 +4023,24 @@ msgstr "git cat-file (-t | -s) [--allow-unknown-type] <objek>"
#: builtin/cat-file.c
msgid ""
+"git cat-file (--textconv | --filters)\n"
+" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
+msgstr ""
+"git cat-file (--textconv | --filters)\n"
+" [<revisi>:<jalur|mirip-pohon> | --path=<jalur|mirip-pohon>] "
+"<revisi>"
+
+#: builtin/cat-file.c
+msgid ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
+" [--textconv | --filters] [-Z]"
msgstr ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
-
-#: builtin/cat-file.c
-msgid ""
-"git cat-file (--textconv | --filters)\n"
-" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
-msgstr ""
-"git cat-file (--textconv | --filters)\n"
-" [<revisi>:<jalur|mirip-pohon> | --path=<jalur|mirip-pohon>] "
-"<revisi>"
+" [--textconv | --filters] [-z]"
#: builtin/cat-file.c
msgid "Check object existence or emit object contents"
@@ -3954,6 +4070,10 @@ msgstr "perlihatkan ukuran objek"
msgid "allow -s and -t to work with broken/corrupt objects"
msgstr "perbolehkan -s dan -t bekerja dengan objek rusak"
+#: builtin/cat-file.c builtin/log.c
+msgid "use mail map file"
+msgstr "gunakan berkas peta surat"
+
#: builtin/cat-file.c
msgid "Batch objects requested on stdin (or --batch-all-objects)"
msgstr "Objek batch diminta pada masukan standar (atau --batch-all-objects)"
@@ -3967,6 +4087,14 @@ msgid "like --batch, but don't emit <contents>"
msgstr "seperti --batch, tapi jangan keluarkan <isi>"
#: builtin/cat-file.c
+msgid "stdin is NUL-terminated"
+msgstr "stdin diakhiri dengan NUL"
+
+#: builtin/cat-file.c
+msgid "stdin and stdout is NUL-terminated"
+msgstr "stdin dan stdout diakhiri dengan NUL"
+
+#: builtin/cat-file.c
msgid "read commands from stdin"
msgstr "baca perintah dari masukan standar"
@@ -4049,11 +4177,6 @@ msgstr "<revisi> diperlukan dengan '%s'"
msgid "<object> required with '-%c'"
msgstr "<objek> diperlukan dengan '-%c'"
-#: builtin/cat-file.c builtin/notes.c builtin/prune-packed.c
-#: builtin/receive-pack.c builtin/tag.c
-msgid "too many arguments"
-msgstr "terlalu banyak argumen"
-
#: builtin/cat-file.c
#, c-format
msgid "only two arguments allowed in <type> <object> mode, not %d"
@@ -4061,138 +4184,155 @@ msgstr ""
"hanya dua argumen yang diperbolehkan di dalam mode <tipe> <objek>, bukan %d"
#: builtin/check-attr.c
-msgid "git check-attr [-a | --all | <attr>...] [--] <pathname>..."
+msgid ""
+"git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] "
+"<pathname>..."
msgstr ""
+"git check-attr [source <mirip-pohon> [-a | --all | <atribut>...] [--] <nama "
+"jalur>..."
#: builtin/check-attr.c
-msgid "git check-attr --stdin [-z] [-a | --all | <attr>...]"
+msgid ""
+"git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"
msgstr ""
+"git check-attr --stdin [-z] [--source <mirip-pohon>] [-a | --all | "
+"<attribut>...]"
#: builtin/check-attr.c
msgid "report all attributes set on file"
-msgstr ""
+msgstr "laporkan semua atribut yang disetel pada berkas"
#: builtin/check-attr.c
msgid "use .gitattributes only from the index"
-msgstr ""
+msgstr "hanya gunakan .gitattributes dari indeks"
#: builtin/check-attr.c builtin/check-ignore.c builtin/hash-object.c
msgid "read file names from stdin"
-msgstr ""
+msgstr "baca nama berkas dari masukan standar"
#: builtin/check-attr.c builtin/check-ignore.c
msgid "terminate input and output records by a NUL character"
-msgstr ""
+msgstr "akhiri masukan dan keluarkan rekaman oleh sebuah karakter NUL"
+
+#: builtin/check-attr.c
+msgid "<tree-ish>"
+msgstr "<mirip-pohon>"
+
+#: builtin/check-attr.c
+msgid "which tree-ish to check attributes at"
+msgstr "mirip-pohon mana yang diperiksa atributnya"
#: builtin/check-ignore.c builtin/checkout.c builtin/gc.c builtin/worktree.c
msgid "suppress progress reporting"
-msgstr ""
+msgstr "padamkan pelaporan kemajuan"
#: builtin/check-ignore.c
msgid "show non-matching input paths"
-msgstr ""
+msgstr "perlihatkan jalur input yang tak cocok"
#: builtin/check-ignore.c
msgid "ignore index when checking"
-msgstr ""
+msgstr "abaikan indeks ketika memeriksa"
#: builtin/check-ignore.c
msgid "cannot specify pathnames with --stdin"
-msgstr ""
+msgstr "tidak dapat menyebutkan nama jalur dengan --stdin"
#: builtin/check-ignore.c
msgid "-z only makes sense with --stdin"
-msgstr ""
+msgstr "-z hanya masuk akal dengan --stdin"
#: builtin/check-ignore.c
msgid "no path specified"
-msgstr ""
+msgstr "tidak ada jalur yang disebutkan"
#: builtin/check-ignore.c
msgid "--quiet is only valid with a single pathname"
-msgstr ""
+msgstr "--quiet hanya valid dengan satu nama jalur"
#: builtin/check-ignore.c
msgid "cannot have both --quiet and --verbose"
-msgstr ""
+msgstr "tidak dapat punya baik --quiet dan --verbose"
#: builtin/check-ignore.c
msgid "--non-matching is only valid with --verbose"
-msgstr ""
+msgstr "--non-matching hanya valid dengan --verbose"
#: builtin/check-mailmap.c
msgid "git check-mailmap [<options>] <contact>..."
-msgstr ""
+msgstr "git check-mailmap [<opsi>] <kontak>..."
#: builtin/check-mailmap.c
msgid "also read contacts from stdin"
-msgstr ""
+msgstr "juga baca kontak dari masukan standar"
#: builtin/check-mailmap.c
#, c-format
msgid "unable to parse contact: %s"
-msgstr ""
+msgstr "tidak dapat menguraikan kontak: %s"
#: builtin/check-mailmap.c
msgid "no contacts specified"
-msgstr ""
+msgstr "tidak ada kontak yang disebutkan"
#: builtin/checkout--worker.c
msgid "git checkout--worker [<options>]"
-msgstr ""
+msgstr "git checkout--worker [<opsi>]"
#: builtin/checkout--worker.c builtin/checkout-index.c builtin/column.c
#: builtin/submodule--helper.c builtin/worktree.c
msgid "string"
-msgstr ""
+msgstr "untai"
#: builtin/checkout--worker.c builtin/checkout-index.c
msgid "when creating files, prepend <string>"
-msgstr ""
+msgstr "saat membuat berkas, awali dengan <string>"
#: builtin/checkout-index.c
msgid "git checkout-index [<options>] [--] [<file>...]"
-msgstr ""
+msgstr "git checkout-index [<opsi>] [--] [<berkas>...]"
#: builtin/checkout-index.c
msgid "stage should be between 1 and 3 or all"
-msgstr ""
+msgstr "tahap seharusnya antara 1 dan 3 atau semua"
#: builtin/checkout-index.c
msgid "check out all files in the index"
-msgstr ""
+msgstr "check out semua berkas di dalam indeks"
#: builtin/checkout-index.c
msgid "do not skip files with skip-worktree set"
-msgstr ""
+msgstr "jangan lewatkan berkas dengan skip-worktree tersetel"
#: builtin/checkout-index.c
msgid "force overwrite of existing files"
-msgstr ""
+msgstr "paksa timpa berkas yang ada"
#: builtin/checkout-index.c
msgid "no warning for existing files and files not in index"
msgstr ""
+"tanpa peringatan untuk berkas yang ada dan berkas yang tidak ada di dalam "
+"indeks"
#: builtin/checkout-index.c
msgid "don't checkout new files"
-msgstr ""
+msgstr "jangan checkout berkas baru"
#: builtin/checkout-index.c
msgid "update stat information in the index file"
-msgstr ""
+msgstr "perbarui informasi stat di dalam berkas indeks"
#: builtin/checkout-index.c
msgid "read list of paths from the standard input"
-msgstr ""
+msgstr "baca daftar jalur dari masukan standar"
#: builtin/checkout-index.c
msgid "write the content to temporary files"
-msgstr ""
+msgstr "tulis isi ke berkas sementara"
#: builtin/checkout-index.c
msgid "copy out the files from named stage"
-msgstr ""
+msgstr "salin berkas dari tahap bernama"
#: builtin/checkout.c
msgid "git checkout [<options>] <branch>"
@@ -4290,6 +4430,11 @@ msgstr "'%s' atau '%s' tidak dapat digunakan untuk %s"
#: builtin/checkout.c
#, c-format
+msgid "'%s', '%s', or '%s' cannot be used when checking out of a tree"
+msgstr "'%s', '%s', atau '%s' tidak dapat digunakan ketika men-checkout pohon"
+
+#: builtin/checkout.c
+#, c-format
msgid "path '%s' is unmerged"
msgstr "jalur '%s' tak tergabung"
@@ -4316,7 +4461,7 @@ msgstr "Tidak dapat melakukan reflog untuk '%s': %s\n"
msgid "HEAD is now at"
msgstr "HEAD sekarang berada di"
-#: builtin/checkout.c builtin/clone.c t/helper/test-fast-rebase.c
+#: builtin/checkout.c builtin/clone.c
msgid "unable to update HEAD"
msgstr "tidak dapat memperbarui HEAD"
@@ -4492,8 +4637,8 @@ msgid ""
"Consider \"git merge --quit\" or \"git worktree add\"."
msgstr ""
"tidak dapat mengganti cabang saat penggabungan\n"
-"Pertimbangkan untuk menggunakan \"git merge --quit\" atau \"git worktree add"
-"\"."
+"Pertimbangkan untuk menggunakan \"git merge --quit\" atau \"git worktree "
+"add\"."
#: builtin/checkout.c
msgid ""
@@ -4509,8 +4654,8 @@ msgid ""
"Consider \"git rebase --quit\" or \"git worktree add\"."
msgstr ""
"tidak dapat mengganti cabang saat pendasaran ulang\n"
-"Pertimbangkan untuk menggunakan \"git rebase --quit\" atau \"git worktree add"
-"\"."
+"Pertimbangkan untuk menggunakan \"git rebase --quit\" atau \"git worktree "
+"add\"."
#: builtin/checkout.c
msgid ""
@@ -4527,8 +4672,8 @@ msgid ""
"Consider \"git revert --quit\" or \"git worktree add\"."
msgstr ""
"tidak dapat mengganti cabang saat pembalikan\n"
-"Pertimbangkan untuk menggunakan \"git revert --quit\" atau \"git worktree add"
-"\"."
+"Pertimbangkan untuk menggunakan \"git revert --quit\" atau \"git worktree "
+"add\"."
#: builtin/checkout.c
msgid "you are switching branch while bisecting"
@@ -4587,8 +4732,8 @@ msgid "new-branch"
msgstr "cabang baru"
#: builtin/checkout.c
-msgid "new unparented branch"
-msgstr "cabang baru tanpa induk"
+msgid "new unborn branch"
+msgstr "cabang yatim baru"
#: builtin/checkout.c builtin/merge.c
msgid "update ignored files (default)"
@@ -4656,7 +4801,7 @@ msgstr ""
msgid "you must specify path(s) to restore"
msgstr "Anda harus sebutkan jalur untuk dipulihkan"
-#: builtin/checkout.c builtin/clone.c builtin/remote.c
+#: builtin/checkout.c builtin/clone.c builtin/remote.c builtin/replay.c
#: builtin/submodule--helper.c builtin/worktree.c
msgid "branch"
msgstr "cabang"
@@ -4719,9 +4864,11 @@ msgstr "gunakan mode hamparan"
#: builtin/clean.c
msgid ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <paths>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] "
+"[<pathspec>...]"
msgstr ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <pola>] [-x | -X] [--] <jalur>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <pola>] [-x | -X] [--] [<spek "
+"jalur>...]"
#: builtin/clean.c
#, c-format
@@ -4761,7 +4908,7 @@ msgstr "Menolak menghapus direktori kerja saat ini\n"
msgid "Would refuse to remove current working directory\n"
msgstr "Akan menolak menghapus direktori kerja saat ini\n"
-#: builtin/clean.c git-add--interactive.perl
+#: builtin/clean.c
#, c-format
msgid ""
"Prompt help:\n"
@@ -4774,7 +4921,7 @@ msgstr ""
"foo - pilih item berdasarkan prefiks unik\n"
" - (kosong) tidak pilih apa-apa\n"
-#: builtin/clean.c git-add--interactive.perl
+#: builtin/clean.c
#, c-format
msgid ""
"Prompt help:\n"
@@ -4795,8 +4942,8 @@ msgstr ""
"* - pilih semua item\n"
" - (kosong) selesai memilih\n"
-#: builtin/clean.c git-add--interactive.perl
-#, c-format, perl-format
+#: builtin/clean.c
+#, c-format
msgid "Huh (%s)?\n"
msgstr "Huh (%s)?\n"
@@ -4865,7 +5012,8 @@ msgid "remove whole directories"
msgstr "hapus keseluruhan direktori"
#: builtin/clean.c builtin/describe.c builtin/grep.c builtin/log.c
-#: builtin/ls-files.c builtin/name-rev.c builtin/show-ref.c
+#: builtin/ls-files.c builtin/name-rev.c builtin/pack-refs.c builtin/show-ref.c
+#: ref-filter.h
msgid "pattern"
msgstr "pola"
@@ -4897,10 +5045,6 @@ msgstr ""
"clean.requireForce asal ke true dan baik -i, -n, atau -f tidak diberikan; "
"menolak membersihkan"
-#: builtin/clean.c
-msgid "-x and -X cannot be used together"
-msgstr "-x dan -X tidak dapat digunakan bersamaan"
-
#: builtin/clone.c
msgid "git clone [<options>] [--] <repo> [<dir>]"
msgstr "git clone [<opsi>] [--] <repo> [<direktori>]"
@@ -4979,7 +5123,7 @@ msgstr "checkout <cabang> daripada HEAD remote"
msgid "path to git-upload-pack on the remote"
msgstr "jalur ke git-upload-pack pada remote"
-#: builtin/clone.c builtin/fetch.c builtin/grep.c builtin/pull.c
+#: builtin/clone.c builtin/fetch.c builtin/pull.c
msgid "depth"
msgstr "kedalaman"
@@ -4987,15 +5131,12 @@ msgstr "kedalaman"
msgid "create a shallow clone of that depth"
msgstr "buat klon dangkal sedalam kedalaman tersebut"
-#: builtin/clone.c builtin/fetch.c builtin/pack-objects.c builtin/pull.c
-msgid "time"
-msgstr "waktu"
-
#: builtin/clone.c
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"
@@ -5023,6 +5164,10 @@ msgstr "direktori git"
msgid "separate git dir from working tree"
msgstr "pisahkan direktori git dari pohon kerja"
+#: builtin/clone.c builtin/init-db.c
+msgid "specify the reference format to use"
+msgstr "sebutkan format referensi untuk digunakan"
+
#: builtin/clone.c
msgid "key=value"
msgstr "kunci=nilai"
@@ -5041,14 +5186,6 @@ msgstr "spesifik ke server"
msgid "option to transmit"
msgstr "opsi untuk transmisi"
-#: builtin/clone.c builtin/fetch.c builtin/pull.c builtin/push.c
-msgid "use IPv4 addresses only"
-msgstr "gunakan hanya alamat IPv4"
-
-#: builtin/clone.c builtin/fetch.c builtin/pull.c builtin/push.c
-msgid "use IPv6 addresses only"
-msgstr "gunakan hanya alamat IPv6"
-
#: builtin/clone.c
msgid "apply partial clone filters to submodules"
msgstr "terapkan saringan kloning parsial ke submodul"
@@ -5063,6 +5200,14 @@ msgstr ""
"inisialisasi berkas checkout tipis agar memasukkan hanya berkas pada akar"
#: builtin/clone.c
+msgid "uri"
+msgstr "URI"
+
+#: builtin/clone.c
+msgid "a URI for downloading bundles before fetching from origin remote"
+msgstr "sebuah URI untuk mengunduh bundel sebelum mengambil dari remote asal"
+
+#: builtin/clone.c
#, c-format
msgid "info: Could not add alternate for '%s': %s\n"
msgstr "info: Tidak dapat menambahkan alternatif untuk '%s': %s\n"
@@ -5079,9 +5224,19 @@ msgstr "%s ada dan bukan direktori"
#: builtin/clone.c
#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "'%s' tautan simbolik, menolak mengkloning dengan --local"
+
+#: builtin/clone.c
+#, c-format
msgid "failed to start iterator over '%s'"
msgstr "gagal memulai iterator pada '%s'"
+#: builtin/clone.c
+#, c-format
+msgid "symlink '%s' exists, refusing to clone with --local"
+msgstr "tautan simbolik '%s' ada, menolak mengkloning dengan --local"
+
#: builtin/clone.c compat/precompose_utf8.c
#, c-format
msgid "failed to unlink '%s'"
@@ -5136,9 +5291,8 @@ msgid "failed to initialize sparse-checkout"
msgstr "gagal menginisalisasi checkout tipis"
#: builtin/clone.c
-msgid "remote HEAD refers to nonexistent ref, unable to checkout.\n"
-msgstr ""
-"HEAD remote merujuk pada ref yang tidak ada, tidak dapat men-checkout.\n"
+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"
@@ -5160,14 +5314,14 @@ msgstr "tidak dapat batal-taut berkas alternatif sementara"
msgid "Too many arguments."
msgstr "Terlalu banyak argumen."
-#: builtin/clone.c contrib/scalar/scalar.c
+#: builtin/clone.c scalar.c
msgid "You must specify a repository to clone."
msgstr "Anda harus sebutkan repositori untuk diklon."
-#: builtin/clone.c
+#: builtin/clone.c builtin/init-db.c setup.c
#, c-format
-msgid "options '%s' and '%s %s' cannot be used together"
-msgstr "opsi '%s' dan '%s %s' tidak dapat digunakan bersamaan"
+msgid "unknown ref storage format '%s'"
+msgstr "format penyimpanan referensi tidak dikenal '%s'"
#: builtin/clone.c
#, c-format
@@ -5262,6 +5416,19 @@ msgid "cannot clone from filtered bundle"
msgstr "tidak dapat mengkloning dari bundel tersaring"
#: builtin/clone.c
+msgid "failed to initialize the repo, skipping bundle URI"
+msgstr "gagal menginisialisasi repo, melewatkan URI bundel"
+
+#: builtin/clone.c
+#, c-format
+msgid "failed to fetch objects from bundle URI '%s'"
+msgstr "gagal mengambil objek dari URI bundel '%s'"
+
+#: builtin/clone.c
+msgid "failed to fetch advertised bundles"
+msgstr "gagal mengambil bundel yang diiklankan"
+
+#: builtin/clone.c
msgid "remote transport reported error"
msgstr "transportasi remote melaporkan kesalahan"
@@ -5276,145 +5443,162 @@ msgstr "Anda tampaknya mengklon repositori kosong."
#: builtin/column.c
msgid "git column [<options>]"
-msgstr ""
+msgstr "git column [<opsi>]"
#: builtin/column.c
msgid "lookup config vars"
-msgstr ""
+msgstr "cari variabel konfigurasi"
#: builtin/column.c
msgid "layout to use"
-msgstr ""
+msgstr "layout yang digunakan"
#: builtin/column.c
msgid "maximum width"
-msgstr ""
+msgstr "lebar maksimum"
#: builtin/column.c
msgid "padding space on left border"
-msgstr ""
+msgstr "bantalan spasi pada perbatasan kiri"
#: builtin/column.c
msgid "padding space on right border"
-msgstr ""
+msgstr "bantalan spasi pada perbatasan kanan"
#: builtin/column.c
msgid "padding space between columns"
-msgstr ""
+msgstr "bantalan spasi di antara kolom"
#: builtin/column.c
msgid "--command must be the first argument"
-msgstr ""
+msgstr "--command harus menjadi argumen pertama"
#: builtin/commit-graph.c
msgid ""
-"git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]"
+"git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]"
msgstr ""
+"git commit-graph verify [--object-dir <direktori>] [--shallow] [--"
+"[no-]progress]"
#: builtin/commit-graph.c
msgid ""
-"git commit-graph write [--object-dir <objdir>] [--append] [--"
-"split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <n>] [--[no-]progress] <split options>"
-msgstr ""
-
-#: builtin/commit-graph.c builtin/fetch.c builtin/log.c
+"git commit-graph write [--object-dir <dir>] [--append]\n"
+" [--split[=<strategy>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <split-options>"
+msgstr ""
+"git commit-graph write [--object-dir <direktori>] [--append]\n"
+" [--split[=<strategi>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <opsi pemisahan>"
+
+#: builtin/commit-graph.c builtin/fetch.c builtin/log.c builtin/repack.c
msgid "dir"
-msgstr ""
+msgstr "direktori"
#: builtin/commit-graph.c
msgid "the object directory to store the graph"
-msgstr ""
+msgstr "direktori objek untuk menyimpan grafik"
#: builtin/commit-graph.c
msgid "if the commit-graph is split, only verify the tip file"
-msgstr ""
+msgstr "jika grafik komit terpisah, hanya verifikasi berkas ujung"
#: builtin/commit-graph.c
#, c-format
msgid "Could not open commit-graph '%s'"
-msgstr ""
+msgstr "Tidak dapat membuka grafik komit '%s'"
+
+#: builtin/commit-graph.c
+#, c-format
+msgid "could not open commit-graph chain '%s'"
+msgstr "tidak dapat membuka grafik komit '%s'"
#: builtin/commit-graph.c
#, c-format
msgid "unrecognized --split argument, %s"
-msgstr ""
+msgstr "argumen --split tidak dikenal, %s"
#: builtin/commit-graph.c
#, c-format
msgid "unexpected non-hex object ID: %s"
-msgstr ""
+msgstr "ID objek non-heks tidak diharapkan: %s"
#: builtin/commit-graph.c
#, c-format
msgid "invalid object: %s"
-msgstr ""
+msgstr "objek tidak valid: %s"
#: builtin/commit-graph.c parse-options-cb.c
#, c-format
msgid "option `%s' expects a numerical value"
-msgstr ""
+msgstr "opsi `%s' mengharapkan nilai numerik"
#: builtin/commit-graph.c
msgid "start walk at all refs"
-msgstr ""
+msgstr "mulai berjalan pada semua referensi"
#: builtin/commit-graph.c
msgid "scan pack-indexes listed by stdin for commits"
-msgstr ""
+msgstr "pindai indeks pak yang disebutkan oleh masukan standar untuk komit"
#: builtin/commit-graph.c
msgid "start walk at commits listed by stdin"
-msgstr ""
+msgstr "mulai berjalan pada komit yang disebutkan oleh masukan standar"
#: builtin/commit-graph.c
msgid "include all commits already in the commit-graph file"
-msgstr ""
+msgstr "masukkan semua komit yang sudah ada di dalam berkas grafik komit"
#: builtin/commit-graph.c
msgid "enable computation for changed paths"
-msgstr ""
+msgstr "aktifkan perhitungan perubahan jalur"
#: builtin/commit-graph.c
msgid "allow writing an incremental commit-graph file"
-msgstr ""
+msgstr "perbolehkan menulis berkas grafik komit bertambah"
#: builtin/commit-graph.c
msgid "maximum number of commits in a non-base split commit-graph"
-msgstr ""
+msgstr "jumlah komit maksimal di dalam grafik komit terpisah non-dasar"
#: builtin/commit-graph.c
msgid "maximum ratio between two levels of a split commit-graph"
-msgstr ""
+msgstr "rasio maksimum di antara dua tingkat grafik komit terpisah"
#: builtin/commit-graph.c
msgid "only expire files older than a given date-time"
msgstr ""
+"hanya kadaluarsakan berkas yang lebih tua dari tanggal-waktu yang diberikan"
#: builtin/commit-graph.c
msgid "maximum number of changed-path Bloom filters to compute"
-msgstr ""
+msgstr "jumlah penyaring Bloom berubah jalur maksimum yang dihitung"
#: builtin/commit-graph.c
msgid "use at most one of --reachable, --stdin-commits, or --stdin-packs"
msgstr ""
+"gunakan hanya satu dari --reachable, --stdin-commits, atau --stdin-packs"
#: builtin/commit-graph.c
msgid "Collecting commits from input"
-msgstr ""
+msgstr "Mengumpulkan komit dari masukan"
-#: builtin/commit-graph.c builtin/multi-pack-index.c
-#, c-format
-msgid "unrecognized subcommand: %s"
-msgstr ""
+#: builtin/commit-tree.c
+msgid "git commit-tree <tree> [(-p <parent>)...]"
+msgstr "git commit-tree <pohon> [(-p <induk>)...]"
#: builtin/commit-tree.c
msgid ""
-"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...] [(-F "
-"<file>)...] <tree>"
+"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]\n"
+" [(-F <file>)...] <tree>"
msgstr ""
-"git commit-tree [(-p <induk>)...] [-S[<id kunci>]] [(-m <pesan>)...] [(-F "
-"<berkas>)...] <pohon>"
+"git commit-tree [(-p <induk>)...] [-S[<id kunci>]] [(-m <pesan>)...]\n"
+" [(-F <berkas>)...] <pohon>"
#: builtin/commit-tree.c
#, c-format
@@ -5471,12 +5655,31 @@ msgid "git commit-tree: failed to read"
msgstr "git commit-tree: gagal membaca"
#: builtin/commit.c
-msgid "git commit [<options>] [--] <pathspec>..."
-msgstr "git commit [<opsi>] [--] <spek jalur>..."
+msgid ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|"
+"reword):]<commit>)]\n"
+" [-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n"
+" [--date=<date>] [--cleanup=<mode>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <komit> | --fixup [(amend|"
+"reword):]<komit>)]\n"
+" [-F <berkas> | -m <pesan>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--"
+"author=<pengarang>]\n"
+" [--date=<tanggal>] [--cleanup=<mode>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<berkas> [--pathspec-file-nul]]\n"
+" [(--trailer <token>[(=|:)<nilai>])...] [-S[<id kunci>]]\n"
+" [--] [<spek jalur>...]"
#: builtin/commit.c
-msgid "git status [<options>] [--] <pathspec>..."
-msgstr "git status [<opsi>] [--] <spek jalur>..."
+msgid "git status [<options>] [--] [<pathspec>...]"
+msgstr "git status [<opsi>] [--] [<spek jalur>...]"
#: builtin/commit.c
msgid ""
@@ -5532,6 +5735,10 @@ msgstr ""
" git cherry-pick --skip\n"
"\n"
+#: builtin/commit.c read-cache.c
+msgid "updating files failed"
+msgstr "gagal memperbarui berkas"
+
#: builtin/commit.c
msgid "failed to unpack HEAD tree object"
msgstr "gagal membuka objek pohon HEAD"
@@ -5557,10 +5764,6 @@ msgid "Failed to update main cache tree"
msgstr "gagal memperbarui tembolok pohon utama"
#: builtin/commit.c
-msgid "unable to write new_index file"
-msgstr "tidak dapat menulis berkas new_index"
-
-#: builtin/commit.c
msgid "cannot do a partial commit during a merge."
msgstr "tidak dapat melakukan komit sebagian selama penggabungan."
@@ -5607,10 +5810,10 @@ msgstr ""
"tidak dapat memilih karakter komentar yang tidak terpakai\n"
"dalam pesan komit saat ini"
-#: builtin/commit.c
+#: builtin/commit.c builtin/merge-tree.c
#, c-format
-msgid "could not lookup commit %s"
-msgstr "tidak dapat mencari komit %s"
+msgid "could not lookup commit '%s'"
+msgstr "tidak dapat mencari komit '%s'"
#: builtin/commit.c builtin/shortlog.c
#, c-format
@@ -5830,7 +6033,7 @@ msgstr "hitung nilai didepan/dibelakang penuh"
msgid "version"
msgstr "versi"
-#: builtin/commit.c builtin/push.c builtin/worktree.c
+#: builtin/commit.c builtin/fetch.c builtin/push.c builtin/worktree.c
msgid "machine-readable output"
msgstr "keluaran yang dapat dibaca mesin"
@@ -5842,10 +6045,6 @@ msgstr "perlihatkan status dalam format panjang (asali)"
msgid "terminate entries with NUL"
msgstr "akhiri entri dengan NUL"
-#: builtin/commit.c builtin/fast-export.c builtin/rebase.c parse-options.h
-msgid "mode"
-msgstr "mode"
-
#: builtin/commit.c
msgid "show untracked files, optional modes: all, normal, no. (Default: all)"
msgstr ""
@@ -5919,7 +6118,7 @@ msgstr "tangal"
msgid "override date for commit"
msgstr "timpa tanggal komit"
-#: builtin/commit.c parse-options.h ref-filter.h
+#: builtin/commit.c builtin/merge-tree.c parse-options.h ref-filter.h
msgid "commit"
msgstr "komit"
@@ -6062,18 +6261,18 @@ msgstr "Batalkan komit karena badan pesan komit kosong.\n"
#: builtin/commit.c
msgid ""
"repository has been updated, but unable to write\n"
-"new_index file. Check that disk is not full and quota is\n"
+"new index file. Check that disk is not full and quota is\n"
"not exceeded, and then \"git restore --staged :/\" to recover."
msgstr ""
"repositori sudah diperbarui, tetapi tidak dapat menulis\n"
-"berkas new_index. Periksa bahwa disk tidak penuh dan kuota\n"
+"berkas indeks baru. Periksa bahwa disk tidak penuh dan kuota\n"
"tidak terlampaui, lalu \"git restore --staged :/\" untuk pulihkan."
#: builtin/config.c
msgid "git config [<options>]"
msgstr "git config [<opsi>]"
-#: builtin/config.c builtin/env--helper.c
+#: builtin/config.c
#, c-format
msgid "unrecognized --type argument, %s"
msgstr "argumen --type tidak dikenal %s"
@@ -6102,7 +6301,7 @@ msgstr "gunakan berkas konfigurasi repositori"
msgid "use per-worktree config file"
msgstr "gunakan berkas konfigurasi per pohon kerja"
-#: builtin/config.c
+#: builtin/config.c builtin/gc.c
msgid "use given config file"
msgstr "gunakan berkas konfigurasi yang diberikan"
@@ -6182,11 +6381,11 @@ msgstr "temukan setelan warna: slot [stdout-is-tty]"
msgid "Type"
msgstr "Tipe"
-#: builtin/config.c builtin/env--helper.c builtin/hash-object.c
+#: builtin/config.c builtin/hash-object.c
msgid "type"
msgstr "tipe"
-#: builtin/config.c builtin/env--helper.c
+#: builtin/config.c
msgid "value is given this type"
msgstr "Nilai diberikan tipe ini"
@@ -6241,7 +6440,7 @@ msgstr ""
"perlihatkan cakupan konfigurasi (pohon kerja, lokal, global, sistem, "
"perintah)"
-#: builtin/config.c builtin/env--helper.c
+#: builtin/config.c
msgid "value"
msgstr "nilai"
@@ -6326,7 +6525,7 @@ msgstr "--blob hanya dapat digunakan di dalam repositori git"
msgid "--worktree can only be used inside a git repository"
msgstr "--worktree hanya dapat digunakan di dalam repositori git"
-#: builtin/config.c
+#: builtin/config.c builtin/gc.c
msgid "$HOME not set"
msgstr "$HOME tak disetel"
@@ -6416,31 +6615,44 @@ msgid ""
"\n"
"\tchmod 0700 %s"
msgstr ""
+"Perizinan pada direktori soket Anda terlalu longgar; pengguna lainnya\n"
+"dapat membaca kredensial tertembolok Anda. Pertimbangkan menjalankan:\n"
+"\n"
+"\tchmod 0700 %s"
#: builtin/credential-cache--daemon.c
msgid "print debugging messages to stderr"
-msgstr ""
+msgstr "cetak pesan penirkutuan ke kesalahan standar"
#: builtin/credential-cache--daemon.c
msgid "credential-cache--daemon unavailable; no unix socket support"
-msgstr ""
+msgstr "credential-cache--daemon tidak tersedia; tidak ada dukungan soket unix"
#: builtin/credential-cache.c
msgid "credential-cache unavailable; no unix socket support"
-msgstr ""
+msgstr "credential-cache tidak tersedia; tidak ada dukungan soket unix"
#: builtin/credential-store.c
#, c-format
msgid "unable to get credential storage lock in %d ms"
msgstr ""
+"tidak dapat mendapatkan kunci penyimpanan kredensial dalam %d milidetik"
+
+#: builtin/describe.c
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<mirip-komit>...]"
#: builtin/describe.c
-msgid "git describe [<options>] [<commit-ish>...]"
-msgstr "git describe [<opsi>] [<mirip-komit>...]"
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<penanda>]"
#: builtin/describe.c
-msgid "git describe [<options>] --dirty"
-msgstr "git describe [<opsi>] --dirty"
+msgid "git describe <blob>"
+msgstr "git describe <blob>"
#: builtin/describe.c
msgid "head"
@@ -6593,6 +6805,26 @@ msgstr "Tidak ada nama yang ditemukan, tidak dapat menjelaskan apapun."
msgid "option '%s' and commit-ishes cannot be used together"
msgstr "opsi '%s' dan mirip-komit tidak dapat digunakan bersamaan"
+#: builtin/diagnose.c
+msgid ""
+"git diagnose [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--mode=<mode>]"
+msgstr ""
+"git diagnose [(-o | --output-directory) <jalur>] [(-s | --suffix) <format>]\n"
+" [--mode=<mode>]"
+
+#: builtin/diagnose.c
+msgid "specify a destination for the diagnostics archive"
+msgstr "sebutkan tujuan untuk arsip diagnostik"
+
+#: builtin/diagnose.c
+msgid "specify a strftime format suffix for the filename"
+msgstr "sebutkan akhiran format strftime untuk nama berkas"
+
+#: builtin/diagnose.c
+msgid "specify the content of the diagnostic archive"
+msgstr "sebutkan isi arsip diagnostik"
+
#: builtin/diff-tree.c
msgid "--merge-base only works with two commits"
msgstr "--merge-base hanya bekerja dengan dua komit"
@@ -6603,6 +6835,10 @@ msgid "'%s': not a regular file or symlink"
msgstr "'%s': bukan berkas reguler atau tautan simbolik"
#: builtin/diff.c
+msgid "no merge given, only parents."
+msgstr "tidak ada penggabungan yang diberikan, hanya induk."
+
+#: builtin/diff.c
#, c-format
msgid "invalid option: %s"
msgstr "opsi tidak valid: %s"
@@ -6747,30 +6983,6 @@ msgstr "tidak ada <alat> yang diberikan untuk --tool=<alat>"
msgid "no <cmd> given for --extcmd=<cmd>"
msgstr "tidak ada <perintah> yang diberikan untuk --extcmd=<perintah>"
-#: builtin/env--helper.c
-msgid "git env--helper --type=[bool|ulong] <options> <env-var>"
-msgstr ""
-
-#: builtin/env--helper.c
-msgid "default for git_env_*(...) to fall back on"
-msgstr ""
-
-#: builtin/env--helper.c
-msgid "be quiet only use git_env_*() value as exit code"
-msgstr ""
-
-#: builtin/env--helper.c
-#, c-format
-msgid "option `--default' expects a boolean value with `--type=bool`, not `%s`"
-msgstr ""
-
-#: builtin/env--helper.c
-#, c-format
-msgid ""
-"option `--default' expects an unsigned long value with `--type=ulong`, not `"
-"%s`"
-msgstr ""
-
#: builtin/fast-export.c
msgid "git fast-export [<rev-list-opts>]"
msgstr "git fast-export [<opsi rev-list>]"
@@ -6916,152 +7128,17 @@ msgstr "git fetch --all [<opsi>]"
msgid "fetch.parallel cannot be negative"
msgstr "fetch.parallel tidak dapat bernilai negatif"
-#: builtin/fetch.c builtin/pull.c
-msgid "fetch from all remotes"
-msgstr "ambil dari semua remote"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "set upstream for git pull/fetch"
-msgstr "setel hulu untuk git pull/fetch"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "tambah ke .git/FETCH_HEAD daripada timpa"
-
-#: builtin/fetch.c
-msgid "use atomic transaction to update references"
-msgstr "gunakan transaksi atomik untuk memperbarui referensi"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "path to upload pack on remote end"
-msgstr "jalur ke paket unggah pada sisi remote"
-
-#: builtin/fetch.c
-msgid "force overwrite of local reference"
-msgstr "paksa timpa referensi lokal"
-
-#: builtin/fetch.c
-msgid "fetch from multiple remotes"
-msgstr "ambil dari banyak remote"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "fetch all tags and associated objects"
-msgstr "ambil semua tag dan objek yang bersesuaian"
-
-#: builtin/fetch.c
-msgid "do not fetch all tags (--no-tags)"
-msgstr "jangan ambil semua tag (--no-tags)"
-
-#: builtin/fetch.c
-msgid "number of submodules fetched in parallel"
-msgstr "jumlah submodul yang diambil secara bersamaan"
-
-#: builtin/fetch.c
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr ""
-"modifikasi spek referensi untuk tempatkan semua referensi di dalam refs/"
-"prefetch/"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "prune remote-tracking branches no longer on remote"
-msgstr "buang cabang pelacak remote yang tidak ada pada remote"
-
-#: builtin/fetch.c
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr "buang tag lokal yang tidak ada pada remote dan klob tag yang berubah"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "on-demand"
-msgstr "sesuai permintaan"
-
-#: builtin/fetch.c
-msgid "control recursive fetching of submodules"
-msgstr "kontrol pengambilan submodul rekursif"
-
-#: builtin/fetch.c
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "tulis referensi yang diambil ke berkas FETCH_HEAD"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "keep downloaded pack"
-msgstr "simpan paket yang diunduh"
-
-#: builtin/fetch.c
-msgid "allow updating of HEAD ref"
-msgstr "bolehkan perbarui referensi HEAD"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "deepen history of shallow clone"
-msgstr "perdalam riwayat klon dangkal"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "deepen history of shallow repository based on time"
-msgstr "perdalam riwayat repositori dangkal berdasarkan waktu"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "convert to a complete repository"
-msgstr "ubah ke repositori penuh"
-
-#: builtin/fetch.c
-msgid "re-fetch without negotiating common commits"
-msgstr "ambil ulang tanpa menegosiasikan komit yang sama"
-
-#: builtin/fetch.c
-msgid "prepend this to submodule path output"
-msgstr "tambahkan ini ke jalur keluaran submodul"
-
-#: builtin/fetch.c
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr ""
-"default untuk ambil submodul secara rekursif (prioritas lebih rendah "
-"dariberkas konfigurasi)"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "accept refs that update .git/shallow"
-msgstr "terima referensi yang memperbarui .git/shallow"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "refmap"
-msgstr "peta referensi"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "specify fetch refmap"
-msgstr "sebutkan ambil peta referensi"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "report that we have only objects reachable from this object"
-msgstr ""
-"laporkan bahwa kami hanya punya object yang bisa dicapai dari objek ini"
-
-#: builtin/fetch.c
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr ""
-"jangan ambil berkas pak; sebagai gantinya cetak leluhur dari ujung negosiasi"
-
-#: builtin/fetch.c
-msgid "run 'maintenance --auto' after fetching"
-msgstr "lakukan 'maintenance --auto' setelah pengambilan"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "check for forced-updates on all updated branches"
-msgstr "periksa pembaruan terpaksa pada semua cabang"
-
-#: builtin/fetch.c
-msgid "write the commit-graph after fetching"
-msgstr "tulis grafik komit setelah pengambilan"
-
-#: builtin/fetch.c
-msgid "accept refspecs from stdin"
-msgstr "terima spek referensi dari masukan standar"
-
#: builtin/fetch.c
msgid "couldn't find remote ref HEAD"
msgstr "tidak dapat menemukan referensi remote HEAD"
#: builtin/fetch.c
#, c-format
+msgid "From %.*s\n"
+msgstr "Dari %.*s\n"
+
+#: builtin/fetch.c
+#, c-format
msgid "object %s not found"
msgstr "objek %s tidak ditemukan"
@@ -7074,12 +7151,8 @@ msgid "[rejected]"
msgstr "[tertolak]"
#: builtin/fetch.c
-msgid "can't fetch in current branch"
-msgstr "tidak dapat mengambil di cabang saat ini"
-
-#: builtin/fetch.c
-msgid "checked out in another worktree"
-msgstr "ter-check out di dalam pohon kerja lainnya"
+msgid "can't fetch into checked-out branch"
+msgstr "tidak dapat mengambil ke dalam cabang ter-checkout"
#: builtin/fetch.c
msgid "[tag update]"
@@ -7155,11 +7228,6 @@ msgstr "tolak %s karena akar dangkal tidak diperkenankan untuk diperbarui"
#: builtin/fetch.c
#, c-format
-msgid "From %.*s\n"
-msgstr "Dari %.*s\n"
-
-#: builtin/fetch.c
-#, c-format
msgid ""
"some local refs could not be updated; try running\n"
" 'git remote prune %s' to remove any old, conflicting branches"
@@ -7270,6 +7338,146 @@ msgstr ""
msgid "you need to specify a tag name"
msgstr "Anda perlu sebutkan sebuah nama tag"
+#: builtin/fetch.c builtin/pull.c
+msgid "fetch from all remotes"
+msgstr "ambil dari semua remote"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "set upstream for git pull/fetch"
+msgstr "setel hulu untuk git pull/fetch"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "tambah ke .git/FETCH_HEAD daripada timpa"
+
+#: builtin/fetch.c
+msgid "use atomic transaction to update references"
+msgstr "gunakan transaksi atomik untuk memperbarui referensi"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "path to upload pack on remote end"
+msgstr "jalur ke paket unggah pada sisi remote"
+
+#: builtin/fetch.c
+msgid "force overwrite of local reference"
+msgstr "paksa timpa referensi lokal"
+
+#: builtin/fetch.c
+msgid "fetch from multiple remotes"
+msgstr "ambil dari banyak remote"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "fetch all tags and associated objects"
+msgstr "ambil semua tag dan objek yang bersesuaian"
+
+#: builtin/fetch.c
+msgid "do not fetch all tags (--no-tags)"
+msgstr "jangan ambil semua tag (--no-tags)"
+
+#: builtin/fetch.c
+msgid "number of submodules fetched in parallel"
+msgstr "jumlah submodul yang diambil secara bersamaan"
+
+#: builtin/fetch.c
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+"modifikasi spek referensi untuk tempatkan semua referensi di dalam refs/"
+"prefetch/"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "prune remote-tracking branches no longer on remote"
+msgstr "buang cabang pelacak remote yang tidak ada pada remote"
+
+#: builtin/fetch.c
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr "buang tag lokal yang tidak ada pada remote dan klob tag yang berubah"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "on-demand"
+msgstr "sesuai permintaan"
+
+#: builtin/fetch.c
+msgid "control recursive fetching of submodules"
+msgstr "kontrol pengambilan submodul rekursif"
+
+#: builtin/fetch.c
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "tulis referensi yang diambil ke berkas FETCH_HEAD"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "keep downloaded pack"
+msgstr "simpan paket yang diunduh"
+
+#: builtin/fetch.c
+msgid "allow updating of HEAD ref"
+msgstr "bolehkan perbarui referensi HEAD"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "deepen history of shallow clone"
+msgstr "perdalam riwayat klon dangkal"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "deepen history of shallow repository based on time"
+msgstr "perdalam riwayat repositori dangkal berdasarkan waktu"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "convert to a complete repository"
+msgstr "ubah ke repositori penuh"
+
+#: builtin/fetch.c
+msgid "re-fetch without negotiating common commits"
+msgstr "ambil ulang tanpa menegosiasikan komit yang sama"
+
+#: builtin/fetch.c
+msgid "prepend this to submodule path output"
+msgstr "tambahkan ini ke jalur keluaran submodul"
+
+#: builtin/fetch.c
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+"default untuk ambil submodul secara rekursif (prioritas lebih rendah "
+"dariberkas konfigurasi)"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "accept refs that update .git/shallow"
+msgstr "terima referensi yang memperbarui .git/shallow"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "refmap"
+msgstr "peta referensi"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "specify fetch refmap"
+msgstr "sebutkan ambil peta referensi"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "report that we have only objects reachable from this object"
+msgstr ""
+"laporkan bahwa kami hanya punya object yang bisa dicapai dari objek ini"
+
+#: builtin/fetch.c
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr ""
+"jangan ambil berkas pak; sebagai gantinya cetak leluhur dari ujung negosiasi"
+
+#: builtin/fetch.c
+msgid "run 'maintenance --auto' after fetching"
+msgstr "lakukan 'maintenance --auto' setelah pengambilan"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "check for forced-updates on all updated branches"
+msgstr "periksa pembaruan terpaksa pada semua cabang"
+
+#: builtin/fetch.c
+msgid "write the commit-graph after fetching"
+msgstr "tulis grafik komit setelah pengambilan"
+
+#: builtin/fetch.c
+msgid "accept refspecs from stdin"
+msgstr "terima spek referensi dari masukan standar"
+
#: builtin/fetch.c
msgid "--negotiate-only needs one or more --negotiation-tip=*"
msgstr "--negotiate-only perlu satu atau lebih --negotiation-tip=*"
@@ -7283,6 +7491,11 @@ msgid "--unshallow on a complete repository does not make sense"
msgstr "--unshallow pada repositori penuh tidak masuk akal"
#: builtin/fetch.c
+#, c-format
+msgid "failed to fetch bundles from '%s'"
+msgstr "gagal mengambil bundel dari '%s'"
+
+#: builtin/fetch.c
msgid "fetch --all does not take a repository argument"
msgstr "fetch --all tidak mengambil argumen repositori"
@@ -7327,106 +7540,120 @@ msgstr "--stdin hanya dapat digunakan saat mengambil dari satu remote"
msgid ""
"git fmt-merge-msg [-m <message>] [--log[=<n>] | --no-log] [--file <file>]"
msgstr ""
+"git fmt-merge-msg [-m <pesan>] [--log[=<n>] | --no-log] [--file <berkas>]"
#: builtin/fmt-merge-msg.c
msgid "populate log with at most <n> entries from shortlog"
-msgstr ""
+msgstr "isi log dengan paling banyak <n> entri dari shortlog"
#: builtin/fmt-merge-msg.c
msgid "alias for --log (deprecated)"
-msgstr ""
+msgstr "alias untuk --log (usang)"
#: builtin/fmt-merge-msg.c
msgid "text"
-msgstr ""
+msgstr "teks"
#: builtin/fmt-merge-msg.c
msgid "use <text> as start of message"
-msgstr ""
+msgstr "gunakan <teks> sebagai awal pesan"
#: builtin/fmt-merge-msg.c
msgid "use <name> instead of the real target branch"
-msgstr ""
+msgstr "gunakan <nama> daripada cabang target sebenarnya"
#: builtin/fmt-merge-msg.c
msgid "file to read from"
-msgstr ""
+msgstr "berkas untuk dibaca"
#: builtin/for-each-ref.c
msgid "git for-each-ref [<options>] [<pattern>]"
-msgstr ""
+msgstr "git for-each-ref [<opsi>] [<pola>]"
#: builtin/for-each-ref.c
msgid "git for-each-ref [--points-at <object>]"
-msgstr ""
+msgstr "git for-each-ref [--points-at <objek>]"
#: builtin/for-each-ref.c
msgid "git for-each-ref [--merged [<commit>]] [--no-merged [<commit>]]"
-msgstr ""
+msgstr "git for-each-ref [--merged [<komit>]] [--no-merged [<komit>]]"
#: builtin/for-each-ref.c
msgid "git for-each-ref [--contains [<commit>]] [--no-contains [<commit>]]"
-msgstr ""
+msgstr "git for-each-ref [--contains [<komit>]] [--no-contains [<komit>]]"
#: builtin/for-each-ref.c
msgid "quote placeholders suitably for shells"
-msgstr ""
+msgstr "kutip tempat penampung yang sesuai untuk cangkang"
#: builtin/for-each-ref.c
msgid "quote placeholders suitably for perl"
-msgstr ""
+msgstr "kutip tempat penampung yang sesuai untuk perl"
#: builtin/for-each-ref.c
msgid "quote placeholders suitably for python"
-msgstr ""
+msgstr "kutip tempat penampung yang sesuai untuk python"
#: builtin/for-each-ref.c
msgid "quote placeholders suitably for Tcl"
-msgstr ""
+msgstr "kutip tempat penampung yang sesuai untuk Tcl"
#: builtin/for-each-ref.c
msgid "show only <n> matched refs"
-msgstr ""
+msgstr "hanya perlihatkan <n> referensi yang cocok"
#: builtin/for-each-ref.c builtin/tag.c
msgid "respect format colors"
-msgstr ""
+msgstr "hargai warna format"
#: builtin/for-each-ref.c
msgid "print only refs which points at the given object"
-msgstr ""
+msgstr "hanya cetak referensi yang menunjuk pada objek yang diberikan"
#: builtin/for-each-ref.c
msgid "print only refs that are merged"
-msgstr ""
+msgstr "hanya cetak referensi yang tergabung"
#: builtin/for-each-ref.c
msgid "print only refs that are not merged"
-msgstr ""
+msgstr "hanya cetak referensi yang tidak tergabung"
#: builtin/for-each-ref.c
msgid "print only refs which contain the commit"
-msgstr ""
+msgstr "hanya cetak referensi yang berisi komit"
#: builtin/for-each-ref.c
msgid "print only refs which don't contain the commit"
-msgstr ""
+msgstr "hanya cetak referensi yang tidak berisi komit"
+
+#: builtin/for-each-ref.c
+msgid "read reference patterns from stdin"
+msgstr "baca pola referensi dari masukan standar"
+
+#: builtin/for-each-ref.c
+msgid "unknown arguments supplied with --stdin"
+msgstr "argumen tidak dikenal diberikan dengan --stdin"
#: builtin/for-each-repo.c
-msgid "git for-each-repo --config=<config> <command-args>"
-msgstr ""
+msgid "git for-each-repo --config=<config> [--] <arguments>"
+msgstr "git for-each-repo --config=<konfigurasi> [--] <argumen perintah>"
#: builtin/for-each-repo.c
msgid "config"
-msgstr ""
+msgstr "konfigurasi"
#: builtin/for-each-repo.c
msgid "config key storing a list of repository paths"
-msgstr ""
+msgstr "kunci konfigurasi yang menampung daftar jalur repositori"
#: builtin/for-each-repo.c
msgid "missing --config=<config>"
-msgstr ""
+msgstr "kehilangan --config=<config>"
+
+#: builtin/for-each-repo.c
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "dapat konfigurasi jelek --config=%s"
#: builtin/fsck.c
msgid "unknown"
@@ -7613,21 +7840,45 @@ msgid "notice: %s points to an unborn branch (%s)"
msgstr "catatan: %s menunjuk ke cabang yang belum lahir (%s)"
#: builtin/fsck.c
-msgid "Checking cache tree"
-msgstr "Memeriksa pohon tembolok"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "Memeriksa pohon tembolok %s"
#: builtin/fsck.c
#, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "%s: penunjuk sha1 tidak valid pada pohon tembolok"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s: penunjuk sha1 tidak valid pada pohon tembolok %s"
#: builtin/fsck.c
msgid "non-tree in cache-tree"
msgstr "bukan pohon pada pohon tembolok"
#: builtin/fsck.c
-msgid "git fsck [<options>] [<object>...]"
-msgstr "git fsck [<opsi>] [<objek>...]"
+#, c-format
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s: penunjuk sha1 tidak valid di resolve-undo %s"
+
+#: builtin/fsck.c
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "tidak dapat memuat indeks balik untuk pak '%s'"
+
+#: builtin/fsck.c
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "indeks balik tidak valid untuk pak '%s'"
+
+#: builtin/fsck.c
+msgid ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<object>...]"
+msgstr ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<objek>...]"
#: builtin/fsck.c
msgid "show unreachable objects"
@@ -7693,128 +7944,121 @@ msgstr "parameter tidak valid: sha1 diharapkan, dapat '%s'"
#: builtin/fsmonitor--daemon.c
msgid "git fsmonitor--daemon start [<options>]"
-msgstr ""
+msgstr "git fsmonitor--daemon start [<opsi>]"
#: builtin/fsmonitor--daemon.c
msgid "git fsmonitor--daemon run [<options>]"
-msgstr ""
-
-#: builtin/fsmonitor--daemon.c
-msgid "git fsmonitor--daemon stop"
-msgstr ""
-
-#: builtin/fsmonitor--daemon.c
-msgid "git fsmonitor--daemon status"
-msgstr ""
+msgstr "git fsmonitor--daemon run [<opsi>]"
#: builtin/fsmonitor--daemon.c
#, c-format
msgid "value of '%s' out of range: %d"
-msgstr ""
+msgstr "nilai '%s' di luar jangkauan: %d"
#: builtin/fsmonitor--daemon.c
#, c-format
msgid "value of '%s' not bool or int: %d"
-msgstr ""
+msgstr "nilai '%s' bukan bool atau int: %d"
#: builtin/fsmonitor--daemon.c
#, c-format
msgid "fsmonitor-daemon is watching '%s'\n"
-msgstr ""
+msgstr "fsmonitor-daemon mengawasi '%s'\n"
#: builtin/fsmonitor--daemon.c
#, c-format
msgid "fsmonitor-daemon is not watching '%s'\n"
-msgstr ""
+msgstr "fsmonitor-daemon tidak mengawasi '%s'\n"
#: builtin/fsmonitor--daemon.c
#, c-format
msgid "could not create fsmonitor cookie '%s'"
-msgstr ""
+msgstr "tidak dapat membuat kuki fsmonitor '%s'"
#: builtin/fsmonitor--daemon.c
#, c-format
msgid "fsmonitor: cookie_result '%d' != SEEN"
-msgstr ""
+msgstr "fsmonitor: cookie_result '%d' != SEEN"
#: builtin/fsmonitor--daemon.c
#, c-format
msgid "could not start IPC thread pool on '%s'"
-msgstr ""
+msgstr "tidak dapat memulai lubuk utas IPC pada '%s'"
#: builtin/fsmonitor--daemon.c
msgid "could not start fsmonitor listener thread"
-msgstr ""
+msgstr "tidak dapat memulai utas pendengar fsmonitor"
#: builtin/fsmonitor--daemon.c
msgid "could not start fsmonitor health thread"
-msgstr ""
+msgstr "tidak dapat memulai utas kesehatan fsmonitor"
#: builtin/fsmonitor--daemon.c
msgid "could not initialize listener thread"
-msgstr ""
+msgstr "tidak dapat menginisialisasi utas pendengar"
#: builtin/fsmonitor--daemon.c
msgid "could not initialize health thread"
-msgstr ""
+msgstr "tidak dapat menginisialisasi utas kesehatan"
#: builtin/fsmonitor--daemon.c
#, c-format
msgid "could not cd home '%s'"
-msgstr ""
+msgstr "tidak dapat berganti direktori ke rumah '%s'"
#: builtin/fsmonitor--daemon.c
#, c-format
msgid "fsmonitor--daemon is already running '%s'"
-msgstr ""
+msgstr "fsmonitor--daemon sudah berjalan '%s'"
#: builtin/fsmonitor--daemon.c
#, c-format
msgid "running fsmonitor-daemon in '%s'\n"
-msgstr ""
+msgstr "menjalankan fsmonitor-daemon di '%s'\n"
#: builtin/fsmonitor--daemon.c
#, c-format
msgid "starting fsmonitor-daemon in '%s'\n"
-msgstr ""
+msgstr "menjalankan fsmonitor-daemon di '%s'\n"
#: builtin/fsmonitor--daemon.c
msgid "daemon failed to start"
-msgstr ""
+msgstr "daemon gagal dijalankan"
#: builtin/fsmonitor--daemon.c
msgid "daemon not online yet"
-msgstr ""
+msgstr "daemon belum daring"
#: builtin/fsmonitor--daemon.c
msgid "daemon terminated"
-msgstr ""
+msgstr "daemon berhenti"
#: builtin/fsmonitor--daemon.c
msgid "detach from console"
-msgstr ""
+msgstr "lepas dari konsol"
#: builtin/fsmonitor--daemon.c
msgid "use <n> ipc worker threads"
-msgstr ""
+msgstr "gunakan <n> utas pekerja ipc"
#: builtin/fsmonitor--daemon.c
msgid "max seconds to wait for background daemon startup"
msgstr ""
+"maksimal waktu (detik) untuk menunggu dimulainya daemon dari balik layar"
#: builtin/fsmonitor--daemon.c
#, c-format
msgid "invalid 'ipc-threads' value (%d)"
-msgstr ""
+msgstr "nilai 'ipc-threads' tidak valid (%d)"
-#: builtin/fsmonitor--daemon.c
+#: builtin/fsmonitor--daemon.c t/helper/test-cache-tree.c
#, c-format
msgid "Unhandled subcommand '%s'"
-msgstr ""
+msgstr "Subperintah tidak tertangani '%s'"
#: builtin/fsmonitor--daemon.c
msgid "fsmonitor--daemon not supported on this platform"
-msgstr ""
+msgstr "fsmonitor--daemon tidak didukung pada platform ini"
#: builtin/gc.c
msgid "git gc [<options>]"
@@ -7830,7 +8074,7 @@ msgstr "Gagal men-fstat %s: %s"
msgid "failed to parse '%s' value '%s'"
msgstr "gagal menguraikan nilai '%s' '%s'"
-#: builtin/gc.c builtin/init-db.c
+#: builtin/gc.c setup.c
#, c-format
msgid "cannot stat '%s'"
msgstr "tidak dapat men-stat '%s'"
@@ -7858,6 +8102,10 @@ msgstr "pangkas objek tak tereferensi"
msgid "pack unreferenced objects separately"
msgstr "pak objek tak terujuk secara terpisah"
+#: builtin/gc.c builtin/repack.c
+msgid "with --cruft, limit the size of new cruft packs"
+msgstr "batasi ukuran pak sisa dengan --cruft"
+
#: builtin/gc.c
msgid "be more thorough (increased runtime)"
msgstr "jadi lebih cermat (waktu yang dijalankan bertambah)"
@@ -8012,8 +8260,23 @@ msgid "use at most one of --auto and --schedule=<frequency>"
msgstr "gunakan paling banyak satu dari --auto dan --schedule=<frekuensi>"
#: builtin/gc.c
-msgid "failed to run 'git config'"
-msgstr "gagal menjalankan 'git config'"
+#, c-format
+msgid "unable to add '%s' value of '%s'"
+msgstr "tidak dapat menambahkan nilai '%s' dari '%s'"
+
+#: builtin/gc.c
+msgid "return success even if repository was not registered"
+msgstr "kembalikan sukses bahkan jika repositori tidak terdaftar"
+
+#: builtin/gc.c
+#, c-format
+msgid "unable to unset '%s' value of '%s'"
+msgstr "tidak dapat membatal-setel nilai '%s' dari '%s'"
+
+#: builtin/gc.c
+#, c-format
+msgid "repository '%s' is not registered"
+msgstr "repositori '%s' tidak terdaftar"
#: builtin/gc.c
#, c-format
@@ -8048,26 +8311,22 @@ msgstr ""
"gagal menjalankan 'crontab -l'; sistem Anda mungkin tidak mendukung 'cron'"
#: builtin/gc.c
+msgid "failed to create crontab temporary file"
+msgstr "tidak dapat membuat berkas crontab sementara"
+
+#: builtin/gc.c
+msgid "failed to open temporary file"
+msgstr "tidak dapat membuka berkas sementara"
+
+#: builtin/gc.c
msgid "failed to run 'crontab'; your system might not support 'cron'"
msgstr ""
"gagal menjalankan 'crontab'; sistem Anda mungkin tidak mendukung 'cron'"
#: builtin/gc.c
-msgid "failed to open stdin of 'crontab'"
-msgstr "gagal membuka masukan standar dari 'crontab'"
-
-#: builtin/gc.c
msgid "'crontab' died"
msgstr "'crontab' mati"
-#: builtin/gc.c
-msgid "failed to start systemctl"
-msgstr "gagal memulai systemctl"
-
-#: builtin/gc.c
-msgid "failed to run systemctl"
-msgstr "gagal menjalankan systemctl"
-
#: builtin/gc.c builtin/worktree.c
#, c-format
msgid "failed to delete '%s'"
@@ -8079,6 +8338,14 @@ msgid "failed to flush '%s'"
msgstr "gagal membilas '%s'"
#: builtin/gc.c
+msgid "failed to start systemctl"
+msgstr "gagal memulai systemctl"
+
+#: builtin/gc.c
+msgid "failed to run systemctl"
+msgstr "gagal menjalankan systemctl"
+
+#: builtin/gc.c
#, c-format
msgid "unrecognized --scheduler argument '%s'"
msgstr "argumen --scheduler tidak dikenal '%s'"
@@ -8109,6 +8376,10 @@ msgid "scheduler to trigger git maintenance run"
msgstr "penjadwal untuk memicu git maintenance run"
#: builtin/gc.c
+msgid "failed to set up maintenance schedule"
+msgstr "gagal mempersiapkan jadwal pemeliharaan"
+
+#: builtin/gc.c
msgid "failed to add repo to global config"
msgstr "gagal menambahkan repositori ke konfigurasi global"
@@ -8116,11 +8387,6 @@ msgstr "gagal menambahkan repositori ke konfigurasi global"
msgid "git maintenance <subcommand> [<options>]"
msgstr "git maintenance <subperintah> [<opsi>]"
-#: builtin/gc.c
-#, c-format
-msgid "invalid subcommand: %s"
-msgstr "subperintah tidak valid: %s"
-
#: builtin/grep.c
msgid "git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]"
msgstr "git grep [<opsi>] [-e] <pola> [<revisi>...] [[--] <pola>...]"
@@ -8152,6 +8418,11 @@ msgstr "tidak dapat membaca pohon (%s)"
#: builtin/grep.c
#, c-format
+msgid "unable to read tree %s"
+msgstr "tidak dapat membaca pohon %s"
+
+#: builtin/grep.c
+#, c-format
msgid "unable to grep from object of type %s"
msgstr "tidak dapan men-grep dari objek dengan tipe %s"
@@ -8209,7 +8480,7 @@ msgid "search in subdirectories (default)"
msgstr "cari dalam subdirektori (asali)"
#: builtin/grep.c
-msgid "descend at most <depth> levels"
+msgid "descend at most <n> levels"
msgstr "turun paling banyak <kedalaman> tingkat"
#: builtin/grep.c
@@ -8346,6 +8617,10 @@ msgid "allow calling of grep(1) (ignored by this build)"
msgstr "perbolehkan pemanggilan grep(1) (diabaikan oleh bangunan ini)"
#: builtin/grep.c
+msgid "maximum number of results per file"
+msgstr "jumlah hasil maksimum tiap berkas"
+
+#: builtin/grep.c
msgid "no pattern given"
msgstr "tidak ada pola yang diberikan"
@@ -8389,11 +8664,15 @@ msgstr "baik --cached dan pohon diberikan"
#: builtin/hash-object.c
msgid ""
-"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] "
-"[--] <file>..."
+"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
+" [--stdin [--literally]] [--] <file>..."
msgstr ""
-"git hash-object [-t <tipe>] [-w] [--path=<berkas> | --no-filters] [--stdin] "
-"[--] <berkas>..."
+"git hash-object [-t <tipe>] [-w] [--path=<berkas> | --no-filters]\n"
+" [--stdin [--literally]] [--] <berkas>..."
+
+#: builtin/hash-object.c
+msgid "git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]"
+msgstr "git hash-object [-t <tipe>] [-w] --stdin-paths [--no-filters]"
#: builtin/hash-object.c
msgid "object type"
@@ -8458,12 +8737,23 @@ msgid "print list of useful guides"
msgstr "cetak daftar panduan berguna"
#: builtin/help.c
+msgid "print list of user-facing repository, command and file interfaces"
+msgstr ""
+"cetak daftar repositori, perintah, dan antarmuka berkas yang menghadap "
+"pengguna"
+
+#: builtin/help.c
+msgid "print list of file formats, protocols and other developer interfaces"
+msgstr "cetak daftar format berkas, protokol, dan antarmuka pengembang lainnya"
+
+#: builtin/help.c
msgid "print all configuration variable names"
msgstr "cetak semua nama variabel konfigurasi"
#: builtin/help.c
-msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>]"
-msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<perintah>]"
+msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"
+msgstr ""
+"git help [[-i|--info] [-m|--man] [-w|--web]] [<perintah>|<dokumentasi>]"
#: builtin/help.c
#, c-format
@@ -8538,6 +8828,7 @@ msgstr "opsi '%s' tidak mengambil argumen bukan opsi"
msgid ""
"the '--no-[external-commands|aliases]' options can only be used with '--all'"
msgstr ""
+"opsi '--no-[external-commands|aliases]' hanya dapat digunakan dengan '--all'"
#: builtin/help.c
#, c-format
@@ -8549,12 +8840,20 @@ msgid "'git help config' for more information"
msgstr "'git help config' untuk informasi lebih lanjut"
#: builtin/hook.c
-msgid "git hook run [--ignore-missing] <hook-name> [-- <hook-args>]"
+msgid ""
+"git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-"
+"args>]"
msgstr ""
+"git hook run [--ignore-missing] [--to-stdin=<jalur>] <nama kait> [-- "
+"<argumen kait>]"
#: builtin/hook.c
msgid "silently ignore missing requested <hook-name>"
-msgstr ""
+msgstr "diam-diam abaikan <nama kait> yang diminta yang hilang"
+
+#: builtin/hook.c
+msgid "file to read into hooks' stdin"
+msgstr "gagal membaca masukan standar kait"
#: builtin/index-pack.c
#, c-format
@@ -8651,11 +8950,6 @@ msgstr "inkonsistensi inflate serius"
msgid "SHA1 COLLISION FOUND WITH %s !"
msgstr "TUMBUKAN SHA1 DITEMUKAN DENGAN %s !"
-#: builtin/index-pack.c builtin/pack-objects.c
-#, c-format
-msgid "unable to read %s"
-msgstr "tidak dapat membaca %s"
-
#: builtin/index-pack.c
#, c-format
msgid "cannot read existing object info %s"
@@ -8812,7 +9106,7 @@ msgstr "tidak dapat kembali ke direktori kerja saat ini"
msgid "bad %s"
msgstr "%s jelek"
-#: builtin/index-pack.c builtin/init-db.c
+#: builtin/index-pack.c builtin/init-db.c setup.c
#, c-format
msgid "unknown hash algorithm '%s'"
msgstr "algoritma hash tak dikenal '%s'"
@@ -8830,101 +9124,18 @@ msgid "fsck error in pack objects"
msgstr "kesalahan fsck dalam objek paket"
#: builtin/init-db.c
-#, c-format
-msgid "cannot stat template '%s'"
-msgstr "tidak dapat men-stat templat '%s'"
-
-#: builtin/init-db.c
-#, c-format
-msgid "cannot opendir '%s'"
-msgstr "tidak dapat membuka direktori '%s'"
-
-#: builtin/init-db.c
-#, c-format
-msgid "cannot readlink '%s'"
-msgstr "tidak dapat membaca tautan '%s'"
-
-#: builtin/init-db.c
-#, c-format
-msgid "cannot symlink '%s' '%s'"
-msgstr "tidak dapat menautkan simbolik '%s' '%s'"
-
-#: builtin/init-db.c
-#, c-format
-msgid "cannot copy '%s' to '%s'"
-msgstr "tidak dapat menyalin '%s' ke '%s'"
-
-#: builtin/init-db.c
-#, c-format
-msgid "ignoring template %s"
-msgstr "mengabaikan templat %s"
-
-#: builtin/init-db.c
-#, c-format
-msgid "templates not found in %s"
-msgstr "templat tidak ditemukan di %s"
-
-#: builtin/init-db.c
-#, c-format
-msgid "not copying templates from '%s': %s"
-msgstr "tidak menyalin templat dari '%s': %s"
-
-#: builtin/init-db.c
-#, c-format
-msgid "invalid initial branch name: '%s'"
-msgstr "nama cabang asal salah: '%s'"
-
-#: builtin/init-db.c
-#, c-format
-msgid "unable to handle file type %d"
-msgstr "tidak dapat menangani tipe berkas %d"
-
-#: builtin/init-db.c
-#, c-format
-msgid "unable to move %s to %s"
-msgstr "tidak dapat memindahkan %s ke %s"
-
-#: builtin/init-db.c
-msgid "attempt to reinitialize repository with different hash"
-msgstr "mencoba menginisialisasi ulang repositori dengan hash yang berbeda"
-
-#: builtin/init-db.c
-#, c-format
-msgid "%s already exists"
-msgstr "%s sudah ada"
-
-#: builtin/init-db.c
-#, c-format
-msgid "re-init: ignored --initial-branch=%s"
-msgstr "re-init: --initial-branch=%s diabaikan"
-
-#: builtin/init-db.c
-#, c-format
-msgid "Reinitialized existing shared Git repository in %s%s\n"
-msgstr "Repositori berbagi Git yang sudah ada diinisialisasi ulang di %s%s\n"
-
-#: builtin/init-db.c
-#, c-format
-msgid "Reinitialized existing Git repository in %s%s\n"
-msgstr "Repositori Git diinisialisasi ulang di %s%s\n"
-
-#: builtin/init-db.c
-#, c-format
-msgid "Initialized empty shared Git repository in %s%s\n"
-msgstr "Repositori berbagi Git kosong diinisialisasi di %s%s\n"
-
-#: builtin/init-db.c
-#, c-format
-msgid "Initialized empty Git repository in %s%s\n"
-msgstr "Repositori Git kosong dinisialisasi di %s%s\n"
-
-#: builtin/init-db.c
msgid ""
-"git init [-q | --quiet] [--bare] [--template=<template-directory>] [--"
-"shared[=<permissions>]] [<directory>]"
+"git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
+" [--separate-git-dir <git-dir>] [--object-format=<format>]\n"
+" [--ref-format=<format>]\n"
+" [-b <branch-name> | --initial-branch=<branch-name>]\n"
+" [--shared[=<permissions>]] [<directory>]"
msgstr ""
-"git init [-q | --quiet] [--bare] [--template=<direktori-templat>][--"
-"shared[=<perizinan>]] [<direktori>]"
+"git init [-q | --quiet] [--bare] [--template=<direktori templat>]\n"
+" [--separate-git-dir <direktori git>] [--object-format=<format>]\n"
+"\t [--ref-format=<format>]\n"
+" [-b <nama cabang> | --initial-branch=<nama cabang>]\n"
+" [--shared[=<perizinan>]] [<direktori>]"
#: builtin/init-db.c
msgid "permissions"
@@ -8977,61 +9188,70 @@ msgstr "--separate-git-dir tidak kompatibel dengan repositori bare"
#: builtin/interpret-trailers.c
msgid ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"<token>[(=|:)<value>])...] [<file>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<key>|<keyAlias>)[(=|:)<value>])...]\n"
+" [--parse] [<file>...]"
msgstr ""
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<kunci>|<alias kunci>)"
+"[(=|:)<nilai>])...]\n"
+" [--parse] [<berkas>...]"
#: builtin/interpret-trailers.c
msgid "edit files in place"
-msgstr ""
+msgstr "sunting berkas di tempat"
#: builtin/interpret-trailers.c
msgid "trim empty trailers"
-msgstr ""
+msgstr "pangkas trailer kosong"
+
+#: builtin/interpret-trailers.c
+msgid "placement"
+msgstr "penempatan"
#: builtin/interpret-trailers.c
msgid "where to place the new trailer"
-msgstr ""
+msgstr "dimana trailer baru ditempatkan"
#: builtin/interpret-trailers.c
msgid "action if trailer already exists"
-msgstr ""
+msgstr "tindakan jika trailer sudah ada"
#: builtin/interpret-trailers.c
msgid "action if trailer is missing"
-msgstr ""
+msgstr "tindakan jika trailer hilang"
#: builtin/interpret-trailers.c
msgid "output only the trailers"
-msgstr ""
+msgstr "keluarkan hanya trailer"
#: builtin/interpret-trailers.c
-msgid "do not apply config rules"
-msgstr ""
+msgid "do not apply trailer.* configuration variables"
+msgstr "jangan terapkan variabel konfigurasi trailer.*"
#: builtin/interpret-trailers.c
-msgid "join whitespace-continued values"
-msgstr ""
+msgid "reformat multiline trailer values as single-line values"
+msgstr "format ulang nilai trailer multibaris sebagai nilai satu baris."
#: builtin/interpret-trailers.c
-msgid "set parsing options"
-msgstr ""
+msgid "alias for --only-trailers --only-input --unfold"
+msgstr "alias untuk --only-trailers --only-input --unfold"
#: builtin/interpret-trailers.c
-msgid "do not treat --- specially"
-msgstr ""
+msgid "do not treat \"---\" as the end of input"
+msgstr "jangan perlakukan \"---\" sebagai ujung masukan"
#: builtin/interpret-trailers.c
msgid "trailer(s) to add"
-msgstr ""
+msgstr "trailer untuk ditambah"
#: builtin/interpret-trailers.c
msgid "--trailer with --only-input does not make sense"
-msgstr ""
+msgstr "--trailer dengan --only-input tidak masuk akal"
#: builtin/interpret-trailers.c
msgid "no input file given for in-place editing"
-msgstr ""
+msgstr "tidak ada berkas masukan yang diberikan untuk penyuntingan di tempat"
#: builtin/log.c
msgid "git log [<options>] [<revision-range>] [[--] <path>...]"
@@ -9055,8 +9275,8 @@ msgid "show source"
msgstr "perlihatkan sumber"
#: builtin/log.c
-msgid "use mail map file"
-msgstr "gunakan berkas peta surat"
+msgid "clear all previously-defined decoration filters"
+msgstr "bersihkan semua penyaring dekorasi yang sebelumnya didefinisikan"
#: builtin/log.c
msgid "only decorate refs that match <pattern>"
@@ -9078,7 +9298,7 @@ msgstr ""
"lacak evolusi rentang baris <awal>,<akhir> atau fungsi :<nama fungsi> dalam "
"<berkas>"
-#: builtin/log.c builtin/shortlog.c bundle.c
+#: builtin/log.c builtin/replay.c builtin/shortlog.c bundle.c
#, c-format
msgid "unrecognized argument: %s"
msgstr "argumen tidak dikenal: %s"
@@ -9134,6 +9354,11 @@ msgid "not a range"
msgstr "bukan sebuah rentang"
#: builtin/log.c
+#, c-format
+msgid "unable to read branch description file '%s'"
+msgstr "tidak dapat membaca berkas deskripsi cabang '%s'"
+
+#: builtin/log.c
msgid "cover letter needs email format"
msgstr "sampul surat butuh format email"
@@ -9262,6 +9487,10 @@ msgid "generate parts of a cover letter based on a branch's description"
msgstr "buat bagian dari sampul surat berdasarkan deskripsi cabang"
#: builtin/log.c
+msgid "use branch description from file"
+msgstr "gunakan deskripsi cabang dari berkas"
+
+#: builtin/log.c
msgid "use [<prefix>] instead of [PATCH]"
msgstr "gunakan [<prefix>] daripada [PATCH]"
@@ -9390,6 +9619,10 @@ msgid "percentage by which creation is weighted"
msgstr "persentase dimana pembuatan tertimbang"
#: builtin/log.c
+msgid "show in-body From: even if identical to the e-mail header"
+msgstr "perlihatkan From: dalam tubuh bahkan jika sama dengan kepala surel"
+
+#: builtin/log.c
#, c-format
msgid "invalid ident line: %s"
msgstr "baris identitas tidak valid: %s"
@@ -9466,11 +9699,31 @@ msgstr ""
"Tidak dapat menemukan cabang remote terlacak, mohon sebutkan <hulu>\n"
"secara manual.\n"
+#: builtin/ls-files.c builtin/ls-tree.c
+#, c-format
+msgid "could not get object info about '%s'"
+msgstr "tidak dapat mendapatkan info objek tentang '%s'"
+
+#: builtin/ls-files.c
+#, c-format
+msgid "bad ls-files format: element '%s' does not start with '('"
+msgstr "format ls-files jelek: elemen '%s' tidak dimulai dengan '('"
+
+#: builtin/ls-files.c
+#, c-format
+msgid "bad ls-files format: element '%s' does not end in ')'"
+msgstr "format ls-files jelek: elemen '%s' tidak diakhiri dengan ')'"
+
+#: builtin/ls-files.c
+#, c-format
+msgid "bad ls-files format: %%%.*s"
+msgstr "format ls-files jelek: %%%.*s"
+
#: builtin/ls-files.c
msgid "git ls-files [<options>] [<file>...]"
msgstr "git ls-files [<opsi>] [<berkas>...]"
-#: builtin/ls-files.c
+#: builtin/ls-files.c builtin/merge-tree.c
msgid "separate paths with the NUL character"
msgstr "pisahkan jalur dengan karakter NUL"
@@ -9579,15 +9832,23 @@ msgstr "hapus entri duplikat"
msgid "show sparse directories in the presence of a sparse index"
msgstr "perlihatkan direktori tipis di hadapan indeks tipis"
+#: builtin/ls-files.c
+msgid ""
+"--format cannot be used with -s, -o, -k, -t, --resolve-undo, --deduplicate, "
+"--eol"
+msgstr ""
+"--format tidak dapat digunakan dengan -s, -o, -k, -t, --resolve-undo, --"
+"deduplicate, --eol"
+
#: builtin/ls-remote.c
msgid ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<repository> [<refs>...]]"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
+" [--symref] [<repository> [<patterns>...]]"
msgstr ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<repositori> [<referensi>...]]"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<kunci>]\n"
+" [--symref] [<repositori> [<pola>...]]"
#: builtin/ls-remote.c
msgid "do not print remote URL"
@@ -9632,11 +9893,6 @@ msgstr "git ls-tree [<opsi>] <mirip-pohon> [<jalur>...]"
#: builtin/ls-tree.c
#, c-format
-msgid "could not get object info about '%s'"
-msgstr "tidak dapat mendapatkan info objek tentang '%s'"
-
-#: builtin/ls-tree.c
-#, c-format
msgid "bad ls-tree format: element '%s' does not start with '('"
msgstr "format ls-tree jelek: elemen '%s' tidak dimulai dengan '('"
@@ -9695,60 +9951,60 @@ msgstr "--format tidak dapat digabungkan opsi pengubah format lainnya"
#. TRANSLATORS: keep <> in "<" mail ">" info.
#: builtin/mailinfo.c
msgid "git mailinfo [<options>] <msg> <patch> < mail >info"
-msgstr ""
+msgstr "git mailinfo [<opsi>] <pesan> <tambalan> < surat >info"
#: builtin/mailinfo.c
msgid "keep subject"
-msgstr ""
+msgstr "pertahankan subjek"
#: builtin/mailinfo.c
msgid "keep non patch brackets in subject"
-msgstr ""
+msgstr "pertahankan tanda kurung non tambalan dalam subjek"
#: builtin/mailinfo.c
msgid "copy Message-ID to the end of commit message"
-msgstr ""
+msgstr "salin Message-ID pada akhir pesan komit"
#: builtin/mailinfo.c
msgid "re-code metadata to i18n.commitEncoding"
-msgstr ""
+msgstr "kodekan ulang metadata ke i18n.commitEncoding"
#: builtin/mailinfo.c
msgid "disable charset re-coding of metadata"
-msgstr ""
+msgstr "nonaktifkan pengkodean ulang set karakter metadata"
#: builtin/mailinfo.c
msgid "encoding"
-msgstr ""
+msgstr "pengkodean"
#: builtin/mailinfo.c
msgid "re-code metadata to this encoding"
-msgstr ""
+msgstr "kodekan ulang metadata ke pengkodean ini"
#: builtin/mailinfo.c
msgid "use scissors"
-msgstr ""
+msgstr "gunakan gunting"
#: builtin/mailinfo.c
msgid "<action>"
-msgstr ""
+msgstr "<tindakan>"
#: builtin/mailinfo.c
msgid "action when quoted CR is found"
-msgstr ""
+msgstr "bertindak ketika CR terkutip ditemukan"
#: builtin/mailinfo.c
msgid "use headers in message's body"
-msgstr ""
+msgstr "gunakan kepala di dalam badan pesan"
#: builtin/mailsplit.c
msgid "reading patches from stdin/tty..."
-msgstr ""
+msgstr "membaca tambalan dari masukan standar/tty..."
#: builtin/mailsplit.c
#, c-format
msgid "empty mbox: '%s'"
-msgstr ""
+msgstr "mbox kosong: '%s'"
#: builtin/merge-base.c
msgid "git merge-base [-a | --all] <commit> <commit>..."
@@ -9759,14 +10015,14 @@ msgid "git merge-base [-a | --all] --octopus <commit>..."
msgstr "git merge-base [-a | --all] --octopus <komit>..."
#: builtin/merge-base.c
-msgid "git merge-base --independent <commit>..."
-msgstr "git merge-base --independent <komit>..."
-
-#: builtin/merge-base.c
msgid "git merge-base --is-ancestor <commit> <commit>"
msgstr "git merge-base --is-ancestor <komit> <komit>"
#: builtin/merge-base.c
+msgid "git merge-base --independent <commit>..."
+msgstr "git merge-base --independent <komit>..."
+
+#: builtin/merge-base.c
msgid "git merge-base --fork-point <ref> [<commit>]"
msgstr "git merge-base --fork-point <referensi> [<komit>]"
@@ -9795,73 +10051,179 @@ msgid ""
"git merge-file [<options>] [-L <name1> [-L <orig> [-L <name2>]]] <file1> "
"<orig-file> <file2>"
msgstr ""
+"git merge-file [<opsi>] [-L <nama 1> [-L <asli> [-L <nama 2>]]] <berkas 1> "
+"<berkas asli> <berkas 2>"
+
+#: builtin/merge-file.c diff.c
+msgid ""
+"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
+"\"histogram\""
+msgstr ""
+"opsi diff-algorithm terima \"myers\", \"minimal\", \"patience\" dan "
+"\"histogram\""
#: builtin/merge-file.c
msgid "send results to standard output"
-msgstr ""
+msgstr "kirim hasil ke keluaran standar"
+
+#: builtin/merge-file.c
+msgid "use object IDs instead of filenames"
+msgstr "gunakan ID objek daripada nama berkas"
#: builtin/merge-file.c
msgid "use a diff3 based merge"
-msgstr ""
+msgstr "gunakan penggabungan berdasarkan diff3"
#: builtin/merge-file.c
msgid "use a zealous diff3 based merge"
-msgstr ""
+msgstr "gunakan penggabungan berdasarkan diff3 yang bersemangat"
#: builtin/merge-file.c
msgid "for conflicts, use our version"
-msgstr ""
+msgstr "untuk konflik, gunakan versi kami"
#: builtin/merge-file.c
msgid "for conflicts, use their version"
-msgstr ""
+msgstr "untuk konflik, gunakan versi mereka"
#: builtin/merge-file.c
msgid "for conflicts, use a union version"
-msgstr ""
+msgstr "untuk konflik, gunakan versi bersatu"
+
+#: builtin/merge-file.c diff.c
+msgid "<algorithm>"
+msgstr "<algoritma>"
+
+#: builtin/merge-file.c diff.c
+msgid "choose a diff algorithm"
+msgstr "pilih algoritma diff"
#: builtin/merge-file.c
msgid "for conflicts, use this marker size"
-msgstr ""
+msgstr "untuk konflik, gunakan ukuran penanda ini"
#: builtin/merge-file.c
msgid "do not warn about conflicts"
-msgstr ""
+msgstr "jangan peringatkan tentang konflik"
#: builtin/merge-file.c
msgid "set labels for file1/orig-file/file2"
-msgstr ""
+msgstr "setel label untuk file1/orig-file/file2"
+
+#: builtin/merge-file.c
+#, c-format
+msgid "object '%s' does not exist"
+msgstr "objek '%s' tidak ada"
+
+#: builtin/merge-file.c
+msgid "Could not write object file"
+msgstr "Tidak dapat menulis berkas objek"
#: builtin/merge-recursive.c
#, c-format
msgid "unknown option %s"
-msgstr ""
+msgstr "opsi tidak dikenal %s"
#: builtin/merge-recursive.c
#, c-format
msgid "could not parse object '%s'"
-msgstr ""
+msgstr "tidak dapat menguraikan objek '%s'"
#: builtin/merge-recursive.c
#, c-format
msgid "cannot handle more than %d base. Ignoring %s."
msgid_plural "cannot handle more than %d bases. Ignoring %s."
-msgstr[0] ""
-msgstr[1] ""
+msgstr[0] "tidak dapat menangani lebih dari %d dasar. Mengabaikan %s."
+msgstr[1] "tidak dapat menangani lebih dari %d dasar. Mengabaikan %s."
#: builtin/merge-recursive.c
msgid "not handling anything other than two heads merge."
-msgstr ""
+msgstr "tidak menangani apapun selain penggabungan dua kepala"
#: builtin/merge-recursive.c
#, c-format
msgid "could not resolve ref '%s'"
-msgstr ""
+msgstr "tidak dapat menguraikan referensi '%s'"
#: builtin/merge-recursive.c
#, c-format
msgid "Merging %s with %s\n"
-msgstr ""
+msgstr "Menggabungkan %s dengan %s\n"
+
+#: builtin/merge-tree.c builtin/merge.c
+msgid "not something we can merge"
+msgstr "bukan sesuatu yang kami bisa gabungkan"
+
+#: builtin/merge-tree.c builtin/merge.c
+msgid "refusing to merge unrelated histories"
+msgstr "menolak menggabungkan riwayat tak terkait"
+
+#: builtin/merge-tree.c
+msgid "failure to merge"
+msgstr "kegagalan penggabungan"
+
+#: builtin/merge-tree.c
+msgid "git merge-tree [--write-tree] [<options>] <branch1> <branch2>"
+msgstr "git merge-tree [--write-tree] [<opsi>] <cabang 1> <cabang 2>"
+
+#: builtin/merge-tree.c
+msgid "git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"
+msgstr "git merge-tree [--trivial-merge] <pohon dasar> <cabang 1> <cabang 2>"
+
+#: builtin/merge-tree.c
+msgid "do a real merge instead of a trivial merge"
+msgstr "lakukan penggabungan sebenarnya daripada penggabungan sepele"
+
+#: builtin/merge-tree.c
+msgid "do a trivial merge only"
+msgstr "hanya lakukan penggabungan sepele"
+
+#: builtin/merge-tree.c
+msgid "also show informational/conflict messages"
+msgstr "perlihatkan juga pesan informasi/konflik"
+
+#: builtin/merge-tree.c
+msgid "list filenames without modes/oids/stages"
+msgstr "daftar nama berkas tanpa mode/oid/tahap"
+
+#: builtin/merge-tree.c builtin/merge.c builtin/pull.c
+msgid "allow merging unrelated histories"
+msgstr "perbolehkan penggabungan riwayat yang tak terkait"
+
+#: builtin/merge-tree.c
+msgid "perform multiple merges, one per line of input"
+msgstr "lakukan banyak penggabungan, satu per baris masukan"
+
+#: builtin/merge-tree.c
+msgid "specify a merge-base for the merge"
+msgstr "harus menyebutkan sebuah dasar penggabungan untuk penggabungan"
+
+#: builtin/merge-tree.c builtin/merge.c builtin/pull.c
+msgid "option=value"
+msgstr "opsi=nilai"
+
+#: builtin/merge-tree.c builtin/merge.c builtin/pull.c
+msgid "option for selected merge strategy"
+msgstr "opsi untuk strategi penggabungan yang dipilih"
+
+#: builtin/merge-tree.c
+msgid "--trivial-merge is incompatible with all other options"
+msgstr "--trivial-merge tidak kompatibel dengan semua opsi lainnya"
+
+#: builtin/merge-tree.c builtin/merge.c
+#, c-format
+msgid "unknown strategy option: -X%s"
+msgstr "opsi strategi tidak dikenal: -X%s"
+
+#: builtin/merge-tree.c builtin/notes.c
+#, c-format
+msgid "malformed input line: '%s'."
+msgstr "baris masukan jelek: '%s'."
+
+#: builtin/merge-tree.c
+#, c-format
+msgid "merging cannot continue; got unclean result of %d"
+msgstr "penggabungan tidak dapat berlanjut; dapat hasil kotor dari %d"
#: builtin/merge.c
msgid "git merge [<options>] [<commit>...]"
@@ -9941,14 +10303,6 @@ msgstr "strategi"
msgid "merge strategy to use"
msgstr "strategi penggabungan yang digunakan"
-#: builtin/merge.c builtin/pull.c
-msgid "option=value"
-msgstr "opsi=nilai"
-
-#: builtin/merge.c builtin/pull.c
-msgid "option for selected merge strategy"
-msgstr "opsi untuk strategi penggabungan yang dipilih"
-
#: builtin/merge.c
msgid "merge commit message (for a non-fast-forward merge)"
msgstr "pesan komit penggabungan (untuk penggabungan bukan maju cepat)"
@@ -9969,10 +10323,6 @@ msgstr "--abort tapi biarkan indeks dan pohon kerja"
msgid "continue the current in-progress merge"
msgstr "lanjutkan penggabungan yang sedang berlangsung saat ini"
-#: builtin/merge.c builtin/pull.c
-msgid "allow merging unrelated histories"
-msgstr "perbolehkan penggabungan riwayat yang tak terkait"
-
#: builtin/merge.c
msgid "bypass pre-merge-commit and commit-msg hooks"
msgstr "lewati kail pre-merge-commit dan commit-msg"
@@ -10022,7 +10372,7 @@ msgstr "'%s' tidak menunjuk pada sebuah komit"
msgid "Bad branch.%s.mergeoptions string: %s"
msgstr "Untai branch.%s.mergeoptions jelek: %s"
-#: builtin/merge.c builtin/stash.c merge-recursive.c
+#: builtin/merge.c merge-recursive.c
msgid "Unable to write index."
msgstr "Tidak dapat menulis indeks."
@@ -10032,11 +10382,6 @@ msgstr "Tak tangani apapun selain penggabungan dua kepala."
#: builtin/merge.c
#, c-format
-msgid "unknown strategy option: -X%s"
-msgstr "opsi strategi tidak dikenal: -X%s"
-
-#: builtin/merge.c t/helper/test-fast-rebase.c
-#, c-format
msgid "unable to write %s"
msgstr "tidak dapat menulis %s"
@@ -10111,10 +10456,10 @@ msgstr "Tidak ada cabang pelacak remote untuk %s dari %s"
msgid "Bad value '%s' in environment '%s'"
msgstr "Nilai jelek '%s' dalam lingkungan '%s'"
-#: builtin/merge.c read-cache.c strbuf.c wrapper.c
+#: builtin/merge.c editor.c read-cache.c wrapper.c
#, c-format
msgid "could not close '%s'"
-msgstr ""
+msgstr "tidak dapat menutup '%s'"
#: builtin/merge.c
#, c-format
@@ -10122,10 +10467,6 @@ msgid "not something we can merge in %s: %s"
msgstr "bukan sesuatu yang kami bisa gabungkan di %s: %s"
#: builtin/merge.c
-msgid "not something we can merge"
-msgstr "bukan sesuatu yang kami bisa gabungkan"
-
-#: builtin/merge.c
msgid "--abort expects no arguments"
msgstr "--abort harap tanpa argumen"
@@ -10188,14 +10529,20 @@ msgid "Can merge only exactly one commit into empty head"
msgstr "Hanya bisa menggabungkan tepantnya satu komit ke kepala kosong"
#: builtin/merge.c
-msgid "refusing to merge unrelated histories"
-msgstr "menolak menggabungkan riwayat tak terkait"
-
-#: builtin/merge.c
#, c-format
msgid "Updating %s..%s\n"
msgstr "Memperbarui %s..%s\n"
+#: builtin/merge.c merge-ort-wrappers.c merge-recursive.c
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+" %s"
+msgstr ""
+"Perubahan lokal Anda terhadap berkas berikut akan ditimpa oleh "
+"penggabungan:\n"
+" %s"
+
#: builtin/merge.c
#, c-format
msgid "Trying really trivial in-index merge...\n"
@@ -10238,30 +10585,35 @@ msgstr ""
"Penggabungan otomatis berjalan baik; berhenti sebelum mengkomit seperti yang "
"diminta\n"
+#: builtin/merge.c
+#, c-format
+msgid "When finished, apply stashed changes with `git stash pop`\n"
+msgstr "Ketika selesai, terapkan perubahan terstase dengan `git stash pop`\n"
+
#: builtin/mktag.c
#, c-format
msgid "warning: tag input does not pass fsck: %s"
-msgstr ""
+msgstr "peringatan: masukan tag tidak lolos fsck: %s"
#: builtin/mktag.c
#, c-format
msgid "error: tag input does not pass fsck: %s"
-msgstr ""
+msgstr "kesalahan: masukan tag tidak lolos fsck: %s"
#: builtin/mktag.c
#, c-format
msgid "%d (FSCK_IGNORE?) should never trigger this callback"
-msgstr ""
+msgstr "%d (FSCK_IGNORE?) seharusnya tidak pernah memicu pemanggilan balik ini"
#: builtin/mktag.c
#, c-format
msgid "could not read tagged object '%s'"
-msgstr ""
+msgstr "tidak dapat membaca objek tertag '%s'"
#: builtin/mktag.c
#, c-format
msgid "object '%s' tagged as '%s', but is a '%s' type"
-msgstr ""
+msgstr "objek '%s' ditag sebagai '%s', tetapi bertipe '%s'"
#: builtin/mktag.c imap-send.c trailer.c
msgid "could not read from stdin"
@@ -10269,27 +10621,27 @@ msgstr "tidak dapat membaca dari masukan standar"
#: builtin/mktag.c
msgid "tag on stdin did not pass our strict fsck check"
-msgstr ""
+msgstr "tag pada masukan standar tidak lolos pemeriksaan fsck ketat kami"
#: builtin/mktag.c
msgid "tag on stdin did not refer to a valid object"
-msgstr ""
+msgstr "tag pada masukan standar tidak merujuk pada objek valid"
#: builtin/mktag.c builtin/tag.c
msgid "unable to write tag file"
-msgstr ""
+msgstr "tidak dapat menulis berkas tag"
#: builtin/mktree.c
msgid "input is NUL terminated"
-msgstr ""
+msgstr "masukan diakhiri dengan NUL"
#: builtin/mktree.c builtin/write-tree.c
msgid "allow missing objects"
-msgstr ""
+msgstr "perbolehkan objek hilang"
#: builtin/mktree.c
msgid "allow creation of more than one tree"
-msgstr ""
+msgstr "perbolehkan pembuatan lebih dari satu pohon"
#: builtin/multi-pack-index.c
msgid ""
@@ -10388,12 +10740,16 @@ msgid "bad source"
msgstr "sumber jelek"
#: builtin/mv.c
+msgid "destination exists"
+msgstr "tujuan ada"
+
+#: builtin/mv.c
msgid "can not move directory into itself"
msgstr "tidak dapat memindahkan direktori ke dirinya sendiri"
#: builtin/mv.c
-msgid "cannot move directory over file"
-msgstr "tidak dapat memindahkan direktori ke berkas"
+msgid "destination already exists"
+msgstr "tujuan sudah ada"
#: builtin/mv.c
msgid "source directory is empty"
@@ -10408,10 +10764,6 @@ msgid "conflicted"
msgstr "terkonflik"
#: builtin/mv.c
-msgid "destination exists"
-msgstr "tujuan ada"
-
-#: builtin/mv.c
#, c-format
msgid "overwriting '%s'"
msgstr "menimpa '%s'"
@@ -10429,6 +10781,10 @@ msgid "destination directory does not exist"
msgstr "direktori tujuan tidak ada"
#: builtin/mv.c
+msgid "destination exists in the index"
+msgstr "tujuan ada dalam indeks"
+
+#: builtin/mv.c
#, c-format
msgid "%s, source=%s, destination=%s"
msgstr "%s, source=%s, destination=%s"
@@ -10438,7 +10794,7 @@ msgstr "%s, source=%s, destination=%s"
msgid "Renaming %s to %s\n"
msgstr "Mengganti nama %s ke %s\n"
-#: builtin/mv.c builtin/remote.c builtin/repack.c
+#: builtin/mv.c builtin/remote.c
#, c-format
msgid "renaming '%s' failed"
msgstr "gagal mengganti nama '%s'"
@@ -10497,11 +10853,13 @@ msgstr "git notes [--ref <referensi catan>] [list [<objek>]]"
#: builtin/notes.c
msgid ""
-"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [-m <msg> | -F <file> "
-"| (-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref <referensi catatan>] add [-f] [--allow-empty] [-m <pesan | -"
-"F <berkas> | (-c | -C) <objek>] [<objek>]"
+"git notes [--ref <referensi catatan>] add [-f] [--allow-empty] [--"
+"[no-]separator|--separator=<pemisah paragraf>] [--[no-]stripspace] [-m "
+"<pesan | -F <berkas> | (-c | -C) <objek>] [<objek>]"
#: builtin/notes.c
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
@@ -10510,11 +10868,13 @@ msgstr ""
#: builtin/notes.c
msgid ""
-"git notes [--ref <notes-ref>] append [--allow-empty] [-m <msg> | -F <file> | "
-"(-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref <referensi catatan>] append [--alow-empty] [-m <pesan> | -F "
-"<berkas> | (-c | -C) <objek>] [<objek>]"
+"git notes [--ref <referensi catatan>] append [--alow-empty] [--"
+"[no]separator|--separator=<pemisah paragraf>] [--[no-]stripspace] [-m "
+"<pesan> | -F <berkas> | (-c | -C) <objek>] [<objek>]"
#: builtin/notes.c
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
@@ -10644,11 +11004,6 @@ msgstr "gagal membaca data catatan dari objek bukan blob '%s'."
#: builtin/notes.c
#, c-format
-msgid "malformed input line: '%s'."
-msgstr "baris masukan jelek: '%s'."
-
-#: builtin/notes.c
-#, c-format
msgid "failed to copy notes from '%s' to '%s'"
msgstr "gagal menyalin catatan dari '%s' ke '%s'"
@@ -10690,6 +11045,18 @@ msgid "replace existing notes"
msgstr "timpa catatan yang sudah ada"
#: builtin/notes.c
+msgid "<paragraph-break>"
+msgstr "<pemisah paragraf>"
+
+#: builtin/notes.c
+msgid "insert <paragraph-break> between paragraphs"
+msgstr "masukkan <pemisah paragraf> di antara paragraf"
+
+#: builtin/notes.c
+msgid "remove unnecessary whitespace"
+msgstr "hapus spasi yang tidak diperlukan"
+
+#: builtin/notes.c
#, c-format
msgid ""
"Cannot add notes. Found existing notes for object %s. Use '-f' to overwrite "
@@ -10882,21 +11249,20 @@ msgstr "referensi catatan"
msgid "use notes from <notes-ref>"
msgstr "gunakan catatan dari <referensi catatan>"
-#: builtin/notes.c builtin/stash.c
+#: builtin/notes.c builtin/remote.c parse-options.c
#, c-format
-msgid "unknown subcommand: %s"
-msgstr "subperintah tidak dikenal: %s"
+msgid "unknown subcommand: `%s'"
+msgstr "subperintah tidak dikenal: `%s'"
#: builtin/pack-objects.c
-msgid ""
-"git pack-objects --stdout [<options>...] [< <ref-list> | < <object-list>]"
+msgid "git pack-objects --stdout [<options>] [< <ref-list> | < <object-list>]"
msgstr ""
-"git pack-objects --stdout [<opsi>...] [< <daftar referensi>| < <daftar-"
+"git pack-objects --stdout [<opsi>...] [< <daftar referensi> | < <daftar-"
"objek>]"
#: builtin/pack-objects.c
msgid ""
-"git pack-objects [<options>...] <base-name> [< <ref-list> | < <object-list>]"
+"git pack-objects [<options>] <base-name> [< <ref-list> | < <object-list>]"
msgstr ""
"git pack-objects [<opsi>...] <nama dasar> [< <daftar referensi> | < <daftar-"
"objek>]"
@@ -10962,7 +11328,7 @@ msgstr "gagal menulis indeks bitmap"
msgid "wrote %<PRIu32> objects while expecting %<PRIu32>"
msgstr "%<PRIu32> objek ditulish ketika mengharapkan %<PRIu32>"
-#: builtin/pack-objects.c
+#: builtin/pack-objects.c builtin/repack.c
msgid "disabling bitmap writing, as some objects are not being packed"
msgstr "menonaktifkan penulisan bitmap, saat beberapa objek tidak sedang dipak"
@@ -11029,6 +11395,11 @@ msgstr "ketidakkonsistenan dengan hitungan delta"
#: builtin/pack-objects.c
#, c-format
+msgid "invalid pack.allowPackReuse value: '%s'"
+msgstr "nilai pack.allowPackReuse tidak valid: '%s'"
+
+#: builtin/pack-objects.c
+#, c-format
msgid ""
"value of uploadpack.blobpackfileuri must be of the form '<object-hash> <pack-"
"hash> <uri>' (got '%s')"
@@ -11131,6 +11502,14 @@ msgid "bad index version '%s'"
msgstr "versi indeks jelek '%s'"
#: builtin/pack-objects.c
+msgid "show progress meter during object writing phase"
+msgstr "perlihatkan meteran perkembangan saat fase penulisan objek"
+
+#: builtin/pack-objects.c
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "sama seperti --all-progress ketika meteran perkembangan diperlihatkan"
+
+#: builtin/pack-objects.c
msgid "<version>[,<offset>]"
msgstr "<versi>[,<offset>]"
@@ -11327,10 +11706,6 @@ msgstr ""
"--thin tidak dapat digunakan untuk membangun sebuah pak yang dapat diindeks"
#: builtin/pack-objects.c
-msgid "cannot use --filter without --stdout"
-msgstr "tidak dapat menggunakan --filter tanpa --stdout"
-
-#: builtin/pack-objects.c
msgid "cannot use --filter with --stdin-packs"
msgstr "tidak dapat menggunakan --filter dengan --stdin-packs"
@@ -11347,10 +11722,6 @@ msgid "cannot use --stdin-packs with --cruft"
msgstr "tidak dapat menggunakan --stdin-packs dengan --cruft"
#: builtin/pack-objects.c
-msgid "cannot use --max-pack-size with --cruft"
-msgstr "tidak dapat menggunakan --max-pack-size dengan --cruft"
-
-#: builtin/pack-objects.c
msgid "Enumerating objects"
msgstr "Menghitung objek"
@@ -11358,10 +11729,10 @@ msgstr "Menghitung objek"
#, c-format
msgid ""
"Total %<PRIu32> (delta %<PRIu32>), reused %<PRIu32> (delta %<PRIu32>), pack-"
-"reused %<PRIu32>"
+"reused %<PRIu32> (from %<PRIuMAX>)"
msgstr ""
"Total %<PRIu32> (delta %<PRIu32>), digunakan ulang %<PRIu32> (delta "
-"%<PRIu32>), pak yang digunakan ulang %<PRIu32>"
+"%<PRIu32>), pak yang digunakan ulang %<PRIu32> (dari %<PRIuMAX>)"
#: builtin/pack-redundant.c
msgid ""
@@ -11371,10 +11742,22 @@ msgid ""
"and let us know you still use it by sending an e-mail\n"
"to <git@vger.kernel.org>. Thanks.\n"
msgstr ""
+"'git pack-redundant' dinominasikan untuk dihapus.\n"
+"Jika Anda masih menggunakan perintah ini, mohon tambahkan sebuah opsi\n"
+"ekstra, '--i-still-use-this', pada baris perintah dan beri tahu kami jika\n"
+"Anda masih menggunakannya dengan mengirimkan surel ke\n"
+"<git@vger.kernel.org>. Terima kasih.\n"
+
+#: builtin/pack-redundant.c
+msgid "refusing to run without --i-still-use-this"
+msgstr "menolak menjalankan tanpa --i-still-use-this"
#: builtin/pack-refs.c
-msgid "git pack-refs [<options>]"
-msgstr "git pack-refs [<opsi>]"
+msgid ""
+"git pack-refs [--all] [--no-prune] [--include <pattern>] [--exclude "
+"<pattern>]"
+msgstr ""
+"git pack-refs [--all] [--no-prune] [--include <pola>] [--exclude <pola>]"
#: builtin/pack-refs.c
msgid "pack everything"
@@ -11384,6 +11767,30 @@ msgstr "pak semuanya"
msgid "prune loose refs (default)"
msgstr "pangkas referensi longgar (asali)"
+#: builtin/pack-refs.c
+msgid "references to include"
+msgstr "referensi untuk ditambahkan"
+
+#: builtin/pack-refs.c
+msgid "references to exclude"
+msgstr "referensi untuk dikecualikan"
+
+#: builtin/patch-id.c
+msgid "git patch-id [--stable | --unstable | --verbatim]"
+msgstr "git patch-id [--stable | --unstable | --verbatim]"
+
+#: builtin/patch-id.c
+msgid "use the unstable patch-id algorithm"
+msgstr "gunakan algoritma id tambalan tidak stabil"
+
+#: builtin/patch-id.c
+msgid "use the stable patch-id algorithm"
+msgstr "gunakan algoritma id tambalan stabil"
+
+#: builtin/patch-id.c
+msgid "don't strip whitespace from the patch"
+msgstr "jangan kupas spasi dari tambalan"
+
#: builtin/prune.c
msgid "git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"
msgstr "git prune [-n] [-v] [--progress] [--expire <waktu>] [--] [<kepala>...]"
@@ -11444,6 +11851,14 @@ msgstr "paksa timpa cabang lokal"
msgid "number of submodules pulled in parallel"
msgstr "nomor submodul ditarik dalam paralel"
+#: builtin/pull.c parse-options.h
+msgid "use IPv4 addresses only"
+msgstr "gunakan hanya alamat IPv4"
+
+#: builtin/pull.c parse-options.h
+msgid "use IPv6 addresses only"
+msgstr "gunakan hanya alamat IPv6"
+
#: builtin/pull.c
msgid ""
"There is no candidate for rebasing against among the refs that you just "
@@ -11498,7 +11913,7 @@ msgstr "Lihat git-pull(1) untuk selengkapnya."
msgid "<remote>"
msgstr "<remote>"
-#: builtin/pull.c contrib/scalar/scalar.c
+#: builtin/pull.c scalar.c
msgid "<branch>"
msgstr "<cabang>"
@@ -11572,9 +11987,9 @@ msgstr ""
msgid "pull with rebase"
msgstr "tarik dengan pendasaran ulang"
-#: builtin/pull.c
-msgid "please commit or stash them."
-msgstr "mohon komit atau stase."
+#: builtin/pull.c builtin/rebase.c
+msgid "Please commit or stash them."
+msgstr "Mohon komit atau stase."
#: builtin/pull.c
#, c-format
@@ -11648,14 +12063,13 @@ msgstr ""
#: builtin/push.c
msgid ""
"\n"
-"To avoid automatically configuring upstream branches when their name\n"
-"doesn't match the local branch, see option 'simple' of branch."
-"autoSetupMerge\n"
+"To avoid automatically configuring an upstream branch when its name\n"
+"won't match the local branch, see option 'simple' of branch.autoSetupMerge\n"
"in 'git help config'.\n"
msgstr ""
"\n"
"Untuk menghindari konfigurasi cabang hulu otomatis ketika namanya\n"
-"tidak cocok dengan cabang lokal, lihat opsi 'simple' dari branch."
+"tidak akan cocok dengan cabang lokal, lihat opsi 'simple' dari branch."
"autoSetupMerge\n"
"di 'git help config'.\n"
@@ -11750,39 +12164,39 @@ msgstr ""
#: builtin/push.c
msgid ""
"Updates were rejected because the tip of your current branch is behind\n"
-"its remote counterpart. Integrate the remote changes (e.g.\n"
-"'git pull ...') before pushing again.\n"
+"its remote counterpart. If you want to integrate the remote changes,\n"
+"use 'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"Pembaruan ditolak karena ujung dari cabang Anda saat ini di belakang\n"
-"pasangan remotenya. Integrasikan perubahan remote (seperti\n"
-"'git pull') sebelum dorong lagi.\n"
+"pasangan remotenya. Jika Anda ingin mengintegrasikan perubahan remote,\n"
+"lakukan 'git pull' sebelum mendorong lagi.\n"
"Lihat 'Note about fast-forwards' di 'git push --help' untuk selengkapnya."
#: builtin/push.c
msgid ""
"Updates were rejected because a pushed branch tip is behind its remote\n"
-"counterpart. Check out this branch and integrate the remote changes\n"
-"(e.g. 'git pull ...') before pushing again.\n"
+"counterpart. If you want to integrate the remote changes, use 'git pull'\n"
+"before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"Pembaruan ditolak karena ujung dari cabang yang didorong di belakang\n"
-"pasangan remotenya. Check out cabang itu dan integrasikan perubahan\n"
-"remote (seperti 'git pull') sebelum dorong lagi.\n"
+"pasangan remotenya. Jika anda ingin mengintegrasikan perubahan\n"
+"remote, lakukan 'git pull' sebelum mendorong lagi.\n"
"Lihat 'Note about fast-forwards' di 'git push --help' untuk selengkapnya."
#: builtin/push.c
msgid ""
-"Updates were rejected because the remote contains work that you do\n"
-"not have locally. This is usually caused by another repository pushing\n"
-"to the same ref. You may want to first integrate the remote changes\n"
-"(e.g., 'git pull ...') before pushing again.\n"
+"Updates were rejected because the remote contains work that you do not\n"
+"have locally. This is usually caused by another repository pushing to\n"
+"the same ref. If you want to integrate the remote changes, use\n"
+"'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"Pembaruan ditolak karena remote berisi kerja yang Anda tidak punya\n"
+"Pembaruan ditolak karena remote berisi karya yang Anda tidak punya\n"
"di lokal. Ini biasanya disebabkan repositori yang lain dorong ke\n"
-"referensi yang sama. Mungkin Anda ingin integrasikan terlebih dahulu\n"
-"perubahan remote (seperti 'git pull') sebelum dorong lagi.\n"
+"referensi yang sama. Jika Anda ingin mengintegrasikan perubahan remote\n"
+"lakukan 'git pull' sebelum mendorong lagi.\n"
"Lihat 'Note about fast-forwards' di 'git push --help' untuk selengkapnya."
#: builtin/push.c
@@ -11801,15 +12215,15 @@ msgstr ""
#: builtin/push.c
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"
+"Updates were rejected because the tip of the remote-tracking branch has\n"
+"been updated since the last checkout. If you want to integrate the\n"
+"remote changes, use 'git pull' before pushing again.\n"
+"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"Pembaruan ditolak karena ujung dari cabang pelacak remote\n"
-"sudah diperbarui sejak checkout terakhir. Mungkin Anda ingin\n"
-"integrasikan perubahan tersebut ke lokal (seperti 'git pull...')\n"
-"sebelum memaksa pembaruan.\n"
+"Pembaruan ditolak karena ujung dari cabang Anda saat ini sudah diperbarui\n"
+"sejak checkout terakhir. Jika Anda ingin mengintegrasikan perubahan remote,\n"
+"lakukan 'git pull' sebelum mendorong lagi.\n"
+"Lihat 'Note about fast-forwards' di 'git push --help' untuk selengkapnya."
#: builtin/push.c
#, c-format
@@ -11821,6 +12235,14 @@ msgstr "Mendorong ke %s\n"
msgid "failed to push some refs to '%s'"
msgstr "gagal dorong beberapa referensi ke '%s'"
+#: builtin/push.c
+msgid ""
+"recursing into submodule with push.recurseSubmodules=only; using on-demand "
+"instead"
+msgstr ""
+"mengulangi ke dalam submodul dengan push.recurseSubmodules=only; menggunakan "
+"on-demand sebagai gantinya"
+
#: builtin/push.c builtin/send-pack.c submodule-config.c
#, c-format
msgid "invalid value for '%s'"
@@ -11830,9 +12252,9 @@ msgstr "nilai tidak valid untuk '%s'"
msgid "repository"
msgstr "repositori"
-#: builtin/push.c builtin/send-pack.c
-msgid "push all refs"
-msgstr "dorong semua referensi"
+#: builtin/push.c
+msgid "push all branches"
+msgstr "dorong semua cabang"
#: builtin/push.c builtin/send-pack.c
msgid "mirror all refs"
@@ -11843,8 +12265,10 @@ msgid "delete refs"
msgstr "hapus referensi"
#: builtin/push.c
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "dorong tag (tidak dapat digunakan dengan --all atau --mirror)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr ""
+"dorong tag (tidak dapat digunakan bersamaan dengan --all, --branches, atau --"
+"mirror)"
#: builtin/push.c builtin/send-pack.c
msgid "force updates"
@@ -11902,7 +12326,7 @@ msgstr "minta transaksi atomik pada sisi remote"
msgid "--delete doesn't make sense without any refs"
msgstr "--delete tidak masuk akal tanpa referensi"
-#: builtin/push.c
+#: builtin/push.c t/helper/test-bundle-uri.c
#, c-format
msgid "bad repository '%s'"
msgstr "repositori jelek '%s'"
@@ -11944,58 +12368,66 @@ msgstr "opsi dorong harus tidak ada karakter baris baru"
#: builtin/range-diff.c
msgid "git range-diff [<options>] <old-base>..<old-tip> <new-base>..<new-tip>"
msgstr ""
+"git range-diff [<opsi>] <dasar lama>..<ujung lama> <dasar-baru>..<ujung baru>"
#: builtin/range-diff.c
msgid "git range-diff [<options>] <old-tip>...<new-tip>"
-msgstr ""
+msgstr "git range-diff [<opsi>] <ujung lama>...<ujung baru>"
#: builtin/range-diff.c
msgid "git range-diff [<options>] <base> <old-tip> <new-tip>"
-msgstr ""
+msgstr "git range-diff [<opsi>] <dasar> <ujung lama> <ujung baru>"
#: builtin/range-diff.c
msgid "use simple diff colors"
-msgstr ""
+msgstr "gunakan warna diff sederhana"
#: builtin/range-diff.c
msgid "notes"
-msgstr ""
+msgstr "catatan"
#: builtin/range-diff.c
msgid "passed to 'git log'"
-msgstr ""
+msgstr "lewatkan ke 'git log'"
#: builtin/range-diff.c
msgid "only emit output related to the first range"
-msgstr ""
+msgstr "hanya keluarkan keluaran relatif terhadap rentang pertama"
#: builtin/range-diff.c
msgid "only emit output related to the second range"
-msgstr ""
+msgstr "hanya keluarkan keluaran relatif terhadap rentang kedua"
+
+#: builtin/range-diff.c
+#, c-format
+msgid "not a revision: '%s'"
+msgstr "bukan sebuah revisi: '%s'"
#: builtin/range-diff.c
#, c-format
msgid "not a commit range: '%s'"
-msgstr ""
+msgstr "bukan sebuah rentang komit '%s'"
#: builtin/range-diff.c
-msgid "single arg format must be symmetric range"
-msgstr ""
+#, c-format
+msgid "not a symmetric range: '%s'"
+msgstr "bukan sebuah rentang simetris: '%s'"
#: builtin/range-diff.c
msgid "need two commit ranges"
-msgstr ""
+msgstr "butuh dua rentang komit"
#: builtin/read-tree.c
msgid ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>) "
-"[-u | -i]] [--no-sparse-checkout] [--index-output=<file>] (--empty | <tree-"
-"ish1> [<tree-ish2> [<tree-ish3>]])"
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<prefix>)\n"
+" [-u | -i]] [--index-output=<file>] [--no-sparse-checkout]\n"
+" (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"
msgstr ""
"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
-"prefix=<prefiks>) [-u | -i]] [--no-sparse-checkout] [--index-"
-"output=<berkas>] (--empty | <mirip-pohon 1> [<mirip-pohon 2> <mirip-pohon "
-"3>])"
+"prefix=<awalan>)\n"
+" [-u | -i]] [--index-output=<berkas>] [--no-sparse-checkout]\n"
+" (--empty | <mirip pohon 1> [<mirip pohon 2> [mirip pohon 3]])"
#: builtin/read-tree.c
msgid "write resulting index to <file>"
@@ -12114,8 +12546,8 @@ msgstr "%s butuh tulang belakang penggabungan"
#: builtin/rebase.c
#, c-format
-msgid "could not get 'onto': '%s'"
-msgstr "tidak dapat mendapatkan 'ke': '%s'"
+msgid "invalid onto: '%s'"
+msgstr "kepada tidak valid: '%s'"
#: builtin/rebase.c
#, c-format
@@ -12168,19 +12600,38 @@ msgstr ""
#: builtin/rebase.c
#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "Mode rebase-merges tidak dikenal: %s"
+
+#: builtin/rebase.c
+#, c-format
msgid "could not switch to %s"
msgstr "tidak dapat mengganti ke %s"
#: builtin/rebase.c
+msgid "apply options and merge options cannot be used together"
+msgstr "opsi apply dan opsi merge tidak dapat digunakan bersamaan"
+
+#: builtin/rebase.c
#, c-format
msgid ""
-"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and \"ask"
-"\"."
+"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and "
+"\"ask\"."
msgstr ""
"tipe kosong tak dikenali '%s'; nilai yang valid adalah \"drop\", \"keep\", "
"dan \"ask\"."
#: builtin/rebase.c
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"--rebase-merges dengan argumen untai kosong usang dan akan berhenti bekerja "
+"pada versi Git berikutnya. Sebagai gantinya, gunakan --rebase-merges tanpa "
+"argumen, yang melakukan hal yang sama."
+
+#: builtin/rebase.c
#, c-format
msgid ""
"%s\n"
@@ -12323,6 +12774,10 @@ msgid "move commits that begin with squash!/fixup! under -i"
msgstr "pindahakan komit yang diawali dengan squash!/fixup! di bawah -i"
#: builtin/rebase.c
+msgid "update branches that point to commits that are being rebased"
+msgstr "perbarui cabang yang menunjuk pada komit yang akan didasarkan ulang"
+
+#: builtin/rebase.c
msgid "add exec lines after each commit of the editable list"
msgstr ""
"tambahkan baris exec setelah setiap komit dari daftar yang bisa disunting"
@@ -12373,6 +12828,9 @@ msgid ""
"Use `git rebase --abort` to terminate current rebase.\n"
"Or downgrade to v2.33, or earlier, to complete the rebase."
msgstr ""
+"`rebase --preserve-merges` (-p) tidak lagi didukung.\n"
+"Gunakan `git rebase --abort` untuk menghentikan pendasaran ulang saat ini.\n"
+"Atau turun ke v2.33 atau lebih awal untuk menyelesaikan pendasaran ulang."
#: builtin/rebase.c
msgid ""
@@ -12380,6 +12838,9 @@ msgid ""
"Note: Your `pull.rebase` configuration may also be set to 'preserve',\n"
"which is no longer supported; use 'merges' instead"
msgstr ""
+"--preserve-merges diganti oleh --rebase-merges\n"
+"Catatan: Konfigurasi `pull.rebase` Anda mungkin juga disetel ke 'preserve',\n"
+"yang tidak lagi didukung; gunakan 'merges' sebagai gantinya"
#: builtin/rebase.c
msgid "No rebase in progress?"
@@ -12390,7 +12851,7 @@ msgid "The --edit-todo action can only be used during interactive rebase."
msgstr ""
"Aksi --edit-todo hanya dapat digunakan selama pendasaran ulang interaktif."
-#: builtin/rebase.c t/helper/test-fast-rebase.c
+#: builtin/rebase.c
msgid "Cannot read HEAD"
msgstr "Tidak dapat membaca HEAD"
@@ -12437,17 +12898,20 @@ msgid "switch `C' expects a numerical value"
msgstr "tombol `C' harap nilai numerik"
#: builtin/rebase.c
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "Mode tidak dikenal: %s"
-
-#: builtin/rebase.c
-msgid "--strategy requires --merge or --interactive"
-msgstr "--strategy butuh --merge atau --interactive"
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges. Consider adding --"
+"no-rebase-merges"
+msgstr ""
+"opsi penerapan tidak kompatibel dengan rebase.rebaseMerges. "
+"Pertimbangkanmenambahkan --no-rebase-merges"
#: builtin/rebase.c
-msgid "apply options and merge options cannot be used together"
-msgstr "opsi apply dan opsi merge tidak dapat digunakan bersamaan"
+msgid ""
+"apply options are incompatible with rebase.updateRefs. Consider adding --no-"
+"update-refs"
+msgstr ""
+"opsi penerapan tidak kompatibel dengan rebase.updateRefs. "
+"Pertimbangkanmenambahkan --no-update-refs"
#: builtin/rebase.c
#, c-format
@@ -12478,8 +12942,8 @@ msgid "No such ref: %s"
msgstr "Tidak ada referensi seperti: %s"
#: builtin/rebase.c
-msgid "Could not resolve HEAD to a revision"
-msgstr "Tidak dapat menguraikan HEAD ke sebuah revisi"
+msgid "Could not resolve HEAD to a commit"
+msgstr "tidak dapat menguraikan komit HEAD ke sebuah komit"
#: builtin/rebase.c
#, c-format
@@ -12497,10 +12961,6 @@ msgid "Does not point to a valid commit '%s'"
msgstr "Tidak menunjuk pada komit yang valid '%s'"
#: builtin/rebase.c
-msgid "Please commit or stash them."
-msgstr "Mohon komit atau stase."
-
-#: builtin/rebase.c
msgid "HEAD is up to date."
msgstr "HEAD terbaru."
@@ -12811,12 +13271,12 @@ msgid "fetch the remote branches"
msgstr "ambil cabang remote"
#: builtin/remote.c
-msgid "import all tags and associated objects when fetching"
-msgstr "impor semua tag dan objek yang terkait ketika mengambil"
-
-#: builtin/remote.c
-msgid "or do not fetch any tag at all (--no-tags)"
-msgstr "atau jangan mengambil tag apapun (--no-tags)"
+msgid ""
+"import all tags and associated objects when fetching\n"
+"or do not fetch any tag at all (--no-tags)"
+msgstr ""
+"impor semua tag dan objek yang terkait ketika mengambil atau jangan\n"
+"mengambil tag apapun (--no-tags)"
#: builtin/remote.c
msgid "branch(es) to track"
@@ -12935,10 +13395,10 @@ msgid_plural ""
"Note: Some branches outside the refs/remotes/ hierarchy were not removed;\n"
"to delete them, use:"
msgstr[0] ""
-"Catatan: Sebuah cabang diluar hierarki refs/remotes tidak dihapus;\n"
+"Catatan: Sebuah cabang diluar hierarki refs/remotes/ tidak dihapus;\n"
"untuk menghapusnya, gunakan:"
msgstr[1] ""
-"Catatan: Beberapa cabang diluar hierarki refs/remotes tidak dihapus;\n"
+"Catatan: Beberapa cabang diluar hierarki refs/remotes/ tidak dihapus;\n"
"untuk menghapusnya, gunakan:"
#: builtin/remote.c
@@ -12956,6 +13416,10 @@ msgid " tracked"
msgstr " dilacak"
#: builtin/remote.c
+msgid " skipped"
+msgstr " dilewati"
+
+#: builtin/remote.c
msgid " stale (use 'git remote prune' to remove)"
msgstr " basi (gunakan 'git remote prune' untuk hapus)"
@@ -13290,6 +13754,16 @@ msgid "could not close refs snapshot tempfile"
msgstr "tidak dapat menutup berkas sementara jepretan referensi"
#: builtin/repack.c
+#, c-format
+msgid "could not remove stale bitmap: %s"
+msgstr "tidak dapt memindahkan bitmap basi: %s"
+
+#: builtin/repack.c
+#, c-format
+msgid "pack prefix %s does not begin with objdir %s"
+msgstr "nama berkas paket %s tidak diawali dengan %s"
+
+#: builtin/repack.c
msgid "pack everything in a single pack"
msgstr "pak semuanya dalam satu pak"
@@ -13306,8 +13780,8 @@ msgid "approxidate"
msgstr "tanggal aproksimasi"
#: builtin/repack.c
-msgid "with -C, expire objects older than this"
-msgstr "dengan -C, jangan kadaluarsakan objek lebih lama dari ini"
+msgid "with --cruft, expire objects older than this"
+msgstr "dengan --cruft, kadaluarsakan objek yang lebih tua dari ini"
#: builtin/repack.c
msgid "remove redundant packs, and run git-prune-packed"
@@ -13388,47 +13862,60 @@ msgid "write a multi-pack index of the resulting packs"
msgstr "tulis indeks multipak dari pak yang dihasilkan"
#: builtin/repack.c
+msgid "pack prefix to store a pack containing pruned objects"
+msgstr "awalan pak untuk menyimpan pak berisi objek terpangkas"
+
+#: builtin/repack.c
+msgid "pack prefix to store a pack containing filtered out objects"
+msgstr "awalan pak untuk menyimpan pak berisi objek tersaring"
+
+#: builtin/repack.c
msgid "cannot delete packs in a precious-objects repo"
msgstr "tidak dapat menghapus pak dalam repositori objek berharga"
#: builtin/repack.c
+#, c-format
+msgid "option '%s' can only be used along with '%s'"
+msgstr "opsi '%s' tidak dapat digunakan bersamaan dengan '%s'"
+
+#: builtin/repack.c
msgid "Nothing new to pack."
msgstr "Tidak ada yang baru untuk dipak."
#: builtin/repack.c
#, c-format
-msgid "pack prefix %s does not begin with objdir %s"
-msgstr "nama berkas paket %s tidak diawali dengan %s"
+msgid "renaming pack to '%s' failed"
+msgstr "gagal mengganti nama pak ke '%s'"
#: builtin/repack.c
#, c-format
-msgid "missing required file: %s"
-msgstr "berkas yang diperlukan hilang: %s"
+msgid "pack-objects did not write a '%s' file for pack %s-%s"
+msgstr "pack-objects tidak menulis berkas '%s' untuk pak %s-%s"
-#: builtin/repack.c
+#: builtin/repack.c sequencer.c
#, c-format
msgid "could not unlink: %s"
msgstr "tidak dapat membatal taut: %s"
#: builtin/replace.c
msgid "git replace [-f] <object> <replacement>"
-msgstr ""
+msgstr "git replace [-f] <objek> <pengganti>"
#: builtin/replace.c
msgid "git replace [-f] --edit <object>"
-msgstr ""
+msgstr "git replace [-f] --edit <objek>"
#: builtin/replace.c
msgid "git replace [-f] --graft <commit> [<parent>...]"
-msgstr ""
+msgstr "git replace [-f] --graft <komit> [<induk>...]"
#: builtin/replace.c
msgid "git replace -d <object>..."
-msgstr ""
+msgstr "git replace -d <objek>..."
#: builtin/replace.c
msgid "git replace [--format=<format>] [-l [<pattern>]]"
-msgstr ""
+msgstr "git replace [--format=<format>] [-l [<pola>]]"
#: builtin/replace.c
#, c-format
@@ -13436,26 +13923,28 @@ msgid ""
"invalid replace format '%s'\n"
"valid formats are 'short', 'medium' and 'long'"
msgstr ""
+"format penggantian '%s' tidak valid\n"
+"yang valid adalah 'short', 'medium' dan 'long'"
#: builtin/replace.c
#, c-format
msgid "replace ref '%s' not found"
-msgstr ""
+msgstr "referensi penggantian '%s' tidak ditemukan"
#: builtin/replace.c
#, c-format
msgid "Deleted replace ref '%s'"
-msgstr ""
+msgstr "Referensi penggantian '%s' dihapus"
#: builtin/replace.c
#, c-format
msgid "'%s' is not a valid ref name"
-msgstr ""
+msgstr "'%s' bukan nama referensi valid"
#: builtin/replace.c
#, c-format
msgid "replace ref '%s' already exists"
-msgstr ""
+msgstr "referensi penggantian '%s' sudah ada"
#: builtin/replace.c
#, c-format
@@ -13464,74 +13953,77 @@ msgid ""
"'%s' points to a replaced object of type '%s'\n"
"while '%s' points to a replacement object of type '%s'."
msgstr ""
+"Objek harus bertipe sama.\n"
+"'%s' menunjuk pada objek yang diganti bertipe '%s'\n"
+"sedangkan '%s' menunjuk pada objek pengganti bertipe '%s'."
#: builtin/replace.c
#, c-format
msgid "unable to open %s for writing"
-msgstr ""
+msgstr "tidak dapat membuka %s untuk ditulis"
#: builtin/replace.c
msgid "cat-file reported failure"
-msgstr ""
+msgstr "cat-file melaporkan kegagalan"
#: builtin/replace.c
#, c-format
msgid "unable to open %s for reading"
-msgstr ""
+msgstr "tidak dapat membuka %s untuk dibaca"
#: builtin/replace.c
msgid "unable to spawn mktree"
-msgstr ""
+msgstr "tidak dapat memunculkan mktree"
#: builtin/replace.c
msgid "unable to read from mktree"
-msgstr ""
+msgstr "tidak dapat membaca dari mktree"
#: builtin/replace.c
msgid "mktree reported failure"
-msgstr ""
+msgstr "mktree melaporkan kegagalan"
#: builtin/replace.c
msgid "mktree did not return an object name"
-msgstr ""
+msgstr "mktree tidak mengembalikan sebuah nama objek"
#: builtin/replace.c
#, c-format
msgid "unable to fstat %s"
-msgstr ""
+msgstr "tidak dapat men-fstat %s"
#: builtin/replace.c
msgid "unable to write object to database"
-msgstr ""
+msgstr "tidak dapat menulis objek ke basis data"
#: builtin/replace.c
#, c-format
msgid "unable to get object type for %s"
-msgstr ""
+msgstr "tidak dapat mendapatkan tipe objek untuk %s"
#: builtin/replace.c
msgid "editing object file failed"
-msgstr ""
+msgstr "gagal menyunting berkas objek"
#: builtin/replace.c
#, c-format
msgid "new object is the same as the old one: '%s'"
-msgstr ""
+msgstr "objek baru sama dengan objek lama: '%s'"
#: builtin/replace.c
#, c-format
msgid "could not parse %s as a commit"
-msgstr ""
+msgstr "tidak dapat menguraikan %s sebagai sebuah komit"
#: builtin/replace.c
#, c-format
msgid "bad mergetag in commit '%s'"
-msgstr ""
+msgstr "tag penggabungan jelek pada komit '%s'"
#: builtin/replace.c
#, c-format
msgid "malformed mergetag in commit '%s'"
-msgstr ""
+msgstr "tag penggabungan rusak pada komit '%s'"
#: builtin/replace.c
#, c-format
@@ -13539,30 +14031,32 @@ msgid ""
"original commit '%s' contains mergetag '%s' that is discarded; use --edit "
"instead of --graft"
msgstr ""
+"komit asal '%s' berisi tag penggabungan '%s' yang dibuang; gunakan --edit "
+"daripada --graft"
#: builtin/replace.c
#, c-format
msgid "the original commit '%s' has a gpg signature"
-msgstr ""
+msgstr "komit asal '%s' punya tandatangan gpg"
#: builtin/replace.c
msgid "the signature will be removed in the replacement commit!"
-msgstr ""
+msgstr "tandatangan akan dihapus di dalam komit pengganti!"
#: builtin/replace.c
#, c-format
msgid "could not write replacement commit for: '%s'"
-msgstr ""
+msgstr "tidak dapat menulis komit pengganti untuk: '%s'"
#: builtin/replace.c
#, c-format
msgid "graft for '%s' unnecessary"
-msgstr ""
+msgstr "cangkuk untuk '%s' tidak diperlukan"
#: builtin/replace.c
#, c-format
msgid "new commit is the same as the old one: '%s'"
-msgstr ""
+msgstr "komit baru sama dengan komit lama: '%s'"
#: builtin/replace.c
#, c-format
@@ -13570,91 +14064,183 @@ msgid ""
"could not convert the following graft(s):\n"
"%s"
msgstr ""
+"tidak dapat mengkonversi cangkuk berikut:\n"
+"%s"
#: builtin/replace.c
msgid "list replace refs"
-msgstr ""
+msgstr "daftar referensi penggantian"
#: builtin/replace.c
msgid "delete replace refs"
-msgstr ""
+msgstr "hapus referensi penggantian"
#: builtin/replace.c
msgid "edit existing object"
-msgstr ""
+msgstr "sunting objek yang ada"
#: builtin/replace.c
msgid "change a commit's parents"
-msgstr ""
+msgstr "ubah induk sebuah komit"
#: builtin/replace.c
msgid "convert existing graft file"
-msgstr ""
+msgstr "konversi berkas cangkuk yang anda"
#: builtin/replace.c
msgid "replace the ref if it exists"
-msgstr ""
+msgstr "ganti referensi jika ada"
#: builtin/replace.c
msgid "do not pretty-print contents for --edit"
-msgstr ""
+msgstr "jangan cetak cantik isi untuk --edit"
#: builtin/replace.c
msgid "use this format"
-msgstr ""
+msgstr "gunakan format ini"
#: builtin/replace.c
msgid "--format cannot be used when not listing"
-msgstr ""
+msgstr "--format tidak dapat digunakan ketika mendaftar"
#: builtin/replace.c
msgid "-f only makes sense when writing a replacement"
-msgstr ""
+msgstr "-f hanya masuk akal ketika menulis pengganti"
#: builtin/replace.c
msgid "--raw only makes sense with --edit"
-msgstr ""
+msgstr "--raw hanya masuk akal dengan --edit"
#: builtin/replace.c
msgid "-d needs at least one argument"
-msgstr ""
+msgstr "-d butuh setidaknya satu argumen"
#: builtin/replace.c
msgid "bad number of arguments"
-msgstr ""
+msgstr "jumlah argumen jelek"
#: builtin/replace.c
msgid "-e needs exactly one argument"
-msgstr ""
+msgstr "-e butuh tepat satu argumen"
#: builtin/replace.c
msgid "-g needs at least one argument"
-msgstr ""
+msgstr "-g butuh setidaknya satu argumen"
#: builtin/replace.c
msgid "--convert-graft-file takes no argument"
-msgstr ""
+msgstr "--convert-graft-file tidak mengambil argumen"
#: builtin/replace.c
msgid "only one pattern can be given with -l"
+msgstr "hanya satu pola yang dapat diberikan dengan -l"
+
+#: builtin/replay.c
+msgid "need some commits to replay"
+msgstr "butuh beberapa komit untuk dimainkan ulang"
+
+#: builtin/replay.c
+msgid "--onto and --advance are incompatible"
+msgstr "--onto dan --advance tidak kompatibel"
+
+#: builtin/replay.c
+msgid "all positive revisions given must be references"
+msgstr "semua revisi positif yang diberikan haruslah referensi"
+
+#: builtin/replay.c
+msgid "argument to --advance must be a reference"
+msgstr "argumen pada --advance harus sebuah referensi"
+
+#: builtin/replay.c
+msgid ""
+"cannot advance target with multiple sources because ordering would be ill-"
+"defined"
msgstr ""
+"tidak dapat memajukan target dengan banyak sumber karena pengurutannya akan "
+"menjadi tidak jelas"
+
+#: builtin/replay.c
+msgid ""
+"cannot implicitly determine whether this is an --advance or --onto operation"
+msgstr ""
+"tidak dapat menentukan secara tidak langsung apakah ini operasi --advance "
+"atau --onto"
+
+#: builtin/replay.c
+msgid ""
+"cannot advance target with multiple source branches because ordering would "
+"be ill-defined"
+msgstr ""
+"tidak dapat memajukan target dengan banyak cabang sumber karena "
+"pengurutannya akan menjadi tidak jelas"
+
+#: builtin/replay.c
+msgid "cannot implicitly determine correct base for --onto"
+msgstr "tidak dapat menentukan secara tidak langsung dasar untuk --onto"
+
+#: builtin/replay.c
+msgid ""
+"(EXPERIMENTAL!) git replay ([--contained] --onto <newbase> | --advance "
+"<branch>) <revision-range>..."
+msgstr ""
+"(EKSPERIMENTAL!) git replay ([--contained] --onto <dasar baru> | --advance "
+"<cabang>) <rentang revisi>..."
+
+#: builtin/replay.c
+msgid "make replay advance given branch"
+msgstr "buat pemainan ulang memajukan caban yang diberikan"
+
+#: builtin/replay.c
+msgid "replay onto given commit"
+msgstr "mainkan ulang pada komit yang diberikan"
+
+#: builtin/replay.c
+msgid "advance all branches contained in revision-range"
+msgstr "majukan semua cabang yang berada pada rentang komit"
+
+#: builtin/replay.c
+msgid "option --onto or --advance is mandatory"
+msgstr "opsi --onto atau --advance diwajibkan"
+
+#: builtin/replay.c
+#, c-format
+msgid ""
+"some rev walking options will be overridden as '%s' bit in 'struct rev_info' "
+"will be forced"
+msgstr ""
+"beberapa opsi jalan revisi akan ditimpa oleh karena bit '%s' di 'struct "
+"rev_info' akan dipaksakan"
+
+#: builtin/replay.c
+msgid "error preparing revisions"
+msgstr "kesalahan menyiapkan revisi"
+
+#: builtin/replay.c
+msgid "replaying down to root commit is not supported yet!"
+msgstr "memainkan ulang ke komit akar belum didukung!"
+
+#: builtin/replay.c
+msgid "replaying merge commits is not supported yet!"
+msgstr "memainkan ulang komit penggabungan belum didukung!"
#: builtin/rerere.c
-msgid "git rerere [clear | forget <path>... | status | remaining | diff | gc]"
+msgid ""
+"git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]"
msgstr ""
+"git rerere [clear | forget <spek jalur>... | diff | status | remaining | gc]"
#: builtin/rerere.c
msgid "register clean resolutions in index"
-msgstr ""
+msgstr "daftar resolusi bersih di dalam indeks"
#: builtin/rerere.c
msgid "'git rerere forget' without paths is deprecated"
-msgstr ""
+msgstr "'git rerere forget' tanpa jalur usang"
#: builtin/rerere.c
#, c-format
msgid "unable to generate diff for '%s'"
-msgstr ""
+msgstr "tidak dapat membuat diff untuk '%s'"
#: builtin/reset.c
msgid ""
@@ -13725,7 +14311,7 @@ msgstr "diam, hanya laporkan kesalahan"
#: builtin/reset.c
msgid "skip refreshing the index after reset"
-msgstr ""
+msgstr "lewati penyegaran indeks setelah reset"
#: builtin/reset.c
msgid "reset HEAD and index"
@@ -13794,10 +14380,16 @@ msgstr "Tidak dapat menyetel ulang berkas indeks ke revisi '%s'."
msgid "Could not write new index file."
msgstr "Tidak dapat menulis berkas indeks baru."
-#: builtin/rev-list.c pack-bitmap.c
+#: builtin/rev-list.c
#, c-format
msgid "unable to get disk usage of %s"
+msgstr "tidak dapat mendapatkan penggunaan disk %s"
+
+#: builtin/rev-list.c
+#, c-format
+msgid "invalid value for '%s': '%s', the only allowed format is '%s'"
msgstr ""
+"nilai tidak valid untuk '%s': '%s', format yang diperbolehkan hanyalah '%s'"
#: builtin/rev-list.c
msgid "rev-list does not support display of notes"
@@ -13833,6 +14425,10 @@ msgid "no usage string given before the `--' separator"
msgstr "tidak ada untai penggunaan yang diberikan sebelum pemisah `--'"
#: builtin/rev-parse.c
+msgid "missing opt-spec before option flags"
+msgstr "kehilangan spek opsi sebelum bendera opsi"
+
+#: builtin/rev-parse.c
msgid "Needed a single revision"
msgstr "Butuh satu revisi"
@@ -13894,25 +14490,37 @@ msgid "this operation must be run in a work tree"
msgstr "operasi ini harus dijalankan di dalam pohon kerja"
#: builtin/rev-parse.c
+msgid "Could not read the index"
+msgstr "Tidak dapat membaca indeks"
+
+#: builtin/rev-parse.c
#, c-format
msgid "unknown mode for --show-object-format: %s"
msgstr "mode untuk --show-object-format tidak dikenal: %s"
#: builtin/revert.c
-msgid "git revert [<options>] <commit-ish>..."
-msgstr "git revert [<opsi>] <mirip-komit>..."
+msgid ""
+"git revert [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] "
+"<commit>..."
+msgstr ""
+"git revert [--[no-]edit] [-n] [-m <nomor induk>] [-s] [-S[<id kunci>]] "
+"<komit>..."
#: builtin/revert.c
-msgid "git revert <subcommand>"
-msgstr "git revert <subperintah>"
+msgid "git revert (--continue | --skip | --abort | --quit)"
+msgstr "git revert (--continue | --skip | --abort | --quit)"
#: builtin/revert.c
-msgid "git cherry-pick [<options>] <commit-ish>..."
-msgstr "git cherry-pick [<opsi>] <mirip-komit>..."
+msgid ""
+"git cherry-pick [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff]\n"
+" [-S[<keyid>]] <commit>..."
+msgstr ""
+"git cherry-pick [--edit] [-n] [-m <nomor induk>] [-s] [-x] [--ff]\n"
+" [-S[<id kunci>]] <komit>..."
#: builtin/revert.c
-msgid "git cherry-pick <subcommand>"
-msgstr "git cherry-pick <subperintah>"
+msgid "git cherry-pick (--continue | --skip | --abort | --quit)"
+msgstr "git cherry-pick (--continue | --skip | --abort | --quit)"
#: builtin/revert.c
#, c-format
@@ -13982,7 +14590,7 @@ msgstr "simpan komit kosong mubazir"
#: builtin/revert.c
msgid "use the 'reference' format to refer to commits"
-msgstr ""
+msgstr "gunakan format 'reference' untuk merujuk pada komit"
#: builtin/revert.c
msgid "revert failed"
@@ -13993,8 +14601,14 @@ msgid "cherry-pick failed"
msgstr "pemetikan ceri gagal"
#: builtin/rm.c
-msgid "git rm [<options>] [--] <file>..."
-msgstr "git rm [<opsi>] [--] <berkas>..."
+msgid ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<berkas> [--pathspec-file-nul]]\n"
+" [--] [<spek jalur>...]"
#: builtin/rm.c
msgid ""
@@ -14082,11 +14696,13 @@ msgid ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
" [<host>:]<directory> (--all | <ref>...)"
msgstr ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>\n"
-"] [--verbose] [--thin] [--atomic]\n"
+" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
" [<tuan rumah>:]<direktori> (--all | <referensi>...)"
#: builtin/send-pack.c
@@ -14094,6 +14710,10 @@ msgid "remote name"
msgstr "nama remote"
#: builtin/send-pack.c
+msgid "push all refs"
+msgstr "dorong semua referensi"
+
+#: builtin/send-pack.c
msgid "use stateless RPC protocol"
msgstr "gunakan protokol RPC nirkeadaan"
@@ -14118,8 +14738,9 @@ msgid "using multiple --group options with stdin is not supported"
msgstr "menggunakan banyak opsi --group dengan masukan standar tidak didukung"
#: builtin/shortlog.c
-msgid "using --group=trailer with stdin is not supported"
-msgstr "mengguanakn --group=trailer dengan stdin tidak didukung"
+#, c-format
+msgid "using %s with stdin is not supported"
+msgstr "menggunakan %s dengan masukan standar tidak didukung"
#: builtin/shortlog.c
#, c-format
@@ -14167,12 +14788,14 @@ msgid ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
" [--current] [--color[=<when>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<rev> | <glob>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<rev> | <glob>)...]"
msgstr ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
" [--current] [--color[=<kapan>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<revisi> | <glob>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<revisi> | <glob>)...]"
#: builtin/show-branch.c
msgid "git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]"
@@ -14302,17 +14925,41 @@ msgstr "algoritma hash tidak dikenal"
#: builtin/show-ref.c
msgid ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...]"
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<pattern>...]"
msgstr ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pola>...]"
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<pola>...]"
+
+#: builtin/show-ref.c
+msgid ""
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<ref>...]"
+msgstr ""
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<pola>...]"
#: builtin/show-ref.c
msgid "git show-ref --exclude-existing[=<pattern>]"
msgstr "git show-ref --exclude-existing[=<pola>]"
#: builtin/show-ref.c
+msgid "git show-ref --exists <ref>"
+msgstr "git show-ref --exists <referensi>"
+
+#: builtin/show-ref.c
+msgid "reference does not exist"
+msgstr "referensi tidak ada"
+
+#: builtin/show-ref.c
+msgid "failed to look up reference"
+msgstr "gagal mencari referensi"
+
+#: builtin/show-ref.c
msgid "only show tags (can be combined with heads)"
msgstr "hanya perlihatkan tag (bisa dikombinasikan dengan kepala)"
@@ -14321,6 +14968,10 @@ msgid "only show heads (can be combined with tags)"
msgstr "hanya perlihatkan kepala (bisa dikombinasikan dengan tag)"
#: builtin/show-ref.c
+msgid "check for reference existence without resolving"
+msgstr "periksa adanya referensi tanpa penguraian"
+
+#: builtin/show-ref.c
msgid "stricter reference checking, requires exact ref path"
msgstr "pemeriksaan referensi lebih ketat, butuh jalur referensi eksak"
@@ -14347,8 +14998,12 @@ msgstr ""
"lokal"
#: builtin/sparse-checkout.c
-msgid "git sparse-checkout (init|list|set|add|reapply|disable) <options>"
-msgstr "git sparse-checkout (init|list|set|add|reapply|disable) <opsi>"
+msgid ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
+msgstr ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<opsi>]"
#: builtin/sparse-checkout.c
msgid "this worktree is not sparse"
@@ -14392,10 +15047,10 @@ msgstr "inisialisasi checkout tipis dalam mode kerucut"
msgid "toggle the use of a sparse index"
msgstr "gunakan indeks tipis"
-#: builtin/sparse-checkout.c commit-graph.c midx.c
+#: builtin/sparse-checkout.c commit-graph.c midx.c sequencer.c
#, c-format
msgid "unable to create leading directories of %s"
-msgstr ""
+msgstr "tidak dapat membuat direktori utama dari %s"
#: builtin/sparse-checkout.c
#, c-format
@@ -14499,77 +15154,88 @@ msgstr ""
msgid "error while refreshing working directory"
msgstr "kesalahan saat menyegarkan direktori kerja"
-#: builtin/stash.c
-msgid "git stash list [<options>]"
-msgstr "git stash list [<opsi>]"
+#: builtin/sparse-checkout.c
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no]-cone] [--rules-"
+"file <file>]"
-#: builtin/stash.c
-msgid "git stash show [<options>] [<stash>]"
-msgstr "git stash show [<opsi>] [<stase>]"
+#: builtin/sparse-checkout.c
+msgid "terminate input and output files by a NUL character"
+msgstr "akhiri berkas masukan dan keluaran oleh satu karakter NUL"
-#: builtin/stash.c
-msgid "git stash drop [-q|--quiet] [<stash>]"
-msgstr "git stash drop [-q|--quiet] [<stase>]"
+#: builtin/sparse-checkout.c
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
+"ketika digunakan dengan --rules-file tafsirkan pola sebagai pola mode kerucut"
-#: builtin/stash.c
-msgid "git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash ( pop | apply ) [--index] [-q|--quiet] [<stase>]"
+#: builtin/sparse-checkout.c
+msgid "use patterns in <file> instead of the current ones."
+msgstr "gunakan pola di dalam <berkas> daripada yang saat ini."
#: builtin/stash.c
-msgid "git stash branch <branchname> [<stash>]"
-msgstr "git stash branch <nama cabang> [<stase>]"
+msgid "git stash list [<log-options>]"
+msgstr "git stash list [<opsi log>]"
#: builtin/stash.c
msgid ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
-" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
-" [--] [<pathspec>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<diff-"
+"options>] [<stash>]"
msgstr ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index]\n"
-" [-q|--quiet] [-u|--include-untracked] [-a|--all]\n"
-" [-m|--message <pesan>] [--pathspec-from-file=<berkas>\n"
-" [--pathspec-file-nul]] [--] [<spek jalur>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<opsi diff>] "
+"[<stase>]"
#: builtin/stash.c
-msgid ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
-msgstr ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index]\n"
-" [-q|--quiet] [-u|--include-untracked] [-a|--all] [<pesan>]"
+msgid "git stash drop [-q | --quiet] [<stash>]"
+msgstr "git stash drop [-q | --quiet] [<stase>]"
+
+#: builtin/stash.c
+msgid "git stash pop [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash pop [--index] [-q | --quiet] [<stase>]"
#: builtin/stash.c
-msgid "git stash pop [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash pop [--index] [-q|--quiet] [<stase>]"
+msgid "git stash apply [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash apply [--index] [-q | --quiet] [<stase>]"
#: builtin/stash.c
-msgid "git stash apply [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash apply [--index] [-q|--quiet] [<stase>]"
+msgid "git stash branch <branchname> [<stash>]"
+msgstr "git stash branch <nama cabang> [<stase>]"
#: builtin/stash.c
-msgid "git stash store [-m|--message <message>] [-q|--quiet] <commit>"
-msgstr "git stash store [-m|--message <pesan>] [-q|--quiet] <komit>"
+msgid "git stash store [(-m | --message) <message>] [-q | --quiet] <commit>"
+msgstr "git stash store [(-m | --message) <pesan>] [-q|--quiet] <komit>"
#: builtin/stash.c
msgid ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<message>]\n"
+" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
" [--] [<pathspec>...]]"
msgstr ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <pesan>]\n"
-" [--] [<spek jalur>...]"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<pesan>]\n"
+" [--pathspec-from-file=<berkas> [--pathspec-file-nul]]\n"
+" [--] [<spek jalur>...]]"
#: builtin/stash.c
msgid ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<message>]"
msgstr ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<pesan>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<pesan>]"
+
+#: builtin/stash.c
+msgid "git stash create [<message>]"
+msgstr "git stash create [<pesan>]"
#: builtin/stash.c
#, c-format
@@ -14787,11 +15453,11 @@ msgstr "masukkan berkas ignore"
#: builtin/stripspace.c
msgid "skip and remove all lines starting with comment character"
-msgstr ""
+msgstr "lewati dan hapus semua baris yang diawali dengan karakter komentar"
#: builtin/stripspace.c
msgid "prepend comment character and space to each line"
-msgstr ""
+msgstr "tambahkan karakter komentar dan spasi di awal setiap baris"
#: builtin/submodule--helper.c
#, c-format
@@ -14800,6 +15466,11 @@ msgstr "Mengharapkan nama referensi penuh, dapat %s"
#: builtin/submodule--helper.c
#, c-format
+msgid "could not get a repository handle for submodule '%s'"
+msgstr "tidak dapat mendapat pegangan repositori untuk submodul '%s'"
+
+#: builtin/submodule--helper.c
+#, c-format
msgid ""
"could not look up configuration '%s'. Assuming this repository is its own "
"authoritative upstream."
@@ -14808,14 +15479,6 @@ msgstr ""
"hulu otoritatif tersendiri."
#: builtin/submodule--helper.c
-msgid "alternative anchor for relative paths"
-msgstr "jangkar alternatif untuk jalur relatif"
-
-#: builtin/submodule--helper.c
-msgid "git submodule--helper list [--prefix=<path>] [<path>...]"
-msgstr "git submodule--helper list [--prefix=<jalur>] [<jalur>...]"
-
-#: builtin/submodule--helper.c
#, c-format
msgid "No url found for submodule path '%s' in .gitmodules"
msgstr "Tidak ada url yang ditemukan untuk jalur submodul '%s' di .gitmodules"
@@ -14854,9 +15517,8 @@ msgid "recurse into nested submodules"
msgstr "rekursi ke dalam submodul bersarang"
#: builtin/submodule--helper.c
-msgid "git submodule--helper foreach [--quiet] [--recursive] [--] <command>"
-msgstr ""
-"git submodule--helper foreach [--quiet] [--recursive] [--] [<perintah>]"
+msgid "git submodule foreach [--quiet] [--recursive] [--] <command>"
+msgstr "git submodule foreach [--quiet] [--recursive] [--] [<perintah>]"
#: builtin/submodule--helper.c
#, c-format
@@ -14883,8 +15545,8 @@ msgid "suppress output for initializing a submodule"
msgstr "sembunyikan keluaran menginisialisasi submodul"
#: builtin/submodule--helper.c
-msgid "git submodule--helper init [<options>] [<path>]"
-msgstr "git submodule--helper init [<opsi>] [<jalur>]"
+msgid "git submodule init [<options>] [<path>]"
+msgstr "git submodule init [<opsi>] [<jalur>]"
#: builtin/submodule--helper.c
#, c-format
@@ -14918,10 +15580,6 @@ msgid "git submodule status [--quiet] [--cached] [--recursive] [<path>...]"
msgstr "git submodule status [--quiet] [--cached] [--recursive] [<jalur>...]"
#: builtin/submodule--helper.c
-msgid "git submodule--helper name <path>"
-msgstr "git submodule--helper name <jalur>"
-
-#: builtin/submodule--helper.c
#, c-format
msgid "* %s %s(blob)->%s(submodule)"
msgstr "* %s %s(blob)->%s(submodul)"
@@ -14963,8 +15621,8 @@ msgid "limit the summary size"
msgstr "batasi ukuran ringkasan"
#: builtin/submodule--helper.c
-msgid "git submodule--helper summary [<options>] [<commit>] [--] [<path>]"
-msgstr "git submodule--helper summary [<opsi>] [<commit>] -- [<jalur>]"
+msgid "git submodule summary [<options>] [<commit>] [--] [<path>]"
+msgstr "git submodule summary [<opsi>] [<commit>] -- [<jalur>]"
#: builtin/submodule--helper.c
msgid "could not fetch a revision for HEAD"
@@ -14982,11 +15640,6 @@ msgstr "gagal mendaftarkan url untuk jalur submodul '%s'"
#: builtin/submodule--helper.c
#, c-format
-msgid "failed to get the default remote for submodule '%s'"
-msgstr "gagal mendapatkan remote asali untuk submodul '%s'"
-
-#: builtin/submodule--helper.c
-#, c-format
msgid "failed to update remote for submodule '%s'"
msgstr "gagal memperbarui remote untuk submodul '%s'"
@@ -14995,8 +15648,8 @@ msgid "suppress output of synchronizing submodule url"
msgstr "sembunyikan keluaran mensinkronisasi url submodul"
#: builtin/submodule--helper.c
-msgid "git submodule--helper sync [--quiet] [--recursive] [<path>]"
-msgstr "git submodule--helper sync [--quiet] [--recursive] [<jalur>]"
+msgid "git submodule sync [--quiet] [--recursive] [<path>]"
+msgstr "git submodule sync [--quiet] [--recursive] [<jalur>]"
#: builtin/submodule--helper.c
#, c-format
@@ -15069,6 +15722,11 @@ msgstr ""
#: builtin/submodule--helper.c
#, c-format
+msgid "could not get a repository handle for gitdir '%s'"
+msgstr "tidak dapat mendapat pegangan repositori untuk direktori git '%s'"
+
+#: builtin/submodule--helper.c
+#, c-format
msgid "submodule '%s' cannot add alternate: %s"
msgstr "submodul '%s' tidak dapat menambahkan pengganti: %s"
@@ -15104,6 +15762,10 @@ msgid "could not get submodule directory for '%s'"
msgstr "tidak dapat mendapatkan direktori submodul untuk '%s'"
#: builtin/submodule--helper.c
+msgid "alternative anchor for relative paths"
+msgstr "jangkar alternatif untuk jalur relatif"
+
+#: builtin/submodule--helper.c
msgid "where the new submodule will be cloned to"
msgstr "di mana submodul baru akan dikloning"
@@ -15139,11 +15801,6 @@ msgstr ""
#: builtin/submodule--helper.c
#, c-format
-msgid "Invalid update mode '%s' for submodule path '%s'"
-msgstr "Mode pembaruan '%s' tidak valid untuk jalur submodul '%s'"
-
-#: builtin/submodule--helper.c
-#, c-format
msgid "Invalid update mode '%s' configured for submodule path '%s'"
msgstr "Mode pembaruan '%s' tidak valid untuk jalur submodul '%s'"
@@ -15168,6 +15825,11 @@ msgstr "Melewati submodul '%s'"
#: builtin/submodule--helper.c
#, c-format
+msgid "cannot clone submodule '%s' without a URL"
+msgstr "tidak dapat mengkloning submodul '%s' tanpa URL"
+
+#: builtin/submodule--helper.c
+#, c-format
msgid "Failed to clone '%s'. Retry scheduled"
msgstr "Gagal mengkloning '%s'. Percobaan ulang dijadwalkan"
@@ -15234,6 +15896,11 @@ msgstr ""
#: builtin/submodule--helper.c
#, c-format
+msgid "could not initialize submodule at path '%s'"
+msgstr "tidak dapat menginisialisasi submodul pada jalur '%s'"
+
+#: builtin/submodule--helper.c
+#, c-format
msgid ""
"Submodule (%s) branch configured to inherit branch from superproject, but "
"the superproject is not on any branch"
@@ -15243,11 +15910,6 @@ msgstr ""
#: builtin/submodule--helper.c
#, c-format
-msgid "could not get a repository handle for submodule '%s'"
-msgstr "tidak dapat mendapat pegangan repositori untuk submodul '%s'"
-
-#: builtin/submodule--helper.c
-#, c-format
msgid "Unable to find current revision in submodule path '%s'"
msgstr "Tidak dapat menemukan revisi saat ini pada jalur submodul '%s'"
@@ -15287,16 +15949,16 @@ msgid "don't fetch new objects from the remote site"
msgstr "jangan ambil objek baru dari situs remote"
#: builtin/submodule--helper.c
-msgid "path into the working tree"
-msgstr "jalur ke dalam pohon kerja"
+msgid "use the 'checkout' update strategy (default)"
+msgstr "gunakan strategi pembaruan 'checkout' (asali)"
#: builtin/submodule--helper.c
-msgid "path into the working tree, across nested submodule boundaries"
-msgstr "jalur ke dalam pohon kerja, melintasi perbatasan submodul bersarang"
+msgid "use the 'merge' update strategy"
+msgstr "gunakan strategi penmbaruan 'merge'"
#: builtin/submodule--helper.c
-msgid "rebase, merge, checkout or none"
-msgstr "dasarkan ulang, gabungkan, checkout atau tidak sama sekali"
+msgid "use the 'rebase' update strategy"
+msgstr "gunakan strategi pembaruan 'rebase'"
#: builtin/submodule--helper.c
msgid "create a shallow clone truncated to the specified number of revisions"
@@ -15315,6 +15977,11 @@ msgid "don't print cloning progress"
msgstr "jangan cetak perkembangan pengkloningan"
#: builtin/submodule--helper.c
+msgid "disallow cloning into non-empty directory, implies --init"
+msgstr ""
+"tak perbolehkan kloning ke dalam direktori berisi, mengimplikasikan --init"
+
+#: builtin/submodule--helper.c
msgid ""
"git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] "
"[-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-"
@@ -15326,45 +15993,21 @@ msgstr ""
"shallow] [--reference <repositori>] [--recursive] [--[no-]single-branch] "
"[--] [<jalur>...]"
-#: builtin/submodule--helper.c
-msgid "bad value for update parameter"
-msgstr "nilai jelek untuk parameter pembaruan"
-
-#: builtin/submodule--helper.c
-msgid "recurse into submodules"
-msgstr "rekursi ke dalam submodul"
-
-#: builtin/submodule--helper.c
-msgid "git submodule--helper absorb-git-dirs [<options>] [<path>...]"
-msgstr "git submodule--helper absorb-git-dirs [<opsi>] [<jalur>...]"
-
-#: builtin/submodule--helper.c
-msgid "check if it is safe to write to the .gitmodules file"
-msgstr "periksa apakah itu aman untuk menulis ke berkas .gitmodules"
-
-#: builtin/submodule--helper.c
-msgid "unset the config in the .gitmodules file"
-msgstr "batal setel konfigurasi dalam berkas .gitmodules"
-
-#: builtin/submodule--helper.c
-msgid "git submodule--helper config <name> [<value>]"
-msgstr "git submodule--helper config <nama> [<nilai>]"
-
-#: builtin/submodule--helper.c
-msgid "git submodule--helper config --unset <name>"
-msgstr "git submodule--helper config --unset <nama>"
+#: builtin/submodule--helper.c submodule.c
+msgid "Failed to resolve HEAD as a valid ref."
+msgstr "Gagal menguraikan HEAD sebagai referensi valid."
#: builtin/submodule--helper.c
-msgid "please make sure that the .gitmodules file is in the working tree"
-msgstr "mohom pastikan berkas .gitmodules di dalam pohon kerja"
+msgid "git submodule absorbgitdirs [<options>] [<path>...]"
+msgstr "git submodule absorbgitdirs [<opsi>] [<jalur>...]"
#: builtin/submodule--helper.c
msgid "suppress output for setting url of a submodule"
msgstr "sembunyikan keluaran penyetelan url submodule"
#: builtin/submodule--helper.c
-msgid "git submodule--helper set-url [--quiet] <path> <newurl>"
-msgstr "git submodule--helper set-url [--quiet] <jalur> <url baru>"
+msgid "git submodule set-url [--quiet] <path> <newurl>"
+msgstr "git submodule set-url [--quiet] <jalur> <url baru>"
#: builtin/submodule--helper.c
msgid "set the default tracking branch to master"
@@ -15375,14 +16018,12 @@ msgid "set the default tracking branch"
msgstr "setel cabang pelacak asali"
#: builtin/submodule--helper.c
-msgid "git submodule--helper set-branch [-q|--quiet] (-d|--default) <path>"
-msgstr "git submodule--helper set-branch [-q|--quiet] (-d|--default) <jalur>"
+msgid "git submodule set-branch [-q|--quiet] (-d|--default) <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-d|--default) <jalur>"
#: builtin/submodule--helper.c
-msgid ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
-msgstr ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <cabang> <jalur>"
+msgid "git submodule set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-b|--branch) <cabang> <jalur>"
#: builtin/submodule--helper.c
msgid "--branch or --default required"
@@ -15456,6 +16097,10 @@ msgid "unable to checkout submodule '%s'"
msgstr "Tidak dapat men-checkout submodul '%s'"
#: builtin/submodule--helper.c
+msgid "please make sure that the .gitmodules file is in the working tree"
+msgstr "mohom pastikan berkas .gitmodules di dalam pohon kerja"
+
+#: builtin/submodule--helper.c
#, c-format
msgid "Failed to add submodule '%s'"
msgstr "Tidak dapat menambahkan submodul '%s'"
@@ -15478,7 +16123,7 @@ msgstr "'%s' sudah ada di dalam indeks dan bukan submodul"
#: builtin/submodule--helper.c read-cache.c
#, c-format
msgid "'%s' does not have a commit checked out"
-msgstr ""
+msgstr "'%s' tidak punya sebuah komit tercheckout"
#: builtin/submodule--helper.c
msgid "branch of repository to add as submodule"
@@ -15500,8 +16145,8 @@ msgstr ""
"setel nama submodul ke untai yang diberikan daripada diasalkan ke jalurnya"
#: builtin/submodule--helper.c
-msgid "git submodule--helper add [<options>] [--] <repository> [<path>]"
-msgstr "git submodule--helper add [<opsi>] [--] <repositori> [<jalur>]"
+msgid "git submodule add [<options>] [--] <repository> [<path>]"
+msgstr "git submodule add [<opsi>] [--] <repositori> [<jalur>]"
#: builtin/submodule--helper.c
msgid "Relative path can only be used from the toplevel of the working tree"
@@ -15517,23 +16162,21 @@ msgstr "URL repo: '%s' harus absolut atau diawali dengan ./|../"
msgid "'%s' is not a valid submodule name"
msgstr "'%s' bukan nama submodul yang valid"
-#: builtin/submodule--helper.c git.c
-#, c-format
-msgid "%s doesn't support --super-prefix"
-msgstr "%s tidak mendukung --super-prefix"
-
#: builtin/submodule--helper.c
-#, c-format
-msgid "'%s' is not a valid submodule--helper subcommand"
-msgstr "'%s' bukan subperintah submodule--helper valid"
+msgid "git submodule--helper <command>"
+msgstr "git submodule--helper <nama>"
#: builtin/symbolic-ref.c
-msgid "git symbolic-ref [<options>] <name> [<ref>]"
-msgstr "git symbolic-ref [<opsi>] <nama> [<referensi>]"
+msgid "git symbolic-ref [-m <reason>] <name> <ref>"
+msgstr "git symbolic-ref [-m <alasan>] <nama> <referensi>"
#: builtin/symbolic-ref.c
-msgid "git symbolic-ref -d [-q] <name>"
-msgstr "git symbolic-ref -d [-q] <nama>"
+msgid "git symbolic-ref [-q] [--short] [--no-recurse] <name>"
+msgstr "git symbolic-ref [-q] [--short] [--no-recurse] <nama>"
+
+#: builtin/symbolic-ref.c
+msgid "git symbolic-ref --delete [-q] <name>"
+msgstr "git symbolic-ref --delete [-q] <nama>"
#: builtin/symbolic-ref.c
msgid "suppress error message for non-symbolic (detached) refs"
@@ -15547,6 +16190,10 @@ msgstr "hapus referensi simbolik"
msgid "shorten ref output"
msgstr "pendekkan keluaran referensi"
+#: builtin/symbolic-ref.c
+msgid "recursively dereference (default)"
+msgstr "derefensi secara rekursif (asali)"
+
#: builtin/symbolic-ref.c builtin/update-ref.c
msgid "reason"
msgstr "alasan"
@@ -15557,11 +16204,11 @@ msgstr "alasan pembaruan"
#: builtin/tag.c
msgid ""
-"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]\n"
-" <tagname> [<head>]"
+"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
+" <tagname> [<commit> | <object>]"
msgstr ""
-"git tag [-a | -s | -u <id kunci>] [-f] [-m <pesan | -F <berkas>]\n"
-" <nama tag> [<kepala>]"
+"git tag [-a | -s | -u <id kunci>] [-f] [-m <pesan> | -F <berkas>] [-e]\n"
+" <nama tag> [<komit> | <objek>]"
#: builtin/tag.c
msgid "git tag -d <tagname>..."
@@ -15569,15 +16216,15 @@ msgstr "git tag -d <nama tag>..."
#: builtin/tag.c
msgid ""
-"git tag -l [-n[<num>]] [--contains <commit>] [--no-contains <commit>] [--"
-"points-at <object>]\n"
-" [--format=<format>] [--merged <commit>] [--no-merged <commit>] "
-"[<pattern>...]"
+"git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]\n"
+" [--points-at <object>] [--column[=<options>] | --no-column]\n"
+" [--create-reflog] [--sort=<key>] [--format=<format>]\n"
+" [--merged <commit>] [--no-merged <commit>] [<pattern>...]"
msgstr ""
-"git tag -l [-n[<angka>]] [--contains <komit>] [--no-contains <komit>] [--"
-"points-at <objek>]\n"
-" [--format=<format>] [--merged <komit>] [--no-merged <komit>] "
-"[<pola>...]"
+"git tag [-n[<angka>]] -l [--contains <komit>] [--no-contains <komit>]\n"
+" [--points-at <objeck>] [--column[=<opsi>] | --no-column]\n"
+" [--create-reflog] [--sort=<kunci>] [--format=<format>]\n"
+" [--merged <komit>] [--no-merged <komit>] [<pola>...]"
#: builtin/tag.c
msgid "git tag -v [--format=<format>] <tagname>..."
@@ -15758,6 +16405,19 @@ msgid "pack exceeds maximum allowed size"
msgstr "paket melebihi ukuran maksimum yang diperbolehkan"
#: builtin/unpack-objects.c
+msgid "failed to write object in stream"
+msgstr "gagal menulis objek di dalam arus"
+
+#: builtin/unpack-objects.c
+#, c-format
+msgid "inflate returned (%d)"
+msgstr "inflate mengembalikan (%d)"
+
+#: builtin/unpack-objects.c
+msgid "invalid blob object from stream"
+msgstr "objek blob tidak valid dari arus"
+
+#: builtin/unpack-objects.c
msgid "Unpacking objects"
msgstr "Membongkar objek"
@@ -15919,6 +16579,10 @@ msgid "write index in this format"
msgstr "tulis indeks dalam format ini"
#: builtin/update-index.c
+msgid "report on-disk index format version"
+msgstr "laporkan versi format indeks pada-disk"
+
+#: builtin/update-index.c
msgid "enable or disable split index"
msgstr "aktifkan atau nonaktifkan indeks terpisah"
@@ -15951,6 +16615,16 @@ msgid "clear fsmonitor valid bit"
msgstr "bersihkan bita fsmonitor valid"
#: builtin/update-index.c
+#, c-format
+msgid "%d\n"
+msgstr "%d\n"
+
+#: builtin/update-index.c
+#, c-format
+msgid "index-version: was %d, set to %d"
+msgstr "index-version: sebelumnya %d, disetel ke %d"
+
+#: builtin/update-index.c
msgid ""
"core.splitIndex is set to false; remove or change it, if you really want to "
"enable split index"
@@ -16046,8 +16720,12 @@ msgid "update the info files from scratch"
msgstr "perbarui berkas info dari awal"
#: builtin/upload-pack.c
-msgid "git upload-pack [<options>] <dir>"
-msgstr "git upload-pack [<opsi>] <direktori>"
+msgid ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <directory>"
+msgstr ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <direktori>"
#: builtin/upload-pack.c t/helper/test-serve-v2.c
msgid "quit after a single request/response exchange"
@@ -16066,8 +16744,8 @@ msgid "interrupt transfer after <n> seconds of inactivity"
msgstr "interupsi transfer setelah <n> detik niraktivitas"
#: builtin/verify-commit.c
-msgid "git verify-commit [-v | --verbose] <commit>..."
-msgstr "git verify-commit [-v | --verbose] <komit>..."
+msgid "git verify-commit [-v | --verbose] [--raw] <commit>..."
+msgstr "git verify-commit [-v | --verbose] [--raw] <komit>..."
#: builtin/verify-commit.c
msgid "print commit contents"
@@ -16078,8 +16756,8 @@ msgid "print raw gpg status output"
msgstr "cetak keluaran status gpg mentah"
#: builtin/verify-pack.c
-msgid "git verify-pack [-v | --verbose] [-s | --stat-only] <pack>..."
-msgstr "git verify-pack [-v | --verbose] [-s | --stat-only] <pak>..."
+msgid "git verify-pack [-v | --verbose] [-s | --stat-only] [--] <pack>.idx..."
+msgstr "git verify-pack [-v | --verbose] [-s | --stat-only] [--] <pak>.idx..."
#: builtin/verify-pack.c
msgid "verbose"
@@ -16090,44 +16768,80 @@ msgid "show statistics only"
msgstr "hanya perlihatkan statistik"
#: builtin/verify-tag.c
-msgid "git verify-tag [-v | --verbose] [--format=<format>] <tag>..."
-msgstr "git verify-tag [-v | --verbose] [--format=<format>] <tag>..."
+msgid "git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."
+msgstr "git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."
#: builtin/verify-tag.c
msgid "print tag contents"
msgstr "cetak isi tag"
#: builtin/worktree.c
-msgid "git worktree add [<options>] <path> [<commit-ish>]"
-msgstr "git worktree add [<opsi>] <jalur> [<mirip komit>]"
+msgid ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <string>]]\n"
+" [--orphan] [(-b | -B) <new-branch>] <path> [<commit-ish>]"
+msgstr ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <untai>]]\n"
+" [--orphan] [(-b | -B) <cabang baru>] <jalur> [<mirip komit>]"
#: builtin/worktree.c
-msgid "git worktree list [<options>]"
-msgstr "git worktree list [<opsi>]"
+msgid "git worktree list [-v | --porcelain [-z]]"
+msgstr "git worktree list [-v | --porcelain [-z]"
#: builtin/worktree.c
-msgid "git worktree lock [<options>] <path>"
-msgstr "git worktree lock [<opsi>] <jalur>"
+msgid "git worktree lock [--reason <string>] <worktree>"
+msgstr "git worktree lock [--reason <untai>] <pohon kerja>"
#: builtin/worktree.c
msgid "git worktree move <worktree> <new-path>"
msgstr "git worktree move <pohon kerja> <jalur baru>"
#: builtin/worktree.c
-msgid "git worktree prune [<options>]"
-msgstr "git worktree prune [<opsi>]"
+msgid "git worktree prune [-n] [-v] [--expire <expire>]"
+msgstr "git worktree prune [-n] [-v] [--expire <kadaluarsa>]"
#: builtin/worktree.c
-msgid "git worktree remove [<options>] <worktree>"
-msgstr "git worktree remove [<opsi>] <pohon kerja>"
+msgid "git worktree remove [-f] <worktree>"
+msgstr "git worktree remove [-f] <pohon kerja>"
#: builtin/worktree.c
msgid "git worktree repair [<path>...]"
msgstr "git worktree repair [<jalur>...]"
#: builtin/worktree.c
-msgid "git worktree unlock <path>"
-msgstr "git worktree unlock <jalur>"
+msgid "git worktree unlock <worktree>"
+msgstr "git worktree unlock <worktree>"
+
+#: builtin/worktree.c
+msgid "No possible source branch, inferring '--orphan'"
+msgstr "Tidak ada cabang sumber yang mungkin, menyimpulkan '--orphan'"
+
+#: builtin/worktree.c
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+msgstr ""
+"Jika maksud Anda ingin membuat pohon kerja berisi sebuah cabang yatim baru\n"
+"(cabang tanpa komit) untuk repositori ini, Anda dapat melakukannya dengan\n"
+"opsi --orphan:\n"
+" git worktree add --orphan -b %s %s\n"
+
+#: builtin/worktree.c
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan %s\n"
+msgstr ""
+"Jika maksud Anda ingin membuat pohon kerja berisi sebuah cabang yatim baru\n"
+"(cabang tanpa komit) untuk repositori ini, Anda dapat melakukannya dengan\n"
+"opsi --orphan:\n"
+" git worktree add --orphan %s\n"
#: builtin/worktree.c
#, c-format
@@ -16198,6 +16912,11 @@ msgstr "menginisialisasi"
#: builtin/worktree.c
#, c-format
+msgid "could not find created worktree '%s'"
+msgstr "tidak dapat menemukan pohon kerja yang dibuat '%s'"
+
+#: builtin/worktree.c
+#, c-format
msgid "Preparing worktree (new branch '%s')"
msgstr "Menyiapkan pohon kerja (cabang baru '%s')"
@@ -16214,10 +16933,35 @@ msgstr "Menyiapkan pohon kerja (men-checkout '%s')"
#: builtin/worktree.c
#, c-format
+msgid "unreachable: invalid reference: %s"
+msgstr "tidak dapat dicapat: referensi tidak valid: %s"
+
+#: builtin/worktree.c
+#, c-format
msgid "Preparing worktree (detached HEAD %s)"
msgstr "Menyiapkan pohon kerja (HEAD terpisah %s)"
#: builtin/worktree.c
+#, c-format
+msgid ""
+"HEAD points to an invalid (or orphaned) reference.\n"
+"HEAD path: '%s'\n"
+"HEAD contents: '%s'"
+msgstr ""
+"HEAD menunjuk pada referensi tidak valid (atau yatim).\n"
+"Jalur HEAD: '%s'\n"
+"Isi HEAD: '%s'"
+
+#: builtin/worktree.c
+msgid ""
+"No local or remote refs exist despite at least one remote\n"
+"present, stopping; use 'add -f' to override or fetch a remote first"
+msgstr ""
+"Tidak ada referensi lokal atau remote yang ada meskipun salah satu remote\n"
+"ada, berhenti; gunakan 'add -f' untuk menimpa atau mengambil remote\n"
+"terlebih dahulu"
+
+#: builtin/worktree.c
msgid "checkout <branch> even if already checked out in other worktree"
msgstr ""
"checkout <cabang> bahkan jika sudah di-checkout pada pohon kerja lainnya"
@@ -16231,6 +16975,10 @@ msgid "create or reset a branch"
msgstr "buat atau setel ulang sebuah cabang"
#: builtin/worktree.c
+msgid "create unborn branch"
+msgstr "buat cabang belum lahir/yatim"
+
+#: builtin/worktree.c
msgid "populate the new working tree"
msgstr "isikan pohon kerja baru"
@@ -16256,6 +17004,11 @@ msgid "options '%s', '%s', and '%s' cannot be used together"
msgstr "Opsi '%s', '%s', dan '%s' tidak dapat digunakan bersamaan"
#: builtin/worktree.c
+#, c-format
+msgid "option '%s' and commit-ish cannot be used together"
+msgstr "opsi '%s' dan mirip-komit tidak dapat digunakan bersamaan"
+
+#: builtin/worktree.c
msgid "added with --lock"
msgstr "tambahkan dengan --lock"
@@ -16414,6 +17167,78 @@ msgstr "tulis objek pohon untuk subdirektori <prefiks>"
msgid "only useful for debugging"
msgstr "hanya berguna untuk penirkutuan"
+#: bulk-checkin.c
+msgid "core.fsyncMethod = batch is unsupported on this platform"
+msgstr "core.fsyncMethod = batch tidak didukung pada platform ini"
+
+#: bundle-uri.c
+#, c-format
+msgid "could not parse bundle list key %s with value '%s'"
+msgstr "tidak dapat mengurai kunci daftar bundel %s dengan nilai '%s'"
+
+#: bundle-uri.c
+#, c-format
+msgid "bundle list at '%s' has no mode"
+msgstr "daftar bundel pada '%s' tidak punya mode"
+
+#: bundle-uri.c
+msgid "failed to create temporary file"
+msgstr "tidak dapat membuat berkas sementara"
+
+#: bundle-uri.c
+msgid "insufficient capabilities"
+msgstr "tidak cukup kemampuan"
+
+#: bundle-uri.c
+#, c-format
+msgid "file downloaded from '%s' is not a bundle"
+msgstr "berkas yang diunduh dari '%s' bukan sebuah bundel"
+
+#: bundle-uri.c
+msgid "failed to store maximum creation token"
+msgstr "gagal menyimpan token pembuatan maksimum"
+
+#: bundle-uri.c
+#, c-format
+msgid "unrecognized bundle mode from URI '%s'"
+msgstr "mode bundel tidak dikenal dari URI '%s'"
+
+#: bundle-uri.c
+#, c-format
+msgid "exceeded bundle URI recursion limit (%d)"
+msgstr "batas rekursi URI bundel (%d) terlewati"
+
+#: bundle-uri.c
+#, c-format
+msgid "failed to download bundle from URI '%s'"
+msgstr "gagal mengunduh bundel dari URI '%s'"
+
+#: bundle-uri.c
+#, c-format
+msgid "file at URI '%s' is not a bundle or bundle list"
+msgstr "berkas pada URI '%s' bukan sebuah bundel atau daftar bundel"
+
+#: bundle-uri.c
+#, c-format
+msgid "bundle-uri: unexpected argument: '%s'"
+msgstr "bundle-uri: argumen tidak diharapkan: '%s'"
+
+#: bundle-uri.c
+msgid "bundle-uri: expected flush after arguments"
+msgstr "bundle-uri: bilasan diharapkan setelah argumen"
+
+#: bundle-uri.c
+msgid "bundle-uri: got an empty line"
+msgstr "bundle-uri: dapat satu baris kosong"
+
+#: bundle-uri.c
+msgid "bundle-uri: line is not of the form 'key=value'"
+msgstr "bundle-uri: baris bukan berbentuk 'kunci=nilai'"
+
+#: bundle-uri.c
+msgid "bundle-uri: line has empty key or value"
+msgstr "bundle-uri: baris berisi kunci atau nilai kosong"
+
#: bundle.c
#, c-format
msgid "unrecognized bundle hash algorithm: %s"
@@ -16443,6 +17268,14 @@ msgid "need a repository to verify a bundle"
msgstr "perlu sebuah repositori untuk verifikasi bundel"
#: bundle.c
+msgid ""
+"some prerequisite commits exist in the object store, but are not connected "
+"to the repository's history"
+msgstr ""
+"beberapa komit prasyarat ada pada penyimpanan objek, tetapi tidak terhubung "
+"ke riwayat repositori"
+
+#: bundle.c
#, c-format
msgid "The bundle contains this ref:"
msgid_plural "The bundle contains these %<PRIuMAX> refs:"
@@ -16461,6 +17294,16 @@ msgstr[0] "Bundel membutuhkan referensi ini:"
msgstr[1] "Bundel membutuhkan %<PRIuMAX> referensi berikut:"
#: bundle.c
+#, c-format
+msgid "The bundle uses this hash algorithm: %s"
+msgstr "Bundel menggunakan algoritma hash ini: %s"
+
+#: bundle.c
+#, c-format
+msgid "The bundle uses this filter: %s"
+msgstr "Bundel menggunakan penyaring ini: %s"
+
+#: bundle.c
msgid "unable to dup bundle descriptor"
msgstr "tidak dapat men-dup pendeskripsi bundel"
@@ -16502,941 +17345,1093 @@ msgstr "index-pack mati"
#: chunk-format.c
msgid "terminating chunk id appears earlier than expected"
-msgstr ""
+msgstr "id bingkah pengakhiran muncul lebih awal dari yang diharapkan"
+
+#: chunk-format.c
+#, c-format
+msgid "chunk id %<PRIx32> not %d-byte aligned"
+msgstr "id bingkah %<PRIx32> tidak terata %d-bita"
#: chunk-format.c
#, c-format
msgid "improper chunk offset(s) %<PRIx64> and %<PRIx64>"
-msgstr ""
+msgstr "offset bingkah %<PRIx64> dan %<PRIx64> tidak tepat"
#: chunk-format.c
#, c-format
msgid "duplicate chunk ID %<PRIx32> found"
-msgstr ""
+msgstr "ID bingkah duplikat %<PRIx32> ditemukan"
#: chunk-format.c
#, c-format
msgid "final chunk has non-zero id %<PRIx32>"
-msgstr ""
+msgstr "bingkah terakhir punya id bukan nol %<PRIx32>"
#: chunk-format.c
msgid "invalid hash version"
-msgstr ""
+msgstr "versi hash tidak valid"
#: color.c
#, c-format
msgid "invalid color value: %.*s"
-msgstr ""
+msgstr "nilai warna tidak valid: %.*s"
#: command-list.h
msgid "Add file contents to the index"
-msgstr ""
+msgstr "Tambahkan isi berkas ke indeks"
#: command-list.h
msgid "Apply a series of patches from a mailbox"
-msgstr ""
+msgstr "Terapkan rangkaian tambalan dari kotak surat"
#: command-list.h
msgid "Annotate file lines with commit information"
-msgstr ""
+msgstr "Anotasi baris berkas dengan informasi komit"
#: command-list.h
msgid "Apply a patch to files and/or to the index"
-msgstr ""
+msgstr "Terapkan tambalan pada berkas dan/atau pada indeks"
#: command-list.h
msgid "Import a GNU Arch repository into Git"
-msgstr ""
+msgstr "Impor repositori GNU Arch ke dalam Git"
#: command-list.h
msgid "Create an archive of files from a named tree"
-msgstr ""
+msgstr "Buat arsip berkas dari pohon bernama"
#: command-list.h
msgid "Use binary search to find the commit that introduced a bug"
-msgstr ""
+msgstr "Gunakan pencarian biner untuk mencari komit yang memasukkan bug"
#: command-list.h
msgid "Show what revision and author last modified each line of a file"
msgstr ""
+"Perlihatkan revisi dan pengarang apa yang terakhir kali mengubah setiap "
+"baris berkas"
#: command-list.h
msgid "List, create, or delete branches"
-msgstr ""
+msgstr "Daftar, buat, atau hapus cabang"
#: command-list.h
msgid "Collect information for user to file a bug report"
-msgstr ""
+msgstr "Kumpulkan informasi agar pengguna melaporkan laporan bug"
#: command-list.h
msgid "Move objects and refs by archive"
-msgstr ""
+msgstr "Pindahkan objek dan referensi oleh arsip"
#: command-list.h
-msgid "Provide content or type and size information for repository objects"
-msgstr ""
+msgid "Provide contents or details of repository objects"
+msgstr "Sediakan isi atau detail objek repositori"
#: command-list.h
msgid "Display gitattributes information"
-msgstr ""
+msgstr "Perlihatkan informasi gitattributes"
#: command-list.h
msgid "Debug gitignore / exclude files"
-msgstr ""
+msgstr "Nirkutukan berkas gitignore / exclude"
#: command-list.h
msgid "Show canonical names and email addresses of contacts"
-msgstr ""
+msgstr "Perlihatkan nama dan alamat email kanonikal"
#: command-list.h
msgid "Ensures that a reference name is well formed"
-msgstr ""
+msgstr "Pastikan bahwa nama referensi baik dan benar"
#: command-list.h
msgid "Switch branches or restore working tree files"
-msgstr ""
+msgstr "Ganti cabang atau kembalikan berkas pohon kerja"
#: command-list.h
msgid "Copy files from the index to the working tree"
-msgstr ""
+msgstr "Salin berkas dari indeks ke pohon kerja"
#: command-list.h
msgid "Find commits yet to be applied to upstream"
-msgstr ""
+msgstr "Cari komit yang belum diterapkan pada hulu"
#: command-list.h
msgid "Apply the changes introduced by some existing commits"
-msgstr ""
+msgstr "Terapkan perubahan yang dimasukkan oleh beberapa komit yang ada"
#: command-list.h
msgid "Graphical alternative to git-commit"
-msgstr ""
+msgstr "Alternatif grafik untuk git-commit"
#: command-list.h
msgid "Remove untracked files from the working tree"
-msgstr ""
+msgstr "Hapus berkas tak terlacak dari pohon kerja"
#: command-list.h
msgid "Clone a repository into a new directory"
-msgstr ""
+msgstr "Salin repositori ke dalam direktori baru"
#: command-list.h
msgid "Display data in columns"
-msgstr ""
+msgstr "Tampilkan data dalam kolom"
#: command-list.h
msgid "Record changes to the repository"
-msgstr ""
+msgstr "Rekam perubahan ke dalam repositori"
#: command-list.h
msgid "Write and verify Git commit-graph files"
-msgstr ""
+msgstr "Tulis dan verifikasi berkas Git commit-graph"
#: command-list.h
msgid "Create a new commit object"
-msgstr ""
+msgstr "Buat objek komit baru"
#: command-list.h
msgid "Get and set repository or global options"
-msgstr ""
+msgstr "Dapatkan dan setel opsi repositori atau global"
#: command-list.h
msgid "Count unpacked number of objects and their disk consumption"
-msgstr ""
+msgstr "Hitung jumlah berkas tak terlacak dan penggunaan disknya"
#: command-list.h
msgid "Retrieve and store user credentials"
-msgstr ""
+msgstr "Dapatkan dan simpan kredensial pengguna"
#: command-list.h
msgid "Helper to temporarily store passwords in memory"
-msgstr ""
+msgstr "Pembantu untuk sementara simpan kata sandi di memori"
#: command-list.h
msgid "Helper to store credentials on disk"
-msgstr ""
+msgstr "Pembantu untuk menyimpan kredensial pada disk"
#: command-list.h
msgid "Export a single commit to a CVS checkout"
-msgstr ""
+msgstr "Ekspor satu komit tunggal ke checkout CVS"
#: command-list.h
msgid "Salvage your data out of another SCM people love to hate"
-msgstr ""
+msgstr "Selamatkan data karena pengguna SCM lainnya yang suka membenci"
#: command-list.h
msgid "A CVS server emulator for Git"
-msgstr ""
+msgstr "Emulator peladen CVS untuk Git"
#: command-list.h
msgid "A really simple server for Git repositories"
-msgstr ""
+msgstr "Peladen sederhana beneran untuk repositori Git"
#: command-list.h
msgid "Give an object a human readable name based on an available ref"
msgstr ""
+"Berikan nama yang dapat dibaca manusia pada objek berdasarkan referensi yang "
+"ada"
+
+#: command-list.h
+msgid "Generate a zip archive of diagnostic information"
+msgstr "Buat arsip zip informasi diagnostik"
#: command-list.h
msgid "Show changes between commits, commit and working tree, etc"
msgstr ""
+"Perlihatkan perubahan di antara komit-komit, komit dan pohon kerja, dll"
#: command-list.h
msgid "Compares files in the working tree and the index"
-msgstr ""
+msgstr "Bandingkan berkas di dalam pohon kerja dan indeks"
#: command-list.h
msgid "Compare a tree to the working tree or index"
-msgstr ""
+msgstr "Bandingkan pohon kepada pohon kerja atau indeks"
#: command-list.h
msgid "Compares the content and mode of blobs found via two tree objects"
-msgstr ""
+msgstr "Bandingkan isi dan mode blob yang ditemukan lewat dua objek pohon"
#: command-list.h
msgid "Show changes using common diff tools"
-msgstr ""
+msgstr "Perlihatkan perubahan menggunakan alat diff umum"
#: command-list.h
msgid "Git data exporter"
-msgstr ""
+msgstr "Eksportir data Git"
#: command-list.h
msgid "Backend for fast Git data importers"
-msgstr ""
+msgstr "Tulang punggung untuk importir data Git"
#: command-list.h
msgid "Download objects and refs from another repository"
-msgstr ""
+msgstr "Unduh objek dan referensi dari repositori yang lain"
#: command-list.h
msgid "Receive missing objects from another repository"
-msgstr ""
+msgstr "Terima objek yang hilang dari repositori yang lain"
#: command-list.h
msgid "Rewrite branches"
-msgstr ""
+msgstr "Tulis ulang cabang"
#: command-list.h
msgid "Produce a merge commit message"
-msgstr ""
+msgstr "Buat pesan komit penggabungan"
#: command-list.h
msgid "Output information on each ref"
-msgstr ""
+msgstr "Keluarkan informasi pada setiap referensi"
#: command-list.h
msgid "Run a Git command on a list of repositories"
-msgstr ""
+msgstr "Jalankan perintah Git pada daftar repositori"
#: command-list.h
msgid "Prepare patches for e-mail submission"
-msgstr ""
+msgstr "Siapkan tambalan untuk pengiriman surel"
#: command-list.h
msgid "Verifies the connectivity and validity of the objects in the database"
-msgstr ""
+msgstr "Verifikasi hubungan dan validitas objek di dalam basis data"
#: command-list.h
msgid "Cleanup unnecessary files and optimize the local repository"
-msgstr ""
+msgstr "Bersihkan berkas yang tak perlu dan optimalkan repositori lokal"
#: command-list.h
msgid "Extract commit ID from an archive created using git-archive"
-msgstr ""
+msgstr "Ekstrak ID komit dari arsip yang dibuat dengan git-archive"
#: command-list.h
msgid "Print lines matching a pattern"
-msgstr ""
+msgstr "Cetak baris yang cocok dengan sebuah pola"
#: command-list.h
msgid "A portable graphical interface to Git"
-msgstr ""
+msgstr "Sebuah antarmuka grafis Git portabel"
#: command-list.h
-msgid "Compute object ID and optionally creates a blob from a file"
-msgstr ""
+msgid "Compute object ID and optionally create an object from a file"
+msgstr "Hitung ID objek dan buat objeck dari berkas (opsional)"
#: command-list.h
msgid "Display help information about Git"
-msgstr ""
+msgstr "Perlihatkan bantuan mengenai Git"
#: command-list.h
msgid "Run git hooks"
-msgstr ""
+msgstr "Jalankan kait git"
#: command-list.h
msgid "Server side implementation of Git over HTTP"
-msgstr ""
+msgstr "Impementasi sisi peladen dari Git lewat HTTP"
#: command-list.h
msgid "Download from a remote Git repository via HTTP"
-msgstr ""
+msgstr "Unduh dari repositori Git remote lewat HTTP"
#: command-list.h
msgid "Push objects over HTTP/DAV to another repository"
-msgstr ""
+msgstr "Dorong objek lewat HTTP/DAV ke repositori lainnya"
#: command-list.h
msgid "Send a collection of patches from stdin to an IMAP folder"
-msgstr ""
+msgstr "Kirim koleksi tambalan dari masukan standar ke sebuah direktori IMAP"
#: command-list.h
msgid "Build pack index file for an existing packed archive"
-msgstr ""
+msgstr "Bangun berkas indeks pak dari arsip terpak yang sudah ada"
#: command-list.h
msgid "Create an empty Git repository or reinitialize an existing one"
-msgstr ""
+msgstr "Buat repositori Git kosong atau inisialisasi ulang yang sudah ada"
#: command-list.h
msgid "Instantly browse your working repository in gitweb"
-msgstr ""
+msgstr "Jelajahi repositori kerja Anda secara instan di gitweb"
#: command-list.h
msgid "Add or parse structured information in commit messages"
-msgstr ""
+msgstr "Tambah atau urai informasi terstruktur di dalam pesan komit"
#: command-list.h
msgid "Show commit logs"
-msgstr ""
+msgstr "Perlihatkan log komit"
#: command-list.h
msgid "Show information about files in the index and the working tree"
msgstr ""
+"Perlihatkan informasi mengenai berkas-berkas di dalam indeks dan pohon kerja"
#: command-list.h
msgid "List references in a remote repository"
-msgstr ""
+msgstr "Daftar referensi di repositori remote"
#: command-list.h
msgid "List the contents of a tree object"
-msgstr ""
+msgstr "Daftar isi objek pohon"
#: command-list.h
msgid "Extracts patch and authorship from a single e-mail message"
-msgstr ""
+msgstr "Ekstrak berkas dan kepengarangan dari pesan surel tunggal"
#: command-list.h
msgid "Simple UNIX mbox splitter program"
-msgstr ""
+msgstr "Program pemisah mbox UNIX sederhana"
#: command-list.h
msgid "Run tasks to optimize Git repository data"
-msgstr ""
+msgstr "Jalankan tugas untuk mengoptimalkan data repositori Git"
#: command-list.h
msgid "Join two or more development histories together"
-msgstr ""
+msgstr "Gabungkan dua riwayat pengembangan atau lebih bersama-sama"
#: command-list.h
msgid "Find as good common ancestors as possible for a merge"
-msgstr ""
+msgstr "Cari leluhur umum sebaik-baiknya untuk penggabungan"
#: command-list.h
msgid "Run a three-way file merge"
-msgstr ""
+msgstr "Lakukan penggabungan berkas tiga arah"
#: command-list.h
msgid "Run a merge for files needing merging"
-msgstr ""
+msgstr "Lakukan penggabungan untuk berkas yang perlu digabungkan"
#: command-list.h
msgid "The standard helper program to use with git-merge-index"
-msgstr ""
+msgstr "Program pembantu standar untuk digunakan dengan git-merge-index"
#: command-list.h
-msgid "Show three-way merge without touching index"
-msgstr ""
+msgid "Perform merge without touching index or working tree"
+msgstr "Lakukan penggabungan tanpa menyentuh indeks atau pohon kerja"
#: command-list.h
msgid "Run merge conflict resolution tools to resolve merge conflicts"
msgstr ""
+"Jalankan alat penyelesaian konflik penggabungan untuk menyelesaikan konflik "
+"penggabungan"
#: command-list.h
msgid "Creates a tag object with extra validation"
-msgstr ""
+msgstr "Buat objek tag dengan validasi ekstra"
#: command-list.h
msgid "Build a tree-object from ls-tree formatted text"
-msgstr ""
+msgstr "Bangun objek pohon dari teks berformat ls-tree"
#: command-list.h
msgid "Write and verify multi-pack-indexes"
-msgstr ""
+msgstr "Tulis dan verifikasi indeks multipak"
#: command-list.h
msgid "Move or rename a file, a directory, or a symlink"
-msgstr ""
+msgstr "Pindahkan atau namai ulang berkas, direktori, atau tautan simbolik"
#: command-list.h
msgid "Find symbolic names for given revs"
-msgstr ""
+msgstr "Cari nama simbolik untuk revisi yang diberikan"
#: command-list.h
msgid "Add or inspect object notes"
-msgstr ""
+msgstr "Tambahkan atau inspeksi catatan objek"
#: command-list.h
msgid "Import from and submit to Perforce repositories"
-msgstr ""
+msgstr "Impor dari dan kirimkan ke repositori Perfore"
#: command-list.h
msgid "Create a packed archive of objects"
-msgstr ""
+msgstr "Buat arsip terpak dari objek"
#: command-list.h
msgid "Find redundant pack files"
-msgstr ""
+msgstr "Cari berkas pak berlebihan"
#: command-list.h
msgid "Pack heads and tags for efficient repository access"
-msgstr ""
+msgstr "Pak kepala dan tag untuk akses repositori yang efisien"
#: command-list.h
msgid "Compute unique ID for a patch"
-msgstr ""
+msgstr "Hitung ID unik untuk sebuah tambalan"
#: command-list.h
msgid "Prune all unreachable objects from the object database"
-msgstr ""
+msgstr "Pangkas semua objek tak tercapai dari basis data objek"
#: command-list.h
msgid "Remove extra objects that are already in pack files"
-msgstr ""
+msgstr "Hapus semua objek ekstra yang sudah ada di dalam berkas pak"
#: command-list.h
msgid "Fetch from and integrate with another repository or a local branch"
-msgstr ""
+msgstr "Ambil dan integrasikan dengan repositori lain atau sebuah cabang lokal"
#: command-list.h
msgid "Update remote refs along with associated objects"
-msgstr ""
+msgstr "Perbarui referensi remote bersama dengan objek yang terkait"
#: command-list.h
msgid "Applies a quilt patchset onto the current branch"
-msgstr ""
+msgstr "Terapkan set tambalan quilt pada cabang saat ini"
#: command-list.h
msgid "Compare two commit ranges (e.g. two versions of a branch)"
-msgstr ""
+msgstr "Bandingkan dua rentang komit (misalnya dua versi cabang)"
#: command-list.h
msgid "Reads tree information into the index"
-msgstr ""
+msgstr "Baca informasi pohon ke dalam indeks"
#: command-list.h
msgid "Reapply commits on top of another base tip"
-msgstr ""
+msgstr "Terapkan ulang komit-komit di atas dasar ujung yang lainnya"
#: command-list.h
msgid "Receive what is pushed into the repository"
-msgstr ""
+msgstr "Terima apa yang didorong pada repositori"
#: command-list.h
msgid "Manage reflog information"
-msgstr ""
+msgstr "Kelola informasi log referensi"
#: command-list.h
msgid "Manage set of tracked repositories"
-msgstr ""
+msgstr "Kelola set repositori terlacak"
#: command-list.h
msgid "Pack unpacked objects in a repository"
-msgstr ""
+msgstr "Pak objek tak terpak di dalam repositori"
#: command-list.h
msgid "Create, list, delete refs to replace objects"
+msgstr "Buat, daftar, hapus referensi untuk mengganti objek"
+
+#: command-list.h
+msgid "EXPERIMENTAL: Replay commits on a new base, works with bare repos too"
msgstr ""
+"EKSPERIMENTAL: Mainkan ulang komit pada dasar baru, dan juga bekerja pada "
+"repositori bare"
#: command-list.h
msgid "Generates a summary of pending changes"
-msgstr ""
+msgstr "Buat ringkasan perubahan tertunda"
#: command-list.h
msgid "Reuse recorded resolution of conflicted merges"
-msgstr ""
+msgstr "Gunakan ulang resolusi konflik penggabungan terekam"
#: command-list.h
msgid "Reset current HEAD to the specified state"
-msgstr ""
+msgstr "Setel ulang HEAD saat ini ke keadaan yang disebutkan"
#: command-list.h
msgid "Restore working tree files"
-msgstr ""
+msgstr "Pulihkan berkas pohon kerja"
#: command-list.h
msgid "Lists commit objects in reverse chronological order"
-msgstr ""
+msgstr "Daftar objek komit dalam urutan kronologis terbalik"
#: command-list.h
msgid "Pick out and massage parameters"
-msgstr ""
+msgstr "Ambil dan pijat parameter"
#: command-list.h
msgid "Revert some existing commits"
-msgstr ""
+msgstr "Balikkan beberapa komit yang sudah ada"
#: command-list.h
msgid "Remove files from the working tree and from the index"
-msgstr ""
+msgstr "Hapus berkas dari pohon kerja dan indeks"
#: command-list.h
msgid "Send a collection of patches as emails"
-msgstr ""
+msgstr "Kirim koleksi tambalan sebagai surel"
#: command-list.h
msgid "Push objects over Git protocol to another repository"
-msgstr ""
+msgstr "Dorong objek lewat protokol Git ke repositori lainnya"
#: command-list.h
msgid "Git's i18n setup code for shell scripts"
-msgstr ""
+msgstr "kode penyusunan i18n Git untuk skrip cangkang"
#: command-list.h
msgid "Common Git shell script setup code"
-msgstr ""
+msgstr "kode penyusunan skrip cangkang umum Git"
#: command-list.h
msgid "Restricted login shell for Git-only SSH access"
-msgstr ""
+msgstr "Cangkang masuk terbatas untuk akses SSH hanya Git"
#: command-list.h
msgid "Summarize 'git log' output"
-msgstr ""
+msgstr "Rangkum keluaran 'git log'"
#: command-list.h
msgid "Show various types of objects"
-msgstr ""
+msgstr "Perlihatkan berbagai tipe objek"
#: command-list.h
msgid "Show branches and their commits"
-msgstr ""
+msgstr "Perlihatkan cabang dan komitnya"
#: command-list.h
msgid "Show packed archive index"
-msgstr ""
+msgstr "Perlihatkan indeks arsip terpak"
#: command-list.h
msgid "List references in a local repository"
-msgstr ""
+msgstr "Daftar referensi di repositori lokal"
#: command-list.h
msgid "Reduce your working tree to a subset of tracked files"
-msgstr ""
+msgstr "Kurangi pohon kerja Anda sampai subset berkas terlacak"
#: command-list.h
msgid "Add file contents to the staging area"
-msgstr ""
+msgstr "Tambahkan isi berkas ke area penggelaran"
#: command-list.h
msgid "Stash the changes in a dirty working directory away"
-msgstr ""
+msgstr "Stase perubahan di dalam direktori kerja"
#: command-list.h
msgid "Show the working tree status"
-msgstr ""
+msgstr "Perlihatkan status pohon kerja"
#: command-list.h
msgid "Remove unnecessary whitespace"
-msgstr ""
+msgstr "Hapus spasi yang tidak diperlukan"
#: command-list.h
msgid "Initialize, update or inspect submodules"
-msgstr ""
+msgstr "Inisialisasi, perbarui atau inspeksi submodul"
#: command-list.h
msgid "Bidirectional operation between a Subversion repository and Git"
-msgstr ""
+msgstr "Operasi dua arah antara repositori Subversion dan Git"
#: command-list.h
msgid "Switch branches"
-msgstr ""
+msgstr "Ganti cabang"
#: command-list.h
msgid "Read, modify and delete symbolic refs"
-msgstr ""
+msgstr "Baca, ubah dan hapus referensi simbolik"
#: command-list.h
msgid "Create, list, delete or verify a tag object signed with GPG"
msgstr ""
+"Buat, daftar, hapus atau verifikasi objek tag yang ditandatangani dengan GPG"
#: command-list.h
msgid "Creates a temporary file with a blob's contents"
-msgstr ""
+msgstr "Buat berkas sementara dengan isi blob"
#: command-list.h
msgid "Unpack objects from a packed archive"
-msgstr ""
+msgstr "Bongkar objek dari arsip terpak"
#: command-list.h
msgid "Register file contents in the working tree to the index"
-msgstr ""
+msgstr "Daftarkan isi berkas dalam pohon kerja ke indeks"
#: command-list.h
msgid "Update the object name stored in a ref safely"
-msgstr ""
+msgstr "Perbarui nama objek yang disimpan di dalam referensi secara aman"
#: command-list.h
msgid "Update auxiliary info file to help dumb servers"
-msgstr ""
+msgstr "Perbarui berkas info tambahan untuk membantu peladen bodoh"
#: command-list.h
msgid "Send archive back to git-archive"
-msgstr ""
+msgstr "Kirim arsip kembali ke git-archive"
#: command-list.h
msgid "Send objects packed back to git-fetch-pack"
-msgstr ""
+msgstr "Kirim objek terpak kembali ke git-fetch-pack"
#: command-list.h
msgid "Show a Git logical variable"
-msgstr ""
+msgstr "Perlihatkan variabel logikal Git"
#: command-list.h
msgid "Check the GPG signature of commits"
-msgstr ""
+msgstr "Periksa tandatangan GPG komit"
#: command-list.h
msgid "Validate packed Git archive files"
-msgstr ""
+msgstr "Validasi berkas arsip Git terpak"
#: command-list.h
msgid "Check the GPG signature of tags"
-msgstr ""
+msgstr "Periksa tandatangan GPG tag"
#: command-list.h
-msgid "Show logs with difference each commit introduces"
-msgstr ""
+msgid "Display version information about Git"
+msgstr "Perlihatkan info versi Git"
+
+#: command-list.h
+msgid "Show logs with differences each commit introduces"
+msgstr "Perlihatkan log dengan perbedaan yang diperkenalkan pada setiap komit"
#: command-list.h
msgid "Manage multiple working trees"
-msgstr ""
+msgstr "Kelola banyak pohon kerja"
#: command-list.h
msgid "Create a tree object from the current index"
-msgstr ""
+msgstr "Buat objek pohon dari indeks saat ini"
#: command-list.h
msgid "Defining attributes per path"
-msgstr ""
+msgstr "Tentukan atribut tiap jalur"
#: command-list.h
msgid "Git command-line interface and conventions"
-msgstr ""
+msgstr "Antarmuka baris perintah dan konvensi Git"
#: command-list.h
msgid "A Git core tutorial for developers"
-msgstr ""
+msgstr "Tutorial Git dasar untuk pengembang"
#: command-list.h
msgid "Providing usernames and passwords to Git"
-msgstr ""
+msgstr "Sediakan nama pengguna dan kata sandi ke Git"
#: command-list.h
msgid "Git for CVS users"
-msgstr ""
+msgstr "Git untuk pengguna CVS"
#: command-list.h
msgid "Tweaking diff output"
-msgstr ""
+msgstr "Ubah keluaran diff"
#: command-list.h
msgid "A useful minimum set of commands for Everyday Git"
-msgstr ""
+msgstr "Set perintah berguna minimal untuk Git setiap hari"
#: command-list.h
msgid "Frequently asked questions about using Git"
-msgstr ""
+msgstr "Pertanyaan yang sering diajukan tentang penggunaan Git"
+
+#: command-list.h
+msgid "The bundle file format"
+msgstr "Format berkas bundel"
+
+#: command-list.h
+msgid "Chunk-based file formats"
+msgstr "Berkas format berbasis bingkah"
+
+#: command-list.h
+msgid "Git commit-graph format"
+msgstr "Format grafik komit Git"
+
+#: command-list.h
+msgid "Git index format"
+msgstr "Format indeks Git"
+
+#: command-list.h
+msgid "Git pack format"
+msgstr "Format pak Git"
+
+#: command-list.h
+msgid "Git cryptographic signature formats"
+msgstr "Format tandatangan kriptografik Git"
#: command-list.h
msgid "A Git Glossary"
-msgstr ""
+msgstr "Glosarium Git"
#: command-list.h
msgid "Hooks used by Git"
-msgstr ""
+msgstr "Kait yang digunakan oleh Git"
#: command-list.h
msgid "Specifies intentionally untracked files to ignore"
-msgstr ""
+msgstr "Sengaja menyebutkan berkas tak terlacak untuk diabaikan"
#: command-list.h
msgid "The Git repository browser"
-msgstr ""
+msgstr "Penjelajah repositori Git"
#: command-list.h
msgid "Map author/committer names and/or E-Mail addresses"
-msgstr ""
+msgstr "Petakan nama pengarang/pengkomit dan/atau alamat surel"
#: command-list.h
msgid "Defining submodule properties"
-msgstr ""
+msgstr "Menentukan properti submodul"
#: command-list.h
msgid "Git namespaces"
-msgstr ""
+msgstr "Nama lingkup Git"
+
+#: command-list.h
+msgid "Protocol v0 and v1 capabilities"
+msgstr "Kemampuan protokol v0 dan v1"
+
+#: command-list.h
+msgid "Things common to various protocols"
+msgstr "Hal-hal yang umum pada berbagai protokol"
+
+#: command-list.h
+msgid "Git HTTP-based protocols"
+msgstr "Protokol Git berbasis HTTP"
+
+#: command-list.h
+msgid "How packs are transferred over-the-wire"
+msgstr "Bagaimana pak ditransfer lewat kabel"
+
+#: command-list.h
+msgid "Git Wire Protocol, Version 2"
+msgstr "Protokol kabel Git, versi 2"
#: command-list.h
msgid "Helper programs to interact with remote repositories"
-msgstr ""
+msgstr "Program pembantu untuk berinteraksi dengan repositori remote"
#: command-list.h
msgid "Git Repository Layout"
-msgstr ""
+msgstr "Tata letak repositori Git"
#: command-list.h
msgid "Specifying revisions and ranges for Git"
-msgstr ""
+msgstr "Menyebutkan revisi dan rentang untuk Git"
#: command-list.h
msgid "Mounting one repository inside another"
-msgstr ""
+msgstr "Menaiki satu repositori di dalam lainnya"
#: command-list.h
msgid "A tutorial introduction to Git"
-msgstr ""
+msgstr "Tutorial perkenalan Git"
#: command-list.h
msgid "A tutorial introduction to Git: part two"
-msgstr ""
+msgstr "Tutorial perkenalan Git: bagian dua"
#: command-list.h
msgid "Git web interface (web frontend to Git repositories)"
-msgstr ""
+msgstr "Antarmuka web Git (tampilan depan web untuk repositori Git)"
#: command-list.h
msgid "An overview of recommended workflows with Git"
-msgstr ""
+msgstr "Selayang pandang alur kerja yang direkomendasikan dengan Git"
+
+#: command-list.h
+msgid "A tool for managing large Git repositories"
+msgstr "Alat untuk mengelola repositori Git besar"
#: commit-graph.c
msgid "commit-graph file is too small"
+msgstr "berkas grafik komit terlalu kecil"
+
+#: commit-graph.c
+msgid "commit-graph oid fanout chunk is wrong size"
+msgstr "bingkah oid grafik komit kipas keluar salah ukuran"
+
+#: commit-graph.c
+msgid "commit-graph fanout values out of order"
+msgstr "nilai kipas keluar grafik komit tidak berurutan"
+
+#: commit-graph.c
+msgid "commit-graph OID lookup chunk is the wrong size"
+msgstr "bingkah OID pencarian grafik komit salah ukuran"
+
+#: commit-graph.c
+msgid "commit-graph commit data chunk is wrong size"
+msgstr "bingkah data grafik komit salah ukuran"
+
+#: commit-graph.c
+msgid "commit-graph generations chunk is wrong size"
+msgstr "bingkah generasi grafik komit salah ukuran"
+
+#: commit-graph.c
+msgid "commit-graph changed-path index chunk is too small"
+msgstr "bingkah indeks grafik komit jalur berubah terlalu kecil"
+
+#: commit-graph.c
+#, c-format
+msgid ""
+"ignoring too-small changed-path chunk (%<PRIuMAX> < %<PRIuMAX>) in commit-"
+"graph file"
msgstr ""
+"mengabaikan bingkah jalur berubah yang terlalu kecil (%<PRIuMAX> < "
+"%<PRIuMAX>) di dalam berkas grafik komit"
#: commit-graph.c
#, c-format
msgid "commit-graph signature %X does not match signature %X"
-msgstr ""
+msgstr "tanda tangan grafik komit %X tidak cocok dengan tanda tangan %X"
#: commit-graph.c
#, c-format
msgid "commit-graph version %X does not match version %X"
-msgstr ""
+msgstr "versi grafik komit %X tidak cocok dengan versi %X"
#: commit-graph.c
#, c-format
msgid "commit-graph hash version %X does not match version %X"
-msgstr ""
+msgstr "versi hash grafik komit %X tidak cocok dengan versi %X"
#: commit-graph.c
#, c-format
msgid "commit-graph file is too small to hold %u chunks"
+msgstr "berkas grafik komit terlalu kecil untuk menyimpan %u bingkah"
+
+#: commit-graph.c
+msgid "commit-graph required OID fanout chunk missing or corrupted"
msgstr ""
+"bingkah grafik komit OID kipas keluar yang diperlukan hilang atau rusak"
+
+#: commit-graph.c
+msgid "commit-graph required OID lookup chunk missing or corrupted"
+msgstr "bingkah grafik komit OID pencarian yang diperlukan hilang atau rusak"
+
+#: commit-graph.c
+msgid "commit-graph required commit data chunk missing or corrupted"
+msgstr "bingkah grafik komit data komit yang diperlukan hilang atau rusak"
#: commit-graph.c
msgid "commit-graph has no base graphs chunk"
-msgstr ""
+msgstr "grafik komit tidak punya bingkah grafik dasar"
+
+#: commit-graph.c
+msgid "commit-graph base graphs chunk is too small"
+msgstr "bingkah grafik komit dasar terlalu kecil"
#: commit-graph.c
msgid "commit-graph chain does not match"
-msgstr ""
+msgstr "rantai grafik komit tidak cocok"
+
+#: commit-graph.c
+#, c-format
+msgid "commit count in base graph too high: %<PRIuMAX>"
+msgstr "jumlah komit pada grafik dasar terlalu tinggi: %<PRIuMAX>"
+
+#: commit-graph.c
+msgid "commit-graph chain file too small"
+msgstr "berkas rantai grafik komit terlalu kecil"
#: commit-graph.c
#, c-format
msgid "invalid commit-graph chain: line '%s' not a hash"
-msgstr ""
+msgstr "rantai grafik komit tidak cocok: baris '%s' bukan sebuah hash"
#: commit-graph.c
msgid "unable to find all commit-graph files"
-msgstr ""
+msgstr "tidak dapat menemukan semua berkas grafik komit"
#: commit-graph.c
msgid "invalid commit position. commit-graph is likely corrupt"
-msgstr ""
+msgstr "posisi komit tidak valid. grafik komit mungkin rusak"
#: commit-graph.c
#, c-format
msgid "could not find commit %s"
-msgstr ""
+msgstr "tidak dapat menemukan komit %s"
#: commit-graph.c
msgid "commit-graph requires overflow generation data but has none"
-msgstr ""
+msgstr "grafik komit memerlukan pembuatan data meluap tapi tidak punya"
+
+#: commit-graph.c
+msgid "commit-graph overflow generation data is too small"
+msgstr "data generasi luapan grafik komit terlalu kecil"
+
+#: commit-graph.c
+msgid "commit-graph extra-edges pointer out of bounds"
+msgstr "penunjuk tepi tambahan grafik komit di luar batas"
#: commit-graph.c
msgid "Loading known commits in commit graph"
-msgstr ""
+msgstr "Memuat komit yang dikenal di grafik komit"
#: commit-graph.c
msgid "Expanding reachable commits in commit graph"
-msgstr ""
+msgstr "Memperluas komit yang dapat dijangkau di grafik komit"
#: commit-graph.c
msgid "Clearing commit marks in commit graph"
-msgstr ""
+msgstr "Membersihkan penanda komit di grafik komit"
#: commit-graph.c
msgid "Computing commit graph topological levels"
-msgstr ""
+msgstr "Menghitung tingat topologis grafik komit"
#: commit-graph.c
msgid "Computing commit graph generation numbers"
-msgstr ""
+msgstr "Menghitung jumlah pembuatan grafik komit"
#: commit-graph.c
msgid "Computing commit changed paths Bloom filters"
-msgstr ""
+msgstr "Menghitung komit yang berubah jalurnya oleh penyaring Bloom"
#: commit-graph.c
msgid "Collecting referenced commits"
-msgstr ""
+msgstr "Mengumpulkan komit tereferensi"
#: commit-graph.c
#, c-format
msgid "Finding commits for commit graph in %<PRIuMAX> pack"
msgid_plural "Finding commits for commit graph in %<PRIuMAX> packs"
-msgstr[0] ""
-msgstr[1] ""
+msgstr[0] "Mencari komit untuk grafik komit di dalam pak %<PRIuMAX>"
+msgstr[1] "Mencari komit untuk grafik komit di dalam pak %<PRIuMAX>"
#: commit-graph.c
#, c-format
msgid "error adding pack %s"
-msgstr ""
+msgstr "kesalahan menambahkan pak %s"
#: commit-graph.c
#, c-format
msgid "error opening index for %s"
-msgstr ""
+msgstr "kesalahan membuka indeks untuk %s"
#: commit-graph.c
msgid "Finding commits for commit graph among packed objects"
-msgstr ""
+msgstr "Mencari komit untuk grafik komit di antara objek terpak"
#: commit-graph.c
msgid "Finding extra edges in commit graph"
-msgstr ""
+msgstr "Mencari tepi ekstra di dalam grafik komit"
#: commit-graph.c
msgid "failed to write correct number of base graph ids"
-msgstr ""
+msgstr "gagal menulis jumlah id grafik dasar yang benar"
#: commit-graph.c
msgid "unable to create temporary graph layer"
-msgstr ""
+msgstr "tidak dapat membuat lapisan grafik dasar"
#: commit-graph.c
#, c-format
msgid "unable to adjust shared permissions for '%s'"
-msgstr ""
+msgstr "tidak dapat menyesuaikan perizinan berbagi untuk '%s'"
#: commit-graph.c
#, c-format
msgid "Writing out commit graph in %d pass"
msgid_plural "Writing out commit graph in %d passes"
-msgstr[0] ""
-msgstr[1] ""
+msgstr[0] "Menulis grafik komit dalam %d fase"
+msgstr[1] "Menulis grafik komit dalam %d fase"
#: commit-graph.c
msgid "unable to open commit-graph chain file"
-msgstr ""
+msgstr "tidak dapat membuka berkas rantai grafik komit"
#: commit-graph.c
msgid "failed to rename base commit-graph file"
-msgstr ""
+msgstr "gagal menamai ulang berkas grafik komit dasar"
#: commit-graph.c
msgid "failed to rename temporary commit-graph file"
-msgstr ""
+msgstr "gagal menamai ulang berkas grafik komit sementara"
+
+#: commit-graph.c
+#, c-format
+msgid "cannot merge graphs with %<PRIuMAX>, %<PRIuMAX> commits"
+msgstr "tidak dapat menggabungkan grafik dengan %<PRIuMAX>, %<PRIuMAX> komit"
+
+#: commit-graph.c
+#, c-format
+msgid "cannot merge graph %s, too many commits: %<PRIuMAX>"
+msgstr "tidak dapat menggabungkan grafik %s, terlalu banyak komit: %<PRIuMAX>"
#: commit-graph.c
msgid "Scanning merged commits"
-msgstr ""
+msgstr "Memindai komit tergabung"
#: commit-graph.c
msgid "Merging commit-graph"
-msgstr ""
+msgstr "Menggabungkan grafik komit"
#: commit-graph.c
msgid "attempting to write a commit-graph, but 'core.commitGraph' is disabled"
-msgstr ""
+msgstr "mencoba menulis grafik komit, tapi 'core.commitGraph' dimatikan"
#: commit-graph.c
msgid "too many commits to write graph"
-msgstr ""
+msgstr "terlalu banyak komit untuk menulis grafik"
#: commit-graph.c
msgid "the commit-graph file has incorrect checksum and is likely corrupt"
-msgstr ""
+msgstr "berkas grafik komit punya checksum salah dan mungkin rusak"
#: commit-graph.c
#, c-format
msgid "commit-graph has incorrect OID order: %s then %s"
-msgstr ""
+msgstr "grafik komit punya urutan OID salah: %s lalu %s"
#: commit-graph.c
#, c-format
msgid "commit-graph has incorrect fanout value: fanout[%d] = %u != %u"
-msgstr ""
+msgstr "grafik komit punya nilai kipas keluar salah: fanout[%d] = %u != %u"
#: commit-graph.c
#, c-format
msgid "failed to parse commit %s from commit-graph"
-msgstr ""
-
-#: commit-graph.c
-msgid "Verifying commits in commit graph"
-msgstr ""
+msgstr "gagal menguraikan komit %s dari grafik komit"
#: commit-graph.c
#, c-format
msgid "failed to parse commit %s from object database for commit-graph"
-msgstr ""
+msgstr "gagal menguraikan komit %s dari basis data objek untuk grafik komit"
#: commit-graph.c
#, c-format
msgid "root tree OID for commit %s in commit-graph is %s != %s"
-msgstr ""
+msgstr "OID pohon akar untuk komit %s di dalam grafik komit yaitu %s != %s"
#: commit-graph.c
#, c-format
msgid "commit-graph parent list for commit %s is too long"
-msgstr ""
+msgstr "daftar induk grafik komit untuk %s terlalu panjang"
#: commit-graph.c
#, c-format
msgid "commit-graph parent for %s is %s != %s"
-msgstr ""
+msgstr "induk grafik komit untuk %s adalah %s != %s"
#: commit-graph.c
#, c-format
msgid "commit-graph parent list for commit %s terminates early"
-msgstr ""
+msgstr "daftar induk grafik komit untuk komit %s berakhir lebih awal"
#: commit-graph.c
#, c-format
-msgid ""
-"commit-graph has generation number zero for commit %s, but non-zero elsewhere"
-msgstr ""
+msgid "commit-graph generation for commit %s is %<PRIuMAX> < %<PRIuMAX>"
+msgstr "pembuatan grafik komit untuk komit %s yaitu %<PRIuMAX> < %<PRIuMAX>"
#: commit-graph.c
#, c-format
-msgid ""
-"commit-graph has non-zero generation number for commit %s, but zero elsewhere"
+msgid "commit date for commit %s in commit-graph is %<PRIuMAX> != %<PRIuMAX>"
msgstr ""
+"tanggal komit untuk komit %s di dalam grafik komit yaitu %<PRIuMAX> != "
+"%<PRIuMAX>"
#: commit-graph.c
#, c-format
-msgid "commit-graph generation for commit %s is %<PRIuMAX> < %<PRIuMAX>"
+msgid ""
+"commit-graph has both zero and non-zero generations (e.g., commits '%s' and "
+"'%s')"
msgstr ""
+"grafik komit punya baik generasi nol dan bukan nol (seperti komit '%s' dan "
+"'%s')"
#: commit-graph.c
-#, c-format
-msgid "commit date for commit %s in commit-graph is %<PRIuMAX> != %<PRIuMAX>"
-msgstr ""
+msgid "Verifying commits in commit graph"
+msgstr "Memverifikasi komit di dalam grafik komit"
#: commit.c
#, c-format
msgid "%s %s is not a commit!"
-msgstr ""
+msgstr "%s %s bukan sebuah komit!"
#: commit.c
msgid ""
@@ -17449,26 +18444,40 @@ msgid ""
"Turn this message off by running\n"
"\"git config advice.graftFileDeprecated false\""
msgstr ""
+"Dukungan untuk <GIT_DIR>/info/grafts usang dan akan dihapus\n"
+"pada versi Git di masa yang akan datang.\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\""
+
+#: commit.c
+#, c-format
+msgid "commit %s exists in commit-graph but not in the object database"
+msgstr ""
+"komit %s ada pada grafik komit tapi tidak ada di dalam basis data objek"
#: commit.c
#, c-format
msgid "Commit %s has an untrusted GPG signature, allegedly by %s."
-msgstr ""
+msgstr "Komit %s punya tandatangan GPG tak dipercaya, dituduh sebagai %s."
#: commit.c
#, c-format
msgid "Commit %s has a bad GPG signature allegedly by %s."
-msgstr ""
+msgstr "Komit %s punya tandatangan GPG tak jelek, dituduh sebagai %s."
#: commit.c
#, c-format
msgid "Commit %s does not have a GPG signature."
-msgstr ""
+msgstr "Komit %s tidak punya tandatangan GPG."
#: commit.c
#, c-format
msgid "Commit %s has a good GPG signature by %s\n"
-msgstr ""
+msgstr "Komit %s punya tandatangan GPG bagus oleh %s\n"
#: commit.c
msgid ""
@@ -17476,214 +18485,264 @@ msgid ""
"You may want to amend it after fixing the message, or set the config\n"
"variable i18n.commitEncoding to the encoding your project uses.\n"
msgstr ""
+"Peringatan: pesan komit tidak sesuai dengan UTF-8.\n"
+"Anda dapat mengubahnya setelah memperbaiki pesan, atau menyetel variabel\n"
+"konfigurasi i18n.commitEncoding ke pengkodean yang proyek Anda gunakan.\n"
#: compat/compiler.h
msgid "no compiler information available\n"
-msgstr ""
+msgstr "informasi pengompilasi tidak tersedia\n"
#: compat/compiler.h
msgid "no libc information available\n"
-msgstr ""
+msgstr "informasi libc tidak tersedia\n"
+
+#: compat/disk.h
+#, c-format
+msgid "could not determine free disk size for '%s'"
+msgstr "tidak dapat menentukan ukuran disk kosong untuk '%s'"
+
+#: compat/disk.h
+#, c-format
+msgid "could not get info for '%s'"
+msgstr "tidak dapat mendapatkan informasi untuk '%s'"
#: compat/fsmonitor/fsm-health-win32.c
#, c-format
msgid "[GLE %ld] health thread could not open '%ls'"
-msgstr ""
+msgstr "[GLE %ld] utas kesehatan tidak dapat membuka '%ls'"
#: compat/fsmonitor/fsm-health-win32.c
#, c-format
msgid "[GLE %ld] health thread getting BHFI for '%ls'"
-msgstr ""
+msgstr "[GLE %ld] utas kesehatan mendapatkan BHFI untuk '%ls'"
#: compat/fsmonitor/fsm-health-win32.c compat/fsmonitor/fsm-listen-win32.c
#, c-format
msgid "could not convert to wide characters: '%s'"
-msgstr ""
+msgstr "tidak dapat mengkonversi ke karakter lebar: '%s'"
#: compat/fsmonitor/fsm-health-win32.c
#, c-format
msgid "BHFI changed '%ls'"
-msgstr ""
+msgstr "BHFI mengubah '%ls'"
#: compat/fsmonitor/fsm-health-win32.c
#, c-format
msgid "unhandled case in 'has_worktree_moved': %d"
-msgstr ""
+msgstr "kasus tak tertangani di 'has_worktree_moved': %d"
#: compat/fsmonitor/fsm-health-win32.c
#, c-format
msgid "health thread wait failed [GLE %ld]"
-msgstr ""
+msgstr "antri utas kesehatan gagal [GLE %ld]"
+
+#: compat/fsmonitor/fsm-ipc-darwin.c
+#, c-format
+msgid "Invalid path: %s"
+msgstr "Jalur tidak valid: %s"
#: compat/fsmonitor/fsm-listen-darwin.c
msgid "Unable to create FSEventStream."
-msgstr ""
+msgstr "tidak dapat membuat FSEventStream."
#: compat/fsmonitor/fsm-listen-darwin.c
msgid "Failed to start the FSEventStream"
-msgstr ""
+msgstr "Gagal memulai FSEventStream"
#: compat/fsmonitor/fsm-listen-win32.c
#, c-format
msgid "[GLE %ld] could not convert path to UTF-8: '%.*ls'"
-msgstr ""
+msgstr "[GLE %ld] tidak dapat mengkonversi jalur ke UTF-8: '%.*ls'"
#: compat/fsmonitor/fsm-listen-win32.c
#, c-format
msgid "[GLE %ld] could not watch '%s'"
-msgstr ""
+msgstr "[GLE %ld] tidak dapat menonton '%s'"
#: compat/fsmonitor/fsm-listen-win32.c
#, c-format
msgid "[GLE %ld] could not get longname of '%s'"
-msgstr ""
+msgstr "[GLE %ld] tidak dapat mendapatkan nama panjang dari '%s'"
#: compat/fsmonitor/fsm-listen-win32.c
#, c-format
msgid "ReadDirectoryChangedW failed on '%s' [GLE %ld]"
-msgstr ""
+msgstr "ReadDirectoryChangedW gagal pada '%s' [GLE %ld]"
#: compat/fsmonitor/fsm-listen-win32.c
#, c-format
msgid "GetOverlappedResult failed on '%s' [GLE %ld]"
-msgstr ""
+msgstr "GetOverlappedResult gagal pada '%s' [GLE %ld]"
#: compat/fsmonitor/fsm-listen-win32.c
#, c-format
msgid "could not read directory changes [GLE %ld]"
-msgstr ""
+msgstr "tidak dapat membaca perubahan direktori [GLE %ld]"
+
+#: compat/fsmonitor/fsm-path-utils-darwin.c
+#, c-format
+msgid "opendir('%s') failed"
+msgstr "opendir('%s') gagal"
+
+#: compat/fsmonitor/fsm-path-utils-darwin.c
+#, c-format
+msgid "lstat('%s') failed"
+msgstr "lstat('%s') gagal"
+
+#: compat/fsmonitor/fsm-path-utils-darwin.c
+#, c-format
+msgid "strbuf_readlink('%s') failed"
+msgstr "strbuf_readlink('%s') gagal"
+
+#: compat/fsmonitor/fsm-path-utils-darwin.c
+#, c-format
+msgid "closedir('%s') failed"
+msgstr "closedir('%s') gagal"
+
+#: compat/fsmonitor/fsm-path-utils-win32.c
+#, c-format
+msgid "[GLE %ld] unable to open for read '%ls'"
+msgstr "[GLE %ld] tidak dapat membuka untuk dibaca '%ls'"
+
+#: compat/fsmonitor/fsm-path-utils-win32.c
+#, c-format
+msgid "[GLE %ld] unable to get protocol information for '%ls'"
+msgstr "[GLE %ld] tidak dapat mendapatkan informasi protokol untuk '%ls'"
#: compat/mingw.c
#, c-format
msgid "failed to copy SID (%ld)"
-msgstr ""
+msgstr "gagal menyalin SID (%ld)"
#: compat/mingw.c
#, c-format
msgid "failed to get owner for '%s' (%ld)"
-msgstr ""
+msgstr "gagal mendapatkan pemilik untuk '%s' (%ld)"
#: compat/obstack.c
msgid "memory exhausted"
-msgstr ""
+msgstr "memory habis"
#: compat/regex/regcomp.c
msgid "Success"
-msgstr ""
+msgstr "Success"
#: compat/regex/regcomp.c
msgid "No match"
-msgstr ""
+msgstr "Tidak ada yang cocok"
#: compat/regex/regcomp.c
msgid "Invalid regular expression"
-msgstr ""
+msgstr "Ekspresi reguler tidak valid"
#: compat/regex/regcomp.c
msgid "Invalid collation character"
-msgstr ""
+msgstr "Karakter kolase tidak valid"
#: compat/regex/regcomp.c
msgid "Invalid character class name"
-msgstr ""
+msgstr "Nama kelas karakter tidak valid"
#: compat/regex/regcomp.c
msgid "Trailing backslash"
-msgstr ""
+msgstr "Garis miring terbalik tertinggal"
#: compat/regex/regcomp.c
msgid "Invalid back reference"
-msgstr ""
+msgstr "Referensi balik tidak valid"
#: compat/regex/regcomp.c
msgid "Unmatched [ or [^"
-msgstr ""
+msgstr "[ atau [^ tak tercocok"
#: compat/regex/regcomp.c
msgid "Unmatched ( or \\("
-msgstr ""
+msgstr "( atau \\( tak tercocok"
#: compat/regex/regcomp.c
msgid "Unmatched \\{"
-msgstr ""
+msgstr "\\{ tak tercocok"
#: compat/regex/regcomp.c
msgid "Invalid content of \\{\\}"
-msgstr ""
+msgstr "Isi \\{\\} tidak valid"
#: compat/regex/regcomp.c
msgid "Invalid range end"
-msgstr ""
+msgstr "Ujung rentang tidak valid"
#: compat/regex/regcomp.c
msgid "Memory exhausted"
-msgstr ""
+msgstr "Memori habis"
#: compat/regex/regcomp.c
msgid "Invalid preceding regular expression"
-msgstr ""
+msgstr "Ekspresi reguler sebelumnya tidak valid"
#: compat/regex/regcomp.c
msgid "Premature end of regular expression"
-msgstr ""
+msgstr "Akhir ekspresi reguler prematur"
#: compat/regex/regcomp.c
msgid "Regular expression too big"
-msgstr ""
+msgstr "Ekspresi reguler terlalu besar"
#: compat/regex/regcomp.c
msgid "Unmatched ) or \\)"
-msgstr ""
+msgstr ") atau \\) tak tercocok"
#: compat/regex/regcomp.c
msgid "No previous regular expression"
-msgstr ""
+msgstr "Tidak ada ekspresi reguler sebelumnya"
#: compat/simple-ipc/ipc-unix-socket.c compat/simple-ipc/ipc-win32.c
msgid "could not send IPC command"
-msgstr ""
+msgstr "tidak dapat mengirimkan perintah IPC"
#: compat/simple-ipc/ipc-unix-socket.c compat/simple-ipc/ipc-win32.c
msgid "could not read IPC response"
-msgstr ""
+msgstr "tidak dapat membaca jawaban IPC"
#: compat/simple-ipc/ipc-unix-socket.c
#, c-format
msgid "could not start accept_thread '%s'"
-msgstr ""
+msgstr "tidak dapat memulai accept_thread '%s'"
#: compat/simple-ipc/ipc-unix-socket.c
#, c-format
msgid "could not start worker[0] for '%s'"
-msgstr ""
+msgstr "tidak dapat memulai worker[0] untuk '%s'"
#: compat/simple-ipc/ipc-win32.c
#, c-format
msgid "ConnectNamedPipe failed for '%s' (%lu)"
-msgstr ""
+msgstr "ConnectNamedPipe gagal untuk '%s' (%lu)"
#: compat/simple-ipc/ipc-win32.c
#, c-format
msgid "could not create fd from pipe for '%s'"
-msgstr ""
+msgstr "tidak dapat membuat penjelas berkas dari pipa untuk '%s'"
#: compat/simple-ipc/ipc-win32.c
#, c-format
msgid "could not start thread[0] for '%s'"
-msgstr ""
+msgstr "tidak dapat memulai thread[0] untuk '%s'"
#: compat/simple-ipc/ipc-win32.c
#, c-format
msgid "wait for hEvent failed for '%s'"
-msgstr ""
+msgstr "antri untuk hEvent gagal untuk '%s'"
#: compat/terminal.c
msgid "cannot resume in the background, please use 'fg' to resume"
msgstr ""
+"tidak dapat melanjutkan di belakang layar, mohon gunakan 'fg' untuk "
+"melanjutkan"
#: compat/terminal.c
msgid "cannot restore terminal settings"
-msgstr ""
+msgstr "tidak dapat mengembalikan setelan terminal"
#: config.c
#, c-format
@@ -17902,8 +18961,8 @@ msgid "bad zlib compression level %d"
msgstr "level kompresi zlib jelek %d"
#: config.c
-msgid "core.commentChar should only be one character"
-msgstr "core.commentChar harusnya hanya satu karakter"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar seharusnya hanya satu karakter ASCII"
#: config.c
#, c-format
@@ -17949,11 +19008,6 @@ msgid "unable to resolve config blob '%s'"
msgstr "tidak dapat menguraikan blob konfigurasi '%s'"
#: config.c
-#, c-format
-msgid "failed to parse %s"
-msgstr "gagal menguraikan %s"
-
-#: config.c
msgid "unable to parse command-line config"
msgstr "gagal menguraikan konfigurasi baris perintah"
@@ -18043,6 +19097,13 @@ msgstr "nama bagian tidak valid: %s"
#: config.c
#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr ""
+"menolak bekerja dengan baris yang terlalu panjang di '%s' pada baris "
+"%<PRIuMAX>"
+
+#: config.c
+#, c-format
msgid "missing value for '%s'"
msgstr "nilai hilang untuk '%s'"
@@ -18109,12 +19170,12 @@ msgstr "format objek tidak dikenal '%s' disebutkan oleh peladen"
#: connect.c
#, c-format
-msgid "invalid ls-refs response: %s"
-msgstr "jawaban ls-refs tidak valid: %s"
+msgid "error on bundle-uri response line %d: %s"
+msgstr "kesalahan pada baris tanggapan bundle-uri ke-%d: %s"
#: connect.c
-msgid "expected flush after ref listing"
-msgstr "bilasan diharapkan setelah penyebutan referensi"
+msgid "expected flush after bundle-uri listing"
+msgstr "bilasan diharapkan setelah pendaftaran bundle-uri"
#: connect.c
msgid "expected response end packet after ref listing"
@@ -18122,6 +19183,15 @@ msgstr "jawaban akhir paket diharapkan setelah penyebutan referensi"
#: connect.c
#, c-format
+msgid "invalid ls-refs response: %s"
+msgstr "jawaban ls-refs tidak valid: %s"
+
+#: connect.c
+msgid "expected flush after ref listing"
+msgstr "bilasan diharapkan setelah penyebutan referensi"
+
+#: connect.c
+#, c-format
msgid "protocol '%s' is not supported"
msgstr "protokol '%s' tidak didukung"
@@ -18231,233 +19301,15 @@ msgstr "gagal menulis ke rev-list"
msgid "failed to close rev-list's stdin"
msgstr "gagal menutup masukan standar rev-list"
-#: contrib/scalar/scalar.c worktree.c
-#, c-format
-msgid "'%s' does not exist"
-msgstr "'%s' tidak ada"
-
-#: contrib/scalar/scalar.c
-msgid "need a working directory"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "could not find enlistment root"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not switch to '%s'"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not configure %s=%s"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "could not configure log.excludeDecoration"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "Scalar enlistments require a worktree"
-msgstr ""
-
-#: contrib/scalar/scalar.c dir.c
-#, c-format
-msgid "could not open directory '%s'"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "skipping '%s', which is neither file nor directory"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not determine free disk size for '%s'"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not get info for '%s'"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "remote HEAD is not a branch: '%.*s'"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "failed to get default branch name from remote; using local default"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "failed to get default branch name"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "failed to unregister repository"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "failed to delete enlistment directory"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "branch to checkout after clone"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "when cloning, create full working directory"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "only download metadata for the branch that will be checked out"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "scalar clone [<options>] [--] <repo> [<dir>]"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "cannot deduce worktree name from '%s'"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "directory '%s' exists already"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "failed to get default branch for '%s'"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not configure remote in '%s'"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not configure '%s'"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "partial clone failed; attempting full clone"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "could not configure for full clone"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "scalar diagnose [<enlistment>]"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not create directory for '%s'"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "could not duplicate stdout"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "failed to write archive"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "`scalar list` does not take arguments"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "scalar register [<enlistment>]"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "reconfigure all registered enlistments"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "scalar reconfigure [--all | <enlistment>]"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "--all or <enlistment>, but not both"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "git repository gone in '%s'"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid ""
-"scalar run <task> [<enlistment>]\n"
-"Tasks:\n"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "no such task: '%s'"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "scalar unregister [<enlistment>]"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "scalar delete <enlistment>"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "refusing to delete current working directory"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "include Git version"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "include Git's build options"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "scalar verbose [-v | --verbose] [--build-options]"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "-C requires a <directory>"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not change to '%s'"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid "-c requires a <key>=<value> argument"
-msgstr ""
-
-#: contrib/scalar/scalar.c
-msgid ""
-"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
-"\n"
-"Commands:\n"
-msgstr ""
-
#: convert.c
#, c-format
msgid "illegal crlf_action %d"
-msgstr ""
+msgstr "crlf_action %d ilegal"
#: convert.c
#, c-format
msgid "CRLF would be replaced by LF in %s"
-msgstr ""
+msgstr "CRLF akan digantikan oleh LF di %s"
#: convert.c
#, c-format
@@ -18465,11 +19317,13 @@ msgid ""
"in the working copy of '%s', CRLF will be replaced by LF the next time Git "
"touches it"
msgstr ""
+"di dalam salinan kerja '%s', CRLF akan digantikan oleh LF pada saat Git "
+"menyentuhnya lain kali"
#: convert.c
#, c-format
msgid "LF would be replaced by CRLF in %s"
-msgstr ""
+msgstr "LF akan digantikan oleh CRLF di %s"
#: convert.c
#, c-format
@@ -18477,11 +19331,13 @@ msgid ""
"in the working copy of '%s', LF will be replaced by CRLF the next time Git "
"touches it"
msgstr ""
+"di dalam salinan kerja '%s', LF akan digantikan oleh LF pada saat Git "
+"menyentuhnya lain kali"
#: convert.c
#, c-format
msgid "BOM is prohibited in '%s' if encoded as %s"
-msgstr ""
+msgstr "BOM tidak diperbolehkan di '%s' jika dikodekan sebagai %s"
#: convert.c
#, c-format
@@ -18489,11 +19345,13 @@ msgid ""
"The file '%s' contains a byte order mark (BOM). Please use UTF-%.*s as "
"working-tree-encoding."
msgstr ""
+"Berkas '%s' berisi tanda urutan bita (BOM). Mohon gunakan UTF-%.*s sebagai "
+"pengkodean pohon kerja."
#: convert.c
#, c-format
msgid "BOM is required in '%s' if encoded as %s"
-msgstr ""
+msgstr "BOM diperlukan di '%s' jika dikodekan sebagai %s"
#: convert.c
#, c-format
@@ -18501,49 +19359,51 @@ msgid ""
"The file '%s' is missing a byte order mark (BOM). Please use UTF-%sBE or UTF-"
"%sLE (depending on the byte order) as working-tree-encoding."
msgstr ""
+"Berkas '%s' kehilangan tanda urutan bita (BOM). Mohon gunakan UTF-%sBE atau "
+"UTF-%sLE (tergantung pada urutan bita) sebagai pengkodean pohon kerja."
#: convert.c
#, c-format
msgid "failed to encode '%s' from %s to %s"
-msgstr ""
+msgstr "gagal mengkodekan '%s' dari %s ke %s"
#: convert.c
#, c-format
msgid "encoding '%s' from %s to %s and back is not the same"
-msgstr ""
+msgstr "pengkodean '%s' dari %s ke %s dan sebaliknya berbeda"
#: convert.c
#, c-format
msgid "cannot fork to run external filter '%s'"
-msgstr ""
+msgstr "tidak dapat menggarpu untuk menjalankan penyaring eksternal '%s'"
#: convert.c
#, c-format
msgid "cannot feed the input to external filter '%s'"
-msgstr ""
+msgstr "tidak dapat mengumpan masukan ke penyaring eksternal '%s'"
#: convert.c
#, c-format
msgid "external filter '%s' failed %d"
-msgstr ""
+msgstr "penyaring eksternal '%s' gagal %d"
#: convert.c
#, c-format
msgid "read from external filter '%s' failed"
-msgstr ""
+msgstr "gagal membaca dari penyaring eksternal '%s'"
#: convert.c
#, c-format
msgid "external filter '%s' failed"
-msgstr ""
+msgstr "penyaring eksternal '%s' gagal"
#: convert.c
msgid "unexpected filter type"
-msgstr ""
+msgstr "tipe penyaring tidak diharapkan"
#: convert.c
msgid "path name too long for external filter"
-msgstr ""
+msgstr "nama jalur terlalu panjang untuk penyaring eksternal"
#: convert.c
#, c-format
@@ -18551,48 +19411,50 @@ msgid ""
"external filter '%s' is not available anymore although not all paths have "
"been filtered"
msgstr ""
+"penyaring eksternal '%s' tidak tersedia lagi walaupun tidak semua jalur "
+"sudah disaring"
#: convert.c
msgid "true/false are no valid working-tree-encodings"
-msgstr ""
+msgstr "true/false bukanlah pengkodean pohon kerja valid"
#: convert.c
#, c-format
msgid "%s: clean filter '%s' failed"
-msgstr ""
+msgstr "%s: penyaring bersih '%s' gagal"
#: convert.c
#, c-format
msgid "%s: smudge filter %s failed"
-msgstr ""
+msgstr "%s: penyaring noda %s gagal"
#: credential.c
#, c-format
msgid "skipping credential lookup for key: credential.%s"
-msgstr ""
+msgstr "melewati pencarian kredensial untuk kunci: credential.%s"
#: credential.c
msgid "refusing to work with credential missing host field"
-msgstr ""
+msgstr "menolak bekerja dengan kredensial yang kehilangan bidang host"
#: credential.c
msgid "refusing to work with credential missing protocol field"
-msgstr ""
+msgstr "menolak bekerja dengan kredensial yang kehilangan bidang protokol"
#: credential.c
#, c-format
msgid "url contains a newline in its %s component: %s"
-msgstr ""
+msgstr "url berisi baris baru pada komponen %s: %s"
#: credential.c
#, c-format
msgid "url has no scheme: %s"
-msgstr ""
+msgstr "url tidak punya skema: %s"
#: credential.c
#, c-format
msgid "credential url cannot be parsed: %s"
-msgstr ""
+msgstr "url kredensial tidak dapat diuraikan: %s"
#: date.c
msgid "in the future"
@@ -18664,57 +19526,97 @@ msgstr[1] "%<PRIuMAX> tahun yang lalu"
#: delta-islands.c
msgid "Propagating island marks"
-msgstr ""
+msgstr "Menyebarkan penanda pulau"
#: delta-islands.c
#, c-format
msgid "bad tree object %s"
-msgstr ""
+msgstr "objek pohon jelek %s"
#: delta-islands.c
#, c-format
msgid "failed to load island regex for '%s': %s"
-msgstr ""
+msgstr "gagal memuat regex pulau untuk '%s': %s"
#: delta-islands.c
#, c-format
msgid "island regex from config has too many capture groups (max=%d)"
msgstr ""
+"regeks pulau dari konfigurasi punya terlalu banyak grup tangkap (max=%d)"
#: delta-islands.c
#, c-format
msgid "Marked %d islands, done.\n"
-msgstr ""
+msgstr "%d pulau ditandai, selesai.\n"
-#: diff-lib.c
-msgid "--merge-base does not work with ranges"
-msgstr ""
+#: diagnose.c
+#, c-format
+msgid "invalid --%s value '%s'"
+msgstr "nilai --%s tidak valid '%s'"
+
+#: diagnose.c
+#, c-format
+msgid "could not archive missing directory '%s'"
+msgstr "tidak dapat mengarsipkan direktori hilang '%s'"
+
+#: diagnose.c dir.c
+#, c-format
+msgid "could not open directory '%s'"
+msgstr "tidak dapat membuka direktori '%s'"
+
+#: diagnose.c
+#, c-format
+msgid "skipping '%s', which is neither file nor directory"
+msgstr "melewatkan '%s', yang bukan berkas atau direktori"
+
+#: diagnose.c
+msgid "could not duplicate stdout"
+msgstr "tidak dapat menggandakan keluaran standar"
+
+#: diagnose.c
+#, c-format
+msgid "could not add directory '%s' to archiver"
+msgstr "tidak dapat menambahkan direktori '%s' ke pengarsip"
+
+#: diagnose.c
+msgid "failed to write archive"
+msgstr "gagal menulis arsip"
#: diff-lib.c
-msgid "--merge-base only works with commits"
-msgstr ""
+msgid "--merge-base does not work with ranges"
+msgstr "--merge-base tidak bekerja dengan rentang"
#: diff-lib.c
msgid "unable to get HEAD"
-msgstr ""
+msgstr "tidak dapat mendapatkan HEAD"
#: diff-lib.c
msgid "no merge base found"
-msgstr ""
+msgstr "dasar penggabungan tidak ditemukan"
#: diff-lib.c
msgid "multiple merge bases found"
-msgstr ""
+msgstr "banyak dasar penggabungan ditemukan"
+
+#: diff-no-index.c
+msgid "cannot compare stdin to a directory"
+msgstr "tidak dapat membandingkan masukan standar dan sebuah direktori"
+
+#: diff-no-index.c
+msgid "cannot compare a named pipe to a directory"
+msgstr "tidak dapat membandingkan pipa bernama dan sebuah direktori"
#: diff-no-index.c
msgid "git diff --no-index [<options>] <path> <path>"
-msgstr ""
+msgstr "git diff --no-index [<opsi>] <jalur> <jalur>"
#: diff-no-index.c
msgid ""
"Not a git repository. Use --no-index to compare two paths outside a working "
"tree"
msgstr ""
+"Bukan sebuah repositori git. Gunakan --no-index untuk membandingkan dua "
+"jalur di luar pohon kerja"
#: diff.c
#, c-format
@@ -18757,6 +19659,11 @@ msgstr ""
msgid "Unknown value for 'diff.submodule' config variable: '%s'"
msgstr "Nilai tidak dikenal untuk variabel konfigurasi 'diff.submodule': '%s'"
+#: diff.c transport.c
+#, c-format
+msgid "unknown value for config '%s': %s"
+msgstr "nilai tidak dikenal untuk konfigurasi '%s': %s"
+
#: diff.c
#, c-format
msgid ""
@@ -18771,6 +19678,15 @@ msgstr ""
msgid "external diff died, stopping at %s"
msgstr "diff eksternal mati, berhenti pada %s"
+#: diff.c
+msgid "--follow requires exactly one pathspec"
+msgstr "--follow butuh tepatnya satu spek jalur"
+
+#: diff.c
+#, c-format
+msgid "pathspec magic not supported by --follow: %s"
+msgstr "spek jalur ajaib tidak didukung oleh --follow: %s"
+
#: diff.c parse-options.c
#, c-format
msgid "options '%s', '%s', '%s', and '%s' cannot be used together"
@@ -18791,10 +19707,6 @@ msgstr ""
"dan '%s'"
#: diff.c
-msgid "--follow requires exactly one pathspec"
-msgstr "--follow butuh tepatnya satu spek jalur"
-
-#: diff.c
#, c-format
msgid "invalid --stat value: %s"
msgstr "nilai --stat tidak valid: %s"
@@ -18802,7 +19714,7 @@ msgstr "nilai --stat tidak valid: %s"
#: diff.c parse-options.c
#, c-format
msgid "%s expects a numerical value"
-msgstr "%s harap nilai numerik"
+msgstr "%s berharap nilai numerik"
#: diff.c
#, c-format
@@ -18849,14 +19761,6 @@ msgid "invalid mode '%s' in --color-moved-ws"
msgstr "mode tidak valid '%s' dalam --color-moved-ws"
#: diff.c
-msgid ""
-"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
-"\"histogram\""
-msgstr ""
-"opsi diff-algorithm terima \"myers\", \"minimal\", \"patience\" dan "
-"\"histogram\""
-
-#: diff.c
#, c-format
msgid "invalid argument to %s"
msgstr "argumen tidak valid ke %s"
@@ -18913,8 +19817,8 @@ msgid "output only the last line of --stat"
msgstr "keluarkan hanya baris terakhir --stat"
#: diff.c
-msgid "<param1,param2>..."
-msgstr "<parameter 1,parameter 2>..."
+msgid "<param1>,<param2>..."
+msgstr "<parameter 1>,<parameter 2>..."
#: diff.c
msgid ""
@@ -18927,8 +19831,8 @@ msgid "synonym for --dirstat=cumulative"
msgstr "sinonim untuk --dirstat=cumulative"
#: diff.c
-msgid "synonym for --dirstat=files,param1,param2..."
-msgstr "sinonim untuk --dirstat=files,param1,param2..."
+msgid "synonym for --dirstat=files,<param1>,<param2>..."
+msgstr "sinonim untuk --dirstat=files,<parameter 1>,<parameter 2>..."
#: diff.c
msgid "warn if changes introduce conflict markers or whitespace errors"
@@ -19036,6 +19940,10 @@ msgid "do not show any source or destination prefix"
msgstr "jangan perlihatkan prefiks sumber atau tujuan apapun"
#: diff.c
+msgid "use default prefixes a/ and b/"
+msgstr "gunakan awalan asali a/ dan b/"
+
+#: diff.c
msgid "show context between diff hunks up to the specified number of lines"
msgstr ""
"perlihatkan konteks diantara bingkah diff hingga jumlah baris yang disebutkan"
@@ -19157,14 +20065,6 @@ msgid "generate diff using the \"histogram diff\" algorithm"
msgstr "buat diff menggunakan algoritma \"diff histogram\""
#: diff.c
-msgid "<algorithm>"
-msgstr "<algoritma>"
-
-#: diff.c
-msgid "choose a diff algorithm"
-msgstr "pilih algoritma diff"
-
-#: diff.c
msgid "<text>"
msgstr "<teks>"
@@ -19343,53 +20243,53 @@ msgstr ""
#: diffcore-order.c
#, c-format
msgid "failed to read orderfile '%s'"
-msgstr ""
+msgstr "gagal membaca berkas urutan '%s'"
#: diffcore-rename.c
msgid "Performing inexact rename detection"
-msgstr ""
+msgstr "Melakukan deteksi penamaan ulang tidak eksak"
#: diffcore-rotate.c
#, c-format
msgid "No such path '%s' in the diff"
-msgstr ""
+msgstr "Tidak ada jalur seperti '%s' di dalam diff"
#: dir.c
#, c-format
msgid "pathspec '%s' did not match any file(s) known to git"
-msgstr ""
+msgstr "spek jalur '%s' tidak cocok dengan berkas apapun yang git kenal"
#: dir.c
#, c-format
msgid "unrecognized pattern: '%s'"
-msgstr ""
+msgstr "pola tidak dikenal: '%s'"
#: dir.c
#, c-format
msgid "unrecognized negative pattern: '%s'"
-msgstr ""
+msgstr "pola negatif tidak dikenal: '%s'"
#: dir.c
#, c-format
msgid "your sparse-checkout file may have issues: pattern '%s' is repeated"
-msgstr ""
+msgstr "berkas sparse-checkout Anda mungkin ada masalah: pola '%s' diulangi"
#: dir.c
msgid "disabling cone pattern matching"
-msgstr ""
+msgstr "mematikan pencocokan pola kerucut"
#: dir.c
#, c-format
msgid "cannot use %s as an exclude file"
-msgstr ""
+msgstr "tidak dapat menggunakan %s sebagai berkas pengecualian"
#: dir.c
msgid "failed to get kernel name and information"
-msgstr ""
+msgstr "gagal mendapatkan nama dan informasi kernel"
#: dir.c
msgid "untracked cache is disabled on this system or location"
-msgstr ""
+msgstr "tembolok tak terlacat dimatikan pada sistem atau lokasi ini"
#: dir.c
msgid ""
@@ -19402,41 +20302,51 @@ msgstr ""
#: dir.c
#, c-format
msgid "index file corrupt in repo %s"
-msgstr ""
+msgstr "berkas indeks rusak pada repo %s"
#: dir.c
#, c-format
msgid "could not create directories for %s"
-msgstr ""
+msgstr "tidak dapat membuat direktori untuk %s"
#: dir.c
#, c-format
msgid "could not migrate git directory from '%s' to '%s'"
-msgstr ""
+msgstr "tidak dapat memigrasikan direktori git dari '%s' ke '%s'"
#: editor.c
#, c-format
msgid "hint: Waiting for your editor to close the file...%c"
-msgstr ""
+msgstr "petunjuk: Menunggu penyunting Anda untuk menutup berkas...%c"
+
+#: editor.c sequencer.c wrapper.c
+#, c-format
+msgid "could not write to '%s'"
+msgstr "tidak dapat menulis ke '%s'"
+
+#: editor.c
+#, c-format
+msgid "could not edit '%s'"
+msgstr "tidak dapat menyunting '%s'"
#: entry.c
msgid "Filtering content"
-msgstr ""
+msgstr "Menyaring isi"
#: entry.c
#, c-format
msgid "could not stat file '%s'"
-msgstr ""
+msgstr "tidak dapat men-stat berkas '%s'"
#: environment.c
#, c-format
msgid "bad git namespace path \"%s\""
-msgstr ""
+msgstr "jalur ruang nama git jelek \"%s\""
#: exec-cmd.c
#, c-format
msgid "too many args to run %s"
-msgstr ""
+msgstr "terlalu banyak argumen untuk menjalankan %s"
#: fetch-pack.c
msgid "git fetch-pack: expected shallow list"
@@ -19460,6 +20370,10 @@ msgid "unable to write to remote"
msgstr "tidak dapat menulis ke remote"
#: fetch-pack.c
+msgid "Server supports filter"
+msgstr "Peladen mendukung saringan"
+
+#: fetch-pack.c
#, c-format
msgid "invalid shallow line: %s"
msgstr "baris dangkal tidak valid: %s"
@@ -19601,10 +20515,6 @@ msgid "Server does not support shallow requests"
msgstr "Peladen tidak mendukung permintaan dangkal"
#: fetch-pack.c
-msgid "Server supports filter"
-msgstr "Peladen mendukung saringan"
-
-#: fetch-pack.c
msgid "unable to write request to remote"
msgstr "tidak dapat menulis permintaan kepada remote"
@@ -19690,47 +20600,50 @@ msgstr "Peladen tidak memperbolehkan permintaan untuk objek tak diiklankan %s"
#: fsmonitor-ipc.c
#, c-format
msgid "fsmonitor_ipc__send_query: invalid path '%s'"
-msgstr ""
+msgstr "fsmonitor_ipc__send_query: jalur tidak valid '%s'"
#: fsmonitor-ipc.c
#, c-format
msgid "fsmonitor_ipc__send_query: unspecified error on '%s'"
-msgstr ""
+msgstr "fsmonitor_ipc__send_query: kesalahan tidak dijelaskan pada '%s'"
#: fsmonitor-ipc.c
msgid "fsmonitor--daemon is not running"
-msgstr ""
+msgstr "fsmonitor--daemon tidak berjalan"
#: fsmonitor-ipc.c
#, c-format
msgid "could not send '%s' command to fsmonitor--daemon"
-msgstr ""
+msgstr "tidak dapat mengirimkan perintah '%s' ke fsmonitor--daemon"
#: fsmonitor-settings.c
#, c-format
msgid "bare repository '%s' is incompatible with fsmonitor"
-msgstr ""
+msgstr "repositori bare '%s' tidak kompatibel dengan fsmonitor"
#: fsmonitor-settings.c
#, c-format
msgid "repository '%s' is incompatible with fsmonitor due to errors"
-msgstr ""
+msgstr "repositori '%s' tidak kompatibel dengan fsmonitor karena kesalahan"
#: fsmonitor-settings.c
#, c-format
msgid "remote repository '%s' is incompatible with fsmonitor"
-msgstr ""
+msgstr "repositori remote '%s' tidak kompatibel dengan fsmonitor"
#: fsmonitor-settings.c
#, c-format
msgid "virtual repository '%s' is incompatible with fsmonitor"
-msgstr ""
+msgstr "repositori virtual '%s' tidka kompatibel dengan fsmonitor"
#: fsmonitor-settings.c
#, c-format
msgid ""
-"repository '%s' is incompatible with fsmonitor due to lack of Unix sockets"
+"socket directory '%s' is incompatible with fsmonitor due to lack of Unix "
+"sockets support"
msgstr ""
+"direktori soket '%s' tidak kompatibel dengan fsmonitor karena kekurangan "
+"dukungan soket Unix"
#: git.c
msgid ""
@@ -19739,16 +20652,14 @@ msgid ""
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
-" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
-" <command> [<args>]"
+" [--config-env=<name>=<envvar>] <command> [<args>]"
msgstr ""
"git [-v| --version] [-h | --help] [-C <jalur>] [-c <nama>=<nilai>]\n"
" [--exec-path[=<jalur>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<jalur>] [--work-tree=<jalur>] [--namespace=<nama>]\n"
-" [--super-prefix=<jalur>] [--config-env=<nama>=<variabel "
-"lingkungan>]\n"
+" [--config-env=<nama>=<variabel lingkungan>]\n"
" <perintah> [<argumen>]"
#: git.c
@@ -19780,11 +20691,6 @@ msgstr "tidak ada ruang nama yang diberikan untuk --namespace\n"
#: git.c
#, c-format
-msgid "no prefix given for --super-prefix\n"
-msgstr "tidak ada prefiks yang diberikan untuk --super-prefix\n"
-
-#: git.c
-#, c-format
msgid "-c expects a configuration string\n"
msgstr "-c mengharapkan sebuah untai konfigurasi\n"
@@ -19795,6 +20701,11 @@ msgstr "tidak ada kunci konfigurasi yang diberikan untuk --config-env\n"
#: git.c
#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "tidak ada atribut yang diberikan untuk --attr-source\n"
+
+#: git.c
+#, c-format
msgid "unknown option: %s\n"
msgstr "opsi tidak dikenal: %s\n"
@@ -19921,8 +20832,13 @@ msgid "gpg.ssh.defaultKeyCommand failed: %s %s"
msgstr "gpg.ssh.defaultKeyCommand gagal: %s %s"
#: gpg-interface.c
-msgid "gpg failed to sign the data"
-msgstr "gpg gagal menandatangani data"
+#, c-format
+msgid ""
+"gpg failed to sign the data:\n"
+"%s"
+msgstr ""
+"gpg gagal menandatangani data:\n"
+"%s"
#: gpg-interface.c
msgid "user.signingKey needs to be set for ssh signing"
@@ -20027,6 +20943,14 @@ msgid "Low-level Commands / Internal Helpers"
msgstr "Perintah Tingak Rendah / Pembantu Internal"
#: help.c
+msgid "User-facing repository, command and file interfaces"
+msgstr "Antarmuka repositori, perintah, dan berkas menghadap-pengguna"
+
+#: help.c
+msgid "Developer-facing file formats, protocols and other interfaces"
+msgstr "Antarmuka menghadap-pengembang format berkas, protokol, dan lainnya"
+
+#: help.c
#, c-format
msgid "available git commands in '%s'"
msgstr "perintah git yang tersedia di '%s'"
@@ -20044,6 +20968,14 @@ msgid "The Git concept guides are:"
msgstr "Panduan konsep Git adalah:"
#: help.c
+msgid "User-facing repository, command and file interfaces:"
+msgstr "Antarmuka repositori, perintah, dan berkas menghadap-pengguna:"
+
+#: help.c
+msgid "File formats, protocols and other developer interfaces:"
+msgstr "Antarmuka format berkas, protokol, dan antarmuka lainnya:"
+
+#: help.c
msgid "External commands"
msgstr "Perintah eksternal"
@@ -20108,8 +21040,8 @@ msgstr[1] ""
"Perintah paling mirip adalah"
#: help.c
-msgid "git version [<options>]"
-msgstr "git version [<opsi>]"
+msgid "git version [--build-options]"
+msgstr "git version [--build-options]"
#: help.c
#, c-format
@@ -20140,51 +21072,48 @@ msgstr ""
"Anda dapat menonaktifkan peringatan ini dengan `git config advice."
"ignoredHook false`."
-#: hook.c
-#, c-format
-msgid "Couldn't start hook '%s'\n"
-msgstr "Tidak dapat memulai kait '%s'\n"
-
#: http-fetch.c
#, c-format
msgid "argument to --packfile must be a valid hash (got '%s')"
-msgstr ""
+msgstr "argumen ke --packfile harus sebuah hash valid (dapat '%s')"
#: http-fetch.c
msgid "not a git repository"
-msgstr ""
+msgstr "bukan sebuah repositori git"
#: http.c
#, c-format
msgid "negative value for http.postBuffer; defaulting to %d"
-msgstr ""
+msgstr "nilai negatif untuk http.postBuffer; asalkan ke %d"
#: http.c
msgid "Delegation control is not supported with cURL < 7.22.0"
-msgstr ""
+msgstr "Kontrol delegasi tidak didukung oleh cURL < 7.22.0"
#: http.c
msgid "Public key pinning not supported with cURL < 7.39.0"
-msgstr ""
+msgstr "Penyematan kunci publik tidak didukung oleh cURL < 7.39.0"
#: http.c
msgid "CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0"
-msgstr ""
+msgstr "CURLSSLOPT_NO_REVOKE tidak didukung dengan cURL < 7.44.0"
#: http.c
#, c-format
msgid "Unsupported SSL backend '%s'. Supported SSL backends:"
-msgstr ""
+msgstr "Tulang punggung SSL '%s' tidak didukung, yang didukung:"
#: http.c
#, c-format
msgid "Could not set SSL backend to '%s': cURL was built without SSL backends"
msgstr ""
+"Tidak dapat menyetel tulang punggung SSL ke '%s': cURL dibangun tanpa tulang "
+"punggung SSL"
#: http.c
#, c-format
msgid "Could not set SSL backend to '%s': already set"
-msgstr ""
+msgstr "Tidak dapat menyetel tulang punggung SSL ke '%s': sudah disetel"
#: http.c
#, c-format
@@ -20193,6 +21122,9 @@ msgid ""
" asked for: %s\n"
" redirect: %s"
msgstr ""
+"tidak dapat memperbarui dasar url dari pengalihan:\n"
+" diminta: %s\n"
+" pengalihan: %s"
#: ident.c
msgid "Author identity unknown\n"
@@ -20258,71 +21190,72 @@ msgstr "nama hanya terdiri dari karakter yang tidak diperbolehkan: %s"
#: list-objects-filter-options.c
msgid "expected 'tree:<depth>'"
-msgstr ""
+msgstr "'tree:<kedalaman> diharapkan'"
#: list-objects-filter-options.c
msgid "sparse:path filters support has been dropped"
-msgstr ""
+msgstr "dukungan penyaring sparse:path sudah ditiadakan"
#: list-objects-filter-options.c
#, c-format
msgid "'%s' for 'object:type=<type>' is not a valid object type"
-msgstr ""
+msgstr "'%s' untuk 'object:type=<tipe>' bukan tipe objek valid"
#: list-objects-filter-options.c
#, c-format
msgid "invalid filter-spec '%s'"
-msgstr ""
+msgstr "spek penyaring tidak valid '%s'"
#: list-objects-filter-options.c
#, c-format
msgid "must escape char in sub-filter-spec: '%c'"
-msgstr ""
+msgstr "harus melarikan karakter pada spek subpenyaring: '%c'"
#: list-objects-filter-options.c
msgid "expected something after combine:"
-msgstr ""
+msgstr "sesuatu setelah pencampuran diharapkan:"
#: list-objects-filter-options.c
msgid "multiple filter-specs cannot be combined"
-msgstr ""
+msgstr "spek penyaring lebih dari satu tidak dapat dicampurkan"
#: list-objects-filter-options.c
msgid "unable to upgrade repository format to support partial clone"
msgstr ""
+"tidak dapat meningkatkan format repositori untuk mendukung klon parsial"
#: list-objects-filter-options.h
msgid "args"
-msgstr ""
+msgstr "argumen"
#: list-objects-filter-options.h
msgid "object filtering"
-msgstr ""
+msgstr "penyaringan objek"
#: list-objects-filter.c
#, c-format
msgid "unable to access sparse blob in '%s'"
-msgstr ""
+msgstr "tidak dapat mengakses blob tipis di '%s'"
#: list-objects-filter.c
#, c-format
msgid "unable to parse sparse filter data in %s"
-msgstr ""
+msgstr "tidak dapat menyaring data penyaring tipis di %s"
#: list-objects.c
#, c-format
msgid "entry '%s' in tree %s has tree mode, but is not a tree"
-msgstr ""
+msgstr "entri '%s' di dalam pohon %s punya mode pohon, tetapi bukan pohon"
#: list-objects.c
#, c-format
msgid "entry '%s' in tree %s has blob mode, but is not a blob"
-msgstr ""
+msgstr "entri '%s' di dalam pohon %s punya mode blob, tetapi bukan blob"
#: list-objects.c
#, c-format
msgid "unable to load root tree for commit %s"
-msgstr ""
+msgstr "tidak dapat memuat pohon akar untuk komit %s"
#: lockfile.c
#, c-format
@@ -20335,40 +21268,41 @@ msgid ""
"may have crashed in this repository earlier:\n"
"remove the file manually to continue."
msgstr ""
+"Tidak dapat membuat '%s.lock': %s.\n"
+"\n"
+"Sepertinya proses git lainnya berjalan pada repositori ini, seperti\n"
+"penyunting yang dibuka oleh 'git commit'. Mohon pastikan semua proses\n"
+"berhenti dan coba lagi. Jika masih gagal, mungkin sebuah proses git hancur\n"
+"pada repositori ini sebelumnya: hapus berkas secara manual untuk melanjutkan."
#: lockfile.c
#, c-format
msgid "Unable to create '%s.lock': %s"
-msgstr ""
+msgstr "Tidak dapat membuat '%s.lock': %s"
#: ls-refs.c
#, c-format
msgid "unexpected line: '%s'"
-msgstr ""
+msgstr "baris tak diharapkan: '%s'"
#: ls-refs.c
msgid "expected flush after ls-refs arguments"
-msgstr ""
+msgstr "bilasan diharapkan setelah argumen ls-refs"
#: mailinfo.c
msgid "quoted CRLF detected"
-msgstr ""
-
-#: merge-ort-wrappers.c merge-recursive.c
-#, c-format
-msgid ""
-"Your local changes to the following files would be overwritten by merge:\n"
-" %s"
-msgstr ""
-"Perubahan lokal Anda terhadap berkas berikut akan ditimpa oleh "
-"penggabungan:\n"
-" %s"
+msgstr "CRLF terkutip terdeteksi"
#: merge-ort.c merge-recursive.c
#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "Gagal menggabungkan submodul %s (tidak di-checkout)"
+#: merge-ort.c
+#, c-format
+msgid "Failed to merge submodule %s (no merge base)"
+msgstr "Gagal menggabungkan submodul %s (tidak ada dasar penggabungan)"
+
#: merge-ort.c merge-recursive.c
#, c-format
msgid "Failed to merge submodule %s (commits not present)"
@@ -20393,28 +21327,10 @@ msgstr "Gagal menggabungkan submodul %s"
#: merge-ort.c
#, c-format
msgid ""
-"Failed to merge submodule %s, but a possible merge resolution exists:\n"
-"%s\n"
-msgstr ""
-"Gagal menggabungkan submodul %s, tetapi sebuah penyelesaian penggabungan "
-"yang mungkin ada:\n"
-"%s\n"
-
-#: merge-ort.c merge-recursive.c
-#, c-format
-msgid ""
-"If this is correct simply add it to the index for example\n"
-"by using:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"which will accept this suggestion.\n"
+"Failed to merge submodule %s, but a possible merge resolution exists: %s"
msgstr ""
-"Jika benar, cukup misalkan tambahkan ke indeks dengan menggunakan:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"yang akan menerima saran ini.\n"
+"Gagal menggabungkan submodul %s, tetapi ada kemungkinan penyelesaian "
+"penggabungan: %s"
#: merge-ort.c
#, c-format
@@ -20427,13 +21343,13 @@ msgstr ""
"%s"
#: merge-ort.c merge-recursive.c
-msgid "Failed to execute internal merge"
-msgstr "Gagal menjalankan penggabungan internal"
+msgid "failed to execute internal merge"
+msgstr "gagal menjalankan penggabungan internal"
#: merge-ort.c merge-recursive.c
#, c-format
-msgid "Unable to add %s to database"
-msgstr "Tidak dapat menambahkan %s ke basis data"
+msgid "unable to add %s to database"
+msgstr "tidak dapat menambahkan %s ke basis data"
#: merge-ort.c merge-recursive.c
#, c-format
@@ -20603,14 +21519,47 @@ msgstr ""
"KONFLIK (pengubahan/penghapusan): %s dihapus di %s dan diubah di %s. Versi "
"%s dari %s ditinggalkan di dalam pohon."
+#. TRANSLATORS: This is a line of advice to resolve a merge
+#. conflict in a submodule. The first argument is the submodule
+#. name, and the second argument is the abbreviated id of the
+#. commit that needs to be merged. For example:
+#. - go to submodule (mysubmodule), and either merge commit abc1234"
+#.
#: merge-ort.c
#, c-format
msgid ""
-"Note: %s not up to date and in way of checking out conflicted version; old "
-"copy renamed to %s"
+" - go to submodule (%s), and either merge commit %s\n"
+" or update to an existing commit which has merged those changes\n"
msgstr ""
-"Catatan: %s tidak terbaru dan dalam men-checkout versi berkonflik; salinan "
-"lama dinamai ulang ke %s"
+" - pergi ke submodul (%s), dan baik gabungkan komit %s\n"
+" atau perbarui ke komit yang sudah ada yang sudah menggabungkan "
+"perubahan tersebut\n"
+
+#: merge-ort.c
+#, c-format
+msgid ""
+"Recursive merging with submodules currently only supports trivial cases.\n"
+"Please manually handle the merging of each conflicted submodule.\n"
+"This can be accomplished with the following steps:\n"
+"%s - come back to superproject and run:\n"
+"\n"
+" git add %s\n"
+"\n"
+" to record the above merge or update\n"
+" - resolve any other conflicts in the superproject\n"
+" - commit the resulting index in the superproject\n"
+msgstr ""
+"Saat ini penggabungan rekursif dengan submodul hanya mendukung kasus-kasus "
+"sepele.\n"
+"Mohon tangani penggabungan setiap submodul berkonflik secara manual.\n"
+"Hal ini dapat dicapai dengan langkah berikut:\n"
+"%s - kembali ke proyek induk dan jalankan:\n"
+"\n"
+" git add %s\n"
+"\n"
+" untuk merekam penggabungan di atas atau perbarui\n"
+" - selesaikan semua konflik lainnya di dalam proyek induk\n"
+" - komit hasil indeks di dalam proyek induk\n"
#. TRANSLATORS: The %s arguments are: 1) tree hash of a merge
#. base, and 2-3) the trees for the two trees we're merging.
@@ -20702,6 +21651,22 @@ msgstr "Sebuah resolusi penggabungan yang mungkin ditemukan untuk submodul:\n"
#: merge-recursive.c
#, c-format
+msgid ""
+"If this is correct simply add it to the index for example\n"
+"by using:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"which will accept this suggestion.\n"
+msgstr ""
+"Jika benar, cukup misalkan tambahkan ke indeks dengan menggunakan:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"yang akan menerima saran ini.\n"
+
+#: merge-recursive.c
+#, c-format
msgid "Failed to merge submodule %s (multiple merges found)"
msgstr "Gagal menggabungkan submodul %s (banyak penggabungan ditemukan)"
@@ -20790,8 +21755,8 @@ msgstr ""
#: merge-recursive.c
#, c-format
msgid ""
-"CONFLICT (rename/rename): Rename \"%s\"->\"%s\" in branch \"%s\" rename \"%s"
-"\"->\"%s\" in \"%s\"%s"
+"CONFLICT (rename/rename): Rename \"%s\"->\"%s\" in branch \"%s\" rename "
+"\"%s\"->\"%s\" in \"%s\"%s"
msgstr ""
"KONFLIK (penamaan ulang/penamaan ulang): Penamaan ulang \"%s\"->\"%s\" di "
"dalam cabang \"%s\" penamaan ulang \"%s\"->\"%s\" di \"%s\"%s"
@@ -20909,6 +21874,22 @@ msgstr "OID kipas-keluar indeks multipak salah ukuran"
#: midx.c
#, c-format
+msgid ""
+"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
+msgstr ""
+"kipas-keluar oid tidak berurutan: fanout[%d] =%<PRIx32> > %<PRIx32> = "
+"fanout[%d]"
+
+#: midx.c
+msgid "multi-pack-index OID lookup chunk is the wrong size"
+msgstr "bingkah pencarian OID kipas-keluar indeks multipak salah ukuran"
+
+#: midx.c
+msgid "multi-pack-index object offset chunk is the wrong size"
+msgstr "bingkah offset OID kipas-keluar indeks multipak salah ukuran"
+
+#: midx.c
+#, c-format
msgid "multi-pack-index file %s is too small"
msgstr "berkas indeks multipak %s terlalu kecil"
@@ -20929,20 +21910,26 @@ msgid "multi-pack-index hash version %u does not match version %u"
msgstr "versi hash indeks multipak %u tidak cocok dengan versi %u"
#: midx.c
-msgid "multi-pack-index missing required pack-name chunk"
-msgstr "indeks multipak kehilangan bingkah pack-name yang diperlukan"
+msgid "multi-pack-index required pack-name chunk missing or corrupted"
+msgstr "bingkah nama pak indeks multipak yang diperlukan hilang atau rusak"
#: midx.c
-msgid "multi-pack-index missing required OID fanout chunk"
-msgstr "indeks multipak kehilangan bingkah OID kipas keluar yang diperlukan"
+msgid "multi-pack-index required OID fanout chunk missing or corrupted"
+msgstr ""
+"bingkah OID kipas-keluar indeks multipak yang diperlukan hilang atau rusak"
#: midx.c
-msgid "multi-pack-index missing required OID lookup chunk"
-msgstr "indeks multipak kehilangan bingkah pencarian OID yang diperlukan"
+msgid "multi-pack-index required OID lookup chunk missing or corrupted"
+msgstr ""
+"bingkah pencarian OID indeks multipak yang diperlukan hilang atau rusak"
#: midx.c
-msgid "multi-pack-index missing required object offsets chunk"
-msgstr "indeks multipak kehilangan bingkah offset objek yang diperlukan"
+msgid "multi-pack-index required object offsets chunk missing or corrupted"
+msgstr "bingkah offset objek indeks multipak yang diperlukan hilang atau rusak"
+
+#: midx.c
+msgid "multi-pack-index pack-name chunk is too short"
+msgstr "bingkah nama pak indeks multipak terlalu kecil"
#: midx.c
#, c-format
@@ -20955,10 +21942,23 @@ msgid "bad pack-int-id: %u (%u total packs)"
msgstr "pack-int-id jelek: %u (total pak %u)"
#: midx.c
+msgid "MIDX does not contain the BTMP chunk"
+msgstr "MIDX tidak berisi bingkah BTMP"
+
+#: midx.c
+#, c-format
+msgid "could not load bitmapped pack %<PRIu32>"
+msgstr "tidak dapat membuka pak terbitmap %<PRIu32>"
+
+#: midx.c
msgid "multi-pack-index stores a 64-bit offset, but off_t is too small"
msgstr "indeks multipak simpan offset 64-bit, tapi off_t terlalu kecil"
#: midx.c
+msgid "multi-pack-index large offset out of bounds"
+msgstr "offset indeks multipak besar di luar jangkauan"
+
+#: midx.c
#, c-format
msgid "failed to add packfile '%s'"
msgstr "gagal menambah berkas pak '%s'"
@@ -21058,14 +22058,6 @@ msgid "Looking for referenced packfiles"
msgstr "Mencari berkas pak yang direferensikan"
#: midx.c
-#, c-format
-msgid ""
-"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
-msgstr ""
-"kipas-keluar oid tidak berurutan: fanout[%d] =%<PRIx32> > %<PRIx32> = "
-"fanout[%d]"
-
-#: midx.c
msgid "the midx contains no oid"
msgstr "midx tidak berisi oid"
@@ -21120,17 +22112,17 @@ msgstr "tidak dapat menyelesaikan pack-objects"
#: name-hash.c
#, c-format
msgid "unable to create lazy_dir thread: %s"
-msgstr ""
+msgstr "tidak dapat membuat utas lazy_dir: %s"
#: name-hash.c
#, c-format
msgid "unable to create lazy_name thread: %s"
-msgstr ""
+msgstr "tidak dapat membuat utas lazy_name: %s"
#: name-hash.c
#, c-format
msgid "unable to join lazy_name thread: %s"
-msgstr ""
+msgstr "tidak dapat menggabungkan utas lazy_name: %s"
#: notes-merge.c
#, c-format
@@ -21139,25 +22131,29 @@ msgid ""
"Please, use 'git notes merge --commit' or 'git notes merge --abort' to "
"commit/abort the previous merge before you start a new notes merge."
msgstr ""
+"Anda belum menyelesaikan penggabungan catatan Anda sebelumnya (%s ada).\n"
+"Mohon gunakan 'git notes merge --commit' atau 'git notes merge --abort' "
+"untuk mengkomit/membatalkan penggabungan sebelumnya sebelum Anda memulai "
+"penggabungan catatan baru."
#: notes-merge.c
#, c-format
msgid "You have not concluded your notes merge (%s exists)."
-msgstr ""
+msgstr "Anda belum menyelesaikan penggabungan catatan Anda (%s ada)."
#: notes-utils.c
msgid "Cannot commit uninitialized/unreferenced notes tree"
-msgstr ""
+msgstr "Tidak dapat mengkomit pohon catatan tak dinisialisasi/tak dirujuk"
#: notes-utils.c
#, c-format
msgid "Bad notes.rewriteMode value: '%s'"
-msgstr ""
+msgstr "Nilai notes.rewriteMode jelek: '%s'"
#: notes-utils.c
#, c-format
msgid "Refusing to rewrite notes in %s (outside of refs/notes/)"
-msgstr ""
+msgstr "Menolak menulis ulang catatan di %s (di luar refs/notes/)"
#. TRANSLATORS: The first %s is the name of
#. the environment variable, the second %s is
@@ -21166,7 +22162,7 @@ msgstr ""
#: notes-utils.c
#, c-format
msgid "Bad %s value: '%s'"
-msgstr ""
+msgstr "Nilai %s jelek: '%s'"
#: object-file.c
#, c-format
@@ -21184,11 +22180,6 @@ msgid "%s: ignoring alternate object stores, nesting too deep"
msgstr "%s: mengabaikan penyimpanan objek alternatif, bersarang terlalu dalam"
#: object-file.c
-#, c-format
-msgid "unable to normalize object directory: %s"
-msgstr "tidak dapat menormalisasikan direktori objek: %s"
-
-#: object-file.c
msgid "unable to fdopen alternates lockfile"
msgstr "tidak dapat men-fdopen berkas kunci alternatif"
@@ -21263,6 +22254,11 @@ msgstr "sampah pada ujung berkas objek '%s'"
#: object-file.c
#, c-format
+msgid "unable to open loose object %s"
+msgstr "tidak dapat membuka objek longgar %s"
+
+#: object-file.c
+#, c-format
msgid "unable to parse %s header"
msgstr "tidak dapat menguraikan kepala %s"
@@ -21282,8 +22278,8 @@ msgstr "kepala untuk %s terlalu panjang, melebihi %d bita"
#: object-file.c
#, c-format
-msgid "failed to read object %s"
-msgstr "gagal membaca objek %s"
+msgid "loose object %s (stored in %s) is corrupt"
+msgstr "objek longgar %s (disimpan di %s) rusak"
#: object-file.c
#, c-format
@@ -21292,11 +22288,6 @@ msgstr "pengganti %s tidak ditemukan untuk %s"
#: object-file.c
#, c-format
-msgid "loose object %s (stored in %s) is corrupt"
-msgstr "objek longgar %s (disimpan di %s) rusak"
-
-#: object-file.c
-#, c-format
msgid "packed object %s (stored in %s) is corrupt"
msgstr "objek terpak %s (disimpan di %s) rusak"
@@ -21311,10 +22302,6 @@ msgid "unable to set permission to '%s'"
msgstr "tidak dapat menyetel perizinan ke '%s'"
#: object-file.c
-msgid "file write error"
-msgstr "kesalahan menulis berkas"
-
-#: object-file.c
msgid "error when closing loose object file"
msgstr "kesalahan saat menutup berkas objek longgar"
@@ -21350,16 +22337,37 @@ msgstr "kebingungan oleh data sumber objek tidak stabil untuk %s"
#: object-file.c
#, c-format
+msgid "write stream object %ld != %<PRIuMAX>"
+msgstr "tulis objek arus %ld != %<PRIuMAX>"
+
+#: object-file.c
+#, c-format
+msgid "unable to stream deflate new object (%d)"
+msgstr "tidak dapat mengempis arus objek baru (%d)"
+
+#: object-file.c
+#, c-format
+msgid "deflateEnd on stream object failed (%d)"
+msgstr "deflateEnd pada objek arus gagal (%d)"
+
+#: object-file.c
+#, c-format
+msgid "unable to create directory %s"
+msgstr "gagal membuat direktori %s"
+
+#: object-file.c
+#, c-format
msgid "cannot read object for %s"
msgstr "tidak dapat membaca objek untuk %s"
#: object-file.c
-msgid "corrupt commit"
-msgstr "komit rusak"
+#, c-format
+msgid "object fails fsck: %s"
+msgstr "fsck objek gagal: %s"
#: object-file.c
-msgid "corrupt tag"
-msgstr "tag rusak"
+msgid "refusing to create malformed object"
+msgstr "menolak membuat objek jelek"
#: object-file.c
#, c-format
@@ -21616,6 +22624,67 @@ msgstr "tidak dapat menguraikan objek: %s"
msgid "hash mismatch %s"
msgstr "hash tidak cocok %s"
+#: pack-bitmap-write.c
+msgid "trying to write commit not in index"
+msgstr "mencoba menulis komit yang bukan di indeks"
+
+#: pack-bitmap.c
+msgid "failed to load bitmap index (corrupted?)"
+msgstr "gagal menulis indeks bitmap (rusak?)"
+
+#: pack-bitmap.c
+msgid "corrupted bitmap index (too small)"
+msgstr "indeks bitmap rusak (terlalu kecil)"
+
+#: pack-bitmap.c
+msgid "corrupted bitmap index file (wrong header)"
+msgstr "berkas indeks bitmap rusak (kepala salah)"
+
+#: pack-bitmap.c
+#, c-format
+msgid "unsupported version '%d' for bitmap index file"
+msgstr "versi '%d' tidak didukung untuk berkas indeks bitmap"
+
+#: pack-bitmap.c
+msgid "corrupted bitmap index file (too short to fit hash cache)"
+msgstr "berkas indeks bitmap rusak (terlalu pendek untuk masuk tembolok hash)"
+
+#: pack-bitmap.c
+msgid "corrupted bitmap index file (too short to fit lookup table)"
+msgstr ""
+"berkas indeks bitmap rusak (terlalu pendek untuk masuk tabel pencarian)"
+
+#: pack-bitmap.c
+#, c-format
+msgid "duplicate entry in bitmap index: '%s'"
+msgstr "entri duplikat di indeks bitmap: '%s'"
+
+#: pack-bitmap.c
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for entry %d"
+msgstr "bitmap ewah rusak: kepala terpotong untuk entri %d"
+
+#: pack-bitmap.c
+#, c-format
+msgid "corrupt ewah bitmap: commit index %u out of range"
+msgstr "bitmap ewah rusak: indeks komit %u di luar jangkauan"
+
+#: pack-bitmap.c
+msgid "corrupted bitmap pack index"
+msgstr "indeks pak bitmap rusak"
+
+#: pack-bitmap.c
+msgid "invalid XOR offset in bitmap pack index"
+msgstr "offset XOR tidak valid di indeks pak bitmap"
+
+#: pack-bitmap.c
+msgid "cannot fstat bitmap file"
+msgstr "tidak dapat fstat berkas bitmap"
+
+#: pack-bitmap.c
+msgid "checksum doesn't match in MIDX and bitmap"
+msgstr "checksum tidak cocok di MIDX dan bitmap"
+
#: pack-bitmap.c
msgid "multi-pack bitmap is missing required reverse index"
msgstr "bitmap multipak kehilangan indeks balik yang diperlukan"
@@ -21625,15 +22694,89 @@ 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"
+
+#: pack-bitmap.c
+msgid "corrupt bitmap lookup table: xor chain exceeds entry count"
+msgstr "tabel pencarian bitmap rusak: rantai xor melebihi hitungan entri"
+
+#: pack-bitmap.c
+#, c-format
+msgid "corrupt bitmap lookup table: commit index %u out of range"
+msgstr "tabel pencarian bitmap rusak: indeks komit %u di luar jangkauan"
+
+#: pack-bitmap.c
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for bitmap of commit \"%s\""
+msgstr "bitmap ewah rusak: kepala terpotong untuk bitmap komit \"%s\""
+
+#: pack-bitmap.c
+#, c-format
+msgid "unable to load pack: '%s', disabling pack-reuse"
+msgstr "tidak dapat memuat pak: '%s', mematikan penggunaan ulang pak"
+
+#: pack-bitmap.c
+#, c-format
+msgid "object '%s' not found in type bitmaps"
+msgstr "objek '%s' tidak ditemukan di bitmap tipe"
+
+#: pack-bitmap.c
+#, c-format
+msgid "object '%s' does not have a unique type"
+msgstr "objek '%s' tidak punya tipe unik"
+
+#: pack-bitmap.c
+#, c-format
+msgid "object '%s': real type '%s', expected: '%s'"
+msgstr "objek '%s': bertipe sebenarnya '%s', diharapkan '%s'"
+
+#: pack-bitmap.c
#, c-format
-msgid "could not find %s in pack %s at offset %<PRIuMAX>"
-msgstr "tidak dapat menemukan %s di dalam pak %s pada offset %<PRIuMAX>"
+msgid "object not in bitmap: '%s'"
+msgstr "object bukan di bitmap: '%s'"
+
+#: pack-bitmap.c
+msgid "failed to load bitmap indexes"
+msgstr "gagal memuat indeks bitmap"
+
+#: pack-bitmap.c
+msgid "you must specify exactly one commit to test"
+msgstr "Anda harus sebutkan tepat satu komit untuk diuji"
+
+#: pack-bitmap.c
+#, c-format
+msgid "commit '%s' doesn't have an indexed bitmap"
+msgstr "komit '%s' tidak punya bitmap terindeks"
+
+#: pack-bitmap.c
+msgid "mismatch in bitmap results"
+msgstr "ketidaksesuaian di dalam hasil bitmap"
+
+#: pack-bitmap.c
+#, c-format
+msgid "could not find '%s' in pack '%s' at offset %<PRIuMAX>"
+msgstr "tidak dapat menemukan %s di dalam pak '%s' pada offset %<PRIuMAX>"
+
+#: pack-bitmap.c
+#, c-format
+msgid "unable to get disk usage of '%s'"
+msgstr "tidak dapat mendapatkan penggunaan disk dari '%s'"
+
+#: pack-bitmap.c
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "checksum berkas bitmap '%s' tidak valid"
#: pack-mtimes.c
#, c-format
@@ -21685,6 +22828,23 @@ msgstr "berkas indeks balik %s punya versi tidak didukung %<PRIu32>"
msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
msgstr "berkas indeks balik %s punya id hash tidak didukung %<PRIu32>"
+#: pack-revindex.c
+msgid "invalid checksum"
+msgstr "checksum tidak valid"
+
+#: pack-revindex.c
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr "posisi indeks balik tidak valid pada %<PRIu64>: %<PRIu32> != %<PRIu32>"
+
+#: pack-revindex.c
+msgid "multi-pack-index reverse-index chunk is the wrong size"
+msgstr "bingkah indeks balik multipak salah ukuran"
+
+#: pack-revindex.c
+msgid "could not determine preferred pack"
+msgstr "tidak dapat menentukan pak terpilih"
+
#: pack-write.c
msgid "cannot both write and verify reverse index"
msgstr "tidak dapat kedua-duanya menulis dan memverifikasi indeks balik"
@@ -21726,91 +22886,87 @@ msgstr "offset di luar ujung indeks pak untuk %s (indeks terpotong?)"
#: parse-options-cb.c
#, c-format
msgid "malformed expiration date '%s'"
-msgstr ""
+msgstr "tanggal kadaluarsa rusak '%s'"
#: parse-options-cb.c
#, c-format
msgid "option `%s' expects \"always\", \"auto\", or \"never\""
-msgstr ""
+msgstr "opsi `%s' mengharapkan \"always\", \"auto\", atau \"never\""
#: parse-options-cb.c
#, c-format
msgid "malformed object name '%s'"
-msgstr ""
+msgstr "nama objek rusak '%s'"
#: parse-options-cb.c
#, c-format
msgid "option `%s' expects \"%s\" or \"%s\""
-msgstr ""
+msgstr "opsi `%s' mengharapkan \"%s\" atau \"%s\""
#: parse-options.c
#, c-format
msgid "%s requires a value"
-msgstr ""
-
-#: parse-options.c
-#, c-format
-msgid "%s is incompatible with %s"
-msgstr ""
-
-#: parse-options.c
-#, c-format
-msgid "%s : incompatible with something else"
-msgstr ""
+msgstr "%s butuh sebuah nilai"
#: parse-options.c
#, c-format
msgid "%s takes no value"
-msgstr ""
+msgstr "%s tidak mengambil nilai apapun"
#: parse-options.c
#, c-format
msgid "%s isn't available"
-msgstr ""
+msgstr "%s tidak ada"
#: parse-options.c
#, c-format
msgid "%s expects a non-negative integer value with an optional k/m/g suffix"
msgstr ""
+"%s mengharapkan nilai bilangan bulat non negatif dengan akhiran opsional k/m/"
+"g"
#: parse-options.c
#, c-format
msgid "ambiguous option: %s (could be --%s%s or --%s%s)"
-msgstr ""
+msgstr "opsi ambigu: %s (bisa jadi --%s%s atau --%s%s)"
#: parse-options.c
#, c-format
msgid "did you mean `--%s` (with two dashes)?"
-msgstr ""
+msgstr "mungkin maksud Anda `--%s` (dengan dua tanda strip)?"
#: parse-options.c
#, c-format
msgid "alias of --%s"
-msgstr ""
+msgstr "alias untuk --%s"
+
+#: parse-options.c
+msgid "need a subcommand"
+msgstr "butuh sebuah subperintah"
#: parse-options.c
#, c-format
msgid "unknown option `%s'"
-msgstr ""
+msgstr "opsi tidak dikenal `%s'"
#: parse-options.c
#, c-format
msgid "unknown switch `%c'"
-msgstr ""
+msgstr "sakelar tidak dikenal `%c'"
#: parse-options.c
#, c-format
msgid "unknown non-ascii option in string: `%s'"
-msgstr ""
+msgstr "opsi non-ascii di dalam untai tidak dikenal: `%s'"
#: parse-options.c
msgid "..."
-msgstr ""
+msgstr "..."
#: parse-options.c
#, c-format
msgid "usage: %s"
-msgstr ""
+msgstr "penggunaan: %s"
#. TRANSLATORS: the colon here should align with the
#. one in "usage: %s" translation.
@@ -21818,7 +22974,7 @@ msgstr ""
#: parse-options.c
#, c-format
msgid " or: %s"
-msgstr ""
+msgstr " atau: %s"
#. TRANSLATORS: You should only need to translate this format
#. string if your language is a RTL language (e.g. Arabic,
@@ -21842,237 +22998,272 @@ msgstr ""
#: parse-options.c
#, c-format
msgid "%*s%s"
-msgstr ""
+msgstr "%*s%s"
#: parse-options.c
#, c-format
msgid " %s"
-msgstr ""
+msgstr " %s"
#: parse-options.c
msgid "-NUM"
-msgstr ""
+msgstr "-NUM"
+
+#: parse-options.c
+#, c-format
+msgid "opposite of --no-%s"
+msgstr "lawan dari --no-%s"
#: parse-options.h
msgid "expiry-date"
-msgstr ""
+msgstr "tanggal kadaluarsa"
#: parse-options.h
msgid "no-op (backward compatibility)"
-msgstr ""
+msgstr "tanpa operasi (kompatibilitas ke belakang)"
#: parse-options.h
msgid "be more verbose"
-msgstr ""
+msgstr "jadi lebih berkata-kata"
#: parse-options.h
msgid "be more quiet"
-msgstr ""
+msgstr "jadi lebih dian"
#: parse-options.h
msgid "use <n> digits to display object names"
-msgstr ""
+msgstr "gunakan <n> digit untuk menampilkan nama objek"
+
+#: parse-options.h
+msgid "prefixed path to initial superproject"
+msgstr "jalur terprefiks ke superproyek awal"
#: parse-options.h
msgid "how to strip spaces and #comments from message"
-msgstr ""
+msgstr "bagaimana cara mengupas spasi dan #komentar dari pesan"
#: parse-options.h
msgid "read pathspec from file"
-msgstr ""
+msgstr "baca spek jalur dari berkas"
#: parse-options.h
msgid ""
"with --pathspec-from-file, pathspec elements are separated with NUL character"
msgstr ""
+"dengan --pathspec-from-file, elemen spek jalur dipisahkan dengan karakter NUL"
+
+#: parse.c
+#, c-format
+msgid "bad boolean environment value '%s' for '%s'"
+msgstr "nilai lingkungan boolean '%s' jelek untuk '%s'"
+
+#: parse.c
+#, c-format
+msgid "failed to parse %s"
+msgstr "gagal menguraikan %s"
#: path.c
#, c-format
msgid "Could not make %s writable by group"
-msgstr ""
+msgstr "Tidak dapat membuat %s bisa ditulis oleh grup"
#: pathspec.c
msgid "Escape character '\\' not allowed as last character in attr value"
msgstr ""
+"Karakter pelarian '\\' tidak diperbolehkan sebagai karakter terakhir dalam "
+"nilai atribut"
#: pathspec.c
msgid "Only one 'attr:' specification is allowed."
-msgstr ""
+msgstr "Hanya satu spesifikasi 'attr:' yang diperbolehkan."
#: pathspec.c
msgid "attr spec must not be empty"
-msgstr ""
+msgstr "spek atribut tidak boleh kosong"
#: pathspec.c
#, c-format
msgid "invalid attribute name %s"
-msgstr ""
+msgstr "nama atribut tidak valid %s"
#: pathspec.c
msgid "global 'glob' and 'noglob' pathspec settings are incompatible"
-msgstr ""
+msgstr "setelan spek jalur global 'glob' dan 'noglob' tidak kompatibel"
#: pathspec.c
msgid ""
"global 'literal' pathspec setting is incompatible with all other global "
"pathspec settings"
msgstr ""
+"setelan spek jalur global 'literal' tidak kompatibel dengan semua setelan "
+"spek jalur lainnya"
#: pathspec.c
msgid "invalid parameter for pathspec magic 'prefix'"
-msgstr ""
+msgstr "parameter tidak valid untuk spek jalur ajaib 'prefix'"
#: pathspec.c
#, c-format
msgid "Invalid pathspec magic '%.*s' in '%s'"
-msgstr ""
+msgstr "Spek jalur ajaib '%.*s' tidak valid di '%s'"
#: pathspec.c
#, c-format
msgid "Missing ')' at the end of pathspec magic in '%s'"
-msgstr ""
+msgstr "Kehilangan ')' pada akhir spek jalur ajaib di '%s'"
#: pathspec.c
#, c-format
msgid "Unimplemented pathspec magic '%c' in '%s'"
-msgstr ""
+msgstr "Spek jalur ajaib '%c' tidak diterapkan di '%s'"
#: pathspec.c
#, c-format
msgid "%s: 'literal' and 'glob' are incompatible"
-msgstr ""
+msgstr "%s: 'literal' dan 'glob' tidak kompatibel"
+
+#: pathspec.c
+#, c-format
+msgid "'%s' is outside the directory tree"
+msgstr "'%s' di luar pohon direktori"
#: pathspec.c
#, c-format
msgid "%s: '%s' is outside repository at '%s'"
-msgstr ""
+msgstr "%s: '%s' di luar repositori pada '%s'"
#: pathspec.c
#, c-format
msgid "'%s' (mnemonic: '%c')"
-msgstr ""
+msgstr "'%s' (mnemonik: '%c')"
#: pathspec.c
#, c-format
msgid "%s: pathspec magic not supported by this command: %s"
-msgstr ""
+msgstr "%s: spek jalur ajaib tidak didukung oleh perintah ini: %s"
#: pathspec.c
#, c-format
msgid "pathspec '%s' is beyond a symbolic link"
-msgstr ""
+msgstr "spek jalur '%s' di luar tautan simbolik"
#: pathspec.c
#, c-format
msgid "line is badly quoted: %s"
-msgstr ""
+msgstr "baris dikutip jelek: %s"
#: pkt-line.c
msgid "unable to write flush packet"
-msgstr ""
+msgstr "tidak dapat menulis paket bilas"
#: pkt-line.c
msgid "unable to write delim packet"
-msgstr ""
+msgstr "tidak dapat menulis paket pembatas"
#: pkt-line.c
msgid "unable to write response end packet"
-msgstr ""
+msgstr "tidak dapat menulis paket ujung jawaban"
#: pkt-line.c
msgid "flush packet write failed"
-msgstr ""
+msgstr "gagal membilas penulisan paket"
#: pkt-line.c
msgid "protocol error: impossibly long line"
-msgstr ""
+msgstr "kesalahan protokol: baris panjang tidak mungkin"
#: pkt-line.c
msgid "packet write with format failed"
-msgstr ""
+msgstr "gagal menulis paket dengan format"
#: pkt-line.c
msgid "packet write failed - data exceeds max packet size"
-msgstr ""
+msgstr "gagal menulis paket - data melebihi ukuran paket maksimum"
#: pkt-line.c
#, c-format
msgid "packet write failed: %s"
-msgstr ""
+msgstr "gagal menulis paket: %s"
#: pkt-line.c
msgid "read error"
-msgstr ""
+msgstr "kesalahan membaca"
#: pkt-line.c
msgid "the remote end hung up unexpectedly"
-msgstr ""
+msgstr "ujung remote menggantung secara tidak terduga"
#: pkt-line.c
#, c-format
msgid "protocol error: bad line length character: %.4s"
-msgstr ""
+msgstr "kesalahan protokol: karakter panjang baris jelek: %.4s"
#: pkt-line.c
#, c-format
msgid "protocol error: bad line length %d"
-msgstr ""
+msgstr "kesalahan protokol: panjang baris %d jelek"
#: pkt-line.c sideband.c
#, c-format
msgid "remote error: %s"
-msgstr ""
+msgstr "kesalahan remote: %s"
#: preload-index.c
msgid "Refreshing index"
-msgstr ""
+msgstr "Menyegarkan indeks"
#: preload-index.c
#, c-format
msgid "unable to create threaded lstat: %s"
-msgstr ""
+msgstr "tidak dapat membuat lstat terutas: %s"
#: pretty.c
msgid "unable to parse --pretty format"
-msgstr ""
+msgstr "tidak dapat menguraikan format --pretty"
#: promisor-remote.c
msgid "promisor-remote: unable to fork off fetch subprocess"
-msgstr ""
+msgstr "promisor-remote: tidak dapat menggarpu subproses pengambilan"
#: promisor-remote.c
msgid "promisor-remote: could not write to fetch subprocess"
-msgstr ""
+msgstr "promisor-remote: tidak dapat menulis ke subproses pengambilan"
#: promisor-remote.c
msgid "promisor-remote: could not close stdin to fetch subprocess"
msgstr ""
+"promisor-remote: tidak dapat menutup masukan standar ke subproses pengambilan"
#: promisor-remote.c
#, c-format
msgid "promisor remote name cannot begin with '/': %s"
-msgstr ""
+msgstr "nama remote penjanji tidak dapat diawali dengan '/': %s"
+
+#: promisor-remote.c
+#, c-format
+msgid "could not fetch %s from promisor remote"
+msgstr "tidak dapat mengambil %s dari remote penjanji"
#: protocol-caps.c
msgid "object-info: expected flush after arguments"
-msgstr ""
+msgstr "object-info: bilasan diharapkan setelah argumen"
#: prune-packed.c
msgid "Removing duplicate objects"
-msgstr ""
+msgstr "Menghapus objek duplikat"
#: range-diff.c
msgid "could not start `log`"
-msgstr ""
+msgstr "tidak dapat memulai `log`"
#: range-diff.c
msgid "could not read `log` output"
-msgstr ""
+msgstr "tidak dapat membaca keluaran `log`"
#: range-diff.c sequencer.c
#, c-format
msgid "could not parse commit '%s'"
-msgstr ""
+msgstr "tidak dapat menguraikan komit '%s'"
#: range-diff.c
#, c-format
@@ -22080,58 +23271,67 @@ msgid ""
"could not parse first line of `log` output: did not start with 'commit ': "
"'%s'"
msgstr ""
+"tidak dapat menguraikan baris pertama dari keluaran `log`: tidak dimulai "
+"dengan 'commit ': '%s'"
#: range-diff.c
#, c-format
msgid "could not parse git header '%.*s'"
-msgstr ""
+msgstr "tidak dapat menguraikan kepala git '%.*s'"
#: range-diff.c
msgid "failed to generate diff"
-msgstr ""
+msgstr "gagal membuat diff"
#: range-diff.c
#, c-format
msgid "could not parse log for '%s'"
-msgstr ""
+msgstr "tidak dapat menguraikan log untuk '%s'"
+
+#: reachable.c
+#, c-format
+msgid "invalid extra cruft tip: '%s'"
+msgstr "ujung sampah tambahan tidak valid: '%s'"
+
+#: reachable.c
+msgid "unable to enumerate additional recent objects"
+msgstr "tidak dapat menghitung objeck terkini tambahan"
#: read-cache.c
#, c-format
msgid "will not add file alias '%s' ('%s' already exists in index)"
msgstr ""
+"tidak akan menambahkan alias berkas '%s' ('%s' sudah ada di dalam indeks)"
#: read-cache.c
msgid "cannot create an empty blob in the object database"
-msgstr ""
+msgstr "tidak dapat membuat sebuah blob kosong di dalam basis data objek"
#: read-cache.c
#, c-format
msgid "%s: can only add regular files, symbolic links or git-directories"
msgstr ""
+"%s: hanya dapat menambahkan berkas reguler, tautan simbolik, atau direktori "
+"git"
#: read-cache.c
#, c-format
msgid "unable to index file '%s'"
-msgstr ""
+msgstr "tidak dapat menulis berkas indeks '%s'"
#: read-cache.c
#, c-format
msgid "unable to add '%s' to index"
-msgstr ""
-
-#: read-cache.c
-#, c-format
-msgid "unable to stat '%s'"
-msgstr ""
+msgstr "tidak dapat menambahkan '%s' ke indeks"
#: read-cache.c
#, c-format
msgid "'%s' appears as both a file and as a directory"
-msgstr ""
+msgstr "'%s' muncul baik sebagai sebuah berkas dan sebagai sebuah direktori"
#: read-cache.c
msgid "Refresh index"
-msgstr ""
+msgstr "Segarkan indeks indeks"
#: read-cache.c
#, c-format
@@ -22139,6 +23339,8 @@ msgid ""
"index.version set, but the value is invalid.\n"
"Using version %i"
msgstr ""
+"index.version disetel, tetapi nilainya tidak valid.\n"
+"Menggunakan versi %i"
#: read-cache.c
#, c-format
@@ -22146,137 +23348,144 @@ msgid ""
"GIT_INDEX_VERSION set, but the value is invalid.\n"
"Using version %i"
msgstr ""
+"GIT_INDEX_VERSION disetel, tetapi nilainya tidak valid.\n"
+"Menggunakan versi %i"
#: read-cache.c
#, c-format
msgid "bad signature 0x%08x"
-msgstr ""
+msgstr "tandatangan 0x%08x jelek"
#: read-cache.c
#, c-format
msgid "bad index version %d"
-msgstr ""
+msgstr "versi indeks %d jelek"
#: read-cache.c
msgid "bad index file sha1 signature"
-msgstr ""
+msgstr "tandatangan sha1 berkas indeks jelek"
#: read-cache.c
#, c-format
msgid "index uses %.4s extension, which we do not understand"
-msgstr ""
+msgstr "indeks menggunakan ekstensi %s, yang kami tidak mengerti"
#: read-cache.c
#, c-format
msgid "ignoring %.4s extension"
-msgstr ""
+msgstr "mengabaikan ekstensi %.4s"
#: read-cache.c
#, c-format
msgid "unknown index entry format 0x%08x"
-msgstr ""
+msgstr "format entri indeks 0x%08x tidak dikenal"
#: read-cache.c
#, c-format
msgid "malformed name field in the index, near path '%s'"
-msgstr ""
+msgstr "bidang nama di dalam indeks rusak, di dekat jalur '%s'"
#: read-cache.c
msgid "unordered stage entries in index"
-msgstr ""
+msgstr "entri gelaran tidak terurut di dalam indeks"
#: read-cache.c
#, c-format
msgid "multiple stage entries for merged file '%s'"
-msgstr ""
+msgstr "banyak entri gelaran untuk berkas tergabung '%s'"
#: read-cache.c
#, c-format
msgid "unordered stage entries for '%s'"
-msgstr ""
+msgstr "entri gelaran tidak terurut untuk '%s'"
#: read-cache.c
#, c-format
msgid "unable to create load_cache_entries thread: %s"
-msgstr ""
+msgstr "tidak dapat membuat utas load_cache_entries: %s"
#: read-cache.c
#, c-format
msgid "unable to join load_cache_entries thread: %s"
-msgstr ""
+msgstr "tidak dapat menggabungkan utas load_cache_entries: %s"
#: read-cache.c
#, c-format
msgid "%s: index file open failed"
-msgstr ""
+msgstr "%s: gagal membuka berkas indeks"
#: read-cache.c
#, c-format
msgid "%s: cannot stat the open index"
-msgstr ""
+msgstr "%s: tidak dapat men-stat indeks terbuka"
#: read-cache.c
#, c-format
msgid "%s: index file smaller than expected"
-msgstr ""
+msgstr "%s: berkas indeks lebih kecil dari yang diharapkan"
#: read-cache.c
#, c-format
msgid "%s: unable to map index file%s"
-msgstr ""
+msgstr "%s: tidak dapat memetakan berkas indeks%s"
#: read-cache.c
#, c-format
msgid "unable to create load_index_extensions thread: %s"
-msgstr ""
+msgstr "tidak dapat membuat utas load_index_extensions: %s"
#: read-cache.c
#, c-format
msgid "unable to join load_index_extensions thread: %s"
-msgstr ""
+msgstr "tidak dapat menggabungkan utas load_index_extensions: %s"
#: read-cache.c
#, c-format
msgid "could not freshen shared index '%s'"
-msgstr ""
+msgstr "tidak dapat menyegarkan indeks berbagi '%s'"
#: read-cache.c
#, c-format
msgid "broken index, expect %s in %s, got %s"
-msgstr ""
+msgstr "indeks rusak, mengharapkan %s di %s, dapat %s"
#: read-cache.c
msgid "cannot write split index for a sparse index"
-msgstr ""
+msgstr "tidak dapat membuat indeks terpisah untuk indeks jarang"
#: read-cache.c
msgid "failed to convert to a sparse-index"
-msgstr ""
-
-#: read-cache.c
-#, c-format
-msgid "could not stat '%s'"
-msgstr ""
+msgstr "gagal mengubah ke indeks jarang"
#: read-cache.c
#, c-format
msgid "unable to open git dir: %s"
-msgstr ""
+msgstr "tidak dapat membuka direktori git: %s"
#: read-cache.c
#, c-format
msgid "unable to unlink: %s"
-msgstr ""
+msgstr "tidak dapat membatal tautan: %s"
#: read-cache.c
#, c-format
msgid "cannot fix permission bits on '%s'"
-msgstr ""
+msgstr "tidak dapat memperbaiki bit perizinan pada '%s'"
#: read-cache.c
#, c-format
msgid "%s: cannot drop to stage #0"
-msgstr ""
+msgstr "%s: tidak dapat menurunkan ke tahap #0"
+
+#: read-cache.c
+#, c-format
+msgid "unexpected diff status %c"
+msgstr "status diff tak diharapkan %c"
+
+#: read-cache.c
+#, c-format
+msgid "remove '%s'\n"
+msgstr "hapus '%s'\n"
#: rebase-interactive.c
msgid ""
@@ -22313,9 +23522,12 @@ msgid ""
"l, label <label> = label current HEAD with a name\n"
"t, reset <label> = reset HEAD to a label\n"
"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
-". create a merge commit using the original merge commit's\n"
-". message (or the oneline, if no original merge commit was\n"
-". specified); use -c <commit> to reword the commit message\n"
+" create a merge commit using the original merge commit's\n"
+" message (or the oneline, if no original merge commit was\n"
+" specified); use -c <commit> to reword the commit message\n"
+"u, update-ref <ref> = track a placeholder for the <ref> to be updated\n"
+" to this position in the new commits. The <ref> is\n"
+" updated at the end of the rebase\n"
"\n"
"These lines can be re-ordered; they are executed from top to bottom.\n"
msgstr ""
@@ -22326,20 +23538,23 @@ msgstr ""
"e, edit <komit> = gunakan komit, tapi berhenti untuk amandemen\n"
"s, squash <komit> = gunakan komit, tapi lebur ke komit sebelumnya\n"
"f, fixup [-C | -c] <komit> = seperti \"squash\" tapi hanya pertahankan\n"
-" pesan komit sebelumnya, kecuali -C digunakan, dimana\n"
-" hanya pertahankan pesan komit ini; -c sama dengan -C "
-"tapi\n"
-" buka penyuntingx, exec <perintah> = jalankan perintah "
-"(sisa baris) menggunakan cangkang\n"
+" pesan komit sebelumnya; kecuali -C digunakan, dimana\n"
+" hanya pertahankan pesan komit ini; -c sama dengan -C\n"
+" tapi buka penyunting\n"
+"x, exec <perintah> = jalankan perintah (sisa baris) menggunakan cangkang\n"
"b, break = berhenti disini (lanjutkan pendasaran ulang nanti dengan 'git "
"rebase --continue')\n"
"d, drop <komit> = hapus komit\n"
"l, label <label> = tandai HEAD saat ini dengan nama\n"
"t, reset <label> = setel ulang HEAD ke sebuah label\n"
"m, merge [-C <komit> | -c <komit>] <label> [# <satu baris>]\n"
-". buat komit penggabungan dengan pesan komit penggabungan asli\n"
-". (atau satu baris, jika tidak ada komit penggabungan asli yang\n"
-". disebutkan); gunakan -c <komit> untuk menulis ulang pesan komit\n"
+" buat komit penggabungan dengan pesan komit penggabungan asli\n"
+" (atau satu baris, jika tidak ada komit penggabungan asli yang\n"
+" disebutkan); gunakan -c <komit> untuk menulis ulang pesan komit\n"
+"u, update-ref <referensi> = lacak tempat penampung untuk <referensi> yang\n"
+" akan diperbarui ke posisi ini di dalam komit\n"
+" baru. <referensi> diperbarui pada "
+"akhir pendasaran ulang.\n"
"\n"
"Baris diatas dapat disusun ulang; hal itu dieksekusi dari atas ke bawah.\n"
@@ -22431,245 +23646,264 @@ msgstr "%s: 'preserve' digantikan oleh 'merges'"
#: ref-filter.c wt-status.c
msgid "gone"
-msgstr ""
+msgstr "pergi"
#: ref-filter.c
#, c-format
msgid "ahead %d"
-msgstr ""
+msgstr "di depan %d"
#: ref-filter.c
#, c-format
msgid "behind %d"
-msgstr ""
+msgstr "di belakang %d"
#: ref-filter.c
#, c-format
msgid "ahead %d, behind %d"
-msgstr ""
+msgstr "di depan %d, di belakang %d"
+
+#: ref-filter.c
+#, c-format
+msgid "%%(%.*s) does not take arguments"
+msgstr "%%(%.*s) tidak mengambil argumen"
+
+#: ref-filter.c
+#, c-format
+msgid "unrecognized %%(%.*s) argument: %s"
+msgstr "argumen %%(%.*s) tidak dikenal: %s"
#: ref-filter.c
#, c-format
msgid "expected format: %%(color:<color>)"
-msgstr ""
+msgstr "format yang diharapkan: %%(color:<warna>)"
#: ref-filter.c
#, c-format
msgid "unrecognized color: %%(color:%s)"
-msgstr ""
+msgstr "warna tidak dikenal: %%(color:%s)"
#: ref-filter.c
#, c-format
msgid "Integer value expected refname:lstrip=%s"
-msgstr ""
+msgstr "Nilai bilangan bulat diharapkan refname:lstrip=%s"
#: ref-filter.c
#, c-format
msgid "Integer value expected refname:rstrip=%s"
-msgstr ""
+msgstr "Nilai bilangan bulat diharapkan refname:rstrip=%s"
#: ref-filter.c
#, c-format
-msgid "unrecognized %%(%s) argument: %s"
-msgstr ""
+msgid "expected %%(trailers:key=<value>)"
+msgstr "diharapkan %%(trailers:key=<nilai>)"
#: ref-filter.c
#, c-format
-msgid "%%(objecttype) does not take arguments"
-msgstr ""
+msgid "unknown %%(trailers) argument: %s"
+msgstr "argumen %%(trailers) tidak dikenal: %s"
#: ref-filter.c
#, c-format
-msgid "%%(deltabase) does not take arguments"
-msgstr ""
+msgid "positive value expected contents:lines=%s"
+msgstr "nilai positif diharapkan contents:lines=%s"
#: ref-filter.c
#, c-format
-msgid "%%(body) does not take arguments"
-msgstr ""
+msgid "argument expected for %s"
+msgstr "argumen diharapkan untuk %s"
#: ref-filter.c
#, c-format
-msgid "expected %%(trailers:key=<value>)"
-msgstr ""
+msgid "positive value expected %s=%s"
+msgstr "nilai positif %s=%s diharapkan"
#: ref-filter.c
#, c-format
-msgid "unknown %%(trailers) argument: %s"
-msgstr ""
+msgid "cannot fully parse %s=%s"
+msgstr "tidak dapat menguraikan penuh %s=%s"
#: ref-filter.c
#, c-format
-msgid "positive value expected contents:lines=%s"
-msgstr ""
+msgid "value expected %s="
+msgstr "nilai %s= diharapkan"
#: ref-filter.c
#, c-format
msgid "positive value expected '%s' in %%(%s)"
-msgstr ""
-
-#: ref-filter.c
-#, c-format
-msgid "unrecognized email option: %s"
-msgstr ""
+msgstr "nilai positif '%s' diharapkan di %%(%s)"
#: ref-filter.c
#, c-format
msgid "expected format: %%(align:<width>,<position>)"
-msgstr ""
+msgstr "format diharapkan: %%(align:<lebar>,<posisi>)"
#: ref-filter.c
#, c-format
msgid "unrecognized position:%s"
-msgstr ""
+msgstr "posisi tidak dikenal: %s"
#: ref-filter.c
#, c-format
msgid "unrecognized width:%s"
-msgstr ""
+msgstr "lebar tidak dikenal: %s"
+
+#: ref-filter.c
+#, c-format
+msgid "unrecognized %%(%s) argument: %s"
+msgstr "argumen %%(%s) tidak dikenal: %s"
#: ref-filter.c
#, c-format
msgid "positive width expected with the %%(align) atom"
-msgstr ""
+msgstr "lebar positif diharapkan dengan atom %%(align)"
#: ref-filter.c
#, c-format
-msgid "%%(rest) does not take arguments"
-msgstr ""
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "format yang diharapkan: %%(ahead-behind:<mirip komit>)"
#: ref-filter.c
#, c-format
msgid "malformed field name: %.*s"
-msgstr ""
+msgstr "nama bidang rusak: %.*s"
#: ref-filter.c
#, c-format
msgid "unknown field name: %.*s"
-msgstr ""
+msgstr "nama bidang tidak dikenal: %.*s"
#: ref-filter.c
#, c-format
msgid ""
"not a git repository, but the field '%.*s' requires access to object data"
msgstr ""
+"bukan sebuah repositori git, tapi bidang '%.*s' butuh akses ke data objek"
#: ref-filter.c
#, c-format
msgid "format: %%(%s) atom used without a %%(%s) atom"
-msgstr ""
+msgstr "format: atom %%(%s) digunakan tanpa sebuah atom %%(%s)"
#: ref-filter.c
#, c-format
msgid "format: %%(then) atom used more than once"
-msgstr ""
+msgstr "format: atom%%(then) digunakan lebih dari sekali"
#: ref-filter.c
#, c-format
msgid "format: %%(then) atom used after %%(else)"
-msgstr ""
+msgstr "format: atom %%(then) digunakan setelah %%(else)"
#: ref-filter.c
#, c-format
msgid "format: %%(else) atom used more than once"
-msgstr ""
+msgstr "format: atom %%(else) digunakan lebih dari sekali"
#: ref-filter.c
#, c-format
msgid "format: %%(end) atom used without corresponding atom"
-msgstr ""
+msgstr "format: atom %%(end) digunakan tanpa atom yang bersesuaian"
#: ref-filter.c
#, c-format
msgid "malformed format string %s"
-msgstr ""
+msgstr "untai format %s rusak"
#: ref-filter.c
#, c-format
msgid "this command reject atom %%(%.*s)"
-msgstr ""
+msgstr "perintah ini menolak atom %%(%.*s)"
#: ref-filter.c
#, c-format
msgid "--format=%.*s cannot be used with --python, --shell, --tcl"
-msgstr ""
+msgstr "--format=%.*s tidak dapat digunakan dengan --python, --shell, --tcl"
+
+#: ref-filter.c
+msgid "failed to run 'describe'"
+msgstr "gagal menjalankan 'describe'"
#: ref-filter.c
#, c-format
msgid "(no branch, rebasing %s)"
-msgstr ""
+msgstr "(tanpa cabang, mendasarkan ulang %s)"
#: ref-filter.c
#, c-format
msgid "(no branch, rebasing detached HEAD %s)"
-msgstr ""
+msgstr "(tanpa cabang, mendasarkan ulang HEAD tercopot %s)"
#: ref-filter.c
#, c-format
msgid "(no branch, bisect started on %s)"
-msgstr ""
+msgstr "(tanpa cabang, pembagian dua dimulai pada %s)"
#: ref-filter.c
#, c-format
msgid "(HEAD detached at %s)"
-msgstr ""
+msgstr "(HEAD tercopot pada %s)"
#: ref-filter.c
#, c-format
msgid "(HEAD detached from %s)"
-msgstr ""
+msgstr "(HEAD tercopot dari %s)"
#: ref-filter.c
msgid "(no branch)"
-msgstr ""
+msgstr "(tanpa cabang)"
#: ref-filter.c
#, c-format
msgid "missing object %s for %s"
-msgstr ""
+msgstr "objek %s hilang untuk %s"
#: ref-filter.c
#, c-format
msgid "parse_object_buffer failed on %s for %s"
-msgstr ""
+msgstr "parse_object_buffer gagal pada %s untuk %s"
#: ref-filter.c
#, c-format
msgid "malformed object at '%s'"
-msgstr ""
+msgstr "objek rusak pada '%s'"
#: ref-filter.c
#, c-format
msgid "ignoring ref with broken name %s"
-msgstr ""
+msgstr "mengabaikan referensi dengan nama rusak %s"
#: ref-filter.c refs.c
#, c-format
msgid "ignoring broken ref %s"
-msgstr ""
+msgstr "mengabaikan referensi rusak %s"
#: ref-filter.c
#, c-format
msgid "format: %%(end) atom missing"
-msgstr ""
+msgstr "format: atom %%(end) hilang"
#: ref-filter.c
#, c-format
msgid "malformed object name %s"
-msgstr ""
+msgstr "nama objek rusak %s"
#: ref-filter.c
#, c-format
msgid "option `%s' must point to a commit"
-msgstr ""
+msgstr "opsi `%s' harus menunjuk pada sebuah komit"
#: ref-filter.h
msgid "key"
-msgstr ""
+msgstr "kunci"
#: ref-filter.h
msgid "field name to sort on"
-msgstr ""
+msgstr "nama bidang untuk diurutkan"
+
+#: ref-filter.h
+msgid "exclude refs which match pattern"
+msgstr "hanya gunakan referensi yang cocok dengan pola"
#: reflog.c
#, c-format
@@ -22776,17 +24010,12 @@ msgstr "'%s' ada; tidak dapat membuat '%s'"
msgid "cannot process '%s' and '%s' at the same time"
msgstr "tidak dapat memproses '%s' dan '%s' pada waktu yang bersamaan"
-#: refs/files-backend.c
-#, c-format
-msgid "could not remove reference %s"
-msgstr "tidak dapat menghapus referensi %s"
-
-#: refs/files-backend.c refs/packed-backend.c
+#: refs.c
#, c-format
msgid "could not delete reference %s: %s"
msgstr "tidak dapat menghapus referensi %s: %s"
-#: refs/files-backend.c refs/packed-backend.c
+#: refs.c
#, c-format
msgid "could not delete references: %s"
msgstr "tidak dapat menghapus referensi: %s"
@@ -22799,139 +24028,150 @@ msgstr "spek referensi tidak valid '%s'"
#: remote-curl.c
#, c-format
msgid "invalid quoting in push-option value: '%s'"
-msgstr ""
+msgstr "kuotasi tidak valid dalam nilai push-option: '%s'"
#: remote-curl.c
#, c-format
msgid "%sinfo/refs not valid: is this a git repository?"
-msgstr ""
+msgstr "%sinfo/refs tidak valid: apakah ini sebuah repositori git?"
#: remote-curl.c
msgid "invalid server response; expected service, got flush packet"
msgstr ""
+"tanggapan peladen tidak valid; mengharapkan layanan, dapat bilasan paket"
#: remote-curl.c
#, c-format
msgid "invalid server response; got '%s'"
-msgstr ""
+msgstr "tanggapan peladen tidak valid; dapat '%s'"
#: remote-curl.c
#, c-format
msgid "repository '%s' not found"
-msgstr ""
+msgstr "repositori '%s' tidak ditemukan"
#: remote-curl.c
#, c-format
msgid "Authentication failed for '%s'"
-msgstr ""
+msgstr "Autentikasi gagal untuk '%s'"
#: remote-curl.c
#, c-format
msgid "unable to access '%s' with http.pinnedPubkey configuration: %s"
-msgstr ""
+msgstr "tidak dapat mengakses '%s' dengan konfigurasi http.pinnedPubkey: %s"
#: remote-curl.c
#, c-format
msgid "unable to access '%s': %s"
-msgstr ""
+msgstr "tidak dapat mengakses '%s': %s"
#: remote-curl.c
#, c-format
msgid "redirecting to %s"
-msgstr ""
+msgstr "mengalihkan ke %s"
#: remote-curl.c
msgid "shouldn't have EOF when not gentle on EOF"
-msgstr ""
+msgstr "seharusnya tidak punya EOF ketika tidak lembut pada EOF"
#: remote-curl.c
msgid "remote server sent unexpected response end packet"
-msgstr ""
+msgstr "peladen remote mengirim paket ujung tanggapan yang tak diharapkan"
#: remote-curl.c
msgid "unable to rewind rpc post data - try increasing http.postBuffer"
msgstr ""
+"tidak dapat memutar ulang data post rpc - coba menaikkan http.postBuffer"
#: remote-curl.c
#, c-format
msgid "remote-curl: bad line length character: %.4s"
-msgstr ""
+msgstr "remote-curl: karakter panjang baris jelek : %.4s"
#: remote-curl.c
msgid "remote-curl: unexpected response end packet"
-msgstr ""
+msgstr "remote-curl: paket ujung tanggapan tidak diharapkan"
#: remote-curl.c
#, c-format
msgid "RPC failed; %s"
-msgstr ""
+msgstr "RPC gagal; %s"
#: remote-curl.c
msgid "cannot handle pushes this big"
-msgstr ""
+msgstr "tidak dapat menangani dorongan sebesar ini"
#: remote-curl.c
#, c-format
msgid "cannot deflate request; zlib deflate error %d"
-msgstr ""
+msgstr "tidak dapat mengempiskan permintaan; kesalahan mengempiskan zlib %d"
#: remote-curl.c
#, c-format
msgid "cannot deflate request; zlib end error %d"
-msgstr ""
+msgstr "tidak dapat mengempiskan permintaan; kesalahan ujung zlib %d"
#: remote-curl.c
#, c-format
msgid "%d bytes of length header were received"
-msgstr ""
+msgstr "%d bita dari kepala panjang diterima"
#: remote-curl.c
#, c-format
msgid "%d bytes of body are still expected"
-msgstr ""
+msgstr "%d bita badan masih diharapkan"
#: remote-curl.c
msgid "dumb http transport does not support shallow capabilities"
-msgstr ""
+msgstr "transportasi http bodoh tidak mendukung kemampuan dangkal"
#: remote-curl.c
msgid "fetch failed."
-msgstr ""
+msgstr "pengambilan gagal."
#: remote-curl.c
msgid "cannot fetch by sha1 over smart http"
-msgstr ""
+msgstr "tidak dapat mengambil oleh sha1 melalui http pintar"
#: remote-curl.c
#, c-format
msgid "protocol error: expected sha/ref, got '%s'"
-msgstr ""
+msgstr "kesalahan protokol: sha/referensi diharapkan, dapat '%s'"
#: remote-curl.c
#, c-format
msgid "http transport does not support %s"
-msgstr ""
+msgstr "transportasi http tidak mendukung %s"
+
+#: remote-curl.c
+msgid "protocol error: expected '<url> <path>', missing space"
+msgstr "kesalahan protokol: '<url> <jalur>' diharapkan, spasi hilang"
+
+#: remote-curl.c
+#, c-format
+msgid "failed to download file at URL '%s'"
+msgstr "gagal mengunduh berkas pada URL '%s'"
#: remote-curl.c
msgid "git-http-push failed"
-msgstr ""
+msgstr "git-http-push gagal"
#: remote-curl.c
msgid "remote-curl: usage: git remote-curl <remote> [<url>]"
-msgstr ""
+msgstr "remote-curl: penggunaan: git remote-curl <remote> [<url>]"
#: remote-curl.c
msgid "remote-curl: error reading command stream from git"
-msgstr ""
+msgstr "remote-curl: kesalahan membaca arus perintah dari git"
#: remote-curl.c
msgid "remote-curl: fetch attempted without a local repo"
-msgstr ""
+msgstr "remote-curl: pengambilan dicoba tanpa repositori lokal"
#: remote-curl.c
#, c-format
msgid "remote-curl: unknown command '%s' from git"
-msgstr ""
+msgstr "remote-curl: perintah tidak dikenal '%s' dari git"
#: remote.c
#, c-format
@@ -23010,9 +24250,9 @@ msgid ""
msgstr ""
"Tujuan yang Anda berikan bukan nama referensi penuh (seperti \n"
"dimulai dengan \"refs/\"). Kami mencoba menebak maksud Anda dengan:\n"
-"- Cari referensi yang cocok dengan '%s' pada sisi remote.\n"
-"- Perika apakah <src> yang sedang didorong ('%s') adalah \n"
-" referensi pada \"refs/{heads,tags}\". Bila demikian kami \n"
+"- mencari referensi yang cocok dengan '%s' pada sisi remote.\n"
+"- memeriksa apakah <src> yang sedang didorong ('%s') adalah \n"
+" referensi pada \"refs/{heads,tags}/\". Bila demikian kami \n"
" menambahkan awalan refs/{heads,tags}/ yang bersesuaian pada sisi \n"
" remote.\n"
"\n"
@@ -23176,7 +24416,9 @@ msgid "Your branch is behind '%s' by %d commit, and can be fast-forwarded.\n"
msgid_plural ""
"Your branch is behind '%s' by %d commits, and can be fast-forwarded.\n"
msgstr[0] ""
+"Cabang Anda di belakang '%s' oleh %d komit, dan bisa di maju-cepatkan.\n"
msgstr[1] ""
+"Cabang Anda di belakan '%s' oleh %d komit, dan bisa di maju-cepatkan.\n"
#: remote.c
msgid " (use \"git pull\" to update your local branch)\n"
@@ -23198,8 +24440,11 @@ msgstr[1] ""
"dan masing-masing punya %d dan %d komit berbeda.\n"
#: remote.c
-msgid " (use \"git pull\" to merge the remote branch into yours)\n"
-msgstr " (gunakan \"git pull\" untuk gabungkan cabang remote ke milik Anda)\n"
+msgid ""
+" (use \"git pull\" if you want to integrate the remote branch with yours)\n"
+msgstr ""
+" (gunakan \"git pull\" jika Anda ingin mengintegrasikan cabang remote pada\n"
+" milik Anda)\n"
#: remote.c
#, c-format
@@ -23214,17 +24459,17 @@ msgstr "tidak dapat mencopot satu komponen dari url '%s'"
#: replace-object.c
#, c-format
msgid "bad replace ref name: %s"
-msgstr ""
+msgstr "nama referensi pengganti jelek: %s"
#: replace-object.c
#, c-format
msgid "duplicate replace ref: %s"
-msgstr ""
+msgstr "referensi pengganti duplikat: %s"
#: replace-object.c
#, c-format
msgid "replace depth too high for object %s"
-msgstr ""
+msgstr "kedalaman penggantian terlalu tinggi untuk objek %s"
#: rerere.c
msgid "corrupt MERGE_RR"
@@ -23291,11 +24536,6 @@ msgstr "tidak ada resolusi yang diingat untuk '%s'"
#: rerere.c
#, c-format
-msgid "cannot unlink '%s'"
-msgstr "tidak dapat batal taut '%s'"
-
-#: rerere.c
-#, c-format
msgid "Updated preimage for '%s'"
msgstr "Pracitra diperbarui untuk '%s'"
@@ -23311,6 +24551,8 @@ msgstr "tidak dapat membuka direktori rr-cache"
#: rerere.h
msgid "update the index with reused conflict resolution if possible"
msgstr ""
+"perbarui indeks dengan resolusi konflik yang digunakan kembali bila "
+"memungkinkan"
#: reset.c
msgid "could not determine HEAD revision"
@@ -23322,10 +24564,34 @@ msgid "failed to find tree of %s"
msgstr "gagal menemukan pohon %s"
#: revision.c
+#, c-format
+msgid "unsupported section for hidden refs: %s"
+msgstr "seksi tidak didukung untuk referensi tersembunyi: %s"
+
+#: revision.c
+msgid "--exclude-hidden= passed more than once"
+msgstr "--exclude-hidden= dilewatkan lebih dari sekali"
+
+#: revision.c
+#, c-format
+msgid "resolve-undo records `%s` which is missing"
+msgstr "resolve-undo merekam `%s` yang dimana hilang"
+
+#: revision.c
+#, c-format
+msgid "could not get commit for ancestry-path argument %s"
+msgstr "tidak dapat mendapatkan komit untuk argumen jalur leluhur '%s'"
+
+#: revision.c
msgid "--unpacked=<packfile> no longer supported"
msgstr "--unpacked=<berkas pak> tidak didukung lagi"
#: revision.c
+#, c-format
+msgid "invalid option '%s' in --stdin mode"
+msgstr "opsi tidak valid: '%s' di mode --stdin"
+
+#: revision.c
msgid "your current branch appears to be broken"
msgstr "sepertinya cabang Anda saat ini rusak"
@@ -23345,7 +24611,259 @@ msgstr "-L belum mendukung format diff selain -p dan -s"
#: run-command.c
#, c-format
msgid "cannot create async thread: %s"
+msgstr "tidak dapat membuat utas async: %s"
+
+#: scalar.c worktree.c
+#, c-format
+msgid "'%s' does not exist"
+msgstr "'%s' tidak ada"
+
+#: scalar.c
+#, c-format
+msgid "could not switch to '%s'"
+msgstr "tidak dapat berganti ke '%s'"
+
+#: scalar.c
+msgid "need a working directory"
+msgstr "butuh sebuah direktori kerja"
+
+#: scalar.c
+msgid "Scalar enlistments require a worktree"
+msgstr "Pendaftaran scalar membutuhkan pohon kerja"
+
+#: scalar.c
+#, c-format
+msgid "could not configure %s=%s"
+msgstr "tidak dapat menyetel %s=%s"
+
+#: scalar.c
+msgid "could not configure log.excludeDecoration"
+msgstr "tidak dapat menyetel log.excludeDecoration"
+
+#: scalar.c
+msgid "could not add enlistment"
+msgstr "tidak dapat menambah pendaftaran"
+
+#: scalar.c
+msgid "could not set recommended config"
+msgstr "tidak dapat menyetel konfigurasi yang direkomendasikan"
+
+#: scalar.c
+msgid "could not turn on maintenance"
+msgstr "tidak dapat mengaktifkan pemeliharaan"
+
+#: scalar.c
+msgid "could not start the FSMonitor daemon"
+msgstr "tidak dapat menjalankan daemon FSMonitor"
+
+#: scalar.c
+msgid "could not turn off maintenance"
+msgstr "tidak dapat menonaktifkan pemeliharaan"
+
+#: scalar.c
+msgid "could not remove enlistment"
+msgstr "tidak dapat menghapus pendaftaran"
+
+#: scalar.c
+#, c-format
+msgid "remote HEAD is not a branch: '%.*s'"
+msgstr "HEAD remote bukan sebuah cabang: '%.*s'"
+
+#: scalar.c
+msgid "failed to get default branch name from remote; using local default"
+msgstr ""
+"gagal mendapatkan nama cabang asali dari remote; menggunakan asali lokal"
+
+#: scalar.c
+msgid "failed to get default branch name"
+msgstr "gagal mendapatkan nama cabang asali"
+
+#: scalar.c
+msgid "failed to unregister repository"
+msgstr "gagal menghapus pendaftaran repositori"
+
+#: scalar.c
+msgid "failed to stop the FSMonitor daemon"
+msgstr "gagal menghentikan daemon FSMonitor"
+
+#: scalar.c
+msgid "failed to delete enlistment directory"
+msgstr "gagal menghapus direktori pendaftaran"
+
+#: scalar.c
+msgid "branch to checkout after clone"
+msgstr "cabang untuk dicheckout setelah kloning"
+
+#: scalar.c
+msgid "when cloning, create full working directory"
+msgstr "ketika kloning, buat direktori kerja penuh"
+
+#: scalar.c
+msgid "only download metadata for the branch that will be checked out"
+msgstr "hanya unduh metadata untuk cabang yang akan dicheckout"
+
+#: scalar.c
+msgid "create repository within 'src' directory"
+msgstr "salin repositori di dalam direktori 'src'"
+
+#: scalar.c
+msgid ""
+"scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n"
+"\t[--[no-]src] <url> [<enlistment>]"
msgstr ""
+"scalar clone [--single-branch] [--branch <cabang utama>] [--full-clone]\n"
+"\t[--[-no-]src] <url> [<pendaftaran>]"
+
+#: scalar.c
+#, c-format
+msgid "cannot deduce worktree name from '%s'"
+msgstr "tidak dapat menyimpulkan nama pohon kerja dari '%s'"
+
+#: scalar.c
+#, c-format
+msgid "directory '%s' exists already"
+msgstr "direktori '%s' sudah ada"
+
+#: scalar.c
+#, c-format
+msgid "failed to get default branch for '%s'"
+msgstr "gagal mendapatkan cabang asali untuk '%s'"
+
+#: scalar.c
+#, c-format
+msgid "could not configure remote in '%s'"
+msgstr "tidak dapat menyetel remote di '%s'"
+
+#: scalar.c
+#, c-format
+msgid "could not configure '%s'"
+msgstr "tidak dapat menyetel '%s'"
+
+#: scalar.c
+msgid "partial clone failed; attempting full clone"
+msgstr "kloning parsial gagal; mencoba kloning penuh"
+
+#: scalar.c
+msgid "could not configure for full clone"
+msgstr "tidak dapat menyetel untuk kloning penuh"
+
+#: scalar.c
+msgid "scalar diagnose [<enlistment>]"
+msgstr "scalar diagnose [<pendaftaran>]"
+
+#: scalar.c
+msgid "`scalar list` does not take arguments"
+msgstr "`scalar list` tidak mengambil argumen"
+
+#: scalar.c
+msgid "scalar register [<enlistment>]"
+msgstr "scalar register [<pendaftaran>]"
+
+#: scalar.c
+msgid "reconfigure all registered enlistments"
+msgstr "konfigurasi ulang semua pendaftaran yang terdaftar"
+
+#: scalar.c
+msgid "scalar reconfigure [--all | <enlistment>]"
+msgstr "scalar reconfigure [--all | <pendaftaran>]"
+
+#: scalar.c
+msgid "--all or <enlistment>, but not both"
+msgstr "--all atau <pendaftaran>, tetapi bukan kedua-duanya"
+
+#: scalar.c
+#, c-format
+msgid "could not remove stale scalar.repo '%s'"
+msgstr "tidak dapat menghapus scalar.repo basi '%s'"
+
+#: scalar.c
+#, c-format
+msgid "removed stale scalar.repo '%s'"
+msgstr "menghapus scalar.repo basi '%s'"
+
+#: scalar.c
+#, c-format
+msgid "repository at '%s' has different owner"
+msgstr "repositori pada '%s' berpemilik lain"
+
+#: scalar.c
+#, c-format
+msgid "repository at '%s' has a format issue"
+msgstr "repositori pada '%s' ada masalah format"
+
+#: scalar.c
+#, c-format
+msgid "repository not found in '%s'"
+msgstr "repositori tidak ditemukan di '%s'"
+
+#: scalar.c
+#, c-format
+msgid ""
+"to unregister this repository from Scalar, run\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+msgstr ""
+"untuk mencabut repositori ini dari Scalar, jalankan\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+
+#: scalar.c
+msgid ""
+"scalar run <task> [<enlistment>]\n"
+"Tasks:\n"
+msgstr ""
+"scalar run <tugas> [<pendaftaran>]\n"
+"Tugas:\n"
+
+#: scalar.c
+#, c-format
+msgid "no such task: '%s'"
+msgstr "tidak ada tugas: '%s'"
+
+#: scalar.c
+msgid "scalar unregister [<enlistment>]"
+msgstr "scalar unregister [<pendaftaran>]"
+
+#: scalar.c
+msgid "scalar delete <enlistment>"
+msgstr "scalar delete <pendaftaran>"
+
+#: scalar.c
+msgid "refusing to delete current working directory"
+msgstr "menolak menghapus direktori kerja saat ini"
+
+#: scalar.c
+msgid "include Git version"
+msgstr "masukkan versi Git"
+
+#: scalar.c
+msgid "include Git's build options"
+msgstr "masukkan opsi bangun Git"
+
+#: scalar.c
+msgid "scalar verbose [-v | --verbose] [--build-options]"
+msgstr "scalar verbose [-v | --verbose] [--build-options]"
+
+#: scalar.c
+msgid "-C requires a <directory>"
+msgstr "-C butuh sebuah <direktori>"
+
+#: scalar.c
+#, c-format
+msgid "could not change to '%s'"
+msgstr "tidak dapat berganti ke '%s'"
+
+#: scalar.c
+msgid "-c requires a <key>=<value> argument"
+msgstr "-c butuh argumen <kunci>=<nilai>"
+
+#: scalar.c
+msgid ""
+"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
+"\n"
+"Commands:\n"
+msgstr ""
+"scalar [-C <direktori>] [-c <kunci>=<nilai>] perintah [<opsi>]\n"
+"\n"
+"Perintah:\n"
#: send-pack.c
msgid "unexpected flush packet while reading remote unpack status"
@@ -23469,11 +24987,6 @@ msgstr ""
msgid "could not lock '%s'"
msgstr "tidak dapat mengunci '%s'"
-#: sequencer.c strbuf.c wrapper.c
-#, c-format
-msgid "could not write to '%s'"
-msgstr "tidak dapat menulis ke '%s'"
-
#: sequencer.c
#, c-format
msgid "could not write eol to '%s'"
@@ -23493,11 +25006,6 @@ msgstr "perubahan lokal Anda akan ditimpa oleh %s."
msgid "commit your changes or stash them to proceed."
msgstr "komit perubahan Anda atau stase untuk melanjutkan."
-#: sequencer.c
-#, c-format
-msgid "%s: fast-forward"
-msgstr "%s: maju-cepat"
-
#. TRANSLATORS: %s will be "revert", "cherry-pick" or
#. "rebase".
#.
@@ -23684,7 +25192,7 @@ msgstr "identitas pengarang tidak valid '%s'"
msgid "corrupt author: missing date information"
msgstr "pengarang rusak: informasi tanggal hilang"
-#: sequencer.c t/helper/test-fast-rebase.c
+#: sequencer.c
#, c-format
msgid "could not update %s"
msgstr "tidak dapat memperbarui %s"
@@ -23781,11 +25289,6 @@ msgstr "%s: tidak dapat menguraikan komit induk %s"
#: sequencer.c
#, c-format
-msgid "could not rename '%s' to '%s'"
-msgstr "tidak dapat menamai ulang '%s' ke '%s'"
-
-#: sequencer.c
-#, c-format
msgid "could not revert %s... %s"
msgstr "tidak dapat membalikkan %s... %s"
@@ -23811,6 +25314,28 @@ msgstr "git %s: gagal menyegarkan indeks"
#: sequencer.c
#, c-format
+msgid "'%s' is not a valid label"
+msgstr "'%s' bukan label valid"
+
+#: sequencer.c
+#, c-format
+msgid "'%s' is not a valid refname"
+msgstr "'%s' bukan nama referensi valid"
+
+#: sequencer.c
+#, c-format
+msgid "update-ref requires a fully qualified refname e.g. refs/heads/%s"
+msgstr ""
+"update-ref memerlukan nama referensi terkualifikasi penuh, misalnya refs/"
+"heads/%s"
+
+#: sequencer.c
+#, c-format
+msgid "invalid command '%.*s'"
+msgstr "perintah tidak valid '%.*s'"
+
+#: sequencer.c
+#, c-format
msgid "%s does not accept arguments: '%s'"
msgstr "%s tidak menerima argumen: '%s'"
@@ -23900,10 +25425,6 @@ msgid "could not create sequencer directory '%s'"
msgstr "tidak dapat membuat direktori pembaris '%s'"
#: sequencer.c
-msgid "could not lock HEAD"
-msgstr "tidak dapat mengunci HEAD"
-
-#: sequencer.c
msgid "no cherry-pick or revert in progress"
msgstr "tidak ada pemetikan ceri atau pembalikkan yang sedang berjalan"
@@ -24019,21 +25540,21 @@ msgstr ""
"\n"
#: sequencer.c
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "dan buat perubahan ke indeks dan/atau pohon kerja\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "dan buat perubahan ke indeks dan/atau pohon kerja.\n"
#: sequencer.c
#, c-format
msgid ""
"execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
"Commit or stash your changes, and then run\n"
"\n"
" git rebase --continue\n"
"\n"
msgstr ""
"eksekusi berhasil: %s\n"
-"tapi meninggalkan perubahan ke indeks dan/atau pohon kerja\n"
+"tapi meninggalkan perubahan ke indeks dan/atau pohon kerja.\n"
"Komit atau stase perubahan Anda, lalu jalankan\n"
"\n"
" git rebase --continue\n"
@@ -24045,6 +25566,11 @@ msgid "illegal label name: '%.*s'"
msgstr "nama label ilegal: '%.*s'"
#: sequencer.c
+#, c-format
+msgid "could not resolve '%s'"
+msgstr "tidak dapat menguraikan '%s'"
+
+#: sequencer.c
msgid "writing fake root commit"
msgstr "menulis komit akar palsu"
@@ -24053,11 +25579,6 @@ msgid "writing squash-onto"
msgstr "menulis squash-onto"
#: sequencer.c
-#, c-format
-msgid "could not resolve '%s'"
-msgstr "tidak dapat menguraikan '%s'"
-
-#: sequencer.c
msgid "cannot merge without a current revision"
msgstr "tidak dapat menggabungkan tanpa revisi saat ini"
@@ -24090,6 +25611,30 @@ msgid "merge: Unable to write new index file"
msgstr "merge: Tidak dapat menulis berkas indeks baru"
#: sequencer.c
+#, c-format
+msgid ""
+"another 'rebase' process appears to be running; '%s.lock' already exists"
+msgstr "sepertinya proses 'rebase' lainnya berjalan; '%s.lock' sudah ada"
+
+#: sequencer.c
+#, c-format
+msgid ""
+"Updated the following refs with %s:\n"
+"%s"
+msgstr ""
+"Referensi berikut diperbarui dengan %s:\n"
+"%s"
+
+#: sequencer.c
+#, c-format
+msgid ""
+"Failed to update the following refs with %s:\n"
+"%s"
+msgstr ""
+"Gagal memperbarui referensi berikut dengan %s:\n"
+"%s"
+
+#: sequencer.c
msgid "Cannot autostash"
msgstr "Tidak dapat menstase otomatis"
@@ -24142,6 +25687,10 @@ msgid "Autostash exists; creating a new stash entry."
msgstr "Stase otomatis sudah ada; membuat entri stase baru."
#: sequencer.c
+msgid "autostash reference is a symref"
+msgstr "referensi autostase itu referensi simbolik"
+
+#: sequencer.c
msgid "could not detach HEAD"
msgstr "tidak dapat melepas HEAD"
@@ -24178,13 +25727,13 @@ msgstr ""
#: sequencer.c
#, c-format
-msgid "Rebasing (%d/%d)%s"
-msgstr "Mendasarkan ulang (%d/%d)%s"
+msgid "Stopped at %s... %.*s\n"
+msgstr "Berhenti pada %s... %.*s\n"
#: sequencer.c
#, c-format
-msgid "Stopped at %s... %.*s\n"
-msgstr "Berhenti pada %s... %.*s\n"
+msgid "Rebasing (%d/%d)%s"
+msgstr "Mendasarkan ulang (%d/%d)%s"
#: sequencer.c
#, c-format
@@ -24293,6 +25842,11 @@ msgstr "tidak dapat melewatkan perintah pick yang tidak perlu"
msgid "the script was already rearranged."
msgstr "skrip sudah ditata ulang."
+#: sequencer.c
+#, c-format
+msgid "update-refs file at '%s' is invalid"
+msgstr "berkas update-refs pada '%s' tidak valid"
+
#: setup.c
#, c-format
msgid "'%s' is outside repository at '%s'"
@@ -24438,18 +25992,24 @@ msgstr ""
#: setup.c
#, c-format
msgid ""
-"unsafe repository ('%s' is owned by someone else)\n"
-"To add an exception for this directory, call:\n"
+"detected dubious ownership in repository at '%s'\n"
+"%sTo add an exception for this directory, call:\n"
"\n"
"\tgit config --global --add safe.directory %s"
msgstr ""
-"repositori tidak aman ('%s' dimiliki oleh orang lain)\n"
-"Untuk menambahkan pengecualian untuk direktori ini, panggil:\n"
+"perizinan meragukan terdeteksi di dalam repositori pada '%s'\n"
+"%sUntuk menambahkan pengecualian untuk direktori ini, panggil:\n"
"\n"
"\tgit config --global --add safe.directory %s"
#: setup.c
#, c-format
+msgid "cannot use bare repository '%s' (safe.bareRepository is '%s')"
+msgstr ""
+"tidak dapat menggunakan repositori bare '%s' (safe.bareRepository yaitu '%s')"
+
+#: setup.c
+#, c-format
msgid ""
"problem with core.sharedRepository filemode value (0%.3o).\n"
"The owner of files must always have read and write permissions."
@@ -24465,6 +26025,102 @@ msgstr "penggarpuan gagal"
msgid "setsid failed"
msgstr "setsid gagal"
+#: setup.c
+#, c-format
+msgid "cannot stat template '%s'"
+msgstr "tidak dapat men-stat templat '%s'"
+
+#: setup.c
+#, c-format
+msgid "cannot opendir '%s'"
+msgstr "tidak dapat membuka direktori '%s'"
+
+#: setup.c
+#, c-format
+msgid "cannot readlink '%s'"
+msgstr "tidak dapat membaca tautan '%s'"
+
+#: setup.c
+#, c-format
+msgid "cannot symlink '%s' '%s'"
+msgstr "tidak dapat menautkan simbolik '%s' '%s'"
+
+#: setup.c
+#, c-format
+msgid "cannot copy '%s' to '%s'"
+msgstr "tidak dapat menyalin '%s' ke '%s'"
+
+#: setup.c
+#, c-format
+msgid "ignoring template %s"
+msgstr "mengabaikan templat %s"
+
+#: setup.c
+#, c-format
+msgid "templates not found in %s"
+msgstr "templat tidak ditemukan di %s"
+
+#: setup.c
+#, c-format
+msgid "not copying templates from '%s': %s"
+msgstr "tidak menyalin templat dari '%s': %s"
+
+#: setup.c
+#, c-format
+msgid "invalid initial branch name: '%s'"
+msgstr "nama cabang asal salah: '%s'"
+
+#: setup.c
+#, c-format
+msgid "re-init: ignored --initial-branch=%s"
+msgstr "re-init: --initial-branch=%s diabaikan"
+
+#: setup.c
+#, c-format
+msgid "unable to handle file type %d"
+msgstr "tidak dapat menangani tipe berkas %d"
+
+#: setup.c
+#, c-format
+msgid "unable to move %s to %s"
+msgstr "tidak dapat memindahkan %s ke %s"
+
+#: setup.c
+msgid "attempt to reinitialize repository with different hash"
+msgstr "mencoba menginisialisasi ulang repositori dengan hash yang berbeda"
+
+#: setup.c
+msgid ""
+"attempt to reinitialize repository with different reference storage format"
+msgstr ""
+"mencoba menginisialisasi ulang repositori dengan format penyimpanan "
+"referensi yang berbeda"
+
+#: setup.c
+#, c-format
+msgid "%s already exists"
+msgstr "%s sudah ada"
+
+#: setup.c
+#, c-format
+msgid "Reinitialized existing shared Git repository in %s%s\n"
+msgstr "Repositori berbagi Git yang sudah ada diinisialisasi ulang di %s%s\n"
+
+#: setup.c
+#, c-format
+msgid "Reinitialized existing Git repository in %s%s\n"
+msgstr "Repositori Git diinisialisasi ulang di %s%s\n"
+
+#: setup.c
+#, c-format
+msgid "Initialized empty shared Git repository in %s%s\n"
+msgstr "Repositori berbagi Git kosong diinisialisasi di %s%s\n"
+
+#: setup.c
+#, c-format
+msgid "Initialized empty Git repository in %s%s\n"
+msgstr "Repositori Git kosong dinisialisasi di %s%s\n"
+
#: sparse-index.c
#, c-format
msgid "index entry is a directory, but not sparse (%08x)"
@@ -24526,11 +26182,6 @@ msgid_plural "%u bytes/s"
msgstr[0] "%u bita/detik"
msgstr[1] "%u bita/detik"
-#: strbuf.c
-#, c-format
-msgid "could not edit '%s'"
-msgstr "tidak dapat menyunting '%s'"
-
#: submodule-config.c
#, c-format
msgid "ignoring suspicious submodule name: %s"
@@ -24749,100 +26400,121 @@ msgstr "ls-tree kembalikan kode kembali %d yang tak diharapkan"
msgid "failed to lstat '%s'"
msgstr "gagal men-lstat '%s'"
-#: t/helper/test-fast-rebase.c
-msgid "unhandled options"
-msgstr ""
+#: t/helper/test-bundle-uri.c
+msgid "no remote configured to get bundle URIs from"
+msgstr "tidak ada remote yang dikonfigurasi untuk mendapatkan URI bundel"
-#: t/helper/test-fast-rebase.c
-msgid "error preparing revisions"
-msgstr ""
+#: t/helper/test-bundle-uri.c
+#, c-format
+msgid "remote '%s' has no configured URL"
+msgstr "remote '%s' tidak punya URL terkonfigurasi"
+
+#: t/helper/test-bundle-uri.c
+msgid "could not get the bundle-uri list"
+msgstr "tidak dapat mendapatkan daftar bundle-uri"
+
+#: t/helper/test-cache-tree.c
+msgid "test-tool cache-tree <options> (control|prime|update)"
+msgstr "test-tool cache-tree <opsi> (control|prime|update)"
+
+#: t/helper/test-cache-tree.c
+msgid "clear the cache tree before each iteration"
+msgstr "bersihkan pohon tembolok sebelum setiap iterasi"
+
+#: t/helper/test-cache-tree.c
+msgid "number of entries in the cache tree to invalidate (default 0)"
+msgstr "jumlah entri di dalam pohon tembolok untuk dinirvalidasi (asali 0)"
#: t/helper/test-reach.c
#, c-format
msgid "commit %s is not marked reachable"
-msgstr ""
+msgstr "komit %s tidak ditandai sebagai dapat dicapai"
#: t/helper/test-reach.c
msgid "too many commits marked reachable"
-msgstr ""
+msgstr "terlalu banyak komit yang ditandai sebagai dapat dicapai"
#: t/helper/test-serve-v2.c
msgid "test-tool serve-v2 [<options>]"
-msgstr ""
+msgstr "test-tool serve-v2 [<opsi>]"
#: t/helper/test-serve-v2.c
msgid "exit immediately after advertising capabilities"
-msgstr ""
+msgstr "langsung keluar setelah mengiklankan kemampuan"
#: t/helper/test-simple-ipc.c
msgid "test-helper simple-ipc is-active [<name>] [<options>]"
-msgstr ""
+msgstr "test-helper simple-ipc is-active [<nama>] [<opsi>]"
#: t/helper/test-simple-ipc.c
msgid "test-helper simple-ipc run-daemon [<name>] [<threads>]"
-msgstr ""
+msgstr "test-helper simple-ipc run-daemon [<nama>] [<utas>]"
#: t/helper/test-simple-ipc.c
msgid "test-helper simple-ipc start-daemon [<name>] [<threads>] [<max-wait>]"
msgstr ""
+"test-helper simple-ipc start-daemon [<nama>] [<utas>] [<tunggu maksimum>]"
#: t/helper/test-simple-ipc.c
msgid "test-helper simple-ipc stop-daemon [<name>] [<max-wait>]"
-msgstr ""
+msgstr "test-helper simple-ipc stop-daemon [<nama> [<tunggu maksimum>]"
#: t/helper/test-simple-ipc.c
msgid "test-helper simple-ipc send [<name>] [<token>]"
-msgstr ""
+msgstr "test-helper simple-ipc send [<nama>] [<token>]"
#: t/helper/test-simple-ipc.c
msgid "test-helper simple-ipc sendbytes [<name>] [<bytecount>] [<byte>]"
msgstr ""
+"test-helper simple-ipc sendbytes [<nama>] [<hitungan bita>] [<bita>]"
#: t/helper/test-simple-ipc.c
msgid ""
"test-helper simple-ipc multiple [<name>] [<threads>] [<bytecount>] "
"[<batchsize>]"
msgstr ""
+"test-helper simple-ipc multiple [<nama>] [<utas>] [<hitungan bita>] "
+"[<ukuran batch>]"
#: t/helper/test-simple-ipc.c
msgid "name or pathname of unix domain socket"
-msgstr ""
+msgstr "nama atau nama jalur soket domain unix"
#: t/helper/test-simple-ipc.c
msgid "named-pipe name"
-msgstr ""
+msgstr "nama pipa bernama"
#: t/helper/test-simple-ipc.c
msgid "number of threads in server thread pool"
-msgstr ""
+msgstr "jumlah utas pada kolam utas peladen"
#: t/helper/test-simple-ipc.c
msgid "seconds to wait for daemon to start or stop"
-msgstr ""
+msgstr "waktu menunggu daemon dimulai atau dihentikan (dalam detik)"
#: t/helper/test-simple-ipc.c
msgid "number of bytes"
-msgstr ""
+msgstr "jumlah bita"
#: t/helper/test-simple-ipc.c
msgid "number of requests per thread"
-msgstr ""
+msgstr "jumlah permintaan tiap utas"
#: t/helper/test-simple-ipc.c
msgid "byte"
-msgstr ""
+msgstr "bita"
#: t/helper/test-simple-ipc.c
msgid "ballast character"
-msgstr ""
+msgstr "karakter pemberat"
#: t/helper/test-simple-ipc.c
msgid "token"
-msgstr ""
+msgstr "token"
#: t/helper/test-simple-ipc.c
msgid "command token to send to the server"
-msgstr ""
+msgstr "token perintah untuk dikirim ke peladen"
#: trailer.c
#, c-format
@@ -24890,16 +26562,16 @@ msgstr "tidak dapat menamai ulang berkas sementara ke %s"
#: transport-helper.c
msgid "full write to remote helper failed"
-msgstr ""
+msgstr "gagal menulis penuh ke pembantu remote"
#: transport-helper.c
#, c-format
msgid "unable to find remote helper for '%s'"
-msgstr ""
+msgstr "tidak dapat menemukan pembantu remote untuk '%s'"
#: transport-helper.c
msgid "can't dup helper output fd"
-msgstr ""
+msgstr "tidak dapat menipu penjelas berkas keluaran pembantu"
#: transport-helper.c
#, c-format
@@ -24907,120 +26579,118 @@ msgid ""
"unknown mandatory capability %s; this remote helper probably needs newer "
"version of Git"
msgstr ""
+"kemampuan wajib %s tidak dikenal; pembantu remote ini sepertinya butuh versi "
+"Git baru"
#: transport-helper.c
msgid "this remote helper should implement refspec capability"
-msgstr ""
+msgstr "pembantu remote ini seharusnya menerapkan kemampuan spek referensi"
#: transport-helper.c
#, c-format
msgid "%s unexpectedly said: '%s'"
-msgstr ""
+msgstr "%s tiba-tiba berkata: '%s'"
#: transport-helper.c
#, c-format
msgid "%s also locked %s"
-msgstr ""
+msgstr "%s juga mengunci %s"
#: transport-helper.c
msgid "couldn't run fast-import"
-msgstr ""
+msgstr "tidak dapat menjalankan fast-import"
#: transport-helper.c
msgid "error while running fast-import"
-msgstr ""
+msgstr "kesalahan ketika menjalankan fast-import"
#: transport-helper.c
#, c-format
msgid "could not read ref %s"
-msgstr ""
+msgstr "tidak dapat membaca referensi %s"
#: transport-helper.c
#, c-format
msgid "unknown response to connect: %s"
-msgstr ""
+msgstr "tanggapan terhadap hubungan tidak dikenal: %s"
#: transport-helper.c
msgid "setting remote service path not supported by protocol"
-msgstr ""
+msgstr "menyetel jalur layanan remote tidak didukung oleh protokol"
#: transport-helper.c
msgid "invalid remote service path"
-msgstr ""
-
-#: transport-helper.c transport.c
-msgid "operation not supported by protocol"
-msgstr ""
+msgstr "jalur layanan remote tidak valid"
#: transport-helper.c
#, c-format
msgid "can't connect to subservice %s"
-msgstr ""
+msgstr "tidak dapat menghubungkan ke sublayanan %s"
#: transport-helper.c transport.c
msgid "--negotiate-only requires protocol v2"
-msgstr ""
+msgstr "--negotiate-only butuh protokol v2"
#: transport-helper.c
msgid "'option' without a matching 'ok/error' directive"
-msgstr ""
+msgstr "'option' tanpa pengarah 'ok/error' yang bersesuaian"
#: transport-helper.c
#, c-format
msgid "expected ok/error, helper said '%s'"
-msgstr ""
+msgstr "ok/error diharapkan, pembantu berkata '%s'"
#: transport-helper.c
#, c-format
msgid "helper reported unexpected status of %s"
-msgstr ""
+msgstr "pembantu melaporkan status %s yang tak diharapkan"
#: transport-helper.c
#, c-format
msgid "helper %s does not support dry-run"
-msgstr ""
+msgstr "pembantu %s tidak mendukung latihan"
#: transport-helper.c
#, c-format
msgid "helper %s does not support --signed"
-msgstr ""
+msgstr "pembantu %s tidak mendukung --signed"
#: transport-helper.c
#, c-format
msgid "helper %s does not support --signed=if-asked"
-msgstr ""
+msgstr "pembantu %s tidak mendukung --signed=if-asked"
#: transport-helper.c
#, c-format
msgid "helper %s does not support --atomic"
-msgstr ""
+msgstr "pembantu %s tidak mendukung --atomic"
#: transport-helper.c
#, c-format
msgid "helper %s does not support --%s"
-msgstr ""
+msgstr "pembantu %s tidak mendukung --%s"
#: transport-helper.c
#, c-format
msgid "helper %s does not support 'push-option'"
-msgstr ""
+msgstr "pembantu %s tidak mendukung 'push-option'"
#: transport-helper.c
msgid "remote-helper doesn't support push; refspec needed"
-msgstr ""
+msgstr "pembantu tidak mendukung pendorongan; spek referensi diperlukan"
#: transport-helper.c
#, c-format
msgid "helper %s does not support 'force'"
-msgstr ""
+msgstr "pembantu %s tidak mendukung 'force'"
#: transport-helper.c
msgid "couldn't run fast-export"
-msgstr ""
+msgstr "tidak dapat menjalankan fast-export"
#: transport-helper.c
msgid "error while running fast-export"
-msgstr ""
+msgstr "kesalahan ketika menjalankan fast-export"
#: transport-helper.c
#, c-format
@@ -25028,104 +26698,101 @@ msgid ""
"No refs in common and none specified; doing nothing.\n"
"Perhaps you should specify a branch.\n"
msgstr ""
+"Tidak ada kesamaan referensi dan tidak ada yang disebutkan; tidak melakuan\n"
+"apa-apa. Mungkin Anda perlu menyebutkan sebuah cabang.\n"
#: transport-helper.c
#, c-format
msgid "unsupported object format '%s'"
-msgstr ""
+msgstr "format objek tidak didukung '%s'"
#: transport-helper.c
#, c-format
msgid "malformed response in ref list: %s"
-msgstr ""
+msgstr "jawaban rusak di daftar referensi: %s"
#: transport-helper.c
#, c-format
msgid "read(%s) failed"
-msgstr ""
+msgstr "read(%s) gagal"
#: transport-helper.c
#, c-format
msgid "write(%s) failed"
-msgstr ""
+msgstr "write(%s) gagal"
#: transport-helper.c
#, c-format
msgid "%s thread failed"
-msgstr ""
+msgstr "utas %s gagal"
#: transport-helper.c
#, c-format
msgid "%s thread failed to join: %s"
-msgstr ""
+msgstr "utas %s gagal bergabung: %s"
#: transport-helper.c
#, c-format
msgid "can't start thread for copying data: %s"
-msgstr ""
+msgstr "tidak dapat memulai utas untuk menyalin data: %s"
#: transport-helper.c
#, c-format
msgid "%s process failed to wait"
-msgstr ""
+msgstr "proses %s gagal menunggu"
#: transport-helper.c
#, c-format
msgid "%s process failed"
-msgstr ""
+msgstr "proses %s gagal"
#: transport-helper.c
msgid "can't start thread for copying data"
-msgstr ""
+msgstr "tidak dapat memulai utas untuk menyalin data"
#: transport.c
#, c-format
msgid "Would set upstream of '%s' to '%s' of '%s'\n"
-msgstr ""
+msgstr "Akan menyetel hulu '%s' ke '%s' dari '%s'\n"
#: transport.c
#, c-format
msgid "could not read bundle '%s'"
-msgstr ""
+msgstr "tidak dapat membaca bundel '%s'"
#: transport.c
#, c-format
msgid "transport: invalid depth option '%s'"
-msgstr ""
+msgstr "transport: opsi kedalaman '%s' tidak valid"
#: transport.c
msgid "see protocol.version in 'git help config' for more details"
-msgstr ""
+msgstr "lihat protocol.version di 'git help config' untuk lebih lengkapnya"
#: transport.c
msgid "server options require protocol version 2 or later"
-msgstr ""
+msgstr "opsi peladen butuh protokol versi 2 atau lebih baru"
#: transport.c
msgid "server does not support wait-for-done"
-msgstr ""
+msgstr "peladen tidak mendukung wait-for-done"
#: transport.c
msgid "could not parse transport.color.* config"
-msgstr ""
+msgstr "tidak dapat menguraikan konfigurasi transport.color.*"
#: transport.c
msgid "support for protocol v2 not implemented yet"
-msgstr ""
-
-#: transport.c
-#, c-format
-msgid "unknown value for config '%s': %s"
-msgstr ""
+msgstr "dukungan untuk protokol v2 belum diterapkan"
#: transport.c
#, c-format
msgid "transport '%s' not allowed"
-msgstr ""
+msgstr "transportasi '%s' tidak diperbolehkan"
#: transport.c
msgid "git-over-rsync is no longer supported"
-msgstr ""
+msgstr "git-over-rsync tidak lagi didukung"
#: transport.c
#, c-format
@@ -25133,6 +26800,8 @@ msgid ""
"The following submodule paths contain changes that can\n"
"not be found on any remote:\n"
msgstr ""
+"Jalur submodul berikut berisi perubahan yang tidak dapat ditemukan\n"
+"pada remote apapun:\n"
#: transport.c
#, c-format
@@ -25149,30 +26818,52 @@ msgid ""
"to push them to a remote.\n"
"\n"
msgstr ""
+"\n"
+"Mohon coba\n"
+"\n"
+"\tgit push --recurse-submodules=on-demand\n"
+"\n"
+"atau berganti direktori ke jalur dan gunakan\n"
+"\n"
+"\tgit push\n"
+"untuk mendorong ke remote.\n"
+"\n"
#: transport.c
msgid "Aborting."
-msgstr ""
+msgstr "Membatalkan."
#: transport.c
msgid "failed to push all needed submodules"
-msgstr ""
+msgstr "gagal mendorong semua submodul yang dibutuhkan"
+
+#: transport.c
+msgid "bundle-uri operation not supported by protocol"
+msgstr "operasi bundle-uri tidak didukung oleh protokol"
+
+#: transport.c
+msgid "could not retrieve server-advertised bundle-uri list"
+msgstr "tidak dapat menerima daftar bundle-uri teriklankan server"
+
+#: transport.c
+msgid "operation not supported by protocol"
+msgstr "operasi tidak didukung oleh protokol"
#: tree-walk.c
msgid "too-short tree object"
-msgstr ""
+msgstr "objek pohon terlalu pendek"
#: tree-walk.c
msgid "malformed mode in tree entry"
-msgstr ""
+msgstr "mode salah di entri pohon"
#: tree-walk.c
msgid "empty filename in tree entry"
-msgstr ""
+msgstr "nama berkas kosong di entri pohon"
#: tree-walk.c
msgid "too-short tree file"
-msgstr ""
+msgstr "berkas pohon terlalu pendek"
#: unpack-trees.c
#, c-format
@@ -25180,6 +26871,8 @@ msgid ""
"Your local changes to the following files would be overwritten by checkout:\n"
"%%sPlease commit your changes or stash them before you switch branches."
msgstr ""
+"Perubahan lokal Anda terhadap berkas berikut akan ditimpa oleh checkout:\n"
+"%%sMohon komit atau stase sebelum Anda mengganti cabang."
#: unpack-trees.c
#, c-format
@@ -25187,6 +26880,8 @@ msgid ""
"Your local changes to the following files would be overwritten by checkout:\n"
"%%s"
msgstr ""
+"Perubahan lokal Anda terhadap berkas berikut akan ditimpa oleh checkout:\n"
+"%%s"
#: unpack-trees.c
#, c-format
@@ -25194,6 +26889,9 @@ msgid ""
"Your local changes to the following files would be overwritten by merge:\n"
"%%sPlease commit your changes or stash them before you merge."
msgstr ""
+"Perubahan lokal Anda terhadap berkas berikut akan ditimpa oleh "
+"penggabungan:\n"
+"%%sMohon komit atau stase sebelum Anda gabungkan."
#: unpack-trees.c
#, c-format
@@ -25201,6 +26899,9 @@ msgid ""
"Your local changes to the following files would be overwritten by merge:\n"
"%%s"
msgstr ""
+"Perubahan lokal Anda terhadap berkas berikut akan ditimpa oleh "
+"penggabungan:\n"
+"%%s"
#: unpack-trees.c
#, c-format
@@ -25208,6 +26909,8 @@ msgid ""
"Your local changes to the following files would be overwritten by %s:\n"
"%%sPlease commit your changes or stash them before you %s."
msgstr ""
+"Perubahan lokal Anda terhadap berkas berikut akan ditimpa oleh %s:\n"
+"%%sMohon komit atau stase sebelum Anda %s."
#: unpack-trees.c
#, c-format
@@ -25215,6 +26918,8 @@ msgid ""
"Your local changes to the following files would be overwritten by %s:\n"
"%%s"
msgstr ""
+"Perubahan lokal Anda terhadap berkas berikut akan ditimpa oleh %s:\n"
+"%%s"
#: unpack-trees.c
#, c-format
@@ -25222,6 +26927,9 @@ msgid ""
"Updating the following directories would lose untracked files in them:\n"
"%s"
msgstr ""
+"Memperbarui direktori berikut akan menghilangkan berkas tak terlacak di "
+"dalam:\n"
+"%s"
#: unpack-trees.c
#, c-format
@@ -25229,6 +26937,8 @@ msgid ""
"Refusing to remove the current working directory:\n"
"%s"
msgstr ""
+"Menolak menghapus direktori kerja saat ini:\n"
+"%s"
#: unpack-trees.c
#, c-format
@@ -25236,6 +26946,8 @@ msgid ""
"The following untracked working tree files would be removed by checkout:\n"
"%%sPlease move or remove them before you switch branches."
msgstr ""
+"Berkas pohon kerja tak terlacak berikut akan dihapus oleh checkout:\n"
+"%%sMohon pindahkan atau hapus sebelum Anda berganti cabang."
#: unpack-trees.c
#, c-format
@@ -25243,6 +26955,8 @@ msgid ""
"The following untracked working tree files would be removed by checkout:\n"
"%%s"
msgstr ""
+"Berkas pohon kerja tak terlacak berikut akan dihapus oleh checkout:\n"
+"%%s"
#: unpack-trees.c
#, c-format
@@ -25250,6 +26964,8 @@ msgid ""
"The following untracked working tree files would be removed by merge:\n"
"%%sPlease move or remove them before you merge."
msgstr ""
+"Berkas pohon kerja tak terlacak berikut akan dihapus oleh penggabungan:\n"
+"%%sMohon pindahkan atau hapus sebelum Anda gabungkan."
#: unpack-trees.c
#, c-format
@@ -25257,6 +26973,8 @@ msgid ""
"The following untracked working tree files would be removed by merge:\n"
"%%s"
msgstr ""
+"Berkas pohon kerja tak terlacak berikut akan dihapus oleh penggabungan:\n"
+"%%s"
#: unpack-trees.c
#, c-format
@@ -25264,6 +26982,8 @@ msgid ""
"The following untracked working tree files would be removed by %s:\n"
"%%sPlease move or remove them before you %s."
msgstr ""
+"Berkas pohon kerja tak terlacak berikut akan dihapus oleh %s:\n"
+"%%sMohon pindahkan atau hapus sebelum Anda %s."
#: unpack-trees.c
#, c-format
@@ -25271,6 +26991,8 @@ msgid ""
"The following untracked working tree files would be removed by %s:\n"
"%%s"
msgstr ""
+"Berkas pohon kerja tak terlacak berikut akan dihapus oleh %s:\n"
+"%%s"
#: unpack-trees.c
#, c-format
@@ -25279,6 +27001,8 @@ msgid ""
"checkout:\n"
"%%sPlease move or remove them before you switch branches."
msgstr ""
+"Berkas pohon kerja tak terlacak berikut akan ditimpa oleh checkout:\n"
+"%%sMohon pindahkan atau hapus sebelum Anda berganti cabang."
#: unpack-trees.c
#, c-format
@@ -25287,6 +27011,8 @@ msgid ""
"checkout:\n"
"%%s"
msgstr ""
+"Berkas pohon kerja tak terlacak berikut akan ditimpa oleh checkout:\n"
+"%%s"
#: unpack-trees.c
#, c-format
@@ -25294,6 +27020,8 @@ msgid ""
"The following untracked working tree files would be overwritten by merge:\n"
"%%sPlease move or remove them before you merge."
msgstr ""
+"Berkas pohon kerja tak terlacak berikut akan ditimpa oleh penggabungan:\n"
+"%%sMohon pindahkan atau hapus sebelum Anda gabungkan."
#: unpack-trees.c
#, c-format
@@ -25301,6 +27029,8 @@ msgid ""
"The following untracked working tree files would be overwritten by merge:\n"
"%%s"
msgstr ""
+"Berkas pohon kerja tak terlacak berikut akan ditimpa oleh penggabungan:\n"
+"%%s"
#: unpack-trees.c
#, c-format
@@ -25308,6 +27038,8 @@ msgid ""
"The following untracked working tree files would be overwritten by %s:\n"
"%%sPlease move or remove them before you %s."
msgstr ""
+"Berkas pohon kerja tak terlacak berikut akan ditimpa oleh %s:\n"
+"%%sMohon pindahkan atau hapus sebelum Anda %s."
#: unpack-trees.c
#, c-format
@@ -25315,11 +27047,13 @@ msgid ""
"The following untracked working tree files would be overwritten by %s:\n"
"%%s"
msgstr ""
+"Berkas pohon kerja tak terlacak berikut akan ditimpa oleh %s:\n"
+"%%s"
#: unpack-trees.c
#, c-format
msgid "Entry '%s' overlaps with '%s'. Cannot bind."
-msgstr ""
+msgstr "Entri '%s' tumpang tindih dengan '%s'. Tidak dapat mengikat."
#: unpack-trees.c
#, c-format
@@ -25327,6 +27061,8 @@ msgid ""
"Cannot update submodule:\n"
"%s"
msgstr ""
+"Tidak dapat memperbarui submodul:\n"
+"%s"
#: unpack-trees.c
#, c-format
@@ -25335,6 +27071,8 @@ msgid ""
"patterns:\n"
"%s"
msgstr ""
+"Jalur berikut tidak diperbarui dan dibiarkan walaupun merupakan pola tipis:\n"
+"%s"
#: unpack-trees.c
#, c-format
@@ -25342,6 +27080,9 @@ msgid ""
"The following paths are unmerged and were left despite sparse patterns:\n"
"%s"
msgstr ""
+"Jalur berikut tidak digabungkan dan dibiarkan walaupun merupakan pola "
+"tipis:\n"
+"%s"
#: unpack-trees.c
#, c-format
@@ -25350,11 +27091,13 @@ msgid ""
"patterns:\n"
"%s"
msgstr ""
+"Jalur berikut sudah ada dan tidak diperbarui walaupun merupakan pola tipis:\n"
+"%s"
#: unpack-trees.c
#, c-format
msgid "Aborting\n"
-msgstr ""
+msgstr "Membatalkan\n"
#: unpack-trees.c
#, c-format
@@ -25362,10 +27105,12 @@ msgid ""
"After fixing the above paths, you may want to run `git sparse-checkout "
"reapply`.\n"
msgstr ""
+"Setelah memperbarui jalur tersebut, Anda mungkin ingin menjalankan `git "
+"sparse-checkout reapply`.\n"
#: unpack-trees.c
msgid "Updating files"
-msgstr ""
+msgstr "Memperbarui berkas"
#: unpack-trees.c
msgid ""
@@ -25373,15 +27118,18 @@ msgid ""
"on a case-insensitive filesystem) and only one from the same\n"
"colliding group is in the working tree:\n"
msgstr ""
+"jalur berikut bertabrakan (misalnya jalur peka huruf besar-kecil pada\n"
+"sistem berkas tidak peka huruf besar-kecil) dan hanya satu dari grup\n"
+"bertabrakan yang sama yang berada di dalam pohon kerja:\n"
#: unpack-trees.c
msgid "Updating index flags"
-msgstr ""
+msgstr "Memperbarui bendera indeks"
#: unpack-trees.c
#, c-format
msgid "worktree and untracked commit have duplicate entries: %s"
-msgstr ""
+msgstr "pohon kerja dan komit tak terlacak punya entri duplikat: %s"
#: upload-pack.c
msgid "expected flush after fetch arguments"
@@ -25389,36 +27137,52 @@ msgstr "bilasan diharapkan setelah argumen pengambilan"
#: urlmatch.c
msgid "invalid URL scheme name or missing '://' suffix"
-msgstr ""
+msgstr "skema URL tidak valid atau kehilangan akhiran '://'"
#: urlmatch.c
#, c-format
msgid "invalid %XX escape sequence"
-msgstr ""
+msgstr "urutan pelarian %XX tidak valid"
#: urlmatch.c
msgid "missing host and scheme is not 'file:'"
-msgstr ""
+msgstr "kehilangan host dan skema bukan 'file:'"
#: urlmatch.c
msgid "a 'file:' URL may not have a port number"
-msgstr ""
+msgstr "sebuah URL 'file:' tidak boleh punya nomor port"
#: urlmatch.c
msgid "invalid characters in host name"
-msgstr ""
+msgstr "karakter tidak valid pada nama host"
#: urlmatch.c
msgid "invalid port number"
-msgstr ""
+msgstr "nomor port tidak valid"
#: urlmatch.c
msgid "invalid '..' path segment"
-msgstr ""
+msgstr "segmen jalur '..' tidak valid"
+
+#: usage.c
+msgid "usage: "
+msgstr "penggunaan: "
+
+#: usage.c
+msgid "fatal: "
+msgstr "fatal: "
+
+#: usage.c
+msgid "error: "
+msgstr "kesalahan: "
+
+#: usage.c
+msgid "warning: "
+msgstr "peringatan: "
#: walker.c
msgid "Fetching objects"
-msgstr ""
+msgstr "Mengambil objek"
#: worktree.c
#, c-format
@@ -25524,7 +27288,7 @@ msgstr "gagal menyetel setelan extensions.worktreeConfig"
#: wrapper.c
#, c-format
msgid "could not setenv '%s'"
-msgstr ""
+msgstr "tidak dapat menyetel lingkungan (setenv) '%s'"
#: wrapper.c
#, c-format
@@ -25534,16 +27298,20 @@ msgstr "tidak dapat membuat '%s'"
#: wrapper.c
#, c-format
msgid "could not open '%s' for reading and writing"
-msgstr ""
+msgstr "tidak dapat membuka '%s' untuk membaca dan menulis"
#: wrapper.c
#, c-format
msgid "unable to access '%s'"
-msgstr ""
+msgstr "tidak dapat mengakses '%s'"
#: wrapper.c
msgid "unable to get current working directory"
-msgstr ""
+msgstr "tidak dapat mendapatkan direktori kerja saat ini"
+
+#: wrapper.c
+msgid "unable to get random bytes"
+msgstr "tidak dapat mendapatkan bita acak"
#: wt-status.c
msgid "Unmerged paths:"
@@ -25960,11 +27728,11 @@ msgstr "sedang mendasarkan ulang; ke "
#: wt-status.c
msgid "HEAD detached at "
-msgstr ""
+msgstr "HEAD terlepas pada "
#: wt-status.c
msgid "HEAD detached from "
-msgstr ""
+msgstr "HEAD terlepas dari "
#: wt-status.c
msgid "Not currently on any branch."
@@ -25989,13 +27757,22 @@ msgstr "Berkas yang diabaikan"
#: wt-status.c
#, c-format
msgid ""
-"It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
-"may speed it up, but you have to be careful not to forget to add\n"
-"new files yourself (see 'git help status')."
+"It took %.2f seconds to enumerate untracked files,\n"
+"but the results were cached, and subsequent runs may be faster."
+msgstr ""
+"Butuh %.2f detik untuk mengenumerasikan berkas tak terlacak,\n"
+"tapi hasilnya ditembolokkan, dan invokasi berikutnya mungkin\n"
+"lebih cepat."
+
+#: wt-status.c
+#, c-format
+msgid "It took %.2f seconds to enumerate untracked files."
+msgstr "Butuh %.2f detik untuk mengenumerasikan berkas tak terlacak."
+
+#: wt-status.c
+msgid "See 'git help status' for information on how to improve this."
msgstr ""
-"Butuh %.2f detik untuk menghitung berkas tak terlacak. 'status -uno'\n"
-"mungkin bisa mempercepat, tapi Anda harus berhati-hati jangan sampai lupa\n"
-"untuk tambahkan berkas baru sendiri (lihat 'git help status')."
+"Lihat 'git help status' untuk informasi bagaimana meningkatkankeadaan ini."
#: wt-status.c
#, c-format
@@ -26093,339 +27870,91 @@ msgstr "juga indeks Anda berisi perubahan yang belum dikomit."
msgid "cannot %s: Your index contains uncommitted changes."
msgstr "tidak dapat %s: indeks Anda berisi perubahan yang belum dikomit."
-#: git-merge-octopus.sh
+#: xdiff-interface.c
+#, c-format
+msgid "unknown style '%s' given for '%s'"
+msgstr "nilai gaya tidak dikenal '%s' diberikan untuk '%s'"
+
+#: git-merge-octopus.sh git-merge-resolve.sh
msgid ""
"Error: Your local changes to the following files would be overwritten by "
"merge"
msgstr ""
+"Kesalahan: Perubahan lokal Anda terhadap berkas berikut akan ditimpa oleh "
+"penggabungan"
#: git-merge-octopus.sh
msgid "Automated merge did not work."
-msgstr ""
+msgstr "Penggabungan otomatis tidak bekerja."
#: git-merge-octopus.sh
msgid "Should not be doing an octopus."
-msgstr ""
+msgstr "Seharusnya tidak melakukan gurita."
#: git-merge-octopus.sh
#, sh-format
msgid "Unable to find common commit with $pretty_name"
-msgstr ""
+msgstr "Tidak dapat menemukan komit umum dengan $pretty_name"
#: git-merge-octopus.sh
#, sh-format
msgid "Already up to date with $pretty_name"
-msgstr ""
+msgstr "Sudah terbaru dengan $pretty_name"
#: git-merge-octopus.sh
#, sh-format
msgid "Fast-forwarding to: $pretty_name"
-msgstr ""
+msgstr "Memaju-cepat ke: $pretty_name"
#: git-merge-octopus.sh
#, sh-format
msgid "Trying simple merge with $pretty_name"
-msgstr ""
+msgstr "Mencoba penggabungan sederhana dengan $pretty_name"
#: git-merge-octopus.sh
msgid "Simple merge did not work, trying automatic merge."
-msgstr ""
+msgstr "Penggabungan sederhana tidak berkerja, mencoba penggabungan otomatis."
#: git-sh-setup.sh
#, sh-format
msgid "usage: $dashless $USAGE"
-msgstr ""
+msgstr "penggunaan: $dashless $USAGE"
#: git-sh-setup.sh
#, sh-format
msgid "Cannot chdir to $cdup, the toplevel of the working tree"
-msgstr ""
+msgstr "tidak dapat berganti direktori ke $cdup, level atas dari pohon kerja"
#: git-sh-setup.sh
#, sh-format
msgid "fatal: $program_name cannot be used without a working tree."
-msgstr ""
+msgstr "fatal: $program_name tidak dapat digunakan tanpa pohon kerja."
#: git-sh-setup.sh
msgid "Cannot rewrite branches: You have unstaged changes."
-msgstr ""
+msgstr "Tidak dapat menulis ulang cabang: Anda punya perubahan tak tergelar."
#: git-sh-setup.sh
#, sh-format
msgid "Cannot $action: You have unstaged changes."
-msgstr ""
+msgstr "Tidak dapat $action: Anda punya perubahan tak tergelar."
#: git-sh-setup.sh
#, sh-format
msgid "Cannot $action: Your index contains uncommitted changes."
-msgstr ""
+msgstr "Tidak dapat $action: Indeks Anda berisi perubahan tak terkomit."
#: git-sh-setup.sh
msgid "Additionally, your index contains uncommitted changes."
-msgstr ""
+msgstr "Selain itu, indeks Anda berisi perubahan tak terkomit."
#: git-sh-setup.sh
msgid "You need to run this command from the toplevel of the working tree."
-msgstr ""
+msgstr "Anda perlu menjalankan perintah ini dari level atas dari pohon kerja."
#: git-sh-setup.sh
msgid "Unable to determine absolute path of git directory"
-msgstr ""
-
-#. TRANSLATORS: you can adjust this to align "git add -i" status menu
-#: git-add--interactive.perl
-#, perl-format
-msgid "%12s %12s %s"
-msgstr ""
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "touched %d path\n"
-msgid_plural "touched %d paths\n"
-msgstr[0] ""
-msgstr[1] ""
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for staging."
-msgstr ""
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for stashing."
-msgstr ""
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for unstaging."
-msgstr ""
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for applying."
-msgstr ""
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for discarding."
-msgstr ""
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "failed to open hunk edit file for writing: %s"
-msgstr ""
-
-#: git-add--interactive.perl
-#, perl-format
-msgid ""
-"---\n"
-"To remove '%s' lines, make them ' ' lines (context).\n"
-"To remove '%s' lines, delete them.\n"
-"Lines starting with %s will be removed.\n"
-msgstr ""
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "failed to open hunk edit file for reading: %s"
-msgstr ""
-
-#: git-add--interactive.perl
-msgid ""
-"y - stage this hunk\n"
-"n - do not stage this hunk\n"
-"q - quit; do not stage this hunk or any of the remaining ones\n"
-"a - stage this hunk and all later hunks in the file\n"
-"d - do not stage this hunk or any of the later hunks in the file"
-msgstr ""
-
-#: git-add--interactive.perl
-msgid ""
-"y - stash this hunk\n"
-"n - do not stash this hunk\n"
-"q - quit; do not stash this hunk or any of the remaining ones\n"
-"a - stash this hunk and all later hunks in the file\n"
-"d - do not stash this hunk or any of the later hunks in the file"
-msgstr ""
-
-#: git-add--interactive.perl
-msgid ""
-"y - unstage this hunk\n"
-"n - do not unstage this hunk\n"
-"q - quit; do not unstage this hunk or any of the remaining ones\n"
-"a - unstage this hunk and all later hunks in the file\n"
-"d - do not unstage this hunk or any of the later hunks in the file"
-msgstr ""
-
-#: git-add--interactive.perl
-msgid ""
-"y - apply this hunk to index\n"
-"n - do not apply this hunk to index\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-
-#: git-add--interactive.perl
-msgid ""
-"y - discard this hunk from worktree\n"
-"n - do not discard this hunk from worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-
-#: git-add--interactive.perl
-msgid ""
-"y - discard this hunk from index and worktree\n"
-"n - do not discard this hunk from index and worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-
-#: git-add--interactive.perl
-msgid ""
-"y - apply this hunk to index and worktree\n"
-"n - do not apply this hunk to index and worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-
-#: git-add--interactive.perl
-msgid ""
-"y - apply this hunk to worktree\n"
-"n - do not apply this hunk to worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-
-#: git-add--interactive.perl
-msgid ""
-"g - select a hunk to go to\n"
-"/ - search for a hunk matching the given regex\n"
-"j - leave this hunk undecided, see next undecided hunk\n"
-"J - leave this hunk undecided, see next hunk\n"
-"k - leave this hunk undecided, see previous undecided hunk\n"
-"K - leave this hunk undecided, see previous hunk\n"
-"s - split the current hunk into smaller hunks\n"
-"e - manually edit the current hunk\n"
-"? - print help\n"
-msgstr ""
-
-#: git-add--interactive.perl
-msgid "The selected hunks do not apply to the index!\n"
-msgstr ""
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "ignoring unmerged: %s\n"
-msgstr ""
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
-msgstr ""
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
-msgstr ""
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
-msgstr ""
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
-msgstr ""
-
-#: git-add--interactive.perl
-msgid "No other hunks to goto\n"
-msgstr ""
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Invalid number: '%s'\n"
-msgstr ""
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Sorry, only %d hunk available.\n"
-msgid_plural "Sorry, only %d hunks available.\n"
-msgstr[0] ""
-msgstr[1] ""
-
-#: git-add--interactive.perl
-msgid "No other hunks to search\n"
-msgstr ""
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Malformed search regexp %s: %s\n"
-msgstr ""
-
-#: git-add--interactive.perl
-msgid "No hunk matches the given pattern\n"
-msgstr ""
-
-#: git-add--interactive.perl
-msgid "No previous hunk\n"
-msgstr ""
-
-#: git-add--interactive.perl
-msgid "No next hunk\n"
-msgstr ""
-
-#: git-add--interactive.perl
-msgid "Sorry, cannot split this hunk\n"
-msgstr ""
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Split into %d hunk.\n"
-msgid_plural "Split into %d hunks.\n"
-msgstr[0] ""
-msgstr[1] ""
-
-#: git-add--interactive.perl
-msgid "Sorry, cannot edit this hunk\n"
-msgstr ""
-
-#. TRANSLATORS: please do not translate the command names
-#. 'status', 'update', 'revert', etc.
-#: git-add--interactive.perl
-msgid ""
-"status - show paths with changes\n"
-"update - add working tree state to the staged set of changes\n"
-"revert - revert staged set of changes back to the HEAD version\n"
-"patch - pick hunks and update selectively\n"
-"diff - view diff between HEAD and index\n"
-"add untracked - add contents of untracked files to the staged set of "
-"changes\n"
-msgstr ""
-
-#: git-add--interactive.perl
-msgid "missing --"
-msgstr ""
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "unknown --patch mode: %s"
-msgstr ""
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "invalid argument %s, expecting --"
-msgstr ""
+msgstr "Tidak dapat menentukan jalur absolut direktori git"
#: git-send-email.perl
msgid "local zone differs from GMT by a non-minute interval\n"
@@ -26568,13 +28097,13 @@ msgstr ""
#: git-send-email.perl
#, perl-format
-msgid "Failed to open %s: %s"
-msgstr "Gagal membuka %s: %s"
+msgid "Failed to open %s.final: %s"
+msgstr "Gagal membuka %s.final: %s"
#: git-send-email.perl
#, perl-format
-msgid "Failed to open %s.final: %s"
-msgstr "Gagal membuka %s.final: %s"
+msgid "Failed to open %s: %s"
+msgstr "Gagal membuka %s: %s"
#: git-send-email.perl
msgid "Summary email is empty, skipping it\n"
@@ -26759,8 +28288,8 @@ msgstr "(%s) Tidak dapat menjalankan '%s'"
#: git-send-email.perl
#, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) Menambahkan %s: %s dari: '%s'\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) Baris masukan salah format: '%s'"
#: git-send-email.perl
#, perl-format
@@ -26768,6 +28297,11 @@ msgid "(%s) failed to close pipe to '%s'"
msgstr "(%s) gagal menutup pipa ke '%s'"
#: git-send-email.perl
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) Menambahkan %s: %s dari: '%s'\n"
+
+#: git-send-email.perl
msgid "cannot send message as 7bit"
msgstr "tidak dapat mengirim pesan sebagai 7bit"
diff --git a/po/ru.po b/po/ru.po
index 803208c..3e56eb5 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -4,28 +4,28 @@
#
# Translators:
# Alexander Golubev <fatzer2@gmail.com>, 2020
-# Dimitriy Ryazantcev <DJm00n@mail.ru>, 2014-2022
+# Dimitriy Ryazantcev <DJm00n@mail.ru>, 2014-2023
# insolor, 2014
# insolor, 2014
# Sergey Alyoshin <alyoshin.s@gmail.com>, 2020-2021
# Sergey Kuznetsov <votkinsk@gmail.com>, 2021-2022
-# Чук Таблицоменделеев <aurum444an@gmail.com>, 2019
+# Чук Таблицоменделеев (Aurum79) <aurum444an@gmail.com>, 2019
msgid ""
msgstr ""
"Project-Id-Version: Git Russian Localization Project\n"
"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2022-06-26 20:30+0800\n"
+"POT-Creation-Date: 2023-06-30 12:55+0300\n"
"PO-Revision-Date: 2014-02-18 23:30+0000\n"
-"Last-Translator: Dimitriy Ryazantcev <DJm00n@mail.ru>, 2014-2022\n"
-"Language-Team: Russian (http://www.transifex.com/djm00n/git-po-ru/language/"
+"Last-Translator: Dimitriy Ryazantcev <DJm00n@mail.ru>, 2014-2023\n"
+"Language-Team: Russian (http://app.transifex.com/djm00n/git-po-ru/language/"
"ru/)\n"
-"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
-"%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n"
-"%100>=11 && n%100<=14)? 2 : 3);\n"
+"Language: ru\n"
+"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
+"n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || "
+"(n%100>=11 && n%100<=14)? 2 : 3);\n"
#, c-format
msgid "Huh (%s)?"
@@ -53,7 +53,7 @@ msgstr " не удалоÑÑŒ проиндекÑировать «%s»"
msgid "could not write index"
msgstr "не удалоÑÑŒ запиÑать индекÑ"
-#, c-format, perl-format
+#, c-format
msgid "updated %d path\n"
msgid_plural "updated %d paths\n"
msgstr[0] "обновлён %d путь\n"
@@ -61,7 +61,7 @@ msgstr[1] "обновлено %d пути\n"
msgstr[2] "обновлено %d путей\n"
msgstr[3] "обновлено %d пути\n"
-#, c-format, perl-format
+#, c-format
msgid "note: %s is untracked now.\n"
msgstr "примечание: %s теперь неотÑлеживаемый.\n"
@@ -75,7 +75,7 @@ msgstr "Обратить изменениÑ"
msgid "Could not parse HEAD^{tree}"
msgstr "Ðе удалоÑÑŒ разобрать HEAD^{tree}"
-#, c-format, perl-format
+#, c-format
msgid "reverted %d path\n"
msgid_plural "reverted %d paths\n"
msgstr[0] "обращены Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ %d пути\n"
@@ -90,7 +90,7 @@ msgstr "Ðет неотÑлеживаемых файлов.\n"
msgid "Add untracked"
msgstr "Добавить неотÑлеживаемый"
-#, c-format, perl-format
+#, c-format
msgid "added %d path\n"
msgid_plural "added %d paths\n"
msgstr[0] "добавлен %d путь\n"
@@ -188,19 +188,19 @@ msgstr "не удалоÑÑŒ обновить индекÑ"
msgid "Bye.\n"
msgstr "До ÑвиданиÑ.\n"
-#, c-format, perl-format
+#, c-format
msgid "Stage mode change [y,n,q,a,d%s,?]? "
msgstr "ПроиндекÑировать изменение режима доÑтупа [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage deletion [y,n,q,a,d%s,?]? "
msgstr "ПроиндекÑировать удаление [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage addition [y,n,q,a,d%s,?]? "
msgstr "Добавить к индекÑу [y,n,q,a,d%s,?]?"
-#, c-format, perl-format
+#, c-format
msgid "Stage this hunk [y,n,q,a,d%s,?]? "
msgstr "ИндекÑировать Ñтот блок [y,n,q,a,d%s,?]? "
@@ -224,19 +224,19 @@ msgstr ""
"a - индекÑировать Ñтот и оÑтальные блоки файла\n"
"d - пропуÑтить Ñтот и оÑтальные блоки файла\n"
-#, c-format, perl-format
+#, c-format
msgid "Stash mode change [y,n,q,a,d%s,?]? "
msgstr "СпрÑтать изменение режима доÑтупа [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash deletion [y,n,q,a,d%s,?]? "
msgstr "СпрÑтать удаление файла [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash addition [y,n,q,a,d%s,?]? "
msgstr "Добавить к ÑпрÑтанному [y,n,q,a,d%s,?]?"
-#, c-format, perl-format
+#, c-format
msgid "Stash this hunk [y,n,q,a,d%s,?]? "
msgstr "СпрÑтать Ñтот блок [y,n,q,a,d%s,?]? "
@@ -259,19 +259,19 @@ msgstr ""
"a - ÑпрÑтать Ñтот и оÑтальные блоки файла\n"
"d - пропуÑтить Ñтот и оÑтальные блоки файла\n"
-#, c-format, perl-format
+#, c-format
msgid "Unstage mode change [y,n,q,a,d%s,?]? "
msgstr "Убрать Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ñ€ÐµÐ¶Ð¸Ð¼Ð° доÑтупа из индекÑа [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage deletion [y,n,q,a,d%s,?]? "
msgstr "Убрать удаление из индекÑа [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage addition [y,n,q,a,d%s,?]? "
msgstr "Убрать из индекÑа [y,n,q,a,d%s,?]?"
-#, c-format, perl-format
+#, c-format
msgid "Unstage this hunk [y,n,q,a,d%s,?]? "
msgstr "Убрать из индекÑа Ñтот блок [y,n,q,a,d%s,?]? "
@@ -289,25 +289,25 @@ msgid ""
"a - unstage this hunk and all later hunks in the file\n"
"d - do not unstage this hunk or any of the later hunks in the file\n"
msgstr ""
-"y - убрать из индекÑа Ñтот блок\n"
+"y - убрать Ñтот блок из индекÑа\n"
"n - пропуÑтить Ñтот блок\n"
"q - выход; пропуÑтить Ñтот и вÑе поÑледующие блоки\n"
"a - убрать из индекÑа Ñтот и оÑтальные блоки файла\n"
"d - пропуÑтить Ñтот и оÑтальные блоки файла\n"
-#, c-format, perl-format
+#, c-format
msgid "Apply mode change to index [y,n,q,a,d%s,?]? "
msgstr "Применить изменение режима доÑтупа к индекÑу [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply deletion to index [y,n,q,a,d%s,?]? "
msgstr "Применить удаление к индекÑу [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply addition to index [y,n,q,a,d%s,?]? "
msgstr "Применить добавление к индекÑу [y,n,q,a,d%s,?]?"
-#, c-format, perl-format
+#, c-format
msgid "Apply this hunk to index [y,n,q,a,d%s,?]? "
msgstr "ПринÑÑ‚ÑŒ Ñтот блок в Ð¸Ð½Ð´ÐµÐºÑ [y,n,q,a,d%s,?]? "
@@ -331,21 +331,21 @@ msgstr ""
"a - принÑÑ‚ÑŒ Ñтот и оÑтальные блоки файла\n"
"d - пропуÑтить Ñтот и оÑтальные блоки файла\n"
-#, c-format, perl-format
+#, c-format
msgid "Discard mode change from worktree [y,n,q,a,d%s,?]? "
msgstr "Отменить Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ñ€ÐµÐ¶Ð¸Ð¼Ð° доÑтупа в рабочем каталоге [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard deletion from worktree [y,n,q,a,d%s,?]? "
msgstr "Отменить удаление в рабочем каталоге [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard addition from worktree [y,n,q,a,d%s,?]? "
msgstr "Отменить Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð¸Ð· рабочего каталога [y,n,q,a,d%s,?]?"
-#, c-format, perl-format
+#, c-format
msgid "Discard this hunk from worktree [y,n,q,a,d%s,?]? "
-msgstr "ОтброÑить Ñтот блок из рабочего дерева [y,n,q,a,d%s,?]?"
+msgstr "ОтброÑить Ñтот блок из рабочего каталога [y,n,q,a,d%s,?]?"
msgid ""
"If the patch applies cleanly, the edited hunk will immediately be marked for "
@@ -360,29 +360,29 @@ msgid ""
"a - discard this hunk and all later hunks in the file\n"
"d - do not discard this hunk or any of the later hunks in the file\n"
msgstr ""
-"y - отброÑить Ñтот блок из рабочего дерева\n"
+"y - отброÑить Ñтот блок из рабочего каталога\n"
"n - пропуÑтить Ñтот блок\n"
"q - выход; пропуÑтить Ñтот и вÑе поÑледующие блоки\n"
"a - отброÑить Ñтот и оÑтальные блоки файла\n"
"d - пропуÑтить Ñтот и оÑтальные блоки файла\n"
-#, c-format, perl-format
+#, 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, perl-format
+#, c-format
msgid "Discard deletion from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Отменить удаление в индекÑе и рабочем каталоге [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard addition from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Отменить добавление в Ð¸Ð½Ð´ÐµÐºÑ Ð¸ рабочий каталог [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard this hunk from index and worktree [y,n,q,a,d%s,?]? "
-msgstr "ОтброÑить Ñтот блок из индекÑа рабочего дерева [y,n,q,a,d%s,?]? "
+msgstr "ОтброÑить Ñтот блок из индекÑа рабочего каталога [y,n,q,a,d%s,?]? "
msgid ""
"y - discard this hunk from index and worktree\n"
@@ -391,27 +391,27 @@ msgid ""
"a - discard this hunk and all later hunks in the file\n"
"d - do not discard this hunk or any of the later hunks in the file\n"
msgstr ""
-"y - отброÑить Ñтот блок из рабочего дерева\n"
+"y - отброÑить Ñтот блок из рабочего каталога\n"
"n - пропуÑтить Ñтот блок\n"
"q - выход; пропуÑтить Ñтот и вÑе поÑледующие блоки\n"
"a - отброÑить Ñтот и оÑтальные блоки файла\n"
"d - пропуÑтить Ñтот и оÑтальные блоки файла\n"
-#, c-format, perl-format
+#, 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, perl-format
+#, c-format
msgid "Apply deletion to index and worktree [y,n,q,a,d%s,?]? "
msgstr "Применить удаление к индекÑу и рабочему каталогу [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply addition to index and worktree [y,n,q,a,d%s,?]? "
msgstr "Применить добавление к индекÑу и рабочему каталогу [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply this hunk to index and worktree [y,n,q,a,d%s,?]? "
msgstr "ПринÑÑ‚ÑŒ Ñтот блок в Ð¸Ð½Ð´ÐµÐºÑ Ð¸ рабочий каталог [y,n,q,a,d%s,?]? "
@@ -422,12 +422,28 @@ msgid ""
"a - apply this hunk and all later hunks in the file\n"
"d - do not apply this hunk or any of the later hunks in the file\n"
msgstr ""
-"y - принÑÑ‚ÑŒ Ñтот блок в Ð¸Ð½Ð´ÐµÐºÑ Ð¸ рабочее дерево\n"
+"y - принÑÑ‚ÑŒ Ñтот блок в Ð¸Ð½Ð´ÐµÐºÑ Ð¸ рабочий каталог\n"
"n - пропуÑтить Ñтот блок\n"
"q - выход; пропуÑтить Ñтот и вÑе поÑледующие блоки\n"
"a - принÑÑ‚ÑŒ Ñтот и оÑтальные блоки файла\n"
"d - пропуÑтить Ñтот и оÑтальные блоки файла\n"
+#, c-format
+msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
+msgstr ""
+
+#, c-format
+msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
+msgstr ""
+
+#, c-format
+msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
+msgstr ""
+
+#, c-format
+msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
+msgstr "ПринÑÑ‚ÑŒ Ñтот блок в рабочий каталог [y,n,q,a,d%s,?]? "
+
msgid ""
"y - apply this hunk to worktree\n"
"n - do not apply this hunk to worktree\n"
@@ -435,7 +451,7 @@ msgid ""
"a - apply this hunk and all later hunks in the file\n"
"d - do not apply this hunk or any of the later hunks in the file\n"
msgstr ""
-"y - принÑÑ‚ÑŒ Ñтот блок в рабочее дерево\n"
+"y - принÑÑ‚ÑŒ Ñтот блок в рабочий каталог\n"
"n - пропуÑтить Ñтот блок\n"
"q - выход; пропуÑтить Ñтот и вÑе поÑледующие блоки\n"
"a - принÑÑ‚ÑŒ Ñтот и оÑтальные блоки файла\n"
@@ -445,10 +461,6 @@ msgstr ""
msgid "could not parse hunk header '%.*s'"
msgstr "не удалоÑÑŒ разобрать заголовок блока изменений «%.*s»"
-#, c-format
-msgid "could not parse colored hunk header '%.*s'"
-msgstr "не удалоÑÑŒ разобрать цветной заголовок блока изменений «%.*s»"
-
msgid "could not parse diff"
msgstr "не удалоÑÑŒ разобрать ÑпиÑок изменений (diff)"
@@ -457,15 +469,18 @@ msgstr "не удалоÑÑŒ разобрать цветной ÑпиÑок изÐ
#, c-format
msgid "failed to run '%s'"
-msgstr ""
+msgstr "не удалоÑÑŒ запуÑтить «%s»"
msgid "mismatched output from interactive.diffFilter"
-msgstr ""
+msgstr "неÑовпадение вывода из interactive.diffFilter"
msgid ""
"Your filter must maintain a one-to-one correspondence\n"
"between its input and output lines."
msgstr ""
+"Ваш фильтр должен поддерживать ÑоответÑтвие\n"
+"один-к-одному между его входными и выходными\n"
+"Ñтроками."
#, c-format
msgid ""
@@ -504,8 +519,6 @@ msgstr ""
"Чтобы убрать «%c»-Ñтроки, удалите их.\n"
"Строки, начинающиеÑÑ Ñ %cбудут удалены.\n"
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: 'it' refers to the patch mentioned in the previous messages.
msgid ""
"If it does not apply cleanly, you will be given an opportunity to\n"
"edit again. If all lines of the hunk are removed, then the edit is\n"
@@ -517,25 +530,16 @@ msgstr ""
"и блок оÑтанетÑÑ Ð±ÐµÐ· изменений.\n"
msgid "could not parse hunk header"
-msgstr ""
+msgstr "не удалоÑÑŒ разобрать заголовок блока изменений"
msgid "'git apply --cached' failed"
-msgstr ""
+msgstr "Ñбой при выполнении «git apply --cached»"
-#. #-#-#-#-# add-patch.c.po #-#-#-#-#
#. TRANSLATORS: do not translate [y/n]
#. The program will only accept that input at this point.
#. Consider translating (saying "no" discards!) as
#. (saying "n" for "no" discards!) if the translation
#. of the word "no" does not start with n.
-#.
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: do not translate [y/n]
-#. The program will only accept that input
-#. at this point.
-#. Consider translating (saying "no" discards!) as
-#. (saying "n" for "no" discards!) if the translation
-#. of the word "no" does not start with n.
msgid ""
"Your edited hunk does not apply. Edit again (saying \"no\" discards!) [y/n]? "
msgstr ""
@@ -543,7 +547,7 @@ msgstr ""
"«нет»!) [y/n]? "
msgid "The selected hunks do not apply to the index!"
-msgstr ""
+msgstr "Выбранные блоки не применÑÑŽÑ‚ÑÑ Ð±ÐµÐ· ошибок к индекÑу!"
msgid "Apply them to the worktree anyway? "
msgstr "Ð’Ñе равно применить их к рабочему каталогу? "
@@ -562,15 +566,24 @@ msgid ""
"e - manually edit the current hunk\n"
"? - print help\n"
msgstr ""
+"j - не принимать решение по Ñтому блоку, перейти на Ñледующий нерешенный\n"
+"J - не принимать решение по Ñтому блоку, перейти на Ñледующий\n"
+"k - не принимать решение по Ñтому блоку, перейти на предыдущий нерешенный\n"
+"K - не принимать решение по Ñтому блоку, перейти на предыдущий\n"
+"g - выбрать блок изменений на который нужно перейти\n"
+"/ - поиÑк блока изменений Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ регулÑрного выражениÑ\n"
+"s - разделить текущий блок на блоки меньшего размера\n"
+"e - вручную отредактировать текущий блок\n"
+"? - вывеÑти Ñправку\n"
msgid "No previous hunk"
-msgstr ""
+msgstr "Ðет предыдущего блока"
msgid "No next hunk"
-msgstr ""
+msgstr "Ðе Ñледующего блока"
msgid "No other hunks to goto"
-msgstr ""
+msgstr "Ðет других блоков Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÑ…Ð¾Ð´Ð°"
msgid "go to which hunk (<ret> to see more)? "
msgstr "на какой блок перейти (нажмите <ввод> чтобы увидеть еще)? "
@@ -580,41 +593,41 @@ msgstr "на какой блок перейти? "
#, c-format
msgid "Invalid number: '%s'"
-msgstr ""
+msgstr "ÐедопуÑтимый номер: «%s»"
#, c-format
msgid "Sorry, only %d hunk available."
msgid_plural "Sorry, only %d hunks available."
-msgstr[0] ""
-msgstr[1] ""
-msgstr[2] ""
-msgstr[3] ""
+msgstr[0] "ПроÑтите, но только %d блок изменений доÑтупнен."
+msgstr[1] "ПроÑтите, но только %d блока изменений доÑтупно."
+msgstr[2] "ПроÑтите, но только %d блоков изменений доÑтупно."
+msgstr[3] "ПроÑтите, но только %d блока изменений доÑтупно."
msgid "No other hunks to search"
-msgstr ""
+msgstr "Ðет других блоков Ð´Ð»Ñ Ð¿Ð¾Ð¸Ñка"
msgid "search for regex? "
msgstr "иÑкать Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ регулÑрного выражениÑ? "
#, c-format
msgid "Malformed search regexp %s: %s"
-msgstr ""
+msgstr "РегулÑрное выражение Ð´Ð»Ñ Ð¿Ð¾Ð¸Ñка в неправильном формате %s: %s"
msgid "No hunk matches the given pattern"
-msgstr ""
+msgstr "Ðе найдены блоки, которые ÑоответÑтвуют указанному шаблону"
msgid "Sorry, cannot split this hunk"
msgstr ""
#, c-format
msgid "Split into %d hunks."
-msgstr ""
+msgstr "Разбито на %d блока изменений."
msgid "Sorry, cannot edit this hunk"
msgstr ""
msgid "'git apply' failed"
-msgstr ""
+msgstr "Ñбой при выполнении «git apply»"
#, c-format
msgid ""
@@ -666,6 +679,16 @@ msgstr "Перед ÑлиÑнием, выполните коммит ваших
msgid "Exiting because of unfinished merge."
msgstr "Выход из-за незавершенного ÑлиÑниÑ."
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+
msgid "Not possible to fast-forward, aborting."
msgstr "БыÑÑ‚Ñ€Ð°Ñ Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚ÐºÐ° невозможна, отменÑем."
@@ -724,19 +747,35 @@ msgstr ""
"advice.detachedHead в значение false\n"
"\n"
+#, c-format
+msgid ""
+"The following paths have been moved outside the\n"
+"sparse-checkout definition but are not sparse due to local\n"
+"modifications.\n"
+msgstr ""
+
+msgid ""
+"To correct the sparsity of these paths, do the following:\n"
+"* Use \"git add --sparse <paths>\" to update the index\n"
+"* Use \"git sparse-checkout reapply\" to apply the sparsity rules"
+msgstr ""
+
msgid "cmdline ends with \\"
msgstr "ÐºÐ¾Ð¼Ð°Ð½Ð´Ð½Ð°Ñ Ñтрока заканчиваетÑÑ Ñимволом \\"
msgid "unclosed quote"
msgstr "пропущена Ð·Ð°ÐºÑ€Ñ‹Ð²Ð°ÑŽÑ‰Ð°Ñ ÐºÐ°Ð²Ñ‹Ñ‡ÐºÐ°"
+msgid "too many arguments"
+msgstr ""
+
#, c-format
msgid "unrecognized whitespace option '%s'"
-msgstr "Ð½ÐµÐ¾Ð¿Ð¾Ð·Ð½Ð°Ð½Ð½Ð°Ñ Ð¾Ð¿Ñ†Ð¸Ñ Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð±ÐµÐ»Ð¾Ð² «%s»"
+msgstr "неопознанный параметр Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð±ÐµÐ»Ð¾Ð² «%s»"
#, c-format
msgid "unrecognized whitespace ignore option '%s'"
-msgstr "Ð½ÐµÐ¾Ð¿Ð¾Ð·Ð½Ð°Ð½Ð½Ð°Ñ Ð¾Ð¿Ñ†Ð¸Ñ Ð´Ð»Ñ Ð¸Ð³Ð½Ð¾Ñ€Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¿Ñ€Ð¾Ð±ÐµÐ»Ð¾Ð² «%s»"
+msgstr "неопознанный параметр Ð´Ð»Ñ Ð¸Ð³Ð½Ð¾Ñ€Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¿Ñ€Ð¾Ð±ÐµÐ»Ð¾Ð² «%s»"
#, c-format
msgid "options '%s' and '%s' cannot be used together"
@@ -1101,6 +1140,10 @@ msgid "cannot open %s"
msgstr "не удалоÑÑŒ открыть %s"
#, c-format
+msgid "cannot unlink '%s'"
+msgstr ""
+
+#, c-format
msgid "Hunk #%d applied cleanly."
msgstr "Блок №%d применен без ошибок."
@@ -1256,6 +1299,10 @@ msgid "unsupported file mode: 0%o (SHA1: %s)"
msgstr "неподдерживаемый режим доÑтупа к файлу: 0%o (SHA1: %s)"
#, c-format
+msgid "deflate error (%d)"
+msgstr "ошибка ÑÐ¶Ð°Ñ‚Ð¸Ñ (%d)"
+
+#, c-format
msgid "unable to start '%s' filter"
msgstr "не удалоÑÑŒ запуÑтить фильтр «%s»"
@@ -1275,10 +1322,6 @@ msgid "path too long (%d chars, SHA1: %s): %s"
msgstr "путь Ñлишком длинный (%d Ñимволов, SHA1: %s): %s"
#, c-format
-msgid "deflate error (%d)"
-msgstr "ошибка ÑÐ¶Ð°Ñ‚Ð¸Ñ (%d)"
-
-#, c-format
msgid "timestamp too large for this system: %<PRIuMAX>"
msgstr "отметка времени Ñлишком Ð±Ð¾Ð»ÑŒÑˆÐ°Ñ Ð´Ð»Ñ Ñтой ÑиÑтемы: %<PRIuMAX>"
@@ -1298,6 +1341,10 @@ msgid "cannot read '%s'"
msgstr "не удалоÑÑŒ прочитать «%s»"
#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr ""
+
+#, c-format
msgid "pathspec '%s' did not match any files"
msgstr "Ñпецификатор пути «%s» не ÑоответÑтвует ни одному файлу"
@@ -1313,9 +1360,6 @@ msgstr "недопуÑтимое Ð¸Ð¼Ñ Ð¾Ð±ÑŠÐµÐºÑ‚Ð°: %s"
msgid "not a tree object: %s"
msgstr "недейÑтвительный объект дерева: %s"
-msgid "current working directory is untracked"
-msgstr "текущий рабочий каталог не отÑлеживаетÑÑ"
-
#, c-format
msgid "File not found: %s"
msgstr ""
@@ -1366,6 +1410,12 @@ msgstr "читать .gitattributes в рабочем каталоге"
msgid "report archived files on stderr"
msgstr "отчет об архивированных файлах в stderr"
+msgid "time"
+msgstr "времÑ"
+
+msgid "set modification time of archive entries"
+msgstr ""
+
msgid "set compression level"
msgstr ""
@@ -1406,6 +1456,13 @@ msgstr "Ðргумент не поддерживаетÑÑ Ð´Ð»Ñ Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚Ð°
msgid "%.*s is not a valid attribute name"
msgstr "%.*s не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым именем атрибута"
+msgid "unable to add additional attribute"
+msgstr ""
+
+#, c-format
+msgid "ignoring overly long attributes line %d"
+msgstr ""
+
#, c-format
msgid "%s not allowed: %s:%d"
msgstr "%s не разрешено: %s:%d"
@@ -1419,6 +1476,21 @@ msgstr ""
"«воÑклицательный знак»."
#, c-format
+msgid "cannot fstat gitattributes file '%s'"
+msgstr ""
+
+#, c-format
+msgid "ignoring overly large gitattributes file '%s'"
+msgstr ""
+
+#, c-format
+msgid "ignoring overly large gitattributes blob '%s'"
+msgstr ""
+
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr ""
+
+#, c-format
msgid "Badly quoted content in file '%s': %s"
msgstr "Плохое Ñодержимое файла «%s»: %s"
@@ -1514,7 +1586,6 @@ msgstr[3] "(примерно %d шагов)"
#. TRANSLATORS: the last %s will be replaced with "(roughly %d
#. steps)" translation.
-#.
#, c-format
msgid "Bisecting: %d revision left to test after this %s\n"
msgid_plural "Bisecting: %d revisions left to test after this %s\n"
@@ -1526,9 +1597,6 @@ msgstr[3] "Бинарный поиÑк: %d редакций оÑталоÑÑŒ пÑ
msgid "--contents and --reverse do not blend well."
msgstr "--contents и --reverse не очень ÑочетаютÑÑ."
-msgid "cannot use --contents with final commit object name"
-msgstr "Ð½ÐµÐ»ÑŒÐ·Ñ Ð¸Ñпользовать --contents Ñ ÑƒÐºÐ°Ð·Ð°Ð½Ð¸ÐµÐ¼ финального имени объекта"
-
msgid "--reverse and --first-parent together require specified latest commit"
msgstr ""
"при --reverse и --first-parent вмеÑте нужно указывать конкретный поÑледний "
@@ -1597,20 +1665,17 @@ msgstr ""
#. TRANSLATORS: This is a line listing a remote with duplicate
#. refspecs in the advice message below. For RTL languages you'll
#. probably want to swap the "%s" and leading " " space around.
-#.
#. #-#-#-#-# object-name.c.po #-#-#-#-#
#. TRANSLATORS: This is line item of ambiguous object output
#. from describe_ambiguous_object() above. For RTL languages
#. you'll probably want to swap the "%s" and leading " " space
#. around.
-#.
#, c-format
msgid " %s\n"
msgstr ""
#. TRANSLATORS: The second argument is a \n-delimited list of
#. duplicate refspecs, composed above.
-#.
#, c-format
msgid ""
"There are multiple remotes whose fetch refspecs map to the remote\n"
@@ -1680,8 +1745,8 @@ msgstr ""
#, c-format
msgid ""
-"You may try updating the submodules using 'git checkout %s && git submodule "
-"update --init'"
+"You may try updating the submodules using 'git checkout --no-recurse-"
+"submodules %s && git submodule update --init'"
msgstr ""
#, c-format
@@ -1692,10 +1757,6 @@ msgstr ""
msgid "'%s' is already checked out at '%s'"
msgstr "«%s» уже находитÑÑ Ð½Ð° «%s»"
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "HEAD рабочего каталога %s не обновлён"
-
msgid "git add [<options>] [--] <pathspec>..."
msgstr "git add [<опции>] [--] <Ñпецификатор-пути>..."
@@ -1717,6 +1778,11 @@ msgstr "удалить «%s»\n"
msgid "Unstaged changes after refreshing the index:"
msgstr "ÐепроиндекÑированные Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð¿Ð¾Ñле Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð¸Ð½Ð´ÐµÐºÑа:"
+msgid ""
+"the add.interactive.useBuiltin setting has been removed!\n"
+"See its entry in 'git help config' for details."
+msgstr ""
+
msgid "Could not read the index"
msgstr "Ðе удалоÑÑŒ прочитать индекÑ"
@@ -2006,7 +2072,6 @@ msgstr "Тело коммита:"
#. TRANSLATORS: Make sure to include [y], [n], [e], [v] and [a]
#. in your translation. The program will only accept English
#. input at this point.
-#.
#, c-format
msgid "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all: "
msgstr ""
@@ -2103,6 +2168,9 @@ msgstr "git am [<опции>] (--continue | --skip | --abort)"
msgid "run interactively"
msgstr "запуÑтить в интерактивном режиме"
+msgid "bypass pre-applypatch and applypatch-msg hooks"
+msgstr ""
+
msgid "historical option -- no-op"
msgstr "иÑторичеÑÐºÐ°Ñ Ð¾Ð¿Ñ†Ð¸Ñ â€” ничего не делает"
@@ -2245,31 +2313,24 @@ msgstr "git archive: ошибка протокола"
msgid "git archive: expected a flush"
msgstr "git archive: ожидалÑÑ ÑÐ±Ñ€Ð¾Ñ Ð±ÑƒÑ„ÐµÑ€Ð°"
-msgid "git bisect--helper --bisect-reset [<commit>]"
-msgstr ""
-
msgid ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<term> --term-{old,good}"
-"=<term>] [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] "
-"[<paths>...]"
+"git bisect start [--term-{new,bad}=<term> --term-{old,good}=<term>] [--no-"
+"checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]"
msgstr ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<термин> --term-{old,"
-"good}=<термин>] [--no-checkout] [--first-parent] [<плохаÑ-редациÑ> [<хорошаÑ-"
-"редациÑ>...]] [--] [<пути>...]"
-msgid "git bisect--helper --bisect-state (bad|new) [<rev>]"
+msgid "git bisect (good|bad) [<rev>...]"
msgstr ""
-msgid "git bisect--helper --bisect-state (good|old) [<rev>...]"
+msgid "git bisect skip [(<rev>|<range>)...]"
msgstr ""
-msgid "git bisect--helper --bisect-replay <filename>"
+msgid "git bisect reset [<commit>]"
msgstr ""
-msgid "git bisect--helper --bisect-skip [(<rev>|<range>)...]"
+msgid "git bisect replay <logfile>"
msgstr ""
-msgid "git bisect--helper --bisect-run <cmd>..."
+msgid "git bisect run <cmd>..."
msgstr ""
#, c-format
@@ -2348,7 +2409,6 @@ msgstr ""
#. TRANSLATORS: Make sure to include [Y] and [n] in your
#. translation. The program will only accept English input
#. at this point.
-#.
msgid "Are you sure [Y/n]? "
msgstr "Вы уверены [Y - да/n - нет]? "
@@ -2406,9 +2466,6 @@ msgstr ""
msgid "checking out '%s' failed. Try 'git bisect start <valid-branch>'."
msgstr ""
-msgid "won't bisect on cg-seek'ed tree"
-msgstr "Ð½ÐµÐ»ÑŒÐ·Ñ Ð²Ñ‹Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÑŒ двоичный поиÑк на дереве поÑле cg-seek"
-
msgid "bad HEAD - strange symbolic ref"
msgstr ""
@@ -2422,7 +2479,6 @@ msgstr ""
#. TRANSLATORS: Make sure to include [Y] and [n] in your
#. translation. The program will only accept English input
#. at this point.
-#.
msgid "Do you want me to do it for you [Y/n]? "
msgstr "Ð’Ñ‹ уверены, что хотите, чтобы Ñ Ñделал Ñто [Y] - да/[n] - нет? "
@@ -2460,7 +2516,7 @@ msgid "bisect run failed: no command provided."
msgstr "Ñбой при выполнении двоичного поиÑка: не передана команда."
#, c-format
-msgid "unable to verify '%s' on good revision"
+msgid "unable to verify %s on good revision"
msgstr ""
#, c-format
@@ -2468,7 +2524,7 @@ msgid "bogus exit code %d for good revision"
msgstr ""
#, c-format
-msgid "bisect run failed: exit code %d from '%s' is < 0 or >= 128"
+msgid "bisect run failed: exit code %d from %s is < 0 or >= 128"
msgstr ""
#, c-format
@@ -2478,74 +2534,48 @@ msgstr ""
msgid "bisect run cannot continue any more"
msgstr "bisect run больше не может продолжать"
-#, c-format
msgid "bisect run success"
msgstr "bisect run выполнен уÑпешно"
-#, c-format
msgid "bisect found first bad commit"
msgstr ""
#, c-format
-msgid ""
-"bisect run failed: 'git bisect--helper --bisect-state %s' exited with error "
-"code %d"
+msgid "bisect run failed: 'git bisect %s' exited with error code %d"
msgstr ""
-msgid "reset the bisection state"
-msgstr ""
-
-msgid "check whether bad or good terms exist"
-msgstr ""
-
-msgid "print out the bisect terms"
-msgstr ""
-
-msgid "start the bisect session"
-msgstr ""
-
-msgid "find the next bisection commit"
-msgstr ""
-
-msgid "mark the state of ref (or refs)"
-msgstr ""
-
-msgid "list the bisection steps so far"
-msgstr ""
-
-msgid "replay the bisection process from the given file"
-msgstr ""
-
-msgid "skip some commits for checkout"
-msgstr ""
-
-msgid "visualize the bisection"
-msgstr ""
-
-msgid "use <cmd>... to automatically bisect"
+#, c-format
+msgid "'%s' requires either no argument or a commit"
msgstr ""
-msgid "no log for BISECT_WRITE"
+#, c-format
+msgid "'%s' requires 0 or 1 argument"
msgstr ""
-msgid "--bisect-reset requires either no argument or a commit"
+#, c-format
+msgid "'%s' requires 0 arguments"
msgstr ""
-msgid "--bisect-terms requires 0 or 1 argument"
+msgid "no logfile given"
msgstr ""
-msgid "--bisect-next requires 0 arguments"
+#, c-format
+msgid "'%s' failed: no command provided."
msgstr ""
-msgid "--bisect-log requires 0 arguments"
+msgid "need a command"
msgstr ""
-msgid "no logfile given"
+#, c-format
+msgid "unknown command: '%s'"
msgstr ""
msgid "git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"
msgstr "git blame [<опции>] [<опции-редакции>] [<редакциÑ>] [--] <файл>"
+msgid "git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"
+msgstr ""
+
msgid "<rev-opts> are documented in git-rev-list(1)"
msgstr "<опции-rev-list> документированы в git-rev-list(1)"
@@ -2659,7 +2689,6 @@ msgstr ""
#. among various forms of relative timestamps, but
#. your language may need more or fewer display
#. columns.
-#.
msgid "4 years, 11 months ago"
msgstr "4 года и 11 меÑÑцев назад"
@@ -2734,9 +2763,6 @@ msgstr "Ðе удалоÑÑŒ обновить файл конфигурации"
msgid "cannot use -a with -d"
msgstr "Ð½ÐµÐ»ÑŒÐ·Ñ Ð¸Ñпользовать одновременно ключи -a и -d"
-msgid "Couldn't look up commit object for HEAD"
-msgstr "Ðе удалоÑÑŒ найти объект коммита Ð´Ð»Ñ HEAD"
-
#, c-format
msgid "Cannot delete branch '%s' checked out at '%s'"
msgstr "ÐÐµÐ»ÑŒÐ·Ñ ÑƒÐ´Ð°Ð»Ð¸Ñ‚ÑŒ ветку «%s» Ñ‚.к. она активна на «%s»"
@@ -2746,6 +2772,12 @@ msgid "remote-tracking branch '%s' not found."
msgstr "внешнÑÑ Ð¾Ñ‚ÑÐ»ÐµÐ¶Ð¸Ð²Ð°ÐµÐ¼Ð°Ñ Ð²ÐµÑ‚ÐºÐ° «%s» не найдена."
#, c-format
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+
+#, c-format
msgid "branch '%s' not found."
msgstr "ветка «%s» не найдена."
@@ -2775,20 +2807,22 @@ msgstr "ПроизводитÑÑ Ð¿ÐµÑ€ÐµÐ¼ÐµÑ‰ÐµÐ½Ð¸Ðµ ветки %s на %s"
msgid "Branch %s is being bisected at %s"
msgstr "ПроизводитÑÑ Ð´Ð²Ð¾Ð¸Ñ‡Ð½Ñ‹Ð¹ поиÑк в ветке %s на %s"
-msgid "cannot copy the current branch while not on any."
-msgstr ""
-"невозможно Ñкопировать текущую ветку, еÑли вы не находитеÑÑŒ ни на одной из "
-"веток."
-
-msgid "cannot rename the current branch while not on any."
-msgstr ""
-"невозможно переименовать текущую ветку, еÑли вы не находитеÑÑŒ ни на одной из "
-"них."
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "HEAD рабочего каталога %s не обновлён"
#, c-format
msgid "Invalid branch name: '%s'"
msgstr "ÐедейÑтвительное Ð¸Ð¼Ñ Ð²ÐµÑ‚ÐºÐ¸: «%s»"
+#, c-format
+msgid "No commit on branch '%s' yet."
+msgstr "Еще нет коммита на ветке «%s»."
+
+#, c-format
+msgid "No branch named '%s'."
+msgstr "Ðет ветки Ñ Ð¸Ð¼ÐµÐ½ÐµÐ¼ «%s»."
+
msgid "Branch rename failed"
msgstr "Сбой Ð¿ÐµÑ€ÐµÐ¸Ð¼ÐµÐ½Ð¾Ð²Ð°Ð½Ð¸Ñ Ð²ÐµÑ‚ÐºÐ¸"
@@ -2877,6 +2911,9 @@ msgstr "перемеÑтить/переименовать ветки и ее жÑ
msgid "move/rename a branch, even if target exists"
msgstr "перемеÑтить/переименовать ветку, даже еÑли целевое Ð¸Ð¼Ñ ÑƒÐ¶Ðµ ÑущеÑтвует"
+msgid "do not output a newline after empty formatted refs"
+msgstr ""
+
msgid "copy a branch and its reflog"
msgstr "Ñкопировать ветку и её журнал ÑÑылок"
@@ -2945,13 +2982,15 @@ msgstr "ÐÐµÐ»ÑŒÐ·Ñ Ð´Ð°Ñ‚ÑŒ опиÑание отÑоединённому ук
msgid "cannot edit description of more than one branch"
msgstr "Ð½ÐµÐ»ÑŒÐ·Ñ Ð¸Ð·Ð¼ÐµÐ½Ð¸Ñ‚ÑŒ опиÑание более одной ветки за раз"
-#, c-format
-msgid "No commit on branch '%s' yet."
-msgstr "Еще нет коммита на ветке «%s»."
+msgid "cannot copy the current branch while not on any."
+msgstr ""
+"невозможно Ñкопировать текущую ветку, еÑли вы не находитеÑÑŒ ни на одной из "
+"веток."
-#, c-format
-msgid "No branch named '%s'."
-msgstr "Ðет ветки Ñ Ð¸Ð¼ÐµÐ½ÐµÐ¼ «%s»."
+msgid "cannot rename the current branch while not on any."
+msgstr ""
+"невозможно переименовать текущую ветку, еÑли вы не находитеÑÑŒ ни на одной из "
+"них."
msgid "too many branches for a copy operation"
msgstr "Ñлишком много веток Ð´Ð»Ñ Ð¾Ð¿ÐµÑ€Ð°Ñ†Ð¸Ð¸ копированиÑ"
@@ -3017,7 +3056,9 @@ msgstr ""
msgid "not run from a git repository - no hooks to show\n"
msgstr ""
-msgid "git bugreport [-o|--output-directory <file>] [-s|--suffix <format>]"
+msgid ""
+"git bugreport [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--diagnose[=<mode>]]"
msgstr ""
msgid ""
@@ -3038,16 +3079,27 @@ msgid ""
"You can delete any lines you don't wish to share.\n"
msgstr ""
-msgid "specify a destination for the bugreport file"
+msgid "mode"
+msgstr "режим"
+
+msgid ""
+"create an additional zip archive of detailed diagnostics (default 'stats')"
msgstr ""
-msgid "specify a strftime format suffix for the filename"
+msgid "specify a destination for the bugreport file(s)"
+msgstr ""
+
+msgid "specify a strftime format suffix for the filename(s)"
msgstr ""
#, c-format
msgid "could not create leading directories for '%s'"
msgstr ""
+#, c-format
+msgid "unable to create diagnostics archive %s"
+msgstr ""
+
msgid "System Info"
msgstr ""
@@ -3062,16 +3114,21 @@ msgstr ""
msgid "Created new report at '%s'.\n"
msgstr ""
-msgid "git bundle create [<options>] <file> <git-rev-list args>"
+msgid ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<version>] <file> <git-rev-list-args>"
msgstr ""
-msgid "git bundle verify [<options>] <file>"
+msgid "git bundle verify [-q | --quiet] <file>"
msgstr ""
msgid "git bundle list-heads <file> [<refname>...]"
msgstr ""
-msgid "git bundle unbundle <file> [<refname>...]"
+msgid "git bundle unbundle [--progress] <file> [<refname>...]"
+msgstr ""
+
+msgid "need a <file> argument"
msgstr ""
msgid "do not show progress meter"
@@ -3080,11 +3137,11 @@ msgstr "не выводить прогреÑÑ Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ"
msgid "show progress meter"
msgstr "показать прогреÑÑ Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ"
-msgid "show progress meter during object writing phase"
-msgstr "показать прогреÑÑ Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ð²Ð¾ Ð²Ñ€ÐµÐ¼Ñ Ð·Ð°Ð¿Ð¸Ñи объектов"
+msgid "historical; same as --progress"
+msgstr ""
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "похоже на --all-progress при включенном прогреÑÑе выполнениÑ"
+msgid "historical; does nothing"
+msgstr ""
msgid "specify bundle format version"
msgstr ""
@@ -3106,10 +3163,6 @@ msgid "Unbundling objects"
msgstr ""
#, c-format
-msgid "Unknown subcommand: %s"
-msgstr "ÐеизвеÑÑ‚Ð½Ð°Ñ Ð¿Ð¾Ð´ÐºÐ¾Ð¼Ð°Ð½Ð´Ð°: %s"
-
-#, c-format
msgid "cannot read object %s '%s'"
msgstr "невозможно прочитать объект %s «%s»"
@@ -3131,10 +3184,6 @@ msgstr ""
msgid "%s takes no arguments"
msgstr ""
-#, c-format
-msgid "unknown command: '%s'"
-msgstr ""
-
msgid "only one batch option may be specified"
msgstr ""
@@ -3151,7 +3200,7 @@ msgid ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
+" [--textconv | --filters] [-z]"
msgstr ""
msgid ""
@@ -3180,6 +3229,9 @@ msgstr "показать размер объекта"
msgid "allow -s and -t to work with broken/corrupt objects"
msgstr "разрешить -s и -t работать Ñ Ð¿Ð¾Ð²Ñ€ÐµÐ¶Ð´Ñ‘Ð½Ð½Ñ‹Ð¼Ð¸ объектами"
+msgid "use mail map file"
+msgstr ""
+
msgid "Batch objects requested on stdin (or --batch-all-objects)"
msgstr ""
@@ -3189,6 +3241,9 @@ msgstr ""
msgid "like --batch, but don't emit <contents>"
msgstr ""
+msgid "stdin is NUL-terminated"
+msgstr ""
+
msgid "read commands from stdin"
msgstr ""
@@ -3250,18 +3305,18 @@ msgstr ""
msgid "<object> required with '-%c'"
msgstr ""
-msgid "too many arguments"
-msgstr ""
-
#, c-format
msgid "only two arguments allowed in <type> <object> mode, not %d"
msgstr ""
-msgid "git check-attr [-a | --all | <attr>...] [--] <pathname>..."
-msgstr "git check-attr [-a | --all | <атрибут>...] [--] <путь>..."
+msgid ""
+"git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] "
+"<pathname>..."
+msgstr ""
-msgid "git check-attr --stdin [-z] [-a | --all | <attr>...]"
-msgstr "git check-attr --stdin [-z] [-a | --all | <атрибут>...]"
+msgid ""
+"git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"
+msgstr ""
msgid "report all attributes set on file"
msgstr "вывеÑти вÑе атрибуты уÑтановленные Ð´Ð»Ñ Ñ„Ð°Ð¹Ð»Ð°"
@@ -3275,6 +3330,12 @@ msgstr "прочитать имена файлов из Ñтандартного
msgid "terminate input and output records by a NUL character"
msgstr "окончание ввода и вывода запиÑей по ÐУЛЕВОМУ Ñимволу"
+msgid "<tree-ish>"
+msgstr ""
+
+msgid "which tree-ish to check attributes at"
+msgstr ""
+
msgid "suppress progress reporting"
msgstr "не выводить прогреÑÑ Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ"
@@ -3787,9 +3848,9 @@ msgid "use overlay mode"
msgstr ""
msgid ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <paths>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] "
+"[<pathspec>...]"
msgstr ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <шаблон>] [-x | -X] [--] <пути>..."
#, c-format
msgid "Removing %s\n"
@@ -3853,7 +3914,7 @@ msgstr ""
"* - выбрать вÑе Ñлементы\n"
" - (пуÑто) завершить выделение\n"
-#, c-format, perl-format
+#, c-format
msgid "Huh (%s)?\n"
msgstr "Хм (%s)?\n"
@@ -4006,9 +4067,6 @@ msgstr "глубина"
msgid "create a shallow clone of that depth"
msgstr "Ñделать чаÑтичный клон указанной глубины"
-msgid "time"
-msgstr "времÑ"
-
msgid "create a shallow clone since a specific time"
msgstr "Ñделать чаÑтичный клон до определенного времени"
@@ -4062,6 +4120,12 @@ msgstr ""
msgid "initialize sparse-checkout file to include only files at root"
msgstr ""
+msgid "uri"
+msgstr ""
+
+msgid "a URI for downloading bundles before fetching from origin remote"
+msgstr ""
+
#, c-format
msgid "info: Could not add alternate for '%s': %s\n"
msgstr "информациÑ: Ðе удалоÑÑŒ добавить альтернативу Ð´Ð»Ñ Â«%s»: %s\n"
@@ -4075,10 +4139,18 @@ msgid "%s exists and is not a directory"
msgstr "%s уже ÑущеÑтвует и не ÑвлÑетÑÑ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ð¾Ð¼"
#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr ""
+
+#, c-format
msgid "failed to start iterator over '%s'"
msgstr ""
#, c-format
+msgid "symlink '%s' exists, refusing to clone with --local"
+msgstr ""
+
+#, c-format
msgid "failed to unlink '%s'"
msgstr "Ñбой отÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Â«%s»"
@@ -4124,10 +4196,8 @@ msgstr "не удалоÑÑŒ обновить %s"
msgid "failed to initialize sparse-checkout"
msgstr ""
-msgid "remote HEAD refers to nonexistent ref, unable to checkout.\n"
+msgid "remote HEAD refers to nonexistent ref, unable to checkout"
msgstr ""
-"внешний HEAD ÑÑылаетÑÑ Ð½Ð° неÑущеÑтвующую ÑÑылку, Ð½ÐµÐ»ÑŒÐ·Ñ Ð¿ÐµÑ€ÐµÐºÐ»ÑŽÑ‡Ð¸Ñ‚ÑŒÑÑ Ð½Ð° "
-"такое ÑоÑтоÑние.\n"
msgid "unable to checkout working tree"
msgstr "не удалоÑÑŒ переключитьÑÑ Ð½Ð° верÑию в рабочем каталоге"
@@ -4147,8 +4217,9 @@ msgstr "Слишком много аргументов."
msgid "You must specify a repository to clone."
msgstr "Ð’Ñ‹ должны указать репозиторий Ð´Ð»Ñ ÐºÐ»Ð¾Ð½Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ."
-#, c-format
-msgid "options '%s' and '%s %s' cannot be used together"
+msgid ""
+"--bundle-uri is incompatible with --depth, --shallow-since, and --shallow-"
+"exclude"
msgstr ""
#, c-format
@@ -4227,6 +4298,16 @@ msgstr "--local игнорируетÑÑ"
msgid "cannot clone from filtered bundle"
msgstr ""
+msgid "failed to initialize the repo, skipping bundle URI"
+msgstr ""
+
+#, c-format
+msgid "failed to fetch objects from bundle URI '%s'"
+msgstr ""
+
+msgid "failed to fetch advertised bundles"
+msgstr ""
+
msgid "remote transport reported error"
msgstr ""
@@ -4262,13 +4343,16 @@ msgid "--command must be the first argument"
msgstr "параметр --command должен быть первым"
msgid ""
-"git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]"
+"git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]"
msgstr ""
msgid ""
-"git commit-graph write [--object-dir <objdir>] [--append] [--"
-"split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <n>] [--[no-]progress] <split options>"
+"git commit-graph write [--object-dir <dir>] [--append]\n"
+" [--split[=<strategy>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <split options>"
msgstr ""
msgid "dir"
@@ -4337,13 +4421,12 @@ msgstr ""
msgid "Collecting commits from input"
msgstr ""
-#, c-format
-msgid "unrecognized subcommand: %s"
+msgid "git commit-tree <tree> [(-p <parent>)...]"
msgstr ""
msgid ""
-"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...] [(-F "
-"<file>)...] <tree>"
+"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]\n"
+" [(-F <file>)...] <tree>"
msgstr ""
#, c-format
@@ -4386,11 +4469,20 @@ msgstr "необходимо указать одно дерево"
msgid "git commit-tree: failed to read"
msgstr "git commit-tree: Ñбой при чтении"
-msgid "git commit [<options>] [--] <pathspec>..."
-msgstr "git commit [<опции>] [--] <Ñпецификатор-пути>..."
+msgid ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|"
+"reword):]<commit>)]\n"
+" [-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n"
+" [--date=<date>] [--cleanup=<mode>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
-msgid "git status [<options>] [--] <pathspec>..."
-msgstr "git status [<опции>] [--] <Ñпецификатор-пути>..."
+msgid "git status [<options>] [--] [<pathspec>...]"
+msgstr ""
msgid ""
"You asked to amend the most recent commit, but doing so would make\n"
@@ -4672,9 +4764,6 @@ msgstr "показать ÑÑ‚Ð°Ñ‚ÑƒÑ Ð² длинном формате (по уÐ
msgid "terminate entries with NUL"
msgstr "завершать запиÑи ÐУЛЕВЫМ байтом"
-msgid "mode"
-msgstr "режим"
-
msgid "show untracked files, optional modes: all, normal, no. (Default: all)"
msgstr ""
"показать неотÑлеживаемые файлы, опциональные режимы: all (вÑе), normal (как "
@@ -4747,7 +4836,6 @@ msgstr "иÑпользовать Ñообщение указанного комÐ
#. TRANSLATORS: Leave "[(amend|reword):]" as-is,
#. and only translate <commit>.
-#.
msgid "[(amend|reword):]commit"
msgstr ""
@@ -5136,11 +5224,16 @@ msgstr ""
msgid "unable to get credential storage lock in %d ms"
msgstr ""
-msgid "git describe [<options>] [<commit-ish>...]"
-msgstr "git describe [<опции>] [<указатель-коммита>...]"
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"
+msgstr ""
-msgid "git describe [<options>] --dirty"
-msgstr "git describe [<опции>] --dirty"
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]"
+msgstr ""
+
+msgid "git describe <blob>"
+msgstr ""
msgid "head"
msgstr "указатель на ветку"
@@ -5262,6 +5355,20 @@ msgstr "Имена не найдены, не могу ничего опиÑатÑ
msgid "option '%s' and commit-ishes cannot be used together"
msgstr ""
+msgid ""
+"git diagnose [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--mode=<mode>]"
+msgstr ""
+
+msgid "specify a destination for the diagnostics archive"
+msgstr ""
+
+msgid "specify a strftime format suffix for the filename"
+msgstr ""
+
+msgid "specify the content of the diagnostic archive"
+msgstr ""
+
msgid "--merge-base only works with two commits"
msgstr ""
@@ -5269,6 +5376,9 @@ msgstr ""
msgid "'%s': not a regular file or symlink"
msgstr "«%s»: не ÑвлÑетÑÑ Ð¾Ð±Ñ‹Ñ‡Ð½Ñ‹Ð¼ файлом или Ñимвольной ÑÑылкой"
+msgid "no merge given, only parents."
+msgstr ""
+
#, c-format
msgid "invalid option: %s"
msgstr "неправильный параметр: %s"
@@ -5380,25 +5490,6 @@ msgstr "не передана <утилита> Ð´Ð»Ñ --tool=<утилита>"
msgid "no <cmd> given for --extcmd=<cmd>"
msgstr "не передана <команда> Ð´Ð»Ñ --extcmd=<команда>"
-msgid "git env--helper --type=[bool|ulong] <options> <env-var>"
-msgstr ""
-
-msgid "default for git_env_*(...) to fall back on"
-msgstr ""
-
-msgid "be quiet only use git_env_*() value as exit code"
-msgstr ""
-
-#, c-format
-msgid "option `--default' expects a boolean value with `--type=bool`, not `%s`"
-msgstr ""
-
-#, c-format
-msgid ""
-"option `--default' expects an unsigned long value with `--type=ulong`, not `"
-"%s`"
-msgstr ""
-
msgid "git fast-export [<rev-list-opts>]"
msgstr ""
@@ -5507,114 +5598,14 @@ msgstr "git fetch --all [<опции>]"
msgid "fetch.parallel cannot be negative"
msgstr ""
-msgid "fetch from all remotes"
-msgstr "извлечь Ñо вÑех внешних репозиториев"
-
-msgid "set upstream for git pull/fetch"
-msgstr ""
-
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "допиÑать к .git/FETCH_HEAD вмеÑто перезапиÑи"
-
-msgid "use atomic transaction to update references"
-msgstr ""
-
-msgid "path to upload pack on remote end"
-msgstr "путь к программе упаковки пакета на машине Ñ Ð²Ð½ÐµÑˆÐ½Ð¸Ð¼ репозиторием"
-
-msgid "force overwrite of local reference"
-msgstr ""
-
-msgid "fetch from multiple remotes"
-msgstr "извлечь Ñ Ð½ÐµÑкольких внешних репозиториев"
-
-msgid "fetch all tags and associated objects"
-msgstr "извлечь вÑе метки и ÑвÑзанные объекты"
-
-msgid "do not fetch all tags (--no-tags)"
-msgstr "не извлекать вÑе метки (--no-tags)"
-
-msgid "number of submodules fetched in parallel"
-msgstr "количеÑтво подмодулей, которые будут Ñкачаны парралельно"
-
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr ""
-
-msgid "prune remote-tracking branches no longer on remote"
-msgstr ""
-"почиÑтить отÑлеживаемые внешние ветки, которых уже нет на внешнем репозитории"
-
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr ""
-
-msgid "on-demand"
-msgstr "по требованию"
-
-msgid "control recursive fetching of submodules"
-msgstr "управление рекурÑивным извлечением подмодулей"
-
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr ""
-
-msgid "keep downloaded pack"
-msgstr "оÑтавить загруженный пакет данных"
-
-msgid "allow updating of HEAD ref"
-msgstr "разрешить обновление ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ HEAD"
-
-msgid "deepen history of shallow clone"
-msgstr "углубить иÑторию чаÑтичного клона"
-
-msgid "deepen history of shallow repository based on time"
-msgstr "углубить иÑторию чаÑтичного клона оÑновываÑÑÑŒ на времени"
-
-msgid "convert to a complete repository"
-msgstr "преобразовать в полный репозиторий"
-
-msgid "re-fetch without negotiating common commits"
-msgstr ""
-
-msgid "prepend this to submodule path output"
-msgstr "приÑоединÑÑ‚ÑŒ Ñто Ñпереди к выводу путей подмодулÑ"
-
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr ""
-"наÑтроить по умолчанию рекурÑивное извлечение подмодулей (более низкий "
-"приоритет, чем файлы конфигурации)"
-
-msgid "accept refs that update .git/shallow"
-msgstr "принимать ÑÑылки, которые обновлÑÑŽÑ‚ .git/shallow"
-
-msgid "refmap"
-msgstr "ÑоответÑтвие-ÑÑылок"
-
-msgid "specify fetch refmap"
-msgstr "указать ÑоответÑтвие ÑÑылок при извлечении"
-
-msgid "report that we have only objects reachable from this object"
-msgstr ""
-
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr ""
-
-msgid "run 'maintenance --auto' after fetching"
-msgstr ""
-
-msgid "check for forced-updates on all updated branches"
-msgstr ""
-
-msgid "write the commit-graph after fetching"
-msgstr ""
-
-msgid "accept refspecs from stdin"
-msgstr ""
-
msgid "couldn't find remote ref HEAD"
msgstr ""
#, c-format
+msgid "From %.*s\n"
+msgstr "Из %.*s\n"
+
+#, c-format
msgid "object %s not found"
msgstr "объект %s не найден"
@@ -5624,10 +5615,7 @@ msgstr "[актуально]"
msgid "[rejected]"
msgstr "[отклонено]"
-msgid "can't fetch in current branch"
-msgstr "Ð½ÐµÐ»ÑŒÐ·Ñ Ð¸Ð·Ð²Ð»ÐµÑ‡ÑŒ текущую ветку"
-
-msgid "checked out in another worktree"
+msgid "can't fetch into checked-out branch"
msgstr ""
msgid "[tag update]"
@@ -5681,10 +5669,6 @@ msgid "rejected %s because shallow roots are not allowed to be updated"
msgstr ""
#, c-format
-msgid "From %.*s\n"
-msgstr "Из %.*s\n"
-
-#, c-format
msgid ""
"some local refs could not be updated; try running\n"
" 'git remote prune %s' to remove any old, conflicting branches"
@@ -5769,6 +5753,110 @@ msgstr ""
msgid "you need to specify a tag name"
msgstr ""
+msgid "fetch from all remotes"
+msgstr "извлечь Ñо вÑех внешних репозиториев"
+
+msgid "set upstream for git pull/fetch"
+msgstr ""
+
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "допиÑать к .git/FETCH_HEAD вмеÑто перезапиÑи"
+
+msgid "use atomic transaction to update references"
+msgstr ""
+
+msgid "path to upload pack on remote end"
+msgstr "путь к программе упаковки пакета на машине Ñ Ð²Ð½ÐµÑˆÐ½Ð¸Ð¼ репозиторием"
+
+msgid "force overwrite of local reference"
+msgstr ""
+
+msgid "fetch from multiple remotes"
+msgstr "извлечь Ñ Ð½ÐµÑкольких внешних репозиториев"
+
+msgid "fetch all tags and associated objects"
+msgstr "извлечь вÑе метки и ÑвÑзанные объекты"
+
+msgid "do not fetch all tags (--no-tags)"
+msgstr "не извлекать вÑе метки (--no-tags)"
+
+msgid "number of submodules fetched in parallel"
+msgstr "количеÑтво подмодулей, которые будут Ñкачаны парралельно"
+
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+
+msgid "prune remote-tracking branches no longer on remote"
+msgstr ""
+"почиÑтить отÑлеживаемые внешние ветки, которых уже нет на внешнем репозитории"
+
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr ""
+
+msgid "on-demand"
+msgstr "по требованию"
+
+msgid "control recursive fetching of submodules"
+msgstr "управление рекурÑивным извлечением подмодулей"
+
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr ""
+
+msgid "keep downloaded pack"
+msgstr "оÑтавить загруженный пакет данных"
+
+msgid "allow updating of HEAD ref"
+msgstr "разрешить обновление ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ HEAD"
+
+msgid "deepen history of shallow clone"
+msgstr "углубить иÑторию чаÑтичного клона"
+
+msgid "deepen history of shallow repository based on time"
+msgstr "углубить иÑторию чаÑтичного клона оÑновываÑÑÑŒ на времени"
+
+msgid "convert to a complete repository"
+msgstr "преобразовать в полный репозиторий"
+
+msgid "re-fetch without negotiating common commits"
+msgstr ""
+
+msgid "prepend this to submodule path output"
+msgstr "приÑоединÑÑ‚ÑŒ Ñто Ñпереди к выводу путей подмодулÑ"
+
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+"наÑтроить по умолчанию рекурÑивное извлечение подмодулей (более низкий "
+"приоритет, чем файлы конфигурации)"
+
+msgid "accept refs that update .git/shallow"
+msgstr "принимать ÑÑылки, которые обновлÑÑŽÑ‚ .git/shallow"
+
+msgid "refmap"
+msgstr "ÑоответÑтвие-ÑÑылок"
+
+msgid "specify fetch refmap"
+msgstr "указать ÑоответÑтвие ÑÑылок при извлечении"
+
+msgid "report that we have only objects reachable from this object"
+msgstr ""
+
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr ""
+
+msgid "run 'maintenance --auto' after fetching"
+msgstr ""
+
+msgid "check for forced-updates on all updated branches"
+msgstr ""
+
+msgid "write the commit-graph after fetching"
+msgstr ""
+
+msgid "accept refspecs from stdin"
+msgstr ""
+
msgid "--negotiate-only needs one or more --negotiation-tip=*"
msgstr ""
@@ -5778,6 +5866,10 @@ msgstr ""
msgid "--unshallow on a complete repository does not make sense"
msgstr "--unshallow не имеет ÑмыÑла на полном репозитории"
+#, c-format
+msgid "failed to fetch bundles from '%s'"
+msgstr ""
+
msgid "fetch --all does not take a repository argument"
msgstr "fetch --all не принимает Ð¸Ð¼Ñ Ñ€ÐµÐ¿Ð¾Ð·Ð¸Ñ‚Ð¾Ñ€Ð¸Ñ ÐºÐ°Ðº аргумент"
@@ -5878,7 +5970,13 @@ msgstr "вывод только ÑÑылок, которые Ñодержат к
msgid "print only refs which don't contain the commit"
msgstr "вывод только ÑÑылок, которые не Ñодержат коммит"
-msgid "git for-each-repo --config=<config> <command-args>"
+msgid "read reference patterns from stdin"
+msgstr ""
+
+msgid "unknown arguments supplied with --stdin"
+msgstr ""
+
+msgid "git for-each-repo --config=<config> [--] <arguments>"
msgstr ""
msgid "config"
@@ -5890,6 +5988,10 @@ msgstr ""
msgid "missing --config=<config>"
msgstr ""
+#, c-format
+msgid "got bad config --config=%s"
+msgstr ""
+
msgid "unknown"
msgstr ""
@@ -6034,18 +6136,35 @@ msgstr "%s: отÑоединённый указатель HEAD ни на что
msgid "notice: %s points to an unborn branch (%s)"
msgstr ""
-msgid "Checking cache tree"
+#, c-format
+msgid "Checking cache tree of %s"
msgstr ""
#, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
msgstr ""
msgid "non-tree in cache-tree"
msgstr ""
-msgid "git fsck [<options>] [<object>...]"
-msgstr "git fsck [<опции>] [<объект>...]"
+#, c-format
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr ""
+
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr ""
+
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr ""
+
+msgid ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<object>...]"
+msgstr ""
msgid "show unreachable objects"
msgstr "показать недоÑтупные объекты"
@@ -6100,12 +6219,6 @@ msgstr ""
msgid "git fsmonitor--daemon run [<options>]"
msgstr ""
-msgid "git fsmonitor--daemon stop"
-msgstr ""
-
-msgid "git fsmonitor--daemon status"
-msgstr ""
-
#, c-format
msgid "value of '%s' out of range: %d"
msgstr ""
@@ -6342,7 +6455,19 @@ msgstr ""
msgid "use at most one of --auto and --schedule=<frequency>"
msgstr ""
-msgid "failed to run 'git config'"
+#, c-format
+msgid "unable to add '%s' value of '%s'"
+msgstr ""
+
+msgid "return success even if repository was not registered"
+msgstr ""
+
+#, c-format
+msgid "unable to unset '%s' value of '%s'"
+msgstr ""
+
+#, c-format
+msgid "repository '%s' is not registered"
msgstr ""
#, c-format
@@ -6369,10 +6494,13 @@ msgstr ""
msgid "failed to run 'crontab -l'; your system might not support 'cron'"
msgstr ""
-msgid "failed to run 'crontab'; your system might not support 'cron'"
+msgid "failed to create crontab temporary file"
msgstr ""
-msgid "failed to open stdin of 'crontab'"
+msgid "failed to open temporary file"
+msgstr ""
+
+msgid "failed to run 'crontab'; your system might not support 'cron'"
msgstr ""
msgid "'crontab' died"
@@ -6421,10 +6549,6 @@ msgstr ""
msgid "git maintenance <subcommand> [<options>]"
msgstr ""
-#, c-format
-msgid "invalid subcommand: %s"
-msgstr ""
-
msgid "git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]"
msgstr "git grep [<опции>] [-e] <шаблон> [<редакциÑ>...] [[--] <путь>...]"
@@ -6440,7 +6564,6 @@ msgstr "указано недопуÑтимое количеÑтво потокÐ
#. TRANSLATORS: %s is the configuration
#. variable for tweaking threads, currently
#. grep.threads
-#.
#, c-format
msgid "no threads support, ignoring %s"
msgstr "нет поддержки потоков, игнорирование %s"
@@ -6595,6 +6718,9 @@ msgstr "показать Ñовпадающие файлы Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ пÑ
msgid "allow calling of grep(1) (ignored by this build)"
msgstr "разрешить вызов grep(1) (игнорируетÑÑ Ð² Ñтой Ñборке)"
+msgid "maximum number of results per file"
+msgstr ""
+
msgid "no pattern given"
msgstr ""
@@ -6630,11 +6756,12 @@ msgid "both --cached and trees are given"
msgstr ""
msgid ""
-"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] "
-"[--] <file>..."
+"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
+" [--stdin [--literally]] [--] <file>..."
+msgstr ""
+
+msgid "git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]"
msgstr ""
-"git hash-object [-t <тип>] [-w] [--path=<файл> | --no-filters] [--stdin] "
-"[--] <файл>..."
msgid "object type"
msgstr "тип объекта"
@@ -6683,10 +6810,16 @@ msgstr ""
msgid "print list of useful guides"
msgstr "вывеÑти ÑпиÑок полезных руководÑтв"
+msgid "print list of user-facing repository, command and file interfaces"
+msgstr ""
+
+msgid "print list of file formats, protocols and other developer interfaces"
+msgstr ""
+
msgid "print all configuration variable names"
msgstr ""
-msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>]"
+msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"
msgstr ""
#, c-format
@@ -6756,12 +6889,17 @@ msgstr "иÑпользование: %s%s"
msgid "'git help config' for more information"
msgstr ""
-msgid "git hook run [--ignore-missing] <hook-name> [-- <hook-args>]"
+msgid ""
+"git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-"
+"args>]"
msgstr ""
msgid "silently ignore missing requested <hook-name>"
msgstr ""
+msgid "file to read into hooks' stdin"
+msgstr ""
+
#, c-format
msgid "object type mismatch at %s"
msgstr "неÑоответÑтвие типа объекта на %s"
@@ -7065,11 +7203,11 @@ msgid "Initialized empty Git repository in %s%s\n"
msgstr "Инициализирован пуÑтой репозиторий Git в %s%s\n"
msgid ""
-"git init [-q | --quiet] [--bare] [--template=<template-directory>] [--"
-"shared[=<permissions>]] [<directory>]"
+"git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
+" [--separate-git-dir <git-dir>] [--object-format=<format>]\n"
+" [-b <branch-name> | --initial-branch=<branch-name>]\n"
+" [--shared[=<permissions>]] [<directory>]"
msgstr ""
-"git init [-q | --quiet] [--bare] [--template=<каталог-шаблонов>] [--"
-"shared[=<права-доÑтупа>]] [<каталог>]"
msgid "permissions"
msgstr "права-доÑтупа"
@@ -7111,11 +7249,10 @@ msgid "--separate-git-dir incompatible with bare repository"
msgstr ""
msgid ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"<token>[(=|:)<value>])...] [<file>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer <token>[(=|:)<value>])...]\n"
+" [--parse] [<file>...]"
msgstr ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"<ключ>[(=|:)<значение>])...] [<файл>...]"
msgid "edit files in place"
msgstr "редактировать файлы на меÑте"
@@ -7172,7 +7309,7 @@ msgstr "не выводить ÑпиÑок изменений"
msgid "show source"
msgstr "показать иÑточник"
-msgid "use mail map file"
+msgid "clear all previously-defined decoration filters"
msgstr ""
msgid "only decorate refs that match <pattern>"
@@ -7422,6 +7559,9 @@ msgstr ""
msgid "percentage by which creation is weighted"
msgstr ""
+msgid "show in-body From: even if identical to the e-mail header"
+msgstr ""
+
#, c-format
msgid "invalid ident line: %s"
msgstr "Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»ÑŒÐ½Ð°Ñ Ñтрока идентификации: %s"
@@ -7482,6 +7622,18 @@ msgstr ""
"Ðе удалоÑÑŒ найти отÑлеживаемую внешнюю ветку, укажите <вышеÑтоÑщую-ветку> "
"вручную.\n"
+#, c-format
+msgid "bad ls-files format: element '%s' does not start with '('"
+msgstr ""
+
+#, c-format
+msgid "bad ls-files format: element '%s' does not end in ')'"
+msgstr ""
+
+#, c-format
+msgid "bad ls-files format: %%%.*s"
+msgstr ""
+
msgid "git ls-files [<options>] [<file>...]"
msgstr "git ls-files [<опции>] [<файл>...]"
@@ -7569,9 +7721,14 @@ msgid "show sparse directories in the presence of a sparse index"
msgstr ""
msgid ""
+"--format cannot be used with -s, -o, -k, -t, --resolve-undo, --deduplicate, "
+"--eol"
+msgstr ""
+
+msgid ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<repository> [<refs>...]]"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
+" [--symref] [<repository> [<patterns>...]]"
msgstr ""
msgid "do not print remote URL"
@@ -7704,12 +7861,12 @@ msgstr "git merge-base [-a | --all] <коммит> <коммит>..."
msgid "git merge-base [-a | --all] --octopus <commit>..."
msgstr "git merge-base [-a | --all] --octopus <коммит>..."
-msgid "git merge-base --independent <commit>..."
-msgstr "git merge-base --independent <коммит>..."
-
msgid "git merge-base --is-ancestor <commit> <commit>"
msgstr "git merge-base --is-ancestor <коммит> <коммит>"
+msgid "git merge-base --independent <commit>..."
+msgstr "git merge-base --independent <коммит>..."
+
msgid "git merge-base --fork-point <ref> [<commit>]"
msgstr "git merge-base --fork-point <ÑÑылка> [<коммит>]"
@@ -7789,6 +7946,56 @@ msgstr "не удалоÑÑŒ раÑпознать ÑÑылку «%s»"
msgid "Merging %s with %s\n"
msgstr "СлиÑние %s и %s\n"
+msgid "not something we can merge"
+msgstr "не ÑвлÑетÑÑ Ñ‚ÐµÐ¼, что можно Ñлить"
+
+msgid "refusing to merge unrelated histories"
+msgstr "отказ ÑлиÑÐ½Ð¸Ñ Ð½ÐµÑвÑзанных иÑторий изменений"
+
+msgid "failure to merge"
+msgstr ""
+
+msgid "git merge-tree [--write-tree] [<options>] <branch1> <branch2>"
+msgstr ""
+
+msgid "git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"
+msgstr ""
+
+msgid "do a real merge instead of a trivial merge"
+msgstr ""
+
+msgid "do a trivial merge only"
+msgstr ""
+
+msgid "also show informational/conflict messages"
+msgstr ""
+
+msgid "list filenames without modes/oids/stages"
+msgstr ""
+
+msgid "allow merging unrelated histories"
+msgstr "разрешить ÑлиÑние неÑвÑзанных иÑторий изменений"
+
+msgid "perform multiple merges, one per line of input"
+msgstr ""
+
+msgid "specify a merge-base for the merge"
+msgstr ""
+
+msgid "--trivial-merge is incompatible with all other options"
+msgstr ""
+
+msgid "--merge-base is incompatible with --stdin"
+msgstr ""
+
+#, c-format
+msgid "malformed input line: '%s'."
+msgstr "Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»ÑŒÐ½Ð°Ñ Ð²Ð²ÐµÐ´ÐµÐ½Ð½Ð°Ñ Ñтрока: «%s»."
+
+#, c-format
+msgid "merging cannot continue; got unclean result of %d"
+msgstr ""
+
msgid "git merge [<options>] [<commit>...]"
msgstr "git merge [<опции>] [<коммит>...]"
@@ -7870,9 +8077,6 @@ msgstr ""
msgid "continue the current in-progress merge"
msgstr "продолжить выполнение проиÑходÑщего ÑлиÑниÑ"
-msgid "allow merging unrelated histories"
-msgstr "разрешить ÑлиÑние неÑвÑзанных иÑторий изменений"
-
msgid "bypass pre-merge-commit and commit-msg hooks"
msgstr ""
@@ -7994,9 +8198,6 @@ msgstr "не удалоÑÑŒ закрыть «%s»"
msgid "not something we can merge in %s: %s"
msgstr "не ÑвлÑетÑÑ Ñ‚ÐµÐ¼, что можно Ñлить в %s: %s"
-msgid "not something we can merge"
-msgstr "не ÑвлÑетÑÑ Ñ‚ÐµÐ¼, что можно Ñлить"
-
msgid "--abort expects no arguments"
msgstr "Ð¾Ð¿Ñ†Ð¸Ñ --abort не принимает аргументы"
@@ -8046,14 +8247,17 @@ msgstr "%s не ÑвлÑетÑÑ Ñ‚ÐµÐ¼, что можно Ñлить"
msgid "Can merge only exactly one commit into empty head"
msgstr "Можно только один коммит в пуÑтую ветку."
-msgid "refusing to merge unrelated histories"
-msgstr "отказ ÑлиÑÐ½Ð¸Ñ Ð½ÐµÑвÑзанных иÑторий изменений"
-
#, c-format
msgid "Updating %s..%s\n"
msgstr "Обновление %s..%s\n"
#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+" %s"
+msgstr ""
+
+#, c-format
msgid "Trying really trivial in-index merge...\n"
msgstr "Попытка тривиального ÑлиÑÐ½Ð¸Ñ Ð² индекÑе...\n"
@@ -8088,6 +8292,10 @@ msgstr ""
"выполнением коммита\n"
#, c-format
+msgid "When finished, apply stashed changes with `git stash pop`\n"
+msgstr ""
+
+#, c-format
msgid "warning: tag input does not pass fsck: %s"
msgstr ""
@@ -8201,6 +8409,9 @@ msgstr "Проверка Ð¿ÐµÑ€ÐµÐ¸Ð¼ÐµÐ½Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¸Ð· «%s» в «%s»\n"
msgid "bad source"
msgstr "плохой иÑточник"
+msgid "destination exists"
+msgstr "целевой путь уже ÑущеÑтвует"
+
msgid "can not move directory into itself"
msgstr "Ð½ÐµÐ»ÑŒÐ·Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÑтить каталог в Ñамого ÑебÑ"
@@ -8216,9 +8427,6 @@ msgstr "не под верÑионным контролем"
msgid "conflicted"
msgstr ""
-msgid "destination exists"
-msgstr "целевой путь уже ÑущеÑтвует"
-
#, c-format
msgid "overwriting '%s'"
msgstr "перезапиÑÑŒ «%s»"
@@ -8232,6 +8440,9 @@ msgstr "неÑколько иÑточников Ð´Ð»Ñ Ð¾Ð´Ð½Ð¾Ð³Ð¾ целево
msgid "destination directory does not exist"
msgstr "целевой каталог не ÑущеÑтвует"
+msgid "destination exists in the index"
+msgstr ""
+
#, c-format
msgid "%s, source=%s, destination=%s"
msgstr "%s, откуда=%s, куда=%s"
@@ -8399,16 +8610,11 @@ msgid "cannot read note data from non-blob object '%s'."
msgstr "не удалоÑÑŒ прочитать данные заметки из недвоичного объекта «%s»."
#, c-format
-msgid "malformed input line: '%s'."
-msgstr "Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»ÑŒÐ½Ð°Ñ Ð²Ð²ÐµÐ´ÐµÐ½Ð½Ð°Ñ Ñтрока: «%s»."
-
-#, c-format
msgid "failed to copy notes from '%s' to '%s'"
msgstr "не удалоÑÑŒ Ñкопировать заметку из «%s» в «%s»"
#. TRANSLATORS: the first %s will be replaced by a git
#. notes command: 'add', 'merge', 'remove', etc.
-#.
#, c-format
msgid "refusing to %s notes in %s (outside of refs/notes/)"
msgstr "отказ в перезапиÑи %s заметок в %s (за пределами refs/notes/)"
@@ -8590,20 +8796,15 @@ msgid "use notes from <notes-ref>"
msgstr "иÑпользовать заметку из <ÑÑылка-на-заметку>"
#, c-format
-msgid "unknown subcommand: %s"
-msgstr "неизвеÑÑ‚Ð½Ð°Ñ Ð¿Ð¾Ð´ÐºÐ¾Ð¼Ð°Ð½Ð´Ð°: %s"
+msgid "unknown subcommand: `%s'"
+msgstr ""
-msgid ""
-"git pack-objects --stdout [<options>...] [< <ref-list> | < <object-list>]"
+msgid "git pack-objects --stdout [<options>] [< <ref-list> | < <object-list>]"
msgstr ""
-"git pack-objects --stdout [<опции>...] [< <ÑпиÑок-ÑÑылок> | < <ÑпиÑок-"
-"объектов>]"
msgid ""
-"git pack-objects [<options>...] <base-name> [< <ref-list> | < <object-list>]"
+"git pack-objects [<options>] <base-name> [< <ref-list> | < <object-list>]"
msgstr ""
-"git pack-objects [<опции>...] <имÑ-базы> [< <ÑпиÑок-ÑÑылок> | < <ÑпиÑок-"
-"объектов>]"
#, c-format
msgid ""
@@ -8782,6 +8983,12 @@ msgstr "Ð½ÐµÐ¿Ð¾Ð´Ð´ÐµÑ€Ð¶Ð¸Ð²Ð°ÐµÐ¼Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ Ð¸Ð½Ð´ÐµÐºÑа %s"
msgid "bad index version '%s'"
msgstr "Ð¿Ð»Ð¾Ñ…Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ Ð¸Ð½Ð´ÐµÐºÑа «%s»"
+msgid "show progress meter during object writing phase"
+msgstr "показать прогреÑÑ Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ð²Ð¾ Ð²Ñ€ÐµÐ¼Ñ Ð·Ð°Ð¿Ð¸Ñи объектов"
+
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "похоже на --all-progress при включенном прогреÑÑе выполнениÑ"
+
msgid "<version>[,<offset>]"
msgstr ""
@@ -8967,8 +9174,11 @@ msgid ""
"to <git@vger.kernel.org>. Thanks.\n"
msgstr ""
-msgid "git pack-refs [<options>]"
-msgstr "git pack-refs [<опции>]"
+msgid "refusing to run without --i-still-use-this"
+msgstr ""
+
+msgid "git pack-refs [--all] [--no-prune]"
+msgstr ""
msgid "pack everything"
msgstr "паковать вÑÑ‘"
@@ -8976,6 +9186,18 @@ msgstr "паковать вÑÑ‘"
msgid "prune loose refs (default)"
msgstr "почиÑтить Ñлабые ÑÑылки (по умолчанию)"
+msgid "git patch-id [--stable | --unstable | --verbatim]"
+msgstr ""
+
+msgid "use the unstable patch-id algorithm"
+msgstr ""
+
+msgid "use the stable patch-id algorithm"
+msgstr ""
+
+msgid "don't strip whitespace from the patch"
+msgstr ""
+
msgid "git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"
msgstr ""
"git prune [-n] [-v] [--progress] [--expire <времÑ>] [--] [<редакциÑ>...]"
@@ -9114,8 +9336,8 @@ msgstr ""
msgid "pull with rebase"
msgstr "получение Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÑ‰ÐµÐ½Ð¸ÐµÐ¼"
-msgid "please commit or stash them."
-msgstr "Ñделайте коммит или ÑпрÑчьте их."
+msgid "Please commit or stash them."
+msgstr "Сделайте коммит или ÑпрÑчьте их."
#, c-format
msgid ""
@@ -9175,9 +9397,8 @@ msgstr ""
msgid ""
"\n"
-"To avoid automatically configuring upstream branches when their name\n"
-"doesn't match the local branch, see option 'simple' of branch."
-"autoSetupMerge\n"
+"To avoid automatically configuring an upstream branch when its name\n"
+"won't match the local branch, see option 'simple' of branch.autoSetupMerge\n"
"in 'git help config'.\n"
msgstr ""
@@ -9321,6 +9542,11 @@ msgstr "Отправка в %s\n"
msgid "failed to push some refs to '%s'"
msgstr "не удалоÑÑŒ отправить некоторые ÑÑылки в «%s»"
+msgid ""
+"recursing into submodule with push.recurseSubmodules=only; using on-demand "
+"instead"
+msgstr ""
+
#, c-format
msgid "invalid value for '%s'"
msgstr ""
@@ -9328,8 +9554,8 @@ msgstr ""
msgid "repository"
msgstr "репозиторий"
-msgid "push all refs"
-msgstr "отправить вÑе ÑÑылки"
+msgid "push all branches"
+msgstr ""
msgid "mirror all refs"
msgstr "Ñделать зеркало вÑех ÑÑылок"
@@ -9337,8 +9563,8 @@ msgstr "Ñделать зеркало вÑех ÑÑылок"
msgid "delete refs"
msgstr "удалить ÑÑылки"
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "отправить метки (Ð½ÐµÐ»ÑŒÐ·Ñ Ð¸Ñпользовать вмеÑте Ñ --all или --mirror)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr ""
msgid "force updates"
msgstr "принудительное обновление"
@@ -9441,19 +9667,25 @@ msgid "only emit output related to the second range"
msgstr ""
#, c-format
+msgid "not a revision: '%s'"
+msgstr ""
+
+#, c-format
msgid "not a commit range: '%s'"
msgstr ""
-msgid "single arg format must be symmetric range"
+#, c-format
+msgid "not a symmetric range: '%s'"
msgstr ""
msgid "need two commit ranges"
msgstr ""
msgid ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>) "
-"[-u | -i]] [--no-sparse-checkout] [--index-output=<file>] (--empty | <tree-"
-"ish1> [<tree-ish2> [<tree-ish3>]])"
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<prefix>)\n"
+" [-u | -i]] [--index-output=<file>] [--no-sparse-checkout]\n"
+" (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"
msgstr ""
msgid "write resulting index to <file>"
@@ -9542,7 +9774,7 @@ msgid "%s requires the merge backend"
msgstr ""
#, c-format
-msgid "could not get 'onto': '%s'"
+msgid "invalid onto: '%s'"
msgstr ""
#, c-format
@@ -9582,13 +9814,26 @@ msgid ""
msgstr ""
#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr ""
+
+#, c-format
msgid "could not switch to %s"
msgstr ""
+msgid "apply options and merge options cannot be used together"
+msgstr ""
+
#, c-format
msgid ""
-"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and \"ask"
-"\"."
+"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and "
+"\"ask\"."
+msgstr ""
+
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
msgstr ""
#, c-format
@@ -9693,6 +9938,9 @@ msgstr ""
msgid "move commits that begin with squash!/fixup! under -i"
msgstr ""
+msgid "update branches that point to commits that are being rebased"
+msgstr ""
+
msgid "add exec lines after each commit of the editable list"
msgstr ""
@@ -9779,14 +10027,22 @@ msgstr ""
msgid "switch `C' expects a numerical value"
msgstr ""
-#, c-format
-msgid "Unknown mode: %s"
+msgid "--strategy requires --merge or --interactive"
msgstr ""
-msgid "--strategy requires --merge or --interactive"
+msgid ""
+"apply options are incompatible with rebase.autoSquash. Consider adding --no-"
+"autosquash"
msgstr ""
-msgid "apply options and merge options cannot be used together"
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges. Consider adding --"
+"no-rebase-merges"
+msgstr ""
+
+msgid ""
+"apply options are incompatible with rebase.updateRefs. Consider adding --no-"
+"update-refs"
msgstr ""
#, c-format
@@ -9811,7 +10067,7 @@ msgstr ""
msgid "No such ref: %s"
msgstr "Ðет такой ÑÑылки: %s"
-msgid "Could not resolve HEAD to a revision"
+msgid "Could not resolve HEAD to a commit"
msgstr ""
#, c-format
@@ -9826,9 +10082,6 @@ msgstr ""
msgid "Does not point to a valid commit '%s'"
msgstr ""
-msgid "Please commit or stash them."
-msgstr "Сделайте коммит или ÑпрÑчьте их."
-
msgid "HEAD is up to date."
msgstr "HEAD уже в актуальном ÑоÑтоÑнии."
@@ -10203,6 +10456,9 @@ msgstr " Ð½Ð¾Ð²Ð°Ñ (Ñледующее извлечение Ñохранит е
msgid " tracked"
msgstr " отÑлеживаетÑÑ"
+msgid " skipped"
+msgstr ""
+
msgid " stale (use 'git remote prune' to remove)"
msgstr " недейÑтвительна (иÑпользуйте «git remote prune», чтобы удалить)"
@@ -10287,7 +10543,6 @@ msgstr "(нет URL)"
#. TRANSLATORS: the colon ':' should align
#. with the one in " Fetch URL: %s"
#. translation.
-#.
#, c-format
msgid " Push URL: %s"
msgstr " URL Ð´Ð»Ñ Ð¾Ñ‚Ð¿Ñ€Ð°Ð²ÐºÐ¸: %s"
@@ -10472,6 +10727,10 @@ msgstr ""
msgid "could not close refs snapshot tempfile"
msgstr ""
+#, c-format
+msgid "could not remove stale bitmap: %s"
+msgstr ""
+
msgid "pack everything in a single pack"
msgstr "упаковать вÑÑ‘ в один пакет"
@@ -10484,7 +10743,7 @@ msgstr ""
msgid "approxidate"
msgstr "примернаÑ-дата"
-msgid "with -C, expire objects older than this"
+msgid "with --cruft, expire objects older than this"
msgstr ""
msgid "remove redundant packs, and run git-prune-packed"
@@ -10544,6 +10803,9 @@ msgstr ""
msgid "write a multi-pack index of the resulting packs"
msgstr ""
+msgid "pack prefix to store a pack containing pruned objects"
+msgstr ""
+
msgid "cannot delete packs in a precious-objects repo"
msgstr "Ð½ÐµÐ»ÑŒÐ·Ñ ÑƒÐ´Ð°Ð»ÑÑ‚ÑŒ пакеты в precious-objects репозитории"
@@ -10555,7 +10817,11 @@ msgid "pack prefix %s does not begin with objdir %s"
msgstr ""
#, c-format
-msgid "missing required file: %s"
+msgid "renaming pack to '%s' failed"
+msgstr ""
+
+#, c-format
+msgid "pack-objects did not write a '%s' file for pack %s-%s"
msgstr ""
#, c-format
@@ -10743,8 +11009,9 @@ msgstr ""
msgid "only one pattern can be given with -l"
msgstr ""
-msgid "git rerere [clear | forget <path>... | status | remaining | diff | gc]"
-msgstr "git rerere [clear | forget <путь>... | status | remaining | diff | gc]"
+msgid ""
+"git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]"
+msgstr ""
msgid "register clean resolutions in index"
msgstr "запиÑать чиÑтые Ñ€Ð°Ð·Ñ€ÐµÑˆÐµÐ½Ð¸Ñ ÐºÐ¾Ð½Ñ„Ð»Ð¸ÐºÑ‚Ð¾Ð² в индекÑ"
@@ -10866,6 +11133,10 @@ msgstr "Ðе удалоÑÑŒ запиÑать новый файл индекÑа.
msgid "unable to get disk usage of %s"
msgstr ""
+#, c-format
+msgid "invalid value for '%s': '%s', the only allowed format is '%s'"
+msgstr ""
+
msgid "rev-list does not support display of notes"
msgstr "rev-list не поддерживает отображение заметок"
@@ -10891,6 +11162,9 @@ msgstr ""
msgid "no usage string given before the `--' separator"
msgstr ""
+msgid "missing opt-spec before option flags"
+msgstr ""
+
msgid "Needed a single revision"
msgstr ""
@@ -10938,6 +11212,15 @@ msgstr ""
msgid "unknown mode for --abbrev-ref: %s"
msgstr ""
+msgid "--exclude-hidden cannot be used together with --branches"
+msgstr ""
+
+msgid "--exclude-hidden cannot be used together with --tags"
+msgstr ""
+
+msgid "--exclude-hidden cannot be used together with --remotes"
+msgstr ""
+
msgid "this operation must be run in a work tree"
msgstr ""
@@ -10945,17 +11228,21 @@ msgstr ""
msgid "unknown mode for --show-object-format: %s"
msgstr ""
-msgid "git revert [<options>] <commit-ish>..."
-msgstr "git revert [<опции>] <указатель-коммита>..."
+msgid ""
+"git revert [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] "
+"<commit>..."
+msgstr ""
-msgid "git revert <subcommand>"
-msgstr "git revert <подкоманда>"
+msgid "git revert (--continue | --skip | --abort | --quit)"
+msgstr ""
-msgid "git cherry-pick [<options>] <commit-ish>..."
-msgstr "git cherry-pick [<опции>] <указатель-коммита>..."
+msgid ""
+"git cherry-pick [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff]\n"
+" [-S[<keyid>]] <commit>..."
+msgstr ""
-msgid "git cherry-pick <subcommand>"
-msgstr "git cherry-pick <подкоманда>"
+msgid "git cherry-pick (--continue | --skip | --abort | --quit)"
+msgstr ""
#, c-format
msgid "option `%s' expects a number greater than zero"
@@ -11017,8 +11304,11 @@ msgstr "Ñбой Ð¾Ð±Ñ€Ð°Ñ‰ÐµÐ½Ð¸Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ð¹ коммита"
msgid "cherry-pick failed"
msgstr "Ñбой при копировании коммита"
-msgid "git rm [<options>] [--] <file>..."
-msgstr "git rm [<опции>] [--] <файл>..."
+msgid ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
msgid ""
"the following file has staged content different from both the\n"
@@ -11101,12 +11391,16 @@ msgid ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
" [<host>:]<directory> (--all | <ref>...)"
msgstr ""
msgid "remote name"
msgstr "Ð¸Ð¼Ñ Ð²Ð½ÐµÑˆÐ½ÐµÐ³Ð¾ репозиториÑ"
+msgid "push all refs"
+msgstr "отправить вÑе ÑÑылки"
+
msgid "use stateless RPC protocol"
msgstr "протокол без ÑÐ¾Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ ÑоÑтоÑÐ½Ð¸Ñ Ð´Ð»Ñ RPC"
@@ -11125,7 +11419,8 @@ msgstr "git log --pretty=short | git shortlog [<опции>]"
msgid "using multiple --group options with stdin is not supported"
msgstr ""
-msgid "using --group=trailer with stdin is not supported"
+#, c-format
+msgid "using %s with stdin is not supported"
msgstr ""
#, c-format
@@ -11163,7 +11458,8 @@ msgid ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
" [--current] [--color[=<when>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<rev> | <glob>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<rev> | <glob>)...]"
msgstr ""
msgid "git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]"
@@ -11270,11 +11566,10 @@ msgid "Unknown hash algorithm"
msgstr ""
msgid ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...]"
+"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<pattern>...]"
msgstr ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<шаблон>...]"
msgid "git show-ref --exclude-existing[=<pattern>]"
msgstr "git show-ref --exclude-existing[=<шаблон>]"
@@ -11305,7 +11600,9 @@ msgid "show refs from stdin that aren't in local repository"
msgstr ""
"вывеÑти ÑÑылки Ñо Ñтандартного ввода, которых нет в локальном репозитории"
-msgid "git sparse-checkout (init|list|set|add|reapply|disable) <options>"
+msgid ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
msgstr ""
msgid "this worktree is not sparse"
@@ -11413,57 +11710,59 @@ msgstr ""
msgid "error while refreshing working directory"
msgstr ""
-msgid "git stash list [<options>]"
-msgstr "git stash list [<опции>]"
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
-msgid "git stash show [<options>] [<stash>]"
-msgstr "git stash show [<опциии>] [<ÑпрÑтанные-изменениÑ>]"
+msgid "terminate input and output files by a NUL character"
+msgstr ""
-msgid "git stash drop [-q|--quiet] [<stash>]"
-msgstr "git stash drop [-q|--quiet] [<ÑпрÑтанные-изменениÑ>]"
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
-msgid "git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"
+msgid "use patterns in <file> instead of the current ones."
msgstr ""
-"git stash ( pop | apply ) [--index] [-q|--quiet] [<ÑпрÑтанные-изменениÑ>]"
-msgid "git stash branch <branchname> [<stash>]"
-msgstr "git stash branch <имÑ-ветки> [<ÑпрÑтанные-изменениÑ>]"
+msgid "git stash list [<log-options>]"
+msgstr ""
msgid ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
-" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
-" [--] [<pathspec>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<diff-"
+"options>] [<stash>]"
msgstr ""
-msgid ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
+msgid "git stash drop [-q | --quiet] [<stash>]"
msgstr ""
-msgid "git stash pop [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash pop [--index] [-q|--quiet] [<ÑпрÑтанные-изменениÑ>]"
+msgid "git stash pop [--index] [-q | --quiet] [<stash>]"
+msgstr ""
-msgid "git stash apply [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash apply [--index] [-q|--quiet] [<ÑпрÑтанные-изменениÑ>]"
+msgid "git stash apply [--index] [-q | --quiet] [<stash>]"
+msgstr ""
+
+msgid "git stash branch <branchname> [<stash>]"
+msgstr "git stash branch <имÑ-ветки> [<ÑпрÑтанные-изменениÑ>]"
-msgid "git stash store [-m|--message <message>] [-q|--quiet] <commit>"
-msgstr "git stash store [-m|--message <Ñообщение>] [-q|--quiet] <коммит>"
+msgid "git stash store [(-m | --message) <message>] [-q | --quiet] <commit>"
+msgstr ""
msgid ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<message>]\n"
+" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
" [--] [<pathspec>...]]"
msgstr ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <Ñообщение>]\n"
-" [--] [<Ñпецификатор-пути>...]]"
msgid ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<message>]"
+msgstr ""
+
+msgid "git stash create [<message>]"
msgstr ""
#, c-format
@@ -11637,17 +11936,15 @@ msgid "Expecting a full ref name, got %s"
msgstr "ОжидалоÑÑŒ полное Ð¸Ð¼Ñ ÑÑылки, а получено %s"
#, c-format
+msgid "could not get a repository handle for submodule '%s'"
+msgstr ""
+
+#, c-format
msgid ""
"could not look up configuration '%s'. Assuming this repository is its own "
"authoritative upstream."
msgstr ""
-msgid "alternative anchor for relative paths"
-msgstr "альтернативный Ñимвол Ð´Ð»Ñ Ð¾Ñ‚Ð½Ð¾Ñительных путей"
-
-msgid "git submodule--helper list [--prefix=<path>] [<path>...]"
-msgstr "git submodule--helper list [--prefix=<путь>] [<путь>...]"
-
#, c-format
msgid "No url found for submodule path '%s' in .gitmodules"
msgstr "URL Ð´Ð»Ñ Ð¿Ð¾Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ Ð¿Ð¾ пути «%s» не найден в .gitmodules"
@@ -11675,7 +11972,7 @@ msgstr ""
msgid "recurse into nested submodules"
msgstr "проходить вглубь вложенных подмодулей"
-msgid "git submodule--helper foreach [--quiet] [--recursive] [--] <command>"
+msgid "git submodule foreach [--quiet] [--recursive] [--] <command>"
msgstr ""
#, c-format
@@ -11697,7 +11994,7 @@ msgstr "Сбой региÑтрации режима Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð´Ð»Ñ
msgid "suppress output for initializing a submodule"
msgstr ""
-msgid "git submodule--helper init [<options>] [<path>]"
+msgid "git submodule init [<options>] [<path>]"
msgstr ""
#, c-format
@@ -11723,9 +12020,6 @@ msgstr ""
msgid "git submodule status [--quiet] [--cached] [--recursive] [<path>...]"
msgstr "git submodule status [--quiet] [--cached] [--recursive] [<путь>...]"
-msgid "git submodule--helper name <path>"
-msgstr "git submodule--helper name <путь>"
-
#, c-format
msgid "* %s %s(blob)->%s(submodule)"
msgstr ""
@@ -11758,7 +12052,7 @@ msgstr ""
msgid "limit the summary size"
msgstr ""
-msgid "git submodule--helper summary [<options>] [<commit>] [--] [<path>]"
+msgid "git submodule summary [<options>] [<commit>] [--] [<path>]"
msgstr ""
msgid "could not fetch a revision for HEAD"
@@ -11773,18 +12067,14 @@ msgid "failed to register url for submodule path '%s'"
msgstr ""
#, c-format
-msgid "failed to get the default remote for submodule '%s'"
-msgstr ""
-
-#, c-format
msgid "failed to update remote for submodule '%s'"
msgstr ""
msgid "suppress output of synchronizing submodule url"
msgstr ""
-msgid "git submodule--helper sync [--quiet] [--recursive] [<path>]"
-msgstr "git submodule--helper sync [--quiet] [--recursive] [<путь>]"
+msgid "git submodule sync [--quiet] [--recursive] [<path>]"
+msgstr ""
#, c-format
msgid ""
@@ -11838,6 +12128,10 @@ msgid ""
msgstr ""
#, c-format
+msgid "could not get a repository handle for gitdir '%s'"
+msgstr ""
+
+#, c-format
msgid "submodule '%s' cannot add alternate: %s"
msgstr "подмодулю «%s» не удалоÑÑŒ добавить альтернативу: %s"
@@ -11866,6 +12160,9 @@ msgstr ""
msgid "could not get submodule directory for '%s'"
msgstr "не удалоÑÑŒ получить каталог Ð´Ð»Ñ Ð¿Ð¾Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ Â«%s»"
+msgid "alternative anchor for relative paths"
+msgstr "альтернативный Ñимвол Ð´Ð»Ñ Ð¾Ñ‚Ð½Ð¾Ñительных путей"
+
msgid "where the new submodule will be cloned to"
msgstr "куда должен быть Ñклонирован новый подмодуль"
@@ -11891,10 +12188,6 @@ msgid ""
msgstr ""
#, c-format
-msgid "Invalid update mode '%s' for submodule path '%s'"
-msgstr ""
-
-#, c-format
msgid "Invalid update mode '%s' configured for submodule path '%s'"
msgstr ""
@@ -11964,6 +12257,10 @@ msgid ""
msgstr ""
#, c-format
+msgid "could not initialize submodule at path '%s'"
+msgstr ""
+
+#, c-format
msgid ""
"Submodule (%s) branch configured to inherit branch from superproject, but "
"the superproject is not on any branch"
@@ -11972,10 +12269,6 @@ msgstr ""
"проекта, но он не находитÑÑ Ð½Ð¸ на одной ветке"
#, c-format
-msgid "could not get a repository handle for submodule '%s'"
-msgstr ""
-
-#, c-format
msgid "Unable to find current revision in submodule path '%s'"
msgstr ""
@@ -12006,14 +12299,14 @@ msgstr ""
msgid "don't fetch new objects from the remote site"
msgstr ""
-msgid "path into the working tree"
-msgstr "путь в рабочем каталоге"
+msgid "use the 'checkout' update strategy (default)"
+msgstr ""
-msgid "path into the working tree, across nested submodule boundaries"
-msgstr "путь в рабочем каталоге, в пределах границ подмодулÑ"
+msgid "use the 'merge' update strategy"
+msgstr ""
-msgid "rebase, merge, checkout or none"
-msgstr "rebase, merge, checkout или none"
+msgid "use the 'rebase' update strategy"
+msgstr ""
msgid "create a shallow clone truncated to the specified number of revisions"
msgstr ""
@@ -12029,6 +12322,9 @@ msgstr ""
msgid "don't print cloning progress"
msgstr "вы выводить прогреÑÑ ÐºÐ»Ð¾Ð½Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ"
+msgid "disallow cloning into non-empty directory, implies --init"
+msgstr ""
+
msgid ""
"git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] "
"[-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-"
@@ -12036,34 +12332,13 @@ msgid ""
"[--] [<path>...]"
msgstr ""
-msgid "bad value for update parameter"
-msgstr "плохое значение Ð´Ð»Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° update"
-
-msgid "recurse into submodules"
-msgstr "рекурÑивно по подмодулÑм"
-
-msgid "git submodule--helper absorb-git-dirs [<options>] [<path>...]"
-msgstr "git submodule--helper absorb-git-dirs [<опции>] [<путь>...]"
-
-msgid "check if it is safe to write to the .gitmodules file"
-msgstr ""
-
-msgid "unset the config in the .gitmodules file"
-msgstr ""
-
-msgid "git submodule--helper config <name> [<value>]"
-msgstr "git submodule--helper config <имÑ> [<значение>]"
-
-msgid "git submodule--helper config --unset <name>"
-msgstr "git submodule--helper config --unset <имÑ>"
-
-msgid "please make sure that the .gitmodules file is in the working tree"
+msgid "git submodule absorbgitdirs [<options>] [<path>...]"
msgstr ""
msgid "suppress output for setting url of a submodule"
msgstr ""
-msgid "git submodule--helper set-url [--quiet] <path> <newurl>"
+msgid "git submodule set-url [--quiet] <path> <newurl>"
msgstr ""
msgid "set the default tracking branch to master"
@@ -12072,11 +12347,10 @@ msgstr ""
msgid "set the default tracking branch"
msgstr ""
-msgid "git submodule--helper set-branch [-q|--quiet] (-d|--default) <path>"
+msgid "git submodule set-branch [-q|--quiet] (-d|--default) <path>"
msgstr ""
-msgid ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
+msgid "git submodule set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
msgstr ""
msgid "--branch or --default required"
@@ -12130,6 +12404,9 @@ msgstr ""
msgid "unable to checkout submodule '%s'"
msgstr ""
+msgid "please make sure that the .gitmodules file is in the working tree"
+msgstr ""
+
#, c-format
msgid "Failed to add submodule '%s'"
msgstr ""
@@ -12164,7 +12441,7 @@ msgid ""
"path"
msgstr ""
-msgid "git submodule--helper add [<options>] [--] <repository> [<path>]"
+msgid "git submodule add [<options>] [--] <repository> [<path>]"
msgstr ""
msgid "Relative path can only be used from the toplevel of the working tree"
@@ -12180,19 +12457,17 @@ msgstr ""
msgid "'%s' is not a valid submodule name"
msgstr ""
-#, c-format
-msgid "%s doesn't support --super-prefix"
-msgstr "%s не поддерживает параметр --super-prefix"
+msgid "git submodule--helper <command>"
+msgstr ""
-#, c-format
-msgid "'%s' is not a valid submodule--helper subcommand"
-msgstr "«%s» не ÑвлÑетÑÑ Ð¿Ð¾Ð´ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¾Ð¹ submodule--helper"
+msgid "git symbolic-ref [-m <reason>] <name> <ref>"
+msgstr ""
-msgid "git symbolic-ref [<options>] <name> [<ref>]"
-msgstr "git symbolic-ref [<опции>] <имÑ> [<ÑÑылка>]"
+msgid "git symbolic-ref [-q] [--short] [--no-recurse] <name>"
+msgstr ""
-msgid "git symbolic-ref -d [-q] <name>"
-msgstr "git symbolic-ref -d [-q] <имÑ>"
+msgid "git symbolic-ref --delete [-q] <name>"
+msgstr ""
msgid "suppress error message for non-symbolic (detached) refs"
msgstr ""
@@ -12204,6 +12479,9 @@ msgstr "удалить Ñимвольные ÑÑылки"
msgid "shorten ref output"
msgstr "укороченный вывод ÑÑылок"
+msgid "recursively dereference (default)"
+msgstr ""
+
msgid "reason"
msgstr "причина"
@@ -12211,18 +12489,18 @@ msgid "reason of the update"
msgstr "причина обновлениÑ"
msgid ""
-"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]\n"
-" <tagname> [<head>]"
+"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
+" <tagname> [<commit> | <object>]"
msgstr ""
msgid "git tag -d <tagname>..."
msgstr "git tag -d <имÑ-метки>..."
msgid ""
-"git tag -l [-n[<num>]] [--contains <commit>] [--no-contains <commit>] [--"
-"points-at <object>]\n"
-" [--format=<format>] [--merged <commit>] [--no-merged <commit>] "
-"[<pattern>...]"
+"git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]\n"
+" [--points-at <object>] [--column[=<options>] | --no-column]\n"
+" [--create-reflog] [--sort=<key>] [--format=<format>]\n"
+" [--merged <commit>] [--no-merged <commit>] [<pattern>...]"
msgstr ""
msgid "git tag -v [--format=<format>] <tagname>..."
@@ -12363,6 +12641,16 @@ msgstr "Метка «%s» обновлена (была %s)\n"
msgid "pack exceeds maximum allowed size"
msgstr "размер пакета превышает макÑимальный допуÑтимый"
+msgid "failed to write object in stream"
+msgstr ""
+
+#, c-format
+msgid "inflate returned (%d)"
+msgstr ""
+
+msgid "invalid blob object from stream"
+msgstr ""
+
msgid "Unpacking objects"
msgstr "РаÑпаковка объектов"
@@ -12592,8 +12880,10 @@ msgstr "прочитать Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð¸Ð· Ñтандартного в
msgid "update the info files from scratch"
msgstr "обновить информацию о Ñерверах Ñ Ð½ÑƒÐ»Ñ"
-msgid "git upload-pack [<options>] <dir>"
-msgstr "git upload-pack [<опции>] <каталог>"
+msgid ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <directory>"
+msgstr ""
msgid "quit after a single request/response exchange"
msgstr "выход поÑле обмена одним запроÑом/ответом"
@@ -12607,8 +12897,8 @@ msgstr "не проверÑÑ‚ÑŒ <каталог>/.git/ еÑли <каталог>
msgid "interrupt transfer after <n> seconds of inactivity"
msgstr "прервать передачу поÑле <кол> Ñекунд проÑтоÑ"
-msgid "git verify-commit [-v | --verbose] <commit>..."
-msgstr "git verify-commit [-v | --verbose] <коммит>..."
+msgid "git verify-commit [-v | --verbose] [--raw] <commit>..."
+msgstr ""
msgid "print commit contents"
msgstr "вывеÑти Ñодержимое коммита"
@@ -12616,8 +12906,8 @@ msgstr "вывеÑти Ñодержимое коммита"
msgid "print raw gpg status output"
msgstr "выводить Ñырой вывод ÑтатуÑа от gpg"
-msgid "git verify-pack [-v | --verbose] [-s | --stat-only] <pack>..."
-msgstr "git verify-pack [-v | --verbose] [-s | --stat-only] <пакет>..."
+msgid "git verify-pack [-v | --verbose] [-s | --stat-only] [--] <pack>.idx..."
+msgstr ""
msgid "verbose"
msgstr "быть многоÑловнее"
@@ -12625,35 +12915,37 @@ msgstr "быть многоÑловнее"
msgid "show statistics only"
msgstr "вывеÑти только ÑтатиÑтику"
-msgid "git verify-tag [-v | --verbose] [--format=<format>] <tag>..."
-msgstr "git verify-tag [-v | --verbose] [--format=<формат>] <метка>..."
+msgid "git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."
+msgstr ""
msgid "print tag contents"
msgstr "вывеÑти Ñодержимое метки"
-msgid "git worktree add [<options>] <path> [<commit-ish>]"
-msgstr "git worktree add [<опции>] <путь> [<указатель-коммита>]"
+msgid ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <string>]]\n"
+" [-b <new-branch>] <path> [<commit-ish>]"
+msgstr ""
-msgid "git worktree list [<options>]"
-msgstr "git worktree list [<опции>]"
+msgid "git worktree list [-v | --porcelain [-z]]"
+msgstr ""
-msgid "git worktree lock [<options>] <path>"
-msgstr "git worktree lock [<опции>] <путь>"
+msgid "git worktree lock [--reason <string>] <worktree>"
+msgstr ""
msgid "git worktree move <worktree> <new-path>"
msgstr "git worktree move <рабочий-каталог> <новый-путь>"
-msgid "git worktree prune [<options>]"
-msgstr "git worktree prune [<опции>]"
+msgid "git worktree prune [-n] [-v] [--expire <expire>]"
+msgstr ""
-msgid "git worktree remove [<options>] <worktree>"
-msgstr "git worktree remove [<опции>] <рабочий-каталог>"
+msgid "git worktree remove [-f] <worktree>"
+msgstr ""
msgid "git worktree repair [<path>...]"
msgstr ""
-msgid "git worktree unlock <path>"
-msgstr "git worktree unlock <путь>"
+msgid "git worktree unlock <worktree>"
+msgstr ""
#, c-format
msgid "Removing %s/%s: %s"
@@ -12722,7 +13014,7 @@ msgstr "ГотовитÑÑ Ñ€Ð°Ð±Ð¾Ñ‡Ð°Ñ ÐºÐ¾Ð¿Ð¸Ñ (отÑоединённый
msgid "checkout <branch> even if already checked out in other worktree"
msgstr ""
-"переключитьÑÑ Ð½Ð° <ветка> даже еÑли она уже активна в другом рабочеÑм каталоге"
+"переключитьÑÑ Ð½Ð° <ветка> даже еÑли она уже активна в другом рабочем каталоге"
msgid "create a new branch"
msgstr "Ñоздать новую ветку"
@@ -12866,6 +13158,62 @@ msgstr "вывеÑти объект дерева Ð´Ð»Ñ Ð¿Ð¾Ð´ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ð° Ñ
msgid "only useful for debugging"
msgstr "иÑпользуетÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ при отладке"
+msgid "core.fsyncMethod = batch is unsupported on this platform"
+msgstr ""
+
+#, c-format
+msgid "could not parse bundle list key %s with value '%s'"
+msgstr ""
+
+#, c-format
+msgid "bundle list at '%s' has no mode"
+msgstr ""
+
+msgid "failed to create temporary file"
+msgstr ""
+
+msgid "insufficient capabilities"
+msgstr ""
+
+#, c-format
+msgid "file downloaded from '%s' is not a bundle"
+msgstr ""
+
+msgid "failed to store maximum creation token"
+msgstr ""
+
+#, c-format
+msgid "unrecognized bundle mode from URI '%s'"
+msgstr ""
+
+#, c-format
+msgid "exceeded bundle URI recursion limit (%d)"
+msgstr ""
+
+#, c-format
+msgid "failed to download bundle from URI '%s'"
+msgstr ""
+
+#, c-format
+msgid "file at URI '%s' is not a bundle or bundle list"
+msgstr ""
+
+#, c-format
+msgid "bundle-uri: unexpected argument: '%s'"
+msgstr ""
+
+msgid "bundle-uri: expected flush after arguments"
+msgstr ""
+
+msgid "bundle-uri: got an empty line"
+msgstr ""
+
+msgid "bundle-uri: line is not of the form 'key=value'"
+msgstr ""
+
+msgid "bundle-uri: line has empty key or value"
+msgstr ""
+
#, c-format
msgid "unrecognized bundle hash algorithm: %s"
msgstr ""
@@ -12888,6 +13236,11 @@ msgstr "Ð’ репозитории отÑутÑтвуют необходимые
msgid "need a repository to verify a bundle"
msgstr ""
+msgid ""
+"some prerequisite commits exist in the object store, but are not connected "
+"to the repository's history"
+msgstr ""
+
#, c-format
msgid "The bundle contains this ref:"
msgid_plural "The bundle contains these %<PRIuMAX> refs:"
@@ -13072,6 +13425,9 @@ msgstr "Очень проÑтой Ñервер Ð´Ð»Ñ Git репозиторие
msgid "Give an object a human readable name based on an available ref"
msgstr "ПриÑвоение объекту удобочитаемое Ð¸Ð¼Ñ Ð½Ð° оÑнове доÑтупной ÑÑылки"
+msgid "Generate a zip archive of diagnostic information"
+msgstr ""
+
msgid "Show changes between commits, commit and working tree, etc"
msgstr "Вывод разницы между коммитами, коммитом и рабочим каталогом и т.д."
@@ -13205,8 +13561,8 @@ msgid "The standard helper program to use with git-merge-index"
msgstr ""
"Ð¡Ñ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð°Ñ Ð¿Ñ€Ð¾Ð³Ñ€Ð°Ð¼Ð¼Ð°-помощник Ð´Ð»Ñ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ ÑовмеÑтно Ñ git-merge-index"
-msgid "Show three-way merge without touching index"
-msgstr "Вывод трёхходового ÑлиÑние без Ð·Ð°Ñ‚Ñ€Ð°Ð³Ð¸Ð²Ð°Ð½Ð¸Ñ Ð¸Ð½Ð´ÐµÐºÑа"
+msgid "Perform merge without touching index or working tree"
+msgstr ""
msgid "Run merge conflict resolution tools to resolve merge conflicts"
msgstr "ЗапуÑк инÑтрументов Ñ€Ð°Ð·Ñ€ÐµÑˆÐµÐ½Ð¸Ñ ÐºÐ¾Ð½Ñ„Ð»Ð¸ÐºÑ‚Ð¾Ð² ÑлиÑниÑ"
@@ -13405,6 +13761,9 @@ msgstr "Проверка файлов упакованных архивов Git"
msgid "Check the GPG signature of tags"
msgstr "Проверка подпиÑи GPG меток"
+msgid "Display version information about Git"
+msgstr ""
+
msgid "Show logs with difference each commit introduces"
msgstr "Вывод журнала Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñми, которые вводил каждый из коммитов"
@@ -13438,6 +13797,24 @@ msgstr "Полезный минимум команд Ð´Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð´Ð½ÐµÐ²Ð½
msgid "Frequently asked questions about using Git"
msgstr ""
+msgid "The bundle file format"
+msgstr ""
+
+msgid "Chunk-based file formats"
+msgstr ""
+
+msgid "Git commit-graph format"
+msgstr ""
+
+msgid "Git index format"
+msgstr ""
+
+msgid "Git pack format"
+msgstr ""
+
+msgid "Git cryptographic signature formats"
+msgstr ""
+
msgid "A Git Glossary"
msgstr "ГлоÑÑарий Git"
@@ -13459,6 +13836,21 @@ msgstr "Определение ÑвойÑтв подмодулей"
msgid "Git namespaces"
msgstr "ПроÑтранÑтва имён Git"
+msgid "Protocol v0 and v1 capabilities"
+msgstr ""
+
+msgid "Things common to various protocols"
+msgstr ""
+
+msgid "Git HTTP-based protocols"
+msgstr ""
+
+msgid "How packs are transferred over-the-wire"
+msgstr ""
+
+msgid "Git Wire Protocol, Version 2"
+msgstr ""
+
msgid "Helper programs to interact with remote repositories"
msgstr ""
@@ -13483,6 +13875,9 @@ msgstr "Веб Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Git (веб-Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð´Ð»Ñ Git ре
msgid "An overview of recommended workflows with Git"
msgstr "Обзор рекомендуемых поÑледовательноÑтей выполнÑемых дейÑтвий Ñ Git"
+msgid "A tool for managing large Git repositories"
+msgstr ""
+
msgid "commit-graph file is too small"
msgstr "файл commit-graph Ñлишком маленький"
@@ -13724,6 +14119,14 @@ msgid "no libc information available\n"
msgstr ""
#, c-format
+msgid "could not determine free disk size for '%s'"
+msgstr ""
+
+#, c-format
+msgid "could not get info for '%s'"
+msgstr ""
+
+#, c-format
msgid "[GLE %ld] health thread could not open '%ls'"
msgstr ""
@@ -13747,6 +14150,10 @@ msgstr ""
msgid "health thread wait failed [GLE %ld]"
msgstr ""
+#, c-format
+msgid "Invalid path: %s"
+msgstr ""
+
msgid "Unable to create FSEventStream."
msgstr ""
@@ -13778,6 +14185,30 @@ msgid "could not read directory changes [GLE %ld]"
msgstr ""
#, c-format
+msgid "opendir('%s') failed"
+msgstr ""
+
+#, c-format
+msgid "lstat('%s') failed"
+msgstr ""
+
+#, c-format
+msgid "strbuf_readlink('%s') failed"
+msgstr ""
+
+#, c-format
+msgid "closedir('%s') failed"
+msgstr ""
+
+#, c-format
+msgid "[GLE %ld] unable to open for read '%ls'"
+msgstr ""
+
+#, c-format
+msgid "[GLE %ld] unable to get protocol information for '%ls'"
+msgstr ""
+
+#, c-format
msgid "failed to copy SID (%ld)"
msgstr ""
@@ -14047,7 +14478,7 @@ msgstr ""
msgid "bad zlib compression level %d"
msgstr "неправильный уровень ÑÐ¶Ð°Ñ‚Ð¸Ñ zlib %d"
-msgid "core.commentChar should only be one character"
+msgid "core.commentChar should only be one ASCII character"
msgstr ""
#, c-format
@@ -14159,6 +14590,10 @@ msgid "invalid section name: %s"
msgstr ""
#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr ""
+
+#, c-format
msgid "missing value for '%s'"
msgstr ""
@@ -14213,16 +14648,23 @@ msgid "unknown object format '%s' specified by server"
msgstr ""
#, c-format
-msgid "invalid ls-refs response: %s"
+msgid "error on bundle-uri response line %d: %s"
msgstr ""
-msgid "expected flush after ref listing"
+msgid "expected flush after bundle-uri listing"
msgstr ""
msgid "expected response end packet after ref listing"
msgstr ""
#, c-format
+msgid "invalid ls-refs response: %s"
+msgstr ""
+
+msgid "expected flush after ref listing"
+msgstr ""
+
+#, c-format
msgid "protocol '%s' is not supported"
msgstr ""
@@ -14306,175 +14748,6 @@ msgid "failed to close rev-list's stdin"
msgstr "Ñбой Ð·Ð°ÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ñтандартного ввода у rev-list"
#, c-format
-msgid "'%s' does not exist"
-msgstr "«%s» не ÑущеÑтвует"
-
-msgid "need a working directory"
-msgstr ""
-
-msgid "could not find enlistment root"
-msgstr ""
-
-#, c-format
-msgid "could not switch to '%s'"
-msgstr ""
-
-#, c-format
-msgid "could not configure %s=%s"
-msgstr ""
-
-msgid "could not configure log.excludeDecoration"
-msgstr ""
-
-msgid "Scalar enlistments require a worktree"
-msgstr ""
-
-#, c-format
-msgid "could not open directory '%s'"
-msgstr "не удалоÑÑŒ открыть каталог «%s»"
-
-#, c-format
-msgid "skipping '%s', which is neither file nor directory"
-msgstr ""
-
-#, c-format
-msgid "could not determine free disk size for '%s'"
-msgstr ""
-
-#, c-format
-msgid "could not get info for '%s'"
-msgstr ""
-
-#, c-format
-msgid "remote HEAD is not a branch: '%.*s'"
-msgstr ""
-
-msgid "failed to get default branch name from remote; using local default"
-msgstr ""
-
-msgid "failed to get default branch name"
-msgstr ""
-
-msgid "failed to unregister repository"
-msgstr ""
-
-msgid "failed to delete enlistment directory"
-msgstr ""
-
-msgid "branch to checkout after clone"
-msgstr ""
-
-msgid "when cloning, create full working directory"
-msgstr ""
-
-msgid "only download metadata for the branch that will be checked out"
-msgstr ""
-
-msgid "scalar clone [<options>] [--] <repo> [<dir>]"
-msgstr ""
-
-#, c-format
-msgid "cannot deduce worktree name from '%s'"
-msgstr ""
-
-#, c-format
-msgid "directory '%s' exists already"
-msgstr ""
-
-#, c-format
-msgid "failed to get default branch for '%s'"
-msgstr ""
-
-#, c-format
-msgid "could not configure remote in '%s'"
-msgstr ""
-
-#, c-format
-msgid "could not configure '%s'"
-msgstr ""
-
-msgid "partial clone failed; attempting full clone"
-msgstr ""
-
-msgid "could not configure for full clone"
-msgstr ""
-
-msgid "scalar diagnose [<enlistment>]"
-msgstr ""
-
-#, c-format
-msgid "could not create directory for '%s'"
-msgstr ""
-
-msgid "could not duplicate stdout"
-msgstr ""
-
-msgid "failed to write archive"
-msgstr ""
-
-msgid "`scalar list` does not take arguments"
-msgstr ""
-
-msgid "scalar register [<enlistment>]"
-msgstr ""
-
-msgid "reconfigure all registered enlistments"
-msgstr ""
-
-msgid "scalar reconfigure [--all | <enlistment>]"
-msgstr ""
-
-msgid "--all or <enlistment>, but not both"
-msgstr ""
-
-#, c-format
-msgid "git repository gone in '%s'"
-msgstr ""
-
-msgid ""
-"scalar run <task> [<enlistment>]\n"
-"Tasks:\n"
-msgstr ""
-
-#, c-format
-msgid "no such task: '%s'"
-msgstr ""
-
-msgid "scalar unregister [<enlistment>]"
-msgstr ""
-
-msgid "scalar delete <enlistment>"
-msgstr ""
-
-msgid "refusing to delete current working directory"
-msgstr ""
-
-msgid "include Git version"
-msgstr ""
-
-msgid "include Git's build options"
-msgstr ""
-
-msgid "scalar verbose [-v | --verbose] [--build-options]"
-msgstr ""
-
-msgid "-C requires a <directory>"
-msgstr ""
-
-#, c-format
-msgid "could not change to '%s'"
-msgstr ""
-
-msgid "-c requires a <key>=<value> argument"
-msgstr ""
-
-msgid ""
-"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
-"\n"
-"Commands:\n"
-msgstr ""
-
-#, c-format
msgid "illegal crlf_action %d"
msgstr ""
@@ -14689,6 +14962,32 @@ msgstr ""
msgid "Marked %d islands, done.\n"
msgstr ""
+#, c-format
+msgid "invalid --%s value '%s'"
+msgstr ""
+
+#, c-format
+msgid "could not archive missing directory '%s'"
+msgstr ""
+
+#, c-format
+msgid "could not open directory '%s'"
+msgstr "не удалоÑÑŒ открыть каталог «%s»"
+
+#, c-format
+msgid "skipping '%s', which is neither file nor directory"
+msgstr ""
+
+msgid "could not duplicate stdout"
+msgstr ""
+
+#, c-format
+msgid "could not add directory '%s' to archiver"
+msgstr ""
+
+msgid "failed to write archive"
+msgstr ""
+
msgid "--merge-base does not work with ranges"
msgstr ""
@@ -14951,6 +15250,9 @@ msgstr ""
msgid "do not show any source or destination prefix"
msgstr ""
+msgid "use default prefixes a/ and b/"
+msgstr ""
+
msgid "show context between diff hunks up to the specified number of lines"
msgstr ""
@@ -15238,6 +15540,14 @@ msgstr "не удалоÑÑŒ перемеÑтить каталог git Ñ Â«%s»
msgid "hint: Waiting for your editor to close the file...%c"
msgstr "подÑказка: Ожидание, пока вы закроете редактор Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð¼...%c"
+#, c-format
+msgid "could not write to '%s'"
+msgstr "не удалоÑÑŒ запиÑать в «%s»"
+
+#, c-format
+msgid "could not edit '%s'"
+msgstr ""
+
msgid "Filtering content"
msgstr "ФильтруетÑÑ Ñодержимое"
@@ -15269,6 +15579,9 @@ msgstr "git fetch-pack: ожидаетÑÑ ACK/NAK, а получено «%s»"
msgid "unable to write to remote"
msgstr ""
+msgid "Server supports filter"
+msgstr "Сервер поддерживает фильтрацию"
+
#, c-format
msgid "invalid shallow line: %s"
msgstr "Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»ÑŒÐ½Ð°Ñ Ñтрока чаÑтичного получениÑ: %s"
@@ -15379,9 +15692,6 @@ msgstr ""
msgid "Server does not support shallow requests"
msgstr "Сервер не поддерживает чаÑтичные запроÑÑ‹"
-msgid "Server supports filter"
-msgstr "Сервер поддерживает фильтрацию"
-
msgid "unable to write request to remote"
msgstr ""
@@ -15403,14 +15713,12 @@ msgstr ""
#. TRANSLATORS: The parameter will be 'ready', a protocol
#. keyword.
-#.
#, c-format
msgid "expected packfile to be sent after '%s'"
msgstr ""
#. TRANSLATORS: The parameter will be 'ready', a protocol
#. keyword.
-#.
#, c-format
msgid "expected no other sections to be sent after no '%s'"
msgstr ""
@@ -15481,7 +15789,8 @@ msgstr ""
#, c-format
msgid ""
-"repository '%s' is incompatible with fsmonitor due to lack of Unix sockets"
+"socket directory '%s' is incompatible with fsmonitor due to lack of Unix "
+"sockets support"
msgstr ""
msgid ""
@@ -15490,8 +15799,7 @@ msgid ""
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
-" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
-" <command> [<args>]"
+" [--config-env=<name>=<envvar>] <command> [<args>]"
msgstr ""
msgid ""
@@ -15519,15 +15827,15 @@ msgid "no namespace given for --namespace\n"
msgstr ""
#, c-format
-msgid "no prefix given for --super-prefix\n"
+msgid "-c expects a configuration string\n"
msgstr ""
#, c-format
-msgid "-c expects a configuration string\n"
+msgid "no config key given for --config-env\n"
msgstr ""
#, c-format
-msgid "no config key given for --config-env\n"
+msgid "no attribute source given for --attr-source\n"
msgstr ""
#, c-format
@@ -15626,8 +15934,11 @@ msgstr ""
msgid "gpg.ssh.defaultKeyCommand failed: %s %s"
msgstr ""
-msgid "gpg failed to sign the data"
-msgstr "gpg не удалоÑÑŒ подпиÑать данные"
+#, c-format
+msgid ""
+"gpg failed to sign the data:\n"
+"%s"
+msgstr ""
msgid "user.signingKey needs to be set for ssh signing"
msgstr ""
@@ -15706,6 +16017,12 @@ msgstr ""
msgid "Low-level Commands / Internal Helpers"
msgstr "Ðизкоуровневые команды / Внутренние вÑпомогательные"
+msgid "User-facing repository, command and file interfaces"
+msgstr ""
+
+msgid "Developer-facing file formats, protocols and other interfaces"
+msgstr ""
+
#, c-format
msgid "available git commands in '%s'"
msgstr "доÑтупные команды git в «%s»"
@@ -15719,6 +16036,12 @@ msgstr "Стандартные команды Git иÑпользуемые в Ñ€
msgid "The Git concept guides are:"
msgstr ""
+msgid "User-facing repository, command and file interfaces:"
+msgstr ""
+
+msgid "File formats, protocols and other developer interfaces:"
+msgstr ""
+
msgid "External commands"
msgstr ""
@@ -15778,8 +16101,8 @@ msgstr[3] ""
"\n"
"Самые похожие команды:"
-msgid "git version [<options>]"
-msgstr "git version [<options>]"
+msgid "git version [--build-options]"
+msgstr ""
#, c-format
msgid "%s: %s - %s"
@@ -15815,10 +16138,6 @@ msgstr ""
"ignoredHook false»."
#, c-format
-msgid "Couldn't start hook '%s'\n"
-msgstr ""
-
-#, c-format
msgid "argument to --packfile must be a valid hash (got '%s')"
msgstr ""
@@ -16002,16 +16321,14 @@ msgid "quoted CRLF detected"
msgstr ""
#, c-format
-msgid ""
-"Your local changes to the following files would be overwritten by merge:\n"
-" %s"
-msgstr ""
-
-#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "Ðе удалоÑÑŒ Ñлить подмодуль %s (ÑоÑтоÑние не забрано)"
#, c-format
+msgid "Failed to merge submodule %s (no merge base)"
+msgstr ""
+
+#, c-format
msgid "Failed to merge submodule %s (commits not present)"
msgstr "Ðе удалоÑÑŒ Ñлить подмодуль %s (нет коммитов)"
@@ -16029,27 +16346,11 @@ msgstr ""
#, c-format
msgid ""
-"Failed to merge submodule %s, but a possible merge resolution exists:\n"
-"%s\n"
+"Failed to merge submodule %s, but a possible merge resolution exists: %s"
msgstr ""
#, c-format
msgid ""
-"If this is correct simply add it to the index for example\n"
-"by using:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"which will accept this suggestion.\n"
-msgstr ""
-"ЕÑли оно верное, то проÑто добавьте его в индекÑ, например так:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"тем Ñамым Ð¿Ñ€Ð¸Ð½Ð¸Ð¼Ð°Ñ Ñто предположение.\n"
-
-#, c-format
-msgid ""
"Failed to merge submodule %s, but multiple possible merges exist:\n"
"%s"
msgstr ""
@@ -16174,15 +16475,33 @@ msgid ""
"of %s left in tree."
msgstr ""
+#. TRANSLATORS: This is a line of advice to resolve a merge
+#. conflict in a submodule. The first argument is the submodule
+#. name, and the second argument is the abbreviated id of the
+#. commit that needs to be merged. For example:
+#. - go to submodule (mysubmodule), and either merge commit abc1234"
#, c-format
msgid ""
-"Note: %s not up to date and in way of checking out conflicted version; old "
-"copy renamed to %s"
+" - go to submodule (%s), and either merge commit %s\n"
+" or update to an existing commit which has merged those changes\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Recursive merging with submodules currently only supports trivial cases.\n"
+"Please manually handle the merging of each conflicted submodule.\n"
+"This can be accomplished with the following steps:\n"
+"%s - come back to superproject and run:\n"
+"\n"
+" git add %s\n"
+"\n"
+" to record the above merge or update\n"
+" - resolve any other conflicts in the superproject\n"
+" - commit the resulting index in the superproject\n"
msgstr ""
#. TRANSLATORS: The %s arguments are: 1) tree hash of a merge
#. base, and 2-3) the trees for the two trees we're merging.
-#.
#, c-format
msgid "collecting merge info failed for trees %s, %s, %s"
msgstr ""
@@ -16249,6 +16568,21 @@ msgid "Found a possible merge resolution for the submodule:\n"
msgstr "Ðайдено возможное разрешение ÑлиÑÑ‚Ð¸Ñ Ð´Ð»Ñ Ð¿Ð¾Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ:\n"
#, c-format
+msgid ""
+"If this is correct simply add it to the index for example\n"
+"by using:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"which will accept this suggestion.\n"
+msgstr ""
+"ЕÑли оно верное, то проÑто добавьте его в индекÑ, например так:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"тем Ñамым Ð¿Ñ€Ð¸Ð½Ð¸Ð¼Ð°Ñ Ñто предположение.\n"
+
+#, c-format
msgid "Failed to merge submodule %s (multiple merges found)"
msgstr "Ðе удалоÑÑŒ Ñлить подмодуль %s (найдено неÑколько ÑлиÑний)"
@@ -16316,8 +16650,8 @@ msgstr "Отказ потери неотÑлеживаемого файла %s;
#, c-format
msgid ""
-"CONFLICT (rename/rename): Rename \"%s\"->\"%s\" in branch \"%s\" rename \"%s"
-"\"->\"%s\" in \"%s\"%s"
+"CONFLICT (rename/rename): Rename \"%s\"->\"%s\" in branch \"%s\" rename "
+"\"%s\"->\"%s\" in \"%s\"%s"
msgstr ""
"КОÐФЛИКТ (переименование/переименование): Переименование «%s»→«%s» в ветке "
"«%s» и переименование «%s»→«%s» в ветке «%s»%s"
@@ -16612,7 +16946,6 @@ msgstr "Отказ в перезапиÑи заметок в %s (за преде
#. TRANSLATORS: The first %s is the name of
#. the environment variable, the second %s is
#. its value.
-#.
#, c-format
msgid "Bad %s value: '%s'"
msgstr "Ðеправильное значение переменной %s: «%s»"
@@ -16629,10 +16962,6 @@ msgstr ""
msgid "%s: ignoring alternate object stores, nesting too deep"
msgstr ""
-#, c-format
-msgid "unable to normalize object directory: %s"
-msgstr ""
-
msgid "unable to fdopen alternates lockfile"
msgstr ""
@@ -16692,6 +17021,10 @@ msgid "garbage at end of loose object '%s'"
msgstr ""
#, c-format
+msgid "unable to open loose object %s"
+msgstr ""
+
+#, c-format
msgid "unable to parse %s header"
msgstr ""
@@ -16707,7 +17040,7 @@ msgid "header for %s too long, exceeds %d bytes"
msgstr ""
#, c-format
-msgid "failed to read object %s"
+msgid "loose object %s (stored in %s) is corrupt"
msgstr ""
#, c-format
@@ -16715,10 +17048,6 @@ msgid "replacement %s not found for %s"
msgstr ""
#, c-format
-msgid "loose object %s (stored in %s) is corrupt"
-msgstr ""
-
-#, c-format
msgid "packed object %s (stored in %s) is corrupt"
msgstr ""
@@ -16730,9 +17059,6 @@ msgstr ""
msgid "unable to set permission to '%s'"
msgstr ""
-msgid "file write error"
-msgstr ""
-
msgid "error when closing loose object file"
msgstr ""
@@ -16759,13 +17085,30 @@ msgid "confused by unstable object source data for %s"
msgstr ""
#, c-format
+msgid "write stream object %ld != %<PRIuMAX>"
+msgstr ""
+
+#, c-format
+msgid "unable to stream deflate new object (%d)"
+msgstr ""
+
+#, c-format
+msgid "deflateEnd on stream object failed (%d)"
+msgstr ""
+
+#, c-format
+msgid "unable to create directory %s"
+msgstr ""
+
+#, c-format
msgid "cannot read object for %s"
msgstr ""
-msgid "corrupt commit"
+#, c-format
+msgid "object fails fsck: %s"
msgstr ""
-msgid "corrupt tag"
+msgid "refusing to create malformed object"
msgstr ""
#, c-format
@@ -16815,7 +17158,6 @@ msgstr ""
#. TRANSLATORS: This is a line of ambiguous object
#. output shown when we cannot look up or parse the
#. object in question. E.g. "deadbeef [bad object]".
-#.
#, c-format
msgid "%s [bad object]"
msgstr ""
@@ -16824,7 +17166,6 @@ msgstr ""
#. object output. E.g.:
#. *
#. "deadbeef commit 2021-01-01 - Some Commit Message"
-#.
#, c-format
msgid "%s commit %s - %s"
msgstr ""
@@ -16839,7 +17180,6 @@ msgstr ""
#. *
#. The third argument is the "tag" string
#. from object.c.
-#.
#, c-format
msgid "%s tag %s - %s"
msgstr ""
@@ -16849,21 +17189,18 @@ msgstr ""
#. the tag itself. E.g.:
#. *
#. "deadbeef [bad tag, could not parse it]"
-#.
#, c-format
msgid "%s [bad tag, could not parse it]"
msgstr ""
#. TRANSLATORS: This is a line of ambiguous <type>
#. object output. E.g. "deadbeef tree".
-#.
#, c-format
msgid "%s tree"
msgstr ""
#. TRANSLATORS: This is a line of ambiguous <type>
#. object output. E.g. "deadbeef blob".
-#.
#, c-format
msgid "%s blob"
msgstr ""
@@ -16875,7 +17212,6 @@ msgstr ""
#. TRANSLATORS: The argument is the list of ambiguous
#. objects composed in show_ambiguous_object(). See
#. its "TRANSLATORS" comments for details.
-#.
#, c-format
msgid ""
"The candidates are:\n"
@@ -16967,6 +17303,52 @@ msgstr "не удалоÑÑŒ разобрать объект: %s"
msgid "hash mismatch %s"
msgstr "неÑоответÑтвие Ñ…Ñш-кода %s"
+msgid "trying to write commit not in index"
+msgstr ""
+
+msgid "failed to load bitmap index (corrupted?)"
+msgstr ""
+
+msgid "corrupted bitmap index (too small)"
+msgstr ""
+
+msgid "corrupted bitmap index file (wrong header)"
+msgstr ""
+
+#, c-format
+msgid "unsupported version '%d' for bitmap index file"
+msgstr ""
+
+msgid "corrupted bitmap index file (too short to fit hash cache)"
+msgstr ""
+
+msgid "corrupted bitmap index file (too short to fit lookup table)"
+msgstr ""
+
+#, c-format
+msgid "duplicate entry in bitmap index: '%s'"
+msgstr ""
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for entry %d"
+msgstr ""
+
+#, c-format
+msgid "corrupt ewah bitmap: commit index %u out of range"
+msgstr ""
+
+msgid "corrupted bitmap pack index"
+msgstr ""
+
+msgid "invalid XOR offset in bitmap pack index"
+msgstr ""
+
+msgid "cannot fstat bitmap file"
+msgstr ""
+
+msgid "checksum doesn't match in MIDX and bitmap"
+msgstr ""
+
msgid "multi-pack bitmap is missing required reverse index"
msgstr ""
@@ -16978,8 +17360,59 @@ msgstr ""
msgid "preferred pack (%s) is invalid"
msgstr ""
+msgid "corrupt bitmap lookup table: triplet position out of index"
+msgstr ""
+
+msgid "corrupt bitmap lookup table: xor chain exceeds entry count"
+msgstr ""
+
#, c-format
-msgid "could not find %s in pack %s at offset %<PRIuMAX>"
+msgid "corrupt bitmap lookup table: commit index %u out of range"
+msgstr ""
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for bitmap of commit \"%s\""
+msgstr ""
+
+#, c-format
+msgid "object '%s' not found in type bitmaps"
+msgstr ""
+
+#, c-format
+msgid "object '%s' does not have a unique type"
+msgstr ""
+
+#, c-format
+msgid "object '%s': real type '%s', expected: '%s'"
+msgstr ""
+
+#, c-format
+msgid "object not in bitmap: '%s'"
+msgstr ""
+
+msgid "failed to load bitmap indexes"
+msgstr ""
+
+msgid "you must specify exactly one commit to test"
+msgstr ""
+
+#, c-format
+msgid "commit '%s' doesn't have an indexed bitmap"
+msgstr ""
+
+msgid "mismatch in bitmap results"
+msgstr ""
+
+#, c-format
+msgid "could not find '%s' in pack '%s' at offset %<PRIuMAX>"
+msgstr ""
+
+#, c-format
+msgid "unable to get disk usage of '%s'"
+msgstr ""
+
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
msgstr ""
#, c-format
@@ -17022,6 +17455,13 @@ msgstr ""
msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
msgstr ""
+msgid "invalid checksum"
+msgstr ""
+
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr ""
+
msgid "cannot both write and verify reverse index"
msgstr ""
@@ -17104,6 +17544,9 @@ msgstr "имелоÑÑŒ в виду `--%s` (Ñ Ð´Ð²ÑƒÐ¼Ñ Ð´ÐµÑ„Ð¸Ñами)?"
msgid "alias of --%s"
msgstr ""
+msgid "need a subcommand"
+msgstr ""
+
#, c-format
msgid "unknown option `%s'"
msgstr ""
@@ -17125,7 +17568,6 @@ msgstr "иÑпользование: %s"
#. TRANSLATORS: the colon here should align with the
#. one in "usage: %s" translation.
-#.
#, c-format
msgid " or: %s"
msgstr " или: %s"
@@ -17148,7 +17590,6 @@ msgstr " или: %s"
#. function. The "%s" is a line in the (hopefully already
#. translated) N_() usage string, which contained embedded
#. newlines before we split it up.
-#.
#, c-format
msgid "%*s%s"
msgstr ""
@@ -17175,6 +17616,9 @@ msgstr "тихий режим"
msgid "use <n> digits to display object names"
msgstr ""
+msgid "prefixed path to initial superproject"
+msgstr ""
+
msgid "how to strip spaces and #comments from message"
msgstr "как удалÑÑ‚ÑŒ пробелы и #комментарии из ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ ÐºÐ¾Ð¼Ð¼Ð¸Ñ‚Ð°"
@@ -17322,6 +17766,10 @@ msgstr ""
msgid "promisor remote name cannot begin with '/': %s"
msgstr ""
+#, c-format
+msgid "could not fetch %s from promisor remote"
+msgstr ""
+
msgid "object-info: expected flush after arguments"
msgstr ""
@@ -17537,9 +17985,12 @@ msgid ""
"l, label <label> = label current HEAD with a name\n"
"t, reset <label> = reset HEAD to a label\n"
"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
-". create a merge commit using the original merge commit's\n"
-". message (or the oneline, if no original merge commit was\n"
-". specified); use -c <commit> to reword the commit message\n"
+" create a merge commit using the original merge commit's\n"
+" message (or the oneline, if no original merge commit was\n"
+" specified); use -c <commit> to reword the commit message\n"
+"u, update-ref <ref> = track a placeholder for the <ref> to be updated\n"
+" to this position in the new commits. The <ref> is\n"
+" updated at the end of the rebase\n"
"\n"
"These lines can be re-ordered; they are executed from top to bottom.\n"
msgstr ""
@@ -17637,6 +18088,14 @@ msgid "ahead %d, behind %d"
msgstr "впереди %d, позади %d"
#, c-format
+msgid "%%(%.*s) does not take arguments"
+msgstr ""
+
+#, c-format
+msgid "unrecognized %%(%.*s) argument: %s"
+msgstr ""
+
+#, c-format
msgid "expected format: %%(color:<color>)"
msgstr "ожидаемый формат: %%(color:<color>)"
@@ -17653,22 +18112,6 @@ msgid "Integer value expected refname:rstrip=%s"
msgstr "ОжидаетÑÑ Ñ†ÐµÐ»Ð¾Ñ‡Ð¸Ñленное значение refname:rstrip=%s"
#, c-format
-msgid "unrecognized %%(%s) argument: %s"
-msgstr "неопознанный аргумент %%(%s): %s"
-
-#, c-format
-msgid "%%(objecttype) does not take arguments"
-msgstr ""
-
-#, c-format
-msgid "%%(deltabase) does not take arguments"
-msgstr ""
-
-#, c-format
-msgid "%%(body) does not take arguments"
-msgstr "параметр %%(body) не принимает аргументы"
-
-#, c-format
msgid "expected %%(trailers:key=<value>)"
msgstr ""
@@ -17685,10 +18128,6 @@ msgid "positive value expected '%s' in %%(%s)"
msgstr ""
#, c-format
-msgid "unrecognized email option: %s"
-msgstr ""
-
-#, c-format
msgid "expected format: %%(align:<width>,<position>)"
msgstr "ожидаемый формат: %%(align:<width>,<position>)"
@@ -17701,11 +18140,15 @@ msgid "unrecognized width:%s"
msgstr "Ð½ÐµÐ¾Ð¿Ð¾Ð·Ð½Ð°Ð½Ð½Ð°Ñ ÑˆÐ¸Ñ€Ð¸Ð½Ð°:%s"
#, c-format
+msgid "unrecognized %%(%s) argument: %s"
+msgstr "неопознанный аргумент %%(%s): %s"
+
+#, c-format
msgid "positive width expected with the %%(align) atom"
msgstr "ожидаетÑÑ Ð¿Ð¾Ð»Ð¾Ð¶Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð°Ñ ÑˆÐ¸Ñ€Ð¸Ð½Ð° Ñ ÑƒÐºÐ°Ð·Ð°Ð½Ð¸ÐµÐ¼ чаÑтицы %%(align)"
#, c-format
-msgid "%%(rest) does not take arguments"
+msgid "expected format: %%(ahead-behind:<committish>)"
msgstr ""
#, c-format
@@ -17997,6 +18440,13 @@ msgstr ""
msgid "http transport does not support %s"
msgstr ""
+msgid "protocol error: expected '<url> <path>', missing space"
+msgstr ""
+
+#, c-format
+msgid "failed to download file at URL '%s'"
+msgstr ""
+
msgid "git-http-push failed"
msgstr ""
@@ -18063,7 +18513,6 @@ msgstr "src refspec %s ÑоответÑтвует более чем одному
#. TRANSLATORS: "matches '%s'%" is the <dst> part of "git push
#. <remote> <src>:<dst>" push, and "being pushed ('%s')" is
#. the <src>.
-#.
#, c-format
msgid ""
"The destination you provided is not a full refname (i.e.,\n"
@@ -18306,10 +18755,6 @@ msgid "no remembered resolution for '%s'"
msgstr ""
#, c-format
-msgid "cannot unlink '%s'"
-msgstr ""
-
-#, c-format
msgid "Updated preimage for '%s'"
msgstr ""
@@ -18332,6 +18777,21 @@ msgstr ""
msgid "failed to find tree of %s"
msgstr "не удалоÑÑŒ найти дерево Ð´Ð»Ñ %s"
+#, c-format
+msgid "unsupported section for hidden refs: %s"
+msgstr ""
+
+msgid "--exclude-hidden= passed more than once"
+msgstr ""
+
+#, c-format
+msgid "resolve-undo records `%s` which is missing"
+msgstr ""
+
+#, c-format
+msgid "could not get commit for ancestry-path argument %s"
+msgstr ""
+
msgid "--unpacked=<packfile> no longer supported"
msgstr ""
@@ -18352,6 +18812,175 @@ msgstr ""
msgid "cannot create async thread: %s"
msgstr ""
+#, c-format
+msgid "'%s' does not exist"
+msgstr "«%s» не ÑущеÑтвует"
+
+#, c-format
+msgid "could not switch to '%s'"
+msgstr ""
+
+msgid "need a working directory"
+msgstr ""
+
+msgid "Scalar enlistments require a worktree"
+msgstr ""
+
+#, c-format
+msgid "could not configure %s=%s"
+msgstr ""
+
+msgid "could not configure log.excludeDecoration"
+msgstr ""
+
+msgid "could not add enlistment"
+msgstr ""
+
+msgid "could not set recommended config"
+msgstr ""
+
+msgid "could not turn on maintenance"
+msgstr ""
+
+msgid "could not start the FSMonitor daemon"
+msgstr ""
+
+msgid "could not turn off maintenance"
+msgstr ""
+
+msgid "could not remove enlistment"
+msgstr ""
+
+#, c-format
+msgid "remote HEAD is not a branch: '%.*s'"
+msgstr ""
+
+msgid "failed to get default branch name from remote; using local default"
+msgstr ""
+
+msgid "failed to get default branch name"
+msgstr ""
+
+msgid "failed to unregister repository"
+msgstr ""
+
+msgid "failed to stop the FSMonitor daemon"
+msgstr ""
+
+msgid "failed to delete enlistment directory"
+msgstr ""
+
+msgid "branch to checkout after clone"
+msgstr ""
+
+msgid "when cloning, create full working directory"
+msgstr ""
+
+msgid "only download metadata for the branch that will be checked out"
+msgstr ""
+
+msgid "scalar clone [<options>] [--] <repo> [<dir>]"
+msgstr ""
+
+#, c-format
+msgid "cannot deduce worktree name from '%s'"
+msgstr ""
+
+#, c-format
+msgid "directory '%s' exists already"
+msgstr ""
+
+#, c-format
+msgid "failed to get default branch for '%s'"
+msgstr ""
+
+#, c-format
+msgid "could not configure remote in '%s'"
+msgstr ""
+
+#, c-format
+msgid "could not configure '%s'"
+msgstr ""
+
+msgid "partial clone failed; attempting full clone"
+msgstr ""
+
+msgid "could not configure for full clone"
+msgstr ""
+
+msgid "scalar diagnose [<enlistment>]"
+msgstr ""
+
+msgid "`scalar list` does not take arguments"
+msgstr ""
+
+msgid "scalar register [<enlistment>]"
+msgstr ""
+
+msgid "reconfigure all registered enlistments"
+msgstr ""
+
+msgid "scalar reconfigure [--all | <enlistment>]"
+msgstr ""
+
+msgid "--all or <enlistment>, but not both"
+msgstr ""
+
+#, c-format
+msgid "could not remove stale scalar.repo '%s'"
+msgstr ""
+
+#, c-format
+msgid "removing stale scalar.repo '%s'"
+msgstr ""
+
+#, c-format
+msgid "git repository gone in '%s'"
+msgstr ""
+
+msgid ""
+"scalar run <task> [<enlistment>]\n"
+"Tasks:\n"
+msgstr ""
+
+#, c-format
+msgid "no such task: '%s'"
+msgstr ""
+
+msgid "scalar unregister [<enlistment>]"
+msgstr ""
+
+msgid "scalar delete <enlistment>"
+msgstr ""
+
+msgid "refusing to delete current working directory"
+msgstr ""
+
+msgid "include Git version"
+msgstr ""
+
+msgid "include Git's build options"
+msgstr ""
+
+msgid "scalar verbose [-v | --verbose] [--build-options]"
+msgstr ""
+
+msgid "-C requires a <directory>"
+msgstr ""
+
+#, c-format
+msgid "could not change to '%s'"
+msgstr ""
+
+msgid "-c requires a <key>=<value> argument"
+msgstr ""
+
+msgid ""
+"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
+"\n"
+"Commands:\n"
+msgstr ""
+
msgid "unexpected flush packet while reading remote unpack status"
msgstr "неожиданный пуÑтой пакет при чтении ÑтатуÑа внешней раÑпаковки"
@@ -18442,10 +19071,6 @@ msgid "could not lock '%s'"
msgstr "не удалоÑÑŒ заблокировать «%s»"
#, c-format
-msgid "could not write to '%s'"
-msgstr "не удалоÑÑŒ запиÑать в «%s»"
-
-#, c-format
msgid "could not write eol to '%s'"
msgstr "не удалоÑÑŒ запиÑать eol в «%s»"
@@ -18460,13 +19085,8 @@ msgstr "ваши локальные Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð±ÑƒÐ´ÑƒÑ‚ перезап
msgid "commit your changes or stash them to proceed."
msgstr "Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð´Ð¾Ð»Ð¶ÐµÐ½Ð¸Ñ Ð·Ð°ÐºÐ¾Ð¼Ð¼Ð¸Ñ‚ÑŒÑ‚Ðµ ваши Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð¸Ð»Ð¸ ÑпрÑчьте их."
-#, c-format
-msgid "%s: fast-forward"
-msgstr "%s: быÑÑ‚Ñ€Ð°Ñ Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚ÐºÐ°"
-
#. TRANSLATORS: %s will be "revert", "cherry-pick" or
#. "rebase".
-#.
#, c-format
msgid "%s: Unable to write new index file"
msgstr "%s: Ðе удалоÑÑŒ запиÑать файл индекÑа"
@@ -18726,6 +19346,22 @@ msgid "git %s: failed to refresh the index"
msgstr "git %s: Ñбой Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð¸Ð½Ð´ÐµÐºÑа"
#, c-format
+msgid "'%s' is not a valid label"
+msgstr ""
+
+#, c-format
+msgid "'%s' is not a valid refname"
+msgstr ""
+
+#, c-format
+msgid "update-ref requires a fully qualified refname e.g. refs/heads/%s"
+msgstr ""
+
+#, c-format
+msgid "invalid command '%.*s'"
+msgstr ""
+
+#, c-format
msgid "%s does not accept arguments: '%s'"
msgstr "параметр %s не принимает аргументы: «%s»"
@@ -18795,11 +19431,8 @@ msgstr ""
msgid "could not create sequencer directory '%s'"
msgstr "не удалоÑÑŒ Ñоздать каталог Ð´Ð»Ñ ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ ÑÐ»ÐµÐ´Ð¾Ð²Ð°Ð½Ð¸Ñ ÐºÐ¾Ð¼Ð¼Ð¸Ñ‚Ð¾Ð² «%s»"
-msgid "could not lock HEAD"
-msgstr "не удалоÑÑŒ заблокировать HEAD"
-
msgid "no cherry-pick or revert in progress"
-msgstr "копирование или обращение изменений коммита уже выполнÑÑŽÑ‚ÑÑ"
+msgstr "копирование или обращение изменений коммита ÑÐµÐ¹Ñ‡Ð°Ñ Ð½Ðµ выполнÑÑŽÑ‚ÑÑ"
msgid "cannot resolve HEAD"
msgstr "не удалоÑÑŒ определить HEAD"
@@ -18885,39 +19518,33 @@ msgstr ""
" git rebase --continue\n"
"\n"
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "и были Ñделаны Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² индекÑе и/или в рабочем каталоге\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr ""
#, c-format
msgid ""
"execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
"Commit or stash your changes, and then run\n"
"\n"
" git rebase --continue\n"
"\n"
msgstr ""
-"уÑпешное выполнение: %s\n"
-"но оÑталиÑÑŒ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² индекÑе и/или в рабочем каталоге\n"
-"Сделайте коммит или ÑпрÑчьте ваши изменениÑ, а затем выполните\n"
-"\n"
-" git rebase --continue\n"
-"\n"
#, c-format
msgid "illegal label name: '%.*s'"
msgstr ""
+#, c-format
+msgid "could not resolve '%s'"
+msgstr "не удалоÑÑŒ раÑпознать «%s»"
+
msgid "writing fake root commit"
msgstr "запиÑÑŒ поддельного корневого коммита"
msgid "writing squash-onto"
msgstr "запить уплотнить-над"
-#, c-format
-msgid "could not resolve '%s'"
-msgstr "не удалоÑÑŒ раÑпознать «%s»"
-
msgid "cannot merge without a current revision"
msgstr "Ð½ÐµÐ»ÑŒÐ·Ñ Ñлить без текущей редакции"
@@ -18943,6 +19570,23 @@ msgstr "не удалоÑÑŒ даже попытатьÑÑ Ñлить «%.*s»"
msgid "merge: Unable to write new index file"
msgstr "ÑлиÑние: Ðе удалоÑÑŒ запиÑать файл индекÑа"
+#, c-format
+msgid ""
+"another 'rebase' process appears to be running; '%s.lock' already exists"
+msgstr ""
+
+#, c-format
+msgid ""
+"Updated the following refs with %s:\n"
+"%s"
+msgstr ""
+
+#, c-format
+msgid ""
+"Failed to update the following refs with %s:\n"
+"%s"
+msgstr ""
+
msgid "Cannot autostash"
msgstr "Ðе удалоÑÑŒ автоматичеÑки ÑпрÑтать изменениÑ"
@@ -19100,6 +19744,10 @@ msgid "the script was already rearranged."
msgstr "Ñценарий уже был переÑтроен."
#, c-format
+msgid "update-refs file at '%s' is invalid"
+msgstr ""
+
+#, c-format
msgid "'%s' is outside repository at '%s'"
msgstr ""
@@ -19225,13 +19873,17 @@ msgstr ""
#, c-format
msgid ""
-"unsafe repository ('%s' is owned by someone else)\n"
-"To add an exception for this directory, call:\n"
+"detected dubious ownership in repository at '%s'\n"
+"%sTo add an exception for this directory, call:\n"
"\n"
"\tgit config --global --add safe.directory %s"
msgstr ""
#, c-format
+msgid "cannot use bare repository '%s' (safe.bareRepository is '%s')"
+msgstr ""
+
+#, c-format
msgid ""
"problem with core.sharedRepository filemode value (0%.3o).\n"
"The owner of files must always have read and write permissions."
@@ -19299,15 +19951,11 @@ msgstr[2] "%u байтов/Ñ"
msgstr[3] "%u байта/Ñ"
#, c-format
-msgid "could not edit '%s'"
-msgstr ""
-
-#, c-format
msgid "ignoring suspicious submodule name: %s"
msgstr "игнорирую подозрительный подмодуль Ñ Ð¸Ð¼ÐµÐ½ÐµÐ¼: %s"
msgid "negative values not allowed for submodule.fetchJobs"
-msgstr "Ð½ÐµÐ»ÑŒÐ·Ñ Ð¸Ñпользовать отприцательные Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð´Ð»Ñ submodule.fetchJobs"
+msgstr "Ð½ÐµÐ»ÑŒÐ·Ñ Ð¸Ñпользовать отрицательные Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð´Ð»Ñ submodule.fetchJobs"
#, c-format
msgid "ignoring '%s' which may be interpreted as a command-line option: %s"
@@ -19472,6 +20120,25 @@ msgstr "ls-tree вернул неожиданный код %d"
msgid "failed to lstat '%s'"
msgstr ""
+msgid "no remote configured to get bundle URIs from"
+msgstr ""
+
+#, c-format
+msgid "remote '%s' has no configured URL"
+msgstr ""
+
+msgid "could not get the bundle-uri list"
+msgstr ""
+
+msgid "test-tool cache-tree <options> (control|prime|update)"
+msgstr ""
+
+msgid "clear the cache tree before each iteration"
+msgstr ""
+
+msgid "number of entries in the cache tree to invalidate (default 0)"
+msgstr ""
+
msgid "unhandled options"
msgstr ""
@@ -19806,6 +20473,12 @@ msgstr "Прерываю."
msgid "failed to push all needed submodules"
msgstr ""
+msgid "bundle-uri operation not supported by protocol"
+msgstr ""
+
+msgid "could not retrieve server-advertised bundle-uri list"
+msgstr ""
+
msgid "too-short tree object"
msgstr "Ñлишком короткий объект дерева"
@@ -20077,6 +20750,18 @@ msgstr "неправильный номер порта"
msgid "invalid '..' path segment"
msgstr "Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»ÑŒÐ½Ð°Ñ Ñ‡Ð°ÑÑ‚ÑŒ пути «..»"
+msgid "usage: "
+msgstr ""
+
+msgid "fatal: "
+msgstr ""
+
+msgid "error: "
+msgstr ""
+
+msgid "warning: "
+msgstr ""
+
msgid "Fetching objects"
msgstr ""
@@ -20530,14 +21215,16 @@ msgstr "Игнорируемые файлы"
#, c-format
msgid ""
-"It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
-"may speed it up, but you have to be careful not to forget to add\n"
-"new files yourself (see 'git help status')."
+"It took %.2f seconds to enumerate untracked files,\n"
+"but the results were cached, and subsequent runs may be faster."
+msgstr ""
+
+#, c-format
+msgid "It took %.2f seconds to enumerate untracked files."
+msgstr ""
+
+msgid "See 'git help status' for information on how to improve this."
msgstr ""
-"%.2f Ñек занÑл вывод ÑпиÑка неотÑлеживаемых файлов.\n"
-"«status -uno» возможно уÑкорит Ñто, но будьте внимательны\n"
-"и не забудьте добавить новые файлы вручную\n"
-"(Ñмотрите «git help status» Ð´Ð»Ñ Ð¿Ð¾Ð´Ñ€Ð¾Ð±Ð½Ð¾Ñтей)."
#, c-format
msgid "Untracked files not listed%s"
@@ -20687,296 +21374,6 @@ msgstr "Вам нужно запуÑкать Ñту команду находÑÑ
msgid "Unable to determine absolute path of git directory"
msgstr "Ðе удалоÑÑŒ определить абÑолютный путь к каталогу git"
-#. TRANSLATORS: you can adjust this to align "git add -i" status menu
-#, perl-format
-msgid "%12s %12s %s"
-msgstr "%12s %12s %s"
-
-#, perl-format
-msgid "touched %d path\n"
-msgid_plural "touched %d paths\n"
-msgstr[0] "тронут %d путь\n"
-msgstr[1] "тронуты %d пути\n"
-msgstr[2] "тронуты %d путей\n"
-msgstr[3] "тронуты %d пути\n"
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for staging."
-msgstr ""
-"ЕÑли патч применÑетÑÑ Ð±ÐµÐ· ошибок, то изменённый блок будет Ñразу помечен Ð´Ð»Ñ "
-"индекÑированиÑ."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for stashing."
-msgstr ""
-"ЕÑли патч применÑетÑÑ Ð±ÐµÐ· ошибок, то изменённый блок будет Ñразу помечен Ð´Ð»Ñ "
-"прÑтаньÑ."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for unstaging."
-msgstr ""
-"ЕÑли патч применÑетÑÑ Ð±ÐµÐ· ошибок, то изменённый блок будет Ñразу помечен Ð´Ð»Ñ "
-"ÑƒÐ±Ð¸Ñ€Ð°Ð½Ð¸Ñ Ð¸Ð· индекÑа."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for applying."
-msgstr ""
-"ЕÑли патч применÑетÑÑ Ð±ÐµÐ· ошибок, то изменённый блок будет Ñразу помечен Ð´Ð»Ñ "
-"применениÑ."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for discarding."
-msgstr ""
-"ЕÑли патч применÑетÑÑ Ð±ÐµÐ· ошибок, то изменённый блок будет Ñразу помечен Ð´Ð»Ñ "
-"отмены изменений."
-
-#, perl-format
-msgid "failed to open hunk edit file for writing: %s"
-msgstr "не удалоÑÑŒ открыть файл Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð±Ð»Ð¾ÐºÐ° изменений Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñи: %s"
-
-#, perl-format
-msgid ""
-"---\n"
-"To remove '%s' lines, make them ' ' lines (context).\n"
-"To remove '%s' lines, delete them.\n"
-"Lines starting with %s will be removed.\n"
-msgstr ""
-"---\n"
-"Чтобы удалить «%s» Ñтроки, Ñделайте их ' ' Ñтроками (контекÑÑ‚).\n"
-"Чтобы удалить «%s» Ñтроки, удалите их.\n"
-"Строки, начинающиеÑÑ Ñ %s будут удалены.\n"
-
-#, perl-format
-msgid "failed to open hunk edit file for reading: %s"
-msgstr "не удалоÑÑŒ открыть файл Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð±Ð»Ð¾ÐºÐ° изменений Ð´Ð»Ñ Ñ‡Ñ‚ÐµÐ½Ð¸Ñ: %s"
-
-msgid ""
-"y - stage this hunk\n"
-"n - do not stage this hunk\n"
-"q - quit; do not stage this hunk or any of the remaining ones\n"
-"a - stage this hunk and all later hunks in the file\n"
-"d - do not stage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - индекÑировать Ñтот блок\n"
-"n - пропуÑтить Ñтот блок\n"
-"q - выход; пропуÑтить Ñтот и вÑе оÑтавшиеÑÑ Ð±Ð»Ð¾ÐºÐ¸\n"
-"a - индекÑировать Ñтот и оÑтальные блоки файла\n"
-"d - пропуÑтить Ñтот и оÑтальные блоки файла"
-
-msgid ""
-"y - stash this hunk\n"
-"n - do not stash this hunk\n"
-"q - quit; do not stash this hunk or any of the remaining ones\n"
-"a - stash this hunk and all later hunks in the file\n"
-"d - do not stash this hunk or any of the later hunks in the file"
-msgstr ""
-"y - ÑпрÑтать Ñтот блок\n"
-"n - пропуÑтить Ñтот блок\n"
-"q - выход; пропуÑтить Ñтот и вÑе поÑледующие блоки\n"
-"a - ÑпрÑтать Ñтот и оÑтальные блоки файла\n"
-"d - пропуÑтить Ñтот и оÑтальные блоки файла"
-
-msgid ""
-"y - unstage this hunk\n"
-"n - do not unstage this hunk\n"
-"q - quit; do not unstage this hunk or any of the remaining ones\n"
-"a - unstage this hunk and all later hunks in the file\n"
-"d - do not unstage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - убрать из индекÑа Ñтот блок\n"
-"n - пропуÑтить Ñтот блок\n"
-"q - выход; пропуÑтить Ñтот и вÑе поÑледующие блоки\n"
-"a - убрать из индекÑа Ñтот и оÑтальные блоки файла\n"
-"d - пропуÑтить Ñтот и оÑтальные блоки файла"
-
-msgid ""
-"y - apply this hunk to index\n"
-"n - do not apply this hunk to index\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - принÑÑ‚ÑŒ Ñтот блок в индекÑ\n"
-"n - пропуÑтить Ñтот блок\n"
-"q - выход; пропуÑтить Ñтот и вÑе поÑледующие блоки\n"
-"a - принÑÑ‚ÑŒ Ñтот и оÑтальные блоки файла\n"
-"d - пропуÑтить Ñтот и оÑтальные блоки файла"
-
-msgid ""
-"y - discard this hunk from worktree\n"
-"n - do not discard this hunk from worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - отброÑить Ñтот блок из рабочего дерева\n"
-"n - пропуÑтить Ñтот блок\n"
-"q - выход; пропуÑтить Ñтот и вÑе поÑледующие блоки\n"
-"a - отброÑить Ñтот и оÑтальные блоки файла\n"
-"d - пропуÑтить Ñтот и оÑтальные блоки файла"
-
-msgid ""
-"y - discard this hunk from index and worktree\n"
-"n - do not discard this hunk from index and worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - отброÑить Ñтот блок из индекÑа и рабочего дерева\n"
-"n - пропуÑтить Ñтот блок\n"
-"q - выход; пропуÑтить Ñтот и вÑе поÑледующие блоки\n"
-"a - отброÑить Ñтот и оÑтальные блоки файла\n"
-"d - пропуÑтить Ñтот и оÑтальные блоки файла"
-
-msgid ""
-"y - apply this hunk to index and worktree\n"
-"n - do not apply this hunk to index and worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - принÑÑ‚ÑŒ Ñтот блок в Ð¸Ð½Ð´ÐµÐºÑ Ð¸ рабочее дерево\n"
-"n - пропуÑтить Ñтот блок\n"
-"q - выход; пропуÑтить Ñтот и вÑе поÑледующие блоки\n"
-"a - принÑÑ‚ÑŒ Ñтот и оÑтальные блоки файла\n"
-"d - пропуÑтить Ñтот и оÑтальные блоки файла"
-
-msgid ""
-"y - apply this hunk to worktree\n"
-"n - do not apply this hunk to worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - принÑÑ‚ÑŒ Ñтот блок в рабочее дерево\n"
-"n - пропуÑтить Ñтот блок\n"
-"q - выход; пропуÑтить Ñтот и вÑе поÑледующие блоки\n"
-"a - принÑÑ‚ÑŒ Ñтот и оÑтальные блоки файла\n"
-"d - пропуÑтить Ñтот и оÑтальные блоки файла"
-
-msgid ""
-"g - select a hunk to go to\n"
-"/ - search for a hunk matching the given regex\n"
-"j - leave this hunk undecided, see next undecided hunk\n"
-"J - leave this hunk undecided, see next hunk\n"
-"k - leave this hunk undecided, see previous undecided hunk\n"
-"K - leave this hunk undecided, see previous hunk\n"
-"s - split the current hunk into smaller hunks\n"
-"e - manually edit the current hunk\n"
-"? - print help\n"
-msgstr ""
-"g - выбрать блок изменений на который нужно перейти\n"
-"/ - поиÑк блока изменений Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ регулÑрного выражениÑ\n"
-"j - не принимать решение по Ñтому блоку, перейти на Ñледующий нерешенный\n"
-"J - не принимать решение по Ñтому блоку, перейти на Ñледующий\n"
-"k - не принимать решение по Ñтому блоку, перейти на предыдущий нерешенный\n"
-"K - не принимать решение по Ñтому блоку, перейти на предыдущий\n"
-"s - разделить текущий блок на блоки меньшего размера\n"
-"e - вручную отредактировать текущий блок\n"
-"? - вывеÑти Ñправку\n"
-
-msgid "The selected hunks do not apply to the index!\n"
-msgstr "Выбранные блоки не применÑÑŽÑ‚ÑÑ Ð±ÐµÐ· ошибок к индекÑу!\n"
-
-#, perl-format
-msgid "ignoring unmerged: %s\n"
-msgstr "игнорирую не Ñлитое: %s\n"
-
-#, perl-format
-msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
-msgstr ""
-
-#, perl-format
-msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
-msgstr ""
-
-#, perl-format
-msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
-msgstr ""
-
-#, perl-format
-msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
-msgstr "ПринÑÑ‚ÑŒ Ñтот блок в рабочее дерево [y,n,q,a,d%s,?]? "
-
-msgid "No other hunks to goto\n"
-msgstr ""
-
-#, perl-format
-msgid "Invalid number: '%s'\n"
-msgstr "Ðеверный номер: «%s»\n"
-
-#, perl-format
-msgid "Sorry, only %d hunk available.\n"
-msgid_plural "Sorry, only %d hunks available.\n"
-msgstr[0] "ПроÑтите, но только %d блок изменений доÑтупен.\n"
-msgstr[1] "ПроÑтите, но только %d блока изменений доÑтупно.\n"
-msgstr[2] "ПроÑтите, но только %d блоков изменений доÑтупно.\n"
-msgstr[3] "ПроÑтите, но только %d блока изменений доÑтупно.\n"
-
-msgid "No other hunks to search\n"
-msgstr ""
-
-#, perl-format
-msgid "Malformed search regexp %s: %s\n"
-msgstr "РегулÑрное выражение Ð´Ð»Ñ Ð¿Ð¾Ð¸Ñка в неверном формате %s: %s\n"
-
-msgid "No hunk matches the given pattern\n"
-msgstr "Ðе найдены блоки, которые ÑоответÑтвуют указанному шаблону\n"
-
-msgid "No previous hunk\n"
-msgstr "Ðет предыдущего блока\n"
-
-msgid "No next hunk\n"
-msgstr "Ðе Ñледующего блока\n"
-
-msgid "Sorry, cannot split this hunk\n"
-msgstr ""
-
-#, perl-format
-msgid "Split into %d hunk.\n"
-msgid_plural "Split into %d hunks.\n"
-msgstr[0] "Разбито на %d блок изменений.\n"
-msgstr[1] "Разбито на %d блока изменений.\n"
-msgstr[2] "Разбито на %d блоков изменений.\n"
-msgstr[3] "Разбито на %d блока изменений.\n"
-
-msgid "Sorry, cannot edit this hunk\n"
-msgstr ""
-
-#. TRANSLATORS: please do not translate the command names
-#. 'status', 'update', 'revert', etc.
-msgid ""
-"status - show paths with changes\n"
-"update - add working tree state to the staged set of changes\n"
-"revert - revert staged set of changes back to the HEAD version\n"
-"patch - pick hunks and update selectively\n"
-"diff - view diff between HEAD and index\n"
-"add untracked - add contents of untracked files to the staged set of "
-"changes\n"
-msgstr ""
-"status - показать пути Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñми\n"
-"update - добавить ÑоÑтоÑние рабочей копии в индекÑ\n"
-"revert - вернуть проиндекÑированный набор изменений к HEAD-верÑии\n"
-"patch - выбрать и выборочно обновить блоки\n"
-"diff - проÑмотреть Ñ€Ð°Ð·Ð»Ð¸Ñ‡Ð¸Ñ Ð¼ÐµÐ¶Ð´Ñƒ HEAD и индекÑом\n"
-"add untracked - добавить Ñодержимое неотÑлеживаемых файлов в индекÑ\n"
-
-msgid "missing --"
-msgstr "отÑутÑтвует --"
-
-#, perl-format
-msgid "unknown --patch mode: %s"
-msgstr "неизвеÑтный режим Ð´Ð»Ñ --patch: %s"
-
-#, perl-format
-msgid "invalid argument %s, expecting --"
-msgstr "недопуÑтимый аргумент %s, ожидаетÑÑ --"
-
msgid "local zone differs from GMT by a non-minute interval\n"
msgstr "локальный чаÑовой поÑÑ Ð¾Ñ‚Ð»Ð¸Ñ‡Ð°ÐµÑ‚ÑÑ Ð¾Ñ‚ GMT на не минутный интервал\n"
@@ -21255,13 +21652,17 @@ msgid "(%s) Could not execute '%s'"
msgstr "(%s) Ðе удалоÑÑŒ выполнить «%s»"
#, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) Добавление %s: %s из: «%s»\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr ""
#, perl-format
msgid "(%s) failed to close pipe to '%s'"
msgstr "(%s) не удалоÑÑŒ закрыть поток к «%s»"
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) Добавление %s: %s из: «%s»\n"
+
msgid "cannot send message as 7bit"
msgstr "не удалоÑÑŒ отправить Ñообщение в 7 битной кодировке"
diff --git a/po/sv.po b/po/sv.po
index 56db2f1..786c2f7 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -1,22 +1,22 @@
# Swedish translations for Git.
-# Copyright (C) 2010-2022 Peter Krefting <peter@softwolves.pp.se>
+# Copyright (C) 2010-2024 Peter Krefting <peter@softwolves.pp.se>
# This file is distributed under the same license as the Git package.
-# Peter Krefting <peter@softwolves.pp.se>, 2010-2022.
+# Peter Krefting <peter@softwolves.pp.se>, 2010-2024.
#
msgid ""
msgstr ""
-"Project-Id-Version: git 2.37.0\n"
+"Project-Id-Version: git 2.44.0\n"
"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2022-06-24 21:19+0100\n"
-"PO-Revision-Date: 2022-06-24 21:23+0100\n"
+"POT-Creation-Date: 2024-02-16 07:58+0100\n"
+"PO-Revision-Date: 2024-02-16 07:59+0100\n"
"Last-Translator: Peter Krefting <peter@softwolves.pp.se>\n"
-"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
+"Language-Team: Svenska <tp-sv@listor.tp-sv.se>\n"
"Language: sv\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Gtranslator 3.38.0\n"
+"X-Generator: Gtranslator 42.0\n"
#, c-format
msgid "Huh (%s)?"
@@ -39,24 +39,24 @@ msgstr "Uppdatera"
#, c-format
msgid "could not stage '%s'"
-msgstr "kunde inte köa \"%s\""
+msgstr "kunde inte köa â€%sâ€"
msgid "could not write index"
msgstr "kunde inte skriva indexet"
-#, c-format, perl-format
+#, c-format
msgid "updated %d path\n"
msgid_plural "updated %d paths\n"
msgstr[0] "uppdaterade %d sökväg\n"
msgstr[1] "uppdaterade %d sökvägar\n"
-#, c-format, perl-format
+#, c-format
msgid "note: %s is untracked now.\n"
msgstr "observera: %s spåras inte längre.\n"
#, c-format
msgid "make_cache_entry failed for path '%s'"
-msgstr "make_cache_entry misslyckades för sökvägen \"%s\""
+msgstr "make_cache_entry misslyckades för sökvägen â€%sâ€"
msgid "Revert"
msgstr "Återställ"
@@ -64,7 +64,7 @@ msgstr "Återställ"
msgid "Could not parse HEAD^{tree}"
msgstr "kunde inte tolka HEAD^{tree}"
-#, c-format, perl-format
+#, c-format
msgid "reverted %d path\n"
msgid_plural "reverted %d paths\n"
msgstr[0] "återställde %d sökväg\n"
@@ -77,7 +77,7 @@ msgstr "Inga ospårade filer.\n"
msgid "Add untracked"
msgstr "Lägg till ospårad"
-#, c-format, perl-format
+#, c-format
msgid "added %d path\n"
msgid_plural "added %d paths\n"
msgstr[0] "lade till %d sökväg\n"
@@ -171,19 +171,19 @@ msgstr "kunde inte uppdatera indexet"
msgid "Bye.\n"
msgstr "Hej då.\n"
-#, c-format, perl-format
+#, c-format
msgid "Stage mode change [y,n,q,a,d%s,?]? "
msgstr "Köa ändrat läge [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage deletion [y,n,q,a,d%s,?]? "
msgstr "Köa borttagning [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage addition [y,n,q,a,d%s,?]? "
msgstr "Köa tillägg [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage this hunk [y,n,q,a,d%s,?]? "
msgstr "Köa stycket [y,n,q,a,d%s,?]? "
@@ -207,19 +207,19 @@ msgstr ""
"a - köa stycket och alla följande i filen\n"
"d - köa inte stycket eller något av de följande i filen\n"
-#, c-format, perl-format
+#, c-format
msgid "Stash mode change [y,n,q,a,d%s,?]? "
msgstr "Stash:a ändrat läge [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash deletion [y,n,q,a,d%s,?]? "
msgstr "Stash:a borttagning [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash addition [y,n,q,a,d%s,?]? "
msgstr "Stash:a tillägg [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash this hunk [y,n,q,a,d%s,?]? "
msgstr "Stash:a stycket [y,n,q,a,d%s,?]? "
@@ -228,7 +228,7 @@ msgid ""
"stashing."
msgstr ""
"Om patchen kan appliceras rent kommer det redigerade stycket att läggas till "
-"i \"stash\" omedelbart."
+"i â€stash†omedelbart."
msgid ""
"y - stash this hunk\n"
@@ -237,25 +237,25 @@ msgid ""
"a - stash this hunk and all later hunks in the file\n"
"d - do not stash this hunk or any of the later hunks in the file\n"
msgstr ""
-"y - \"stash\":a stycket\n"
-"n - \"stash\":a inte stycket\n"
-"q - avsluta; \"stash\":a inte stycket eller något av de följande\n"
-"a - \"stash\":a stycket och alla följande i filen\n"
-"d - \"stash\":a inte stycket eller något av de följande i filen\n"
+"y - â€stashâ€:a stycket\n"
+"n - â€stashâ€:a inte stycket\n"
+"q - avsluta; â€stashâ€:a inte stycket eller nÃ¥got av de följande\n"
+"a - â€stashâ€:a stycket och alla följande i filen\n"
+"d - â€stashâ€:a inte stycket eller nÃ¥got av de följande i filen\n"
-#, c-format, perl-format
+#, c-format
msgid "Unstage mode change [y,n,q,a,d%s,?]? "
msgstr "Ta bort ändrat läge från kön [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage deletion [y,n,q,a,d%s,?]? "
msgstr "Ta bort borttagning från kön [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage addition [y,n,q,a,d%s,?]? "
msgstr "Ta bort tillägg från kön [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage this hunk [y,n,q,a,d%s,?]? "
msgstr "Ta bort stycket från kön [y,n,q,a,d%s,?]? "
@@ -279,19 +279,19 @@ msgstr ""
"a - ta bort stycket och alla följande i filen från kön\n"
"d - ta inte bort stycket eller något av de följande i filen från kön\n"
-#, c-format, perl-format
+#, c-format
msgid "Apply mode change to index [y,n,q,a,d%s,?]? "
msgstr "Applicera ändrat läge på indexet [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply deletion to index [y,n,q,a,d%s,?]? "
msgstr "Applicera borttagning på indexet [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply addition to index [y,n,q,a,d%s,?]? "
msgstr "Applicera tillägg på indexet [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply this hunk to index [y,n,q,a,d%s,?]? "
msgstr "Applicera stycket på indexet [y,n,q,a,d%s,?]? "
@@ -315,19 +315,19 @@ msgstr ""
"a - applicera stycket och alla följande i filen\n"
"d - applicera inte stycket eller något av de följande i filen\n"
-#, c-format, perl-format
+#, c-format
msgid "Discard mode change from worktree [y,n,q,a,d%s,?]? "
msgstr "Kasta ändrat läge från arbetskatalogen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard deletion from worktree [y,n,q,a,d%s,?]? "
msgstr "Kasta borttagning från arbetskatalogen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard addition from worktree [y,n,q,a,d%s,?]? "
msgstr "Kasta tillägg från arbetskatalogen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard this hunk from worktree [y,n,q,a,d%s,?]? "
msgstr "Kasta stycket från arbetskatalogen [y,n,q,a,d%s,?]? "
@@ -351,19 +351,19 @@ msgstr ""
"a - förkasta stycket och alla följande i filen\n"
"d - förkasta inte stycket eller något av de följande i filen\n"
-#, c-format, perl-format
+#, c-format
msgid "Discard mode change from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Kasta ändrat läge från indexet och arbetskatalogen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard deletion from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Kasta borttagning från indexet och arbetskatalogen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard addition from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Kasta tillägg från indexet och arbetskatalogen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard this hunk from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Kasta stycket från indexet och arbetskatalogen [y,n,q,a,d%s,?]? "
@@ -380,19 +380,19 @@ msgstr ""
"a - förkasta stycket och alla följande i filen\n"
"d - förkasta inte stycket eller något av de följande i filen\n"
-#, c-format, perl-format
+#, c-format
msgid "Apply mode change to index and worktree [y,n,q,a,d%s,?]? "
msgstr "Applicera ändrat läge på indexet och arbetskatalogen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply deletion to index and worktree [y,n,q,a,d%s,?]? "
msgstr "Applicera borttagning på indexet och arbetskatalogen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply addition to index and worktree [y,n,q,a,d%s,?]? "
msgstr "Applicera tillägg på indexet och arbetskatalogen [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply this hunk to index and worktree [y,n,q,a,d%s,?]? "
msgstr "Applicera stycket på indexet och arbetskatalogen [y,n,q,a,d%s,?]? "
@@ -409,6 +409,22 @@ msgstr ""
"a - applicera stycket och alla följande i filen\n"
"d - applicera inte stycket eller något av de följande i filen\n"
+#, c-format
+msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
+msgstr "Applicera ändrat läge på arbetskatalogen [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
+msgstr "Applicera borttagning på arbetskatalogen [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
+msgstr "Applicera tillägg på arbetskatalogen [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
+msgstr "Applicera stycket på arbetskatalogen [y,n,q,a,d%s,?]? "
+
msgid ""
"y - apply this hunk to worktree\n"
"n - do not apply this hunk to worktree\n"
@@ -424,11 +440,7 @@ msgstr ""
#, c-format
msgid "could not parse hunk header '%.*s'"
-msgstr "kunde inte tolka styckehuvudet \"%.*s\""
-
-#, c-format
-msgid "could not parse colored hunk header '%.*s'"
-msgstr "kunde inte tolka färgat styckehuvud \"%.*s\""
+msgstr "kunde inte tolka styckehuvudet â€%.*sâ€"
msgid "could not parse diff"
msgstr "kunde inte tolka diff"
@@ -438,7 +450,7 @@ msgstr "kunde inte tolka färgad diff"
#, c-format
msgid "failed to run '%s'"
-msgstr "misslyckades att köra \"%s\""
+msgstr "misslyckades att köra â€%sâ€"
msgid "mismatched output from interactive.diffFilter"
msgstr "omaka utdata från interactive.diffFilter"
@@ -481,12 +493,10 @@ msgid ""
"Lines starting with %c will be removed.\n"
msgstr ""
"---\n"
-"Ta bort \"%c\" rader genom att göra dem \" \"-rader (sammanhang).\n"
-"Ta bort \"%c\" rader genom att radera dem.\n"
+"Ta bort â€%c†rader genom att göra dem †â€-rader (sammanhang).\n"
+"Ta bort â€%c†rader genom att radera dem.\n"
"Rader som börjar med %c kommer att tas bort.\n"
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: 'it' refers to the patch mentioned in the previous messages.
msgid ""
"If it does not apply cleanly, you will be given an opportunity to\n"
"edit again. If all lines of the hunk are removed, then the edit is\n"
@@ -500,27 +510,19 @@ msgid "could not parse hunk header"
msgstr "kunde inte tolka styckehuvud"
msgid "'git apply --cached' failed"
-msgstr "\"git apply --cached\" misslyckades"
+msgstr "â€git apply --cached†misslyckades"
-#. #-#-#-#-# add-patch.c.po #-#-#-#-#
#. TRANSLATORS: do not translate [y/n]
#. The program will only accept that input at this point.
#. Consider translating (saying "no" discards!) as
#. (saying "n" for "no" discards!) if the translation
#. of the word "no" does not start with n.
#.
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: do not translate [y/n]
-#. The program will only accept that input
-#. at this point.
-#. Consider translating (saying "no" discards!) as
-#. (saying "n" for "no" discards!) if the translation
-#. of the word "no" does not start with n.
msgid ""
"Your edited hunk does not apply. Edit again (saying \"no\" discards!) [y/n]? "
msgstr ""
-"Ditt redigerade stycke kan inte appliceras. Redigera igen (\"nej\" kastar!) "
-"[y/n]? "
+"Ditt redigerade stycke kan inte appliceras. Redigera igen (â€nej†kastar!) [y/"
+"n]? "
msgid "The selected hunks do not apply to the index!"
msgstr "Markerade stycken kan inte appliceras på indexet!"
@@ -569,7 +571,7 @@ msgstr "gå till vilket stycke? "
#, c-format
msgid "Invalid number: '%s'"
-msgstr "Ogiltigt siffervärde: \"%s\""
+msgstr "Ogiltigt siffervärde: â€%sâ€"
#, c-format
msgid "Sorry, only %d hunk available."
@@ -601,7 +603,7 @@ msgid "Sorry, cannot edit this hunk"
msgstr "Beklagar, kan inte redigera stycket"
msgid "'git apply' failed"
-msgstr "\"git apply\" misslyckades"
+msgstr "â€git apply†misslyckades"
#, c-format
msgid ""
@@ -609,7 +611,7 @@ msgid ""
"Disable this message with \"git config advice.%s false\""
msgstr ""
"\n"
-"Slå av meddelandet med \"git config advice.%s false\""
+"SlÃ¥ av meddelandet med â€git config advice.%s falseâ€"
#, c-format
msgid "%shint: %.*s%s\n"
@@ -617,13 +619,11 @@ msgstr "%stips: %.*s%s\n"
msgid "Cherry-picking is not possible because you have unmerged files."
msgstr ""
-"Du kan inte utföra en cherry-pick eftersom du har filer som inte slagits "
+"Du kan inte utföra en â€cherry-pick†eftersom du har filer som inte slagits "
"samman."
msgid "Committing is not possible because you have unmerged files."
-msgstr ""
-"Du kan inte utföra en incheckning eftersom du har filer som inte slagits "
-"samman."
+msgstr "Du kan inte checka in eftersom du har filer som inte slagits samman."
msgid "Merging is not possible because you have unmerged files."
msgstr ""
@@ -632,23 +632,19 @@ msgstr ""
msgid "Pulling is not possible because you have unmerged files."
msgstr ""
-"Du kan inte utföra en \"pull\" eftersom du har filer som inte slagits samman."
+"Du kan inte utföra en â€pull†eftersom du har filer som inte slagits samman."
msgid "Reverting is not possible because you have unmerged files."
-msgstr ""
-"Du kan inte utföra en \"revert\" eftersom du har filer som inte slagits "
-"samman."
+msgstr "Du kan inte återställa eftersom du har filer som inte slagits samman."
-#, c-format
-msgid "It is not possible to %s because you have unmerged files."
-msgstr ""
-"Du kan inte utföra en \"%s\" eftersom du har filer som inte slagits samman."
+msgid "Rebasing is not possible because you have unmerged files."
+msgstr "Du kan inte ombasera eftersom du har filer som inte slagits samman."
msgid ""
"Fix them up in the work tree, and then use 'git add/rm <file>'\n"
"as appropriate to mark resolution and make a commit."
msgstr ""
-"Rätta dem i din arbetskatalog och använd sedan \"git add/rm <fil>\"\n"
+"Rätta dem i din arbetskatalog och använd sedan â€git add/rm <fil>â€\n"
"som lämpligt för att ange lösning och checka in."
msgid "Exiting because of an unresolved conflict."
@@ -663,6 +659,23 @@ msgstr "Checka in dina ändringar innan du utför sammanslagningen."
msgid "Exiting because of unfinished merge."
msgstr "Avslutar på grund av ofullbordad sammanslagning."
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"Divergerande grenar kan inte snabbspolas, du måste antingen använda:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"eller:\n"
+"\n"
+"\tgit rebase\n"
+
msgid "Not possible to fast-forward, aborting."
msgstr "Kan inte snabbspola, avbryter."
@@ -672,8 +685,8 @@ msgid ""
"outside of your sparse-checkout definition, so will not be\n"
"updated in the index:\n"
msgstr ""
-"Följande sökvägar och/eller ökvägsangivelser motsvarar sökvägar\n"
-"utanför din \"sparse-checkout\"-definition, så de kommer inte\n"
+"Följande sökvägar och/eller sökvägsangivelser motsvarar sökvägar\n"
+"utanför din â€sparse-checkoutâ€-definition, sÃ¥ de kommer inte\n"
"uppdateras i indexet:\n"
msgid ""
@@ -706,9 +719,9 @@ msgid ""
"false\n"
"\n"
msgstr ""
-"Observera: checkar ut \"%s\".\n"
+"Observera: checkar ut â€%sâ€.\n"
"\n"
-"Du har nu ett \"frånkopplat HEAD\". Du kan se dig omkring, experimentera\n"
+"Du har nu ett â€frÃ¥nkopplat HEADâ€. Du kan se dig omkring, experimentera\n"
"med ändringar och checka in dem, och du kan kasta incheckningar du gör\n"
"i det här läget utan att det påverkar grenar genom att växla tillbaka\n"
"till en gren.\n"
@@ -727,27 +740,55 @@ msgstr ""
"advice.detachedHead till false\n"
"\n"
+#, c-format
+msgid ""
+"The following paths have been moved outside the\n"
+"sparse-checkout definition but are not sparse due to local\n"
+"modifications.\n"
+msgstr ""
+"Följande sökvägar har flyttats ut från din\n"
+"â€sparse-checkoutâ€-definition, men är inte glesa pÃ¥ grund av\n"
+"lokala ändringar.\n"
+
+msgid ""
+"To correct the sparsity of these paths, do the following:\n"
+"* Use \"git add --sparse <paths>\" to update the index\n"
+"* Use \"git sparse-checkout reapply\" to apply the sparsity rules"
+msgstr ""
+"För att korrigera glesheten för dessa sökvägar, gör följande:\n"
+"* Använd â€git add --sparse <sökväg>†för att uppdatera indexet\n"
+"* Använd â€git sparse-checkout reapply†för att tillämpa gleshetsreglerna"
+
msgid "cmdline ends with \\"
msgstr "kommandorad avslutas med \\"
msgid "unclosed quote"
msgstr "citat ej stängt"
+msgid "too many arguments"
+msgstr "för många argument"
+
#, c-format
msgid "unrecognized whitespace option '%s'"
-msgstr "okänt alternativ för whitespace: \"%s\""
+msgstr "okänt alternativ för whitespace: â€%sâ€"
#, c-format
msgid "unrecognized whitespace ignore option '%s'"
-msgstr "okänt alternativ för ignore-whitespace: \"%s\""
+msgstr "okänt alternativ för ignore-whitespace: â€%sâ€"
#, c-format
msgid "options '%s' and '%s' cannot be used together"
-msgstr "flaggorna \"%s\" och \"%s\" kan inte användas samtidigt"
+msgstr "flaggorna â€%s†och â€%s†kan inte användas samtidigt"
#, c-format
msgid "'%s' outside a repository"
-msgstr "\"%s\" utanför arkiv"
+msgstr "â€%s†utanför arkiv"
+
+msgid "failed to read patch"
+msgstr "misslyckades läsa patchen"
+
+msgid "patch too large"
+msgstr "patchen är för stor"
#, c-format
msgid "Cannot prepare timestamp regexp %s"
@@ -856,7 +897,7 @@ msgstr "kunde inte öppna eller läsa %s"
#, c-format
msgid "invalid start of line: '%c'"
-msgstr "felaktig inledning på rad: \"%c\""
+msgstr "felaktig inledning pÃ¥ rad: â€%câ€"
#, c-format
msgid "Hunk #%d succeeded at %d (offset %d line)."
@@ -878,41 +919,38 @@ msgstr ""
#, c-format
msgid "missing binary patch data for '%s'"
-msgstr "saknar binära patchdata för \"%s\""
+msgstr "saknar binära patchdata för â€%sâ€"
#, c-format
msgid "cannot reverse-apply a binary patch without the reverse hunk to '%s'"
msgstr ""
-"kan inte applicera en binärpatch baklänges utan den omvända patchen för \"%s"
-"\""
+"kan inte applicera en binärpatch baklänges utan den omvända patchen för â€%sâ€"
#, c-format
msgid "cannot apply binary patch to '%s' without full index line"
-msgstr ""
-"kan inte applicera binärpatch på \"%s\" utan den fullständiga indexraden"
+msgstr "kan inte applicera binärpatch pÃ¥ â€%s†utan den fullständiga indexraden"
#, c-format
msgid ""
"the patch applies to '%s' (%s), which does not match the current contents."
msgstr ""
-"patchen appliceras på \"%s\" (%s), som inte motsvarar det nuvarande "
-"innehållet."
+"patchen appliceras pÃ¥ â€%s†(%s), som inte motsvarar det nuvarande innehÃ¥llet."
#, c-format
msgid "the patch applies to an empty '%s' but it is not empty"
-msgstr "patchen appliceras på en tom \"%s\", men den är inte tom"
+msgstr "patchen appliceras pÃ¥ en tom â€%sâ€, men den är inte tom"
#, c-format
msgid "the necessary postimage %s for '%s' cannot be read"
-msgstr "nödvändig efterbild %s för \"%s\" kan inte läsas"
+msgstr "nödvändig efterbild %s för â€%s†kan inte läsas"
#, c-format
msgid "binary patch does not apply to '%s'"
-msgstr "binärpatchen kan inte tillämpas på \"%s\""
+msgstr "binärpatchen kan inte tillämpas pÃ¥ â€%sâ€"
#, c-format
msgid "binary patch to '%s' creates incorrect result (expecting %s, got %s)"
-msgstr "binärpatchen på \"%s\" ger felaktigt resultat (förväntade %s, fick %s)"
+msgstr "binärpatchen pÃ¥ â€%s†ger felaktigt resultat (förväntade %s, fick %s)"
#, c-format
msgid "patch failed: %s:%ld"
@@ -928,7 +966,7 @@ msgstr "misslyckades läsa %s"
#, c-format
msgid "reading from '%s' beyond a symbolic link"
-msgstr "läser från \"%s\" som är på andra sidan av en symbolisk länk"
+msgstr "läser frÃ¥n â€%s†som är pÃ¥ andra sidan av en symbolisk länk"
#, c-format
msgid "path %s has been renamed/deleted"
@@ -951,7 +989,7 @@ msgstr "Utför trevägssammanslagning...\n"
#, c-format
msgid "cannot read the current contents of '%s'"
-msgstr "kunde inte läsa aktuellt innehåll i \"%s\""
+msgstr "kunde inte läsa aktuellt innehÃ¥ll i â€%sâ€"
#, c-format
msgid "Failed to perform three-way merge...\n"
@@ -959,11 +997,11 @@ msgstr "Misslyckades utföra trevägssammanslagning...\n"
#, c-format
msgid "Applied patch to '%s' with conflicts.\n"
-msgstr "Applicerade patchen på \"%s\" med konflikter.\n"
+msgstr "Applicerade patchen pÃ¥ â€%s†med konflikter.\n"
#, c-format
msgid "Applied patch to '%s' cleanly.\n"
-msgstr "Tillämpade patchen på \"%s\" rent.\n"
+msgstr "Tillämpade patchen pÃ¥ â€%s†rent.\n"
#, c-format
msgid "Falling back to direct application...\n"
@@ -982,7 +1020,7 @@ msgstr "%s har typen %o, förväntade %o"
#, c-format
msgid "invalid path '%s'"
-msgstr "ogiltig sökväg \"%s\""
+msgstr "ogiltig sökväg â€%sâ€"
#, c-format
msgid "%s: already exists in index"
@@ -1002,7 +1040,7 @@ msgstr "nytt läge (%o) för %s motsvarar inte gammalt läge (%o) för %s"
#, c-format
msgid "affected file '%s' is beyond a symbolic link"
-msgstr "den berörda filen \"%s\" är på andra sidan av en symbolisk länk"
+msgstr "den berörda filen â€%s†är pÃ¥ andra sidan av en symbolisk länk"
#, c-format
msgid "%s: patch does not apply"
@@ -1042,7 +1080,7 @@ msgstr "trasig patch för undermodulen %s"
#, c-format
msgid "unable to stat newly created file '%s'"
-msgstr "kan inte ta status på nyligen skapade filen \"%s\""
+msgstr "kan inte ta status pÃ¥ nyligen skapade filen â€%sâ€"
#, c-format
msgid "unable to create backing store for newly created file %s"
@@ -1054,15 +1092,15 @@ msgstr "kan inte lägga till cachepost för %s"
#, c-format
msgid "failed to write to '%s'"
-msgstr "misslyckades skriva till \"%s\""
+msgstr "misslyckades skriva till â€%sâ€"
#, c-format
msgid "closing file '%s'"
-msgstr "stänger filen \"%s\""
+msgstr "stänger filen â€%sâ€"
#, c-format
msgid "unable to write file '%s' mode %o"
-msgstr "kan inte skriva filen \"%s\" läge %o"
+msgstr "kan inte skriva filen â€%s†läge %o"
#, c-format
msgid "Applied patch %s cleanly."
@@ -1086,6 +1124,10 @@ msgid "cannot open %s"
msgstr "kan inte öppna %s"
#, c-format
+msgid "cannot unlink '%s'"
+msgstr "kan inte ta bort länken â€%sâ€"
+
+#, c-format
msgid "Hunk #%d applied cleanly."
msgstr "Stycke %d tillämpades rent."
@@ -1095,17 +1137,17 @@ msgstr "Refuserar stycke %d."
#, c-format
msgid "Skipped patch '%s'."
-msgstr "Ignorerar patch \"%s\"."
+msgstr "Ignorerar patch â€%sâ€."
msgid "No valid patches in input (allow with \"--allow-empty\")"
-msgstr "Inga giltiga patchar i indata (tillåt med \"--allow-empty\")"
+msgstr "Inga giltiga patchar i indata (tillÃ¥t med â€--allow-emptyâ€)"
msgid "unable to read index file"
msgstr "kan inte läsa indexfilen"
#, c-format
msgid "can't open patch '%s': %s"
-msgstr "kan inte öppna patchen \"%s\": %s"
+msgstr "kan inte öppna patchen â€%sâ€: %s"
#, c-format
msgid "squelched %d whitespace error"
@@ -1159,7 +1201,7 @@ msgid "make sure the patch is applicable to the current index"
msgstr "se till att patchen kan tillämpas på aktuellt index"
msgid "mark new files with `git add --intent-to-add`"
-msgstr "markera nya filer med \"git add --intent-to-add\""
+msgstr "markera nya filer med â€git add --intent-to-addâ€"
msgid "apply a patch without touching the working tree"
msgstr "tillämpa en patch utan att röra arbetskatalogen"
@@ -1229,15 +1271,19 @@ msgid "unsupported file mode: 0%o (SHA1: %s)"
msgstr "filens läge stöds ej: 0%o (SHA1: %s)"
#, c-format
+msgid "deflate error (%d)"
+msgstr "fel i deflate (%d)"
+
+#, c-format
msgid "unable to start '%s' filter"
-msgstr "kunde inte starta filtret \"%s\""
+msgstr "kunde inte starta filtret â€%sâ€"
msgid "unable to redirect descriptor"
msgstr "kan inte omdirigera handtag"
#, c-format
msgid "'%s' filter reported error"
-msgstr "filtret \"%s\" rapporterade fel"
+msgstr "filtret â€%s†rapporterade fel"
#, c-format
msgid "path is not valid UTF-8: %s"
@@ -1248,10 +1294,6 @@ msgid "path too long (%d chars, SHA1: %s): %s"
msgstr "sökvägen för lång (%d tecken, SHA1: %s): %s"
#, c-format
-msgid "deflate error (%d)"
-msgstr "fel i deflate (%d)"
-
-#, c-format
msgid "timestamp too large for this system: %<PRIuMAX>"
msgstr "tidsstämpeln för stor för detta system: %<PRIuMAX>"
@@ -1269,11 +1311,15 @@ msgstr "git archive --remote <arkiv> [--exec <kmd>] --list"
#, c-format
msgid "cannot read '%s'"
-msgstr "kunde inte läsa \"%s\""
+msgstr "kunde inte läsa â€%sâ€"
+
+#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr "sökvägsangivelsen â€%s†motsvarar filer utanför aktuell katalog"
#, c-format
msgid "pathspec '%s' did not match any files"
-msgstr "sökvägsangivelsen \"%s\" motsvarade inte några filer"
+msgstr "sökvägsangivelsen â€%s†motsvarade inte nÃ¥gra filer"
#, c-format
msgid "no such ref: %.*s"
@@ -1287,9 +1333,6 @@ msgstr "objektnamnet är inte giltigt: %s"
msgid "not a tree object: %s"
msgstr "inte ett trädobjekt: %s"
-msgid "current working directory is untracked"
-msgstr "aktuell arbetskatalog är inte spårad"
-
#, c-format
msgid "File not found: %s"
msgstr "Hittar inte filen: %s"
@@ -1300,15 +1343,15 @@ msgstr "Inte en vanlig fil: %s"
#, c-format
msgid "unclosed quote: '%s'"
-msgstr "citat ej stängt: \"%s\""
+msgstr "citat ej stängt: â€%sâ€"
#, c-format
msgid "missing colon: '%s'"
-msgstr "kolon saknas: \"%s\""
+msgstr "kolon saknas: â€%sâ€"
#, c-format
msgid "empty file name: '%s'"
-msgstr "tomt filnamn: \"%s\""
+msgstr "tomt filnamn: â€%sâ€"
msgid "fmt"
msgstr "fmt"
@@ -1340,6 +1383,12 @@ msgstr "läs .gitattributes i arbetskatalogen"
msgid "report archived files on stderr"
msgstr "rapportera arkiverade filer på standard fel"
+msgid "time"
+msgstr "tid"
+
+msgid "set modification time of archive entries"
+msgstr "välj modifieringstid för arkivposter"
+
msgid "set compression level"
msgstr "välj komprimeringsgrad"
@@ -1363,23 +1412,34 @@ msgstr "Oväntad flagga --remote"
#, c-format
msgid "the option '%s' requires '%s'"
-msgstr "flaggan \"%s\" kräver \"%s\""
+msgstr "flaggan â€%s†kräver â€%sâ€"
msgid "Unexpected option --output"
msgstr "Oväntad flagga --output"
#, c-format
+msgid "extra command line parameter '%s'"
+msgstr "falsk konfigureringsparameter: â€%sâ€"
+
+#, c-format
msgid "Unknown archive format '%s'"
-msgstr "Okänt arkivformat \"%s\""
+msgstr "Okänt arkivformat â€%sâ€"
#, c-format
msgid "Argument not supported for format '%s': -%d"
-msgstr "Argumentet stöd inte för formatet \"%s\": -%d"
+msgstr "Argumentet stöd inte för formatet â€%sâ€: -%d"
#, c-format
msgid "%.*s is not a valid attribute name"
msgstr "%-*s är inte ett giltigt namn på attribut"
+msgid "unable to add additional attribute"
+msgstr "Kunde inte lägga till ytterligare attribut"
+
+#, c-format
+msgid "ignoring overly long attributes line %d"
+msgstr "ignorerar överlång attributrad %d"
+
#, c-format
msgid "%s not allowed: %s:%d"
msgstr "%s inte tillåtet: %s:%d"
@@ -1392,12 +1452,35 @@ msgstr ""
"Använd '\\!' för att inleda med ett utropstecken."
#, c-format
+msgid "cannot fstat gitattributes file '%s'"
+msgstr "kan inte utföra fstat pÃ¥ gitattributes-filen â€%sâ€"
+
+#, c-format
+msgid "ignoring overly large gitattributes file '%s'"
+msgstr "ignorerar allt för stor gitattributes-fil â€%sâ€"
+
+#, c-format
+msgid "ignoring overly large gitattributes blob '%s'"
+msgstr "ignorerar allt för stor gitattributes-objekt â€%sâ€"
+
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "felaktig --attr-source eller GIT_ATTR_SOURCE"
+
+#, c-format
+msgid "unable to stat '%s'"
+msgstr "kan inte ta status pÃ¥ â€%sâ€"
+
+#, c-format
+msgid "unable to read %s"
+msgstr "kunde inte läsa %s"
+
+#, c-format
msgid "Badly quoted content in file '%s': %s"
-msgstr "Felaktigt citerat innehåll i filen \"%s\": %s"
+msgstr "Felaktigt citerat innehÃ¥ll i filen â€%sâ€: %s"
#, c-format
msgid "We cannot bisect more!\n"
-msgstr "Det finns inte mer att göra \"bisect\" på!\n"
+msgstr "Det finns inte mer att göra â€bisect†pÃ¥!\n"
#, c-format
msgid "Not a valid commit name %s"
@@ -1425,7 +1508,7 @@ msgid ""
"This means the first '%s' commit is between %s and [%s].\n"
msgstr ""
"Sammanslagningsbasen %s är %s.\n"
-"Det betyder att den första \"%s\" incheckningen är mellan %s och [%s].\n"
+"Det betyder att den första â€%s†incheckningen är mellan %s och [%s].\n"
#, c-format
msgid ""
@@ -1458,11 +1541,11 @@ msgstr "en %s-revision behövs"
#, c-format
msgid "could not create file '%s'"
-msgstr "kunde inte skapa filen \"%s\""
+msgstr "kunde inte skapa filen â€%sâ€"
#, c-format
msgid "could not read file '%s'"
-msgstr "kunde inte läsa filen \"%s\""
+msgstr "kunde inte läsa filen â€%sâ€"
msgid "reading bisect refs failed"
msgstr "misslyckades läsa bisect-referenser"
@@ -1497,9 +1580,6 @@ msgstr[1] "Bisect: %d revisioner kvar att testa efter denna %s\n"
msgid "--contents and --reverse do not blend well."
msgstr "--contents och --reverse fungerar inte så bra tillsammans."
-msgid "cannot use --contents with final commit object name"
-msgstr "kan inte använda --contents med namn på slutgiltigt incheckningsobjekt"
-
msgid "--reverse and --first-parent together require specified latest commit"
msgstr ""
"--reverse och --first-parent tillsammans kräver att du anger senaste "
@@ -1535,15 +1615,15 @@ msgstr "ställer inte in grenen %s som sin egen uppströmsgren"
#, c-format
msgid "branch '%s' set up to track '%s' by rebasing."
-msgstr "grenen \"%s\" inställd på att spåra \"%s\" genom ombasering."
+msgstr "grenen â€%s†inställd pÃ¥ att spÃ¥ra â€%s†genom ombasering."
#, c-format
msgid "branch '%s' set up to track '%s'."
-msgstr "grenen \"%s\" inställd på att spåra \"%s\"."
+msgstr "grenen â€%s†inställd pÃ¥ att spÃ¥ra â€%sâ€."
#, c-format
msgid "branch '%s' set up to track:"
-msgstr "grenen \"%s\" inställd på att spåra:"
+msgstr "grenen â€%s†inställd pÃ¥ att spÃ¥ra:"
msgid "unable to write upstream branch configuration"
msgstr "kan inte skriva inställningar för uppströmsgren"
@@ -1559,17 +1639,17 @@ msgstr ""
#, c-format
msgid "asked to inherit tracking from '%s', but no remote is set"
-msgstr "bad om att ärva spårning från \"%s\", men ingen fjärr är vald"
+msgstr "bad om att ärva spÃ¥rning frÃ¥n â€%sâ€, men ingen fjärr är vald"
#, c-format
msgid "asked to inherit tracking from '%s', but no merge configuration is set"
msgstr ""
-"bad om att ärva spårning från \"%s\", men ingen sammanslagningsinställning "
-"är vald"
+"bad om att ärva spÃ¥rning frÃ¥n â€%sâ€, men ingen sammanslagningsinställning är "
+"vald"
#, c-format
msgid "not tracking: ambiguous information for ref '%s'"
-msgstr "spårar inte: tvetydig information för referensen \"%s\""
+msgstr "spÃ¥rar inte: tvetydig information för referensen â€%sâ€"
#. #-#-#-#-# branch.c.po #-#-#-#-#
#. TRANSLATORS: This is a line listing a remote with duplicate
@@ -1601,7 +1681,7 @@ msgid ""
"tracking namespaces."
msgstr ""
"Flera fjärrars hämtnings-referensspecifikationer motsvarar fjärr-\n"
-"spårningsreferensen \"%s\":\n"
+"spÃ¥rningsreferensen â€%sâ€:\n"
"%s\n"
"Detta är vanligtvis ett fel i konfigurationen.\n"
"\n"
@@ -1611,25 +1691,26 @@ msgstr ""
#, c-format
msgid "'%s' is not a valid branch name"
-msgstr "\"%s\" är inte ett giltigt grennamn"
+msgstr "â€%s†är inte ett giltigt grennamn"
#, c-format
msgid "a branch named '%s' already exists"
-msgstr "det finns redan en gren som heter \"%s\""
+msgstr "det finns redan en gren som heter â€%sâ€"
#, c-format
-msgid "cannot force update the branch '%s' checked out at '%s'"
+msgid "cannot force update the branch '%s' used by worktree at '%s'"
msgstr ""
-"kan inte tvinga uppdatering av grenen \"%s\" som är utcheckad på \"%s\""
+"kan inte tvinga uppdatering av grenen â€%s†som används av arbetskatalogen pÃ¥ "
+"â€%sâ€"
#, c-format
msgid "cannot set up tracking information; starting point '%s' is not a branch"
msgstr ""
-"kan inte ställa in spårningsinformation; startpunkten \"%s\" är inte en gren"
+"kan inte ställa in spÃ¥rningsinformation; startpunkten â€%s†är inte en gren"
#, c-format
msgid "the requested upstream branch '%s' does not exist"
-msgstr "den efterfrågade uppströmsgrenen \"%s\" finns inte"
+msgstr "den efterfrÃ¥gade uppströmsgrenen â€%s†finns inte"
msgid ""
"\n"
@@ -1643,89 +1724,78 @@ msgid ""
msgstr ""
"\n"
"Om du har tänkt basera ditt arbete på en uppströmsgren\n"
-"som redan finns på fjärren kan du behöva köra \"git fetch\"\n"
+"som redan finns pÃ¥ fjärren kan du behöva köra â€git fetchâ€\n"
"för att hämta den.\n"
"\n"
"Om du har tänkt sända in en ny lokal gren som ska\n"
-"spåra dess fjärrmotsvarighet kan du använda \"git push -u\"\n"
+"spÃ¥ra dess fjärrmotsvarighet kan du använda â€git push -uâ€\n"
"för att ställa in uppströmskonfigurationen när du sänder in."
#, c-format
msgid "not a valid object name: '%s'"
-msgstr "objektnamnet är inte giltigt: \"%s\""
+msgstr "objektnamnet är inte giltigt: â€%sâ€"
#, c-format
msgid "ambiguous object name: '%s'"
-msgstr "objektnamnet är tvetydigt: \"%s\""
+msgstr "objektnamnet är tvetydigt: â€%sâ€"
#, c-format
msgid "not a valid branch point: '%s'"
-msgstr "avgreningspunkten är inte giltig: \"%s\""
+msgstr "avgreningspunkten är inte giltig: â€%sâ€"
#, c-format
msgid "submodule '%s': unable to find submodule"
-msgstr "undermodulen \"%s\": kan inte hitta undermodulen"
+msgstr "undermodulen â€%sâ€: kan inte hitta undermodulen"
#, c-format
msgid ""
-"You may try updating the submodules using 'git checkout %s && git submodule "
-"update --init'"
+"You may try updating the submodules using 'git checkout --no-recurse-"
+"submodules %s && git submodule update --init'"
msgstr ""
-"Du kan försöka uppdatera undermodulerna med \"git checkout %s && git "
-"submodule update --init\""
+"Du kan försöka uppdatera undermodulerna med â€git checkout --no-recurse-"
+"submodules %s && git submodule update --initâ€"
#, c-format
msgid "submodule '%s': cannot create branch '%s'"
-msgstr "undermodulen \"%s\": kan inte skapa grenen \"%s\""
-
-#, c-format
-msgid "'%s' is already checked out at '%s'"
-msgstr "\"%s\" är redan utcheckad på \"%s\""
+msgstr "undermodulen â€%sâ€: kan inte skapa grenen â€%sâ€"
#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "HEAD i arbetskatalogen %s har inte uppdaterats"
+msgid "'%s' is already used by worktree at '%s'"
+msgstr "â€%s†används redan av arbetskatalogen â€%sâ€"
msgid "git add [<options>] [--] <pathspec>..."
msgstr "git add [<flaggor>] [--] <sökväg>..."
#, c-format
msgid "cannot chmod %cx '%s'"
-msgstr "kan inte utföra chmod %cx \"%s\""
-
-#, c-format
-msgid "unexpected diff status %c"
-msgstr "diff-status %c förväntades inte"
-
-msgid "updating files failed"
-msgstr "misslyckades uppdatera filer"
-
-#, c-format
-msgid "remove '%s'\n"
-msgstr "ta bort \"%s\"\n"
+msgstr "kan inte utföra chmod %cx â€%sâ€"
msgid "Unstaged changes after refreshing the index:"
msgstr "Oköade ändringar efter att ha uppdaterat indexet:"
-msgid "Could not read the index"
-msgstr "Kunde inte läsa indexet"
+msgid ""
+"the add.interactive.useBuiltin setting has been removed!\n"
+"See its entry in 'git help config' for details."
+msgstr ""
+"inställningen add.interactive.useBuiltin har tagits bort!\n"
+"Se dess post i â€git help config†för detaljer."
-msgid "Could not write patch"
-msgstr "Kunde inte skriva patch"
+msgid "could not read the index"
+msgstr "kunde inte läsa indexet"
msgid "editing patch failed"
msgstr "redigering av patch misslyckades"
#, c-format
-msgid "Could not stat '%s'"
-msgstr "Kunde inte ta status på \"%s\""
+msgid "could not stat '%s'"
+msgstr "kunde inte ta status pÃ¥ â€%sâ€"
-msgid "Empty patch. Aborted."
-msgstr "Tom patch. Avbryter."
+msgid "empty patch. aborted"
+msgstr "tom patch. avbryter"
#, c-format
-msgid "Could not apply '%s'"
-msgstr "Kunde inte tillämpa \"%s\""
+msgid "could not apply '%s'"
+msgstr "kunde inte tillämpa â€%sâ€"
msgid "The following paths are ignored by one of your .gitignore files:\n"
msgstr "Följande sökvägar ignoreras av en av dina .gitignore-filer:\n"
@@ -1773,7 +1843,7 @@ msgid "check if - even missing - files are ignored in dry run"
msgstr "se om - även saknade - filer ignoreras i testkörning"
msgid "allow updating entries outside of the sparse-checkout cone"
-msgstr "tillåt uppdatera poster utanför området angivet i \"sparse-checkout\""
+msgstr "tillÃ¥t uppdatera poster utanför omrÃ¥det angivet i â€sparse-checkoutâ€"
msgid "override the executable bit of the listed files"
msgstr "överstyr exekveringsbiten för angivna filer"
@@ -1809,7 +1879,7 @@ msgstr ""
"\n"
"\tgit rm --cached %s\n"
"\n"
-"Se \"git help submodule\" för ytterligare information."
+"Se â€git help submodule†för ytterligare information."
#, c-format
msgid "adding embedded git repository: %s"
@@ -1822,18 +1892,18 @@ msgid ""
msgstr ""
"Använd -f om du verkligen vill lägga till dem.\n"
"Slå av detta meddelande med\n"
-"\"git config advice.addIgnoredFile false\""
+"â€git config advice.addIgnoredFile falseâ€"
msgid "adding files failed"
msgstr "misslyckades lägga till filer"
#, c-format
msgid "--chmod param '%s' must be either -x or +x"
-msgstr "\"--chmod\"-parametern \"%s\" måste antingen vara -x eller +x"
+msgstr "â€--chmodâ€-parametern â€%s†mÃ¥ste antingen vara -x eller +x"
#, c-format
msgid "'%s' and pathspec arguments cannot be used together"
-msgstr "\"%s\" kan inte användas tillsammans med sökvägsangivelser"
+msgstr "â€%s†kan inte användas tillsammans med sökvägsangivelser"
#, c-format
msgid "Nothing specified, nothing added.\n"
@@ -1844,24 +1914,27 @@ msgid ""
"Turn this message off by running\n"
"\"git config advice.addEmptyPathspec false\""
msgstr ""
-"Tänkte du kanske säga \"git add .\"?\n"
+"Tänkte du kanske säga â€git add .â€?\n"
"Slå av detta meddelande genom att köra\n"
-"\"git config advice.addEmptyPathspec false\""
+"â€git config advice.addEmptyPathspec falseâ€"
msgid "index file corrupt"
msgstr "indexfilen trasig"
+msgid "unable to write new index file"
+msgstr "kunde inte skriva ny indexfil"
+
#, c-format
msgid "bad action '%s' for '%s'"
-msgstr "felaktig funktion \"%s\" för \"%s\""
+msgstr "felaktig funktion â€%s†för â€%sâ€"
#, c-format
msgid "invalid value for '%s': '%s'"
-msgstr "felaktigt värde för \"%s\": \"%s\""
+msgstr "felaktigt värde för â€%sâ€: â€%sâ€"
#, c-format
msgid "could not read '%s'"
-msgstr "kunde inte läsa \"%s\""
+msgstr "kunde inte läsa â€%sâ€"
msgid "could not parse author script"
msgstr "kunde inte tolka författarskript"
@@ -1872,30 +1945,30 @@ msgstr "kunde inte tolka %s"
#, c-format
msgid "'%s' was deleted by the applypatch-msg hook"
-msgstr "\"%s\" togs bort av kroken applypatch-msg"
+msgstr "â€%s†togs bort av kroken applypatch-msg"
#, c-format
msgid "Malformed input line: '%s'."
-msgstr "Felaktig indatarad: \"%s\"."
+msgstr "Felaktig indatarad: â€%sâ€."
#, c-format
msgid "Failed to copy notes from '%s' to '%s'"
-msgstr "Misslyckades kopiera anteckningar från \"%s\" till \"%s\""
+msgstr "Misslyckades kopiera anteckningar frÃ¥n â€%s†till â€%sâ€"
msgid "fseek failed"
-msgstr "\"fseek\" misslyckades"
+msgstr "â€fseek†misslyckades"
#, c-format
msgid "could not open '%s' for reading"
-msgstr "kunde inte öppna \"%s\" för läsning"
+msgstr "kunde inte öppna â€%s†för läsning"
#, c-format
msgid "could not open '%s' for writing"
-msgstr "kunde inte öppna \"%s\" för skrivning"
+msgstr "kunde inte öppna â€%s†för skrivning"
#, c-format
msgid "could not parse patch '%s'"
-msgstr "kunde inte tolka patchen \"%s\""
+msgstr "kunde inte tolka patchen â€%sâ€"
msgid "Only one StGIT patch series can be applied at once"
msgstr "Endast en StGIT-patchserie kan tillämpas åt gången"
@@ -1904,7 +1977,7 @@ msgid "invalid timestamp"
msgstr "ogiltig tidsstämpel"
msgid "invalid Date line"
-msgstr "ogiltig \"Date\"-rad"
+msgstr "ogiltig â€Dateâ€-rad"
msgid "invalid timezone offset"
msgstr "ogiltig tidszons-offset"
@@ -1914,29 +1987,29 @@ msgstr "Misslyckades detektera patchformat."
#, c-format
msgid "failed to create directory '%s'"
-msgstr "misslyckades skapa katalogen \"%s\""
+msgstr "misslyckades skapa katalogen â€%sâ€"
msgid "Failed to split patches."
msgstr "Misslyckades dela patchar."
#, c-format
msgid "When you have resolved this problem, run \"%s --continue\"."
-msgstr "När du har löst problemet, kör \"%s --continue\"."
+msgstr "När du har löst problemet, kör â€%s --continueâ€."
#, c-format
msgid "If you prefer to skip this patch, run \"%s --skip\" instead."
-msgstr "Om du hellre vill hoppa över patchen, kör \"%s --skip\" i stället."
+msgstr "Om du hellre vill hoppa över patchen, kör â€%s --skip†i stället."
#, c-format
msgid "To record the empty patch as an empty commit, run \"%s --allow-empty\"."
msgstr ""
-"För att registrera den tomma patchen som en tom incheckning, kör \"%s --"
-"allow-empty\"."
+"För att registrera den tomma patchen som en tom incheckning, kör â€%s --allow-"
+"emptyâ€."
#, c-format
msgid "To restore the original branch and stop patching, run \"%s --abort\"."
msgstr ""
-"För att återgå till ursprunglig gren och sluta patcha, kör \"%s --abort\"."
+"För att Ã¥tergÃ¥ till ursprunglig gren och sluta patcha, kör â€%s --abortâ€."
msgid "Patch sent with format=flowed; space at the end of lines might be lost."
msgstr ""
@@ -1944,7 +2017,7 @@ msgstr ""
#, c-format
msgid "missing author line in commit %s"
-msgstr "saknad \"author\"-rad i incheckningen %s"
+msgstr "saknad â€authorâ€-rad i incheckningen %s"
#, c-format
msgid "invalid ident line: %.*s"
@@ -2031,8 +2104,7 @@ msgstr "Patch misslyckades på %s %.*s"
msgid "Use 'git am --show-current-patch=diff' to see the failed patch"
msgstr ""
-"Använd \"git am --show-current-patch=diff\" för att se patchen som "
-"misslyckades"
+"Använd â€git am --show-current-patch=diff†för att se patchen som misslyckades"
msgid "No changes - recorded it as an empty commit."
msgstr "Inga ändringar - sparat som en tom incheckning."
@@ -2042,7 +2114,7 @@ msgid ""
"If there is nothing left to stage, chances are that something else\n"
"already introduced the same changes; you might want to skip this patch."
msgstr ""
-"Inga ändringar - glömde du att använda \"git add\"?\n"
+"Inga ändringar - glömde du att använda â€git addâ€?\n"
"Om det inte är något kvar att köa kan det hända att något annat redan\n"
"introducerat samma ändringar; kanske du bör hoppa över patchen."
@@ -2053,16 +2125,13 @@ msgid ""
"You might run `git rm` on a file to accept \"deleted by them\" for it."
msgstr ""
"Du har fortfarande ej sammanslagna sökvägar i indexet.\n"
-"Du bör köra \"git add\" på filer med lösta konflikter för att ange dem som "
+"Du bör köra â€git add†pÃ¥ filer med lösta konflikter för att ange dem som "
"lösta.\n"
-"Du kan köra \"git rm\" för att godta \"borttagen av dem\" för den."
-
-msgid "unable to write new index file"
-msgstr "kunde inte skriva ny indexfil"
+"Du kan köra â€git rm†för att godta â€borttagen av dem†för den."
#, c-format
msgid "Could not parse object '%s'."
-msgstr "Kan inte tolka objektet \"%s\"."
+msgstr "Kan inte tolka objektet â€%sâ€."
msgid "failed to clean index"
msgstr "misslyckades städa upp indexet"
@@ -2071,16 +2140,12 @@ msgid ""
"You seem to have moved HEAD since the last 'am' failure.\n"
"Not rewinding to ORIG_HEAD"
msgstr ""
-"Du verkar ha flyttat HEAD sedan \"am\" sist misslyckades.\n"
+"Du verkar ha flyttat HEAD sedan â€am†sist misslyckades.\n"
"Återställer inte till ORIG_HEAD"
#, c-format
msgid "failed to read '%s'"
-msgstr "misslyckades läsa \"%s\""
-
-#, c-format
-msgid "options '%s=%s' and '%s=%s' cannot be used together"
-msgstr "flaggorna \"%s=%s\" och \"%s=%s\" kan inte användas samtidigt"
+msgstr "misslyckades läsa â€%sâ€"
msgid "git am [<options>] [(<mbox> | <Maildir>)...]"
msgstr "git am [<flaggor>] [(<mbox> | <Maildir>)...]"
@@ -2091,6 +2156,9 @@ msgstr "git am [<flaggor>] (--continue | --skip | --abort)"
msgid "run interactively"
msgstr "kör interaktivt"
+msgid "bypass pre-applypatch and applypatch-msg hooks"
+msgstr "förbigå pre-applypatch- och applypatch-msg-krokar"
+
msgid "historical option -- no-op"
msgstr "historisk flagga -- no-op"
@@ -2101,7 +2169,7 @@ msgid "be quiet"
msgstr "var tyst"
msgid "add a Signed-off-by trailer to the commit message"
-msgstr "lägg till \"Signed-off-by\"-släprad i incheckningsmeddelandet"
+msgstr "lägg till â€Signed-off-byâ€-släprad i incheckningsmeddelandet"
msgid "recode into utf8 (default)"
msgstr "koda om till utf8 (standard)"
@@ -2118,9 +2186,6 @@ msgstr "sänd flaggan -m till git-mailinfo"
msgid "pass --keep-cr flag to git-mailsplit for mbox format"
msgstr "sänd flaggan --keep-cr till git-mailsplit för mbox-formatet"
-msgid "do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"
-msgstr "sänd inte flaggan --keep-cr till git-mailsplit oberoende av am.keepcr"
-
msgid "strip everything before a scissors line"
msgstr "ta bort allting före en saxlinje"
@@ -2201,7 +2266,7 @@ msgid ""
"Use \"git am --abort\" to remove it."
msgstr ""
"Kvarbliven katalog %s hittades.\n"
-"Använd \"git am --abort\" för att ta bort den."
+"Använd â€git am --abort†för att ta bort den."
msgid "Resolve operation not in progress, we are not resuming."
msgstr "Lösningsoperation pågår inte, vi återupptar inte."
@@ -2231,56 +2296,51 @@ msgstr "git archive: protokollfel"
msgid "git archive: expected a flush"
msgstr "git archive: förväntade en tömning (flush)"
-msgid "git bisect--helper --bisect-reset [<commit>]"
-msgstr "git bisect--helper --bisect-reset [<incheckning>]"
-
msgid ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<term> --term-{old,good}"
-"=<term>] [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] "
-"[<paths>...]"
+"git bisect start [--term-(new|bad)=<term> --term-(old|good)=<term>] [--no-"
+"checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]"
msgstr ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<term> --term-{old,good}"
-"=<term>] [--no-checkout] [--first-parent] [<dålig> [<bra>...]] [--] "
-"[<sökvägar>...]"
+"git bisect start [--term-(new|bad)=<term> --term-(old|good)=<term>] [--no-"
+"checkout] [--first-parent] [<dålig> [<bra>...]] [--] [<sökvägar>...]"
-msgid "git bisect--helper --bisect-state (bad|new) [<rev>]"
-msgstr "git bisect--helper --bisect-state (bad|new) [<incheckning>]"
+msgid "git bisect (good|bad) [<rev>...]"
+msgstr "git bisect (good|bad) [<incheckning>...]"
-msgid "git bisect--helper --bisect-state (good|old) [<rev>...]"
-msgstr "git bisect--helper --bisect-state (good|old) [<incheckning>...]"
+msgid "git bisect skip [(<rev>|<range>)...]"
+msgstr "git bisect skip [(<incheckning>|<intervall>)...]"
-msgid "git bisect--helper --bisect-replay <filename>"
-msgstr "git bisect--helper --bisect-replay <filnamn>"
+msgid "git bisect reset [<commit>]"
+msgstr "git bisect reset [<incheckning>]"
-msgid "git bisect--helper --bisect-skip [(<rev>|<range>)...]"
-msgstr "git bisect--helper --bisect-skip [(<incheckning>|<intervall>)...]"
+msgid "git bisect replay <logfile>"
+msgstr "git bisect replay <loggfil>"
-msgid "git bisect--helper --bisect-run <cmd>..."
-msgstr "git bisect--helper --bisect-run <kommando>..."
+msgid "git bisect run <cmd> [<arg>...]"
+msgstr "git bisect run <kommando> [<argument>]..."
#, c-format
msgid "cannot open file '%s' in mode '%s'"
-msgstr "kan inte kopiera filen \"%s\" i läget \"%s\""
+msgstr "kan inte kopiera filen â€%s†i läget â€%sâ€"
#, c-format
msgid "could not write to file '%s'"
-msgstr "kunde inte skriva till filen \"%s\""
+msgstr "kunde inte skriva till filen â€%sâ€"
#, c-format
msgid "cannot open file '%s' for reading"
-msgstr "kan inte öppna filen \"%s\" för läsning"
+msgstr "kan inte öppna filen â€%s†för läsning"
#, c-format
msgid "'%s' is not a valid term"
-msgstr "\"%s\" är inte en giltig term"
+msgstr "â€%s†är inte en giltig term"
#, c-format
msgid "can't use the builtin command '%s' as a term"
-msgstr "kan inte använda det inbyggda kommandot \"%s\" som term"
+msgstr "kan inte använda det inbyggda kommandot â€%s†som term"
#, c-format
msgid "can't change the meaning of the term '%s'"
-msgstr "kan inte ändra betydelsen av termen \"%s\""
+msgstr "kan inte ändra betydelsen av termen â€%sâ€"
msgid "please use two different terms"
msgstr "termerna måste vara olika"
@@ -2291,14 +2351,14 @@ msgstr "Vi utför ingen bisect för tillfället.\n"
#, c-format
msgid "'%s' is not a valid commit"
-msgstr "\"%s\" är inte en giltig incheckning"
+msgstr "â€%s†är inte en giltig incheckning"
#, c-format
msgid ""
"could not check out original HEAD '%s'. Try 'git bisect reset <commit>'."
msgstr ""
-"Kunde inte checka ut original-HEAD \"%s\". Försök \"git bisect reset "
-"<incheckning>\"."
+"Kunde inte checka ut original-HEAD â€%sâ€. Försök â€git bisect reset "
+"<incheckning>â€."
#, c-format
msgid "Bad bisect_write argument: %s"
@@ -2306,15 +2366,15 @@ msgstr "Felaktigt argument till bisect_write: %s"
#, c-format
msgid "couldn't get the oid of the rev '%s'"
-msgstr "kan inte läsa oid för referensen \"%s\""
+msgstr "kan inte läsa oid för referensen â€%sâ€"
#, c-format
msgid "couldn't open the file '%s'"
-msgstr "kunde inte öppna filen \"%s\""
+msgstr "kunde inte öppna filen â€%sâ€"
#, c-format
msgid "Invalid command: you're currently in a %s/%s bisect"
-msgstr "Ogiltigt kommando: du utför just nu en \"bisect\" med %s/%s."
+msgstr "Ogiltigt kommando: du utför just nu en â€bisect†med %s/%s."
#, c-format
msgid ""
@@ -2322,7 +2382,7 @@ msgid ""
"You can use \"git bisect %s\" and \"git bisect %s\" for that."
msgstr ""
"Du måste ange åtminstone en %s och en %s version.\n"
-"(Du kan använda \"git bisect %s\" och \"git bisect %s\" för detta.)"
+"(Du kan använda â€git bisect %s†och â€git bisect %s†för detta.)"
#, c-format
msgid ""
@@ -2330,9 +2390,9 @@ msgid ""
"You then need to give me at least one %s and %s revision.\n"
"You can use \"git bisect %s\" and \"git bisect %s\" for that."
msgstr ""
-"Du måste starta med \"git bisect start\".\n"
+"Du mÃ¥ste starta med â€git bisect startâ€.\n"
"Du måste sedan ange åtminstone en %s och en %s version.\n"
-"(Du kan använda \"git bisect %s\" och \"git bisect %s\" för detta.)"
+"(Du kan använda â€git bisect %s†och â€git bisect %s†för detta.)"
#, c-format
msgid "bisecting only with a %s commit"
@@ -2373,7 +2433,7 @@ msgid ""
"invalid argument %s for 'git bisect terms'.\n"
"Supported options are: --term-good|--term-old and --term-bad|--term-new."
msgstr ""
-"ogiltigt argument %s för \"git bisect terms\".\n"
+"ogiltigt argument %s för â€git bisect termsâ€.\n"
"Flaggor som stöds är: --term-good|--term-old och --term-bad|--term-new."
msgid "revision walk setup failed\n"
@@ -2381,10 +2441,10 @@ msgstr "misslyckades starta revisionstraversering\n"
#, c-format
msgid "could not open '%s' for appending"
-msgstr "kunde inte öppna \"%s\" för tillägg"
+msgstr "kunde inte öppna â€%s†för tillägg"
msgid "'' is not a valid term"
-msgstr "\"\" är inte en giltig term"
+msgstr "â€â€ är inte en giltig term"
#, c-format
msgid "unrecognized option: '%s'"
@@ -2392,29 +2452,24 @@ msgstr "okänd flagga: %s"
#, c-format
msgid "'%s' does not appear to be a valid revision"
-msgstr "\"%s\" verkar inte vara en giltig revision"
+msgstr "â€%s†verkar inte vara en giltig revision"
msgid "bad HEAD - I need a HEAD"
msgstr "felaktigt HEAD - Jag behöver ett HEAD"
#, c-format
msgid "checking out '%s' failed. Try 'git bisect start <valid-branch>'."
-msgstr ""
-"misslyckades checka ut \"%s\". Försök \"git bisect reset <giltig_gren>\"."
-
-# cogito-relaterat
-msgid "won't bisect on cg-seek'ed tree"
-msgstr "kör inte \"bisect\" på träd där \"cg-seek\" använts"
+msgstr "misslyckades checka ut â€%sâ€. Försök â€git bisect reset <giltig_gren>â€."
msgid "bad HEAD - strange symbolic ref"
msgstr "felaktigt HEAD - konstig symbolisk referens"
#, c-format
msgid "invalid ref: '%s'"
-msgstr "ogiltig referens: \"%s\""
+msgstr "ogiltig referens: â€%sâ€"
msgid "You need to start by \"git bisect start\"\n"
-msgstr "Du måste starta med \"git bisect start\"\n"
+msgstr "Du mÃ¥ste starta med â€git bisect startâ€\n"
#. TRANSLATORS: Make sure to include [Y] and [n] in your
#. translation. The program will only accept English input
@@ -2424,11 +2479,11 @@ msgid "Do you want me to do it for you [Y/n]? "
msgstr "Vill du att jag ska göra det åt dig [Y=ja/N=nej]? "
msgid "Please call `--bisect-state` with at least one argument"
-msgstr "Anropa \"--bisect-state\" med minst ett argument."
+msgstr "Anropa â€--bisect-state†med minst ett argument."
#, c-format
msgid "'git bisect %s' can take only one argument."
-msgstr "\"git bisect %s\" kan bara ta ett argument."
+msgstr "â€git bisect %s†kan bara ta ett argument."
#, c-format
msgid "Bad rev input: %s"
@@ -2443,11 +2498,11 @@ msgstr "Vi utför ingen bisect för tillfället."
#, c-format
msgid "'%s'?? what are you talking about?"
-msgstr "\"%s\"?? vad menar du?"
+msgstr "â€%sâ€?? vad menar du?"
#, c-format
msgid "cannot read file '%s' for replaying"
-msgstr "kan inte läsa filen \"%s\" för återuppspelning"
+msgstr "kan inte läsa filen â€%s†för Ã¥teruppspelning"
#, c-format
msgid "running %s\n"
@@ -2457,95 +2512,67 @@ msgid "bisect run failed: no command provided."
msgstr "bisect-körning misslyckades: inget kommando gavs."
#, c-format
-msgid "unable to verify '%s' on good revision"
-msgstr "kan inte bekräfta \"%s\" på bra revision"
+msgid "unable to verify %s on good revision"
+msgstr "kan inte bekräfta %s på bra revision"
#, c-format
msgid "bogus exit code %d for good revision"
msgstr "falsk slutkod %d för bra revision"
#, c-format
-msgid "bisect run failed: exit code %d from '%s' is < 0 or >= 128"
-msgstr ""
-"\"bisect\"-körningen misslyckades: felkod %d från \"%s\" är < 0 eller >= 128"
+msgid "bisect run failed: exit code %d from %s is < 0 or >= 128"
+msgstr "â€bisectâ€-körningen misslyckades: felkod %d frÃ¥n %s är < 0 eller >= 128"
#, c-format
msgid "cannot open file '%s' for writing"
-msgstr "kan inte öppna \"%s\" för skrivning"
+msgstr "kan inte öppna â€%s†för skrivning"
msgid "bisect run cannot continue any more"
-msgstr "\"bisect\"-körningen kan inte fortsätta längre"
+msgstr "â€bisectâ€-körningen kan inte fortsätta längre"
-#, c-format
msgid "bisect run success"
-msgstr "\"bisect\"-körningen lyckades"
+msgstr "â€bisectâ€-körningen lyckades"
-#, c-format
msgid "bisect found first bad commit"
msgstr "bisect hittade första trasiga incheckning"
#, c-format
-msgid ""
-"bisect run failed: 'git bisect--helper --bisect-state %s' exited with error "
-"code %d"
+msgid "bisect run failed: 'git bisect %s' exited with error code %d"
msgstr ""
-"\"bisect\"-körningen misslyckades: \"git bisect--helper --bisect-state %s\" "
-"avslutades med felkoden %d"
-
-msgid "reset the bisection state"
-msgstr "återställ bisect-tillstånd"
-
-msgid "check whether bad or good terms exist"
-msgstr "se efter om termer för rätt och fel finns"
-
-msgid "print out the bisect terms"
-msgstr "skriv ut termer för bisect"
-
-msgid "start the bisect session"
-msgstr "påbörja bisect-körningen"
-
-msgid "find the next bisection commit"
-msgstr "hitta nästa incheckning i bisect"
+"â€bisectâ€-körningen misslyckades: â€git bisect %s†avslutades med felkoden %d"
-msgid "mark the state of ref (or refs)"
-msgstr "markera tillståndet för en eller flera referenser"
-
-msgid "list the bisection steps so far"
-msgstr "lista \"bisect\"-stegen som utförts så långt"
-
-msgid "replay the bisection process from the given file"
-msgstr "spela upp \"bisect\"-processen från angiven fil"
-
-msgid "skip some commits for checkout"
-msgstr "hoppa över ett par incheckningar"
-
-msgid "visualize the bisection"
-msgstr "visualisera \"bisect\"-körningen"
-
-msgid "use <cmd>... to automatically bisect"
-msgstr "använd <kommando>... för att utföra \"bisect\" automatiskt"
+#, c-format
+msgid "'%s' requires either no argument or a commit"
+msgstr "â€%s†kräver antingen inget argument eller en incheckning"
-msgid "no log for BISECT_WRITE"
-msgstr "ingen logg för BISECT_WRITE"
+#, c-format
+msgid "'%s' requires 0 or 1 argument"
+msgstr "â€%s†kräver noll eller ett argument"
-msgid "--bisect-reset requires either no argument or a commit"
-msgstr "--bisect-reset kräver antingen inget argument eller en incheckning"
+#, c-format
+msgid "'%s' requires 0 arguments"
+msgstr "â€%s†kräver noll argument"
-msgid "--bisect-terms requires 0 or 1 argument"
-msgstr "--bisect-terms kräver noll eller ett argument"
+msgid "no logfile given"
+msgstr "ingen loggfil angiven"
-msgid "--bisect-next requires 0 arguments"
-msgstr "--bisect-next kräver 0 argument"
+#, c-format
+msgid "'%s' failed: no command provided."
+msgstr "â€%s†misslyckades: inget kommando gavs."
-msgid "--bisect-log requires 0 arguments"
-msgstr "--bisect-log kräver 0 argument"
+msgid "need a command"
+msgstr "behöver ett kommando"
-msgid "no logfile given"
-msgstr "ingen loggfil angiven"
+#, c-format
+msgid "unknown command: '%s'"
+msgstr "okänt kommando: â€%sâ€"
msgid "git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"
msgstr "git blame [<flaggor>] [<rev-flaggor>] [<rev>] [--] <fil>"
+msgid "git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"
+msgstr "git annotate [<flaggor>] [<rev-flaggor>] [<rev>] [--] <fil>"
+
msgid "<rev-opts> are documented in git-rev-list(1)"
msgstr "<rev-flaggor> dokumenteras i git-rev-list(1)"
@@ -2567,7 +2594,7 @@ msgid "do not show object names of boundary commits (Default: off)"
msgstr "visa inte objektnamn för gränsincheckningar (Standard: av)"
msgid "do not treat root commits as boundaries (Default: off)"
-msgstr "vehandla inte rotincheckningar som gränser (Standard: av)"
+msgstr "behandla inte rotincheckningar som gränser (Standard: av)"
msgid "show work cost statistics"
msgstr "visa statistik över arbetskostnad"
@@ -2701,51 +2728,56 @@ msgstr "git branch [<flaggor>] [-r | -a] [--format]"
#, c-format
msgid ""
"deleting branch '%s' that has been merged to\n"
-" '%s', but not yet merged to HEAD."
+" '%s', but not yet merged to HEAD"
msgstr ""
-"tar bort grenen \"%s\" som har slagits ihop med\n"
-" \"%s\", men ännu inte slagits ihop med HEAD."
+"tar bort grenen â€%s†som har slagits ihop med\n"
+" â€%sâ€, men ännu inte slagits ihop med HEAD"
#, c-format
msgid ""
"not deleting branch '%s' that is not yet merged to\n"
-" '%s', even though it is merged to HEAD."
+" '%s', even though it is merged to HEAD"
msgstr ""
-"tar inte bort grenen \"%s\" som inte har slagits ihop med\n"
-" \"%s\", trots att den har slagits ihop med HEAD."
+"tar inte bort grenen â€%s†som inte har slagits ihop med\n"
+" â€%sâ€, trots att den har slagits ihop med HEAD"
#, c-format
-msgid "Couldn't look up commit object for '%s'"
-msgstr "Kunde inte slå upp incheckningsobjekt för \"%s\""
+msgid "couldn't look up commit object for '%s'"
+msgstr "kunde inte slÃ¥ upp incheckningsobjekt för â€%sâ€"
#, c-format
-msgid ""
-"The branch '%s' is not fully merged.\n"
-"If you are sure you want to delete it, run 'git branch -D %s'."
-msgstr ""
-"Grenen \"%s\" har inte slagits samman i sin helhet.\n"
-"Om du är säker på att du vill ta bort den, kör \"git branch -D %s\"."
+msgid "the branch '%s' is not fully merged"
+msgstr "grenen â€%s†har inte slagits samman i sin helhet"
+
+#, c-format
+msgid "If you are sure you want to delete it, run 'git branch -D %s'"
+msgstr "Om du är säker pÃ¥ att du vill ta bort den, kör â€git branch -D %sâ€"
-msgid "Update of config-file failed"
-msgstr "Misslyckades uppdatera konfigurationsfil"
+msgid "update of config-file failed"
+msgstr "misslyckades uppdatera konfigurationsfil"
msgid "cannot use -a with -d"
msgstr "kan inte ange -a med -d"
-msgid "Couldn't look up commit object for HEAD"
-msgstr "Kunde inte slå upp incheckningsobjekt för HEAD"
+#, c-format
+msgid "cannot delete branch '%s' used by worktree at '%s'"
+msgstr "kan inte ta bort grenen â€%s†som används av arbetskatalogen pÃ¥ â€%sâ€"
#, c-format
-msgid "Cannot delete branch '%s' checked out at '%s'"
-msgstr "Kan inte ta bort grenen \"%s\" som är utcheckad på \"%s\""
+msgid "remote-tracking branch '%s' not found"
+msgstr "fjärrspÃ¥rande grenen â€%s†hittades inte"
#, c-format
-msgid "remote-tracking branch '%s' not found."
-msgstr "fjärrspårande grenen \"%s\" hittades inte."
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"grenen â€%s†hittades inte.\n"
+"Glömde du --remote?"
#, c-format
-msgid "branch '%s' not found."
-msgstr "grenen \"%s\" hittades inte."
+msgid "branch '%s' not found"
+msgstr "grenen â€%s†hittades inte"
#, c-format
msgid "Deleted remote-tracking branch %s (was %s).\n"
@@ -2766,47 +2798,52 @@ msgid "HEAD (%s) points outside of refs/heads/"
msgstr "HEAD (%s) pekar utenför refs/heads/"
#, c-format
-msgid "Branch %s is being rebased at %s"
-msgstr "Grenen %s ombaseras på %s"
+msgid "branch %s is being rebased at %s"
+msgstr "grenen %s ombaseras på %s"
+
+#, c-format
+msgid "branch %s is being bisected at %s"
+msgstr "grenen %s är i en â€bisect†pÃ¥ %s"
#, c-format
-msgid "Branch %s is being bisected at %s"
-msgstr "Grenen %s är i en \"bisect\" på %s"
+msgid "HEAD of working tree %s is not updated"
+msgstr "HEAD i arbetskatalogen %s har inte uppdaterats"
-msgid "cannot copy the current branch while not on any."
-msgstr "kunde inte kopiera aktuell gren när du inte befinner dig på någon."
+#, c-format
+msgid "invalid branch name: '%s'"
+msgstr "gelaktigt namn pÃ¥ gren: â€%sâ€"
-msgid "cannot rename the current branch while not on any."
-msgstr ""
-"kunde inte byta namn på aktuell gren när du inte befinner dig på någon."
+#, c-format
+msgid "no commit on branch '%s' yet"
+msgstr "inga incheckningar pÃ¥ grenen â€%s†ännu"
#, c-format
-msgid "Invalid branch name: '%s'"
-msgstr "Felaktigt namn på gren: \"%s\""
+msgid "no branch named '%s'"
+msgstr "ingen gren vid namnet â€%sâ€"
-msgid "Branch rename failed"
-msgstr "Misslyckades byta namn på gren"
+msgid "branch rename failed"
+msgstr "misslyckades byta namn på gren"
-msgid "Branch copy failed"
-msgstr "Misslyckades kopiera gren"
+msgid "branch copy failed"
+msgstr "misslyckades kopiera gren"
#, c-format
-msgid "Created a copy of a misnamed branch '%s'"
-msgstr "Skapade kopia av felaktigt namngiven gren \"%s\""
+msgid "created a copy of a misnamed branch '%s'"
+msgstr "skapade kopia av felaktigt namngiven gren â€%sâ€"
#, c-format
-msgid "Renamed a misnamed branch '%s' away"
-msgstr "Bytte bort namn på en felaktigt namngiven gren \"%s\""
+msgid "renamed a misnamed branch '%s' away"
+msgstr "bytte bort namn pÃ¥ en felaktigt namngiven gren â€%sâ€"
#, c-format
-msgid "Branch renamed to %s, but HEAD is not updated!"
-msgstr "Grenen namnbytt till %s, men HEAD har inte uppdaterats!"
+msgid "branch renamed to %s, but HEAD is not updated"
+msgstr "grenen namnbytt till %s, men HEAD har inte uppdaterats"
-msgid "Branch is renamed, but update of config-file failed"
-msgstr "Grenen namnbytt, men misslyckades uppdatera konfigurationsfilen"
+msgid "branch is renamed, but update of config-file failed"
+msgstr "grenen namnbytt, men misslyckades uppdatera konfigurationsfilen"
-msgid "Branch is copied, but update of config-file failed"
-msgstr "Grenen kopierades, men misslyckades uppdatera konfigurationsfilen"
+msgid "branch is copied, but update of config-file failed"
+msgstr "grenen kopierades, men misslyckades uppdatera konfigurationsfilen"
#, c-format
msgid ""
@@ -2816,7 +2853,7 @@ msgid ""
msgstr ""
"Redigera beskrivningen för grenen\n"
" %s\n"
-"Rader som inleds med \"%c\" ignoreras.\n"
+"Rader som inleds med â€%c†ignoreras.\n"
msgid "Generic options"
msgstr "Allmänna flaggor"
@@ -2872,6 +2909,9 @@ msgstr "flytta/ta bort en gren och dess reflogg"
msgid "move/rename a branch, even if target exists"
msgstr "flytta/ta bort en gren, även om målet finns"
+msgid "do not output a newline after empty formatted refs"
+msgstr "skriv inte ut ett nyradstecken efter tomma formaterade referenser"
+
msgid "copy a branch and its reflog"
msgstr "kopiera en gren och dess reflogg"
@@ -2917,8 +2957,8 @@ msgstr "rekursera ner i undermoduler"
msgid "format to use for the output"
msgstr "format att använda för utdata"
-msgid "Failed to resolve HEAD as a valid ref."
-msgstr "Misslyckades slå upp HEAD som giltig referens."
+msgid "failed to resolve HEAD as a valid ref"
+msgstr "misslyckades slå upp HEAD som giltig referens"
msgid "HEAD not found below refs/heads!"
msgstr "HEAD hittades inte under refs/heads!"
@@ -2931,24 +2971,22 @@ msgstr ""
"propagateBranches har aktiverats"
msgid "--recurse-submodules can only be used to create branches"
-msgstr "--recurse-submodules jan endast användas för att skapa grenar"
+msgstr "--recurse-submodules kan endast användas för att skapa grenar"
msgid "branch name required"
msgstr "grennamn krävs"
-msgid "Cannot give description to detached HEAD"
-msgstr "Kan inte beskriva frånkopplad HEAD"
+msgid "cannot give description to detached HEAD"
+msgstr "kan inte beskriva frånkopplad HEAD"
msgid "cannot edit description of more than one branch"
msgstr "kan inte redigera beskrivning för mer än en gren"
-#, c-format
-msgid "No commit on branch '%s' yet."
-msgstr "Inga incheckningar på grenen \"%s\" ännu."
+msgid "cannot copy the current branch while not on any"
+msgstr "kunde inte kopiera aktuell gren när du inte befinner dig på någon"
-#, c-format
-msgid "No branch named '%s'."
-msgstr "Ingen gren vid namnet \"%s\"."
+msgid "cannot rename the current branch while not on any"
+msgstr "kunde inte byta namn på aktuell gren när du inte befinner dig på någon"
msgid "too many branches for a copy operation"
msgstr "för många grenar för kopiering"
@@ -2961,49 +2999,48 @@ msgstr "för många flaggor för att byta uppström"
#, c-format
msgid ""
-"could not set upstream of HEAD to %s when it does not point to any branch."
+"could not set upstream of HEAD to %s when it does not point to any branch"
msgstr ""
-"kunde inte sätta uppström för HEAD till %s när det inte pekar mot någon gren."
+"kunde inte sätta uppström för HEAD till %s när det inte pekar mot någon gren"
#, c-format
msgid "no such branch '%s'"
-msgstr "okänd gren \"%s\""
+msgstr "okänd gren â€%sâ€"
#, c-format
msgid "branch '%s' does not exist"
-msgstr "grenen \"%s\" finns inte"
+msgstr "grenen â€%s†finns inte"
msgid "too many arguments to unset upstream"
msgstr "för många flaggor för att ta bort uppström"
-msgid "could not unset upstream of HEAD when it does not point to any branch."
-msgstr ""
-"kunde inte ta bort uppström för HEAD när det inte pekar mot någon gren."
+msgid "could not unset upstream of HEAD when it does not point to any branch"
+msgstr "kunde inte ta bort uppström för HEAD när det inte pekar mot någon gren"
#, c-format
-msgid "Branch '%s' has no upstream information"
-msgstr "Grenen \"%s\" har ingen uppströmsinformation"
+msgid "branch '%s' has no upstream information"
+msgstr "grenen â€%s†har ingen uppströmsinformation"
msgid ""
-"The -a, and -r, options to 'git branch' do not take a branch name.\n"
+"the -a, and -r, options to 'git branch' do not take a branch name.\n"
"Did you mean to use: -a|-r --list <pattern>?"
msgstr ""
-"Flaggorna -a och -r på \"git branch\" tar inte ett namn på gren.\n"
+"flaggorna -a och -r pÃ¥ â€git branch†tar inte ett namn pÃ¥ gren.\n"
"Menade du att använda: -a|-r --list <mönster>?"
msgid ""
"the '--set-upstream' option is no longer supported. Please use '--track' or "
-"'--set-upstream-to' instead."
+"'--set-upstream-to' instead"
msgstr ""
-"Flaggan --set-upstream rekommenderas ej och kommer tas bort. Använd --track "
-"eller --set-upstream-to istället."
+"flaggan â€--set-upstream†rekommenderas ej och kommer tas bort. Använd â€--"
+"track†eller â€--set-upstream-to†istället"
msgid "git version:\n"
msgstr "git version:\n"
#, c-format
msgid "uname() failed with error '%s' (%d)\n"
-msgstr "uname() misslyckades med felet \"%s\" (%d)\n"
+msgstr "uname() misslyckades med felet â€%s†(%d)\n"
msgid "compiler info: "
msgstr "kompilatorinfo:"
@@ -3014,8 +3051,12 @@ msgstr "libc-info:"
msgid "not run from a git repository - no hooks to show\n"
msgstr "körs inte från ett git-arkiv - inga krokar att visa\n"
-msgid "git bugreport [-o|--output-directory <file>] [-s|--suffix <format>]"
-msgstr "git bugreport [-o|--output-directory <fil>] [-s|--suffix <format>]"
+msgid ""
+"git bugreport [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--diagnose[=<mode>]]"
+msgstr ""
+"git bugreport [(-o | --output-directory) <fil>] [(-s | --suffix) <format>]\n"
+" [--diagnose[=<läge>]"
msgid ""
"Thank you for filling out a Git bug report!\n"
@@ -3052,15 +3093,31 @@ msgstr ""
"Se över resten av felrapporten nedan.\n"
"Du kan ta bort rader du inte vill dela.\n"
-msgid "specify a destination for the bugreport file"
-msgstr "ange mål för buggrapporteringsfilen"
+msgid "mode"
+msgstr "läge"
-msgid "specify a strftime format suffix for the filename"
-msgstr "ange ett filändelse i strftime-format"
+msgid ""
+"create an additional zip archive of detailed diagnostics (default 'stats')"
+msgstr ""
+"skapa ett ytterligare zip-arkiv med detaljerad diagnostik (förval är â€statsâ€)"
+
+msgid "specify a destination for the bugreport file(s)"
+msgstr "ange mål för buggrapporteringsfilen/-rna"
+
+msgid "specify a strftime format suffix for the filename(s)"
+msgstr "ange filändelse i strftime-format"
+
+#, c-format
+msgid "unknown argument `%s'"
+msgstr "okänt argument â€%sâ€"
#, c-format
msgid "could not create leading directories for '%s'"
-msgstr "kunde inte skapa inledande kataloger för \"%s\""
+msgstr "kunde inte skapa inledande kataloger för â€%sâ€"
+
+#, c-format
+msgid "unable to create diagnostics archive %s"
+msgstr "kunde inte skapa diagnostikarkiven %s"
msgid "System Info"
msgstr "Systeminfo"
@@ -3074,19 +3131,26 @@ msgstr "kunde inte skriva till %s"
#, c-format
msgid "Created new report at '%s'.\n"
-msgstr "Skapade ny rapport på \"%s\"\n"
+msgstr "Skapade ny rapport pÃ¥ â€%sâ€\n"
-msgid "git bundle create [<options>] <file> <git-rev-list args>"
-msgstr "git bundle create [<flaggor>] <fil> <git-rev-list-flaggor>"
+msgid ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<version>] <file> <git-rev-list-args>"
+msgstr ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<version>] <fil> <git-rev-list-flaggor>"
-msgid "git bundle verify [<options>] <file>"
-msgstr "git bundle verify [<flaggor>] <fil>"
+msgid "git bundle verify [-q | --quiet] <file>"
+msgstr "git bundle verify [-q | --quiet] <fil>"
msgid "git bundle list-heads <file> [<refname>...]"
msgstr "git bundle list-heads <fil> [<refnamn>...]"
-msgid "git bundle unbundle <file> [<refname>...]"
-msgstr "git bundle unbundle <fil> [<refnamn>...]"
+msgid "git bundle unbundle [--progress] <file> [<refname>...]"
+msgstr "git bundle unbundle [--progress] <fil> [<refnamn>...]"
+
+msgid "need a <file> argument"
+msgstr "behöver ett <fil>-argument"
msgid "do not show progress meter"
msgstr "visa inte förloppsindikator"
@@ -3094,11 +3158,11 @@ msgstr "visa inte förloppsindikator"
msgid "show progress meter"
msgstr "visa förloppsindikator"
-msgid "show progress meter during object writing phase"
-msgstr "visa förloppsindikator under objektskrivningsfasen"
+msgid "historical; same as --progress"
+msgstr "historisk; samma som --progress"
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "som --all-progress när förloppsindikatorn visas"
+msgid "historical; does nothing"
+msgstr "historisk flagga; gör ingenting"
msgid "specify bundle format version"
msgstr "ange formatversion för bunten."
@@ -3120,22 +3184,18 @@ msgid "Unbundling objects"
msgstr "Packar upp objektbunt"
#, c-format
-msgid "Unknown subcommand: %s"
-msgstr "Okänt underkommando: %s"
-
-#, c-format
msgid "cannot read object %s '%s'"
-msgstr "kan inte läsa objektet %s: \"%s\""
+msgstr "kan inte läsa objektet %s: â€%sâ€"
msgid "flush is only for --buffer mode"
-msgstr "flush är endast till för --buffer-läge"
+msgstr "flush är endast till för â€--bufferâ€-läge"
msgid "empty command in input"
msgstr "tomt kommando i indata"
#, c-format
msgid "whitespace before command: '%s'"
-msgstr "blanksteg före kommando: \"%s\""
+msgstr "blanksteg före kommando: â€%sâ€"
#, c-format
msgid "%s requires arguments"
@@ -3145,10 +3205,6 @@ msgstr "%s kräver ett argument"
msgid "%s takes no arguments"
msgstr "%s tar inget argument"
-#, c-format
-msgid "unknown command: '%s'"
-msgstr "okänt kommando: \"%s\""
-
msgid "only one batch option may be specified"
msgstr "endast en buntflagga kan anges"
@@ -3162,23 +3218,23 @@ msgid "git cat-file (-t | -s) [--allow-unknown-type] <object>"
msgstr "git cat-file (-t | -s) [--allow-unknown-type] <objekt>"
msgid ""
+"git cat-file (--textconv | --filters)\n"
+" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
+msgstr ""
+"git cat-file (--textconv | --filters)\n"
+" [<revision>:<sökväg|träd-igt> | --path=<sökväg|träd-igt> "
+"<revision>]"
+
+msgid ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
+" [--textconv | --filters] [-Z]"
msgstr ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
-
-msgid ""
-"git cat-file (--textconv | --filters)\n"
-" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
-msgstr ""
-"git cat-file (--textconv | --filters)\n"
-" [<revision>:<sökväg|träd-igt> | --path=<sökväg|träd-igt> "
-"<revision>]"
+" [--textconv | --filters] [-Z]"
msgid "Check object existence or emit object contents"
msgstr "Kontrollera om objektet finns eller mata ut objektets innehåll"
@@ -3193,7 +3249,7 @@ msgid "Emit [broken] object attributes"
msgstr "Skriv ut [trasiga] objektattribut"
msgid "show object type (one of 'blob', 'tree', 'commit', 'tag', ...)"
-msgstr "visa objekttyp (en av: \"blob\", \"tree\", \"commit\", \"tag\", ...)"
+msgstr "visa objekttyp (en av: â€blobâ€, â€treeâ€, â€commitâ€, â€tagâ€, ...)"
msgid "show object size"
msgstr "visa objektstorlek"
@@ -3201,6 +3257,9 @@ msgstr "visa objektstorlek"
msgid "allow -s and -t to work with broken/corrupt objects"
msgstr "låter -s och -t att fungera med trasiga/sönderskrivna objekt"
+msgid "use mail map file"
+msgstr "använd e-postmappningsfil"
+
msgid "Batch objects requested on stdin (or --batch-all-objects)"
msgstr "Buntobjekt ombeds på standard in (eller --batch-all-objects)"
@@ -3210,6 +3269,12 @@ msgstr "visa komplett innehåll för <objekt> eller <rev>"
msgid "like --batch, but don't emit <contents>"
msgstr "som --batch, men mata inte ut <innehåll>"
+msgid "stdin is NUL-terminated"
+msgstr "standard in är NUL-terminerad"
+
+msgid "stdin and stdout is NUL-terminated"
+msgstr "standard in och standard ut är NUL-terminerade"
+
msgid "read commands from stdin"
msgstr "läs kommandon från standard in"
@@ -3256,35 +3321,38 @@ msgstr "sökväg|träd-igt"
#, c-format
msgid "'%s' requires a batch mode"
-msgstr "\"%s\" behöver ett buntläge"
+msgstr "â€%s†behöver ett buntläge"
#, c-format
msgid "'-%c' is incompatible with batch mode"
-msgstr "\"-%c\" är inkompatibel med buntläge"
+msgstr "â€-%c†är inkompatibel med buntläge"
msgid "batch modes take no arguments"
msgstr "buntlägen inte några argument"
#, c-format
msgid "<rev> required with '%s'"
-msgstr "<rev> krävs med \"%s\""
+msgstr "<rev> krävs med â€%sâ€"
#, c-format
msgid "<object> required with '-%c'"
-msgstr "<objekt> krävs med \"-%c\""
-
-msgid "too many arguments"
-msgstr "för många argument"
+msgstr "<objekt> krävs med â€-%câ€"
#, c-format
msgid "only two arguments allowed in <type> <object> mode, not %d"
msgstr "endast två argument krävs i <typ> <objekt>-läge, inte %d"
-msgid "git check-attr [-a | --all | <attr>...] [--] <pathname>..."
-msgstr "git check-attr [-a | --all | <attr>...] [--] <sökväg>..."
+msgid ""
+"git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] "
+"<pathname>..."
+msgstr ""
+"git check-attr [--source <träd:igt>] [-a | --all | <attr>...] [--] "
+"<sökväg>..."
-msgid "git check-attr --stdin [-z] [-a | --all | <attr>...]"
-msgstr "git check-attr --stdin [-z] [-a | --all | <attr>...]"
+msgid ""
+"git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"
+msgstr ""
+"git check-attr --stdin [-z] [--source <träd:igt>] [-a | --all | <attr>...]"
msgid "report all attributes set on file"
msgstr "visa alla attribut som satts på filen"
@@ -3298,6 +3366,12 @@ msgstr "läs filnamn från standard in"
msgid "terminate input and output records by a NUL character"
msgstr "avsluta in- och utdataposter med NUL-tecken"
+msgid "<tree-ish>"
+msgstr "<träd-igt>"
+
+msgid "which tree-ish to check attributes at"
+msgstr "vilken träd-igt att kontrollera attribut på"
+
msgid "suppress progress reporting"
msgstr "undertryck förloppsrapportering"
@@ -3351,7 +3425,7 @@ msgid "git checkout-index [<options>] [--] [<file>...]"
msgstr "git checkout-index [<flaggor>] [--] [<fil>...]"
msgid "stage should be between 1 and 3 or all"
-msgstr "etapp måste vara mellan 1 och 3 eller \"all\""
+msgstr "etapp mÃ¥ste vara mellan 1 och 3 eller â€allâ€"
msgid "check out all files in the index"
msgstr "checka ut alla filer i indexet"
@@ -3394,27 +3468,27 @@ msgstr "git restore [<flaggor>] [--source=<gren>] <fil>..."
#, c-format
msgid "path '%s' does not have our version"
-msgstr "sökvägen \"%s\" har inte vår version"
+msgstr "sökvägen â€%s†har inte vÃ¥r version"
#, c-format
msgid "path '%s' does not have their version"
-msgstr "sökvägen \"%s\" har inte deras version"
+msgstr "sökvägen â€%s†har inte deras version"
#, c-format
msgid "path '%s' does not have all necessary versions"
-msgstr "sökvägen \"%s\" innehåller inte alla nödvändiga versioner"
+msgstr "sökvägen â€%s†innehÃ¥ller inte alla nödvändiga versioner"
#, c-format
msgid "path '%s' does not have necessary versions"
-msgstr "sökvägen \"%s\" innehåller inte nödvändiga versioner"
+msgstr "sökvägen â€%s†innehÃ¥ller inte nödvändiga versioner"
#, c-format
msgid "path '%s': cannot merge"
-msgstr "sökväg \"%s\": kan inte slå ihop"
+msgstr "sökväg â€%sâ€: kan inte slÃ¥ ihop"
#, c-format
msgid "Unable to add merge result for '%s'"
-msgstr "Kunde inte lägga till sammanslagningsresultat för \"%s\""
+msgstr "Kunde inte lägga till sammanslagningsresultat för â€%sâ€"
#, c-format
msgid "Recreated %d merge conflict"
@@ -3436,27 +3510,31 @@ msgstr[1] "Uppdaterade %d sökvägar från indexet"
#, c-format
msgid "'%s' cannot be used with updating paths"
-msgstr "\"%s\" kan inte användas vid uppdatering av sökvägar"
+msgstr "â€%s†kan inte användas vid uppdatering av sökvägar"
#, c-format
msgid "Cannot update paths and switch to branch '%s' at the same time."
-msgstr "Kan inte uppdatera sökvägar och växla till grenen \"%s\" samtidigt."
+msgstr "Kan inte uppdatera sökvägar och växla till grenen â€%s†samtidigt."
#, c-format
msgid "neither '%s' or '%s' is specified"
-msgstr "varken \"%s\" eller \"%s\" har angivits"
+msgstr "varken â€%s†eller â€%s†har angivits"
#, c-format
msgid "'%s' must be used when '%s' is not specified"
-msgstr "\"%s\" måste användas när \"%s\" inte anges"
+msgstr "â€%s†mÃ¥ste användas när â€%s†inte anges"
#, c-format
msgid "'%s' or '%s' cannot be used with %s"
-msgstr "\"%s\" eller \"%s\" kan inte användas med %s"
+msgstr "â€%s†eller â€%s†kan inte användas med %s"
+
+#, c-format
+msgid "'%s', '%s', or '%s' cannot be used when checking out of a tree"
+msgstr "â€%sâ€, â€%s†eller â€%s†kan inte användas när en katalog checkas ut"
#, c-format
msgid "path '%s' is unmerged"
-msgstr "sökvägen \"%s\" har inte slagits ihop"
+msgstr "sökvägen â€%s†har inte slagits ihop"
msgid "you need to resolve your current index first"
msgstr "du måste lösa ditt befintliga index först"
@@ -3471,7 +3549,7 @@ msgstr ""
#, c-format
msgid "Can not do reflog for '%s': %s\n"
-msgstr "Kan inte skapa referenslogg för \"%s\": %s\n"
+msgstr "Kan inte skapa referenslogg för â€%sâ€: %s\n"
msgid "HEAD is now at"
msgstr "HEAD är nu på"
@@ -3481,23 +3559,23 @@ msgstr "kan inte uppdatera HEAD"
#, c-format
msgid "Reset branch '%s'\n"
-msgstr "Återställ gren \"%s\"\n"
+msgstr "Ã…terställ gren â€%sâ€\n"
#, c-format
msgid "Already on '%s'\n"
-msgstr "Redan på \"%s\"\n"
+msgstr "Redan pÃ¥ â€%sâ€\n"
#, c-format
msgid "Switched to and reset branch '%s'\n"
-msgstr "Växlade till och nollställde grenen \"%s\"\n"
+msgstr "Växlade till och nollställde grenen â€%sâ€\n"
#, c-format
msgid "Switched to a new branch '%s'\n"
-msgstr "Växlade till en ny gren \"%s\"\n"
+msgstr "Växlade till en ny gren â€%sâ€\n"
#, c-format
msgid "Switched to branch '%s'\n"
-msgstr "Växlade till grenen \"%s\"\n"
+msgstr "Växlade till grenen â€%sâ€\n"
#, c-format
msgid " ... and %d more.\n"
@@ -3565,7 +3643,7 @@ msgid ""
"'%s' could be both a local file and a tracking branch.\n"
"Please use -- (and optionally --no-guess) to disambiguate"
msgstr ""
-"\"%s\" kan vara både en lokal fil och en spårande gren.\n"
+"â€%s†kan vara bÃ¥de en lokal fil och en spÃ¥rande gren.\n"
"Använd -- (och möjligen --no-guess) för att göra otvetydig"
msgid ""
@@ -3578,18 +3656,18 @@ 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
msgid "'%s' matched multiple (%d) remote tracking branches"
-msgstr "\"%s\" motsvarar flera (%d) spårade fjärrgrenar"
+msgstr "â€%s†motsvarar flera (%d) spÃ¥rade fjärrgrenar"
msgid "only one reference expected"
msgstr "endast en referens förväntades"
@@ -3608,19 +3686,19 @@ msgstr "referensen är inte ett träd: %s"
#, c-format
msgid "a branch is expected, got tag '%s'"
-msgstr "förväntade gren, fick taggen \"%s\""
+msgstr "förväntade gren, fick taggen â€%sâ€"
#, c-format
msgid "a branch is expected, got remote branch '%s'"
-msgstr "förväntade gren, fick fjärrgrenen \"%s\""
+msgstr "förväntade gren, fick fjärrgrenen â€%sâ€"
#, c-format
msgid "a branch is expected, got '%s'"
-msgstr "förväntade gren, fick \"%s\""
+msgstr "förväntade gren, fick â€%sâ€"
#, c-format
msgid "a branch is expected, got commit '%s'"
-msgstr "förväntade gren, fick incheckningen \"%s\""
+msgstr "förväntade gren, fick incheckningen â€%sâ€"
msgid ""
"If you want to detach HEAD at the commit, try again with the --detach option."
@@ -3633,57 +3711,57 @@ msgid ""
"Consider \"git merge --quit\" or \"git worktree add\"."
msgstr ""
"kan inte växla gren vid sammanslagning\n"
-"Överväg \"git merge --quit\" eller \"git worktree add\"."
+"Överväg â€git merge --quit†eller â€git worktree addâ€."
msgid ""
"cannot switch branch in the middle of an am session\n"
"Consider \"git am --quit\" or \"git worktree add\"."
msgstr ""
-"kan inte växla gren mitt i en \"am\"-körning\n"
-"Överväg \"git am --quit\" eller \"git worktree add\"."
+"kan inte växla gren mitt i en â€amâ€-körning\n"
+"Överväg â€git am --quit†eller â€git worktree addâ€."
msgid ""
"cannot switch branch while rebasing\n"
"Consider \"git rebase --quit\" or \"git worktree add\"."
msgstr ""
"kan inte växla gren vid ombasering\n"
-"Överväg \"git rebase --quit\" eller \"git worktree add\"."
+"Överväg â€git rebase --quit†eller â€git worktree addâ€."
msgid ""
"cannot switch branch while cherry-picking\n"
"Consider \"git cherry-pick --quit\" or \"git worktree add\"."
msgstr ""
-"kan inte växla gren i en \"cherry-pick\"\n"
-"Överväg \"git cherry-pick --quit\" eller \"git worktree add\"."
+"kan inte växla gren i en â€cherry-pickâ€\n"
+"Överväg â€git cherry-pick --quit†eller â€git worktree addâ€."
msgid ""
"cannot switch branch while reverting\n"
"Consider \"git revert --quit\" or \"git worktree add\"."
msgstr ""
-"kan inte växla gren i en \"revert\"\n"
-"Överväg \"git revert --quit\" eller \"git worktree add\"."
+"kan inte växla gren i en â€revertâ€\n"
+"Överväg â€git revert --quit†eller â€git worktree addâ€."
msgid "you are switching branch while bisecting"
-msgstr "då växlar grenar medan du gör en \"bisect\""
+msgstr "dÃ¥ växlar grenar medan du gör en â€bisectâ€"
msgid "paths cannot be used with switching branches"
msgstr "sökvägar kan inte användas vid byte av gren"
#, c-format
msgid "'%s' cannot be used with switching branches"
-msgstr "\"%s\" kan inte användas vid byte av gren"
+msgstr "â€%s†kan inte användas vid byte av gren"
#, c-format
msgid "'%s' cannot be used with '%s'"
-msgstr "\"%s\" kan inte användas med \"%s\""
+msgstr "â€%s†kan inte användas med â€%sâ€"
#, c-format
msgid "'%s' cannot take <start-point>"
-msgstr "\"%s\" kan inte ta <startpunkt>"
+msgstr "â€%s†kan inte ta <startpunkt>"
#, c-format
msgid "Cannot switch branch to a non-commit '%s'"
-msgstr "Kan inte växla gren till icke-incheckningen \"%s\""
+msgstr "Kan inte växla gren till icke-incheckningen â€%sâ€"
msgid "missing branch or commit argument"
msgstr "saknar gren- eller incheckingsargument"
@@ -3706,8 +3784,8 @@ msgstr "tvinga utcheckning (kasta bort lokala ändringar)"
msgid "new-branch"
msgstr "ny-gren"
-msgid "new unparented branch"
-msgstr "ny gren utan förälder"
+msgid "new unborn branch"
+msgstr "ny ofödd gren"
msgid "update ignored files (default)"
msgstr "uppdatera ignorerade filer (standard)"
@@ -3727,7 +3805,7 @@ msgstr "begränsa inte sökvägar till endast glesa poster"
#, c-format
msgid "options '-%c', '-%c', and '%s' cannot be used together"
-msgstr "flaggorna \"%-c\", \"-%c\" och \"%s\" kan inte användas samtidigt"
+msgstr "flaggorna â€%-câ€, â€-%c†och â€%s†kan inte användas samtidigt"
msgid "--track needs a branch name"
msgstr "--track behöver ett namn på en gren"
@@ -3745,12 +3823,11 @@ msgstr "felaktig sökvägsangivelse"
#, c-format
msgid "'%s' is not a commit and a branch '%s' cannot be created from it"
-msgstr ""
-"\"%s\" är inte en incheckning och grenen \"%s\" kan inte skapas från den"
+msgstr "â€%s†är inte en incheckning och grenen â€%s†kan inte skapas frÃ¥n den"
#, c-format
msgid "git checkout: --detach does not take a path argument '%s'"
-msgstr "git checkout: --detach tar inte en sökväg som argument \"%s\""
+msgstr "git checkout: --detach tar inte en sökväg som argument â€%sâ€"
msgid ""
"git checkout: --ours/--theirs, --force and --merge are incompatible when\n"
@@ -3775,7 +3852,7 @@ msgid "create reflog for new branch"
msgstr "skapa reflogg för ny gren"
msgid "second guess 'git checkout <no-such-branch>' (default)"
-msgstr "förutspå \"git checkout <gren-saknas>\" (förval)"
+msgstr "förutspÃ¥ â€git checkout <gren-saknas>†(förval)"
msgid "use overlay mode (default)"
msgstr "använd överläggsläge (standard)"
@@ -3787,7 +3864,7 @@ msgid "create/reset and switch to a branch"
msgstr "skapa/nollställ och växla till en gren"
msgid "second guess 'git switch <no-such-branch>'"
-msgstr "förutspå \"git checkout <gren-saknas>\""
+msgstr "förutspÃ¥ â€git checkout <gren-saknas>â€"
msgid "throw away local modifications"
msgstr "kasta bort lokala ändringar"
@@ -3808,10 +3885,10 @@ msgid "use overlay mode"
msgstr "använd överläggsläge"
msgid ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <paths>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] "
+"[<pathspec>...]"
msgstr ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <mönster>] [-x | -X] [--] "
-"<sökvägar>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <mönster>] [-x | -X] [--] <sökväg>..."
#, c-format
msgid "Removing %s\n"
@@ -3835,7 +3912,7 @@ msgstr "misslyckades ta bort %s"
#, c-format
msgid "could not lstat %s\n"
-msgstr "kunde inte ta status (\"lstat\") på %s\n"
+msgstr "kunde inte ta status (â€lstatâ€) pÃ¥ %s\n"
msgid "Refusing to remove current working directory\n"
msgstr "Vägrar ta bort aktuell arbetskatalog\n"
@@ -3875,7 +3952,7 @@ msgstr ""
"* - välj alla poster\n"
" - (tomt) avsluta markering\n"
-#, c-format, perl-format
+#, c-format
msgid "Huh (%s)?\n"
msgstr "Vadå (%s)?\n"
@@ -3907,7 +3984,7 @@ msgstr ""
"clean - börja städa\n"
"filter by pattern - uteslut poster från borttagning\n"
"select by numbers - markera poster som ska tas bort med siffror\n"
-"ask each - bekräfta varje borttagning (som \"rm -i\")\n"
+"ask each - bekräfta varje borttagning (som â€rm -iâ€)\n"
"quit - sluta städa\n"
"help - denna skärm\n"
"? - hjälp för kommandoval"
@@ -3958,9 +4035,6 @@ msgstr ""
"clean.requireForce har standardvärdet true och varken -i, -n eller -f "
"angavs; vägrar städa"
-msgid "-x and -X cannot be used together"
-msgstr "-x och -X kan inte användas samtidigt"
-
msgid "git clone [<options>] [--] <repo> [<dir>]"
msgstr "git clone [<flaggor>] [--] <arkiv> [<kat>]"
@@ -3971,10 +4045,10 @@ msgid "don't create a checkout"
msgstr "skapa inte någon utcheckning"
msgid "create a bare repository"
-msgstr "skapa ett naket (\"bare\") arkiv"
+msgstr "skapa ett naket (â€bareâ€) arkiv"
msgid "create a mirror repository (implies bare)"
-msgstr "skapa ett spegelarkiv (implicerar \"bare\")"
+msgstr "skapa ett spegelarkiv (implicerar â€bareâ€)"
msgid "to clone from a local repository"
msgstr "för att klona från ett lokalt arkiv"
@@ -4010,7 +4084,7 @@ msgid "name"
msgstr "namn"
msgid "use <name> instead of 'origin' to track upstream"
-msgstr "använd <namn> istället för \"origin\" för att spåra uppströms"
+msgstr "använd <namn> istället för â€origin†för att spÃ¥ra uppströms"
msgid "checkout <branch> instead of the remote's HEAD"
msgstr "checka ut <gren> istället för fjärrens HEAD"
@@ -4024,9 +4098,6 @@ msgstr "djup"
msgid "create a shallow clone of that depth"
msgstr "skapa en grund klon på detta djup"
-msgid "time"
-msgstr "tid"
-
msgid "create a shallow clone since a specific time"
msgstr "skapa en grund klon från en angiven tidpunkt"
@@ -4051,6 +4122,9 @@ msgstr "gitkat"
msgid "separate git dir from working tree"
msgstr "separera gitkatalogen från arbetskatalogen"
+msgid "specify the reference format to use"
+msgstr "använd referensformatet som ska användas"
+
msgid "key=value"
msgstr "nyckel=värde"
@@ -4063,12 +4137,6 @@ msgstr "serverspecifik"
msgid "option to transmit"
msgstr "flagga att sända"
-msgid "use IPv4 addresses only"
-msgstr "använd endast IPv4-adresser"
-
-msgid "use IPv6 addresses only"
-msgstr "använd endast IPv6-adresser"
-
msgid "apply partial clone filters to submodules"
msgstr "tillämpa delvisa klonfilter på undermoduler"
@@ -4078,37 +4146,51 @@ msgstr "klonade undermoduler kommer använda sin fjärrspårningsgren"
msgid "initialize sparse-checkout file to include only files at root"
msgstr "initiera sparse-checkout-filen till att bara ta med filer i roten"
+msgid "uri"
+msgstr "uri"
+
+msgid "a URI for downloading bundles before fetching from origin remote"
+msgstr "en URI för att hämta buntar innan de hämtas från ursprungsfjärr"
+
#, c-format
msgid "info: Could not add alternate for '%s': %s\n"
-msgstr "info: Kan inte skapa suppleant för \"%s\": %s\n"
+msgstr "info: Kan inte skapa suppleant för â€%sâ€: %s\n"
#, c-format
msgid "failed to stat '%s'"
-msgstr "misslyckades ta status på \"%s\""
+msgstr "misslyckades ta status pÃ¥ â€%sâ€"
#, c-format
msgid "%s exists and is not a directory"
msgstr "%s finns och är ingen katalog"
#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "â€%s†är en symbolisk länk, vägrar klona med --local"
+
+#, c-format
msgid "failed to start iterator over '%s'"
-msgstr "misslyckades starta iterator över \"%s\""
+msgstr "misslyckades starta iterator över â€%sâ€"
+
+#, c-format
+msgid "symlink '%s' exists, refusing to clone with --local"
+msgstr "symbolisk länk â€%s†finns redan, vägrar klona med --local"
#, c-format
msgid "failed to unlink '%s'"
-msgstr "misslyckades ta bort länken \"%s\""
+msgstr "misslyckades ta bort länken â€%sâ€"
#, c-format
msgid "failed to create link '%s'"
-msgstr "misslyckades skapa länken \"%s\""
+msgstr "misslyckades skapa länken â€%sâ€"
#, c-format
msgid "failed to copy file to '%s'"
-msgstr "misslyckades kopiera filen till \"%s\""
+msgstr "misslyckades kopiera filen till â€%sâ€"
#, c-format
msgid "failed to iterate over '%s'"
-msgstr "misslyckades iterera över \"%s\""
+msgstr "misslyckades iterera över â€%sâ€"
#, c-format
msgid "done.\n"
@@ -4120,8 +4202,8 @@ msgid ""
"and retry with 'git restore --source=HEAD :/'\n"
msgstr ""
"Klonen lyckades, men utcheckningen misslyckades.\n"
-"Du kan inspektera det som checkades ut med \"git status\"\n"
-"och försöka med \"git restore --source=HEAD :/\"\n"
+"Du kan inspektera det som checkades ut med â€git statusâ€\n"
+"och försöka med â€git restore --source=HEAD :/â€\n"
#, c-format
msgid "Could not find remote branch %s to clone."
@@ -4137,9 +4219,8 @@ msgstr "kan inte uppdatera %s"
msgid "failed to initialize sparse-checkout"
msgstr "misslyckades initiera sparse-checkout"
-msgid "remote HEAD refers to nonexistent ref, unable to checkout.\n"
-msgstr ""
-"HEAD hos fjärren pekar på en obefintlig referens, kan inte checka ut.\n"
+msgid "remote HEAD refers to nonexistent ref, unable to checkout"
+msgstr "HEAD hos fjärren pekar på en obefintlig referens, kan inte checka ut"
msgid "unable to checkout working tree"
msgstr "kunde inte checka ut arbetskatalogen"
@@ -4151,7 +4232,7 @@ msgid "cannot repack to clean up"
msgstr "kan inte packa om för att städa upp"
msgid "cannot unlink temporary alternates file"
-msgstr "kunde inte ta bort temporär \"alternates\"-fil"
+msgstr "kunde inte ta bort temporär â€alternatesâ€-fil"
msgid "Too many arguments."
msgstr "För många argument."
@@ -4160,12 +4241,12 @@ msgid "You must specify a repository to clone."
msgstr "Du måste ange ett arkiv att klona."
#, c-format
-msgid "options '%s' and '%s %s' cannot be used together"
-msgstr "flaggorna \"%s\" och \"%s %s\" kan inte användas samtidigt"
+msgid "unknown ref storage format '%s'"
+msgstr "okänt format för lagring av referenser â€%sâ€"
#, c-format
msgid "repository '%s' does not exist"
-msgstr "arkivet \"%s\" finns inte"
+msgstr "arkivet â€%s†finns inte"
#, c-format
msgid "depth %s is not a positive number"
@@ -4173,31 +4254,31 @@ msgstr "djupet %s är inte ett positivt tal"
#, c-format
msgid "destination path '%s' already exists and is not an empty directory."
-msgstr "destinationssökvägen \"%s\" finns redan och är inte en tom katalog."
+msgstr "destinationssökvägen â€%s†finns redan och är inte en tom katalog."
#, c-format
msgid "repository path '%s' already exists and is not an empty directory."
-msgstr "arkivsökvägen \"%s\" finns redan och är inte en tom katalog."
+msgstr "arkivsökvägen â€%s†finns redan och är inte en tom katalog."
#, c-format
msgid "working tree '%s' already exists."
-msgstr "arbetsträdet \"%s\" finns redan."
+msgstr "arbetsträdet â€%s†finns redan."
#, c-format
msgid "could not create leading directories of '%s'"
-msgstr "kunde inte skapa inledande kataloger för \"%s\""
+msgstr "kunde inte skapa inledande kataloger för â€%sâ€"
#, c-format
msgid "could not create work tree dir '%s'"
-msgstr "kunde inte skapa arbetskatalogen \"%s\""
+msgstr "kunde inte skapa arbetskatalogen â€%sâ€"
#, c-format
msgid "Cloning into bare repository '%s'...\n"
-msgstr "Klonar till ett naket arkiv \"%s\"...\n"
+msgstr "Klonar till ett naket arkiv â€%sâ€...\n"
#, c-format
msgid "Cloning into '%s'...\n"
-msgstr "Klonar till \"%s\"...\n"
+msgstr "Klonar till â€%sâ€...\n"
msgid ""
"clone --recursive is not compatible with both --reference and --reference-if-"
@@ -4207,7 +4288,7 @@ msgstr ""
#, c-format
msgid "'%s' is not a valid remote name"
-msgstr "\"%s\" är inte ett giltigt namn på fjärrarkiv"
+msgstr "â€%s†är inte ett giltigt namn pÃ¥ fjärrarkiv"
msgid "--depth is ignored in local clones; use file:// instead."
msgstr "--depth ignoreras i lokala kloningar; använd file:// istället."
@@ -4234,6 +4315,16 @@ msgstr "--local ignoreras"
msgid "cannot clone from filtered bundle"
msgstr "kan inte klona från filtrerad bunt"
+msgid "failed to initialize the repo, skipping bundle URI"
+msgstr "misslyckades initiera arkivet, hoppar över bunt-URI"
+
+#, c-format
+msgid "failed to fetch objects from bundle URI '%s'"
+msgstr "misslyckades hämta objekt frÃ¥n bunt-URI â€%sâ€"
+
+msgid "failed to fetch advertised bundles"
+msgstr "misslyckades hämta annonserade buntar"
+
msgid "remote transport reported error"
msgstr "fjärrtransport rapporterade fel"
@@ -4269,18 +4360,24 @@ msgid "--command must be the first argument"
msgstr "--command måste vara första argument"
msgid ""
-"git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]"
+"git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]"
msgstr ""
-"git commit-graph verify [--object-dir <objkat>] [--shallow] [--[no-]progress]"
+"git commit-graph verify [--object-dir <kat>] [--shallow] [--[no-]progress]"
msgid ""
-"git commit-graph write [--object-dir <objdir>] [--append] [--"
-"split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <n>] [--[no-]progress] <split options>"
+"git commit-graph write [--object-dir <dir>] [--append]\n"
+" [--split[=<strategy>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <split-options>"
msgstr ""
-"git commit-graph write [--object-dir <objkat>] [--append] [--"
-"split[=<strategi>]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <n>] [--[no-]progress] <delnings-flaggor>"
+"git commit-graph write [--object-dir <kat>] [--append]\n"
+" [--split[=<strategi>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <delnings-flaggor>"
msgid "dir"
msgstr "kat"
@@ -4293,7 +4390,11 @@ msgstr "om inchecknignsgrafen är delad, kontrollera bara spetsfilen"
#, c-format
msgid "Could not open commit-graph '%s'"
-msgstr "Kunde inte öppna incheckningsgrafen \"%s\""
+msgstr "Kunde inte öppna incheckningsgrafen â€%sâ€"
+
+#, c-format
+msgid "could not open commit-graph chain '%s'"
+msgstr "kunde inte öppna incheckningsgrafen â€%sâ€"
#, c-format
msgid "unrecognized --split argument, %s"
@@ -4309,7 +4410,7 @@ msgstr "ogiltigt objekt: %s"
#, c-format
msgid "option `%s' expects a numerical value"
-msgstr "flaggan \"%s\" antar ett numeriskt värde"
+msgstr "flaggan â€%s†antar ett numeriskt värde"
msgid "start walk at all refs"
msgstr "starta traversering vid alla referenser"
@@ -4348,16 +4449,16 @@ msgstr "använd som mest en av --reachable, --stdin-commits och --stdin-packs"
msgid "Collecting commits from input"
msgstr "Hämtar incheckningar från indata"
-#, c-format
-msgid "unrecognized subcommand: %s"
-msgstr "okänt underkommando: %s"
+msgid "git commit-tree <tree> [(-p <parent>)...]"
+msgstr "git commit-tree <träd> [(-p <förälder>)...]"
msgid ""
-"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...] [(-F "
-"<file>)...] <tree>"
+"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]\n"
+" [(-F <file>)...] <tree>"
msgstr ""
-"git commit-tree [(-p <föräldrer>)...] [-S[<nyckelid>]] [(-m "
-"<meddelande>)...] [(-F <fil>)...] <träd>"
+"git commit-tree [(-p <förälder>)...] [-S[<nyckelid>]] [(-m "
+"<meddelande>)...]\n"
+" [(-F <fil>)...] <träd>"
#, c-format
msgid "duplicate parent %s ignored"
@@ -4369,11 +4470,11 @@ msgstr "objektnamnet är inte giltigt: %s"
#, c-format
msgid "git commit-tree: failed to read '%s'"
-msgstr "git commit-tree: misslyckades läsa \"%s\""
+msgstr "git commit-tree: misslyckades läsa â€%sâ€"
#, c-format
msgid "git commit-tree: failed to close '%s'"
-msgstr "git commit-tree: misslyckades stänga \"%s\""
+msgstr "git commit-tree: misslyckades stänga â€%sâ€"
msgid "parent"
msgstr "förälder"
@@ -4399,10 +4500,29 @@ msgstr "måste ange exakt ett träd"
msgid "git commit-tree: failed to read"
msgstr "git commit-tree: misslyckades läsa"
-msgid "git commit [<options>] [--] <pathspec>..."
-msgstr "git commit [<flaggor>] [--] <sökväg>..."
-
-msgid "git status [<options>] [--] <pathspec>..."
+msgid ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|"
+"reword):]<commit>)]\n"
+" [-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n"
+" [--date=<date>] [--cleanup=<mode>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<läge>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <incheckning> | --fixup [(amend|"
+"reword):]<incheckning>)]\n"
+" [-F <fil> | -m <medd>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--"
+"author=<författare>]\n"
+" [--date=<datum>] [--cleanup=<läge>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<fil> [--pathspec-file-nul]]\n"
+" [(--trailer <symbol>[(=|:)<värde>])...] [-S[<nyckel-id>]]\n"
+" [--] [<sökväg>...]"
+
+msgid "git status [<options>] [--] [<pathspec>...]"
msgstr "git status [<flaggor>] [--] <sökväg>..."
msgid ""
@@ -4412,7 +4532,7 @@ msgid ""
msgstr ""
"Du bad om att utöka den senaste incheckningen, men om du gör det\n"
"blir den tom. Du kan köra kommandot på nytt med --allow-empty, eller\n"
-"så kan du ta bort incheckningen helt med \"git reset HEAD^\".\n"
+"sÃ¥ kan du ta bort incheckningen helt med â€git reset HEAD^â€.\n"
msgid ""
"The previous cherry-pick is now empty, possibly due to conflict resolution.\n"
@@ -4421,17 +4541,17 @@ msgid ""
" git commit --allow-empty\n"
"\n"
msgstr ""
-"Den tidigare \"cherry-pick\":en är nu tom, kanske på grund av en löst\n"
+"Den tidigare â€cherry-pickâ€:en är nu tom, kanske pÃ¥ grund av en löst\n"
"konflikt. Om du vill checka in den ändå använder du:\n"
"\n"
" git commit --allow-empty\n"
"\n"
msgid "Otherwise, please use 'git rebase --skip'\n"
-msgstr "Använd annars \"git rebase --skip\"\n"
+msgstr "Använd annars â€git rebase --skipâ€\n"
msgid "Otherwise, please use 'git cherry-pick --skip'\n"
-msgstr "Använd annars \"git cherry-pick --skip\"\n"
+msgstr "Använd annars â€git cherry-pick --skipâ€\n"
msgid ""
"and then use:\n"
@@ -4448,12 +4568,15 @@ msgstr ""
"\n"
" git cherry-pick --continue\n"
"\n"
-"för att fortsätta \"cherry-pick\" med resterande incheckningar.\n"
+"för att fortsätta â€cherry-pick†med resterande incheckningar.\n"
"Om du vill hoppa över den här incheckningen, använd:\n"
"\n"
" git cherry-pick --skip\n"
"\n"
+msgid "updating files failed"
+msgstr "misslyckades uppdatera filer"
+
msgid "failed to unpack HEAD tree object"
msgstr "misslyckades packa upp HEAD:s trädobjekt"
@@ -4472,9 +4595,6 @@ msgstr "kan inte uppdatera temporärt index"
msgid "Failed to update main cache tree"
msgstr "Misslyckades uppdatera huvud-cacheträdet"
-msgid "unable to write new_index file"
-msgstr "kunde inte skriva filen new_index"
-
msgid "cannot do a partial commit during a merge."
msgstr "kan inte utföra en delvis incheckning under en sammanslagning."
@@ -4492,14 +4612,14 @@ msgstr "kunde inte skriva temporär indexfil"
#, c-format
msgid "commit '%s' lacks author header"
-msgstr "incheckningen \"%s\" saknar författarhuvud"
+msgstr "incheckningen â€%s†saknar författarhuvud"
#, c-format
msgid "commit '%s' has malformed author line"
-msgstr "incheckningen \"%s\" har felformaterat författarhuvud"
+msgstr "incheckningen â€%s†har felformaterat författarhuvud"
msgid "malformed --author parameter"
-msgstr "felformad \"--author\"-flagga"
+msgstr "felformad â€--authorâ€-flagga"
#, c-format
msgid "invalid date format: %s"
@@ -4513,8 +4633,8 @@ msgstr ""
"i det befintliga incheckningsmeddelandet"
#, c-format
-msgid "could not lookup commit %s"
-msgstr "kunde inte slå upp incheckningen %s"
+msgid "could not lookup commit '%s'"
+msgstr "kunde inte slÃ¥ upp incheckningen â€%sâ€"
#, c-format
msgid "(reading log message from standard input)\n"
@@ -4525,11 +4645,11 @@ msgstr "kunde inte läsa logg från standard in"
#, c-format
msgid "could not read log file '%s'"
-msgstr "kunde inte läsa loggfilen \"%s\""
+msgstr "kunde inte läsa loggfilen â€%sâ€"
#, c-format
msgid "options '%s' and '%s:%s' cannot be used together"
-msgstr "flaggorna \"%s\" och \"%s:%s\" kan inte användas samtidigt"
+msgstr "flaggorna â€%s†och â€%s:%s†kan inte användas samtidigt"
msgid "could not read SQUASH_MSG"
msgstr "kunde inte läsa SQUASH_MSG"
@@ -4539,7 +4659,7 @@ msgstr "kunde inte läsa MERGE_MSG"
#, c-format
msgid "could not open '%s'"
-msgstr "kunde inte öppna \"%s\""
+msgstr "kunde inte öppna â€%sâ€"
msgid "could not write commit template"
msgstr "kunde inte skriva incheckningsmall"
@@ -4550,7 +4670,7 @@ msgid ""
"with '%c' will be ignored.\n"
msgstr ""
"Ange incheckningsmeddelandet för dina ändringar. Rader som inleds\n"
-"med \"%c\" kommer ignoreras.\n"
+"med â€%c†kommer ignoreras.\n"
#, c-format
msgid ""
@@ -4558,8 +4678,7 @@ msgid ""
"with '%c' will be ignored, and an empty message aborts the commit.\n"
msgstr ""
"Ange incheckningsmeddelandet för dina ändringar. Rader som inleds\n"
-"med \"%c\" kommer ignoreras, och ett tomt meddelande avbryter "
-"incheckningen.\n"
+"med â€%c†kommer ignoreras, och ett tomt meddelande avbryter incheckningen.\n"
#, c-format
msgid ""
@@ -4567,7 +4686,7 @@ msgid ""
"with '%c' will be kept; you may remove them yourself if you want to.\n"
msgstr ""
"Ange incheckningsmeddelandet för dina ändringar. Rader som inleds\n"
-"med \"%c\" kommer behållas; du kan själv ta bort dem om du vill.\n"
+"med â€%c†kommer behÃ¥llas; du kan själv ta bort dem om du vill.\n"
#, c-format
msgid ""
@@ -4576,7 +4695,7 @@ msgid ""
"An empty message aborts the commit.\n"
msgstr ""
"Ange incheckningsmeddelandet för dina ändringar. Rader som inleds\n"
-"med \"%c\" kommer behållas; du kan själv ta bort dem om du vill.\n"
+"med â€%c†kommer behÃ¥llas; du kan själv ta bort dem om du vill.\n"
"Ett tomt meddelande avbryter incheckningen.\n"
msgid ""
@@ -4637,11 +4756,11 @@ msgstr ""
#, c-format
msgid "Invalid ignored mode '%s'"
-msgstr "Ogiltigt ignorerat läge \"%s\""
+msgstr "Ogiltigt ignorerat läge â€%sâ€"
#, c-format
msgid "Invalid untracked files mode '%s'"
-msgstr "Ogiltigt läge för ospårade filer: \"%s\""
+msgstr "Ogiltigt läge för ospÃ¥rade filer: â€%sâ€"
msgid "You are in the middle of a merge -- cannot reword."
msgstr "Du är i mitten av en sammanslagning -- kan inte omformulera."
@@ -4652,11 +4771,11 @@ msgstr "Du är i mitten av en cherry-pick -- kan inte omformulera."
#, c-format
msgid "reword option of '%s' and path '%s' cannot be used together"
msgstr ""
-"reword-flaggan till \"%s\" och sökvägen \"%s\" kan inte användas tillsammans"
+"reword-flaggan till â€%s†och sökvägen â€%s†kan inte användas tillsammans"
#, c-format
msgid "reword option of '%s' and '%s' cannot be used together"
-msgstr "reword-flaggan till \"%s\" och \"%s\" kan inte användas tillsammans"
+msgstr "reword-flaggan till â€%s†och â€%s†kan inte användas tillsammans"
msgid "You have nothing to amend."
msgstr "Du har inget att utöka."
@@ -4679,7 +4798,7 @@ msgstr "okänd flagga: --fixup=%s:%s"
#, c-format
msgid "paths '%s ...' with -a does not make sense"
-msgstr "sökvägarna \"%s ...\" med -a ger ingen mening"
+msgstr "sökvägarna â€%s ...†med -a ger ingen mening"
msgid "show status concisely"
msgstr "visa koncis status"
@@ -4705,9 +4824,6 @@ msgstr "visa status i långt format (standard)"
msgid "terminate entries with NUL"
msgstr "terminera poster med NUL"
-msgid "mode"
-msgstr "läge"
-
msgid "show untracked files, optional modes: all, normal, no. (Default: all)"
msgstr "visa ospårade filer, valfria lägen: all, normal, no. (Standard: all)"
@@ -4875,13 +4991,13 @@ msgstr "Avbryter på grund av tom incheckningsmeddelandekropp.\n"
msgid ""
"repository has been updated, but unable to write\n"
-"new_index file. Check that disk is not full and quota is\n"
+"new index file. Check that disk is not full and quota is\n"
"not exceeded, and then \"git restore --staged :/\" to recover."
msgstr ""
-"arkivet har uppdaterats, men kunde inte skriva filen\n"
-"new_index. Kontrollera att disken inte är full och\n"
+"arkivet har uppdaterats, men kunde inte skriva ny\n"
+"indexfil. Kontrollera att disken inte är full och\n"
"att kvoten inte har överskridits, och kör sedan\n"
-"\"git restore --staged :/\" för att återställa."
+"â€git restore --staged :/†för att Ã¥terställa."
msgid "git config [<options>]"
msgstr "git config [<flaggor>]"
@@ -4954,7 +5070,7 @@ msgid "list all"
msgstr "visa alla"
msgid "use string equality when comparing values to 'value-pattern'"
-msgstr "använd stränglikhet vid när värden jämförs med \"värde-mönster\""
+msgstr "använd stränglikhet vid när värden jämförs med â€värde-mönsterâ€"
msgid "open an editor"
msgstr "öppna textredigeringsprogram"
@@ -4975,7 +5091,7 @@ msgid "value is given this type"
msgstr "värdet har givits denna typ"
msgid "value is \"true\" or \"false\""
-msgstr "värdet är \"true\" eller \"false\""
+msgstr "värdet är â€true†eller â€falseâ€"
msgid "value is decimal number"
msgstr "värdet är ett decimalt tal"
@@ -5040,7 +5156,7 @@ msgstr "misslyckades formatera standardkonfigurationsvärde: %s"
#, c-format
msgid "cannot parse color '%s'"
-msgstr "kan inte tolka färgen \"%s\""
+msgstr "kan inte tolka färgen â€%sâ€"
msgid "unable to parse default color value"
msgstr "kan inte tolka standardfärgvärde"
@@ -5090,7 +5206,7 @@ msgid ""
msgstr ""
"--worktree kan inte användas med flera arbetskataloger om inte\n"
"konfigurationsutöknignen worktreeConfig har aktiverats. Läsa stycket\n"
-"\"KONFIGURATIONSFIL\" i \"git help worktree\" för detaljer"
+"â€KONFIGURATIONSFIL†i â€git help worktree†för detaljer"
msgid "--get-color and variable type are incoherent"
msgstr "--get-color och variabeltyp stämmer inte överens"
@@ -5111,11 +5227,11 @@ msgid "--default is only applicable to --get"
msgstr "--default gäller bara för --get"
msgid "--fixed-value only applies with 'value-pattern'"
-msgstr "--fixed-value gäller endast med \"värde-mönster\""
+msgstr "--fixed-value gäller endast med â€värde-mönsterâ€"
#, c-format
msgid "unable to read config file '%s'"
-msgstr "kan inte konfigurationsfil \"%s\""
+msgstr "kan inte läsa konfigurationsfilen â€%sâ€"
msgid "error processing config file(s)"
msgstr "fel vid hantering av konfigurationsfil(er)"
@@ -5128,7 +5244,7 @@ msgstr "redigering av blobbar stöds ej"
#, c-format
msgid "cannot create configuration file %s"
-msgstr "kan inte skapa konfigurationsfilen \"%s\""
+msgstr "kan inte skapa konfigurationsfilen â€%sâ€"
#, c-format
msgid ""
@@ -5161,21 +5277,28 @@ msgid "print debugging messages to stderr"
msgstr "skriv felsökningsmeddelanden på standard fel"
msgid "credential-cache--daemon unavailable; no unix socket support"
-msgstr ""
-"\"credential-cache--daemon\" ej tillgänglig; stöd för unix-uttag saknas"
+msgstr "â€credential-cache--daemon†ej tillgänglig; stöd för unix-uttag saknas"
msgid "credential-cache unavailable; no unix socket support"
-msgstr "\"credential-cache\" ej tillgänglig; stöd för unix-uttag saknas"
+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 "kunde inte erhålla låset för lagring av inlogginsuppgifter på %d ms"
-msgid "git describe [<options>] [<commit-ish>...]"
-msgstr "git describe [<flaggor>] [<incheckning-igt>...]"
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"
+msgstr ""
+"git describe [--all] [--tag] [--contains] [--abbrev=<n>] [<incheckning-"
+"igt>...]"
+
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<märke>]"
-msgid "git describe [<options>] --dirty"
-msgstr "git describe [<flaggor>] --dirty"
+msgid "git describe <blob>"
+msgstr "git describe <objekt>"
msgid "head"
msgstr "huvud"
@@ -5192,11 +5315,11 @@ msgstr "den annoterade taggen %s inte tillgänglig"
#, c-format
msgid "tag '%s' is externally known as '%s'"
-msgstr "taggen \"%s\" är utanför känd som \"%s\""
+msgstr "taggen â€%s†är utanför känd som â€%sâ€"
#, c-format
msgid "no tag exactly matches '%s'"
-msgstr "ingen tagg motsvarar \"%s\" exakt"
+msgstr "ingen tagg motsvarar â€%s†exakt"
#, c-format
msgid "No exact match on refs or tags, searching to describe\n"
@@ -5212,7 +5335,7 @@ msgid ""
"No annotated tags can describe '%s'.\n"
"However, there were unannotated tags: try --tags."
msgstr ""
-"Inga annoterade taggar kan beskriva \"%s\".\n"
+"Inga annoterade taggar kan beskriva â€%sâ€.\n"
"Det finns dock oannoterade taggar: testa --tags."
#, c-format
@@ -5220,7 +5343,7 @@ msgid ""
"No tags can describe '%s'.\n"
"Try --always, or create some tags."
msgstr ""
-"Inga taggar kan beskriva \"%s\".\n"
+"Inga taggar kan beskriva â€%sâ€.\n"
"Testa --always, eller skapa några taggar."
#, c-format
@@ -5284,24 +5407,44 @@ msgid "mark"
msgstr "märke"
msgid "append <mark> on dirty working tree (default: \"-dirty\")"
-msgstr "lägg till <märke> på lortigt arbetsträd (standard: \"-dirty\")"
+msgstr "lägg till <märke> pÃ¥ lortigt arbetsträd (standard: â€-dirtyâ€)"
msgid "append <mark> on broken working tree (default: \"-broken\")"
-msgstr "lägg till <märke> på trasigt arbetsträd (standard: \"-broken\")"
+msgstr "lägg till <märke> pÃ¥ trasigt arbetsträd (standard: â€-brokenâ€)"
msgid "No names found, cannot describe anything."
msgstr "Inga namn hittades, kan inte beskriva något."
#, c-format
msgid "option '%s' and commit-ishes cannot be used together"
-msgstr "flaggorna \"%s\" och incheckning-igter kan inte användas samtidigt"
+msgstr "flaggorna â€%s†och incheckning-igter kan inte användas samtidigt"
+
+msgid ""
+"git diagnose [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--mode=<mode>]"
+msgstr ""
+"git diagnose [(-o | --output-directory) <sökväg>] [(-s | --suffix) "
+"<format>]\n"
+" [--mode=<läge>]"
+
+msgid "specify a destination for the diagnostics archive"
+msgstr "ange mål för diagnostikarkivet"
+
+msgid "specify a strftime format suffix for the filename"
+msgstr "ange ett filändelse i strftime-format"
+
+msgid "specify the content of the diagnostic archive"
+msgstr "ange vilket innehåll diagnostikarkivet ska ha"
msgid "--merge-base only works with two commits"
msgstr "--merge-base fungerar endast med två incheckningar"
#, c-format
msgid "'%s': not a regular file or symlink"
-msgstr "\"%s\": inte en normal fil eller symbolisk länk"
+msgstr "â€%sâ€: inte en normal fil eller symbolisk länk"
+
+msgid "no merge given, only parents."
+msgstr "ingen sammanslagning angiven, endast föräldrar."
#, c-format
msgid "invalid option: %s"
@@ -5316,15 +5459,15 @@ msgstr "Inte ett git-arkiv"
#, c-format
msgid "invalid object '%s' given."
-msgstr "objektet \"%s\" som angavs är felaktigt."
+msgstr "objektet â€%s†som angavs är felaktigt."
#, c-format
msgid "more than two blobs given: '%s'"
-msgstr "mer än två blobbar angavs: \"%s\""
+msgstr "mer än tvÃ¥ blobbar angavs: â€%sâ€"
#, c-format
msgid "unhandled object '%s' given."
-msgstr "ej hanterat objekt \"%s\" angavs."
+msgstr "ej hanterat objekt â€%s†angavs."
#, c-format
msgid "%s...%s: multiple merge bases, using %s"
@@ -5350,23 +5493,23 @@ msgid ""
"combined diff formats ('-c' and '--cc') are not supported in\n"
"directory diff mode ('-d' and '--dir-diff')."
msgstr ""
-"kombinerade diff-format (\"-c\" och \"--cc\") stöds inte i\n"
-"katalogdiffläge (\"-d\" och \"--dir-diff\")."
+"kombinerade diff-format (â€-c†och â€--ccâ€) stöds inte i\n"
+"katalogdiffläge (â€-d†och â€--dir-diffâ€)."
#, c-format
msgid "both files modified: '%s' and '%s'."
-msgstr "bägge filerna ändrade: \"%s\" och \"%s\"."
+msgstr "bägge filerna ändrade: â€%s†och â€%sâ€."
msgid "working tree file has been left."
msgstr "filen i arbetskatalogen lämnades kvar."
#, c-format
msgid "could not copy '%s' to '%s'"
-msgstr "kunde inte kopiera in \"%s\" till \"%s\""
+msgstr "kunde inte kopiera in â€%s†till â€%sâ€"
#, c-format
msgid "temporary files exist in '%s'."
-msgstr "temporära filer finns i \"%s\"."
+msgstr "temporära filer finns i â€%sâ€."
msgid "you may want to cleanup or recover these."
msgstr "du kanske vill städa eller rädda dem."
@@ -5376,7 +5519,7 @@ msgid "failed: %d"
msgstr "misslyckades: %d"
msgid "use `diff.guitool` instead of `diff.tool`"
-msgstr "använd \"diff.guitool\" istället för \"diff.tool\""
+msgstr "använd â€diff.guitool†istället för â€diff.toolâ€"
msgid "perform a full-directory diff"
msgstr "utför diff för hela katalogen"
@@ -5394,20 +5537,20 @@ msgid "use the specified diff tool"
msgstr "använd angivet diff-verktyg"
msgid "print a list of diff tools that may be used with `--tool`"
-msgstr "visa en lista över diff-verktyg som kan användas med \"--tool\""
+msgstr "visa en lista över diff-verktyg som kan användas med â€--toolâ€"
msgid ""
"make 'git-difftool' exit when an invoked diff tool returns a non-zero exit "
"code"
msgstr ""
-"låt \"git-difftool\" avsluta när ett anropat diff-verktyg ger returvärde "
-"skilt från noll"
+"lÃ¥t â€git-difftool†avsluta när ett anropat diff-verktyg ger returvärde skilt "
+"från noll"
msgid "specify a custom command for viewing diffs"
msgstr "ange eget kommando för att visa diffar"
msgid "passed to `diff`"
-msgstr "sändes till \"diff\""
+msgstr "sändes till â€diffâ€"
msgid "difftool requires worktree or --no-index"
msgstr "difftool kräver en arbetskatalog eller --no-index"
@@ -5418,29 +5561,6 @@ msgstr "inget <verktyg> angavs för --tool=<verktyg>"
msgid "no <cmd> given for --extcmd=<cmd>"
msgstr "inget <kommando> angavs för --extcmd=<kommando>"
-msgid "git env--helper --type=[bool|ulong] <options> <env-var>"
-msgstr "git env--helper --type=[bool|ulong] <flaggor> <miljövariabel>"
-
-msgid "default for git_env_*(...) to fall back on"
-msgstr "standard för git_env_*(...) att falla tillbaka på"
-
-msgid "be quiet only use git_env_*() value as exit code"
-msgstr "var tyst, använd bara git_env_*() som resultatvärde"
-
-#, c-format
-msgid "option `--default' expects a boolean value with `--type=bool`, not `%s`"
-msgstr ""
-"flaggan \"--default\" förväntar ett sanningsvärde med \"--type=bool\", inte "
-"\"%s\""
-
-#, c-format
-msgid ""
-"option `--default' expects an unsigned long value with `--type=ulong`, not `"
-"%s`"
-msgstr ""
-"flaggan \"--default\" förväntar ett teckenlöst långt värde med \"--type=ulong"
-"\", inte \"%s\""
-
msgid "git fast-export [<rev-list-opts>]"
msgstr "git fast-export [<rev-list-flaggor>]"
@@ -5509,26 +5629,26 @@ msgstr "märk taggar med märke-id"
#, c-format
msgid "Missing from marks for submodule '%s'"
-msgstr "Saknar från-märken för undermodulen \"%s\""
+msgstr "Saknar frÃ¥n-märken för undermodulen â€%sâ€"
#, c-format
msgid "Missing to marks for submodule '%s'"
-msgstr "Saknar till-märken för undermodulen \"%s\""
+msgstr "Saknar till-märken för undermodulen â€%sâ€"
#, c-format
msgid "Expected 'mark' command, got %s"
-msgstr "Förväntade \"mark\"-kommando, fick %s"
+msgstr "Förväntade â€markâ€-kommando, fick %s"
#, c-format
msgid "Expected 'to' command, got %s"
-msgstr "Förväntade \"to\"-kommando, fick %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"
#, c-format
msgid "feature '%s' forbidden in input without --allow-unsafe-features"
-msgstr "funktionen \"%s\" förbjuden i indata utan --allow-unsafe-features"
+msgstr "funktionen â€%s†förbjuden i indata utan --allow-unsafe-features"
#, c-format
msgid "Lockfile created but not reported: %s"
@@ -5549,116 +5669,14 @@ msgstr "git fetch --all [<flaggor>]"
msgid "fetch.parallel cannot be negative"
msgstr "fetch.parallel kan inte vara negativt"
-msgid "fetch from all remotes"
-msgstr "hämta från alla fjärrar"
-
-msgid "set upstream for git pull/fetch"
-msgstr "ställ in uppström för git pull/fetch"
-
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "lägg till i .git/FETCH_HEAD istället för att skriva över"
-
-msgid "use atomic transaction to update references"
-msgstr "använd atomiska transaktioner för att uppdatera referenser"
-
-msgid "path to upload pack on remote end"
-msgstr "sökväg till upload pack på fjärren"
-
-msgid "force overwrite of local reference"
-msgstr "tvinga överskrivning av lokal referens"
-
-msgid "fetch from multiple remotes"
-msgstr "hämta från flera fjärrar"
-
-msgid "fetch all tags and associated objects"
-msgstr "hämta alla taggar och associerade objekt"
-
-msgid "do not fetch all tags (--no-tags)"
-msgstr "hämta inte alla taggar (--no-tags)"
-
-msgid "number of submodules fetched in parallel"
-msgstr "antal undermoduler som hämtas parallellt"
-
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr ""
-"modifiera referensspecifikationen så att alla referenser hamnar i refs/"
-"prefetch/"
-
-msgid "prune remote-tracking branches no longer on remote"
-msgstr "rensa fjärrspårande grenar ej längre på fjärren"
-
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr ""
-"rensa lokala taggar inte längre på fjärren och skriv över ändrade taggar"
-
-msgid "on-demand"
-msgstr "on-demand"
-
-msgid "control recursive fetching of submodules"
-msgstr "styr rekursiv hämtning av undermoduler"
-
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "skriv hämtade referenser till FETCH_HEAD-filen"
-
-msgid "keep downloaded pack"
-msgstr "behåll hämtade paket"
-
-msgid "allow updating of HEAD ref"
-msgstr "tillåt uppdatering av HEAD-referens"
-
-msgid "deepen history of shallow clone"
-msgstr "fördjupa historik för grund klon"
-
-msgid "deepen history of shallow repository based on time"
-msgstr "fördjupa historik för grund klon baserad på tid"
-
-msgid "convert to a complete repository"
-msgstr "konvertera till komplett arkiv"
-
-msgid "re-fetch without negotiating common commits"
-msgstr "hämta om utan att förhandla om gemensamma incheckningar"
-
-msgid "prepend this to submodule path output"
-msgstr "lägg till i början av undermodulens sökvägsutdata"
-
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr ""
-"standard för rekursiv hämtning av undermoduler (lägre prioritet än "
-"konfigurationsfiler)"
-
-msgid "accept refs that update .git/shallow"
-msgstr "tar emot referenser som uppdaterar .git/shallow"
-
-msgid "refmap"
-msgstr "referenskarta"
-
-msgid "specify fetch refmap"
-msgstr "ange referenskarta för \"fetch\""
-
-msgid "report that we have only objects reachable from this object"
-msgstr "rapportera att vi bara har objekt nåbara från detta objektet"
-
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr "hämta inte paketfil; skriv istället förfäder till förhandlingstips"
-
-msgid "run 'maintenance --auto' after fetching"
-msgstr "kör \"maintenance --auto\" efter hämtning"
-
-msgid "check for forced-updates on all updated branches"
-msgstr "se efter tvingade uppdateringar i alla uppdaterade grenar"
-
-msgid "write the commit-graph after fetching"
-msgstr "skriv incheckingsgrafen efter hämtning"
-
-msgid "accept refspecs from stdin"
-msgstr "ta emot referenser från standard in"
-
msgid "couldn't find remote ref HEAD"
msgstr "kunde inte hitta fjärr-referensen HEAD"
#, c-format
+msgid "From %.*s\n"
+msgstr "Från %.*s\n"
+
+#, c-format
msgid "object %s not found"
msgstr "objektet %s hittades inte"
@@ -5668,11 +5686,8 @@ msgstr "[àjour]"
msgid "[rejected]"
msgstr "[refuserad]"
-msgid "can't fetch in current branch"
-msgstr "kan inte hämta i aktuell gren"
-
-msgid "checked out in another worktree"
-msgstr "utcheckat i en annan arbetskatalog"
+msgid "can't fetch into checked-out branch"
+msgstr "kan inte hämta i utcheckad gren"
msgid "[tag update]"
msgstr "[uppdaterad tagg]"
@@ -5700,7 +5715,7 @@ msgstr "ej snabbspolad"
#, c-format
msgid "cannot open '%s'"
-msgstr "kan inte öppna \"%s\""
+msgstr "kan inte öppna â€%sâ€"
msgid ""
"fetch normally indicates which branches had a forced update,\n"
@@ -5709,8 +5724,8 @@ msgid ""
msgstr ""
"fetch visar normalt vilka grenar som tvångsuppdaterats, men testet har "
"slagits\n"
-"av; för att slå på igen, använd flaggan \"--show-forced-updates\" eller kör\n"
-"\"git config fetch.showForcedUpdates true\""
+"av; för att slÃ¥ pÃ¥ igen, använd flaggan â€--show-forced-updates†eller kör\n"
+"â€git config fetch.showForcedUpdates trueâ€"
#, c-format
msgid ""
@@ -5720,9 +5735,8 @@ msgid ""
"to avoid this check\n"
msgstr ""
"det tog %.2f sekunder att se efter tvångsuppdateringar; Du kan använda\n"
-"\"--no-show-forced-updates\" eller köra \"git config fetch."
-"showForcedUpdates\n"
-"false\" för att undvika testet\n"
+"â€--no-show-forced-updates†eller köra â€git config fetch.showForcedUpdates\n"
+"false†för att undvika testet\n"
#, c-format
msgid "%s did not send all necessary objects\n"
@@ -5733,16 +5747,12 @@ msgid "rejected %s because shallow roots are not allowed to be updated"
msgstr "avvisade %s då grunda rötter inte tillåts uppdateras"
#, c-format
-msgid "From %.*s\n"
-msgstr "Från %.*s\n"
-
-#, c-format
msgid ""
"some local refs could not be updated; try running\n"
" 'git remote prune %s' to remove any old, conflicting branches"
msgstr ""
"vissa lokala referenser kunde inte uppdateras; testa att köra\n"
-" \"git remote prune %s\" för att ta bort gamla grenar som står i konflikt"
+" â€git remote prune %s†för att ta bort gamla grenar som stÃ¥r i konflikt"
#, c-format
msgid " (%s will become dangling)"
@@ -5760,15 +5770,15 @@ msgstr "(ingen)"
#, c-format
msgid "refusing to fetch into branch '%s' checked out at '%s'"
-msgstr "vägrar hämta till grenen \"%s\" som är utcheckad på \"%s\""
+msgstr "vägrar hämta till grenen â€%s†som är utcheckad pÃ¥ â€%sâ€"
#, c-format
msgid "option \"%s\" value \"%s\" is not valid for %s"
-msgstr "flaggan \"%s\" med värdet \"%s\" är inte giltigt för %s"
+msgstr "flaggan â€%s†med värdet â€%s†är inte giltigt för %s"
#, c-format
msgid "option \"%s\" is ignored for %s\n"
-msgstr "flaggan \"%s\" ignoreras för %s\n"
+msgstr "flaggan â€%s†ignoreras för %s\n"
#, c-format
msgid "%s is not a valid object"
@@ -5786,8 +5796,8 @@ msgid ""
"could not set upstream of HEAD to '%s' from '%s' when it does not point to "
"any branch."
msgstr ""
-"kunde inte sätta uppström för HEAD till \"%s\" från \"%s\" när det inte "
-"pekar mot någon gren."
+"kunde inte sätta uppström för HEAD till â€%s†frÃ¥n â€%s†när det inte pekar "
+"mot någon gren."
msgid "not setting upstream for a remote remote-tracking branch"
msgstr "ställer inte in uppströmsgren för en fjärrspårande gren på fjärren"
@@ -5815,7 +5825,7 @@ msgstr "kunde inte hämta %s"
#, c-format
msgid "could not fetch '%s' (exit code: %d)\n"
-msgstr "kunde inte hämta \"%s\" (felkod: %d)\n"
+msgstr "kunde inte hämta â€%s†(felkod: %d)\n"
msgid ""
"no remote repository specified; please specify either a URL or a\n"
@@ -5827,6 +5837,112 @@ msgstr ""
msgid "you need to specify a tag name"
msgstr "du måste ange namnet på en tagg"
+msgid "fetch from all remotes"
+msgstr "hämta från alla fjärrar"
+
+msgid "set upstream for git pull/fetch"
+msgstr "ställ in uppström för git pull/fetch"
+
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "lägg till i .git/FETCH_HEAD istället för att skriva över"
+
+msgid "use atomic transaction to update references"
+msgstr "använd atomiska transaktioner för att uppdatera referenser"
+
+msgid "path to upload pack on remote end"
+msgstr "sökväg till upload pack på fjärren"
+
+msgid "force overwrite of local reference"
+msgstr "tvinga överskrivning av lokal referens"
+
+msgid "fetch from multiple remotes"
+msgstr "hämta från flera fjärrar"
+
+msgid "fetch all tags and associated objects"
+msgstr "hämta alla taggar och associerade objekt"
+
+msgid "do not fetch all tags (--no-tags)"
+msgstr "hämta inte alla taggar (--no-tags)"
+
+msgid "number of submodules fetched in parallel"
+msgstr "antal undermoduler som hämtas parallellt"
+
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+"modifiera referensspecifikationen så att alla referenser hamnar i refs/"
+"prefetch/"
+
+msgid "prune remote-tracking branches no longer on remote"
+msgstr "rensa fjärrspårande grenar ej längre på fjärren"
+
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr ""
+"rensa lokala taggar inte längre på fjärren och skriv över ändrade taggar"
+
+msgid "on-demand"
+msgstr "on-demand"
+
+msgid "control recursive fetching of submodules"
+msgstr "styr rekursiv hämtning av undermoduler"
+
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "skriv hämtade referenser till FETCH_HEAD-filen"
+
+msgid "keep downloaded pack"
+msgstr "behåll hämtade paket"
+
+msgid "allow updating of HEAD ref"
+msgstr "tillåt uppdatering av HEAD-referens"
+
+msgid "deepen history of shallow clone"
+msgstr "fördjupa historik för grund klon"
+
+msgid "deepen history of shallow repository based on time"
+msgstr "fördjupa historik för grund klon baserad på tid"
+
+msgid "convert to a complete repository"
+msgstr "konvertera till komplett arkiv"
+
+msgid "re-fetch without negotiating common commits"
+msgstr "hämta om utan att förhandla om gemensamma incheckningar"
+
+msgid "prepend this to submodule path output"
+msgstr "lägg till i början av undermodulens sökvägsutdata"
+
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+"standard för rekursiv hämtning av undermoduler (lägre prioritet än "
+"konfigurationsfiler)"
+
+msgid "accept refs that update .git/shallow"
+msgstr "tar emot referenser som uppdaterar .git/shallow"
+
+msgid "refmap"
+msgstr "referenskarta"
+
+msgid "specify fetch refmap"
+msgstr "ange referenskarta för â€fetchâ€"
+
+msgid "report that we have only objects reachable from this object"
+msgstr "rapportera att vi bara har objekt nåbara från detta objektet"
+
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr "hämta inte paketfil; skriv istället förfäder till förhandlingstips"
+
+msgid "run 'maintenance --auto' after fetching"
+msgstr "kör â€maintenance --auto†efter hämtning"
+
+msgid "check for forced-updates on all updated branches"
+msgstr "se efter tvingade uppdateringar i alla uppdaterade grenar"
+
+msgid "write the commit-graph after fetching"
+msgstr "skriv incheckingsgrafen efter hämtning"
+
+msgid "accept refspecs from stdin"
+msgstr "ta emot referenser från standard in"
+
msgid "--negotiate-only needs one or more --negotiation-tip=*"
msgstr "--negotiate-only behöver en eller flera --negotiation-tip=*"
@@ -5836,6 +5952,10 @@ msgstr "negativa djup stöds inte i --deepen"
msgid "--unshallow on a complete repository does not make sense"
msgstr "--unshallow kan inte användas på ett komplett arkiv"
+#, c-format
+msgid "failed to fetch bundles from '%s'"
+msgstr "misslyckades hämta buntar frÃ¥n â€%sâ€"
+
msgid "fetch --all does not take a repository argument"
msgstr "fetch --all tar inte namnet på ett arkiv som argument"
@@ -5938,8 +6058,14 @@ msgstr "visa endast referenser som innehåller incheckningen"
msgid "print only refs which don't contain the commit"
msgstr "visa endast referenser som inte innehåller incheckningen"
-msgid "git for-each-repo --config=<config> <command-args>"
-msgstr "git for-each-repo --config=<konfig> <kommandoargument>"
+msgid "read reference patterns from stdin"
+msgstr "läs referensmönster från standard in"
+
+msgid "unknown arguments supplied with --stdin"
+msgstr "okända argument angavs tillsammans med --stdin"
+
+msgid "git for-each-repo --config=<config> [--] <arguments>"
+msgstr "git for-each-repo --config=<konfig> [--] <argument>"
msgid "config"
msgstr "konfig"
@@ -5950,6 +6076,10 @@ msgstr "konfigurationsnyckel som innehåller en lista över arkivsökvägar"
msgid "missing --config=<config>"
msgstr "saknar --config=<konfig>"
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "fick felaktig konfiguration --config=%s"
+
msgid "unknown"
msgstr "okänd"
@@ -6000,11 +6130,11 @@ msgstr "kunde inte skapa lost-found"
#, c-format
msgid "could not write '%s'"
-msgstr "kunde inte skriva \"%s\""
+msgstr "kunde inte skriva â€%sâ€"
#, c-format
msgid "could not finish '%s'"
-msgstr "kunde inte avsluta \"%s\""
+msgstr "kunde inte avsluta â€%sâ€"
#, c-format
msgid "Checking %s"
@@ -6041,7 +6171,7 @@ msgstr "%s: ogiltig reflog-post %s"
#, c-format
msgid "Checking reflog %s->%s"
-msgstr "Kontrollerar reflog %s->%s"
+msgstr "Kontrollerar reflog %s→%s"
#, c-format
msgid "%s: invalid sha1 pointer %s"
@@ -6064,7 +6194,7 @@ msgstr "%s: objektet trasigt eller saknas: %s"
#, c-format
msgid "%s: object is of unknown type '%s': %s"
-msgstr "%s: objektet har okänd typ \"%s\": %s"
+msgstr "%s: objektet har okänd typ â€%sâ€: %s"
#, c-format
msgid "%s: object could not be parsed: %s"
@@ -6100,18 +6230,39 @@ msgstr "%s: frånkopplat HEAD pekar på ingenting"
msgid "notice: %s points to an unborn branch (%s)"
msgstr "obs: %s pekar på en ofödd gren (%s)"
-msgid "Checking cache tree"
-msgstr "Kontrollerar cacheträd"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "Kontrollerar cacheträd för %s"
#, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "%s: ogiltig sha1-pekare i cacheträd"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s: ogiltig sha1-pekare i cacheträd för %s"
msgid "non-tree in cache-tree"
msgstr "icke-träd i cacheträd"
-msgid "git fsck [<options>] [<object>...]"
-msgstr "git fsck [<flaggor>] [<objekt>...]"
+#, c-format
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s: ogiltig sha1-pekare i resolve-undo för %s"
+
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "kunde inte läsa rev-index för paketfil â€%sâ€"
+
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "ogiltigt rev-index för paketet â€%sâ€"
+
+msgid ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<object>...]"
+msgstr ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<objekt>...]"
msgid "show unreachable objects"
msgstr "visa onåbara objekt"
@@ -6160,7 +6311,7 @@ msgstr "%s: objekt saknas"
#, c-format
msgid "invalid parameter: expected sha1, got '%s'"
-msgstr "ogiltig parameter: förväntade sha1, fick \"%s\""
+msgstr "ogiltig parameter: förväntade sha1, fick â€%sâ€"
msgid "git fsmonitor--daemon start [<options>]"
msgstr "git fsmonitor--daemon start [<flaggor>]"
@@ -6168,31 +6319,25 @@ msgstr "git fsmonitor--daemon start [<flaggor>]"
msgid "git fsmonitor--daemon run [<options>]"
msgstr "git fsmonitor--daemon run [<flaggor>]"
-msgid "git fsmonitor--daemon stop"
-msgstr "git fsmonitor--daemon stop"
-
-msgid "git fsmonitor--daemon status"
-msgstr "git fsmonitor--daemon status"
-
#, c-format
msgid "value of '%s' out of range: %d"
-msgstr "värdet för \"%s\" utanför intervallet: %d"
+msgstr "värdet för â€%s†utanför intervallet: %d"
#, c-format
msgid "value of '%s' not bool or int: %d"
-msgstr "värdet för \"%s\" är inte bool eller int: %d"
+msgstr "värdet för â€%s†är inte bool eller int: %d"
#, c-format
msgid "fsmonitor-daemon is watching '%s'\n"
-msgstr "fsmonitor-daemon bevakar \"%s\"\n"
+msgstr "fsmonitor-daemon bevakar â€%sâ€\n"
#, c-format
msgid "fsmonitor-daemon is not watching '%s'\n"
-msgstr "fsmonitor-daemon bevakar inte \"%s\"\n"
+msgstr "fsmonitor-daemon bevakar inte â€%sâ€\n"
#, c-format
msgid "could not create fsmonitor cookie '%s'"
-msgstr "kunde inte skapa fsmonitor-kaka \"%s\""
+msgstr "kunde inte skapa fsmonitor-kaka â€%sâ€"
#, c-format
msgid "fsmonitor: cookie_result '%d' != SEEN"
@@ -6200,7 +6345,7 @@ msgstr "fsmonitor: cookie_result '%d' != SEEN"
#, c-format
msgid "could not start IPC thread pool on '%s'"
-msgstr "kunde inte starta IPC-trådpol på \"%s\""
+msgstr "kunde inte starta IPC-trÃ¥dpol pÃ¥ â€%sâ€"
msgid "could not start fsmonitor listener thread"
msgstr "kunde inte starta fsmonitor-lyssnartråd"
@@ -6216,19 +6361,19 @@ msgstr "kunde inte initiera hälsotråd"
#, c-format
msgid "could not cd home '%s'"
-msgstr "kunde inte byta katalog hem \"%s\""
+msgstr "kunde inte byta katalog hem â€%sâ€"
#, c-format
msgid "fsmonitor--daemon is already running '%s'"
-msgstr "fsmonitor--daemon körs redan på \"%s\""
+msgstr "fsmonitor--daemon körs redan pÃ¥ â€%sâ€"
#, c-format
msgid "running fsmonitor-daemon in '%s'\n"
-msgstr "kör fsmonitor-daemon i \"%s\"\n"
+msgstr "kör fsmonitor-daemon i â€%sâ€\n"
#, c-format
msgid "starting fsmonitor-daemon in '%s'\n"
-msgstr "startar fsmonitor-daemon i \"%s\"\n"
+msgstr "startar fsmonitor-daemon i â€%sâ€\n"
msgid "daemon failed to start"
msgstr "serverprocessen kunde inte startas"
@@ -6250,11 +6395,11 @@ msgstr "max sekunder att vänta på att serverprocessen startar"
#, c-format
msgid "invalid 'ipc-threads' value (%d)"
-msgstr "ogiltigt värde för \"ipc-threads\" (%d)"
+msgstr "ogiltigt värde för â€ipc-threads†(%d)"
#, c-format
msgid "Unhandled subcommand '%s'"
-msgstr "Ej hanterat underkommando \"%s\""
+msgstr "Ej hanterat underkommando â€%sâ€"
msgid "fsmonitor--daemon not supported on this platform"
msgstr "fsmonitor--daemon stöds inte på denna plattform"
@@ -6268,11 +6413,11 @@ msgstr "Misslyckades ta status (fstat) på %s: %s"
#, c-format
msgid "failed to parse '%s' value '%s'"
-msgstr "misslyckades tolka \"%s\" värde \"%s\""
+msgstr "misslyckades tolka â€%s†värde â€%sâ€"
#, c-format
msgid "cannot stat '%s'"
-msgstr "kan inte ta status på \"%s\""
+msgstr "kan inte ta status pÃ¥ â€%sâ€"
#, c-format
msgid ""
@@ -6294,6 +6439,9 @@ msgstr "rensa ej refererade objekt"
msgid "pack unreferenced objects separately"
msgstr "packa ej refererade objekt separat"
+msgid "with --cruft, limit the size of new cruft packs"
+msgstr "med --cruft, begränsa storleken på nya onödiga paket"
+
msgid "be more thorough (increased runtime)"
msgstr "var mer grundlig (ökar körtiden)"
@@ -6324,20 +6472,19 @@ msgstr "Packar arkivet automatiskt för optimal prestanda.\n"
#, c-format
msgid "See \"git help gc\" for manual housekeeping.\n"
-msgstr "Se \"git help gc\" för manuell hushållning.\n"
+msgstr "Se â€git help gc†för manuell hushÃ¥llning.\n"
#, c-format
msgid ""
"gc is already running on machine '%s' pid %<PRIuMAX> (use --force if not)"
msgstr ""
-"gc körs redan på maskinen \"%s\" pid %<PRIuMAX> (använd --force om så inte "
-"är fallet)"
+"gc körs redan pÃ¥ maskinen â€%s†pid %<PRIuMAX> (använd --force om sÃ¥ inte är "
+"fallet)"
msgid ""
"There are too many unreachable loose objects; run 'git prune' to remove them."
msgstr ""
-"Det finns för många onåbara lösa objekt; kör \"git prune\" för att ta bort "
-"dem."
+"Det finns för mÃ¥nga onÃ¥bara lösa objekt; kör â€git prune†för att ta bort dem."
msgid ""
"git maintenance run [--auto] [--[no-]quiet] [--task=<task>] [--schedule]"
@@ -6358,41 +6505,41 @@ msgid "failed to prefetch remotes"
msgstr "kunde inte förhämta fjärrar"
msgid "failed to start 'git pack-objects' process"
-msgstr "kunde inte starta \"git pack-objects\"-process"
+msgstr "kunde inte starta â€git pack-objectsâ€-process"
msgid "failed to finish 'git pack-objects' process"
-msgstr "kunde inte avsluta \"git pack-objects\"-process"
+msgstr "kunde inte avsluta â€git pack-objectsâ€-process"
msgid "failed to write multi-pack-index"
msgstr "kunde inte skriva multi-pack-index"
msgid "'git multi-pack-index expire' failed"
-msgstr "\"git multi-pack-index expire\" misslyckades"
+msgstr "â€git multi-pack-index expire†misslyckades"
msgid "'git multi-pack-index repack' failed"
-msgstr "\"git multi-pack-index repack\" misslyckades"
+msgstr "â€git multi-pack-index repack†misslyckades"
msgid ""
"skipping incremental-repack task because core.multiPackIndex is disabled"
msgstr ""
-"hoppar över \"incremental-repack\"-uppgift eftersom core.multiPackIndex är "
+"hoppar över â€incremental-repackâ€-uppgift eftersom core.multiPackIndex är "
"inaktiverat"
#, c-format
msgid "lock file '%s' exists, skipping maintenance"
-msgstr "låsfilen \"%s\" finns, hoppar över underhåll"
+msgstr "lÃ¥sfilen â€%s†finns, hoppar över underhÃ¥ll"
#, c-format
msgid "task '%s' failed"
-msgstr "uppgiften \"%s\" misslyckades"
+msgstr "uppgiften â€%s†misslyckades"
#, c-format
msgid "'%s' is not a valid task"
-msgstr "\"%s\" är inte en giltig uppgift"
+msgstr "â€%s†är inte en giltig uppgift"
#, c-format
msgid "task '%s' cannot be selected multiple times"
-msgstr "uppgiften \"%s\" kan inte väljas flera gånger"
+msgstr "uppgiften â€%s†kan inte väljas flera gÃ¥nger"
msgid "run tasks based on the state of the repository"
msgstr "kör uppgifter baserad på arkivets tillstånd"
@@ -6415,19 +6562,31 @@ msgstr "utför en specifik uppgift"
msgid "use at most one of --auto and --schedule=<frequency>"
msgstr "använd som mest en av --auto och --schedule=<frekvens>"
-msgid "failed to run 'git config'"
-msgstr "misslyckades köra \"git config\""
+#, c-format
+msgid "unable to add '%s' value of '%s'"
+msgstr "kan inte lägga till â€%sâ€-värdet för â€%sâ€"
+
+msgid "return success even if repository was not registered"
+msgstr "returnera framgång även om arkivet inte var registrerat"
+
+#, c-format
+msgid "unable to unset '%s' value of '%s'"
+msgstr "kan inte ta bort â€%sâ€-värdet för â€%sâ€"
+
+#, c-format
+msgid "repository '%s' is not registered"
+msgstr "arkivet â€%s†har inte registrerats"
#, c-format
msgid "failed to expand path '%s'"
-msgstr "misslyckades expandera sökvägen \"%s\""
+msgstr "misslyckades expandera sökvägen â€%sâ€"
msgid "failed to start launchctl"
msgstr "misslyckades starta launchctl"
#, c-format
msgid "failed to create directories for '%s'"
-msgstr "misslyckades skapa kataloger för \"%s\""
+msgstr "misslyckades skapa kataloger för â€%sâ€"
#, c-format
msgid "failed to bootstrap service %s"
@@ -6440,35 +6599,37 @@ msgid "failed to start schtasks"
msgstr "misslyckades starta schtasks"
msgid "failed to run 'crontab -l'; your system might not support 'cron'"
-msgstr ""
-"kunde inte köra \"crontab -l\"; ditt system kanske inte stöder \"cron\""
+msgstr "misslyckades köra â€crontab -lâ€; ditt system kanske inte stöder â€cronâ€"
-msgid "failed to run 'crontab'; your system might not support 'cron'"
-msgstr "kunde inte köra \"crontab\"; ditt system kanske inte stöder \"cron\""
+msgid "failed to create crontab temporary file"
+msgstr "misslyckades skapa temporär crontab-fil"
-msgid "failed to open stdin of 'crontab'"
-msgstr "misslyckades öppna standard in för \"crontab\""
+msgid "failed to open temporary file"
+msgstr "misslyckades öppna temporär fil"
-msgid "'crontab' died"
-msgstr "\"crontab\" dog"
-
-msgid "failed to start systemctl"
-msgstr "misslyckades starta systemctl"
+msgid "failed to run 'crontab'; your system might not support 'cron'"
+msgstr "misslyckades köra â€crontabâ€; ditt system kanske inte stöder â€cronâ€"
-msgid "failed to run systemctl"
-msgstr "misslyckades att köra systemctl"
+msgid "'crontab' died"
+msgstr "â€crontab†dog"
#, c-format
msgid "failed to delete '%s'"
-msgstr "misslyckades ta bort \"%s\""
+msgstr "misslyckades ta bort â€%sâ€"
#, c-format
msgid "failed to flush '%s'"
-msgstr "misslyckades spola \"%s\""
+msgstr "misslyckades spola â€%sâ€"
+
+msgid "failed to start systemctl"
+msgstr "misslyckades starta systemctl"
+
+msgid "failed to run systemctl"
+msgstr "misslyckades att köra systemctl"
#, c-format
msgid "unrecognized --scheduler argument '%s'"
-msgstr "okänt argument för --scheduler, \"%s\""
+msgstr "okänt argument för --scheduler, â€%sâ€"
msgid "neither systemd timers nor crontab are available"
msgstr "varken systemd-timer eller crontab är tillgänglig"
@@ -6487,7 +6648,10 @@ msgid "scheduler"
msgstr "schemaläggare"
msgid "scheduler to trigger git maintenance run"
-msgstr "schemaläggare som utlöser \"git maintenance\"-körning"
+msgstr "schemaläggare som utlöser â€git maintenanceâ€-körning"
+
+msgid "failed to set up maintenance schedule"
+msgstr "misslyckades uppdatera underhållsschema"
msgid "failed to add repo to global config"
msgstr "misslyckades lägga till arkiv till global konfiguration"
@@ -6495,10 +6659,6 @@ msgstr "misslyckades lägga till arkiv till global konfiguration"
msgid "git maintenance <subcommand> [<options>]"
msgstr "git maintenance <underkommando> [<flaggor>]"
-#, c-format
-msgid "invalid subcommand: %s"
-msgstr "felaktigt underkommando: %s"
-
msgid "git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]"
msgstr "git grep [<flaggor>] [-e] <mönster> [<rev>...] [[--] <sökväg>...]"
@@ -6524,12 +6684,16 @@ msgid "unable to read tree (%s)"
msgstr "kunde inte läsa träd (%s)"
#, c-format
+msgid "unable to read tree %s"
+msgstr "kunde inte läsa trädet %s"
+
+#, c-format
msgid "unable to grep from object of type %s"
-msgstr "kunde inte \"grep\" från objekt av typen %s"
+msgstr "kunde inte â€grep†frÃ¥n objekt av typen %s"
#, c-format
msgid "switch `%c' expects a numerical value"
-msgstr "flaggan \"%c\" antar ett numeriskt värde"
+msgstr "flaggan â€%c†antar ett numeriskt värde"
msgid "search in index instead of in the work tree"
msgstr "sök i indexet istället för i arbetskatalogen"
@@ -6541,7 +6705,7 @@ msgid "search in both tracked and untracked files"
msgstr "sök i både spårade och ospårade filer"
msgid "ignore files specified via '.gitignore'"
-msgstr "ignorera filer angivna i \".gitignore\""
+msgstr "ignorera filer angivna i â€.gitignoreâ€"
msgid "recursively search in each submodule"
msgstr "sök varje undermodul rekursivt"
@@ -6567,8 +6731,8 @@ msgstr "hantera binärfiler med textconv-filter"
msgid "search in subdirectories (default)"
msgstr "sök i underkataloger (standard)"
-msgid "descend at most <depth> levels"
-msgstr "gå som mest ned <djup> nivåer"
+msgid "descend at most <n> levels"
+msgstr "gå som mest ned <n> nivåer"
msgid "use extended POSIX regular expressions"
msgstr "använd utökade POSIX-reguljära uttryck"
@@ -6669,6 +6833,9 @@ msgstr "visa träffade filer i filbläddraren"
msgid "allow calling of grep(1) (ignored by this build)"
msgstr "tillåt anropa grep(1) (ignoreras av detta bygge)"
+msgid "maximum number of results per file"
+msgstr "maximalt antal resultat per fil"
+
msgid "no pattern given"
msgstr "inget mönster angavs"
@@ -6702,11 +6869,14 @@ msgid "both --cached and trees are given"
msgstr "både --cached och träd angavs"
msgid ""
-"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] "
-"[--] <file>..."
+"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
+" [--stdin [--literally]] [--] <file>..."
msgstr ""
-"git hash-object [-t <typ>] [-w] [--path=<fil> | --no-filters] [--stdin] [--] "
-"<fil>..."
+"git hash-object [-t <typ>] [-w] [--path=<fil> | --no-filters]\n"
+" [--stdin [--literally]] [--] <fil>..."
+
+msgid "git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]"
+msgstr "git hash-object [-t <typ>] [-w] --stdin-paths [--no-filters]"
msgid "object type"
msgstr "objekttyp"
@@ -6755,15 +6925,21 @@ msgstr "visa kommandobeskrivning"
msgid "print list of useful guides"
msgstr "lista användbara vägledningar"
+msgid "print list of user-facing repository, command and file interfaces"
+msgstr "lista arkiv-, kommando- och filgränssnitt tänkta för användare"
+
+msgid "print list of file formats, protocols and other developer interfaces"
+msgstr "lista filformat, protokoll och andra utvecklargränssnitt"
+
msgid "print all configuration variable names"
msgstr "visa namn på alla konfigurationsvariabler"
-msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>]"
-msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<kommando>]"
+msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"
+msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<kommando>|<doc>]"
#, c-format
msgid "unrecognized help format '%s'"
-msgstr "okänt hjälpformat: \"%s\""
+msgstr "okänt hjälpformat: â€%sâ€"
msgid "Failed to start emacsclient."
msgstr "Misslyckades starta emacsclient."
@@ -6773,31 +6949,31 @@ msgstr "Kunde inte tolka emacsclient-version."
#, c-format
msgid "emacsclient version '%d' too old (< 22)."
-msgstr "emacsclient version \"%d\" för gammal (< 22)."
+msgstr "emacsclient version â€%d†för gammal (< 22)."
#, c-format
msgid "failed to exec '%s'"
-msgstr "exec misslyckades för \"%s\""
+msgstr "exec misslyckades för â€%sâ€"
#, c-format
msgid ""
"'%s': path for unsupported man viewer.\n"
"Please consider using 'man.<tool>.cmd' instead."
msgstr ""
-"\"%s\": sökväg för man-visare som ej stöds.\n"
-"Använd \"man.<verktyg>.cmd\" istället."
+"â€%sâ€: sökväg för man-visare som ej stöds.\n"
+"Använd â€man.<verktyg>.cmd†istället."
#, c-format
msgid ""
"'%s': cmd for supported man viewer.\n"
"Please consider using 'man.<tool>.path' instead."
msgstr ""
-"\"%s\": kommando för man-visare som stöds.\n"
-"Använd \"man.<verktyg>.path\" istället."
+"â€%sâ€: kommando för man-visare som stöds.\n"
+"Använd â€man.<verktyg>.path†istället."
#, c-format
msgid "'%s': unknown man viewer."
-msgstr "\"%s\": okänd man-visare."
+msgstr "â€%sâ€: okänd man-visare."
msgid "no man viewer handled the request"
msgstr "ingen man-visare hanterade förfrågan"
@@ -6807,7 +6983,7 @@ msgstr "ingen info-visare hanterade förfrågan"
#, c-format
msgid "'%s' is aliased to '%s'"
-msgstr "\"%s\" är ett alias för \"%s\""
+msgstr "â€%s†är ett alias för â€%sâ€"
#, c-format
msgid "bad alias.%s string: %s"
@@ -6815,27 +6991,33 @@ msgstr "felaktig alias.%s-sträng: %s"
#, c-format
msgid "the '%s' option doesn't take any non-option arguments"
-msgstr "flaggan \"%s\" tar inte några argument som inte är flaggor"
+msgstr "flaggan â€%s†tar inte nÃ¥gra argument som inte är flaggor"
msgid ""
"the '--no-[external-commands|aliases]' options can only be used with '--all'"
msgstr ""
-"flaggorna '--no-[external-commands|aliases]' kan endast användas med \"--all"
-"\""
+"flaggorna '--no-[external-commands|aliases]' kan endast användas med â€--allâ€"
#, c-format
msgid "usage: %s%s"
msgstr "användning: %s%s"
msgid "'git help config' for more information"
-msgstr "\"git help config\" för mer information"
+msgstr "â€git help config†för mer information"
-msgid "git hook run [--ignore-missing] <hook-name> [-- <hook-args>]"
-msgstr "git hook run [--ignore-missing] <krok-namn> [-- <krok-argument>]"
+msgid ""
+"git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-"
+"args>]"
+msgstr ""
+"git hook run [--ignore-missing] [--to-stdin=<sökväg>] <krok-namn> [-- <krok-"
+"argument>]"
msgid "silently ignore missing requested <hook-name>"
msgstr "ignorera tyst om önskat <krok-namn> saknas"
+msgid "file to read into hooks' stdin"
+msgstr "misslyckades läsa till krokens standard in"
+
#, c-format
msgid "object type mismatch at %s"
msgstr "objekttyp stämmer inte överens vid %s"
@@ -6896,7 +7078,7 @@ msgid "unknown object type %d"
msgstr "okänd objekttyp %d"
msgid "cannot pread pack file"
-msgstr "kan inte utföra \"pread\" på paketfil"
+msgstr "kan inte utföra â€pread†pÃ¥ paketfil"
#, c-format
msgid "premature end of pack file, %<PRIuMAX> byte missing"
@@ -6912,10 +7094,6 @@ msgid "SHA1 COLLISION FOUND WITH %s !"
msgstr "SHA1-KOLLISION UPPTÄCKT VID %s !"
#, c-format
-msgid "unable to read %s"
-msgstr "kunde inte läsa %s"
-
-#, c-format
msgid "cannot read existing object info %s"
msgstr "kan inte läsa information om befintligt objekt %s"
@@ -6947,7 +7125,7 @@ msgid "pack is corrupted (SHA1 mismatch)"
msgstr "paketet är trasigt (SHA1 stämmer inte)"
msgid "cannot fstat packfile"
-msgstr "kan inte utföra \"fstat\" på paketfil"
+msgstr "kan inte utföra â€fstat†pÃ¥ paketfil"
msgid "pack has junk at the end"
msgstr "paket har skräp i slutet"
@@ -6983,7 +7161,7 @@ msgstr[1] "paketet har %d oanalyserade delta"
#, c-format
msgid "unable to deflate appended object (%d)"
-msgstr "kunde inte utföra \"deflate\" på tillagt objekt (%d)"
+msgstr "kunde inte utföra â€deflate†pÃ¥ tillagt objekt (%d)"
#, c-format
msgid "local object %s is corrupt"
@@ -6991,19 +7169,19 @@ msgstr "lokalt objekt %s är trasigt"
#, c-format
msgid "packfile name '%s' does not end with '.%s'"
-msgstr "paketfilnamnet \"%s\" slutar inte med \".%s\""
+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 ta skriva %s-fil â€%sâ€"
#, c-format
msgid "cannot close written %s file '%s'"
-msgstr "kan inte stänga skriven %s-fil \"%s\""
+msgstr "kan inte stänga skriven %s-fil â€%sâ€"
#, c-format
msgid "unable to rename temporary '*.%s' file to '%s'"
-msgstr "kunde inte byta namn på temporär \"*.%s\"-fil till \"%s\""
+msgstr "kunde inte byta namn pÃ¥ temporär â€*.%sâ€-fil till â€%sâ€"
msgid "error while closing pack file"
msgstr "fel vid stängning av paketfil"
@@ -7014,11 +7192,11 @@ msgstr "felaktig pack.indexVersion=%<PRIu32>"
#, c-format
msgid "Cannot open existing pack file '%s'"
-msgstr "Kan inte öppna befintlig paketfil \"%s\""
+msgstr "Kan inte öppna befintlig paketfil â€%sâ€"
#, c-format
msgid "Cannot open existing pack idx file for '%s'"
-msgstr "Kan inte öppna befintlig paket-idx-fil för \"%s\""
+msgstr "Kan inte öppna befintlig paket-idx-fil för â€%sâ€"
#, c-format
msgid "non delta: %d object"
@@ -7041,7 +7219,7 @@ msgstr "felaktig %s"
#, c-format
msgid "unknown hash algorithm '%s'"
-msgstr "okänd hashningsalgoritm \"%s\""
+msgstr "okänd hashningsalgoritm â€%sâ€"
msgid "--stdin requires a git repository"
msgstr "--stdin kräver ett git-arkiv"
@@ -7052,83 +7230,18 @@ msgstr "--verify angavs utan paketfilnamn"
msgid "fsck error in pack objects"
msgstr "fsck-fel i packat objekt"
-#, c-format
-msgid "cannot stat template '%s'"
-msgstr "kan inte ta status på mallen \"%s\""
-
-#, c-format
-msgid "cannot opendir '%s'"
-msgstr "kan inte öppna katalogen (opendir) \"%s\""
-
-#, c-format
-msgid "cannot readlink '%s'"
-msgstr "kan inte läsa länk (readlink) \"%s\""
-
-#, c-format
-msgid "cannot symlink '%s' '%s'"
-msgstr "kan inte skapa symbolisk länk \"%s\" \"%s\""
-
-#, c-format
-msgid "cannot copy '%s' to '%s'"
-msgstr "kan inte kopiera \"%s\" till \"%s\""
-
-#, c-format
-msgid "ignoring template %s"
-msgstr "ignorerar mallen %s"
-
-#, c-format
-msgid "templates not found in %s"
-msgstr "mallarna hittades inte i %s"
-
-#, c-format
-msgid "not copying templates from '%s': %s"
-msgstr "kopierade inte mallar från \"%s\": %s"
-
-#, c-format
-msgid "invalid initial branch name: '%s'"
-msgstr "ogiltigt namn på första gren: \"%s\""
-
-#, c-format
-msgid "unable to handle file type %d"
-msgstr "kan inte hantera filtyp %d"
-
-#, c-format
-msgid "unable to move %s to %s"
-msgstr "kan inte flytta %s till %s"
-
-msgid "attempt to reinitialize repository with different hash"
-msgstr "försöker initiera arkivet på nytt med annan hash"
-
-#, c-format
-msgid "%s already exists"
-msgstr "%s finns redan"
-
-#, c-format
-msgid "re-init: ignored --initial-branch=%s"
-msgstr "re-init: ignorerade --initial-branch=%s"
-
-#, c-format
-msgid "Reinitialized existing shared Git repository in %s%s\n"
-msgstr "Ominitierade befintligt delat Git-arkiv i %s%s\n"
-
-#, c-format
-msgid "Reinitialized existing Git repository in %s%s\n"
-msgstr "Ominitierade befintligt Git-arkiv i %s%s\n"
-
-#, c-format
-msgid "Initialized empty shared Git repository in %s%s\n"
-msgstr "Initierade tomt delat Git-arkiv i %s%s\n"
-
-#, c-format
-msgid "Initialized empty Git repository in %s%s\n"
-msgstr "Initierade tomt Git-arkiv i %s%s\n"
-
msgid ""
-"git init [-q | --quiet] [--bare] [--template=<template-directory>] [--"
-"shared[=<permissions>]] [<directory>]"
+"git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
+" [--separate-git-dir <git-dir>] [--object-format=<format>]\n"
+" [--ref-format=<format>]\n"
+" [-b <branch-name> | --initial-branch=<branch-name>]\n"
+" [--shared[=<permissions>]] [<directory>]"
msgstr ""
-"git init [-q | --quiet] [--bare] [--template=<mallkatalog>] [--"
-"shared[=<behörigheter>]] [<katalog>]"
+"git init [-q | --quiet] [--bare] [--template=<mallkatalog>]\n"
+" [--separate-git-dir <git-kat>] [--object-format=<format>]\n"
+" [--ref-format=<format>]\n"
+" [-b <grennamn> | --initial-branch=<grennamn>]\n"
+" [--shared[=<behörigheter>]] [<katalog>]"
msgid "permissions"
msgstr "behörigheter"
@@ -7163,17 +7276,20 @@ msgstr ""
#, c-format
msgid "Cannot access work tree '%s'"
-msgstr "Kan inte komma åt arbetskatalogen \"%s\""
+msgstr "Kan inte komma Ã¥t arbetskatalogen â€%sâ€"
msgid "--separate-git-dir incompatible with bare repository"
msgstr "--separate-git-dir är inkompatibelt med naket arkiv"
msgid ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"<token>[(=|:)<value>])...] [<file>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<key>|<keyAlias>)[(=|:)<value>])...]\n"
+" [--parse] [<file>...]"
msgstr ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"<symbol>[(=|:)<värde>])...] [<fil>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<nyckel>|<nyckelAlias>)"
+"[(=|:)<värde>])...]\n"
+" [--parse] [<fil>...]"
msgid "edit files in place"
msgstr "redigera filer på plats"
@@ -7181,6 +7297,9 @@ msgstr "redigera filer på plats"
msgid "trim empty trailers"
msgstr "ta bort tomma släprader"
+msgid "placement"
+msgstr "placering"
+
msgid "where to place the new trailer"
msgstr "var nya släprader ska placeras"
@@ -7193,17 +7312,17 @@ msgstr "att göra om släprader saknas"
msgid "output only the trailers"
msgstr "visa endast släprader"
-msgid "do not apply config rules"
-msgstr "använd inte regler från konfigurationen"
+msgid "do not apply trailer.* configuration variables"
+msgstr "tillämpa inte konfigurationsvariablerna trailer.*"
-msgid "join whitespace-continued values"
-msgstr "slå ihop värden avdelade med blanksteg"
+msgid "reformat multiline trailer values as single-line values"
+msgstr "omformatera flerradiga släpradsvärden som enradsvärden"
-msgid "set parsing options"
-msgstr "välj tolkningsalternativ"
+msgid "alias for --only-trailers --only-input --unfold"
+msgstr "alias för --only-trailers --only-input --unfold"
-msgid "do not treat --- specially"
-msgstr "tolka inte --- speciellt"
+msgid "do not treat \"---\" as the end of input"
+msgstr "tolka inte â€---†som slut pÃ¥ indata"
msgid "trailer(s) to add"
msgstr "släprad(er) att lägga till"
@@ -7230,8 +7349,8 @@ msgstr "undertryck diff-utdata"
msgid "show source"
msgstr "visa källkod"
-msgid "use mail map file"
-msgstr "använd e-postmappningsfil"
+msgid "clear all previously-defined decoration filters"
+msgstr "rensa alla tidigare definierade dekorationsfilter"
msgid "only decorate refs that match <pattern>"
msgstr "dekorera endast referenser som motsvarar <mönster>"
@@ -7292,6 +7411,10 @@ msgstr "behöver precis ett intervall"
msgid "not a range"
msgstr "inte ett intervall"
+#, c-format
+msgid "unable to read branch description file '%s'"
+msgstr "kan inte läsa grenbeskrivningsfilen â€%sâ€"
+
msgid "cover letter needs email format"
msgstr "omslagsbrevet behöver e-postformat"
@@ -7314,7 +7437,7 @@ msgstr "okänd incheckning %s"
#, c-format
msgid "failed to resolve '%s' as a valid ref"
-msgstr "misslyckades slå upp \"%s\" som en giltig referens"
+msgstr "misslyckades slÃ¥ upp â€%s†som en giltig referens"
msgid "could not find exact merge base"
msgstr "kunde inte hitta exakt sammanslagningsbas"
@@ -7345,7 +7468,7 @@ msgstr "misslyckades räkna ut intervalldiff-ursprung för aktuell serie"
#, c-format
msgid "using '%s' as range-diff origin of current series"
-msgstr "använd \"%s\" som intervalldiff-ursprung för aktuell serie"
+msgstr "använd â€%s†som intervalldiff-ursprung för aktuell serie"
msgid "use [PATCH n/m] even with a single patch"
msgstr "använd [PATCH n/m] även för en ensam patch"
@@ -7366,7 +7489,7 @@ msgid "sfx"
msgstr "sfx"
msgid "use <sfx> instead of '.patch'"
-msgstr "använd <sfx> istället för \".patch\""
+msgstr "använd <sfx> istället för â€.patchâ€"
msgid "start numbering patches at <n> instead of 1"
msgstr "börja numrera patchar på <n> istället för 1"
@@ -7389,6 +7512,9 @@ 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"
+msgid "use branch description from file"
+msgstr "använd grenbeskrivningar från fil"
+
msgid "use [<prefix>] instead of [PATCH]"
msgstr "använd [<prefix>] istället för [PATCH]"
@@ -7423,10 +7549,10 @@ msgid "email"
msgstr "epost"
msgid "add To: header"
-msgstr "lägg till mottagarhuvud (\"To:\")"
+msgstr "lägg till mottagarhuvud (â€To:â€)"
msgid "add Cc: header"
-msgstr "lägg till kopiehuvud (\"Cc:\")"
+msgstr "lägg till kopiehuvud (â€Cc:â€)"
msgid "ident"
msgstr "ident"
@@ -7482,6 +7608,9 @@ msgstr "visa ändringar mot <refspec> i omslagsbrev eller ensam patch"
msgid "percentage by which creation is weighted"
msgstr "procent som skapelse vägs med"
+msgid "show in-body From: even if identical to the e-mail header"
+msgstr "visa From: i kroppen även om samma som i e-posthuvudet"
+
#, c-format
msgid "invalid ident line: %s"
msgstr "ogiltig ident-rad: %s"
@@ -7500,7 +7629,7 @@ msgstr "kan inte använda --remerge-diff"
#, c-format
msgid "could not create directory '%s'"
-msgstr "kunde inte skapa katalogen \"%s\""
+msgstr "kunde inte skapa katalogen â€%sâ€"
msgid "--interdiff requires --cover-letter or single patch"
msgstr "--interdiff kräver --cover-letter eller ensam patch"
@@ -7524,7 +7653,7 @@ msgstr "Intervall-diff mot v%d:"
#, c-format
msgid "unable to read signature file '%s'"
-msgstr "kunde inte läsa signaturfil \"%s\""
+msgstr "kunde inte läsa signaturfil â€%sâ€"
msgid "Generating patches"
msgstr "Skapar patchar"
@@ -7540,6 +7669,22 @@ msgid ""
"Could not find a tracked remote branch, please specify <upstream> manually.\n"
msgstr "Kunde inte hitta en spårad fjärrgren, ange <uppström> manuellt.\n"
+#, c-format
+msgid "could not get object info about '%s'"
+msgstr "kunde inte hämta objektinfo om â€%sâ€"
+
+#, c-format
+msgid "bad ls-files format: element '%s' does not start with '('"
+msgstr "felaktigt ls-files-format: elementet â€%s†börjar inte med â€(â€"
+
+#, c-format
+msgid "bad ls-files format: element '%s' does not end in ')'"
+msgstr "felaktigt ls-files-format: elementet â€%s†slutar inte med â€)â€"
+
+#, c-format
+msgid "bad ls-files format: %%%.*s"
+msgstr "felaktigt ls-files-format: %%%.*s"
+
msgid "git ls-files [<options>] [<file>...]"
msgstr "git ls-files [<flaggor>] [<fil>...]"
@@ -7550,10 +7695,10 @@ msgid "identify the file status with tags"
msgstr "identifiera filstatus med taggar"
msgid "use lowercase letters for 'assume unchanged' files"
-msgstr "använd små bokstäver för \"anta oförändrade\"-filer"
+msgstr "använd smÃ¥ bokstäver för â€anta oförändradeâ€-filer"
msgid "use lowercase letters for 'fsmonitor clean' files"
-msgstr "använd små bokstäver för \"fsmonitor clean\"-filer"
+msgstr "använd smÃ¥ bokstäver för â€fsmonitor cleanâ€-filer"
msgid "show cached files in the output (default)"
msgstr "visa cachade filer i utdata (standard)"
@@ -7577,7 +7722,7 @@ msgid "show files on the filesystem that need to be removed"
msgstr "visa filer i filsystemet som behöver tas bort"
msgid "show 'other' directories' names only"
-msgstr "visa endast namn för \"andra\" kataloger"
+msgstr "visa endast namn för â€andra†kataloger"
msgid "show line endings of files"
msgstr "visa radslut i filer"
@@ -7589,7 +7734,7 @@ msgid "show unmerged files in the output"
msgstr "visa ej sammanslagna filer i utdata"
msgid "show resolve-undo information"
-msgstr "visa \"resolve-undo\"-information"
+msgstr "visa â€resolve-undoâ€-information"
msgid "skip files matching pattern"
msgstr "hoppa över filer som motsvarar mönster"
@@ -7625,13 +7770,20 @@ msgid "show sparse directories in the presence of a sparse index"
msgstr "visa glesa kataloger när et glest index existerar"
msgid ""
+"--format cannot be used with -s, -o, -k, -t, --resolve-undo, --deduplicate, "
+"--eol"
+msgstr ""
+"--format kan inte användas med -s, -o, -k, -t, --resolve-undo, --"
+"deduplicate, --eol"
+
+msgid ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<repository> [<refs>...]]"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
+" [--symref] [<repository> [<patterns>...]]"
msgstr ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<arkiv> [<referenser>...]]"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<nyckel>]\n"
+" [--symref] [<arkiv> [<mönster>...]]"
msgid "do not print remote URL"
msgstr "visa inte fjärr-URL"
@@ -7664,16 +7816,12 @@ msgid "git ls-tree [<options>] <tree-ish> [<path>...]"
msgstr "git ls-tree [<flaggor>] <träd-igt> [<sökväg>...]"
#, c-format
-msgid "could not get object info about '%s'"
-msgstr "kunde inte hämta objektinfo om \"%s\""
-
-#, c-format
msgid "bad ls-tree format: element '%s' does not start with '('"
-msgstr "felaktigt ls-tree-format: elementet \"%s\" börjar inte med \"(\""
+msgstr "felaktigt ls-tree-format: elementet â€%s†börjar inte med â€(â€"
#, c-format
msgid "bad ls-tree format: element '%s' does not end in ')'"
-msgstr "felaktigt ls-tree-format: elementet \"%s\" slutar inte med \")\""
+msgstr "felaktigt ls-tree-format: elementet â€%s†slutar inte med â€)â€"
#, c-format
msgid "bad ls-tree format: %%%.*s"
@@ -7717,7 +7865,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 hakparanterser som inte är â€patch†i ärenderaden"
msgid "copy Message-ID to the end of commit message"
msgstr "kopiera Message-ID till slutet av incheckningsmeddelandet"
@@ -7751,7 +7899,7 @@ msgstr "läser patchar från standard in/tty..."
#, c-format
msgid "empty mbox: '%s'"
-msgstr "tom mbox: \"%s\""
+msgstr "tom mbox: â€%sâ€"
msgid "git merge-base [-a | --all] <commit> <commit>..."
msgstr "git merge-base [-a | --all] <incheckning> <incheckning>..."
@@ -7759,12 +7907,12 @@ msgstr "git merge-base [-a | --all] <incheckning> <incheckning>..."
msgid "git merge-base [-a | --all] --octopus <commit>..."
msgstr "git merge-base [-a | --all] --octopus <incheckning>..."
-msgid "git merge-base --independent <commit>..."
-msgstr "git merge-base --independent <incheckning>..."
-
msgid "git merge-base --is-ancestor <commit> <commit>"
msgstr "git merge-base --is-ancestor <incheckning> <incheckning>"
+msgid "git merge-base --independent <commit>..."
+msgstr "git merge-base --independent <incheckning>..."
+
msgid "git merge-base --fork-point <ref> [<commit>]"
msgstr "git merge-base --fork-point <ref> [<incheckning>]"
@@ -7790,9 +7938,18 @@ msgstr ""
"git merge-file [<alternativ>] [-L <namn1> [-L <orig> [-L <namn2>]]] <fil1> "
"<origfil> <fil2>"
+msgid ""
+"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
+"\"histogram\""
+msgstr ""
+"flaggan diff-algorithm godtar â€myersâ€, â€minimalâ€, â€patience†och â€histogramâ€"
+
msgid "send results to standard output"
msgstr "sänd resultat till standard ut"
+msgid "use object IDs instead of filenames"
+msgstr "använd objekt-ID istället för filnamn"
+
msgid "use a diff3 based merge"
msgstr "använd diff3-baserad sammanslagning"
@@ -7808,6 +7965,12 @@ msgstr "för konflikter, använd deras version"
msgid "for conflicts, use a union version"
msgstr "för konflikter, använd en förenad version"
+msgid "<algorithm>"
+msgstr "<algoritm>"
+
+msgid "choose a diff algorithm"
+msgstr "välj en diff-algoritm"
+
msgid "for conflicts, use this marker size"
msgstr "för konflikter, använd denna markörstorlek"
@@ -7818,12 +7981,19 @@ msgid "set labels for file1/orig-file/file2"
msgstr "sätt etiketter för fil1/origfil/fil2"
#, c-format
+msgid "object '%s' does not exist"
+msgstr "objektet â€%s†finns inte"
+
+msgid "Could not write object file"
+msgstr "Kunde inte skriva objektfilen"
+
+#, c-format
msgid "unknown option %s"
msgstr "okänd flagga %s"
#, c-format
msgid "could not parse object '%s'"
-msgstr "kunde inte tolka objektet \"%s\""
+msgstr "kunde inte tolka objektet â€%sâ€"
#, c-format
msgid "cannot handle more than %d base. Ignoring %s."
@@ -7836,25 +8006,82 @@ msgstr "hanterar inte något annat än en sammanslagning av två huvuden."
#, c-format
msgid "could not resolve ref '%s'"
-msgstr "kunde inte bestämma referensen \"%s\""
+msgstr "kunde inte bestämma referensen â€%sâ€"
#, c-format
msgid "Merging %s with %s\n"
msgstr "Slår ihop %s med %s\n"
+msgid "not something we can merge"
+msgstr "inte något vi kan slå ihop"
+
+msgid "refusing to merge unrelated histories"
+msgstr "vägrar slå samman orelaterad historik"
+
+msgid "failure to merge"
+msgstr "misslyckades slå ihop"
+
+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>"
+
+msgid "do a real merge instead of a trivial merge"
+msgstr "gör en riktig sammanslagning istället för en enkel sammanslagning"
+
+msgid "do a trivial merge only"
+msgstr "gör endast en enkel sammanslagning"
+
+msgid "also show informational/conflict messages"
+msgstr "visa även informations-/konfliktmeddelanden"
+
+msgid "list filenames without modes/oids/stages"
+msgstr "lista filnamn utan lägen/oid/köer"
+
+msgid "allow merging unrelated histories"
+msgstr "tillåt sammanslagning av orelaterade historier"
+
+msgid "perform multiple merges, one per line of input"
+msgstr "utför flera sammanslagningar, en per indatarad"
+
+msgid "specify a merge-base for the merge"
+msgstr "ange en sammanslagningsbas för sammanslagningen"
+
+msgid "option=value"
+msgstr "alternativ=värde"
+
+msgid "option for selected merge strategy"
+msgstr "alternativ för vald sammanslagningsstrategi"
+
+msgid "--trivial-merge is incompatible with all other options"
+msgstr "--trivial-merge är inkompatibelt med andra flaggor"
+
+#, c-format
+msgid "unknown strategy option: -X%s"
+msgstr "okänd strategiflagga: -X%s"
+
+#, c-format
+msgid "malformed input line: '%s'."
+msgstr "felaktig indatarad: â€%sâ€."
+
+#, c-format
+msgid "merging cannot continue; got unclean result of %d"
+msgstr "sammanslagning kan inte fortsätta; fick inte rent resultat från %d"
+
msgid "git merge [<options>] [<commit>...]"
msgstr "git merge [<flaggor>] [<incheckning>...]"
msgid "switch `m' requires a value"
-msgstr "flaggan \"m\" behöver ett värde"
+msgstr "flaggan â€m†behöver ett värde"
#, c-format
msgid "option `%s' requires a value"
-msgstr "flaggan \"%s\" behöver ett värde"
+msgstr "flaggan â€%s†behöver ett värde"
#, c-format
msgid "Could not find merge strategy '%s'.\n"
-msgstr "Kunde inte hitta sammanslagningsstrategin \"%s\".\n"
+msgstr "Kunde inte hitta sammanslagningsstrategin â€%sâ€.\n"
#, c-format
msgid "Available strategies are:"
@@ -7901,12 +8128,6 @@ msgstr "strategi"
msgid "merge strategy to use"
msgstr "sammanslagningsstrategi att använda"
-msgid "option=value"
-msgstr "alternativ=värde"
-
-msgid "option for selected merge strategy"
-msgstr "alternativ för vald sammanslagningsstrategi"
-
msgid "merge commit message (for a non-fast-forward merge)"
msgstr "incheckningsmeddelande för (icke snabbspolande) sammanslagning"
@@ -7922,9 +8143,6 @@ msgstr "--abort men lämna index och arbetskatalog ensamma"
msgid "continue the current in-progress merge"
msgstr "fortsätt den pågående sammanslagningen"
-msgid "allow merging unrelated histories"
-msgstr "tillåt sammanslagning av orelaterade historier"
-
msgid "bypass pre-merge-commit and commit-msg hooks"
msgstr "förbigå pre-merge-commit- och commit-msg-krokar"
@@ -7957,7 +8175,7 @@ msgstr "Inget sammanslagningsmeddelande -- uppdaterar inte HEAD\n"
#, c-format
msgid "'%s' does not point to a commit"
-msgstr "\"%s\" verkar inte peka på en incheckning"
+msgstr "â€%s†verkar inte peka pÃ¥ en incheckning"
#, c-format
msgid "Bad branch.%s.mergeoptions string: %s"
@@ -7970,22 +8188,17 @@ msgid "Not handling anything other than two heads merge."
msgstr "Hanterar inte något annat än en sammanslagning av två huvuden."
#, c-format
-msgid "unknown strategy option: -X%s"
-msgstr "okänd strategiflagga: -X%s"
-
-#, c-format
msgid "unable to write %s"
msgstr "kunde inte skriva %s"
#, c-format
msgid "Could not read from '%s'"
-msgstr "Kunde inte läsa från \"%s\""
+msgstr "Kunde inte läsa frÃ¥n â€%sâ€"
#, c-format
msgid "Not committing merge; use 'git commit' to complete the merge.\n"
msgstr ""
-"Checkar inte in sammanslagningen; använd \"git commit\" för att slutföra "
-"den.\n"
+"Checkar inte in sammanslagningen; använd â€git commit†för att slutföra den.\n"
msgid ""
"Please enter a commit message to explain why this merge is necessary,\n"
@@ -8005,7 +8218,7 @@ msgid ""
"Lines starting with '%c' will be ignored, and an empty message aborts\n"
"the commit.\n"
msgstr ""
-"Rader som inleds med \"%c\" kommer ignoreras, och ett tomt meddelande\n"
+"Rader som inleds med â€%c†kommer ignoreras, och ett tomt meddelande\n"
"avbryter incheckningen.\n"
msgid "Empty commit message."
@@ -8035,19 +8248,16 @@ msgstr "Ingen fjärrspårande gren för %s från %s"
#, c-format
msgid "Bad value '%s' in environment '%s'"
-msgstr "Felaktigt värde \"%s\" i miljövariabeln \"%s\""
+msgstr "Felaktigt värde â€%s†i miljövariabeln â€%sâ€"
#, c-format
msgid "could not close '%s'"
-msgstr "kunde inte stänga \"%s\""
+msgstr "kunde inte stänga â€%sâ€"
#, c-format
msgid "not something we can merge in %s: %s"
msgstr "inte något vi kan slå ihop med %s: %s"
-msgid "not something we can merge"
-msgstr "inte något vi kan slå ihop"
-
msgid "--abort expects no arguments"
msgstr "--abort tar inga argument"
@@ -8074,11 +8284,11 @@ msgid ""
"You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n"
"Please, commit your changes before you merge."
msgstr ""
-"Du har inte avslutat din \"cherry-pick\" (CHERRY_PICK_HEAD finns).\n"
+"Du har inte avslutat din â€cherry-pick†(CHERRY_PICK_HEAD finns).\n"
"Checka in dina ändringar innan du slår ihop."
msgid "You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists)."
-msgstr "Du har inte avslutat din \"cherry-pick\" (CHERRY_PICK_HEAD finns)."
+msgstr "Du har inte avslutat din â€cherry-pick†(CHERRY_PICK_HEAD finns)."
msgid "No commit specified and merge.defaultToUpstream not set."
msgstr "Ingen incheckning angiven och merge.defaultToUpstream är ej satt."
@@ -8096,14 +8306,20 @@ msgstr "%s - inte något vi kan slå ihop"
msgid "Can merge only exactly one commit into empty head"
msgstr "Kan endast slå ihop en enda incheckning i ett tomt huvud"
-msgid "refusing to merge unrelated histories"
-msgstr "vägrar slå samman orelaterad historik"
-
#, c-format
msgid "Updating %s..%s\n"
msgstr "Uppdaterar %s..%s\n"
#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+" %s"
+msgstr ""
+"Dina lokala ändringar av följande filer skulle skrivas över av "
+"sammanslagning:\n"
+" %s"
+
+#, c-format
msgid "Trying really trivial in-index merge...\n"
msgstr "Försöker riktigt enkel sammanslagning i indexet...\n"
@@ -8137,6 +8353,10 @@ msgstr ""
"Automatisk sammanslagning lyckades; stoppar före incheckning som önskat\n"
#, c-format
+msgid "When finished, apply stashed changes with `git stash pop`\n"
+msgstr "När färdig, applicerade sparade ändringar med â€git stash popâ€\n"
+
+#, c-format
msgid "warning: tag input does not pass fsck: %s"
msgstr "varning: taggindata godkänns inte av fsck: %s"
@@ -8150,11 +8370,11 @@ msgstr "%d (FSCK_IGNORE?) skulle aldrig utlösa detta återanrop"
#, c-format
msgid "could not read tagged object '%s'"
-msgstr "kunde inte läsa det taggade objektet \"%s\""
+msgstr "kunde inte läsa det taggade objektet â€%sâ€"
#, c-format
msgid "object '%s' tagged as '%s', but is a '%s' type"
-msgstr "objektet \"%s\" taggat som \"%s\", men är av typen \"%s\""
+msgstr "objektet â€%s†taggat som â€%sâ€, men är av typen â€%sâ€"
msgid "could not read from stdin"
msgstr "kunde inte läsa från standard in"
@@ -8230,7 +8450,7 @@ msgstr "Katalogen %s är i indexet och inte en undermodul?"
msgid "Please stage your changes to .gitmodules or stash them to proceed"
msgstr ""
-"Kö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 "%.*s is in index"
@@ -8244,20 +8464,23 @@ msgstr "hoppa över fel vid flytt/namnändring"
#, c-format
msgid "destination '%s' is not a directory"
-msgstr "destinationen \"%s\" är ingen katalog"
+msgstr "destinationen â€%s†är ingen katalog"
#, c-format
msgid "Checking rename of '%s' to '%s'\n"
-msgstr "Kontrollerar namnbyte av \"%s\" till \"%s\"\n"
+msgstr "Kontrollerar namnbyte av â€%s†till â€%sâ€\n"
msgid "bad source"
msgstr "felaktig källa"
+msgid "destination exists"
+msgstr "destinationen finns"
+
msgid "can not move directory into itself"
msgstr "kan inte flytta katalog till sig själv"
-msgid "cannot move directory over file"
-msgstr "kan inte flytta katalog över fil"
+msgid "destination already exists"
+msgstr "destinationen finns redan"
msgid "source directory is empty"
msgstr "källkatalogen är tom"
@@ -8268,12 +8491,9 @@ msgstr "inte versionshanterad"
msgid "conflicted"
msgstr "i konflikt"
-msgid "destination exists"
-msgstr "destinationen finns"
-
#, c-format
msgid "overwriting '%s'"
-msgstr "skriver över \"%s\""
+msgstr "skriver över â€%sâ€"
msgid "Cannot overwrite"
msgstr "Kan inte skriva över"
@@ -8284,6 +8504,9 @@ msgstr "flera källor för samma mål"
msgid "destination directory does not exist"
msgstr "destinationskatalogen finns inte"
+msgid "destination exists in the index"
+msgstr "destinationen finns i indexet"
+
#, c-format
msgid "%s, source=%s, destination=%s"
msgstr "%s, källa=%s, mål=%s"
@@ -8294,7 +8517,7 @@ msgstr "Byter namn på %s till %s\n"
#, c-format
msgid "renaming '%s' failed"
-msgstr "misslyckades byta namn på \"%s\""
+msgstr "misslyckades byta namn pÃ¥ â€%sâ€"
msgid "git name-rev [<options>] <commit>..."
msgstr "git name-rev [<flaggor>] <incheckning>..."
@@ -8320,7 +8543,6 @@ msgstr "ignorera referenser som motsvarar <mönster>"
msgid "list all commits reachable from all refs"
msgstr "lista alla incheckningar som kan nås alla referenser"
-#| msgid "deprecated: use annotate-stdin instead"
msgid "deprecated: use --annotate-stdin instead"
msgstr "avråds: använd --annotate-stdin istället"
@@ -8328,7 +8550,7 @@ msgid "annotate text from stdin"
msgstr "annotera text från standard in"
msgid "allow to print `undefined` names (default)"
-msgstr "tillåt att skriva \"odefinierade\" namn (standard)"
+msgstr "tillÃ¥t att skriva â€odefinierade†namn (standard)"
msgid "dereference tags in the input (internal use)"
msgstr "avreferera taggar i indata (används internt)"
@@ -8337,22 +8559,26 @@ msgid "git notes [--ref <notes-ref>] [list [<object>]]"
msgstr "git notes [--ref <anteckningsref>] [list [<objekt>]]"
msgid ""
-"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [-m <msg> | -F <file> "
-"| (-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref <anteckningsref>] add [-f] [--allow-empty] [-m <medd> | -F "
-"<fil> | (-c | -C) <objekt>] [<objekt>]"
+"git notes [--ref <anteckningsref>] add [-f] [--allow-empty] [--"
+"[no-]separator|--separator=<styckebrytning>] [--[no-]stripspace] [-m <medd> "
+"| -F <fil> | (-c | -C) <objekt>] [<objekt>]"
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
msgstr ""
"git notes [--ref <anteckningsref>] copy [-f] <från-objekt> <till-objekt>"
msgid ""
-"git notes [--ref <notes-ref>] append [--allow-empty] [-m <msg> | -F <file> | "
-"(-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref <anteckningsref>] append [--allow-empty] [-m <medd> | -F "
-"<fil> | (-c | -C) <objekt>] [<objekt>]"
+"git notes [--ref <anteckningsref>] append [--allow-empty] [--"
+"[no-]separator|--separator=<styckebrytning>] [--[no-]stripspace] [-m <medd> "
+"| -F <fil> | (-c | -C) <objekt>] [<objekt>]"
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
msgstr "git notes [--ref <anteckningsref>] edit [--allow-empty] [<objekt>]"
@@ -8416,14 +8642,14 @@ msgstr "Skriv/redigera anteckningar för följande objekt:"
#, c-format
msgid "unable to start 'show' for object '%s'"
-msgstr "kunde inte starta \"show\" för objektet \"%s\""
+msgstr "kunde inte starta â€show†för objektet â€%sâ€"
msgid "could not read 'show' output"
-msgstr "kunde inte läsa utdata från \"show\""
+msgstr "kunde inte läsa utdata frÃ¥n â€showâ€"
#, c-format
msgid "failed to finish 'show' for object '%s'"
-msgstr "kunde inte avsluta \"show\" för objektet \"%s\""
+msgstr "kunde inte avsluta â€show†för objektet â€%sâ€"
msgid "please supply the note contents using either -m or -F option"
msgstr "ange innehåll för anteckningen med antingen -m eller -F"
@@ -8437,34 +8663,30 @@ msgstr "anteckningens innehåll har lämnats kvar i %s"
#, c-format
msgid "could not open or read '%s'"
-msgstr "kunde inte öppna eller läsa \"%s\""
+msgstr "kunde inte öppna eller läsa â€%sâ€"
#, c-format
msgid "failed to resolve '%s' as a valid ref."
-msgstr "kunde inte slå upp \"%s\" som en giltig referens."
+msgstr "kunde inte slÃ¥ upp â€%s†som en giltig referens."
#, c-format
msgid "failed to read object '%s'."
-msgstr "kunde inte läsa objektet \"%s\"."
+msgstr "kunde inte läsa objektet â€%sâ€."
#, c-format
msgid "cannot read note data from non-blob object '%s'."
-msgstr "kan inte läsa anteckningsdata från icke-blob-objektet \"%s\"."
-
-#, c-format
-msgid "malformed input line: '%s'."
-msgstr "felaktig indatarad: \"%s\"."
+msgstr "kan inte läsa anteckningsdata frÃ¥n icke-blob-objektet â€%sâ€."
#, c-format
msgid "failed to copy notes from '%s' to '%s'"
-msgstr "misslyckades kopiera anteckningar från \"%s\" till \"%s\""
+msgstr "misslyckades kopiera anteckningar frÃ¥n â€%s†till â€%sâ€"
#. TRANSLATORS: the first %s will be replaced by a git
#. notes command: 'add', 'merge', 'remove', etc.
#.
#, c-format
msgid "refusing to %s notes in %s (outside of refs/notes/)"
-msgstr "vägrar utföra \"%s\" på anteckningar i %s (utanför refs/notes/)"
+msgstr "vägrar utföra â€%s†pÃ¥ anteckningar i %s (utanför refs/notes/)"
#, c-format
msgid "no note found for object %s."
@@ -8488,13 +8710,22 @@ msgstr "tillåt lagra tom anteckning"
msgid "replace existing notes"
msgstr "ersätt befintliga anteckningar"
+msgid "<paragraph-break>"
+msgstr "<styckebrytning>"
+
+msgid "insert <paragraph-break> between paragraphs"
+msgstr "sätt in <styckebrytning> mellan stycken"
+
+msgid "remove unnecessary whitespace"
+msgstr "ta bort onödiga blanksteg"
+
#, c-format
msgid ""
"Cannot add notes. Found existing notes for object %s. Use '-f' to overwrite "
"existing notes"
msgstr ""
"Kan inte lägga till anteckningar. Hittade befintliga anteckningar för "
-"objektet %s. Använd \"-f\" för att skriva över befintliga anteckningar"
+"objektet %s. Använd â€-f†för att skriva över befintliga anteckningar"
#, c-format
msgid "Overwriting existing notes for object %s\n"
@@ -8519,7 +8750,7 @@ msgid ""
"existing notes"
msgstr ""
"Kan inte kopiera anteckningar. Hittade befintliga anteckningar för objektet "
-"%s. Använd \"-f\" för att skriva över befintliga anteckningar"
+"%s. Använd â€-f†för att skriva över befintliga anteckningar"
#, c-format
msgid "missing notes on source object %s. Cannot copy."
@@ -8530,8 +8761,8 @@ msgid ""
"The -m/-F/-c/-C options have been deprecated for the 'edit' subcommand.\n"
"Please use 'git notes add -f -m/-F/-c/-C' instead.\n"
msgstr ""
-"Flaggorna -m/-F/-c/-C rekommenderas inte för underkommandot \"edit\".\n"
-"Använd \"git notes add -f -m/-F/-c/-C\" istället.\n"
+"Flaggorna -m/-F/-c/-C rekommenderas inte för underkommandot â€editâ€.\n"
+"Använd â€git notes add -f -m/-F/-c/-C†istället.\n"
msgid "failed to delete ref NOTES_MERGE_PARTIAL"
msgstr "misslyckades ta bort referensen NOTES_MERGE_PARTIAL"
@@ -8540,7 +8771,7 @@ msgid "failed to delete ref NOTES_MERGE_REF"
msgstr "misslyckades ta bort referensen NOTES_MERGE_REF"
msgid "failed to remove 'git notes merge' worktree"
-msgstr "misslyckades ta bort arbetskatalogen för \"git notes merge\""
+msgstr "misslyckades ta bort arbetskatalogen för â€git notes mergeâ€"
msgid "failed to read ref NOTES_MERGE_PARTIAL"
msgstr "misslyckades läsa references NOTES_MERGE_PARTIAL"
@@ -8613,12 +8844,12 @@ msgid ""
"abort'.\n"
msgstr ""
"Automatisk sammanslagning av anteckningar misslyckades. Rätta konflikter i "
-"%s och checka in resultatet med \"git notes merge --commit\", eller avbryt "
-"sammanslagningen med \"git notes merge --abort\".\n"
+"%s och checka in resultatet med â€git notes merge --commitâ€, eller avbryt "
+"sammanslagningen med â€git notes merge --abortâ€.\n"
#, c-format
msgid "Failed to resolve '%s' as a valid ref."
-msgstr "Kunde inte slå upp \"%s\" som en giltig referens."
+msgstr "Kunde inte slÃ¥ upp â€%s†som en giltig referens."
#, c-format
msgid "Object %s has no note\n"
@@ -8643,18 +8874,16 @@ msgid "use notes from <notes-ref>"
msgstr "använd anteckningar från <anteckningsref>"
#, c-format
-msgid "unknown subcommand: %s"
-msgstr "okänt underkommando: %s"
+msgid "unknown subcommand: `%s'"
+msgstr "okänt underkommando: â€%sâ€"
-msgid ""
-"git pack-objects --stdout [<options>...] [< <ref-list> | < <object-list>]"
-msgstr ""
-"git pack-objects --stdout [<flaggor>...] [< <reflista> | < <objektlista>]"
+msgid "git pack-objects --stdout [<options>] [< <ref-list> | < <object-list>]"
+msgstr "git pack-objects --stdout [<flaggor>] [< <reflista> | < <objektlista>]"
msgid ""
-"git pack-objects [<options>...] <base-name> [< <ref-list> | < <object-list>]"
+"git pack-objects [<options>] <base-name> [< <ref-list> | < <object-list>]"
msgstr ""
-"git pack-objects [<flaggor>...] <basnamn> [< <reflista> | < <objektlista>]"
+"git pack-objects [<flaggor>] <basnamn> [< <reflista> | < <objektlista>]"
#, c-format
msgid ""
@@ -8697,7 +8926,7 @@ msgstr "misslyckades ta status på %s"
#, c-format
msgid "failed utime() on %s"
-msgstr "\"utime()\" misslyckades på %s"
+msgstr "â€utime()†misslyckades pÃ¥ %s"
msgid "failed to write bitmap index"
msgstr "misslyckade skriva bitkarteindex"
@@ -8758,6 +8987,10 @@ msgid "inconsistency with delta count"
msgstr "deltaräknaren är inkonsekvent"
#, c-format
+msgid "invalid pack.allowPackReuse value: '%s'"
+msgstr "felaktigt värde för pack.allowPackReuse: â€%sâ€"
+
+#, c-format
msgid ""
"value of uploadpack.blobpackfileuri must be of the form '<object-hash> <pack-"
"hash> <uri>' (got '%s')"
@@ -8777,7 +9010,7 @@ msgstr "kunde inte hämta typ för objektet %s i paketet %s"
#, c-format
msgid "could not find pack '%s'"
-msgstr "kunde inte hitta paketet \"%s\""
+msgstr "kunde inte hitta paketet â€%sâ€"
#, c-format
msgid "packfile %s cannot be accessed"
@@ -8823,11 +9056,11 @@ msgstr "kan inte tvinga lösa objekt"
#, c-format
msgid "not a rev '%s'"
-msgstr "inte en referens \"%s\""
+msgstr "inte en referens â€%sâ€"
#, c-format
msgid "bad revision '%s'"
-msgstr "felaktig revision \"%s\""
+msgstr "felaktig revision â€%sâ€"
msgid "unable to add recent objects"
msgstr "kan inte lägga till nya objekt"
@@ -8838,7 +9071,13 @@ msgstr "indexversionen %s stöds ej"
#, c-format
msgid "bad index version '%s'"
-msgstr "felaktig indexversion \"%s\""
+msgstr "felaktig indexversion â€%sâ€"
+
+msgid "show progress meter during object writing phase"
+msgstr "visa förloppsindikator under objektskrivningsfasen"
+
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "som --all-progress när förloppsindikatorn visas"
msgid "<version>[,<offset>]"
msgstr "<version>[,<offset>]"
@@ -8937,7 +9176,7 @@ msgid "pack compression level"
msgstr "komprimeringsgrad för paket"
msgid "do not hide commits by grafts"
-msgstr "göm inte incheckningar med ympningar (\"grafts\")"
+msgstr "göm inte incheckningar med ympningar (â€graftsâ€)"
msgid "use a bitmap index if available to speed up counting objects"
msgstr "använd bitkartindex om tillgängligt för att räkna objekt snabbare"
@@ -8986,9 +9225,6 @@ msgstr "minsta packstorlek är 1 MiB"
msgid "--thin cannot be used to build an indexable pack"
msgstr "--thin kan inte användas för att bygga ett indexerbart paket"
-msgid "cannot use --filter without --stdout"
-msgstr "kan inte använda --filter utan --stdout"
-
msgid "cannot use --filter with --stdin-packs"
msgstr "kan inte använda --filter med --stdin-packs"
@@ -9001,19 +9237,16 @@ msgstr "kan inte använda intern revisionslista med --cruft"
msgid "cannot use --stdin-packs with --cruft"
msgstr "kan inte använda --stdin-packs med --cruft"
-msgid "cannot use --max-pack-size with --cruft"
-msgstr "kan inte använda --max-pack-size med --cruft"
-
msgid "Enumerating objects"
msgstr "Räknar upp objekt"
#, c-format
msgid ""
"Total %<PRIu32> (delta %<PRIu32>), reused %<PRIu32> (delta %<PRIu32>), pack-"
-"reused %<PRIu32>"
+"reused %<PRIu32> (from %<PRIuMAX>)"
msgstr ""
"Totalt %<PRIu32> (delta %<PRIu32>), återanvände %<PRIu32> (delta %<PRIu32>), "
-"paket-återanvända %<PRIu32>"
+"paket-återanvända %<PRIu32> (från %<PRIuMAX>)"
msgid ""
"'git pack-redundant' is nominated for removal.\n"
@@ -9022,14 +9255,21 @@ msgid ""
"and let us know you still use it by sending an e-mail\n"
"to <git@vger.kernel.org>. Thanks.\n"
msgstr ""
-"\"git pack-redundant\" har nominerats för borttagning.\n"
+"â€git pack-redundant†har nominerats för borttagning.\n"
"Om du fortfarande använder kommandot, lägg till flaggan\n"
-"\"--i-still-use-this\" på kommandoraden och berätta för\n"
+"â€--i-still-use-this†pÃ¥ kommandoraden och berätta för\n"
"oss att du fortfarande använder det på e-post till\n"
"<git@vger.kernel.org>. Tack.\n"
-msgid "git pack-refs [<options>]"
-msgstr "git pack-refs [<flaggor>]"
+msgid "refusing to run without --i-still-use-this"
+msgstr "vägrar köra utan --i-still-use-this"
+
+msgid ""
+"git pack-refs [--all] [--no-prune] [--include <pattern>] [--exclude "
+"<pattern>]"
+msgstr ""
+"git pack-refs [--all] [--no-prune] [--include <mönster>] [--exclude "
+"<mönster>]"
msgid "pack everything"
msgstr "packa allt"
@@ -9037,6 +9277,24 @@ msgstr "packa allt"
msgid "prune loose refs (default)"
msgstr "ta bort lösa referenser (standard)"
+msgid "references to include"
+msgstr "referenser att ta med"
+
+msgid "references to exclude"
+msgstr "referenser att utesluta"
+
+msgid "git patch-id [--stable | --unstable | --verbatim]"
+msgstr "git patch-id [--stable | --unstable | --verbatim]"
+
+msgid "use the unstable patch-id algorithm"
+msgstr "använd den instabila patch-id-algoritmen"
+
+msgid "use the stable patch-id algorithm"
+msgstr "använd den stabila patch-id-algoritmen"
+
+msgid "don't strip whitespace from the patch"
+msgstr "ta inte bort blanksteg från patchen"
+
msgid "git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"
msgstr "git prune [-n] [-v] [--progress] [--expire <tid>] [--] [<huvud>...]"
@@ -9050,7 +9308,7 @@ msgid "limit traversal to objects outside promisor packfiles"
msgstr "begränsa vandring av objekt utanför kontraktspackfiler."
msgid "cannot prune in a precious-objects repo"
-msgstr "kan inte rensa i ett \"precious-objekt\"-arkiv"
+msgstr "kan inte rensa i ett â€precious-objektâ€-arkiv"
msgid "git pull [<options>] [<repository> [<refspec>...]]"
msgstr "git pull [<flaggor>] [<arkiv> [<refspec>...]]"
@@ -9082,6 +9340,12 @@ msgstr "tvinga överskrivning av lokal gren"
msgid "number of submodules pulled in parallel"
msgstr "antal undermoduler som hämtas parallellt"
+msgid "use IPv4 addresses only"
+msgstr "använd endast IPv4-adresser"
+
+msgid "use IPv6 addresses only"
+msgstr "använd endast IPv6-adresser"
+
msgid ""
"There is no candidate for rebasing against among the refs that you just "
"fetched."
@@ -9108,7 +9372,7 @@ msgid ""
"a branch. Because this is not the default configured remote\n"
"for your current branch, you must specify a branch on the command line."
msgstr ""
-"Du bad om att hämta från fjärren \"%s\", men angav inte någon\n"
+"Du bad om att hämta frÃ¥n fjärren â€%sâ€, men angav inte nÃ¥gon\n"
"gren. Eftersom det inte är den fjärr som är konfigurerad som\n"
"standard för aktuell gren måste du ange en gren på kommandoraden."
@@ -9142,7 +9406,7 @@ msgid ""
"Your configuration specifies to merge with the ref '%s'\n"
"from the remote, but no such ref was fetched."
msgstr ""
-"Dina inställningar anger sammanslagning med referensen \"%s\"\n"
+"Dina inställningar anger sammanslagning med referensen â€%sâ€\n"
"från fjärren, men någon sådan referens togs inte emot."
#, c-format
@@ -9169,13 +9433,13 @@ msgid ""
msgstr ""
"Du har avvikande grenar och måste ange hur de skall förlikas.\n"
"Du kan göra detta genom att köra ett av följande kommando innan du\n"
-"gör \"pull\" nästa gång: \n"
+"gör â€pull†nästa gÃ¥ng: \n"
"\n"
" git config pull.rebase false # sammanslagning\n"
" git config pull.rebase true # ombasering\n"
" git config pull.ff only # endast snabbspolning\n"
"\n"
-"Du kan ersätta \"git config\" med \"git config --global\" för att välja en\n"
+"Du kan ersätta â€git config†med â€git config --global†för att välja en\n"
"förvald inställning för alla arkiv. Du kan också ange --rebase, --no-rebase\n"
"eller --ff-only på kommandoraden för att överstyra det konfigurerade\n"
"förvalet vid körning.\n"
@@ -9186,8 +9450,8 @@ msgstr "Uppdaterar en ofödd gren med ändringar som lagts till i indexet."
msgid "pull with rebase"
msgstr "pull med ombasering"
-msgid "please commit or stash them."
-msgstr "checka in eller använd \"stash\" på dem."
+msgid "Please commit or stash them."
+msgstr "Checka in eller använd â€stash†pÃ¥ dem."
#, c-format
msgid ""
@@ -9244,21 +9508,20 @@ msgid ""
"To choose either option permanently, see push.default in 'git help config'.\n"
msgstr ""
"\n"
-"För att välja ett av alternativen permanent, se push.default i \"git help "
-"config\".\n"
+"För att välja ett av alternativen permanent, se push.default i â€git help "
+"configâ€.\n"
msgid ""
"\n"
-"To avoid automatically configuring upstream branches when their name\n"
-"doesn't match the local branch, see option 'simple' of branch."
-"autoSetupMerge\n"
+"To avoid automatically configuring an upstream branch when its name\n"
+"won't match the local branch, see option 'simple' of branch.autoSetupMerge\n"
"in 'git help config'.\n"
msgstr ""
"\n"
-"För att undvika att uppströmsgrenar automatiskt konfigureras när deras\n"
-"namn inte motsvarar en lokal gren, se värdet \"simple\" i branch."
+"För att undvika att en uppströmsgren automatiskt konfigureras när dess namn\n"
+"inte motsvarar den lokala grenen, se värdet â€simple†i branch."
"autoSetupMerge\n"
-"i \"git help config\".\n"
+"i â€git help configâ€.\n"
#, c-format
msgid ""
@@ -9305,7 +9568,7 @@ msgid ""
msgstr ""
"\n"
"För att detta ska ske automatiskt för grenar som saknar en spårande\n"
-"uppströmsgren, se \"push.autoSetupRemote\" i \"git help config\".\n"
+"uppströmsgren, se â€push.autoSetupRemote†i â€git help configâ€.\n"
#, c-format
msgid ""
@@ -9329,7 +9592,7 @@ msgid ""
"You didn't specify any refspecs to push, and push.default is \"nothing\"."
msgstr ""
"Du angav inga referensspecifikationer att sända, och push.default är "
-"\"nothing\"."
+"â€nothingâ€."
#, c-format
msgid ""
@@ -9337,44 +9600,44 @@ msgid ""
"your current branch '%s', without telling me what to push\n"
"to update which remote branch."
msgstr ""
-"Du sänder till fjärren \"%s\", som inte är uppströms för den\n"
-"aktuella grenen \"%s\", utan att tala om för mig vad som\n"
+"Du sänder till fjärren â€%sâ€, som inte är uppströms för den\n"
+"aktuella grenen â€%sâ€, utan att tala om för mig vad som\n"
"ska sändas för att uppdatera fjärrgrenen."
msgid ""
"Updates were rejected because the tip of your current branch is behind\n"
-"its remote counterpart. Integrate the remote changes (e.g.\n"
-"'git pull ...') before pushing again.\n"
+"its remote counterpart. If you want to integrate the remote changes,\n"
+"use 'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"Uppdateringar avvisades då änden på din befintliga gren är bakom\n"
-"dess fjärrmotsvarighet. Integrera fjärrändringarna (t.ex\n"
-"\"git pull ....\") innan du sänder igen.\n"
-"Se avsnittet \"Note about fast-forward\" i \"git push --help\" för detaljer."
+"dess fjärrmotsvarighet. Om du vill integrera fjärrändringarna,\n"
+"använd â€git pull†innan du sänder igen.\t\n"
+"Se avsnittet â€Note about fast-forward†i â€git push --help†för detaljer."
msgid ""
"Updates were rejected because a pushed branch tip is behind its remote\n"
-"counterpart. Check out this branch and integrate the remote changes\n"
-"(e.g. 'git pull ...') before pushing again.\n"
+"counterpart. If you want to integrate the remote changes, use 'git pull'\n"
+"before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"Uppdateringar avvisades då änden på en gren som sänds in är bakom dess\n"
-"fjärrmotsvarighet. Checka ut grenen och integrera fjärrändringarna (t.ex.\n"
-"\"git pull ...\") innan du sänder igen.\n"
-"Se avsnittet \"Note about fast-forward\" i \"git push --help\" för detaljer."
+"fjärrmotsvarighet. Om du vill integrera fjärrändringarna, använd â€git pullâ€\n"
+"innan du sänder igen.\n"
+"Se avsnittet â€Note about fast-forward†i â€git push --help†för detaljer."
msgid ""
-"Updates were rejected because the remote contains work that you do\n"
-"not have locally. This is usually caused by another repository pushing\n"
-"to the same ref. You may want to first integrate the remote changes\n"
-"(e.g., 'git pull ...') before pushing again.\n"
+"Updates were rejected because the remote contains work that you do not\n"
+"have locally. This is usually caused by another repository pushing to\n"
+"the same ref. If you want to integrate the remote changes, use\n"
+"'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"Uppdateringar avvisades då fjärren innehåller ändringar som du inte\n"
"har lokalt. Det beror oftast på att ett annat arkiv har sänt in samma\n"
-"referenser. Det kan vara en idé att först integrera fjärrändringarna\n"
-"(t.ex. \"git pull ...\") innan du sänder igen.\n"
-"Se avsnittet \"Note about fast-forwards\" i \"git push --help\" för detaljer."
+"referenser. Om du vill integrera fjärrändringarna, använd â€git pullâ€\n"
+"innan du sänder igen.\n"
+"Se avsnittet â€Note about fast-forwards†i â€git push --help†för detaljer."
msgid "Updates were rejected because the tag already exists in the remote."
msgstr "Uppdateringarna avvisades eftersom taggen redan finns på fjärren."
@@ -9387,18 +9650,18 @@ msgstr ""
"Du kan inte uppdatera en fjärr-referens som pekar på ett objekt som\n"
"inte är en incheckning, eller uppdatera en fjärr-referens så att den\n"
"pekar på något som inte är en incheckning, utan att använda flaggan\n"
-"\"--force\".\n"
+"â€--forceâ€.\n"
msgid ""
-"Updates were rejected because the tip of the remote-tracking\n"
-"branch has been updated since the last checkout. You may want\n"
-"to integrate those changes locally (e.g., 'git pull ...')\n"
-"before forcing an update.\n"
+"Updates were rejected because the tip of the remote-tracking branch has\n"
+"been updated since the last checkout. If you want to integrate the\n"
+"remote changes, use 'git pull' before pushing again.\n"
+"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"Uppdateringar avvisades då änden på den fjärrspårande grenen\n"
-"har uppdaterats sedan senaste utcheckning. Integrera\n"
-"fjärrändringarna lokalt (t.ex \"git pull ....\") innan du\n"
-"tvingar en uppdatering.\n"
+"Uppdateringar avvisades då änden på din befintliga gren är bakom\n"
+"dess fjärrmotsvarighet. Om du vill integrera fjärrändringarna,\n"
+"använd â€git pull†innan du sänder igen.\n"
+"Se avsnittet â€Note about fast-forward†i â€git push --help†för detaljer."
#, c-format
msgid "Pushing to %s\n"
@@ -9406,17 +9669,24 @@ msgstr "Sänder till %s\n"
#, c-format
msgid "failed to push some refs to '%s'"
-msgstr "misslyckades sända vissa referenser till \"%s\""
+msgstr "misslyckades sända vissa referenser till â€%sâ€"
+
+msgid ""
+"recursing into submodule with push.recurseSubmodules=only; using on-demand "
+"instead"
+msgstr ""
+"rekurserar in i undermoduler med push.recurseSubmodules=only; använder "
+"istället vid behov"
#, c-format
msgid "invalid value for '%s'"
-msgstr "ogiltigt värde för \"%s\""
+msgstr "ogiltigt värde för â€%sâ€"
msgid "repository"
msgstr "arkiv"
-msgid "push all refs"
-msgstr "sänd alla referenser"
+msgid "push all branches"
+msgstr "sänd alla grenar"
msgid "mirror all refs"
msgstr "spegla alla referenser"
@@ -9424,8 +9694,9 @@ msgstr "spegla alla referenser"
msgid "delete refs"
msgstr "ta bort referenser"
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "sänd taggar (kan inte användas med --all eller --mirror)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr ""
+"sänd taggar (kan inte användas med --all eller --branches eller --mirror)"
msgid "force updates"
msgstr "tvinga uppdateringar"
@@ -9471,7 +9742,7 @@ msgstr "--delete kan inte användas utan referenser"
#, c-format
msgid "bad repository '%s'"
-msgstr "felaktigt arkiv \"%s\""
+msgstr "felaktigt arkiv â€%sâ€"
msgid ""
"No configured push destination.\n"
@@ -9519,7 +9790,7 @@ msgid "notes"
msgstr "anteckningar"
msgid "passed to 'git log'"
-msgstr "sänds till \"git log\""
+msgstr "sänds till â€git logâ€"
msgid "only emit output related to the first range"
msgstr "visa endast utdata för det första intervallet"
@@ -9528,23 +9799,30 @@ msgid "only emit output related to the second range"
msgstr "visa endast utdata för det andra intervallet"
#, c-format
+msgid "not a revision: '%s'"
+msgstr "inte en revision: â€%sâ€"
+
+#, c-format
msgid "not a commit range: '%s'"
-msgstr "inte ett incheckningsintervall: \"%s\""
+msgstr "inte ett incheckningsintervall: â€%sâ€"
-msgid "single arg format must be symmetric range"
-msgstr "ensamt argument måste vara symmetriskt intervall"
+#, c-format
+msgid "not a symmetric range: '%s'"
+msgstr "inte ett symmetriskt intervall: â€%sâ€"
msgid "need two commit ranges"
msgstr "behöver två incheckningsintervall"
msgid ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>) "
-"[-u | -i]] [--no-sparse-checkout] [--index-output=<file>] (--empty | <tree-"
-"ish1> [<tree-ish2> [<tree-ish3>]])"
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<prefix>)\n"
+" [-u | -i]] [--index-output=<file>] [--no-sparse-checkout]\n"
+" (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"
msgstr ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>) "
-"[-u | -i]] [--no-sparse-checkout] [--index-output=<fil>] (--empty | <träd-"
-"igt1> [<träd-igt2> [<träd-igt3>]])"
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<prefix>)\n"
+" [-u | -i]] [--index-output=<fil>] [--no-sparse-checkout]\n"
+" (--empty | <träd-igt1> [<träd-igt2> [<träd-igt3>]])"
msgid "write resulting index to <file>"
msgstr "skriv resulterande index till <fil>"
@@ -9614,7 +9892,7 @@ msgstr ""
#, c-format
msgid "could not read '%s'."
-msgstr "kunde inte läsa \"%s\"."
+msgstr "kunde inte läsa â€%sâ€."
#, c-format
msgid "could not create temporary %s"
@@ -9631,23 +9909,23 @@ msgstr "en basincheckning måste anges med --upstream eller --onto"
#, c-format
msgid "%s requires the merge backend"
-msgstr "%s kräver \"merge\"-bakändan"
+msgstr "%s kräver â€mergeâ€-bakändan"
#, c-format
-msgid "could not get 'onto': '%s'"
-msgstr "kunde inte hämta \"onto\": \"%s\""
+msgid "invalid onto: '%s'"
+msgstr "ogiltig â€ontoâ€: â€%sâ€"
#, c-format
msgid "invalid orig-head: '%s'"
-msgstr "ogiltigt orig-head: \"%s\""
+msgstr "ogiltig â€orig-headâ€: â€%sâ€"
#, c-format
msgid "ignoring invalid allow_rerere_autoupdate: '%s'"
-msgstr "ignorera ogiltigt allow_rerere_autoupdate: \"%s\""
+msgstr "ignorera ogiltigt allow_rerere_autoupdate: â€%sâ€"
#, c-format
msgid "could not remove '%s'"
-msgstr "kunde inte ta bort \"%s\""
+msgstr "kunde inte ta bort â€%sâ€"
msgid ""
"Resolve all conflicts manually, mark them as resolved with\n"
@@ -9657,10 +9935,10 @@ msgid ""
"abort\"."
msgstr ""
"Lös alla konflikter manuellt, märk dem som lösta med\n"
-"\"git add/rm <filer_i_konflikt>\", kör sedan \"git rebase --continue\".\n"
-"Du kan hoppa över incheckningen istället: kör \"git rebase --skip\".\n"
-"För att avbryta och återgå till där du var före ombaseringen, kör \"git "
-"rebase --abort\"."
+"â€git add/rm <filer_i_konflikt>â€, kör sedan â€git rebase --continueâ€.\n"
+"Du kan hoppa över incheckningen istället: kör â€git rebase --skipâ€.\n"
+"För att avbryta och Ã¥tergÃ¥ till där du var före ombaseringen, kör â€git "
+"rebase --abortâ€."
#, c-format
msgid ""
@@ -9681,15 +9959,31 @@ msgstr ""
"Därför kan inte git ombasera dessa."
#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "Okänd rebase-merges-läge: %s"
+
+#, c-format
msgid "could not switch to %s"
msgstr "kunde inte växla till %s"
+msgid "apply options and merge options cannot be used together"
+msgstr ""
+"appliceringsflaggor och sammanslagningsflaggor kan inte användas tillsammans"
+
#, c-format
msgid ""
-"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and \"ask"
-"\"."
+"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and "
+"\"ask\"."
+msgstr "okänd tom-typ â€%sâ€; giltiga värden är â€dropâ€, â€keep†och â€askâ€."
+
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
msgstr ""
-"okänd tom-typ \"%s\"; giltiga värden är \"drop\", \"keep\" och \"ask\"."
+"--rebase-merges med en tom sträng som argument avråds från och kommer sluta "
+"fungera i en framtida version av Git. Använd istället --rebase-merges utan "
+"argument, vilket har samma effekt."
#, c-format
msgid ""
@@ -9744,7 +10038,7 @@ msgid "do not show diffstat of what changed upstream"
msgstr "visa inte en diffstat för vad som ändrats uppströms"
msgid "add a Signed-off-by trailer to each commit"
-msgstr "lägg \"Signed-off-by:\"-släprad till varje incheckning"
+msgstr "lägg â€Signed-off-by:â€-släprad till varje incheckning"
msgid "make committer date match author date"
msgstr "sätt incheckningsdatum till författardatum"
@@ -9756,7 +10050,7 @@ msgid "synonym of --reset-author-date"
msgstr "synonym för --reset-author-date"
msgid "passed to 'git apply'"
-msgstr "sänds till \"git apply\""
+msgstr "sänds till â€git applyâ€"
msgid "ignore changes in whitespace"
msgstr "ignorera ändringar i blanksteg"
@@ -9805,6 +10099,9 @@ msgstr "behåller incheckningar som är tomma från början"
msgid "move commits that begin with squash!/fixup! under -i"
msgstr "flytta incheckningar som börjar med squash!/fixup! under -i"
+msgid "update branches that point to commits that are being rebased"
+msgstr "uppdatera grenar som pekar på incheckningar som ombaseras"
+
msgid "add exec lines after each commit of the editable list"
msgstr "lägg till exec-rader efter varje incheckning i den redigerbara listan"
@@ -9815,7 +10112,7 @@ msgid "try to rebase merges instead of skipping them"
msgstr "försök ombasera sammanslagningar istället för att ignorera dem"
msgid "use 'merge-base --fork-point' to refine upstream"
-msgstr "använd \"merge-base --fork-point\" för att förfina uppström"
+msgstr "använd â€merge-base --fork-point†för att förfina uppström"
msgid "use the given merge strategy"
msgstr "använd angiven sammanslagningsstrategi"
@@ -9830,21 +10127,21 @@ msgid "rebase all reachable commits up to the root(s)"
msgstr "ombasera alla nåbara incheckningar upp till roten/rötterna"
msgid "automatically re-schedule any `exec` that fails"
-msgstr "kör automatiskt alla \"exec\" som misslyckas på nytt"
+msgstr "kör automatiskt alla â€exec†som misslyckas pÃ¥ nytt"
msgid "apply all changes, even those already present upstream"
msgstr "applicera alla ändringar, även de som redan finns uppströms"
msgid "It looks like 'git am' is in progress. Cannot rebase."
-msgstr "Det verkar som en \"git am\" körs. Kan inte ombasera."
+msgstr "Det verkar som en â€git am†körs. Kan inte ombasera."
msgid ""
"`rebase --preserve-merges` (-p) is no longer supported.\n"
"Use `git rebase --abort` to terminate current rebase.\n"
"Or downgrade to v2.33, or earlier, to complete the rebase."
msgstr ""
-"\"rebase --preserve-merges\" (-p) stöds ej längre.\n"
-"Använd \"git rebase --abort\" för att avsluta aktuell ombasering.\n"
+"â€rebase --preserve-merges†(-p) stöds ej längre.\n"
+"Använd â€git rebase --abort†för att avsluta aktuell ombasering.\n"
"Eller nedgradera till v2.33 eller tidigare för att slutföra ombaseringen."
msgid ""
@@ -9853,8 +10150,8 @@ msgid ""
"which is no longer supported; use 'merges' instead"
msgstr ""
"--preserve-merges ersattes av --rebase-merges\n"
-"Observera: Din inställning för \"pull.rebase\" kan också vara satt till\n"
-"\"preserve\", som inte längre stöds; använd \"merges\" istället"
+"Observera: Din inställning för â€pull.rebase†kan ocksÃ¥ vara satt till\n"
+"â€preserveâ€, som inte längre stöds; använd â€merges†istället"
msgid "No rebase in progress?"
msgstr "Ingen ombasering pågår?"
@@ -9900,18 +10197,21 @@ msgstr ""
"något av värde där.\n"
msgid "switch `C' expects a numerical value"
-msgstr "flaggan \"C\" förväntar ett numeriskt värde"
-
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "Okänt läge: %s"
+msgstr "flaggan â€C†förväntar ett numeriskt värde"
-msgid "--strategy requires --merge or --interactive"
-msgstr "--strategy kräver --merge eller --interactive"
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges. Consider adding --"
+"no-rebase-merges"
+msgstr ""
+"argument för â€apply†är inkompatibla med rebase.rebaseMerges. Överväg att "
+"lägga till --no-rebase-merges"
-msgid "apply options and merge options cannot be used together"
+msgid ""
+"apply options are incompatible with rebase.updateRefs. Consider adding --no-"
+"update-refs"
msgstr ""
-"appliceringsflaggor och sammanslagningsflaggor kan inte användas tillsammans"
+"argument för â€apply†är inkompatibla med rebase.updateRefs. Överväg att "
+"lägga till --no-update-refs"
#, c-format
msgid "Unknown rebase backend: %s"
@@ -9922,36 +10222,33 @@ msgstr "--reschedule-failed-exec kräver --exec eller --interactive"
#, c-format
msgid "invalid upstream '%s'"
-msgstr "felaktig uppström \"%s\""
+msgstr "felaktig uppström â€%sâ€"
msgid "Could not create new root commit"
msgstr "kunde inte skapa ny rotincheckning"
#, c-format
msgid "no such branch/commit '%s'"
-msgstr "ingen sådan gren/incheckning: \"%s\""
+msgstr "ingen sÃ¥dan gren/incheckning: â€%sâ€"
#, c-format
msgid "No such ref: %s"
msgstr "Ingen sådan referens: %s"
-msgid "Could not resolve HEAD to a revision"
-msgstr "Kunde inte bestämma HEAD:s incheckning"
+msgid "Could not resolve HEAD to a commit"
+msgstr "Kunde inte bestämma en incheckning för HEAD"
#, c-format
msgid "'%s': need exactly one merge base with branch"
-msgstr "\"%s\": behöver precis en sammanslagningsbas med gren"
+msgstr "â€%sâ€: behöver precis en sammanslagningsbas med gren"
#, c-format
msgid "'%s': need exactly one merge base"
-msgstr "\"%s\": behöver precis en sammanslagningsbas"
+msgstr "â€%sâ€: behöver precis en sammanslagningsbas"
#, c-format
msgid "Does not point to a valid commit '%s'"
-msgstr "Pekar inte på en giltig incheckning: \"%s\""
-
-msgid "Please commit or stash them."
-msgstr "Checka in eller använd \"stash\" på dem."
+msgstr "Pekar inte pÃ¥ en giltig incheckning: â€%sâ€"
msgid "HEAD is up to date."
msgstr "HEAD är à jour."
@@ -10010,17 +10307,17 @@ msgid ""
msgstr ""
"Normalt tillåts inte uppdatering av aktuell gren i ett icke-naket\n"
"arkiv, då index och arbetskatalog inte kommer stämma med det du\n"
-"sände och \"git reset --hard\" krävs för att få arbetskatalogen och\n"
+"sände och â€git reset --hard†krävs för att fÃ¥ arbetskatalogen och\n"
"HEAD att stämma överens.\n"
"\n"
-"Du kan ställa in variabeln \"receive.denyCurrentBranch\" till\n"
-"\"ignore\" eller \"warn\" i fjärrarkivet för att tillåta sändning till\n"
+"Du kan ställa in variabeln â€receive.denyCurrentBranch†till\n"
+"â€ignore†eller â€warn†i fjärrarkivet för att tillÃ¥ta sändning till\n"
"dess aktuella gren; detta rekommenderas dock inte såvida du inte\n"
"sett till att dess arbetskatalog uppdateras till det tu sände in\n"
"på annat sätt.\n"
"\n"
"För att undvika detta meddelande och fortfarande behålla det\n"
-"normala beteendet, sätt \"receive.denyCurrentBranch\" till \"refuse\"."
+"normala beteendet, sätt â€receive.denyCurrentBranch†till â€refuseâ€."
msgid ""
"By default, deleting the current branch is denied, because the next\n"
@@ -10033,14 +10330,14 @@ msgid ""
"To squelch this message, you can set it to 'refuse'."
msgstr ""
"Normalt tillåts inte radering av aktuell gren, eftersom nästa\n"
-"\"git clone\" inte kommer innebära att några filer checkas ut,\n"
+"â€git clone†inte kommer innebära att nÃ¥gra filer checkas ut,\n"
"vilket är förvirrande.\n"
"\n"
-"Du kan ställa in variabeln \"receive.denyDeleteCurrent\" till\n"
-"\"warn\" eller \"ignore\" i fjärrarkivet för att tillåta borttagning\n"
+"Du kan ställa in variabeln â€receive.denyDeleteCurrent†till\n"
+"â€warn†eller â€ignore†i fjärrarkivet för att tillÃ¥ta borttagning\n"
"av aktuell gren, med eller utan varningsmeddelande.\n"
"\n"
-"För att undvika detta meddelande kan du sätta det till \"refuse\"."
+"För att undvika detta meddelande kan du sätta det till â€refuseâ€."
msgid "quiet"
msgstr "tyst"
@@ -10074,7 +10371,7 @@ msgstr "git reflog exists <referens>"
#, c-format
msgid "invalid timestamp '%s' given to '--%s'"
-msgstr "ogiltig tidsstämpel \"%s\" given i \"--%s\""
+msgstr "ogiltig tidsstämpel â€%s†given i â€--%sâ€"
msgid "do not actually prune any entries"
msgstr "rensa faktiskt inte några poster"
@@ -10207,11 +10504,12 @@ msgstr "okänt argument till mirror: %s"
msgid "fetch the remote branches"
msgstr "hämta fjärrgrenarna"
-msgid "import all tags and associated objects when fetching"
-msgstr "importera alla taggar och associerade objekt vid hämtning"
-
-msgid "or do not fetch any tag at all (--no-tags)"
-msgstr "eller hämta inte några taggar alls (--no-tags)"
+msgid ""
+"import all tags and associated objects when fetching\n"
+"or do not fetch any tag at all (--no-tags)"
+msgstr ""
+"importera alla taggar och associerade objekt vid hämtning\n"
+"eller hämta inte några taggar alls (--no-tags)"
msgid "branch(es) to track"
msgstr "gren(ar) att spåra"
@@ -10234,7 +10532,7 @@ msgstr "fjärrarkivet %s finns redan."
#, c-format
msgid "Could not setup master '%s'"
-msgstr "Kunde inte skapa master \"%s\""
+msgstr "Kunde inte skapa master â€%sâ€"
#, c-format
msgid "more than one %s"
@@ -10242,7 +10540,7 @@ msgstr "mer än en %s"
#, c-format
msgid "unhandled branch.%s.rebase=%s; assuming 'true'"
-msgstr "ohanterad branch.%s.rebase=%s; antar \"true\""
+msgstr "ohanterad branch.%s.rebase=%s; antar â€trueâ€"
#, c-format
msgid "Could not get fetch map for refspec %s"
@@ -10256,11 +10554,11 @@ msgstr "(ta bort)"
#, c-format
msgid "could not set '%s'"
-msgstr "kunde inte ställa in \"%s\""
+msgstr "kunde inte ställa in â€%sâ€"
#, c-format
msgid "could not unset '%s'"
-msgstr "kunde inte ta bort inställning för \"%s\""
+msgstr "kunde inte ta bort inställning för â€%sâ€"
#, c-format
msgid ""
@@ -10270,15 +10568,15 @@ msgid ""
msgstr ""
"Konfigurationen för %s för remote.pushDefault i:\n"
"\t%s:%d\n"
-"anger nu den icke-existerande fjärren \"%s\""
+"anger nu den icke-existerande fjärren â€%sâ€"
#, c-format
msgid "No such remote: '%s'"
-msgstr "Ingen sådan fjärr: \"%s\""
+msgstr "Ingen sÃ¥dan fjärr: â€%sâ€"
#, c-format
msgid "Could not rename config section '%s' to '%s'"
-msgstr "Kunde inte byta namn på konfigurationssektionen \"%s\" till \"%s\""
+msgstr "Kunde inte byta namn pÃ¥ konfigurationssektionen â€%s†till â€%sâ€"
#, c-format
msgid ""
@@ -10295,11 +10593,11 @@ msgstr "Byter namn på fjärreferenser"
#, c-format
msgid "deleting '%s' failed"
-msgstr "misslyckades ta bort \"%s\""
+msgstr "misslyckades ta bort â€%sâ€"
#, c-format
msgid "creating '%s' failed"
-msgstr "misslyckades skapa \"%s\""
+msgstr "misslyckades skapa â€%sâ€"
msgid ""
"Note: A branch outside the refs/remotes/ hierarchy was not removed;\n"
@@ -10316,7 +10614,7 @@ msgstr[1] ""
#, c-format
msgid "Could not remove config section '%s'"
-msgstr "Kunde inte ta bort konfigurationssektionen \"%s\""
+msgstr "Kunde inte ta bort konfigurationssektionen â€%sâ€"
#, c-format
msgid " new (next fetch will store in remotes/%s)"
@@ -10325,8 +10623,11 @@ msgstr " ny (nästa hämtning sparar i remotes/%s)"
msgid " tracked"
msgstr " spårad"
+msgid " skipped"
+msgstr " överhoppad"
+
msgid " stale (use 'git remote prune' to remove)"
-msgstr " förlegad (använd \"git remote prune\" för att ta bort)"
+msgstr " förlegad (använd â€git remote prune†för att ta bort)"
msgid " ???"
msgstr " ???"
@@ -10438,17 +10739,17 @@ msgstr " (status inte förfrågad)"
msgid " Local branch configured for 'git pull':"
msgid_plural " Local branches configured for 'git pull':"
-msgstr[0] " Lokal gren konfigurerad för \"git pull\":"
-msgstr[1] " Lokala grenar konfigurerade för \"git pull\":"
+msgstr[0] " Lokal gren konfigurerad för â€git pullâ€:"
+msgstr[1] " Lokala grenar konfigurerade för â€git pullâ€:"
msgid " Local refs will be mirrored by 'git push'"
-msgstr " Lokala referenser speglas av \"git push\""
+msgstr " Lokala referenser speglas av â€git pushâ€"
#, c-format
msgid " Local ref configured for 'git push'%s:"
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:"
+msgstr[0] " Lokal referens konfigurerad för â€git pushâ€%s:"
+msgstr[1] " Lokala referenser konfigurerade för â€git pushâ€%s:"
msgid "set refs/remotes/<name>/HEAD according to remote"
msgstr "sätt refs/remotes/<namn>/HEAD enligt fjärren"
@@ -10503,7 +10804,7 @@ msgstr "rensa fjärrar efter hämtning"
#, c-format
msgid "No such remote '%s'"
-msgstr "Ingen sådan fjärr \"%s\""
+msgstr "Ingen sÃ¥dan fjärr â€%sâ€"
msgid "add branch"
msgstr "lägg till gren"
@@ -10519,7 +10820,7 @@ msgstr "returnera alla URL:er"
#, c-format
msgid "no URLs configured for remote '%s'"
-msgstr "ingen URL:er angivna för fjärren \"%s\""
+msgstr "ingen URL:er angivna för fjärren â€%sâ€"
msgid "manipulate push URLs"
msgstr "manipulera URL:ar för sändning"
@@ -10587,6 +10888,14 @@ msgstr "kunde inte öppna temporär fil %s för skrivning"
msgid "could not close refs snapshot tempfile"
msgstr "kunde inte stänga temporär fil för refs-ögonblicksbild"
+#, c-format
+msgid "could not remove stale bitmap: %s"
+msgstr "kunde inte ta bort gammal bitkarta: %s"
+
+#, c-format
+msgid "pack prefix %s does not begin with objdir %s"
+msgstr "paketprefixet %s börjar inte med objkat %s"
+
msgid "pack everything in a single pack"
msgstr "packa allt i ett enda paket"
@@ -10599,8 +10908,8 @@ msgstr "samma som -a, packa onåbara onödiga objekt separat"
msgid "approxidate"
msgstr "cirkadatum"
-msgid "with -C, expire objects older than this"
-msgstr "med -C, låt tid gå ut för objekt äldre än detta"
+msgid "with --cruft, expire objects older than this"
+msgstr "med --cruft, låt tid gå ut för objekt äldre än detta"
msgid "remove redundant packs, and run git-prune-packed"
msgstr "ta bort överflödiga paket, och kör git-prune-packed"
@@ -10659,23 +10968,33 @@ msgstr "hitta ett geometrisk förlopp med faktor <N>"
msgid "write a multi-pack index of the resulting packs"
msgstr "skriv ett flerpaketsindex för de skapade paketen"
+msgid "pack prefix to store a pack containing pruned objects"
+msgstr "paketprefix att lagra ett paket som innehåller bortrensade objekt"
+
+msgid "pack prefix to store a pack containing filtered out objects"
+msgstr "paketprefix att lagra ett paket som innehåller utfiltrerade objekt"
+
msgid "cannot delete packs in a precious-objects repo"
-msgstr "kan inte ta bort paket i ett \"precious-objects\"-arkiv"
+msgstr "kan inte ta bort paket i ett â€precious-objectsâ€-arkiv"
+
+#, c-format
+msgid "option '%s' can only be used along with '%s'"
+msgstr "flaggan â€%s†kan inte användas med â€%sâ€"
msgid "Nothing new to pack."
msgstr "Inget nytt att packa."
#, c-format
-msgid "pack prefix %s does not begin with objdir %s"
-msgstr "paketprefixet %s börjar inte med objkat %s"
+msgid "renaming pack to '%s' failed"
+msgstr "misslyckades byta namn pÃ¥ paket till â€%sâ€"
#, c-format
-msgid "missing required file: %s"
-msgstr "nödvändig fil saknas: %s"
+msgid "pack-objects did not write a '%s' file for pack %s-%s"
+msgstr "pack-objects skrev inte en â€%sâ€-fil för paketet %s-%s"
#, c-format
msgid "could not unlink: %s"
-msgstr "kunde inte ta bort: \"%s\""
+msgstr "kunde inte ta bort: â€%sâ€"
msgid "git replace [-f] <object> <replacement>"
msgstr "git replace [-f] <objekt> <ersättning>"
@@ -10697,24 +11016,24 @@ msgid ""
"invalid replace format '%s'\n"
"valid formats are 'short', 'medium' and 'long'"
msgstr ""
-"ogiltigt ersättningsformat \"%s\"\n"
-"giltiga format är \"short\", \"medium\" och \"long\""
+"ogiltigt ersättningsformat â€%sâ€\n"
+"giltiga format är â€shortâ€, â€medium†och â€longâ€"
#, c-format
msgid "replace ref '%s' not found"
-msgstr "ersättningsreferensen \"%s\" hittades inte"
+msgstr "ersättningsreferensen â€%s†hittades inte"
#, c-format
msgid "Deleted replace ref '%s'"
-msgstr "Tog bort ersättningsreferensen \"%s\""
+msgstr "Tog bort ersättningsreferensen â€%sâ€"
#, c-format
msgid "'%s' is not a valid ref name"
-msgstr "\"%s\" är inte ett giltigt referensnamn"
+msgstr "â€%s†är inte ett giltigt referensnamn"
#, c-format
msgid "replace ref '%s' already exists"
-msgstr "ersättningsreferensen \"%s\" finns redan"
+msgstr "ersättningsreferensen â€%s†finns redan"
#, c-format
msgid ""
@@ -10723,8 +11042,8 @@ msgid ""
"while '%s' points to a replacement object of type '%s'."
msgstr ""
"Objekt måste vara av samma typ.\n"
-"\"%s\" pekar på ett ersatt objekt med typen \"%s\"\n"
-"medan \"%s\" pekar på ett ersättningsobjekt av typen \"%s\"."
+"â€%s†pekar pÃ¥ ett ersatt objekt med typen â€%sâ€\n"
+"medan â€%s†pekar pÃ¥ ett ersättningsobjekt av typen â€%sâ€."
#, c-format
msgid "unable to open %s for writing"
@@ -10751,7 +11070,7 @@ msgstr "mktree returnerade inte ett objektnamn"
#, c-format
msgid "unable to fstat %s"
-msgstr "kan inte utföra \"fstat\" på %s"
+msgstr "kan inte utföra â€fstat†pÃ¥ %s"
msgid "unable to write object to database"
msgstr "kan inte skriva objektet till databasen"
@@ -10765,7 +11084,7 @@ msgstr "misslyckades redigera objektfilen"
#, c-format
msgid "new object is the same as the old one: '%s'"
-msgstr "nytt objekt är samma som det gamla: \"%s\""
+msgstr "nytt objekt är samma som det gamla: â€%sâ€"
#, c-format
msgid "could not parse %s as a commit"
@@ -10773,38 +11092,38 @@ msgstr "kunde inte tolka %s som incheckning"
#, c-format
msgid "bad mergetag in commit '%s'"
-msgstr "felaktig sammanslagningstagg i incheckningen \"%s\""
+msgstr "felaktig sammanslagningstagg i incheckningen â€%sâ€"
#, c-format
msgid "malformed mergetag in commit '%s'"
-msgstr "felformad sammanslagningstagg i incheckningen \"%s\""
+msgstr "felformad sammanslagningstagg i incheckningen â€%sâ€"
#, c-format
msgid ""
"original commit '%s' contains mergetag '%s' that is discarded; use --edit "
"instead of --graft"
msgstr ""
-"den ursprungliga incheckningen \"%s\" innehåller sammanslagningstaggen \"%s"
-"\" som har förkastats; använd --edit istället för --graft"
+"den ursprungliga incheckningen â€%s†innehÃ¥ller sammanslagningstaggen â€%s†"
+"som har förkastats; använd --edit istället för --graft"
#, c-format
msgid "the original commit '%s' has a gpg signature"
-msgstr "den ursprungliga incheckningen \"%s\" har en gpg-signatur"
+msgstr "den ursprungliga incheckningen â€%s†har en gpg-signatur"
msgid "the signature will be removed in the replacement commit!"
msgstr "signaturen kommer att tas bort i ersättningsincheckningen!"
#, c-format
msgid "could not write replacement commit for: '%s'"
-msgstr "kunde inte skriva ersättningsincheckning för: \"%s\""
+msgstr "kunde inte skriva ersättningsincheckning för: â€%sâ€"
#, c-format
msgid "graft for '%s' unnecessary"
-msgstr "ympning för \"%s\" behövs inte"
+msgstr "ympning för â€%s†behövs inte"
#, c-format
msgid "new commit is the same as the old one: '%s'"
-msgstr "ny incheckning är samma som den gamla: \"%s\""
+msgstr "ny incheckning är samma som den gamla: â€%sâ€"
#, c-format
msgid ""
@@ -10865,18 +11184,90 @@ msgstr "--convert-graft-file tar inga argument"
msgid "only one pattern can be given with -l"
msgstr "endast ett mönster kan anges med -l"
-msgid "git rerere [clear | forget <path>... | status | remaining | diff | gc]"
-msgstr "git rerere [clear | forget <path>... | status | remaining | diff | gc]"
+msgid "need some commits to replay"
+msgstr "behöver några incheckningar för omspelning"
+
+msgid "--onto and --advance are incompatible"
+msgstr "--onto och --advance kan inte kombineras"
+
+msgid "all positive revisions given must be references"
+msgstr "alla positiva revisioner som anges måste vara referenser"
+
+msgid "argument to --advance must be a reference"
+msgstr "argumentet till --advance måste vara en referens"
+
+msgid ""
+"cannot advance target with multiple sources because ordering would be ill-"
+"defined"
+msgstr ""
+"kan inte flytta målet framåt när det finns flera källor eftersom ordningen "
+"inte kan fastställas"
+
+msgid ""
+"cannot implicitly determine whether this is an --advance or --onto operation"
+msgstr ""
+"kan inte avgöra om den underförstådda processen är --advance eller --onto"
+
+msgid ""
+"cannot advance target with multiple source branches because ordering would "
+"be ill-defined"
+msgstr ""
+"kan inte flytta målet framåt när det finns flera källgrenar eftersom "
+"ordningen inte kan fastställas"
+
+msgid "cannot implicitly determine correct base for --onto"
+msgstr "kan inte avgöra den underförstådda basen för --onto"
+
+msgid ""
+"(EXPERIMENTAL!) git replay ([--contained] --onto <newbase> | --advance "
+"<branch>) <revision-range>..."
+msgstr ""
+"(EXPERIMENTELLT!) git replay ([--contained] --onto <nybas> | --advance "
+"<gren>) <revisions-intervall>..."
+
+msgid "make replay advance given branch"
+msgstr "låt omspelningen flytta den givna grenen framåt"
+
+msgid "replay onto given commit"
+msgstr "spela om ovanpå en given incheckning"
+
+msgid "advance all branches contained in revision-range"
+msgstr "flytta alla grenar som finns i revisionsintervallet framåt"
+
+msgid "option --onto or --advance is mandatory"
+msgstr "flaggan --onto eller --advance måste anges"
+
+#, c-format
+msgid ""
+"some rev walking options will be overridden as '%s' bit in 'struct rev_info' "
+"will be forced"
+msgstr ""
+"nÃ¥gra flaggor för revisionstraversering kommer överstyras eftersom â€%sâ€-"
+"biten i â€struct rev_info†kommer att tvingas"
+
+msgid "error preparing revisions"
+msgstr "fel när revisioner skulle förberedas"
+
+msgid "replaying down to root commit is not supported yet!"
+msgstr "kan ännu inte spela om hela vägen ned till rotincheckningen!"
+
+msgid "replaying merge commits is not supported yet!"
+msgstr "kan ännu inte spela om sammanslagningsincheckningar!"
+
+msgid ""
+"git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]"
+msgstr ""
+"git rerere [clear | forget <sökväg>... | diff | status | remaining | gc]"
msgid "register clean resolutions in index"
msgstr "registrera rena lösningar i indexet"
msgid "'git rerere forget' without paths is deprecated"
-msgstr "\"git rerere forget\" utan sökvägar är föråldrat"
+msgstr "â€git rerere forget†utan sökvägar är förÃ¥ldrat"
#, c-format
msgid "unable to generate diff for '%s'"
-msgstr "misslyckades skapa diff för \"%s\""
+msgstr "misslyckades skapa diff för â€%sâ€"
msgid ""
"git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]"
@@ -10950,15 +11341,15 @@ msgstr "registrera endast att borttagna sökvägar kommer läggas till senare"
#, c-format
msgid "Failed to resolve '%s' as a valid revision."
-msgstr "Kunde inte slå upp \"%s\" som en giltig revision."
+msgstr "Kunde inte slÃ¥ upp â€%s†som en giltig revision."
#, c-format
msgid "Failed to resolve '%s' as a valid tree."
-msgstr "Kunde inte slå upp \"%s\" som ett giltigt träd."
+msgstr "Kunde inte slÃ¥ upp â€%s†som ett giltigt träd."
msgid "--mixed with paths is deprecated; use 'git reset -- <paths>' instead."
msgstr ""
-"--mixed rekommenderas inte med sökvägar; använd \"git reset -- <sökvägar>\"."
+"--mixed rekommenderas inte med sökvägar; använd â€git reset -- <sökvägar>â€."
#, c-format
msgid "Cannot do %s reset with paths."
@@ -10977,11 +11368,11 @@ msgid ""
"'--no-refresh' to avoid this."
msgstr ""
"Det tog %.2f sekunder att uppdatera indexet efter återställning.\n"
-"Du kan använda \"--no-refresh\" för undvika detta."
+"Du kan använda â€--no-refresh†för undvika detta."
#, c-format
msgid "Could not reset index file to revision '%s'."
-msgstr "Kunde inte återställa indexfilen till versionen \"%s\"."
+msgstr "Kunde inte Ã¥terställa indexfilen till versionen â€%sâ€."
msgid "Could not write new index file."
msgstr "Kunde inte skriva ny indexfil."
@@ -10990,18 +11381,22 @@ msgstr "Kunde inte skriva ny indexfil."
msgid "unable to get disk usage of %s"
msgstr "kan inte hämta diskanvändning för %s"
+#, c-format
+msgid "invalid value for '%s': '%s', the only allowed format is '%s'"
+msgstr "felaktigt värde för â€%sâ€: â€%sâ€, det enda tillÃ¥tna formatet är â€%sâ€"
+
msgid "rev-list does not support display of notes"
msgstr "rev-list stöder inte visning av anteckningar"
#, c-format
msgid "marked counting and '%s' cannot be used together"
-msgstr "markerad räkning och \"%s\" kan inte användas samtidigt."
+msgstr "markerad räkning och â€%s†kan inte användas samtidigt."
msgid "git rev-parse --parseopt [<options>] -- [<args>...]"
msgstr "git rev-parse --parseopt [<options>] -- [<argument>...]"
msgid "keep the `--` passed as an arg"
-msgstr "behåll \"--\" sänt som argument"
+msgstr "behÃ¥ll â€--†sänt som argument"
msgid "stop parsing after the first non-option argument"
msgstr "sluta tolka efter första argument som inte är flagga"
@@ -11013,7 +11408,10 @@ msgid "premature end of input"
msgstr "för tidigt slut på indata"
msgid "no usage string given before the `--' separator"
-msgstr "ingen användningssträng angavs före \"--\"-avdelaren"
+msgstr "ingen användningssträng angavs före â€--â€-avdelaren"
+
+msgid "missing opt-spec before option flags"
+msgstr "saknar flagg-spec före alternativflaggor"
msgid "Needed a single revision"
msgstr "Behövde ensam revision"
@@ -11029,7 +11427,7 @@ msgstr ""
" eller: git rev-parse --sq-quote [<argument>...]\n"
" eller: git rev-parse [<flaggor>] [<argument>...]\n"
"\n"
-"Kör \"git rev-parse --parseopt -h\" för mer information om den första "
+"Kör â€git rev-parse --parseopt -h†för mer information om den första "
"varianten."
msgid "--resolve-git-dir requires an argument"
@@ -11037,7 +11435,7 @@ msgstr "--resolve-git-dir kräver ett argument"
#, c-format
msgid "not a gitdir '%s'"
-msgstr "inte en gitkatalog \"%s\""
+msgstr "inte en gitkatalog â€%sâ€"
msgid "--git-path requires an argument"
msgstr "--git-path kräver ett argument"
@@ -11065,25 +11463,36 @@ msgstr "okänt läge för --abbrev-ref: %s"
msgid "this operation must be run in a work tree"
msgstr "funktionen måste köras i en arbetskatalog"
+msgid "Could not read the index"
+msgstr "Kunde inte läsa indexet"
+
#, c-format
msgid "unknown mode for --show-object-format: %s"
msgstr "okänt läge för --show-object-format: %s"
-msgid "git revert [<options>] <commit-ish>..."
-msgstr "git revert [<flaggor>] <incheckning-igt>..."
+msgid ""
+"git revert [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] "
+"<commit>..."
+msgstr ""
+"git revert [--[no-]edit] [-n] [-m <förälder-nummer>] [-s] [-S[<nyckelid>]] "
+"<incheckning>..."
-msgid "git revert <subcommand>"
-msgstr "git revert <underkommando>"
+msgid "git revert (--continue | --skip | --abort | --quit)"
+msgstr "git revert (--continue | --skip | --abort | --quit)"
-msgid "git cherry-pick [<options>] <commit-ish>..."
-msgstr "git cherry-pick [<flaggor>] <incheckning-igt>..."
+msgid ""
+"git cherry-pick [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff]\n"
+" [-S[<keyid>]] <commit>..."
+msgstr ""
+"git cherry-pick [--edit] [-n] [-m <förälder-nummer>] [-s] [-x] [--ff]\n"
+" [-S[<nyckelid>]] <incheckning>..."
-msgid "git cherry-pick <subcommand>"
-msgstr "git cherry-pick <underkommando>"
+msgid "git cherry-pick (--continue | --skip | --abort | --quit)"
+msgstr "git cherry-pick (--continue | --skip | --abort | --quit)"
#, c-format
msgid "option `%s' expects a number greater than zero"
-msgstr "flaggan \"%s\" antar ett numeriskt värde större än noll"
+msgstr "flaggan â€%s†antar ett numeriskt värde större än noll"
#, c-format
msgid "%s: %s cannot be used with %s"
@@ -11132,16 +11541,22 @@ msgid "keep redundant, empty commits"
msgstr "behåll redundanta, tomma incheckningar"
msgid "use the 'reference' format to refer to commits"
-msgstr "använd \"referens\"-format för att referera till incheckningar"
+msgstr "använd â€referensâ€-format för att referera till incheckningar"
msgid "revert failed"
-msgstr "\"revert\" misslyckades"
+msgstr "â€revert†misslyckades"
msgid "cherry-pick failed"
-msgstr "\"cherry-pick\" misslyckades"
+msgstr "â€cherry-pick†misslyckades"
-msgid "git rm [<options>] [--] <file>..."
-msgstr "git rm [<flaggor>] [--] <fil>..."
+msgid ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<fil> [--pathspec-file-nul]]\n"
+" [--] [<sökväg>...]"
msgid ""
"the following file has staged content different from both the\n"
@@ -11198,11 +11613,11 @@ 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"
+"löa dina ändringar i .gitmodules eller använd â€stash†för att fortsätta"
#, c-format
msgid "not removing '%s' recursively without -r"
-msgstr "tar inte bort \"%s\" rekursivt utan -r"
+msgstr "tar inte bort â€%s†rekursivt utan -r"
#, c-format
msgid "git rm: unable to remove %s"
@@ -11212,16 +11627,21 @@ msgid ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
" [<host>:]<directory> (--all | <ref>...)"
msgstr ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
" [<värd>:]<katalog> (--all | <ref>...)"
msgid "remote name"
msgstr "fjärrnamn"
+msgid "push all refs"
+msgstr "sänd alla referenser"
+
msgid "use stateless RPC protocol"
msgstr "använd tillståndslöst RPC-protokoll"
@@ -11238,10 +11658,11 @@ msgid "git log --pretty=short | git shortlog [<options>]"
msgstr "git log --pretty=short | git shortlog [<flaggor>]"
msgid "using multiple --group options with stdin is not supported"
-msgstr "mer än en \"--group\"-flagga stöds inte med standard in"
+msgstr "mer än en â€--groupâ€-flagga stöds inte med standard in"
-msgid "using --group=trailer with stdin is not supported"
-msgstr "att använda --group=trailer stöds inte med standard in"
+#, c-format
+msgid "using %s with stdin is not supported"
+msgstr "använda %s med standard in stöds inte"
#, c-format
msgid "unknown group type: %s"
@@ -11278,12 +11699,14 @@ msgid ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
" [--current] [--color[=<when>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<rev> | <glob>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<rev> | <glob>)...]"
msgstr ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
" [--current] [--color[=<när>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<rev> | <mönster>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<rev> | <mönster>)...]"
msgid "git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]"
msgstr "git show-branch (-g | --reflog)[=<n>[,<bas>]] [--list] [<ref>]"
@@ -11305,7 +11728,7 @@ msgid "show remote-tracking branches"
msgstr "visa fjärrspårande grenar"
msgid "color '*!+-' corresponding to the branch"
-msgstr "färga \"*!+-\" enligt grenen"
+msgstr "färga â€*!+-†enligt grenen"
msgid "show <n> more commits after the common ancestor"
msgstr "visa <n> ytterligare incheckningar efter gemensam anfader"
@@ -11370,7 +11793,7 @@ msgstr[1] "kan inte hantera mer än %d revisioner."
#, c-format
msgid "'%s' is not a valid ref."
-msgstr "\"%s\" är inte en giltig referens."
+msgstr "â€%s†är inte en giltig referens."
#, c-format
msgid "cannot find commit %s (%s)"
@@ -11383,21 +11806,44 @@ msgid "Unknown hash algorithm"
msgstr "okänd hashningsalgoritm"
msgid ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...]"
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<pattern>...]"
+msgstr ""
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<mönster>...]"
+
+msgid ""
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<ref>...]"
msgstr ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<mönster>...]"
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<ref>...]"
msgid "git show-ref --exclude-existing[=<pattern>]"
msgstr "git show-ref --exclude-existing[=<mönster>]"
+msgid "git show-ref --exists <ref>"
+msgstr "git show-ref --exists <ref>"
+
+msgid "reference does not exist"
+msgstr "referensen existerar inte"
+
+msgid "failed to look up reference"
+msgstr "misslyckades slå upp referensen"
+
msgid "only show tags (can be combined with heads)"
msgstr "visa endast taggar (kan kombineras med huvuden)"
msgid "only show heads (can be combined with tags)"
msgstr "visa endast huvuden (kan kombineras med taggar)"
+msgid "check for reference existence without resolving"
+msgstr "kontrollerar att referensen existerar utan att slå upp dem"
+
msgid "stricter reference checking, requires exact ref path"
msgstr "striktare referenskontroll, kräver exakt referenssökväg"
@@ -11416,8 +11862,12 @@ msgstr "visa inte resultat på standard ut (användbart med --verify)"
msgid "show refs from stdin that aren't in local repository"
msgstr "visa referenser från standard in som inte finns i lokalt arkiv"
-msgid "git sparse-checkout (init|list|set|add|reapply|disable) <options>"
-msgstr "git sparse-checkout (init|list|set|add|reapply|disable) <flaggor>"
+msgid ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
+msgstr ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) <flaggor>"
msgid "this worktree is not sparse"
msgstr "arbetskatalogen är inte gren"
@@ -11431,15 +11881,15 @@ msgid ""
"directory '%s' contains untracked files, but is not in the sparse-checkout "
"cone"
msgstr ""
-"katalogen \"%s\" innehåller ospårade filer, men är inte i området som ages i "
-"\"sparse-checkout\""
+"katalogen â€%s†innehÃ¥ller ospÃ¥rade filer, men är inte i omrÃ¥det som ages i "
+"â€sparse-checkoutâ€"
#, c-format
msgid "failed to remove directory '%s'"
-msgstr "misslyckades ta bort katalogen \"%s\""
+msgstr "misslyckades ta bort katalogen â€%sâ€"
msgid "failed to create directory for sparse-checkout file"
-msgstr "misslyckades skapa katalog för \"sparse-checkout\"-filen"
+msgstr "misslyckades skapa katalog för â€sparse-checkoutâ€-filen"
msgid "failed to initialize worktree config"
msgstr "misslyckades initiera arbetskataloginställning"
@@ -11459,15 +11909,15 @@ msgstr "kunde inte skapa inledande kataloger för %s"
#, c-format
msgid "failed to open '%s'"
-msgstr "misslyckades öppna \"%s\""
+msgstr "misslyckades öppna â€%sâ€"
#, c-format
msgid "could not normalize path %s"
-msgstr "kunde inte normalisera sökvägen \"%s\""
+msgstr "kunde inte normalisera sökvägen â€%sâ€"
#, c-format
msgid "unable to unquote C-style string '%s'"
-msgstr "kan inte ta bort citering av C-sträng \"%s\""
+msgstr "kan inte ta bort citering av C-sträng â€%sâ€"
msgid "unable to load existing sparse-checkout patterns"
msgstr "kunde inte läsa in existerande mönster för gles utcheckning"
@@ -11485,8 +11935,8 @@ msgid ""
"specify directories rather than patterns. If your directory starts with a "
"'!', pass --skip-checks"
msgstr ""
-"ange kataloger istället för mönster. Om din katalog börjar med ett \"!\", "
-"sänd med --skip-checks"
+"ange kataloger istället för mönster. Om din katalog börjar med ett â€!â€, sänd "
+"med --skip-checks"
msgid ""
"specify directories rather than patterns. If your directory really has any "
@@ -11500,7 +11950,7 @@ msgid ""
"'%s' is not a directory; to treat it as a directory anyway, rerun with --"
"skip-checks"
msgstr ""
-"\"%s\" är inte en katalog: för att ändå behandla det som en katalog, kör på "
+"â€%s†är inte en katalog: för att ändÃ¥ behandla det som en katalog, kör pÃ¥ "
"nytt med --skip-checks"
#, c-format
@@ -11508,7 +11958,7 @@ msgid ""
"pass a leading slash before paths such as '%s' if you want a single file "
"(see NON-CONE PROBLEMS in the git-sparse-checkout manual)."
msgstr ""
-"sänd med ett inledande snedstreck före sökvägar som \"%s\" om du vill ha en "
+"sänd med ett inledande snedstreck före sökvägar som â€%s†om du vill ha en "
"enstaka file (se NON-CONE PROBLEMS i manualen git-sparse-checkout)."
msgid "git sparse-checkout add [--skip-checks] (--stdin | <patterns>)"
@@ -11540,85 +11990,92 @@ msgstr ""
msgid "error while refreshing working directory"
msgstr "fel vid uppdatering av arbetskatalog"
-msgid "git stash list [<options>]"
-msgstr "git stash list [<flaggor>]"
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks] [--[no-]cone] [--rules-"
+"file <fil>]"
-msgid "git stash show [<options>] [<stash>]"
-msgstr "git stash show [<flaggor>] [<stash>]"
+msgid "terminate input and output files by a NUL character"
+msgstr "avsluta in- och utdatafiler med NUL-tecken"
-msgid "git stash drop [-q|--quiet] [<stash>]"
-msgstr "git stash drop [-q|--quiet] [<stash>]"
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr "om används med --rules-file tolka mönster som kon-lägemönster"
-msgid "git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"
+msgid "use patterns in <file> instead of the current ones."
+msgstr "använd mönster i <fil> istället för de nuvarande."
-msgid "git stash branch <branchname> [<stash>]"
-msgstr "git stash branch <grennamn> [<stash>]"
+msgid "git stash list [<log-options>]"
+msgstr "git stash list [<â€logâ€-flaggor>]"
msgid ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
-" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
-" [--] [<pathspec>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<diff-"
+"options>] [<stash>]"
msgstr ""
-"git stash [push [-p|--patch] [S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <meddelande>]\n"
-" [--pathspec-from-file=<fil> [--pathspec-file-nul]]\n"
-" [--] [<sökväg>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<â€diffâ€-"
+"flaggor>] [<stash>]"
-msgid ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
-msgstr ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<meddelande>]"
+msgid "git stash drop [-q | --quiet] [<stash>]"
+msgstr "git stash drop [-q | --quiet] [<stash>]"
-msgid "git stash pop [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash pop [--index] [-q|--quiet] [<stash>]"
+msgid "git stash pop [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash pop [--index] [-q | --quiet] [<stash>]"
-msgid "git stash apply [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash apply [--index] [-q|--quiet] [<stash>]"
+msgid "git stash apply [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash apply [--index] [-q | --quiet] [<stash>]"
-msgid "git stash store [-m|--message <message>] [-q|--quiet] <commit>"
-msgstr "git stash store [-m|--message <meddelande>] [-q|--quiet] <incheckning>"
+msgid "git stash branch <branchname> [<stash>]"
+msgstr "git stash branch <grennamn> [<stash>]"
+
+msgid "git stash store [(-m | --message) <message>] [-q | --quiet] <commit>"
+msgstr ""
+"git stash store [(-m | --message) <meddelande>] [-q | --quiet] <incheckning>"
msgid ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<message>]\n"
+" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
" [--] [<pathspec>...]]"
msgstr ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <meddelande>]\n"
+"git stash [push [-p | --patch] [S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message "
+"<meddelande>]\n"
+" [--pathspec-from-file=<fil> [--pathspec-file-nul]]\n"
" [--] [<sökväg>...]]"
msgid ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<message>]"
msgstr ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<meddelande>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<meddelande>]"
+
+msgid "git stash create [<message>]"
+msgstr "git stash create [<meddelande>]"
#, c-format
msgid "'%s' is not a stash-like commit"
-msgstr "\"%s\" är inte en \"stash\"-liknande incheckning"
+msgstr "â€%s†är inte en â€stashâ€-liknande incheckning"
#, c-format
msgid "Too many revisions specified:%s"
msgstr "För många revisioner angivna:%s"
msgid "No stash entries found."
-msgstr "Inga \"stash\"-poster hittades."
+msgstr "Inga â€stashâ€-poster hittades."
#, c-format
msgid "%s is not a valid reference"
msgstr "%s är inte en giltigt referens"
msgid "git stash clear with arguments is unimplemented"
-msgstr "\"git stash clear\" med argument har inte implementerats"
+msgstr "â€git stash clear†med argument har inte implementerats"
#, c-format
msgid ""
@@ -11627,11 +12084,11 @@ msgid ""
" to make room.\n"
msgstr ""
"VARNING: En ospårad fil är i vägen för en spårad fil! Byter namn\n"
-" %s -> %s\n"
+" %s → %s\n"
" för att lämna plats.\n"
msgid "cannot apply a stash in the middle of a merge"
-msgstr "kan inte tillämpa en \"stash\" mitt i en sammanslagning"
+msgstr "kan inte tillämpa en â€stash†mitt i en sammanslagning"
#, c-format
msgid "could not generate diff %s^!."
@@ -11648,7 +12105,7 @@ msgid "Merging %s with %s"
msgstr "Slår ihop %s med %s"
msgid "Index was not unstashed."
-msgstr "Indexet har inte tagits upp ur \"stash\":en"
+msgstr "Indexet har inte tagits upp ur â€stashâ€:en"
msgid "could not restore untracked files from stash"
msgstr "kunde inte återställa ospårade filer från stash-post"
@@ -11662,11 +12119,11 @@ msgstr "Kastade %s (%s)"
#, c-format
msgid "%s: Could not drop stash entry"
-msgstr "%s: Kunde inte kasta \"stash\"-post"
+msgstr "%s: Kunde inte kasta â€stashâ€-post"
#, c-format
msgid "'%s' is not a stash reference"
-msgstr "\"%s\" är inte en \"stash\"-referens"
+msgstr "â€%s†är inte en â€stashâ€-referens"
msgid "The stash entry is kept in case you need it again."
msgstr "Stash-posten behålls ifall du behöver den igen."
@@ -11681,20 +12138,20 @@ msgid "failed to unpack trees"
msgstr "misslyckades packa upp träd"
msgid "include untracked files in the stash"
-msgstr "ta med ospårade filer i \"stash\""
+msgstr "ta med ospÃ¥rade filer i â€stashâ€"
msgid "only show untracked files in the stash"
-msgstr "visa bara ospårade filer i \"stash\""
+msgstr "visa bara ospÃ¥rade filer i â€stashâ€"
#, c-format
msgid "Cannot update %s with %s"
msgstr "Kan inte uppdatera %s med %s"
msgid "stash message"
-msgstr "\"stash\"-meddelande"
+msgstr "â€stashâ€-meddelande"
msgid "\"git stash store\" requires one <commit> argument"
-msgstr "\"git stash store\" kräver ett <incheckning>-argument"
+msgstr "â€git stash store†kräver ett <incheckning>-argument"
msgid "No staged changes"
msgstr "Inga köade ändringar"
@@ -11728,13 +12185,13 @@ msgstr ""
"Kan inte använda --staged och --include-untracked eller --all samtidigt"
msgid "Did you forget to 'git add'?"
-msgstr "Glömde du använda \"git add\"?"
+msgstr "Glömde du använda â€git addâ€?"
msgid "No local changes to save"
msgstr "Inga lokala ändringar att spara"
msgid "Cannot initialize stash"
-msgstr "Kan inte initiera \"stash\""
+msgstr "Kan inte initiera â€stashâ€"
msgid "Cannot save the current status"
msgstr "Kan inte spara aktuell status"
@@ -11753,13 +12210,13 @@ msgid "stash staged changes only"
msgstr "stash:a endast köade ändringar"
msgid "stash in patch mode"
-msgstr "\"stash\" i \"patch\"-läge"
+msgstr "â€stash†i â€patchâ€-läge"
msgid "quiet mode"
msgstr "tyst läge"
msgid "include untracked files in stash"
-msgstr "ta med ospårade filer i \"stash\""
+msgstr "ta med ospÃ¥rade filer i â€stashâ€"
msgid "include ignore files"
msgstr "ta med ignorerade filer"
@@ -11775,26 +12232,24 @@ msgid "Expecting a full ref name, got %s"
msgstr "Förväntade fullt referensnamn, fick %s"
#, c-format
+msgid "could not get a repository handle for submodule '%s'"
+msgstr "kunde inte fÃ¥ tag i arkivhandtag för undermodulen â€%sâ€"
+
+#, c-format
msgid ""
"could not look up configuration '%s'. Assuming this repository is its own "
"authoritative upstream."
msgstr ""
-"kunde inte slå upp konfigurationen \"%s\". Antar att arkivet är sin eget "
+"kunde inte slÃ¥ upp konfigurationen â€%sâ€. Antar att arkivet är sin eget "
"officiella uppström."
-msgid "alternative anchor for relative paths"
-msgstr "alternativa ankare för relativa sökvägar"
-
-msgid "git submodule--helper list [--prefix=<path>] [<path>...]"
-msgstr "git submodule--helper list [--prefix=<sökväg>] [<sökväg>...]"
-
#, c-format
msgid "No url found for submodule path '%s' in .gitmodules"
-msgstr "Hittade ingen url för undermodulsökvägen \"%s\" i .gitmodules"
+msgstr "Hittade ingen url för undermodulsökvägen â€%s†i .gitmodules"
#, c-format
msgid "Entering '%s'\n"
-msgstr "GÃ¥r in i \"%s\"\n"
+msgstr "GÃ¥r in i â€%sâ€\n"
#, c-format
msgid ""
@@ -11820,42 +12275,42 @@ msgstr "dölj utdata från för varje undermodulskommando som startas"
msgid "recurse into nested submodules"
msgstr "rekursera in i nästlade undermoduler"
-msgid "git submodule--helper foreach [--quiet] [--recursive] [--] <command>"
-msgstr "git submodule--helper sync [--quiet] [--recursive] [--] [<kommando>]"
+msgid "git submodule foreach [--quiet] [--recursive] [--] <command>"
+msgstr "git submodule foreach [--quiet] [--recursive] [--] <kommando>"
#, c-format
msgid "Failed to register url for submodule path '%s'"
-msgstr "Misslyckades registrera url för undermodulsökväg \"%s\""
+msgstr "Misslyckades registrera url för undermodulsökväg â€%sâ€"
#, c-format
msgid "Submodule '%s' (%s) registered for path '%s'\n"
-msgstr "Undermodulen \"%s\" (%s) registrerad för sökvägen \"%s\"\n"
+msgstr "Undermodulen â€%s†(%s) registrerad för sökvägen â€%sâ€\n"
#, c-format
msgid "warning: command update mode suggested for submodule '%s'\n"
-msgstr "varning: kommandouppdateringsläge föreslogs för undermodulen \"%s\"\n"
+msgstr "varning: kommandouppdateringsläge föreslogs för undermodulen â€%sâ€\n"
#, c-format
msgid "Failed to register update mode for submodule path '%s'"
-msgstr "Misslyckades registrera uppdateringsläge för undermodulsökväg \"%s\""
+msgstr "Misslyckades registrera uppdateringsläge för undermodulsökväg â€%sâ€"
msgid "suppress output for initializing a submodule"
msgstr "dölj utdata från initiering av undermodul"
-msgid "git submodule--helper init [<options>] [<path>]"
-msgstr "git submodule--helper init [<flaggor>] [<sökväg>]"
+msgid "git submodule init [<options>] [<path>]"
+msgstr "git submodule init [<flaggor>] [<sökväg>]"
#, c-format
msgid "no submodule mapping found in .gitmodules for path '%s'"
-msgstr "hittade ingen undermodulmappning i .gitmodules för sökvägen \"%s\""
+msgstr "hittade ingen undermodulmappning i .gitmodules för sökvägen â€%sâ€"
#, c-format
msgid "could not resolve HEAD ref inside the submodule '%s'"
-msgstr "kunde inte bestämma HEAD:s incheckning i undermodulen \"%s\""
+msgstr "kunde inte bestämma HEAD:s incheckning i undermodulen â€%sâ€"
#, c-format
msgid "failed to recurse into submodule '%s'"
-msgstr "misslyckades rekursera in i undermodulen \"%s\""
+msgstr "misslyckades rekursera in i undermodulen â€%sâ€"
msgid "suppress submodule status output"
msgstr "hindra statusutskrift för undermodul"
@@ -11870,16 +12325,13 @@ msgstr ""
msgid "git submodule status [--quiet] [--cached] [--recursive] [<path>...]"
msgstr "git submodule status [--quitet] [--cached] [--recursive] [<sökväg>...]"
-msgid "git submodule--helper name <path>"
-msgstr "git submodule--helper name <sökväg>"
-
#, c-format
msgid "* %s %s(blob)->%s(submodule)"
-msgstr "* %s %s(blob)->%s(submodule)"
+msgstr "* %s %s(blob)→%s(submodule)"
#, c-format
msgid "* %s %s(submodule)->%s(blob)"
-msgstr "* %s %s(submodule)->%s(blob)"
+msgstr "* %s %s(submodule)→%s(blob)"
#, c-format
msgid "%s"
@@ -11887,7 +12339,7 @@ msgstr "%s"
#, c-format
msgid "couldn't hash object from '%s'"
-msgstr "kunde inte hasha objekt från \"%s\""
+msgstr "kunde inte hasha objekt frÃ¥n â€%sâ€"
#, c-format
msgid "unexpected mode %o\n"
@@ -11901,46 +12353,41 @@ msgstr "jämför incheckningen i indexet med den i undermodulens HEAD"
msgid "skip submodules with 'ignore_config' value set to 'all'"
msgstr ""
-"hoppa över undermoduler där värdet för \"ignore_config\" är satt till \"all\""
+"hoppa över undermoduler där värdet för â€ignore_config†är satt till â€allâ€"
msgid "limit the summary size"
msgstr "begränsa översiktsstorleken"
-msgid "git submodule--helper summary [<options>] [<commit>] [--] [<path>]"
-msgstr ""
-"git submodule--helper summary [<flaggor>] [<incheckning>] [--] [<sökväg>]"
+msgid "git submodule summary [<options>] [<commit>] [--] [<path>]"
+msgstr "git submodule summary [<flaggor>] [<incheckning>] [--] [<sökväg>]"
msgid "could not fetch a revision for HEAD"
msgstr "kunde inte hämta en version för HEAD"
#, c-format
msgid "Synchronizing submodule url for '%s'\n"
-msgstr "Synkroniserar undermodul-url för \"%s\"\n"
+msgstr "Synkroniserar undermodul-url för â€%sâ€\n"
#, c-format
msgid "failed to register url for submodule path '%s'"
-msgstr "misslyckades registrera url för undermodulsökväg \"%s\""
-
-#, c-format
-msgid "failed to get the default remote for submodule '%s'"
-msgstr "misslyckades hämta standardfjärr för undermodulsökväg \"%s\""
+msgstr "misslyckades registrera url för undermodulsökväg â€%sâ€"
#, c-format
msgid "failed to update remote for submodule '%s'"
-msgstr "misslyckades uppdatera fjärr för undermodulsökväg \"%s\""
+msgstr "misslyckades uppdatera fjärr för undermodulsökväg â€%sâ€"
msgid "suppress output of synchronizing submodule url"
msgstr "dölj utdata från synkronisering av undermodul-url"
-msgid "git submodule--helper sync [--quiet] [--recursive] [<path>]"
-msgstr "git submodule--helper sync [--quiet] [--recursive] [<sökväg>]"
+msgid "git submodule sync [--quiet] [--recursive] [<path>]"
+msgstr "git submodule sync [--quiet] [--recursive] [<sökväg>]"
#, c-format
msgid ""
"Submodule work tree '%s' contains a .git directory. This will be replaced "
"with a .git file by using absorbgitdirs."
msgstr ""
-"Undermodulsarbetskatalogen \"%s\" innehåller en .git-katalog. Denna kommer "
+"Undermodulsarbetskatalogen â€%s†innehÃ¥ller en .git-katalog. Denna kommer "
"ersättas med en .git-fil med absorbgitdirs."
#, c-format
@@ -11948,16 +12395,15 @@ msgid ""
"Submodule work tree '%s' contains local modifications; use '-f' to discard "
"them"
msgstr ""
-"Undermodulens arbetskatalog \"%s\" har lokala ändringar; \"-f\" kastar bort "
-"dem"
+"Undermodulens arbetskatalog â€%s†har lokala ändringar; â€-f†kastar bort dem"
#, c-format
msgid "Cleared directory '%s'\n"
-msgstr "Rensade katalogen \"%s\"\n"
+msgstr "Rensade katalogen â€%sâ€\n"
#, c-format
msgid "Could not remove submodule work tree '%s'\n"
-msgstr "Kunde inte ta bort undermodulens arbetskatalog \"%s\"\n"
+msgstr "Kunde inte ta bort undermodulens arbetskatalog â€%sâ€\n"
#, c-format
msgid "could not create empty submodule directory %s"
@@ -11965,7 +12411,7 @@ msgstr "kunde inte skapa tom undermodulskatalog %s"
#, c-format
msgid "Submodule '%s' (%s) unregistered for path '%s'\n"
-msgstr "Undermodulen \"%s\" (%s) registrerad för sökvägen \"%s\"\n"
+msgstr "Undermodulen â€%s†(%s) registrerad för sökvägen â€%sâ€\n"
msgid "remove submodule working trees even if they contain local changes"
msgstr ""
@@ -11980,7 +12426,7 @@ msgstr ""
"git submodule deinit [--quiet] [-f | --force] [--all | [--] [<sökväg>...]]"
msgid "Use '--all' if you really want to deinitialize all submodules"
-msgstr "Använd \"--all\" om du verkligen vill avinitiera alla undermoduler"
+msgstr "Använd â€--all†om du verkligen vill avinitiera alla undermoduler"
msgid ""
"An alternate computed from a superproject's alternate is invalid.\n"
@@ -11988,38 +12434,45 @@ msgid ""
"submodule.alternateErrorStrategy to 'info' or, equivalently, clone with\n"
"'--reference-if-able' instead of '--reference'."
msgstr ""
-"En suppleant beräknad från överprojektets suppleant är ogiltig.\n"
+"En suppleant beräknad från huvudprojektets suppleant är ogiltig.\n"
"För att i så fall låta Git klona utan ett suppleant, sätt\n"
-"submodule.alternateErrorStrategy till \"info\" eller, likvärdigt, klona\n"
-"med \"--reference-if-able\" istället för \"--reference\"."
+"submodule.alternateErrorStrategy till â€info†eller, likvärdigt, klona\n"
+"med â€--reference-if-able†istället för â€--referenceâ€."
+
+#, c-format
+msgid "could not get a repository handle for gitdir '%s'"
+msgstr "kunde inte fÃ¥ tag i arkivhandtag för gitkatalogen â€%sâ€"
#, c-format
msgid "submodule '%s' cannot add alternate: %s"
-msgstr "undermodulen \"%s\" kan inte lägga till suppleant: %s"
+msgstr "undermodulen â€%s†kan inte lägga till suppleant: %s"
#, c-format
msgid "Value '%s' for submodule.alternateErrorStrategy is not recognized"
-msgstr "Värdet \"%s\" i submodule.alternateErrorStrategy förstås inte"
+msgstr "Värdet â€%s†i submodule.alternateErrorStrategy förstÃ¥s inte"
#, c-format
msgid "Value '%s' for submodule.alternateLocation is not recognized"
-msgstr "Värdet \"%s\" i submodule.alternateLocation förstås inte"
+msgstr "Värdet â€%s†i submodule.alternateLocation förstÃ¥s inte"
#, c-format
msgid "refusing to create/use '%s' in another submodule's git dir"
-msgstr "vägrar skapa/använda \"%s\" i en annan undermoduls gitkatalog"
+msgstr "vägrar skapa/använda â€%s†i en annan undermoduls gitkatalog"
#, c-format
msgid "clone of '%s' into submodule path '%s' failed"
-msgstr "misslyckades klona \"%s\" till undermodulsökvägen \"%s\""
+msgstr "misslyckades klona â€%s†till undermodulsökvägen â€%sâ€"
#, c-format
msgid "directory not empty: '%s'"
-msgstr "katalogen inte tom: \"%s\""
+msgstr "katalogen inte tom: â€%sâ€"
#, c-format
msgid "could not get submodule directory for '%s'"
-msgstr "kunde inte få tag i undermodulkatalog för \"%s\""
+msgstr "kunde inte fÃ¥ tag i undermodulkatalog för â€%sâ€"
+
+msgid "alternative anchor for relative paths"
+msgstr "alternativa ankare för relativa sökvägar"
msgid "where the new submodule will be cloned to"
msgstr "var den nya undermodulen ska klonas till"
@@ -12049,20 +12502,15 @@ msgstr ""
"<filterangivelse>] --url <url> --path <sökväg>"
#, c-format
-msgid "Invalid update mode '%s' for submodule path '%s'"
-msgstr "Ogiltigt uppdateringsläge \"%s\" för undermodulsökväg \"%s\""
-
-#, c-format
msgid "Invalid update mode '%s' configured for submodule path '%s'"
-msgstr ""
-"Ogiltigt uppdateringsläge \"%s\" konfigurerat för undermodulsökväg \"%s\""
+msgstr "Ogiltigt uppdateringsläge â€%s†konfigurerat för undermodulsökväg â€%sâ€"
#, c-format
msgid "Submodule path '%s' not initialized"
-msgstr "Undermodulsökvägen \"%s\" har inte initierats"
+msgstr "Undermodulsökvägen â€%s†har inte initierats"
msgid "Maybe you want to use 'update --init'?"
-msgstr "Kanske menade du att använda \"update --init\"?"
+msgstr "Kanske menade du att använda â€update --initâ€?"
#, c-format
msgid "Skipping unmerged submodule %s"
@@ -12070,61 +12518,69 @@ msgstr "Hoppar över ej sammanslagen undermodul %s"
#, c-format
msgid "Skipping submodule '%s'"
-msgstr "Hoppar över undermodulen \"%s\""
+msgstr "Hoppar över undermodulen â€%sâ€"
+
+#, c-format
+msgid "cannot clone submodule '%s' without a URL"
+msgstr "kan inte klona undermodulen â€%s†utan en URL"
#, c-format
msgid "Failed to clone '%s'. Retry scheduled"
-msgstr "Misslyckades klona \"%s\". Nytt försök planlagt"
+msgstr "Misslyckades klona â€%sâ€. Nytt försök planlagt"
#, c-format
msgid "Failed to clone '%s' a second time, aborting"
-msgstr "Misslyckades klona \"%s\" för andra gången, avbryter"
+msgstr "Misslyckades klona â€%s†för andra gÃ¥ngen, avbryter"
#, c-format
msgid "Unable to checkout '%s' in submodule path '%s'"
-msgstr "Kan inte checka ut \"%s\" i undermodulsökvägen \"%s\""
+msgstr "Kan inte checka ut â€%s†i undermodulsökvägen â€%sâ€"
#, c-format
msgid "Unable to rebase '%s' in submodule path '%s'"
-msgstr "Kan inte ombasera \"%s\" i undermodulsökvägen \"%s\""
+msgstr "Kan inte ombasera â€%s†i undermodulsökvägen â€%sâ€"
#, c-format
msgid "Unable to merge '%s' in submodule path '%s'"
-msgstr "Kan inte slå ihop \"%s\" i undermodulsökvägen \"%s\""
+msgstr "Kan inte slÃ¥ ihop â€%s†i undermodulsökvägen â€%sâ€"
#, c-format
msgid "Execution of '%s %s' failed in submodule path '%s'"
-msgstr "Misslyckades köra \"%s %s\" i undermodulsökvägen \"%s\""
+msgstr "Misslyckades köra â€%s %s†i undermodulsökvägen â€%sâ€"
#, c-format
msgid "Submodule path '%s': checked out '%s'\n"
-msgstr "Undermodulsökvägen \"%s\": checkade ut \"%s\"\n"
+msgstr "Undermodulsökvägen â€%sâ€: checkade ut â€%sâ€\n"
#, c-format
msgid "Submodule path '%s': rebased into '%s'\n"
-msgstr "Undermodulsökvägen \"%s\": ombaserade in i \"%s\"\n"
+msgstr "Undermodulsökvägen â€%sâ€: ombaserade in i â€%sâ€\n"
#, c-format
msgid "Submodule path '%s': merged in '%s'\n"
-msgstr "Undermodulsökvägen \"%s\": sammanslagen i \"%s\"\n"
+msgstr "Undermodulsökvägen â€%sâ€: sammanslagen i â€%sâ€\n"
#, c-format
msgid "Submodule path '%s': '%s %s'\n"
-msgstr "Undermodulsökvägen \"%s\": \"%s %s\"\n"
+msgstr "Undermodulsökvägen â€%sâ€: â€%s %sâ€\n"
#, c-format
msgid "Unable to fetch in submodule path '%s'; trying to directly fetch %s:"
-msgstr "Kan inte hämta i undermodulsökväg \"%s\"; försökte hämta %s direkt:"
+msgstr "Kan inte hämta i undermodulsökväg â€%sâ€; försökte hämta %s direkt:"
#, c-format
msgid ""
"Fetched in submodule path '%s', but it did not contain %s. Direct fetching "
"of that commit failed."
msgstr ""
-"Hämtade i undermodulssökvägen \"%s\", men den innehöll inte %s. Direkt "
+"Hämtade i undermodulssökvägen â€%sâ€, men den innehöll inte %s. Direkt "
"hämtning av incheckningen misslyckades."
#, c-format
+msgid "could not initialize submodule at path '%s'"
+msgstr "kunde inte initiera undermodul i sökvägen â€%sâ€"
+
+#, c-format
msgid ""
"Submodule (%s) branch configured to inherit branch from superproject, but "
"the superproject is not on any branch"
@@ -12133,24 +12589,20 @@ msgstr ""
"huvudprojektet är inte på någon gren"
#, c-format
-msgid "could not get a repository handle for submodule '%s'"
-msgstr "kunde inte få tag i arkivhandtag för undermodulen \"%s\""
-
-#, c-format
msgid "Unable to find current revision in submodule path '%s'"
-msgstr "Kan inte hitta aktuell revision i undermodulsökvägen \"%s\""
+msgstr "Kan inte hitta aktuell revision i undermodulsökvägen â€%sâ€"
#, c-format
msgid "Unable to fetch in submodule path '%s'"
-msgstr "Kan inte hämta i undermodulsökväg \"%s\""
+msgstr "Kan inte hämta i undermodulsökväg â€%sâ€"
#, c-format
msgid "Unable to find %s revision in submodule path '%s'"
-msgstr "Kan inte hitta %s revision i undermodulsökvägen \"%s\""
+msgstr "Kan inte hitta %s revision i undermodulsökvägen â€%sâ€"
#, c-format
msgid "Failed to recurse into submodule path '%s'"
-msgstr "Misslyckades rekursera in i undermodulsökväg \"%s\""
+msgstr "Misslyckades rekursera in i undermodulsökväg â€%sâ€"
msgid "force checkout updates"
msgstr "tvinga utcheckningsuppdateringar"
@@ -12167,14 +12619,14 @@ msgstr "traversera undermoduler rekursivt"
msgid "don't fetch new objects from the remote site"
msgstr "hämta inte nya objekt från fjärrplatsen"
-msgid "path into the working tree"
-msgstr "sökväg inuti arbetskatalogen"
+msgid "use the 'checkout' update strategy (default)"
+msgstr "använd uppdateringsstrategin â€checkout†(utcheckning; förval)"
-msgid "path into the working tree, across nested submodule boundaries"
-msgstr "sökväg inuti arbetskatalogen, genom nästlade undermodulgränser"
+msgid "use the 'merge' update strategy"
+msgstr "använd uppdateringsstrategin â€merge†(sammanslagning)"
-msgid "rebase, merge, checkout or none"
-msgstr "rebase, merge, checkout eller none"
+msgid "use the 'rebase' update strategy"
+msgstr "använd uppdateringsstrategin â€rebase†(ombasering)"
msgid "create a shallow clone truncated to the specified number of revisions"
msgstr "skapa en grund klon trunkerad till angivet antal revisioner"
@@ -12188,6 +12640,9 @@ msgstr "om den första klonen ska följa rekommendation för grund kloning"
msgid "don't print cloning progress"
msgstr "skriv inte klonförlopp"
+msgid "disallow cloning into non-empty directory, implies --init"
+msgstr "förhindra kloning till icke-tom katalog, implicerar --init"
+
msgid ""
"git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] "
"[-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-"
@@ -12199,35 +12654,17 @@ msgstr ""
"[no-]recommend-shallow] [--reference <arkiv>] [--recursive] [--[no-]single-"
"branch] [--] [<sökväg>...]"
-msgid "bad value for update parameter"
-msgstr "felaktigt värde för parametern update"
-
-msgid "recurse into submodules"
-msgstr "rekursera ner i undermoduler"
-
-msgid "git submodule--helper absorb-git-dirs [<options>] [<path>...]"
-msgstr "git submodule--helper absorb-git-dirs [<flaggor>] [<sökväg>...]"
-
-msgid "check if it is safe to write to the .gitmodules file"
-msgstr "se om det är säkert att skriva till .gitmodules-filen"
-
-msgid "unset the config in the .gitmodules file"
-msgstr "ta bort konfigurationen från .gitmodules-filen"
-
-msgid "git submodule--helper config <name> [<value>]"
-msgstr "git submodule--helper config <namn> [<värde>]"
-
-msgid "git submodule--helper config --unset <name>"
-msgstr "git submodule--helper config --unset <namn>"
+msgid "Failed to resolve HEAD as a valid ref."
+msgstr "Misslyckades slå upp HEAD som giltig referens."
-msgid "please make sure that the .gitmodules file is in the working tree"
-msgstr "se till att .gitmodules finns i arbetskatalogen"
+msgid "git submodule absorbgitdirs [<options>] [<path>...]"
+msgstr "git submodule absorbgitdirs [<flaggor>] [<sökväg>...]"
msgid "suppress output for setting url of a submodule"
msgstr "dölj utdata från inställning av url för undermodul"
-msgid "git submodule--helper set-url [--quiet] <path> <newurl>"
-msgstr "git submodule--helper set-url [--quiet] <sökväg> <nyurl>"
+msgid "git submodule set-url [--quiet] <path> <newurl>"
+msgstr "git submodule set-url [--quiet] <sökväg> <nyurl>"
msgid "set the default tracking branch to master"
msgstr "välj master som förvald spårad gren"
@@ -12235,13 +12672,11 @@ msgstr "välj master som förvald spårad gren"
msgid "set the default tracking branch"
msgstr "välj förvald spårad gren"
-msgid "git submodule--helper set-branch [-q|--quiet] (-d|--default) <path>"
-msgstr "git submodule--helper set-branch [-q|--quiet] (-d|--default) <sökväg>"
+msgid "git submodule set-branch [-q|--quiet] (-d|--default) <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-d|--default) <sökväg>"
-msgid ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
-msgstr ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <gren> <sökväg>"
+msgid "git submodule set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-b|--branch) <gren> <sökväg>"
msgid "--branch or --default required"
msgstr "--branch eller --default krävs"
@@ -12264,19 +12699,19 @@ msgstr ""
#, c-format
msgid "creating branch '%s'"
-msgstr "skapar grenen \"%s\""
+msgstr "skapar grenen â€%sâ€"
#, c-format
msgid "Adding existing repo at '%s' to the index\n"
-msgstr "Lägger till befintligt arkiv i \"%s\" i indexet\n"
+msgstr "Lägger till befintligt arkiv i â€%s†i indexet\n"
#, c-format
msgid "'%s' already exists and is not a valid git repo"
-msgstr "\"%s\" finns redan och är inte ett giltigt git-arkiv"
+msgstr "â€%s†finns redan och är inte ett giltigt git-arkiv"
#, c-format
msgid "A git directory for '%s' is found locally with remote(s):\n"
-msgstr "En git-katalog för \"%s\" hittades lokalt med fjärr(ar):\n"
+msgstr "En git-katalog för â€%s†hittades lokalt med fjärr(ar):\n"
#, c-format
msgid ""
@@ -12290,38 +12725,41 @@ msgstr ""
"Om du vill återanvända den lokala git-katalogen istället för att klona på "
"nytt från\n"
" %s\n"
-"kan du använda flaggan \"--force\". Om den lokala git-katalogen inte är "
+"kan du använda flaggan â€--forceâ€. Om den lokala git-katalogen inte är "
"korrekt\n"
"arkiv eller om du är osäker på vad det här betyder, välj ett annat namn med\n"
-"flaggan \"--name\"."
+"flaggan â€--nameâ€."
#, c-format
msgid "Reactivating local git directory for submodule '%s'\n"
-msgstr "Aktiverar lokal git-katalog för undermodulen \"%s\" på nytt.\n"
+msgstr "Aktiverar lokal git-katalog för undermodulen â€%s†pÃ¥ nytt.\n"
#, c-format
msgid "unable to checkout submodule '%s'"
-msgstr "Kan inte checka ut undermodulen \"%s\""
+msgstr "Kan inte checka ut undermodulen â€%sâ€"
+
+msgid "please make sure that the .gitmodules file is in the working tree"
+msgstr "se till att .gitmodules finns i arbetskatalogen"
#, c-format
msgid "Failed to add submodule '%s'"
-msgstr "Misslyckades lägga till undermodulen \"%s\""
+msgstr "Misslyckades lägga till undermodulen â€%sâ€"
#, c-format
msgid "Failed to register submodule '%s'"
-msgstr "Misslyckades registrera undermodulen \"%s\""
+msgstr "Misslyckades registrera undermodulen â€%sâ€"
#, c-format
msgid "'%s' already exists in the index"
-msgstr "\"%s\" finns redan i indexet"
+msgstr "â€%s†finns redan i indexet"
#, c-format
msgid "'%s' already exists in the index and is not a submodule"
-msgstr "\"%s\" finns redan i indexet och är inte en undermodul"
+msgstr "â€%s†finns redan i indexet och är inte en undermodul"
#, c-format
msgid "'%s' does not have a commit checked out"
-msgstr "\"%s\" har inte någon utcheckad incheckning"
+msgstr "â€%s†har inte nÃ¥gon utcheckad incheckning"
msgid "branch of repository to add as submodule"
msgstr "gren från arkivet att lägga till som undermodul"
@@ -12339,33 +12777,31 @@ msgstr ""
"sätter undermodulens namn till den angivna strängen istället för att använda "
"sökvägen"
-msgid "git submodule--helper add [<options>] [--] <repository> [<path>]"
-msgstr "git submodule--helper add [<flaggor>] [--] <arkiv> [<sökväg>]"
+msgid "git submodule add [<options>] [--] <repository> [<path>]"
+msgstr "git submodule add [<flaggor>] [--] <arkiv> [<sökväg>]"
msgid "Relative path can only be used from the toplevel of the working tree"
msgstr "Relativ sökväg kan endast användas från arbetskatalogens toppnivå"
#, c-format
msgid "repo URL: '%s' must be absolute or begin with ./|../"
-msgstr "arkiv-URL: \"%s\" måste vara absolut eller börja med ./|../"
+msgstr "arkiv-URL: â€%s†mÃ¥ste vara absolut eller börja med ./|../"
#, c-format
msgid "'%s' is not a valid submodule name"
-msgstr "\"%s\" är inte ett giltigt namn på undermodul"
+msgstr "â€%s†är inte ett giltigt namn pÃ¥ undermodul"
-#, c-format
-msgid "%s doesn't support --super-prefix"
-msgstr "%s stöder inte --super-prefix"
+msgid "git submodule--helper <command>"
+msgstr "git submodule--helper <kommando>"
-#, c-format
-msgid "'%s' is not a valid submodule--helper subcommand"
-msgstr "\"%s\" är inte ett giltigt underkommando till submodule--helper"
+msgid "git symbolic-ref [-m <reason>] <name> <ref>"
+msgstr "git symbolic-ref [-m <orsak>] <namn> <ref>"
-msgid "git symbolic-ref [<options>] <name> [<ref>]"
-msgstr "git symbolic-ref [<flaggor>] <namn> [<ref>]"
+msgid "git symbolic-ref [-q] [--short] [--no-recurse] <name>"
+msgstr "git symbolic-ref [-q] [--short] [--no-recurse] <namn>"
-msgid "git symbolic-ref -d [-q] <name>"
-msgstr "git symbolic-ref -d [-q] <namn>"
+msgid "git symbolic-ref --delete [-q] <name>"
+msgstr "git symbolic-ref --delete [-q] <namn>"
msgid "suppress error message for non-symbolic (detached) refs"
msgstr ""
@@ -12377,6 +12813,9 @@ msgstr "ta bort symbolisk referens"
msgid "shorten ref output"
msgstr "förkorta ref-utdata"
+msgid "recursively dereference (default)"
+msgstr "avreferera rekursivt (standard)"
+
msgid "reason"
msgstr "skäl"
@@ -12384,36 +12823,37 @@ msgid "reason of the update"
msgstr "skäl till uppdateringen"
msgid ""
-"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]\n"
-" <tagname> [<head>]"
+"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
+" <tagname> [<commit> | <object>]"
msgstr ""
-"git tag [-a | -s | -u <nyckel-id>] [-f] [-m <medd> | -F <fil>]\n"
-" <taggnamn> [<huvud>]"
+"git tag [-a | -s | -u <nyckel-id>] [-f] [-m <medd> | -F <fil>] [-e]\n"
+" <taggnamn> [<incheckning> | <objekt>]"
msgid "git tag -d <tagname>..."
msgstr "git tag -d <taggnamn>..."
msgid ""
-"git tag -l [-n[<num>]] [--contains <commit>] [--no-contains <commit>] [--"
-"points-at <object>]\n"
-" [--format=<format>] [--merged <commit>] [--no-merged <commit>] "
-"[<pattern>...]"
+"git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]\n"
+" [--points-at <object>] [--column[=<options>] | --no-column]\n"
+" [--create-reflog] [--sort=<key>] [--format=<format>]\n"
+" [--merged <commit>] [--no-merged <commit>] [<pattern>...]"
msgstr ""
-"git tag -l [-n[<antal>]] [--contains <incheckning>] [--no-contains "
-"<incheckning>] [--points-at <objekt>]\n"
-" [--format=<format>] [--merged <incheckning>] [--no-merged "
-"<incheckning>] [<mönster>...]"
+"git tag [-n[<antal>]] -l [--contains <incheckning>] [--no-contains "
+"<incheckning>\n"
+" [--points-at <objekt>] [--column[=<flaggor>] | --no-column]\n"
+" [--create-reflog] [--sort=<nyckel>] [--format=<format>]\n"
+" [--merged <incheckning>] [--no-merged <incheckning>] [<mönster>...]"
msgid "git tag -v [--format=<format>] <tagname>..."
msgstr "git tag -v [--format=<format>] <taggnamn>..."
#, c-format
msgid "tag '%s' not found."
-msgstr "taggen \"%s\" hittades inte."
+msgstr "taggen â€%s†hittades inte."
#, c-format
msgid "Deleted tag '%s' (was %s)\n"
-msgstr "Tog bort tagg \"%s\" (var %s)\n"
+msgstr "Tog bort tagg â€%s†(var %s)\n"
#, c-format
msgid ""
@@ -12425,7 +12865,7 @@ msgstr ""
"\n"
"Skriv ett meddelande för taggen:\n"
" %s\n"
-"Rader som inleds med \"%c\" ignoreras.\n"
+"Rader som inleds med â€%c†ignoreras.\n"
#, c-format
msgid ""
@@ -12438,7 +12878,7 @@ msgstr ""
"\n"
"Skriv ett meddelande för taggen:\n"
" %s\n"
-"Rader som inleds med \"%c\" kommer behållas; du kan själv ta bort dem om\n"
+"Rader som inleds med â€%c†kommer behÃ¥llas; du kan själv ta bort dem om\n"
"du vill.\n"
msgid "unable to sign the tag"
@@ -12525,15 +12965,15 @@ msgstr "visa endast taggar för objektet"
#, c-format
msgid "the '%s' option is only allowed in list mode"
-msgstr "flaggan \"%s\" är endast tillåten i listläge"
+msgstr "flaggan â€%s†är endast tillÃ¥ten i listläge"
#, c-format
msgid "'%s' is not a valid tag name."
-msgstr "\"%s\" är inte ett giltigt taggnamn."
+msgstr "â€%s†är inte ett giltigt taggnamn."
#, c-format
msgid "tag '%s' already exists"
-msgstr "taggen \"%s\" finns redan"
+msgstr "taggen â€%s†finns redan"
#, c-format
msgid "Invalid cleanup mode %s"
@@ -12541,11 +12981,21 @@ msgstr "Felaktigt städningsläge %s"
#, c-format
msgid "Updated tag '%s' (was %s)\n"
-msgstr "Uppdaterad tagg \"%s\" (var %s)\n"
+msgstr "Uppdaterad tagg â€%s†(var %s)\n"
msgid "pack exceeds maximum allowed size"
msgstr "paket är större än tillåten maximal storlek"
+msgid "failed to write object in stream"
+msgstr "misslyckades skriva objekt i ström"
+
+#, c-format
+msgid "inflate returned (%d)"
+msgstr "inflate returnerade (%d)"
+
+msgid "invalid blob object from stream"
+msgstr "ogiltigt blob-objekt från ström"
+
msgid "Unpacking objects"
msgstr "Packar upp objekt"
@@ -12563,7 +13013,7 @@ msgstr "misslyckades ta bort katalogen %s"
#, c-format
msgid "Testing mtime in '%s' "
-msgstr "Testar mtime i \"%s\" "
+msgstr "Testar mtime i â€%s†"
msgid "directory stat info does not change after adding a new file"
msgstr "stat-informationen för en katalog ändras inte när nya filer läggs till"
@@ -12623,19 +13073,19 @@ msgid "add the specified entry to the index"
msgstr "lägg till angiven post i indexet"
msgid "mark files as \"not changing\""
-msgstr "markera filer som \"ändras inte\""
+msgstr "markera filer som â€Ã¤ndras inteâ€"
msgid "clear assumed-unchanged bit"
-msgstr "rensa \"assume-unchanged\"-biten"
+msgstr "rensa â€assume-unchangedâ€-biten"
msgid "mark files as \"index-only\""
-msgstr "markera filer som \"endast index\""
+msgstr "markera filer som â€endast indexâ€"
msgid "clear skip-worktree bit"
-msgstr "töm \"skip-worktree\"-biten"
+msgstr "töm â€skip-worktreeâ€-biten"
msgid "do not touch index-only entries"
-msgstr "rör inte \"endast index\"-poster"
+msgstr "rör inte â€endast indexâ€-poster"
msgid "add to index only; do not add content to object database"
msgstr "lägg endast till indexet; lägg inte till innehållet i objektdatabasen"
@@ -12670,6 +13120,9 @@ msgstr "(för porslin) glöm sparade olösta konflikter"
msgid "write index in this format"
msgstr "skriv index i detta format"
+msgid "report on-disk index format version"
+msgstr "rapportera formatversion för indexfilen på disk"
+
msgid "enable or disable split index"
msgstr "aktivera eller inaktivera delat index"
@@ -12689,10 +13142,18 @@ msgid "enable or disable file system monitor"
msgstr "aktivera eller inaktivera filsystemsövervakning"
msgid "mark files as fsmonitor valid"
-msgstr "markera filer som \"fsmonitor valid\""
+msgstr "markera filer som â€fsmonitor validâ€"
msgid "clear fsmonitor valid bit"
-msgstr "töm \"fsmonitor valid\"-bit"
+msgstr "töm â€fsmonitor validâ€-bit"
+
+#, c-format
+msgid "%d\n"
+msgstr "%d\n"
+
+#, c-format
+msgid "index-version: was %d, set to %d"
+msgstr "index-version: vad %d, sattes till %d"
msgid ""
"core.splitIndex is set to false; remove or change it, if you really want to "
@@ -12727,7 +13188,7 @@ msgstr ""
#, c-format
msgid "Untracked cache enabled for '%s'"
-msgstr "Ospårad cache är aktiverad för \"%s\""
+msgstr "OspÃ¥rad cache är aktiverad för â€%sâ€"
msgid "core.fsmonitor is unset; set it if you really want to enable fsmonitor"
msgstr "core.fsmonitor inte satt; sätt om du verkligen vill aktivera fsmonitor"
@@ -12767,8 +13228,12 @@ msgstr "läs uppdateringar från standard in"
msgid "update the info files from scratch"
msgstr "uppdatera informationsfilerna från grunden"
-msgid "git upload-pack [<options>] <dir>"
-msgstr "git upload-pack [<flaggor>] <katalog>"
+msgid ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <directory>"
+msgstr ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <katalog>"
msgid "quit after a single request/response exchange"
msgstr "avsluta omedelbart efter första anrop/svar-utväxling"
@@ -12782,8 +13247,8 @@ msgstr "testa inte <katalog>/.git/ om <katalog> inte är en Git-katalog"
msgid "interrupt transfer after <n> seconds of inactivity"
msgstr "avbryt överföringen efter <n> sekunders inaktivitet"
-msgid "git verify-commit [-v | --verbose] <commit>..."
-msgstr "git verify-commit [-v | --verbose] <incheckning>..."
+msgid "git verify-commit [-v | --verbose] [--raw] <commit>..."
+msgstr "git verify-commit [-v | --verbose] [--raw] <incheckning>..."
msgid "print commit contents"
msgstr "visa innehåll för incheckning"
@@ -12791,8 +13256,9 @@ msgstr "visa innehåll för incheckning"
msgid "print raw gpg status output"
msgstr "visa råa gpg-statusdata"
-msgid "git verify-pack [-v | --verbose] [-s | --stat-only] <pack>..."
-msgstr "git verify-pack [-v | --verbose] [-s | --stat-only] <paket>..."
+msgid "git verify-pack [-v | --verbose] [-s | --stat-only] [--] <pack>.idx..."
+msgstr ""
+"git verify-pack [-v | --verbose] [-s | --stat-only] [--] <paket>.idx..."
msgid "verbose"
msgstr "pratsam"
@@ -12800,35 +13266,71 @@ msgstr "pratsam"
msgid "show statistics only"
msgstr "visa endast statistik"
-msgid "git verify-tag [-v | --verbose] [--format=<format>] <tag>..."
-msgstr "git verify-tag [-v | --verbose] [--format=<format>] <tagg>..."
+msgid "git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."
+msgstr "git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tagg>..."
msgid "print tag contents"
msgstr "visa innehåll för tag"
-msgid "git worktree add [<options>] <path> [<commit-ish>]"
-msgstr "git worktree add [<flaggor>] <sökväg> [<incheckning-igt>]"
+msgid ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <string>]]\n"
+" [--orphan] [(-b | -B) <new-branch>] <path> [<commit-ish>]"
+msgstr ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <sträng>]]\n"
+" [--orphan] [(-b | -B) <ny-gren>] <sökväg> [<incheckning-"
+"igt>]"
-msgid "git worktree list [<options>]"
-msgstr "git worktree list [<flaggor>]"
+msgid "git worktree list [-v | --porcelain [-z]]"
+msgstr "git worktree list [-v | --porcelain [-z]]"
-msgid "git worktree lock [<options>] <path>"
-msgstr "git worktree lock [<flaggor>] <sökväg>"
+msgid "git worktree lock [--reason <string>] <worktree>"
+msgstr "git worktree lock [--reason <sträng>] <arbetskatalog>"
msgid "git worktree move <worktree> <new-path>"
msgstr "git worktree move <arbetskatalog> <ny-sökväg>"
-msgid "git worktree prune [<options>]"
-msgstr "git worktree prune [<flaggor>]"
+msgid "git worktree prune [-n] [-v] [--expire <expire>]"
+msgstr "git worktree prune [-n] [-v] [--expire <utgår>]"
-msgid "git worktree remove [<options>] <worktree>"
-msgstr "git worktree remove [<flaggor>] <arbetskatalog>"
+msgid "git worktree remove [-f] <worktree>"
+msgstr "git worktree remove [-f] <arbetskatalog>"
msgid "git worktree repair [<path>...]"
msgstr "git worktree repair [<sökväg>...]"
-msgid "git worktree unlock <path>"
-msgstr "git worktree unlock <sökväg>"
+msgid "git worktree unlock <worktree>"
+msgstr "git worktree unlock <arbetskatalog>"
+
+msgid "No possible source branch, inferring '--orphan'"
+msgstr "Ingen möjlig källgren, använder â€--orphanâ€"
+
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+msgstr ""
+"Om meningen var att skapa en arbetskatalog från en ny ofödd\n"
+"gren (gren utan incheckningar) för det här arkivet kan du göra\n"
+"det med flaggan --orphan:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan %s\n"
+msgstr ""
+"Om meningen var att skapa en arbetskatalog från en ny ofödd\n"
+"gren (gren utan incheckningar) för det här arkivet kan du göra\n"
+"det med flaggan --orphan:\n"
+"\n"
+" git worktree add --orphan %s\n"
#, c-format
msgid "Removing %s/%s: %s"
@@ -12842,68 +13344,92 @@ msgstr "låt tid gå ut för arbetskataloger äldre än <tid>"
#, c-format
msgid "'%s' already exists"
-msgstr "\"%s\" finns redan"
+msgstr "â€%s†finns redan"
#, c-format
msgid "unusable worktree destination '%s'"
-msgstr "oanvändbar mål för arbetskatalog \"%s\""
+msgstr "oanvändbar mÃ¥l för arbetskatalog â€%sâ€"
#, c-format
msgid ""
"'%s' is a missing but locked worktree;\n"
"use '%s -f -f' to override, or 'unlock' and 'prune' or 'remove' to clear"
msgstr ""
-"\"%s\" är en saknad men låst arbetskatalog;\n"
-"använd \"%s -f -f\" för att överstyra, eller \"unlock\" och \"prune\" eller "
-"\"remove\" för att rensa"
+"â€%s†är en saknad men lÃ¥st arbetskatalog;\n"
+"använd â€%s -f -f†för att överstyra, eller â€unlock†och â€prune†eller "
+"â€remove†för att rensa"
#, c-format
msgid ""
"'%s' is a missing but already registered worktree;\n"
"use '%s -f' to override, or 'prune' or 'remove' to clear"
msgstr ""
-"\"%s\" är en saknad men redan registrerad arbetskatalog;\n"
-"använd \"%s -f\" för att överstyra, eller \"prune\" eller \"remove\" för att "
-"rensa"
+"â€%s†är en saknad men redan registrerad arbetskatalog;\n"
+"använd â€%s -f†för att överstyra, eller â€prune†eller â€remove†för att rensa"
#, c-format
msgid "failed to copy '%s' to '%s'; sparse-checkout may not work correctly"
msgstr ""
-"misslyckades kopiera \"%s\" till \"%s\"; sparse-checkout kanske inte kommer "
-"att fungera korrekt"
+"misslyckades kopiera â€%s†till â€%sâ€; sparse-checkout kanske inte kommer att "
+"fungera korrekt"
#, c-format
msgid "failed to copy worktree config from '%s' to '%s'"
-msgstr ""
-"misslyckades kopiera arbetskatalogkonfiguration från \"%s\" till \"%s\""
+msgstr "misslyckades kopiera arbetskatalogkonfiguration frÃ¥n â€%s†till â€%sâ€"
#, c-format
msgid "failed to unset '%s' in '%s'"
-msgstr "misslyckades slå av \"%s\" i \"%s\""
+msgstr "misslyckades slÃ¥ av â€%s†i â€%sâ€"
#, c-format
msgid "could not create directory of '%s'"
-msgstr "kunde inte skapa katalogen \"%s\""
+msgstr "kunde inte skapa katalogen â€%sâ€"
msgid "initializing"
msgstr "initierar"
#, c-format
+msgid "could not find created worktree '%s'"
+msgstr "kunde inte hitta den skapade arbetskatalogen â€%sâ€"
+
+#, c-format
msgid "Preparing worktree (new branch '%s')"
-msgstr "Förbereder arbetskatalog (ny gren \"%s\")"
+msgstr "Förbereder arbetskatalog (ny gren â€%sâ€)"
#, c-format
msgid "Preparing worktree (resetting branch '%s'; was at %s)"
-msgstr "Förbereder arbetskatalog (återställer gren \"%s\"; var på %s)"
+msgstr "Förbereder arbetskatalog (Ã¥terställer gren â€%sâ€; var pÃ¥ %s)"
#, c-format
msgid "Preparing worktree (checking out '%s')"
-msgstr "Förbereder arbetskatalog (checkar ut \"%s\")"
+msgstr "Förbereder arbetskatalog (checkar ut â€%sâ€)"
+
+#, c-format
+msgid "unreachable: invalid reference: %s"
+msgstr "onåbar: felaktig referens: %s"
#, c-format
msgid "Preparing worktree (detached HEAD %s)"
msgstr "Förbereder arbetskatalog (frånkopplat HEAD %s)"
+#, c-format
+msgid ""
+"HEAD points to an invalid (or orphaned) reference.\n"
+"HEAD path: '%s'\n"
+"HEAD contents: '%s'"
+msgstr ""
+"HEAD pekar på en ogiltig (eller övergiven) referens.\n"
+"HEAD-sökväg: â€%sâ€\n"
+"HEAD-innehÃ¥ll: â€%sâ€"
+
+msgid ""
+"No local or remote refs exist despite at least one remote\n"
+"present, stopping; use 'add -f' to override or fetch a remote first"
+msgstr ""
+"Ingen lokal eller fjärr-referens finns trots att åtminstone en fjärr\n"
+"finns, avslutar; använd â€add -f†för att överstyra eller hämta frÃ¥n en fjärr "
+"först"
+
msgid "checkout <branch> even if already checked out in other worktree"
msgstr ""
"checka ut <gren> även om den redan är utcheckad i en annan arbetskatalog"
@@ -12914,6 +13440,9 @@ msgstr "skapa en ny gren"
msgid "create or reset a branch"
msgstr "skapa eller återställ en gren"
+msgid "create unborn branch"
+msgstr "skapa en ofödd gren"
+
msgid "populate the new working tree"
msgstr "befolka den nya arbetskatalogen"
@@ -12931,7 +13460,11 @@ msgstr "försök träffa namn på ny gren mot en fjärrspårande gren"
#, c-format
msgid "options '%s', '%s', and '%s' cannot be used together"
-msgstr "flaggorna \"%s\", \"%s\" och \"%s\" kan inte användas samtidigt"
+msgstr "flaggorna â€%sâ€, â€%s†och â€%s†kan inte användas samtidigt"
+
+#, c-format
+msgid "option '%s' and commit-ish cannot be used together"
+msgstr "flaggorna â€%s†och incheckning-igt kan inte användas samtidigt"
msgid "added with --lock"
msgstr "lagt till med --lock"
@@ -12943,30 +13476,29 @@ msgid "show extended annotations and reasons, if available"
msgstr "visa utökade annoteringar och grunder, om tillgängliga"
msgid "add 'prunable' annotation to worktrees older than <time>"
-msgstr ""
-"lägg till \"prunable\"-annoteringar till arbetskataloger äldre än <tid>"
+msgstr "lägg till â€prunableâ€-annoteringar till arbetskataloger äldre än <tid>"
msgid "terminate records with a NUL character"
msgstr "avsluta poster med NUL-tecken"
#, c-format
msgid "'%s' is not a working tree"
-msgstr "\"%s\" är inte en arbetskatalog"
+msgstr "â€%s†är inte en arbetskatalog"
msgid "The main working tree cannot be locked or unlocked"
msgstr "Huvudarbetskatalogen kan inte låsas eller låsas upp"
#, c-format
msgid "'%s' is already locked, reason: %s"
-msgstr "\"%s\" är redan låst, orsak: %s"
+msgstr "â€%s†är redan lÃ¥st, orsak: %s"
#, c-format
msgid "'%s' is already locked"
-msgstr "\"%s\" är redan låst"
+msgstr "â€%s†är redan lÃ¥st"
#, c-format
msgid "'%s' is not locked"
-msgstr "\"%s\" är inte låst"
+msgstr "â€%s†är inte lÃ¥st"
msgid "working trees containing submodules cannot be moved or removed"
msgstr "arbetskataloger med undermoduler kan inte flyttas eller tas bort"
@@ -12976,11 +13508,11 @@ msgstr "tvinga flyttning även om arbetskatalogen är smutsig eller låst"
#, c-format
msgid "'%s' is a main working tree"
-msgstr "\"%s\" är inte en huvudarbetskatalog"
+msgstr "â€%s†är inte en huvudarbetskatalog"
#, c-format
msgid "could not figure out destination name from '%s'"
-msgstr "kunde inte lista ut målnamn från \"%s\""
+msgstr "kunde inte lista ut mÃ¥lnamn frÃ¥n â€%sâ€"
#, c-format
msgid ""
@@ -12988,14 +13520,14 @@ msgid ""
"use 'move -f -f' to override or unlock first"
msgstr ""
"kan inte flytta en låst arbetskatalog, orsak till lås: %s\n"
-"använd \"move -f -f\" för att överstyra, eller lås upp först"
+"använd â€move -f -f†för att överstyra, eller lÃ¥s upp först"
msgid ""
"cannot move a locked working tree;\n"
"use 'move -f -f' to override or unlock first"
msgstr ""
"kan inte flytta en låst arbetskatalog;\n"
-"använd \"move -f -f\" för att överstyra, eller lås upp först"
+"använd â€move -f -f†för att överstyra, eller lÃ¥s upp först"
#, c-format
msgid "validation failed, cannot move working tree: %s"
@@ -13003,21 +13535,21 @@ msgstr "kontroll misslyckades, kan inte flytta arbetskatalog: %s"
#, c-format
msgid "failed to move '%s' to '%s'"
-msgstr "misslyckades flytta \"%s\" till \"%s\""
+msgstr "misslyckades flytta â€%s†till â€%sâ€"
#, c-format
msgid "failed to run 'git status' on '%s'"
-msgstr "misslyckades köra \"git status\" på \"%s\""
+msgstr "misslyckades köra â€git status†pÃ¥ â€%sâ€"
#, c-format
msgid "'%s' contains modified or untracked files, use --force to delete it"
msgstr ""
-"\"%s\" innehåller ändrade eller ospårade filer, använd --force för att ta "
-"bort det"
+"â€%s†innehÃ¥ller ändrade eller ospÃ¥rade filer, använd --force för att ta bort "
+"det"
#, c-format
msgid "failed to run 'git status' on '%s', code %d"
-msgstr "misslyckades köra \"git status\" på \"%s\", kod %d"
+msgstr "misslyckades köra â€git status†pÃ¥ â€%sâ€, kod %d"
msgid "force removal even if worktree is dirty or locked"
msgstr "tvinga ta bort även om arbetskatalogen är smutsig eller låst"
@@ -13028,14 +13560,14 @@ msgid ""
"use 'remove -f -f' to override or unlock first"
msgstr ""
"kan inte ta bort en låst arbetskatalog, orsak till låset: %s\n"
-"använd \"remove -f -f\" för att överstyra, eller lås upp först"
+"använd â€remove -f -f†för att överstyra, eller lÃ¥s upp först"
msgid ""
"cannot remove a locked working tree;\n"
"use 'remove -f -f' to override or unlock first"
msgstr ""
"kan inte ta bort en låst arbetskatalog;\n"
-"använd \"remove -f -f\" för att överstyra, eller lås upp först"
+"använd â€remove -f -f†för att överstyra, eller lÃ¥s upp först"
#, c-format
msgid "validation failed, cannot remove working tree: %s"
@@ -13061,13 +13593,69 @@ msgstr "visa trädobjekt för underkatalogen <prefix>"
msgid "only useful for debugging"
msgstr "endast användbart vid felsökning"
+msgid "core.fsyncMethod = batch is unsupported on this platform"
+msgstr "core.fsyncMethod = batch stöds inte på denna plattform"
+
+#, c-format
+msgid "could not parse bundle list key %s with value '%s'"
+msgstr "kunde inte tolka listnyckeln %s med värdet â€%sâ€"
+
+#, c-format
+msgid "bundle list at '%s' has no mode"
+msgstr "buntlistan pÃ¥ â€%s†har inget läge"
+
+msgid "failed to create temporary file"
+msgstr "misslyckades skapa temporär fil"
+
+msgid "insufficient capabilities"
+msgstr "otillräckliga kapabiliteter"
+
+#, c-format
+msgid "file downloaded from '%s' is not a bundle"
+msgstr "filen hämtad frÃ¥n â€%s†är inte en bunt"
+
+msgid "failed to store maximum creation token"
+msgstr "misslyckades lagra maximal skaparsymbol"
+
+#, c-format
+msgid "unrecognized bundle mode from URI '%s'"
+msgstr "okänt buntlägre frÃ¥n URI:en â€%sâ€"
+
+#, c-format
+msgid "exceeded bundle URI recursion limit (%d)"
+msgstr "överskred buntens URI-rekursionsgräns (%d)"
+
+#, c-format
+msgid "failed to download bundle from URI '%s'"
+msgstr "kunde inte hämta bunt frÃ¥n URI:en â€%sâ€"
+
+#, c-format
+msgid "file at URI '%s' is not a bundle or bundle list"
+msgstr "filen pÃ¥ URI:en â€%s†är inte en bunt eller buntlista"
+
+#, c-format
+msgid "bundle-uri: unexpected argument: '%s'"
+msgstr "bundle-uri: okänt argument: â€%sâ€"
+
+msgid "bundle-uri: expected flush after arguments"
+msgstr "bundle-uri: förväntade â€flush†efter argument"
+
+msgid "bundle-uri: got an empty line"
+msgstr "bunt-uri: fick en tom rad"
+
+msgid "bundle-uri: line is not of the form 'key=value'"
+msgstr "bunt-uri: raden är inte pÃ¥ formen â€nyckel=värdeâ€"
+
+msgid "bundle-uri: line has empty key or value"
+msgstr "bunt-uri: raden har tom nyckel eller värde"
+
#, c-format
msgid "unrecognized bundle hash algorithm: %s"
-msgstr "okänd hashningsalgoritm för bunt: \"%s\""
+msgstr "okänd hashningsalgoritm för bunt: â€%sâ€"
#, c-format
msgid "unknown capability '%s'"
-msgstr "okänd kapabilitet \"%s\""
+msgstr "okänd kapabilitet â€%sâ€"
#, c-format
msgid "'%s' does not look like a v2 or v3 bundle file"
@@ -13083,6 +13671,13 @@ msgstr "Arkivet saknar dessa nödvändiga incheckningar:"
msgid "need a repository to verify a bundle"
msgstr "behöver ett arkiv för att bekräfta en bunt."
+msgid ""
+"some prerequisite commits exist in the object store, but are not connected "
+"to the repository's history"
+msgstr ""
+"några förutsättande incheckningar finns i objektkatalogen, men är inte "
+"anslutna i arkivets historik"
+
#, c-format
msgid "The bundle contains this ref:"
msgid_plural "The bundle contains these %<PRIuMAX> refs:"
@@ -13098,6 +13693,14 @@ msgid_plural "The bundle requires these %<PRIuMAX> refs:"
msgstr[0] "Bunten kräver denna referens:"
msgstr[1] "Bunten kräver dessa %<PRIuMAX> referenser:"
+#, c-format
+msgid "The bundle uses this hash algorithm: %s"
+msgstr "Bunten använder denna hashningsalgoritm: %s"
+
+#, c-format
+msgid "The bundle uses this filter: %s"
+msgstr "Bunten använder detta filter. %s"
+
msgid "unable to dup bundle descriptor"
msgstr "kan inte duplicera bunthandtag"
@@ -13109,7 +13712,7 @@ msgstr "pack-objects misslyckades"
#, c-format
msgid "ref '%s' is excluded by the rev-list options"
-msgstr "referensen \"%s\" exkluderas av argumenten till rev-list"
+msgstr "referensen â€%s†exkluderas av argumenten till rev-list"
#, c-format
msgid "unsupported bundle version %d"
@@ -13124,7 +13727,7 @@ msgstr "Vägrar skapa en tom bunt."
#, c-format
msgid "cannot create '%s'"
-msgstr "kan inte skapa \"%s\""
+msgstr "kan inte skapa â€%sâ€"
msgid "index-pack died"
msgstr "index-pack dog"
@@ -13133,6 +13736,10 @@ msgid "terminating chunk id appears earlier than expected"
msgstr "avslutande stycke-id förekommer tidigare än förväntat"
#, c-format
+msgid "chunk id %<PRIx32> not %d-byte aligned"
+msgstr "stycke-id %<PRIx32> är inte %d-byte-justerad"
+
+#, c-format
msgid "improper chunk offset(s) %<PRIx64> and %<PRIx64>"
msgstr "felaktigt stycke-offset %<PRIx64> och %<PRIx64>"
@@ -13184,9 +13791,8 @@ msgstr "Samla information från användaren för att sända en felrapport"
msgid "Move objects and refs by archive"
msgstr "Flytta objekt och referenser efter arkiv"
-msgid "Provide content or type and size information for repository objects"
-msgstr ""
-"Visa innehåller eller typ- och storleksinformation för objekt i arkivet"
+msgid "Provide contents or details of repository objects"
+msgstr "Visa innehåll eller detaljer för objekt i arkivet"
msgid "Display gitattributes information"
msgstr "Visa information från gitattributes"
@@ -13263,6 +13869,9 @@ msgstr "En riktigt enkel server för Git-arkiv"
msgid "Give an object a human readable name based on an available ref"
msgstr "Ge ett objekt användarläsbara namn baserade på en tillgänglig referens"
+msgid "Generate a zip archive of diagnostic information"
+msgstr "Skapa ett zip-arkiv med diagnostisk information"
+
msgid "Show changes between commits, commit and working tree, etc"
msgstr "Visa ändringar mellan incheckningar, med arbetskatalogen, osv"
@@ -13320,8 +13929,8 @@ msgstr "Visa rader som motsvarar mönster"
msgid "A portable graphical interface to Git"
msgstr "Ett portabelt grafiskt gränssnitt för Git"
-msgid "Compute object ID and optionally creates a blob from a file"
-msgstr "Beräkna objekt-id och möjligen skapa en blob från en fil"
+msgid "Compute object ID and optionally create an object from a file"
+msgstr "Beräkna objekt-ID och möjligen skapa ett objekt från en fil"
msgid "Display help information about Git"
msgstr "Visa hjälpinformation om Git"
@@ -13390,8 +13999,8 @@ msgstr "Kör en sammanslagning för filer som behöver det"
msgid "The standard helper program to use with git-merge-index"
msgstr "Förvalt hjälpprogram att använda tillsammans med git-merge-index"
-msgid "Show three-way merge without touching index"
-msgstr "Visa trevägssammanslagning utan att röra indexet"
+msgid "Perform merge without touching index or working tree"
+msgstr "Utför sammanslagning utan att röra index eller arbetskatalog"
msgid "Run merge conflict resolution tools to resolve merge conflicts"
msgstr "Kör verktyg för lösning av sammanslagningskonflikter"
@@ -13468,6 +14077,11 @@ msgstr "Packa opackade objekt i ett arkiv"
msgid "Create, list, delete refs to replace objects"
msgstr "Skapa, visa, ta bort referenser för att ersätta objekt"
+msgid "EXPERIMENTAL: Replay commits on a new base, works with bare repos too"
+msgstr ""
+"EXPERIMENTELLT: Spela om incheckningar ovanpå en ny bas, fungerar även med "
+"nakna arkiv"
+
msgid "Generates a summary of pending changes"
msgstr "Skapar en sammanfattning av väntande ändringar"
@@ -13508,7 +14122,7 @@ msgid "Restricted login shell for Git-only SSH access"
msgstr "Begränsat inloggningsskal för SSH-åtkomst till bara Git"
msgid "Summarize 'git log' output"
-msgstr "Summera \"git log\"-utdata"
+msgstr "Summera â€git logâ€-utdata"
msgid "Show various types of objects"
msgstr "Visa olika sorters objekt"
@@ -13585,8 +14199,11 @@ msgstr "Bekräfta packade Git-arkivfiler"
msgid "Check the GPG signature of tags"
msgstr "Kontrollera GPG-signaturer i taggar"
-msgid "Show logs with difference each commit introduces"
-msgstr "Visa loggar med differenser varje incheckning introducerar"
+msgid "Display version information about Git"
+msgstr "Visa versionsinformation om Git"
+
+msgid "Show logs with differences each commit introduces"
+msgstr "Visa loggar med ändringarna varje incheckning introducerar"
msgid "Manage multiple working trees"
msgstr "Hantera ytterligare arbetskataloger"
@@ -13618,6 +14235,24 @@ msgstr "Ett användbart minsta uppsättning kommandon för vardags-Git"
msgid "Frequently asked questions about using Git"
msgstr "Ofta ställda frågor om att använda Git"
+msgid "The bundle file format"
+msgstr "Filformat för bunt"
+
+msgid "Chunk-based file formats"
+msgstr "Styckebaserade filformat"
+
+msgid "Git commit-graph format"
+msgstr "Format för Git-incheckningsgraf"
+
+msgid "Git index format"
+msgstr "Format för Git-index"
+
+msgid "Git pack format"
+msgstr "Format för Git-paket"
+
+msgid "Git cryptographic signature formats"
+msgstr "Format för kryptografiska signaturer i Git"
+
msgid "A Git Glossary"
msgstr "En Git-ordlista"
@@ -13639,6 +14274,21 @@ msgstr "Ange egenskaper för undermoduler"
msgid "Git namespaces"
msgstr "Git-namnrymder"
+msgid "Protocol v0 and v1 capabilities"
+msgstr "Kapabiliteter i protokoll v0 och v1"
+
+msgid "Things common to various protocols"
+msgstr "Vad är gemensamt i de olika protokollen"
+
+msgid "Git HTTP-based protocols"
+msgstr "HTTP-baserade Git-protokoll"
+
+msgid "How packs are transferred over-the-wire"
+msgstr "Hur paket överförs på linjen"
+
+msgid "Git Wire Protocol, Version 2"
+msgstr "Gits linjeprotokoll, version 2"
+
msgid "Helper programs to interact with remote repositories"
msgstr "Hjälpprogram för att interagera med fjärrarkiv"
@@ -13663,9 +14313,38 @@ msgstr "Git-webbgränssnitt (webbframända för Git-arkiv)"
msgid "An overview of recommended workflows with Git"
msgstr "Översikt över rekommenderade arbetsflöden med Git"
+msgid "A tool for managing large Git repositories"
+msgstr "Verktyg för att hantera stora Git-arkiv"
+
msgid "commit-graph file is too small"
msgstr "incheckningsgraffilen %s är för liten"
+msgid "commit-graph oid fanout chunk is wrong size"
+msgstr "incheckningsgrafens oid-utbredningsstycke har fel storlek"
+
+msgid "commit-graph fanout values out of order"
+msgstr "incheckningsgrafens utbredningsvärden är i fel ordning"
+
+msgid "commit-graph OID lookup chunk is the wrong size"
+msgstr "incheckningsgrafens OID-uppslagningsstycket har fel storlek"
+
+msgid "commit-graph commit data chunk is wrong size"
+msgstr "incheckningsgrafens incheckningsdatastycke har fel storlek"
+
+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"
+
+#, c-format
+msgid ""
+"ignoring too-small changed-path chunk (%<PRIuMAX> < %<PRIuMAX>) in commit-"
+"graph file"
+msgstr ""
+"ignorerar för litet ändrade-sökvägar-stycke (%<PRIuMAX> < %<PRIuMAX>) i "
+"incheckningsgraffilen"
+
#, c-format
msgid "commit-graph signature %X does not match signature %X"
msgstr "incheckningsgrafens signatur %X stämmer inte med signaturen %X"
@@ -13682,15 +14361,37 @@ msgstr "incheckningsgrafens hashversion %X stämmer inte med versionen %X"
msgid "commit-graph file is too small to hold %u chunks"
msgstr "incheckningsgraffilen är för liten för att innehålla %u stycken"
+msgid "commit-graph required OID fanout chunk missing or corrupted"
+msgstr ""
+"incheckningsgrafens nödvändiga OID-utbredningsstycke saknas eller är trasigt"
+
+msgid "commit-graph required OID lookup chunk missing or corrupted"
+msgstr ""
+"incheckningsgrafens nödvändiga OID-uppslagningsstycke saknas eller är trasigt"
+
+msgid "commit-graph required commit data chunk missing or corrupted"
+msgstr ""
+"incheckningsgrafens nödvändiga incheckningsdatastycke saknas eller är trasigt"
+
msgid "commit-graph has no base graphs chunk"
msgstr "incheckningsgrafen har inga bas-graf-stycken"
+msgid "commit-graph base graphs chunk is too small"
+msgstr "incheckningsgrafens bas-graf-stycken är för små"
+
msgid "commit-graph chain does not match"
msgstr "incheckningsgrafens kedja stämmer inte"
#, c-format
+msgid "commit count in base graph too high: %<PRIuMAX>"
+msgstr "antalet incheckningar i basgrafen för högt: %<PRIuMAX>"
+
+msgid "commit-graph chain file too small"
+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 incheckingsgrafkedja: rad â€%s†är inte ett hash-värde"
msgid "unable to find all commit-graph files"
msgstr "kan inte hitta alla incheckingsgraffiler"
@@ -13705,6 +14406,12 @@ msgstr "kunde inte hitta incheckningen %s"
msgid "commit-graph requires overflow generation data but has none"
msgstr "incheckningsgraf kräver spillgenerationsdata, men har ingen"
+msgid "commit-graph overflow generation data is too small"
+msgstr "incheckningsgrafens spillgenerationsdata är för liten"
+
+msgid "commit-graph extra-edges pointer out of bounds"
+msgstr "incheckningsgrafens extra-kant-pekare är utanför intervallet"
+
msgid "Loading known commits in commit graph"
msgstr "Läser in kända incheckningar i incheckningsgraf"
@@ -13754,7 +14461,7 @@ msgstr "kan inte skapa temporärt graflager"
#, c-format
msgid "unable to adjust shared permissions for '%s'"
-msgstr "kan inte justera delade behörigheter för \"%s\""
+msgstr "kan inte justera delade behörigheter för â€%sâ€"
#, c-format
msgid "Writing out commit graph in %d pass"
@@ -13771,6 +14478,14 @@ msgstr "kunde inte byta namn på bas-incheckingsgraffilen"
msgid "failed to rename temporary commit-graph file"
msgstr "kunde inte byta namn på temporär incheckningsgraffil"
+#, c-format
+msgid "cannot merge graphs with %<PRIuMAX>, %<PRIuMAX> commits"
+msgstr "kan inte slå ihop grafer med %<PRIuMAX>, %<PRIuMAX> incheckningar"
+
+#, c-format
+msgid "cannot merge graph %s, too many commits: %<PRIuMAX>"
+msgstr "kan inte slå ihop grafen %s, med för många incheckningar: %<PRIuMAX>"
+
msgid "Scanning merged commits"
msgstr "Söker sammanslagna incheckningar"
@@ -13779,7 +14494,7 @@ msgstr "Slår ihop incheckningsgraf"
msgid "attempting to write a commit-graph, but 'core.commitGraph' is disabled"
msgstr ""
-"försöker skriva en incheckningsgraf, men \"core.commitGraph\" är inaktiverad"
+"försöker skriva en incheckningsgraf, men â€core.commitGraph†är inaktiverad"
msgid "too many commits to write graph"
msgstr "för många incheckningar för att skriva graf"
@@ -13802,9 +14517,6 @@ msgstr ""
msgid "failed to parse commit %s from commit-graph"
msgstr "kunde inte tolka incheckning %s från incheckningsgraf"
-msgid "Verifying commits in commit graph"
-msgstr "Bekräftar incheckningar i incheckningsgrafen"
-
#, c-format
msgid "failed to parse commit %s from object database for commit-graph"
msgstr ""
@@ -13828,20 +14540,6 @@ msgstr ""
"incheckningsgrafens föräldralista för incheckningen %s avslutas för tidigt"
#, c-format
-msgid ""
-"commit-graph has generation number zero for commit %s, but non-zero elsewhere"
-msgstr ""
-"incheckningsgrafen har generationsnummer noll för incheckningen %s, men icke-"
-"noll på annan plats"
-
-#, c-format
-msgid ""
-"commit-graph has non-zero generation number for commit %s, but zero elsewhere"
-msgstr ""
-"incheckningsgrafen har generationsnummer skilt från noll för incheckningen "
-"%s, men noll på annan plats"
-
-#, c-format
msgid "commit-graph generation for commit %s is %<PRIuMAX> < %<PRIuMAX>"
msgstr ""
"incheckningsgrafens generation för incheckningen %s är %<PRIuMAX> < "
@@ -13854,6 +14552,17 @@ msgstr ""
"= %<PRIuMAX>"
#, c-format
+msgid ""
+"commit-graph has both zero and non-zero generations (e.g., commits '%s' and "
+"'%s')"
+msgstr ""
+"incheckningsgrafen har generationsnummer som både är noll och icke-noll "
+"(dvs, incheckningarna â€%s†och â€%sâ€)"
+
+msgid "Verifying commits in commit graph"
+msgstr "Bekräftar incheckningar i incheckningsgrafen"
+
+#, c-format
msgid "%s %s is not a commit!"
msgstr "%s %s är inte en incheckning!"
@@ -13870,11 +14579,16 @@ 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"
"\n"
-"Använd \"git replace --convert-graft-file\"\n"
+"Använd â€git replace --convert-graft-fileâ€\n"
"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 advice.graftFileDeprecated falseâ€"
+
+#, c-format
+msgid "commit %s exists in commit-graph but not in the object database"
+msgstr ""
+"incheckningen %s finns i incheckningsgrafen, men inte i objektdatabasen"
#, c-format
msgid "Commit %s has an untrusted GPG signature, allegedly by %s."
@@ -13910,29 +14624,41 @@ msgid "no libc information available\n"
msgstr "ingen libc-information tillgänglig\n"
#, c-format
+msgid "could not determine free disk size for '%s'"
+msgstr "kunde inte ta reda pÃ¥ ledigt diskutrymme för â€%sâ€"
+
+#, c-format
+msgid "could not get info for '%s'"
+msgstr "kunde inte hämta info för â€%sâ€"
+
+#, c-format
msgid "[GLE %ld] health thread could not open '%ls'"
-msgstr "[GLE %ld] hälsotråden kunde inte öppna \"%ls\""
+msgstr "[GLE %ld] hälsotrÃ¥den kunde inte öppna â€%lsâ€"
#, c-format
msgid "[GLE %ld] health thread getting BHFI for '%ls'"
-msgstr "[GLE %ld] hälsotråden hämtar BHFI för \"%ls\""
+msgstr "[GLE %ld] hälsotrÃ¥den hämtar BHFI för â€%lsâ€"
#, c-format
msgid "could not convert to wide characters: '%s'"
-msgstr "kunde inte konvertera till breda tecken: \"%s\""
+msgstr "kunde inte konvertera till breda tecken: â€%sâ€"
#, c-format
msgid "BHFI changed '%ls'"
-msgstr "BHFI ändrade \"%ls\""
+msgstr "BHFI ändrade â€%lsâ€"
#, c-format
msgid "unhandled case in 'has_worktree_moved': %d"
-msgstr "ohanterat fall i \"has_worktree_moved\": %d"
+msgstr "ohanterat fall i â€has_worktree_movedâ€: %d"
#, c-format
msgid "health thread wait failed [GLE %ld]"
msgstr "misslyckades vänta på hälsotråden [GLE %ld]"
+#, c-format
+msgid "Invalid path: %s"
+msgstr "ogiltig sökväg: %s"
+
msgid "Unable to create FSEventStream."
msgstr "kunde inte skapa FSEventStream."
@@ -13941,35 +14667,59 @@ msgstr "Misslyckades starta FSEventStream:en"
#, c-format
msgid "[GLE %ld] could not convert path to UTF-8: '%.*ls'"
-msgstr "[GLE %ld] kunde inte konvertera sökväg till UTF-8: \"%.*ls\""
+msgstr "[GLE %ld] kunde inte konvertera sökväg till UTF-8: â€%.*lsâ€"
#, c-format
msgid "[GLE %ld] could not watch '%s'"
-msgstr "[GLE %ld] kunde inte övervaka \"%s\""
+msgstr "[GLE %ld] kunde inte övervaka â€%sâ€"
#, c-format
msgid "[GLE %ld] could not get longname of '%s'"
-msgstr "[GLE %ld] kunde inte hämta långt namn för \"%s\""
+msgstr "[GLE %ld] kunde inte hämta lÃ¥ngt namn för â€%sâ€"
#, c-format
msgid "ReadDirectoryChangedW failed on '%s' [GLE %ld]"
-msgstr "ReadDirectoryChangedW misslyckades på \"%s\" [GLE %ld]"
+msgstr "ReadDirectoryChangedW misslyckades pÃ¥ â€%s†[GLE %ld]"
#, c-format
msgid "GetOverlappedResult failed on '%s' [GLE %ld]"
-msgstr "GetOverlappedResult misslyckades på \"%s\" [GLE %ld]"
+msgstr "GetOverlappedResult misslyckades pÃ¥ â€%s†[GLE %ld]"
#, c-format
msgid "could not read directory changes [GLE %ld]"
msgstr "kunde inte läsa katalogändringar [GLE %ld]"
#, c-format
+msgid "opendir('%s') failed"
+msgstr "opendir('%s') misslyckades"
+
+#, c-format
+msgid "lstat('%s') failed"
+msgstr "lstat('%s') misslyckades"
+
+#, c-format
+msgid "strbuf_readlink('%s') failed"
+msgstr "strbuf_readlink('%s') misslyckades"
+
+#, c-format
+msgid "closedir('%s') failed"
+msgstr "closedir('%s') misslyckades"
+
+#, c-format
+msgid "[GLE %ld] unable to open for read '%ls'"
+msgstr "[GLE %ld] kunde inte öppna â€%ls†för läsning"
+
+#, c-format
+msgid "[GLE %ld] unable to get protocol information for '%ls'"
+msgstr "[GLE %ld] kunde inte hämta protokollinformation för â€%lsâ€"
+
+#, c-format
msgid "failed to copy SID (%ld)"
msgstr "misslyckades kopiera SID (%ld)"
#, c-format
msgid "failed to get owner for '%s' (%ld)"
-msgstr "misslyckades hämta ägaren för \"%s\" (%ld)"
+msgstr "misslyckades hämta ägaren för â€%s†(%ld)"
msgid "memory exhausted"
msgstr "minnet slut"
@@ -14036,15 +14786,15 @@ msgstr "kunde inte läsa IPC-svar"
#, c-format
msgid "could not start accept_thread '%s'"
-msgstr "kunde inte ta status \"accept_thread\" \"%s\""
+msgstr "kunde inte ta status â€accept_thread†â€%sâ€"
#, c-format
msgid "could not start worker[0] for '%s'"
-msgstr "kunde inte starta \"worker[0]\" för \"%s\""
+msgstr "kunde inte starta â€worker[0]†för â€%sâ€"
#, c-format
msgid "ConnectNamedPipe failed for '%s' (%lu)"
-msgstr "ConnectNamedPipe misslyckades för \"%s\" (%lu)"
+msgstr "ConnectNamedPipe misslyckades för â€%s†(%lu)"
#, c-format
msgid "could not create fd from pipe for '%s'"
@@ -14052,14 +14802,14 @@ msgstr "kunde inte skapa filhandtag från rör för %s"
#, c-format
msgid "could not start thread[0] for '%s'"
-msgstr "kunde inte starta thread[0] för \"%s\""
+msgstr "kunde inte starta thread[0] för â€%sâ€"
#, c-format
msgid "wait for hEvent failed for '%s'"
-msgstr "misslyckades vänta på hEvent för \"%s\""
+msgstr "misslyckades vänta pÃ¥ hEvent för â€%sâ€"
msgid "cannot resume in the background, please use 'fg' to resume"
-msgstr "kan inte fortsätta i bakgrunden, använd \"fg\" för att återuppta"
+msgstr "kan inte fortsätta i bakgrunden, använd â€fg†för att Ã¥teruppta"
msgid "cannot restore terminal settings"
msgstr "kan inte återställa terminalinställningar"
@@ -14080,7 +14830,7 @@ msgstr ""
#, c-format
msgid "could not expand include path '%s'"
-msgstr "kunde inte expandera inkluderingssökväg \"%s\""
+msgstr "kunde inte expandera inkluderingssökväg â€%sâ€"
msgid "relative config includes must come from files"
msgstr "relativa konfigureringsinkluderingar måste komma från filer"
@@ -14101,11 +14851,11 @@ msgstr "felaktigt konfigurationsformat: %s"
#, c-format
msgid "missing environment variable name for configuration '%.*s'"
-msgstr "miljövariabelnamn saknas för konfigurationen \"%.*s\""
+msgstr "miljövariabelnamn saknas för konfigurationen â€%.*sâ€"
#, c-format
msgid "missing environment variable '%s' for configuration '%.*s'"
-msgstr "miljövariabeln \"%s\" saknas för konfigurationen \"%.*s\""
+msgstr "miljövariabeln â€%s†saknas för konfigurationen â€%.*sâ€"
#, c-format
msgid "key does not contain a section: %s"
@@ -14182,38 +14932,35 @@ msgstr "ogiltig enhet"
#, c-format
msgid "bad numeric config value '%s' for '%s': %s"
-msgstr "felaktigt numeriskt konfigurationsvärde \"%s\" för \"%s\": %s"
+msgstr "felaktigt numeriskt konfigurationsvärde â€%s†för â€%sâ€: %s"
#, c-format
msgid "bad numeric config value '%s' for '%s' in blob %s: %s"
-msgstr ""
-"felaktigt numeriskt konfigurationsvärde \"%s\" för \"%s\" i blob:en %s: %s"
+msgstr "felaktigt numeriskt konfigurationsvärde â€%s†för â€%s†i blob:en %s: %s"
#, c-format
msgid "bad numeric config value '%s' for '%s' in file %s: %s"
-msgstr ""
-"felaktigt numeriskt konfigurationsvärde \"%s\" för \"%s\" i filen %s: %s"
+msgstr "felaktigt numeriskt konfigurationsvärde â€%s†för â€%s†i filen %s: %s"
#, c-format
msgid "bad numeric config value '%s' for '%s' in standard input: %s"
msgstr ""
-"felaktigt numeriskt konfigurationsvärde \"%s\" för \"%s\" i standard in: %s"
+"felaktigt numeriskt konfigurationsvärde â€%s†för â€%s†i standard in: %s"
#, c-format
msgid "bad numeric config value '%s' for '%s' in submodule-blob %s: %s"
msgstr ""
-"felaktigt numeriskt konfigurationsvärde \"%s\" för \"%s\" i undermodul-blob:"
-"en %s: %s"
+"felaktigt numeriskt konfigurationsvärde â€%s†för â€%s†i undermodul-blob:en "
+"%s: %s"
#, c-format
msgid "bad numeric config value '%s' for '%s' in command line %s: %s"
msgstr ""
-"felaktigt numeriskt konfigurationsvärde \"%s\" för \"%s\" i kommandoraden "
-"%s: %s"
+"felaktigt numeriskt konfigurationsvärde â€%s†för â€%s†i kommandoraden %s: %s"
#, c-format
msgid "bad numeric config value '%s' for '%s' in %s: %s"
-msgstr "felaktigt numeriskt konfigurationsvärde \"%s\" för \"%s\" i %s: %s"
+msgstr "felaktigt numeriskt konfigurationsvärde â€%s†för â€%s†i %s: %s"
#, c-format
msgid "invalid value for variable %s"
@@ -14221,19 +14968,19 @@ msgstr "ogiltigt värde för variabeln %s"
#, c-format
msgid "ignoring unknown core.fsync component '%s'"
-msgstr "ignorerar okänd core.fsync-komponent \"%s\""
+msgstr "ignorerar okänd core.fsync-komponent â€%sâ€"
#, c-format
msgid "bad boolean config value '%s' for '%s'"
-msgstr "felaktigt booleskt konfigurationsvärde \"%s\" för \"%s\""
+msgstr "felaktigt booleskt konfigurationsvärde â€%s†för â€%sâ€"
#, c-format
msgid "failed to expand user dir in: '%s'"
-msgstr "misslyckades expandera användarkatalog i: \"%s\""
+msgstr "misslyckades expandera användarkatalog i: â€%sâ€"
#, c-format
msgid "'%s' for '%s' is not a valid timestamp"
-msgstr "\"%s\" för \"%s\" är inte en giltig tidsstämpel"
+msgstr "â€%s†för â€%s†är inte en giltig tidsstämpel"
#, c-format
msgid "abbrev length out of range: %d"
@@ -14243,12 +14990,12 @@ msgstr "förkortningslängd utanför intervallet: %d"
msgid "bad zlib compression level %d"
msgstr "felaktigt zlib-komprimeringsgrad %d"
-msgid "core.commentChar should only be one character"
-msgstr "core.commentChar kan bara vara ett tecken"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar kan bara vara ett ASCII-tecken"
#, c-format
msgid "ignoring unknown core.fsyncMethod value '%s'"
-msgstr "ignorerar okänt core.fsyncMethod-värde \"%s\""
+msgstr "ignorerar okänt core.fsyncMethod-värde â€%sâ€"
msgid "core.fsyncObjectFiles is deprecated; use core.fsync instead"
msgstr "core.fsyncObjectFiles avråds från; använd core.fsync istället"
@@ -14270,19 +15017,15 @@ msgstr "måste vara en av nothing, matching, simple, upstream eller current"
#, c-format
msgid "unable to load config blob object '%s'"
-msgstr "kunde inte läsa konfigurerings-blobobjektet \"%s\""
+msgstr "kunde inte läsa konfigurerings-blobobjektet â€%sâ€"
#, c-format
msgid "reference '%s' does not point to a blob"
-msgstr "referensen \"%s\" pekar inte på en blob"
+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\""
-
-#, c-format
-msgid "failed to parse %s"
-msgstr "kunde inte tolka %s"
+msgstr "kan inte slÃ¥ upp konfigurerings-bloben â€%sâ€"
msgid "unable to parse command-line config"
msgstr "kan inte tolka kommandoradskonfiguration"
@@ -14292,24 +15035,24 @@ msgstr "okänt fel uppstod vid läsning av konfigurationsfilerna"
#, c-format
msgid "Invalid %s: '%s'"
-msgstr "Felaktigt %s: \"%s\""
+msgstr "Felaktigt %s: â€%sâ€"
#, c-format
msgid "splitIndex.maxPercentChange value '%d' should be between 0 and 100"
msgstr ""
-"värdet \"%d\" för splitIndex.maxPercentChange borde vara mellan 0 och 100"
+"värdet â€%d†för splitIndex.maxPercentChange borde vara mellan 0 och 100"
#, c-format
msgid "unable to parse '%s' from command-line config"
-msgstr "kunde inte tolka värdet \"%s\" från kommandoradskonfiguration"
+msgstr "kunde inte tolka värdet â€%s†frÃ¥n kommandoradskonfiguration"
#, c-format
msgid "bad config variable '%s' in file '%s' at line %d"
-msgstr "felaktig konfigurationsvariabel \"%s\" i filen \"%s\" på rad %d"
+msgstr "felaktig konfigurationsvariabel â€%s†i filen â€%s†pÃ¥ rad %d"
#, c-format
msgid "invalid section name '%s'"
-msgstr "felaktigt sektionsnamn \"%s\""
+msgstr "felaktigt sektionsnamn â€%sâ€"
#, c-format
msgid "%s has multiple values"
@@ -14317,7 +15060,7 @@ msgstr "%s har flera värden"
#, c-format
msgid "failed to write new configuration file %s"
-msgstr "kan inte skriva nya konfigurationsfilen \"%s\""
+msgstr "kan inte skriva nya konfigurationsfilen â€%sâ€"
#, c-format
msgid "could not lock config file %s"
@@ -14329,7 +15072,7 @@ msgstr "öppnar %s"
#, c-format
msgid "invalid config file %s"
-msgstr "ogiltig konfigurationsfil: \"%s\""
+msgstr "ogiltig konfigurationsfil: â€%sâ€"
#, c-format
msgid "fstat on %s failed"
@@ -14337,7 +15080,7 @@ msgstr "fstat misslyckades på %s"
#, c-format
msgid "unable to mmap '%s'%s"
-msgstr "kunde inte utföra mmap på \"%s\"%s"
+msgstr "kunde inte utföra mmap pÃ¥ â€%sâ€%s"
#, c-format
msgid "chmod on %s failed"
@@ -14349,15 +15092,19 @@ msgstr "kunde inte skriva konfigurationsfilen %s"
#, c-format
msgid "could not set '%s' to '%s'"
-msgstr "kunde inte ställa in \"%s\" till \"%s\""
+msgstr "kunde inte ställa in â€%s†till â€%sâ€"
#, c-format
msgid "invalid section name: %s"
msgstr "felaktigt namn på stycke: %s"
#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr "vägrar arbeta med för lÃ¥nga rader i â€%s†pÃ¥ rad %<PRIuMAX>"
+
+#, c-format
msgid "missing value for '%s'"
-msgstr "värde saknas för \"%s\""
+msgstr "värde saknas för â€%sâ€"
msgid "the remote end hung up upon initial contact"
msgstr "fjärren lade på vid inledande kontakt"
@@ -14375,25 +15122,25 @@ msgstr ""
#, c-format
msgid "server doesn't support '%s'"
-msgstr "Servern stöder inte \"%s\""
+msgstr "Servern stöder inte â€%sâ€"
#, c-format
msgid "server doesn't support feature '%s'"
-msgstr "servern stöder inte funktionen \"%s\""
+msgstr "servern stöder inte funktionen â€%sâ€"
msgid "expected flush after capabilities"
-msgstr "förväntade \"flush\" efter förmågor"
+msgstr "förväntade â€flush†efter förmÃ¥gor"
#, c-format
msgid "ignoring capabilities after first line '%s'"
-msgstr "ignorerar förmågor efter första raden \"%s\""
+msgstr "ignorerar förmÃ¥gor efter första raden â€%sâ€"
msgid "protocol error: unexpected capabilities^{}"
msgstr "protokollfel: förväntade inte capabilities^{}"
#, c-format
msgid "protocol error: expected shallow sha-1, got '%s'"
-msgstr "protokollfel: förväntade \"shallow sha-1\" fick \"%s\""
+msgstr "protokollfel: förväntade â€shallow sha-1†fick â€%sâ€"
msgid "repository on the other end cannot be shallow"
msgstr "arkivet på andra sidan kan inte vara grunt"
@@ -14403,25 +15150,32 @@ msgstr "ogiltigt paket"
#, c-format
msgid "protocol error: unexpected '%s'"
-msgstr "protokollfel: förväntade inte \"%s\""
+msgstr "protokollfel: förväntade inte â€%sâ€"
#, c-format
msgid "unknown object format '%s' specified by server"
-msgstr "okänt objektformat \"%s\" angavs av servern"
+msgstr "okänt objektformat â€%s†angavs av servern"
#, c-format
-msgid "invalid ls-refs response: %s"
-msgstr "ogiltigt svar på ls-refs: %s"
+msgid "error on bundle-uri response line %d: %s"
+msgstr "fel på bundle-uri-svar rad %d: %s"
-msgid "expected flush after ref listing"
-msgstr "förväntade \"flush\" efter ref-listan"
+msgid "expected flush after bundle-uri listing"
+msgstr "förväntade â€flush†efter bundle-uri-listan"
msgid "expected response end packet after ref listing"
msgstr "förväntade svarsavslutningspaket efter ref-listan"
#, c-format
+msgid "invalid ls-refs response: %s"
+msgstr "ogiltigt svar på ls-refs: %s"
+
+msgid "expected flush after ref listing"
+msgstr "förväntade â€flush†efter ref-listan"
+
+#, c-format
msgid "protocol '%s' is not supported"
-msgstr "protokollet \"%s\" stöds inte"
+msgstr "protokollet â€%s†stöds inte"
msgid "unable to set SO_KEEPALIVE on socket"
msgstr "kunde inte sätta SO_KEEPALIVE på uttaget"
@@ -14465,40 +15219,40 @@ msgstr "okänd port %s"
#, c-format
msgid "strange hostname '%s' blocked"
-msgstr "konstigt värdnamn \"%s\" blockerat"
+msgstr "konstigt värdnamn â€%s†blockerat"
#, c-format
msgid "strange port '%s' blocked"
-msgstr "konstig port \"%s\" blockerad"
+msgstr "konstig port â€%s†blockerad"
#, c-format
msgid "cannot start proxy %s"
msgstr "kan inte starta mellanserver (proxy) %s"
msgid "no path specified; see 'git help pull' for valid url syntax"
-msgstr "ingen sökväg angavs; se \"git help pull\" för giltig URL-syntax"
+msgstr "ingen sökväg angavs; se â€git help pull†för giltig URL-syntax"
msgid "newline is forbidden in git:// hosts and repo paths"
msgstr "radbrytningar är förbjudna i git://-värdnamn och arkivsökvägar"
msgid "ssh variant 'simple' does not support -4"
-msgstr "ssh-varianten \"simple\" stöder inte -4"
+msgstr "ssh-varianten â€simple†stöder inte -4"
msgid "ssh variant 'simple' does not support -6"
-msgstr "ssh-varianten \"simple\" stöder inte -6"
+msgstr "ssh-varianten â€simple†stöder inte -6"
msgid "ssh variant 'simple' does not support setting port"
-msgstr "ssh-varianten \"simple\" stöder inte val av port"
+msgstr "ssh-varianten â€simple†stöder inte val av port"
#, c-format
msgid "strange pathname '%s' blocked"
-msgstr "konstigt sökvägsnamn \"%s\" blockerat"
+msgstr "konstigt sökvägsnamn â€%s†blockerat"
msgid "unable to fork"
msgstr "kunde inte grena (fork)"
msgid "Could not run 'git rev-list'"
-msgstr "Kunde inte köra \"git rev-list\""
+msgstr "Kunde inte köra â€git rev-listâ€"
msgid "failed write to rev-list"
msgstr "kunde inte skriva till rev-list"
@@ -14507,181 +15261,6 @@ msgid "failed to close rev-list's stdin"
msgstr "kunde inte stänga rev-list:s standard in"
#, c-format
-msgid "'%s' does not exist"
-msgstr "\"%s\" finns inte"
-
-msgid "need a working directory"
-msgstr "behöver en arbetskatalog"
-
-msgid "could not find enlistment root"
-msgstr "kunde inte hitta enrolleringsroten"
-
-#, c-format
-msgid "could not switch to '%s'"
-msgstr "kunde inte växla till \"%s\""
-
-#, c-format
-msgid "could not configure %s=%s"
-msgstr "kunde inte ställa in %s=%s"
-
-msgid "could not configure log.excludeDecoration"
-msgstr "kunde inte ställa in log.excludeDecoration"
-
-msgid "Scalar enlistments require a worktree"
-msgstr "Scalar-enrolleringar kräver en arbetskatalog"
-
-#, c-format
-msgid "could not open directory '%s'"
-msgstr "kunde inte öppna katalogen \"%s\""
-
-#, c-format
-msgid "skipping '%s', which is neither file nor directory"
-msgstr "hoppar över \"%s\", som varken är en fil eller en katalog"
-
-#, c-format
-msgid "could not determine free disk size for '%s'"
-msgstr "kunde inte ta reda på ledigt diskutrymme för \"%s\""
-
-#, c-format
-msgid "could not get info for '%s'"
-msgstr "kunde inte hämta info för \"%s\""
-
-#, c-format
-msgid "remote HEAD is not a branch: '%.*s'"
-msgstr "HEAD hos fjärren är inte en gren: \"%.*s\""
-
-msgid "failed to get default branch name from remote; using local default"
-msgstr ""
-"misslyckades hämta namn på standardgren för fjärr; använder lokalt förval"
-
-msgid "failed to get default branch name"
-msgstr "misslyckades hämta namn på standardgren"
-
-msgid "failed to unregister repository"
-msgstr "misslyckades avregistrera arkivet"
-
-msgid "failed to delete enlistment directory"
-msgstr "misslyckades ta bort enrolleringskatalogen"
-
-msgid "branch to checkout after clone"
-msgstr "gren att checka ut efter kloning"
-
-msgid "when cloning, create full working directory"
-msgstr "skapa komplett arbetskatalog vid kloning"
-
-msgid "only download metadata for the branch that will be checked out"
-msgstr "hämta endast metadata för grenen som skall checkas ut"
-
-msgid "scalar clone [<options>] [--] <repo> [<dir>]"
-msgstr "scalar clone [<flaggor>] [--] <arkiv> [<kat>]"
-
-#, c-format
-msgid "cannot deduce worktree name from '%s'"
-msgstr "Kan inte härleda arbetsträdsnamn från \"%s\""
-
-#, c-format
-msgid "directory '%s' exists already"
-msgstr "katalogen \"%s\" finns redan"
-
-#, c-format
-msgid "failed to get default branch for '%s'"
-msgstr "misslyckades hämta standardgren för \"%s\""
-
-#, c-format
-msgid "could not configure remote in '%s'"
-msgstr "kunde inte ställa in fjärr i \"%s\""
-
-#, c-format
-msgid "could not configure '%s'"
-msgstr "kunde inte ställa in \"%s\""
-
-msgid "partial clone failed; attempting full clone"
-msgstr "delvis klon misslyckades; försöker med fullständig klon"
-
-msgid "could not configure for full clone"
-msgstr "kunde inte ställa in för komplett klon"
-
-msgid "scalar diagnose [<enlistment>]"
-msgstr "scalar diagnose [<enrollering>]"
-
-#, c-format
-msgid "could not create directory for '%s'"
-msgstr "kunde inte skapa katalog för \"%s\""
-
-msgid "could not duplicate stdout"
-msgstr "kunde inte duplicera standard ut"
-
-msgid "failed to write archive"
-msgstr "misslyckades skriva arkiv"
-
-msgid "`scalar list` does not take arguments"
-msgstr "\"scalar list\" tar inte argument"
-
-msgid "scalar register [<enlistment>]"
-msgstr "scalar register [<enrollering>]"
-
-msgid "reconfigure all registered enlistments"
-msgstr "konfigurera alla registrerade enrolleringar på nytt"
-
-msgid "scalar reconfigure [--all | <enlistment>]"
-msgstr "scalar reconfigure [--all | <enrollering>]"
-
-msgid "--all or <enlistment>, but not both"
-msgstr "--all eller <enrollering>, men inte bägge"
-
-#, c-format
-msgid "git repository gone in '%s'"
-msgstr "git-arkiv försvunnet i \"%s\""
-
-msgid ""
-"scalar run <task> [<enlistment>]\n"
-"Tasks:\n"
-msgstr ""
-"scalar run <uppgift> [<enrollering>]\n"
-"Uppgifter:\n"
-
-#, c-format
-msgid "no such task: '%s'"
-msgstr "okänd uppgift: \"%s\""
-
-msgid "scalar unregister [<enlistment>]"
-msgstr "scalar unregister [<enrollering>]"
-
-msgid "scalar delete <enlistment>"
-msgstr "scalar delete <enrollering>"
-
-msgid "refusing to delete current working directory"
-msgstr "vägrar ta bort aktuell arbetskatalog"
-
-msgid "include Git version"
-msgstr "ta med Git-version"
-
-msgid "include Git's build options"
-msgstr "ta med Gits byggflaggor"
-
-msgid "scalar verbose [-v | --verbose] [--build-options]"
-msgstr "scalar verbose [-v | --verbose] [--build-options]"
-
-msgid "-C requires a <directory>"
-msgstr "-C kräver en <katalog>"
-
-#, c-format
-msgid "could not change to '%s'"
-msgstr "kunde inte byta till \"%s\""
-
-msgid "-c requires a <key>=<value> argument"
-msgstr "-c kräver ett argument på formen <nyckel>=<värde>"
-
-msgid ""
-"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
-"\n"
-"Commands:\n"
-msgstr ""
-"scalar [-C <katalog>] [-c <nyckel>=<värde>] <kommando> [<flaggor>]\n"
-"\n"
-"Kommandon:\n"
-
-#, c-format
msgid "illegal crlf_action %d"
msgstr "felaktig crlf_action %d"
@@ -14694,7 +15273,7 @@ msgid ""
"in the working copy of '%s', CRLF will be replaced by LF the next time Git "
"touches it"
msgstr ""
-"CRLF i arbetskopian av \"%s\" kommer ersättas med LF nästa gång Git rör den"
+"CRLF i arbetskopian av â€%s†kommer ersättas med LF nästa gÃ¥ng Git rör den"
#, c-format
msgid "LF would be replaced by CRLF in %s"
@@ -14705,60 +15284,59 @@ msgid ""
"in the working copy of '%s', LF will be replaced by CRLF the next time Git "
"touches it"
msgstr ""
-"LF i arbetskopian av \"%s\" kommer ersättas med CRLF nästa gång Git rör den"
+"LF i arbetskopian av â€%s†kommer ersättas med CRLF nästa gÃ¥ng Git rör den"
#, c-format
msgid "BOM is prohibited in '%s' if encoded as %s"
-msgstr "BOM är förbjudet i \"%s\" om kodat som %s"
+msgstr "BOM är förbjudet i â€%s†om kodat som %s"
#, c-format
msgid ""
"The file '%s' contains a byte order mark (BOM). Please use UTF-%.*s as "
"working-tree-encoding."
msgstr ""
-"Filen \"%s\" innehåller byte order mark (BOM). Använd UTF-%.*s som "
+"Filen â€%s†innehÃ¥ller byte order mark (BOM). Använd UTF-%.*s som "
"teckenkodning i arbetskatalogen."
#, c-format
msgid "BOM is required in '%s' if encoded as %s"
-msgstr "BOM krävs om \"%s\" kodas som %s"
+msgstr "BOM krävs om â€%s†kodas som %s"
#, c-format
msgid ""
"The file '%s' is missing a byte order mark (BOM). Please use UTF-%sBE or UTF-"
"%sLE (depending on the byte order) as working-tree-encoding."
msgstr ""
-"Filen \"%s\" saknar byte order mark (BOM). Använd UTF-%sBE eller UTF-%sLE "
+"Filen â€%s†saknar byte order mark (BOM). Använd UTF-%sBE eller UTF-%sLE "
"(beroende på byteordning) som teckenkodning i arbetskatalogen."
#, c-format
msgid "failed to encode '%s' from %s to %s"
-msgstr "misslyckades omkoda \"%s\" från %s till %s"
+msgstr "misslyckades omkoda â€%s†frÃ¥n %s till %s"
#, c-format
msgid "encoding '%s' from %s to %s and back is not the same"
-msgstr ""
-"omkodning av \"%s\" från %s till %s och tillbaka ger inte samma resultat"
+msgstr "omkodning av â€%s†frÃ¥n %s till %s och tillbaka ger inte samma resultat"
#, c-format
msgid "cannot fork to run external filter '%s'"
-msgstr "kan inte grena (fork) för att köra externt filter \"%s\""
+msgstr "kan inte grena (fork) för att köra externt filter â€%sâ€"
#, c-format
msgid "cannot feed the input to external filter '%s'"
-msgstr "kunde inte skicka indata till externt filter \"%s\""
+msgstr "kunde inte skicka indata till externt filter â€%sâ€"
#, c-format
msgid "external filter '%s' failed %d"
-msgstr "externt filter \"%s\" misslyckades %d"
+msgstr "externt filter â€%s†misslyckades %d"
#, c-format
msgid "read from external filter '%s' failed"
-msgstr "läsning från externt filter \"%s\" misslyckades"
+msgstr "läsning frÃ¥n externt filter â€%s†misslyckades"
#, c-format
msgid "external filter '%s' failed"
-msgstr "externt filter \"%s\" misslyckades"
+msgstr "externt filter â€%s†misslyckades"
msgid "unexpected filter type"
msgstr "oväntad filtertyp"
@@ -14771,19 +15349,19 @@ msgid ""
"external filter '%s' is not available anymore although not all paths have "
"been filtered"
msgstr ""
-"externt filter \"%s\" är inte längre tillgängligt trots att alla sökvägar "
-"inte har filtrerats"
+"externt filter â€%s†är inte längre tillgängligt trots att alla sökvägar inte "
+"har filtrerats"
msgid "true/false are no valid working-tree-encodings"
msgstr "true/false är inte giltig teckenkodning för arbetskatalogen"
#, c-format
msgid "%s: clean filter '%s' failed"
-msgstr "%s: \"clean\"-filtret \"%s\" misslyckades"
+msgstr "%s: â€cleanâ€-filtret â€%s†misslyckades"
#, c-format
msgid "%s: smudge filter %s failed"
-msgstr "%s: \"smudge\"-filtret \"%s\" misslyckades"
+msgstr "%s: â€smudgeâ€-filtret â€%s†misslyckades"
#, c-format
msgid "skipping credential lookup for key: credential.%s"
@@ -14874,7 +15452,7 @@ msgstr "felaktigt trädobjektet %s"
#, c-format
msgid "failed to load island regex for '%s': %s"
-msgstr "kunde inte hämta ö-regex för \"%s\": %s"
+msgstr "kunde inte hämta ö-regex för â€%sâ€: %s"
#, c-format
msgid "island regex from config has too many capture groups (max=%d)"
@@ -14884,12 +15462,35 @@ msgstr "ö-regex från konfiguration har för många fångstgrupper (max=%d)"
msgid "Marked %d islands, done.\n"
msgstr "Markerade %d öar, klar.\n"
+#, c-format
+msgid "invalid --%s value '%s'"
+msgstr "ogiltigt värde för --%s: â€%sâ€"
+
+#, c-format
+msgid "could not archive missing directory '%s'"
+msgstr "kunde inte arkivera saknad katalog â€%sâ€"
+
+#, c-format
+msgid "could not open directory '%s'"
+msgstr "kunde inte öppna katalogen â€%sâ€"
+
+#, c-format
+msgid "skipping '%s', which is neither file nor directory"
+msgstr "hoppar över â€%sâ€, som varken är en fil eller en katalog"
+
+msgid "could not duplicate stdout"
+msgstr "kunde inte duplicera standard ut"
+
+#, c-format
+msgid "could not add directory '%s' to archiver"
+msgstr "kunde inte lägga till katalogen â€%s†till arkiveraren"
+
+msgid "failed to write archive"
+msgstr "misslyckades skriva arkiv"
+
msgid "--merge-base does not work with ranges"
msgstr "--merge-base fungerar inte med intervall"
-msgid "--merge-base only works with commits"
-msgstr "--merge-base fungerar bara med incheckningar"
-
msgid "unable to get HEAD"
msgstr "kan inte hämta HEAD"
@@ -14899,6 +15500,12 @@ msgstr "ingen sammanslagningsbas hittades"
msgid "multiple merge bases found"
msgstr "flera sammanslagningsbaser hittades"
+msgid "cannot compare stdin to a directory"
+msgstr "kan inte jämföra standard in med en katalog"
+
+msgid "cannot compare a named pipe to a directory"
+msgstr "kan inte jämföra ett namngivet rör med en katalog"
+
msgid "git diff --no-index [<options>] <path> <path>"
msgstr "git diff --no-index [<flaggor>] <sökväg> <sökväg>"
@@ -14911,27 +15518,26 @@ msgstr ""
#, c-format
msgid " Failed to parse dirstat cut-off percentage '%s'\n"
-msgstr " Misslyckades tolka dirstat-avskärningsprocentandel \"%s\"\n"
+msgstr " Misslyckades tolka dirstat-avskärningsprocentandel â€%sâ€\n"
#, c-format
msgid " Unknown dirstat parameter '%s'\n"
-msgstr " Okänd dirstat-parameter \"%s\"\n"
+msgstr " Okänd dirstat-parameter â€%sâ€\n"
msgid ""
"color moved setting must be one of 'no', 'default', 'blocks', 'zebra', "
"'dimmed-zebra', 'plain'"
msgstr ""
-"färginställningen för flyttade block måste vara en av \"no\", \"default\", "
-"\"blocks\", \"zebra\", \"dimmed-zebra\", \"plain\""
+"färginställningen för flyttade block mÃ¥ste vara en av â€noâ€, â€defaultâ€, "
+"â€blocksâ€, â€zebraâ€, â€dimmed-zebraâ€, â€plainâ€"
#, c-format
msgid ""
"unknown color-moved-ws mode '%s', possible values are 'ignore-space-change', "
"'ignore-space-at-eol', 'ignore-all-space', 'allow-indentation-change'"
msgstr ""
-"okänt läge \"%s\" för color-moved-ws, möjliga värden är \"ignore-space-change"
-"\", \"ignore-space-at-eol\", \"ignore-all-space\", \"allow-indentation-change"
-"\""
+"okänt läge â€%s†för color-moved-ws, möjliga värden är â€ignore-space-changeâ€, "
+"â€ignore-space-at-eolâ€, â€ignore-all-spaceâ€, â€allow-indentation-changeâ€"
msgid ""
"color-moved-ws: allow-indentation-change cannot be combined with other "
@@ -14942,40 +15548,46 @@ msgstr ""
#, c-format
msgid "Unknown value for 'diff.submodule' config variable: '%s'"
-msgstr "Okänt värde för konfigurationsvariabeln \"diff.submodule\": \"%s\""
+msgstr "Okänt värde för konfigurationsvariabeln â€diff.submoduleâ€: â€%sâ€"
+
+#, c-format
+msgid "unknown value for config '%s': %s"
+msgstr "okänt värde för inställningen â€%sâ€: %s"
#, c-format
msgid ""
"Found errors in 'diff.dirstat' config variable:\n"
"%s"
msgstr ""
-"Hittade fel i konfigurationsvariabeln \"diff.dirstat\":\n"
+"Hittade fel i konfigurationsvariabeln â€diff.dirstatâ€:\n"
"%s"
#, c-format
msgid "external diff died, stopping at %s"
msgstr "extern diff dog, stannar vid %s"
+msgid "--follow requires exactly one pathspec"
+msgstr "--follow kräver exakt en sökvägsangivelse"
+
+#, c-format
+msgid "pathspec magic not supported by --follow: %s"
+msgstr "sökvägs-magi stöds inte av --follow: %s"
+
#, c-format
msgid "options '%s', '%s', '%s', and '%s' cannot be used together"
-msgstr ""
-"flaggorna \"%s\", \"%s\", \"%s\" och \"%s\" kan inte användas samtidigt"
+msgstr "flaggorna â€%sâ€, â€%sâ€, â€%s†och â€%s†kan inte användas samtidigt"
#, c-format
msgid "options '%s' and '%s' cannot be used together, use '%s' with '%s'"
msgstr ""
-"flaggorna \"%s\" och \"%s\" kan inte användas samtidigt, använd \"%s\" med "
-"\"%s\""
+"flaggorna â€%s†och â€%s†kan inte användas samtidigt, använd â€%s†med â€%sâ€"
#, c-format
msgid ""
"options '%s' and '%s' cannot be used together, use '%s' with '%s' and '%s'"
msgstr ""
-"flaggorna \"%s\" och \"%s\" kan inte användas samtidigt, använd \"%s\" med "
-"\"%s\" och \"%s\""
-
-msgid "--follow requires exactly one pathspec"
-msgstr "--follow kräver exakt en sökvägsangivelse"
+"flaggorna â€%s†och â€%s†kan inte användas samtidigt, använd â€%s†med â€%s†"
+"och â€%sâ€"
#, c-format
msgid "invalid --stat value: %s"
@@ -14995,7 +15607,7 @@ msgstr ""
#, c-format
msgid "unknown change class '%c' in --diff-filter=%s"
-msgstr "okänd ändringsklass \"%c\" i --diff-filter=%s"
+msgstr "okänd ändringsklass â€%c†i --diff-filter=%s"
#, c-format
msgid "unknown value after ws-error-highlight=%.*s"
@@ -15003,7 +15615,7 @@ msgstr "okänt värde efter ws-error-highlight=%.*s"
#, c-format
msgid "unable to resolve '%s'"
-msgstr "kunde inte slå upp \"%s\""
+msgstr "kunde inte slÃ¥ upp â€%sâ€"
#, c-format
msgid "%s expects <n>/<m> form"
@@ -15011,7 +15623,7 @@ msgstr "%s förväntar formen <n>/<m>"
#, c-format
msgid "%s expects a character, got '%s'"
-msgstr "%s förväntar ett tecken, fick \"%s\""
+msgstr "%s förväntar ett tecken, fick â€%sâ€"
#, c-format
msgid "bad --color-moved argument: %s"
@@ -15019,14 +15631,7 @@ msgstr "felaktigt argument till --color-moved: %s"
#, c-format
msgid "invalid mode '%s' in --color-moved-ws"
-msgstr "ogiltigt läge %s\" i --color-moved-ws"
-
-msgid ""
-"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
-"\"histogram\""
-msgstr ""
-"flaggan diff-algorithm godtar\"myers\", \"minimal\", \"patience\" och "
-"\"histogram\""
+msgstr "ogiltigt läge %s†i --color-moved-ws"
#, c-format
msgid "invalid argument to %s"
@@ -15034,11 +15639,11 @@ msgstr "ogiltigt argument för %s"
#, c-format
msgid "invalid regex given to -I: '%s'"
-msgstr "ogiltigt reguljärt uttryck angavs för -I: \"%s\""
+msgstr "ogiltigt reguljärt uttryck angavs för -I: â€%sâ€"
#, c-format
msgid "failed to parse --submodule option parameter: '%s'"
-msgstr "misslyckades tolka argument till flaggan --submodule: \"%s\""
+msgstr "misslyckades tolka argument till flaggan --submodule: â€%sâ€"
#, c-format
msgid "bad --word-diff argument: %s"
@@ -15060,10 +15665,10 @@ msgid "generate the diff in raw format"
msgstr "generera diff i råformat"
msgid "synonym for '-p --raw'"
-msgstr "synonym till \"-p --raw\""
+msgstr "synonym till â€-p --rawâ€"
msgid "synonym for '-p --stat'"
-msgstr "synonym till \"-p --stat\""
+msgstr "synonym till â€-p --statâ€"
msgid "machine friendly --stat"
msgstr "maskinläsbar --stat"
@@ -15071,8 +15676,8 @@ msgstr "maskinläsbar --stat"
msgid "output only the last line of --stat"
msgstr "skriv bara ut den sista raden för --stat"
-msgid "<param1,param2>..."
-msgstr "<param1,param2>..."
+msgid "<param1>,<param2>..."
+msgstr "<param1>,<param2>..."
msgid ""
"output the distribution of relative amount of changes for each sub-directory"
@@ -15082,8 +15687,8 @@ msgstr ""
msgid "synonym for --dirstat=cumulative"
msgstr "synonym för --dirstat=cumulative"
-msgid "synonym for --dirstat=files,param1,param2..."
-msgstr "synonym för --dirstat=filer,param1,param2..."
+msgid "synonym for --dirstat=files,<param1>,<param2>..."
+msgstr "synonym för --dirstat=filer,<param1>,<param2>..."
msgid "warn if changes introduce conflict markers or whitespace errors"
msgstr "varna om ändringar introducerar konfliktmarkörer eller blankstegsfel"
@@ -15129,7 +15734,7 @@ msgstr "skapa en binärdiff som kan appliceras"
msgid "show full pre- and post-image object names on the \"index\" lines"
msgstr ""
-"visa fullständiga objektnamn i \"index\"-rader för läget både före och efter"
+"visa fullständiga objektnamn i â€indexâ€-rader för läget bÃ¥de före och efter"
msgid "show colored diff"
msgstr "visa färgad diff"
@@ -15141,8 +15746,8 @@ msgid ""
"highlight whitespace errors in the 'context', 'old' or 'new' lines in the "
"diff"
msgstr ""
-"ljusmarkera blankstegsfel i \"context\" (sammanhang), \"old\" (gamla) eller "
-"\"new\" (nya) rader i diffen"
+"ljusmarkera blankstegsfel i â€context†(sammanhang), â€old†(gamla) eller "
+"â€new†(nya) rader i diffen"
msgid ""
"do not munge pathnames and use NULs as output field terminators in --raw or "
@@ -15155,10 +15760,10 @@ msgid "<prefix>"
msgstr "<prefix>"
msgid "show the given source prefix instead of \"a/\""
-msgstr "visa givet källprefix istället för \"a/\""
+msgstr "visa givet källprefix istället för â€a/â€"
msgid "show the given destination prefix instead of \"b/\""
-msgstr "visa givet målprefix istället för \"b/\""
+msgstr "visa givet mÃ¥lprefix istället för â€b/â€"
msgid "prepend an additional prefix to every line of output"
msgstr "lägg till ytterligare prefix på alla rader i utdata"
@@ -15166,6 +15771,9 @@ msgstr "lägg till ytterligare prefix på alla rader i utdata"
msgid "do not show any source or destination prefix"
msgstr "visa inte käll- eller målprefix"
+msgid "use default prefixes a/ and b/"
+msgstr "använd standardprefixen a/ och b/"
+
msgid "show context between diff hunks up to the specified number of lines"
msgstr "visa sammnhang mellan diff-stycken upp till angivet antal rader"
@@ -15173,13 +15781,13 @@ msgid "<char>"
msgstr "<tecken>"
msgid "specify the character to indicate a new line instead of '+'"
-msgstr "ange tecken för att ange ny rad istället för \"+\""
+msgstr "ange tecken för att ange ny rad istället för â€+â€"
msgid "specify the character to indicate an old line instead of '-'"
-msgstr "ange tecken för att ange gammal rad istället för \"-\""
+msgstr "ange tecken för att ange gammal rad istället för â€-â€"
msgid "specify the character to indicate a context instead of ' '"
-msgstr "ange tecken för att ange sammanhang istället för \" \""
+msgstr "ange tecken för att ange sammanhang istället för †â€"
msgid "Diff rename options"
msgstr "Diff-namnbytesflaggor"
@@ -15249,22 +15857,16 @@ msgid "heuristic to shift diff hunk boundaries for easy reading"
msgstr "heuristik för att flytta diff-gränser för lättare läsning"
msgid "generate diff using the \"patience diff\" algorithm"
-msgstr "skapa diffar med algoritmen \"patience diff\""
+msgstr "skapa diffar med algoritmen â€patience diffâ€"
msgid "generate diff using the \"histogram diff\" algorithm"
-msgstr "skapa diffar med algoritmen \"histogram diff\""
-
-msgid "<algorithm>"
-msgstr "<algoritm>"
-
-msgid "choose a diff algorithm"
-msgstr "välj en diff-algoritm"
+msgstr "skapa diffar med algoritmen â€histogram diffâ€"
msgid "<text>"
msgstr "<text>"
msgid "generate diff using the \"anchored diff\" algorithm"
-msgstr "skapa diffar med algoritmen \"anchored diff\""
+msgstr "skapa diffar med algoritmen â€anchored diffâ€"
msgid "<mode>"
msgstr "<läge>"
@@ -15323,10 +15925,10 @@ msgid "specify how differences in submodules are shown"
msgstr "ange hur ändringar i undermoduler visas"
msgid "hide 'git add -N' entries from the index"
-msgstr "dölj \"git add -N\"-poster från indexet"
+msgstr "dölj â€git add -Nâ€-poster frÃ¥n indexet"
msgid "treat 'git add -N' entries as real in the index"
-msgstr "tolka \"git add -N\"-poster som äkta i indexet"
+msgstr "tolka â€git add -Nâ€-poster som äkta i indexet"
msgid "<string>"
msgstr "<sträng>"
@@ -15396,18 +15998,18 @@ msgstr ""
#, c-format
msgid "failed to read orderfile '%s'"
-msgstr "kunde inte läsa orderfilen \"%s\""
+msgstr "kunde inte läsa orderfilen â€%sâ€"
msgid "Performing inexact rename detection"
msgstr "Utför onöjaktig namnbytesdetektering"
#, c-format
msgid "No such path '%s' in the diff"
-msgstr "Sökvägen \"%s\" finns inte i diffen"
+msgstr "Sökvägen â€%s†finns inte i diffen"
#, c-format
msgid "pathspec '%s' did not match any file(s) known to git"
-msgstr "sökvägsangivelsen \"%s\" motsvarade inte några av git kända filer"
+msgstr "sökvägsangivelsen â€%s†motsvarade inte nÃ¥gra av git kända filer"
#, c-format
msgid "unrecognized pattern: '%s'"
@@ -15420,7 +16022,7 @@ msgstr "okänt negativt mönster: %s"
#, c-format
msgid "your sparse-checkout file may have issues: pattern '%s' is repeated"
msgstr ""
-"din \"sparse-checkout\"-fil kan ha problem: mönstret \"%s\" förekommer flera "
+"din â€sparse-checkoutâ€-fil kan ha problem: mönstret â€%s†förekommer flera "
"gånger"
msgid "disabling cone pattern matching"
@@ -15453,22 +16055,30 @@ msgstr "kunde inte skapa kataloger för %s"
#, c-format
msgid "could not migrate git directory from '%s' to '%s'"
-msgstr "kunde inte migrera git-katalog från \"%s\" till \"%s\""
+msgstr "kunde inte migrera git-katalog frÃ¥n â€%s†till â€%sâ€"
#, c-format
msgid "hint: Waiting for your editor to close the file...%c"
msgstr "tips: Väntar på att textredigeringsprogrammet ska stänga filen...%c"
+#, c-format
+msgid "could not write to '%s'"
+msgstr "kunde inte skriva till â€%sâ€"
+
+#, c-format
+msgid "could not edit '%s'"
+msgstr "kunde inte redigera â€%sâ€"
+
msgid "Filtering content"
msgstr "Filtrerar innehåll"
#, c-format
msgid "could not stat file '%s'"
-msgstr "kunde inte ta status på filen \"%s\""
+msgstr "kunde inte ta status pÃ¥ filen â€%sâ€"
#, c-format
msgid "bad git namespace path \"%s\""
-msgstr "felaktig git-namnrymdssökväg \"%s\""
+msgstr "felaktig git-namnrymdssökväg â€%sâ€"
#, c-format
msgid "too many args to run %s"
@@ -15485,18 +16095,21 @@ msgstr "git fetch-pack: förväntade ACK/NAK, fick flush-paket"
#, c-format
msgid "git fetch-pack: expected ACK/NAK, got '%s'"
-msgstr "git fetch-pack: förväntade ACK/NAK, fick \"%s\""
+msgstr "git fetch-pack: förväntade ACK/NAK, fick â€%sâ€"
msgid "unable to write to remote"
msgstr "kunde inte skriva till fjärren"
+msgid "Server supports filter"
+msgstr "Servern stöder filter"
+
#, c-format
msgid "invalid shallow line: %s"
-msgstr "ogiltig \"shallow\"-rad: %s"
+msgstr "ogiltig â€shallowâ€-rad: %s"
#, c-format
msgid "invalid unshallow line: %s"
-msgstr "ogiltig \"unshallow\"-rad: %s"
+msgstr "ogiltig â€unshallowâ€-rad: %s"
#, c-format
msgid "object not found: %s"
@@ -15508,7 +16121,7 @@ msgstr "fel i objekt: %s"
#, c-format
msgid "no shallow found: %s"
-msgstr "ingen \"shallow\" hittades: %s"
+msgstr "ingen â€shallow†hittades: %s"
#, c-format
msgid "expected shallow/unshallow, got %s"
@@ -15595,28 +16208,25 @@ msgstr "omaka algoritmer: klient %s; server %s"
#, c-format
msgid "the server does not support algorithm '%s'"
-msgstr "servern stöder inte algoritmen \"%s\""
+msgstr "servern stöder inte algoritmen â€%sâ€"
msgid "Server does not support shallow requests"
msgstr "Servern stöder inte grunda förfrågningar"
-msgid "Server supports filter"
-msgstr "Servern stöder filter"
-
msgid "unable to write request to remote"
msgstr "kunde inte skriva anrop till fjärren"
#, c-format
msgid "expected '%s', received '%s'"
-msgstr "förväntade \"%s\", tog emot \"%s\""
+msgstr "förväntade â€%sâ€, tog emot â€%sâ€"
#, c-format
msgid "expected '%s'"
-msgstr "förväntade \"%s\""
+msgstr "förväntade â€%sâ€"
#, c-format
msgid "unexpected acknowledgment line: '%s'"
-msgstr "oväntad bekräftelserad: \"%s\""
+msgstr "oväntad bekräftelserad: â€%sâ€"
#, c-format
msgid "error processing acks: %d"
@@ -15627,19 +16237,18 @@ msgstr "fel vid hantering av bekräftelser: %d"
#.
#, c-format
msgid "expected packfile to be sent after '%s'"
-msgstr "väntade att paketfil skulle sändas efter \"%s\""
+msgstr "väntade att paketfil skulle sändas efter â€%sâ€"
#. TRANSLATORS: The parameter will be 'ready', a protocol
#. keyword.
#.
#, c-format
msgid "expected no other sections to be sent after no '%s'"
-msgstr ""
-"väntade inte att några ytterligare sektioner skulle sändas efter \"%s\""
+msgstr "väntade inte att nÃ¥gra ytterligare sektioner skulle sändas efter â€%sâ€"
#, c-format
msgid "error processing shallow info: %d"
-msgstr "fel vid hantering av grund (\"shallow\") info: %d"
+msgstr "fel vid hantering av grund (â€shallowâ€) info: %d"
#, c-format
msgid "expected wanted-ref, got '%s'"
@@ -15647,7 +16256,7 @@ msgstr "förväntade wanted-ref, fick %s"
#, c-format
msgid "unexpected wanted-ref: '%s'"
-msgstr "oväntad wanted-ref: \"%s\""
+msgstr "oväntad wanted-ref: â€%sâ€"
#, c-format
msgid "error processing wanted refs: %d"
@@ -15660,7 +16269,7 @@ msgid "no matching remote head"
msgstr "inget motsvarande fjärrhuvud"
msgid "unexpected 'ready' from remote"
-msgstr "oväntat \"ready\" från fjärr"
+msgstr "oväntat â€ready†frÃ¥n fjärr"
#, c-format
msgid "no such remote ref %s"
@@ -15672,41 +16281,42 @@ 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: ogilitg sökväg â€%sâ€"
#, c-format
msgid "fsmonitor_ipc__send_query: unspecified error on '%s'"
-msgstr "fsmonitor_ipc__send_query: ospecificerat fel på \"%s\""
+msgstr "fsmonitor_ipc__send_query: ospecificerat fel pÃ¥ â€%sâ€"
msgid "fsmonitor--daemon is not running"
msgstr "fsmonitor--daemon kör inte"
#, c-format
msgid "could not send '%s' command to fsmonitor--daemon"
-msgstr "kunde inte sända kommandot \"%s\" till fsmonitor--daemon"
+msgstr "kunde inte sända kommandot â€%s†till fsmonitor--daemon"
#, c-format
msgid "bare repository '%s' is incompatible with fsmonitor"
-msgstr "naket arkiv \"%s\" är inkompatibelt med fsmonitor"
+msgstr "naket arkiv â€%s†är inkompatibelt med fsmonitor"
#, c-format
msgid "repository '%s' is incompatible with fsmonitor due to errors"
-msgstr "arkivet \"%s\" är inkompatibelt med fsmonitor på grund av fel"
+msgstr "arkivet â€%s†är inkompatibelt med fsmonitor pÃ¥ grund av fel"
#, c-format
msgid "remote repository '%s' is incompatible with fsmonitor"
-msgstr "fjärrarkivet \"%s\" är inkompatibelt med fsmonitor"
+msgstr "fjärrarkivet â€%s†är inkompatibelt med fsmonitor"
#, c-format
msgid "virtual repository '%s' is incompatible with fsmonitor"
-msgstr "det virtuella arkivet \"%s\" är inkompatibelt med fsmonitor"
+msgstr "det virtuella arkivet â€%s†är inkompatibelt med fsmonitor"
#, c-format
msgid ""
-"repository '%s' is incompatible with fsmonitor due to lack of Unix sockets"
+"socket directory '%s' is incompatible with fsmonitor due to lack of Unix "
+"sockets support"
msgstr ""
-"arkivet \"%s\" är inkompatibelt med fsmonitor på grund av avsaknad av Unix-"
-"uttag"
+"uttagskatalogen â€%s†är inkompatibelt med fsmonitor pÃ¥ grund av avsaknad av "
+"Unix-uttag"
msgid ""
"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
@@ -15714,8 +16324,7 @@ msgid ""
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
-" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
-" <command> [<args>]"
+" [--config-env=<name>=<envvar>] <command> [<args>]"
msgstr ""
"git [-v | --version] [-h |--help] [-C <sökväg>] [-c <namn>=<värde>]\n"
" [--exec-path[=<sökväg>]] [--html-path] [--man-path] [--info-"
@@ -15723,8 +16332,7 @@ msgstr ""
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<sökväg>] [--work-tree=<sökväg>] [--namespace=<namn>]\n"
-" [--super-prefix=<sökväg>] [--config-env=<namn>=<miljövar>]\n"
-" <kommando> [<flaggor>]"
+" [--config-env=<namn>=<miljövar>] <kommando> [<flaggor>]"
msgid ""
"'git help -a' and 'git help -g' list available subcommands and some\n"
@@ -15732,28 +16340,24 @@ msgid ""
"to read about a specific subcommand or concept.\n"
"See 'git help git' for an overview of the system."
msgstr ""
-"\"git help -a\" och \"git help -g\" visar tillgängliga underkommandon och\n"
-"några konceptvägledningar. Se \"git help <kommando>\" eller \"git help\n"
-"<koncept>\" för att läsa mer om specifika underkommandon och koncept.\n"
-"See \"git help git\" för en översikt över systemet."
+"â€git help -a†och â€git help -g†visar tillgängliga underkommandon och\n"
+"nÃ¥gra konceptvägledningar. Se â€git help <kommando>†eller â€git help\n"
+"<koncept>†för att läsa mer om specifika underkommandon och koncept.\n"
+"See â€git help git†för en översikt över systemet."
#, c-format
msgid "unsupported command listing type '%s'"
-msgstr "okänd kommandolisttyp \"%s\""
+msgstr "okänd kommandolisttyp â€%sâ€"
#, c-format
msgid "no directory given for '%s' option\n"
-msgstr "ingen katalog angavs för flaggan \"%s\"\n"
+msgstr "ingen katalog angavs för flaggan â€%sâ€\n"
#, c-format
msgid "no namespace given for --namespace\n"
msgstr "ingen namnrymd angavs för --namespace\n"
#, c-format
-msgid "no prefix given for --super-prefix\n"
-msgstr "inget prefix angavs för --super-prefix\n"
-
-#, c-format
msgid "-c expects a configuration string\n"
msgstr "-c förväntar en konfigurationssträng\n"
@@ -15762,20 +16366,24 @@ msgid "no config key given for --config-env\n"
msgstr "ingen konfigurationsnyckel angavs för --config-env\n"
#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "ingen attributkälla angavs för --attr-source\n"
+
+#, c-format
msgid "unknown option: %s\n"
msgstr "okänd flagga: %s\n"
#, c-format
msgid "while expanding alias '%s': '%s'"
-msgstr "vid expandering av aliaset \"%s\": \"%s\""
+msgstr "vid expandering av aliaset â€%sâ€: â€%sâ€"
#, c-format
msgid ""
"alias '%s' changes environment variables.\n"
"You can use '!git' in the alias to do this"
msgstr ""
-"aliaset \"%s\" ändrar miljövariabler.\n"
-"Du kan använda \"!git\" i aliaset för att göra det"
+"aliaset â€%s†ändrar miljövariabler.\n"
+"Du kan använda â€!git†i aliaset för att göra det"
#, c-format
msgid "empty alias for %s"
@@ -15796,7 +16404,7 @@ msgstr "stäng misslyckades på standard ut"
#, c-format
msgid "alias loop detected: expansion of '%s' does not terminate:%s"
-msgstr "alias-slinga detekterades: expansionen av \"%s\" avslutas aldrig:%s"
+msgstr "alias-slinga detekterades: expansionen av â€%s†avslutas aldrig:%s"
#, c-format
msgid "cannot handle %s as a builtin"
@@ -15813,18 +16421,18 @@ msgstr ""
#, c-format
msgid "expansion of alias '%s' failed; '%s' is not a git command\n"
msgstr ""
-"expandering av alias \"%s\" misslyckades; \"%s\" är inte ett git-kommando\n"
+"expandering av alias â€%s†misslyckades; â€%s†är inte ett git-kommando\n"
#, c-format
msgid "failed to run command '%s': %s\n"
-msgstr "misslyckades köra kommandot \"%s\": %s\n"
+msgstr "misslyckades köra kommandot â€%sâ€: %s\n"
msgid "could not create temporary file"
msgstr "kunde inte skapa temporära fil"
#, c-format
msgid "failed writing detached signature to '%s'"
-msgstr "misslyckades skriva fristående signatur till \"%s\""
+msgstr "misslyckades skriva fristÃ¥ende signatur till â€%sâ€"
msgid ""
"gpg.ssh.allowedSignersFile needs to be configured and exist for ssh "
@@ -15837,7 +16445,7 @@ msgid ""
"ssh-keygen -Y find-principals/verify is needed for ssh signature "
"verification (available in openssh version 8.2p1+)"
msgstr ""
-"\"ssh-keygen -Y find-principals/verify\" behövs för att bekräfta ssh-"
+"â€ssh-keygen -Y find-principals/verify†behövs för att bekräfta ssh-"
"signaturer (tillgängligt i openssh version 8.2p1+)"
#, c-format
@@ -15846,11 +16454,11 @@ msgstr "återkallningsfilen för ssh-signering inställd men saknas: %s"
#, c-format
msgid "bad/incompatible signature '%s'"
-msgstr "felaktig/inkompatibel signatur \"%s\""
+msgstr "felaktig/inkompatibel signatur â€%sâ€"
#, c-format
msgid "failed to get the ssh fingerprint for key '%s'"
-msgstr "misslyckades hämta ssh-fingeravtrycket för nyckeln \"%s\""
+msgstr "misslyckades hämta ssh-fingeravtrycket för nyckeln â€%sâ€"
msgid ""
"either user.signingkey or gpg.ssh.defaultKeyCommand needs to be configured"
@@ -15865,34 +16473,39 @@ msgstr "gpg.ssh.defaultKeyCommand lyckades men gav inga nycklar: %s %s"
msgid "gpg.ssh.defaultKeyCommand failed: %s %s"
msgstr "gpg.ssh.defaultKeyCommand misslyckades: %s %s"
-msgid "gpg failed to sign the data"
-msgstr "gpg misslyckades signera data"
+#, c-format
+msgid ""
+"gpg failed to sign the data:\n"
+"%s"
+msgstr ""
+"gpg misslyckades signera data:\n"
+"%s"
msgid "user.signingKey needs to be set for ssh signing"
msgstr "user.signingKey måste anges för ssh-signering"
#, c-format
msgid "failed writing ssh signing key to '%s'"
-msgstr "misslyckades skriva ssh-signeringsnyckel till \"%s\""
+msgstr "misslyckades skriva ssh-signeringsnyckel till â€%sâ€"
#, c-format
msgid "failed writing ssh signing key buffer to '%s'"
-msgstr "misslyckades skriva ssh-signeringsnyckelbuffert till \"%s\""
+msgstr "misslyckades skriva ssh-signeringsnyckelbuffert till â€%sâ€"
msgid ""
"ssh-keygen -Y sign is needed for ssh signing (available in openssh version "
"8.2p1+)"
msgstr ""
-"\"ssh-keygen -Y sign\" behövs för ssh-signering (tillgängligt i openssh "
+"â€ssh-keygen -Y sign†behövs för ssh-signering (tillgängligt i openssh "
"version 8.2p1+)"
#, c-format
msgid "failed reading ssh signing data buffer from '%s'"
-msgstr "misslyckades läsa ssh-signeringsdatabuffert från \"%s\""
+msgstr "misslyckades läsa ssh-signeringsdatabuffert frÃ¥n â€%sâ€"
#, c-format
msgid "ignored invalid color '%.*s' in log.graphColors"
-msgstr "ignorerade felaktig färg \"%.*s\" i log.graphColors"
+msgstr "ignorerade felaktig färg â€%.*s†i log.graphColors"
msgid ""
"given pattern contains NULL byte (via -f <file>). This is only supported "
@@ -15903,11 +16516,11 @@ msgstr ""
#, c-format
msgid "'%s': unable to read %s"
-msgstr "\"%s\" kunde inte läsa %s"
+msgstr "â€%s†kunde inte läsa %s"
#, c-format
msgid "'%s': short read"
-msgstr "\"%s\": kort läsning"
+msgstr "â€%sâ€: kort läsning"
msgid "start a working area (see also: git help tutorial)"
msgstr "starta arbetskatalog (se också: git help tutorial)"
@@ -15948,9 +16561,15 @@ msgstr "Lågnivåkommandon / synka arkiv"
msgid "Low-level Commands / Internal Helpers"
msgstr "Lågnivåkommandon / interna hjälpare"
+msgid "User-facing repository, command and file interfaces"
+msgstr "Arkiv-, kommando- och filgränssnitt tänkta för användare"
+
+msgid "Developer-facing file formats, protocols and other interfaces"
+msgstr "Filformat, protokoll och andra gränssnitt tänkta för utvecklare"
+
#, c-format
msgid "available git commands in '%s'"
-msgstr "git-kommandon tillgängliga i \"%s\""
+msgstr "git-kommandon tillgängliga i â€%sâ€"
msgid "git commands available from elsewhere on your $PATH"
msgstr "git-kommandon från andra platser i din $PATH"
@@ -15961,6 +16580,12 @@ msgstr "Dessa vanliga Git-kommandon används i olika situationer:"
msgid "The Git concept guides are:"
msgstr "Vägledningar för Git-koncept:"
+msgid "User-facing repository, command and file interfaces:"
+msgstr "Arkiv-, kommando- och filgränssnitt tänkta för användare:"
+
+msgid "File formats, protocols and other developer interfaces:"
+msgstr "Filformat, protokoll och andra utvecklargränssnitt:"
+
msgid "External commands"
msgstr "Externa kommandon"
@@ -15968,39 +16593,39 @@ msgid "Command aliases"
msgstr "Kommadoalias"
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"
+msgstr "Se â€git help <kommando>†för att läsa om ett specifikt underkommando"
#, c-format
msgid ""
"'%s' appears to be a git command, but we were not\n"
"able to execute it. Maybe git-%s is broken?"
msgstr ""
-"\"%s\" verkar vara ett git-kommando, men vi kan inte\n"
+"â€%s†verkar vara ett git-kommando, men vi kan inte\n"
"köra det. Kanske git-%s är trasigt?"
#, c-format
msgid "git: '%s' is not a git command. See 'git --help'."
-msgstr "git: \"%s\" är inte ett git-kommando. Se \"git --help\"."
+msgstr "git: â€%s†är inte ett git-kommando. Se â€git --helpâ€."
msgid "Uh oh. Your system reports no Git commands at all."
msgstr "Oj då. Ditt system rapporterar inga Git-kommandon alls."
#, c-format
msgid "WARNING: You called a Git command named '%s', which does not exist."
-msgstr "VARNING: Du anropade ett Git-kommando vid namn \"%s\", som inte finns."
+msgstr "VARNING: Du anropade ett Git-kommando vid namn â€%sâ€, som inte finns."
#, c-format
msgid "Continuing under the assumption that you meant '%s'."
-msgstr "Fortsätter under förutsättningen att du menade \"%s\"."
+msgstr "Fortsätter under förutsättningen att du menade â€%sâ€."
#, c-format
msgid "Run '%s' instead [y/N]? "
-msgstr "Köra \"%s\" istället (j/N)?"
+msgstr "Köra â€%s†istället (j/N)?"
#, c-format
msgid "Continuing in %0.1f seconds, assuming that you meant '%s'."
msgstr ""
-"Fortsätter om %0.1f sekunder, under förutsättningen att du menade \"%s\"."
+"Fortsätter om %0.1f sekunder, under förutsättningen att du menade â€%sâ€."
msgid ""
"\n"
@@ -16015,8 +16640,8 @@ msgstr[1] ""
"\n"
"Mest lika kommandon är"
-msgid "git version [<options>]"
-msgstr "git version [<flaggor>]"
+msgid "git version [--build-options]"
+msgstr "git version [--build-options]"
#, c-format
msgid "%s: %s - %s"
@@ -16040,12 +16665,8 @@ msgid ""
"The '%s' hook was ignored because it's not set as executable.\n"
"You can disable this warning with `git config advice.ignoredHook false`."
msgstr ""
-"Kroken \"%s\" ignorerades eftersom den inte är markerad som körbar.\n"
-"Du kan inaktivera varningen med \"git config advice.ignoredHook false\"."
-
-#, c-format
-msgid "Couldn't start hook '%s'\n"
-msgstr "Kunde inte starta kroken \"%s\"\n"
+"Kroken â€%s†ignorerades eftersom den inte är markerad som körbar.\n"
+"Du kan inaktivera varningen med â€git config advice.ignoredHook falseâ€."
#, c-format
msgid "argument to --packfile must be a valid hash (got '%s')"
@@ -16070,15 +16691,15 @@ 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:"
+msgstr "SSL-bakändan â€%s†stöds inte. Dessa SSL-bakändor stöds:"
#, c-format
msgid "Could not set SSL backend to '%s': cURL was built without SSL backends"
-msgstr "Kan inte sätta SSL-bakända till \"%s\": cURL byggdes utan SSL-bakändor"
+msgstr "Kan inte sätta SSL-bakända till â€%sâ€: cURL byggdes utan SSL-bakändor"
#, c-format
msgid "Could not set SSL backend to '%s': already set"
-msgstr "Kunde inte sätta SSL-bakända till \"%s\": redan valt"
+msgstr "Kunde inte sätta SSL-bakända till â€%sâ€: redan valt"
#, c-format
msgid ""
@@ -16126,14 +16747,14 @@ msgstr "ingen e-post angavs och autodetektering är inaktiverad"
#, c-format
msgid "unable to auto-detect email address (got '%s')"
-msgstr "kunde inte autodetektera e-postadress (fick \"%s\")"
+msgstr "kunde inte autodetektera e-postadress (fick â€%sâ€)"
msgid "no name was given and auto-detection is disabled"
msgstr "inget namn angavs och autodetektering är inaktiverad"
#, c-format
msgid "unable to auto-detect name (got '%s')"
-msgstr "kunde inte autodetektera namn (fick \"%s\")"
+msgstr "kunde inte autodetektera namn (fick â€%sâ€)"
#, c-format
msgid "empty ident name (for <%s>) not allowed"
@@ -16144,22 +16765,22 @@ msgid "name consists only of disallowed characters: %s"
msgstr "namnet består enbart av ej tillåtna tecken: %s"
msgid "expected 'tree:<depth>'"
-msgstr "förväntade \"tree:<djup>\""
+msgstr "förväntade â€tree:<djup>â€"
msgid "sparse:path filters support has been dropped"
msgstr "sparse:sökväg-filter stöds inte längre"
#, c-format
msgid "'%s' for 'object:type=<type>' is not a valid object type"
-msgstr "\"%s\" för \"object:type=<typ>\" är inte en giltig objekttyp"
+msgstr "â€%s†för â€object:type=<typ>†är inte en giltig objekttyp"
#, c-format
msgid "invalid filter-spec '%s'"
-msgstr "felaktig filterspecifikation: \"%s\""
+msgstr "felaktig filterspecifikation: â€%sâ€"
#, c-format
msgid "must escape char in sub-filter-spec: '%c'"
-msgstr "måste använda specialsekvens i delfilter-spec: \"%c\""
+msgstr "mÃ¥ste använda specialsekvens i delfilter-spec: â€%câ€"
msgid "expected something after combine:"
msgstr "förväntade någonting efter combine:"
@@ -16178,7 +16799,7 @@ msgstr "objektfiltrering"
#, c-format
msgid "unable to access sparse blob in '%s'"
-msgstr "kunde inte nå gles blob på \"%s\""
+msgstr "kunde inte nÃ¥ gles blob pÃ¥ â€%sâ€"
#, c-format
msgid "unable to parse sparse filter data in %s"
@@ -16186,11 +16807,11 @@ msgstr "kunde inte tolka gles filterdata i %s"
#, c-format
msgid "entry '%s' in tree %s has tree mode, but is not a tree"
-msgstr "posten \"%s\" i trädet %s har träd-läge, men är inte ett träd"
+msgstr "posten â€%s†i trädet %s har träd-läge, men är inte ett träd"
#, c-format
msgid "entry '%s' in tree %s has blob mode, but is not a blob"
-msgstr "posten \"%s\" i trädet %s har blob-läge, men är inte en blob"
+msgstr "posten â€%s†i trädet %s har blob-läge, men är inte en blob"
#, c-format
msgid "unable to load root tree for commit %s"
@@ -16206,10 +16827,10 @@ msgid ""
"may have crashed in this repository earlier:\n"
"remove the file manually to continue."
msgstr ""
-"Kunde inte skapa \"%s.lock\": %s.\n"
+"Kunde inte skapa â€%s.lockâ€: %s.\n"
"\n"
"Det verkar som en annan git-process kör i det här arkivet, t.ex.\n"
-"ett textredigeringsprogram startat av \"git commit\". Se till att\n"
+"ett textredigeringsprogram startat av â€git commitâ€. Se till att\n"
"alla processer avslutats och försök sedan igen. Om det fortfarande\n"
"misslyckas kanske en git-process har kraschat i det här arkivet\n"
"tidigare:\n"
@@ -16217,32 +16838,27 @@ msgstr ""
#, c-format
msgid "Unable to create '%s.lock': %s"
-msgstr "Kunde inte skapa \"%s.lock\": %s"
+msgstr "Kunde inte skapa â€%s.lockâ€: %s"
#, c-format
msgid "unexpected line: '%s'"
-msgstr "oväntad rad: \"%s\""
+msgstr "oväntad rad: â€%sâ€"
msgid "expected flush after ls-refs arguments"
-msgstr "förväntade \"flush\" efter ls-refs-argument"
+msgstr "förväntade â€flush†efter ls-refs-argument"
msgid "quoted CRLF detected"
msgstr "citerad CRLF upptäcktes"
#, c-format
-msgid ""
-"Your local changes to the following files would be overwritten by merge:\n"
-" %s"
-msgstr ""
-"Dina lokala ändringar av följande filer skulle skrivas över av "
-"sammanslagning:\n"
-" %s"
-
-#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "Misslyckades slå ihop undermodulen %s (ej utcheckad)"
#, c-format
+msgid "Failed to merge submodule %s (no merge base)"
+msgstr "Misslyckades slå ihop undermodulen %s (ingen sammanslagningsbas)"
+
+#, c-format
msgid "Failed to merge submodule %s (commits not present)"
msgstr "Misslyckades slå ihop undermodulen %s (incheckningar saknas)"
@@ -16262,27 +16878,8 @@ msgstr "Misslyckades slå ihop undermodulen %s"
#, c-format
msgid ""
-"Failed to merge submodule %s, but a possible merge resolution exists:\n"
-"%s\n"
-msgstr ""
-"Misslyckades slå ihop undermodulen %s, men en möjlig lösning finns:\n"
-"%s\n"
-
-#, c-format
-msgid ""
-"If this is correct simply add it to the index for example\n"
-"by using:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"which will accept this suggestion.\n"
-msgstr ""
-"Om detta är riktigt lägger du bara till det i indexet, till\n"
-"exempel så här:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"vilket godtar lösningen.\n"
+"Failed to merge submodule %s, but a possible merge resolution exists: %s"
+msgstr "Misslyckades slå ihop undermodulen %s, men en möjlig lösning finns: %s"
#, c-format
msgid ""
@@ -16293,12 +16890,12 @@ msgstr ""
"finns:\n"
"%s"
-msgid "Failed to execute internal merge"
-msgstr "Misslyckades exekvera intern sammanslagning"
+msgid "failed to execute internal merge"
+msgstr "misslyckades exekvera intern sammanslagning"
#, c-format
-msgid "Unable to add %s to database"
-msgstr "Kunde inte lägga till %s till databasen"
+msgid "unable to add %s to database"
+msgstr "kunde inte lägga till %s till databasen"
#, c-format
msgid "Auto-merging %s"
@@ -16335,7 +16932,7 @@ msgid ""
"WARNING: Avoiding applying %s -> %s rename to %s, because %s itself was "
"renamed."
msgstr ""
-"VARNING: Undviker att applicera namnändring %s -> %s på %s, då %s själv har "
+"VARNING: Undviker att applicera namnändring %s → %s på %s, då %s själv har "
"bytt namn."
#, c-format
@@ -16360,7 +16957,7 @@ msgid ""
"in %s, suggesting it should perhaps be moved to %s."
msgstr ""
"KONFLIKT (filplacering): %s lade till %s inuti en katalog som bytte namn i "
-"%s, föreslår att den bör flyttas till%s."
+"%s, föreslår att den bör flyttas till %s."
#, c-format
msgid ""
@@ -16381,7 +16978,7 @@ msgid ""
"conflicts AND collides with another path; this may result in nested conflict "
"markers."
msgstr ""
-"KONFLIKT (namnbyte involverad i krock): namnbyte av %s -> %s har "
+"KONFLIKT (namnbyte involverad i krock): namnbyte av %s → %s har "
"innehållskonflikter OCH krockar med en annan sökväg; detta kan leda till "
"nästlade konfliktmarkörer."
@@ -16443,13 +17040,45 @@ msgstr ""
"KONFLIKT (ändra/radera): %s raderad i %s och ändrad i %s. Versionen %s av %s "
"lämnad i trädet."
+#. TRANSLATORS: This is a line of advice to resolve a merge
+#. conflict in a submodule. The first argument is the submodule
+#. name, and the second argument is the abbreviated id of the
+#. commit that needs to be merged. For example:
+#. - go to submodule (mysubmodule), and either merge commit abc1234"
+#.
#, c-format
msgid ""
-"Note: %s not up to date and in way of checking out conflicted version; old "
-"copy renamed to %s"
+" - go to submodule (%s), and either merge commit %s\n"
+" or update to an existing commit which has merged those changes\n"
msgstr ""
-"Observera: %s är inte à jour och i vägen för att checka ut version i "
-"konflikt; gammal upplaga har nytt namn %s"
+" - gå till undermodulen (%s), och slå antingen ihop incheckningen %s\n"
+" eller uppdatera till en befintlig incheckning som slagit ihop "
+"ändringarna\n"
+
+#, c-format
+msgid ""
+"Recursive merging with submodules currently only supports trivial cases.\n"
+"Please manually handle the merging of each conflicted submodule.\n"
+"This can be accomplished with the following steps:\n"
+"%s - come back to superproject and run:\n"
+"\n"
+" git add %s\n"
+"\n"
+" to record the above merge or update\n"
+" - resolve any other conflicts in the superproject\n"
+" - commit the resulting index in the superproject\n"
+msgstr ""
+"Rekursiv sammanslaning 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"
+"%s - kom tillbaka till huvudprojektet och kör:\n"
+"\n"
+" git add %s\n"
+"\n"
+" för att registrera sammanslagningen över eller uppdatera\n"
+" - lös eventuella andra konflikter i huvudprojektet\n"
+" - checka in det slutförda indexet i huvudprojektet\n"
#. TRANSLATORS: The %s arguments are: 1) tree hash of a merge
#. base, and 2-3) the trees for the two trees we're merging.
@@ -16464,17 +17093,17 @@ msgstr "(felaktig incheckning)\n"
#, c-format
msgid "add_cacheinfo failed for path '%s'; merge aborting."
msgstr ""
-"add_cacheinfo misslyckades för sökvägen \"%s\"; avslutar sammanslagningen."
+"add_cacheinfo misslyckades för sökvägen â€%sâ€; avslutar sammanslagningen."
#, c-format
msgid "add_cacheinfo failed to refresh for path '%s'; merge aborting."
msgstr ""
-"add_cacheinfo misslyckades uppdatera för sökvägen \"%s\"; avslutar "
+"add_cacheinfo misslyckades uppdatera för sökvägen â€%sâ€; avslutar "
"sammanslagningen."
#, c-format
msgid "failed to create path '%s'%s"
-msgstr "misslyckades skapa sökvägen \"%s\"%s"
+msgstr "misslyckades skapa sökvägen â€%sâ€%s"
#, c-format
msgid "Removing %s to make room for subdirectory\n"
@@ -16485,23 +17114,23 @@ msgstr ": kanske en K/F-konflikt?"
#, c-format
msgid "refusing to lose untracked file at '%s'"
-msgstr "vägrar förlora ospårad fil vid \"%s\""
+msgstr "vägrar förlora ospÃ¥rad fil vid â€%sâ€"
#, c-format
msgid "blob expected for %s '%s'"
-msgstr "blob förväntades för %s \"%s\""
+msgstr "blob förväntades för %s â€%sâ€"
#, c-format
msgid "failed to open '%s': %s"
-msgstr "misslyckades öppna \"%s\": %s"
+msgstr "misslyckades öppna â€%sâ€: %s"
#, c-format
msgid "failed to symlink '%s': %s"
-msgstr "misslyckades skapa symboliska länken \"%s\": %s"
+msgstr "misslyckades skapa symboliska länken â€%sâ€: %s"
#, c-format
msgid "do not know what to do with %06o %s '%s'"
-msgstr "vet inte hur %06o %s \"%s\" ska hanteras"
+msgstr "vet inte hur %06o %s â€%s†ska hanteras"
#, c-format
msgid "Fast-forwarding submodule %s to the following commit:"
@@ -16525,6 +17154,22 @@ msgid "Found a possible merge resolution for the submodule:\n"
msgstr "Hittade en möjlig lösning av sammanslagning för undermodulen:\n"
#, c-format
+msgid ""
+"If this is correct simply add it to the index for example\n"
+"by using:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"which will accept this suggestion.\n"
+msgstr ""
+"Om detta är riktigt lägger du bara till det i indexet, till\n"
+"exempel så här:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"vilket godtar lösningen.\n"
+
+#, c-format
msgid "Failed to merge submodule %s (multiple merges found)"
msgstr ""
"Misslyckades slå ihop undermodulen %s (flera sammanslagningar hittades)"
@@ -16573,7 +17218,7 @@ msgstr "namnbytt"
#, c-format
msgid "Refusing to lose dirty file at %s"
-msgstr "Vägrar förlora lortig fil vid \"%s\""
+msgstr "Vägrar förlora lortig fil vid â€%sâ€"
#, c-format
msgid "Refusing to lose untracked file at %s, even though it's in the way."
@@ -16581,7 +17226,7 @@ msgstr "Vägrar förlora ospårad fil vid %s, trots att den är i vägen."
#, c-format
msgid "CONFLICT (rename/add): Rename %s->%s in %s. Added %s in %s"
-msgstr "KONFLIKT (namnbyte/tillägg): Namnbyte %s->%s i %s. Lade till %s i %s"
+msgstr "KONFLIKT (namnbyte/tillägg): Namnbyte %s→%s i %s. Lade till %s i %s"
#, c-format
msgid "%s is a directory in %s adding as %s instead"
@@ -16593,19 +17238,18 @@ msgstr "Vägrar förlora ospårad fil vid %s; lägger till som %s istället"
#, c-format
msgid ""
-"CONFLICT (rename/rename): Rename \"%s\"->\"%s\" in branch \"%s\" rename \"%s"
-"\"->\"%s\" in \"%s\"%s"
+"CONFLICT (rename/rename): Rename \"%s\"->\"%s\" in branch \"%s\" rename "
+"\"%s\"->\"%s\" in \"%s\"%s"
msgstr ""
-"KONFLIKT (namnbyte/namnbyte): Namnbyte \"%s\"->\"%s\" på grenen \"%s\" "
-"namnbyte \"%s\"->\"%s\" i \"%s\"%s"
+"KONFLIKT (namnbyte/namnbyte): Namnbyte â€%sâ€â†’â€%s†pÃ¥ grenen â€%s†namnbyte "
+"â€%sâ€â†’â€%s†i â€%sâ€%s"
msgid " (left unresolved)"
msgstr " (lämnad olöst)"
#, c-format
msgid "CONFLICT (rename/rename): Rename %s->%s in %s. Rename %s->%s in %s"
-msgstr ""
-"KONFLIKT (namnbyte/namnbyte): Namnbyte %s->%s i %s. Namnbyte %s->%s i %s"
+msgstr "KONFLIKT (namnbyte/namnbyte): Namnbyte %s→%s i %s. Namnbyte %s→%s i %s"
#, c-format
msgid ""
@@ -16622,8 +17266,8 @@ msgid ""
"CONFLICT (rename/rename): Rename directory %s->%s in %s. Rename directory %s-"
">%s in %s"
msgstr ""
-"KONFLIKT (namnbyte/namnbyte): Namnbytt katalog %s->%s i %s. Namnbytt katalog "
-"%s->%s i %s"
+"KONFLIKT (namnbyte/namnbyte): Namnbytt katalog %s→%s i %s. Namnbytt katalog "
+"%s→%s i %s"
msgid "modify"
msgstr "ändra"
@@ -16680,13 +17324,25 @@ msgstr "sammanslagningen returnerade ingen incheckning"
#, c-format
msgid "Could not parse object '%s'"
-msgstr "Kunde inte tolka objektet \"%s\""
+msgstr "Kunde inte tolka objektet â€%sâ€"
msgid "failed to read the cache"
msgstr "misslyckades läsa cachen"
msgid "multi-pack-index OID fanout is of the wrong size"
-msgstr "multi-pack-indexets OID-utbredning har fel storlek"
+msgstr "OID-utbredning för multi-pack-index har fel storlek"
+
+#, c-format
+msgid ""
+"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
+msgstr ""
+"oid-utbredning i fel ordning: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
+
+msgid "multi-pack-index OID lookup chunk is the wrong size"
+msgstr "OID-uppslagningsstycket för multi-pack-index har fel storlek"
+
+msgid "multi-pack-index object offset chunk is the wrong size"
+msgstr "objekt-offset-stycket för multi-pack-index har fel storlek"
#, c-format
msgid "multi-pack-index file %s is too small"
@@ -16704,36 +17360,54 @@ msgstr "multi-pack-indexversionen %d stöds inte"
msgid "multi-pack-index hash version %u does not match version %u"
msgstr "multi-pack-index-hashversionen %u stämmer inte med versionen %u"
-msgid "multi-pack-index missing required pack-name chunk"
-msgstr "multi-pack-index saknar krävd paketnamn-stycke"
+msgid "multi-pack-index required pack-name chunk missing or corrupted"
+msgstr ""
+"nödvändigt paketnamn-stycke för multi-pack-index saknas eller är trasigt"
-msgid "multi-pack-index missing required OID fanout chunk"
-msgstr "multi-pack-index saknar krävt OID-utbredningsstycke"
+msgid "multi-pack-index required OID fanout chunk missing or corrupted"
+msgstr ""
+"nödvändigt OID-utbredningsstycke för multi-pack-index saknas eller är trasigt"
-msgid "multi-pack-index missing required OID lookup chunk"
-msgstr "multi-pack-index saknar krävt OID-uppslagnignsstycke"
+msgid "multi-pack-index required OID lookup chunk missing or corrupted"
+msgstr ""
+"nödvändigt OID-uppslagningsstycke för multi-pack-index saknas eller är "
+"trasigt"
-msgid "multi-pack-index missing required object offsets chunk"
-msgstr "multi-pack-index saknar krävt objekt-offsetstycke"
+msgid "multi-pack-index required object offsets chunk missing or corrupted"
+msgstr ""
+"nödvändigt objekt-offsetstycke för multi-pack-index saknas eller är trasigt"
+
+msgid "multi-pack-index pack-name chunk is too short"
+msgstr "paketnamnstycke för multi-pack-index är för kort"
#, c-format
msgid "multi-pack-index pack names out of order: '%s' before '%s'"
-msgstr "multi-pack-index-paketnamn i fel ordning: \"%s\" före \"%s\""
+msgstr "paketnamn för multi-pack-index i fel ordning: â€%s†före â€%sâ€"
#, c-format
msgid "bad pack-int-id: %u (%u total packs)"
msgstr "bad pack-int-id: %u (%u paket totalt)"
+msgid "MIDX does not contain the BTMP chunk"
+msgstr "MIDX innehåller inte BTMP-stycket"
+
+#, c-format
+msgid "could not load bitmapped pack %<PRIu32>"
+msgstr "kunde inte läsa det bitmappade paketet %<PRIu32>"
+
msgid "multi-pack-index stores a 64-bit offset, but off_t is too small"
-msgstr "multi-pack-index skriver 64-bitars offset, men off_t är för liten"
+msgstr "multi-pack-index innehåller 64-bitars offset, men off_t är för liten"
+
+msgid "multi-pack-index large offset out of bounds"
+msgstr "stort offset för mult-pack-index utanför gränsen"
#, c-format
msgid "failed to add packfile '%s'"
-msgstr "misslyckades läsa paketfilen \"%s\""
+msgstr "misslyckades läsa paketfilen â€%sâ€"
#, c-format
msgid "failed to open pack-index '%s'"
-msgstr "misslyckades öppna paketindexet \"%s\""
+msgstr "misslyckades öppna paketindexet â€%sâ€"
#, c-format
msgid "failed to locate object %d in packfile"
@@ -16777,7 +17451,7 @@ msgstr "såg inte paketfilen %s som skulle kastas"
#, c-format
msgid "preferred pack '%s' is expired"
-msgstr "föredraget paket \"%s\" har löpt ut"
+msgstr "föredraget paket â€%s†har löpt ut"
msgid "no pack files to index."
msgstr "inga paketfiler att indexera."
@@ -16804,12 +17478,6 @@ msgstr "felaktig kontrollsumma"
msgid "Looking for referenced packfiles"
msgstr "Ser efter refererade packfiler"
-#, c-format
-msgid ""
-"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
-msgstr ""
-"oid-utbredning i fel ordning: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
-
msgid "the midx contains no oid"
msgstr "midx saknar oid"
@@ -16869,9 +17537,9 @@ msgid ""
"commit/abort the previous merge before you start a new notes merge."
msgstr ""
"Du har inte avslutat föregående antecknings-sammanslagning (%s finns).\n"
-"Använd \"git notes merge --commit\" eller \"git notes merge --abort\" för "
-"att checka in eller avbryta föregående sammanslagning innan du påbörjar en "
-"ny antecknings-sammanslagning."
+"Använd â€git notes merge --commit†eller â€git notes merge --abort†för att "
+"checka in eller avbryta föregående sammanslagning innan du påbörjar en ny "
+"antecknings-sammanslagning."
#, c-format
msgid "You have not concluded your notes merge (%s exists)."
@@ -16894,7 +17562,7 @@ msgstr "Vägrar skriva över anteckningar i %s (utanför refs/notes/)"
#.
#, c-format
msgid "Bad %s value: '%s'"
-msgstr "Felaktigt värde på %s: \"%s\""
+msgstr "Felaktigt värde pÃ¥ %s: â€%sâ€"
#, c-format
msgid "object directory %s does not exist; check .git/objects/info/alternates"
@@ -16908,38 +17576,34 @@ msgstr "kunde inte normalisera supplerande objektsökväg: %s"
msgid "%s: ignoring alternate object stores, nesting too deep"
msgstr "%s: ignorerar supplerande objektlager, för djup nästling"
-#, c-format
-msgid "unable to normalize object directory: %s"
-msgstr "kan inte normalisera objektkatalogen: %s"
-
msgid "unable to fdopen alternates lockfile"
-msgstr "kan inte utföra \"fdopen\" på suppleantlåsfil"
+msgstr "kan inte utföra â€fdopen†pÃ¥ suppleantlÃ¥sfil"
msgid "unable to read alternates file"
-msgstr "kan inte läsa \"alternates\"-filen"
+msgstr "kan inte läsa â€alternatesâ€-filen"
msgid "unable to move new alternates file into place"
-msgstr "kan inte flytta ny \"alternates\"-fil på plats"
+msgstr "kan inte flytta ny â€alternatesâ€-fil pÃ¥ plats"
#, c-format
msgid "path '%s' does not exist"
-msgstr "sökvägen \"%s\" finns inte"
+msgstr "sökvägen â€%s†finns inte"
#, c-format
msgid "reference repository '%s' as a linked checkout is not supported yet."
-msgstr "referensarkivet \"%s\" som en länkad utcheckning stöds inte ännu."
+msgstr "referensarkivet â€%s†som en länkad utcheckning stöds inte ännu."
#, c-format
msgid "reference repository '%s' is not a local repository."
-msgstr "referensarkivet \"%s\" är inte ett lokalt arkiv."
+msgstr "referensarkivet â€%s†är inte ett lokalt arkiv."
#, c-format
msgid "reference repository '%s' is shallow"
-msgstr "referensarkivet \"%s\" är grunt"
+msgstr "referensarkivet â€%s†är grunt"
#, c-format
msgid "reference repository '%s' is grafted"
-msgstr "referensarkivet \"%s\" är ympat"
+msgstr "referensarkivet â€%s†är ympat"
#, c-format
msgid "could not find object directory matching %s"
@@ -16951,7 +17615,7 @@ msgstr "felaktig rad vid tolkning av supplerande referenser: %s"
#, c-format
msgid "attempting to mmap %<PRIuMAX> over limit %<PRIuMAX>"
-msgstr "försök att utföra \"mmap\" på %<PRIuMAX> över gränsen %<PRIuMAX>"
+msgstr "försök att utföra â€mmap†pÃ¥ %<PRIuMAX> över gränsen %<PRIuMAX>"
#, c-format
msgid "mmap failed%s"
@@ -16963,11 +17627,15 @@ msgstr "objektfilen %s är tom"
#, c-format
msgid "corrupt loose object '%s'"
-msgstr "trasigt löst objekt \"%s\""
+msgstr "trasigt löst objekt â€%sâ€"
#, c-format
msgid "garbage at end of loose object '%s'"
-msgstr "skräp i slutet av löst objekt \"%s\""
+msgstr "skräp i slutet av löst objekt â€%sâ€"
+
+#, c-format
+msgid "unable to open loose object %s"
+msgstr "kan inte öppna lösa objekt %s"
#, c-format
msgid "unable to parse %s header"
@@ -16985,18 +17653,14 @@ msgid "header for %s too long, exceeds %d bytes"
msgstr "huvudet för %s är för långt, mer än %d byte"
#, c-format
-msgid "failed to read object %s"
-msgstr "misslyckades läsa objektet %s"
+msgid "loose object %s (stored in %s) is corrupt"
+msgstr "löst objekt %s (lagrat i %s) är trasigt"
#, c-format
msgid "replacement %s not found for %s"
msgstr "ersättningen %s hittades inte för %s"
#, c-format
-msgid "loose object %s (stored in %s) is corrupt"
-msgstr "löst objekt %s (lagrat i %s) är trasigt"
-
-#, c-format
msgid "packed object %s (stored in %s) is corrupt"
msgstr "packat objekt %s (lagrat i %s) är trasigt"
@@ -17006,10 +17670,7 @@ msgstr "kunde inte skriva filen %s"
#, c-format
msgid "unable to set permission to '%s'"
-msgstr "kan inte sätta behörigheten till \"%s\""
-
-msgid "file write error"
-msgstr "fel vid skrivning av fil"
+msgstr "kan inte sätta behörigheten till â€%sâ€"
msgid "error when closing loose object file"
msgstr "fel vid stängning av fil för löst objekt"
@@ -17027,25 +17688,42 @@ msgstr "kunde inte skriva fil för löst objekt"
#, c-format
msgid "unable to deflate new object %s (%d)"
-msgstr "kan inte utföra \"deflate\" på nytt objekt %s (%d)"
+msgstr "kan inte utföra â€deflate†pÃ¥ nytt objekt %s (%d)"
#, c-format
msgid "deflateEnd on object %s failed (%d)"
-msgstr "\"deflateend\" på objektet %s misslyckades (%d)"
+msgstr "â€deflateEnd†pÃ¥ objektet %s misslyckades (%d)"
#, c-format
msgid "confused by unstable object source data for %s"
msgstr "förvirrad av instabil objektkälldata för %s"
#, c-format
+msgid "write stream object %ld != %<PRIuMAX>"
+msgstr "skriv strömobjektet %ld != %<PRIuMAX>"
+
+#, c-format
+msgid "unable to stream deflate new object (%d)"
+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)"
+
+#, c-format
+msgid "unable to create directory %s"
+msgstr "kunde inte skapa katalogen %s"
+
+#, c-format
msgid "cannot read object for %s"
msgstr "kan inte läsa objekt för %s"
-msgid "corrupt commit"
-msgstr "trasik incheckning"
+#, c-format
+msgid "object fails fsck: %s"
+msgstr "objekt klarar inte fsck: %s"
-msgid "corrupt tag"
-msgstr "trasig tagg"
+msgid "refusing to create malformed object"
+msgstr "vägrar skapa ett felaktigt format objekt"
#, c-format
msgid "read error while indexing %s"
@@ -17065,7 +17743,7 @@ msgstr "%s: filtypen stöds ej"
#, c-format
msgid "%s is not a valid '%s' object"
-msgstr "%s är inte ett giltigt \"%s\"-objekt"
+msgstr "%s är inte ett giltigt â€%sâ€-objekt"
#, c-format
msgid "unable to open %s"
@@ -17077,7 +17755,7 @@ msgstr "hash stämmer inte för %s (förväntade %s)"
#, c-format
msgid "unable to mmap %s"
-msgstr "kan inte utföra \"mmap\" för %s"
+msgstr "kan inte utföra â€mmap†för %s"
#, c-format
msgid "unable to unpack header of %s"
@@ -17180,72 +17858,72 @@ msgstr ""
"\n"
" git switch -c $br $(git rev-parse ...)\n"
"\n"
-"där \"$br\" på något sätt blivit tomt och en 40-hex-referens skapats.\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 advice.objectNameWarning falseâ€"
#, c-format
msgid "log for '%.*s' only goes back to %s"
-msgstr "loggen för \"%.*s\" räcker bara tillbaka till %s"
+msgstr "loggen för â€%.*s†räcker bara tillbaka till %s"
#, c-format
msgid "log for '%.*s' only has %d entries"
-msgstr "loggen för \"%.*s\" har bara %d poster"
+msgstr "loggen för â€%.*s†har bara %d poster"
#, c-format
msgid "path '%s' exists on disk, but not in '%.*s'"
-msgstr "Sökvägen \"%s\" finns på disken, men inte i \"%.*s\""
+msgstr "Sökvägen â€%s†finns pÃ¥ disken, men inte i â€%.*sâ€"
#, c-format
msgid ""
"path '%s' exists, but not '%s'\n"
"hint: Did you mean '%.*s:%s' aka '%.*s:./%s'?"
msgstr ""
-"sökvägen \"%s\" finns, men inte i \"%s\"\n"
-"tips: Menade du \"%.*s:%s\", även känd som \"%.*s:./%s\"?"
+"sökvägen â€%s†finns, men inte i â€%sâ€\n"
+"tips: Menade du â€%.*s:%sâ€, även känd som â€%.*s:./%sâ€?"
#, c-format
msgid "path '%s' does not exist in '%.*s'"
-msgstr "sökvägen \"%s\" finns inte i \"%.*s\""
+msgstr "sökvägen â€%s†finns inte i â€%.*sâ€"
#, c-format
msgid ""
"path '%s' is in the index, but not at stage %d\n"
"hint: Did you mean ':%d:%s'?"
msgstr ""
-"sökvägen \"%s\" finns i indexet men inte i etapp %d\n"
-"tips: Menade du \":%d:%s\"?"
+"sökvägen â€%s†finns i indexet men inte i etapp %d\n"
+"tips: Menade du â€:%d:%sâ€?"
#, c-format
msgid ""
"path '%s' is in the index, but not '%s'\n"
"hint: Did you mean ':%d:%s' aka ':%d:./%s'?"
msgstr ""
-"sökvägen \"%s\" finns i indexet, men inte i \"%s\"\n"
-"tips: Menade du \":%d:%s\", även känd som \":%d:./%s\"?"
+"sökvägen â€%s†finns i indexet, men inte i â€%sâ€\n"
+"tips: Menade du â€:%d:%sâ€, även känd som â€:%d:./%sâ€?"
#, c-format
msgid "path '%s' exists on disk, but not in the index"
-msgstr "sökvägen \"%s\" finns på disk, men inte i indexet"
+msgstr "sökvägen â€%s†finns pÃ¥ disk, men inte i indexet"
#, c-format
msgid "path '%s' does not exist (neither on disk nor in the index)"
-msgstr "sökvägen \"%s\" finns inte (varken i disken eller i indexet)"
+msgstr "sökvägen â€%s†finns inte (varken i disken eller i indexet)"
msgid "relative path syntax can't be used outside working tree"
msgstr "relativ sökväg kan inte användas utanför arbetskatalogen"
#, c-format
msgid "<object>:<path> required, only <object> '%s' given"
-msgstr "<objekt>:<sökväg> krävs, endast <objekt> \"%s\" har angivits"
+msgstr "<objekt>:<sökväg> krävs, endast <objekt> â€%s†har angivits"
#, c-format
msgid "invalid object name '%.*s'."
-msgstr "felaktigt objektnamn \"%.*s\"."
+msgstr "felaktigt objektnamn â€%.*sâ€."
#, c-format
msgid "invalid object type \"%s\""
-msgstr "ogiltig objekttyp \"%s\""
+msgstr "ogiltig objekttyp â€%sâ€"
#, c-format
msgid "object %s is a %s, not a %s"
@@ -17263,6 +17941,52 @@ msgstr "kunde inte tolka objektet: %s"
msgid "hash mismatch %s"
msgstr "hashvärde stämmer inte överens %s"
+msgid "trying to write commit not in index"
+msgstr "försöker skriva incheckning som inte finns i indexet"
+
+msgid "failed to load bitmap index (corrupted?)"
+msgstr "misslyckade läsa in bitkarteindex (trasigt?)"
+
+msgid "corrupted bitmap index (too small)"
+msgstr "trasigt bitkarteindex (för litet)"
+
+msgid "corrupted bitmap index file (wrong header)"
+msgstr "trasigt bitkarteindex (felaktigt huvud)"
+
+#, c-format
+msgid "unsupported version '%d' for bitmap index file"
+msgstr "versionen â€%d†i bitkarteindexfilen stöds inte"
+
+msgid "corrupted bitmap index file (too short to fit hash cache)"
+msgstr "trasigt bitkarteindex (för kort för att få plats för hash-cache)"
+
+msgid "corrupted bitmap index file (too short to fit lookup table)"
+msgstr "trasigt bitkarteindex (för kort för att få plats för uppslagstabell)"
+
+#, c-format
+msgid "duplicate entry in bitmap index: '%s'"
+msgstr "duplicerad post i bitkarteindex: â€%sâ€"
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for entry %d"
+msgstr "trasig ewah-bitkarta: avhugget huvud för post %d"
+
+#, c-format
+msgid "corrupt ewah bitmap: commit index %u out of range"
+msgstr "trasig ewah-bitkarta: incheckningsindex %u utanför intervall"
+
+msgid "corrupted bitmap pack index"
+msgstr "trasigt bitkarte-packindex"
+
+msgid "invalid XOR offset in bitmap pack index"
+msgstr "ogiltigt XOR-offset i bitkarte-packindex"
+
+msgid "cannot fstat bitmap file"
+msgstr "kan inte utföra â€fstat†pÃ¥ bitkartefil"
+
+msgid "checksum doesn't match in MIDX and bitmap"
+msgstr "checksumman stämmer inte i MIDX och bitkarta"
+
msgid "multi-pack bitmap is missing required reverse index"
msgstr "flerpaketsbitkarta saknar nödvändigt omvänt index"
@@ -17270,13 +17994,72 @@ 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"
+
+msgid "corrupt bitmap lookup table: xor chain exceeds entry count"
+msgstr "trasig bitkarteuppslagstabell: xor-kedja överskrider postantalet"
+
+#, c-format
+msgid "corrupt bitmap lookup table: commit index %u out of range"
+msgstr ""
+"trasig bitkarteuppslagstabell: incheckningsindexet %u utanför intervallet"
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for bitmap of commit \"%s\""
+msgstr "trasig ewah-bitkarta: avhugget huvud för bitkarta för incheckning â€%sâ€"
+
+#, c-format
+msgid "unable to load pack: '%s', disabling pack-reuse"
+msgstr "kunde inte läsa paketet: â€%sâ€, inaktiverar Ã¥teranvändning av paket"
+
+#, c-format
+msgid "object '%s' not found in type bitmaps"
+msgstr "objektet â€%s†hittades inte i typbitkartor"
+
#, c-format
-msgid "could not find %s in pack %s at offset %<PRIuMAX>"
-msgstr "kunde inte hitta %s i paketet %s på offset %<PRIuMAX>"
+msgid "object '%s' does not have a unique type"
+msgstr "objektet â€%s†har inte en unik typ"
+
+#, c-format
+msgid "object '%s': real type '%s', expected: '%s'"
+msgstr "objektet â€%sâ€: riktig typ â€%sâ€, förväntade â€%sâ€"
+
+#, c-format
+msgid "object not in bitmap: '%s'"
+msgstr "objekt saknas i bitkarta: %s"
+
+msgid "failed to load bitmap indexes"
+msgstr "misslyckade läsa in bitkarteindex"
+
+msgid "you must specify exactly one commit to test"
+msgstr "du måste ange exakt en incheckning att testa"
+
+#, c-format
+msgid "commit '%s' doesn't have an indexed bitmap"
+msgstr "incheckningen â€%s†har inte en indexerad bitkarta"
+
+msgid "mismatch in bitmap results"
+msgstr "bitkarteresultat stämmer inte överens"
+
+#, c-format
+msgid "could not find '%s' in pack '%s' at offset %<PRIuMAX>"
+msgstr "kunde inte hitta â€%s†i paketet â€%s†pÃ¥ offset %<PRIuMAX>"
+
+#, c-format
+msgid "unable to get disk usage of '%s'"
+msgstr "kan inte hämta diskanvändning för â€%sâ€"
+
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "bitkartefilen â€%s†har ogiltig kontrollsumma"
#, c-format
msgid "mtimes file %s is too small"
@@ -17318,6 +18101,19 @@ msgstr "reverse-index-filen %s har versionen %<PRIu32> som inte stöds"
msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
msgstr "reverse-index-filen %s har hash-ID %<PRIu32> som inte stöds"
+msgid "invalid checksum"
+msgstr "ogiltig kontrollsumma"
+
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr "ogiltig rev-indexposition vid %<PRIu64>: %<PRIu32> != %<PRIu32>"
+
+msgid "multi-pack-index reverse-index chunk is the wrong size"
+msgstr "baklängesindex-stycke för multi-pack-index har fel storlek"
+
+msgid "could not determine preferred pack"
+msgstr "kunde inte bestämma föredraget paket"
+
msgid "cannot both write and verify reverse index"
msgstr "kan inte både skriva och bekräfta reverse-index"
@@ -17331,7 +18127,7 @@ msgstr "kunde inte göra %s läsbar"
#, c-format
msgid "could not write '%s' promisor file"
-msgstr "kunde inte skriva kontraktsfilen \"%s\""
+msgstr "kunde inte skriva kontraktsfilen â€%sâ€"
msgid "offset before end of packfile (broken .idx?)"
msgstr "offset före slutet av packfilen (trasig .idx?)"
@@ -17350,34 +18146,25 @@ msgstr "offset borton slutet av packindex för %s (trunkerat index?)"
#, c-format
msgid "malformed expiration date '%s'"
-msgstr "trasigt utlöpsdatum: \"%s\""
+msgstr "trasigt utlöpsdatum: â€%sâ€"
#, c-format
msgid "option `%s' expects \"always\", \"auto\", or \"never\""
-msgstr ""
-"flaggan \"%s\" antar \"always\" (alltid), \"auto\" eller \"never\" (aldrig)"
+msgstr "flaggan â€%s†antar â€always†(alltid), â€auto†eller â€never†(aldrig)"
#, c-format
msgid "malformed object name '%s'"
-msgstr "felformat objektnamn \"%s\""
+msgstr "felformat objektnamn â€%sâ€"
#, c-format
msgid "option `%s' expects \"%s\" or \"%s\""
-msgstr "flaggan \"%s\" kräver \"%s\" eller \"%s\""
+msgstr "flaggan â€%s†kräver â€%s†eller â€%sâ€"
#, c-format
msgid "%s requires a value"
msgstr "%s behöver ett värde"
#, c-format
-msgid "%s is incompatible with %s"
-msgstr "%s är inkompatibel med %s"
-
-#, c-format
-msgid "%s : incompatible with something else"
-msgstr "%s: inkompatibelt med något annat"
-
-#, c-format
msgid "%s takes no value"
msgstr "%s tar inget värde"
@@ -17395,23 +18182,26 @@ msgstr "tvetydig flagga: %s (kan vara --%s%s eller --%s%s)"
#, c-format
msgid "did you mean `--%s` (with two dashes)?"
-msgstr "menade du \"--%s\" (med två bindestreck)?"
+msgstr "menade du â€--%s†(med tvÃ¥ bindestreck)?"
#, c-format
msgid "alias of --%s"
msgstr "alias för --%s"
+msgid "need a subcommand"
+msgstr "behöver ett underkommando"
+
#, c-format
msgid "unknown option `%s'"
-msgstr "okänd flagga \"%s\""
+msgstr "okänd flagga â€%sâ€"
#, c-format
msgid "unknown switch `%c'"
-msgstr "okänd flagga \"%c\""
+msgstr "okänd flagga â€%câ€"
#, c-format
msgid "unknown non-ascii option in string: `%s'"
-msgstr "okänd icke-ascii-flagga i strängen: \"%s\""
+msgstr "okänd icke-ascii-flagga i strängen: â€%sâ€"
msgid "..."
msgstr "..."
@@ -17457,6 +18247,10 @@ msgstr " %s"
msgid "-NUM"
msgstr "-TAL"
+#, c-format
+msgid "opposite of --no-%s"
+msgstr "motsatsen mot --no-%s"
+
msgid "expiry-date"
msgstr "giltig-till"
@@ -17472,6 +18266,9 @@ msgstr "var mer tyst"
msgid "use <n> digits to display object names"
msgstr "använd <n> siffror för att visa objektnamn"
+msgid "prefixed path to initial superproject"
+msgstr "inledande sökväg till start-överprojekt"
+
msgid "how to strip spaces and #comments from message"
msgstr "hur blanksteg och #kommentarer ska tas bort från meddelande"
@@ -17483,14 +18280,22 @@ msgid ""
msgstr "med --pathspec-from-file, sökvägsangivelser avdelas med NUL-tecken"
#, c-format
+msgid "bad boolean environment value '%s' for '%s'"
+msgstr "felaktigt booleskt miljövariabelvärde â€%s†för â€%sâ€"
+
+#, c-format
+msgid "failed to parse %s"
+msgstr "kunde inte tolka %s"
+
+#, c-format
msgid "Could not make %s writable by group"
msgstr "Kunde inte göra %s skrivbar för gruppen"
msgid "Escape character '\\' not allowed as last character in attr value"
-msgstr "Specialtecknet \"\\\" tillåts inte som sista tecken i attributvärde"
+msgstr "Specialtecknet â€\\†tillÃ¥ts inte som sista tecken i attributvärde"
msgid "Only one 'attr:' specification is allowed."
-msgstr "Endast en \"attr:\"-angivelse tillåten."
+msgstr "Endast en â€attr:â€-angivelse tillÃ¥ten."
msgid "attr spec must not be empty"
msgstr "attr-angivelse kan inte vara tom"
@@ -17500,42 +18305,45 @@ msgid "invalid attribute name %s"
msgstr "ogiltigt attributnamn %s"
msgid "global 'glob' and 'noglob' pathspec settings are incompatible"
-msgstr ""
-"de globala sökvägsinställningarna \"glob\" och \"noglob\" är inkompatibla"
+msgstr "de globala sökvägsinställningarna â€glob†och â€noglob†är inkompatibla"
msgid ""
"global 'literal' pathspec setting is incompatible with all other global "
"pathspec settings"
msgstr ""
-"den globala sökvägsinställningen \"literal\" är inkompatibel med alla andra "
+"den globala sökvägsinställningen â€literal†är inkompatibel med alla andra "
"globala sökvägsinställningar"
msgid "invalid parameter for pathspec magic 'prefix'"
-msgstr "ogiltig parameter för sökvägsuttrycket för \"prefix\""
+msgstr "ogiltig parameter för sökvägsuttrycket för â€prefixâ€"
#, c-format
msgid "Invalid pathspec magic '%.*s' in '%s'"
-msgstr "Felaktigt sökvägsuttryck \"%.*s\" i \"%s\""
+msgstr "Felaktigt sökvägsuttryck â€%.*s†i â€%sâ€"
#, c-format
msgid "Missing ')' at the end of pathspec magic in '%s'"
-msgstr "\")\" saknas i slutet av sökvägsuttrycket för \"%s\""
+msgstr "â€)†saknas i slutet av sökvägsuttrycket för â€%sâ€"
#, c-format
msgid "Unimplemented pathspec magic '%c' in '%s'"
-msgstr "Ej implementerat sökvägsuttryckmagi \"%c\" i \"%s\""
+msgstr "Ej implementerat sökvägsuttryckmagi â€%c†i â€%sâ€"
#, c-format
msgid "%s: 'literal' and 'glob' are incompatible"
-msgstr "%s: \"literal\" och \"glob\" är inkompatibla"
+msgstr "%s: â€literal†och â€glob†är inkompatibla"
+
+#, c-format
+msgid "'%s' is outside the directory tree"
+msgstr "â€%s†är utanför katalogträdet"
#, c-format
msgid "%s: '%s' is outside repository at '%s'"
-msgstr "%s: \"%s\" är utanför arkivet på \"%s\""
+msgstr "%s: â€%s†är utanför arkivet pÃ¥ â€%sâ€"
#, c-format
msgid "'%s' (mnemonic: '%c')"
-msgstr "\"%s\" (minnesstöd: \"%c\")"
+msgstr "â€%s†(minnesstöd: â€%câ€)"
#, c-format
msgid "%s: pathspec magic not supported by this command: %s"
@@ -17543,7 +18351,7 @@ msgstr "%s: sökvägsuttrycket hanteras inte av det här kommandot: %s"
#, c-format
msgid "pathspec '%s' is beyond a symbolic link"
-msgstr "sökvägsangivelsen \"%s\" är på andra sidan av en symbolisk länk"
+msgstr "sökvägsangivelsen â€%s†är pÃ¥ andra sidan av en symbolisk länk"
#, c-format
msgid "line is badly quoted: %s"
@@ -17559,7 +18367,7 @@ msgid "unable to write response end packet"
msgstr "kunde inte skriva svarsavslutningspaket"
msgid "flush packet write failed"
-msgstr "fel vid skrivning av \"flush\"-paket"
+msgstr "fel vid skrivning av â€flushâ€-paket"
msgid "protocol error: impossibly long line"
msgstr "protokollfel: omöjligt lång rad"
@@ -17614,46 +18422,56 @@ msgstr ""
#, c-format
msgid "promisor remote name cannot begin with '/': %s"
-msgstr "kontraktsfjärr kan inte börja med \"/\": %s"
+msgstr "kontraktsfjärr kan inte börja med â€/â€: %s"
+
+#, c-format
+msgid "could not fetch %s from promisor remote"
+msgstr "kunde inte hämta %s från kontraktsfjärr"
msgid "object-info: expected flush after arguments"
-msgstr "object-info: förväntade \"flush\" efter argument"
+msgstr "object-info: förväntade â€flush†efter argument"
msgid "Removing duplicate objects"
msgstr "Tar bort duplicerade objekt"
msgid "could not start `log`"
-msgstr "kunde inte starta \"log\""
+msgstr "kunde inte starta â€logâ€"
msgid "could not read `log` output"
-msgstr "kunde inte läsa utdata från \"log\""
+msgstr "kunde inte läsa utdata frÃ¥n â€logâ€"
#, c-format
msgid "could not parse commit '%s'"
-msgstr "kunde inte tolka incheckningen \"%s\""
+msgstr "kunde inte tolka incheckningen â€%sâ€"
#, c-format
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â€-updata: börjar inte med â€commit â€: â€%sâ€"
#, c-format
msgid "could not parse git header '%.*s'"
-msgstr "kunde inte tolka git-huvudet \"%.*s\""
+msgstr "kunde inte tolka git-huvudet â€%.*sâ€"
msgid "failed to generate diff"
msgstr "misslyckades skapa diff"
#, c-format
msgid "could not parse log for '%s'"
-msgstr "kunde inte tolka loggen för \"%s\""
+msgstr "kunde inte tolka loggen för â€%sâ€"
+
+#, c-format
+msgid "invalid extra cruft tip: '%s'"
+msgstr "ogiltig extra överbliven ände: â€%sâ€"
+
+msgid "unable to enumerate additional recent objects"
+msgstr "kan inte räkna ytterligare nyliga objekt"
#, c-format
msgid "will not add file alias '%s' ('%s' already exists in index)"
-msgstr "lägger inte till filalias \"%s\" (\"%s\" finns redan i indexet)"
+msgstr "lägger inte till filalias â€%s†(â€%s†finns redan i indexet)"
msgid "cannot create an empty blob in the object database"
msgstr "kan inte skapa tom blob i objektdatabasen"
@@ -17665,19 +18483,15 @@ msgstr ""
#, c-format
msgid "unable to index file '%s'"
-msgstr "kan inte indexera filen \"%s\""
+msgstr "kan inte indexera filen â€%sâ€"
#, c-format
msgid "unable to add '%s' to index"
-msgstr "kan inte lägga till \"%s\" till indexet"
-
-#, c-format
-msgid "unable to stat '%s'"
-msgstr "kan inte ta status på \"%s\""
+msgstr "kan inte lägga till â€%s†till indexet"
#, c-format
msgid "'%s' appears as both a file and as a directory"
-msgstr "\"%s\" finns både som en fil och en katalog"
+msgstr "â€%s†finns bÃ¥de som en fil och en katalog"
msgid "Refresh index"
msgstr "Uppdatera indexet"
@@ -17723,18 +18537,18 @@ msgstr "okänt format 0x%08x på indexpost"
#, c-format
msgid "malformed name field in the index, near path '%s'"
-msgstr "felformat namnfält i indexet, nära sökvägen \"%s\""
+msgstr "felformat namnfält i indexet, nära sökvägen â€%sâ€"
msgid "unordered stage entries in index"
msgstr "osorterade köposter i index"
#, c-format
msgid "multiple stage entries for merged file '%s'"
-msgstr "flera köposter för den sammanslagna filen \"%s\""
+msgstr "flera köposter för den sammanslagna filen â€%sâ€"
#, c-format
msgid "unordered stage entries for '%s'"
-msgstr "osorterade köposter för \"%s\""
+msgstr "osorterade köposter för â€%sâ€"
#, c-format
msgid "unable to create load_cache_entries thread: %s"
@@ -17770,7 +18584,7 @@ msgstr "kunde inte utföra join på load_index_extensions-tråden: %s"
#, c-format
msgid "could not freshen shared index '%s'"
-msgstr "kunde inte uppdatera delat index \"%s\""
+msgstr "kunde inte uppdatera delat index â€%sâ€"
#, c-format
msgid "broken index, expect %s in %s, got %s"
@@ -17783,10 +18597,6 @@ msgid "failed to convert to a sparse-index"
msgstr "misslyckades omvandla till glest index"
#, c-format
-msgid "could not stat '%s'"
-msgstr "kunde inte ta status på \"%s\""
-
-#, c-format
msgid "unable to open git dir: %s"
msgstr "kunde inte öppna git-katalog: %s"
@@ -17796,20 +18606,28 @@ msgstr "misslyckades ta bort länken: %s"
#, c-format
msgid "cannot fix permission bits on '%s'"
-msgstr "kan inte rätta behörighetsbitar på \"%s\""
+msgstr "kan inte rätta behörighetsbitar pÃ¥ â€%sâ€"
#, c-format
msgid "%s: cannot drop to stage #0"
msgstr "%s: kan inte återgå till kö 0"
+#, c-format
+msgid "unexpected diff status %c"
+msgstr "diff-status %c förväntades inte"
+
+#, c-format
+msgid "remove '%s'\n"
+msgstr "ta bort â€%sâ€\n"
+
msgid ""
"You can fix this with 'git rebase --edit-todo' and then run 'git rebase --"
"continue'.\n"
"Or you can abort the rebase with 'git rebase --abort'.\n"
msgstr ""
-"Du kan rätta detta med \"git rebase --edit-todo\" följt av \"git rebase --"
-"continue\".\n"
-"Avbryt ombaseringen med \"git rebase --abort\".\n"
+"Du kan rätta detta med â€git rebase --edit-todo†följt av â€git rebase --"
+"continueâ€.\n"
+"Avbryt ombaseringen med â€git rebase --abortâ€.\n"
#, c-format
msgid ""
@@ -17834,9 +18652,12 @@ msgid ""
"l, label <label> = label current HEAD with a name\n"
"t, reset <label> = reset HEAD to a label\n"
"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
-". create a merge commit using the original merge commit's\n"
-". message (or the oneline, if no original merge commit was\n"
-". specified); use -c <commit> to reword the commit message\n"
+" create a merge commit using the original merge commit's\n"
+" message (or the oneline, if no original merge commit was\n"
+" specified); use -c <commit> to reword the commit message\n"
+"u, update-ref <ref> = track a placeholder for the <ref> to be updated\n"
+" to this position in the new commits. The <ref> is\n"
+" updated at the end of the rebase\n"
"\n"
"These lines can be re-ordered; they are executed from top to bottom.\n"
msgstr ""
@@ -17848,25 +18669,27 @@ msgstr ""
"e, edit <incheckning> = använd incheckning, men stanna för tillägg\n"
"s, squash <incheckning> = använd incheckning, men infoga i föregående "
"incheckning\n"
-"f, fixup [-C | -c] <incheckning> = som \"squash\" men behåll bara "
+"f, fixup [-C | -c] <incheckning> = som â€squash†men behÃ¥ll bara "
"loggmeddelandet\n"
" från föregående incheckning, såvida inte -C används, då "
"används\n"
" istället bara den här incheckningens meddelande; -c är "
"samma\n"
" som -C, men öppnar redigeringsprogrammet\n"
-"f, fixup <incheckning> = som \"squash\", men förkasta "
-"incheckningsmeddelandet\n"
+"f, fixup <incheckning> = som â€squashâ€, men förkasta incheckningsmeddelandet\n"
"x, exec <kommando> = kör kommando (resten av raden) i skalet\n"
-"b, break = stoppa här (fortsätt ombaseringen senare med \"git rebase --"
-"continue\")\n"
+"b, break = stoppa här (fortsätt ombaseringen senare med â€git rebase --"
+"continueâ€)\n"
"d, drop <incheckning> = ta bort incheckning\n"
"l, label <etikett> = ge aktuellt HEAD ett namn\n"
"t, reset <etikett> = återställ HEAD till en etikett\n"
"m, merge [-C <incheckning> | -c <incheckning>] <etikett> [# <enrads>]\n"
-". skapa en sammanslagning med ursprungligt meddelande (eller\n"
-". enrads, om inget incheckningsmeddelande angavs); använd\n"
-". -c <incheckning> för att skriva om meddelandet.\n"
+" skapa en sammanslagning med ursprungligt meddelande (eller\n"
+" enrads, om inget incheckningsmeddelande angavs); använd\n"
+" -c <incheckning> för att skriva om meddelandet.\n"
+"u, update-ref <ref> = spåra en platshållare för <ref> att uppdatera\n"
+" till denna position bland nya inchecknngar.\n"
+" <ref> uppdateras i slutet av ombaseringen.\n"
"\n"
"Du kan byta ordning på raderna; de utförs uppifrån och ned.\n"
@@ -17881,7 +18704,7 @@ msgid ""
"Do not remove any line. Use 'drop' explicitly to remove a commit.\n"
msgstr ""
"\n"
-"Ta inte bort rader. Använd \"drop\" för att specifikt förkasta en "
+"Ta inte bort rader. Använd â€drop†för att specifikt förkasta en "
"incheckning.\n"
msgid ""
@@ -17899,7 +18722,7 @@ msgid ""
"\n"
msgstr ""
"\n"
-"Du redigerar \"todo\"-filen för en pågående interaktiv ombasering.\n"
+"Du redigerar â€todoâ€-filen för en pÃ¥gÃ¥ende interaktiv ombasering.\n"
"För att forsätta ombasera efter redigeringen, kör:\n"
" git rebase --continue\n"
"\n"
@@ -17915,7 +18738,7 @@ msgstr ""
#, c-format
msgid "could not write '%s'."
-msgstr "kunde inte skriva \"%s\"."
+msgstr "kunde inte skriva â€%sâ€."
#, c-format
msgid ""
@@ -17934,19 +18757,16 @@ msgid ""
"The possible behaviours are: ignore, warn, error.\n"
"\n"
msgstr ""
-"För att undvika det här meddelandet kan du använda \"drop\" för att "
-"explicit\n"
+"För att undvika det här meddelandet kan du använda â€drop†för att explicit\n"
"kasta en incheckning.\n"
"\n"
-"Använd \"git config rebase.missingCommitsCheck\" för att ändra "
-"varningsnivån.\n"
-"Möjliga bettenden är: \"ignore\" (ignorera), \"warn\" (varna), \"error"
-"\" (fel).\n"
+"Använd â€git config rebase.missingCommitsCheck†för att ändra varningsnivÃ¥n.\n"
+"Möjliga bettenden är: â€ignore†(ignorera), â€warn†(varna), â€error†(fel).\n"
"\n"
#, c-format
msgid "%s: 'preserve' superseded by 'merges'"
-msgstr "%s: \"preserve\" har ersatts av \"merges\""
+msgstr "%s: â€preserve†har ersatts av â€mergesâ€"
msgid "gone"
msgstr "försvunnen"
@@ -17964,6 +18784,14 @@ msgid "ahead %d, behind %d"
msgstr "före %d, bakom %d"
#, c-format
+msgid "%%(%.*s) does not take arguments"
+msgstr "%%(%.*s) tar inte argument"
+
+#, c-format
+msgid "unrecognized %%(%.*s) argument: %s"
+msgstr "okänt %%(%.*s)-argument: %s"
+
+#, c-format
msgid "expected format: %%(color:<color>)"
msgstr "förväntat format: %%(color:<color>)"
@@ -17980,40 +18808,36 @@ msgid "Integer value expected refname:rstrip=%s"
msgstr "Heltalsvärde förväntades refname:rstrip=%s"
#, c-format
-msgid "unrecognized %%(%s) argument: %s"
-msgstr "okänt %%(%s)-argument: %s"
+msgid "expected %%(trailers:key=<value>)"
+msgstr "förväntade %%(trailers:key=<värde>)"
#, c-format
-msgid "%%(objecttype) does not take arguments"
-msgstr "%%(objecttype) tar inte argument"
+msgid "unknown %%(trailers) argument: %s"
+msgstr "okänt %%(trailers)-argument: %s"
#, c-format
-msgid "%%(deltabase) does not take arguments"
-msgstr "%%(deltabase) tar inte argument"
+msgid "positive value expected contents:lines=%s"
+msgstr "positivt värde förväntat contents:lines=%s"
#, c-format
-msgid "%%(body) does not take arguments"
-msgstr "%%(body) tar inte argument"
+msgid "argument expected for %s"
+msgstr "argument förväntades för %s"
#, c-format
-msgid "expected %%(trailers:key=<value>)"
-msgstr "förväntade %%(trailers:key=<värde>)"
+msgid "positive value expected %s=%s"
+msgstr "positivt värde förväntat %s=%s"
#, c-format
-msgid "unknown %%(trailers) argument: %s"
-msgstr "okänt %%(trailers)-argument: %s"
+msgid "cannot fully parse %s=%s"
+msgstr "kan inte helt tolka %s=%s"
#, c-format
-msgid "positive value expected contents:lines=%s"
-msgstr "positivt värde förväntat contents:lines=%s"
+msgid "value expected %s="
+msgstr "vädre förväntades %s="
#, c-format
msgid "positive value expected '%s' in %%(%s)"
-msgstr "positivt värde förväntat \"%s\" i %%(%s)"
-
-#, c-format
-msgid "unrecognized email option: %s"
-msgstr "okänd e-postalternativ: %s"
+msgstr "positivt värde förväntat â€%s†i %%(%s)"
#, c-format
msgid "expected format: %%(align:<width>,<position>)"
@@ -18028,12 +18852,16 @@ msgid "unrecognized width:%s"
msgstr "okänd bredd:%s"
#, c-format
+msgid "unrecognized %%(%s) argument: %s"
+msgstr "okänt %%(%s)-argument: %s"
+
+#, c-format
msgid "positive width expected with the %%(align) atom"
msgstr "positiv bredd förväntad med atomen %%(align)"
#, c-format
-msgid "%%(rest) does not take arguments"
-msgstr "%%(rest) tar inte argument"
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "förväntat format: %%(ahead-behind:<incheckning-igt>)"
#, c-format
msgid "malformed field name: %.*s"
@@ -18046,8 +18874,7 @@ msgstr "okänt fältnamn: %.*s"
#, c-format
msgid ""
"not a git repository, but the field '%.*s' requires access to object data"
-msgstr ""
-"inte ett git-arkiv, men fältet \"%.*s\" kräver tillgång till objektdata"
+msgstr "inte ett git-arkiv, men fältet â€%.*s†kräver tillgÃ¥ng till objektdata"
#, c-format
msgid "format: %%(%s) atom used without a %%(%s) atom"
@@ -18081,6 +18908,9 @@ msgstr "kommandot förkastar atom %%(%.*s)"
msgid "--format=%.*s cannot be used with --python, --shell, --tcl"
msgstr "--format=%.*s kan inte användas med --python, --shell, --tcl"
+msgid "failed to run 'describe'"
+msgstr "misslyckades att köra â€describeâ€"
+
#, c-format
msgid "(no branch, rebasing %s)"
msgstr "(ingen gren, ombaserar %s)"
@@ -18091,7 +18921,7 @@ msgstr "(ingen gren, ombaserar frånkopplat HEAD %s)"
#, c-format
msgid "(no branch, bisect started on %s)"
-msgstr "(ingen gren, \"bisect\" startad på %s)"
+msgstr "(ingen gren, â€bisect†startad pÃ¥ %s)"
#, c-format
msgid "(HEAD detached at %s)"
@@ -18114,7 +18944,7 @@ msgstr "parse_object_buffer misslyckades på %s för %s"
#, c-format
msgid "malformed object at '%s'"
-msgstr "felformat objekt vid \"%s\""
+msgstr "felformat objekt vid â€%sâ€"
#, c-format
msgid "ignoring ref with broken name %s"
@@ -18134,7 +18964,7 @@ msgstr "felformat objektnamn %s"
#, c-format
msgid "option `%s' must point to a commit"
-msgstr "flaggan \"%s\" måste peka på en incheckning"
+msgstr "flaggan â€%s†mÃ¥ste peka pÃ¥ en incheckning"
msgid "key"
msgstr "nyckel"
@@ -18142,17 +18972,20 @@ msgstr "nyckel"
msgid "field name to sort on"
msgstr "fältnamn att sortera på"
+msgid "exclude refs which match pattern"
+msgstr "uteslut referenser som motsvarar mönster"
+
#, c-format
msgid "not a reflog: %s"
msgstr "inte en referenslogg: %s"
#, c-format
msgid "no reflog for '%s'"
-msgstr "ingen referenslogg för \"%s\""
+msgstr "ingen referenslogg för â€%sâ€"
#, c-format
msgid "%s does not point to a valid object!"
-msgstr "\"%s\" pekar inte på ett giltigt objekt!"
+msgstr "â€%s†pekar inte pÃ¥ ett giltigt objekt!"
#, c-format
msgid ""
@@ -18167,20 +19000,20 @@ msgid ""
"\n"
"\tgit branch -m <name>\n"
msgstr ""
-"Använder \"%s\" som namn för den inledande grenen. Detta förvalda grennamn\n"
+"Använder â€%s†som namn för den inledande grenen. Detta förvalda grennamn\n"
"kan ändras i framtiden. För att välja vilket namn som ska användas på\n"
"den inledande grenen i alla nya arkiv, och dölja denna varning, kör du:\n"
"\n"
"\tgit config --global init.defaultBranch <namn>\n"
"\n"
-"Namn som ofta används istället för \"master\" är \"main\", \"trunk\" och\n"
-"\"development\". Den nyskapade grenen kan ges nytt namn med kommandot:\n"
+"Namn som ofta används istället för â€master†är â€mainâ€, â€trunk†och\n"
+"â€developmentâ€. Den nyskapade grenen kan ges nytt namn med kommandot:\n"
"\n"
"\tgit branch -m <namn>\n"
#, c-format
msgid "could not retrieve `%s`"
-msgstr "kunde inte hämta \"%s\""
+msgstr "kunde inte hämta â€%sâ€"
#, c-format
msgid "invalid branch name: %s = %s"
@@ -18204,15 +19037,15 @@ msgstr "loggen för %s är tom"
#, c-format
msgid "refusing to update ref with bad name '%s'"
-msgstr "vägrar uppdatera referens med trasigt namn \"%s\""
+msgstr "vägrar uppdatera referens med trasigt namn â€%sâ€"
#, c-format
msgid "update_ref failed for ref '%s': %s"
-msgstr "update_ref misslyckades för referensen \"%s\": %s"
+msgstr "update_ref misslyckades för referensen â€%sâ€: %s"
#, c-format
msgid "multiple updates for ref '%s' not allowed"
-msgstr "flera uppdateringar för referensen \"%s\" tillåts inte"
+msgstr "flera uppdateringar för referensen â€%s†tillÃ¥ts inte"
msgid "ref updates forbidden inside quarantine environment"
msgstr "referensuppdateringar förbjudna i karantänmiljö"
@@ -18222,15 +19055,11 @@ msgstr "referensuppdateringar avbrutna av krok"
#, c-format
msgid "'%s' exists; cannot create '%s'"
-msgstr "\"%s\" finns; kan inte skapa \"%s\""
+msgstr "â€%s†finns; kan inte skapa â€%sâ€"
#, c-format
msgid "cannot process '%s' and '%s' at the same time"
-msgstr "kan inte hantera \"%s\" och \"%s\" samtidigt"
-
-#, c-format
-msgid "could not remove reference %s"
-msgstr "kunde inte ta bort referensen %s"
+msgstr "kan inte hantera â€%s†och â€%s†samtidigt"
#, c-format
msgid "could not delete reference %s: %s"
@@ -18242,11 +19071,11 @@ msgstr "kunde inte ta bort referenser: %s"
#, c-format
msgid "invalid refspec '%s'"
-msgstr "felaktig referensspecifikation: \"%s\""
+msgstr "felaktig referensspecifikation: â€%sâ€"
#, c-format
msgid "invalid quoting in push-option value: '%s'"
-msgstr "felaktig citering på värde för push-option: \"%s\""
+msgstr "felaktig citering pÃ¥ värde för push-option: â€%sâ€"
#, c-format
msgid "%sinfo/refs not valid: is this a git repository?"
@@ -18257,23 +19086,23 @@ msgstr "ogiltigt svar från servern; förväntade tjänst, fick flush-paket"
#, c-format
msgid "invalid server response; got '%s'"
-msgstr "ogiltigt svar från servern; fick \"%s\""
+msgstr "ogiltigt svar frÃ¥n servern; fick â€%sâ€"
#, c-format
msgid "repository '%s' not found"
-msgstr "arkivet \"%s\" hittades inte"
+msgstr "arkivet â€%s†hittades inte"
#, c-format
msgid "Authentication failed for '%s'"
-msgstr "Autentisering misslyckades \"%s\""
+msgstr "Autentisering misslyckades â€%sâ€"
#, c-format
msgid "unable to access '%s' with http.pinnedPubkey configuration: %s"
-msgstr "kan inte nå \"%s\" med http.pinnedPubkey inställt till: %s"
+msgstr "kan inte nÃ¥ â€%s†med http.pinnedPubkey inställt till: %s"
#, c-format
msgid "unable to access '%s': %s"
-msgstr "kan inte komma åt \"%s\": %s"
+msgstr "kan inte komma Ã¥t â€%sâ€: %s"
#, c-format
msgid "redirecting to %s"
@@ -18329,12 +19158,19 @@ msgstr "kan inte hämta med sha1 över smart http"
#, c-format
msgid "protocol error: expected sha/ref, got '%s'"
-msgstr "protokollfel: förväntade sha/ref, fick \"%s\""
+msgstr "protokollfel: förväntade sha/ref, fick â€%sâ€"
#, c-format
msgid "http transport does not support %s"
msgstr "http-transporten stöder inte %s"
+msgid "protocol error: expected '<url> <path>', missing space"
+msgstr "protokollfel: förväntade â€<url> <sökväg>â€, saknar blanksteg"
+
+#, c-format
+msgid "failed to download file at URL '%s'"
+msgstr "misslyckades hämta filen pÃ¥ URL â€%sâ€"
+
msgid "git-http-push failed"
msgstr "git-http-push misslyckades"
@@ -18349,11 +19185,11 @@ msgstr "remote-curl: försökte ta emot utan lokalt arkiv"
#, c-format
msgid "remote-curl: unknown command '%s' from git"
-msgstr "remote-curl: okänt kommando \"%s\" från git"
+msgstr "remote-curl: okänt kommando â€%s†frÃ¥n git"
#, c-format
msgid "config remote shorthand cannot begin with '/': %s"
-msgstr "konfigurerad kortform för fjärr kan inte börja med \"/\": %s"
+msgstr "konfigurerad kortform för fjärr kan inte börja med â€/â€: %s"
msgid "more than one receivepack given, using the first"
msgstr "mer än en receivepack angavs, använder den första"
@@ -18363,11 +19199,11 @@ msgstr "mer än en uploadpack angavs, använder den första"
#, c-format
msgid "unrecognized value transfer.credentialsInUrl: '%s'"
-msgstr "okänt värde transfer.credentialsInUrl: \"%s\""
+msgstr "okänt värde transfer.credentialsInUrl: â€%sâ€"
#, c-format
msgid "URL '%s' uses plaintext credentials"
-msgstr "URL \"%s\" använder inloggningsuppgifter i klartext"
+msgstr "URL â€%s†använder inloggningsuppgifter i klartext"
#, c-format
msgid "Cannot fetch both %s and %s to %s"
@@ -18383,11 +19219,11 @@ msgstr "%s spårar både %s och %s"
#, c-format
msgid "key '%s' of pattern had no '*'"
-msgstr "nyckeln \"%s\" i mönstret innehåller ingen \"*\""
+msgstr "nyckeln â€%s†i mönstret innehÃ¥ller ingen â€*â€"
#, c-format
msgid "value '%s' of pattern has no '*'"
-msgstr "värdet \"%s\" i mönstret innehåller ingen \"*\""
+msgstr "värdet â€%s†i mönstret innehÃ¥ller ingen â€*â€"
#, c-format
msgid "src refspec %s does not match any"
@@ -18414,12 +19250,12 @@ msgid ""
"Neither worked, so we gave up. You must fully qualify the ref."
msgstr ""
"Målet du angav är inte ett komplett referensamn (dvs.,\n"
-"startar med \"refs/\"). Vi försökte gissa vad du menade genom att:\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"
-"- Se om <källan> som sänds (\"%s\")\n"
-" är en referens i \"refs/{heads,tags}/\". Om så lägger vi till\n"
-" motsvarande refs/{heads,tags}/-prefix på fjärrsidan.\n"
+"- Se efter en referens som motsvarar â€%s†pÃ¥ fjärrsidan.\n"
+"- Se om <källan> som sänds (â€%sâ€)\n"
+" är en referens i â€refs/{heads,tags}/â€. Om sÃ¥ lägger vi till\n"
+" motsvarande â€refs/{heads,tags}/â€-prefix pÃ¥ fjärrsidan.\n"
"\n"
"Inget av dem fungerade, så vi gav upp. Ange fullständig referens."
@@ -18431,7 +19267,7 @@ msgid ""
msgstr ""
"<Källa>-delen av ref.spec-en är ett incheckningsobjekt.\n"
"Var det meningen att skapa en ny gren genom att sända\n"
-"till \"%s:refs/heads/%s\"?"
+"till â€%s:refs/heads/%sâ€?"
#, c-format
msgid ""
@@ -18441,7 +19277,7 @@ msgid ""
msgstr ""
"<Källa>-delen av ref.spec-en är ett taggobjekt.\n"
"Var det meningen att skapa en ny tagg genom att sända\n"
-"till \"%s:refs/tags/%s\"?"
+"till â€%s:refs/tags/%sâ€?"
#, c-format
msgid ""
@@ -18451,7 +19287,7 @@ msgid ""
msgstr ""
"<Källa>-delen av ref.spec-en är ett trädobjekt.\n"
"Var det meningen att tagga ett nytt träd genom att sända\n"
-"till \"%s:refs/tags/%s\"?"
+"till â€%s:refs/tags/%sâ€?"
#, c-format
msgid ""
@@ -18461,7 +19297,7 @@ msgid ""
msgstr ""
"<Källa>-delen av ref.spec-en är ett blobobjekt.\n"
"Var det meningen att tagga en ny blob genom att sända\n"
-"till \"%s:refs/tags/%s\"?"
+"till â€%s:refs/tags/%sâ€?"
#, c-format
msgid "%s cannot be resolved to branch"
@@ -18469,48 +19305,48 @@ msgstr "%s kan inte slås upp till en gren"
#, c-format
msgid "unable to delete '%s': remote ref does not exist"
-msgstr "kan inte ta bort \"%s\": fjärreferensen finns inte"
+msgstr "kan inte ta bort â€%sâ€: fjärreferensen finns inte"
#, c-format
msgid "dst refspec %s matches more than one"
-msgstr "fjärr-referensspecifikationen \"%s\" motsvarar mer än en"
+msgstr "fjärr-referensspecifikationen â€%s†motsvarar mer än en"
#, c-format
msgid "dst ref %s receives from more than one src"
-msgstr "fjärr-referensen \"%s\" hämtar från mer än en källa"
+msgstr "fjärr-referensen â€%s†hämtar frÃ¥n mer än en källa"
msgid "HEAD does not point to a branch"
msgstr "HEAD pekar inte på en gren"
#, c-format
msgid "no such branch: '%s'"
-msgstr "okänd gren: \"%s\""
+msgstr "okänd gren: â€%sâ€"
#, c-format
msgid "no upstream configured for branch '%s'"
-msgstr "ingen standarduppström angiven för grenen \"%s\""
+msgstr "ingen standarduppström angiven för grenen â€%sâ€"
#, c-format
msgid "upstream branch '%s' not stored as a remote-tracking branch"
-msgstr "uppströmsgrenen \"%s\" är inte lagrad som en fjärrspårande gren"
+msgstr "uppströmsgrenen â€%s†är inte lagrad som en fjärrspÃ¥rande gren"
#, c-format
msgid "push destination '%s' on remote '%s' has no local tracking branch"
-msgstr "push-målet \"%s\" på fjärren \"%s\" har ingen lokalt spårande gren"
+msgstr "push-mÃ¥let â€%s†pÃ¥ fjärren â€%s†har ingen lokalt spÃ¥rande gren"
#, c-format
msgid "branch '%s' has no remote for pushing"
-msgstr "grenen \"%s\" har ingen fjärr för \"push\""
+msgstr "grenen â€%s†har ingen fjärr för â€pushâ€"
#, c-format
msgid "push refspecs for '%s' do not include '%s'"
-msgstr "\"push\"-referensspecifikation för \"%s\" innehåller inte \"%s\""
+msgstr "â€pushâ€-referensspecifikation för â€%s†innehÃ¥ller inte â€%sâ€"
msgid "push has no destination (push.default is 'nothing')"
-msgstr "\"push\" har inget mål (push.default är \"ingenting\")"
+msgstr "â€push†har inget mÃ¥l (push.default är â€ingentingâ€)"
msgid "cannot resolve 'simple' push to a single destination"
-msgstr "\"enkel push\" motsvarar flera olika mål"
+msgstr "â€enkel push†motsvarar flera olika mÃ¥l"
#, c-format
msgid "couldn't find remote ref %s"
@@ -18518,47 +19354,47 @@ msgstr "Kunde inte hitta fjärr-referensen %s"
#, c-format
msgid "* Ignoring funny ref '%s' locally"
-msgstr "* Ignorerar märklig referens \"%s\" lokalt"
+msgstr "* Ignorerar märklig referens â€%s†lokalt"
#, c-format
msgid "Your branch is based on '%s', but the upstream is gone.\n"
-msgstr "Din gren är baserad på \"%s\", men den har försvunnit uppströms.\n"
+msgstr "Din gren är baserad pÃ¥ â€%sâ€, men den har försvunnit uppströms.\n"
msgid " (use \"git branch --unset-upstream\" to fixup)\n"
-msgstr " (använd \"git branch --unset-upstream\" för att rätta)\n"
+msgstr " (använd â€git branch --unset-upstream†för att rätta)\n"
#, c-format
msgid "Your branch is up to date with '%s'.\n"
-msgstr "Din gren är à jour med \"%s\".\n"
+msgstr "Din gren är à jour med â€%sâ€.\n"
#, c-format
msgid "Your branch and '%s' refer to different commits.\n"
-msgstr "Din gren och \"%s\" pekar på olika incheckningar.\n"
+msgstr "Din gren och â€%s†pekar pÃ¥ olika incheckningar.\n"
#, c-format
msgid " (use \"%s\" for details)\n"
-msgstr " (använd \"%s\" för detaljer)\n"
+msgstr " (använd â€%s†för detaljer)\n"
#, c-format
msgid "Your branch is ahead of '%s' by %d commit.\n"
msgid_plural "Your branch is ahead of '%s' by %d commits.\n"
-msgstr[0] "Din gren ligger före \"%s\" med %d incheckning.\n"
-msgstr[1] "Din gren ligger före \"%s\" med %d incheckningar.\n"
+msgstr[0] "Din gren ligger före â€%s†med %d incheckning.\n"
+msgstr[1] "Din gren ligger före â€%s†med %d incheckningar.\n"
msgid " (use \"git push\" to publish your local commits)\n"
-msgstr " (använd \"git push\" för att publicera dina lokala incheckningar)\n"
+msgstr " (använd â€git push†för att publicera dina lokala incheckningar)\n"
#, c-format
msgid "Your branch is behind '%s' by %d commit, and can be fast-forwarded.\n"
msgid_plural ""
"Your branch is behind '%s' by %d commits, and can be fast-forwarded.\n"
msgstr[0] ""
-"Din gren ligger efter \"%s\" med %d incheckning, och kan snabbspolas.\n"
+"Din gren ligger efter â€%s†med %d incheckning, och kan snabbspolas.\n"
msgstr[1] ""
-"Din gren ligger efter \"%s\" med %d incheckningar, och kan snabbspolas.\n"
+"Din gren ligger efter â€%s†med %d incheckningar, och kan snabbspolas.\n"
msgid " (use \"git pull\" to update your local branch)\n"
-msgstr " (använd \"git pull\" för att uppdatera din lokala gren)\n"
+msgstr " (använd â€git pull†för att uppdatera din lokala gren)\n"
#, c-format
msgid ""
@@ -18568,22 +19404,23 @@ msgid_plural ""
"Your branch and '%s' have diverged,\n"
"and have %d and %d different commits each, respectively.\n"
msgstr[0] ""
-"Din gren och \"%s\" har divergerat,\n"
+"Din gren och â€%s†har divergerat,\n"
"och har %d respektive %d olika incheckning.\n"
msgstr[1] ""
-"Din gren och \"%s\" har divergerat,\n"
+"Din gren och â€%s†har divergerat,\n"
"och har %d respektive %d olika incheckningar.\n"
-msgid " (use \"git pull\" to merge the remote branch into yours)\n"
-msgstr " (använd \"git pull\" för att slå ihop fjärrgrenen med din egen)\n"
+msgid ""
+" (use \"git pull\" if you want to integrate the remote branch with yours)\n"
+msgstr " (använd â€git pull†om du vill integrera fjärrgrenen med din egen)\n"
#, c-format
msgid "cannot parse expected object name '%s'"
-msgstr "kan inte tolka förväntat objektnamn \"%s\""
+msgstr "kan inte tolka förväntat objektnamn â€%sâ€"
#, c-format
msgid "cannot strip one component off url '%s'"
-msgstr "kan inte ta bort en komponent från url:en \"%s\""
+msgstr "kan inte ta bort en komponent frÃ¥n url:en â€%sâ€"
#, c-format
msgid "bad replace ref name: %s"
@@ -18605,59 +19442,55 @@ msgstr "kunde inte skriva rerere-post"
#, c-format
msgid "there were errors while writing '%s' (%s)"
-msgstr "fel vid skrivning av \"%s\" (%s)"
+msgstr "fel vid skrivning av â€%s†(%s)"
#, c-format
msgid "could not parse conflict hunks in '%s'"
-msgstr "kunde inte tolka konflikt-stycket i \"%s\""
+msgstr "kunde inte tolka konflikt-stycket i â€%sâ€"
#, c-format
msgid "failed utime() on '%s'"
-msgstr "\"utime()\" misslyckades på \"%s\""
+msgstr "â€utime()†misslyckades pÃ¥ â€%sâ€"
#, c-format
msgid "writing '%s' failed"
-msgstr "misslyckades skriva \"%s\""
+msgstr "misslyckades skriva â€%sâ€"
#, c-format
msgid "Staged '%s' using previous resolution."
-msgstr "Köade \"%s\" med sparad lösning."
+msgstr "Köade â€%s†med sparad lösning."
#, c-format
msgid "Recorded resolution for '%s'."
-msgstr "Sparade lösning för \"%s\"."
+msgstr "Sparade lösning för â€%sâ€."
#, c-format
msgid "Resolved '%s' using previous resolution."
-msgstr "Löste \"%s\" med tidigare lösning."
+msgstr "Löste â€%s†med tidigare lösning."
#, c-format
msgid "cannot unlink stray '%s'"
-msgstr "kan inte ta bort lös länk \"%s\""
+msgstr "kan inte ta bort lös länk â€%sâ€"
#, c-format
msgid "Recorded preimage for '%s'"
-msgstr "Sparade förhandsbild för \"%s\""
+msgstr "Sparade förhandsbild för â€%sâ€"
#, c-format
msgid "failed to update conflicted state in '%s'"
-msgstr "misslyckades uppdatera tillstånd för sammanslagningsproblem i \"%s\""
+msgstr "misslyckades uppdatera tillstÃ¥nd för sammanslagningsproblem i â€%sâ€"
#, c-format
msgid "no remembered resolution for '%s'"
-msgstr "inget sparat sammanslagningsresultat för \"%s\""
-
-#, c-format
-msgid "cannot unlink '%s'"
-msgstr "kan inte ta bort länken \"%s\""
+msgstr "inget sparat sammanslagningsresultat för â€%sâ€"
#, c-format
msgid "Updated preimage for '%s'"
-msgstr "Uppdaterade förhandsbild för \"%s\""
+msgstr "Uppdaterade förhandsbild för â€%sâ€"
#, c-format
msgid "Forgot resolution for '%s'\n"
-msgstr "Glömde lösning för \"%s\"\n"
+msgstr "Glömde lösning för â€%sâ€\n"
msgid "unable to open rr-cache directory"
msgstr "kan inte uppdatera katalogen rr-cache"
@@ -18672,15 +19505,34 @@ msgstr "kunde inte bestämma HEAD-revision"
msgid "failed to find tree of %s"
msgstr "kunde inte 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"
+
+msgid "--exclude-hidden= passed more than once"
+msgstr "--exclude-hidden= angavs mer än en gång"
+
+#, c-format
+msgid "resolve-undo records `%s` which is missing"
+msgstr "resolve-undo registrerar â€%s†som saknas"
+
+#, c-format
+msgid "could not get commit for ancestry-path argument %s"
+msgstr "kunde inte hämta incheckning för â€ancestry-pathâ€-argumentet %s"
+
msgid "--unpacked=<packfile> no longer supported"
msgstr "--unpacked=<paketfil> stöds inte längre"
+#, c-format
+msgid "invalid option '%s' in --stdin mode"
+msgstr "ogiltig flagga â€%s†i --stdin-läge"
+
msgid "your current branch appears to be broken"
msgstr "din nuvarande gren verkar vara trasig"
#, c-format
msgid "your current branch '%s' does not have any commits yet"
-msgstr "din nuvarande gren \"%s\" innehåller ännu inte några incheckningar"
+msgstr "din nuvarande gren â€%s†innehÃ¥ller ännu inte nÃ¥gra incheckningar"
msgid "object filtering requires --objects"
msgstr "objektfiltrering kräver --objects"
@@ -18692,6 +19544,204 @@ msgstr "-L stöder ännu inte andra diff-format än -p och -s"
msgid "cannot create async thread: %s"
msgstr "kan inte skapa asynkron tråd: %s"
+#, c-format
+msgid "'%s' does not exist"
+msgstr "â€%s†finns inte"
+
+#, c-format
+msgid "could not switch to '%s'"
+msgstr "kunde inte växla till â€%sâ€"
+
+msgid "need a working directory"
+msgstr "behöver en arbetskatalog"
+
+msgid "Scalar enlistments require a worktree"
+msgstr "Scalar-enrolleringar kräver en arbetskatalog"
+
+#, c-format
+msgid "could not configure %s=%s"
+msgstr "kunde inte ställa in %s=%s"
+
+msgid "could not configure log.excludeDecoration"
+msgstr "kunde inte ställa in log.excludeDecoration"
+
+msgid "could not add enlistment"
+msgstr "kunde inte lägga till enrollering"
+
+msgid "could not set recommended config"
+msgstr "kan inte ange rekommenderad konfiguration"
+
+msgid "could not turn on maintenance"
+msgstr "kunde inte aktivera underhåll"
+
+msgid "could not start the FSMonitor daemon"
+msgstr "kunde inte starta FSMonitor-server"
+
+msgid "could not turn off maintenance"
+msgstr "kunde inte slå av underhåll"
+
+msgid "could not remove enlistment"
+msgstr "kunde inte ta bort enrollering"
+
+#, c-format
+msgid "remote HEAD is not a branch: '%.*s'"
+msgstr "HEAD hos fjärren är inte en gren: â€%.*sâ€"
+
+msgid "failed to get default branch name from remote; using local default"
+msgstr ""
+"misslyckades hämta namn på standardgren för fjärr; använder lokalt förval"
+
+msgid "failed to get default branch name"
+msgstr "misslyckades hämta namn på standardgren"
+
+msgid "failed to unregister repository"
+msgstr "misslyckades avregistrera arkivet"
+
+msgid "failed to stop the FSMonitor daemon"
+msgstr "misslyckades stoppa FSMonitor-server"
+
+msgid "failed to delete enlistment directory"
+msgstr "misslyckades ta bort enrolleringskatalogen"
+
+msgid "branch to checkout after clone"
+msgstr "gren att checka ut efter kloning"
+
+msgid "when cloning, create full working directory"
+msgstr "skapa komplett arbetskatalog vid kloning"
+
+msgid "only download metadata for the branch that will be checked out"
+msgstr "hämta endast metadata för grenen som skall checkas ut"
+
+msgid "create repository within 'src' directory"
+msgstr "skapa arkiv inuti katalogen â€srcâ€"
+
+msgid ""
+"scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n"
+"\t[--[no-]src] <url> [<enlistment>]"
+msgstr ""
+"scalar clone [--single-branch] [--branch <huvudgren>] [--full-clone]\n"
+"\t[--[no-]src] <url> [<enrollering>]"
+
+#, c-format
+msgid "cannot deduce worktree name from '%s'"
+msgstr "Kan inte härleda arbetsträdsnamn frÃ¥n â€%sâ€"
+
+#, c-format
+msgid "directory '%s' exists already"
+msgstr "katalogen â€%s†finns redan"
+
+#, c-format
+msgid "failed to get default branch for '%s'"
+msgstr "misslyckades hämta standardgren för â€%sâ€"
+
+#, c-format
+msgid "could not configure remote in '%s'"
+msgstr "kunde inte ställa in fjärr i â€%sâ€"
+
+#, c-format
+msgid "could not configure '%s'"
+msgstr "kunde inte ställa in â€%sâ€"
+
+msgid "partial clone failed; attempting full clone"
+msgstr "delvis klon misslyckades; försöker med fullständig klon"
+
+msgid "could not configure for full clone"
+msgstr "kunde inte ställa in för komplett klon"
+
+msgid "scalar diagnose [<enlistment>]"
+msgstr "scalar diagnose [<enrollering>]"
+
+msgid "`scalar list` does not take arguments"
+msgstr "â€scalar list†tar inte argument"
+
+msgid "scalar register [<enlistment>]"
+msgstr "scalar register [<enrollering>]"
+
+msgid "reconfigure all registered enlistments"
+msgstr "konfigurera alla registrerade enrolleringar på nytt"
+
+msgid "scalar reconfigure [--all | <enlistment>]"
+msgstr "scalar reconfigure [--all | <enrollering>]"
+
+msgid "--all or <enlistment>, but not both"
+msgstr "--all eller <enrollering>, men inte bägge"
+
+#, c-format
+msgid "could not remove stale scalar.repo '%s'"
+msgstr "kunde inte ta bort gammal scalar.repo â€%sâ€"
+
+#, c-format
+msgid "removed stale scalar.repo '%s'"
+msgstr "tog bort gammal scalar.repo â€%sâ€"
+
+#, c-format
+msgid "repository at '%s' has different owner"
+msgstr "arkivet â€%s†har en annan ägare"
+
+#, c-format
+msgid "repository at '%s' has a format issue"
+msgstr "arkivet â€%s†har ett formatproblem"
+
+#, c-format
+msgid "repository not found in '%s'"
+msgstr "arkivet hittades inte i â€%sâ€"
+
+#, c-format
+msgid ""
+"to unregister this repository from Scalar, run\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+msgstr ""
+"för att avregistrera arkivet från Scalar, kör\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+
+msgid ""
+"scalar run <task> [<enlistment>]\n"
+"Tasks:\n"
+msgstr ""
+"scalar run <uppgift> [<enrollering>]\n"
+"Uppgifter:\n"
+
+#, c-format
+msgid "no such task: '%s'"
+msgstr "okänd uppgift: â€%sâ€"
+
+msgid "scalar unregister [<enlistment>]"
+msgstr "scalar unregister [<enrollering>]"
+
+msgid "scalar delete <enlistment>"
+msgstr "scalar delete <enrollering>"
+
+msgid "refusing to delete current working directory"
+msgstr "vägrar ta bort aktuell arbetskatalog"
+
+msgid "include Git version"
+msgstr "ta med Git-version"
+
+msgid "include Git's build options"
+msgstr "ta med Gits byggflaggor"
+
+msgid "scalar verbose [-v | --verbose] [--build-options]"
+msgstr "scalar verbose [-v | --verbose] [--build-options]"
+
+msgid "-C requires a <directory>"
+msgstr "-C kräver en <katalog>"
+
+#, c-format
+msgid "could not change to '%s'"
+msgstr "kunde inte byta till â€%sâ€"
+
+msgid "-c requires a <key>=<value> argument"
+msgstr "-c kräver ett argument på formen <nyckel>=<värde>"
+
+msgid ""
+"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
+"\n"
+"Commands:\n"
+msgstr ""
+"scalar [-C <katalog>] [-c <nyckel>=<värde>] <kommando> [<flaggor>]\n"
+"\n"
+"Kommandon:\n"
+
msgid "unexpected flush packet while reading remote unpack status"
msgstr "oväntat flush-paket vid läsning av fjärruppackningsstatus"
@@ -18733,11 +19783,11 @@ msgstr "mottagarsidan stöder inte push-flaggor"
#, c-format
msgid "invalid commit message cleanup mode '%s'"
-msgstr "felaktigt incheckningsmeddelandestädningsläge \"%s\""
+msgstr "felaktigt incheckningsmeddelandestädningsläge â€%sâ€"
#, c-format
msgid "could not delete '%s'"
-msgstr "kunde inte ta bort \"%s\""
+msgstr "kunde inte ta bort â€%sâ€"
msgid "revert"
msgstr "revert"
@@ -18757,7 +19807,7 @@ msgid ""
"with 'git add <paths>' or 'git rm <paths>'"
msgstr ""
"efter att ha löst konflikterna, markera de rättade sökvägarna\n"
-"med \"git add <sökvägar>\" eller \"git rm <sökvägar>\""
+"med â€git add <sökvägar>†eller â€git rm <sökvägar>â€"
msgid ""
"After resolving the conflicts, mark them with\n"
@@ -18768,11 +19818,11 @@ msgid ""
"run \"git cherry-pick --abort\"."
msgstr ""
"Efter att ha löst konflikterna, märk dem med\n"
-"\"git add/rm <sökvägsangivelse>\" och kör sedan\n"
-"\"git cherry-pick --continue\".\n"
-"Du kan hoppa över incheckningen istället med \"git cherry-pick --skip\"\n"
-"För att avbryta och återgå till där du var före \"git cherry-pick\",\n"
-"kör \"git cherry-pick --abort\"."
+"â€git add/rm <sökvägsangivelse>†och kör sedan\n"
+"â€git cherry-pick --continueâ€.\n"
+"Du kan hoppa över incheckningen istället med â€git cherry-pick --skipâ€\n"
+"För att avbryta och Ã¥tergÃ¥ till där du var före â€git cherry-pickâ€,\n"
+"kör â€git cherry-pick --abortâ€."
msgid ""
"After resolving the conflicts, mark them with\n"
@@ -18783,38 +19833,30 @@ msgid ""
"run \"git revert --abort\"."
msgstr ""
"Efter att ha löst konflikterna, märk dem med\n"
-"\"git add/rm <sökvägsangivelse>\" och kör sedan\n"
-"\"git revert --continue\".\n"
-"Du kan hoppa över incheckningen istället med \"git revert --skip\"\n"
-"För att avbryta och återgå till där du var före \"git revert\",\n"
-"kör \"git revert --abort\"."
+"â€git add/rm <sökvägsangivelse>†och kör sedan\n"
+"â€git revert --continueâ€.\n"
+"Du kan hoppa över incheckningen istället med â€git revert --skipâ€\n"
+"För att avbryta och Ã¥tergÃ¥ till där du var före â€git revertâ€,\n"
+"kör â€git revert --abortâ€."
#, c-format
msgid "could not lock '%s'"
-msgstr "kunde inte låsa \"%s\""
-
-#, c-format
-msgid "could not write to '%s'"
-msgstr "kunde inte skriva till \"%s\""
+msgstr "kunde inte lÃ¥sa â€%sâ€"
#, c-format
msgid "could not write eol to '%s'"
-msgstr "kunde inte skriva radslut till \"%s\""
+msgstr "kunde inte skriva radslut till â€%sâ€"
#, c-format
msgid "failed to finalize '%s'"
-msgstr "misslyckades färdigställa \"%s\""
+msgstr "misslyckades färdigställa â€%sâ€"
#, c-format
msgid "your local changes would be overwritten by %s."
msgstr "dina lokala ändringar skulle skrivas över av %s."
msgid "commit your changes or stash them to proceed."
-msgstr "checka in dina ändringar eller använd \"stash\" för att fortsätta."
-
-#, c-format
-msgid "%s: fast-forward"
-msgstr "%s: snabbspola"
+msgstr "checka in dina ändringar eller använd â€stash†för att fortsätta."
#. TRANSLATORS: %s will be "revert", "cherry-pick" or
#. "rebase".
@@ -18831,33 +19873,33 @@ msgstr "kunde inte bestämma HEAD:s incheckning"
#, c-format
msgid "no key present in '%.*s'"
-msgstr "ingen nyckel i \"%.*s\""
+msgstr "ingen nyckel i â€%.*sâ€"
#, c-format
msgid "unable to dequote value of '%s'"
-msgstr "kan inte ta bort citering av värdet \"%s\""
+msgstr "kan inte ta bort citering av värdet â€%sâ€"
msgid "'GIT_AUTHOR_NAME' already given"
-msgstr "\"GIT_AUTHOR_NAME\" har redan angivits"
+msgstr "â€GIT_AUTHOR_NAME†har redan angivits"
msgid "'GIT_AUTHOR_EMAIL' already given"
-msgstr "\"GIT_AUTHOR_EMAIL\" har redan angivits"
+msgstr "â€GIT_AUTHOR_EMAIL†har redan angivits"
msgid "'GIT_AUTHOR_DATE' already given"
-msgstr "\"GIT_AUTHOR_DATE\" har redan angivits"
+msgstr "â€GIT_AUTHOR_DATE†har redan angivits"
#, c-format
msgid "unknown variable '%s'"
-msgstr "okänd variabel \"%s\""
+msgstr "okänd variabel â€%sâ€"
msgid "missing 'GIT_AUTHOR_NAME'"
-msgstr "\"GIT_AUTHOR_NAME\" saknas"
+msgstr "â€GIT_AUTHOR_NAME†saknas"
msgid "missing 'GIT_AUTHOR_EMAIL'"
-msgstr "\"GIT_AUTHOR_EMAIL\" saknas"
+msgstr "â€GIT_AUTHOR_EMAIL†saknas"
msgid "missing 'GIT_AUTHOR_DATE'"
-msgstr "\"GIT_AUTHOR_DATE\" saknas"
+msgstr "â€GIT_AUTHOR_DATE†saknas"
#, c-format
msgid ""
@@ -18888,7 +19930,7 @@ msgstr ""
" git rebase --continue\n"
msgid "'prepare-commit-msg' hook failed"
-msgstr "kroken \"prepare-commit-msg\" misslyckades"
+msgstr "kroken â€prepare-commit-msg†misslyckades"
msgid ""
"Your name and email address were configured automatically based\n"
@@ -18967,11 +20009,11 @@ msgstr "kunde inte tolka incheckningens författare"
#, c-format
msgid "unable to read commit message from '%s'"
-msgstr "kunde inte läsa incheckningsmeddelande från \"%s\""
+msgstr "kunde inte läsa incheckningsmeddelande frÃ¥n â€%sâ€"
#, c-format
msgid "invalid author identity '%s'"
-msgstr "ogiltig författar-identitet \"%s\""
+msgstr "ogiltig författar-identitet â€%sâ€"
msgid "corrupt author: missing date information"
msgstr "trasig författare: saknar datuminformation"
@@ -19012,7 +20054,7 @@ msgstr "Det här är en kombination av %d incheckningar."
#, c-format
msgid "cannot write '%s'"
-msgstr "kan inte skriva \"%s\""
+msgstr "kan inte skriva â€%sâ€"
msgid "need a HEAD to fixup"
msgstr "behöver en HEAD-incheckning att rätta"
@@ -19031,7 +20073,7 @@ msgid "your index file is unmerged."
msgstr "din indexfil har inte slagits ihop."
msgid "cannot fixup root commit"
-msgstr "kan inte göra \"fixup\" på rotincheckning"
+msgstr "kan inte göra â€fixup†pÃ¥ rotincheckning"
#, c-format
msgid "commit %s is a merge but no -m option was given."
@@ -19052,10 +20094,6 @@ msgid "%s: cannot parse parent commit %s"
msgstr "%s: kan inte tolka föräldraincheckningen %s"
#, c-format
-msgid "could not rename '%s' to '%s'"
-msgstr "kunde inte byta namn på \"%s\" till \"%s\""
-
-#, c-format
msgid "could not revert %s... %s"
msgstr "kunde inte ångra %s... %s"
@@ -19076,8 +20114,24 @@ msgid "git %s: failed to refresh the index"
msgstr "git %s: misslyckades uppdatera indexet"
#, c-format
+msgid "'%s' is not a valid label"
+msgstr "â€%s†är inte en giltig etikett"
+
+#, c-format
+msgid "'%s' is not a valid refname"
+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"
+
+#, c-format
+msgid "invalid command '%.*s'"
+msgstr "ogiltigt kommando â€%.*sâ€"
+
+#, c-format
msgid "%s does not accept arguments: '%s'"
-msgstr "%s tar inte argument: \"%s\""
+msgstr "%s tar inte argument: â€%sâ€"
#, c-format
msgid "missing arguments for %s"
@@ -19085,7 +20139,7 @@ msgstr "argument saknas för %s"
#, c-format
msgid "could not parse '%s'"
-msgstr "kunde inte tolka \"%s\""
+msgstr "kunde inte tolka â€%sâ€"
#, c-format
msgid "invalid line %d: %.*s"
@@ -19093,63 +20147,60 @@ msgstr "ogiltig rad %d: %.*s"
#, c-format
msgid "cannot '%s' without a previous commit"
-msgstr "kan inte utföra \"%s\" utan en föregående incheckning"
+msgstr "kan inte utföra â€%s†utan en föregÃ¥ende incheckning"
msgid "cancelling a cherry picking in progress"
-msgstr "avbryter pågående \"cherry-pick\""
+msgstr "avbryter pÃ¥gÃ¥ende â€cherry-pickâ€"
msgid "cancelling a revert in progress"
-msgstr "avbryter pågående \"revert\""
+msgstr "avbryter pÃ¥gÃ¥ende â€revertâ€"
msgid "please fix this using 'git rebase --edit-todo'."
-msgstr "rätta det med \"git rebase --edit-todo\"."
+msgstr "rätta det med â€git rebase --edit-todoâ€."
#, c-format
msgid "unusable instruction sheet: '%s'"
-msgstr "oanvändbart manus: \"%s\""
+msgstr "oanvändbart manus: â€%sâ€"
msgid "no commits parsed."
msgstr "inga incheckningar lästes."
msgid "cannot cherry-pick during a revert."
-msgstr "kan inte utföra \"cherry-pick\" under en \"revert\"."
+msgstr "kan inte utföra â€cherry-pick†under en â€revertâ€."
msgid "cannot revert during a cherry-pick."
-msgstr "kan inte utföra \"revert\" under en \"cherry-pick\"."
+msgstr "kan inte utföra â€revert†under en â€cherry-pickâ€."
msgid "unusable squash-onto"
msgstr "oanvändbar squash-onto"
#, c-format
msgid "malformed options sheet: '%s'"
-msgstr "trasigt manus: \"%s\""
+msgstr "trasigt manus: â€%sâ€"
msgid "empty commit set passed"
msgstr "den angivna uppsättningen incheckningar är tom"
msgid "revert is already in progress"
-msgstr "en \"revert\" pågår redan"
+msgstr "en â€revert†pÃ¥gÃ¥r redan"
#, c-format
msgid "try \"git revert (--continue | %s--abort | --quit)\""
-msgstr "testa \"git revert (--continue | %s--abort | --quit)\""
+msgstr "testa â€git revert (--continue | %s--abort | --quit)â€"
msgid "cherry-pick is already in progress"
-msgstr "en \"cherry-pick\" pågår redan"
+msgstr "en â€cherry-pick†pÃ¥gÃ¥r redan"
#, c-format
msgid "try \"git cherry-pick (--continue | %s--abort | --quit)\""
-msgstr "testa \"git cherry-pick (--continue | %s--abort | --quit)\""
+msgstr "testa â€git cherry-pick (--continue | %s--abort | --quit)â€"
#, c-format
msgid "could not create sequencer directory '%s'"
-msgstr "kunde inte skapa \"sequencer\"-katalogen \"%s\""
-
-msgid "could not lock HEAD"
-msgstr "kunde inte låsa HEAD"
+msgstr "kunde inte skapa â€sequencerâ€-katalogen â€%sâ€"
msgid "no cherry-pick or revert in progress"
-msgstr "ingen \"cherry-pick\" eller \"revert\" pågår"
+msgstr "ingen â€cherry-pick†eller â€revert†pÃ¥gÃ¥r"
msgid "cannot resolve HEAD"
msgstr "kan inte bestämma HEAD"
@@ -19159,14 +20210,14 @@ msgstr "kan inte avbryta från en gren som ännu inte är född"
#, c-format
msgid "cannot read '%s': %s"
-msgstr "kan inte läsa \"%s\": %s"
+msgstr "kan inte läsa â€%sâ€: %s"
msgid "unexpected end of file"
msgstr "oväntat filslut"
#, c-format
msgid "stored pre-cherry-pick HEAD file '%s' is corrupt"
-msgstr "sparad HEAD-fil från före \"cherry-pick\", \"%s\", är trasig"
+msgstr "sparad HEAD-fil frÃ¥n före â€cherry-pickâ€, â€%sâ€, är trasig"
msgid "You seem to have moved HEAD. Not rewinding, check your HEAD!"
msgstr ""
@@ -19174,10 +20225,10 @@ msgstr ""
"Spolar inte tillbaka, kontrollera HEAD!"
msgid "no revert in progress"
-msgstr "ingen \"revers\" pågår"
+msgstr "ingen â€revert†pÃ¥gÃ¥r"
msgid "no cherry-pick in progress"
-msgstr "ingen \"cherry-pick\" pågår"
+msgstr "ingen â€cherry-pick†pÃ¥gÃ¥r"
msgid "failed to skip the commit"
msgstr "kunde inte hoppa över incheckningen"
@@ -19191,14 +20242,14 @@ msgid ""
"try \"git %s --continue\""
msgstr ""
"har du redan checkat in?\n"
-"testa \"git %s --continue\""
+"testa â€git %s --continueâ€"
msgid "cannot read HEAD"
msgstr "kan inte läsa HEAD"
#, c-format
msgid "unable to copy '%s' to '%s'"
-msgstr "kan inte kopiera in \"%s\" till \"%s\""
+msgstr "kan inte kopiera in â€%s†till â€%sâ€"
#, c-format
msgid ""
@@ -19244,28 +20295,32 @@ msgstr ""
"\tgit rebase --continue\n"
"\n"
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "och gjorde ändringar till indexet och/eller arbetskatalogen\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "och gjorde ändringar till indexet och/eller arbetskatalogen.\n"
#, c-format
msgid ""
"execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
"Commit or stash your changes, and then run\n"
"\n"
" git rebase --continue\n"
"\n"
msgstr ""
"körningen lyckades: %s\n"
-"men lämnade kvar ändringar i indexet och/eller arbetskatalogen\n"
-"Checka in eller utför \"stash\" på ändringarna och kör sedan\n"
+"men lämnade kvar ändringar i indexet och/eller arbetskatalogen.\n"
+"Checka in eller utför â€stash†pÃ¥ ändringarna och kör sedan\n"
"\n"
"\tgit rebase --continue\n"
"\n"
#, c-format
msgid "illegal label name: '%.*s'"
-msgstr "ogiltigt etikettnamn: \"%.*s\""
+msgstr "ogiltigt etikettnamn: â€%.*sâ€"
+
+#, c-format
+msgid "could not resolve '%s'"
+msgstr "kunde inte upplösa â€%sâ€"
msgid "writing fake root commit"
msgstr "skriver fejkad rotincheckning"
@@ -19273,52 +20328,69 @@ msgstr "skriver fejkad rotincheckning"
msgid "writing squash-onto"
msgstr "skriver squash-onto"
-#, c-format
-msgid "could not resolve '%s'"
-msgstr "kunde inte upplösa \"%s\""
-
msgid "cannot merge without a current revision"
msgstr "kan inte slå ihop utan en aktuell incheckning"
#, c-format
msgid "unable to parse '%.*s'"
-msgstr "kan inte tolka \"%.*s\""
+msgstr "kan inte tolka â€%.*sâ€"
#, c-format
msgid "nothing to merge: '%.*s'"
-msgstr "inget att slå samman: \"%.*s\""
+msgstr "inget att slÃ¥ samman: â€%.*sâ€"
msgid "octopus merge cannot be executed on top of a [new root]"
-msgstr "\"octopus\"-sammanslagning kan inte köras ovanpå en [ny rot]"
+msgstr "â€octopusâ€-sammanslagning kan inte köras ovanpÃ¥ en [ny rot]"
#, c-format
msgid "could not get commit message of '%s'"
-msgstr "kunde inte läsa incheckningsmeddelande för \"%s\""
+msgstr "kunde inte läsa incheckningsmeddelande för â€%sâ€"
#, c-format
msgid "could not even attempt to merge '%.*s'"
-msgstr "kunde inte ens försöka slå ihop \"%.*s\""
+msgstr "kunde inte ens försöka slÃ¥ ihop â€%.*sâ€"
msgid "merge: Unable to write new index file"
msgstr "sammanslagning: Kunde inte skriva ny indexfil"
+#, c-format
+msgid ""
+"another 'rebase' process appears to be running; '%s.lock' already exists"
+msgstr "en annan â€rebaseâ€-process verkar vara aktiv; â€%s.lock†finns redan"
+
+#, c-format
+msgid ""
+"Updated the following refs with %s:\n"
+"%s"
+msgstr ""
+"Uppdaterade följande referenser med %s:\n"
+"%s"
+
+#, c-format
+msgid ""
+"Failed to update the following refs with %s:\n"
+"%s"
+msgstr ""
+"Misslyckades uppdatera följande referenser med %s:\n"
+"%s"
+
msgid "Cannot autostash"
-msgstr "Kan inte utföra \"autostash\""
+msgstr "Kan inte utföra â€autostashâ€"
#, c-format
msgid "Unexpected stash response: '%s'"
-msgstr "Oväntat svar från stash: \"%s\""
+msgstr "Oväntat svar frÃ¥n stash: â€%sâ€"
#, c-format
msgid "Could not create directory for '%s'"
-msgstr "Kunde inte skapa katalog för \"%s\""
+msgstr "Kunde inte skapa katalog för â€%sâ€"
#, c-format
msgid "Created autostash: %s\n"
msgstr "Skapade autostash: %s\n"
msgid "could not reset --hard"
-msgstr "kunde inte utföra \"reset --hard\""
+msgstr "kunde inte utföra â€reset --hardâ€"
#, c-format
msgid "Applied autostash.\n"
@@ -19336,7 +20408,7 @@ msgid ""
msgstr ""
"%s\n"
"Dina ändringar är säkra i stashen.\n"
-"Du kan när som helst använda \"git stash pop\" eller \"git stash drop\".\n"
+"Du kan när som helst använda â€git stash pop†eller â€git stash dropâ€.\n"
msgid "Applying autostash resulted in conflicts."
msgstr "Tillämpning av autostash gav konflikter."
@@ -19344,6 +20416,9 @@ msgstr "Tillämpning av autostash gav konflikter."
msgid "Autostash exists; creating a new stash entry."
msgstr "Autostash finns; skapar ny stash-post."
+msgid "autostash reference is a symref"
+msgstr "autostash-referensen är en symbolisk referens"
+
msgid "could not detach HEAD"
msgstr "kunde inte koppla från HEAD"
@@ -19376,14 +20451,14 @@ msgstr ""
" git rebase --continue\n"
#, c-format
-msgid "Rebasing (%d/%d)%s"
-msgstr "Ombaserar (%d/%d)%s"
-
-#, c-format
msgid "Stopped at %s... %.*s\n"
msgstr "Stoppade på %s... %.*s\n"
#, c-format
+msgid "Rebasing (%d/%d)%s"
+msgstr "Ombaserar (%d/%d)%s"
+
+#, c-format
msgid "unknown command %d"
msgstr "okänt kommando %d"
@@ -19391,7 +20466,7 @@ msgid "could not read orig-head"
msgstr "kunde inte läsa orig-head"
msgid "could not read 'onto'"
-msgstr "kunde inte läsa \"onto\""
+msgstr "kunde inte läsa â€ontoâ€"
#, c-format
msgid "could not update HEAD to %s"
@@ -19409,11 +20484,11 @@ msgstr "kan inte lägga till incheckning som inte finns"
#, c-format
msgid "invalid file: '%s'"
-msgstr "ogiltig fil: \"%s\""
+msgstr "ogiltig fil: â€%sâ€"
#, c-format
msgid "invalid contents: '%s'"
-msgstr "ogiltigt innehåll: \"%s\""
+msgstr "ogiltigt innehÃ¥ll: â€%sâ€"
msgid ""
"\n"
@@ -19422,11 +20497,11 @@ msgid ""
msgstr ""
"\n"
"Du har ändringar i arbetskatalogen som inte checkats in. Checka in dem\n"
-"först och kör sedan \"git rebase --continue\" igen."
+"först och kör sedan â€git rebase --continue†igen."
#, c-format
msgid "could not write file: '%s'"
-msgstr "kunde inte skriva fil: \"%s\""
+msgstr "kunde inte skriva fil: â€%sâ€"
msgid "could not remove CHERRY_PICK_HEAD"
msgstr "kunde inte ta bort CHERRY_PICK_HEAD"
@@ -19436,7 +20511,7 @@ msgstr "kunde inte checka in köade ändringar."
#, c-format
msgid "%s: can't cherry-pick a %s"
-msgstr "%s: kan inte göra \"cherry-pick\" på typen \"%s\""
+msgstr "%s: kan inte göra â€cherry-pick†pÃ¥ typen â€%sâ€"
#, c-format
msgid "%s: bad revision"
@@ -19462,14 +20537,18 @@ msgid "nothing to do"
msgstr "inget att göra"
msgid "could not skip unnecessary pick commands"
-msgstr "kunde inte hoppa över onödiga \"pick\"-kommandon"
+msgstr "kunde inte hoppa över onödiga â€pickâ€-kommandon"
msgid "the script was already rearranged."
msgstr "skriptet har redan omordnats."
#, c-format
+msgid "update-refs file at '%s' is invalid"
+msgstr "update-refs-filen vid â€%s†är ogiltig"
+
+#, c-format
msgid "'%s' is outside repository at '%s'"
-msgstr "\"%s\" är utanför arkivet på \"%s\""
+msgstr "â€%s†är utanför arkivet pÃ¥ â€%sâ€"
#, c-format
msgid ""
@@ -19477,7 +20556,7 @@ msgid ""
"Use 'git <command> -- <path>...' to specify paths that do not exist locally."
msgstr ""
"%s: sökvägen finns inte i arbetskatalogen.\n"
-"Använd \"git <kommando> -- <sökväg>..\" för att ange sökvägar som inte finns "
+"Använd â€git <kommando> -- <sökväg>..†för att ange sökvägar som inte finns "
"lokalt."
#, c-format
@@ -19486,14 +20565,14 @@ msgid ""
"Use '--' to separate paths from revisions, like this:\n"
"'git <command> [<revision>...] -- [<file>...]'"
msgstr ""
-"tvetydigt argument \"%s\": okänd revision eller sökväg inte i "
+"tvetydigt argument â€%sâ€: okänd revision eller sökväg inte i "
"arbetskatalogen.\n"
-"Använd \"--\" för att skilja sökvägar från revisioner, så här:\n"
-"\"git <kommando> [<revision>...] -- [<fil>...]\""
+"Använd â€--†för att skilja sökvägar frÃ¥n revisioner, sÃ¥ här:\n"
+"â€git <kommando> [<revision>...] -- [<fil>...]â€"
#, c-format
msgid "option '%s' must come before non-option arguments"
-msgstr "flaggan \"%s\" måste anges före argument som inte är flaggor"
+msgstr "flaggan â€%s†mÃ¥ste anges före argument som inte är flaggor"
#, c-format
msgid ""
@@ -19501,9 +20580,9 @@ msgid ""
"Use '--' to separate paths from revisions, like this:\n"
"'git <command> [<revision>...] -- [<file>...]'"
msgstr ""
-"tvetydigt argument \"%s\": både revision och filnamn\n"
-"Använd \"--\" för att skilja sökvägar från revisioner, så här:\n"
-"\"git <kommando> [<revision>...] -- [<fil>...]\""
+"tvetydigt argument â€%sâ€: bÃ¥de revision och filnamn\n"
+"Använd â€--†för att skilja sökvägar frÃ¥n revisioner, sÃ¥ här:\n"
+"â€git <kommando> [<revision>...] -- [<fil>...]â€"
msgid "unable to set up work tree using invalid config"
msgstr "kan inte skapa arbetskatalog med felaktig konfiguration"
@@ -19524,11 +20603,11 @@ msgstr[1] "arkivversionen är 0, men utökningar som bara finns i v1 upptäcktes
#, c-format
msgid "error opening '%s'"
-msgstr "fel vid öppning av \"%s\""
+msgstr "fel vid öppning av â€%sâ€"
#, c-format
msgid "too large to be a .git file: '%s'"
-msgstr "för stor för att vara en .git-fil: \"%s\""
+msgstr "för stor för att vara en .git-fil: â€%sâ€"
#, c-format
msgid "error reading %s"
@@ -19548,29 +20627,29 @@ msgstr "inte ett git-arkiv: %s"
#, c-format
msgid "'$%s' too big"
-msgstr "\"$%s\" för stor"
+msgstr "â€$%s†för stor"
#, c-format
msgid "not a git repository: '%s'"
-msgstr "inte ett git-arkiv: \"%s\""
+msgstr "inte ett git-arkiv: â€%sâ€"
#, c-format
msgid "cannot chdir to '%s'"
-msgstr "kan inte byta katalog (chdir) till \"%s\""
+msgstr "kan inte byta katalog (chdir) till â€%sâ€"
msgid "cannot come back to cwd"
msgstr "kan inte gå tillbaka till arbetskatalogen (cwd)"
#, c-format
msgid "failed to stat '%*s%s%s'"
-msgstr "misslyckades ta status på \"%*ss%s%s\""
+msgstr "misslyckades ta status pÃ¥ â€%*ss%s%sâ€"
msgid "Unable to read current working directory"
msgstr "Kan inte läsa aktuell arbetskatalog"
#, c-format
msgid "cannot change to '%s'"
-msgstr "kan inte byta till \"%s\""
+msgstr "kan inte byta till â€%sâ€"
#, c-format
msgid "not a git repository (or any of the parent directories): %s"
@@ -19587,17 +20666,21 @@ msgstr ""
#, c-format
msgid ""
-"unsafe repository ('%s' is owned by someone else)\n"
-"To add an exception for this directory, call:\n"
+"detected dubious ownership in repository at '%s'\n"
+"%sTo add an exception for this directory, call:\n"
"\n"
"\tgit config --global --add safe.directory %s"
msgstr ""
-"osäkert arkiv (\"%s\" ägs av någon annan)\n"
-"För att lägga till ett undantag för denna katalog, kör:\n"
+"upptäckte tveksamt ägarskap i arkivet i â€%sâ€\n"
+"%sFör att lägga till ett undantag för denna katalog, kör:\n"
"\n"
"\tgit config --global --add safe.directory %s"
#, c-format
+msgid "cannot use bare repository '%s' (safe.bareRepository is '%s')"
+msgstr "kan inte använda naket arkiv â€%s†(safe.bareRepository är â€%sâ€)"
+
+#, c-format
msgid ""
"problem with core.sharedRepository filemode value (0%.3o).\n"
"The owner of files must always have read and write permissions."
@@ -19606,10 +20689,85 @@ msgstr ""
"Ägaren av filerna måste alltid ha läs- och skrivbehörighet."
msgid "fork failed"
-msgstr "\"fork\" misslyckades"
+msgstr "â€fork†misslyckades"
msgid "setsid failed"
-msgstr "\"setsid\" misslyckades"
+msgstr "â€setsid†misslyckades"
+
+#, c-format
+msgid "cannot stat template '%s'"
+msgstr "kan inte ta status pÃ¥ mallen â€%sâ€"
+
+#, c-format
+msgid "cannot opendir '%s'"
+msgstr "kan inte öppna katalogen (opendir) â€%sâ€"
+
+#, c-format
+msgid "cannot readlink '%s'"
+msgstr "kan inte läsa länk (readlink) â€%sâ€"
+
+#, c-format
+msgid "cannot symlink '%s' '%s'"
+msgstr "kan inte skapa symbolisk länk â€%s†â€%sâ€"
+
+#, c-format
+msgid "cannot copy '%s' to '%s'"
+msgstr "kan inte kopiera â€%s†till â€%sâ€"
+
+#, c-format
+msgid "ignoring template %s"
+msgstr "ignorerar mallen %s"
+
+#, c-format
+msgid "templates not found in %s"
+msgstr "mallarna hittades inte i %s"
+
+#, c-format
+msgid "not copying templates from '%s': %s"
+msgstr "kopierade inte mallar frÃ¥n â€%sâ€: %s"
+
+#, c-format
+msgid "invalid initial branch name: '%s'"
+msgstr "ogiltigt namn pÃ¥ första gren: â€%sâ€"
+
+#, c-format
+msgid "re-init: ignored --initial-branch=%s"
+msgstr "re-init: ignorerade --initial-branch=%s"
+
+#, c-format
+msgid "unable to handle file type %d"
+msgstr "kan inte hantera filtyp %d"
+
+#, c-format
+msgid "unable to move %s to %s"
+msgstr "kan inte flytta %s till %s"
+
+msgid "attempt to reinitialize repository with different hash"
+msgstr "försöker initiera arkivet på nytt med annan hash"
+
+msgid ""
+"attempt to reinitialize repository with different reference storage format"
+msgstr "försöker initiera arkivet på nytt med annat referenslagringsformat"
+
+#, c-format
+msgid "%s already exists"
+msgstr "%s finns redan"
+
+#, c-format
+msgid "Reinitialized existing shared Git repository in %s%s\n"
+msgstr "Ominitierade befintligt delat Git-arkiv i %s%s\n"
+
+#, c-format
+msgid "Reinitialized existing Git repository in %s%s\n"
+msgstr "Ominitierade befintligt Git-arkiv i %s%s\n"
+
+#, c-format
+msgid "Initialized empty shared Git repository in %s%s\n"
+msgstr "Initierade tomt delat Git-arkiv i %s%s\n"
+
+#, c-format
+msgid "Initialized empty Git repository in %s%s\n"
+msgstr "Initierade tomt Git-arkiv i %s%s\n"
#, c-format
msgid "index entry is a directory, but not sparse (%08x)"
@@ -19663,10 +20821,6 @@ msgstr[0] "%u byte/s"
msgstr[1] "%u bytes/s"
#, c-format
-msgid "could not edit '%s'"
-msgstr "kunde inte redigera \"%s\""
-
-#, c-format
msgid "ignoring suspicious submodule name: %s"
msgstr "ignorerar misstänkt undermodulnamn: %s"
@@ -19675,7 +20829,7 @@ msgstr "negativa värden är inte tillåtna för submodule.fetchJobs"
#, c-format
msgid "ignoring '%s' which may be interpreted as a command-line option: %s"
-msgstr "ignorerar \"%s\" som kan tolkas som en kommandoradsflagga: %s"
+msgstr "ignorerar â€%s†som kan tolkas som en kommandoradsflagga: %s"
#, c-format
msgid "Could not update .gitmodules entry %s"
@@ -19699,11 +20853,11 @@ msgstr "misslyckades köa uppdaterad .gitmodules"
#, c-format
msgid "in unpopulated submodule '%s'"
-msgstr "i ej utcheckad undermodul \"%s\""
+msgstr "i ej utcheckad undermodul â€%sâ€"
#, c-format
msgid "Pathspec '%s' is in submodule '%.*s'"
-msgstr "Sökvägsangivelsen \"%s\" är i undermodulen \"%.*s\""
+msgstr "Sökvägsangivelsen â€%s†är i undermodulen â€%.*sâ€"
#, c-format
msgid "bad --ignore-submodules argument: %s"
@@ -19714,32 +20868,32 @@ msgid ""
"Submodule in commit %s at path: '%s' collides with a submodule named the "
"same. Skipping it."
msgstr ""
-"Undermodulen i incheckning %s på sökvägen: \"%s\" krockar med en undermodul "
+"Undermodulen i incheckning %s pÃ¥ sökvägen: â€%s†krockar med en undermodul "
"med samma namn. Hoppar över den."
#, c-format
msgid "submodule entry '%s' (%s) is a %s, not a commit"
-msgstr "undermodulposten \"%s\" (%s) är en %s, inte en incheckning"
+msgstr "undermodulposten â€%s†(%s) är en %s, inte en incheckning"
#, c-format
msgid ""
"Could not run 'git rev-list <commits> --not --remotes -n 1' command in "
"submodule %s"
msgstr ""
-"kunde inte köra \"git rev-list <incheckningar> --not --remotes -n 1\" i "
-"undermodulen \"%s\""
+"kunde inte köra â€git rev-list <incheckningar> --not --remotes -n 1†i "
+"undermodulen â€%sâ€"
#, c-format
msgid "process for submodule '%s' failed"
-msgstr "process för undermodulen \"%s\" misslyckades"
+msgstr "process för undermodulen â€%s†misslyckades"
#, c-format
msgid "Pushing submodule '%s'\n"
-msgstr "Sänder undermodulen \"%s\"\n"
+msgstr "Sänder undermodulen â€%sâ€\n"
#, c-format
msgid "Unable to push submodule '%s'\n"
-msgstr "Kunde inte sända undermodulen \"%s\"\n"
+msgstr "Kunde inte sända undermodulen â€%sâ€\n"
#, c-format
msgid "Fetching submodule %s%s\n"
@@ -19747,11 +20901,11 @@ msgstr "Hämtar undermodulen %s%s\n"
#, c-format
msgid "Could not access submodule '%s'\n"
-msgstr "Kunde inte komma åt undermodulen \"%s\"\n"
+msgstr "Kunde inte komma Ã¥t undermodulen â€%sâ€\n"
#, c-format
msgid "Could not access submodule '%s' at commit %s\n"
-msgstr "Kunde inte komma åt undermodulen \"%s\" vid incheckningen %s\n"
+msgstr "Kunde inte komma Ã¥t undermodulen â€%s†vid incheckningen %s\n"
#, c-format
msgid "Fetching submodule %s%s at commit %s\n"
@@ -19767,61 +20921,61 @@ msgstr ""
#, c-format
msgid "'%s' not recognized as a git repository"
-msgstr "\"%s\" känns inte igen som ett git-arkiv"
+msgstr "â€%s†känns inte igen som ett git-arkiv"
#, c-format
msgid "Could not run 'git status --porcelain=2' in submodule %s"
-msgstr "Kunde inte köra \"git status --porcelain=2\" i undermodulen \"%s\""
+msgstr "Kunde inte köra â€git status --porcelain=2†i undermodulen â€%sâ€"
#, c-format
msgid "'git status --porcelain=2' failed in submodule %s"
-msgstr "\"git status --porcelain=2\" misslyckades i undermodulen \"%s\""
+msgstr "â€git status --porcelain=2†misslyckades i undermodulen â€%sâ€"
#, c-format
msgid "could not start 'git status' in submodule '%s'"
-msgstr "kunde inte starta \"git status\" i undermodulen \"%s\""
+msgstr "kunde inte starta â€git status†i undermodulen â€%sâ€"
#, c-format
msgid "could not run 'git status' in submodule '%s'"
-msgstr "kunde inte köra \"git status\" i undermodulen \"%s\""
+msgstr "kunde inte köra â€git status†i undermodulen â€%sâ€"
#, c-format
msgid "Could not unset core.worktree setting in submodule '%s'"
-msgstr "Kunde inte ta bort inställningen core.worktree i undermodulen \"%s\""
+msgstr "Kunde inte ta bort inställningen core.worktree i undermodulen â€%sâ€"
#, c-format
msgid "could not recurse into submodule '%s'"
-msgstr "kunde inte rekursera in i undermodulen \"%s\""
+msgstr "kunde inte rekursera in i undermodulen â€%sâ€"
msgid "could not reset submodule index"
msgstr "kunde inte återställa indexet i undermodul"
#, c-format
msgid "submodule '%s' has dirty index"
-msgstr "undermodulen \"%s\" har ett smutsigt index"
+msgstr "undermodulen â€%s†har ett smutsigt index"
#, c-format
msgid "Submodule '%s' could not be updated."
-msgstr "Undermoduler \"%s\" kunde inte uppdateras."
+msgstr "Undermoduler â€%s†kunde inte uppdateras."
#, c-format
msgid "submodule git dir '%s' is inside git dir '%.*s'"
-msgstr "undermodul-gitkatalogen \"%s\" är inuti gitkatalogen \"%.*s\""
+msgstr "undermodul-gitkatalogen â€%s†är inuti gitkatalogen â€%.*sâ€"
#, c-format
msgid ""
"relocate_gitdir for submodule '%s' with more than one worktree not supported"
msgstr ""
-"relocate_gitdir för undermodulen \"%s\", som har mer än en arbetskatalog, "
+"relocate_gitdir för undermodulen â€%sâ€, som har mer än en arbetskatalog, "
"stöds ej"
#, c-format
msgid "could not lookup name for submodule '%s'"
-msgstr "kunde inte slå upp namnet för undermodulen \"%s\""
+msgstr "kunde inte slÃ¥ upp namnet för undermodulen â€%sâ€"
#, c-format
msgid "refusing to move '%s' into an existing git dir"
-msgstr "vägrar flytta \"%s\" till en befintlig gitkatalog"
+msgstr "vägrar flytta â€%s†till en befintlig gitkatalog"
#, c-format
msgid ""
@@ -19829,9 +20983,9 @@ msgid ""
"'%s' to\n"
"'%s'\n"
msgstr ""
-"Migrerar git-katalogen för \"%s%s\" från\n"
-"\"%s\" till\n"
-"\"%s\"\n"
+"Migrerar git-katalogen för â€%s%s†frÃ¥n\n"
+"â€%s†till\n"
+"â€%sâ€\n"
msgid "could not start ls-files in .."
msgstr "kunde inte starta ls-files i .."
@@ -19842,13 +20996,26 @@ msgstr "ls-tree returnerade en oväntad returkod %d"
#, c-format
msgid "failed to lstat '%s'"
-msgstr "misslyckades ta status (lstat) på \"%s\""
+msgstr "misslyckades ta status (lstat) pÃ¥ â€%sâ€"
-msgid "unhandled options"
-msgstr "flaggor som inte hanterats"
+msgid "no remote configured to get bundle URIs from"
+msgstr "ingen fjärr att hämta bunt-URI:er från inställd"
-msgid "error preparing revisions"
-msgstr "fel när revisioner skulle förberedas"
+#, c-format
+msgid "remote '%s' has no configured URL"
+msgstr "fjärren â€%s†har ingen URL konfigurerad"
+
+msgid "could not get the bundle-uri list"
+msgstr "kunde inte hämta bundle-uri-listan"
+
+msgid "test-tool cache-tree <options> (control|prime|update)"
+msgstr "test-tool cache-tree <flaggor> (control|prime|update)"
+
+msgid "clear the cache tree before each iteration"
+msgstr "töm cacheträdet före varje iteration"
+
+msgid "number of entries in the cache tree to invalidate (default 0)"
+msgstr "antal poster i cacheträdet att ogiltigförklara (förval är 0)"
#, c-format
msgid "commit %s is not marked reachable"
@@ -19921,19 +21088,19 @@ msgstr "igenkänningstecken för kommando att sända till servern"
#, c-format
msgid "running trailer command '%s' failed"
-msgstr "misslyckades utföra släpradskommandot \"%s\""
+msgstr "misslyckades utföra släpradskommandot â€%sâ€"
#, c-format
msgid "unknown value '%s' for key '%s'"
-msgstr "okänt värde \"%s\" för nyckeln \"%s\""
+msgstr "okänt värde â€%s†för nyckeln â€%sâ€"
#, c-format
msgid "empty trailer token in trailer '%.*s'"
-msgstr "tom släpradssymbol i släpraden \"%.*s\""
+msgstr "tom släpradssymbol i släpraden â€%.*sâ€"
#, c-format
msgid "could not read input file '%s'"
-msgstr "kunde inte läsa indatafilen \"%s\""
+msgstr "kunde inte läsa indatafilen â€%sâ€"
#, c-format
msgid "could not stat %s"
@@ -19959,7 +21126,7 @@ msgstr "komplett skrivning till fjärrhjälpare misslyckades"
#, c-format
msgid "unable to find remote helper for '%s'"
-msgstr "kan inte hitta fjärrhjälpare för \"%s\""
+msgstr "kan inte hitta fjärrhjälpare för â€%sâ€"
msgid "can't dup helper output fd"
msgstr "kunde inte duplicera utdata-filhandtag"
@@ -19979,7 +21146,7 @@ msgstr ""
#, c-format
msgid "%s unexpectedly said: '%s'"
-msgstr "%s sade oväntat: \"%s\""
+msgstr "%s sade oväntat: â€%sâ€"
#, c-format
msgid "%s also locked %s"
@@ -20005,9 +21172,6 @@ msgstr "protkollet 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"
-msgid "operation not supported by protocol"
-msgstr "funktionen stöds inte av protokollet"
-
#, c-format
msgid "can't connect to subservice %s"
msgstr "kan inte ansluta till undertjänsten %s"
@@ -20016,11 +21180,11 @@ 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 mostsvarande â€ok/errorâ€-direktiv"
#, c-format
msgid "expected ok/error, helper said '%s'"
-msgstr "förväntade ok/error, hjälpprogrammet svarade \"%s\""
+msgstr "förväntade ok/error, hjälpprogrammet svarade â€%sâ€"
#, c-format
msgid "helper reported unexpected status of %s"
@@ -20048,14 +21212,14 @@ msgstr "hjälparen %s stöder inte --%s"
#, c-format
msgid "helper %s does not support 'push-option'"
-msgstr "hjälparen %s stöder inte \"push-option\""
+msgstr "hjälparen %s stöder inte â€push-optionâ€"
msgid "remote-helper doesn't support push; refspec needed"
msgstr "fjärrhjälparen stöder inte push; referensspecifikation krävs"
#, c-format
msgid "helper %s does not support 'force'"
-msgstr "hjälparen %s stöder inte \"force\""
+msgstr "hjälparen %s stöder inte â€forceâ€"
msgid "couldn't run fast-export"
msgstr "kunde inte köra fast-export"
@@ -20073,7 +21237,7 @@ msgstr ""
#, c-format
msgid "unsupported object format '%s'"
-msgstr "objektformatet \"%s\" stöds ej"
+msgstr "objektformatet â€%s†stöds ej"
#, c-format
msgid "malformed response in ref list: %s"
@@ -20112,18 +21276,18 @@ msgstr "kan inte skapa tråd för kopiering av data"
#, c-format
msgid "Would set upstream of '%s' to '%s' of '%s'\n"
-msgstr "Skulle sätta uppströms för \"%s\" till \"%s\" från \"%s\"\n"
+msgstr "Skulle sätta uppströms för â€%s†till â€%s†frÃ¥n â€%sâ€\n"
#, c-format
msgid "could not read bundle '%s'"
-msgstr "kunde inte läsa bunten \"%s\""
+msgstr "kunde inte läsa bunten â€%sâ€"
#, c-format
msgid "transport: invalid depth option '%s'"
-msgstr "transport: ogiltig flagga för depth: \"%s\""
+msgstr "transport: ogiltig flagga för depth: â€%sâ€"
msgid "see protocol.version in 'git help config' for more details"
-msgstr "se protocol.version i \"git help config\" för mer information"
+msgstr "se protocol.version i â€git help config†för mer information"
msgid "server options require protocol version 2 or later"
msgstr "serverflaggor kräver protokollversion 2 eller senare"
@@ -20138,12 +21302,8 @@ msgid "support for protocol v2 not implemented yet"
msgstr "stöd för protokoll v2 ännu ej implementerat"
#, c-format
-msgid "unknown value for config '%s': %s"
-msgstr "okänt värde för inställningen \"%s\": %s"
-
-#, c-format
msgid "transport '%s' not allowed"
-msgstr "transporten \"%s\" tillåts inte"
+msgstr "transporten â€%s†tillÃ¥ts inte"
msgid "git-over-rsync is no longer supported"
msgstr "git-over-rsync stöds inte längre"
@@ -20188,6 +21348,15 @@ msgstr "Avbryter."
msgid "failed to push all needed submodules"
msgstr "kunde inte sända alla nödvändiga undermoduler"
+msgid "bundle-uri operation not supported by protocol"
+msgstr "bundle-uri-funktionen stöds inte av protokollet"
+
+msgid "could not retrieve server-advertised bundle-uri list"
+msgstr "kunde inte hämta bundle-uri-listan som servern annonserade"
+
+msgid "operation not supported by protocol"
+msgstr "funktionen stöds inte av protokollet"
+
msgid "too-short tree object"
msgstr "trädobjekt för kort"
@@ -20206,7 +21375,7 @@ msgid ""
"%%sPlease commit your changes or stash them before you switch branches."
msgstr ""
"Dina lokala ändringar av följande filer skulle skrivas över av utcheckning:\n"
-"%%sChecka in dina ändringar eller använd \"stash\" innan du byter gren."
+"%%sChecka in dina ändringar eller använd â€stash†innan du byter gren."
#, c-format
msgid ""
@@ -20223,7 +21392,7 @@ msgid ""
msgstr ""
"Dina lokala ändringar av följande filer skulle skrivas över av "
"sammanslagning:\n"
-"%%sChecka in dina ändringar eller använd \"stash\" innan du byter gren."
+"%%sChecka in dina ändringar eller använd â€stash†innan du byter gren."
#, c-format
msgid ""
@@ -20239,15 +21408,15 @@ msgid ""
"Your local changes to the following files would be overwritten by %s:\n"
"%%sPlease commit your changes or stash them before you %s."
msgstr ""
-"Dina lokala ändringar av följande filer skulle skrivas över av \"%s\":\n"
-"%%sChecka in dina ändringar eller använd \"stash\" innan du \"%s\"."
+"Dina lokala ändringar av följande filer skulle skrivas över av â€%sâ€:\n"
+"%%sChecka in dina ändringar eller använd â€stash†innan du â€%sâ€."
#, c-format
msgid ""
"Your local changes to the following files would be overwritten by %s:\n"
"%%s"
msgstr ""
-"Dina lokala ändringar av följande filer skulle skrivas över av \"%s\":\n"
+"Dina lokala ändringar av följande filer skulle skrivas över av â€%sâ€:\n"
"%%s"
#, c-format
@@ -20306,15 +21475,15 @@ msgid ""
"The following untracked working tree files would be removed by %s:\n"
"%%sPlease move or remove them before you %s."
msgstr ""
-"Följande ospårade filer i arbetskatalogen skulle tas bort av \"%s\":\n"
-"%%sFlytta eller ta bort dem innan du \"%s\"."
+"Följande ospÃ¥rade filer i arbetskatalogen skulle tas bort av â€%sâ€:\n"
+"%%sFlytta eller ta bort dem innan du â€%sâ€."
#, c-format
msgid ""
"The following untracked working tree files would be removed by %s:\n"
"%%s"
msgstr ""
-"Följande ospårade filer i arbetskatalogen skulle tas bort av \"%s\":\n"
+"Följande ospÃ¥rade filer i arbetskatalogen skulle tas bort av â€%sâ€:\n"
"%%s"
#, c-format
@@ -20360,20 +21529,20 @@ msgid ""
"The following untracked working tree files would be overwritten by %s:\n"
"%%sPlease move or remove them before you %s."
msgstr ""
-"Följande ospårade filer i arbetskatalogen skulle skrivas över av \"%s\":\n"
-"%%sFlytta eller ta bort dem innan du \"%s\"."
+"Följande ospÃ¥rade filer i arbetskatalogen skulle skrivas över av â€%sâ€:\n"
+"%%sFlytta eller ta bort dem innan du â€%sâ€."
#, c-format
msgid ""
"The following untracked working tree files would be overwritten by %s:\n"
"%%s"
msgstr ""
-"Följande ospårade filer i arbetskatalogen skulle skrivas över av \"%s\":\n"
+"Följande ospÃ¥rade filer i arbetskatalogen skulle skrivas över av â€%sâ€:\n"
"%%s"
#, c-format
msgid "Entry '%s' overlaps with '%s'. Cannot bind."
-msgstr "Posten \"%s\" överlappar \"%s\". Kan inte binda."
+msgstr "Posten â€%s†överlappar â€%sâ€. Kan inte binda."
#, c-format
msgid ""
@@ -20420,7 +21589,7 @@ msgid ""
"After fixing the above paths, you may want to run `git sparse-checkout "
"reapply`.\n"
msgstr ""
-"Du bör köra \"git sparse-checkout reapply\" efter att ha fixat sökvägarna "
+"Du bör köra â€git sparse-checkout reapply†efter att ha fixat sökvägarna "
"ovan.\n"
msgid "Updating files"
@@ -20443,20 +21612,20 @@ msgid "worktree and untracked commit have duplicate entries: %s"
msgstr "arbetskatalog och ospårad incheckning har dublettposter: %s"
msgid "expected flush after fetch arguments"
-msgstr "förväntade \"flush\" efter \"fetch\"-argument"
+msgstr "förväntade â€flush†efter â€fetchâ€-argument"
msgid "invalid URL scheme name or missing '://' suffix"
-msgstr "ogiltig URL-schemanamn eller saknat \"://\"-suffix"
+msgstr "ogiltig URL-schemanamn eller saknat â€://â€-suffix"
#, c-format
msgid "invalid %XX escape sequence"
msgstr "ogiltig %XX-teckensekvens"
msgid "missing host and scheme is not 'file:'"
-msgstr "värd saknas och schemat är inte \"file:\""
+msgstr "värd saknas och schemat är inte â€file:â€"
msgid "a 'file:' URL may not have a port number"
-msgstr "en \"file:\"-URL kan inte innehålla portnummer"
+msgstr "en â€file:â€-URL kan inte innehÃ¥lla portnummer"
msgid "invalid characters in host name"
msgstr "ogiltiga tecken i värdnamnet"
@@ -20465,26 +21634,38 @@ msgid "invalid port number"
msgstr "felaktigt portnummer"
msgid "invalid '..' path segment"
-msgstr "felaktigt \"..\"-sökvägssegment"
+msgstr "felaktigt â€..â€-sökvägssegment"
+
+msgid "usage: "
+msgstr "användning: "
+
+msgid "fatal: "
+msgstr "ödesdigert: "
+
+msgid "error: "
+msgstr "fel: "
+
+msgid "warning: "
+msgstr "varning: "
msgid "Fetching objects"
msgstr "Hämtar objekt"
#, c-format
msgid "'%s' at main working tree is not the repository directory"
-msgstr "\"%s\" i huvudarbetskatalogen är inte arkivkatalogen"
+msgstr "â€%s†i huvudarbetskatalogen är inte arkivkatalogen"
#, c-format
msgid "'%s' file does not contain absolute path to the working tree location"
-msgstr "filen \"%s\" innehåller inte absolut sökväg till arbetskatalogen"
+msgstr "filen â€%s†innehÃ¥ller inte absolut sökväg till arbetskatalogen"
#, c-format
msgid "'%s' is not a .git file, error code %d"
-msgstr "\"%s\" är inte en .git-fil, felkod %d"
+msgstr "â€%s†är inte en .git-fil, felkod %d"
#, c-format
msgid "'%s' does not point back to '%s'"
-msgstr "\"%s\" pekar inte tillbaka till \"%s\""
+msgstr "â€%s†pekar inte tillbaka till â€%sâ€"
msgid "not a directory"
msgstr "inte en katalog"
@@ -20538,57 +21719,60 @@ msgstr "gitdir-filen pekar på en ickeexisterande plats"
#, c-format
msgid "unable to set %s in '%s'"
-msgstr "kan inte sätta %s i \"%s\""
+msgstr "kan inte sätta %s i â€%sâ€"
#, c-format
msgid "unable to unset %s in '%s'"
-msgstr "kan inte slå av %s i \"%s\""
+msgstr "kan inte slÃ¥ av %s i â€%sâ€"
msgid "failed to set extensions.worktreeConfig setting"
msgstr "misslyckades ändra inställningen extensions.worktreeConfig"
#, c-format
msgid "could not setenv '%s'"
-msgstr "kunde inte lagra miljövariabeln \"%s\""
+msgstr "kunde inte lagra miljövariabeln â€%sâ€"
#, c-format
msgid "unable to create '%s'"
-msgstr "kunde inte skapa \"%s\""
+msgstr "kunde inte skapa â€%sâ€"
#, c-format
msgid "could not open '%s' for reading and writing"
-msgstr "kunde inte öppna \"%s\" för läsning och skrivning"
+msgstr "kunde inte öppna â€%s†för läsning och skrivning"
#, c-format
msgid "unable to access '%s'"
-msgstr "kan inte komma åt \"%s\""
+msgstr "kan inte komma Ã¥t â€%sâ€"
msgid "unable to get current working directory"
msgstr "kan inte hämta aktuell arbetskatalog"
+msgid "unable to get random bytes"
+msgstr "kunde inte hämta slumpdata"
+
msgid "Unmerged paths:"
msgstr "Ej sammanslagna sökvägar:"
msgid " (use \"git restore --staged <file>...\" to unstage)"
-msgstr " (använd \"git restore --staged <fil>...\" för att ta bort från kö)"
+msgstr " (använd â€git restore --staged <fil>...†för att ta bort frÃ¥n kö)"
#, c-format
msgid " (use \"git restore --source=%s --staged <file>...\" to unstage)"
msgstr ""
-" (använd \"git restore --source=%s --staged <fil>...\" för att ta bort från "
+" (använd â€git restore --source=%s --staged <fil>...†för att ta bort frÃ¥n "
"kö)"
msgid " (use \"git rm --cached <file>...\" to unstage)"
-msgstr " (använd \"git rm --cached <fil>...\" för att ta bort från kö)"
+msgstr " (använd â€git rm --cached <fil>...†för att ta bort frÃ¥n kö)"
msgid " (use \"git add <file>...\" to mark resolution)"
-msgstr " (använd \"git add <fil>...\" för att ange lösning)"
+msgstr " (använd â€git add <fil>...†för att ange lösning)"
msgid " (use \"git add/rm <file>...\" as appropriate to mark resolution)"
-msgstr " (använd \"git add/rm <fil>...\" som lämpligt för att ange lösning)"
+msgstr " (använd â€git add/rm <fil>...†som lämpligt för att ange lösning)"
msgid " (use \"git rm <file>...\" to mark resolution)"
-msgstr " (använd \"git rm <fil>...\" för att ange lösning)"
+msgstr " (använd â€git rm <fil>...†för att ange lösning)"
msgid "Changes to be committed:"
msgstr "Ändringar att checka in:"
@@ -20597,17 +21781,16 @@ msgid "Changes not staged for commit:"
msgstr "Ändringar ej i incheckningskön:"
msgid " (use \"git add <file>...\" to update what will be committed)"
-msgstr ""
-" (använd \"git add <fil>...\" för att uppdatera vad som ska checkas in)"
+msgstr " (använd â€git add <fil>...†för att uppdatera vad som ska checkas in)"
msgid " (use \"git add/rm <file>...\" to update what will be committed)"
msgstr ""
-" (använd \"git add/rm <fil>...\" för att uppdatera vad som ska checkas in)"
+" (använd â€git add/rm <fil>...†för att uppdatera vad som ska checkas in)"
msgid ""
" (use \"git restore <file>...\" to discard changes in working directory)"
msgstr ""
-" (använd \"git restore <fil>...\" för att förkasta ändringar i "
+" (använd â€git restore <fil>...†för att förkasta ändringar i "
"arbetskatalogen)"
msgid " (commit or discard the untracked or modified content in submodules)"
@@ -20616,7 +21799,7 @@ msgstr ""
#, c-format
msgid " (use \"git %s <file>...\" to include in what will be committed)"
-msgstr " (använd \"git %s <fil>...\" för att ta med i det som ska checkas in)"
+msgstr " (använd â€git %s <fil>...†för att ta med i det som ska checkas in)"
msgid "both deleted:"
msgstr "borttaget av bägge:"
@@ -20699,43 +21882,43 @@ msgid ""
msgstr ""
"\n"
"Det tog %.2f sekunder att räkna före/bakom-värden.\n"
-"Du kan använda \"--no-ahead-behind\" för undvika detta.\n"
+"Du kan använda â€--no-ahead-behind†för undvika detta.\n"
msgid "You have unmerged paths."
msgstr "Du har ej sammanslagna sökvägar."
msgid " (fix conflicts and run \"git commit\")"
-msgstr " (rätta konflikter och kör \"git commit\")"
+msgstr " (rätta konflikter och kör â€git commitâ€)"
msgid " (use \"git merge --abort\" to abort the merge)"
-msgstr " (använd \"git merge --abort\" för att avbryta sammanslagningen)"
+msgstr " (använd â€git merge --abort†för att avbryta sammanslagningen)"
msgid "All conflicts fixed but you are still merging."
msgstr "Alla konflikter har rättats men du är fortfarande i en sammanslagning."
msgid " (use \"git commit\" to conclude merge)"
-msgstr " (använd \"git commit\" för att slutföra sammanslagningen)"
+msgstr " (använd â€git commit†för att slutföra sammanslagningen)"
msgid "You are in the middle of an am session."
-msgstr "Du är i mitten av en körning av \"git am\"."
+msgstr "Du är i mitten av en körning av â€git amâ€."
msgid "The current patch is empty."
msgstr "Aktuell patch är tom."
msgid " (fix conflicts and then run \"git am --continue\")"
-msgstr " (rätta konflikter och kör sedan \"git am --continue\")"
+msgstr " (rätta konflikter och kör sedan â€git am --continueâ€)"
msgid " (use \"git am --skip\" to skip this patch)"
-msgstr " (använd \"git am --skip\" för att hoppa över patchen)"
+msgstr " (använd â€git am --skip†för att hoppa över patchen)"
msgid ""
" (use \"git am --allow-empty\" to record this patch as an empty commit)"
msgstr ""
-" (använd \"git am --allow-empty\" för att registrera patchen som en tom "
+" (använd â€git am --allow-empty†för att registrera patchen som en tom "
"incheckning)"
msgid " (use \"git am --abort\" to restore the original branch)"
-msgstr " (använd \"git am --abort\" för att återställa ursprungsgrenen)"
+msgstr " (använd â€git am --abort†för att Ã¥terställa ursprungsgrenen)"
msgid "git-rebase-todo is missing."
msgstr "git-rebase-todo saknas."
@@ -20763,79 +21946,79 @@ msgstr[0] "Nästa kommando att utföra (%<PRIuMAX> kommando återstår):"
msgstr[1] "Följande kommandon att utföra (%<PRIuMAX> kommandon återstår):"
msgid " (use \"git rebase --edit-todo\" to view and edit)"
-msgstr " (använd \"git rebase --edit-todo\" för att visa och redigera)"
+msgstr " (använd â€git rebase --edit-todo†för att visa och redigera)"
#, c-format
msgid "You are currently rebasing branch '%s' on '%s'."
-msgstr "Du håller på att ombasera grenen \"%s\" ovanpå \"%s\"."
+msgstr "Du hÃ¥ller pÃ¥ att ombasera grenen â€%s†ovanpÃ¥ â€%sâ€."
msgid "You are currently rebasing."
msgstr "Du håller på med en ombasering."
msgid " (fix conflicts and then run \"git rebase --continue\")"
-msgstr " (rätta konflikter och kör sedan \"git rebase --continue\")"
+msgstr " (rätta konflikter och kör sedan â€git rebase --continueâ€)"
msgid " (use \"git rebase --skip\" to skip this patch)"
-msgstr " (använd \"git rebase --skip\" för att hoppa över patchen)"
+msgstr " (använd â€git rebase --skip†för att hoppa över patchen)"
msgid " (use \"git rebase --abort\" to check out the original branch)"
-msgstr " (använd \"git rebase --abort\" för att checka ut ursprungsgrenen)"
+msgstr " (använd â€git rebase --abort†för att checka ut ursprungsgrenen)"
msgid " (all conflicts fixed: run \"git rebase --continue\")"
-msgstr " (alla konflikter rättade: kör \"git rebase --continue\")"
+msgstr " (alla konflikter rättade: kör â€git rebase --continueâ€)"
#, c-format
msgid ""
"You are currently splitting a commit while rebasing branch '%s' on '%s'."
msgstr ""
-"Du håller på att dela upp en incheckning medan du ombaserar grenen \"%s\" "
-"ovanpå \"%s\"."
+"Du hÃ¥ller pÃ¥ att dela upp en incheckning medan du ombaserar grenen â€%s†"
+"ovanpÃ¥ â€%sâ€."
msgid "You are currently splitting a commit during a rebase."
msgstr "Du håller på att dela upp en incheckning i en ombasering."
msgid " (Once your working directory is clean, run \"git rebase --continue\")"
-msgstr " (Så fort din arbetskatalog är ren, kör \"git rebase --continue\")"
+msgstr " (SÃ¥ fort din arbetskatalog är ren, kör â€git rebase --continueâ€)"
#, c-format
msgid "You are currently editing a commit while rebasing branch '%s' on '%s'."
msgstr ""
-"Du håller på att redigera en incheckning medan du ombaserar grenen \"%s\" "
-"ovanpå \"%s\"."
+"Du hÃ¥ller pÃ¥ att redigera en incheckning medan du ombaserar grenen â€%s†"
+"ovanpÃ¥ â€%sâ€."
msgid "You are currently editing a commit during a rebase."
msgstr "Du håller på att redigera en incheckning under en ombasering."
msgid " (use \"git commit --amend\" to amend the current commit)"
msgstr ""
-" (använd \"git commit --amend\" för att lägga till på aktuell incheckning)"
+" (använd â€git commit --amend†för att lägga till pÃ¥ aktuell incheckning)"
msgid ""
" (use \"git rebase --continue\" once you are satisfied with your changes)"
-msgstr " (använd \"git rebase --continue\" när du är nöjd med dina ändringar)"
+msgstr " (använd â€git rebase --continue†när du är nöjd med dina ändringar)"
msgid "Cherry-pick currently in progress."
msgstr "Cherry-pick pågår."
#, c-format
msgid "You are currently cherry-picking commit %s."
-msgstr "Du håller på med en \"cherry-pick\" av incheckningen %s."
+msgstr "Du hÃ¥ller pÃ¥ med en â€cherry-pick†av incheckningen %s."
msgid " (fix conflicts and run \"git cherry-pick --continue\")"
-msgstr " (rätta konflikter och kör sedan \"git cherry-pick --continue\")"
+msgstr " (rätta konflikter och kör sedan â€git cherry-pick --continueâ€)"
msgid " (run \"git cherry-pick --continue\" to continue)"
-msgstr " (kör \"git cherry-pick --continue\" för att fortsätta)"
+msgstr " (kör â€git cherry-pick --continue†för att fortsätta)"
msgid " (all conflicts fixed: run \"git cherry-pick --continue\")"
-msgstr " (alla konflikter rättade: kör \"git cherry-pick --continue\")"
+msgstr " (alla konflikter rättade: kör â€git cherry-pick --continueâ€)"
msgid " (use \"git cherry-pick --skip\" to skip this patch)"
-msgstr " (använd \"git cherry-pick --skip\" för att hoppa över patchen)"
+msgstr " (använd â€git cherry-pick --skip†för att hoppa över patchen)"
msgid " (use \"git cherry-pick --abort\" to cancel the cherry-pick operation)"
msgstr ""
-" (använd \"git cherry-pick --abort\" för att avbryta \"cherry-pick\"-"
+" (använd â€git cherry-pick --abort†för att avbryta â€cherry-pickâ€-"
"operationen)"
msgid "Revert currently in progress."
@@ -20846,30 +22029,30 @@ msgid "You are currently reverting commit %s."
msgstr "Du håller på med att ångra incheckningen %s."
msgid " (fix conflicts and run \"git revert --continue\")"
-msgstr " (rätta konflikter och kör sedan \"git revert --continue\")"
+msgstr " (rätta konflikter och kör sedan â€git revert --continueâ€)"
msgid " (run \"git revert --continue\" to continue)"
-msgstr " (kör \"git revert --continue\" för att fortsätta)"
+msgstr " (kör â€git revert --continue†för att fortsätta)"
msgid " (all conflicts fixed: run \"git revert --continue\")"
-msgstr " (alla konflikter rättade: kör \"git revert --continue\")"
+msgstr " (alla konflikter rättade: kör â€git revert --continueâ€)"
msgid " (use \"git revert --skip\" to skip this patch)"
-msgstr " (använd \"git revert --skip\" för att hoppa över patchen)"
+msgstr " (använd â€git revert --skip†för att hoppa över patchen)"
msgid " (use \"git revert --abort\" to cancel the revert operation)"
-msgstr " (använd \"git revert --abort\" för att avbryta ångrandet)"
+msgstr " (använd â€git revert --abort†för att avbryta Ã¥ngrandet)"
#, c-format
msgid "You are currently bisecting, started from branch '%s'."
-msgstr "Du håller på med en \"bisect\", startad från grenen \"%s\"."
+msgstr "Du hÃ¥ller pÃ¥ med en â€bisectâ€, startad frÃ¥n grenen â€%sâ€."
msgid "You are currently bisecting."
-msgstr "Du håller på med en \"bisect\"."
+msgstr "Du hÃ¥ller pÃ¥ med en â€bisectâ€."
msgid " (use \"git bisect reset\" to get back to the original branch)"
msgstr ""
-" (använd \"git bisect reset\" för att komma tillbaka till ursprungsgrenen)"
+" (använd â€git bisect reset†för att komma tillbaka till ursprungsgrenen)"
msgid "You are in a sparse checkout."
msgstr "Du är i en gles utcheckning."
@@ -20910,13 +22093,18 @@ msgstr "Ignorerade filer"
#, c-format
msgid ""
-"It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
-"may speed it up, but you have to be careful not to forget to add\n"
-"new files yourself (see 'git help status')."
+"It took %.2f seconds to enumerate untracked files,\n"
+"but the results were cached, and subsequent runs may be faster."
msgstr ""
-"Det tog %.2f sekunder att räkna upp ospårade filer. \"status -uno\"\n"
-"kan gå snabbare, men du måste vara försiktig så du inte glömmer\n"
-"lägga till nya filer själv (se \"git help status\")."
+"Det tog %.2f sekunder att räkna upp ospårade filer,\n"
+"men resultaten cachelagrades och senare körningar kan bli snabbare."
+
+#, c-format
+msgid "It took %.2f seconds to enumerate untracked files."
+msgstr "Det tog %.2f sekunder att räkna upp ospårade filer."
+
+msgid "See 'git help status' for information on how to improve this."
+msgstr "Se â€git help status†för information om hur du kan förbättra detta."
# %s är nästa sträng eller tom.
#, c-format
@@ -20932,8 +22120,7 @@ msgstr "Inga ändringar"
#, c-format
msgid "no changes added to commit (use \"git add\" and/or \"git commit -a\")\n"
msgstr ""
-"inga ändringar att checka in (använd \"git add\" och/eller \"git commit -a"
-"\")\n"
+"inga ändringar att checka in (använd â€git add†och/eller â€git commit -aâ€)\n"
#, c-format
msgid "no changes added to commit\n"
@@ -20944,8 +22131,7 @@ msgid ""
"nothing added to commit but untracked files present (use \"git add\" to "
"track)\n"
msgstr ""
-"inget köat för incheckning, men ospårade filer finns (spåra med \"git add"
-"\")\n"
+"inget köat för incheckning, men ospÃ¥rade filer finns (spÃ¥ra med â€git addâ€)\n"
#, c-format
msgid "nothing added to commit but untracked files present\n"
@@ -20953,7 +22139,7 @@ msgstr "inget köat för incheckning, men ospårade filer finns\n"
#, c-format
msgid "nothing to commit (create/copy files and use \"git add\" to track)\n"
-msgstr "inget att checka in (skapa/kopiera filer och spåra med \"git add\")\n"
+msgstr "inget att checka in (skapa/kopiera filer och spÃ¥ra med â€git addâ€)\n"
#, c-format
msgid "nothing to commit\n"
@@ -20994,6 +22180,10 @@ msgstr "dessutom innehåller dit index ändringar som inte har checkats in."
msgid "cannot %s: Your index contains uncommitted changes."
msgstr "kan inte %s: Ditt index innehåller ändringar som inte checkats in."
+#, c-format
+msgid "unknown style '%s' given for '%s'"
+msgstr "okänd stil â€%s†angavs för â€%sâ€"
+
msgid ""
"Error: Your local changes to the following files would be overwritten by "
"merge"
@@ -21059,290 +22249,6 @@ msgstr "Du måste köra kommandot från arbetskatalogens toppnivå."
msgid "Unable to determine absolute path of git directory"
msgstr "Kunde inte bestämma absolut sökväg till git-katalogen"
-#. TRANSLATORS: you can adjust this to align "git add -i" status menu
-#, perl-format
-msgid "%12s %12s %s"
-msgstr "%12s %12s %s"
-
-#, perl-format
-msgid "touched %d path\n"
-msgid_plural "touched %d paths\n"
-msgstr[0] "rörde %d sökväg\n"
-msgstr[1] "rörde %d sökvägar\n"
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for staging."
-msgstr ""
-"Om patchen kan appliceras rent kommer det redigerade stycket att\n"
-"köas omedelbart."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for stashing."
-msgstr ""
-"Om patchen kan appliceras rent kommer det redigerade stycket att\n"
-"läggas till i \"stash\" omedelbart."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for unstaging."
-msgstr ""
-"Om patchen kan appliceras rent kommer det redigerade stycket att\n"
-"tas bort från kön omedelbart."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for applying."
-msgstr ""
-"Om patchen kan appliceras rent kommer det redigerade stycket att\n"
-"markeras för applicering omedelbart."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for discarding."
-msgstr ""
-"Om patchen kan appliceras rent kommer det redigerade stycket att\n"
-"markeras för kasta omedelbart."
-
-#, perl-format
-msgid "failed to open hunk edit file for writing: %s"
-msgstr "misslyckades öppna styckeredigeringsfil för skrivning: %s"
-
-#, perl-format
-msgid ""
-"---\n"
-"To remove '%s' lines, make them ' ' lines (context).\n"
-"To remove '%s' lines, delete them.\n"
-"Lines starting with %s will be removed.\n"
-msgstr ""
-"---\n"
-"Ta bort \"%s\" rader genom att göra dem \" \"-rader (sammanhang).\n"
-"Ta bort \"%s\" rader genom att radera dem.\n"
-"Rader som börjar med %s kommer att tas bort.\n"
-
-#, perl-format
-msgid "failed to open hunk edit file for reading: %s"
-msgstr "misslyckades öppna styckesredigeringsfil för läsning: %s"
-
-msgid ""
-"y - stage this hunk\n"
-"n - do not stage this hunk\n"
-"q - quit; do not stage this hunk or any of the remaining ones\n"
-"a - stage this hunk and all later hunks in the file\n"
-"d - do not stage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - köa stycket\n"
-"n - köa inte stycket\n"
-"q - avsluta; köa inte stycket eller något av de följande\n"
-"a - köa stycket och alla följande i filen\n"
-"d - köa inte stycket eller något av de följande i filen"
-
-msgid ""
-"y - stash this hunk\n"
-"n - do not stash this hunk\n"
-"q - quit; do not stash this hunk or any of the remaining ones\n"
-"a - stash this hunk and all later hunks in the file\n"
-"d - do not stash this hunk or any of the later hunks in the file"
-msgstr ""
-"y - \"stash\":a stycket\n"
-"n - \"stash\":a inte stycket\n"
-"q - avsluta; \"stash\":a inte stycket eller något av de följande\n"
-"a - \"stash\":a stycket och alla följande i filen\n"
-"d - \"stash\":a inte stycket eller något av de följande i filen"
-
-msgid ""
-"y - unstage this hunk\n"
-"n - do not unstage this hunk\n"
-"q - quit; do not unstage this hunk or any of the remaining ones\n"
-"a - unstage this hunk and all later hunks in the file\n"
-"d - do not unstage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - ta bort stycket från kön\n"
-"n - ta inte bort stycket från kön\n"
-"q - avsluta; ta inte bort stycket eller något av de följande från kön\n"
-"a - ta bort stycket och alla följande i filen från kön\n"
-"d - ta inte bort stycket eller något av de följande i filen från kön"
-
-msgid ""
-"y - apply this hunk to index\n"
-"n - do not apply this hunk to index\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - applicera stycket på indexet\n"
-"n - applicera inte stycket på indexet\n"
-"q - avsluta; applicera inte stycket eller något av de följande\n"
-"a - applicera stycket och alla följande i filen\n"
-"d - applicera inte stycket eller något av de följande i filen"
-
-msgid ""
-"y - discard this hunk from worktree\n"
-"n - do not discard this hunk from worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - förkasta stycket från arbetskatalogen\n"
-"n - förkasta inte stycket från arbetskatalogen\n"
-"q - avsluta; förkasta inte stycket eller något av de följande\n"
-"a - förkasta stycket och alla följande i filen\n"
-"d - förkasta inte stycket eller något av de följande i filen"
-
-msgid ""
-"y - discard this hunk from index and worktree\n"
-"n - do not discard this hunk from index and worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - förkasta stycket från indexet och arbetskatalogen\n"
-"n - förkasta inte stycket från indexet och arbetskatalogen\n"
-"q - avsluta; förkasta inte stycket eller något av de följande\n"
-"a - förkasta stycket och alla följande i filen\n"
-"d - förkasta inte stycket eller något av de följande i filen"
-
-msgid ""
-"y - apply this hunk to index and worktree\n"
-"n - do not apply this hunk to index and worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - applicera stycket på indexet och arbetskatalogen\n"
-"n - applicera inte stycket på indexet och arbetskatalogen\n"
-"q - avsluta; applicera inte stycket eller något av de följande\n"
-"a - applicera stycket och alla följande i filen\n"
-"d - applicera inte stycket eller något av de följande i filen"
-
-msgid ""
-"y - apply this hunk to worktree\n"
-"n - do not apply this hunk to worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - applicera stycket på arbetskatalogen\n"
-"n - applicera inte stycket på arbetskatalogen\n"
-"q - avsluta; applicera inte stycket eller något av de följande\n"
-"a - applicera stycket och alla följande i filen\n"
-"d - applicera inte stycket eller något av de följande i filen"
-
-msgid ""
-"g - select a hunk to go to\n"
-"/ - search for a hunk matching the given regex\n"
-"j - leave this hunk undecided, see next undecided hunk\n"
-"J - leave this hunk undecided, see next hunk\n"
-"k - leave this hunk undecided, see previous undecided hunk\n"
-"K - leave this hunk undecided, see previous hunk\n"
-"s - split the current hunk into smaller hunks\n"
-"e - manually edit the current hunk\n"
-"? - print help\n"
-msgstr ""
-"g - välj ett stycke att gå till\n"
-"/ - sök efter stycke som motsvarar angivet reguljärt uttryck\n"
-"j - lämna stycket obestämt, se nästa obestämda stycke\n"
-"J - lämna stycket obestämt, se nästa stycke\n"
-"k - lämna stycket obestämt, se föregående obestämda stycke\n"
-"K - lämna stycket obestämt, se föregående stycke\n"
-"s - dela aktuellt stycke i mindre styckens\n"
-"e - redigera aktuellt stycke manuellt\n"
-"? - visa hjälp\n"
-
-msgid "The selected hunks do not apply to the index!\n"
-msgstr "Markerade stycken kan inte appliceras på indexet!\n"
-
-#, perl-format
-msgid "ignoring unmerged: %s\n"
-msgstr "ignorerar ej sammanslagen: %s\n"
-
-#, perl-format
-msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
-msgstr "Applicera ändrat läge på arbetskatalogen [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
-msgstr "Applicera borttagning på arbetskatalogen [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
-msgstr "Applicera tillägg på arbetskatalogen [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
-msgstr "Applicera stycket på arbetskatalogen [y,n,q,a,d%s,?]? "
-
-msgid "No other hunks to goto\n"
-msgstr "Inga andra stycken att gå till\n"
-
-#, perl-format
-msgid "Invalid number: '%s'\n"
-msgstr "Ogiltigt siffervärde: \"%s\"\n"
-
-#, perl-format
-msgid "Sorry, only %d hunk available.\n"
-msgid_plural "Sorry, only %d hunks available.\n"
-msgstr[0] "Beklagar, det finns bara %d stycke.\n"
-msgstr[1] "Beklagar, det finns bara %d stycken.\n"
-
-msgid "No other hunks to search\n"
-msgstr "Inga andra stycken att söka efter\n"
-
-#, perl-format
-msgid "Malformed search regexp %s: %s\n"
-msgstr "Felaktigt format på reguljärt sökuttryck %s: %s\n"
-
-msgid "No hunk matches the given pattern\n"
-msgstr "Inga stycken motsvarar givet mönster\n"
-
-msgid "No previous hunk\n"
-msgstr "Inget föregående stycke\n"
-
-msgid "No next hunk\n"
-msgstr "Inget följande stycke\n"
-
-msgid "Sorry, cannot split this hunk\n"
-msgstr "Beklagar, kan inte dela stycket\n"
-
-#, perl-format
-msgid "Split into %d hunk.\n"
-msgid_plural "Split into %d hunks.\n"
-msgstr[0] "Dela i %d stycke.\n"
-msgstr[1] "Dela i %d stycken.\n"
-
-msgid "Sorry, cannot edit this hunk\n"
-msgstr "Beklagar, kan inte redigera stycket\n"
-
-#. TRANSLATORS: please do not translate the command names
-#. 'status', 'update', 'revert', etc.
-msgid ""
-"status - show paths with changes\n"
-"update - add working tree state to the staged set of changes\n"
-"revert - revert staged set of changes back to the HEAD version\n"
-"patch - pick hunks and update selectively\n"
-"diff - view diff between HEAD and index\n"
-"add untracked - add contents of untracked files to the staged set of "
-"changes\n"
-msgstr ""
-"status - visa sökvägar med ändringar\n"
-"update - lägg arbetskatalogens tillstånd till köade ändringar\n"
-"revert - återställ köade ändringar till HEAD-versionen\n"
-"patch - välj och uppdatera valda stycken\n"
-"diff - visa diff mellan HEAD och index\n"
-"add untracked - lägg till innehåll i ospårade filer till köade ändringar\n"
-
-msgid "missing --"
-msgstr "saknad --"
-
-#, perl-format
-msgid "unknown --patch mode: %s"
-msgstr "okänt läge för --patch: %s"
-
-#, perl-format
-msgid "invalid argument %s, expecting --"
-msgstr "felaktigt argument %s, förväntar --"
-
msgid "local zone differs from GMT by a non-minute interval\n"
msgstr "lokal zon skiljer sig från GMT med delar av minuter\n"
@@ -21351,7 +22257,7 @@ msgstr "lokal tidszonförskjutning större än eller lika med 24 timmar\n"
#, perl-format
msgid "fatal: command '%s' died with exit code %d"
-msgstr "ödesdigert: kommandot \"%s\" dog med slutkoden %d"
+msgstr "ödesdigert: kommandot â€%s†dog med slutkoden %d"
msgid "the editor exited uncleanly, aborting everything"
msgstr "textredigeringsprogrammet avslutades med fel, avbryter allting"
@@ -21359,12 +22265,11 @@ msgstr "textredigeringsprogrammet avslutades med fel, avbryter allting"
#, perl-format
msgid ""
"'%s' contains an intermediate version of the email you were composing.\n"
-msgstr ""
-"\"%s\" innehåller en mellanliggande version av e-postbrevet du skrev.\n"
+msgstr "â€%s†innehÃ¥ller en mellanliggande version av e-postbrevet du skrev.\n"
#, perl-format
msgid "'%s.final' contains the composed email.\n"
-msgstr "\"%s.final\" innehåller det skrivna brevet.\n"
+msgstr "â€%s.final†innehÃ¥ller det skrivna brevet.\n"
msgid "--dump-aliases incompatible with other options\n"
msgstr "--dump-aliases är inkompatibelt med andra flaggor\n"
@@ -21374,9 +22279,9 @@ msgid ""
"git-send-email is configured with the sendemail.* options - note the 'e'.\n"
"Set sendemail.forbidSendmailVariables to false to disable this check.\n"
msgstr ""
-"ödesdigert: hittade konfigurationsflaggor för \"sendmail\"\n"
-"git-send-email konfigureras med \"sendemail.*\"-flaggor - lägg märke till \"e"
-"\".\n"
+"ödesdigert: hittade konfigurationsflaggor för â€sendmailâ€\n"
+"git-send-email konfigureras med â€sendemail.*â€-flaggor - lägg märke till "
+"â€eâ€.\n"
"Sätt sendemail.forbidSendmailVariables till false för att inaktivera denna "
"kontroll.\n"
@@ -21387,16 +22292,16 @@ msgid ""
"`batch-size` and `relogin` must be specified together (via command-line or "
"configuration option)\n"
msgstr ""
-"\"batch-size\" och \"relogin\" måste anges tillsammans (via kommandorad "
-"eller konfigurationsflagga)\n"
+"â€batch-size†och â€relogin†mÃ¥ste anges tillsammans (via kommandorad eller "
+"konfigurationsflagga)\n"
#, perl-format
msgid "Unknown --suppress-cc field: '%s'\n"
-msgstr "Okänt fält i --suppress-cc: \"%s\"\n"
+msgstr "Okänt fält i --suppress-cc: â€%sâ€\n"
#, perl-format
msgid "Unknown --confirm setting: '%s'\n"
-msgstr "Okänd inställning i --confirm: \"%s\"\n"
+msgstr "Okänd inställning i --confirm: â€%sâ€\n"
#, perl-format
msgid "warning: sendmail alias with quotes is not supported: %s\n"
@@ -21404,11 +22309,11 @@ msgstr "varning: sendmail-alias med citationstecken stöds inte. %s\n"
#, perl-format
msgid "warning: `:include:` not supported: %s\n"
-msgstr "varning: \":include:\" stöds inte: %s\n"
+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 til â€/fil†eller â€|rör†stöds inte: %s\n"
#, perl-format
msgid "warning: sendmail line is not recognized: %s\n"
@@ -21422,10 +22327,10 @@ msgid ""
" * Saying \"./%s\" if you mean a file; or\n"
" * Giving --format-patch option if you mean a range.\n"
msgstr ""
-"Filen \"%s\" finns men kan också vara ett incheckningsintervall\n"
+"Filen â€%s†finns men kan ocksÃ¥ vara ett incheckningsintervall\n"
"att skapa patchar för. Gör otvetydigt genom att...\n"
"\n"
-" * Säga \"./%s\" om du menar en fil; eller\n"
+" * Säga â€./%s†om du menar en fil; eller\n"
" * Ange flaggan --format-patch om du menar ett intervall.\n"
#, perl-format
@@ -21456,20 +22361,20 @@ msgid ""
"\n"
"Clear the body content if you don't wish to send a summary.\n"
msgstr ""
-"Rader som börjar med \"GIT:\" kommer tas bort.\n"
+"Rader som börjar med â€GIT:†kommer tas bort.\n"
"Överväg att ta med en övergripande diffstatus eller\n"
"innehållsförteckning för patchen du skriver.\n"
"\n"
"Rensa brevkroppen om du inte vill sända någon sammanfattning.\n"
#, perl-format
-msgid "Failed to open %s: %s"
-msgstr "Misslyckades öppna %s: %s"
-
-#, perl-format
msgid "Failed to open %s.final: %s"
msgstr "Misslyckades öppna %s.final: %s"
+#, perl-format
+msgid "Failed to open %s: %s"
+msgstr "Misslyckades öppna %s: %s"
+
msgid "Summary email is empty, skipping it\n"
msgstr "Sammanfattande brev tomt, hoppar över\n"
@@ -21496,15 +22401,15 @@ msgid ""
msgstr ""
"Vägrar sända eftersom patchen\n"
"\t%s\n"
-"har mallärendet \"*** SUBJECT HERE ***\". Använd --force om du verkligen "
-"vill sända.\n"
+"har mallärendet â€*** SUBJECT HERE ***â€. Använd --force om du verkligen vill "
+"sända.\n"
msgid "To whom should the emails be sent (if anyone)?"
msgstr "Till vem ska breven sändas (om någon)?"
#, perl-format
msgid "fatal: alias '%s' expands to itself\n"
-msgstr "ödesdigert: aliaset \"%s\" expanderar till sig själv\n"
+msgstr "ödesdigert: aliaset â€%s†expanderar till sig själv\n"
msgid "Message-ID to be used as In-Reply-To for the first email (if any)? "
msgstr ""
@@ -21522,7 +22427,7 @@ msgstr "Vad vill du göra med adressen? (q=avsluta, d=kasta, e=redigera): "
#, perl-format
msgid "CA path \"%s\" does not exist"
-msgstr "CA-sökvägen \"%s\" finns inte"
+msgstr "CA-sökvägen â€%s†finns inte"
msgid ""
" The Cc list above has been expanded by additional\n"
@@ -21542,9 +22447,9 @@ msgstr ""
" Beteendet styrs av konfigurationsinställningen\n"
" sendemail.confirm\n"
"\n"
-" För ytterligare information, kör \"git send-email --help\".\n"
+" För ytterligare information, kör â€git send-email --helpâ€.\n"
" För att behålla nuvarande beteende, men dölja detta\n"
-" meddelande, kör \"git config --global sendemail.confirm auto\".\n"
+" meddelande, kör â€git config --global sendemail.confirm autoâ€.\n"
"\n"
#. TRANSLATORS: Make sure to include [y] [n] [e] [q] [a] in your
@@ -21554,7 +22459,7 @@ msgid "Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): "
msgstr "Sända brevet? (y=ja, n=nej, e=redigera, q=avsluta, a=alla): "
msgid "Send this email reply required"
-msgstr "Svar krävs på frågan \"Sända brevet?\""
+msgstr "Svar krävs pÃ¥ frÃ¥gan â€Sända brevet?â€"
msgid "The required SMTP server is not properly defined."
msgstr "Nödvändig SMTP-server har inte angivits korrekt."
@@ -21602,31 +22507,35 @@ msgstr "kan inte öppna filen %s"
#, perl-format
msgid "(mbox) Adding cc: %s from line '%s'\n"
-msgstr "(mbox) Lägger till cc: %s från raden \"%s\"\n"
+msgstr "(mbox) Lägger till cc: %s frÃ¥n raden â€%sâ€\n"
#, perl-format
msgid "(mbox) Adding to: %s from line '%s'\n"
-msgstr "(mbox) Lägger till to: %s från raden \"%s\"\n"
+msgstr "(mbox) Lägger till to: %s frÃ¥n raden â€%sâ€\n"
#, perl-format
msgid "(non-mbox) Adding cc: %s from line '%s'\n"
-msgstr "(icke-mbox) Lägger till cc: %s från raden \"%s\"\n"
+msgstr "(icke-mbox) Lägger till cc: %s frÃ¥n raden â€%sâ€\n"
#, perl-format
msgid "(body) Adding cc: %s from line '%s'\n"
-msgstr "(kropp) Lägger till cc: %s från raden \"%s\"\n"
+msgstr "(kropp) Lägger till cc: %s frÃ¥n raden â€%sâ€\n"
#, perl-format
msgid "(%s) Could not execute '%s'"
-msgstr "(%s) Kunde inte köra \"%s\""
+msgstr "(%s) Kunde inte köra â€%sâ€"
#, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) Lägger till %s: %s från: \"%s\"\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) Felformaterad utdata frÃ¥n â€%sâ€"
#, perl-format
msgid "(%s) failed to close pipe to '%s'"
-msgstr "(%s) misslyckades stänga röret till \"%s\""
+msgstr "(%s) misslyckades stänga röret till â€%sâ€"
+
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) Lägger till %s: %s frÃ¥n: â€%sâ€\n"
msgid "cannot send message as 7bit"
msgstr "kan inte sända brev som sjubitars"
@@ -21659,8 +22568,7 @@ msgstr ""
#, perl-format
msgid "Skipping %s with backup suffix '%s'.\n"
msgstr ""
-"Hoppar över %s med filnamnstillägget \"%s\" som används för "
-"säkerhetskopior.\n"
+"Hoppar över %s med filnamnstillägget â€%s†som används för säkerhetskopior.\n"
#. TRANSLATORS: please keep "[y|N]" as is.
#, perl-format
diff --git a/po/tr.po b/po/tr.po
index 1e1d031..5837752 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -1,8 +1,8 @@
# Turkish translations for Git
# Git Türkçe çevirileri
-# Copyright (C) 2020-2022 Emir SARI <emir_sari@icloud.com>
+# 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-2022
+# Emir SARI <emir_sari@icloud.com>, 2020-2024
#
# ######################################################### #
# Git Türkçe kavramlar dizini / Git Turkish Glossary #
@@ -20,13 +20,14 @@
# clone | klon(lamak) #
# commit (ad) | iÅŸleme #
# commit (eyl.) | iÅŸlemek #
-# commitish | iÅŸlememsi #
+# commit-ish | iÅŸlememsi #
# conflict | çakışma #
# cruft | süprüntü #
# dangling object | sallanan nesne #
# detached HEAD | ayrık HEAD #
# dirty | kirli #
# evil merge | uÄŸursuz birleÅŸtirme #
+# fanout | çıkış sayısı #
# fast-forward | ileri sarım/sarmak #
# fetch | getirme(k) #
# fixup | düzeltmek #
@@ -39,6 +40,8 @@
# mark | im(lemek) #
# merge | birleÅŸtirme(k) #
# octopus | ahtapot #
+# orphan | yetim #
+# orphaned | yetim bırakılmış #
# overlay | yerpaylaşım #
# pack | paket #
# parent | üst öge #
@@ -46,10 +49,10 @@
# pathspec | yol belirteci #
# pattern | dizgi #
# porcelain | okunabilir #
-# prune | budamak #
+# prune | buda(mak) #
# pseudoref | yalancıktan başvuru #
-# pull | çekme(k) #
-# push | itme(k) #
+# pull | çek(mek) #
+# push | it(mek) #
# rebase | yeniden temellendirme(k) #
# record | kayıt yaz(mak) #
# ref | baÅŸvuru #
@@ -74,6 +77,7 @@
# string | dizi #
# subdirectory | altdizin #
# submodule | altmodül #
+# superproject | üst proje #
# symlink | sembolik baÄŸ #
# symref | sembolik baÅŸvuru #
# tag | etiket #
@@ -82,6 +86,7 @@
# trailer | artbilgi #
# tree | ağaç #
# treeish | ağacımsı #
+# unborn | henüz doğmamış (dal) #
# unstage | hazırlıktan çıkar(mak) #
# upstream | üstkaynak #
# worktree/working tree | çalışma ağacı #
@@ -91,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: 2022-06-22 12:46+0300\n"
-"PO-Revision-Date: 2022-06-22 16:00+0300\n"
+"POT-Creation-Date: 2024-02-16 22:04+0300\n"
+"PO-Revision-Date: 2024-02-16 22: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"
@@ -127,13 +132,13 @@ msgstr "'%s' hazırlanamadı"
msgid "could not write index"
msgstr "indeks yazılamadı"
-#, c-format, perl-format
+#, c-format
msgid "updated %d path\n"
msgid_plural "updated %d paths\n"
msgstr[0] "%d yol güncellendi\n"
msgstr[1] "%d yol güncellendi\n"
-#, c-format, perl-format
+#, c-format
msgid "note: %s is untracked now.\n"
msgstr "not: %s artık izlenmiyor.\n"
@@ -147,7 +152,7 @@ msgstr "Geri al"
msgid "Could not parse HEAD^{tree}"
msgstr "HEAD^{tree} ayrıştırılamadı"
-#, c-format, perl-format
+#, c-format
msgid "reverted %d path\n"
msgid_plural "reverted %d paths\n"
msgstr[0] "%d yol geri alındı\n"
@@ -160,7 +165,7 @@ msgstr "Ä°zlenmeyen dosya yok.\n"
msgid "Add untracked"
msgstr "Ä°zlenmeyenleri ekle"
-#, c-format, perl-format
+#, c-format
msgid "added %d path\n"
msgid_plural "added %d paths\n"
msgstr[0] "%d yol eklendi\n"
@@ -254,19 +259,19 @@ msgstr "indeks yenilenemedi"
msgid "Bye.\n"
msgstr "Güle güle.\n"
-#, c-format, perl-format
+#, c-format
msgid "Stage mode change [y,n,q,a,d%s,?]? "
msgstr "Kip değişimi hazırlansın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage deletion [y,n,q,a,d%s,?]? "
msgstr "Silme hazırlansın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage addition [y,n,q,a,d%s,?]? "
msgstr "Ekleme hazırlansın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stage this hunk [y,n,q,a,d%s,?]? "
msgstr "Bu parça hazırlansın mı [y,n,q,a,d%s,?]? "
@@ -290,19 +295,19 @@ msgstr ""
"a - bu parçayı ve sonraki tüm parçaları hazırla\n"
"d - bu parçayı veya sonraki parçalardan herhangi birini hazırlama\n"
-#, c-format, perl-format
+#, c-format
msgid "Stash mode change [y,n,q,a,d%s,?]? "
msgstr "Kip değişimi zulalansın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash deletion [y,n,q,a,d%s,?]? "
msgstr "Silme zulalansın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash addition [y,n,q,a,d%s,?]? "
msgstr "Ekleme zulalansın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Stash this hunk [y,n,q,a,d%s,?]? "
msgstr "Bu parça zulalansın mı [y,n,q,a,d%s,?]? "
@@ -326,19 +331,19 @@ msgstr ""
"a - bu parçayı ve sonraki tüm parçaları zulala\n"
"d - bu parçayı veya sonraki parçalardan herhangi birini zulalama\n"
-#, c-format, perl-format
+#, c-format
msgid "Unstage mode change [y,n,q,a,d%s,?]? "
msgstr "Kip değişimi hazırlıktan çıkarılsın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage deletion [y,n,q,a,d%s,?]? "
msgstr "Silme hazırlıktan çıkarılsın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage addition [y,n,q,a,d%s,?]? "
msgstr "Ekleme hazırlıktan çıkarılsın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Unstage this hunk [y,n,q,a,d%s,?]? "
msgstr "Bu parça hazırlıktan çıkarılsın mı [y,n,q,a,d%s,?]? "
@@ -362,19 +367,19 @@ msgstr ""
"a - bu parçayı ve sonraki tüm parçaları hazırlıktan çıkar\n"
"d - bu parçayı veya sonraki parçalardan herhangi birini hazırlıktan çıkarma\n"
-#, c-format, perl-format
+#, c-format
msgid "Apply mode change to index [y,n,q,a,d%s,?]? "
msgstr "Kip değişimi indekse uygulansın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply deletion to index [y,n,q,a,d%s,?]? "
msgstr "Silme indekse uygulansın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply addition to index [y,n,q,a,d%s,?]? "
msgstr "Ekleme indekse uygulansın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply this hunk to index [y,n,q,a,d%s,?]? "
msgstr "Bu parça indekse uygulansın mı [y,n,q,a,d%s,?]? "
@@ -398,19 +403,19 @@ msgstr ""
"a - bu parçayı ve sonraki tüm parçaları uygula\n"
"d - bu parçayı veya sonraki parçalardan herhangi birini uygulama\n"
-#, c-format, perl-format
+#, c-format
msgid "Discard mode change from worktree [y,n,q,a,d%s,?]? "
msgstr "Kip değişimi çalışma ağacından atılsın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard deletion from worktree [y,n,q,a,d%s,?]? "
msgstr "Silme çalışma ağacından atılsın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard addition from worktree [y,n,q,a,d%s,?]? "
msgstr "Ekleme çalışma ağacından atılsın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard this hunk from worktree [y,n,q,a,d%s,?]? "
msgstr "Bu parça çalışma ağacından atılsın mı [y,n,q,a,d%s,?]? "
@@ -434,20 +439,20 @@ msgstr ""
"a - bu parçayı ve sonraki tüm parçaları at\n"
"d - bu parçayı veya sonraki parçalardan herhangi birini atma\n"
-#, c-format, perl-format
+#, c-format
msgid "Discard mode change from index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
"Kip değişimi indeksten ve çalışma ağacından atılsın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard deletion from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Silme indeksten ve çalışma ağacından atılsın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard addition from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Ekleme indeksten ve çalışma ağacından atılsın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Discard this hunk from index and worktree [y,n,q,a,d%s,?]? "
msgstr "Bu parça indeksten ve çalışma ağacından atılsın mı [y,n,q,a,d%s,?]? "
@@ -464,20 +469,20 @@ msgstr ""
"a - bu parçayı ve sonraki tüm parçaları at\n"
"d - bu parçayı veya sonraki parçalardan herhangi birini atma\n"
-#, c-format, perl-format
+#, c-format
msgid "Apply mode change to index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
"Kip değişimi indekse ve çalışma ağacına uygulansın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply deletion to index and worktree [y,n,q,a,d%s,?]? "
msgstr "Silme indekse ve çalışma ağacına uygulansın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply addition to index and worktree [y,n,q,a,d%s,?]? "
msgstr "Ekleme indekse ve çalışma ağacına uygulansın mı [y,n,q,a,d%s,?]? "
-#, c-format, perl-format
+#, c-format
msgid "Apply this hunk to index and worktree [y,n,q,a,d%s,?]? "
msgstr "Bu parça indekse ve çalışma ağacına uygulansın mı [y,n,q,a,d%s,?]? "
@@ -494,6 +499,22 @@ msgstr ""
"a - bu parçayı ve sonraki tüm parçaları uygula\n"
"d - bu parçayı veya sonraki parçalardan herhangi birini uygulama\n"
+#, c-format
+msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
+msgstr "Kip değişimi çalışma ağacına uygulansın mı [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
+msgstr "Silme çalışma ağacına uygulansın mı [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
+msgstr "Ekleme çalışma ağacına uygulansın mı [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
+msgstr "Bu parça çalışma ağacına uygulansın mı [y,n,q,a,d%s,?]? "
+
msgid ""
"y - apply this hunk to worktree\n"
"n - do not apply this hunk to worktree\n"
@@ -511,10 +532,6 @@ msgstr ""
msgid "could not parse hunk header '%.*s'"
msgstr "parça üstbilgisi '%.*s' ayrıştırılamadı"
-#, c-format
-msgid "could not parse colored hunk header '%.*s'"
-msgstr "renklendirilmiş parça üstbilgisi '%.*s' ayrıştırılamadı"
-
msgid "could not parse diff"
msgstr "diff ayrıştırılamadı"
@@ -570,8 +587,6 @@ msgstr ""
"'%c' satır kaldırmak için onları silin.\n"
"%c kaldırılacak.\n"
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: 'it' refers to the patch mentioned in the previous messages.
msgid ""
"If it does not apply cleanly, you will be given an opportunity to\n"
"edit again. If all lines of the hunk are removed, then the edit is\n"
@@ -587,20 +602,12 @@ msgstr "parça üstbilgisi ayrıştırılamadı"
msgid "'git apply --cached' failed"
msgstr "'git apply --cached' başarısız oldu"
-#. #-#-#-#-# add-patch.c.po #-#-#-#-#
#. TRANSLATORS: do not translate [y/n]
#. The program will only accept that input at this point.
#. Consider translating (saying "no" discards!) as
#. (saying "n" for "no" discards!) if the translation
#. of the word "no" does not start with n.
#.
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: do not translate [y/n]
-#. The program will only accept that input
-#. at this point.
-#. Consider translating (saying "no" discards!) as
-#. (saying "n" for "no" discards!) if the translation
-#. of the word "no" does not start with n.
msgid ""
"Your edited hunk does not apply. Edit again (saying \"no\" discards!) [y/n]? "
msgstr ""
@@ -715,9 +722,10 @@ msgstr "Çekme yapılamaz; birleştirmesi tamamlanmamış dosyalarınız var."
msgid "Reverting is not possible because you have unmerged files."
msgstr "Geriye al yapılamaz; birleştirmesi tamamlanmamış dosyalarınız var."
-#, c-format
-msgid "It is not possible to %s because you have unmerged files."
-msgstr "%s yapılamıyor; birleştirmesi tamamlanmamış dosyalarınız var."
+msgid "Rebasing is not possible because you have unmerged files."
+msgstr ""
+"Yeniden temellendirme yapılamaz; birleştirmesi tamamlanmamış dosyalarınız "
+"var."
msgid ""
"Fix them up in the work tree, and then use 'git add/rm <file>'\n"
@@ -730,7 +738,7 @@ msgid "Exiting because of an unresolved conflict."
msgstr "Çözüme kavuşturulmamış bir çakışmadan dolayı çıkılıyor."
msgid "You have not concluded your merge (MERGE_HEAD exists)."
-msgstr "Birleştirmenizi sonuçlandırmadınız (MERGE_HEAD mevcut)."
+msgstr "Birleştirmenizi sonuçlandırmadınız (MERGE_HEAD var)."
msgid "Please, commit your changes before merging."
msgstr "Birleştirme öncesinde değişikliklerinizi işleyin."
@@ -738,6 +746,23 @@ msgstr "Birleştirme öncesinde değişikliklerinizi işleyin."
msgid "Exiting because of unfinished merge."
msgstr "Tamamlanmamış birleştirmeden dolayı çıkılıyor."
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"Iraksak dallar ileri sarılamaz; şunlardan birini yapmanız gerekiyor:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"veya\n"
+"\n"
+"\tgit rebase\n"
+
msgid "Not possible to fast-forward, aborting."
msgstr "İleri sarma olanaklı değil, iptal ediliyor."
@@ -801,12 +826,35 @@ msgstr ""
"kapatabilirsiniz.\n"
"\n"
+#, c-format
+msgid ""
+"The following paths have been moved outside the\n"
+"sparse-checkout definition but are not sparse due to local\n"
+"modifications.\n"
+msgstr ""
+"Aşağıdaki yollar, aralıklı çıkış tanımının dışına\n"
+"taşındı; ancak yerel değişikliklerden dolayı\n"
+"aralıklı değiller.\n"
+
+msgid ""
+"To correct the sparsity of these paths, do the following:\n"
+"* Use \"git add --sparse <paths>\" to update the index\n"
+"* Use \"git sparse-checkout reapply\" to apply the sparsity rules"
+msgstr ""
+"Bu yollardaki aralıklılığı düzeltmek için aşağıdakini yapın:\n"
+"* İndeksi güncellemek için \"git add --sparse <yollar>\" kullanın\n"
+"* Aralıklılık kurallarını uygulamak için \"git sparse-checkout reapply\" "
+"yapın"
+
msgid "cmdline ends with \\"
msgstr "komut satırı \\ ile bitiyor"
msgid "unclosed quote"
msgstr "kapatılmamış tırnak"
+msgid "too many arguments"
+msgstr "pek fazla argüman"
+
#, c-format
msgid "unrecognized whitespace option '%s'"
msgstr "tanımlanamayan boşluk seçeneği '%s'"
@@ -823,6 +871,12 @@ msgstr "'%s' ve '%s' seçenekleri birlikte kullanılamaz"
msgid "'%s' outside a repository"
msgstr "'%s' bir depo dışında"
+msgid "failed to read patch"
+msgstr "yama okunamadı"
+
+msgid "patch too large"
+msgstr "yama pek büyük"
+
#, c-format
msgid "Cannot prepare timestamp regexp %s"
msgstr "Zaman damgası düzenli ifadesi %s hazırlanamıyor"
@@ -1157,6 +1211,10 @@ msgid "cannot open %s"
msgstr "%s açılamıyor"
#, c-format
+msgid "cannot unlink '%s'"
+msgstr "'%s' bağlantısı kesilemiyor"
+
+#, c-format
msgid "Hunk #%d applied cleanly."
msgstr "Parça #%d sorunsuzca uygulandı."
@@ -1298,6 +1356,10 @@ msgid "unsupported file mode: 0%o (SHA1: %s)"
msgstr "desteklenmeyen dosya kipi: 0%o (SHA1: %s)"
#, c-format
+msgid "deflate error (%d)"
+msgstr "söndürme hatası (%d)"
+
+#, c-format
msgid "unable to start '%s' filter"
msgstr "'%s' süzgeci başlatılamıyor"
@@ -1317,10 +1379,6 @@ msgid "path too long (%d chars, SHA1: %s): %s"
msgstr "yol çok uzun (%d karakter, SHA1: %s): %s"
#, c-format
-msgid "deflate error (%d)"
-msgstr "söndürme hatası (%d)"
-
-#, c-format
msgid "timestamp too large for this system: %<PRIuMAX>"
msgstr "zaman damgası bu sistem için çok büyük: %<PRIuMAX>"
@@ -1340,8 +1398,12 @@ msgid "cannot read '%s'"
msgstr "'%s' okunamıyor"
#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr "yol belirteci '%s', geçerli dizinin dışındaki dosyalarla eşleşiyor"
+
+#, c-format
msgid "pathspec '%s' did not match any files"
-msgstr "yol belirteci '%s' hiçbir dosya ile eşleşmedi"
+msgstr "yol belirteci '%s', hiçbir dosya ile eşleşmedi"
#, c-format
msgid "no such ref: %.*s"
@@ -1355,9 +1417,6 @@ msgstr "geçerli bir nesne adı değil: %s"
msgid "not a tree object: %s"
msgstr "bir ağaç nesnesi değil: %s"
-msgid "current working directory is untracked"
-msgstr "geçerli çalışma dizini izlenmiyor"
-
#, c-format
msgid "File not found: %s"
msgstr "Dosya bulunamadı: %s"
@@ -1408,6 +1467,12 @@ msgstr "çalışma dizinindeki .gitattributes'u oku"
msgid "report archived files on stderr"
msgstr "arşivlenmiş dosyaları stderr'de raporla"
+msgid "time"
+msgstr "zaman"
+
+msgid "set modification time of archive entries"
+msgstr "arşiv girdilerinin değiştirilme zamanını ayarla"
+
msgid "set compression level"
msgstr "sıkıştırma düzeyini ayarla"
@@ -1437,6 +1502,10 @@ msgid "Unexpected option --output"
msgstr "Beklenmedik seçenek --output"
#, c-format
+msgid "extra command line parameter '%s'"
+msgstr "fazladan komut satırı parametresi '%s'"
+
+#, c-format
msgid "Unknown archive format '%s'"
msgstr "Bilinmeyen arşiv biçimi '%s'"
@@ -1448,6 +1517,13 @@ msgstr "'%s' biçimi için desteklenmeyen argüman: -%d"
msgid "%.*s is not a valid attribute name"
msgstr "%.*s geçerli bir öznitelik adı değil"
+msgid "unable to add additional attribute"
+msgstr "ek öznitelik eklenemiyor"
+
+#, c-format
+msgid "ignoring overly long attributes line %d"
+msgstr "pek uzun öznitelik satırı %d yok sayılıyor"
+
#, c-format
msgid "%s not allowed: %s:%d"
msgstr "%s izin verilmiyor: %s:%d"
@@ -1460,6 +1536,29 @@ msgstr ""
"Gerçek öncü ünlem için '\\!' kullanın."
#, c-format
+msgid "cannot fstat gitattributes file '%s'"
+msgstr "fstat gitattributes dosyası '%s' bulunamıyor"
+
+#, c-format
+msgid "ignoring overly large gitattributes file '%s'"
+msgstr "pek büyük gitattributes dosyası '%s' dosyası yok sayılıyor"
+
+#, c-format
+msgid "ignoring overly large gitattributes blob '%s'"
+msgstr "pek büyük gitattributes ikili nesnesi '%s' yok sayılıyor"
+
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "hatalı --attr-source veya GIT_ATTR_SOURCE"
+
+#, c-format
+msgid "unable to stat '%s'"
+msgstr "'%s' dosyasının bilgileri alınamıyor"
+
+#, c-format
+msgid "unable to read %s"
+msgstr "%s okunamıyor"
+
+#, c-format
msgid "Badly quoted content in file '%s': %s"
msgstr "'%s' dosyasında hatalı tırnağa alınmış içerik: %s"
@@ -1564,9 +1663,6 @@ msgstr[1] "İkili arama: Şundan sonra sınanacak %d revizyon kaldı: %s\n"
msgid "--contents and --reverse do not blend well."
msgstr "--contents ve --reverse birlikte pek iyi gitmiyor."
-msgid "cannot use --contents with final commit object name"
-msgstr "--contents son işleme nesnesi adı ile kullanılamıyor"
-
msgid "--reverse and --first-parent together require specified latest commit"
msgstr ""
"--reverse ve --first-parent birlikte en son iÅŸlemenin belirtilmesini "
@@ -1687,8 +1783,10 @@ msgid "a branch named '%s' already exists"
msgstr "'%s' adında bir dal halihazırda var"
#, c-format
-msgid "cannot force update the branch '%s' checked out at '%s'"
-msgstr "'%s' dalı zorla güncellenemiyor, '%s' konumunda çıkış yapılmış"
+msgid "cannot force update the branch '%s' used by worktree at '%s'"
+msgstr ""
+"şuradaki çalışma ağacı tarafından kullanılan '%s' dalı zorla "
+"güncellenemiyor: '%s'"
#, c-format
msgid "cannot set up tracking information; starting point '%s' is not a branch"
@@ -1696,7 +1794,7 @@ msgstr "izleme bilgisi ayarlanamıyor; başlangıç noktası '%s' bir dal değil
#, c-format
msgid "the requested upstream branch '%s' does not exist"
-msgstr "istenen üstkaynak dalı '%s' mevcut değil"
+msgstr "istenen üstkaynak dalı '%s' yok"
msgid ""
"\n"
@@ -1735,23 +1833,19 @@ msgstr "'%s' altmodülü: altmodül bulunamıyor"
#, c-format
msgid ""
-"You may try updating the submodules using 'git checkout %s && git submodule "
-"update --init'"
+"You may try updating the submodules using 'git checkout --no-recurse-"
+"submodules %s && git submodule update --init'"
msgstr ""
-"Altmodülleri güncellemeyi 'git checkout %s && git submodule update --init' "
-"kullanarak deneyebilirsiniz."
+"'git checkout --no-recurse-submodules %s && git submodule update --init' "
+"kullanarak altmodülleri güncellemeyi deneyebilirsiniz"
#, c-format
msgid "submodule '%s': cannot create branch '%s'"
msgstr "'%s' altmodülü: '%s' dalı oluşturulamıyor"
#, c-format
-msgid "'%s' is already checked out at '%s'"
-msgstr "'%s' çıkışı '%s' konumunda halihazırda yapılmış"
-
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "%s çalışma ağacının HEAD'i güncellenmemiş"
+msgid "'%s' is already used by worktree at '%s'"
+msgstr "'%s', '%s' konumunda halihazırda çalışma ağacı tarafından kullanılıyor"
msgid "git add [<options>] [--] <pathspec>..."
msgstr "git add [<seçenekler>] [--] <yol-blrtç>..."
@@ -1760,38 +1854,31 @@ msgstr "git add [<seçenekler>] [--] <yol-blrtç>..."
msgid "cannot chmod %cx '%s'"
msgstr "%cx '%s' chmod yapılamıyor"
-#, c-format
-msgid "unexpected diff status %c"
-msgstr "beklenmedik diff durumu %c"
-
-msgid "updating files failed"
-msgstr "dosyaları güncelleme başarısız"
-
-#, c-format
-msgid "remove '%s'\n"
-msgstr "kaldır: '%s'\n"
-
msgid "Unstaged changes after refreshing the index:"
msgstr "İndeksi yeniledikten sonra hazırlanmamış değişiklikler:"
-msgid "Could not read the index"
-msgstr "İndeks okunamadı"
+msgid ""
+"the add.interactive.useBuiltin setting has been removed!\n"
+"See its entry in 'git help config' for details."
+msgstr ""
+"add.interactive.useBuiltin ayarı kaldırıldı!\n"
+"Ayrıntılar için onun 'git help config' içindeki girdisine bakın."
-msgid "Could not write patch"
-msgstr "Yama yazılamadı"
+msgid "could not read the index"
+msgstr "indeks okunamadı"
msgid "editing patch failed"
msgstr "yamayı düzenleme başarısız"
#, c-format
-msgid "Could not stat '%s'"
-msgstr "'%s' dosya bilgileri alınamadı"
+msgid "could not stat '%s'"
+msgstr "'%s' bilgileri alınamadı"
-msgid "Empty patch. Aborted."
-msgstr "BoÅŸ yama. Ä°ptal edildi."
+msgid "empty patch. aborted"
+msgstr "boÅŸ yama. iptal edildi."
#, c-format
-msgid "Could not apply '%s'"
+msgid "could not apply '%s'"
msgstr "'%s' uygulanamadı"
msgid "The following paths are ignored by one of your .gitignore files:\n"
@@ -1847,7 +1934,7 @@ msgid "allow updating entries outside of the sparse-checkout cone"
msgstr "aralıklı çıkış konisi dışındaki girdileri güncellemeye izin ver"
msgid "override the executable bit of the listed files"
-msgstr "listelenen dosyaların çalıştırılabilir kısımlarını geçersiz kıl"
+msgstr "listelenen dosyaların yürütülebilir kısımlarını geçersiz kıl"
msgid "warn when adding an embedded repository"
msgstr "gömülü bir depo eklenirken uyar"
@@ -1893,7 +1980,7 @@ msgid ""
msgstr ""
"Gerçekten eklemek istiyorsanız -f kullanın.\n"
"Bu iletiyi 'git config advice.addIgnoredFile false'\n"
-"kullanarak kapatabilirsiniz."
+"yaparak kapatabilirsiniz"
msgid "adding files failed"
msgstr "dosya ekleme başarısız"
@@ -1917,10 +2004,13 @@ msgid ""
msgstr ""
"'git add .' mı demek istediniz?\n"
"Bu iletiyi 'git config advice.addEmptyPathspec false'\n"
-"yaparak kapatabilirsiniz."
+"yaparak kapatabilirsiniz"
msgid "index file corrupt"
-msgstr "indeks dosyası hasar görmüş"
+msgstr "indeks dosyası hasarlı"
+
+msgid "unable to write new index file"
+msgstr "yeni indeks dosyası yazılamıyor"
#, c-format
msgid "bad action '%s' for '%s'"
@@ -2130,9 +2220,6 @@ msgstr ""
"Bir dosyanın \"onlar sildi\" olduğunu kabul etmek için dosya ile 'git rm' "
"yapabilirsiniz."
-msgid "unable to write new index file"
-msgstr "yeni indeks dosyası yazılamıyor"
-
#, c-format
msgid "Could not parse object '%s'."
msgstr "'%s' nesnesi ayrıştırılamadı."
@@ -2145,16 +2232,12 @@ msgid ""
"Not rewinding to ORIG_HEAD"
msgstr ""
"Son 'am' başarısızlığından bu yana HEAD'i hareket ettirmiş görünüyorsunuz.\n"
-"ORIG_HEAD'e geri sarılmıyor."
+"ORIG_HEAD'e geri sarılmıyor"
#, c-format
msgid "failed to read '%s'"
msgstr "'%s' okunamadı"
-#, c-format
-msgid "options '%s=%s' and '%s=%s' cannot be used together"
-msgstr "'%s=%s' ve '%s=%s' seçenekleri birlikte kullanılamaz"
-
msgid "git am [<options>] [(<mbox> | <Maildir>)...]"
msgstr "git am [<seçenekler>] [(<mbox> | <posta-dizin>)...]"
@@ -2164,6 +2247,9 @@ msgstr "git am [<seçenekler>] (--continue | --skip | --abort)"
msgid "run interactively"
msgstr "etkileşimli olarak çalıştır"
+msgid "bypass pre-applypatch and applypatch-msg hooks"
+msgstr "pre-applypatch ve applypatch-msg kancalarını atla"
+
msgid "historical option -- no-op"
msgstr "tarihi seçenek -- no-op"
@@ -2191,10 +2277,6 @@ msgstr "'git-mailinfo'ya -m bayrağını geçir"
msgid "pass --keep-cr flag to git-mailsplit for mbox format"
msgstr "'git-mailsplit'e mbox biçimi için --keep-cr bayrağını geçir"
-msgid "do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"
-msgstr ""
-"'git-mailsplit'e 'am.keepcr'dan bağımsız olarak --keep-cr bayrağını geçirme"
-
msgid "strip everything before a scissors line"
msgstr "bir kesim çizgisinden önceki her şeyi çıkar"
@@ -2250,7 +2332,7 @@ msgid "GPG-sign commits"
msgstr "GPG imzalı işlemeler"
msgid "how to handle empty patches"
-msgstr "boş yamaların nasıl değerlendirileceği"
+msgstr "boş yamaların nasıl ele alınacağı"
msgid "(internal use for git-rebase)"
msgstr "(git-rebase için iç kullanım)"
@@ -2268,7 +2350,7 @@ msgstr "indeks okunamadı"
#, c-format
msgid "previous rebase directory %s still exists but mbox given."
msgstr ""
-"Bir önceki yeniden temellendirme dizini %s hâlâ mevcut; ancak mbox verildi."
+"Bir önceki yeniden temellendirme dizini %s hâlâ var; ancak mbox verildi."
#, c-format
msgid ""
@@ -2306,32 +2388,27 @@ msgstr "git archive: Protokol hatası"
msgid "git archive: expected a flush"
msgstr "git archive: FloÅŸ bekleniyordu"
-msgid "git bisect--helper --bisect-reset [<commit>]"
-msgstr "git bisect--helper --bisect-reset [<iÅŸleme>]"
-
msgid ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<term> --term-{old,good}"
-"=<term>] [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] "
-"[<paths>...]"
+"git bisect start [--term-(new|bad)=<term> --term-(old|good)=<term>] [--no-"
+"checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]"
msgstr ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<terim> --term-{old,good}"
-"=<terim>] [--no-checkout] [--first-parent] [<kötü> [<iyi>...]] [--] "
-"[<yollar>...]"
+"git bisect start [--term-(new|bad)=<uçbirim> --term-(old|good)=<uçbirim>] "
+"[--no-checkout] [--first-parent] [<kötü> [<iyi>...]] [--] [<yol-blrtç>...]"
-msgid "git bisect--helper --bisect-state (bad|new) [<rev>]"
-msgstr "git bisect--helper --bisect-state (bad|new) [<rev>]"
+msgid "git bisect (good|bad) [<rev>...]"
+msgstr "git bisect (good|bad) [<rev>...]"
-msgid "git bisect--helper --bisect-state (good|old) [<rev>...]"
-msgstr "git bisect--helper --bisect-state (good|old) [<rev>...]"
+msgid "git bisect skip [(<rev>|<range>)...]"
+msgstr "git bisect skip [(<rev>|<erim>)...]"
-msgid "git bisect--helper --bisect-replay <filename>"
-msgstr "git bisect--helper --bisect-replay <dosyaadı>"
+msgid "git bisect reset [<commit>]"
+msgstr "git bisect reset [<iÅŸleme>]"
-msgid "git bisect--helper --bisect-skip [(<rev>|<range>)...]"
-msgstr "git bisect--helper --bisect-skip [(<rev>|<erim>)...]"
+msgid "git bisect replay <logfile>"
+msgstr "git bisect replay <günlük-dosyası>"
-msgid "git bisect--helper --bisect-run <cmd>..."
-msgstr "git bisect--helper --bisect-run <komut>..."
+msgid "git bisect run <cmd> [<arg>...]"
+msgstr "git bisect run <komut> [<argüman>...]"
#, c-format
msgid "cannot open file '%s' in mode '%s'"
@@ -2475,9 +2552,6 @@ msgstr "hatalı HEAD - Bana bir HEAD gerek"
msgid "checking out '%s' failed. Try 'git bisect start <valid-branch>'."
msgstr "'%s' çıkış yapımı başarısız. 'git bisect start <geçerli-dal>' deneyin."
-msgid "won't bisect on cg-seek'ed tree"
-msgstr "cg-seek yapılmış bir ağaçta ikili arama yapılmayacak"
-
msgid "bad HEAD - strange symbolic ref"
msgstr "hatalı HEAD - tuhaf sembolik başvuru"
@@ -2529,17 +2603,16 @@ msgid "bisect run failed: no command provided."
msgstr "ikili arama başarısız: Komut verilmedi."
#, c-format
-msgid "unable to verify '%s' on good revision"
-msgstr "'%s', iyi revizyonda doğrulanamadı"
+msgid "unable to verify %s on good revision"
+msgstr "%s, iyi revizyonda doğrulanamıyor"
#, c-format
msgid "bogus exit code %d for good revision"
msgstr "iyi revizyon için anlamsız %d çıkış kodu"
#, c-format
-msgid "bisect run failed: exit code %d from '%s' is < 0 or >= 128"
-msgstr ""
-"bisect çalıştırılamadı: çıkış kodu %d, '%s' konumundan, < 0 veya >= 128"
+msgid "bisect run failed: exit code %d from %s is < 0 or >= 128"
+msgstr "bisect çalıştırılamadı: çıkış kodu %d, %s konumundan, < 0 veya >= 128"
#, c-format
msgid "cannot open file '%s' for writing"
@@ -2548,76 +2621,48 @@ msgstr "'%s' dosyası yazma için açılamadı"
msgid "bisect run cannot continue any more"
msgstr "ikili arama artık çalışmayı sürdüremiyor"
-#, c-format
msgid "bisect run success"
msgstr "ikili arama başarılı"
-#, c-format
msgid "bisect found first bad commit"
msgstr "ikili arama ilk hatalı işlemeyi buldu"
#, c-format
-msgid ""
-"bisect run failed: 'git bisect--helper --bisect-state %s' exited with error "
-"code %d"
-msgstr ""
-"ikili arama çalıştırılamadı: 'git bisect--helper --bisect-state %s', %d hata "
-"koduyla çıktı"
-
-msgid "reset the bisection state"
-msgstr "ikili arama durumunu sıfırla"
-
-msgid "check whether bad or good terms exist"
-msgstr "iyi veya kötü terimlerin olup olmadığını denetle"
-
-msgid "print out the bisect terms"
-msgstr "ikili arama terimlerini yazdır"
+msgid "bisect run failed: 'git bisect %s' exited with error code %d"
+msgstr "ikili arama çalıştırılamadı: 'git bisect %s', %d hata koduyla çıktı"
-msgid "start the bisect session"
-msgstr "ikili arama oturumunu baÅŸlat"
-
-msgid "find the next bisection commit"
-msgstr "bir sonraki ikili arama iÅŸlemesini bul"
-
-msgid "mark the state of ref (or refs)"
-msgstr "başvurunun (veya başvuruların) durumunu imle"
-
-msgid "list the bisection steps so far"
-msgstr "ÅŸu ana kadarki ikili arama durumunu listele"
-
-msgid "replay the bisection process from the given file"
-msgstr "verilen dosyadan ikili arama iÅŸlemini yeniden oynat"
-
-msgid "skip some commits for checkout"
-msgstr "çıkış için birkaç işlemeyi atla"
-
-msgid "visualize the bisection"
-msgstr "ikili aramayı görselleştir"
-
-msgid "use <cmd>... to automatically bisect"
-msgstr "kendiliğinden ikili aramak için <komut>... kullan"
+#, c-format
+msgid "'%s' requires either no argument or a commit"
+msgstr "'%s', bir argüman veya işleme gerektirmiyor"
-msgid "no log for BISECT_WRITE"
-msgstr "BISECT_WRITE için günlük yok"
+#, c-format
+msgid "'%s' requires 0 or 1 argument"
+msgstr "'%s', 0 veya 1 argümanı gerektiriyor"
-msgid "--bisect-reset requires either no argument or a commit"
-msgstr "--bisect-reset bir argüman veya işleme gerektirmiyor"
+#, c-format
+msgid "'%s' requires 0 arguments"
+msgstr "'%s', 0 argüman gerektiriyor"
-msgid "--bisect-terms requires 0 or 1 argument"
-msgstr "--bisect-terms 0 veya 1 argüman gerektiriyor"
+msgid "no logfile given"
+msgstr "hiçbir günlük dosyası verilmedi"
-msgid "--bisect-next requires 0 arguments"
-msgstr "--bisect-next 0 argüman gerektiriyor"
+#, c-format
+msgid "'%s' failed: no command provided."
+msgstr "'%s' başarısız: Komut verilmedi."
-msgid "--bisect-log requires 0 arguments"
-msgstr "--bisect-log 0 argüman gerektiriyor"
+msgid "need a command"
+msgstr "bir komut gerekli"
-msgid "no logfile given"
-msgstr "hiçbir günlük dosyası verilmedi"
+#, c-format
+msgid "unknown command: '%s'"
+msgstr "bilinmeyen komut: '%s'"
msgid "git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"
msgstr "git blame [<seçenekler>] [<rev-sçnk>] [<rev>] [--] <dosya>"
+msgid "git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"
+msgstr "git annotate [<seçenekler>] [<rev-sçnk>] [<rev>] [--] <dosya>"
+
msgid "<rev-opts> are documented in git-rev-list(1)"
msgstr "<rev-sçnk>, git-rev-list(1) içinde belgelendirilmiştir"
@@ -2741,7 +2786,7 @@ msgstr[0] "%s dosyasında yalnızca %lu satır var"
msgstr[1] "%s dosyasında yalnızca %lu satır var"
msgid "Blaming lines"
-msgstr "Genel bakış satırları"
+msgstr "Satırlara bakılıyor"
msgid "git branch [<options>] [-r | -a] [--merged] [--no-merged]"
msgstr "git branch [<seçenekler>] [-r | -a] [--merged] [--no-merged]"
@@ -2774,7 +2819,7 @@ msgstr "git branch [<seçenekler>] [-r | -a] [--format]"
#, c-format
msgid ""
"deleting branch '%s' that has been merged to\n"
-" '%s', but not yet merged to HEAD."
+" '%s', but not yet merged to HEAD"
msgstr ""
"'%s' dalı siliniyor: Bu dal '%s'\n"
" dalına birleştirilmiş; ancak HEAD'e henüz birleştirilmemiş."
@@ -2782,43 +2827,49 @@ msgstr ""
#, c-format
msgid ""
"not deleting branch '%s' that is not yet merged to\n"
-" '%s', even though it is merged to HEAD."
+" '%s', even though it is merged to HEAD"
msgstr ""
"'%s' dalı silinmiyor: Bu dal HEAD'e birleştirilmiş olmasına rağmen\n"
" '%s' dalına birleştirilmemiş."
#, c-format
-msgid "Couldn't look up commit object for '%s'"
+msgid "couldn't look up commit object for '%s'"
msgstr "'%s' için işleme nesnesi aranamadı"
#, c-format
-msgid ""
-"The branch '%s' is not fully merged.\n"
-"If you are sure you want to delete it, run 'git branch -D %s'."
-msgstr ""
-"'%s' dalı tümüyle birleştirilmemiş.\n"
-"Eğer silmek istediğinizden eminseniz 'git branch -D %s' çalıştırın."
+msgid "the branch '%s' is not fully merged"
+msgstr "'%s' dalı tümüyle birleştirilmedi"
-msgid "Update of config-file failed"
-msgstr "config-file güncellemesi başarısız"
+#, c-format
+msgid "If you are sure you want to delete it, run 'git branch -D %s'"
+msgstr "Onu silmek istediğinizden eminseniz 'git branch -D %s' çalıştırın."
+
+msgid "update of config-file failed"
+msgstr "config-file güncellenemedi"
msgid "cannot use -a with -d"
msgstr "-a, -d ile kullanılamıyor"
-msgid "Couldn't look up commit object for HEAD"
-msgstr "HEAD için işleme nesnesi aranamadı."
+#, c-format
+msgid "cannot delete branch '%s' used by worktree at '%s'"
+msgstr ""
+"'%s' konumundaki çalışma ağacı tarafından kullanılan '%s' dalı silinemiyor"
#, c-format
-msgid "Cannot delete branch '%s' checked out at '%s'"
-msgstr "'%s' dalı silinemiyor, şurada çıkış yapılmış: '%s'."
+msgid "remote-tracking branch '%s' not found"
+msgstr "uzak izleme dalı '%s' bulunamadı"
#, c-format
-msgid "remote-tracking branch '%s' not found."
-msgstr "Uzak izleme dalı '%s' bulunamadı."
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"'%s' dalı bulunamadı.\n"
+"--remote yazmayı mı unuttunuz?"
#, c-format
-msgid "branch '%s' not found."
-msgstr "'%s' dalı bulunamadı."
+msgid "branch '%s' not found"
+msgstr "'%s' dalı bulunamadı"
#, c-format
msgid "Deleted remote-tracking branch %s (was %s).\n"
@@ -2839,46 +2890,52 @@ msgid "HEAD (%s) points outside of refs/heads/"
msgstr "HEAD (%s), refs/heads/ dışına işaret ediyor"
#, c-format
-msgid "Branch %s is being rebased at %s"
+msgid "branch %s is being rebased at %s"
msgstr "%s dalı %s konumunda yeniden temellendiriliyor"
#, c-format
-msgid "Branch %s is being bisected at %s"
+msgid "branch %s is being bisected at %s"
msgstr "%s dalı %s konumunda ikili aranıyor"
-msgid "cannot copy the current branch while not on any."
-msgstr "Bir dalın üzerinde değilken geçerli dal kopyalanamaz."
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "%s çalışma ağacının HEAD'i güncellenmemiş"
-msgid "cannot rename the current branch while not on any."
-msgstr "Bir dalın üzerinde değilken geçerli dal yeniden adlandırılamaz."
+#, c-format
+msgid "invalid branch name: '%s'"
+msgstr "geçersiz dal adı: '%s'"
+
+#, c-format
+msgid "no commit on branch '%s' yet"
+msgstr "'%s' dalında henüz bir işleme yok"
#, c-format
-msgid "Invalid branch name: '%s'"
-msgstr "Geçersiz dal adı: '%s'"
+msgid "no branch named '%s'"
+msgstr "'%s' adında bir dal yok"
-msgid "Branch rename failed"
-msgstr "Dal yeniden adlandırması başarısız"
+msgid "branch rename failed"
+msgstr "dal yeniden adlandırılamadı"
-msgid "Branch copy failed"
-msgstr "Dal kopyalaması başarısız"
+msgid "branch copy failed"
+msgstr "dal kopyalanamadı"
#, c-format
-msgid "Created a copy of a misnamed branch '%s'"
-msgstr "Yanlış adlandırılan '%s' dalının bir kopyası oluşturuldu"
+msgid "created a copy of a misnamed branch '%s'"
+msgstr "yanlış adlandırılan '%s' dalının bir kopyası oluşturuldu"
#, c-format
-msgid "Renamed a misnamed branch '%s' away"
-msgstr "Yanlış adlandırılan '%s' dalı yeniden adlandırıldı"
+msgid "renamed a misnamed branch '%s' away"
+msgstr "yanlış adlandırılan '%s' dalı yeniden adlandırıldı"
#, c-format
-msgid "Branch renamed to %s, but HEAD is not updated!"
-msgstr "Dal %s olarak yeniden adlandırıldı; ancak HEAD güncellenmedi!"
+msgid "branch renamed to %s, but HEAD is not updated"
+msgstr "dal %s olarak yeniden adlandırıldı; ancak HEAD güncellenmedi!"
-msgid "Branch is renamed, but update of config-file failed"
-msgstr "Dal yeniden adlandırıldı; ancak config-file güncellemesi başarısız"
+msgid "branch is renamed, but update of config-file failed"
+msgstr "dal yeniden adlandırıldı; ancak config-file güncellenemedi"
-msgid "Branch is copied, but update of config-file failed"
-msgstr "Dal kopyalandı; ancak config-file güncellemesi başarısız"
+msgid "branch is copied, but update of config-file failed"
+msgstr "dal kopyalandı; ancak config-file güncellenemedi"
#, c-format
msgid ""
@@ -2944,6 +3001,9 @@ msgstr "bir dalı ve onun başvuru günlüğünü taşı/yeniden adlandır"
msgid "move/rename a branch, even if target exists"
msgstr "bir dalı taşı/yeniden adlandır, hedef var olsa bile"
+msgid "do not output a newline after empty formatted refs"
+msgstr "boş biçimli başvurulardan sonra bir yenisatır çıktılama"
+
msgid "copy a branch and its reflog"
msgstr "bir dalı ve onun başvuru günlüğünü kopyala"
@@ -2989,8 +3049,8 @@ msgstr "altmodüller içinden özyinele"
msgid "format to use for the output"
msgstr "çıktı için kullanılacak biçim"
-msgid "Failed to resolve HEAD as a valid ref."
-msgstr "HEAD geçerli bir başvuru olarak çözülemedi."
+msgid "failed to resolve HEAD as a valid ref"
+msgstr "HEAD geçerli bir başvuru olarak çözülemedi"
msgid "HEAD not found below refs/heads!"
msgstr "HEAD, refs/heads altında bulunamadı!"
@@ -3008,35 +3068,33 @@ msgstr "--recurse-submodules, yalnızca dal oluşturmada kullanılabilir"
msgid "branch name required"
msgstr "dal adı gerekli"
-msgid "Cannot give description to detached HEAD"
-msgstr "Ayrılmış HEAD'e açıklama verilemiyor"
+msgid "cannot give description to detached HEAD"
+msgstr "ayrık HEAD'e açıklama verilemiyor"
msgid "cannot edit description of more than one branch"
msgstr "birden çok dalın açıklaması düzenlenemiyor"
-#, c-format
-msgid "No commit on branch '%s' yet."
-msgstr "'%s' dalında henüz bir işleme yok."
+msgid "cannot copy the current branch while not on any"
+msgstr "bir dalın üzerinde değilken geçerli dal kopyalanamaz"
-#, c-format
-msgid "No branch named '%s'."
-msgstr "'%s' adında bir dal yok."
+msgid "cannot rename the current branch while not on any"
+msgstr "bir dalın üzerinde değilken geçerli dal yeniden adlandırılamaz"
msgid "too many branches for a copy operation"
-msgstr "bir kopyalama işlemi için çok fazla dal"
+msgstr "bir kopyalama işlemi için pek fazla dal"
msgid "too many arguments for a rename operation"
-msgstr "bir yeniden adlandırma işlemi için çok fazla argüman"
+msgstr "bir yeniden adlandırma işlemi için pek fazla argüman"
msgid "too many arguments to set new upstream"
-msgstr "yeni üstkaynak ayarlamak için çok fazla argüman"
+msgstr "yeni üstkaynak ayarlamak için pek fazla argüman"
#, c-format
msgid ""
-"could not set upstream of HEAD to %s when it does not point to any branch."
+"could not set upstream of HEAD to %s when it does not point to any branch"
msgstr ""
"HEAD'in üst kaynağı %s olarak ayarlanamadı; çünkü herhangi bir dala işaret "
-"etmiyor."
+"etmiyor"
#, c-format
msgid "no such branch '%s'"
@@ -3044,21 +3102,21 @@ msgstr "'%s' diye bir dal yok"
#, c-format
msgid "branch '%s' does not exist"
-msgstr "'%s' diye bir dal mevcut deÄŸil"
+msgstr "'%s' diye bir dal yok"
msgid "too many arguments to unset upstream"
-msgstr "üst kaynağı kaldırmak için çok fazla argüman"
+msgstr "üst kaynağı kaldırmak için pek fazla argüman"
-msgid "could not unset upstream of HEAD when it does not point to any branch."
+msgid "could not unset upstream of HEAD when it does not point to any branch"
msgstr ""
-"HEAD'in üst kaynağı kaldırılamadı; çünkü herhangi bir dala işaret etmiyor."
+"HEAD'in üst kaynağı kaldırılamadı; çünkü herhangi bir dala işaret etmiyor"
#, c-format
-msgid "Branch '%s' has no upstream information"
+msgid "branch '%s' has no upstream information"
msgstr "'%s' dalının üstkaynak bilgisi yok"
msgid ""
-"The -a, and -r, options to 'git branch' do not take a branch name.\n"
+"the -a, and -r, options to 'git branch' do not take a branch name.\n"
"Did you mean to use: -a|-r --list <pattern>?"
msgstr ""
"'git branch'in -a ve -r seçenekleri bir dal adı almaz.\n"
@@ -3066,10 +3124,10 @@ msgstr ""
msgid ""
"the '--set-upstream' option is no longer supported. Please use '--track' or "
-"'--set-upstream-to' instead."
+"'--set-upstream-to' instead"
msgstr ""
"--set-upstream seçeneği artık desteklenmiyor. Lütfen --track veya --set-"
-"upstream-to kullanın."
+"upstream-to kullanın"
msgid "git version:\n"
msgstr "git sürümü:\n"
@@ -3087,8 +3145,12 @@ msgstr "libc bilgisi: "
msgid "not run from a git repository - no hooks to show\n"
msgstr "bir git deposundan çalıştırılmadı - gösterilecek kanca yok\n"
-msgid "git bugreport [-o|--output-directory <file>] [-s|--suffix <format>]"
-msgstr "git bugreport [-o|--output-directory <dosya>] [-s|--suffix <biçim>]"
+msgid ""
+"git bugreport [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--diagnose[=<mode>]]"
+msgstr ""
+"git bugreport [(-o | --output-directory) <yol>] [(-s | --suffix) <biçim>]\n"
+" [--diagnose[=<kip>]]"
msgid ""
"Thank you for filling out a Git bug report!\n"
@@ -3124,16 +3186,31 @@ msgstr ""
"Aşağıda hata raporunun geri kalanına bir göz atın.\n"
"Paylaşmak istemediğiniz satırları silebilirsiniz.\n"
-msgid "specify a destination for the bugreport file"
-msgstr "hata raporu dosyası için bir konum belirtin"
+msgid "mode"
+msgstr "kip"
-msgid "specify a strftime format suffix for the filename"
-msgstr "dosya adı için bir strftime biçimli ek belirtin"
+msgid ""
+"create an additional zip archive of detailed diagnostics (default 'stats')"
+msgstr "ayrıntılı tanıların ek bir zip arşivini oluştur (öntanımlı: 'stats')"
+
+msgid "specify a destination for the bugreport file(s)"
+msgstr "hata raporu dosyaları için bir hedef konum belirtin"
+
+msgid "specify a strftime format suffix for the filename(s)"
+msgstr "dosya adları için bir strftime biçim soneki belirtin"
+
+#, c-format
+msgid "unknown argument `%s'"
+msgstr "bilinmeyen argüman '%s'"
#, c-format
msgid "could not create leading directories for '%s'"
msgstr "'%s' için öncü dizinler oluşturulamadı"
+#, c-format
+msgid "unable to create diagnostics archive %s"
+msgstr "tanı arşivi %s oluşturulamadı"
+
msgid "System Info"
msgstr "Sistem Bilgisi"
@@ -3148,17 +3225,24 @@ msgstr "%s dosyasına yazılamıyor"
msgid "Created new report at '%s'.\n"
msgstr "Hata raporu '%s' dosyasına yazıldı.\n"
-msgid "git bundle create [<options>] <file> <git-rev-list args>"
-msgstr "git bundle create [<seçenekler>] <dosya> <git-rev-liste argümanlar>"
+msgid ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<version>] <file> <git-rev-list-args>"
+msgstr ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<sürüm>] <dosya> <git-rev-listesi-argümanları>"
-msgid "git bundle verify [<options>] <file>"
-msgstr "git bundle verify [<seçenekler>] <dosya>"
+msgid "git bundle verify [-q | --quiet] <file>"
+msgstr "git bundle verify [-q | --quiet] <dosya>"
msgid "git bundle list-heads <file> [<refname>...]"
msgstr "git bundle list-heads <dosya> [<başvuru-adı>...]"
-msgid "git bundle unbundle <file> [<refname>...]"
-msgstr "git bundle unbundle <dosya> [<başvuru-adı>...]"
+msgid "git bundle unbundle [--progress] <file> [<refname>...]"
+msgstr "git bundle unbundle [--progress] <dosya> [<başvuru-adı>...]"
+
+msgid "need a <file> argument"
+msgstr "bir <dosya> argümanı gerekiyor"
msgid "do not show progress meter"
msgstr "ilerleme çubuğunu gösterme"
@@ -3166,11 +3250,11 @@ msgstr "ilerleme çubuğunu gösterme"
msgid "show progress meter"
msgstr "ilerleme çubuğunu göster"
-msgid "show progress meter during object writing phase"
-msgstr "ilerleme çubuğunu nesne yazımı aşaması sırasında göster"
+msgid "historical; same as --progress"
+msgstr "eski seçenek; --progress ile aynı"
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "ilerleme çubuğu gösterildiğinde --all-progress'e benzer"
+msgid "historical; does nothing"
+msgstr "eski seçenek; bir şey yapmaz"
msgid "specify bundle format version"
msgstr "demet biçim sürümünü belirt"
@@ -3192,10 +3276,6 @@ msgid "Unbundling objects"
msgstr "Nesneler demetten çıkarılıyor"
#, c-format
-msgid "Unknown subcommand: %s"
-msgstr "Bilinmeyen altkomut: %s"
-
-#, c-format
msgid "cannot read object %s '%s'"
msgstr "%s '%s' nesnesi okunamıyor"
@@ -3217,10 +3297,6 @@ msgstr "%s, argümanlar gerektiriyor"
msgid "%s takes no arguments"
msgstr "%s, bir argüman almıyor"
-#, c-format
-msgid "unknown command: '%s'"
-msgstr "bilinmeyen komut: '%s'"
-
msgid "only one batch option may be specified"
msgstr "yalnızca bir toplu iş seçeneği belirtilebilir"
@@ -3234,22 +3310,22 @@ msgid "git cat-file (-t | -s) [--allow-unknown-type] <object>"
msgstr "git cat-file (-t | -s) [--allow-unknown-type] <nesne>"
msgid ""
+"git cat-file (--textconv | --filters)\n"
+" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
+msgstr ""
+"git cat-file (--textconv | --filters)\n"
+" [<başvuru>:<yol|ağacımsı> | --path=<yol|ağacımsı> <revizyon>]"
+
+msgid ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
+" [--textconv | --filters] [-Z]"
msgstr ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
-
-msgid ""
-"git cat-file (--textconv | --filters)\n"
-" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
-msgstr ""
-"git cat-file (--textconv | --filters)\n"
-" [<başvuru>:<yol|ağacımsı> | --path=<yol|ağacımsı> <revizyon>]"
+" [--textconv | --filters] [-Z]"
msgid "Check object existence or emit object contents"
msgstr "Nesne varlığını denetle veya nesne içeriğini yay"
@@ -3270,7 +3346,10 @@ msgid "show object size"
msgstr "nesne boyutunu göster"
msgid "allow -s and -t to work with broken/corrupt objects"
-msgstr "-s ve -t'nin bozuk/hasar görmüş nesnelerle çalışmasına izin ver"
+msgstr "-s ve -t'nin bozuk/hasarlı nesnelerle çalışmasına izin ver"
+
+msgid "use mail map file"
+msgstr "posta eşlem dosyasını kullan"
msgid "Batch objects requested on stdin (or --batch-all-objects)"
msgstr "Toplu iÅŸ nesneleri stdin'de istendi (veya --batch-all-objects)"
@@ -3281,6 +3360,12 @@ msgstr "tam <nesne> veya <revizyon> içeriğini göster"
msgid "like --batch, but don't emit <contents>"
msgstr "--batch gibi; ancak <içerik> yayma"
+msgid "stdin is NUL-terminated"
+msgstr "stdin, NUL ile sonlandırılmış"
+
+msgid "stdin and stdout is NUL-terminated"
+msgstr "stdin ve stdout NUL ile sonlandırılmış"
+
msgid "read commands from stdin"
msgstr "komutları stdin'den oku"
@@ -3346,18 +3431,22 @@ msgstr "<revizyon>, '%s' ile gerekiyor"
msgid "<object> required with '-%c'"
msgstr "<nesne>, '-%c' ile gerekiyor"
-msgid "too many arguments"
-msgstr "çok fazla argüman"
-
#, c-format
msgid "only two arguments allowed in <type> <object> mode, not %d"
msgstr "<tür> <nesne> kipinde yalnızca iki argümana izin veriliyor, %d değil"
-msgid "git check-attr [-a | --all | <attr>...] [--] <pathname>..."
-msgstr "git check-attr [-a | --all | <öznitelik>...] [--] <yol-adı>..."
+msgid ""
+"git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] "
+"<pathname>..."
+msgstr ""
+"git check-attr [--source <ağacımsı>] [-a | --all | <öznitelik>...] [--] <yol-"
+"adı>..."
-msgid "git check-attr --stdin [-z] [-a | --all | <attr>...]"
-msgstr "git check-attr --stdin [-z] [-a | --all | <öznitelik>...]"
+msgid ""
+"git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"
+msgstr ""
+"git check-attr --stdin [-z] [--source <ağacımsı>] [-a | --all | "
+"<öznitelik>...]"
msgid "report all attributes set on file"
msgstr "tüm dosya özniteliklerini bildir"
@@ -3371,6 +3460,12 @@ msgstr "dosya adlarını stdin'den oku"
msgid "terminate input and output records by a NUL character"
msgstr "girdi ve çıktı kayıtlarını bir NUL karakteri ile sonlandır"
+msgid "<tree-ish>"
+msgstr "<ağacımsı>"
+
+msgid "which tree-ish to check attributes at"
+msgstr "özniteliklerin hangi ağacımsıda denetleneceği"
+
msgid "suppress progress reporting"
msgstr "ilerleme bildirimini gizle"
@@ -3433,10 +3528,10 @@ msgid "do not skip files with skip-worktree set"
msgstr "skip-worktree kümesiyle dosyaları atlama"
msgid "force overwrite of existing files"
-msgstr "mevcut dosyaların üzerine yazılmasını zorla"
+msgstr "var olan dosyaların üzerine yazılmasını zorla"
msgid "no warning for existing files and files not in index"
-msgstr "mevcut dosyalar ve indekste olmayan dosyalar için uyarma"
+msgstr "var olan dosyalar ve indekste olmayan dosyalar için uyarma"
msgid "don't checkout new files"
msgstr "yeni dosyaları çıkış yapma"
@@ -3528,6 +3623,10 @@ msgid "'%s' or '%s' cannot be used with %s"
msgstr "'%s' veya '%s', %s ile birlikte kullanılamaz"
#, c-format
+msgid "'%s', '%s', or '%s' cannot be used when checking out of a tree"
+msgstr "'%s', '%s' veya '%s' bir ağaçtan çıkış yaparken kullanılamaz"
+
+#, c-format
msgid "path '%s' is unmerged"
msgstr "'%s' yolu birleÅŸtirilmemiÅŸ"
@@ -3639,7 +3738,7 @@ msgid ""
"Please use -- (and optionally --no-guess) to disambiguate"
msgstr ""
"'%s' hem bir yerel dosya hem de bir izleme dalı olabilir.\n"
-"Lütfen -- (ve isteğe bağlı olarak --no-guess) kullanıp belirsizliği giderin."
+"-- (ve isteğe bağlı olarak --no-guess) kullanıp belirsizliği giderin"
msgid ""
"If you meant to check out a remote tracking branch on, e.g. 'origin',\n"
@@ -3778,8 +3877,8 @@ msgstr "zorla çıkış yap (yerel değişiklikleri çöpe at)"
msgid "new-branch"
msgstr "yeni dal"
-msgid "new unparented branch"
-msgstr "yeni üst ögesi olmayan dal"
+msgid "new unborn branch"
+msgstr "yeni henüz doğmamış dal"
msgid "update ignored files (default)"
msgstr "yok sayılan dosyaları güncelle (öntanımlı)"
@@ -3879,9 +3978,11 @@ msgid "use overlay mode"
msgstr "yerpaylaşım kipini kullan"
msgid ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <paths>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] "
+"[<pathspec>...]"
msgstr ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <dizgi>] [-x | -X] [--] <yollar>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <dizgi>] [-x | -X] [--] [<yol-"
+"blrtç>...]"
#, c-format
msgid "Removing %s\n"
@@ -3945,7 +4046,7 @@ msgstr ""
"* - tüm ögeleri seç\n"
" - (boş) seçimi bitir\n"
-#, c-format, perl-format
+#, c-format
msgid "Huh (%s)?\n"
msgstr "Pardon (%s)?\n"
@@ -4028,9 +4129,6 @@ msgstr ""
"clean.requireForce öntanımlı olarak 'true' ve ne -i ne -n ne de -f verilmiş; "
"temizleme reddediliyor"
-msgid "-x and -X cannot be used together"
-msgstr "-x ve -X birlikte kullanılamaz"
-
msgid "git clone [<options>] [--] <repo> [<dir>]"
msgstr "git clone [<seçenekler>] [--] <depo> [<dizin>]"
@@ -4094,9 +4192,6 @@ msgstr "derinlik"
msgid "create a shallow clone of that depth"
msgstr "verilen derinlikte sığ bir depo oluştur"
-msgid "time"
-msgstr "zaman"
-
msgid "create a shallow clone since a specific time"
msgstr "verilen zamandan sonrasını içeren bir sığ depo oluştur"
@@ -4121,6 +4216,9 @@ msgstr "git dizini"
msgid "separate git dir from working tree"
msgstr "git dizinini çalışma ağacından ayır"
+msgid "specify the reference format to use"
+msgstr "kullanılacak başvuru biçimini belirt"
+
msgid "key=value"
msgstr "anahtar=deÄŸer"
@@ -4133,12 +4231,6 @@ msgstr "sunucuya özel"
msgid "option to transmit"
msgstr "iletme seçeneği"
-msgid "use IPv4 addresses only"
-msgstr "yalnızca IPv4 adresleri kullan"
-
-msgid "use IPv6 addresses only"
-msgstr "yalnızca IPv6 adresleri kullan"
-
msgid "apply partial clone filters to submodules"
msgstr "altmodüllere kısımsal klon süzgeçlerini uygula"
@@ -4150,6 +4242,12 @@ msgstr ""
"sparse-checkout dosyasını yalnızca kökteki dosyaları içerecek biçimde "
"ilklendir"
+msgid "uri"
+msgstr "uri"
+
+msgid "a URI for downloading bundles before fetching from origin remote"
+msgstr "uzak konum kökeninden getirmeden önce demetleri indirmek için bir URI"
+
#, c-format
msgid "info: Could not add alternate for '%s': %s\n"
msgstr "info: '%s' için alternatif eklenemedi: %s\n"
@@ -4163,10 +4261,18 @@ msgid "%s exists and is not a directory"
msgstr "%s var ve bir dizin deÄŸil"
#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "'%s' bir sembolik bağlantı; --local ile klonlama reddediliyor"
+
+#, c-format
msgid "failed to start iterator over '%s'"
msgstr "yineleyici '%s' üzerinden çalıştırılamadı"
#, c-format
+msgid "symlink '%s' exists, refusing to clone with --local"
+msgstr "'%s' sembolik bağlantısı var, --local ile klonlama reddediliyor"
+
+#, c-format
msgid "failed to unlink '%s'"
msgstr "'%s' bağlantısı kesilemedi"
@@ -4209,9 +4315,8 @@ msgstr "%s güncellenemiyor"
msgid "failed to initialize sparse-checkout"
msgstr "sparse-checkout ilklendirilemedi"
-msgid "remote HEAD refers to nonexistent ref, unable to checkout.\n"
-msgstr ""
-"uzak konum HEAD'i var olmayan başvuruya bağlanıyor, çıkış yapılamıyor.\n"
+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"
@@ -4232,12 +4337,12 @@ msgid "You must specify a repository to clone."
msgstr "Klonlamak için bir depo belirtmelisiniz."
#, c-format
-msgid "options '%s' and '%s %s' cannot be used together"
-msgstr "'%s' ve '%s %s' seçenekleri birlikte kullanılamaz"
+msgid "unknown ref storage format '%s'"
+msgstr "bilinmeyen başvuru depolama biçimi '%s'"
#, c-format
msgid "repository '%s' does not exist"
-msgstr "'%s' deposu mevcut deÄŸil"
+msgstr "'%s' deposu yok"
#, c-format
msgid "depth %s is not a positive number"
@@ -4245,15 +4350,15 @@ msgstr "%s derinliği pozitif bir sayı değil"
#, c-format
msgid "destination path '%s' already exists and is not an empty directory."
-msgstr "Hedef yolu '%s' halihazırda mevcut ve boş bir dizin değil."
+msgstr "Hedef yolu '%s' halihazırda var ve boş bir dizin değil."
#, c-format
msgid "repository path '%s' already exists and is not an empty directory."
-msgstr "Depo yolu '%s' halihazırda mevcut ve boş bir dizin değil."
+msgstr "Depo yolu '%s' halihazırda var ve boş bir dizin değil."
#, c-format
msgid "working tree '%s' already exists."
-msgstr "Çalışma ağacı '%s' halihazırda mevcut."
+msgstr "Çalışma ağacı '%s' halihazırda var."
#, c-format
msgid "could not create leading directories of '%s'"
@@ -4306,6 +4411,16 @@ msgstr "--local yok sayıldı"
msgid "cannot clone from filtered bundle"
msgstr "süzülmüş demetten klonlanamıyor"
+msgid "failed to initialize the repo, skipping bundle URI"
+msgstr "depo ilklendirilemedi, demet URI'si atlanıyor"
+
+#, c-format
+msgid "failed to fetch objects from bundle URI '%s'"
+msgstr "'%s' demet URI'sinden nesneler getirilemedi"
+
+msgid "failed to fetch advertised bundles"
+msgstr "tanıtılan demetler alınamadı"
+
msgid "remote transport reported error"
msgstr "uzak konum taşıması hata bildirdi"
@@ -4341,18 +4456,24 @@ msgid "--command must be the first argument"
msgstr "--command ilk argüman olmalı"
msgid ""
-"git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]"
+"git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]"
msgstr ""
-"git commit-graph verify [--object-dir <nsndzn>] [--shallow] [--[no-]progress]"
+"git commit-graph verify [--object-dir <dizin>] [--shallow] [--[no-]progress]"
msgid ""
-"git commit-graph write [--object-dir <objdir>] [--append] [--"
-"split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <n>] [--[no-]progress] <split options>"
+"git commit-graph write [--object-dir <dir>] [--append]\n"
+" [--split[=<strategy>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <split-options>"
msgstr ""
-"git commit-graph write [--object-dir <nsndzn>] [--append] [--"
-"split[=<strateji>]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <n>] [--[no-]progress] <bölme-seçenekleri>"
+"git commit-graph write [--object-dir <dizin>] [--append]\n"
+" [--split[=<strateji>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <bölme-seçenekleri>"
msgid "dir"
msgstr "dizin"
@@ -4368,6 +4489,10 @@ msgid "Could not open commit-graph '%s'"
msgstr "commit-graph '%s' açılamadı"
#, c-format
+msgid "could not open commit-graph chain '%s'"
+msgstr "commit-graph zinciri '%s' açılamadı"
+
+#, c-format
msgid "unrecognized --split argument, %s"
msgstr "tanımlanamayan --split argümanı, %s"
@@ -4423,16 +4548,16 @@ msgstr ""
msgid "Collecting commits from input"
msgstr "Girdiden işlemeler toplanıyor"
-#, c-format
-msgid "unrecognized subcommand: %s"
-msgstr "tanımlanamayan altkomut: %s"
+msgid "git commit-tree <tree> [(-p <parent>)...]"
+msgstr "git commit-tree <ağaç> [(-p <üst-öge>)...]"
msgid ""
-"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...] [(-F "
-"<file>)...] <tree>"
+"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]\n"
+" [(-F <file>)...] <tree>"
msgstr ""
-"git commit-tree [(-p <üst-öge>)...] [-S[<değer-no>]] [(-m <ileti>)...] [(-F "
-"<dosya>)...] <ağaç>"
+"git commit-tree [(-p <üst-öge>)...] [-S[<anahtar-kimliği>]] [(-m "
+"<ileti>)...]\n"
+" [(-F <dosya>)...] <ağaç>"
#, c-format
msgid "duplicate parent %s ignored"
@@ -4474,11 +4599,29 @@ msgstr "bir tam ağaç vermeli"
msgid "git commit-tree: failed to read"
msgstr "git commit-tree: okunamadı"
-msgid "git commit [<options>] [--] <pathspec>..."
-msgstr "git commit [<seçenekler>] [--] <yol-blrtç>..."
+msgid ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|"
+"reword):]<commit>)]\n"
+" [-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n"
+" [--date=<date>] [--cleanup=<mode>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<kip>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <iÅŸleme> | --fixup [(amend|"
+"reword):]<iÅŸleme>)]\n"
+" [-F <dosya> | -m <ileti>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n"
+" [--date=<tarih>] [--cleanup=<kip>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<dosya> [--pathspec-file-nul]]\n"
+" [(--trailer <jeton>[(=|:)<deÄŸer>])...] [-S[<anahtar-kimliÄŸi>]]\n"
+" [--] [<yol-blrtç>...]"
-msgid "git status [<options>] [--] <pathspec>..."
-msgstr "git status [<seçenekler>] [--] <yol-blrtç>..."
+msgid "git status [<options>] [--] [<pathspec>...]"
+msgstr "git status [<seçenekler>] [--] [<yol-blrtç>...]"
msgid ""
"You asked to amend the most recent commit, but doing so would make\n"
@@ -4529,6 +4672,9 @@ msgstr ""
"\tgit cherry-pick --skip\n"
"\n"
+msgid "updating files failed"
+msgstr "dosyaları güncelleme başarısız"
+
msgid "failed to unpack HEAD tree object"
msgstr "HEAD ağaç nesnesi açılamadı"
@@ -4547,9 +4693,6 @@ msgstr "geçici indeks güncellenemiyor"
msgid "Failed to update main cache tree"
msgstr "Ana önbellek ağacı güncellenemedi"
-msgid "unable to write new_index file"
-msgstr "new_index dosyası yazılamıyor"
-
msgid "cannot do a partial commit during a merge."
msgstr "Bir birleştirme sırasında kısmi işleme yapılamaz."
@@ -4584,12 +4727,12 @@ msgid ""
"unable to select a comment character that is not used\n"
"in the current commit message"
msgstr ""
-"mevcut işleme iletisinde kullanılmayan bir yorum\n"
+"geçerli işleme iletisinde kullanılmayan bir yorum\n"
"karakteri seçilemiyor"
#, c-format
-msgid "could not lookup commit %s"
-msgstr "%s işlemesi aranamadı"
+msgid "could not lookup commit '%s'"
+msgstr "'%s' işlemesi aranamadı"
#, c-format
msgid "(reading log message from standard input)\n"
@@ -4707,7 +4850,7 @@ msgstr "Lütfen iletiyi -m veya -F seçeneğini kullanarak destekleyin.\n"
#, c-format
msgid "--author '%s' is not 'Name <email>' and matches no existing author"
msgstr ""
-"--author '%s', 'Ad <e-posta>' biçiminde değil ve mevcut bir yazarla "
+"--author '%s', 'Ad <e-posta>' biçiminde değil ve var olan bir yazarla "
"eÅŸleÅŸmiyor"
#, c-format
@@ -4782,9 +4925,6 @@ msgstr "durumu uzun biçimde göster (öntanımlı)"
msgid "terminate entries with NUL"
msgstr "girdileri NUL ile sonlandır"
-msgid "mode"
-msgstr "kip"
-
msgid "show untracked files, optional modes: all, normal, no. (Default: all)"
msgstr ""
"izlenmeyen dosyaları göster, ist. bağlı kipler: all, normal, no (Öntanım.: "
@@ -4795,7 +4935,7 @@ msgid ""
"traditional)"
msgstr ""
"yok sayılan dosyaları göster, isteğe bağlı kipler: traditional (geleneksel) "
-"matching (eşleşen), no (hayır) (Öntanımlı: traditional)."
+"matching (eşleşen), no (hayır) (Öntanımlı: traditional)"
msgid "when"
msgstr "ne zaman"
@@ -4805,7 +4945,7 @@ msgid ""
"(Default: all)"
msgstr ""
"altmodüllere olan değişiklikleri yok say, isteğe bağlı ne zaman: all "
-"(hepsi), dirty (kirli), untracked (izlenmeyen) (Öntanımlı: all)."
+"(hepsi), dirty (kirli), untracked (izlenmeyen) (Öntanımlı: all)"
msgid "list untracked files in columns"
msgstr "izlenmeyen dosyaları sütunlarla göster"
@@ -4958,10 +5098,10 @@ msgstr "İşleme iletisi gövdesinin boş bırakılmasından ötürü iptal edil
msgid ""
"repository has been updated, but unable to write\n"
-"new_index file. Check that disk is not full and quota is\n"
+"new index file. Check that disk is not full and quota is\n"
"not exceeded, and then \"git restore --staged :/\" to recover."
msgstr ""
-"Depo güncellendi; ancak new_index dosyası yazılamıyor.\n"
+"Depo güncellendi; ancak yeni indeks dosyası yazılamıyor.\n"
"Diskin dolu olup olmadığını ve kotanızı aşıp aşmadığınızı denetleyin,\n"
"sonra kurtarmak için \"git restore --staged :/\" kullanın."
@@ -5173,7 +5313,7 @@ msgid ""
msgstr ""
"--worktree, worktreeConfig yapılandırma genişletmesi etkinleştirilmediği\n"
"sürece birden çok çalışma ağacı ile birlikte kullanılamaz. Ayrıntılar için\n"
-"lütfen \"git help worktree\" içindeki \"CONFIGURATION FILE\" bölümünü okuyun."
+"lütfen \"git help worktree\" içindeki \"CONFIGURATION FILE\" bölümünü okuyun"
msgid "--get-color and variable type are incoherent"
msgstr "--get-color ve değişken türü tutarsız"
@@ -5237,7 +5377,7 @@ msgid ""
"\n"
"\tchmod 0700 %s"
msgstr ""
-"Soket dizininizdeki izinler çok gevşek; diğer kullanıcılar sizin\n"
+"Yuva dizininizdeki izinler çok gevşek; diğer kullanıcılar sizin\n"
"önbelleğe alınmış yetkilerinizi okuyabilirler. Şunu çalıştırmayı düşünün:\n"
"\n"
"\tchmod 0700 %s"
@@ -5246,20 +5386,27 @@ msgid "print debugging messages to stderr"
msgstr "hata ayıklama iletilerini stderr'e yazdır"
msgid "credential-cache--daemon unavailable; no unix socket support"
-msgstr "credential-cache--daemon kullanılamıyor; unix soket desteği yok"
+msgstr "credential-cache--daemon kullanılamıyor; unix yuva desteği yok"
msgid "credential-cache unavailable; no unix socket support"
-msgstr "credential-cache kullanılamıyor; unix soket desteği yok"
+msgstr "credential-cache kullanılamıyor; unix yuva desteği yok"
#, c-format
msgid "unable to get credential storage lock in %d ms"
msgstr "kimlik depo kilidi %d ms içinde alınamadı"
-msgid "git describe [<options>] [<commit-ish>...]"
-msgstr "git describe [<seçenekler>] [<işlememsi>...]"
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<iÅŸlememsi>...]"
-msgid "git describe [<options>] --dirty"
-msgstr "git describe [<seçenekler>] --dirty"
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<im>]"
+
+msgid "git describe <blob>"
+msgstr "git describe <ikili>"
msgid "head"
msgstr "dal ucu"
@@ -5272,7 +5419,7 @@ msgstr "ek açıklamalı"
#, c-format
msgid "annotated tag %s not available"
-msgstr "%s ek açıklamalı etiketi mevcut değil"
+msgstr "ek açıklamalı etiket %s kullanılamıyor"
#, c-format
msgid "tag '%s' is externally known as '%s'"
@@ -5380,6 +5527,22 @@ msgstr "Hiçbir ad bulunamadı, hiçbir şey betimlenemiyor."
msgid "option '%s' and commit-ishes cannot be used together"
msgstr "'%s' seçeneği ve işlememsiler birlikte kullanılamaz"
+msgid ""
+"git diagnose [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--mode=<mode>]"
+msgstr ""
+"git diagnose [(-o | --output-directory) <yol>] [(-s | --suffix) <biçim>]\n"
+" [--mode=<kip>]"
+
+msgid "specify a destination for the diagnostics archive"
+msgstr "tanı arşivi için bir hedef konum belirtin"
+
+msgid "specify a strftime format suffix for the filename"
+msgstr "dosya adı için bir strftime biçimli ek belirtin"
+
+msgid "specify the content of the diagnostic archive"
+msgstr "tanı arşivinin içeriğini belirtin"
+
msgid "--merge-base only works with two commits"
msgstr "--merge-base yalnızca iki işleme ile kullanılabilir"
@@ -5387,6 +5550,9 @@ msgstr "--merge-base yalnızca iki işleme ile kullanılabilir"
msgid "'%s': not a regular file or symlink"
msgstr "'%s': Sıradan bir dosya veya sembolik bağ değil"
+msgid "no merge given, only parents."
+msgstr "birleştirme verilmedi, yalnızca üst ögeler."
+
#, c-format
msgid "invalid option: %s"
msgstr "geçersiz seçenek: %s"
@@ -5400,7 +5566,7 @@ msgstr "Bir git deposu deÄŸil"
#, c-format
msgid "invalid object '%s' given."
-msgstr "geçersiz nesne '%s' verildi"
+msgstr "geçersiz nesne '%s' verildi."
#, c-format
msgid "more than two blobs given: '%s'"
@@ -5408,7 +5574,7 @@ msgstr "ikiden çok ikili nesne verildi: '%s'"
#, c-format
msgid "unhandled object '%s' given."
-msgstr "ele alınmayan nesne '%s' verildi"
+msgstr "ele alınmayan nesne '%s' verildi."
#, c-format
msgid "%s...%s: multiple merge bases, using %s"
@@ -5502,29 +5668,6 @@ msgstr "--tool=<araç> için bir <araç> verilmedi"
msgid "no <cmd> given for --extcmd=<cmd>"
msgstr "--extcmd=<komut> için bir <komut> verilmedi"
-msgid "git env--helper --type=[bool|ulong] <options> <env-var>"
-msgstr "git env--helper --type=[bool|ulong] <seçenekler> <ortam-dğşkn>"
-
-msgid "default for git_env_*(...) to fall back on"
-msgstr "git_env_*(...)'ın geri çekileceği öntanımlı"
-
-msgid "be quiet only use git_env_*() value as exit code"
-msgstr "sessiz ol, yalnızca git_env_*() değerini çıkış kodu olarak kullan"
-
-#, c-format
-msgid "option `--default' expects a boolean value with `--type=bool`, not `%s`"
-msgstr ""
-"--default seçeneği, --type=bool ile birlikte bir Boole değeri bekliyor, '%s' "
-"deÄŸil"
-
-#, c-format
-msgid ""
-"option `--default' expects an unsigned long value with `--type=ulong`, not `"
-"%s`"
-msgstr ""
-"--default seçeneği, --type=ulong ile birlikte bir imzalanmamış uzun değer "
-"bekliyor, '%s' deÄŸil"
-
msgid "git fast-export [<rev-list-opts>]"
msgstr "git fast-export [<revizyon-listesi-seçenekleri>]"
@@ -5636,119 +5779,14 @@ msgstr "git fetch --all [<seçenekler>]"
msgid "fetch.parallel cannot be negative"
msgstr "fetch.parallel negatif olamaz"
-msgid "fetch from all remotes"
-msgstr "tüm uzak konumlardan getir"
-
-msgid "set upstream for git pull/fetch"
-msgstr "git pull/fetch için üstkaynak ayarla"
-
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr ".git/FETCH_HEAD'in üzerine yazmak yerine ona iliştir"
-
-msgid "use atomic transaction to update references"
-msgstr "başvuruları güncellemek için atomsal işlem kullan"
-
-msgid "path to upload pack on remote end"
-msgstr "uzak uçtaki yükleme paketine olan yol"
-
-msgid "force overwrite of local reference"
-msgstr "yerel başvurunun üzerine zorla yaz"
-
-msgid "fetch from multiple remotes"
-msgstr "birden çok uzak konumdan getir"
-
-msgid "fetch all tags and associated objects"
-msgstr "tüm etiketleri ve ilişkilendirilen nesneleri getir"
-
-msgid "do not fetch all tags (--no-tags)"
-msgstr "tüm etiketleri getirme (--no-tags)"
-
-msgid "number of submodules fetched in parallel"
-msgstr "paralelde getirilen altmodüllerin sayısı"
-
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr ""
-"başvuru belirtecini tüm başvuruları refs/prefetch/'e yerleştirecek biçimde "
-"deÄŸiÅŸtir"
-
-msgid "prune remote-tracking branches no longer on remote"
-msgstr "artık uzak konumda olmayan uzak izleme dallarını buda"
-
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr ""
-"artık uzak konumda olmayan yerel etiketleri buda ve değiştirilen etiketleri "
-"güncelle"
-
-msgid "on-demand"
-msgstr "istek üzerine"
-
-msgid "control recursive fetching of submodules"
-msgstr "altmodüllerin özyineli getirilmesini denetle"
-
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "getirilen başvuruları FETCH_HEAD dosyasına yaz"
-
-msgid "keep downloaded pack"
-msgstr "indirilen paketi tut"
-
-msgid "allow updating of HEAD ref"
-msgstr "HEAD başvurusunun güncellenmesine izin ver"
-
-msgid "deepen history of shallow clone"
-msgstr "sığ klonun geçmişini derinleştir"
-
-msgid "deepen history of shallow repository based on time"
-msgstr "zamana bağlı olarak sığ deponun geçmişini derinleştir"
-
-msgid "convert to a complete repository"
-msgstr "tam bir depoya dönüştür"
-
-msgid "re-fetch without negotiating common commits"
-msgstr "ortak işlemeleri pazarlık etmeden yeniden getir"
-
-msgid "prepend this to submodule path output"
-msgstr "bunu altmodül yol çıktısının başına ekle"
-
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr ""
-"altmodüllerin özyineli getirilmesi için öntanımlı (yapılandırma "
-"dosyalarından daha az önceliğe iye)"
-
-msgid "accept refs that update .git/shallow"
-msgstr ".git/shallow'u güncelleyen başvuruları kabul et"
-
-msgid "refmap"
-msgstr "ilgili baÅŸvuru"
-
-msgid "specify fetch refmap"
-msgstr "getirme ile ilgili başvuruları belirt"
-
-msgid "report that we have only objects reachable from this object"
-msgstr "yalnızca bu nesneden ulaşılabilir nesnelerimiz olduğunu bildir"
-
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr ""
-"bir paket dosyasını getirme; bunun yerine pazarlık ipuçlarının atalarını "
-"yazdır"
-
-msgid "run 'maintenance --auto' after fetching"
-msgstr "getirme sonrasında 'maintenance --auto' çalıştır"
-
-msgid "check for forced-updates on all updated branches"
-msgstr "tüm güncellenmiş dalları zorlanmış güncellemeler için denetle"
-
-msgid "write the commit-graph after fetching"
-msgstr "getirdikten sonra iÅŸleme grafiÄŸini yaz"
-
-msgid "accept refspecs from stdin"
-msgstr "başvuru belirteçlerini stdin'den oku"
-
msgid "couldn't find remote ref HEAD"
msgstr "uzak HEAD başvurusu bulunamadı"
#, c-format
+msgid "From %.*s\n"
+msgstr "Åžu konumdan: %.*s\n"
+
+#, c-format
msgid "object %s not found"
msgstr "%s nesnesi bulunamadı"
@@ -5758,11 +5796,8 @@ msgstr "[güncel]"
msgid "[rejected]"
msgstr "[reddedildi]"
-msgid "can't fetch in current branch"
-msgstr "geçerli dalda getirme yapılamıyor"
-
-msgid "checked out in another worktree"
-msgstr "başka bir çalışma ağacında çıkış yapıldı"
+msgid "can't fetch into checked-out branch"
+msgstr "çıkış yapılmış dala getirilemiyor"
msgid "[tag update]"
msgstr "[etiket güncellemesi]"
@@ -5797,9 +5832,9 @@ msgid ""
"but that check has been disabled; to re-enable, use '--show-forced-updates'\n"
"flag or run 'git config fetch.showForcedUpdates true'"
msgstr ""
-"Getirme normalde hangi dallarda zorla güncelleme yapıldığını belirtir;\n"
-"ancak bu denetleme kapatılmış. Yeniden açmak için '--show-forced-updates'\n"
-"bayrağını kullanın veya 'git config fetch.showForcedUpdates true' çalıştırın."
+"Getirme, normalde hangi dallarda zorla güncelleme yapıldığını belirtir;\n"
+"ancak bu denetleme kapatılmış; yeniden açmak için '--show-forced-updates'\n"
+"bayrağını kullanın veya 'git config fetch.showForcedUpdates true' çalıştırın"
#, c-format
msgid ""
@@ -5822,10 +5857,6 @@ msgid "rejected %s because shallow roots are not allowed to be updated"
msgstr "%s reddedildi; çünkü sığ köklerin güncellenmesine izin verilmiyor"
#, c-format
-msgid "From %.*s\n"
-msgstr "Åžu konumdan: %.*s\n"
-
-#, c-format
msgid ""
"some local refs could not be updated; try running\n"
" 'git remote prune %s' to remove any old, conflicting branches"
@@ -5891,8 +5922,8 @@ msgid ""
"no source branch found;\n"
"you need to specify exactly one branch with the --set-upstream option"
msgstr ""
-"Kaynak dal bulunamadı.\n"
-"--set-upstream seçeneği ile tam olarak bir dal belirtmeniz gerekiyor."
+"Kaynak dal bulunamadı;\n"
+"--set-upstream seçeneği ile tam olarak bir dal belirtmeniz gerekiyor"
#, c-format
msgid "Fetching %s\n"
@@ -5910,12 +5941,121 @@ msgid ""
"no remote repository specified; please specify either a URL or a\n"
"remote name from which new revisions should be fetched"
msgstr ""
-"Bir uzak dal belirtilmedi. Lütfen yeni revizyonların\n"
-"getirileceği bir URL veya uzak konum adı belirtin."
+"Bir uzak dal belirtilmedi; lütfen yeni revizyonların\n"
+"getirileceği bir URL veya uzak konum adı belirtin"
msgid "you need to specify a tag name"
msgstr "bir etiket adı belirtmeniz gerekiyor"
+msgid "fetch from all remotes"
+msgstr "tüm uzak konumlardan getir"
+
+msgid "set upstream for git pull/fetch"
+msgstr "git pull/fetch için üstkaynak ayarla"
+
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr ".git/FETCH_HEAD'in üzerine yazmak yerine ona iliştir"
+
+msgid "use atomic transaction to update references"
+msgstr "başvuruları güncellemek için atomsal işlem kullan"
+
+msgid "path to upload pack on remote end"
+msgstr "uzak uçtaki yükleme paketine olan yol"
+
+msgid "force overwrite of local reference"
+msgstr "yerel başvurunun üzerine zorla yaz"
+
+msgid "fetch from multiple remotes"
+msgstr "birden çok uzak konumdan getir"
+
+msgid "fetch all tags and associated objects"
+msgstr "tüm etiketleri ve ilişkilendirilen nesneleri getir"
+
+msgid "do not fetch all tags (--no-tags)"
+msgstr "tüm etiketleri getirme (--no-tags)"
+
+msgid "number of submodules fetched in parallel"
+msgstr "paralelde getirilen altmodüllerin sayısı"
+
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+"başvuru belirtecini tüm başvuruları refs/prefetch/'e yerleştirecek biçimde "
+"deÄŸiÅŸtir"
+
+msgid "prune remote-tracking branches no longer on remote"
+msgstr "artık uzak konumda olmayan uzak izleme dallarını buda"
+
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr ""
+"artık uzak konumda olmayan yerel etiketleri buda ve değiştirilen etiketleri "
+"güncelle"
+
+msgid "on-demand"
+msgstr "istek üzerine"
+
+msgid "control recursive fetching of submodules"
+msgstr "altmodüllerin özyineli getirilmesini denetle"
+
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "getirilen başvuruları FETCH_HEAD dosyasına yaz"
+
+msgid "keep downloaded pack"
+msgstr "indirilen paketi tut"
+
+msgid "allow updating of HEAD ref"
+msgstr "HEAD başvurusunun güncellenmesine izin ver"
+
+msgid "deepen history of shallow clone"
+msgstr "sığ klonun geçmişini derinleştir"
+
+msgid "deepen history of shallow repository based on time"
+msgstr "zamana bağlı olarak sığ deponun geçmişini derinleştir"
+
+msgid "convert to a complete repository"
+msgstr "tam bir depoya dönüştür"
+
+msgid "re-fetch without negotiating common commits"
+msgstr "ortak işlemeleri pazarlık etmeden yeniden getir"
+
+msgid "prepend this to submodule path output"
+msgstr "bunu altmodül yol çıktısının başına ekle"
+
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+"altmodüllerin özyineli getirilmesi için öntanımlı (yapılandırma "
+"dosyalarından daha az önceliğe iye)"
+
+msgid "accept refs that update .git/shallow"
+msgstr ".git/shallow'u güncelleyen başvuruları kabul et"
+
+msgid "refmap"
+msgstr "ilgili baÅŸvuru"
+
+msgid "specify fetch refmap"
+msgstr "getirme ile ilgili başvuruları belirt"
+
+msgid "report that we have only objects reachable from this object"
+msgstr "yalnızca bu nesneden ulaşılabilir nesnelerimiz olduğunu bildir"
+
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr ""
+"bir paket dosyasını getirme; bunun yerine pazarlık ipuçlarının atalarını "
+"yazdır"
+
+msgid "run 'maintenance --auto' after fetching"
+msgstr "getirme sonrasında 'maintenance --auto' çalıştır"
+
+msgid "check for forced-updates on all updated branches"
+msgstr "tüm güncellenmiş dalları zorlanmış güncellemeler için denetle"
+
+msgid "write the commit-graph after fetching"
+msgstr "getirdikten sonra iÅŸleme grafiÄŸini yaz"
+
+msgid "accept refspecs from stdin"
+msgstr "başvuru belirteçlerini stdin'den oku"
+
msgid "--negotiate-only needs one or more --negotiation-tip=*"
msgstr "--negotiate-only'e bir veya daha çok --negotiation-tip=* gerekiyor"
@@ -5925,6 +6065,10 @@ msgstr "--deepen içinde negatif derinlik desteklenmiyor"
msgid "--unshallow on a complete repository does not make sense"
msgstr "tam bir depo üzerinde --unshallow bir anlam ifade etmiyor"
+#, c-format
+msgid "failed to fetch bundles from '%s'"
+msgstr "'%s' konumundan demetler getirilemedi"
+
msgid "fetch --all does not take a repository argument"
msgstr "fetch --all bir depo argümanı almıyor"
@@ -5949,8 +6093,8 @@ msgid ""
"--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."
+"--filter, yalnızca extensions.partialclone içinde yapılandırılmış uzak konum "
+"ile kullanılabilir"
msgid "--atomic can only be used when fetching from one remote"
msgstr "--atomic yalnızca bir uzak konumdan getirirken kullanılabilir"
@@ -6027,8 +6171,14 @@ msgstr "yalnızca işlemeyi içeren başvuruları yazdır"
msgid "print only refs which don't contain the commit"
msgstr "yalnızca işlemeyi içermeyen başvuruları yazdır"
-msgid "git for-each-repo --config=<config> <command-args>"
-msgstr "git for-each-repo --config=<yapılandırma> <komut-argümanları>"
+msgid "read reference patterns from stdin"
+msgstr "baÅŸvuru dizgilerini stdin'den oku"
+
+msgid "unknown arguments supplied with --stdin"
+msgstr "--stdin ile bilinmeyen argümanlar verilmiş"
+
+msgid "git for-each-repo --config=<config> [--] <arguments>"
+msgstr "git for-each-repo --config=<yapılandırma> [--] <argümanlar>"
msgid "config"
msgstr "yapılandırma"
@@ -6039,6 +6189,10 @@ msgstr "bir depo yolları listesi tutan yapılandırma anahtarı"
msgid "missing --config=<config>"
msgstr "--config=<yapılandırma> eksik"
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "hatayı yapılandırma alındı, --config=%s"
+
msgid "unknown"
msgstr "bilinmeyen"
@@ -6118,7 +6272,7 @@ msgstr "%s %s (%s) ÅŸurada etiketlendi: %s"
#, c-format
msgid "%s: object corrupt or missing"
-msgstr "%s: nesne hasar görmüş veya kayıp"
+msgstr "%s: nesne hasarlı veya kayıp"
#, c-format
msgid "%s: invalid reflog entry %s"
@@ -6145,7 +6299,7 @@ msgstr "%s: sağlama yolu uyuşmazlığı, şurada bulundu: %s"
#, c-format
msgid "%s: object corrupt or missing: %s"
-msgstr "%s: nesne hasar görmüş veya kayıp: %s"
+msgstr "%s: nesne hasarlı veya kayıp: %s"
#, c-format
msgid "%s: object is of unknown type '%s': %s"
@@ -6185,18 +6339,39 @@ msgstr "%s: ayrık HEAD bir şeye işaret etmiyor"
msgid "notice: %s points to an unborn branch (%s)"
msgstr "Uyarı: %s henüz doğmamış bir dala işaret ediyor (%s)"
-msgid "Checking cache tree"
-msgstr "Önbellek ağacı denetleniyor"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "%s ögesinin önbellek ağacı denetleniyor"
#, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "%s: cache-tree içinde geçersiz sha1 işaretçisi"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s: %s ögesinin cache-tree'si içinde geçersiz sha1 işaretçisi"
msgid "non-tree in cache-tree"
msgstr "cache-tree içinde ağaç olmayan öge"
-msgid "git fsck [<options>] [<object>...]"
-msgstr "git fsck [<seçenekler>] [<nesne>...]"
+#, c-format
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s: %s ögesinin resolve-undo'su içinde geçersiz sha1 işaretçisi"
+
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "'%s' paketi için rev-index yüklenemiyor"
+
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "'%s' paketi için geçersiz rev-index"
+
+msgid ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<object>...]"
+msgstr ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<nesne>...]"
msgid "show unreachable objects"
msgstr "ulaşılamayan nesneleri göster"
@@ -6251,12 +6426,6 @@ msgstr "git fsmonitor--daemon start [<seçenekler>]"
msgid "git fsmonitor--daemon run [<options>]"
msgstr "git fsmonitor--daemon run [<seçenekler>]"
-msgid "git fsmonitor--daemon stop"
-msgstr "git fsmonitor--daemon stop"
-
-msgid "git fsmonitor--daemon status"
-msgstr "git fsmonitor--daemon status"
-
#, c-format
msgid "value of '%s' out of range: %d"
msgstr "'%s' değeri erim dışında: %d"
@@ -6337,7 +6506,7 @@ msgstr "geçersiz 'ipc-threads' değeri (%d)"
#, c-format
msgid "Unhandled subcommand '%s'"
-msgstr "Ä°ÅŸlenmemiÅŸ altkomut '%s'"
+msgstr "Ele alınmamış altkomut '%s'"
msgid "fsmonitor--daemon not supported on this platform"
msgstr "fsmonitor--daemon bu platformda desteklenmiyor"
@@ -6377,6 +6546,9 @@ msgstr "baÅŸvurulmayan nesneleri buda"
msgid "pack unreferenced objects separately"
msgstr "başvurulmamış nesneleri ayrı olarak paketle"
+msgid "with --cruft, limit the size of new cruft packs"
+msgstr "--cruft ile yeni süprüntü paketlerinin boyutunu sınırla"
+
msgid "be more thorough (increased runtime)"
msgstr "biraz daha titiz ol (artırılmış işleyiş süresi)"
@@ -6461,7 +6633,7 @@ msgstr ""
#, c-format
msgid "lock file '%s' exists, skipping maintenance"
-msgstr "kilit dosyası '%s' mevcut, bakım atlanıyor"
+msgstr "kilit dosyası '%s' var, bakım atlanıyor"
#, c-format
msgid "task '%s' failed"
@@ -6496,8 +6668,20 @@ msgstr "belirli bir görevi çalıştır"
msgid "use at most one of --auto and --schedule=<frequency>"
msgstr "tek kezde --auto ve --schedule=<sıklık>'tan birini kullan"
-msgid "failed to run 'git config'"
-msgstr "'git config' çalıştırılamadı"
+#, c-format
+msgid "unable to add '%s' value of '%s'"
+msgstr "şunun için '%s' değeri eklenemiyor: '%s'"
+
+msgid "return success even if repository was not registered"
+msgstr "depo kaydı yapılmamış olsa bile başarılı durum döndür"
+
+#, c-format
+msgid "unable to unset '%s' value of '%s'"
+msgstr "şunun '%s' değeri ayarı kaldırılamıyor: '%s'"
+
+#, c-format
+msgid "repository '%s' is not registered"
+msgstr "'%s' deposu kaydı yapılmamış"
#, c-format
msgid "failed to expand path '%s'"
@@ -6523,21 +6707,18 @@ msgstr "schtasks başlatılamadı"
msgid "failed to run 'crontab -l'; your system might not support 'cron'"
msgstr "'crontab -l' çalıştırılamadı; sisteminiz 'cron' desteklemiyor olabilir"
+msgid "failed to create crontab temporary file"
+msgstr "crontab geçici dosyası oluşturulamadı"
+
+msgid "failed to open temporary file"
+msgstr "geçici dosya açılamadı"
+
msgid "failed to run 'crontab'; your system might not support 'cron'"
msgstr "'crontab' çalıştırılamadı; sisteminiz 'cron' desteklemiyor olabilir"
-msgid "failed to open stdin of 'crontab'"
-msgstr "'crontab' stdin'i açılamadı"
-
msgid "'crontab' died"
msgstr "'crontab' beklenmedik bir biçimde sonlandı"
-msgid "failed to start systemctl"
-msgstr "systemctl başlatılamadı"
-
-msgid "failed to run systemctl"
-msgstr "systemctl çalıştırılamadı"
-
#, c-format
msgid "failed to delete '%s'"
msgstr "'%s' silinemedi"
@@ -6546,16 +6727,22 @@ msgstr "'%s' silinemedi"
msgid "failed to flush '%s'"
msgstr "'%s' floş yapılamadı"
+msgid "failed to start systemctl"
+msgstr "systemctl başlatılamadı"
+
+msgid "failed to run systemctl"
+msgstr "systemctl çalıştırılamadı"
+
#, c-format
msgid "unrecognized --scheduler argument '%s'"
msgstr "tanımlanamayan --scheduler argümanı, '%s'"
msgid "neither systemd timers nor crontab are available"
-msgstr "ne systemd zamanlayıcıları ne de crontab mevcut değil"
+msgstr "ne systemd zamanlayıcıları ne de crontab kullanılabiliyor"
#, c-format
msgid "%s scheduler is not available"
-msgstr "%s planlayıcısı mevcut değil"
+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"
@@ -6569,16 +6756,15 @@ msgstr "görev planlayıcı"
msgid "scheduler to trigger git maintenance run"
msgstr "git bakımını tetikleyecek görev planlayıcı"
+msgid "failed to set up maintenance schedule"
+msgstr "bakım programı ayarlanamadı"
+
msgid "failed to add repo to global config"
msgstr "depo, global yapılandırmaya eklenemedi"
msgid "git maintenance <subcommand> [<options>]"
msgstr "git maintenance <altkomut> [<seçenekler>]"
-#, c-format
-msgid "invalid subcommand: %s"
-msgstr "geçersiz altkomut: %s"
-
msgid "git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]"
msgstr "git grep [<seçenekler>] [-e] <dizgi> [<rev>...] [[--] <yol>...]"
@@ -6604,6 +6790,10 @@ msgid "unable to read tree (%s)"
msgstr "ağaç okunamıyor (%s)"
#, c-format
+msgid "unable to read tree %s"
+msgstr "%s ağacı okunamıyor"
+
+#, c-format
msgid "unable to grep from object of type %s"
msgstr "%s türündeki bir nesneden grep yapılamıyor"
@@ -6647,8 +6837,8 @@ msgstr "ikili dosyaları textconv süzgeçleri ile işle"
msgid "search in subdirectories (default)"
msgstr "altdizinlerde ara (öntanımlı)"
-msgid "descend at most <depth> levels"
-msgstr "en çok <derinlik> düzey in"
+msgid "descend at most <n> levels"
+msgstr "en çok <n> düzey aşağı in"
msgid "use extended POSIX regular expressions"
msgstr "genişletilmiş POSIX düzenli ifadelerini kullan"
@@ -6750,6 +6940,9 @@ msgstr "sayfalayıcıda eşleşen dosyaları göster"
msgid "allow calling of grep(1) (ignored by this build)"
msgstr "grep(1)'in çağrılmasına izin ver (bu yapım tarafından yok sayıldı)"
+msgid "maximum number of results per file"
+msgstr "dosya başına en çok sonuç sayısı"
+
msgid "no pattern given"
msgstr "bir dizgi verilmedi"
@@ -6783,11 +6976,14 @@ msgid "both --cached and trees are given"
msgstr "hem --cached hem ağaçlar verilmiş"
msgid ""
-"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] "
-"[--] <file>..."
+"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
+" [--stdin [--literally]] [--] <file>..."
msgstr ""
-"git hash-object [-t <tür>] [-w] [--path=<dosya> | --no-filters] [--stdin] "
-"[--] <dosya>..."
+"git hash-object [-t <tür>] [-w] [--path=<dosya> | --no-filters]\n"
+" [--stdin [--literally]] [--] <dosya>..."
+
+msgid "git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]"
+msgstr "git hash-object [-t <tür>] [-w] --stdin-paths [--no-filters]"
msgid "object type"
msgstr "nesne türü"
@@ -6837,11 +7033,21 @@ msgstr "komut açıklamasını yazdır"
msgid "print list of useful guides"
msgstr "kullanışlı kılavuzların listesini çıkar"
+msgid "print list of user-facing repository, command and file interfaces"
+msgstr ""
+"kullanıcıya görünür depolar, komutlar ve dosya arayüzlerinin bir listesini "
+"yazdır"
+
+msgid "print list of file formats, protocols and other developer interfaces"
+msgstr ""
+"dosya biçimleri, protokoller ve diğer geliştirici arayüzlerinin bir "
+"listesini yazdır"
+
msgid "print all configuration variable names"
msgstr "tüm yapılandırma değişkenleri adlarını yazdır"
-msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>]"
-msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<komutlar>]"
+msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"
+msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<komut>|<belge>]"
#, c-format
msgid "unrecognized help format '%s'"
@@ -6911,12 +7117,19 @@ msgstr "kullanım: %s%s"
msgid "'git help config' for more information"
msgstr "ek bilgi için: 'git help config'"
-msgid "git hook run [--ignore-missing] <hook-name> [-- <hook-args>]"
-msgstr "git hook run [--ignore-missing] <kanca-adı> [-- <kanca-argümanları>]"
+msgid ""
+"git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-"
+"args>]"
+msgstr ""
+"git hook run [--ignore-missing] [--to-stdin=<yol>] <kanca-adı> [-- <kanca-"
+"argümanları>]"
msgid "silently ignore missing requested <hook-name>"
msgstr "istenen eksik <kanca-adı> sessizce yok sayılıyor"
+msgid "file to read into hooks' stdin"
+msgstr "kancaların stdin'ine okunacak dosya"
+
#, c-format
msgid "object type mismatch at %s"
msgstr "%s konumunda nesne türü uyuşmazlığı"
@@ -6993,16 +7206,12 @@ msgid "SHA1 COLLISION FOUND WITH %s !"
msgstr "%s İLE SHA1 ÇARPIŞMASI BULUNDU!"
#, c-format
-msgid "unable to read %s"
-msgstr "%s okunamıyor"
-
-#, c-format
msgid "cannot read existing object info %s"
-msgstr "mevcut %s nesne bilgisi okunamıyor"
+msgstr "var olan nesne bilgisi %s okunamıyor"
#, c-format
msgid "cannot read existing object %s"
-msgstr "mevcut %s nesnesi okunamıyor"
+msgstr "var olan nesne %s okunamıyor"
#, c-format
msgid "invalid blob object %s"
@@ -7025,7 +7234,7 @@ msgid "Indexing objects"
msgstr "Nesneler indeksleniyor"
msgid "pack is corrupted (SHA1 mismatch)"
-msgstr "paket hasar görmüş (SHA1 uyumsuzluğu)"
+msgstr "paket hasarlı (SHA1 uyumsuzluğu)"
msgid "cannot fstat packfile"
msgstr "paket dosyası fstat yapılamıyor"
@@ -7099,7 +7308,7 @@ msgstr "Mevcut paket dosyası '%s' açılamıyor"
#, c-format
msgid "Cannot open existing pack idx file for '%s'"
-msgstr "'%s' için mevcut paket idx dosyası açılamıyor"
+msgstr "'%s' için var olan paket idx dosyası açılamıyor"
#, c-format
msgid "non delta: %d object"
@@ -7133,83 +7342,18 @@ msgstr "--verify ile bir paket dosyası adı verilmedi"
msgid "fsck error in pack objects"
msgstr "paket nesnelerinde fsck hatası"
-#, c-format
-msgid "cannot stat template '%s'"
-msgstr "'%s' şablonunun bilgileri alınamıyor"
-
-#, c-format
-msgid "cannot opendir '%s'"
-msgstr "'%s' opendir yapılamıyor"
-
-#, c-format
-msgid "cannot readlink '%s'"
-msgstr "'%s' readlink yapılamıyor"
-
-#, c-format
-msgid "cannot symlink '%s' '%s'"
-msgstr "'%s', '%s' ögesine sembolik bağla bağlanamıyor"
-
-#, c-format
-msgid "cannot copy '%s' to '%s'"
-msgstr "'%s' şuraya kopyalanamıyor: '%s'"
-
-#, c-format
-msgid "ignoring template %s"
-msgstr "%s şablonu yok sayılıyor"
-
-#, c-format
-msgid "templates not found in %s"
-msgstr "şablonlar %s içinde bulunamadı"
-
-#, c-format
-msgid "not copying templates from '%s': %s"
-msgstr "şablonlar '%s' konumundan kopyalanmıyor: %s"
-
-#, c-format
-msgid "invalid initial branch name: '%s'"
-msgstr "geçersiz başlangıç dalı adı: '%s'"
-
-#, c-format
-msgid "unable to handle file type %d"
-msgstr "%d dosya türü ele alınamıyor"
-
-#, c-format
-msgid "unable to move %s to %s"
-msgstr "%s şuraya taşınamıyor: %s"
-
-msgid "attempt to reinitialize repository with different hash"
-msgstr "depoyu baÅŸka bir saÄŸlama ile yeniden ilklendirme deneniyor"
-
-#, c-format
-msgid "%s already exists"
-msgstr "%s halihazırda var"
-
-#, c-format
-msgid "re-init: ignored --initial-branch=%s"
-msgstr "re-init: --initial-branch=%s yok sayıldı"
-
-#, c-format
-msgid "Reinitialized existing shared Git repository in %s%s\n"
-msgstr "%s%s içindeki mevcut paylaşılan Git deposu yeniden ilklendirildi\n"
-
-#, c-format
-msgid "Reinitialized existing Git repository in %s%s\n"
-msgstr "%s%s içindeki mevcut Git deposu yeniden ilklendirildi\n"
-
-#, c-format
-msgid "Initialized empty shared Git repository in %s%s\n"
-msgstr "%s%s içinde paylaşılan boş Git deposu ilklendirildi\n"
-
-#, c-format
-msgid "Initialized empty Git repository in %s%s\n"
-msgstr "%s%s içinde boş Git deposu ilklendirildi\n"
-
msgid ""
-"git init [-q | --quiet] [--bare] [--template=<template-directory>] [--"
-"shared[=<permissions>]] [<directory>]"
+"git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
+" [--separate-git-dir <git-dir>] [--object-format=<format>]\n"
+" [--ref-format=<format>]\n"
+" [-b <branch-name> | --initial-branch=<branch-name>]\n"
+" [--shared[=<permissions>]] [<directory>]"
msgstr ""
-"git init [-q | --quiet] [--bare] [--template=<ÅŸablon-dizini>] [--"
-"shared[=<izinler>]] [<dizin>]"
+"git init [-q | --quiet] [--bare] [--template=<ÅŸablon-dizini>]\n"
+" [--separate-git-dir <git-dizini>] [--object-format=<biçim>]\n"
+" [--ref-format=<biçim>]\n"
+" [-b <dal-adı> | --initial-branch=<dal-adı>]\n"
+" [--shared[=<izin>]] [<dizin>]"
msgid "permissions"
msgstr "izinler"
@@ -7250,11 +7394,14 @@ msgid "--separate-git-dir incompatible with bare repository"
msgstr "--separate-git-dir, çıplak depo ile uyumsuz"
msgid ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"<token>[(=|:)<value>])...] [<file>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<key>|<keyAlias>)[(=|:)<value>])...]\n"
+" [--parse] [<file>...]"
msgstr ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"<jeton>[(=|:)<deÄŸer>])...] [<dosya>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<anahtar>|<anArması>)"
+"[(=|:)<deÄŸer>])...]\n"
+" [--parse] [<dosya>...]"
msgid "edit files in place"
msgstr "dosyaları yerinde düzenle"
@@ -7262,6 +7409,9 @@ msgstr "dosyaları yerinde düzenle"
msgid "trim empty trailers"
msgstr "boş artbilgileri kırp"
+msgid "placement"
+msgstr "yerleÅŸtirme"
+
msgid "where to place the new trailer"
msgstr "yeni artbilgiler nereye yerleÅŸtirilecek"
@@ -7274,17 +7424,17 @@ msgstr "artbilgi eksikse yapılacak eylem"
msgid "output only the trailers"
msgstr "yalnızca artbilgileri çıktı ver"
-msgid "do not apply config rules"
-msgstr "yapılandırma kurallarını uygulama"
+msgid "do not apply trailer.* configuration variables"
+msgstr "trailer.* yapılandırma değişkenlerini uygulama"
-msgid "join whitespace-continued values"
-msgstr "boşluk ile sürdürülen değerleri uç uca ekle"
+msgid "reformat multiline trailer values as single-line values"
+msgstr "çok satırlı artbilgileri tek satırlı değerler olarak biçimlendir"
-msgid "set parsing options"
-msgstr "ayrıştırma seçeneklerini ayarla"
+msgid "alias for --only-trailers --only-input --unfold"
+msgstr "--only-trailers --only-input --unfold için arma"
-msgid "do not treat --- specially"
-msgstr "ayırma çizgilerine (---) özel davranma"
+msgid "do not treat \"---\" as the end of input"
+msgstr "\"---\" dizgisine satır sonu olarak davranma"
msgid "trailer(s) to add"
msgstr "eklenecek artbilgi(ler)"
@@ -7311,8 +7461,8 @@ msgstr "diff çıktısını gizle"
msgid "show source"
msgstr "kaynağı göster"
-msgid "use mail map file"
-msgstr "posta eşlem dosyasını kullan"
+msgid "clear all previously-defined decoration filters"
+msgstr "tüm önceden tanımlanmış süsleme süzgeçlerini temizle"
msgid "only decorate refs that match <pattern>"
msgstr "yalnızca <dizgi> ile eşleşen başvuruları süsle"
@@ -7373,6 +7523,10 @@ msgstr "bir tam erim gerekiyor"
msgid "not a range"
msgstr "bir erim deÄŸil"
+#, c-format
+msgid "unable to read branch description file '%s'"
+msgstr "'%s' dal açıklama dosyası okunamıyor"
+
msgid "cover letter needs email format"
msgstr "ön yazı için e-posta biçimi gerekli"
@@ -7408,7 +7562,7 @@ msgstr ""
"Üstkaynak alınamadı; taban işlemesinin kaydını kendiliğinden yazmak\n"
"istiyorsanız lütfen git branch --set-upstream-to kullanarak bir uzak dalı\n"
"izleyin. Bunun dışında taban işlemesini kendiniz --base=<taban-işlemesi-no>\n"
-"kullanarak el ile belirtebilirsiniz."
+"kullanarak el ile belirtebilirsiniz"
msgid "failed to find exact merge base"
msgstr "kesin birleştirme temeli bulunamadı"
@@ -7471,6 +7625,9 @@ msgstr "açıklama kipinden kapak sayfası kipi"
msgid "generate parts of a cover letter based on a branch's description"
msgstr "ön yazının bazı kısımlarını dalın açıklamasından oluştur"
+msgid "use branch description from file"
+msgstr "dal açıklamasını dosyadan oku"
+
msgid "use [<prefix>] instead of [PATCH]"
msgstr "[PATCH] yerine [<önek>] kullan"
@@ -7566,6 +7723,9 @@ msgstr ""
msgid "percentage by which creation is weighted"
msgstr "oluşumun tartıldığı yüzde"
+msgid "show in-body From: even if identical to the e-mail header"
+msgstr "e-posta üstbilgisinin aynısı dahi olsa gövde için From:'u göster"
+
#, c-format
msgid "invalid ident line: %s"
msgstr "geçersiz tanımlayıcı satırı: %s"
@@ -7624,6 +7784,22 @@ msgid ""
"Could not find a tracked remote branch, please specify <upstream> manually.\n"
msgstr "İzlenen bir uzak dal bulunamadı, lütfen el ile <üstkaynak> belirtin.\n"
+#, c-format
+msgid "could not get object info about '%s'"
+msgstr "'%s' hakkında nesne bilgisi alınamadı"
+
+#, c-format
+msgid "bad ls-files format: element '%s' does not start with '('"
+msgstr "hatalı ls-files biçimi: '%s' ögesi, '(' ile başlamıyor"
+
+#, c-format
+msgid "bad ls-files format: element '%s' does not end in ')'"
+msgstr "hatalı ls-files biçimi: '%s' ögesi, ')' ile sonlanmıyor"
+
+#, c-format
+msgid "bad ls-files format: %%%.*s"
+msgstr "hatalı ls-files biçimi: %%%.*s"
+
msgid "git ls-files [<options>] [<file>...]"
msgstr "git ls-files [<seçenekler>] [<dosya>...]"
@@ -7709,13 +7885,20 @@ msgid "show sparse directories in the presence of a sparse index"
msgstr "bir aralıklı indeks bulunurluğunda aralıklı dizinleri göster"
msgid ""
+"--format cannot be used with -s, -o, -k, -t, --resolve-undo, --deduplicate, "
+"--eol"
+msgstr ""
+"--format; -s, -o, -k, -t, --resolve-undo, --deduplicate, --eol ile birlikte "
+"kullanılamaz"
+
+msgid ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<repository> [<refs>...]]"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
+" [--symref] [<repository> [<patterns>...]]"
msgstr ""
-"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<çlştr>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<depo> [<baÅŸvurular>...]]"
+"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<yürütülebilir>]\n"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<anahtar>]\n"
+" [--symref] [<depo> [<dizgiler>...]]"
msgid "do not print remote URL"
msgstr "uzak konum URL'sini yazdırma"
@@ -7748,10 +7931,6 @@ msgid "git ls-tree [<options>] <tree-ish> [<path>...]"
msgstr "git ls-tree [<seçenekler>] <ağacımsı> [<yol>...]"
#, c-format
-msgid "could not get object info about '%s'"
-msgstr "'%s' hakkında nesne bilgisi alınamadı"
-
-#, c-format
msgid "bad ls-tree format: element '%s' does not start with '('"
msgstr "hatalı ls-tree biçimi: '%s' ögesi '(' ile başlamıyor"
@@ -7843,12 +8022,12 @@ msgstr "git merge-base [-a | --all] <iÅŸleme> <iÅŸleme>..."
msgid "git merge-base [-a | --all] --octopus <commit>..."
msgstr "git merge-base [-a | --all] --octopus <iÅŸleme>..."
-msgid "git merge-base --independent <commit>..."
-msgstr "git merge-base --independent <iÅŸleme>..."
-
msgid "git merge-base --is-ancestor <commit> <commit>"
msgstr "git merge-base --is-ancestor <iÅŸleme> <iÅŸleme>"
+msgid "git merge-base --independent <commit>..."
+msgstr "git merge-base --independent <iÅŸleme>..."
+
msgid "git merge-base --fork-point <ref> [<commit>]"
msgstr "git merge-base --fork-point <baÅŸvuru> [<iÅŸleme>]"
@@ -7874,9 +8053,19 @@ msgstr ""
"git merge-file [<seçenekler>] [-L <ad1> [-L <orij> [-L <ad2>]]] <dosya1> "
"<orij-dosya> <dosya2>"
+msgid ""
+"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
+"\"histogram\""
+msgstr ""
+"diff-algorithm seçeneği şunları kabul eder: \"myers\", \"minimal\", "
+"\"patience\" ve \"histogram\""
+
msgid "send results to standard output"
msgstr "sonuçları standart çıktıya gönder"
+msgid "use object IDs instead of filenames"
+msgstr "dosya adları yerine nesne kimlikleri kullan"
+
msgid "use a diff3 based merge"
msgstr "diff3 tabanlı birleştirme kullan"
@@ -7892,6 +8081,12 @@ msgstr "çakışmalarda onların sürümünü kullan"
msgid "for conflicts, use a union version"
msgstr "çakışmalarda birlik olmuş bir sürüm kullan"
+msgid "<algorithm>"
+msgstr "<algoritma>"
+
+msgid "choose a diff algorithm"
+msgstr "bir diff algoritması seç"
+
msgid "for conflicts, use this marker size"
msgstr "çakışmalarda bu imleyici boyutunu kullan"
@@ -7902,6 +8097,13 @@ msgid "set labels for file1/orig-file/file2"
msgstr "file1/orig-file/file2 için etiketler yapıştır"
#, c-format
+msgid "object '%s' does not exist"
+msgstr "'%s' diye bir nesne yok"
+
+msgid "Could not write object file"
+msgstr "nesne dosyası yazılamadı"
+
+#, c-format
msgid "unknown option %s"
msgstr "bilinmeyen seçenek %s"
@@ -7926,6 +8128,63 @@ msgstr "'%s' başvurusu çözülemedi"
msgid "Merging %s with %s\n"
msgstr "%s, %s ile birleÅŸtiriliyor\n"
+msgid "not something we can merge"
+msgstr "birleÅŸtirebileceÄŸimiz bir ÅŸey deÄŸil"
+
+msgid "refusing to merge unrelated histories"
+msgstr "birbiriyle ilişkisi olmayan geçmişleri birleştirme reddediliyor"
+
+msgid "failure to merge"
+msgstr "birleÅŸtirilemedi"
+
+msgid "git merge-tree [--write-tree] [<options>] <branch1> <branch2>"
+msgstr "git merge-tree [--write-tree] [<seçenekler>] <dal1> <dal2>"
+
+msgid "git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"
+msgstr "git merge-tree [--trivial-merge] <taban-ağaç> <dal1> <dal2>"
+
+msgid "do a real merge instead of a trivial merge"
+msgstr "bir önemsiz birleştirme yerine gerçek bir birleştirme yap"
+
+msgid "do a trivial merge only"
+msgstr "yalnızca bir önemsiz birleştirme yap"
+
+msgid "also show informational/conflict messages"
+msgstr "ayrıcı bilgi/çakışma iletilerini göster"
+
+msgid "list filenames without modes/oids/stages"
+msgstr "kipi/oid'si/hazırlığı olmayan dosya adlarını listele"
+
+msgid "allow merging unrelated histories"
+msgstr "birbiriyle ilişkisi olmayan geçmişlerin birleştirilmesine izin ver"
+
+msgid "perform multiple merges, one per line of input"
+msgstr "girdi satırı başına bir adet çoklu birleştirmeler gerçekleştir"
+
+msgid "specify a merge-base for the merge"
+msgstr "birleştirme için bir birleştirme temeli belirtilmeli"
+
+msgid "option=value"
+msgstr "seçenek=değer"
+
+msgid "option for selected merge strategy"
+msgstr "seçili birleştirme stratejisi için seçenekler"
+
+msgid "--trivial-merge is incompatible with all other options"
+msgstr "--trivial-merge, tüm diğer seçeneklerle uyumsuz"
+
+#, c-format
+msgid "unknown strategy option: -X%s"
+msgstr "bilinmeyen strateji seçeneği: -X%s"
+
+#, c-format
+msgid "malformed input line: '%s'."
+msgstr "hatalı oluşturulmuş girdi satırı: '%s'."
+
+#, c-format
+msgid "merging cannot continue; got unclean result of %d"
+msgstr "birleştirme sürdürülemiyor; %d için temiz olmayan sonuçlar alındı"
+
msgid "git merge [<options>] [<commit>...]"
msgstr "git merge [<seçenekler>] [<işleme>...]"
@@ -7985,12 +8244,6 @@ msgstr "strateji"
msgid "merge strategy to use"
msgstr "kullanılacak birleştirme stratejisi"
-msgid "option=value"
-msgstr "seçenek=değer"
-
-msgid "option for selected merge strategy"
-msgstr "seçili birleştirme stratejisi için seçenekler"
-
msgid "merge commit message (for a non-fast-forward merge)"
msgstr ""
"birleştirme işlemesi iletisi (ileri sarım olmayan bir birleştirme için)"
@@ -8007,9 +8260,6 @@ msgstr "--abort; ancak indeksi ve çalışma ağacını değiştirmeden bırakı
msgid "continue the current in-progress merge"
msgstr "ilerlemekte olan geçerli birleştirmeyi sürdürün"
-msgid "allow merging unrelated histories"
-msgstr "birbiriyle ilişkisi olmayan geçmişlerin birleştirilmesine izin ver"
-
msgid "bypass pre-merge-commit and commit-msg hooks"
msgstr "pre-merge-commit ve commit-msg kancalarını atla"
@@ -8027,7 +8277,7 @@ msgid "read-tree failed"
msgstr "read-tree başarısız oldu"
msgid "Already up to date. (nothing to squash)"
-msgstr "Tümü güncel (tıkıştırılacak bir şey yok)."
+msgstr "Tümü güncel (tıkıştırılacak bir şey yok)"
msgid "Already up to date."
msgstr "Tümü güncel."
@@ -8055,10 +8305,6 @@ msgid "Not handling anything other than two heads merge."
msgstr "İki uç işlemenin birleştirilmesi dışında bir şey yapılmıyor."
#, c-format
-msgid "unknown strategy option: -X%s"
-msgstr "bilinmeyen strateji seçeneği: -X%s"
-
-#, c-format
msgid "unable to write %s"
msgstr "%s yazılamıyor"
@@ -8126,9 +8372,6 @@ msgstr "'%s' kapatılamadı"
msgid "not something we can merge in %s: %s"
msgstr "%s içinde birleştirebileceğimiz bir şey değil: %s"
-msgid "not something we can merge"
-msgstr "birleÅŸtirebileceÄŸimiz bir ÅŸey deÄŸil"
-
msgid "--abort expects no arguments"
msgstr "--abort bir argüman beklemez"
@@ -8148,18 +8391,18 @@ msgid ""
"You have not concluded your merge (MERGE_HEAD exists).\n"
"Please, commit your changes before you merge."
msgstr ""
-"Birleştirmenizi sonuçlandırmadınız (MERGE_HEAD mevcut).\n"
+"Birleştirmenizi sonuçlandırmadınız (MERGE_HEAD var).\n"
"Lütfen birleştirmeden önce değişikliklerinizi işleyin."
msgid ""
"You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n"
"Please, commit your changes before you merge."
msgstr ""
-"Seç-al'ınızı sonuçlandırmadınız (CHERRY_PICK_HEAD mevcut).\n"
+"Seç-al'ınızı sonuçlandırmadınız (CHERRY_PICK_HEAD var).\n"
"Lütfen birleştirmeden önce değişikliklerinizi işleyin."
msgid "You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists)."
-msgstr "Seç-al'ınızı sonuçlandırmadınız (CHERRY_PICK_HEAD mevcut)."
+msgstr "Seç-al'ınızı sonuçlandırmadınız (CHERRY_PICK_HEAD var)."
msgid "No commit specified and merge.defaultToUpstream not set."
msgstr "Belirtilen bir işleme yok ve merge.defaultToUpstream ayarlanmamış."
@@ -8178,14 +8421,19 @@ msgstr "%s - birleÅŸtirebileceÄŸimiz bir ÅŸey deÄŸil"
msgid "Can merge only exactly one commit into empty head"
msgstr "Boş dal ucuna tam olarak yalnızca bir işleme birleştirilebilir"
-msgid "refusing to merge unrelated histories"
-msgstr "birbiriyle ilişkisi olmayan geçmişleri birleştirme reddediliyor"
-
#, c-format
msgid "Updating %s..%s\n"
msgstr "Güncelleniyor: %s..%s\n"
#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+" %s"
+msgstr ""
+"Birleştirme ile aşağıdaki yerel değişikliklerin üzerine yazılacak:\n"
+"\t%s"
+
+#, c-format
msgid "Trying really trivial in-index merge...\n"
msgstr "Gerçekten önemsiz indeks içi birleştirme deneniyor...\n"
@@ -8203,7 +8451,7 @@ msgstr "%s birleÅŸtirme stratejisi deneniyor...\n"
#, c-format
msgid "No merge strategy handled the merge.\n"
-msgstr "Birleştirmeyi hiçbir birleştirme stratejisi işlemedi\n"
+msgstr "Birleştirmeyi hiçbir birleştirme stratejisi ele almadı\n"
#, c-format
msgid "Merge with strategy %s failed.\n"
@@ -8219,6 +8467,10 @@ msgstr ""
"Otomatik birleştirme iyi geçti; istendiği üzere gönderme öncesinde durdu.\n"
#, c-format
+msgid "When finished, apply stashed changes with `git stash pop`\n"
+msgstr "BittiÄŸinde, 'git stash pop' ile zulalalan deÄŸiÅŸiklikleri uygula\n"
+
+#, c-format
msgid "warning: tag input does not pass fsck: %s"
msgstr "uyarı: etiket girdisi fsck'den geçemiyor: %s"
@@ -8336,11 +8588,14 @@ msgstr "'%s'->'%s' yeniden adlandırması denetleniyor\n"
msgid "bad source"
msgstr "hatalı kaynak"
+msgid "destination exists"
+msgstr "hedef konum var"
+
msgid "can not move directory into itself"
msgstr "dizin kendi içine taşınamıyor"
-msgid "cannot move directory over file"
-msgstr "dizin dosya üzerinden taşınamıyor"
+msgid "destination already exists"
+msgstr "hedef halihazırda var"
msgid "source directory is empty"
msgstr "kaynak dizin boÅŸ"
@@ -8351,9 +8606,6 @@ msgstr "sürüm denetimi altında değil"
msgid "conflicted"
msgstr "çakışmalı"
-msgid "destination exists"
-msgstr "hedef mevcut"
-
#, c-format
msgid "overwriting '%s'"
msgstr "üzerine yazılıyor: '%s'"
@@ -8365,7 +8617,10 @@ msgid "multiple sources for the same target"
msgstr "aynı hedef için birden çok kaynak"
msgid "destination directory does not exist"
-msgstr "hedef dizin mevcut deÄŸil"
+msgstr "hedef dizin yok"
+
+msgid "destination exists in the index"
+msgstr "hedef konum indekste var"
#, c-format
msgid "%s, source=%s, destination=%s"
@@ -8419,21 +8674,25 @@ msgid "git notes [--ref <notes-ref>] [list [<object>]]"
msgstr "git notes [--ref <not-bÅŸvr>] [list [<nesne>]]"
msgid ""
-"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [-m <msg> | -F <file> "
-"| (-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref <not-bÅŸvr>] add [-f] [--allow-empty] [-m <ileti> | -F "
-"<dosya> | (-c | -C) <nesne>] [<nesne>]"
+"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>]"
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
msgstr "git notes [--ref <not-bÅŸvr>] copy [-f] <nesneden> <nesneye>"
msgid ""
-"git notes [--ref <notes-ref>] append [--allow-empty] [-m <msg> | -F <file> | "
-"(-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref <not-bÅŸvr>] append [--allow-empty] [-m <ileti> | -F <dosya> "
-"| (-c | -C) <nesne>] [<nesne>]"
+"git notes [--ref <not-bÅŸv>] append [--allow-empty] [--[no-]separator|--"
+"separator=<paragraf-sonu>] [--[no-]stripspace] [-m <ileti> | -F <dosya> | (-"
+"c | -C) <nesne>] [<nesne>]"
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
msgstr "git notes [--ref <not-bÅŸvr>] edit [--allow-empty] [<nesne>]"
@@ -8517,11 +8776,11 @@ msgstr "not içeriği %s içinde bırakıldı"
#, c-format
msgid "could not open or read '%s'"
-msgstr "'%s' açılamadı veya okunamadı"
+msgstr "'%s', açılamadı veya okunamadı"
#, c-format
msgid "failed to resolve '%s' as a valid ref."
-msgstr "'%s' geçerli bir başvuru olarak çözülemedi"
+msgstr "'%s', geçerli bir başvuru olarak çözülemedi."
#, c-format
msgid "failed to read object '%s'."
@@ -8532,10 +8791,6 @@ msgid "cannot read note data from non-blob object '%s'."
msgstr "İkili nesne olmayan '%s' nesnesinden not verisi okunamıyor."
#, c-format
-msgid "malformed input line: '%s'."
-msgstr "hatalı oluşturulmuş girdi satırı: '%s'"
-
-#, c-format
msgid "failed to copy notes from '%s' to '%s'"
msgstr "notlar '%s' konumundan '%s' konumuna kopyalanamadı"
@@ -8568,13 +8823,22 @@ msgstr "boş not depolamasına izin ver"
msgid "replace existing notes"
msgstr "var olan notları başkalarıyla değiştir"
+msgid "<paragraph-break>"
+msgstr "<paragraf-sonu>"
+
+msgid "insert <paragraph-break> between paragraphs"
+msgstr "paragraflar arasında <paragraf-sonu> ekle"
+
+msgid "remove unnecessary whitespace"
+msgstr "gereksiz boşlukları kaldır"
+
#, c-format
msgid ""
"Cannot add notes. Found existing notes for object %s. Use '-f' to overwrite "
"existing notes"
msgstr ""
"Not eklenemiyor. %s nesnesi için halihazırda var olan notlar bulundu. Bu "
-"notların üzerine yazmak için '-f' kullanın."
+"notların üzerine yazmak için '-f' kullanın"
#, c-format
msgid "Overwriting existing notes for object %s\n"
@@ -8599,7 +8863,7 @@ msgid ""
"existing notes"
msgstr ""
"Notlar kopyalanamıyor. %s nesnesi için halihazırda var olan notlar bulundu. "
-"Bu notların üzerine yazmak için '-f' kullanın."
+"Bu notların üzerine yazmak için '-f' kullanın"
#, c-format
msgid "missing notes on source object %s. Cannot copy."
@@ -8629,7 +8893,7 @@ msgid "could not find commit from NOTES_MERGE_PARTIAL."
msgstr "işleme, NOTES_MERGE_PARTIAL ögesinden bulunamadı."
msgid "could not parse commit from NOTES_MERGE_PARTIAL."
-msgstr "işleme, NOTES_MERGE_PARTIAL ögesinden ayrıştırılamadı"
+msgstr "işleme, NOTES_MERGE_PARTIAL ögesinden ayrıştırılamadı."
msgid "failed to resolve NOTES_MERGE_REF"
msgstr "NOTES_MERGE_REF çözülemedi"
@@ -8696,7 +8960,7 @@ msgstr ""
#, c-format
msgid "Failed to resolve '%s' as a valid ref."
-msgstr "'%s' geçerli bir başvuru olarak çözülemiyor"
+msgstr "'%s', geçerli bir başvuru olarak çözülemiyor."
#, c-format
msgid "Object %s has no note\n"
@@ -8721,19 +8985,19 @@ msgid "use notes from <notes-ref>"
msgstr "notları <not-bşvr>'ndan kullan"
#, c-format
-msgid "unknown subcommand: %s"
-msgstr "bilinmeyen altkomut: %s"
+msgid "unknown subcommand: `%s'"
+msgstr "bilinmeyen altkomut: '%s'"
-msgid ""
-"git pack-objects --stdout [<options>...] [< <ref-list> | < <object-list>]"
+msgid "git pack-objects --stdout [<options>] [< <ref-list> | < <object-list>]"
msgstr ""
-"git pack-objects --stdout [<seçenekler>...] [< <bşvr-liste> | < <nesne-"
-"liste>]"
+"git pack-objects --stdout [<sçnklr>] [< <başvuru-listesi> | < <nesne-"
+"listesi>]"
msgid ""
-"git pack-objects [<options>...] <base-name> [< <ref-list> | < <object-list>]"
+"git pack-objects [<options>] <base-name> [< <ref-list> | < <object-list>]"
msgstr ""
-"git pack-objects [<sçnklr>...] <base-name> [< <bşvr-liste> | < <nesne-liste>]"
+"git pack-objects [<sçnklr>] <temel-ad> [< <bşvru-listesi> | < <nesne-"
+"listesi>]"
#, c-format
msgid ""
@@ -8749,7 +9013,7 @@ msgstr "%s için hatalı paketlenmiş nesne CRC'si"
#, c-format
msgid "corrupt packed object for %s"
-msgstr "%s için hasar görmüş paketlenmiş nesne"
+msgstr "%s için hasarlı paketlenmiş nesne"
#, c-format
msgid "recursive delta detected for object %s"
@@ -8838,6 +9102,10 @@ msgid "inconsistency with delta count"
msgstr "delta sayımında tutarsızlık"
#, c-format
+msgid "invalid pack.allowPackReuse value: '%s'"
+msgstr "geçersiz pack.allowPackReuse değeri: '%s'"
+
+#, c-format
msgid ""
"value of uploadpack.blobpackfileuri must be of the form '<object-hash> <pack-"
"hash> <uri>' (got '%s')"
@@ -8921,6 +9189,12 @@ msgstr "desteklenmeyen indeks sürümü %s"
msgid "bad index version '%s'"
msgstr "hatalı indeks sürümü '%s'"
+msgid "show progress meter during object writing phase"
+msgstr "ilerleme çubuğunu nesne yazımı aşaması sırasında göster"
+
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "ilerleme çubuğu gösterildiğinde --all-progress'e benzer"
+
msgid "<version>[,<offset>]"
msgstr "<sürüm>[,<ofset>]"
@@ -9068,9 +9342,6 @@ msgstr "olabilecek en küçük paket boyutu limiti 1 MiB'dır"
msgid "--thin cannot be used to build an indexable pack"
msgstr "--thin bir indekslenebilir paket yapımında kullanılamaz"
-msgid "cannot use --filter without --stdout"
-msgstr "--filter, --stdout olmadan kullanılamaz"
-
msgid "cannot use --filter with --stdin-packs"
msgstr "--filter, --stdin-packs ile birlikte kullanılamıyor"
@@ -9083,19 +9354,16 @@ msgstr "iç revizyon listeleri, --cruft ile birlikte kullanılamıyor"
msgid "cannot use --stdin-packs with --cruft"
msgstr "--stdin-packs, --cruft ile birlikte kullanılamıyor"
-msgid "cannot use --max-pack-size with --cruft"
-msgstr "--max-pack-size, --cruft ile birlikte kullanılamıyor"
-
msgid "Enumerating objects"
msgstr "Nesneler ortaya dökülüyor"
#, c-format
msgid ""
"Total %<PRIu32> (delta %<PRIu32>), reused %<PRIu32> (delta %<PRIu32>), pack-"
-"reused %<PRIu32>"
+"reused %<PRIu32> (from %<PRIuMAX>)"
msgstr ""
"Toplam %<PRIu32> (delta %<PRIu32>), yeniden kullanılan %<PRIu32> (delta "
-"%<PRIu32>), yeniden kullanılan paket %<PRIu32>"
+"%<PRIu32>), yeniden kullanılan paket %<PRIu32> (%<PRIuMAX> konumundan)"
msgid ""
"'git pack-redundant' is nominated for removal.\n"
@@ -9111,8 +9379,15 @@ msgstr ""
"<git@vger.kernel.org> adresine bir e-posta atarak\n"
"bize haber verin. SaÄŸ olun.\n"
-msgid "git pack-refs [<options>]"
-msgstr "git pack-refs [<seçenekler>]"
+msgid "refusing to run without --i-still-use-this"
+msgstr "--i-still-use-this olmadan çalıştırma reddediliyor"
+
+msgid ""
+"git pack-refs [--all] [--no-prune] [--include <pattern>] [--exclude "
+"<pattern>]"
+msgstr ""
+"git pack-refs [--all] [--no-prune]git pack-refs [--all] [--no-prune] [--"
+"include <dizgi>] [--exclude <dizgi>]"
msgid "pack everything"
msgstr "her ÅŸeyi paketle"
@@ -9120,6 +9395,24 @@ msgstr "her ÅŸeyi paketle"
msgid "prune loose refs (default)"
msgstr "gevşek başvuruları buda (öntanımlı)"
+msgid "references to include"
+msgstr "içerilecek başvurular"
+
+msgid "references to exclude"
+msgstr "dışarıda tutulacak başvurular"
+
+msgid "git patch-id [--stable | --unstable | --verbatim]"
+msgstr "git patch-id [--stable | --unstable | --verbatim]"
+
+msgid "use the unstable patch-id algorithm"
+msgstr "kararlı olmayan yama kimliği algoritmasını kullan"
+
+msgid "use the stable patch-id algorithm"
+msgstr "kararlı yama kimliği algoritmasını kullan"
+
+msgid "don't strip whitespace from the patch"
+msgstr "yamadan boşlukları çıkarma"
+
msgid "git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"
msgstr ""
"git prune [-n] [-v] [--progress] [--expire <zaman>] [--] [<dal-ucu>...]"
@@ -9166,6 +9459,12 @@ msgstr "zorla yerel dalın üzerine yaz"
msgid "number of submodules pulled in parallel"
msgstr "paralelde çekilen altmodüllerin sayısı"
+msgid "use IPv4 addresses only"
+msgstr "yalnızca IPv4 adresleri kullan"
+
+msgid "use IPv6 addresses only"
+msgstr "yalnızca IPv6 adresleri kullan"
+
msgid ""
"There is no candidate for rebasing against among the refs that you just "
"fetched."
@@ -9204,7 +9503,7 @@ msgid "Please specify which branch you want to merge with."
msgstr "Lütfen hangi dal ile birleştirmek istediğinizi belirtin."
msgid "See git-pull(1) for details."
-msgstr "Ayrıntılar için: git-pull(1)"
+msgstr "Ayrıntılar için git-pull(1)'a bakın."
msgid "<remote>"
msgstr "<uzak-konum>"
@@ -9250,7 +9549,7 @@ msgid ""
"or --ff-only on the command line to override the configured default per\n"
"invocation.\n"
msgstr ""
-"Iraksak dallarınız mevcut ve onların nasıl uzlaştırılacağını\n"
+"Iraksak dallarınız var ve onların nasıl uzlaştırılacağını\n"
"belirtmeniz gerekiyor. Bunu bir sonraki çekimden önce\n"
"aşağıdaki komutlardan birini çalıştırarak yapabilirsiniz:\n"
"\n"
@@ -9269,7 +9568,7 @@ msgstr "İndekse eklenen değişikliklerle henüz doğmamış bir dal güncellen
msgid "pull with rebase"
msgstr "yeniden temellendirme ile çekim"
-msgid "please commit or stash them."
+msgid "Please commit or stash them."
msgstr "Lütfen onları işleyin veya zulalayın."
#, c-format
@@ -9333,9 +9632,8 @@ msgstr ""
msgid ""
"\n"
-"To avoid automatically configuring upstream branches when their name\n"
-"doesn't match the local branch, see option 'simple' of branch."
-"autoSetupMerge\n"
+"To avoid automatically configuring an upstream branch when its name\n"
+"won't match the local branch, see option 'simple' of branch.autoSetupMerge\n"
"in 'git help config'.\n"
msgstr ""
"\n"
@@ -9425,39 +9723,39 @@ msgstr ""
msgid ""
"Updates were rejected because the tip of your current branch is behind\n"
-"its remote counterpart. Integrate the remote changes (e.g.\n"
-"'git pull ...') before pushing again.\n"
+"its remote counterpart. If you want to integrate the remote changes,\n"
+"use 'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"Güncellemeler reddedildi; çünkü geçerli dalınızın ucu kendisinin\n"
-"uzak konum karşıtından geride. Yeniden itmeden önce uzak konumdaki\n"
-"değişiklikleri entegre edin (örn. 'git pull ...').\n"
+"uzak konum karşıtından geride. Uzaktaki değişiklikleri tümleştirmek\n"
+"istiyorsanız yeniden itmeden önce 'git pull' yapın.\n"
"Ayrıntılar için 'git push --help' içinde 'Notes about fast-forwards'a\n"
"bakın."
msgid ""
"Updates were rejected because a pushed branch tip is behind its remote\n"
-"counterpart. Check out this branch and integrate the remote changes\n"
-"(e.g. 'git pull ...') before pushing again.\n"
+"counterpart. If you want to integrate the remote changes, use 'git pull'\n"
+"before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"Güncellemeler reddedildi; çünkü itilmiş bir dal ucu kendisinin\n"
-"uzak konum karşıtından geride. Yeniden itmeden önce bu dalı çıkış\n"
-"yapın ve uzak konumdaki değişiklikleri entegre edin (örn. 'git pull\n"
-"...'). Ayrıntılar için 'git push --help' içinde 'Notes about\n"
-"fast-forwards'a bakın."
+"uzak konum karşıtından geride. Uzaktaki değişiklikleri tümleştirmek\n"
+"istiyorsanız yeniden itmeden önce 'git pull' yapın.\n"
+"Ayrıntılar için 'git push --help' içinde 'Notes about fast-forwards'a\n"
+"bakın."
msgid ""
-"Updates were rejected because the remote contains work that you do\n"
-"not have locally. This is usually caused by another repository pushing\n"
-"to the same ref. You may want to first integrate the remote changes\n"
-"(e.g., 'git pull ...') before pushing again.\n"
+"Updates were rejected because the remote contains work that you do not\n"
+"have locally. This is usually caused by another repository pushing to\n"
+"the same ref. If you want to integrate the remote changes, use\n"
+"'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"Güncellemeler reddedildi; çünkü uzak konumda henüz yerelde sizde olmayan\n"
"değişiklikler var. Bu genelde başka bir deponun aynı başvuruya itmesinden\n"
-"dolayı olur. Yeniden itmeden önce uzak konumdaki değişiklikleri entegre\n"
-"etmek isteyebilirsiniz (örn. 'git pull ...').\n"
+"dolayı olur. Uzaktaki değişiklikleri tümleştirmek istiyorsanız yeniden\n"
+"itmeden önce 'git pull' yapın..\n"
"Ayrıntılar için 'git push --help' içinde 'Notes about fast-forwards'a\n"
"bakın."
@@ -9474,24 +9772,32 @@ msgstr ""
"olmayan bir nesneye işaret etmesini sağlaması için güncelleyemezsiniz.\n"
msgid ""
-"Updates were rejected because the tip of the remote-tracking\n"
-"branch has been updated since the last checkout. You may want\n"
-"to integrate those changes locally (e.g., 'git pull ...')\n"
-"before forcing an update.\n"
+"Updates were rejected because the tip of the remote-tracking branch has\n"
+"been updated since the last checkout. If you want to integrate the\n"
+"remote changes, use 'git pull' before pushing again.\n"
+"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"Güncellemeler reddedildi; çünkü uzak izleme dalının ucu son\n"
-"çıkıştan bu yana güncellenmiş. Bir güncellemeyi zorlamadan\n"
-"önce bu değişiklikleri yerel olarak entegre etmek isteye-\n"
-"bilirsiniz (örn. 'git pull ...'\n"
+"Güncellemeler reddedildi; çünkü geçerli dalınızın ucu kendisinin\n"
+"uzak konum karşıtından geride. Uzaktaki değişiklikleri tümleştirmek\n"
+"istiyorsanız yeniden itmeden önce 'git pull' yapın.\n"
+"Ayrıntılar için 'git push --help' içinde 'Notes about fast-forwards'a\n"
+"bakın."
#, c-format
msgid "Pushing to %s\n"
-msgstr "Ä°tme konumu: %s\n"
+msgstr "Åžuraya itiliyor: %s\n"
#, c-format
msgid "failed to push some refs to '%s'"
msgstr "bazı başvurular '%s' konumuna itilemedi"
+msgid ""
+"recursing into submodule with push.recurseSubmodules=only; using on-demand "
+"instead"
+msgstr ""
+"altmodül içine push.recurseSubmodules=only ile özyineleniyor; yerine talep "
+"başına kullanılıyor"
+
#, c-format
msgid "invalid value for '%s'"
msgstr "'%s' için geçersiz değer"
@@ -9499,8 +9805,8 @@ msgstr "'%s' için geçersiz değer"
msgid "repository"
msgstr "depo"
-msgid "push all refs"
-msgstr "tüm başvuruları it"
+msgid "push all branches"
+msgstr "tüm dalları it"
msgid "mirror all refs"
msgstr "tüm başvuruları yansıla"
@@ -9508,20 +9814,20 @@ msgstr "tüm başvuruları yansıla"
msgid "delete refs"
msgstr "başvuruları sil"
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "etiketleri it (--all veya --mirror ile kullanılamaz)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr "etiketleri it (--all, --branches veya --mirror ile kullanılamaz)"
msgid "force updates"
-msgstr "zorla güncelle"
+msgstr "güncellemeleri zorla"
msgid "<refname>:<expect>"
-msgstr "<başvuruadı>:<bekle>"
+msgstr "<bşvr-adı>:<bekle>"
msgid "require old value of ref to be at this value"
msgstr "başvurunun eski değerinin bu değerde olmasını gerektir"
msgid "require remote updates to be integrated locally"
-msgstr "uzak güncellemelerin yerele entegre edilmesini gerektir"
+msgstr "uzak güncellemelerin yerele tümleştirilmesini gerektir"
msgid "control recursive pushing of submodules"
msgstr "altmodüllerin özyineli itilmesini denetle"
@@ -9613,23 +9919,29 @@ msgid "only emit output related to the second range"
msgstr "yalnızca ikinci erimle ilişkili çıktıyı yay"
#, c-format
+msgid "not a revision: '%s'"
+msgstr "bir revizyon deÄŸil: '%s'"
+
+#, c-format
msgid "not a commit range: '%s'"
msgstr "bir iÅŸleme erimi deÄŸil: '%s'"
-msgid "single arg format must be symmetric range"
-msgstr "tekli argüman biçimi simetrik erim olmalı"
+#, c-format
+msgid "not a symmetric range: '%s'"
+msgstr "bir simetrik erim deÄŸil: '%s'"
msgid "need two commit ranges"
msgstr "iki iÅŸleme erimi gerekli"
msgid ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>) "
-"[-u | -i]] [--no-sparse-checkout] [--index-output=<file>] (--empty | <tree-"
-"ish1> [<tree-ish2> [<tree-ish3>]])"
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<prefix>)\n"
+" [-u | -i]] [--index-output=<file>] [--no-sparse-checkout]\n"
+" (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"
msgstr ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<önek>) [-"
-"u | -i]] [--no-sparse-checkout] [--index-output=<dosya>] (--empty | "
-"<ağacımsı1> [<ağacımsı2> [<ağacımsı3>]])"
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<önek>)\n"
+" [-u | -i]] [--index-output=<dosya>] [--no-sparse-checkout]\n"
+" (--empty | <ağacımsı1> [<ağacımsı2> [<ağacımsı3>]])"
msgid "write resulting index to <file>"
msgstr "ortaya çıkan indeksi <dosya>'ya yaz"
@@ -9720,8 +10032,8 @@ msgid "%s requires the merge backend"
msgstr "%s birleÅŸtirme arka ucunu gerektiriyor"
#, c-format
-msgid "could not get 'onto': '%s'"
-msgstr "'onto' alınamadı: '%s'"
+msgid "invalid onto: '%s'"
+msgstr "üzerine geçersiz: '%s'"
#, c-format
msgid "invalid orig-head: '%s'"
@@ -9767,16 +10079,32 @@ msgstr ""
"Bunun sonucu olarak git onları yeniden temellendiremiyor."
#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "Bilinmeyen rebase-merges kipi: %s"
+
+#, c-format
msgid "could not switch to %s"
msgstr "şuraya geçilemedi: %s"
+msgid "apply options and merge options cannot be used together"
+msgstr "uygulama seçenekleri ve birleştirme seçenekleri birlikte kullanılamaz"
+
#, c-format
msgid ""
-"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and \"ask"
-"\"."
+"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and "
+"\"ask\"."
msgstr ""
"Tanımlanamayan boş tür '%s'; geçerli türler: \"drop\", \"keep\" ve \"ask\"."
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"bir boş dizi argümanıyla --rebase-merges yapmak artık kullanılmıyor ve "
+"Git'in ileriki bir sürümünde tümüyle kaldırılacak. Bunun yerine, aynı şeyi "
+"yapan argümansız bir --rebase-merges kullanın."
+
#, c-format
msgid ""
"%s\n"
@@ -9895,6 +10223,9 @@ msgstr "boÅŸ baÅŸlayan iÅŸlemeleri tut"
msgid "move commits that begin with squash!/fixup! under -i"
msgstr "-i altındaki squash!/fixup! ile başlayan işlemeleri taşı"
+msgid "update branches that point to commits that are being rebased"
+msgstr "yeniden temellendirilen işlemelere işaret eden dalları güncelle"
+
msgid "add exec lines after each commit of the editable list"
msgstr "düzenlenebilir listenin her işlemesinden sonra exec satırları ekle"
@@ -9963,7 +10294,7 @@ msgid ""
"mark them as resolved using git add"
msgstr ""
"Önce tüm birleştirme çakışmalarını düzenlemeli ve onları\n"
-"git add kullanarak tamamlandı olarak imlemelisiniz."
+"git add kullanarak tamamlandı olarak imlemelisiniz"
msgid "could not discard worktree changes"
msgstr "çalışma ağacı değişiklikleri atılamadı"
@@ -9995,15 +10326,19 @@ msgstr ""
msgid "switch `C' expects a numerical value"
msgstr "'C' anahtarı sayısal bir değer bekliyor"
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "Bilinmeyen kip: %s"
-
-msgid "--strategy requires --merge or --interactive"
-msgstr "--strategy, --merge veya --interactive gerektiriyor"
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges. Consider adding --"
+"no-rebase-merges"
+msgstr ""
+"seçenekleri uygula, rebase.rebaseMerges ile uyumlu değil. --no-rebase-merges "
+"eklemeyi düşünün"
-msgid "apply options and merge options cannot be used together"
-msgstr "uygulama seçenekleri ve birleştirme seçenekleri birlikte kullanılamaz"
+msgid ""
+"apply options are incompatible with rebase.updateRefs. Consider adding --no-"
+"update-refs"
+msgstr ""
+"uygulama seçenekleri, rebase.updateRefs ile uyumlu değil. --no-update-refs "
+"eklemeyi düşünün"
#, c-format
msgid "Unknown rebase backend: %s"
@@ -10027,8 +10362,8 @@ msgstr "böyle bir dal/işleme yok: '%s'"
msgid "No such ref: %s"
msgstr "Böyle bir başvuru yok: %s"
-msgid "Could not resolve HEAD to a revision"
-msgstr "HEAD bir revizyona çözülemedi"
+msgid "Could not resolve HEAD to a commit"
+msgstr "HEAD, bir işlemeye çözülemedi"
#, c-format
msgid "'%s': need exactly one merge base with branch"
@@ -10042,9 +10377,6 @@ msgstr "'%s': tam olarak bir birleÅŸtirme temeli gerekiyor"
msgid "Does not point to a valid commit '%s'"
msgstr "'%s' geçerli bir işlemeye işaret etmiyor"
-msgid "Please commit or stash them."
-msgstr "Lütfen onları işleyin veya zulalayın."
-
msgid "HEAD is up to date."
msgstr "HEAD güncel."
@@ -10292,7 +10624,7 @@ msgid ""
"\t use --mirror=fetch or --mirror=push instead"
msgstr ""
"--mirror tehlikeli ve artık kullanılmamalı; lütfen\n"
-"\t yerine --mirror=fetch veya --mirror=push kullanın."
+"\t yerine --mirror=fetch veya --mirror=push kullanın"
#, c-format
msgid "unknown mirror argument: %s"
@@ -10301,11 +10633,12 @@ msgstr "bilinmeyen yansı argümanı: %s"
msgid "fetch the remote branches"
msgstr "uzak konum dallarını getir"
-msgid "import all tags and associated objects when fetching"
-msgstr "getirirken tüm etiketleri ve ilişkili nesneleri içe aktar"
-
-msgid "or do not fetch any tag at all (--no-tags)"
-msgstr "veya hiçbir etiketi getirme (--no-tags)"
+msgid ""
+"import all tags and associated objects when fetching\n"
+"or do not fetch any tag at all (--no-tags)"
+msgstr ""
+"getirirken tüm etiketleri ve ilişkili nesneleri\n"
+"içe aktar veya etiketleri hiç içe aktarma (--no-tags)"
msgid "branch(es) to track"
msgstr "izlenecek dal(lar)"
@@ -10339,7 +10672,7 @@ msgstr "birden çok %s"
#, c-format
msgid "unhandled branch.%s.rebase=%s; assuming 'true'"
-msgstr "ilgilenilmemiş branch.%s.rebase=%s, 'true' olduğu var sayılıyor"
+msgstr "ele alınmamış branch.%s.rebase=%s, 'true' olduğu var sayılıyor"
#, c-format
msgid "Could not get fetch map for refspec %s"
@@ -10367,7 +10700,7 @@ msgid ""
msgstr ""
"Şuradaki %s yapılandırması remote.pushDefault:\n"
"\t%s:%d\n"
-"artık var olmayan '%s' uzak konumunu adlandırıyor."
+"artık var olmayan '%s' uzak konumunu adlandırıyor"
#, c-format
msgid "No such remote: '%s'"
@@ -10405,10 +10738,10 @@ msgid_plural ""
"Note: Some branches outside the refs/remotes/ hierarchy were not removed;\n"
"to delete them, use:"
msgstr[0] ""
-"Not: refs/remotes hiyerarşisi dışındaki bir dal kaldırılmadı;\n"
+"Not: refs/remotes/ hiyerarşisi dışındaki bir dal kaldırılmadı;\n"
"onu silmek için şunu kullanın:"
msgstr[1] ""
-"Not: refs/remotes hiyerarşisi dışındaki bazı dallar kaldırılmadı;\n"
+"Not: refs/remotes/ hiyerarşisi dışındaki bazı dallar kaldırılmadı;\n"
"onları silmek için şunu kullanın:"
#, c-format
@@ -10422,6 +10755,9 @@ msgstr " yeni (bir sonraki getirme uzak konumlarda depolayacak/%s"
msgid " tracked"
msgstr " izlendi"
+msgid " skipped"
+msgstr " atlandı"
+
msgid " stale (use 'git remote prune' to remove)"
msgstr " eskimiş (kaldırmak için 'git remote prune' kullanın)"
@@ -10687,6 +11023,14 @@ msgstr "geçici dosya '%s', yazma için açılamadı"
msgid "could not close refs snapshot tempfile"
msgstr "başvurular anlık görüntü geçici dosyası kapatılamadı"
+#, c-format
+msgid "could not remove stale bitmap: %s"
+msgstr "eskimiş biteşlem kaldırılamadı: %s"
+
+#, c-format
+msgid "pack prefix %s does not begin with objdir %s"
+msgstr "paket öneki %s, nesne dizini %s ile başlamıyor"
+
msgid "pack everything in a single pack"
msgstr "her şeyi tek bir pakete sığdır"
@@ -10699,8 +11043,8 @@ msgstr "-a ile aynı, ulaşılamayan süprüntü nesneleri ayrı paketle"
msgid "approxidate"
msgstr "yaklaşık tarih"
-msgid "with -C, expire objects older than this"
-msgstr "-C ile, bundan daha eski nesneleri yürürlükten kaldır"
+msgid "with --cruft, expire objects older than this"
+msgstr "--cruft ile bundan daha eski nesneleri yürürlükten kaldır"
msgid "remove redundant packs, and run git-prune-packed"
msgstr "gereksiz paketleri kaldır ve 'git-prune-packed' çalıştır"
@@ -10759,19 +11103,29 @@ msgstr "<N> faktörlü bir geometrik ilerleme bul"
msgid "write a multi-pack index of the resulting packs"
msgstr "ortaya çıkan paketlerin bir çoklu paket indeksini yaz"
+msgid "pack prefix to store a pack containing pruned objects"
+msgstr "budanan nesneler içeren paketi depolamak için paket öneki"
+
+msgid "pack prefix to store a pack containing filtered out objects"
+msgstr "süzülen nesneler içeren paketi depolamak için paket öneki"
+
msgid "cannot delete packs in a precious-objects repo"
msgstr "bir precious-objects deposundaki paketler silinemiyor"
+#, c-format
+msgid "option '%s' can only be used along with '%s'"
+msgstr "'%s' seçeneği, yalnızca '%s' ile birlikte kullanılabilir"
+
msgid "Nothing new to pack."
msgstr "Paketlenecek yeni bir ÅŸey yok."
#, c-format
-msgid "pack prefix %s does not begin with objdir %s"
-msgstr "paket öneki %s, nesne dizini %s ile başlamıyor"
+msgid "renaming pack to '%s' failed"
+msgstr "paketi '%s' olarak yeniden adlandırma başarısız"
#, c-format
-msgid "missing required file: %s"
-msgstr "gereken dosya eksik: %s"
+msgid "pack-objects did not write a '%s' file for pack %s-%s"
+msgstr "pack-objects, şu paket için bir '%s' dosyası yazmadı: %s-%s"
#, c-format
msgid "could not unlink: %s"
@@ -10814,7 +11168,7 @@ msgstr "'%s' geçerli bir başvuru adı değil"
#, c-format
msgid "replace ref '%s' already exists"
-msgstr "değiştirme başvurusu '%s' halihazırda mevcut"
+msgstr "değiştirme başvurusu '%s' halihazırda var"
#, c-format
msgid ""
@@ -10927,10 +11281,10 @@ msgid "change a commit's parents"
msgstr "bir işlemenin üst ögelerini değiştir"
msgid "convert existing graft file"
-msgstr "mevcut aşı dosyasını dönüştür"
+msgstr "var olan aşı dosyasını dönüştür"
msgid "replace the ref if it exists"
-msgstr "baÅŸvuru mevcutsa onu deÄŸiÅŸtir"
+msgstr "baÅŸvuru varsa onu deÄŸiÅŸtir"
msgid "do not pretty-print contents for --edit"
msgstr "--edit içeriğini hoş biçimde gösterme"
@@ -10965,8 +11319,80 @@ msgstr "--convert-graft-file argüman almaz"
msgid "only one pattern can be given with -l"
msgstr "-l ile yalnızca bir dizgi verilebilir"
-msgid "git rerere [clear | forget <path>... | status | remaining | diff | gc]"
-msgstr "git rerere [clear | forget <yol>... | status | remaining | diff | gc]"
+msgid "need some commits to replay"
+msgstr "yeniden oynatmak için birkaç işleme gerekli"
+
+msgid "--onto and --advance are incompatible"
+msgstr "--onto ve --advance birbiriyle uyumsuz"
+
+msgid "all positive revisions given must be references"
+msgstr "verilen tüm pozitif revizyonlar, başvuru olmalı"
+
+msgid "argument to --advance must be a reference"
+msgstr "--advance'a olan argüman bir başvuru olmalı"
+
+msgid ""
+"cannot advance target with multiple sources because ordering would be ill-"
+"defined"
+msgstr ""
+"birden çok kaynaklı hedef ilerletilemiyor; çünkü sıralama hatalı tanımlanmış "
+"olurdu"
+
+msgid ""
+"cannot implicitly determine whether this is an --advance or --onto operation"
+msgstr ""
+"bunun --advance veya --onto işlemi olup olmadığı örtük olarak algılanamıyor"
+
+msgid ""
+"cannot advance target with multiple source branches because ordering would "
+"be ill-defined"
+msgstr ""
+"birden çok kaynak dallı hedef ilerletilemiyor; çünkü sıralama hatalı "
+"tanımlanmış olurdu"
+
+msgid "cannot implicitly determine correct base for --onto"
+msgstr "--onto için olan doğru temel örtük olarak algılanamıyor"
+
+msgid ""
+"(EXPERIMENTAL!) git replay ([--contained] --onto <newbase> | --advance "
+"<branch>) <revision-range>..."
+msgstr ""
+"(DENEYSEL!) git replay ([--contained] --onto <yeni-temel> | --advance <dal>) "
+"<revizyon-erimi>..."
+
+msgid "make replay advance given branch"
+msgstr "verilen dalı önceden yeniden oynat"
+
+msgid "replay onto given commit"
+msgstr "verilen iÅŸlemeye yeniden oynat"
+
+msgid "advance all branches contained in revision-range"
+msgstr "revizyon eriminde içerilen tüm dalları ilerlet"
+
+msgid "option --onto or --advance is mandatory"
+msgstr "--onto veya --advance seçeneğinin kullanımı zorunlu"
+
+#, c-format
+msgid ""
+"some rev walking options will be overridden as '%s' bit in 'struct rev_info' "
+"will be forced"
+msgstr ""
+"'struct rev_info' içindeki '%s' biti zorlanacağından kimi revizyon yürütme "
+"seçenekleri geçersiz kılınacak"
+
+msgid "error preparing revisions"
+msgstr "revizyonlar hazırlanırken hata"
+
+msgid "replaying down to root commit is not supported yet!"
+msgstr "kök işlemeye kadar yeniden oynatma henüz desteklenmiyor!"
+
+msgid "replaying merge commits is not supported yet!"
+msgstr "birleştirme işlemelerini yeniden oynatma henüz desteklenmiyor!"
+
+msgid ""
+"git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]"
+msgstr ""
+"git rerere [clear | forget <yol-blrtç>... | diff | status | remaining | gc]"
msgid "register clean resolutions in index"
msgstr "indeksteki temiz çözümlerin kaydını yap"
@@ -11093,6 +11519,10 @@ msgstr "Yeni indeks dosyası yazılamadı."
msgid "unable to get disk usage of %s"
msgstr "%s ögesinin disk kullanımı alınamıyor"
+#, c-format
+msgid "invalid value for '%s': '%s', the only allowed format is '%s'"
+msgstr "'%s' için geçersiz değer: '%s', tek izin verilen biçim '%s'"
+
msgid "rev-list does not support display of notes"
msgstr "rev-list not görüntülemesini desteklemiyor"
@@ -11118,6 +11548,9 @@ msgstr "zamansız girdi sonu"
msgid "no usage string given before the `--' separator"
msgstr "'--' ayırıcısı öncesinde bir kullanım dizisi verilmedi"
+msgid "missing opt-spec before option flags"
+msgstr "seçenek bayraklarından önce eksik opt-spec"
+
msgid "Needed a single revision"
msgstr "Tek bir revizyon gerekiyordu"
@@ -11129,8 +11562,8 @@ msgid ""
"Run \"git rev-parse --parseopt -h\" for more information on the first usage."
msgstr ""
"git rev-parse --parseopt [<seçenekler>] -- [<argümanlar>...]\n"
-"\tor: git rev-parse --sq-quote [<argümanlar>...]\n"
-"\tor: git rev-parse [<seçenekler>] [<argümanlar>...]\n"
+" veya: git rev-parse --sq-quote [<argümanlar>...]\n"
+" veya: git rev-parse [<seçenekler>] [<argümanlar>...]\n"
"\n"
"İlki hakkında ek bilgi için \"git rev-parse --parseopt -h\" çalıştırın."
@@ -11167,21 +11600,32 @@ msgstr "--abbrev-ref için bilinmeyen kip: %s"
msgid "this operation must be run in a work tree"
msgstr "bu işlem bir çalışma ağacı içinde çalıştırılmalı"
+msgid "Could not read the index"
+msgstr "İndeks okunamadı"
+
#, c-format
msgid "unknown mode for --show-object-format: %s"
msgstr "--show-object-format için bilinmeyen kip: %s"
-msgid "git revert [<options>] <commit-ish>..."
-msgstr "git revert [<seçenekler>] <işlememsi>..."
+msgid ""
+"git revert [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] "
+"<commit>..."
+msgstr ""
+"git revert [--[no-]edit] [-n] [-m <üst-öge-numarası>] [-s] [-S[<anahtar-"
+"kimliÄŸi>]] <iÅŸleme>..."
-msgid "git revert <subcommand>"
-msgstr "git revert <altkomut>"
+msgid "git revert (--continue | --skip | --abort | --quit)"
+msgstr "git revert (--continue | --skip | --abort | --quit)"
-msgid "git cherry-pick [<options>] <commit-ish>..."
-msgstr "git cherry-pick [<seçenekler>] <işlememsi>..."
+msgid ""
+"git cherry-pick [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff]\n"
+" [-S[<keyid>]] <commit>..."
+msgstr ""
+"git cherry-pick [--edit] [-n] [-m <üst-öge-numarası>] [-s] [-x] [--ff]\n"
+" [-S[<anahtar-kimliÄŸi>]] <iÅŸleme>..."
-msgid "git cherry-pick <subcommand>"
-msgstr "git cherry-pick <altkomut>"
+msgid "git cherry-pick (--continue | --skip | --abort | --quit)"
+msgstr "git cherry-pick (--continue | --skip | --abort | --quit)"
#, c-format
msgid "option `%s' expects a number greater than zero"
@@ -11242,8 +11686,14 @@ msgstr "geri al başarısız"
msgid "cherry-pick failed"
msgstr "seç-al başarısız"
-msgid "git rm [<options>] [--] <file>..."
-msgstr "git rm [<seçenekler>] [--] <dosya>..."
+msgid ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<dosya> [--pathspec-file-nul]]\n"
+" [--] [<yol-blrtç>...]"
msgid ""
"the following file has staged content different from both the\n"
@@ -11253,10 +11703,10 @@ msgid_plural ""
"file and the HEAD:"
msgstr[0] ""
"Aşağıdaki dosyanın hem HEAD'den hem de dosyadan farklı hazırlanmış\n"
-"içeriği mevcut:"
+"içeriği var:"
msgstr[1] ""
"Aşağıdaki dosyaların hem HEAD'den hem de dosyadan farklı hazırlanmış\n"
-"içeriği mevcut:"
+"içeriği var:"
msgid ""
"\n"
@@ -11267,8 +11717,8 @@ msgstr ""
msgid "the following file has changes staged in the index:"
msgid_plural "the following files have changes staged in the index:"
-msgstr[0] "Aşağıdaki dosyanın indekste hazırlanmış değişiklikleri mevcut:"
-msgstr[1] "Aşağıdaki dosyaların indekste hazırlanmış değişiklikleri mevcut:"
+msgstr[0] "Aşağıdaki dosyanın indekste hazırlanmış değişiklikleri var:"
+msgstr[1] "Aşağıdaki dosyaların indekste hazırlanmış değişiklikleri var:"
msgid ""
"\n"
@@ -11317,16 +11767,21 @@ msgid ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
" [<host>:]<directory> (--all | <ref>...)"
msgstr ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
-" [--receive-pack=<git-receive-pack>]\n"
+" [--receive-pack=<git-paket-al>]\n"
" [--verbose] [--thin] [--atomic]\n"
-" [<makine>:]<dizin> (--all | <baÅŸvurular>...)"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
+" [<makine>:]<dizin> (--all | <baÅŸvuru>...)"
msgid "remote name"
msgstr "uzak konum adı"
+msgid "push all refs"
+msgstr "tüm başvuruları it"
+
msgid "use stateless RPC protocol"
msgstr "durumsuz RPC protokolünü kullan"
@@ -11345,8 +11800,9 @@ msgstr "git log --pretty=short | git shortlog [<seçenekler>]"
msgid "using multiple --group options with stdin is not supported"
msgstr "stdin ile çoklu --group seçenekleri kullanımı desteklenmiyor"
-msgid "using --group=trailer with stdin is not supported"
-msgstr "stdin ile --group=trailer kullanımı desteklenmiyor"
+#, c-format
+msgid "using %s with stdin is not supported"
+msgstr "stdin ile %s kullanma desteklenmiyor"
#, c-format
msgid "unknown group type: %s"
@@ -11377,18 +11833,20 @@ msgid "group by field"
msgstr "alan ile grupla"
msgid "too many arguments given outside repository"
-msgstr "depo dışında çok fazla argüman verildi"
+msgstr "depo dışında pek fazla argüman verildi"
msgid ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
" [--current] [--color[=<when>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<rev> | <glob>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<rev> | <glob>)...]"
msgstr ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
-" [--current] [--color[=<nezaman>] | --no-color] [--sparse]\n"
+" [--current] [--color[=<ne-zaman>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<bÅŸvr> | <glob>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<rev> | <glob>)...]"
msgid "git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]"
msgstr "git show-branch (-g | --reflog)[=<n>[,<temel>]] [--list] [<baÅŸvuru>]"
@@ -11488,21 +11946,44 @@ msgid "Unknown hash algorithm"
msgstr "bilinmeyen sağlama algoritması '%s'"
msgid ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...]"
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<pattern>...]"
msgstr ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<dizgi>...]"
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<dizgi>...]"
+
+msgid ""
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<ref>...]"
+msgstr ""
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<baÅŸvuru>...]"
msgid "git show-ref --exclude-existing[=<pattern>]"
msgstr "git show-ref --exclude-existing[=<dizgi>]"
+msgid "git show-ref --exists <ref>"
+msgstr "git show-ref --exists <baÅŸvuru>"
+
+msgid "reference does not exist"
+msgstr "baÅŸvuru yok"
+
+msgid "failed to look up reference"
+msgstr "başvuru bakılamadı"
+
msgid "only show tags (can be combined with heads)"
msgstr "yalnızca etiketleri göster (dal uçlarıyla birlikte kullanılabilir)"
msgid "only show heads (can be combined with tags)"
msgstr "yalnızca dal uçlarını göster (etiketlerle birlikte kullanılabilir)"
+msgid "check for reference existence without resolving"
+msgstr "çözmeden başvuru varlığını denetle"
+
msgid "stricter reference checking, requires exact ref path"
msgstr "daha sıkı başvuru denetlemesi; kesin başvuru yolu gerektirir"
@@ -11521,8 +12002,12 @@ msgstr "sonuçları stdout'a yazdırma (--verify ile birlikte kullanışlı)"
msgid "show refs from stdin that aren't in local repository"
msgstr "stdin'den yerel bir depoda olmayan başvuruları göster"
-msgid "git sparse-checkout (init|list|set|add|reapply|disable) <options>"
-msgstr "git sparse-checkout (init|list|set|add|reapply|disable) <seçenekler>"
+msgid ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
+msgstr ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<seçenekler>]"
msgid "this worktree is not sparse"
msgstr "bu çalışma ağacı aralıklı değil"
@@ -11575,10 +12060,10 @@ msgid "unable to unquote C-style string '%s'"
msgstr "C biçemli '%s' dizisinin tırnakları kaldırılamıyor"
msgid "unable to load existing sparse-checkout patterns"
-msgstr "mevcut aralıklı çıkış dizgileri yüklenemiyor"
+msgstr "var olan aralıklı çıkış dizgileri yüklenemiyor"
msgid "existing sparse-checkout patterns do not use cone mode"
-msgstr "mevcut aralıklı çıkış dizgileri koni kipini kullanmıyor"
+msgstr "var olan aralıklı çıkış dizgileri koni kipini kullanmıyor"
msgid "please run from the toplevel directory in non-cone mode"
msgstr "koni dışı kipte en üst düzey dizinden çalıştırın"
@@ -11644,67 +12129,73 @@ msgstr ""
msgid "error while refreshing working directory"
msgstr "çalışma dizini yenilenirken hata"
-msgid "git stash list [<options>]"
-msgstr "git stash list [<seçenekler>]"
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <dosya>]"
-msgid "git stash show [<options>] [<stash>]"
-msgstr "git stash show [<seçenekler>] [<zula>]"
+msgid "terminate input and output files by a NUL character"
+msgstr "girdi ve çıktı dosyalarını bir NUL karakteri ile sonlandır"
-msgid "git stash drop [-q|--quiet] [<stash>]"
-msgstr "git stash drop [-q|--quiet] [<zula>]"
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
+"--rules-file ile kullanıldığında dizgileri koni kipi dizgileri olarak yorumla"
-msgid "git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash ( pop | apply ) [--index] [-q|--quiet] [<zula>]"
+msgid "use patterns in <file> instead of the current ones."
+msgstr "geçerli dizgiler yerine <dosya> içindekileri kullan."
-msgid "git stash branch <branchname> [<stash>]"
-msgstr "git stash branch <dal-adı> [<zula>]"
+msgid "git stash list [<log-options>]"
+msgstr "git stash list [<günlük-seçenekleri>]"
msgid ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
-" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
-" [--] [<pathspec>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<diff-"
+"options>] [<stash>]"
msgstr ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <ileti>]\n"
-" [--pathspec-from-file=<dosya> [--pathspec-file-nul]]\n"
-" [--] [<yol-blrtç>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<diff-"
+"seçenekleri>] [<zula>]"
-msgid ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
-msgstr ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<ileti>]"
+msgid "git stash drop [-q | --quiet] [<stash>]"
+msgstr "git stash drop [-q | --quiet] [<zula>]"
+
+msgid "git stash pop [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash pop [--index] [-q | --quiet] [<zula>]"
-msgid "git stash pop [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash pop [--index] [-q|--quiet] [<zula>]"
+msgid "git stash apply [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash apply [--index] [-q | --quiet] [<zula>]"
-msgid "git stash apply [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash apply [--index] [-q|--quiet] [<zula>]"
+msgid "git stash branch <branchname> [<stash>]"
+msgstr "git stash branch <dal-adı> [<zula>]"
-msgid "git stash store [-m|--message <message>] [-q|--quiet] <commit>"
-msgstr "git stash store [-m|--message <ileti>] [-q|--quiet] <iÅŸleme>"
+msgid "git stash store [(-m | --message) <message>] [-q | --quiet] <commit>"
+msgstr "git stash store [(-m | --message) <ileti>] [-q | --quiet] <iÅŸleme>"
msgid ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<message>]\n"
+" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
" [--] [<pathspec>...]]"
msgstr ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <ileti>]\n"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q\n"
+" | --quiet] [-u | --include-untracked] [-a | --all] [(-m | --"
+"message)\n"
+" <ileti>] [--pathspec-from-file=<dosya> [--pathspec-file-nul]]\n"
" [--] [<yol-blrtç>...]]"
msgid ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<message>]"
msgstr ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<ileti>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"|\n"
+" --quiet] [-u | --include-untracked] [-a | --all] [<ileti>]"
+
+msgid "git stash create [<message>]"
+msgstr "git stash create [<ileti>]"
#, c-format
msgid "'%s' is not a stash-like commit"
@@ -11879,6 +12370,10 @@ msgid "Expecting a full ref name, got %s"
msgstr "Tam bir başvuru adı bekleniyordu, %s alındı"
#, c-format
+msgid "could not get a repository handle for submodule '%s'"
+msgstr "'%s' altmodülü için depo tutacağı alınamadı"
+
+#, c-format
msgid ""
"could not look up configuration '%s'. Assuming this repository is its own "
"authoritative upstream."
@@ -11886,12 +12381,6 @@ msgstr ""
"'%s' yapılandırması aranamadı. Bu deponun kendi yetkili üstkaynağı olduğu "
"varsayılıyor."
-msgid "alternative anchor for relative paths"
-msgstr "göreceli yollar için alternatif tutturucu"
-
-msgid "git submodule--helper list [--prefix=<path>] [<path>...]"
-msgstr "git submodule--helper list [--prefix=<yol>] [<yol>...]"
-
#, c-format
msgid "No url found for submodule path '%s' in .gitmodules"
msgstr ".gitmodules içinde '%s' altmodül yolu için url bulunamadı"
@@ -11923,8 +12412,8 @@ msgstr "her bir altmodül komutu girişinin çıktısını gizle"
msgid "recurse into nested submodules"
msgstr "iç içe geçmiş altmodüle özyinele"
-msgid "git submodule--helper foreach [--quiet] [--recursive] [--] <command>"
-msgstr "git submodule--helper foreach [--quiet] [--recursive] [--] <komut>"
+msgid "git submodule foreach [--quiet] [--recursive] [--] <command>"
+msgstr "git submodule foreach [--quiet] [--recursive] [--] <komut>"
#, c-format
msgid "Failed to register url for submodule path '%s'"
@@ -11945,8 +12434,8 @@ msgstr "'%s' altmodülü yolu için güncelleme kipi kaydı yapılamadı"
msgid "suppress output for initializing a submodule"
msgstr "bir altmodül ilklendirmesi çıktısını gizle"
-msgid "git submodule--helper init [<options>] [<path>]"
-msgstr "git submodule--helper init [<seçenekler>] [<yol>]"
+msgid "git submodule init [<options>] [<path>]"
+msgstr "git submodule init [<seçenekler>] [<yol>]"
#, c-format
msgid "no submodule mapping found in .gitmodules for path '%s'"
@@ -11973,9 +12462,6 @@ msgstr ""
msgid "git submodule status [--quiet] [--cached] [--recursive] [<path>...]"
msgstr "git submodule status [--quiet] [--cached] [--recursive] [<yol>...]"
-msgid "git submodule--helper name <path>"
-msgstr "git submodule--helper name <yol>"
-
#, c-format
msgid "* %s %s(blob)->%s(submodule)"
msgstr "* %s %s(ikili nesne)->%s(altmodül)"
@@ -12008,8 +12494,8 @@ msgstr "'ignore_config' değeri 'all' olan altmodülleri atla"
msgid "limit the summary size"
msgstr "özet boyutunu sınırla"
-msgid "git submodule--helper summary [<options>] [<commit>] [--] [<path>]"
-msgstr "git submodule--helper summary [<seçenekler>] [<işleme>] [--] [<yol>]"
+msgid "git submodule summary [<options>] [<commit>] [--] [<path>]"
+msgstr "git submodule summary [<seçenekler>] [<işleme>] [--] [<yol>]"
msgid "could not fetch a revision for HEAD"
msgstr "HEAD için bir revizyon getirilemedi"
@@ -12023,18 +12509,14 @@ msgid "failed to register url for submodule path '%s'"
msgstr "'%s' altmodülü yolu için url kaydı yapılamadı"
#, c-format
-msgid "failed to get the default remote for submodule '%s'"
-msgstr "'%s' altmodülü için öntanımlı uzak konum alınamadı"
-
-#, c-format
msgid "failed to update remote for submodule '%s'"
msgstr "'%s' altmodülü için uzak konum güncellenemedi"
msgid "suppress output of synchronizing submodule url"
msgstr "altmodül url'si eşitleme çıktısını gizle"
-msgid "git submodule--helper sync [--quiet] [--recursive] [<path>]"
-msgstr "git submodule--helper sync [--quiet] [--recursive] [<yol>]"
+msgid "git submodule sync [--quiet] [--recursive] [<path>]"
+msgstr "git submodule sync [--quiet] [--recursive] [<yol>]"
#, c-format
msgid ""
@@ -12090,12 +12572,16 @@ msgid ""
"submodule.alternateErrorStrategy to 'info' or, equivalently, clone with\n"
"'--reference-if-able' instead of '--reference'."
msgstr ""
-"Bir süperprojenin alternatifinden hesaplanan bir alternatif geçersiz.\n"
+"Bir üst projenin alternatifinden hesaplanan bir alternatif geçersiz.\n"
"Böyle bir durumda Git'in alternatifsiz klonlamasına izin vermek için\n"
"submodule.alternateErrorStrategy ayarını 'info'ya ayarlayın veya\n"
"--reference yerine --reference-if-able kullanarak klonlayın."
#, c-format
+msgid "could not get a repository handle for gitdir '%s'"
+msgstr "'%s' git dizini için bir depo tutacı alınamadı"
+
+#, c-format
msgid "submodule '%s' cannot add alternate: %s"
msgstr "'%s' altmodülü alternatif ekleyemiyor: %s"
@@ -12124,6 +12610,9 @@ msgstr "dizin boÅŸ deÄŸil: '%s'"
msgid "could not get submodule directory for '%s'"
msgstr "'%s' için altmodül dizini alınamadı"
+msgid "alternative anchor for relative paths"
+msgstr "göreceli yollar için alternatif tutturucu"
+
msgid "where the new submodule will be cloned to"
msgstr "yeni altmodülün nereye klonlanacağı"
@@ -12152,10 +12641,6 @@ msgstr ""
"belirteci>] --url <url> --path <yol>"
#, c-format
-msgid "Invalid update mode '%s' for submodule path '%s'"
-msgstr "Geçersiz güncelleme kipi '%s', '%s' altmodül yolu için"
-
-#, c-format
msgid "Invalid update mode '%s' configured for submodule path '%s'"
msgstr "Geçersiz güncelleme kipi '%s', '%s' altmodül yolu için yapılandırılmış"
@@ -12175,8 +12660,12 @@ msgid "Skipping submodule '%s'"
msgstr "'%s' altmodülü atlanıyor"
#, c-format
+msgid "cannot clone submodule '%s' without a URL"
+msgstr "bir URL olmadan '%s' altmodülü içe aktarılamıyor"
+
+#, c-format
msgid "Failed to clone '%s'. Retry scheduled"
-msgstr "'%s' klonlanamadı. Yeniden deneme zamanlandı."
+msgstr "'%s' klonlanamadı. Yeniden deneme zamanlandı"
#, c-format
msgid "Failed to clone '%s' a second time, aborting"
@@ -12196,7 +12685,7 @@ msgstr "Şu altmodül yolunda '%s' birleştirilemedi: '%s'"
#, c-format
msgid "Execution of '%s %s' failed in submodule path '%s'"
-msgstr "Şu altmodül yolunda '%s %s' çalıştırılamadı: '%s'"
+msgstr "Şu altmodül yolunda '%s %s' yürütülemedi: '%s'"
#, c-format
msgid "Submodule path '%s': checked out '%s'\n"
@@ -12229,16 +12718,16 @@ msgstr ""
"doğrudan getirilmesi başarısız oldu."
#, c-format
+msgid "could not initialize submodule at path '%s'"
+msgstr "'%s' konumundaki altmodül ilklendirilemedi"
+
+#, c-format
msgid ""
"Submodule (%s) branch configured to inherit branch from superproject, but "
"the superproject is not on any branch"
msgstr ""
-"Altmodül (%s) dalı süperproje dalından devralmak üzere yapılandırıldı; ancak "
-"süperproje herhangi bir dalda değil"
-
-#, c-format
-msgid "could not get a repository handle for submodule '%s'"
-msgstr "'%s' altmodülü için depo tutacağı alınamadı"
+"Altmodül (%s) dalı, üst projenin dalından devralmak üzere yapılandırıldı; "
+"ancak üst proje, herhangi bir dalda değil"
#, c-format
msgid "Unable to find current revision in submodule path '%s'"
@@ -12271,14 +12760,14 @@ msgstr "altmodülleri özyineli basamaklandır"
msgid "don't fetch new objects from the remote site"
msgstr "yeni nesneleri uzak konumdan getirme"
-msgid "path into the working tree"
-msgstr "çalışma ağacına giden yol"
+msgid "use the 'checkout' update strategy (default)"
+msgstr "'checkout' güncelleme stratejisini kullan (öntanımlı)"
-msgid "path into the working tree, across nested submodule boundaries"
-msgstr "iç içe geçmiş altmodül sınırları üzerinden çalışma ağacına giden yol"
+msgid "use the 'merge' update strategy"
+msgstr "'merge' güncelleme stratejisini kullan"
-msgid "rebase, merge, checkout or none"
-msgstr "rebase, merge, checkout veya none"
+msgid "use the 'rebase' update strategy"
+msgstr "'rebase' güncelleme stratejisini kullan"
msgid "create a shallow clone truncated to the specified number of revisions"
msgstr "belirli bir revizyon sayısına kısaltılmış sığ klon oluştur"
@@ -12292,6 +12781,9 @@ msgstr "ilk klonun sığlık üzerine olan tavsiyeyi izleyip izlemeyeceği"
msgid "don't print cloning progress"
msgstr "klonlama işlemini yazdırma"
+msgid "disallow cloning into non-empty directory, implies --init"
+msgstr "boÅŸ olmayan dizine klonlamaya izin verme, --init ima eder"
+
msgid ""
"git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] "
"[-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-"
@@ -12303,35 +12795,17 @@ msgstr ""
"shallow] [--reference <depo>] [--recursive] [--[no-]single-branch] [--] "
"[<yol>...]"
-msgid "bad value for update parameter"
-msgstr "güncelleme parametresi için hatalı değer"
-
-msgid "recurse into submodules"
-msgstr "altmodüllere özyinele"
-
-msgid "git submodule--helper absorb-git-dirs [<options>] [<path>...]"
-msgstr "git submodule--helper absorb-git-dirs [<seçenekler>] [<yol>...]"
-
-msgid "check if it is safe to write to the .gitmodules file"
-msgstr ".gitmodules dosyasına yazım güvenli mi değil mi denetle"
-
-msgid "unset the config in the .gitmodules file"
-msgstr ".gitmodules dosyasındaki yapılandırmayı kaldır"
-
-msgid "git submodule--helper config <name> [<value>]"
-msgstr "git submodule--helper config <ad> [<deÄŸer>]"
+msgid "Failed to resolve HEAD as a valid ref."
+msgstr "HEAD geçerli bir başvuru olarak çözülemedi."
-msgid "git submodule--helper config --unset <name>"
-msgstr "git submodule--helper config --unset <ad>"
-
-msgid "please make sure that the .gitmodules file is in the working tree"
-msgstr ".gitmodules dosyasının çalışma ağacında olduğundan lütfen emin ol"
+msgid "git submodule absorbgitdirs [<options>] [<path>...]"
+msgstr "git submodule absorbgitdirs [<seçenekler>] [<yol>...]"
msgid "suppress output for setting url of a submodule"
msgstr "bir altmodül url ayarlanması çıktısını gizle"
-msgid "git submodule--helper set-url [--quiet] <path> <newurl>"
-msgstr "git submodule--helper set-url [--quiet] <yol> <yeniurl>"
+msgid "git submodule set-url [--quiet] <path> <newurl>"
+msgstr "git submodule set-url [--quiet] <yol> <yeniurl>"
msgid "set the default tracking branch to master"
msgstr "öntanımlı izleme dalını master olarak ayarla"
@@ -12339,13 +12813,11 @@ msgstr "öntanımlı izleme dalını master olarak ayarla"
msgid "set the default tracking branch"
msgstr "öntanımlı izleme dalını ayarla"
-msgid "git submodule--helper set-branch [-q|--quiet] (-d|--default) <path>"
-msgstr "git submodule--helper set-branch [-q|--quiet] (-d|--default) <yol>"
+msgid "git submodule set-branch [-q|--quiet] (-d|--default) <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-d|--default) <yol>"
-msgid ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
-msgstr ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <dal> <yol>"
+msgid "git submodule set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-b|--branch) <dal> <yol>"
msgid "--branch or --default required"
msgstr "--branch veya --default gerekli"
@@ -12372,11 +12844,11 @@ msgstr "'%s' dalı oluşturuluyor"
#, c-format
msgid "Adding existing repo at '%s' to the index\n"
-msgstr "'%s' konumundaki mevcut repo indekse ekleniyor\n"
+msgstr "'%s' konumundaki var olan depo indekse ekleniyor\n"
#, c-format
msgid "'%s' already exists and is not a valid git repo"
-msgstr "'%s' halihazırda mevcut ve geçerli bir git deposu değil"
+msgstr "'%s' halihazırda var ve geçerli bir git deposu değil"
#, c-format
msgid "A git directory for '%s' is found locally with remote(s):\n"
@@ -12406,6 +12878,9 @@ msgstr "'%s' altmodülü için yerel git dizini yeniden etkinleştiriliyor\n"
msgid "unable to checkout submodule '%s'"
msgstr "'%s' altmodülü çıkış yapılamıyor"
+msgid "please make sure that the .gitmodules file is in the working tree"
+msgstr ".gitmodules dosyasının çalışma ağacında olduğundan lütfen emin ol"
+
#, c-format
msgid "Failed to add submodule '%s'"
msgstr "'%s' altmodülü eklenemedi"
@@ -12441,8 +12916,8 @@ msgid ""
msgstr ""
"altmodülün adını kendi yoluna öntanımlamak yerine verilen dizi olarak ayarlar"
-msgid "git submodule--helper add [<options>] [--] <repository> [<path>]"
-msgstr "git submodule--helper add [<seçenekler>] [--] <depo> [<yol>]"
+msgid "git submodule add [<options>] [--] <repository> [<path>]"
+msgstr "git submodule add [<seçenekler>] [--] <depo> [<yol>]"
msgid "Relative path can only be used from the toplevel of the working tree"
msgstr ""
@@ -12456,19 +12931,17 @@ msgstr "depo URL'si: '%s' mutlak olmalı veya ./|../ ile başlamalıdır"
msgid "'%s' is not a valid submodule name"
msgstr "'%s' geçerli bir altmodül adı değil"
-#, c-format
-msgid "%s doesn't support --super-prefix"
-msgstr "%s, --super-prefix desteklemiyor"
+msgid "git submodule--helper <command>"
+msgstr "git submodule--helper <komut>"
-#, c-format
-msgid "'%s' is not a valid submodule--helper subcommand"
-msgstr "'%s' geçerli bir submodule--helper altkomutu değil"
+msgid "git symbolic-ref [-m <reason>] <name> <ref>"
+msgstr "git symbolic-ref [-m <neden>] <ad> <baÅŸvuru>"
-msgid "git symbolic-ref [<options>] <name> [<ref>]"
-msgstr "git symbolic-ref [<seçenekler>] <ad> [<başvuru>]"
+msgid "git symbolic-ref [-q] [--short] [--no-recurse] <name>"
+msgstr "git symbolic-ref [-q] [--short] [--no-recurse] <ad>"
-msgid "git symbolic-ref -d [-q] <name>"
-msgstr "git symbolic-ref -d [-q] <ad>"
+msgid "git symbolic-ref --delete [-q] <name>"
+msgstr "git symbolic-ref --delete [-q] <ad>"
msgid "suppress error message for non-symbolic (detached) refs"
msgstr "sembolik olmayan (ayrık) başvurular için hata iletisini gizle"
@@ -12479,6 +12952,9 @@ msgstr "sembolik baÅŸvuruyu sil"
msgid "shorten ref output"
msgstr "başvuru çıktısını kısalt"
+msgid "recursively dereference (default)"
+msgstr "başvuruyu özyineli olarak kaldır (öntanımlı)"
+
msgid "reason"
msgstr "neden"
@@ -12486,24 +12962,26 @@ msgid "reason of the update"
msgstr "güncelleme nedeni"
msgid ""
-"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]\n"
-" <tagname> [<head>]"
+"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
+" <tagname> [<commit> | <object>]"
msgstr ""
-"git tag [-a | -s | -u <anahtar-kimliÄŸi>] [-f] [-m <ileti> | -F <dosya>]\n"
-" <etiket-adı> [<head>]"
+"git tag [-a | -s | -u <anahtar-kimliÄŸi>] [-f] [-m <ileti> | -F <dosya>] [-"
+"e]\n"
+" <etiket-adı> [<işleme> | <nesne>]"
msgid "git tag -d <tagname>..."
msgstr "git tag -d <etiket-adı>..."
msgid ""
-"git tag -l [-n[<num>]] [--contains <commit>] [--no-contains <commit>] [--"
-"points-at <object>]\n"
-" [--format=<format>] [--merged <commit>] [--no-merged <commit>] "
-"[<pattern>...]"
+"git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]\n"
+" [--points-at <object>] [--column[=<options>] | --no-column]\n"
+" [--create-reflog] [--sort=<key>] [--format=<format>]\n"
+" [--merged <commit>] [--no-merged <commit>] [<pattern>...]"
msgstr ""
-"git tag -l [-n[<sayı>]] [--contains <işleme>] [--no-contains <işleme>]\n"
-" [-- points-at <nesne>] [--format=<biçim>] [--merged <işleme>]\n"
-" [--no-merged <iÅŸleme>] [<dizgi>...]"
+"git tag [-n[<sayı>]] -l [--contains <işleme>] [--no-contains <işleme>]\n"
+" [--points-at <nesne>] [--column[=<seçenekler>] | --no-column]\n"
+" [--create-reflog] [--sort=<anahtar>] [--format=<biçim>]\n"
+" [--merged <iÅŸleme>] [--no-merged <iÅŸleme>] [<dizgi>...]"
msgid "git tag -v [--format=<format>] <tagname>..."
msgstr "git tag -v [--format=<biçim>] <etiket-adı>..."
@@ -12647,6 +13125,16 @@ msgstr "'%s' etiketi güncellendi (%s idi)\n"
msgid "pack exceeds maximum allowed size"
msgstr "paket izin verilen en büyük boyutu aşıyor"
+msgid "failed to write object in stream"
+msgstr "akışta nesne yazılamadı"
+
+#, c-format
+msgid "inflate returned (%d)"
+msgstr "şişirme programı (%d) döndürdü"
+
+msgid "invalid blob object from stream"
+msgstr "akıştan geçersiz ikili nesne"
+
msgid "Unpacking objects"
msgstr "Nesneler açılıyor"
@@ -12739,7 +13227,7 @@ msgid "add to index only; do not add content to object database"
msgstr "yalnızca indekse ekle; içeriğe nesne veritabanına ekleme"
msgid "remove named paths even if present in worktree"
-msgstr "çalışma ağacında mevcut olsa bile ad verilen yolları kaldır"
+msgstr "çalışma ağacında var olsa bile ad verilen yolları kaldır"
msgid "with --stdin: input lines are terminated by null bytes"
msgstr "--stdin ile: girdi satırları boş baytlarla sonlandırılır"
@@ -12768,6 +13256,9 @@ msgstr "(okunabilir veri için) kaydedilmiş çözülmeyen çakışmaları unut"
msgid "write index in this format"
msgstr "indeksi bu biçimle yaz"
+msgid "report on-disk index format version"
+msgstr "diskteki indeks biçimi sürümünü raporla"
+
msgid "enable or disable split index"
msgstr "bölünmüş indeksi etkinleştir veya devre dışı bırak"
@@ -12792,6 +13283,14 @@ msgstr "dosyaları dosya sistemi monitöründe geçerli olarak imle"
msgid "clear fsmonitor valid bit"
msgstr "dosya sistemi monitöründe geçerli kısmını temizle"
+#, c-format
+msgid "%d\n"
+msgstr "%d\n"
+
+#, c-format
+msgid "index-version: was %d, set to %d"
+msgstr "index-version: %d idi, %d olarak ayarlandı"
+
msgid ""
"core.splitIndex is set to false; remove or change it, if you really want to "
"enable split index"
@@ -12869,8 +13368,12 @@ msgstr "güncellemeleri stdin'den oku"
msgid "update the info files from scratch"
msgstr "bilgi dosyalarını en baştan güncelle"
-msgid "git upload-pack [<options>] <dir>"
-msgstr "git upload-pack [<seçenekler>] <dizin>"
+msgid ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <directory>"
+msgstr ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <dizin>"
msgid "quit after a single request/response exchange"
msgstr "tek bir istek/yanıt değiş tokuşundan sonra çık"
@@ -12884,8 +13387,8 @@ msgstr "eÄŸer <dizin> bir Git dizini deÄŸilse <dizin>/.git/ deneme"
msgid "interrupt transfer after <n> seconds of inactivity"
msgstr "aktarımı <n> saniye hareketsizlikten sonra kes"
-msgid "git verify-commit [-v | --verbose] <commit>..."
-msgstr "git verify-commit [-v | --verbose] <iÅŸleme>..."
+msgid "git verify-commit [-v | --verbose] [--raw] <commit>..."
+msgstr "git verify-commit [-v | --verbose] [--raw] <iÅŸleme>..."
msgid "print commit contents"
msgstr "işleme içeriğini yazdır"
@@ -12893,8 +13396,9 @@ msgstr "işleme içeriğini yazdır"
msgid "print raw gpg status output"
msgstr "ham gpg durum çıktısını yazdır"
-msgid "git verify-pack [-v | --verbose] [-s | --stat-only] <pack>..."
-msgstr "git verify-pack [-v | --verbose] [-s | --stat-only] <paket>..."
+msgid "git verify-pack [-v | --verbose] [-s | --stat-only] [--] <pack>.idx..."
+msgstr ""
+"git verify-pack [-v | --verbose] [-s | --stat-only] [--] <paket>.idx..."
msgid "verbose"
msgstr "ayrıntılı anlatım"
@@ -12902,35 +13406,70 @@ msgstr "ayrıntılı anlatım"
msgid "show statistics only"
msgstr "yalnızca istatistikleri göster"
-msgid "git verify-tag [-v | --verbose] [--format=<format>] <tag>..."
-msgstr "git verify-tag [-v | --verbose] [--format=<biçim>] <etiket>..."
+msgid "git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."
+msgstr "git verify-tag [-v | --verbose] [--format=<biçim>] [--raw] <etiket>..."
msgid "print tag contents"
msgstr "etiket içeriğini yazdır"
-msgid "git worktree add [<options>] <path> [<commit-ish>]"
-msgstr "git worktree add [<seçenekler>] <yol> [<işlememsi>]"
+msgid ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <string>]]\n"
+" [--orphan] [(-b | -B) <new-branch>] <path> [<commit-ish>]"
+msgstr ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <dizi>]]\n"
+" [--orphan] [(-b | -B) <yeni-dal>] <yol> [<iÅŸlememsi>]"
-msgid "git worktree list [<options>]"
-msgstr "git worktree list [<seçenekler>]"
+msgid "git worktree list [-v | --porcelain [-z]]"
+msgstr "git worktree list [-v | --porcelain [-z]]"
-msgid "git worktree lock [<options>] <path>"
-msgstr "git worktree lock [<seçenekler>] <yol>"
+msgid "git worktree lock [--reason <string>] <worktree>"
+msgstr "git worktree lock [--reason <dizi>] <çalışma-ağacı>"
msgid "git worktree move <worktree> <new-path>"
msgstr "git worktree move <ç-ağacı> <yeni-yol>"
-msgid "git worktree prune [<options>]"
-msgstr "git worktree prune [<seçenekler>]"
+msgid "git worktree prune [-n] [-v] [--expire <expire>]"
+msgstr "git worktree prune [-n] [-v] [--expire <süre-dolum>]"
-msgid "git worktree remove [<options>] <worktree>"
-msgstr "git worktree remove [<seçenekler>] <ç-ağacı>"
+msgid "git worktree remove [-f] <worktree>"
+msgstr "git worktree remove [-f] <çalışma-ağacı>"
msgid "git worktree repair [<path>...]"
msgstr "git worktree repair [<yol>...]"
-msgid "git worktree unlock <path>"
-msgstr "git worktree unlock <yol>"
+msgid "git worktree unlock <worktree>"
+msgstr "git worktree unlock <çalışma-ağacı>"
+
+msgid "No possible source branch, inferring '--orphan'"
+msgstr "Olası kaynak dal yok, '--orphan' anlamı çıkarılıyor"
+
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+msgstr ""
+"Bu depo için henüz doğmamış bir dal (işleme içermeyen dal) içeren\n"
+"bir çalışma ağacı oluşturmak istediyseniz bunu --orphan bayrağını\n"
+"kullanarak yapabilirsiniz:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan %s\n"
+msgstr ""
+"Bu depo için henüz doğmamış bir dal (işleme içermeyen dal) içeren\n"
+"bir çalışma ağacı oluşturmak istediyseniz bunu --orphan bayrağını\n"
+"kullanarak yapabilirsiniz:\n"
+"\n"
+" git worktree add --orphan %s\n"
#, c-format
msgid "Removing %s/%s: %s"
@@ -12987,6 +13526,10 @@ msgid "initializing"
msgstr "ilklendiriliyor"
#, c-format
+msgid "could not find created worktree '%s'"
+msgstr "oluşturulan '%s' çalışma ağacı bulunamadı"
+
+#, c-format
msgid "Preparing worktree (new branch '%s')"
msgstr "Çalışma ağacı hazırlanıyor (yeni dal '%s')"
@@ -12999,9 +13542,30 @@ msgid "Preparing worktree (checking out '%s')"
msgstr "Çalışma ağacı hazırlanıyor ('%s' çıkış yapılıyor)"
#, c-format
+msgid "unreachable: invalid reference: %s"
+msgstr "erişilemiyor: geçersiz başvuru: %s"
+
+#, c-format
msgid "Preparing worktree (detached HEAD %s)"
msgstr "Çalışma ağacı hazırlanıyor (ayrık HEAD %s)"
+#, c-format
+msgid ""
+"HEAD points to an invalid (or orphaned) reference.\n"
+"HEAD path: '%s'\n"
+"HEAD contents: '%s'"
+msgstr ""
+"HEAD, geçersiz (veya yetim bırakılmış bir başvuruya işaret ediyor.\n"
+"HEAD yolu: '%s'\n"
+"HEAD içeriği: '%s'"
+
+msgid ""
+"No local or remote refs exist despite at least one remote\n"
+"present, stopping; use 'add -f' to override or fetch a remote first"
+msgstr ""
+"Bir uzak konum olmasına rağmen hiçbir yerel/uzak başvuru yok, durduruluyor;\n"
+"geçersiz kılmak veya önce bir uzak konum getirmek için 'add -f' kullanın"
+
msgid "checkout <branch> even if already checked out in other worktree"
msgstr "diğer çalışma ağacında çıkış yapılmış olsa bile <dal> çıkışını yap"
@@ -13011,6 +13575,9 @@ msgstr "yeni bir dal oluÅŸtur"
msgid "create or reset a branch"
msgstr "yeni bir dal oluştur veya sıfırla"
+msgid "create unborn branch"
+msgstr "henüz doğmamış dal oluştur"
+
msgid "populate the new working tree"
msgstr "yeni çalışma ağacını doldur"
@@ -13030,6 +13597,10 @@ msgstr "yeni dalın adını bir uzak izleme dalıyla eşleştirmeyi dene"
msgid "options '%s', '%s', and '%s' cannot be used together"
msgstr "'%s', '%s' ve '%s' seçenekleri birlikte kullanılamaz"
+#, c-format
+msgid "option '%s' and commit-ish cannot be used together"
+msgstr "'%s' seçeneği ve işlememsiler birlikte kullanılamaz"
+
msgid "added with --lock"
msgstr "--lock ile eklendi"
@@ -13157,6 +13728,62 @@ msgstr "bir <önek> altdizini için ağaç nesnesi yaz"
msgid "only useful for debugging"
msgstr "yalnızca hata ayıklama için yararlı"
+msgid "core.fsyncMethod = batch is unsupported on this platform"
+msgstr "core.fsyncMethod = batch, bu platformda desteklenmiyor"
+
+#, c-format
+msgid "could not parse bundle list key %s with value '%s'"
+msgstr "demet liste anahtarı %s ile '%s' değeri ayrıştırılamıyor"
+
+#, c-format
+msgid "bundle list at '%s' has no mode"
+msgstr "'%s' konumundaki demet listesinin kipi yok"
+
+msgid "failed to create temporary file"
+msgstr "geçici dosya oluşturulamadı"
+
+msgid "insufficient capabilities"
+msgstr "yetersiz yetenekler"
+
+#, c-format
+msgid "file downloaded from '%s' is not a bundle"
+msgstr "'%s' konumundan indirilen dosya bir demet deÄŸil"
+
+msgid "failed to store maximum creation token"
+msgstr "en büyük oluşturma jetonu depolanamadı"
+
+#, c-format
+msgid "unrecognized bundle mode from URI '%s'"
+msgstr "'%s' URI'sinden tanımlanamayan demet kipi"
+
+#, c-format
+msgid "exceeded bundle URI recursion limit (%d)"
+msgstr "demet URI özyineleme sınırı aşıldı (%d)"
+
+#, c-format
+msgid "failed to download bundle from URI '%s'"
+msgstr "'%s' URI'sinden demet indirilemedi"
+
+#, c-format
+msgid "file at URI '%s' is not a bundle or bundle list"
+msgstr "'%s' URI'sindeki dosya bir demet veya demet listesi deÄŸil"
+
+#, c-format
+msgid "bundle-uri: unexpected argument: '%s'"
+msgstr "bundle-uri: beklenmedik argüman: '%s'"
+
+msgid "bundle-uri: expected flush after arguments"
+msgstr "bundle-uri: argümanlardan sonra floş bekleniyordu"
+
+msgid "bundle-uri: got an empty line"
+msgstr "bundle-uri: boş bir satır alındı"
+
+msgid "bundle-uri: line is not of the form 'key=value'"
+msgstr "bundle-uri: satır, 'anahtar=değer' olarak biçimlenmemiş"
+
+msgid "bundle-uri: line has empty key or value"
+msgstr "bundle-uri: satırda boş anahtar veya değer var"
+
#, c-format
msgid "unrecognized bundle hash algorithm: %s"
msgstr "bilinmeyen demet sağlama algoritması: %s"
@@ -13179,6 +13806,13 @@ msgstr "Depo aşağıdaki önkoşul işlemelere iye değil:"
msgid "need a repository to verify a bundle"
msgstr "bir demeti doğrulamak için bir depo gerekiyor"
+msgid ""
+"some prerequisite commits exist in the object store, but are not connected "
+"to the repository's history"
+msgstr ""
+"nesne deposunda bazı önkoşul işlemeleri var; ancak deponun geçmişine bağlı "
+"deÄŸiller"
+
#, c-format
msgid "The bundle contains this ref:"
msgid_plural "The bundle contains these %<PRIuMAX> refs:"
@@ -13194,6 +13828,14 @@ msgid_plural "The bundle requires these %<PRIuMAX> refs:"
msgstr[0] "Demet bu baÅŸvuruyu gerektiriyor:"
msgstr[1] "Demet bu %<PRIuMAX> baÅŸvuruyu gerektiriyor:"
+#, c-format
+msgid "The bundle uses this hash algorithm: %s"
+msgstr "Demet, bu sağlama algoritmasını kullanıyor: %s"
+
+#, c-format
+msgid "The bundle uses this filter: %s"
+msgstr "Demet, bu süzgeci kullanıyor: %s"
+
msgid "unable to dup bundle descriptor"
msgstr "demet açıklayıcısı çoğaltılamıyor"
@@ -13229,6 +13871,10 @@ msgid "terminating chunk id appears earlier than expected"
msgstr "iri parça numarası sonlandırması beklenenden önce ortaya çıkıyor"
#, c-format
+msgid "chunk id %<PRIx32> not %d-byte aligned"
+msgstr "iri parça kimliği %<PRIx32>, %d bayt hizalı değil"
+
+#, c-format
msgid "improper chunk offset(s) %<PRIx64> and %<PRIx64>"
msgstr "düzgün olmayan iri parça ofseti %<PRIx64> ve %<PRIx64>"
@@ -13280,8 +13926,8 @@ msgstr "Hata raporu bildirimi için veri topla"
msgid "Move objects and refs by archive"
msgstr "Nesneleri ve başvuruları arşive göre taşı"
-msgid "Provide content or type and size information for repository objects"
-msgstr "Depo nesneleri için içerik veya tür/boyut bilgisi sağla"
+msgid "Provide contents or details of repository objects"
+msgstr "Depo nesnelerinin içeriğini veya ayrıntılarını sağla"
msgid "Display gitattributes information"
msgstr "gitattributes bilgisini görüntüle"
@@ -13358,6 +14004,9 @@ msgstr "Git depoları için gerçekten yalın bir sunucu"
msgid "Give an object a human readable name based on an available ref"
msgstr "Uygun bir başvuruyu temel alıp nesneye okunabilir ad ver"
+msgid "Generate a zip archive of diagnostic information"
+msgstr "Tanı bilgisinin bir zip arşivini oluştur"
+
msgid "Show changes between commits, commit and working tree, etc"
msgstr "İşlemeler, işleme ve ağaçlar vb. arası değişiklikler"
@@ -13368,8 +14017,7 @@ msgid "Compare a tree to the working tree or index"
msgstr "Bir ağacı çalışma ağacı veya indeks ile karşılaştır"
msgid "Compares the content and mode of blobs found via two tree objects"
-msgstr ""
-"İki ağaç nesnesi aracılığıyla bulunan ikililerin içerik ve kipini karşılaştır"
+msgstr "İki ağaç nesnesiyle bulunan ikililerin içerik/kipini karşılaştır"
msgid "Show changes using common diff tools"
msgstr "Değişiklikleri yaygın diff araçlarıyla göster"
@@ -13416,8 +14064,8 @@ msgstr "Bir dizgi ile eşleşen satırları yazdır"
msgid "A portable graphical interface to Git"
msgstr "Git için taşınabilir bir grafik arabirim"
-msgid "Compute object ID and optionally creates a blob from a file"
-msgstr "Sağlamayı hesapla ve isteğe göre dosyadan ikili oluştur"
+msgid "Compute object ID and optionally create an object from a file"
+msgstr "Nesne kimliğini hesapla/dosyadan isteğe bağlı nesne oluştur"
msgid "Display help information about Git"
msgstr "Git yardım bilgisini görüntüle"
@@ -13485,8 +14133,8 @@ msgstr "Birleştirilmesi gereken dosyaları birleştir"
msgid "The standard helper program to use with git-merge-index"
msgstr "Bu yardımcı program git-merge-index kullanımı içindir"
-msgid "Show three-way merge without touching index"
-msgstr "İndekse dokunmadan üçlü birleştirmeyi göster"
+msgid "Perform merge without touching index or working tree"
+msgstr "İndekse veya çalışma ağacına dokunmadan birleştir"
msgid "Run merge conflict resolution tools to resolve merge conflicts"
msgstr "Çakışmaları çözmek için çözüm araçlarını çalıştır"
@@ -13531,7 +14179,7 @@ msgid "Remove extra objects that are already in pack files"
msgstr "Halihazırda paket dosyalarında olan ek nesneleri kaldır"
msgid "Fetch from and integrate with another repository or a local branch"
-msgstr "BaÅŸka bir depo veya yerel daldan getir ve entegre et"
+msgstr "Başka bir depo veya yerel daldan getir ve tümleştir"
msgid "Update remote refs along with associated objects"
msgstr "İlişkin nesnelerle birlikte uzak başvuruları da güncelle"
@@ -13563,6 +14211,10 @@ msgstr "Bir depodaki paketlenmemiÅŸ nesneleri paketle"
msgid "Create, list, delete refs to replace objects"
msgstr "Nesne değiştirmek için başvurular oluştur, sil, listele"
+msgid "EXPERIMENTAL: Replay commits on a new base, works with bare repos too"
+msgstr ""
+"DENEYSEL: İşlemeleri yeni temelde yeniden oynat, çıplak depolarla da çalışır"
+
msgid "Generates a summary of pending changes"
msgstr "Bekleyen değişikliklerin bir özetini çıkart"
@@ -13618,7 +14270,7 @@ msgid "List references in a local repository"
msgstr "Yerel bir depodaki başvuruları listele"
msgid "Reduce your working tree to a subset of tracked files"
-msgstr "Çalışma ağacını izlenen dosyaların bir alt kümesine küçült"
+msgstr "Çalışma ağacını izlenen dosyaların alt kümesine küçült"
msgid "Add file contents to the staging area"
msgstr "Dosya içeriğini hazırlama alanına ekle"
@@ -13681,8 +14333,11 @@ msgstr "Paketlenmiş Git arşiv dosyalarını doğrula"
msgid "Check the GPG signature of tags"
msgstr "Etiketlerin GPG imzasını doğrula"
-msgid "Show logs with difference each commit introduces"
-msgstr "Günlükleri her işlemenin sunduğu değişikliklerle göster"
+msgid "Display version information about Git"
+msgstr "Git sürüm bilgisini görüntüle"
+
+msgid "Show logs with differences each commit introduces"
+msgstr "Günlükleri her işlemenin değişiklikleriyle göster"
msgid "Manage multiple working trees"
msgstr "Birden çok çalışma ağacını yönet"
@@ -13714,6 +14369,24 @@ msgstr "Günlük Git kullanımı için yararlı komutlar"
msgid "Frequently asked questions about using Git"
msgstr "Git kullanımı hakkında sıkça sorulan sorular"
+msgid "The bundle file format"
+msgstr "Demet dosya biçimi"
+
+msgid "Chunk-based file formats"
+msgstr "geçersiz gitfile biçimi: %s"
+
+msgid "Git commit-graph format"
+msgstr "Git commit-graph biçimi"
+
+msgid "Git index format"
+msgstr "Git indeks biçimi"
+
+msgid "Git pack format"
+msgstr "Git paket biçimi"
+
+msgid "Git cryptographic signature formats"
+msgstr "Git kriptografik imza biçimleri"
+
msgid "A Git Glossary"
msgstr "Git Kavram Dizini"
@@ -13735,6 +14408,21 @@ msgstr "Altmodül özelliklerini tanımlama"
msgid "Git namespaces"
msgstr "Git ad alanları"
+msgid "Protocol v0 and v1 capabilities"
+msgstr "Protokol v0 ve v1 yetenekleri"
+
+msgid "Things common to various protocols"
+msgstr "Çeşitli protokollerde ortak olan şeyler"
+
+msgid "Git HTTP-based protocols"
+msgstr "Git HTTP tabanlı protokolleri"
+
+msgid "How packs are transferred over-the-wire"
+msgstr "Paketlerin nice aktarıldığı"
+
+msgid "Git Wire Protocol, Version 2"
+msgstr "Git Wire Protokolü, Sürüm 2"
+
msgid "Helper programs to interact with remote repositories"
msgstr "Uzak depolar ile etkileşim için yardımcı programlar"
@@ -13759,9 +14447,38 @@ msgstr "Git web arabirimi (Git depoları için web ön ucu)"
msgid "An overview of recommended workflows with Git"
msgstr "Önerilen Git çalışma akışlarına genel bakış"
+msgid "A tool for managing large Git repositories"
+msgstr "Büyük Git depolarını yönetmek için bir araç"
+
msgid "commit-graph file is too small"
msgstr "commit-graph dosyası pek küçük"
+msgid "commit-graph oid fanout chunk is wrong size"
+msgstr "commit-graph OID çıkış sayısı iri parçası boyutu yanlış"
+
+msgid "commit-graph fanout values out of order"
+msgstr "commit-graph çıkış sayısı değerleri sırasız: fanout[%d] = %u != %u"
+
+msgid "commit-graph OID lookup chunk is the wrong size"
+msgstr "commit-graph OID arama iri parçası boyutu yanlış"
+
+msgid "commit-graph commit data chunk is wrong size"
+msgstr "commit-graph işleme verisi iri parçası boyutu yanlış"
+
+msgid "commit-graph generations chunk is wrong size"
+msgstr "commit-graph kuşaklar iri parçası boyutu yanlış"
+
+msgid "commit-graph changed-path index chunk is too small"
+msgstr "commit-graph changed-path indeksi iri parçası boyutu pek küçük"
+
+#, c-format
+msgid ""
+"ignoring too-small changed-path chunk (%<PRIuMAX> < %<PRIuMAX>) in commit-"
+"graph file"
+msgstr ""
+"commit-graph dosyasındaki pek küçük changed-path iri parçası (%<PRIuMAX> < "
+"%<PRIuMAX>) yok sayılıyor"
+
#, c-format
msgid "commit-graph signature %X does not match signature %X"
msgstr "commit-graph imzası %X, %X ile eşleşmiyor"
@@ -13778,13 +14495,34 @@ msgstr "commit-graph sağlama sürümü %X, %X ile eşleşmiyor"
msgid "commit-graph file is too small to hold %u chunks"
msgstr "commit-graph dosyası %u iri parça tutmak için pek küçük"
+msgid "commit-graph required OID fanout chunk missing or corrupted"
+msgstr ""
+"commit-graph'ten gerekli OID çıkış sayısı iri parçası eksik veya hasarlı"
+
+msgid "commit-graph required OID lookup chunk missing or corrupted"
+msgstr "commit-graph'ten gerekli OID arama iri parçası eksik veya hasarlı"
+
+msgid "commit-graph required commit data chunk missing or corrupted"
+msgstr ""
+"commit-graph'ten gerekli OID çıkış sayısı iri parçası eksik veya hasarlı"
+
msgid "commit-graph has no base graphs chunk"
msgstr "commit-graph temel grafiği iri parçasına iye değil"
+msgid "commit-graph base graphs chunk is too small"
+msgstr "commit-graph temel grafiği iri parçası pek küçük"
+
msgid "commit-graph chain does not match"
msgstr "commit-graph zinciri eÅŸleÅŸmiyor"
#, c-format
+msgid "commit count in base graph too high: %<PRIuMAX>"
+msgstr "temel grafikteki işleme sayısı pek yüksek: %<PRIuMAX>"
+
+msgid "commit-graph chain file too small"
+msgstr "commit-graph zincir dosyası pek küçük"
+
+#, c-format
msgid "invalid commit-graph chain: line '%s' not a hash"
msgstr "geçersiz commit-graph zinciri: '%s'. satır bir sağlama değil"
@@ -13792,7 +14530,7 @@ msgid "unable to find all commit-graph files"
msgstr "tüm commit-graph dosyaları bulunamıyor"
msgid "invalid commit position. commit-graph is likely corrupt"
-msgstr "geçersiz işleme konumu, commit-graph büyük olasılıkla hasar görmüş"
+msgstr "geçersiz işleme konumu, commit-graph büyük olasılıkla hasarlı"
#, c-format
msgid "could not find commit %s"
@@ -13801,6 +14539,12 @@ msgstr "%s işlemesi bulunamadı"
msgid "commit-graph requires overflow generation data but has none"
msgstr "commit-graph, taşım oluşturma verisi gerektiriyor; ancak hiç yok"
+msgid "commit-graph overflow generation data is too small"
+msgstr "commit-graph, taşım üretim verisi pek küçük"
+
+msgid "commit-graph extra-edges pointer out of bounds"
+msgstr "commit-graph extra-edges işaretçisi sınırlar dışında"
+
msgid "Loading known commits in commit graph"
msgstr "İşleme grafiğindeki bilinen işlemeler yükleniyor"
@@ -13868,6 +14612,14 @@ msgstr "temel commit-graph dosyası yeniden adlandırılamadı"
msgid "failed to rename temporary commit-graph file"
msgstr "geçici commit-graph dosyası yeniden adlandırılamadı"
+#, c-format
+msgid "cannot merge graphs with %<PRIuMAX>, %<PRIuMAX> commits"
+msgstr "%<PRIuMAX>, %<PRIuMAX> iÅŸlemeli grafikler birleÅŸtirilemiyor"
+
+#, c-format
+msgid "cannot merge graph %s, too many commits: %<PRIuMAX>"
+msgstr "%s grafiği birleştirilemiyor, pek çok işleme: %<PRIuMAX>"
+
msgid "Scanning merged commits"
msgstr "Birleştirilen işlemeler taranıyor"
@@ -13879,12 +14631,11 @@ msgstr ""
"bir commit-graph yazılmaya çalışılıyor; ancak 'core.commitGraph' devre dışı"
msgid "too many commits to write graph"
-msgstr "grafik yazımı için çok fazla işleme"
+msgstr "grafik yazımı için pek fazla işleme"
msgid "the commit-graph file has incorrect checksum and is likely corrupt"
msgstr ""
-"commit-graph dosyasının sağlama toplamı yanlış ve büyük olasılıkla hasar "
-"görmüş"
+"commit-graph dosyasının sağlama toplamı yanlış ve büyük olasılıkla hasarlı"
#, c-format
msgid "commit-graph has incorrect OID order: %s then %s"
@@ -13898,9 +14649,6 @@ msgstr "commit-graph hatalı fanout değerine iye: fanout[%d] = %u != %u"
msgid "failed to parse commit %s from commit-graph"
msgstr "%s işlemesi commit-graph'tan ayrıştırılamadı"
-msgid "Verifying commits in commit graph"
-msgstr "İşleme grafiğindeki işlemeler doğrulanıyor"
-
#, c-format
msgid "failed to parse commit %s from object database for commit-graph"
msgstr ""
@@ -13924,20 +14672,6 @@ msgid "commit-graph parent list for commit %s terminates early"
msgstr "%s işlemesi için olan commit-graph üst öge listesi erkenden sonlanıyor"
#, c-format
-msgid ""
-"commit-graph has generation number zero for commit %s, but non-zero elsewhere"
-msgstr ""
-"%s işlemesi için commit-graph kuşak sayısı sıfır; ancak başka yerlerde "
-"sıfırdan farklı"
-
-#, c-format
-msgid ""
-"commit-graph has non-zero generation number for commit %s, but zero elsewhere"
-msgstr ""
-"%s işlemesi için commit-graph kuşak sayısı sıfırdan farklı; ancak başka "
-"yerlerde sıfır"
-
-#, c-format
msgid "commit-graph generation for commit %s is %<PRIuMAX> < %<PRIuMAX>"
msgstr "%s işlemesi için commit-graph kuşağı %<PRIuMAX> < %<PRIuMAX>"
@@ -13947,6 +14681,17 @@ msgstr ""
"%s işlemesi için commit-graph içindeki işleme tarihi %<PRIuMAX> != %<PRIuMAX>"
#, c-format
+msgid ""
+"commit-graph has both zero and non-zero generations (e.g., commits '%s' and "
+"'%s')"
+msgstr ""
+"commit-graph'te hem sıfır hem de sıfır olmayan üretimler var (örneğin, "
+"'%s've '%s' iÅŸlemeleri)"
+
+msgid "Verifying commits in commit graph"
+msgstr "İşleme grafiğindeki işlemeler doğrulanıyor"
+
+#, c-format
msgid "%s %s is not a commit!"
msgstr "%s %s bir iÅŸleme deÄŸil!"
@@ -13967,7 +14712,11 @@ msgstr ""
"lütfen \"git replace --convert-graft-file\" kullanın.\n"
"\n"
"\"git config advice.graftFileDeprecated false\"\n"
-"kullanarak bu iletiyi kapatabilirsiniz."
+"kullanarak bu iletiyi kapatabilirsiniz"
+
+#, c-format
+msgid "commit %s exists in commit-graph but not in the object database"
+msgstr "%s işlemesi işleme grafiğinde var; ancak nesne veritabanında yok"
#, c-format
msgid "Commit %s has an untrusted GPG signature, allegedly by %s."
@@ -13997,10 +14746,18 @@ msgstr ""
"kodlama ile deÄŸiÅŸtirmek isteyebilirsiniz.\n"
msgid "no compiler information available\n"
-msgstr "derleyici bilgisi mevcut deÄŸil\n"
+msgstr "derleyici bilgisi yok\n"
msgid "no libc information available\n"
-msgstr "libc bilgisi mevcut deÄŸil\n"
+msgstr "libc bilgisi yok\n"
+
+#, c-format
+msgid "could not determine free disk size for '%s'"
+msgstr "'%s' için boş disk alanı belirlenemedi"
+
+#, c-format
+msgid "could not get info for '%s'"
+msgstr "'%s' için bilgi alınamadı"
#, c-format
msgid "[GLE %ld] health thread could not open '%ls'"
@@ -14026,6 +14783,10 @@ msgstr "'has_worktree_moved' içinde işlenmemiş senaryo: %d"
msgid "health thread wait failed [GLE %ld]"
msgstr "sağlık iş parçacığı bekleme başarısız oldu [GLE %ld]"
+#, c-format
+msgid "Invalid path: %s"
+msgstr "Geçersiz yol %s"
+
msgid "Unable to create FSEventStream."
msgstr "FSEventStream oluşturulamadı."
@@ -14057,6 +14818,30 @@ msgid "could not read directory changes [GLE %ld]"
msgstr "dizin değişiklikleri okunamadı [GLE %ld]"
#, c-format
+msgid "opendir('%s') failed"
+msgstr "opendir('%s') başarısız oldu"
+
+#, c-format
+msgid "lstat('%s') failed"
+msgstr "lstat('%s') başarısız oldu"
+
+#, c-format
+msgid "strbuf_readlink('%s') failed"
+msgstr "strbuf_readlink('%s') başarısız oldu"
+
+#, c-format
+msgid "closedir('%s') failed"
+msgstr "closedir('%s') başarısız oldu"
+
+#, c-format
+msgid "[GLE %ld] unable to open for read '%ls'"
+msgstr "[GLE %ld] '%ls', okuma için açılamıyor"
+
+#, c-format
+msgid "[GLE %ld] unable to get protocol information for '%ls'"
+msgstr "[GLE %ld] '%ls' için protokol bilgisi alınamıyor"
+
+#, c-format
msgid "failed to copy SID (%ld)"
msgstr "SID kopyalanamadı (%ld)"
@@ -14233,7 +15018,7 @@ msgstr "%s içinde düzmece sayım"
#, c-format
msgid "too many entries in %s"
-msgstr "%s içinde çok fazla girdi"
+msgstr "%s içinde pek fazla girdi"
#, c-format
msgid "missing config key %s"
@@ -14337,8 +15122,8 @@ msgstr "kısaltma uzunluğu erim dışında: %d"
msgid "bad zlib compression level %d"
msgstr "hatalı zlib sıkıştırma düzeyi %d"
-msgid "core.commentChar should only be one character"
-msgstr "core.commentChar yalnızca bir karakter olmalı"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar yalnızca bir ASCII karakter olmalı"
#, c-format
msgid "ignoring unknown core.fsyncMethod value '%s'"
@@ -14374,10 +15159,6 @@ msgstr "'%s' baÅŸvurusu ikili bir nesneye iÅŸaret etmiyor"
msgid "unable to resolve config blob '%s'"
msgstr "'%s' yapılandırma ikili nesnesi çözülemiyor"
-#, c-format
-msgid "failed to parse %s"
-msgstr "%s ayrıştırılamadı"
-
msgid "unable to parse command-line config"
msgstr "komut satırı yapılandırması ayrıştırılamıyor"
@@ -14449,6 +15230,10 @@ msgid "invalid section name: %s"
msgstr "geçersiz bölüm adı: %s"
#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr "'%s' içindeki haddinden uzun %<PRIuMAX>. satırla çalışma reddediliyor"
+
+#, c-format
msgid "missing value for '%s'"
msgstr "'%s' için değer eksik"
@@ -14503,21 +15288,28 @@ msgid "unknown object format '%s' specified by server"
msgstr "sunucu tarafından bilinmeyen nesne biçimi '%s' belirtildi"
#, c-format
+msgid "error on bundle-uri response line %d: %s"
+msgstr "bundle-uri %d. yanıt satırında hata: %s"
+
+msgid "expected flush after bundle-uri listing"
+msgstr "bundle-uri listelemesinden sonra floÅŸ bekleniyordu"
+
+msgid "expected response end packet after ref listing"
+msgstr "başvuru listelemesinden sonra yanıt sonu paketi bekleniyordu"
+
+#, c-format
msgid "invalid ls-refs response: %s"
msgstr "geçersiz ls-refs yanıtı: %s"
msgid "expected flush after ref listing"
msgstr "baÅŸvuru listelemesinden sonra floÅŸ bekleniyordu"
-msgid "expected response end packet after ref listing"
-msgstr "başvuru listelemesinden sonra yanıt sonu paketi bekleniyordu"
-
#, c-format
msgid "protocol '%s' is not supported"
msgstr "'%s' protokolü desteklenmiyor"
msgid "unable to set SO_KEEPALIVE on socket"
-msgstr "soket üzerinde SO_KEEPALIVE ayarlanamıyor"
+msgstr "yuva üzerinde SO_KEEPALIVE ayarlanamıyor"
#, c-format
msgid "Looking up %s ... "
@@ -14600,181 +15392,6 @@ msgid "failed to close rev-list's stdin"
msgstr "rev-list'in stdin'i kapatılamadı"
#, c-format
-msgid "'%s' does not exist"
-msgstr "'%s' mevcut deÄŸil"
-
-msgid "need a working directory"
-msgstr "bir çalışma dizini gerekiyor"
-
-msgid "could not find enlistment root"
-msgstr "gönüllü yazılma kaydı bulunamıyor"
-
-#, c-format
-msgid "could not switch to '%s'"
-msgstr "şuraya geçilemedi: '%s'"
-
-#, c-format
-msgid "could not configure %s=%s"
-msgstr "%s=%s yapılandırılamadı"
-
-msgid "could not configure log.excludeDecoration"
-msgstr "log.excludeDecoration yapılandırılamadı"
-
-msgid "Scalar enlistments require a worktree"
-msgstr "Scalar gönüllü kayıtları bir çalışma ağacı gerektiriyor"
-
-#, c-format
-msgid "could not open directory '%s'"
-msgstr "'%s' dizini açılamadı"
-
-#, c-format
-msgid "skipping '%s', which is neither file nor directory"
-msgstr "ne bir dosya ne de dizin olan '%s' atlanıyor"
-
-#, c-format
-msgid "could not determine free disk size for '%s'"
-msgstr "'%s' için boş disk alanı belirlenemedi"
-
-#, c-format
-msgid "could not get info for '%s'"
-msgstr "'%s' için bilgi alınamadı"
-
-#, c-format
-msgid "remote HEAD is not a branch: '%.*s'"
-msgstr "uzak konum HEAD'i bir dal deÄŸil: '%.*s'"
-
-msgid "failed to get default branch name from remote; using local default"
-msgstr ""
-"uzak konumdan öntanımlı dal adı alınamadı; yerel öntanımlı kullanılıyor"
-
-msgid "failed to get default branch name"
-msgstr "öntanımlı dal adı alınamadı"
-
-msgid "failed to unregister repository"
-msgstr "depo kaydı silinemedi"
-
-msgid "failed to delete enlistment directory"
-msgstr "gönüllü kayıt dizini silinemedi"
-
-msgid "branch to checkout after clone"
-msgstr "klonlama sonrası çıkış yapılacak dal"
-
-msgid "when cloning, create full working directory"
-msgstr "klonlama sırasında tam çalışma dizini oluştur"
-
-msgid "only download metadata for the branch that will be checked out"
-msgstr "yalnızca çıkış yapılacak dalın üstverisini indir"
-
-msgid "scalar clone [<options>] [--] <repo> [<dir>]"
-msgstr "scalar clone [<seçenekler>] [--] <depo> [<dizin>]"
-
-#, c-format
-msgid "cannot deduce worktree name from '%s'"
-msgstr "'%s' ögesinden çalışma ağacı adı ortaya çıkarılamıyor"
-
-#, c-format
-msgid "directory '%s' exists already"
-msgstr "'%s' dizini halihazırda var"
-
-#, c-format
-msgid "failed to get default branch for '%s'"
-msgstr "'%s' için öntanımlı dal alınamadı"
-
-#, c-format
-msgid "could not configure remote in '%s'"
-msgstr "'%s' içindeki uzak konum yapılandırılamadı"
-
-#, c-format
-msgid "could not configure '%s'"
-msgstr "'%s' yapılandırılamadı"
-
-msgid "partial clone failed; attempting full clone"
-msgstr "kısımsal klonlama başarısız; tam klonlama deneniyor"
-
-msgid "could not configure for full clone"
-msgstr "tam klonlama için yapılandırılamadı"
-
-msgid "scalar diagnose [<enlistment>]"
-msgstr "scalar diagnose [<gönüllükayıt>]"
-
-#, c-format
-msgid "could not create directory for '%s'"
-msgstr "'%s' için dizin oluşturulamadı"
-
-msgid "could not duplicate stdout"
-msgstr "stdout çoğaltılamadı"
-
-msgid "failed to write archive"
-msgstr "arşiv yazılamadı"
-
-msgid "`scalar list` does not take arguments"
-msgstr "'scalar list' argüman almıyor"
-
-msgid "scalar register [<enlistment>]"
-msgstr "scalar register [<gönüllükayıt>]"
-
-msgid "reconfigure all registered enlistments"
-msgstr "tüm kaydı yapılmış gönüllü kayıtları yeniden yapılandır"
-
-msgid "scalar reconfigure [--all | <enlistment>]"
-msgstr "scalar reconfigure [--all | <gönüllükayıt>]"
-
-msgid "--all or <enlistment>, but not both"
-msgstr "--all veya <gönüllükayıt>; ancak ikisi değil"
-
-#, c-format
-msgid "git repository gone in '%s'"
-msgstr "git deposu '%s' içinde gitti"
-
-msgid ""
-"scalar run <task> [<enlistment>]\n"
-"Tasks:\n"
-msgstr ""
-"scalar run <görev> [<gönüllükayıt>]\n"
-"Görevler:\n"
-
-#, c-format
-msgid "no such task: '%s'"
-msgstr "böyle bir görev yok: '%s'"
-
-msgid "scalar unregister [<enlistment>]"
-msgstr "scalar unregister [<enlistment>]"
-
-msgid "scalar delete <enlistment>"
-msgstr "scalar delete <gönüllükayıt>"
-
-msgid "refusing to delete current working directory"
-msgstr "geçerli çalışma dizinini silme reddediliyor"
-
-msgid "include Git version"
-msgstr "Git sürümünü içer"
-
-msgid "include Git's build options"
-msgstr "Git'in yapı seçeneklerini içer"
-
-msgid "scalar verbose [-v | --verbose] [--build-options]"
-msgstr "scalar verbose [-v | --verbose] [--build-options]"
-
-msgid "-C requires a <directory>"
-msgstr "-C, bir <dizin> gerektiriyor"
-
-#, c-format
-msgid "could not change to '%s'"
-msgstr "'%s' olarak deÄŸiÅŸtirilemedi"
-
-msgid "-c requires a <key>=<value> argument"
-msgstr "-c, bir <anahtar>=<değer> argümanı gerektiriyor"
-
-msgid ""
-"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
-"\n"
-"Commands:\n"
-msgstr ""
-"scalar [-C <dizin>] [-c <anahtar>=<değer>] <komut> [<seçenekler>]\n"
-"\n"
-"Komutlar:\n"
-
-#, c-format
msgid "illegal crlf_action %d"
msgstr "izin verilmeyen crlf_action %d"
@@ -14973,19 +15590,42 @@ msgstr "'%s' için delta adası düzenli ifadesi yüklenemedi: %s"
#, c-format
msgid "island regex from config has too many capture groups (max=%d)"
msgstr ""
-"yapılandırmanın delta adası düzenli ifadesinde çok fazla yakalama grubu var "
+"yapılandırmanın delta adası düzenli ifadesinde pek fazla yakalama grubu var "
"(en çok %d)"
#, c-format
msgid "Marked %d islands, done.\n"
msgstr "%d delta adası imlendi, bitti.\n"
+#, c-format
+msgid "invalid --%s value '%s'"
+msgstr "geçersiz --%s değeri '%s'"
+
+#, c-format
+msgid "could not archive missing directory '%s'"
+msgstr "eksik dizin '%s', arÅŸivlenemedi"
+
+#, c-format
+msgid "could not open directory '%s'"
+msgstr "'%s' dizini açılamadı"
+
+#, c-format
+msgid "skipping '%s', which is neither file nor directory"
+msgstr "ne bir dosya ne de dizin olan '%s' atlanıyor"
+
+msgid "could not duplicate stdout"
+msgstr "stdout çoğaltılamadı"
+
+#, c-format
+msgid "could not add directory '%s' to archiver"
+msgstr "'%s' dizini, arÅŸivleyiciye eklenemedi"
+
+msgid "failed to write archive"
+msgstr "arşiv yazılamadı"
+
msgid "--merge-base does not work with ranges"
msgstr "--merge-base erimlerle çalışmaz"
-msgid "--merge-base only works with commits"
-msgstr "--merge-base yalnızca işlemelerle çalışır"
-
msgid "unable to get HEAD"
msgstr "HEAD alınamıyor"
@@ -14995,6 +15635,12 @@ msgstr "bir birleştirme temeli bulunamadı"
msgid "multiple merge bases found"
msgstr "birden çok birleştirme temeli bulundu"
+msgid "cannot compare stdin to a directory"
+msgstr "stdin, bir dizinle karşılaştırılamıyor"
+
+msgid "cannot compare a named pipe to a directory"
+msgstr "adlandırılmış bir veriyolu bir dizinle karşılaştırılamıyor"
+
msgid "git diff --no-index [<options>] <path> <path>"
msgstr "git diff --no-index [<seçenekler>] <yol> <yol>"
@@ -15003,7 +15649,7 @@ msgid ""
"tree"
msgstr ""
"Bir git deposu değil. Bir çalışma ağacının dışındaki iki yolu karşılaştırmak "
-"için --no-index kullanın."
+"için --no-index kullanın"
#, c-format
msgid " Failed to parse dirstat cut-off percentage '%s'\n"
@@ -15040,6 +15686,10 @@ msgid "Unknown value for 'diff.submodule' config variable: '%s'"
msgstr "'diff.submodule' yapılandırma değişkeni için bilinmeyen değer: '%s'"
#, c-format
+msgid "unknown value for config '%s': %s"
+msgstr "'%s' yapılandırması için bilinmeyen değer: %s"
+
+#, c-format
msgid ""
"Found errors in 'diff.dirstat' config variable:\n"
"%s"
@@ -15051,6 +15701,13 @@ msgstr ""
msgid "external diff died, stopping at %s"
msgstr "dış diff sonlandı, %s konumunda durdu"
+msgid "--follow requires exactly one pathspec"
+msgstr "--follow tam olarak yalnızca bir yol belirteci gerektiriyor"
+
+#, c-format
+msgid "pathspec magic not supported by --follow: %s"
+msgstr "yol belirteci sihri --follow tarafından desteklenmiyor: %s"
+
#, c-format
msgid "options '%s', '%s', '%s', and '%s' cannot be used together"
msgstr "'%s', '%s', '%s' ve '%s' seçenekleri birlikte kullanılamaz"
@@ -15068,9 +15725,6 @@ msgstr ""
"'%s' ve '%s' seçenekleri birlikte kullanılamaz, '%s' seçeneğini '%s' ve '%s' "
"ile kullanın"
-msgid "--follow requires exactly one pathspec"
-msgstr "--follow tam olarak yalnızca bir yol belirteci gerektiriyor"
-
#, c-format
msgid "invalid --stat value: %s"
msgstr "geçersiz --stat değeri: %s"
@@ -15115,13 +15769,6 @@ msgstr "hatalı --color-moved argümanı: %s"
msgid "invalid mode '%s' in --color-moved-ws"
msgstr "--color-moved-ws içinde geçersiz kip '%s'"
-msgid ""
-"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
-"\"histogram\""
-msgstr ""
-"diff-algorithm seçeneği şunları kabul eder: \"myers\", \"minimal\", "
-"\"patience\" ve \"histogram\""
-
#, c-format
msgid "invalid argument to %s"
msgstr "%s için geçersiz argüman"
@@ -15165,8 +15812,8 @@ msgstr "makinede okunabilen --stat"
msgid "output only the last line of --stat"
msgstr "--stat'ın yalnızca son satırını çıktı ver"
-msgid "<param1,param2>..."
-msgstr "<param1,param2>..."
+msgid "<param1>,<param2>..."
+msgstr "<param1>,<param2>..."
msgid ""
"output the distribution of relative amount of changes for each sub-directory"
@@ -15176,8 +15823,8 @@ msgstr ""
msgid "synonym for --dirstat=cumulative"
msgstr "--dirstat=cumulative eşanlamlısı"
-msgid "synonym for --dirstat=files,param1,param2..."
-msgstr "--dirstat=files,param1,param2... eşanlamlısı"
+msgid "synonym for --dirstat=files,<param1>,<param2>..."
+msgstr "--dirstat=files,<param1>,<param2>... eşanlamlısı"
msgid "warn if changes introduce conflict markers or whitespace errors"
msgstr ""
@@ -15260,6 +15907,9 @@ msgstr "çıktının her satırının başına ek bir önek ekle"
msgid "do not show any source or destination prefix"
msgstr "hiçbir kaynak ve hedef önekini gösterme"
+msgid "use default prefixes a/ and b/"
+msgstr "a/ ve b/ ögelerinin öntanımlı öneklerini kullan"
+
msgid "show context between diff hunks up to the specified number of lines"
msgstr "diff parçaları arasındaki bağlamı belirtilen satır sayısı kadar göster"
@@ -15349,12 +15999,6 @@ msgstr "diff'i \"patience diff\" algoritmasını kullanarak oluştur"
msgid "generate diff using the \"histogram diff\" algorithm"
msgstr "diff'i \"histogram diff\" algoritmasını kullanarak oluştur"
-msgid "<algorithm>"
-msgstr "<algoritma>"
-
-msgid "choose a diff algorithm"
-msgstr "bir diff algoritması seç"
-
msgid "<text>"
msgstr "<metin>"
@@ -15402,7 +16046,7 @@ msgid "disable all output of the program"
msgstr "tüm program çıktısını devre dışı bırak"
msgid "allow an external diff helper to be executed"
-msgstr "bir dış diff yardımcısının çalıştırılmasına izin ver"
+msgstr "bir dış diff yardımcısının yürütülmesine izin ver"
msgid "run external text conversion filters when comparing binary files"
msgstr ""
@@ -15479,7 +16123,7 @@ msgstr "belirli bir dosyaya çıktıla"
msgid "exhaustive rename detection was skipped due to too many files."
msgstr ""
-"Geniş kapsamlı yeniden adlandırma algılaması çok fazla dosya olmasından "
+"Geniş kapsamlı yeniden adlandırma algılaması pek fazla dosya olmasından "
"dolayı atlandı."
msgid "only found copies from modified paths due to too many files."
@@ -15539,7 +16183,7 @@ msgid ""
"Please specify a directory on the command line"
msgstr ""
"Bir dizin adı tahmin edilemedi.\n"
-"Lütfen komut satırında bir dizin belirtin."
+"Lütfen komut satırında bir dizin belirtin"
#, c-format
msgid "index file corrupt in repo %s"
@@ -15557,6 +16201,14 @@ msgstr "git dizini '%s' konumundan '%s' konumuna göç ettirilemedi"
msgid "hint: Waiting for your editor to close the file...%c"
msgstr "İpucu: Düzenleyicinizin dosyayı kapatması bekleniyor...%c"
+#, c-format
+msgid "could not write to '%s'"
+msgstr "şuraya yazılamadı: '%s'"
+
+#, c-format
+msgid "could not edit '%s'"
+msgstr "'%s' düzenlenemedi"
+
msgid "Filtering content"
msgstr "İçerik süzülüyor"
@@ -15570,7 +16222,7 @@ msgstr "hatalı git ad alanı yolu \"%s\""
#, c-format
msgid "too many args to run %s"
-msgstr "%s çalıştırmak için çok fazla argüman"
+msgstr "%s çalıştırmak için pek fazla argüman"
msgid "git fetch-pack: expected shallow list"
msgstr "git fetch-pack: sığ bir liste bekleniyordu"
@@ -15588,6 +16240,9 @@ msgstr "git fetch-pack: ACK/NAK bekleniyordu, '%s' alındı"
msgid "unable to write to remote"
msgstr "uzak konuma yazılamıyor"
+msgid "Server supports filter"
+msgstr "Sunucu süzgeç destekliyor"
+
#, c-format
msgid "invalid shallow line: %s"
msgstr "geçersiz sığ satır: %s"
@@ -15698,9 +16353,6 @@ msgstr "sunucu '%s' algoritmasını desteklemiyor"
msgid "Server does not support shallow requests"
msgstr "Sunucu sığ istekleri desteklemiyor"
-msgid "Server supports filter"
-msgstr "Sunucu süzgeç destekliyor"
-
msgid "unable to write request to remote"
msgstr "uzak konuma istek yazılamıyor"
@@ -15800,9 +16452,10 @@ msgstr "sanal depo '%s', fsmonitor ile uyumsuz"
#, c-format
msgid ""
-"repository '%s' is incompatible with fsmonitor due to lack of Unix sockets"
+"socket directory '%s' is incompatible with fsmonitor due to lack of Unix "
+"sockets support"
msgstr ""
-"Unix soketleri eksik olduğundan dolayı; '%s' deposu, fsmonitor ile uyumsuz"
+"yuva dizini '%s', Unix yuva dasteği olmadığından dolayı fsmonitor ile uyumsuz"
msgid ""
"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
@@ -15810,16 +16463,14 @@ msgid ""
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
-" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
-" <command> [<args>]"
+" [--config-env=<name>=<envvar>] <command> [<args>]"
msgstr ""
"git [-v | --version] [-h | --help] [-C <yol>] [-c <ad>=<deÄŸer>]\n"
" [--exec-path[=<yol>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<yol>] [--work-tree=<yol>] [--namespace=<ad>]\n"
-" [--super-prefix=<yol>] [--config-env=<ad>=<çevredeğişkeni>]\n"
-" <komut> [<argümanlar>]"
+" [--config-env=<ad>=<çevre-değişkeni>] <komut> [<argümanlar>]"
msgid ""
"'git help -a' and 'git help -g' list available subcommands and some\n"
@@ -15845,10 +16496,6 @@ msgid "no namespace given for --namespace\n"
msgstr "--namespace için ad alanı verilmedi\n"
#, c-format
-msgid "no prefix given for --super-prefix\n"
-msgstr "--super-prefix için önek verilmedi\n"
-
-#, c-format
msgid "-c expects a configuration string\n"
msgstr "-c bir yapılandırma dizisi bekliyor\n"
@@ -15857,6 +16504,10 @@ msgid "no config key given for --config-env\n"
msgstr "--config-env için bir yapılandırma anahtarı verilmedi\n"
#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "--attr-source için öznitelik kaynağı verilmedi\n"
+
+#, c-format
msgid "unknown option: %s\n"
msgstr "bilinmeyen seçenek: %s\n"
@@ -15870,7 +16521,7 @@ msgid ""
"You can use '!git' in the alias to do this"
msgstr ""
"'%s' arması çevre değişkenlerini değiştirir.\n"
-"Bunu yapmak için armada '!git' kullanabilirsiniz."
+"Bunu yapmak için armada '!git' kullanabilirsiniz"
#, c-format
msgid "empty alias for %s"
@@ -15933,7 +16584,7 @@ msgid ""
"verification (available in openssh version 8.2p1+)"
msgstr ""
"ssh-keygen -Y find-principals/verify, ssh imza doğrulaması için gerekli "
-"(openssh 8.21p1+ sürümünde mevcut)"
+"(openssh 8.21p1+ sürümünde var)"
#, c-format
msgid "ssh signing revocation file configured but not found: %s"
@@ -15963,8 +16614,13 @@ msgstr ""
msgid "gpg.ssh.defaultKeyCommand failed: %s %s"
msgstr "gpg.ssh.defaultKeyCommand başarısız oldu: %s %s"
-msgid "gpg failed to sign the data"
-msgstr "gpg veriyi imzalayamadı"
+#, c-format
+msgid ""
+"gpg failed to sign the data:\n"
+"%s"
+msgstr ""
+"gpg veriyi imzalayamadı:\n"
+"%s"
msgid "user.signingKey needs to be set for ssh signing"
msgstr "user.signingKey'in ssh imzalaması için ayarlanması gerekiyor"
@@ -15982,7 +16638,7 @@ msgid ""
"8.2p1+)"
msgstr ""
"ssh-keygen -Y imzası, ssh imzalaması için gerekli (openssh 8.21p1+ sürümünde "
-"mevcut)"
+"var)"
#, c-format
msgid "failed reading ssh signing data buffer from '%s'"
@@ -16047,6 +16703,12 @@ msgstr "Düşük Düzeyli Komutlar / Depo Eşitleme"
msgid "Low-level Commands / Internal Helpers"
msgstr "Düşük Düzeyli Komutlar / İç Yardımcılar"
+msgid "User-facing repository, command and file interfaces"
+msgstr "Kullanıcı için depo, komut ve dosya arayüzleri"
+
+msgid "Developer-facing file formats, protocols and other interfaces"
+msgstr "Geliştirici için dosya biçimleri, protokoller ve arayüzler"
+
#, c-format
msgid "available git commands in '%s'"
msgstr "'%s' içindeki kullanılabilir git komutları"
@@ -16060,6 +16722,12 @@ msgstr "En çok kullanılan temel Git komutlarının bir listesi aşağıdadır:
msgid "The Git concept guides are:"
msgstr "Git konsept kılavuzları şunlardır:"
+msgid "User-facing repository, command and file interfaces:"
+msgstr "Kullanıcıya görünür depo, komut ve dosya arayüzleri:"
+
+msgid "File formats, protocols and other developer interfaces:"
+msgstr "Dosya biçimleri, protokoller ve diğer geliştirici arayüzleri:"
+
msgid "External commands"
msgstr "Dış komutlar"
@@ -16075,7 +16743,7 @@ msgid ""
"able to execute it. Maybe git-%s is broken?"
msgstr ""
"'%s' bir git komutu gibi görünüyor; ancak biz onu\n"
-"çalıştıramadık. git-%s bozuk olabilir mi?"
+"yürütemedik. git-%s bozuk olabilir mi?"
#, c-format
msgid "git: '%s' is not a git command. See 'git --help'."
@@ -16114,8 +16782,8 @@ msgstr[1] ""
"\n"
"Buna en yakın komutlar:"
-msgid "git version [<options>]"
-msgstr "git version [<seçenekler>]"
+msgid "git version [--build-options]"
+msgstr "git version [--build-options]"
#, c-format
msgid "%s: %s - %s"
@@ -16139,20 +16807,17 @@ msgid ""
"The '%s' hook was ignored because it's not set as executable.\n"
"You can disable this warning with `git config advice.ignoredHook false`."
msgstr ""
-"'%s' kancası yok sayıldı; çünkü bir çalıştırılabilir olarak ayarlanmamış.\n"
+"'%s' kancası yok sayıldı; çünkü bir yürütülebilir olarak ayarlanmamış.\n"
"Bu uyarıyı 'git config advice.ignoredHook false' ile kapatabilirsiniz."
#, c-format
-msgid "Couldn't start hook '%s'\n"
-msgstr "'%s' kancası başlatılamadı\n"
-
-#, c-format
msgid "argument to --packfile must be a valid hash (got '%s')"
msgstr "--packfile için argüman geçerli bir sağlama olmalıdır ('%s' alındı)"
msgid "not a git repository"
msgstr "bir git deposu deÄŸil"
+#, c-format
msgid "negative value for http.postBuffer; defaulting to %d"
msgstr "http.postBuffer için negatif değer; %d olarak varsayılıyor"
@@ -16330,21 +16995,16 @@ msgid "quoted CRLF detected"
msgstr "alıntılanmış CRLF algılandı"
#, c-format
-msgid ""
-"Your local changes to the following files would be overwritten by merge:\n"
-" %s"
-msgstr ""
-"Birleştirme ile aşağıdaki dosyalardaki yerel değişikliklerin üzerine "
-"yazılacak:\n"
-"\t%s"
-
-#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "%s altmodülü birleştirilemedi (çıkış yapılmadı)"
#, c-format
+msgid "Failed to merge submodule %s (no merge base)"
+msgstr "%s altmodülü birleştirilemedi (birleştirme temeli yok)"
+
+#, c-format
msgid "Failed to merge submodule %s (commits not present)"
-msgstr "%s altmodülü birleştirilemedi (işlemeler mevcut değil)"
+msgstr "%s altmodülü birleştirilemedi (işlemeler yok)"
#, c-format
msgid "Failed to merge submodule %s (commits don't follow merge-base)"
@@ -16360,42 +17020,24 @@ msgstr "'%s' altmodülü birleştirilemedi"
#, c-format
msgid ""
-"Failed to merge submodule %s, but a possible merge resolution exists:\n"
-"%s\n"
+"Failed to merge submodule %s, but a possible merge resolution exists: %s"
msgstr ""
-"%s altmodülü birleştirilemedi; ancak olası bir birleştirme çözümü mevcut:\n"
-"%s\n"
-
-#, c-format
-msgid ""
-"If this is correct simply add it to the index for example\n"
-"by using:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"which will accept this suggestion.\n"
-msgstr ""
-"Eğer bu doğruysa yalnızca indekse ekleyin, örneğin:\n"
-"\n"
-"\tgit update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"komutu bu öneriyi kabul edecektir.\n"
+"%s altmodülü birleştirilemedi; ancak olası bir birleştirme çözümü var: %s"
#, c-format
msgid ""
"Failed to merge submodule %s, but multiple possible merges exist:\n"
"%s"
msgstr ""
-"%s altmodülü birleştirilemedi; ancak birden çok olası birleştirmeler "
-"mevcut:\n"
+"%s altmodülü birleştirilemedi; ancak birden çok olası birleştirmeler var:\n"
"%s"
-msgid "Failed to execute internal merge"
-msgstr "İç birleştirme çalıştırılamadı"
+msgid "failed to execute internal merge"
+msgstr "iç birleştirme yürütülemedi"
#, c-format
-msgid "Unable to add %s to database"
-msgstr "%s veritabanına eklenemedi"
+msgid "unable to add %s to database"
+msgstr "%s veritabanına eklenemiyor"
#, c-format
msgid "Auto-merging %s"
@@ -16406,7 +17048,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 ""
-"ÇAKIŞMA (örtülü dizin yeniden adlandırma): %s konumundaki mevcut dosya/dizin "
+"ÇAKIŞMA (örtülü dizin yeniden adlandırma): %s konumunda var olan dosya/dizin "
"örtülü yeniden adlandırmanın aşağıdaki yolları oraya koymasına engel oluyor: "
"%s."
@@ -16417,7 +17059,7 @@ msgid ""
msgstr ""
"ÇAKIŞMA (örtülü dizin yeniden adlandırma): %s için birden çok yol "
"eşlemlenemiyor; örtülü dizin yeniden adlandırmaları aşağıdaki yolları oraya "
-"koymayı denedi: %s."
+"koymayı denedi: %s"
#, c-format
msgid ""
@@ -16546,13 +17188,44 @@ msgstr ""
"ÇAKIŞMA (değiştir/sil): %s silindi (%s içinde) ve %s içinde değiştirildi. %s "
"sürümü (şunun: %s) ağaçta bırakıldı."
+#. TRANSLATORS: This is a line of advice to resolve a merge
+#. conflict in a submodule. The first argument is the submodule
+#. name, and the second argument is the abbreviated id of the
+#. commit that needs to be merged. For example:
+#. - go to submodule (mysubmodule), and either merge commit abc1234"
+#.
#, c-format
msgid ""
-"Note: %s not up to date and in way of checking out conflicted version; old "
-"copy renamed to %s"
+" - go to submodule (%s), and either merge commit %s\n"
+" or update to an existing commit which has merged those changes\n"
msgstr ""
-"Not: %s güncel değil ve çakışmalı sürümlerin çıkışının önünde; eski kopya %s "
-"olarak yeniden adlandırıldı."
+" - altmodüle gidin (%s) ve %s işlemesini birleştirin\n"
+" veya bu değişiklikleri birleştirmiş var olan bir işlemeye güncelleyin\n"
+
+#, c-format
+msgid ""
+"Recursive merging with submodules currently only supports trivial cases.\n"
+"Please manually handle the merging of each conflicted submodule.\n"
+"This can be accomplished with the following steps:\n"
+"%s - come back to superproject and run:\n"
+"\n"
+" git add %s\n"
+"\n"
+" to record the above merge or update\n"
+" - resolve any other conflicts in the superproject\n"
+" - commit the resulting index in the superproject\n"
+msgstr ""
+"Altmodülle özyineli birleştirme şu anda yalnızca önemsiz durumları "
+"destekler.\n"
+"Her bir çakışan altmodülün birleştirmesini lütfen elle yapın.\n"
+"Bu, aşağıdaki adımlarla gerçekleştirilebilir:\n"
+"%s - yukarıdaki birleştirmeyi kaydetmek veya güncellemek için\n"
+" üst projeye geri gelin ve şunu çalıştırın:\n"
+"\n"
+" git add %s\n"
+"\n"
+" - üst projedeki kalan diğer çakışmaları çözün\n"
+" - üst projedeki sonuç olarak alınan indeksi işleyin\n"
#. TRANSLATORS: The %s arguments are: 1) tree hash of a merge
#. base, and 2-3) the trees for the two trees we're merging.
@@ -16625,6 +17298,21 @@ msgid "Found a possible merge resolution for the submodule:\n"
msgstr "Şu altmodül için olası bir birleştirme çözümü bulundu:\n"
#, c-format
+msgid ""
+"If this is correct simply add it to the index for example\n"
+"by using:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"which will accept this suggestion.\n"
+msgstr ""
+"Eğer bu doğruysa yalnızca indekse ekleyin, örneğin:\n"
+"\n"
+"\tgit update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"komutu bu öneriyi kabul edecektir.\n"
+
+#, c-format
msgid "Failed to merge submodule %s (multiple merges found)"
msgstr "%s altmodülü birleştirilemedi (birden çok birleştirme bulundu)"
@@ -16685,7 +17373,7 @@ msgstr ""
msgid "CONFLICT (rename/add): Rename %s->%s in %s. Added %s in %s"
msgstr ""
"ÇAKIŞMA (yeniden adlandır/ekle): %s->%s olarak adlandırıldı (%s içinde). %s "
-"eklendi (%s içinde)."
+"eklendi (%s içinde)"
#, c-format
msgid "%s is a directory in %s adding as %s instead"
@@ -16699,8 +17387,8 @@ msgstr ""
#, c-format
msgid ""
-"CONFLICT (rename/rename): Rename \"%s\"->\"%s\" in branch \"%s\" rename \"%s"
-"\"->\"%s\" in \"%s\"%s"
+"CONFLICT (rename/rename): Rename \"%s\"->\"%s\" in branch \"%s\" rename "
+"\"%s\"->\"%s\" in \"%s\"%s"
msgstr ""
"ÇAKIŞMA (y. adlandır/y. adlandır): \"%s\"->\"%s\" olarak adlandır (\"%s\" "
"dalında), \"%s\"->\"%s\" olarak adlandır (\"%s\"%s içinde)"
@@ -16711,8 +17399,8 @@ msgstr " (çözülmeden bırakıldı)"
#, c-format
msgid "CONFLICT (rename/rename): Rename %s->%s in %s. Rename %s->%s in %s"
msgstr ""
-"ÇAKIŞMA (y. adlandır/y. adlandır): %s->%s olarak adlandır (%s içinde). %s->"
-"%s olarak adlandır (%s içinde)"
+"ÇAKIŞMA (y. adlandır/y. adlandır): %s->%s olarak adlandır (%s içinde). %s-"
+">%s olarak adlandır (%s içinde)"
#, c-format
msgid ""
@@ -16730,7 +17418,7 @@ msgid ""
">%s in %s"
msgstr ""
"ÇAKIŞMA (y. adlandır/y. adlandır): Dizini %s->%s olarak adlandır (%s "
-"içinde). Dizini %s->%s olarak adlandır (%s içinde)."
+"içinde). Dizini %s->%s olarak adlandır (%s içinde)"
msgid "modify"
msgstr "deÄŸiÅŸtir"
@@ -16740,7 +17428,7 @@ msgstr "deÄŸiÅŸtirilmiÅŸ"
#, c-format
msgid "Skipped %s (merged same as existing)"
-msgstr "%s atlandı (mevcut ile aynı biçimde birleştirildi)"
+msgstr "%s atlandı (var olan ile aynı biçimde birleştirildi)"
#, c-format
msgid "Adding as %s instead"
@@ -16759,7 +17447,7 @@ msgstr "dizin/dosya"
#, c-format
msgid "CONFLICT (%s): There is a directory with name %s in %s. Adding %s as %s"
msgstr ""
-"ÇAKIŞMA (%s): %s adıyla bir dizin var (%s içinde). %s, %s olarak ekleniyor."
+"ÇAKIŞMA (%s): %s adıyla bir dizin var (%s içinde). %s, %s olarak ekleniyor"
#, c-format
msgid "Adding %s"
@@ -16793,7 +17481,19 @@ msgid "failed to read the cache"
msgstr "önbellek okunamadı"
msgid "multi-pack-index OID fanout is of the wrong size"
-msgstr "multi-pack-index OID ikiye bölümünün boyutu hatalı"
+msgstr "multi-pack-index OID çıkış sayısı boyutu yanlış"
+
+#, c-format
+msgid ""
+"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
+msgstr ""
+"oid çıkış sayısı sırasız: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
+
+msgid "multi-pack-index OID lookup chunk is the wrong size"
+msgstr "multi-pack-index OID arama iri parçası yanlış boyutlu"
+
+msgid "multi-pack-index object offset chunk is the wrong size"
+msgstr "multi-pack-index OID nesne ofseti iri parçası yanlış boyutlu"
#, c-format
msgid "multi-pack-index file %s is too small"
@@ -16811,17 +17511,21 @@ msgstr "multi-pack-index sürümü %d tanımlanamıyor"
msgid "multi-pack-index hash version %u does not match version %u"
msgstr "multi-pack-index sağlama sürümü %u, %u sürümü ile eşleşmiyor"
-msgid "multi-pack-index missing required pack-name chunk"
-msgstr "multi-pack-index'ten gerekli pack-name iri parçası eksik"
+msgid "multi-pack-index required pack-name chunk missing or corrupted"
+msgstr "multi-pack-index'ten gerekli pack-name iri parçası eksik veya hasarlı"
+
+msgid "multi-pack-index required OID fanout chunk missing or corrupted"
+msgstr "multi-pack-index'ten gerekli OID fanout iri parçası eksik veya hasarlı"
-msgid "multi-pack-index missing required OID fanout chunk"
-msgstr "multi-pack-index'ten gerekli OID fanout iri parçası eksik"
+msgid "multi-pack-index required OID lookup chunk missing or corrupted"
+msgstr "multi-pack-index'ten gerekli OID arama iri parçası eksik veya hasarlı"
-msgid "multi-pack-index missing required OID lookup chunk"
-msgstr "multi-pack-index'ten gerekli OID arama iri parçası eksik"
+msgid "multi-pack-index required object offsets chunk missing or corrupted"
+msgstr ""
+"multi-pack-index'ten gerekli nesne ofsetleri iri parçası eksik veya hasarlı"
-msgid "multi-pack-index missing required object offsets chunk"
-msgstr "multi-pack-index'ten gerekli nesne ofsetleri iri parçası eksik"
+msgid "multi-pack-index pack-name chunk is too short"
+msgstr "multi-pack-index pack-name iri parçası pek kısa"
#, c-format
msgid "multi-pack-index pack names out of order: '%s' before '%s'"
@@ -16831,9 +17535,19 @@ msgstr "multi-pack-index paket adlarının sırasız: '%s' şundan önce: '%s'"
msgid "bad pack-int-id: %u (%u total packs)"
msgstr "hatalı pack-int-id: %u (%u toplam paket)"
+msgid "MIDX does not contain the BTMP chunk"
+msgstr "MIDX, BTMP iri parçasını içermiyor"
+
+#, c-format
+msgid "could not load bitmapped pack %<PRIu32>"
+msgstr "biteşlemli %<PRIu32> paketi yüklenemedi"
+
msgid "multi-pack-index stores a 64-bit offset, but off_t is too small"
msgstr "multi-pack-index bir 64 bit ofset depoluyor; ancak off_t pek küçük"
+msgid "multi-pack-index large offset out of bounds"
+msgstr "multi-pack-index geniş ofseti sınırlar dışında"
+
#, c-format
msgid "failed to add packfile '%s'"
msgstr "paket dosyası '%s' eklenemedi"
@@ -16858,7 +17572,7 @@ msgid "malformed line: %s"
msgstr "hatalı oluşturulmuş satır: %s"
msgid "ignoring existing multi-pack-index; checksum mismatch"
-msgstr "mevcut multi-pack-index yok sayılıyor; sağlama toplamı uyumsuzluğu"
+msgstr "var olan multi-pack-index yok sayılıyor; sağlama toplamı uyumsuzluğu"
msgid "could not load pack"
msgstr "paket yüklenemedi"
@@ -16903,7 +17617,7 @@ msgid "failed to clear multi-pack-index at %s"
msgstr "multi-pack-index %s konumunda temizlenemedi"
msgid "multi-pack-index file exists, but failed to parse"
-msgstr "multi-pack-index dosyası mevcut, ancak ayrıştırılamadı"
+msgstr "multi-pack-index dosyası var; ancak ayrıştırılamadı"
msgid "incorrect checksum"
msgstr "yanlış sağlama toplamı"
@@ -16911,11 +17625,6 @@ msgstr "yanlış sağlama toplamı"
msgid "Looking for referenced packfiles"
msgstr "Başvurulmuş paket dosyaları aranıyor"
-#, c-format
-msgid ""
-"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
-msgstr "oid fanout sırasız: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
-
msgid "the midx contains no oid"
msgstr "midx bir oid içermiyor"
@@ -17014,10 +17723,6 @@ msgstr "alternatif nesne yolu olağanlaştırılamıyor: %s"
msgid "%s: ignoring alternate object stores, nesting too deep"
msgstr "%s: alternatif nesne depoları yok sayılıyor, iç içe geçme pek derin"
-#, c-format
-msgid "unable to normalize object directory: %s"
-msgstr "nesne dizini olağanlaştırılamıyor: %s"
-
msgid "unable to fdopen alternates lockfile"
msgstr "alternatifler kilit dosyası fdopen yapılamıyor"
@@ -17070,13 +17775,17 @@ msgstr "nesne dosyası %s boş"
#, c-format
msgid "corrupt loose object '%s'"
-msgstr "hasar görmüş gevşek nesne '%s'"
+msgstr "hasarlı gevşek nesne '%s'"
#, c-format
msgid "garbage at end of loose object '%s'"
msgstr "gevşek nesne '%s' sonunda anlamsız veri"
#, c-format
+msgid "unable to open loose object %s"
+msgstr "gevşek nesne %s açılamıyor"
+
+#, c-format
msgid "unable to parse %s header"
msgstr "%s üstbilgisi ayrıştırılamıyor"
@@ -17092,20 +17801,16 @@ msgid "header for %s too long, exceeds %d bytes"
msgstr "%s üstbilgisi pek uzun, %d bayt'ı aşıyor"
#, c-format
-msgid "failed to read object %s"
-msgstr "%s nesnesi okunamadı"
+msgid "loose object %s (stored in %s) is corrupt"
+msgstr "%s gevşek nesnesi (%s içinde depolanıyor) hasarlı"
#, c-format
msgid "replacement %s not found for %s"
msgstr "%s yedeği %s için bulunamadı"
#, c-format
-msgid "loose object %s (stored in %s) is corrupt"
-msgstr "%s gevşek nesnesi (%s içinde depolanıyor) hasar görmüş"
-
-#, c-format
msgid "packed object %s (stored in %s) is corrupt"
-msgstr "paketlenmiş nesne %s (%s içinde depolanıyor) hasar görmüş"
+msgstr "paketlenmiş nesne %s (%s içinde depolanıyor) hasarlı"
#, c-format
msgid "unable to write file %s"
@@ -17115,9 +17820,6 @@ msgstr "%s dosyası yazılamıyor"
msgid "unable to set permission to '%s'"
msgstr "'%s' ögesine izin ayarlanamıyor"
-msgid "file write error"
-msgstr "dosya yazım hatası"
-
msgid "error when closing loose object file"
msgstr "gevşek nesne dosyası kapatılırken hata"
@@ -17144,14 +17846,31 @@ msgid "confused by unstable object source data for %s"
msgstr "%s için olan nesne kaynak verisinden dolayı kafa karışıklığı"
#, c-format
+msgid "write stream object %ld != %<PRIuMAX>"
+msgstr "akış nesnesini yaz %ld != %<PRIuMAX>"
+
+#, c-format
+msgid "unable to stream deflate new object (%d)"
+msgstr "yeni nesne akışı söndürülemiyor (%d)"
+
+#, c-format
+msgid "deflateEnd on stream object failed (%d)"
+msgstr "akış nesnesi üzerinde deflateEnd başarısız (%d)"
+
+#, c-format
+msgid "unable to create directory %s"
+msgstr "%s dizini oluşturulamıyor"
+
+#, c-format
msgid "cannot read object for %s"
msgstr "%s için nesne okunamıyor"
-msgid "corrupt commit"
-msgstr "hasar görmüş işleme"
+#, c-format
+msgid "object fails fsck: %s"
+msgstr "nesne fsck'yi başarısız ediyor: %s"
-msgid "corrupt tag"
-msgstr "hasar görmüş etiket"
+msgid "refusing to create malformed object"
+msgstr "hatalı oluşturulmuş nesne oluşturma reddediliyor"
#, c-format
msgid "read error while indexing %s"
@@ -17284,12 +18003,12 @@ msgstr ""
"oluşturmaz; çünkü 40 onaltılı bir başvuru, onu belirlediğiniz zaman yok\n"
"sayılacaktır. Bu başvurular yanlışlıkla oluşturulmuş olabilir. Örneğin:\n"
"\n"
-"\tgit switch -c $br $(git rev-parse ...)\n"
+" git switch -c $br $(git rev-parse ...)\n"
"\n"
"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 advice.objectNameWarning\" yapın"
#, c-format
msgid "log for '%.*s' only goes back to %s"
@@ -17301,7 +18020,7 @@ msgstr "'%.*s' günlüğünde yalnızca %d girdi var"
#, c-format
msgid "path '%s' exists on disk, but not in '%.*s'"
-msgstr "'%s' yolu disk üzerinde mevcut; ancak '%.*s' içinde değil"
+msgstr "'%s' yolu disk üzerinde var; ancak '%.*s' içinde değil"
#, c-format
msgid ""
@@ -17370,6 +18089,54 @@ msgstr "nesne ayrıştırılamıyor: %s"
msgid "hash mismatch %s"
msgstr "sağlama uyuşmazlığı %s"
+msgid "trying to write commit not in index"
+msgstr "indekste olmayan işleme yazılmaya çalışılıyor"
+
+msgid "failed to load bitmap index (corrupted?)"
+msgstr "biteşlem indeksi yüklenemedi (hasarlı mı?)"
+
+msgid "corrupted bitmap index (too small)"
+msgstr "hasarlı biteşlem indeksi (pek küçük)"
+
+msgid "corrupted bitmap index file (wrong header)"
+msgstr "hasarlı biteşlem indeks dosyası (yanlış üstbilgi)"
+
+#, c-format
+msgid "unsupported version '%d' for bitmap index file"
+msgstr "biteşlem indeks dosyası için desteklenmeyen sürüm '%d'"
+
+msgid "corrupted bitmap index file (too short to fit hash cache)"
+msgstr ""
+"hasarlı biteşlem indeks dosyası (sağlama önbelleğine sığmak için pek küçük)"
+
+msgid "corrupted bitmap index file (too short to fit lookup table)"
+msgstr ""
+"hasarlı biteşlem indeks dosyası (arama tablosuna sığmak için pek küçük)"
+
+#, c-format
+msgid "duplicate entry in bitmap index: '%s'"
+msgstr "biteÅŸlem indeksinde yinelenen girdi: '%s'"
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for entry %d"
+msgstr "hasarlı ewah biteşlemi: %d girdisi için kısaltılmış üstbilgi"
+
+#, c-format
+msgid "corrupt ewah bitmap: commit index %u out of range"
+msgstr "hasarlı ewah biteşlemi: işleme erimi %u, erim dışında"
+
+msgid "corrupted bitmap pack index"
+msgstr "hasarlı biteşlem paket indeksi"
+
+msgid "invalid XOR offset in bitmap pack index"
+msgstr "biteşlem paket indeksinde geçersi XOR ofseti"
+
+msgid "cannot fstat bitmap file"
+msgstr "biteşlem dosyası fstat yapılamıyor"
+
+msgid "checksum doesn't match in MIDX and bitmap"
+msgstr "sağlama toplamı, MIDX ve biteşlem içinde uymuyor"
+
msgid "multi-pack bitmap is missing required reverse index"
msgstr "çoklu paket biteşlemi gereken ters indeksi içermiyor"
@@ -17377,13 +18144,72 @@ 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 "tercih edilen (%s) paket geçersiz"
+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"
+
+msgid "corrupt bitmap lookup table: xor chain exceeds entry count"
+msgstr "hasarlı biteşlem arama tablosu: xor zinciri, girdi sayısını aşıyor"
+
+#, c-format
+msgid "corrupt bitmap lookup table: commit index %u out of range"
+msgstr "hasarlı biteşlem arama tablosu: işleme indeksi %u, erim dışında"
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for bitmap of commit \"%s\""
+msgstr ""
+"hasarlı ewah biteşlemi: \"%s\" işlemesinin biteşleminde kısaltılmış üstbilgi"
+
+#, c-format
+msgid "unable to load pack: '%s', disabling pack-reuse"
+msgstr "paket yüklenemiyor: '%s', pack-reuse devre dışı bırakılıyor"
+
+#, c-format
+msgid "object '%s' not found in type bitmaps"
+msgstr "'%s' nesnesi, tür biteşlemlerinde bulunamadı"
+
+#, c-format
+msgid "object '%s' does not have a unique type"
+msgstr "'%s' nesnesinin benzersiz bir türü yok"
+
+#, c-format
+msgid "object '%s': real type '%s', expected: '%s'"
+msgstr "'%s' nesnesi: gerçek tür '%s', beklenen: '%s'"
#, c-format
-msgid "could not find %s in pack %s at offset %<PRIuMAX>"
-msgstr "%s, %s paketi %<PRIuMAX> ofsetinde bulunamadı"
+msgid "object not in bitmap: '%s'"
+msgstr "nesne, biteÅŸlemde deÄŸil: '%s'"
+
+msgid "failed to load bitmap indexes"
+msgstr "biteşlem indeksi yüklenemedi"
+
+msgid "you must specify exactly one commit to test"
+msgstr "sınamak için tam olarak bir işleme belirtmelisiniz"
+
+#, c-format
+msgid "commit '%s' doesn't have an indexed bitmap"
+msgstr "'%s' iÅŸlemesinin indekslenmiÅŸ bir biteÅŸlemi yok"
+
+msgid "mismatch in bitmap results"
+msgstr "biteşlem sonuçlarında uyuşmazlık"
+
+#, c-format
+msgid "could not find '%s' in pack '%s' at offset %<PRIuMAX>"
+msgstr "öge bulunamadı: '%s'; '%s' paketinde, %<PRIuMAX> ofsetinde"
+
+#, c-format
+msgid "unable to get disk usage of '%s'"
+msgstr "'%s' ögesinin disk kullanımı alınamadı"
+
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "biteşlem dosyası '%s', geçersiz sağlama toplamına iye"
#, c-format
msgid "mtimes file %s is too small"
@@ -17425,6 +18251,19 @@ msgstr "%s reverse-index dosyasının sürümü %<PRIu32> desteklenmiyor"
msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
msgstr "%s reverse-index dosyasının sağlama numarası %<PRIu32> desteklenmiyor"
+msgid "invalid checksum"
+msgstr "geçersiz sağlama toplamı"
+
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr "%<PRIu64> konumunda geçersiz rev-index konumu: %<PRIu32> != %<PRIu32>"
+
+msgid "multi-pack-index reverse-index chunk is the wrong size"
+msgstr "multi-pack-index reverse-index iri parçası yanlış boyutlu"
+
+msgid "could not determine preferred pack"
+msgstr "yeğlenen paket algılanamadı"
+
msgid "cannot both write and verify reverse index"
msgstr "ters indeks dosyası hem yazılıp hem doğrulanamıyor"
@@ -17476,14 +18315,6 @@ msgid "%s requires a value"
msgstr "%s bir deÄŸer gerektiriyor"
#, c-format
-msgid "%s is incompatible with %s"
-msgstr "%s, %s ile uyumsuz"
-
-#, c-format
-msgid "%s : incompatible with something else"
-msgstr "%s: baÅŸka bir ÅŸeyle uyumsuz"
-
-#, c-format
msgid "%s takes no value"
msgstr "%s bir değer almıyor"
@@ -17507,6 +18338,9 @@ msgstr "ÅŸunu mu demek istediniz: '--%s' (iki tire ile)?"
msgid "alias of --%s"
msgstr "şunun arması: --%s"
+msgid "need a subcommand"
+msgstr "bir altkomut gerekli"
+
#, c-format
msgid "unknown option `%s'"
msgstr "bilinmeyen seçenek '%s'"
@@ -17563,6 +18397,10 @@ msgstr " %s"
msgid "-NUM"
msgstr "-SAYI"
+#, c-format
+msgid "opposite of --no-%s"
+msgstr "--no-%s karşıtı"
+
msgid "expiry-date"
msgstr "son kullanım tarihi"
@@ -17578,6 +18416,9 @@ msgstr "daha sessiz ol"
msgid "use <n> digits to display object names"
msgstr "nesne adlarını görüntülemek için <n> basamak kullan"
+msgid "prefixed path to initial superproject"
+msgstr "yol, ilk üst projeye öneklendi"
+
msgid "how to strip spaces and #comments from message"
msgstr "iletiden boşlukları ve #yorumları çıkart"
@@ -17587,7 +18428,15 @@ msgstr "yol belirtecini dosyadan oku"
msgid ""
"with --pathspec-from-file, pathspec elements are separated with NUL character"
msgstr ""
-"--pathspec-from-file ile, yol belirteci ögeleri NUL karakteri ile ayrılır"
+"--pathspec-from-file ile yol belirteci ögeleri NUL karakteri ile ayrılır"
+
+#, c-format
+msgid "bad boolean environment value '%s' for '%s'"
+msgstr "hatalı Boole çevre değeri '%s', '%s' için"
+
+#, c-format
+msgid "failed to parse %s"
+msgstr "%s ayrıştırılamadı"
#, c-format
msgid "Could not make %s writable by group"
@@ -17636,6 +18485,10 @@ msgid "%s: 'literal' and 'glob' are incompatible"
msgstr "%s: 'literal' ve 'glob' birbiriyle uyumsuz"
#, c-format
+msgid "'%s' is outside the directory tree"
+msgstr "'%s', dizin ağacının dışında"
+
+#, c-format
msgid "%s: '%s' is outside repository at '%s'"
msgstr "%s: '%s', '%s' konumunda depo dışında"
@@ -17721,6 +18574,10 @@ msgstr "promisor-remote: alt sürecine getirmek için stdin kapatılamıyor"
msgid "promisor remote name cannot begin with '/': %s"
msgstr "vaatçi uzak konum adı '/' ile başlayamaz: %s"
+#, c-format
+msgid "could not fetch %s from promisor remote"
+msgstr "vaatçi uzak konumundan %s getirilemedi"
+
msgid "object-info: expected flush after arguments"
msgstr "object-info: argümanlardan sonra floş bekleniyordu"
@@ -17756,6 +18613,13 @@ msgid "could not parse log for '%s'"
msgstr "'%s' günlüğü ayrıştırılamadı"
#, c-format
+msgid "invalid extra cruft tip: '%s'"
+msgstr "geçersiz ek süprüntü ucu: '%s'"
+
+msgid "unable to enumerate additional recent objects"
+msgstr "ek son kullanılan nesneler numaralandırılamıyor"
+
+#, c-format
msgid "will not add file alias '%s' ('%s' already exists in index)"
msgstr "dosya arması '%s' eklenmeyecek ('%s' indekste halihazırda var)"
@@ -17776,10 +18640,6 @@ msgid "unable to add '%s' to index"
msgstr "'%s' indekse eklenemiyor"
#, c-format
-msgid "unable to stat '%s'"
-msgstr "'%s' dosyasının bilgileri alınamıyor"
-
-#, c-format
msgid "'%s' appears as both a file and as a directory"
msgstr "'%s' hem bir dosya hem de bir dizin olarak görünüyor"
@@ -17887,10 +18747,6 @@ msgid "failed to convert to a sparse-index"
msgstr "bir sparse-index'e dönüştürülemedi"
#, c-format
-msgid "could not stat '%s'"
-msgstr "'%s' bilgileri alınamadı"
-
-#, c-format
msgid "unable to open git dir: %s"
msgstr "git dizini açılamıyor: %s"
@@ -17906,6 +18762,14 @@ msgstr "'%s' üzerindeki izin bitleri onarılamıyor"
msgid "%s: cannot drop to stage #0"
msgstr "%s: #0 numaralı hazırlama alanına bırakılamıyor"
+#, c-format
+msgid "unexpected diff status %c"
+msgstr "beklenmedik diff durumu %c"
+
+#, c-format
+msgid "remove '%s'\n"
+msgstr "kaldır: '%s'\n"
+
msgid ""
"You can fix this with 'git rebase --edit-todo' and then run 'git rebase --"
"continue'.\n"
@@ -17939,9 +18803,12 @@ msgid ""
"l, label <label> = label current HEAD with a name\n"
"t, reset <label> = reset HEAD to a label\n"
"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
-". create a merge commit using the original merge commit's\n"
-". message (or the oneline, if no original merge commit was\n"
-". specified); use -c <commit> to reword the commit message\n"
+" create a merge commit using the original merge commit's\n"
+" message (or the oneline, if no original merge commit was\n"
+" specified); use -c <commit> to reword the commit message\n"
+"u, update-ref <ref> = track a placeholder for the <ref> to be updated\n"
+" to this position in the new commits. The <ref> is\n"
+" updated at the end of the rebase\n"
"\n"
"These lines can be re-ordered; they are executed from top to bottom.\n"
msgstr ""
@@ -17952,8 +18819,8 @@ msgstr ""
"e, edit <işleme> = işlemeyi kullan; ancak değiştirmek için dur\n"
"s, squash <işleme> = işlemeyi kullan; ancak önceki işleme içine karıştır\n"
"f, fixup [-C | -c] <işleme> = \"squash\" gibi; ancak yalnızca bir önceki\n"
-" işlemenin günlük iletisini tutar (-C kullanılmadıysa,\n"
-" o zaman yalnızca bu işlemenin iletisini tutar; -c, -C\n"
+" işlemenin günlük iletisini tutar (-C kullanılmadıysa\n"
+" o zaman yalnızca bu işlemenin iletisini tut; -c, -C\n"
" ile aynıdır; ancak ek olarak düzenleyiciyi açar)\n"
"x, exec <komut> = komutu (satırın geri kalanı) kabuk kullanarak çalıştır\n"
"b, break = burada dur (daha sonra sürdürmek için 'git rebase --continue')\n"
@@ -17964,9 +18831,12 @@ msgstr ""
". orijinal birleÅŸtirme iÅŸlemesi iletisini kullanarak bir\n"
". birleştirme işlemesi oluştur (veya teksatır, eğer bir orijinal\n"
". birleÅŸtirme iÅŸlemesi belirtilmemiÅŸse). Ä°ÅŸleme iletisini yeniden\n"
-". yazmak için -c <işleme> kullanın.\n"
+". yazmak için -c <işleme> kullan.\n"
+"u, update-ref <baş> = yeni iletilerde <baş>'ın bu konuma güncellenmesi için\n"
+" bir yer tutucu izle. <baÅŸ>, yeniden temellendirmenin\n"
+" sonunda güncellenir\n"
"\n"
-"Bu satırlar yeniden sıralanabilirler, yukarıdan aşağıya çalıştırılırlar.\n"
+"Bu satırlar yeniden sıralanabilirler, yukarıdan aşağıya yürütülürler.\n"
#, c-format
msgid "Rebase %s onto %s (%d command)"
@@ -18035,9 +18905,9 @@ 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' "
-"kullanın.\n"
-"Kullanılabilir davranışlar: ignore, warn, error.\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"
#, c-format
@@ -18060,6 +18930,14 @@ msgid "ahead %d, behind %d"
msgstr "%d önünde, %d arkasında"
#, c-format
+msgid "%%(%.*s) does not take arguments"
+msgstr "%%(%.*s) argüman almıyor"
+
+#, c-format
+msgid "unrecognized %%(%.*s) argument: %s"
+msgstr "tanımlanamayan %%(%.*s) argümanı: %s"
+
+#, c-format
msgid "expected format: %%(color:<color>)"
msgstr "beklenen biçim: %%(color:<renk>)"
@@ -18076,42 +18954,38 @@ msgid "Integer value expected refname:rstrip=%s"
msgstr "Tamsayı değeri şunu bekliyordu: refname:rstrip=%s"
#, c-format
-msgid "unrecognized %%(%s) argument: %s"
-msgstr "tanımlanamayan %%(%s) argümanı: %s"
+msgid "expected %%(trailers:key=<value>)"
+msgstr "%%(trailers:key=<deÄŸer>) bekleniyordu"
#, c-format
-msgid "%%(objecttype) does not take arguments"
-msgstr "%%(objecttype) argüman almıyor"
+msgid "unknown %%(trailers) argument: %s"
+msgstr "bilinmeyen %%(trailers) argümanı: %s"
#, c-format
-msgid "%%(deltabase) does not take arguments"
-msgstr "%%(deltabase) argüman almıyor"
+msgid "positive value expected contents:lines=%s"
+msgstr "pozitif deÄŸer ÅŸunu bekliyordu: contents:lines=%s"
#, c-format
-msgid "%%(body) does not take arguments"
-msgstr "%%(body) argüman almıyor"
+msgid "argument expected for %s"
+msgstr "%s için argüman bekleniyordu"
#, c-format
-msgid "expected %%(trailers:key=<value>)"
-msgstr "%%(trailers:key=<deÄŸer>) bekleniyordu"
+msgid "positive value expected %s=%s"
+msgstr "pozitif deÄŸer ÅŸunu bekliyordu: %s=%s"
#, c-format
-msgid "unknown %%(trailers) argument: %s"
-msgstr "bilinmeyen %%(trailers) argümanı: %s"
+msgid "cannot fully parse %s=%s"
+msgstr "tümüyle ayrıştırılamıyor: %s=%s"
#, c-format
-msgid "positive value expected contents:lines=%s"
-msgstr "pozitif deÄŸer ÅŸunu bekliyordu: contents:lines=%s"
+msgid "value expected %s="
+msgstr "deÄŸer ÅŸunu bekliyordu: %s="
#, c-format
msgid "positive value expected '%s' in %%(%s)"
msgstr "pozitif deÄŸer ÅŸurada '%s' bekliyordu: %%(%s)"
#, c-format
-msgid "unrecognized email option: %s"
-msgstr "tanımlanamayan e-posta seçeneği: %s"
-
-#, c-format
msgid "expected format: %%(align:<width>,<position>)"
msgstr "beklenen biçim: %%(align:<genişlik>,<konum>)"
@@ -18124,12 +18998,16 @@ msgid "unrecognized width:%s"
msgstr "tanımlanamayan genişlik:%s"
#, c-format
+msgid "unrecognized %%(%s) argument: %s"
+msgstr "tanımlanamayan %%(%s) argümanı: %s"
+
+#, c-format
msgid "positive width expected with the %%(align) atom"
msgstr "pozitif genişlik %%(align) ögeciği ile birlikte bekleniyordu"
#, c-format
-msgid "%%(rest) does not take arguments"
-msgstr "%%(rest) argüman almıyor"
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "beklenen biçim: %%(ahead-behind:<işlememsi>)"
#, c-format
msgid "malformed field name: %.*s"
@@ -18177,6 +19055,9 @@ msgstr "bu komut atom %%(%.*s) reddediyor"
msgid "--format=%.*s cannot be used with --python, --shell, --tcl"
msgstr "--format=%.*s, --python, --shell ve --tcl ile kullanılamaz"
+msgid "failed to run 'describe'"
+msgstr "'describe' çalıştırılamadı"
+
#, c-format
msgid "(no branch, rebasing %s)"
msgstr "(dal yok, %s yeniden temellendiriliyor)"
@@ -18238,6 +19119,9 @@ msgstr "anahtar"
msgid "field name to sort on"
msgstr "üzerine sıralanacak alan adı"
+msgid "exclude refs which match pattern"
+msgstr "dizgiyle eşleşen başvuruları dışarıda bırak"
+
#, c-format
msgid "not a reflog: %s"
msgstr "bir başvuru günlüğü değil: %s"
@@ -18327,10 +19211,6 @@ msgid "cannot process '%s' and '%s' at the same time"
msgstr "'%s' ve '%s' aynı anda işlenemiyor"
#, c-format
-msgid "could not remove reference %s"
-msgstr "%s başvurusu kaldırılamadı"
-
-#, c-format
msgid "could not delete reference %s: %s"
msgstr "%s baÅŸvurusu silinemedi: %s"
@@ -18434,6 +19314,13 @@ msgstr "protokol hatası: sha/ref bekleniyordu, '%s' alındı"
msgid "http transport does not support %s"
msgstr "http taşıyıcısı %s desteklemiyor"
+msgid "protocol error: expected '<url> <path>', missing space"
+msgstr "protokol hatası: '<url> <yol>' bekleniyordu, eksik boşluk"
+
+#, c-format
+msgid "failed to download file at URL '%s'"
+msgstr "'%s' URL'sindeki dosya indirilemedi"
+
msgid "git-http-push failed"
msgstr "git-http-push başarısız"
@@ -18460,6 +19347,7 @@ msgstr "birden fazla receivepack verildi, birincisi kullanılıyor"
msgid "more than one uploadpack given, using the first"
msgstr "birden fazla uploadpack verildi, birincisi kullanılıyor"
+#, c-format
msgid "unrecognized value transfer.credentialsInUrl: '%s'"
msgstr "tanımlanamayan değer transfer.credentialsInUrl: '%s'"
@@ -18671,8 +19559,11 @@ msgstr[1] ""
"Sizin dalınız ve '%s' birbirinden uzaklaşmış ve sırasıyla\n"
"her birinde %d ve %d iÅŸleme var.\n"
-msgid " (use \"git pull\" to merge the remote branch into yours)\n"
-msgstr " (uzak dalı kendi dalınıza birleştirmek için \"git pull\" kullanın)\n"
+msgid ""
+" (use \"git pull\" if you want to integrate the remote branch with yours)\n"
+msgstr ""
+" (uzak dalı kendi dalınızla birleştirmek istiyorsanız \"git pull\" "
+"kullanın)\n"
#, c-format
msgid "cannot parse expected object name '%s'"
@@ -18745,10 +19636,6 @@ msgid "no remembered resolution for '%s'"
msgstr "'%s' için hatırlanan çözüm yok"
#, c-format
-msgid "cannot unlink '%s'"
-msgstr "'%s' bağlantısı kesilemiyor"
-
-#, c-format
msgid "Updated preimage for '%s'"
msgstr "'%s' için öngörüntü güncellendi"
@@ -18770,9 +19657,28 @@ msgstr "HEAD revizyonu saptanamadı"
msgid "failed to find tree of %s"
msgstr "%s ögesinin ağacı bulunamadı"
+#, c-format
+msgid "unsupported section for hidden refs: %s"
+msgstr "gizli başvurular için desteklenmeyen bölüm: %s"
+
+msgid "--exclude-hidden= passed more than once"
+msgstr "--exclude-hidden=, birden çok kez geçirildi"
+
+#, c-format
+msgid "resolve-undo records `%s` which is missing"
+msgstr "resolve-undo, kayıp olan '%s' ögesini kaydetmiş"
+
+#, c-format
+msgid "could not get commit for ancestry-path argument %s"
+msgstr "soy yolu argümanı %s için işleme alınamadı"
+
msgid "--unpacked=<packfile> no longer supported"
msgstr "--unpacked=<paketdosyası> artık desteklenmiyor"
+#, c-format
+msgid "invalid option '%s' in --stdin mode"
+msgstr "--stdin kipinde geçersiz seçenek '%s'"
+
msgid "your current branch appears to be broken"
msgstr "geçerli dalınız bozuk gibi görünüyor"
@@ -18790,6 +19696,204 @@ msgstr "-L, -p ve -s dışında başka diff biçimlerini henüz desteklemiyor"
msgid "cannot create async thread: %s"
msgstr "async iş parçacığı oluşturulamadı: %s"
+#, c-format
+msgid "'%s' does not exist"
+msgstr "'%s' yok"
+
+#, c-format
+msgid "could not switch to '%s'"
+msgstr "şuraya geçilemedi: '%s'"
+
+msgid "need a working directory"
+msgstr "bir çalışma dizini gerekiyor"
+
+msgid "Scalar enlistments require a worktree"
+msgstr "Scalar gönüllü kayıtları bir çalışma ağacı gerektiriyor"
+
+#, c-format
+msgid "could not configure %s=%s"
+msgstr "%s=%s yapılandırılamadı"
+
+msgid "could not configure log.excludeDecoration"
+msgstr "log.excludeDecoration yapılandırılamadı"
+
+msgid "could not add enlistment"
+msgstr "gönüllü yazılma eklenemedi"
+
+msgid "could not set recommended config"
+msgstr "önerilen yapılandırma ayarlanamadı"
+
+msgid "could not turn on maintenance"
+msgstr "bakım ayarı açılamadı"
+
+msgid "could not start the FSMonitor daemon"
+msgstr "FSMonitor ardalan süreci başlatılamadı"
+
+msgid "could not turn off maintenance"
+msgstr "bakım ayarı kapatılamadı"
+
+msgid "could not remove enlistment"
+msgstr "gönüllü yazılma kaldırılamadı"
+
+#, c-format
+msgid "remote HEAD is not a branch: '%.*s'"
+msgstr "uzak konum HEAD'i bir dal deÄŸil: '%.*s'"
+
+msgid "failed to get default branch name from remote; using local default"
+msgstr ""
+"uzak konumdan öntanımlı dal adı alınamadı; yerel öntanımlı kullanılıyor"
+
+msgid "failed to get default branch name"
+msgstr "öntanımlı dal adı alınamadı"
+
+msgid "failed to unregister repository"
+msgstr "depo kaydı silinemedi"
+
+msgid "failed to stop the FSMonitor daemon"
+msgstr "FSMonitor ardalan süreci durdurulamadı"
+
+msgid "failed to delete enlistment directory"
+msgstr "gönüllü kayıt dizini silinemedi"
+
+msgid "branch to checkout after clone"
+msgstr "klonlama sonrası çıkış yapılacak dal"
+
+msgid "when cloning, create full working directory"
+msgstr "klonlama sırasında tam çalışma dizini oluştur"
+
+msgid "only download metadata for the branch that will be checked out"
+msgstr "yalnızca çıkış yapılacak dalın üstverisini indir"
+
+msgid "create repository within 'src' directory"
+msgstr "'src' dizininde depo oluÅŸtur"
+
+msgid ""
+"scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n"
+"\t[--[no-]src] <url> [<enlistment>]"
+msgstr ""
+"scalar clone [--single-branch] [--branch <ana-dal>] [--full-clone]\n"
+"\t[--[no-]src] <url> [<yazılma>]"
+
+#, c-format
+msgid "cannot deduce worktree name from '%s'"
+msgstr "'%s' ögesinden çalışma ağacı adı ortaya çıkarılamıyor"
+
+#, c-format
+msgid "directory '%s' exists already"
+msgstr "'%s' dizini halihazırda var"
+
+#, c-format
+msgid "failed to get default branch for '%s'"
+msgstr "'%s' için öntanımlı dal alınamadı"
+
+#, c-format
+msgid "could not configure remote in '%s'"
+msgstr "'%s' içindeki uzak konum yapılandırılamadı"
+
+#, c-format
+msgid "could not configure '%s'"
+msgstr "'%s' yapılandırılamadı"
+
+msgid "partial clone failed; attempting full clone"
+msgstr "kısımsal klonlama başarısız; tam klonlama deneniyor"
+
+msgid "could not configure for full clone"
+msgstr "tam klonlama için yapılandırılamadı"
+
+msgid "scalar diagnose [<enlistment>]"
+msgstr "scalar diagnose [<gönüllükayıt>]"
+
+msgid "`scalar list` does not take arguments"
+msgstr "'scalar list' argüman almıyor"
+
+msgid "scalar register [<enlistment>]"
+msgstr "scalar register [<gönüllükayıt>]"
+
+msgid "reconfigure all registered enlistments"
+msgstr "tüm kaydı yapılmış gönüllü kayıtları yeniden yapılandır"
+
+msgid "scalar reconfigure [--all | <enlistment>]"
+msgstr "scalar reconfigure [--all | <gönüllükayıt>]"
+
+msgid "--all or <enlistment>, but not both"
+msgstr "--all veya <gönüllükayıt>; ancak ikisi değil"
+
+#, c-format
+msgid "could not remove stale scalar.repo '%s'"
+msgstr "eskimiş scalar.repo '%s' kaldırılamadı"
+
+#, c-format
+msgid "removed stale scalar.repo '%s'"
+msgstr "eskimiş scalar.repo '%s' kaldırıldı"
+
+#, c-format
+msgid "repository at '%s' has different owner"
+msgstr "'%s' konumundaki deponun sahibi başkası"
+
+#, c-format
+msgid "repository at '%s' has a format issue"
+msgstr "'%s' konumundaki depoda bir biçim sorunu var"
+
+#, c-format
+msgid "repository not found in '%s'"
+msgstr "'%s' konumunda depo bulunamadı"
+
+#, c-format
+msgid ""
+"to unregister this repository from Scalar, run\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+msgstr ""
+"bu deponun kaydını Scalar'dan kaldırmak için şu komutu çalıştırın:\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+
+msgid ""
+"scalar run <task> [<enlistment>]\n"
+"Tasks:\n"
+msgstr ""
+"scalar run <görev> [<gönüllükayıt>]\n"
+"Görevler:\n"
+
+#, c-format
+msgid "no such task: '%s'"
+msgstr "böyle bir görev yok: '%s'"
+
+msgid "scalar unregister [<enlistment>]"
+msgstr "scalar unregister [<enlistment>]"
+
+msgid "scalar delete <enlistment>"
+msgstr "scalar delete <gönüllükayıt>"
+
+msgid "refusing to delete current working directory"
+msgstr "geçerli çalışma dizinini silme reddediliyor"
+
+msgid "include Git version"
+msgstr "Git sürümünü içer"
+
+msgid "include Git's build options"
+msgstr "Git'in yapı seçeneklerini içer"
+
+msgid "scalar verbose [-v | --verbose] [--build-options]"
+msgstr "scalar verbose [-v | --verbose] [--build-options]"
+
+msgid "-C requires a <directory>"
+msgstr "-C, bir <dizin> gerektiriyor"
+
+#, c-format
+msgid "could not change to '%s'"
+msgstr "'%s' olarak deÄŸiÅŸtirilemedi"
+
+msgid "-c requires a <key>=<value> argument"
+msgstr "-c, bir <anahtar>=<değer> argümanı gerektiriyor"
+
+msgid ""
+"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
+"\n"
+"Commands:\n"
+msgstr ""
+"scalar [-C <dizin>] [-c <anahtar>=<değer>] <komut> [<seçenekler>]\n"
+"\n"
+"Komutlar:\n"
+
msgid "unexpected flush packet while reading remote unpack status"
msgstr "uzak konum açım durumu okunurken beklenmedik floş paketi"
@@ -18892,10 +19996,6 @@ msgid "could not lock '%s'"
msgstr "'%s' kilitlenemedi"
#, c-format
-msgid "could not write to '%s'"
-msgstr "şuraya yazılamadı: '%s'"
-
-#, c-format
msgid "could not write eol to '%s'"
msgstr "satır sonu şuraya yazılamadı: '%s'"
@@ -18910,10 +20010,6 @@ msgstr "%s ile yerel değişikliklerinizin üzerine yazılacaktır."
msgid "commit your changes or stash them to proceed."
msgstr "İlerlemek için değişikliklerinizi işleyin veya zulalayın."
-#, c-format
-msgid "%s: fast-forward"
-msgstr "%s: ileri sar"
-
#. TRANSLATORS: %s will be "revert", "cherry-pick" or
#. "rebase".
#.
@@ -18976,15 +20072,15 @@ msgstr ""
"Eğer bu değişikliklerin bir önceki işlemeye eklenmesi\n"
"gerekiyorsa şu komutu çalıştırın:\n"
"\n"
-"\tgit commit --amend %s\n"
+" git commit --amend %s\n"
"\n"
"Yeni bir işleme yapmak istiyorsanız şu komutu çalıştırın:\n"
"\n"
-"\tgit commit %s\n"
+" git commit %s\n"
"\n"
"Her iki durumda da işiniz bittikten sonra şu komut ile sürdürün:\n"
"\n"
-"\tgit rebase --continue\n"
+" git rebase --continue\n"
msgid "'prepare-commit-msg' hook failed"
msgstr "'prepare-commit-msg' başarısız oldu"
@@ -19149,10 +20245,6 @@ msgid "%s: cannot parse parent commit %s"
msgstr "%s: üst işleme %s ayrıştırılamıyor"
#, c-format
-msgid "could not rename '%s' to '%s'"
-msgstr "'%s', '%s' olarak yeniden adlandırılamadı"
-
-#, c-format
msgid "could not revert %s... %s"
msgstr "%s geri alınamadı... %s"
@@ -19173,6 +20265,23 @@ msgid "git %s: failed to refresh the index"
msgstr "git %s: indeks yenilenemedi"
#, c-format
+msgid "'%s' is not a valid label"
+msgstr "'%s', geçerli bir etiket değil"
+
+#, c-format
+msgid "'%s' is not a valid refname"
+msgstr "'%s', geçerli bir başvuru adı değil"
+
+#, c-format
+msgid "update-ref requires a fully qualified refname e.g. refs/heads/%s"
+msgstr ""
+"update-ref, tümüyle kalifiye bir başvuru adı gerektiriyor; örn. refs/heads/%s"
+
+#, c-format
+msgid "invalid command '%.*s'"
+msgstr "geçersiz komut %.*s"
+
+#, c-format
msgid "%s does not accept arguments: '%s'"
msgstr "%s argüman kabul etmiyor: '%s'"
@@ -19242,9 +20351,6 @@ msgstr "\"git cherry-pick (--continue | %s--abort | --quit)\" deneyin"
msgid "could not create sequencer directory '%s'"
msgstr "ardıştırıcı dizini '%s' oluşturulamadı"
-msgid "could not lock HEAD"
-msgstr "HEAD kilitlenemedi"
-
msgid "no cherry-pick or revert in progress"
msgstr "süren bir seç-al veya geri al yok"
@@ -19323,7 +20429,7 @@ msgstr "%.*s birleÅŸtirilemedi"
#, c-format
msgid "Executing: %s\n"
-msgstr "Çalıştırılıyor: %s\n"
+msgstr "Yürütülüyor: %s\n"
#, c-format
msgid ""
@@ -19333,26 +20439,26 @@ msgid ""
" git rebase --continue\n"
"\n"
msgstr ""
-"Çalıştırma başarısız: %s\n"
+"Yürütme başarısız: %s\n"
"%sSorunu çözüp sürdürmek için şunu çalıştırın:\n"
"\n"
"\tgit rebase --continue\n"
"\n"
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "ve indekse ve/veya çalışma ağacına değişiklikler yapıldı\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "ve indekse ve/veya çalışma ağacına değişiklikler yapıldı.\n"
#, c-format
msgid ""
"execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
"Commit or stash your changes, and then run\n"
"\n"
" git rebase --continue\n"
"\n"
msgstr ""
-"Çalıştırma başarılı oldu: %s,\n"
-"ancak indeksinize ve/veya çalışma ağacınıza değişiklikler bıraktı\n"
+"Yürütme başarılı oldu: %s;\n"
+"ancak indeksinize ve/veya çalışma ağacınıza değişiklikler bıraktı.\n"
"Değişikliklerinizi işleyin veya zulalayın, ardından şunu çalıştırın:\n"
"\n"
"\tgit rebase --continue\n"
@@ -19362,16 +20468,16 @@ msgstr ""
msgid "illegal label name: '%.*s'"
msgstr "izin verilmeyen etiket adı: '%.*s'"
+#, c-format
+msgid "could not resolve '%s'"
+msgstr "'%s' çözülemedi"
+
msgid "writing fake root commit"
msgstr "sahte kök işlemesi yazılıyor"
msgid "writing squash-onto"
msgstr "squash-onto yazılıyor"
-#, c-format
-msgid "could not resolve '%s'"
-msgstr "'%s' çözülemedi"
-
msgid "cannot merge without a current revision"
msgstr "güncel bir revizyon olmadan birleştirilemiyor"
@@ -19384,7 +20490,7 @@ msgid "nothing to merge: '%.*s'"
msgstr "birleÅŸtirilecek bir ÅŸey yok: '%.*s'"
msgid "octopus merge cannot be executed on top of a [new root]"
-msgstr "ahtapot birleştirmesi bir [yeni kök]ün üzerinde çalıştırılamaz"
+msgstr "ahtapot birleştirmesi bir [yeni kök]ün üzerinde yürütülemez"
#, c-format
msgid "could not get commit message of '%s'"
@@ -19397,6 +20503,27 @@ msgstr "şunu birleştirme girişiminde bulunulamadı bile: '%.*s'"
msgid "merge: Unable to write new index file"
msgstr "merge: Yeni indeks dosyası yazılamıyor"
+#, c-format
+msgid ""
+"another 'rebase' process appears to be running; '%s.lock' already exists"
+msgstr "başka bir 'rebase' süreci çalışıyor gibi; '%s.lock' halihazırda var"
+
+#, c-format
+msgid ""
+"Updated the following refs with %s:\n"
+"%s"
+msgstr ""
+"Aşağıdaki başvurular, %s ile güncellendi:\n"
+"%s"
+
+#, c-format
+msgid ""
+"Failed to update the following refs with %s:\n"
+"%s"
+msgstr ""
+"Aşağıdaki başvurular, %s ile güncellenemedi:\n"
+"%s"
+
msgid "Cannot autostash"
msgstr "Kendiliğinden zulalanamıyor"
@@ -19439,6 +20566,9 @@ msgstr "Kendiliğinden zulalama çakışmalara neden oldu."
msgid "Autostash exists; creating a new stash entry."
msgstr "KendiliÄŸinden zulalama mevcut; yeni bir zula girdisi oluÅŸturuluyor."
+msgid "autostash reference is a symref"
+msgstr "kendiliÄŸinden zulalama baÅŸvurusu bir sembol baÅŸvurusu"
+
msgid "could not detach HEAD"
msgstr "HEAD ayrılamadı"
@@ -19461,7 +20591,7 @@ msgid ""
" git rebase --edit-todo\n"
" git rebase --continue\n"
msgstr ""
-"todo komutu çalıştırılamadı.\n"
+"todo komutu yürütülemedi.\n"
"\n"
"\t%.*s\n"
"Yeniden zamanlandı; sürdürmeden önce komutu düzenlemek için lütfen\n"
@@ -19471,14 +20601,14 @@ msgstr ""
"\tgit rebase --continue\n"
#, c-format
-msgid "Rebasing (%d/%d)%s"
-msgstr "Yeniden temellendiriliyor: (%d/%d)%s"
-
-#, c-format
msgid "Stopped at %s... %.*s\n"
msgstr "%s konumunda durdu... %.*s\n"
#, c-format
+msgid "Rebasing (%d/%d)%s"
+msgstr "Yeniden temellendiriliyor: (%d/%d)%s"
+
+#, c-format
msgid "unknown command %d"
msgstr "bilinmeyen komut %d"
@@ -19563,6 +20693,10 @@ msgid "the script was already rearranged."
msgstr "betik halihazırda yeniden düzenlenmişti."
#, c-format
+msgid "update-refs file at '%s' is invalid"
+msgstr "'%s' konumundaki update-refs dosyası geçersiz"
+
+#, c-format
msgid "'%s' is outside repository at '%s'"
msgstr "'%s', '%s' konumunda depo dışında"
@@ -19681,17 +20815,21 @@ msgstr ""
#, c-format
msgid ""
-"unsafe repository ('%s' is owned by someone else)\n"
-"To add an exception for this directory, call:\n"
+"detected dubious ownership in repository at '%s'\n"
+"%sTo add an exception for this directory, call:\n"
"\n"
"\tgit config --global --add safe.directory %s"
msgstr ""
-"güvensiz depo ('%s' sahibi bir başkası)\n"
-"Bu dizin için bir istisna eklemek için şunu çağırın:\n"
+"'%s' konumundaki depoda belirsiz iyelik algılandı\n"
+"%sBu dizin için istisna eklemek için şunu çağırın:\n"
"\n"
"\tgit config --global --add safe.directory %s"
#, c-format
+msgid "cannot use bare repository '%s' (safe.bareRepository is '%s')"
+msgstr "çıplak depo '%s', kullanılamaz (safe.bareRepository '%s')"
+
+#, c-format
msgid ""
"problem with core.sharedRepository filemode value (0%.3o).\n"
"The owner of files must always have read and write permissions."
@@ -19706,6 +20844,82 @@ msgid "setsid failed"
msgstr "setsid başarısız"
#, c-format
+msgid "cannot stat template '%s'"
+msgstr "'%s' şablonunun bilgileri alınamıyor"
+
+#, c-format
+msgid "cannot opendir '%s'"
+msgstr "'%s' opendir yapılamıyor"
+
+#, c-format
+msgid "cannot readlink '%s'"
+msgstr "'%s' readlink yapılamıyor"
+
+#, c-format
+msgid "cannot symlink '%s' '%s'"
+msgstr "'%s', '%s' ögesine sembolik bağla bağlanamıyor"
+
+#, c-format
+msgid "cannot copy '%s' to '%s'"
+msgstr "'%s' şuraya kopyalanamıyor: '%s'"
+
+#, c-format
+msgid "ignoring template %s"
+msgstr "%s şablonu yok sayılıyor"
+
+#, c-format
+msgid "templates not found in %s"
+msgstr "şablonlar %s içinde bulunamadı"
+
+#, c-format
+msgid "not copying templates from '%s': %s"
+msgstr "şablonlar '%s' konumundan kopyalanmıyor: %s"
+
+#, c-format
+msgid "invalid initial branch name: '%s'"
+msgstr "geçersiz başlangıç dalı adı: '%s'"
+
+#, c-format
+msgid "re-init: ignored --initial-branch=%s"
+msgstr "re-init: --initial-branch=%s yok sayıldı"
+
+#, c-format
+msgid "unable to handle file type %d"
+msgstr "%d dosya türü ele alınamıyor"
+
+#, c-format
+msgid "unable to move %s to %s"
+msgstr "%s şuraya taşınamıyor: %s"
+
+msgid "attempt to reinitialize repository with different hash"
+msgstr "depoyu baÅŸka bir saÄŸlama ile yeniden ilklendirme deneniyor"
+
+msgid ""
+"attempt to reinitialize repository with different reference storage format"
+msgstr ""
+"depo başka bir başvuru depolama biçimiyle yeniden ilklendirilmeye çalışılıyor"
+
+#, c-format
+msgid "%s already exists"
+msgstr "%s halihazırda var"
+
+#, c-format
+msgid "Reinitialized existing shared Git repository in %s%s\n"
+msgstr "%s%s içindeki var olan paylaşılan Git deposu yeniden ilklendirildi\n"
+
+#, c-format
+msgid "Reinitialized existing Git repository in %s%s\n"
+msgstr "%s%s içindeki var olan Git deposu yeniden ilklendirildi\n"
+
+#, c-format
+msgid "Initialized empty shared Git repository in %s%s\n"
+msgstr "%s%s içinde paylaşılan boş Git deposu ilklendirildi\n"
+
+#, c-format
+msgid "Initialized empty Git repository in %s%s\n"
+msgstr "%s%s içinde boş Git deposu ilklendirildi\n"
+
+#, c-format
msgid "index entry is a directory, but not sparse (%08x)"
msgstr "indeks girdisi bir dizin; ancak aralıklı değil (%08x)"
@@ -19757,10 +20971,6 @@ msgstr[0] "%u bayt/sn"
msgstr[1] "%u bayt/sn"
#, c-format
-msgid "could not edit '%s'"
-msgstr "'%s' düzenlenemedi"
-
-#, c-format
msgid "ignoring suspicious submodule name: %s"
msgstr "kuşku doğuran altmodül yok sayılıyor: %s"
@@ -19938,18 +21148,31 @@ msgstr "ls-tree beklenmedik bir biçimde %d kodu ile çıktı"
msgid "failed to lstat '%s'"
msgstr "'%s', lstat yapılamadı"
-msgid "unhandled options"
-msgstr "beklenmeyen seçenekler"
+msgid "no remote configured to get bundle URIs from"
+msgstr "demet URI'lerini almak için bir uzak konum yapılandırılmamış"
-msgid "error preparing revisions"
-msgstr "revizyonlar hazırlanırken hata"
+#, c-format
+msgid "remote '%s' has no configured URL"
+msgstr "'%s' uzak konumunun yapılandırılmış bir URL'si yok"
+
+msgid "could not get the bundle-uri list"
+msgstr "bundle-uri listesi alınamadı"
+
+msgid "test-tool cache-tree <options> (control|prime|update)"
+msgstr "test-tool cache-tree <seçenekler> (control|prime|update)"
+
+msgid "clear the cache tree before each iteration"
+msgstr "her bir yinelemeden önce önbellek ağacını temizle"
+
+msgid "number of entries in the cache tree to invalidate (default 0)"
+msgstr "önbellek ağacındaki geçersizleştirilecek girdi sayısı (öntanımlı 0)"
#, c-format
msgid "commit %s is not marked reachable"
msgstr "%s işlemesi ulaşılabilir olarak imlenmedi"
msgid "too many commits marked reachable"
-msgstr "çok fazla işleme ulaşılabilir olarak imlenmiş"
+msgstr "pek fazla işleme ulaşılabilir olarak imlenmiş"
msgid "test-tool serve-v2 [<options>]"
msgstr "test-tool serve-v2 [<seçenekler>]"
@@ -20097,9 +21320,6 @@ msgstr "uzak servis yolu ayarlama protokol tarafından desteklenmiyor"
msgid "invalid remote service path"
msgstr "geçersiz uzak konum servis yolu"
-msgid "operation not supported by protocol"
-msgstr "işlem protokol tarafından desteklenmiyor"
-
#, c-format
msgid "can't connect to subservice %s"
msgstr "%s altservisine bağlanılamıyor"
@@ -20230,10 +21450,6 @@ msgid "support for protocol v2 not implemented yet"
msgstr "protokol v2 desteği henüz yerine getirilmedi"
#, c-format
-msgid "unknown value for config '%s': %s"
-msgstr "'%s' yapılandırması için bilinmeyen değer: %s"
-
-#, c-format
msgid "transport '%s' not allowed"
msgstr "'%s' taşıyıcısına izin verilmiyor"
@@ -20280,6 +21496,15 @@ msgstr "Ä°ptal ediliyor."
msgid "failed to push all needed submodules"
msgstr "gereken tüm altmodüller itilemedi"
+msgid "bundle-uri operation not supported by protocol"
+msgstr "bundle-uri işlemi protokol tarafından desteklenmiyor"
+
+msgid "could not retrieve server-advertised bundle-uri list"
+msgstr "sunucu tarafından tanıtılan bundle-uri listesi alınamadı"
+
+msgid "operation not supported by protocol"
+msgstr "işlem protokol tarafından desteklenmiyor"
+
msgid "too-short tree object"
msgstr "ağaç nesnesi çok kısa"
@@ -20555,6 +21780,18 @@ msgstr "geçersiz kapı numarası"
msgid "invalid '..' path segment"
msgstr "geçersiz '..' yol kesimi"
+msgid "usage: "
+msgstr "kullanım: "
+
+msgid "fatal: "
+msgstr "onulmaz: "
+
+msgid "error: "
+msgstr "hata: "
+
+msgid "warning: "
+msgstr "uyarı: "
+
msgid "Fetching objects"
msgstr "Nesneler getiriliyor"
@@ -20654,6 +21891,9 @@ msgstr "'%s' eriÅŸilemiyor"
msgid "unable to get current working directory"
msgstr "geçerli çalışma dizini alınamıyor"
+msgid "unable to get random bytes"
+msgstr "rastgele baytlar alınamıyor"
+
msgid "Unmerged paths:"
msgstr "BirleÅŸtirilmemiÅŸ yollar:"
@@ -20696,8 +21936,8 @@ msgstr " (işlenecekleri güncellemek için \"git add/rm <dosya>...\" kullanın
msgid ""
" (use \"git restore <file>...\" to discard changes in working directory)"
msgstr ""
-" (çalışma dizinindeki değişiklikleri atmak için \"git restore <dosya>...\" "
-"kullanın)"
+" (çalışma dizinindeki değişiklikleri atmak için\n"
+" \"git restore <dosya>...\" kullanın)"
msgid " (commit or discard the untracked or modified content in submodules)"
msgstr " (altmodüllerdeki izlenmeyen/değiştirilen içeriği gönder veya at)"
@@ -20997,13 +22237,18 @@ msgstr "Yok sayılan dosyalar"
#, c-format
msgid ""
-"It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
-"may speed it up, but you have to be careful not to forget to add\n"
-"new files yourself (see 'git help status')."
+"It took %.2f seconds to enumerate untracked files,\n"
+"but the results were cached, and subsequent runs may be faster."
msgstr ""
-"İzlenmeyen dosyaların ortaya dökülmesi %.2f saniye sürdü. 'status -uno'\n"
-"bunu hızlandırabilir; ancak yeni dosyaları eklemeyi unutmamanız\n"
-"konusunda dikkatli olmalısınız (ek bilgi için 'git help status')."
+"İzlenmeyen dosyaları ortaya dökme %.2f saniye sürdü;\n"
+"ancak sonuçlar önbelleğe alındı ve sonrakiler daha hızlı olabilir."
+
+#, c-format
+msgid "It took %.2f seconds to enumerate untracked files."
+msgstr "İzlenmeyen dosyaları ortaya dökme %.2f saniye sürdü."
+
+msgid "See 'git help status' for information on how to improve this."
+msgstr "Bunu iyileştirme üzerine bilgi için 'git help status'a bakın."
#, c-format
msgid "Untracked files not listed%s"
@@ -21030,8 +22275,8 @@ msgid ""
"nothing added to commit but untracked files present (use \"git add\" to "
"track)\n"
msgstr ""
-"işlemeye bir şey eklenmedi; ancak izlenmeyen dosyalar var (izlemek için "
-"\"git add\" kullanın)\n"
+"iÅŸlemeye bir ÅŸey eklenmedi; ancak izlenmeyen dosyalar var\n"
+" (izlemek için \"git add\" kullanın)\n"
#, c-format
msgid "nothing added to commit but untracked files present\n"
@@ -21040,8 +22285,8 @@ msgstr "iÅŸlemeye bir ÅŸey eklenmedi; ancak izlenmeyen dosyalar var\n"
#, c-format
msgid "nothing to commit (create/copy files and use \"git add\" to track)\n"
msgstr ""
-"İşlenecek bir şey yok (dosyalar oluşturun/kopyalayın ve izlemek için \"git "
-"add\" kullanın)\n"
+"Ä°ÅŸlenecek bir ÅŸey yok\n"
+" (dosyalar oluşturun/kopyalayın ve izlemek için \"git add\" kullanın)\n"
#, c-format
msgid "nothing to commit\n"
@@ -21083,6 +22328,10 @@ msgstr "Ek olarak, indeksiniz işlenmemiş değişiklikler içeriyor."
msgid "cannot %s: Your index contains uncommitted changes."
msgstr "%s yapılamıyor: İndeksiniz işlenmemiş değişiklikler içeriyor."
+#, c-format
+msgid "unknown style '%s' given for '%s'"
+msgstr "'%s' bilinmeyen biçemi şunun için verildi: '%s'"
+
msgid ""
"Error: Your local changes to the following files would be overwritten by "
"merge"
@@ -21147,291 +22396,6 @@ msgstr "Bu komutu çalışma ağacının en üst düzeyinden çalıştırmanız
msgid "Unable to determine absolute path of git directory"
msgstr "Git dizininin kesin yolu algılanamıyor"
-#. TRANSLATORS: you can adjust this to align "git add -i" status menu
-#, perl-format
-msgid "%12s %12s %s"
-msgstr "%12s %12s %s"
-
-#, perl-format
-msgid "touched %d path\n"
-msgid_plural "touched %d paths\n"
-msgstr[0] "%d yola dokunuldu\n"
-msgstr[1] "%d yola dokunuldu\n"
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for staging."
-msgstr ""
-"Eğer yama sorunsuzca uygulanırsa düzenlenen parça derhal hazırlama\n"
-"için imlenecektir."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for stashing."
-msgstr ""
-"Eğer yama sorunsuzca uygulanırsa düzenlenen parça derhal zulalama\n"
-"için imlenecektir."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for unstaging."
-msgstr ""
-"Eğer yama sorunsuzca uygulanırsa, düzenlenen parça derhal hazırlıktan\n"
-"çıkarılma için imlenecektir."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for applying."
-msgstr ""
-"Eğer yama sorunsuzca uygulanırsa düzenlenen parça derhal uygulama\n"
-"için imlenecektir."
-
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for discarding."
-msgstr ""
-"Eğer yama sorunsuzca uygulanırsa düzenlenen parça derhal ıskartaya\n"
-"çıkarım için imlenecektir."
-
-#, perl-format
-msgid "failed to open hunk edit file for writing: %s"
-msgstr "parça düzenleme dosyası yazım için açılamadı: %s"
-
-#, perl-format
-msgid ""
-"---\n"
-"To remove '%s' lines, make them ' ' lines (context).\n"
-"To remove '%s' lines, delete them.\n"
-"Lines starting with %s will be removed.\n"
-msgstr ""
-"---\n"
-"'%s' satır kaldırmak için onları ' ' satır yapın (bağlam).\n"
-"'%s' satır kaldırmak için onları silin.\n"
-"%s ile başlayan satırlar kaldırılacaktır.\n"
-
-#, perl-format
-msgid "failed to open hunk edit file for reading: %s"
-msgstr "parça düzenleme dosyası okuma için açılamadı: %s"
-
-msgid ""
-"y - stage this hunk\n"
-"n - do not stage this hunk\n"
-"q - quit; do not stage this hunk or any of the remaining ones\n"
-"a - stage this hunk and all later hunks in the file\n"
-"d - do not stage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - bu parçayı hazırla\n"
-"n - bu parçayı hazırlama\n"
-"q - çık; bu parçayı veya kalanlardan herhangi birini hazırlama\n"
-"a - bu parçayı ve sonraki tüm parçaları hazırla\n"
-"d - bu parçayı veya sonraki parçalardan herhangi birini hazırlama"
-
-msgid ""
-"y - stash this hunk\n"
-"n - do not stash this hunk\n"
-"q - quit; do not stash this hunk or any of the remaining ones\n"
-"a - stash this hunk and all later hunks in the file\n"
-"d - do not stash this hunk or any of the later hunks in the file"
-msgstr ""
-"y - bu parçayı zulala\n"
-"n - bu parçayı zulalama\n"
-"q - çık; bu parçayı veya kalanlardan herhangi birini zulalama\n"
-"a - bu parçayı ve sonraki tüm parçaları zulala\n"
-"d - bu parçayı veya sonraki parçalardan herhangi birini zulalama"
-
-msgid ""
-"y - unstage this hunk\n"
-"n - do not unstage this hunk\n"
-"q - quit; do not unstage this hunk or any of the remaining ones\n"
-"a - unstage this hunk and all later hunks in the file\n"
-"d - do not unstage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - bu parçayı hazırlıktan çıkar\n"
-"n - bu parçayı hazırlıktan çıkarma\n"
-"q - çık; bu parçayı veya kalanlardan herhangi birini hazırlıktan çıkarma\n"
-"a - bu parçayı ve sonraki tüm parçaları hazırlıktan çıkar\n"
-"d - bu parçayı veya sonraki parçalardan herhangi birini hazırlıktan çıkarma"
-
-msgid ""
-"y - apply this hunk to index\n"
-"n - do not apply this hunk to index\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - bu parçayı indekse uygula\n"
-"n - bu parçayı indekse uygulama\n"
-"q - çık; bu parçayı veya kalanlardan herhangi birini uygulama\n"
-"a - bu parçayı ve sonraki tüm parçaları uygula\n"
-"d - bu parçayı veya sonraki parçalardan herhangi birini uygulama"
-
-msgid ""
-"y - discard this hunk from worktree\n"
-"n - do not discard this hunk from worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - bu parçayı çalışma ağacından at\n"
-"n - bu parçayı çalışma ağacından atma\n"
-"q - çık; bu parçayı veya kalanlardan herhangi birini atma\n"
-"a - bu parçayı ve sonraki tüm parçaları at\n"
-"d - bu parçayı veya sonraki parçalardan herhangi birini atma"
-
-msgid ""
-"y - discard this hunk from index and worktree\n"
-"n - do not discard this hunk from index and worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - bu parçayı çalışma ağacından ve indeksten at\n"
-"n - bu parçayı çalışma ağacından ve indeksten atma\n"
-"q - çık; bu parçayı veya kalanlardan herhangi birini atma\n"
-"a - bu parçayı ve sonraki tüm parçaları at\n"
-"d - bu parçayı veya sonraki parçalardan herhangi birini atma"
-
-msgid ""
-"y - apply this hunk to index and worktree\n"
-"n - do not apply this hunk to index and worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - bu parçayı indekse ve çalışma ağacına uygula\n"
-"n - bu parçayı indekse ve çalışma ağacına uygulama\n"
-"q - çık; bu parçayı veya kalanlardan herhangi birini uygulama\n"
-"a - bu parçayı ve sonraki tüm parçaları uygula\n"
-"d - bu parçayı veya sonraki parçalardan herhangi birini uygulama"
-
-msgid ""
-"y - apply this hunk to worktree\n"
-"n - do not apply this hunk to worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - bu parçayı çalışma ağacına uygula\n"
-"n - bu parçayı çalışma ağacına uygulama\n"
-"q - çık; bu parçayı veya kalanlardan herhangi birini uygulama\n"
-"a - bu parçayı ve sonraki tüm parçaları uygula\n"
-"d - bu parçayı veya sonraki parçalardan herhangi birini uygulama"
-
-msgid ""
-"g - select a hunk to go to\n"
-"/ - search for a hunk matching the given regex\n"
-"j - leave this hunk undecided, see next undecided hunk\n"
-"J - leave this hunk undecided, see next hunk\n"
-"k - leave this hunk undecided, see previous undecided hunk\n"
-"K - leave this hunk undecided, see previous hunk\n"
-"s - split the current hunk into smaller hunks\n"
-"e - manually edit the current hunk\n"
-"? - print help\n"
-msgstr ""
-"g - gidilecek bir parça seç\n"
-"/ - verilen düzenli ifade ile eşleşen bir parça ara\n"
-"j - bu parça için sonra karar ver, bir sonraki karar verilmemiş parçayı gör\n"
-"J - bu parça için sonra karar ver, bir sonraki parçayı gör\n"
-"k - bu parça için sonra karar ver, bir önceki karar verilmemiş parçayı gör\n"
-"K - bu parça için sonra karar ver, bir önceki parçayı gör\n"
-"s - geçerli parçayı daha ufak parçalara böl\n"
-"e - geçerli parçayı el ile düzenle\n"
-"? - yardımı yazdır\n"
-
-msgid "The selected hunks do not apply to the index!\n"
-msgstr "Seçili parçalar indekse uygulanamıyor!\n"
-
-#, perl-format
-msgid "ignoring unmerged: %s\n"
-msgstr "birleştirilmeyenler yok sayılıyor: %s\n"
-
-#, perl-format
-msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
-msgstr "Kip değişimi çalışma ağacına uygulansın mı [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
-msgstr "Silme çalışma ağacına uygulansın mı [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
-msgstr "Ekleme çalışma ağacına uygulansın mı [y,n,q,a,d%s,?]? "
-
-#, perl-format
-msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
-msgstr "Bu parça çalışma ağacına uygulansın mı [y,n,q,a,d%s,?]? "
-
-msgid "No other hunks to goto\n"
-msgstr "Gidilecek başka parça yok\n"
-
-#, perl-format
-msgid "Invalid number: '%s'\n"
-msgstr "Geçersiz sayı: '%s'\n"
-
-#, perl-format
-msgid "Sorry, only %d hunk available.\n"
-msgid_plural "Sorry, only %d hunks available.\n"
-msgstr[0] "Üzgünüm, yalnızca %d parça kullanılabilir.\n"
-msgstr[1] "Üzgünüm, yalnızca %d parça kullanılabilir.\n"
-
-msgid "No other hunks to search\n"
-msgstr "Aranacak başka parça yok\n"
-
-#, perl-format
-msgid "Malformed search regexp %s: %s\n"
-msgstr "Hatalı oluşturulmuş arama düzenli ifadesi %s: %s\n"
-
-msgid "No hunk matches the given pattern\n"
-msgstr "Verilen dizgi ile hiçbir parça eşleşmiyor\n"
-
-msgid "No previous hunk\n"
-msgstr "Öncesinde parça yok\n"
-
-msgid "No next hunk\n"
-msgstr "Sonrasında parça yok\n"
-
-msgid "Sorry, cannot split this hunk\n"
-msgstr "Üzgünüm, bu parça bölünemiyor\n"
-
-#, perl-format
-msgid "Split into %d hunk.\n"
-msgid_plural "Split into %d hunks.\n"
-msgstr[0] "%d parçaya bölündü.\n"
-msgstr[1] "%d parçaya bölündü.\n"
-
-msgid "Sorry, cannot edit this hunk\n"
-msgstr "Üzgünüm, bu parça düzenlenemiyor\n"
-
-#. TRANSLATORS: please do not translate the command names
-#. 'status', 'update', 'revert', etc.
-msgid ""
-"status - show paths with changes\n"
-"update - add working tree state to the staged set of changes\n"
-"revert - revert staged set of changes back to the HEAD version\n"
-"patch - pick hunks and update selectively\n"
-"diff - view diff between HEAD and index\n"
-"add untracked - add contents of untracked files to the staged set of "
-"changes\n"
-msgstr ""
-"status - değişiklik içeren yolları göster\n"
-"update - çalışma ağacı durumunu hazırlanan değişiklik setine ekle\n"
-"revert - hazırlanan değişiklik setini HEAD sürümüne geri al\n"
-"patch - parçaları seç ve seçici olarak güncelle\n"
-"diff - HEAD ve indeks arasındaki diff'i (ayrımları) görüntüle\n"
-"add untracked - izlenmeyen dosyaların içeriğini hazırlanan değişiklik setine "
-"ekle\n"
-
-msgid "missing --"
-msgstr "-- eksik"
-
-#, perl-format
-msgid "unknown --patch mode: %s"
-msgstr "bilinmeyen --patch kipi: %s"
-
-#, perl-format
-msgid "invalid argument %s, expecting --"
-msgstr "geçersiz argüman %s, -- bekleniyor"
-
msgid "local zone differs from GMT by a non-minute interval\n"
msgstr "yerel dilim GMT'den bir dakikadan az bir aralıkla ayrımlı\n"
@@ -21550,13 +22514,13 @@ msgstr ""
"Bir özet göndermek istemiyorsanız gövde kısmını temizleyin.\n"
#, perl-format
-msgid "Failed to open %s: %s"
-msgstr "%s açılamadı: %s"
-
-#, perl-format
msgid "Failed to open %s.final: %s"
msgstr "%s.final açılamadı: %s"
+#, perl-format
+msgid "Failed to open %s: %s"
+msgstr "%s açılamadı: %s"
+
msgid "Summary email is empty, skipping it\n"
msgstr "Özet e-postası boş, atlanıyor\n"
@@ -21706,15 +22670,19 @@ msgstr "(body) Cc: %s, '%s' satırından ekleniyor\n"
#, perl-format
msgid "(%s) Could not execute '%s'"
-msgstr "(%s) '%s' çalıştırılamadı"
+msgstr "(%s) '%s' yürütülemedi"
#, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) %s: %s, '%s' konumundan ekleniyor\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) '%s' ögesinden hatalı oluşturulmuş çıktı"
#, perl-format
msgid "(%s) failed to close pipe to '%s'"
-msgstr "(%s) şuraya olan veri yolu kapatılamadı: '%s'"
+msgstr "(%s) şuraya olan veriyolu kapatılamadı: '%s'"
+
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) %s: %s, '%s' konumundan ekleniyor\n"
msgid "cannot send message as 7bit"
msgstr "ileti 7 bit olarak gönderilemiyor"
diff --git a/po/uk.po b/po/uk.po
new file mode 100644
index 0000000..0507e38
--- /dev/null
+++ b/po/uk.po
@@ -0,0 +1,22978 @@
+# Ukrainian translation for Git package.
+# УкраїнÑький переклад пакету Git.
+# Copyright (c) 2023 Arkadii Yakovets.
+# Copyright (c) 2023 Kateryna Golovanova.
+# This file is distributed under the same license as the Git package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Git v2.43\n"
+"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
+"POT-Creation-Date: 2023-11-09 14:26-0800\n"
+"PO-Revision-Date: 2024-02-11 09:26-0800\n"
+"Last-Translator: Arkadii Yakovets <ark@cho.red>\n"
+"Language-Team: Ukrainian <https://github.com/arkid15r/git-uk-l10n/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
+"n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
+"X-Generator: Poedit 3.4.2\n"
+
+#, c-format
+msgid "Huh (%s)?"
+msgstr "Га (%s)?"
+
+msgid "could not read index"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ індекÑ"
+
+msgid "binary"
+msgstr "бінарний"
+
+msgid "nothing"
+msgstr "нічого"
+
+msgid "unchanged"
+msgstr "без змін"
+
+msgid "Update"
+msgstr "Оновити"
+
+#, c-format
+msgid "could not stage '%s'"
+msgstr "не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ до індекÑу %s"
+
+msgid "could not write index"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати індекÑ"
+
+#, c-format
+msgid "updated %d path\n"
+msgid_plural "updated %d paths\n"
+msgstr[0] "оновлено %d шлÑÑ…\n"
+msgstr[1] "оновлено %d шлÑхи\n"
+msgstr[2] "оновлено %d шлÑхів\n"
+
+#, c-format
+msgid "note: %s is untracked now.\n"
+msgstr "примітка: %s зараз не відÑтежуєтьÑÑ.\n"
+
+#, c-format
+msgid "make_cache_entry failed for path '%s'"
+msgstr "невдала Ñпроба make_cache_entry Ð´Ð»Ñ ÑˆÐ»Ñху \"%s\""
+
+msgid "Revert"
+msgstr "Вивернути"
+
+msgid "Could not parse HEAD^{tree}"
+msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ HEAD^{tree}"
+
+#, c-format
+msgid "reverted %d path\n"
+msgid_plural "reverted %d paths\n"
+msgstr[0] "вивернуто %d шлÑÑ…\n"
+msgstr[1] "вивернуто %d шлÑхи\n"
+msgstr[2] "вивернуто %d шлÑхів\n"
+
+#, c-format
+msgid "No untracked files.\n"
+msgstr "ÐевідÑтежуваних файлів немає\n"
+
+msgid "Add untracked"
+msgstr "Додати невідÑтежувані"
+
+#, c-format
+msgid "added %d path\n"
+msgid_plural "added %d paths\n"
+msgstr[0] "додано %d шлÑÑ…\n"
+msgstr[1] "додано %d шлÑхи\n"
+msgstr[2] "додано %d шлÑхів\n"
+
+#, c-format
+msgid "ignoring unmerged: %s"
+msgstr "ігноруютьÑÑ Ð½Ðµ злиті запиÑи: %s"
+
+#, c-format
+msgid "Only binary files changed.\n"
+msgstr "ЗмінилиÑÑ Ð»Ð¸ÑˆÐµ бінарні файли.\n"
+
+#, c-format
+msgid "No changes.\n"
+msgstr "Ðічого не змінено.\n"
+
+msgid "Patch update"
+msgstr "ÐžÐ½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð»Ð°Ñ‚ÐºÐ¸"
+
+msgid "Review diff"
+msgstr "ПереглÑнути різницю"
+
+msgid "show paths with changes"
+msgstr "показати шлÑхи зі змінами"
+
+msgid "add working tree state to the staged set of changes"
+msgstr "додати Ñтан робочого дерева до індекÑу"
+
+msgid "revert staged set of changes back to the HEAD version"
+msgstr "вивернути зміни індекÑу до верÑÑ–Ñ— HEAD"
+
+msgid "pick hunks and update selectively"
+msgstr "вибирати шматки і оновлювати вибірково"
+
+msgid "view diff between HEAD and index"
+msgstr "переглÑнути різницю між HEAD та індекÑом"
+
+msgid "add contents of untracked files to the staged set of changes"
+msgstr "додати вміÑÑ‚ невідÑтежуваних файлів до індекÑу"
+
+msgid "Prompt help:"
+msgstr "Підказка по опціÑм:"
+
+msgid "select a single item"
+msgstr "вибрати один елемент"
+
+msgid "select a range of items"
+msgstr "вибрати діапазон елементів"
+
+msgid "select multiple ranges"
+msgstr "вибрати кілька діапазонів"
+
+msgid "select item based on unique prefix"
+msgstr "вибрати елемент за унікальним префікÑом"
+
+msgid "unselect specified items"
+msgstr "знÑти позначку із зазначених елементів"
+
+msgid "choose all items"
+msgstr "вибрати вÑÑ– елементи"
+
+msgid "(empty) finish selecting"
+msgstr "(пуÑто) закінчити вибір"
+
+msgid "select a numbered item"
+msgstr "вибрати пронумерований елемент"
+
+msgid "(empty) select nothing"
+msgstr "(пуÑто) нічого не вибирати"
+
+msgid "*** Commands ***"
+msgstr "*** Команди ***"
+
+msgid "What now"
+msgstr "Що тепер"
+
+msgid "staged"
+msgstr "в індекÑÑ–"
+
+msgid "unstaged"
+msgstr "поза індекÑом"
+
+msgid "path"
+msgstr "шлÑÑ…"
+
+msgid "could not refresh index"
+msgstr "не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ індекÑ"
+
+#, c-format
+msgid "Bye.\n"
+msgstr "До побаченнÑ.\n"
+
+#, c-format
+msgid "Stage mode change [y,n,q,a,d%s,?]? "
+msgstr "ІндекÑувати зміну режиму [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Stage deletion [y,n,q,a,d%s,?]? "
+msgstr "ІндекÑувати Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Stage addition [y,n,q,a,d%s,?]? "
+msgstr "ІндекÑувати Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Stage this hunk [y,n,q,a,d%s,?]? "
+msgstr "ІндекÑувати цей шматок [y,n,q,a,d%s,?]? "
+
+msgid ""
+"If the patch applies cleanly, the edited hunk will immediately be marked for "
+"staging."
+msgstr ""
+"Якщо латка буде заÑтоÑована без помилок, відредагований шматок буде одразу ж "
+"позначено Ð´Ð»Ñ Ñ–Ð½Ð´ÐµÐºÑації."
+
+msgid ""
+"y - stage this hunk\n"
+"n - do not stage this hunk\n"
+"q - quit; do not stage this hunk or any of the remaining ones\n"
+"a - stage this hunk and all later hunks in the file\n"
+"d - do not stage this hunk or any of the later hunks in the file\n"
+msgstr ""
+"y - індекÑувати цей шматок\n"
+"n - не індекÑувати цей шматок\n"
+"q - вийти; не індекÑувати ні цей шматок, ні решту\n"
+"a - індекÑувати цей шматок Ñ– вÑÑ– наÑтупні шматки у файлі\n"
+"d - не індекÑувати цей шматок Ñ– вÑÑ– наÑтупні шматки у файлі\n"
+
+#, c-format
+msgid "Stash mode change [y,n,q,a,d%s,?]? "
+msgstr "Сховати зміну режиму [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Stash deletion [y,n,q,a,d%s,?]? "
+msgstr "Сховати Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Stash addition [y,n,q,a,d%s,?]? "
+msgstr "Сховати Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Stash this hunk [y,n,q,a,d%s,?]? "
+msgstr "Сховати цей шматок [y,n,q,a,d%s,?]? "
+
+msgid ""
+"If the patch applies cleanly, the edited hunk will immediately be marked for "
+"stashing."
+msgstr ""
+"Якщо латка буде заÑтоÑована без помилок, відредагований шматок буде одразу ж "
+"позначено Ð´Ð»Ñ Ñхову."
+
+msgid ""
+"y - stash this hunk\n"
+"n - do not stash this hunk\n"
+"q - quit; do not stash this hunk or any of the remaining ones\n"
+"a - stash this hunk and all later hunks in the file\n"
+"d - do not stash this hunk or any of the later hunks in the file\n"
+msgstr ""
+"y - Ñховати цей шматок\n"
+"n - не ховати цей шматок\n"
+"q - вийти; не ховати ні цей шматок, ні решту\n"
+"a - Ñховати цей шматок Ñ– вÑÑ– наÑтупні шматки у файлі\n"
+"d - не ховати цей шматок Ñ– вÑÑ– наÑтупні шматки у файлі\n"
+
+#, c-format
+msgid "Unstage mode change [y,n,q,a,d%s,?]? "
+msgstr "Прибрати з індекÑу зміну режиму [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Unstage deletion [y,n,q,a,d%s,?]? "
+msgstr "Прибрати з індекÑу Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Unstage addition [y,n,q,a,d%s,?]? "
+msgstr "Прибрати з індекÑу Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Unstage this hunk [y,n,q,a,d%s,?]? "
+msgstr "Прибрати з індекÑу цей шматок [y,n,q,a,d%s,?]? "
+
+msgid ""
+"If the patch applies cleanly, the edited hunk will immediately be marked for "
+"unstaging."
+msgstr ""
+"Якщо латка буде заÑтоÑована без помилок, відредагований шматок буде одразу ж "
+"позначено Ð´Ð»Ñ Ñ€Ð¾Ð·Ñ–Ð½Ð´ÐµÐºÑації."
+
+msgid ""
+"y - unstage this hunk\n"
+"n - do not unstage this hunk\n"
+"q - quit; do not unstage this hunk or any of the remaining ones\n"
+"a - unstage this hunk and all later hunks in the file\n"
+"d - do not unstage this hunk or any of the later hunks in the file\n"
+msgstr ""
+"y - прибрати з індекÑу цей шматок\n"
+"n - не прибирати з індекÑу цей шматок\n"
+"q - вийти; не прибирати з індекÑу ні цей шматок, ні решту\n"
+"a - прибрати з індекÑу цей шматок Ñ– вÑÑ– наÑтупні шматки у файлі\n"
+"d - не прибирати з індекÑу цей шматок Ñ– вÑÑ– наÑтупні шматки у файлі\n"
+
+#, c-format
+msgid "Apply mode change to index [y,n,q,a,d%s,?]? "
+msgstr "ЗаÑтоÑувати зміну режиму до індекÑу [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply deletion to index [y,n,q,a,d%s,?]? "
+msgstr "ЗаÑтоÑувати Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð´Ð¾ індекÑу [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply addition to index [y,n,q,a,d%s,?]? "
+msgstr "ЗаÑтоÑувати Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð´Ð¾ індекÑу [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply this hunk to index [y,n,q,a,d%s,?]? "
+msgstr "ЗаÑтоÑувати цей шматок до індекÑу [y,n,q,a,d%s,?]? "
+
+msgid ""
+"If the patch applies cleanly, the edited hunk will immediately be marked for "
+"applying."
+msgstr ""
+"Якщо латка буде заÑтоÑована без помилок, відредагований шматок буде одразу ж "
+"позначено Ð´Ð»Ñ Ð·Ð°ÑтоÑуваннÑ."
+
+msgid ""
+"y - apply this hunk to index\n"
+"n - do not apply this hunk to index\n"
+"q - quit; do not apply this hunk or any of the remaining ones\n"
+"a - apply this hunk and all later hunks in the file\n"
+"d - do not apply this hunk or any of the later hunks in the file\n"
+msgstr ""
+"y - заÑтоÑувати цей шматок до індекÑу\n"
+"n - не заÑтоÑовувати цей шматок до індекÑу\n"
+"q - вийти; не заÑтоÑовувати ні цей шматок, ні решту\n"
+"a - заÑтоÑувати цей шматок Ñ– вÑÑ– наÑтупні шматки у файлі\n"
+"d - не заÑтоÑовувати цей шматок Ñ– вÑÑ– наÑтупні шматки у файлі\n"
+
+#, c-format
+msgid "Discard mode change from worktree [y,n,q,a,d%s,?]? "
+msgstr "Відкинути зміну режиму з робочого дерева [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Discard deletion from worktree [y,n,q,a,d%s,?]? "
+msgstr "Відкинути Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð· робочого дерева [y,n,q,a,d%s,?] "
+
+#, c-format
+msgid "Discard addition from worktree [y,n,q,a,d%s,?]? "
+msgstr "Відкинути Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð· робочого дерева [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Discard this hunk from worktree [y,n,q,a,d%s,?]? "
+msgstr "Відкинути цей шматок з робочого дерева [y,n,q,a,d%s,?]? "
+
+msgid ""
+"If the patch applies cleanly, the edited hunk will immediately be marked for "
+"discarding."
+msgstr ""
+"Якщо латка буде заÑтоÑована без помилок, відредагований шматок буде одразу ж "
+"позначено Ð´Ð»Ñ Ð²Ñ–Ð´ÐºÐ¸Ð´Ð°Ð½Ð½Ñ."
+
+msgid ""
+"y - discard this hunk from worktree\n"
+"n - do not discard this hunk from worktree\n"
+"q - quit; do not discard this hunk or any of the remaining ones\n"
+"a - discard this hunk and all later hunks in the file\n"
+"d - do not discard this hunk or any of the later hunks in the file\n"
+msgstr ""
+"y - відкинути цей шматок з робочого дерева\n"
+"n - не відкидати цей шматок з робочого дерева\n"
+"q - вийти; не відкидати ні цей шматок, ні решту\n"
+"a - відкинути цей шматок Ñ– вÑÑ– наÑтупні шматки у файлі\n"
+"d - не відкидати цей шматок Ñ– вÑÑ– наÑтупні шматки у файлі\n"
+
+#, c-format
+msgid "Discard mode change from index and worktree [y,n,q,a,d%s,?]? "
+msgstr "Відкинути зміну режиму з індекÑу та робочого дерева [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Discard deletion from index and worktree [y,n,q,a,d%s,?]? "
+msgstr "Відкинути Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð· індекÑу та робочого дерева [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Discard addition from index and worktree [y,n,q,a,d%s,?]? "
+msgstr "Відкинути Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð· індекÑу та робочого дерева [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Discard this hunk from index and worktree [y,n,q,a,d%s,?]? "
+msgstr "Відкинути цей шматок з індекÑу та робочого дерева [y,n,q,a,d%s,?]? "
+
+msgid ""
+"y - discard this hunk from index and worktree\n"
+"n - do not discard this hunk from index and worktree\n"
+"q - quit; do not discard this hunk or any of the remaining ones\n"
+"a - discard this hunk and all later hunks in the file\n"
+"d - do not discard this hunk or any of the later hunks in the file\n"
+msgstr ""
+"y - відкинути цей шматок з індекÑу та робочого дерева\n"
+"n - не відкидати цей шматок з індекÑу та робочого дерева\n"
+"q - вийти; не відкидати ні цей шматок, ні решту\n"
+"a - відкинути цей шматок Ñ– вÑÑ– наÑтупні шматки у файлі\n"
+"d - не відкидати цей шматок Ñ– вÑÑ– наÑтупні шматки у файлі\n"
+
+#, c-format
+msgid "Apply mode change to index and worktree [y,n,q,a,d%s,?]? "
+msgstr ""
+"ЗаÑтоÑувати зміну режиму до індекÑу та робочого дерева [y,n,q,a,d%s,?] "
+
+#, c-format
+msgid "Apply deletion to index and worktree [y,n,q,a,d%s,?]? "
+msgstr "ЗаÑтоÑувати Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð´Ð¾ індекÑу та робочого дерева [y,n,q,a,d%s,?] "
+
+#, c-format
+msgid "Apply addition to index and worktree [y,n,q,a,d%s,?]? "
+msgstr "ЗаÑтоÑувати Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð´Ð¾ індекÑу та робочого дерева [y,n,q,a,d%s,?] "
+
+#, c-format
+msgid "Apply this hunk to index and worktree [y,n,q,a,d%s,?]? "
+msgstr "ЗаÑтоÑувати цей шматок до індекÑу та робочого дерева [y,n,q,a,d%s,?] "
+
+msgid ""
+"y - apply this hunk to index and worktree\n"
+"n - do not apply this hunk to index and worktree\n"
+"q - quit; do not apply this hunk or any of the remaining ones\n"
+"a - apply this hunk and all later hunks in the file\n"
+"d - do not apply this hunk or any of the later hunks in the file\n"
+msgstr ""
+"y - заÑтоÑувати цей шматок до індекÑу та робочого дерева\n"
+"n - не заÑтоÑовувати цей шматок до індекÑу та робочого дерева\n"
+"q - вийти; не заÑтоÑовувати ні цей шматок, ні решту\n"
+"a - заÑтоÑувати цей шматок Ñ– вÑÑ– наÑтупні шматки у файлі\n"
+"d - не заÑтоÑовувати цей шматок Ñ– вÑÑ– наÑтупні шматки у файлі\n"
+
+#, c-format
+msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
+msgstr "ЗаÑтоÑувати зміну режиму до робочого дерева [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
+msgstr "ЗаÑтоÑувати Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð´Ð¾ робочого дерева [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
+msgstr "ЗаÑтоÑувати Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð´Ð¾ робочого дерева [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
+msgstr "ЗаÑтоÑувати цей шматок до робочого дерева [y,n,q,a,d%s,?]? "
+
+msgid ""
+"y - apply this hunk to worktree\n"
+"n - do not apply this hunk to worktree\n"
+"q - quit; do not apply this hunk or any of the remaining ones\n"
+"a - apply this hunk and all later hunks in the file\n"
+"d - do not apply this hunk or any of the later hunks in the file\n"
+msgstr ""
+"y - заÑтоÑувати цей шматок до робочого дерева\n"
+"n - не заÑтоÑовувати цей шматок до робочого дерева\n"
+"q - вийти; не заÑтоÑовувати ні цей шматок, ні решту\n"
+"a - заÑтоÑувати цей шматок Ñ– вÑÑ– наÑтупні шматки у файлі\n"
+"d - не заÑтоÑовувати цей шматок Ñ– вÑÑ– наÑтупні шматки у файлі\n"
+
+#, c-format
+msgid "could not parse hunk header '%.*s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ заголовок шматка \"%.*s\""
+
+msgid "could not parse diff"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ різницю"
+
+msgid "could not parse colored diff"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ кольоровану різницю"
+
+#, c-format
+msgid "failed to run '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити \"%s\""
+
+msgid "mismatched output from interactive.diffFilter"
+msgstr "неÑÐ¿Ñ–Ð²Ð¿Ð°Ð´Ñ–Ð½Ð½Ñ Ð²Ð¸Ð²Ð¾Ð´Ñƒ з interactive.diffFilter"
+
+msgid ""
+"Your filter must maintain a one-to-one correspondence\n"
+"between its input and output lines."
+msgstr ""
+"Ваш фільтр повинен підтримувати один до одного відповідніÑÑ‚ÑŒ\n"
+"між його вхідними та вихідними Ñ€Ñдками."
+
+#, c-format
+msgid ""
+"expected context line #%d in\n"
+"%.*s"
+msgstr ""
+"очікувавÑÑ Ñ€Ñдок контекÑту #%d в\n"
+"%.*s"
+
+#, c-format
+msgid ""
+"hunks do not overlap:\n"
+"%.*s\n"
+"\tdoes not end with:\n"
+"%.*s"
+msgstr ""
+"шматки не перетинаютьÑÑ:\n"
+"%.*s\n"
+"\tне закінчуєтьÑÑ Ð½Ð°:\n"
+"%.*s"
+
+msgid "Manual hunk edit mode -- see bottom for a quick guide.\n"
+msgstr "Режим ручного Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ ÑˆÐ¼Ð°Ñ‚ÐºÐ° -- див. короткий поÑібник внизу.\n"
+
+#, c-format
+msgid ""
+"---\n"
+"To remove '%c' lines, make them ' ' lines (context).\n"
+"To remove '%c' lines, delete them.\n"
+"Lines starting with %c will be removed.\n"
+msgstr ""
+"---\n"
+"Щоб видалити Ñ€Ñдки \"%c\", зробіть Ñ—Ñ… Ñ€Ñдками \" \" (контекÑÑ‚).\n"
+"Щоб видалити Ñ€Ñдки \"%c\", вилучіть Ñ—Ñ….\n"
+"Буде видалено Ñ€Ñдки, що починаютьÑÑ Ð· %c.\n"
+
+msgid ""
+"If it does not apply cleanly, you will be given an opportunity to\n"
+"edit again. If all lines of the hunk are removed, then the edit is\n"
+"aborted and the hunk is left unchanged.\n"
+msgstr ""
+"Якщо шматок буде заÑтоÑований з помилками, вам буде надана можливіÑÑ‚ÑŒ\n"
+"відредагувати ще раз. Якщо вÑÑ– Ñ€Ñдки шматка буде вилучено, то Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ "
+"буде\n"
+"перервано, Ñ– шматок залишитьÑÑ Ð±ÐµÐ· змін.\n"
+
+msgid "could not parse hunk header"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ заголовок шматка"
+
+msgid "'git apply --cached' failed"
+msgstr "\"git apply --cached\" завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#. TRANSLATORS: do not translate [y/n]
+#. The program will only accept that input at this point.
+#. Consider translating (saying "no" discards!) as
+#. (saying "n" for "no" discards!) if the translation
+#. of the word "no" does not start with n.
+#.
+msgid ""
+"Your edited hunk does not apply. Edit again (saying \"no\" discards!) [y/n]? "
+msgstr ""
+"Ваш відредагований шматок неможливо заÑтоÑувати. Відредагувати ще раз "
+"(\"no\" - відкинути!) [y/n]? "
+
+msgid "The selected hunks do not apply to the index!"
+msgstr "Вибрані шматки неможливо заÑтоÑувати до індекÑу!"
+
+msgid "Apply them to the worktree anyway? "
+msgstr "Ð’Ñе одно заÑтоÑувати Ñ—Ñ… до робочого дерева? "
+
+msgid "Nothing was applied.\n"
+msgstr "Ðічого не заÑтоÑовано.\n"
+
+msgid ""
+"j - leave this hunk undecided, see next undecided hunk\n"
+"J - leave this hunk undecided, see next hunk\n"
+"k - leave this hunk undecided, see previous undecided hunk\n"
+"K - leave this hunk undecided, see previous hunk\n"
+"g - select a hunk to go to\n"
+"/ - search for a hunk matching the given regex\n"
+"s - split the current hunk into smaller hunks\n"
+"e - manually edit the current hunk\n"
+"? - print help\n"
+msgstr ""
+"j - залишити цей шматок невизначеним, перейти до наÑтупного невизначеного "
+"шматка\n"
+"J - залишити цей шматок невизначеним, перейти до наÑтупного шматка\n"
+"k - залишити цей шматок невизначеним, перейти до попереднього невизначеного "
+"шматка\n"
+"K - залишити цей шматок невизначеним, перейти до попереднього шматка\n"
+"g - вибрати шматок, до Ñкого ви хочете перейти\n"
+"/ - шукати шматок, що відповідає заданому регвиру\n"
+"s - розбити поточний шматок на менші шматки\n"
+"e - редагувати поточний шматок вручну\n"
+"? - показати довідку\n"
+
+msgid "No previous hunk"
+msgstr "Ðемає попереднього шматка"
+
+msgid "No next hunk"
+msgstr "Ðемає наÑтупного шматка"
+
+msgid "No other hunks to goto"
+msgstr "Ðемає інших шматків Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÑ…Ð¾Ð´Ñƒ"
+
+msgid "go to which hunk (<ret> to see more)? "
+msgstr "до Ñкого шматка перейти (<ret>, щоб побачити більше)? "
+
+msgid "go to which hunk? "
+msgstr "до Ñкого шматка перейти? "
+
+#, c-format
+msgid "Invalid number: '%s'"
+msgstr "ÐеприпуÑтиме чиÑло: \"%s\""
+
+#, c-format
+msgid "Sorry, only %d hunk available."
+msgid_plural "Sorry, only %d hunks available."
+msgstr[0] "Вибачайте, доÑтупний лише %d шматок."
+msgstr[1] "Вибачайте, доÑтупно лише %d шматки."
+msgstr[2] "Вибачайте, доÑтупно лише %d шматків."
+
+msgid "No other hunks to search"
+msgstr "Ðемає інших шматків Ð´Ð»Ñ Ð¿Ð¾ÑˆÑƒÐºÑƒ"
+
+msgid "search for regex? "
+msgstr "шукати регвир? "
+
+#, c-format
+msgid "Malformed search regexp %s: %s"
+msgstr "Ðевірно Ñформований регвир пошуку %s: %s"
+
+msgid "No hunk matches the given pattern"
+msgstr "Жоден шматок не відповідає заданому шаблону"
+
+msgid "Sorry, cannot split this hunk"
+msgstr "Вибачайте, не можу розщепити цей шматок"
+
+#, c-format
+msgid "Split into %d hunks."
+msgstr "Розщепити на %d шматків."
+
+msgid "Sorry, cannot edit this hunk"
+msgstr "Вибачайте, не можу редагувати цей шматок"
+
+msgid "'git apply' failed"
+msgstr "\"git apply\" завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid ""
+"\n"
+"Disable this message with \"git config advice.%s false\""
+msgstr ""
+"\n"
+"Вимкнути це Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð¼Ð¾Ð¶Ð½Ð° за допомогою \"git config advice.%s false\""
+
+#, c-format
+msgid "%shint: %.*s%s\n"
+msgstr "%sпідказка: %.*s%s\n"
+
+msgid "Cherry-picking is not possible because you have unmerged files."
+msgstr "ВиÑÐ¼Ð¸ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð½ÐµÐ¼Ð¾Ð¶Ð»Ð¸Ð²Ðµ, оÑкільки у Ð²Ð°Ñ Ñ” не злиті файли."
+
+msgid "Committing is not possible because you have unmerged files."
+msgstr "Ð¡Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ неможливе, оÑкільки у Ð²Ð°Ñ Ñ” не злиті файли."
+
+msgid "Merging is not possible because you have unmerged files."
+msgstr "Ð—Ð»Ð¸Ñ‚Ñ‚Ñ Ð½ÐµÐ¼Ð¾Ð¶Ð»Ð¸Ð²Ðµ, оÑкільки у Ð²Ð°Ñ Ñ” не злиті файли."
+
+msgid "Pulling is not possible because you have unmerged files."
+msgstr "ÐžÑ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð½ÐµÐ¼Ð¾Ð¶Ð»Ð¸Ð²Ðµ, оÑкільки у Ð²Ð°Ñ Ñ” не злиті файли."
+
+msgid "Reverting is not possible because you have unmerged files."
+msgstr "Ð’Ð¸Ð²ÐµÑ€Ñ‚Ð°Ð½Ð½Ñ Ð½ÐµÐ¼Ð¾Ð¶Ð»Ð¸Ð²Ðµ, оÑкільки у Ð²Ð°Ñ Ñ” не злиті файли."
+
+msgid "Rebasing is not possible because you have unmerged files."
+msgstr "ÐŸÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ Ð½ÐµÐ¼Ð¾Ð¶Ð»Ð¸Ð²Ðµ, оÑкільки у Ð²Ð°Ñ Ñ” не злиті файли."
+
+msgid ""
+"Fix them up in the work tree, and then use 'git add/rm <file>'\n"
+"as appropriate to mark resolution and make a commit."
+msgstr ""
+"Виправте Ñ—Ñ… у робочому дереві, а потім ÑкориÑтайтеÑÑŒ командою \"git add/rm "
+"<файл>\"\n"
+"щоб позначити Ð²Ð¸Ñ€Ñ–ÑˆÐµÐ½Ð½Ñ Ñ– зробити коміт."
+
+msgid "Exiting because of an unresolved conflict."
+msgstr "Вихід через невирішений конфлікт."
+
+msgid "You have not concluded your merge (MERGE_HEAD exists)."
+msgstr "Ви не завершили Ð·Ð»Ð¸Ñ‚Ñ‚Ñ (Ñ–Ñнує MERGE_HEAD)."
+
+msgid "Please, commit your changes before merging."
+msgstr "Будь лаÑка, зробіть коміт ваших змін перед злиттÑм."
+
+msgid "Exiting because of unfinished merge."
+msgstr "Вихід через незавершене злиттÑ."
+
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"Гілки, що розходÑÑ‚ÑŒÑÑ, не можуть бути перемотані вперед, вам потрібно "
+"зробити:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"або\n"
+"\n"
+"\tgit rebase\n"
+
+msgid "Not possible to fast-forward, aborting."
+msgstr "Ðеможливо перемотати вперед, перериваннÑ."
+
+#, c-format
+msgid ""
+"The following paths and/or pathspecs matched paths that exist\n"
+"outside of your sparse-checkout definition, so will not be\n"
+"updated in the index:\n"
+msgstr ""
+"ÐаÑтупні шлÑхи та/або визначники шлÑхів відповідають шлÑхам, Ñкі Ñ–Ñнують\n"
+"за межами Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð°ÑˆÐ¾Ð³Ð¾ розрідженого переходу, тому не будуть\n"
+"оновлені в індекÑÑ–:\n"
+
+msgid ""
+"If you intend to update such entries, try one of the following:\n"
+"* Use the --sparse option.\n"
+"* Disable or modify the sparsity rules."
+msgstr ""
+"Якщо ви маєте намір оновити такі запиÑи, Ñпробуйте один із наведених нижче "
+"ÑпоÑобів:\n"
+"* ВикориÑтайте параметр --sparse.\n"
+"* Вимкніть або змініть правила розрідженоÑÑ‚Ñ–."
+
+#, c-format
+msgid ""
+"Note: switching to '%s'.\n"
+"\n"
+"You are in 'detached HEAD' state. You can look around, make experimental\n"
+"changes and commit them, and you can discard any commits you make in this\n"
+"state without impacting any branches by switching back to a branch.\n"
+"\n"
+"If you want to create a new branch to retain commits you create, you may\n"
+"do so (now or later) by using -c with the switch command. Example:\n"
+"\n"
+" git switch -c <new-branch-name>\n"
+"\n"
+"Or undo this operation with:\n"
+"\n"
+" git switch -\n"
+"\n"
+"Turn off this advice by setting config variable advice.detachedHead to "
+"false\n"
+"\n"
+msgstr ""
+"Примітка: Ð¿ÐµÑ€ÐµÐ¼Ð¸ÐºÐ°Ð½Ð½Ñ Ð½Ð° \"%s\".\n"
+"\n"
+"Ви перебуваєте в Ñтані \"відʼєднаного HEAD\". Ви можете озирнутиÑÑ Ð´Ð¾Ð²ÐºÐ¾Ð»Ð°, "
+"внеÑти екÑпериментальні\n"
+"зміни Ñ– зробити коміт, також ви можете відкинути будь-Ñкі коміти, зроблені у "
+"цьому\n"
+"Ñтані, не впливаючи на інші гілки, проÑто перейшовши до іншої гілки.\n"
+"\n"
+"Якщо ви хочете Ñтворити нову гілку Ð´Ð»Ñ Ð·Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ð·Ñ€Ð¾Ð±Ð»ÐµÐ½Ð¸Ñ… вами комітів, ви "
+"можете\n"
+"викориÑтати (зараз або пізніше) -c з командою switch. Ðаприклад:\n"
+"\n"
+" git switch -c <назва-нової-гілки\n"
+"\n"
+"Ðбо ÑкаÑувати цю операцію за допомогою:\n"
+"\n"
+" git switch -\n"
+"\n"
+"Щоб вимкнути цю пораду, вÑтановіть конфігураційний параметр advice."
+"detachedHead у false\n"
+
+#, c-format
+msgid ""
+"The following paths have been moved outside the\n"
+"sparse-checkout definition but are not sparse due to local\n"
+"modifications.\n"
+msgstr ""
+"ÐаÑтупні шлÑхи, що було винеÑено за межі Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ€Ð¾Ð·Ñ€Ñ–Ð´Ð¶ÐµÐ½Ð¾Ð³Ð¾\n"
+"переходу, не є розрідженими через локальні\n"
+"зміни.\n"
+
+msgid ""
+"To correct the sparsity of these paths, do the following:\n"
+"* Use \"git add --sparse <paths>\" to update the index\n"
+"* Use \"git sparse-checkout reapply\" to apply the sparsity rules"
+msgstr ""
+"Щоб виправити розрідженіÑÑ‚ÑŒ цих шлÑхів, виконайте наÑтупне:\n"
+"* ВикориÑтайте \"git add --sparse <шлÑхи>\" Ð´Ð»Ñ Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ñ–Ð½Ð´ÐµÐºÑу\n"
+"* ВикориÑтайте \"git sparse-checkout reapply\", щоб заÑтоÑувати правила "
+"розрідженоÑÑ‚Ñ–"
+
+msgid "cmdline ends with \\"
+msgstr "cmdline завершуєтьÑÑ Ñимволом \\"
+
+msgid "unclosed quote"
+msgstr "незакриті лапки"
+
+msgid "too many arguments"
+msgstr "забагато аргументів"
+
+#, c-format
+msgid "unrecognized whitespace option '%s'"
+msgstr "нерозпізнана Ð¾Ð¿Ñ†Ñ–Ñ Ð¿Ñ€Ð¾Ð±Ñ–Ð»ÑŒÐ½Ð¸Ñ… Ñимволів \"%s\""
+
+#, c-format
+msgid "unrecognized whitespace ignore option '%s'"
+msgstr "нерозпізнана Ð¾Ð¿Ñ†Ñ–Ñ Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ñ€Ð¾Ð±Ñ–Ð»ÑŒÐ½Ð¸Ñ… Ñимволів \"%s\""
+
+#, c-format
+msgid "options '%s' and '%s' cannot be used together"
+msgstr "опції \"%s\" Ñ– \"%s\" не можна викориÑтовувати разом"
+
+#, c-format
+msgid "'%s' outside a repository"
+msgstr "\"%s\" поза Ñховищем"
+
+msgid "failed to read patch"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ латку"
+
+msgid "patch too large"
+msgstr "латка занадто велика"
+
+#, c-format
+msgid "Cannot prepare timestamp regexp %s"
+msgstr "Ðеможливо підготувати регвир позначки чаÑу %s"
+
+#, c-format
+msgid "regexec returned %d for input: %s"
+msgstr "regexec повернув %d Ð´Ð»Ñ Ð²Ð²Ð¾Ð´Ñƒ: %s"
+
+#, c-format
+msgid "unable to find filename in patch at line %d"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ назву файла в Ñ€Ñдку %d латки"
+
+#, c-format
+msgid "git apply: bad git-diff - expected /dev/null, got %s on line %d"
+msgstr ""
+"git apply: невірний git-diff - очікувалоÑÑŒ /dev/null, отримано %s у Ñ€Ñдку %d"
+
+#, c-format
+msgid "git apply: bad git-diff - inconsistent new filename on line %d"
+msgstr ""
+"git apply: невірний git-diff - невідповідна назва нового файлу в Ñ€Ñдку %d"
+
+#, c-format
+msgid "git apply: bad git-diff - inconsistent old filename on line %d"
+msgstr ""
+"git apply: невірний git-diff - невідповідна назва Ñтарого файлу в Ñ€Ñдку %d"
+
+#, c-format
+msgid "git apply: bad git-diff - expected /dev/null on line %d"
+msgstr "git apply: невірний git-diff - очікувалоÑÑŒ /dev/null у Ñ€Ñдку %d"
+
+#, c-format
+msgid "invalid mode on line %d: %s"
+msgstr "неприпуÑтимий режим у Ñ€Ñдку %d: %s"
+
+#, c-format
+msgid "inconsistent header lines %d and %d"
+msgstr "невідповідні Ñ€Ñдки заголовка %d та %d"
+
+#, c-format
+msgid ""
+"git diff header lacks filename information when removing %d leading pathname "
+"component (line %d)"
+msgid_plural ""
+"git diff header lacks filename information when removing %d leading pathname "
+"components (line %d)"
+msgstr[0] ""
+"у заголовку git diff відÑÑƒÑ‚Ð½Ñ Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð¿Ñ€Ð¾ назву файла при видаленні %d "
+"провідного компонента назви шлÑху (Ñ€Ñдок %d)"
+msgstr[1] ""
+"у заголовку git diff відÑÑƒÑ‚Ð½Ñ Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð¿Ñ€Ð¾ назву файла при видаленні %d "
+"провідних компонентів назви шлÑху (Ñ€Ñдок %d)"
+msgstr[2] ""
+"у заголовку git diff відÑÑƒÑ‚Ð½Ñ Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð¿Ñ€Ð¾ назву файла при видаленні %d "
+"провідних компонентів назви шлÑху (Ñ€Ñдок %d)"
+
+#, c-format
+msgid "git diff header lacks filename information (line %d)"
+msgstr "у заголовку git diff відÑÑƒÑ‚Ð½Ñ Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð¿Ñ€Ð¾ назву файла (Ñ€Ñдок %d)"
+
+#, c-format
+msgid "recount: unexpected line: %.*s"
+msgstr "recount: неочікуваний Ñ€Ñдок: %.*s"
+
+#, c-format
+msgid "patch fragment without header at line %d: %.*s"
+msgstr "фрагмент латки без заголовка у Ñ€Ñдку %d: %.*s"
+
+msgid "new file depends on old contents"
+msgstr "новий файл залежить від Ñтарого вміÑту"
+
+msgid "deleted file still has contents"
+msgstr "видалений файл вÑе ще має вміÑÑ‚"
+
+#, c-format
+msgid "corrupt patch at line %d"
+msgstr "пошкоджена латка у Ñ€Ñдку %d"
+
+#, c-format
+msgid "new file %s depends on old contents"
+msgstr "новий файл %s залежить від Ñтарого вміÑту"
+
+#, c-format
+msgid "deleted file %s still has contents"
+msgstr "видалений файл %s вÑе ще має вміÑÑ‚"
+
+#, c-format
+msgid "** warning: file %s becomes empty but is not deleted"
+msgstr "** попередженнÑ: файл %s Ñтане порожнім, але не буде видалений"
+
+#, c-format
+msgid "corrupt binary patch at line %d: %.*s"
+msgstr "пошкоджена бінарна латка у Ñ€Ñдку %d: %.*s"
+
+#, c-format
+msgid "unrecognized binary patch at line %d"
+msgstr "нерозпізнана бінарна латка у Ñ€Ñдку %d"
+
+#, c-format
+msgid "patch with only garbage at line %d"
+msgstr "латка, що міÑтить лише непотріб у Ñ€Ñдку %d"
+
+#, c-format
+msgid "unable to read symlink %s"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ Ñимвольне поÑÐ¸Ð»Ð°Ð½Ð½Ñ %s"
+
+#, c-format
+msgid "unable to open or read %s"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ або прочитати %s"
+
+#, c-format
+msgid "invalid start of line: '%c'"
+msgstr "неприпуÑтимий початок Ñ€Ñдка: \"%c\""
+
+#, c-format
+msgid "Hunk #%d succeeded at %d (offset %d line)."
+msgid_plural "Hunk #%d succeeded at %d (offset %d lines)."
+msgstr[0] "Шматок #%d уÑпішно заÑтоÑовано на позиції %d (Ð·Ð¼Ñ–Ñ‰ÐµÐ½Ð½Ñ %d Ñ€Ñдок)."
+msgstr[1] "Шматок #%d уÑпішно заÑтоÑовано на позиції %d (Ð·Ð¼Ñ–Ñ‰ÐµÐ½Ð½Ñ %d Ñ€Ñдки)."
+msgstr[2] "Шматок #%d уÑпішно заÑтоÑовано на позиції %d (Ð·Ð¼Ñ–Ñ‰ÐµÐ½Ð½Ñ %d Ñ€Ñдків)."
+
+#, c-format
+msgid "Context reduced to (%ld/%ld) to apply fragment at %d"
+msgstr ""
+"КонтекÑÑ‚ Ñкорочено до (%ld/%ld), щоб заÑтоÑувати фрагмент на позиції %d"
+
+#, c-format
+msgid ""
+"while searching for:\n"
+"%.*s"
+msgstr ""
+"поки йде пошук:\n"
+"%.*s"
+
+#, c-format
+msgid "missing binary patch data for '%s'"
+msgstr "відÑутні дані бінарної латки Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "cannot reverse-apply a binary patch without the reverse hunk to '%s'"
+msgstr ""
+"неможливо виконати reverse-apply бінарної латки без зворотнього шматка до "
+"\"%s\""
+
+#, c-format
+msgid "cannot apply binary patch to '%s' without full index line"
+msgstr ""
+"неможливо заÑтоÑувати бінарну латку до \"%s\" без повного індекÑного Ñ€Ñдка"
+
+#, c-format
+msgid ""
+"the patch applies to '%s' (%s), which does not match the current contents."
+msgstr ""
+"латка заÑтоÑовуєтьÑÑ Ð´Ð¾ \"%s\" (%s), Ñкий не збігаєтьÑÑ Ð· поточним вміÑтом."
+
+#, c-format
+msgid "the patch applies to an empty '%s' but it is not empty"
+msgstr "латка заÑтоÑовуєтьÑÑ Ð´Ð¾ порожнього \"%s\", Ñкий не Ñ” порожнім"
+
+#, c-format
+msgid "the necessary postimage %s for '%s' cannot be read"
+msgstr "неможливо прочитати необхідний postimage %s Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "binary patch does not apply to '%s'"
+msgstr "бінарна латка не заÑтоÑовуєтьÑÑ Ð´Ð¾ \"%s\""
+
+#, c-format
+msgid "binary patch to '%s' creates incorrect result (expecting %s, got %s)"
+msgstr ""
+"бінарна латка Ð´Ð»Ñ \"%s\" призводить до некоректного результату (очікувалоÑÑŒ "
+"%s, отримано %s)"
+
+#, c-format
+msgid "patch failed: %s:%ld"
+msgstr "Ð»Ð°Ñ‚Ð°Ð½Ð½Ñ Ð½Ðµ вдалоÑÑ: %s:%ld"
+
+#, c-format
+msgid "cannot checkout %s"
+msgstr "неможливо переключити Ñтан %s"
+
+#, c-format
+msgid "failed to read %s"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ %s"
+
+#, c-format
+msgid "reading from '%s' beyond a symbolic link"
+msgstr "Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ð· \"%s\" за Ñимвольним поÑиланнÑм"
+
+#, c-format
+msgid "path %s has been renamed/deleted"
+msgstr "шлÑÑ… %s перейменовано/видалено"
+
+#, c-format
+msgid "%s: does not exist in index"
+msgstr "%s: не Ñ–Ñнує в індекÑÑ–"
+
+#, c-format
+msgid "%s: does not match index"
+msgstr "%s: не Ñпівпадає з індекÑом"
+
+msgid "repository lacks the necessary blob to perform 3-way merge."
+msgstr ""
+"у Ñховищі відÑутній необхідний blob Ð´Ð»Ñ Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ Ñ‚Ñ€Ð¸Ñтороннього злиттÑ."
+
+#, c-format
+msgid "Performing three-way merge...\n"
+msgstr "Ð’Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ Ñ‚Ñ€Ð¸Ñтороннього злиттÑ...\n"
+
+#, c-format
+msgid "cannot read the current contents of '%s'"
+msgstr "неможливо прочитати поточний вміÑÑ‚ \"%s\""
+
+#, c-format
+msgid "Failed to perform three-way merge...\n"
+msgstr "Ðе вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ триÑтороннє злиттÑ...\n"
+
+#, c-format
+msgid "Applied patch to '%s' with conflicts.\n"
+msgstr "Латка до \"%s\" заÑтоÑована з конфліктами.\n"
+
+#, c-format
+msgid "Applied patch to '%s' cleanly.\n"
+msgstr "Латка до \"%s\" заÑтоÑована чиÑто.\n"
+
+#, c-format
+msgid "Falling back to direct application...\n"
+msgstr "ÐŸÐ¾Ð²ÐµÑ€Ð½ÐµÐ½Ð½Ñ Ð´Ð¾ прÑмого заÑтоÑуваннÑ...\n"
+
+msgid "removal patch leaves file contents"
+msgstr "латка Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð·Ð°Ð»Ð¸ÑˆÐ°Ñ” вміÑÑ‚ файлу"
+
+#, c-format
+msgid "%s: wrong type"
+msgstr "%s: невірний тип"
+
+#, c-format
+msgid "%s has type %o, expected %o"
+msgstr "%s має тип %o, очікувалоÑÑŒ %o"
+
+#, c-format
+msgid "invalid path '%s'"
+msgstr "неприпуÑтимий шлÑÑ… \"%s\""
+
+#, c-format
+msgid "%s: already exists in index"
+msgstr "%s: вже Ñ–Ñнує в індекÑÑ–"
+
+#, c-format
+msgid "%s: already exists in working directory"
+msgstr "%s: вже Ñ–Ñнує в робочій директорії"
+
+#, c-format
+msgid "new mode (%o) of %s does not match old mode (%o)"
+msgstr "новий режим (%o) Ð´Ð»Ñ %s не відповідає Ñтарому режиму (%o)"
+
+#, c-format
+msgid "new mode (%o) of %s does not match old mode (%o) of %s"
+msgstr "новий режим (%o) Ð´Ð»Ñ %s не відповідає Ñтарому режиму (%o) Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "affected file '%s' is beyond a symbolic link"
+msgstr "уражений файл \"%s\" знаходитьÑÑ Ð·Ð° межами Ñимволічного поÑиланнÑ"
+
+#, c-format
+msgid "%s: patch does not apply"
+msgstr "%s: латка не може бути заÑтоÑована"
+
+#, c-format
+msgid "Checking patch %s..."
+msgstr "Перевірка латки %s..."
+
+#, c-format
+msgid "sha1 information is lacking or useless for submodule %s"
+msgstr "sha1 Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð²Ñ–Ð´ÑÑƒÑ‚Ð½Ñ Ð°Ð±Ð¾ марна Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ %s"
+
+#, c-format
+msgid "mode change for %s, which is not in current HEAD"
+msgstr "зміна режиму Ð´Ð»Ñ %s, Ñкого немає в поточному HEAD"
+
+#, c-format
+msgid "sha1 information is lacking or useless (%s)."
+msgstr "sha1 Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð²Ñ–Ð´ÑÑƒÑ‚Ð½Ñ Ð°Ð±Ð¾ марна (%s)."
+
+#, c-format
+msgid "could not add %s to temporary index"
+msgstr "не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ %s до тимчаÑового індекÑу"
+
+#, c-format
+msgid "could not write temporary index to %s"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати тимчаÑовий Ñ–Ð½Ð´ÐµÐºÑ Ñƒ %s"
+
+#, c-format
+msgid "unable to remove %s from index"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ %s з індекÑу"
+
+#, c-format
+msgid "corrupt patch for submodule %s"
+msgstr "пошкоджена латка Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ %s"
+
+#, c-format
+msgid "unable to stat newly created file '%s'"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ інформацію про щойно Ñтворений файл \"%s\""
+
+#, c-format
+msgid "unable to create backing store for newly created file %s"
+msgstr "не вдалоÑÑ Ð·Ñ€Ð¾Ð±Ð¸Ñ‚Ð¸ Ð·Ð°Ð¿Ð¸Ñ Ð´Ð»Ñ Ñ‰Ð¾Ð¹Ð½Ð¾ Ñтвореного файлу %s"
+
+#, c-format
+msgid "unable to add cache entry for %s"
+msgstr "не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ Ð·Ð°Ð¿Ð¸Ñ ÐºÐµÑˆÑƒ Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "failed to write to '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати в \"%s\""
+
+#, c-format
+msgid "closing file '%s'"
+msgstr "Ð·Ð°ÐºÑ€Ð¸Ñ‚Ñ‚Ñ Ñ„Ð°Ð¹Ð»Ñƒ \"%s\""
+
+#, c-format
+msgid "unable to write file '%s' mode %o"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати файл \"%s\" в режимі %o"
+
+#, c-format
+msgid "Applied patch %s cleanly."
+msgstr "Латка %s заÑтоÑована чиÑто."
+
+msgid "internal error"
+msgstr "Ð²Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ°"
+
+#, c-format
+msgid "Applying patch %%s with %d reject..."
+msgid_plural "Applying patch %%s with %d rejects..."
+msgstr[0] "ЗаÑтоÑÑƒÐ²Ð°Ð½Ð½Ñ Ð»Ð°Ñ‚ÐºÐ¸ %%s з %d відкиданнÑм..."
+msgstr[1] "ЗаÑтоÑÑƒÐ²Ð°Ð½Ð½Ñ Ð»Ð°Ñ‚ÐºÐ¸ %%s з %d відкиданнÑми..."
+msgstr[2] "ЗаÑтоÑÑƒÐ²Ð°Ð½Ð½Ñ Ð»Ð°Ñ‚ÐºÐ¸ %%s з %d відкиданнÑми..."
+
+#, c-format
+msgid "truncating .rej filename to %.*s.rej"
+msgstr "ÑÐºÐ¾Ñ€Ð¾Ñ‡ÐµÐ½Ð½Ñ Ð½Ð°Ð·Ð²Ð¸ файлу .rej до %.*s.rej"
+
+#, c-format
+msgid "cannot open %s"
+msgstr "неможливо відкрити %s"
+
+#, c-format
+msgid "cannot unlink '%s'"
+msgstr "неможливо видалити \"%s\""
+
+#, c-format
+msgid "Hunk #%d applied cleanly."
+msgstr "Шматок #%d заÑтоÑовано чиÑто."
+
+#, c-format
+msgid "Rejected hunk #%d."
+msgstr "Шматок #%d відкинуто."
+
+#, c-format
+msgid "Skipped patch '%s'."
+msgstr "Пропущена латка \"%s\"."
+
+msgid "No valid patches in input (allow with \"--allow-empty\")"
+msgstr "Ðемає коректних латок на вході (дозволити через \"--allow-empty\")"
+
+msgid "unable to read index file"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ індекÑний файл"
+
+#, c-format
+msgid "can't open patch '%s': %s"
+msgstr "неможливо відкрити латку \"%s\": %s"
+
+#, c-format
+msgid "squelched %d whitespace error"
+msgid_plural "squelched %d whitespace errors"
+msgstr[0] "ігнорована %d помилка пробільних Ñимволів"
+msgstr[1] "ігноровані %d помилки пробільних Ñимволів"
+msgstr[2] "ігноровані %d помилок пробільних Ñимволів"
+
+#, c-format
+msgid "%d line adds whitespace errors."
+msgid_plural "%d lines add whitespace errors."
+msgstr[0] "%d Ñ€Ñдок додає помилки пробільних Ñимволів."
+msgstr[1] "%d Ñ€Ñдки додають помилки пробільних Ñимволів."
+msgstr[2] "%d Ñ€Ñдків додають помилки пробільних Ñимволів."
+
+#, c-format
+msgid "%d line applied after fixing whitespace errors."
+msgid_plural "%d lines applied after fixing whitespace errors."
+msgstr[0] "%d Ñ€Ñдок заÑтоÑовано піÑÐ»Ñ Ð²Ð¸Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð¿Ð¾Ð¼Ð¸Ð»Ð¾Ðº пробільних Ñимволів."
+msgstr[1] "%d Ñ€Ñдки заÑтоÑовано піÑÐ»Ñ Ð²Ð¸Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð¿Ð¾Ð¼Ð¸Ð»Ð¾Ðº пробільних Ñимволів."
+msgstr[2] ""
+"%d Ñ€Ñдків заÑтоÑовано піÑÐ»Ñ Ð²Ð¸Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð¿Ð¾Ð¼Ð¸Ð»Ð¾Ðº пробільних Ñимволів."
+
+msgid "Unable to write new index file"
+msgstr "Ðе вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати новий файл індекÑу"
+
+msgid "don't apply changes matching the given path"
+msgstr "не заÑтоÑовувати зміни, що відповідають вказаному шлÑху"
+
+msgid "apply changes matching the given path"
+msgstr "заÑтоÑувати зміни, що відповідають вказаному шлÑху"
+
+msgid "num"
+msgstr "чиÑло"
+
+msgid "remove <num> leading slashes from traditional diff paths"
+msgstr "видалити <num> перших Ñлешів з традиційних diff-шлÑхів"
+
+msgid "ignore additions made by the patch"
+msgstr "ігнорувати доповненнÑ, зроблені латкою"
+
+msgid "instead of applying the patch, output diffstat for the input"
+msgstr "заміÑÑ‚ÑŒ заÑтоÑÑƒÐ²Ð°Ð½Ð½Ñ Ð»Ð°Ñ‚ÐºÐ¸ вивеÑти diffstat Ð´Ð»Ñ Ð²Ñ…Ñ–Ð´Ð½Ð¸Ñ… даних"
+
+msgid "show number of added and deleted lines in decimal notation"
+msgstr "показати кількіÑÑ‚ÑŒ доданих Ñ– видалених Ñ€Ñдків у деÑÑтковій нотації"
+
+msgid "instead of applying the patch, output a summary for the input"
+msgstr "заміÑÑ‚ÑŒ заÑтоÑÑƒÐ²Ð°Ð½Ð½Ñ Ð»Ð°Ñ‚ÐºÐ¸ вивеÑти підÑумок Ð´Ð»Ñ Ð²Ñ…Ñ–Ð´Ð½Ð¸Ñ… даних"
+
+msgid "instead of applying the patch, see if the patch is applicable"
+msgstr "заміÑÑ‚ÑŒ заÑтоÑÑƒÐ²Ð°Ð½Ð½Ñ Ð»Ð°Ñ‚ÐºÐ¸ перевірити можливіÑÑ‚ÑŒ Ñ—Ñ— заÑтоÑуваннÑ"
+
+msgid "make sure the patch is applicable to the current index"
+msgstr "переконатиÑÑ, що латка може бути заÑтоÑовна до поточного індекÑу"
+
+msgid "mark new files with `git add --intent-to-add`"
+msgstr "позначити нові файли командою \"git add --intent-to-add\""
+
+msgid "apply a patch without touching the working tree"
+msgstr "заÑтоÑувати латку, не торкаючиÑÑŒ робочого дерева"
+
+msgid "accept a patch that touches outside the working area"
+msgstr "прийнÑти латку, Ñка виходить за межі робочого проÑтору"
+
+msgid "also apply the patch (use with --stat/--summary/--check)"
+msgstr "також заÑтоÑувати латку (викориÑтовуйте з --stat/--summary/--check)"
+
+msgid "attempt three-way merge, fall back on normal patch if that fails"
+msgstr ""
+"Ñпробувати триÑтороннє злиттÑ, повернутиÑÑ Ð´Ð¾ звичайного латаннÑ, Ñкщо це не "
+"вдаÑÑ‚ÑŒÑÑ"
+
+msgid "build a temporary index based on embedded index information"
+msgstr "Ñтворити тимчаÑовий Ñ–Ð½Ð´ÐµÐºÑ Ð½Ð° оÑнові вбудованої індекÑної інформації"
+
+msgid "paths are separated with NUL character"
+msgstr "шлÑхи відокремлюютьÑÑ Ñимволом NUL"
+
+msgid "ensure at least <n> lines of context match"
+msgstr "забезпечити збіг принаймні <n> Ñ€Ñдків контекÑту"
+
+msgid "action"
+msgstr "діÑ"
+
+msgid "detect new or modified lines that have whitespace errors"
+msgstr "виÑвлÑти нові або змінені Ñ€Ñдки з помилками пробільних Ñимволів"
+
+msgid "ignore changes in whitespace when finding context"
+msgstr "ігнорувати зміни пробільних Ñимволів при пошуку контекÑту"
+
+msgid "apply the patch in reverse"
+msgstr "заÑтоÑувати латку у зворотному порÑдку"
+
+msgid "don't expect at least one line of context"
+msgstr "не очікувати на хоча б один Ñ€Ñдок контекÑту"
+
+msgid "leave the rejected hunks in corresponding *.rej files"
+msgstr "залишити відкинуті шматки у відповідних *.rej файлах"
+
+msgid "allow overlapping hunks"
+msgstr "дозволити Ð¿ÐµÑ€ÐµÐºÑ€Ð¸Ñ‚Ñ‚Ñ ÑˆÐ¼Ð°Ñ‚ÐºÑ–Ð²"
+
+msgid "tolerate incorrectly detected missing new-line at the end of file"
+msgstr "дозволÑти некоректно виÑвлену відÑутніÑÑ‚ÑŒ нового Ñ€Ñдка в кінці файлу"
+
+msgid "do not trust the line counts in the hunk headers"
+msgstr "не довірÑти кількоÑÑ‚Ñ– Ñ€Ñдків у заголовках шматків"
+
+msgid "root"
+msgstr "корінь"
+
+msgid "prepend <root> to all filenames"
+msgstr "додати <корінь> до вÑÑ–Ñ… назв файлів"
+
+msgid "don't return error for empty patches"
+msgstr "не повертати помилку Ð´Ð»Ñ Ð¿Ð¾Ñ€Ð¾Ð¶Ð½Ñ–Ñ… латок"
+
+#, c-format
+msgid "cannot stream blob %s"
+msgstr "неможливо транÑлювати blob %s"
+
+#, c-format
+msgid "unsupported file mode: 0%o (SHA1: %s)"
+msgstr "непідтримуваний режим файлу: 0%o (SHA1: %s)"
+
+#, c-format
+msgid "deflate error (%d)"
+msgstr "помилка Ð¿Ð°ÐºÑƒÐ²Ð°Ð½Ð½Ñ (%d)"
+
+#, c-format
+msgid "unable to start '%s' filter"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити \"%s\" фільтр"
+
+msgid "unable to redirect descriptor"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ½Ð°Ð¿Ñ€Ð°Ð²Ð¸Ñ‚Ð¸ деÑкриптор"
+
+#, c-format
+msgid "'%s' filter reported error"
+msgstr "Фільтр \"%s\" повідомив про помилку"
+
+#, c-format
+msgid "path is not valid UTF-8: %s"
+msgstr "шлÑÑ… не Ñ” припуÑтимим UTF-8: %s"
+
+#, c-format
+msgid "path too long (%d chars, SHA1: %s): %s"
+msgstr "шлÑÑ… занадто довгий (%d Ñимволів, SHA1: %s): %s"
+
+#, c-format
+msgid "timestamp too large for this system: %<PRIuMAX>"
+msgstr "позначка чаÑу занадто велика Ð´Ð»Ñ Ñ†Ñ–Ñ”Ñ— ÑиÑтеми: %<PRIuMAX>"
+
+msgid "git archive [<options>] <tree-ish> [<path>...]"
+msgstr "git archive [<опції>] <деревоподібне-джерело> [<шлÑÑ…>...]"
+
+msgid ""
+"git archive --remote <repo> [--exec <cmd>] [<options>] <tree-ish> [<path>...]"
+msgstr ""
+"git archive --remote <Ñховище> [--exec <команда>] [<опції>] <деревоподібне-"
+"джерело> [<шлÑÑ…>...]"
+
+msgid "git archive --remote <repo> [--exec <cmd>] --list"
+msgstr "git archive --remote <Ñховище> [--exec <команда>] --list"
+
+#, c-format
+msgid "cannot read '%s'"
+msgstr "неможливо прочитати \"%s\""
+
+#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr "визначник шлÑху \"%s\" відповідає файлам поза поточною директорією"
+
+#, c-format
+msgid "pathspec '%s' did not match any files"
+msgstr "визначник шлÑxу \"%s\" не відповідає жодному файлу"
+
+#, c-format
+msgid "no such ref: %.*s"
+msgstr "немає такого поÑиланнÑ: %.*s"
+
+#, c-format
+msgid "not a valid object name: %s"
+msgstr "невірне Ñ–Ð¼â€™Ñ Ð¾Ð±â€™Ñ”ÐºÑ‚Ð°: %s"
+
+#, c-format
+msgid "not a tree object: %s"
+msgstr "не є об’єктом дерева: %s"
+
+#, c-format
+msgid "File not found: %s"
+msgstr "Файл не знайдено: %s"
+
+#, c-format
+msgid "Not a regular file: %s"
+msgstr "Ðе звичайний файл: %s"
+
+#, c-format
+msgid "unclosed quote: '%s'"
+msgstr "незакриті лапки: \"%s\""
+
+#, c-format
+msgid "missing colon: '%s'"
+msgstr "відÑÑƒÑ‚Ð½Ñ Ð´Ð²Ð¾ÐºÑ€Ð°Ð¿ÐºÐ°: \"%s\""
+
+#, c-format
+msgid "empty file name: '%s'"
+msgstr "Ð¿Ð¾Ñ€Ð¾Ð¶Ð½Ñ Ð½Ð°Ð·Ð²Ð° файлу: \"%s\""
+
+msgid "fmt"
+msgstr "fmt"
+
+msgid "archive format"
+msgstr "формат архіву"
+
+msgid "prefix"
+msgstr "префікÑ"
+
+msgid "prepend prefix to each pathname in the archive"
+msgstr "додати Ð¿Ñ€ÐµÑ„Ñ–ÐºÑ Ð´Ð¾ кожної назви шлÑху в архіві"
+
+msgid "file"
+msgstr "файл"
+
+msgid "add untracked file to archive"
+msgstr "додати невідÑтежуваний файл до архіву"
+
+msgid "path:content"
+msgstr "шлÑÑ…:вміÑÑ‚"
+
+msgid "write the archive to this file"
+msgstr "запиÑати архів до цього файлу"
+
+msgid "read .gitattributes in working directory"
+msgstr "прочитати .gitattributes робочої директорії"
+
+msgid "report archived files on stderr"
+msgstr "звітувати про заархівовані файли в stderr"
+
+msgid "time"
+msgstr "чаÑ"
+
+msgid "set modification time of archive entries"
+msgstr "вÑтановити Ñ‡Ð°Ñ Ð¼Ð¾Ð´Ð¸Ñ„Ñ–ÐºÐ°Ñ†Ñ–Ñ— архівних запиÑів"
+
+msgid "set compression level"
+msgstr "вÑтановити рівень компреÑÑ–Ñ—"
+
+msgid "list supported archive formats"
+msgstr "показати ÑпиÑок підтримуваних форматів архівів"
+
+msgid "repo"
+msgstr "Ñховище"
+
+msgid "retrieve the archive from remote repository <repo>"
+msgstr "отримати архів з віддаленого <Ñховища>"
+
+msgid "command"
+msgstr "команда"
+
+msgid "path to the remote git-upload-archive command"
+msgstr "шлÑÑ… до віддаленої команди git-upload-archive"
+
+msgid "Unexpected option --remote"
+msgstr "Ðеочікувана Ð¾Ð¿Ñ†Ñ–Ñ --remote"
+
+#, c-format
+msgid "the option '%s' requires '%s'"
+msgstr "Ð¾Ð¿Ñ†Ñ–Ñ \"%s\" потребує \"%s\""
+
+msgid "Unexpected option --output"
+msgstr "Ðеочікувана Ð¾Ð¿Ñ†Ñ–Ñ --output"
+
+#, c-format
+msgid "extra command line parameter '%s'"
+msgstr "зайвий параметр командного Ñ€Ñдка: \"%s\""
+
+#, c-format
+msgid "Unknown archive format '%s'"
+msgstr "Ðевідомий формат архіву \"%s\""
+
+#, c-format
+msgid "Argument not supported for format '%s': -%d"
+msgstr "Ðргумент не підтримуєтьÑÑ Ð´Ð»Ñ Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚Ñƒ \"%s\": -%d"
+
+#, c-format
+msgid "%.*s is not a valid attribute name"
+msgstr "%.*s не Ñ” припуÑтимою назвою атрибута"
+
+msgid "unable to add additional attribute"
+msgstr "не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ додатковий атрибут"
+
+#, c-format
+msgid "ignoring overly long attributes line %d"
+msgstr "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð°Ð´Ñ‚Ð¾ довгого Ñ€Ñдка атрибутів %d"
+
+#, c-format
+msgid "%s not allowed: %s:%d"
+msgstr "%s не дозволено: %s:%d"
+
+msgid ""
+"Negative patterns are ignored in git attributes\n"
+"Use '\\!' for literal leading exclamation."
+msgstr ""
+"Ðегативні шаблони ігноруютьÑÑ Ð² git атрибутах\n"
+"ВикориÑтовуйте \"\\!\" Ð´Ð»Ñ Ð´Ð¾Ð´Ð°Ð½Ð½Ñ Ð·Ð½Ð°ÐºÐ° оклику."
+
+#, c-format
+msgid "cannot fstat gitattributes file '%s'"
+msgstr "неможливо виконати fstat Ð´Ð»Ñ Ñ„Ð°Ð¹Ð»Ð° git атрибутів \"%s\""
+
+#, c-format
+msgid "ignoring overly large gitattributes file '%s'"
+msgstr "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð°Ð´Ñ‚Ð¾ великого файлу gitattributes \"%s\""
+
+#, c-format
+msgid "ignoring overly large gitattributes blob '%s'"
+msgstr "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð°Ð´Ñ‚Ð¾ великих gitattributes blob \"%s\""
+
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "невірний --attr-source або GIT_ATTR_SOURCE"
+
+#, c-format
+msgid "unable to stat '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ stat Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "unable to read %s"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ %s"
+
+#, c-format
+msgid "Badly quoted content in file '%s': %s"
+msgstr "Ðевірно процитований вміÑÑ‚ у файлі \"%s\": %s"
+
+#, c-format
+msgid "We cannot bisect more!\n"
+msgstr "Подальше біÑÐµÐºÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð½ÐµÐ¼Ð¾Ð¶Ð»Ð¸Ð²Ð¾!\n"
+
+#, c-format
+msgid "Not a valid commit name %s"
+msgstr "Ðе Ñ” дійÑною назвою коміту %s"
+
+#, c-format
+msgid ""
+"The merge base %s is bad.\n"
+"This means the bug has been fixed between %s and [%s].\n"
+msgstr ""
+"База Ð·Ð»Ð¸Ñ‚Ñ‚Ñ %s Ñ” невірною.\n"
+"Це означає, що помилку було виправлено між %s та [%s].\n"
+
+#, c-format
+msgid ""
+"The merge base %s is new.\n"
+"The property has changed between %s and [%s].\n"
+msgstr ""
+"База Ð·Ð»Ð¸Ñ‚Ñ‚Ñ %s Ñ” новою.\n"
+"ВлаÑтивіÑÑ‚ÑŒ змінилаÑÑ Ð¼Ñ–Ð¶ %s та [%s].\n"
+
+#, c-format
+msgid ""
+"The merge base %s is %s.\n"
+"This means the first '%s' commit is between %s and [%s].\n"
+msgstr ""
+"Базою Ð·Ð»Ð¸Ñ‚Ñ‚Ñ %s Ñ” %s.\n"
+"Це означає, що перший \"%s\" коміт знаходитьÑÑ Ð¼Ñ–Ð¶ %s Ñ– [%s].\n"
+
+#, c-format
+msgid ""
+"Some %s revs are not ancestors of the %s rev.\n"
+"git bisect cannot work properly in this case.\n"
+"Maybe you mistook %s and %s revs?\n"
+msgstr ""
+"ДеÑкі %s revs не Ñ” предками %s rev.\n"
+"git bisect не може працювати належним чином в таких випадках.\n"
+"Можливо, ви переплутали %s і %s revs?\n"
+
+#, c-format
+msgid ""
+"the merge base between %s and [%s] must be skipped.\n"
+"So we cannot be sure the first %s commit is between %s and %s.\n"
+"We continue anyway."
+msgstr ""
+"базу Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð¼Ñ–Ð¶ %s Ñ– [%s] потрібно пропуÑтити.\n"
+"Тому ми не можемо бути впевнені, що перший коміт %s знаходитьÑÑ Ð¼Ñ–Ð¶ %s Ñ– "
+"%s.\n"
+"Ми вÑе одно продовжимо."
+
+#, c-format
+msgid "Bisecting: a merge base must be tested\n"
+msgstr "БіÑекціÑ: база Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð° бути протеÑтована\n"
+
+#, c-format
+msgid "a %s revision is needed"
+msgstr "необхідна Ñ€ÐµÐ²Ñ–Ð·Ñ–Ñ %s"
+
+#, c-format
+msgid "could not create file '%s'"
+msgstr "не вдалоÑÑ Ñтворити файл \"%s\""
+
+#, c-format
+msgid "could not read file '%s'"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ файл \"%s\""
+
+msgid "reading bisect refs failed"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ біÑекційні поÑиланнÑ"
+
+#, c-format
+msgid "%s was both %s and %s\n"
+msgstr "%s був одночаÑно Ñ– %s, Ñ– %s\n"
+
+#, c-format
+msgid ""
+"No testable commit found.\n"
+"Maybe you started with bad path arguments?\n"
+msgstr ""
+"Ðе знайдено коміт Ð´Ð»Ñ Ñ‚ÐµÑтуваннÑ.\n"
+"Можливо, ви почали з невірних аргументів шлÑху?\n"
+
+#, c-format
+msgid "(roughly %d step)"
+msgid_plural "(roughly %d steps)"
+msgstr[0] "(приблизно %d крок)"
+msgstr[1] "(приблизно %d кроки)"
+msgstr[2] "(приблизно %d кроків)"
+
+#. TRANSLATORS: the last %s will be replaced with "(roughly %d
+#. steps)" translation.
+#.
+#, c-format
+msgid "Bisecting: %d revision left to test after this %s\n"
+msgid_plural "Bisecting: %d revisions left to test after this %s\n"
+msgstr[0] "БіÑекціÑ: залишилоÑÑ Ð¿Ñ€Ð¾Ñ‚ÐµÑтувати %d ревізію піÑÐ»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ %s\n"
+msgstr[1] "БіÑекціÑ: залишилоÑÑ Ð¿Ñ€Ð¾Ñ‚ÐµÑтувати %d ревізії піÑÐ»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ %s\n"
+msgstr[2] "БіÑекціÑ: залишилоÑÑ Ð¿Ñ€Ð¾Ñ‚ÐµÑтувати %d ревізій піÑÐ»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ %s\n"
+
+msgid "--contents and --reverse do not blend well."
+msgstr "--contents Ñ– --reverse поєднуютьÑÑ Ð½Ðµ дуже добре."
+
+msgid "--reverse and --first-parent together require specified latest commit"
+msgstr "--reverse Ñ– --first-parent разом вимагають вказівки оÑтаннього коміту"
+
+msgid "revision walk setup failed"
+msgstr "не вдалоÑÑ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ñ‚Ð¸ Ð¿Ñ€Ð¾Ñ…Ð¾Ð´Ð¶ÐµÐ½Ð½Ñ Ð¿Ð¾ ревізіÑм"
+
+msgid ""
+"--reverse --first-parent together require range along first-parent chain"
+msgstr ""
+"--reverse --first-parent разом вимагають вказівки діапазону вздовж ланцюжка "
+"першого батька"
+
+#, c-format
+msgid "no such path %s in %s"
+msgstr "немає шлÑху %s в %s"
+
+#, c-format
+msgid "cannot read blob %s for path %s"
+msgstr "неможливо прочитати blob %s Ð´Ð»Ñ ÑˆÐ»Ñху %s"
+
+msgid ""
+"cannot inherit upstream tracking configuration of multiple refs when "
+"rebasing is requested"
+msgstr ""
+"неможливо уÑпадкувати першоджерельну конфігурацію відÑÑ‚ÐµÐ¶ÑƒÐ²Ð°Ð½Ð½Ñ ÐºÑ–Ð»ÑŒÐºÐ¾Ñ… "
+"поÑилань при запиті перебазуваннÑ"
+
+#, c-format
+msgid "not setting branch '%s' as its own upstream"
+msgstr "гілку \"%s\" не вÑтановлено влаÑним першоджерельним Ñховищем"
+
+#, c-format
+msgid "branch '%s' set up to track '%s' by rebasing."
+msgstr "гілку \"%s\" налаштовано на відÑÑ‚ÐµÐ¶ÑƒÐ²Ð°Ð½Ð½Ñ \"%s\" через перебазуваннÑ."
+
+#, c-format
+msgid "branch '%s' set up to track '%s'."
+msgstr "гілку \"%s\" налаштовано на відÑÑ‚ÐµÐ¶ÑƒÐ²Ð°Ð½Ð½Ñ \"%s\"."
+
+#, c-format
+msgid "branch '%s' set up to track:"
+msgstr "гілку \"%s\" налаштовано на відÑтежуваннÑ:"
+
+msgid "unable to write upstream branch configuration"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати конфігурацію виÑхідної гілки"
+
+msgid ""
+"\n"
+"After fixing the error cause you may try to fix up\n"
+"the remote tracking information by invoking:"
+msgstr ""
+"\n"
+"ПіÑÐ»Ñ ÑƒÑÑƒÐ½ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¸Ñ‡Ð¸Ð½Ð¸ помилки ви можете Ñпробувати виправити\n"
+"інформацію про віддалене відÑÑ‚ÐµÐ¶ÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð´Ñ–Ð¹Ñнівши виклик:"
+
+#, c-format
+msgid "asked to inherit tracking from '%s', but no remote is set"
+msgstr ""
+"проÑили уÑпадкувати відÑÑ‚ÐµÐ¶ÑƒÐ²Ð°Ð½Ð½Ñ Ð· \"%s\", але віддалене Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ "
+"вÑтановлено"
+
+#, c-format
+msgid "asked to inherit tracking from '%s', but no merge configuration is set"
+msgstr ""
+"проÑили уÑпадкувати відÑÑ‚ÐµÐ¶ÑƒÐ²Ð°Ð½Ð½Ñ Ð· \"%s\", але конфігурацію Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ðµ задано"
+
+#, c-format
+msgid "not tracking: ambiguous information for ref '%s'"
+msgstr "не відÑтежуєтьÑÑ: неоднозначна Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð´Ð»Ñ Ð¿Ð¾ÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\""
+
+#. #-#-#-#-# branch.c.po #-#-#-#-#
+#. TRANSLATORS: This is a line listing a remote with duplicate
+#. refspecs in the advice message below. For RTL languages you'll
+#. probably want to swap the "%s" and leading " " space around.
+#.
+#. #-#-#-#-# object-name.c.po #-#-#-#-#
+#. TRANSLATORS: This is line item of ambiguous object output
+#. from describe_ambiguous_object() above. For RTL languages
+#. you'll probably want to swap the "%s" and leading " " space
+#. around.
+#.
+#, c-format
+msgid " %s\n"
+msgstr " %s\n"
+
+#. TRANSLATORS: The second argument is a \n-delimited list of
+#. duplicate refspecs, composed above.
+#.
+#, c-format
+msgid ""
+"There are multiple remotes whose fetch refspecs map to the remote\n"
+"tracking ref '%s':\n"
+"%s\n"
+"This is typically a configuration error.\n"
+"\n"
+"To support setting up tracking branches, ensure that\n"
+"different remotes' fetch refspecs map into different\n"
+"tracking namespaces."
+msgstr ""
+"ІÑнує кілька віддалених призначень, визначники Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð¿Ð¾Ñилань Ñких "
+"розвʼÑзуютьÑÑ Ñƒ віддалено \n"
+"відÑтежуване поÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\":\n"
+"%s\n"
+"Зазвичай це помилка конфігурації.\n"
+"\n"
+"Щоб підтримувати Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð³Ñ–Ð»Ð¾Ðº відÑтежуваннÑ, переконайтеÑÑ, що\n"
+"визначники Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð¿Ð¾Ñилань різних віддалених призначень розвʼÑзуютьÑÑ Ñƒ "
+"різні\n"
+"проÑтори імен відÑтежуваннÑ."
+
+#, c-format
+msgid "'%s' is not a valid branch name"
+msgstr "\"%s\" не Ñ” допуÑтимою назвою гілки"
+
+#, c-format
+msgid "a branch named '%s' already exists"
+msgstr "гілка з ім’Ñм \"%s\" вже Ñ–Ñнує"
+
+#, c-format
+msgid "cannot force update the branch '%s' used by worktree at '%s'"
+msgstr ""
+"неможливо примуÑово оновити гілку \"%s\", Ñка викориÑтовуєтьÑÑ Ñ€Ð¾Ð±Ð¾Ñ‡Ð¸Ð¼ "
+"деревом у \"%s\""
+
+#, c-format
+msgid "cannot set up tracking information; starting point '%s' is not a branch"
+msgstr ""
+"неможливо налаштувати інформацію про відÑтежуваннÑ; початкова точка \"%s\" "
+"не є гілкою"
+
+#, c-format
+msgid "the requested upstream branch '%s' does not exist"
+msgstr "запитувана виÑхідна гілка \"%s\" не Ñ–Ñнує"
+
+msgid ""
+"\n"
+"If you are planning on basing your work on an upstream\n"
+"branch that already exists at the remote, you may need to\n"
+"run \"git fetch\" to retrieve it.\n"
+"\n"
+"If you are planning to push out a new local branch that\n"
+"will track its remote counterpart, you may want to use\n"
+"\"git push -u\" to set the upstream config as you push."
+msgstr ""
+"\n"
+"Якщо ви плануєте базувати Ñвою роботу на оÑнові першоджерельної\n"
+"гілки, Ñка вже Ñ–Ñнує на віддаленому призначенні, вам може знадобитиÑÑ\n"
+"запуÑтити \"git fetch\", щоб отримати Ñ—Ñ—.\n"
+"\n"
+"Якщо ви плануєте надіÑлати нову локальну гілку, Ñка\n"
+"буде відÑтежувати Ñвою віддалену гілку, вам Ñлід ÑкориÑтатиÑÑ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¾ÑŽ\n"
+"\"git push -u\", щоб вÑтановити конфігурацію першоджерельного Ñховища під "
+"Ñ‡Ð°Ñ Ð½Ð°Ð´ÑиланнÑ."
+
+#, c-format
+msgid "not a valid object name: '%s'"
+msgstr "не Ñ” допуÑтимою назвою об’єкта: \"%s\""
+
+#, c-format
+msgid "ambiguous object name: '%s'"
+msgstr "неоднозначна назва об’єкта: \"%s\""
+
+#, c-format
+msgid "not a valid branch point: '%s'"
+msgstr "не Ñ” допуÑтимою точкою розгалуженнÑ: \"%s\""
+
+#, c-format
+msgid "submodule '%s': unable to find submodule"
+msgstr "підмодуль \"%s\": не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ підмодуль"
+
+#, c-format
+msgid ""
+"You may try updating the submodules using 'git checkout --no-recurse-"
+"submodules %s && git submodule update --init'"
+msgstr ""
+"Ви можете Ñпробувати оновити підмодулі за допомогою \"git checkout --no-"
+"recurse-submodules %s && git submodule update --init\"."
+
+#, c-format
+msgid "submodule '%s': cannot create branch '%s'"
+msgstr "підмодуль \"%s\": неможливо Ñтворити гілку \"%s\""
+
+#, c-format
+msgid "'%s' is already used by worktree at '%s'"
+msgstr "\"%s\" вже викориÑтовуєтьÑÑ Ñ€Ð¾Ð±Ð¾Ñ‡Ð¸Ð¼ деревом в \"%s\""
+
+msgid "git add [<options>] [--] <pathspec>..."
+msgstr "git add [<опції>] [--] <визначник шлÑху>..."
+
+#, c-format
+msgid "cannot chmod %cx '%s'"
+msgstr "неможливо виконати chmod %cx \"%s\""
+
+msgid "Unstaged changes after refreshing the index:"
+msgstr "ÐеіндекÑовані зміни піÑÐ»Ñ Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ñ–Ð½Ð´ÐµÐºÑу:"
+
+msgid ""
+"the add.interactive.useBuiltin setting has been removed!\n"
+"See its entry in 'git help config' for details."
+msgstr ""
+"параметр add.interactive.useBuiltin було видалено!\n"
+"ДивітьÑÑ Ð·Ð°Ð¿Ð¸Ñ Ñƒ \"git help config\" Ð´Ð»Ñ Ð±Ñ–Ð»ÑŒÑˆ детальної інформації."
+
+msgid "could not read the index"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ індекÑ"
+
+msgid "editing patch failed"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ñ‚Ð¸ латку"
+
+#, c-format
+msgid "could not stat '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ stat \"%s\""
+
+msgid "empty patch. aborted"
+msgstr "Ð¿Ð¾Ñ€Ð¾Ð¶Ð½Ñ Ð»Ð°Ñ‚ÐºÐ°. перервано"
+
+#, c-format
+msgid "could not apply '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°ÑтоÑувати \"%s\""
+
+msgid "The following paths are ignored by one of your .gitignore files:\n"
+msgstr "ÐаÑтупні шлÑхи ігноруютьÑÑ Ð¾Ð´Ð½Ð¸Ð¼ з ваших .gitignore файлів:\n"
+
+msgid "dry run"
+msgstr "пробний запуÑк"
+
+msgid "be verbose"
+msgstr "розгорнутий вивід"
+
+msgid "interactive picking"
+msgstr "інтерактивний вибір"
+
+msgid "select hunks interactively"
+msgstr "обирати шматки інтерактивно"
+
+msgid "edit current diff and apply"
+msgstr "відредагувати поточну різницю Ñ– заÑтоÑувати"
+
+msgid "allow adding otherwise ignored files"
+msgstr "дозволити Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ñ–Ð³Ð½Ð¾Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ… файлів"
+
+msgid "update tracked files"
+msgstr "оновити відÑтежувані файли"
+
+msgid "renormalize EOL of tracked files (implies -u)"
+msgstr "перенормувати EOL відÑтежуваних файлів (маєтьÑÑ Ð½Ð° увазі -u)"
+
+msgid "record only the fact that the path will be added later"
+msgstr "запиÑати лише той факт, що шлÑÑ… буде додано пізніше"
+
+msgid "add changes from all tracked and untracked files"
+msgstr "додати зміни з уÑÑ–Ñ… відÑтежуваних Ñ– невідÑтежуваних файлів"
+
+msgid "ignore paths removed in the working tree (same as --no-all)"
+msgstr "ігнорувати шлÑхи, видалені у робочому дереві (те Ñаме, що й --no-all)"
+
+msgid "don't add, only refresh the index"
+msgstr "не додавати, лише оновити індекÑ"
+
+msgid "just skip files which cannot be added because of errors"
+msgstr "проÑто пропуÑтити файли, Ñкі не можуть бути додані через помилки"
+
+msgid "check if - even missing - files are ignored in dry run"
+msgstr ""
+"перевірити, чи ігноруютьÑÑ Ñ„Ð°Ð¹Ð»Ð¸, навіть Ñкщо вони відÑутні, під Ñ‡Ð°Ñ "
+"пробного запуÑку"
+
+msgid "allow updating entries outside of the sparse-checkout cone"
+msgstr "дозволити Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð·Ð°Ð¿Ð¸Ñів за межами конуÑа розрідженого переходу"
+
+msgid "override the executable bit of the listed files"
+msgstr "перевизначити біт Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ Ð´Ð»Ñ Ð·Ð°Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ… файлів"
+
+msgid "warn when adding an embedded repository"
+msgstr "попереджувати при додаванні вбудованого Ñховища"
+
+#, c-format
+msgid ""
+"You've added another git repository inside your current repository.\n"
+"Clones of the outer repository will not contain the contents of\n"
+"the embedded repository and will not know how to obtain it.\n"
+"If you meant to add a submodule, use:\n"
+"\n"
+"\tgit submodule add <url> %s\n"
+"\n"
+"If you added this path by mistake, you can remove it from the\n"
+"index with:\n"
+"\n"
+"\tgit rm --cached %s\n"
+"\n"
+"See \"git help submodule\" for more information."
+msgstr ""
+"Ви додали ще одне git Ñховище вÑередині вашого поточного Ñховища.\n"
+"Клони зовнішнього Ñховища не міÑтитимуть вміÑту\n"
+"вбудованого Ñховища Ñ– не знатимуть, Ñк його отримати.\n"
+"Якщо ви хочете додати підмодуль, ÑкориÑтайтеÑÑŒ командою\n"
+"\n"
+"\tgit submodule add <url> %s\n"
+"\n"
+"Якщо ви додали цей шлÑÑ… помилково, ви можете видалити його з\n"
+"індекÑу за допомогою:\n"
+"\n"
+"\tgit rm --cached %s\n"
+"\n"
+"Докладніше дивітьÑÑ Ñƒ \"git help submodule\"."
+
+#, c-format
+msgid "adding embedded git repository: %s"
+msgstr "Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð²Ð±ÑƒÐ´Ð¾Ð²Ð°Ð½Ð¾Ð³Ð¾ git Ñховища: %s"
+
+msgid ""
+"Use -f if you really want to add them.\n"
+"Turn this message off by running\n"
+"\"git config advice.addIgnoredFile false\""
+msgstr ""
+"ВикориÑтовуйте -f, Ñкщо ви дійÑно хочете Ñ—Ñ… додати.\n"
+"Щоб вимкнути це повідомленнÑ, виконайте\n"
+"\"git config advice.addIgnoredFile false\""
+
+msgid "adding files failed"
+msgstr "Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñ–Ð² завершилоÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "--chmod param '%s' must be either -x or +x"
+msgstr "--chmod параметр \"%s\" має бути -x або +x"
+
+#, c-format
+msgid "'%s' and pathspec arguments cannot be used together"
+msgstr "\"%s\" та аргументи визначника шлÑху не можна викориÑтовувати разом"
+
+#, c-format
+msgid "Nothing specified, nothing added.\n"
+msgstr "Ðічого не зазначено, нічого не додано.\n"
+
+msgid ""
+"Maybe you wanted to say 'git add .'?\n"
+"Turn this message off by running\n"
+"\"git config advice.addEmptyPathspec false\""
+msgstr ""
+"Можливо, ви хотіли вказати \"git add .\"?\n"
+"Щоб вимкнути це повідомленнÑ, виконайте\n"
+"\"git config advice.addEmptyPathspec false\""
+
+msgid "index file corrupt"
+msgstr "індекÑний файл пошкоджено"
+
+msgid "unable to write new index file"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати новий файл індекÑу"
+
+#, c-format
+msgid "bad action '%s' for '%s'"
+msgstr "невірна Ð´Ñ–Ñ \"%s\" Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "invalid value for '%s': '%s'"
+msgstr "неприпуÑтиме Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ \"%s\": \"%s\""
+
+#, c-format
+msgid "could not read '%s'"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ \"%s\""
+
+msgid "could not parse author script"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ author script"
+
+#, c-format
+msgid "could not parse %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ %s"
+
+#, c-format
+msgid "'%s' was deleted by the applypatch-msg hook"
+msgstr "\"%s\" було видалено applypatch-msg гачком"
+
+#, c-format
+msgid "Malformed input line: '%s'."
+msgstr "Ðевірно Ñформований Ñ€Ñдок вводу: \"%s\"."
+
+#, c-format
+msgid "Failed to copy notes from '%s' to '%s'"
+msgstr "Ðе вдалоÑÑ Ñкопіювати нотатки з \"%s\" в \"%s\""
+
+msgid "fseek failed"
+msgstr "fseek завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "could not open '%s' for reading"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ \"%s\" Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ"
+
+#, c-format
+msgid "could not open '%s' for writing"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ \"%s\" Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу"
+
+#, c-format
+msgid "could not parse patch '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ латку \"%s\""
+
+msgid "Only one StGIT patch series can be applied at once"
+msgstr "Можна заÑтоÑовувати лише одну Ñерію StGIT латок одразу"
+
+msgid "invalid timestamp"
+msgstr "неприпуÑтима позначка чаÑу"
+
+msgid "invalid Date line"
+msgstr "неприпуÑтимий Ñ€Ñдок дати"
+
+msgid "invalid timezone offset"
+msgstr "неприпуÑтиме Ð·Ð¼Ñ–Ñ‰ÐµÐ½Ð½Ñ Ñ‡Ð°Ñового поÑÑу"
+
+msgid "Patch format detection failed."
+msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ формат латки."
+
+#, c-format
+msgid "failed to create directory '%s'"
+msgstr "не вдалоÑÑ Ñтворити директорію \"%s\""
+
+msgid "Failed to split patches."
+msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·Ñ‰ÐµÐ¿Ð¸Ñ‚Ð¸ латки."
+
+#, c-format
+msgid "When you have resolved this problem, run \"%s --continue\"."
+msgstr "Коли ви вирішите цю проблему, виконайте \"%s --continue\"."
+
+#, c-format
+msgid "If you prefer to skip this patch, run \"%s --skip\" instead."
+msgstr ""
+"Якщо ви бажаєте пропуÑтити цю латку, виконайте \"%s --skip\" заміÑÑ‚ÑŒ цього."
+
+#, c-format
+msgid "To record the empty patch as an empty commit, run \"%s --allow-empty\"."
+msgstr ""
+"Щоб запиÑати порожню латку Ñк порожній коміт, виконайте \"%s --allow-empty\"."
+
+#, c-format
+msgid "To restore the original branch and stop patching, run \"%s --abort\"."
+msgstr ""
+"Щоб повернути гілку до початкового Ñтану Ñ– зупинити латаннÑ, виконайте \"%s "
+"--abort\"."
+
+msgid "Patch sent with format=flowed; space at the end of lines might be lost."
+msgstr ""
+"Латку надіÑлано з параметром format=flowed; пробіли в кінці Ñ€Ñдків можуть "
+"бути втрачені."
+
+#, c-format
+msgid "missing author line in commit %s"
+msgstr "відÑутній Ñ€Ñдок автора в коміті %s"
+
+#, c-format
+msgid "invalid ident line: %.*s"
+msgstr "неприпуÑтимий ідентифікаційний Ñ€Ñдок: %.*s"
+
+#, c-format
+msgid "unable to parse commit %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ коміт %s"
+
+msgid "Repository lacks necessary blobs to fall back on 3-way merge."
+msgstr ""
+"У Ñховищі не виÑтачає необхідних blob-обʼєктів, щоб повернутиÑÑ Ð´Ð¾ "
+"триÑтороннього злиттÑ."
+
+msgid "Using index info to reconstruct a base tree..."
+msgstr ""
+"ВикориÑÑ‚Ð°Ð½Ð½Ñ Ñ–Ð½Ð´ÐµÐºÑної інформації Ð´Ð»Ñ Ñ€ÐµÐºÐ¾Ð½ÑÑ‚Ñ€ÑƒÑŽÐ²Ð°Ð½Ð½Ñ Ð±Ð°Ð·Ð¾Ð²Ð¾Ð³Ð¾ дерева..."
+
+msgid ""
+"Did you hand edit your patch?\n"
+"It does not apply to blobs recorded in its index."
+msgstr ""
+"Ви відредагували Ñвою латку вручну?\n"
+"Це не ÑтоÑуєтьÑÑ blob-обʼєктів, запиÑаних у його індекÑÑ–."
+
+msgid "Falling back to patching base and 3-way merge..."
+msgstr "ÐŸÐ¾Ð²ÐµÑ€Ð½ÐµÐ½Ð½Ñ Ð´Ð¾ бази латки та триÑтороннього злиттÑ..."
+
+msgid "Failed to merge in the changes."
+msgstr "Ðе вдалоÑÑ Ð·Ð»Ð¸Ñ‚Ð¸ зміни."
+
+msgid "git write-tree failed to write a tree"
+msgstr "git write-tree не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати дерево"
+
+msgid "applying to an empty history"
+msgstr "заÑтоÑÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð¾ порожньої Ñ–Ñторії"
+
+msgid "failed to write commit object"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати об’єкт коміту"
+
+#, c-format
+msgid "cannot resume: %s does not exist."
+msgstr "неможливо продовжити: %s не Ñ–Ñнує."
+
+msgid "Commit Body is:"
+msgstr "Тіло коміту:"
+
+#. TRANSLATORS: Make sure to include [y], [n], [e], [v] and [a]
+#. in your translation. The program will only accept English
+#. input at this point.
+#.
+#, c-format
+msgid "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all: "
+msgstr ""
+"ЗаÑтоÑувати? [y]-так / [n]-ні / [e]-редагувати / [v]-переглÑнути латку / [a]-"
+"заÑтоÑувати вÑе: "
+
+msgid "unable to write index file"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати індекÑний файл"
+
+#, c-format
+msgid "Dirty index: cannot apply patches (dirty: %s)"
+msgstr "Ð†Ð½Ð´ÐµÐºÑ Ð·Ð°Ð±Ñ€ÑƒÐ´Ð½ÐµÐ½Ð¾: неможливо заÑтоÑувати латки (забруднено: %s)"
+
+#, c-format
+msgid "Skipping: %.*s"
+msgstr "ПропуÑк: %.*s"
+
+#, c-format
+msgid "Creating an empty commit: %.*s"
+msgstr "Ð¡Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð¿Ð¾Ñ€Ð¾Ð¶Ð½ÑŒÐ¾Ð³Ð¾ коміту: %.*s"
+
+msgid "Patch is empty."
+msgstr "Латка порожнÑ."
+
+#, c-format
+msgid "Applying: %.*s"
+msgstr "ЗаÑтоÑуваннÑ: %.*s"
+
+msgid "No changes -- Patch already applied."
+msgstr "Без змін - латку вже заÑтоÑовано."
+
+#, c-format
+msgid "Patch failed at %s %.*s"
+msgstr "Ð›Ð°Ñ‚Ð°Ð½Ð½Ñ Ð½Ðµ вдалоÑÑ Ð½Ð° %s %.*s"
+
+msgid "Use 'git am --show-current-patch=diff' to see the failed patch"
+msgstr ""
+"СкориÑтайтеÑÑŒ \"git am --show-current-patch=diff\", щоб побачити невдалу "
+"латку"
+
+msgid "No changes - recorded it as an empty commit."
+msgstr "Без змін - запиÑаний Ñк порожній коміт."
+
+msgid ""
+"No changes - did you forget to use 'git add'?\n"
+"If there is nothing left to stage, chances are that something else\n"
+"already introduced the same changes; you might want to skip this patch."
+msgstr ""
+"Без змін - ви забули викориÑтати \"git add\"?\n"
+"Якщо нічого індекÑувати, Ñ” ймовірніÑÑ‚ÑŒ того, що хтоÑÑŒ інший\n"
+"вже Ð²Ð½Ñ–Ñ Ñ‚Ñ– Ñамі зміни; можливо, ви захочете пропуÑтити цю латку."
+
+msgid ""
+"You still have unmerged paths in your index.\n"
+"You should 'git add' each file with resolved conflicts to mark them as "
+"such.\n"
+"You might run `git rm` on a file to accept \"deleted by them\" for it."
+msgstr ""
+"У вашому індекÑÑ– вÑе ще залишаютьÑÑ Ð½Ðµ злиті шлÑхи.\n"
+"Вам Ñлід виконати \"git add\" Ð´Ð»Ñ ÐºÐ¾Ð¶Ð½Ð¾Ð³Ð¾ файлу з розвʼÑзаними конфліктами, "
+"щоб позначити Ñ—Ñ… Ñк такі.\n"
+"Ви можете виконати \"git rm\" Ð´Ð»Ñ Ñ„Ð°Ð¹Ð»Ñƒ, щоб прийнÑти \"видалено ними\"."
+
+#, c-format
+msgid "Could not parse object '%s'."
+msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ об'єкт '%s'."
+
+msgid "failed to clean index"
+msgstr "не вдалоÑÑ Ð¾Ñ‡Ð¸Ñтити індекÑ"
+
+msgid ""
+"You seem to have moved HEAD since the last 'am' failure.\n"
+"Not rewinding to ORIG_HEAD"
+msgstr ""
+"ЗдаєтьÑÑ, ви переміÑтили HEAD піÑÐ»Ñ Ð¾Ñтанньої невдачі з \"am\".\n"
+"ÐŸÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¿ÐµÑ€ÐµÐ´ до ORIG_HEAD не виконуєтьÑÑ"
+
+#, c-format
+msgid "failed to read '%s'"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ \"%s\""
+
+msgid "git am [<options>] [(<mbox> | <Maildir>)...]"
+msgstr "git am [<опції>] [(<Ñкринька> [<поштова директоріÑ>)...]"
+
+msgid "git am [<options>] (--continue | --skip | --abort)"
+msgstr "git am [<опції>] (--continue | --skip | --abort)"
+
+msgid "run interactively"
+msgstr "запуÑтити інтерактивно"
+
+msgid "bypass pre-applypatch and applypatch-msg hooks"
+msgstr "обійти pre-applypatch та applypatch-msg гачки"
+
+msgid "historical option -- no-op"
+msgstr "Ñтара Ð¾Ð¿Ñ†Ñ–Ñ -- не працює"
+
+msgid "allow fall back on 3way merging if needed"
+msgstr "дозволити повернутиÑÑ Ð´Ð¾ триÑтороннього Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ñƒ разі потреби"
+
+msgid "be quiet"
+msgstr "працювати тихеÑенько"
+
+msgid "add a Signed-off-by trailer to the commit message"
+msgstr "додати Signed-off-by причіп у Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту"
+
+msgid "recode into utf8 (default)"
+msgstr "перекодувати в utf8 (за замовчуваннÑм)"
+
+msgid "pass -k flag to git-mailinfo"
+msgstr "передати -k прапорець до git-mailinfo"
+
+msgid "pass -b flag to git-mailinfo"
+msgstr "передати -b прапорець до git-mailinfo"
+
+msgid "pass -m flag to git-mailinfo"
+msgstr "передати -m прапорець до git-mailinfo"
+
+msgid "pass --keep-cr flag to git-mailsplit for mbox format"
+msgstr "передати --keep-cr прапорець до git-mailsplit Ð´Ð»Ñ Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚Ñƒ mbox"
+
+msgid "strip everything before a scissors line"
+msgstr "прибрати вÑе раніше відрізної лінії"
+
+msgid "pass it through git-mailinfo"
+msgstr "передати через git-mailinfo"
+
+msgid "pass it through git-apply"
+msgstr "передати через git-apply"
+
+msgid "n"
+msgstr "н"
+
+msgid "format"
+msgstr "формат"
+
+msgid "format the patch(es) are in"
+msgstr "формат латки(-ок)"
+
+msgid "override error message when patch failure occurs"
+msgstr "перевизначити Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¾ помилку при збої латаннÑ"
+
+msgid "continue applying patches after resolving a conflict"
+msgstr "продовжити заÑтоÑÑƒÐ²Ð°Ð½Ð½Ñ Ð»Ð°Ñ‚ÐºÐ¸ піÑÐ»Ñ Ð²Ð¸Ñ€Ñ–ÑˆÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ð»Ñ–ÐºÑ‚Ñƒ"
+
+msgid "synonyms for --continue"
+msgstr "те ж Ñаме, що й --continue"
+
+msgid "skip the current patch"
+msgstr "пропуÑтити поточну латку"
+
+msgid "restore the original branch and abort the patching operation"
+msgstr "відновити початкову гілку Ñ– перервати операцію латаннÑ"
+
+msgid "abort the patching operation but keep HEAD where it is"
+msgstr "перервати латаннÑ, але залишити HEAD на тому міÑці, де він знаходитьÑÑ"
+
+msgid "show the patch being applied"
+msgstr "показати латку, що заÑтоÑовуєтьÑÑ"
+
+msgid "record the empty patch as an empty commit"
+msgstr "запиÑати порожню латку Ñк порожній коміт"
+
+msgid "lie about committer date"
+msgstr "брехати про дату комітера"
+
+msgid "use current timestamp for author date"
+msgstr "викориÑтовувати поточну мітку чаÑу Ð´Ð»Ñ Ð´Ð°Ñ‚Ð¸ автора"
+
+msgid "key-id"
+msgstr "key-id"
+
+msgid "GPG-sign commits"
+msgstr "підпиÑати коміти GPG-підпиÑом"
+
+msgid "how to handle empty patches"
+msgstr "Ñк оброблÑти порожні латки"
+
+msgid "(internal use for git-rebase)"
+msgstr "(внутрішнє викориÑÑ‚Ð°Ð½Ð½Ñ Ð´Ð»Ñ git-rebase)"
+
+msgid ""
+"The -b/--binary option has been a no-op for long time, and\n"
+"it will be removed. Please do not use it anymore."
+msgstr ""
+"ÐžÐ¿Ñ†Ñ–Ñ -b/--binary вже давно не працює Ñ–\n"
+"буде видалена. Будь лаÑка, не викориÑтовуйте Ñ—Ñ— більше."
+
+msgid "failed to read the index"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ індекÑ"
+
+#, c-format
+msgid "previous rebase directory %s still exists but mbox given."
+msgstr ""
+"Ð¿Ð¾Ð¿ÐµÑ€ÐµÐ´Ð½Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ %s вÑе ще Ñ–Ñнує, але було надано mbox."
+
+#, c-format
+msgid ""
+"Stray %s directory found.\n"
+"Use \"git am --abort\" to remove it."
+msgstr ""
+"Знайдено блукаючу директорію %s.\n"
+"ÑкориÑтайтеÑÑŒ командою \"git am --abort\", щоб вилучити Ñ—Ñ—."
+
+msgid "Resolve operation not in progress, we are not resuming."
+msgstr "Ðаразі не виконуєтьÑÑ Ð¾Ð¿ÐµÑ€Ð°Ñ†Ñ–Ñ Ð²Ð¸Ñ€Ñ–ÑˆÐµÐ½Ð½Ñ, не поновлено."
+
+msgid "interactive mode requires patches on the command line"
+msgstr "інтерактивний режим потребує латки у командному Ñ€Ñдку"
+
+msgid "git apply [<options>] [<patch>...]"
+msgstr "git apply [<опції>] [<латка>...]"
+
+msgid "could not redirect output"
+msgstr "неможливо перенаправити вивід"
+
+msgid "git archive: Remote with no URL"
+msgstr "git archive: віддалене Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð±ÐµÐ· URL"
+
+msgid "git archive: expected ACK/NAK, got a flush packet"
+msgstr "git archive: очікувалоÑÑŒ ACK/NAK, отримано flush-пакет"
+
+#, c-format
+msgid "git archive: NACK %s"
+msgstr "git archive: NACK %s"
+
+msgid "git archive: protocol error"
+msgstr "git archive: помилка протоколу"
+
+msgid "git archive: expected a flush"
+msgstr "git archive: очікувалоÑÑŒ flush"
+
+msgid ""
+"git bisect start [--term-(new|bad)=<term> --term-(old|good)=<term>] [--no-"
+"checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]"
+msgstr ""
+"git bisect start [--term-(new,bad)=<термін> --term-(old,good)=<термін>] "
+"[--no-checkout] [--first-parent] [<поганий> [<добрий>...]] [--] "
+"[<визначник шлÑху>...]"
+
+msgid "git bisect (good|bad) [<rev>...]"
+msgstr "git bisect (добрий|поганий) [<ревізіÑ>...]"
+
+msgid "git bisect skip [(<rev>|<range>)...]"
+msgstr "git bisect skip [(<ревізіÑ>|<діапазон>)...]"
+
+msgid "git bisect reset [<commit>]"
+msgstr "git bisect reset [<коміт>]"
+
+msgid "git bisect replay <logfile>"
+msgstr "git bisect replay <лог файл>"
+
+msgid "git bisect run <cmd> [<arg>...]"
+msgstr "git bisect run <команда> [<аргумент>...]"
+
+#, c-format
+msgid "cannot open file '%s' in mode '%s'"
+msgstr "неможливо відкрити файл \"%s\" у режимі \"%s\""
+
+#, c-format
+msgid "could not write to file '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати в файл \"%s\""
+
+#, c-format
+msgid "cannot open file '%s' for reading"
+msgstr "неможливо відкрити файл \"%s\" Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ"
+
+#, c-format
+msgid "'%s' is not a valid term"
+msgstr "\"%s\" не Ñ” допуÑтимим терміном"
+
+#, c-format
+msgid "can't use the builtin command '%s' as a term"
+msgstr "неможливо викориÑтати вбудовану команду \"%s\" Ñк термін"
+
+#, c-format
+msgid "can't change the meaning of the term '%s'"
+msgstr "неможливо змінити Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ‚ÐµÑ€Ð¼Ñ–Ð½Ñƒ \"%s\""
+
+msgid "please use two different terms"
+msgstr "будь лаÑка, викориÑтовуйте два різних терміна"
+
+#, c-format
+msgid "We are not bisecting.\n"
+msgstr "Ми не робимо біÑекцію.\n"
+
+#, c-format
+msgid "'%s' is not a valid commit"
+msgstr "\"%s\" не Ñ” дійÑним комітом"
+
+#, c-format
+msgid ""
+"could not check out original HEAD '%s'. Try 'git bisect reset <commit>'."
+msgstr ""
+"не вдалоÑÑ Ð¿ÐµÑ€ÐµÐºÐ»ÑŽÑ‡Ð¸Ñ‚Ð¸ÑÑ Ð½Ð° початковий HEAD \"%s\". Спробуйте \"git bisect "
+"reset <коміт>\"."
+
+#, c-format
+msgid "Bad bisect_write argument: %s"
+msgstr "Ðевірний bisect_write аргумент: %s"
+
+#, c-format
+msgid "couldn't get the oid of the rev '%s'"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ oid Ð´Ð»Ñ rev \"%s\""
+
+#, c-format
+msgid "couldn't open the file '%s'"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ файл \"%s\""
+
+#, c-format
+msgid "Invalid command: you're currently in a %s/%s bisect"
+msgstr "ÐеприпуÑтима команда: наразі ви в процеÑÑ– %s/%s біÑекції"
+
+#, c-format
+msgid ""
+"You need to give me at least one %s and %s revision.\n"
+"You can use \"git bisect %s\" and \"git bisect %s\" for that."
+msgstr ""
+"Ви маєте надати принаймні одну %s та %s ревізію.\n"
+"Ð”Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ ви можете ÑкориÑтатиÑÑ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð°Ð¼Ð¸ \"git bisect %s\" Ñ– \"git bisect "
+"%s\"."
+
+#, c-format
+msgid ""
+"You need to start by \"git bisect start\".\n"
+"You then need to give me at least one %s and %s revision.\n"
+"You can use \"git bisect %s\" and \"git bisect %s\" for that."
+msgstr ""
+"Вам потрібно почати з \"git bisect start\".\n"
+"Потім вам потрібно надати принаймні одну %s і %s ревізію.\n"
+"Ð”Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ ви можете ÑкориÑтатиÑÑ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð°Ð¼Ð¸ \"git bisect %s\" Ñ– \"git bisect "
+"%s\"."
+
+#, c-format
+msgid "bisecting only with a %s commit"
+msgstr "біÑÐµÐºÑ†Ñ–Ñ Ð»Ð¸ÑˆÐµ з %s комітом"
+
+#. TRANSLATORS: Make sure to include [Y] and [n] in your
+#. translation. The program will only accept English input
+#. at this point.
+#.
+msgid "Are you sure [Y/n]? "
+msgstr "Ви впевнені [Y/n]? "
+
+msgid "status: waiting for both good and bad commits\n"
+msgstr "ÑтатуÑ: чекаємо на добрий Ñ– поганий коміти\n"
+
+#, c-format
+msgid "status: waiting for bad commit, %d good commit known\n"
+msgid_plural "status: waiting for bad commit, %d good commits known\n"
+msgstr[0] "ÑтатуÑ: чекаємо на поганий коміт, відомий %d добрий коміт\n"
+msgstr[1] "ÑтатуÑ: чекаємо на поганий коміт, відомі %d добрих коміти\n"
+msgstr[2] "ÑтатуÑ: чекаємо на поганий коміт, відомі %d добрих комітів\n"
+
+msgid "status: waiting for good commit(s), bad commit known\n"
+msgstr "ÑтатуÑ: чекаємо на добрий коміт(и), поганий коміт відомий\n"
+
+msgid "no terms defined"
+msgstr "терміни не визначені"
+
+#, c-format
+msgid ""
+"Your current terms are %s for the old state\n"
+"and %s for the new state.\n"
+msgstr ""
+"Ваші поточні терміни: %s Ð´Ð»Ñ Ñтарого Ñтану\n"
+"Ñ– %s Ð´Ð»Ñ Ð½Ð¾Ð²Ð¾Ð³Ð¾ Ñтану.\n"
+
+#, c-format
+msgid ""
+"invalid argument %s for 'git bisect terms'.\n"
+"Supported options are: --term-good|--term-old and --term-bad|--term-new."
+msgstr ""
+"неприпуÑтимий аргумент %s Ð´Ð»Ñ \"git bisect terms\".\n"
+"Підтримувані опції: --term-good|--term-old і --term-bad|--term-new."
+
+msgid "revision walk setup failed\n"
+msgstr "не вдалоÑÑ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ñ‚Ð¸ Ð¿Ñ€Ð¾Ñ…Ð¾Ð´Ð¶ÐµÐ½Ð½Ñ Ð¿Ð¾ ревізіÑм\n"
+
+#, c-format
+msgid "could not open '%s' for appending"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ \"%s\" Ð´Ð»Ñ Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ"
+
+msgid "'' is not a valid term"
+msgstr "\"\" не Ñ” допуÑтимим терміном"
+
+#, c-format
+msgid "unrecognized option: '%s'"
+msgstr "нерозпізнана опціÑ: \"%s\""
+
+#, c-format
+msgid "'%s' does not appear to be a valid revision"
+msgstr "\"%s\" не Ñ” дійÑною ревізією"
+
+msgid "bad HEAD - I need a HEAD"
+msgstr "невірний HEAD - потрібен HEAD"
+
+#, c-format
+msgid "checking out '%s' failed. Try 'git bisect start <valid-branch>'."
+msgstr ""
+"Ð¿ÐµÑ€ÐµÐºÐ»ÑŽÑ‡ÐµÐ½Ð½Ñ Ð½Ð° \"%s\" завершилоÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾. Спробуйте \"git bisect start "
+"<дійÑна-гілка>\"."
+
+msgid "bad HEAD - strange symbolic ref"
+msgstr "невірний HEAD - дивне Ñимвольне поÑиланнÑ"
+
+#, c-format
+msgid "invalid ref: '%s'"
+msgstr "неприпуÑтиме поÑиланнÑ: \"%s\""
+
+msgid "You need to start by \"git bisect start\"\n"
+msgstr "Вам потрібно почати з \"git bisect start\"\n"
+
+#. TRANSLATORS: Make sure to include [Y] and [n] in your
+#. translation. The program will only accept English input
+#. at this point.
+#.
+msgid "Do you want me to do it for you [Y/n]? "
+msgstr "Ви хочете, щоб Ñ Ð·Ñ€Ð¾Ð±Ð¸Ð² це Ð´Ð»Ñ Ð²Ð°Ñ [Y/n]? "
+
+msgid "Please call `--bisect-state` with at least one argument"
+msgstr ""
+"Будь лаÑка, викориÑтовуйте \"--bisect-state\" з принаймні одним аргументом"
+
+#, c-format
+msgid "'git bisect %s' can take only one argument."
+msgstr "\"git bisect %s\" приймає лише один аргумент."
+
+#, c-format
+msgid "Bad rev input: %s"
+msgstr "Ðевірне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ€ÐµÐ²Ñ–Ð·Ñ–Ñ—: %s"
+
+#, c-format
+msgid "Bad rev input (not a commit): %s"
+msgstr "Ðевірне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ€ÐµÐ²Ñ–Ð·Ñ–Ñ— (не Ñ” комітом): %s"
+
+msgid "We are not bisecting."
+msgstr "Ðаразі ви не робите біÑекцію."
+
+#, c-format
+msgid "'%s'?? what are you talking about?"
+msgstr "\"%s\"? Що ви маєте на увазі?"
+
+#, c-format
+msgid "cannot read file '%s' for replaying"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ файл \"%s\" Ð´Ð»Ñ Ð²Ñ–Ð´Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ"
+
+#, c-format
+msgid "running %s\n"
+msgstr "Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ %s\n"
+
+msgid "bisect run failed: no command provided."
+msgstr "біÑÐµÐºÑ†Ñ–Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ð»Ð°ÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾: не надано команду."
+
+#, c-format
+msgid "unable to verify %s on good revision"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ñ‚Ð¸ %s Ñк припуÑтиму ревізію"
+
+#, c-format
+msgid "bogus exit code %d for good revision"
+msgstr "хибний код виходу %d Ð´Ð»Ñ Ð´Ð¾Ð±Ñ€Ð¾Ñ— ревізії"
+
+#, c-format
+msgid "bisect run failed: exit code %d from %s is < 0 or >= 128"
+msgstr "біÑÐµÐºÑ†Ñ–Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ð»Ð°ÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾: код виходу %d з %s Ñ” < 0 або >= 128"
+
+#, c-format
+msgid "cannot open file '%s' for writing"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ файл \"%s\" Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу"
+
+msgid "bisect run cannot continue any more"
+msgstr "неможливо продовжити біÑекцію"
+
+msgid "bisect run success"
+msgstr "біÑекцію завершено уÑпішно"
+
+msgid "bisect found first bad commit"
+msgstr "біÑÐµÐºÑ†Ñ–Ñ Ð·Ð½Ð°Ð¹ÑˆÐ»Ð° перший поганий коміт"
+
+#, c-format
+msgid "bisect run failed: 'git bisect %s' exited with error code %d"
+msgstr ""
+"біÑÐµÐºÑ†Ñ–Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ð»Ð°ÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾: \"git bisect %s\" завершено з кодом помилки %d"
+
+#, c-format
+msgid "'%s' requires either no argument or a commit"
+msgstr "\"%s\" потребує або відÑутноÑÑ‚Ñ– аргументу, або коміт"
+
+#, c-format
+msgid "'%s' requires 0 or 1 argument"
+msgstr "\"%s\" потребує 0 або 1 аргумент"
+
+#, c-format
+msgid "'%s' requires 0 arguments"
+msgstr "\"%s\" потребує 0 аргументів"
+
+msgid "no logfile given"
+msgstr "не надано файл журналу"
+
+#, c-format
+msgid "'%s' failed: no command provided."
+msgstr "\"%s\" завершено невдало: не надано команду."
+
+msgid "need a command"
+msgstr "потрібна команда"
+
+#, c-format
+msgid "unknown command: '%s'"
+msgstr "невідома команда: \"%s\""
+
+msgid "git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"
+msgstr "git blame [<опції>] [<rev-опції>] [<ревізіÑ>] [--] <файл>"
+
+msgid "git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"
+msgstr "git annotate [<опції>] [<rev-опції>] [<ревізіÑ>] [--] <файл>"
+
+msgid "<rev-opts> are documented in git-rev-list(1)"
+msgstr "<rev-опції> задокументовані у git-rev-list(1)"
+
+#, c-format
+msgid "expecting a color: %s"
+msgstr "Ð¾Ñ‡Ñ–ÐºÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐ¾Ð»ÑŒÐ¾Ñ€Ñƒ: %s"
+
+msgid "must end with a color"
+msgstr "повинно закінчуватиÑÑ ÐºÐ¾Ð»ÑŒÐ¾Ñ€Ð¾Ð¼"
+
+#, c-format
+msgid "cannot find revision %s to ignore"
+msgstr "неможливо знайти ревізію %s Ð´Ð»Ñ Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ"
+
+msgid "show blame entries as we find them, incrementally"
+msgstr "показувати blame запиÑи по мірі того, Ñк ми Ñ—Ñ… знаходимо, поÑтупово"
+
+msgid "do not show object names of boundary commits (Default: off)"
+msgstr "не показувати назви об’єктів межевих комітів (за замовчуваннÑм: off)"
+
+msgid "do not treat root commits as boundaries (Default: off)"
+msgstr "не оброблÑти кореневі коміти Ñк межі (за замовчуваннÑм: off)"
+
+msgid "show work cost statistics"
+msgstr "показати ÑтатиÑтику вартоÑÑ‚Ñ– робіт"
+
+msgid "force progress reporting"
+msgstr "примуÑово звітувати про хід виконаннÑ"
+
+msgid "show output score for blame entries"
+msgstr "показати вихідний показник Ð´Ð»Ñ blame запиÑів"
+
+msgid "show original filename (Default: auto)"
+msgstr "показати оригінальне Ñ–Ð¼â€™Ñ Ñ„Ð°Ð¹Ð»Ñƒ (за замовчуваннÑм: auto)"
+
+msgid "show original linenumber (Default: off)"
+msgstr "показувати початковий номер Ñ€Ñдка (за замовчуваннÑм: off)"
+
+msgid "show in a format designed for machine consumption"
+msgstr "показувати у форматі, призначеному Ð´Ð»Ñ Ð¼Ð°ÑˆÐ¸Ð½Ð½Ð¾Ð³Ð¾ ÑпоживаннÑ"
+
+msgid "show porcelain format with per-line commit information"
+msgstr ""
+"показати у porcelain форматі з інформацією про кожен коміт в окремому Ñ€Ñдку"
+
+msgid "use the same output mode as git-annotate (Default: off)"
+msgstr ""
+"викориÑтовувати той Ñамий режим виводу, що Ñ– git-annotate (за замовчуваннÑм: "
+"off)"
+
+msgid "show raw timestamp (Default: off)"
+msgstr "показувати необроблену мітку чаÑу (за замовчуваннÑм: off)"
+
+msgid "show long commit SHA1 (Default: off)"
+msgstr "показувати довгу верÑÑ–ÑŽ SHA1 коміту (за замовчуваннÑм: off)"
+
+msgid "suppress author name and timestamp (Default: off)"
+msgstr "приховати Ñ–Ð¼â€™Ñ Ð°Ð²Ñ‚Ð¾Ñ€Ð° та мітку чаÑу (за замовчуваннÑм: off)"
+
+msgid "show author email instead of name (Default: off)"
+msgstr "показувати email автора заміÑÑ‚ÑŒ імені (за замовчуваннÑм: off)"
+
+msgid "ignore whitespace differences"
+msgstr "ігнорувати різницю між пробільними Ñимволами"
+
+msgid "rev"
+msgstr "ревізіÑ"
+
+msgid "ignore <rev> when blaming"
+msgstr "ігнорувати <ревізію> при blame"
+
+msgid "ignore revisions from <file>"
+msgstr "ігнорувати ревізії з <файлу>"
+
+msgid "color redundant metadata from previous line differently"
+msgstr "розфарбувати надлишкові метадані з попереднього Ñ€Ñдка інакше"
+
+msgid "color lines by age"
+msgstr "розфарбувати Ñ€Ñдки за віком"
+
+msgid "spend extra cycles to find better match"
+msgstr "витрачати додаткові цикли Ð´Ð»Ñ Ð¿Ð¾ÑˆÑƒÐºÑƒ кращого варіанта"
+
+msgid "use revisions from <file> instead of calling git-rev-list"
+msgstr "викориÑтовувати ревізії з <файлу> заміÑÑ‚ÑŒ виклику git-rev-list"
+
+msgid "use <file>'s contents as the final image"
+msgstr "викориÑтовувати вміÑÑ‚ <файлу> Ñк кінцевий образ"
+
+msgid "score"
+msgstr "показник"
+
+msgid "find line copies within and across files"
+msgstr "знаходити копії Ñ€Ñдків у файлах та між ними"
+
+msgid "find line movements within and across files"
+msgstr "знаходити Ð¿ÐµÑ€ÐµÐ¼Ñ–Ñ‰ÐµÐ½Ð½Ñ Ñ€Ñдків у файлі та між ними"
+
+msgid "range"
+msgstr "діапазон"
+
+msgid "process only line range <start>,<end> or function :<funcname>"
+msgstr ""
+"обробити тільки діапазон Ñ€Ñдків <початок>,<кінець> або функцію :<назва-"
+"функції>"
+
+msgid "--progress can't be used with --incremental or porcelain formats"
+msgstr ""
+"--progress не можна викориÑтовувати з форматами --incremental або porcelain"
+
+#. TRANSLATORS: This string is used to tell us the
+#. maximum display width for a relative timestamp in
+#. "git blame" output. For C locale, "4 years, 11
+#. months ago", which takes 22 places, is the longest
+#. among various forms of relative timestamps, but
+#. your language may need more or fewer display
+#. columns.
+#.
+msgid "4 years, 11 months ago"
+msgstr "4 роки, 11 міÑÑців тому"
+
+#, c-format
+msgid "file %s has only %lu line"
+msgid_plural "file %s has only %lu lines"
+msgstr[0] "файл %s міÑтить лише %lu Ñ€Ñдок"
+msgstr[1] "файл %s міÑтить лише %lu Ñ€Ñдки"
+msgstr[2] "файл %s міÑтить лише %lu Ñ€Ñдків"
+
+msgid "Blaming lines"
+msgstr "Blaming Ñ€Ñдки"
+
+msgid "git branch [<options>] [-r | -a] [--merged] [--no-merged]"
+msgstr "git branch [<опції>] [-r | -a] [--merged] [--no-merged]"
+
+msgid ""
+"git branch [<options>] [-f] [--recurse-submodules] <branch-name> [<start-"
+"point>]"
+msgstr ""
+"git branch [<опції>] [-f] [--recurse-submodules] <назва-гілки> [<початкова-"
+"точка>]"
+
+msgid "git branch [<options>] [-l] [<pattern>...]"
+msgstr "git branch [<опції>] [-l] [<шаблон>...]"
+
+msgid "git branch [<options>] [-r] (-d | -D) <branch-name>..."
+msgstr "git branch [<опції>] [-r] (-d | -D) <имʼÑ-гілки>..."
+
+msgid "git branch [<options>] (-m | -M) [<old-branch>] <new-branch>"
+msgstr "git branch [<опції>] (-m | -M) [<Ñтара-гілка>] <нова-гілка>"
+
+msgid "git branch [<options>] (-c | -C) [<old-branch>] <new-branch>"
+msgstr "git branch [<опції>] (-c | -C) [<Ñтара-гілка>] <нова-гілка>"
+
+msgid "git branch [<options>] [-r | -a] [--points-at]"
+msgstr "git branch [<опції>] [-r | -a] [--points-at]"
+
+msgid "git branch [<options>] [-r | -a] [--format]"
+msgstr "git branch [<опції>] [-r | -a] [--format]"
+
+#, c-format
+msgid ""
+"deleting branch '%s' that has been merged to\n"
+" '%s', but not yet merged to HEAD"
+msgstr ""
+"Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð³Ñ–Ð»ÐºÐ¸ \"%s\", Ñка була злита з\n"
+" \"%s\", але ще не злита з HEAD"
+
+#, c-format
+msgid ""
+"not deleting branch '%s' that is not yet merged to\n"
+" '%s', even though it is merged to HEAD"
+msgstr ""
+"ÑƒÑ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð³Ñ–Ð»ÐºÐ¸ \"%s\", Ñка ще не була злита з\n"
+" \"%s\", незважаючи на те, що вже була злита з HEAD"
+
+#, c-format
+msgid "couldn't look up commit object for '%s'"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ об’єкт коміту Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "the branch '%s' is not fully merged"
+msgstr "гілка \"%s\" злита не повніÑÑ‚ÑŽ"
+
+#, c-format
+msgid "If you are sure you want to delete it, run 'git branch -D %s'"
+msgstr ""
+"Якщо ви впевнені, що хочете її видалити, виконайте \"git branch -D %s\""
+
+msgid "update of config-file failed"
+msgstr "не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ конфігураційний файл"
+
+msgid "cannot use -a with -d"
+msgstr "не можна викориÑтовувати -a з -d"
+
+#, c-format
+msgid "cannot delete branch '%s' used by worktree at '%s'"
+msgstr ""
+"неможливо видалити гілку \"%s\", Ñка викориÑтовуєтьÑÑ Ñ€Ð¾Ð±Ð¾Ñ‡Ð¸Ð¼ деревом у "
+"\"%s\""
+
+#, c-format
+msgid "remote-tracking branch '%s' not found"
+msgstr "віддалено відÑтежувана гілка \"%s\" не знайдена"
+
+#, c-format
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"гілка \"%s\" не знайдена.\n"
+"Ви забули --remote?"
+
+#, c-format
+msgid "branch '%s' not found"
+msgstr "гілка \"%s\" не знайдена"
+
+#, c-format
+msgid "Deleted remote-tracking branch %s (was %s).\n"
+msgstr "Видалено гілку віддаленого відÑÑ‚ÐµÐ¶ÐµÐ½Ð½Ñ %s (була %s).\n"
+
+#, c-format
+msgid "Deleted branch %s (was %s).\n"
+msgstr "Видалено гілку %s (була %s).\n"
+
+msgid "unable to parse format string"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ Ñ€Ñдок форматуваннÑ"
+
+msgid "could not resolve HEAD"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð²Ê¼Ñзати HEAD"
+
+#, c-format
+msgid "HEAD (%s) points outside of refs/heads/"
+msgstr "HEAD (%s) пунктів за межами refs/heads/"
+
+#, c-format
+msgid "branch %s is being rebased at %s"
+msgstr "гілка %s перебазуєтьÑÑ Ð½Ð° %s"
+
+#, c-format
+msgid "branch %s is being bisected at %s"
+msgstr "гілка %s біÑектуєтьÑÑ Ð² %s"
+
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "HEAD робочого дерева %s не оновлено"
+
+#, c-format
+msgid "invalid branch name: '%s'"
+msgstr "неприпуÑтима назва гілки: \"%s\""
+
+#, c-format
+msgid "no commit on branch '%s' yet"
+msgstr "поки що немає комітів у гілці \"%s\""
+
+#, c-format
+msgid "no branch named '%s'"
+msgstr "немає гілки з назвою \"%s\""
+
+msgid "branch rename failed"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ñ‚Ð¸ гілку"
+
+msgid "branch copy failed"
+msgstr "не вдалоÑÑ Ñкопіювати гілку"
+
+#, c-format
+msgid "created a copy of a misnamed branch '%s'"
+msgstr "Ñтворено копію невірно названої гілки \"%s\""
+
+#, c-format
+msgid "renamed a misnamed branch '%s' away"
+msgstr "перейменовано невірно названу гілку \"%s\""
+
+#, c-format
+msgid "branch renamed to %s, but HEAD is not updated"
+msgstr "гілку перейменовано на %s, але HEAD не оновлено"
+
+msgid "branch is renamed, but update of config-file failed"
+msgstr "гілку перейменовано, але не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ конфігураційний файл"
+
+msgid "branch is copied, but update of config-file failed"
+msgstr "гілку Ñкопійовано, але не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ конфігураційний файл"
+
+#, c-format
+msgid ""
+"Please edit the description for the branch\n"
+" %s\n"
+"Lines starting with '%c' will be stripped.\n"
+msgstr ""
+"Будь лаÑка, відредагуйте Ð¾Ð¿Ð¸Ñ Ð³Ñ–Ð»ÐºÐ¸\n"
+" %s\n"
+"РÑдки, що починаютьÑÑ Ð· \"%c\", будуть вилучені.\n"
+
+msgid "Generic options"
+msgstr "Загальні опції"
+
+msgid "show hash and subject, give twice for upstream branch"
+msgstr ""
+"показувати хеш Ñ– тему, додайте двічі, щоб заÑтоÑувати Ð´Ð»Ñ Ð²Ð¸Ñхідної гілки"
+
+msgid "suppress informational messages"
+msgstr "приховати інформаційні повідомленнÑ"
+
+msgid "set branch tracking configuration"
+msgstr "налаштувати конфігурацію відÑтежуваних гілок"
+
+msgid "do not use"
+msgstr "не викориÑтовувати"
+
+msgid "upstream"
+msgstr "першоджерельне Ñховище"
+
+msgid "change the upstream info"
+msgstr "змінити інформацію щодо першоджерельного Ñховища"
+
+msgid "unset the upstream info"
+msgstr "Ñкинути інформацію щодо першоджерельного Ñховища"
+
+msgid "use colored output"
+msgstr "викориÑтовувати кольоровий вивід"
+
+msgid "act on remote-tracking branches"
+msgstr "працювати з віддалено відÑтежуваними гілками"
+
+msgid "print only branches that contain the commit"
+msgstr "виводити тільки гілки, що міÑÑ‚ÑÑ‚ÑŒ цей коміт"
+
+msgid "print only branches that don't contain the commit"
+msgstr "виводити тільки гілки, що не міÑÑ‚ÑÑ‚ÑŒ цей коміт"
+
+msgid "Specific git-branch actions:"
+msgstr "Специфічні git-branch дії:"
+
+msgid "list both remote-tracking and local branches"
+msgstr "показати Ñк віддалено відÑтежувані, так Ñ– локальні гілки"
+
+msgid "delete fully merged branch"
+msgstr "видалити повніÑÑ‚ÑŽ злиту гілку"
+
+msgid "delete branch (even if not merged)"
+msgstr "видалити гілку (навіть не повніÑÑ‚ÑŽ злиту)"
+
+msgid "move/rename a branch and its reflog"
+msgstr "переміÑтити/перейменувати гілку та Ñ—Ñ— журнал поÑилань"
+
+msgid "move/rename a branch, even if target exists"
+msgstr "переміÑтити/перейменувати гілку, навіть Ñкщо Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ–Ñнує"
+
+msgid "do not output a newline after empty formatted refs"
+msgstr "не виводити новий Ñ€Ñдок піÑÐ»Ñ Ð¿Ð¾Ñ€Ð¾Ð¶Ð½Ñ–Ñ… форматованих поÑилань"
+
+msgid "copy a branch and its reflog"
+msgstr "Ñкопіювати гілку та Ñ—Ñ— журнал поÑилань"
+
+msgid "copy a branch, even if target exists"
+msgstr "Ñкопіювати гілку, навіть Ñкщо Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ–Ñнує"
+
+msgid "list branch names"
+msgstr "показати назви гілок"
+
+msgid "show current branch name"
+msgstr "показати назву поточної гілки"
+
+msgid "create the branch's reflog"
+msgstr "Ñтворити журнал поÑилань гілки"
+
+msgid "edit the description for the branch"
+msgstr "редагувати Ð¾Ð¿Ð¸Ñ Ð³Ñ–Ð»ÐºÐ¸"
+
+msgid "force creation, move/rename, deletion"
+msgstr "примуÑове ÑтвореннÑ, переміщеннÑ/перейменуваннÑ, видаленнÑ"
+
+msgid "print only branches that are merged"
+msgstr "вивеÑти тільки злиті гілки"
+
+msgid "print only branches that are not merged"
+msgstr "вивеÑти тільки не злиті гілки"
+
+msgid "list branches in columns"
+msgstr "виводити гілки в Ñтовпчиках"
+
+msgid "object"
+msgstr "обʼєкт"
+
+msgid "print only branches of the object"
+msgstr "виводити тільки гілки об’єкта"
+
+msgid "sorting and filtering are case insensitive"
+msgstr "Ñортувати та фільтрувати незалежно від регіÑтру"
+
+msgid "recurse through submodules"
+msgstr "рекурÑивно через підмодулі"
+
+msgid "format to use for the output"
+msgstr "формат, що викориÑтовувати Ð´Ð»Ñ Ð²Ð¸Ð²Ð¾Ð´Ñƒ"
+
+msgid "failed to resolve HEAD as a valid ref"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ñ‚Ð¸ HEAD Ñк дійÑне поÑиланнÑ"
+
+msgid "HEAD not found below refs/heads!"
+msgstr "HEAD не знайдено під refs/heads!"
+
+msgid ""
+"branch with --recurse-submodules can only be used if submodule."
+"propagateBranches is enabled"
+msgstr ""
+"гілку з --recurse-submodules можна викориÑтовувати лише Ñкщо увімкнено "
+"submodule.propagateBranches"
+
+msgid "--recurse-submodules can only be used to create branches"
+msgstr "--recurse-submodules можна викориÑтовувати лише Ð´Ð»Ñ ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð³Ñ–Ð»Ð¾Ðº"
+
+msgid "branch name required"
+msgstr "назва гілки Ñ” обовʼÑзковою"
+
+msgid "cannot give description to detached HEAD"
+msgstr "неможливо надати Ð¾Ð¿Ð¸Ñ Ð²Ñ–Ð´Ð¾ÐºÑ€ÐµÐ¼Ð»ÐµÐ½Ð¾Ð¼Ñƒ HEAD"
+
+msgid "cannot edit description of more than one branch"
+msgstr "неможливо редагувати Ð¾Ð¿Ð¸Ñ Ð±Ñ–Ð»ÑŒÑˆ ніж однієї гілки"
+
+msgid "cannot copy the current branch while not on any"
+msgstr "неможливо Ñкопіювати поточну гілку, не перебуваючи на жодній з них"
+
+msgid "cannot rename the current branch while not on any"
+msgstr "неможливо перейменувати поточну гілку, не перебуваючи на жодній з них"
+
+msgid "too many branches for a copy operation"
+msgstr "забагато гілок Ð´Ð»Ñ Ð¾Ð¿ÐµÑ€Ð°Ñ†Ñ–Ñ— копіюваннÑ"
+
+msgid "too many arguments for a rename operation"
+msgstr "забагато аргументів Ð´Ð»Ñ Ð¾Ð¿ÐµÑ€Ð°Ñ†Ñ–Ñ— перейменуваннÑ"
+
+msgid "too many arguments to set new upstream"
+msgstr "забагато аргументів Ð´Ð»Ñ Ð²ÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð½Ð¾Ð²Ð¾Ð³Ð¾ першоджерельного Ñховища"
+
+#, c-format
+msgid ""
+"could not set upstream of HEAD to %s when it does not point to any branch"
+msgstr ""
+"не вдалоÑÑ Ð²Ñтановити першождерельне Ñховище HEAD у %s, Ñкий не вказує на "
+"жодну гілку"
+
+#, c-format
+msgid "no such branch '%s'"
+msgstr "немає такої гілки \"%s\""
+
+#, c-format
+msgid "branch '%s' does not exist"
+msgstr "гілка \"%s\" не Ñ–Ñнує"
+
+msgid "too many arguments to unset upstream"
+msgstr "забагато аргументів Ð´Ð»Ñ ÑÐºÐ¸Ð´Ð°Ð½Ð½Ñ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿ÐµÑ€ÑˆÐ¾Ð´Ð¶ÐµÑ€ÐµÐ»ÑŒÐ½Ð¾Ð³Ð¾ Ñховища"
+
+msgid "could not unset upstream of HEAD when it does not point to any branch"
+msgstr ""
+"не вдалоÑÑ Ñкинути Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿ÐµÑ€ÑˆÐ¾Ð´Ð¶ÐµÑ€ÐµÐ»ÑŒÐ½Ð¾Ð³Ð¾ Ñховища Ð´Ð»Ñ HEAD, Ñкий не "
+"вказує на жодну гілку"
+
+#, c-format
+msgid "branch '%s' has no upstream information"
+msgstr "гілка \"%s\" не має інформації щодо першоджерельного Ñховища"
+
+msgid ""
+"the -a, and -r, options to 'git branch' do not take a branch name.\n"
+"Did you mean to use: -a|-r --list <pattern>?"
+msgstr ""
+"опції -a та -r Ð´Ð»Ñ \"git branch\" не приймають назву гілки.\n"
+"Ви хотіли викориÑтати -a|-r --list <шаблон>?"
+
+msgid ""
+"the '--set-upstream' option is no longer supported. Please use '--track' or "
+"'--set-upstream-to' instead"
+msgstr ""
+"Ð¾Ð¿Ñ†Ñ–Ñ \"--set-upstream\" більше не підтримуєтьÑÑ. Будь лаÑка, викориÑтовуйте "
+"\"--track\" або \"--set-upstream-to\" заміÑÑ‚ÑŒ неї"
+
+msgid "git version:\n"
+msgstr "верÑÑ–Ñ git:\n"
+
+#, c-format
+msgid "uname() failed with error '%s' (%d)\n"
+msgstr "uname() завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾ з помилкою \"%s\" (%d)\n"
+
+msgid "compiler info: "
+msgstr "Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ñ‰Ð¾Ð´Ð¾ компілÑтора: "
+
+msgid "libc info: "
+msgstr "Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ñ‰Ð¾Ð´Ð¾ libc: "
+
+msgid "not run from a git repository - no hooks to show\n"
+msgstr "запущено не з git Ñховища - немає гачків Ð´Ð»Ñ Ð¿Ð¾ÐºÐ°Ð·Ñƒ\n"
+
+msgid ""
+"git bugreport [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--diagnose[=<mode>]]"
+msgstr ""
+"git bugreport [(-o | --output-directory) <шлÑÑ…>] [(-s | --suffix) <формат>]\n"
+" [--diagnose[=<режим>]]"
+
+msgid ""
+"Thank you for filling out a Git bug report!\n"
+"Please answer the following questions to help us understand your issue.\n"
+"\n"
+"What did you do before the bug happened? (Steps to reproduce your issue)\n"
+"\n"
+"What did you expect to happen? (Expected behavior)\n"
+"\n"
+"What happened instead? (Actual behavior)\n"
+"\n"
+"What's different between what you expected and what actually happened?\n"
+"\n"
+"Anything else you want to add:\n"
+"\n"
+"Please review the rest of the bug report below.\n"
+"You can delete any lines you don't wish to share.\n"
+msgstr ""
+"ДÑкуємо, що заповнили звіт про помилку в Git!\n"
+"Будь лаÑка, дайте відповіді на наÑтупні питаннÑ, щоб допомогти нам зрозуміти "
+"вашу проблему.\n"
+"\n"
+"Що ви робили до того, Ñк ÑталаÑÑ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ° (кроки Ð´Ð»Ñ Ð²Ñ–Ð´Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð²Ð°ÑˆÐ¾Ñ— "
+"проблеми)\n"
+"\n"
+"Який результат ви очікували? (Очікувана поведінка)\n"
+"\n"
+"Що ÑталоÑÑ Ð·Ð°Ð¼Ñ–ÑÑ‚ÑŒ цього? (Фактична поведінка)\n"
+"\n"
+"Чим відрізнÑєтьÑÑ Ñ‚Ðµ, що ви очікували, від того, що ÑталоÑÑ Ð½Ð°Ñправді?\n"
+"\n"
+"Будь-що інше, що ви хочете додати:\n"
+"\n"
+"Будь лаÑка, переглÑньте решту Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¾ ваду нижче.\n"
+"Ви можете видалити будь-Ñкі Ñ€Ñдки, Ñкими не хочете ділитиÑÑ.\n"
+
+msgid "mode"
+msgstr "режим"
+
+msgid ""
+"create an additional zip archive of detailed diagnostics (default 'stats')"
+msgstr ""
+"Ñтворити додатковий zip-архів з детальною діагноÑтикою (за замовчуваннÑм "
+"\"stats\")"
+
+msgid "specify a destination for the bugreport file(s)"
+msgstr "вказати міÑце Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ñ„Ð°Ð¹Ð»Ð°(-ів) звіта про помилку"
+
+msgid "specify a strftime format suffix for the filename(s)"
+msgstr "вказати ÑÑƒÑ„Ñ–ÐºÑ Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚Ñƒ strftime Ð´Ð»Ñ Ð½Ð°Ð·Ð²Ð¸ файла(-ів)"
+
+#, c-format
+msgid "unknown argument `%s'"
+msgstr "невідомий аргумент \"%s\""
+
+#, c-format
+msgid "could not create leading directories for '%s'"
+msgstr "не вдалоÑÑ Ñтворити провідні каталоги Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "unable to create diagnostics archive %s"
+msgstr "не вдалоÑÑ Ñтворити архів діагноÑтики %s"
+
+msgid "System Info"
+msgstr "Ð†Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð¿Ñ€Ð¾ ÑиÑтему"
+
+msgid "Enabled Hooks"
+msgstr "Увімкнені гачки"
+
+#, c-format
+msgid "unable to write to %s"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати до %s"
+
+#, c-format
+msgid "Created new report at '%s'.\n"
+msgstr "Створено новий звіт в \"%s\".\n"
+
+msgid ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<version>] <file> <git-rev-list-args>"
+msgstr ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<верÑÑ–Ñ>] <файл> <git-rev-list-агрументи>"
+
+msgid "git bundle verify [-q | --quiet] <file>"
+msgstr "git bundle verify [-q | --quiet] <файл>"
+
+msgid "git bundle list-heads <file> [<refname>...]"
+msgstr "git bundle list-heads <файл> [<назва-поÑиланнÑ>...]"
+
+msgid "git bundle unbundle [--progress] <file> [<refname>...]"
+msgstr "git bundle unbundle [--progress] <файл> [<назва-поÑиланнÑ>...]"
+
+msgid "need a <file> argument"
+msgstr "потрібен аргумент <файл>"
+
+msgid "do not show progress meter"
+msgstr "не показувати хід виконаннÑ"
+
+msgid "show progress meter"
+msgstr "показувати хід виконаннÑ"
+
+msgid "historical; same as --progress"
+msgstr "Ñ–Ñторичний; те Ñаме, що --progress"
+
+msgid "historical; does nothing"
+msgstr "Ñ–Ñторична; не робить нічогіÑенько"
+
+msgid "specify bundle format version"
+msgstr "вказати верÑÑ–ÑŽ формату пакунка"
+
+msgid "Need a repository to create a bundle."
+msgstr "Ð”Ð»Ñ ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð¿Ð°ÐºÑƒÐ½ÐºÐ° потрібне Ñховище."
+
+msgid "do not show bundle details"
+msgstr "не показувати деталі пакунка"
+
+#, c-format
+msgid "%s is okay\n"
+msgstr "%s у порÑдку\n"
+
+msgid "Need a repository to unbundle."
+msgstr "Потрібне Ñховище Ð´Ð»Ñ Ñ€Ð¾Ð·Ð´Ñ–Ð»ÐµÐ½Ð½Ñ."
+
+msgid "Unbundling objects"
+msgstr "Ð Ð¾Ð·Ð´Ñ–Ð»ÐµÐ½Ð½Ñ Ð¾Ð±â€™Ñ”ÐºÑ‚Ñ–Ð²"
+
+#, c-format
+msgid "cannot read object %s '%s'"
+msgstr "неможливо прочитати об’єкт %s \"%s\""
+
+msgid "flush is only for --buffer mode"
+msgstr "flush тільки Ð´Ð»Ñ Ñ€ÐµÐ¶Ð¸Ð¼Ñƒ --buffer"
+
+msgid "empty command in input"
+msgstr "Ð¿Ð¾Ñ€Ð¾Ð¶Ð½Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° на вході"
+
+#, c-format
+msgid "whitespace before command: '%s'"
+msgstr "пробільний Ñимвол перед командою: \"%s\""
+
+#, c-format
+msgid "%s requires arguments"
+msgstr "%s потребує аргументів"
+
+#, c-format
+msgid "%s takes no arguments"
+msgstr "%s не потребує аргументів"
+
+msgid "only one batch option may be specified"
+msgstr "можна вказати лише одну групову опцію"
+
+msgid "git cat-file <type> <object>"
+msgstr "git cat-file <тип> <об’єкт>"
+
+msgid "git cat-file (-e | -p) <object>"
+msgstr "git cat-file (-e | -p) <об’єкт>"
+
+msgid "git cat-file (-t | -s) [--allow-unknown-type] <object>"
+msgstr "git cat-file (-t | -s) [--allow-unknown-type] <об’єкт>"
+
+msgid ""
+"git cat-file (--textconv | --filters)\n"
+" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
+msgstr ""
+"git cat-file (--textconv | --filters)\n"
+" [<ревізіÑ>:<шлÑÑ…|деревоподібне-джерело> | --path=<шлÑÑ…|"
+"деревоподібне-джерело> <ревізіÑ>]"
+
+msgid ""
+"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
+"objects]\n"
+" [--buffer] [--follow-symlinks] [--unordered]\n"
+" [--textconv | --filters] [-Z]"
+msgstr ""
+"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
+"objects]\n"
+" [--buffer] [--follow-symlinks] [--unordered]\n"
+" [--textconv | --filters] [-Z]"
+
+msgid "Check object existence or emit object contents"
+msgstr "Перевірити Ñ–ÑÐ½ÑƒÐ²Ð°Ð½Ð½Ñ Ð¾Ð±â€™Ñ”ÐºÑ‚Ð° або видати вміÑÑ‚ об’єкта"
+
+msgid "check if <object> exists"
+msgstr "перевірити, чи Ñ–Ñнує <об’єкт>"
+
+msgid "pretty-print <object> content"
+msgstr "pretty-print вміÑÑ‚ <об’єкта>"
+
+msgid "Emit [broken] object attributes"
+msgstr "Видати [пошкоджені] атрибути об’єкта"
+
+msgid "show object type (one of 'blob', 'tree', 'commit', 'tag', ...)"
+msgstr ""
+"показати тип об’єкта (один з \"blob\", \"tree\", \"commit\", \"tag\", ...)"
+
+msgid "show object size"
+msgstr "показати розмір об’єкта"
+
+msgid "allow -s and -t to work with broken/corrupt objects"
+msgstr "дозволити -s та -t працювати з пошкодженими/зіпÑованими об’єктами"
+
+msgid "use mail map file"
+msgstr "викориÑтовувати файл відповідноÑÑ‚Ñ– поштових адреÑ"
+
+msgid "Batch objects requested on stdin (or --batch-all-objects)"
+msgstr "Пакетний запит об’єктів з stdin (або --batch-all-objects)"
+
+msgid "show full <object> or <rev> contents"
+msgstr "показати повний вміÑÑ‚ <об’єкта> або <ревізії>"
+
+msgid "like --batch, but don't emit <contents>"
+msgstr "Ñк --batch, але не виводить <вміÑÑ‚>"
+
+msgid "stdin is NUL-terminated"
+msgstr "stdin закінчуєтьÑÑ NUL"
+
+msgid "stdin and stdout is NUL-terminated"
+msgstr "stdin та stdout закінчуютьÑÑ NUL"
+
+msgid "read commands from stdin"
+msgstr "читати команди з stdin"
+
+msgid "with --batch[-check]: ignores stdin, batches all known objects"
+msgstr "з --batch[-check]: ігнорує stdin, групує вÑÑ– відомі об’єкти"
+
+msgid "Change or optimize batch output"
+msgstr "Змінити або оптимізувати груповий вивід"
+
+msgid "buffer --batch output"
+msgstr "буферизувати --batch вивід"
+
+msgid "follow in-tree symlinks"
+msgstr "розвʼÑзувати Ñимвольні поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð² дереві"
+
+msgid "do not order objects before emitting them"
+msgstr "не упорÑдковувати об’єкти перед випуÑком"
+
+msgid ""
+"Emit object (blob or tree) with conversion or filter (stand-alone, or with "
+"batch)"
+msgstr ""
+"Видавати об’єкт (blob або tree) з перетвореннÑм або фільтром (окремо або з "
+"групою)"
+
+msgid "run textconv on object's content"
+msgstr "виконати textconv над вміÑтом об’єкта"
+
+msgid "run filters on object's content"
+msgstr "запуÑтити фільтри на вміÑÑ‚ об’єкта"
+
+msgid "blob|tree"
+msgstr "blob|дерево"
+
+msgid "use a <path> for (--textconv | --filters); Not with 'batch'"
+msgstr "викориÑтати <шлÑÑ…> Ð´Ð»Ñ (--textconv | --filters); не з \"batch\""
+
+#, c-format
+msgid "'%s=<%s>' needs '%s' or '%s'"
+msgstr "\"%s=<%s>\" потребує \"%s\" або \"%s\""
+
+msgid "path|tree-ish"
+msgstr "шлÑÑ…|деревоподібне-джерело"
+
+#, c-format
+msgid "'%s' requires a batch mode"
+msgstr "\"%s\" потребує групового режиму"
+
+#, c-format
+msgid "'-%c' is incompatible with batch mode"
+msgstr "\"-%c\" неÑуміÑний з груповим режимом"
+
+msgid "batch modes take no arguments"
+msgstr "групові режими не потребують аргументів"
+
+#, c-format
+msgid "<rev> required with '%s'"
+msgstr "<ревізіÑ> Ñ” обов’Ñзковою Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "<object> required with '-%c'"
+msgstr "<об’єкт> Ñ” обов’Ñзковим Ð´Ð»Ñ \"-%c\""
+
+#, c-format
+msgid "only two arguments allowed in <type> <object> mode, not %d"
+msgstr "у режимі <тип> <об’єкт> дозволено лише два аргументи, а не %d"
+
+msgid ""
+"git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] "
+"<pathname>..."
+msgstr ""
+"git check-attr [--source <деревоподібне-джерело>] [-a | --all | "
+"<атрибут>...] [--] <назва-шлÑху>..."
+
+msgid ""
+"git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"
+msgstr ""
+"git check-attr --stdin [-z] [--source <деревоподібне-джерело>] [-a | --all | "
+"<атрибут>...]"
+
+msgid "report all attributes set on file"
+msgstr "звітувати про вÑÑ– атрибути, вÑтановлені у файлі"
+
+msgid "use .gitattributes only from the index"
+msgstr "викориÑтовувати .gitattributes тільки з індекÑу"
+
+msgid "read file names from stdin"
+msgstr "зчитувати назви файлів з stdin"
+
+msgid "terminate input and output records by a NUL character"
+msgstr "завершувати вхідні та вихідні запиÑи Ñимволом NUL"
+
+msgid "<tree-ish>"
+msgstr "<деревоподібне-джерело>"
+
+msgid "which tree-ish to check attributes at"
+msgstr "атрибути Ñкого деревоподібного джерела перевірÑти"
+
+msgid "suppress progress reporting"
+msgstr "не звітувати про хід виконаннÑ"
+
+msgid "show non-matching input paths"
+msgstr "показати неÑÐ¿Ñ–Ð²Ð¿Ð°Ð´Ñ–Ð½Ð½Ñ Ð²Ñ…Ñ–Ð´Ð½Ð¸Ñ… шлÑхів"
+
+msgid "ignore index when checking"
+msgstr "ігнорувати Ñ–Ð½Ð´ÐµÐºÑ Ð¿Ñ–Ð´ Ñ‡Ð°Ñ Ð¿ÐµÑ€ÐµÐ²Ñ–Ñ€ÐºÐ¸"
+
+msgid "cannot specify pathnames with --stdin"
+msgstr "неможливо вказувати назви шлÑхів із --stdin"
+
+msgid "-z only makes sense with --stdin"
+msgstr "-z має ÑÐµÐ½Ñ Ñ‚Ñ–Ð»ÑŒÐºÐ¸ з --stdin"
+
+msgid "no path specified"
+msgstr "шлÑÑ… не зазначено"
+
+msgid "--quiet is only valid with a single pathname"
+msgstr "--quiet дійÑний лише з однією назвою шлÑху"
+
+msgid "cannot have both --quiet and --verbose"
+msgstr "неможливо мати одночаÑно --quiet Ñ– --verbose"
+
+msgid "--non-matching is only valid with --verbose"
+msgstr "--non-matching діє тільки з --verbose"
+
+msgid "git check-mailmap [<options>] <contact>..."
+msgstr "git check-mailmap [<опції>] <контакт>..."
+
+msgid "also read contacts from stdin"
+msgstr "також читати контакти з stdin"
+
+#, c-format
+msgid "unable to parse contact: %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ контакт: %s"
+
+msgid "no contacts specified"
+msgstr "контакти не вказані"
+
+msgid "git checkout--worker [<options>]"
+msgstr "git checkout--worker [<опції>]"
+
+msgid "string"
+msgstr "Ñтрока"
+
+msgid "when creating files, prepend <string>"
+msgstr "при Ñтворенні файлів додавати <Ñтроку> напочатку"
+
+msgid "git checkout-index [<options>] [--] [<file>...]"
+msgstr "git checkout-index [<опції>] [—] [<файл>...]"
+
+msgid "stage should be between 1 and 3 or all"
+msgstr "ÑÑ‚Ð°Ð´Ñ–Ñ Ð¼Ð°Ñ” бути від 1 до 3 або all"
+
+msgid "check out all files in the index"
+msgstr "переключити Ñтан Ð´Ð»Ñ Ð²ÑÑ–Ñ… файлів в індекÑÑ–"
+
+msgid "do not skip files with skip-worktree set"
+msgstr "не пропуÑкати файли зі вÑтановленим skip-worktree"
+
+msgid "force overwrite of existing files"
+msgstr "примуÑово перезапиÑати Ñ–Ñнуючі файли"
+
+msgid "no warning for existing files and files not in index"
+msgstr "не попереджувати про Ñ–Ñнуючі файли та файли, Ñких немає в індекÑÑ–"
+
+msgid "don't checkout new files"
+msgstr "не переключати Ñтан Ð´Ð»Ñ Ð½Ð¾Ð²Ð¸Ñ… файлів"
+
+msgid "update stat information in the index file"
+msgstr "оновити ÑтатиÑтичну інформацію в індекÑному файлі"
+
+msgid "read list of paths from the standard input"
+msgstr "зчитати ÑпиÑок шлÑхів зі Ñтандартного вводу"
+
+msgid "write the content to temporary files"
+msgstr "запиÑати вміÑÑ‚ у тимчаÑові файли"
+
+msgid "copy out the files from named stage"
+msgstr "Ñкопіювати файли з іменованої Ñтадії"
+
+msgid "git checkout [<options>] <branch>"
+msgstr "git checkout [<опції>] <гілка>"
+
+msgid "git checkout [<options>] [<branch>] -- <file>..."
+msgstr "git checkout [<опції>] [<гілка>] -- <файл>..."
+
+msgid "git switch [<options>] [<branch>]"
+msgstr "git switch [<опції>] [<гілка>]"
+
+msgid "git restore [<options>] [--source=<branch>] <file>..."
+msgstr "git restore [<опції>] [--source=<гілка>] <файл>..."
+
+#, c-format
+msgid "path '%s' does not have our version"
+msgstr "шлÑÑ… \"%s\" не міÑтить нашої верÑÑ–Ñ—"
+
+#, c-format
+msgid "path '%s' does not have their version"
+msgstr "шлÑÑ… \"%s\" не міÑтить їхньої верÑÑ–Ñ—"
+
+#, c-format
+msgid "path '%s' does not have all necessary versions"
+msgstr "шлÑÑ… \"%s\" не міÑтить вÑÑ–Ñ… необхідних верÑій"
+
+#, c-format
+msgid "path '%s' does not have necessary versions"
+msgstr "шлÑÑ… \"%s\" не міÑтить необхідних верÑій"
+
+#, c-format
+msgid "path '%s': cannot merge"
+msgstr "шлÑÑ… \"%s\": неможливо злити"
+
+#, c-format
+msgid "Unable to add merge result for '%s'"
+msgstr "Ðеможливо додати результат Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "Recreated %d merge conflict"
+msgid_plural "Recreated %d merge conflicts"
+msgstr[0] "Відтворено %d конфлікт злиттÑ"
+msgstr[1] "Відтворено %d конфлікта злиттÑ"
+msgstr[2] "Відтворено %d конфліктів злиттÑ"
+
+#, c-format
+msgid "Updated %d path from %s"
+msgid_plural "Updated %d paths from %s"
+msgstr[0] "Оновлено %d шлÑÑ… з %s"
+msgstr[1] "Оновлено %d шлÑхи з %s"
+msgstr[2] "Оновлено %d шлÑхів з %s"
+
+#, c-format
+msgid "Updated %d path from the index"
+msgid_plural "Updated %d paths from the index"
+msgstr[0] "Оновлено %d шлÑÑ… з індекÑу"
+msgstr[1] "Оновлено %d шлÑхи з індекÑу"
+msgstr[2] "Оновлено %d шлÑхів з індекÑу"
+
+#, c-format
+msgid "'%s' cannot be used with updating paths"
+msgstr "\"%s\" не можна викориÑтовувати зі шлÑхами оновленнÑ"
+
+#, c-format
+msgid "Cannot update paths and switch to branch '%s' at the same time."
+msgstr "Ðеможливо одночаÑно оновити шлÑхи та переключитиÑÑŒ на гілку \"%s\"."
+
+#, c-format
+msgid "neither '%s' or '%s' is specified"
+msgstr "не вказано ні \"%s\", ні \"%s\""
+
+#, c-format
+msgid "'%s' must be used when '%s' is not specified"
+msgstr "\"%s\" повинен викориÑтовуватиÑÑ, Ñкщо не вказано \"%s\""
+
+#, c-format
+msgid "'%s' or '%s' cannot be used with %s"
+msgstr "\"%s\" або \"%s\" не можна викориÑтовувати з %s"
+
+#, c-format
+msgid "'%s', '%s', or '%s' cannot be used when checking out of a tree"
+msgstr ""
+"\"%s\", \"%s\" або \"%s\" не можна викориÑтовувати при переключенні Ñтану"
+
+#, c-format
+msgid "path '%s' is unmerged"
+msgstr "шлÑÑ… '%s' не злитий"
+
+msgid "you need to resolve your current index first"
+msgstr "Ñпочатку потрібно розібратиÑÑŒ з вашим поточним індекÑом"
+
+#, c-format
+msgid ""
+"cannot continue with staged changes in the following files:\n"
+"%s"
+msgstr ""
+"неможливо продовжити з індекÑованими змінами в наÑтупних файлах:\n"
+"%s"
+
+#, c-format
+msgid "Can not do reflog for '%s': %s\n"
+msgstr "Ðеможливо виконати reflog Ð´Ð»Ñ \"%s\": %s\n"
+
+msgid "HEAD is now at"
+msgstr "HEAD зараз на"
+
+msgid "unable to update HEAD"
+msgstr "не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ HEAD"
+
+#, c-format
+msgid "Reset branch '%s'\n"
+msgstr "Скинути гілку \"%s\"\n"
+
+#, c-format
+msgid "Already on '%s'\n"
+msgstr "Вже на \"%s\"\n"
+
+#, c-format
+msgid "Switched to and reset branch '%s'\n"
+msgstr "Переключено на та Ñкинуто гілку '%s'\n"
+
+#, c-format
+msgid "Switched to a new branch '%s'\n"
+msgstr "Переключено на нову гілку \"%s\"\n"
+
+#, c-format
+msgid "Switched to branch '%s'\n"
+msgstr "Переключено на гілку \"%s\"\n"
+
+#, c-format
+msgid " ... and %d more.\n"
+msgstr " ... та ще %d.\n"
+
+#, c-format
+msgid ""
+"Warning: you are leaving %d commit behind, not connected to\n"
+"any of your branches:\n"
+"\n"
+"%s\n"
+msgid_plural ""
+"Warning: you are leaving %d commits behind, not connected to\n"
+"any of your branches:\n"
+"\n"
+"%s\n"
+msgstr[0] ""
+"ПопередженнÑ: ви залишаєте позаду %d коміт, не підключений до\n"
+"жодної з ваших гілок:\n"
+"\n"
+"%s\n"
+msgstr[1] ""
+"ПопередженнÑ: ви залишаєте позаду %d коміти, не підключених до\n"
+"жодної з ваших гілок:\n"
+"\n"
+"%s\n"
+msgstr[2] ""
+"ПопередженнÑ: ви залишаєте позаду %d комітів, не підключених до\n"
+"жодної з ваших гілок:\n"
+"\n"
+"%s\n"
+
+#, c-format
+msgid ""
+"If you want to keep it by creating a new branch, this may be a good time\n"
+"to do so with:\n"
+"\n"
+" git branch <new-branch-name> %s\n"
+"\n"
+msgid_plural ""
+"If you want to keep them by creating a new branch, this may be a good time\n"
+"to do so with:\n"
+"\n"
+" git branch <new-branch-name> %s\n"
+"\n"
+msgstr[0] ""
+"Якщо ви хочете зберегти його, Ñтворивши нову гілку, то зараз Ñ” чудова "
+"нагода\n"
+"зробити це за допомогою:\n"
+"git branch <назва-нової-гілки> %s\n"
+"\n"
+msgstr[1] ""
+"Якщо ви хочете зберегти Ñ—Ñ…, Ñтворивши нову гілку, то зараз Ñ” чудова нагода\n"
+"зробити це за допомогою:\n"
+"git branch <назва-нової-гілки> %s\n"
+"\n"
+msgstr[2] ""
+"Якщо ви хочете зберегти Ñ—Ñ…, Ñтворивши нову гілку, то зараз Ñ” чудова нагода\n"
+"зробити це за допомогою:\n"
+"git branch <назва-нової-гілки> %s\n"
+"\n"
+
+msgid "internal error in revision walk"
+msgstr "Ð²Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ° при проходженні по ревізіÑм"
+
+msgid "Previous HEAD position was"
+msgstr "ÐŸÐ¾Ð¿ÐµÑ€ÐµÐ´Ð½Ñ Ð¿Ð¾Ð·Ð¸Ñ†Ñ–Ñ HEAD була"
+
+msgid "You are on a branch yet to be born"
+msgstr "Ви на гілці, Ñка ще не iÑнує"
+
+#, c-format
+msgid ""
+"'%s' could be both a local file and a tracking branch.\n"
+"Please use -- (and optionally --no-guess) to disambiguate"
+msgstr ""
+"\"%s\" може бути Ñк локальним файлом, так Ñ– відÑтежуваною гілкою.\n"
+"Будь лаÑка, викориÑтовуйте -- (Ñ–, за бажаннÑм, --no-guess), Ð´Ð»Ñ Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ"
+
+msgid ""
+"If you meant to check out a remote tracking branch on, e.g. 'origin',\n"
+"you can do so by fully qualifying the name with the --track option:\n"
+"\n"
+" git checkout --track origin/<name>\n"
+"\n"
+"If you'd like to always have checkouts of an ambiguous <name> prefer\n"
+"one remote, e.g. the 'origin' remote, consider setting\n"
+"checkout.defaultRemote=origin in your config."
+msgstr ""
+"Якщо ви хотіли переключитиÑÑŒ на віддалено відÑтежувану гілку, наприклад, "
+"'origin',\n"
+"ви можете зробити це, повніÑÑ‚ÑŽ вказавши назву з опцією --track:\n"
+"\n"
+" git checkout --track origin/<назва>.\n"
+"\n"
+"Якщо при переключенні з неоднозначною <назвою> ви бажаєте завжди віддавати "
+"перевагу\n"
+"певному віддаленому Ñховищу, наприклад, 'origin', розглÑньте можливіÑÑ‚ÑŒ "
+"доданнÑ\n"
+"checkout.defaultRemote=origin до вашого конфігураційного файлу."
+
+#, c-format
+msgid "'%s' matched multiple (%d) remote tracking branches"
+msgstr "\"%s\" відповідає кільком (%d) гілкам віддаленого відÑтежуваннÑ"
+
+msgid "only one reference expected"
+msgstr "очікувалоÑÑŒ тільки одне поÑиланнÑ"
+
+#, c-format
+msgid "only one reference expected, %d given."
+msgstr "очікувалоÑÑŒ тільки одне поÑиланнÑ, надано %d."
+
+#, c-format
+msgid "invalid reference: %s"
+msgstr "неприпуÑтиме поÑиланнÑ: %s"
+
+#, c-format
+msgid "reference is not a tree: %s"
+msgstr "поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” деревом: %s"
+
+#, c-format
+msgid "a branch is expected, got tag '%s'"
+msgstr "очікувалаÑÑŒ гілка, надано тег \"%s\""
+
+#, c-format
+msgid "a branch is expected, got remote branch '%s'"
+msgstr "очікувалаÑÑŒ гілка, надана віддалена гілка \"%s\""
+
+#, c-format
+msgid "a branch is expected, got '%s'"
+msgstr "очікувалаÑÑŒ гілка, надано \"%s\""
+
+#, c-format
+msgid "a branch is expected, got commit '%s'"
+msgstr "очікувалаÑÑŒ гілка, надано коміт \"%s\""
+
+msgid ""
+"If you want to detach HEAD at the commit, try again with the --detach option."
+msgstr ""
+"Якщо ви хочете від'єднати HEAD на цьому коміті, Ñпробуйте ще раз з опцією --"
+"detach."
+
+msgid ""
+"cannot switch branch while merging\n"
+"Consider \"git merge --quit\" or \"git worktree add\"."
+msgstr ""
+"неможливо змінити гілку під Ñ‡Ð°Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ\n"
+"Спробуйте \"git merge --quit\" або \"git worktree add\"."
+
+msgid ""
+"cannot switch branch in the middle of an am session\n"
+"Consider \"git am --quit\" or \"git worktree add\"."
+msgstr ""
+"неможливо змінити гілку під Ñ‡Ð°Ñ am ÑеанÑу\n"
+"Спробуйте \"git am --quit\" або \"git worktree add\"."
+
+msgid ""
+"cannot switch branch while rebasing\n"
+"Consider \"git rebase --quit\" or \"git worktree add\"."
+msgstr ""
+"неможливо змінити гілку під Ñ‡Ð°Ñ Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ\n"
+"Спробуйте \"git rebase --quit\" або \"git worktree add\"."
+
+msgid ""
+"cannot switch branch while cherry-picking\n"
+"Consider \"git cherry-pick --quit\" or \"git worktree add\"."
+msgstr ""
+"неможливо змінити гілку під Ñ‡Ð°Ñ Ð²Ð¸ÑмикуваннÑ\n"
+"Спробуйте \"git cherry-pick --quit\" або \"git worktree add\"."
+
+msgid ""
+"cannot switch branch while reverting\n"
+"Consider \"git revert --quit\" or \"git worktree add\"."
+msgstr ""
+"неможливо змінити гілку під Ñ‡Ð°Ñ Ð²Ð¸Ð²ÐµÑ€Ñ‚Ð°Ð½Ð½Ñ\n"
+"Спробуйте \"git revert --quit\" або \"git worktree add\"."
+
+msgid "you are switching branch while bisecting"
+msgstr "ви переключаєте гілку під Ñ‡Ð°Ñ Ð±Ñ–Ñекції"
+
+msgid "paths cannot be used with switching branches"
+msgstr "шлÑхи не можуть викориÑтовуватиÑÑŒ при переключенні гілок"
+
+#, c-format
+msgid "'%s' cannot be used with switching branches"
+msgstr "'%s' не може викориÑтовуватиÑÑŒ при переключенні гілок"
+
+#, c-format
+msgid "'%s' cannot be used with '%s'"
+msgstr "'%s' не може викориÑтовуватиÑÑŒ з '%s'"
+
+#, c-format
+msgid "'%s' cannot take <start-point>"
+msgstr "'%s' не може прийнÑти <Ñтартова-точка>"
+
+#, c-format
+msgid "Cannot switch branch to a non-commit '%s'"
+msgstr "Ðеможливо переключити гілку на не коміт '%s'"
+
+msgid "missing branch or commit argument"
+msgstr "відÑÑƒÑ‚Ð½Ñ Ð³Ñ–Ð»ÐºÐ° або коміт"
+
+msgid "perform a 3-way merge with the new branch"
+msgstr "здійÑнити 3-Ñтороннє Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð· новою гілкою"
+
+msgid "style"
+msgstr "Ñтиль"
+
+msgid "conflict style (merge, diff3, or zdiff3)"
+msgstr "конфлікт Ñтилю (merge, diff3 або zdiff3)"
+
+msgid "detach HEAD at named commit"
+msgstr "відʼєднати HEAD на вказаному коміті"
+
+msgid "force checkout (throw away local modifications)"
+msgstr "переключити примуÑово (викинути локальні зміни)"
+
+msgid "new-branch"
+msgstr "нова-гілка"
+
+msgid "new unborn branch"
+msgstr "нова ненароджена гілка"
+
+msgid "update ignored files (default)"
+msgstr "оновити ігноровані файли (за замовчуваннÑм)"
+
+msgid "do not check if another worktree is holding the given ref"
+msgstr "не перевірÑти, чи інше робоче дерево міÑтить дане поÑиланнÑ"
+
+msgid "checkout our version for unmerged files"
+msgstr "викориÑтовувати нашу верÑÑ–ÑŽ Ð´Ð»Ñ Ð½Ðµ злитих файлів"
+
+msgid "checkout their version for unmerged files"
+msgstr "викориÑтовувати їхню верÑÑ–ÑŽ Ð´Ð»Ñ Ð½Ðµ злитих файлів"
+
+msgid "do not limit pathspecs to sparse entries only"
+msgstr "не обмежувати визначники шлÑхів лише розрідженими запиÑами"
+
+#, c-format
+msgid "options '-%c', '-%c', and '%s' cannot be used together"
+msgstr "опції \"-%c\", \"-%c\" та \"%s\" не можна викориÑтовувати разом"
+
+msgid "--track needs a branch name"
+msgstr "--track потребує назви гілки"
+
+#, c-format
+msgid "missing branch name; try -%c"
+msgstr "відÑÑƒÑ‚Ð½Ñ Ð½Ð°Ð·Ð²Ð° гілки; Ñпробуйте -%c"
+
+#, c-format
+msgid "could not resolve %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð²Ê¼Ñзати %s"
+
+msgid "invalid path specification"
+msgstr "неприпуÑтиме Ð·Ð°Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÑˆÐ»Ñху"
+
+#, c-format
+msgid "'%s' is not a commit and a branch '%s' cannot be created from it"
+msgstr "'%s' не Ñ” комітом, Ñ– з нього не можна Ñтворити гілку '%s'"
+
+#, c-format
+msgid "git checkout: --detach does not take a path argument '%s'"
+msgstr "git checkout: --detach не приймає аргумент шлÑху '%s'"
+
+msgid ""
+"git checkout: --ours/--theirs, --force and --merge are incompatible when\n"
+"checking out of the index."
+msgstr ""
+"git checkout: --ours/--theirs, --force та --merge неÑуміÑні при\n"
+"при прееключенні індекÑу."
+
+msgid "you must specify path(s) to restore"
+msgstr "необхідно вказати шлÑÑ…(и) Ð´Ð»Ñ Ð²Ñ–Ð´Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ"
+
+msgid "branch"
+msgstr "гілка"
+
+msgid "create and checkout a new branch"
+msgstr "Ñтворити та перейти до нової гілки"
+
+msgid "create/reset and checkout a branch"
+msgstr "Ñтворити/Ñкинути та перейти до нової гілки"
+
+msgid "create reflog for new branch"
+msgstr "Ñтворити журнал поÑилань Ð´Ð»Ñ Ð½Ð¾Ð²Ð¾Ñ— гілки"
+
+msgid "second guess 'git checkout <no-such-branch>' (default)"
+msgstr "друга здогадка \"git checkout <гілка-не-Ñ–Ñнує>\" (за замовчуваннÑм)"
+
+msgid "use overlay mode (default)"
+msgstr "викориÑтовувати режим Ð½Ð°ÐºÐ»Ð°Ð´ÐµÐ½Ð½Ñ (за замовчуваннÑм)"
+
+msgid "create and switch to a new branch"
+msgstr "Ñтворити та переключити на нову гілку"
+
+msgid "create/reset and switch to a branch"
+msgstr "Ñтворити/Ñкинути та переключити на гілку"
+
+msgid "second guess 'git switch <no-such-branch>'"
+msgstr "друга здогадка \"git switch <гілка-не-Ñ–Ñнує>\" (за замовчуваннÑм)"
+
+msgid "throw away local modifications"
+msgstr "викинути локальні зміни"
+
+msgid "which tree-ish to checkout from"
+msgstr "з Ñкого деревоподібного джерела Ñтворювати"
+
+msgid "restore the index"
+msgstr "відновити індекÑ"
+
+msgid "restore the working tree (default)"
+msgstr "відновити робоче дерево (за замовчуваннÑм)"
+
+msgid "ignore unmerged entries"
+msgstr "ігнорувати не злиті запиÑи"
+
+msgid "use overlay mode"
+msgstr "викориÑтовувати режим накладеннÑ"
+
+msgid ""
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] "
+"[<pathspec>...]"
+msgstr ""
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <шаблон>] [-x | -X] [--] [<визначник "
+"шлÑху>...]"
+
+#, c-format
+msgid "Removing %s\n"
+msgstr "Ð’Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ %s\n"
+
+#, c-format
+msgid "Would remove %s\n"
+msgstr "Було б видалено %s\n"
+
+#, c-format
+msgid "Skipping repository %s\n"
+msgstr "ПропуÑк Ñховища %s\n"
+
+#, c-format
+msgid "Would skip repository %s\n"
+msgstr "Було б пропущено Ñховище %s\n"
+
+#, c-format
+msgid "failed to remove %s"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ %s"
+
+#, c-format
+msgid "could not lstat %s\n"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ lstat %s\n"
+
+msgid "Refusing to remove current working directory\n"
+msgstr "Відмовлено у видаленні поточної робочої директорії\n"
+
+msgid "Would refuse to remove current working directory\n"
+msgstr "Було б відмовлено у видаленні поточної робочої директорії\n"
+
+#, c-format
+msgid ""
+"Prompt help:\n"
+"1 - select a numbered item\n"
+"foo - select item based on unique prefix\n"
+" - (empty) select nothing\n"
+msgstr ""
+"Підказка по опціÑм:\n"
+"1 - вибрати пронумерований елемент\n"
+"foo - вибрати елемент за унікальним префікÑом\n"
+" - (порожньо) - не вибирати нічого\n"
+
+#, c-format
+msgid ""
+"Prompt help:\n"
+"1 - select a single item\n"
+"3-5 - select a range of items\n"
+"2-3,6-9 - select multiple ranges\n"
+"foo - select item based on unique prefix\n"
+"-... - unselect specified items\n"
+"* - choose all items\n"
+" - (empty) finish selecting\n"
+msgstr ""
+"Підказка по опціÑм:\n"
+"1 - вибрати один елемент\n"
+"3-5 - вибрати діапазон елементів\n"
+"2-3,6-9 - вибрати кілька діапазонів\n"
+"foo - вибрати елемент за унікальним префікÑом\n"
+"-... - ÑкаÑувати вибір вказаних елементів\n"
+"* - вибрати вÑÑ– елементи\n"
+" - (порожньо) завершити вибір\n"
+
+#, c-format
+msgid "Huh (%s)?\n"
+msgstr "Га (%s)?\n"
+
+#, c-format
+msgid "Input ignore patterns>> "
+msgstr "Введіть шаблони ігноруваннÑ>> "
+
+#, c-format
+msgid "WARNING: Cannot find items matched by: %s"
+msgstr "ПОПЕРЕДЖЕÐÐЯ: Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ елементи, що відповідають: %s"
+
+msgid "Select items to delete"
+msgstr "Виберіть елементи Ð´Ð»Ñ Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ"
+
+#. TRANSLATORS: Make sure to keep [y/N] as is
+#, c-format
+msgid "Remove %s [y/N]? "
+msgstr "Видалити %s [y/N]? "
+
+msgid ""
+"clean - start cleaning\n"
+"filter by pattern - exclude items from deletion\n"
+"select by numbers - select items to be deleted by numbers\n"
+"ask each - confirm each deletion (like \"rm -i\")\n"
+"quit - stop cleaning\n"
+"help - this screen\n"
+"? - help for prompt selection"
+msgstr ""
+"clean - розпочати прибираннÑ\n"
+"filter by pattern - виключити елементи з прибираннÑ\n"
+"select by numbers - вибрати елементи Ð´Ð»Ñ Ð¿Ñ€Ð¸Ð±Ð¸Ñ€Ð°Ð½Ð½Ñ Ð·Ð° номерами\n"
+"ask each - підтверджувати кожне Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ (Ñк \"rm -i\")\n"
+"quit - припинити прибираннÑ\n"
+"help - показати цей екран\n"
+"? - підказка Ð´Ð»Ñ ÑˆÐ²Ð¸Ð´ÐºÐ¾Ð³Ð¾ вибору"
+
+msgid "Would remove the following item:"
+msgid_plural "Would remove the following items:"
+msgstr[0] "Видалить наÑтупний елемент:"
+msgstr[1] "Видалить наÑтупні елементи:"
+msgstr[2] "Видалить наÑтупні елементи:"
+
+msgid "No more files to clean, exiting."
+msgstr "Більше немає файлів Ð´Ð»Ñ Ð¿Ñ€Ð¸Ð±Ð¸Ñ€Ð°Ð½Ð½Ñ, вихід."
+
+msgid "do not print names of files removed"
+msgstr "не виводити назви видалених файлів"
+
+msgid "force"
+msgstr "примуÑово"
+
+msgid "interactive cleaning"
+msgstr "інтерактивне прибираннÑ"
+
+msgid "remove whole directories"
+msgstr "видалÑти цілі директорії"
+
+msgid "pattern"
+msgstr "шаблон"
+
+msgid "add <pattern> to ignore rules"
+msgstr "додати <шаблон> в правила ігноруваннÑ"
+
+msgid "remove ignored files, too"
+msgstr "видалити також ігноровані файли"
+
+msgid "remove only ignored files"
+msgstr "видалити лише ігноровані файли"
+
+msgid ""
+"clean.requireForce set to true and neither -i, -n, nor -f given; refusing to "
+"clean"
+msgstr ""
+"clean.requireForce вÑтановлено у true Ñ– не задано ні -i, ні -n, ні -f; "
+"відмовлено в прибиранні"
+
+msgid ""
+"clean.requireForce defaults to true and neither -i, -n, nor -f given; "
+"refusing to clean"
+msgstr ""
+"clean.requireForce вÑтановлено у true за замовчуваннÑм Ñ– не задано ні -i, ні "
+"-n, ні -f; відмовлено в прибиранні"
+
+msgid "git clone [<options>] [--] <repo> [<dir>]"
+msgstr "git clone [<опції>] [--] <Ñховище> [<директоріÑ>]"
+
+msgid "don't clone shallow repository"
+msgstr "не клонувати неглибоке Ñховище"
+
+msgid "don't create a checkout"
+msgstr "не переходити на гілку"
+
+msgid "create a bare repository"
+msgstr "Ñтворити порожнє Ñховище"
+
+msgid "create a mirror repository (implies bare)"
+msgstr "Ñтворити дзеркальне Ñховище (включає опцію bare)"
+
+msgid "to clone from a local repository"
+msgstr "клонувати з локального Ñховища"
+
+msgid "don't use local hardlinks, always copy"
+msgstr "не викориÑтовувати локальні жорÑткі поÑиланнÑ, завжди копіювати"
+
+msgid "setup as shared repository"
+msgstr "налаштувати Ñк Ñпільне Ñховище"
+
+msgid "pathspec"
+msgstr "визначник шлÑху"
+
+msgid "initialize submodules in the clone"
+msgstr "ініціалізувати підмодулі в клоні"
+
+msgid "number of submodules cloned in parallel"
+msgstr "кількіÑÑ‚ÑŒ підмодулів, що клонуютьÑÑ Ð¿Ð°Ñ€Ð°Ð»ÐµÐ»ÑŒÐ½Ð¾"
+
+msgid "template-directory"
+msgstr "директоріÑ-шаблонів"
+
+msgid "directory from which templates will be used"
+msgstr "директоріÑ, з Ñкої брати шаблони"
+
+msgid "reference repository"
+msgstr "поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ð° Ñховище"
+
+msgid "use --reference only while cloning"
+msgstr "викориÑтовуйте --reference тільки під Ñ‡Ð°Ñ ÐºÐ»Ð¾Ð½ÑƒÐ²Ð°Ð½Ð½Ñ"
+
+msgid "name"
+msgstr "назва"
+
+msgid "use <name> instead of 'origin' to track upstream"
+msgstr ""
+"викориÑтовуйте <назва> заміÑÑ‚ÑŒ \"origin\" Ð´Ð»Ñ Ð²Ñ–Ð´ÑÑ‚ÐµÐ¶ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿ÐµÑ€ÑˆÐ¾Ð´Ð¶ÐµÑ€ÐµÐ»ÑŒÐ½Ð¾Ð³Ð¾ "
+"Ñховища"
+
+msgid "checkout <branch> instead of the remote's HEAD"
+msgstr "перейти до <гілки> заміÑÑ‚ÑŒ HEAD віддаленого Ñховища"
+
+msgid "path to git-upload-pack on the remote"
+msgstr "шлÑÑ… до git-upload-pack на віддаленому Ñервері"
+
+msgid "depth"
+msgstr "глибина"
+
+msgid "create a shallow clone of that depth"
+msgstr "Ñтворити неглибокий клон вказаної глибини"
+
+msgid "create a shallow clone since a specific time"
+msgstr "Ñтворити неглибокий клон з певного чаÑу"
+
+msgid "revision"
+msgstr "ревізіÑ"
+
+msgid "deepen history of shallow clone, excluding rev"
+msgstr "поглибити Ñ–Ñторію неглибокого клону, за винÑтком ревізії"
+
+msgid "clone only one branch, HEAD or --branch"
+msgstr "клонувати лише одну гілку, HEAD або --branch"
+
+msgid "don't clone any tags, and make later fetches not to follow them"
+msgstr ""
+"не клонувати жодних тегів Ñ– не Ñлідувати за ними під Ñ‡Ð°Ñ Ð¾Ñ‚Ñ€Ð¸Ð¼ÑƒÐ²Ð°Ð½ÑŒ пізніше"
+
+msgid "any cloned submodules will be shallow"
+msgstr "будь-Ñкі клоновані підмодулі будуть неглибокими"
+
+msgid "gitdir"
+msgstr "git директоріÑ"
+
+msgid "separate git dir from working tree"
+msgstr "відокремити git-директорію від робочого дерева"
+
+msgid "specify the reference format to use"
+msgstr "вкажіть формат поÑиланнÑ, Ñкий потрібно викориÑтовувати"
+
+msgid "key=value"
+msgstr "ключ=значеннÑ"
+
+msgid "set config inside the new repository"
+msgstr "вÑтановити конфігурацію вÑередині нового Ñховища"
+
+msgid "server-specific"
+msgstr "тільки Ð´Ð»Ñ Ñервера"
+
+msgid "option to transmit"
+msgstr "Ð¾Ð¿Ñ†Ñ–Ñ Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ´Ð°Ñ‡Ñ–"
+
+msgid "apply partial clone filters to submodules"
+msgstr "заÑтоÑувати фільтри чаÑткового ÐºÐ»Ð¾Ð½ÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð¾ підмодулів"
+
+msgid "any cloned submodules will use their remote-tracking branch"
+msgstr ""
+"будь-Ñкі клоновані підмодулі будуть викориÑтовувати Ñвою віддалено "
+"відÑтежувану гілку"
+
+msgid "initialize sparse-checkout file to include only files at root"
+msgstr ""
+"ініціалізувати, щоб файл розрідженого переходу включав лише файли в корені"
+
+msgid "uri"
+msgstr "uri"
+
+msgid "a URI for downloading bundles before fetching from origin remote"
+msgstr "URI Ð´Ð»Ñ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ Ð¿Ð°ÐºÑƒÐ½ÐºÑ–Ð² перед отриманнÑм з віддаленого джерела"
+
+#, c-format
+msgid "info: Could not add alternate for '%s': %s\n"
+msgstr "инфо: Ðе вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ запозичений обʼєкт Ð´Ð»Ñ \"%s\": %s\n"
+
+#, c-format
+msgid "failed to stat '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ stat \"%s\""
+
+#, c-format
+msgid "%s exists and is not a directory"
+msgstr "%s Ñ–Ñнує Ñ– не Ñ” директорією"
+
+#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "\"%s\" Ñ” Ñимвольним поÑиланнÑм, відмовлено в клонуванні з --local"
+
+#, c-format
+msgid "failed to start iterator over '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити перебір Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "symlink '%s' exists, refusing to clone with --local"
+msgstr "Ñимвольне поÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\" Ñ–Ñнує, не можу клонувати з --local"
+
+#, c-format
+msgid "failed to unlink '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ \"%s\""
+
+#, c-format
+msgid "failed to create link '%s'"
+msgstr "не вдалоÑÑ Ñтворити поÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\""
+
+#, c-format
+msgid "failed to copy file to '%s'"
+msgstr "не вдалоÑÑ Ñкопіювати файл у \"%s\""
+
+#, c-format
+msgid "failed to iterate over '%s'"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ±Ñ€Ð°Ñ‚Ð¸ \"%s\""
+
+#, c-format
+msgid "done.\n"
+msgstr "готово.\n"
+
+msgid ""
+"Clone succeeded, but checkout failed.\n"
+"You can inspect what was checked out with 'git status'\n"
+"and retry with 'git restore --source=HEAD :/'\n"
+msgstr ""
+"ÐšÐ»Ð¾Ð½ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ñ€Ð¾Ð¹ÑˆÐ»Ð¾ уÑпішно, але не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¹Ñ‚Ð¸ на гілку.\n"
+"Ви можете перевірити, що було додано за допомогою 'git status'\n"
+"Ñ– повторити Ñпробу за допомогою 'git restore --source=HEAD :/'\n"
+
+#, c-format
+msgid "Could not find remote branch %s to clone."
+msgstr "Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ віддалену гілку %s Ð´Ð»Ñ ÐºÐ»Ð¾Ð½ÑƒÐ²Ð°Ð½Ð½Ñ."
+
+msgid "remote did not send all necessary objects"
+msgstr "віддалене Ñховище не надіÑлало вÑÑ– необхідні обʼєкти"
+
+#, c-format
+msgid "unable to update %s"
+msgstr "не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ %s"
+
+msgid "failed to initialize sparse-checkout"
+msgstr "не вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ розріджений перехід"
+
+msgid "remote HEAD refers to nonexistent ref, unable to checkout"
+msgstr "віддалений HEAD поÑилаєтьÑÑ Ð½Ð° неіÑнуючого рефа, неможливо перейти"
+
+msgid "unable to checkout working tree"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ Ñтан робочої директорії"
+
+msgid "unable to write parameters to config file"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати параметри до конфігураційного файлу"
+
+msgid "cannot repack to clean up"
+msgstr "неможливо перепакувати, щоб очиÑтити"
+
+msgid "cannot unlink temporary alternates file"
+msgstr "неможливо видалити тимчаÑовий файл запозичених обʼєктів"
+
+msgid "Too many arguments."
+msgstr "Забагато аргументів."
+
+msgid "You must specify a repository to clone."
+msgstr "Треба вказати Ñховище Ð´Ð»Ñ ÐºÐ»Ð¾Ð½ÑƒÐ²Ð°Ð½Ð½Ñ."
+
+#, c-format
+msgid "unknown ref storage format '%s'"
+msgstr "невідомий формат Ð·Ð±ÐµÑ€Ñ–Ð³Ð°Ð½Ð½Ñ Ð¿Ð¾Ñилань \"%s\""
+
+#, c-format
+msgid "repository '%s' does not exist"
+msgstr "Ñховище \"%s\" не Ñ–Ñнує"
+
+#, c-format
+msgid "depth %s is not a positive number"
+msgstr "глибина %s не Ñ” додатнім чиÑлом"
+
+#, c-format
+msgid "destination path '%s' already exists and is not an empty directory."
+msgstr "шлÑÑ… Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"%s\" вже Ñ–Ñнує Ñ– не Ñ” порожньою директорією."
+
+#, c-format
+msgid "repository path '%s' already exists and is not an empty directory."
+msgstr "шлÑÑ… до Ñховища \"%s\" вже Ñ–Ñнує Ñ– не Ñ” порожньою директорією."
+
+#, c-format
+msgid "working tree '%s' already exists."
+msgstr "робоче дерево \"%s\" вже Ñ–Ñнує."
+
+#, c-format
+msgid "could not create leading directories of '%s'"
+msgstr "не вдалоÑÑ Ñтворити провідні директорії Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "could not create work tree dir '%s'"
+msgstr "не вдалоÑÑ Ñтворити директорію робочого дерева \"%s\""
+
+#, c-format
+msgid "Cloning into bare repository '%s'...\n"
+msgstr "ÐšÐ»Ð¾Ð½ÑƒÐ²Ð°Ð½Ð½Ñ Ñƒ порожнє Ñховище \"%s\"...\n"
+
+#, c-format
+msgid "Cloning into '%s'...\n"
+msgstr "ÐšÐ»Ð¾Ð½ÑƒÐ²Ð°Ð½Ð½Ñ Ð² \"%s\"..\n"
+
+msgid ""
+"clone --recursive is not compatible with both --reference and --reference-if-"
+"able"
+msgstr ""
+"clone --recursive не ÑуміÑне з --reference та --reference-if-able одночаÑно"
+
+#, c-format
+msgid "'%s' is not a valid remote name"
+msgstr "\"%s\" не Ñ” дійÑною назвою віддаленого Ñховища"
+
+msgid "--depth is ignored in local clones; use file:// instead."
+msgstr ""
+"--depth ігноруєтьÑÑ Ñƒ локальних клонах; викориÑтовуйте file:// заміÑÑ‚ÑŒ цього."
+
+msgid "--shallow-since is ignored in local clones; use file:// instead."
+msgstr ""
+"--shallow-since ігноруєтьÑÑ Ñƒ локальних клонах; викориÑтовуйте file:// "
+"заміÑÑ‚ÑŒ цього."
+
+msgid "--shallow-exclude is ignored in local clones; use file:// instead."
+msgstr ""
+"--shallow-exclude ігноруєтьÑÑ Ñƒ локальних клонах; викориÑтовуйте file:// "
+"заміÑÑ‚ÑŒ цього."
+
+msgid "--filter is ignored in local clones; use file:// instead."
+msgstr ""
+"--filter ігноруєтьÑÑ Ñƒ локальних клонах; викориÑтовуйте file:// заміÑÑ‚ÑŒ "
+"нього."
+
+msgid "source repository is shallow, reject to clone."
+msgstr "джерельне Ñховище Ñ” неглибоким, ÐºÐ»Ð¾Ð½ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ñ–Ð´Ñ…Ð¸Ð»ÐµÐ½Ð¾."
+
+msgid "source repository is shallow, ignoring --local"
+msgstr "джерельне Ñховище Ñ” неглибоким, --local ігноровано"
+
+msgid "--local is ignored"
+msgstr "--local ігноровано"
+
+msgid "cannot clone from filtered bundle"
+msgstr "неможливо клонувати з відфільтрованого пакунка"
+
+msgid "failed to initialize the repo, skipping bundle URI"
+msgstr "не вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ Ñховище, URI пакунка пропущено"
+
+#, c-format
+msgid "failed to fetch objects from bundle URI '%s'"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ обʼєкти з пакунка URI '%s'"
+
+msgid "failed to fetch advertised bundles"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ обіцÑні пакунки"
+
+msgid "remote transport reported error"
+msgstr "Ð¾Ð¿ÐµÑ€Ð°Ñ†Ñ–Ñ Ð²Ñ–Ð´Ð´Ð°Ð»ÐµÐ½Ð¾Ð³Ð¾ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð¸Ð»Ð° про помилку"
+
+#, c-format
+msgid "Remote branch %s not found in upstream %s"
+msgstr "Віддалену гілку %s не знайдено у першоджерельному Ñховищі %s"
+
+msgid "You appear to have cloned an empty repository."
+msgstr "ЗдаєтьÑÑ, ви клонували порожнє Ñховище."
+
+msgid "git column [<options>]"
+msgstr "git column [<опції>]"
+
+msgid "lookup config vars"
+msgstr "пошук параметрів конфігурації"
+
+msgid "layout to use"
+msgstr "Ñхема розташуваннÑ"
+
+msgid "maximum width"
+msgstr "макÑимальна ширина"
+
+msgid "padding space on left border"
+msgstr "відÑтуп по лівому краю"
+
+msgid "padding space on right border"
+msgstr "відÑтуп по правому краю"
+
+msgid "padding space between columns"
+msgstr "відÑтуп між Ñтовпчиками"
+
+msgid "--command must be the first argument"
+msgstr "--command має бути першим аргументом"
+
+msgid ""
+"git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]"
+msgstr ""
+"git commit-graph verify [--object-dir <директоріÑ>] [--shallow] [--"
+"[no-]progress]"
+
+msgid ""
+"git commit-graph write [--object-dir <dir>] [--append]\n"
+" [--split[=<strategy>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <split-options>"
+msgstr ""
+"git commit-graph write [--object-dir <директоріÑ>] [--append] [--object-dir "
+"<директоріÑ>] [--append] [--object-dir <директоріÑ>] [--append\n"
+" [--split[=<ÑтратегіÑ>]] [--reachable | --stdin-packs "
+"| --stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <чиÑло>] [--"
+"[no-]progress]\n"
+" <опції-розділеннÑ>"
+
+msgid "dir"
+msgstr "директоріÑ"
+
+msgid "the object directory to store the graph"
+msgstr "Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ Ð¾Ð±â€™Ñ”ÐºÑ‚Ñ–Ð² Ð´Ð»Ñ Ð·Ð±ÐµÑ€Ñ–Ð³Ð°Ð½Ð½Ñ Ð³Ñ€Ð°Ñ„Ñƒ"
+
+msgid "if the commit-graph is split, only verify the tip file"
+msgstr "Ñкщо коміт-граф розщеплено, перевірÑти тільки файл підказок"
+
+#, c-format
+msgid "Could not open commit-graph '%s'"
+msgstr "Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ коміт-граф \"%s\""
+
+#, c-format
+msgid "could not open commit-graph chain '%s'"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ ланцюжок коміт-графа \"%s\""
+
+#, c-format
+msgid "unrecognized --split argument, %s"
+msgstr "нерозпізнаний --split аргумент, %s"
+
+#, c-format
+msgid "unexpected non-hex object ID: %s"
+msgstr "неочікуваний не hex ідентифікатор обʼєкта: %s"
+
+#, c-format
+msgid "invalid object: %s"
+msgstr "неприпуÑтимий об’єкт: %s"
+
+#, c-format
+msgid "option `%s' expects a numerical value"
+msgstr "Ð¾Ð¿Ñ†Ñ–Ñ \"%s\" очікує чиÑлове значеннÑ"
+
+msgid "start walk at all refs"
+msgstr "розпочати Ð¿Ñ€Ð¾Ñ…Ð¾Ð´Ð¶ÐµÐ½Ð½Ñ Ð¿Ð¾ вÑім поÑиланнÑм"
+
+msgid "scan pack-indexes listed by stdin for commits"
+msgstr "проÑканувати pack-indexes зазначені через stdin Ð´Ð»Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñ–Ð²"
+
+msgid "start walk at commits listed by stdin"
+msgstr "розпочати Ð¿Ñ€Ð¾Ñ…Ð¾Ð´Ð¶ÐµÐ½Ð½Ñ Ð¿Ð¾ вÑім комітам зазначеним через stdin"
+
+msgid "include all commits already in the commit-graph file"
+msgstr "включити вÑÑ– коміти, Ñкі вже Ñ” у файлі коміт-графа"
+
+msgid "enable computation for changed paths"
+msgstr "увімкнути обчиÑÐ»ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ð·Ð¼Ñ–Ð½ÐµÐ½Ð¸Ñ… шлÑхів"
+
+msgid "allow writing an incremental commit-graph file"
+msgstr "дозволити Ð·Ð°Ð¿Ð¸Ñ Ñ–Ð½ÐºÑ€ÐµÐ¼ÐµÐ½Ñ‚Ð½Ð¾Ð³Ð¾ файлу коміт-графа"
+
+msgid "maximum number of commits in a non-base split commit-graph"
+msgstr "макÑимальна кількіÑÑ‚ÑŒ комітів у безбазовому розщепленому коміт-графі"
+
+msgid "maximum ratio between two levels of a split commit-graph"
+msgstr "макÑимальне ÑÐ¿Ñ–Ð²Ð²Ñ–Ð´Ð½Ð¾ÑˆÐµÐ½Ð½Ñ Ð¼Ñ–Ð¶ двома рівнÑми розщепленого коміт-графа"
+
+msgid "only expire files older than a given date-time"
+msgstr "видалити лише файли, Ñтаріші за вказану дату"
+
+msgid "maximum number of changed-path Bloom filters to compute"
+msgstr "макÑимальна кількіÑÑ‚ÑŒ фільтрів Блума зміненого шлÑху Ð´Ð»Ñ Ð¾Ð±Ñ‡Ð¸ÑленнÑ"
+
+msgid "use at most one of --reachable, --stdin-commits, or --stdin-packs"
+msgstr ""
+"викориÑтовувати щонайбільше один з --reachable, --stdin-commits або --stdin-"
+"packs"
+
+msgid "Collecting commits from input"
+msgstr "Ð—Ð±Ð¸Ñ€Ð°Ð½Ð½Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñ–Ð² з вхідних даних"
+
+msgid "git commit-tree <tree> [(-p <parent>)...]"
+msgstr "git commit-tree <дерево> [(-p <батько>)...]"
+
+msgid ""
+"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]\n"
+" [(-F <file>)...] <tree>"
+msgstr ""
+"git commit-tree [(-p <батько>)...] [-S[<ідентифікатор-ключа>]] [(-m "
+"<допиÑ>)...]\n"
+" [(-F <файл>)...] <дерево>"
+
+#, c-format
+msgid "duplicate parent %s ignored"
+msgstr "проігноровано дубльований батьківÑький %s"
+
+#, c-format
+msgid "not a valid object name %s"
+msgstr "невірне Ñ–Ð¼â€™Ñ Ð¾Ð±â€™Ñ”ÐºÑ‚Ð° %s"
+
+#, c-format
+msgid "git commit-tree: failed to read '%s'"
+msgstr "git commit-tree: не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ \"%s\""
+
+#, c-format
+msgid "git commit-tree: failed to close '%s'"
+msgstr "git commit-tree: не вдалоÑÑ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¸ \"%s\""
+
+msgid "parent"
+msgstr "батько"
+
+msgid "id of a parent commit object"
+msgstr "ідентифікатор обʼєкта батьківÑького коміту"
+
+msgid "message"
+msgstr "допиÑ"
+
+msgid "commit message"
+msgstr "Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту"
+
+msgid "read commit log message from file"
+msgstr "читати Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту з файлу"
+
+msgid "GPG sign commit"
+msgstr "підпиÑати коміт за допомогою GPG"
+
+msgid "must give exactly one tree"
+msgstr "має бути надано лишень одне дерево"
+
+msgid "git commit-tree: failed to read"
+msgstr "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"
+" [-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n"
+" [--date=<date>] [--cleanup=<mode>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<режим>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <коміт> | --fixup [(amend|"
+"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[<ідентифікатор "
+"ключа>]]\n"
+" [--] [<визначник шлÑху>...]"
+
+msgid "git status [<options>] [--] [<pathspec>...]"
+msgstr "git status [<опції>] [--] [<визначник шлÑху>...]"
+
+msgid ""
+"You asked to amend the most recent commit, but doing so would make\n"
+"it empty. You can repeat your command with --allow-empty, or you can\n"
+"remove the commit entirely with \"git reset HEAD^\".\n"
+msgstr ""
+"Ви проÑили внеÑти зміни до оÑтаннього коміту, але це зробить його\n"
+"порожнім. Ви можете повторити команду, ÑкориÑтавшиÑÑŒ --allow-empty, або\n"
+"повніÑÑ‚ÑŽ видалити коміт за допомогою \"git reset HEAD^\".\n"
+
+msgid ""
+"The previous cherry-pick is now empty, possibly due to conflict resolution.\n"
+"If you wish to commit it anyway, use:\n"
+"\n"
+" git commit --allow-empty\n"
+"\n"
+msgstr ""
+"Попереднє виÑÐ¼Ð¸ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð°Ñ€Ð°Ð· порожнє, можливо, через Ð²Ð¸Ñ€Ñ–ÑˆÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ð»Ñ–ÐºÑ‚Ñƒ.\n"
+"Якщо ви вÑе одно бажаєте додати його, ÑкориÑтайтеÑÑŒ командою\n"
+"\n"
+" git commit --allow-empty\n"
+
+msgid "Otherwise, please use 'git rebase --skip'\n"
+msgstr "Ð’ іншому випадку, будь лаÑка, ÑкориÑтайтеÑÑŒ \"git rebase --skip\"\n"
+
+msgid "Otherwise, please use 'git cherry-pick --skip'\n"
+msgstr ""
+"Ð’ іншому випадку, будь лаÑка, ÑкориÑтайтеÑÑŒ \"git cherry-pick --skip\"\n"
+
+msgid ""
+"and then use:\n"
+"\n"
+" git cherry-pick --continue\n"
+"\n"
+"to resume cherry-picking the remaining commits.\n"
+"If you wish to skip this commit, use:\n"
+"\n"
+" git cherry-pick --skip\n"
+"\n"
+msgstr ""
+"а потім ÑкориÑтайтеÑÑŒ:\n"
+"\n"
+" git cherry-pick --continue\n"
+"\n"
+"щоб продовжити виÑÐ¼Ð¸ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ñ€ÐµÑˆÑ‚Ð¸ комітів.\n"
+"Якщо ви хочете пропуÑтити цей коміт, ÑкориÑтайтеÑÑŒ\n"
+"\n"
+" git cherry-pick --skip\n"
+
+msgid "updating files failed"
+msgstr "не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ файли"
+
+msgid "failed to unpack HEAD tree object"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ð°ÐºÑƒÐ²Ð°Ñ‚Ð¸ HEAD обʼєкт дерева"
+
+msgid "No paths with --include/--only does not make sense."
+msgstr "ÐÑ–Ñкі шлÑхи з --include/--only не мають ÑенÑу."
+
+msgid "unable to create temporary index"
+msgstr "не вдалоÑÑ Ñтворити тимчаÑовий індекÑ"
+
+msgid "interactive add failed"
+msgstr "інтерактивне Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð½Ðµ вдалоÑÑ"
+
+msgid "unable to update temporary index"
+msgstr "не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ тимчаÑовий індекÑ"
+
+msgid "Failed to update main cache tree"
+msgstr "Ðе вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ головне дерево кешу"
+
+msgid "cannot do a partial commit during a merge."
+msgstr "неможливо зробити чаÑтковий коміт під Ñ‡Ð°Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ."
+
+msgid "cannot do a partial commit during a cherry-pick."
+msgstr "неможливо зробити чаÑтковий коміт під Ñ‡Ð°Ñ Ð²Ð¸ÑмикуваннÑ."
+
+msgid "cannot do a partial commit during a rebase."
+msgstr "неможливо зробити чаÑтковий коміт під Ñ‡Ð°Ñ Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ."
+
+msgid "cannot read the index"
+msgstr "неможливо прочитати індекÑ"
+
+msgid "unable to write temporary index file"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати тимчаÑовий файл індекÑу"
+
+#, c-format
+msgid "commit '%s' lacks author header"
+msgstr "у коміті \"%s\" немає заголовка автора"
+
+#, c-format
+msgid "commit '%s' has malformed author line"
+msgstr "у коміті \"%s\" невірно Ñформовано Ñ€Ñдок автора"
+
+msgid "malformed --author parameter"
+msgstr "невірно Ñформований --author параметр"
+
+#, c-format
+msgid "invalid date format: %s"
+msgstr "неприпуÑтимий формат дати: %s"
+
+msgid ""
+"unable to select a comment character that is not used\n"
+"in the current commit message"
+msgstr ""
+"не вдалоÑÑ Ð²Ð¸Ð±Ñ€Ð°Ñ‚Ð¸ Ñимвол коментарÑ, Ñкий не викориÑтовуєтьÑÑ\n"
+"у поточному допиÑÑ– до коміту"
+
+#, c-format
+msgid "could not lookup commit '%s'"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ коміт \"%s\""
+
+#, c-format
+msgid "(reading log message from standard input)\n"
+msgstr "(Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ð´Ð¾Ð¿Ð¸Ñу журналу зі Ñтандартного вводу)\n"
+
+msgid "could not read log from standard input"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ Ð´Ð¾Ð¿Ð¸Ñ Ð·Ñ– Ñтандартного вводу"
+
+#, c-format
+msgid "could not read log file '%s'"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ Ð´Ð¾Ð¿Ð¸Ñ Ð· файлу \"%s\""
+
+#, c-format
+msgid "options '%s' and '%s:%s' cannot be used together"
+msgstr "опції \"%s\" та \"%s:%s\" не можна викориÑтовувати разом"
+
+msgid "could not read SQUASH_MSG"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ SQUASH_MSG"
+
+msgid "could not read MERGE_MSG"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ MERGE_MSG"
+
+#, c-format
+msgid "could not open '%s'"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ \"%s\""
+
+msgid "could not write commit template"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати шаблон комітів"
+
+#, c-format
+msgid ""
+"Please enter the commit message for your changes. Lines starting\n"
+"with '%c' will be ignored.\n"
+msgstr ""
+"Будь лаÑка, введіть Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту Ð´Ð»Ñ Ð²Ð°ÑˆÐ¸Ñ… змін. РÑдки, що починаютьÑÑ Ð·\n"
+" \"%c\" будуть проігноровані.\n"
+
+#, c-format
+msgid ""
+"Please enter the commit message for your changes. Lines starting\n"
+"with '%c' will be ignored, and an empty message aborts the commit.\n"
+msgstr ""
+"Будь лаÑка, введіть Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту Ð´Ð»Ñ Ð²Ð°ÑˆÐ¸Ñ… змін. РÑдки, що починаютьÑÑ Ð·\n"
+" \"%c\" будуть проігноровані, а порожній Ð´Ð¾Ð¿Ð¸Ñ Ð¿ÐµÑ€ÐµÑ€Ð²Ðµ коміт.\n"
+
+#, c-format
+msgid ""
+"Please enter the commit message for your changes. Lines starting\n"
+"with '%c' will be kept; you may remove them yourself if you want to.\n"
+msgstr ""
+"Будь лаÑка, введіть Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту Ð´Ð»Ñ Ð²Ð°ÑˆÐ¸Ñ… змін. РÑдки, що починаютьÑÑ Ð·\n"
+" \"%c\" будуть збережені; ви можете вилучити Ñ—Ñ… ÑамоÑтійно, Ñкщо захочете.\n"
+
+#, c-format
+msgid ""
+"Please enter the commit message for your changes. Lines starting\n"
+"with '%c' will be kept; you may remove them yourself if you want to.\n"
+"An empty message aborts the commit.\n"
+msgstr ""
+"Будь лаÑка, введіть Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту Ð´Ð»Ñ Ð²Ð°ÑˆÐ¸Ñ… змін. РÑдки, що починаютьÑÑ Ð·\n"
+" \"%c\" будуть збережені; ви можете вилучити Ñ—Ñ… ÑамоÑтійно, Ñкщо захочете.\n"
+"Порожній Ð´Ð¾Ð¿Ð¸Ñ Ð¿ÐµÑ€ÐµÑ€Ð¸Ð²Ð°Ñ” коміт.\n"
+
+msgid ""
+"\n"
+"It looks like you may be committing a merge.\n"
+"If this is not correct, please run\n"
+"\tgit update-ref -d MERGE_HEAD\n"
+"and try again.\n"
+msgstr ""
+"\n"
+"Схоже, що ви робите злиттÑ.\n"
+"Якщо це не так, виконайте команду\n"
+"\tgit update-ref -d MERGE_HEAD\n"
+"Ñ– Ñпробуйте ще раз.\n"
+
+msgid ""
+"\n"
+"It looks like you may be committing a cherry-pick.\n"
+"If this is not correct, please run\n"
+"\tgit update-ref -d CHERRY_PICK_HEAD\n"
+"and try again.\n"
+msgstr ""
+"\n"
+"Схоже, що ви робите виÑмикуваннÑ.\n"
+"Якщо це не так, виконайте\n"
+"\tgit update-ref -d CHERRY_PICK_HEAD\n"
+"Ñ– Ñпробуйте ще раз.\n"
+
+#, c-format
+msgid "%sAuthor: %.*s <%.*s>"
+msgstr "%sÐвтор: %.*s <%.*s>"
+
+#, c-format
+msgid "%sDate: %s"
+msgstr "%sДата: %s"
+
+#, c-format
+msgid "%sCommitter: %.*s <%.*s>"
+msgstr "%sКомітер: %.*s <%.*s>"
+
+msgid "Cannot read index"
+msgstr "Ðеможливо прочитати індекÑ"
+
+msgid "unable to pass trailers to --trailers"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ´Ð°Ñ‚Ð¸ причепи до --trailers"
+
+msgid "Error building trees"
+msgstr "Помилка при побудові дерев"
+
+#, c-format
+msgid "Please supply the message using either -m or -F option.\n"
+msgstr "Будь лаÑка, надайте допиÑ, викориÑтовуючи опцію -m або -F.\n"
+
+#, c-format
+msgid "--author '%s' is not 'Name <email>' and matches no existing author"
+msgstr ""
+"--author \"%s\" не в форматі \"Ð†Ð¼Ê¼Ñ <адреÑа електронної пошти>\" Ñ– не "
+"відповідає жодному Ñ–Ñнуючому автору"
+
+#, c-format
+msgid "Invalid ignored mode '%s'"
+msgstr "ÐеприпуÑтимий режим Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ \"%s\""
+
+#, c-format
+msgid "Invalid untracked files mode '%s'"
+msgstr "ÐеприпуÑтимий режим невідÑтежуваних файлів \"%s\""
+
+msgid "You are in the middle of a merge -- cannot reword."
+msgstr "Ви перебуваєте в процеÑÑ– Ð·Ð»Ð¸Ñ‚Ñ‚Ñ -- неможливо перефразувати."
+
+msgid "You are in the middle of a cherry-pick -- cannot reword."
+msgstr "Ви перебуваєте в процеÑÑ– виÑÐ¼Ð¸ÐºÑƒÐ²Ð°Ð½Ð½Ñ -- неможливо перефразувати."
+
+#, c-format
+msgid "reword option of '%s' and path '%s' cannot be used together"
+msgstr ""
+"параметр Ð¿ÐµÑ€ÐµÑ„Ñ€Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ \"%s\" Ñ– шлÑÑ… \"%s\" не можуть бути викориÑтані разом"
+
+#, c-format
+msgid "reword option of '%s' and '%s' cannot be used together"
+msgstr "опцію Ð¿ÐµÑ€ÐµÑ„Ñ€Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ \"%s\" Ñ– \"%s\" не можна викориÑтовувати разом"
+
+msgid "You have nothing to amend."
+msgstr "Вам немає до чого вноÑити зміни."
+
+msgid "You are in the middle of a merge -- cannot amend."
+msgstr "Ви перебуваєте в процеÑÑ– Ð·Ð»Ð¸Ñ‚Ñ‚Ñ -- неможливо внеÑти зміни."
+
+msgid "You are in the middle of a cherry-pick -- cannot amend."
+msgstr "Ви перебуваєте в процеÑÑ– виÑÐ¼Ð¸ÐºÑƒÐ²Ð°Ð½Ð½Ñ - неможливо внеÑти зміни."
+
+msgid "You are in the middle of a rebase -- cannot amend."
+msgstr "Ви перебуваєте в процеÑÑ– Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ°Ð²Ð½Ð½Ñ -- неможливо внеÑти зміни."
+
+msgid "--reset-author can be used only with -C, -c or --amend."
+msgstr "--reset-author можна викориÑтовувати лише з -C, -c або --amend."
+
+#, c-format
+msgid "unknown option: --fixup=%s:%s"
+msgstr "невідомий параметр: --fixup=%s:%s"
+
+#, c-format
+msgid "paths '%s ...' with -a does not make sense"
+msgstr "шлÑхи \"%s ...\" з -a не мають ÑенÑу"
+
+msgid "show status concisely"
+msgstr "показувати ÑÑ‚Ð°Ñ‚ÑƒÑ ÑтиÑло"
+
+msgid "show branch information"
+msgstr "показати інформацію про гілку"
+
+msgid "show stash information"
+msgstr "показати інформацію про Ñхов"
+
+msgid "compute full ahead/behind values"
+msgstr "обчиÑлювати повні попереду/позаду значеннÑ"
+
+msgid "version"
+msgstr "верÑÑ–Ñ"
+
+msgid "machine-readable output"
+msgstr "машинозчитуваний вивід"
+
+msgid "show status in long format (default)"
+msgstr "показувати ÑÑ‚Ð°Ñ‚ÑƒÑ Ñƒ повному форматі (за замовчуваннÑм)"
+
+msgid "terminate entries with NUL"
+msgstr "завершувати запиÑи Ñимволом NUL"
+
+msgid "show untracked files, optional modes: all, normal, no. (Default: all)"
+msgstr ""
+"показувати невідÑтежувані файли, варіанти режимів: all, normal, no (за "
+"замовчуваннÑм: all)"
+
+msgid ""
+"show ignored files, optional modes: traditional, matching, no. (Default: "
+"traditional)"
+msgstr ""
+"показувати ігноровані файли, варіанти режимів: traditional, matching, no (за "
+"замовчуваннÑм: traditional)."
+
+msgid "when"
+msgstr "коли"
+
+msgid ""
+"ignore changes to submodules, optional when: all, dirty, untracked. "
+"(Default: all)"
+msgstr ""
+"ігнорувати зміни підмодулів, опціонально, Ñкщо: all, dirty, untracked (за "
+"замовчуваннÑм: all)."
+
+msgid "list untracked files in columns"
+msgstr "показати невідÑтежувані файли в Ñтовпчиках"
+
+msgid "do not detect renames"
+msgstr "не виÑвлÑти перейменуваннÑ"
+
+msgid "detect renames, optionally set similarity index"
+msgstr "виÑвлÑти перейменуваннÑ, опціонально вÑтановлювати Ñ–Ð½Ð´ÐµÐºÑ ÑхожоÑÑ‚Ñ–"
+
+msgid "Unsupported combination of ignored and untracked-files arguments"
+msgstr ""
+"Ðепідтримувана ÐºÐ¾Ð¼Ð±Ñ–Ð½Ð°Ñ†Ñ–Ñ Ð°Ñ€Ð³ÑƒÐ¼ÐµÐ½Ñ‚Ñ–Ð² Ð´Ð»Ñ Ñ–Ð³Ð½Ð¾Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ… та невідÑтежуваних "
+"файлів"
+
+msgid "suppress summary after successful commit"
+msgstr "не показувати підÑумок піÑÐ»Ñ ÑƒÑпішного коміту"
+
+msgid "show diff in commit message template"
+msgstr "показувати різницю в шаблоні допиÑа до коміту"
+
+msgid "Commit message options"
+msgstr "Опції допиÑа до коміту"
+
+msgid "read message from file"
+msgstr "читати текÑÑ‚ допиÑа з файлу"
+
+msgid "author"
+msgstr "автор"
+
+msgid "override author for commit"
+msgstr "перевизначити автора коміту"
+
+msgid "date"
+msgstr "дата"
+
+msgid "override date for commit"
+msgstr "перевизначити дату коміту"
+
+msgid "commit"
+msgstr "коміт"
+
+msgid "reuse and edit message from specified commit"
+msgstr "повторно викориÑтати та редагувати Ð´Ð¾Ð¿Ð¸Ñ Ð·Ñ– вказаного коміту"
+
+msgid "reuse message from specified commit"
+msgstr "повторно викориÑтати Ð´Ð¾Ð¿Ð¸Ñ Ð·Ñ– вказаного коміту"
+
+#. TRANSLATORS: Leave "[(amend|reword):]" as-is,
+#. and only translate <commit>.
+#.
+msgid "[(amend|reword):]commit"
+msgstr "[(amend|reword):]коміт"
+
+msgid ""
+"use autosquash formatted message to fixup or amend/reword specified commit"
+msgstr ""
+"викориÑтовувати Ð´Ð¾Ð¿Ð¸Ñ Ñƒ форматі autosquash Ð´Ð»Ñ Ð²Ð¸Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð°Ð±Ð¾ зміни/"
+"Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ Ð²ÐºÐ°Ð·Ð°Ð½Ð¾Ð³Ð¾ коміту"
+
+msgid "use autosquash formatted message to squash specified commit"
+msgstr ""
+"викориÑтовувати Ð´Ð¾Ð¿Ð¸Ñ Ñƒ форматі autosquash Ð´Ð»Ñ Ð·Ñ‡Ð°Ð²Ð»ÑŽÐ²Ð°Ð½Ð½Ñ Ð²ÐºÐ°Ð·Ð°Ð½Ð¾Ð³Ð¾ коміту"
+
+msgid "the commit is authored by me now (used with -C/-c/--amend)"
+msgstr "автором коміту тепер Ñ” Ñ (викориÑтовуєтьÑÑ Ð· -C/-c/--amend)"
+
+msgid "trailer"
+msgstr "причіп"
+
+msgid "add custom trailer(s)"
+msgstr "додати неÑтандартний причіп"
+
+msgid "add a Signed-off-by trailer"
+msgstr "додати Signed-off-by причіп"
+
+msgid "use specified template file"
+msgstr "викориÑтати зазначений файл шаблону"
+
+msgid "force edit of commit"
+msgstr "редагувати коміт примуÑово"
+
+msgid "include status in commit message template"
+msgstr "включити ÑÑ‚Ð°Ñ‚ÑƒÑ Ñƒ шаблон допиÑа до коміту"
+
+msgid "Commit contents options"
+msgstr "Опції вміÑту коміту"
+
+msgid "commit all changed files"
+msgstr "закомітити вÑÑ– змінені файли"
+
+msgid "add specified files to index for commit"
+msgstr "додати вказані файли до індекÑу Ð´Ð»Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ"
+
+msgid "interactively add files"
+msgstr "додавати файли інтерактивно"
+
+msgid "interactively add changes"
+msgstr "додавати зміни інтерактивно"
+
+msgid "commit only specified files"
+msgstr "комітити лише вказані файли"
+
+msgid "bypass pre-commit and commit-msg hooks"
+msgstr "обходити pre-commit та commit-msg гачки"
+
+msgid "show what would be committed"
+msgstr "показати, що буде закомічено"
+
+msgid "amend previous commit"
+msgstr "внеÑти зміни до попереднього коміту"
+
+msgid "bypass post-rewrite hook"
+msgstr "обійти post-rewrite гачок"
+
+msgid "ok to record an empty change"
+msgstr "дозволити запиÑати порожню зміну"
+
+msgid "ok to record a change with an empty message"
+msgstr "дозволити запиÑати зміну з порожнім допиÑом"
+
+msgid "could not parse HEAD commit"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ HEAD коміт"
+
+#, c-format
+msgid "Corrupt MERGE_HEAD file (%s)"
+msgstr "Пошкоджений MERGE_HEAD (%s)"
+
+msgid "could not read MERGE_MODE"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ MERGE_MODE"
+
+#, c-format
+msgid "could not read commit message: %s"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту: %s"
+
+#, c-format
+msgid "Aborting commit due to empty commit message.\n"
+msgstr "ÐŸÐµÑ€ÐµÑ€Ð¸Ð²Ð°Ð½Ð½Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ через порожній Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту.\n"
+
+#, c-format
+msgid "Aborting commit; you did not edit the message.\n"
+msgstr "ÐŸÐµÑ€ÐµÑ€Ð¸Ð²Ð°Ð½Ð½Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ; ви не відредагували допиÑ.\n"
+
+#, c-format
+msgid "Aborting commit due to empty commit message body.\n"
+msgstr "ÐŸÐµÑ€ÐµÑ€Ð¸Ð²Ð°Ð½Ð½Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ через порожнє тіло допиÑа до коміту.\n"
+
+msgid ""
+"repository has been updated, but unable to write\n"
+"new index file. Check that disk is not full and quota is\n"
+"not exceeded, and then \"git restore --staged :/\" to recover."
+msgstr ""
+"Ñховище було оновлено, але не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати\n"
+"новий файл індекÑу. ПереконайтеÑÑ, що диÑк не переповнений Ñ– квота\n"
+"не перевищена, а потім виконайте \"git restore --staged :/\" Ð´Ð»Ñ Ð²Ñ–Ð´Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ."
+
+msgid "git config [<options>]"
+msgstr "git config [<опції>]"
+
+#, c-format
+msgid "unrecognized --type argument, %s"
+msgstr "нерозпізнаний аргумент --type, %s"
+
+msgid "only one type at a time"
+msgstr "лише один тип за раз"
+
+msgid "Config file location"
+msgstr "Ð Ð¾Ð·Ñ‚Ð°ÑˆÑƒÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñƒ конфігурації"
+
+msgid "use global config file"
+msgstr "викориÑтовувати глобальний файл конфігурації"
+
+msgid "use system config file"
+msgstr "викориÑтовувати файл конфігурації ÑиÑтеми"
+
+msgid "use repository config file"
+msgstr "викориÑтовувати файл конфігурації Ñховища"
+
+msgid "use per-worktree config file"
+msgstr "викориÑтовувати файл конфігурації робочого дерева"
+
+msgid "use given config file"
+msgstr "викориÑтовувати наданий файл конфігурації"
+
+msgid "blob-id"
+msgstr "blob-id"
+
+msgid "read config from given blob object"
+msgstr "прочитати конфігурацію з наданого blob-обʼєкту"
+
+msgid "Action"
+msgstr "ДіÑ"
+
+msgid "get value: name [value-pattern]"
+msgstr "отримати значеннÑ: назва [шаблон-значеннÑ]"
+
+msgid "get all values: key [value-pattern]"
+msgstr "отримати вÑÑ– значеннÑ: ключ [шаблон-значеннÑ]"
+
+msgid "get values for regexp: name-regex [value-pattern]"
+msgstr "отримати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ñ€ÐµÐ³Ð²Ð¸Ñ€Ñƒ: регвир-назви [шаблон-значеннÑ]"
+
+msgid "get value specific for the URL: section[.var] URL"
+msgstr "отримати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ ÐºÐ¾Ð½ÐºÑ€ÐµÑ‚Ð½Ð¾Ñ— URL-адреÑи: розділ[.var] URL-адреÑа"
+
+msgid "replace all matching variables: name value [value-pattern]"
+msgstr "замінити вÑÑ– відповідні змінні: назва Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ [шаблон-значеннÑ]"
+
+msgid "add a new variable: name value"
+msgstr "додати нову змінну: назва значеннÑ"
+
+msgid "remove a variable: name [value-pattern]"
+msgstr "видалити змінну: назва [шаблон-значеннÑ]"
+
+msgid "remove all matches: name [value-pattern]"
+msgstr "видалити вÑÑ– збіги: назва [шаблон-значеннÑ]"
+
+msgid "rename section: old-name new-name"
+msgstr "перейменувати розділ: Ñтара-назва нова-назва"
+
+msgid "remove a section: name"
+msgstr "видалити розділ: назва"
+
+msgid "list all"
+msgstr "показати вÑÑ– змінні"
+
+msgid "use string equality when comparing values to 'value-pattern'"
+msgstr ""
+"викориÑтовувати рівніÑÑ‚ÑŒ Ñтрок при порівнÑнні значень з \"шаблон-значеннÑм\""
+
+msgid "open an editor"
+msgstr "відкрити редактор"
+
+msgid "find the color configured: slot [default]"
+msgstr "знайти налаштований колір: Ñлот [за замовчуваннÑм]"
+
+msgid "find the color setting: slot [stdout-is-tty]"
+msgstr "знайти Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐ¾Ð»ÑŒÐ¾Ñ€Ñƒ: slot [stdout-is-tty]"
+
+msgid "Type"
+msgstr "Тип"
+
+msgid "type"
+msgstr "тип"
+
+msgid "value is given this type"
+msgstr "тип значеннÑ"
+
+msgid "value is \"true\" or \"false\""
+msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"true\" або \"false\""
+
+msgid "value is decimal number"
+msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´ÐµÑÑткове чиÑло"
+
+msgid "value is --bool or --int"
+msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ --bool або --int"
+
+msgid "value is --bool or string"
+msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ --bool або string"
+
+msgid "value is a path (file or directory name)"
+msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÑˆÐ»ÑÑ… (файл або назва директорії)"
+
+msgid "value is an expiry date"
+msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ - дата Ð·Ð°ÐºÑ–Ð½Ñ‡ÐµÐ½Ð½Ñ Ñ‚ÐµÑ€Ð¼Ñ–Ð½Ñƒ дії"
+
+msgid "Other"
+msgstr "Інше"
+
+msgid "terminate values with NUL byte"
+msgstr "завершити Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð±Ð°Ð¹Ñ‚Ð¾Ð¼ NUL"
+
+msgid "show variable names only"
+msgstr "показувати тільки назви змінних"
+
+msgid "respect include directives on lookup"
+msgstr "дотримуватиÑÑŒ директив Ð²ÐºÐ»ÑŽÑ‡ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¸ пошуку"
+
+msgid "show origin of config (file, standard input, blob, command line)"
+msgstr ""
+"показати Ð¿Ð¾Ñ…Ð¾Ð´Ð¶ÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ— (файл, Ñтандартний ввід, blob, командний "
+"Ñ€Ñдок)"
+
+msgid "show scope of config (worktree, local, global, system, command)"
+msgstr ""
+"показати межі дії конфігурації (робоче дерево, локально, глобально, ÑиÑтема, "
+"команда)"
+
+msgid "value"
+msgstr "значеннÑ"
+
+msgid "with --get, use default value when missing entry"
+msgstr ""
+"з --get викориÑтовувати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð° замовчуваннÑм, Ñкщо Ð·Ð°Ð¿Ð¸Ñ Ð²Ñ–Ð´Ñутній"
+
+#, c-format
+msgid "wrong number of arguments, should be %d"
+msgstr "невірна кількіÑÑ‚ÑŒ аргументів, має бути %d"
+
+#, c-format
+msgid "wrong number of arguments, should be from %d to %d"
+msgstr "невірна кількіÑÑ‚ÑŒ аргументів, має бути від %d до %d"
+
+#, c-format
+msgid "invalid key pattern: %s"
+msgstr "неприпуÑтимий шаблон ключа: %s"
+
+#, c-format
+msgid "invalid pattern: %s"
+msgstr "неприпуÑтимий шаблон: %s"
+
+#, c-format
+msgid "failed to format default config value: %s"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚ÑƒÐ²Ð°Ñ‚Ð¸ початкове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ—: %s"
+
+#, c-format
+msgid "cannot parse color '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ колір \"%s\""
+
+msgid "unable to parse default color value"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ початкове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ¾Ð»ÑŒÐ¾Ñ€Ñƒ"
+
+msgid "not in a git directory"
+msgstr "не в git директорії"
+
+msgid "writing to stdin is not supported"
+msgstr "Ð·Ð°Ð¿Ð¸Ñ Ð´Ð¾ stdin не підтримуєтьÑÑ"
+
+msgid "writing config blobs is not supported"
+msgstr "Ð·Ð°Ð¿Ð¸Ñ blob конфігурації не підтримуєтьÑÑ"
+
+#, c-format
+msgid ""
+"# This is Git's per-user configuration file.\n"
+"[user]\n"
+"# Please adapt and uncomment the following lines:\n"
+"#\tname = %s\n"
+"#\temail = %s\n"
+msgstr ""
+"# Це файл конфігурації Git Ð´Ð»Ñ ÐºÐ¾Ð¶Ð½Ð¾Ð³Ð¾ кориÑтувача.\n"
+"[user]\n"
+"# Будь лаÑка, адаптуйте та розкоментуйте наÑтупні Ñ€Ñдки:\n"
+"# name = %s\n"
+"# email = %s\n"
+
+msgid "only one config file at a time"
+msgstr "лише один конфігураційний файл за раз"
+
+msgid "--local can only be used inside a git repository"
+msgstr "--local можна викориÑтовувати лише вÑередині git Ñховища"
+
+msgid "--blob can only be used inside a git repository"
+msgstr "--blob можна викориÑтовувати лише вÑередині git Ñховища"
+
+msgid "--worktree can only be used inside a git repository"
+msgstr "--worktree можна викориÑтовувати лише вÑередині git Ñховища"
+
+msgid "$HOME not set"
+msgstr "$HOME не вÑтановлено"
+
+msgid ""
+"--worktree cannot be used with multiple working trees unless the config\n"
+"extension worktreeConfig is enabled. Please read \"CONFIGURATION FILE\"\n"
+"section in \"git help worktree\" for details"
+msgstr ""
+"--worktree неможливо викориÑтовувати з кількома робочими деревами, Ñкщо не "
+"увімкнено розширеннÑ\n"
+"конфігурації worktreeConfig. Будь лаÑка, прочитайте розділ \"КОÐФІГУРÐЦІЙÐИЙ "
+"ФÐЙЛ\"\n"
+"у \"git help worktree\" Ð´Ð»Ñ Ð±Ñ–Ð»ÑŒÑˆ детальної інформації"
+
+msgid "--get-color and variable type are incoherent"
+msgstr "--get-color Ñ– тип змінної не узгоджуютьÑÑ"
+
+msgid "only one action at a time"
+msgstr "лише одна Ð´Ñ–Ñ Ð·Ð° раз"
+
+msgid "--name-only is only applicable to --list or --get-regexp"
+msgstr "--name-only заÑтоÑовуєтьÑÑ Ð»Ð¸ÑˆÐµ до --list або --get-regexp"
+
+msgid ""
+"--show-origin is only applicable to --get, --get-all, --get-regexp, and --"
+"list"
+msgstr ""
+"--show-origin заÑтоÑовуєтьÑÑ Ð»Ð¸ÑˆÐµ до --get, --get-all, --get-regexp та --list"
+
+msgid "--default is only applicable to --get"
+msgstr "--default заÑтоÑовуєтьÑÑ Ð»Ð¸ÑˆÐµ до --get"
+
+msgid "--fixed-value only applies with 'value-pattern'"
+msgstr "--fixed-value заÑтоÑовуєтьÑÑ Ð»Ð¸ÑˆÐµ з \"шаблоном-значеннÑ\""
+
+#, c-format
+msgid "unable to read config file '%s'"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ файл конфігурації \"%s\""
+
+msgid "error processing config file(s)"
+msgstr "помилка при обробці файлу(ів) конфігурації"
+
+msgid "editing stdin is not supported"
+msgstr "Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ stdin не підтримуєтьÑÑ"
+
+msgid "editing blobs is not supported"
+msgstr "Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ blobs не підтримуєтьÑÑ"
+
+#, c-format
+msgid "cannot create configuration file %s"
+msgstr "неможливо Ñтворити конфігураційний файл %s"
+
+#, c-format
+msgid ""
+"cannot overwrite multiple values with a single value\n"
+" Use a regexp, --add or --replace-all to change %s."
+msgstr ""
+"неможливо перезапиÑати кілька значень одним значеннÑм\n"
+" ВикориÑтовуйте regexp, --add або --replace-all Ð´Ð»Ñ Ð·Ð¼Ñ–Ð½Ð¸ %s."
+
+#, c-format
+msgid "no such section: %s"
+msgstr "немає такого розділу: %s"
+
+msgid "print sizes in human readable format"
+msgstr "показувати розмір у зручному Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚Ñ–"
+
+#, c-format
+msgid ""
+"The permissions on your socket directory are too loose; other\n"
+"users may be able to read your cached credentials. Consider running:\n"
+"\n"
+"\tchmod 0700 %s"
+msgstr ""
+"Дозволи на вашу Ñокет директорію занадто вільні; інші\n"
+"кориÑтувачі можуть прочитати ваші кешовані облікові дані. Подумайте про "
+"запуÑк:\n"
+"\n"
+"\tchmod 0700 %s"
+
+msgid "print debugging messages to stderr"
+msgstr "виводити відлагоджувальні Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð² stderr"
+
+msgid "credential-cache--daemon unavailable; no unix socket support"
+msgstr "credential-cache--daemon недоÑтупний; немає підтримки unix-Ñокетів"
+
+msgid "credential-cache unavailable; no unix socket support"
+msgstr "credential-cache недоÑтупний; немає підтримки unix-Ñокетів"
+
+#, c-format
+msgid "unable to get credential storage lock in %d ms"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ файл Ð±Ð»Ð¾ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ñховища облікових даних за %d мÑ"
+
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<н>] "
+"[<комітоподібне>...]"
+
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<н>] --"
+"dirty[=<позначка>]"
+
+msgid "git describe <blob>"
+msgstr "git describe <blob>"
+
+msgid "head"
+msgstr "head"
+
+msgid "lightweight"
+msgstr "lightweight"
+
+msgid "annotated"
+msgstr "annotated"
+
+#, c-format
+msgid "annotated tag %s not available"
+msgstr "анотований тег %s недоÑтупний"
+
+#, c-format
+msgid "tag '%s' is externally known as '%s'"
+msgstr "тег \"%s\" відомий зовні Ñк \"%s\""
+
+#, c-format
+msgid "no tag exactly matches '%s'"
+msgstr "жоден тег не збігаєтьÑÑ Ñ‚Ð¾Ñ‡Ð½Ð¾ з \"%s\""
+
+#, c-format
+msgid "No exact match on refs or tags, searching to describe\n"
+msgstr "Ðемає точного збігу за поÑиланнÑми або тегами, пошук Ð´Ð»Ñ Ð¾Ð¿Ð¸Ñу\n"
+
+#, c-format
+msgid "finished search at %s\n"
+msgstr "пошук завершено на %s\n"
+
+#, c-format
+msgid ""
+"No annotated tags can describe '%s'.\n"
+"However, there were unannotated tags: try --tags."
+msgstr ""
+"Жоден анотований тег не може опиÑати \"%s\".\n"
+"Однак Ñ–Ñнують неанотовані теги: Ñпробуйте --tags."
+
+#, c-format
+msgid ""
+"No tags can describe '%s'.\n"
+"Try --always, or create some tags."
+msgstr ""
+"Жоден тег не може опиÑати \"%s\".\n"
+"Спробуйте --always або Ñтворіть кілька тегів."
+
+#, c-format
+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"
+
+#, c-format
+msgid "describe %s\n"
+msgstr "опиÑати %s\n"
+
+#, c-format
+msgid "Not a valid object name %s"
+msgstr "ÐеприпуÑтиме Ñ–Ð¼â€™Ñ Ð¾Ð±â€™Ñ”ÐºÑ‚Ð° %s"
+
+#, c-format
+msgid "%s is neither a commit nor blob"
+msgstr "%s не є commit чи blob"
+
+msgid "find the tag that comes after the commit"
+msgstr "знайти тег, що йде піÑÐ»Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ"
+
+msgid "debug search strategy on stderr"
+msgstr "виводити відлагоджувальні Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ñтратегії пошуку в stderr"
+
+msgid "use any ref"
+msgstr "викориÑтати будь-Ñке поÑиланнÑ"
+
+msgid "use any tag, even unannotated"
+msgstr "викориÑтати будь-Ñкий тег, навіть неанотований"
+
+msgid "always use long format"
+msgstr "завжди викориÑтовувати довгий формат"
+
+msgid "only follow first parent"
+msgstr "Ñлідувати тільки за першим з батьків"
+
+msgid "only output exact matches"
+msgstr "виводити лише точні збіги"
+
+msgid "consider <n> most recent tags (default: 10)"
+msgstr "враховувати <н> оÑтанніх тегів (за замовчуваннÑм: 10)"
+
+msgid "only consider tags matching <pattern>"
+msgstr "враховувати лише теги, що відповідають <шаблону>"
+
+msgid "do not consider tags matching <pattern>"
+msgstr "не враховувати теги, що відповідають <шаблону>"
+
+msgid "show abbreviated commit object as fallback"
+msgstr "показувати Ñкорочений обʼєкт коміту Ñк запаÑний варіант"
+
+msgid "mark"
+msgstr "позначка"
+
+msgid "append <mark> on dirty working tree (default: \"-dirty\")"
+msgstr ""
+"додати <позначку> до брудного робочого дерева (за замовчуваннÑм: \\â€-"
+"dirty\\â€)"
+
+msgid "append <mark> on broken working tree (default: \"-broken\")"
+msgstr ""
+"додати <позначку> до пошкодженого робочого дерева (за замовчуваннÑм: \"-"
+"broken\")"
+
+msgid "No names found, cannot describe anything."
+msgstr "Ðазв не знайдено, неможливо нічого опиÑати."
+
+#, c-format
+msgid "option '%s' and commit-ishes cannot be used together"
+msgstr "опцію \"%s\" не можна викориÑтовувати разом з комітоподібними"
+
+msgid ""
+"git diagnose [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--mode=<mode>]"
+msgstr ""
+"git diagnose [(-o | --output-directory) <шлÑÑ…>] [(-s | --suffix) <формат>]\n"
+" [--mode=<режим>]"
+
+msgid "specify a destination for the diagnostics archive"
+msgstr "вказати міÑце Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð°Ñ€Ñ…Ñ–Ð²Ñƒ діагноÑтики"
+
+msgid "specify a strftime format suffix for the filename"
+msgstr "вказати ÑÑƒÑ„Ñ–ÐºÑ Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚Ñƒ strftime Ð´Ð»Ñ Ð½Ð°Ð·Ð²Ð¸ файлу"
+
+msgid "specify the content of the diagnostic archive"
+msgstr "вказати вміÑÑ‚ архіву діагноÑтики"
+
+msgid "--merge-base only works with two commits"
+msgstr "--merge-base працює лише з двома комітами"
+
+#, c-format
+msgid "'%s': not a regular file or symlink"
+msgstr "\"%s\": не звичайний файл або Ñимвольне поÑиланнÑ"
+
+msgid "no merge given, only parents."
+msgstr "Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ðµ надано, лише батьки."
+
+#, c-format
+msgid "invalid option: %s"
+msgstr "неприпуÑтима Ð¾Ð¿Ñ†Ñ–Ñ %s"
+
+#, c-format
+msgid "%s...%s: no merge base"
+msgstr "%s...%s: немає бази злиттÑ"
+
+msgid "Not a git repository"
+msgstr "Ðе Ñ” git Ñховищем"
+
+#, c-format
+msgid "invalid object '%s' given."
+msgstr "надано неприпуÑтимий об’єкт \"%s\"."
+
+#, c-format
+msgid "more than two blobs given: '%s'"
+msgstr "надано більше двох blob: \"%s\""
+
+#, c-format
+msgid "unhandled object '%s' given."
+msgstr "надано необроблений об’єкт \"%s\"."
+
+#, c-format
+msgid "%s...%s: multiple merge bases, using %s"
+msgstr "%s...%s: кілька баз злиттÑ, викориÑÑ‚Ð°Ð½Ð½Ñ %s"
+
+msgid "git difftool [<options>] [<commit> [<commit>]] [--] [<path>...]"
+msgstr "git difftool [<опції>] [<коміт> [<коміт>]] [--] [<шлÑÑ…>...]"
+
+#, c-format
+msgid "could not read symlink %s"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ Ñимвольне поÑÐ¸Ð»Ð°Ð½Ð½Ñ %s"
+
+#, c-format
+msgid "could not read symlink file %s"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ файл Ñимвольного поÑÐ¸Ð»Ð°Ð½Ð½Ñ %s"
+
+#, c-format
+msgid "could not read object %s for symlink %s"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ об’єкт %s Ð´Ð»Ñ Ñимвольного поÑÐ¸Ð»Ð°Ð½Ð½Ñ %s"
+
+msgid ""
+"combined diff formats ('-c' and '--cc') are not supported in\n"
+"directory diff mode ('-d' and '--dir-diff')."
+msgstr ""
+"комбіновані формати diff (\"-c\" Ñ– \"--cc\") не підтримуютьÑÑ Ñƒ\n"
+"режимі порівнÑÐ½Ð½Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ð¹ (\"-d\" Ñ– \"--dir-diff\")."
+
+#, c-format
+msgid "both files modified: '%s' and '%s'."
+msgstr "обидва файли змінено: \"%s\" і \"%s\"."
+
+msgid "working tree file has been left."
+msgstr "файл робочого дерева було залишено."
+
+#, c-format
+msgid "could not copy '%s' to '%s'"
+msgstr "не вдалоÑÑ Ñкопіювати \"%s\" в \"%s\""
+
+#, c-format
+msgid "temporary files exist in '%s'."
+msgstr "тимчаÑові файли Ñ–Ñнують в \"%s\"."
+
+msgid "you may want to cleanup or recover these."
+msgstr "можливо, ви захочете очиÑтити або відновити Ñ—Ñ…."
+
+#, c-format
+msgid "failed: %d"
+msgstr "завершилоÑÑŒ невдало: %d"
+
+msgid "use `diff.guitool` instead of `diff.tool`"
+msgstr "викориÑтовувати \"diff.guitool\" заміÑÑ‚ÑŒ \"diff.tool\""
+
+msgid "perform a full-directory diff"
+msgstr "виконати порівнÑÐ½Ð½Ñ Ð²ÑÑ–Ñ… директорій"
+
+msgid "do not prompt before launching a diff tool"
+msgstr "не запитувати перед запуÑком diff"
+
+msgid "use symlinks in dir-diff mode"
+msgstr "викориÑтовувати Ñимвольні поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ñƒ режимі dir-diff"
+
+msgid "tool"
+msgstr "заÑіб"
+
+msgid "use the specified diff tool"
+msgstr "викориÑтовувати вказаний diff заÑіб"
+
+msgid "print a list of diff tools that may be used with `--tool`"
+msgstr "показати ÑпиÑок diff заÑобів, Ñкі можна викориÑтовувати з \"--tool\""
+
+msgid ""
+"make 'git-difftool' exit when an invoked diff tool returns a non-zero exit "
+"code"
+msgstr ""
+"змуÑити \"git-difftool\" завершувати роботу, коли викликаний diff заÑіб "
+"повертає ненульовий код завершеннÑ"
+
+msgid "specify a custom command for viewing diffs"
+msgstr "вказати неÑтандартну команду Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ³Ð»Ñду різниць"
+
+msgid "passed to `diff`"
+msgstr "передаєтьÑÑ Ð´Ð¾ \"diff\""
+
+msgid "difftool requires worktree or --no-index"
+msgstr "difftool потребує worktree або --no-index"
+
+msgid "no <tool> given for --tool=<tool>"
+msgstr "не надано <заÑіб> Ð´Ð»Ñ --tool=<заÑіб>"
+
+msgid "no <cmd> given for --extcmd=<cmd>"
+msgstr "не надана <команда> Ð´Ð»Ñ --extcmd=<команда>"
+
+msgid "git fast-export [<rev-list-opts>]"
+msgstr "git fast-export [<rev-list-опції>]"
+
+msgid "Error: Cannot export nested tags unless --mark-tags is specified."
+msgstr ""
+"Помилка: неможливо екÑпортувати вкладені теги, Ñкщо не вказано --mark-tags."
+
+msgid "--anonymize-map token cannot be empty"
+msgstr "--anonymize-map токен не може бути порожнім"
+
+msgid "show progress after <n> objects"
+msgstr "показати Ð¿Ñ€Ð¾Ð³Ñ€ÐµÑ Ð¿Ñ–ÑÐ»Ñ <н> обʼєктів"
+
+msgid "select handling of signed tags"
+msgstr "вибрати обробку підпиÑаних тегів"
+
+msgid "select handling of tags that tag filtered objects"
+msgstr "вибрати обробку тегів, Ñкими позначено відфільтровані обʼєкти"
+
+msgid "select handling of commit messages in an alternate encoding"
+msgstr "вибрати обробку допиÑів до комітів в іншому кодуванні"
+
+msgid "dump marks to this file"
+msgstr "екÑпортувати позначки в цей файл"
+
+msgid "import marks from this file"
+msgstr "імпортувати позначки з цього файлу"
+
+msgid "import marks from this file if it exists"
+msgstr "імпортувати позначки з цього файлу, Ñкщо він Ñ–Ñнує"
+
+msgid "fake a tagger when tags lack one"
+msgstr "підроблÑти теггера, коли його не вказано Ð´Ð»Ñ Ñ‚ÐµÐ³Ð°"
+
+msgid "output full tree for each commit"
+msgstr "виводити повне дерево Ð´Ð»Ñ ÐºÐ¾Ð¶Ð½Ð¾Ð³Ð¾ коміту"
+
+msgid "use the done feature to terminate the stream"
+msgstr "викориÑтовувати оÑобливіÑÑ‚ÑŒ done Ð´Ð»Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð½Ñ Ð¿Ð¾Ñ‚Ð¾ÐºÑƒ"
+
+msgid "skip output of blob data"
+msgstr "пропуÑкати Ð²Ð¸Ð²ÐµÐ´ÐµÐ½Ð½Ñ blob-даних"
+
+msgid "refspec"
+msgstr "визначник поÑиланнÑ"
+
+msgid "apply refspec to exported refs"
+msgstr "заÑтоÑувати визначник поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð´Ð¾ екÑпортованих поÑилань"
+
+msgid "anonymize output"
+msgstr "анонімізувати вивід"
+
+msgid "from:to"
+msgstr "від:до"
+
+msgid "convert <from> to <to> in anonymized output"
+msgstr "конвертувати <від> в <до> в анонімізованому виводі"
+
+msgid "reference parents which are not in fast-export stream by object id"
+msgstr ""
+"батьки поÑиланнÑ, Ñких не знайдено в fast-export потоці за ідентифікатором "
+"обʼєкта"
+
+msgid "show original object ids of blobs/commits"
+msgstr "показувати оригінальні ідентифікатори обʼєктів blob/комітів"
+
+msgid "label tags with mark ids"
+msgstr "позначати теги ідентифікаторами позначок"
+
+#, c-format
+msgid "Missing from marks for submodule '%s'"
+msgstr "ВідÑутні \"від\" позначки Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\""
+
+#, c-format
+msgid "Missing to marks for submodule '%s'"
+msgstr "ВідÑутні \"до\" позначки Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\""
+
+#, c-format
+msgid "Expected 'mark' command, got %s"
+msgstr "ОчікувалаÑÑŒ команда \"mark\", отримано %s"
+
+#, c-format
+msgid "Expected 'to' command, got %s"
+msgstr "ОчікувалаÑÑŒ команда \"to\", отримано %s"
+
+msgid "Expected format name:filename for submodule rewrite option"
+msgstr "Очікуваний формат назва:назва файлу Ð´Ð»Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° перезапиÑу підмодулÑ"
+
+#, c-format
+msgid "feature '%s' forbidden in input without --allow-unsafe-features"
+msgstr ""
+"оÑобливіÑÑ‚ÑŒ \"%s\" не можна викориÑтовувати без --allow-unsafe-features"
+
+#, c-format
+msgid "Lockfile created but not reported: %s"
+msgstr "Файл Ð±Ð»Ð¾ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ñтворено, але не звітовано: %s"
+
+msgid "git fetch [<options>] [<repository> [<refspec>...]]"
+msgstr "git fetch [<опції>] [<Ñховище> [<визначник поÑиланнÑ>...]]"
+
+msgid "git fetch [<options>] <group>"
+msgstr "git fetch [<опції>] [<група>]"
+
+msgid "git fetch --multiple [<options>] [(<repository> | <group>)...]"
+msgstr "git fetch --multiple [<опції>] [(<Ñховище> | <група>)...]"
+
+msgid "git fetch --all [<options>]"
+msgstr "git fetch --all [<опції>]"
+
+msgid "fetch.parallel cannot be negative"
+msgstr "fetch.parallel не може бути відʼємним"
+
+msgid "couldn't find remote ref HEAD"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð´Ð»Ñ Ð²Ñ–Ð´Ð´Ð°Ð»ÐµÐ½Ð¾Ð³Ð¾ HEAD"
+
+#, c-format
+msgid "From %.*s\n"
+msgstr "Від %.*s\n"
+
+#, c-format
+msgid "object %s not found"
+msgstr "об’єкт %s не знайдено"
+
+msgid "[up to date]"
+msgstr "[в актуальному Ñтані]"
+
+msgid "[rejected]"
+msgstr "[відхилено]"
+
+msgid "can't fetch into checked-out branch"
+msgstr "неможливо виконати Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð² активну гілку"
+
+msgid "[tag update]"
+msgstr "[Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ñ‚ÐµÐ³Ñƒ]"
+
+msgid "unable to update local ref"
+msgstr "не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ локальне поÑиланнÑ"
+
+msgid "would clobber existing tag"
+msgstr "зруйнує Ñ–Ñнуючий тег"
+
+msgid "[new tag]"
+msgstr "[новий тег]"
+
+msgid "[new branch]"
+msgstr "[нова гілка]"
+
+msgid "[new ref]"
+msgstr "[нове поÑиланнÑ]"
+
+msgid "forced update"
+msgstr "примуÑове оновленнÑ"
+
+msgid "non-fast-forward"
+msgstr "без Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¿ÐµÑ€ÐµÐ´"
+
+#, c-format
+msgid "cannot open '%s'"
+msgstr "неможливо відкрити \"%s\""
+
+msgid ""
+"fetch normally indicates which branches had a forced update,\n"
+"but that check has been disabled; to re-enable, use '--show-forced-updates'\n"
+"flag or run 'git config fetch.showForcedUpdates true'"
+msgstr ""
+"fetch зазвичай показує, Ñкі гілки було примуÑово оновлено,\n"
+"але цю перевірку було вимкнено; щоб увімкнути Ñ—Ñ— знову, ÑкориÑтайтеÑÑŒ \"--"
+"show-forced-updates\"\n"
+"або виконайте \"git config fetch.showForcedUpdates true\""
+
+#, c-format
+msgid ""
+"it took %.2f seconds to check forced updates; you can use\n"
+"'--no-show-forced-updates' or run 'git config fetch.showForcedUpdates "
+"false'\n"
+"to avoid this check\n"
+msgstr ""
+"перевірка примуÑових оновлень зайнÑла %.2f Ñекунд; ви можете ÑкориÑтатиÑÑ\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"
+
+#, c-format
+msgid "rejected %s because shallow roots are not allowed to be updated"
+msgstr "відхилено %s, оÑкільки неглибокі корені не можна оновлювати"
+
+#, c-format
+msgid ""
+"some local refs could not be updated; try running\n"
+" 'git remote prune %s' to remove any old, conflicting branches"
+msgstr ""
+"не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ деÑкі локальні поÑиланнÑ; Ñпробуйте виконати\n"
+" \"git remote prune %s\", щоб видалити вÑÑ– Ñтарі конфліктні гілки"
+
+#, c-format
+msgid " (%s will become dangling)"
+msgstr " (%s Ñтануть виÑÑчими)"
+
+#, c-format
+msgid " (%s has become dangling)"
+msgstr " (%s Ñтав виÑÑчим)"
+
+msgid "[deleted]"
+msgstr "[видалено]"
+
+msgid "(none)"
+msgstr "(нічого)"
+
+#, c-format
+msgid "refusing to fetch into branch '%s' checked out at '%s'"
+msgstr "відмовлено в отримані в гілку \"%s\", що знаходитьÑÑ Ð² \"%s\""
+
+#, c-format
+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"
+
+#, c-format
+msgid "%s is not a valid object"
+msgstr "%s не Ñ” припуÑтимим об’єктом"
+
+#, c-format
+msgid "the object %s does not exist"
+msgstr "об’єкт %s не Ñ–Ñнує"
+
+msgid "multiple branches detected, incompatible with --set-upstream"
+msgstr "виÑвлено кілька гілок, неÑуміÑних з --set-upstream"
+
+#, c-format
+msgid ""
+"could not set upstream of HEAD to '%s' from '%s' when it does not point to "
+"any branch."
+msgstr ""
+"не вдалоÑÑ Ð²Ñтановити першоджерельне Ñховище Ð´Ð»Ñ HEAD в \"%s\" з \"%s\", "
+"коли воно не вказує на жодну гілку."
+
+msgid "not setting upstream for a remote remote-tracking branch"
+msgstr ""
+"не вÑтановлено першоджерельне Ñховище Ð´Ð»Ñ Ð²Ñ–Ð´Ð´Ð°Ð»ÐµÐ½Ð¾ відÑтежуваної гілки"
+
+msgid "not setting upstream for a remote tag"
+msgstr "не вÑтановлено першоджерельне Ñховище Ð´Ð»Ñ Ð²Ñ–Ð´Ð´Ð°Ð»ÐµÐ½Ð¾Ð³Ð¾ тега"
+
+msgid "unknown branch type"
+msgstr "невідомий тип гілки"
+
+msgid ""
+"no source branch found;\n"
+"you need to specify exactly one branch with the --set-upstream option"
+msgstr ""
+"джерельна гілка не знайдена;\n"
+"потрібно вказати лишень одну гілку з опцією --set-upstream"
+
+#, c-format
+msgid "Fetching %s\n"
+msgstr "ÐžÑ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ %s\n"
+
+#, c-format
+msgid "could not fetch %s"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ %s"
+
+#, c-format
+msgid "could not fetch '%s' (exit code: %d)\n"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ \"%s\" (код завершеннÑ: %d)\n"
+
+msgid ""
+"no remote repository specified; please specify either a URL or a\n"
+"remote name from which new revisions should be fetched"
+msgstr ""
+"віддалене Ñховище не вказано; будь лаÑка, вкажіть або URL або\n"
+"назву віддаленого Ñховища, з Ñкого Ñлід отримувати нові ревізії"
+
+msgid "you need to specify a tag name"
+msgstr "потрібно вказати назву тегу"
+
+msgid "fetch from all remotes"
+msgstr "отримати з уÑÑ–Ñ… віддалених призначень"
+
+msgid "set upstream for git pull/fetch"
+msgstr "вÑтановити першоджерельне Ñховище Ð´Ð»Ñ git pull/fetch"
+
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "додати до .git/FETCH_HEAD заміÑÑ‚ÑŒ перезапиÑу"
+
+msgid "use atomic transaction to update references"
+msgstr "викориÑтати атомарну транзакцію Ð´Ð»Ñ Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð¿Ð¾Ñилань"
+
+msgid "path to upload pack on remote end"
+msgstr "шлÑÑ… Ð´Ð»Ñ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ Ð¿Ð°ÐºÑƒÐ½ÐºÐ° на віддаленій Ñтороні"
+
+msgid "force overwrite of local reference"
+msgstr "примуÑовий Ð¿ÐµÑ€ÐµÐ·Ð°Ð¿Ð¸Ñ Ð»Ð¾ÐºÐ°Ð»ÑŒÐ½Ð¾Ð³Ð¾ поÑиланнÑ"
+
+msgid "fetch from multiple remotes"
+msgstr "отримати з кількох віддалених призначень"
+
+msgid "fetch all tags and associated objects"
+msgstr "отримати вÑÑ– теги Ñ– повʼÑзані з ними обʼєкти"
+
+msgid "do not fetch all tags (--no-tags)"
+msgstr "не отримувати вÑÑ– теги (--no-tags)"
+
+msgid "number of submodules fetched in parallel"
+msgstr "кількіÑÑ‚ÑŒ підмодулів, що завантажуютьÑÑ Ð¿Ð°Ñ€Ð°Ð»ÐµÐ»ÑŒÐ½Ð¾"
+
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+"змінити визначник поÑиланнÑ, щоб поміÑтити вÑÑ– поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð² refs/prefetch/"
+
+msgid "prune remote-tracking branches no longer on remote"
+msgstr ""
+"видалити віддалено відÑтежувані гілки, що більше не Ñ–Ñнують у віддаленому "
+"призначенні"
+
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr ""
+"видалити локальні теги, що більше не Ñ–Ñнують у віддаленому призначенні, Ñ– "
+"зруйнувати змінені теги"
+
+msgid "on-demand"
+msgstr "на вимогу"
+
+msgid "control recursive fetching of submodules"
+msgstr "контролювати рекурÑивне Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ–Ð²"
+
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "запиÑувати отримані поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ñƒ файл FETCH_HEAD"
+
+msgid "keep downloaded pack"
+msgstr "зберегти завантажений пакунок"
+
+msgid "allow updating of HEAD ref"
+msgstr "дозволити Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ HEAD поÑиланнÑ"
+
+msgid "deepen history of shallow clone"
+msgstr "поглибити Ñ–Ñторію неглибокого клону"
+
+msgid "deepen history of shallow repository based on time"
+msgstr "поглибити Ñ–Ñторію неглибокого клону залежно від чаÑу"
+
+msgid "convert to a complete repository"
+msgstr "перетворити на повне Ñховище"
+
+msgid "re-fetch without negotiating common commits"
+msgstr "повторне Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð±ÐµÐ· ÑƒÐ·Ð³Ð¾Ð´Ð¶ÐµÐ½Ð½Ñ Ñпільних комітів"
+
+msgid "prepend this to submodule path output"
+msgstr "додавати це напочатку шлÑху до Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ Ð¿Ñ€Ð¸ виведенні"
+
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+"поведінка за замовчуваннÑм Ð´Ð»Ñ Ñ€ÐµÐºÑƒÑ€Ñивного Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ–Ð² (нижчий "
+"пріоритет, ніж у конфігураційних файлів)"
+
+msgid "accept refs that update .git/shallow"
+msgstr "приймати поÑиланнÑ, Ñкі оновлюють .git/shallow"
+
+msgid "refmap"
+msgstr "refmap"
+
+msgid "specify fetch refmap"
+msgstr "вказати мапу поÑилань Ð´Ð»Ñ fetch"
+
+msgid "report that we have only objects reachable from this object"
+msgstr "звітувати, що у Ð½Ð°Ñ Ñ” тільки обʼєкти, доÑтупні з цього обʼєкта"
+
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr ""
+"не отримувати файл пакунка; заміÑÑ‚ÑŒ цього роздрукувати предків верхівок Ð´Ð»Ñ "
+"узгодженнÑ"
+
+msgid "run 'maintenance --auto' after fetching"
+msgstr "виконати \"maintenance --auto\" піÑÐ»Ñ Ð¾Ñ‚Ñ€Ð¸Ð¼ÑƒÐ²Ð°Ð°Ð½Ð½Ñ"
+
+msgid "check for forced-updates on all updated branches"
+msgstr "перевірити на примуÑове Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ð²ÑÑ–Ñ… оновлених гілок"
+
+msgid "write the commit-graph after fetching"
+msgstr "запиÑати коміт-граф піÑÐ»Ñ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ"
+
+msgid "accept refspecs from stdin"
+msgstr "приймати визначники поÑилань з stdin"
+
+msgid "--negotiate-only needs one or more --negotiation-tip=*"
+msgstr "--negotiate-only потребує одного або кількох --negotiation-tip=*"
+
+msgid "negative depth in --deepen is not supported"
+msgstr "відʼємна глибина в --deepen не підтримуєтьÑÑ"
+
+msgid "--unshallow on a complete repository does not make sense"
+msgstr "--unshallow на повному Ñховищі не має ÑенÑу"
+
+#, c-format
+msgid "failed to fetch bundles from '%s'"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ пакунки з \"%s\""
+
+msgid "fetch --all does not take a repository argument"
+msgstr "fetch --all не приймає Ñховище Ñк аргумент"
+
+msgid "fetch --all does not make sense with refspecs"
+msgstr "fetch --all не має ÑенÑу з визначниками поÑилань"
+
+#, c-format
+msgid "no such remote or remote group: %s"
+msgstr "немає такого віддаленого Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð°Ð±Ð¾ віддаленої групи: %s"
+
+msgid "fetching a group and specifying refspecs does not make sense"
+msgstr "Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð³Ñ€ÑƒÐ¿Ð¸ Ñ– вказівка визначників поÑилань не має ÑенÑу"
+
+msgid "must supply remote when using --negotiate-only"
+msgstr ""
+"необхідно вказати віддалене Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¸ викориÑтанні --negotiate-only"
+
+msgid "protocol does not support --negotiate-only, exiting"
+msgstr "протокол не підтримує --negotiate-only, вихід"
+
+msgid ""
+"--filter can only be used with the remote configured in extensions."
+"partialclone"
+msgstr ""
+"--filter можна викориÑтовувати лише з віддаленим призначеннÑм, налаштованим "
+"у extensions.partialclone"
+
+msgid "--atomic can only be used when fetching from one remote"
+msgstr ""
+"--atomic може бути викориÑтано лише при отриманні з одного віддаленого "
+"джерела"
+
+msgid "--stdin can only be used when fetching from one remote"
+msgstr ""
+"--stdin можна викориÑтовувати лише при отриманні одного віддаленого джерела"
+
+msgid ""
+"git fmt-merge-msg [-m <message>] [--log[=<n>] | --no-log] [--file <file>]"
+msgstr ""
+"git fmt-merge-msg [-m <допиÑ>] [--log[=<н>] | --no-log] [--file <файл>]"
+
+msgid "populate log with at most <n> entries from shortlog"
+msgstr "заповнити журнал не більше ніж <н> запиÑами з shortlog"
+
+msgid "alias for --log (deprecated)"
+msgstr "пÑевдонім Ð´Ð»Ñ --log (заÑтарілий)"
+
+msgid "text"
+msgstr "текÑÑ‚"
+
+msgid "use <text> as start of message"
+msgstr "викориÑтовувати <текÑÑ‚> Ñк початок допиÑу"
+
+msgid "use <name> instead of the real target branch"
+msgstr "викориÑтовувати <назва> заміÑÑ‚ÑŒ реальної цільової гілки"
+
+msgid "file to read from"
+msgstr "файл, з Ñкого читати"
+
+msgid "git for-each-ref [<options>] [<pattern>]"
+msgstr "git for-each-ref [<опції>] [<шаблон>]"
+
+msgid "git for-each-ref [--points-at <object>]"
+msgstr "git for-each-ref [--points-at <обʼєкт>]"
+
+msgid "git for-each-ref [--merged [<commit>]] [--no-merged [<commit>]]"
+msgstr "git for-each-ref [--merged [<коміт>]] [--no-merged [<коміт>]]"
+
+msgid "git for-each-ref [--contains [<commit>]] [--no-contains [<commit>]]"
+msgstr "git for-each-ref [--contains [<коміт>]] [--no-contains [<коміт>]]"
+
+msgid "quote placeholders suitably for shells"
+msgstr "заповнювачі лапок Ð´Ð»Ñ shell"
+
+msgid "quote placeholders suitably for perl"
+msgstr "заповнювачі лапок Ð´Ð»Ñ perl"
+
+msgid "quote placeholders suitably for python"
+msgstr "заповнювачі лапок Ð´Ð»Ñ python"
+
+msgid "quote placeholders suitably for Tcl"
+msgstr "заповнювачі лапок Ð´Ð»Ñ Tcl"
+
+msgid "show only <n> matched refs"
+msgstr "показати тільки <н> відповідних поÑилань"
+
+msgid "respect format colors"
+msgstr "дотримуватиÑÑ ÐºÐ¾Ð»ÑŒÐ¾Ñ€Ñ–Ð² формату"
+
+msgid "print only refs which points at the given object"
+msgstr "виводити тільки поÑиланнÑ, Ñкі вказують на заданий об’єкт"
+
+msgid "print only refs that are merged"
+msgstr "виводити тільки злиті поÑиланнÑ"
+
+msgid "print only refs that are not merged"
+msgstr "виводити тільки не злиті поÑиланнÑ"
+
+msgid "print only refs which contain the commit"
+msgstr "виводити тільки Ñ‚Ñ– поÑиланнÑ, що міÑÑ‚ÑÑ‚ÑŒ коміт"
+
+msgid "print only refs which don't contain the commit"
+msgstr "виводити тільки Ñ‚Ñ– поÑиланнÑ, що не міÑÑ‚ÑÑ‚ÑŒ коміту"
+
+msgid "read reference patterns from stdin"
+msgstr "читати шаблони поÑилань з stdin"
+
+msgid "unknown arguments supplied with --stdin"
+msgstr "невідомі аргументи надані через --stdin"
+
+msgid "git for-each-repo --config=<config> [--] <arguments>"
+msgstr "git for-each-repo --config=<конфіг> [--] <аргументи>"
+
+msgid "config"
+msgstr "конфіг"
+
+msgid "config key storing a list of repository paths"
+msgstr "ключ конфігурації, в Ñкому зберігаєтьÑÑ ÑпиÑок шлÑхів до Ñховищ"
+
+msgid "missing --config=<config>"
+msgstr "відÑутній --config=<конфіг>"
+
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "невірно задано параметр --config=%s"
+
+msgid "unknown"
+msgstr "невідомо"
+
+#. TRANSLATORS: e.g. error in tree 01bfda: <more explanation>
+#, c-format
+msgid "error in %s %s: %s"
+msgstr "помилка в %s %s: %s"
+
+#. TRANSLATORS: e.g. warning in tree 01bfda: <more explanation>
+#, c-format
+msgid "warning in %s %s: %s"
+msgstr "Ð¿Ð¾Ð¿ÐµÑ€ÐµÐ´Ð¶ÐµÐ½Ð½Ñ Ð² %s %s: %s"
+
+#, c-format
+msgid "broken link from %7s %s"
+msgstr "пошкоджене поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð· %7s %s"
+
+msgid "wrong object type in link"
+msgstr "невірний тип об’єкта в поÑиланні"
+
+#, c-format
+msgid ""
+"broken link from %7s %s\n"
+" to %7s %s"
+msgstr ""
+"пошкоджене поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð· %7s %s\n"
+" на %7s %s"
+
+msgid "Checking connectivity"
+msgstr "Перевірка підключеннÑ"
+
+#, c-format
+msgid "missing %s %s"
+msgstr "відÑутній %s %s"
+
+#, c-format
+msgid "unreachable %s %s"
+msgstr "недоÑÑжний %s %s"
+
+#, c-format
+msgid "dangling %s %s"
+msgstr "виÑÑчий %s %s"
+
+msgid "could not create lost-found"
+msgstr "не вдалоÑÑ Ñтворити lost-found"
+
+#, c-format
+msgid "could not write '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати \"%s\""
+
+#, c-format
+msgid "could not finish '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ñ‚Ð¸ \"%s\""
+
+#, c-format
+msgid "Checking %s"
+msgstr "Перевірка %s"
+
+#, c-format
+msgid "Checking connectivity (%d objects)"
+msgstr "Перевірка Ð¿Ñ–Ð´ÐºÐ»ÑŽÑ‡ÐµÐ½Ð½Ñ (%d обʼєктів)"
+
+#, c-format
+msgid "Checking %s %s"
+msgstr "Перевірка %s %s"
+
+msgid "broken links"
+msgstr "пошкоджені поÑиланнÑ"
+
+#, c-format
+msgid "root %s"
+msgstr "корінь %s"
+
+#, c-format
+msgid "tagged %s %s (%s) in %s"
+msgstr "з тегом %s %s (%s) в %s"
+
+#, c-format
+msgid "%s: object corrupt or missing"
+msgstr "%s: об’єкт пошкоджений або відÑутній"
+
+#, c-format
+msgid "%s: invalid reflog entry %s"
+msgstr "%s: неприпуÑтимий Ð·Ð°Ð¿Ð¸Ñ Ð¶ÑƒÑ€Ð½Ð°Ð»Ñƒ поÑилань %s"
+
+#, c-format
+msgid "Checking reflog %s->%s"
+msgstr "Перевірка журналу поÑилань %s->%s"
+
+#, c-format
+msgid "%s: invalid sha1 pointer %s"
+msgstr "%s: невірний вказівник sha1 %s"
+
+#, c-format
+msgid "%s: not a commit"
+msgstr "%s не є комітом"
+
+msgid "notice: No default references"
+msgstr "повідомленнÑ: Ðемає поÑилань за замовчуваннÑм"
+
+#, c-format
+msgid "%s: hash-path mismatch, found at: %s"
+msgstr "%s: невідповідніÑÑ‚ÑŒ хеш/шлÑÑ… знайдена в: %s"
+
+#, c-format
+msgid "%s: object corrupt or missing: %s"
+msgstr "%s: об’єкт пошкоджений або відÑутній: %s"
+
+#, c-format
+msgid "%s: object is of unknown type '%s': %s"
+msgstr "%s: об’єкт невідомого типу \"%s\": %s"
+
+#, c-format
+msgid "%s: object could not be parsed: %s"
+msgstr "%s: неможливо розібрати об’єкт: %s"
+
+#, c-format
+msgid "bad sha1 file: %s"
+msgstr "невірний sha1 файл: %s"
+
+msgid "Checking object directory"
+msgstr "Перевірка директорії об’єкта"
+
+msgid "Checking object directories"
+msgstr "Перевірка директорій обʼєкта"
+
+#, c-format
+msgid "Checking %s link"
+msgstr "Перевірка %s поÑиланнÑ"
+
+#, c-format
+msgid "invalid %s"
+msgstr "неприпуÑтимий %s"
+
+#, c-format
+msgid "%s points to something strange (%s)"
+msgstr "%s вказує на щоÑÑŒ дивне (%s)"
+
+#, c-format
+msgid "%s: detached HEAD points at nothing"
+msgstr "%s: відокремлений HEAD вказує на ніщо"
+
+#, c-format
+msgid "notice: %s points to an unborn branch (%s)"
+msgstr "повідомленнÑ: %s вказує на ненароджену гілку (%s)"
+
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "Перевірка дерева кеша Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s: невірний sha1 вказівник в cache-tree Ð´Ð»Ñ %s"
+
+msgid "non-tree in cache-tree"
+msgstr "non-tree в cache-tree"
+
+#, c-format
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s: невірний sha1 вказівник в resolve-undo Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ rev-index Ð´Ð»Ñ Ð¿Ð°ÐºÑƒÐ½ÐºÑƒ \"%s\""
+
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "неприпуÑтимий rev-index Ð´Ð»Ñ \"%s\""
+
+msgid ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<object>...]"
+msgstr ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<обʼєкт>...]"
+
+msgid "show unreachable objects"
+msgstr "показати недоÑÑжні об’єкти"
+
+msgid "show dangling objects"
+msgstr "показати виÑÑчі об’єкти"
+
+msgid "report tags"
+msgstr "звітувати про теги"
+
+msgid "report root nodes"
+msgstr "звітувати про кореневі вузли"
+
+msgid "make index objects head nodes"
+msgstr "побудувати головні вузли об’єктів індекÑу"
+
+msgid "make reflogs head nodes (default)"
+msgstr "побудувати головні вузли журналу поÑилань (за замовчуваннÑм)"
+
+msgid "also consider packs and alternate objects"
+msgstr "також розглÑдати пакунки та запозичені об’єкти"
+
+msgid "check only connectivity"
+msgstr "перевірити лише звʼÑзніÑÑ‚ÑŒ"
+
+msgid "enable more strict checking"
+msgstr "увімкнути більш Ñувору перевірку"
+
+msgid "write dangling objects in .git/lost-found"
+msgstr "запиÑувати виÑÑчі об’єкти в .git/lost-found"
+
+msgid "show progress"
+msgstr "показувати прогреÑ"
+
+msgid "show verbose names for reachable objects"
+msgstr "показувати докладні назви Ð´Ð»Ñ Ð´Ð¾Ñтупних об’єктів"
+
+msgid "Checking objects"
+msgstr "Перевірка обʼєктів"
+
+#, c-format
+msgid "%s: object missing"
+msgstr "%s: об’єкт відÑутній"
+
+#, c-format
+msgid "invalid parameter: expected sha1, got '%s'"
+msgstr "неприпуÑтимий параметр: очікувалоÑÑŒ sha1, надано \"%s\""
+
+msgid "git fsmonitor--daemon start [<options>]"
+msgstr "git fsmonitor--daemon start [<опції>]"
+
+msgid "git fsmonitor--daemon run [<options>]"
+msgstr "git fsmonitor--daemon run [<опції>]"
+
+#, c-format
+msgid "value of '%s' out of range: %d"
+msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"%s\" за межами діапазону: %d"
+
+#, c-format
+msgid "value of '%s' not bool or int: %d"
+msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"%s\" не Ñ” bool або int: %d"
+
+#, c-format
+msgid "fsmonitor-daemon is watching '%s'\n"
+msgstr "fsmonitor-daemon Ñтежить за \"%s\"\n"
+
+#, c-format
+msgid "fsmonitor-daemon is not watching '%s'\n"
+msgstr "fsmonitor-daemon не Ñтежить за \"%s\"\n"
+
+#, c-format
+msgid "could not create fsmonitor cookie '%s'"
+msgstr "не вдалоÑÑ Ñтворити fsmonitor cookie \"%s\""
+
+#, c-format
+msgid "fsmonitor: cookie_result '%d' != SEEN"
+msgstr "fsmonitor: cookie_result \"%d\" != SEEN"
+
+#, c-format
+msgid "could not start IPC thread pool on '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити пул потоків IPC на \"%s\""
+
+msgid "could not start fsmonitor listener thread"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити потік Ñлухача fsmonitor"
+
+msgid "could not start fsmonitor health thread"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити потік Ñтану fsmonitor"
+
+msgid "could not initialize listener thread"
+msgstr "не вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ потік Ñлухача"
+
+msgid "could not initialize health thread"
+msgstr "не вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ потік Ñтану"
+
+#, c-format
+msgid "could not cd home '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ cd home \"%s\""
+
+#, c-format
+msgid "fsmonitor--daemon is already running '%s'"
+msgstr "fsmonitor--daemon вже запущений \"%s\""
+
+#, c-format
+msgid "running fsmonitor-daemon in '%s'\n"
+msgstr "запуÑк fsmonitor-daemon в \"%s\"\n"
+
+#, c-format
+msgid "starting fsmonitor-daemon in '%s'\n"
+msgstr "Ñтарт fsmonitor-daemon в \"%s\"\n"
+
+msgid "daemon failed to start"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити демон"
+
+msgid "daemon not online yet"
+msgstr "демон ще не онлайн"
+
+msgid "daemon terminated"
+msgstr "роботу демона припинено"
+
+msgid "detach from console"
+msgstr "від’єднати від конÑолі"
+
+msgid "use <n> ipc worker threads"
+msgstr "викориÑтовувати <н> потоків IPC працівника"
+
+msgid "max seconds to wait for background daemon startup"
+msgstr "макÑимальна кількіÑÑ‚ÑŒ Ñекунд Ð´Ð»Ñ Ð¾Ñ‡Ñ–ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð°Ð¿ÑƒÑку фонового демона"
+
+#, c-format
+msgid "invalid 'ipc-threads' value (%d)"
+msgstr "невірне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"ipc-threads\" (%d)"
+
+#, c-format
+msgid "Unhandled subcommand '%s'"
+msgstr "Ðеоброблена підкоманда \"%s\""
+
+msgid "fsmonitor--daemon not supported on this platform"
+msgstr "fsmonitor--daemon не підтримуєтьÑÑ Ð½Ð° цій платформі"
+
+msgid "git gc [<options>]"
+msgstr "git gc [<опції>]"
+
+#, c-format
+msgid "Failed to fstat %s: %s"
+msgstr "Ðе вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ fstat %s: %s"
+
+#, c-format
+msgid "failed to parse '%s' value '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ \"%s\" Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"%s\""
+
+#, c-format
+msgid "cannot stat '%s'"
+msgstr "неможливо виконати stat \"%s\""
+
+#, c-format
+msgid ""
+"The last gc run reported the following. Please correct the root cause\n"
+"and remove %s\n"
+"Automatic cleanup will not be performed until the file is removed.\n"
+"\n"
+"%s"
+msgstr ""
+"Попередній запуÑк gc показав наÑтупне. Будь лаÑка, виправте першопричину\n"
+"і видаліть %s\n"
+"Ðвтоматичне Ð¾Ñ‡Ð¸Ñ‰ÐµÐ½Ð½Ñ Ð½Ðµ буде виконано, доки файл не буде вилучено.\n"
+"\n"
+"%s"
+
+msgid "prune unreferenced objects"
+msgstr "видалити об’єкти, на Ñкі немає поÑилань"
+
+msgid "pack unreferenced objects separately"
+msgstr "пакувати об’єкти, на Ñкі немає поÑилань, окремо"
+
+msgid "with --cruft, limit the size of new cruft packs"
+msgstr "з --cruft, обмежити розмір нових марних пакунків"
+
+msgid "be more thorough (increased runtime)"
+msgstr "працювати ретельніше (збільшує Ñ‡Ð°Ñ Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ)"
+
+msgid "enable auto-gc mode"
+msgstr "увімкнути режим автоматичного збору ÑміттÑ"
+
+msgid "force running gc even if there may be another gc running"
+msgstr "примуÑово запуÑкати збирач ÑміттÑ, навіть Ñкщо інший збирач вже працює"
+
+msgid "repack all other packs except the largest pack"
+msgstr "перепакувати вÑÑ– пакунки, крім найбільшого"
+
+#, c-format
+msgid "failed to parse gc.logExpiry value %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ gc.logExpiry Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ %s"
+
+#, c-format
+msgid "failed to parse prune expiry value %s"
+msgstr ""
+"не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð°Ñ‚Ð¸ Ð·Ð°ÐºÑ–Ð½Ñ‡ÐµÐ½Ð½Ñ Ñ‚ÐµÑ€Ð¼Ñ–Ð½Ñƒ дії Ð´Ð»Ñ Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ %s"
+
+#, c-format
+msgid "Auto packing the repository in background for optimum performance.\n"
+msgstr ""
+"Ðвтоматичне Ð¿Ð°ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ñховища у фоновому режимі Ð´Ð»Ñ Ð¾Ð¿Ñ‚Ð¸Ð¼Ð°Ð»ÑŒÐ½Ð¾Ñ— "
+"продуктивноÑÑ‚Ñ–.\n"
+
+#, c-format
+msgid "Auto packing the repository for optimum performance.\n"
+msgstr "Ðвтоматичне Ð¿Ð°ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ñховища Ð´Ð»Ñ Ð¾Ð¿Ñ‚Ð¸Ð¼Ð°Ð»ÑŒÐ½Ð¾Ñ— продуктивноÑÑ‚Ñ–.\n"
+
+#, c-format
+msgid "See \"git help gc\" for manual housekeeping.\n"
+msgstr ""
+"ДивітьÑÑ \"git help gc\" Ð´Ð»Ñ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ— про Ð½Ð°Ð»Ð°Ð³Ð¾Ð´Ð¶ÐµÐ½Ð½Ñ Ð²Ñ€ÑƒÑ‡Ð½Ñƒ.\n"
+
+#, c-format
+msgid ""
+"gc is already running on machine '%s' pid %<PRIuMAX> (use --force if not)"
+msgstr ""
+"збір ÑÐ¼Ñ–Ñ‚Ñ‚Ñ Ð²Ð¶Ðµ запущено на машині \"%s\" pid %<PRIuMAX> (ÑкориÑтайтеÑÑŒ --"
+"force, Ñкщо ні)"
+
+msgid ""
+"There are too many unreachable loose objects; run 'git prune' to remove them."
+msgstr ""
+"Занадто багато недоÑÑжних вільних об’єктів; запуÑÑ‚Ñ–Ñ‚ÑŒ \"git prune\", щоб "
+"вилучити їх."
+
+msgid ""
+"git maintenance run [--auto] [--[no-]quiet] [--task=<task>] [--schedule]"
+msgstr ""
+"git maintenance run [--auto] [--[no-]quiet] [--task=<завданнÑ>] [--schedule]"
+
+msgid "--no-schedule is not allowed"
+msgstr "--no-schedule не дозволÑєтьÑÑ"
+
+#, c-format
+msgid "unrecognized --schedule argument '%s'"
+msgstr "нерозпізнаний аргумент --schedule \"%s\""
+
+msgid "failed to write commit-graph"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати граф комітів"
+
+msgid "failed to prefetch remotes"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ попереднє Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð· віддалених Ñховищ"
+
+msgid "failed to start 'git pack-objects' process"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити \"git pack-objects\" процеÑ"
+
+msgid "failed to finish 'git pack-objects' process"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ñ‚Ð¸ \"git pack-objects\" процеÑ"
+
+msgid "failed to write multi-pack-index"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати multi-pack-index"
+
+msgid "'git multi-pack-index expire' failed"
+msgstr "\"git multi-pack-index expire\" завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+msgid "'git multi-pack-index repack' failed"
+msgstr "\"git multi-pack-index repack\" завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+msgid ""
+"skipping incremental-repack task because core.multiPackIndex is disabled"
+msgstr ""
+"пропуÑк incremental-repack завданнÑ, оÑкільки core.multiPackIndex вимкнено"
+
+#, c-format
+msgid "lock file '%s' exists, skipping maintenance"
+msgstr "файл Ð±Ð»Ð¾ÐºÑƒÐ²Ð°Ð½Ð½Ñ \"%s\" Ñ–Ñнує, пропуÑк обÑлуговуваннÑ"
+
+#, c-format
+msgid "task '%s' failed"
+msgstr "Ð·Ð°Ð²Ð´Ð°Ð½Ð½Ñ \"%s\" завершилоÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "'%s' is not a valid task"
+msgstr "\"%s\" не Ñ” припуÑтимим завданнÑм"
+
+#, c-format
+msgid "task '%s' cannot be selected multiple times"
+msgstr "Ð·Ð°Ð²Ð´Ð°Ð½Ð½Ñ \"%s\" не можна вибрати кілька разів"
+
+msgid "run tasks based on the state of the repository"
+msgstr "запуÑкати Ð·Ð°Ð²Ð´Ð°Ð½Ð½Ñ Ð½Ð° оÑнові Ñтану Ñховища"
+
+msgid "frequency"
+msgstr "чаÑтота"
+
+msgid "run tasks based on frequency"
+msgstr "запуÑкати задачі на оÑнові чаÑтоти"
+
+msgid "do not report progress or other information over stderr"
+msgstr "не показувати хід Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ Ñ‚Ð° іншу інформацію в stderr"
+
+msgid "task"
+msgstr "завданнÑ"
+
+msgid "run a specific task"
+msgstr "запуÑтити певне завданнÑ"
+
+msgid "use at most one of --auto and --schedule=<frequency>"
+msgstr "викориÑтовуйте щонайбільше одну з опцій --auto та --schedule=<чаÑтота>"
+
+#, c-format
+msgid "unable to add '%s' value of '%s'"
+msgstr "не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ \"%s\" Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð¾ \"%s\""
+
+msgid "return success even if repository was not registered"
+msgstr "повертати уÑпіх, навіть Ñкщо Ñховище не було зареєÑтровано"
+
+#, c-format
+msgid "unable to unset '%s' value of '%s'"
+msgstr "не вдалоÑÑ Ñкинути \"%s\" Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "repository '%s' is not registered"
+msgstr "Ñховище \"%s\" не зареєÑтровано"
+
+#, c-format
+msgid "failed to expand path '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð³Ð¾Ñ€Ð½ÑƒÑ‚Ð¸ шлÑÑ… \"%s\""
+
+msgid "failed to start launchctl"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити launchctl"
+
+#, c-format
+msgid "failed to create directories for '%s'"
+msgstr "не вдалоÑÑ Ñтворити директорії Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "failed to bootstrap service %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð³Ð¾Ñ€Ð½ÑƒÑ‚Ð¸ Ñлужбу %s"
+
+msgid "failed to create temp xml file"
+msgstr "не вдалоÑÑ Ñтворити тимчаÑовий xml файл"
+
+msgid "failed to start schtasks"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити schtasks"
+
+msgid "failed to run 'crontab -l'; your system might not support 'cron'"
+msgstr ""
+"не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити \"crontab -l\"; можливо, ваша ÑиÑтема не підтримує "
+"\"cron\""
+
+msgid "failed to create crontab temporary file"
+msgstr "не вдалоÑÑ Ñтворити тимчаÑовий crontab файл"
+
+msgid "failed to open temporary file"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ тимчаÑовий файл"
+
+msgid "failed to run 'crontab'; your system might not support 'cron'"
+msgstr ""
+"не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити \"crontab\"; можливо, ваша ÑиÑтема не підтримує \"cron\""
+
+msgid "'crontab' died"
+msgstr "\"crontab\" завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "failed to delete '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ \"%s\""
+
+#, c-format
+msgid "failed to flush '%s'"
+msgstr "не вдалоÑÑ Ð¾Ñ‡Ð¸Ñтити \"%s\""
+
+msgid "failed to start systemctl"
+msgstr "не вдалоÑÑ Ñтартувати systemctl"
+
+msgid "failed to run systemctl"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити systemctl"
+
+#, c-format
+msgid "unrecognized --scheduler argument '%s'"
+msgstr "нерозпізнаний --scheduler аргумент \"%s\""
+
+msgid "neither systemd timers nor crontab are available"
+msgstr "недоÑтупні ні systemd таймери, ні crontab"
+
+#, c-format
+msgid "%s scheduler is not available"
+msgstr "%s планувальник недоÑтупний"
+
+msgid "another process is scheduling background maintenance"
+msgstr "ще один Ð¿Ñ€Ð¾Ñ†ÐµÑ Ð¿Ð»Ð°Ð½ÑƒÑ” фонове обÑлуговуваннÑ"
+
+msgid "git maintenance start [--scheduler=<scheduler>]"
+msgstr "git maintenance start [--scheduler=<планувальник>]"
+
+msgid "scheduler"
+msgstr "планувальник"
+
+msgid "scheduler to trigger git maintenance run"
+msgstr "планувальник Ð´Ð»Ñ Ð·Ð°Ð¿ÑƒÑку обÑÐ»ÑƒÐ³Ð¾Ð²ÑƒÐ²Ð°Ð½Ð½Ñ git"
+
+msgid "failed to set up maintenance schedule"
+msgstr "не вдалоÑÑ Ð²Ñтановити розклад обÑлуговуваннÑ"
+
+msgid "failed to add repo to global config"
+msgstr "не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ Ñховище до глобальної конфігурації"
+
+msgid "git maintenance <subcommand> [<options>]"
+msgstr "git maintenance <підкоманда> [<опції>]"
+
+msgid "git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]"
+msgstr "git grep [<опції>] [-e] <шаблон> [<ревізіÑ>...] [[--] <шлÑÑ…>...]"
+
+#, c-format
+msgid "grep: failed to create thread: %s"
+msgstr "grep: не вдалоÑÑ Ñтворити потік: %s"
+
+#, c-format
+msgid "invalid number of threads specified (%d) for %s"
+msgstr "невірно вказана кількіÑÑ‚ÑŒ потоків (%d) Ð´Ð»Ñ %s"
+
+#. #-#-#-#-# grep.c.po #-#-#-#-#
+#. TRANSLATORS: %s is the configuration
+#. variable for tweaking threads, currently
+#. grep.threads
+#.
+#, c-format
+msgid "no threads support, ignoring %s"
+msgstr "немає підтримки потоків, Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ %s"
+
+#, c-format
+msgid "unable to read tree (%s)"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ дерево (%s)"
+
+#, c-format
+msgid "unable to read tree %s"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ дерево %s"
+
+#, c-format
+msgid "unable to grep from object of type %s"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ grep Ð´Ð»Ñ Ð¾Ð±â€™Ñ”ÐºÑ‚Ð° типу %s"
+
+#, c-format
+msgid "switch `%c' expects a numerical value"
+msgstr "switch \"%c\" очікує чиÑлове значеннÑ"
+
+msgid "search in index instead of in the work tree"
+msgstr "шукати в індекÑÑ– заміÑÑ‚ÑŒ робочого дерева"
+
+msgid "find in contents not managed by git"
+msgstr "шукати у вміÑÑ‚Ñ–, не індекÑованому git"
+
+msgid "search in both tracked and untracked files"
+msgstr "шукати Ñк у відÑтежуваних, так Ñ– в невідÑтежуваних файлах"
+
+msgid "ignore files specified via '.gitignore'"
+msgstr "ігнорувати файли, вказані через \".gitignore\""
+
+msgid "recursively search in each submodule"
+msgstr "шукати рекурÑивно в кожному підмодулі"
+
+msgid "show non-matching lines"
+msgstr "показувати Ñ€Ñдки, що не збігаютьÑÑ"
+
+msgid "case insensitive matching"
+msgstr "нечутливе до регіÑтру зіÑтавленнÑ"
+
+msgid "match patterns only at word boundaries"
+msgstr "зіÑтавлÑти шаблони тільки на межі Ñлів"
+
+msgid "process binary files as text"
+msgstr "оброблÑти бінарні файли Ñк текÑÑ‚"
+
+msgid "don't match patterns in binary files"
+msgstr "не зіÑтавлÑти шаблони в бінарних файлах"
+
+msgid "process binary files with textconv filters"
+msgstr "оброблÑти бінарні файли за допомогою textconv фільтрів"
+
+msgid "search in subdirectories (default)"
+msgstr "шукати в піддиректоріÑÑ… (за замовчуваннÑм)"
+
+msgid "descend at most <n> levels"
+msgstr "ÑпуÑкатиÑÑ Ð½Ðµ більше ніж на <н> рівнів"
+
+msgid "use extended POSIX regular expressions"
+msgstr "викориÑтовувати розширені POSIX регулÑрні вирази"
+
+msgid "use basic POSIX regular expressions (default)"
+msgstr "викориÑтовувати базові регулÑрні вирази POSIX (за замовчуваннÑм)"
+
+msgid "interpret patterns as fixed strings"
+msgstr "інтерпретувати шаблони Ñк фікÑовані Ñтроки"
+
+msgid "use Perl-compatible regular expressions"
+msgstr "викориÑтовувати Perl-ÑуміÑні регулÑрні вирази"
+
+msgid "show line numbers"
+msgstr "показувати номери Ñ€Ñдків"
+
+msgid "show column number of first match"
+msgstr "показувати номер ÑÑ‚Ð¾Ð²Ð¿Ñ†Ñ Ð¿ÐµÑ€ÑˆÐ¾Ð³Ð¾ збігу"
+
+msgid "don't show filenames"
+msgstr "не показувати назви файлів"
+
+msgid "show filenames"
+msgstr "показувати назви файлів"
+
+msgid "show filenames relative to top directory"
+msgstr "показувати назви файлів відноÑно верхнього каталогу"
+
+msgid "show only filenames instead of matching lines"
+msgstr "показувати лише назви файлів заміÑÑ‚ÑŒ відповідних Ñ€Ñдків"
+
+msgid "synonym for --files-with-matches"
+msgstr "Ñинонім Ð´Ð»Ñ --files-with-matches"
+
+msgid "show only the names of files without match"
+msgstr "показувати лише назви файлів без збігу"
+
+msgid "print NUL after filenames"
+msgstr "друкувати NUL піÑÐ»Ñ Ð½Ð°Ð·Ð² файлів"
+
+msgid "show only matching parts of a line"
+msgstr "показувати лише чаÑтини Ñ€Ñдка, що збігаютьÑÑ"
+
+msgid "show the number of matches instead of matching lines"
+msgstr "показувати кількіÑÑ‚ÑŒ збігів заміÑÑ‚ÑŒ Ñ€Ñдків, що збігаютьÑÑ"
+
+msgid "highlight matches"
+msgstr "виділÑти збіги"
+
+msgid "print empty line between matches from different files"
+msgstr "друкувати порожній Ñ€Ñдок між збігами з різних файлів"
+
+msgid "show filename only once above matches from same file"
+msgstr "показувати назву файлу лише один раз над збігами з того файлу"
+
+msgid "show <n> context lines before and after matches"
+msgstr "показувати <н> Ñ€Ñдків до Ñ– піÑÐ»Ñ Ð·Ð±Ñ–Ð³Ñƒ"
+
+msgid "show <n> context lines before matches"
+msgstr "показувати <н> Ñ€Ñдків до збігу"
+
+msgid "show <n> context lines after matches"
+msgstr "показувати <н> Ñ€Ñдків піÑÐ»Ñ Ð·Ð±Ñ–Ð³Ñƒ"
+
+msgid "use <n> worker threads"
+msgstr "викориÑтати <н> робочих потоків"
+
+msgid "shortcut for -C NUM"
+msgstr "ÑÐºÐ¾Ñ€Ð¾Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ -C номер"
+
+msgid "show a line with the function name before matches"
+msgstr "показувати Ñ€Ñдок з назвою функції перед збігами"
+
+msgid "show the surrounding function"
+msgstr "показати навколишню функцію"
+
+msgid "read patterns from file"
+msgstr "зчитувати шаблони з файлу"
+
+msgid "match <pattern>"
+msgstr "зіÑтавлÑти <шаблон>"
+
+msgid "combine patterns specified with -e"
+msgstr "об’єднати шаблони, вказані через -e"
+
+msgid "indicate hit with exit status without output"
+msgstr "позначати збіг кодом виходу без виводу"
+
+msgid "show only matches from files that match all patterns"
+msgstr "показувати збіги лише з файлів, Ñкі відповідають уÑім шаблонам"
+
+msgid "pager"
+msgstr "пейджер"
+
+msgid "show matching files in the pager"
+msgstr "показати відповідні файли в пейджері"
+
+msgid "allow calling of grep(1) (ignored by this build)"
+msgstr "дозволÑти виклик grep(1) (ігноруєтьÑÑ Ñƒ цій збірці)"
+
+msgid "maximum number of results per file"
+msgstr "макÑимальна кількіÑÑ‚ÑŒ результатів у файлі"
+
+msgid "no pattern given"
+msgstr "шаблон не надано"
+
+msgid "--no-index or --untracked cannot be used with revs"
+msgstr "--no-index або --untracked не можна викориÑтовувати з ревізіÑми"
+
+#, c-format
+msgid "unable to resolve revision: %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð²Ê¼Ñзати ревізію: %s"
+
+msgid "--untracked not supported with --recurse-submodules"
+msgstr "--untracked не підтримуєтьÑÑ Ð· --recurse-submodules"
+
+msgid "invalid option combination, ignoring --threads"
+msgstr "неприпуÑтима ÐºÐ¾Ð¼Ð±Ñ–Ð½Ð°Ñ†Ñ–Ñ Ð¾Ð¿Ñ†Ñ–Ð¹, Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ --threads"
+
+msgid "no threads support, ignoring --threads"
+msgstr "немає підтримки потоків, Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ --threads"
+
+#, c-format
+msgid "invalid number of threads specified (%d)"
+msgstr "вказано неприпуÑтиму кількіÑÑ‚ÑŒ потоків (%d)"
+
+msgid "--open-files-in-pager only works on the worktree"
+msgstr "--open-files-in-pager працює тільки в робочому дереві"
+
+msgid "--[no-]exclude-standard cannot be used for tracked contents"
+msgstr ""
+"--[no-]exclude-standard не можна викориÑтовувати Ð´Ð»Ñ Ð²Ñ–Ð´Ñтежуваного вміÑту"
+
+msgid "both --cached and trees are given"
+msgstr "надані Ñк --cached, так Ñ– дерева"
+
+msgid ""
+"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
+" [--stdin [--literally]] [--] <file>..."
+msgstr ""
+"git hash-object [-t <тип>] [-w] [--path=<файл> | --no-filters]\n"
+" [--stdin [--literally]] [--] <файл>..."
+
+msgid "git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]"
+msgstr "git hash-object [-t <тип>] [-w] --stdin-paths [--no-filters]"
+
+msgid "object type"
+msgstr "тип обʼєкта"
+
+msgid "write the object into the object database"
+msgstr "запиÑати об’єкт до бази даних об’єктів"
+
+msgid "read the object from stdin"
+msgstr "прочитати об’єкт з stdin"
+
+msgid "store file as is without filters"
+msgstr "зберегти файл Ñк Ñ” без фільтрів"
+
+msgid ""
+"just hash any random garbage to create corrupt objects for debugging Git"
+msgstr ""
+"проÑто хешувати будь-Ñкий випадковий непотріб, щоб Ñтворити пошкоджені "
+"об’єкти Ð´Ð»Ñ Ð²Ñ–Ð´Ð»Ð°Ð³Ð¾Ð´Ð¶ÐµÐ½Ð½Ñ Git"
+
+msgid "process file as it were from this path"
+msgstr "оброблювати файл, наче він з цього шлÑху"
+
+msgid "print all available commands"
+msgstr "показати вÑÑ– доÑтупні команди"
+
+msgid "show external commands in --all"
+msgstr "показати зовнішні команди в --all"
+
+msgid "show aliases in --all"
+msgstr "показати пÑевдоніми в --all"
+
+msgid "exclude guides"
+msgstr "виключити поÑібники"
+
+msgid "show man page"
+msgstr "показати Ñторінку керівництва кориÑтувача"
+
+msgid "show manual in web browser"
+msgstr "показати Ñторінку керівництва кориÑтувача в веб-браузері"
+
+msgid "show info page"
+msgstr "показати інформаційну Ñторінку"
+
+msgid "print command description"
+msgstr "показати Ð¾Ð¿Ð¸Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¸"
+
+msgid "print list of useful guides"
+msgstr "показати ÑпиÑок кориÑних поÑібників"
+
+msgid "print list of user-facing repository, command and file interfaces"
+msgstr "показати ÑпиÑок інтерфейÑів кориÑтувача Ð´Ð»Ñ Ñховищ, команд та файлів"
+
+msgid "print list of file formats, protocols and other developer interfaces"
+msgstr ""
+"показати ÑпиÑок форматів файлів, протоколів та інших інтерфейÑів розробника"
+
+msgid "print all configuration variable names"
+msgstr "показати вÑÑ– назви конфігураційних змінних"
+
+msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"
+msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<команда>|<док>]"
+
+#, c-format
+msgid "unrecognized help format '%s'"
+msgstr "нерозпізнаний формат довідки \"%s\""
+
+msgid "Failed to start emacsclient."
+msgstr "Ðе вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити emacsclient."
+
+msgid "Failed to parse emacsclient version."
+msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ верÑÑ–ÑŽ emacsclient."
+
+#, c-format
+msgid "emacsclient version '%d' too old (< 22)."
+msgstr "верÑÑ–Ñ emacsclient \"%d\" заÑтаріла (< 22)."
+
+#, c-format
+msgid "failed to exec '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ \"%s\""
+
+#, c-format
+msgid ""
+"'%s': path for unsupported man viewer.\n"
+"Please consider using 'man.<tool>.cmd' instead."
+msgstr ""
+"\"%s\": шлÑÑ… до непідтримуваного переглÑдача керівництва кориÑтувача.\n"
+"Будь лаÑка, ÑкориÑтайтеÑÑŒ \"man.<tool>.cmd\" заміÑÑ‚ÑŒ цього."
+
+#, c-format
+msgid ""
+"'%s': cmd for supported man viewer.\n"
+"Please consider using 'man.<tool>.path' instead."
+msgstr ""
+"\"%s\": команда Ð´Ð»Ñ Ð¿Ñ–Ð´Ñ‚Ñ€Ð¸Ð¼ÑƒÐ²Ð°Ð½Ð¾Ð³Ð¾ переглÑдача керівництва кориÑтувача.\n"
+"Будь лаÑка, ÑкориÑтайтеÑÑŒ \"man.<tool>.path\" заміÑÑ‚ÑŒ цього."
+
+#, c-format
+msgid "'%s': unknown man viewer."
+msgstr "\"%s\": невідомий переглÑдач керівництва кориÑтувача."
+
+msgid "no man viewer handled the request"
+msgstr "жоден з переглÑдачів керівництва кориÑтувача не обробив запит"
+
+msgid "no info viewer handled the request"
+msgstr "жоден з переглÑдачів інформації не обробив запит"
+
+#, c-format
+msgid "'%s' is aliased to '%s'"
+msgstr "\"%s\" Ñ” пÑевдонімом Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "bad alias.%s string: %s"
+msgstr "невірний пÑевдонім.%s Ñ€Ñдок: %s"
+
+#, c-format
+msgid "the '%s' option doesn't take any non-option arguments"
+msgstr "Ð¾Ð¿Ñ†Ñ–Ñ \"%s\" не приймає жодних неопціональних аргументів"
+
+msgid ""
+"the '--no-[external-commands|aliases]' options can only be used with '--all'"
+msgstr ""
+"опції \"--no-[external-commands|aliases]\" можна викориÑтовувати лише з \"--"
+"all\""
+
+#, c-format
+msgid "usage: %s%s"
+msgstr "викориÑтаннÑ: %s%s"
+
+msgid "'git help config' for more information"
+msgstr "\"git help config\" Ð´Ð»Ñ Ð´Ð¾Ð´Ð°Ñ‚ÐºÐ¾Ð²Ð¾Ñ— інформації"
+
+msgid ""
+"git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-"
+"args>]"
+msgstr ""
+"git hook run [--ignore-missing] [--to-stdin=<шлÑÑ…>] <назва-гачка> [-- "
+"<аргументи-гачка>]"
+
+msgid "silently ignore missing requested <hook-name>"
+msgstr "мовчки ігнорувати відÑутній <назва-гачка>"
+
+msgid "file to read into hooks' stdin"
+msgstr "файл, з Ñкого читати stdin хука"
+
+#, c-format
+msgid "object type mismatch at %s"
+msgstr "не Ñпівпадає тип обʼєкта Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "did not receive expected object %s"
+msgstr "очікуваних обʼєктів не отримано %s"
+
+#, c-format
+msgid "object %s: expected type %s, found %s"
+msgstr "обʼєкт %s: очікувавÑÑ Ñ‚Ð¸Ð¿ %s, знайдено %s"
+
+#, c-format
+msgid "cannot fill %d byte"
+msgid_plural "cannot fill %d bytes"
+msgstr[0] "не вдаєтьÑÑ Ð·Ð°Ð¿Ð¾Ð²Ð½Ð¸Ñ‚Ð¸ %d байт"
+msgstr[1] "не вдаєтьÑÑ Ð·Ð°Ð¿Ð¾Ð²Ð½Ð¸Ñ‚Ð¸ %d байти"
+msgstr[2] "не вдаєтьÑÑ Ð·Ð°Ð¿Ð¾Ð²Ð½Ð¸Ñ‚Ð¸ %d байтів"
+
+msgid "early EOF"
+msgstr "ранній EOF"
+
+msgid "read error on input"
+msgstr "помилка Ð·Ñ‡Ð¸Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð° вході"
+
+msgid "used more bytes than were available"
+msgstr "викориÑтано більше байтів, ніж було доÑтупно"
+
+msgid "pack too large for current definition of off_t"
+msgstr "пакунок занадто великий Ð´Ð»Ñ Ð¿Ð¾Ñ‚Ð¾Ñ‡Ð½Ð¾Ð³Ð¾ Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ off_t"
+
+#, c-format
+msgid "pack exceeds maximum allowed size (%s)"
+msgstr "пакунок перевищує макÑимально дозволений розмір (%s)"
+
+msgid "pack signature mismatch"
+msgstr "не Ñпівпадає Ð¿Ñ–Ð´Ð¿Ð¸Ñ Ð¿Ð°ÐºÑƒÐ½ÐºÐ°"
+
+#, c-format
+msgid "pack version %<PRIu32> unsupported"
+msgstr "верÑÑ–Ñ Ð¿Ð°ÐºÑƒÐ½ÐºÐ° %<PRIu32> не підтримуєтьÑÑ"
+
+#, c-format
+msgid "pack has bad object at offset %<PRIuMAX>: %s"
+msgstr "пакунок має невірний обʼєкт зі зміщеннÑм %<PRIuMAX>: %s"
+
+#, c-format
+msgid "inflate returned %d"
+msgstr "розпаковувач повернув %d"
+
+msgid "offset value overflow for delta base object"
+msgstr "Ð¿ÐµÑ€ÐµÐ¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ñуву Ð´Ð»Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ñƒ дельти з базою"
+
+msgid "delta base offset is out of bound"
+msgstr "зÑув дельти з базою виходить за межі"
+
+#, c-format
+msgid "unknown object type %d"
+msgstr "невідомий тип обʼєкта %d"
+
+msgid "cannot pread pack file"
+msgstr "неможливо прочитати файл пакунка"
+
+#, c-format
+msgid "premature end of pack file, %<PRIuMAX> byte missing"
+msgid_plural "premature end of pack file, %<PRIuMAX> bytes missing"
+msgstr[0] "передчаÑний кінець файлу пакунка, %<PRIuMAX> байт відÑутній"
+msgstr[1] "передчаÑний кінець файлу пакунка, %<PRIuMAX> байта відÑутні"
+msgstr[2] "передчаÑний кінець файлу пакунка, %<PRIuMAX> байтів відÑутні"
+
+msgid "serious inflate inconsistency"
+msgstr "Ñерйозне неÑÐ¿Ñ–Ð²Ð¿Ð°Ð´Ñ–Ð½Ð½Ñ Ð¿Ñ–Ð´ Ñ‡Ð°Ñ Ñ€Ð¾Ð·Ð¿Ð°ÐºÑƒÐ²Ð°Ð½Ð½Ñ"
+
+#, c-format
+msgid "SHA1 COLLISION FOUND WITH %s !"
+msgstr "ВИЯВЛЕÐО SHA1 КОЛІЗІЮ З %s!"
+
+#, c-format
+msgid "cannot read existing object info %s"
+msgstr "неможливо прочитати інформацію про Ñ–Ñнуючий об’єкт %s"
+
+#, c-format
+msgid "cannot read existing object %s"
+msgstr "неможливо прочитати Ñ–Ñнуючий об’єкт %s"
+
+#, c-format
+msgid "invalid blob object %s"
+msgstr "неприпуÑтимий об’єкт blob %s"
+
+msgid "fsck error in packed object"
+msgstr "помилка fsck у запакованому обʼєкті"
+
+#, c-format
+msgid "Not all child objects of %s are reachable"
+msgstr "Ðе вÑÑ– дочірні об’єкти %s доÑтупні"
+
+msgid "failed to apply delta"
+msgstr "не вдалоÑÑ Ð·Ð°ÑтоÑувати дельту"
+
+msgid "Receiving objects"
+msgstr "ÐžÑ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð¾Ð±â€™Ñ”ÐºÑ‚Ñ–Ð²"
+
+msgid "Indexing objects"
+msgstr "ІндекÑÐ°Ñ†Ñ–Ñ Ð¾Ð±â€™Ñ”ÐºÑ‚Ñ–Ð²"
+
+msgid "pack is corrupted (SHA1 mismatch)"
+msgstr "пакунок пошкоджено (SHA1 не Ñпівпадає)"
+
+msgid "cannot fstat packfile"
+msgstr "неможливо зробити fstat файла пакунка"
+
+msgid "pack has junk at the end"
+msgstr "мотлох наприкінці пакунка"
+
+msgid "confusion beyond insanity in parse_pack_objects()"
+msgstr "плутанина на межі пекельного борошна в parse_pack_objects()"
+
+msgid "Resolving deltas"
+msgstr "Розв’ÑÐ·Ð°Ð½Ð½Ñ Ð´ÐµÐ»ÑŒÑ‚"
+
+#, c-format
+msgid "unable to create thread: %s"
+msgstr "не вдалоÑÑ Ñтворити потік: %s"
+
+msgid "confusion beyond insanity"
+msgstr "плутанина на межі пекельного борошна"
+
+#, c-format
+msgid "completed with %d local object"
+msgid_plural "completed with %d local objects"
+msgstr[0] "завершено з %d локальним об’єктом"
+msgstr[1] "завершено з %d локальними об’єктами"
+msgstr[2] "завершено з %d локальними об’єктами"
+
+#, c-format
+msgid "Unexpected tail checksum for %s (disk corruption?)"
+msgstr "Ðеочікувана контрольна Ñума наприкінці %s (Ð¿Ð¾ÑˆÐºÐ¾Ð´Ð¶ÐµÐ½Ð½Ñ Ð´Ð¸Ñка?)"
+
+#, c-format
+msgid "pack has %d unresolved delta"
+msgid_plural "pack has %d unresolved deltas"
+msgstr[0] "пакунок має %d нерозвʼÑзану дельту"
+msgstr[1] "пакунок має %d нерозвʼÑзаних дельти"
+msgstr[2] "пакунок має %d нерозвʼÑзаних дельт"
+
+#, c-format
+msgid "unable to deflate appended object (%d)"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð°ÐºÑƒÐ²Ð°Ñ‚Ð¸ доданий об’єкт (%d)"
+
+#, c-format
+msgid "local object %s is corrupt"
+msgstr "локальний обʼєкт %s пошкоджено"
+
+#, c-format
+msgid "packfile name '%s' does not end with '.%s'"
+msgstr "Ñ–Ð¼â€™Ñ Ñ„Ð°Ð¹Ð»Ð° пакунка '%s' не закінчуєтьÑÑ Ð½Ð° '.%s'"
+
+#, c-format
+msgid "cannot write %s file '%s'"
+msgstr "неможливо запиÑати %s файл '%s'"
+
+#, c-format
+msgid "cannot close written %s file '%s'"
+msgstr "неможливо закрити запиÑаний %s файл '%s'"
+
+#, c-format
+msgid "unable to rename temporary '*.%s' file to '%s'"
+msgstr "не вдаєтьÑÑ Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ñ‚Ð¸ тимчаÑовий файл '*.%s' на '%s'"
+
+msgid "error while closing pack file"
+msgstr "помилка під Ñ‡Ð°Ñ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ñ‚Ñ Ñ„Ð°Ð¹Ð»Ñƒ пакунка"
+
+#, c-format
+msgid "bad pack.indexVersion=%<PRIu32>"
+msgstr "невірний pack.indexVersion=%<PRIu32>"
+
+#, c-format
+msgid "Cannot open existing pack file '%s'"
+msgstr "Ðеможливо відкрити Ñ–Ñнуючий файл пакунка '%s"
+
+#, c-format
+msgid "Cannot open existing pack idx file for '%s'"
+msgstr "Ðеможливо відкрити Ñ–Ñнуючий індекÑний файл пакунка Ð´Ð»Ñ '%s"
+
+#, c-format
+msgid "non delta: %d object"
+msgid_plural "non delta: %d objects"
+msgstr[0] "не дельта: %d об’єкт"
+msgstr[1] "не дельта: %d об’єкта"
+msgstr[2] "не дельта: %d об’єктів"
+
+#, c-format
+msgid "chain length = %d: %lu object"
+msgid_plural "chain length = %d: %lu objects"
+msgstr[0] "довжина ланцюжка = %d: %lu об’єкт"
+msgstr[1] "довжина ланцюжка = %d: %lu об’єкти"
+msgstr[2] "довжина ланцюжка = %d: %lu об’єктів"
+
+msgid "Cannot come back to cwd"
+msgstr "Ðеможливо повернутиÑÑ Ð´Ð¾ поточної робочої директорії"
+
+#, c-format
+msgid "bad %s"
+msgstr "невірний %s"
+
+#, c-format
+msgid "unknown hash algorithm '%s'"
+msgstr "невідомий хеш-алгоритм '%s'"
+
+msgid "--stdin requires a git repository"
+msgstr "--stdin потребує наÑвноÑÑ‚Ñ– git Ñховища"
+
+msgid "--verify with no packfile name given"
+msgstr "--verify без Ð·Ð°Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¸Ð¼ÐµÐ½Ñ– файла пакунка"
+
+msgid "fsck error in pack objects"
+msgstr "помилка fsck в об’єктах пакунка"
+
+msgid ""
+"git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
+" [--separate-git-dir <git-dir>] [--object-format=<format>]\n"
+" [--ref-format=<format>]\n"
+" [-b <branch-name> | --initial-branch=<branch-name>]\n"
+" [--shared[=<permissions>]] [<directory>]"
+msgstr ""
+"git init [-q | --quiet] [--bare] [--template=<шаблон-директоріÑ>]\n"
+" [--separate-git-dir <git-директоріÑ>] [--object-format=<формат>]\n"
+" [--ref-format=<формат>]\n"
+" [-b <назва-гілки> | --initial-branch=<назва-гілки>]\n"
+" [--shared[=<дозволи>]] [<директоріÑ>]"
+
+msgid "permissions"
+msgstr "дозволи"
+
+msgid "specify that the git repository is to be shared amongst several users"
+msgstr "вказати, що git Ñховище буде Ñпільним Ð´Ð»Ñ ÐºÑ–Ð»ÑŒÐºÐ¾Ñ… кориÑтувачів"
+
+msgid "override the name of the initial branch"
+msgstr "перевизначити назву початкової гілки"
+
+msgid "hash"
+msgstr "хеш"
+
+msgid "specify the hash algorithm to use"
+msgstr "вказати, Ñкий алгоритм Ñ…ÐµÑˆÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¸ÐºÐ¾Ñ€Ð¸Ñтовувати"
+
+#, c-format
+msgid "cannot mkdir %s"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ mkdir %s"
+
+#, c-format
+msgid "cannot chdir to %s"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ chdir %s"
+
+#, c-format
+msgid ""
+"%s (or --work-tree=<directory>) not allowed without specifying %s (or --git-"
+"dir=<directory>)"
+msgstr ""
+"%s (або --work-tree=<директоріÑ>) не дозволено без вказівки %s (або --git-"
+"dir=<каталог>)"
+
+#, c-format
+msgid "Cannot access work tree '%s'"
+msgstr "Ðеможливо отримати доÑтуп до робочого дерева \"%s\""
+
+msgid "--separate-git-dir incompatible with bare repository"
+msgstr "--separate-git-dir неÑуміÑна з порожнім Ñховищем"
+
+msgid ""
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<key>|<keyAlias>)[(=|:)<value>])...]\n"
+" [--parse] [<file>...]"
+msgstr ""
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer <ключ>|"
+"<аліаÑКлюча>[(=|:)<значеннÑ>])...]\n"
+" [--parse] [<файл>...]"
+
+msgid "edit files in place"
+msgstr "редагувати файли на міÑцÑÑ…"
+
+msgid "trim empty trailers"
+msgstr "обрізати порожні причепи"
+
+msgid "placement"
+msgstr "розміщеннÑ"
+
+msgid "where to place the new trailer"
+msgstr "де розміÑтити новий причіп"
+
+msgid "action if trailer already exists"
+msgstr "що робити, Ñкщо причіп вже Ñ–Ñнує"
+
+msgid "action if trailer is missing"
+msgstr "що робити, Ñкщо причіп відÑутній"
+
+msgid "output only the trailers"
+msgstr "виводити лише причепи"
+
+msgid "do not apply trailer.* configuration variables"
+msgstr "не заÑтоÑовувати конфігураційні змінні trailer.*"
+
+msgid "reformat multiline trailer values as single-line values"
+msgstr "переформатувати багаторÑдкові Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¸Ñ‡ÐµÐ¿Ñ–Ð² в однорÑдкові"
+
+msgid "alias for --only-trailers --only-input --unfold"
+msgstr "Ð°Ð»Ñ–Ð°Ñ Ð´Ð»Ñ --only-trailers --only-input --unfold"
+
+msgid "do not treat \"---\" as the end of input"
+msgstr "не оброблÑти \"---\" Ñк кінець вводу"
+
+msgid "trailer(s) to add"
+msgstr "причіп(и) Ð´Ð»Ñ Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ"
+
+msgid "--trailer with --only-input does not make sense"
+msgstr "--trailer з --only-input не має ÑенÑу"
+
+msgid "no input file given for in-place editing"
+msgstr "не надано вхідного файлу Ð´Ð»Ñ Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð° міÑці"
+
+msgid "git log [<options>] [<revision-range>] [[--] <path>...]"
+msgstr "git log [<опції>] [<діапазон-ревізій>] [[--] <шлÑÑ…>...]"
+
+msgid "git show [<options>] <object>..."
+msgstr "git show [<опції>] <обʼєкт>..."
+
+#, c-format
+msgid "invalid --decorate option: %s"
+msgstr "неприпуÑтима --decorate опціÑ: %s"
+
+msgid "suppress diff output"
+msgstr "приховати вивід diff"
+
+msgid "show source"
+msgstr "показати джерело"
+
+msgid "clear all previously-defined decoration filters"
+msgstr "очиÑтити вÑÑ– раніше визначені фільтри оздобленнÑ"
+
+msgid "only decorate refs that match <pattern>"
+msgstr "оздоблювати лише поÑиланнÑ, що відповідають <шаблону>"
+
+msgid "do not decorate refs that match <pattern>"
+msgstr "не оздоблювати поÑиланнÑ, що відповідають <шаблону>"
+
+msgid "decorate options"
+msgstr "опції оздобленнÑ"
+
+msgid ""
+"trace the evolution of line range <start>,<end> or function :<funcname> in "
+"<file>"
+msgstr ""
+"проÑтежити еволюцію діапазону Ñ€Ñдків <початок>,<кінець> або функції :<назва-"
+"функції> в <файлі>"
+
+#, c-format
+msgid "unrecognized argument: %s"
+msgstr "нерозпізнаний аргумент: %s"
+
+msgid "-L<range>:<file> cannot be used with pathspec"
+msgstr "-L<діапазон>:<файл> не можна викориÑтовувати з визначником шлÑху"
+
+#, c-format
+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: невірний файл"
+
+#, c-format
+msgid "could not read object %s"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ об’єкт %s"
+
+#, c-format
+msgid "unknown type: %d"
+msgstr "невідомий тип: %d"
+
+#, c-format
+msgid "%s: invalid cover from description mode"
+msgstr "%s: невірна обкладинка з режиму опиÑу"
+
+msgid "format.headers without value"
+msgstr "format.headers без значеннÑ"
+
+#, c-format
+msgid "cannot open patch file %s"
+msgstr "не вдаєтьÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ файл латки %s"
+
+msgid "need exactly one range"
+msgstr "потрібен лишень один діапазон"
+
+msgid "not a range"
+msgstr "не діапазон"
+
+#, c-format
+msgid "unable to read branch description file '%s'"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ файл опиÑу гілки \"%s\""
+
+msgid "cover letter needs email format"
+msgstr "Ñупровідний лиÑÑ‚ має бути у форматі електронної пошти"
+
+msgid "failed to create cover-letter file"
+msgstr "не вдалоÑÑ Ñтворити файл Ñупровідного лиÑта"
+
+#, c-format
+msgid "insane in-reply-to: %s"
+msgstr "неприпуÑтимий in-reply-to: %s"
+
+msgid "git format-patch [<options>] [<since> | <revision-range>]"
+msgstr "git format-patch [<опції>] [<відколи> | <діапазон-ревізій>]"
+
+msgid "two output directories?"
+msgstr "дві вихідні директорії?"
+
+#, c-format
+msgid "unknown commit %s"
+msgstr "невідомий коміт %s"
+
+#, c-format
+msgid "failed to resolve '%s' as a valid ref"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ñ‚Ð¸ \"%s\" Ñк припуÑтиме поÑиланнÑ"
+
+msgid "could not find exact merge base"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ точну базу Ð´Ð»Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ"
+
+msgid ""
+"failed to get upstream, if you want to record base commit automatically,\n"
+"please use git branch --set-upstream-to to track a remote branch.\n"
+"Or you could specify base commit by --base=<base-commit-id> manually"
+msgstr ""
+"не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ першоджерельне Ñховище. Якщо ви хочете запиÑати базовий "
+"коміт автоматично,\n"
+"будь лаÑка, ÑкориÑтайтеÑÑŒ git branch --set-upstream-to Ð´Ð»Ñ Ð²Ñ–Ð´ÑÑ‚ÐµÐ¶ÑƒÐ²Ð°Ð½Ð½Ñ "
+"віддаленої гілки.\n"
+"Ðбо ви можете вказати базовий коміт вручну за допомогою --"
+"base=<ідентифікатор-базового-коміту>"
+
+msgid "failed to find exact merge base"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ точну базу Ð´Ð»Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ"
+
+msgid "base commit should be the ancestor of revision list"
+msgstr "базовий коміт має бути предком ÑпиÑку ревізій"
+
+msgid "base commit shouldn't be in revision list"
+msgstr "базового коміту не має бути в ÑпиÑку ревізій"
+
+msgid "cannot get patch id"
+msgstr "неможливо отримати ідентифікатор латки"
+
+msgid "failed to infer range-diff origin of current series"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ Ð¿Ð¾Ñ…Ð¾Ð´Ð¶ÐµÐ½Ð½Ñ Ñ€Ñ–Ð·Ð½Ð¸Ñ†Ñ– діапазонів поточного Ñ€Ñду"
+
+#, c-format
+msgid "using '%s' as range-diff origin of current series"
+msgstr "викориÑÑ‚Ð°Ð½Ð½Ñ \"%s\" Ñк Ð¿Ð¾Ñ…Ð¾Ð´Ð¶ÐµÐ½Ð½Ñ Ñ€Ñ–Ð·Ð½Ð¸Ñ†Ñ– діапазонів поточного Ñ€Ñду"
+
+msgid "use [PATCH n/m] even with a single patch"
+msgstr "викориÑтовуйте [PATCH n/m] навіть з однією латкою"
+
+msgid "use [PATCH] even with multiple patches"
+msgstr "викориÑтовуйте [PATCH] навіть з кількома латками"
+
+msgid "print patches to standard out"
+msgstr "вивеÑти латки на Ñтандартний вивід"
+
+msgid "generate a cover letter"
+msgstr "ÑклаÑти Ñупровідний лиÑÑ‚"
+
+msgid "use simple number sequence for output file names"
+msgstr "викориÑтати проÑту поÑлідовніÑÑ‚ÑŒ чиÑел Ð´Ð»Ñ Ð½Ð°Ð·Ð² вихідних файлів"
+
+msgid "sfx"
+msgstr "ÑуфікÑ"
+
+msgid "use <sfx> instead of '.patch'"
+msgstr "викориÑтати <ÑуфікÑ> заміÑÑ‚ÑŒ \".patch\""
+
+msgid "start numbering patches at <n> instead of 1"
+msgstr "почати нумерацію латок з <н> заміÑÑ‚ÑŒ 1"
+
+msgid "reroll-count"
+msgstr "кількіÑÑ‚ÑŒ перекидань"
+
+msgid "mark the series as Nth re-roll"
+msgstr "позначити Ñ€Ñд Ñк N-не перекиданнÑ"
+
+msgid "max length of output filename"
+msgstr "макÑимальна довжина назви вихідного файлу"
+
+msgid "use [RFC PATCH] instead of [PATCH]"
+msgstr "викориÑтати [RFC PATCH] заміÑÑ‚ÑŒ [PATCH]"
+
+msgid "cover-from-description-mode"
+msgstr "cover-from-description-mode"
+
+msgid "generate parts of a cover letter based on a branch's description"
+msgstr "ÑклаÑти чаÑтини Ñупровідного лиÑта на оÑнові опиÑу гілки"
+
+msgid "use branch description from file"
+msgstr "викориÑтовувати Ð¾Ð¿Ð¸Ñ Ð³Ñ–Ð»ÐºÐ¸ з файлу"
+
+msgid "use [<prefix>] instead of [PATCH]"
+msgstr "викориÑтати [<префікÑ>] заміÑÑ‚ÑŒ [PATCH]"
+
+msgid "store resulting files in <dir>"
+msgstr "зберегти результуючі файли в <директорії>"
+
+msgid "don't strip/add [PATCH]"
+msgstr "не видалÑти/додавати [PATCH]"
+
+msgid "don't output binary diffs"
+msgstr "не виводити бінарні різниці"
+
+msgid "output all-zero hash in From header"
+msgstr "вивеÑти хеш з уÑіма нулÑми в заголовку From"
+
+msgid "don't include a patch matching a commit upstream"
+msgstr ""
+"не включати латки, Ñкі мають відповідні коміти в першоджерельному Ñховищі"
+
+msgid "show patch format instead of default (patch + stat)"
+msgstr "показати формат латки заміÑÑ‚ÑŒ Ñтандартного (латка + підÑумок)"
+
+msgid "Messaging"
+msgstr "ПовідомленнÑ"
+
+msgid "header"
+msgstr "заголовок"
+
+msgid "add email header"
+msgstr "додати заголовок лиÑта"
+
+msgid "email"
+msgstr "електронна адреÑа"
+
+msgid "add To: header"
+msgstr "додати To: заголовок"
+
+msgid "add Cc: header"
+msgstr "додати Cc: заголовок"
+
+msgid "ident"
+msgstr "оÑобиÑÑ‚Ñ–ÑÑ‚ÑŒ"
+
+msgid "set From address to <ident> (or committer ident if absent)"
+msgstr ""
+"вÑтановити From адреÑу в <оÑобиÑÑ‚Ñ–ÑÑ‚ÑŒ> (або оÑобиÑÑ‚Ñ–ÑÑ‚ÑŒ комітера, Ñкщо "
+"відÑутнÑ)"
+
+msgid "message-id"
+msgstr "ідентифікатор-повідомленнÑ"
+
+msgid "make first mail a reply to <message-id>"
+msgstr "зробити перший лиÑÑ‚ відповіддю на <id-повідомленнÑ>"
+
+msgid "boundary"
+msgstr "межа"
+
+msgid "attach the patch"
+msgstr "прикріпити латку"
+
+msgid "inline the patch"
+msgstr "вÑтавити латку"
+
+msgid "enable message threading, styles: shallow, deep"
+msgstr "увімкнути потік повідомлень, Ñтилі: дрібний, глибокий"
+
+msgid "signature"
+msgstr "підпиÑ"
+
+msgid "add a signature"
+msgstr "додати підпиÑ"
+
+msgid "base-commit"
+msgstr "базовий коміт"
+
+msgid "add prerequisite tree info to the patch series"
+msgstr "додати інформацію про дерево передумов до Ñерії латок"
+
+msgid "add a signature from a file"
+msgstr "додати Ð¿Ñ–Ð´Ð¿Ð¸Ñ Ð· файлу"
+
+msgid "don't print the patch filenames"
+msgstr "не виводити назви файлів латок"
+
+msgid "show progress while generating patches"
+msgstr "показувати Ð¿Ñ€Ð¾Ð³Ñ€ÐµÑ Ð¿Ñ–Ð´ Ñ‡Ð°Ñ Ð³ÐµÐ½ÐµÑ€Ð°Ñ†Ñ–Ñ— патчів"
+
+msgid "show changes against <rev> in cover letter or single patch"
+msgstr ""
+"показувати зміни проти <ревізіÑ> у Ñупровідному лиÑÑ‚Ñ– або окремій латці"
+
+msgid "show changes against <refspec> in cover letter or single patch"
+msgstr ""
+"показувати зміни проти <визначник-поÑиланнÑ> у Ñупровідному лиÑÑ‚Ñ– або "
+"окремій латці"
+
+msgid "percentage by which creation is weighted"
+msgstr "відÑоток, за Ñким зважуєтьÑÑ ÑтвореннÑ"
+
+msgid "show in-body From: even if identical to the e-mail header"
+msgstr "показувати in-body From: навіть Ñкщо він ідентичний заголовку лиÑта"
+
+#, c-format
+msgid "invalid ident line: %s"
+msgstr "неприпуÑтимий Ñ€Ñдок оÑобиÑтоÑÑ‚Ñ–: %s"
+
+msgid "--name-only does not make sense"
+msgstr "--name-only не має ÑенÑу"
+
+msgid "--name-status does not make sense"
+msgstr "--name-status не має ÑенÑу"
+
+msgid "--check does not make sense"
+msgstr "--check не має ÑенÑу"
+
+msgid "--remerge-diff does not make sense"
+msgstr "--remerge-diff не має ÑенÑу"
+
+#, c-format
+msgid "could not create directory '%s'"
+msgstr "не вдалоÑÑ Ñтворити директорію \"%s\""
+
+msgid "--interdiff requires --cover-letter or single patch"
+msgstr "--interdiff вимагає --cover-letter або окремої латки"
+
+msgid "Interdiff:"
+msgstr "Ð Ñ–Ð·Ð½Ð¸Ñ†Ñ Ð· попередньою Ñерією латок:"
+
+#, c-format
+msgid "Interdiff against v%d:"
+msgstr "Ð Ñ–Ð·Ð½Ð¸Ñ†Ñ Ð· v%d:"
+
+msgid "--range-diff requires --cover-letter or single patch"
+msgstr "--range-diff потребує --cover-letter або окремої латки"
+
+msgid "Range-diff:"
+msgstr "Ð Ñ–Ð·Ð½Ð¸Ñ†Ñ Ð´Ñ–Ð°Ð¿Ð°Ð·Ð¾Ð½Ñƒ з попередньою Ñерією латок:"
+
+#, c-format
+msgid "Range-diff against v%d:"
+msgstr "Ð Ñ–Ð·Ð½Ð¸Ñ†Ñ Ð´Ñ–Ð°Ð¿Ð°Ð·Ð¾Ð½Ñƒ з v%d:"
+
+#, c-format
+msgid "unable to read signature file '%s'"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ файл підпиÑу \"%s\""
+
+msgid "Generating patches"
+msgstr "Ð¡Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð»Ð°Ñ‚Ð¾Ðº"
+
+msgid "failed to create output files"
+msgstr "не вдалоÑÑ Ñтворити вихідні файли"
+
+msgid "git cherry [-v] [<upstream> [<head> [<limit>]]]"
+msgstr "git cherry [-v] [<першоджерельне-Ñховище> [<голова> [<ліміт>]]]]"
+
+#, c-format
+msgid ""
+"Could not find a tracked remote branch, please specify <upstream> manually.\n"
+msgstr ""
+"Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ віддалено відÑтежувану гілку, будь лаÑка, вкажіть "
+"<першоджерельне-Ñховище> вручну.\n"
+
+#, c-format
+msgid "could not get object info about '%s'"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ інформацію про обʼєкт \"%s\""
+
+#, c-format
+msgid "bad ls-files format: element '%s' does not start with '('"
+msgstr "невірний ls-files формат: елемент \"%s\" не починаєтьÑÑ Ð· \"(\""
+
+#, c-format
+msgid "bad ls-files format: element '%s' does not end in ')'"
+msgstr "невірний ls-files формат: елемент \"%s\" не закінчуєтьÑÑ Ð½Ð° \")\""
+
+#, c-format
+msgid "bad ls-files format: %%%.*s"
+msgstr "невірний ls-files формат: %%%.*s"
+
+msgid "git ls-files [<options>] [<file>...]"
+msgstr "git ls-files [<опції>] [<файл>...]"
+
+msgid "separate paths with the NUL character"
+msgstr "відокремити шлÑхи Ñимволом NUL"
+
+msgid "identify the file status with tags"
+msgstr "визначити Ñтан файлу за допомогою тегів"
+
+msgid "use lowercase letters for 'assume unchanged' files"
+msgstr "викориÑтати малі літери Ð´Ð»Ñ \"вважати незмінними\" файлів"
+
+msgid "use lowercase letters for 'fsmonitor clean' files"
+msgstr "викориÑтати малі літери Ð´Ð»Ñ \"fsmonitor clean\" файлів"
+
+msgid "show cached files in the output (default)"
+msgstr "показати кешовані файли у виводі (за замовчуваннÑм)"
+
+msgid "show deleted files in the output"
+msgstr "показати видалені файли у виводі"
+
+msgid "show modified files in the output"
+msgstr "показати змінені файли у виводі"
+
+msgid "show other files in the output"
+msgstr "показати інші файли у виводі"
+
+msgid "show ignored files in the output"
+msgstr "показати ігноровані файли у виводі"
+
+msgid "show staged contents' object name in the output"
+msgstr "показати назву обʼєкта індекÑованого вміÑту у виводі"
+
+msgid "show files on the filesystem that need to be removed"
+msgstr "показати файли файлової ÑиÑтеми, Ñкі потрібно видалити"
+
+msgid "show 'other' directories' names only"
+msgstr "показати тільки назви \"інших\" директорій"
+
+msgid "show line endings of files"
+msgstr "показати Ð·Ð°ÐºÑ–Ð½Ñ‡ÐµÐ½Ð½Ñ Ñ€Ñдків файлів"
+
+msgid "don't show empty directories"
+msgstr "не показувати порожні директорії"
+
+msgid "show unmerged files in the output"
+msgstr "показати не злиті файли у виводі"
+
+msgid "show resolve-undo information"
+msgstr "показати resolve-undo інформацію"
+
+msgid "skip files matching pattern"
+msgstr "пропуÑтити файли, Ñкі відповідають шаблону"
+
+msgid "read exclude patterns from <file>"
+msgstr "читати шаблони Ð²Ð¸ÐºÐ»ÑŽÑ‡ÐµÐ½Ð½Ñ Ð· <файлу>"
+
+msgid "read additional per-directory exclude patterns in <file>"
+msgstr "читати додаткові шаблони Ð²Ð¸ÐºÐ»ÑŽÑ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ ÐºÐ¾Ð¶Ð½Ð¾Ñ— директорії з <файлу>"
+
+msgid "add the standard git exclusions"
+msgstr "додати Ñтандартні git виключеннÑ"
+
+msgid "make the output relative to the project top directory"
+msgstr "зробити Ð²Ð¸Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð²Ñ–Ð´Ð½Ð¾Ñно верхньої директорії проекту"
+
+msgid "if any <file> is not in the index, treat this as an error"
+msgstr "Ñкщо ÑкогоÑÑŒ <файлу> немає в індекÑÑ–, вважати це помилкою"
+
+msgid "tree-ish"
+msgstr "деревоподібне-джерело"
+
+msgid "pretend that paths removed since <tree-ish> are still present"
+msgstr ""
+"вдавати, що шлÑхи, видалені піÑÐ»Ñ <деревоподібного-джерела>, вÑе ще приÑутні"
+
+msgid "show debugging data"
+msgstr "показати дані відлагодженнÑ"
+
+msgid "suppress duplicate entries"
+msgstr "не показувати дублікати запиÑів"
+
+msgid "show sparse directories in the presence of a sparse index"
+msgstr "показувати розріджені директорії при наÑвноÑÑ‚Ñ– розрідженого індекÑу"
+
+msgid ""
+"--format cannot be used with -s, -o, -k, -t, --resolve-undo, --deduplicate, "
+"--eol"
+msgstr ""
+"--format не можна викориÑтовувати з -s, -o, -k, -t, --resolve-undo, --"
+"deduplicate, --eol"
+
+msgid ""
+"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
+" [--symref] [<repository> [<patterns>...]]"
+msgstr ""
+"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<виконавчий-файл>]\n"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<ключ>]\n"
+" [--symref] [<Ñховище> [<шаблони>...]]"
+
+msgid "do not print remote URL"
+msgstr "не виводити віддалену URL-адреÑу"
+
+msgid "exec"
+msgstr "виконавчий файл"
+
+msgid "path of git-upload-pack on the remote host"
+msgstr "шлÑÑ… до git-upload-pack на віддаленому Ñервері"
+
+msgid "limit to tags"
+msgstr "обмежити до тегів"
+
+msgid "limit to heads"
+msgstr "обмежити до голів"
+
+msgid "do not show peeled tags"
+msgstr "не показувати очищені теги"
+
+msgid "take url.<base>.insteadOf into account"
+msgstr "враховувати url.<база>.insteadOf"
+
+msgid "exit with exit code 2 if no matching refs are found"
+msgstr "вийти з кодом виходу 2, Ñкщо не знайдено відповідних поÑилань"
+
+msgid "show underlying ref in addition to the object pointed by it"
+msgstr "показувати базове поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ð° додаток до об’єкта, на Ñкий воно вказує"
+
+msgid "git ls-tree [<options>] <tree-ish> [<path>...]"
+msgstr "git ls-tree [<опції>] <деревоподібне-джерело> [<шлÑÑ…>...]"
+
+#, c-format
+msgid "bad ls-tree format: element '%s' does not start with '('"
+msgstr "невірний формат ls-tree: елемент \"%s\" не починаєтьÑÑ Ð· \"(\""
+
+#, c-format
+msgid "bad ls-tree format: element '%s' does not end in ')'"
+msgstr "невірний формат ls-tree: елемент \"%s\" не закінчуєтьÑÑ Ð½Ð° \")\""
+
+#, c-format
+msgid "bad ls-tree format: %%%.*s"
+msgstr "невірний формат ls-tree: %%%.*s"
+
+msgid "only show trees"
+msgstr "показувати тільки дерева"
+
+msgid "recurse into subtrees"
+msgstr "рекурÑивно в піддеревах"
+
+msgid "show trees when recursing"
+msgstr "відображати дерева при рекурÑÑ–Ñ—"
+
+msgid "terminate entries with NUL byte"
+msgstr "завершувати запиÑи байтом NUL"
+
+msgid "include object size"
+msgstr "включити розмір об’єкта"
+
+msgid "list only filenames"
+msgstr "показувати лише назви файлів"
+
+msgid "list only objects"
+msgstr "показати лише обʼєкти"
+
+msgid "use full path names"
+msgstr "викориÑтовувати повні назви шлÑхів"
+
+msgid "list entire tree; not just current directory (implies --full-name)"
+msgstr ""
+"показувати вÑе дерево, а не лише поточну директорію (маєтьÑÑ Ð½Ð° увазі --full-"
+"name)."
+
+msgid "--format can't be combined with other format-altering options"
+msgstr "--format не можна комбінувати з іншими опціÑми зміни формату"
+
+#. TRANSLATORS: keep <> in "<" mail ">" info.
+msgid "git mailinfo [<options>] <msg> <patch> < mail >info"
+msgstr "git mailinfo [<опції>] <допиÑ> <латка> < mail >info"
+
+msgid "keep subject"
+msgstr "не змінювати тему"
+
+msgid "keep non patch brackets in subject"
+msgstr "зберігати дужки, що не ÑтоÑуютьÑÑ Ð»Ð°Ñ‚Ð¾Ðº, в темі"
+
+msgid "copy Message-ID to the end of commit message"
+msgstr "копіювати Message-ID в кінець допиÑу до коміту"
+
+msgid "re-code metadata to i18n.commitEncoding"
+msgstr "перекодувати метадані в i18n.commitEncoding"
+
+msgid "disable charset re-coding of metadata"
+msgstr "вимкнути Ð¿ÐµÑ€ÐµÐºÐ¾Ð´ÑƒÐ²Ð°Ð½Ð½Ñ Ð¼ÐµÑ‚Ð°Ð´Ð°Ð½Ð¸Ñ…"
+
+msgid "encoding"
+msgstr "кодуваннÑ"
+
+msgid "re-code metadata to this encoding"
+msgstr "перекодувати метадані в це кодуваннÑ"
+
+msgid "use scissors"
+msgstr "викориÑтовувати ножиці"
+
+msgid "<action>"
+msgstr "<діÑ>"
+
+msgid "action when quoted CR is found"
+msgstr "Ð´Ñ–Ñ Ð¿Ñ€Ð¸ знаходженні цитованого CR"
+
+msgid "use headers in message's body"
+msgstr "викориÑтовувати заголовки в тілі повідомленнÑ"
+
+msgid "reading patches from stdin/tty..."
+msgstr "Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ð»Ð°Ñ‚Ð¾Ðº з stdin/tty..."
+
+#, c-format
+msgid "empty mbox: '%s'"
+msgstr "порожній mbox: \"%s\""
+
+msgid "git merge-base [-a | --all] <commit> <commit>..."
+msgstr "git merge-base [-a | --all] <коміт> <коміт>..."
+
+msgid "git merge-base [-a | --all] --octopus <commit>..."
+msgstr "git merge-base [-a | --all] --octopus <коміт>..."
+
+msgid "git merge-base --is-ancestor <commit> <commit>"
+msgstr "git merge-base --is-ancestor <коміт> <коміт>"
+
+msgid "git merge-base --independent <commit>..."
+msgstr "git merge-base --independent <коміт>..."
+
+msgid "git merge-base --fork-point <ref> [<commit>]"
+msgstr "git merge-base --fork-point <поÑиланнÑ> [<коміт>]"
+
+msgid "output all common ancestors"
+msgstr "вивеÑти вÑÑ–Ñ… Ñпільних предків"
+
+msgid "find ancestors for a single n-way merge"
+msgstr "знайти предків Ð´Ð»Ñ Ð¾Ð´Ð½Ð¾Ð³Ð¾ n-Ñтороннього злиттÑ"
+
+msgid "list revs not reachable from others"
+msgstr "показати ревізії, недоÑтупні з інших джерел"
+
+msgid "is the first one ancestor of the other?"
+msgstr "чи є перша з них предком другої?"
+
+msgid "find where <commit> forked from reflog of <ref>"
+msgstr "знайти, де <коміт> відгалузивÑÑ Ð²Ñ–Ð´ журналу поÑилань <поÑиланнÑ>"
+
+msgid ""
+"git merge-file [<options>] [-L <name1> [-L <orig> [-L <name2>]]] <file1> "
+"<orig-file> <file2>"
+msgstr ""
+"git merge-file [<опції>] [-L <назва1> [-L <оріг> [-L <назва2>]]] <файл1> "
+"<оріг-файл> <файл2>"
+
+msgid ""
+"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
+"\"histogram\""
+msgstr ""
+"Ð¾Ð¿Ñ†Ñ–Ñ diff-algorithm приймає Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"myers\", \"minimal\", \"patience\" "
+"та \"histogram\""
+
+msgid "send results to standard output"
+msgstr "надÑилати результати до Ñтандартного виводу"
+
+msgid "use object IDs instead of filenames"
+msgstr "викориÑтовувати ідентифікатори обʼєктів заміÑÑ‚ÑŒ назв файлів"
+
+msgid "use a diff3 based merge"
+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 "<алгоритм>"
+
+msgid "choose a diff algorithm"
+msgstr "вибрати алгоритм різниці"
+
+msgid "for conflicts, use this marker size"
+msgstr "у разі конфліктів викориÑтовувати цей розмір маркера"
+
+msgid "do not warn about conflicts"
+msgstr "не попереджати про конфлікти"
+
+msgid "set labels for file1/orig-file/file2"
+msgstr "вÑтановити мітки Ð´Ð»Ñ Ñ„Ð°Ð¹Ð»1/оріг-файл/файл2"
+
+#, c-format
+msgid "object '%s' does not exist"
+msgstr "об’єкт \"%s\" не Ñ–Ñнує"
+
+msgid "Could not write object file"
+msgstr "Ðе вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати файл обʼєкта"
+
+#, c-format
+msgid "unknown option %s"
+msgstr "невідома Ð¾Ð¿Ñ†Ñ–Ñ %s"
+
+#, c-format
+msgid "could not parse object '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ обʼєкт \"%s\""
+
+#, c-format
+msgid "cannot handle more than %d base. Ignoring %s."
+msgid_plural "cannot handle more than %d bases. Ignoring %s."
+msgstr[0] "неможливо обробити більш ніж %d базу. Ð†Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ %s."
+msgstr[1] "неможливо обробити більш ніж %d бази. Ð†Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ %s."
+msgstr[2] "неможливо обробити більш ніж %d баз. Ð†Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ %s."
+
+msgid "not handling anything other than two heads merge."
+msgstr "не оброблюєтьÑÑ Ð½Ñ–Ñ‡Ð¾Ð³Ð¾, окрім Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð´Ð²Ð¾Ñ… верхівок."
+
+#, c-format
+msgid "could not resolve ref '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð²Ê¼Ñзати поÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\""
+
+#, c-format
+msgid "Merging %s with %s\n"
+msgstr "Ð—Ð»Ð¸Ñ‚Ñ‚Ñ %s з %s\n"
+
+msgid "not something we can merge"
+msgstr "не те, що ми в змозі об’єднати"
+
+msgid "refusing to merge unrelated histories"
+msgstr "відмовлено в об’єднанні непов’Ñзаних Ñ–Ñторій"
+
+msgid "failure to merge"
+msgstr "не вдалоÑÑ Ð·Ð»Ð¸Ñ‚Ð¸"
+
+msgid "git merge-tree [--write-tree] [<options>] <branch1> <branch2>"
+msgstr "git merge-tree [--write-tree] [<опції>] <гілка1> <гілка2>"
+
+msgid "git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"
+msgstr "git merge-tree [--trivial-merge] <базове-дерево> <гілка1> <гілка2>"
+
+msgid "do a real merge instead of a trivial merge"
+msgstr "зробити Ñправжнє Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð·Ð°Ð¼Ñ–ÑÑ‚ÑŒ тривіального злиттÑ"
+
+msgid "do a trivial merge only"
+msgstr "зробити лише тривіальне злиттÑ"
+
+msgid "also show informational/conflict messages"
+msgstr "також показувати інформаційні/конфліктні повідомленнÑ"
+
+msgid "list filenames without modes/oids/stages"
+msgstr "вивеÑти назви файлів без режимів/oid/Ñтадій"
+
+msgid "allow merging unrelated histories"
+msgstr "дозволити Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½ÐµÐ¿Ð¾Ð²â€™Ñзаних Ñ–Ñторій"
+
+msgid "perform multiple merges, one per line of input"
+msgstr "виконати кілька злиттів, по одному на кожен Ñ€Ñдок вводу"
+
+msgid "specify a merge-base for the merge"
+msgstr "вказати базу Ð´Ð»Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ"
+
+msgid "option=value"
+msgstr "опціÑ=значеннÑ"
+
+msgid "option for selected merge strategy"
+msgstr "Ð¾Ð¿Ñ†Ñ–Ñ Ð´Ð»Ñ Ð¾Ð±Ñ€Ð°Ð½Ð¾Ñ— Ñтратегії злиттÑ"
+
+msgid "--trivial-merge is incompatible with all other options"
+msgstr "--trivial-merge неÑуміÑна з уÑіма іншими опціÑми"
+
+#, c-format
+msgid "unknown strategy option: -X%s"
+msgstr "невідомий варіант Ñтратегії: -X%s"
+
+#, c-format
+msgid "malformed input line: '%s'."
+msgstr "невірно Ñформований Ñ€Ñдок вводу: \"%s\"."
+
+#, c-format
+msgid "merging cannot continue; got unclean result of %d"
+msgstr "неможливо продовжити злиттÑ; отримано брудний результат Ð´Ð»Ñ %d"
+
+msgid "git merge [<options>] [<commit>...]"
+msgstr "git merge [<опції>] [<коміт>...]"
+
+msgid "switch `m' requires a value"
+msgstr "перемикач \"m\" потребує значеннÑ"
+
+#, c-format
+msgid "option `%s' requires a value"
+msgstr "Ð¾Ð¿Ñ†Ñ–Ñ \"%s\" потребує значеннÑ"
+
+#, c-format
+msgid "Could not find merge strategy '%s'.\n"
+msgstr "Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ Ñтратегію Ð·Ð»Ð¸Ñ‚Ñ‚Ñ \"%s\".\n"
+
+#, c-format
+msgid "Available strategies are:"
+msgstr "ДоÑтупні Ñтратегії:"
+
+#, c-format
+msgid "Available custom strategies are:"
+msgstr "ДоÑтупні Ñпеціальні Ñтратегії:"
+
+msgid "do not show a diffstat at the end of the merge"
+msgstr "не показувати diffstat наприкінці злиттÑ"
+
+msgid "show a diffstat at the end of the merge"
+msgstr "показувати diffstat наприкінці злиттÑ"
+
+msgid "(synonym to --stat)"
+msgstr "(Ñинонім до --stat)"
+
+msgid "add (at most <n>) entries from shortlog to merge commit message"
+msgstr ""
+"додати (не більше <н>) запиÑів з короткого журналу у Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту злиттÑ"
+
+msgid "create a single commit instead of doing a merge"
+msgstr "Ñтворити єдиний коміт заміÑÑ‚ÑŒ злиттÑ"
+
+msgid "perform a commit if the merge succeeds (default)"
+msgstr "виконати коміт, Ñкщо Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð¿Ñ€Ð¾Ð¹ÑˆÐ»Ð¾ уÑпішно (за замовчуваннÑм)"
+
+msgid "edit message before committing"
+msgstr "редагувати Ð´Ð¾Ð¿Ð¸Ñ Ð¿ÐµÑ€ÐµÐ´ комітом"
+
+msgid "allow fast-forward (default)"
+msgstr "дозволити Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¿ÐµÑ€ÐµÐ´ (за замовчуваннÑм)"
+
+msgid "abort if fast-forward is not possible"
+msgstr "перервати, Ñкщо Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¿ÐµÑ€ÐµÐ´ неможливе"
+
+msgid "verify that the named commit has a valid GPG signature"
+msgstr "перевірÑти, чи має коміт дійÑний GPG-підпиÑ"
+
+msgid "strategy"
+msgstr "ÑтратегіÑ"
+
+msgid "merge strategy to use"
+msgstr "Ñку Ñтратегію Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð²Ð¸ÐºÐ¾Ñ€Ð¸Ñтовувати"
+
+msgid "merge commit message (for a non-fast-forward merge)"
+msgstr "Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту Ð·Ð»Ð¸Ñ‚Ñ‚Ñ (Ð´Ð»Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð±ÐµÐ· Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¿ÐµÑ€ÐµÐ´)"
+
+msgid "use <name> instead of the real target"
+msgstr "викориÑтовувати <назву> заміÑÑ‚ÑŒ реальної цілі"
+
+msgid "abort the current in-progress merge"
+msgstr "перервати поточне злиттÑ"
+
+msgid "--abort but leave index and working tree alone"
+msgstr "--abort, але зберегти Ñтан індекÑу Ñ– робочого дерева"
+
+msgid "continue the current in-progress merge"
+msgstr "продовжити поточний Ð¿Ñ€Ð¾Ñ†ÐµÑ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ"
+
+msgid "bypass pre-merge-commit and commit-msg hooks"
+msgstr "обходити pre-merge-commit та commit-msg гачки"
+
+msgid "could not run stash."
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ stash."
+
+msgid "stash failed"
+msgstr "не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ до Ñхову"
+
+#, c-format
+msgid "not a valid object: %s"
+msgstr "не Ñ” припуÑтимим обʼєктом: %s"
+
+msgid "read-tree failed"
+msgstr "read-tree завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+msgid "Already up to date. (nothing to squash)"
+msgstr "Вже в актуальному Ñтані. (нічого зчавлювати)"
+
+msgid "Already up to date."
+msgstr "Вже в актуальному Ñтані."
+
+#, c-format
+msgid "Squash commit -- not updating HEAD\n"
+msgstr "Коміт Ð·Ñ‡Ð°Ð²Ð»ÑŽÐ²Ð°Ð½Ð½Ñ -- HEAD не оновлюєтьÑÑ\n"
+
+#, c-format
+msgid "No merge message -- not updating HEAD\n"
+msgstr "Ðемає допиÑу до Ð·Ð»Ð¸Ñ‚Ñ‚Ñ -- HEAD не оновлюєтьÑÑ\n"
+
+#, c-format
+msgid "'%s' does not point to a commit"
+msgstr "\"%s\" не вказує на коміт"
+
+#, c-format
+msgid "Bad branch.%s.mergeoptions string: %s"
+msgstr "Ðевірна branch.%s.mergeoptions Ñтрока: %s"
+
+msgid "Unable to write index."
+msgstr "Ðе вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати індекÑ."
+
+msgid "Not handling anything other than two heads merge."
+msgstr "Ðе оброблюєтьÑÑ Ð½Ñ–Ñ‡Ð¾Ð³Ð¾, окрім Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð´Ð²Ð¾Ñ… верхівок."
+
+#, c-format
+msgid "unable to write %s"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати %s"
+
+#, c-format
+msgid "Could not read from '%s'"
+msgstr "Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ з \"%s\""
+
+#, c-format
+msgid "Not committing merge; use 'git commit' to complete the merge.\n"
+msgstr ""
+"Ðе додано коміт злиттÑ; ÑкориÑтайтеÑÑŒ \"git commit\", щоб завершити злиттÑ.\n"
+
+msgid ""
+"Please enter a commit message to explain why this merge is necessary,\n"
+"especially if it merges an updated upstream into a topic branch.\n"
+"\n"
+msgstr ""
+"Будь лаÑка, введіть Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту, щоб поÑÑнити, чому це Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ñ” "
+"необхідним,\n"
+"оÑобливо Ñкщо воно об’єднує першоджерельні Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð· тематичною гілкою.\n"
+
+msgid "An empty message aborts the commit.\n"
+msgstr "Порожній Ð´Ð¾Ð¿Ð¸Ñ Ð¿ÐµÑ€ÐµÑ€Ð²Ðµ Ð¿Ñ€Ð¾Ñ†ÐµÑ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ.\n"
+
+#, c-format
+msgid ""
+"Lines starting with '%c' will be ignored, and an empty message aborts\n"
+"the commit.\n"
+msgstr ""
+"РÑдки, що починаютьÑÑ Ð· \"%c\", будуть проігноровані, а порожній Ð´Ð¾Ð¿Ð¸Ñ "
+"перерве\n"
+"Ð¿Ñ€Ð¾Ñ†ÐµÑ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ.\n"
+
+msgid "Empty commit message."
+msgstr "Порожній Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту."
+
+#, c-format
+msgid "Wonderful.\n"
+msgstr "Чудово.\n"
+
+#, c-format
+msgid "Automatic merge failed; fix conflicts and then commit the result.\n"
+msgstr ""
+"Ðвтоматичне Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ðµ вдалоÑÑ; виправте конфлікти Ñ– потім зробіть коміт "
+"результату.\n"
+
+msgid "No current branch."
+msgstr "Ðемає поточної гілки."
+
+msgid "No remote for the current branch."
+msgstr "Ðемає віддаленого Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ð¿Ð¾Ñ‚Ð¾Ñ‡Ð½Ð¾Ñ— гілки."
+
+msgid "No default upstream defined for the current branch."
+msgstr ""
+"Ð”Ð»Ñ Ð¿Ð¾Ñ‚Ð¾Ñ‡Ð½Ð¾Ñ— гілки не визначено першоджерельне Ñховище за замовчуваннÑм."
+
+#, c-format
+msgid "No remote-tracking branch for %s from %s"
+msgstr "Ðемає віддалено відÑтежуваної гілки Ð´Ð»Ñ %s з %s"
+
+#, c-format
+msgid "Bad value '%s' in environment '%s'"
+msgstr "Ðевірне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"%s\" в оточенні \"%s\""
+
+#, c-format
+msgid "could not close '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¸ \"%s\""
+
+#, c-format
+msgid "not something we can merge in %s: %s"
+msgstr "не те, що можна злити в %s: %s"
+
+msgid "--abort expects no arguments"
+msgstr "--abort не очікує жодних аргументів"
+
+msgid "There is no merge to abort (MERGE_HEAD missing)."
+msgstr "Ðеможливо перервати Ð·Ð»Ð¸Ñ‚Ñ‚Ñ (відÑутній MERGE_HEAD)."
+
+msgid "--quit expects no arguments"
+msgstr "--quit не очікує жодних аргументів"
+
+msgid "--continue expects no arguments"
+msgstr "--continue не очікує жодних аргументів"
+
+msgid "There is no merge in progress (MERGE_HEAD missing)."
+msgstr "Ð—Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ðµ виконуєтьÑÑ (відÑутній MERGE_HEAD)."
+
+msgid ""
+"You have not concluded your merge (MERGE_HEAD exists).\n"
+"Please, commit your changes before you merge."
+msgstr ""
+"Ви не завершили Ð·Ð»Ð¸Ñ‚Ñ‚Ñ (Ñ–Ñнує MERGE_HEAD).\n"
+"Будь лаÑка, зробіть коміт Ð´Ð»Ñ Ð²Ð°ÑˆÐ¸Ñ… змін перед злиттÑм."
+
+msgid ""
+"You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n"
+"Please, commit your changes before you merge."
+msgstr ""
+"Ви не завершили виÑÐ¼Ð¸ÐºÑƒÐ²Ð°Ð½Ð½Ñ (Ñ–Ñнує CHERRY_PICK_HEAD).\n"
+"Будь лаÑка, зробіть коміт Ð´Ð»Ñ Ð²Ð°ÑˆÐ¸Ñ… змін перед злиттÑм."
+
+msgid "You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists)."
+msgstr "Ви не завершили виÑÐ¼Ð¸ÐºÑƒÐ²Ð°Ð½Ð½Ñ (Ñ–Ñнує CHERRY_PICK_HEAD)."
+
+msgid "No commit specified and merge.defaultToUpstream not set."
+msgstr "Ðе вказано коміт Ñ– не вÑтановлено merge.defaultToUpstream."
+
+msgid "Squash commit into empty head not supported yet"
+msgstr "Поки що немає підтримки комітів Ð·Ñ‡Ð°Ð²Ð»ÑŽÐ²Ð°Ð½Ð½Ñ Ð² порожню верхівку"
+
+msgid "Non-fast-forward commit does not make sense into an empty head"
+msgstr "Коміт без Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¿ÐµÑ€ÐµÐ´ у порожню верхівку не має ÑенÑу"
+
+#, c-format
+msgid "%s - not something we can merge"
+msgstr "%s - не те, що можна злити"
+
+msgid "Can merge only exactly one commit into empty head"
+msgstr "Можна злити лишень один коміт у порожню верхівку"
+
+#, c-format
+msgid "Updating %s..%s\n"
+msgstr "ÐžÐ½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ %s..%s\n"
+
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+" %s"
+msgstr ""
+"Ваші локальні зміни у наÑтупних файлах буде замінено злиттÑм:\n"
+" %s"
+
+#, c-format
+msgid "Trying really trivial in-index merge...\n"
+msgstr "Спроба Ñправді тривіального внутрішньо-індекÑного злиттÑ...\n"
+
+#, c-format
+msgid "Nope.\n"
+msgstr "ÐÑ–.\n"
+
+#, c-format
+msgid "Rewinding the tree to pristine...\n"
+msgstr "ÐŸÑ€Ð¸Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð´ÐµÑ€ÐµÐ²Ð° до початкового Ñтану...\n"
+
+#, c-format
+msgid "Trying merge strategy %s...\n"
+msgstr "Спроба Ñтратегії Ð·Ð»Ð¸Ñ‚Ñ‚Ñ %s...\n"
+
+#, c-format
+msgid "No merge strategy handled the merge.\n"
+msgstr "Жодна ÑÑ‚Ñ€Ð°Ñ‚ÐµÐ³Ñ–Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ðµ впоралаÑÑ Ð·Ñ– злиттÑм.\n"
+
+#, c-format
+msgid "Merge with strategy %s failed.\n"
+msgstr "Ð—Ð»Ð¸Ñ‚Ñ‚Ñ Ð·Ñ– Ñтратегією %s не вдалоÑÑ.\n"
+
+#, c-format
+msgid "Using the %s strategy to prepare resolving by hand.\n"
+msgstr "ВикориÑÑ‚Ð°Ð½Ð½Ñ Ñтратегії %s Ð´Ð»Ñ Ð¿Ñ–Ð´Ð³Ð¾Ñ‚Ð¾Ð²ÐºÐ¸ Ð²Ð¸Ñ€Ñ–ÑˆÐµÐ½Ð½Ñ Ð²Ñ€ÑƒÑ‡Ð½Ñƒ.\n"
+
+#, c-format
+msgid "Automatic merge went well; stopped before committing as requested\n"
+msgstr ""
+"Ðвтоматичне Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð¿Ñ€Ð¾Ð¹ÑˆÐ»Ð¾ добре; зупинка перед комітом, Ñк було вказано\n"
+
+#, c-format
+msgid "When finished, apply stashed changes with `git stash pop`\n"
+msgstr ""
+"Закінчивши, заÑтоÑуйте збережені зміни за допомогою \"git stash pop\"\n"
+
+#, c-format
+msgid "warning: tag input does not pass fsck: %s"
+msgstr "попередженнÑ: вхідний тег не пройшов fsck: %s"
+
+#, c-format
+msgid "error: tag input does not pass fsck: %s"
+msgstr "помилка: вхідний тег не пройшов fsck: %s"
+
+#, c-format
+msgid "%d (FSCK_IGNORE?) should never trigger this callback"
+msgstr "%d (FSCK_IGNORE?) ніколи не мав Ñпричинити цей зворотній виклик"
+
+#, c-format
+msgid "could not read tagged object '%s'"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ тегований об’єкт \"%s\""
+
+#, c-format
+msgid "object '%s' tagged as '%s', but is a '%s' type"
+msgstr "об’єкт \"%s\", позначений Ñк \"%s\", але має тип \"%s\""
+
+msgid "could not read from stdin"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ з stdin"
+
+msgid "tag on stdin did not pass our strict fsck check"
+msgstr "тег з stdin не пройшов нашу Ñувору перевірку fsck"
+
+msgid "tag on stdin did not refer to a valid object"
+msgstr "тег з stdin не поÑилавÑÑ Ð½Ð° дійÑний об’єкт"
+
+msgid "unable to write tag file"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати файл тегів"
+
+msgid "input is NUL terminated"
+msgstr "ввід завершено Ñимволом NUL"
+
+msgid "allow missing objects"
+msgstr "дозволÑти відÑутні об’єкти"
+
+msgid "allow creation of more than one tree"
+msgstr "дозволÑти ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð±Ñ–Ð»ÑŒÑˆ ніж одного дерева"
+
+msgid ""
+"git multi-pack-index [<options>] write [--preferred-pack=<pack>][--refs-"
+"snapshot=<path>]"
+msgstr ""
+"git multi-pack-index [<опції>] write [--preferred-pack=<пакунок>] [--refs-"
+"snapshot=<шлÑÑ…>]"
+
+msgid "git multi-pack-index [<options>] verify"
+msgstr "git multi-pack-index [<опції>] verify"
+
+msgid "git multi-pack-index [<options>] expire"
+msgstr "git multi-pack-index [<опції>] expire"
+
+msgid "git multi-pack-index [<options>] repack [--batch-size=<size>]"
+msgstr "git multi-pack-index [<опції>] repack [--batch-size=<розмір>]"
+
+msgid "directory"
+msgstr "директоріÑ"
+
+msgid "object directory containing set of packfile and pack-index pairs"
+msgstr "Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ Ð¾Ð±â€™Ñ”ÐºÑ‚Ñ–Ð², що міÑтить набір packfile та pack-index пар"
+
+msgid "preferred-pack"
+msgstr "preferred-pack"
+
+msgid "pack for reuse when computing a multi-pack bitmap"
+msgstr ""
+"пакунок Ð´Ð»Ñ Ð¿Ð¾Ð²Ñ‚Ð¾Ñ€Ð½Ð¾Ð³Ð¾ викориÑÑ‚Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´ Ñ‡Ð°Ñ Ð¾Ð±Ñ‡Ð¸ÑÐ»ÐµÐ½Ð½Ñ multi-pack bitmap"
+
+msgid "write multi-pack bitmap"
+msgstr "запиÑати multi-pack bitmap"
+
+msgid "write multi-pack index containing only given indexes"
+msgstr "запиÑати multi-pack індекÑ, що міÑтить лише задані індекÑи"
+
+msgid "refs snapshot for selecting bitmap commits"
+msgstr "знімок поÑилань Ð´Ð»Ñ Ð²Ð¸Ð±Ð¾Ñ€Ñƒ bitmap комітів"
+
+msgid ""
+"during repack, collect pack-files of smaller size into a batch that is "
+"larger than this size"
+msgstr ""
+"під Ñ‡Ð°Ñ Ð¿ÐµÑ€ÐµÐ¿Ð°ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð±Ð¸Ñ€Ð°Ñ‚Ð¸ пакувальні файли меншого розміру в партію, "
+"більшу за цей розмір"
+
+msgid "git mv [<options>] <source>... <destination>"
+msgstr "git mv [<опції>] <джерело>... <призначеннÑ>"
+
+#, c-format
+msgid "Directory %s is in index and no submodule?"
+msgstr "Ð”Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ %s в індекÑÑ–, але без підмодулÑ?"
+
+msgid "Please stage your changes to .gitmodules or stash them to proceed"
+msgstr ""
+"Будь лаÑка, додайте змінений .gitmodules до індекÑу або до Ñхову, щоб "
+"продовжити"
+
+#, c-format
+msgid "%.*s is in index"
+msgstr "%.*s в індекÑÑ–"
+
+msgid "force move/rename even if target exists"
+msgstr "примуÑово переміщувати/перейменовувати, навіть Ñкщо ціль Ñ–Ñнує"
+
+msgid "skip move/rename errors"
+msgstr "пропуÑкати помилки переміщеннÑ/перейменуваннÑ"
+
+#, c-format
+msgid "destination '%s' is not a directory"
+msgstr "міÑце Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"%s\" не Ñ” директорією"
+
+#, c-format
+msgid "Checking rename of '%s' to '%s'\n"
+msgstr "Перевірка Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ \"%s\" на \"%s\"\n"
+
+msgid "bad source"
+msgstr "невірне джерело"
+
+msgid "destination exists"
+msgstr "Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ–Ñнує"
+
+msgid "can not move directory into itself"
+msgstr "неможливо переміÑтити директорію в Ñаму Ñебе"
+
+msgid "destination already exists"
+msgstr "Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð¶Ðµ Ñ–Ñнує"
+
+msgid "source directory is empty"
+msgstr "Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ Ð´Ð¶ÐµÑ€ÐµÐ»Ð° порожнÑ"
+
+msgid "not under version control"
+msgstr "не під контролем верÑій"
+
+msgid "conflicted"
+msgstr "конфлікт"
+
+#, c-format
+msgid "overwriting '%s'"
+msgstr "Ð¿ÐµÑ€ÐµÐ·Ð°Ð¿Ð¸Ñ \"%s\""
+
+msgid "Cannot overwrite"
+msgstr "Ðеможливо перезапиÑати"
+
+msgid "multiple sources for the same target"
+msgstr "кілька джерел Ð´Ð»Ñ Ð¾Ð´Ð½Ñ–Ñ”Ñ— цілі"
+
+msgid "destination directory does not exist"
+msgstr "Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ Ñ–Ñнує"
+
+msgid "destination exists in the index"
+msgstr "Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ–Ñнує в індекÑÑ–"
+
+#, c-format
+msgid "%s, source=%s, destination=%s"
+msgstr "%s, джерело=%s, призначеннÑ=%s"
+
+#, c-format
+msgid "Renaming %s to %s\n"
+msgstr "ÐŸÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ %s на %s\n"
+
+#, c-format
+msgid "renaming '%s' failed"
+msgstr "Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ \"%s\" завершилоÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+msgid "git name-rev [<options>] <commit>..."
+msgstr "git name-rev [<опції>] <коміт>..."
+
+msgid "git name-rev [<options>] --all"
+msgstr "git name-rev [<опції>] --all"
+
+msgid "git name-rev [<options>] --annotate-stdin"
+msgstr "git name-rev [<опції>] --annotate-stdin"
+
+msgid "print only ref-based names (no object names)"
+msgstr "виводити тільки назви на оÑнові поÑилань (без назв об’єктів)"
+
+msgid "only use tags to name the commits"
+msgstr "викориÑтовувати теги лише Ð´Ð»Ñ Ð½Ð°Ð·Ð² комітів"
+
+msgid "only use refs matching <pattern>"
+msgstr "викориÑтовувати лише поÑиланнÑ, що збігаютьÑÑ Ð· <шаблоном>"
+
+msgid "ignore refs matching <pattern>"
+msgstr "ігнорувати поÑиланнÑ, що збігаютьÑÑ Ð· <шаблоном>"
+
+msgid "list all commits reachable from all refs"
+msgstr "вивеÑти вÑÑ– коміти, доÑтупні з уÑÑ–Ñ… поÑилань"
+
+msgid "deprecated: use --annotate-stdin instead"
+msgstr "заÑтаріле: заміÑÑ‚ÑŒ цього викориÑтовуйте --annotate-stdin"
+
+msgid "annotate text from stdin"
+msgstr "анотувати текÑÑ‚ зі stdin"
+
+msgid "allow to print `undefined` names (default)"
+msgstr "дозволити виводити \"невизначені\" назви (за замовчуваннÑм)"
+
+msgid "dereference tags in the input (internal use)"
+msgstr "розіменувати теги на вході (внутрішнє викориÑтаннÑ)"
+
+msgid "git notes [--ref <notes-ref>] [list [<object>]]"
+msgstr "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>]"
+msgstr ""
+"git notes [--ref <поÑиланнÑ-нотатки>] add [-f] [--allow-empty] [--"
+"[no-]separator|--separator=<розділювач-абзаців>] [--[no-]stripspace] [-m "
+"<допиÑ> | -F <файл> | (-c | -C) <обʼєкт>] [<обʼєкт>]"
+
+msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
+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>]"
+msgstr ""
+"git notes [--ref <поÑиланнÑ-нотатки>] append [--allow-empty] [--"
+"[no-]separator|--separator=<розділювач-абзаців>] [--[no-]stripspace] [-m "
+"<допиÑ> | -F <файл> | (-c | -C) <обʼєкт>] [<обʼєкт>]"
+
+msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
+msgstr "git notes [--ref <поÑиланнÑ-нотатки>] edit [--allow-empty] [<об’єкт>]"
+
+msgid "git notes [--ref <notes-ref>] show [<object>]"
+msgstr "git notes [--ref <поÑиланнÑ-нотатки>] show [<об’єкт>]"
+
+msgid ""
+"git notes [--ref <notes-ref>] merge [-v | -q] [-s <strategy>] <notes-ref>"
+msgstr ""
+"git notes [--ref <поÑиланнÑ-нотатки>] merge [-v | -q] [-s <ÑтратегіÑ>] "
+"<поÑиланнÑ-нотатки>"
+
+msgid "git notes [--ref <notes-ref>] remove [<object>...]"
+msgstr "git notes [--ref <поÑиланнÑ-нотатки>] remove [<об’єкт>...]"
+
+msgid "git notes [--ref <notes-ref>] prune [-n] [-v]"
+msgstr "git notes [--ref <поÑиланнÑ-нотатки>] prune [-n] [-v]."
+
+msgid "git notes [--ref <notes-ref>] get-ref"
+msgstr "git notes [--ref <поÑиланнÑ-нотатки>] get-ref"
+
+msgid "git notes [list [<object>]]"
+msgstr "git notes [list [<об’єкт>]]"
+
+msgid "git notes add [<options>] [<object>]"
+msgstr "git notes add [<опції>] [<обʼєкт>]"
+
+msgid "git notes copy [<options>] <from-object> <to-object>"
+msgstr "git notes copy [<опції>] <з-об’єкта> <до-об’єкта"
+
+msgid "git notes copy --stdin [<from-object> <to-object>]..."
+msgstr "git notes copy --stdin [<з-об’єкта> <до-об’єкта>]..."
+
+msgid "git notes append [<options>] [<object>]"
+msgstr "git notes append [<опції>] [<обʼєкт>]"
+
+msgid "git notes edit [<object>]"
+msgstr "git notes edit [<об’єкт>]"
+
+msgid "git notes show [<object>]"
+msgstr "git notes show [<об’єкт>]"
+
+msgid "git notes merge [<options>] <notes-ref>"
+msgstr "git notes merge [<опції>] <поÑиланнÑ-нотатки>"
+
+msgid "git notes merge --commit [<options>]"
+msgstr "git notes merge --commit [<опції>]"
+
+msgid "git notes merge --abort [<options>]"
+msgstr "git notes merge --abort [<опції>]"
+
+msgid "git notes remove [<object>]"
+msgstr "git notes remove [<об’єкт>]"
+
+msgid "git notes prune [<options>]"
+msgstr "git notes prune [<опції>]"
+
+msgid "Write/edit the notes for the following object:"
+msgstr "ЗапиÑати/відредагувати нотатки Ð´Ð»Ñ Ð½Ð°Ñтупного обʼєкта:"
+
+#, c-format
+msgid "unable to start 'show' for object '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити \"show\" Ð´Ð»Ñ Ð¾Ð±â€™Ñ”ÐºÑ‚Ð° \"%s\""
+
+msgid "could not read 'show' output"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ вивід \"show\""
+
+#, c-format
+msgid "failed to finish 'show' for object '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ñ‚Ð¸ \"show\" Ð´Ð»Ñ Ð¾Ð±â€™Ñ”ÐºÑ‚Ð° \"%s\""
+
+msgid "please supply the note contents using either -m or -F option"
+msgstr "будь лаÑка, надайте зміÑÑ‚ нотатки, викориÑтовуючи опцію -m або -F"
+
+msgid "unable to write note object"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати об’єкт нотатки"
+
+#, c-format
+msgid "the note contents have been left in %s"
+msgstr "вміÑÑ‚ нотатки залишено в %s"
+
+#, c-format
+msgid "could not open or read '%s'"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ або прочитати \"%s\""
+
+#, c-format
+msgid "failed to resolve '%s' as a valid ref."
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ñ‚Ð¸ \"%s\" Ñк припуÑтиме поÑиланнÑ."
+
+#, c-format
+msgid "failed to read object '%s'."
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ обʼєкт \"%s\"."
+
+#, c-format
+msgid "cannot read note data from non-blob object '%s'."
+msgstr "неможливо прочитати дані нотатки з не-blob обʼєкту \"%s\"."
+
+#, c-format
+msgid "failed to copy notes from '%s' to '%s'"
+msgstr "не вдалоÑÑ Ñкопіювати нотатки з \"%s\" в \"%s\""
+
+#. TRANSLATORS: the first %s will be replaced by a git
+#. notes command: 'add', 'merge', 'remove', etc.
+#.
+#, c-format
+msgid "refusing to %s notes in %s (outside of refs/notes/)"
+msgstr "відмовлено в %s нотаток у %s (за межами refs/notes/)"
+
+#, c-format
+msgid "no note found for object %s."
+msgstr "Ð´Ð»Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ð° %s не знайдено жодної нотатки."
+
+msgid "note contents as a string"
+msgstr "вміÑÑ‚ нотатки Ñк Ñтрока"
+
+msgid "note contents in a file"
+msgstr "вміÑÑ‚ нотатки у файлі"
+
+msgid "reuse and edit specified note object"
+msgstr "повторно викориÑтати та редагувати вказаний обʼєкт нотатки"
+
+msgid "reuse specified note object"
+msgstr "повторно викориÑтати вказаний обʼєкт нотатки"
+
+msgid "allow storing empty note"
+msgstr "дозволити Ð·Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ð¿Ð¾Ñ€Ð¾Ð¶Ð½ÑŒÐ¾Ñ— нотатки"
+
+msgid "replace existing notes"
+msgstr "замінити Ñ–Ñнуючі нотатки"
+
+msgid "<paragraph-break>"
+msgstr "<розділювач-абзаців>"
+
+msgid "insert <paragraph-break> between paragraphs"
+msgstr "вÑтавити <розділювач-абзаців> між абзацами"
+
+msgid "remove unnecessary whitespace"
+msgstr "видалити зайві пробіли"
+
+#, c-format
+msgid ""
+"Cannot add notes. Found existing notes for object %s. Use '-f' to overwrite "
+"existing notes"
+msgstr ""
+"Ðеможливо додати нотатки. Знайдено Ñ–Ñнуючі нотатки Ð´Ð»Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ð° %s. "
+"СкориÑтайтеÑÑŒ \"-f\" Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ·Ð°Ð¿Ð¸Ñу Ñ–Ñнуючих нотаток"
+
+#, c-format
+msgid "Overwriting existing notes for object %s\n"
+msgstr "ÐŸÐµÑ€ÐµÐ·Ð°Ð¿Ð¸Ñ Ñ–Ñнуючих нотаток Ð´Ð»Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ð° %s\n"
+
+#, c-format
+msgid "Removing note for object %s\n"
+msgstr "Ð’Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð½Ð¾Ñ‚Ð°Ñ‚ÐºÐ¸ Ð´Ð»Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ð° %s\n"
+
+msgid "read objects from stdin"
+msgstr "зчитати обʼєкти з stdin"
+
+msgid "load rewriting config for <command> (implies --stdin)"
+msgstr ""
+"завантажити Ð¿ÐµÑ€ÐµÐ·Ð°Ð¿Ð¸Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ— Ð´Ð»Ñ <команда> (маєтьÑÑ Ð½Ð° увазі --stdin)"
+
+msgid "too few arguments"
+msgstr "замало аргументів"
+
+#, c-format
+msgid ""
+"Cannot copy notes. Found existing notes for object %s. Use '-f' to overwrite "
+"existing notes"
+msgstr ""
+"Ðеможливо Ñкопіювати нотатки. Знайдено Ñ–Ñнуючі нотатки Ð´Ð»Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ð° %s. "
+"СкориÑтайтеÑÑŒ \"-f\", щоб перезапиÑати Ñ–Ñнуючі нотатки"
+
+#, c-format
+msgid "missing notes on source object %s. Cannot copy."
+msgstr "нотатки джерельного обʼєкта %s відÑутні. Ðеможливо Ñкопіювати."
+
+#, c-format
+msgid ""
+"The -m/-F/-c/-C options have been deprecated for the 'edit' subcommand.\n"
+"Please use 'git notes add -f -m/-F/-c/-C' instead.\n"
+msgstr ""
+"Опції -m/-F/-c/-C заÑтаріли Ð´Ð»Ñ Ð¿Ñ–Ð´ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¸ \"edit\".\n"
+"Будь лаÑка, ÑкориÑтайтеÑÑŒ \"git notes add -f -m/-F/-c/-C\" заміÑÑ‚ÑŒ цього.\n"
+
+msgid "failed to delete ref NOTES_MERGE_PARTIAL"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ поÑÐ¸Ð»Ð°Ð½Ð½Ñ NOTES_MERGE_PARTIAL"
+
+msgid "failed to delete ref NOTES_MERGE_REF"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ поÑÐ¸Ð»Ð°Ð½Ð½Ñ NOTES_MERGE_REF"
+
+msgid "failed to remove 'git notes merge' worktree"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ \"git notes merge\" робоче дерево"
+
+msgid "failed to read ref NOTES_MERGE_PARTIAL"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ поÑÐ¸Ð»Ð°Ð½Ð½Ñ NOTES_MERGE_PARTIAL"
+
+msgid "could not find commit from NOTES_MERGE_PARTIAL."
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ коміт з NOTES_MERGE_PARTIAL."
+
+msgid "could not parse commit from NOTES_MERGE_PARTIAL."
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ коміт з NOTES_MERGE_PARTIAL."
+
+msgid "failed to resolve NOTES_MERGE_REF"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð²Ê¼Ñзати NOTES_MERGE_REF"
+
+msgid "failed to finalize notes merge"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ñ‚Ð¸ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ð¾Ñ‚Ð°Ñ‚Ð¾Ðº"
+
+#, c-format
+msgid "unknown notes merge strategy %s"
+msgstr "невідома ÑÑ‚Ñ€Ð°Ñ‚ÐµÐ³Ñ–Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ð¾Ñ‚Ð°Ñ‚Ð¾Ðº %s"
+
+msgid "General options"
+msgstr "ОÑновні опції"
+
+msgid "Merge options"
+msgstr "Опції злиттÑ"
+
+msgid ""
+"resolve notes conflicts using the given strategy (manual/ours/theirs/union/"
+"cat_sort_uniq)"
+msgstr ""
+"вирішити конфлікти нотаток, викориÑтовуючи задану Ñтратегію (manual/our/"
+"their/union/cat_sort_uniq)"
+
+msgid "Committing unmerged notes"
+msgstr "Ð’Ð¸ÐºÐ¾Ð½Ð½Ð°Ð½Ð½Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ не злитих нотаток"
+
+msgid "finalize notes merge by committing unmerged notes"
+msgstr "завершити Ð·Ð»Ð¸Ñ‚Ñ‚Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ð¾Ð¼ не злитих нотаток"
+
+msgid "Aborting notes merge resolution"
+msgstr "ÐŸÐµÑ€ÐµÑ€Ð¸Ð²Ð°Ð½Ð½Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ð¾Ñ‚Ð°Ñ‚Ð¾Ðº"
+
+msgid "abort notes merge"
+msgstr "перервати Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ð¾Ñ‚Ð°Ñ‚Ð¾Ðº"
+
+msgid "cannot mix --commit, --abort or -s/--strategy"
+msgstr "не можна змішувати --commit, --abort або -s/--strategy"
+
+msgid "must specify a notes ref to merge"
+msgstr "необхідно вказати поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ð¾Ñ‚Ð°Ñ‚Ð¾Ðº Ð´Ð»Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ"
+
+#, c-format
+msgid "unknown -s/--strategy: %s"
+msgstr "невідома -s/--strategy: %s"
+
+#, c-format
+msgid "a notes merge into %s is already in-progress at %s"
+msgstr "Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ð¾Ñ‚Ð°Ñ‚Ð¾Ðº у %s вже виконуєтьÑÑ Ð² %s"
+
+#, c-format
+msgid "failed to store link to current notes ref (%s)"
+msgstr "не вдалоÑÑ Ð·Ð±ÐµÑ€ÐµÐ³Ñ‚Ð¸ ланку на поточні нотатки поÑÐ¸Ð»Ð°Ð½Ð½Ñ (%s)"
+
+#, c-format
+msgid ""
+"Automatic notes merge failed. Fix conflicts in %s and commit the result with "
+"'git notes merge --commit', or abort the merge with 'git notes merge --"
+"abort'.\n"
+msgstr ""
+"Ðвтоматичне Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ð¾Ñ‚Ð°Ñ‚Ð¾Ðº не вдалоÑÑ. Виправте конфлікти у %s Ñ– зробіть "
+"коміт змін командою \"git notes merge --commit\" або перервіть Ð·Ð»Ð¸Ñ‚Ñ‚Ñ "
+"командою \"git notes merge --abort\".\n"
+
+#, c-format
+msgid "Failed to resolve '%s' as a valid ref."
+msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·Ð²Ê¼Ñзати \"%s\" Ñк припуÑтиме поÑиланнÑ."
+
+#, c-format
+msgid "Object %s has no note\n"
+msgstr "Обʼєкт %s не має нотатки\n"
+
+msgid "attempt to remove non-existent note is not an error"
+msgstr "Ñпроба видалити неіÑнуючу нотатку не Ñ” помилкою"
+
+msgid "read object names from the standard input"
+msgstr "зчитати імена обʼєктів зі Ñтандартного вводу"
+
+msgid "do not remove, show only"
+msgstr "не видалÑти, тільки показувати"
+
+msgid "report pruned notes"
+msgstr "звітувати про видалені нотатки"
+
+msgid "notes-ref"
+msgstr "поÑиланнÑ-нотатки"
+
+msgid "use notes from <notes-ref>"
+msgstr "викориÑтовувати нотатки з <поÑиланнÑ-нотатки>"
+
+#, c-format
+msgid "unknown subcommand: `%s'"
+msgstr "невідома підкоманда: \"%s\""
+
+msgid "git pack-objects --stdout [<options>] [< <ref-list> | < <object-list>]"
+msgstr ""
+"git pack-objects --stdout [<опції>] [< <ÑпиÑок-поÑилань> | < <ÑпиÑок-"
+"обʼєктів>]"
+
+msgid ""
+"git pack-objects [<options>] <base-name> [< <ref-list> | < <object-list>]"
+msgstr ""
+"git pack-objects [<опції>] <базова-назва> [< <ÑпиÑок-поÑилань> | < <ÑпиÑок-"
+"обʼєктів>]"
+
+#, c-format
+msgid ""
+"write_reuse_object: could not locate %s, expected at offset %<PRIuMAX> in "
+"pack %s"
+msgstr ""
+"write_reuse_object: не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ %s, очікуваний зі зміщеннÑм %<PRIuMAX> "
+"у пакунку %s"
+
+#, c-format
+msgid "bad packed object CRC for %s"
+msgstr "невірна CRC запакованого обʼєкта %s"
+
+#, c-format
+msgid "corrupt packed object for %s"
+msgstr "пошкоджений запакований обʼєкт Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "recursive delta detected for object %s"
+msgstr "виÑвлено рекурÑивну дельту Ð´Ð»Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ð° %s"
+
+#, c-format
+msgid "ordered %u objects, expected %<PRIu32>"
+msgstr "замовлено %u обʼєктів, очікувалоÑÑŒ %<PRIu32>"
+
+#, c-format
+msgid "expected object at offset %<PRIuMAX> in pack %s"
+msgstr "очікувавÑÑ Ð¾Ð±Ê¼Ñ”ÐºÑ‚ на зміщенні %<PRIuMAX> пакунка %s"
+
+msgid "disabling bitmap writing, packs are split due to pack.packSizeLimit"
+msgstr ""
+"Ð²Ð¸Ð¼ÐºÐ½ÐµÐ½Ð½Ñ bitmap запиÑу, пакунки розбиваютьÑÑ Ð½Ð° чаÑтини через pack."
+"packSizeLimit"
+
+msgid "Writing objects"
+msgstr "Ð—Ð°Ð¿Ð¸Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ñ–Ð²"
+
+#, c-format
+msgid "failed to stat %s"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ stat %s"
+
+#, c-format
+msgid "failed utime() on %s"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ utime() на %s"
+
+msgid "failed to write bitmap index"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати bitmap індекÑ"
+
+#, c-format
+msgid "wrote %<PRIu32> objects while expecting %<PRIu32>"
+msgstr "запиÑано %<PRIu32> обʼєкти при очікуванні %<PRIu32>"
+
+msgid "disabling bitmap writing, as some objects are not being packed"
+msgstr "Ð²Ð¸Ð¼ÐºÐ½ÐµÐ½Ð½Ñ bitmap запиÑу, оÑкільки деÑкі обʼєкти не упаковуютьÑÑ"
+
+#, c-format
+msgid "delta base offset overflow in pack for %s"
+msgstr "Ð¿ÐµÑ€ÐµÐ¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ Ð·Ð¼Ñ–Ñ‰ÐµÐ½Ð½Ñ Ð´ÐµÐ»ÑŒÑ‚Ð¸ бази у пакунку Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "delta base offset out of bound for %s"
+msgstr "Ð·Ð¼Ñ–Ñ‰ÐµÐ½Ð½Ñ Ð±Ð°Ð·Ð¸ дельти виходить за межі Ð´Ð»Ñ %s"
+
+msgid "Counting objects"
+msgstr "Підрахунок обʼєктів"
+
+#, c-format
+msgid "unable to get size of %s"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ розмір %s"
+
+#, c-format
+msgid "unable to parse object header of %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ заголовок обʼєкта %s"
+
+#, c-format
+msgid "object %s cannot be read"
+msgstr "обʼєкт %s не може бути прочитаний"
+
+#, c-format
+msgid "object %s inconsistent object length (%<PRIuMAX> vs %<PRIuMAX>)"
+msgstr "обʼєкт %s має невідповідну довжину (%<PRIuMAX> проти %<PRIuMAX>)"
+
+msgid "suboptimal pack - out of memory"
+msgstr "неоптимальний пакунок - не виÑтачає памʼÑÑ‚Ñ–"
+
+#, c-format
+msgid "Delta compression using up to %d threads"
+msgstr "Дельта компреÑÑ–Ñ Ð· викориÑтаннÑм до %d потоків"
+
+#, c-format
+msgid "unable to pack objects reachable from tag %s"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð°ÐºÑƒÐ²Ð°Ñ‚Ð¸ обʼєкти, доÑтупні з тегу %s"
+
+#, c-format
+msgid "unable to get type of object %s"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ тип обʼєкта %s"
+
+msgid "Compressing objects"
+msgstr "КомпреÑÑ–Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ñ–Ð²"
+
+msgid "inconsistency with delta count"
+msgstr "неÑÐ¿Ñ–Ð²Ð¿Ð°Ð´Ñ–Ð½Ð½Ñ Ð· підрахунком дельти"
+
+#, c-format
+msgid "invalid pack.allowPackReuse value: '%s'"
+msgstr "неприпуÑтиме Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ pack.allowPackReuse: \"%s\""
+
+#, c-format
+msgid ""
+"value of uploadpack.blobpackfileuri must be of the form '<object-hash> <pack-"
+"hash> <uri>' (got '%s')"
+msgstr ""
+"Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ uploadpack.blobpackfileuri повинно мати виглÑд \"<хеш-обʼєкта> <хеш-"
+"пакунка> <uri>\" (отримано \"%s\")"
+
+#, c-format
+msgid ""
+"object already configured in another uploadpack.blobpackfileuri (got '%s')"
+msgstr ""
+"обʼєкт вже Ñконфігуровано в іншому uploadpack.blobpackfileuri (отримано "
+"\"%s\")"
+
+#, c-format
+msgid "could not get type of object %s in pack %s"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ тип обʼєкта %s у пакунку %s"
+
+#, c-format
+msgid "could not find pack '%s'"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ пакунок \"%s\""
+
+#, c-format
+msgid "packfile %s cannot be accessed"
+msgstr "неможливо отримати доÑтуп до файлу пакунку %s"
+
+msgid "Enumerating cruft objects"
+msgstr "ÐŸÐµÑ€ÐµÑ€Ð°Ñ…ÑƒÐ²Ð°Ð½Ð½Ñ Ð¼Ð°Ñ€Ð½Ð¸Ñ… обʼєктів"
+
+msgid "unable to add cruft objects"
+msgstr "не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ марні обʼєкти"
+
+msgid "Traversing cruft objects"
+msgstr "ÐŸÑ€Ð¾Ñ…Ð¾Ð´Ð¶ÐµÐ½Ð½Ñ Ð¿Ð¾ марним обʼєктам"
+
+#, c-format
+msgid ""
+"expected edge object ID, got garbage:\n"
+" %s"
+msgstr ""
+"очікувавÑÑ Ñ–Ð´ÐµÐ½Ñ‚Ð¸Ñ„Ñ–ÐºÐ°Ñ‚Ð¾Ñ€ реберного обʼєкту, отримано непотріб:\n"
+" %s"
+
+#, c-format
+msgid ""
+"expected object ID, got garbage:\n"
+" %s"
+msgstr ""
+"очікувавÑÑ Ñ–Ð´ÐµÐ½Ñ‚Ð¸Ñ„Ñ–ÐºÐ°Ñ‚Ð¾Ñ€ обʼєкта, отримано непотріб:\n"
+" %s"
+
+msgid "could not load cruft pack .mtimes"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ марний пакунок .mtimes"
+
+msgid "cannot open pack index"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ Ñ–Ð½Ð´ÐµÐºÑ Ð¿Ð°ÐºÑƒÐ½ÐºÐ°"
+
+#, c-format
+msgid "loose object at %s could not be examined"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð³Ð»Ñнути вільний обʼєкт у %s"
+
+msgid "unable to force loose object"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¸Ð¼ÑƒÑово вивільнити обʼєкт"
+
+#, c-format
+msgid "not a rev '%s'"
+msgstr "не є ревізією \"%s\""
+
+#, c-format
+msgid "bad revision '%s'"
+msgstr "невірна Ñ€ÐµÐ²Ñ–Ð·Ñ–Ñ \"%s\""
+
+msgid "unable to add recent objects"
+msgstr "не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ нещодавні обʼєкти"
+
+#, c-format
+msgid "unsupported index version %s"
+msgstr "непідтримувана верÑÑ–Ñ Ñ–Ð½Ð´ÐµÐºÑу %s"
+
+#, c-format
+msgid "bad index version '%s'"
+msgstr "невірна верÑÑ–Ñ Ñ–Ð½Ð´ÐµÐºÑу \"%s\""
+
+msgid "show progress meter during object writing phase"
+msgstr "показувати хід Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´ Ñ‡Ð°Ñ Ñ„Ð°Ð·Ð¸ запиÑу обʼєкта"
+
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "подібно до --all-progress, коли показано хід виконаннÑ"
+
+msgid "<version>[,<offset>]"
+msgstr "<верÑÑ–Ñ>[, <зміщеннÑ>]"
+
+msgid "write the pack index file in the specified idx format version"
+msgstr "запиÑати індекÑний файл пакунка у вказаній верÑÑ–Ñ— idx формату"
+
+msgid "maximum size of each output pack file"
+msgstr "макÑимальний розмір кожного файлу вихідного пакунку"
+
+msgid "ignore borrowed objects from alternate object store"
+msgstr "ігнорувати запозичені обʼєкти з міÑÑ†Ñ Ð·Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ð·Ð°Ð¿Ð¾Ð·Ð¸Ñ‡ÐµÐ½Ð¸Ñ… об’єктів"
+
+msgid "ignore packed objects"
+msgstr "ігнорувати запаковані обʼєкти"
+
+msgid "limit pack window by objects"
+msgstr "обмежити вікно Ð¿Ð°ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð° обʼєктами"
+
+msgid "limit pack window by memory in addition to object limit"
+msgstr "обмежити вікно Ð¿Ð°ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð° памʼÑÑ‚Ñ‚ÑŽ на додаток до ліміту обʼєкта"
+
+msgid "maximum length of delta chain allowed in the resulting pack"
+msgstr "макÑимальна довжина дельта ланцюжка, дозволена в результуючому пакунку"
+
+msgid "reuse existing deltas"
+msgstr "повторно викориÑтати Ñ–Ñнуючі дельти"
+
+msgid "reuse existing objects"
+msgstr "повторно викориÑтати Ñ–Ñнуючі обʼєкти"
+
+msgid "use OFS_DELTA objects"
+msgstr "викориÑтати OFS_DELTA обʼєкти"
+
+msgid "use threads when searching for best delta matches"
+msgstr "викориÑтовувати потоки під Ñ‡Ð°Ñ Ð¿Ð¾ÑˆÑƒÐºÑƒ найкращих дельта збігів"
+
+msgid "do not create an empty pack output"
+msgstr "не Ñтворювати вивід порожнього пакунка"
+
+msgid "read revision arguments from standard input"
+msgstr "зчитувати аргументи ревізії зі Ñтандартного вводу"
+
+msgid "limit the objects to those that are not yet packed"
+msgstr "обмежувати обʼєкти тільки тими, Ñкі ще не запаковані"
+
+msgid "include objects reachable from any reference"
+msgstr "включати обʼєкти, доÑÑжні з будь-Ñкого поÑиланнÑ"
+
+msgid "include objects referred by reflog entries"
+msgstr "включати обʼєкти, на Ñкі поÑилаютьÑÑ Ð·Ð°Ð¿Ð¸Ñи журналу поÑилань"
+
+msgid "include objects referred to by the index"
+msgstr "включати обʼєкти, на Ñкі поÑилаєтьÑÑ Ñ–Ð½Ð´ÐµÐºÑ"
+
+msgid "read packs from stdin"
+msgstr "прочитати пакунки з stdin"
+
+msgid "output pack to stdout"
+msgstr "вивеÑти пакунок у stdout"
+
+msgid "include tag objects that refer to objects to be packed"
+msgstr ""
+"включати обʼєкти тегів, Ñкі поÑилаютьÑÑ Ð½Ð° обʼєкти, що будуть запаковані"
+
+msgid "keep unreachable objects"
+msgstr "зберігати недоÑÑжні обʼєкти"
+
+msgid "pack loose unreachable objects"
+msgstr "запакувати вільні недоÑÑжні обʼєкти"
+
+msgid "unpack unreachable objects newer than <time>"
+msgstr "розпакувати недоÑÑжні обʼєкти, новіші за <чаÑ>"
+
+msgid "create a cruft pack"
+msgstr "Ñтворити марний пакунок"
+
+msgid "expire cruft objects older than <time>"
+msgstr "видалити марні обʼєкти Ñтаріші за <чаÑ>"
+
+msgid "use the sparse reachability algorithm"
+msgstr "викориÑтовувати алгоритм розрідженої доÑÑжноÑÑ‚Ñ–"
+
+msgid "create thin packs"
+msgstr "Ñтворити тонкі пакунки"
+
+msgid "create packs suitable for shallow fetches"
+msgstr "Ñтворювати пакунки, придатні Ð´Ð»Ñ Ð½ÐµÐ³Ð»Ð¸Ð±Ð¾ÐºÐ¾Ð³Ð¾ отриманнÑ"
+
+msgid "ignore packs that have companion .keep file"
+msgstr "ігнорувати пакунки, Ñкі мають Ñупровідний .keep файл"
+
+msgid "ignore this pack"
+msgstr "ігнорувати цей пакунок"
+
+msgid "pack compression level"
+msgstr "рівень ÑтиÑÐ½ÐµÐ½Ð½Ñ Ð¿Ð°ÐºÑƒÐ½ÐºÐ°"
+
+msgid "do not hide commits by grafts"
+msgstr "не приховувати коміти через прищепи"
+
+msgid "use a bitmap index if available to speed up counting objects"
+msgstr ""
+"викориÑтовувати bitmap індекÑ, Ñкщо він доÑтупний, Ð´Ð»Ñ Ð¿Ñ€Ð¸ÑÐºÐ¾Ñ€ÐµÐ½Ð½Ñ "
+"підрахунку обʼєктів"
+
+msgid "write a bitmap index together with the pack index"
+msgstr "запиÑати bitmap Ñ–Ð½Ð´ÐµÐºÑ Ñ€Ð°Ð·Ð¾Ð¼ з індекÑом пакунка"
+
+msgid "write a bitmap index if possible"
+msgstr "запиÑати bitmap індекÑ, Ñкщо це можливо"
+
+msgid "handling for missing objects"
+msgstr "обробка Ð´Ð»Ñ Ð²Ñ–Ð´Ñутніх обʼєктів"
+
+msgid "do not pack objects in promisor packfiles"
+msgstr "не пакувати обʼєкти у promisor пакунки"
+
+msgid "respect islands during delta compression"
+msgstr "поважати оÑтрови під Ñ‡Ð°Ñ Ð´ÐµÐ»ÑŒÑ‚Ð° компреÑÑ–Ñ—"
+
+msgid "protocol"
+msgstr "протокол"
+
+msgid "exclude any configured uploadpack.blobpackfileuri with this protocol"
+msgstr "вилучити вÑÑ– налаштовані uploadpack.blobpackfileuri з цим протоколом"
+
+#, c-format
+msgid "delta chain depth %d is too deep, forcing %d"
+msgstr "глибина дельта ланцюжка %d занадто глибока, примуÑове %d"
+
+#, c-format
+msgid "pack.deltaCacheLimit is too high, forcing %d"
+msgstr "pack.deltaCacheLimit занадто великий, примуÑове %d"
+
+#, c-format
+msgid "bad pack compression level %d"
+msgstr "невірний рівень ÑтиÑÐ½ÐµÐ½Ð½Ñ Ð¿Ð°ÐºÑƒÐ½ÐºÐ° %d"
+
+msgid "--max-pack-size cannot be used to build a pack for transfer"
+msgstr ""
+"--max-pack-size не можна викориÑтовувати Ð´Ð»Ñ ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð¿Ð°ÐºÑƒÐ½ÐºÐ° Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ´Ð°Ñ‡Ñ–"
+
+msgid "minimum pack size limit is 1 MiB"
+msgstr "мінімальний розмір пакунка - 1 МіБ"
+
+msgid "--thin cannot be used to build an indexable pack"
+msgstr "--thin не можна викориÑтовувати Ð´Ð»Ñ ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ñ–Ð½Ð´ÐµÐºÑованого пакунка"
+
+msgid "cannot use --filter with --stdin-packs"
+msgstr "неможливо викориÑтовувати --filter з --stdin-packs"
+
+msgid "cannot use internal rev list with --stdin-packs"
+msgstr "неможливо викориÑтовувати внутрішній ÑпиÑок ревізій з --stdin-packs"
+
+msgid "cannot use internal rev list with --cruft"
+msgstr "неможливо викориÑтовувати внутрішній ÑпиÑок ревізій з --cruft"
+
+msgid "cannot use --stdin-packs with --cruft"
+msgstr "неможливо викориÑтовувати --stdin-packs з --cruft"
+
+msgid "Enumerating objects"
+msgstr "ÐŸÐµÑ€ÐµÑ€Ð°Ñ…ÑƒÐ²Ð°Ð½Ð½Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ñ–Ð²"
+
+#, c-format
+msgid ""
+"Total %<PRIu32> (delta %<PRIu32>), reused %<PRIu32> (delta %<PRIu32>), pack-"
+"reused %<PRIu32> (from %<PRIuMAX>)"
+msgstr ""
+"Ð’Ñього %<PRIu32> (дельта %<PRIu32>), повторно викориÑтано %<PRIu32> (дельта "
+"%<PRIu32>), повторно викориÑтано пакунків %<PRIu32> (з %<PRIuMAX>)"
+
+msgid ""
+"'git pack-redundant' is nominated for removal.\n"
+"If you still use this command, please add an extra\n"
+"option, '--i-still-use-this', on the command line\n"
+"and let us know you still use it by sending an e-mail\n"
+"to <git@vger.kernel.org>. Thanks.\n"
+msgstr ""
+"Команду \"git pack-redundant\" номіновано на вилученнÑ.\n"
+"Якщо ви вÑе ще викориÑтовуєте цю команду, будь лаÑка, додайте додатковий "
+"параметр\n"
+"\"--i-still-use-this\" у командному Ñ€Ñдку\n"
+"Ñ– повідомте нам, що ви вÑе ще викориÑтовуєте Ñ—Ñ—, надіÑлавши лиÑта\n"
+"на адреÑу <git@vger.kernel.org>. ДÑкуємо.\n"
+
+msgid "refusing to run without --i-still-use-this"
+msgstr "відмовлено в запуÑку без --i-still-use-this"
+
+msgid ""
+"git pack-refs [--all] [--no-prune] [--include <pattern>] [--exclude "
+"<pattern>]"
+msgstr ""
+"git pack-refs [--all] [--no-prune] [--include <шаблон>] [--exclude <шаблон>]"
+
+msgid "pack everything"
+msgstr "запакувати вÑе"
+
+msgid "prune loose refs (default)"
+msgstr "видалити вивільнені поÑÐ¸Ð»Ð°Ð½Ð½Ñ (за замовчуваннÑм)"
+
+msgid "references to include"
+msgstr "поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð´Ð»Ñ Ð²ÐºÐ»ÑŽÑ‡ÐµÐ½Ð½Ñ"
+
+msgid "references to exclude"
+msgstr "поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð´Ð»Ñ Ð²Ð¸ÐºÐ»ÑŽÑ‡ÐµÐ½Ð½Ñ"
+
+msgid "git patch-id [--stable | --unstable | --verbatim]"
+msgstr "git patch-id [--stable | --unstable | --verbatim]"
+
+msgid "use the unstable patch-id algorithm"
+msgstr "викориÑтовувати неÑтабільний алгоритм ідентифікатора латки"
+
+msgid "use the stable patch-id algorithm"
+msgstr "викориÑтовувати Ñтабільний алгоритм ідентифікатора латки"
+
+msgid "don't strip whitespace from the patch"
+msgstr "не прибирати пробіли з латки"
+
+msgid "git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"
+msgstr "git prune [-n] [-v] [--progress] [--expire <чаÑ>] [--] [<верхівка>...]"
+
+msgid "report pruned objects"
+msgstr "повідомлÑти про видалені обʼєкти"
+
+msgid "expire objects older than <time>"
+msgstr "видалити обʼєкти Ñтаріші за <чаÑ>"
+
+msgid "limit traversal to objects outside promisor packfiles"
+msgstr "обмежити обхід об’єктами за межами promisor пакунків"
+
+msgid "cannot prune in a precious-objects repo"
+msgstr "неможливо виконати Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð² precious-objects Ñховищі"
+
+msgid "git pull [<options>] [<repository> [<refspec>...]]"
+msgstr "git pull [<опції>] [<Ñховище> [<визначник поÑиланнÑ>...]]"
+
+msgid "control for recursive fetching of submodules"
+msgstr "ÑƒÐ¿Ñ€Ð°Ð²Ð»Ñ–Ð½Ð½Ñ Ñ€ÐµÐºÑƒÑ€Ñивним отриманнÑм підмодулів"
+
+msgid "Options related to merging"
+msgstr "Опції, повʼÑзані зі злиттÑм"
+
+msgid "incorporate changes by rebasing rather than merging"
+msgstr "вноÑити зміни через перебазуваннÑ, а не злиттÑ"
+
+msgid "allow fast-forward"
+msgstr "дозволити Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¿ÐµÑ€ÐµÐ´"
+
+msgid "control use of pre-merge-commit and commit-msg hooks"
+msgstr "контролювати викориÑÑ‚Ð°Ð½Ð½Ñ Ð³Ð°Ñ‡ÐºÑ–Ð² pre-merge-commit та commit-msg"
+
+msgid "automatically stash/stash pop before and after"
+msgstr "автоматично додавати до та забирати зі Ñхову перед Ñ– піÑлÑ"
+
+msgid "Options related to fetching"
+msgstr "Опції, пов’Ñзані з отриманнÑм"
+
+msgid "force overwrite of local branch"
+msgstr "примуÑовий Ð¿ÐµÑ€ÐµÐ·Ð°Ð¿Ð¸Ñ Ð»Ð¾ÐºÐ°Ð»ÑŒÐ½Ð¾Ñ— гілки"
+
+msgid "number of submodules pulled in parallel"
+msgstr "кількіÑÑ‚ÑŒ підмодулів, що затÑгуютьÑÑ Ð¿Ð°Ñ€Ð°Ð»ÐµÐ»ÑŒÐ½Ð¾"
+
+msgid "use IPv4 addresses only"
+msgstr "викориÑтовувати тільки IPv4 адреÑи"
+
+msgid "use IPv6 addresses only"
+msgstr "викориÑтовувати тільки IPv6 адреÑи"
+
+msgid ""
+"There is no candidate for rebasing against among the refs that you just "
+"fetched."
+msgstr ""
+"Серед щойно отриманих поÑилань немає кандидата, відноÑно Ñкого можна "
+"виконати перебазуваннÑ."
+
+msgid ""
+"There are no candidates for merging among the refs that you just fetched."
+msgstr "Серед щойно отриманих поÑилань немає кандидатів на злиттÑ."
+
+msgid ""
+"Generally this means that you provided a wildcard refspec which had no\n"
+"matches on the remote end."
+msgstr ""
+"Зазвичай це означає, що Ð´Ð»Ñ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð½Ð¸ÐºÐ° поÑиланнÑ, ви ввели Ñимвол "
+"підÑтановки, Ñкий не має збігів на віддаленому призначені."
+
+#, c-format
+msgid ""
+"You asked to pull from the remote '%s', but did not specify\n"
+"a branch. Because this is not the default configured remote\n"
+"for your current branch, you must specify a branch on the command line."
+msgstr ""
+"Ви попроÑили затÑгнути з віддаленого \"%s\", але не вказали\n"
+"гілку. ОÑкільки це не типове віддалене призначеннÑ\n"
+"Ð´Ð»Ñ Ð²Ð°ÑˆÐ¾Ñ— поточної гілки, вам треба вказати гілку у командному Ñ€Ñдку."
+
+msgid "You are not currently on a branch."
+msgstr "Ðаразі ви не на гілці."
+
+msgid "Please specify which branch you want to rebase against."
+msgstr ""
+"Будь лаÑка, вкажіть, відноÑно Ñкої гілки ви хочете виконати перебазуваннÑ."
+
+msgid "Please specify which branch you want to merge with."
+msgstr "Будь лаÑка, вкажіть, з Ñкою гілкою ви хочете виконати злиттÑ."
+
+msgid "See git-pull(1) for details."
+msgstr "ДивітьÑÑ git-pull(1) Ð´Ð»Ñ Ð±Ñ–Ð»ÑŒÑˆ детальної інформації."
+
+msgid "<remote>"
+msgstr "<віддалене-призначеннÑ>"
+
+msgid "<branch>"
+msgstr "<гілка>"
+
+msgid "There is no tracking information for the current branch."
+msgstr "Ðемає інформації Ð´Ð»Ñ Ð²Ñ–Ð´ÑÑ‚ÐµÐ¶ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð¾Ñ‚Ð¾Ñ‡Ð½Ð¾Ñ— гілки."
+
+msgid ""
+"If you wish to set tracking information for this branch you can do so with:"
+msgstr ""
+"Якщо ви бажаєте вÑтановити інформацію Ð´Ð»Ñ Ð²Ñ–Ð´ÑÑ‚ÐµÐ¶ÑƒÐ²Ð°Ð½Ð½Ñ Ñ†Ñ–Ñ”Ñ— гілки, ви "
+"можете зробити це за допомогою:"
+
+#, c-format
+msgid ""
+"Your configuration specifies to merge with the ref '%s'\n"
+"from the remote, but no such ref was fetched."
+msgstr ""
+"У вашій конфігурації вказано робити Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð· поÑиланнÑм \"%s\"\n"
+"з віддаленого призначеннÑ, але такого поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ðµ було отримано."
+
+#, c-format
+msgid "unable to access commit %s"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ доÑтуп до коміту %s"
+
+msgid "ignoring --verify-signatures for rebase"
+msgstr "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ --verify-signatures Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ"
+
+msgid ""
+"You have divergent branches and need to specify how to reconcile them.\n"
+"You can do so by running one of the following commands sometime before\n"
+"your next pull:\n"
+"\n"
+" git config pull.rebase false # merge\n"
+" git config pull.rebase true # rebase\n"
+" git config pull.ff only # fast-forward only\n"
+"\n"
+"You can replace \"git config\" with \"git config --global\" to set a "
+"default\n"
+"preference for all repositories. You can also pass --rebase, --no-rebase,\n"
+"or --ff-only on the command line to override the configured default per\n"
+"invocation.\n"
+msgstr ""
+"У Ð²Ð°Ñ Ñ” розбіжні гілки, Ñ– вам потрібно вказати, Ñк Ñ—Ñ… узгодити.\n"
+"Ви можете зробити це, виконавши одну з наÑтупних команд \n"
+"до вашого наÑтупного затÑгуваннÑ:\n"
+"\n"
+" git config pull.rebase false # merge\n"
+" git config pull.rebase true # rebase\n"
+" git config pull.ff only # fast-forward only\n"
+"\n"
+"Ви можете замінити \"git config\" на \"git config --global\", щоб вÑтановити "
+"Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð° замовчуваннÑм\n"
+"Ð´Ð»Ñ Ð²ÑÑ–Ñ… Ñховищ. Ви також можете передати --rebase, --no-rebase,\n"
+"або --ff-only у командному Ñ€Ñдку, щоб перевизначити Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð° "
+"замовчуваннÑм Ð´Ð»Ñ ÐºÐ¾Ð¶Ð½Ð¾Ð³Ð¾\n"
+"виклику.\n"
+
+msgid "Updating an unborn branch with changes added to the index."
+msgstr "ÐžÐ½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð½ÐµÐ½Ð°Ñ€Ð¾Ð´Ð¶ÐµÐ½Ð¾Ñ— гілки зі змінами, доданими до індекÑу."
+
+msgid "pull with rebase"
+msgstr "затÑгнути з перебазуваннÑм"
+
+msgid "Please commit or stash them."
+msgstr "Будь лаÑка, зробіть коміт або додайте зміни до Ñхову."
+
+#, c-format
+msgid ""
+"fetch updated the current branch head.\n"
+"fast-forwarding your working tree from\n"
+"commit %s."
+msgstr ""
+"Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð¾Ð½Ð¾Ð²Ð¸Ð»Ð¾ верхівку поточної гілки.\n"
+"Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¿ÐµÑ€ÐµÐ´ вашого робочого дерева з\n"
+"коміту %s."
+
+#, c-format
+msgid ""
+"Cannot fast-forward your working tree.\n"
+"After making sure that you saved anything precious from\n"
+"$ git diff %s\n"
+"output, run\n"
+"$ git reset --hard\n"
+"to recover."
+msgstr ""
+"Ðеможливо перемотати вперед ваше робоче дерево.\n"
+"ПереконавшиÑÑŒ, що ви зберегли вÑе цінне з\n"
+"$ git diff %s\n"
+"виводу, виконайте\n"
+"$ git reset --hard\n"
+"Ð´Ð»Ñ Ð²Ñ–Ð´Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ."
+
+msgid "Cannot merge multiple branches into empty head."
+msgstr "Ðеможливо злити кілька гілок до порожньої верхівки."
+
+msgid "Cannot rebase onto multiple branches."
+msgstr "Ðеможливо перебазувати на кілька гілок."
+
+msgid "Cannot fast-forward to multiple branches."
+msgstr "Ðеможливо перемотати вперед кілька гілок."
+
+msgid "Need to specify how to reconcile divergent branches."
+msgstr "Потрібно вказати, Ñк узгоджувати розбіжні гілки."
+
+msgid "cannot rebase with locally recorded submodule modifications"
+msgstr "неможливо перебазувати з локально запиÑаними модифікаціÑми підмодулÑ"
+
+msgid "git push [<options>] [<repository> [<refspec>...]]"
+msgstr "git push [<опції>] [<Ñховище> [<визначник поÑиланнÑ>...]]"
+
+msgid "tag shorthand without <tag>"
+msgstr "ÑÐºÐ¾Ñ€Ð¾Ñ‡ÐµÐ½Ð½Ñ Ñ‚ÐµÐ³Ñƒ без <тег>"
+
+msgid "--delete only accepts plain target ref names"
+msgstr "--delete приймає лише проÑÑ‚Ñ– назви поÑилань"
+
+msgid ""
+"\n"
+"To choose either option permanently, see push.default in 'git help config'.\n"
+msgstr ""
+"\n"
+"Щоб обрати будь-Ñку з опцій поÑтійною, ÑкориÑтайтеÑÑŒ опцією push.default у "
+"'git help config'.\n"
+
+msgid ""
+"\n"
+"To avoid automatically configuring an upstream branch when its name\n"
+"won't match the local branch, see option 'simple' of branch.autoSetupMerge\n"
+"in 'git help config'.\n"
+msgstr ""
+"\n"
+"Щоб уникнути автоматичного Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¸Ñхідної гілки, Ñкщо Ñ—Ñ— назва\n"
+"не збігаєтьÑÑ Ð· назвою локальної гілки, ÑкориÑтайтеÑÑŒ опцією 'simple' Ð´Ð»Ñ "
+"branch.autoSetupMerge\n"
+"у “git help configâ€.\n"
+
+#, c-format
+msgid ""
+"The upstream branch of your current branch does not match\n"
+"the name of your current branch. To push to the upstream branch\n"
+"on the remote, use\n"
+"\n"
+" git push %s HEAD:%s\n"
+"\n"
+"To push to the branch of the same name on the remote, use\n"
+"\n"
+" git push %s HEAD\n"
+"%s%s"
+msgstr ""
+"Ðазва виÑхідної гілки Ð´Ð»Ñ Ð²Ð°ÑˆÐ¾Ñ— поточної гілки не збігаєтьÑÑ Ð·\n"
+"назвою вашої поточної гілки. Щоб надіÑлати до виÑхідної гілки,\n"
+"ÑкориÑтайтеÑÑŒ командою\n"
+"\n"
+" git push %s HEAD:%s\n"
+"\n"
+"Щоб надіÑлати до однойменної гілки на віддаленому Ñервері ÑкориÑтайтеÑÑŒ\n"
+"\n"
+" git push %s HEAD\n"
+"%s%s"
+
+#, c-format
+msgid ""
+"You are not currently on a branch.\n"
+"To push the history leading to the current (detached HEAD)\n"
+"state now, use\n"
+"\n"
+" git push %s HEAD:<name-of-remote-branch>\n"
+msgstr ""
+"Ви зараз не перебуваєте на гілці.\n"
+"Щоб надіÑлати Ñ–Ñторію, що веде до поточного (відокремленого HEAD)\n"
+"Ñтану, ÑкориÑтайтеÑÑŒ командою\n"
+"\n"
+" git push %s HEAD:<назва-віддаленої-гілки>\n"
+
+msgid ""
+"\n"
+"To have this happen automatically for branches without a tracking\n"
+"upstream, see 'push.autoSetupRemote' in 'git help config'.\n"
+msgstr ""
+"\n"
+"Щоб це відбувалоÑÑ Ð°Ð²Ñ‚Ð¾Ð¼Ð°Ñ‚Ð¸Ñ‡Ð½Ð¾ Ð´Ð»Ñ Ð½ÐµÐ²Ñ–Ð´Ñтежуваних гілок\n"
+"першоджерельного Ñховища, дивітьÑÑ 'push.autoSetupRemote' у 'git help "
+"config'.\n"
+
+#, c-format
+msgid ""
+"The current branch %s has no upstream branch.\n"
+"To push the current branch and set the remote as upstream, use\n"
+"\n"
+" git push --set-upstream %s %s\n"
+"%s"
+msgstr ""
+"Поточна гілка %s не має виÑхідної гілки.\n"
+"Щоб надіÑлати поточну гілку Ñ– вÑтановити віддалене Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ "
+"першоджерельним Ñховищем, ÑкориÑтайтеÑÑŒ\n"
+"\n"
+" git push --set-upstream %s %s\n"
+"%s"
+
+#, c-format
+msgid "The current branch %s has multiple upstream branches, refusing to push."
+msgstr "Поточна гілка %s має кілька виÑхідних гілок, відмовлено в надÑиланні."
+
+msgid ""
+"You didn't specify any refspecs to push, and push.default is \"nothing\"."
+msgstr ""
+"Ви не вказали жодних визначників поÑилань Ð´Ð»Ñ Ð½Ð°Ð´ÑиланнÑ, Ñ– push.default "
+"дорівнює \"nothing\"."
+
+#, c-format
+msgid ""
+"You are pushing to remote '%s', which is not the upstream of\n"
+"your current branch '%s', without telling me what to push\n"
+"to update which remote branch."
+msgstr ""
+"Ви надÑилаєте до віддаленої гілки \"%s\", Ñка не Ñ” першоджерелом\n"
+"вашої поточної гілки \"%s\", не кажучі мені, що надÑилати\n"
+"Ñ– Ñку віддалену гілку оновлювати."
+
+msgid ""
+"Updates were rejected because the tip of your current branch is behind\n"
+"its remote counterpart. If you want to integrate the remote changes,\n"
+"use 'git pull' before pushing again.\n"
+"See the 'Note about fast-forwards' in 'git push --help' for details."
+msgstr ""
+"ÐžÐ½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð±ÑƒÐ»Ð¸ відхилені, оÑкільки верхівка вашої поточної гілки знаходитьÑÑ "
+"позаду\n"
+"її віддаленого аналога. Якщо ви хочете інтегрувати віддалені зміни,\n"
+"ÑкориÑтайтеÑÑŒ командою \"git pull\" перед повторним надÑиланнÑм.\n"
+"Докладні відомоÑÑ‚Ñ– наведено у розділі \"Ð—Ð°ÑƒÐ²Ð°Ð¶ÐµÐ½Ð½Ñ Ñ‰Ð¾Ð´Ð¾ Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ "
+"вперед\" команди \"git push --help\"."
+
+msgid ""
+"Updates were rejected because a pushed branch tip is behind its remote\n"
+"counterpart. If you want to integrate the remote changes, use 'git pull'\n"
+"before pushing again.\n"
+"See the 'Note about fast-forwards' in 'git push --help' for details."
+msgstr ""
+"ÐžÐ½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð±ÑƒÐ»Ð¸ відхилені, оÑкільки верхівка надіÑланої гілки знаходитьÑÑ "
+"позаду\n"
+"її віддаленого аналога. Якщо ви хочете інтегрувати віддалені зміни, "
+"ÑкориÑтайтеÑÑŒ командою \"git pull\"\n"
+"перед повторним надÑиланнÑм.\n"
+"Докладні відомоÑÑ‚Ñ– наведено у розділі \"Ð—Ð°ÑƒÐ²Ð°Ð¶ÐµÐ½Ð½Ñ Ñ‰Ð¾Ð´Ð¾ Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ "
+"вперед\" команди \"git push --help\"."
+
+msgid ""
+"Updates were rejected because the remote contains work that you do not\n"
+"have locally. This is usually caused by another repository pushing to\n"
+"the same ref. If you want to integrate the remote changes, use\n"
+"'git pull' before pushing again.\n"
+"See the 'Note about fast-forwards' in 'git push --help' for details."
+msgstr ""
+"ÐžÐ½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð±ÑƒÐ»Ð¸ відхилені, оÑкільки у віддаленому Ñховищі міÑтитьÑÑ Ñ€Ð¾Ð±Ð¾Ñ‚Ð°, "
+"Ñкої\n"
+"немає локально. Зазвичай це ÑтаєтьÑÑ, коли інше Ñховище надÑилає\n"
+"до того Ñамого поÑиланнÑ. Якщо ви хочете інтегрувати віддалені зміни,\n"
+"ÑкориÑтайтеÑÑŒ командою \"git pull\" перед повторним надÑиланнÑм.\n"
+"Докладні відомоÑÑ‚Ñ– наведено у розділі \"Ð—Ð°ÑƒÐ²Ð°Ð¶ÐµÐ½Ð½Ñ Ñ‰Ð¾Ð´Ð¾ Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ "
+"вперед\" команди \"git push --help\"."
+
+msgid "Updates were rejected because the tag already exists in the remote."
+msgstr ""
+"ÐžÐ½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð±ÑƒÐ»Ð¸ відхилені, оÑкільки тег вже Ñ–Ñнує на віддаленому Ñховищі."
+
+msgid ""
+"You cannot update a remote ref that points at a non-commit object,\n"
+"or update a remote ref to make it point at a non-commit object,\n"
+"without using the '--force' option.\n"
+msgstr ""
+"Ви не можете оновити віддалене поÑиланнÑ, Ñке вказує на об’єкт, що не Ñ” "
+"об’єктом коміту,\n"
+"або оновити віддалене поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ñ‚Ð°Ðº, щоб воно вказувало на об’єкт, що не Ñ” "
+"об’єктом коміту,\n"
+"без викориÑÑ‚Ð°Ð½Ð½Ñ Ð¾Ð¿Ñ†Ñ–Ñ— \"--force\".\n"
+
+msgid ""
+"Updates were rejected because the tip of the remote-tracking branch has\n"
+"been updated since the last checkout. If you want to integrate the\n"
+"remote changes, use 'git pull' before pushing again.\n"
+"See the 'Note about fast-forwards' in 'git push --help' for details."
+msgstr ""
+"ÐžÐ½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð±ÑƒÐ»Ð¸ відхилені, оÑкільки верхівка віддалено відÑтежуваної гілки "
+"була\n"
+"оновлена з чаÑу оÑтанньої Ñинхронізації. Якщо ви хочете інтегрувати "
+"віддалені зміни,\n"
+"ÑкориÑтайтеÑÑŒ командою \"git pull\" перед повторним надÑиланнÑм.\n"
+"Докладні відомоÑÑ‚Ñ– наведено у розділі \"Ð—Ð°ÑƒÐ²Ð°Ð¶ÐµÐ½Ð½Ñ Ñ‰Ð¾Ð´Ð¾ Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ "
+"вперед\" команди \"git push --help\"."
+
+#, c-format
+msgid "Pushing to %s\n"
+msgstr "ÐадÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð´Ð¾ %s\n"
+
+#, c-format
+msgid "failed to push some refs to '%s'"
+msgstr "не вдалоÑÑ Ð½Ð°Ð´Ñ–Ñлати деÑкі поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð´Ð¾ '%s'"
+
+msgid ""
+"recursing into submodule with push.recurseSubmodules=only; using on-demand "
+"instead"
+msgstr ""
+"рекурÑÑ–Ñ Ð² підмодулі з push.recurseSubmodules=only; натоміÑÑ‚ÑŒ викориÑтовую "
+"on-demand"
+
+#, c-format
+msgid "invalid value for '%s'"
+msgstr "неприпуÑтиме Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ '%s'"
+
+msgid "repository"
+msgstr "Ñховище"
+
+msgid "push all branches"
+msgstr "надіÑлати вÑÑ– гілки"
+
+msgid "mirror all refs"
+msgstr "віддзеркалити вÑÑ– поÑиланнÑ"
+
+msgid "delete refs"
+msgstr "видалити поÑиланнÑ"
+
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr ""
+"надіÑлати теги (не можна викориÑтовувати з --all, --branches або --mirror)"
+
+msgid "force updates"
+msgstr "оновити примуÑово"
+
+msgid "<refname>:<expect>"
+msgstr "<refname>:<expect>"
+
+msgid "require old value of ref to be at this value"
+msgstr "вимагати, щоб Ñтаре Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾ÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð±ÑƒÐ»Ð¾ рівним цьому значенню"
+
+msgid "require remote updates to be integrated locally"
+msgstr "вимагати локальної інтеграції віддалених оновлень"
+
+msgid "control recursive pushing of submodules"
+msgstr "контролювати рекурÑивне надÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ–Ð²"
+
+msgid "use thin pack"
+msgstr "викориÑтовувати тонке пакуваннÑ"
+
+msgid "receive pack program"
+msgstr "отримати пакетну програму"
+
+msgid "set upstream for git pull/status"
+msgstr "вÑтановити першоджерельне Ñховище Ð´Ð»Ñ git pull/status"
+
+msgid "prune locally removed refs"
+msgstr "обрізати локально видалені поÑиланнÑ"
+
+msgid "bypass pre-push hook"
+msgstr "обійти pre-push гачок"
+
+msgid "push missing but relevant tags"
+msgstr "надÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð²Ñ–Ð´Ñутнє, але Ñ” релевантні теги"
+
+msgid "GPG sign the push"
+msgstr "підпиÑати надÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð·Ð° допомогою GPG"
+
+msgid "request atomic transaction on remote side"
+msgstr "запроÑити атомарну транзакцію на віддаленій Ñтороні"
+
+msgid "--delete doesn't make sense without any refs"
+msgstr "--delete не має ÑенÑу без поÑилань"
+
+#, c-format
+msgid "bad repository '%s'"
+msgstr "невірне Ñховище \"%s\""
+
+msgid ""
+"No configured push destination.\n"
+"Either specify the URL from the command-line or configure a remote "
+"repository using\n"
+"\n"
+" git remote add <name> <url>\n"
+"\n"
+"and then push using the remote name\n"
+"\n"
+" git push <name>\n"
+msgstr ""
+"Ðемає налаштованого міÑÑ†Ñ Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ð°Ð´ÑиланнÑ.\n"
+"Ðбо зазначте URL-адреÑу з командного Ñ€Ñдка, або налаштуйте віддалене Ñховище "
+"за допомогою\n"
+"\n"
+" git remote add <назва> <адреÑа>\n"
+"\n"
+"а потім виконайте надÑиланнÑ, викориÑтовуючи назву віддаленого Ñховища\n"
+"\n"
+" git push <ім'Ñ>\n"
+
+msgid "--all can't be combined with refspecs"
+msgstr "--all не можна комбінувати з визначниками поÑилань"
+
+msgid "--mirror can't be combined with refspecs"
+msgstr "--mirror не можна комбінувати з визначниками поÑилань"
+
+msgid "push options must not have new line characters"
+msgstr "опції push не можуть міÑтити Ñимволи нового Ñ€Ñдка"
+
+msgid "git range-diff [<options>] <old-base>..<old-tip> <new-base>..<new-tip>"
+msgstr ""
+"git range-diff [<опції>] <Ñтара-база>..<Ñтара-верхівка> <нова-база>..<нова-"
+"верхівка>"
+
+msgid "git range-diff [<options>] <old-tip>...<new-tip>"
+msgstr "git range-diff [<опції>] <Ñтара-верхівка>...<нова-верхівка>"
+
+msgid "git range-diff [<options>] <base> <old-tip> <new-tip>"
+msgstr "git range-diff [<опції>] <база> <Ñтара-верхівка> <нова-верхівка>"
+
+msgid "use simple diff colors"
+msgstr "викориÑтовувати проÑÑ‚Ñ– кольори diff"
+
+msgid "notes"
+msgstr "нотатки"
+
+msgid "passed to 'git log'"
+msgstr "передано до \"git log\""
+
+msgid "only emit output related to the first range"
+msgstr "видати тільки вивід, що відноÑитьÑÑ Ð´Ð¾ першого діапазону"
+
+msgid "only emit output related to the second range"
+msgstr "видати тільки вивід, що відноÑитьÑÑ Ð´Ð¾ другого діапазону"
+
+#, c-format
+msgid "not a revision: '%s'"
+msgstr "не є ревізією: \"%s\""
+
+#, c-format
+msgid "not a commit range: '%s'"
+msgstr "не діапазон комітів: \"%s\""
+
+#, c-format
+msgid "not a symmetric range: '%s'"
+msgstr "не Ñиметричний діапазон: \"%s\""
+
+msgid "need two commit ranges"
+msgstr "потрібно два діапазони комітів"
+
+msgid ""
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<prefix>)\n"
+" [-u | -i]] [--index-output=<file>] [--no-sparse-checkout]\n"
+" (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"
+msgstr ""
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<префікÑ>)\n"
+" [-u | -i]] [--index-output=<файл>] [--no-sparse-checkout]\n"
+" (--empty | <деревоподібне-джерело1> [<деревоподібне-джерело2> "
+"[<деревоподібне-джерело3>]])"
+
+msgid "write resulting index to <file>"
+msgstr "запиÑати отриманий Ñ–Ð½Ð´ÐµÐºÑ Ñƒ <файл>"
+
+msgid "only empty the index"
+msgstr "тільки очиÑтити індекÑ"
+
+msgid "Merging"
+msgstr "ЗлиттÑ"
+
+msgid "perform a merge in addition to a read"
+msgstr "виконати Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ð° додачу до читаннÑ"
+
+msgid "3-way merge if no file level merging required"
+msgstr "3-Ñтороннє злиттÑ, при відÑутноÑÑ‚Ñ– потреби в злитті на рівні файлів"
+
+msgid "3-way merge in presence of adds and removes"
+msgstr "3-Ñтороннє Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð·Ð° наÑвноÑÑ‚Ñ– Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ñ‚Ð° видаленнÑ"
+
+msgid "same as -m, but discard unmerged entries"
+msgstr "те Ñаме, що й -m, але відкидає не злиті запиÑи"
+
+msgid "<subdirectory>/"
+msgstr "<піддиректоріÑ>/"
+
+msgid "read the tree into the index under <subdirectory>/"
+msgstr "зчитати дерево в Ñ–Ð½Ð´ÐµÐºÑ Ð¿Ñ–Ð´ <піддиректорію>/"
+
+msgid "update working tree with merge result"
+msgstr "оновити робоче дерево результатом злиттÑ"
+
+msgid "gitignore"
+msgstr "gitignore"
+
+msgid "allow explicitly ignored files to be overwritten"
+msgstr "дозволити Ð¿ÐµÑ€ÐµÐ·Ð°Ð¿Ð¸Ñ Ñвно проігнорованих файлів"
+
+msgid "don't check the working tree after merging"
+msgstr "не перевірÑти робоче дерево піÑÐ»Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ"
+
+msgid "don't update the index or the work tree"
+msgstr "не оновлювати Ñ–Ð½Ð´ÐµÐºÑ Ð°Ð±Ð¾ робоче дерево"
+
+msgid "skip applying sparse checkout filter"
+msgstr "пропуÑтити заÑтоÑÑƒÐ²Ð°Ð½Ð½Ñ sparse checkout фільтра"
+
+msgid "debug unpack-trees"
+msgstr "відлагодити unpack-trees"
+
+msgid "suppress feedback messages"
+msgstr "не показувати Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð·Ð²Ð¾Ñ€Ð¾Ñ‚Ð½Ð¾Ð³Ð¾ звʼÑзку"
+
+msgid "You need to resolve your current index first"
+msgstr "Спочатку вам потрібно розвʼÑзати поточний індекÑ"
+
+msgid ""
+"git rebase [-i] [options] [--exec <cmd>] [--onto <newbase> | --keep-base] "
+"[<upstream> [<branch>]]"
+msgstr ""
+"git rebase [-i] [опції] [--exec <команда>] [--onto <нова-база> | --keep-"
+"base] [<першоджерельне-Ñховище> [<гілка>]]"
+
+msgid ""
+"git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]"
+msgstr ""
+"git rebase [-i] [опції] [--exec <команда>] [--onto <нова-база>] --root "
+"[<гілка>]"
+
+#, c-format
+msgid "could not read '%s'."
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ \"%s\"."
+
+#, c-format
+msgid "could not create temporary %s"
+msgstr "не вдалоÑÑ Ñтворити тимчаÑовий %s"
+
+msgid "could not mark as interactive"
+msgstr "не вдалоÑÑ Ð¿Ð¾Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ Ñк інтерактивний"
+
+msgid "could not generate todo list"
+msgstr "не вдалоÑÑ Ñтворити ÑпиÑок Ñправ"
+
+msgid "a base commit must be provided with --upstream or --onto"
+msgstr "базовий коміт має бути наданий з --upstream або --onto"
+
+#, c-format
+msgid "%s requires the merge backend"
+msgstr "%s потребує обробника злиттÑ"
+
+#, c-format
+msgid "invalid onto: '%s'"
+msgstr "неприпуÑтимий onto: \"%s\""
+
+#, c-format
+msgid "invalid orig-head: '%s'"
+msgstr "неприпуÑтимий orig-head: \"%s\""
+
+#, c-format
+msgid "ignoring invalid allow_rerere_autoupdate: '%s'"
+msgstr "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð½ÐµÐ¿Ñ€Ð¸Ð¿ÑƒÑтимого allow_rerere_autoupdate: \"%s\""
+
+#, c-format
+msgid "could not remove '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ \"%s\""
+
+msgid ""
+"Resolve all conflicts manually, mark them as resolved with\n"
+"\"git add/rm <conflicted_files>\", then run \"git rebase --continue\".\n"
+"You can instead skip this commit: run \"git rebase --skip\".\n"
+"To abort and get back to the state before \"git rebase\", run \"git rebase --"
+"abort\"."
+msgstr ""
+"Вирішіть уÑÑ– конфлікти вручну, позначте Ñ—Ñ… Ñк вирішені за допомогою\n"
+"\"git add/rm <конфліктні_файли>\", а потім виконайте \"git rebase --"
+"continue\".\n"
+"ЗаміÑÑ‚ÑŒ цього ви можете пропуÑтити цей коміт: виконайте \"git rebase --"
+"skip\".\n"
+"Щоб перервати Ð¿Ñ€Ð¾Ñ†ÐµÑ Ñ– повернутиÑÑ Ð´Ð¾ Ñтану перед \"git rebase\", виконайте "
+"\"git rebase --abort\"."
+
+#, c-format
+msgid ""
+"\n"
+"git encountered an error while preparing the patches to replay\n"
+"these revisions:\n"
+"\n"
+" %s\n"
+"\n"
+"As a result, git cannot rebase them."
+msgstr ""
+"\n"
+"git зіткнувÑÑ Ð· помилкою під Ñ‡Ð°Ñ Ð¿Ñ–Ð´Ð³Ð¾Ñ‚Ð¾Ð²ÐºÐ¸ латок Ð´Ð»Ñ Ð²Ñ–Ð´Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ\n"
+"цих ревізій:\n"
+"\n"
+" %s\n"
+"\n"
+"ВнаÑлідок цього git не може Ñ—Ñ… перебазувати."
+
+#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "Ðевідомий режим перебазуваннÑ-злиттÑ: %s"
+
+#, c-format
+msgid "could not switch to %s"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐºÐ»ÑŽÑ‡Ð¸Ñ‚Ð¸ÑÑŒ на %s"
+
+msgid "apply options and merge options cannot be used together"
+msgstr "apply опції не можна викориÑтовувати разом з merge опціÑми"
+
+#, c-format
+msgid ""
+"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and "
+"\"ask\"."
+msgstr ""
+"нерозпізнаний порожній тип \"%s\"; припуÑтимими значеннÑми Ñ” \"drop\", "
+"\"keep\" та \"ask\"."
+
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"Команда --rebase-merges з порожнім Ñтроковим аргументом Ñ” заÑтарілою Ñ– "
+"переÑтане працювати у наÑтупній верÑÑ–Ñ— Git. ЗаміÑÑ‚ÑŒ цього ÑкориÑтайтеÑÑŒ "
+"командою --rebase-merges без аргументу, Ñкий робить те Ñаме."
+
+#, c-format
+msgid ""
+"%s\n"
+"Please specify which branch you want to rebase against.\n"
+"See git-rebase(1) for details.\n"
+"\n"
+" git rebase '<branch>'\n"
+"\n"
+msgstr ""
+"%s\n"
+"Будь лаÑка, вкажіть гілку, відноÑно Ñкої ви хочете виконати перебазуваннÑ.\n"
+"ДивітьÑÑ git-rebase(1) Ð´Ð»Ñ Ð´ÐµÑ‚Ð°Ð»ÑŒÐ½Ð¾Ñ— інформації.\n"
+"\n"
+" git rebase \"<гілка>\"\n"
+"\n"
+"\n"
+
+#, c-format
+msgid ""
+"If you wish to set tracking information for this branch you can do so with:\n"
+"\n"
+" git branch --set-upstream-to=%s/<branch> %s\n"
+"\n"
+msgstr ""
+"Якщо ви бажаєте налаштувати відÑÑ‚ÐµÐ¶ÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð»Ñ Ñ†Ñ–Ñ”Ñ— гілки, ви можете зробити "
+"це за допомогою:\n"
+"\n"
+" git branch --set-upstream-to=%s/<гілка> %s\n"
+"\n"
+
+msgid "exec commands cannot contain newlines"
+msgstr "команди exec не можуть міÑтити Ñимволи нового Ñ€Ñдка"
+
+msgid "empty exec command"
+msgstr "Ð¿Ð¾Ñ€Ð¾Ð¶Ð½Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° exec"
+
+msgid "rebase onto given branch instead of upstream"
+msgstr "перебазувати на задану гілку заміÑÑ‚ÑŒ першоджерельного Ñховища"
+
+msgid "use the merge-base of upstream and branch as the current base"
+msgstr ""
+"викориÑтовувати базу Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð¿ÐµÑ€ÑˆÐ¾Ð´Ð¶ÐµÑ€ÐµÐ»ÑŒÐ½Ð¾Ð³Ð¾ Ñховища та гілки Ñк поточну базу"
+
+msgid "allow pre-rebase hook to run"
+msgstr "дозволити запуÑк pre-rebase гачка"
+
+msgid "be quiet. implies --no-stat"
+msgstr "працювати тихеÑенько. МаєтьÑÑ Ð½Ð° увазі --no-stat"
+
+msgid "display a diffstat of what changed upstream"
+msgstr "відображати diffstat того, що змінилоÑÑ Ñƒ першоджерельному Ñховищі"
+
+msgid "do not show diffstat of what changed upstream"
+msgstr "не відображати diffstat того, що змінилоÑÑ Ñƒ першоджерельному Ñховищі"
+
+msgid "add a Signed-off-by trailer to each commit"
+msgstr "додати Signed-off-by причіп до кожного коміту"
+
+msgid "make committer date match author date"
+msgstr "зробити так, щоб дата комітера збігалаÑÑ Ð· датою автора"
+
+msgid "ignore author date and use current date"
+msgstr "ігнорувати дату автора та викориÑтати поточну дату"
+
+msgid "synonym of --reset-author-date"
+msgstr "Ñинонім --reset-author-date"
+
+msgid "passed to 'git apply'"
+msgstr "передано в \"git apply\""
+
+msgid "ignore changes in whitespace"
+msgstr "ігнорувати зміни в пробілах"
+
+msgid "cherry-pick all commits, even if unchanged"
+msgstr "виÑмикнути вÑÑ– коміти, навіть Ñкщо вони не змінені"
+
+msgid "continue"
+msgstr "продовжити"
+
+msgid "skip current patch and continue"
+msgstr "пропуÑтити поточну латку Ñ– продовжити"
+
+msgid "abort and check out the original branch"
+msgstr "перервати і перейти до початкової гілки"
+
+msgid "abort but keep HEAD where it is"
+msgstr "перервати, але залишити HEAD на міÑці"
+
+msgid "edit the todo list during an interactive rebase"
+msgstr "редагувати ÑпиÑок Ñправ під Ñ‡Ð°Ñ Ñ–Ð½Ñ‚ÐµÑ€Ð°ÐºÑ‚Ð¸Ð²Ð½Ð¾Ð³Ð¾ перебазуваннÑ"
+
+msgid "show the patch file being applied or merged"
+msgstr "показати файл латки, Ñкий заÑтоÑовуєтьÑÑ Ð°Ð±Ð¾ зливаєтьÑÑ"
+
+msgid "use apply strategies to rebase"
+msgstr "викориÑтовувати Ñтратегії заÑтоÑÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ"
+
+msgid "use merging strategies to rebase"
+msgstr "викориÑтовувати Ñтратегії Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ"
+
+msgid "let the user edit the list of commits to rebase"
+msgstr "дозволити кориÑтувачеві редагувати ÑпиÑок комітів Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ"
+
+msgid "(REMOVED) was: try to recreate merges instead of ignoring them"
+msgstr ""
+"(ВИДÐЛЕÐО) було: Ñпробувати відтворити Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð·Ð°Ð¼Ñ–ÑÑ‚ÑŒ того, щоб ігнорувати Ñ—Ñ…"
+
+msgid "how to handle commits that become empty"
+msgstr "Ñк оброблÑти порожні коміти"
+
+msgid "keep commits which start empty"
+msgstr "зберігати коміти, Ñкі починаютьÑÑ Ð¿Ð¾Ñ€Ð¾Ð¶Ð½Ñ–Ð¼Ð¸"
+
+msgid "move commits that begin with squash!/fixup! under -i"
+msgstr "переміÑтити коміти, Ñкі починаютьÑÑ Ð· squash!/fixup! під -i"
+
+msgid "update branches that point to commits that are being rebased"
+msgstr ""
+"оновити гілки, Ñкі вказують на коміти, що знаходÑÑ‚ÑŒÑÑ Ð² Ñтані перебазуваннÑ"
+
+msgid "add exec lines after each commit of the editable list"
+msgstr "додати exec Ñ€Ñдки піÑÐ»Ñ ÐºÐ¾Ð¶Ð½Ð¾Ð³Ð¾ коміту редагованого ÑпиÑку"
+
+msgid "allow rebasing commits with empty messages"
+msgstr "дозволити Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñ–Ð² з порожніми допиÑами"
+
+msgid "try to rebase merges instead of skipping them"
+msgstr "Ñпробувати перебазувати Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð·Ð°Ð¼Ñ–ÑÑ‚ÑŒ того, щоб пропуÑкати Ñ—Ñ…"
+
+msgid "use 'merge-base --fork-point' to refine upstream"
+msgstr ""
+"ÑкориÑтайтеÑÑŒ \"merge-base --fork-point\", щоб зазначиити першоджерельне "
+"Ñховище"
+
+msgid "use the given merge strategy"
+msgstr "викориÑтати задану Ñтратегію злиттÑ"
+
+msgid "option"
+msgstr "опціÑ"
+
+msgid "pass the argument through to the merge strategy"
+msgstr "передати аргумент до Ñтратегії злиттÑ"
+
+msgid "rebase all reachable commits up to the root(s)"
+msgstr "перебазувати вÑÑ– доÑтупні коміти до коренÑ(ів)."
+
+msgid "automatically re-schedule any `exec` that fails"
+msgstr "автоматично переноÑити будь-Ñкий \"exec\", Ñкий завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+msgid "apply all changes, even those already present upstream"
+msgstr ""
+"заÑтоÑовувати вÑÑ– зміни, навіть Ñ‚Ñ–, що вже Ñ–Ñнують у першоджерельному Ñховищі"
+
+msgid "It looks like 'git am' is in progress. Cannot rebase."
+msgstr "Схоже, що виконуєтьÑÑ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° \"git am\". Ðеможливо перебазувати."
+
+msgid ""
+"`rebase --preserve-merges` (-p) is no longer supported.\n"
+"Use `git rebase --abort` to terminate current rebase.\n"
+"Or downgrade to v2.33, or earlier, to complete the rebase."
+msgstr ""
+"Команда \"rebase --preserve-merges\" (-p) більше не підтримуєтьÑÑ.\n"
+"СкориÑтайтеÑÑŒ \"git rebase --abort\" Ð´Ð»Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð½Ñ Ð¿Ð¾Ñ‚Ð¾Ñ‡Ð½Ð¾Ð³Ð¾ "
+"перебазуваннÑ.\n"
+"Ðбо повернітьÑÑ Ð´Ð¾ v2.33 або більш ранньої верÑÑ–Ñ—, щоб завершити "
+"перебазуваннÑ."
+
+msgid ""
+"--preserve-merges was replaced by --rebase-merges\n"
+"Note: Your `pull.rebase` configuration may also be set to 'preserve',\n"
+"which is no longer supported; use 'merges' instead"
+msgstr ""
+"--preserve-merges було замінено на --rebase-merges\n"
+"Примітка: У вашій конфігурації \"pull.rebase\" також може бути вÑтановлено у "
+"Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"preserve\",\n"
+"Ñкий більше не підтримуєтьÑÑ; натоміÑÑ‚ÑŒ викориÑтовуйте \"merges\""
+
+msgid "No rebase in progress?"
+msgstr "ÐŸÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ðµ відбуваєтьÑÑ?"
+
+msgid "The --edit-todo action can only be used during interactive rebase."
+msgstr ""
+"Дію --edit-todo можна викориÑтовувати лише під Ñ‡Ð°Ñ Ñ–Ð½Ñ‚ÐµÑ€Ð°ÐºÑ‚Ð¸Ð²Ð½Ð¾Ð³Ð¾ "
+"перебазуваннÑ."
+
+msgid "Cannot read HEAD"
+msgstr "Ðеможливо прочитати HEAD"
+
+msgid ""
+"You must edit all merge conflicts and then\n"
+"mark them as resolved using git add"
+msgstr ""
+"Ви повинні відредагувати вÑÑ– конфлікти злиттÑ, а потім\n"
+"позначити Ñ—Ñ… Ñк вирішені за допомогою git add"
+
+msgid "could not discard worktree changes"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÐ¸Ð½ÑƒÑ‚Ð¸ зміни робочого дерева"
+
+#, c-format
+msgid "could not move back to %s"
+msgstr "не вдалоÑÑ Ð¿Ð¾Ð²ÐµÑ€Ð½ÑƒÑ‚Ð¸ÑÑ Ð´Ð¾ %s"
+
+#, c-format
+msgid ""
+"It seems that there is already a %s directory, and\n"
+"I wonder if you are in the middle of another rebase. If that is the\n"
+"case, please try\n"
+"\t%s\n"
+"If that is not the case, please\n"
+"\t%s\n"
+"and run me again. I am stopping in case you still have something\n"
+"valuable there.\n"
+msgstr ""
+"ЗдаєтьÑÑ, що Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ %s вже Ñ–Ñнує, Ñ–\n"
+"можливо, ви перебуваєте у процеÑÑ– іншого перебазуваннÑ. Якщо це так,\n"
+"будь лаÑка, Ñпробуйте\n"
+"\t%s\n"
+"Якщо це не так, Ñпробуйте\n"
+"\t%s\n"
+"Ñ– запуÑÑ‚Ñ–Ñ‚ÑŒ команду ще раз. Зупинка на випадок, Ñкщо там у Ð²Ð°Ñ Ð²Ñе ще Ñ” "
+"щоÑÑŒ\n"
+"цінне.\n"
+
+msgid "switch `C' expects a numerical value"
+msgstr "перемикач \"C\" очікує чиÑлове значеннÑ"
+
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges. Consider adding --"
+"no-rebase-merges"
+msgstr ""
+"apply опції неÑуміÑні з rebase.rebaseMerges. РозглÑньте можливіÑÑ‚ÑŒ "
+"Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ --no-rebase-merges"
+
+msgid ""
+"apply options are incompatible with rebase.updateRefs. Consider adding --no-"
+"update-refs"
+msgstr ""
+"apply опції неÑуміÑні з rebase.updateRefs. РозглÑньте можливіÑÑ‚ÑŒ Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ "
+"--no-update-refs"
+
+#, c-format
+msgid "Unknown rebase backend: %s"
+msgstr "Ðевідомий обробник перебазуваннÑ: %s"
+
+msgid "--reschedule-failed-exec requires --exec or --interactive"
+msgstr "--reschedule-failed-exec потребує --exec або --interactive"
+
+#, c-format
+msgid "invalid upstream '%s'"
+msgstr "неприпуÑтиме першоджерельне Ñховище \"%s\""
+
+msgid "Could not create new root commit"
+msgstr "Ðе вдалоÑÑ Ñтворити новий кореневий коміт"
+
+#, c-format
+msgid "no such branch/commit '%s'"
+msgstr "немає такої гілки/коміту \"%s\""
+
+#, c-format
+msgid "No such ref: %s"
+msgstr "Ðемає такого поÑиланнÑ: %s"
+
+msgid "Could not resolve HEAD to a commit"
+msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·Ð²Ê¼Ñзати HEAD у коміт"
+
+#, c-format
+msgid "'%s': need exactly one merge base with branch"
+msgstr "\"%s\": потрібна лишень одна база Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð· гілкою"
+
+#, c-format
+msgid "'%s': need exactly one merge base"
+msgstr "\"%s\": потрібна лишень одна база злиттÑ"
+
+#, c-format
+msgid "Does not point to a valid commit '%s'"
+msgstr "Ðе вказує на припуÑтимий коміт \"%s\""
+
+msgid "HEAD is up to date."
+msgstr "HEAD знаходитьÑÑ Ð² актуальному Ñтані."
+
+#, c-format
+msgid "Current branch %s is up to date.\n"
+msgstr "Поточна гілка %s знаходитьÑÑ Ð² актуальному Ñтані.\n"
+
+msgid "HEAD is up to date, rebase forced."
+msgstr "HEAD знаходитьÑÑ Ð² актуальному Ñтані, примуÑове перебазуваннÑ."
+
+#, c-format
+msgid "Current branch %s is up to date, rebase forced.\n"
+msgstr ""
+"Поточна гілка %s знаходитьÑÑ Ð² актуальному Ñтані, перебазовуйте примуÑово.\n"
+
+msgid "The pre-rebase hook refused to rebase."
+msgstr "Гачок pre-rebase відмовивÑÑ Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ñ‚Ð¸."
+
+#, c-format
+msgid "Changes to %s:\n"
+msgstr "Зміни у %s:\n"
+
+#, c-format
+msgid "Changes from %s to %s:\n"
+msgstr "Зміна з %s на %s:\n"
+
+#, c-format
+msgid "First, rewinding head to replay your work on top of it...\n"
+msgstr "Спочатку перемотуємо HEAD, щоб відтворити вашу роботу поверх того...\n"
+
+msgid "Could not detach HEAD"
+msgstr "Ðе вдалоÑÑ Ð²Ñ–Ð´Ê¼Ñ”Ð´Ð½Ð°Ñ‚Ð¸ HEAD"
+
+#, c-format
+msgid "Fast-forwarded %s to %s.\n"
+msgstr "Перемотано вперед %s на %s.\n"
+
+msgid "git receive-pack <git-dir>"
+msgstr "git receive-pack <git-директоріÑ>"
+
+msgid ""
+"By default, updating the current branch in a non-bare repository\n"
+"is denied, because it will make the index and work tree inconsistent\n"
+"with what you pushed, and will require 'git reset --hard' to match\n"
+"the work tree to HEAD.\n"
+"\n"
+"You can set the 'receive.denyCurrentBranch' configuration variable\n"
+"to 'ignore' or 'warn' in the remote repository to allow pushing into\n"
+"its current branch; however, this is not recommended unless you\n"
+"arranged to update its work tree to match what you pushed in some\n"
+"other way.\n"
+"\n"
+"To squelch this message and still keep the default behaviour, set\n"
+"'receive.denyCurrentBranch' configuration variable to 'refuse'."
+msgstr ""
+"За замовчуваннÑм, Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð¿Ð¾Ñ‚Ð¾Ñ‡Ð½Ð¾Ñ— гілки у непуÑтому Ñховищі\n"
+"заборонено, оÑкільки це зробить Ñ–Ð½Ð´ÐµÐºÑ Ñ– робоче дерево невідповідними\n"
+"з тим, що ви надіÑлали, Ñ– вимагатиме Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¸ \"git reset --hard\" "
+"щоб ÑпівÑтавити робоче дерево Ñ– HEAD.\n"
+"\n"
+"Ви можете вÑтановити конфігураційну змінну \"receive.denyCurrentBranch\"\n"
+"на \"ignore\" або \"warn\" у віддаленому Ñховищі, щоб дозволити надÑÐ¸Ð»Ð°Ð½Ð½Ñ "
+"до поточної гілки; однак, це не рекомендуєтьÑÑ, Ñкщо ви не\n"
+"налагодили Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð¹Ð¾Ð³Ð¾ робочого дерева відповідно до того, що ви "
+"надіÑлали ÑкимоÑÑŒ іншим ÑпоÑобом.\n"
+"\n"
+"Щоб ігнорувати це Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ñ– зберегти поведінку за замовчуваннÑм, "
+"вÑтановіть параметр \"receive.denyCurrentBranch\" у Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"refuse\"."
+
+msgid ""
+"By default, deleting the current branch is denied, because the next\n"
+"'git clone' won't result in any file checked out, causing confusion.\n"
+"\n"
+"You can set 'receive.denyDeleteCurrent' configuration variable to\n"
+"'warn' or 'ignore' in the remote repository to allow deleting the\n"
+"current branch, with or without a warning message.\n"
+"\n"
+"To squelch this message, you can set it to 'refuse'."
+msgstr ""
+"За замовчуваннÑм, Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð¿Ð¾Ñ‚Ð¾Ñ‡Ð½Ð¾Ñ— гілки заборонено, оÑкільки наÑтупний\n"
+"\"git clone\" не призведе до Ð¿ÐµÑ€ÐµÐºÐ»ÑŽÑ‡ÐµÐ½Ð½Ñ Ñтану жодного файлу, що Ñпричинить "
+"плутанину.\n"
+"\n"
+"Ви можете вÑтановити конфігураційну змінну \"receive.denyDeleteCurrent\" у "
+"значеннÑ\n"
+"\"warn\" або \"ignore\" у віддаленому Ñховищі, щоб дозволити видаленнÑ\n"
+"поточної гілки, з попереджувальним повідомленнÑм або без нього.\n"
+"\n"
+"Щоб ігнорувати це повідомленнÑ, ви можете вÑтановити Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"refuse\"."
+
+msgid "quiet"
+msgstr "тихо"
+
+msgid "you must specify a directory"
+msgstr "необхідно вказати директорію"
+
+msgid "git reflog [show] [<log-options>] [<ref>]"
+msgstr "git reflog [show] [<лог-опції>] [<поÑиланнÑ>]"
+
+msgid ""
+"git reflog expire [--expire=<time>] [--expire-unreachable=<time>]\n"
+" [--rewrite] [--updateref] [--stale-fix]\n"
+" [--dry-run | -n] [--verbose] [--all [--single-worktree] | "
+"<refs>...]"
+msgstr ""
+"git reflog expire [--expire=<чаÑ>] [--expire-unreachable=<чаÑ>]\n"
+" [--rewrite] [--updateref] [--stale-fix]\n"
+" [--dry-run | -n] [--verbose] [--all [--single-worktree] | "
+"<поÑиланнÑ>...]"
+
+msgid ""
+"git reflog delete [--rewrite] [--updateref]\n"
+" [--dry-run | -n] [--verbose] <ref>@{<specifier>}..."
+msgstr ""
+"git reflog delete [--rewrite] [--updateref]\n"
+" [--dry-run | -n] [--verbose] <поÑиланнÑ>@{<визначник>}..."
+
+msgid "git reflog exists <ref>"
+msgstr "git reflog exists <поÑиланнÑ>"
+
+#, c-format
+msgid "invalid timestamp '%s' given to '--%s'"
+msgstr "неприпуÑтима позначка чаÑу \"%s\" передана до \"--%s\""
+
+msgid "do not actually prune any entries"
+msgstr "наÑправді не видалÑти жодного запиÑу"
+
+msgid ""
+"rewrite the old SHA1 with the new SHA1 of the entry that now precedes it"
+msgstr "перезапиÑати Ñтарий SHA1 на новий SHA1 запиÑу, Ñкий тепер передує йому"
+
+msgid "update the reference to the value of the top reflog entry"
+msgstr "оновити поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ð° Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²ÐµÑ€Ñ…Ð½ÑŒÐ¾Ð³Ð¾ запиÑу журналу поÑилань"
+
+msgid "print extra information on screen"
+msgstr "вивеÑти додаткову інформацію на екран"
+
+msgid "timestamp"
+msgstr "позначка чаÑу"
+
+msgid "prune entries older than the specified time"
+msgstr "видалити запиÑи, Ñтаріші за вказаний чаÑ"
+
+msgid ""
+"prune entries older than <time> that are not reachable from the current tip "
+"of the branch"
+msgstr ""
+"видалити запиÑи, Ñтаріші за <чаÑ>, Ñкі недоÑтупні з поточної верхівки гілки"
+
+msgid "prune any reflog entries that point to broken commits"
+msgstr ""
+"видалити вÑÑ– запиÑи журналу поÑилань, Ñкі вказують на пошкоджені коміти"
+
+msgid "process the reflogs of all references"
+msgstr "оброблÑти журнали поÑилань вÑÑ–Ñ… поÑилань"
+
+msgid "limits processing to reflogs from the current worktree only"
+msgstr "обмежити обробку журналами поÑилань лише з поточного робочого дерева"
+
+#, c-format
+msgid "Marking reachable objects..."
+msgstr "ÐŸÐ¾Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð¾ÑÑжних обʼєктів..."
+
+#, c-format
+msgid "%s points nowhere!"
+msgstr "%s вказує в нікуди!"
+
+msgid "no reflog specified to delete"
+msgstr "не вказано журнал поÑилань Ð´Ð»Ñ Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ"
+
+#, c-format
+msgid "invalid ref format: %s"
+msgstr "неприпуÑтимий формат поÑиланнÑ: %s"
+
+msgid ""
+"git remote add [-t <branch>] [-m <master>] [-f] [--tags | --no-tags] [--"
+"mirror=<fetch|push>] <name> <url>"
+msgstr ""
+"git remote add [-t <гілка>] [-m <маÑтер>] [-f] [--tags | --no-tags] [--"
+"mirror=<fetch|push>] <назва> <URL-адреÑа>"
+
+msgid "git remote rename [--[no-]progress] <old> <new>"
+msgstr "git remote rename [--[no-]progress] <Ñтара-назва> <нова-назва>"
+
+msgid "git remote remove <name>"
+msgstr "git remote remove <назвa>"
+
+msgid "git remote set-head <name> (-a | --auto | -d | --delete | <branch>)"
+msgstr "git remote set-head <назва> (-a | --auto | -d | --delete | <гілка>)"
+
+msgid "git remote [-v | --verbose] show [-n] <name>"
+msgstr "git remote [-v | --verbose] show [-n] <назва>"
+
+msgid "git remote prune [-n | --dry-run] <name>"
+msgstr "git remote prune [-n | --dry-run] <назва>"
+
+msgid ""
+"git remote [-v | --verbose] update [-p | --prune] [(<group> | <remote>)...]"
+msgstr ""
+"git remote [-v | --verbose] update [-p | --prune] [(<група> | <віддалене-"
+"призначеннÑ>)...]"
+
+msgid "git remote set-branches [--add] <name> <branch>..."
+msgstr "git remote set-branches [--add] <назва> <гілка>..."
+
+msgid "git remote get-url [--push] [--all] <name>"
+msgstr "git remote get-url [--push] [--all] <назва>"
+
+msgid "git remote set-url [--push] <name> <newurl> [<oldurl>]"
+msgstr ""
+"git remote set-url [--push] <назва> <нова-url-адреÑа> [<Ñтара-url-адреÑа>]"
+
+msgid "git remote set-url --add <name> <newurl>"
+msgstr "git remote set-url --add <назва> <нова-url-адреÑа>"
+
+msgid "git remote set-url --delete <name> <url>"
+msgstr "git remote set-url --delete <назва> <url-адреÑа>"
+
+msgid "git remote add [<options>] <name> <url>"
+msgstr "git remote add [<опції>] <назва> <url>"
+
+msgid "git remote set-branches <name> <branch>..."
+msgstr "git remote set-branches <назва> <гілка>..."
+
+msgid "git remote set-branches --add <name> <branch>..."
+msgstr "git remote set-branches --add <назва> <гілка>..."
+
+msgid "git remote show [<options>] <name>"
+msgstr "git remote show [<опції>] <назва>"
+
+msgid "git remote prune [<options>] <name>"
+msgstr "git remote prune [<опції>] <назва>"
+
+msgid "git remote update [<options>] [<group> | <remote>]..."
+msgstr "git remote update [<опції>] [<група> | <віддаленe-призначеннÑ>]..."
+
+#, c-format
+msgid "Updating %s"
+msgstr "ÐžÐ½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ %s"
+
+#, c-format
+msgid "Could not fetch %s"
+msgstr "Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ %s"
+
+msgid ""
+"--mirror is dangerous and deprecated; please\n"
+"\t use --mirror=fetch or --mirror=push instead"
+msgstr ""
+"--mirror небезпечний Ñ– заÑтарілий; будь лаÑка, \n"
+"\t ÑкориÑтайтеÑÑŒ --mirror=fetch або --mirror=push"
+
+#, c-format
+msgid "unknown mirror argument: %s"
+msgstr "невідомий аргумент дзеркала: %s"
+
+msgid "fetch the remote branches"
+msgstr "отримати віддалені гілки"
+
+msgid ""
+"import all tags and associated objects when fetching\n"
+"or do not fetch any tag at all (--no-tags)"
+msgstr ""
+"імпортувати вÑÑ– теги та повʼÑзані з ними обʼєкти під Ñ‡Ð°Ñ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ\n"
+"або не отримувати жодного тегу (--no-tags)"
+
+msgid "branch(es) to track"
+msgstr "гілка(и) Ð´Ð»Ñ Ð²Ñ–Ð´ÑтежуваннÑ"
+
+msgid "master branch"
+msgstr "master гілка"
+
+msgid "set up remote as a mirror to push to or fetch from"
+msgstr ""
+"налаштувати віддалене Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñк дзеркало, щоб надÑилати до нього або "
+"отримувати з нього дані"
+
+msgid "specifying a master branch makes no sense with --mirror"
+msgstr "вказівка головної гілки не має ÑенÑу з --mirror"
+
+msgid "specifying branches to track makes sense only with fetch mirrors"
+msgstr ""
+"вказівка гілок Ð´Ð»Ñ Ð²Ñ–Ð´ÑÑ‚ÐµÐ¶ÑƒÐ²Ð°Ð½Ð½Ñ Ð¼Ð°Ñ” ÑÐµÐ½Ñ Ñ‚Ñ–Ð»ÑŒÐºÐ¸ з дзеркалами отриманнÑ"
+
+#, c-format
+msgid "remote %s already exists."
+msgstr "віддалений %s вже Ñ–Ñнує."
+
+#, c-format
+msgid "Could not setup master '%s'"
+msgstr "Ðе вдалоÑÑ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ñ‚Ð¸ master \"%s\""
+
+#, c-format
+msgid "more than one %s"
+msgstr "більше одного %s"
+
+#, c-format
+msgid "unhandled branch.%s.rebase=%s; assuming 'true'"
+msgstr "unhandled branch.%s.rebase=%s; припуÑкаю \"true\""
+
+#, c-format
+msgid "Could not get fetch map for refspec %s"
+msgstr "Ðе вдалоÑÑ Ð·Ð°Ð±Ñ€Ð°Ñ‚Ð¸ карту Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð´Ð»Ñ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð½Ð¸ÐºÐ° поÑÐ¸Ð»Ð°Ð½Ð½Ñ %s"
+
+msgid "(matching)"
+msgstr "(збіг)"
+
+msgid "(delete)"
+msgstr "(видалити)"
+
+#, c-format
+msgid "could not set '%s'"
+msgstr "не вдалоÑÑ Ð²Ñтановити \"%s\""
+
+#, c-format
+msgid "could not unset '%s'"
+msgstr "не вдалоÑÑ Ñкинути \"%s\""
+
+#, c-format
+msgid ""
+"The %s configuration remote.pushDefault in:\n"
+"\t%s:%d\n"
+"now names the non-existent remote '%s'"
+msgstr ""
+"ÐšÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ %s remote.pushDefault in:\n"
+"\t%s:%d\n"
+"тепер називає неіÑнуюче віддалене поÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\""
+
+#, c-format
+msgid "No such remote: '%s'"
+msgstr "Ðемає такого віддаленого призначеннÑ: \"%s\""
+
+#, c-format
+msgid "Could not rename config section '%s' to '%s'"
+msgstr "Ðе вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ñ‚Ð¸ розділ конфігурації з \"%s\" на \"%s\""
+
+#, c-format
+msgid ""
+"Not updating non-default fetch refspec\n"
+"\t%s\n"
+"\tPlease update the configuration manually if necessary."
+msgstr ""
+"Ðе оновлюєтьÑÑ Ð½ÐµÑтандартний визначник Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð¿Ð¾Ñилань\n"
+"%s\n"
+"Будь лаÑка, за потреби оновіть конфігурацію вручну."
+
+msgid "Renaming remote references"
+msgstr "ÐŸÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ñ–Ð´Ð´Ð°Ð»ÐµÐ½Ð¸Ñ… поÑилань"
+
+#, c-format
+msgid "deleting '%s' failed"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ \"%s\""
+
+#, c-format
+msgid "creating '%s' failed"
+msgstr "не вдалоÑÑ Ñтворити \"%s\""
+
+msgid ""
+"Note: A branch outside the refs/remotes/ hierarchy was not removed;\n"
+"to delete it, use:"
+msgid_plural ""
+"Note: Some branches outside the refs/remotes/ hierarchy were not removed;\n"
+"to delete them, use:"
+msgstr[0] ""
+"Примітка: гілка поза межами refs/remotes/ ієрархії не була видалена;\n"
+"щоб видалити Ñ—Ñ—, ÑкориÑтайтеÑÑŒ:"
+msgstr[1] ""
+"Примітка: деÑкі гілки поза межами refs/remotes/ ієрархії не були видалені;\n"
+"щоб видалити Ñ—Ñ…, ÑкориÑтайтеÑÑŒ:"
+msgstr[2] ""
+"Примітка: деÑкі гілки поза межами refs/remotes/ ієрархії не були видалені;\n"
+"щоб видалити Ñ—Ñ…, ÑкориÑтайтеÑÑŒ:"
+
+#, c-format
+msgid "Could not remove config section '%s'"
+msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ Ñекцію конфігурації \"%s\""
+
+#, c-format
+msgid " new (next fetch will store in remotes/%s)"
+msgstr " нова (наÑтупне Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð·Ð±ÐµÑ€Ñ–Ð³Ð°Ñ‚Ð¸Ð¼ÐµÑ‚ÑŒÑÑ Ñƒ віддалених remotes/%s)"
+
+msgid " tracked"
+msgstr " відÑтежуєтьÑÑ"
+
+msgid " skipped"
+msgstr " пропущена"
+
+msgid " stale (use 'git remote prune' to remove)"
+msgstr " заÑтаріла (ÑкориÑтайтеÑÑŒ \"git remote prune\", щоб видалити)"
+
+msgid " ???"
+msgstr " ???"
+
+#, c-format
+msgid "invalid branch.%s.merge; cannot rebase onto > 1 branch"
+msgstr "неприпуÑтиме branch.%s.merge; неможливо перебазувати на > 1 гілку"
+
+#, c-format
+msgid "rebases interactively onto remote %s"
+msgstr "перебазувати інтерактивно на віддалене Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ %s"
+
+#, c-format
+msgid "rebases interactively (with merges) onto remote %s"
+msgstr "перебазувати інтерактивно (зі злиттÑм) на віддалене Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ %s"
+
+#, c-format
+msgid "rebases onto remote %s"
+msgstr "перебазувати на віддалене Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ %s"
+
+#, c-format
+msgid " merges with remote %s"
+msgstr " зливаєтьÑÑ Ð· віддаленим призначеннÑм %s"
+
+#, c-format
+msgid "merges with remote %s"
+msgstr "зливаєтьÑÑ Ð· віддаленим призначеннÑм %s"
+
+#, c-format
+msgid "%-*s and with remote %s\n"
+msgstr "%-*s та з віддаленим призначеннÑм %s\n"
+
+msgid "create"
+msgstr "Ñтворити"
+
+msgid "delete"
+msgstr "видалити"
+
+msgid "up to date"
+msgstr "в актуальному Ñтані"
+
+msgid "fast-forwardable"
+msgstr "з можливіÑÑ‚ÑŽ Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¿ÐµÑ€ÐµÐ´"
+
+msgid "local out of date"
+msgstr "локальне Ñховище заÑтаріло"
+
+#, c-format
+msgid " %-*s forces to %-*s (%s)"
+msgstr " %-*s примуÑово надіÑлати до %-*s (%s)"
+
+#, c-format
+msgid " %-*s pushes to %-*s (%s)"
+msgstr " %-*s надіÑлати до %-*s (%s)"
+
+#, c-format
+msgid " %-*s forces to %s"
+msgstr " %-*s примуÑово надіÑлати до %s"
+
+#, c-format
+msgid " %-*s pushes to %s"
+msgstr " %-*s надіÑлати до %s"
+
+msgid "do not query remotes"
+msgstr "не запитувати віддалені призначеннÑ"
+
+#, c-format
+msgid "* remote %s"
+msgstr "* віддалене %s"
+
+#, c-format
+msgid " Fetch URL: %s"
+msgstr " URL-адреÑа отриманнÑ: %s"
+
+msgid "(no URL)"
+msgstr "(без URL-адреÑи)"
+
+#. TRANSLATORS: the colon ':' should align
+#. with the one in " Fetch URL: %s"
+#. translation.
+#.
+#, c-format
+msgid " Push URL: %s"
+msgstr " URL-адреÑа надÑиланнÑ: %s"
+
+#, c-format
+msgid " HEAD branch: %s"
+msgstr " HEAD гілка: %s"
+
+msgid "(not queried)"
+msgstr "(не запитувалоÑÑŒ)"
+
+msgid "(unknown)"
+msgstr "(невідомо)"
+
+#, c-format
+msgid ""
+" HEAD branch (remote HEAD is ambiguous, may be one of the following):\n"
+msgstr ""
+" HEAD гілка (віддалений HEAD неоднозначний, може бути одним з наÑтупних):\n"
+
+#, c-format
+msgid " Remote branch:%s"
+msgid_plural " Remote branches:%s"
+msgstr[0] " Віддалена гілка:%s"
+msgstr[1] " Віддалені гілки:%s"
+msgstr[2] " Віддалених гілок:%s"
+
+msgid " (status not queried)"
+msgstr " (ÑÑ‚Ð°Ñ‚ÑƒÑ Ð½Ðµ запитувавÑÑ)"
+
+msgid " Local branch configured for 'git pull':"
+msgid_plural " Local branches configured for 'git pull':"
+msgstr[0] " Локальну гілку налаштовано на \"git pull\":"
+msgstr[1] " Локальні гілки налаштовано на \"git pull\":"
+msgstr[2] " Локальних гілок налаштовано на \"git pull\":"
+
+msgid " Local refs will be mirrored by 'git push'"
+msgstr " Локальні поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð±ÑƒÐ´ÑƒÑ‚ÑŒ віддзеркалені за допомогою \"git push\""
+
+#, c-format
+msgid " Local ref configured for 'git push'%s:"
+msgid_plural " Local refs configured for 'git push'%s:"
+msgstr[0] " Локальне поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ð°Ð»Ð°ÑˆÑ‚Ð¾Ð²Ð°Ð½Ð¾ Ð´Ð»Ñ \"git push\"%s:"
+msgstr[1] " Локальних поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ð°Ð»Ð°ÑˆÑ‚Ð¾Ð²Ð°Ð½Ð¾ Ð´Ð»Ñ \"git push\"%s:"
+msgstr[2] " Локальних поÑилань налаштовано Ð´Ð»Ñ \"git push\"%s:"
+
+msgid "set refs/remotes/<name>/HEAD according to remote"
+msgstr ""
+"вÑтановити refs/remotes/<назва>/HEAD відповідно до віддаленого призначеннÑ"
+
+msgid "delete refs/remotes/<name>/HEAD"
+msgstr "видалити refs/remotes/<назва>/HEAD"
+
+msgid "Cannot determine remote HEAD"
+msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ віддалений HEAD"
+
+msgid "Multiple remote HEAD branches. Please choose one explicitly with:"
+msgstr ""
+"ІÑнує кілька віддалених HEAD гілок. Будь лаÑка, виберіть одну з них, "
+"ÑкориÑтавшиÑÑŒ:"
+
+#, c-format
+msgid "Could not delete %s"
+msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ %s"
+
+#, c-format
+msgid "Not a valid ref: %s"
+msgstr "Ðе Ñ” припуÑтимим поÑиланнÑм: %s"
+
+#, c-format
+msgid "Could not setup %s"
+msgstr "Ðе вдалоÑÑ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ñ‚Ð¸ %s"
+
+#, c-format
+msgid " %s will become dangling!"
+msgstr " %s Ñтануть виÑÑчими!"
+
+#, c-format
+msgid " %s has become dangling!"
+msgstr " %s Ñтав виÑÑчим!"
+
+#, c-format
+msgid "Pruning %s"
+msgstr "Ð’Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ %s"
+
+#, c-format
+msgid "URL: %s"
+msgstr "URL-адреÑа: %s"
+
+#, c-format
+msgid " * [would prune] %s"
+msgstr " * [буде видалено] %s"
+
+#, c-format
+msgid " * [pruned] %s"
+msgstr " * [видалено] %s"
+
+msgid "prune remotes after fetching"
+msgstr "видалити віддалені Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ñ–ÑÐ»Ñ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ"
+
+#, c-format
+msgid "No such remote '%s'"
+msgstr "Ðемає такого віддаленого Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"%s\""
+
+msgid "add branch"
+msgstr "додати гілку"
+
+msgid "no remote specified"
+msgstr "віддалене Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ вказано"
+
+msgid "query push URLs rather than fetch URLs"
+msgstr "запитувати URL-адреÑи надÑилань заміÑÑ‚ÑŒ URL-Ð°Ð´Ñ€ÐµÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ"
+
+msgid "return all URLs"
+msgstr "повернути вÑÑ– URL-адреÑи"
+
+#, c-format
+msgid "no URLs configured for remote '%s'"
+msgstr "не налаштовано URL-адреÑи Ð´Ð»Ñ Ð²Ñ–Ð´Ð´Ð°Ð»ÐµÐ½Ð¾Ð³Ð¾ \"%s\""
+
+msgid "manipulate push URLs"
+msgstr "маніпулювати URL-адреÑами надÑиланнÑ"
+
+msgid "add URL"
+msgstr "додати URL-адреÑу"
+
+msgid "delete URLs"
+msgstr "видалити URL-адреÑи"
+
+msgid "--add --delete doesn't make sense"
+msgstr "--add --delete не має ÑенÑу"
+
+#, c-format
+msgid "Invalid old URL pattern: %s"
+msgstr "ÐеприпуÑтимий шаблон Ñтарої URL-адреÑи: %s"
+
+#, c-format
+msgid "No such URL found: %s"
+msgstr "Такої URL-адреÑи не знайдено: %s"
+
+msgid "Will not delete all non-push URLs"
+msgstr "Ðе видалÑтиме вÑÑ– URL-адреÑи, що не Ñ” призначеннÑм надÑилань"
+
+msgid "be verbose; must be placed before a subcommand"
+msgstr "розгорнутий вивід; має ÑтоÑти перед підкомандою"
+
+msgid "git repack [<options>]"
+msgstr "git repack [<опції>]"
+
+msgid ""
+"Incremental repacks are incompatible with bitmap indexes. Use\n"
+"--no-write-bitmap-index or disable the pack.writeBitmaps configuration."
+msgstr ""
+"ПоÑтупові Ð¿ÐµÑ€ÐµÐ¿Ð°ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð½ÐµÑуміÑні з bitmap індекÑами. СкориÑтайтеÑÑŒ "
+"параметром\n"
+"--no-write-bitmap-index або вимкніть конфігурацію pack.writeBitmaps."
+
+msgid "could not start pack-objects to repack promisor objects"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ð¾Ñ‡Ð°Ñ‚Ð¸ pack-objects Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ¿Ð°ÐºÑƒÐ²Ð°Ð½Ð½Ñ promisor обʼєктів"
+
+msgid "repack: Expecting full hex object ID lines only from pack-objects."
+msgstr ""
+"перепакуваннÑ: очікуютьÑÑ Ð¿Ð¾Ð²Ð½Ñ– Ñ€Ñдки hex ідентифікаторів обʼєктів тільки "
+"від pack-objects."
+
+msgid "could not finish pack-objects to repack promisor objects"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ñ‚Ð¸ pack-objects Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ¿Ð°ÐºÑƒÐ²Ð°Ð½Ð½Ñ promisor обʼєктів"
+
+#, c-format
+msgid "cannot open index for %s"
+msgstr "неможливо відкрити Ñ–Ð½Ð´ÐµÐºÑ Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "pack %s too large to consider in geometric progression"
+msgstr "пакунок %s занадто великий, щоб враховувати в геометричній прогреÑÑ–Ñ—"
+
+#, c-format
+msgid "pack %s too large to roll up"
+msgstr "пакунок %s занадто великий Ð´Ð»Ñ Ð·Ð³Ð¾Ñ€Ñ‚Ð°Ð½Ð½Ñ"
+
+#, c-format
+msgid "could not open tempfile %s for writing"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ тимчаÑовий файл %s Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу"
+
+msgid "could not close refs snapshot tempfile"
+msgstr "не вдалоÑÑ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¸ тимчаÑовий файл знімка поÑилань"
+
+#, c-format
+msgid "could not remove stale bitmap: %s"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ заÑтарілий bitmap: %s"
+
+#, c-format
+msgid "pack prefix %s does not begin with objdir %s"
+msgstr "Ð¿Ñ€ÐµÑ„Ñ–ÐºÑ Ð¿Ð°ÐºÑƒÐ½ÐºÑƒ %s не починаєтьÑÑ Ð· objdir %s"
+
+msgid "pack everything in a single pack"
+msgstr "запакувати вÑе в один пакунок"
+
+msgid "same as -a, and turn unreachable objects loose"
+msgstr "те Ñаме, що й -a, та звільнÑÑ” недоÑÑжні обʼєкти"
+
+msgid "same as -a, pack unreachable cruft objects separately"
+msgstr "те Ñаме, що й -a, пакує недоÑÑжні марні обʼєкти окремо"
+
+msgid "approxidate"
+msgstr "приблизна дата"
+
+msgid "with --cruft, expire objects older than this"
+msgstr "з --cruft видалити обʼєкти, Ñтаріші за цей термін"
+
+msgid "remove redundant packs, and run git-prune-packed"
+msgstr "видалити зайві пакунки Ñ– запуÑтити git-prune-packed"
+
+msgid "pass --no-reuse-delta to git-pack-objects"
+msgstr "передати --no-reuse-delta до git-pack-objects"
+
+msgid "pass --no-reuse-object to git-pack-objects"
+msgstr "передати --no-reuse-object до git-pack-objects"
+
+msgid "do not run git-update-server-info"
+msgstr "не запуÑкати git-update-server-info"
+
+msgid "pass --local to git-pack-objects"
+msgstr "передати --local до git-pack-objects"
+
+msgid "write bitmap index"
+msgstr "запиÑати bitmap індекÑ"
+
+msgid "pass --delta-islands to git-pack-objects"
+msgstr "передати --delta-islands до git-pack-objects"
+
+msgid "with -A, do not loosen objects older than this"
+msgstr "з -A, не поÑлаблÑти обʼєкти, Ñтаріші за це значеннÑ"
+
+msgid "with -a, repack unreachable objects"
+msgstr "з -a, перепакувати недоÑтупні обʼєкти"
+
+msgid "size of the window used for delta compression"
+msgstr "розмір вікна, що викориÑтовуєтьÑÑ Ð´Ð»Ñ Ð´ÐµÐ»ÑŒÑ‚Ð° компреÑÑ–Ñ—"
+
+msgid "bytes"
+msgstr "байти"
+
+msgid "same as the above, but limit memory size instead of entries count"
+msgstr ""
+"те Ñаме, що й вище, але обмежує розмір памʼÑÑ‚Ñ– заміÑÑ‚ÑŒ кількоÑÑ‚Ñ– запиÑів"
+
+msgid "limits the maximum delta depth"
+msgstr "обмежує макÑимальну глибину дельти"
+
+msgid "limits the maximum number of threads"
+msgstr "обмежує макÑимальну кількіÑÑ‚ÑŒ потоків"
+
+msgid "maximum size of each packfile"
+msgstr "макÑимальний розмір кожного файла пакунка"
+
+msgid "repack objects in packs marked with .keep"
+msgstr "перепакувати обʼєкти в пакунках, позначених .keep"
+
+msgid "do not repack this pack"
+msgstr "не перепаковувати цей пакунок"
+
+msgid "find a geometric progression with factor <N>"
+msgstr "знайти геометричну прогреÑÑ–ÑŽ з фактором <Ð>"
+
+msgid "write a multi-pack index of the resulting packs"
+msgstr "запиÑати multi-pack-index результуючих пакунків"
+
+msgid "pack prefix to store a pack containing pruned objects"
+msgstr "Ð¿Ñ€ÐµÑ„Ñ–ÐºÑ Ð´Ð»Ñ Ð·Ð±ÐµÑ€Ñ–Ð³Ð°Ð½Ð½Ñ Ð¿Ð°ÐºÑƒÐ½ÐºÐ° з обрізаними обʼєктами"
+
+msgid "pack prefix to store a pack containing filtered out objects"
+msgstr "Ð¿Ñ€ÐµÑ„Ñ–ÐºÑ Ð´Ð»Ñ Ð·Ð±ÐµÑ€Ñ–Ð³Ð°Ð½Ð½Ñ Ð¿Ð°ÐºÑƒÐ½ÐºÐ° з відфільтрованими обʼєктами"
+
+msgid "cannot delete packs in a precious-objects repo"
+msgstr "неможливо видалити пакунки в precious-objects Ñховищі"
+
+#, c-format
+msgid "option '%s' can only be used along with '%s'"
+msgstr "Ð¾Ð¿Ñ†Ñ–Ñ \"%s\" може бути викориÑтана тільки разом з \"%s\""
+
+msgid "Nothing new to pack."
+msgstr "Ðемає нічого нового Ð´Ð»Ñ Ð¿Ð°ÐºÑƒÐ²Ð°Ð½Ð½Ñ."
+
+#, c-format
+msgid "renaming pack to '%s' failed"
+msgstr "Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð°ÐºÑƒÐ½ÐºÐ° на \"%s\" завершилоÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "pack-objects did not write a '%s' file for pack %s-%s"
+msgstr "pack-objects не запиÑав файл \"%s\" Ð´Ð»Ñ Ð¿Ð°ÐºÑƒÐ½ÐºÐ° %s-%s"
+
+#, c-format
+msgid "could not unlink: %s"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸: %s"
+
+msgid "git replace [-f] <object> <replacement>"
+msgstr "git replace [-f] <обʼєкт> <заміна>"
+
+msgid "git replace [-f] --edit <object>"
+msgstr "git replace [-f] --edit <обʼєкт>"
+
+msgid "git replace [-f] --graft <commit> [<parent>...]"
+msgstr "git replace [-f] --graft <коміт> [<батько>...]"
+
+msgid "git replace -d <object>..."
+msgstr "git replace -d <обʼєкт>..."
+
+msgid "git replace [--format=<format>] [-l [<pattern>]]"
+msgstr "git replace [--format=<формат>] [-l [<шаблон>]]"
+
+#, c-format
+msgid ""
+"invalid replace format '%s'\n"
+"valid formats are 'short', 'medium' and 'long'"
+msgstr ""
+"невірний формат заміни \"%s\"\n"
+"допуÑтимі формати \"short\", \"medium\" та \"long\""
+
+#, c-format
+msgid "replace ref '%s' not found"
+msgstr "заміна поÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\" не знайдена"
+
+#, c-format
+msgid "Deleted replace ref '%s'"
+msgstr "Видалена заміна поÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\""
+
+#, c-format
+msgid "'%s' is not a valid ref name"
+msgstr "\"%s\" не Ñ” припуÑтимою назвою поÑиланнÑ"
+
+#, c-format
+msgid "replace ref '%s' already exists"
+msgstr "заміна поÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\" вже Ñ–Ñнує"
+
+#, c-format
+msgid ""
+"Objects must be of the same type.\n"
+"'%s' points to a replaced object of type '%s'\n"
+"while '%s' points to a replacement object of type '%s'."
+msgstr ""
+"Обʼєкти повинні бути одного типу.\n"
+"\"%s\" вказує на замінений обʼєкт типу \"%s\", \n"
+"тоді Ñк \"%s\" вказує на обʼєкт заміни типу \"%s\"."
+
+#, c-format
+msgid "unable to open %s for writing"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ %s Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу"
+
+msgid "cat-file reported failure"
+msgstr "cat-file повідомила про збій"
+
+#, c-format
+msgid "unable to open %s for reading"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ %s Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ"
+
+msgid "unable to spawn mktree"
+msgstr "не вдалоÑÑ Ð¿Ð¾Ñ€Ð¾Ð´Ð¸Ñ‚Ð¸ mktree"
+
+msgid "unable to read from mktree"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ з mktree"
+
+msgid "mktree reported failure"
+msgstr "mktree повідомила про збій"
+
+msgid "mktree did not return an object name"
+msgstr "mktree не повернув назву обʼєкта"
+
+#, c-format
+msgid "unable to fstat %s"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ fstat %s"
+
+msgid "unable to write object to database"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати обʼєкт до бази даних"
+
+#, c-format
+msgid "unable to get object type for %s"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ тип обʼєкта Ð´Ð»Ñ %s"
+
+msgid "editing object file failed"
+msgstr "Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° обʼєкта завершилоÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "new object is the same as the old one: '%s'"
+msgstr "новий обʼєкт такий Ñамий, Ñк Ñ– Ñтарий: \"%s\""
+
+#, c-format
+msgid "could not parse %s as a commit"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ %s Ñк коміт"
+
+#, c-format
+msgid "bad mergetag in commit '%s'"
+msgstr "невірний mergetag в коміті \"%s\""
+
+#, c-format
+msgid "malformed mergetag in commit '%s'"
+msgstr "невірно Ñформований тег Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ñƒ коміті \"%s\""
+
+#, c-format
+msgid ""
+"original commit '%s' contains mergetag '%s' that is discarded; use --edit "
+"instead of --graft"
+msgstr ""
+"початковий коміт \"%s\" міÑтить тег Ð·Ð»Ð¸Ñ‚Ñ‚Ñ \"%s\", Ñкий було відкинуто; "
+"ÑкориÑтайтеÑÑŒ --edit заміÑÑ‚ÑŒ --graft"
+
+#, c-format
+msgid "the original commit '%s' has a gpg signature"
+msgstr "оригінальний коміт \"%s\" має Ð¿Ñ–Ð´Ð¿Ð¸Ñ gpg"
+
+msgid "the signature will be removed in the replacement commit!"
+msgstr "Ð¿Ñ–Ð´Ð¿Ð¸Ñ Ð±ÑƒÐ´Ðµ видалено в коміті заміни!"
+
+#, c-format
+msgid "could not write replacement commit for: '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати коміт заміни длÑ: \"%s\""
+
+#, c-format
+msgid "graft for '%s' unnecessary"
+msgstr "прищепа Ð´Ð»Ñ \"%s\" не потрібна"
+
+#, c-format
+msgid "new commit is the same as the old one: '%s'"
+msgstr "новий коміт такий Ñамий, Ñк Ñ– Ñтарий: \"%s\""
+
+#, c-format
+msgid ""
+"could not convert the following graft(s):\n"
+"%s"
+msgstr ""
+"не вдалоÑÑ ÐºÐ¾Ð½Ð²ÐµÑ€Ñ‚ÑƒÐ²Ð°Ñ‚Ð¸ наÑтупні прищепи:\n"
+"%s"
+
+msgid "list replace refs"
+msgstr "показати заміни поÑилань"
+
+msgid "delete replace refs"
+msgstr "видалити заміни поÑиланнь"
+
+msgid "edit existing object"
+msgstr "редагувати Ñ–Ñнуючий обʼєкт"
+
+msgid "change a commit's parents"
+msgstr "змінити батьків коміту"
+
+msgid "convert existing graft file"
+msgstr "конвертувати Ñ–Ñнуючий файл щепленнÑ"
+
+msgid "replace the ref if it exists"
+msgstr "замінити поÑиланнÑ, Ñкщо воно Ñ–Ñнує"
+
+msgid "do not pretty-print contents for --edit"
+msgstr "не прикрашати вивід вміÑту Ð´Ð»Ñ --edit"
+
+msgid "use this format"
+msgstr "викориÑтати цей формат"
+
+msgid "--format cannot be used when not listing"
+msgstr "--format не можна викориÑтовувати без list"
+
+msgid "-f only makes sense when writing a replacement"
+msgstr "-f має ÑÐµÐ½Ñ Ñ‚Ñ–Ð»ÑŒÐºÐ¸ при запиÑÑ– заміни"
+
+msgid "--raw only makes sense with --edit"
+msgstr "--raw має ÑÐµÐ½Ñ Ñ‚Ñ–Ð»ÑŒÐºÐ¸ з --edit"
+
+msgid "-d needs at least one argument"
+msgstr "-d потребує принаймні одного аргументу"
+
+msgid "bad number of arguments"
+msgstr "невірна кількіÑÑ‚ÑŒ аргументів"
+
+msgid "-e needs exactly one argument"
+msgstr "-e потребує лишень один аргумент"
+
+msgid "-g needs at least one argument"
+msgstr "-g потребує принаймні одного аргументу"
+
+msgid "--convert-graft-file takes no argument"
+msgstr "--convert-graft-file не потребує аргументів"
+
+msgid "only one pattern can be given with -l"
+msgstr "тільки один шаблон може бути заданий з -l"
+
+msgid "need some commits to replay"
+msgstr "потрібні деÑкі комміти Ð´Ð»Ñ Ð²Ñ–Ð´Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ"
+
+msgid "--onto and --advance are incompatible"
+msgstr "--onto та --advance неÑуміÑні"
+
+msgid "all positive revisions given must be references"
+msgstr "вÑÑ– надані позитивні ревізії мають бути поÑиланнÑми"
+
+msgid "argument to --advance must be a reference"
+msgstr "аргумент до --advance має бути поÑиланнÑм"
+
+msgid ""
+"cannot advance target with multiple sources because ordering would be ill-"
+"defined"
+msgstr ""
+"неможливо проÑунути поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð· декількома джерелами, тому що впорÑÐ´ÐºÑƒÐ²Ð°Ð½Ð½Ñ "
+"буде нечітко визначеним"
+
+msgid ""
+"cannot implicitly determine whether this is an --advance or --onto operation"
+msgstr "неможливо неÑвно визначити, чи це Ð¾Ð¿ÐµÑ€Ð°Ñ†Ñ–Ñ --advance або --onto"
+
+msgid ""
+"cannot advance target with multiple source branches because ordering would "
+"be ill-defined"
+msgstr ""
+"неможливо проÑунути поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð· декількома джерельними гілками, тому що "
+"впорÑÐ´ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð±ÑƒÐ´Ðµ нечітко визначеним"
+
+msgid "cannot implicitly determine correct base for --onto"
+msgstr "неможливо неÑвно визначити вірну базу Ð´Ð»Ñ --onto"
+
+msgid ""
+"(EXPERIMENTAL!) git replay ([--contained] --onto <newbase> | --advance "
+"<branch>) <revision-range>..."
+msgstr ""
+"(ЕКСПЕРИМЕÐТÐЛЬÐО!) git replay ([--contained] --onto <нова-база> | --advance "
+"<гілка>) <діапазон-ревізій>..."
+
+msgid "make replay advance given branch"
+msgstr "зробити Ð²Ñ–Ð´Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð· проÑуваннÑм даної гілки"
+
+msgid "replay onto given commit"
+msgstr "відтворити на заданий коміт"
+
+msgid "advance all branches contained in revision-range"
+msgstr "проÑунути вÑÑ– гілки, що міÑÑ‚ÑÑ‚ÑŒÑÑ Ð² діапазоні ревізій"
+
+msgid "option --onto or --advance is mandatory"
+msgstr "Ð¾Ð¿Ñ†Ñ–Ñ --onto або --advance Ñ” обовʼÑзковою"
+
+#, c-format
+msgid ""
+"some rev walking options will be overridden as '%s' bit in 'struct rev_info' "
+"will be forced"
+msgstr ""
+"деÑкі опції Ð¿Ñ€Ð¾Ñ…Ð¾Ð´Ð¶ÐµÐ½Ð½Ñ Ð¿Ð¾ ревізіÑм будуть перевизначені, оÑкільки біт "
+"\"%s\" у \"struct rev_info\" буде примуÑово викориÑтано"
+
+msgid "error preparing revisions"
+msgstr "помилка при підготовці ревізій"
+
+msgid "replaying down to root commit is not supported yet!"
+msgstr "Ð²Ñ–Ð´Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð´Ð¾ кореневого коміту поки що не підтримуєтьÑÑ!"
+
+msgid "replaying merge commits is not supported yet!"
+msgstr "Ð²Ñ–Ð´Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ ÐºÐ¾Ð¼Ð¼Ñ–Ñ‚Ñ–Ð² Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð¿Ð¾ÐºÐ¸ що не підтримуєтьÑÑ!"
+
+msgid ""
+"git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]"
+msgstr ""
+"git rerere [clear | forget <визначник-шлÑху>... | diff | status | remaining "
+"| gc]"
+
+msgid "register clean resolutions in index"
+msgstr "зареєÑтрувати чиÑÑ‚Ñ– Ð²Ð¸Ñ€Ñ–ÑˆÐµÐ½Ð½Ñ Ð² індекÑÑ–"
+
+msgid "'git rerere forget' without paths is deprecated"
+msgstr "команда \"git rerere forget\" без шлÑхів заÑтаріла"
+
+#, c-format
+msgid "unable to generate diff for '%s'"
+msgstr "не вдалоÑÑ Ð·Ð³ÐµÐ½ÐµÑ€ÑƒÐ²Ð°Ñ‚Ð¸ diff Ð´Ð»Ñ \"%s\""
+
+msgid ""
+"git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]"
+msgstr ""
+"git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]"
+
+msgid "git reset [-q] [<tree-ish>] [--] <pathspec>..."
+msgstr "git reset [-q] [<деревоподібне-джерело>] [--] <визначник шлÑху>..."
+
+msgid ""
+"git reset [-q] [--pathspec-from-file [--pathspec-file-nul]] [<tree-ish>]"
+msgstr ""
+"git reset [-q] [--pathspec-from-file [--pathspec-file-nul]] [<деревоподібне-"
+"джерело>]"
+
+msgid "git reset --patch [<tree-ish>] [--] [<pathspec>...]"
+msgstr ""
+"git reset --patch [<деревоподібне-джерело>] [--] [<визначник шлÑху>...]"
+
+msgid "mixed"
+msgstr "змішане"
+
+msgid "soft"
+msgstr "м’Ñке"
+
+msgid "hard"
+msgstr "жорÑтке"
+
+msgid "merge"
+msgstr "злити"
+
+msgid "keep"
+msgstr "зберегти"
+
+msgid "You do not have a valid HEAD."
+msgstr "У Ð²Ð°Ñ Ð½ÐµÐ¼Ð°Ñ” дійÑного HEAD."
+
+msgid "Failed to find tree of HEAD."
+msgstr "Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ дерево HEAD."
+
+#, c-format
+msgid "Failed to find tree of %s."
+msgstr "Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ дерево %s."
+
+#, c-format
+msgid "HEAD is now at %s"
+msgstr "HEAD зараз на %s"
+
+#, c-format
+msgid "Cannot do a %s reset in the middle of a merge."
+msgstr "Ðеможливо виконати %s ÑÐºÐ¸Ð´Ð°Ð½Ð½Ñ Ð¿Ð¾Ñеред злиттÑ."
+
+msgid "be quiet, only report errors"
+msgstr "тихеÑенько, повідомлÑти лише про помилки"
+
+msgid "skip refreshing the index after reset"
+msgstr "пропуÑтити Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ñ–Ð½Ð´ÐµÐºÑу піÑÐ»Ñ ÑкиданнÑ"
+
+msgid "reset HEAD and index"
+msgstr "Ñкинути HEAD та індекÑ"
+
+msgid "reset only HEAD"
+msgstr "Ñкинути тільки HEAD"
+
+msgid "reset HEAD, index and working tree"
+msgstr "Ñкинути HEAD, Ñ–Ð½Ð´ÐµÐºÑ Ñ‚Ð° робоче дерево"
+
+msgid "reset HEAD but keep local changes"
+msgstr "Ñкинути HEAD, але зберегти локальні зміни"
+
+msgid "record only the fact that removed paths will be added later"
+msgstr "запиÑати лише той факт, що вилучені шлÑхи будуть додані пізніше"
+
+#, c-format
+msgid "Failed to resolve '%s' as a valid revision."
+msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ñ‚Ð¸ '%s' Ñк припуÑтиму ревізію."
+
+#, c-format
+msgid "Failed to resolve '%s' as a valid tree."
+msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ñ‚Ð¸ '%s' Ñк припуÑтиме дерево."
+
+msgid "--mixed with paths is deprecated; use 'git reset -- <paths>' instead."
+msgstr ""
+"викориÑÑ‚Ð°Ð½Ð½Ñ --mixed зі шлÑхами заÑтаріло; викориÑтовуйте 'git reset -- "
+"<paths>' заміÑÑ‚ÑŒ цього."
+
+#, c-format
+msgid "Cannot do %s reset with paths."
+msgstr "Ðеможливо виконати %s ÑÐºÐ¸Ð´Ð°Ð½Ð½Ñ Ð·Ñ– шлÑхами."
+
+#, c-format
+msgid "%s reset is not allowed in a bare repository"
+msgstr "%s ÑÐºÐ¸Ð´Ð°Ð½Ð½Ñ Ð½Ðµ дозволÑєтьÑÑ Ñƒ порожньому Ñховищі"
+
+msgid "Unstaged changes after reset:"
+msgstr "ÐеіндекÑовані зміни піÑÐ»Ñ ÑкиданнÑ:"
+
+#, c-format
+msgid ""
+"It took %.2f seconds to refresh the index after reset. You can use\n"
+"'--no-refresh' to avoid this."
+msgstr ""
+"ÐžÐ½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ñ–Ð½Ð´ÐµÐºÑу піÑÐ»Ñ ÑÐºÐ¸Ð´Ð°Ð½Ð½Ñ Ð·Ð°Ð¹Ð½Ñло %.2f Ñекунд. Ви можете "
+"ÑкориÑтатиÑÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼\n"
+"'--no-refresh', щоб уникнути цього."
+
+#, c-format
+msgid "Could not reset index file to revision '%s'."
+msgstr "Ðе вдалоÑÑ Ñкинути індекÑний файл до ревізії '%s'."
+
+msgid "Could not write new index file."
+msgstr "Ðе вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати новий індекÑний файл."
+
+#, c-format
+msgid "unable to get disk usage of %s"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ дані про викориÑÑ‚Ð°Ð½Ð½Ñ Ð´Ð¸Ñка %s"
+
+#, c-format
+msgid "invalid value for '%s': '%s', the only allowed format is '%s'"
+msgstr ""
+"неприпуÑтиме Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ \"%s\": \"%s\", єдиним допуÑтимим форматом Ñ” \"%s\""
+
+msgid "rev-list does not support display of notes"
+msgstr "rev-list не підтримує Ð²Ñ–Ð´Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð½Ð¾Ñ‚Ð°Ñ‚Ð¾Ðº"
+
+#, c-format
+msgid "marked counting and '%s' cannot be used together"
+msgstr "позначений підрахунок та \"%s\" не можна викориÑтовувати разом"
+
+msgid "git rev-parse --parseopt [<options>] -- [<args>...]"
+msgstr "git rev-parse --parseopt [<опції>] -- [<аргументи>...]"
+
+msgid "keep the `--` passed as an arg"
+msgstr "залишити \"--\" переданим Ñк аргумент"
+
+msgid "stop parsing after the first non-option argument"
+msgstr "зупинити розбір піÑÐ»Ñ Ð¿ÐµÑ€ÑˆÐ¾Ð³Ð¾ неопціонального аргументу"
+
+msgid "output in stuck long form"
+msgstr "Ð²Ð¸Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð² заÑÑ‚Ñ€Ñглій довгій формі"
+
+msgid "premature end of input"
+msgstr "передчаÑне Ð·Ð°ÐºÑ–Ð½Ñ‡ÐµÐ½Ð½Ñ Ð²Ñ…Ñ–Ð´Ð½Ð¸Ñ… даних"
+
+msgid "no usage string given before the `--' separator"
+msgstr "не вказана Ñтрока викориÑÑ‚Ð°Ð½Ð½Ñ Ð¿ÐµÑ€ÐµÐ´ \"--\" розділювачем"
+
+msgid "missing opt-spec before option flags"
+msgstr "відÑутній opt-spec перед прапорцÑми опції"
+
+msgid "Needed a single revision"
+msgstr "Ðеобхідна одна ревізіÑ"
+
+msgid ""
+"git rev-parse --parseopt [<options>] -- [<args>...]\n"
+" or: git rev-parse --sq-quote [<arg>...]\n"
+" or: git rev-parse [<options>] [<arg>...]\n"
+"\n"
+"Run \"git rev-parse --parseopt -h\" for more information on the first usage."
+msgstr ""
+"git rev-parse --parseopt [<опції>] -- [<аргументи>...]\n"
+" або: git rev-parse --sq-quote [<аргумент>...]\n"
+" або: git rev-parse [<опції>] [<аргумент>...]\n"
+"\n"
+"ЗапуÑÑ‚Ñ–Ñ‚ÑŒ \"git rev-parse --parseopt -h\" Ð´Ð»Ñ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð´Ð¾Ð´Ð°Ñ‚ÐºÐ¾Ð²Ð¾Ñ— "
+"інформації про перше викориÑтаннÑ."
+
+msgid "--resolve-git-dir requires an argument"
+msgstr "--resolve-git-dir потребує аргументу"
+
+#, c-format
+msgid "not a gitdir '%s'"
+msgstr "не є git директорією \"%s\""
+
+msgid "--git-path requires an argument"
+msgstr "--git-path потребує аргументу"
+
+msgid "-n requires an argument"
+msgstr "-n потребує аргументу"
+
+msgid "--path-format requires an argument"
+msgstr "--path-format потребує аргументу"
+
+#, c-format
+msgid "unknown argument to --path-format: %s"
+msgstr "невідомий аргумент до --path-format: %s"
+
+msgid "--default requires an argument"
+msgstr "--default потребує аргументу"
+
+msgid "--prefix requires an argument"
+msgstr "--prefix потребує аргументу"
+
+#, c-format
+msgid "unknown mode for --abbrev-ref: %s"
+msgstr "невідомий режим Ð´Ð»Ñ --abbrev-ref: %s"
+
+msgid "this operation must be run in a work tree"
+msgstr "цю операцію треба виконувати в робочому дереві"
+
+msgid "Could not read the index"
+msgstr "Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ індекÑ"
+
+#, c-format
+msgid "unknown mode for --show-object-format: %s"
+msgstr "невідомий режим Ð´Ð»Ñ --show-object-format: %s"
+
+msgid ""
+"git revert [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] "
+"<commit>..."
+msgstr ""
+"git revert [--[no-]edit] [-n] [-m <номер-батька>] [-s] [-S[<ідентифікатор-"
+"ключа>]] <коміт>..."
+
+msgid "git revert (--continue | --skip | --abort | --quit)"
+msgstr "git revert (--continue | --skip | --abort | --quit)"
+
+msgid ""
+"git cherry-pick [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff]\n"
+" [-S[<keyid>]] <commit>..."
+msgstr ""
+"git cherry-pick [--edit] [-n] [-m <номер-батька>] [-s] [-x] [--ff].\n"
+" [-S[<ідентифікатор-ключа>]] <коміт>..."
+
+msgid "git cherry-pick (--continue | --skip | --abort | --quit)"
+msgstr "git cherry-pick (--continue | --skip | --abort | --quit)"
+
+#, c-format
+msgid "option `%s' expects a number greater than zero"
+msgstr "Ð¾Ð¿Ñ†Ñ–Ñ \"%s\" очікує чиÑло більше нулÑ"
+
+#, c-format
+msgid "%s: %s cannot be used with %s"
+msgstr "%s: %s неможливо викориÑтовувати з %s"
+
+msgid "end revert or cherry-pick sequence"
+msgstr "завершити Ð¿Ñ€Ð¾Ñ†ÐµÑ Ð²Ð¸Ð²ÐµÑ€Ñ‚Ð°Ð½Ð½Ñ Ð°Ð±Ð¾ виÑмикуваннÑ"
+
+msgid "resume revert or cherry-pick sequence"
+msgstr "відновити Ð¿Ñ€Ð¾Ñ†ÐµÑ Ð²Ð¸Ð²ÐµÑ€Ñ‚Ð°Ð½Ð½Ñ Ð°Ð±Ð¾ виÑмикуваннÑ"
+
+msgid "cancel revert or cherry-pick sequence"
+msgstr "ÑкаÑувати Ð¿Ñ€Ð¾Ñ†ÐµÑ Ð²Ð¸Ð²ÐµÑ€Ñ‚Ð°Ð½Ð½Ñ Ð°Ð±Ð¾ виÑмикуваннÑ"
+
+msgid "skip current commit and continue"
+msgstr "пропуÑтити поточний коміт Ñ– продовжити"
+
+msgid "don't automatically commit"
+msgstr "не комітити автоматично"
+
+msgid "edit the commit message"
+msgstr "редагувати Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту"
+
+msgid "parent-number"
+msgstr "номер батька"
+
+msgid "select mainline parent"
+msgstr "вибрати оÑновну батьківÑьку лінію"
+
+msgid "merge strategy"
+msgstr "ÑÑ‚Ñ€Ð°Ñ‚ÐµÐ³Ñ–Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ"
+
+msgid "option for merge strategy"
+msgstr "Ð¾Ð¿Ñ†Ñ–Ñ Ð´Ð»Ñ Ñтратегії злиттÑ"
+
+msgid "append commit name"
+msgstr "додати назву коміту"
+
+msgid "preserve initially empty commits"
+msgstr "зберігати первинно порожні коміти"
+
+msgid "allow commits with empty messages"
+msgstr "дозволити коміти з порожніми допиÑами"
+
+msgid "keep redundant, empty commits"
+msgstr "зберігати зайві порожні коміти"
+
+msgid "use the 'reference' format to refer to commits"
+msgstr "викориÑтовувати \"reference\" формат Ð´Ð»Ñ Ð¿Ð¾Ñилань на коміти"
+
+msgid "revert failed"
+msgstr "Ð²Ð¸Ð²ÐµÑ€Ñ‚Ð°Ð½Ð½Ñ Ð½Ðµ вдалоÑÑ"
+
+msgid "cherry-pick failed"
+msgstr "виÑÐ¼Ð¸ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ðµ вдалоÑÑ"
+
+msgid ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch] [--ignore-"
+"unmatch\n"
+" [--quiet] [--pathspec-from-file=<файл> [--pathspec-file-nul]]\n"
+" [--] [<визначник-шлÑху>...]"
+
+msgid ""
+"the following file has staged content different from both the\n"
+"file and the HEAD:"
+msgid_plural ""
+"the following files have staged content different from both the\n"
+"file and the HEAD:"
+msgstr[0] ""
+"наÑтупний файл має доданий до індекÑу вміÑÑ‚, відмінний Ñк від файла\n"
+"так й від HEAD:"
+msgstr[1] ""
+"наÑтупні файли мають доданий до індекÑу вміÑÑ‚, відмінний Ñк від файла\n"
+"так й від HEAD:"
+msgstr[2] ""
+"наÑтупні файли мають доданий до індекÑу вміÑÑ‚, відмінний Ñк від файла\n"
+"так й від HEAD:"
+
+msgid ""
+"\n"
+"(use -f to force removal)"
+msgstr ""
+"\n"
+"(викориÑтовуйте -f щоб видалити примуÑово)"
+
+msgid "the following file has changes staged in the index:"
+msgid_plural "the following files have changes staged in the index:"
+msgstr[0] "у наÑтупному файлі Ñ” зміни, додані до індекÑу:"
+msgstr[1] "у наÑтупних файлах Ñ” зміни, додані до індекÑу:"
+msgstr[2] "у наÑтупних файлах Ñ” зміни, додані до індекÑу:"
+
+msgid ""
+"\n"
+"(use --cached to keep the file, or -f to force removal)"
+msgstr ""
+"\n"
+"(викориÑтовуйте --cached, щоб зберегти файл, або -f, щоб видалити примуÑово)"
+
+msgid "the following file has local modifications:"
+msgid_plural "the following files have local modifications:"
+msgstr[0] "наÑтупний файл має локальні зміни:"
+msgstr[1] "наÑтупні файли мають локальні зміни:"
+msgstr[2] "наÑтупних файлів мають локальні зміни:"
+
+msgid "do not list removed files"
+msgstr "не показувати видалені файли"
+
+msgid "only remove from the index"
+msgstr "видалити тільки з індекÑу"
+
+msgid "override the up-to-date check"
+msgstr "перевизначити перевірку на актуальніÑÑ‚ÑŒ"
+
+msgid "allow recursive removal"
+msgstr "дозволити рекурÑивне видаленнÑ"
+
+msgid "exit with a zero status even if nothing matched"
+msgstr "виходити з нульовим ÑтатуÑом, навіть Ñкщо нічого не збігаєтьÑÑ"
+
+msgid "No pathspec was given. Which files should I remove?"
+msgstr "Ðе було вказано визначник шлÑху. Які файли Ñлід видалити?"
+
+msgid "please stage your changes to .gitmodules or stash them to proceed"
+msgstr ""
+"будь лаÑка, додайте ваші зміни до .gitmodules або Ñхову, щоб продовжити"
+
+#, c-format
+msgid "not removing '%s' recursively without -r"
+msgstr "не видалено \"%s\" рекурÑивно без -r"
+
+#, c-format
+msgid "git rm: unable to remove %s"
+msgstr "git rm: не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ %s"
+
+msgid ""
+"git send-pack [--mirror] [--dry-run] [--force]\n"
+" [--receive-pack=<git-receive-pack>]\n"
+" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
+" [<host>:]<directory> (--all | <ref>...)"
+msgstr ""
+"git send-pack [--mirror] [--dry-run] [--force]\n"
+" [--receive-pack=<git-пакунок-отриманнÑ>]\n"
+" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
+" [<хоÑÑ‚>:]<директоріÑ> (--all | <поÑиланнÑ>...)"
+
+msgid "remote name"
+msgstr "віддалена назва"
+
+msgid "push all refs"
+msgstr "надіÑлати вÑÑ– поÑиланнÑ"
+
+msgid "use stateless RPC protocol"
+msgstr "викориÑтовувати протокол RPC без Ð·Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ñтану"
+
+msgid "read refs from stdin"
+msgstr "прочитати поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð· stdin"
+
+msgid "print status from remote helper"
+msgstr "вивеÑти ÑÑ‚Ð°Ñ‚ÑƒÑ Ð· віддаленого помічника"
+
+msgid "git shortlog [<options>] [<revision-range>] [[--] <path>...]"
+msgstr "git shortlog [<опції>] [<діапазон-ревізій>] [[--] <шлÑÑ…>...]"
+
+msgid "git log --pretty=short | git shortlog [<options>]"
+msgstr "git log --pretty=short | git shortlog [<опції>]"
+
+msgid "using multiple --group options with stdin is not supported"
+msgstr "викориÑÑ‚Ð°Ð½Ð½Ñ ÐºÑ–Ð»ÑŒÐºÐ¾Ñ… --group опцій з stdin не підтримуєтьÑÑ"
+
+#, c-format
+msgid "using %s with stdin is not supported"
+msgstr "викориÑÑ‚Ð°Ð½Ð½Ñ %s з stdin не підтримуєтьÑÑ"
+
+#, c-format
+msgid "unknown group type: %s"
+msgstr "невідомий тип групи: %s"
+
+msgid "group by committer rather than author"
+msgstr "групувати за комітером, а не за автором"
+
+msgid "sort output according to the number of commits per author"
+msgstr "Ñортувати Ð²Ð¸Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð·Ð° кількіÑÑ‚ÑŽ комітів на автора"
+
+msgid "suppress commit descriptions, only provides commit count"
+msgstr "приховати опиÑи комітів, показати лише кількіÑÑ‚ÑŒ комітів"
+
+msgid "show the email address of each author"
+msgstr "показати адреÑу електронної пошти кожного автора"
+
+msgid "<w>[,<i1>[,<i2>]]"
+msgstr "<w>[,<i1>[,<i2>]]"
+
+msgid "linewrap output"
+msgstr "обгортати Ñ€Ñдки виводу"
+
+msgid "field"
+msgstr "поле"
+
+msgid "group by field"
+msgstr "групувати за полем"
+
+msgid "too many arguments given outside repository"
+msgstr "занадто багато аргументів надано поза Ñховищем"
+
+msgid ""
+"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
+" [--current] [--color[=<when>] | --no-color] [--sparse]\n"
+" [--more=<n> | --list | --independent | --merge-base]\n"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<rev> | <glob>)...]"
+msgstr ""
+"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
+" [--current] [--color[=<коли>] | --no-color] [--sparse]\n"
+" [--more=<н> | --list | --independent | --merge-base]\n"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<ревізіÑ> | <глоб>)...]"
+
+msgid "git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]"
+msgstr "git show-branch (-g | --reflog)[=<н>[,<база>]] [--list] [<поÑиланнÑ>]"
+
+#, c-format
+msgid "ignoring %s; cannot handle more than %d ref"
+msgid_plural "ignoring %s; cannot handle more than %d refs"
+msgstr[0] "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ %s; неможливо обробити більше %d поÑиланнÑ"
+msgstr[1] "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ %s; неможливо обробити більше %d поÑилань"
+msgstr[2] "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ %s; неможливо обробити більше %d поÑилань"
+
+#, c-format
+msgid "no matching refs with %s"
+msgstr "немає Ñпівпадаючих поÑилань з %s"
+
+msgid "show remote-tracking and local branches"
+msgstr "показати віддалено відÑтежувані та локальні гілки"
+
+msgid "show remote-tracking branches"
+msgstr "показати віддалено відÑтежувані гілки"
+
+msgid "color '*!+-' corresponding to the branch"
+msgstr "колір \"*!+-\" відповідно на гілку"
+
+msgid "show <n> more commits after the common ancestor"
+msgstr "показати ще <н> комітів піÑÐ»Ñ Ñпільного предка"
+
+msgid "synonym to more=-1"
+msgstr "Ñинонім до more=-1"
+
+msgid "suppress naming strings"
+msgstr "не показувати назву"
+
+msgid "include the current branch"
+msgstr "включити поточну гілку"
+
+msgid "name commits with their object names"
+msgstr "називати коміти за іменами обʼєктів"
+
+msgid "show possible merge bases"
+msgstr "показати можливі бази злиттÑ"
+
+msgid "show refs unreachable from any other ref"
+msgstr "показати поÑиланнÑ, недоÑÑжні з жодного іншого поÑиланнÑ"
+
+msgid "show commits in topological order"
+msgstr "показати коміти в топологічному порÑдку"
+
+msgid "show only commits not on the first branch"
+msgstr "показати лише коміти не з найпершої гілки"
+
+msgid "show merges reachable from only one tip"
+msgstr "показати Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð´Ð¾ÑÑжні лише з однієї верхівки"
+
+msgid "topologically sort, maintaining date order where possible"
+msgstr "Ñортувати топологічно, зберігаючи порÑдок дат, Ñкщо це можливо"
+
+msgid "<n>[,<base>]"
+msgstr "<н>[,<база>]"
+
+msgid "show <n> most recent ref-log entries starting at base"
+msgstr "показати <н> оÑтанніх запиÑів лога поÑилань, починаючи з бази"
+
+msgid "no branches given, and HEAD is not valid"
+msgstr "не надано гілок, Ñ– HEAD не Ñ” дійÑним"
+
+msgid "--reflog option needs one branch name"
+msgstr "--reflog потребує одну назву гілки"
+
+#, c-format
+msgid "only %d entry can be shown at one time."
+msgid_plural "only %d entries can be shown at one time."
+msgstr[0] "одночаÑно може бути показаний лише %d запиÑ."
+msgstr[1] "одночаÑно можуть бути показані лише %d запиÑи."
+msgstr[2] "одночаÑно можуть бути показані лише %d запиÑів."
+
+#, c-format
+msgid "no such ref %s"
+msgstr "немає такого поÑÐ¸Ð»Ð°Ð½Ð½Ñ %s"
+
+#, c-format
+msgid "cannot handle more than %d rev."
+msgid_plural "cannot handle more than %d revs."
+msgstr[0] "неможливо обробити більше %d ревізії."
+msgstr[1] "неможливо обробити більше %d ревізій."
+msgstr[2] "неможливо обробити більше %d ревізій."
+
+#, c-format
+msgid "'%s' is not a valid ref."
+msgstr "\"%s\" не Ñ” припуÑтимим поÑиланнÑм."
+
+#, c-format
+msgid "cannot find commit %s (%s)"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ коміт %s (%s)"
+
+msgid "hash-algorithm"
+msgstr "хеш-алгоритм"
+
+msgid "Unknown hash algorithm"
+msgstr "Ðевідомий хеш-алгоритм"
+
+msgid ""
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<pattern>...]"
+msgstr ""
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<н>]] [--abbrev[=<н>]] [--tags]\n"
+" [--heads] [--] [<шаблон>...]"
+
+msgid ""
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<ref>...]"
+msgstr ""
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<н>]] [--abbrev[=<н>]]\n"
+" [--] [<поÑиланнÑ>...]"
+
+msgid "git show-ref --exclude-existing[=<pattern>]"
+msgstr "git show-ref --exclude-existing[=<шаблон>]"
+
+msgid "git show-ref --exists <ref>"
+msgstr "git show-ref --exists <поÑиланнÑ>"
+
+msgid "reference does not exist"
+msgstr "поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ðµ Ñ–Ñнує"
+
+msgid "failed to look up reference"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ поÑиланнÑ"
+
+msgid "only show tags (can be combined with heads)"
+msgstr "показати тільки теги (можна комбінувати з верхівками)"
+
+msgid "only show heads (can be combined with tags)"
+msgstr "показати тільки верхівки (можна комбінувати з тегами)"
+
+msgid "check for reference existence without resolving"
+msgstr "перевірÑти наÑвніÑÑ‚ÑŒ поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð±ÐµÐ· розвʼÑзаннÑ"
+
+msgid "stricter reference checking, requires exact ref path"
+msgstr "більш Ñувора перевірка поÑилань, потребує точного шлÑху до поÑиланнÑ"
+
+msgid "show the HEAD reference, even if it would be filtered out"
+msgstr "показати HEAD поÑиланнÑ, навіть Ñкщо воно було б відфільтроване"
+
+msgid "dereference tags into object IDs"
+msgstr "розіменувати теги в ідентифікатори обʼєктів"
+
+msgid "only show SHA1 hash using <n> digits"
+msgstr "показати тільки SHA1 хеш з викориÑтаннÑм <н> цифр"
+
+msgid "do not print results to stdout (useful with --verify)"
+msgstr "не виводити результати у stdout (кориÑно з --verify)"
+
+msgid "show refs from stdin that aren't in local repository"
+msgstr "показати поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð· stdin, Ñких немає в локальному Ñховищі"
+
+msgid ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
+msgstr ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<опції>]"
+
+msgid "this worktree is not sparse"
+msgstr "це робоче дерево не є розрідженим"
+
+msgid "this worktree is not sparse (sparse-checkout file may not exist)"
+msgstr ""
+"це робоче дерево не є розрідженим (файл розрідженого переходу може не "
+"Ñ–Ñнувати)"
+
+#, c-format
+msgid ""
+"directory '%s' contains untracked files, but is not in the sparse-checkout "
+"cone"
+msgstr ""
+"Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ \"%s\" міÑтить невідÑтежувані файли, але не входить до конуÑа "
+"розрідженого переходу"
+
+#, c-format
+msgid "failed to remove directory '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ директорію \"%s\""
+
+msgid "failed to create directory for sparse-checkout file"
+msgstr "не вдалоÑÑ Ñтворити директорію Ð´Ð»Ñ Ñ„Ð°Ð¹Ð»Ñƒ розрідженого переходу"
+
+msgid "failed to initialize worktree config"
+msgstr "не вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ конфігурацію робочого дерева"
+
+msgid "failed to modify sparse-index config"
+msgstr "не вдалоÑÑ Ð·Ð¼Ñ–Ð½Ð¸Ñ‚Ð¸ sparse-index конфігурацію"
+
+msgid "initialize the sparse-checkout in cone mode"
+msgstr "ініціалізувати розріджений перехід в режимі конуÑа"
+
+msgid "toggle the use of a sparse index"
+msgstr "перемкнути викориÑÑ‚Ð°Ð½Ð½Ñ Ñ€Ð¾Ð·Ñ€Ñ–Ð´Ð¶ÐµÐ½Ð¾Ð³Ð¾ індекÑу"
+
+#, c-format
+msgid "unable to create leading directories of %s"
+msgstr "не вдалоÑÑ Ñтворити провідні директорії %s"
+
+#, c-format
+msgid "failed to open '%s'"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ \"%s\""
+
+#, c-format
+msgid "could not normalize path %s"
+msgstr "не вдалоÑÑ Ð½Ð¾Ñ€Ð¼Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ шлÑÑ… %s"
+
+#, c-format
+msgid "unable to unquote C-style string '%s'"
+msgstr "неможливо прибрати лапки з C-style Ñтроки \"%s\""
+
+msgid "unable to load existing sparse-checkout patterns"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ Ñ–Ñнуючі шаблони розріджених переходів"
+
+msgid "existing sparse-checkout patterns do not use cone mode"
+msgstr "Ñ–Ñнуючі шаблони розрідженого переходу не викориÑтовують режим конуÑа"
+
+msgid "please run from the toplevel directory in non-cone mode"
+msgstr ""
+"будь лаÑка, запуÑкайте з директорії верхнього Ñ€Ñ–Ð²Ð½Ñ Ð² не конуÑномі режимі"
+
+msgid "specify directories rather than patterns (no leading slash)"
+msgstr "вказати директорії заміÑÑ‚ÑŒ шаблонів (без першого Ñлешу)"
+
+msgid ""
+"specify directories rather than patterns. If your directory starts with a "
+"'!', pass --skip-checks"
+msgstr ""
+"вказати директорії заміÑÑ‚ÑŒ шаблонів. Якщо ваша Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ Ð¿Ð¾Ñ‡Ð¸Ð½Ð°Ñ”Ñ‚ÑŒÑÑ Ð· \"!"
+"\", додайте --skip-checks"
+
+msgid ""
+"specify directories rather than patterns. If your directory really has any "
+"of '*?[]\\' in it, pass --skip-checks"
+msgstr ""
+"вказати директорії заміÑÑ‚ÑŒ шаблонів. Якщо в назві вашої директорії дійÑно Ñ” "
+"Ñимволи \"*?[]\\\", додайте --skip-checks"
+
+#, c-format
+msgid ""
+"'%s' is not a directory; to treat it as a directory anyway, rerun with --"
+"skip-checks"
+msgstr ""
+"\"%s\" не Ñ” директорією; щоб вважати його директорією, повторіть запуÑк з --"
+"skip-checks"
+
+#, c-format
+msgid ""
+"pass a leading slash before paths such as '%s' if you want a single file "
+"(see NON-CONE PROBLEMS in the git-sparse-checkout manual)."
+msgstr ""
+"додайте перший Ñлеш перед такими шлÑхами, Ñк \"%s\", Ñкщо вам потрібен один "
+"файл (див. розділ ÐЕ КОÐУСÐІ ПРОБЛЕМИ у поÑібнику з git-sparse-checkout)."
+
+msgid "git sparse-checkout add [--skip-checks] (--stdin | <patterns>)"
+msgstr "git sparse-checkout add [--skip-checks] (--stdin | <шаблони>)"
+
+msgid ""
+"skip some sanity checks on the given paths that might give false positives"
+msgstr ""
+"пропуÑтити деÑкі перевірки на заданих шлÑхах, Ñкі можуть давати хибні "
+"результати"
+
+msgid "read patterns from standard in"
+msgstr "читати шаблони зі Ñтандартного вводу"
+
+msgid "no sparse-checkout to add to"
+msgstr "немає розрідженого переходу Ð´Ð»Ñ Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ"
+
+msgid ""
+"git sparse-checkout set [--[no-]cone] [--[no-]sparse-index] [--skip-checks] "
+"(--stdin | <patterns>)"
+msgstr ""
+"git sparse-checkout set [--[no-]cone] [--[no-]sparse-index] [--skip-checks] "
+"(--stdin | <шаблони>)"
+
+msgid "must be in a sparse-checkout to reapply sparsity patterns"
+msgstr ""
+"має перебувати в розрідженому переході Ð´Ð»Ñ Ð¿Ð¾Ð²Ñ‚Ð¾Ñ€Ð½Ð¾Ð³Ð¾ заÑтоÑÑƒÐ²Ð°Ð½Ð½Ñ ÑˆÐ°Ð±Ð»Ð¾Ð½Ñ–Ð² "
+"розрідженоÑÑ‚Ñ–"
+
+msgid "error while refreshing working directory"
+msgstr "помилка під Ñ‡Ð°Ñ Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ñ€Ð¾Ð±Ð¾Ñ‡Ð¾Ñ— директорії"
+
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <файл>]"
+
+msgid "terminate input and output files by a NUL character"
+msgstr "завершити вхідні та вихідні файли Ñимволом NUL"
+
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
+"при викориÑтанні з --rules-file інтерпретувати шаблони Ñк шаблони конуÑного "
+"режиму"
+
+msgid "use patterns in <file> instead of the current ones."
+msgstr "викориÑтовувати шаблони з <file> заміÑÑ‚ÑŒ поточних."
+
+msgid "git stash list [<log-options>]"
+msgstr "git stash list [<лог-опції>]"
+
+msgid ""
+"git stash show [-u | --include-untracked | --only-untracked] [<diff-"
+"options>] [<stash>]"
+msgstr ""
+"git stash show [-u | --include-untracked | --only-untracked] [<опції-"
+"різниці>] [<Ñхов>]"
+
+msgid "git stash drop [-q | --quiet] [<stash>]"
+msgstr "git stash drop [-q | --quiet] [<Ñхов>]"
+
+msgid "git stash pop [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash pop [--index] [-q | --quiet] [<Ñхов>]"
+
+msgid "git stash apply [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash apply [--index] [-q | --quiet] [<Ñхов>]"
+
+msgid "git stash branch <branchname> [<stash>]"
+msgstr "git stash branch <назва-гілки> [<Ñхов>]"
+
+msgid "git stash store [(-m | --message) <message>] [-q | --quiet] <commit>"
+msgstr "git stash store [(-m | --message) <допиÑ>] [-q | --quiet] <коміт>"
+
+msgid ""
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<message>]\n"
+" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [--] [<pathspec>...]]"
+msgstr ""
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<допиÑ>]\n"
+" [--pathspec-from-file=<файл> [--pathspec-file-nul]]\n"
+" [--] [<визначник-шлÑху>...]]"
+
+msgid ""
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<message>]"
+msgstr ""
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<допиÑ>]"
+
+msgid "git stash create [<message>]"
+msgstr "git stash create [<допиÑ>]"
+
+#, c-format
+msgid "'%s' is not a stash-like commit"
+msgstr "\"%s\" не Ñ” Ñховоподібним комітом"
+
+#, c-format
+msgid "Too many revisions specified:%s"
+msgstr "Вказано забагато ревізій:%s"
+
+msgid "No stash entries found."
+msgstr "ЗапиÑи Ñхова не знайдені."
+
+#, c-format
+msgid "%s is not a valid reference"
+msgstr "%s не Ñ” припуÑтимим поÑиланнÑм"
+
+msgid "git stash clear with arguments is unimplemented"
+msgstr "git stash clear з аргументами не реалізовано"
+
+#, c-format
+msgid ""
+"WARNING: Untracked file in way of tracked file! Renaming\n"
+" %s -> %s\n"
+" to make room.\n"
+msgstr ""
+"ПОПЕРЕДЖЕÐÐЯ: ÐевідÑтежуваний файл на шлÑху відÑтежуваного! ПерейменуваннÑ\n"
+" %s -> %s\n"
+" щоб звільнити міÑце.\n"
+
+msgid "cannot apply a stash in the middle of a merge"
+msgstr "неможливо заÑтоÑувати Ñхов поÑеред злиттÑ"
+
+#, c-format
+msgid "could not generate diff %s^!."
+msgstr "не вдалоÑÑ Ð·Ð³ÐµÐ½ÐµÑ€ÑƒÐ²Ð°Ñ‚Ð¸ різницю %s^!."
+
+msgid "conflicts in index. Try without --index."
+msgstr "конфлікти в індекÑÑ–. Спробуйте без --index."
+
+msgid "could not save index tree"
+msgstr "не вдалоÑÑ Ð·Ð±ÐµÑ€ÐµÐ³Ñ‚Ð¸ дерево індекÑа"
+
+#, c-format
+msgid "Merging %s with %s"
+msgstr "Ð—Ð»Ð¸Ñ‚Ñ‚Ñ %s з %s"
+
+msgid "Index was not unstashed."
+msgstr "Ð†Ð½Ð´ÐµÐºÑ Ð½Ðµ було вилучено зі Ñхову."
+
+msgid "could not restore untracked files from stash"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ невідÑтежувані файли зі Ñхову"
+
+msgid "attempt to recreate the index"
+msgstr "Ñпроба відтворити індекÑ"
+
+#, c-format
+msgid "Dropped %s (%s)"
+msgstr "Скинуто %s (%s)"
+
+#, c-format
+msgid "%s: Could not drop stash entry"
+msgstr "%s: Ðе вдалоÑÑ Ñкинути Ð·Ð°Ð¿Ð¸Ñ Ñхову"
+
+#, c-format
+msgid "'%s' is not a stash reference"
+msgstr "\"%s\" не Ñ” поÑиланнÑм Ñхова"
+
+msgid "The stash entry is kept in case you need it again."
+msgstr "Ð—Ð°Ð¿Ð¸Ñ Ñхову збережено на випадок, Ñкщо він вам знову знадобитьÑÑ."
+
+msgid "No branch name specified"
+msgstr "Ðе вказана назва гілки"
+
+msgid "failed to parse tree"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ дерево"
+
+msgid "failed to unpack trees"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ð°ÐºÑƒÐ²Ð°Ñ‚Ð¸ дерева"
+
+msgid "include untracked files in the stash"
+msgstr "в тому чиÑлі невідÑтежувані файли Ñхову"
+
+msgid "only show untracked files in the stash"
+msgstr "показувати тільки невідÑтежувані файли Ñхову"
+
+#, c-format
+msgid "Cannot update %s with %s"
+msgstr "Ðеможливо оновити %s з %s"
+
+msgid "stash message"
+msgstr "Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ запиÑу Ñхова"
+
+msgid "\"git stash store\" requires one <commit> argument"
+msgstr "\"git stash store\" потребує одного <коміт> аргументу"
+
+msgid "No staged changes"
+msgstr "Ðемає індекÑованих змін"
+
+msgid "No changes selected"
+msgstr "Ðе обрано жодних змін"
+
+msgid "You do not have the initial commit yet"
+msgstr "У Ð²Ð°Ñ Ñ‰Ðµ немає початкового коміту"
+
+msgid "Cannot save the current index state"
+msgstr "Ðеможливо зберегти поточний Ñтан індекÑу"
+
+msgid "Cannot save the untracked files"
+msgstr "Ðеможливо зберегти невідÑтежувані файли"
+
+msgid "Cannot save the current worktree state"
+msgstr "Ðе вдалоÑÑ Ð·Ð±ÐµÑ€ÐµÐ³Ñ‚Ð¸ поточний Ñтан робочого дерева"
+
+msgid "Cannot save the current staged state"
+msgstr "Ðеможливо зберегти поточний індекÑований Ñтан"
+
+msgid "Cannot record working tree state"
+msgstr "Ðеможливо запиÑати Ñтан робочого дерева"
+
+msgid "Can't use --patch and --include-untracked or --all at the same time"
+msgstr ""
+"Ðе можна викориÑтовувати --patch Ñ– --include-untracked або --all одночаÑно"
+
+msgid "Can't use --staged and --include-untracked or --all at the same time"
+msgstr ""
+"Ðе можна викориÑтовувати --staged Ñ– --include-untracked або --all одночаÑно"
+
+msgid "Did you forget to 'git add'?"
+msgstr "Ви забули \"git add\"?"
+
+msgid "No local changes to save"
+msgstr "Ðемає локальних змін Ð´Ð»Ñ Ð·Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ"
+
+msgid "Cannot initialize stash"
+msgstr "Ðеможливо ініціалізувати Ñхов"
+
+msgid "Cannot save the current status"
+msgstr "Ðеможливо зберегти поточний Ñтан"
+
+#, c-format
+msgid "Saved working directory and index state %s"
+msgstr "Збережено робочу директорію та Ñтан індекÑу %s"
+
+msgid "Cannot remove worktree changes"
+msgstr "Ðеможливо видалити зміни робочого дерева"
+
+msgid "keep index"
+msgstr "зберегти індекÑ"
+
+msgid "stash staged changes only"
+msgstr "додати до Ñхову тільки індекÑовані зміни"
+
+msgid "stash in patch mode"
+msgstr "додати до Ñхову у режимі латаннÑ"
+
+msgid "quiet mode"
+msgstr "тихий режим"
+
+msgid "include untracked files in stash"
+msgstr "в тому чиÑлі невідÑтежувані файли Ñхову"
+
+msgid "include ignore files"
+msgstr "в тому чиÑли файли ігноруваннÑ"
+
+msgid "skip and remove all lines starting with comment character"
+msgstr "пропуÑтити та видалити вÑÑ– Ñ€Ñдки, що починаютьÑÑ Ð· Ñимволу коментарÑ"
+
+msgid "prepend comment character and space to each line"
+msgstr "додати Ñимвол ÐºÐ¾Ð¼ÐµÐ½Ñ‚Ð°Ñ€Ñ Ñ‚Ð° пробіл до кожного Ñ€Ñдка"
+
+#, c-format
+msgid "Expecting a full ref name, got %s"
+msgstr "ОчікувалаÑÑŒ повна назва поÑиланнÑ, отримано %s"
+
+#, c-format
+msgid "could not get a repository handle for submodule '%s'"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ обʼєкт Ñховища Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\""
+
+#, c-format
+msgid ""
+"could not look up configuration '%s'. Assuming this repository is its own "
+"authoritative upstream."
+msgstr ""
+"не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ конфігурацію \"%s\". Мабуть, це Ñховище має влаÑне "
+"першоджерельне Ñховище."
+
+#, c-format
+msgid "No url found for submodule path '%s' in .gitmodules"
+msgstr "Ðе знайдено URL Ð´Ð»Ñ ÑˆÐ»Ñху Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\" у .gitmodules"
+
+#, c-format
+msgid "Entering '%s'\n"
+msgstr "Ð’Ð²ÐµÐ´ÐµÐ½Ð½Ñ \"%s\"\n"
+
+#, c-format
+msgid ""
+"run_command returned non-zero status for %s\n"
+"."
+msgstr ""
+"run_command повернула ненульовий ÑÑ‚Ð°Ñ‚ÑƒÑ Ð´Ð»Ñ %s\n"
+"."
+
+#, c-format
+msgid ""
+"run_command returned non-zero status while recursing in the nested "
+"submodules of %s\n"
+"."
+msgstr ""
+"run_command повернула ненульовий ÑÑ‚Ð°Ñ‚ÑƒÑ Ð¿Ñ–Ð´ Ñ‡Ð°Ñ Ñ€ÐµÐºÑƒÑ€ÑÑ–Ñ— у вкладених "
+"підмодулÑÑ… %s\n"
+"."
+
+msgid "suppress output of entering each submodule command"
+msgstr "приховати вивід Ð²Ð²ÐµÐ´ÐµÐ½Ð½Ñ ÐºÐ¾Ð¶Ð½Ð¾Ñ— команди підмодулÑ"
+
+msgid "recurse into nested submodules"
+msgstr "рекурÑивно у вкладених підмодулÑÑ…"
+
+msgid "git submodule foreach [--quiet] [--recursive] [--] <command>"
+msgstr "git submodule foreach [--quiet] [--recursive] [--] <команда>"
+
+#, c-format
+msgid "Failed to register url for submodule path '%s'"
+msgstr "Ðе вдалоÑÑ Ð·Ð°Ñ€ÐµÑ”Ñтрувати url Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ Ð·Ð° шлÑхом \"%s\""
+
+#, c-format
+msgid "Submodule '%s' (%s) registered for path '%s'\n"
+msgstr "Підмодуль \"%s\" (%s) зареєÑтровано Ð´Ð»Ñ ÑˆÐ»Ñху \"%s\"\n"
+
+#, c-format
+msgid "warning: command update mode suggested for submodule '%s'\n"
+msgstr ""
+"попередженнÑ: запропоновано режим Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´ Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\"\n"
+
+#, c-format
+msgid "Failed to register update mode for submodule path '%s'"
+msgstr ""
+"Ðе вдалоÑÑ Ð·Ð°Ñ€ÐµÑ”Ñтрувати режим Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ Ð·Ð° шлÑхом \"%s\""
+
+msgid "suppress output for initializing a submodule"
+msgstr "приховати вивід Ð´Ð»Ñ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·Ð°Ñ†Ñ–Ñ— підмодулÑ"
+
+msgid "git submodule init [<options>] [<path>]"
+msgstr "git submodule init [<опції>] [<шлÑÑ…>]"
+
+#, c-format
+msgid "no submodule mapping found in .gitmodules for path '%s'"
+msgstr ""
+"відповідне Ð²Ñ–Ð´Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ Ð½Ðµ знайдено у .gitmodules Ð´Ð»Ñ ÑˆÐ»Ñху \"%s\""
+
+#, c-format
+msgid "could not resolve HEAD ref inside the submodule '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð²Ê¼Ñзати HEAD поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð²Ñередині Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\""
+
+#, c-format
+msgid "failed to recurse into submodule '%s'"
+msgstr "не вдалоÑÑ Ð¾Ð±Ñ€Ð¾Ð±Ð¸Ñ‚Ð¸ рекурÑивно підмодуль \"%s\""
+
+msgid "suppress submodule status output"
+msgstr "приховати вивід Ñтану підмодулÑ"
+
+msgid ""
+"use commit stored in the index instead of the one stored in the submodule "
+"HEAD"
+msgstr ""
+"викориÑтати коміт, що зберігаєтьÑÑ Ð² індекÑÑ–, заміÑÑ‚ÑŒ того, що зберігаєтьÑÑ "
+"в HEAD підмодулÑ"
+
+msgid "git submodule status [--quiet] [--cached] [--recursive] [<path>...]"
+msgstr "git submodule status [--quiet] [--cached] [--recursive] [<шлÑÑ…>...]"
+
+#, c-format
+msgid "* %s %s(blob)->%s(submodule)"
+msgstr "* %s %s(blob)->%s(підмодуль)"
+
+#, c-format
+msgid "* %s %s(submodule)->%s(blob)"
+msgstr "* %s %s(підмодуль)->%s(blob)"
+
+#, c-format
+msgid "%s"
+msgstr "%s"
+
+#, c-format
+msgid "couldn't hash object from '%s'"
+msgstr "не вдалоÑÑ Ñ…ÐµÑˆÑƒÐ²Ð°Ñ‚Ð¸ обʼєкт з \"%s\""
+
+#, c-format
+msgid "unexpected mode %o\n"
+msgstr "неочікуваний режим %o\n"
+
+msgid "use the commit stored in the index instead of the submodule HEAD"
+msgstr "викориÑтати коміт, збережений в індекÑÑ–, заміÑÑ‚ÑŒ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ HEAD"
+
+msgid "compare the commit in the index with that in the submodule HEAD"
+msgstr "порівнÑти коміт в індекÑÑ– з комітом у HEAD підмодулÑ"
+
+msgid "skip submodules with 'ignore_config' value set to 'all'"
+msgstr ""
+"пропуÑкати підмодулі зі значеннÑм \"ignore_config\" вÑтановленим у \"all\""
+
+msgid "limit the summary size"
+msgstr "обмежити розмір підÑумку"
+
+msgid "git submodule summary [<options>] [<commit>] [--] [<path>]"
+msgstr "git summary submodule [<опції>] [<коміт>] [--] [<шлÑÑ…>]"
+
+msgid "could not fetch a revision for HEAD"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ ревізію Ð´Ð»Ñ HEAD"
+
+#, c-format
+msgid "Synchronizing submodule url for '%s'\n"
+msgstr "Ð¡Ð¸Ð½Ñ…Ñ€Ð¾Ð½Ñ–Ð·Ð°Ñ†Ñ–Ñ url Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ Ð´Ð»Ñ \"%s\"\n"
+
+#, c-format
+msgid "failed to register url for submodule path '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ñ€ÐµÑ”Ñтрувати url Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ Ð·Ð° шлÑхом \"%s\""
+
+#, c-format
+msgid "failed to update remote for submodule '%s'"
+msgstr "не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ віддалене Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\""
+
+msgid "suppress output of synchronizing submodule url"
+msgstr "приховати вивід процеÑу Ñинхронізації url-адреÑи підмодулÑ"
+
+msgid "git submodule sync [--quiet] [--recursive] [<path>]"
+msgstr "git submodule sync [--quiet] [--recursive] [<шлÑÑ…>]"
+
+#, c-format
+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."
+
+#, c-format
+msgid ""
+"Submodule work tree '%s' contains local modifications; use '-f' to discard "
+"them"
+msgstr ""
+"Робоче дерево Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\" міÑтить локальні модифікації; ÑкориÑтайтеÑÑŒ "
+"\"-f\", щоб ÑкаÑувати Ñ—Ñ…"
+
+#, c-format
+msgid "Cleared directory '%s'\n"
+msgstr "Очищено директорію \"%s\"\n"
+
+#, c-format
+msgid "Could not remove submodule work tree '%s'\n"
+msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ робоче дерево Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\"\n"
+
+#, c-format
+msgid "could not create empty submodule directory %s"
+msgstr "не вдалоÑÑ Ñтворити порожню директорію Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ %s"
+
+#, c-format
+msgid "Submodule '%s' (%s) unregistered for path '%s'\n"
+msgstr "Підмодуль \"%s\" (%s) не зареєÑтровано за шлÑхом \"%s\"\n"
+
+msgid "remove submodule working trees even if they contain local changes"
+msgstr ""
+"видалити робочі дерева підмодулів, навіть Ñкщо вони міÑÑ‚ÑÑ‚ÑŒ локальні зміни"
+
+msgid "unregister all submodules"
+msgstr "ÑкаÑувати реєÑтрацію вÑÑ–Ñ… підмодулів"
+
+msgid ""
+"git submodule deinit [--quiet] [-f | --force] [--all | [--] [<path>...]]"
+msgstr ""
+"git submodule deinit [--quiet] [-f | --force] [--all | [--] [<шлÑÑ…>...]]"
+
+msgid "Use '--all' if you really want to deinitialize all submodules"
+msgstr ""
+"СкориÑтайтеÑÑŒ \"--all\", Ñкщо ви дійÑно хочете деініціалізувати вÑÑ– підмодулі"
+
+msgid ""
+"An alternate computed from a superproject's alternate is invalid.\n"
+"To allow Git to clone without an alternate in such a case, set\n"
+"submodule.alternateErrorStrategy to 'info' or, equivalently, clone with\n"
+"'--reference-if-able' instead of '--reference'."
+msgstr ""
+"Запозичений обʼєкт, обчиÑлений з запозиченого обʼєкту батьківÑького проекту, "
+"не Ñ” дійÑним.\n"
+"Щоб дозволити Git клонувати без запозиченого обʼєкту в такому випадку, "
+"вÑтановіть\n"
+"submodule.alternateErrorStrategy на \"info\" або, що еквівалентно, клонуйте "
+"з\n"
+"\"--reference-if-able\" заміÑÑ‚ÑŒ \"--reference\"."
+
+#, c-format
+msgid "could not get a repository handle for gitdir '%s'"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ деÑкриптор Ñховища Ð´Ð»Ñ git директорії \"%s\""
+
+#, c-format
+msgid "submodule '%s' cannot add alternate: %s"
+msgstr "підмодуль \"%s\" не може додати запозичених обʼєкт: %s"
+
+#, c-format
+msgid "Value '%s' for submodule.alternateErrorStrategy is not recognized"
+msgstr "Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"%s\" Ð´Ð»Ñ submodule.alternateErrorStrategy не розпізнано"
+
+#, c-format
+msgid "Value '%s' for submodule.alternateLocation is not recognized"
+msgstr "Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"%s\" Ð´Ð»Ñ submodule.alternateLocation не розпізнано"
+
+#, c-format
+msgid "refusing to create/use '%s' in another submodule's git dir"
+msgstr ""
+"відмовлено в Ñтворенні/викориÑтанні \"%s\" у git директорії іншого підмодулÑ"
+
+#, c-format
+msgid "clone of '%s' into submodule path '%s' failed"
+msgstr "не вдалоÑÑ ÐºÐ»Ð¾Ð½ÑƒÐ²Ð°Ñ‚Ð¸ \"%s\" у шлÑÑ… Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\""
+
+#, c-format
+msgid "directory not empty: '%s'"
+msgstr "Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ Ð½Ðµ порожнÑ: \"%s\""
+
+#, c-format
+msgid "could not get submodule directory for '%s'"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ директорію Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ Ð´Ð»Ñ \"%s\""
+
+msgid "alternative anchor for relative paths"
+msgstr "альтернативний Ñкір Ð´Ð»Ñ Ð²Ñ–Ð´Ð½Ð¾Ñних шлÑхів"
+
+msgid "where the new submodule will be cloned to"
+msgstr "куди буде клоновано новий підмодуль"
+
+msgid "name of the new submodule"
+msgstr "назва нового підмодулÑ"
+
+msgid "url where to clone the submodule from"
+msgstr "url адреÑа, звідки клонувати підмодуль"
+
+msgid "depth for shallow clones"
+msgstr "глибина Ð´Ð»Ñ Ð½ÐµÐ³Ð»Ð¸Ð±Ð¾ÐºÐ¸Ñ… клонів"
+
+msgid "force cloning progress"
+msgstr "примуÑово звітувати Ð¿Ñ€Ð¾Ð³Ñ€ÐµÑ ÐºÐ»Ð¾Ð½ÑƒÐ²Ð°Ð½Ð½Ñ"
+
+msgid "disallow cloning into non-empty directory"
+msgstr "заборонити ÐºÐ»Ð¾Ð½ÑƒÐ²Ð°Ð½Ð½Ñ Ñƒ непорожню директорію"
+
+msgid ""
+"git submodule--helper clone [--prefix=<path>] [--quiet] [--reference "
+"<repository>] [--name <name>] [--depth <depth>] [--single-branch] [--filter "
+"<filter-spec>] --url <url> --path <path>"
+msgstr ""
+"git submodule--helper clone [--prefix=<шлÑÑ…>] [--quiet] [--reference "
+"<Ñховище>] [--name <назва>] [--depth <глибина>] [--single-branch] [--filter "
+"<визначник-фільтру>] --url <url> --path <шлÑÑ…>"
+
+#, c-format
+msgid "Invalid update mode '%s' configured for submodule path '%s'"
+msgstr ""
+"ÐеприпуÑтимий режим Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ \"%s\" налаштовано Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ Ð·Ð° шлÑхом "
+"\"%s\""
+
+#, c-format
+msgid "Submodule path '%s' not initialized"
+msgstr "Підмодуль за шлÑхом \"%s\" не ініціалізовано"
+
+msgid "Maybe you want to use 'update --init'?"
+msgstr "Можливо, ви хочете ÑкориÑтатиÑÑŒ командою \"update --init\"?"
+
+#, c-format
+msgid "Skipping unmerged submodule %s"
+msgstr "ПропуÑк незлитого Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ %s"
+
+#, c-format
+msgid "Skipping submodule '%s'"
+msgstr "ПропуÑк Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\""
+
+#, c-format
+msgid "cannot clone submodule '%s' without a URL"
+msgstr "неможливо клонувати підмодуль \"%s\" без URL-адреÑи"
+
+#, c-format
+msgid "Failed to clone '%s'. Retry scheduled"
+msgstr "Ðе вдалоÑÑ ÐºÐ»Ð¾Ð½ÑƒÐ²Ð°Ñ‚Ð¸ \"%s\". Запланована повторна Ñпроба"
+
+#, c-format
+msgid "Failed to clone '%s' a second time, aborting"
+msgstr "Ðе вдалоÑÑ ÐºÐ»Ð¾Ð½ÑƒÐ²Ð°Ñ‚Ð¸ \"%s\" вдруге, перериваннÑ"
+
+#, c-format
+msgid "Unable to checkout '%s' in submodule path '%s'"
+msgstr "Ðе вдалоÑÑ Ð¿ÐµÑ€ÐµÐºÐ»ÑŽÑ‡Ð¸Ñ‚Ð¸ÑÑ Ð½Ð° \"%s\" у підмодулі за шлÑхом \"%s\""
+
+#, c-format
+msgid "Unable to rebase '%s' in submodule path '%s'"
+msgstr "Ðе вдалоÑÑ Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ñ‚Ð¸ \"%s\" в підмодулі за шлÑхом \"%s\""
+
+#, c-format
+msgid "Unable to merge '%s' in submodule path '%s'"
+msgstr "Ðе вдалоÑÑ Ð·Ð»Ð¸Ñ‚Ð¸ \"%s\" в підмодулі за шлÑхом \"%s\""
+
+#, c-format
+msgid "Execution of '%s %s' failed in submodule path '%s'"
+msgstr "Ðе вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ \"%s %s\" у шлÑху Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\""
+
+#, c-format
+msgid "Submodule path '%s': checked out '%s'\n"
+msgstr "ШлÑÑ… Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\": переключено Ñтан \"%s\"\n"
+
+#, c-format
+msgid "Submodule path '%s': rebased into '%s'\n"
+msgstr "ШлÑÑ… Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\": перебазовано в \"%s\"\n"
+
+#, c-format
+msgid "Submodule path '%s': merged in '%s'\n"
+msgstr "ШлÑÑ… Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\": злито в \"%s\"\n"
+
+#, c-format
+msgid "Submodule path '%s': '%s %s'\n"
+msgstr "ШлÑÑ… Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\": \"%s %s\"\n"
+
+#, c-format
+msgid "Unable to fetch in submodule path '%s'; trying to directly fetch %s:"
+msgstr ""
+"Ðеможливо виконати Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ ÑˆÐ»Ñху Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\"; Ñпроба отримати напрÑму "
+"%s:"
+
+#, c-format
+msgid ""
+"Fetched in submodule path '%s', but it did not contain %s. Direct fetching "
+"of that commit failed."
+msgstr ""
+"Отримано у шлÑху до Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\", але він не міÑтить %s. ПрÑме Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ "
+"цього коміту не вдалоÑÑ."
+
+#, c-format
+msgid "could not initialize submodule at path '%s'"
+msgstr "не вдалоÑÑ Ñ–Ð½Ñ–Ñ†Ñ–Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ підмодуль за шлÑхом \"%s\""
+
+#, c-format
+msgid ""
+"Submodule (%s) branch configured to inherit branch from superproject, but "
+"the superproject is not on any branch"
+msgstr ""
+"Гілку Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ (%s) налаштовано на уÑÐ¿Ð°Ð´ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð³Ñ–Ð»ÐºÐ¸ від Ñуперпроекту, але "
+"Ñуперпроект не знаходитьÑÑ Ñƒ жодній гілці"
+
+#, c-format
+msgid "Unable to find current revision in submodule path '%s'"
+msgstr "Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ поточну ревізію у шлÑху Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\""
+
+#, c-format
+msgid "Unable to fetch in submodule path '%s'"
+msgstr "Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ шлÑÑ… Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\""
+
+#, c-format
+msgid "Unable to find %s revision in submodule path '%s'"
+msgstr "Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ ревізію %s у шлÑху Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\""
+
+#, c-format
+msgid "Failed to recurse into submodule path '%s'"
+msgstr "Ðе вдалоÑÑ Ð¾Ð±Ñ€Ð¾Ð±Ð¸Ñ‚Ð¸ рекурÑивно підмодуль за шлÑхом \"%s\""
+
+msgid "force checkout updates"
+msgstr "переключитиÑÑ Ð½Ð° Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¸Ð¼ÑƒÑово"
+
+msgid "initialize uninitialized submodules before update"
+msgstr "ініціалізувати неініціалізовані підмодулі перед оновленнÑм"
+
+msgid "use SHA-1 of submodule's remote tracking branch"
+msgstr "викориÑтовувати SHA-1 гілки віддаленого відÑÑ‚ÐµÐ¶ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ"
+
+msgid "traverse submodules recursively"
+msgstr "обходити підмодулі рекурÑивно"
+
+msgid "don't fetch new objects from the remote site"
+msgstr "не отримувати нові обʼєкти з віддаленої Ñторони"
+
+msgid "use the 'checkout' update strategy (default)"
+msgstr "викориÑтати Ñтратегію Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ \"checkout \" (за замовчуваннÑм)"
+
+msgid "use the 'merge' update strategy"
+msgstr "викориÑтати Ñтратегію Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ \"merge\""
+
+msgid "use the 'rebase' update strategy"
+msgstr "викориÑтати Ñтратегію Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ \"rebase\""
+
+msgid "create a shallow clone truncated to the specified number of revisions"
+msgstr "Ñтворити неглибокий клон, урізаний до вказаної кількоÑÑ‚Ñ– ревізій"
+
+msgid "parallel jobs"
+msgstr "паралельні потоки"
+
+msgid "whether the initial clone should follow the shallow recommendation"
+msgstr "чи повинен початковий клон Ñлідувати неглибоким рекомендаціÑм"
+
+msgid "don't print cloning progress"
+msgstr "не виводити хід клонуваннÑ"
+
+msgid "disallow cloning into non-empty directory, implies --init"
+msgstr "заборонити ÐºÐ»Ð¾Ð½ÑƒÐ²Ð°Ð½Ð½Ñ Ñƒ непорожній каталог, маєтьÑÑ Ð½Ð° увазі --init"
+
+msgid ""
+"git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] "
+"[-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-"
+"shallow] [--reference <repository>] [--recursive] [--[no-]single-branch] "
+"[--] [<path>...]"
+msgstr ""
+"git submodule [--quiet] update [--init [--filter=<визначник-фільтру>]] [--"
+"remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--"
+"[no-]recommend-shallow] [--reference <Ñховище>] [--recursive] [--[no-]single-"
+"branch] [--] [<шлÑÑ…>...]"
+
+msgid "Failed to resolve HEAD as a valid ref."
+msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·Ð²Ê¼Ñзати HEAD в дійÑне поÑиланнÑ."
+
+msgid "git submodule absorbgitdirs [<options>] [<path>...]"
+msgstr "git submodule absorbgitdirs [<опції>] [<шлÑÑ…>...]"
+
+msgid "suppress output for setting url of a submodule"
+msgstr "приховати вивід при вÑтановленні url підмодулÑ"
+
+msgid "git submodule set-url [--quiet] <path> <newurl>"
+msgstr "git submodule set-url [--quiet] <шлÑÑ…> <новий-url>"
+
+msgid "set the default tracking branch to master"
+msgstr "вÑтановити гілку відÑÑ‚ÐµÐ¶ÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð° замовчуваннÑм на master"
+
+msgid "set the default tracking branch"
+msgstr "вÑтановити гілку відÑÑ‚ÐµÐ¶ÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð° замовчуваннÑм"
+
+msgid "git submodule set-branch [-q|--quiet] (-d|--default) <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-d|--default) <шлÑÑ…>"
+
+msgid "git submodule set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-b|--branch) <гілка> <шлÑÑ…>"
+
+msgid "--branch or --default required"
+msgstr "Потрібно вказати --branch або --default"
+
+msgid "print only error messages"
+msgstr "виводити тільки Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¾ помилки"
+
+msgid "force creation"
+msgstr "примуÑове ÑтвореннÑ"
+
+msgid "show whether the branch would be created"
+msgstr "показати, чи буде Ñтворено гілку"
+
+msgid ""
+"git submodule--helper create-branch [-f|--force] [--create-reflog] [-q|--"
+"quiet] [-t|--track] [-n|--dry-run] <name> <start-oid> <start-name>"
+msgstr ""
+"git submodule--helper create-branch [-f|--force] [--create-reflog] [-q|--"
+"quiet] [-t|--track] [-n|--dry-run] <назва> <початковий-oid> <початкова-назва>"
+
+#, c-format
+msgid "creating branch '%s'"
+msgstr "ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð³Ñ–Ð»ÐºÐ¸ \"%s\""
+
+#, c-format
+msgid "Adding existing repo at '%s' to the index\n"
+msgstr "Ð”Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ñ–Ñнуючого Ñховища за адреÑою \"%s\" до індекÑу\n"
+
+#, c-format
+msgid "'%s' already exists and is not a valid git repo"
+msgstr "\"%s\" вже Ñ–Ñнує Ñ– не Ñ” припуÑтимим git Ñховищем"
+
+#, c-format
+msgid "A git directory for '%s' is found locally with remote(s):\n"
+msgstr ""
+"Git директорію Ð´Ð»Ñ \"%s\" знайдено локально з віддаленим(и) "
+"призначеннÑм(и):\n"
+
+#, c-format
+msgid ""
+"If you want to reuse this local git directory instead of cloning again from\n"
+" %s\n"
+"use the '--force' option. If the local git directory is not the correct "
+"repo\n"
+"or you are unsure what this means choose another name with the '--name' "
+"option."
+msgstr ""
+"Якщо ви хочете повторно викориÑтати цю локальну git директорію заміÑÑ‚ÑŒ того, "
+"щоб знову клонувати з\n"
+" %s\n"
+"ÑкориÑтайтеÑÑŒ опцією \"--force\". Якщо локальна Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ git не Ñ” "
+"правильним Ñховищем\n"
+"або ви не впевнені, що це означає, виберіть іншу назву за допомогою опції "
+"\"--name\"."
+
+#, c-format
+msgid "Reactivating local git directory for submodule '%s'\n"
+msgstr "Повторна Ð°ÐºÑ‚Ð¸Ð²Ð°Ñ†Ñ–Ñ Ð»Ð¾ÐºÐ°Ð»ÑŒÐ½Ð¾Ñ— git директорії Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\"\n"
+
+#, c-format
+msgid "unable to checkout submodule '%s'"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐºÐ»ÑŽÑ‡Ð¸Ñ‚Ð¸ÑÑŒ на підмодуль \"%s\""
+
+msgid "please make sure that the .gitmodules file is in the working tree"
+msgstr ""
+"будь лаÑка, переконайтеÑÑ, що файл .gitmodules знаходитьÑÑ Ñƒ робочому дереві"
+
+#, c-format
+msgid "Failed to add submodule '%s'"
+msgstr "Ðе вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ підмодуль \"%s\""
+
+#, c-format
+msgid "Failed to register submodule '%s'"
+msgstr "Ðе вдалоÑÑ Ð·Ð°Ñ€ÐµÑ”Ñтрувати підмодуль \"%s\""
+
+#, c-format
+msgid "'%s' already exists in the index"
+msgstr "\"%s\" вже Ñ–Ñнує в індекÑÑ–"
+
+#, c-format
+msgid "'%s' already exists in the index and is not a submodule"
+msgstr "\"%s\" вже Ñ–Ñнує в індекÑÑ– Ñ– не Ñ” підмодулем"
+
+#, c-format
+msgid "'%s' does not have a commit checked out"
+msgstr "\"%s\" не має активного коміту"
+
+msgid "branch of repository to add as submodule"
+msgstr "гілка Ñховища, Ñку потрібно додати Ñк підмодуль"
+
+msgid "allow adding an otherwise ignored submodule path"
+msgstr "дозволити Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ ÑˆÐ»Ñху до підмодулÑ, Ñкий інакше ігноруєтьÑÑ"
+
+msgid "borrow the objects from reference repositories"
+msgstr "запозичити обʼєкти з репозиторіїв поÑилань"
+
+msgid ""
+"sets the submodule's name to the given string instead of defaulting to its "
+"path"
+msgstr ""
+"вÑтановлює назву Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ Ð½Ð° вказане Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð°Ð¼Ñ–ÑÑ‚ÑŒ викориÑÑ‚Ð°Ð½Ð½Ñ Ð¹Ð¾Ð³Ð¾ "
+"шлÑху"
+
+msgid "git submodule add [<options>] [--] <repository> [<path>]"
+msgstr "git submodule add [<опції>] [--] <Ñховище> [<шлÑÑ…>]"
+
+msgid "Relative path can only be used from the toplevel of the working tree"
+msgstr ""
+"ВідноÑний шлÑÑ… можна викориÑтовувати лише з верхнього Ñ€Ñ–Ð²Ð½Ñ Ñ€Ð¾Ð±Ð¾Ñ‡Ð¾Ð³Ð¾ дерева"
+
+#, c-format
+msgid "repo URL: '%s' must be absolute or begin with ./|../"
+msgstr "URL Ñховища: \"%s\" має бути абÑолютним або починатиÑÑ Ð· ./|../."
+
+#, c-format
+msgid "'%s' is not a valid submodule name"
+msgstr "\"%s\" не Ñ” припуÑтимою назвою підмодулÑ"
+
+msgid "git submodule--helper <command>"
+msgstr "git submodule--helper <команда>"
+
+msgid "git symbolic-ref [-m <reason>] <name> <ref>"
+msgstr "git symbolic-ref [-m <причина>] <назва> <поÑиланнÑ>"
+
+msgid "git symbolic-ref [-q] [--short] [--no-recurse] <name>"
+msgstr "git symbolic-ref [-q] [--short] [--no-recurse] <назва>"
+
+msgid "git symbolic-ref --delete [-q] <name>"
+msgstr "git symbolic-ref --delete [-q] <назва>"
+
+msgid "suppress error message for non-symbolic (detached) refs"
+msgstr ""
+"приховати Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¾ помилку Ð´Ð»Ñ Ð½ÐµÑимвольних (відокремлених) поÑилань"
+
+msgid "delete symbolic ref"
+msgstr "видалити Ñимвольне поÑиланнÑ"
+
+msgid "shorten ref output"
+msgstr "Ñкоротити вивід поÑилань"
+
+msgid "recursively dereference (default)"
+msgstr "рекурÑивне Ñ€Ð¾Ð·Ñ–Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ (за замовчуваннÑм)"
+
+msgid "reason"
+msgstr "причина"
+
+msgid "reason of the update"
+msgstr "причина оновленнÑ"
+
+msgid ""
+"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
+" <tagname> [<commit> | <object>]"
+msgstr ""
+"git tag [-a | -s | -u <ідентифікатор-ключа>] [-f] [-m <допиÑ> | -F <файл>] [-"
+"e]\n"
+" <назва-тегу> [<коміт> | <об’єкт>]"
+
+msgid "git tag -d <tagname>..."
+msgstr "git tag -d <назва-тега>..."
+
+msgid ""
+"git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]\n"
+" [--points-at <object>] [--column[=<options>] | --no-column]\n"
+" [--create-reflog] [--sort=<key>] [--format=<format>]\n"
+" [--merged <commit>] [--no-merged <commit>] [<pattern>...]"
+msgstr ""
+"git tag [-n[<чиÑло>]] -l [--contains <коміт>] [--no-contains <коміт>]\n"
+" [--points-at <обʼєкт>] [--column[=<опціі>] | --no-column]\n"
+" [--create-reflog] [--sort=<ключ>] [--format=<формат>]\n"
+" [--merged <коміт>] [--no-merged <коміт>] [<шаблон>...]"
+
+msgid "git tag -v [--format=<format>] <tagname>..."
+msgstr "git tag -v [--format=<формат>] <назва-тега>..."
+
+#, c-format
+msgid "tag '%s' not found."
+msgstr "тег \"%s\" не знайдено."
+
+#, c-format
+msgid "Deleted tag '%s' (was %s)\n"
+msgstr "Видалено тег \"%s\" (було %s)\n"
+
+#, c-format
+msgid ""
+"\n"
+"Write a message for tag:\n"
+" %s\n"
+"Lines starting with '%c' will be ignored.\n"
+msgstr ""
+"\n"
+"Ðапишіть Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ тегу:\n"
+" %s\n"
+"РÑдки, що починаютьÑÑ Ð· \"%c\", будуть проігноровані.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Write a message for tag:\n"
+" %s\n"
+"Lines starting with '%c' will be kept; you may remove them yourself if you "
+"want to.\n"
+msgstr ""
+"\n"
+"Ðапишіть Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ тегу:\n"
+" %s\n"
+"РÑдки, що починаютьÑÑ Ð· \"%c\", будуть збережені; ви можете вилучити Ñ—Ñ… "
+"ÑамоÑтійно, Ñкщо захочете.\n"
+
+msgid "unable to sign the tag"
+msgstr "не вдалоÑÑ Ð¿Ñ–Ð´Ð¿Ð¸Ñати тег"
+
+#, c-format
+msgid ""
+"You have created a nested tag. The object referred to by your new tag is\n"
+"already a tag. If you meant to tag the object that it points to, use:\n"
+"\n"
+"\tgit tag -f %s %s^{}"
+msgstr ""
+"Ви Ñтворили вкладений тег. Обʼєкт, на Ñкий поÑилаєтьÑÑ Ð²Ð°Ñˆ новий тег\n"
+"вже Ñ” тегом. Якщо ви хотіли позначити обʼєкт, на Ñкий він вказує, "
+"ÑкориÑтайтеÑÑŒ\n"
+"\n"
+"\tgit tag -f %s %s^{}"
+
+msgid "bad object type."
+msgstr "невірний тип обʼєкта."
+
+msgid "no tag message?"
+msgstr "немає допиÑу до тегу?"
+
+#, c-format
+msgid "The tag message has been left in %s\n"
+msgstr "Ð”Ð¾Ð¿Ð¸Ñ Ð´Ð¾ тегу було залишено в %s\n"
+
+msgid "list tag names"
+msgstr "показати назви тегів"
+
+msgid "print <n> lines of each tag message"
+msgstr "вивеÑти <н> Ñ€Ñдків кожного допиÑу до тегу"
+
+msgid "delete tags"
+msgstr "видалити теги"
+
+msgid "verify tags"
+msgstr "перевірити теги"
+
+msgid "Tag creation options"
+msgstr "Опції ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ñ‚ÐµÐ³Ñ–Ð²"
+
+msgid "annotated tag, needs a message"
+msgstr "анотований тег потребує допиÑу"
+
+msgid "tag message"
+msgstr "Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ тегу"
+
+msgid "force edit of tag message"
+msgstr "примуÑове Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð¾Ð¿Ð¸Ñу до тегу"
+
+msgid "annotated and GPG-signed tag"
+msgstr "анотований та підпиÑаний GPG-підпиÑом тег"
+
+msgid "use another key to sign the tag"
+msgstr "викориÑтати інший ключ Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¿Ð¸Ñу тегу"
+
+msgid "replace the tag if exists"
+msgstr "замінити тег, Ñкщо він Ñ–Ñнує"
+
+msgid "create a reflog"
+msgstr "Ñтворити журнал поÑилань"
+
+msgid "Tag listing options"
+msgstr "Опції виводу тегів"
+
+msgid "show tag list in columns"
+msgstr "показати ÑпиÑок тегів в Ñтовпчиках"
+
+msgid "print only tags that contain the commit"
+msgstr "вивеÑти тільки теги, що міÑÑ‚ÑÑ‚ÑŒ коміти"
+
+msgid "print only tags that don't contain the commit"
+msgstr "вивеÑти тільки теги, що не міÑÑ‚ÑÑ‚ÑŒ комітів"
+
+msgid "print only tags that are merged"
+msgstr "вивеÑти тільки злиті теги"
+
+msgid "print only tags that are not merged"
+msgstr "вивеÑти тільки не злиті теги"
+
+msgid "print only tags of the object"
+msgstr "вивеÑти тільки теги обʼєкта"
+
+#, c-format
+msgid "the '%s' option is only allowed in list mode"
+msgstr "Ð¾Ð¿Ñ†Ñ–Ñ \"%s\" дозволена лише в режимі виводу"
+
+#, c-format
+msgid "'%s' is not a valid tag name."
+msgstr "\"%s\" не Ñ” припуÑтимою назвою тега."
+
+#, c-format
+msgid "tag '%s' already exists"
+msgstr "тег \"%s\" вже Ñ–Ñнує"
+
+#, c-format
+msgid "Invalid cleanup mode %s"
+msgstr "ÐеприпуÑтимий режим Ð¾Ñ‡Ð¸Ñ‰ÐµÐ½Ð½Ñ %s"
+
+#, c-format
+msgid "Updated tag '%s' (was %s)\n"
+msgstr "Оновлено тег \"%s\" (було %s)\n"
+
+msgid "pack exceeds maximum allowed size"
+msgstr "пакунок перевищує макÑимально дозволений розмір"
+
+msgid "failed to write object in stream"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати обʼєкт потоку"
+
+#, c-format
+msgid "inflate returned (%d)"
+msgstr "розпаковувач повернув (%d)"
+
+msgid "invalid blob object from stream"
+msgstr "неприпуÑтимий обʼєкт blob з потоку"
+
+msgid "Unpacking objects"
+msgstr "Ð Ð¾Ð·Ð¿Ð°ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ñ–Ð²"
+
+#, c-format
+msgid "failed to create directory %s"
+msgstr "не вдалоÑÑ Ñтворити директорію %s"
+
+#, c-format
+msgid "failed to delete file %s"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ файл %s"
+
+#, c-format
+msgid "failed to delete directory %s"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ директорію %s"
+
+#, c-format
+msgid "Testing mtime in '%s' "
+msgstr "ТеÑÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ mtime в \"%s\" "
+
+msgid "directory stat info does not change after adding a new file"
+msgstr ""
+"ÑтатиÑтична Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ— не змінилаÑÑŒ піÑÐ»Ñ Ð´Ð¾Ð´Ð°Ð½Ð½Ñ Ð½Ð¾Ð²Ð¾Ð³Ð¾ файла"
+
+msgid "directory stat info does not change after adding a new directory"
+msgstr ""
+"ÑтатиÑтична Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ— не змінилаÑÑŒ піÑÐ»Ñ Ð´Ð¾Ð´Ð°Ð½Ð½Ñ Ð½Ð¾Ð²Ð¾Ñ— директорії"
+
+msgid "directory stat info changes after updating a file"
+msgstr "ÑтатиÑтична Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ— змінилаÑÑŒ піÑÐ»Ñ Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð°"
+
+msgid "directory stat info changes after adding a file inside subdirectory"
+msgstr ""
+"ÑтатиÑтична Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ— змінилаÑÑŒ піÑÐ»Ñ Ð´Ð¾Ð´Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° до "
+"піддиректорії"
+
+msgid "directory stat info does not change after deleting a file"
+msgstr "ÑтатиÑтична Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ— не змінилаÑÑŒ піÑÐ»Ñ Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð°"
+
+msgid "directory stat info does not change after deleting a directory"
+msgstr ""
+"ÑтатиÑтична Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ— не змінилаÑÑŒ піÑÐ»Ñ Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ—"
+
+msgid " OK"
+msgstr " OK"
+
+msgid "git update-index [<options>] [--] [<file>...]"
+msgstr "git update-index [<опції>] [--] [<файл>...]"
+
+msgid "continue refresh even when index needs update"
+msgstr "продовжити оновленнÑ, навіть Ñкщо Ñ–Ð½Ð´ÐµÐºÑ Ð¿Ð¾Ñ‚Ñ€ÐµÐ±ÑƒÑ” змін"
+
+msgid "refresh: ignore submodules"
+msgstr "оновити: ігнорувати підмодулі"
+
+msgid "do not ignore new files"
+msgstr "не ігнорувати нові файли"
+
+msgid "let files replace directories and vice-versa"
+msgstr "дозволити файлам замінювати директорії і навпаки"
+
+msgid "notice files missing from worktree"
+msgstr "повідомлÑти про файли, відÑутні в робочому дереві"
+
+msgid "refresh even if index contains unmerged entries"
+msgstr "оновити, навіть Ñкщо Ñ–Ð½Ð´ÐµÐºÑ Ð¼Ñ–Ñтить не злиті запиÑи"
+
+msgid "refresh stat information"
+msgstr "оновити ÑтатиÑтичну інформацію"
+
+msgid "like --refresh, but ignore assume-unchanged setting"
+msgstr "на кшталт --refresh, але ігнорує assume-unchanged опцію"
+
+msgid "<mode>,<object>,<path>"
+msgstr "<режим>,<обʼєкт>,<шлÑÑ…>"
+
+msgid "add the specified entry to the index"
+msgstr "додати вказаний Ð·Ð°Ð¿Ð¸Ñ Ð´Ð¾ індекÑу"
+
+msgid "mark files as \"not changing\""
+msgstr "позначити файли Ñк \"не змінені\""
+
+msgid "clear assumed-unchanged bit"
+msgstr "очиÑтити assumed-unchanged біт"
+
+msgid "mark files as \"index-only\""
+msgstr "позначити файли Ñк \"тільки Ð´Ð»Ñ Ñ–Ð½Ð´ÐµÐºÑу\""
+
+msgid "clear skip-worktree bit"
+msgstr "очиÑтити skip-worktree біт"
+
+msgid "do not touch index-only entries"
+msgstr "ігнорувати файли, призначені тільки Ð´Ð»Ñ Ñ–Ð½Ð´ÐµÐºÑу"
+
+msgid "add to index only; do not add content to object database"
+msgstr "додати лише до індекÑу; не додавати вміÑÑ‚ до бази даних обʼєкта"
+
+msgid "remove named paths even if present in worktree"
+msgstr "видалити іменовані шлÑхи, навіть Ñкщо вони приÑутні у робочому дереві"
+
+msgid "with --stdin: input lines are terminated by null bytes"
+msgstr "з --stdin: вхідні Ñ€Ñдки завершуютьÑÑ Ð½ÑƒÐ»ÑŒÐ¾Ð²Ð¸Ð¼Ð¸ байтами"
+
+msgid "read list of paths to be updated from standard input"
+msgstr "прочитати ÑпиÑок шлÑхів Ð´Ð»Ñ Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð·Ñ– Ñтандартного вводу"
+
+msgid "add entries from standard input to the index"
+msgstr "додати запиÑи зі Ñтандартного вводу до індекÑу"
+
+msgid "repopulate stages #2 and #3 for the listed paths"
+msgstr "перезаповнити етапи â„–2 Ñ– â„–3 Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ»Ñ–Ñ‡ÐµÐ½Ð¸Ñ… шлÑхів"
+
+msgid "only update entries that differ from HEAD"
+msgstr "оновити тільки Ñ‚Ñ– запиÑи, Ñкі відрізнÑÑŽÑ‚ÑŒÑÑ Ð²Ñ–Ð´ HEAD"
+
+msgid "ignore files missing from worktree"
+msgstr "ігнорувати файли відÑутні в робочому дереві"
+
+msgid "report actions to standard output"
+msgstr "звітувати про дії на Ñтандартний вивід"
+
+msgid "(for porcelains) forget saved unresolved conflicts"
+msgstr "(Ð´Ð»Ñ Ð²Ð¸Ñокорівневих команд) забути збережені невирішені конфлікти"
+
+msgid "write index in this format"
+msgstr "запиÑати Ñ–Ð½Ð´ÐµÐºÑ Ñƒ цьому форматі"
+
+msgid "report on-disk index format version"
+msgstr "звітувати про верÑÑ–ÑŽ формату індекÑу на диÑку"
+
+msgid "enable or disable split index"
+msgstr "увімкнути або вимкнути розділений індекÑ"
+
+msgid "enable/disable untracked cache"
+msgstr "увімкнути/вимкнути невідÑтежуваний кеш"
+
+msgid "test if the filesystem supports untracked cache"
+msgstr "перевірити, чи підтримує файлова ÑиÑтема невідÑтежуваний кеш"
+
+msgid "enable untracked cache without testing the filesystem"
+msgstr "увімкнути невідÑтежуваний кеш без теÑÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð²Ð¾Ñ— ÑиÑтеми"
+
+msgid "write out the index even if is not flagged as changed"
+msgstr "запиÑати індекÑ, навіть Ñкщо він не позначений Ñк змінений"
+
+msgid "enable or disable file system monitor"
+msgstr "увімкнути або вимкнути монітор файлової ÑиÑтеми"
+
+msgid "mark files as fsmonitor valid"
+msgstr "позначити файли придатними Ð´Ð»Ñ fsmonitor"
+
+msgid "clear fsmonitor valid bit"
+msgstr "очиÑтити біт придатноÑÑ‚Ñ– Ð´Ð»Ñ fsmonitor"
+
+#, c-format
+msgid "%d\n"
+msgstr "%d\n"
+
+#, c-format
+msgid "index-version: was %d, set to %d"
+msgstr "верÑÑ–Ñ Ñ–Ð½Ð´ÐµÐºÑу: була %d, Ñтала %d"
+
+msgid ""
+"core.splitIndex is set to false; remove or change it, if you really want to "
+"enable split index"
+msgstr ""
+"core.splitIndex вÑтановлено в false; видаліть або змініть його, Ñкщо ви "
+"дійÑно хочете увімкнути розділений індекÑ"
+
+msgid ""
+"core.splitIndex is set to true; remove or change it, if you really want to "
+"disable split index"
+msgstr ""
+"core.splitIndex вÑтановлено в true; видаліть або змініть його, Ñкщо ви "
+"дійÑно хочете вимкнути розділений індекÑ"
+
+msgid ""
+"core.untrackedCache is set to true; remove or change it, if you really want "
+"to disable the untracked cache"
+msgstr ""
+"core.untrackedCache вÑтановлено в true; видаліть або змініть його, Ñкщо ви "
+"дійÑно хочете вимкнути невідÑтежуваний кеш"
+
+msgid "Untracked cache disabled"
+msgstr "ÐевідÑтежуваний кеш вимкнено"
+
+msgid ""
+"core.untrackedCache is set to false; remove or change it, if you really want "
+"to enable the untracked cache"
+msgstr ""
+"core.untrackedCache вÑтановлено в false; видаліть або змініть його, Ñкщо ви "
+"дійÑно хочете увімкнути невідÑтежуваний кеш"
+
+#, c-format
+msgid "Untracked cache enabled for '%s'"
+msgstr "Увімкнено невідÑтежуваний кеш Ð´Ð»Ñ \"%s\""
+
+msgid "core.fsmonitor is unset; set it if you really want to enable fsmonitor"
+msgstr ""
+"core.fsmonitor не вÑтановлено; вÑтановіть його, Ñкщо ви дійÑно хочете "
+"увімкнути fsmonitor"
+
+msgid "fsmonitor enabled"
+msgstr "fsmonitor увімкнено"
+
+msgid ""
+"core.fsmonitor is set; remove it if you really want to disable fsmonitor"
+msgstr ""
+"core.fsmonitor вÑтановлено; видаліть його, Ñкщо ви дійÑно хочете вимкнути "
+"fsmonitor"
+
+msgid "fsmonitor disabled"
+msgstr "fsmonitor вимкнено"
+
+msgid "git update-ref [<options>] -d <refname> [<old-val>]"
+msgstr "git update-ref [<опції>] -d <назва поÑиланнÑ> [<Ñтаре значеннÑ>]"
+
+msgid "git update-ref [<options>] <refname> <new-val> [<old-val>]"
+msgstr ""
+"git update-ref [<опції>] <назва-поÑиланнÑ> <нове-значеннÑ> [<Ñтаре-значеннÑ>]"
+
+msgid "git update-ref [<options>] --stdin [-z]"
+msgstr "git update-ref [<опції>] --stdin [-z]"
+
+msgid "delete the reference"
+msgstr "видалити поÑиланнÑ"
+
+msgid "update <refname> not the one it points to"
+msgstr "оновити <назвау-поÑиланнÑ>, а не те, на Ñке воно вказує"
+
+msgid "stdin has NUL-terminated arguments"
+msgstr "stdin має аргументи, що закінчуютьÑÑ NUL"
+
+msgid "read updates from stdin"
+msgstr "читати Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð· stdin"
+
+msgid "update the info files from scratch"
+msgstr "оновити інформаційні файли з чиÑтого аркуша"
+
+msgid ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <directory>"
+msgstr ""
+"git-upload-pack [--[no-]strict] [--timeout=<н>] [--stateless-rpc]\n"
+" [--advertise-refs] <директоріÑ>"
+
+msgid "quit after a single request/response exchange"
+msgstr "припинити роботу піÑÐ»Ñ Ð¿ÐµÑ€ÑˆÐ¾Ð³Ð¾ запит/відповідь обміну"
+
+msgid "serve up the info/refs for git-http-backend"
+msgstr "надати info/refs Ð´Ð»Ñ git-http-backend"
+
+msgid "do not try <directory>/.git/ if <directory> is no Git directory"
+msgstr ""
+"не пробувати <директоріÑ>/.git/, Ñкщо <директоріÑ> не Ñ” директорією Git"
+
+msgid "interrupt transfer after <n> seconds of inactivity"
+msgstr "перервати передачу піÑÐ»Ñ <н> Ñекунд неактивноÑÑ‚Ñ–"
+
+msgid "git verify-commit [-v | --verbose] [--raw] <commit>..."
+msgstr "git verify-commit [-v | —verbose] [--raw] <коміт>..."
+
+msgid "print commit contents"
+msgstr "показати вміÑÑ‚ коміту"
+
+msgid "print raw gpg status output"
+msgstr "показати необроблений вивід Ñтану gpg"
+
+msgid "git verify-pack [-v | --verbose] [-s | --stat-only] [--] <pack>.idx..."
+msgstr ""
+"git verify-pack [-v | --verbose] [-s | --stat-only] [--] <пакунок>.idx..."
+
+msgid "verbose"
+msgstr "розгорнутий вивід"
+
+msgid "show statistics only"
+msgstr "показати тільки ÑтатиÑтику"
+
+msgid "git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."
+msgstr "git verify-tag [-v | --verbose] [--format=<формат>] [--raw] <тег>..."
+
+msgid "print tag contents"
+msgstr "показати вміÑÑ‚ тегу"
+
+msgid ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <string>]]\n"
+" [--orphan] [(-b | -B) <new-branch>] <path> [<commit-ish>]"
+msgstr ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <Ñтрока>]]\n"
+" [--orphan] [(-b | -B) <нова-гілка>] <шлÑÑ…> [<комітоподібне>]"
+
+msgid "git worktree list [-v | --porcelain [-z]]"
+msgstr "git worktree list [-v | --porcelain [-z]]"
+
+msgid "git worktree lock [--reason <string>] <worktree>"
+msgstr "git worktree lock [--reason <Ñтрока>] <робоче дерево>"
+
+msgid "git worktree move <worktree> <new-path>"
+msgstr "git worktree move <робоче-дерево> <новий-шлÑÑ…>"
+
+msgid "git worktree prune [-n] [-v] [--expire <expire>]"
+msgstr "git worktree prune [-n] [-v] [--expire <термін-дії>]"
+
+msgid "git worktree remove [-f] <worktree>"
+msgstr "git worktree remove [-f] <робоче дерево>"
+
+msgid "git worktree repair [<path>...]"
+msgstr "git worktree repair [<шлÑÑ…>...]"
+
+msgid "git worktree unlock <worktree>"
+msgstr "git worktree unlock <робоче дерево>"
+
+msgid "No possible source branch, inferring '--orphan'"
+msgstr "Ðемає можливої джерельної гілки, що означає \"--orphan\""
+
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+msgstr ""
+"Якщо ви хочете Ñтворити робоче дерево, що міÑтить нову ненароджену гілку\n"
+"(гілку без комітів) Ð´Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ Ñховища, ви можете зробити це\n"
+"за допомогою Ð¿Ñ€Ð°Ð¿Ð¾Ñ€Ñ†Ñ --orphan:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan %s\n"
+msgstr ""
+"Якщо ви хочете Ñтворити робоче дерево, що міÑтить нову ненароджену гілку\n"
+"(гілку без комітів) Ð´Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ Ñховища, ви можете зробити це\n"
+"за допомогою Ð¿Ñ€Ð°Ð¿Ð¾Ñ€Ñ†Ñ --orphan:\n"
+"\n"
+" git worktree add --orphan %s\n"
+
+#, c-format
+msgid "Removing %s/%s: %s"
+msgstr "Ð’Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ %s/%s: %s"
+
+msgid "report pruned working trees"
+msgstr "звітувати про Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ñ€Ð¾Ð±Ð¾Ñ‡Ð¸Ñ… дерев"
+
+msgid "expire working trees older than <time>"
+msgstr "видалити робочі дерева, Ñтаріші за <чаÑ>"
+
+#, c-format
+msgid "'%s' already exists"
+msgstr "\"%s\" вже Ñ–Ñнує"
+
+#, c-format
+msgid "unusable worktree destination '%s'"
+msgstr "непридатне міÑце Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ€Ð¾Ð±Ð¾Ñ‡Ð¾Ð³Ð¾ дерева \"%s\""
+
+#, c-format
+msgid ""
+"'%s' is a missing but locked worktree;\n"
+"use '%s -f -f' to override, or 'unlock' and 'prune' or 'remove' to clear"
+msgstr ""
+"\"%s\" - Ñ” відÑутнім, але заблокованим робочим деревом;\n"
+"ÑкориÑтайтеÑÑŒ командою \"%s -f -f\", щоб перевизначити або \"unlock\" Ñ– "
+"\"prune\" або \"remove\", щоб очиÑтити"
+
+#, c-format
+msgid ""
+"'%s' is a missing but already registered worktree;\n"
+"use '%s -f' to override, or 'prune' or 'remove' to clear"
+msgstr ""
+"\"%s\" - Ñ” відÑутнім, але вже зареєÑтрованим робочим деревом;\n"
+"ÑкориÑтайтеÑÑŒ командою \"%s -f\", щоб перевизначити, або \"prune\" чи "
+"\"remove\", щоб очиÑтити"
+
+#, c-format
+msgid "failed to copy '%s' to '%s'; sparse-checkout may not work correctly"
+msgstr ""
+"не вдалоÑÑ Ñкопіювати \"%s\" в \"%s\"; розріджений перехід може працювати "
+"некоректно"
+
+#, c-format
+msgid "failed to copy worktree config from '%s' to '%s'"
+msgstr "не вдалоÑÑ Ñкопіювати конфігурацію робочого дерева з \"%s\" до \"%s\""
+
+#, c-format
+msgid "failed to unset '%s' in '%s'"
+msgstr "не вдалоÑÑ Ñкинути \"%s\" в \"%s\""
+
+#, c-format
+msgid "could not create directory of '%s'"
+msgstr "не вдалоÑÑ Ñтворити директорію \"%s\""
+
+msgid "initializing"
+msgstr "ініціалізаціÑ"
+
+#, c-format
+msgid "could not find created worktree '%s'"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ Ñтворене робоче дерево \"%s\""
+
+#, c-format
+msgid "Preparing worktree (new branch '%s')"
+msgstr "Підготовка робочого дерева (нова гілка \"%s\")"
+
+#, c-format
+msgid "Preparing worktree (resetting branch '%s'; was at %s)"
+msgstr "Підготовка робочого дерева (ÑÐºÐ¸Ð´Ð°Ð½Ð½Ñ Ð³Ñ–Ð»ÐºÐ¸ \"%s\"; була на %s)"
+
+#, c-format
+msgid "Preparing worktree (checking out '%s')"
+msgstr "Підготовка робочого дерева (перехід до \"%s\")"
+
+#, c-format
+msgid "unreachable: invalid reference: %s"
+msgstr "недоÑÑжне: неприпуÑтиме поÑиланнÑ: %s"
+
+#, c-format
+msgid "Preparing worktree (detached HEAD %s)"
+msgstr "Підготовка робочого дерева (відокремлений HEAD %s)"
+
+#, c-format
+msgid ""
+"HEAD points to an invalid (or orphaned) reference.\n"
+"HEAD path: '%s'\n"
+"HEAD contents: '%s'"
+msgstr ""
+"HEAD вказує на неприпуÑтиме (або оÑиротіле) поÑиланнÑ.\n"
+"HEAD шлÑÑ…: \"%s\"\n"
+"HEAD вміÑÑ‚: \"%s\""
+
+msgid ""
+"No local or remote refs exist despite at least one remote\n"
+"present, stopping; use 'add -f' to override or fetch a remote first"
+msgstr ""
+"Ðе Ñ–Ñнує локальних або віддалених поÑилань, незважаючи на наÑвніÑÑ‚ÑŒ "
+"принаймні одного віддаленого\n"
+"призначеннÑ, зупинка; ÑкориÑтайтеÑÑŒ \"add -f\", щоб перевизначити, або "
+"Ñпочатку виконайте Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð· віддаленного Ñховища"
+
+msgid "checkout <branch> even if already checked out in other worktree"
+msgstr ""
+"перейти на <гілку>, навіть Ñкщо вона вже активна в іншому робочому дереві"
+
+msgid "create a new branch"
+msgstr "Ñтворити нову гілку"
+
+msgid "create or reset a branch"
+msgstr "Ñтворити або Ñкинути гілку"
+
+msgid "create unborn branch"
+msgstr "Ñтворити ненароджену гілку"
+
+msgid "populate the new working tree"
+msgstr "заповнити нове робоче дерево"
+
+msgid "keep the new working tree locked"
+msgstr "зберегти нове робоче дерево зафікÑованим"
+
+msgid "reason for locking"
+msgstr "причина блокуваннÑ"
+
+msgid "set up tracking mode (see git-branch(1))"
+msgstr "налаштувати режим відÑÑ‚ÐµÐ¶ÑƒÐ²Ð°Ð½Ð½Ñ (дивітьÑÑ git-branch(1))"
+
+msgid "try to match the new branch name with a remote-tracking branch"
+msgstr ""
+"Ñпробуйте ÑпівÑтавити нову назву гілки з назвою віддалено відÑтежуваної гілки"
+
+#, c-format
+msgid "options '%s', '%s', and '%s' cannot be used together"
+msgstr "опції \"%s\", \"%s\" та \"%s\" не можна викориÑтовувати разом"
+
+#, c-format
+msgid "option '%s' and commit-ish cannot be used together"
+msgstr "опцію \"%s\" не можна викориÑтовувати разом з комітоподібними"
+
+msgid "added with --lock"
+msgstr "додано з --lock"
+
+msgid "--[no-]track can only be used if a new branch is created"
+msgstr "--[no-]track можна викориÑтовувати лише при Ñтворенні нової гілки"
+
+msgid "show extended annotations and reasons, if available"
+msgstr "показувати розширені анотації та причини, Ñкщо вони доÑтупні"
+
+msgid "add 'prunable' annotation to worktrees older than <time>"
+msgstr "додати анотацію \"prunable\" до робочих дерев, Ñтаріших за <чаÑ>"
+
+msgid "terminate records with a NUL character"
+msgstr "завершувати запиÑи Ñимволом NUL"
+
+#, c-format
+msgid "'%s' is not a working tree"
+msgstr "\"%s\" не є робочим деревом"
+
+msgid "The main working tree cannot be locked or unlocked"
+msgstr "Головне робоче дерево неможливо заблокувати або розблокувати"
+
+#, c-format
+msgid "'%s' is already locked, reason: %s"
+msgstr "\"%s\" вже заблоковано, причина: %s"
+
+#, c-format
+msgid "'%s' is already locked"
+msgstr "\"%s\" вже заблоковано"
+
+#, c-format
+msgid "'%s' is not locked"
+msgstr "\"%s\" не зафікÑовано"
+
+msgid "working trees containing submodules cannot be moved or removed"
+msgstr ""
+"робочі дерева, що міÑÑ‚ÑÑ‚ÑŒ підмодулі, не можуть бути переміщені або видалені"
+
+msgid "force move even if worktree is dirty or locked"
+msgstr ""
+"переміÑтити примуÑово, навіть Ñкщо робоче дерево забруднене або заблоковане"
+
+#, c-format
+msgid "'%s' is a main working tree"
+msgstr "\"%s\" є головним робочим деревом"
+
+#, c-format
+msgid "could not figure out destination name from '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ назву Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð· \"%s\""
+
+#, c-format
+msgid ""
+"cannot move a locked working tree, lock reason: %s\n"
+"use 'move -f -f' to override or unlock first"
+msgstr ""
+"неможливо переміÑтити заблоковане робоче дерево, причина блокуваннÑ: %s\n"
+"ÑкориÑтайтеÑÑŒ командою \"move -f -f\", щоб Ñпочатку перевизначити або "
+"розблокувати його"
+
+msgid ""
+"cannot move a locked working tree;\n"
+"use 'move -f -f' to override or unlock first"
+msgstr ""
+"неможливо переміÑтити заблоковане робоче дерево;\n"
+"ÑкориÑтайтеÑÑŒ командою \"move -f -f\", щоб Ñпочатку перевизначити або "
+"розблокувати його"
+
+#, c-format
+msgid "validation failed, cannot move working tree: %s"
+msgstr "Ð²Ð°Ð»Ñ–Ð´Ð°Ñ†Ñ–Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ð»Ð°ÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾, неможливо переміÑтити робоче дерево: %s"
+
+#, c-format
+msgid "failed to move '%s' to '%s'"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ½ÐµÑти \"%s\" до \"%s\""
+
+#, c-format
+msgid "failed to run 'git status' on '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ \"git status\" на \"%s\""
+
+#, c-format
+msgid "'%s' contains modified or untracked files, use --force to delete it"
+msgstr ""
+"\"%s\" міÑтить змінені або невідÑтежувані файли, ÑкориÑтайтеÑÑŒ --force, щоб "
+"видалити їх"
+
+#, c-format
+msgid "failed to run 'git status' on '%s', code %d"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ \"git status\" на \"%s\", код %d"
+
+msgid "force removal even if worktree is dirty or locked"
+msgstr ""
+"видалити примуÑово, навіть Ñкщо робоче дерево забруднене або заблоковане"
+
+#, c-format
+msgid ""
+"cannot remove a locked working tree, lock reason: %s\n"
+"use 'remove -f -f' to override or unlock first"
+msgstr ""
+"неможливо видалити заблоковане робоче дерево, причина блокуваннÑ: %s\n"
+"ÑкориÑтайтеÑÑŒ \"remove -f -f\", щоб перевизначити або розблокувати"
+
+msgid ""
+"cannot remove a locked working tree;\n"
+"use 'remove -f -f' to override or unlock first"
+msgstr ""
+"неможливо видалити заблоковане робоче дерево;\n"
+"ÑкориÑтайтеÑÑŒ \"remove -f -f\", щоб перевизначити або розблокувати"
+
+#, c-format
+msgid "validation failed, cannot remove working tree: %s"
+msgstr "Ð²Ð°Ð»Ñ–Ð´Ð°Ñ†Ñ–Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ð»Ð°ÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾, неможливо видалити робоче дерево: %s"
+
+#, c-format
+msgid "repair: %s: %s"
+msgstr "відремонтувати: %s: %s"
+
+#, c-format
+msgid "error: %s: %s"
+msgstr "помилка: %s: %s"
+
+msgid "git write-tree [--missing-ok] [--prefix=<prefix>/]"
+msgstr "git write-tree [--missing-ok] [--prefix=<префікÑ>/]"
+
+msgid "<prefix>/"
+msgstr "<префікÑ>/"
+
+msgid "write tree object for a subdirectory <prefix>"
+msgstr "запиÑати обʼєкт дерева Ð´Ð»Ñ Ð¿Ñ–Ð´Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ— <префікÑ>"
+
+msgid "only useful for debugging"
+msgstr "кориÑно лише Ð´Ð»Ñ Ð²Ñ–Ð´Ð»Ð°Ð³Ð¾Ð´Ð¶ÐµÐ½Ð½Ñ"
+
+msgid "core.fsyncMethod = batch is unsupported on this platform"
+msgstr "core.fsyncMethod = batch не підтримуєтьÑÑ Ð½Ð° цій платформі"
+
+#, c-format
+msgid "could not parse bundle list key %s with value '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ ключ ÑпиÑку пакунків %s зі значеннÑм \"%s\""
+
+#, c-format
+msgid "bundle list at '%s' has no mode"
+msgstr "ÑпиÑок пакунків на \"%s\" не має режиму"
+
+msgid "failed to create temporary file"
+msgstr "не вдалоÑÑ Ñтворити тимчаÑовий файл"
+
+msgid "insufficient capabilities"
+msgstr "недоÑтатні здібноÑÑ‚Ñ–"
+
+#, c-format
+msgid "file downloaded from '%s' is not a bundle"
+msgstr "файл, завантажений з \"%s\", не є пакунком"
+
+msgid "failed to store maximum creation token"
+msgstr "не вдалоÑÑ Ð·Ð±ÐµÑ€ÐµÐ³Ñ‚Ð¸ токен макÑимального ÑтвореннÑ"
+
+#, c-format
+msgid "unrecognized bundle mode from URI '%s'"
+msgstr "нерозпізнаний режим пакунка з URI \"%s\""
+
+#, c-format
+msgid "exceeded bundle URI recursion limit (%d)"
+msgstr "перевищено ліміт рекурÑÑ–Ñ— URI пакунка (%d)"
+
+#, c-format
+msgid "failed to download bundle from URI '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ пакунок з URI \"%s\""
+
+#, c-format
+msgid "file at URI '%s' is not a bundle or bundle list"
+msgstr "файл з URI \"%s\" не Ñ” пакунком або ÑпиÑком пакунків"
+
+#, c-format
+msgid "bundle-uri: unexpected argument: '%s'"
+msgstr "bundle-uri: неочікуваний аргумент: \"%s\""
+
+msgid "bundle-uri: expected flush after arguments"
+msgstr "bundle-uri: очікувалоÑÑŒ flush піÑÐ»Ñ Ð°Ñ€Ð³ÑƒÐ¼ÐµÐ½Ñ‚Ñ–Ð²"
+
+msgid "bundle-uri: got an empty line"
+msgstr "bundle-uri: отримано порожній Ñ€Ñдок"
+
+msgid "bundle-uri: line is not of the form 'key=value'"
+msgstr "bundle-uri: Ñ€Ñдок не відповідає формату \"key=value\""
+
+msgid "bundle-uri: line has empty key or value"
+msgstr "bundle-uri: Ñ€Ñдок має порожній ключ або значеннÑ"
+
+#, c-format
+msgid "unrecognized bundle hash algorithm: %s"
+msgstr "нерозпізнаний хеш-алгоритм пакунка: %s"
+
+#, c-format
+msgid "unknown capability '%s'"
+msgstr "невідома влаÑтивіÑÑ‚ÑŒ \"%s\""
+
+#, c-format
+msgid "'%s' does not look like a v2 or v3 bundle file"
+msgstr "\"%s\" не Ñхожий на файл пакунка v2 або v3"
+
+#, c-format
+msgid "unrecognized header: %s%s (%d)"
+msgstr "нерозпізнаний заголовок: %s%s (%d)"
+
+msgid "Repository lacks these prerequisite commits:"
+msgstr "У Ñховищі не виÑтачає обовʼÑзкових комітів:"
+
+msgid "need a repository to verify a bundle"
+msgstr "потрібне Ñховище Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ²Ñ–Ñ€ÐºÐ¸ пакунка"
+
+msgid ""
+"some prerequisite commits exist in the object store, but are not connected "
+"to the repository's history"
+msgstr ""
+"деÑкі попередні коміти Ñ–Ñнують у міÑці Ð·Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ñ–Ð², але не повʼÑзані "
+"з Ñ–Ñторією Ñховища"
+
+#, c-format
+msgid "The bundle contains this ref:"
+msgid_plural "The bundle contains these %<PRIuMAX> refs:"
+msgstr[0] "Пакунок міÑтить це %<PRIuMAX> поÑиланнÑ:"
+msgstr[1] "Пакунок міÑтить ці %<PRIuMAX> поÑиланнÑ:"
+msgstr[2] "Пакунок міÑтить ці %<PRIuMAX> поÑилань:"
+
+msgid "The bundle records a complete history."
+msgstr "Пакунок запиÑує повну Ñ–Ñторію."
+
+#, c-format
+msgid "The bundle requires this ref:"
+msgid_plural "The bundle requires these %<PRIuMAX> refs:"
+msgstr[0] "Пакунок потребує це %<PRIuMAX> поÑиланнÑ:"
+msgstr[1] "Пакунок потребує ці %<PRIuMAX> поÑиланнÑ:"
+msgstr[2] "Пакунок потребує ці %<PRIuMAX> поÑилань:"
+
+#, c-format
+msgid "The bundle uses this hash algorithm: %s"
+msgstr "Пакунок викориÑтовує такий алгоритм хешуваннÑ: %s"
+
+#, c-format
+msgid "The bundle uses this filter: %s"
+msgstr "Пакунок викориÑтовує такий фільтр: %s"
+
+msgid "unable to dup bundle descriptor"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ð´ÑƒÐ±Ð»ÑŽÐ²Ð°Ñ‚Ð¸ деÑкриптор пакунка"
+
+msgid "Could not spawn pack-objects"
+msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·Ð¼Ð½Ð¾Ð¶Ð¸Ñ‚Ð¸ об’єкти пакунків"
+
+msgid "pack-objects died"
+msgstr "pack-objects завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "ref '%s' is excluded by the rev-list options"
+msgstr "поÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\" виключено опціÑми rev-list"
+
+#, c-format
+msgid "unsupported bundle version %d"
+msgstr "непідтримувана верÑÑ–Ñ Ð¿Ð°ÐºÑƒÐ½ÐºÐ° %d"
+
+#, c-format
+msgid "cannot write bundle version %d with algorithm %s"
+msgstr "неможливо запиÑати верÑÑ–ÑŽ пакунка %d з алгоритмом %s"
+
+msgid "Refusing to create empty bundle."
+msgstr "Відмовлено в Ñтворенні порожнього пакунка."
+
+#, c-format
+msgid "cannot create '%s'"
+msgstr "неможливо Ñтворити \"%s\""
+
+msgid "index-pack died"
+msgstr "index-pack завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+msgid "terminating chunk id appears earlier than expected"
+msgstr "ідентифікатор Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð½Ñ Ñ„Ñ€Ð°Ð³Ð¼ÐµÐ½Ñ‚Ð° зʼÑвивÑÑ Ñ€Ð°Ð½Ñ–ÑˆÐµ, ніж очікувалоÑÑŒ"
+
+#, c-format
+msgid "chunk id %<PRIx32> not %d-byte aligned"
+msgstr "шматок id %<PRIx32> не Ñ” %d-byte впорÑдкованим"
+
+#, c-format
+msgid "improper chunk offset(s) %<PRIx64> and %<PRIx64>"
+msgstr "невірне Ð·Ð¼Ñ–Ñ‰ÐµÐ½Ð½Ñ ÑˆÐ¼Ð°Ñ‚ÐºÐ°(ів) %<PRIx64> та %<PRIx64>"
+
+#, c-format
+msgid "duplicate chunk ID %<PRIx32> found"
+msgstr "знайдено дубльований шматок з ідентифікатором %<PRIx32>"
+
+#, c-format
+msgid "final chunk has non-zero id %<PRIx32>"
+msgstr "заключний шматок має ненульовий ідентифікатор %<PRIx32>"
+
+msgid "invalid hash version"
+msgstr "неприпуÑтима верÑÑ–Ñ Ñ…ÐµÑˆÑƒ"
+
+#, c-format
+msgid "invalid color value: %.*s"
+msgstr "неприпуÑтиме Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ¾Ð»ÑŒÐ¾Ñ€Ñƒ: %.*s"
+
+msgid "Add file contents to the index"
+msgstr "Додати вміÑÑ‚ файлу до індекÑу"
+
+msgid "Apply a series of patches from a mailbox"
+msgstr "ЗаÑтоÑувати Ñерію латок з поштової Ñкриньки"
+
+msgid "Annotate file lines with commit information"
+msgstr "Ðнотувати Ñ€Ñдки файлів з інформацією про коміти"
+
+msgid "Apply a patch to files and/or to the index"
+msgstr "ЗаÑтоÑувати латку до файлів та/або до індекÑу"
+
+msgid "Import a GNU Arch repository into Git"
+msgstr "Імпортувати GNU Arch Ñховище до Git"
+
+msgid "Create an archive of files from a named tree"
+msgstr "Створити архів файлів з названого дерева"
+
+msgid "Use binary search to find the commit that introduced a bug"
+msgstr "ВикориÑтати бінарний пошук, щоб знайти коміт, Ñкий Ð²Ð½Ñ–Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÑƒ"
+
+msgid "Show what revision and author last modified each line of a file"
+msgstr "Показати, Ñка Ñ€ÐµÐ²Ñ–Ð·Ñ–Ñ Ñ‚Ð° автор воÑтаннє змінювали кожен Ñ€Ñдок файлу"
+
+msgid "List, create, or delete branches"
+msgstr "Показати, Ñтворити або видалити гілки"
+
+msgid "Collect information for user to file a bug report"
+msgstr "Зібрати інформацію, щоб кориÑтувач міг подати звіт про помилку"
+
+msgid "Move objects and refs by archive"
+msgstr "ПеренеÑти архів обʼєктів та поÑилань"
+
+msgid "Provide contents or details of repository objects"
+msgstr "Ðадавати вміÑÑ‚ або деталі обʼєктів Ñховища"
+
+msgid "Display gitattributes information"
+msgstr "Відобразити інформацію про gitattributes"
+
+msgid "Debug gitignore / exclude files"
+msgstr "Відлагодити gitignore / вилучити файли"
+
+msgid "Show canonical names and email addresses of contacts"
+msgstr "Показати канонічні імена та адреÑи електронної пошти контактів"
+
+msgid "Ensures that a reference name is well formed"
+msgstr "Забезпечує правильне Ñ„Ð¾Ñ€Ð¼ÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð°Ð·Ð²Ð¸ поÑиланнÑ"
+
+msgid "Switch branches or restore working tree files"
+msgstr "Перемкнути гілки або відновити файли робочого дерева"
+
+msgid "Copy files from the index to the working tree"
+msgstr "Скопіювати файли з індекÑу в робоче дерево"
+
+msgid "Find commits yet to be applied to upstream"
+msgstr "Знайти коміти, Ñкі ще не були заÑтоÑовані до першоджерельного Ñховища"
+
+msgid "Apply the changes introduced by some existing commits"
+msgstr "ЗаÑтоÑувати зміни, внеÑені деÑкими Ñ–Ñнуючими комітами"
+
+msgid "Graphical alternative to git-commit"
+msgstr "Графічна альтернатива git-commit"
+
+msgid "Remove untracked files from the working tree"
+msgstr "Видалити невідÑтежувані файли з робочого дерева"
+
+msgid "Clone a repository into a new directory"
+msgstr "Клонувати Ñховище в нову директорію"
+
+msgid "Display data in columns"
+msgstr "Відобразити дані в Ñтовпчиках"
+
+msgid "Record changes to the repository"
+msgstr "ЗапиÑати зміни у Ñховище"
+
+msgid "Write and verify Git commit-graph files"
+msgstr "ЗапиÑати та перевірити файли коміт-графа Git"
+
+msgid "Create a new commit object"
+msgstr "Створити новий обʼєкт коміту"
+
+msgid "Get and set repository or global options"
+msgstr "Отримати та вÑтановити параметри Ñховища або глобальні параметри"
+
+msgid "Count unpacked number of objects and their disk consumption"
+msgstr "Підрахувати кількіÑÑ‚ÑŒ розпакованих обʼєктів та їхнє викориÑÑ‚Ð°Ð½Ð½Ñ Ð´Ð¸Ñка"
+
+msgid "Retrieve and store user credentials"
+msgstr "Отримати та зберегти облікові дані кориÑтувача"
+
+msgid "Helper to temporarily store passwords in memory"
+msgstr "Помічник Ð´Ð»Ñ Ñ‚Ð¸Ð¼Ñ‡Ð°Ñового Ð·Ð±ÐµÑ€Ñ–Ð³Ð°Ð½Ð½Ñ Ð¿Ð°Ñ€Ð¾Ð»Ñ–Ð² у памʼÑÑ‚Ñ–"
+
+msgid "Helper to store credentials on disk"
+msgstr "Помічник Ð´Ð»Ñ Ð·Ð±ÐµÑ€Ñ–Ð³Ð°Ð½Ð½Ñ Ð¾Ð±Ð»Ñ–ÐºÐ¾Ð²Ð¸Ñ… даних на диÑку"
+
+msgid "Export a single commit to a CVS checkout"
+msgstr "ЕкÑпортувати окремий коміт до CVS Ñтану"
+
+msgid "Salvage your data out of another SCM people love to hate"
+msgstr "Ð’Ñ€Ñтувати Ñвої дані з іншої SCM, Ñку вÑÑ– так неполюблÑÑŽÑ‚ÑŒ"
+
+msgid "A CVS server emulator for Git"
+msgstr "ЕмулÑтор CVS Ñервера Ð´Ð»Ñ Git"
+
+msgid "A really simple server for Git repositories"
+msgstr "Дуже проÑтий Ñервер Ð´Ð»Ñ Git Ñховищ"
+
+msgid "Give an object a human readable name based on an available ref"
+msgstr ""
+"Ðадати обʼєкту читабельну Ð´Ð»Ñ Ð»ÑŽÐ´Ð¸Ð½Ð¸ назву на оÑнові наÑвного поÑиланнÑ"
+
+msgid "Generate a zip archive of diagnostic information"
+msgstr "Згенерувати zip-архів з діагноÑтичною інформацією"
+
+msgid "Show changes between commits, commit and working tree, etc"
+msgstr "Показати зміни між комітами, комітом та робочим деревом, тощо"
+
+msgid "Compares files in the working tree and the index"
+msgstr "Порівнює файли в робочому дереві та індекÑÑ–"
+
+msgid "Compare a tree to the working tree or index"
+msgstr "ПорівнÑти дерево з робочим деревом або індекÑом"
+
+msgid "Compares the content and mode of blobs found via two tree objects"
+msgstr ""
+"Порівнює вміÑÑ‚ та режим blob обʼєктів, знайдених у двох обʼєктах дерева"
+
+msgid "Show changes using common diff tools"
+msgstr "Показати зміни за допомогою звичайних diff заÑобів"
+
+msgid "Git data exporter"
+msgstr "ЕкÑпортер даних Git"
+
+msgid "Backend for fast Git data importers"
+msgstr "Обробник Ð´Ð»Ñ ÑˆÐ²Ð¸Ð´ÐºÐ¸Ñ… імпортерів даних Git"
+
+msgid "Download objects and refs from another repository"
+msgstr "Завантажити обʼєкти та поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð· іншого Ñховища"
+
+msgid "Receive missing objects from another repository"
+msgstr "Отримати відÑутні обʼєкти з іншого Ñховища"
+
+msgid "Rewrite branches"
+msgstr "ПерезапиÑати гілки"
+
+msgid "Produce a merge commit message"
+msgstr "Створити Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту злиттÑ"
+
+msgid "Output information on each ref"
+msgstr "ВивеÑти інформацію про кожне поÑиланнÑ"
+
+msgid "Run a Git command on a list of repositories"
+msgstr "ЗапуÑтити команду Git на ÑпиÑку Ñховищ"
+
+msgid "Prepare patches for e-mail submission"
+msgstr "Підготувати латки Ð´Ð»Ñ Ð½Ð°Ð´ÑÐ¸Ð»Ð°Ð½Ð½Ñ ÐµÐ»ÐµÐºÑ‚Ñ€Ð¾Ð½Ð½Ð¾ÑŽ поштою"
+
+msgid "Verifies the connectivity and validity of the objects in the database"
+msgstr "ПеревірÑÑ” звʼÑзніÑÑ‚ÑŒ та валідніÑÑ‚ÑŒ обʼєктів у базі даних"
+
+msgid "Cleanup unnecessary files and optimize the local repository"
+msgstr "Видалити непотрібні файли та оптимізувати локальне Ñховище"
+
+msgid "Extract commit ID from an archive created using git-archive"
+msgstr ""
+"ВитÑгти ідентифікатор коміту з архіву, Ñтвореного за допомогою git-archive"
+
+msgid "Print lines matching a pattern"
+msgstr "ВивеÑти Ñ€Ñдки, що відповідають шаблону"
+
+msgid "A portable graphical interface to Git"
+msgstr "Портативний графічний Ñ–Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð´Ð¾ Git"
+
+msgid "Compute object ID and optionally create an object from a file"
+msgstr "ОбчиÑлити ідентифікатор обʼєкта та за бажаннÑм Ñтворити обʼєкт з файлу"
+
+msgid "Display help information about Git"
+msgstr "Відобразити довідкову інформацію про Git"
+
+msgid "Run git hooks"
+msgstr "ЗапуÑтити git гачки"
+
+msgid "Server side implementation of Git over HTTP"
+msgstr "Серверна Ñ€ÐµÐ°Ð»Ñ–Ð·Ð°Ñ†Ñ–Ñ Git через HTTP"
+
+msgid "Download from a remote Git repository via HTTP"
+msgstr "Завантажити з віддаленого Git Ñховища через HTTP"
+
+msgid "Push objects over HTTP/DAV to another repository"
+msgstr "ÐадіÑлати обʼєкти через HTTP/DAV до іншого Ñховища"
+
+msgid "Send a collection of patches from stdin to an IMAP folder"
+msgstr "ÐадіÑлати збірку латок з stdin до теки IMAP"
+
+msgid "Build pack index file for an existing packed archive"
+msgstr "Побудувати індекÑний файл пакунка Ð´Ð»Ñ Ñ–Ñнуючого запакованого архіву"
+
+msgid "Create an empty Git repository or reinitialize an existing one"
+msgstr "Створити порожнє Git Ñховище або переініціалізувати Ñ–Ñнуюче"
+
+msgid "Instantly browse your working repository in gitweb"
+msgstr "Миттєво переглÑнути Ñвоє робоче Ñховище в gitweb"
+
+msgid "Add or parse structured information in commit messages"
+msgstr "Додати або розібрати Ñтруктуровану інформацію в допиÑах до комітів"
+
+msgid "Show commit logs"
+msgstr "Показати журнал коміту"
+
+msgid "Show information about files in the index and the working tree"
+msgstr "Показати інформацію про файли в індекÑÑ– та робочому дереві"
+
+msgid "List references in a remote repository"
+msgstr "Показати поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ñƒ віддаленому Ñховищі"
+
+msgid "List the contents of a tree object"
+msgstr "Показати вміÑÑ‚ обʼєкта дерева"
+
+msgid "Extracts patch and authorship from a single e-mail message"
+msgstr "ВитÑгує латку та авторÑтво з одного Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ ÐµÐ»ÐµÐºÑ‚Ñ€Ð¾Ð½Ð½Ð¾Ñ— пошти"
+
+msgid "Simple UNIX mbox splitter program"
+msgstr "ПроÑта програма-розщеплювач UNIX mbox"
+
+msgid "Run tasks to optimize Git repository data"
+msgstr "ЗапуÑтити Ð·Ð°Ð²Ð´Ð°Ð½Ð½Ñ Ð´Ð»Ñ Ð¾Ð¿Ñ‚Ð¸Ð¼Ñ–Ð·Ð°Ñ†Ñ–Ñ— даних Git Ñховища"
+
+msgid "Join two or more development histories together"
+msgstr "Обʼєднати дві або більше Ñ–Ñторій розробки"
+
+msgid "Find as good common ancestors as possible for a merge"
+msgstr "Знайти Ñкомога кращого Ñпільного предка Ð´Ð»Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ"
+
+msgid "Run a three-way file merge"
+msgstr "ЗапуÑтити триÑтороннє Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ñ„Ð°Ð¹Ð»Ñ–Ð²"
+
+msgid "Run a merge for files needing merging"
+msgstr "ЗапуÑтити Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð´Ð»Ñ Ñ„Ð°Ð¹Ð»Ñ–Ð², Ñкі потрібно обʼєднати"
+
+msgid "The standard helper program to use with git-merge-index"
+msgstr "Стандартна допоміжна програма Ð´Ð»Ñ Ð²Ð¸ÐºÐ¾Ñ€Ð¸ÑÑ‚Ð°Ð½Ð½Ñ Ð· git-merge-index"
+
+msgid "Perform merge without touching index or working tree"
+msgstr "Виконати злиттÑ, не торкаючиÑÑŒ індекÑу або робочого дерева"
+
+msgid "Run merge conflict resolution tools to resolve merge conflicts"
+msgstr ""
+"ЗапуÑтити інÑтрументи Ð²Ð¸Ñ€Ñ–ÑˆÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ð»Ñ–ÐºÑ‚Ñ–Ð², щоб вирішити конфлікти злиттÑ"
+
+msgid "Creates a tag object with extra validation"
+msgstr "Створює обʼєкт тегу з додатковою перевіркою"
+
+msgid "Build a tree-object from ls-tree formatted text"
+msgstr "Побудувати обʼєкт дерева з ls-tree форматованого текÑту"
+
+msgid "Write and verify multi-pack-indexes"
+msgstr "ЗапиÑати Ñ– перевірити multi-pack-indexes"
+
+msgid "Move or rename a file, a directory, or a symlink"
+msgstr "ПереміÑтити або перейменувати файл, директорію або Ñимвольне поÑиланнÑ"
+
+msgid "Find symbolic names for given revs"
+msgstr "Знайти Ñимвольни назви Ð´Ð»Ñ Ð·Ð°Ð´Ð°Ð½Ð¸Ñ… ревізій"
+
+msgid "Add or inspect object notes"
+msgstr "Додати або перевірити нотатки до обʼєктів"
+
+msgid "Import from and submit to Perforce repositories"
+msgstr "Імпортувати з та надÑилати до Perforce Ñховищ"
+
+msgid "Create a packed archive of objects"
+msgstr "Створити запакований архів обʼєктів"
+
+msgid "Find redundant pack files"
+msgstr "Знайти зайві файли пакунків"
+
+msgid "Pack heads and tags for efficient repository access"
+msgstr "Запакувати верхівки та теги Ð´Ð»Ñ ÐµÑ„ÐµÐºÑ‚Ð¸Ð²Ð½Ð¾Ð³Ð¾ доÑтупу до Ñховища"
+
+msgid "Compute unique ID for a patch"
+msgstr "ОбчиÑлити унікальний ідентифікатор Ð´Ð»Ñ Ð¿Ð°Ñ‚Ñ‡Ñƒ"
+
+msgid "Prune all unreachable objects from the object database"
+msgstr "Видалити вÑÑ– недоÑÑжні обʼєкти з бази даних обʼєктів"
+
+msgid "Remove extra objects that are already in pack files"
+msgstr "Видалити зайві обʼєкти, Ñкі вже Ñ” у файлах пакунків"
+
+msgid "Fetch from and integrate with another repository or a local branch"
+msgstr "Отримати та інтегрувати з іншим Ñховищем або локальною гілкою"
+
+msgid "Update remote refs along with associated objects"
+msgstr "Оновити віддалені поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ñ€Ð°Ð·Ð¾Ð¼ з аÑоційованими обʼєктами"
+
+msgid "Applies a quilt patchset onto the current branch"
+msgstr "ЗаÑтоÑовує набір латок до поточної гілки"
+
+msgid "Compare two commit ranges (e.g. two versions of a branch)"
+msgstr "ПорівнÑти два діапазони комітів (наприклад, дві верÑÑ–Ñ— гілки)"
+
+msgid "Reads tree information into the index"
+msgstr "Зчитує інформацію про дерево в індекÑ"
+
+msgid "Reapply commits on top of another base tip"
+msgstr "ЗаÑтоÑувати коміти поверх іншої верхівки бази"
+
+msgid "Receive what is pushed into the repository"
+msgstr "Отримати те, що надÑилаєтьÑÑ Ð´Ð¾ Ñховища"
+
+msgid "Manage reflog information"
+msgstr "ÐšÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ”ÑŽ журналу поÑилань"
+
+msgid "Manage set of tracked repositories"
+msgstr "Керувати набором відÑтежуваних Ñховищ"
+
+msgid "Pack unpacked objects in a repository"
+msgstr "Запакувати розпаковані обʼєкти у Ñховищі"
+
+msgid "Create, list, delete refs to replace objects"
+msgstr "Створити, показати, видалити поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð´Ð»Ñ Ð¾Ð±â€™Ñ”ÐºÑ‚Ñ–Ð² заміни"
+
+msgid "EXPERIMENTAL: Replay commits on a new base, works with bare repos too"
+msgstr ""
+"ЕКСПЕРИМЕÐТÐЛЬÐО: Ð’Ñ–Ð´Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ ÐºÐ¾Ð¼Ð¼Ñ–Ñ‚Ñ–Ð² на новій базі також працює з "
+"порожніми Ñховищами"
+
+msgid "Generates a summary of pending changes"
+msgstr "Створює підÑумок змін Ð´Ð»Ñ Ñ€Ð¾Ð·Ð³Ð»Ñду"
+
+msgid "Reuse recorded resolution of conflicted merges"
+msgstr "ВикориÑтати повторно запиÑане розв’ÑÐ·Ð°Ð½Ð½Ñ ÐºÐ¾Ð½Ñ„Ð»Ñ–ÐºÑ‚Ð½Ð¸Ñ… злиттів"
+
+msgid "Reset current HEAD to the specified state"
+msgstr "Скинути поточний HEAD до вказаного Ñтану"
+
+msgid "Restore working tree files"
+msgstr "Відновити файли робочого дерева"
+
+msgid "Lists commit objects in reverse chronological order"
+msgstr "Показувати обʼєкти коміту у зворотному хронологічному порÑдку"
+
+msgid "Pick out and massage parameters"
+msgstr "Ð’Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ‚Ð° обробка параметрів"
+
+msgid "Revert some existing commits"
+msgstr "Вивернути деÑкі Ñ–Ñнуючі коміти"
+
+msgid "Remove files from the working tree and from the index"
+msgstr "Видалити файли з робочого дерева та з індекÑу"
+
+msgid "Send a collection of patches as emails"
+msgstr "ÐадіÑлати колекцію латок у виглÑді електронних лиÑтів"
+
+msgid "Push objects over Git protocol to another repository"
+msgstr "ÐадіÑлати обʼєкти за протоколом Git до іншого Ñховища"
+
+msgid "Git's i18n setup code for shell scripts"
+msgstr "Код Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ i18n у Git Ð´Ð»Ñ Ñкриптів оболонки"
+
+msgid "Common Git shell script setup code"
+msgstr "Загальний код Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ñкриптів оболонки Git"
+
+msgid "Restricted login shell for Git-only SSH access"
+msgstr "Обмежений логін оболонки Ð´Ð»Ñ Ð´Ð¾Ñтупу по SSH лише Ð´Ð»Ñ Git"
+
+msgid "Summarize 'git log' output"
+msgstr "ПідÑумувати вивід \"git log\""
+
+msgid "Show various types of objects"
+msgstr "Показати різні типи об’єктів"
+
+msgid "Show branches and their commits"
+msgstr "Показати гілки та їхні коміти"
+
+msgid "Show packed archive index"
+msgstr "Показати Ñ–Ð½Ð´ÐµÐºÑ Ð·Ð°Ð¿Ð°ÐºÐ¾Ð²Ð°Ð½Ð¾Ð³Ð¾ архіву"
+
+msgid "List references in a local repository"
+msgstr "Показати поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ñƒ локальному Ñховищі"
+
+msgid "Reduce your working tree to a subset of tracked files"
+msgstr "Скоротити робоче дерево до підмножини відÑтежуваних файлів"
+
+msgid "Add file contents to the staging area"
+msgstr "Додати вміÑÑ‚ файлу до облаÑÑ‚Ñ– індекÑації"
+
+msgid "Stash the changes in a dirty working directory away"
+msgstr "ПеренеÑти зміни в брудній робочій директорії до Ñхову"
+
+msgid "Show the working tree status"
+msgstr "Показати Ñтан робочого дерева"
+
+msgid "Remove unnecessary whitespace"
+msgstr "Видалити зайві пробіли"
+
+msgid "Initialize, update or inspect submodules"
+msgstr "Ініціалізувати, оновити або перевірити підмодулі"
+
+msgid "Bidirectional operation between a Subversion repository and Git"
+msgstr "Двонаправлена Ð¾Ð¿ÐµÑ€Ð°Ñ†Ñ–Ñ Ð¼Ñ–Ð¶ Subversion Ñховищем та Git"
+
+msgid "Switch branches"
+msgstr "Переключити гілки"
+
+msgid "Read, modify and delete symbolic refs"
+msgstr "Прочитати, змінити та видалити Ñимвольні поÑиланнÑ"
+
+msgid "Create, list, delete or verify a tag object signed with GPG"
+msgstr ""
+"Створити, показати, видалити або перевірити обʼєкт тегу, підпиÑаний GPG"
+
+msgid "Creates a temporary file with a blob's contents"
+msgstr "Створює тимчаÑовий файл із вміÑтом blob"
+
+msgid "Unpack objects from a packed archive"
+msgstr "Розпакувати обʼєкти із запакованого архіву"
+
+msgid "Register file contents in the working tree to the index"
+msgstr "ЗареєÑтрувати вміÑÑ‚ файлу робочого дерева в індекÑÑ–"
+
+msgid "Update the object name stored in a ref safely"
+msgstr "Безпечно оновити назву обʼєкта, що зберігаєтьÑÑ Ð² поÑиланні"
+
+msgid "Update auxiliary info file to help dumb servers"
+msgstr "Оновити додатковий інформаційний файл Ð´Ð»Ñ Ð´Ð¾Ð¿Ð¾Ð¼Ð¾Ð³Ð¸ \"тупим\" Ñерверам"
+
+msgid "Send archive back to git-archive"
+msgstr "ÐадіÑлати архів назад до git-archive"
+
+msgid "Send objects packed back to git-fetch-pack"
+msgstr "ÐадіÑлати запаковані обʼєкти назад до git-fetch-pack"
+
+msgid "Show a Git logical variable"
+msgstr "Показати логічну змінну Git"
+
+msgid "Check the GPG signature of commits"
+msgstr "Перевірити GPG-Ð¿Ñ–Ð´Ð¿Ð¸Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñ–Ð²"
+
+msgid "Validate packed Git archive files"
+msgstr "Перевірити запаковані файли Git архіву"
+
+msgid "Check the GPG signature of tags"
+msgstr "Перевірити GPG-Ð¿Ñ–Ð´Ð¿Ð¸Ñ Ñ‚ÐµÐ³Ñ–Ð²"
+
+msgid "Display version information about Git"
+msgstr "Показати інформацію про верÑÑ–ÑŽ Git"
+
+msgid "Show logs with differences each commit introduces"
+msgstr "Показати журнал з різницÑми, Ñкі вноÑить кожен коміт"
+
+msgid "Manage multiple working trees"
+msgstr "Керувати кількома робочими деревами"
+
+msgid "Create a tree object from the current index"
+msgstr "Створити обʼєкт дерева з поточного індекÑу"
+
+msgid "Defining attributes per path"
+msgstr "Ð’Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð°Ñ‚Ñ€Ð¸Ð±ÑƒÑ‚Ñ–Ð² Ð´Ð»Ñ ÐºÐ¾Ð¶Ð½Ð¾Ð³Ð¾ шлÑху"
+
+msgid "Git command-line interface and conventions"
+msgstr "Ð†Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ñ‚Ð° конвенції командного Ñ€Ñдка Git"
+
+msgid "A Git core tutorial for developers"
+msgstr "ІнÑÑ‚Ñ€ÑƒÐºÑ†Ñ–Ñ Ð¿Ð¾ Ñдру Git Ð´Ð»Ñ Ñ€Ð¾Ð·Ñ€Ð¾Ð±Ð½Ð¸ÐºÑ–Ð²"
+
+msgid "Providing usernames and passwords to Git"
+msgstr "ÐÐ°Ð´Ð°Ð½Ð½Ñ Ñ–Ð¼ÐµÐ½ кориÑтувачів та паролів до Git"
+
+msgid "Git for CVS users"
+msgstr "Git Ð´Ð»Ñ ÐºÐ¾Ñ€Ð¸Ñтувачів CVS"
+
+msgid "Tweaking diff output"
+msgstr "ÐÐ°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¸Ð²Ð¾Ð´Ñƒ різниці"
+
+msgid "A useful minimum set of commands for Everyday Git"
+msgstr "КориÑний мінімальний набір команд Ð´Ð»Ñ Ð¿Ð¾Ð²ÑÑкденного викориÑÑ‚Ð°Ð½Ð½Ñ Git"
+
+msgid "Frequently asked questions about using Git"
+msgstr "Поширені Ð·Ð°Ð¿Ð¸Ñ‚Ð°Ð½Ð½Ñ Ð¿Ñ€Ð¾ викориÑÑ‚Ð°Ð½Ð½Ñ Git"
+
+msgid "The bundle file format"
+msgstr "Формат файлу пакунка"
+
+msgid "Chunk-based file formats"
+msgstr "Файлові формати на оÑнові шматків"
+
+msgid "Git commit-graph format"
+msgstr "Формат Git коміт-графа"
+
+msgid "Git index format"
+msgstr "Формат Git індекÑа"
+
+msgid "Git pack format"
+msgstr "Формат Git пакунка"
+
+msgid "Git cryptographic signature formats"
+msgstr "Формати криптографічного підпиÑу Git"
+
+msgid "A Git Glossary"
+msgstr "Git Ñловник"
+
+msgid "Hooks used by Git"
+msgstr "Гачки, що викориÑтовує Git"
+
+msgid "Specifies intentionally untracked files to ignore"
+msgstr "Вказує навмиÑно невідÑтежувані файли Ð´Ð»Ñ Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ"
+
+msgid "The Git repository browser"
+msgstr "Браузер Ñховища Git"
+
+msgid "Map author/committer names and/or E-Mail addresses"
+msgstr "Зробити мапу імен авторів/комітерів та/або Ð°Ð´Ñ€ÐµÑ ÐµÐ»ÐµÐºÑ‚Ñ€Ð¾Ð½Ð½Ð¾Ñ— пошти"
+
+msgid "Defining submodule properties"
+msgstr "Ð’Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð»Ð°ÑтивоÑтей підмодулів"
+
+msgid "Git namespaces"
+msgstr "ПроÑтори імен Git"
+
+msgid "Protocol v0 and v1 capabilities"
+msgstr "ЗдібноÑÑ‚Ñ– протоколів v0 та v1"
+
+msgid "Things common to various protocols"
+msgstr "Спільні риÑи різних протоколів"
+
+msgid "Git HTTP-based protocols"
+msgstr "Git протоколи на оÑнові HTTP"
+
+msgid "How packs are transferred over-the-wire"
+msgstr "Як пакунки передаютьÑÑ Ð¿Ð¾ дроту"
+
+msgid "Git Wire Protocol, Version 2"
+msgstr "Протокол Git Wire, верÑÑ–Ñ 2"
+
+msgid "Helper programs to interact with remote repositories"
+msgstr "Програми-помічники Ð´Ð»Ñ Ð²Ð·Ð°Ñ”Ð¼Ð¾Ð´Ñ–Ñ— з віддаленими Ñховищами"
+
+msgid "Git Repository Layout"
+msgstr "Схема Git Ñховища"
+
+msgid "Specifying revisions and ranges for Git"
+msgstr "Ð’Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ€ÐµÐ²Ñ–Ð·Ñ–Ð¹ та діапазонів Ð´Ð»Ñ Git"
+
+msgid "Mounting one repository inside another"
+msgstr "ÐœÐ¾Ð½Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¾Ð´Ð½Ð¾Ð³Ð¾ Ñховища вÑередині іншого"
+
+msgid "A tutorial introduction to Git"
+msgstr "Ðавчальний вÑтуп до Git"
+
+msgid "A tutorial introduction to Git: part two"
+msgstr "Ðавчальний вÑтуп до Git: чаÑтина друга"
+
+msgid "Git web interface (web frontend to Git repositories)"
+msgstr "Веб-Ñ–Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Git (веб-фронтенд до Ñховищ Git)"
+
+msgid "An overview of recommended workflows with Git"
+msgstr "ОглÑд рекомендованих робочих процеÑів з Git"
+
+msgid "A tool for managing large Git repositories"
+msgstr "ІнÑтрумент Ð´Ð»Ñ ÐºÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð²ÐµÐ»Ð¸ÐºÐ¸Ð¼Ð¸ Ñховищами Git"
+
+msgid "commit-graph file is too small"
+msgstr "файл коміт-графа занадто малий"
+
+msgid "commit-graph oid fanout chunk is wrong size"
+msgstr "шматок oid fanout коміт-графа має невірний розмір"
+
+msgid "commit-graph fanout values out of order"
+msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ fanout коміт-графа впорÑдковані невірно"
+
+msgid "commit-graph OID lookup chunk is the wrong size"
+msgstr "шматок OID lookup коміт-графа має невірний розмір"
+
+msgid "commit-graph commit data chunk is wrong size"
+msgstr "шматок commit data коміт-графа має невірний розмір"
+
+msgid "commit-graph generations chunk is wrong size"
+msgstr "шматок generations коміт-графа має невірний розмір"
+
+msgid "commit-graph changed-path index chunk is too small"
+msgstr "шматок changed-path index коміт-графа має невірний розмір"
+
+#, c-format
+msgid ""
+"ignoring too-small changed-path chunk (%<PRIuMAX> < %<PRIuMAX>) in commit-"
+"graph file"
+msgstr ""
+"Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð°Ð½Ð°Ð´Ñ‚Ð¾ малого шматка changed-path (%<PRIuMAX> < %<PRIuMAX>) "
+"файла коміт-графа"
+
+#, c-format
+msgid "commit-graph signature %X does not match signature %X"
+msgstr "Ð¿Ñ–Ð´Ð¿Ð¸Ñ ÐºÐ¾Ð¼Ñ–Ñ‚-графа %X не збігаєтьÑÑ Ð· підпиÑом %X"
+
+#, c-format
+msgid "commit-graph version %X does not match version %X"
+msgstr "верÑÑ–Ñ ÐºÐ¾Ð¼Ñ–Ñ‚-графа %X не збігаєтьÑÑ Ð· верÑією %X"
+
+#, c-format
+msgid "commit-graph hash version %X does not match version %X"
+msgstr "хеш верÑÑ–Ñ ÐºÐ¾Ð¼Ñ–Ñ‚-графа %X не збігаєтьÑÑ Ð· верÑією %X"
+
+#, c-format
+msgid "commit-graph file is too small to hold %u chunks"
+msgstr "файл коміт-графа занадто малий, щоб вміÑтити %u шматків"
+
+msgid "commit-graph required OID fanout chunk missing or corrupted"
+msgstr "необхідний шматок OID fanout коміт-графа відÑутній або пошкоджений"
+
+msgid "commit-graph required OID lookup chunk missing or corrupted"
+msgstr "необхідний шматок OID lookup коміт-графа відÑутній або пошкоджений"
+
+msgid "commit-graph required commit data chunk missing or corrupted"
+msgstr "необхідний шматок commit data коміт-графа відÑутній або пошкоджений"
+
+msgid "commit-graph has no base graphs chunk"
+msgstr "коміт-граф не має шматка базових графів"
+
+msgid "commit-graph base graphs chunk is too small"
+msgstr "шматок base graphs коміт-графа занадто малий"
+
+msgid "commit-graph chain does not match"
+msgstr "ланцюжок коміт-графа не Ñпівпадає"
+
+#, c-format
+msgid "commit count in base graph too high: %<PRIuMAX>"
+msgstr "кількіÑÑ‚ÑŒ комітів у базовому графі занадто велика: %<PRIuMAX>"
+
+msgid "commit-graph chain file too small"
+msgstr "файл ланцюжка коміт-графа занадто малий"
+
+#, c-format
+msgid "invalid commit-graph chain: line '%s' not a hash"
+msgstr "неприпуÑтимий ланцюжок коміт-графа: Ñ€Ñдок \"%s\" не Ñ” хешем"
+
+msgid "unable to find all commit-graph files"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ вÑÑ– файли коміт-графа"
+
+msgid "invalid commit position. commit-graph is likely corrupt"
+msgstr "неприпуÑтима Ð¿Ð¾Ð·Ð¸Ñ†Ñ–Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ, ймовірно, коміт-граф пошкоджено"
+
+#, c-format
+msgid "could not find commit %s"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ коміт %s"
+
+msgid "commit-graph requires overflow generation data but has none"
+msgstr "коміт-граф потребує даних генерації переповненнÑ, але не має Ñ—Ñ…"
+
+msgid "commit-graph overflow generation data is too small"
+msgstr "занадто мало даних генерації Ð¿ÐµÑ€ÐµÐ¿Ð¾Ð²Ð½ÐµÐ½Ð½Ñ ÐºÐ¾Ð¼Ñ–Ñ‚-графа"
+
+msgid "commit-graph extra-edges pointer out of bounds"
+msgstr "extra-edges pointer коміт-графа виходить за межі"
+
+msgid "Loading known commits in commit graph"
+msgstr "Ð—Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ Ð²Ñ–Ð´Ð¾Ð¼Ð¸Ñ… комітів у коміт-графі"
+
+msgid "Expanding reachable commits in commit graph"
+msgstr "Ð Ð¾Ð·ÑˆÐ¸Ñ€ÐµÐ½Ð½Ñ Ð´Ð¾ÑÑжних комітів у коміт-графі"
+
+msgid "Clearing commit marks in commit graph"
+msgstr "ÐžÑ‡Ð¸Ñ‰ÐµÐ½Ð½Ñ Ð¿Ð¾Ð·Ð½Ð°Ñ‡Ð¾Ðº комітів у коміт-графі"
+
+msgid "Computing commit graph topological levels"
+msgstr "ОбчиÑÐ»ÐµÐ½Ð½Ñ Ñ‚Ð¾Ð¿Ð¾Ð»Ð¾Ð³Ñ–Ñ‡Ð½Ð¸Ñ… рівнів коміт-графа"
+
+msgid "Computing commit graph generation numbers"
+msgstr "ОбчиÑÐ»ÐµÐ½Ð½Ñ Ð½Ð¾Ð¼ÐµÑ€Ñ–Ð² генерації коміт-графа"
+
+msgid "Computing commit changed paths Bloom filters"
+msgstr "ОбчиÑÐ»ÐµÐ½Ð½Ñ Ñ„Ñ–Ð»ÑŒÑ‚Ñ€Ñ–Ð² Блума Ð´Ð»Ñ ÑˆÐ»Ñхів, змінених комітом"
+
+msgid "Collecting referenced commits"
+msgstr "Збір поÑилань на коміти"
+
+#, c-format
+msgid "Finding commits for commit graph in %<PRIuMAX> pack"
+msgid_plural "Finding commits for commit graph in %<PRIuMAX> packs"
+msgstr[0] "Пошук комітів Ð´Ð»Ñ ÐºÐ¾Ð¼Ñ–Ñ‚-графа у %<PRIuMAX> пакунку"
+msgstr[1] "Пошук комітів Ð´Ð»Ñ ÐºÐ¾Ð¼Ñ–Ñ‚-графа у %<PRIuMAX> пакунках"
+msgstr[2] "Пошук комітів Ð´Ð»Ñ ÐºÐ¾Ð¼Ñ–Ñ‚-графа у %<PRIuMAX> пакунках"
+
+#, c-format
+msgid "error adding pack %s"
+msgstr "помилка Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð¿Ð°ÐºÐµÑ‚Ñƒ %s"
+
+#, c-format
+msgid "error opening index for %s"
+msgstr "помилка Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ñ‚Ñ Ñ–Ð½Ð´ÐµÐºÑу Ð´Ð»Ñ %s"
+
+msgid "Finding commits for commit graph among packed objects"
+msgstr "Пошук комітів Ð´Ð»Ñ ÐºÐ¾Ð¼Ñ–Ñ‚-графа Ñеред запакованих обʼєктів"
+
+msgid "Finding extra edges in commit graph"
+msgstr "Пошук додаткових ребер у коміт-графі"
+
+msgid "failed to write correct number of base graph ids"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати правильну кількіÑÑ‚ÑŒ ідентифікаторів базових графів"
+
+msgid "unable to create temporary graph layer"
+msgstr "не вдалоÑÑ Ñтворити тимчаÑовий шар графа"
+
+#, c-format
+msgid "unable to adjust shared permissions for '%s'"
+msgstr "не вдалоÑÑ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ñ‚Ð¸ Ñпільні дозволи Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "Writing out commit graph in %d pass"
+msgid_plural "Writing out commit graph in %d passes"
+msgstr[0] "Ð’Ð¸Ð²ÐµÐ´ÐµÐ½Ð½Ñ ÐºÐ¾Ð¼Ñ–Ñ‚-графа за %d прохід"
+msgstr[1] "Ð’Ð¸Ð²ÐµÐ´ÐµÐ½Ð½Ñ ÐºÐ¾Ð¼Ñ–Ñ‚-графа за %d проходи"
+msgstr[2] "Ð’Ð¸Ð²ÐµÐ´ÐµÐ½Ð½Ñ ÐºÐ¾Ð¼Ñ–Ñ‚-графа за %d проходів"
+
+msgid "unable to open commit-graph chain file"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ ланцюжковий файл коміт-графа"
+
+msgid "failed to rename base commit-graph file"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ñ‚Ð¸ базовий файл коміт-графа"
+
+msgid "failed to rename temporary commit-graph file"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ñ‚Ð¸ тимчаÑовий файл коміт-графа"
+
+#, c-format
+msgid "cannot merge graphs with %<PRIuMAX>, %<PRIuMAX> commits"
+msgstr "неможливо обʼєднати графи з %<PRIuMAX>, %<PRIuMAX> комітів"
+
+#, c-format
+msgid "cannot merge graph %s, too many commits: %<PRIuMAX>"
+msgstr "неможливо обʼєднати граф %s, занадто багато комітів: %<PRIuMAX>"
+
+msgid "Scanning merged commits"
+msgstr "Ð¡ÐºÐ°Ð½ÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð»Ð¸Ñ‚Ð¸Ñ… комітів"
+
+msgid "Merging commit-graph"
+msgstr "Ð—Ð»Ð¸Ñ‚Ñ‚Ñ ÐºÐ¾Ð¼Ñ–Ñ‚-графа"
+
+msgid "attempting to write a commit-graph, but 'core.commitGraph' is disabled"
+msgstr "Ñпроба запиÑати коміт-граф, але \"core.commitGraph\" відключено"
+
+msgid "too many commits to write graph"
+msgstr "занадто багато комітів, щоб запиÑати граф"
+
+msgid "the commit-graph file has incorrect checksum and is likely corrupt"
+msgstr "файл коміт-графа має невірну контрольну Ñуму Ñ–, ймовірно, пошкоджений"
+
+#, c-format
+msgid "commit-graph has incorrect OID order: %s then %s"
+msgstr "коміт-граф має невірну OID поÑлідовніÑÑ‚ÑŒ: %s потім %s"
+
+#, c-format
+msgid "commit-graph has incorrect fanout value: fanout[%d] = %u != %u"
+msgstr "коміт-граф має невірне fanout значеннÑ: fanout[%d] = %u != %u"
+
+#, c-format
+msgid "failed to parse commit %s from commit-graph"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ коміт %s з графа комітв"
+
+#, c-format
+msgid "failed to parse commit %s from object database for commit-graph"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ коміт %s з бази даних обʼєктів Ð´Ð»Ñ ÐºÐ¾Ð¼Ñ–Ñ‚-графа"
+
+#, c-format
+msgid "root tree OID for commit %s in commit-graph is %s != %s"
+msgstr "OID кореневого дерева Ð´Ð»Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ %s у коміт-графі Ñ” %s != %s"
+
+#, c-format
+msgid "commit-graph parent list for commit %s is too long"
+msgstr "ÑпиÑок батьків Ð´Ð»Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ %s коміт-графа занадто довгий"
+
+#, c-format
+msgid "commit-graph parent for %s is %s != %s"
+msgstr "батько Ð´Ð»Ñ %s коміт-графа Ñ” %s != %s"
+
+#, c-format
+msgid "commit-graph parent list for commit %s terminates early"
+msgstr "ÑпиÑок батьків коміт-графа Ð´Ð»Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ %s завершивÑÑ Ð¿ÐµÑ€ÐµÐ´Ñ‡Ð°Ñно"
+
+#, c-format
+msgid "commit-graph generation for commit %s is %<PRIuMAX> < %<PRIuMAX>"
+msgstr "Ð³ÐµÐ½ÐµÑ€Ð°Ñ†Ñ–Ñ ÐºÐ¾Ð¼Ñ–Ñ‚-графа Ð´Ð»Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ %s Ñ” %<PRIuMAX> < %<PRIuMAX>"
+
+#, c-format
+msgid "commit date for commit %s in commit-graph is %<PRIuMAX> != %<PRIuMAX>"
+msgstr "дата коміту Ð´Ð»Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ %s у коміт-графі Ñ” %<PRIuMAX> != %<PRIuMAX>"
+
+#, c-format
+msgid ""
+"commit-graph has both zero and non-zero generations (e.g., commits '%s' and "
+"'%s')"
+msgstr ""
+"коміт-граф має Ñк нульові, так Ñ– ненульові генерації (наприклад, коміти "
+"\"%s\" Ñ– \"%s\")"
+
+msgid "Verifying commits in commit graph"
+msgstr "Перевірка комітів у коміт-графі"
+
+#, c-format
+msgid "%s %s is not a commit!"
+msgstr "%s %s не є комітом!"
+
+msgid ""
+"Support for <GIT_DIR>/info/grafts is deprecated\n"
+"and will be removed in a future Git version.\n"
+"\n"
+"Please use \"git replace --convert-graft-file\"\n"
+"to convert the grafts into replace refs.\n"
+"\n"
+"Turn this message off by running\n"
+"\"git config advice.graftFileDeprecated false\""
+msgstr ""
+"Підтримка <GIT_DIR>/info/grafts заÑтаріла\n"
+"Ñ– буде вилучена в одній з наÑтупних верÑій Git.\n"
+"\n"
+"Будь лаÑка, ÑкориÑтайтеÑÑŒ \"git replace --convert-graft-file\"\n"
+"щоб перетворити щепи на заміни поÑилань.\n"
+"\n"
+"Щоб вимкнути це повідомленнÑ, виконайте\n"
+"\"git config advice.graftFileDeprecated false\""
+
+#, c-format
+msgid "commit %s exists in commit-graph but not in the object database"
+msgstr "коміт %s Ñ–Ñнує в коміт-графі, але не в базі даних обʼєктів"
+
+#, c-format
+msgid "Commit %s has an untrusted GPG signature, allegedly by %s."
+msgstr "Коміт %s має недоÑтовірний GPG-підпиÑ, нібито від %s."
+
+#, c-format
+msgid "Commit %s has a bad GPG signature allegedly by %s."
+msgstr "Коміт %s має невірний GPG-підпиÑ, нібито від %s."
+
+#, c-format
+msgid "Commit %s does not have a GPG signature."
+msgstr "Коміт %s не має GPG підпиÑу."
+
+#, c-format
+msgid "Commit %s has a good GPG signature by %s\n"
+msgstr "Коміт %s має добрий GPG-Ð¿Ñ–Ð´Ð¿Ð¸Ñ Ð²Ñ–Ð´ %s\n"
+
+msgid ""
+"Warning: commit message did not conform to UTF-8.\n"
+"You may want to amend it after fixing the message, or set the config\n"
+"variable i18n.commitEncoding to the encoding your project uses.\n"
+msgstr ""
+"ПопередженнÑ: Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту не відповідає кодуванню UTF-8.\n"
+"Можливо, ви захочете змінити його піÑÐ»Ñ Ð²Ð¸Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð´Ð¾Ð¿Ð¸Ñу, або вÑтановити "
+"змінну конфігурації\n"
+"i18n.commitEncoding у кодуваннÑ, Ñке викориÑтовуєтьÑÑ Ñƒ вашому проекті.\n"
+
+msgid "no compiler information available\n"
+msgstr "немає інформації про компілÑтор\n"
+
+msgid "no libc information available\n"
+msgstr "немає інформації про libc\n"
+
+#, c-format
+msgid "could not determine free disk size for '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ вільний розмір диÑка Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "could not get info for '%s'"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ інформацію Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "[GLE %ld] health thread could not open '%ls'"
+msgstr "[GLE %ld] потік Ñтану не зміг відкрити \"%ls\""
+
+#, c-format
+msgid "[GLE %ld] health thread getting BHFI for '%ls'"
+msgstr "[GLE %ld] потік Ñтану отримує BHFI Ð´Ð»Ñ \"%ls\""
+
+#, c-format
+msgid "could not convert to wide characters: '%s'"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€Ð¸Ñ‚Ð¸ в широкі Ñимволи: \"%s\""
+
+#, c-format
+msgid "BHFI changed '%ls'"
+msgstr "BHFI змінено \"%ls\""
+
+#, c-format
+msgid "unhandled case in 'has_worktree_moved': %d"
+msgstr "необроблений випадок у \"has_worktree_moved\": %d"
+
+#, c-format
+msgid "health thread wait failed [GLE %ld]"
+msgstr "Ð¾Ñ‡Ñ–ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð¾Ñ‚Ð¾ÐºÑƒ Ñтану завершилоÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾ [GLE %ld]"
+
+#, c-format
+msgid "Invalid path: %s"
+msgstr "ÐеприпуÑтимий шлÑÑ…: %s"
+
+msgid "Unable to create FSEventStream."
+msgstr "Ðе вдалоÑÑ Ñтворити FSEventStream."
+
+msgid "Failed to start the FSEventStream"
+msgstr "Ðе вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити потік FSEventStream"
+
+#, c-format
+msgid "[GLE %ld] could not convert path to UTF-8: '%.*ls'"
+msgstr "[GLE %ld] не вдалоÑÑ ÐºÐ¾Ð½Ð²ÐµÑ€Ñ‚ÑƒÐ²Ð°Ñ‚Ð¸ шлÑÑ… у UTF-8: \"%.*ls\""
+
+#, c-format
+msgid "[GLE %ld] could not watch '%s'"
+msgstr "[GLE %ld] ÑÑ‚ÐµÐ¶ÐµÐ½Ð½Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ð»Ð¾ÑÑŒ невдало \"%s\""
+
+#, c-format
+msgid "[GLE %ld] could not get longname of '%s'"
+msgstr "[GLE %ld] не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ довгу назву \"%s\""
+
+#, c-format
+msgid "ReadDirectoryChangedW failed on '%s' [GLE %ld]"
+msgstr "ReadDirectoryChangedW завершилоÑÑŒ невдало на \"%s\" [GLE %ld]"
+
+#, c-format
+msgid "GetOverlappedResult failed on '%s' [GLE %ld]"
+msgstr "GetOverlappedResult завершилоÑÑŒ невдало на \"%s\" [GLE %ld]"
+
+#, c-format
+msgid "could not read directory changes [GLE %ld]"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ зміни директорії [GLE %ld]"
+
+#, c-format
+msgid "opendir('%s') failed"
+msgstr "opendir(\"%s\") завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "lstat('%s') failed"
+msgstr "lstat(\"%s\") завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "strbuf_readlink('%s') failed"
+msgstr "strbuf_readlink(\"%s\") завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "closedir('%s') failed"
+msgstr "closedir(\"%s\") завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "[GLE %ld] unable to open for read '%ls'"
+msgstr "[GLE %ld] не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ \"%ls\""
+
+#, c-format
+msgid "[GLE %ld] unable to get protocol information for '%ls'"
+msgstr "[GLE %ld] не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ інформацію про протокол Ð´Ð»Ñ \"%ls\""
+
+#, c-format
+msgid "failed to copy SID (%ld)"
+msgstr "не вдалоÑÑ Ñкопіювати SID (%ld)"
+
+#, c-format
+msgid "failed to get owner for '%s' (%ld)"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ влаÑника Ð´Ð»Ñ \"%s\" (%ld)"
+
+msgid "memory exhausted"
+msgstr "памʼÑÑ‚ÑŒ вичерпано"
+
+msgid "Success"
+msgstr "УÑпіх"
+
+msgid "No match"
+msgstr "Ðемає збігів"
+
+msgid "Invalid regular expression"
+msgstr "ÐеприпуÑтимий регулÑрний вираз"
+
+msgid "Invalid collation character"
+msgstr "ÐеприпуÑтимий Ñимвол зведеннÑ"
+
+msgid "Invalid character class name"
+msgstr "ÐеприпуÑтима назва клаÑу Ñимволів"
+
+msgid "Trailing backslash"
+msgstr "Кінцева зворотна коÑа риÑка"
+
+msgid "Invalid back reference"
+msgstr "ÐеприпуÑтиме зворотнє поÑиланнÑ"
+
+msgid "Unmatched [ or [^"
+msgstr "Ðепарна [ або [^"
+
+msgid "Unmatched ( or \\("
+msgstr "Ðепарна ( або \\("
+
+msgid "Unmatched \\{"
+msgstr "Ðепарна \\{"
+
+msgid "Invalid content of \\{\\}"
+msgstr "ÐеприпуÑтимий вміÑÑ‚ Ð´Ð»Ñ \\{\\}"
+
+msgid "Invalid range end"
+msgstr "ÐеприпуÑтимий кінець діапазону"
+
+msgid "Memory exhausted"
+msgstr "ПамʼÑÑ‚ÑŒ вичерпано"
+
+msgid "Invalid preceding regular expression"
+msgstr "ÐеприпуÑтимий попередній регулÑрний вираз"
+
+msgid "Premature end of regular expression"
+msgstr "ПередчаÑне Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð½Ñ Ñ€ÐµÐ³ÑƒÐ»Ñрного виразу"
+
+msgid "Regular expression too big"
+msgstr "Занадто великий регулÑрний вираз"
+
+msgid "Unmatched ) or \\)"
+msgstr "Ðепарна ) або \\)"
+
+msgid "No previous regular expression"
+msgstr "Ðемає попереднього регулÑрного виразу"
+
+msgid "could not send IPC command"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´Ð¿Ñ€Ð°Ð²Ð¸Ñ‚Ð¸ IPC команду"
+
+msgid "could not read IPC response"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ IPC відповідь"
+
+#, c-format
+msgid "could not start accept_thread '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ð¾Ñ‡Ð°Ñ‚Ð¸ accept_thread \"%s\""
+
+#, c-format
+msgid "could not start worker[0] for '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити worker[0] Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "ConnectNamedPipe failed for '%s' (%lu)"
+msgstr "ConnectNamedPipe завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾ Ð´Ð»Ñ \"%s\" (%lu)"
+
+#, c-format
+msgid "could not create fd from pipe for '%s'"
+msgstr "не вдалоÑÑ Ñтворити fd з каналу Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "could not start thread[0] for '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити thread[0] Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "wait for hEvent failed for '%s'"
+msgstr "Ð¾Ñ‡Ñ–ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð° hEvent не вдалоÑÑ Ð´Ð»Ñ \"%s\""
+
+msgid "cannot resume in the background, please use 'fg' to resume"
+msgstr ""
+"неможливо поновити роботу у фоновому режимі; будь лаÑка, ÑкориÑтайтеÑÑŒ "
+"\"fg\" Ð´Ð»Ñ Ð¿Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ"
+
+msgid "cannot restore terminal settings"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ñ‚ÐµÑ€Ð¼Ñ–Ð½Ð°Ð»Ð°"
+
+#, c-format
+msgid ""
+"exceeded maximum include depth (%d) while including\n"
+"\t%s\n"
+"from\n"
+"\t%s\n"
+"This might be due to circular includes."
+msgstr ""
+"перевищено макÑимальну глибину (%d) під Ñ‡Ð°Ñ Ð²ÐºÐ»ÑŽÑ‡ÐµÐ½Ð½Ñ\n"
+"\t%s\n"
+"від\n"
+"\t%s\n"
+"Це може бути повʼÑзано з циклічним включеннÑм."
+
+#, c-format
+msgid "could not expand include path '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ include path \"%s\""
+
+msgid "relative config includes must come from files"
+msgstr "відноÑні конфігураційні Ð²ÐºÐ»ÑŽÑ‡ÐµÐ½Ð½Ñ Ð¼Ð°ÑŽÑ‚ÑŒ надходити з файлів"
+
+msgid "relative config include conditionals must come from files"
+msgstr ""
+"відноÑні умовні Ð¿Ð¾Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ð¹Ð½Ð¸Ñ… включень мають надходити з файлів"
+
+msgid ""
+"remote URLs cannot be configured in file directly or indirectly included by "
+"includeIf.hasconfig:remote.*.url"
+msgstr ""
+"віддалені URL-адреÑи не можуть бути налаштовані у файлі, прÑмо чи "
+"опоÑередковано включеному за допомогою includeIf.hasconfig:remote.*.url"
+
+#, c-format
+msgid "invalid config format: %s"
+msgstr "неприпуÑтимий формат конфігурації: %s"
+
+#, c-format
+msgid "missing environment variable name for configuration '%.*s'"
+msgstr "відÑÑƒÑ‚Ð½Ñ Ð½Ð°Ð·Ð²Ð° змінної Ð¾Ñ‚Ð¾Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ— \"%.*s\""
+
+#, c-format
+msgid "missing environment variable '%s' for configuration '%.*s'"
+msgstr "відÑÑƒÑ‚Ð½Ñ Ð·Ð¼Ñ–Ð½Ð½Ð° Ð¾Ñ‚Ð¾Ñ‡ÐµÐ½Ð½Ñ \"%s\" Ð´Ð»Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ— \"%.*s\""
+
+#, c-format
+msgid "key does not contain a section: %s"
+msgstr "ключ не міÑтить розділу: %s"
+
+#, c-format
+msgid "key does not contain variable name: %s"
+msgstr "ключ не міÑтить назви змінної: %s"
+
+#, c-format
+msgid "invalid key: %s"
+msgstr "неприпуÑтимий ключ: %s"
+
+#, c-format
+msgid "invalid key (newline): %s"
+msgstr "неприпуÑтимий ключ (новий Ñ€Ñдок): %s"
+
+msgid "empty config key"
+msgstr "порожній ключ конфігурації"
+
+#, c-format
+msgid "bogus config parameter: %s"
+msgstr "хибний параметр конфігурації: %s"
+
+#, c-format
+msgid "bogus format in %s"
+msgstr "хибний формат у %s"
+
+#, c-format
+msgid "bogus count in %s"
+msgstr "хибна кількіÑÑ‚ÑŒ у %s"
+
+#, c-format
+msgid "too many entries in %s"
+msgstr "забагато запиÑів у %s"
+
+#, c-format
+msgid "missing config key %s"
+msgstr "відÑутній ключ конфігурації %s"
+
+#, c-format
+msgid "missing config value %s"
+msgstr "відÑутнє Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ— %s"
+
+#, c-format
+msgid "bad config line %d in blob %s"
+msgstr "невірний конфігураційний Ñ€Ñдок %d у blob %s"
+
+#, c-format
+msgid "bad config line %d in file %s"
+msgstr "невірний конфігураційний Ñ€Ñдок %d у файлі %s"
+
+#, c-format
+msgid "bad config line %d in standard input"
+msgstr "невірний конфігураційний Ñ€Ñдок %d у Ñтандартному вводі"
+
+#, c-format
+msgid "bad config line %d in submodule-blob %s"
+msgstr "невірний конфігураційний Ñ€Ñдок %d у підмодулі-blob %s"
+
+#, c-format
+msgid "bad config line %d in command line %s"
+msgstr "невірний конфігураційний Ñ€Ñдок %d у командному Ñ€Ñдку %s"
+
+#, c-format
+msgid "bad config line %d in %s"
+msgstr "невірний конфігураційний Ñ€Ñдок %d в %s"
+
+msgid "out of range"
+msgstr "поза межами діапазону"
+
+msgid "invalid unit"
+msgstr "неприпуÑтима Ð¾Ð´Ð¸Ð½Ð¸Ñ†Ñ Ð²Ð¸Ð¼Ñ–Ñ€Ñƒ"
+
+#, c-format
+msgid "bad numeric config value '%s' for '%s': %s"
+msgstr "невірне чиÑлове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ— \"%s\" Ð´Ð»Ñ \"%s\": %s"
+
+#, c-format
+msgid "bad numeric config value '%s' for '%s' in blob %s: %s"
+msgstr "невірне чиÑлове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ— \"%s\" Ð´Ð»Ñ \"%s\" у blob %s: %s"
+
+#, c-format
+msgid "bad numeric config value '%s' for '%s' in file %s: %s"
+msgstr "невірне чиÑлове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ— \"%s\" Ð´Ð»Ñ \"%s\" у файлі %s: %s"
+
+#, c-format
+msgid "bad numeric config value '%s' for '%s' in standard input: %s"
+msgstr ""
+"невірне чиÑлове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ— \"%s\" Ð´Ð»Ñ \"%s\" у Ñтандартному "
+"вводі: %s"
+
+#, c-format
+msgid "bad numeric config value '%s' for '%s' in submodule-blob %s: %s"
+msgstr ""
+"невірне чиÑлове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ— \"%s\" Ð´Ð»Ñ \"%s\" у підмодулі-blob %s: "
+"%s"
+
+#, c-format
+msgid "bad numeric config value '%s' for '%s' in command line %s: %s"
+msgstr ""
+"невірне чиÑлове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ— \"%s\" Ð´Ð»Ñ \"%s\" у командному Ñ€Ñдку "
+"%s: %s"
+
+#, c-format
+msgid "bad numeric config value '%s' for '%s' in %s: %s"
+msgstr "невірне чиÑлове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ— \"%s\" Ð´Ð»Ñ \"%s\" у \"%s\": %s"
+
+#, c-format
+msgid "invalid value for variable %s"
+msgstr "неприпуÑтиме Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ð·Ð¼Ñ–Ð½Ð½Ð¾Ñ— %s"
+
+#, c-format
+msgid "ignoring unknown core.fsync component '%s'"
+msgstr "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð½ÐµÐ²Ñ–Ð´Ð¾Ð¼Ð¾Ð³Ð¾ компонента core.fsync \"%s\""
+
+#, c-format
+msgid "bad boolean config value '%s' for '%s'"
+msgstr "невірне булеве Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ— \"%s\" Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "failed to expand user dir in: '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ директорію кориÑтувача в: \"%s\""
+
+#, c-format
+msgid "'%s' for '%s' is not a valid timestamp"
+msgstr "\"%s\" Ð´Ð»Ñ \"%s\" не Ñ” припуÑтимою міткою чаÑу"
+
+#, c-format
+msgid "abbrev length out of range: %d"
+msgstr "довжина ÑÐºÐ¾Ñ€Ð¾Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð·Ð° діапазоном: %d"
+
+#, c-format
+msgid "bad zlib compression level %d"
+msgstr "невірний рівень zlib компреÑÑ–Ñ— %d"
+
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar має бути лише одним Ñимволом ASCII"
+
+#, c-format
+msgid "ignoring unknown core.fsyncMethod value '%s'"
+msgstr "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð½ÐµÐ²Ñ–Ð´Ð¾Ð¼Ð¾Ð³Ð¾ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ core.fsyncMethod \"%s\""
+
+msgid "core.fsyncObjectFiles is deprecated; use core.fsync instead"
+msgstr "core.fsyncObjectFiles заÑтаріла; натоміÑÑ‚ÑŒ викориÑтовуйте core.fsync"
+
+#, c-format
+msgid "invalid mode for object creation: %s"
+msgstr "неприпуÑтимий режим ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ð°: %s"
+
+#, c-format
+msgid "malformed value for %s"
+msgstr "невірно Ñформоване Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "malformed value for %s: %s"
+msgstr "невірно Ñформоване Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ %s: %s"
+
+msgid "must be one of nothing, matching, simple, upstream or current"
+msgstr "має бути одним з nothing, matching, simple, upstream або current"
+
+#, c-format
+msgid "unable to load config blob object '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ config blob обʼєкт \"%s\""
+
+#, c-format
+msgid "reference '%s' does not point to a blob"
+msgstr "поÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\" не вказує на blob"
+
+#, c-format
+msgid "unable to resolve config blob '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ñ‚Ð¸ config blob \"%s\""
+
+msgid "unable to parse command-line config"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ конфігурацію командного Ñ€Ñдка"
+
+msgid "unknown error occurred while reading the configuration files"
+msgstr "невідома помилка виникла під Ñ‡Ð°Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ð¹Ð½Ð¸Ñ… файлів"
+
+#, c-format
+msgid "Invalid %s: '%s'"
+msgstr "ÐеприпуÑтимий %s: \"%s\""
+
+#, c-format
+msgid "splitIndex.maxPercentChange value '%d' should be between 0 and 100"
+msgstr ""
+"Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ splitIndex.maxPercentChange \"%d\" має бути в діапазоні від 0 до 100"
+
+#, c-format
+msgid "unable to parse '%s' from command-line config"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ \"%s\" з конфігурації командного Ñ€Ñдка"
+
+#, c-format
+msgid "bad config variable '%s' in file '%s' at line %d"
+msgstr "невірна конфігураційна змінна \"%s\" у файлі \"%s\", Ñ€Ñдок \"%d\""
+
+#, c-format
+msgid "invalid section name '%s'"
+msgstr "неприпуÑтима назва Ñекції \"%s\""
+
+#, c-format
+msgid "%s has multiple values"
+msgstr "%s має кілька значень"
+
+#, c-format
+msgid "failed to write new configuration file %s"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати новий конфігураційний файл %s"
+
+#, c-format
+msgid "could not lock config file %s"
+msgstr "не вдалоÑÑ Ð·Ð°Ñ„Ñ–ÐºÑувати файл конфігурації %s"
+
+#, c-format
+msgid "opening %s"
+msgstr "Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ñ‚Ñ %s"
+
+#, c-format
+msgid "invalid config file %s"
+msgstr "неприпуÑтимий конфігураційний файл %s"
+
+#, c-format
+msgid "fstat on %s failed"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ fstat на %s"
+
+#, c-format
+msgid "unable to mmap '%s'%s"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ mmap \"%s\"%s"
+
+#, c-format
+msgid "chmod on %s failed"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ chmod на %s"
+
+#, c-format
+msgid "could not write config file %s"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати конфігураційний файл %s"
+
+#, c-format
+msgid "could not set '%s' to '%s'"
+msgstr "не вдалоÑÑ Ð²Ñтановити \"%s\" в \"%s\""
+
+#, c-format
+msgid "invalid section name: %s"
+msgstr "неприпуÑтима назва Ñекції: %s"
+
+#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr ""
+"відмовлено в роботі з занадто довгим Ñ€Ñдком у \"%s\", Ñ€Ñдок %<PRIuMAX>"
+
+#, c-format
+msgid "missing value for '%s'"
+msgstr "відÑутнє Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ \"%s\""
+
+msgid "the remote end hung up upon initial contact"
+msgstr "віддалене Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ñ Ð²Ñ–Ð´ÐºÐ»ÑŽÑ‡Ð¸Ð»Ð¾ÑÑ Ð¿Ñ€Ð¸ першому контакті"
+
+msgid ""
+"Could not read from remote repository.\n"
+"\n"
+"Please make sure you have the correct access rights\n"
+"and the repository exists."
+msgstr ""
+"Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ з віддаленого Ñховища.\n"
+"\n"
+"Будь лаÑка, переконайтеÑÑ, що у Ð²Ð°Ñ Ñ” правильні права доÑтупу\n"
+"Ñ– що Ñховище Ñ–Ñнує."
+
+#, c-format
+msgid "server doesn't support '%s'"
+msgstr "Ñервер не підтримує \"%s\""
+
+#, c-format
+msgid "server doesn't support feature '%s'"
+msgstr "Ñервер не підтримує оÑобливіÑÑ‚ÑŒ \"%s\""
+
+msgid "expected flush after capabilities"
+msgstr "очікувалоÑÑŒ flush піÑÐ»Ñ Ð·Ð´Ñ–Ð±Ð½Ð¾Ñтей"
+
+#, c-format
+msgid "ignoring capabilities after first line '%s'"
+msgstr "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð´Ñ–Ð±Ð½Ð¾Ñтей піÑÐ»Ñ Ð¿ÐµÑ€ÑˆÐ¾Ð³Ð¾ Ñ€Ñдка \"%s\""
+
+msgid "protocol error: unexpected capabilities^{}"
+msgstr "помилка протоколу: неочікувані здібноÑÑ‚Ñ–^{}"
+
+#, c-format
+msgid "protocol error: expected shallow sha-1, got '%s'"
+msgstr "помилка протоколу: очікувалоÑÑŒ неглибоке sha-1, отримано \"%s\""
+
+msgid "repository on the other end cannot be shallow"
+msgstr "Ñховище на іншому кінці не може бути неглибоким"
+
+msgid "invalid packet"
+msgstr "неприпуÑтимий пакет"
+
+#, c-format
+msgid "protocol error: unexpected '%s'"
+msgstr "помилка протоколу: неочікуване \"%s\""
+
+#, c-format
+msgid "unknown object format '%s' specified by server"
+msgstr "невідомий формат обʼєкта \"%s\", вказаний Ñервером"
+
+#, c-format
+msgid "error on bundle-uri response line %d: %s"
+msgstr "помилка у Ñ€Ñдку відповіді bundle-uri %d: %s"
+
+msgid "expected flush after bundle-uri listing"
+msgstr "очікувалоÑÑŒ flush піÑÐ»Ñ Ð²Ð¸Ð²Ð¾Ð´Ñƒ bundle-uri"
+
+msgid "expected response end packet after ref listing"
+msgstr "очікувалоÑÑŒ response end пакет піÑÐ»Ñ Ð²Ð¸Ð²Ð¾Ð´Ñƒ поÑилань"
+
+#, c-format
+msgid "invalid ls-refs response: %s"
+msgstr "неприпуÑтима ls-refs відповідь: %s"
+
+msgid "expected flush after ref listing"
+msgstr "очікувалоÑÑŒ flush піÑÐ»Ñ Ð²Ð¸Ð²Ð¾Ð´Ñƒ поÑилань"
+
+#, c-format
+msgid "protocol '%s' is not supported"
+msgstr "протокол \"%s\" не підтримуєтьÑÑ"
+
+msgid "unable to set SO_KEEPALIVE on socket"
+msgstr "не вдалоÑÑ Ð²Ñтановити SO_KEEPALIVE Ñокету"
+
+#, c-format
+msgid "Looking up %s ... "
+msgstr "Пошук %s ... "
+
+#, c-format
+msgid "unable to look up %s (port %s) (%s)"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ %s (порт %s) (%s)"
+
+#. TRANSLATORS: this is the end of "Looking up %s ... "
+#, c-format
+msgid ""
+"done.\n"
+"Connecting to %s (port %s) ... "
+msgstr ""
+"готово.\n"
+"ÐŸÑ–Ð´ÐºÐ»ÑŽÑ‡ÐµÐ½Ð½Ñ Ð´Ð¾ %s (порт %s) ... "
+
+#, c-format
+msgid ""
+"unable to connect to %s:\n"
+"%s"
+msgstr ""
+"не вдалоÑÑ Ð¿Ñ€Ð¸Ñ”Ð´Ð½Ð°Ñ‚Ð¸ÑÑ Ð´Ð¾ %s:\n"
+"%s"
+
+#. TRANSLATORS: this is the end of "Connecting to %s (port %s) ... "
+msgid "done."
+msgstr "готово."
+
+#, c-format
+msgid "unable to look up %s (%s)"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ %s (%s)"
+
+#, c-format
+msgid "unknown port %s"
+msgstr "невідомий порт %s"
+
+#, c-format
+msgid "strange hostname '%s' blocked"
+msgstr "дивне Ñ–Ð¼Ê¼Ñ Ñ…Ð¾Ñта \"%s\" заблоковано"
+
+#, c-format
+msgid "strange port '%s' blocked"
+msgstr "дивний порт \"%s\" заблоковано"
+
+#, c-format
+msgid "cannot start proxy %s"
+msgstr "неможливо запуÑтити прокÑÑ– %s"
+
+msgid "no path specified; see 'git help pull' for valid url syntax"
+msgstr "не вказано шлÑÑ…; дивітьÑÑ \"git help pull\" Ð´Ð»Ñ Ñ‡Ð¸Ð½Ð½Ð¾Ð³Ð¾ url ÑинтакÑиÑу"
+
+msgid "newline is forbidden in git:// hosts and repo paths"
+msgstr "новий Ñ€Ñдок у хоÑтах git:// та шлÑхах репозиторіїв заборонено"
+
+msgid "ssh variant 'simple' does not support -4"
+msgstr "ssh Ð¾Ð¿Ñ†Ñ–Ñ \"simple\" не підтримує -4"
+
+msgid "ssh variant 'simple' does not support -6"
+msgstr "ssh Ð¾Ð¿Ñ†Ñ–Ñ \"simple\" не підтримує -6"
+
+msgid "ssh variant 'simple' does not support setting port"
+msgstr "ssh Ð¾Ð¿Ñ†Ñ–Ñ \"simple\" не підтримує вÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð¿Ð¾Ñ€Ñ‚Ñƒ"
+
+#, c-format
+msgid "strange pathname '%s' blocked"
+msgstr "дивне Ñ–Ð¼Ê¼Ñ ÑˆÐ»Ñху \"%s\" заблоковано"
+
+msgid "unable to fork"
+msgstr "неможливо розгалужити"
+
+msgid "Could not run 'git rev-list'"
+msgstr "Ðе вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити \"git rev-list\""
+
+msgid "failed write to rev-list"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати до rev-list"
+
+msgid "failed to close rev-list's stdin"
+msgstr "не вдалоÑÑ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¸ stdin Ð´Ð»Ñ rev-list"
+
+#, c-format
+msgid "illegal crlf_action %d"
+msgstr "неприпуÑтиме crlf_action %d"
+
+#, c-format
+msgid "CRLF would be replaced by LF in %s"
+msgstr "CRLF буде замінено на LF у %s"
+
+#, c-format
+msgid ""
+"in the working copy of '%s', CRLF will be replaced by LF the next time Git "
+"touches it"
+msgstr ""
+"у робочій копії \"%s\" CRLF буде замінено на LF наÑтупного разу, коли Git "
+"доторкнетьÑÑ Ð´Ð¾ неї"
+
+#, c-format
+msgid "LF would be replaced by CRLF in %s"
+msgstr "LF буде замінено на CRLF у %s"
+
+#, c-format
+msgid ""
+"in the working copy of '%s', LF will be replaced by CRLF the next time Git "
+"touches it"
+msgstr ""
+"у робочій копії \"%s\" LF буде замінено на CRLF наÑтупного разу, коли Git "
+"доторкнетьÑÑ Ð´Ð¾ неї"
+
+#, c-format
+msgid "BOM is prohibited in '%s' if encoded as %s"
+msgstr "BOM заборонено в \"%s\", Ñкщо закодовано Ñк %s"
+
+#, c-format
+msgid ""
+"The file '%s' contains a byte order mark (BOM). Please use UTF-%.*s as "
+"working-tree-encoding."
+msgstr ""
+"Файл \"%s\" міÑтить позначку порÑдку байтів (BOM). Будь лаÑка, "
+"викориÑтовуйте UTF-%.*s Ñк ÐºÐ¾Ð´ÑƒÐ²Ð°Ð½Ð½Ñ Ñ€Ð¾Ð±Ð¾Ñ‡Ð¾Ð³Ð¾ дерева."
+
+#, c-format
+msgid "BOM is required in '%s' if encoded as %s"
+msgstr "BOM необхідний в \"%s\", Ñкщо закодовано Ñк %s"
+
+#, c-format
+msgid ""
+"The file '%s' is missing a byte order mark (BOM). Please use UTF-%sBE or UTF-"
+"%sLE (depending on the byte order) as working-tree-encoding."
+msgstr ""
+"У файлі \"%s\" відÑÑƒÑ‚Ð½Ñ Ð¿Ð¾Ð·Ð½Ð°Ñ‡ÐºÐ° поÑлідовноÑÑ‚Ñ– байтів (BOM). Будь лаÑка, "
+"викориÑтовуйте UTF-%sBE або UTF-%sLE (залежно від поÑлідовноÑÑ‚Ñ– байтів) Ñк "
+"ÐºÐ¾Ð´ÑƒÐ²Ð°Ð½Ð½Ñ Ñ€Ð¾Ð±Ð¾Ñ‡Ð¾Ð³Ð¾ дерева."
+
+#, c-format
+msgid "failed to encode '%s' from %s to %s"
+msgstr "не вдалоÑÑ Ð·Ð°ÐºÐ¾Ð´ÑƒÐ²Ð°Ñ‚Ð¸ \"%s\" з %s в %s"
+
+#, c-format
+msgid "encoding '%s' from %s to %s and back is not the same"
+msgstr "ÐºÐ¾Ð´ÑƒÐ²Ð°Ð½Ð½Ñ \"%s\" з %s в %s Ñ– назад не однакове"
+
+#, c-format
+msgid "cannot fork to run external filter '%s'"
+msgstr "неможливо розгалужити Ð´Ð»Ñ Ð·Ð°Ð¿ÑƒÑку зовнішнього фільтра \"%s\""
+
+#, c-format
+msgid "cannot feed the input to external filter '%s'"
+msgstr "неможливо подати вхідні дані на зовнішній фільтр \"%s\""
+
+#, c-format
+msgid "external filter '%s' failed %d"
+msgstr "помилка зовнішнього фільтра \"%s\", код: %d"
+
+#, c-format
+msgid "read from external filter '%s' failed"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ з зовнішнього фільтра \"%s\""
+
+#, c-format
+msgid "external filter '%s' failed"
+msgstr "помилка зовнішнього фільтра \"%s\""
+
+msgid "unexpected filter type"
+msgstr "неÑподіваний тип фільтра"
+
+msgid "path name too long for external filter"
+msgstr "назва шлÑху занадто довга Ð´Ð»Ñ Ð·Ð¾Ð²Ð½Ñ–ÑˆÐ½ÑŒÐ¾Ð³Ð¾ фільтра"
+
+#, c-format
+msgid ""
+"external filter '%s' is not available anymore although not all paths have "
+"been filtered"
+msgstr ""
+"зовнішній фільтр \"%s\" більше не доÑтупний, хоча не вÑÑ– шлÑхи були "
+"відфільтровані"
+
+msgid "true/false are no valid working-tree-encodings"
+msgstr "true/false не Ñ” допуÑтимими кодуваннÑми робочого дерева"
+
+#, c-format
+msgid "%s: clean filter '%s' failed"
+msgstr "%s: помилка фільтра очиÑтки \"%s\""
+
+#, c-format
+msgid "%s: smudge filter %s failed"
+msgstr "%s: помилка фільтра Ñ€Ð¾Ð·Ð¼Ð¸Ñ‚Ñ‚Ñ %s"
+
+#, c-format
+msgid "skipping credential lookup for key: credential.%s"
+msgstr "пропуÑк пошуку облікових даних Ð´Ð»Ñ ÐºÐ»ÑŽÑ‡Ð°: credential.%s"
+
+msgid "refusing to work with credential missing host field"
+msgstr "відмовлено в роботі з відÑутнім полем хоÑта в облікових даних"
+
+msgid "refusing to work with credential missing protocol field"
+msgstr "відмовлено в роботі з відÑутнім полем протоколу облікових даних"
+
+#, c-format
+msgid "url contains a newline in its %s component: %s"
+msgstr "url міÑтить новий Ñ€Ñдок у %s компоненті: %s"
+
+#, c-format
+msgid "url has no scheme: %s"
+msgstr "url не має Ñхеми: %s"
+
+#, c-format
+msgid "credential url cannot be parsed: %s"
+msgstr "неможливо розібрати url облікових даних: %s"
+
+msgid "in the future"
+msgstr "у майбутньому"
+
+#, c-format
+msgid "%<PRIuMAX> second ago"
+msgid_plural "%<PRIuMAX> seconds ago"
+msgstr[0] "%<PRIuMAX> Ñекунду тому"
+msgstr[1] "%<PRIuMAX> Ñекунди тому"
+msgstr[2] "%<PRIuMAX> Ñекунд тому"
+
+#, c-format
+msgid "%<PRIuMAX> minute ago"
+msgid_plural "%<PRIuMAX> minutes ago"
+msgstr[0] "%<PRIuMAX> хвилину тому"
+msgstr[1] "%<PRIuMAX> хвилини тому"
+msgstr[2] "%<PRIuMAX> хвилин тому"
+
+#, c-format
+msgid "%<PRIuMAX> hour ago"
+msgid_plural "%<PRIuMAX> hours ago"
+msgstr[0] "%<PRIuMAX> годину тому"
+msgstr[1] "%<PRIuMAX> години тому"
+msgstr[2] "%<PRIuMAX> годин тому"
+
+#, c-format
+msgid "%<PRIuMAX> day ago"
+msgid_plural "%<PRIuMAX> days ago"
+msgstr[0] "%<PRIuMAX> день тому"
+msgstr[1] "%<PRIuMAX> дні тому"
+msgstr[2] "%<PRIuMAX> днів тому"
+
+#, c-format
+msgid "%<PRIuMAX> week ago"
+msgid_plural "%<PRIuMAX> weeks ago"
+msgstr[0] "%<PRIuMAX> тиждень тому"
+msgstr[1] "%<PRIuMAX> тижні тому"
+msgstr[2] "%<PRIuMAX> тижнів тому"
+
+#, c-format
+msgid "%<PRIuMAX> month ago"
+msgid_plural "%<PRIuMAX> months ago"
+msgstr[0] "%<PRIuMAX> міÑÑць тому"
+msgstr[1] "%<PRIuMAX> міÑÑці тому"
+msgstr[2] "%<PRIuMAX> міÑÑців тому"
+
+#, c-format
+msgid "%<PRIuMAX> year"
+msgid_plural "%<PRIuMAX> years"
+msgstr[0] "%<PRIuMAX> рік"
+msgstr[1] "%<PRIuMAX> роки"
+msgstr[2] "%<PRIuMAX> років"
+
+#. TRANSLATORS: "%s" is "<n> years"
+#, c-format
+msgid "%s, %<PRIuMAX> month ago"
+msgid_plural "%s, %<PRIuMAX> months ago"
+msgstr[0] "%s, %<PRIuMAX> міÑÑць тому"
+msgstr[1] "%s, %<PRIuMAX> міÑÑці тому"
+msgstr[2] "%s, %<PRIuMAX> міÑÑців тому"
+
+#, c-format
+msgid "%<PRIuMAX> year ago"
+msgid_plural "%<PRIuMAX> years ago"
+msgstr[0] "%<PRIuMAX> рік тому"
+msgstr[1] "%<PRIuMAX> роки тому"
+msgstr[2] "%<PRIuMAX> років тому"
+
+msgid "Propagating island marks"
+msgstr "РозповÑÑŽÐ´Ð¶ÐµÐ½Ð½Ñ Ð¾Ñтрівних позначок"
+
+#, c-format
+msgid "bad tree object %s"
+msgstr "невірний обʼєкт дерева %s"
+
+#, c-format
+msgid "failed to load island regex for '%s': %s"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ island регвир Ð´Ð»Ñ \"%s\": %s"
+
+#, c-format
+msgid "island regex from config has too many capture groups (max=%d)"
+msgstr "регвир оÑтрова з конфігурації має забагато груп Ð·Ð°Ñ…Ð¾Ð¿Ð»ÐµÐ½Ð½Ñ (max=%d)"
+
+#, c-format
+msgid "Marked %d islands, done.\n"
+msgstr "Позначено %d оÑтровів, готово.\n"
+
+#, c-format
+msgid "invalid --%s value '%s'"
+msgstr "неприпуÑтиме --%s Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"%s\""
+
+#, c-format
+msgid "could not archive missing directory '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð°Ñ€Ñ…Ñ–Ð²ÑƒÐ²Ð°Ñ‚Ð¸ відÑутню директорію \"%s\""
+
+#, c-format
+msgid "could not open directory '%s'"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ директорію \"%s\""
+
+#, c-format
+msgid "skipping '%s', which is neither file nor directory"
+msgstr "пропуÑÐºÐ°Ð½Ð½Ñ \"%s\", Ñкий не Ñ” ні файлом, ні директорією"
+
+msgid "could not duplicate stdout"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ð´ÑƒÐ±Ð»ÑŽÐ²Ð°Ñ‚Ð¸ stdout"
+
+#, c-format
+msgid "could not add directory '%s' to archiver"
+msgstr "не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ директорію \"%s\" до архіватора"
+
+msgid "failed to write archive"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати архів"
+
+msgid "--merge-base does not work with ranges"
+msgstr "--merge-base не працює з діапазонами"
+
+msgid "unable to get HEAD"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ HEAD"
+
+msgid "no merge base found"
+msgstr "базу Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ðµ знайдено"
+
+msgid "multiple merge bases found"
+msgstr "знайдено кілька баз злиттÑ"
+
+msgid "cannot compare stdin to a directory"
+msgstr "неможливо порівнÑти stdin з директорією"
+
+msgid "cannot compare a named pipe to a directory"
+msgstr "неможливо порівнÑти іменований канал з директорією"
+
+msgid "git diff --no-index [<options>] <path> <path>"
+msgstr "git diff --no-index [<опції>] <шлÑÑ…> <шлÑÑ…>"
+
+msgid ""
+"Not a git repository. Use --no-index to compare two paths outside a working "
+"tree"
+msgstr ""
+"Це не git Ñховище. СкориÑтайтеÑÑŒ --no-index Ð´Ð»Ñ Ð¿Ð¾Ñ€Ñ–Ð²Ð½ÑÐ½Ð½Ñ Ð´Ð²Ð¾Ñ… шлÑхів поза "
+"робочим деревом"
+
+#, c-format
+msgid " Failed to parse dirstat cut-off percentage '%s'\n"
+msgstr " Ðе вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ відÑоток відÑÑ–ÐºÐ°Ð½Ð½Ñ dirstat \"%s\"\n"
+
+#, c-format
+msgid " Unknown dirstat parameter '%s'\n"
+msgstr " Ðевідомий параметр dirstat \"%s\"\n"
+
+msgid ""
+"color moved setting must be one of 'no', 'default', 'blocks', 'zebra', "
+"'dimmed-zebra', 'plain'"
+msgstr ""
+"Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° кольору перенеÑÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути одним з \"no\", \"default\", "
+"\"blocks\", \"zebra\", \"dimmed-zebra\", \"plain\""
+
+#, c-format
+msgid ""
+"unknown color-moved-ws mode '%s', possible values are 'ignore-space-change', "
+"'ignore-space-at-eol', 'ignore-all-space', 'allow-indentation-change'"
+msgstr ""
+"невідомий режим color-moved-ws \"%s\", можливі Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"ignore-space-"
+"change\", \"ignore-space-at-eol\", \"ignore-all-space\", \"allow-indentation-"
+"change\""
+
+msgid ""
+"color-moved-ws: allow-indentation-change cannot be combined with other "
+"whitespace modes"
+msgstr ""
+"color-moved-ws: allow-indentation-change не можна комбінувати з іншими "
+"режимами Ð²Ñ–Ð´Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¾Ð±Ñ–Ð»Ñ–Ð²"
+
+#, c-format
+msgid "Unknown value for 'diff.submodule' config variable: '%s'"
+msgstr "Ðевідоме Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ð¹Ð½Ð¾Ñ— змінної \"diff.submodule\": \"%s\""
+
+#, c-format
+msgid "unknown value for config '%s': %s"
+msgstr "невідоме Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ— \"%s\": %s"
+
+#, c-format
+msgid ""
+"Found errors in 'diff.dirstat' config variable:\n"
+"%s"
+msgstr ""
+"Знайдено помилки у конфігураційній змінній \"diff.dirstat\":\n"
+"%s"
+
+#, c-format
+msgid "external diff died, stopping at %s"
+msgstr "зовнішній diff завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾, зупинившиÑÑŒ на %s"
+
+msgid "--follow requires exactly one pathspec"
+msgstr "--follow потрібен лишень один визначник шлÑху"
+
+#, c-format
+msgid "pathspec magic not supported by --follow: %s"
+msgstr "магічне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð½Ð¸ÐºÐ° шлÑху не підтримуєтьÑÑ --follow: %s"
+
+#, c-format
+msgid "options '%s', '%s', '%s', and '%s' cannot be used together"
+msgstr "опції \"%s\", \"%s\", \"%s\" та \"%s\" неможливо викориÑтовувати разом"
+
+#, c-format
+msgid "options '%s' and '%s' cannot be used together, use '%s' with '%s'"
+msgstr ""
+"опції \"%s\" Ñ– \"%s\" неможливо викориÑтати разом, викориÑтовуйте \"%s\" з "
+"\"%s\""
+
+#, c-format
+msgid ""
+"options '%s' and '%s' cannot be used together, use '%s' with '%s' and '%s'"
+msgstr ""
+"опції \"%s\" Ñ– \"%s\" неможливо викориÑтати разом, викориÑтовуйте \"%s\" з "
+"\"%s\" та \"%s\""
+
+#, c-format
+msgid "invalid --stat value: %s"
+msgstr "неприпуÑтиме --stat значеннÑ: %s"
+
+#, c-format
+msgid "%s expects a numerical value"
+msgstr "%s очікує чиÑлове значеннÑ"
+
+#, c-format
+msgid ""
+"Failed to parse --dirstat/-X option parameter:\n"
+"%s"
+msgstr ""
+"Ðе вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ параметр опції --dirstat/-X:\n"
+"%s"
+
+#, c-format
+msgid "unknown change class '%c' in --diff-filter=%s"
+msgstr "невідома зміна клаÑу \"%c\" у --diff-filter=%s"
+
+#, c-format
+msgid "unknown value after ws-error-highlight=%.*s"
+msgstr "невідоме Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ñ–ÑÐ»Ñ ws-error-highlight=%.*s"
+
+#, c-format
+msgid "unable to resolve '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ñ‚Ð¸ \"%s\""
+
+#, c-format
+msgid "%s expects <n>/<m> form"
+msgstr "%s очікує <n>/<m> форму"
+
+#, c-format
+msgid "%s expects a character, got '%s'"
+msgstr "%s очікує Ñимвол, отримано \"%s\""
+
+#, c-format
+msgid "bad --color-moved argument: %s"
+msgstr "невірний --color-moved аргумент: %s"
+
+#, c-format
+msgid "invalid mode '%s' in --color-moved-ws"
+msgstr "неприпуÑтимий режим \"%s\" у --color-moved-ws"
+
+#, c-format
+msgid "invalid argument to %s"
+msgstr "неприпуÑтимий аргумент до %s"
+
+#, c-format
+msgid "invalid regex given to -I: '%s'"
+msgstr "неприпуÑтимий regex, переданий до -I: \"%s\""
+
+#, c-format
+msgid "failed to parse --submodule option parameter: '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ параметр опції --submodule: \"%s\""
+
+#, c-format
+msgid "bad --word-diff argument: %s"
+msgstr "невірний --word-diff аргумент: %s"
+
+msgid "Diff output format options"
+msgstr "Варіанти формату виводу різниці"
+
+msgid "generate patch"
+msgstr "згенерувати латку"
+
+msgid "<n>"
+msgstr "<n>"
+
+msgid "generate diffs with <n> lines context"
+msgstr "згенерувати різниці з контекÑтом в <n> Ñ€Ñдків"
+
+msgid "generate the diff in raw format"
+msgstr "згенерувати різницю у форматі raw"
+
+msgid "synonym for '-p --raw'"
+msgstr "Ñинонім Ð´Ð»Ñ \"-p --raw\""
+
+msgid "synonym for '-p --stat'"
+msgstr "Ñинонім Ð´Ð»Ñ \"-p --stat\""
+
+msgid "machine friendly --stat"
+msgstr "машинний вивід --stat"
+
+msgid "output only the last line of --stat"
+msgstr "вивеÑти лише оÑтанній Ñ€Ñдок --stat"
+
+msgid "<param1>,<param2>..."
+msgstr "<параметр1>,<параметр2>..."
+
+msgid ""
+"output the distribution of relative amount of changes for each sub-directory"
+msgstr "вивеÑти розподіл відноÑної кількоÑÑ‚Ñ– змін Ð´Ð»Ñ ÐºÐ¾Ð¶Ð½Ð¾Ñ— піддиректорії"
+
+msgid "synonym for --dirstat=cumulative"
+msgstr "Ñинонім Ð´Ð»Ñ --dirstat=cumulative"
+
+msgid "synonym for --dirstat=files,<param1>,<param2>..."
+msgstr "Ñинонім Ð´Ð»Ñ --dirstat=files,<параметр1>,<параметр2>..."
+
+msgid "warn if changes introduce conflict markers or whitespace errors"
+msgstr ""
+"попереджати, Ñкщо зміни призводÑÑ‚ÑŒ до поÑви конфліктних маркерів або помилок "
+"пробільних Ñимволів"
+
+msgid "condensed summary such as creations, renames and mode changes"
+msgstr "ÑтиÑлі підÑумки, такі Ñк ÑтвореннÑ, Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ Ñ‚Ð° зміни режимів"
+
+msgid "show only names of changed files"
+msgstr "показувати тільки назви змінених файлів"
+
+msgid "show only names and status of changed files"
+msgstr "показувати тільки назви та ÑÑ‚Ð°Ñ‚ÑƒÑ Ð·Ð¼Ñ–Ð½ÐµÐ½Ð¸Ñ… файлів"
+
+msgid "<width>[,<name-width>[,<count>]]"
+msgstr "<ширина>[,<ширина-назви>[,<кількіÑÑ‚ÑŒ>]]"
+
+msgid "generate diffstat"
+msgstr "згенерувати diffstat"
+
+msgid "<width>"
+msgstr "<ширина>"
+
+msgid "generate diffstat with a given width"
+msgstr "згенерувати diffstat із заданою шириною"
+
+msgid "generate diffstat with a given name width"
+msgstr "згенерувати diffstat із заданою шириною назви"
+
+msgid "generate diffstat with a given graph width"
+msgstr "згенерувати diffstat із заданою шириною графіка"
+
+msgid "<count>"
+msgstr "<кількіÑÑ‚ÑŒ>"
+
+msgid "generate diffstat with limited lines"
+msgstr "згенерувати diffstat з обмеженою кількіÑÑ‚ÑŽ Ñ€Ñдків"
+
+msgid "generate compact summary in diffstat"
+msgstr "згенерувати компактний підÑумок у diffstat"
+
+msgid "output a binary diff that can be applied"
+msgstr "вивеÑти бінарну різницю, Ñку можна заÑтоÑувати"
+
+msgid "show full pre- and post-image object names on the \"index\" lines"
+msgstr ""
+"показувати повні назви обʼєктів до та піÑÐ»Ñ Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð² \"index\" Ñ€Ñдках"
+
+msgid "show colored diff"
+msgstr "показати кольорову різницю"
+
+msgid "<kind>"
+msgstr "<тип>"
+
+msgid ""
+"highlight whitespace errors in the 'context', 'old' or 'new' lines in the "
+"diff"
+msgstr ""
+"виділÑти помилки пробільних Ñимволів у \"context\", \"old\" або \"new\" "
+"Ñ€Ñдках різниці"
+
+msgid ""
+"do not munge pathnames and use NULs as output field terminators in --raw or "
+"--numstat"
+msgstr ""
+"не змінювати імена шлÑхів Ñ– викориÑтовувати NUL Ñк термінатори полів виводу "
+"в --raw або --numstat"
+
+msgid "<prefix>"
+msgstr "<префікÑ>"
+
+msgid "show the given source prefix instead of \"a/\""
+msgstr "показувати заданий Ð¿Ñ€ÐµÑ„Ñ–ÐºÑ Ð´Ð¶ÐµÑ€ÐµÐ»Ð° заміÑÑ‚ÑŒ \"a/\""
+
+msgid "show the given destination prefix instead of \"b/\""
+msgstr "показувати заданий Ð¿Ñ€ÐµÑ„Ñ–ÐºÑ Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð°Ð¼Ñ–ÑÑ‚ÑŒ \"b/\""
+
+msgid "prepend an additional prefix to every line of output"
+msgstr "додавати Ð¿Ñ€ÐµÑ„Ñ–ÐºÑ Ð´Ð¾ кожного Ñ€Ñдка виводу"
+
+msgid "do not show any source or destination prefix"
+msgstr "не показувати жодного префікÑа джерела або призначеннÑ"
+
+msgid "use default prefixes a/ and b/"
+msgstr "викориÑтовувати префікÑи за замовчуваннÑм a/ та b/"
+
+msgid "show context between diff hunks up to the specified number of lines"
+msgstr "показувати контекÑÑ‚ між шматками різниці до вказаної кількоÑÑ‚Ñ– Ñ€Ñдків"
+
+msgid "<char>"
+msgstr "<Ñимвол>"
+
+msgid "specify the character to indicate a new line instead of '+'"
+msgstr "вкажіть Ñимвол Ð´Ð»Ñ Ð¿Ð¾Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ð¾Ð²Ð¾Ð³Ð¾ Ñ€Ñдка заміÑÑ‚ÑŒ \"+\""
+
+msgid "specify the character to indicate an old line instead of '-'"
+msgstr "вкажіть Ñимвол Ð´Ð»Ñ Ð¿Ð¾Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñтарого Ñ€Ñдка заміÑÑ‚ÑŒ \"-\""
+
+msgid "specify the character to indicate a context instead of ' '"
+msgstr "вкажіть Ñимвол Ð´Ð»Ñ Ð¿Ð¾Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ‚ÐµÐºÑту заміÑÑ‚ÑŒ \" \""
+
+msgid "Diff rename options"
+msgstr "Варіанти Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ Ñ€Ñ–Ð·Ð½Ð¸Ñ†Ñ–"
+
+msgid "<n>[/<m>]"
+msgstr "<n>[/<m>]"
+
+msgid "break complete rewrite changes into pairs of delete and create"
+msgstr "розбити повний Ð¿ÐµÑ€ÐµÐ·Ð°Ð¿Ð¸Ñ Ð·Ð¼Ñ–Ð½ на пари delete та create"
+
+msgid "detect renames"
+msgstr "виÑвлÑти перейменуваннÑ"
+
+msgid "omit the preimage for deletes"
+msgstr "пропуÑкати попереднє Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ð²Ð¸Ð´Ð°Ð»ÐµÐ½ÑŒ"
+
+msgid "detect copies"
+msgstr "виÑвлÑти копії"
+
+msgid "use unmodified files as source to find copies"
+msgstr "викориÑтовувати незмінені файли Ñк джерело Ð´Ð»Ñ Ð¿Ð¾ÑˆÑƒÐºÑƒ копій"
+
+msgid "disable rename detection"
+msgstr "вимкнути виÑÐ²Ð»ÐµÐ½Ð½Ñ Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ"
+
+msgid "use empty blobs as rename source"
+msgstr "викориÑтовувати порожні blobs Ñк джерело перейменуваннÑ"
+
+msgid "continue listing the history of a file beyond renames"
+msgstr "продовжити Ð²Ð¸Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ñ–Ñторії файлу піÑÐ»Ñ Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ"
+
+msgid ""
+"prevent rename/copy detection if the number of rename/copy targets exceeds "
+"given limit"
+msgstr ""
+"запобігати виÑвленню перейменуваннÑ/копіюваннÑ, Ñкщо кількіÑÑ‚ÑŒ обʼєктів "
+"перейменуваннÑ/ÐºÐ¾Ð¿Ñ–ÑŽÐ²Ð°Ð½Ð½Ñ Ð¿ÐµÑ€ÐµÐ²Ð¸Ñ‰ÑƒÑ” заданий ліміт"
+
+msgid "Diff algorithm options"
+msgstr "Варіанти алгоритмів різниці"
+
+msgid "produce the smallest possible diff"
+msgstr "Ñтворювати найменшу можливу різницю"
+
+msgid "ignore whitespace when comparing lines"
+msgstr "ігнорувати пробіли при порівнÑнні Ñ€Ñдків"
+
+msgid "ignore changes in amount of whitespace"
+msgstr "ігнорувати зміни кількоÑÑ‚Ñ– пробілів"
+
+msgid "ignore changes in whitespace at EOL"
+msgstr "ігнорувати зміни пробілів у EOL"
+
+msgid "ignore carrier-return at the end of line"
+msgstr "ігнорувати Ð¿Ð¾Ð²ÐµÑ€Ð½ÐµÐ½Ð½Ñ ÐºÐ°Ñ€ÐµÑ‚ÐºÐ¸ в кінці Ñ€Ñдка"
+
+msgid "ignore changes whose lines are all blank"
+msgstr "ігнорувати зміни, вÑÑ– Ñ€Ñдки Ñких порожні"
+
+msgid "<regex>"
+msgstr "<регвир>"
+
+msgid "ignore changes whose all lines match <regex>"
+msgstr "ігнорувати зміни, вÑÑ– Ñ€Ñдки Ñких збігаютьÑÑ Ð· <регвир>"
+
+msgid "heuristic to shift diff hunk boundaries for easy reading"
+msgstr "евриÑтичне Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð¼Ñ–Ñ‰ÐµÐ½Ð½Ñ Ð¼ÐµÐ¶ шматка різниці Ð´Ð»Ñ Ð·Ñ€ÑƒÑ‡Ð½Ð¾Ð³Ð¾ читаннÑ"
+
+msgid "generate diff using the \"patience diff\" algorithm"
+msgstr "згенерувати різницю за алгоритмом \"patience diff\""
+
+msgid "generate diff using the \"histogram diff\" algorithm"
+msgstr "згенерувати різницю за алгоритмом \"histogram diff\""
+
+msgid "<text>"
+msgstr "<текÑÑ‚>"
+
+msgid "generate diff using the \"anchored diff\" algorithm"
+msgstr "згенерувати різницю за алгоритмом \"anchored diff\""
+
+msgid "<mode>"
+msgstr "<режим>"
+
+msgid "show word diff, using <mode> to delimit changed words"
+msgstr ""
+"показати різницю по Ñловам, викориÑтовуючи <режим> Ð´Ð»Ñ Ð²Ñ–Ð´Ð¾ÐºÑ€ÐµÐ¼Ð»ÐµÐ½Ð½Ñ "
+"змінених Ñлів"
+
+msgid "use <regex> to decide what a word is"
+msgstr "ÑкориÑтайтеÑÑŒ <регвир>, щоб визначити, що це за Ñлово"
+
+msgid "equivalent to --word-diff=color --word-diff-regex=<regex>"
+msgstr "еквівалентно --word-diff=color --word-diff-regex=<регвир>"
+
+msgid "moved lines of code are colored differently"
+msgstr "переміщені Ñ€Ñдки коду мають інший колір"
+
+msgid "how white spaces are ignored in --color-moved"
+msgstr "Ñк ігноруютьÑÑ Ð¿Ñ€Ð¾Ð±Ñ–Ð»Ð¸ в --color-moved"
+
+msgid "Other diff options"
+msgstr "Інші опції різниці"
+
+msgid "when run from subdir, exclude changes outside and show relative paths"
+msgstr ""
+"при запуÑку з піддиректорії не враховувати зміни ззовні та показувати "
+"відноÑні шлÑхи"
+
+msgid "treat all files as text"
+msgstr "оброблÑти вÑÑ– файли Ñк текÑтові"
+
+msgid "swap two inputs, reverse the diff"
+msgstr "помінÑти міÑцÑми два вводи, змінити різницю на протилежну"
+
+msgid "exit with 1 if there were differences, 0 otherwise"
+msgstr ""
+"завершити Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ Ð· кодом 1, Ñкщо були різниці, або з кодом 0 в іншому "
+"випадку"
+
+msgid "disable all output of the program"
+msgstr "вимкнути веÑÑŒ вивід програми"
+
+msgid "allow an external diff helper to be executed"
+msgstr "дозволити Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ Ð·Ð¾Ð²Ð½Ñ–ÑˆÐ½ÑŒÐ¾Ð³Ð¾ помічника різниці"
+
+msgid "run external text conversion filters when comparing binary files"
+msgstr ""
+"запуÑкати зовнішні фільтри конвертації текÑту під Ñ‡Ð°Ñ Ð¿Ð¾Ñ€Ñ–Ð²Ð½ÑÐ½Ð½Ñ Ð±Ñ–Ð½Ð°Ñ€Ð½Ð¸Ñ… "
+"файлів"
+
+msgid "<when>"
+msgstr "<коли>"
+
+msgid "ignore changes to submodules in the diff generation"
+msgstr "ігнорувати зміни підмодулів у генерації різниці"
+
+msgid "<format>"
+msgstr "<формат>"
+
+msgid "specify how differences in submodules are shown"
+msgstr "вказати Ñк відображати різниці в підмодулÑÑ…"
+
+msgid "hide 'git add -N' entries from the index"
+msgstr "приховати запиÑи \"git add -N\" з індекÑу"
+
+msgid "treat 'git add -N' entries as real in the index"
+msgstr "оброблÑти \"git add -N\" запиÑи Ñк дійÑні в індекÑÑ–"
+
+msgid "<string>"
+msgstr "<Ñтрока>"
+
+msgid ""
+"look for differences that change the number of occurrences of the specified "
+"string"
+msgstr "шукати різниці, Ñкі змінюють кількіÑÑ‚ÑŒ входжень вказаного Ñ€Ñдка"
+
+msgid ""
+"look for differences that change the number of occurrences of the specified "
+"regex"
+msgstr "шукати різниці, Ñкі змінюють кількіÑÑ‚ÑŒ входжень вказаного регвиру"
+
+msgid "show all changes in the changeset with -S or -G"
+msgstr "показати вÑÑ– зміни у змінному наборі з -S або -G"
+
+msgid "treat <string> in -S as extended POSIX regular expression"
+msgstr "оброблÑти <Ñ€Ñдок> у -S Ñк розширений POSIX регулÑрний вираз"
+
+msgid "control the order in which files appear in the output"
+msgstr "керувати порÑдком, у Ñкому файли зʼÑвлÑÑŽÑ‚ÑŒÑÑ Ñƒ виводі"
+
+msgid "<path>"
+msgstr "<шлÑÑ…>"
+
+msgid "show the change in the specified path first"
+msgstr "Ñпочатку показати зміну Ð´Ð»Ñ Ð·Ð°Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¾Ð³Ð¾ шлÑху"
+
+msgid "skip the output to the specified path"
+msgstr "пропуÑтити вивід Ð´Ð»Ñ Ð·Ð°Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¾Ð³Ð¾ шлÑху"
+
+msgid "<object-id>"
+msgstr "<id-обʼєкта>"
+
+msgid ""
+"look for differences that change the number of occurrences of the specified "
+"object"
+msgstr "шукати різниці, Ñкі змінюють кількіÑÑ‚ÑŒ входжень вказаного обʼєкта"
+
+msgid "[(A|C|D|M|R|T|U|X|B)...[*]]"
+msgstr "[(A|C|D|M|R|T|U|X|B)...[*]]"
+
+msgid "select files by diff type"
+msgstr "вибрати файли за типом різниці"
+
+msgid "<file>"
+msgstr "<файл>"
+
+msgid "output to a specific file"
+msgstr "виводити до певного файла"
+
+msgid "exhaustive rename detection was skipped due to too many files."
+msgstr ""
+"вичерпне виÑÐ²Ð»ÐµÐ½Ð½Ñ Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ Ð±ÑƒÐ»Ð¾ пропущено через занадто велику "
+"кількіÑÑ‚ÑŒ файлів."
+
+msgid "only found copies from modified paths due to too many files."
+msgstr ""
+"знайдено лише копії зі змінених шлÑхів через занадто велику кількіÑÑ‚ÑŒ файлів."
+
+#, c-format
+msgid ""
+"you may want to set your %s variable to at least %d and retry the command."
+msgstr ""
+"можливо, вам Ñлід вÑтановити Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð¼Ñ–Ð½Ð½Ð¾Ñ— %s принаймні у %d Ñ– повторити "
+"команду."
+
+#, c-format
+msgid "failed to read orderfile '%s'"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ orderfile \"%s\""
+
+msgid "Performing inexact rename detection"
+msgstr "ВиÑÐ²Ð»ÐµÐ½Ð½Ñ Ð½ÐµÑ‚Ð¾Ñ‡Ð½Ð¾Ð³Ð¾ перейменуваннÑ"
+
+#, c-format
+msgid "No such path '%s' in the diff"
+msgstr "Ðемає такого шлÑху \"%s\" у різниці"
+
+#, c-format
+msgid "pathspec '%s' did not match any file(s) known to git"
+msgstr "визначник шлÑху \"%s\" не збігаєтьÑÑ Ð· жодним файлом, відомим git"
+
+#, c-format
+msgid "unrecognized pattern: '%s'"
+msgstr "нерозпізнаний шаблон: \"%s\""
+
+#, c-format
+msgid "unrecognized negative pattern: '%s'"
+msgstr "нерозпізнаний негативний шаблон: \"%s\""
+
+#, c-format
+msgid "your sparse-checkout file may have issues: pattern '%s' is repeated"
+msgstr ""
+"ваш файл розрідженого переходу може мати певні проблеми: шаблон \"%s\" "
+"повторюєтьÑÑ"
+
+msgid "disabling cone pattern matching"
+msgstr "Ð²Ð¸Ð¼ÐºÐ½ÐµÐ½Ð½Ñ Ð·Ñ–ÑÑ‚Ð°Ð²Ð»ÐµÐ½Ð½Ñ ÑˆÐ°Ð±Ð»Ð¾Ð½Ñƒ конуÑа"
+
+#, c-format
+msgid "cannot use %s as an exclude file"
+msgstr "неможливо викориÑтовувати %s Ñк файл виключеннÑ"
+
+msgid "failed to get kernel name and information"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ назву та інформацію про Ñдро"
+
+msgid "untracked cache is disabled on this system or location"
+msgstr "невідÑтежуваний кеш вимкнено на цій ÑиÑтемі або в цьому міÑці"
+
+msgid ""
+"No directory name could be guessed.\n"
+"Please specify a directory on the command line"
+msgstr ""
+"Hе вдалоÑÑ Ð²Ð³Ð°Ð´Ð°Ñ‚Ð¸ назву директорії.\n"
+"Будь лаÑка, вкажіть директорію в командному Ñ€Ñдку"
+
+#, c-format
+msgid "index file corrupt in repo %s"
+msgstr "пошкоджено індекÑний файл у Ñховищі %s"
+
+#, c-format
+msgid "could not create directories for %s"
+msgstr "не вдалоÑÑ Ñтворити директорії Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "could not migrate git directory from '%s' to '%s'"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ½ÐµÑти git директорію з \"%s\" до \"%s\""
+
+#, c-format
+msgid "hint: Waiting for your editor to close the file...%c"
+msgstr "підказка: чекаємо, поки редактор закриє файл...%c"
+
+#, c-format
+msgid "could not write to '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати в \"%s\""
+
+#, c-format
+msgid "could not edit '%s'"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ñ‚Ð¸ \"%s\""
+
+msgid "Filtering content"
+msgstr "Ð¤Ñ–Ð»ÑŒÑ‚Ñ€Ð°Ñ†Ñ–Ñ Ð²Ð¼Ñ–Ñту"
+
+#, c-format
+msgid "could not stat file '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ stat Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "bad git namespace path \"%s\""
+msgstr "невірний шлÑÑ… до проÑтору імен git \"%s\""
+
+#, c-format
+msgid "too many args to run %s"
+msgstr "забагато аргументів Ð´Ð»Ñ Ð·Ð°Ð¿ÑƒÑку %s"
+
+msgid "git fetch-pack: expected shallow list"
+msgstr "git fetch-pack: очікувавÑÑ Ð½ÐµÐ³Ð»Ð¸Ð±Ð¾ÐºÐ¸Ð¹ ÑпиÑок"
+
+msgid "git fetch-pack: expected a flush packet after shallow list"
+msgstr "git fetch-pack: очікувалоÑÑŒ flush пакет піÑÐ»Ñ Ð½ÐµÐ³Ð»Ð¸Ð±Ð¾ÐºÐ¾Ð³Ð¾ ÑпиÑку"
+
+msgid "git fetch-pack: expected ACK/NAK, got a flush packet"
+msgstr "git fetch-pack: очікувалоÑÑŒ ACK/NAK, отримано flush пакет"
+
+#, c-format
+msgid "git fetch-pack: expected ACK/NAK, got '%s'"
+msgstr "git fetch-pack: очікувалоÑÑŒ ACK/NAK, отримано \"%s\""
+
+msgid "unable to write to remote"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати до віддаленого Ñховища"
+
+msgid "Server supports filter"
+msgstr "Сервер підтримує фільтр"
+
+#, c-format
+msgid "invalid shallow line: %s"
+msgstr "неприпуÑтимий shallow Ñ€Ñдок: %s"
+
+#, c-format
+msgid "invalid unshallow line: %s"
+msgstr "неприпуÑтимий unshallow Ñ€Ñдок: %s"
+
+#, c-format
+msgid "object not found: %s"
+msgstr "обʼєкт не знайдено: %s"
+
+#, c-format
+msgid "error in object: %s"
+msgstr "помилка в обʼєкті: %s"
+
+#, c-format
+msgid "no shallow found: %s"
+msgstr "не знайдено неглибоких: %s"
+
+#, c-format
+msgid "expected shallow/unshallow, got %s"
+msgstr "очікувалоÑÑŒ shallow/unshallow, отримано %s"
+
+#, c-format
+msgid "got %s %d %s"
+msgstr "отримано %s %d %s"
+
+#, c-format
+msgid "invalid commit %s"
+msgstr "неприпуÑтимий коміт %s"
+
+msgid "giving up"
+msgstr "здаюÑÑ"
+
+msgid "done"
+msgstr "готово"
+
+#, c-format
+msgid "got %s (%d) %s"
+msgstr "отримано %s (%d) %s"
+
+#, c-format
+msgid "Marking %s as complete"
+msgstr "ÐŸÐ¾Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ %s Ñк завершеного"
+
+#, c-format
+msgid "already have %s (%s)"
+msgstr "вже є %s (%s)"
+
+msgid "fetch-pack: unable to fork off sideband demultiplexer"
+msgstr "fetch-pack: не вдалоÑÑ Ñ€Ð¾Ð·Ð³Ð°Ð»ÑƒÐ¶Ð¸Ñ‚Ð¸ sideband demultiplexer"
+
+msgid "protocol error: bad pack header"
+msgstr "помилка протоколу: невірний заголовок пакунка"
+
+#, c-format
+msgid "fetch-pack: unable to fork off %s"
+msgstr "fetch-pack: не вдалоÑÑ Ñ€Ð¾Ð·Ð³Ð°Ð»ÑƒÐ¶Ð¸Ñ‚Ð¸ %s"
+
+msgid "fetch-pack: invalid index-pack output"
+msgstr "fetch-pack: неприпуÑтиме Ð²Ð¸Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ñ–Ð½Ð´ÐµÐºÑного пакунка"
+
+#, c-format
+msgid "%s failed"
+msgstr "%s завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+msgid "error in sideband demultiplexer"
+msgstr "помилка в sideband demultiplexer"
+
+#, c-format
+msgid "Server version is %.*s"
+msgstr "ВерÑÑ–Ñ Ñервера %.*s"
+
+#, c-format
+msgid "Server supports %s"
+msgstr "Сервер підтримує %s"
+
+msgid "Server does not support shallow clients"
+msgstr "Сервер не підтримує неглибоких клієнтів"
+
+msgid "Server does not support --shallow-since"
+msgstr "Сервер не підтримує параметр --shallow-since"
+
+msgid "Server does not support --shallow-exclude"
+msgstr "Сервер не підтримує параметр --shallow-exclude"
+
+msgid "Server does not support --deepen"
+msgstr "Сервер не підтримує параметр --deepen"
+
+msgid "Server does not support this repository's object format"
+msgstr "Сервер не підтримує формат об’єктів цього Ñховища"
+
+msgid "no common commits"
+msgstr "немає Ñпільних комітів"
+
+msgid "git fetch-pack: fetch failed."
+msgstr "git fetch-pack: помилка отриманнÑ."
+
+#, c-format
+msgid "mismatched algorithms: client %s; server %s"
+msgstr "невідповідніÑÑ‚ÑŒ алгоритмів: клієнт %s; Ñервер %s"
+
+#, c-format
+msgid "the server does not support algorithm '%s'"
+msgstr "Ñервер не підтримує алгоритм \"%s\""
+
+msgid "Server does not support shallow requests"
+msgstr "Сервер не підтримує неглибокі запити"
+
+msgid "unable to write request to remote"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати запит до віддаленого Ñховища"
+
+#, c-format
+msgid "expected '%s', received '%s'"
+msgstr "очікувалоÑÑŒ \"%s\", отримано \"%s\""
+
+#, c-format
+msgid "expected '%s'"
+msgstr "очікувалоÑÑŒ \"%s\""
+
+#, c-format
+msgid "unexpected acknowledgment line: '%s'"
+msgstr "неÑподіваний Ñ€Ñдок підтвердженнÑ: \"%s\""
+
+#, c-format
+msgid "error processing acks: %d"
+msgstr "помилка при обробці підтверджень: %d"
+
+#. TRANSLATORS: The parameter will be 'ready', a protocol
+#. keyword.
+#.
+#, c-format
+msgid "expected packfile to be sent after '%s'"
+msgstr "очікувалоÑÑŒ надÑÐ¸Ð»Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° пакунка піÑÐ»Ñ \"%s\""
+
+#. TRANSLATORS: The parameter will be 'ready', a protocol
+#. keyword.
+#.
+#, c-format
+msgid "expected no other sections to be sent after no '%s'"
+msgstr "не очікувалоÑÑŒ надÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð¶Ð¾Ð´Ð½Ð¾Ñ— Ñекції Ð´Ð»Ñ ÑтатуÑу не \"%s\""
+
+#, c-format
+msgid "error processing shallow info: %d"
+msgstr "помилка при обробці неглибокої інформації: %d"
+
+#, c-format
+msgid "expected wanted-ref, got '%s'"
+msgstr "очікувалоÑÑŒ wanted-ref, отримано \"%s\""
+
+#, c-format
+msgid "unexpected wanted-ref: '%s'"
+msgstr "неÑподіване запитуване поÑиланнÑ: \"%s\""
+
+#, c-format
+msgid "error processing wanted refs: %d"
+msgstr "помилка під Ñ‡Ð°Ñ Ð¾Ð±Ñ€Ð¾Ð±ÐºÐ¸ запитуваних поÑилань: %d"
+
+msgid "git fetch-pack: expected response end packet"
+msgstr "git fetch-pack: очікувавÑÑ response end пакет"
+
+msgid "no matching remote head"
+msgstr "немає відповідного віддаленого head"
+
+msgid "unexpected 'ready' from remote"
+msgstr "неÑподіване \"ready\" з віддаленого призначеннÑ"
+
+#, c-format
+msgid "no such remote ref %s"
+msgstr "немає такого віддаленого поÑÐ¸Ð»Ð°Ð½Ð½Ñ %s"
+
+#, c-format
+msgid "Server does not allow request for unadvertised object %s"
+msgstr "Сервер заборонÑÑ” запити до неоголошених обʼєктів %s"
+
+#, c-format
+msgid "fsmonitor_ipc__send_query: invalid path '%s'"
+msgstr "fsmonitor_ipc__send_query: неприпуÑтимий шлÑÑ… \"%s\""
+
+#, c-format
+msgid "fsmonitor_ipc__send_query: unspecified error on '%s'"
+msgstr "fsmonitor_ipc__send_query: невизначена помилка на \"%s\""
+
+msgid "fsmonitor--daemon is not running"
+msgstr "fsmonitor--daemon не запущено"
+
+#, c-format
+msgid "could not send '%s' command to fsmonitor--daemon"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´Ð¿Ñ€Ð°Ð²Ð¸Ñ‚Ð¸ команду \"%s\" до fsmonitor--daemon"
+
+#, c-format
+msgid "bare repository '%s' is incompatible with fsmonitor"
+msgstr "порожнє Ñховище \"%s\" неÑуміÑне з fsmonitor"
+
+#, c-format
+msgid "repository '%s' is incompatible with fsmonitor due to errors"
+msgstr "Ñховище \"%s\" неÑуміÑне з fsmonitor через помилки"
+
+#, c-format
+msgid "remote repository '%s' is incompatible with fsmonitor"
+msgstr "віддалене Ñховище \"%s\" неÑуміÑне з fsmonitor"
+
+#, c-format
+msgid "virtual repository '%s' is incompatible with fsmonitor"
+msgstr "віртуальне Ñховище \"%s\" неÑуміÑне з fsmonitor"
+
+#, c-format
+msgid ""
+"socket directory '%s' is incompatible with fsmonitor due to lack of Unix "
+"sockets support"
+msgstr ""
+"Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ Ñокетів \"%s\" неÑуміÑна з fsmonitor через відÑутніÑÑ‚ÑŒ підтримки "
+"Ñокетів Unix"
+
+msgid ""
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
+" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
+" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
+"bare]\n"
+" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
+" [--config-env=<name>=<envvar>] <command> [<args>]"
+msgstr ""
+"git [-v | --version] [-h | --help] [-C <шлÑÑ…>] [-c <назва>=<значеннÑ>]\n"
+" [--exec-path[=<шлÑÑ…>]] [--html-path] [--man-path] [--info-path]\n"
+" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
+"bare]\n"
+" [--git-dir=<шлÑÑ…>] [--work-tree=<шлÑÑ…>] [--namespace=<назва>]\n"
+"[--config-env=<назва>=<змінна-оточеннÑ>] <команда> [<аргументи>]"
+
+msgid ""
+"'git help -a' and 'git help -g' list available subcommands and some\n"
+"concept guides. See 'git help <command>' or 'git help <concept>'\n"
+"to read about a specific subcommand or concept.\n"
+"See 'git help git' for an overview of the system."
+msgstr ""
+"\"git help -a\" Ñ– \"git help -g\" виводÑÑ‚ÑŒ доÑтупні підкоманди та деÑкі\n"
+"поÑібники з понÑÑ‚ÑŒ. ДивітьÑÑ \"git help <команда>\" або \"git help "
+"<понÑÑ‚Ñ‚Ñ>\n"
+"щоб прочитати про конкретну підкоманду або понÑÑ‚Ñ‚Ñ.\n"
+"ДивітьÑÑ \"git help git\" Ð´Ð»Ñ Ð¾Ð·Ð½Ð°Ð¹Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð· ÑиÑтемою."
+
+#, c-format
+msgid "unsupported command listing type '%s'"
+msgstr "непідтримуваний тип виводу команд \"%s\""
+
+#, c-format
+msgid "no directory given for '%s' option\n"
+msgstr "не вказано директорію Ð´Ð»Ñ \"%s\" опціі\n"
+
+#, c-format
+msgid "no namespace given for --namespace\n"
+msgstr "не вказано проÑÑ‚Ñ–Ñ€ імен Ð´Ð»Ñ --namespace\n"
+
+#, c-format
+msgid "-c expects a configuration string\n"
+msgstr "-c очікує на Ñ€Ñдок конфігурації\n"
+
+#, c-format
+msgid "no config key given for --config-env\n"
+msgstr "не вказано ключ конфігурації Ð´Ð»Ñ --config-env\n"
+
+#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "Ð´Ð»Ñ --attr-source не вказано джерело атрибутів\n"
+
+#, c-format
+msgid "unknown option: %s\n"
+msgstr "невідома опціÑ: %s\n"
+
+#, c-format
+msgid "while expanding alias '%s': '%s'"
+msgstr "під Ñ‡Ð°Ñ Ñ€Ð¾Ð·Ð³Ð¾Ñ€Ñ‚Ð°Ð½Ð½Ñ Ð¿Ñевдоніма \"%s\": \"%s\""
+
+#, c-format
+msgid ""
+"alias '%s' changes environment variables.\n"
+"You can use '!git' in the alias to do this"
+msgstr ""
+"пÑевдонім \"%s\" перемінює змінні оточеннÑ.\n"
+"Ви можете викориÑтовувати \"!git\" в пÑевдонімі Ð´Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾"
+
+#, c-format
+msgid "empty alias for %s"
+msgstr "порожній пÑевдонім Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "recursive alias: %s"
+msgstr "рекурÑивний пÑевдонім: %s"
+
+msgid "write failure on standard output"
+msgstr "помилка запиÑу в Ñтандартний вивід"
+
+msgid "unknown write failure on standard output"
+msgstr "невідома помилка запиÑу в Ñтандартний вивід"
+
+msgid "close failed on standard output"
+msgstr "не вдалоÑÑ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¸ Ñтандартний вивід"
+
+#, c-format
+msgid "alias loop detected: expansion of '%s' does not terminate:%s"
+msgstr "виÑвлено цикл пÑевдонімів: Ñ€Ð¾Ð·ÑˆÐ¸Ñ€ÐµÐ½Ð½Ñ \"%s\" не припинÑÑ”:%s"
+
+#, c-format
+msgid "cannot handle %s as a builtin"
+msgstr "неможливо обробити %s Ñк вбудовану команду"
+
+#, c-format
+msgid ""
+"usage: %s\n"
+"\n"
+msgstr "викориÑтаннÑ: %s\n"
+
+#, c-format
+msgid "expansion of alias '%s' failed; '%s' is not a git command\n"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·ÑˆÐ¸Ñ€Ð¸Ñ‚Ð¸ пÑевдонім \"%s\"; \"%s\" не Ñ” командою git\n"
+
+#, c-format
+msgid "failed to run command '%s': %s\n"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ команду \"%s\": %s\n"
+
+msgid "could not create temporary file"
+msgstr "не вдалоÑÑ Ñтворити тимчаÑовий файл"
+
+#, c-format
+msgid "failed writing detached signature to '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати відʼєднаний Ð¿Ñ–Ð´Ð¿Ð¸Ñ Ð´Ð¾ \"%s\""
+
+msgid ""
+"gpg.ssh.allowedSignersFile needs to be configured and exist for ssh "
+"signature verification"
+msgstr ""
+"gpg.ssh.allowedSignersFile має бути налаштований та Ñ–Ñнувати Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ²Ñ–Ñ€ÐºÐ¸ "
+"ssh підпиÑу"
+
+msgid ""
+"ssh-keygen -Y find-principals/verify is needed for ssh signature "
+"verification (available in openssh version 8.2p1+)"
+msgstr ""
+"ssh-keygen -Y find-principals/verify необхідно Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ²Ñ–Ñ€ÐºÐ¸ підпиÑу ssh "
+"(доÑтупно у верÑÑ–Ñ— openssh 8.2p1+)"
+
+#, c-format
+msgid "ssh signing revocation file configured but not found: %s"
+msgstr "файл ÑкаÑÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´Ð¿Ð¸Ñу ssh налаштовано, але не знайдено: %s"
+
+#, c-format
+msgid "bad/incompatible signature '%s'"
+msgstr "невірний/неÑуміÑний Ð¿Ñ–Ð´Ð¿Ð¸Ñ \"%s\""
+
+#, c-format
+msgid "failed to get the ssh fingerprint for key '%s'"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ ssh відбиток Ð´Ð»Ñ ÐºÐ»ÑŽÑ‡Ð° \"%s\""
+
+msgid ""
+"either user.signingkey or gpg.ssh.defaultKeyCommand needs to be configured"
+msgstr ""
+"потрібно налаштувати або user.signingkey, або gpg.ssh.defaultKeyCommand"
+
+#, c-format
+msgid "gpg.ssh.defaultKeyCommand succeeded but returned no keys: %s %s"
+msgstr ""
+"gpg.ssh.defaultKeyCommand команда виконалаÑÑ ÑƒÑпішно, але не повернула "
+"жодного ключа: %s %s"
+
+#, c-format
+msgid "gpg.ssh.defaultKeyCommand failed: %s %s"
+msgstr "gpg.ssh.defaultKeyCommand завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾: %s %s"
+
+#, c-format
+msgid ""
+"gpg failed to sign the data:\n"
+"%s"
+msgstr ""
+"gpg не вдалоÑÑ Ð¿Ñ–Ð´Ð¿Ð¸Ñати дані:\n"
+"%s"
+
+msgid "user.signingKey needs to be set for ssh signing"
+msgstr "user.signingKey має бути налаштований Ð´Ð»Ñ ssh підпиÑаннÑ"
+
+#, c-format
+msgid "failed writing ssh signing key to '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати ssh ключ підпиÑу до \"%s\""
+
+#, c-format
+msgid "failed writing ssh signing key buffer to '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати буфер ssh ключа підпиÑу в \"%s\""
+
+msgid ""
+"ssh-keygen -Y sign is needed for ssh signing (available in openssh version "
+"8.2p1+)"
+msgstr ""
+"ssh-keygen -Y знак потрібен Ð´Ð»Ñ ssh підпиÑÐ°Ð½Ð½Ñ (доÑтупно у openssh верÑÑ–Ñ— "
+"8.2p1+)"
+
+#, c-format
+msgid "failed reading ssh signing data buffer from '%s'"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ буфер даних ssh підпиÑÐ°Ð½Ð½Ñ Ð· \"%s\""
+
+#, c-format
+msgid "ignored invalid color '%.*s' in log.graphColors"
+msgstr "проігноровано неприпуÑтимий колір \"%.*s\" у log.graphColors"
+
+msgid ""
+"given pattern contains NULL byte (via -f <file>). This is only supported "
+"with -P under PCRE v2"
+msgstr ""
+"заданий шаблон міÑтить NULL байт (через -f <файл>). Це підтримуєтьÑÑ Ð»Ð¸ÑˆÐµ з "
+"опцією -P у PCRE v2"
+
+#, c-format
+msgid "'%s': unable to read %s"
+msgstr "\"%s\": не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ %s"
+
+#, c-format
+msgid "'%s': short read"
+msgstr "\"%s\": помилка ÑчитуваннÑ"
+
+msgid "start a working area (see also: git help tutorial)"
+msgstr "запуÑтити робочу облаÑÑ‚ÑŒ (дивітьÑÑ Ñ‚Ð°ÐºÐ¾Ð¶: git help tutorial)"
+
+msgid "work on the current change (see also: git help everyday)"
+msgstr "працювати над поточними змінами (дивітьÑÑ Ñ‚Ð°ÐºÐ¾Ð¶: git help everyday)"
+
+msgid "examine the history and state (see also: git help revisions)"
+msgstr "переглÑнути Ñ–Ñторію та Ñтан (дивітьÑÑ Ñ‚Ð°ÐºÐ¾Ð¶: git help revisions)"
+
+msgid "grow, mark and tweak your common history"
+msgstr "розвивати, позначати та підправлÑти вашу Ñпільну Ñ–Ñторію"
+
+msgid "collaborate (see also: git help workflows)"
+msgstr "Ñпівпрацювати (дивітьÑÑ Ñ‚Ð°ÐºÐ¾Ð¶: git help workflows)"
+
+msgid "Main Porcelain Commands"
+msgstr "ОÑновні виÑокорівневі команди"
+
+msgid "Ancillary Commands / Manipulators"
+msgstr "Допоміжні команди / МаніпулÑтори"
+
+msgid "Ancillary Commands / Interrogators"
+msgstr "Допоміжні команди / Допитувачі"
+
+msgid "Interacting with Others"
+msgstr "Ð’Ð·Ð°Ñ”Ð¼Ð¾Ð´Ñ–Ñ Ð· іншими"
+
+msgid "Low-level Commands / Manipulators"
+msgstr "Ðизькорівневі команди / МаніпулÑтори"
+
+msgid "Low-level Commands / Interrogators"
+msgstr "Ðизькорівневі команди / Допитувачі"
+
+msgid "Low-level Commands / Syncing Repositories"
+msgstr "Ðизькорівневі команди / Сховища Ñинхронізації"
+
+msgid "Low-level Commands / Internal Helpers"
+msgstr "Ðизькорівневі команди / Внутрішні помічники"
+
+msgid "User-facing repository, command and file interfaces"
+msgstr "ІнтерфейÑи кориÑтувача Ð´Ð»Ñ Ñховищ, команд та файлів"
+
+msgid "Developer-facing file formats, protocols and other interfaces"
+msgstr "Формати файлів, протоколи та інші інтерфейÑи розробника"
+
+#, c-format
+msgid "available git commands in '%s'"
+msgstr "доÑтупні команди git в \"%s\""
+
+msgid "git commands available from elsewhere on your $PATH"
+msgstr "команди git доÑтупні з будь-Ñкого міÑÑ†Ñ Ð½Ð° вашому $PATH"
+
+msgid "These are common Git commands used in various situations:"
+msgstr "Це загальні команди Git, Ñкі викориÑтовуютьÑÑ Ð² різних ÑитуаціÑÑ…:"
+
+msgid "The Git concept guides are:"
+msgstr "ПоÑібники з понÑÑ‚ÑŒ Git:"
+
+msgid "User-facing repository, command and file interfaces:"
+msgstr "ІнтерфейÑи кориÑтувача Ð´Ð»Ñ Ñховищ, команд та файлів:"
+
+msgid "File formats, protocols and other developer interfaces:"
+msgstr "Формати файлів, протоколи та інші інтерфейÑи розробника:"
+
+msgid "External commands"
+msgstr "Зовнішні команди"
+
+msgid "Command aliases"
+msgstr "ПÑевдоніми команд"
+
+msgid "See 'git help <command>' to read about a specific subcommand"
+msgstr ""
+"ДивітьÑÑ \"git help <команда>\", щоб прочитати про конкретну підкоманду"
+
+#, c-format
+msgid ""
+"'%s' appears to be a git command, but we were not\n"
+"able to execute it. Maybe git-%s is broken?"
+msgstr ""
+"Схоже, що \"%s\" є git командою, але ми не змогли\n"
+"виконати її. Можливо, git-%s не працює?"
+
+#, c-format
+msgid "git: '%s' is not a git command. See 'git --help'."
+msgstr "git: \"%s\" не Ñ” командою git. Ð”Ð¸Ð²Ñ–Ñ‚ÑŒÑ git --help."
+
+msgid "Uh oh. Your system reports no Git commands at all."
+msgstr "Ой-ой. Ваша ÑиÑтема повідомлÑÑ” про повну відÑутніÑÑ‚ÑŒ Git команд."
+
+#, c-format
+msgid "WARNING: You called a Git command named '%s', which does not exist."
+msgstr "ПОПЕРЕДЖЕÐÐЯ: Ви викликали Git команду \"%s\", Ñкої не Ñ–Ñнує."
+
+#, c-format
+msgid "Continuing under the assumption that you meant '%s'."
+msgstr "Продовжую, припуÑкаючи, що ви мали на увазі \"%s\"."
+
+#, c-format
+msgid "Run '%s' instead [y/N]? "
+msgstr "ЗапуÑтити натоміÑÑ‚ÑŒ \"%s\" [y/N]? "
+
+#, c-format
+msgid "Continuing in %0.1f seconds, assuming that you meant '%s'."
+msgstr "Продовжую через %0.1f Ñекунд, припуÑкаючи, що ви мали на увазі \"%s\"."
+
+msgid ""
+"\n"
+"The most similar command is"
+msgid_plural ""
+"\n"
+"The most similar commands are"
+msgstr[0] ""
+"\n"
+"Ðайбільш Ñхожою командою Ñ”"
+msgstr[1] ""
+"\n"
+"Ðайбільш Ñхожими командами Ñ”"
+msgstr[2] ""
+"\n"
+"Ðайбільш Ñхожими командами Ñ”"
+
+msgid "git version [--build-options]"
+msgstr "git верÑÑ–Ñ [--build-options]"
+
+#, c-format
+msgid "%s: %s - %s"
+msgstr "%s: %s - %s"
+
+msgid ""
+"\n"
+"Did you mean this?"
+msgid_plural ""
+"\n"
+"Did you mean one of these?"
+msgstr[0] ""
+"\n"
+"Ви це мали на увазі?"
+msgstr[1] ""
+"\n"
+"Ви мали на увазі одну з цих?"
+msgstr[2] ""
+"\n"
+"Ви мали на увазі одну з цих?"
+
+#, c-format
+msgid ""
+"The '%s' hook was ignored because it's not set as executable.\n"
+"You can disable this warning with `git config advice.ignoredHook false`."
+msgstr ""
+"Гачок \"%s\" було проігноровано, оÑкільки він не визначений Ñк виконуваний.\n"
+"Ви можете вимкнути це Ð¿Ð¾Ð¿ÐµÑ€ÐµÐ´Ð¶ÐµÐ½Ð½Ñ Ð·Ð° допомогою \"git config advice."
+"ignoredHook false\"."
+
+#, c-format
+msgid "argument to --packfile must be a valid hash (got '%s')"
+msgstr "аргумент до --packfile має бути коректним хешем (отримано \"%s\")"
+
+msgid "not a git repository"
+msgstr "не Ñ” git Ñховищем"
+
+#, c-format
+msgid "negative value for http.postBuffer; defaulting to %d"
+msgstr ""
+"відʼємне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ http.postBuffer; зміна до Ð·Ð½Ð°Ñ‡ÐµÐ½Ñ Ð·Ð° замовчуваннÑм %d"
+
+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 "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 обробники:"
+
+#, c-format
+msgid "Could not set SSL backend to '%s': cURL was built without SSL backends"
+msgstr ""
+"Ðе вдалоÑÑ Ð²Ñтановити SSL обробник в \"%s\": cURL було зібрано без підтримки "
+"SSL обробників"
+
+#, c-format
+msgid "Could not set SSL backend to '%s': already set"
+msgstr "Ðе вдалоÑÑ Ð²Ñтановити SSL обробник в \"%s\": вже вÑтановлено"
+
+#, c-format
+msgid ""
+"unable to update url base from redirection:\n"
+" asked for: %s\n"
+" redirect: %s"
+msgstr ""
+"не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ базу url з перенаправленнÑ:\n"
+" запитували: %s\n"
+" перенаправленнÑ: %s"
+
+msgid "Author identity unknown\n"
+msgstr "ОÑобиÑÑ‚Ñ–ÑÑ‚ÑŒ автора невідома\n"
+
+msgid "Committer identity unknown\n"
+msgstr "ОÑобиÑÑ‚Ñ–ÑÑ‚ÑŒ комітера невідома\n"
+
+msgid ""
+"\n"
+"*** Please tell me who you are.\n"
+"\n"
+"Run\n"
+"\n"
+" git config --global user.email \"you@example.com\"\n"
+" git config --global user.name \"Your Name\"\n"
+"\n"
+"to set your account's default identity.\n"
+"Omit --global to set the identity only in this repository.\n"
+"\n"
+msgstr ""
+"\n"
+"*** Будь лаÑка, Ñкажіть мені, хто ви.\n"
+"\n"
+"Виконайте\n"
+"\n"
+" git config --global user.email \"you@example.com\"\n"
+" git config --global user.name \"Ваше ІмʼÑ\"\n"
+"\n"
+"щоб вÑтановити оÑобиÑÑ‚Ñ–ÑÑ‚ÑŒ акаунту за замовчуваннÑм.\n"
+"ПропуÑÑ‚Ñ–Ñ‚ÑŒ --global, щоб вÑтановити оÑобиÑÑ‚Ñ–ÑÑ‚ÑŒ лише Ð´Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ Ñховища.\n"
+
+msgid "no email was given and auto-detection is disabled"
+msgstr "не вказана адреÑа електронної пошти Ñ– автоматичне Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð¸Ð¼ÐºÐ½ÐµÐ½Ð¾"
+
+#, c-format
+msgid "unable to auto-detect email address (got '%s')"
+msgstr ""
+"не вдалоÑÑ Ð°Ð²Ñ‚Ð¾Ð¼Ð°Ñ‚Ð¸Ñ‡Ð½Ð¾ визначити адреÑу електронної пошти (отримано \"%s\")"
+
+msgid "no name was given and auto-detection is disabled"
+msgstr "Ñ–Ð¼Ê¼Ñ Ð½Ðµ вказано Ñ– автоматичне Ð²Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð¸Ð¼ÐºÐ½ÐµÐ½Ð¾"
+
+#, c-format
+msgid "unable to auto-detect name (got '%s')"
+msgstr "не вдалоÑÑ Ð°Ð²Ñ‚Ð¾Ð¼Ð°Ñ‚Ð¸Ñ‡Ð½Ð¾ визначити назву (отримано \"%s\")"
+
+#, c-format
+msgid "empty ident name (for <%s>) not allowed"
+msgstr "порожнє Ñ–Ð¼Ê¼Ñ Ð¾ÑобиÑтоÑÑ‚Ñ– (Ð´Ð»Ñ <%s>) заборонено"
+
+#, c-format
+msgid "name consists only of disallowed characters: %s"
+msgstr "Ñ–Ð¼Ê¼Ñ ÑкладаєтьÑÑ Ð»Ð¸ÑˆÐµ з заборонених Ñимволів: %s"
+
+msgid "expected 'tree:<depth>'"
+msgstr "очікувалоÑÑŒ \"tree:<глибина>\""
+
+msgid "sparse:path filters support has been dropped"
+msgstr "підтримку фільтрів sparse:path було припинено"
+
+#, c-format
+msgid "'%s' for 'object:type=<type>' is not a valid object type"
+msgstr "\"%s\" Ð´Ð»Ñ \"object:type=<type>\" не Ñ” припуÑтимим типом обʼєкта"
+
+#, c-format
+msgid "invalid filter-spec '%s'"
+msgstr "неприпуÑтимий визначник фільтра \"%s\""
+
+#, c-format
+msgid "must escape char in sub-filter-spec: '%c'"
+msgstr "необхідно екранувати Ñимвол у sub-filter-spec: \"%c\""
+
+msgid "expected something after combine:"
+msgstr "щоcÑŒ очікувалоÑÑŒ піÑÐ»Ñ ÐºÐ¾Ð¼Ð±Ñ–Ð½ÑƒÐ²Ð°Ð½Ð½Ñ:"
+
+msgid "multiple filter-specs cannot be combined"
+msgstr "не можна комбінувати кілька визначників фільтра"
+
+msgid "unable to upgrade repository format to support partial clone"
+msgstr "не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ формат Ñховища Ð´Ð»Ñ Ð¿Ñ–Ð´Ñ‚Ñ€Ð¸Ð¼ÐºÐ¸ чаÑткового клонуваннÑ"
+
+msgid "args"
+msgstr "аргументи"
+
+msgid "object filtering"
+msgstr "Ñ„Ñ–Ð»ÑŒÑ‚Ñ€Ð°Ñ†Ñ–Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ñ–Ð²"
+
+#, c-format
+msgid "unable to access sparse blob in '%s'"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ доÑтуп до розрідженого blob в \"%s\""
+
+#, c-format
+msgid "unable to parse sparse filter data in %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ дані розрідженого фільтра в %s"
+
+#, c-format
+msgid "entry '%s' in tree %s has tree mode, but is not a tree"
+msgstr "Ð·Ð°Ð¿Ð¸Ñ \"%s\" у дереві %s має режим tree, але не Ñ” деревом"
+
+#, c-format
+msgid "entry '%s' in tree %s has blob mode, but is not a blob"
+msgstr "Ð·Ð°Ð¿Ð¸Ñ \"%s\" у дереві %s має режим blob, але не Ñ” blob"
+
+#, c-format
+msgid "unable to load root tree for commit %s"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ кореневе дерево Ð´Ð»Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ %s"
+
+#, c-format
+msgid ""
+"Unable to create '%s.lock': %s.\n"
+"\n"
+"Another git process seems to be running in this repository, e.g.\n"
+"an editor opened by 'git commit'. Please make sure all processes\n"
+"are terminated then try again. If it still fails, a git process\n"
+"may have crashed in this repository earlier:\n"
+"remove the file manually to continue."
+msgstr ""
+"Ðе вдалоÑÑ Ñтворити \"%s.lock\": %s.\n"
+"\n"
+"Схоже, у цьому Ñховищі запущено інший git процеÑ, наприклад\n"
+"редактор, відкритий командою \"git commit\". Будь лаÑка, переконайтеÑÑ, що "
+"вÑÑ– процеÑи\n"
+"завершено, а потім Ñпробуйте ще раз. Якщо вÑе одно не вдаÑÑ‚ÑŒÑÑ, можливо, "
+"раніше \n"
+"у цьому Ñховищі аварійно завершивÑÑ git процеÑ:\n"
+"видаліть файл вручну, щоб продовжити."
+
+#, c-format
+msgid "Unable to create '%s.lock': %s"
+msgstr "Ðе вдалоÑÑ Ñтворити \"%s.lock\": %s"
+
+#, c-format
+msgid "unexpected line: '%s'"
+msgstr "неочікуваний Ñ€Ñдок: \"%s\""
+
+msgid "expected flush after ls-refs arguments"
+msgstr "очікувавÑÑ flush піÑÐ»Ñ ls-refs аргументів"
+
+msgid "quoted CRLF detected"
+msgstr "виÑвлено цитований CRLF"
+
+#, c-format
+msgid "Failed to merge submodule %s (not checked out)"
+msgstr "Ðе вдалоÑÑ Ð¾Ð±Ê¼Ñ”Ð´Ð½Ð°Ñ‚Ð¸ підмодуль %s (не активне)"
+
+#, c-format
+msgid "Failed to merge submodule %s (no merge base)"
+msgstr "Ðе вдалоÑÑ Ð·Ð»Ð¸Ñ‚Ð¸ підмодуль %s (немає бази злиттÑ)"
+
+#, c-format
+msgid "Failed to merge submodule %s (commits not present)"
+msgstr "Ðе вдалоÑÑ Ð·Ð»Ð¸Ñ‚Ð¸ підмодуль %s (відÑутні коміти)"
+
+#, c-format
+msgid "Failed to merge submodule %s (commits don't follow merge-base)"
+msgstr "Ðе вдалоÑÑ Ð·Ð»Ð¸Ñ‚Ð¸ підмодуль %s (коміти не відповідають базі)"
+
+#, c-format
+msgid "Note: Fast-forwarding submodule %s to %s"
+msgstr "Примітка: Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ %s вперед до %s"
+
+#, c-format
+msgid "Failed to merge submodule %s"
+msgstr "Ðе вдалоÑÑ Ð·Ð»Ð¸Ñ‚Ð¸ підмодуль %s"
+
+#, c-format
+msgid ""
+"Failed to merge submodule %s, but a possible merge resolution exists: %s"
+msgstr "Ðе вдалоÑÑ Ð·Ð»Ð¸Ñ‚Ð¸ підмодуль %s, але Ñ–Ñнує можливе Ð²Ð¸Ñ€Ñ–ÑˆÐµÐ½Ð½Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ: %s"
+
+#, c-format
+msgid ""
+"Failed to merge submodule %s, but multiple possible merges exist:\n"
+"%s"
+msgstr ""
+"Ðе вдалоÑÑ Ð·Ð»Ð¸Ñ‚Ð¸ підмодуль %s, але Ñ–Ñнує кілька можливих варіантів злиттÑ:\n"
+"%s"
+
+msgid "failed to execute internal merge"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ внутрішнє злиттÑ"
+
+#, c-format
+msgid "unable to add %s to database"
+msgstr "не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ %s до бази даних"
+
+#, c-format
+msgid "Auto-merging %s"
+msgstr "Ðвтоматичне Ð·Ð»Ð¸Ñ‚Ñ‚Ñ %s"
+
+#, c-format
+msgid ""
+"CONFLICT (implicit dir rename): Existing file/dir at %s in the way of "
+"implicit directory rename(s) putting the following path(s) there: %s."
+msgstr ""
+"КОÐФЛІКТ (неÑвне Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ñƒ): Ñ–Ñнуючий файл/Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ Ð² %s "
+"заважає неÑвному перейменуванню директорії, додавши наÑтупні шлÑхи до: %s."
+
+#, c-format
+msgid ""
+"CONFLICT (implicit dir rename): Cannot map more than one path to %s; "
+"implicit directory renames tried to put these paths there: %s"
+msgstr ""
+"КОÐФЛІКТ (неÑвне Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ—): Ðеможливо зіÑтавити більше "
+"одного шлÑху з %s; неÑвне Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ð¹ намагалоÑÑ Ð¿Ð¾Ð¼Ñ–Ñтити "
+"туди ці шлÑхи: %s"
+
+#, c-format
+msgid ""
+"CONFLICT (directory rename split): Unclear where to rename %s to; it was "
+"renamed to multiple other directories, with no destination getting a "
+"majority of the files."
+msgstr ""
+"КОÐФЛІКТ (розбіжніÑÑ‚ÑŒ під Ñ‡Ð°Ñ Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ—): ÐеÑÑно, Ñк "
+"перейменувати директорію %s; її було перейменовано в кілька інших "
+"директорій, жодна з Ñких не отримала більшоÑÑ‚Ñ– файлів."
+
+#, c-format
+msgid ""
+"WARNING: Avoiding applying %s -> %s rename to %s, because %s itself was "
+"renamed."
+msgstr ""
+"ПОПЕРЕДЖЕÐÐЯ: ÑƒÐ½Ð¸ÐºÐ½ÐµÐ½Ð½Ñ Ð·Ð°ÑтоÑÑƒÐ²Ð°Ð½Ð½Ñ %s -> %s Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð° %s, оÑкільки "
+"%s було перейменовано."
+
+#, c-format
+msgid ""
+"Path updated: %s added in %s inside a directory that was renamed in %s; "
+"moving it to %s."
+msgstr ""
+"ШлÑÑ… було оновлено: %s додано до %s вÑередині директорії, Ñку було "
+"перейменовано в %s; Ð¿ÐµÑ€ÐµÐ¼Ñ–Ñ‰ÐµÐ½Ð½Ñ Ð´Ð¾ %s."
+
+#, c-format
+msgid ""
+"Path updated: %s renamed to %s in %s, inside a directory that was renamed in "
+"%s; moving it to %s."
+msgstr ""
+"ШлÑÑ… було оновлено: %s перейменовано на %s в %s, вÑередині директорії, Ñку "
+"було перейменовано в %s; Ð¿ÐµÑ€ÐµÐ¼Ñ–Ñ‰ÐµÐ½Ð½Ñ Ð´Ð¾ %s."
+
+#, c-format
+msgid ""
+"CONFLICT (file location): %s added in %s inside a directory that was renamed "
+"in %s, suggesting it should perhaps be moved to %s."
+msgstr ""
+"КОÐФЛІКТ (Ñ€Ð¾Ð·Ñ‚Ð°ÑˆÑƒÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñƒ): %s додано до %s вÑередині директорії, Ñку "
+"було перейменовано в %s, що Ñвідчить про те, що його Ñлід переміÑтити до %s."
+
+#, c-format
+msgid ""
+"CONFLICT (file location): %s renamed to %s in %s, inside a directory that "
+"was renamed in %s, suggesting it should perhaps be moved to %s."
+msgstr ""
+"КОÐФЛІКТ (Ñ€Ð¾Ð·Ñ‚Ð°ÑˆÑƒÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñƒ): %s перейменовано на %s в %s вÑередині "
+"директорії, Ñку було перейменовано в %s, що Ñвідчить про те, що його Ñлід "
+"переміÑтити до %s."
+
+#, c-format
+msgid "CONFLICT (rename/rename): %s renamed to %s in %s and to %s in %s."
+msgstr ""
+"КОÐФЛІКТ (перейменовано/перейменовано): %s перейменовано на %s в %s та на %s "
+"в %s."
+
+#, c-format
+msgid ""
+"CONFLICT (rename involved in collision): rename of %s -> %s has content "
+"conflicts AND collides with another path; this may result in nested conflict "
+"markers."
+msgstr ""
+"КОÐФЛІКТ (Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ñ€Ð¸Ð·Ð²ÐµÐ»Ð¾ до колізії): Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ %s -> %s має "
+"конфлікт вміÑту та зіткаєтьÑÑ Ð· іншим шлÑхом; це може призвеÑти до поÑви "
+"вкладених маркерів конфлікту."
+
+#, c-format
+msgid "CONFLICT (rename/delete): %s renamed to %s in %s, but deleted in %s."
+msgstr ""
+"КОÐФЛІКТ (перейменовано/видалено): %s перейменовано на %s в %s, але видалено "
+"в %s."
+
+#, c-format
+msgid "cannot read object %s"
+msgstr "неможливо прочитати обʼєкт %s"
+
+#, c-format
+msgid "object %s is not a blob"
+msgstr "обʼєкт %s не є blob"
+
+#, c-format
+msgid ""
+"CONFLICT (file/directory): directory in the way of %s from %s; moving it to "
+"%s instead."
+msgstr ""
+"КОÐФЛІКТ (файл/директоріÑ): Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ Ð½Ð° шлÑху %s від %s; Ð¿ÐµÑ€ÐµÐ¼Ñ–Ñ‰ÐµÐ½Ð½Ñ Ñ—Ñ— до "
+"%s заміÑÑ‚ÑŒ цього."
+
+#, c-format
+msgid ""
+"CONFLICT (distinct types): %s had different types on each side; renamed both "
+"of them so each can be recorded somewhere."
+msgstr ""
+"КОÐФЛІКТ (різні типи): %s мали різні типи з обох боків; перейменовано "
+"обидва, щоб кожен можна було деÑÑŒ запиÑати."
+
+#, c-format
+msgid ""
+"CONFLICT (distinct types): %s had different types on each side; renamed one "
+"of them so each can be recorded somewhere."
+msgstr ""
+"КОÐФЛІКТ (різні типи): %s мали різні типи з обох боків; перейменовано один з "
+"них, щоб кожен можна було деÑÑŒ запиÑати."
+
+msgid "content"
+msgstr "вміÑÑ‚"
+
+msgid "add/add"
+msgstr "додано/додано"
+
+msgid "submodule"
+msgstr "підмодуль"
+
+#, c-format
+msgid "CONFLICT (%s): Merge conflict in %s"
+msgstr "КОÐФЛІКТ (%s): конфлікт Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð² %s"
+
+#, c-format
+msgid ""
+"CONFLICT (modify/delete): %s deleted in %s and modified in %s. Version %s "
+"of %s left in tree."
+msgstr ""
+"КОÐФЛІКТ (змінено/видалено): %s видалено в %s та змінено в %s. ВерÑÑ–ÑŽ %s з "
+"%s залишено у дереві."
+
+#. TRANSLATORS: This is a line of advice to resolve a merge
+#. conflict in a submodule. The first argument is the submodule
+#. name, and the second argument is the abbreviated id of the
+#. commit that needs to be merged. For example:
+#. - go to submodule (mysubmodule), and either merge commit abc1234"
+#.
+#, c-format
+msgid ""
+" - go to submodule (%s), and either merge commit %s\n"
+" or update to an existing commit which has merged those changes\n"
+msgstr ""
+" - перейдіть до Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ (%s), щоб або злити коміт %s\n"
+" або оновитиÑÑŒ до Ñ–Ñнуючого коміту, в Ñкому ці зміни вже злиті\n"
+
+#, c-format
+msgid ""
+"Recursive merging with submodules currently only supports trivial cases.\n"
+"Please manually handle the merging of each conflicted submodule.\n"
+"This can be accomplished with the following steps:\n"
+"%s - come back to superproject and run:\n"
+"\n"
+" git add %s\n"
+"\n"
+" to record the above merge or update\n"
+" - resolve any other conflicts in the superproject\n"
+" - commit the resulting index in the superproject\n"
+msgstr ""
+"РекурÑивне Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð· підмодулÑми наразі підтримує лише тривіальні випадки.\n"
+"Будь лаÑка, обробіть Ð·Ð»Ð¸Ñ‚Ñ‚Ñ ÐºÐ¾Ð¶Ð½Ð¾Ð³Ð¾ конфліктного Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ Ð²Ñ€ÑƒÑ‡Ð½Ñƒ.\n"
+"Це можна зробити за допомогою наÑтупних кроків:\n"
+"%s - повернітьÑÑ Ð´Ð¾ Ñуперпроекту Ñ– виконайте:\n"
+"\n"
+" git add %s\n"
+"\n"
+" щоб запиÑати вищезгадане Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð°Ð±Ð¾ оновленнÑ\n"
+"- розвʼÑжіть будь-Ñкі інші конфлікти в Ñуперпроекті\n"
+"- зробіть коміт підÑумкового індекÑа в Ñуперпроекті\n"
+
+#. TRANSLATORS: The %s arguments are: 1) tree hash of a merge
+#. base, and 2-3) the trees for the two trees we're merging.
+#.
+#, c-format
+msgid "collecting merge info failed for trees %s, %s, %s"
+msgstr "Ð·Ð±Ð¸Ñ€Ð°Ð½Ð½Ñ Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ— про Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ðµ вдалоÑÑ Ð´Ð»Ñ Ð´ÐµÑ€ÐµÐ² %s, %s, %s"
+
+msgid "(bad commit)\n"
+msgstr "(невірний коміт)\n"
+
+#, c-format
+msgid "add_cacheinfo failed for path '%s'; merge aborting."
+msgstr "невдала Ñпроба add_cacheinfo Ð´Ð»Ñ ÑˆÐ»Ñху \"%s\"; Ð¿ÐµÑ€ÐµÑ€Ð¸Ð²Ð°Ð½Ð½Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ."
+
+#, c-format
+msgid "add_cacheinfo failed to refresh for path '%s'; merge aborting."
+msgstr ""
+"процеÑу add_cacheinfo не вдалоÑÑ Ð·Ñ€Ð¾Ð±Ð¸Ñ‚Ð¸ Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð´Ð»Ñ ÑˆÐ»Ñху \"%s\"; "
+"Ð¿ÐµÑ€ÐµÑ€Ð¸Ð²Ð°Ð½Ð½Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ."
+
+#, c-format
+msgid "failed to create path '%s'%s"
+msgstr "не вдалоÑÑ Ñтворити шлÑÑ… \"%s\"%s"
+
+#, c-format
+msgid "Removing %s to make room for subdirectory\n"
+msgstr "Ð’Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ %s, щоб звільнити міÑце Ð´Ð»Ñ Ð¿Ñ–Ð´Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ—\n"
+
+msgid ": perhaps a D/F conflict?"
+msgstr ": можливо, D/F конфлікт?"
+
+#, c-format
+msgid "refusing to lose untracked file at '%s'"
+msgstr "відмовлено у втраті невідÑтежуваного файла \"%s\""
+
+#, c-format
+msgid "blob expected for %s '%s'"
+msgstr "blob очікуєтьÑÑ Ð´Ð»Ñ %s \"%s\""
+
+#, c-format
+msgid "failed to open '%s': %s"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ \"%s\": %s"
+
+#, c-format
+msgid "failed to symlink '%s': %s"
+msgstr "не вдалоÑÑ Ð·Ñ€Ð¾Ð±Ð¸Ñ‚Ð¸ Ñимвольне поÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\": %s"
+
+#, c-format
+msgid "do not know what to do with %06o %s '%s'"
+msgstr "не знаю, що робити з %06o %s \"%s\""
+
+#, c-format
+msgid "Fast-forwarding submodule %s to the following commit:"
+msgstr "ÐŸÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ %s вперед до наÑтупного коміту:"
+
+#, c-format
+msgid "Fast-forwarding submodule %s"
+msgstr "ÐŸÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ %s вперед"
+
+#, c-format
+msgid "Failed to merge submodule %s (merge following commits not found)"
+msgstr "Ðе вдалоÑÑ Ð·Ð»Ð¸Ñ‚Ð¸ підмодуль %s (Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ð°Ñтупних комітів не знайдено)"
+
+#, c-format
+msgid "Failed to merge submodule %s (not fast-forward)"
+msgstr "Ðе вдалоÑÑ Ð·Ð»Ð¸Ñ‚Ð¸ підмодуль %s (не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚Ð°Ñ‚Ð¸ вперед)"
+
+msgid "Found a possible merge resolution for the submodule:\n"
+msgstr "Знайдено можливе Ð²Ð¸Ñ€Ñ–ÑˆÐµÐ½Ð½Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ:\n"
+
+#, c-format
+msgid ""
+"If this is correct simply add it to the index for example\n"
+"by using:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"which will accept this suggestion.\n"
+msgstr ""
+"Якщо вÑе вірно, проÑто додайте це до індекÑу, наприклад,\n"
+"викориÑтавши:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"Ñкий прийме цю пропозицію.\n"
+
+#, c-format
+msgid "Failed to merge submodule %s (multiple merges found)"
+msgstr "Ðе вдалоÑÑ Ð·Ð»Ð¸Ñ‚Ð¸ підмодуль %s (знайдено більше одного злиттÑ)"
+
+#, c-format
+msgid "Error: Refusing to lose untracked file at %s; writing to %s instead."
+msgstr ""
+"Помилка: відмовлено у втраті невідÑтежуваного файла %s; натоміÑÑ‚ÑŒ запиÑуємо "
+"до %s."
+
+#, c-format
+msgid ""
+"CONFLICT (%s/delete): %s deleted in %s and %s in %s. Version %s of %s left "
+"in tree."
+msgstr ""
+"КОÐФЛІКТ (%s/видалено): %s видалено в %s та %s в %s. ВерÑÑ–ÑŽ %s з %s залишено "
+"в дереві."
+
+#, c-format
+msgid ""
+"CONFLICT (%s/delete): %s deleted in %s and %s to %s in %s. Version %s of %s "
+"left in tree."
+msgstr ""
+"КОÐФЛІКТ (%s/видалено): %s видалено в %s Ñ– %s в %s в %s. ВерÑÑ–ÑŽ %s з %s "
+"залишено у дереві."
+
+#, c-format
+msgid ""
+"CONFLICT (%s/delete): %s deleted in %s and %s in %s. Version %s of %s left "
+"in tree at %s."
+msgstr ""
+"КОÐФЛІКТ (%s/видалено): %s видалено в %s Ñ– %s в %s. ВерÑÑ–ÑŽ %s з %s залишено "
+"у дереві в %s."
+
+#, c-format
+msgid ""
+"CONFLICT (%s/delete): %s deleted in %s and %s to %s in %s. Version %s of %s "
+"left in tree at %s."
+msgstr ""
+"КОÐФЛІКТ (%s/видалено): %s видалено в %s Ñ– %s в %s в %s. ВерÑÑ–ÑŽ %s з %s "
+"залишено в дереві в %s."
+
+msgid "rename"
+msgstr "перейменувати"
+
+msgid "renamed"
+msgstr "перейменовано"
+
+#, c-format
+msgid "Refusing to lose dirty file at %s"
+msgstr "Відмовлено у втраті брудного файла %s"
+
+#, c-format
+msgid "Refusing to lose untracked file at %s, even though it's in the way."
+msgstr ""
+"Відмовлено у втраті невідÑтежуваного файла %s, не дивлÑчиÑÑŒ на те, що він "
+"знаходитьÑÑ Ð½Ð° шлÑху."
+
+#, c-format
+msgid "CONFLICT (rename/add): Rename %s->%s in %s. Added %s in %s"
+msgstr ""
+"КОÐФЛІКТ (перейменовано/додано): перейменовано %s->%s в %s. Додано %s в %s"
+
+#, c-format
+msgid "%s is a directory in %s adding as %s instead"
+msgstr "%s Ñ” директорією в %s, натоміÑÑ‚ÑŒ додаємо Ñк %s"
+
+#, c-format
+msgid "Refusing to lose untracked file at %s; adding as %s instead"
+msgstr "Відмовлено у втраті невідÑтежуваного файла %s; натоміÑÑ‚ÑŒ додаємо Ñк %s"
+
+#, c-format
+msgid ""
+"CONFLICT (rename/rename): Rename \"%s\"->\"%s\" in branch \"%s\" rename "
+"\"%s\"->\"%s\" in \"%s\"%s"
+msgstr ""
+"КОÐФЛІКТ (перейменовано/перейменовано): перейменовано \"%s\"->\"%s\" у гілці "
+"\"%s\" перейменовано \"%s\"->\"%s\" у \"%s\"%s"
+
+msgid " (left unresolved)"
+msgstr " (залишилоÑÑ Ð½ÐµÑ€Ð¾Ð·Ð²Ê¼Ñзаним)"
+
+#, c-format
+msgid "CONFLICT (rename/rename): Rename %s->%s in %s. Rename %s->%s in %s"
+msgstr ""
+"КОÐФЛІКТ (перейменовано/перейменовано): перейменовано %s->%s в %s. "
+"Перейменовано %s->%s в %s"
+
+#, c-format
+msgid ""
+"CONFLICT (directory rename split): Unclear where to place %s because "
+"directory %s was renamed to multiple other directories, with no destination "
+"getting a majority of the files."
+msgstr ""
+"КОÐФЛІКТ (розбіжніÑÑ‚ÑŒ під Ñ‡Ð°Ñ Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ—): ÐеÑÑно, куди "
+"поміÑтити %s, оÑкільки директорію %s було перейменовано в кілька інших "
+"директорій, жодна з Ñких не отримала більшоÑÑ‚Ñ– файлів."
+
+#, c-format
+msgid ""
+"CONFLICT (rename/rename): Rename directory %s->%s in %s. Rename directory %s-"
+">%s in %s"
+msgstr ""
+"КОÐФЛІКТ (перейменовано/перейменовано): перейменовано директорію %s->%s в "
+"%s. Перейменовано директорію %s->%s в %s"
+
+msgid "modify"
+msgstr "змінити"
+
+msgid "modified"
+msgstr "змінено"
+
+#, c-format
+msgid "Skipped %s (merged same as existing)"
+msgstr "Пропущено %s (злите - те Ñаме, що й Ñ–Ñнуюче)"
+
+#, c-format
+msgid "Adding as %s instead"
+msgstr "Ð”Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ñк %s заміÑÑ‚ÑŒ цього"
+
+#, c-format
+msgid "Removing %s"
+msgstr "Ð’Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ %s"
+
+msgid "file/directory"
+msgstr "файл/директоріÑ"
+
+msgid "directory/file"
+msgstr "директоріÑ/файл"
+
+#, c-format
+msgid "CONFLICT (%s): There is a directory with name %s in %s. Adding %s as %s"
+msgstr "КОÐФЛІКТ (%s): в %s Ñ–Ñнує Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ Ð· іменем %s. Ð”Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ %s Ñк %s"
+
+#, c-format
+msgid "Adding %s"
+msgstr "Ð”Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ %s"
+
+#, c-format
+msgid "CONFLICT (add/add): Merge conflict in %s"
+msgstr "КОÐФЛІКТ (додано/додано): Конфлікт Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ñƒ %s"
+
+#, c-format
+msgid "merging of trees %s and %s failed"
+msgstr "не вдалоÑÑ Ð·Ð»Ð¸Ñ‚Ð¸ дерева %s та %s"
+
+msgid "Merging:"
+msgstr "ЗлиттÑ:"
+
+#, c-format
+msgid "found %u common ancestor:"
+msgid_plural "found %u common ancestors:"
+msgstr[0] "знайшли %u Ñпільного предка:"
+msgstr[1] "знайшли %u Ñпільних предків:"
+msgstr[2] "знайшли %u Ñпільних предків:"
+
+msgid "merge returned no commit"
+msgstr "Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ðµ повернуло коміт"
+
+#, c-format
+msgid "Could not parse object '%s'"
+msgstr "Ðе вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ обʼєкт \"%s\""
+
+msgid "failed to read the cache"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ кеш"
+
+msgid "multi-pack-index OID fanout is of the wrong size"
+msgstr "multi-pack-index OID розÑÑ–ÑŽÐ²Ð°Ð½Ð½Ñ Ð¼Ð°Ñ” невірний розмір"
+
+#, c-format
+msgid ""
+"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
+msgstr ""
+"невірна поÑлідовніÑÑ‚ÑŒ oid fanout: fanout[%d] = %<PRIx32> > %<PRIx32> = "
+"fanout[%d]"
+
+msgid "multi-pack-index OID lookup chunk is the wrong size"
+msgstr "multi-pack-index OID lookup шматок має невірний розмір"
+
+msgid "multi-pack-index object offset chunk is the wrong size"
+msgstr "multi-pack-index object offset шматок має невірний розмір"
+
+#, c-format
+msgid "multi-pack-index file %s is too small"
+msgstr "multi-pack-index файл %s занадто малий"
+
+#, c-format
+msgid "multi-pack-index signature 0x%08x does not match signature 0x%08x"
+msgstr "multi-pack-index Ð¿Ñ–Ð´Ð¿Ð¸Ñ 0x%08x не збігаєтьÑÑ Ð· підпиÑом 0x%08x"
+
+#, c-format
+msgid "multi-pack-index version %d not recognized"
+msgstr "multi-pack-index верÑÑ–Ñ %d не розпізнана"
+
+#, c-format
+msgid "multi-pack-index hash version %u does not match version %u"
+msgstr "верÑÑ–Ñ Ñ…ÐµÑˆÑƒ multi-pack-index %u не збігаєтьÑÑ Ð· верÑією %u"
+
+msgid "multi-pack-index required pack-name chunk missing or corrupted"
+msgstr "необхідний шматок pack-name multi-pack-index відÑутній або пошкоджений"
+
+msgid "multi-pack-index required OID fanout chunk missing or corrupted"
+msgstr ""
+"необхідний шматок OID fanout multi-pack-index відÑутній або пошкоджений"
+
+msgid "multi-pack-index required OID lookup chunk missing or corrupted"
+msgstr ""
+"необхідний шматок OID lookup multi-pack-index відÑутній або пошкоджений"
+
+msgid "multi-pack-index required object offsets chunk missing or corrupted"
+msgstr ""
+"необхідний шматок object offsets multi-pack-index відÑутній або пошкоджений"
+
+msgid "multi-pack-index pack-name chunk is too short"
+msgstr "шматок pack-name multi-pack-index занадто малий"
+
+#, c-format
+msgid "multi-pack-index pack names out of order: '%s' before '%s'"
+msgstr ""
+"multi-pack-index назви пакунків знаходÑÑ‚ÑŒÑÑ Ñƒ невірній поÑлідовноÑÑ‚Ñ–: \"%s\" "
+"перед \"%s\""
+
+#, c-format
+msgid "bad pack-int-id: %u (%u total packs)"
+msgstr "невірний pack-int-id: %u (%u вÑього пакунків)"
+
+msgid "MIDX does not contain the BTMP chunk"
+msgstr "MIDX не міÑтить шматок BTMP"
+
+#, c-format
+msgid "could not load bitmapped pack %<PRIu32>"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ бітмаповий пакунок %<PRIu32>"
+
+msgid "multi-pack-index stores a 64-bit offset, but off_t is too small"
+msgstr ""
+"multi-pack-index зберігає 64-бітне зміщеннÑ, але Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ off_t занадто мале"
+
+msgid "multi-pack-index large offset out of bounds"
+msgstr "large offset multi-pack-index виходить за межі"
+
+#, c-format
+msgid "failed to add packfile '%s'"
+msgstr "не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ packfile \"%s\""
+
+#, c-format
+msgid "failed to open pack-index '%s'"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ pack-index \"%s\""
+
+#, c-format
+msgid "failed to locate object %d in packfile"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ обʼєкт %d у файлі пакунка"
+
+msgid "cannot store reverse index file"
+msgstr "неможливо зберегти файл зворотнього індекÑу"
+
+#, c-format
+msgid "could not parse line: %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ Ñ€Ñдок: %s"
+
+#, c-format
+msgid "malformed line: %s"
+msgstr "невірно Ñформований Ñ€Ñдок: %s"
+
+msgid "ignoring existing multi-pack-index; checksum mismatch"
+msgstr ""
+"Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ñ–Ñнуючого multi-pack-index; невідповідніÑÑ‚ÑŒ контрольних Ñум"
+
+msgid "could not load pack"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ пакет"
+
+#, c-format
+msgid "could not open index for %s"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ Ñ–Ð½Ð´ÐµÐºÑ Ð´Ð»Ñ %s"
+
+msgid "Adding packfiles to multi-pack-index"
+msgstr "Ð”Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð¿Ð°ÐºÑƒÐ½ÐºÑ–Ð² до multi-pack-index"
+
+#, c-format
+msgid "unknown preferred pack: '%s'"
+msgstr "невідомий бажаний пакунок: \"%s\""
+
+#, c-format
+msgid "cannot select preferred pack %s with no objects"
+msgstr "неможливо вибрати бажаний пакунок %s за відÑутноÑÑ‚Ñ– об’єктів"
+
+#, c-format
+msgid "did not see pack-file %s to drop"
+msgstr "не побачив файл пакунка %s, Ñкий потрібно Ñкинути"
+
+#, c-format
+msgid "preferred pack '%s' is expired"
+msgstr "у бажаного пакета \"%s\" закінчивÑÑ Ñ‚ÐµÑ€Ð¼Ñ–Ð½ дії"
+
+msgid "no pack files to index."
+msgstr "немає файлів пакунків Ð´Ð»Ñ Ñ–Ð½Ð´ÐµÐºÑації."
+
+msgid "refusing to write multi-pack .bitmap without any objects"
+msgstr "відмовлено в запиÑÑ– мультіпакункового .bitmap без обʼєктів"
+
+msgid "could not write multi-pack bitmap"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати мультіпакунковий bitmap"
+
+msgid "could not write multi-pack-index"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати multi-pack-index"
+
+#, c-format
+msgid "failed to clear multi-pack-index at %s"
+msgstr "не вдалоÑÑ Ð¾Ñ‡Ð¸Ñтити multi-pack-index при %s"
+
+msgid "multi-pack-index file exists, but failed to parse"
+msgstr "multi-pack-index файл Ñ–Ñнує, але його не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸"
+
+msgid "incorrect checksum"
+msgstr "невірна контрольна Ñума"
+
+msgid "Looking for referenced packfiles"
+msgstr "Пошук файлів пакунків, на Ñкі Ñ” поÑиланнÑ"
+
+msgid "the midx contains no oid"
+msgstr "midx не міÑтить oid"
+
+msgid "Verifying OID order in multi-pack-index"
+msgstr "Перевірка OID поÑлідовноÑÑ‚Ñ– в multi-pack-index"
+
+#, c-format
+msgid "oid lookup out of order: oid[%d] = %s >= %s = oid[%d]"
+msgstr "невірна поÑлідовніÑÑ‚ÑŒ oid lookup: oid[%d] = %s >= %s = oid[%d]"
+
+msgid "Sorting objects by packfile"
+msgstr "Ð¡Ð¾Ñ€Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ñ–Ð² за файлом пакунка"
+
+msgid "Verifying object offsets"
+msgstr "Перевірка зміщень обʼєкта"
+
+#, c-format
+msgid "failed to load pack entry for oid[%d] = %s"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ Ð·Ð°Ð¿Ð¸Ñ Ð¿Ð°ÐºÑƒÐ½ÐºÐ° Ð´Ð»Ñ oid[%d] = %s"
+
+#, c-format
+msgid "failed to load pack-index for packfile %s"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ Ñ–Ð½Ð´ÐµÐºÑ Ñ„Ð°Ð¹Ð»Ð° пакунка %s"
+
+#, c-format
+msgid "incorrect object offset for oid[%d] = %s: %<PRIx64> != %<PRIx64>"
+msgstr "невірне Ð·Ð¼Ñ–Ñ‰ÐµÐ½Ð½Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ð° Ð´Ð»Ñ oid[%d] = %s: %<PRIx64> != %<PRIx64>"
+
+msgid "Counting referenced objects"
+msgstr "Підрахунок обʼєктів, на Ñкі Ñ” поÑиланнÑ"
+
+msgid "Finding and deleting unreferenced packfiles"
+msgstr "Пошук Ñ– Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñ–Ð² пакунків без поÑилань"
+
+msgid "could not start pack-objects"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ð¾Ñ‡Ð°Ñ‚Ð¸ pack-objects"
+
+msgid "could not finish pack-objects"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ñ‚Ð¸ pack-objects"
+
+#, c-format
+msgid "unable to create lazy_dir thread: %s"
+msgstr "не вдалоÑÑ Ñтворити lazy_dir потік: %s"
+
+#, c-format
+msgid "unable to create lazy_name thread: %s"
+msgstr "не вдалоÑÑ Ñтворити lazy_name потік: %s"
+
+#, c-format
+msgid "unable to join lazy_name thread: %s"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¸Ñ”Ð´Ð½Ð°Ñ‚Ð¸ÑÑ Ð´Ð¾ lazy_name потоку: %s"
+
+#, c-format
+msgid ""
+"You have not concluded your previous notes merge (%s exists).\n"
+"Please, use 'git notes merge --commit' or 'git notes merge --abort' to "
+"commit/abort the previous merge before you start a new notes merge."
+msgstr ""
+"Ви не завершили попереднє Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ð¾Ñ‚Ð°Ñ‚Ð¾Ðº (Ñ–Ñнує %s).\n"
+"Будь лаÑка, ÑкориÑтайтеÑÑŒ командами \"git notes merge --commit\" або \"git "
+"notes merge --abort\", щоб зробити коміт/ÑкаÑувати попереднє злиттÑ, перш "
+"ніж розпочати нове Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ð¾Ñ‚Ð°Ñ‚Ð¾Ðº."
+
+#, c-format
+msgid "You have not concluded your notes merge (%s exists)."
+msgstr "Ви не завершили Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð²Ð°ÑˆÐ¸Ñ… нотаток (%s Ñ–Ñнує)."
+
+msgid "Cannot commit uninitialized/unreferenced notes tree"
+msgstr "Ðеможливо зробити коміт неініціалізованого/непоÑиланого дерева нотаток"
+
+#, c-format
+msgid "Bad notes.rewriteMode value: '%s'"
+msgstr "Ðевірнe notes.rewriteMode значеннÑ: \"%s\""
+
+#, c-format
+msgid "Refusing to rewrite notes in %s (outside of refs/notes/)"
+msgstr "Відмовлено в перезапиÑÑ– нотаток у %s (за межами refs/notes/)"
+
+#. TRANSLATORS: The first %s is the name of
+#. the environment variable, the second %s is
+#. its value.
+#.
+#, c-format
+msgid "Bad %s value: '%s'"
+msgstr "Ðевірне %s значеннÑ: \"%s\""
+
+#, c-format
+msgid "object directory %s does not exist; check .git/objects/info/alternates"
+msgstr "Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ Ð¾Ð±â€™Ñ”ÐºÑ‚Ð° %s не Ñ–Ñнує; перевірте .git/objects/info/alternates"
+
+#, c-format
+msgid "unable to normalize alternate object path: %s"
+msgstr "не вдалоÑÑ Ð½Ð¾Ñ€Ð¼Ð°Ð»Ñ–Ð·ÑƒÐ²Ð°Ñ‚Ð¸ шлÑÑ… запозиченого обʼєкта: %s"
+
+#, c-format
+msgid "%s: ignoring alternate object stores, nesting too deep"
+msgstr ""
+"%s: Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð¼Ñ–Ñць Ð·Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ð·Ð°Ð¿Ð¾Ð·Ð¸Ñ‡ÐµÐ½Ð¸Ñ… об’єктів, надто глибока "
+"вкладеніÑÑ‚ÑŒ"
+
+msgid "unable to fdopen alternates lockfile"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ fdopen Ð´Ð»Ñ Ñ„Ð°Ð¹Ð»Ð° Ð±Ð»Ð¾ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð°Ð¿Ð¾Ð·Ð¸Ñ‡ÐµÐ½Ð¸Ñ… обʼєктів"
+
+msgid "unable to read alternates file"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ файл запозичених обʼєктів"
+
+msgid "unable to move new alternates file into place"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¼Ñ–Ñтити файл нових запозичених обʼєктів на міÑце"
+
+#, c-format
+msgid "path '%s' does not exist"
+msgstr "шлÑÑ… \"%s\" не Ñ–Ñнує"
+
+#, c-format
+msgid "reference repository '%s' as a linked checkout is not supported yet."
+msgstr "поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ð° Ñховище \"%s\" Ñк повʼÑзане поки що не підтримуєтьÑÑ."
+
+#, c-format
+msgid "reference repository '%s' is not a local repository."
+msgstr "Ñховище поÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\" не Ñ” локальним Ñховищем."
+
+#, c-format
+msgid "reference repository '%s' is shallow"
+msgstr "Ñховище поÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\" Ñ” неглибоким"
+
+#, c-format
+msgid "reference repository '%s' is grafted"
+msgstr "Ñховище поÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\" прищеплено"
+
+#, c-format
+msgid "could not find object directory matching %s"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ директорію обʼєктів, що відповідає %s"
+
+#, c-format
+msgid "invalid line while parsing alternate refs: %s"
+msgstr "неприпуÑтимий Ñ€Ñдок при розбиранні поÑилань запозичених обʼєктів: %s"
+
+#, c-format
+msgid "attempting to mmap %<PRIuMAX> over limit %<PRIuMAX>"
+msgstr "Ñпроба виконати mmap %<PRIuMAX> за межею %<PRIuMAX>"
+
+#, c-format
+msgid "mmap failed%s"
+msgstr "Ð¾Ð¿ÐµÑ€Ð°Ñ†Ñ–Ñ mmap не вдалаÑÑ%s"
+
+#, c-format
+msgid "object file %s is empty"
+msgstr "обʼєктний файл %s порожній"
+
+#, c-format
+msgid "corrupt loose object '%s'"
+msgstr "пошкоджено вільний обʼєкт \"%s\""
+
+#, c-format
+msgid "garbage at end of loose object '%s'"
+msgstr "непотріб в кінці вільного обʼєкта \"%s\""
+
+#, c-format
+msgid "unable to open loose object %s"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ вільний обʼєкт %s"
+
+#, c-format
+msgid "unable to parse %s header"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ заголовок %s"
+
+msgid "invalid object type"
+msgstr "неприпуÑтимий тип обʼєкта"
+
+#, c-format
+msgid "unable to unpack %s header"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ð°ÐºÑƒÐ²Ð°Ñ‚Ð¸ %s заголовок"
+
+#, c-format
+msgid "header for %s too long, exceeds %d bytes"
+msgstr "заголовок Ð´Ð»Ñ %s занадто довгий, перевищує %d байт"
+
+#, c-format
+msgid "loose object %s (stored in %s) is corrupt"
+msgstr "вільний обʼєкт %s (що зберігаєтьÑÑ Ñƒ %s) пошкоджено"
+
+#, c-format
+msgid "replacement %s not found for %s"
+msgstr "заміна %s не знайдена Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "packed object %s (stored in %s) is corrupt"
+msgstr "упакований обʼєкт %s (що зберігаєтьÑÑ Ñƒ %s) пошкоджено"
+
+#, c-format
+msgid "unable to write file %s"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати файл %s"
+
+#, c-format
+msgid "unable to set permission to '%s'"
+msgstr "не вдалоÑÑ Ð²Ñтановити дозволи Ð´Ð»Ñ \"%s\""
+
+msgid "error when closing loose object file"
+msgstr "помилка при закритті файла вільного об’єкта"
+
+#, c-format
+msgid "insufficient permission for adding an object to repository database %s"
+msgstr "недоÑтатньо дозволу Ð´Ð»Ñ Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ð° до бази даних Ñховища %s"
+
+msgid "unable to create temporary file"
+msgstr "не вдалоÑÑ Ñтворити тимчаÑовий файл"
+
+msgid "unable to write loose object file"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати файл вільного об’єкта"
+
+#, c-format
+msgid "unable to deflate new object %s (%d)"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð°ÐºÑƒÐ²Ð°Ñ‚Ð¸ новий обʼєкт %s (%d)"
+
+#, c-format
+msgid "deflateEnd on object %s failed (%d)"
+msgstr "Ð¾Ð¿ÐµÑ€Ð°Ñ†Ñ–Ñ deflateEnd на обʼєкті %s завершилаÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾ (%d)"
+
+#, c-format
+msgid "confused by unstable object source data for %s"
+msgstr "збентежений неÑтабільними початковими даними обʼєкта Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "write stream object %ld != %<PRIuMAX>"
+msgstr "Ð·Ð°Ð¿Ð¸Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ð° потока %ld != %<PRIuMAX>"
+
+#, c-format
+msgid "unable to stream deflate new object (%d)"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð°ÐºÑƒÐ²Ð°Ñ‚Ð¸ новий обʼєкт (%d) при передачі"
+
+#, c-format
+msgid "deflateEnd on stream object failed (%d)"
+msgstr "Ð¾Ð¿ÐµÑ€Ð°Ñ†Ñ–Ñ deflateEnd на обʼєкті потоку завершилаÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾ (%d)"
+
+#, c-format
+msgid "unable to create directory %s"
+msgstr "не вдалоÑÑ Ñтворити директорію %s"
+
+#, c-format
+msgid "cannot read object for %s"
+msgstr "неможливо прочитати обʼєкт Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "object fails fsck: %s"
+msgstr "об’єкт не пройшов перевірку fsck: %s"
+
+msgid "refusing to create malformed object"
+msgstr "відмовлено в Ñтворенні невірно Ñформованого обʼєкта"
+
+#, c-format
+msgid "read error while indexing %s"
+msgstr "помилка ÑÑ‡Ð¸Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ñ€Ð¸ індекÑаціі %s"
+
+#, c-format
+msgid "short read while indexing %s"
+msgstr "помилка ÑÑ‡Ð¸Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð°Ð¼Ð°Ð»Ð¾Ð³Ð¾ вміÑту при індекÑаціі %s"
+
+#, c-format
+msgid "%s: failed to insert into database"
+msgstr "%s: не вдалоÑÑ Ð²Ð½ÐµÑти до бази даних"
+
+#, c-format
+msgid "%s: unsupported file type"
+msgstr "%s: непідтримуваний тип файлу"
+
+#, c-format
+msgid "%s is not a valid '%s' object"
+msgstr "%s не Ñ” допуÑтимим \"%s\" обʼєктом"
+
+#, c-format
+msgid "unable to open %s"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ %s"
+
+#, c-format
+msgid "hash mismatch for %s (expected %s)"
+msgstr "невідповідніÑÑ‚ÑŒ хешу Ð´Ð»Ñ %s (очікувалоÑÑŒ %s)"
+
+#, c-format
+msgid "unable to mmap %s"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ mmap %s"
+
+#, c-format
+msgid "unable to unpack header of %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ð°ÐºÑƒÐ²Ð°Ñ‚Ð¸ заголовок %s"
+
+#, c-format
+msgid "unable to parse header of %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ заголовок %s"
+
+#, c-format
+msgid "unable to unpack contents of %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ð°ÐºÑƒÐ²Ð°Ñ‚Ð¸ вміÑÑ‚ %s"
+
+#. TRANSLATORS: This is a line of ambiguous object
+#. output shown when we cannot look up or parse the
+#. object in question. E.g. "deadbeef [bad object]".
+#.
+#, c-format
+msgid "%s [bad object]"
+msgstr "%s [невірний обʼект]"
+
+#. TRANSLATORS: This is a line of ambiguous commit
+#. object output. E.g.:
+#. *
+#. "deadbeef commit 2021-01-01 - Some Commit Message"
+#.
+#, c-format
+msgid "%s commit %s - %s"
+msgstr "%s коміт %s - %s"
+
+#. TRANSLATORS: This is a line of ambiguous
+#. tag object output. E.g.:
+#. *
+#. "deadbeef tag 2022-01-01 - Some Tag Message"
+#. *
+#. The second argument is the YYYY-MM-DD found
+#. in the tag.
+#. *
+#. The third argument is the "tag" string
+#. from object.c.
+#.
+#, c-format
+msgid "%s tag %s - %s"
+msgstr "%s тег %s - %s"
+
+#. TRANSLATORS: This is a line of ambiguous
+#. tag object output where we couldn't parse
+#. the tag itself. E.g.:
+#. *
+#. "deadbeef [bad tag, could not parse it]"
+#.
+#, c-format
+msgid "%s [bad tag, could not parse it]"
+msgstr "%s [невірний тег, не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸]"
+
+#. TRANSLATORS: This is a line of ambiguous <type>
+#. object output. E.g. "deadbeef tree".
+#.
+#, c-format
+msgid "%s tree"
+msgstr "%s дерево"
+
+#. TRANSLATORS: This is a line of ambiguous <type>
+#. object output. E.g. "deadbeef blob".
+#.
+#, c-format
+msgid "%s blob"
+msgstr "%s blob"
+
+#, c-format
+msgid "short object ID %s is ambiguous"
+msgstr "короткий ідентифікатор обʼєкта %s неоднозначний"
+
+#. TRANSLATORS: The argument is the list of ambiguous
+#. objects composed in show_ambiguous_object(). See
+#. its "TRANSLATORS" comments for details.
+#.
+#, c-format
+msgid ""
+"The candidates are:\n"
+"%s"
+msgstr ""
+"Кандидати такі:\n"
+"%s"
+
+msgid ""
+"Git normally never creates a ref that ends with 40 hex characters\n"
+"because it will be ignored when you just specify 40-hex. These refs\n"
+"may be created by mistake. For example,\n"
+"\n"
+" git switch -c $br $(git rev-parse ...)\n"
+"\n"
+"where \"$br\" is somehow empty and a 40-hex ref is created. Please\n"
+"examine these refs and maybe delete them. Turn this message off by\n"
+"running \"git config advice.objectNameWarning false\""
+msgstr ""
+"Зазвичай Git ніколи не Ñтворює поÑиланнÑ, Ñке закінчуєтьÑÑ 40-hex "
+"Ñимволами,\n"
+"тому що воно буде проігноровано, Ñкщо ви проÑто вкажете 40-hex. Такі "
+"поÑиланнÑ\n"
+"можуть бути Ñтворені помилково. Ðаприклад\n"
+"\n"
+" git switch -c $br $(git rev-parse ...)\n"
+"\n"
+"де \"$br\" ÑкимоÑÑŒ чином порожнє, Ñтворює 40-hex поÑиланнÑ. Будь лаÑка\n"
+"перевірте ці поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ñ–, можливо, видаліть Ñ—Ñ…. Щоб вимкнути це "
+"повідомленнÑ, виконайте\n"
+"\"git config advice.objectNameWarning false\""
+
+#, c-format
+msgid "log for '%.*s' only goes back to %s"
+msgstr "лог Ð´Ð»Ñ \"%.*s\" міÑтить запиÑи тільки до %s"
+
+#, c-format
+msgid "log for '%.*s' only has %d entries"
+msgstr "лог Ð´Ð»Ñ \"%.*s\" міÑтить лише %d запиÑів"
+
+#, c-format
+msgid "path '%s' exists on disk, but not in '%.*s'"
+msgstr "шлÑÑ… \"%s\" Ñ–Ñнує на диÑку, але не в \"%.*s\""
+
+#, c-format
+msgid ""
+"path '%s' exists, but not '%s'\n"
+"hint: Did you mean '%.*s:%s' aka '%.*s:./%s'?"
+msgstr ""
+"шлÑÑ… \"%s\" Ñ–Ñнує, але не \"%s\"\n"
+"підказка: ви мали на увазі \"%.*s:%s\" або \"%.*s:./%s\"?"
+
+#, c-format
+msgid "path '%s' does not exist in '%.*s'"
+msgstr "шлÑÑ… \"%s\" не Ñ–Ñнує в \"%.*s\""
+
+#, c-format
+msgid ""
+"path '%s' is in the index, but not at stage %d\n"
+"hint: Did you mean ':%d:%s'?"
+msgstr ""
+"шлÑÑ… \"%s\" Ñ” в індекÑÑ–, але відÑутній на Ñтадії %d\n"
+"підказка: ви мали на увазі \":%d:%s\"?"
+
+#, c-format
+msgid ""
+"path '%s' is in the index, but not '%s'\n"
+"hint: Did you mean ':%d:%s' aka ':%d:./%s'?"
+msgstr ""
+"шлÑÑ… \"%s\" Ñ” в індекÑÑ–, але не \"%s\"\n"
+"підказка: ви мали на увазі \"%d:%s\" або \"%d:./%s\"?"
+
+#, c-format
+msgid "path '%s' exists on disk, but not in the index"
+msgstr "шлÑÑ… \"%s\" Ñ–Ñнує на диÑку, але відÑутній в індекÑÑ–"
+
+#, c-format
+msgid "path '%s' does not exist (neither on disk nor in the index)"
+msgstr "шлÑÑ… \"%s\" не Ñ–Ñнує (ні на диÑку, ні в індекÑÑ–)"
+
+msgid "relative path syntax can't be used outside working tree"
+msgstr ""
+"ÑинтакÑÐ¸Ñ Ð²Ñ–Ð´Ð½Ð¾Ñного шлÑху не можна викориÑтовувати поза робочим деревом"
+
+#, c-format
+msgid "<object>:<path> required, only <object> '%s' given"
+msgstr "потрібно <обʼєкт>:<шлÑÑ…>, надано лише <обʼєкт> \"%s\""
+
+#, c-format
+msgid "invalid object name '%.*s'."
+msgstr "неприпуÑтима назва обʼєкта \"%.*s\"."
+
+#, c-format
+msgid "invalid object type \"%s\""
+msgstr "неприпуÑтимий тип обʼєкту \"%s\""
+
+#, c-format
+msgid "object %s is a %s, not a %s"
+msgstr "обʼєкт %s є %s, а не %s"
+
+#, c-format
+msgid "object %s has unknown type id %d"
+msgstr "обʼєкт %s має невідомий тип ідентифікатора %d"
+
+#, c-format
+msgid "unable to parse object: %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ обʼєкт: %s"
+
+#, c-format
+msgid "hash mismatch %s"
+msgstr "невідповідніÑÑ‚ÑŒ хешу %s"
+
+msgid "trying to write commit not in index"
+msgstr "Ñпроба запиÑати коміт, Ñкого немає в індекÑÑ–"
+
+msgid "failed to load bitmap index (corrupted?)"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ bitmap Ñ–Ð½Ð´ÐµÐºÑ (пошкоджено?)"
+
+msgid "corrupted bitmap index (too small)"
+msgstr "пошкоджений bitmap Ñ–Ð½Ð´ÐµÐºÑ (занадто малий)"
+
+msgid "corrupted bitmap index file (wrong header)"
+msgstr "пошкоджений файл bitmap індекÑу (занадто малий)"
+
+#, c-format
+msgid "unsupported version '%d' for bitmap index file"
+msgstr "непідтримувана верÑÑ–Ñ \"%d\" Ð´Ð»Ñ Ñ„Ð°Ð¹Ð»Ñƒ bitmap індекÑу"
+
+msgid "corrupted bitmap index file (too short to fit hash cache)"
+msgstr ""
+"пошкоджений файл bitmap індекÑу (занадто короткий щоб уміÑтити кеш хеша)"
+
+msgid "corrupted bitmap index file (too short to fit lookup table)"
+msgstr ""
+"пошкоджений файл bitmap індекÑу (занадто короткий, щоб вміÑтити таблицю "
+"пошуку)"
+
+#, c-format
+msgid "duplicate entry in bitmap index: '%s'"
+msgstr "дубльований Ð·Ð°Ð¿Ð¸Ñ Ð² bitmap індекÑÑ–: \"%s\""
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for entry %d"
+msgstr "пошкоджений ewah bitmap: урізаний заголовок Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу %d"
+
+#, c-format
+msgid "corrupt ewah bitmap: commit index %u out of range"
+msgstr "пошкоджений ewah bitmap: Ñ–Ð½Ð´ÐµÐºÑ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ %u поза межами діапазону"
+
+msgid "corrupted bitmap pack index"
+msgstr "пошкоджений bitmap Ñ–Ð½Ð´ÐµÐºÑ Ð¿Ð°ÐºÑƒÐ½ÐºÐ°"
+
+msgid "invalid XOR offset in bitmap pack index"
+msgstr "невірне XOR Ð·Ð¼Ñ–Ñ‰ÐµÐ½Ð½Ñ Ð² bitmap індекÑÑ– пакунка"
+
+msgid "cannot fstat bitmap file"
+msgstr "неможливо виконати fstat Ð´Ð»Ñ bitmap файла"
+
+msgid "checksum doesn't match in MIDX and bitmap"
+msgstr "контрольна Ñума не збігаєтьÑÑ Ð² MIDX Ñ– bitmap"
+
+msgid "multi-pack bitmap is missing required reverse index"
+msgstr "у мультіпакунковому bitmap відÑутній необхідний зворотний індекÑ"
+
+#, c-format
+msgid "could not open pack %s"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ пакунок %s"
+
+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 Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ Ð¿Ð¾ÑˆÑƒÐºÑƒ: триплетна Ð¿Ð¾Ð·Ð¸Ñ†Ñ–Ñ Ð¿Ð¾Ð·Ð° індекÑом"
+
+msgid "corrupt bitmap lookup table: xor chain exceeds entry count"
+msgstr ""
+"пошкоджена bitmap Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ Ð¿Ð¾ÑˆÑƒÐºÑƒ: xor ланцюжок перевищує кількіÑÑ‚ÑŒ запиÑів"
+
+#, c-format
+msgid "corrupt bitmap lookup table: commit index %u out of range"
+msgstr ""
+"пошкоджена bitmap Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ Ð¿Ð¾ÑˆÑƒÐºÑƒ: Ñ–Ð½Ð´ÐµÐºÑ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ %u поза межами діапазону"
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for bitmap of commit \"%s\""
+msgstr "пошкоджений ewah bitmap: урізаний заголовок Ð´Ð»Ñ bitmap коміту \"%s\""
+
+#, c-format
+msgid "unable to load pack: '%s', disabling pack-reuse"
+msgstr ""
+"не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ пакунок: \"%s\", Ð²Ð¸Ð¼ÐºÐ½ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ñ‚Ð¾Ñ€Ð½Ð¾Ð³Ð¾ викориÑÑ‚Ð°Ð½Ð½Ñ "
+"пакунків"
+
+#, c-format
+msgid "object '%s' not found in type bitmaps"
+msgstr "обʼєкт \"%s\" не знайдено в типах bitmap"
+
+#, c-format
+msgid "object '%s' does not have a unique type"
+msgstr "обʼєкт \"%s\" не має унікального типу"
+
+#, c-format
+msgid "object '%s': real type '%s', expected: '%s'"
+msgstr "обʼєкт \"%s\": дійÑний тип \"%s\", очікуваний: \"%s\""
+
+#, c-format
+msgid "object not in bitmap: '%s'"
+msgstr "обʼєкт не у bitmap: \"%s\""
+
+msgid "failed to load bitmap indexes"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ bitmap індекÑи"
+
+msgid "you must specify exactly one commit to test"
+msgstr "ви маєте вказати лишень один коміт Ð´Ð»Ñ Ñ‚ÐµÑтуваннÑ"
+
+#, c-format
+msgid "commit '%s' doesn't have an indexed bitmap"
+msgstr "коміт \"%s\" не має індекÑованого bitmap"
+
+msgid "mismatch in bitmap results"
+msgstr "розбіжніÑÑ‚ÑŒ в bitmap результатах"
+
+#, c-format
+msgid "could not find '%s' in pack '%s' at offset %<PRIuMAX>"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ \"%s\" у пакунку \"%s\" зі зміщеннÑм %<PRIuMAX>"
+
+#, c-format
+msgid "unable to get disk usage of '%s'"
+msgstr ""
+"не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ дані про викориÑÑ‚Ð°Ð½Ð½Ñ Ð´Ð¸Ñкового проÑтору Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "bitmap файл \"%s\" має невірну контрольну Ñуму"
+
+#, c-format
+msgid "mtimes file %s is too small"
+msgstr "mtimes файл %s занадто малий"
+
+#, c-format
+msgid "mtimes file %s has unknown signature"
+msgstr "mtimes файл %s має невідомий підпиÑ"
+
+#, c-format
+msgid "mtimes file %s has unsupported version %<PRIu32>"
+msgstr "mtimes файл %s має непідтримувану верÑÑ–ÑŽ %<PRIu32>"
+
+#, c-format
+msgid "mtimes file %s has unsupported hash id %<PRIu32>"
+msgstr "mtimes файл %s має непідтримуваний хеш-ідентифікатор %<PRIu32>"
+
+#, c-format
+msgid "mtimes file %s is corrupt"
+msgstr "mtimes файл %s пошкоджено"
+
+#, c-format
+msgid "reverse-index file %s is too small"
+msgstr "файл зворотного індекÑу %s занадто малий"
+
+#, c-format
+msgid "reverse-index file %s is corrupt"
+msgstr "файл зворотнього індекÑу %s пошкоджено"
+
+#, c-format
+msgid "reverse-index file %s has unknown signature"
+msgstr "файл зворотного індекÑу %s має невідомий підпиÑ"
+
+#, c-format
+msgid "reverse-index file %s has unsupported version %<PRIu32>"
+msgstr "файл зворотного індекÑу %s має непідтримувану верÑÑ–ÑŽ %<PRIu32>"
+
+#, c-format
+msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
+msgstr ""
+"файл зворотного індекÑу %s має непідтримуваний хеш-ідентифікатор %<PRIu32>"
+
+msgid "invalid checksum"
+msgstr "неприпуÑтима контрольна Ñума"
+
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr ""
+"невірна Ð¿Ð¾Ð·Ð¸Ñ†Ñ–Ñ Ð·Ð²Ð¾Ñ€Ð¾Ñ€Ñ‚Ð½Ð¾Ð³Ð¾ індекÑу у %<PRIu64>: %<PRIu32> != %<PRIu32>"
+
+msgid "multi-pack-index reverse-index chunk is the wrong size"
+msgstr "multi-pack-index reverse-index шматок має невірний розмір"
+
+msgid "could not determine preferred pack"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ бажаний пакунок"
+
+msgid "cannot both write and verify reverse index"
+msgstr "неможливо одночаÑно запиÑувати та звірÑти зворотний індекÑ"
+
+#, c-format
+msgid "could not stat: %s"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ stat: %s"
+
+#, c-format
+msgid "failed to make %s readable"
+msgstr "не вдалоÑÑ Ð·Ñ€Ð¾Ð±Ð¸Ñ‚Ð¸ %s читабельним"
+
+#, c-format
+msgid "could not write '%s' promisor file"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати promisor файл \"%s\""
+
+msgid "offset before end of packfile (broken .idx?)"
+msgstr "Ð·Ð¼Ñ–Ñ‰ÐµÐ½Ð½Ñ Ð¿ÐµÑ€ÐµÐ´ кінцем файла пакунка (пошкоджений .idx?)"
+
+#, c-format
+msgid "packfile %s cannot be mapped%s"
+msgstr "файл пакунка %s не може бути mapped%s"
+
+#, c-format
+msgid "offset before start of pack index for %s (corrupt index?)"
+msgstr "Ð·Ð¼Ñ–Ñ‰ÐµÐ½Ð½Ñ Ð¿ÐµÑ€ÐµÐ´ початком індекÑа пакунка Ð´Ð»Ñ %s (пошкоджений індекÑ?)"
+
+#, c-format
+msgid "offset beyond end of pack index for %s (truncated index?)"
+msgstr "Ð·Ð¼Ñ–Ñ‰ÐµÐ½Ð½Ñ Ð·Ð° межою ÐºÑ–Ð½Ñ†Ñ Ñ–Ð½Ð´ÐµÐºÑа пакунка Ð´Ð»Ñ %s (зрізаний індекÑ?)"
+
+#, c-format
+msgid "malformed expiration date '%s'"
+msgstr "невірно Ñформована дата Ð·Ð°ÐºÑ–Ð½Ñ‡ÐµÐ½Ð½Ñ Ñ‚ÐµÑ€Ð¼Ñ–Ð½Ñƒ дії \"%s\""
+
+#, c-format
+msgid "option `%s' expects \"always\", \"auto\", or \"never\""
+msgstr "Ð¾Ð¿Ñ†Ñ–Ñ \"%s\" очікує \"always\", \"auto\" або \"never\""
+
+#, c-format
+msgid "malformed object name '%s'"
+msgstr "невірно Ñформована назва обʼєкта \"%s\""
+
+#, c-format
+msgid "option `%s' expects \"%s\" or \"%s\""
+msgstr "Ð¾Ð¿Ñ†Ñ–Ñ \"%s\" очікує \"%s\" або \"%s\""
+
+#, c-format
+msgid "%s requires a value"
+msgstr "%s потребує значеннÑ"
+
+#, c-format
+msgid "%s takes no value"
+msgstr "%s не приймає значеннÑ"
+
+#, c-format
+msgid "%s isn't available"
+msgstr "%s недоÑтупний"
+
+#, c-format
+msgid "%s expects a non-negative integer value with an optional k/m/g suffix"
+msgstr "%s очікує невід'ємне ціле Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð· опціональним ÑуфікÑом k/m/g"
+
+#, c-format
+msgid "ambiguous option: %s (could be --%s%s or --%s%s)"
+msgstr "неоднозначна опціÑ: %s (може бути --%s%s або --%s%s)"
+
+#, c-format
+msgid "did you mean `--%s` (with two dashes)?"
+msgstr "ви мали на увазі \"--%s\" (з двома риÑками)?"
+
+#, c-format
+msgid "alias of --%s"
+msgstr "пÑевдонім Ð´Ð»Ñ --%s"
+
+msgid "need a subcommand"
+msgstr "потрібна підкоманда"
+
+#, c-format
+msgid "unknown option `%s'"
+msgstr "невідома Ð¾Ð¿Ñ†Ñ–Ñ \"%s\""
+
+#, c-format
+msgid "unknown switch `%c'"
+msgstr "невідомий перемикач \"%c\""
+
+#, c-format
+msgid "unknown non-ascii option in string: `%s'"
+msgstr "невідомий non-ascii параметр у Ñ€Ñдку: \"%s\""
+
+msgid "..."
+msgstr "..."
+
+#, c-format
+msgid "usage: %s"
+msgstr "викориÑтаннÑ: %s"
+
+#. TRANSLATORS: the colon here should align with the
+#. one in "usage: %s" translation.
+#.
+#, c-format
+msgid " or: %s"
+msgstr " або: %s"
+
+#. TRANSLATORS: You should only need to translate this format
+#. string if your language is a RTL language (e.g. Arabic,
+#. Hebrew etc.), not if it's a LTR language (e.g. German,
+#. Russian, Chinese etc.).
+#. *
+#. When a translated usage string has an embedded "\n" it's
+#. because options have wrapped to the next line. The line
+#. after the "\n" will then be padded to align with the
+#. command name, such as N_("git cmd [opt]\n<8
+#. spaces>[opt2]"), where the 8 spaces are the same length as
+#. "git cmd ".
+#. *
+#. This format string prints out that already-translated
+#. line. The "%*s" is whitespace padding to account for the
+#. padding at the start of the line that we add in this
+#. function. The "%s" is a line in the (hopefully already
+#. translated) N_() usage string, which contained embedded
+#. newlines before we split it up.
+#.
+#, c-format
+msgid "%*s%s"
+msgstr "%*s%s"
+
+#, c-format
+msgid " %s"
+msgstr " %s"
+
+msgid "-NUM"
+msgstr "-NUM"
+
+#, c-format
+msgid "opposite of --no-%s"
+msgstr "протилежне --no-%s"
+
+msgid "expiry-date"
+msgstr "Ð·Ð°ÐºÑ–Ð½Ñ‡ÐµÐ½Ð½Ñ Ñтроку дії"
+
+msgid "no-op (backward compatibility)"
+msgstr "не працює (зворотна ÑуміÑніÑÑ‚ÑŒ)"
+
+msgid "be more verbose"
+msgstr "надавати більш розгорнутий вивід"
+
+msgid "be more quiet"
+msgstr "надавати менш розгорнутий вивід"
+
+msgid "use <n> digits to display object names"
+msgstr "викориÑтовувати <n> цифр Ð´Ð»Ñ Ð²Ñ–Ð´Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð½Ð°Ð·Ð² обʼєктів"
+
+msgid "prefixed path to initial superproject"
+msgstr "префікÑний шлÑÑ… до початкового Ñуперпроекту"
+
+msgid "how to strip spaces and #comments from message"
+msgstr "Ñк прибирати пробіли та #коментарі з допиÑу"
+
+msgid "read pathspec from file"
+msgstr "прочитати визначник шлÑху з файлу"
+
+msgid ""
+"with --pathspec-from-file, pathspec elements are separated with NUL character"
+msgstr ""
+"за допомогою --pathspec-from-file елементи визначника шлÑху відокремлюютьÑÑ "
+"Ñимволом NUL"
+
+#, c-format
+msgid "bad boolean environment value '%s' for '%s'"
+msgstr "невірне булеве Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¾Ñ‚Ð¾Ñ‡ÐµÐ½Ð½Ñ \"%s\" Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "failed to parse %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ %s"
+
+#, c-format
+msgid "Could not make %s writable by group"
+msgstr "Ðе вдалоÑÑ Ð·Ñ€Ð¾Ð±Ð¸Ñ‚Ð¸ %s доÑтупним Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу групою"
+
+msgid "Escape character '\\' not allowed as last character in attr value"
+msgstr ""
+"Символ ÐµÐºÑ€Ð°Ð½ÑƒÐ²Ð°Ð½Ð½Ñ \"\\\" не дозволÑєтьÑÑ Ñк оÑтанній Ñимвол у значенні "
+"атрибута"
+
+msgid "Only one 'attr:' specification is allowed."
+msgstr "Дозволений лише один визначник \"attr:\"."
+
+msgid "attr spec must not be empty"
+msgstr "визначник атрибута повинен бути не порожнім"
+
+#, c-format
+msgid "invalid attribute name %s"
+msgstr "невірна назва атрибуту %s"
+
+msgid "global 'glob' and 'noglob' pathspec settings are incompatible"
+msgstr "глобальні параметри визначника шлÑху \"glob\" та \"noglob\" неÑуміÑні"
+
+msgid ""
+"global 'literal' pathspec setting is incompatible with all other global "
+"pathspec settings"
+msgstr ""
+"глобальний параметр \"literal\" визначника шлÑху неÑуміÑний з уÑіма іншими "
+"глобальними параметрами визначника шлÑху"
+
+msgid "invalid parameter for pathspec magic 'prefix'"
+msgstr ""
+"неприпуÑтимий параметр Ð´Ð»Ñ Ð¼Ð°Ð³Ñ–Ñ‡Ð½Ð¾Ð³Ð¾ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"prefix\" визначника шлÑху"
+
+#, c-format
+msgid "Invalid pathspec magic '%.*s' in '%s'"
+msgstr "ÐеприпуÑтиме магічне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"%.*s\" Ð´Ð»Ñ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð½Ð¸ÐºÐ° шлÑху в \"%s\""
+
+#, c-format
+msgid "Missing ')' at the end of pathspec magic in '%s'"
+msgstr ""
+"Пропущено \")\" наприкінці магічного Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð½Ð¸ÐºÐ° шлÑху в \"%s\""
+
+#, c-format
+msgid "Unimplemented pathspec magic '%c' in '%s'"
+msgstr "Ðереалізоване магічне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"%c\" Ð´Ð»Ñ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð½Ð¸ÐºÐ° шлÑху в \"%s\""
+
+#, c-format
+msgid "%s: 'literal' and 'glob' are incompatible"
+msgstr "%s: \"literal\" та \"glob\" неÑуміÑні"
+
+#, c-format
+msgid "'%s' is outside the directory tree"
+msgstr "\"%s\" знаходитьÑÑ Ð¿Ð¾Ð·Ð° деревом директорій"
+
+#, c-format
+msgid "%s: '%s' is outside repository at '%s'"
+msgstr "%s: \"%s\" знаходитьÑÑ Ð·Ð° межами Ñховища за адреÑою \"%s\""
+
+#, c-format
+msgid "'%s' (mnemonic: '%c')"
+msgstr "\"%s\" (мнемонічно: \"%c\")"
+
+#, c-format
+msgid "%s: pathspec magic not supported by this command: %s"
+msgstr ""
+"%s: магічне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð½Ð¸ÐºÐ° шлÑху не підтримуєтьÑÑ Ñ†Ñ–Ñ”ÑŽ командою: %s"
+
+#, c-format
+msgid "pathspec '%s' is beyond a symbolic link"
+msgstr "визначник шлÑху \"%s\" знаходитьÑÑ Ð·Ð° межами Ñимвольного поÑиланнÑ"
+
+#, c-format
+msgid "line is badly quoted: %s"
+msgstr "Ñ€Ñдок взÑто в лапки невірно: %s"
+
+msgid "unable to write flush packet"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати flush пакет"
+
+msgid "unable to write delim packet"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати delim пакет"
+
+msgid "unable to write response end packet"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати response end пакет"
+
+msgid "flush packet write failed"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати flush пакет"
+
+msgid "protocol error: impossibly long line"
+msgstr "помилка протоколу: неймовірно довгий Ñ€Ñдок"
+
+msgid "packet write with format failed"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати пакет з форматуваннÑм"
+
+msgid "packet write failed - data exceeds max packet size"
+msgstr ""
+"не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати пакет - дані перевищують макÑимальний розмір пакета"
+
+#, c-format
+msgid "packet write failed: %s"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати пакет: %s"
+
+msgid "read error"
+msgstr "помилка зчитуваннÑ"
+
+msgid "the remote end hung up unexpectedly"
+msgstr "віддалене Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½ÐµÑподівано відключилоÑÑ"
+
+#, c-format
+msgid "protocol error: bad line length character: %.4s"
+msgstr "помилка протоколу: невірний Ñимвол довжини Ñ€Ñдка: %.4s"
+
+#, c-format
+msgid "protocol error: bad line length %d"
+msgstr "помилка протоколу: невірна довжина Ñ€Ñдка %d"
+
+#, c-format
+msgid "remote error: %s"
+msgstr "помилка віддаленого призначеннÑ: %s"
+
+msgid "Refreshing index"
+msgstr "ÐžÐ½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ñ–Ð½Ð´ÐµÐºÑа"
+
+#, c-format
+msgid "unable to create threaded lstat: %s"
+msgstr "не вдалоÑÑ Ñтворити потоковий lstat: %s"
+
+msgid "unable to parse --pretty format"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ --pretty формат"
+
+msgid "promisor-remote: unable to fork off fetch subprocess"
+msgstr "promisor-remote: не вдалоÑÑ Ñ€Ð¾Ð·Ð³Ð°Ð»ÑƒÐ¶Ð¸Ñ‚Ð¸ Ð¿Ñ–Ð´Ð¿Ñ€Ð¾Ñ†ÐµÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ"
+
+msgid "promisor-remote: could not write to fetch subprocess"
+msgstr "promisor-remote: не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати до підпроцеÑу отриманнÑ"
+
+msgid "promisor-remote: could not close stdin to fetch subprocess"
+msgstr "promisor-remote: не вдалоÑÑ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¸ stdin Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¿Ñ€Ð¾Ñ†ÐµÑу отриманнÑ"
+
+#, c-format
+msgid "promisor remote name cannot begin with '/': %s"
+msgstr "назва віддаленого promisor не може починатиÑÑ Ð· \"/\": %s"
+
+#, c-format
+msgid "could not fetch %s from promisor remote"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ %s з віддаленого promisor"
+
+msgid "object-info: expected flush after arguments"
+msgstr "object-info: очікувавÑÑ flush піÑÐ»Ñ Ð°Ñ€Ð³ÑƒÐ¼ÐµÐ½Ñ‚Ñ–Ð²"
+
+msgid "Removing duplicate objects"
+msgstr "Ð’Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð´ÑƒÐ±Ð»Ñ–ÐºÐ°Ñ‚Ñ–Ð² обʼєктів"
+
+msgid "could not start `log`"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ð¾Ñ‡Ð°Ñ‚Ð¸ \"log\""
+
+msgid "could not read `log` output"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ \"log\" вивід"
+
+#, c-format
+msgid "could not parse commit '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ коміт \"%s\""
+
+#, c-format
+msgid ""
+"could not parse first line of `log` output: did not start with 'commit ': "
+"'%s'"
+msgstr ""
+"не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ перший Ñ€Ñдок \"log\" виводу: не починавÑÑ Ð· \"commit "
+"\"': \"%s\""
+
+#, c-format
+msgid "could not parse git header '%.*s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ git заголовок \"%.*s\""
+
+msgid "failed to generate diff"
+msgstr "не вдалоÑÑ Ð·Ð³ÐµÐ½ÐµÑ€ÑƒÐ²Ð°Ñ‚Ð¸ різницю"
+
+#, c-format
+msgid "could not parse log for '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ журнал Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "invalid extra cruft tip: '%s'"
+msgstr "неприпуÑтима додаткова марна верхівка: \"%s\""
+
+msgid "unable to enumerate additional recent objects"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÑ€Ð°Ñ…ÑƒÐ²Ð°Ñ‚Ð¸ додаткові нещодавні обʼєкти"
+
+#, c-format
+msgid "will not add file alias '%s' ('%s' already exists in index)"
+msgstr "не додаємо пÑевдонім файлу \"%s\" (\"%s\" вже Ñ–Ñнує в індекÑÑ–)"
+
+msgid "cannot create an empty blob in the object database"
+msgstr "неможливо Ñтворити порожній blob в базі даних обʼєктів"
+
+#, c-format
+msgid "%s: can only add regular files, symbolic links or git-directories"
+msgstr ""
+"%s: може додавати лише звичайні файли, Ñимвольні поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð°Ð±Ð¾ git-директорії"
+
+#, c-format
+msgid "unable to index file '%s'"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ–Ð½Ð´ÐµÐºÑувати файл \"%s\""
+
+#, c-format
+msgid "unable to add '%s' to index"
+msgstr "не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ \"%s\" до індекÑу"
+
+#, c-format
+msgid "'%s' appears as both a file and as a directory"
+msgstr "\"%s\" відображаєтьÑÑ Ñк файл Ñ– Ñк каталог"
+
+msgid "Refresh index"
+msgstr "Оновити індекÑ"
+
+#, c-format
+msgid ""
+"index.version set, but the value is invalid.\n"
+"Using version %i"
+msgstr ""
+"index.version вÑтановлено, але Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½ÐµÐ¿Ñ€Ð¸Ð¿ÑƒÑтиме.\n"
+"ВикориÑÑ‚Ð°Ð½Ð½Ñ Ð²ÐµÑ€ÑÑ–Ñ— %i"
+
+#, c-format
+msgid ""
+"GIT_INDEX_VERSION set, but the value is invalid.\n"
+"Using version %i"
+msgstr ""
+"GIT_INDEX_VERSION вÑтановлено, але Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½ÐµÐ¿Ñ€Ð¸Ð¿ÑƒÑтиме.\n"
+"ВикориÑÑ‚Ð°Ð½Ð½Ñ Ð²ÐµÑ€ÑÑ–Ñ— %i"
+
+#, c-format
+msgid "bad signature 0x%08x"
+msgstr "невірний Ð¿Ñ–Ð´Ð¿Ð¸Ñ 0x%08x"
+
+#, c-format
+msgid "bad index version %d"
+msgstr "невірна верÑÑ–Ñ Ñ–Ð½Ð´ÐµÐºÑу %d"
+
+msgid "bad index file sha1 signature"
+msgstr "невірний sha1 Ð¿Ñ–Ð´Ð¿Ð¸Ñ Ñ–Ð½Ð´ÐµÐºÑного файлу"
+
+#, c-format
+msgid "index uses %.4s extension, which we do not understand"
+msgstr "Ñ–Ð½Ð´ÐµÐºÑ Ð²Ð¸ÐºÐ¾Ñ€Ð¸Ñтовує %.4s розширеннÑ, Ñке ми не розуміємо"
+
+#, c-format
+msgid "ignoring %.4s extension"
+msgstr "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ %.4s розширеннÑ"
+
+#, c-format
+msgid "unknown index entry format 0x%08x"
+msgstr "невідомий формат запиÑу індекÑу 0x%08x"
+
+#, c-format
+msgid "malformed name field in the index, near path '%s'"
+msgstr "невірно Ñформоване поле назви в індекÑÑ– Ð±Ñ–Ð»Ñ ÑˆÐ»Ñху \"%s\""
+
+msgid "unordered stage entries in index"
+msgstr "невпорÑдковані запиÑи в індекÑÑ–"
+
+#, c-format
+msgid "multiple stage entries for merged file '%s'"
+msgstr "багатоÑтупеневі запиÑи Ð´Ð»Ñ Ð·Ð»Ð¸Ñ‚Ð¾Ð³Ð¾ файлу \"%s\""
+
+#, c-format
+msgid "unordered stage entries for '%s'"
+msgstr "невпорÑдковані запиÑи індекÑу Ð´Ð»Ñ '%s'"
+
+#, c-format
+msgid "unable to create load_cache_entries thread: %s"
+msgstr "не вдалоÑÑ Ñтворити потік load_cache_entries: %s"
+
+#, c-format
+msgid "unable to join load_cache_entries thread: %s"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¸Ñ”Ð´Ð½Ð°Ñ‚Ð¸ÑÑ Ð´Ð¾ потоку load_cache_entries: %s"
+
+#, c-format
+msgid "%s: index file open failed"
+msgstr "%s: не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ індекÑний файл"
+
+#, c-format
+msgid "%s: cannot stat the open index"
+msgstr "%s: не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ stat відкритого індекÑу"
+
+#, c-format
+msgid "%s: index file smaller than expected"
+msgstr "%s: індекÑний файл менший, ніж очікувавÑÑ"
+
+#, c-format
+msgid "%s: unable to map index file%s"
+msgstr "%s: не вдалоÑÑ Ð·Ñ–Ñтавити індекÑний файл%s"
+
+#, c-format
+msgid "unable to create load_index_extensions thread: %s"
+msgstr "не вдалоÑÑ Ñтворити потік load_index_extensions: %s"
+
+#, c-format
+msgid "unable to join load_index_extensions thread: %s"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¸Ñ”Ð´Ð½Ð°Ñ‚Ð¸ÑÑ Ð´Ð¾ потоку load_index_extensions: %s"
+
+#, c-format
+msgid "could not freshen shared index '%s'"
+msgstr "не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ Ñпільний Ñ–Ð½Ð´ÐµÐºÑ \"%s\""
+
+#, c-format
+msgid "broken index, expect %s in %s, got %s"
+msgstr "пошкоджений індекÑ, очікувавÑÑ %s у %s, отримано %s"
+
+msgid "cannot write split index for a sparse index"
+msgstr "неможливо запиÑати розділений Ñ–Ð½Ð´ÐµÐºÑ Ð´Ð»Ñ Ñ€Ð¾Ð·Ñ€Ñ–Ð´Ð¶ÐµÐ½Ð¾Ð³Ð¾ індекÑу"
+
+msgid "failed to convert to a sparse-index"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€Ð¸Ñ‚Ð¸ в sparse-index"
+
+#, c-format
+msgid "unable to open git dir: %s"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ git-директорію: %s"
+
+#, c-format
+msgid "unable to unlink: %s"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸: %s"
+
+#, c-format
+msgid "cannot fix permission bits on '%s'"
+msgstr "неможливо виправити біти дозволу на \"%s\""
+
+#, c-format
+msgid "%s: cannot drop to stage #0"
+msgstr "%s: неможливо Ñкинути Ñ–Ð½Ð´ÐµÐºÑ Ð´Ð¾ Ñтану #0"
+
+#, c-format
+msgid "unexpected diff status %c"
+msgstr "неочікуваний ÑÑ‚Ð°Ñ‚ÑƒÑ diff %c"
+
+#, c-format
+msgid "remove '%s'\n"
+msgstr "видалити \"%s\"\n"
+
+msgid ""
+"You can fix this with 'git rebase --edit-todo' and then run 'git rebase --"
+"continue'.\n"
+"Or you can abort the rebase with 'git rebase --abort'.\n"
+msgstr ""
+"Ви можете виправити це командою \"git rebase --edit-todo\", а потім "
+"запуÑтити \"git rebase --continue\".\n"
+"Ðбо ви можете перервати Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ Ð·Ð° допомогою \"git rebase --abort\".\n"
+
+#, c-format
+msgid ""
+"unrecognized setting %s for option rebase.missingCommitsCheck. Ignoring."
+msgstr ""
+"нерозпізнане Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ %s Ð´Ð»Ñ Ð¾Ð¿Ñ†Ñ–Ñ— rebase.missingCommitsCheck. ІгноруєтьÑÑ."
+
+msgid ""
+"\n"
+"Commands:\n"
+"p, pick <commit> = use commit\n"
+"r, reword <commit> = use commit, but edit the commit message\n"
+"e, edit <commit> = use commit, but stop for amending\n"
+"s, squash <commit> = use commit, but meld into previous commit\n"
+"f, fixup [-C | -c] <commit> = like \"squash\" but keep only the previous\n"
+" commit's log message, unless -C is used, in which case\n"
+" keep only this commit's message; -c is same as -C but\n"
+" opens the editor\n"
+"x, exec <command> = run command (the rest of the line) using shell\n"
+"b, break = stop here (continue rebase later with 'git rebase --continue')\n"
+"d, drop <commit> = remove commit\n"
+"l, label <label> = label current HEAD with a name\n"
+"t, reset <label> = reset HEAD to a label\n"
+"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
+" create a merge commit using the original merge commit's\n"
+" message (or the oneline, if no original merge commit was\n"
+" specified); use -c <commit> to reword the commit message\n"
+"u, update-ref <ref> = track a placeholder for the <ref> to be updated\n"
+" to this position in the new commits. The <ref> is\n"
+" updated at the end of the rebase\n"
+"\n"
+"These lines can be re-ordered; they are executed from top to bottom.\n"
+msgstr ""
+"\n"
+"Команди:\n"
+"p, pick <коміт> = викориÑтати коміт\n"
+"r, reword <коміт> = викориÑтати коміт, але відредагувати Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту\n"
+"e, edit <коміт> = викориÑтати коміт, але зупинитиÑÑŒ Ð´Ð»Ñ Ð²Ð½ÐµÑÐµÐ½Ð½Ñ Ð¿Ð¾Ð¿Ñ€Ð°Ð²Ð¾Ðº\n"
+"s, squash <коміт> = викориÑтати коміт, але обʼєднати з попереднім комітом\n"
+"f, fixup [-C | -c] <коміт> = Ñк \"squash\", але зберігає лише попередній\n"
+" Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту, Ñкщо тільки не вказана Ð¾Ð¿Ñ†Ñ–Ñ -С, у Ñкому "
+"разі\n"
+" зберігаєтьÑÑ Ð»Ð¸ÑˆÐµ Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ цього коміту; -c - те Ñаме, що "
+"й -C, але\n"
+" відкриває редактор\n"
+"x, exec <команда> = виконати команду (решту Ñ€Ñдка) за допомогою shell\n"
+"b, break = зупинитиÑÑŒ тут (продовжити Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ñ–Ð·Ð½Ñ–ÑˆÐµ за допомогою "
+"'git rebase --continue')\n"
+"d, drop <коміт> = видалити коміт\n"
+"l, label <мітка> = помітити поточний HEAD назвою\n"
+"t, reset <мітка> = Ñкинути HEAD до мітки\n"
+"m, merge [-C <коміт> | -c <коміт>] <мітка> [# <однорÑдковий допиÑ>]\n"
+" Ñтворити коміт злиттÑ, викориÑтовуючи Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ початкового коміту\n"
+" Ð·Ð»Ð¸Ñ‚Ñ‚Ñ (або однорÑдковий допиÑ, Ñкщо не було вказано коміт\n"
+" злиттÑ); викориÑтовуйте -c <коміт>, щоб перефразувати Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ "
+"коміту\n"
+"u, update-ref <поÑиланнÑ> = відÑтежити заповнювач Ð´Ð»Ñ <поÑиланнÑ>, Ñке "
+"потрібно оновити\n"
+" до цієї позиції у нових комітах. <поÑиланнÑ>\n"
+" оновлюєтьÑÑ Ð² кінці перебазуваннÑ\n"
+"\n"
+"Ці Ñ€Ñдки можна переупорÑдкувати; вони виконуютьÑÑ Ð·Ð²ÐµÑ€Ñ…Ñƒ вниз.\n"
+
+#, c-format
+msgid "Rebase %s onto %s (%d command)"
+msgid_plural "Rebase %s onto %s (%d commands)"
+msgstr[0] "ÐŸÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ %s на %s (%d команда)"
+msgstr[1] "ÐŸÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ %s на %s (%d команди)"
+msgstr[2] "ÐŸÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ %s на %s (%d команд)"
+
+msgid ""
+"\n"
+"Do not remove any line. Use 'drop' explicitly to remove a commit.\n"
+msgstr ""
+"\n"
+"Ðе видалÑйте жодного Ñ€Ñдка. ВикориÑтовуйте \"drop\", щоб Ñвно видалити "
+"коміт.\n"
+
+msgid ""
+"\n"
+"If you remove a line here THAT COMMIT WILL BE LOST.\n"
+msgstr ""
+"\n"
+"Якщо ви видалите тут Ñ€Ñдок, ЦЕЙ КОМІТ БУДЕ ВТРÐЧЕÐО.\n"
+
+msgid ""
+"\n"
+"You are editing the todo file of an ongoing interactive rebase.\n"
+"To continue rebase after editing, run:\n"
+" git rebase --continue\n"
+"\n"
+msgstr ""
+"\n"
+"Ви редагуєте файл todo поточного інтерактивного перебазуваннÑ.\n"
+"Щоб продовжити Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ñ–ÑÐ»Ñ Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ, виконайте:\n"
+" git rebase --continue\n"
+
+msgid ""
+"\n"
+"However, if you remove everything, the rebase will be aborted.\n"
+"\n"
+msgstr ""
+"\n"
+"Однак, Ñкщо ви видалите вÑе, Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ Ð±ÑƒÐ´Ðµ перервано.\n"
+"\n"
+
+#, c-format
+msgid "could not write '%s'."
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати \"%s\"."
+
+#, c-format
+msgid ""
+"Warning: some commits may have been dropped accidentally.\n"
+"Dropped commits (newer to older):\n"
+msgstr ""
+"ПопередженнÑ: деÑкі коміти могли бути видалені випадково.\n"
+"Скинуті коміти (від новіших до Ñтаріших):\n"
+
+#, c-format
+msgid ""
+"To avoid this message, use \"drop\" to explicitly remove a commit.\n"
+"\n"
+"Use 'git config rebase.missingCommitsCheck' to change the level of "
+"warnings.\n"
+"The possible behaviours are: ignore, warn, error.\n"
+"\n"
+msgstr ""
+"Щоб уникнути цього повідомленнÑ, викориÑтовуйте \"drop\" Ð´Ð»Ñ Ñвного "
+"Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ.\n"
+"\n"
+"ВикориÑтовуйте \"git config rebase.missingCommitsCheck\" Ð´Ð»Ñ Ð·Ð¼Ñ–Ð½Ð¸ Ñ€Ñ–Ð²Ð½Ñ "
+"попереджень.\n"
+"Можливі варіанти поведінки: ignore, warn, error.\n"
+
+#, c-format
+msgid "%s: 'preserve' superseded by 'merges'"
+msgstr "%s: \"preserve\" замінено на \"merges\""
+
+msgid "gone"
+msgstr "відÑутнє"
+
+#, c-format
+msgid "ahead %d"
+msgstr "попереду %d"
+
+#, c-format
+msgid "behind %d"
+msgstr "позаду %d"
+
+#, c-format
+msgid "ahead %d, behind %d"
+msgstr "попереду %d, позаду %d"
+
+#, c-format
+msgid "%%(%.*s) does not take arguments"
+msgstr "%%(%.*s) не приймає аргументів"
+
+#, c-format
+msgid "unrecognized %%(%.*s) argument: %s"
+msgstr "нерозпізнаний %%(%.*s) аргумент: %s"
+
+#, c-format
+msgid "expected format: %%(color:<color>)"
+msgstr "очікуваний формат: %%(color:<колір>)"
+
+#, c-format
+msgid "unrecognized color: %%(color:%s)"
+msgstr "нерозпізнаний колір: %%(color:%s)"
+
+#, c-format
+msgid "Integer value expected refname:lstrip=%s"
+msgstr "ОчікувалоÑÑŒ ціле чиÑло refname:lstrip=%s"
+
+#, c-format
+msgid "Integer value expected refname:rstrip=%s"
+msgstr "ОчікувалоÑÑŒ ціле чиÑло refname:rstrip=%s"
+
+#, c-format
+msgid "expected %%(trailers:key=<value>)"
+msgstr "очікувалоÑÑŒ %%(trailers:key=<значеннÑ>)"
+
+#, c-format
+msgid "unknown %%(trailers) argument: %s"
+msgstr "невідомий %%(trailers) аргумент: %s"
+
+#, c-format
+msgid "positive value expected contents:lines=%s"
+msgstr "очікувалоÑÑŒ додатне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ contents:lines=%s"
+
+#, c-format
+msgid "argument expected for %s"
+msgstr "очікувавÑÑ Ð°Ñ€Ð³ÑƒÐ¼ÐµÐ½Ñ‚ Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "positive value expected %s=%s"
+msgstr "очікувалоÑÑŒ додатне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ %s=%s"
+
+#, c-format
+msgid "cannot fully parse %s=%s"
+msgstr "неможливо повніÑÑ‚ÑŽ розібрати %s=%s"
+
+#, c-format
+msgid "value expected %s="
+msgstr "очікувалоÑÑŒ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ %s="
+
+#, c-format
+msgid "positive value expected '%s' in %%(%s)"
+msgstr "очікувалоÑÑŒ додатне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"%s\" в %%(%s)"
+
+#, c-format
+msgid "expected format: %%(align:<width>,<position>)"
+msgstr "очікуваний формат: %%(align:<ширина>,<позиціÑ>)"
+
+#, c-format
+msgid "unrecognized position:%s"
+msgstr "нерозпізнана позиціÑ:%s"
+
+#, c-format
+msgid "unrecognized width:%s"
+msgstr "нерозпізнана ширина:%s"
+
+#, c-format
+msgid "unrecognized %%(%s) argument: %s"
+msgstr "нерозпізнаний %%(%s) аргумент: %s"
+
+#, c-format
+msgid "positive width expected with the %%(align) atom"
+msgstr "очікувалаÑÑŒ додатна ширина з %%(align) чаÑткою"
+
+#, c-format
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "очікуваний формат: %%(ahead-behind:<комітоподібне>)"
+
+#, c-format
+msgid "malformed field name: %.*s"
+msgstr "невірно Ñформована назва полÑ: %.*s"
+
+#, c-format
+msgid "unknown field name: %.*s"
+msgstr "невідома назва полÑ: %.*s"
+
+#, c-format
+msgid ""
+"not a git repository, but the field '%.*s' requires access to object data"
+msgstr "не git Ñховище, але поле \"%.*s\" потребує доÑтупу до даних обʼєкта"
+
+#, c-format
+msgid "format: %%(%s) atom used without a %%(%s) atom"
+msgstr "формат: чаÑтка %%(%s) викориÑтано без чаÑтки %%(%s)"
+
+#, c-format
+msgid "format: %%(then) atom used more than once"
+msgstr "формат: %%(then) чаÑтка викориÑтана більше одного разу"
+
+#, c-format
+msgid "format: %%(then) atom used after %%(else)"
+msgstr "формат: %%(then) чаÑтка викориÑтана піÑÐ»Ñ %%(else)"
+
+#, c-format
+msgid "format: %%(else) atom used more than once"
+msgstr "формат: %%(else) чаÑтка викориÑтана більше одного разу"
+
+#, c-format
+msgid "format: %%(end) atom used without corresponding atom"
+msgstr "формат: %%(end) чаÑтка викориÑтана без відповідної чаÑтки"
+
+#, c-format
+msgid "malformed format string %s"
+msgstr "невірно Ñформований Ñ€Ñдок Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ %s"
+
+#, c-format
+msgid "this command reject atom %%(%.*s)"
+msgstr "Ñ†Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° відхилÑÑ” чаÑтку %%(%.*s)"
+
+#, c-format
+msgid "--format=%.*s cannot be used with --python, --shell, --tcl"
+msgstr "--format=%.*s не може бути викориÑтаний з --python, --shell, --tcl"
+
+msgid "failed to run 'describe'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити команду \"describe\""
+
+#, c-format
+msgid "(no branch, rebasing %s)"
+msgstr "(немає гілки, Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ %s)"
+
+#, c-format
+msgid "(no branch, rebasing detached HEAD %s)"
+msgstr "(немає гілки, Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ñ–Ð´Ð¾ÐºÑ€ÐµÐ¼Ð»ÐµÐ½Ð¾Ð³Ð¾ HEAD %s)"
+
+#, c-format
+msgid "(no branch, bisect started on %s)"
+msgstr "(немає гілки, біÑекцію розпочато на %s)"
+
+#, c-format
+msgid "(HEAD detached at %s)"
+msgstr "(HEAD відʼєднано на %s)"
+
+#, c-format
+msgid "(HEAD detached from %s)"
+msgstr "(HEAD відʼєднано від %s)"
+
+msgid "(no branch)"
+msgstr "(немає гілки)"
+
+#, c-format
+msgid "missing object %s for %s"
+msgstr "відÑутній обʼєкт %s Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "parse_object_buffer failed on %s for %s"
+msgstr "parse_object_buffer завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾ на %s Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "malformed object at '%s'"
+msgstr "невірно Ñформований обʼєкт за адреÑою \"%s\""
+
+#, c-format
+msgid "ignoring ref with broken name %s"
+msgstr "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð¾ÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð· пошкодженою назвою %s"
+
+#, c-format
+msgid "ignoring broken ref %s"
+msgstr "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð¾ÑˆÐºÐ¾Ð´Ð¶ÐµÐ½Ð¸Ñ… поÑилань %s"
+
+#, c-format
+msgid "format: %%(end) atom missing"
+msgstr "формат: %%(end) чаÑтка відÑутнÑ"
+
+#, c-format
+msgid "malformed object name %s"
+msgstr "невірно Ñформована назва обʼєкта %s"
+
+#, c-format
+msgid "option `%s' must point to a commit"
+msgstr "Ð¾Ð¿Ñ†Ñ–Ñ \"%s\" повинна вказувати на коміт"
+
+msgid "key"
+msgstr "ключ"
+
+msgid "field name to sort on"
+msgstr "назва Ð¿Ð¾Ð»Ñ Ð´Ð»Ñ ÑортуваннÑ"
+
+msgid "exclude refs which match pattern"
+msgstr "виключити поÑиланнÑ, Ñкі збігаютьÑÑ Ð· шаблоном"
+
+#, c-format
+msgid "not a reflog: %s"
+msgstr "не Ñ” журналом поÑилань: %s"
+
+#, c-format
+msgid "no reflog for '%s'"
+msgstr "немає журналу поÑилань Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "%s does not point to a valid object!"
+msgstr "%s не вказує на допуÑтимий обʼєкт!"
+
+#, c-format
+msgid ""
+"Using '%s' as the name for the initial branch. This default branch name\n"
+"is subject to change. To configure the initial branch name to use in all\n"
+"of your new repositories, which will suppress this warning, call:\n"
+"\n"
+"\tgit config --global init.defaultBranch <name>\n"
+"\n"
+"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n"
+"'development'. The just-created branch can be renamed via this command:\n"
+"\n"
+"\tgit branch -m <name>\n"
+msgstr ""
+"ВикориÑÑ‚Ð°Ð½Ð½Ñ \"%s\" Ñк назви початкової гілки. Ðазву гілки за замовчуваннÑм\n"
+"може бути змінено. Щоб налаштувати назву початкової гілки Ð´Ð»Ñ Ð²Ð¸ÐºÐ¾Ñ€Ð¸ÑÑ‚Ð°Ð½Ð½Ñ Ñƒ "
+"вÑÑ–Ñ…\n"
+"ваших нових Ñховищах, що приховає це попередженнÑ, викличте\n"
+"\n"
+"\tgit config --global init.defaultBranch <назва>.\n"
+"\n"
+"ЗаміÑÑ‚ÑŒ \"master\" зазвичай викориÑтовують такі назви, Ñк \"main\", "
+"\"trunk\" та\n"
+"\"development\". Щойно Ñтворену гілку можна перейменувати за допомогою цієї "
+"команди:\n"
+"\n"
+"\tgit branch -m <назва>\n"
+
+#, c-format
+msgid "could not retrieve `%s`"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ \"%s\""
+
+#, c-format
+msgid "invalid branch name: %s = %s"
+msgstr "неприпуÑтима назва гілки: %s = %s"
+
+#, c-format
+msgid "ignoring dangling symref %s"
+msgstr "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¸ÑÑчих symref %s"
+
+#, c-format
+msgid "log for ref %s has gap after %s"
+msgstr "лог Ð´Ð»Ñ Ð¿Ð¾ÑÐ¸Ð»Ð°Ð½Ð½Ñ %s має пропуÑк піÑÐ»Ñ %s"
+
+#, c-format
+msgid "log for ref %s unexpectedly ended on %s"
+msgstr "лог Ð´Ð»Ñ Ð¿Ð¾ÑÐ¸Ð»Ð°Ð½Ð½Ñ %s неÑподівано завершивÑÑ Ð½Ð° %s"
+
+#, c-format
+msgid "log for %s is empty"
+msgstr "лог Ð´Ð»Ñ %s порожній"
+
+#, c-format
+msgid "refusing to update ref with bad name '%s'"
+msgstr "відмовлено в оновленні поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð· невірною назвою \"%s\""
+
+#, c-format
+msgid "update_ref failed for ref '%s': %s"
+msgstr "update_ref завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾ Ð´Ð»Ñ Ð¿Ð¾ÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\": %s"
+
+#, c-format
+msgid "multiple updates for ref '%s' not allowed"
+msgstr "багатократні Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ð¿Ð¾ÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\" заборонені"
+
+msgid "ref updates forbidden inside quarantine environment"
+msgstr "Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð¿Ð¾Ñилань заборонено у карантинному Ñередовищі"
+
+msgid "ref updates aborted by hook"
+msgstr "Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð¿Ð¾Ñилань перервано гачком"
+
+#, c-format
+msgid "'%s' exists; cannot create '%s'"
+msgstr "\"%s\" Ñ–Ñнує; неможливо Ñтворити \"%s\""
+
+#, c-format
+msgid "cannot process '%s' and '%s' at the same time"
+msgstr "неможливо обробити \"%s\" Ñ– \"%s\" одночаÑно"
+
+#, c-format
+msgid "could not delete reference %s: %s"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ поÑÐ¸Ð»Ð°Ð½Ð½Ñ %s: %s"
+
+#, c-format
+msgid "could not delete references: %s"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ поÑиланнÑ: %s"
+
+#, c-format
+msgid "invalid refspec '%s'"
+msgstr "неприпуÑтимий визначник поÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\""
+
+#, c-format
+msgid "invalid quoting in push-option value: '%s'"
+msgstr "неприпуÑтимі лапки у значенні push-опції: \"%s\""
+
+#, c-format
+msgid "%sinfo/refs not valid: is this a git repository?"
+msgstr "%sinfo/refs не дійÑні: це git Ñховище?"
+
+msgid "invalid server response; expected service, got flush packet"
+msgstr ""
+"неприпуÑтима відповідь Ñервера; очікувалоÑÑŒ service, отримано flush пакет"
+
+#, c-format
+msgid "invalid server response; got '%s'"
+msgstr "неприпуÑтима відповідь Ñервера; отримано \"%s\""
+
+#, c-format
+msgid "repository '%s' not found"
+msgstr "Ñховище \"%s\" не знайдено"
+
+#, c-format
+msgid "Authentication failed for '%s'"
+msgstr "Ðевдала Ð°ÑƒÑ‚ÐµÐ½Ñ‚Ð¸Ñ„Ñ–ÐºÐ°Ñ†Ñ–Ñ Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "unable to access '%s' with http.pinnedPubkey configuration: %s"
+msgstr ""
+"не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ доÑтуп до \"%s\" з конфігурацією http.pinnedPubkey: %s"
+
+#, c-format
+msgid "unable to access '%s': %s"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ доÑтуп до \"%s\": %s"
+
+#, c-format
+msgid "redirecting to %s"
+msgstr "Ð¿ÐµÑ€ÐµÐ½Ð°Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð½Ð° %s"
+
+msgid "shouldn't have EOF when not gentle on EOF"
+msgstr "не повинен мати EOF, Ñкщо не Ñ” обережним з EOF"
+
+msgid "remote server sent unexpected response end packet"
+msgstr "віддалений Ñервер надіÑлав неочікуваний response end пакет"
+
+msgid "unable to rewind rpc post data - try increasing http.postBuffer"
+msgstr ""
+"не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚Ð°Ñ‚Ð¸ вперед rpc post дані - Ñпробуйте збільшити http."
+"postBuffer"
+
+#, c-format
+msgid "remote-curl: bad line length character: %.4s"
+msgstr "remote-curl: невірний Ñимвол довжини Ñ€Ñдка: %.4s"
+
+msgid "remote-curl: unexpected response end packet"
+msgstr "remote-curl: неочікуваний response end пакет"
+
+#, c-format
+msgid "RPC failed; %s"
+msgstr "RPC завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾; %s"
+
+msgid "cannot handle pushes this big"
+msgstr "неможливо впоратиÑÑ Ð· такими великими надÑиланнÑми"
+
+#, c-format
+msgid "cannot deflate request; zlib deflate error %d"
+msgstr "неможливо запакувати запит; zlib помилка Ð¿Ð°ÐºÑƒÐ²Ð°Ð½Ð½Ñ %d"
+
+#, c-format
+msgid "cannot deflate request; zlib end error %d"
+msgstr "неможливо запакувати запит; zlib помилка Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð½Ñ %d"
+
+#, c-format
+msgid "%d bytes of length header were received"
+msgstr "%d байтів заголовку було отримано"
+
+#, c-format
+msgid "%d bytes of body are still expected"
+msgstr "%d байтів тіла вÑе ще очікуютьÑÑ"
+
+msgid "dumb http transport does not support shallow capabilities"
+msgstr "заÑіб передачі dumb http не підтримує shallow здібноÑÑ‚Ñ–"
+
+msgid "fetch failed."
+msgstr "Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ð»Ð¾ÑÑŒ невдало."
+
+msgid "cannot fetch by sha1 over smart http"
+msgstr "неможливо отримати дані за допомогою sha1 через smart http"
+
+#, c-format
+msgid "protocol error: expected sha/ref, got '%s'"
+msgstr "помилка протоколу: очікувалоÑÑŒ sha/ref, отримано \"%s\""
+
+#, c-format
+msgid "http transport does not support %s"
+msgstr "http заÑіб передачі не підтримує %s"
+
+msgid "protocol error: expected '<url> <path>', missing space"
+msgstr "помилка протоколу: очікувалоÑÑŒ \"<url> <шлÑÑ…>\", пропущено пробіл"
+
+#, c-format
+msgid "failed to download file at URL '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ файл за URL-адреÑою \"%s\""
+
+msgid "git-http-push failed"
+msgstr "git-http-push завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+msgid "remote-curl: usage: git remote-curl <remote> [<url>]"
+msgstr ""
+"remote-curl: викориÑтаннÑ: git remote-curl <віддаленe-призначеннÑ> [<url>]"
+
+msgid "remote-curl: error reading command stream from git"
+msgstr "remote-curl: помилка Ð·Ñ‡Ð¸Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð¾Ñ‚Ð¾ÐºÑƒ команд з git"
+
+msgid "remote-curl: fetch attempted without a local repo"
+msgstr "remote-curl: Ñпроба Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð±ÐµÐ· локального Ñховища"
+
+#, c-format
+msgid "remote-curl: unknown command '%s' from git"
+msgstr "remote-curl: невідома команда \"%s\" з git"
+
+#, c-format
+msgid "config remote shorthand cannot begin with '/': %s"
+msgstr "ÑÐºÐ¾Ñ€Ð¾Ñ‡ÐµÐ½Ð½Ñ Ð²Ñ–Ð´Ð´Ð°Ð»ÐµÐ½Ð¾Ñ— конфігураціі не може починатиÑÑ Ð· '/': %s"
+
+msgid "more than one receivepack given, using the first"
+msgstr "надано більше одного пакунка Ð´Ð»Ñ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ, викориÑтано перший"
+
+msgid "more than one uploadpack given, using the first"
+msgstr "надано більше одного пакунка Ð´Ð»Ñ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ, викориÑтано перший"
+
+#, c-format
+msgid "unrecognized value transfer.credentialsInUrl: '%s'"
+msgstr "нерозпізнане Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ transfer.credentialsInUrl: '%s'"
+
+#, c-format
+msgid "URL '%s' uses plaintext credentials"
+msgstr "URL-адреÑа \"%s\" викориÑтовує облікові дані у відкритому текÑÑ‚Ñ–"
+
+#, c-format
+msgid "Cannot fetch both %s and %s to %s"
+msgstr "Ðеможливо отримати Ñк %s, так Ñ– %s до %s"
+
+#, c-format
+msgid "%s usually tracks %s, not %s"
+msgstr "%s зазвичай відÑтежує %s, а не %s"
+
+#, c-format
+msgid "%s tracks both %s and %s"
+msgstr "%s відÑтежує Ñк %s, так Ñ– %s"
+
+#, c-format
+msgid "key '%s' of pattern had no '*'"
+msgstr "ключ '%s' шаблону не міÑтив '*'"
+
+#, c-format
+msgid "value '%s' of pattern has no '*'"
+msgstr "Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ '%s' шаблону не міÑтить '*'"
+
+#, c-format
+msgid "src refspec %s does not match any"
+msgstr "визначник поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð´Ð¶ÐµÑ€ÐµÐ»Ð° %s не збігаєтьÑÑ Ð· жодним"
+
+#, c-format
+msgid "src refspec %s matches more than one"
+msgstr "визначник поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð´Ð¶ÐµÑ€ÐµÐ»Ð° %s збігаєтьÑÑ Ð· більш ніж одним"
+
+#. TRANSLATORS: "matches '%s'%" is the <dst> part of "git push
+#. <remote> <src>:<dst>" push, and "being pushed ('%s')" is
+#. the <src>.
+#.
+#, c-format
+msgid ""
+"The destination you provided is not a full refname (i.e.,\n"
+"starting with \"refs/\"). We tried to guess what you meant by:\n"
+"\n"
+"- Looking for a ref that matches '%s' on the remote side.\n"
+"- Checking if the <src> being pushed ('%s')\n"
+" is a ref in \"refs/{heads,tags}/\". If so we add a corresponding\n"
+" refs/{heads,tags}/ prefix on the remote side.\n"
+"\n"
+"Neither worked, so we gave up. You must fully qualify the ref."
+msgstr ""
+"ПризначеннÑ, що ви вказали, не Ñ” повною назвою поÑÐ¸Ð»Ð°Ð½Ð½Ñ (такою,\n"
+"що починаєтьÑÑ Ð· \"refs/\"). Ми Ñпробували вгадати, що ви мали на увазі "
+"через:\n"
+"\n"
+"- Пошук поÑиланнÑ, Ñке відповідає \"%s\" на віддаленій Ñтороні.\n"
+"- Перевірку, чи Ñ” <джерело> надÑиланнÑ, (\"%s\")\n"
+" поÑиланнÑм у \"refs/{heads,tags}/\". Якщо так, то ми додаємо відповідний\n"
+" refs/{heads,tags}/ Ð¿Ñ€ÐµÑ„Ñ–ÐºÑ Ð½Ð° віддаленій Ñтороні.\n"
+"\n"
+"ÐÑ– те, ні інше не Ñпрацювало, тому ми здалиÑÑ. Ви повинні повніÑÑ‚ÑŽ "
+"кваліфікувати поÑиланнÑ."
+
+#, c-format
+msgid ""
+"The <src> part of the refspec is a commit object.\n"
+"Did you mean to create a new branch by pushing to\n"
+"'%s:refs/heads/%s'?"
+msgstr ""
+"ЧаÑтина <джерело> визаначника поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ñ” об’єктом коміту.\n"
+"Ви хотіли Ñтворити нову гілку, надіÑлавши зміни до\n"
+"\"%s:refs/heads/%s\"?"
+
+#, c-format
+msgid ""
+"The <src> part of the refspec is a tag object.\n"
+"Did you mean to create a new tag by pushing to\n"
+"'%s:refs/tags/%s'?"
+msgstr ""
+"ЧаÑтина <джерело> визаначника поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ñ” об’єктом тегу.\n"
+"Ви хотіли Ñтворити новий тег, надіÑлавши зміни до\n"
+"\"%s:refs/tags/%s\"?"
+
+#, c-format
+msgid ""
+"The <src> part of the refspec is a tree object.\n"
+"Did you mean to tag a new tree by pushing to\n"
+"'%s:refs/tags/%s'?"
+msgstr ""
+"ЧаÑтина <джерело> визаначника поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ñ” об’єктом дерева.\n"
+"Ви хотіли позначити нове дерево, надіÑлавши зміни до\n"
+"\"%s:refs/tags/%s\"?"
+
+#, c-format
+msgid ""
+"The <src> part of the refspec is a blob object.\n"
+"Did you mean to tag a new blob by pushing to\n"
+"'%s:refs/tags/%s'?"
+msgstr ""
+"ЧаÑтина <джерело> визаначника поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ñ” об’єктом blob.\n"
+"Ви хотіли позначити новий blob, надіÑлавши зміни до\n"
+"\"%s:refs/tags/%s\"?"
+
+#, c-format
+msgid "%s cannot be resolved to branch"
+msgstr "%s неможливо розвʼÑзати в гілку"
+
+#, c-format
+msgid "unable to delete '%s': remote ref does not exist"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ \"%s\": віддалене поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ðµ Ñ–Ñнує"
+
+#, c-format
+msgid "dst refspec %s matches more than one"
+msgstr "визаначник поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ %s збігаєтьÑÑ Ð· більш ніж одним"
+
+#, c-format
+msgid "dst ref %s receives from more than one src"
+msgstr "поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ %s отримує з більш ніж одного src"
+
+msgid "HEAD does not point to a branch"
+msgstr "HEAD не вказує на гілку"
+
+#, c-format
+msgid "no such branch: '%s'"
+msgstr "немає такої гілки: '%s'"
+
+#, c-format
+msgid "no upstream configured for branch '%s'"
+msgstr "першоджерельне Ñховище не налаштовано Ð´Ð»Ñ Ð³Ñ–Ð»ÐºÐ¸ '%s'"
+
+#, c-format
+msgid "upstream branch '%s' not stored as a remote-tracking branch"
+msgstr "виÑхідна гілка \"%s\" не збережена Ñк віддалено відÑтежувана гілка"
+
+#, c-format
+msgid "push destination '%s' on remote '%s' has no local tracking branch"
+msgstr ""
+"шлÑÑ… Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ð°Ð´ÑÐ¸Ð»Ð°Ð½Ð½Ñ \"%s\" на віддаленому \"%s\" не має гілки "
+"локального відÑтежуваннÑ"
+
+#, c-format
+msgid "branch '%s' has no remote for pushing"
+msgstr "гілка \"%s\" не має віддаленого Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ð½Ð°Ð´ÑиланнÑ"
+
+#, c-format
+msgid "push refspecs for '%s' do not include '%s'"
+msgstr "надіÑлані визначники поÑилань Ð´Ð»Ñ \"%s\" не включають \"%s\""
+
+msgid "push has no destination (push.default is 'nothing')"
+msgstr "надÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ðµ має Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ (push.default дорівнює 'nothing')"
+
+msgid "cannot resolve 'simple' push to a single destination"
+msgstr ""
+"неможливо розвʼÑзати \"simple\" надÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð´Ð¾ єдиного пункту призначеннÑ"
+
+#, c-format
+msgid "couldn't find remote ref %s"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ віддалене поÑÐ¸Ð»Ð°Ð½Ð½Ñ %s"
+
+#, c-format
+msgid "* Ignoring funny ref '%s' locally"
+msgstr "* Ð†Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ ÐºÑƒÐ¼ÐµÐ´Ð½Ð¸Ñ… поÑилань \"%s\" локально"
+
+#, c-format
+msgid "Your branch is based on '%s', but the upstream is gone.\n"
+msgstr "Ваша гілка базуєтьÑÑ Ð½Ð° \"%s\", але першоджерельне Ñховище зникло.\n"
+
+msgid " (use \"git branch --unset-upstream\" to fixup)\n"
+msgstr ""
+" (викориÑтовуйте команду \"git branch --unset-upstream\", щоб виправити)\n"
+
+#, c-format
+msgid "Your branch is up to date with '%s'.\n"
+msgstr "Ваша гілка не відрізнÑєтьÑÑ Ð²Ñ–Ð´ \"%s\".\n"
+
+#, c-format
+msgid "Your branch and '%s' refer to different commits.\n"
+msgstr "Ваша гілка та гілка \"%s\" поÑилаютьÑÑ Ð´Ð¾ різних комітів.\n"
+
+#, c-format
+msgid " (use \"%s\" for details)\n"
+msgstr " (викориÑтовуйте \"%s\" Ð´Ð»Ñ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð´ÐµÑ‚Ð°Ð»ÑŒÐ½Ð¾Ñ— інформації)\n"
+
+#, c-format
+msgid "Your branch is ahead of '%s' by %d commit.\n"
+msgid_plural "Your branch is ahead of '%s' by %d commits.\n"
+msgstr[0] "Ваша гілка випереджає \"%s\" на %d коміт.\n"
+msgstr[1] "Ваша гілка випереджає \"%s\" на %d коміти.\n"
+msgstr[2] "Ваша гілка випереджає \"%s\" на %d комітів.\n"
+
+msgid " (use \"git push\" to publish your local commits)\n"
+msgstr " (ÑкориÑтайтеÑÑŒ \"git push\", щоб надіÑлати локальні коміти)\n"
+
+#, c-format
+msgid "Your branch is behind '%s' by %d commit, and can be fast-forwarded.\n"
+msgid_plural ""
+"Your branch is behind '%s' by %d commits, and can be fast-forwarded.\n"
+msgstr[0] ""
+"Ваша гілка відÑтає від \"%s\" на %d коміт, Ñ– Ñ—Ñ— можна перемотати вперед.\n"
+msgstr[1] ""
+"Ваша гілка відÑтає від \"%s\" на %d коміти, Ñ– Ñ—Ñ— можна перемотати вперед.\n"
+msgstr[2] ""
+"Ваша гілка відÑтає від гілки '%s' на %d комітів, Ñ– Ñ—Ñ— можна перемотати "
+"вперед.\n"
+
+msgid " (use \"git pull\" to update your local branch)\n"
+msgstr " (викориÑтовуйте \"git pull\", щоб оновити вашу локальну гілку)\n"
+
+#, c-format
+msgid ""
+"Your branch and '%s' have diverged,\n"
+"and have %d and %d different commit each, respectively.\n"
+msgid_plural ""
+"Your branch and '%s' have diverged,\n"
+"and have %d and %d different commits each, respectively.\n"
+msgstr[0] ""
+"Ваша гілка Ñ– гілка '%s' розійшлиÑÑ,\n"
+"і мають %d і %d різний коміт відповідно.\n"
+msgstr[1] ""
+"Ваша гілка Ñ– гілка \"%s\" розійшлиÑÑ,\n"
+"і мають %d і %d різних коміти відповідно.\n"
+msgstr[2] ""
+"Ваша гілка Ñ– гілка \"%s\" розійшлиÑÑ,\n"
+"і мають %d і %d різних комітів відповідно.\n"
+
+msgid ""
+" (use \"git pull\" if you want to integrate the remote branch with yours)\n"
+msgstr ""
+" (ÑкориÑтайтеÑÑŒ \"git pull\", Ñкщо ви хочете інтегрувати віддалену гілку зі "
+"Ñвоєю)\n"
+
+#, c-format
+msgid "cannot parse expected object name '%s'"
+msgstr "неможливо розібрати очікувану назву обʼєкту \"%s\""
+
+#, c-format
+msgid "cannot strip one component off url '%s'"
+msgstr "неможливо вилучити один компонент з url '%s'"
+
+#, c-format
+msgid "bad replace ref name: %s"
+msgstr "неприпуÑтима назва заміни поÑиланнÑ: %s"
+
+#, c-format
+msgid "duplicate replace ref: %s"
+msgstr "дубльована заміна поÑиланнÑ: %s"
+
+#, c-format
+msgid "replace depth too high for object %s"
+msgstr "глибина заміни занадто виÑока Ð´Ð»Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ð° %s"
+
+msgid "corrupt MERGE_RR"
+msgstr "пошкоджений MERGE_RR"
+
+msgid "unable to write rerere record"
+msgstr "неможливо зробити rerere запиÑ"
+
+#, c-format
+msgid "there were errors while writing '%s' (%s)"
+msgstr "виникли помилки під Ñ‡Ð°Ñ Ð·Ð°Ð¿Ð¸Ñу \"%s\" (%s)"
+
+#, c-format
+msgid "could not parse conflict hunks in '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ конфліктні шматки в \"%s\""
+
+#, c-format
+msgid "failed utime() on '%s'"
+msgstr "невдалий utime() на \"%s\""
+
+#, c-format
+msgid "writing '%s' failed"
+msgstr "Ð·Ð°Ð¿Ð¸Ñ \"%s\" завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "Staged '%s' using previous resolution."
+msgstr "ІндекÑовано \"%s\" з викориÑтаннÑм попереднього вирішеннÑ."
+
+#, c-format
+msgid "Recorded resolution for '%s'."
+msgstr "ЗапиÑано Ð²Ð¸Ñ€Ñ–ÑˆÐµÐ½Ð½Ñ Ð´Ð»Ñ \"%s\"."
+
+#, c-format
+msgid "Resolved '%s' using previous resolution."
+msgstr "Вирішено \"%s\" з викориÑтаннÑм попереднього вирішеннÑ."
+
+#, c-format
+msgid "cannot unlink stray '%s'"
+msgstr "неможливо видалити блукаючий \"%s\""
+
+#, c-format
+msgid "Recorded preimage for '%s'"
+msgstr "ЗапиÑано попереднє Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "failed to update conflicted state in '%s'"
+msgstr "не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ конфліктний Ñтан у \"%s\""
+
+#, c-format
+msgid "no remembered resolution for '%s'"
+msgstr "немає запиÑаного Ð²Ð¸Ñ€Ñ–ÑˆÐµÐ½Ð½Ñ Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "Updated preimage for '%s'"
+msgstr "Оновлено попереднє Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "Forgot resolution for '%s'\n"
+msgstr "Забуто Ð²Ð¸Ñ€Ñ–ÑˆÐµÐ½Ð½Ñ Ð´Ð»Ñ \"%s\"\n"
+
+msgid "unable to open rr-cache directory"
+msgstr "неможливо відкрити rr-cache директорію"
+
+msgid "update the index with reused conflict resolution if possible"
+msgstr ""
+"оновити Ñ–Ð½Ð´ÐµÐºÑ Ð· повторним викориÑтаннÑм Ð²Ð¸Ñ€Ñ–ÑˆÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ð»Ñ–ÐºÑ‚Ñ–Ð², Ñкщо це "
+"можливо"
+
+msgid "could not determine HEAD revision"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ ревізію HEAD"
+
+#, c-format
+msgid "failed to find tree of %s"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ дерево %s"
+
+#, c-format
+msgid "unsupported section for hidden refs: %s"
+msgstr "непідтримувана ÑÐµÐºÑ†Ñ–Ñ Ð´Ð»Ñ Ð¿Ñ€Ð¸Ñ…Ð¾Ð²Ð°Ð½Ð¸Ñ… поÑилань: %s"
+
+msgid "--exclude-hidden= passed more than once"
+msgstr "--exclude-hidden= передано більше одного разу"
+
+#, c-format
+msgid "resolve-undo records `%s` which is missing"
+msgstr "resolve-undo запиÑує \"%s\", Ñкий відÑутній"
+
+#, c-format
+msgid "could not get commit for ancestry-path argument %s"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ коміт Ð´Ð»Ñ ancestry-path аргументу %s"
+
+msgid "--unpacked=<packfile> no longer supported"
+msgstr "--unpacked=<файл пакунка> більше не підтримуєтьÑÑ"
+
+#, c-format
+msgid "invalid option '%s' in --stdin mode"
+msgstr "неприпуÑтима Ð¾Ð¿Ñ†Ñ–Ñ \"%s\" у --stdin режимі"
+
+msgid "your current branch appears to be broken"
+msgstr "ваша поточна гілка виглÑдає пошкодженою"
+
+#, c-format
+msgid "your current branch '%s' does not have any commits yet"
+msgstr "ваша поточна гілка \"%s\" ще не має жодних комітів"
+
+msgid "object filtering requires --objects"
+msgstr "Ð´Ð»Ñ Ñ„Ñ–Ð»ÑŒÑ‚Ñ€Ð°Ñ†Ñ–Ñ— обʼєктів потрібен параметр --objects"
+
+msgid "-L does not yet support diff formats besides -p and -s"
+msgstr "-L поки що не підтримує diff формати, окрім -p та -s"
+
+#, c-format
+msgid "cannot create async thread: %s"
+msgstr "неможливо Ñтворити аÑинхронний потік: %s"
+
+#, c-format
+msgid "'%s' does not exist"
+msgstr "\"%s\" не Ñ–Ñнує"
+
+#, c-format
+msgid "could not switch to '%s'"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐºÐ»ÑŽÑ‡Ð¸Ñ‚Ð¸ÑÑ Ð½Ð° \"%s\""
+
+msgid "need a working directory"
+msgstr "потрібна робоча директоріÑ"
+
+msgid "Scalar enlistments require a worktree"
+msgstr "Коренева Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ Ð¿Ñ€Ð¾ÐµÐºÑ‚Ñƒ потребує робоче дерево"
+
+#, c-format
+msgid "could not configure %s=%s"
+msgstr "не вдалоÑÑ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ñ‚Ð¸ %s=%s"
+
+msgid "could not configure log.excludeDecoration"
+msgstr "не вдалоÑÑ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ñ‚Ð¸ log.excludeDecoration"
+
+msgid "could not add enlistment"
+msgstr "не вдалоÑÑ Ð´Ð¾Ð´Ð°Ñ‚Ð¸ кореневу директорію проекту"
+
+msgid "could not set recommended config"
+msgstr "не вдалоÑÑ Ð²Ñтановити рекомендовану конфігурацію"
+
+msgid "could not turn on maintenance"
+msgstr "не вдалоÑÑ Ð²Ð²Ñ–Ð¼ÐºÐ½ÑƒÑ‚Ð¸ технічне обÑлуговуваннÑ"
+
+msgid "could not start the FSMonitor daemon"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити FSMonitor демон"
+
+msgid "could not turn off maintenance"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð¼ÐºÐ½ÑƒÑ‚Ð¸ технічне обÑлуговуваннÑ"
+
+msgid "could not remove enlistment"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ директорію верхнього рівнÑ"
+
+#, c-format
+msgid "remote HEAD is not a branch: '%.*s'"
+msgstr "віддалений HEAD не є гілкою: \"%.*s\""
+
+msgid "failed to get default branch name from remote; using local default"
+msgstr ""
+"не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ назву гілки за замовчуваннÑм з віддаленого Ñховища; "
+"викориÑтано локальне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð° замовчуваннÑм"
+
+msgid "failed to get default branch name"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ назву гілки за замовчуваннÑм"
+
+msgid "failed to unregister repository"
+msgstr "не вдалоÑÑ ÑкаÑувати реєÑтрацію Ñховища"
+
+msgid "failed to stop the FSMonitor daemon"
+msgstr "не вдалоÑÑ Ð·ÑƒÐ¿Ð¸Ð½Ð¸Ñ‚Ð¸ FSMonitor демон"
+
+msgid "failed to delete enlistment directory"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ кореневу директорію проекту"
+
+msgid "branch to checkout after clone"
+msgstr "гілка, на Ñку перейти піÑÐ»Ñ ÐºÐ»Ð¾Ð½ÑƒÐ²Ð°Ð½Ð½Ñ"
+
+msgid "when cloning, create full working directory"
+msgstr "при клонуванні Ñтворювати повну робочу директорію"
+
+msgid "only download metadata for the branch that will be checked out"
+msgstr ""
+"завантажити метадані тільки Ð´Ð»Ñ Ð³Ñ–Ð»ÐºÐ¸, на Ñку буде здійÑнюватиÑÑ Ð¿ÐµÑ€ÐµÑ…Ñ–Ð´"
+
+msgid "create repository within 'src' directory"
+msgstr "Ñтворити Ñховище в директорії \"src\""
+
+msgid ""
+"scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n"
+"\t[--[no-]src] <url> [<enlistment>]"
+msgstr ""
+"scalar clone [--single-branch] [--branch <головна-гілка>] [--full-clone]\n"
+"\t[--[no-]src] <URL-адреÑа> [<коренева-директоріÑ>]"
+
+#, c-format
+msgid "cannot deduce worktree name from '%s'"
+msgstr "неможливо вивеÑти назву робочого дерева з \"%s\""
+
+#, c-format
+msgid "directory '%s' exists already"
+msgstr "Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ \"%s\" вже Ñ–Ñнує"
+
+#, c-format
+msgid "failed to get default branch for '%s'"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ гілку за замовчуваннÑм Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "could not configure remote in '%s'"
+msgstr "не вдалоÑÑ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ñ‚Ð¸ віддалене Ñховище в \"%s\""
+
+#, c-format
+msgid "could not configure '%s'"
+msgstr "не вдалоÑÑ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ñ‚Ð¸ \"%s\""
+
+msgid "partial clone failed; attempting full clone"
+msgstr "не вдалоÑÑ Ð·Ñ€Ð¾Ð±Ð¸Ñ‚Ð¸ розріджений клон; Ñпроба зробити повний клон"
+
+msgid "could not configure for full clone"
+msgstr "не вдалоÑÑ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ñ‚Ð¸ Ð´Ð»Ñ Ð¿Ð¾Ð²Ð½Ð¾Ð³Ð¾ клона"
+
+msgid "scalar diagnose [<enlistment>]"
+msgstr "scalar diagnose [<коренева-директоріÑ-проекту>]"
+
+msgid "`scalar list` does not take arguments"
+msgstr "\"scalar list\" не приймає аргументів"
+
+msgid "scalar register [<enlistment>]"
+msgstr "scalar register [<коренева-директоріÑ-проекту>]"
+
+msgid "reconfigure all registered enlistments"
+msgstr "переналаштувати вÑÑ– зареєÑтровані кореневі директорії проекту"
+
+msgid "scalar reconfigure [--all | <enlistment>]"
+msgstr "scalar reconfigure [--all | <коренева-директоріÑ-проекту>]"
+
+msgid "--all or <enlistment>, but not both"
+msgstr "--all або <коренева-директоріÑ-проекту>, але не обидва"
+
+#, c-format
+msgid "could not remove stale scalar.repo '%s'"
+msgstr "неможливо видалити заÑтаріле scalar.repo \"%s\""
+
+#, c-format
+msgid "removed stale scalar.repo '%s'"
+msgstr "видалено заÑтаріле scalar.repo \"%s\""
+
+#, c-format
+msgid "repository at '%s' has different owner"
+msgstr "у Ñховища \"%s\" інший влаÑник"
+
+#, c-format
+msgid "repository at '%s' has a format issue"
+msgstr "невірній формат Ñховища \"%s\""
+
+#, c-format
+msgid "repository not found in '%s'"
+msgstr "Ñховище \"%s\" не знайдено"
+
+#, c-format
+msgid ""
+"to unregister this repository from Scalar, run\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+msgstr ""
+"щоб ÑкаÑувати реєÑтрацію цього репозиторію в Scalar, виконайте\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+
+msgid ""
+"scalar run <task> [<enlistment>]\n"
+"Tasks:\n"
+msgstr ""
+"scalar run <завданнÑ> [<коренева-директоріÑ-проекту>]\n"
+"ЗавданнÑ:\n"
+
+#, c-format
+msgid "no such task: '%s'"
+msgstr "немає такого завданнÑ: \"%s\""
+
+msgid "scalar unregister [<enlistment>]"
+msgstr "scalar unregister [<коренева-директоріÑ-проекту>]"
+
+msgid "scalar delete <enlistment>"
+msgstr "scalar delete <коренева-директоріÑ-проекту>"
+
+msgid "refusing to delete current working directory"
+msgstr "відмовлено у видаленні поточної робочої директорії"
+
+msgid "include Git version"
+msgstr "включити верÑÑ–ÑŽ Git"
+
+msgid "include Git's build options"
+msgstr "включити опції збірки Git"
+
+msgid "scalar verbose [-v | --verbose] [--build-options]"
+msgstr "scalar verbose [-v | --verbose] [--build-options]"
+
+msgid "-C requires a <directory>"
+msgstr "-C потребує наÑвноÑÑ‚Ñ– <директорії>"
+
+#, c-format
+msgid "could not change to '%s'"
+msgstr "не вдалоÑÑ Ð·Ð¼Ñ–Ð½Ð¸Ñ‚Ð¸ на \"%s\""
+
+msgid "-c requires a <key>=<value> argument"
+msgstr "-c потребує <ключ>=<значеннÑ> аргумент"
+
+msgid ""
+"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
+"\n"
+"Commands:\n"
+msgstr ""
+"scalar [-C <директоріÑ>] [-c <ключ>=<значеннÑ>] <команда> [<опції>]\n"
+"\n"
+"Команди:\n"
+
+msgid "unexpected flush packet while reading remote unpack status"
+msgstr ""
+"неÑподіваний flush пакет під Ñ‡Ð°Ñ Ð·Ñ‡Ð¸Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ ÑтатуÑу віддаленого розпакуваннÑ"
+
+#, c-format
+msgid "unable to parse remote unpack status: %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ Ñтан Ñ€Ð¾Ð·Ð¿Ð°ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ñ–Ð´Ð´Ð°Ð»ÐµÐ½Ð¾Ð³Ð¾ Ñховища: %s"
+
+#, c-format
+msgid "remote unpack failed: %s"
+msgstr "віддалене Ñ€Ð¾Ð·Ð¿Ð°ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ðµ вдалоÑÑ: %s"
+
+msgid "failed to sign the push certificate"
+msgstr "не вдалоÑÑ Ð¿Ñ–Ð´Ð¿Ð¸Ñати Ñертифікат надÑиланнÑ"
+
+msgid "send-pack: unable to fork off fetch subprocess"
+msgstr "send-pack: не вдалоÑÑ Ñ€Ð¾Ð·Ð³Ð°Ð»ÑƒÐ¶Ð¸Ñ‚Ð¸ Ð¿Ñ–Ð´Ð¿Ñ€Ð¾Ñ†ÐµÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ"
+
+msgid "push negotiation failed; proceeding anyway with push"
+msgstr "перемовини з надÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ðµ вдалиÑÑ; вÑе одно продовжуємо надÑиланнÑ"
+
+msgid "the receiving end does not support this repository's hash algorithm"
+msgstr "отримуюча Ñторона не підтримує хеш-алгоритм цього Ñховища"
+
+msgid "the receiving end does not support --signed push"
+msgstr "отримуюча Ñторона не підтримує --signed push"
+
+msgid ""
+"not sending a push certificate since the receiving end does not support --"
+"signed push"
+msgstr ""
+"Ñертифікат надÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð½Ðµ відправлено, оÑкільки отримуюча Ñторона не "
+"підтримує --signed push"
+
+msgid "the receiving end does not support --atomic push"
+msgstr "отримуюча Ñторона не підтримує --atomic push"
+
+msgid "the receiving end does not support push options"
+msgstr "отримуюча Ñторона не підтримує опції push"
+
+#, c-format
+msgid "invalid commit message cleanup mode '%s'"
+msgstr "неприпуÑтимий режим Ð¾Ñ‡Ð¸Ñ‰ÐµÐ½Ð½Ñ Ð´Ð¾Ð¿Ð¸Ñів до коміту \"%s\""
+
+#, c-format
+msgid "could not delete '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ \"%s\""
+
+msgid "revert"
+msgstr "вивертаннÑ"
+
+msgid "cherry-pick"
+msgstr "виÑмикуваннÑ"
+
+msgid "rebase"
+msgstr "перебазуваннÑ"
+
+#, c-format
+msgid "unknown action: %d"
+msgstr "невідома діÑ: %d"
+
+msgid ""
+"after resolving the conflicts, mark the corrected paths\n"
+"with 'git add <paths>' or 'git rm <paths>'"
+msgstr ""
+"піÑÐ»Ñ Ð²Ð¸Ñ€Ñ–ÑˆÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ð»Ñ–ÐºÑ‚Ñ–Ð² позначте виправлені шлÑхи\n"
+"за допомогою \"git add <шлÑхи>\" або \"git rm <шлÑхи>\""
+
+msgid ""
+"After resolving the conflicts, mark them with\n"
+"\"git add/rm <pathspec>\", then run\n"
+"\"git cherry-pick --continue\".\n"
+"You can instead skip this commit with \"git cherry-pick --skip\".\n"
+"To abort and get back to the state before \"git cherry-pick\",\n"
+"run \"git cherry-pick --abort\"."
+msgstr ""
+"ПіÑÐ»Ñ Ð²Ð¸Ñ€Ñ–ÑˆÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ð»Ñ–ÐºÑ‚Ñ–Ð² позначте Ñ—Ñ… за допомогою\n"
+"\"git add/rm <визначник шлÑху>\", а потім виконайте\n"
+"\"git cherry-pick --continue\".\n"
+"ЗаміÑÑ‚ÑŒ цього ви можете пропуÑтити цей коміт за допомогою \"git cherry-pick "
+"--skip\".\n"
+"Щоб перервати Ð¿Ñ€Ð¾Ñ†ÐµÑ Ñ– повернутиÑÑ Ð´Ð¾ Ñтану перед \"git cherry-pick\",\n"
+"виконайте \"git cherry-pick --abort\"."
+
+msgid ""
+"After resolving the conflicts, mark them with\n"
+"\"git add/rm <pathspec>\", then run\n"
+"\"git revert --continue\".\n"
+"You can instead skip this commit with \"git revert --skip\".\n"
+"To abort and get back to the state before \"git revert\",\n"
+"run \"git revert --abort\"."
+msgstr ""
+"ПіÑÐ»Ñ Ð²Ð¸Ñ€Ñ–ÑˆÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ„Ð»Ñ–ÐºÑ‚Ñ–Ð² позначте Ñ—Ñ… за допомогою\n"
+"\"git add/rm <визначник шлÑху>\", а потім виконайте\n"
+"\"git revert --continue\".\n"
+"ЗаміÑÑ‚ÑŒ цього ви можете пропуÑтити цей коміт за допомогою \"git revert --"
+"skip\".\n"
+"Щоб перервати Ñ– повернутиÑÑ Ð´Ð¾ Ñтану перед \"git revert\",\n"
+"виконайте \"git revert --abort\"."
+
+#, c-format
+msgid "could not lock '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ñ„Ñ–ÐºÑувати \"%s\""
+
+#, c-format
+msgid "could not write eol to '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати eol в \"%s\""
+
+#, c-format
+msgid "failed to finalize '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ñ‚Ð¸ \"%s\""
+
+#, c-format
+msgid "your local changes would be overwritten by %s."
+msgstr "ваші локальні зміни будуть перезапиÑані %s."
+
+msgid "commit your changes or stash them to proceed."
+msgstr "зробіть коміт або додайте ваші зміни до Ñхову, щоб продовжити."
+
+#. TRANSLATORS: %s will be "revert", "cherry-pick" or
+#. "rebase".
+#.
+#, c-format
+msgid "%s: Unable to write new index file"
+msgstr "%s: Ðе вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати новий індекÑний файл"
+
+msgid "unable to update cache tree"
+msgstr "не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ дерево кешу"
+
+msgid "could not resolve HEAD commit"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ñ‚Ð¸ HEAD коміт"
+
+#, c-format
+msgid "no key present in '%.*s'"
+msgstr "немає ключа у \"%.*s\""
+
+#, c-format
+msgid "unable to dequote value of '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð»ÑƒÑ‡Ð¸Ñ‚Ð¸ лапки зі Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"%s\""
+
+msgid "'GIT_AUTHOR_NAME' already given"
+msgstr "\"GIT_AUTHOR_NAME\" вже надано"
+
+msgid "'GIT_AUTHOR_EMAIL' already given"
+msgstr "\"GIT_AUTHOR_EMAIL\" вже надано"
+
+msgid "'GIT_AUTHOR_DATE' already given"
+msgstr "\"GIT_AUTHOR_DATE\" вже надано"
+
+#, c-format
+msgid "unknown variable '%s'"
+msgstr "невідома змінна \"%s\""
+
+msgid "missing 'GIT_AUTHOR_NAME'"
+msgstr "бракує \"GIT_AUTHOR_NAME\""
+
+msgid "missing 'GIT_AUTHOR_EMAIL'"
+msgstr "бракує \"GIT_AUTHOR_EMAIL\""
+
+msgid "missing 'GIT_AUTHOR_DATE'"
+msgstr "бракує \"GIT_AUTHOR_DATE\""
+
+#, c-format
+msgid ""
+"you have staged changes in your working tree\n"
+"If these changes are meant to be squashed into the previous commit, run:\n"
+"\n"
+" git commit --amend %s\n"
+"\n"
+"If they are meant to go into a new commit, run:\n"
+"\n"
+" git commit %s\n"
+"\n"
+"In both cases, once you're done, continue with:\n"
+"\n"
+" git rebase --continue\n"
+msgstr ""
+"ви маєте індекÑовані зміни у вашому робочому дереві\n"
+"Якщо ці зміни мають бути ÑтиÑнуті у попередній коміт, запуÑÑ‚Ñ–Ñ‚ÑŒ:\n"
+"\n"
+" git commit --amend %s\n"
+"\n"
+"Якщо вони мають потрапити до нового коміту, виконайте:\n"
+"\n"
+" git commit %s\n"
+"\n"
+"Ð’ обох випадках, Ñк тільки ви закінчите, продовжуйте за допомогою:\n"
+"\n"
+" git rebase --continue\n"
+
+msgid "'prepare-commit-msg' hook failed"
+msgstr "\"prepare-commit-msg\" гачок завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+msgid ""
+"Your name and email address were configured automatically based\n"
+"on your username and hostname. Please check that they are accurate.\n"
+"You can suppress this message by setting them explicitly. Run the\n"
+"following command and follow the instructions in your editor to edit\n"
+"your configuration file:\n"
+"\n"
+" git config --global --edit\n"
+"\n"
+"After doing this, you may fix the identity used for this commit with:\n"
+"\n"
+" git commit --amend --reset-author\n"
+msgstr ""
+"Ваше Ñ–Ð¼Ê¼Ñ Ñ‚Ð° адреÑа електронної пошти були налаштовані автоматично на "
+"оÑнові\n"
+"вашого імені кориÑтувача та назви хоÑту. Будь лаÑка, перевірте Ñ—Ñ… "
+"правильніÑÑ‚ÑŒ.\n"
+"Ви можете приховати це повідомленнÑ, вÑтановивши Ñ—Ñ… Ñвно. ЗапуÑÑ‚Ñ–Ñ‚ÑŒ\n"
+"наÑтупну команду Ñ– дотримуйтеÑÑŒ інÑтрукцій у вашому редакторі, щоб "
+"відредагувати\n"
+"ваш конфігураційний файл:\n"
+"\n"
+" git config --global --edit\n"
+"\n"
+"ПіÑÐ»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ ви можете виправити оÑобиÑÑ‚Ñ–ÑÑ‚ÑŒ автора, викориÑтану Ð´Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ "
+"коміту, за допомогою\n"
+"\n"
+" git commit --amend --reset-author\n"
+
+msgid ""
+"Your name and email address were configured automatically based\n"
+"on your username and hostname. Please check that they are accurate.\n"
+"You can suppress this message by setting them explicitly:\n"
+"\n"
+" git config --global user.name \"Your Name\"\n"
+" git config --global user.email you@example.com\n"
+"\n"
+"After doing this, you may fix the identity used for this commit with:\n"
+"\n"
+" git commit --amend --reset-author\n"
+msgstr ""
+"Ваше Ñ–Ð¼Ê¼Ñ Ñ‚Ð° адреÑа електронної пошти були налаштовані автоматично на "
+"оÑнові\n"
+"вашого імені кориÑтувача та назви хоÑту. Будь лаÑка, перевірте Ñ—Ñ… "
+"правильніÑÑ‚ÑŒ.\n"
+"Ви можете приховати це повідомленнÑ, вказавши Ñ—Ñ… Ñвно:\n"
+"\n"
+" git config --global user.name \"Ваше ІмʼÑ\"\n"
+" git config --global user.email you@example.com\n"
+"\n"
+"ПіÑÐ»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ ви можете виправити оÑобиÑÑ‚Ñ–ÑÑ‚ÑŒ автора, викориÑтану Ð´Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ "
+"коміту, за допомогою\n"
+"\n"
+" git commit --amend --reset-author\n"
+
+msgid "couldn't look up newly created commit"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ новоÑтворений коміт"
+
+msgid "could not parse newly created commit"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ новоÑтворений коміт"
+
+msgid "unable to resolve HEAD after creating commit"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð²Ê¼Ñзати HEAD піÑÐ»Ñ ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ"
+
+msgid "detached HEAD"
+msgstr "відʼєднаний HEAD"
+
+msgid " (root-commit)"
+msgstr " (кореневий коміт)"
+
+msgid "could not parse HEAD"
+msgstr "неможливо розібрати HEAD"
+
+#, c-format
+msgid "HEAD %s is not a commit!"
+msgstr "HEAD %s не є комітом!"
+
+msgid "unable to parse commit author"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ автора коміту"
+
+#, c-format
+msgid "unable to read commit message from '%s'"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту від \"%s\""
+
+#, c-format
+msgid "invalid author identity '%s'"
+msgstr "неприпуÑтима оÑобиÑÑ‚Ñ–ÑÑ‚ÑŒ автора \"%s\""
+
+msgid "corrupt author: missing date information"
+msgstr "пошкоджені дані про автора: відÑÑƒÑ‚Ð½Ñ Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð¿Ñ€Ð¾ дату"
+
+#, c-format
+msgid "could not update %s"
+msgstr "не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ %s"
+
+#, c-format
+msgid "could not parse commit %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ коміт %s"
+
+#, c-format
+msgid "could not parse parent commit %s"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ джерельний коміт %s"
+
+#, c-format
+msgid "unknown command: %d"
+msgstr "невідома команда: %d"
+
+msgid "This is the 1st commit message:"
+msgstr "Це перший Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту:"
+
+#, c-format
+msgid "This is the commit message #%d:"
+msgstr "Це Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту #%d:"
+
+msgid "The 1st commit message will be skipped:"
+msgstr "Перший Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту буде пропущено:"
+
+#, c-format
+msgid "The commit message #%d will be skipped:"
+msgstr "Ð”Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту #%d буде пропущено:"
+
+#, c-format
+msgid "This is a combination of %d commits."
+msgstr "Це ÐºÐ¾Ð¼Ð±Ñ–Ð½Ð°Ñ†Ñ–Ñ %d комітів."
+
+#, c-format
+msgid "cannot write '%s'"
+msgstr "неможливо запиÑати \"%s\""
+
+msgid "need a HEAD to fixup"
+msgstr "потрібен HEAD, щоб виправити"
+
+msgid "could not read HEAD"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ HEAD"
+
+msgid "could not read HEAD's commit message"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту HEAD"
+
+#, c-format
+msgid "could not read commit message of %s"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту %s"
+
+msgid "your index file is unmerged."
+msgstr "ваш індекÑний файл не злитий."
+
+msgid "cannot fixup root commit"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð¿Ñ€Ð°Ð²Ð¸Ñ‚Ð¸ кореневий коміт"
+
+#, c-format
+msgid "commit %s is a merge but no -m option was given."
+msgstr "коміт %s - це злиттÑ, але Ð¾Ð¿Ñ†Ñ–Ñ -m не була вказана."
+
+#, c-format
+msgid "commit %s does not have parent %d"
+msgstr "коміт %s не має джерела %d"
+
+#, c-format
+msgid "cannot get commit message for %s"
+msgstr "неможливо отримати Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту Ð´Ð»Ñ %s"
+
+#. TRANSLATORS: The first %s will be a "todo" command like
+#. "revert" or "pick", the second %s a SHA1.
+#, c-format
+msgid "%s: cannot parse parent commit %s"
+msgstr "%s: не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ джерельний коміт %s"
+
+#, c-format
+msgid "could not revert %s... %s"
+msgstr "не вдалоÑÑ Ð·Ñ€Ð¾Ð±Ð¸Ñ‚Ð¸ Ð²Ð¸Ð²ÐµÑ€Ñ‚Ð°Ð½Ð½Ñ %s... %s"
+
+#, c-format
+msgid "could not apply %s... %s"
+msgstr "не вдалоÑÑ Ð·Ð°ÑтоÑувати %s... %s"
+
+#, c-format
+msgid "dropping %s %s -- patch contents already upstream\n"
+msgstr ""
+"ÑÐºÐ¸Ð´Ð°Ð½Ð½Ñ %s %s -- вміÑÑ‚ латки вже знаходитьÑÑ Ñƒ першоджерельному Ñховищі\n"
+
+#, c-format
+msgid "git %s: failed to read the index"
+msgstr "git %s: не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ індекÑ"
+
+#, c-format
+msgid "git %s: failed to refresh the index"
+msgstr "git %s: не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ індекÑ"
+
+#, c-format
+msgid "'%s' is not a valid label"
+msgstr "\"%s\" не Ñ” припуÑтимою міткою"
+
+#, c-format
+msgid "'%s' is not a valid refname"
+msgstr "\"%s\" не Ñ” припуÑтимою назвою поÑиланнÑ"
+
+#, c-format
+msgid "update-ref requires a fully qualified refname e.g. refs/heads/%s"
+msgstr "update-ref потребує повної назви поÑиланнÑ, наприклад, refs/heads/%s"
+
+#, c-format
+msgid "invalid command '%.*s'"
+msgstr "неприпуÑтима команда \"%.*s\""
+
+#, c-format
+msgid "%s does not accept arguments: '%s'"
+msgstr "%s не приймає аргументи: \"%s\""
+
+#, c-format
+msgid "missing arguments for %s"
+msgstr "відÑутні аргументи Ð´Ð»Ñ %s"
+
+#, c-format
+msgid "could not parse '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ \"%s\""
+
+#, c-format
+msgid "invalid line %d: %.*s"
+msgstr "невірний Ñ€Ñдок %d: %.*s"
+
+#, c-format
+msgid "cannot '%s' without a previous commit"
+msgstr "неможливо зробити \"%s\" без попереднього коміту"
+
+msgid "cancelling a cherry picking in progress"
+msgstr "наразі йде ÑкаÑÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¸ÑмикуваннÑ"
+
+msgid "cancelling a revert in progress"
+msgstr "наразі йде ÑкаÑÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¸Ð²ÐµÑ€Ñ‚Ð°Ð½Ð½Ñ"
+
+msgid "please fix this using 'git rebase --edit-todo'."
+msgstr "будь лаÑка, виправте це за допомогою \"git rebase --edit-todo\"."
+
+#, c-format
+msgid "unusable instruction sheet: '%s'"
+msgstr "непридатна інÑтрукціÑ: \"%s\""
+
+msgid "no commits parsed."
+msgstr "не розібрано жодного коміту."
+
+msgid "cannot cherry-pick during a revert."
+msgstr "неможливо зробити виÑÐ¼Ð¸ÐºÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´ Ñ‡Ð°Ñ Ð²Ð¸Ð²ÐµÑ€Ñ‚Ð°Ð½Ð½Ñ."
+
+msgid "cannot revert during a cherry-pick."
+msgstr "неможливо зробити Ð²Ð¸Ð²ÐµÑ€Ñ‚Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´ Ñ‡Ð°Ñ Ð²Ð¸ÑмикуваннÑ."
+
+msgid "unusable squash-onto"
+msgstr "непридатний squash-onto"
+
+#, c-format
+msgid "malformed options sheet: '%s'"
+msgstr "невірно Ñформований ÑпиÑок опцій: \"%s\""
+
+msgid "empty commit set passed"
+msgstr "передано порожній набір комітів"
+
+msgid "revert is already in progress"
+msgstr "наразі вже триває вивертаннÑ"
+
+#, c-format
+msgid "try \"git revert (--continue | %s--abort | --quit)\""
+msgstr "Ñпробуйте \"git revert (--continue | %s--abort | --quit)\""
+
+msgid "cherry-pick is already in progress"
+msgstr "наразі вже триває виÑмикуваннÑ"
+
+#, c-format
+msgid "try \"git cherry-pick (--continue | %s--abort | --quit)\""
+msgstr "Ñпробуйте \"git cherry-pick (--continue | %s--abort | --quit)\""
+
+#, c-format
+msgid "could not create sequencer directory '%s'"
+msgstr "не вдалоÑÑ Ñтворити директорію ÑеквенÑора \"%s\""
+
+msgid "no cherry-pick or revert in progress"
+msgstr "наразі не триває ні ÑкаÑуваннÑ, ні виÑмикуваннÑ"
+
+msgid "cannot resolve HEAD"
+msgstr "неможливо розпізнати HEAD"
+
+msgid "cannot abort from a branch yet to be born"
+msgstr "неможливо перервати з гілки, Ñка ще не народилаÑÑ"
+
+#, c-format
+msgid "cannot read '%s': %s"
+msgstr "неможливо прочитати \"%s\": %s"
+
+msgid "unexpected end of file"
+msgstr "неÑподіваний кінець файлу"
+
+#, c-format
+msgid "stored pre-cherry-pick HEAD file '%s' is corrupt"
+msgstr "збережений pre-cherry-pick HEAD файл \"%s\" пошкоджено"
+
+msgid "You seem to have moved HEAD. Not rewinding, check your HEAD!"
+msgstr ""
+"ЗдаєтьÑÑ, ви переміÑтили HEAD. ÐŸÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð°Ð·Ð°Ð´ не виконуєтьÑÑ, перевірте "
+"Ñвій HEAD!"
+
+msgid "no revert in progress"
+msgstr "наразі не виконуєтьÑÑ Ð²Ð¸Ð²ÐµÑ€Ñ‚Ð°Ð½Ð½Ñ"
+
+msgid "no cherry-pick in progress"
+msgstr "наразі не виконуєтьÑÑ Ð²Ð¸ÑмикуваннÑ"
+
+msgid "failed to skip the commit"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ð¿ÑƒÑтити коміт"
+
+msgid "there is nothing to skip"
+msgstr "немає чого пропуÑкати"
+
+#, c-format
+msgid ""
+"have you committed already?\n"
+"try \"git %s --continue\""
+msgstr ""
+"ви вже зробили коміт?\n"
+"Ñпробуйте \"git %s --continue\""
+
+msgid "cannot read HEAD"
+msgstr "неможливо прочитати HEAD"
+
+#, c-format
+msgid "unable to copy '%s' to '%s'"
+msgstr "не вдалоÑÑ Ñкопіювати \"%s\" в \"%s\""
+
+#, c-format
+msgid ""
+"You can amend the commit now, with\n"
+"\n"
+" git commit --amend %s\n"
+"\n"
+"Once you are satisfied with your changes, run\n"
+"\n"
+" git rebase --continue\n"
+msgstr ""
+"Ви можете внеÑти зміни до коміту зараз за допомогою\n"
+"\n"
+" git commit --amend %s\n"
+"\n"
+"ПіÑÐ»Ñ Ñ‚Ð¾Ð³Ð¾, Ñк ви будете задоволені Ñвоїми змінами, виконайте\n"
+"\n"
+" git rebase --continue\n"
+
+#, c-format
+msgid "Could not apply %s... %.*s"
+msgstr "Ðе вдалоÑÑ Ð·Ð°ÑтоÑувати %s... %.*s"
+
+#, c-format
+msgid "Could not merge %.*s"
+msgstr "Ðе вдалоÑÑ Ð·Ð»Ð¸Ñ‚Ð¸ %.*s"
+
+#, c-format
+msgid "Executing: %s\n"
+msgstr "ВиконаннÑ: %s\n"
+
+#, c-format
+msgid ""
+"execution failed: %s\n"
+"%sYou can fix the problem, and then run\n"
+"\n"
+" git rebase --continue\n"
+"\n"
+msgstr ""
+"не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ : %s\n"
+"%sВи можете виправити проблему, а потім виконати\n"
+"\n"
+" git rebase --continue\n"
+
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "та внеÑли зміни до індекÑу та/або робочого дерева\n"
+
+#, c-format
+msgid ""
+"execution succeeded: %s\n"
+"but left changes to the index and/or the working tree.\n"
+"Commit or stash your changes, and then run\n"
+"\n"
+" git rebase --continue\n"
+"\n"
+msgstr ""
+"Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ Ð¿Ñ€Ð¾Ð¹ÑˆÐ»Ð¾ уÑпішно: %s\n"
+"але залишило зміни в індекÑÑ– та/або робочому дереві\n"
+"Зробіть коміт або додайте зміни до Ñхову, а потім запуÑÑ‚Ñ–Ñ‚ÑŒ\n"
+"\n"
+" git rebase --continue\n"
+
+#, c-format
+msgid "illegal label name: '%.*s'"
+msgstr "неприпуÑтима назва мітки: \"%.*s\""
+
+#, c-format
+msgid "could not resolve '%s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ñ‚Ð¸ \"%s\""
+
+msgid "writing fake root commit"
+msgstr "напиÑÐ°Ð½Ð½Ñ Ð¿Ñ–Ð´Ñ€Ð¾Ð±Ð»ÐµÐ½Ð¾Ð³Ð¾ кореневого коміту"
+
+msgid "writing squash-onto"
+msgstr "Ð·Ð°Ð¿Ð¸Ñ squash-onto"
+
+msgid "cannot merge without a current revision"
+msgstr "неможливо злити без поточної ревізії"
+
+#, c-format
+msgid "unable to parse '%.*s'"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ \"%.*s\""
+
+#, c-format
+msgid "nothing to merge: '%.*s'"
+msgstr "нічого зливати: \"%.*s\""
+
+msgid "octopus merge cannot be executed on top of a [new root]"
+msgstr "octopus Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½ÐµÐ¼Ð¾Ð¶Ð»Ð¸Ð²Ð¾ виконати поверх [new root]"
+
+#, c-format
+msgid "could not get commit message of '%s'"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ Ð´Ð¾Ð¿Ð¸Ñ Ð´Ð¾ коміту \"%s\""
+
+#, c-format
+msgid "could not even attempt to merge '%.*s'"
+msgstr "не вдалоÑÑ Ð½Ð°Ð²Ñ–Ñ‚ÑŒ Ñпробувати злити \"%.*s\""
+
+msgid "merge: Unable to write new index file"
+msgstr "злиттÑ: Ðе вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати новий файл індекÑу"
+
+#, c-format
+msgid ""
+"another 'rebase' process appears to be running; '%s.lock' already exists"
+msgstr "здаєтьÑÑ, запущено інший Ð¿Ñ€Ð¾Ñ†ÐµÑ \"rebase\"; \"%s.lock\" вже Ñ–Ñнує"
+
+#, c-format
+msgid ""
+"Updated the following refs with %s:\n"
+"%s"
+msgstr ""
+"Оновлені наÑтупні поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð· %s:\n"
+"%s"
+
+#, c-format
+msgid ""
+"Failed to update the following refs with %s:\n"
+"%s"
+msgstr ""
+"Ðе вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ наÑтупні поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð· %s:\n"
+"%s"
+
+msgid "Cannot autostash"
+msgstr "Ðеможливо зробити автоÑхов"
+
+#, c-format
+msgid "Unexpected stash response: '%s'"
+msgstr "Ðеочікувана відповідь Ñхову: \"%s\""
+
+#, c-format
+msgid "Could not create directory for '%s'"
+msgstr "Ðе вдалоÑÑ Ñтворити директорію Ð´Ð»Ñ \"%s\""
+
+#, c-format
+msgid "Created autostash: %s\n"
+msgstr "Створено автоÑхов: %s\n"
+
+msgid "could not reset --hard"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ ÑÐºÐ¸Ð´Ð°Ð½Ð½Ñ Ð· --hard"
+
+#, c-format
+msgid "Applied autostash.\n"
+msgstr "ЗаÑтоÑовано автоÑхов.\n"
+
+#, c-format
+msgid "cannot store %s"
+msgstr "неможливо зберегти %s"
+
+#, c-format
+msgid ""
+"%s\n"
+"Your changes are safe in the stash.\n"
+"You can run \"git stash pop\" or \"git stash drop\" at any time.\n"
+msgstr ""
+"%s\n"
+"Ваші зміни в безпеці у Ñхову.\n"
+"Ви можете запуÑтити \"git stash pop\" або \"git stash drop\" у будь-Ñкий "
+"чаÑ.\n"
+
+msgid "Applying autostash resulted in conflicts."
+msgstr "ЗаÑтоÑÑƒÐ²Ð°Ð½Ð½Ñ Ð°Ð²Ñ‚Ð¾Ñхову призвело до конфліктів."
+
+msgid "Autostash exists; creating a new stash entry."
+msgstr "ÐвтоÑхов Ñ–Ñнує; ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð½Ð¾Ð²Ð¾Ð³Ð¾ запиÑу Ñхову."
+
+msgid "autostash reference is a symref"
+msgstr "поÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð°Ð²Ñ‚Ð¾Ñхову Ñ” Ñимвольним поÑиланнÑм"
+
+msgid "could not detach HEAD"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´Ê¼Ñ”Ð´Ð½Ð°Ñ‚Ð¸ HEAD"
+
+#, c-format
+msgid "Stopped at HEAD\n"
+msgstr "Зупинено на HEAD\n"
+
+#, c-format
+msgid "Stopped at %s\n"
+msgstr "Зупинено на %s\n"
+
+#, c-format
+msgid ""
+"Could not execute the todo command\n"
+"\n"
+" %.*s\n"
+"It has been rescheduled; To edit the command before continuing, please\n"
+"edit the todo list first:\n"
+"\n"
+" git rebase --edit-todo\n"
+" git rebase --continue\n"
+msgstr ""
+"Ðе вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ команду todo\n"
+"\n"
+" %.*s\n"
+"Її було перенеÑено; Щоб відредагувати команду перед продовженнÑм, будь "
+"лаÑка\n"
+"Ñпочатку відредагуйте ÑпиÑок Ñправ:\n"
+"\n"
+" git rebase --edit-todo\n"
+" git rebase --continue\n"
+
+#, c-format
+msgid "Stopped at %s... %.*s\n"
+msgstr "Зупинено на %s... %.*s\n"
+
+#, c-format
+msgid "Rebasing (%d/%d)%s"
+msgstr "ÐŸÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ (%d/%d)%s"
+
+#, c-format
+msgid "unknown command %d"
+msgstr "невідома команда %d"
+
+msgid "could not read orig-head"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ orig-head"
+
+msgid "could not read 'onto'"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ \"onto\""
+
+#, c-format
+msgid "could not update HEAD to %s"
+msgstr "не вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ HEAD до %s"
+
+#, c-format
+msgid "Successfully rebased and updated %s.\n"
+msgstr "УÑпішно перебазовано та оновлено %s.\n"
+
+msgid "cannot rebase: You have unstaged changes."
+msgstr "неможливо перебазувати: у Ð²Ð°Ñ Ñ” неіндекÑовані зміни."
+
+msgid "cannot amend non-existing commit"
+msgstr "неможливо виправити неіÑнуючий коміт"
+
+#, c-format
+msgid "invalid file: '%s'"
+msgstr "неприпуÑтимий файл: \"%s\""
+
+#, c-format
+msgid "invalid contents: '%s'"
+msgstr "неприпуÑтимий вміÑÑ‚: \"%s\""
+
+msgid ""
+"\n"
+"You have uncommitted changes in your working tree. Please, commit them\n"
+"first and then run 'git rebase --continue' again."
+msgstr ""
+"\n"
+"У Ð²Ð°Ñ Ñ” незакомічені зміни у вашому робочому дереві. Будь лаÑка, Ñпочатку "
+"зробіть коміт,\n"
+"а потім знову виконайте \"git rebase --continue\"."
+
+#, c-format
+msgid "could not write file: '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати файл: \"%s\""
+
+msgid "could not remove CHERRY_PICK_HEAD"
+msgstr "не вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ CHERRY_PICK_HEAD"
+
+msgid "could not commit staged changes."
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати індекÑовані зміни."
+
+#, c-format
+msgid "%s: can't cherry-pick a %s"
+msgstr "%s: неможливо зробити виÑÐ¼Ð¸ÐºÑƒÐ²Ð°Ð½Ð½Ñ %s"
+
+#, c-format
+msgid "%s: bad revision"
+msgstr "%s: невірна ревізіÑ"
+
+msgid "can't revert as initial commit"
+msgstr "неможливо зробити Ð²Ð¸Ð²ÐµÑ€Ñ‚Ð°Ð½Ð½Ñ Ñк початковий коміт"
+
+#, c-format
+msgid "skipped previously applied commit %s"
+msgstr "пропущено попередньо заÑтоÑований коміт %s"
+
+msgid "use --reapply-cherry-picks to include skipped commits"
+msgstr "викориÑтовуйте --reapply-cherry-picks, щоб включити пропущені коміти"
+
+msgid "make_script: unhandled options"
+msgstr "make_script: необроблені опції"
+
+msgid "make_script: error preparing revisions"
+msgstr "make_script: помилка при підготовці ревізій"
+
+msgid "nothing to do"
+msgstr "нічого робити"
+
+msgid "could not skip unnecessary pick commands"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ð¿ÑƒÑтити непотрібні команди вибору"
+
+msgid "the script was already rearranged."
+msgstr "Ñкрипт вже був перероблений."
+
+#, c-format
+msgid "update-refs file at '%s' is invalid"
+msgstr "файл update-refs за адреÑою \"%s\" Ñ” неприпуÑтимим"
+
+#, c-format
+msgid "'%s' is outside repository at '%s'"
+msgstr "\"%s\" зовнішнє Ñховище в \"%s\""
+
+#, c-format
+msgid ""
+"%s: no such path in the working tree.\n"
+"Use 'git <command> -- <path>...' to specify paths that do not exist locally."
+msgstr ""
+"%s: немає такого шлÑху у робочому дереві.\n"
+"ВикориÑтовуйте \"git <команда> -- <шлÑÑ…>...\", щоб вказати шлÑхи, Ñкі не "
+"Ñ–Ñнують локально."
+
+#, c-format
+msgid ""
+"ambiguous argument '%s': unknown revision or path not in the working tree.\n"
+"Use '--' to separate paths from revisions, like this:\n"
+"'git <command> [<revision>...] -- [<file>...]'"
+msgstr ""
+"неоднозначний аргумент \"%s\": невідома Ñ€ÐµÐ²Ñ–Ð·Ñ–Ñ Ð°Ð±Ð¾ шлÑÑ… не у робочому "
+"дереві.\n"
+"ВикориÑтовуйте \"--\", щоб відокремити шлÑÑ… від ревізій, наприклад, так:\n"
+"\"git <команда> [<ревізіÑ>...] -- [<файл>...]\""
+
+#, c-format
+msgid "option '%s' must come before non-option arguments"
+msgstr "Ð¾Ð¿Ñ†Ñ–Ñ \"%s\" повинна ÑтоÑти перед аргументами без опцій"
+
+#, c-format
+msgid ""
+"ambiguous argument '%s': both revision and filename\n"
+"Use '--' to separate paths from revisions, like this:\n"
+"'git <command> [<revision>...] -- [<file>...]'"
+msgstr ""
+"неоднозначний аргумент \"%s\": Ñ– ревізіÑ, Ñ– назва файлу\n"
+"ВикориÑтовуйте \"--\", щоб відокремити шлÑхи від ревізій, наприклад, так:\n"
+"\"git <команда> [<ревізіÑ>...] -- [<файл>...]\""
+
+msgid "unable to set up work tree using invalid config"
+msgstr ""
+"не вдалоÑÑ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ñ‚Ð¸ робоче дерево, викориÑтовуючи неприпуÑтиму "
+"конфігурацію"
+
+#, c-format
+msgid "Expected git repo version <= %d, found %d"
+msgstr "ОчікувалоÑÑŒ git Ñховищe верÑÑ–Ñ— <= %d, знайдено %d"
+
+msgid "unknown repository extension found:"
+msgid_plural "unknown repository extensions found:"
+msgstr[0] "знайдено невідомих розширень Ñховища:"
+msgstr[1] "знайдено невідомих розширень Ñховища:"
+msgstr[2] "знайдено невідомих розширень Ñховища:"
+
+msgid "repo version is 0, but v1-only extension found:"
+msgid_plural "repo version is 0, but v1-only extensions found:"
+msgstr[0] "верÑÑ–Ñ Ñховища дорівнює 0, але знайдено v1-only розширень:"
+msgstr[1] "верÑÑ–Ñ Ñховища дорівнює 0, але знайдено v1-only розширень:"
+msgstr[2] "верÑÑ–Ñ Ñховища дорівнює 0, але знайдено v1-only розширень:"
+
+#, c-format
+msgid "error opening '%s'"
+msgstr "помилка при відкритті \"%s\""
+
+#, c-format
+msgid "too large to be a .git file: '%s'"
+msgstr "занадто великий Ð´Ð»Ñ .git-файлу: \"%s\""
+
+#, c-format
+msgid "error reading %s"
+msgstr "помилка Ð·Ñ‡Ð¸Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ %s"
+
+#, c-format
+msgid "invalid gitfile format: %s"
+msgstr "неприпуÑтимий формат git файлу: %s"
+
+#, c-format
+msgid "no path in gitfile: %s"
+msgstr "немає шлÑху в gitfile: %s"
+
+#, c-format
+msgid "not a git repository: %s"
+msgstr "не Ñ” git Ñховищем: %s"
+
+#, c-format
+msgid "'$%s' too big"
+msgstr "\"$%s\" занадто великий"
+
+#, c-format
+msgid "not a git repository: '%s'"
+msgstr "не Ñ” git Ñховищем: \"%s\""
+
+#, c-format
+msgid "cannot chdir to '%s'"
+msgstr "неможливо змінити директорію на \"%s\""
+
+msgid "cannot come back to cwd"
+msgstr "неможливо повернутиÑÑ Ð´Ð¾ поточної робочої директорії"
+
+#, c-format
+msgid "failed to stat '%*s%s%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿Ð¸Ñати \"%*s%s%s\""
+
+msgid "Unable to read current working directory"
+msgstr "Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ поточну робочу директорію"
+
+#, c-format
+msgid "cannot change to '%s'"
+msgstr "неможливо змінити на \"%s\""
+
+#, c-format
+msgid "not a git repository (or any of the parent directories): %s"
+msgstr "не Ñ” git Ñховищем (Ñк Ñ– жодна з батьківÑьких директорій): %s"
+
+#, c-format
+msgid ""
+"not a git repository (or any parent up to mount point %s)\n"
+"Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set)."
+msgstr ""
+"не Ñ” git Ñховищем (Ñк Ñ– жодна з батьківÑьких директорій до міÑÑ†Ñ Ð¼Ð¾Ð½Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ "
+"%s)\n"
+"Зупинка на межі файлової ÑиÑтеми (GIT_DISCOVERY_ACROSS_FILESYSTEM не "
+"вÑтановлено)."
+
+#, c-format
+msgid ""
+"detected dubious ownership in repository at '%s'\n"
+"%sTo add an exception for this directory, call:\n"
+"\n"
+"\tgit config --global --add safe.directory %s"
+msgstr ""
+"виÑвлено Ñумнівне право влаÑноÑÑ‚Ñ– у Ñховищі за адреÑою \"%s\"\n"
+"%sЩоб додати винÑток Ð´Ð»Ñ Ñ†Ñ–Ñ”Ñ— директорії, виконайте:\n"
+"\n"
+"\tgit config --global --add safe.directory %s"
+
+#, c-format
+msgid "cannot use bare repository '%s' (safe.bareRepository is '%s')"
+msgstr ""
+"неможливо викориÑтати порожнє Ñховище \"%s\" (safe.bareRepository "
+"вÑтановлено в \"%s\")"
+
+#, c-format
+msgid ""
+"problem with core.sharedRepository filemode value (0%.3o).\n"
+"The owner of files must always have read and write permissions."
+msgstr ""
+"проблема зі значеннÑм файлового режиму core.sharedRepository (0%.3o).\n"
+"ВлаÑник файлів завжди повинен мати дозвіл на Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ñ‚Ð° запиÑ."
+
+msgid "fork failed"
+msgstr "fork завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+msgid "setsid failed"
+msgstr "setsid завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "cannot stat template '%s'"
+msgstr "неможливо виконати stat шаблона \"%s\""
+
+#, c-format
+msgid "cannot opendir '%s'"
+msgstr "неможливо виконати opendir \"%s\""
+
+#, c-format
+msgid "cannot readlink '%s'"
+msgstr "неможливо виконати readlink \"%s\""
+
+#, c-format
+msgid "cannot symlink '%s' '%s'"
+msgstr "неможливо виконати symlink \"%s\" \"%s\""
+
+#, c-format
+msgid "cannot copy '%s' to '%s'"
+msgstr "неможливо Ñкопіювати \"%s\" до \"%s\""
+
+#, c-format
+msgid "ignoring template %s"
+msgstr "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ ÑˆÐ°Ð±Ð»Ð¾Ð½Ñƒ %s"
+
+#, c-format
+msgid "templates not found in %s"
+msgstr "шаблонів не знайдено в %s"
+
+#, c-format
+msgid "not copying templates from '%s': %s"
+msgstr "не копіюютьÑÑ ÑˆÐ°Ð±Ð»Ð¾Ð½Ð¸ з \"%s\": %s"
+
+#, c-format
+msgid "invalid initial branch name: '%s'"
+msgstr "неприпуÑтиме початкове Ñ–Ð¼â€™Ñ Ð³Ñ–Ð»ÐºÐ¸: \"%s\""
+
+#, c-format
+msgid "re-init: ignored --initial-branch=%s"
+msgstr "re-init: ігноровано --initial-branch=%s"
+
+#, c-format
+msgid "unable to handle file type %d"
+msgstr "не вдалоÑÑ Ð¾Ð±Ñ€Ð¾Ð±Ð¸Ñ‚Ð¸ тип файлу %d"
+
+#, c-format
+msgid "unable to move %s to %s"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¼Ñ–Ñтити %s на %s"
+
+msgid "attempt to reinitialize repository with different hash"
+msgstr "Ñпроба переініціалізувати репозиторій з іншим хеш-алгоритмом"
+
+msgid ""
+"attempt to reinitialize repository with different reference storage format"
+msgstr "Ñпроба переініціалізувати Ñховище з іншим форматом зберіганнÑ"
+
+#, c-format
+msgid "%s already exists"
+msgstr "%s вже Ñ–Ñнує"
+
+#, c-format
+msgid "Reinitialized existing shared Git repository in %s%s\n"
+msgstr "Переініціалізовано Ñ–Ñнуюче Ñпільне Git Ñховище в %s%s\n"
+
+#, c-format
+msgid "Reinitialized existing Git repository in %s%s\n"
+msgstr "Переініціалізовано Ñ–Ñнуюче Git Ñховище в %s%s\n"
+
+#, c-format
+msgid "Initialized empty shared Git repository in %s%s\n"
+msgstr "Ініціалізовано порожнє Ñпільне Git Ñховище в %s%s\n"
+
+#, c-format
+msgid "Initialized empty Git repository in %s%s\n"
+msgstr "Ініціалізовано порожнє Git Ñховище в %s%s\n"
+
+#, c-format
+msgid "index entry is a directory, but not sparse (%08x)"
+msgstr "Ð·Ð°Ð¿Ð¸Ñ Ñ–Ð½Ð´ÐµÐºÑу Ñ” директорією, але не розрідженою (%08x)"
+
+msgid "cannot use split index with a sparse index"
+msgstr "неможливо викориÑтовувати розділений Ñ–Ð½Ð´ÐµÐºÑ Ð· розрідженим індекÑом"
+
+#. TRANSLATORS: IEC 80000-13:2008 gibibyte
+#, c-format
+msgid "%u.%2.2u GiB"
+msgstr "%u.%2.2u ГіБ"
+
+#. TRANSLATORS: IEC 80000-13:2008 gibibyte/second
+#, c-format
+msgid "%u.%2.2u GiB/s"
+msgstr "%u.%2.2u ГіБ/Ñ"
+
+#. TRANSLATORS: IEC 80000-13:2008 mebibyte
+#, c-format
+msgid "%u.%2.2u MiB"
+msgstr "%u.%2.2u МіБ"
+
+#. TRANSLATORS: IEC 80000-13:2008 mebibyte/second
+#, c-format
+msgid "%u.%2.2u MiB/s"
+msgstr "%u.%2.2u МіБ/Ñ"
+
+#. TRANSLATORS: IEC 80000-13:2008 kibibyte
+#, c-format
+msgid "%u.%2.2u KiB"
+msgstr "%u.%2.2u КіБ"
+
+#. TRANSLATORS: IEC 80000-13:2008 kibibyte/second
+#, c-format
+msgid "%u.%2.2u KiB/s"
+msgstr "%u.%2.2u КіБ/Ñ"
+
+#. TRANSLATORS: IEC 80000-13:2008 byte
+#, c-format
+msgid "%u byte"
+msgid_plural "%u bytes"
+msgstr[0] "%u байт"
+msgstr[1] "%u байти"
+msgstr[2] "%u байтів"
+
+#. TRANSLATORS: IEC 80000-13:2008 byte/second
+#, c-format
+msgid "%u byte/s"
+msgid_plural "%u bytes/s"
+msgstr[0] "%u байт/s"
+msgstr[1] "%u байти/s"
+msgstr[2] "%u байтів/s"
+
+#, c-format
+msgid "ignoring suspicious submodule name: %s"
+msgstr "Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´Ð¾Ð·Ñ€Ñ–Ð»Ð¾Ñ— назви підмодулÑ: %s"
+
+msgid "negative values not allowed for submodule.fetchJobs"
+msgstr "негативні Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ дозволені Ð´Ð»Ñ submodule.fetchJobs"
+
+#, c-format
+msgid "ignoring '%s' which may be interpreted as a command-line option: %s"
+msgstr ""
+"Ñ–Ð³Ð½Ð¾Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ \"%s\", Ñкий може бути інтерпретований Ñк параметр командного "
+"Ñ€Ñдка: %s"
+
+#, c-format
+msgid "Could not update .gitmodules entry %s"
+msgstr "Ðе вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ Ð·Ð°Ð¿Ð¸Ñ %s у .gitmodules"
+
+msgid "Cannot change unmerged .gitmodules, resolve merge conflicts first"
+msgstr ""
+"Ðеможливо змінити не злиті .gitmodules, Ñпочатку розвʼÑжіть конфлікти злиттÑ"
+
+#, c-format
+msgid "Could not find section in .gitmodules where path=%s"
+msgstr "Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ розділ у .gitmodules де path=%s"
+
+#, c-format
+msgid "Could not remove .gitmodules entry for %s"
+msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ Ð·Ð°Ð¿Ð¸Ñ .gitmodules Ð´Ð»Ñ %s"
+
+msgid "staging updated .gitmodules failed"
+msgstr "індекÑÐ°Ñ†Ñ–Ñ Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð¾Ð³Ð¾ .gitmodules завершилаÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "in unpopulated submodule '%s'"
+msgstr "у незаповненому підмодулі \"%s\""
+
+#, c-format
+msgid "Pathspec '%s' is in submodule '%.*s'"
+msgstr "Визначник шлÑху \"%s\" знаходитьÑÑ Ñƒ підмодулі \"%.*s\""
+
+#, c-format
+msgid "bad --ignore-submodules argument: %s"
+msgstr "невірний --ignore-submodules аргумент: %s"
+
+#, c-format
+msgid ""
+"Submodule in commit %s at path: '%s' collides with a submodule named the "
+"same. Skipping it."
+msgstr ""
+"Підмодуль у коміті %s за шлÑхом \"%s\" зіткнувÑÑ Ð· підмодулем з такою Ñамою "
+"назвою. ПропуÑкаємо його."
+
+#, c-format
+msgid "submodule entry '%s' (%s) is a %s, not a commit"
+msgstr "Ð·Ð°Ð¿Ð¸Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\" (%s) Ñ” %s, а не комітом"
+
+#, c-format
+msgid ""
+"Could not run 'git rev-list <commits> --not --remotes -n 1' command in "
+"submodule %s"
+msgstr ""
+"Ðе вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ команду \"git rev-list <коміти> --not --remotes -n 1\" у "
+"підмодулі %s"
+
+#, c-format
+msgid "process for submodule '%s' failed"
+msgstr "Ð¿Ñ€Ð¾Ñ†ÐµÑ Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\" завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "Pushing submodule '%s'\n"
+msgstr "ÐадÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\"\n"
+
+#, c-format
+msgid "Unable to push submodule '%s'\n"
+msgstr "Ðе вдалоÑÑ Ð½Ð°Ð´Ñ–Ñлати підмодуль \"%s\"\n"
+
+#, c-format
+msgid "Fetching submodule %s%s\n"
+msgstr "ÐžÑ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ %s%s\n"
+
+#, c-format
+msgid "Could not access submodule '%s'\n"
+msgstr "Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ доÑтуп до Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\"\n"
+
+#, c-format
+msgid "Could not access submodule '%s' at commit %s\n"
+msgstr "Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ доÑтуп до Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\" Ð´Ð»Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ %s\n"
+
+#, c-format
+msgid "Fetching submodule %s%s at commit %s\n"
+msgstr "ÐžÑ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ %s%s Ð´Ð»Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ %s\n"
+
+#, c-format
+msgid ""
+"Errors during submodule fetch:\n"
+"%s"
+msgstr ""
+"Помилки під Ñ‡Ð°Ñ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ:\n"
+"%s"
+
+#, c-format
+msgid "'%s' not recognized as a git repository"
+msgstr "\"%s\" не розпізнано Ñк git Ñховище"
+
+#, c-format
+msgid "Could not run 'git status --porcelain=2' in submodule %s"
+msgstr ""
+"Ðе вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ команду \"git status --porcelain=2\" у підмодулі %s"
+
+#, c-format
+msgid "'git status --porcelain=2' failed in submodule %s"
+msgstr "\"git status --porcelain=2\" завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾ у підмодулі %s"
+
+#, c-format
+msgid "could not start 'git status' in submodule '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити \"git status\" у підмодулі \"%s\""
+
+#, c-format
+msgid "could not run 'git status' in submodule '%s'"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити \"git status\" у підмодулі \"%s\""
+
+#, c-format
+msgid "Could not unset core.worktree setting in submodule '%s'"
+msgstr "Ðе вдалоÑÑ Ñкинути Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ core.worktree у підмодулі \"%s\""
+
+#, c-format
+msgid "could not recurse into submodule '%s'"
+msgstr "не вдалоÑÑ Ñ€ÐµÐºÑƒÑ€Ñивно перейти в підмодуль \"%s\""
+
+msgid "could not reset submodule index"
+msgstr "не вдалоÑÑ Ñкинути Ñ–Ð½Ð´ÐµÐºÑ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ"
+
+#, c-format
+msgid "submodule '%s' has dirty index"
+msgstr "підмодуль \"%s\" має брудний індекÑ"
+
+#, c-format
+msgid "Submodule '%s' could not be updated."
+msgstr "Ðе вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ підмодуль \"%s\"."
+
+#, c-format
+msgid "submodule git dir '%s' is inside git dir '%.*s'"
+msgstr "підмодуль git dir \"%s\" знаходитьÑÑ Ð²Ñередині git директорії \"%.*s\""
+
+#, c-format
+msgid ""
+"relocate_gitdir for submodule '%s' with more than one worktree not supported"
+msgstr ""
+"relocate_gitdir Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\" з більш ніж одним робочим деревом не "
+"підтримуєтьÑÑ"
+
+#, c-format
+msgid "could not lookup name for submodule '%s'"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ назву Ð´Ð»Ñ Ð¿Ñ–Ð´Ð¼Ð¾Ð´ÑƒÐ»Ñ \"%s\""
+
+#, c-format
+msgid "refusing to move '%s' into an existing git dir"
+msgstr "відмовлено в переміщенні \"%s\" до Ñ–Ñнуючої git директорії"
+
+#, c-format
+msgid ""
+"Migrating git directory of '%s%s' from\n"
+"'%s' to\n"
+"'%s'\n"
+msgstr ""
+"ÐœÑ–Ð³Ñ€Ð°Ñ†Ñ–Ñ git-директорії \"%s%s\" з\n"
+"\"%s\" до\n"
+"\"%s\"\n"
+
+msgid "could not start ls-files in .."
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити ls-файли в .."
+
+#, c-format
+msgid "ls-tree returned unexpected return code %d"
+msgstr "ls-tree повернув неочікуваний код Ð¿Ð¾Ð²ÐµÑ€Ð½ÐµÐ½Ð½Ñ %d"
+
+#, c-format
+msgid "failed to lstat '%s'"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ lstat Ð´Ð»Ñ \"%s\""
+
+msgid "no remote configured to get bundle URIs from"
+msgstr ""
+"немає налаштованого віддаленого Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ URI пакунків з "
+"нього"
+
+#, c-format
+msgid "remote '%s' has no configured URL"
+msgstr "віддалений \"%s\" не має налаштованої URL-адреÑи"
+
+msgid "could not get the bundle-uri list"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ ÑпиÑок bundle-uri"
+
+msgid "test-tool cache-tree <options> (control|prime|update)"
+msgstr "test-tool cache-tree <опції> (control|prime|update)"
+
+msgid "clear the cache tree before each iteration"
+msgstr "очищати дерево кешу перед кожною ітерацією"
+
+msgid "number of entries in the cache tree to invalidate (default 0)"
+msgstr ""
+"кількіÑÑ‚ÑŒ запиÑів у дереві кешу, Ñкі потрібно анулювати (за замовчуваннÑм 0)"
+
+#, c-format
+msgid "commit %s is not marked reachable"
+msgstr "коміт %s не позначений Ñк доÑÑжний"
+
+msgid "too many commits marked reachable"
+msgstr "забагато комітів позначено Ñк доÑÑжні"
+
+msgid "test-tool serve-v2 [<options>]"
+msgstr "test-tool serve-v2 [<опції>]"
+
+msgid "exit immediately after advertising capabilities"
+msgstr "вихід відразу піÑÐ»Ñ Ð¿Ð¾ÐºÐ°Ð·Ñƒ здібноÑтей"
+
+msgid "test-helper simple-ipc is-active [<name>] [<options>]"
+msgstr "test-helper simple-ipc is-active [<назва>] [<опції>]"
+
+msgid "test-helper simple-ipc run-daemon [<name>] [<threads>]"
+msgstr "test-helper simple-ipc run-daemon [<назва>] [<потоки>]"
+
+msgid "test-helper simple-ipc start-daemon [<name>] [<threads>] [<max-wait>]"
+msgstr ""
+"test-helper simple-ipc start-daemon [<назва>] [<потоки>] [<макÑимальний Ñ‡Ð°Ñ "
+"очікуваннÑ>]"
+
+msgid "test-helper simple-ipc stop-daemon [<name>] [<max-wait>]"
+msgstr ""
+"test-helper simple-ipc stop-daemon [<назва>] [<макÑимальний Ñ‡Ð°Ñ Ð¾Ñ‡Ñ–ÐºÑƒÐ²Ð°Ð½Ð½Ñ>]"
+
+msgid "test-helper simple-ipc send [<name>] [<token>]"
+msgstr "test-helper simple-ipc send [<назва>] [<токен>]"
+
+msgid "test-helper simple-ipc sendbytes [<name>] [<bytecount>] [<byte>]"
+msgstr ""
+"test-helper simple-ipc sendbytes [<назва>] [<кількіÑÑ‚ÑŒ байт>] [<байт>]"
+
+msgid ""
+"test-helper simple-ipc multiple [<name>] [<threads>] [<bytecount>] "
+"[<batchsize>]"
+msgstr ""
+"test-helper simple-ipc multiple [<назва>] [<потоки>] [<кількіÑÑ‚ÑŒ байт>] "
+"[<розмір пакетів>]"
+
+msgid "name or pathname of unix domain socket"
+msgstr "назва або назва шлÑху Ñокета домену unix"
+
+msgid "named-pipe name"
+msgstr "назва іменованого канала"
+
+msgid "number of threads in server thread pool"
+msgstr "кількіÑÑ‚ÑŒ потоків у пулі потоків Ñервера"
+
+msgid "seconds to wait for daemon to start or stop"
+msgstr "Ñекунд чекати на запуÑк або зупинку демона"
+
+msgid "number of bytes"
+msgstr "кількіÑÑ‚ÑŒ байтів"
+
+msgid "number of requests per thread"
+msgstr "кількіÑÑ‚ÑŒ запитів на потік"
+
+msgid "byte"
+msgstr "байт"
+
+msgid "ballast character"
+msgstr "балаÑтний Ñимвол"
+
+msgid "token"
+msgstr "токен"
+
+msgid "command token to send to the server"
+msgstr "токен команди Ð´Ð»Ñ Ð²Ñ–Ð´Ð¿Ñ€Ð°Ð²ÐºÐ¸ на Ñервер"
+
+#, c-format
+msgid "running trailer command '%s' failed"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ команду трейлера \"%s\""
+
+#, c-format
+msgid "unknown value '%s' for key '%s'"
+msgstr "невідоме Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ \"%s\" Ð´Ð»Ñ ÐºÐ»ÑŽÑ‡Ð° \"%s\""
+
+#, c-format
+msgid "empty trailer token in trailer '%.*s'"
+msgstr "порожній токен трейлера в трейлері \"%.*s\""
+
+#, c-format
+msgid "could not read input file '%s'"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ вхідний файл \"%s\""
+
+#, c-format
+msgid "could not stat %s"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ %s"
+
+#, c-format
+msgid "file %s is not a regular file"
+msgstr "файл %s не є звичайним файлом"
+
+#, c-format
+msgid "file %s is not writable by user"
+msgstr "файл %s не доÑтупний Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу кориÑтувачем"
+
+msgid "could not open temporary file"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ тимчаÑовий файл"
+
+#, c-format
+msgid "could not rename temporary file to %s"
+msgstr "не вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ñ‚Ð¸ тимчаÑовий файл на %s"
+
+msgid "full write to remote helper failed"
+msgstr "не вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ повний Ð·Ð°Ð¿Ð¸Ñ Ð´Ð¾ віддаленого помічника"
+
+#, c-format
+msgid "unable to find remote helper for '%s'"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ віддаленого помічника Ð´Ð»Ñ \"%s\""
+
+msgid "can't dup helper output fd"
+msgstr "неможливо зробити копію деÑкриптора файла виводу помічника"
+
+#, c-format
+msgid ""
+"unknown mandatory capability %s; this remote helper probably needs newer "
+"version of Git"
+msgstr ""
+"невідома обовʼÑзкова здібніÑÑ‚ÑŒ %s; цей віддалений помічник напевно потребує "
+"новішої верÑÑ–Ñ— Git"
+
+msgid "this remote helper should implement refspec capability"
+msgstr "цей віддалений помічник має реалізовувати здібніÑÑ‚ÑŒ refspec"
+
+#, c-format
+msgid "%s unexpectedly said: '%s'"
+msgstr "%s неÑподівано Ñказав: \"%s\""
+
+#, c-format
+msgid "%s also locked %s"
+msgstr "%s також заблокувало %s"
+
+msgid "couldn't run fast-import"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити fast-import"
+
+msgid "error while running fast-import"
+msgstr "помилка під Ñ‡Ð°Ñ Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ ÑˆÐ²Ð¸Ð´ÐºÐ¾Ð³Ð¾ імпорту"
+
+#, c-format
+msgid "could not read ref %s"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ поÑÐ¸Ð»Ð°Ð½Ð½Ñ %s"
+
+#, c-format
+msgid "unknown response to connect: %s"
+msgstr "невідома відповідь на зʼєднаннÑ: %s"
+
+msgid "setting remote service path not supported by protocol"
+msgstr "вÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ ÑˆÐ»Ñху до віддаленого ÑервіÑу не підтримуєтьÑÑ Ð¿Ñ€Ð¾Ñ‚Ð¾ÐºÐ¾Ð»Ð¾Ð¼"
+
+msgid "invalid remote service path"
+msgstr "неприпуÑтимий шлÑÑ… до віддаленої Ñлужби"
+
+#, c-format
+msgid "can't connect to subservice %s"
+msgstr "неможливо підключитиÑÑ Ð´Ð¾ підÑервіÑу %s"
+
+msgid "--negotiate-only requires protocol v2"
+msgstr "--negotiate-only потребує протоколу v2"
+
+msgid "'option' without a matching 'ok/error' directive"
+msgstr "\"option\" без відповідної директиви \"ok/error\""
+
+#, c-format
+msgid "expected ok/error, helper said '%s'"
+msgstr "очікувалоÑÑŒ ok/error, помічник Ñказав \"%s\""
+
+#, c-format
+msgid "helper reported unexpected status of %s"
+msgstr "helper повідомив про неочікуваний ÑÑ‚Ð°Ñ‚ÑƒÑ %s"
+
+#, c-format
+msgid "helper %s does not support dry-run"
+msgstr "помічник %s не підтримує dry-run"
+
+#, c-format
+msgid "helper %s does not support --signed"
+msgstr "помічник %s не підтримує --signed"
+
+#, c-format
+msgid "helper %s does not support --signed=if-asked"
+msgstr "помічник %s не підтримує --signed=if-asked"
+
+#, c-format
+msgid "helper %s does not support --atomic"
+msgstr "помічник %s не підтримує --atomic"
+
+#, c-format
+msgid "helper %s does not support --%s"
+msgstr "помічник %s не підтримує --%s"
+
+#, c-format
+msgid "helper %s does not support 'push-option'"
+msgstr "помічник %s не підтримує \"push-option\""
+
+msgid "remote-helper doesn't support push; refspec needed"
+msgstr "remote-helper не підтримує push; потрібен refspec"
+
+#, c-format
+msgid "helper %s does not support 'force'"
+msgstr "помічник %s не підтримує \"force\""
+
+msgid "couldn't run fast-export"
+msgstr "не вдалоÑÑ Ð·Ð°Ð¿ÑƒÑтити fast-export"
+
+msgid "error while running fast-export"
+msgstr "помилка під Ñ‡Ð°Ñ Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ ÑˆÐ²Ð¸Ð´ÐºÐ¾Ð³Ð¾ екÑпорту"
+
+#, c-format
+msgid ""
+"No refs in common and none specified; doing nothing.\n"
+"Perhaps you should specify a branch.\n"
+msgstr ""
+"Ðемає Ñпільних поÑилань Ñ– жодного не вказано; нічого не робитьÑÑ.\n"
+"Можливо, вам Ñлід вказати гілку.\n"
+
+#, c-format
+msgid "unsupported object format '%s'"
+msgstr "непідтримуваний обʼєкт формата \"%s\""
+
+#, c-format
+msgid "malformed response in ref list: %s"
+msgstr "невірно Ñформована відповідь у ÑпиÑку поÑилань: %s"
+
+#, c-format
+msgid "read(%s) failed"
+msgstr "read(%s) завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "write(%s) failed"
+msgstr "write(%s) завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "%s thread failed"
+msgstr "%s потік завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+#, c-format
+msgid "%s thread failed to join: %s"
+msgstr "%s потік не зміг приєднатиÑÑŒ: %s"
+
+#, c-format
+msgid "can't start thread for copying data: %s"
+msgstr "неможливо запуÑтити потік Ð´Ð»Ñ ÐºÐ¾Ð¿Ñ–ÑŽÐ²Ð°Ð½Ð½Ñ Ð´Ð°Ð½Ð¸Ñ…: %s"
+
+#, c-format
+msgid "%s process failed to wait"
+msgstr "%s Ð¿Ñ€Ð¾Ñ†ÐµÑ Ð½Ðµ зміг дочекатиÑÑ"
+
+#, c-format
+msgid "%s process failed"
+msgstr "%s Ð¿Ñ€Ð¾Ñ†ÐµÑ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ð²ÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾"
+
+msgid "can't start thread for copying data"
+msgstr "неможливо запуÑтити потік Ð´Ð»Ñ ÐºÐ¾Ð¿Ñ–ÑŽÐ²Ð°Ð½Ð½Ñ Ð´Ð°Ð½Ð¸Ñ…"
+
+#, c-format
+msgid "Would set upstream of '%s' to '%s' of '%s'\n"
+msgstr "Ð’Ñтановить першоджерельне Ñховище Ð´Ð»Ñ \"%s\" на \"%s\" в \"%s\"\n"
+
+#, c-format
+msgid "could not read bundle '%s'"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ пакунок \"%s\""
+
+#, c-format
+msgid "transport: invalid depth option '%s'"
+msgstr "transport: неприпуÑтимий параметр глибини \"%s\""
+
+msgid "see protocol.version in 'git help config' for more details"
+msgstr ""
+"дивітьÑÑ protocol.version у \"git help config\" Ð´Ð»Ñ Ð±Ñ–Ð»ÑŒÑˆ детальної "
+"інформації"
+
+msgid "server options require protocol version 2 or later"
+msgstr "опції Ñервера вимагають протокол верÑÑ–Ñ— 2 або пізнішої"
+
+msgid "server does not support wait-for-done"
+msgstr "Ñервер не підтримує wait-for-done"
+
+msgid "could not parse transport.color.* config"
+msgstr "не вдалоÑÑ Ñ€Ð¾Ð·Ñ–Ð±Ñ€Ð°Ñ‚Ð¸ конфігурацію transport.color.*"
+
+msgid "support for protocol v2 not implemented yet"
+msgstr "підтримка протоколу v2 ще не запроваджена"
+
+#, c-format
+msgid "transport '%s' not allowed"
+msgstr "заÑіб передачі \"%s\" не дозволений"
+
+msgid "git-over-rsync is no longer supported"
+msgstr "git-over-rsync більше не підтримуєтьÑÑ"
+
+#, c-format
+msgid ""
+"The following submodule paths contain changes that can\n"
+"not be found on any remote:\n"
+msgstr ""
+"ÐаÑтупні шлÑхи до підмодулів міÑÑ‚ÑÑ‚ÑŒ зміни, Ñкі неможливо\n"
+"знайти в жодному віддаленому призначенні:\n"
+
+#, c-format
+msgid ""
+"\n"
+"Please try\n"
+"\n"
+"\tgit push --recurse-submodules=on-demand\n"
+"\n"
+"or cd to the path and use\n"
+"\n"
+"\tgit push\n"
+"\n"
+"to push them to a remote.\n"
+"\n"
+msgstr ""
+"\n"
+"Будь лаÑка, Ñпробуйте\n"
+"\n"
+"\tgit push --recurse-submodules=on-demand\n"
+"\n"
+"або перейдіть до директорії та викориÑтайте\n"
+"\n"
+"\tgit push\n"
+"\n"
+"щоб надіÑлати Ñ—Ñ… до віддаленого призначеннÑ.\n"
+
+msgid "Aborting."
+msgstr "Відміна."
+
+msgid "failed to push all needed submodules"
+msgstr "не вдалоÑÑ Ð½Ð°Ð´Ñ–Ñлати вÑÑ– необхідні підмодулі"
+
+msgid "bundle-uri operation not supported by protocol"
+msgstr "bundle-uri Ð¾Ð¿ÐµÑ€Ð°Ñ†Ñ–Ñ Ð½Ðµ підтримуєтьÑÑ Ð¿Ñ€Ð¾Ñ‚Ð¾ÐºÐ¾Ð»Ð¾Ð¼"
+
+msgid "could not retrieve server-advertised bundle-uri list"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ ÑпиÑок Ð°Ð´Ñ€ÐµÑ Ð¿Ð°ÐºÐµÑ‚Ñ–Ð², оголошений Ñервером"
+
+msgid "operation not supported by protocol"
+msgstr "Ð¾Ð¿ÐµÑ€Ð°Ñ†Ñ–Ñ Ð½Ðµ підтримуєтьÑÑ Ð¿Ñ€Ð¾Ñ‚Ð¾ÐºÐ¾Ð»Ð¾Ð¼"
+
+msgid "too-short tree object"
+msgstr "занадто короткий обʼєкт дерева"
+
+msgid "malformed mode in tree entry"
+msgstr "невірно визначений режим у запиÑÑ– дерева"
+
+msgid "empty filename in tree entry"
+msgstr "Ð¿Ð¾Ñ€Ð¾Ð¶Ð½Ñ Ð½Ð°Ð·Ð²Ð° файлу у запиÑÑ– дерева"
+
+msgid "too-short tree file"
+msgstr "занадто короткий файл дерева"
+
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by checkout:\n"
+"%%sPlease commit your changes or stash them before you switch branches."
+msgstr ""
+"Ваші локальні зміни в наÑтупних файлах будуть перезапиÑані при переключенні "
+"Ñтану:\n"
+"%%sБудь лаÑка, зробіть коміт або додайте Ñ—Ñ… до Ñхову перед переходом до "
+"іншої гілки."
+
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by checkout:\n"
+"%%s"
+msgstr ""
+"Ваші локальні зміни в наÑтупних файлах будуть перезапиÑані при переключенні "
+"Ñтану:\n"
+"%%s"
+
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+"%%sPlease commit your changes or stash them before you merge."
+msgstr ""
+"Ваші локальні зміни у наÑтупних файлах будуть перезапиÑані під Ñ‡Ð°Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ:\n"
+"%%sБудь лаÑка, зробіть коміт або додайте Ñ—Ñ… до Ñхову перед злиттÑм."
+
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+"%%s"
+msgstr ""
+"Ваші локальні зміни у наÑтупних файлах будуть перезапиÑані під Ñ‡Ð°Ñ Ð·Ð»Ð¸Ñ‚Ñ‚Ñ:\n"
+"%%s"
+
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by %s:\n"
+"%%sPlease commit your changes or stash them before you %s."
+msgstr ""
+"Ваші локальні зміни у наÑтупних файлах будуть перезапиÑані %s:\n"
+"%%sБудь лаÑка, зробіть коміт або додайте Ñ—Ñ… до Ñхову перед %s."
+
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by %s:\n"
+"%%s"
+msgstr ""
+"Ваші локальні зміни у наÑтупних файлах будуть перезапиÑані %s:\n"
+"%%s"
+
+#, c-format
+msgid ""
+"Updating the following directories would lose untracked files in them:\n"
+"%s"
+msgstr ""
+"ÐžÐ½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð½Ð°Ñтупних директорій призведе до втрати невідÑтежуваних файлів у "
+"цих директоріÑÑ…:\n"
+"%s"
+
+#, c-format
+msgid ""
+"Refusing to remove the current working directory:\n"
+"%s"
+msgstr ""
+"Відмовлено у видаленні поточної робочої директорії:\n"
+"%s"
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be removed by checkout:\n"
+"%%sPlease move or remove them before you switch branches."
+msgstr ""
+"ÐаÑтупні невідÑтежувані файли робочого дерева будуть видалені під Ñ‡Ð°Ñ "
+"переключеннÑ:\n"
+"%%sБудь лаÑка, переміÑÑ‚Ñ–Ñ‚ÑŒ або видаліть Ñ—Ñ… перед переходом до іншої гілки."
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be removed by checkout:\n"
+"%%s"
+msgstr ""
+"ÐаÑтупні невідÑтежувані файли робочого дерева будуть видалені під Ñ‡Ð°Ñ "
+"переключеннÑ:\n"
+"%%s"
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be removed by merge:\n"
+"%%sPlease move or remove them before you merge."
+msgstr ""
+"ÐаÑтупні невідÑтежувані файли робочого дерева будуть видалені при виконанні "
+"злиттÑ:\n"
+"%%sБудь лаÑка, переміÑÑ‚Ñ–Ñ‚ÑŒ або видаліть Ñ—Ñ… перед злиттÑм."
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be removed by merge:\n"
+"%%s"
+msgstr ""
+"ÐаÑтупні невідÑтежувані файли робочого дерева будуть видалені при виконанні "
+"злиттÑ:\n"
+"%%s"
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be removed by %s:\n"
+"%%sPlease move or remove them before you %s."
+msgstr ""
+"ÐаÑтупні невідÑтежувані файли робочого дерева будуть видалені при виконанні "
+"%s:\n"
+"%%sБудь лаÑка, переміÑÑ‚Ñ–Ñ‚ÑŒ або видаліть Ñ—Ñ… перед %s."
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be removed by %s:\n"
+"%%s"
+msgstr ""
+"ÐаÑтупні невідÑтежувані файли робочого дерева будуть видалені при виконанні "
+"%s:\n"
+"%%s"
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be overwritten by "
+"checkout:\n"
+"%%sPlease move or remove them before you switch branches."
+msgstr ""
+"ÐаÑтупні невідÑтежувані файли робочого дерева будуть перезапиÑані при "
+"переключенні Ñтану\n"
+"%%sБудь лаÑка, переміÑÑ‚Ñ–Ñ‚ÑŒ або видаліть Ñ—Ñ… перед переходом до іншої гілки."
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be overwritten by "
+"checkout:\n"
+"%%s"
+msgstr ""
+"ÐаÑтупні невідÑтежувані файли робочого дерева будуть перезапиÑані при "
+"переключенні Ñтану:\n"
+"%%s"
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be overwritten by merge:\n"
+"%%sPlease move or remove them before you merge."
+msgstr ""
+"ÐаÑтупні невідÑтежувані файли робочого дерева будуть перезапиÑані при "
+"злитті:\n"
+"%%sБудь лаÑка, переміÑÑ‚Ñ–Ñ‚ÑŒ або видаліть Ñ—Ñ… перед злиттÑм."
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be overwritten by merge:\n"
+"%%s"
+msgstr ""
+"ÐаÑтупні невідÑтежувані файли робочого дерева будуть перезапиÑані при "
+"виконанні злиттÑ:\n"
+"%%s"
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be overwritten by %s:\n"
+"%%sPlease move or remove them before you %s."
+msgstr ""
+"ÐаÑтупні невідÑтежувані файли робочого дерева будуть перезапиÑані %s:\n"
+"%%sБудь лаÑка, переміÑÑ‚Ñ–Ñ‚ÑŒ або видаліть Ñ—Ñ… перед %s."
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be overwritten by %s:\n"
+"%%s"
+msgstr ""
+"ÐаÑтупні невідÑтежувані файли робочого дерева будуть перезапиÑані %s:\n"
+"%%s"
+
+#, c-format
+msgid "Entry '%s' overlaps with '%s'. Cannot bind."
+msgstr "Ð—Ð°Ð¿Ð¸Ñ \"%s\" перетинаєтьÑÑ Ð· \"%s\". Ðеможливо звʼÑзати."
+
+#, c-format
+msgid ""
+"Cannot update submodule:\n"
+"%s"
+msgstr ""
+"Ðе вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ підмодуль:\n"
+"%s"
+
+#, c-format
+msgid ""
+"The following paths are not up to date and were left despite sparse "
+"patterns:\n"
+"%s"
+msgstr ""
+"ÐаÑтупні шлÑхи не Ñ” актуальними Ñ– були залишені, незважаючи на розріджені "
+"шаблони:\n"
+"%s"
+
+#, c-format
+msgid ""
+"The following paths are unmerged and were left despite sparse patterns:\n"
+"%s"
+msgstr ""
+"ÐаÑтупні шлÑхи не злиті Ñ– були залишені, незважаючи на розріджені шаблони:\n"
+"%s"
+
+#, c-format
+msgid ""
+"The following paths were already present and thus not updated despite sparse "
+"patterns:\n"
+"%s"
+msgstr ""
+"ÐаÑтупні шлÑхи вже Ñ–Ñнували Ñ– тому не були оновлені, незважаючи на "
+"розріджені шаблони:\n"
+"%s"
+
+#, c-format
+msgid "Aborting\n"
+msgstr "ПерериваннÑ\n"
+
+#, c-format
+msgid ""
+"After fixing the above paths, you may want to run `git sparse-checkout "
+"reapply`.\n"
+msgstr ""
+"ПіÑÐ»Ñ Ð²Ð¸Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð½Ð°Ð²ÐµÐ´ÐµÐ½Ð¸Ñ… вище шлÑхів можливо ви забажаєте виконати \"git "
+"sparse-checkout reapply\".\n"
+
+msgid "Updating files"
+msgstr "ÐžÐ½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñ–Ð²"
+
+msgid ""
+"the following paths have collided (e.g. case-sensitive paths\n"
+"on a case-insensitive filesystem) and only one from the same\n"
+"colliding group is in the working tree:\n"
+msgstr ""
+"зіткнулиÑÑ Ð½Ð°Ñтупні шлÑхи (наприклад, шлÑхи, чутливі до регіÑтру\n"
+"у файловій ÑиÑтемі, не чутливій до регіÑтру) Ñ– лише один шлÑÑ… з тієї \n"
+"групи, що зіткнулиÑÑ, знаходитьÑÑ Ñƒ робочому дереві:\n"
+
+msgid "Updating index flags"
+msgstr "ÐžÐ½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð¿Ñ€Ð°Ð¿Ð¾Ñ€Ñ†Ñ–Ð² індекÑу"
+
+#, c-format
+msgid "worktree and untracked commit have duplicate entries: %s"
+msgstr "робоче дерево та невідÑтежуваний коміт мають дубльовані запиÑи: %s"
+
+msgid "expected flush after fetch arguments"
+msgstr "очікувалоÑÑŒ flush піÑÐ»Ñ Ð°Ñ€Ð³ÑƒÐ¼ÐµÐ½Ñ‚Ñ–Ð² отриманнÑ"
+
+msgid "invalid URL scheme name or missing '://' suffix"
+msgstr "неприпуÑтима назва Ñхеми URL-адреÑи або відÑутній \"://\" ÑуфікÑ"
+
+#, c-format
+msgid "invalid %XX escape sequence"
+msgstr "неприпуÑтима %XX екрануюча поÑлідовніÑÑ‚ÑŒ"
+
+msgid "missing host and scheme is not 'file:'"
+msgstr "відÑутній хоÑÑ‚ Ñ– Ñхема не \"file:\""
+
+msgid "a 'file:' URL may not have a port number"
+msgstr "\"file:\" URL-адреÑа не може мати номера порту"
+
+msgid "invalid characters in host name"
+msgstr "неприпуÑтимі Ñимволи в назві хоÑта"
+
+msgid "invalid port number"
+msgstr "неприпуÑтимий номер порту"
+
+msgid "invalid '..' path segment"
+msgstr "неприпуÑтимий \"..\" Ñегмент шлÑху"
+
+msgid "usage: "
+msgstr "викориÑтаннÑ: "
+
+msgid "fatal: "
+msgstr "збій: "
+
+msgid "error: "
+msgstr "помилка: "
+
+msgid "warning: "
+msgstr "попередженнÑ: "
+
+msgid "Fetching objects"
+msgstr "ÐžÑ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð¾Ð±Ê¼Ñ”ÐºÑ‚Ñ–Ð²"
+
+#, c-format
+msgid "'%s' at main working tree is not the repository directory"
+msgstr "\"%s\" у головному робочому дереві не Ñ” директорією Ñховища"
+
+#, c-format
+msgid "'%s' file does not contain absolute path to the working tree location"
+msgstr ""
+"\"%s\" файл не міÑтить абÑолютного шлÑху до Ñ€Ð¾Ð·Ñ‚Ð°ÑˆÑƒÐ²Ð°Ð½Ð½Ñ Ñ€Ð¾Ð±Ð¾Ñ‡Ð¾Ð³Ð¾ дерева"
+
+#, c-format
+msgid "'%s' is not a .git file, error code %d"
+msgstr "\"%s\" не є .git файлом, код помилки %d"
+
+#, c-format
+msgid "'%s' does not point back to '%s'"
+msgstr "\"%s\" не вказує назад на \"%s\""
+
+msgid "not a directory"
+msgstr "не є директорією"
+
+msgid ".git is not a file"
+msgstr ".git не є файлом"
+
+msgid ".git file broken"
+msgstr ".git файл пошкоджено"
+
+msgid ".git file incorrect"
+msgstr ".git файл не є коректним"
+
+msgid "not a valid path"
+msgstr "неприпуÑтимий шлÑÑ…"
+
+msgid "unable to locate repository; .git is not a file"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ Ñховище; .git не Ñ” файлом"
+
+msgid "unable to locate repository; .git file does not reference a repository"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ Ñховище; .git-файл не поÑилаєтьÑÑ Ð½Ð° Ñховище"
+
+msgid "unable to locate repository; .git file broken"
+msgstr "не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ Ñховище; файл .git пошкоджено"
+
+msgid "gitdir unreadable"
+msgstr "нечитабельна git директоріÑ"
+
+msgid "gitdir incorrect"
+msgstr "невірна git директоріÑ"
+
+msgid "not a valid directory"
+msgstr "неприпуÑтима директоріÑ"
+
+msgid "gitdir file does not exist"
+msgstr "файл git директорії не Ñ–Ñнує"
+
+#, c-format
+msgid "unable to read gitdir file (%s)"
+msgstr "не вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ файл git директорії (%s)"
+
+#, c-format
+msgid "short read (expected %<PRIuMAX> bytes, read %<PRIuMAX>)"
+msgstr ""
+"помилка при зчитуванні (очікувалоÑÑŒ %<PRIuMAX> байтів, прочитано %<PRIuMAX>)"
+
+msgid "invalid gitdir file"
+msgstr "неприпуÑтимий файл git директорії"
+
+msgid "gitdir file points to non-existent location"
+msgstr "файл git директорії вказує на неіÑнуюче розташуваннÑ"
+
+#, c-format
+msgid "unable to set %s in '%s'"
+msgstr "не вдалоÑÑ Ð²Ñтановити %s в \"%s\""
+
+#, c-format
+msgid "unable to unset %s in '%s'"
+msgstr "не вдалоÑÑ Ñкинути %s в \"%s\""
+
+msgid "failed to set extensions.worktreeConfig setting"
+msgstr "не вдалоÑÑ Ð²Ñтановити extensions.worktreeConfig параметр"
+
+#, c-format
+msgid "could not setenv '%s'"
+msgstr "не вдалоÑÑ Ð²Ñтановити змінну Ð¾Ñ‚Ð¾Ñ‡ÐµÐ½Ð½Ñ \"%s\""
+
+#, c-format
+msgid "unable to create '%s'"
+msgstr "не вдалоÑÑ Ñтворити \"%s\""
+
+#, c-format
+msgid "could not open '%s' for reading and writing"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ \"%s\" Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ñ‚Ð° запиÑу"
+
+#, c-format
+msgid "unable to access '%s'"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ доÑтуп до \"%s\""
+
+msgid "unable to get current working directory"
+msgstr "не вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ поточну робочу директорію"
+
+msgid "unable to get random bytes"
+msgstr "не вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ випадкові байти"
+
+msgid "Unmerged paths:"
+msgstr "Ðе злиті шлÑхи:"
+
+msgid " (use \"git restore --staged <file>...\" to unstage)"
+msgstr ""
+" (викориÑтовуйте \"git restore --staged <файл>...\", щоб видалити з індекÑу)"
+
+#, c-format
+msgid " (use \"git restore --source=%s --staged <file>...\" to unstage)"
+msgstr ""
+" (викориÑтовуйте \"git restore --source=%s --staged <file>...\", щоб "
+"прибрати з індекÑу)"
+
+msgid " (use \"git rm --cached <file>...\" to unstage)"
+msgstr ""
+" (викориÑтовуйте \"git rm --cached <file>...\", щоб видалити з індекÑу)"
+
+msgid " (use \"git add <file>...\" to mark resolution)"
+msgstr " (викориÑтовуйте \"git add <файл>...\", щоб позначити Ñк розвʼÑзане)"
+
+msgid " (use \"git add/rm <file>...\" as appropriate to mark resolution)"
+msgstr ""
+" (викориÑтовуйте \"git add/rm <файл>...\" за потребою, щоб позначити "
+"вирішеннÑ)"
+
+msgid " (use \"git rm <file>...\" to mark resolution)"
+msgstr " (викориÑтовуйте \"git rm <файл>...\", щоб позначити вирішеннÑ)"
+
+msgid "Changes to be committed:"
+msgstr "Зміни, додані до майбутнього коміту:"
+
+msgid "Changes not staged for commit:"
+msgstr "Зміни, не додані до майбутнього коміту:"
+
+msgid " (use \"git add <file>...\" to update what will be committed)"
+msgstr " (ÑкориÑтайтеÑÑŒ \"git add <файл>...\", щоб оновити майбутній коміт)"
+
+msgid " (use \"git add/rm <file>...\" to update what will be committed)"
+msgstr ""
+" (ÑкориÑтайтеÑÑŒ \"git add/rm <файл>...\", щоб оновити майбутній коміт)"
+
+msgid ""
+" (use \"git restore <file>...\" to discard changes in working directory)"
+msgstr ""
+" (ÑкориÑтайтеÑÑŒ \"git restore <файл>...\", щоб ÑкаÑувати зміни в робочій "
+"директорії)"
+
+msgid " (commit or discard the untracked or modified content in submodules)"
+msgstr ""
+" (зробіть коміт або відкиньте невідÑтежуваний або змінений вміÑÑ‚ у "
+"підмодулÑÑ…)"
+
+#, c-format
+msgid " (use \"git %s <file>...\" to include in what will be committed)"
+msgstr ""
+" (ÑкориÑтайтеÑÑŒ \"git %s <файл>...\", щоб додати до майбутнього коміту)"
+
+msgid "both deleted:"
+msgstr "видалено обома:"
+
+msgid "added by us:"
+msgstr "додано нами:"
+
+msgid "deleted by them:"
+msgstr "видалено ними:"
+
+msgid "added by them:"
+msgstr "додано ними:"
+
+msgid "deleted by us:"
+msgstr "видалено нами:"
+
+msgid "both added:"
+msgstr "додано обома:"
+
+msgid "both modified:"
+msgstr "змінено обома:"
+
+msgid "new file:"
+msgstr "новий файл:"
+
+msgid "copied:"
+msgstr "Ñкопійовано:"
+
+msgid "deleted:"
+msgstr "видалено:"
+
+msgid "modified:"
+msgstr "змінено:"
+
+msgid "renamed:"
+msgstr "перейменовано:"
+
+msgid "typechange:"
+msgstr "змінено тип:"
+
+msgid "unknown:"
+msgstr "невідомо:"
+
+msgid "unmerged:"
+msgstr "не злито:"
+
+msgid "new commits, "
+msgstr "нові коміти, "
+
+msgid "modified content, "
+msgstr "змінений контент, "
+
+msgid "untracked content, "
+msgstr "невідÑтежуваний контент, "
+
+#, c-format
+msgid "Your stash currently has %d entry"
+msgid_plural "Your stash currently has %d entries"
+msgstr[0] "У вашій Ñхованці наразі Ñ” %d запиÑ"
+msgstr[1] "У вашій Ñхованці наразі Ñ” %d запиÑи"
+msgstr[2] "У вашій Ñхованці наразі Ñ” %d запиÑів"
+
+msgid "Submodules changed but not updated:"
+msgstr "Підмодулі змінено, але не оновлено:"
+
+msgid "Submodule changes to be committed:"
+msgstr "Зміни в підмодулі, Ñкі будуть закомічені:"
+
+msgid ""
+"Do not modify or remove the line above.\n"
+"Everything below it will be ignored."
+msgstr ""
+"Ðе змінюйте та не видалÑйте Ñ€Ñдок вище.\n"
+"Ð’Ñе, що нижче, буде проігноровано."
+
+#, c-format
+msgid ""
+"\n"
+"It took %.2f seconds to compute the branch ahead/behind values.\n"
+"You can use '--no-ahead-behind' to avoid this.\n"
+msgstr ""
+"\n"
+"ОбчиÑÐ»ÐµÐ½Ð½Ñ Ð·Ð½Ð°Ñ‡ÐµÐ½ÑŒ попереду/позаду Ð´Ð»Ñ Ð³Ñ–Ð»ÐºÐ¸ зайнÑло %.2f Ñекунд.\n"
+"Ви можете викориÑтати параметр '--no-ahead-behind', щоб уникнути цього.\n"
+
+msgid "You have unmerged paths."
+msgstr "У Ð²Ð°Ñ Ñ” незлиті шлÑхи."
+
+msgid " (fix conflicts and run \"git commit\")"
+msgstr " (виправте конфлікти та виконайте \"git commit\")"
+
+msgid " (use \"git merge --abort\" to abort the merge)"
+msgstr ""
+" (ÑкориÑтайтеÑÑŒ командою \"git merge --abort\", щоб перервати злиттÑ)."
+
+msgid "All conflicts fixed but you are still merging."
+msgstr "УÑÑ– конфлікти виправлено, але ви вÑе ще продовжуєте злиттÑ."
+
+msgid " (use \"git commit\" to conclude merge)"
+msgstr " (ÑкориÑтайтеÑÑŒ \"git commit\", щоб завершити злиттÑ)"
+
+msgid "You are in the middle of an am session."
+msgstr "Ви вÑередині am ÑеанÑу."
+
+msgid "The current patch is empty."
+msgstr "Поточна латка порожнÑ."
+
+msgid " (fix conflicts and then run \"git am --continue\")"
+msgstr " (виправте конфлікти, а потім виконайте \"git am --continue\")"
+
+msgid " (use \"git am --skip\" to skip this patch)"
+msgstr " (ÑкориÑтайтеÑÑŒ командою \"git am --skip\", щоб пропуÑтити цю латку)"
+
+msgid ""
+" (use \"git am --allow-empty\" to record this patch as an empty commit)"
+msgstr ""
+" (ÑкориÑтайтеÑÑŒ \"git am --allow-empty\", щоб запиÑати цю латку Ñк порожній "
+"коміт)"
+
+msgid " (use \"git am --abort\" to restore the original branch)"
+msgstr " (ÑкориÑтайтеÑÑŒ \"git am --abort\", щоб відновити початкову гілку)"
+
+msgid "git-rebase-todo is missing."
+msgstr "git-rebase-todo відÑутній."
+
+msgid "No commands done."
+msgstr "Ðе виконано жодної команди."
+
+#, c-format
+msgid "Last command done (%<PRIuMAX> command done):"
+msgid_plural "Last commands done (%<PRIuMAX> commands done):"
+msgstr[0] "ОÑтанню команду виконано (%<PRIuMAX> команду виконано):"
+msgstr[1] "ОÑтанні команди виконано (%<PRIuMAX> команди виконано):"
+msgstr[2] "ОÑтанніх команд виконано (%<PRIuMAX> команд виконано):"
+
+#, c-format
+msgid " (see more in file %s)"
+msgstr " (дивітьÑÑ Ð±Ñ–Ð»ÑŒÑˆÐµ у файлі %s)"
+
+msgid "No commands remaining."
+msgstr "Ðе залишилоÑÑŒ команд."
+
+#, c-format
+msgid "Next command to do (%<PRIuMAX> remaining command):"
+msgid_plural "Next commands to do (%<PRIuMAX> remaining commands):"
+msgstr[0] "ÐаÑтупна команда Ð´Ð»Ñ Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ (залишилаÑÑŒ %<PRIuMAX> команда):"
+msgstr[1] "ÐаÑтупні команди Ð´Ð»Ñ Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ (залишилоÑÑŒ %<PRIuMAX> команди):"
+msgstr[2] "ÐаÑтупні команди Ð´Ð»Ñ Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ (залишилоÑÑŒ %<PRIuMAX> команд):"
+
+msgid " (use \"git rebase --edit-todo\" to view and edit)"
+msgstr ""
+" (ÑкориÑтайтеÑÑŒ \"git rebase --edit-todo\", щоб переглÑнути та "
+"відредагувати)"
+
+#, c-format
+msgid "You are currently rebasing branch '%s' on '%s'."
+msgstr "Ðаразі ви перебазовуєте гілку \"%s\" на \"%s\"."
+
+msgid "You are currently rebasing."
+msgstr "Ðаразі йде перебазуваннÑ."
+
+msgid " (fix conflicts and then run \"git rebase --continue\")"
+msgstr " (виправте конфлікти, а потім виконайте \"git rebase --continue\")"
+
+msgid " (use \"git rebase --skip\" to skip this patch)"
+msgstr " (ÑкориÑтайтеÑÑŒ \"git rebase --skip\", щоб пропуÑтити цю латку)"
+
+msgid " (use \"git rebase --abort\" to check out the original branch)"
+msgstr ""
+" (ÑкориÑтайтеÑÑŒ \"git rebase --abort\", щоб перейти до початкової гілки)"
+
+msgid " (all conflicts fixed: run \"git rebase --continue\")"
+msgstr " (уÑÑ– конфлікти виправлено: виконайте \"git rebase --continue\")"
+
+#, c-format
+msgid ""
+"You are currently splitting a commit while rebasing branch '%s' on '%s'."
+msgstr ""
+"Ðаразі виконуєтьÑÑ Ñ€Ð¾Ð·Ñ‰ÐµÐ¿Ð»ÐµÐ½Ð½Ñ ÐºÐ¾Ð¼Ñ–Ñ‚Ñƒ під Ñ‡Ð°Ñ Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ Ð³Ñ–Ð»ÐºÐ¸ \"%s\" на "
+"\"%s\"."
+
+msgid "You are currently splitting a commit during a rebase."
+msgstr "Ви розщеплюєте коміт під Ñ‡Ð°Ñ Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ."
+
+msgid " (Once your working directory is clean, run \"git rebase --continue\")"
+msgstr ""
+" (ПіÑÐ»Ñ Ð¾Ñ‡Ð¸Ñ‰ÐµÐ½Ð½Ñ Ñ€Ð¾Ð±Ð¾Ñ‡Ð¾Ñ— директорії виконайте \"git rebase --continue\")"
+
+#, c-format
+msgid "You are currently editing a commit while rebasing branch '%s' on '%s'."
+msgstr "Ðаразі ви редагуєте коміт при перебазуванні гілки \"%s\" на \"%s\"."
+
+msgid "You are currently editing a commit during a rebase."
+msgstr "Ðаразі ви редагуєте коміт при перебазуванні."
+
+msgid " (use \"git commit --amend\" to amend the current commit)"
+msgstr ""
+" (ÑкориÑтайтеÑÑŒ \"git commit --amend\", щоб внеÑти зміни до поточного "
+"коміту)"
+
+msgid ""
+" (use \"git rebase --continue\" once you are satisfied with your changes)"
+msgstr ""
+" (ÑкориÑтайтеÑÑŒ командою \"git rebase --continue\", коли ви будете "
+"задоволені Ñвоїми змінами)"
+
+msgid "Cherry-pick currently in progress."
+msgstr "Ðаразі триває виÑмикуваннÑ."
+
+#, c-format
+msgid "You are currently cherry-picking commit %s."
+msgstr "Ðаразі ви виÑмикуєте коміт %s."
+
+msgid " (fix conflicts and run \"git cherry-pick --continue\")"
+msgstr " (виправте конфлікти і виконайте \"git cherry-pick --continue\")"
+
+msgid " (run \"git cherry-pick --continue\" to continue)"
+msgstr " (виконайте \"git cherry-pick --continue\", щоб продовжити)"
+
+msgid " (all conflicts fixed: run \"git cherry-pick --continue\")"
+msgstr " (уÑÑ– конфлікти виправлено: виконайте \"git cherry-pick --continue\")"
+
+msgid " (use \"git cherry-pick --skip\" to skip this patch)"
+msgstr ""
+" (ÑкориÑтайтеÑÑŒ командою \"git cherry-pick --skip\", щоб пропуÑтити цю "
+"латку)"
+
+msgid " (use \"git cherry-pick --abort\" to cancel the cherry-pick operation)"
+msgstr ""
+" (ÑкориÑтайтеÑÑŒ командою \"git cherry-pick --abort\", щоб ÑкаÑувати операцію "
+"виÑмикуваннÑ)"
+
+msgid "Revert currently in progress."
+msgstr "Ðаразі триває вивертаннÑ."
+
+#, c-format
+msgid "You are currently reverting commit %s."
+msgstr "Ðаразі ви вивертаєте коміт %s."
+
+msgid " (fix conflicts and run \"git revert --continue\")"
+msgstr " (виправте конфлікти і виконайте \"git revert --continue\")"
+
+msgid " (run \"git revert --continue\" to continue)"
+msgstr " (виконайте \"git revert --continue\", щоб продовжити)"
+
+msgid " (all conflicts fixed: run \"git revert --continue\")"
+msgstr " (уÑÑ– конфлікти виправлено: виконайте \"git revert --continue\")"
+
+msgid " (use \"git revert --skip\" to skip this patch)"
+msgstr " (ÑкориÑтайтеÑÑŒ \"git revert --skip\", щоб пропуÑтити цю латку)"
+
+msgid " (use \"git revert --abort\" to cancel the revert operation)"
+msgstr ""
+" (ÑкориÑтайтеÑÑŒ \"git revert --abort\", щоб ÑкаÑувати операцію поверненнÑ)"
+
+#, c-format
+msgid "You are currently bisecting, started from branch '%s'."
+msgstr "Ðаразі ви робите біÑекцію, починаючи з гілки '%s'."
+
+msgid "You are currently bisecting."
+msgstr "Ðаразі ви робите біÑекцію."
+
+msgid " (use \"git bisect reset\" to get back to the original branch)"
+msgstr ""
+" (ÑкориÑтайтеÑÑŒ \"git bisect reset\", щоб повернутиÑÑŒ на початкову гілку)"
+
+msgid "You are in a sparse checkout."
+msgstr "Ви перебуваєте в розрідженому переході на гілку."
+
+#, c-format
+msgid "You are in a sparse checkout with %d%% of tracked files present."
+msgstr ""
+"Ви перебуваєте в розрідженому переході на гілку з %d%% наÑвних відÑтежуваних "
+"файлів."
+
+msgid "On branch "
+msgstr "Ðа гілці "
+
+msgid "interactive rebase in progress; onto "
+msgstr "триває інтерактивне Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð° "
+
+msgid "rebase in progress; onto "
+msgstr "триває Ð¿ÐµÑ€ÐµÐ±Ð°Ð·ÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ð° "
+
+msgid "HEAD detached at "
+msgstr "HEAD відʼєднано на "
+
+msgid "HEAD detached from "
+msgstr "HEAD відʼєднано від "
+
+msgid "Not currently on any branch."
+msgstr "Ðе на гілці."
+
+msgid "Initial commit"
+msgstr "Початковий коміт"
+
+msgid "No commits yet"
+msgstr "Поки що немає комітів"
+
+msgid "Untracked files"
+msgstr "ÐевідÑтежувані файли"
+
+msgid "Ignored files"
+msgstr "Ігноровані файли"
+
+#, c-format
+msgid ""
+"It took %.2f seconds to enumerate untracked files,\n"
+"but the results were cached, and subsequent runs may be faster."
+msgstr ""
+"Ðа Ð¿ÐµÑ€ÐµÑ€Ð°Ñ…ÑƒÐ²Ð°Ð½Ð½Ñ Ð½ÐµÐ²Ñ–Ð´Ñтежуваних файлів пішло %.2f Ñекунд,\n"
+"але результат було додано у кеш, тому наÑтупні запуÑки можуть бути швидшими."
+
+#, c-format
+msgid "It took %.2f seconds to enumerate untracked files."
+msgstr "Ðа Ð¿ÐµÑ€ÐµÑ€Ð°Ñ…ÑƒÐ²Ð°Ð½Ð½Ñ Ð½ÐµÐ²Ñ–Ð´Ñтежуваних файлів пішло %.2f Ñекунд."
+
+msgid "See 'git help status' for information on how to improve this."
+msgstr "ДивітьÑÑ \"git help status\" Ð´Ð»Ñ Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ— про те, Ñк це покращити."
+
+#, c-format
+msgid "Untracked files not listed%s"
+msgstr "ÐевідÑтежувані файли не показані%s"
+
+msgid " (use -u option to show untracked files)"
+msgstr " (викориÑтовуйте опцію -u, щоб показати невідÑтежувані файли)"
+
+msgid "No changes"
+msgstr "Ðемає змін"
+
+#, c-format
+msgid "no changes added to commit (use \"git add\" and/or \"git commit -a\")\n"
+msgstr ""
+"не додано жодних змін до коміту (ÑкориÑтайтеÑÑŒ \"git add\" та/або \"git "
+"commit -a\")\n"
+
+#, c-format
+msgid "no changes added to commit\n"
+msgstr "нічого не додано до коміту\n"
+
+#, c-format
+msgid ""
+"nothing added to commit but untracked files present (use \"git add\" to "
+"track)\n"
+msgstr ""
+"нічого не додано до коміту, але Ñ” невідÑтежувані файли (ÑкориÑтайтеÑÑŒ \"git "
+"add\" Ð´Ð»Ñ Ð²Ñ–Ð´ÑтежуваннÑ)\n"
+
+#, c-format
+msgid "nothing added to commit but untracked files present\n"
+msgstr "нічого не додано до коміту, але приÑутні невідÑтежувані файли\n"
+
+#, c-format
+msgid "nothing to commit (create/copy files and use \"git add\" to track)\n"
+msgstr ""
+"нічого комітити (Ñтворіть/Ñкопіюйте файли та ÑкориÑтайтеÑÑŒ \"git add\" Ð´Ð»Ñ "
+"відÑтежуваннÑ)\n"
+
+#, c-format
+msgid "nothing to commit\n"
+msgstr "нічого комітити\n"
+
+#, c-format
+msgid "nothing to commit (use -u to show untracked files)\n"
+msgstr "нічого комітити (ÑкориÑтайтеÑÑŒ -u щоб показати невідÑтежувані файли)\n"
+
+#, c-format
+msgid "nothing to commit, working tree clean\n"
+msgstr "нічого комітити, робоче дерево чиÑте\n"
+
+msgid "No commits yet on "
+msgstr "Поки що немає комітів у "
+
+msgid "HEAD (no branch)"
+msgstr "HEAD (немає гілки)"
+
+msgid "different"
+msgstr "відрізнÑєтьÑÑ"
+
+msgid "behind "
+msgstr "позаду "
+
+msgid "ahead "
+msgstr "попереду "
+
+#. TRANSLATORS: the action is e.g. "pull with rebase"
+#, c-format
+msgid "cannot %s: You have unstaged changes."
+msgstr "неможливо %s: У Ð²Ð°Ñ Ñ” неіндекÑовані зміни."
+
+msgid "additionally, your index contains uncommitted changes."
+msgstr "крім того, ваш Ñ–Ð½Ð´ÐµÐºÑ Ð¼Ñ–Ñтить незакомічені зміни."
+
+#, c-format
+msgid "cannot %s: Your index contains uncommitted changes."
+msgstr "неможливо виконати %s: Ваш Ñ–Ð½Ð´ÐµÐºÑ Ð¼Ñ–Ñтить незакомічені зміни."
+
+#, c-format
+msgid "unknown style '%s' given for '%s'"
+msgstr "невідомий Ñтиль \"%s\" наданий Ð´Ð»Ñ \"%s\""
+
+msgid ""
+"Error: Your local changes to the following files would be overwritten by "
+"merge"
+msgstr ""
+"Помилка: Ваші локальні зміни в наÑтупних файлах були б перезапиÑані під Ñ‡Ð°Ñ "
+"злиттÑ"
+
+msgid "Automated merge did not work."
+msgstr "Ðвтоматичне Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ðµ Ñпрацювало."
+
+msgid "Should not be doing an octopus."
+msgstr "Ðе Ñлід робити octopus злиттÑ."
+
+#, sh-format
+msgid "Unable to find common commit with $pretty_name"
+msgstr "Ðе вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ Ñпільний коміт з $pretty_name"
+
+#, sh-format
+msgid "Already up to date with $pretty_name"
+msgstr "Вже в актуальному Ñтані з $pretty_name"
+
+#, sh-format
+msgid "Fast-forwarding to: $pretty_name"
+msgstr "ÐŸÐµÑ€ÐµÐ¼Ð¾Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¿ÐµÑ€ÐµÐ´ до: $pretty_name"
+
+#, sh-format
+msgid "Trying simple merge with $pretty_name"
+msgstr "Спроба проÑтого Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð· $pretty_name"
+
+msgid "Simple merge did not work, trying automatic merge."
+msgstr "ПроÑте Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ðµ Ñпрацювало, Ñпроба автоматичного злиттÑ."
+
+#, sh-format
+msgid "usage: $dashless $USAGE"
+msgstr "викориÑтаннÑ: $dashless $USAGE"
+
+#, sh-format
+msgid "Cannot chdir to $cdup, the toplevel of the working tree"
+msgstr "Ðеможливо виконати chdir до $cdup, верхнього Ñ€Ñ–Ð²Ð½Ñ Ñ€Ð¾Ð±Ð¾Ñ‡Ð¾Ð³Ð¾ дерева"
+
+#, sh-format
+msgid "fatal: $program_name cannot be used without a working tree."
+msgstr "збій: $program_name неможливо викориÑтовувати без робочого дерева."
+
+msgid "Cannot rewrite branches: You have unstaged changes."
+msgstr "Ðеможливо перепиÑати гілку: у Ð²Ð°Ñ Ñ” неіндекÑовані зміни."
+
+#, sh-format
+msgid "Cannot $action: You have unstaged changes."
+msgstr "Ðеможливо $action: у Ð²Ð°Ñ Ñ” неіндекÑовані зміни."
+
+#, sh-format
+msgid "Cannot $action: Your index contains uncommitted changes."
+msgstr "Ðеможливо $action: ваш Ñ–Ð½Ð´ÐµÐºÑ Ð¼Ñ–Ñтить незакомічені зміни."
+
+msgid "Additionally, your index contains uncommitted changes."
+msgstr "Крім того, ваш Ñ–Ð½Ð´ÐµÐºÑ Ð¼Ñ–Ñтить незакомічені зміни."
+
+msgid "You need to run this command from the toplevel of the working tree."
+msgstr "Цю команду потрібно запуÑкати з верхнього Ñ€Ñ–Ð²Ð½Ñ Ñ€Ð¾Ð±Ð¾Ñ‡Ð¾Ð³Ð¾ дерева."
+
+msgid "Unable to determine absolute path of git directory"
+msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ абÑолютний шлÑÑ… git директорії"
+
+msgid "local zone differs from GMT by a non-minute interval\n"
+msgstr "міÑцева зона відрізнÑєтьÑÑ Ð²Ñ–Ð´ GMT на нехвилинний інтервал\n"
+
+msgid "local time offset greater than or equal to 24 hours\n"
+msgstr "Ð·Ð¼Ñ–Ñ‰ÐµÐ½Ð½Ñ Ð¼Ñ–Ñцевого чаÑу більше або дорівнює 24 годинам\n"
+
+#, perl-format
+msgid "fatal: command '%s' died with exit code %d"
+msgstr "збій: команда \"%s\" завершилаÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾ з кодом виходу %d"
+
+msgid "the editor exited uncleanly, aborting everything"
+msgstr "редактор вийшов неналежним чином, перервано вÑÑ– процеÑи"
+
+#, perl-format
+msgid ""
+"'%s' contains an intermediate version of the email you were composing.\n"
+msgstr "\"%s\" міÑтить проміжну верÑÑ–ÑŽ лиÑта, Ñкий ви Ñтворювали.\n"
+
+#, perl-format
+msgid "'%s.final' contains the composed email.\n"
+msgstr "\"%s.final\" міÑтить Ñтворений лиÑÑ‚.\n"
+
+msgid "--dump-aliases incompatible with other options\n"
+msgstr "--dump-aliases неÑуміÑна з іншими опціÑми\n"
+
+msgid ""
+"fatal: found configuration options for 'sendmail'\n"
+"git-send-email is configured with the sendemail.* options - note the 'e'.\n"
+"Set sendemail.forbidSendmailVariables to false to disable this check.\n"
+msgstr ""
+"збій: знайдено опції конфігурації Ð´Ð»Ñ \"sendmail\"\n"
+"git-send-email налаштовано з параметрами sendemail.* options - зверніть "
+"увагу на \"e\".\n"
+"Ð’Ñтановіть sendemail.forbidSendmailVariables у false, щоб вимкнути цю "
+"перевірку.\n"
+
+msgid "Cannot run git format-patch from outside a repository\n"
+msgstr "Ðеможливо запуÑтити git format-patch поза Ñховищем\n"
+
+msgid ""
+"`batch-size` and `relogin` must be specified together (via command-line or "
+"configuration option)\n"
+msgstr ""
+"\"batch-size\" і \"relogin\" повинні бути вказані разом (через командний "
+"Ñ€Ñдок або опції конфігурації)\n"
+
+#, perl-format
+msgid "Unknown --suppress-cc field: '%s'\n"
+msgstr "Ðевідоме --suppress-cc поле: \"%s\"\n"
+
+#, perl-format
+msgid "Unknown --confirm setting: '%s'\n"
+msgstr "Ðевідомий --confirm параметр: \"%s\"\n"
+
+#, perl-format
+msgid "warning: sendmail alias with quotes is not supported: %s\n"
+msgstr "попередженнÑ: sendmail пÑевдонім у лапках не підтримуєтьÑÑ: %s\n"
+
+#, perl-format
+msgid "warning: `:include:` not supported: %s\n"
+msgstr "попередженнÑ: \":include:\" не підтримуєтьÑÑ: %s\n"
+
+#, perl-format
+msgid "warning: `/file` or `|pipe` redirection not supported: %s\n"
+msgstr ""
+"попередженнÑ: \"/file\" або \"|pipe\" Ð¿ÐµÑ€ÐµÐ½Ð°Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð½Ðµ підтримуютьÑÑ: %s\n"
+
+#, perl-format
+msgid "warning: sendmail line is not recognized: %s\n"
+msgstr "попередженнÑ: Ñ€Ñдок sendmail не розпізнано: %s\n"
+
+#, perl-format
+msgid ""
+"File '%s' exists but it could also be the range of commits\n"
+"to produce patches for. Please disambiguate by...\n"
+"\n"
+" * Saying \"./%s\" if you mean a file; or\n"
+" * Giving --format-patch option if you mean a range.\n"
+msgstr ""
+"Файл \"%s\" Ñ–Ñнує, але це також може бути діапазон комітів\n"
+"Ð´Ð»Ñ Ñких ÑтворюютьÑÑ Ð»Ð°Ñ‚ÐºÐ¸. Будь лаÑка, розтлумачте...\n"
+"\n"
+" * Вказавши \"./%s\", Ñкщо на увазі маєтьÑÑ Ñ„Ð°Ð¹Ð»\n"
+" * Додавши --format-patch, Ñкщо на увазі маєтьÑÑ Ð´Ñ–Ð°Ð¿Ð°Ð·Ð¾Ð½.\n"
+
+#, perl-format
+msgid "Failed to opendir %s: %s"
+msgstr "Ðе вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ opendir %s: %s"
+
+msgid ""
+"\n"
+"No patch files specified!\n"
+"\n"
+msgstr ""
+"\n"
+"Файли латок не вказано!\n"
+"\n"
+
+#, perl-format
+msgid "No subject line in %s?"
+msgstr "Ðемає Ñ€Ñдка теми в %s?"
+
+#, perl-format
+msgid "Failed to open for writing %s: %s"
+msgstr "Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу %s: %s"
+
+msgid ""
+"Lines beginning in \"GIT:\" will be removed.\n"
+"Consider including an overall diffstat or table of contents\n"
+"for the patch you are writing.\n"
+"\n"
+"Clear the body content if you don't wish to send a summary.\n"
+msgstr ""
+"РÑдки, що починаютьÑÑ Ð· \"GIT:\", будуть вилучені.\n"
+"РозглÑньте можливіÑÑ‚ÑŒ Ð²ÐºÐ»ÑŽÑ‡ÐµÐ½Ð½Ñ Ð·Ð°Ð³Ð°Ð»ÑŒÐ½Ð¾Ð³Ð¾ diffstat або зміÑту\n"
+"Ð´Ð»Ñ Ð»Ð°Ñ‚ÐºÐ¸, Ñку ви пишете.\n"
+"\n"
+"ОчиÑÑ‚Ñ–Ñ‚ÑŒ вміÑÑ‚ тіла, Ñкщо ви не бажаєте надÑилати підÑумок.\n"
+
+#, perl-format
+msgid "Failed to open %s.final: %s"
+msgstr "Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ %s.final: %s"
+
+#, perl-format
+msgid "Failed to open %s: %s"
+msgstr "Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ %s: %s"
+
+msgid "Summary email is empty, skipping it\n"
+msgstr "ПідÑумковий лиÑÑ‚ порожній, пропущено\n"
+
+#. TRANSLATORS: please keep [y/N] as is.
+#, perl-format
+msgid "Are you sure you want to use <%s> [y/N]? "
+msgstr "Ви впевнені, що хочете викориÑтати <%s> [y/N]? "
+
+msgid ""
+"The following files are 8bit, but do not declare a Content-Transfer-"
+"Encoding.\n"
+msgstr ""
+"ÐаÑтупні файли Ñ” 8-бітними, але не міÑÑ‚ÑÑ‚ÑŒ Content-Transfer-Encoding.\n"
+
+msgid "Which 8bit encoding should I declare [UTF-8]? "
+msgstr "Яке 8-бітне ÐºÐ¾Ð´ÑƒÐ²Ð°Ð½Ð½Ñ Ñлід оголоÑити [UTF-8]? "
+
+#, perl-format
+msgid ""
+"Refusing to send because the patch\n"
+"\t%s\n"
+"has the template subject '*** SUBJECT HERE ***'. Pass --force if you really "
+"want to send.\n"
+msgstr ""
+"Відмовлено в надÑиланні, тому що латка\n"
+"\t%s\n"
+"має шаблонну тему \"*** SUBJECT HERE ***\". Додайте --force, Ñкщо ви дійÑно "
+"хочете відправити.\n"
+
+msgid "To whom should the emails be sent (if anyone)?"
+msgstr "Кому Ñлід надÑилати електронні лиÑти (Ñкщо комуÑÑŒ)?"
+
+#, perl-format
+msgid "fatal: alias '%s' expands to itself\n"
+msgstr "збій: пÑевдонім \"%s\" розгортаєтьÑÑ Ð½Ð° Ñамого Ñебе\n"
+
+msgid "Message-ID to be used as In-Reply-To for the first email (if any)? "
+msgstr ""
+"Message-ID, Ñкий буде викориÑтовуватиÑÑ Ñк In-Reply-To Ð´Ð»Ñ Ð¿ÐµÑ€ÑˆÐ¾Ð³Ð¾ лиÑта "
+"(Ñкщо такий Ñ”)? "
+
+#, perl-format
+msgid "error: unable to extract a valid address from: %s\n"
+msgstr "помилка: не вдалоÑÑ Ð²Ð¸Ñ‚Ñгти дійÑну адреÑу з: %s\n"
+
+#. TRANSLATORS: Make sure to include [q] [d] [e] in your
+#. translation. The program will only accept English input
+#. at this point.
+msgid "What to do with this address? ([q]uit|[d]rop|[e]dit): "
+msgstr "Що робити з цією адреÑою? ([q]uit|[d]rop|[e]dit): "
+
+#, perl-format
+msgid "CA path \"%s\" does not exist"
+msgstr "ШлÑÑ… до ЦВС \"%s\" не Ñ–Ñнує"
+
+msgid ""
+" The Cc list above has been expanded by additional\n"
+" addresses found in the patch commit message. By default\n"
+" send-email prompts before sending whenever this occurs.\n"
+" This behavior is controlled by the sendemail.confirm\n"
+" configuration setting.\n"
+"\n"
+" For additional information, run 'git send-email --help'.\n"
+" To retain the current behavior, but squelch this message,\n"
+" run 'git config --global sendemail.confirm auto'.\n"
+"\n"
+msgstr ""
+" Ðаведений вище ÑпиÑок копій було розширено додатковими\n"
+" адреÑами, знайденими у допиÑÑ– до коміту латки. Зазвичай\n"
+" send-email запитує перед надÑиланнÑм, коли це траплÑєтьÑÑ.\n"
+" Цю поведінку можна контролювати за допомогою параметра sendemail."
+"confirm\n"
+" Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ—.\n"
+"\n"
+" Ð”Ð»Ñ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð´Ð¾Ð´Ð°Ñ‚ÐºÐ¾Ð²Ð¾Ñ— інформації виконайте команду \"git send-email --"
+"help\".\n"
+"Ð”Ð»Ñ ÑƒÑ‚Ñ€Ð¸Ð¼Ð°Ð½Ð½Ñ Ð¿Ð¾Ñ‚Ð¾Ñ‡Ð½Ð¾Ñ— поведінки, але без цього повідомленнÑ,\n"
+" виконайте \"git config --global sendemail.confirm auto\".\n"
+
+#. TRANSLATORS: Make sure to include [y] [n] [e] [q] [a] in your
+#. translation. The program will only accept English input
+#. at this point.
+msgid "Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): "
+msgstr "ÐадіÑлати цей лиÑÑ‚? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): "
+
+msgid "Send this email reply required"
+msgstr "Відповідь на Ð·Ð°Ð¿Ð¸Ñ‚Ð°Ð½Ð½Ñ \"ÐадіÑлати цей лиÑÑ‚?\" Ñ” обовʼÑзковою"
+
+msgid "The required SMTP server is not properly defined."
+msgstr "Потрібний SMTP-Ñервер не визначено належним чином."
+
+#, perl-format
+msgid "Server does not support STARTTLS! %s"
+msgstr "Сервер не підтримує STARTTLS! %s"
+
+#, perl-format
+msgid "STARTTLS failed! %s"
+msgstr "STARTTLS завершивÑÑ Ð½ÐµÐ²Ð´Ð°Ð»Ð¾! %s"
+
+msgid "Unable to initialize SMTP properly. Check config and use --smtp-debug."
+msgstr ""
+"Ðе вдалоÑÑ Ð¿Ñ€Ð°Ð²Ð¸Ð»ÑŒÐ½Ð¾ ініціалізувати SMTP. Перевірте конфігурацію Ñ– "
+"ÑкориÑтайтеÑÑŒ --smtp-debug."
+
+#, perl-format
+msgid "Failed to send %s\n"
+msgstr "Ðе вдалоÑÑ Ð½Ð°Ð´Ñ–Ñлати %s\n"
+
+#, perl-format
+msgid "Dry-Sent %s\n"
+msgstr "Пробно відправлено %s\n"
+
+#, perl-format
+msgid "Sent %s\n"
+msgstr "Відправлено %s\n"
+
+msgid "Dry-OK. Log says:\n"
+msgstr "Пробно OK. Журнал каже:\n"
+
+msgid "OK. Log says:\n"
+msgstr "ОК. Журнал каже:\n"
+
+msgid "Result: "
+msgstr "Результат: "
+
+msgid "Result: OK\n"
+msgstr "Результат: OK\n"
+
+#, perl-format
+msgid "can't open file %s"
+msgstr "неможливо відкрити файл %s"
+
+#, perl-format
+msgid "(mbox) Adding cc: %s from line '%s'\n"
+msgstr "(mbox) Ð”Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ cc: %s з Ñ€Ñдка \"%s\"\n"
+
+#, perl-format
+msgid "(mbox) Adding to: %s from line '%s'\n"
+msgstr "(mbox) Ð”Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð´Ð¾: %s з Ñ€Ñдка \"%s\"\n"
+
+#, perl-format
+msgid "(non-mbox) Adding cc: %s from line '%s'\n"
+msgstr "(non-mbox) Ð”Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ cc: %s з Ñ€Ñдка \"%s\"\n"
+
+#, perl-format
+msgid "(body) Adding cc: %s from line '%s'\n"
+msgstr "(тіло) Ð”Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ cc: %s з Ñ€Ñдка \"%s\"\n"
+
+#, perl-format
+msgid "(%s) Could not execute '%s'"
+msgstr "(%s) Ðе вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ \"%s\""
+
+#, perl-format
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) Ðевірно Ñформований вивід з \"%s\""
+
+#, perl-format
+msgid "(%s) failed to close pipe to '%s'"
+msgstr "(%s) не вдалоÑÑ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¸ канал до \"%s\""
+
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) Ð”Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ %s: %s з: \"%s\"\n"
+
+msgid "cannot send message as 7bit"
+msgstr "неможливо надіÑлати Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ñк 7bit"
+
+msgid "invalid transfer encoding"
+msgstr "неприпуÑтиме ÐºÐ¾Ð´ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿ÐµÑ€ÐµÐ´Ð°Ñ‡Ñ–"
+
+#, perl-format
+msgid ""
+"fatal: %s: rejected by %s hook\n"
+"%s\n"
+"warning: no patches were sent\n"
+msgstr ""
+"збій: %s: відхилено %s хуком\n"
+"%s\n"
+"попередженнÑ: не було надіÑлано жодних латок\n"
+
+#, perl-format
+msgid "unable to open %s: %s\n"
+msgstr "не вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ %s: %s\n"
+
+#, perl-format
+msgid ""
+"fatal: %s:%d is longer than 998 characters\n"
+"warning: no patches were sent\n"
+msgstr ""
+"збій: %s:%d довше ніж 998 Ñимволів\n"
+"попередженнÑ: не було надіÑлано жодних латок\n"
+
+#, perl-format
+msgid "Skipping %s with backup suffix '%s'.\n"
+msgstr "ПропуÑк %s з ÑуфікÑом резервної копії \"%s\".\n"
+
+#. TRANSLATORS: please keep "[y|N]" as is.
+#, perl-format
+msgid "Do you really want to send %s? [y|N]: "
+msgstr "Ви дійÑно хочете відправити %s? [y|N]: "
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 7de9c72..39efaf1 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -14,6 +14,7 @@
# - ä¾äº‘ <lilydjwg AT gmail.com>
# - Yichao Yu <yyc1992 AT gmail.com>
# - Zhuang Ya <zhuangya AT me.com>
+# - Teng Long <dyroneteng AT gmail.com>
#
# Git glossary for Chinese translators
#
@@ -22,11 +23,13 @@
# 3-way merge | 三方åˆå¹¶
# abbreviate | 简写(的 SHA-1 值)
# alternate object database | 备用对象库
+# attribute source | 属性æ¥æº
# amend | 修补
# ancestor | 祖先,祖先æ交
# annotated tag | 附注标签
# bare repository | 纯仓库
# bisect | 二分查找
+# bitmap | ä½å›¾
# blob object | æ•°æ®å¯¹è±¡
# bloom filter | 布隆过滤器
# branch | 分支
@@ -43,6 +46,7 @@
# commit | æ交
# commit message | æ交说明
# commit object | æ交对象
+# commit-graph | æ交图
# commit-ish (also committish) | æ交å·
# cone | 锥形(稀ç–检出模型);锥(稀ç–检出)
# conflict | 冲çª
@@ -74,6 +78,7 @@
# index entry | 索引æ¡ç›®
# loose object | æ¾æ•£å¯¹è±¡
# loose refs | æ¾æ•£å¼•ç”¨
+# magic | 神奇å‰ç¼€ï¼ˆè·¯å¾„规格支æŒçš„一ç§å‰ç¼€è¡¨è¾¾å¼ï¼‰
# master | master(默认分支å)
# merge | åˆå¹¶
# object | 对象
@@ -83,6 +88,7 @@
# object type | 对象类型
# octopus | ç« é±¼å¼åˆå¹¶ï¼ˆä¸¤åˆ†æ”¯ä»¥ä¸Šçš„åˆå¹¶ï¼‰
# origin | origin(默认的远程å称)
+# orphan | 孤立(一般指孤立分支,å³æ²¡æœ‰ä»»ä½•æ交的分支)
# pack | 包
# pack index | 包索引
# packfile | 包文件
@@ -94,6 +100,7 @@
# plumbing | 管件(Git 底层核心命令的别称)
# porcelain | 瓷件(Git 上层å°è£…命令的别称)
# precious-objects repo | çå“仓库
+# preferred pack | 首选包(多包索引中引入的首选包概念)
# promisor | 承诺者
# prune | 清除
# pull | 拉,拉å–
@@ -102,6 +109,7 @@
# rebase | å˜åŸº
# ref | 引用
# reflog | 引用日志
+# refmap | 引用映射
# refspec | 引用规格
# remote | 远程,远程仓库
# remote-tracking branch | 远程跟踪分支
@@ -119,6 +127,7 @@
# smart HTTP protocol | 智能 HTTP åè®®
# squash | 挤压
# stage | n. 暂存区(å³ç´¢å¼•ï¼‰; v. æš‚å­˜
+# stale | 过期的
# stash | n. è´®è—区; v. è´®è—
# submodule | å­æ¨¡ç»„
# symref | 符å·å¼•ç”¨
@@ -138,45 +147,45 @@
# upstream | 上游
# upstream branch | 上游分支
# working tree | 工作区
-# Fangyi Zhou <me@fangyi.io>, 2021-2022.
+# Fangyi Zhou <me@fangyi.io>, 2021-2023.
#
msgid ""
msgstr ""
"Project-Id-Version: Git\n"
"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2022-06-22 10:25+0100\n"
-"PO-Revision-Date: 2022-06-14 20:52+0100\n"
-"Last-Translator: Fangyi Zhou <me@fangyi.io>\n"
-"Language-Team: GitHub <https://github.com/fangyi-zhou/git-po/>\n"
+"POT-Creation-Date: 2024-02-16 14:27+0800\n"
+"PO-Revision-Date: 2024-02-18 11:47+0800\n"
+"Last-Translator: Teng Long <dyroneteng@gmail.com>\n"
+"Language-Team: GitHub <https://github.com/dyrone/git/>\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Gtranslator 40.0\n"
+"X-Generator: Gtranslator 42.0\n"
#: add-interactive.c
#, c-format
msgid "Huh (%s)?"
msgstr "嗯(%s)?"
-#: add-interactive.c builtin/rebase.c reset.c sequencer.c
+#: add-interactive.c builtin/merge.c builtin/rebase.c reset.c sequencer.c
msgid "could not read index"
msgstr "ä¸èƒ½è¯»å–索引"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "binary"
msgstr "二进制"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "nothing"
msgstr "æ— "
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "unchanged"
msgstr "没有修改"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "Update"
msgstr "æ›´æ–°"
@@ -189,15 +198,15 @@ msgstr "ä¸èƒ½æš‚å­˜ '%s'"
msgid "could not write index"
msgstr "ä¸èƒ½å†™å…¥ç´¢å¼•"
-#: add-interactive.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-interactive.c
+#, c-format
msgid "updated %d path\n"
msgid_plural "updated %d paths\n"
msgstr[0] "更新了 %d 个路径\n"
msgstr[1] "更新了 %d 个路径\n"
-#: add-interactive.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-interactive.c
+#, c-format
msgid "note: %s is untracked now.\n"
msgstr "说明:%s 现已æˆä¸ºæœªè·Ÿè¸ªçš„。\n"
@@ -206,7 +215,7 @@ msgstr "说明:%s 现已æˆä¸ºæœªè·Ÿè¸ªçš„。\n"
msgid "make_cache_entry failed for path '%s'"
msgstr "对路径 '%s' çš„ make_cache_entry æ“作失败"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "Revert"
msgstr "还原"
@@ -214,24 +223,24 @@ msgstr "还原"
msgid "Could not parse HEAD^{tree}"
msgstr "ä¸èƒ½è§£æž HEAD^{tree}"
-#: add-interactive.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-interactive.c
+#, c-format
msgid "reverted %d path\n"
msgid_plural "reverted %d paths\n"
msgstr[0] "还原了 %d 个路径\n"
msgstr[1] "还原了 %d 个路径\n"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
#, c-format
msgid "No untracked files.\n"
msgstr "没有未跟踪的文件。\n"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "Add untracked"
msgstr "添加未跟踪的"
-#: add-interactive.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-interactive.c
+#, c-format
msgid "added %d path\n"
msgid_plural "added %d paths\n"
msgstr[0] "增加了 %d 个路径\n"
@@ -242,21 +251,21 @@ msgstr[1] "增加了 %d 个路径\n"
msgid "ignoring unmerged: %s"
msgstr "忽略未åˆå…¥çš„:%s"
-#: add-interactive.c add-patch.c git-add--interactive.perl
+#: add-interactive.c add-patch.c
#, c-format
msgid "Only binary files changed.\n"
msgstr "åªæœ‰äºŒè¿›åˆ¶æ–‡ä»¶è¢«ä¿®æ”¹ã€‚\n"
-#: add-interactive.c add-patch.c git-add--interactive.perl
+#: add-interactive.c add-patch.c
#, c-format
msgid "No changes.\n"
msgstr "没有修改。\n"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "Patch update"
msgstr "è¡¥ä¸æ›´æ–°"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "Review diff"
msgstr "检视 diff"
@@ -324,25 +333,25 @@ msgstr "选择一个编å·æ¡ç›®"
msgid "(empty) select nothing"
msgstr "(空)ä¸é€‰æ‹©ä»»ä½•å†…容"
-#: add-interactive.c builtin/clean.c git-add--interactive.perl
+#: add-interactive.c builtin/clean.c
msgid "*** Commands ***"
msgstr "*** 命令 ***"
-#: add-interactive.c builtin/clean.c git-add--interactive.perl
+#: add-interactive.c builtin/clean.c
msgid "What now"
msgstr "请选择"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "staged"
msgstr "缓存"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "unstaged"
msgstr "未缓存"
#: add-interactive.c apply.c builtin/am.c builtin/bugreport.c builtin/clone.c
-#: builtin/fetch.c builtin/merge.c builtin/pull.c builtin/submodule--helper.c
-#: git-add--interactive.perl
+#: builtin/diagnose.c builtin/fetch.c builtin/hook.c builtin/merge.c
+#: builtin/pull.c builtin/submodule--helper.c
msgid "path"
msgstr "路径"
@@ -350,28 +359,28 @@ msgstr "路径"
msgid "could not refresh index"
msgstr "ä¸èƒ½åˆ·æ–°ç´¢å¼•"
-#: add-interactive.c builtin/clean.c git-add--interactive.perl
+#: add-interactive.c builtin/clean.c
#, c-format
msgid "Bye.\n"
msgstr "å†è§ã€‚\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stage mode change [y,n,q,a,d%s,?]? "
msgstr "暂存模å¼å˜æ›´ [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stage deletion [y,n,q,a,d%s,?]? "
msgstr "暂存删除动作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stage addition [y,n,q,a,d%s,?]? "
msgstr "暂存添加动作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stage this hunk [y,n,q,a,d%s,?]? "
msgstr "æš‚å­˜è¯¥å— [y,n,q,a,d%s,?]? "
@@ -395,23 +404,23 @@ msgstr ""
"a - 暂存该å—和本文件中åŽé¢çš„全部å—\n"
"d - ä¸æš‚存该å—和本文件中åŽé¢çš„全部å—\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stash mode change [y,n,q,a,d%s,?]? "
msgstr "è´®è—模å¼å˜æ›´ [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stash deletion [y,n,q,a,d%s,?]? "
msgstr "è´®è—删除动作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stash addition [y,n,q,a,d%s,?]? "
msgstr "è´®è—添加动作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stash this hunk [y,n,q,a,d%s,?]? "
msgstr "è´®è—è¯¥å— [y,n,q,a,d%s,?]? "
@@ -435,23 +444,23 @@ msgstr ""
"a - è´®è—该å—和本文件中åŽé¢çš„全部å—\n"
"d - ä¸è´®è—该å—和本文件中åŽé¢çš„全部å—\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Unstage mode change [y,n,q,a,d%s,?]? "
msgstr "å–消暂存模å¼å˜æ›´ [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Unstage deletion [y,n,q,a,d%s,?]? "
msgstr "å–消暂存删除动作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Unstage addition [y,n,q,a,d%s,?]? "
msgstr "å–消暂存添加动作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Unstage this hunk [y,n,q,a,d%s,?]? "
msgstr "å–æ¶ˆæš‚å­˜è¯¥å— [y,n,q,a,d%s,?]? "
@@ -475,23 +484,23 @@ msgstr ""
"a - å–消暂存该å—和本文件中åŽé¢çš„全部å—\n"
"d - ä¸è¦å–消暂存该å—和本文件中åŽé¢çš„全部å—\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply mode change to index [y,n,q,a,d%s,?]? "
msgstr "将模å¼å˜æ›´åº”用到索引 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply deletion to index [y,n,q,a,d%s,?]? "
msgstr "将删除æ“作应用到索引 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply addition to index [y,n,q,a,d%s,?]? "
msgstr "将添加æ“作应用到索引 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply this hunk to index [y,n,q,a,d%s,?]? "
msgstr "将该å—应用到索引 [y,n,q,a,d%s,?]? "
@@ -515,23 +524,23 @@ msgstr ""
"a - 应用该å—和本文件中åŽé¢çš„全部å—\n"
"d - ä¸è¦åº”用该å—和本文件中åŽé¢çš„全部å—\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard mode change from worktree [y,n,q,a,d%s,?]? "
msgstr "从工作区中丢弃模å¼å˜æ›´ [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard deletion from worktree [y,n,q,a,d%s,?]? "
msgstr "从工作区中丢弃删除动作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard addition from worktree [y,n,q,a,d%s,?]? "
msgstr "从工作区中丢弃添加动作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard this hunk from worktree [y,n,q,a,d%s,?]? "
msgstr "ä»Žå·¥ä½œåŒºä¸­ä¸¢å¼ƒè¯¥å— [y,n,q,a,d%s,?]? "
@@ -555,23 +564,23 @@ msgstr ""
"a - 丢弃该å—和本文件中åŽé¢çš„全部å—\n"
"d - ä¸è¦ä¸¢å¼ƒè¯¥å—和本文件中åŽé¢çš„全部å—\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard mode change from index and worktree [y,n,q,a,d%s,?]? "
msgstr "从索引和工作区中丢弃模å¼å˜æ›´ [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard deletion from index and worktree [y,n,q,a,d%s,?]? "
msgstr "从索引和工作区中丢弃删除动作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard addition from index and worktree [y,n,q,a,d%s,?]? "
msgstr "从索引和工作区中丢弃添加动作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard this hunk from index and worktree [y,n,q,a,d%s,?]? "
msgstr "ä»Žç´¢å¼•å’Œå·¥ä½œåŒºä¸­ä¸¢å¼ƒè¯¥å— [y,n,q,a,d%s,?]? "
@@ -589,23 +598,23 @@ msgstr ""
"a - 丢弃该å—和本文件中åŽé¢çš„全部å—\n"
"d - ä¸è¦ä¸¢å¼ƒè¯¥å—和本文件中åŽé¢çš„全部å—\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply mode change to index and worktree [y,n,q,a,d%s,?]? "
msgstr "将模å¼å˜æ›´åº”用到索引和工作区 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply deletion to index and worktree [y,n,q,a,d%s,?]? "
msgstr "将删除æ“作应用到索引和工作区 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply addition to index and worktree [y,n,q,a,d%s,?]? "
msgstr "将添加æ“作应用到索引和工作区 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply this hunk to index and worktree [y,n,q,a,d%s,?]? "
msgstr "将该å—应用到索引和工作区 [y,n,q,a,d%s,?]? "
@@ -624,6 +633,26 @@ msgstr ""
"d - ä¸è¦åº”用该å—和本文件中åŽé¢çš„全部å—\n"
#: add-patch.c
+#, c-format
+msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
+msgstr "将模å¼å˜æ›´åº”用到工作区 [y,n,q,a,d%s,?]? "
+
+#: add-patch.c
+#, c-format
+msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
+msgstr "将删除æ“作应用到工作区 [y,n,q,a,d%s,?]? "
+
+#: add-patch.c
+#, c-format
+msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
+msgstr "将添加æ“作应用到工作区 [y,n,q,a,d%s,?]? "
+
+#: add-patch.c
+#, c-format
+msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
+msgstr "将该å—应用到工作区 [y,n,q,a,d%s,?]? "
+
+#: add-patch.c
msgid ""
"y - apply this hunk to worktree\n"
"n - do not apply this hunk to worktree\n"
@@ -643,11 +672,6 @@ msgid "could not parse hunk header '%.*s'"
msgstr "无法解æžæ•°æ®å—å¤´ä¿¡æ¯ '%.*s'"
#: add-patch.c
-#, c-format
-msgid "could not parse colored hunk header '%.*s'"
-msgstr "无法解æžå½©è‰²æ•°æ®å—å¤´ä¿¡æ¯ '%.*s'"
-
-#: add-patch.c
msgid "could not parse diff"
msgstr "ä¸èƒ½è§£æžå·®å¼‚ä¿¡æ¯"
@@ -692,7 +716,7 @@ msgstr ""
"\tä¸æ˜¯ç»“尾于:\n"
"%.*s"
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "Manual hunk edit mode -- see bottom for a quick guide.\n"
msgstr "手动å—ç¼–è¾‘æ¨¡å¼ -- 查看底部的快速指å—。\n"
@@ -709,9 +733,7 @@ msgstr ""
"è¦åˆ é™¤ '%c' 开始的行,删除它们。\n"
"以 %c 开始的行将被删除。\n"
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: 'it' refers to the patch mentioned in the previous messages.
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid ""
"If it does not apply cleanly, you will be given an opportunity to\n"
"edit again. If all lines of the hunk are removed, then the edit is\n"
@@ -728,21 +750,13 @@ msgstr "无法解æžæ•°æ®å—头信æ¯"
msgid "'git apply --cached' failed"
msgstr "'git apply --cached' 失败"
-#. #-#-#-#-# add-patch.c.po #-#-#-#-#
#. TRANSLATORS: do not translate [y/n]
#. The program will only accept that input at this point.
#. Consider translating (saying "no" discards!) as
#. (saying "n" for "no" discards!) if the translation
#. of the word "no" does not start with n.
#.
-#. #-#-#-#-# git-add--interactive.perl.po #-#-#-#-#
-#. TRANSLATORS: do not translate [y/n]
-#. The program will only accept that input
-#. at this point.
-#. Consider translating (saying "no" discards!) as
-#. (saying "n" for "no" discards!) if the translation
-#. of the word "no" does not start with n.
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid ""
"Your edited hunk does not apply. Edit again (saying \"no\" discards!) [y/n]? "
msgstr "您的编辑å—ä¸èƒ½è¢«åº”用。é‡æ–°ç¼–辑(选择 \"no\" 丢弃ï¼ï¼‰ [y/n]? "
@@ -751,11 +765,11 @@ msgstr "您的编辑å—ä¸èƒ½è¢«åº”用。é‡æ–°ç¼–辑(选择 \"no\" 丢弃ï¼ï
msgid "The selected hunks do not apply to the index!"
msgstr "选中的å—ä¸èƒ½åº”用到索引ï¼"
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "Apply them to the worktree anyway? "
msgstr "无论如何都è¦åº”用到工作区么?"
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "Nothing was applied.\n"
msgstr "未应用。\n"
@@ -793,11 +807,11 @@ msgstr "没有下一个å—"
msgid "No other hunks to goto"
msgstr "没有其它å¯ä¾›è·³è½¬çš„å—"
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "go to which hunk (<ret> to see more)? "
msgstr "跳转到哪个å—(<回车> 查看更多)? "
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "go to which hunk? "
msgstr "跳转到哪个å—?"
@@ -817,7 +831,7 @@ msgstr[1] "对ä¸èµ·ï¼Œåªæœ‰ %d 个å¯ç”¨å—。"
msgid "No other hunks to search"
msgstr "没有其它å¯ä¾›æŸ¥æ‰¾çš„å—"
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "search for regex? "
msgstr "使用正则表达å¼æœç´¢ï¼Ÿ"
@@ -882,9 +896,8 @@ msgid "Reverting is not possible because you have unmerged files."
msgstr "无法回退,因为您有未åˆå¹¶çš„文件。"
#: advice.c
-#, c-format
-msgid "It is not possible to %s because you have unmerged files."
-msgstr "无法 %s,因为您有未åˆå¹¶çš„文件。"
+msgid "Rebasing is not possible because you have unmerged files."
+msgstr "无法å˜åŸºï¼Œå› ä¸ºæ‚¨æœ‰æœªåˆå¹¶çš„文件。"
#: advice.c
msgid ""
@@ -911,6 +924,24 @@ msgid "Exiting because of unfinished merge."
msgstr "因为存在未完æˆçš„åˆå¹¶è€Œé€€å‡ºã€‚"
#: advice.c
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"无法在å离的分支上进行快进æ“作,您需è¦:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"或者:\n"
+"\n"
+"\tgit rebase\n"
+
+#: advice.c
msgid "Not possible to fast-forward, aborting."
msgstr "无法快进,终止。"
@@ -973,6 +1004,26 @@ msgstr ""
"通过将é…ç½®å˜é‡ advice.detachedHead 设置为 false æ¥å…³é—­æ­¤å»ºè®®\n"
"\n"
+#: advice.c
+#, c-format
+msgid ""
+"The following paths have been moved outside the\n"
+"sparse-checkout definition but are not sparse due to local\n"
+"modifications.\n"
+msgstr ""
+"下列的路径已ç»è¢«ç§»åŠ¨è‡³ç¨€ç–检出的定义之外,\n"
+"但是由于本地的修改而并éžç¨€ç–。\n"
+
+#: advice.c
+msgid ""
+"To correct the sparsity of these paths, do the following:\n"
+"* Use \"git add --sparse <paths>\" to update the index\n"
+"* Use \"git sparse-checkout reapply\" to apply the sparsity rules"
+msgstr ""
+"为了修正这些的路径的稀ç–性,请è¿è¡Œä¸‹åˆ—命令:\n"
+"* 使用 \"git add --sparse <路径>\" æ¥æ›´æ–°ç´¢å¼•\n"
+"* 使用 \"git sparse-checkout reapply\" æ¥åº”用稀ç–规则"
+
#: alias.c
msgid "cmdline ends with \\"
msgstr "命令行以 \\ 结尾"
@@ -981,6 +1032,11 @@ msgstr "命令行以 \\ 结尾"
msgid "unclosed quote"
msgstr "未关闭的引å·"
+#: alias.c builtin/cat-file.c builtin/notes.c builtin/prune-packed.c
+#: builtin/receive-pack.c builtin/tag.c t/helper/test-pkt-line.c
+msgid "too many arguments"
+msgstr "太多å‚æ•°"
+
#: apply.c
#, c-format
msgid "unrecognized whitespace option '%s'"
@@ -991,14 +1047,16 @@ msgstr "未能识别的空白字符选项 '%s'"
msgid "unrecognized whitespace ignore option '%s'"
msgstr "未能识别的空白字符忽略选项 '%s'"
-#: apply.c archive.c builtin/add.c builtin/branch.c builtin/checkout.c
-#: builtin/clone.c builtin/commit.c builtin/describe.c builtin/diff-tree.c
-#: builtin/difftool.c builtin/fast-export.c builtin/fetch.c builtin/help.c
-#: builtin/index-pack.c builtin/init-db.c builtin/log.c builtin/ls-files.c
-#: builtin/merge-base.c builtin/merge.c builtin/pack-objects.c builtin/push.c
-#: builtin/rebase.c builtin/repack.c builtin/reset.c builtin/rev-list.c
-#: builtin/show-branch.c builtin/stash.c builtin/submodule--helper.c
-#: builtin/tag.c builtin/worktree.c parse-options.c range-diff.c revision.c
+#: 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
+#: builtin/describe.c builtin/diff-tree.c builtin/difftool.c
+#: builtin/fast-export.c builtin/fetch.c builtin/help.c builtin/index-pack.c
+#: builtin/init-db.c builtin/log.c builtin/ls-files.c builtin/merge-base.c
+#: builtin/merge-tree.c builtin/merge.c builtin/pack-objects.c builtin/rebase.c
+#: builtin/repack.c builtin/replay.c builtin/reset.c builtin/rev-list.c
+#: builtin/rev-parse.c builtin/show-branch.c builtin/stash.c
+#: builtin/submodule--helper.c builtin/tag.c builtin/worktree.c parse-options.c
+#: range-diff.c revision.c
#, c-format
msgid "options '%s' and '%s' cannot be used together"
msgstr "选项 '%s' å’Œ '%s' ä¸èƒ½åŒæ—¶ä½¿ç”¨"
@@ -1009,6 +1067,14 @@ msgid "'%s' outside a repository"
msgstr "'%s' 在仓库之外"
#: apply.c
+msgid "failed to read patch"
+msgstr "无法读å–è¡¥ä¸"
+
+#: apply.c
+msgid "patch too large"
+msgstr "è¡¥ä¸è¿‡å¤§"
+
+#: apply.c
#, c-format
msgid "Cannot prepare timestamp regexp %s"
msgstr "æ— æ³•å‡†å¤‡æ—¶é—´æˆ³æ­£åˆ™è¡¨è¾¾å¼ %s"
@@ -1204,7 +1270,7 @@ msgstr "到 '%s' 的二进制补ä¸äº§ç”Ÿäº†ä¸æ­£ç¡®çš„结果(应为 %s,å´
msgid "patch failed: %s:%ld"
msgstr "打补ä¸å¤±è´¥ï¼š%s:%ld"
-#: apply.c
+#: apply.c builtin/mv.c
#, c-format
msgid "cannot checkout %s"
msgstr "ä¸èƒ½æ£€å‡º %s"
@@ -1372,7 +1438,7 @@ msgstr "ä¸èƒ½ä¸ºæ–°å»ºæ–‡ä»¶ %s 创建åŽç«¯å­˜å‚¨"
msgid "unable to add cache entry for %s"
msgstr "无法为 %s 添加缓存æ¡ç›®"
-#: apply.c builtin/bisect--helper.c builtin/gc.c
+#: apply.c builtin/bisect.c builtin/gc.c
#, c-format
msgid "failed to write to '%s'"
msgstr "无法写入 '%s'"
@@ -1413,6 +1479,11 @@ msgstr "截短 .rej 文件å为 %.*s.rej"
msgid "cannot open %s"
msgstr "ä¸èƒ½æ‰“å¼€ %s"
+#: apply.c rerere.c
+#, c-format
+msgid "cannot unlink '%s'"
+msgstr "ä¸èƒ½åˆ é™¤ '%s'"
+
#: apply.c
#, c-format
msgid "Hunk #%d applied cleanly."
@@ -1432,7 +1503,7 @@ msgstr "ç•¥è¿‡è¡¥ä¸ '%s'。"
msgid "No valid patches in input (allow with \"--allow-empty\")"
msgstr "输入中没有åˆæ³•çš„è¡¥ä¸ ï¼ˆä½¿ç”¨ \"--allow-empty\" æ¥å…许)"
-#: apply.c
+#: apply.c t/helper/test-cache-tree.c
msgid "unable to read index file"
msgstr "无法读å–索引文件"
@@ -1462,7 +1533,7 @@ msgid_plural "%d lines applied after fixing whitespace errors."
msgstr[0] "ä¿®å¤ç©ºç™½é”™è¯¯åŽï¼Œåº”用了 %d 行。"
msgstr[1] "ä¿®å¤ç©ºç™½é”™è¯¯åŽï¼Œåº”用了 %d 行。"
-#: apply.c builtin/add.c builtin/mv.c builtin/rm.c
+#: apply.c builtin/mv.c builtin/rm.c
msgid "Unable to write new index file"
msgstr "无法写入新索引文件"
@@ -1597,6 +1668,11 @@ msgstr "ä¸èƒ½æ‰“开数æ®å¯¹è±¡ %s"
msgid "unsupported file mode: 0%o (SHA1: %s)"
msgstr "ä¸æ”¯æŒçš„文件模å¼ï¼š0%o (SHA1: %s)"
+#: archive-tar.c archive-zip.c builtin/pack-objects.c
+#, c-format
+msgid "deflate error (%d)"
+msgstr "压缩错误 (%d)"
+
#: archive-tar.c
#, c-format
msgid "unable to start '%s' filter"
@@ -1621,11 +1697,6 @@ msgstr "路径ä¸æ˜¯æœ‰æ•ˆçš„ UTF-8:%s"
msgid "path too long (%d chars, SHA1: %s): %s"
msgstr "路径太长(%d 字符,SHA1:%s):%s"
-#: archive-zip.c builtin/pack-objects.c
-#, c-format
-msgid "deflate error (%d)"
-msgstr "压缩错误 (%d)"
-
#: archive-zip.c
#, c-format
msgid "timestamp too large for this system: %<PRIuMAX>"
@@ -1650,6 +1721,11 @@ msgstr "git archive --remote <仓库> [--exec <命令>] --list"
msgid "cannot read '%s'"
msgstr "ä¸èƒ½è¯»å– '%s'"
+#: archive.c
+#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr "路径规格 '%s' 匹é…了当å‰ç›®å½•å¤–的文件'"
+
#: archive.c builtin/add.c builtin/rm.c
#, c-format
msgid "pathspec '%s' did not match any files"
@@ -1665,16 +1741,12 @@ msgstr "无此引用:%.*s"
msgid "not a valid object name: %s"
msgstr "ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„对象å:%s"
-#: archive.c
+#: archive.c t/helper/test-cache-tree.c
#, c-format
msgid "not a tree object: %s"
msgstr "ä¸æ˜¯ä¸€ä¸ªæ ‘对象:%s"
#: archive.c
-msgid "current working directory is untracked"
-msgstr "当å‰å·¥ä½œç›®å½•æœªè¢«è·Ÿè¸ª"
-
-#: archive.c
#, c-format
msgid "File not found: %s"
msgstr "文件未找到:%s"
@@ -1707,7 +1779,7 @@ msgstr "æ ¼å¼"
msgid "archive format"
msgstr "归档格å¼"
-#: archive.c builtin/log.c
+#: archive.c builtin/log.c parse-options.h
msgid "prefix"
msgstr "å‰ç¼€"
@@ -1716,7 +1788,7 @@ msgid "prepend prefix to each pathname in the archive"
msgstr "为归档中æ¯ä¸ªè·¯å¾„å加上å‰ç¼€"
#: archive.c builtin/blame.c builtin/commit-tree.c builtin/config.c
-#: builtin/fast-export.c builtin/grep.c builtin/hash-object.c
+#: builtin/fast-export.c builtin/gc.c builtin/grep.c builtin/hash-object.c
#: builtin/ls-files.c builtin/notes.c builtin/read-tree.c parse-options.h
msgid "file"
msgstr "文件"
@@ -1741,6 +1813,15 @@ msgstr "读å–工作区中的 .gitattributes"
msgid "report archived files on stderr"
msgstr "在标准错误上报告归档文件"
+#: archive.c builtin/clone.c builtin/fetch.c builtin/pack-objects.c
+#: builtin/pull.c
+msgid "time"
+msgstr "时间"
+
+#: archive.c
+msgid "set modification time of archive entries"
+msgstr "设置归档æ¡ç›®çš„修改时间"
+
#: archive.c
msgid "set compression level"
msgstr "设置压缩级别"
@@ -1783,6 +1864,11 @@ msgstr "未知å‚æ•° --output"
#: archive.c
#, c-format
+msgid "extra command line parameter '%s'"
+msgstr "é¢å¤–的命令行å‚数:'%s'"
+
+#: archive.c
+#, c-format
msgid "Unknown archive format '%s'"
msgstr "æœªçŸ¥å½’æ¡£æ ¼å¼ '%s'"
@@ -1797,6 +1883,15 @@ msgid "%.*s is not a valid attribute name"
msgstr "%.*s ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„属性å"
#: attr.c
+msgid "unable to add additional attribute"
+msgstr "ä¸èƒ½æ·»åŠ é¢å¤–属性"
+
+#: attr.c
+#, c-format
+msgid "ignoring overly long attributes line %d"
+msgstr "忽略过长的属性行 %d"
+
+#: attr.c
#, c-format
msgid "%s not allowed: %s:%d"
msgstr "ä¸å…许 %s:%s:%d"
@@ -1809,6 +1904,36 @@ msgstr ""
"负值模版在 git attributes 中被忽略\n"
"当字符串确实è¦ä»¥æ„Ÿå¹å·å¼€å§‹æ—¶ï¼Œä½¿ç”¨ '\\!'。"
+#: attr.c
+#, c-format
+msgid "cannot fstat gitattributes file '%s'"
+msgstr "无法 fstat gitattributes 文件 '%s'"
+
+#: attr.c
+#, c-format
+msgid "ignoring overly large gitattributes file '%s'"
+msgstr "忽略过大的 gitattributes 文件 '%s'"
+
+#: attr.c
+#, c-format
+msgid "ignoring overly large gitattributes blob '%s'"
+msgstr "忽略过大的 gitattributes æ•°æ®å¯¹è±¡ '%s'"
+
+#: attr.c
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "错误的 --attr-source 或 GIT_ATTR_SOURCE"
+
+#: attr.c read-cache.c
+#, c-format
+msgid "unable to stat '%s'"
+msgstr "无法对 %s 执行 stat"
+
+#: bisect.c builtin/cat-file.c builtin/index-pack.c builtin/notes.c
+#: builtin/pack-objects.c combine-diff.c rerere.c
+#, c-format
+msgid "unable to read %s"
+msgstr "ä¸èƒ½è¯» %s"
+
#: bisect.c
#, c-format
msgid "Badly quoted content in file '%s': %s"
@@ -1933,18 +2058,14 @@ msgid "--contents and --reverse do not blend well."
msgstr "--contents å’Œ --reverse ä¸èƒ½æ··ç”¨ã€‚"
#: blame.c
-msgid "cannot use --contents with final commit object name"
-msgstr "ä¸èƒ½å°† --contents 和最终的æ交对象å共用"
-
-#: blame.c
msgid "--reverse and --first-parent together require specified latest commit"
msgstr "--reverse å’Œ --first-parent 共用,需è¦æŒ‡å®šæœ€æ–°çš„æ交"
#: blame.c builtin/commit.c builtin/log.c builtin/merge.c
-#: builtin/pack-objects.c builtin/shortlog.c bundle.c midx.c ref-filter.c
-#: remote.c sequencer.c submodule.c
+#: builtin/pack-objects.c builtin/shortlog.c midx.c pack-bitmap.c remote.c
+#: sequencer.c submodule.c
msgid "revision walk setup failed"
-msgstr "版本é历设置失败"
+msgstr "版本é历åˆå§‹åŒ–失败"
#: blame.c
msgid ""
@@ -2066,8 +2187,8 @@ msgstr "一个å为 '%s' 的分支已ç»å­˜åœ¨"
#: branch.c
#, c-format
-msgid "cannot force update the branch '%s' checked out at '%s'"
-msgstr "无法强制更新检出于 '%2$s' 的分支 '%1$s'"
+msgid "cannot force update the branch '%s' used by worktree at '%s'"
+msgstr "无法强制更新被工作区 '%2$s' 所使用的分支 '%1$s'"
#: branch.c
#, c-format
@@ -2120,10 +2241,11 @@ msgstr "å­æ¨¡ç»„ '%s':无法找到å­æ¨¡ç»„"
#: branch.c
#, c-format
msgid ""
-"You may try updating the submodules using 'git checkout %s && git submodule "
-"update --init'"
+"You may try updating the submodules using 'git checkout --no-recurse-"
+"submodules %s && git submodule update --init'"
msgstr ""
-"ä½ å¯ä»¥ç”¨ 'git checkout %s && git submodule update --init' æ¥å°è¯•æ›´æ–°å­æ¨¡ç»„"
+"ä½ å¯ä»¥ç”¨ 'git checkout --no-recurse-submodules %s && git submodule update --"
+"init' æ¥å°è¯•æ›´æ–°å­æ¨¡ç»„"
#: branch.c
#, c-format
@@ -2132,13 +2254,8 @@ msgstr "å­æ¨¡ç»„ '%s':ä¸èƒ½åˆ›å»ºåˆ†æ”¯ '%s'"
#: branch.c
#, c-format
-msgid "'%s' is already checked out at '%s'"
-msgstr "'%s' å·²ç»æ£€å‡ºåˆ° '%s'"
-
-#: branch.c
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "工作区 %s çš„ HEAD 指å‘没有被更新"
+msgid "'%s' is already used by worktree at '%s'"
+msgstr "'%s' å·²ç»è¢«å·¥ä½œåŒº '%s' 使用"
#: builtin/add.c
msgid "git add [<options>] [--] <pathspec>..."
@@ -2150,47 +2267,37 @@ msgid "cannot chmod %cx '%s'"
msgstr "ä¸èƒ½ chmod %cx '%s'"
#: builtin/add.c
-#, c-format
-msgid "unexpected diff status %c"
-msgstr "æ„å¤–çš„å·®å¼‚çŠ¶æ€ %c"
-
-#: builtin/add.c builtin/commit.c
-msgid "updating files failed"
-msgstr "更新文件失败"
-
-#: builtin/add.c
-#, c-format
-msgid "remove '%s'\n"
-msgstr "删除 '%s'\n"
-
-#: builtin/add.c
msgid "Unstaged changes after refreshing the index:"
msgstr "刷新索引之åŽå°šæœªè¢«æš‚存的å˜æ›´ï¼š"
-#: builtin/add.c builtin/rev-parse.c
-msgid "Could not read the index"
-msgstr "ä¸èƒ½è¯»å–索引"
+#: builtin/add.c
+msgid ""
+"the add.interactive.useBuiltin setting has been removed!\n"
+"See its entry in 'git help config' for details."
+msgstr ""
+"设置 add.interactive.useBuiltin å·²ç»è¢«ç§»é™¤ï¼\n"
+"查看 'git help config' 中的相关æ¡ç›®ä»¥èŽ·å–更多信æ¯ã€‚"
#: builtin/add.c
-msgid "Could not write patch"
-msgstr "ä¸èƒ½ç”Ÿæˆè¡¥ä¸"
+msgid "could not read the index"
+msgstr "ä¸èƒ½è¯»å–索引"
#: builtin/add.c
msgid "editing patch failed"
msgstr "编辑补ä¸å¤±è´¥"
-#: builtin/add.c
+#: builtin/add.c read-cache.c
#, c-format
-msgid "Could not stat '%s'"
+msgid "could not stat '%s'"
msgstr "ä¸èƒ½å¯¹ '%s' 调用 stat"
#: builtin/add.c
-msgid "Empty patch. Aborted."
-msgstr "空补ä¸ã€‚异常终止。"
+msgid "empty patch. aborted"
+msgstr "空补ä¸ã€‚异常终止"
#: builtin/add.c
#, c-format
-msgid "Could not apply '%s'"
+msgid "could not apply '%s'"
msgstr "ä¸èƒ½åº”用 '%s'"
#: builtin/add.c
@@ -2349,14 +2456,19 @@ msgstr ""
msgid "index file corrupt"
msgstr "索引文件æŸå"
+#: builtin/add.c builtin/am.c builtin/checkout.c builtin/clone.c
+#: builtin/commit.c builtin/stash.c merge.c rerere.c
+msgid "unable to write new index file"
+msgstr "无法写新的索引文件"
+
#: builtin/am.c builtin/mailinfo.c mailinfo.c
#, c-format
msgid "bad action '%s' for '%s'"
msgstr "'%2$s' 的错误动作 '%1$s'"
#: builtin/am.c builtin/blame.c builtin/fetch.c builtin/pack-objects.c
-#: builtin/pull.c diff-merges.c gpg-interface.c ls-refs.c parallel-checkout.c
-#: sequencer.c setup.c
+#: builtin/pull.c config.c diff-merges.c gpg-interface.c ls-refs.c
+#: parallel-checkout.c sequencer.c setup.c
#, c-format
msgid "invalid value for '%s': '%s'"
msgstr "'%s' 的值无效:'%s'"
@@ -2399,7 +2511,7 @@ msgstr "fseek 失败"
msgid "could not open '%s' for reading"
msgstr "无法打开 '%s' 进行读å–"
-#: builtin/am.c builtin/rebase.c strbuf.c wrapper.c
+#: builtin/am.c builtin/rebase.c editor.c sequencer.c wrapper.c
#, c-format
msgid "could not open '%s' for writing"
msgstr "无法打开 '%s' 进行写入"
@@ -2509,8 +2621,7 @@ msgstr "git write-tree 无法写入树对象"
msgid "applying to an empty history"
msgstr "正应用到一个空历å²ä¸Š"
-#: builtin/am.c builtin/commit.c builtin/merge.c sequencer.c
-#: t/helper/test-fast-rebase.c
+#: builtin/am.c builtin/commit.c builtin/merge.c builtin/replay.c sequencer.c
msgid "failed to write commit object"
msgstr "无法写æ交对象"
@@ -2598,11 +2709,6 @@ msgstr ""
"您应该对已ç»å†²çªè§£å†³çš„æ¯ä¸€ä¸ªæ–‡ä»¶æ‰§è¡Œ 'git add' æ¥æ ‡è®°å·²ç»å®Œæˆã€‚ \n"
"您å¯ä»¥å¯¹ \"由他们删除\" 的文件执行 `git rm` 命令。"
-#: builtin/am.c builtin/checkout.c builtin/clone.c builtin/stash.c merge.c
-#: rerere.c
-msgid "unable to write new index file"
-msgstr "无法写新的索引文件"
-
#: builtin/am.c builtin/reset.c
#, c-format
msgid "Could not parse object '%s'."
@@ -2618,17 +2724,12 @@ msgid ""
"Not rewinding to ORIG_HEAD"
msgstr "您好åƒåœ¨ä¸Šä¸€æ¬¡ 'am' 失败åŽç§»åŠ¨äº† HEAD。未回退至 ORIG_HEAD"
-#: builtin/am.c builtin/bisect--helper.c worktree.c
+#: builtin/am.c builtin/bisect.c worktree.c
#, c-format
msgid "failed to read '%s'"
msgstr "æ— æ³•è¯»å– '%s'"
#: builtin/am.c
-#, c-format
-msgid "options '%s=%s' and '%s=%s' cannot be used together"
-msgstr "选项 '%s=%s' å’Œ '%s=%s' ä¸èƒ½åŒæ—¶ä½¿ç”¨"
-
-#: builtin/am.c
msgid "git am [<options>] [(<mbox> | <Maildir>)...]"
msgstr "git am [<选项>] [(<mbox> | <Maildir>)...]"
@@ -2641,6 +2742,10 @@ msgid "run interactively"
msgstr "以交互å¼æ–¹å¼è¿è¡Œ"
#: builtin/am.c
+msgid "bypass pre-applypatch and applypatch-msg hooks"
+msgstr "绕过 pre-applypatch å’Œ applypatch-msg é’©å­"
+
+#: builtin/am.c
msgid "historical option -- no-op"
msgstr "è€çš„å‚æ•° —— 无作用"
@@ -2678,10 +2783,6 @@ msgid "pass --keep-cr flag to git-mailsplit for mbox format"
msgstr "针对 mbox æ ¼å¼ï¼Œå‘ git-mailsplit 传递 --keep-cr å‚æ•°"
#: builtin/am.c
-msgid "do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"
-msgstr "ä¸å‘ git-mailsplit 传递 --keep-cr å‚数,覆盖 am.keepcr 的设置"
-
-#: builtin/am.c
msgid "strip everything before a scissors line"
msgstr "丢弃è£åˆ‡çº¿å‰çš„所有内容"
@@ -2700,7 +2801,8 @@ msgid "n"
msgstr "n"
#: builtin/am.c builtin/branch.c builtin/bugreport.c builtin/cat-file.c
-#: builtin/for-each-ref.c builtin/ls-tree.c builtin/replace.c builtin/tag.c
+#: builtin/clone.c builtin/diagnose.c builtin/for-each-ref.c builtin/init-db.c
+#: builtin/ls-files.c builtin/ls-tree.c builtin/replace.c builtin/tag.c
#: builtin/verify-tag.c
msgid "format"
msgstr "æ ¼å¼"
@@ -2804,7 +2906,7 @@ msgstr "交互å¼æ¨¡å¼éœ€è¦å‘½ä»¤è¡Œä¸Šæ供补ä¸"
msgid "git apply [<options>] [<patch>...]"
msgstr "git apply [<选项>] [<è¡¥ä¸>...]"
-#: builtin/archive.c contrib/scalar/scalar.c
+#: builtin/archive.c diagnose.c
msgid "could not redirect output"
msgstr "ä¸èƒ½é‡å®šå‘输出"
@@ -2829,110 +2931,105 @@ msgstr "git archive:å议错误"
msgid "git archive: expected a flush"
msgstr "git archive:应有一个 flush 包"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-reset [<commit>]"
-msgstr "git bisect--helper --bisect-reset [<æ交>]"
-
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<term> --term-{old,good}"
-"=<term>] [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] "
-"[<paths>...]"
+"git bisect start [--term-(new|bad)=<term> --term-(old|good)=<term>] [--no-"
+"checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]"
msgstr ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<术语> --term-{old,good}"
-"=<术语>] [--no-checkout] [--first-parent] [<å> [<好>...]] [--] [<路径>...]"
+"git bisect start [--term-{new|bad}=<术语> --term-{old|good}=<术语>] [--no-"
+"checkout] [--first-parent] [<å> [<好>...]] [--] [<路径规格>...]"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-state (bad|new) [<rev>]"
-msgstr "git bisect--helper --bisect-state (bad|new) [<版本>]"
+#: builtin/bisect.c
+msgid "git bisect (good|bad) [<rev>...]"
+msgstr "git bisect (good|bad) [<版本>...]"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-state (good|old) [<rev>...]"
-msgstr "git bisect--helper --bisect-state (good|old) [<版本>...]"
+#: builtin/bisect.c
+msgid "git bisect skip [(<rev>|<range>)...]"
+msgstr "git bisect skip [(<版本>|<范围>)...]"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-replay <filename>"
-msgstr "git bisect--helper --bisect-replay <文件>"
+#: builtin/bisect.c
+msgid "git bisect reset [<commit>]"
+msgstr "git bisect reset [<æ交>]"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-skip [(<rev>|<range>)...]"
-msgstr "git bisect--helper --bisect-skip [(<版本>|<范围>)...]"
+#: builtin/bisect.c
+msgid "git bisect replay <logfile>"
+msgstr "git bisect replay <日志文件>"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-run <cmd>..."
-msgstr "git bisect--helper --bisect-run <命令>..."
+#: builtin/bisect.c
+msgid "git bisect run <cmd> [<arg>...]"
+msgstr "git bisect run <命令> [<å‚æ•°>...]"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "cannot open file '%s' in mode '%s'"
msgstr "ä¸èƒ½ä»¥ '%2$s' 模å¼æ‰“开文件 '%1$s'"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "could not write to file '%s'"
msgstr "ä¸èƒ½å†™å…¥æ–‡ä»¶ '%s'"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "cannot open file '%s' for reading"
msgstr "ä¸èƒ½æ‰“开文件 '%s' æ¥è¯»å–"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "'%s' is not a valid term"
msgstr "'%s' ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„术语"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "can't use the builtin command '%s' as a term"
msgstr "ä¸èƒ½ä½¿ç”¨å†…置命令 '%s' 作为术语"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "can't change the meaning of the term '%s'"
msgstr "ä¸èƒ½ä¿®æ”¹æœ¯è¯­ '%s' çš„å«ä¹‰"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "please use two different terms"
msgstr "请使用两个ä¸åŒçš„术语"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "We are not bisecting.\n"
msgstr "我们没有在二分查找。\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "'%s' is not a valid commit"
msgstr "'%s' ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„æ交"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid ""
"could not check out original HEAD '%s'. Try 'git bisect reset <commit>'."
msgstr "ä¸èƒ½æ£€å‡ºåŽŸå§‹ HEAD '%s'。å°è¯• 'git bisect reset <æ交>'。"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "Bad bisect_write argument: %s"
msgstr "åçš„ bisect_write å‚数:%s"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "couldn't get the oid of the rev '%s'"
msgstr "无法获å–版本 '%s' 的对象 ID"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "couldn't open the file '%s'"
msgstr "无法打开文件 '%s'"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "Invalid command: you're currently in a %s/%s bisect"
msgstr "无效的命令:您当å‰æ­£å¤„于一个 %s/%s 二分查找中"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid ""
"You need to give me at least one %s and %s revision.\n"
@@ -2941,7 +3038,7 @@ msgstr ""
"您需è¦ç»™æˆ‘至少一个 %s 和一个 %s 版本。\n"
"为此您å¯ä»¥ç”¨ \"git bisect %s\" å’Œ \"git bisect %s\"。"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid ""
"You need to start by \"git bisect start\".\n"
@@ -2952,7 +3049,7 @@ msgstr ""
"然åŽéœ€è¦æ供我至少一个 %s 和一个 %s 版本。\n"
"为此您å¯ä»¥ç”¨ \"git bisect %s\" å’Œ \"git bisect %s\" 命令。"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "bisecting only with a %s commit"
msgstr "在åªæœ‰ä¸€ä¸ª %s æ交的情况下二分查找"
@@ -2961,37 +3058,37 @@ msgstr "在åªæœ‰ä¸€ä¸ª %s æ交的情况下二分查找"
#. translation. The program will only accept English input
#. at this point.
#.
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "Are you sure [Y/n]? "
msgstr "您确认么[Y/n]? "
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "status: waiting for both good and bad commits\n"
msgstr "状æ€ï¼šæ­£åœ¨ç­‰å¾…好的和åçš„æ交\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "status: waiting for bad commit, %d good commit known\n"
msgid_plural "status: waiting for bad commit, %d good commits known\n"
msgstr[0] "状æ€ï¼šæ­£åœ¨ç­‰å¾…åçš„æ交,已知 %d 个好的æ交\n"
msgstr[1] "状æ€ï¼šæ­£åœ¨ç­‰å¾…åçš„æ交,已知 %d 个好的æ交\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "status: waiting for good commit(s), bad commit known\n"
msgstr "状æ€ï¼šæ­£åœ¨ç­‰å¾…好的æ交,已知åçš„æ交\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "no terms defined"
msgstr "未定义术语"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid ""
"Your current terms are %s for the old state\n"
"and %s for the new state.\n"
msgstr "您当å‰é’ˆå¯¹æ—§çŠ¶æ€çš„术语是 %s,对新状æ€çš„术语是 %s。\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid ""
"invalid argument %s for 'git bisect terms'.\n"
@@ -3000,52 +3097,48 @@ msgstr ""
"命令 'git bisect terms' çš„å‚æ•° %s 无效。\n"
"支æŒçš„选项有:--term-good|--term-old å’Œ --term-bad|--term-new。"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "revision walk setup failed\n"
msgstr "版本é历设置失败\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "could not open '%s' for appending"
msgstr "无法打开 '%s' 进行追加"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "'' is not a valid term"
msgstr "'' ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„术语"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "unrecognized option: '%s'"
msgstr "未识别的选项:'%s'"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "'%s' does not appear to be a valid revision"
msgstr "'%s' 看起æ¥ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„版本"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "bad HEAD - I need a HEAD"
msgstr "åçš„ HEAD - 我需è¦ä¸€ä¸ª HEAD"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "checking out '%s' failed. Try 'git bisect start <valid-branch>'."
msgstr "检出 '%s' 失败。å°è¯• 'git bisect start <有效分支>'。"
-#: builtin/bisect--helper.c
-msgid "won't bisect on cg-seek'ed tree"
-msgstr "ä¸ä¼šåœ¨åšäº† cg-seek 的树上åšäºŒåˆ†æŸ¥æ‰¾"
-
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "bad HEAD - strange symbolic ref"
msgstr "åçš„ HEAD - 奇怪的符å·å¼•ç”¨"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "invalid ref: '%s'"
msgstr "无效的引用:'%s'"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "You need to start by \"git bisect start\"\n"
msgstr "您需è¦æ‰§è¡Œ \"git bisect start\" æ¥å¼€å§‹\n"
@@ -3053,166 +3146,131 @@ msgstr "您需è¦æ‰§è¡Œ \"git bisect start\" æ¥å¼€å§‹\n"
#. translation. The program will only accept English input
#. at this point.
#.
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "Do you want me to do it for you [Y/n]? "
msgstr "您想让我为您这样åšä¹ˆ[Y/n]? "
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "Please call `--bisect-state` with at least one argument"
msgstr "请使用至少一个å‚数调用 `--bisect-state`"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "'git bisect %s' can take only one argument."
msgstr "'git bisect %s' åªèƒ½å¸¦ä¸€ä¸ªå‚数。"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "Bad rev input: %s"
msgstr "å的版本输入:%s"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "Bad rev input (not a commit): %s"
msgstr "å的版本输入(ä¸æ˜¯æ交):%s"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "We are not bisecting."
msgstr "我们没有在二分查找。"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "'%s'?? what are you talking about?"
msgstr "'%s'?? 您在说什么?"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "cannot read file '%s' for replaying"
msgstr "ä¸èƒ½è¯»å–文件 '%s' æ¥é‡æ”¾"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "running %s\n"
msgstr "正在执行 %s\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "bisect run failed: no command provided."
msgstr "二分查找è¿è¡Œå¤±è´¥ï¼šæ²¡æœ‰æ供命令。"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
-msgid "unable to verify '%s' on good revision"
-msgstr "æ— æ³•åœ¨å¥½ç‰ˆæœ¬ä¸­éªŒè¯ '%s'"
+msgid "unable to verify %s on good revision"
+msgstr "æ— æ³•åœ¨å¥½ç‰ˆæœ¬ä¸­éªŒè¯ %s"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "bogus exit code %d for good revision"
msgstr "å¥½ç‰ˆæœ¬è¿”å›žé”™è¯¯çš„é€€å‡ºç  %d"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
-msgid "bisect run failed: exit code %d from '%s' is < 0 or >= 128"
-msgstr "二分查找è¿è¡Œå¤±è´¥ï¼šå‘½ä»¤ '%2$s' çš„é€€å‡ºç  %1$d < 0 或 >= 128"
+msgid "bisect run failed: exit code %d from %s is < 0 or >= 128"
+msgstr "二分查找è¿è¡Œå¤±è´¥ï¼šå‘½ä»¤ %2$s çš„é€€å‡ºç  %1$d < 0 或 >= 128"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "cannot open file '%s' for writing"
msgstr "无法打开文件 '%s' 进行写入"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "bisect run cannot continue any more"
msgstr "二分查找ä¸èƒ½ç»§ç»­è¿è¡Œ"
-#: builtin/bisect--helper.c
-#, c-format
+#: builtin/bisect.c
msgid "bisect run success"
msgstr "二分查找è¿è¡ŒæˆåŠŸ"
-#: builtin/bisect--helper.c
-#, c-format
+#: builtin/bisect.c
msgid "bisect found first bad commit"
msgstr "二分查找找到了第一个åçš„æ交"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
-msgid ""
-"bisect run failed: 'git bisect--helper --bisect-state %s' exited with error "
-"code %d"
-msgstr "二分查找è¿è¡Œå¤±è´¥ï¼š'git bisect--helper --bisect-state %s' 退出ç ä¸º %d"
-
-#: builtin/bisect--helper.c
-msgid "reset the bisection state"
-msgstr "清除二分查找状æ€"
-
-#: builtin/bisect--helper.c
-msgid "check whether bad or good terms exist"
-msgstr "检查å的或好的术语是å¦å­˜åœ¨"
-
-#: builtin/bisect--helper.c
-msgid "print out the bisect terms"
-msgstr "打å°äºŒåˆ†æŸ¥æ‰¾æœ¯è¯­"
-
-#: builtin/bisect--helper.c
-msgid "start the bisect session"
-msgstr "å¯åŠ¨äºŒåˆ†æŸ¥æ‰¾è¿‡ç¨‹"
-
-#: builtin/bisect--helper.c
-msgid "find the next bisection commit"
-msgstr "查询下一个二分查找æ交"
-
-#: builtin/bisect--helper.c
-msgid "mark the state of ref (or refs)"
-msgstr "标记引用的状æ€"
-
-#: builtin/bisect--helper.c
-msgid "list the bisection steps so far"
-msgstr "列出到目å‰ä¸ºæ­¢çš„二分查找步骤"
-
-#: builtin/bisect--helper.c
-msgid "replay the bisection process from the given file"
-msgstr "从给定文件é‡æ”¾äºŒåˆ†æŸ¥æ‰¾è¿›ç¨‹"
+msgid "bisect run failed: 'git bisect %s' exited with error code %d"
+msgstr "二分查找è¿è¡Œå¤±è´¥ï¼š'git bisect %s' 退出ç ä¸º %d"
-#: builtin/bisect--helper.c
-msgid "skip some commits for checkout"
-msgstr "跳过è¦æ£€å‡ºçš„一些æ交"
-
-#: builtin/bisect--helper.c
-msgid "visualize the bisection"
-msgstr "å¯è§†åŒ–二分查找过程"
-
-#: builtin/bisect--helper.c
-msgid "use <cmd>... to automatically bisect"
-msgstr "使用 <命令>... æ¥è‡ªåŠ¨äºŒåˆ†æŸ¥æ‰¾"
+#: builtin/bisect.c
+#, c-format
+msgid "'%s' requires either no argument or a commit"
+msgstr "'%s' 无需å‚数或者需è¦ä¸€ä¸ªæ交"
-#: builtin/bisect--helper.c
-msgid "no log for BISECT_WRITE"
-msgstr "BISECT_WRITE 无日志"
+#: builtin/bisect.c
+#, c-format
+msgid "'%s' requires 0 or 1 argument"
+msgstr "'%s' 无需å‚数或者需è¦ä¸€ä¸ªå‚æ•°"
-#: builtin/bisect--helper.c
-msgid "--bisect-reset requires either no argument or a commit"
-msgstr "--bisect-reset 无需å‚数或者需è¦ä¸€ä¸ªæ交"
+#: builtin/bisect.c
+#, c-format
+msgid "'%s' requires 0 arguments"
+msgstr "'%s' 无需å‚æ•°"
-#: builtin/bisect--helper.c
-msgid "--bisect-terms requires 0 or 1 argument"
-msgstr "--bisect-terms éœ€è¦ 0 或 1 个å‚æ•°"
+#: builtin/bisect.c
+msgid "no logfile given"
+msgstr "未æ供日志文件"
-#: builtin/bisect--helper.c
-msgid "--bisect-next requires 0 arguments"
-msgstr "--bisect-next éœ€è¦ 0 个å‚æ•°"
+#: builtin/bisect.c
+#, c-format
+msgid "'%s' failed: no command provided."
+msgstr "'%s' è¿è¡Œå¤±è´¥ï¼šæ²¡æœ‰æ供命令。"
-#: builtin/bisect--helper.c
-msgid "--bisect-log requires 0 arguments"
-msgstr "--bisect-log éœ€è¦ 0 个å‚æ•°"
+#: builtin/bisect.c
+msgid "need a command"
+msgstr "需è¦ä¸€ä¸ªå‘½ä»¤"
-#: builtin/bisect--helper.c
-msgid "no logfile given"
-msgstr "未æ供日志文件"
+#: builtin/bisect.c builtin/cat-file.c
+#, c-format
+msgid "unknown command: '%s'"
+msgstr "未知命令:'%s'"
#: builtin/blame.c
msgid "git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"
msgstr "git blame [<选项>] [<版本选项>] [<版本>] [--] <文件>"
#: builtin/blame.c
+msgid "git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"
+msgstr "git annotate [<选项>] [<版本选项>] [<版本>] [--] <文件>"
+
+#: builtin/blame.c
msgid "<rev-opts> are documented in git-rev-list(1)"
msgstr "<版本选项> 的文档记录在 git-rev-list(1) 中"
@@ -3414,37 +3472,38 @@ msgstr "git branch [<选项>] [-r | -a] [--format]"
#, c-format
msgid ""
"deleting branch '%s' that has been merged to\n"
-" '%s', but not yet merged to HEAD."
+" '%s', but not yet merged to HEAD"
msgstr ""
"å°†è¦åˆ é™¤çš„分支 '%s' å·²ç»è¢«åˆå¹¶åˆ°\n"
-" '%s',但未åˆå¹¶åˆ° HEAD。"
+" '%s',但未åˆå¹¶åˆ° HEAD"
# 译者:ä¿æŒåŽŸæ¢è¡Œæ ¼å¼ï¼Œåœ¨è¾“出时 %s 的替代内容会让字符串å˜é•¿
#: builtin/branch.c
#, c-format
msgid ""
"not deleting branch '%s' that is not yet merged to\n"
-" '%s', even though it is merged to HEAD."
+" '%s', even though it is merged to HEAD"
msgstr ""
-"并未删除分支 '%s', 虽然它已ç»åˆå¹¶åˆ° HEAD,\n"
-" 然而å´å°šæœªè¢«åˆå¹¶åˆ°åˆ†æ”¯ '%s' 。"
+"并未删除分支 '%s',虽然它已ç»åˆå¹¶åˆ° HEAD,\n"
+" 然而å´å°šæœªè¢«åˆå¹¶åˆ°åˆ†æ”¯ '%s'"
#: builtin/branch.c
#, c-format
-msgid "Couldn't look up commit object for '%s'"
+msgid "couldn't look up commit object for '%s'"
msgstr "无法查询 '%s' 指å‘çš„æ交对象"
#: builtin/branch.c
#, c-format
-msgid ""
-"The branch '%s' is not fully merged.\n"
-"If you are sure you want to delete it, run 'git branch -D %s'."
-msgstr ""
-"分支 '%s' 没有完全åˆå¹¶ã€‚\n"
-"如果您确认è¦åˆ é™¤å®ƒï¼Œæ‰§è¡Œ 'git branch -D %s'。"
+msgid "the branch '%s' is not fully merged"
+msgstr "分支 '%s' 没有完全åˆå¹¶"
#: builtin/branch.c
-msgid "Update of config-file failed"
+#, c-format
+msgid "If you are sure you want to delete it, run 'git branch -D %s'"
+msgstr "如果您确认è¦åˆ é™¤å®ƒï¼Œæ‰§è¡Œ 'git branch -D %s'"
+
+#: builtin/branch.c
+msgid "update of config-file failed"
msgstr "æ›´æ–°é…置文件失败"
#: builtin/branch.c
@@ -3452,23 +3511,28 @@ msgid "cannot use -a with -d"
msgstr "ä¸èƒ½å°† -a å’Œ -d åŒæ—¶ä½¿ç”¨"
#: builtin/branch.c
-msgid "Couldn't look up commit object for HEAD"
-msgstr "无法查询 HEAD 指å‘çš„æ交对象"
+#, c-format
+msgid "cannot delete branch '%s' used by worktree at '%s'"
+msgstr "无法强制更新被工作区 '%2$s' 所使用的分支 '%1$s'"
#: builtin/branch.c
#, c-format
-msgid "Cannot delete branch '%s' checked out at '%s'"
-msgstr "无法删除检出于 '%2$s' 的分支 '%1$s'。"
+msgid "remote-tracking branch '%s' not found"
+msgstr "未能找到远程跟踪分支 '%s'"
#: builtin/branch.c
#, c-format
-msgid "remote-tracking branch '%s' not found."
-msgstr "未能找到远程跟踪分支 '%s'。"
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"分支 '%s' 未找到。\n"
+"是å¦å¿˜è®°æŒ‡å®š --remote 选项?"
#: builtin/branch.c
#, c-format
-msgid "branch '%s' not found."
-msgstr "分支 '%s' 未å‘现。"
+msgid "branch '%s' not found"
+msgstr "分支 '%s' 未å‘现"
#: builtin/branch.c
#, c-format
@@ -3495,56 +3559,63 @@ msgstr "HEAD (%s) æŒ‡å‘ refs/heads/ 之外"
#: builtin/branch.c
#, c-format
-msgid "Branch %s is being rebased at %s"
+msgid "branch %s is being rebased at %s"
msgstr "分支 %s 正被å˜åŸºåˆ° %s"
#: builtin/branch.c
#, c-format
-msgid "Branch %s is being bisected at %s"
+msgid "branch %s is being bisected at %s"
msgstr "分支 %s 正被二分查找于 %s"
#: builtin/branch.c
-msgid "cannot copy the current branch while not on any."
-msgstr "无法拷è´å½“å‰åˆ†æ”¯å› ä¸ºä¸å¤„于任何分支上。"
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "工作区 %s çš„ HEAD 指å‘没有被更新"
#: builtin/branch.c
-msgid "cannot rename the current branch while not on any."
-msgstr "无法é‡å‘½å当å‰åˆ†æ”¯å› ä¸ºä¸å¤„于任何分支上。"
+#, c-format
+msgid "invalid branch name: '%s'"
+msgstr "无效的分支å:'%s'"
#: builtin/branch.c
#, c-format
-msgid "Invalid branch name: '%s'"
-msgstr "无效的分支å:'%s'"
+msgid "no commit on branch '%s' yet"
+msgstr "分支 '%s' å°šæ— æ交"
+
+#: builtin/branch.c
+#, c-format
+msgid "no branch named '%s'"
+msgstr "没有分支 '%s'"
#: builtin/branch.c
-msgid "Branch rename failed"
+msgid "branch rename failed"
msgstr "分支é‡å‘½å失败"
#: builtin/branch.c
-msgid "Branch copy failed"
+msgid "branch copy failed"
msgstr "分支拷è´å¤±è´¥"
#: builtin/branch.c
#, c-format
-msgid "Created a copy of a misnamed branch '%s'"
+msgid "created a copy of a misnamed branch '%s'"
msgstr "已为错误命å的分支 '%s' 创建了一个副本"
#: builtin/branch.c
#, c-format
-msgid "Renamed a misnamed branch '%s' away"
+msgid "renamed a misnamed branch '%s' away"
msgstr "已将错误命å的分支 '%s' é‡å‘½å"
#: builtin/branch.c
#, c-format
-msgid "Branch renamed to %s, but HEAD is not updated!"
-msgstr "分支é‡å‘½å为 %s,但 HEAD 没有更新ï¼"
+msgid "branch renamed to %s, but HEAD is not updated"
+msgstr "分支é‡å‘½å为 %s,但 HEAD 没有更新"
#: builtin/branch.c
-msgid "Branch is renamed, but update of config-file failed"
+msgid "branch is renamed, but update of config-file failed"
msgstr "分支被é‡å‘½å,但更新é…置文件失败"
#: builtin/branch.c
-msgid "Branch is copied, but update of config-file failed"
+msgid "branch is copied, but update of config-file failed"
msgstr "分支已拷è´ï¼Œä½†æ›´æ–°é…置文件失败"
#: builtin/branch.c
@@ -3630,6 +3701,10 @@ msgstr "移动/é‡å‘½å一个分支,以åŠå®ƒçš„引用日志"
msgid "move/rename a branch, even if target exists"
msgstr "移动/é‡å‘½å一个分支,å³ä½¿ç›®æ ‡å·²å­˜åœ¨"
+#: builtin/branch.c builtin/for-each-ref.c builtin/tag.c
+msgid "do not output a newline after empty formatted refs"
+msgstr "在格å¼åŒ–引用结果为空之åŽï¼Œä¸è¾“出æ¢è¡Œç¬¦"
+
#: builtin/branch.c
msgid "copy a branch and its reflog"
msgstr "æ‹·è´ä¸€ä¸ªåˆ†æ”¯å’Œå®ƒçš„引用日志"
@@ -3686,14 +3761,14 @@ msgstr "排åºå’Œè¿‡æ»¤å±žäºŽå¤§å°å†™ä¸æ•æ„Ÿ"
msgid "recurse through submodules"
msgstr "在å­æ¨¡ç»„中递归"
-#: builtin/branch.c builtin/for-each-ref.c builtin/ls-tree.c builtin/tag.c
-#: builtin/verify-tag.c
+#: builtin/branch.c builtin/for-each-ref.c builtin/ls-files.c builtin/ls-tree.c
+#: builtin/tag.c builtin/verify-tag.c
msgid "format to use for the output"
msgstr "输出格å¼"
-#: builtin/branch.c builtin/submodule--helper.c submodule.c
-msgid "Failed to resolve HEAD as a valid ref."
-msgstr "无法将 HEAD 解æžä¸ºæœ‰æ•ˆå¼•ç”¨ã€‚"
+#: builtin/branch.c
+msgid "failed to resolve HEAD as a valid ref"
+msgstr "无法将 HEAD 解æžä¸ºæœ‰æ•ˆå¼•ç”¨"
#: builtin/branch.c builtin/clone.c
msgid "HEAD not found below refs/heads!"
@@ -3715,7 +3790,7 @@ msgid "branch name required"
msgstr "å¿…é¡»æ供分支å"
#: builtin/branch.c
-msgid "Cannot give description to detached HEAD"
+msgid "cannot give description to detached HEAD"
msgstr "ä¸èƒ½å‘分离头指针æä¾›æè¿°"
#: builtin/branch.c
@@ -3723,14 +3798,12 @@ msgid "cannot edit description of more than one branch"
msgstr "ä¸èƒ½ä¸ºä¸€ä¸ªä»¥ä¸Šçš„分支编辑æè¿°"
#: builtin/branch.c
-#, c-format
-msgid "No commit on branch '%s' yet."
-msgstr "分支 '%s' å°šæ— æ交。"
+msgid "cannot copy the current branch while not on any"
+msgstr "ä¸å¤„于任何分支上,无法拷è´å½“å‰åˆ†æ”¯"
#: builtin/branch.c
-#, c-format
-msgid "No branch named '%s'."
-msgstr "没有分支 '%s'。"
+msgid "cannot rename the current branch while not on any"
+msgstr "ä¸å¤„于任何分支上,无法é‡å‘½å当å‰åˆ†æ”¯"
#: builtin/branch.c
msgid "too many branches for a copy operation"
@@ -3747,8 +3820,8 @@ msgstr "为设置新上游æ供了太多的å‚æ•°"
#: builtin/branch.c
#, c-format
msgid ""
-"could not set upstream of HEAD to %s when it does not point to any branch."
-msgstr "无法设置 HEAD 的上游为 %s,因为 HEAD 没有指å‘任何分支。"
+"could not set upstream of HEAD to %s when it does not point to any branch"
+msgstr "无法设置 HEAD 的上游为 %s,因为 HEAD 没有指å‘任何分支"
#: builtin/branch.c
#, c-format
@@ -3765,17 +3838,17 @@ msgid "too many arguments to unset upstream"
msgstr "为å–消上游设置æ“作æ供了太多的å‚æ•°"
#: builtin/branch.c
-msgid "could not unset upstream of HEAD when it does not point to any branch."
+msgid "could not unset upstream of HEAD when it does not point to any branch"
msgstr "无法å–消 HEAD 的上游设置因为它没有指å‘一个分支"
#: builtin/branch.c
#, c-format
-msgid "Branch '%s' has no upstream information"
+msgid "branch '%s' has no upstream information"
msgstr "分支 '%s' 没有上游信æ¯"
#: builtin/branch.c
msgid ""
-"The -a, and -r, options to 'git branch' do not take a branch name.\n"
+"the -a, and -r, options to 'git branch' do not take a branch name.\n"
"Did you mean to use: -a|-r --list <pattern>?"
msgstr ""
"'git branch' çš„ -a å’Œ -r 选项ä¸å¸¦ä¸€ä¸ªåˆ†æ”¯å。\n"
@@ -3784,9 +3857,8 @@ msgstr ""
#: builtin/branch.c
msgid ""
"the '--set-upstream' option is no longer supported. Please use '--track' or "
-"'--set-upstream-to' instead."
-msgstr ""
-"ä¸å†æ”¯æŒé€‰é¡¹ '--set-upstream'。请使用 '--track' 或 '--set-upstream-to'。"
+"'--set-upstream-to' instead"
+msgstr "ä¸å†æ”¯æŒé€‰é¡¹ '--set-upstream'。请使用 '--track' 或 '--set-upstream-to'"
#: builtin/bugreport.c
msgid "git version:\n"
@@ -3810,8 +3882,12 @@ msgid "not run from a git repository - no hooks to show\n"
msgstr "ä¸æ˜¯åœ¨ git 仓库中执行 - 没有å¯æ˜¾ç¤ºçš„é’©å­\n"
#: builtin/bugreport.c
-msgid "git bugreport [-o|--output-directory <file>] [-s|--suffix <format>]"
-msgstr "git bugreport [-o|--output-directory <文件>] [-s|--suffix <æ ¼å¼>]"
+msgid ""
+"git bugreport [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--diagnose[=<mode>]]"
+msgstr ""
+"git bugreport [-o|--output-directory <文件>] [(-s|--suffix) <æ ¼å¼>]\n"
+" [--diagnose[=<模å¼>]"
#: builtin/bugreport.c
msgid ""
@@ -3847,19 +3923,39 @@ msgstr ""
"请检查下é¢é”™è¯¯æŠ¥å‘Šä¸­ä½™ä¸‹çš„内容。\n"
"您å¯ä»¥åˆ é™¤ä»»ä½•æ‚¨ä¸æƒ³å…±äº«çš„内容。\n"
+#: builtin/bugreport.c builtin/commit.c builtin/fast-export.c builtin/rebase.c
+#: parse-options.h
+msgid "mode"
+msgstr "模å¼"
+
#: builtin/bugreport.c
-msgid "specify a destination for the bugreport file"
+msgid ""
+"create an additional zip archive of detailed diagnostics (default 'stats')"
+msgstr "é¢å¤–创建详细诊断信æ¯çš„压缩包(默认 'stats')"
+
+#: builtin/bugreport.c
+msgid "specify a destination for the bugreport file(s)"
msgstr "指定错误报告文件的目标ä½ç½®"
#: builtin/bugreport.c
-msgid "specify a strftime format suffix for the filename"
+msgid "specify a strftime format suffix for the filename(s)"
msgstr "指定文件的 strftime æ ¼å¼åŽç¼€"
#: builtin/bugreport.c
#, c-format
+msgid "unknown argument `%s'"
+msgstr "未知å‚æ•° `%s'"
+
+#: builtin/bugreport.c builtin/diagnose.c
+#, c-format
msgid "could not create leading directories for '%s'"
msgstr "ä¸èƒ½ä¸º '%s' 创建先导目录"
+#: builtin/bugreport.c builtin/diagnose.c
+#, c-format
+msgid "unable to create diagnostics archive %s"
+msgstr "ä¸èƒ½åˆ›å»ºè¯Šæ–­å½’档包 %s"
+
#: builtin/bugreport.c
msgid "System Info"
msgstr "系统信æ¯"
@@ -3879,20 +3975,28 @@ msgid "Created new report at '%s'.\n"
msgstr "在 '%s' 创建了新报告。\n"
#: builtin/bundle.c
-msgid "git bundle create [<options>] <file> <git-rev-list args>"
-msgstr "git bundle create [<选项>] <文件> <git-rev-list å‚æ•°>"
+msgid ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<version>] <file> <git-rev-list-args>"
+msgstr ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<版本>] <文件> <git-rev-list-å‚æ•°>"
#: builtin/bundle.c
-msgid "git bundle verify [<options>] <file>"
-msgstr "git bundle verify [<选项>] <文件>"
+msgid "git bundle verify [-q | --quiet] <file>"
+msgstr "git bundle verify [-q | --quiet] <文件>"
#: builtin/bundle.c
msgid "git bundle list-heads <file> [<refname>...]"
msgstr "git bundle list-heads <文件> [<引用å>...]"
#: builtin/bundle.c
-msgid "git bundle unbundle <file> [<refname>...]"
-msgstr "git bundle unbundle <文件> [<引用å>...]"
+msgid "git bundle unbundle [--progress] <file> [<refname>...]"
+msgstr "git bundle unbundle [--progress] <文件> [<引用å>...]"
+
+#: builtin/bundle.c
+msgid "need a <file> argument"
+msgstr "需è¦ä¸€ä¸ª <文件> å‚æ•°"
#: builtin/bundle.c builtin/pack-objects.c
msgid "do not show progress meter"
@@ -3902,13 +4006,13 @@ msgstr "ä¸æ˜¾ç¤ºè¿›åº¦è¡¨"
msgid "show progress meter"
msgstr "显示进度表"
-#: builtin/bundle.c builtin/pack-objects.c
-msgid "show progress meter during object writing phase"
-msgstr "在对象写入阶段显示进度表"
+#: builtin/bundle.c
+msgid "historical; same as --progress"
+msgstr "è€çš„å‚数;等åŒäºŽ --progress"
-#: builtin/bundle.c builtin/pack-objects.c
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "当进度表显示时类似于 --all-progress"
+#: builtin/bundle.c
+msgid "historical; does nothing"
+msgstr "è€çš„å‚数;无作用"
#: builtin/bundle.c
msgid "specify bundle format version"
@@ -3935,11 +4039,6 @@ msgstr "需è¦ä¸€ä¸ªä»“库æ¥è§£å¼€å½’档包。"
msgid "Unbundling objects"
msgstr "解包对象中"
-#: builtin/bundle.c builtin/remote.c
-#, c-format
-msgid "Unknown subcommand: %s"
-msgstr "未知å­å‘½ä»¤ï¼š%s"
-
#: builtin/cat-file.c merge-recursive.c
#, c-format
msgid "cannot read object %s '%s'"
@@ -3969,11 +4068,6 @@ msgid "%s takes no arguments"
msgstr "%s ä¸éœ€è¦å‚æ•°"
#: builtin/cat-file.c
-#, c-format
-msgid "unknown command: '%s'"
-msgstr "未知命令:'%s'"
-
-#: builtin/cat-file.c
msgid "only one batch option may be specified"
msgstr "åªèƒ½æŒ‡å®šä¸€ä¸ªæ‰¹å¤„ç†é€‰é¡¹"
@@ -3991,23 +4085,23 @@ msgstr "git cat-file (-t | -s) [--allow-unknown-type] <对象>"
#: builtin/cat-file.c
msgid ""
+"git cat-file (--textconv | --filters)\n"
+" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
+msgstr ""
+"git cat-file (--textconv | --filters)\n"
+" [<版本>:<路径|树对象> | --path=<路径|树对象> <版本>]"
+
+#: builtin/cat-file.c
+msgid ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
+" [--textconv | --filters] [-Z]"
msgstr ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
-
-#: builtin/cat-file.c
-msgid ""
-"git cat-file (--textconv | --filters)\n"
-" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
-msgstr ""
-"git cat-file (--textconv | --filters)\n"
-" [<版本>:<路径|树对象> | --path=<路径|树对象> <版本>]"
+" [--textconv | --filters] [-Z]"
#: builtin/cat-file.c
msgid "Check object existence or emit object contents"
@@ -4037,6 +4131,10 @@ msgstr "显示对象大å°"
msgid "allow -s and -t to work with broken/corrupt objects"
msgstr "å…许 -s å’Œ -t 对æŸå的对象生效"
+#: builtin/cat-file.c builtin/log.c
+msgid "use mail map file"
+msgstr "使用邮件映射文件"
+
#: builtin/cat-file.c
msgid "Batch objects requested on stdin (or --batch-all-objects)"
msgstr "批é‡å¤„ç†æ ‡å‡†è¾“入中请求的对象(或者 --batch-all-objects)"
@@ -4050,6 +4148,14 @@ msgid "like --batch, but don't emit <contents>"
msgstr "类似于 --batch,但ä¸è¾“出 <内容>"
#: builtin/cat-file.c
+msgid "stdin is NUL-terminated"
+msgstr "标准输入以 NUL 字符分隔"
+
+#: builtin/cat-file.c
+msgid "stdin and stdout is NUL-terminated"
+msgstr "标准输入和标准输出以 NUL 字符分隔"
+
+#: builtin/cat-file.c
msgid "read commands from stdin"
msgstr "从标准输入读å–命令"
@@ -4128,23 +4234,23 @@ msgstr "'%s' éœ€è¦ <版本>"
msgid "<object> required with '-%c'"
msgstr "'-%c' éœ€è¦ <对象>"
-#: builtin/cat-file.c builtin/notes.c builtin/prune-packed.c
-#: builtin/receive-pack.c builtin/tag.c
-msgid "too many arguments"
-msgstr "太多å‚æ•°"
-
#: builtin/cat-file.c
#, c-format
msgid "only two arguments allowed in <type> <object> mode, not %d"
msgstr "<类型> <对象> 模å¼åªå…许两个å‚数,而ä¸æ˜¯ %d 个"
#: builtin/check-attr.c
-msgid "git check-attr [-a | --all | <attr>...] [--] <pathname>..."
-msgstr "git check-attr [-a | --all | <属性>...] [--] <路径å>..."
+msgid ""
+"git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] "
+"<pathname>..."
+msgstr ""
+"git check-attr [--source <树对象>] [-a | --all | <属性>...] [--] <路径å>..."
#: builtin/check-attr.c
-msgid "git check-attr --stdin [-z] [-a | --all | <attr>...]"
-msgstr "git check-attr --stdin [-z] [-a | --all | <属性>...]"
+msgid ""
+"git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"
+msgstr ""
+"git check-attr --stdin [-z] [--source <树对象>] [-a | --all | <属性>...]"
#: builtin/check-attr.c
msgid "report all attributes set on file"
@@ -4162,6 +4268,14 @@ msgstr "从标准输入读出文件å"
msgid "terminate input and output records by a NUL character"
msgstr "输入和输出的记录使用 NUL 字符终结"
+#: builtin/check-attr.c
+msgid "<tree-ish>"
+msgstr "<树对象>"
+
+#: builtin/check-attr.c
+msgid "which tree-ish to check attributes at"
+msgstr "è¦ç”¨å“ªä¸€ä¸ªæ ‘对象æ¥æ£€æŸ¥å±žæ€§"
+
#: builtin/check-ignore.c builtin/checkout.c builtin/gc.c builtin/worktree.c
msgid "suppress progress reporting"
msgstr "ä¸æ˜¾ç¤ºè¿›åº¦æŠ¥å‘Š"
@@ -4366,6 +4480,11 @@ msgstr "'%s' 或 '%s' ä¸èƒ½å’Œ %s 一起使用"
#: builtin/checkout.c
#, c-format
+msgid "'%s', '%s', or '%s' cannot be used when checking out of a tree"
+msgstr "'%s'ã€'%s' 或 '%s' ä¸èƒ½åœ¨æ£€å‡ºä¸€ä¸ªæ ‘时使用"
+
+#: builtin/checkout.c
+#, c-format
msgid "path '%s' is unmerged"
msgstr "路径 '%s' 未åˆå¹¶"
@@ -4391,7 +4510,7 @@ msgstr "ä¸èƒ½å¯¹ '%s' 执行 reflog æ“作:%s\n"
msgid "HEAD is now at"
msgstr "HEAD ç›®å‰ä½äºŽ"
-#: builtin/checkout.c builtin/clone.c t/helper/test-fast-rebase.c
+#: builtin/checkout.c builtin/clone.c
msgid "unable to update HEAD"
msgstr "ä¸èƒ½æ›´æ–° HEAD"
@@ -4660,8 +4779,8 @@ msgid "new-branch"
msgstr "新分支"
#: builtin/checkout.c
-msgid "new unparented branch"
-msgstr "新的没有父æ交的分支"
+msgid "new unborn branch"
+msgstr "新的未诞生的分支"
#: builtin/checkout.c builtin/merge.c
msgid "update ignored files (default)"
@@ -4725,9 +4844,9 @@ msgstr ""
#: builtin/checkout.c
msgid "you must specify path(s) to restore"
-msgstr "您必须指定一个è¦æ¢å¤çš„路径"
+msgstr "您必须指定è¦æ¢å¤çš„路径"
-#: builtin/checkout.c builtin/clone.c builtin/remote.c
+#: builtin/checkout.c builtin/clone.c builtin/remote.c builtin/replay.c
#: builtin/submodule--helper.c builtin/worktree.c
msgid "branch"
msgstr "分支"
@@ -4790,9 +4909,10 @@ msgstr "使用å åŠ æ¨¡å¼"
#: builtin/clean.c
msgid ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <paths>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] "
+"[<pathspec>...]"
msgstr ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <模å¼>] [-x | -X] [--] <路径>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <模å¼>] [-x | -X] [--] <路径规格>..."
#: builtin/clean.c
#, c-format
@@ -4832,7 +4952,7 @@ msgstr "æ‹’ç»åˆ é™¤å½“å‰å·¥ä½œç›®å½•\n"
msgid "Would refuse to remove current working directory\n"
msgstr "将拒ç»åˆ é™¤å½“å‰å·¥ä½œç›®å½•\n"
-#: builtin/clean.c git-add--interactive.perl
+#: builtin/clean.c
#, c-format
msgid ""
"Prompt help:\n"
@@ -4845,7 +4965,7 @@ msgstr ""
"foo - 通过唯一å‰ç¼€é€‰æ‹©ä¸€ä¸ªé€‰é¡¹\n"
" - (空)什么也ä¸é€‰æ‹©\n"
-#: builtin/clean.c git-add--interactive.perl
+#: builtin/clean.c
#, c-format
msgid ""
"Prompt help:\n"
@@ -4866,8 +4986,8 @@ msgstr ""
"* - 选择所有选项\n"
" - (空)结æŸé€‰æ‹©\n"
-#: builtin/clean.c git-add--interactive.perl
-#, c-format, perl-format
+#: builtin/clean.c
+#, c-format
msgid "Huh (%s)?\n"
msgstr "嗯(%s)?\n"
@@ -4936,7 +5056,8 @@ msgid "remove whole directories"
msgstr "删除整个目录"
#: builtin/clean.c builtin/describe.c builtin/grep.c builtin/log.c
-#: builtin/ls-files.c builtin/name-rev.c builtin/show-ref.c
+#: builtin/ls-files.c builtin/name-rev.c builtin/pack-refs.c builtin/show-ref.c
+#: ref-filter.h
msgid "pattern"
msgstr "模å¼"
@@ -4966,10 +5087,6 @@ msgid ""
msgstr ""
"clean.requireForce 默认为 true 且未æä¾› -iã€-n 或 -f 选项,拒ç»æ‰§è¡Œæ¸…ç†åŠ¨ä½œ"
-#: builtin/clean.c
-msgid "-x and -X cannot be used together"
-msgstr "-x å’Œ -X ä¸èƒ½åŒæ—¶ä½¿ç”¨"
-
#: builtin/clone.c
msgid "git clone [<options>] [--] <repo> [<dir>]"
msgstr "git clone [<选项>] [--] <仓库> [<路径>]"
@@ -5048,7 +5165,7 @@ msgstr "检出 <分支> 而ä¸æ˜¯è¿œç¨‹ HEAD"
msgid "path to git-upload-pack on the remote"
msgstr "远程 git-upload-pack 路径"
-#: builtin/clone.c builtin/fetch.c builtin/grep.c builtin/pull.c
+#: builtin/clone.c builtin/fetch.c builtin/pull.c
msgid "depth"
msgstr "深度"
@@ -5056,15 +5173,12 @@ msgstr "深度"
msgid "create a shallow clone of that depth"
msgstr "创建一个指定深度的浅克隆"
-#: builtin/clone.c builtin/fetch.c builtin/pack-objects.c builtin/pull.c
-msgid "time"
-msgstr "时间"
-
#: builtin/clone.c
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 "版本"
@@ -5092,6 +5206,10 @@ msgstr "git目录"
msgid "separate git dir from working tree"
msgstr "git目录和工作区分离"
+#: builtin/clone.c builtin/init-db.c
+msgid "specify the reference format to use"
+msgstr "指定è¦ä½¿ç”¨çš„引用格å¼"
+
#: builtin/clone.c
msgid "key=value"
msgstr "key=value"
@@ -5110,14 +5228,6 @@ msgstr "server-specific"
msgid "option to transmit"
msgstr "传输选项"
-#: builtin/clone.c builtin/fetch.c builtin/pull.c builtin/push.c
-msgid "use IPv4 addresses only"
-msgstr "åªä½¿ç”¨ IPv4 地å€"
-
-#: builtin/clone.c builtin/fetch.c builtin/pull.c builtin/push.c
-msgid "use IPv6 addresses only"
-msgstr "åªä½¿ç”¨ IPv6 地å€"
-
#: builtin/clone.c
msgid "apply partial clone filters to submodules"
msgstr "对å­æ¨¡ç»„使用部分克隆过滤器"
@@ -5131,6 +5241,14 @@ msgid "initialize sparse-checkout file to include only files at root"
msgstr "åˆå§‹åŒ–稀ç–检出文件,åªåŒ…å«æ ¹ç›®å½•æ–‡ä»¶"
#: builtin/clone.c
+msgid "uri"
+msgstr "uri"
+
+#: builtin/clone.c
+msgid "a URI for downloading bundles before fetching from origin remote"
+msgstr "用于在从 origin 远程获å–之å‰ä¸‹è½½å½’档包的 URI"
+
+#: builtin/clone.c
#, c-format
msgid "info: Could not add alternate for '%s': %s\n"
msgstr "info: ä¸èƒ½ä¸º '%s' 添加一个备用:%s\n"
@@ -5147,9 +5265,19 @@ msgstr "%s 存在且ä¸æ˜¯ä¸€ä¸ªç›®å½•"
#: builtin/clone.c
#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "'%s' 为符å·é“¾æŽ¥ï¼Œæ‹’ç»ç”¨ --local 克隆"
+
+#: builtin/clone.c
+#, c-format
msgid "failed to start iterator over '%s'"
msgstr "无法在 '%s' 上å¯åŠ¨è¿­ä»£å™¨"
+#: builtin/clone.c
+#, c-format
+msgid "symlink '%s' exists, refusing to clone with --local"
+msgstr "符å·é“¾æŽ¥ '%s' 存在,拒ç»ç”¨ --local 克隆"
+
#: builtin/clone.c compat/precompose_utf8.c
#, c-format
msgid "failed to unlink '%s'"
@@ -5204,8 +5332,8 @@ msgid "failed to initialize sparse-checkout"
msgstr "无法åˆå§‹åŒ–稀ç–检出"
#: builtin/clone.c
-msgid "remote HEAD refers to nonexistent ref, unable to checkout.\n"
-msgstr "远程 HEAD 指å‘一个ä¸å­˜åœ¨çš„引用,无法检出。\n"
+msgid "remote HEAD refers to nonexistent ref, unable to checkout"
+msgstr "远程 HEAD 指å‘一个ä¸å­˜åœ¨çš„引用,无法检出"
#: builtin/clone.c
msgid "unable to checkout working tree"
@@ -5227,14 +5355,14 @@ msgstr "无法删除临时的 alternates 文件"
msgid "Too many arguments."
msgstr "太多å‚数。"
-#: builtin/clone.c contrib/scalar/scalar.c
+#: builtin/clone.c scalar.c
msgid "You must specify a repository to clone."
msgstr "您必须指定一个仓库æ¥å…‹éš†ã€‚"
-#: builtin/clone.c
+#: builtin/clone.c builtin/init-db.c setup.c
#, c-format
-msgid "options '%s' and '%s %s' cannot be used together"
-msgstr "选项 '%s' å’Œ '%s %s' ä¸èƒ½åŒæ—¶ä½¿ç”¨"
+msgid "unknown ref storage format '%s'"
+msgstr "æœªçŸ¥çš„å¼•ç”¨å­˜å‚¨æ ¼å¼ '%s'"
#: builtin/clone.c
#, c-format
@@ -5325,6 +5453,19 @@ msgid "cannot clone from filtered bundle"
msgstr "无法从ç»è¿‡è¿‡æ»¤çš„归档包克隆"
#: builtin/clone.c
+msgid "failed to initialize the repo, skipping bundle URI"
+msgstr "无法åˆå§‹åŒ–仓库,跳过归档包 URI"
+
+#: builtin/clone.c
+#, c-format
+msgid "failed to fetch objects from bundle URI '%s'"
+msgstr "无法从归档包 URI '%s' 获å–对象"
+
+#: builtin/clone.c
+msgid "failed to fetch advertised bundles"
+msgstr "无法获å–公布的归档包"
+
+#: builtin/clone.c
msgid "remote transport reported error"
msgstr "远程传输报告错误"
@@ -5371,22 +5512,27 @@ msgstr "--command 必须是第一个å‚æ•°"
#: builtin/commit-graph.c
msgid ""
-"git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]"
+"git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]"
msgstr ""
-"git commit-graph verify [--object-dir <对象目录>] [--shallow] [--"
-"[no-]progress]"
+"git commit-graph verify [--object-dir <目录>] [--shallow] [--[no-]progress]"
#: builtin/commit-graph.c
msgid ""
-"git commit-graph write [--object-dir <objdir>] [--append] [--"
-"split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <n>] [--[no-]progress] <split options>"
-msgstr ""
-"git commit-graph write [--object-dir <对象目录>] [--append] [--split[=<策略"
-">]] [--reachable|--stdin-packs|--stdin-commits] [--changed-paths] [--"
-"[no-]max-new-filters <n>] [--[no-]progress] <切分选项>"
-
-#: builtin/commit-graph.c builtin/fetch.c builtin/log.c
+"git commit-graph write [--object-dir <dir>] [--append]\n"
+" [--split[=<strategy>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <split-options>"
+msgstr ""
+"git commit-graph write [--object-dir <目录>] [--append]\n"
+" [--split[=<ç­–ç•¥>]] [--reachable | --stdin-packs | --"
+"stdin-commits] \n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <切分选项>"
+
+#: builtin/commit-graph.c builtin/fetch.c builtin/log.c builtin/repack.c
msgid "dir"
msgstr "目录"
@@ -5396,12 +5542,17 @@ msgstr "ä¿å­˜å›¾å½¢çš„对象目录"
#: builtin/commit-graph.c
msgid "if the commit-graph is split, only verify the tip file"
-msgstr "如果æ交图形被拆分,åªéªŒè¯å¤´ä¸€ä¸ªæ–‡ä»¶"
+msgstr "如果æ交图被拆分,åªéªŒè¯å¤´ä¸€ä¸ªæ–‡ä»¶"
#: builtin/commit-graph.c
#, c-format
msgid "Could not open commit-graph '%s'"
-msgstr "无法打开æ交图形 '%s'"
+msgstr "无法打开æ交图 '%s'"
+
+#: builtin/commit-graph.c
+#, c-format
+msgid "could not open commit-graph chain '%s'"
+msgstr "无法打开æ交图链 '%s'"
#: builtin/commit-graph.c
#, c-format
@@ -5445,15 +5596,15 @@ msgstr "å¯ç”¨å˜æ›´è·¯å¾„的计算"
#: builtin/commit-graph.c
msgid "allow writing an incremental commit-graph file"
-msgstr "å…许写一个增é‡æ交图形文件"
+msgstr "å…许写一个增é‡æ交图文件"
#: builtin/commit-graph.c
msgid "maximum number of commits in a non-base split commit-graph"
-msgstr "在éžåŸºæœ¬æ‹†åˆ†æ交图形中的最大æ交数"
+msgstr "在éžåŸºæœ¬æ‹†åˆ†æ交图中的最大æ交数"
#: builtin/commit-graph.c
msgid "maximum ratio between two levels of a split commit-graph"
-msgstr "一个拆分æ交图形的两个级别之间的最大比率"
+msgstr "一个拆分æ交图的两个级别之间的最大比率"
#: builtin/commit-graph.c
msgid "only expire files older than a given date-time"
@@ -5471,18 +5622,17 @@ msgstr "ä¸èƒ½åŒæ—¶ä½¿ç”¨ --reachableã€--stdin-commits 或 --stdin-packs"
msgid "Collecting commits from input"
msgstr "正从标准输入收集æ交"
-#: builtin/commit-graph.c builtin/multi-pack-index.c
-#, c-format
-msgid "unrecognized subcommand: %s"
-msgstr "未识别的å­å‘½ä»¤ï¼š%s"
+#: builtin/commit-tree.c
+msgid "git commit-tree <tree> [(-p <parent>)...]"
+msgstr "git commit-tree <æ ‘> [(-p <父æ交>)...]"
#: builtin/commit-tree.c
msgid ""
-"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...] [(-F "
-"<file>)...] <tree>"
+"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]\n"
+" [(-F <file>)...] <tree>"
msgstr ""
-"git commit-tree [(-p <父æ交>)...] [-S[<keyid>]] [(-m <消æ¯>)...] [(-F <文件"
-">)...] <æ ‘>"
+"git commit-tree [(-p <父æ交>)...] [-S[<ç§é’¥ ID>]] [(-m <消æ¯>)...]\n"
+" [(-F <文件>)...] <树>"
#: builtin/commit-tree.c
#, c-format
@@ -5539,12 +5689,30 @@ msgid "git commit-tree: failed to read"
msgstr "git commit-tree:无法读å–"
#: builtin/commit.c
-msgid "git commit [<options>] [--] <pathspec>..."
-msgstr "git commit [<选项>] [--] <路径规格>..."
+msgid ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|"
+"reword):]<commit>)]\n"
+" [-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n"
+" [--date=<date>] [--cleanup=<mode>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<模å¼>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <æ交> | --fixup [(amend|"
+"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[<ç§é’¥ ID>]]\n"
+" [--] [<路径规格>...]"
#: builtin/commit.c
-msgid "git status [<options>] [--] <pathspec>..."
-msgstr "git status [<选项>] [--] <路径规格>..."
+msgid "git status [<options>] [--] [<pathspec>...]"
+msgstr "git status [<选项>] [--] [<路径规格>...]"
#: builtin/commit.c
msgid ""
@@ -5598,6 +5766,10 @@ msgstr ""
" git cherry-pick --skip\n"
"\n"
+#: builtin/commit.c read-cache.c
+msgid "updating files failed"
+msgstr "更新文件失败"
+
#: builtin/commit.c
msgid "failed to unpack HEAD tree object"
msgstr "无法解包 HEAD 树对象"
@@ -5623,10 +5795,6 @@ msgid "Failed to update main cache tree"
msgstr "ä¸èƒ½æ›´æ–°æ ‘的主缓存"
#: builtin/commit.c
-msgid "unable to write new_index file"
-msgstr "无法写 new_index 文件"
-
-#: builtin/commit.c
msgid "cannot do a partial commit during a merge."
msgstr "在åˆå¹¶è¿‡ç¨‹ä¸­ä¸èƒ½åšéƒ¨åˆ†æ交。"
@@ -5671,10 +5839,10 @@ msgid ""
"in the current commit message"
msgstr "无法选择一个未被当å‰æ交说明使用的注释字符"
-#: builtin/commit.c
+#: builtin/commit.c builtin/merge-tree.c
#, c-format
-msgid "could not lookup commit %s"
-msgstr "ä¸èƒ½æŸ¥è¯¢æ交 %s"
+msgid "could not lookup commit '%s'"
+msgstr "ä¸èƒ½æŸ¥è¯¢æ交 '%s'"
#: builtin/commit.c builtin/shortlog.c
#, c-format
@@ -5891,7 +6059,7 @@ msgstr "计算完整的领先/è½åŽå€¼"
msgid "version"
msgstr "版本"
-#: builtin/commit.c builtin/push.c builtin/worktree.c
+#: builtin/commit.c builtin/fetch.c builtin/push.c builtin/worktree.c
msgid "machine-readable output"
msgstr "机器å¯è¯»çš„输出"
@@ -5903,10 +6071,6 @@ msgstr "以长格å¼æ˜¾ç¤ºçŠ¶æ€ï¼ˆé»˜è®¤ï¼‰"
msgid "terminate entries with NUL"
msgstr "æ¡ç›®ä»¥ NUL 字符结尾"
-#: builtin/commit.c builtin/fast-export.c builtin/rebase.c parse-options.h
-msgid "mode"
-msgstr "模å¼"
-
#: builtin/commit.c
msgid "show untracked files, optional modes: all, normal, no. (Default: all)"
msgstr "显示未跟踪的文件,“模å¼â€çš„å¯é€‰å‚数:allã€normalã€no。(默认:all)"
@@ -5977,7 +6141,7 @@ msgstr "日期"
msgid "override date for commit"
msgstr "æ交时覆盖日期"
-#: builtin/commit.c parse-options.h ref-filter.h
+#: builtin/commit.c builtin/merge-tree.c parse-options.h ref-filter.h
msgid "commit"
msgstr "æ交"
@@ -6118,17 +6282,17 @@ msgstr "å› æ交说明的正文为空而终止æ交。\n"
#: builtin/commit.c
msgid ""
"repository has been updated, but unable to write\n"
-"new_index file. Check that disk is not full and quota is\n"
+"new index file. Check that disk is not full and quota is\n"
"not exceeded, and then \"git restore --staged :/\" to recover."
msgstr ""
-"仓库已更新,但无法写 new_index 文件。检查是å¦ç£ç›˜å·²æ»¡æˆ–\n"
+"仓库已更新,但无法写入索引文件。检查是å¦ç£ç›˜å·²æ»¡æˆ–\n"
"ç£ç›˜é…é¢å·²è€—尽,然åŽæ‰§è¡Œ \"git restore --staged :/\" æ¢å¤ã€‚"
#: builtin/config.c
msgid "git config [<options>]"
msgstr "git config [<选项>]"
-#: builtin/config.c builtin/env--helper.c
+#: builtin/config.c
#, c-format
msgid "unrecognized --type argument, %s"
msgstr "未能识别的 --type å‚数,%s"
@@ -6157,7 +6321,7 @@ msgstr "使用仓库级é…置文件"
msgid "use per-worktree config file"
msgstr "使用工作区级别的é…置文件"
-#: builtin/config.c
+#: builtin/config.c builtin/gc.c
msgid "use given config file"
msgstr "使用指定的é…置文件"
@@ -6237,11 +6401,11 @@ msgstr "获得颜色设置:é…ç½® [stdout-is-tty]"
msgid "Type"
msgstr "类型"
-#: builtin/config.c builtin/env--helper.c builtin/hash-object.c
+#: builtin/config.c builtin/hash-object.c
msgid "type"
msgstr "类型"
-#: builtin/config.c builtin/env--helper.c
+#: builtin/config.c
msgid "value is given this type"
msgstr "å–值为该类型"
@@ -6293,7 +6457,7 @@ msgstr "显示é…置的æ¥æºï¼ˆæ–‡ä»¶ã€æ ‡å‡†è¾“å…¥ã€æ•°æ®å¯¹è±¡ï¼Œæˆ–命令
msgid "show scope of config (worktree, local, global, system, command)"
msgstr "显示é…置的作用域(工作区ã€æœ¬åœ°ã€å…¨å±€ã€ç³»ç»Ÿã€å‘½ä»¤ï¼‰"
-#: builtin/config.c builtin/env--helper.c
+#: builtin/config.c
msgid "value"
msgstr "å–值"
@@ -6378,7 +6542,7 @@ msgstr "--blob åªèƒ½åœ¨ git 仓库内使用"
msgid "--worktree can only be used inside a git repository"
msgstr "--worktree åªèƒ½åœ¨ git 仓库内使用"
-#: builtin/config.c
+#: builtin/config.c builtin/gc.c
msgid "$HOME not set"
msgstr "$HOME 未设置"
@@ -6488,12 +6652,20 @@ msgid "unable to get credential storage lock in %d ms"
msgstr "无法在 %d ms 获得凭è¯å­˜å‚¨é”"
#: builtin/describe.c
-msgid "git describe [<options>] [<commit-ish>...]"
-msgstr "git describe [<选项>] [<æ交å·>...]"
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<æ交å·>...]"
#: builtin/describe.c
-msgid "git describe [<options>] --dirty"
-msgstr "git describe [<选项>] --dirty"
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<标记>]"
+
+#: builtin/describe.c
+msgid "git describe <blob>"
+msgstr "git describe <æ•°æ®å¯¹è±¡>"
#: builtin/describe.c
msgid "head"
@@ -6644,6 +6816,26 @@ msgstr "没有å‘现å称,无法æ述任何东西。"
msgid "option '%s' and commit-ishes cannot be used together"
msgstr "选项 '%s' å’Œæ交å·ä¸èƒ½åŒæ—¶ä½¿ç”¨"
+#: builtin/diagnose.c
+msgid ""
+"git diagnose [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--mode=<mode>]"
+msgstr ""
+"git diagnose [(-o | --output-directory) <路径>] [(-s | --suffix) <æ ¼å¼>]\n"
+" [--mode=<模å¼>]"
+
+#: builtin/diagnose.c
+msgid "specify a destination for the diagnostics archive"
+msgstr "指定诊断归档包的目标ä½ç½®"
+
+#: builtin/diagnose.c
+msgid "specify a strftime format suffix for the filename"
+msgstr "指定文件的 strftime æ ¼å¼åŽç¼€"
+
+#: builtin/diagnose.c
+msgid "specify the content of the diagnostic archive"
+msgstr "指定诊断信æ¯å½’档包的内容"
+
#: builtin/diff-tree.c
msgid "--merge-base only works with two commits"
msgstr "--merge-base 仅适用于两个æ交"
@@ -6654,6 +6846,10 @@ msgid "'%s': not a regular file or symlink"
msgstr "'%s':ä¸æ˜¯ä¸€ä¸ªæ­£è§„文件或符å·é“¾æŽ¥"
#: builtin/diff.c
+msgid "no merge given, only parents."
+msgstr "没有给出åˆå¹¶ï¼Œåªæœ‰çˆ¶æ交。"
+
+#: builtin/diff.c
#, c-format
msgid "invalid option: %s"
msgstr "无效选项:%s"
@@ -6796,30 +6992,6 @@ msgstr "没有为 --tool=<工具> å‚æ•°æä¾› <工具>"
msgid "no <cmd> given for --extcmd=<cmd>"
msgstr "没有为 --extcmd=<命令> å‚æ•°æä¾› <命令>"
-#: builtin/env--helper.c
-msgid "git env--helper --type=[bool|ulong] <options> <env-var>"
-msgstr "git env--helper --type=[bool|ulong] <选项> <环境å˜é‡>"
-
-#: builtin/env--helper.c
-msgid "default for git_env_*(...) to fall back on"
-msgstr "git_env_*(...) 的默认值"
-
-#: builtin/env--helper.c
-msgid "be quiet only use git_env_*() value as exit code"
-msgstr "安é™æ¨¡å¼ï¼Œåªä½¿ç”¨ git_env_*() 的值作为退出ç "
-
-#: builtin/env--helper.c
-#, c-format
-msgid "option `--default' expects a boolean value with `--type=bool`, not `%s`"
-msgstr "选项 `--default' å’Œ `--type=bool` 期望一个布尔值,ä¸æ˜¯ `%s`"
-
-#: builtin/env--helper.c
-#, c-format
-msgid ""
-"option `--default' expects an unsigned long value with `--type=ulong`, not "
-"`%s`"
-msgstr "选项 `--default' å’Œ `--type=ulong` 期望一个无符å·é•¿æ•´åž‹ï¼Œä¸æ˜¯ `%s`"
-
#: builtin/fast-export.c
msgid "git fast-export [<rev-list-opts>]"
msgstr "git fast-export [<rev-list 选项>]"
@@ -6962,147 +7134,17 @@ msgstr "git fetch --all [<选项>]"
msgid "fetch.parallel cannot be negative"
msgstr "fetch.parallel ä¸èƒ½ä¸ºè´Ÿæ•°"
-#: builtin/fetch.c builtin/pull.c
-msgid "fetch from all remotes"
-msgstr "从所有的远程抓å–"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "set upstream for git pull/fetch"
-msgstr "为 git pull/fetch 设置上游"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "追加到 .git/FETCH_HEAD 而ä¸æ˜¯è¦†ç›–它"
-
-#: builtin/fetch.c
-msgid "use atomic transaction to update references"
-msgstr "使用原å­äº‹åŠ¡æ›´æ–°å¼•ç”¨"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "path to upload pack on remote end"
-msgstr "上传包到远程的路径"
-
-#: builtin/fetch.c
-msgid "force overwrite of local reference"
-msgstr "强制覆盖本地引用"
-
-#: builtin/fetch.c
-msgid "fetch from multiple remotes"
-msgstr "从多个远程抓å–"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "fetch all tags and associated objects"
-msgstr "抓å–所有的标签和关è”对象"
-
-#: builtin/fetch.c
-msgid "do not fetch all tags (--no-tags)"
-msgstr "ä¸æŠ“å–任何标签(--no-tags)"
-
-#: builtin/fetch.c
-msgid "number of submodules fetched in parallel"
-msgstr "å­æ¨¡ç»„获å–的并å‘æ•°"
-
-#: builtin/fetch.c
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr "修改引用规格以将所有引用放入 refs/prefetch/"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "prune remote-tracking branches no longer on remote"
-msgstr "清除远程已ç»ä¸å­˜åœ¨çš„分支的跟踪分支"
-
-#: builtin/fetch.c
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr "清除远程ä¸å­˜åœ¨çš„本地标签,并且替æ¢å˜æ›´æ ‡ç­¾"
-
-# 译者:å¯é€‰å€¼ï¼Œä¸èƒ½ç¿»è¯‘
-#: builtin/fetch.c builtin/pull.c
-msgid "on-demand"
-msgstr "on-demand"
-
-#: builtin/fetch.c
-msgid "control recursive fetching of submodules"
-msgstr "控制å­æ¨¡ç»„的递归抓å–"
-
-#: builtin/fetch.c
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "将获å–到的引用写入 FETCH_HEAD 文件"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "keep downloaded pack"
-msgstr "ä¿æŒä¸‹è½½åŒ…"
-
-#: builtin/fetch.c
-msgid "allow updating of HEAD ref"
-msgstr "å…许更新 HEAD 引用"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "deepen history of shallow clone"
-msgstr "深化浅克隆的历å²"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "deepen history of shallow repository based on time"
-msgstr "基于时间æ¥æ·±åŒ–浅克隆的历å²"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "convert to a complete repository"
-msgstr "转æ¢ä¸ºä¸€ä¸ªå®Œæ•´çš„仓库"
-
-#: builtin/fetch.c
-msgid "re-fetch without negotiating common commits"
-msgstr "ä¸å商共有æ交é‡æ–°èŽ·å–"
-
-#: builtin/fetch.c
-msgid "prepend this to submodule path output"
-msgstr "在å­æ¨¡ç»„路径输出的å‰é¢åŠ ä¸Šæ­¤ç›®å½•"
-
-#: builtin/fetch.c
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr "递归获å–å­æ¨¡ç»„的缺çœå€¼ï¼ˆæ¯”é…置文件优先级低)"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "accept refs that update .git/shallow"
-msgstr "接å—æ›´æ–° .git/shallow 的引用"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "refmap"
-msgstr "引用映射"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "specify fetch refmap"
-msgstr "指定获å–æ“作的引用映射"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "report that we have only objects reachable from this object"
-msgstr "报告我们åªæ‹¥æœ‰ä»Žè¯¥å¯¹è±¡å¼€å§‹å¯è¾¾çš„对象"
-
-#: builtin/fetch.c
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr "ä¸èŽ·å–包文件;而是打å°å商的祖先æ交"
-
-#: builtin/fetch.c
-msgid "run 'maintenance --auto' after fetching"
-msgstr "获å–åŽæ‰§è¡Œ 'maintenance --auto'"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "check for forced-updates on all updated branches"
-msgstr "在所有更新分支上检查强制更新"
-
-#: builtin/fetch.c
-msgid "write the commit-graph after fetching"
-msgstr "抓å–åŽå†™æ交图"
-
-#: builtin/fetch.c
-msgid "accept refspecs from stdin"
-msgstr "从标准输入获å–引用规格"
-
#: builtin/fetch.c
msgid "couldn't find remote ref HEAD"
msgstr "无法å‘现远程 HEAD 引用"
#: builtin/fetch.c
#, c-format
+msgid "From %.*s\n"
+msgstr "æ¥è‡ª %.*s\n"
+
+#: builtin/fetch.c
+#, c-format
msgid "object %s not found"
msgstr "对象 %s 未å‘现"
@@ -7115,12 +7157,8 @@ msgid "[rejected]"
msgstr "[已拒ç»]"
#: builtin/fetch.c
-msgid "can't fetch in current branch"
-msgstr "当å‰åˆ†æ”¯ä¸‹ä¸èƒ½æ‰§è¡ŒèŽ·å–æ“作"
-
-#: builtin/fetch.c
-msgid "checked out in another worktree"
-msgstr "已在å¦ä¸€ä¸ªå·¥ä½œæ ‘中检出"
+msgid "can't fetch into checked-out branch"
+msgstr "无法获å–到已检出的分支"
#: builtin/fetch.c
msgid "[tag update]"
@@ -7192,11 +7230,6 @@ msgstr "æ‹’ç» %s 因为浅克隆的根ä¸å…许被更新"
#: builtin/fetch.c
#, c-format
-msgid "From %.*s\n"
-msgstr "æ¥è‡ª %.*s\n"
-
-#: builtin/fetch.c
-#, c-format
msgid ""
"some local refs could not be updated; try running\n"
" 'git remote prune %s' to remove any old, conflicting branches"
@@ -7305,6 +7338,141 @@ msgstr "未指定远程仓库;请指定一个用于获å–新版本的 URL 或è
msgid "you need to specify a tag name"
msgstr "您需è¦æŒ‡å®šä¸€ä¸ªæ ‡ç­¾å称"
+#: builtin/fetch.c builtin/pull.c
+msgid "fetch from all remotes"
+msgstr "从所有远程抓å–"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "set upstream for git pull/fetch"
+msgstr "为 git pull/fetch 设置上游"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "追加到 .git/FETCH_HEAD 而ä¸æ˜¯è¦†ç›–它"
+
+#: builtin/fetch.c
+msgid "use atomic transaction to update references"
+msgstr "使用原å­äº‹åŠ¡æ›´æ–°å¼•ç”¨"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "path to upload pack on remote end"
+msgstr "上传包到远程的路径"
+
+#: builtin/fetch.c
+msgid "force overwrite of local reference"
+msgstr "强制覆盖本地引用"
+
+#: builtin/fetch.c
+msgid "fetch from multiple remotes"
+msgstr "从多个远程抓å–"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "fetch all tags and associated objects"
+msgstr "抓å–所有的标签和关è”对象"
+
+#: builtin/fetch.c
+msgid "do not fetch all tags (--no-tags)"
+msgstr "ä¸æŠ“å–任何标签(--no-tags)"
+
+#: builtin/fetch.c
+msgid "number of submodules fetched in parallel"
+msgstr "获å–å­æ¨¡ç»„的并å‘æ•°"
+
+#: builtin/fetch.c
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr "修改引用规格以将所有引用放入 refs/prefetch/"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "prune remote-tracking branches no longer on remote"
+msgstr "清除远程已ç»ä¸å­˜åœ¨çš„分支的跟踪分支"
+
+#: builtin/fetch.c
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr "清除远程ä¸å­˜åœ¨çš„本地标签,并且替æ¢å˜æ›´æ ‡ç­¾"
+
+# 译者:å¯é€‰å€¼ï¼Œä¸èƒ½ç¿»è¯‘
+#: builtin/fetch.c builtin/pull.c
+msgid "on-demand"
+msgstr "on-demand"
+
+#: builtin/fetch.c
+msgid "control recursive fetching of submodules"
+msgstr "控制å­æ¨¡ç»„的递归抓å–"
+
+#: builtin/fetch.c
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "将获å–到的引用写入 FETCH_HEAD 文件"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "keep downloaded pack"
+msgstr "ä¿æŒå·²ä¸‹è½½çš„包"
+
+#: builtin/fetch.c
+msgid "allow updating of HEAD ref"
+msgstr "å…许更新 HEAD 引用"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "deepen history of shallow clone"
+msgstr "深化浅克隆的历å²"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "deepen history of shallow repository based on time"
+msgstr "基于时间æ¥æ·±åŒ–浅克隆的历å²"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "convert to a complete repository"
+msgstr "转æ¢ä¸ºä¸€ä¸ªå®Œæ•´çš„仓库"
+
+#: builtin/fetch.c
+msgid "re-fetch without negotiating common commits"
+msgstr "é‡æ–°èŽ·å–而ä¸å商共åŒæ交"
+
+#: builtin/fetch.c
+msgid "prepend this to submodule path output"
+msgstr "在å­æ¨¡ç»„路径输出的å‰é¢åŠ ä¸Šæ­¤ç›®å½•"
+
+#: builtin/fetch.c
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr "递归获å–å­æ¨¡ç»„的缺çœå€¼ï¼ˆæ¯”é…置文件优先级低)"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "accept refs that update .git/shallow"
+msgstr "接å—æ›´æ–° .git/shallow 的引用"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "refmap"
+msgstr "引用映射"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "specify fetch refmap"
+msgstr "指定获å–æ“作的引用映射"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "report that we have only objects reachable from this object"
+msgstr "报告我们åªæ‹¥æœ‰ä»Žè¯¥å¯¹è±¡å¼€å§‹å¯è¾¾çš„对象"
+
+#: builtin/fetch.c
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr "ä¸èŽ·å–包文件;而是打å°å商的祖先æ交"
+
+#: builtin/fetch.c
+msgid "run 'maintenance --auto' after fetching"
+msgstr "获å–åŽæ‰§è¡Œ 'maintenance --auto'"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "check for forced-updates on all updated branches"
+msgstr "在所有更新分支上检查强制更新"
+
+#: builtin/fetch.c
+msgid "write the commit-graph after fetching"
+msgstr "抓å–åŽå†™æ交图"
+
+#: builtin/fetch.c
+msgid "accept refspecs from stdin"
+msgstr "从标准输入获å–引用规格"
+
#: builtin/fetch.c
msgid "--negotiate-only needs one or more --negotiation-tip=*"
msgstr "--negotiate-only 需è¦ä¸€ä¸ªæˆ–多个 --negotiation-tip=*"
@@ -7318,6 +7486,11 @@ msgid "--unshallow on a complete repository does not make sense"
msgstr "对于一个完整的仓库,å‚æ•° --unshallow 没有æ„义"
#: builtin/fetch.c
+#, c-format
+msgid "failed to fetch bundles from '%s'"
+msgstr "无法从 '%s' 获å–归档包"
+
+#: builtin/fetch.c
msgid "fetch --all does not take a repository argument"
msgstr "fetch --all ä¸èƒ½å¸¦ä¸€ä¸ªä»“库å‚æ•°"
@@ -7445,9 +7618,17 @@ msgstr "åªæ‰“å°åŒ…å«è¯¥æ交的引用"
msgid "print only refs which don't contain the commit"
msgstr "åªæ‰“å°ä¸åŒ…å«è¯¥æ交的引用"
+#: builtin/for-each-ref.c
+msgid "read reference patterns from stdin"
+msgstr "从标准输入读å–引用的模å¼"
+
+#: builtin/for-each-ref.c
+msgid "unknown arguments supplied with --stdin"
+msgstr "为 --stdin æ供了未知的命令å‚æ•°"
+
#: builtin/for-each-repo.c
-msgid "git for-each-repo --config=<config> <command-args>"
-msgstr "git for-each-repo --config=<é…ç½®> <命令å‚æ•°>"
+msgid "git for-each-repo --config=<config> [--] <arguments>"
+msgstr "git for-each-repo --config=<é…ç½®> [--] <命令å‚æ•°>"
#: builtin/for-each-repo.c
msgid "config"
@@ -7461,6 +7642,11 @@ msgstr "存储ç€ä»“库路径列表的é…置项键å"
msgid "missing --config=<config>"
msgstr "缺少 --config=<é…ç½®>"
+#: builtin/for-each-repo.c
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "å‘现错误的é…置行 --config=%s"
+
#: builtin/fsck.c
msgid "unknown"
msgstr "未知"
@@ -7646,21 +7832,45 @@ msgid "notice: %s points to an unborn branch (%s)"
msgstr "注æ„:%s 指å‘一个尚未诞生的分支(%s)"
#: builtin/fsck.c
-msgid "Checking cache tree"
-msgstr "正在检查缓存树"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "正在检查缓存树 %s"
#: builtin/fsck.c
#, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "%s:cache-tree 中无效的 sha1 指针"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s:cache-tree %s 中存在无效的 sha1 指针"
#: builtin/fsck.c
msgid "non-tree in cache-tree"
msgstr "cache-tree 中éžæ ‘对象"
#: builtin/fsck.c
-msgid "git fsck [<options>] [<object>...]"
-msgstr "git fsck [<选项>] [<对象>...]"
+#, c-format
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s:resolve-undo %s 中存在无效的 sha1 指针"
+
+#: builtin/fsck.c
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "无法为包文件 %s 加载åå‘索引"
+
+#: builtin/fsck.c
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "包文件 '%s' çš„åå‘索引文件无效"
+
+#: builtin/fsck.c
+msgid ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<object>...]"
+msgstr ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<对象>...]"
#: builtin/fsck.c
msgid "show unreachable objects"
@@ -7733,14 +7943,6 @@ msgid "git fsmonitor--daemon run [<options>]"
msgstr "git fsmonitor--daemon run [<选项>]"
#: builtin/fsmonitor--daemon.c
-msgid "git fsmonitor--daemon stop"
-msgstr "git fsmonitor--daemon stop"
-
-#: builtin/fsmonitor--daemon.c
-msgid "git fsmonitor--daemon status"
-msgstr "git fsmonitor--daemon status"
-
-#: builtin/fsmonitor--daemon.c
#, c-format
msgid "value of '%s' out of range: %d"
msgstr "'%s' 的值超出范围:%d"
@@ -7840,7 +8042,7 @@ msgstr "等待守护进程å¯åŠ¨çš„最大秒数"
msgid "invalid 'ipc-threads' value (%d)"
msgstr "无效的 'ipc-threads' 值(%d)"
-#: builtin/fsmonitor--daemon.c
+#: builtin/fsmonitor--daemon.c t/helper/test-cache-tree.c
#, c-format
msgid "Unhandled subcommand '%s'"
msgstr "未处ç†çš„å­å‘½ä»¤ '%s'"
@@ -7863,7 +8065,7 @@ msgstr "对 %s 调用 fstat 失败:%s"
msgid "failed to parse '%s' value '%s'"
msgstr "æ— æ³•è§£æž '%s' 值 '%s'"
-#: builtin/gc.c builtin/init-db.c
+#: builtin/gc.c setup.c
#, c-format
msgid "cannot stat '%s'"
msgstr "ä¸èƒ½å¯¹ '%s' 调用 stat"
@@ -7890,6 +8092,10 @@ msgstr "清除未引用的对象"
msgid "pack unreferenced objects separately"
msgstr "分开打包未引用的对象"
+#: builtin/gc.c builtin/repack.c
+msgid "with --cruft, limit the size of new cruft packs"
+msgstr "使用 --cruft,é™åˆ¶æ–° cruft 包的总大å°"
+
#: builtin/gc.c
msgid "be more thorough (increased runtime)"
msgstr "更彻底(增加è¿è¡Œæ—¶é—´ï¼‰"
@@ -8040,8 +8246,23 @@ msgid "use at most one of --auto and --schedule=<frequency>"
msgstr "最多使用 --auto 和 --schedule=<频率> 其中之一"
#: builtin/gc.c
-msgid "failed to run 'git config'"
-msgstr "无法è¿è¡Œ 'git config'"
+#, c-format
+msgid "unable to add '%s' value of '%s'"
+msgstr "无法添加 '%2$s' 的 '%1$s' 值"
+
+#: builtin/gc.c
+msgid "return success even if repository was not registered"
+msgstr "å³ä¾¿ä»“库éžæ³¨å†Œä»ç„¶è¿”回æˆåŠŸ"
+
+#: builtin/gc.c
+#, c-format
+msgid "unable to unset '%s' value of '%s'"
+msgstr "无法å–消设置 '%2$s' çš„ '%1$s' 值"
+
+#: builtin/gc.c
+#, c-format
+msgid "repository '%s' is not registered"
+msgstr "仓库 '%s' 未注册"
#: builtin/gc.c
#, c-format
@@ -8075,24 +8296,20 @@ msgid "failed to run 'crontab -l'; your system might not support 'cron'"
msgstr "无法执行 'crontab -l',您的系统å¯èƒ½ä¸æ”¯æŒ 'cron'"
#: builtin/gc.c
-msgid "failed to run 'crontab'; your system might not support 'cron'"
-msgstr "无法è¿è¡Œ 'crontab',您的系统å¯èƒ½ä¸æ”¯æŒ 'cron'"
+msgid "failed to create crontab temporary file"
+msgstr "无法创建 crontab 临时文件"
#: builtin/gc.c
-msgid "failed to open stdin of 'crontab'"
-msgstr "无法打开 'crontab' 的标准输入"
-
-#: builtin/gc.c
-msgid "'crontab' died"
-msgstr "'crontab' 终止"
+msgid "failed to open temporary file"
+msgstr "无法打开临时文件"
#: builtin/gc.c
-msgid "failed to start systemctl"
-msgstr "无法å¯åŠ¨ systemctl"
+msgid "failed to run 'crontab'; your system might not support 'cron'"
+msgstr "无法è¿è¡Œ 'crontab',您的系统å¯èƒ½ä¸æ”¯æŒ 'cron'"
#: builtin/gc.c
-msgid "failed to run systemctl"
-msgstr "无法è¿è¡Œ systemctl"
+msgid "'crontab' died"
+msgstr "'crontab' 终止"
#: builtin/gc.c builtin/worktree.c
#, c-format
@@ -8105,6 +8322,14 @@ msgid "failed to flush '%s'"
msgstr "无法刷新 '%s'"
#: builtin/gc.c
+msgid "failed to start systemctl"
+msgstr "无法å¯åŠ¨ systemctl"
+
+#: builtin/gc.c
+msgid "failed to run systemctl"
+msgstr "无法è¿è¡Œ systemctl"
+
+#: builtin/gc.c
#, c-format
msgid "unrecognized --scheduler argument '%s'"
msgstr "无法识别的 --scheduler å‚æ•° '%s'"
@@ -8135,6 +8360,10 @@ msgid "scheduler to trigger git maintenance run"
msgstr "è§¦å‘ git maintenance 执行的调度器"
#: builtin/gc.c
+msgid "failed to set up maintenance schedule"
+msgstr "无法设置维护计划"
+
+#: builtin/gc.c
msgid "failed to add repo to global config"
msgstr "无法将仓库添加到全局é…ç½®"
@@ -8142,11 +8371,6 @@ msgstr "无法将仓库添加到全局é…ç½®"
msgid "git maintenance <subcommand> [<options>]"
msgstr "git maintenance <å­å‘½ä»¤> [<选项>]"
-#: builtin/gc.c
-#, c-format
-msgid "invalid subcommand: %s"
-msgstr "无效å­å‘½ä»¤ï¼š%s"
-
#: builtin/grep.c
msgid "git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]"
msgstr "git grep [<选项>] [-e] <模å¼> [<版本>...] [[--] <路径>...]"
@@ -8178,6 +8402,11 @@ msgstr "无法读å–树(%s)"
#: builtin/grep.c
#, c-format
+msgid "unable to read tree %s"
+msgstr "无法读å–æ ‘ %s"
+
+#: builtin/grep.c
+#, c-format
msgid "unable to grep from object of type %s"
msgstr "无法抓å–æ¥è‡ªäºŽ %s 类型的对象"
@@ -8235,8 +8464,8 @@ msgid "search in subdirectories (default)"
msgstr "在å­ç›®å½•ä¸­å¯»æ‰¾ï¼ˆé»˜è®¤ï¼‰"
#: builtin/grep.c
-msgid "descend at most <depth> levels"
-msgstr "最多以指定的深度å‘下寻找"
+msgid "descend at most <n> levels"
+msgstr "最多å‘下寻找 <n> 层"
#: builtin/grep.c
msgid "use extended POSIX regular expressions"
@@ -8371,6 +8600,10 @@ msgid "allow calling of grep(1) (ignored by this build)"
msgstr "å…许调用 grep(1)(本次构建忽略)"
#: builtin/grep.c
+msgid "maximum number of results per file"
+msgstr "æ¯ä¸ªæ–‡ä»¶çš„最大结果数é‡"
+
+#: builtin/grep.c
msgid "no pattern given"
msgstr "未æ供匹é…模å¼"
@@ -8414,11 +8647,15 @@ msgstr "åŒæ—¶ç»™å‡ºäº† --cached 和树对象"
#: builtin/hash-object.c
msgid ""
-"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] "
-"[--] <file>..."
+"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
+" [--stdin [--literally]] [--] <file>..."
msgstr ""
-"git hash-object [-t <类型>] [-w] [--path=<文件> | --no-filters] [--stdin] "
-"[--] <文件>..."
+"git hash-object [-t <类型>] [-w] [--path=<文件> | --no-filters]\n"
+" [--stdin [--literally]] [--] <文件>..."
+
+#: builtin/hash-object.c
+msgid "git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]"
+msgstr "git hash-object [-t <类型>] [-w] --stdin-paths [--no-filters]"
#: builtin/hash-object.c
msgid "object type"
@@ -8482,12 +8719,20 @@ msgid "print list of useful guides"
msgstr "显示有用的指å—列表"
#: builtin/help.c
+msgid "print list of user-facing repository, command and file interfaces"
+msgstr "打å°é¢å‘用户的仓库ã€å‘½ä»¤å’Œæ–‡ä»¶æŽ¥å£åˆ—表"
+
+#: builtin/help.c
+msgid "print list of file formats, protocols and other developer interfaces"
+msgstr "打å°æ–‡ä»¶æ ¼å¼ã€å议和其他开å‘者接å£åˆ—表"
+
+#: builtin/help.c
msgid "print all configuration variable names"
msgstr "打å°æ‰€æœ‰é…ç½®å˜é‡å称"
#: builtin/help.c
-msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>]"
-msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<命令>]"
+msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"
+msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<命令>|<文档>]"
#: builtin/help.c
#, c-format
@@ -8573,13 +8818,21 @@ msgid "'git help config' for more information"
msgstr "'git help config' 获å–更多信æ¯"
#: builtin/hook.c
-msgid "git hook run [--ignore-missing] <hook-name> [-- <hook-args>]"
-msgstr "git hook run [--ignore-missing] <é’©å­å称> [-- <é’©å­å‚æ•°>]"
+msgid ""
+"git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-"
+"args>]"
+msgstr ""
+"git hook run [--ignore-missing] [--to-stdin=<路径>] <é’©å­å称> [-- <é’©å­å‚æ•°"
+">]"
#: builtin/hook.c
msgid "silently ignore missing requested <hook-name>"
msgstr "é™é»˜åœ°å¿½ç•¥ç¼ºå¤±çš„ <é’©å­å称>"
+#: builtin/hook.c
+msgid "file to read into hooks' stdin"
+msgstr "读å–至钩å­æ ‡å‡†è¾“入的文件"
+
#: builtin/index-pack.c
#, c-format
msgid "object type mismatch at %s"
@@ -8675,11 +8928,6 @@ msgstr "解压缩严é‡çš„ä¸ä¸€è‡´"
msgid "SHA1 COLLISION FOUND WITH %s !"
msgstr "å‘现 %s 出现 SHA1 冲çªï¼"
-#: builtin/index-pack.c builtin/pack-objects.c
-#, c-format
-msgid "unable to read %s"
-msgstr "ä¸èƒ½è¯» %s"
-
#: builtin/index-pack.c
#, c-format
msgid "cannot read existing object info %s"
@@ -8836,7 +9084,7 @@ msgstr "无法返回当å‰å·¥ä½œç›®å½•"
msgid "bad %s"
msgstr "错误选项 %s"
-#: builtin/index-pack.c builtin/init-db.c
+#: builtin/index-pack.c builtin/init-db.c setup.c
#, c-format
msgid "unknown hash algorithm '%s'"
msgstr "未知的哈希算法 '%s'"
@@ -8854,101 +9102,18 @@ msgid "fsck error in pack objects"
msgstr "在打包对象中 fsck 检查出错"
#: builtin/init-db.c
-#, c-format
-msgid "cannot stat template '%s'"
-msgstr "ä¸èƒ½å¯¹æ¨¡ç‰ˆ '%s' 调用 stat"
-
-#: builtin/init-db.c
-#, c-format
-msgid "cannot opendir '%s'"
-msgstr "ä¸èƒ½æ‰“开目录 '%s'"
-
-#: builtin/init-db.c
-#, c-format
-msgid "cannot readlink '%s'"
-msgstr "ä¸èƒ½è¯»å–链接 '%s'"
-
-#: builtin/init-db.c
-#, c-format
-msgid "cannot symlink '%s' '%s'"
-msgstr "ä¸èƒ½è‡ª '%s' 到 '%s' 创建符å·é“¾æŽ¥"
-
-#: builtin/init-db.c
-#, c-format
-msgid "cannot copy '%s' to '%s'"
-msgstr "ä¸èƒ½æ‹·è´ '%s' 至 '%s'"
-
-#: builtin/init-db.c
-#, c-format
-msgid "ignoring template %s"
-msgstr "忽略模版 %s"
-
-#: builtin/init-db.c
-#, c-format
-msgid "templates not found in %s"
-msgstr "没有在 %s 中找到模版"
-
-#: builtin/init-db.c
-#, c-format
-msgid "not copying templates from '%s': %s"
-msgstr "没有从 '%s' å¤åˆ¶æ¨¡ç‰ˆï¼š%s"
-
-#: builtin/init-db.c
-#, c-format
-msgid "invalid initial branch name: '%s'"
-msgstr "无效的åˆå§‹åˆ†æ”¯å:'%s'"
-
-#: builtin/init-db.c
-#, c-format
-msgid "unable to handle file type %d"
-msgstr "ä¸èƒ½å¤„ç† %d 类型的文件"
-
-#: builtin/init-db.c
-#, c-format
-msgid "unable to move %s to %s"
-msgstr "ä¸èƒ½ç§»åŠ¨ %s 至 %s"
-
-#: builtin/init-db.c
-msgid "attempt to reinitialize repository with different hash"
-msgstr "å°è¯•ç”¨ä¸åŒçš„哈希算法é‡æ–°åˆå§‹åŒ–仓库"
-
-#: builtin/init-db.c
-#, c-format
-msgid "%s already exists"
-msgstr "%s å·²ç»å­˜åœ¨"
-
-#: builtin/init-db.c
-#, c-format
-msgid "re-init: ignored --initial-branch=%s"
-msgstr "re-init:已忽略 --initial-branch=%s"
-
-#: builtin/init-db.c
-#, c-format
-msgid "Reinitialized existing shared Git repository in %s%s\n"
-msgstr "é‡æ–°åˆå§‹åŒ–已存在的共享 Git 仓库于 %s%s\n"
-
-#: builtin/init-db.c
-#, c-format
-msgid "Reinitialized existing Git repository in %s%s\n"
-msgstr "å·²é‡æ–°åˆå§‹åŒ–已存在的 Git 仓库于 %s%s\n"
-
-#: builtin/init-db.c
-#, c-format
-msgid "Initialized empty shared Git repository in %s%s\n"
-msgstr "å·²åˆå§‹åŒ–空的共享 Git 仓库于 %s%s\n"
-
-#: builtin/init-db.c
-#, c-format
-msgid "Initialized empty Git repository in %s%s\n"
-msgstr "å·²åˆå§‹åŒ–空的 Git 仓库于 %s%s\n"
-
-#: builtin/init-db.c
msgid ""
-"git init [-q | --quiet] [--bare] [--template=<template-directory>] [--"
-"shared[=<permissions>]] [<directory>]"
+"git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
+" [--separate-git-dir <git-dir>] [--object-format=<format>]\n"
+" [--ref-format=<format>]\n"
+" [-b <branch-name> | --initial-branch=<branch-name>]\n"
+" [--shared[=<permissions>]] [<directory>]"
msgstr ""
-"git init [-q | --quiet] [--bare] [--template=<模æ¿ç›®å½•>] [--shared[=<æƒé™>]] "
-"[<目录>]"
+"git init [-q | --quiet] [--bare] [--template=<模æ¿ç›®å½•>]\n"
+" [--separate-git-dir <git 目录>] [--object-format=<æ ¼å¼>]\n"
+" [--ref-format=<æ ¼å¼>]\n"
+" [-b <分支å> | --initial-branch=<分支å>]\n"
+" [--shared[=<æƒé™>]] [<目录>]"
#: builtin/init-db.c
msgid "permissions"
@@ -8998,11 +9163,13 @@ msgstr "--separate-git-dir ä¸èƒ½ç”¨äºŽçº¯ä»“库"
#: builtin/interpret-trailers.c
msgid ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"<token>[(=|:)<value>])...] [<file>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<key>|<keyAlias>)[(=|:)<value>])...]\n"
+" [--parse] [<file>...]"
msgstr ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer <键>[(=|:)<值"
-">])...] [<文件>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<é”®|键别å>)[(=|:)<值>])...]\n"
+" [--parse] [<文件>...]"
#: builtin/interpret-trailers.c
msgid "edit files in place"
@@ -9013,6 +9180,10 @@ msgid "trim empty trailers"
msgstr "删除空的尾注"
#: builtin/interpret-trailers.c
+msgid "placement"
+msgstr "安置"
+
+#: builtin/interpret-trailers.c
msgid "where to place the new trailer"
msgstr "在哪里放置新的尾注"
@@ -9029,20 +9200,20 @@ msgid "output only the trailers"
msgstr "åªè¾“出尾注"
#: builtin/interpret-trailers.c
-msgid "do not apply config rules"
-msgstr "ä¸è¦åº”用é…置规则"
+msgid "do not apply trailer.* configuration variables"
+msgstr "ä¸åº”用 trailer.* é…ç½®å˜é‡"
#: builtin/interpret-trailers.c
-msgid "join whitespace-continued values"
-msgstr "连接空白折行的值"
+msgid "reformat multiline trailer values as single-line values"
+msgstr "将多行尾注值é‡æ–°æ ¼å¼åŒ–为å•è¡Œå€¼"
#: builtin/interpret-trailers.c
-msgid "set parsing options"
-msgstr "设置解æžé€‰é¡¹"
+msgid "alias for --only-trailers --only-input --unfold"
+msgstr "--only-trailers --only-input --unfold 的别å"
#: builtin/interpret-trailers.c
-msgid "do not treat --- specially"
-msgstr "ä¸è¦å¯¹ --- 特殊处ç†"
+msgid "do not treat \"---\" as the end of input"
+msgstr "ä¸è¦å°† \"---\" 视为输入的结æŸ"
#: builtin/interpret-trailers.c
msgid "trailer(s) to add"
@@ -9078,8 +9249,8 @@ msgid "show source"
msgstr "显示æº"
#: builtin/log.c
-msgid "use mail map file"
-msgstr "使用邮件映射文件"
+msgid "clear all previously-defined decoration filters"
+msgstr "清除所有之å‰å®šä¹‰çš„修饰过滤器"
#: builtin/log.c
msgid "only decorate refs that match <pattern>"
@@ -9099,7 +9270,7 @@ msgid ""
"<file>"
msgstr "跟踪 <文件> 中 <开始>,<结æŸ> 范围内的行或函数 :<函数å> çš„æ¼”å˜"
-#: builtin/log.c builtin/shortlog.c bundle.c
+#: builtin/log.c builtin/replay.c builtin/shortlog.c bundle.c
#, c-format
msgid "unrecognized argument: %s"
msgstr "未能识别的å‚数:%s"
@@ -9155,6 +9326,11 @@ msgid "not a range"
msgstr "ä¸æ˜¯ä¸€ä¸ªèŒƒå›´"
#: builtin/log.c
+#, c-format
+msgid "unable to read branch description file '%s'"
+msgstr "无法读å–分支æ述文件 '%s'"
+
+#: builtin/log.c
msgid "cover letter needs email format"
msgstr "附函需è¦é‚®ä»¶åœ°å€æ ¼å¼"
@@ -9281,6 +9457,10 @@ msgid "generate parts of a cover letter based on a branch's description"
msgstr "基于一个分支æ述生æˆéƒ¨åˆ†é™„函"
#: builtin/log.c
+msgid "use branch description from file"
+msgstr "使用æ¥è‡ªæ–‡ä»¶çš„分支æè¿°"
+
+#: builtin/log.c
msgid "use [<prefix>] instead of [PATCH]"
msgstr "使用 [<å‰ç¼€>] 代替 [PATCH]"
@@ -9405,6 +9585,10 @@ msgid "percentage by which creation is weighted"
msgstr "创建æƒé‡çš„百分比"
#: builtin/log.c
+msgid "show in-body From: even if identical to the e-mail header"
+msgstr "显示正文内的 From:,å³ä½¿å…¶ä¸Žç”µå­é‚®ä»¶å¤´ä¸­ä¸€è‡´"
+
+#: builtin/log.c
#, c-format
msgid "invalid ident line: %s"
msgstr "包å«æ— æ•ˆçš„身份标识:%s"
@@ -9479,11 +9663,31 @@ msgid ""
"Could not find a tracked remote branch, please specify <upstream> manually.\n"
msgstr "ä¸èƒ½æ‰¾åˆ°è·Ÿè¸ªçš„远程分支,请手工指定 <上游>。\n"
+#: builtin/ls-files.c builtin/ls-tree.c
+#, c-format
+msgid "could not get object info about '%s'"
+msgstr "无法获得关于 '%s' 的对象信æ¯"
+
+#: builtin/ls-files.c
+#, c-format
+msgid "bad ls-files format: element '%s' does not start with '('"
+msgstr "åçš„ ls-files æ ¼å¼ï¼šå…ƒç´  '%s' 没有以 '(' 开头"
+
+#: builtin/ls-files.c
+#, c-format
+msgid "bad ls-files format: element '%s' does not end in ')'"
+msgstr "åçš„ ls-files æ ¼å¼ï¼šå…ƒç´  '%s' 没有以 ')' 结尾"
+
+#: builtin/ls-files.c
+#, c-format
+msgid "bad ls-files format: %%%.*s"
+msgstr "åçš„ ls-files æ ¼å¼: %%%.*s"
+
#: builtin/ls-files.c
msgid "git ls-files [<options>] [<file>...]"
msgstr "git ls-files [<选项>] [<文件>...]"
-#: builtin/ls-files.c
+#: builtin/ls-files.c builtin/merge-tree.c
msgid "separate paths with the NUL character"
msgstr "用 NUL 字符分隔路径"
@@ -9591,15 +9795,23 @@ msgstr "抑制é‡å¤æ¡ç›®"
msgid "show sparse directories in the presence of a sparse index"
msgstr "在稀ç–索引存在时显示稀ç–目录"
+#: builtin/ls-files.c
+msgid ""
+"--format cannot be used with -s, -o, -k, -t, --resolve-undo, --deduplicate, "
+"--eol"
+msgstr ""
+"--format ä¸èƒ½å’Œ -sã€-oã€-kã€-tã€--resolve-undoã€--deduplicate å’Œ --eol åŒæ—¶ä½¿"
+"用"
+
#: builtin/ls-remote.c
msgid ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<repository> [<refs>...]]"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
+" [--symref] [<repository> [<patterns>...]]"
msgstr ""
-"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<仓库> [<引用>...]]"
+"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<å¯æ‰§è¡Œæ–‡ä»¶>]\n"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<é”®>]\n"
+" [--symref] [<仓库> [<模å¼>...]]"
#: builtin/ls-remote.c
msgid "do not print remote URL"
@@ -9643,11 +9855,6 @@ msgstr "git ls-tree [<选项>] <树对象> [<路径>...]"
#: builtin/ls-tree.c
#, c-format
-msgid "could not get object info about '%s'"
-msgstr "无法获得关于 '%s' 的对象信æ¯"
-
-#: builtin/ls-tree.c
-#, c-format
msgid "bad ls-tree format: element '%s' does not start with '('"
msgstr "åçš„ ls-tree æ ¼å¼ï¼šå…ƒç´  '%s' 没有以 '(' 开头"
@@ -9768,14 +9975,14 @@ msgid "git merge-base [-a | --all] --octopus <commit>..."
msgstr "git merge-base [-a | --all] --octopus <æ交>..."
#: builtin/merge-base.c
-msgid "git merge-base --independent <commit>..."
-msgstr "git merge-base --independent <æ交>..."
-
-#: builtin/merge-base.c
msgid "git merge-base --is-ancestor <commit> <commit>"
msgstr "git merge-base --is-ancestor <æ交> <æ交>"
#: builtin/merge-base.c
+msgid "git merge-base --independent <commit>..."
+msgstr "git merge-base --independent <æ交>..."
+
+#: builtin/merge-base.c
msgid "git merge-base --fork-point <ref> [<commit>]"
msgstr "git merge-base --fork-point <引用> [<æ交>]"
@@ -9807,11 +10014,21 @@ msgstr ""
"git merge-file [<选项>] [-L <åå­—1> [-L <åˆå§‹åå­—> [-L <åå­—2>]]] <文件1> <åˆ"
"始文件> <文件2>"
+#: builtin/merge-file.c diff.c
+msgid ""
+"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
+"\"histogram\""
+msgstr "选项 diff-algorithm 接å—å‚æ•° \"myers\"ã€\"minimal\"ã€\"patience\" å’Œ \"histogram\""
+
#: builtin/merge-file.c
msgid "send results to standard output"
msgstr "将结果å‘é€åˆ°æ ‡å‡†è¾“出"
#: builtin/merge-file.c
+msgid "use object IDs instead of filenames"
+msgstr "使用对象 ID 替æ¢æ–‡ä»¶å"
+
+#: builtin/merge-file.c
msgid "use a diff3 based merge"
msgstr "使用基于 diff3 çš„åˆå¹¶"
@@ -9831,6 +10048,14 @@ msgstr "如果冲çªï¼Œä½¿ç”¨ä»–们的版本"
msgid "for conflicts, use a union version"
msgstr "如果冲çªï¼Œä½¿ç”¨è”åˆç‰ˆæœ¬"
+#: builtin/merge-file.c diff.c
+msgid "<algorithm>"
+msgstr "<算法>"
+
+#: builtin/merge-file.c diff.c
+msgid "choose a diff algorithm"
+msgstr "选择一个差异算法"
+
#: builtin/merge-file.c
msgid "for conflicts, use this marker size"
msgstr "如果冲çªï¼Œä½¿ç”¨æŒ‡å®šé•¿åº¦çš„标记"
@@ -9843,6 +10068,15 @@ msgstr "ä¸è¦è­¦å‘Šå†²çª"
msgid "set labels for file1/orig-file/file2"
msgstr "为 文件1/åˆå§‹æ–‡ä»¶/文件2 设置标签"
+#: builtin/merge-file.c
+#, c-format
+msgid "object '%s' does not exist"
+msgstr "对象 '%s' ä¸å­˜åœ¨"
+
+#: builtin/merge-file.c
+msgid "Could not write object file"
+msgstr "ä¸èƒ½å†™å…¥å¯¹è±¡æ–‡ä»¶"
+
#: builtin/merge-recursive.c
#, c-format
msgid "unknown option %s"
@@ -9874,6 +10108,81 @@ msgstr "无法解æžå¼•ç”¨ '%s'"
msgid "Merging %s with %s\n"
msgstr "åˆå¹¶ %s å’Œ %s\n"
+#: builtin/merge-tree.c builtin/merge.c
+msgid "not something we can merge"
+msgstr "ä¸æ˜¯å¯ä»¥åˆå¹¶çš„东西"
+
+#: builtin/merge-tree.c builtin/merge.c
+msgid "refusing to merge unrelated histories"
+msgstr "æ‹’ç»åˆå¹¶æ— å…³çš„历å²"
+
+#: builtin/merge-tree.c
+msgid "failure to merge"
+msgstr "åˆå¹¶å¤±è´¥"
+
+#: builtin/merge-tree.c
+msgid "git merge-tree [--write-tree] [<options>] <branch1> <branch2>"
+msgstr "git merge-tree [--write-tree] [<选项>] <分支1> <分支2>"
+
+#: builtin/merge-tree.c
+msgid "git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"
+msgstr "git merge-tree [--trivial-merge] <基准树> <分支1> <分支2>"
+
+#: builtin/merge-tree.c
+msgid "do a real merge instead of a trivial merge"
+msgstr "进行真正的åˆå¹¶è€Œä¸æ˜¯ç®€å•çš„åˆå¹¶"
+
+#: builtin/merge-tree.c
+msgid "do a trivial merge only"
+msgstr "åªè¿›è¡Œç®€å•çš„åˆå¹¶"
+
+#: builtin/merge-tree.c
+msgid "also show informational/conflict messages"
+msgstr "åŒæ—¶æ˜¾ç¤ºé¢å¤–ä¿¡æ¯/冲çªæ¶ˆæ¯"
+
+#: builtin/merge-tree.c
+msgid "list filenames without modes/oids/stages"
+msgstr "列出没有模å¼/对象 ID/暂存的文件å"
+
+#: builtin/merge-tree.c builtin/merge.c builtin/pull.c
+msgid "allow merging unrelated histories"
+msgstr "å…许åˆå¹¶ä¸ç›¸å…³çš„历å²"
+
+#: builtin/merge-tree.c
+msgid "perform multiple merges, one per line of input"
+msgstr "实施多个åˆå¹¶ï¼Œæ¯è¾“入行一个"
+
+#: builtin/merge-tree.c
+msgid "specify a merge-base for the merge"
+msgstr "指定用于åˆå¹¶çš„åˆå¹¶åŸºçº¿"
+
+#: builtin/merge-tree.c builtin/merge.c builtin/pull.c
+msgid "option=value"
+msgstr "option=value"
+
+#: builtin/merge-tree.c builtin/merge.c builtin/pull.c
+msgid "option for selected merge strategy"
+msgstr "所选的åˆå¹¶ç­–略的选项"
+
+#: builtin/merge-tree.c
+msgid "--trivial-merge is incompatible with all other options"
+msgstr "--trivial-merge 与其他所有选项ä¸å…¼å®¹"
+
+#: builtin/merge-tree.c builtin/merge.c
+#, c-format
+msgid "unknown strategy option: -X%s"
+msgstr "未知的策略选项:-X%s"
+
+#: builtin/merge-tree.c builtin/notes.c
+#, c-format
+msgid "malformed input line: '%s'."
+msgstr "æ ¼å¼é”™è¯¯çš„输入行:'%s'。"
+
+#: builtin/merge-tree.c
+#, c-format
+msgid "merging cannot continue; got unclean result of %d"
+msgstr "åˆå¹¶æ— æ³•ç»§ç»­ï¼›å¾—到ä¸å¹²å‡€çš„结果 %d"
+
#: builtin/merge.c
msgid "git merge [<options>] [<commit>...]"
msgstr "git merge [<选项>] [<æ交>...]"
@@ -9951,14 +10260,6 @@ msgstr "ç­–ç•¥"
msgid "merge strategy to use"
msgstr "è¦ä½¿ç”¨çš„åˆå¹¶ç­–ç•¥"
-#: builtin/merge.c builtin/pull.c
-msgid "option=value"
-msgstr "option=value"
-
-#: builtin/merge.c builtin/pull.c
-msgid "option for selected merge strategy"
-msgstr "所选的åˆå¹¶ç­–略的选项"
-
#: builtin/merge.c
msgid "merge commit message (for a non-fast-forward merge)"
msgstr "åˆå¹¶çš„æ交说明(针对éžå¿«è¿›å¼åˆå¹¶ï¼‰"
@@ -9980,10 +10281,6 @@ msgstr "--abort,但是ä¿ç•™ç´¢å¼•å’Œå·¥ä½œåŒº"
msgid "continue the current in-progress merge"
msgstr "继续当å‰æ­£åœ¨è¿›è¡Œçš„åˆå¹¶"
-#: builtin/merge.c builtin/pull.c
-msgid "allow merging unrelated histories"
-msgstr "å…许åˆå¹¶ä¸ç›¸å…³çš„历å²"
-
#: builtin/merge.c
msgid "bypass pre-merge-commit and commit-msg hooks"
msgstr "绕过 pre-merge-commit å’Œ commit-msg é’©å­"
@@ -10033,7 +10330,7 @@ msgstr "'%s' 没有指å‘一个æ交"
msgid "Bad branch.%s.mergeoptions string: %s"
msgstr "åçš„ branch.%s.mergeoptions 字符串:%s"
-#: builtin/merge.c builtin/stash.c merge-recursive.c
+#: builtin/merge.c merge-recursive.c
msgid "Unable to write index."
msgstr "ä¸èƒ½å†™å…¥ç´¢å¼•ã€‚"
@@ -10043,11 +10340,6 @@ msgstr "未处ç†ä¸¤ä¸ªå¤´åˆå¹¶ä¹‹å¤–的任何æ“作。"
#: builtin/merge.c
#, c-format
-msgid "unknown strategy option: -X%s"
-msgstr "未知的策略选项:-X%s"
-
-#: builtin/merge.c t/helper/test-fast-rebase.c
-#, c-format
msgid "unable to write %s"
msgstr "ä¸èƒ½å†™ %s"
@@ -10118,7 +10410,7 @@ msgstr "对于 %s 没有æ¥è‡ª %s 的远程跟踪分支"
msgid "Bad value '%s' in environment '%s'"
msgstr "环境 '%2$s' 中存在åçš„å–值 '%1$s'"
-#: builtin/merge.c read-cache.c strbuf.c wrapper.c
+#: builtin/merge.c editor.c read-cache.c wrapper.c
#, c-format
msgid "could not close '%s'"
msgstr "ä¸èƒ½å…³é—­ '%s'"
@@ -10129,10 +10421,6 @@ msgid "not something we can merge in %s: %s"
msgstr "ä¸èƒ½åœ¨ %s 中åˆå¹¶ï¼š%s"
#: builtin/merge.c
-msgid "not something we can merge"
-msgstr "ä¸èƒ½åˆå¹¶"
-
-#: builtin/merge.c
msgid "--abort expects no arguments"
msgstr "--abort ä¸å¸¦å‚æ•°"
@@ -10194,14 +10482,19 @@ msgid "Can merge only exactly one commit into empty head"
msgstr "åªèƒ½å°†ä¸€ä¸ªæ交åˆå¹¶åˆ°ç©ºåˆ†æ”¯ä¸Š"
#: builtin/merge.c
-msgid "refusing to merge unrelated histories"
-msgstr "æ‹’ç»åˆå¹¶æ— å…³çš„历å²"
-
-#: builtin/merge.c
#, c-format
msgid "Updating %s..%s\n"
msgstr "æ›´æ–° %s..%s\n"
+#: builtin/merge.c merge-ort-wrappers.c merge-recursive.c
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+" %s"
+msgstr ""
+"您对下列文件的本地修改将被åˆå¹¶æ“作覆盖:\n"
+" %s"
+
#: builtin/merge.c
#, c-format
msgid "Trying really trivial in-index merge...\n"
@@ -10242,6 +10535,11 @@ msgstr "使用 %s 策略以准备手工解决。\n"
msgid "Automatic merge went well; stopped before committing as requested\n"
msgstr "自动åˆå¹¶è¿›å±•é¡ºåˆ©ï¼ŒæŒ‰è¦æ±‚在æ交å‰åœæ­¢\n"
+#: builtin/merge.c
+#, c-format
+msgid "When finished, apply stashed changes with `git stash pop`\n"
+msgstr "在完æˆåŽï¼Œä½¿ç”¨ `git stash pop` 应用贮è—çš„å˜æ›´\n"
+
#: builtin/mktag.c
#, c-format
msgid "warning: tag input does not pass fsck: %s"
@@ -10390,12 +10688,16 @@ msgid "bad source"
msgstr "åçš„æº"
#: builtin/mv.c
+msgid "destination exists"
+msgstr "目标已存在"
+
+#: builtin/mv.c
msgid "can not move directory into itself"
msgstr "ä¸èƒ½å°†ç›®å½•ç§»åŠ¨åˆ°è‡ªèº«"
#: builtin/mv.c
-msgid "cannot move directory over file"
-msgstr "ä¸èƒ½å°†ç›®å½•ç§»åŠ¨åˆ°æ–‡ä»¶"
+msgid "destination already exists"
+msgstr "目标已存在"
#: builtin/mv.c
msgid "source directory is empty"
@@ -10410,10 +10712,6 @@ msgid "conflicted"
msgstr "冲çª"
#: builtin/mv.c
-msgid "destination exists"
-msgstr "目标已存在"
-
-#: builtin/mv.c
#, c-format
msgid "overwriting '%s'"
msgstr "覆盖 '%s'"
@@ -10431,6 +10729,10 @@ msgid "destination directory does not exist"
msgstr "目标目录ä¸å­˜åœ¨"
#: builtin/mv.c
+msgid "destination exists in the index"
+msgstr "目标在索引中已存在"
+
+#: builtin/mv.c
#, c-format
msgid "%s, source=%s, destination=%s"
msgstr "%s,æº=%s,目标=%s"
@@ -10440,7 +10742,7 @@ msgstr "%s,æº=%s,目标=%s"
msgid "Renaming %s to %s\n"
msgstr "é‡å‘½å %s 至 %s\n"
-#: builtin/mv.c builtin/remote.c builtin/repack.c
+#: builtin/mv.c builtin/remote.c
#, c-format
msgid "renaming '%s' failed"
msgstr "é‡å‘½å '%s' 失败"
@@ -10499,11 +10801,13 @@ msgstr "git notes [--ref <注解引用>] [list [<对象>]]"
#: builtin/notes.c
msgid ""
-"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [-m <msg> | -F <file> "
-"| (-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref <注解引用>] add [-f] [--allow-empty] [-m <说明> | -F <文件> "
-"| (-c | -C) <对象>] [<对象>]"
+"git notes [--ref <注解引用>] add [-f] [--allow-empty] [--[no-]separator|--"
+"separator=<分段符>] [--[no-]stripspace] [-m <说明> | -F <文件> | (-c | -C) <"
+"对象>] [<对象>]"
#: builtin/notes.c
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
@@ -10511,11 +10815,13 @@ msgstr "git notes [--ref <注解引用>] copy [-f] <æºå¯¹è±¡> <目标对象>"
#: builtin/notes.c
msgid ""
-"git notes [--ref <notes-ref>] append [--allow-empty] [-m <msg> | -F <file> | "
-"(-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref <注解引用>] append [--allow-empty] [-m <说明> | -F <文件> | "
-"(-c | -C) <对象>] [<对象>]"
+"git notes [--ref <注解引用>] append [--allow-empty] [--[no-]separator|--"
+"separator=<分段符>] [--[no-]stripspace] [-m <说明> | -F <文件> | (-c | -C) <"
+"对象>] [<对象>]"
#: builtin/notes.c
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
@@ -10643,11 +10949,6 @@ msgstr "ä¸èƒ½ä»Žéžæ•°æ®å¯¹è±¡ '%s' 中读å–注解数æ®ã€‚"
#: builtin/notes.c
#, c-format
-msgid "malformed input line: '%s'."
-msgstr "æ ¼å¼é”™è¯¯çš„输入行:'%s'。"
-
-#: builtin/notes.c
-#, c-format
msgid "failed to copy notes from '%s' to '%s'"
msgstr "无法把注解从 '%s' æ‹·è´åˆ° '%s'"
@@ -10689,6 +10990,18 @@ msgid "replace existing notes"
msgstr "替æ¢å·²å­˜åœ¨çš„注解"
#: builtin/notes.c
+msgid "<paragraph-break>"
+msgstr "<分段符>"
+
+#: builtin/notes.c
+msgid "insert <paragraph-break> between paragraphs"
+msgstr "在段è½ä¹‹é—´æ’å…¥<分段符>"
+
+#: builtin/notes.c
+msgid "remove unnecessary whitespace"
+msgstr "删除ä¸å¿…è¦çš„空白字符"
+
+#: builtin/notes.c
#, c-format
msgid ""
"Cannot add notes. Found existing notes for object %s. Use '-f' to overwrite "
@@ -10872,20 +11185,19 @@ msgstr "注解引用"
msgid "use notes from <notes-ref>"
msgstr "从 <注解引用> 使用注解"
-#: builtin/notes.c builtin/stash.c
+#: builtin/notes.c builtin/remote.c parse-options.c
#, c-format
-msgid "unknown subcommand: %s"
-msgstr "未知å­å‘½ä»¤ï¼š%s"
+msgid "unknown subcommand: `%s'"
+msgstr "未知å­å‘½ä»¤ï¼š`%s'"
#: builtin/pack-objects.c
-msgid ""
-"git pack-objects --stdout [<options>...] [< <ref-list> | < <object-list>]"
-msgstr "git pack-objects --stdout [<选项>...] [< <引用列表> | < <对象列表>]"
+msgid "git pack-objects --stdout [<options>] [< <ref-list> | < <object-list>]"
+msgstr "git pack-objects --stdout [<选项>] [< <引用列表> | < <对象列表>]"
#: builtin/pack-objects.c
msgid ""
-"git pack-objects [<options>...] <base-name> [< <ref-list> | < <object-list>]"
-msgstr "git pack-objects [<选项>...] <å‰ç¼€å称> [< <引用列表> | < <对象列表>]"
+"git pack-objects [<options>] <base-name> [< <ref-list> | < <object-list>]"
+msgstr "git pack-objects [<选项>] <å‰ç¼€å称> [< <引用列表> | < <对象列表>]"
#: builtin/pack-objects.c
#, c-format
@@ -10947,7 +11259,7 @@ msgstr "无法写入ä½å›¾ç´¢å¼•"
msgid "wrote %<PRIu32> objects while expecting %<PRIu32>"
msgstr "写入 %<PRIu32> 个对象而预期 %<PRIu32> 个"
-#: builtin/pack-objects.c
+#: builtin/pack-objects.c builtin/repack.c
msgid "disabling bitmap writing, as some objects are not being packed"
msgstr "ç¦ç”¨ bitmap 写入,因为一些对象将ä¸ä¼šè¢«æ‰“包"
@@ -11014,6 +11326,11 @@ msgstr "ä¸ä¸€è‡´çš„差异计数"
#: builtin/pack-objects.c
#, c-format
+msgid "invalid pack.allowPackReuse value: '%s'"
+msgstr "无效的 pack.allowPackReuse 值:'%s'"
+
+#: builtin/pack-objects.c
+#, c-format
msgid ""
"value of uploadpack.blobpackfileuri must be of the form '<object-hash> <pack-"
"hash> <uri>' (got '%s')"
@@ -11114,6 +11431,14 @@ msgid "bad index version '%s'"
msgstr "å的索引版本 '%s'"
#: builtin/pack-objects.c
+msgid "show progress meter during object writing phase"
+msgstr "在对象写入阶段显示进度表"
+
+#: builtin/pack-objects.c
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "当进度表显示时类似于 --all-progress"
+
+#: builtin/pack-objects.c
msgid "<version>[,<offset>]"
msgstr "<版本>[,<å移>]"
@@ -11305,10 +11630,6 @@ msgid "--thin cannot be used to build an indexable pack"
msgstr "--thin ä¸èƒ½ç”¨äºŽåˆ›å»ºä¸€ä¸ªå¯ç´¢å¼•åŒ…"
#: builtin/pack-objects.c
-msgid "cannot use --filter without --stdout"
-msgstr "ä¸èƒ½åœ¨æ²¡æœ‰ --stdout 的情况下使用 --filter"
-
-#: builtin/pack-objects.c
msgid "cannot use --filter with --stdin-packs"
msgstr "ä¸èƒ½åŒæ—¶ä½¿ç”¨ --filter å’Œ --stdin-packs"
@@ -11325,10 +11646,6 @@ msgid "cannot use --stdin-packs with --cruft"
msgstr "ä¸èƒ½å°† --stdin-packs å’Œ --cruft åŒæ—¶ä½¿ç”¨"
#: builtin/pack-objects.c
-msgid "cannot use --max-pack-size with --cruft"
-msgstr "ä¸èƒ½å°† --max-pack-size å’Œ --cruft åŒæ—¶ä½¿ç”¨"
-
-#: builtin/pack-objects.c
msgid "Enumerating objects"
msgstr "枚举对象中"
@@ -11336,10 +11653,10 @@ msgstr "枚举对象中"
#, c-format
msgid ""
"Total %<PRIu32> (delta %<PRIu32>), reused %<PRIu32> (delta %<PRIu32>), pack-"
-"reused %<PRIu32>"
+"reused %<PRIu32> (from %<PRIuMAX>)"
msgstr ""
"总共 %<PRIu32>(差异 %<PRIu32>),å¤ç”¨ %<PRIu32>(差异 %<PRIu32>),包å¤ç”¨ "
-"%<PRIu32>"
+"%<PRIu32>(æ¥è‡ª %<PRIuMAX> 个包)"
#: builtin/pack-redundant.c
msgid ""
@@ -11354,9 +11671,16 @@ msgstr ""
"并通过å‘é€é‚®ä»¶åˆ° <git@vger.kernel.org> 让我们知é“您ä»æ—§\n"
"使用它。 谢谢。\n"
+#: builtin/pack-redundant.c
+msgid "refusing to run without --i-still-use-this"
+msgstr "æ‹’ç»åœ¨æœªæŒ‡å®š --i-still-use-this 选项时è¿è¡Œ"
+
#: builtin/pack-refs.c
-msgid "git pack-refs [<options>]"
-msgstr "git pack-refs [<选项>]"
+msgid ""
+"git pack-refs [--all] [--no-prune] [--include <pattern>] [--exclude "
+"<pattern>]"
+msgstr ""
+"git pack-refs [--all] [--no-prune] [--include <模å¼>] [--exclude <模å¼>]"
#: builtin/pack-refs.c
msgid "pack everything"
@@ -11366,6 +11690,30 @@ msgstr "打包一切"
msgid "prune loose refs (default)"
msgstr "清除æ¾æ•£çš„引用(默认)"
+#: builtin/pack-refs.c
+msgid "references to include"
+msgstr "需包å«çš„引用"
+
+#: builtin/pack-refs.c
+msgid "references to exclude"
+msgstr "需排除的引用"
+
+#: builtin/patch-id.c
+msgid "git patch-id [--stable | --unstable | --verbatim]"
+msgstr "git patch-id [--stable | --unstable | --verbatim]"
+
+#: builtin/patch-id.c
+msgid "use the unstable patch-id algorithm"
+msgstr "使用ä¸ç¨³å®šçš„ patch-id 算法"
+
+#: builtin/patch-id.c
+msgid "use the stable patch-id algorithm"
+msgstr "使用稳定的 patch-id 算法"
+
+#: builtin/patch-id.c
+msgid "don't strip whitespace from the patch"
+msgstr "ä¸è¦ä»Žè¡¥ä¸ä¸­åˆ é™¤ç©ºç™½å­—符"
+
#: builtin/prune.c
msgid "git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"
msgstr "git prune [-n] [-v] [--progress] [--expire <时间>] [--] [<head>...]"
@@ -11426,6 +11774,14 @@ msgstr "强制覆盖本地分支"
msgid "number of submodules pulled in parallel"
msgstr "并å‘拉å–çš„å­æ¨¡ç»„çš„æ•°é‡"
+#: builtin/pull.c parse-options.h
+msgid "use IPv4 addresses only"
+msgstr "åªä½¿ç”¨ IPv4 地å€"
+
+#: builtin/pull.c parse-options.h
+msgid "use IPv6 addresses only"
+msgstr "åªä½¿ç”¨ IPv6 地å€"
+
#: builtin/pull.c
msgid ""
"There is no candidate for rebasing against among the refs that you just "
@@ -11473,7 +11829,7 @@ msgstr "è¯¦è§ git-pull(1)。"
msgid "<remote>"
msgstr "<远程>"
-#: builtin/pull.c contrib/scalar/scalar.c
+#: builtin/pull.c scalar.c
msgid "<branch>"
msgstr "<分支>"
@@ -11539,9 +11895,9 @@ msgstr "更新尚未诞生的分支,å˜æ›´æ·»åŠ è‡³ç´¢å¼•ã€‚"
msgid "pull with rebase"
msgstr "å˜åŸºå¼æ‹‰å–"
-#: builtin/pull.c
-msgid "please commit or stash them."
-msgstr "请æ交或贮è—它们。"
+#: builtin/pull.c builtin/rebase.c
+msgid "Please commit or stash them."
+msgstr "请æ交或贮è—修改。"
#: builtin/pull.c
#, c-format
@@ -11613,9 +11969,8 @@ msgstr ""
#: builtin/push.c
msgid ""
"\n"
-"To avoid automatically configuring upstream branches when their name\n"
-"doesn't match the local branch, see option 'simple' of branch."
-"autoSetupMerge\n"
+"To avoid automatically configuring an upstream branch when its name\n"
+"won't match the local branch, see option 'simple' of branch.autoSetupMerge\n"
"in 'git help config'.\n"
msgstr ""
"\n"
@@ -11708,36 +12063,36 @@ msgstr ""
#: builtin/push.c
msgid ""
"Updates were rejected because the tip of your current branch is behind\n"
-"its remote counterpart. Integrate the remote changes (e.g.\n"
-"'git pull ...') before pushing again.\n"
+"its remote counterpart. If you want to integrate the remote changes,\n"
+"use 'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"更新被拒ç»ï¼Œå› ä¸ºæ‚¨å½“å‰åˆ†æ”¯çš„最新æ交è½åŽäºŽå…¶å¯¹åº”的远程分支。\n"
-"å†æ¬¡æŽ¨é€å‰ï¼Œå…ˆä¸Žè¿œç¨‹å˜æ›´åˆå¹¶ï¼ˆå¦‚ 'git pull ...')。详è§\n"
-"'git push --help' 中的 'Note about fast-forwards' å°èŠ‚。"
+"如果您希望先与远程å˜æ›´åˆå¹¶ï¼Œè¯·åœ¨æŽ¨é€å‰æ‰§è¡Œ 'git pull'。\n"
+"è¯¦è§ 'git push --help' 中的 'Note about fast-forwards' å°èŠ‚。"
#: builtin/push.c
msgid ""
"Updates were rejected because a pushed branch tip is behind its remote\n"
-"counterpart. Check out this branch and integrate the remote changes\n"
-"(e.g. 'git pull ...') before pushing again.\n"
+"counterpart. If you want to integrate the remote changes, use 'git pull'\n"
+"before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"更新被拒ç»ï¼Œå› ä¸ºæŽ¨é€çš„一个分支的最新æ交è½åŽäºŽå…¶å¯¹åº”的远程分支。\n"
-"检出该分支并整åˆè¿œç¨‹å˜æ›´ï¼ˆå¦‚ 'git pull ...'),然åŽå†æŽ¨é€ã€‚详è§\n"
-"'git push --help' 中的 'Note about fast-forwards' å°èŠ‚。"
+"如果您希望先与远程å˜æ›´åˆå¹¶ï¼Œè¯·åœ¨æŽ¨é€å‰æ‰§è¡Œ 'git pull'。\n"
+"è¯¦è§ 'git push --help' 中的 'Note about fast-forwards' å°èŠ‚。"
#: builtin/push.c
msgid ""
-"Updates were rejected because the remote contains work that you do\n"
-"not have locally. This is usually caused by another repository pushing\n"
-"to the same ref. You may want to first integrate the remote changes\n"
-"(e.g., 'git pull ...') before pushing again.\n"
+"Updates were rejected because the remote contains work that you do not\n"
+"have locally. This is usually caused by another repository pushing to\n"
+"the same ref. If you want to integrate the remote changes, use\n"
+"'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"更新被拒ç»ï¼Œå› ä¸ºè¿œç¨‹ä»“库包å«æ‚¨æœ¬åœ°å°šä¸å­˜åœ¨çš„æ交。这通常是因为å¦å¤–\n"
-"一个仓库已å‘该引用进行了推é€ã€‚å†æ¬¡æŽ¨é€å‰ï¼Œæ‚¨å¯èƒ½éœ€è¦å…ˆæ•´åˆè¿œç¨‹å˜æ›´\n"
-"(如 'git pull ...')。\n"
+"一个仓库已å‘该引用进行了推é€ã€‚如果您希望先与远程å˜æ›´åˆå¹¶ï¼Œè¯·åœ¨æŽ¨é€\n"
+"å‰æ‰§è¡Œ 'git pull'。\n"
"è¯¦è§ 'git push --help' 中的 'Note about fast-forwards' å°èŠ‚。"
#: builtin/push.c
@@ -11755,13 +12110,14 @@ msgstr ""
#: builtin/push.c
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"
+"Updates were rejected because the tip of the remote-tracking branch has\n"
+"been updated since the last checkout. If you want to integrate the\n"
+"remote changes, use 'git pull' before pushing again.\n"
+"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"更新被拒ç»ï¼Œå› ä¸ºè¿œç¨‹è·Ÿè¸ªåˆ†æ”¯çš„最新æ交自从上次检出之åŽå·²è¢«æ›´æ–°ã€‚\n"
-"在强制更新å‰ï¼Œæ‚¨å¯èƒ½æƒ³å°†è¿™äº›å˜æ›´æ•´åˆåˆ°æœ¬åœ°ï¼ˆå¦‚ 'git pull ...')。\n"
+"如果您希望先与远程å˜æ›´åˆå¹¶ï¼Œè¯·åœ¨æŽ¨é€å‰æ‰§è¡Œ 'git pull'。\n"
+"è¯¦è§ 'git push --help' 中的 'Note about fast-forwards' å°èŠ‚。"
#: builtin/push.c
#, c-format
@@ -11773,6 +12129,13 @@ msgstr "推é€åˆ° %s\n"
msgid "failed to push some refs to '%s'"
msgstr "无法推é€ä¸€äº›å¼•ç”¨åˆ° '%s'"
+#: builtin/push.c
+msgid ""
+"recursing into submodule with push.recurseSubmodules=only; using on-demand "
+"instead"
+msgstr ""
+"在 push.recurseSubmodules=only 时递归进入å­æ¨¡ç»„ï¼›å–而代之使用 on-demand"
+
#: builtin/push.c builtin/send-pack.c submodule-config.c
#, c-format
msgid "invalid value for '%s'"
@@ -11782,9 +12145,9 @@ msgstr "'%s' 的值无效"
msgid "repository"
msgstr "仓库"
-#: builtin/push.c builtin/send-pack.c
-msgid "push all refs"
-msgstr "推é€æ‰€æœ‰å¼•ç”¨"
+#: builtin/push.c
+msgid "push all branches"
+msgstr "推é€æ‰€æœ‰åˆ†æ”¯"
#: builtin/push.c builtin/send-pack.c
msgid "mirror all refs"
@@ -11795,8 +12158,8 @@ msgid "delete refs"
msgstr "删除引用"
#: builtin/push.c
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "推é€æ ‡ç­¾ï¼ˆä¸èƒ½ä½¿ç”¨ --all or --mirror)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr "推é€æ ‡ç­¾ï¼ˆä¸èƒ½ä½¿ç”¨ --all or --branches or --mirror)"
#: builtin/push.c builtin/send-pack.c
msgid "force updates"
@@ -11854,7 +12217,7 @@ msgstr "需è¦è¿œç«¯æ”¯æŒåŽŸå­äº‹åŠ¡"
msgid "--delete doesn't make sense without any refs"
msgstr "--delete 未接任何引用没有æ„义"
-#: builtin/push.c
+#: builtin/push.c t/helper/test-bundle-uri.c
#, c-format
msgid "bad repository '%s'"
msgstr "å的仓库 '%s'"
@@ -11926,12 +12289,18 @@ msgstr "仅显示与第二个范围有关的输出"
#: builtin/range-diff.c
#, c-format
+msgid "not a revision: '%s'"
+msgstr "ä¸æ˜¯ç‰ˆæœ¬ï¼š'%s'"
+
+#: builtin/range-diff.c
+#, c-format
msgid "not a commit range: '%s'"
-msgstr "ä¸æ˜¯ä¸€ä¸ªæ交范围:'%s'"
+msgstr "ä¸æ˜¯æ交范围:'%s'"
#: builtin/range-diff.c
-msgid "single arg format must be symmetric range"
-msgstr "å•ä¸ªå‚æ•°æ ¼å¼å¿…须是对称范围(å³åŒ…å«...)"
+#, c-format
+msgid "not a symmetric range: '%s'"
+msgstr "ä¸æ˜¯å¯¹ç§°çš„范围:'%s'"
#: builtin/range-diff.c
msgid "need two commit ranges"
@@ -11939,13 +12308,14 @@ msgstr "需è¦ä¸¤ä¸ªæ交范围"
#: builtin/read-tree.c
msgid ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>) "
-"[-u | -i]] [--no-sparse-checkout] [--index-output=<file>] (--empty | <tree-"
-"ish1> [<tree-ish2> [<tree-ish3>]])"
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<prefix>)\n"
+" [-u | -i]] [--index-output=<file>] [--no-sparse-checkout]\n"
+" (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"
msgstr ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<å‰ç¼€>) [-"
-"u | -i]] [--no-sparse-checkout] [--index-output=<文件>] (--empty | <树对象一"
-"> [<树对象二> [<树对象三>]])"
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<å‰ç¼€>)\n"
+" [-u | -i]] [--index-output=<文件>] [--no-sparse-checkout]\n"
+" (--empty | <树对象一> [<树对象二> [<树对象三>]])"
#: builtin/read-tree.c
msgid "write resulting index to <file>"
@@ -12062,8 +12432,8 @@ msgstr "%s 需è¦åˆå¹¶åŽç«¯"
#: builtin/rebase.c
#, c-format
-msgid "could not get 'onto': '%s'"
-msgstr "æ— æ³•èŽ·å– 'onto':'%s'"
+msgid "invalid onto: '%s'"
+msgstr "无效新基线:'%s'"
#: builtin/rebase.c
#, c-format
@@ -12113,10 +12483,19 @@ msgstr ""
#: builtin/rebase.c
#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "未知的å˜åŸºåˆå¹¶æ¨¡å¼ï¼š%s"
+
+#: builtin/rebase.c
+#, c-format
msgid "could not switch to %s"
msgstr "无法切æ¢åˆ° %s"
#: builtin/rebase.c
+msgid "apply options and merge options cannot be used together"
+msgstr "应用选项和åˆå¹¶é€‰é¡¹ä¸èƒ½åŒæ—¶ä½¿ç”¨"
+
+#: builtin/rebase.c
#, c-format
msgid ""
"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and "
@@ -12124,6 +12503,16 @@ msgid ""
msgstr "无法识别的空类型 '%s';有效值有 \"drop\"ã€\"keep\" å’Œ \"ask\"。"
#: builtin/rebase.c
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"为 --rebase-merges 指定空值å‚æ•°çš„æ–¹å¼å·²ç»è¢«åºŸå¼ƒå¹¶ä¸”在 Git 未æ¥\n"
+"的版本中将ä¸å†æ”¯æŒã€‚ 支æŒä½¿ç”¨æ— å‚æ•° --rebase-merges çš„æ–¹å¼è¿›è¡Œæ›¿\n"
+"代,它们具有相åŒçš„作用。"
+
+#: builtin/rebase.c
#, c-format
msgid ""
"%s\n"
@@ -12266,6 +12655,10 @@ msgid "move commits that begin with squash!/fixup! under -i"
msgstr "在 -i 交互模å¼ä¸‹ï¼Œç§»åŠ¨ä»¥ squash!/fixup! 开头的æ交"
#: builtin/rebase.c
+msgid "update branches that point to commits that are being rebased"
+msgstr "更新指å‘正在被å˜åŸºçš„æ交的分支"
+
+#: builtin/rebase.c
msgid "add exec lines after each commit of the editable list"
msgstr "å¯ç¼–辑列表的æ¯ä¸€ä¸ªæ交下é¢å¢žåŠ ä¸€è¡Œ exec"
@@ -12337,7 +12730,7 @@ msgstr "没有正在进行的å˜åŸºï¼Ÿ"
msgid "The --edit-todo action can only be used during interactive rebase."
msgstr "动作 --edit-todo åªèƒ½ç”¨åœ¨äº¤äº’å¼å˜åŸºè¿‡ç¨‹ä¸­ã€‚"
-#: builtin/rebase.c t/helper/test-fast-rebase.c
+#: builtin/rebase.c
msgid "Cannot read HEAD"
msgstr "ä¸èƒ½è¯»å– HEAD"
@@ -12382,17 +12775,16 @@ msgid "switch `C' expects a numerical value"
msgstr "开关 `C' 期望一个数字值"
#: builtin/rebase.c
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "未知模å¼ï¼š%s"
-
-#: builtin/rebase.c
-msgid "--strategy requires --merge or --interactive"
-msgstr "--strategy éœ€è¦ --merge 或 --interactive"
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges. Consider adding --"
+"no-rebase-merges"
+msgstr "应用的选项与 rebase.rebaseMerges ä¸å…¼å®¹ã€‚考虑加上 --no-rebase-merges"
#: builtin/rebase.c
-msgid "apply options and merge options cannot be used together"
-msgstr "应用选项和åˆå¹¶é€‰é¡¹ä¸èƒ½åŒæ—¶ä½¿ç”¨"
+msgid ""
+"apply options are incompatible with rebase.updateRefs. Consider adding --no-"
+"update-refs"
+msgstr "应用的选项与 rebase.updateRefs ä¸å…¼å®¹ã€‚考虑加上 --no-update-refs"
#: builtin/rebase.c
#, c-format
@@ -12423,8 +12815,8 @@ msgid "No such ref: %s"
msgstr "没有这样的引用:%s"
#: builtin/rebase.c
-msgid "Could not resolve HEAD to a revision"
-msgstr "无法将 HEAD 解æžä¸ºä¸€ä¸ªç‰ˆæœ¬"
+msgid "Could not resolve HEAD to a commit"
+msgstr "ä¸èƒ½è§£æž HEAD 至一个æ交"
#: builtin/rebase.c
#, c-format
@@ -12442,10 +12834,6 @@ msgid "Does not point to a valid commit '%s'"
msgstr "没有指å‘一个有效的æ交 '%s'"
#: builtin/rebase.c
-msgid "Please commit or stash them."
-msgstr "请æ交或贮è—修改。"
-
-#: builtin/rebase.c
msgid "HEAD is up to date."
msgstr "HEAD 是最新的。"
@@ -12748,12 +13136,10 @@ msgid "fetch the remote branches"
msgstr "抓å–远程的分支"
#: builtin/remote.c
-msgid "import all tags and associated objects when fetching"
-msgstr "抓å–时导入所有的标签和关è”对象"
-
-#: builtin/remote.c
-msgid "or do not fetch any tag at all (--no-tags)"
-msgstr "或ä¸æŠ“å–任何标签(--no-tags)"
+msgid ""
+"import all tags and associated objects when fetching\n"
+"or do not fetch any tag at all (--no-tags)"
+msgstr "抓å–时导入所有的标签和关è”对象,或ä¸æŠ“å–任何标签(--no-tags)"
#: builtin/remote.c
msgid "branch(es) to track"
@@ -12871,8 +13257,8 @@ msgid ""
msgid_plural ""
"Note: Some branches outside the refs/remotes/ hierarchy were not removed;\n"
"to delete them, use:"
-msgstr[0] "注æ„:ref/remotes 层级之外的一个分支未被移除。è¦åˆ é™¤å®ƒï¼Œä½¿ç”¨ï¼š"
-msgstr[1] "注æ„:ref/remotes 层级之外的一些分支未被移除。è¦åˆ é™¤å®ƒä»¬ï¼Œä½¿ç”¨ï¼š"
+msgstr[0] "注æ„:refs/remotes/ 层级之外的一个分支未被移除。è¦åˆ é™¤å®ƒï¼Œä½¿ç”¨ï¼š"
+msgstr[1] "注æ„:refs/remotes/ 层级之外的一些分支未被移除。è¦åˆ é™¤å®ƒä»¬ï¼Œä½¿ç”¨ï¼š"
#: builtin/remote.c
#, c-format
@@ -12889,8 +13275,12 @@ msgid " tracked"
msgstr " 已跟踪"
#: builtin/remote.c
+msgid " skipped"
+msgstr " 已跳过"
+
+#: builtin/remote.c
msgid " stale (use 'git remote prune' to remove)"
-msgstr " 过时(使用 'git remote prune' æ¥ç§»é™¤ï¼‰"
+msgstr " 已过期(使用 'git remote prune' æ¥ç§»é™¤ï¼‰"
#: builtin/remote.c
msgid " ???"
@@ -13222,6 +13612,16 @@ msgid "could not close refs snapshot tempfile"
msgstr "ä¸èƒ½å…³é—­å¼•ç”¨å¿«ç…§ä¸´æ—¶æ–‡ä»¶"
#: builtin/repack.c
+#, c-format
+msgid "could not remove stale bitmap: %s"
+msgstr "无法删除过期的ä½å›¾ï¼š %s"
+
+#: builtin/repack.c
+#, c-format
+msgid "pack prefix %s does not begin with objdir %s"
+msgstr "包å‰ç¼€ %s 没有以对象目录 %s 开始"
+
+#: builtin/repack.c
msgid "pack everything in a single pack"
msgstr "所有内容打包到一个包文件中"
@@ -13238,8 +13638,8 @@ msgid "approxidate"
msgstr "近似日期"
#: builtin/repack.c
-msgid "with -C, expire objects older than this"
-msgstr "使用 -C,使早于给定时间的对象过期"
+msgid "with --cruft, expire objects older than this"
+msgstr "使用 --cruft,使早于给定时间的对象过期"
#: builtin/repack.c
msgid "remove redundant packs, and run git-prune-packed"
@@ -13318,24 +13718,37 @@ msgid "write a multi-pack index of the resulting packs"
msgstr "写入结果包的多包索引"
#: builtin/repack.c
+msgid "pack prefix to store a pack containing pruned objects"
+msgstr "储存被清除的对象的包的å‰ç¼€"
+
+#: builtin/repack.c
+msgid "pack prefix to store a pack containing filtered out objects"
+msgstr "储存被过滤的对象的包的å‰ç¼€"
+
+#: builtin/repack.c
msgid "cannot delete packs in a precious-objects repo"
msgstr "ä¸èƒ½åˆ é™¤çå“仓库中的打包文件"
#: builtin/repack.c
+#, c-format
+msgid "option '%s' can only be used along with '%s'"
+msgstr "选项 '%s' åªèƒ½å’Œ '%s' æ­é…使用"
+
+#: builtin/repack.c
msgid "Nothing new to pack."
msgstr "没有新的è¦æ‰“包。"
#: builtin/repack.c
#, c-format
-msgid "pack prefix %s does not begin with objdir %s"
-msgstr "包å‰ç¼€ %s 没有以对象目录 .%s 开始"
+msgid "renaming pack to '%s' failed"
+msgstr "é‡å‘½å包至 '%s' 失败"
#: builtin/repack.c
#, c-format
-msgid "missing required file: %s"
-msgstr "缺少需è¦çš„文件:%s"
+msgid "pack-objects did not write a '%s' file for pack %s-%s"
+msgstr "pack-objects 未为包 %2$s-%3$s 写入 '%1$s' 文件"
-#: builtin/repack.c
+#: builtin/repack.c sequencer.c
#, c-format
msgid "could not unlink: %s"
msgstr "ä¸èƒ½åˆ é™¤ï¼š%s"
@@ -13576,9 +13989,89 @@ msgstr "--convert-graft-file ä¸å¸¦å‚æ•°"
msgid "only one pattern can be given with -l"
msgstr "åªèƒ½ä¸º -l æ供一个模å¼"
+#: builtin/replay.c
+msgid "need some commits to replay"
+msgstr "需è¦ä¸€äº›æ交æ¥é‡æ”¾"
+
+#: builtin/replay.c
+msgid "--onto and --advance are incompatible"
+msgstr "--onto å’Œ --advance ä¸å…¼å®¹"
+
+#: builtin/replay.c
+msgid "all positive revisions given must be references"
+msgstr "æ供的所有正å‘版本必须为引用"
+
+#: builtin/replay.c
+msgid "argument to --advance must be a reference"
+msgstr "--advance çš„å‚数必须是引用"
+
+#: builtin/replay.c
+msgid ""
+"cannot advance target with multiple sources because ordering would be ill-"
+"defined"
+msgstr "ä¸èƒ½ä½¿ç”¨å¤šä¸ªæºæŽ¨è¿›ç›®æ ‡ï¼Œå› ä¸ºæ— æ³•æ˜Žç¡®å¦‚何排åº"
+
+#: builtin/replay.c
+msgid ""
+"cannot implicitly determine whether this is an --advance or --onto operation"
+msgstr "ä¸èƒ½éšå¼åœ°ç¡®å®šè¿™æ˜¯ --advance 还是 --onto çš„æ“作"
+
+#: builtin/replay.c
+msgid ""
+"cannot advance target with multiple source branches because ordering would "
+"be ill-defined"
+msgstr "ä¸èƒ½ä½¿ç”¨å¤šä¸ªæºåˆ†æ”¯æŽ¨è¿›ç›®æ ‡ï¼Œå› ä¸ºæ— æ³•æ˜Žç¡®å¦‚何排åº"
+
+#: builtin/replay.c
+msgid "cannot implicitly determine correct base for --onto"
+msgstr "ä¸èƒ½éšå¼åœ°ç¡®å®š --onto 正确的基线"
+
+#: builtin/replay.c
+msgid ""
+"(EXPERIMENTAL!) git replay ([--contained] --onto <newbase> | --advance "
+"<branch>) <revision-range>..."
+msgstr "(试验中ï¼ï¼‰git replay ([--contained] --onto <新基线> | --advance <分支>) <版本范围>..."
+
+#: builtin/replay.c
+msgid "make replay advance given branch"
+msgstr "é‡æ”¾æ—¶æ¼”进给定的分支"
+
+#: builtin/replay.c
+msgid "replay onto given commit"
+msgstr "é‡æ”¾åˆ°ç»™å®šæ交"
+
+#: builtin/replay.c
+msgid "advance all branches contained in revision-range"
+msgstr "演进版本范围中包å«çš„所有分支"
+
+#: builtin/replay.c
+msgid "option --onto or --advance is mandatory"
+msgstr "选项 --onto 或 --advance 必须指定其一"
+
+#: builtin/replay.c
+#, c-format
+msgid ""
+"some rev walking options will be overridden as '%s' bit in 'struct rev_info' "
+"will be forced"
+msgstr "一些版本é历选项将被覆盖,如 'struct rev_info' 中的 '%s' ä½å°†è¢«å¼ºåˆ¶è®¾å®š"
+
+#: builtin/replay.c
+msgid "error preparing revisions"
+msgstr "准备版本时错误"
+
+#: builtin/replay.c
+msgid "replaying down to root commit is not supported yet!"
+msgstr "ç›®å‰è¿˜ä¸æ”¯æŒé‡æ”¾åˆ°æ ¹æ交ï¼"
+
+#: builtin/replay.c
+msgid "replaying merge commits is not supported yet!"
+msgstr "ç›®å‰è¿˜ä¸æ”¯æŒé‡æ”¾åˆ°åˆå¹¶æ交ï¼"
+
#: builtin/rerere.c
-msgid "git rerere [clear | forget <path>... | status | remaining | diff | gc]"
-msgstr "git rerere [clear | forget <路径>... | status | remaining | diff | gc]"
+msgid ""
+"git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]"
+msgstr ""
+"git rerere [clear | forget <路径规格>... | diff | status | remaining | gc]"
#: builtin/rerere.c
msgid "register clean resolutions in index"
@@ -13729,12 +14222,17 @@ msgstr "ä¸èƒ½é‡ç½®ç´¢å¼•æ–‡ä»¶è‡³ç‰ˆæœ¬ '%s'。"
msgid "Could not write new index file."
msgstr "ä¸èƒ½å†™å…¥æ–°çš„索引文件。"
-#: builtin/rev-list.c pack-bitmap.c
+#: builtin/rev-list.c
#, c-format
msgid "unable to get disk usage of %s"
msgstr "无法得到 %s çš„ç£ç›˜ä½¿ç”¨é‡"
#: builtin/rev-list.c
+#, c-format
+msgid "invalid value for '%s': '%s', the only allowed format is '%s'"
+msgstr "'%s' 的值无效:'%s',唯一å…许的格å¼æ˜¯ '%s'"
+
+#: builtin/rev-list.c
msgid "rev-list does not support display of notes"
msgstr "rev-list ä¸æ”¯æŒæ˜¾ç¤ºæ³¨è§£"
@@ -13768,6 +14266,10 @@ msgid "no usage string given before the `--' separator"
msgstr "在 `--' 分隔符之å‰æ²¡æœ‰ç»™å‡ºä½¿ç”¨æ–¹æ³•å­—符串"
#: builtin/rev-parse.c
+msgid "missing opt-spec before option flags"
+msgstr "选项å‚数之å‰ç¼ºå°‘选项规格"
+
+#: builtin/rev-parse.c
msgid "Needed a single revision"
msgstr "需è¦ä¸€ä¸ªå•ç‹¬çš„版本"
@@ -13829,25 +14331,36 @@ msgid "this operation must be run in a work tree"
msgstr "该æ“作必须在一个工作区中è¿è¡Œ"
#: builtin/rev-parse.c
+msgid "Could not read the index"
+msgstr "ä¸èƒ½è¯»å–索引"
+
+#: builtin/rev-parse.c
#, c-format
msgid "unknown mode for --show-object-format: %s"
msgstr "未知的 --show-object-format 模å¼ï¼š%s"
#: builtin/revert.c
-msgid "git revert [<options>] <commit-ish>..."
-msgstr "git revert [<选项>] <æ交å·>..."
+msgid ""
+"git revert [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] "
+"<commit>..."
+msgstr ""
+"git revert [--[no-]edit] [-n] [-m <父编å·>] [-s] [-S[<ç§é’¥ ID>]] <æ交>..."
#: builtin/revert.c
-msgid "git revert <subcommand>"
-msgstr "git revert <å­å‘½ä»¤>"
+msgid "git revert (--continue | --skip | --abort | --quit)"
+msgstr "git revert (--continue | --skip | --abort | --quit)"
#: builtin/revert.c
-msgid "git cherry-pick [<options>] <commit-ish>..."
-msgstr "git cherry-pick [<选项>] <æ交å·>..."
+msgid ""
+"git cherry-pick [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff]\n"
+" [-S[<keyid>]] <commit>..."
+msgstr ""
+"git cherry-pick [--edit] [-n] [-m <父编å·>] [-s] [-x] [--ff]\n"
+" [-S[<ç§é’¥ ID>]] <æ交>..."
#: builtin/revert.c
-msgid "git cherry-pick <subcommand>"
-msgstr "git cherry-pick <å­å‘½ä»¤>"
+msgid "git cherry-pick (--continue | --skip | --abort | --quit)"
+msgstr "git cherry-pick (--continue | --skip | --abort | --quit)"
#: builtin/revert.c
#, c-format
@@ -13928,8 +14441,14 @@ msgid "cherry-pick failed"
msgstr "拣选失败"
#: builtin/rm.c
-msgid "git rm [<options>] [--] <file>..."
-msgstr "git rm [<选项>] [--] <文件>..."
+msgid ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<文件> [--pathspec-file-nul]]\n"
+" [--] [<路径规格>...]"
#: builtin/rm.c
msgid ""
@@ -14012,11 +14531,13 @@ msgid ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
" [<host>:]<directory> (--all | <ref>...)"
msgstr ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
" [<主机>:]<目录> (--all | <引用>...)"
#: builtin/send-pack.c
@@ -14024,6 +14545,10 @@ msgid "remote name"
msgstr "远程å称"
#: builtin/send-pack.c
+msgid "push all refs"
+msgstr "推é€æ‰€æœ‰å¼•ç”¨"
+
+#: builtin/send-pack.c
msgid "use stateless RPC protocol"
msgstr "使用无状æ€çš„ RPC åè®®"
@@ -14048,8 +14573,9 @@ msgid "using multiple --group options with stdin is not supported"
msgstr "ä¸æ”¯æŒå’Œæ ‡å‡†è¾“入一起使用多个 --group 选项"
#: builtin/shortlog.c
-msgid "using --group=trailer with stdin is not supported"
-msgstr "ä¸æ”¯æŒå’Œæ ‡å‡†è¾“入一起使用 --group=trailer"
+#, c-format
+msgid "using %s with stdin is not supported"
+msgstr "ä¸æ”¯æŒå¯¹ %s 使用标准输入"
#: builtin/shortlog.c
#, c-format
@@ -14097,12 +14623,14 @@ msgid ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
" [--current] [--color[=<when>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<rev> | <glob>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<rev> | <glob>)...]"
msgstr ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
" [--current] [--color[=<何时>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<版本> | <通é…符>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<版本> | <通é…符>)...]"
#: builtin/show-branch.c
msgid "git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]"
@@ -14231,17 +14759,41 @@ msgstr "未知的哈希算法"
#: builtin/show-ref.c
msgid ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...]"
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<pattern>...]"
+msgstr ""
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<模å¼>...]"
+
+#: builtin/show-ref.c
+msgid ""
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<ref>...]"
msgstr ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<模å¼>...]"
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<引用>...]"
#: builtin/show-ref.c
msgid "git show-ref --exclude-existing[=<pattern>]"
msgstr "git show-ref --exclude-existing[=<模å¼>]"
#: builtin/show-ref.c
+msgid "git show-ref --exists <ref>"
+msgstr "git show-ref --exists <引用>"
+
+#: builtin/show-ref.c
+msgid "reference does not exist"
+msgstr "引用ä¸å­˜åœ¨"
+
+#: builtin/show-ref.c
+msgid "failed to look up reference"
+msgstr "无法找到引用"
+
+#: builtin/show-ref.c
msgid "only show tags (can be combined with heads)"
msgstr "åªæ˜¾ç¤ºæ ‡ç­¾ï¼ˆå¯ä»¥å’Œå¤´å…±ç”¨ï¼‰"
@@ -14250,6 +14802,10 @@ msgid "only show heads (can be combined with tags)"
msgstr "åªæ˜¾ç¤ºå¤´ï¼ˆå¯ä»¥å’Œæ ‡ç­¾å…±ç”¨ï¼‰"
#: builtin/show-ref.c
+msgid "check for reference existence without resolving"
+msgstr "检查引用是å¦å­˜åœ¨ä½†ä¸è§£æž"
+
+#: builtin/show-ref.c
msgid "stricter reference checking, requires exact ref path"
msgstr "更严格的引用检测,需è¦ç²¾ç¡®çš„引用路径"
@@ -14274,8 +14830,12 @@ msgid "show refs from stdin that aren't in local repository"
msgstr "显示从标准输入中读入的ä¸åœ¨æœ¬åœ°ä»“库中的引用"
#: builtin/sparse-checkout.c
-msgid "git sparse-checkout (init|list|set|add|reapply|disable) <options>"
-msgstr "git sparse-checkout (init|list|set|add|reapply|disable) <选项>"
+msgid ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
+msgstr ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check\n"
+"-rules) [<选项>]"
#: builtin/sparse-checkout.c
msgid "this worktree is not sparse"
@@ -14317,7 +14877,7 @@ msgstr "åˆå§‹åŒ–稀ç–检出为锥形模å¼"
msgid "toggle the use of a sparse index"
msgstr "切æ¢ç¨€ç–索引的使用"
-#: builtin/sparse-checkout.c commit-graph.c midx.c
+#: builtin/sparse-checkout.c commit-graph.c midx.c sequencer.c
#, c-format
msgid "unable to create leading directories of %s"
msgstr "ä¸èƒ½ä¸º %s 创建先导目录"
@@ -14415,79 +14975,86 @@ msgstr "必须在稀ç–检出中é‡åº”用稀ç–模å¼"
msgid "error while refreshing working directory"
msgstr "刷新工作目录时出错"
-#: builtin/stash.c
-msgid "git stash list [<options>]"
-msgstr "git stash list [<选项>]"
+#: builtin/sparse-checkout.c
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <文件>]"
-#: builtin/stash.c
-msgid "git stash show [<options>] [<stash>]"
-msgstr "git stash show [<选项>] [<stash>]"
+#: builtin/sparse-checkout.c
+msgid "terminate input and output files by a NUL character"
+msgstr "输入和输出的文件使用 NUL 字符终结"
-#: builtin/stash.c
-msgid "git stash drop [-q|--quiet] [<stash>]"
-msgstr "git stash drop [-q|--quiet] [<stash>]"
+#: builtin/sparse-checkout.c
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr "通过 --rules-file 选项传递的模型将被作为锥形(稀ç–检出模型)进行解æž"
-#: builtin/stash.c
-msgid "git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"
+#: builtin/sparse-checkout.c
+msgid "use patterns in <file> instead of the current ones."
+msgstr "从 <文件> å‚数中读å–模å¼ï¼Œè€Œä¸æ˜¯ä»Žæ ‡å‡†è¾“å…¥"
#: builtin/stash.c
-msgid "git stash branch <branchname> [<stash>]"
-msgstr "git stash branch <分支å> [<stash>]"
+msgid "git stash list [<log-options>]"
+msgstr "git stash list [<日志选项>]"
#: builtin/stash.c
msgid ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
-" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
-" [--] [<pathspec>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<diff-"
+"options>] [<stash>]"
msgstr ""
-"git stash [push [-p|--patch] [[-S|--staged] -k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <消æ¯>]\n"
-" [--pathspec-from-file=<文件> [--pathspec-file-nul]]\n"
-" [--] [<路径规格>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<差异选项>] [<"
+"贮存>]"
#: builtin/stash.c
-msgid ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
-msgstr ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<消æ¯>]"
+msgid "git stash drop [-q | --quiet] [<stash>]"
+msgstr "git stash drop [-q | --quiet] [<贮存>]"
#: builtin/stash.c
-msgid "git stash pop [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash pop [--index] [-q|--quiet] [<stash>]"
+msgid "git stash pop [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash pop [--index] [-q | --quiet] [<贮存>]"
#: builtin/stash.c
-msgid "git stash apply [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash apply [--index] [-q|--quiet] [<stash>]"
+msgid "git stash apply [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash apply [--index] [-q | --quiet] [<贮存>]"
+
+#: builtin/stash.c
+msgid "git stash branch <branchname> [<stash>]"
+msgstr "git stash branch <分支å> [<stash>]"
#: builtin/stash.c
-msgid "git stash store [-m|--message <message>] [-q|--quiet] <commit>"
-msgstr "git stash store [-m|--message <消æ¯>] [-q|--quiet] <æ交>"
+msgid "git stash store [(-m | --message) <message>] [-q | --quiet] <commit>"
+msgstr "git stash store [(-m | --message) <消æ¯>] [-q | --quiet] <æ交>"
#: builtin/stash.c
msgid ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<message>]\n"
+" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
" [--] [<pathspec>...]]"
msgstr ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <消æ¯>]\n"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message <消æ¯>]\n"
+" [--pathspec-from-file=<文件> [--pathspec-file-nul]]\n"
" [--] [<路径规格>...]]"
#: builtin/stash.c
msgid ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<message>]"
msgstr ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<消æ¯>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<消æ¯>]"
+
+#: builtin/stash.c
+msgid "git stash create [<message>]"
+msgstr "git stash create [<消æ¯>]"
#: builtin/stash.c
#, c-format
@@ -14713,20 +15280,17 @@ msgstr "期望一个完整的引用å称,å´å¾—到 %s"
#: builtin/submodule--helper.c
#, c-format
+msgid "could not get a repository handle for submodule '%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'。å‡å®šè¿™ä¸ªä»“库是其自身的官方上游。"
#: builtin/submodule--helper.c
-msgid "alternative anchor for relative paths"
-msgstr "相对路径的替代锚记(anchor)"
-
-#: builtin/submodule--helper.c
-msgid "git submodule--helper list [--prefix=<path>] [<path>...]"
-msgstr "git submodule--helper list [--prefix=<路径>] [<路径>...]"
-
-#: builtin/submodule--helper.c
#, c-format
msgid "No url found for submodule path '%s' in .gitmodules"
msgstr "在 .gitmodules 中未找到å­æ¨¡ç»„路径 '%s' çš„ url"
@@ -14764,8 +15328,8 @@ msgid "recurse into nested submodules"
msgstr "递归进入嵌套å­æ¨¡ç»„中"
#: builtin/submodule--helper.c
-msgid "git submodule--helper foreach [--quiet] [--recursive] [--] <command>"
-msgstr "git submodule--helper foreach [--quiet] [--recursive] [--] <命令>"
+msgid "git submodule foreach [--quiet] [--recursive] [--] <command>"
+msgstr "git submodule foreach [--quiet] [--recursive] [--] <命令>"
#: builtin/submodule--helper.c
#, c-format
@@ -14792,8 +15356,8 @@ msgid "suppress output for initializing a submodule"
msgstr "抑制å­æ¨¡ç»„åˆå§‹åŒ–的输出"
#: builtin/submodule--helper.c
-msgid "git submodule--helper init [<options>] [<path>]"
-msgstr "git submodule--helper init [<选项>] [<路径>]"
+msgid "git submodule init [<options>] [<path>]"
+msgstr "git submodule init [<选项>] [<路径>]"
#: builtin/submodule--helper.c
#, c-format
@@ -14825,10 +15389,6 @@ msgid "git submodule status [--quiet] [--cached] [--recursive] [<path>...]"
msgstr "git submodule status [--quiet] [--cached] [--recursive] [<路径>...]"
#: builtin/submodule--helper.c
-msgid "git submodule--helper name <path>"
-msgstr "git submodule--helper name <路径>"
-
-#: builtin/submodule--helper.c
#, c-format
msgid "* %s %s(blob)->%s(submodule)"
msgstr "* %s %s(数æ®å¯¹è±¡ï¼‰->%s(å­æ¨¡ç»„)"
@@ -14870,8 +15430,8 @@ msgid "limit the summary size"
msgstr "é™åˆ¶æ€»ç»“的大å°"
#: builtin/submodule--helper.c
-msgid "git submodule--helper summary [<options>] [<commit>] [--] [<path>]"
-msgstr "git submodule--helper summary [<选项>] [<æ交>] [--] [<路径>]"
+msgid "git submodule summary [<options>] [<commit>] [--] [<path>]"
+msgstr "git submodule summary [<选项>] [<æ交>] [--] [<路径>]"
#: builtin/submodule--helper.c
msgid "could not fetch a revision for HEAD"
@@ -14889,11 +15449,6 @@ msgstr "无法为å­æ¨¡ç»„路径 '%s' 注册 url"
#: builtin/submodule--helper.c
#, c-format
-msgid "failed to get the default remote for submodule '%s'"
-msgstr "无法得到å­æ¨¡ç»„ '%s' 的默认远程关è”"
-
-#: builtin/submodule--helper.c
-#, c-format
msgid "failed to update remote for submodule '%s'"
msgstr "无法为å­æ¨¡ç»„ '%s' 更新远程关è”"
@@ -14902,8 +15457,8 @@ msgid "suppress output of synchronizing submodule url"
msgstr "抑制å­æ¨¡ç»„ URL åŒæ­¥çš„输出"
#: builtin/submodule--helper.c
-msgid "git submodule--helper sync [--quiet] [--recursive] [<path>]"
-msgstr "git submodule--helper sync [--quiet] [--recursive] [<路径>]"
+msgid "git submodule sync [--quiet] [--recursive] [<path>]"
+msgstr "git submodule sync [--quiet] [--recursive] [<路径>]"
#: builtin/submodule--helper.c
#, c-format
@@ -14973,6 +15528,11 @@ msgstr ""
#: builtin/submodule--helper.c
#, c-format
+msgid "could not get a repository handle for gitdir '%s'"
+msgstr "无法获得 git 目录 '%s' 的仓库å¥æŸ„"
+
+#: builtin/submodule--helper.c
+#, c-format
msgid "submodule '%s' cannot add alternate: %s"
msgstr "å­æ¨¡ç»„ '%s' ä¸èƒ½æ·»åŠ ä»“库备选:%s"
@@ -15007,6 +15567,10 @@ msgid "could not get submodule directory for '%s'"
msgstr "无法得到 '%s' çš„å­æ¨¡ç»„目录"
#: builtin/submodule--helper.c
+msgid "alternative anchor for relative paths"
+msgstr "相对路径的替代锚记(anchor)"
+
+#: builtin/submodule--helper.c
msgid "where the new submodule will be cloned to"
msgstr "æ–°çš„å­æ¨¡ç»„å°†è¦å…‹éš†çš„路径"
@@ -15042,11 +15606,6 @@ msgstr ""
#: builtin/submodule--helper.c
#, c-format
-msgid "Invalid update mode '%s' for submodule path '%s'"
-msgstr "å­æ¨¡ç»„路径 '%2$s' çš„æ›´æ–°æ¨¡å¼ '%1$s' 无效"
-
-#: builtin/submodule--helper.c
-#, c-format
msgid "Invalid update mode '%s' configured for submodule path '%s'"
msgstr "为å­æ¨¡ç»„路径 '%2$s' é…ç½®çš„æ›´æ–°æ¨¡å¼ '%1$s' 无效"
@@ -15071,6 +15630,11 @@ msgstr "略过å­æ¨¡ç»„ '%s'"
#: builtin/submodule--helper.c
#, c-format
+msgid "cannot clone submodule '%s' without a URL"
+msgstr "无法在ä¸æä¾› URL 时克隆å­æ¨¡ç»„ '%s'"
+
+#: builtin/submodule--helper.c
+#, c-format
msgid "Failed to clone '%s'. Retry scheduled"
msgstr "克隆 '%s' 失败。按计划é‡è¯•"
@@ -15133,6 +15697,11 @@ msgstr "获å–了å­æ¨¡ç»„路径 '%s'ï¼Œä½†æ˜¯å®ƒæ²¡æœ‰åŒ…å« %s。直接获å–è
#: builtin/submodule--helper.c
#, c-format
+msgid "could not initialize submodule at path '%s'"
+msgstr "无法在路径 '%s' åˆå§‹åŒ–å­æ¨¡ç»„"
+
+#: builtin/submodule--helper.c
+#, c-format
msgid ""
"Submodule (%s) branch configured to inherit branch from superproject, but "
"the superproject is not on any branch"
@@ -15140,11 +15709,6 @@ msgstr "å­æ¨¡ç»„(%s)的分支é…置为继承上级项目的分支,但是ä
#: builtin/submodule--helper.c
#, c-format
-msgid "could not get a repository handle for submodule '%s'"
-msgstr "无法获得å­æ¨¡ç»„ '%s' 的仓库å¥æŸ„"
-
-#: builtin/submodule--helper.c
-#, c-format
msgid "Unable to find current revision in submodule path '%s'"
msgstr "无法在å­æ¨¡ç»„路径 '%s' 中找到当å‰ç‰ˆæœ¬"
@@ -15184,16 +15748,16 @@ msgid "don't fetch new objects from the remote site"
msgstr "ä¸è¦ä»Žè¿œç¨‹åœ°å€èŽ·å–新对象"
#: builtin/submodule--helper.c
-msgid "path into the working tree"
-msgstr "到工作区的路径"
+msgid "use the 'checkout' update strategy (default)"
+msgstr "使用 'checkout' 更新策略(默认)"
#: builtin/submodule--helper.c
-msgid "path into the working tree, across nested submodule boundaries"
-msgstr "工作区中的路径,递归嵌套å­æ¨¡ç»„"
+msgid "use the 'merge' update strategy"
+msgstr "使用 'merge' 更新策略"
#: builtin/submodule--helper.c
-msgid "rebase, merge, checkout or none"
-msgstr "rebaseã€mergeã€checkout 或 none"
+msgid "use the 'rebase' update strategy"
+msgstr "使用 'rebase' 更新策略"
#: builtin/submodule--helper.c
msgid "create a shallow clone truncated to the specified number of revisions"
@@ -15212,6 +15776,10 @@ msgid "don't print cloning progress"
msgstr "ä¸è¦è¾“出克隆进度"
#: builtin/submodule--helper.c
+msgid "disallow cloning into non-empty directory, implies --init"
+msgstr "ä¸å…许克隆到一个éžç©ºç›®å½•ï¼Œæš—å« --init"
+
+#: builtin/submodule--helper.c
msgid ""
"git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] "
"[-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-"
@@ -15223,45 +15791,21 @@ msgstr ""
"shallow] [--reference <仓库>] [--recursive] [--[no-]single-branch] [--] [<路"
"径>...]"
-#: builtin/submodule--helper.c
-msgid "bad value for update parameter"
-msgstr "update å‚æ•°å–值错误"
-
-#: builtin/submodule--helper.c
-msgid "recurse into submodules"
-msgstr "在å­æ¨¡ç»„中递归"
-
-#: builtin/submodule--helper.c
-msgid "git submodule--helper absorb-git-dirs [<options>] [<path>...]"
-msgstr "git submodule--helper absorb-git-dirs [<选项>] [<路径>...]"
-
-#: builtin/submodule--helper.c
-msgid "check if it is safe to write to the .gitmodules file"
-msgstr "检查写入 .gitmodules 文件是å¦å®‰å…¨"
-
-#: builtin/submodule--helper.c
-msgid "unset the config in the .gitmodules file"
-msgstr "å–消 .gitmodules 文件中的设置"
-
-#: builtin/submodule--helper.c
-msgid "git submodule--helper config <name> [<value>]"
-msgstr "git submodule--helper config <å称> [<值>]"
-
-#: builtin/submodule--helper.c
-msgid "git submodule--helper config --unset <name>"
-msgstr "git submodule--helper config --unset <å称>"
+#: builtin/submodule--helper.c submodule.c
+msgid "Failed to resolve HEAD as a valid ref."
+msgstr "无法将 HEAD 解æžä¸ºæœ‰æ•ˆå¼•ç”¨ã€‚"
#: builtin/submodule--helper.c
-msgid "please make sure that the .gitmodules file is in the working tree"
-msgstr "请确认 .gitmodules 文件在工作区里"
+msgid "git submodule absorbgitdirs [<options>] [<path>...]"
+msgstr "git submodule absorbgitdirs [<选项>] [<路径>...]"
#: builtin/submodule--helper.c
msgid "suppress output for setting url of a submodule"
msgstr "抑制设置å­æ¨¡ç»„ URL 的输出"
#: builtin/submodule--helper.c
-msgid "git submodule--helper set-url [--quiet] <path> <newurl>"
-msgstr "git submodule--helper set-url [--quiet] <路径> <新地å€>"
+msgid "git submodule set-url [--quiet] <path> <newurl>"
+msgstr "git submodule set-url [--quiet] <路径> <新地å€>"
#: builtin/submodule--helper.c
msgid "set the default tracking branch to master"
@@ -15272,14 +15816,12 @@ msgid "set the default tracking branch"
msgstr "设置默认跟踪分支"
#: builtin/submodule--helper.c
-msgid "git submodule--helper set-branch [-q|--quiet] (-d|--default) <path>"
-msgstr "git submodule--helper set-branch [-q|--quiet] (-d|--default) <路径>"
+msgid "git submodule set-branch [-q|--quiet] (-d|--default) <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-d|--default) <路径>"
#: builtin/submodule--helper.c
-msgid ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
-msgstr ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <分支> <路径>"
+msgid "git submodule set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-b|--branch) <分支> <路径>"
#: builtin/submodule--helper.c
msgid "--branch or --default required"
@@ -15351,6 +15893,10 @@ msgid "unable to checkout submodule '%s'"
msgstr "无法检出å­æ¨¡ç»„ '%s'"
#: builtin/submodule--helper.c
+msgid "please make sure that the .gitmodules file is in the working tree"
+msgstr "请确认 .gitmodules 文件在工作区里"
+
+#: builtin/submodule--helper.c
#, c-format
msgid "Failed to add submodule '%s'"
msgstr "无法添加å­æ¨¡ç»„ '%s'"
@@ -15394,8 +15940,8 @@ msgid ""
msgstr "å°†å­æ¨¡ç»„çš„å称设置为给定的字符串,而éžé»˜è®¤ä¸ºå…¶è·¯å¾„"
#: builtin/submodule--helper.c
-msgid "git submodule--helper add [<options>] [--] <repository> [<path>]"
-msgstr "git submodule--helper add [<选项>] [--] <仓库> [<路径>]"
+msgid "git submodule add [<options>] [--] <repository> [<path>]"
+msgstr "git submodule add [<选项>] [--] <仓库> [<路径>]"
#: builtin/submodule--helper.c
msgid "Relative path can only be used from the toplevel of the working tree"
@@ -15411,23 +15957,21 @@ msgstr "仓库 URL:'%s' 必须是ç»å¯¹è·¯å¾„或以 ./|../ 起始"
msgid "'%s' is not a valid submodule name"
msgstr "'%s' ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„å­æ¨¡ç»„å称"
-#: builtin/submodule--helper.c git.c
-#, c-format
-msgid "%s doesn't support --super-prefix"
-msgstr "%s ä¸æ”¯æŒ --super-prefix"
-
#: builtin/submodule--helper.c
-#, c-format
-msgid "'%s' is not a valid submodule--helper subcommand"
-msgstr "'%s' ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„ submodule--helper å­å‘½ä»¤"
+msgid "git submodule--helper <command>"
+msgstr "git submodule--helper <命令>"
+
+#: builtin/symbolic-ref.c
+msgid "git symbolic-ref [-m <reason>] <name> <ref>"
+msgstr "git symbolic-ref [-m <ç†ç”±>] <å称> <引用>"
#: builtin/symbolic-ref.c
-msgid "git symbolic-ref [<options>] <name> [<ref>]"
-msgstr "git symbolic-ref [<选项>] <å称> [<引用>]"
+msgid "git symbolic-ref [-q] [--short] [--no-recurse] <name>"
+msgstr "git symbolic-ref [-q] [--short] [--no-recurse] <å称>"
#: builtin/symbolic-ref.c
-msgid "git symbolic-ref -d [-q] <name>"
-msgstr "git symbolic-ref -d [-q] <å称>"
+msgid "git symbolic-ref --delete [-q] <name>"
+msgstr "git symbolic-ref --delete [-q] <å称>"
#: builtin/symbolic-ref.c
msgid "suppress error message for non-symbolic (detached) refs"
@@ -15441,6 +15985,10 @@ msgstr "删除符å·å¼•ç”¨"
msgid "shorten ref output"
msgstr "缩短引用输出"
+#: builtin/symbolic-ref.c
+msgid "recursively dereference (default)"
+msgstr "递归解引用(默认)"
+
#: builtin/symbolic-ref.c builtin/update-ref.c
msgid "reason"
msgstr "原因"
@@ -15451,11 +15999,11 @@ msgstr "更新的原因"
#: builtin/tag.c
msgid ""
-"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]\n"
-" <tagname> [<head>]"
+"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
+" <tagname> [<commit> | <object>]"
msgstr ""
-"git tag [-a | -s | -u <key-id>] [-f] [-m <消æ¯> | -F <文件>]\n"
-" <标签å> [<头>]"
+"git tag [-a | -s | -u <ç§é’¥ ID>] [-f] [-m <消æ¯> | -F <文件>] [-e]\n"
+" <标签å> [<æ交> | <对象>]"
#: builtin/tag.c
msgid "git tag -d <tagname>..."
@@ -15463,14 +16011,15 @@ msgstr "git tag -d <标签å>..."
#: builtin/tag.c
msgid ""
-"git tag -l [-n[<num>]] [--contains <commit>] [--no-contains <commit>] [--"
-"points-at <object>]\n"
-" [--format=<format>] [--merged <commit>] [--no-merged <commit>] "
-"[<pattern>...]"
+"git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]\n"
+" [--points-at <object>] [--column[=<options>] | --no-column]\n"
+" [--create-reflog] [--sort=<key>] [--format=<format>]\n"
+" [--merged <commit>] [--no-merged <commit>] [<pattern>...]"
msgstr ""
-"git tag -l [-n[<æ•°å­—>]] [--contains <æ交>] [--no-contains <æ交>] [--points-"
-"at <对象>]\n"
-" [--format=<æ ¼å¼>] [--merged <æ交>] [--no-merged <æ交>] [<模å¼>...]"
+"git tag [-n[<æ•°å­—>]] -l [--contains <æ交>] [--no-contains <æ交>]\n"
+" [--points-at <对象>] [--column[=<选项>] | --no-column]\n"
+" [--create-reflog] [--sort=<é”®>] [--format=<æ ¼å¼>]\n"
+" [--merged <æ交>] [--no-merged <æ交>] [<模å¼>...]"
#: builtin/tag.c
msgid "git tag -v [--format=<format>] <tagname>..."
@@ -15649,6 +16198,19 @@ msgid "pack exceeds maximum allowed size"
msgstr "包超过了最大å…许大å°"
#: builtin/unpack-objects.c
+msgid "failed to write object in stream"
+msgstr "无法在æµä¸­å†™å…¥å¯¹è±¡"
+
+#: builtin/unpack-objects.c
+#, c-format
+msgid "inflate returned (%d)"
+msgstr "解压缩返回了 (%d)"
+
+#: builtin/unpack-objects.c
+msgid "invalid blob object from stream"
+msgstr "æµä¸­æ— æ•ˆçš„æ•°æ®å¯¹è±¡"
+
+#: builtin/unpack-objects.c
msgid "Unpacking objects"
msgstr "展开对象中"
@@ -15809,6 +16371,10 @@ msgid "write index in this format"
msgstr "以这ç§æ ¼å¼å†™å…¥ç´¢å¼•åŒº"
#: builtin/update-index.c
+msgid "report on-disk index format version"
+msgstr "报告ç£ç›˜ç´¢å¼•æ ¼å¼çš„版本"
+
+#: builtin/update-index.c
msgid "enable or disable split index"
msgstr "å¯ç”¨æˆ–ç¦ç”¨ç´¢å¼•æ‹†åˆ†"
@@ -15841,6 +16407,16 @@ msgid "clear fsmonitor valid bit"
msgstr "清除 fsmonitor 有效ä½"
#: builtin/update-index.c
+#, c-format
+msgid "%d\n"
+msgstr "%d\n"
+
+#: builtin/update-index.c
+#, c-format
+msgid "index-version: was %d, set to %d"
+msgstr "索引版本:从 %d 设置为 %d"
+
+#: builtin/update-index.c
msgid ""
"core.splitIndex is set to false; remove or change it, if you really want to "
"enable split index"
@@ -15929,8 +16505,12 @@ msgid "update the info files from scratch"
msgstr "从头开始更新文件信æ¯"
#: builtin/upload-pack.c
-msgid "git upload-pack [<options>] <dir>"
-msgstr "git upload-pack [<选项>] <目录>"
+msgid ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <directory>"
+msgstr ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <目录>"
#: builtin/upload-pack.c t/helper/test-serve-v2.c
msgid "quit after a single request/response exchange"
@@ -15949,8 +16529,8 @@ msgid "interrupt transfer after <n> seconds of inactivity"
msgstr "ä¸æ´»åŠ¨ <n> 秒钟åŽç»ˆæ­¢ä¼ è¾“"
#: builtin/verify-commit.c
-msgid "git verify-commit [-v | --verbose] <commit>..."
-msgstr "git verify-commit [-v | --verbose] <æ交>..."
+msgid "git verify-commit [-v | --verbose] [--raw] <commit>..."
+msgstr "git verify-commit [-v | --verbose] [--raw] <æ交>..."
#: builtin/verify-commit.c
msgid "print commit contents"
@@ -15961,8 +16541,8 @@ msgid "print raw gpg status output"
msgstr "打å°åŽŸå§‹ gpg 状æ€è¾“出"
#: builtin/verify-pack.c
-msgid "git verify-pack [-v | --verbose] [-s | --stat-only] <pack>..."
-msgstr "git verify-pack [-v | --verbose] [-s | --stat-only] <包>..."
+msgid "git verify-pack [-v | --verbose] [-s | --stat-only] [--] <pack>.idx..."
+msgstr "git verify-pack [-v | --verbose] [-s | --stat-only] [--] <包>.idx..."
#: builtin/verify-pack.c
msgid "verbose"
@@ -15973,44 +16553,82 @@ msgid "show statistics only"
msgstr "åªæ˜¾ç¤ºç»Ÿè®¡"
#: builtin/verify-tag.c
-msgid "git verify-tag [-v | --verbose] [--format=<format>] <tag>..."
-msgstr "git verify-tag [-v | --verbose] [--format=<æ ¼å¼>] <标签>..."
+msgid "git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."
+msgstr "git verify-tag [-v | --verbose] [--format=<æ ¼å¼>] [--raw] <标签>..."
#: builtin/verify-tag.c
msgid "print tag contents"
msgstr "打å°æ ‡ç­¾å†…容"
#: builtin/worktree.c
-msgid "git worktree add [<options>] <path> [<commit-ish>]"
-msgstr "git worktree add [<选项>] <路径> [<æ交>]"
+msgid ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <string>]]\n"
+" [--orphan] [(-b | -B) <new-branch>] <path> [<commit-ish>]"
+msgstr ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <字符串>]]\n"
+" [--orphan] [(-b | -B) <新分支>] <路径> [<æ交å·>]"
#: builtin/worktree.c
-msgid "git worktree list [<options>]"
-msgstr "git worktree list [<选项>]"
+msgid "git worktree list [-v | --porcelain [-z]]"
+msgstr "git worktree list [-v | --porcelain [-z]]"
#: builtin/worktree.c
-msgid "git worktree lock [<options>] <path>"
-msgstr "git worktree lock [<选项>] <路径>"
+msgid "git worktree lock [--reason <string>] <worktree>"
+msgstr "git worktree lock [--reason <字符串>] <工作区>"
#: builtin/worktree.c
msgid "git worktree move <worktree> <new-path>"
msgstr "git worktree move <工作区> <新路径>"
#: builtin/worktree.c
-msgid "git worktree prune [<options>]"
-msgstr "git worktree prune [<选项>]"
+msgid "git worktree prune [-n] [-v] [--expire <expire>]"
+msgstr "git worktree prune [-n] [-v] [--expire <过期>]"
#: builtin/worktree.c
-msgid "git worktree remove [<options>] <worktree>"
-msgstr "git worktree remove [<选项>] <工作区>"
+msgid "git worktree remove [-f] <worktree>"
+msgstr "git worktree remove [-f] <工作区>"
#: builtin/worktree.c
msgid "git worktree repair [<path>...]"
msgstr "git worktree repair [<路径>...]"
#: builtin/worktree.c
-msgid "git worktree unlock <path>"
-msgstr "git worktree unlock <路径>"
+msgid "git worktree unlock <worktree>"
+msgstr "git worktree unlock <工作区>"
+
+#: builtin/worktree.c
+msgid "No possible source branch, inferring '--orphan'"
+msgstr "没有å¯ç”¨çš„æºåˆ†æ”¯ï¼Œå°†åŸºäºŽ '--orphan' 选项进行推断"
+
+#: builtin/worktree.c
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+msgstr ""
+"如果你打算为此仓库创建一个包å«æ–°çš„未诞生的\n"
+"分支(没有æ交的分支)的工作区,你å¯ä»¥ä½¿ç”¨\n"
+"选项 --orphan æ¥æ‰§è¡Œæ­¤æ“作:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+
+#: builtin/worktree.c
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan %s\n"
+msgstr ""
+"如果你打算为此仓库创建一个包å«æ–°çš„未诞生的\n"
+"分支(没有æ交的分支)的工作区,你å¯ä»¥ä½¿ç”¨\n"
+"选项 --orphan æ¥æ‰§è¡Œæ­¤æ“作:\n"
+"\n"
+" git worktree add --orphan %s\n"
#: builtin/worktree.c
#, c-format
@@ -16079,6 +16697,11 @@ msgstr "åˆå§‹åŒ–"
#: builtin/worktree.c
#, c-format
+msgid "could not find created worktree '%s'"
+msgstr "无法找到已创建的工作树 '%s'"
+
+#: builtin/worktree.c
+#, c-format
msgid "Preparing worktree (new branch '%s')"
msgstr "准备工作区(新分支 '%s')"
@@ -16094,10 +16717,34 @@ msgstr "准备工作区(检出 '%s')"
#: builtin/worktree.c
#, c-format
+msgid "unreachable: invalid reference: %s"
+msgstr "ä¸å¯è¾¾ï¼šæ— æ•ˆå¼•ç”¨ï¼š%s"
+
+#: builtin/worktree.c
+#, c-format
msgid "Preparing worktree (detached HEAD %s)"
msgstr "准备工作区(分离头指针 %s)"
#: builtin/worktree.c
+#, c-format
+msgid ""
+"HEAD points to an invalid (or orphaned) reference.\n"
+"HEAD path: '%s'\n"
+"HEAD contents: '%s'"
+msgstr ""
+"HEAD 指å‘了一个无用的(或孤立的)引用。\n"
+"HEAD 路径: '%s'\n"
+"HEAD 内容: '%s'"
+
+#: builtin/worktree.c
+msgid ""
+"No local or remote refs exist despite at least one remote\n"
+"present, stopping; use 'add -f' to override or fetch a remote first"
+msgstr ""
+"尽管已é…置远程仓库,但ä¸å­˜åœ¨ä»»ä½•æœ¬åœ°çš„或远程的引用,æ“作终止。\n"
+"请先使用 'add -f' æ¥è¦†ç›–或拉å–一个远程仓库"
+
+#: builtin/worktree.c
msgid "checkout <branch> even if already checked out in other worktree"
msgstr "检出 <分支>,å³ä½¿å·²ç»è¢«æ£€å‡ºåˆ°å…¶å®ƒå·¥ä½œåŒº"
@@ -16110,6 +16757,10 @@ msgid "create or reset a branch"
msgstr "创建或é‡ç½®ä¸€ä¸ªåˆ†æ”¯"
#: builtin/worktree.c
+msgid "create unborn branch"
+msgstr "创建一个尚未诞生的分支"
+
+#: builtin/worktree.c
msgid "populate the new working tree"
msgstr "生æˆæ–°çš„工作区"
@@ -16135,6 +16786,11 @@ msgid "options '%s', '%s', and '%s' cannot be used together"
msgstr "选项 '%s'ã€'%s' å’Œ '%s' ä¸èƒ½åŒæ—¶ä½¿ç”¨"
#: builtin/worktree.c
+#, c-format
+msgid "option '%s' and commit-ish cannot be used together"
+msgstr "选项 '%s' å’Œæ交å·ä¸èƒ½åŒæ—¶ä½¿ç”¨"
+
+#: builtin/worktree.c
msgid "added with --lock"
msgstr "由 --lock 添加"
@@ -16290,6 +16946,78 @@ msgstr "å°† <å‰ç¼€> å­ç›®å½•å†…容写到一个树对象"
msgid "only useful for debugging"
msgstr "åªå¯¹è°ƒè¯•æœ‰ç”¨"
+#: bulk-checkin.c
+msgid "core.fsyncMethod = batch is unsupported on this platform"
+msgstr "core.fsyncMethod = batch ä¸æ”¯æŒæœ¬å¹³å°"
+
+#: bundle-uri.c
+#, c-format
+msgid "could not parse bundle list key %s with value '%s'"
+msgstr "ä¸èƒ½è§£æžå½’档包列表键 %s 的值 '%s'"
+
+#: bundle-uri.c
+#, c-format
+msgid "bundle list at '%s' has no mode"
+msgstr "在 '%s' 的归档包列表没有模å¼"
+
+#: bundle-uri.c
+msgid "failed to create temporary file"
+msgstr "无法创建临时文件"
+
+#: bundle-uri.c
+msgid "insufficient capabilities"
+msgstr "缺ä¹èƒ½åŠ›"
+
+#: bundle-uri.c
+#, c-format
+msgid "file downloaded from '%s' is not a bundle"
+msgstr "下载自 '%s' 的文件ä¸æ˜¯å½’档包"
+
+#: bundle-uri.c
+msgid "failed to store maximum creation token"
+msgstr "无法储存最大的创建令牌"
+
+#: bundle-uri.c
+#, c-format
+msgid "unrecognized bundle mode from URI '%s'"
+msgstr "ä¸å¯è¾¨è®¤çš„归档包模å¼æ¥è‡ª URI '%s'"
+
+#: bundle-uri.c
+#, c-format
+msgid "exceeded bundle URI recursion limit (%d)"
+msgstr "超过了 URI 递归é™åˆ¶ (%d)"
+
+#: bundle-uri.c
+#, c-format
+msgid "failed to download bundle from URI '%s'"
+msgstr "无法从 URI '%s' 下载归档包"
+
+#: bundle-uri.c
+#, c-format
+msgid "file at URI '%s' is not a bundle or bundle list"
+msgstr "ä½äºŽ URI '%s' 的文件ä¸æ˜¯å½’档包或归档包列表"
+
+#: bundle-uri.c
+#, c-format
+msgid "bundle-uri: unexpected argument: '%s'"
+msgstr "bundle-uri: æ„外的å‚数:'%s'"
+
+#: bundle-uri.c
+msgid "bundle-uri: expected flush after arguments"
+msgstr "bundle-uri: 在å‚数之åŽåº”有一个 flush"
+
+#: bundle-uri.c
+msgid "bundle-uri: got an empty line"
+msgstr "bundle-uri: 获得了空行"
+
+#: bundle-uri.c
+msgid "bundle-uri: line is not of the form 'key=value'"
+msgstr "bundle-uri: è¡Œä¸æ˜¯ä»¥ 'key=value' æ ¼å¼"
+
+#: bundle-uri.c
+msgid "bundle-uri: line has empty key or value"
+msgstr "bundle-uri: 行有空的键或值"
+
#: bundle.c
#, c-format
msgid "unrecognized bundle hash algorithm: %s"
@@ -16319,6 +17047,12 @@ msgid "need a repository to verify a bundle"
msgstr "需è¦ä¸€ä¸ªä»“库æ¥æ ¡éªŒä¸€ä¸ªå½’档包"
#: bundle.c
+msgid ""
+"some prerequisite commits exist in the object store, but are not connected "
+"to the repository's history"
+msgstr "一些å‰ç½®æ交存在于对象储存中,但未连接于本仓库的历å²"
+
+#: bundle.c
#, c-format
msgid "The bundle contains this ref:"
msgid_plural "The bundle contains these %<PRIuMAX> refs:"
@@ -16337,6 +17071,16 @@ msgstr[0] "这个归档包需è¦è¿™ä¸ªå¼•ç”¨ï¼š"
msgstr[1] "è¿™ä¸ªå½’æ¡£åŒ…éœ€è¦ %<PRIuMAX> 个引用:"
#: bundle.c
+#, c-format
+msgid "The bundle uses this hash algorithm: %s"
+msgstr "该归档包使用的哈希算法:%s"
+
+#: bundle.c
+#, c-format
+msgid "The bundle uses this filter: %s"
+msgstr "归档包使用了过滤器:%s"
+
+#: bundle.c
msgid "unable to dup bundle descriptor"
msgstr "无法å¤åˆ¶å½’档包æ述符"
@@ -16382,6 +17126,11 @@ msgstr "ç»ˆæ­¢å— ID 比预期更早出现"
#: chunk-format.c
#, c-format
+msgid "chunk id %<PRIx32> not %d-byte aligned"
+msgstr "å— id %<PRIx32> 未 %d 字节对é½"
+
+#: chunk-format.c
+#, c-format
msgid "improper chunk offset(s) %<PRIx64> and %<PRIx64>"
msgstr "ä¸æ­£ç¡®çš„å—å移 %<PRIx64> å’Œ %<PRIx64>"
@@ -16449,8 +17198,8 @@ msgid "Move objects and refs by archive"
msgstr "通过归档移动对象和引用"
#: command-list.h
-msgid "Provide content or type and size information for repository objects"
-msgstr "æ供仓库对象的内容ã€ç±»åž‹æˆ–大å°"
+msgid "Provide contents or details of repository objects"
+msgstr "æ供仓库对象的内容或详情"
#: command-list.h
msgid "Display gitattributes information"
@@ -16553,6 +17302,10 @@ msgid "Give an object a human readable name based on an available ref"
msgstr "基于一个现存的引用为一个对象起一个å¯è¯»çš„å称"
#: command-list.h
+msgid "Generate a zip archive of diagnostic information"
+msgstr "生æˆè¯Šæ–­ä¿¡æ¯çš„压缩包"
+
+#: command-list.h
msgid "Show changes between commits, commit and working tree, etc"
msgstr "显示æ交之间ã€æ交和工作区之间等的差异"
@@ -16629,8 +17382,8 @@ msgid "A portable graphical interface to Git"
msgstr "一个便æºçš„ Git 图形客户端"
#: command-list.h
-msgid "Compute object ID and optionally creates a blob from a file"
-msgstr "从一个文件计算对象 ID,并å¯ä»¥åˆ›å»º blob æ•°æ®å¯¹è±¡"
+msgid "Compute object ID and optionally create an object from a file"
+msgstr "从一个文件计算对象 ID,并支æŒå¯é€‰åœ°åˆ›å»ºä¸€ä¸ªå¯¹è±¡"
#: command-list.h
msgid "Display help information about Git"
@@ -16721,8 +17474,8 @@ msgid "The standard helper program to use with git-merge-index"
msgstr "与 git-merge-index 一起使用的标准å‘导程åº"
#: command-list.h
-msgid "Show three-way merge without touching index"
-msgstr "在ä¸åŠ¨ç´¢å¼•çš„情况下显示三路åˆå¹¶"
+msgid "Perform merge without touching index or working tree"
+msgstr "在ä¸è§¦ç¢°ç´¢å¼•æˆ–工作树情况下应用åˆå¹¶"
#: command-list.h
msgid "Run merge conflict resolution tools to resolve merge conflicts"
@@ -16826,6 +17579,10 @@ msgid "Create, list, delete refs to replace objects"
msgstr "创建ã€åˆ—出ã€åˆ é™¤å¯¹è±¡æ›¿æ¢å¼•ç”¨"
#: command-list.h
+msgid "EXPERIMENTAL: Replay commits on a new base, works with bare repos too"
+msgstr "试验中:基于一个新基线é‡æ”¾æ交,åŒæ ·é€‚用于纯仓库"
+
+#: command-list.h
msgid "Generates a summary of pending changes"
msgstr "生æˆå¾…定更改的摘è¦"
@@ -16983,7 +17740,11 @@ msgid "Check the GPG signature of tags"
msgstr "检查标签的 GPG ç­¾å"
#: command-list.h
-msgid "Show logs with difference each commit introduces"
+msgid "Display version information about Git"
+msgstr "显示关于 Git 的版本信æ¯"
+
+#: command-list.h
+msgid "Show logs with differences each commit introduces"
msgstr "显示æ¯ä¸€ä¸ªæ交引入的差异日志"
#: command-list.h
@@ -17027,6 +17788,30 @@ msgid "Frequently asked questions about using Git"
msgstr "关于使用 Git 的常è§é—®é¢˜"
#: command-list.h
+msgid "The bundle file format"
+msgstr "归档包文件格å¼"
+
+#: command-list.h
+msgid "Chunk-based file formats"
+msgstr "å—å¼æ–‡ä»¶æ ¼å¼"
+
+#: command-list.h
+msgid "Git commit-graph format"
+msgstr "Git æ交图格å¼"
+
+#: command-list.h
+msgid "Git index format"
+msgstr "Git 索引格å¼"
+
+#: command-list.h
+msgid "Git pack format"
+msgstr "Git 包格å¼"
+
+#: command-list.h
+msgid "Git cryptographic signature formats"
+msgstr "Git 密ç å­¦ç­¾åæ ¼å¼"
+
+#: command-list.h
msgid "A Git Glossary"
msgstr "Git è¯æ±‡è¡¨"
@@ -17036,7 +17821,7 @@ msgstr "Git 使用的钩å­"
#: command-list.h
msgid "Specifies intentionally untracked files to ignore"
-msgstr "忽略指定的未跟踪文件"
+msgstr "指定故æ„忽略的未跟踪文件"
#: command-list.h
msgid "The Git repository browser"
@@ -17055,6 +17840,26 @@ msgid "Git namespaces"
msgstr "Git å字空间"
#: command-list.h
+msgid "Protocol v0 and v1 capabilities"
+msgstr "åè®® v0 å’Œ v1 能力"
+
+#: command-list.h
+msgid "Things common to various protocols"
+msgstr "ä¸åŒå议的共åŒéƒ¨åˆ†"
+
+#: command-list.h
+msgid "Git HTTP-based protocols"
+msgstr "Git 基于 HTTP çš„åè®®"
+
+#: command-list.h
+msgid "How packs are transferred over-the-wire"
+msgstr "包在线路中传输的方å¼"
+
+#: command-list.h
+msgid "Git Wire Protocol, Version 2"
+msgstr "Git 传输å议,第二版"
+
+#: command-list.h
msgid "Helper programs to interact with remote repositories"
msgstr "与远程仓库交互的助手程åº"
@@ -17086,50 +17891,110 @@ msgstr "Git web ç•Œé¢ï¼ˆGit 仓库的 web å‰ç«¯ï¼‰"
msgid "An overview of recommended workflows with Git"
msgstr "Git 推è的工作æµæ¦‚览"
+#: command-list.h
+msgid "A tool for managing large Git repositories"
+msgstr "一个管ç†å¤§åž‹ Git 仓库的工具"
+
#: commit-graph.c
msgid "commit-graph file is too small"
-msgstr "æ交图形文件太å°"
+msgstr "æ交图文件太å°"
+
+#: commit-graph.c
+msgid "commit-graph oid fanout chunk is wrong size"
+msgstr "æ交图中对象 ID 的扇出å—大å°é”™è¯¯"
+
+#: commit-graph.c
+msgid "commit-graph fanout values out of order"
+msgstr "æ交图的扇出值失åº"
+
+#: commit-graph.c
+msgid "commit-graph OID lookup chunk is the wrong size"
+msgstr "æ交图的对象 ID 查询å—大å°é”™è¯¯"
+
+#: commit-graph.c
+msgid "commit-graph commit data chunk is wrong size"
+msgstr "æ交图的æ交数æ®å—大å°é”™è¯¯"
+
+#: commit-graph.c
+msgid "commit-graph generations chunk is wrong size"
+msgstr "æ交图的世代å—大å°é”™è¯¯"
+
+#: commit-graph.c
+msgid "commit-graph changed-path index chunk is too small"
+msgstr "æ交图的å˜æ›´è·¯å¾„的索引å—太å°"
+
+#: commit-graph.c
+#, c-format
+msgid ""
+"ignoring too-small changed-path chunk (%<PRIuMAX> < %<PRIuMAX>) in commit-"
+"graph file"
+msgstr "忽略æ交图文件中过å°çš„更改路径å—(%<PRIuMAX> < %<PRIuMAX>)"
#: commit-graph.c
#, c-format
msgid "commit-graph signature %X does not match signature %X"
-msgstr "æ交图形签å %X 和签å %X ä¸åŒ¹é…"
+msgstr "æ交图签å %X 和签å %X ä¸åŒ¹é…"
#: commit-graph.c
#, c-format
msgid "commit-graph version %X does not match version %X"
-msgstr "æ交图形版本 %X 和版本 %X ä¸åŒ¹é…"
+msgstr "æ交图版本 %X 和版本 %X ä¸åŒ¹é…"
#: commit-graph.c
#, c-format
msgid "commit-graph hash version %X does not match version %X"
-msgstr "æ交图形哈希版本 %X 和版本 %X ä¸åŒ¹é…"
+msgstr "æ交图哈希版本 %X 和版本 %X ä¸åŒ¹é…"
#: commit-graph.c
#, c-format
msgid "commit-graph file is too small to hold %u chunks"
-msgstr "æ交图形文件太å°ï¼Œå®¹ä¸ä¸‹ %u 个å—"
+msgstr "æ交图文件太å°ï¼Œå®¹ä¸ä¸‹ %u 个å—"
+
+#: commit-graph.c
+msgid "commit-graph required OID fanout chunk missing or corrupted"
+msgstr "æ交图所需的对象 ID 扇出å—缺失或æŸå"
+
+#: commit-graph.c
+msgid "commit-graph required OID lookup chunk missing or corrupted"
+msgstr "æ交图所需的对象 ID 查询å—缺失或æŸå"
+
+#: commit-graph.c
+msgid "commit-graph required commit data chunk missing or corrupted"
+msgstr "æ交图所需的æ交数æ®å—缺失或æŸå"
#: commit-graph.c
msgid "commit-graph has no base graphs chunk"
-msgstr "æ交图形没有基础图形å—"
+msgstr "æ交图没有基础图形å—"
+
+#: commit-graph.c
+msgid "commit-graph base graphs chunk is too small"
+msgstr "æ交图的基础图形å—过å°"
#: commit-graph.c
msgid "commit-graph chain does not match"
-msgstr "æ交图形链ä¸åŒ¹é…"
+msgstr "æ交图链ä¸åŒ¹é…"
+
+#: commit-graph.c
+#, c-format
+msgid "commit count in base graph too high: %<PRIuMAX>"
+msgstr "基础图形中的æ交数é‡è¿‡é«˜ï¼š%<PRIuMAX>"
+
+#: commit-graph.c
+msgid "commit-graph chain file too small"
+msgstr "æ交图链文件太å°"
#: commit-graph.c
#, c-format
msgid "invalid commit-graph chain: line '%s' not a hash"
-msgstr "无效的æ交图形链:行 '%s' ä¸æ˜¯ä¸€ä¸ªå“ˆå¸Œå€¼"
+msgstr "无效的æ交图链:行 '%s' ä¸æ˜¯ä¸€ä¸ªå“ˆå¸Œå€¼"
#: commit-graph.c
msgid "unable to find all commit-graph files"
-msgstr "无法找到所有æ交图形文件"
+msgstr "无法找到所有æ交图文件"
#: commit-graph.c
msgid "invalid commit position. commit-graph is likely corrupt"
-msgstr "无效的æ交ä½ç½®ã€‚æ交图形å¯èƒ½å·²æŸå"
+msgstr "无效的æ交ä½ç½®ã€‚æ交图å¯èƒ½å·²æŸå"
#: commit-graph.c
#, c-format
@@ -17141,6 +18006,14 @@ msgid "commit-graph requires overflow generation data but has none"
msgstr "æ交图需è¦æº¢å‡ºä¸–代数æ®ï¼Œä½†æ˜¯æ²¡æœ‰"
#: commit-graph.c
+msgid "commit-graph overflow generation data is too small"
+msgstr "æ交图溢出世代数æ®è¿‡å°"
+
+#: commit-graph.c
+msgid "commit-graph extra-edges pointer out of bounds"
+msgstr "æ交图é¢å¤–边的指针越界"
+
+#: commit-graph.c
msgid "Loading known commits in commit graph"
msgstr "正在加载æ交图中的已知æ交"
@@ -17215,15 +18088,25 @@ msgstr[1] "正在用 %d 步写出æ交图"
#: commit-graph.c
msgid "unable to open commit-graph chain file"
-msgstr "无法打开æ交图形链文件"
+msgstr "无法打开æ交图链文件"
#: commit-graph.c
msgid "failed to rename base commit-graph file"
-msgstr "无法é‡å‘½å基础æ交图形文件"
+msgstr "无法é‡å‘½å基础æ交图文件"
#: commit-graph.c
msgid "failed to rename temporary commit-graph file"
-msgstr "无法é‡å‘½å临时æ交图形文件"
+msgstr "无法é‡å‘½å临时æ交图文件"
+
+#: commit-graph.c
+#, c-format
+msgid "cannot merge graphs with %<PRIuMAX>, %<PRIuMAX> commits"
+msgstr "无法åˆå¹¶æ交图,总共已累加æ交数:%<PRIuMAX>,当å‰å¾…累加æ交数:%<PRIuMAX>"
+
+#: commit-graph.c
+#, c-format
+msgid "cannot merge graph %s, too many commits: %<PRIuMAX>"
+msgstr "无法åˆå¹¶æ交图 %s, æ交过多:%<PRIuMAX>"
#: commit-graph.c
msgid "Scanning merged commits"
@@ -17231,7 +18114,7 @@ msgstr "正在扫æåˆå¹¶æ交"
#: commit-graph.c
msgid "Merging commit-graph"
-msgstr "正在åˆå¹¶æ交图形"
+msgstr "正在åˆå¹¶æ交图"
#: commit-graph.c
msgid "attempting to write a commit-graph, but 'core.commitGraph' is disabled"
@@ -17248,68 +18131,63 @@ msgstr "æ交图文件的校验ç é”™è¯¯ï¼Œå¯èƒ½å·²ç»æŸå"
#: commit-graph.c
#, c-format
msgid "commit-graph has incorrect OID order: %s then %s"
-msgstr "æ交图形的对象 ID 顺åºä¸æ­£ç¡®ï¼š%s ç„¶åŽ %s"
+msgstr "æ交图的对象 ID 顺åºä¸æ­£ç¡®ï¼š%s ç„¶åŽ %s"
#: commit-graph.c
#, c-format
msgid "commit-graph has incorrect fanout value: fanout[%d] = %u != %u"
-msgstr "æ交图形有ä¸æ­£ç¡®çš„扇出值:fanout[%d] = %u != %u"
+msgstr "æ交图有ä¸æ­£ç¡®çš„扇出值:fanout[%d] = %u != %u"
#: commit-graph.c
#, c-format
msgid "failed to parse commit %s from commit-graph"
-msgstr "无法从æ交图形中解æžæ交 %s"
-
-#: commit-graph.c
-msgid "Verifying commits in commit graph"
-msgstr "正在校验æ交图中的æ交"
+msgstr "无法从æ交图中解æžæ交 %s"
#: commit-graph.c
#, c-format
msgid "failed to parse commit %s from object database for commit-graph"
-msgstr "无法从æ交图形的对象库中解æžæ交 %s"
+msgstr "无法从æ交图的对象库中解æžæ交 %s"
#: commit-graph.c
#, c-format
msgid "root tree OID for commit %s in commit-graph is %s != %s"
-msgstr "æ交图形中的æ交 %s 的根树对象 ID 是 %s != %s"
+msgstr "æ交图中的æ交 %s 的根树对象 ID 是 %s != %s"
#: commit-graph.c
#, c-format
msgid "commit-graph parent list for commit %s is too long"
-msgstr "æ交 %s çš„æ交图形父æ交列表太长了"
+msgstr "æ交 %s çš„æ交图父æ交列表太长了"
#: commit-graph.c
#, c-format
msgid "commit-graph parent for %s is %s != %s"
-msgstr "%s çš„æ交图形父æ交是 %s != %s"
+msgstr "%s çš„æ交图父æ交是 %s != %s"
#: commit-graph.c
#, c-format
msgid "commit-graph parent list for commit %s terminates early"
-msgstr "æ交 %s çš„æ交图形父æ交列表过早终止"
+msgstr "æ交 %s çš„æ交图父æ交列表过早终止"
#: commit-graph.c
#, c-format
-msgid ""
-"commit-graph has generation number zero for commit %s, but non-zero elsewhere"
-msgstr "æ交图形中æ交 %s 的世代å·æ˜¯é›¶ï¼Œä½†å…¶å®ƒåœ°æ–¹éžé›¶"
+msgid "commit-graph generation for commit %s is %<PRIuMAX> < %<PRIuMAX>"
+msgstr "æ交图中的æ交 %s 的世代å·æ˜¯ %<PRIuMAX> < %<PRIuMAX>"
#: commit-graph.c
#, c-format
-msgid ""
-"commit-graph has non-zero generation number for commit %s, but zero elsewhere"
-msgstr "æ交图形中æ交 %s 的世代å·éžé›¶ï¼Œä½†å…¶å®ƒåœ°æ–¹æ˜¯é›¶"
+msgid "commit date for commit %s in commit-graph is %<PRIuMAX> != %<PRIuMAX>"
+msgstr "æ交图中æ交 %s çš„æ交日期是 %<PRIuMAX> != %<PRIuMAX>"
#: commit-graph.c
#, c-format
-msgid "commit-graph generation for commit %s is %<PRIuMAX> < %<PRIuMAX>"
-msgstr "æ交图形中的æ交 %s 的世代å·æ˜¯ %<PRIuMAX> < %<PRIuMAX>"
+msgid ""
+"commit-graph has both zero and non-zero generations (e.g., commits '%s' and "
+"'%s')"
+msgstr "æ交图具有零和éžé›¶çš„世代(例如:æ交 '%s' å’Œ '%s')"
#: commit-graph.c
-#, c-format
-msgid "commit date for commit %s in commit-graph is %<PRIuMAX> != %<PRIuMAX>"
-msgstr "æ交图形中æ交 %s çš„æ交日期是 %<PRIuMAX> != %<PRIuMAX>"
+msgid "Verifying commits in commit graph"
+msgstr "正在校验æ交图中的æ交"
#: commit.c
#, c-format
@@ -17338,6 +18216,11 @@ msgstr ""
#: commit.c
#, c-format
+msgid "commit %s exists in commit-graph but not in the object database"
+msgstr "æ交 %s 存在于æ交图中,但ä¸å­˜åœ¨äºŽå¯¹è±¡æ•°æ®åº“中"
+
+#: commit.c
+#, c-format
msgid "Commit %s has an untrusted GPG signature, allegedly by %s."
msgstr "æ交 %s 有一个éžå¯ä¿¡çš„声称æ¥è‡ª %s çš„ GPG ç­¾å。"
@@ -17374,6 +18257,16 @@ msgstr "编译器信æ¯ä¸å¯ç”¨\n"
msgid "no libc information available\n"
msgstr "libc ä¿¡æ¯ä¸å¯ç”¨\n"
+#: compat/disk.h
+#, c-format
+msgid "could not determine free disk size for '%s'"
+msgstr "ä¸èƒ½ç¡®å®š '%s' 的空余ç£ç›˜ç©ºé—´"
+
+#: compat/disk.h
+#, c-format
+msgid "could not get info for '%s'"
+msgstr "无法获得 '%s' çš„ä¿¡æ¯"
+
#: compat/fsmonitor/fsm-health-win32.c
#, c-format
msgid "[GLE %ld] health thread could not open '%ls'"
@@ -17404,6 +18297,11 @@ msgstr "'has_worktree_moved' 中未处ç†çš„情况:%d"
msgid "health thread wait failed [GLE %ld]"
msgstr "å¥åº·ç›‘测线程等待失败 [GLE %ld]"
+#: compat/fsmonitor/fsm-ipc-darwin.c
+#, c-format
+msgid "Invalid path: %s"
+msgstr "无效路径: %s"
+
#: compat/fsmonitor/fsm-listen-darwin.c
msgid "Unable to create FSEventStream."
msgstr "无法创建 FSEventStream。"
@@ -17442,6 +18340,36 @@ msgstr "GetOverlappedResult 失败于 '%s' [GLE %ld]"
msgid "could not read directory changes [GLE %ld]"
msgstr "无法获å–目录å˜æ›´ [GLE %ld]"
+#: compat/fsmonitor/fsm-path-utils-darwin.c
+#, c-format
+msgid "opendir('%s') failed"
+msgstr "opendir('%s') 失败"
+
+#: compat/fsmonitor/fsm-path-utils-darwin.c
+#, c-format
+msgid "lstat('%s') failed"
+msgstr "lstat('%s') 失败"
+
+#: compat/fsmonitor/fsm-path-utils-darwin.c
+#, c-format
+msgid "strbuf_readlink('%s') failed"
+msgstr "strbuf_readlink('%s') 失败"
+
+#: compat/fsmonitor/fsm-path-utils-darwin.c
+#, c-format
+msgid "closedir('%s') failed"
+msgstr "closedir('%s') 失败"
+
+#: compat/fsmonitor/fsm-path-utils-win32.c
+#, c-format
+msgid "[GLE %ld] unable to open for read '%ls'"
+msgstr "[GLE %ld] 无法打开è¦è¯»å–çš„ '%ls'"
+
+#: compat/fsmonitor/fsm-path-utils-win32.c
+#, c-format
+msgid "[GLE %ld] unable to get protocol information for '%ls'"
+msgstr "[GLE %ld] æ— æ³•èŽ·å– '%ls' çš„åè®®ä¿¡æ¯ "
+
#: compat/mingw.c
#, c-format
msgid "failed to copy SID (%ld)"
@@ -17788,8 +18716,8 @@ msgid "bad zlib compression level %d"
msgstr "错误的 zlib 压缩级别 %d"
#: config.c
-msgid "core.commentChar should only be one character"
-msgstr "core.commentChar 应该是一个字符"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar 应该是一个 ASCII ç¼–ç çš„字符"
#: config.c
#, c-format
@@ -17835,11 +18763,6 @@ msgid "unable to resolve config blob '%s'"
msgstr "ä¸èƒ½è§£æžé…置对象 '%s'"
#: config.c
-#, c-format
-msgid "failed to parse %s"
-msgstr "æ— æ³•è§£æž %s"
-
-#: config.c
msgid "unable to parse command-line config"
msgstr "无法解æžå‘½ä»¤è¡Œä¸­çš„é…ç½®"
@@ -17929,6 +18852,11 @@ msgstr "无效的å°èŠ‚å称:%s"
#: config.c
#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr "æ‹’ç»æ”¯æŒå†…容过长的行,ä½äºŽæ–‡ä»¶ '%s' 中的第 %<PRIuMAX> è¡Œ"
+
+#: config.c
+#, c-format
msgid "missing value for '%s'"
msgstr "%s çš„å–值缺失"
@@ -17995,12 +18923,12 @@ msgstr "æœåŠ¡å™¨ç»™å‡ºæœªçŸ¥çš„å¯¹è±¡æ ¼å¼ '%s'"
#: connect.c
#, c-format
-msgid "invalid ls-refs response: %s"
-msgstr "无效的 ls-refs å“应:%s"
+msgid "error on bundle-uri response line %d: %s"
+msgstr "于 bundle-uri å“应行 %d å‘生错误:%s"
#: connect.c
-msgid "expected flush after ref listing"
-msgstr "在引用列表之åŽåº”该有一个 flush 包"
+msgid "expected flush after bundle-uri listing"
+msgstr "在 bundle-uri 列表之åŽåº”该有一个 flush 包"
#: connect.c
msgid "expected response end packet after ref listing"
@@ -18008,6 +18936,15 @@ msgstr "在引用列表之åŽåº”该有å“应结æŸåŒ…"
#: connect.c
#, c-format
+msgid "invalid ls-refs response: %s"
+msgstr "无效的 ls-refs å“应:%s"
+
+#: connect.c
+msgid "expected flush after ref listing"
+msgstr "在引用列表之åŽåº”该有一个 flush 包"
+
+#: connect.c
+#, c-format
msgid "protocol '%s' is not supported"
msgstr "ä¸æ”¯æŒ '%s' åè®®"
@@ -18115,229 +19052,6 @@ msgstr "写入 rev-list 失败"
msgid "failed to close rev-list's stdin"
msgstr "无法关闭 rev-list 的标准输入"
-#: contrib/scalar/scalar.c worktree.c
-#, c-format
-msgid "'%s' does not exist"
-msgstr "'%s' ä¸å­˜åœ¨"
-
-#: contrib/scalar/scalar.c
-msgid "need a working directory"
-msgstr "需è¦ä¸€ä¸ªå·¥ä½œç›®å½•"
-
-#: contrib/scalar/scalar.c
-msgid "could not find enlistment root"
-msgstr "无法找到登记根"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not switch to '%s'"
-msgstr "无法切æ¢åˆ° '%s'"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not configure %s=%s"
-msgstr "无法é…ç½® %s=%s"
-
-#: contrib/scalar/scalar.c
-msgid "could not configure log.excludeDecoration"
-msgstr "无法é…ç½® log.excludeDecoration"
-
-#: contrib/scalar/scalar.c
-msgid "Scalar enlistments require a worktree"
-msgstr "Scalar 登记需è¦ä¸€ä¸ªå·¥ä½œæ ‘"
-
-#: contrib/scalar/scalar.c dir.c
-#, c-format
-msgid "could not open directory '%s'"
-msgstr "ä¸èƒ½æ‰“开目录 '%s'"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "skipping '%s', which is neither file nor directory"
-msgstr "跳过 '%s',既ä¸æ˜¯æ–‡ä»¶åˆä¸æ˜¯ç›®å½•"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not determine free disk size for '%s'"
-msgstr "ä¸èƒ½ç¡®å®š '%s' 的空余ç£ç›˜ç©ºé—´"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not get info for '%s'"
-msgstr "ä¸èƒ½èŽ·å¾— '%s' çš„ä¿¡æ¯"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "remote HEAD is not a branch: '%.*s'"
-msgstr "远程 HEAD ä¸æ˜¯ä¸€ä¸ªåˆ†æ”¯ï¼š'%.*s'"
-
-#: contrib/scalar/scalar.c
-msgid "failed to get default branch name from remote; using local default"
-msgstr "无法从远程获å–默认分支å称;使用本地默认值"
-
-#: contrib/scalar/scalar.c
-msgid "failed to get default branch name"
-msgstr "无法获å–默认分支å称"
-
-#: contrib/scalar/scalar.c
-msgid "failed to unregister repository"
-msgstr "无法å–消注册仓库"
-
-#: contrib/scalar/scalar.c
-msgid "failed to delete enlistment directory"
-msgstr "无法删除登记目录"
-
-#: contrib/scalar/scalar.c
-msgid "branch to checkout after clone"
-msgstr "克隆åŽè¦æ£€å‡ºçš„分支"
-
-#: contrib/scalar/scalar.c
-msgid "when cloning, create full working directory"
-msgstr "在克隆时,创建完整的工作目录"
-
-#: contrib/scalar/scalar.c
-msgid "only download metadata for the branch that will be checked out"
-msgstr "åªä¸‹è½½è¦æ£€å‡ºçš„分支的元信æ¯"
-
-#: contrib/scalar/scalar.c
-msgid "scalar clone [<options>] [--] <repo> [<dir>]"
-msgstr "scalar clone [<选项>] [--] <仓库> [<目录>]"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "cannot deduce worktree name from '%s'"
-msgstr "无法从 '%s' 猜测工作区å称"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "directory '%s' exists already"
-msgstr "目录 '%s' 已存在"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "failed to get default branch for '%s'"
-msgstr "æ— æ³•èŽ·å– '%s' 的默认分支"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not configure remote in '%s'"
-msgstr "无法在 '%s' 中é…置远程"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not configure '%s'"
-msgstr "无法é…ç½® '%s'"
-
-#: contrib/scalar/scalar.c
-msgid "partial clone failed; attempting full clone"
-msgstr "部分克隆失败;å°è¯•å®Œæ•´å…‹éš†"
-
-#: contrib/scalar/scalar.c
-msgid "could not configure for full clone"
-msgstr "无法é…置完整克隆"
-
-#: contrib/scalar/scalar.c
-msgid "scalar diagnose [<enlistment>]"
-msgstr "scalar diagnose [<登记>]"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not create directory for '%s'"
-msgstr "ä¸èƒ½ä¸º '%s' 创建目录"
-
-#: contrib/scalar/scalar.c
-msgid "could not duplicate stdout"
-msgstr "ä¸èƒ½å¤åˆ¶æ ‡å‡†è¾“出"
-
-#: contrib/scalar/scalar.c
-msgid "failed to write archive"
-msgstr "无法写入归档"
-
-#: contrib/scalar/scalar.c
-msgid "`scalar list` does not take arguments"
-msgstr "`scalar list` ä¸å¸¦å‚æ•°"
-
-#: contrib/scalar/scalar.c
-msgid "scalar register [<enlistment>]"
-msgstr "scalar register [<登记>]"
-
-#: contrib/scalar/scalar.c
-msgid "reconfigure all registered enlistments"
-msgstr "é‡æ–°é…置所有注册的登记"
-
-#: contrib/scalar/scalar.c
-msgid "scalar reconfigure [--all | <enlistment>]"
-msgstr "scalar reconfigure [--all | <登记>]"
-
-#: contrib/scalar/scalar.c
-msgid "--all or <enlistment>, but not both"
-msgstr "--all 或者 <登记>,而ä¸æ˜¯ä¸¤ä¸ªä¸€èµ·"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "git repository gone in '%s'"
-msgstr "在 '%s' 的 git 仓库已消失"
-
-#: contrib/scalar/scalar.c
-msgid ""
-"scalar run <task> [<enlistment>]\n"
-"Tasks:\n"
-msgstr ""
-"scalar run <任务> [<登记>]\n"
-"任务:\n"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "no such task: '%s'"
-msgstr "没有此任务:'%s'"
-
-#: contrib/scalar/scalar.c
-msgid "scalar unregister [<enlistment>]"
-msgstr "scalar unregister [<登记>]"
-
-#: contrib/scalar/scalar.c
-msgid "scalar delete <enlistment>"
-msgstr "scalar delete <登记>"
-
-#: contrib/scalar/scalar.c
-msgid "refusing to delete current working directory"
-msgstr "æ‹’ç»åˆ é™¤å½“å‰å·¥ä½œç›®å½•"
-
-#: contrib/scalar/scalar.c
-msgid "include Git version"
-msgstr "包括 Git 的版本"
-
-#: contrib/scalar/scalar.c
-msgid "include Git's build options"
-msgstr "包括 Git 的构建选项"
-
-#: contrib/scalar/scalar.c
-msgid "scalar verbose [-v | --verbose] [--build-options]"
-msgstr "scalar verbose [-v | --verbose] [--build-options]"
-
-#: contrib/scalar/scalar.c
-msgid "-C requires a <directory>"
-msgstr "-C éœ€è¦ <目录>"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not change to '%s'"
-msgstr "无法å˜æ›´åˆ° '%s'"
-
-#: contrib/scalar/scalar.c
-msgid "-c requires a <key>=<value> argument"
-msgstr "-c éœ€è¦ <é”®>=<值> å‚æ•°"
-
-#: contrib/scalar/scalar.c
-msgid ""
-"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
-"\n"
-"Commands:\n"
-msgstr ""
-"scalar [-C <目录>] [-c <键>=<值>] <命令> [<选项>]\n"
-"\n"
-"命令:\n"
-
#: convert.c
#, c-format
msgid "illegal crlf_action %d"
@@ -18578,15 +19292,44 @@ msgstr "æ¥è‡ª config çš„æ•°æ®å²›æ­£åˆ™è¡¨è¾¾å¼æœ‰å¤ªå¤šçš„æ•èŽ·ç»„(最多
msgid "Marked %d islands, done.\n"
msgstr "已标记 %d 个数æ®å²›ï¼Œç»“æŸã€‚\n"
+#: diagnose.c
+#, c-format
+msgid "invalid --%s value '%s'"
+msgstr "无效的 --%s 值 '%s'"
+
+#: diagnose.c
+#, c-format
+msgid "could not archive missing directory '%s'"
+msgstr "无法归档缺失的目录 '%s'"
+
+#: diagnose.c dir.c
+#, c-format
+msgid "could not open directory '%s'"
+msgstr "无法打开目录 '%s'"
+
+#: diagnose.c
+#, c-format
+msgid "skipping '%s', which is neither file nor directory"
+msgstr "跳过 '%s',既ä¸æ˜¯æ–‡ä»¶åˆä¸æ˜¯ç›®å½•"
+
+#: diagnose.c
+msgid "could not duplicate stdout"
+msgstr "无法å¤åˆ¶æ ‡å‡†è¾“出"
+
+#: diagnose.c
+#, c-format
+msgid "could not add directory '%s' to archiver"
+msgstr "无法添加目录 '%s' 至归档器"
+
+#: diagnose.c
+msgid "failed to write archive"
+msgstr "无法写入归档"
+
#: diff-lib.c
msgid "--merge-base does not work with ranges"
msgstr "--merge-base ä¸é€‚用于范围"
#: diff-lib.c
-msgid "--merge-base only works with commits"
-msgstr "--merge-base 仅适用于æ交"
-
-#: diff-lib.c
msgid "unable to get HEAD"
msgstr "ä¸èƒ½è§£æž HEAD"
@@ -18599,6 +19342,14 @@ msgid "multiple merge bases found"
msgstr "找到了多æ¡åˆå¹¶åŸºçº¿"
#: diff-no-index.c
+msgid "cannot compare stdin to a directory"
+msgstr "无法将标准输入和目录进行比较"
+
+#: diff-no-index.c
+msgid "cannot compare a named pipe to a directory"
+msgstr "无法将命å管é“和目录进行比较"
+
+#: diff-no-index.c
msgid "git diff --no-index [<options>] <path> <path>"
msgstr "git diff --no-index [<选项>] <路径> <路径>"
@@ -18648,6 +19399,11 @@ msgstr "color-moved-ws:allow-indentation-change ä¸èƒ½ä¸Žå…¶å®ƒç©ºç™½å­—符模
msgid "Unknown value for 'diff.submodule' config variable: '%s'"
msgstr "é…ç½®å˜é‡ 'diff.submodule' 未知的å–值:'%s'"
+#: diff.c transport.c
+#, c-format
+msgid "unknown value for config '%s': %s"
+msgstr "é…ç½® '%s' 未知的å–值:%s"
+
#: diff.c
#, c-format
msgid ""
@@ -18662,6 +19418,15 @@ msgstr ""
msgid "external diff died, stopping at %s"
msgstr "外部 diff 退出,åœæ­¢åœ¨ %s"
+#: diff.c
+msgid "--follow requires exactly one pathspec"
+msgstr "--follow 明确è¦æ±‚åªè·Ÿä¸€ä¸ªè·¯å¾„规格"
+
+#: diff.c
+#, c-format
+msgid "pathspec magic not supported by --follow: %s"
+msgstr "指定 --follow: %s çš„åŒæ—¶ï¼Œä¸æ”¯æŒåœ¨è·¯å¾„规格中使用神奇å‰ç¼€"
+
#: diff.c parse-options.c
#, c-format
msgid "options '%s', '%s', '%s', and '%s' cannot be used together"
@@ -18679,10 +19444,6 @@ msgid ""
msgstr "选项 '%1$s'ã€'%2$s' ä¸èƒ½åŒæ—¶ä½¿ç”¨ï¼Œä¸Ž '%4$s' å’Œ '%5$s' 一起使用 '%3$s'"
#: diff.c
-msgid "--follow requires exactly one pathspec"
-msgstr "--follow 明确è¦æ±‚åªè·Ÿä¸€ä¸ªè·¯å¾„规格"
-
-#: diff.c
#, c-format
msgid "invalid --stat value: %s"
msgstr "无效的 --stat 值:%s"
@@ -18737,13 +19498,6 @@ msgid "invalid mode '%s' in --color-moved-ws"
msgstr "--color-moved-ws ä¸­çš„æ— æ•ˆæ¨¡å¼ '%s' "
#: diff.c
-msgid ""
-"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
-"\"histogram\""
-msgstr ""
-"diff-algorithm 选项有 \"myers\"ã€\"minimal\"ã€\"patience\" å’Œ \"histogram\""
-
-#: diff.c
#, c-format
msgid "invalid argument to %s"
msgstr "%s çš„å‚数无效"
@@ -18800,8 +19554,8 @@ msgid "output only the last line of --stat"
msgstr "åªè¾“出 --stat 的最åŽä¸€è¡Œ"
#: diff.c
-msgid "<param1,param2>..."
-msgstr "<å‚æ•°1,å‚æ•°2>..."
+msgid "<param1>,<param2>..."
+msgstr "<å‚æ•°1>,<å‚æ•°2>..."
#: diff.c
msgid ""
@@ -18813,8 +19567,8 @@ msgid "synonym for --dirstat=cumulative"
msgstr "å’Œ --dirstat=cumulative åŒä¹‰"
#: diff.c
-msgid "synonym for --dirstat=files,param1,param2..."
-msgstr "是 --dirstat=files,param1,param2... çš„åŒä¹‰è¯"
+msgid "synonym for --dirstat=files,<param1>,<param2>..."
+msgstr "是 --dirstat=files,<å‚æ•°1>,<å‚æ•°2>... çš„åŒä¹‰è¯"
#: diff.c
msgid "warn if changes introduce conflict markers or whitespace errors"
@@ -18919,6 +19673,10 @@ msgid "do not show any source or destination prefix"
msgstr "ä¸æ˜¾ç¤ºä»»ä½•æºå’Œç›®æ ‡å‰ç¼€"
#: diff.c
+msgid "use default prefixes a/ and b/"
+msgstr "使用 a/ å’Œ b/ 作为默认å‰ç¼€"
+
+#: diff.c
msgid "show context between diff hunks up to the specified number of lines"
msgstr "显示指定行数的差异å—间的上下文"
@@ -19033,14 +19791,6 @@ msgid "generate diff using the \"histogram diff\" algorithm"
msgstr "使用 \"histogram diff\" 算法生æˆå·®å¼‚"
#: diff.c
-msgid "<algorithm>"
-msgstr "<算法>"
-
-#: diff.c
-msgid "choose a diff algorithm"
-msgstr "选择一个差异算法"
-
-#: diff.c
msgid "<text>"
msgstr "<文本>"
@@ -19287,6 +20037,16 @@ msgstr "ä¸èƒ½ä»Ž '%s' è¿ç§» git 目录到 '%s'"
msgid "hint: Waiting for your editor to close the file...%c"
msgstr "æ示:等待您的编辑器关闭文件...%c"
+#: editor.c sequencer.c wrapper.c
+#, c-format
+msgid "could not write to '%s'"
+msgstr "ä¸èƒ½å†™å…¥ '%s'"
+
+#: editor.c
+#, c-format
+msgid "could not edit '%s'"
+msgstr "ä¸èƒ½ç¼–辑 '%s'"
+
#: entry.c
msgid "Filtering content"
msgstr "过滤内容"
@@ -19328,6 +20088,10 @@ msgid "unable to write to remote"
msgstr "无法写到远程"
#: fetch-pack.c
+msgid "Server supports filter"
+msgstr "æœåŠ¡å™¨æ”¯æŒ filter"
+
+#: fetch-pack.c
#, c-format
msgid "invalid shallow line: %s"
msgstr "无效的 shallow ä¿¡æ¯ï¼š%s"
@@ -19469,10 +20233,6 @@ msgid "Server does not support shallow requests"
msgstr "æœåŠ¡å™¨ä¸æ”¯æŒæµ…克隆请求"
#: fetch-pack.c
-msgid "Server supports filter"
-msgstr "æœåŠ¡å™¨æ”¯æŒ filter"
-
-#: fetch-pack.c
msgid "unable to write request to remote"
msgstr "无法将请求写到远程"
@@ -19596,8 +20356,9 @@ msgstr "虚拟仓库 '%s' 与 fsmonitor ä¸å…¼å®¹"
#: fsmonitor-settings.c
#, c-format
msgid ""
-"repository '%s' is incompatible with fsmonitor due to lack of Unix sockets"
-msgstr "因为缺少 Unix 套接字,仓库 '%s' 与 fsmonitor ä¸å…¼å®¹"
+"socket directory '%s' is incompatible with fsmonitor due to lack of Unix "
+"sockets support"
+msgstr "因为缺少 Unix 套接字支æŒï¼Œå¥—接字目录 '%s' 与 fsmonitor ä¸å…¼å®¹"
#: git.c
msgid ""
@@ -19606,16 +20367,14 @@ msgid ""
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
-" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
-" <command> [<args>]"
+" [--config-env=<name>=<envvar>] <command> [<args>]"
msgstr ""
-"git [-v | --version] [--help] [-C <路径>] [-c <å称>=<å–值>]\n"
+"git [-v | --version] [-h | --help] [-C <路径>] [-c <å称>=<å–值>]\n"
" [--exec-path[=<路径>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<路径>] [--work-tree=<路径>] [--namespace=<å称>]\n"
-" [--super-prefix=<路径>] [--config-env=<å称>=<环境å˜é‡>]\n"
-" <命令> [<å‚æ•°>]"
+" [--config-env=<å称>=<环境å˜é‡>] <命令> [<å‚æ•°>]"
#: git.c
msgid ""
@@ -19646,11 +20405,6 @@ msgstr "没有为 --namespace æ供命å空间\n"
#: git.c
#, c-format
-msgid "no prefix given for --super-prefix\n"
-msgstr "没有为 --super-prefix æä¾›å‰ç¼€\n"
-
-#: git.c
-#, c-format
msgid "-c expects a configuration string\n"
msgstr "应为 -c æ供一个é…置字符串\n"
@@ -19661,6 +20415,11 @@ msgstr "没有为 --config-env æä¾›é…ç½®å称\n"
#: git.c
#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "没有为 --attr-source æ供属性æ¥æº\n"
+
+#: git.c
+#, c-format
msgid "unknown option: %s\n"
msgstr "未知选项:%s\n"
@@ -19783,8 +20542,13 @@ msgid "gpg.ssh.defaultKeyCommand failed: %s %s"
msgstr "gpg.ssh.defaultKeyCommand 失败:%s %s"
#: gpg-interface.c
-msgid "gpg failed to sign the data"
-msgstr "gpg 无法为数æ®ç­¾å"
+#, c-format
+msgid ""
+"gpg failed to sign the data:\n"
+"%s"
+msgstr ""
+"gpg 无法为数æ®ç­¾å:\n"
+"%s"
#: gpg-interface.c
msgid "user.signingKey needs to be set for ssh signing"
@@ -19887,6 +20651,14 @@ msgid "Low-level Commands / Internal Helpers"
msgstr "低级命令/内部助手"
#: help.c
+msgid "User-facing repository, command and file interfaces"
+msgstr "é¢å‘用户的仓库ã€å‘½ä»¤å’Œæ–‡ä»¶æŽ¥å£"
+
+#: help.c
+msgid "Developer-facing file formats, protocols and other interfaces"
+msgstr "é¢å‘å¼€å‘者的文件格å¼ã€å议和其他接å£"
+
+#: help.c
#, c-format
msgid "available git commands in '%s'"
msgstr "在 '%s' 下å¯ç”¨çš„ git 命令"
@@ -19904,6 +20676,14 @@ msgid "The Git concept guides are:"
msgstr "Git 概念å‘导有:"
#: help.c
+msgid "User-facing repository, command and file interfaces:"
+msgstr "é¢å‘用户的仓库ã€å‘½ä»¤å’Œæ–‡ä»¶æŽ¥å£ï¼š"
+
+#: help.c
+msgid "File formats, protocols and other developer interfaces:"
+msgstr "文件格å¼ã€å议和其他开å‘者接å£åˆ—表:"
+
+#: help.c
msgid "External commands"
msgstr "外部命令"
@@ -19968,8 +20748,8 @@ msgstr[1] ""
"最相似的命令是"
#: help.c
-msgid "git version [<options>]"
-msgstr "git version [<选项>]"
+msgid "git version [--build-options]"
+msgstr "git version [--build-options]"
#: help.c
#, c-format
@@ -19999,11 +20779,6 @@ msgstr ""
"å› ä¸ºæ²¡æœ‰å°†é’©å­ '%s' 设置为å¯æ‰§è¡Œï¼Œé’©å­è¢«å¿½ç•¥ã€‚您å¯ä»¥é€šè¿‡\n"
"é…ç½® `git config advice.ignoredHook false` æ¥å…³é—­è¿™æ¡è­¦å‘Šã€‚"
-#: hook.c
-#, c-format
-msgid "Couldn't start hook '%s'\n"
-msgstr "ä¸èƒ½å¯åŠ¨é’©å­ '%s'\n"
-
#: http-fetch.c
#, c-format
msgid "argument to --packfile must be a valid hash (got '%s')"
@@ -20221,20 +20996,16 @@ msgstr "在 ls-refs å‚æ•°åŽåº”该有一个 flush 包"
msgid "quoted CRLF detected"
msgstr "检测到被引用的 CRLF"
-#: merge-ort-wrappers.c merge-recursive.c
-#, c-format
-msgid ""
-"Your local changes to the following files would be overwritten by merge:\n"
-" %s"
-msgstr ""
-"您对下列文件的本地修改将被åˆå¹¶æ“作覆盖:\n"
-" %s"
-
#: merge-ort.c merge-recursive.c
#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "无法åˆå¹¶å­æ¨¡ç»„ %s (没有检出)"
+#: merge-ort.c
+#, c-format
+msgid "Failed to merge submodule %s (no merge base)"
+msgstr "无法åˆå¹¶å­æ¨¡ç»„ %s (没有åˆå¹¶åŸºçº¿ï¼‰"
+
#: merge-ort.c merge-recursive.c
#, c-format
msgid "Failed to merge submodule %s (commits not present)"
@@ -20258,27 +21029,8 @@ msgstr "无法åˆå¹¶å­æ¨¡ç»„ %s"
#: merge-ort.c
#, c-format
msgid ""
-"Failed to merge submodule %s, but a possible merge resolution exists:\n"
-"%s\n"
-msgstr ""
-"无法åˆå¹¶å­æ¨¡ç»„ %s,但是存在一个å¯èƒ½çš„åˆå¹¶æ–¹æ¡ˆï¼š\n"
-"%s\n"
-
-#: merge-ort.c merge-recursive.c
-#, c-format
-msgid ""
-"If this is correct simply add it to the index for example\n"
-"by using:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"which will accept this suggestion.\n"
-msgstr ""
-"如果这个正确,将其添加到索引,例如使用命令:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"以接å—此建议。\n"
+"Failed to merge submodule %s, but a possible merge resolution exists: %s"
+msgstr "无法åˆå¹¶å­æ¨¡ç»„ %s,但是存在一个å¯èƒ½çš„åˆå¹¶æ–¹æ¡ˆï¼š%s"
#: merge-ort.c
#, c-format
@@ -20290,12 +21042,12 @@ msgstr ""
"%s"
#: merge-ort.c merge-recursive.c
-msgid "Failed to execute internal merge"
+msgid "failed to execute internal merge"
msgstr "无法执行内部åˆå¹¶"
#: merge-ort.c merge-recursive.c
#, c-format
-msgid "Unable to add %s to database"
+msgid "unable to add %s to database"
msgstr "ä¸èƒ½æ·»åŠ  %s 至对象库"
#: merge-ort.c merge-recursive.c
@@ -20455,12 +21207,45 @@ msgstr ""
"冲çªï¼ˆä¿®æ”¹/删除):%1$s 在 %2$s 中被删除,在 %3$s 中被修改。%5$s çš„ %4$s 版本"
"在树中被ä¿ç•™ã€‚"
+#. TRANSLATORS: This is a line of advice to resolve a merge
+#. conflict in a submodule. The first argument is the submodule
+#. name, and the second argument is the abbreviated id of the
+#. commit that needs to be merged. For example:
+#. - go to submodule (mysubmodule), and either merge commit abc1234"
+#.
#: merge-ort.c
#, c-format
msgid ""
-"Note: %s not up to date and in way of checking out conflicted version; old "
-"copy renamed to %s"
-msgstr "注æ„:%s ä¸æ˜¯æœ€æ–°çš„,并且与è¦æ£€å‡ºçš„版本冲çªã€‚旧副本é‡å‘½å为 %s"
+" - go to submodule (%s), and either merge commit %s\n"
+" or update to an existing commit which has merged those changes\n"
+msgstr ""
+" - 进入å­æ¨¡ç»„(%s),è¦ä¹ˆåˆå¹¶æ交 %s\n"
+" è¦ä¹ˆæ›´æ–°è‡³å·²åˆå¹¶è¿™äº›å˜æ›´çš„æ交\n"
+
+#: merge-ort.c
+#, c-format
+msgid ""
+"Recursive merging with submodules currently only supports trivial cases.\n"
+"Please manually handle the merging of each conflicted submodule.\n"
+"This can be accomplished with the following steps:\n"
+"%s - come back to superproject and run:\n"
+"\n"
+" git add %s\n"
+"\n"
+" to record the above merge or update\n"
+" - resolve any other conflicts in the superproject\n"
+" - commit the resulting index in the superproject\n"
+msgstr ""
+"å­æ¨¡ç»„内的递归åˆå¹¶çŽ°åœ¨åªæ”¯æŒç®€å•çš„情况。\n"
+"请手动åˆå¹¶æ¯ä¸ªæœ‰å†²çªçš„å­æ¨¡ç»„。\n"
+"è¿™å¯ä»¥é€šè¿‡ä¸‹åˆ—步骤完æˆï¼š\n"
+"%s - 回到上级项目并è¿è¡Œï¼š\n"
+"\n"
+" git add %s\n"
+"\n"
+" æ¥è®°å½•ä¸Šè¿°çš„åˆå¹¶æˆ–æ›´æ–°\n"
+" - 解决上级项目中的其他冲çª\n"
+" - æ交上级项目中的结果索引\n"
#. TRANSLATORS: The %s arguments are: 1) tree hash of a merge
#. base, and 2-3) the trees for the two trees we're merging.
@@ -20549,6 +21334,22 @@ msgstr "找到å­æ¨¡ç»„的一个å¯èƒ½çš„åˆå¹¶æ–¹æ¡ˆï¼š\n"
#: merge-recursive.c
#, c-format
+msgid ""
+"If this is correct simply add it to the index for example\n"
+"by using:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"which will accept this suggestion.\n"
+msgstr ""
+"如果这个正确,将其添加到索引,例如使用命令:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"以接å—此建议。\n"
+
+#: merge-recursive.c
+#, c-format
msgid "Failed to merge submodule %s (multiple merges found)"
msgstr "无法åˆå¹¶å­æ¨¡ç»„ %s (å‘现多个åˆå¹¶ï¼‰"
@@ -20742,7 +21543,21 @@ msgstr "无法读å–缓存"
#: midx.c
msgid "multi-pack-index OID fanout is of the wrong size"
-msgstr "多包索引的对象ID扇出表大å°é”™è¯¯"
+msgstr "多包索引的对象 ID 扇出表大å°é”™è¯¯"
+
+#: midx.c
+#, c-format
+msgid ""
+"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
+msgstr "对象 ID 扇出失åºï¼šfanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
+
+#: midx.c
+msgid "multi-pack-index OID lookup chunk is the wrong size"
+msgstr "多包索引的对象 ID 查询å—大å°é”™è¯¯"
+
+#: midx.c
+msgid "multi-pack-index object offset chunk is the wrong size"
+msgstr "多包索引的对象 ID å移å—大å°é”™è¯¯"
#: midx.c
#, c-format
@@ -20765,20 +21580,24 @@ msgid "multi-pack-index hash version %u does not match version %u"
msgstr "多包索引哈希版本 %u 和版本 %u ä¸åŒ¹é…"
#: midx.c
-msgid "multi-pack-index missing required pack-name chunk"
-msgstr "多包索引缺少必需的包åå—"
+msgid "multi-pack-index required pack-name chunk missing or corrupted"
+msgstr "多包索引必需的包åå—缺失或æŸå"
+
+#: midx.c
+msgid "multi-pack-index required OID fanout chunk missing or corrupted"
+msgstr "多包索引必需的对象 ID 扇出å—缺失或æŸå"
#: midx.c
-msgid "multi-pack-index missing required OID fanout chunk"
-msgstr "多包索引缺少必需的对象 ID 扇出å—"
+msgid "multi-pack-index required OID lookup chunk missing or corrupted"
+msgstr "多包索引必需的对象 ID 查询å—缺失或æŸå"
#: midx.c
-msgid "multi-pack-index missing required OID lookup chunk"
-msgstr "多包索引缺少必需的对象 ID 查询å—"
+msgid "multi-pack-index required object offsets chunk missing or corrupted"
+msgstr "多包索引必需的对象å移å—缺少或æŸå"
#: midx.c
-msgid "multi-pack-index missing required object offsets chunk"
-msgstr "多包索引缺少必需的对象å移å—"
+msgid "multi-pack-index pack-name chunk is too short"
+msgstr "多包索引包åå—过短"
#: midx.c
#, c-format
@@ -20791,10 +21610,23 @@ msgid "bad pack-int-id: %u (%u total packs)"
msgstr "错的 pack-int-id:%u(共有 %u 个包)"
#: midx.c
+msgid "MIDX does not contain the BTMP chunk"
+msgstr "å¤šåŒ…ç´¢å¼•ä¸­æœªåŒ…å« BTMP å—"
+
+#: midx.c
+#, c-format
+msgid "could not load bitmapped pack %<PRIu32>"
+msgstr "ä¸èƒ½æ‰“开已被ä½å›¾ç´¢å¼•çš„包 %<PRIu32>"
+
+#: midx.c
msgid "multi-pack-index stores a 64-bit offset, but off_t is too small"
msgstr "多包索引存储一个64ä½å移,但是 off_t 太å°"
#: midx.c
+msgid "multi-pack-index large offset out of bounds"
+msgstr "多包索引大å移区越界"
+
+#: midx.c
#, c-format
msgid "failed to add packfile '%s'"
msgstr "无法添加包文件 '%s'"
@@ -20894,12 +21726,6 @@ msgid "Looking for referenced packfiles"
msgstr "正在查找引用的包文件"
#: midx.c
-#, c-format
-msgid ""
-"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
-msgstr "对象 ID 扇出无åºï¼šfanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
-
-#: midx.c
msgid "the midx contains no oid"
msgstr "midx ä¸åŒ…å« oid"
@@ -21021,11 +21847,6 @@ msgid "%s: ignoring alternate object stores, nesting too deep"
msgstr "%s:忽略备用对象库,嵌套太深"
#: object-file.c
-#, c-format
-msgid "unable to normalize object directory: %s"
-msgstr "无法规范化对象目录: %s"
-
-#: object-file.c
msgid "unable to fdopen alternates lockfile"
msgstr "无法 fdopen 替æ¢é”文件"
@@ -21099,6 +21920,11 @@ msgstr "æ¾æ•£å¯¹è±¡ '%s' åŽé¢æœ‰åžƒåœ¾æ•°æ®"
#: object-file.c
#, c-format
+msgid "unable to open loose object %s"
+msgstr "无法打开æ¾æ•£å¯¹è±¡ %s"
+
+#: object-file.c
+#, c-format
msgid "unable to parse %s header"
msgstr "æ— æ³•è§£æž %s 头部"
@@ -21118,8 +21944,8 @@ msgstr "%s 的头部太长,超出了 %d 字节"
#: object-file.c
#, c-format
-msgid "failed to read object %s"
-msgstr "无法读å–对象 %s"
+msgid "loose object %s (stored in %s) is corrupt"
+msgstr "æ¾æ•£å¯¹è±¡ %s(ä¿å­˜åœ¨ %s)已æŸå"
#: object-file.c
#, c-format
@@ -21128,11 +21954,6 @@ msgstr "找ä¸åˆ° %2$s 的替代 %1$s"
#: object-file.c
#, c-format
-msgid "loose object %s (stored in %s) is corrupt"
-msgstr "æ¾æ•£å¯¹è±¡ %s(ä¿å­˜åœ¨ %s)已æŸå"
-
-#: object-file.c
-#, c-format
msgid "packed object %s (stored in %s) is corrupt"
msgstr "打包对象 %s(ä¿å­˜åœ¨ %s)已æŸå"
@@ -21147,10 +21968,6 @@ msgid "unable to set permission to '%s'"
msgstr "无法为 '%s' 设置æƒé™"
#: object-file.c
-msgid "file write error"
-msgstr "文件写错误"
-
-#: object-file.c
msgid "error when closing loose object file"
msgstr "关闭æ¾æ•£å¯¹è±¡æ–‡ä»¶æ—¶å‡ºé”™"
@@ -21184,16 +22001,37 @@ msgstr "被 %s çš„ä¸ç¨³å®šå¯¹è±¡æºæ•°æ®æžç³Šæ¶‚了"
#: object-file.c
#, c-format
+msgid "write stream object %ld != %<PRIuMAX>"
+msgstr "写入æµå¯¹è±¡ %ld != %<PRIuMAX>"
+
+#: object-file.c
+#, c-format
+msgid "unable to stream deflate new object (%d)"
+msgstr "ä¸èƒ½æµå¼åŽ‹ç¼©æ–°å¯¹è±¡ï¼ˆ%d)"
+
+#: object-file.c
+#, c-format
+msgid "deflateEnd on stream object failed (%d)"
+msgstr "在æµå¯¹è±¡ä¸Šè°ƒç”¨ deflateEnd 失败(%d)"
+
+#: object-file.c
+#, c-format
+msgid "unable to create directory %s"
+msgstr "无法创建目录 %s"
+
+#: object-file.c
+#, c-format
msgid "cannot read object for %s"
msgstr "ä¸èƒ½è¯»å–对象 %s"
#: object-file.c
-msgid "corrupt commit"
-msgstr "æŸåçš„æ交"
+#, c-format
+msgid "object fails fsck: %s"
+msgstr "对象 fsck 失败:%s"
#: object-file.c
-msgid "corrupt tag"
-msgstr "æŸå的标签"
+msgid "refusing to create malformed object"
+msgstr "æ‹’ç»åˆ›å»ºæ ¼å¼é”™è¯¯çš„对象"
#: object-file.c
#, c-format
@@ -21447,6 +22285,66 @@ msgstr "ä¸èƒ½è§£æžå¯¹è±¡ï¼š%s"
msgid "hash mismatch %s"
msgstr "哈希值与 %s ä¸åŒ¹é…"
+#: pack-bitmap-write.c
+msgid "trying to write commit not in index"
+msgstr "å°è¯•å†™å…¥æœªåœ¨ç´¢å¼•ä¸­çš„æ交"
+
+#: pack-bitmap.c
+msgid "failed to load bitmap index (corrupted?)"
+msgstr "无法载入ä½å›¾ç´¢å¼•ï¼ˆå·²æŸå?)"
+
+#: pack-bitmap.c
+msgid "corrupted bitmap index (too small)"
+msgstr "æŸåçš„ä½å›¾ç´¢å¼•ï¼ˆå¤ªå°ï¼‰"
+
+#: pack-bitmap.c
+msgid "corrupted bitmap index file (wrong header)"
+msgstr "æŸåçš„ä½å›¾ç´¢å¼•ï¼ˆé”™è¯¯çš„文件头)"
+
+#: pack-bitmap.c
+#, c-format
+msgid "unsupported version '%d' for bitmap index file"
+msgstr "ä¸æ”¯æŒçš„ä½å›¾ç´¢å¼•æ–‡ä»¶ç‰ˆæœ¬ '%d'"
+
+#: pack-bitmap.c
+msgid "corrupted bitmap index file (too short to fit hash cache)"
+msgstr "æŸåçš„ä½å›¾ç´¢å¼•ï¼ˆå¤ªå°ï¼Œå®¹ä¸ä¸‹å“ˆå¸Œç¼“存)"
+
+#: pack-bitmap.c
+msgid "corrupted bitmap index file (too short to fit lookup table)"
+msgstr "æŸåçš„ä½å›¾ç´¢å¼•ï¼ˆå¤ªå°ï¼Œå®¹ä¸ä¸‹æŸ¥è¯¢è¡¨ï¼‰"
+
+#: pack-bitmap.c
+#, c-format
+msgid "duplicate entry in bitmap index: '%s'"
+msgstr "ä½å›¾ç´¢å¼•ä¸­çš„é‡å¤æ¡ç›®ï¼š'%s'"
+
+#: pack-bitmap.c
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for entry %d"
+msgstr "æŸåçš„ EWAH ä½å›¾ï¼šæ¡ç›® %d 截断的文件头"
+
+#: pack-bitmap.c
+#, c-format
+msgid "corrupt ewah bitmap: commit index %u out of range"
+msgstr "æŸåçš„ EWAH ä½å›¾ï¼šæ交索引 %u 超出范围"
+
+#: pack-bitmap.c
+msgid "corrupted bitmap pack index"
+msgstr "æŸåçš„ä½å›¾åŒ…索引"
+
+#: pack-bitmap.c
+msgid "invalid XOR offset in bitmap pack index"
+msgstr "ä½å›¾åŒ…索引中 XOR å移值无效"
+
+#: pack-bitmap.c
+msgid "cannot fstat bitmap file"
+msgstr "ä¸èƒ½å¯¹ä½å›¾æ–‡ä»¶è°ƒç”¨ fstat"
+
+#: pack-bitmap.c
+msgid "checksum doesn't match in MIDX and bitmap"
+msgstr "MIDX å’Œä½å›¾ä¸­çš„校验ç ä¸åŒ¹é…"
+
#: pack-bitmap.c
msgid "multi-pack bitmap is missing required reverse index"
msgstr "多包ä½å›¾ç¼ºå°‘必需的åå‘索引"
@@ -21456,15 +22354,89 @@ 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 "æŸåçš„ä½å›¾æŸ¥è¯¢è¡¨ï¼šä¸‰å…ƒç»„ä½ç½®è¶…出索引"
+
+#: pack-bitmap.c
+msgid "corrupt bitmap lookup table: xor chain exceeds entry count"
+msgstr "æŸåçš„ä½å›¾æŸ¥è¯¢è¡¨ï¼šxor 链超出æ¡ç›®æ•°"
+
+#: pack-bitmap.c
+#, c-format
+msgid "corrupt bitmap lookup table: commit index %u out of range"
+msgstr "æŸåçš„ä½å›¾æŸ¥è¯¢è¡¨ï¼šæ交索引 %u 超出范围"
+
+#: pack-bitmap.c
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for bitmap of commit \"%s\""
+msgstr "æŸåçš„ EWAH ä½å›¾ï¼šæ交 \"%s\" ä½å›¾çš„文件头被截断"
+
+#: pack-bitmap.c
+#, c-format
+msgid "unable to load pack: '%s', disabling pack-reuse"
+msgstr "无法打开包:'%s',ç¦ç”¨åŒ…é‡ç”¨"
+
+#: pack-bitmap.c
+#, c-format
+msgid "object '%s' not found in type bitmaps"
+msgstr "对象 %s 为在类型ä½å›¾ä¸­æ‰¾åˆ°"
+
+#: pack-bitmap.c
+#, c-format
+msgid "object '%s' does not have a unique type"
+msgstr "对象 '%s' 没有唯一的类型"
+
+#: pack-bitmap.c
+#, c-format
+msgid "object '%s': real type '%s', expected: '%s'"
+msgstr "对象 '%s':实际类型 '%s',预期:'%s'"
+
+#: pack-bitmap.c
+#, c-format
+msgid "object not in bitmap: '%s'"
+msgstr "对象ä¸åœ¨ä½å›¾ä¸­ï¼š%s"
+
+#: pack-bitmap.c
+msgid "failed to load bitmap indexes"
+msgstr "无法载入ä½å›¾ç´¢å¼•"
+
+#: pack-bitmap.c
+msgid "you must specify exactly one commit to test"
+msgstr "您必须准确指定一个æ交æ¥æµ‹è¯•"
+
+#: pack-bitmap.c
#, c-format
-msgid "could not find %s in pack %s at offset %<PRIuMAX>"
-msgstr "在包 %2$s å移 %3$<PRIuMAX> 中无法找到 %1$s"
+msgid "commit '%s' doesn't have an indexed bitmap"
+msgstr "æ交 '%s' 没有索引ä½å›¾"
+
+#: pack-bitmap.c
+msgid "mismatch in bitmap results"
+msgstr "ä½å›¾ç»“æžœä¸ä¸€è‡´"
+
+#: pack-bitmap.c
+#, c-format
+msgid "could not find '%s' in pack '%s' at offset %<PRIuMAX>"
+msgstr "无法在包 '%2$s' å移 %3$<PRIuMAX> 中找到 '%1$s'"
+
+#: pack-bitmap.c
+#, c-format
+msgid "unable to get disk usage of '%s'"
+msgstr "无法得到 '%s' çš„ç£ç›˜ä½¿ç”¨é‡"
+
+#: pack-bitmap.c
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "ä½å›¾æ–‡ä»¶ '%s' 有无效的校验ç "
#: pack-mtimes.c
#, c-format
@@ -21516,6 +22488,23 @@ msgstr "åå‘索引文件 %s ä¸æ”¯æŒçš„版本 %<PRIu32>"
msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
msgstr "åå‘索引文件 %s 有ä¸æ”¯æŒçš„哈希 ID %<PRIu32>"
+#: pack-revindex.c
+msgid "invalid checksum"
+msgstr "æ— æ•ˆçš„æ ¡éªŒç  %s"
+
+#: pack-revindex.c
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr "ä½äºŽ %<PRIu64> 的无效的åå‘索引:%<PRIu32> != %<PRIu32>"
+
+#: pack-revindex.c
+msgid "multi-pack-index reverse-index chunk is the wrong size"
+msgstr "多包索引的åå‘索引å—大å°é”™è¯¯"
+
+#: pack-revindex.c
+msgid "could not determine preferred pack"
+msgstr "无法确定首选包"
+
#: pack-write.c
msgid "cannot both write and verify reverse index"
msgstr "无法åŒæ—¶å†™å…¥å’Œæ ¡éªŒåå‘索引"
@@ -21581,16 +22570,6 @@ msgstr "%s 需è¦ä¸€ä¸ªå€¼"
#: parse-options.c
#, c-format
-msgid "%s is incompatible with %s"
-msgstr "%s 与 %s ä¸å…¼å®¹"
-
-#: parse-options.c
-#, c-format
-msgid "%s : incompatible with something else"
-msgstr "%s:和其它的ä¸å…¼å®¹"
-
-#: parse-options.c
-#, c-format
msgid "%s takes no value"
msgstr "%s ä¸å–值"
@@ -21620,6 +22599,10 @@ msgid "alias of --%s"
msgstr "--%s 的别å"
#: parse-options.c
+msgid "need a subcommand"
+msgstr "需è¦ä¸€ä¸ªå­å‘½ä»¤"
+
+#: parse-options.c
#, c-format
msgid "unknown option `%s'"
msgstr "未知选项 `%s'"
@@ -21685,6 +22668,11 @@ msgstr " %s"
msgid "-NUM"
msgstr "-æ•°å­—"
+#: parse-options.c
+#, c-format
+msgid "opposite of --no-%s"
+msgstr "与 --no-%s 相å"
+
#: parse-options.h
msgid "expiry-date"
msgstr "到期时间"
@@ -21706,6 +22694,10 @@ msgid "use <n> digits to display object names"
msgstr "用 <n> ä½æ•°å­—显示对象å"
#: parse-options.h
+msgid "prefixed path to initial superproject"
+msgstr "用æ¥åˆå§‹åŒ–父项目的å‰ç¼€è·¯å¾„"
+
+#: parse-options.h
msgid "how to strip spaces and #comments from message"
msgstr "设置如何删除æ交说明里的空格和#注释"
@@ -21718,6 +22710,16 @@ msgid ""
"with --pathspec-from-file, pathspec elements are separated with NUL character"
msgstr "使用 --pathspec-from-file,路径表达å¼ç”¨ç©ºå­—符分隔"
+#: parse.c
+#, c-format
+msgid "bad boolean environment value '%s' for '%s'"
+msgstr "对于 '%2$s' 的错误的布尔环境å–值 '%1$s'"
+
+#: parse.c
+#, c-format
+msgid "failed to parse %s"
+msgstr "æ— æ³•è§£æž %s"
+
#: path.c
#, c-format
msgid "Could not make %s writable by group"
@@ -21776,6 +22778,11 @@ msgstr "%s:'literal' å’Œ 'glob' ä¸å…¼å®¹"
#: pathspec.c
#, c-format
+msgid "'%s' is outside the directory tree"
+msgstr "'%s' ä½äºŽç›®å½•æ ‘之外"
+
+#: pathspec.c
+#, c-format
msgid "%s: '%s' is outside repository at '%s'"
msgstr "%s:'%s' 在ä½äºŽ '%s' 的仓库之外"
@@ -21885,6 +22892,11 @@ msgstr "promisor-remote:无法关闭至 fetch å­è¿›ç¨‹çš„标准输入"
msgid "promisor remote name cannot begin with '/': %s"
msgstr "promisor 远程å称ä¸èƒ½ä»¥ '/' 开始:%s"
+#: promisor-remote.c
+#, c-format
+msgid "could not fetch %s from promisor remote"
+msgstr "æ— æ³•ä»Žæ‰¿è¯ºè€…è¿œç¨‹èŽ·å– %s"
+
#: protocol-caps.c
msgid "object-info: expected flush after arguments"
msgstr "object-info:在å‚数之åŽåº”有一个 flush"
@@ -21927,6 +22939,15 @@ msgstr "æ— æ³•ç”Ÿæˆ diff"
msgid "could not parse log for '%s'"
msgstr "ä¸èƒ½è§£æž '%s' 的日志"
+#: reachable.c
+#, c-format
+msgid "invalid extra cruft tip: '%s'"
+msgstr "无效的é¢å¤–废弃æ交版本:'%s'"
+
+#: reachable.c
+msgid "unable to enumerate additional recent objects"
+msgstr "无法枚举é¢å¤–的近期对象"
+
#: read-cache.c
#, c-format
msgid "will not add file alias '%s' ('%s' already exists in index)"
@@ -21953,11 +22974,6 @@ msgstr "无法在索引中添加 '%s'"
#: read-cache.c
#, c-format
-msgid "unable to stat '%s'"
-msgstr "无法对 %s 执行 stat"
-
-#: read-cache.c
-#, c-format
msgid "'%s' appears as both a file and as a directory"
msgstr "'%s' 看起æ¥æ—¢æ˜¯æ–‡ä»¶åˆæ˜¯ç›®å½•"
@@ -22091,11 +23107,6 @@ msgstr "无法转æ¢ä¸ºç¨€ç–索引"
#: read-cache.c
#, c-format
-msgid "could not stat '%s'"
-msgstr "ä¸èƒ½å¯¹ '%s' 调用 stat"
-
-#: read-cache.c
-#, c-format
msgid "unable to open git dir: %s"
msgstr "ä¸èƒ½æ‰“å¼€ git 目录:%s"
@@ -22114,6 +23125,16 @@ msgstr "ä¸èƒ½ä¿®å¤ '%s' çš„æƒé™ä½"
msgid "%s: cannot drop to stage #0"
msgstr "%s:ä¸èƒ½è½åˆ°æš‚存区 #0"
+#: read-cache.c
+#, c-format
+msgid "unexpected diff status %c"
+msgstr "æ„å¤–çš„å·®å¼‚çŠ¶æ€ %c"
+
+#: read-cache.c
+#, c-format
+msgid "remove '%s'\n"
+msgstr "删除 '%s'\n"
+
#: rebase-interactive.c
msgid ""
"You can fix this with 'git rebase --edit-todo' and then run 'git rebase --"
@@ -22147,9 +23168,12 @@ msgid ""
"l, label <label> = label current HEAD with a name\n"
"t, reset <label> = reset HEAD to a label\n"
"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
-". create a merge commit using the original merge commit's\n"
-". message (or the oneline, if no original merge commit was\n"
-". specified); use -c <commit> to reword the commit message\n"
+" create a merge commit using the original merge commit's\n"
+" message (or the oneline, if no original merge commit was\n"
+" specified); use -c <commit> to reword the commit message\n"
+"u, update-ref <ref> = track a placeholder for the <ref> to be updated\n"
+" to this position in the new commits. The <ref> is\n"
+" updated at the end of the rebase\n"
"\n"
"These lines can be re-ordered; they are executed from top to bottom.\n"
msgstr ""
@@ -22157,7 +23181,7 @@ msgstr ""
"命令:\n"
"p, pick <æ交> = 使用æ交\n"
"r, reword <æ交> = 使用æ交,但编辑æ交说明\n"
-"e, edit <æ交> = 使用æ交,但åœæ­¢ä»¥ä¾¿åœ¨ shell 中修补æ交\n"
+"e, edit <æ交> = 使用æ交,但åœæ­¢ä»¥ä¾¿ä¿®è¡¥æ交\n"
"s, squash <æ交> = 使用æ交,但挤压到å‰ä¸€ä¸ªæ交\n"
"f, fixup [-C | -c] <æ交> = 类似于 \"squash\",但åªä¿ç•™å‰ä¸€ä¸ªæ交\n"
" çš„æ交说明,除éžä½¿ç”¨äº† -C å‚数,此情况下则åª\n"
@@ -22172,6 +23196,9 @@ msgstr ""
". 创建一个åˆå¹¶æ交,并使用原始的åˆå¹¶æ交说明(如果没有指定\n"
". 原始æ交,使用注释部分的 oneline 作为æ交说明)。使用\n"
". -c <æ交> å¯ä»¥ç¼–辑æ交说明。\n"
+"u, update-ref <引用> = 为引用 <ref> 设置一个å ä½ç¬¦ï¼Œä»¥å°†è¯¥å¼•ç”¨æ›´æ–°ä¸ºæ­¤å¤„çš„æ–°"
+"æ交。\n"
+" æ­¤ <引用> 在å˜åŸºç»“æŸåŽæ›´æ–°ã€‚\n"
"\n"
"å¯ä»¥å¯¹è¿™äº›è¡Œé‡æ–°æŽ’åºï¼Œå°†ä»Žä¸Šè‡³ä¸‹æ‰§è¡Œã€‚\n"
@@ -22278,6 +23305,16 @@ msgstr "领先 %d,è½åŽ %d"
#: ref-filter.c
#, c-format
+msgid "%%(%.*s) does not take arguments"
+msgstr "%%(%.*s) ä¸å¸¦å‚æ•°"
+
+#: ref-filter.c
+#, c-format
+msgid "unrecognized %%(%.*s) argument: %s"
+msgstr "未能识别的 %%(%.*s) å‚数:%s"
+
+#: ref-filter.c
+#, c-format
msgid "expected format: %%(color:<color>)"
msgstr "期望的格å¼ï¼š%%(color:<颜色>)"
@@ -22298,38 +23335,38 @@ msgstr "期望整数值 refname:rstrip=%s"
#: ref-filter.c
#, c-format
-msgid "unrecognized %%(%s) argument: %s"
-msgstr "未能识别的 %%(%s) å‚数:%s"
+msgid "expected %%(trailers:key=<value>)"
+msgstr "预期 %%(trailers:key=<值>)"
#: ref-filter.c
#, c-format
-msgid "%%(objecttype) does not take arguments"
-msgstr "%%(objecttype) ä¸å¸¦å‚æ•°"
+msgid "unknown %%(trailers) argument: %s"
+msgstr "未知的 %%(trailers) å‚数:%s"
#: ref-filter.c
#, c-format
-msgid "%%(deltabase) does not take arguments"
-msgstr "%%(deltabase) ä¸å¸¦å‚æ•°"
+msgid "positive value expected contents:lines=%s"
+msgstr "期望一个正数 contents:lines=%s"
#: ref-filter.c
#, c-format
-msgid "%%(body) does not take arguments"
-msgstr "%%(body) ä¸å¸¦å‚æ•°"
+msgid "argument expected for %s"
+msgstr "预期å‚æ•° %s"
#: ref-filter.c
#, c-format
-msgid "expected %%(trailers:key=<value>)"
-msgstr "预期 %%(trailers:key=<值>)"
+msgid "positive value expected %s=%s"
+msgstr "预期正数å‚数值 %s=%s"
#: ref-filter.c
#, c-format
-msgid "unknown %%(trailers) argument: %s"
-msgstr "未知的 %%(trailers) å‚数:%s"
+msgid "cannot fully parse %s=%s"
+msgstr "ä¸èƒ½å®Œæ•´è§£æž %s=%s"
#: ref-filter.c
#, c-format
-msgid "positive value expected contents:lines=%s"
-msgstr "期望一个正数 contents:lines=%s"
+msgid "value expected %s="
+msgstr "预期值 %s="
#: ref-filter.c
#, c-format
@@ -22338,11 +23375,6 @@ msgstr "期望 %%(%2$s) 中的 '%1$s' 是一个正数"
#: ref-filter.c
#, c-format
-msgid "unrecognized email option: %s"
-msgstr "未识别的邮件选项:%s"
-
-#: ref-filter.c
-#, c-format
msgid "expected format: %%(align:<width>,<position>)"
msgstr "期望的格å¼ï¼š%%(align:<宽度>,<ä½ç½®>)"
@@ -22358,13 +23390,18 @@ msgstr "未能识别的宽度:%s"
#: ref-filter.c
#, c-format
+msgid "unrecognized %%(%s) argument: %s"
+msgstr "未能识别的 %%(%s) å‚数:%s"
+
+#: ref-filter.c
+#, c-format
msgid "positive width expected with the %%(align) atom"
msgstr "元素 %%(align) 需è¦ä¸€ä¸ªæ­£æ•°çš„宽度"
#: ref-filter.c
#, c-format
-msgid "%%(rest) does not take arguments"
-msgstr "%%(rest) ä¸å¸¦å‚æ•°"
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "期望的格å¼ï¼š%%(ahead-behind:<æ交å·>)"
#: ref-filter.c
#, c-format
@@ -22423,6 +23460,10 @@ msgid "--format=%.*s cannot be used with --python, --shell, --tcl"
msgstr "--format=%.*s ä¸èƒ½å’Œ --pythonã€--shellã€--tcl åŒæ—¶ä½¿ç”¨"
#: ref-filter.c
+msgid "failed to run 'describe'"
+msgstr "无法è¿è¡Œ 'describe'"
+
+#: ref-filter.c
#, c-format
msgid "(no branch, rebasing %s)"
msgstr "(éžåˆ†æ”¯ï¼Œæ­£å˜åŸº %s)"
@@ -22499,6 +23540,10 @@ msgstr "key"
msgid "field name to sort on"
msgstr "排åºçš„字段å"
+#: ref-filter.h
+msgid "exclude refs which match pattern"
+msgstr "排除与 <模å¼> 相匹é…的引用"
+
#: reflog.c
#, c-format
msgid "not a reflog: %s"
@@ -22601,17 +23646,12 @@ msgstr "'%s' 已存在,无法创建 '%s'"
msgid "cannot process '%s' and '%s' at the same time"
msgstr "无法åŒæ—¶å¤„ç† '%s' å’Œ '%s'"
-#: refs/files-backend.c
-#, c-format
-msgid "could not remove reference %s"
-msgstr "无法删除引用 %s"
-
-#: refs/files-backend.c refs/packed-backend.c
+#: refs.c
#, c-format
msgid "could not delete reference %s: %s"
msgstr "无法删除引用 %s:%s"
-#: refs/files-backend.c refs/packed-backend.c
+#: refs.c
#, c-format
msgid "could not delete references: %s"
msgstr "无法删除引用:%s"
@@ -22738,6 +23778,15 @@ msgid "http transport does not support %s"
msgstr "http 传输åè®®ä¸æ”¯æŒ %s"
#: remote-curl.c
+msgid "protocol error: expected '<url> <path>', missing space"
+msgstr "å议错误:预期 '<url> <path>',缺少空格"
+
+#: remote-curl.c
+#, c-format
+msgid "failed to download file at URL '%s'"
+msgstr "无法下载ä½äºŽ URL '%s' 的文件"
+
+#: remote-curl.c
msgid "git-http-push failed"
msgstr "git-http-push 失败"
@@ -23019,8 +24068,9 @@ msgstr[1] ""
# 译者:注æ„ä¿æŒå‰å¯¼ç©ºæ ¼
#: remote.c
-msgid " (use \"git pull\" to merge the remote branch into yours)\n"
-msgstr " (使用 \"git pull\" æ¥åˆå¹¶è¿œç¨‹åˆ†æ”¯ï¼‰\n"
+msgid ""
+" (use \"git pull\" if you want to integrate the remote branch with yours)\n"
+msgstr " (如果您想将远程分支与您的更改åˆå¹¶ï¼Œè¯·ä½¿ç”¨ \"git pull\")\n"
#: remote.c
#, c-format
@@ -23112,11 +24162,6 @@ msgstr "没有为 '%s' 记忆的解决方案"
#: rerere.c
#, c-format
-msgid "cannot unlink '%s'"
-msgstr "ä¸èƒ½åˆ é™¤ '%s'"
-
-#: rerere.c
-#, c-format
msgid "Updated preimage for '%s'"
msgstr "已为 '%s' 更新 preimage"
@@ -23143,10 +24188,34 @@ msgid "failed to find tree of %s"
msgstr "无法找到 %s 指å‘çš„æ ‘"
#: revision.c
+#, c-format
+msgid "unsupported section for hidden refs: %s"
+msgstr "ä¸æ”¯æŒçš„éšè—引用片段: %s"
+
+#: revision.c
+msgid "--exclude-hidden= passed more than once"
+msgstr "--exclude-hidden= 传递了ä¸æ­¢ä¸€æ¬¡"
+
+#: revision.c
+#, c-format
+msgid "resolve-undo records `%s` which is missing"
+msgstr "resolve-undo 记录 `%s`,现缺失"
+
+#: revision.c
+#, c-format
+msgid "could not get commit for ancestry-path argument %s"
+msgstr "无法获得 ancestry-path å‚æ•° %s çš„æ交"
+
+#: revision.c
msgid "--unpacked=<packfile> no longer supported"
msgstr "ä¸å†æ”¯æŒ --unpacked=<packfile>"
#: revision.c
+#, c-format
+msgid "invalid option '%s' in --stdin mode"
+msgstr "在 --stdin 模å¼ä¸‹çš„无效选项:'%s'"
+
+#: revision.c
msgid "your current branch appears to be broken"
msgstr "您的当å‰åˆ†æ”¯å¥½åƒè¢«æŸå"
@@ -23168,6 +24237,257 @@ msgstr "-L å°šä¸æ”¯æŒ -p å’Œ -s 之外的差异格å¼"
msgid "cannot create async thread: %s"
msgstr "ä¸èƒ½åˆ›å»º async 线程:%s"
+#: scalar.c worktree.c
+#, c-format
+msgid "'%s' does not exist"
+msgstr "'%s' ä¸å­˜åœ¨"
+
+#: scalar.c
+#, c-format
+msgid "could not switch to '%s'"
+msgstr "无法切æ¢åˆ° '%s'"
+
+#: scalar.c
+msgid "need a working directory"
+msgstr "需è¦ä¸€ä¸ªå·¥ä½œç›®å½•"
+
+#: scalar.c
+msgid "Scalar enlistments require a worktree"
+msgstr "Scalar 登记需è¦ä¸€ä¸ªå·¥ä½œæ ‘"
+
+#: scalar.c
+#, c-format
+msgid "could not configure %s=%s"
+msgstr "无法é…ç½® %s=%s"
+
+#: scalar.c
+msgid "could not configure log.excludeDecoration"
+msgstr "无法é…ç½® log.excludeDecoration"
+
+#: scalar.c
+msgid "could not add enlistment"
+msgstr "无法添加登记"
+
+#: scalar.c
+msgid "could not set recommended config"
+msgstr "无法设置推èçš„é…ç½®"
+
+#: scalar.c
+msgid "could not turn on maintenance"
+msgstr "无法打开维护模å¼"
+
+#: scalar.c
+msgid "could not start the FSMonitor daemon"
+msgstr "无法å¯åŠ¨ FSMonitor 守护进程"
+
+#: scalar.c
+msgid "could not turn off maintenance"
+msgstr "无法关闭维护模å¼"
+
+#: scalar.c
+msgid "could not remove enlistment"
+msgstr "无法删除登记"
+
+#: scalar.c
+#, c-format
+msgid "remote HEAD is not a branch: '%.*s'"
+msgstr "远程 HEAD ä¸æ˜¯ä¸€ä¸ªåˆ†æ”¯ï¼š'%.*s'"
+
+#: scalar.c
+msgid "failed to get default branch name from remote; using local default"
+msgstr "无法从远程获å–默认分支å称;使用本地默认值"
+
+#: scalar.c
+msgid "failed to get default branch name"
+msgstr "无法获å–默认分支å称"
+
+#: scalar.c
+msgid "failed to unregister repository"
+msgstr "无法å–消注册仓库"
+
+#: scalar.c
+msgid "failed to stop the FSMonitor daemon"
+msgstr "无法åœæ­¢ FSMonitor 守护进程"
+
+#: scalar.c
+msgid "failed to delete enlistment directory"
+msgstr "无法删除登记目录"
+
+#: scalar.c
+msgid "branch to checkout after clone"
+msgstr "克隆åŽè¦æ£€å‡ºçš„分支"
+
+#: scalar.c
+msgid "when cloning, create full working directory"
+msgstr "在克隆时,创建完整的工作目录"
+
+#: scalar.c
+msgid "only download metadata for the branch that will be checked out"
+msgstr "åªä¸‹è½½è¦æ£€å‡ºçš„分支的元信æ¯"
+
+#: scalar.c
+msgid "create repository within 'src' directory"
+msgstr "在 'src' 目录中创建仓库"
+
+#: scalar.c
+msgid ""
+"scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n"
+"\t[--[no-]src] <url> [<enlistment>]"
+msgstr ""
+"scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n"
+"\t[--[no-]src] <url> [<登记>]"
+
+#: scalar.c
+#, c-format
+msgid "cannot deduce worktree name from '%s'"
+msgstr "无法从 '%s' 猜测工作区å称"
+
+#: scalar.c
+#, c-format
+msgid "directory '%s' exists already"
+msgstr "目录 '%s' 已存在"
+
+#: scalar.c
+#, c-format
+msgid "failed to get default branch for '%s'"
+msgstr "æ— æ³•èŽ·å– '%s' 的默认分支"
+
+#: scalar.c
+#, c-format
+msgid "could not configure remote in '%s'"
+msgstr "无法在 '%s' 中é…置远程"
+
+#: scalar.c
+#, c-format
+msgid "could not configure '%s'"
+msgstr "无法é…ç½® '%s'"
+
+#: scalar.c
+msgid "partial clone failed; attempting full clone"
+msgstr "部分克隆失败;å°è¯•å®Œæ•´å…‹éš†"
+
+#: scalar.c
+msgid "could not configure for full clone"
+msgstr "无法é…置完整克隆"
+
+#: scalar.c
+msgid "scalar diagnose [<enlistment>]"
+msgstr "scalar diagnose [<登记>]"
+
+#: scalar.c
+msgid "`scalar list` does not take arguments"
+msgstr "`scalar list` ä¸å¸¦å‚æ•°"
+
+#: scalar.c
+msgid "scalar register [<enlistment>]"
+msgstr "scalar register [<登记>]"
+
+#: scalar.c
+msgid "reconfigure all registered enlistments"
+msgstr "é‡æ–°é…置所有注册的登记"
+
+#: scalar.c
+msgid "scalar reconfigure [--all | <enlistment>]"
+msgstr "scalar reconfigure [--all | <登记>]"
+
+#: scalar.c
+msgid "--all or <enlistment>, but not both"
+msgstr "--all 或者 <登记>,而ä¸æ˜¯ä¸¤ä¸ªä¸€èµ·"
+
+#: scalar.c
+#, c-format
+msgid "could not remove stale scalar.repo '%s'"
+msgstr "无法删除过期的 scalar.repo '%s'"
+
+#: scalar.c
+#, c-format
+msgid "removed stale scalar.repo '%s'"
+msgstr "已删除过期的 scalar.repo '%s'"
+
+#: scalar.c
+#, c-format
+msgid "repository at '%s' has different owner"
+msgstr "ä½äºŽ '%s' 处的仓库有ä¸åŒçš„所有者"
+
+#: scalar.c
+#, c-format
+msgid "repository at '%s' has a format issue"
+msgstr "ä½äºŽ '%s' 处的仓库存在格å¼é—®é¢˜"
+
+#: scalar.c
+#, c-format
+msgid "repository not found in '%s'"
+msgstr "在 '%s' 中找ä¸åˆ°ä»“库"
+
+#: scalar.c
+#, c-format
+msgid ""
+"to unregister this repository from Scalar, run\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+msgstr ""
+"若希望从 Scalar 注销该仓库,执行\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+
+#: scalar.c
+msgid ""
+"scalar run <task> [<enlistment>]\n"
+"Tasks:\n"
+msgstr ""
+"scalar run <任务> [<登记>]\n"
+"任务:\n"
+
+#: scalar.c
+#, c-format
+msgid "no such task: '%s'"
+msgstr "没有此任务:'%s'"
+
+#: scalar.c
+msgid "scalar unregister [<enlistment>]"
+msgstr "scalar unregister [<登记>]"
+
+#: scalar.c
+msgid "scalar delete <enlistment>"
+msgstr "scalar delete <登记>"
+
+#: scalar.c
+msgid "refusing to delete current working directory"
+msgstr "æ‹’ç»åˆ é™¤å½“å‰å·¥ä½œç›®å½•"
+
+#: scalar.c
+msgid "include Git version"
+msgstr "包括 Git 的版本"
+
+#: scalar.c
+msgid "include Git's build options"
+msgstr "包括 Git 的构建选项"
+
+#: scalar.c
+msgid "scalar verbose [-v | --verbose] [--build-options]"
+msgstr "scalar verbose [-v | --verbose] [--build-options]"
+
+#: scalar.c
+msgid "-C requires a <directory>"
+msgstr "-C éœ€è¦ <目录>"
+
+#: scalar.c
+#, c-format
+msgid "could not change to '%s'"
+msgstr "无法å˜æ›´åˆ° '%s'"
+
+#: scalar.c
+msgid "-c requires a <key>=<value> argument"
+msgstr "-c éœ€è¦ <é”®>=<值> å‚æ•°"
+
+#: scalar.c
+msgid ""
+"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
+"\n"
+"Commands:\n"
+msgstr ""
+"scalar [-C <目录>] [-c <键>=<值>] <命令> [<选项>]\n"
+"\n"
+"命令:\n"
+
#: send-pack.c
msgid "unexpected flush packet while reading remote unpack status"
msgstr "读å–远程解包状æ€æ—¶æ”¶åˆ°æ„外的 flush 包"
@@ -23284,11 +24604,6 @@ msgstr ""
msgid "could not lock '%s'"
msgstr "ä¸èƒ½é”定 '%s'"
-#: sequencer.c strbuf.c wrapper.c
-#, c-format
-msgid "could not write to '%s'"
-msgstr "ä¸èƒ½å†™å…¥ '%s'"
-
#: sequencer.c
#, c-format
msgid "could not write eol to '%s'"
@@ -23308,11 +24623,6 @@ msgstr "您的本地修改将被%s覆盖。"
msgid "commit your changes or stash them to proceed."
msgstr "æ交您的修改或贮è—åŽå†ç»§ç»­ã€‚"
-#: sequencer.c
-#, c-format
-msgid "%s: fast-forward"
-msgstr "%s:快进"
-
#. TRANSLATORS: %s will be "revert", "cherry-pick" or
#. "rebase".
#.
@@ -23496,7 +24806,7 @@ msgstr "无效的作者身份 '%s'"
msgid "corrupt author: missing date information"
msgstr "æŸå的作者:缺失日期信æ¯"
-#: sequencer.c t/helper/test-fast-rebase.c
+#: sequencer.c
#, c-format
msgid "could not update %s"
msgstr "ä¸èƒ½æ›´æ–° %s"
@@ -23593,11 +24903,6 @@ msgstr "%s:ä¸èƒ½è§£æžçˆ¶æ交 %s"
#: sequencer.c
#, c-format
-msgid "could not rename '%s' to '%s'"
-msgstr "ä¸èƒ½å°† '%s' é‡å‘½å为 '%s'"
-
-#: sequencer.c
-#, c-format
msgid "could not revert %s... %s"
msgstr "ä¸èƒ½è¿˜åŽŸ %s... %s"
@@ -23623,6 +24928,26 @@ msgstr "git %s:无法刷新索引"
#: sequencer.c
#, c-format
+msgid "'%s' is not a valid label"
+msgstr "'%s' ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„标签"
+
+#: sequencer.c
+#, c-format
+msgid "'%s' is not a valid refname"
+msgstr "'%s' ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„引用å"
+
+#: sequencer.c
+#, c-format
+msgid "update-ref requires a fully qualified refname e.g. refs/heads/%s"
+msgstr "update-ref 需è¦ä¸€ä¸ªå®Œæ•´çš„引用å,例如:refs/heads/%s"
+
+#: sequencer.c
+#, c-format
+msgid "invalid command '%.*s'"
+msgstr "无效命令 '%.*s'"
+
+#: sequencer.c
+#, c-format
msgid "%s does not accept arguments: '%s'"
msgstr "%s ä¸æŽ¥å—å‚数:'%s'"
@@ -23712,10 +25037,6 @@ msgid "could not create sequencer directory '%s'"
msgstr "ä¸èƒ½åˆ›å»ºåºåˆ—目录 '%s'"
#: sequencer.c
-msgid "could not lock HEAD"
-msgstr "ä¸èƒ½é”定 HEAD"
-
-#: sequencer.c
msgid "no cherry-pick or revert in progress"
msgstr "拣选或还原æ“作并未进行"
@@ -23829,21 +25150,21 @@ msgstr ""
"\n"
#: sequencer.c
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "并且修改索引和/或工作区\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "并且修改索引和/或工作区。\n"
#: sequencer.c
#, c-format
msgid ""
"execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
"Commit or stash your changes, and then run\n"
"\n"
" git rebase --continue\n"
"\n"
msgstr ""
"执行æˆåŠŸï¼š%s\n"
-"但是在索引和/或工作区中存在å˜æ›´\n"
+"但是在索引和/或工作区中存在å˜æ›´ã€‚\n"
"æ交或贮è—修改,然åŽè¿è¡Œ\n"
"\n"
" git rebase --continue\n"
@@ -23855,6 +25176,11 @@ msgid "illegal label name: '%.*s'"
msgstr "éžæ³•çš„标签å称:'%.*s'"
#: sequencer.c
+#, c-format
+msgid "could not resolve '%s'"
+msgstr "æ— æ³•è§£æž '%s'"
+
+#: sequencer.c
msgid "writing fake root commit"
msgstr "写伪根æ交"
@@ -23863,11 +25189,6 @@ msgid "writing squash-onto"
msgstr "写入 squash-onto"
#: sequencer.c
-#, c-format
-msgid "could not resolve '%s'"
-msgstr "æ— æ³•è§£æž '%s'"
-
-#: sequencer.c
msgid "cannot merge without a current revision"
msgstr "没有当å‰ç‰ˆæœ¬ä¸èƒ½åˆå¹¶"
@@ -23900,6 +25221,30 @@ msgid "merge: Unable to write new index file"
msgstr "åˆå¹¶ï¼šæ— æ³•å†™å…¥æ–°ç´¢å¼•æ–‡ä»¶"
#: sequencer.c
+#, c-format
+msgid ""
+"another 'rebase' process appears to be running; '%s.lock' already exists"
+msgstr "å¦ä¸€ä¸ª 'rebase' 进程似乎在è¿è¡Œï¼›'%s.lock' 已存在"
+
+#: sequencer.c
+#, c-format
+msgid ""
+"Updated the following refs with %s:\n"
+"%s"
+msgstr ""
+"已用 %s 更新下列引用:\n"
+"%s"
+
+#: sequencer.c
+#, c-format
+msgid ""
+"Failed to update the following refs with %s:\n"
+"%s"
+msgstr ""
+"无法用 %s 更新下列引用:\n"
+"%s"
+
+#: sequencer.c
msgid "Cannot autostash"
msgstr "无法自动贮è—"
@@ -23952,6 +25297,10 @@ msgid "Autostash exists; creating a new stash entry."
msgstr "自动贮è—å·²ç»å­˜åœ¨ï¼›æ­£åœ¨åˆ›å»ºä¸€ä¸ªæ–°çš„è´®è—æ¡ç›®ã€‚"
#: sequencer.c
+msgid "autostash reference is a symref"
+msgstr "自动贮è—的引用是一个符å·å¼•ç”¨"
+
+#: sequencer.c
msgid "could not detach HEAD"
msgstr "ä¸èƒ½åˆ†ç¦»å¤´æŒ‡é’ˆ"
@@ -23987,13 +25336,13 @@ msgstr ""
#: sequencer.c
#, c-format
-msgid "Rebasing (%d/%d)%s"
-msgstr "正在å˜åŸºï¼ˆ%d/%d)%s"
+msgid "Stopped at %s... %.*s\n"
+msgstr "åœæ­¢åœ¨ %s... %.*s\n"
#: sequencer.c
#, c-format
-msgid "Stopped at %s... %.*s\n"
-msgstr "åœæ­¢åœ¨ %s... %.*s\n"
+msgid "Rebasing (%d/%d)%s"
+msgstr "正在å˜åŸºï¼ˆ%d/%d)%s"
#: sequencer.c
#, c-format
@@ -24101,6 +25450,11 @@ msgstr "无法跳过ä¸å¿…è¦çš„拣选"
msgid "the script was already rearranged."
msgstr "脚本已ç»é‡æ–°ç¼–排。"
+#: sequencer.c
+#, c-format
+msgid "update-refs file at '%s' is invalid"
+msgstr "ä½äºŽ '%s' çš„ update-refs 文件无效"
+
#: setup.c
#, c-format
msgid "'%s' is outside repository at '%s'"
@@ -24243,18 +25597,23 @@ msgstr ""
#: setup.c
#, c-format
msgid ""
-"unsafe repository ('%s' is owned by someone else)\n"
-"To add an exception for this directory, call:\n"
+"detected dubious ownership in repository at '%s'\n"
+"%sTo add an exception for this directory, call:\n"
"\n"
"\tgit config --global --add safe.directory %s"
msgstr ""
-"仓库ä¸å®‰å…¨ï¼ˆ'%s' 的所有者是其他人)\n"
-"è¦ä¸ºæœ¬ä»“库创建特例,请使用:\n"
+"在 '%s' 检测到å¯ç–‘的仓库所有æƒ\n"
+"%sè¦ä¸ºæœ¬ä»“库创建特例,请è¿è¡Œï¼š\n"
"\n"
"\tgit config --global --add safe.directory %s"
#: setup.c
#, c-format
+msgid "cannot use bare repository '%s' (safe.bareRepository is '%s')"
+msgstr "无法使用纯仓库 '%s' (safe.bareRepository 为 '%s')"
+
+#: setup.c
+#, c-format
msgid ""
"problem with core.sharedRepository filemode value (0%.3o).\n"
"The owner of files must always have read and write permissions."
@@ -24270,6 +25629,100 @@ msgstr "fork 失败"
msgid "setsid failed"
msgstr "setsid 失败"
+#: setup.c
+#, c-format
+msgid "cannot stat template '%s'"
+msgstr "ä¸èƒ½å¯¹æ¨¡ç‰ˆ '%s' 调用 stat"
+
+#: setup.c
+#, c-format
+msgid "cannot opendir '%s'"
+msgstr "ä¸èƒ½æ‰“开目录 '%s'"
+
+#: setup.c
+#, c-format
+msgid "cannot readlink '%s'"
+msgstr "ä¸èƒ½è¯»å–链接 '%s'"
+
+#: setup.c
+#, c-format
+msgid "cannot symlink '%s' '%s'"
+msgstr "ä¸èƒ½è‡ª '%s' 到 '%s' 创建符å·é“¾æŽ¥"
+
+#: setup.c
+#, c-format
+msgid "cannot copy '%s' to '%s'"
+msgstr "ä¸èƒ½æ‹·è´ '%s' 至 '%s'"
+
+#: setup.c
+#, c-format
+msgid "ignoring template %s"
+msgstr "忽略模版 %s"
+
+#: setup.c
+#, c-format
+msgid "templates not found in %s"
+msgstr "没有在 %s 中找到模版"
+
+#: setup.c
+#, c-format
+msgid "not copying templates from '%s': %s"
+msgstr "没有从 '%s' å¤åˆ¶æ¨¡ç‰ˆï¼š%s"
+
+#: setup.c
+#, c-format
+msgid "invalid initial branch name: '%s'"
+msgstr "无效的åˆå§‹åˆ†æ”¯å:'%s'"
+
+#: setup.c
+#, c-format
+msgid "re-init: ignored --initial-branch=%s"
+msgstr "re-init:已忽略 --initial-branch=%s"
+
+#: setup.c
+#, c-format
+msgid "unable to handle file type %d"
+msgstr "ä¸èƒ½å¤„ç† %d 类型的文件"
+
+#: setup.c
+#, c-format
+msgid "unable to move %s to %s"
+msgstr "ä¸èƒ½ç§»åŠ¨ %s 至 %s"
+
+#: setup.c
+msgid "attempt to reinitialize repository with different hash"
+msgstr "å°è¯•ç”¨ä¸åŒçš„哈希算法é‡æ–°åˆå§‹åŒ–仓库"
+
+#: setup.c
+msgid ""
+"attempt to reinitialize repository with different reference storage format"
+msgstr "å°è¯•ä½¿ç”¨ä¸åŒçš„引用存储格å¼é‡æ–°åˆå§‹åŒ–仓库"
+
+#: setup.c
+#, c-format
+msgid "%s already exists"
+msgstr "%s å·²ç»å­˜åœ¨"
+
+#: setup.c
+#, c-format
+msgid "Reinitialized existing shared Git repository in %s%s\n"
+msgstr "é‡æ–°åˆå§‹åŒ–已存在的共享 Git 仓库于 %s%s\n"
+
+#: setup.c
+#, c-format
+msgid "Reinitialized existing Git repository in %s%s\n"
+msgstr "å·²é‡æ–°åˆå§‹åŒ–已存在的 Git 仓库于 %s%s\n"
+
+#: setup.c
+#, c-format
+msgid "Initialized empty shared Git repository in %s%s\n"
+msgstr "å·²åˆå§‹åŒ–空的共享 Git 仓库于 %s%s\n"
+
+#: setup.c
+#, c-format
+msgid "Initialized empty Git repository in %s%s\n"
+msgstr "å·²åˆå§‹åŒ–空的 Git 仓库于 %s%s\n"
+
#: sparse-index.c
#, c-format
msgid "index entry is a directory, but not sparse (%08x)"
@@ -24331,11 +25784,6 @@ msgid_plural "%u bytes/s"
msgstr[0] "%u 字节/秒"
msgstr[1] "%u 字节/秒"
-#: strbuf.c
-#, c-format
-msgid "could not edit '%s'"
-msgstr "ä¸èƒ½ç¼–辑 '%s'"
-
#: submodule-config.c
#, c-format
msgid "ignoring suspicious submodule name: %s"
@@ -24546,13 +25994,30 @@ msgstr "ls-tree 返回未知返回值 %d"
msgid "failed to lstat '%s'"
msgstr "无法执行 lstat '%s'"
-#: t/helper/test-fast-rebase.c
-msgid "unhandled options"
-msgstr "未处ç†çš„选项"
+#: t/helper/test-bundle-uri.c
+msgid "no remote configured to get bundle URIs from"
+msgstr "没有远程被设置为å¯ä»¥èŽ·å–归档包 URI"
-#: t/helper/test-fast-rebase.c
-msgid "error preparing revisions"
-msgstr "准备版本时错误"
+#: t/helper/test-bundle-uri.c
+#, c-format
+msgid "remote '%s' has no configured URL"
+msgstr "远程 '%s' 没有设置 URL"
+
+#: t/helper/test-bundle-uri.c
+msgid "could not get the bundle-uri list"
+msgstr "æ— æ³•èŽ·å– bundle-uri 列表"
+
+#: t/helper/test-cache-tree.c
+msgid "test-tool cache-tree <options> (control|prime|update)"
+msgstr "test-tool cache-tree <选项> (control|prime|update)"
+
+#: t/helper/test-cache-tree.c
+msgid "clear the cache tree before each iteration"
+msgstr "在æ¯æ¬¡è¿­ä»£å‰æ¸…除缓存树"
+
+#: t/helper/test-cache-tree.c
+msgid "number of entries in the cache tree to invalidate (default 0)"
+msgstr "缓存树中无效化的æ¡ç›®æ•°é‡ï¼ˆé»˜è®¤ 0)"
#: t/helper/test-reach.c
#, c-format
@@ -24747,10 +26212,6 @@ msgstr "åè®®ä¸æ”¯æŒè®¾ç½®è¿œç¨‹æœåŠ¡è·¯å¾„"
msgid "invalid remote service path"
msgstr "无效的远程æœåŠ¡è·¯å¾„"
-#: transport-helper.c transport.c
-msgid "operation not supported by protocol"
-msgstr "åè®®ä¸æ”¯æŒè¯¥æ“作"
-
#: transport-helper.c
#, c-format
msgid "can't connect to subservice %s"
@@ -24916,11 +26377,6 @@ msgstr "åè®® v2 的支æŒå°šæœªå®žçŽ°"
#: transport.c
#, c-format
-msgid "unknown value for config '%s': %s"
-msgstr "é…ç½® '%s' çš„å–值未知:%s"
-
-#: transport.c
-#, c-format
msgid "transport '%s' not allowed"
msgstr "传输 '%s' ä¸å…许"
@@ -24970,6 +26426,18 @@ msgstr "正在终止。"
msgid "failed to push all needed submodules"
msgstr "ä¸èƒ½æŽ¨é€å…¨éƒ¨éœ€è¦çš„å­æ¨¡ç»„"
+#: transport.c
+msgid "bundle-uri operation not supported by protocol"
+msgstr "åè®®ä¸æ”¯æŒ bundle-uri æ“作"
+
+#: transport.c
+msgid "could not retrieve server-advertised bundle-uri list"
+msgstr "无法获å–æœåŠ¡å™¨å…¬å¸ƒçš„ bundle-uri 列表"
+
+#: transport.c
+msgid "operation not supported by protocol"
+msgstr "åè®®ä¸æ”¯æŒè¯¥æ“作"
+
#: tree-walk.c
msgid "too-short tree object"
msgstr "太短的树对象"
@@ -25278,6 +26746,22 @@ msgstr "无效的端å£å·"
msgid "invalid '..' path segment"
msgstr "无效的 '..' 路径片段"
+#: usage.c
+msgid "usage: "
+msgstr "用法:"
+
+#: usage.c
+msgid "fatal: "
+msgstr "致命错误:"
+
+#: usage.c
+msgid "error: "
+msgstr "错误:"
+
+#: usage.c
+msgid "warning: "
+msgstr "警告:"
+
#: walker.c
msgid "Fetching objects"
msgstr "正在获å–对象"
@@ -25406,6 +26890,10 @@ msgstr "ä¸èƒ½è®¿é—® '%s'"
msgid "unable to get current working directory"
msgstr "ä¸èƒ½èŽ·å–当å‰å·¥ä½œç›®å½•"
+#: wrapper.c
+msgid "unable to get random bytes"
+msgstr "无法获å–éšæœºå­—节"
+
#: wt-status.c
msgid "Unmerged paths:"
msgstr "未åˆå¹¶çš„路径:"
@@ -25871,12 +27359,20 @@ msgstr "忽略的文件"
#: wt-status.c
#, c-format
msgid ""
-"It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
-"may speed it up, but you have to be careful not to forget to add\n"
-"new files yourself (see 'git help status')."
+"It took %.2f seconds to enumerate untracked files,\n"
+"but the results were cached, and subsequent runs may be faster."
msgstr ""
-"耗费了 %.2f 秒以枚举未跟踪的文件。'status -uno' 也许能æ高速度,\n"
-"但您需è¦å°å¿ƒä¸è¦å¿˜äº†æ·»åŠ æ–°æ–‡ä»¶ï¼ˆå‚è§ 'git help status')。"
+"枚举未追踪的文件花了 %.2f 秒,\n"
+"结果已被缓存,åŽç»­çš„执行会更快。"
+
+#: wt-status.c
+#, c-format
+msgid "It took %.2f seconds to enumerate untracked files."
+msgstr "枚举未追踪的文件花了 %.2f 秒。"
+
+#: wt-status.c
+msgid "See 'git help status' for information on how to improve this."
+msgstr "å‚è§ 'git help status' æ¥èŽ·å–如何改善的信æ¯ã€‚"
#: wt-status.c
#, c-format
@@ -25970,7 +27466,12 @@ msgstr "å¦å¤–,您的索引中包å«æœªæ交的å˜æ›´ã€‚"
msgid "cannot %s: Your index contains uncommitted changes."
msgstr "ä¸èƒ½%s:您的索引中包å«æœªæ交的å˜æ›´ã€‚"
-#: git-merge-octopus.sh
+#: xdiff-interface.c
+#, c-format
+msgid "unknown style '%s' given for '%s'"
+msgstr "'%2$s' 的未知风格å–值 '%1$s'"
+
+#: git-merge-octopus.sh git-merge-resolve.sh
msgid ""
"Error: Your local changes to the following files would be overwritten by "
"merge"
@@ -26049,320 +27550,6 @@ msgstr "您需è¦åœ¨å·¥ä½œåŒºçš„顶级目录中è¿è¡Œè¿™ä¸ªå‘½ä»¤ã€‚"
msgid "Unable to determine absolute path of git directory"
msgstr "ä¸èƒ½ç¡®å®š git 目录的ç»å¯¹è·¯å¾„"
-#. TRANSLATORS: you can adjust this to align "git add -i" status menu
-#: git-add--interactive.perl
-#, perl-format
-msgid "%12s %12s %s"
-msgstr "%12s %12s %s"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "touched %d path\n"
-msgid_plural "touched %d paths\n"
-msgstr[0] "触碰了 %d 个路径\n"
-msgstr[1] "触碰了 %d 个路径\n"
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for staging."
-msgstr "如果补ä¸èƒ½å¹²å‡€åœ°åº”用,编辑å—将立å³æ ‡è®°ä¸ºæš‚存。"
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for stashing."
-msgstr "如果补ä¸èƒ½å¹²å‡€åœ°åº”用,编辑å—将立å³æ ‡è®°ä¸ºè´®è—。"
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for unstaging."
-msgstr "如果补ä¸èƒ½å¹²å‡€åœ°åº”用,编辑å—将立å³æ ‡è®°ä¸ºæœªæš‚存。"
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for applying."
-msgstr "如果补ä¸èƒ½å¹²å‡€åœ°åº”用,编辑å—将立å³æ ‡è®°ä¸ºåº”用。"
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for discarding."
-msgstr "如果补ä¸èƒ½å¹²å‡€åœ°åº”用,编辑å—将立å³æ ‡è®°ä¸ºä¸¢å¼ƒã€‚"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "failed to open hunk edit file for writing: %s"
-msgstr "无法为写入打开å—编辑文件:%s"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid ""
-"---\n"
-"To remove '%s' lines, make them ' ' lines (context).\n"
-"To remove '%s' lines, delete them.\n"
-"Lines starting with %s will be removed.\n"
-msgstr ""
-"---\n"
-"è¦åˆ é™¤ '%s' 开始的行,使其æˆä¸º ' ' 开始的行(上下文)。\n"
-"è¦åˆ é™¤ '%s' 开始的行,删除它们。\n"
-"以 %s 开始的行将被删除。\n"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "failed to open hunk edit file for reading: %s"
-msgstr "无法读å–å—编辑文件:%s"
-
-#: git-add--interactive.perl
-msgid ""
-"y - stage this hunk\n"
-"n - do not stage this hunk\n"
-"q - quit; do not stage this hunk or any of the remaining ones\n"
-"a - stage this hunk and all later hunks in the file\n"
-"d - do not stage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 暂存该å—\n"
-"n - ä¸è¦æš‚存该å—\n"
-"q - 退出。ä¸æš‚存该å—åŠåŽé¢çš„全部å—\n"
-"a - 暂存该å—和本文件中åŽé¢çš„全部å—\n"
-"d - ä¸æš‚存该å—和本文件中åŽé¢çš„全部å—"
-
-#: git-add--interactive.perl
-msgid ""
-"y - stash this hunk\n"
-"n - do not stash this hunk\n"
-"q - quit; do not stash this hunk or any of the remaining ones\n"
-"a - stash this hunk and all later hunks in the file\n"
-"d - do not stash this hunk or any of the later hunks in the file"
-msgstr ""
-"y - è´®è—该å—\n"
-"n - ä¸è¦è´®è—该å—\n"
-"q - 退出。ä¸è´®è—该å—åŠåŽé¢çš„全部å—\n"
-"a - è´®è—该å—和本文件中åŽé¢çš„全部å—\n"
-"d - ä¸è´®è—该å—和本文件中åŽé¢çš„全部å—"
-
-#: git-add--interactive.perl
-msgid ""
-"y - unstage this hunk\n"
-"n - do not unstage this hunk\n"
-"q - quit; do not unstage this hunk or any of the remaining ones\n"
-"a - unstage this hunk and all later hunks in the file\n"
-"d - do not unstage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - ä¸æš‚存该å—\n"
-"n - ä¸è¦ä¸æš‚存该å—\n"
-"q - 退出。ä¸è¦ä¸æš‚存该å—åŠåŽé¢çš„全部å—\n"
-"a - ä¸æš‚存该å—和本文件中åŽé¢çš„全部å—\n"
-"d - ä¸è¦ä¸æš‚存该å—和本文件中åŽé¢çš„全部å—"
-
-#: git-add--interactive.perl
-msgid ""
-"y - apply this hunk to index\n"
-"n - do not apply this hunk to index\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 在索引中应用该å—\n"
-"n - ä¸è¦åœ¨ç´¢å¼•ä¸­åº”用该å—\n"
-"q - 退出。ä¸è¦åº”用该å—åŠåŽé¢çš„全部å—\n"
-"a - 应用该å—和本文件中åŽé¢çš„全部å—\n"
-"d - ä¸è¦åº”用该å—和本文件中åŽé¢çš„全部å—"
-
-#: git-add--interactive.perl
-msgid ""
-"y - discard this hunk from worktree\n"
-"n - do not discard this hunk from worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 在工作区中丢弃该å—\n"
-"n - ä¸è¦åœ¨å·¥ä½œåŒºä¸­ä¸¢å¼ƒè¯¥å—\n"
-"q - 退出。ä¸è¦ä¸¢å¼ƒè¯¥å—åŠåŽé¢çš„全部å—\n"
-"a - 丢弃该å—和本文件中åŽé¢çš„全部å—\n"
-"d - ä¸è¦ä¸¢å¼ƒè¯¥å—和本文件中åŽé¢çš„全部å—"
-
-#: git-add--interactive.perl
-msgid ""
-"y - discard this hunk from index and worktree\n"
-"n - do not discard this hunk from index and worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 在索引和工作区中丢弃该å—\n"
-"n - ä¸è¦åœ¨ç´¢å¼•å’Œå·¥ä½œåŒºä¸­ä¸¢å¼ƒè¯¥å—\n"
-"q - 退出。ä¸è¦ä¸¢å¼ƒè¯¥å—åŠåŽé¢çš„全部å—\n"
-"a - 丢弃该å—和本文件中åŽé¢çš„全部å—\n"
-"d - ä¸è¦ä¸¢å¼ƒè¯¥å—和本文件中åŽé¢çš„全部å—"
-
-#: git-add--interactive.perl
-msgid ""
-"y - apply this hunk to index and worktree\n"
-"n - do not apply this hunk to index and worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 在索引和工作区中应用该å—\n"
-"n - ä¸è¦åœ¨ç´¢å¼•å’Œå·¥ä½œåŒºä¸­åº”用该å—\n"
-"q - 退出。ä¸è¦åº”用该å—åŠåŽé¢çš„全部å—\n"
-"a - 应用该å—和本文件中åŽé¢çš„全部å—\n"
-"d - ä¸è¦åº”用该å—和本文件中åŽé¢çš„全部å—"
-
-#: git-add--interactive.perl
-msgid ""
-"y - apply this hunk to worktree\n"
-"n - do not apply this hunk to worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 在工作区中应用该å—\n"
-"n - ä¸è¦åœ¨å·¥ä½œåŒºä¸­åº”用该å—\n"
-"q - 退出。ä¸è¦åº”用该å—åŠåŽé¢çš„全部å—\n"
-"a - 应用该å—和本文件中åŽé¢çš„全部å—\n"
-"d - ä¸è¦åº”用该å—和本文件中åŽé¢çš„全部å—"
-
-#: git-add--interactive.perl
-msgid ""
-"g - select a hunk to go to\n"
-"/ - search for a hunk matching the given regex\n"
-"j - leave this hunk undecided, see next undecided hunk\n"
-"J - leave this hunk undecided, see next hunk\n"
-"k - leave this hunk undecided, see previous undecided hunk\n"
-"K - leave this hunk undecided, see previous hunk\n"
-"s - split the current hunk into smaller hunks\n"
-"e - manually edit the current hunk\n"
-"? - print help\n"
-msgstr ""
-"g - 选择跳转到一个å—\n"
-"/ - 查找和给定正则表达å¼åŒ¹é…çš„å—\n"
-"j - ç»´æŒè¯¥å—未决状æ€ï¼ŒæŸ¥çœ‹ä¸‹ä¸€ä¸ªæœªå†³å—\n"
-"J - ç»´æŒè¯¥å—未决状æ€ï¼ŒæŸ¥çœ‹ä¸‹ä¸€ä¸ªå—\n"
-"k - ç»´æŒè¯¥å—未决状æ€ï¼ŒæŸ¥çœ‹ä¸Šä¸€ä¸ªæœªå†³å—\n"
-"K - ç»´æŒè¯¥å—未决状æ€ï¼ŒæŸ¥çœ‹ä¸Šä¸€ä¸ªå—\n"
-"s - 拆分当å‰å—为更å°çš„å—\n"
-"e - 手动编辑当å‰å—\n"
-"? - 显示帮助\n"
-
-#: git-add--interactive.perl
-msgid "The selected hunks do not apply to the index!\n"
-msgstr "选中的å—ä¸èƒ½åº”用到索引ï¼\n"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "ignoring unmerged: %s\n"
-msgstr "忽略未åˆå…¥çš„:%s\n"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
-msgstr "将模å¼å˜æ›´åº”用到工作区 [y,n,q,a,d%s,?]? "
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
-msgstr "将删除æ“作应用到工作区 [y,n,q,a,d%s,?]? "
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
-msgstr "将添加æ“作应用到工作区 [y,n,q,a,d%s,?]? "
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
-msgstr "将该å—应用到工作区 [y,n,q,a,d%s,?]? "
-
-#: git-add--interactive.perl
-msgid "No other hunks to goto\n"
-msgstr "没有其它å¯ä¾›è·³è½¬çš„å—\n"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Invalid number: '%s'\n"
-msgstr "无效数字:'%s'\n"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Sorry, only %d hunk available.\n"
-msgid_plural "Sorry, only %d hunks available.\n"
-msgstr[0] "对ä¸èµ·ï¼Œåªæœ‰ %d 个å¯ç”¨å—。\n"
-msgstr[1] "对ä¸èµ·ï¼Œåªæœ‰ %d 个å¯ç”¨å—。\n"
-
-#: git-add--interactive.perl
-msgid "No other hunks to search\n"
-msgstr "没有其它å¯ä¾›æŸ¥æ‰¾çš„å—\n"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Malformed search regexp %s: %s\n"
-msgstr "é”™è¯¯çš„æ­£åˆ™è¡¨è¾¾å¼ %s:%s\n"
-
-#: git-add--interactive.perl
-msgid "No hunk matches the given pattern\n"
-msgstr "没有和给定模å¼ç›¸åŒ¹é…çš„å—\n"
-
-#: git-add--interactive.perl
-msgid "No previous hunk\n"
-msgstr "没有å‰ä¸€ä¸ªå—\n"
-
-#: git-add--interactive.perl
-msgid "No next hunk\n"
-msgstr "没有下一个å—\n"
-
-#: git-add--interactive.perl
-msgid "Sorry, cannot split this hunk\n"
-msgstr "对ä¸èµ·ï¼Œä¸èƒ½æ‹†åˆ†è¿™ä¸ªå—\n"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Split into %d hunk.\n"
-msgid_plural "Split into %d hunks.\n"
-msgstr[0] "拆分为 %d å—。\n"
-msgstr[1] "拆分为 %d å—。\n"
-
-#: git-add--interactive.perl
-msgid "Sorry, cannot edit this hunk\n"
-msgstr "对ä¸èµ·ï¼Œä¸èƒ½ç¼–辑这个å—\n"
-
-#. TRANSLATORS: please do not translate the command names
-#. 'status', 'update', 'revert', etc.
-#: git-add--interactive.perl
-msgid ""
-"status - show paths with changes\n"
-"update - add working tree state to the staged set of changes\n"
-"revert - revert staged set of changes back to the HEAD version\n"
-"patch - pick hunks and update selectively\n"
-"diff - view diff between HEAD and index\n"
-"add untracked - add contents of untracked files to the staged set of "
-"changes\n"
-msgstr ""
-"status - 显示å«å˜æ›´çš„路径\n"
-"update - 添加工作区状æ€è‡³æš‚存列表\n"
-"revert - 还原修改的暂存集至 HEAD 版本\n"
-"patch - 挑选å—并且有选择地更新\n"
-"diff - 显示 HEAD 和索引间差异\n"
-"add untracked - 添加未跟踪文件的内容至暂存列表\n"
-
-#: git-add--interactive.perl
-msgid "missing --"
-msgstr "缺失 --"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "unknown --patch mode: %s"
-msgstr "未知的 --patch 模å¼ï¼š%s"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "invalid argument %s, expecting --"
-msgstr "无效的å‚æ•° %s,期望是 --"
-
#: git-send-email.perl
msgid "local zone differs from GMT by a non-minute interval\n"
msgstr "本地时间和 GMT 有ä¸åˆ°ä¸€åˆ†é’Ÿé—´éš”\n"
@@ -26500,13 +27687,13 @@ msgstr ""
#: git-send-email.perl
#, perl-format
-msgid "Failed to open %s: %s"
-msgstr "无法打开 %s: %s"
+msgid "Failed to open %s.final: %s"
+msgstr "无法打开 %s.final: %s"
#: git-send-email.perl
#, perl-format
-msgid "Failed to open %s.final: %s"
-msgstr "无法打开 %s.final: %s"
+msgid "Failed to open %s: %s"
+msgstr "无法打开 %s: %s"
#: git-send-email.perl
msgid "Summary email is empty, skipping it\n"
@@ -26684,8 +27871,8 @@ msgstr "(%s) ä¸èƒ½æ‰§è¡Œ '%s'"
#: git-send-email.perl
#, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) 添加 %s: %s 自:'%s'\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) éžæ³•çš„输出信æ¯ï¼Œæ¥è‡ªäºŽ: '%s'"
#: git-send-email.perl
#, perl-format
@@ -26693,6 +27880,11 @@ msgid "(%s) failed to close pipe to '%s'"
msgstr "(%s) 无法关闭管é“至 '%s'"
#: git-send-email.perl
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) 添加 %s: %s 自:'%s'\n"
+
+#: git-send-email.perl
msgid "cannot send message as 7bit"
msgstr "ä¸èƒ½ä»¥ 7bit å½¢å¼å‘é€ä¿¡æ¯"
diff --git a/po/zh_TW.po b/po/zh_TW.po
index 2f7d01c..312dd12 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -1,9 +1,11 @@
# Chinese (traditional) translations for Git package
# Git 套è£è»Ÿé«”çš„ç¹é«”中文翻譯。
# Copyright (C) 2012-2021 Jiang Xin <worldhello.net AT gmail.com>
-# Copyright (C) 2019-2021 Yi-Jyun Pan <pan93412@gmail.com>
+# Copyright (C) 2019-2023 Yi-Jyun Pan <pan93412@gmail.com>
# This file is distributed under the same license as the Git package.
#
+# The glossary can be found on https://github.com/l10n-tw/git-glossary
+#
# Contributors (CN):
# - Fangyi Zhou <me AT fangyi.io>
# - Jiang Xin <worldhello.net AT gmail.com>
@@ -17,13 +19,15 @@
# - Yichao Yu <yyc1992 AT gmail.com>
# - Zhuang Ya <zhuangya AT me.com>
#
-# Yi-Jyun Pan <pan93412@gmail.com>, 2021, 2022.
+# Yi-Jyun Pan <pan93412@gmail.com>, 2021, 2022, 2023, 2024.
+# Kaiyang Wu <self@origincode.me>, 2022.
+# lumynou5 <lumynou5.tw@gmail.com>, 2023, 2024.
msgid ""
msgstr ""
"Project-Id-Version: Git\n"
"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2022-06-23 21:13+0800\n"
-"PO-Revision-Date: 2022-06-23 23:02+0800\n"
+"POT-Creation-Date: 2024-02-18 20:48+0800\n"
+"PO-Revision-Date: 2024-02-18 20:50+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"
@@ -32,7 +36,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Poedit 3.1\n"
+"X-Generator: Poedit 3.4.2\n"
"X-ZhConverter: ç¹åŒ–姬 dict-f4bc617e-r910 @ 2019/11/16 20:23:12 | https://"
"zhconvert.org\n"
@@ -41,114 +45,114 @@ msgstr ""
msgid "Huh (%s)?"
msgstr "嗯(%s)?"
-#: add-interactive.c builtin/rebase.c reset.c sequencer.c
+#: add-interactive.c builtin/merge.c builtin/rebase.c reset.c sequencer.c
msgid "could not read index"
msgstr "無法讀å–索引"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "binary"
msgstr "二進ä½"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "nothing"
msgstr "ç„¡"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "unchanged"
msgstr "未變更"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "Update"
msgstr "æ›´æ–°"
#: add-interactive.c
#, c-format
msgid "could not stage '%s'"
-msgstr "無法暫存「%sã€"
+msgstr "無法暫存 “%sâ€"
#: add-interactive.c builtin/stash.c reset.c sequencer.c
msgid "could not write index"
msgstr "無法寫入索引"
-#: add-interactive.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-interactive.c
+#, c-format
msgid "updated %d path\n"
msgid_plural "updated %d paths\n"
msgstr[0] "已更新 %d 個路徑\n"
-#: add-interactive.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-interactive.c
+#, c-format
msgid "note: %s is untracked now.\n"
-msgstr "注æ„:%s ç¾å·²ä¸å†è¿½è¹¤ã€‚\n"
+msgstr "註:ç¾å·²ä¸å†è¿½è¹¤ %s。\n"
#: add-interactive.c apply.c builtin/checkout.c builtin/reset.c
#, c-format
msgid "make_cache_entry failed for path '%s'"
-msgstr "「%sã€è·¯å¾‘執行 make_cache_entry 失敗"
+msgstr "å° â€œ%s†路徑執行 make_cache_entry 失敗"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "Revert"
msgstr "還原"
#: add-interactive.c
msgid "Could not parse HEAD^{tree}"
-msgstr "ä¸èƒ½è§£æž HEAD^{樹}"
+msgstr "ç„¡æ³•è§£æž HEAD^{tree}"
-#: add-interactive.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-interactive.c
+#, c-format
msgid "reverted %d path\n"
msgid_plural "reverted %d paths\n"
-msgstr[0] "還原了 %d 個路徑\n"
+msgstr[0] "已還原 %d 個路徑\n"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
#, c-format
msgid "No untracked files.\n"
msgstr "沒有未追蹤的檔案。\n"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "Add untracked"
-msgstr "新增未追蹤的"
+msgstr "加入未追蹤項目"
-#: add-interactive.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-interactive.c
+#, c-format
msgid "added %d path\n"
msgid_plural "added %d paths\n"
-msgstr[0] "增加了 %d 個路徑\n"
+msgstr[0] "已加入 %d 個路徑\n"
#: add-interactive.c
#, c-format
msgid "ignoring unmerged: %s"
-msgstr "忽略未åˆä½µï¼š%s"
+msgstr "忽略未åˆä½µé …目:%s"
-#: add-interactive.c add-patch.c git-add--interactive.perl
+#: add-interactive.c add-patch.c
#, c-format
msgid "Only binary files changed.\n"
-msgstr "åªæœ‰äºŒé€²ä½æª”案被修改。\n"
+msgstr "åªæœ‰äºŒé€²ä½æª”案更動了。\n"
-#: add-interactive.c add-patch.c git-add--interactive.perl
+#: add-interactive.c add-patch.c
#, c-format
msgid "No changes.\n"
-msgstr "沒有修改。\n"
+msgstr "沒有更動。\n"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "Patch update"
msgstr "修補檔更新"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "Review diff"
-msgstr "檢視 diff"
+msgstr "檢閱差異"
#: add-interactive.c
msgid "show paths with changes"
-msgstr "顯示有變更的路徑"
+msgstr "顯示有更動的路徑"
#: add-interactive.c
msgid "add working tree state to the staged set of changes"
-msgstr "加入工作å€ç‹€æ…‹è‡³æš«å­˜åˆ—表"
+msgstr "將工作å€ç‹€æ…‹åŠ å…¥è‡³æš«å­˜æ›´å‹•é›†"
#: add-interactive.c
msgid "revert staged set of changes back to the HEAD version"
-msgstr "還原修改的暫存集至 HEAD 版本"
+msgstr "將暫存的更動集還原回 HEAD 版本"
#: add-interactive.c
msgid "pick hunks and update selectively"
@@ -160,7 +164,7 @@ msgstr "檢視 HEAD åŠç´¢å¼•ä¹‹é–“的差異"
#: add-interactive.c
msgid "add contents of untracked files to the staged set of changes"
-msgstr "加入未追蹤檔案的內容至暫存列表"
+msgstr "將未追蹤檔案的內容加入至更動暫存集"
#: add-interactive.c
msgid "Prompt help:"
@@ -168,23 +172,23 @@ msgstr "æ示說明:"
#: add-interactive.c
msgid "select a single item"
-msgstr "é¸æ“‡å–®ä¸€é …ç›®"
+msgstr "é¸å–一個項目"
#: add-interactive.c
msgid "select a range of items"
-msgstr "é¸æ“‡é …目範åœ"
+msgstr "é¸å–範åœä¸­é …ç›®"
#: add-interactive.c
msgid "select multiple ranges"
-msgstr "é¸æ“‡å¤šå€‹ç¯„åœ"
+msgstr "é¸å–多個範åœ"
#: add-interactive.c
msgid "select item based on unique prefix"
-msgstr "基於唯一å‰ç¶´é¸æ“‡é …ç›®"
+msgstr "根據ç¨ç‰¹å‰ç¶´é¸å–é …ç›®"
#: add-interactive.c
msgid "unselect specified items"
-msgstr "å–消é¸æ“‡æŒ‡å®šé …ç›®"
+msgstr "å–消é¸å–指定項目"
#: add-interactive.c
msgid "choose all items"
@@ -196,31 +200,31 @@ msgstr "(空)完æˆé¸å–"
#: add-interactive.c
msgid "select a numbered item"
-msgstr "é¸æ“‡ç·¨è™ŸéŽçš„é …ç›®"
+msgstr "é¸å–編號éŽçš„é …ç›®"
#: add-interactive.c
msgid "(empty) select nothing"
-msgstr "(空)全ä¸é¸å–"
+msgstr "(空)全部ä¸é¸å–"
-#: add-interactive.c builtin/clean.c git-add--interactive.perl
+#: add-interactive.c builtin/clean.c
msgid "*** Commands ***"
-msgstr "*** 指令 ***"
+msgstr "*** 命令 ***"
-#: add-interactive.c builtin/clean.c git-add--interactive.perl
+#: add-interactive.c builtin/clean.c
msgid "What now"
msgstr "è«‹é¸æ“‡"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "staged"
-msgstr "å¿«å–"
+msgstr "已暫存"
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
msgid "unstaged"
-msgstr "未快å–"
+msgstr "未暫存"
#: add-interactive.c apply.c builtin/am.c builtin/bugreport.c builtin/clone.c
-#: builtin/fetch.c builtin/merge.c builtin/pull.c builtin/submodule--helper.c
-#: git-add--interactive.perl
+#: builtin/diagnose.c builtin/fetch.c builtin/hook.c builtin/merge.c
+#: builtin/pull.c builtin/submodule--helper.c
msgid "path"
msgstr "路徑"
@@ -228,28 +232,28 @@ msgstr "路徑"
msgid "could not refresh index"
msgstr "無法é‡æ–°æ•´ç†ç´¢å¼•"
-#: add-interactive.c builtin/clean.c git-add--interactive.perl
+#: add-interactive.c builtin/clean.c
#, c-format
msgid "Bye.\n"
msgstr "å†è¦‹ã€‚\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stage mode change [y,n,q,a,d%s,?]? "
-msgstr "暫存模å¼è®Šæ›´ [y,n,q,a,d%s,?]? "
+msgstr "暫存模å¼æ›´å‹• [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stage deletion [y,n,q,a,d%s,?]? "
-msgstr "暫存刪除變更 [y,n,q,a,d%s,?]? "
+msgstr "暫存刪除動作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stage addition [y,n,q,a,d%s,?]? "
-msgstr "暫存新增變更 [y,n,q,a,d%s,?]? "
+msgstr "暫存加入動作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stage this hunk [y,n,q,a,d%s,?]? "
msgstr "暫存此å€å¡Š [y,n,q,a,d%s,?]? "
@@ -257,7 +261,7 @@ msgstr "暫存此å€å¡Š [y,n,q,a,d%s,?]? "
msgid ""
"If the patch applies cleanly, the edited hunk will immediately be marked for "
"staging."
-msgstr "如果修補檔能乾淨地套用,編輯å€å¡Šå°‡ç«‹å³æ¨™è¨˜ç‚ºæš«å­˜ã€‚"
+msgstr "如果修補檔能完全套用,編輯å€å¡Šå°‡ç«‹å³æ¨™è¨˜ç‚ºæš«å­˜ã€‚"
#: add-patch.c
msgid ""
@@ -273,31 +277,31 @@ msgstr ""
"a - 暫存此å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
"d - ä¸æš«å­˜æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stash mode change [y,n,q,a,d%s,?]? "
-msgstr "儲è—模å¼è®Šæ›´ [y,n,q,a,d%s,?]? "
+msgstr "貯存模å¼æ›´å‹• [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stash deletion [y,n,q,a,d%s,?]? "
-msgstr "儲è—刪除變更 [y,n,q,a,d%s,?]? "
+msgstr "貯存刪除動作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stash addition [y,n,q,a,d%s,?]? "
-msgstr "儲è—新增變更 [y,n,q,a,d%s,?]? "
+msgstr "貯存加入動作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Stash this hunk [y,n,q,a,d%s,?]? "
-msgstr "儲è—æ­¤å€å¡Š [y,n,q,a,d%s,?]? "
+msgstr "貯存此å€å¡Š [y,n,q,a,d%s,?]? "
#: add-patch.c
msgid ""
"If the patch applies cleanly, the edited hunk will immediately be marked for "
"stashing."
-msgstr "如果修補檔能乾淨地套用,編輯å€å¡Šå°‡ç«‹å³æ¨™è¨˜ç‚ºå„²è—。"
+msgstr "如果修補檔能完全套用,編輯å€å¡Šå°‡ç«‹å³æ¨™è¨˜ç‚ºè²¯å­˜ã€‚"
#: add-patch.c
msgid ""
@@ -307,29 +311,29 @@ msgid ""
"a - stash this hunk and all later hunks in the file\n"
"d - do not stash this hunk or any of the later hunks in the file\n"
msgstr ""
-"y - 儲è—æ­¤å€å¡Š\n"
-"n - ä¸è¦å„²è—æ­¤å€å¡Š\n"
-"q - 離開。ä¸å„²è—æ­¤å€å¡ŠåŠå¾Œé¢çš„全部å€å¡Š\n"
-"a - 儲è—æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
-"d - ä¸å„²è—æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
+"y - 貯存此å€å¡Š\n"
+"n - ä¸è¦è²¯å­˜æ­¤å€å¡Š\n"
+"q - 離開。ä¸è²¯å­˜æ­¤å€å¡ŠåŠå¾Œé¢çš„全部å€å¡Š\n"
+"a - 貯存此å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
+"d - ä¸è²¯å­˜æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Unstage mode change [y,n,q,a,d%s,?]? "
-msgstr "å–消暫存模å¼è®Šæ›´ [y,n,q,a,d%s,?]? "
+msgstr "å–消暫存模å¼æ›´å‹• [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Unstage deletion [y,n,q,a,d%s,?]? "
-msgstr "å–消暫存刪除變更 [y,n,q,a,d%s,?]? "
+msgstr "å–消暫存刪除動作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Unstage addition [y,n,q,a,d%s,?]? "
-msgstr "å–消暫存新增變更 [y,n,q,a,d%s,?]? "
+msgstr "å–消暫存加入動作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Unstage this hunk [y,n,q,a,d%s,?]? "
msgstr "å–消暫存此å€å¡Š [y,n,q,a,d%s,?]? "
@@ -337,7 +341,7 @@ msgstr "å–消暫存此å€å¡Š [y,n,q,a,d%s,?]? "
msgid ""
"If the patch applies cleanly, the edited hunk will immediately be marked for "
"unstaging."
-msgstr "如果修補檔能乾淨地套用,編輯å€å¡Šå°‡ç«‹å³æ¨™è¨˜ç‚ºæœªæš«å­˜ã€‚"
+msgstr "如果修補檔能完全套用,編輯å€å¡Šå°‡ç«‹å³æ¨™è¨˜ç‚ºæœªæš«å­˜ã€‚"
#: add-patch.c
msgid ""
@@ -353,23 +357,23 @@ msgstr ""
"a - ä¸æš«å­˜æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
"d - ä¸è¦ä¸æš«å­˜æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply mode change to index [y,n,q,a,d%s,?]? "
-msgstr "將模å¼è®Šæ›´å¥—用到索引 [y,n,q,a,d%s,?]? "
+msgstr "將模å¼æ›´å‹•å¥—用到索引 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply deletion to index [y,n,q,a,d%s,?]? "
-msgstr "將刪除變更套用到索引 [y,n,q,a,d%s,?]? "
+msgstr "將刪除動作套用至索引 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply addition to index [y,n,q,a,d%s,?]? "
-msgstr "套用新增變更至索引 [y,n,q,a,d%s,?]? "
+msgstr "將加入動作套用至索引 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply this hunk to index [y,n,q,a,d%s,?]? "
msgstr "將此å€å¡Šå¥—用到索引 [y,n,q,a,d%s,?]? "
@@ -377,7 +381,7 @@ msgstr "將此å€å¡Šå¥—用到索引 [y,n,q,a,d%s,?]? "
msgid ""
"If the patch applies cleanly, the edited hunk will immediately be marked for "
"applying."
-msgstr "如果修補檔能乾淨地套用,編輯å€å¡Šå°‡ç«‹å³æ¨™è¨˜ç‚ºå¥—用。"
+msgstr "如果修補檔能完全套用,編輯å€å¡Šå°‡ç«‹å³æ¨™è¨˜ç‚ºå¥—用。"
#: add-patch.c
msgid ""
@@ -393,31 +397,31 @@ msgstr ""
"a - 套用此å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
"d - ä¸è¦å¥—用此å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard mode change from worktree [y,n,q,a,d%s,?]? "
-msgstr "從工作å€ä¸­æ¨æ£„模å¼è®Šæ›´ [y,n,q,a,d%s,?]? "
+msgstr "從工作å€æ¨æ£„模å¼æ›´å‹• [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard deletion from worktree [y,n,q,a,d%s,?]? "
-msgstr "從工作å€ä¸­æ¨æ£„刪除變更 [y,n,q,a,d%s,?]? "
+msgstr "從工作å€æ¨æ£„刪除動作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard addition from worktree [y,n,q,a,d%s,?]? "
-msgstr "放棄工作目錄的新增變更 [y,n,q,a,d%s,?]? "
+msgstr "從工作å€æ¨æ£„加入動作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard this hunk from worktree [y,n,q,a,d%s,?]? "
-msgstr "從工作å€ä¸­æ¨æ£„æ­¤å€å¡Š [y,n,q,a,d%s,?]? "
+msgstr "從工作å€æ¨æ£„æ­¤å€å¡Š [y,n,q,a,d%s,?]? "
#: add-patch.c
msgid ""
"If the patch applies cleanly, the edited hunk will immediately be marked for "
"discarding."
-msgstr "如果修補檔能乾淨地套用,編輯å€å¡Šå°‡ç«‹å³æ¨™è¨˜ç‚ºæ¨æ£„。"
+msgstr "如果修補檔能完全套用,編輯å€å¡Šå°‡ç«‹å³æ¨™è¨˜ç‚ºæ¨æ£„。"
#: add-patch.c
msgid ""
@@ -433,25 +437,25 @@ msgstr ""
"a - æ¨æ£„æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
"d - ä¸è¦æ¨æ£„æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard mode change from index and worktree [y,n,q,a,d%s,?]? "
-msgstr "從索引和工作å€ä¸­æ¨æ£„模å¼è®Šæ›´ [y,n,q,a,d%s,?]? "
+msgstr "從索引和工作å€æ¨æ£„模å¼æ›´å‹• [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard deletion from index and worktree [y,n,q,a,d%s,?]? "
-msgstr "從索引和工作å€ä¸­æ¨æ£„刪除 [y,n,q,a,d%s,?]? "
+msgstr "從索引和工作å€æ¨æ£„刪除 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard addition from index and worktree [y,n,q,a,d%s,?]? "
-msgstr "放棄索引åŠå·¥ä½œç›®éŒ„的新增變更 [y,n,q,a,d%s,?]? "
+msgstr "從索引和工作å€æ¨æ£„加入動作 [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Discard this hunk from index and worktree [y,n,q,a,d%s,?]? "
-msgstr "從索引和工作å€ä¸­æ¨æ£„æ­¤å€å¡Š [y,n,q,a,d%s,?]? "
+msgstr "從索引和工作å€æ¨æ£„æ­¤å€å¡Š [y,n,q,a,d%s,?]? "
#: add-patch.c
msgid ""
@@ -467,23 +471,23 @@ msgstr ""
"a - æ¨æ£„æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
"d - ä¸è¦æ¨æ£„æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply mode change to index and worktree [y,n,q,a,d%s,?]? "
-msgstr "將模å¼è®Šæ›´å¥—ç”¨åˆ°ç´¢å¼•å’Œå·¥ä½œå€ [y,n,q,a,d%s,?]? "
+msgstr "將模å¼æ›´å‹•å¥—ç”¨åˆ°ç´¢å¼•å’Œå·¥ä½œå€ [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply deletion to index and worktree [y,n,q,a,d%s,?]? "
-msgstr "å°‡åˆªé™¤è®Šæ›´å¥—ç”¨åˆ°ç´¢å¼•å’Œå·¥ä½œå€ [y,n,q,a,d%s,?]? "
+msgstr "å°‡åˆªé™¤å‹•ä½œå¥—ç”¨åˆ°ç´¢å¼•å’Œå·¥ä½œå€ [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply addition to index and worktree [y,n,q,a,d%s,?]? "
-msgstr "套用索引åŠå·¥ä½œç›®éŒ„的新增變更 [y,n,q,a,d%s,?]? "
+msgstr "å°‡åŠ å…¥å‹•ä½œå¥—ç”¨åˆ°ç´¢å¼•å’Œå·¥ä½œå€ [y,n,q,a,d%s,?]? "
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
msgid "Apply this hunk to index and worktree [y,n,q,a,d%s,?]? "
msgstr "將此å€å¡Šå¥—ç”¨åˆ°ç´¢å¼•å’Œå·¥ä½œå€ [y,n,q,a,d%s,?]? "
@@ -502,6 +506,26 @@ msgstr ""
"d - ä¸è¦å¥—用此å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
#: add-patch.c
+#, c-format
+msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
+msgstr "將模å¼æ›´å‹•å¥—ç”¨åˆ°å·¥ä½œå€ [y,n,q,a,d%s,?]? "
+
+#: add-patch.c
+#, c-format
+msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
+msgstr "å°‡åˆªé™¤å‹•ä½œå¥—ç”¨åˆ°å·¥ä½œå€ [y,n,q,a,d%s,?]? "
+
+#: add-patch.c
+#, c-format
+msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
+msgstr "å°‡åŠ å…¥å‹•ä½œå¥—ç”¨åˆ°å·¥ä½œå€ [y,n,q,a,d%s,?]? "
+
+#: add-patch.c
+#, c-format
+msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
+msgstr "將此å€å¡Šå¥—ç”¨åˆ°å·¥ä½œå€ [y,n,q,a,d%s,?]? "
+
+#: add-patch.c
msgid ""
"y - apply this hunk to worktree\n"
"n - do not apply this hunk to worktree\n"
@@ -518,25 +542,20 @@ msgstr ""
#: add-patch.c
#, c-format
msgid "could not parse hunk header '%.*s'"
-msgstr "無法解æžå€å¡Šæ¨™é ­ '%.*s'"
-
-#: add-patch.c
-#, c-format
-msgid "could not parse colored hunk header '%.*s'"
-msgstr "無法解æžä¸Šè‰²éŽçš„å€å¡Šæ¨™é ­ '%.*s'"
+msgstr "無法解æžå€å¡Šæ¨™é ­ “%.*sâ€"
#: add-patch.c
msgid "could not parse diff"
-msgstr "無法解æžå·®ç•° (diff)"
+msgstr "無法解æžå·®ç•°"
#: add-patch.c
msgid "could not parse colored diff"
-msgstr "無法解æžä¸Šè‰²éŽçš„差異 (diff)"
+msgstr "無法解æžä¸Šè‰²éŽçš„差異"
#: add-patch.c
#, c-format
msgid "failed to run '%s'"
-msgstr "無法執行 '%s'"
+msgstr "無法執行 “%sâ€"
#: add-patch.c
msgid "mismatched output from interactive.diffFilter"
@@ -547,7 +566,7 @@ msgid ""
"Your filter must maintain a one-to-one correspondence\n"
"between its input and output lines."
msgstr ""
-"您的éŽæ¿¾å™¨å¿…須在其輸入åŠè¼¸å‡ºè¡Œ\n"
+"您的éŽæ¿¾å™¨å¿…須在其輸入åŠè¼¸å‡ºåˆ—\n"
"維æŒä¸€å°ä¸€çš„å°æ‡‰é—œä¿‚。"
#: add-patch.c
@@ -556,7 +575,7 @@ msgid ""
"expected context line #%d in\n"
"%.*s"
msgstr ""
-"應有上下文行 #%d 於\n"
+"é æœŸåœ¨ä¸‹è¿°ä½ç½®æœ‰ä¸Šä¸‹æ–‡åˆ— #%d:\n"
"%.*s"
#: add-patch.c
@@ -569,12 +588,12 @@ msgid ""
msgstr ""
"å€å¡Šæœªé‡ç–Šï¼š\n"
"%.*s\n"
-"\tä¸ä»¥ä¸‹è¿°çµå°¾ï¼š\n"
+"\tçµå°¾ä¸æ˜¯ï¼š\n"
"%.*s"
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "Manual hunk edit mode -- see bottom for a quick guide.\n"
-msgstr "手動å€å¡Šç·¨è¼¯æ¨¡å¼ -- 檢視底部的快速指å—。\n"
+msgstr "手動å€å¡Šç·¨è¼¯æ¨¡å¼â€”—檢視底部的快速指引。\n"
#: add-patch.c
#, c-format
@@ -585,20 +604,19 @@ msgid ""
"Lines starting with %c will be removed.\n"
msgstr ""
"---\n"
-"è¦åˆªé™¤ '%c' 開始的行,使其æˆç‚º ' ' 開始的行(上下文)。\n"
-"è¦åˆªé™¤ '%c' 開始的行,刪除它們。\n"
-"以 %c 開始的行將被刪除。\n"
+"è¦åˆªé™¤ “%c†開頭的列,請將列首(上下文)改æˆç©ºç™½ã€‚\n"
+"è¦åˆªé™¤ “%c†開頭的列,請直接刪除。\n"
+"開頭是 %c 的列將會被移除。\n"
-#. TRANSLATORS: 'it' refers to the patch mentioned in the previous messages.
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid ""
"If it does not apply cleanly, you will be given an opportunity to\n"
"edit again. If all lines of the hunk are removed, then the edit is\n"
"aborted and the hunk is left unchanged.\n"
msgstr ""
-"如果未乾淨套用,您就有機會é‡æ–°ç·¨è¼¯ã€‚\n"
-"若刪掉此å€å¡Šçš„全部內容,則會中止\n"
-"本次編輯,å€å¡Šå‰‡ä¸æœƒè¢«ä¿®æ”¹ã€‚\n"
+"如果沒有完全套用,您å¯ä»¥å†æ¬¡ç·¨è¼¯ã€‚\n"
+"若刪掉此å€å¡Šçš„所有內容,則會中止編輯,\n"
+"å€å¡Šå‰‡ä¸æœƒè®Šæ›´ã€‚\n"
#: add-patch.c
msgid "could not parse hunk header"
@@ -606,7 +624,7 @@ msgstr "無法解æžå€å¡Šæ¨™é ­"
#: add-patch.c
msgid "'git apply --cached' failed"
-msgstr "「git apply --cachedã€å¤±æ•—"
+msgstr "“git apply --cached†失敗"
#. TRANSLATORS: do not translate [y/n]
#. The program will only accept that input at this point.
@@ -614,26 +632,20 @@ msgstr "「git apply --cachedã€å¤±æ•—"
#. (saying "n" for "no" discards!) if the translation
#. of the word "no" does not start with n.
#.
-#. TRANSLATORS: do not translate [y/n]
-#. The program will only accept that input
-#. at this point.
-#. Consider translating (saying "no" discards!) as
-#. (saying "n" for "no" discards!) if the translation
-#. of the word "no" does not start with n.
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid ""
"Your edited hunk does not apply. Edit again (saying \"no\" discards!) [y/n]? "
-msgstr "未套用編輯å€å¡Šã€‚是å¦é‡æ–°ç·¨è¼¯ï¼ˆè¼¸å…¥ “no†æ¨æ£„ï¼ï¼‰ [y/n]? "
+msgstr "未套用您編輯的å€å¡Šã€‚是å¦é‡æ–°ç·¨è¼¯ï¼ˆè¼¸å…¥ “no†æ¨æ£„ï¼ï¼‰ [y/n]? "
#: add-patch.c
msgid "The selected hunks do not apply to the index!"
-msgstr "é¸å–çš„å€å¡Šä¸æœƒå¥—用進索引ï¼"
+msgstr "é¸å–çš„å€å¡Šç„¡æ³•å¥—用至索引ï¼"
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "Apply them to the worktree anyway? "
-msgstr "無論如何都è¦å¥—用到工作å€å—Žï¼Ÿ "
+msgstr "無論如何都è¦å¥—用到工作å€å—Ž? "
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "Nothing was applied.\n"
msgstr "未套用。\n"
@@ -669,20 +681,20 @@ msgstr "沒有下一個å€å¡Š"
#: add-patch.c
msgid "No other hunks to goto"
-msgstr "沒有其它å¯ä¾›è·³è½‰çš„å€å¡Š"
+msgstr "沒有其它å¯ä»¥è·³è½‰çš„å€å¡Š"
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "go to which hunk (<ret> to see more)? "
-msgstr "è¦è·³è½‰åˆ°å“ªå€‹å€å¡Šï¼ˆ<Enter> 檢視更多)? "
+msgstr "è¦è·³è½‰åˆ°å“ªå€‹å€å¡Šï¼ˆ<ret> 檢視更多)? "
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "go to which hunk? "
-msgstr "跳轉到哪個å€å¡Šï¼Ÿ "
+msgstr "跳轉到哪個å€å¡Š? "
#: add-patch.c
#, c-format
msgid "Invalid number: '%s'"
-msgstr "無效數字:'%s'"
+msgstr "無效數字:“%sâ€"
#: add-patch.c
#, c-format
@@ -692,20 +704,20 @@ msgstr[0] "å°ä¸èµ·ï¼Œåªæœ‰ %d 個å¯ç”¨å€å¡Šã€‚"
#: add-patch.c
msgid "No other hunks to search"
-msgstr "沒有其它å¯ä¾›å°‹æ‰¾çš„å€å¡Š"
+msgstr "沒有其它å¯ä»¥å°‹æ‰¾çš„å€å¡Š"
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
msgid "search for regex? "
-msgstr "使用常è¦è¡¨ç¤ºå¼æœå°‹ï¼Ÿ "
+msgstr "使用常è¦è¡¨ç¤ºå¼æœå°‹? "
#: add-patch.c
#, c-format
msgid "Malformed search regexp %s: %s"
-msgstr "錯誤的常è¦è¡¨ç¤ºå¼ %s:%s"
+msgstr "æ ¼å¼éŒ¯èª¤çš„常è¦è¡¨ç¤ºå¼ %s:%s"
#: add-patch.c
msgid "No hunk matches the given pattern"
-msgstr "沒有和æ供模å¼ç›¸ç¬¦åˆçš„å€å¡Š"
+msgstr "沒有符åˆæ供模å¼çš„å€å¡Š"
#: add-patch.c
msgid "Sorry, cannot split this hunk"
@@ -718,11 +730,11 @@ msgstr "分割為 %d 個å€å¡Šã€‚"
#: add-patch.c
msgid "Sorry, cannot edit this hunk"
-msgstr "å°ä¸èµ·ï¼Œä¸èƒ½ç·¨è¼¯é€™å€‹å€å¡Š"
+msgstr "å°ä¸èµ·ï¼Œç„¡æ³•ç·¨è¼¯é€™å€‹å€å¡Š"
#: add-patch.c
msgid "'git apply' failed"
-msgstr "'git apply' 失敗"
+msgstr "“git apply†失敗"
#: advice.c
#, c-format
@@ -731,7 +743,7 @@ msgid ""
"Disable this message with \"git config advice.%s false\""
msgstr ""
"\n"
-"請使用「git config advice.%s falseã€ä¾†åœç”¨æ­¤è¨Šæ¯"
+"請使用 “git config advice.%s false†åœç”¨æ­¤è¨Šæ¯"
#: advice.c
#, c-format
@@ -740,56 +752,73 @@ msgstr "%sæ示:%.*s%s\n"
#: advice.c
msgid "Cherry-picking is not possible because you have unmerged files."
-msgstr "無法æ€é¸ï¼Œå› ç‚ºæ‚¨æœ‰æœªåˆä½µçš„檔案。"
+msgstr "無法æ€é¸ï¼Œæœ‰æœªåˆä½µçš„檔案。"
#: advice.c
msgid "Committing is not possible because you have unmerged files."
-msgstr "無法æ交,因為您有未åˆä½µçš„檔案。"
+msgstr "無法æ交,有未åˆä½µçš„檔案。"
#: advice.c
msgid "Merging is not possible because you have unmerged files."
-msgstr "無法åˆä½µï¼Œå› ç‚ºæ‚¨æœ‰æœªåˆä½µçš„檔案。"
+msgstr "無法åˆä½µï¼Œæœ‰æœªåˆä½µçš„檔案。"
#: advice.c
msgid "Pulling is not possible because you have unmerged files."
-msgstr "無法拉å–,因為您有未åˆä½µçš„檔案。"
+msgstr "無法拉å–,有未åˆä½µçš„檔案。"
#: advice.c
msgid "Reverting is not possible because you have unmerged files."
-msgstr "無法還原æ交,因為您有未åˆä½µçš„檔案。"
+msgstr "無法還原æ交,有未åˆä½µçš„檔案。"
#: advice.c
-#, c-format
-msgid "It is not possible to %s because you have unmerged files."
-msgstr "無法 %s,因為您有未åˆä½µçš„檔案。"
+msgid "Rebasing is not possible because you have unmerged files."
+msgstr "無法é‡å®šåŸºåº•ï¼Œæœ‰æœªåˆä½µçš„檔案。"
#: advice.c
msgid ""
"Fix them up in the work tree, and then use 'git add/rm <file>'\n"
"as appropriate to mark resolution and make a commit."
msgstr ""
-"請在工作å€æ”¹æ­£æª”案,然後酌情使用 'git add/rm <檔案>' 指令標記\n"
-"解決方案並æ交。"
+"請在工作å€ä¿®æ­£æª”案,然後視情æ³ä½¿ç”¨ “git add/rm <file>â€\n"
+"命令標記解決方案並æ交。"
#: advice.c
msgid "Exiting because of an unresolved conflict."
-msgstr "因為存在未解決的è¡çªè€Œé›¢é–‹ã€‚"
+msgstr "存在未解決的è¡çªï¼Œé›¢é–‹ã€‚"
#: advice.c builtin/merge.c
msgid "You have not concluded your merge (MERGE_HEAD exists)."
-msgstr "您尚未çµæŸæ‚¨çš„åˆä½µï¼ˆå­˜åœ¨ MERGE_HEAD)。"
+msgstr "åˆä½µå°šæœªçµæŸï¼ˆæœ‰ MERGE_HEAD)。"
#: advice.c
msgid "Please, commit your changes before merging."
-msgstr "請在åˆä½µå‰å…ˆæ交您的修改。"
+msgstr "請在åˆä½µå‰å…ˆæ交您的更動。"
#: advice.c
msgid "Exiting because of unfinished merge."
-msgstr "因為存在未完æˆçš„åˆä½µè€Œé›¢é–‹ã€‚"
+msgstr "存在未完æˆçš„åˆä½µï¼Œé›¢é–‹ã€‚"
+
+#: advice.c
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"岔開的分支ä¸èƒ½å¿«è½‰ï¼Œæ‚¨å¾—執行:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"或者:\n"
+"\n"
+"\tgit rebase\n"
#: advice.c
msgid "Not possible to fast-forward, aborting."
-msgstr "無法快轉,終止。"
+msgstr "無法快轉,中止。"
#: advice.c
#, c-format
@@ -834,58 +863,93 @@ msgid ""
"false\n"
"\n"
msgstr ""
-"注æ„:正在切æ›åˆ° '%s'。\n"
+"註:切æ›è‡³ “%sâ€ã€‚\n"
"\n"
-"您正處於分離開頭指標狀態。您å¯ä»¥æª¢è¦–ã€é€²è¡Œå¯¦é©—性修改並æ交,\n"
-"而且您å¯ä»¥åœ¨åˆ‡æ›å›žä¸€å€‹åˆ†æ”¯æ™‚,\n"
-"æ¨æ£„在此狀態下所åšçš„æ交而ä¸å°åˆ†æ”¯é€ æˆå½±éŸ¿ã€‚\n"
+"您正處於「分離 HEADã€ç‹€æ…‹ã€‚您å¯ä»¥æª¢è¦–ã€é€²è¡Œå¯¦é©—性修改並æ交,\n"
+"而且您å¯ä»¥åœ¨åˆ‡å›žåˆ†æ”¯æ™‚,æ¨æ£„在此狀態下所åšçš„æ交\n"
+"而ä¸å°åˆ†æ”¯é€ æˆå½±éŸ¿ã€‚\n"
"\n"
"如果您想è¦é€éŽå»ºç«‹åˆ†æ”¯ä¾†ä¿ç•™åœ¨æ­¤ç‹€æ…‹ä¸‹æ‰€åšçš„æ交,\n"
"您å¯ä»¥ç¾åœ¨æˆ–ç¨å¾Œåœ¨ switch 指令使用 -c é¸é …。例如:\n"
"\n"
" git switch -c <新分支å稱>\n"
"\n"
-"或者是復原此動作:\n"
+"或者是使用下述命令復原此動作:\n"
"\n"
" git switch -\n"
"\n"
"將組態變數 advice.detachedHead 設定為 false,å³å¯é—œé–‰æœ¬å»ºè­°\n"
"\n"
+#: advice.c
+#, c-format
+msgid ""
+"The following paths have been moved outside the\n"
+"sparse-checkout definition but are not sparse due to local\n"
+"modifications.\n"
+msgstr ""
+"以下路徑已經移到稀ç–簽出定義之外的地方,\n"
+"但因為有本機更動,因此路徑ä¸æ˜¯ç¨€ç–的。\n"
+
+#: advice.c
+msgid ""
+"To correct the sparsity of these paths, do the following:\n"
+"* Use \"git add --sparse <paths>\" to update the index\n"
+"* Use \"git sparse-checkout reapply\" to apply the sparsity rules"
+msgstr ""
+"è‹¥è¦æ›´æ­£é€™äº›è·¯å¾‘的稀ç–狀態,請:\n"
+"* 使用 “git add --sparse <路徑†更新索引\n"
+"* 使用 “git sparse-checkout reapply†套用稀ç–è¦å‰‡"
+
#: alias.c
msgid "cmdline ends with \\"
-msgstr "指令列以 \\ çµå°¾"
+msgstr "命令列以 \\ çµå°¾"
#: alias.c
msgid "unclosed quote"
msgstr "未閉åˆçš„引號"
+#: alias.c builtin/cat-file.c builtin/notes.c builtin/prune-packed.c
+#: builtin/receive-pack.c builtin/tag.c t/helper/test-pkt-line.c
+msgid "too many arguments"
+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'"
-
-#: apply.c archive.c builtin/add.c builtin/branch.c builtin/checkout.c
-#: builtin/clone.c builtin/commit.c builtin/describe.c builtin/diff-tree.c
-#: builtin/difftool.c builtin/fast-export.c builtin/fetch.c builtin/help.c
-#: builtin/index-pack.c builtin/init-db.c builtin/log.c builtin/ls-files.c
-#: builtin/merge-base.c builtin/merge.c builtin/pack-objects.c builtin/push.c
-#: builtin/rebase.c builtin/repack.c builtin/reset.c builtin/rev-list.c
-#: builtin/show-branch.c builtin/stash.c builtin/submodule--helper.c
-#: builtin/tag.c builtin/worktree.c parse-options.c range-diff.c revision.c
+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
+#: builtin/describe.c builtin/diff-tree.c builtin/difftool.c
+#: builtin/fast-export.c builtin/fetch.c builtin/help.c builtin/index-pack.c
+#: builtin/init-db.c builtin/log.c builtin/ls-files.c builtin/merge-base.c
+#: builtin/merge-tree.c builtin/merge.c builtin/pack-objects.c builtin/rebase.c
+#: builtin/repack.c builtin/replay.c builtin/reset.c builtin/rev-list.c
+#: builtin/rev-parse.c builtin/show-branch.c builtin/stash.c
+#: builtin/submodule--helper.c builtin/tag.c builtin/worktree.c parse-options.c
+#: range-diff.c revision.c
#, c-format
msgid "options '%s' and '%s' cannot be used together"
-msgstr "ä¸èƒ½åŒæ™‚使用 '%s' å’Œ '%s' é¸é …"
+msgstr "無法åŒæ™‚使用 “%s†和 “%s†é¸é …"
#: apply.c
#, c-format
msgid "'%s' outside a repository"
-msgstr "'%s' 在版本庫之外"
+msgstr "“%s†在版本庫之外"
+
+#: apply.c
+msgid "failed to read patch"
+msgstr "無法讀å–修補檔"
+
+#: apply.c
+msgid "patch too large"
+msgstr "修補檔éŽå¤§"
#: apply.c
#, c-format
@@ -895,42 +959,42 @@ msgstr "無法準備時間戳常è¦è¡¨ç¤ºå¼ %s"
#: apply.c
#, c-format
msgid "regexec returned %d for input: %s"
-msgstr "regexec 返回 %d,輸入為:%s"
+msgstr "regexec 回傳 %d,輸入為:%s"
#: apply.c
#, c-format
msgid "unable to find filename in patch at line %d"
-msgstr "ä¸èƒ½åœ¨ä¿®è£œæª”的第 %d 行找到檔案å"
+msgstr "無法在修補檔的第 %d 列找到檔案å稱"
#: apply.c
#, c-format
msgid "git apply: bad git-diff - expected /dev/null, got %s on line %d"
-msgstr "git apply:錯誤的 git-diff - 應為 /dev/null,但在第 %2$d 行得到 %1$s"
+msgstr "git apply:無效的 git-diff — 應為 /dev/null,但在第 %2$d 列得到 %1$s"
#: apply.c
#, c-format
msgid "git apply: bad git-diff - inconsistent new filename on line %d"
-msgstr "git apply:錯誤的 git-diff - 第 %d 行上新檔案åä¸ä¸€è‡´"
+msgstr "git apply:無效的 git-diff — 第 %d 列的新檔案å稱ä¸ä¸€è‡´"
#: apply.c
#, c-format
msgid "git apply: bad git-diff - inconsistent old filename on line %d"
-msgstr "git apply:錯誤的 git-diff - 第 %d 行上舊檔案åä¸ä¸€è‡´"
+msgstr "git apply:無效的 git-diff — 第 %d 列上舊檔案å稱ä¸ä¸€è‡´"
#: apply.c
#, c-format
msgid "git apply: bad git-diff - expected /dev/null on line %d"
-msgstr "git apply:錯誤的 git-diff - 第 %d 行處應為 /dev/null"
+msgstr "git apply:無效的 git-diff — 第 %d 列處é æœŸæ˜¯ /dev/null"
#: apply.c
#, c-format
msgid "invalid mode on line %d: %s"
-msgstr "第 %d 行包å«ç„¡æ•ˆæª”案模å¼ï¼š%s"
+msgstr "第 %d 列包å«ç„¡æ•ˆæª”案模å¼ï¼š%s"
#: apply.c
#, c-format
msgid "inconsistent header lines %d and %d"
-msgstr "ä¸ä¸€è‡´çš„檔案頭,%d 行和 %d è¡Œ"
+msgstr "ä¸ä¸€è‡´çš„檔案標頭(%d 列和 %d 列)"
#: apply.c
#, c-format
@@ -940,22 +1004,22 @@ msgid ""
msgid_plural ""
"git diff header lacks filename information when removing %d leading pathname "
"components (line %d)"
-msgstr[0] "當移除 %d 個å‰å°Žè·¯å¾‘後 git diff 頭缺ä¹æª”案å訊æ¯ï¼ˆç¬¬ %d 行)"
+msgstr[0] "移除 %d 個å‰å°Žè·¯å¾‘部分後,git diff 標頭缺少檔案å稱資訊(第 %d 列)"
#: apply.c
#, c-format
msgid "git diff header lacks filename information (line %d)"
-msgstr "git diff 的標頭訊æ¯ä¸­ç¼ºä¹æª”案å訊æ¯ï¼ˆç¬¬ %d 行)"
+msgstr "git diff 標頭缺少檔案å稱資訊(第 %d 列)"
#: apply.c
#, c-format
msgid "recount: unexpected line: %.*s"
-msgstr "recount:æ„外的行:%.*s"
+msgstr "recount:é‡åˆ°éžé æœŸçš„列:%.*s"
#: apply.c
#, c-format
msgid "patch fragment without header at line %d: %.*s"
-msgstr "第 %d 行的修補檔å€å¡Šæ²’有標頭訊æ¯ï¼š%.*s"
+msgstr "第 %d 列的修補檔å€æ®µæ²’有標頭:%.*s"
#: apply.c
msgid "new file depends on old contents"
@@ -968,7 +1032,7 @@ msgstr "刪除的檔案ä»æœ‰å…§å®¹"
#: apply.c
#, c-format
msgid "corrupt patch at line %d"
-msgstr "修補檔在第 %d 行發ç¾æ壞"
+msgstr "修補檔在第 %d 列發ç¾æ壞"
#: apply.c
#, c-format
@@ -988,17 +1052,17 @@ msgstr "** 警告:檔案 %s æˆç‚ºç©ºæª”案但並未刪除"
#: apply.c
#, c-format
msgid "corrupt binary patch at line %d: %.*s"
-msgstr "二進ä½ä¿®è£œæª”在第 %d è¡Œæ壞:%.*s"
+msgstr "二進ä½ä¿®è£œæª”在第 %d 列æ壞:%.*s"
#: apply.c
#, c-format
msgid "unrecognized binary patch at line %d"
-msgstr "無法識別的二進ä½ä¿®è£œæª”ä½æ–¼ç¬¬ %d è¡Œ"
+msgstr "第 %d 列的二進ä½ä¿®è£œæª”無法識別"
#: apply.c
#, c-format
msgid "patch with only garbage at line %d"
-msgstr "修補檔案的第 %d è¡Œåªæœ‰åžƒåœ¾è³‡æ–™"
+msgstr "修補檔案的第 %d 列åªæœ‰åžƒåœ¾è³‡æ–™"
#: apply.c
#, c-format
@@ -1008,23 +1072,23 @@ msgstr "無法讀å–ç¬¦è™Ÿé€£çµ %s"
#: apply.c
#, c-format
msgid "unable to open or read %s"
-msgstr "ä¸èƒ½é–‹å•Ÿæˆ–è®€å– %s"
+msgstr "ç„¡æ³•é–‹å•Ÿæˆ–è®€å– %s"
#: apply.c
#, c-format
msgid "invalid start of line: '%c'"
-msgstr "無效的行首字元:'%c'"
+msgstr "無效的列首字元:“%câ€"
#: apply.c
#, c-format
msgid "Hunk #%d succeeded at %d (offset %d line)."
msgid_plural "Hunk #%d succeeded at %d (offset %d lines)."
-msgstr[0] "å€å¡Š #%d æˆåŠŸå¥—用於 %d(ä½ç§» %d 行)。"
+msgstr[0] "å€å¡Š #%d æˆåŠŸå¥—用於 %d(å移 %d 列)。"
#: apply.c
#, c-format
msgid "Context reduced to (%ld/%ld) to apply fragment at %d"
-msgstr "上下文減少到(%ld/%ld)以在第 %d 行套用修補檔å€å¡Š"
+msgstr "上下文減少到(%ld/%ld)以在第 %d 列套用修補檔å€å¡Š"
#: apply.c
#, c-format
@@ -1038,53 +1102,53 @@ msgstr ""
#: apply.c
#, c-format
msgid "missing binary patch data for '%s'"
-msgstr "缺少 '%s' 的二進ä½ä¿®è£œæª”資料"
+msgstr "缺少 “%s†的二進ä½ä¿®è£œæª”資料"
#: apply.c
#, c-format
msgid "cannot reverse-apply a binary patch without the reverse hunk to '%s'"
-msgstr "ä¸èƒ½åå‘套用一個缺少到 '%s' çš„åå‘資料å€å¡Šçš„二進ä½ä¿®è£œæª”"
+msgstr "無法åå‘套用一個缺少至 “%s†的åå‘資料å€å¡Šçš„二進ä½ä¿®è£œæª”"
#: apply.c
#, c-format
msgid "cannot apply binary patch to '%s' without full index line"
-msgstr "ä¸èƒ½åœ¨ '%s' 上套用沒有完整索引行的二進ä½ä¿®è£œæª”"
+msgstr "無法在 “%s†上套用沒有完整索引列的二進ä½ä¿®è£œæª”"
#: apply.c
#, c-format
msgid ""
"the patch applies to '%s' (%s), which does not match the current contents."
-msgstr "修補檔套用到 '%s'(%s),但是和目å‰å…§å®¹ä¸ç¬¦åˆã€‚"
+msgstr "修補檔è¦å¥—用到 “%sâ€ï¼ˆ%s),但與目å‰å…§å®¹ä¸ç¬¦ã€‚"
#: apply.c
#, c-format
msgid "the patch applies to an empty '%s' but it is not empty"
-msgstr "修補檔套用到空檔案 '%s',但其並éžç©ºæª”案"
+msgstr "修補檔è¦å¥—用至空檔案 “%sâ€ï¼Œä½†å…¶éžç©ºæª”案"
#: apply.c
#, c-format
msgid "the necessary postimage %s for '%s' cannot be read"
-msgstr "ç„¡æ³•è®€å– '%2$s' 必需的目標檔案 %1$s"
+msgstr "ç„¡æ³•è®€å– â€œ%2$s†必須的目標檔案 %1$s"
#: apply.c
#, c-format
msgid "binary patch does not apply to '%s'"
-msgstr "二進ä½ä¿®è£œæª”未套用到 '%s'"
+msgstr "二進ä½ä¿®è£œæª”未套用到 “%sâ€"
#: apply.c
#, c-format
msgid "binary patch to '%s' creates incorrect result (expecting %s, got %s)"
-msgstr "到 '%s' 的二進ä½ä¿®è£œæª”產生了ä¸æ­£ç¢ºçš„çµæžœï¼ˆæ‡‰ç‚º %s,å»ç‚º %s)"
+msgstr "修補 “%s†的二進ä½ä¿®è£œæª”,產生了ä¸æ­£ç¢ºçš„çµæžœï¼ˆé æœŸ %s,å»ç‚º %s)"
#: apply.c
#, c-format
msgid "patch failed: %s:%ld"
-msgstr "打修補檔失敗:%s:%ld"
+msgstr "修補失敗:%s:%ld"
-#: apply.c
+#: apply.c builtin/mv.c
#, c-format
msgid "cannot checkout %s"
-msgstr "ä¸èƒ½ç°½å‡º %s"
+msgstr "無法簽出 %s"
#: apply.c midx.c pack-mtimes.c pack-revindex.c setup.c
#, c-format
@@ -1094,51 +1158,51 @@ msgstr "ç„¡æ³•è®€å– %s"
#: apply.c
#, c-format
msgid "reading from '%s' beyond a symbolic link"
-msgstr "讀å–ä½æ–¼ç¬¦è™Ÿé€£çµä¸­çš„ '%s'"
+msgstr "讀å–符號連çµèƒŒå¾Œçš„ “%sâ€"
#: apply.c
#, c-format
msgid "path %s has been renamed/deleted"
-msgstr "路徑 %s 已經被é‡æ–°å‘½å/刪除"
+msgstr "路徑 %s 已被é‡æ–°å‘½å或刪除"
#: apply.c
#, c-format
msgid "%s: does not exist in index"
-msgstr "%s:ä¸å­˜åœ¨æ–¼ç´¢å¼•ä¸­"
+msgstr "%s:ä¸åœ¨ç´¢å¼•ä¸­"
#: apply.c
#, c-format
msgid "%s: does not match index"
-msgstr "%s:和索引ä¸ç¬¦åˆ"
+msgstr "%s:與索引ä¸ç¬¦"
#: apply.c
msgid "repository lacks the necessary blob to perform 3-way merge."
-msgstr "版本庫缺少用來進行三方åˆä½µæ‰€éœ€è¦çš„資料物件。"
+msgstr "版本庫缺少用來進行三方åˆä½µï¼Œæ‰€éœ€è¦çš„資料物件。"
#: apply.c
#, c-format
msgid "Performing three-way merge...\n"
-msgstr "正在進行三方åˆä½µâ‹¯â‹¯\n"
+msgstr "正在進行三方åˆä½µâ€¦â€¦\n"
#: apply.c
#, c-format
msgid "cannot read the current contents of '%s'"
-msgstr "ç„¡æ³•è®€å– '%s' çš„ç›®å‰å…§å®¹"
+msgstr "ç„¡æ³•è®€å– â€œ%s†目å‰çš„內容"
#: apply.c
#, c-format
msgid "Failed to perform three-way merge...\n"
-msgstr "無法進行三方åˆä½µâ‹¯â‹¯\n"
+msgstr "無法進行三方åˆä½µâ€¦â€¦\n"
#: apply.c
#, c-format
msgid "Applied patch to '%s' with conflicts.\n"
-msgstr "套用修補檔到 '%s' 存在è¡çªã€‚\n"
+msgstr "å·²å¥—ç”¨å° â€œ%s†的修補檔,但有è¡çªã€‚\n"
#: apply.c
#, c-format
msgid "Applied patch to '%s' cleanly.\n"
-msgstr "æˆåŠŸå¥—用修補檔到 '%s'。\n"
+msgstr "å·²å®Œå…¨å¥—ç”¨å° â€œ%s†的修補檔。\n"
#: apply.c
#, c-format
@@ -1147,7 +1211,7 @@ msgstr "回復至直接套用模å¼â‹¯â‹¯\n"
#: apply.c
msgid "removal patch leaves file contents"
-msgstr "移除修補檔ä»ç•™ä¸‹äº†æª”案內容"
+msgstr "移除性的修補檔ä»æœ‰ç•™ä¸‹æª”案內容"
#: apply.c
#, c-format
@@ -1157,117 +1221,117 @@ msgstr "%s:錯誤類型"
#: apply.c
#, c-format
msgid "%s has type %o, expected %o"
-msgstr "%s 的類型是 %o,應為 %o"
+msgstr "%s 的類型是 %o,é æœŸæ˜¯ %o"
#: apply.c read-cache.c
#, c-format
msgid "invalid path '%s'"
-msgstr "無效路徑 '%s'"
+msgstr "路徑 “%s†無效"
#: apply.c
#, c-format
msgid "%s: already exists in index"
-msgstr "%s:已經存在於索引中"
+msgstr "%s:已存在於索引中"
#: apply.c
#, c-format
msgid "%s: already exists in working directory"
-msgstr "%s:已經存在於工作å€ä¸­"
+msgstr "%s:已存在於工作å€ä¸­"
#: apply.c
#, c-format
msgid "new mode (%o) of %s does not match old mode (%o)"
-msgstr "%2$s 的新模å¼ï¼ˆ%1$o)和舊模å¼ï¼ˆ%3$o)ä¸ç¬¦åˆ"
+msgstr "%2$s 的新模å¼ï¼ˆ%1$o)和舊模å¼ï¼ˆ%3$o)ä¸ç¬¦"
#: apply.c
#, c-format
msgid "new mode (%o) of %s does not match old mode (%o) of %s"
-msgstr "%2$s 的新模å¼ï¼ˆ%1$o)和 %4$s 的舊模å¼ï¼ˆ%3$o)ä¸ç¬¦åˆ"
+msgstr "%2$s 的新模å¼ï¼ˆ%1$o)和 %4$s 的舊模å¼ï¼ˆ%3$o)ä¸ç¬¦"
#: apply.c
#, c-format
msgid "affected file '%s' is beyond a symbolic link"
-msgstr "å—影響的檔案 '%s' ä½æ–¼ç¬¦è™Ÿé€£çµä¸­"
+msgstr "å—影響的檔案 “%s†在符號連çµå¾Œ"
#: apply.c
#, c-format
msgid "%s: patch does not apply"
-msgstr "%s:修補檔未套用"
+msgstr "%s:未套用修補檔"
#: apply.c
#, c-format
msgid "Checking patch %s..."
-msgstr "正在檢查修補檔 %s..."
+msgstr "正在檢查修補檔 %s……"
#: apply.c
#, c-format
msgid "sha1 information is lacking or useless for submodule %s"
-msgstr "å­æ¨¡çµ„ %s çš„ sha1 訊æ¯ç¼ºå°‘或無效"
+msgstr "%s å­æ¨¡çµ„缺少 sha1 資訊或沒有幫助"
#: apply.c
#, c-format
msgid "mode change for %s, which is not in current HEAD"
-msgstr "%s 的模å¼è®Šæ›´ï¼Œä½†å®ƒä¸åœ¨ç›®å‰ HEAD 中"
+msgstr "%s 的模å¼æœ‰æ›´å‹•ï¼Œä½†å…¶ä¸åœ¨ç›®å‰ HEAD 中"
#: apply.c
#, c-format
msgid "sha1 information is lacking or useless (%s)."
-msgstr "sha1 訊æ¯ç¼ºå°‘或無效(%s)。"
+msgstr "缺少 sha1 資訊或沒有幫助 (%s)。"
#: apply.c
#, c-format
msgid "could not add %s to temporary index"
-msgstr "ä¸èƒ½åœ¨æš«æ™‚索引中新增 %s"
+msgstr "無法將 %s 加進暫存索引"
#: apply.c
#, c-format
msgid "could not write temporary index to %s"
-msgstr "ä¸èƒ½æŠŠæš«æ™‚索引寫入到 %s"
+msgstr "無法將暫存索引寫入 %s"
#: apply.c
#, c-format
msgid "unable to remove %s from index"
-msgstr "ä¸èƒ½å¾žç´¢å¼•ä¸­ç§»é™¤ %s"
+msgstr "無法從索引移除 %s"
#: apply.c
#, c-format
msgid "corrupt patch for submodule %s"
-msgstr "å­æ¨¡çµ„ %s æ壞的修補檔"
+msgstr "修補 %s å­æ¨¡çµ„的修補檔æ壞"
#: apply.c
#, c-format
msgid "unable to stat newly created file '%s'"
-msgstr "ä¸èƒ½å°å»ºç«‹æª”案 '%s' å‘¼å« stat"
+msgstr "無法å°å‰›å»ºç«‹çš„檔案 “%s†執行 stat"
#: apply.c
#, c-format
msgid "unable to create backing store for newly created file %s"
-msgstr "ä¸èƒ½ç‚ºå»ºç«‹æª”案 %s 建立後端儲存"
+msgstr "無法å°å‰›å»ºç«‹çš„檔案 %s 建立後端儲存"
#: apply.c
#, c-format
msgid "unable to add cache entry for %s"
-msgstr "無法為 %s 新增快å–æ¢ç›®"
+msgstr "無法為 %s 加入快å–é …ç›®"
-#: apply.c builtin/bisect--helper.c builtin/gc.c
+#: apply.c builtin/bisect.c builtin/gc.c
#, c-format
msgid "failed to write to '%s'"
-msgstr "寫入 '%s' 失敗"
+msgstr "無法寫入 “%sâ€"
#: apply.c
#, c-format
msgid "closing file '%s'"
-msgstr "關閉檔案 '%s'"
+msgstr "關閉檔案 “%sâ€"
#: apply.c
#, c-format
msgid "unable to write file '%s' mode %o"
-msgstr "ä¸èƒ½å¯«å…¥æª”案 '%s' æ¬Šé™ %o"
+msgstr "ç„¡æ³•ä»¥æ¨¡å¼ %2$o 寫入 “%1$s†檔案"
#: apply.c
#, c-format
msgid "Applied patch %s cleanly."
-msgstr "æˆåŠŸå¥—用修補檔 %s。"
+msgstr "已完全套用 %s 修補檔。"
#: apply.c
msgid "internal error"
@@ -1277,22 +1341,27 @@ msgstr "內部錯誤"
#, c-format
msgid "Applying patch %%s with %d reject..."
msgid_plural "Applying patch %%s with %d rejects..."
-msgstr[0] "套用 %%s 個修補檔,其中 %d 個被拒絕..."
+msgstr[0] "套用 %%s 個修補檔,其中 %d 個被拒絕……"
#: apply.c
#, c-format
msgid "truncating .rej filename to %.*s.rej"
-msgstr "截短 .rej 檔案å為 %.*s.rej"
+msgstr "正在將 .rej 檔案å稱截短為 %.*s.rej"
#: apply.c
#, c-format
msgid "cannot open %s"
-msgstr "ä¸èƒ½é–‹å•Ÿ %s"
+msgstr "無法開啟 %s"
+
+#: apply.c rerere.c
+#, c-format
+msgid "cannot unlink '%s'"
+msgstr "無法刪除 “%sâ€"
#: apply.c
#, c-format
msgid "Hunk #%d applied cleanly."
-msgstr "æˆåŠŸå¥—用第 #%d 個å€å¡Šã€‚"
+msgstr "æˆåŠŸå®Œå…¨å¥—用第 #%d 個å€å¡Šã€‚"
#: apply.c
#, c-format
@@ -1302,20 +1371,20 @@ msgstr "拒絕第 #%d 個å€å¡Šã€‚"
#: apply.c
#, c-format
msgid "Skipped patch '%s'."
-msgstr "ç•¥éŽä¿®è£œæª” '%s'。"
+msgstr "ç•¥éŽä¿®è£œæª” “%sâ€ã€‚"
#: apply.c
msgid "No valid patches in input (allow with \"--allow-empty\")"
-msgstr "輸入中沒有有效的修補檔內容(傳入「--allow-emptyã€å…許)"
+msgstr "輸入沒有有效的修補檔內容(傳入 “--allow-empty†å…許此行為)"
-#: apply.c
+#: apply.c t/helper/test-cache-tree.c
msgid "unable to read index file"
msgstr "無法讀å–索引檔案"
#: apply.c
#, c-format
msgid "can't open patch '%s': %s"
-msgstr "ä¸èƒ½é–‹å•Ÿä¿®è£œæª” '%s':%s"
+msgstr "無法開啟修補檔 “%sâ€ï¼š%s"
#: apply.c
#, c-format
@@ -1327,25 +1396,25 @@ msgstr[0] "抑制下ä»æœ‰ %d 個空白字元誤用"
#, c-format
msgid "%d line adds whitespace errors."
msgid_plural "%d lines add whitespace errors."
-msgstr[0] "%d 行新增了空白字元誤用。"
+msgstr[0] "%d 列加入了空白字元誤用。"
#: apply.c
#, c-format
msgid "%d line applied after fixing whitespace errors."
msgid_plural "%d lines applied after fixing whitespace errors."
-msgstr[0] "修復空白錯誤後,套用了 %d 行。"
+msgstr[0] "修正空白誤用後,套用了 %d 列。"
-#: apply.c builtin/add.c builtin/mv.c builtin/rm.c
+#: apply.c builtin/mv.c builtin/rm.c
msgid "Unable to write new index file"
msgstr "無法寫入新索引檔案"
#: apply.c
msgid "don't apply changes matching the given path"
-msgstr "ä¸è¦å¥—用符åˆæ供路徑的變更"
+msgstr "ä¸è¦å¥—用符åˆæ供路徑的更動"
#: apply.c
msgid "apply changes matching the given path"
-msgstr "套用符åˆæ供路徑的變更"
+msgstr "套用符åˆæ供路徑的更動"
#: apply.c builtin/am.c
msgid "num"
@@ -1353,19 +1422,19 @@ msgstr "數字"
#: apply.c
msgid "remove <num> leading slashes from traditional diff paths"
-msgstr "從傳統的 diff 路徑中移除指定數é‡çš„å‰å°Žæ–œç·š"
+msgstr "從傳統的 diff 路徑中移除 <num> 個å‰å°Žæ–œç·š"
#: apply.c
msgid "ignore additions made by the patch"
-msgstr "忽略修補檔中的新增的檔案"
+msgstr "忽略修補檔中的加入內容"
#: apply.c
msgid "instead of applying the patch, output diffstat for the input"
-msgstr "ä¸å¥—用修補檔,而是顯示輸入的差異統計(diffstat)"
+msgstr "ä¸å¥—用修補檔,而是顯示輸入的差異統計 (diffstat)"
#: apply.c
msgid "show number of added and deleted lines in decimal notation"
-msgstr "以å進ä½æ•¸é¡¯ç¤ºæ–°å¢žå’Œåˆªé™¤çš„行數"
+msgstr "以å進ä½æ•¸å­—,顯示加入和刪除的列數"
#: apply.c
msgid "instead of applying the patch, output a summary for the input"
@@ -1381,7 +1450,7 @@ msgstr "確èªä¿®è£œæª”å¯ä»¥å¥—用到目å‰ç´¢å¼•"
#: apply.c
msgid "mark new files with `git add --intent-to-add`"
-msgstr "使用指令 `git add --intent-to-add` 標記新增檔案"
+msgstr "使用 `git add --intent-to-add` 命令標記新檔案"
#: apply.c
msgid "apply a patch without touching the working tree"
@@ -1393,15 +1462,15 @@ msgstr "接å—修改工作å€ä¹‹å¤–檔案的修補檔"
#: apply.c
msgid "also apply the patch (use with --stat/--summary/--check)"
-msgstr "還套用此修補檔(與 --stat/--summary/--check é¸é …åŒæ™‚使用)"
+msgstr "亦套用修補檔(與 --stat/--summary/--check é¸é …åŒæ™‚使用)"
#: apply.c
msgid "attempt three-way merge, fall back on normal patch if that fails"
-msgstr "嘗試三方åˆä½µã€‚如果失敗,則回到正常修補檔 (patch) 模å¼"
+msgstr "嘗試三方åˆä½µï¼Œè‹¥å¤±æ•—則回到正常修補模å¼"
#: apply.c
msgid "build a temporary index based on embedded index information"
-msgstr "建立一個暫時索引基於嵌入的索引訊æ¯"
+msgstr "組建以嵌入索引資訊為基礎的暫存索引"
#: apply.c builtin/checkout-index.c
msgid "paths are separated with NUL character"
@@ -1409,7 +1478,7 @@ msgstr "路徑以 NUL 字元分隔"
#: apply.c
msgid "ensure at least <n> lines of context match"
-msgstr "確ä¿è‡³å°‘ç¬¦åˆ <n> 行上下文"
+msgstr "確ä¿è‡³å°‘ç¬¦åˆ <n> 列上下文"
#: apply.c builtin/am.c builtin/interpret-trailers.c builtin/pack-objects.c
#: builtin/rebase.c
@@ -1418,11 +1487,11 @@ msgstr "動作"
#: apply.c
msgid "detect new or modified lines that have whitespace errors"
-msgstr "檢查新增和修改的行中間的空白字元濫用"
+msgstr "檢查新增和修改的列中間,是å¦æœ‰ç©ºç™½å­—元誤用"
#: apply.c
msgid "ignore changes in whitespace when finding context"
-msgstr "尋找上下文時忽略空白字元的變更"
+msgstr "尋找上下文時忽略空白字元更動"
#: apply.c
msgid "apply the patch in reverse"
@@ -1430,23 +1499,23 @@ msgstr "åå‘套用修補檔"
#: apply.c
msgid "don't expect at least one line of context"
-msgstr "無需至少一行上下文"
+msgstr "無需至少一列上下文"
#: apply.c
msgid "leave the rejected hunks in corresponding *.rej files"
-msgstr "將拒絕的修補檔å€å¡Šå„²å­˜åœ¨å°æ‡‰çš„ *.rej 檔案中"
+msgstr "將拒絕的修補檔å€å¡Šï¼Œç•™åœ¨å°æ‡‰çš„ *.rej 檔案中"
#: apply.c
msgid "allow overlapping hunks"
-msgstr "å…許é‡ç–Šçš„修補檔å€å¡Š"
+msgstr "å…許é‡ç–Šå€å¡Š"
#: apply.c
msgid "tolerate incorrectly detected missing new-line at the end of file"
-msgstr "å…許ä¸æ­£ç¢ºçš„檔案末尾æ›è¡Œç¬¦è™Ÿ"
+msgstr "å…許ä¸æ­£ç¢ºçš„檔案末尾æ›åˆ—符號"
#: apply.c
msgid "do not trust the line counts in the hunk headers"
-msgstr "ä¸ä¿¡ä»»ä¿®è£œæª”å€å¡Šçš„標頭訊æ¯ä¸­çš„行號"
+msgstr "ä¸ä¿¡ä»»å€å¡Šæ¨™é ­ä¸­çš„列號"
#: apply.c builtin/am.c
msgid "root"
@@ -1454,35 +1523,40 @@ msgstr "根目錄"
#: apply.c
msgid "prepend <root> to all filenames"
-msgstr "為所有檔案åå‰æ–°å¢ž <根目錄>"
+msgstr "在所有檔案å稱å‰åŠ ä¸Š <root>"
#: apply.c
msgid "don't return error for empty patches"
-msgstr "é‡åˆ°ç©ºç™½ä¿®è£œæª”時ä¸å›žå‚³éŒ¯èª¤"
+msgstr "é‡åˆ°ç©ºç™½ä¿®è£œæª”時,ä¸å›žå‚³éŒ¯èª¤"
#: archive-tar.c archive-zip.c
#, c-format
msgid "cannot stream blob %s"
-msgstr "ä¸èƒ½é–‹å•Ÿè³‡æ–™ç‰©ä»¶ %s"
+msgstr "無法串æµè³‡æ–™ç‰©ä»¶ %s"
#: archive-tar.c archive-zip.c
#, c-format
msgid "unsupported file mode: 0%o (SHA1: %s)"
-msgstr "ä¸æ”¯æ´çš„檔案模å¼ï¼š0%o (SHA1: %s)"
+msgstr "ä¸æ”¯æ´çš„檔案模å¼ï¼š0%o (SHA1:%s)"
+
+#: archive-tar.c archive-zip.c builtin/pack-objects.c
+#, c-format
+msgid "deflate error (%d)"
+msgstr "壓縮錯誤 (%d)"
#: archive-tar.c
#, c-format
msgid "unable to start '%s' filter"
-msgstr "無法啟動 '%s' éŽæ¿¾å™¨"
+msgstr "無法啟動 “%s†éŽæ¿¾å™¨"
#: archive-tar.c
msgid "unable to redirect descriptor"
-msgstr "無法é‡å®šå‘æ述符"
+msgstr "無法é‡æ–°å°Žå‘æè¿°å…ƒ"
#: archive-tar.c
#, c-format
msgid "'%s' filter reported error"
-msgstr "'%s' éŽæ¿¾å™¨å ±å‘Šäº†éŒ¯èª¤"
+msgstr "“%s†éŽæ¿¾å™¨å›žå ±éŒ¯èª¤"
#: archive-zip.c
#, c-format
@@ -1492,41 +1566,41 @@ msgstr "路徑ä¸æ˜¯æœ‰æ•ˆçš„ UTF-8:%s"
#: archive-zip.c
#, c-format
msgid "path too long (%d chars, SHA1: %s): %s"
-msgstr "路徑太長(%d 字元,SHA1:%s):%s"
-
-#: archive-zip.c builtin/pack-objects.c
-#, c-format
-msgid "deflate error (%d)"
-msgstr "壓縮錯誤 (%d)"
+msgstr "路徑太長(%d 個字元,SHA1:%s):%s"
#: archive-zip.c
#, c-format
msgid "timestamp too large for this system: %<PRIuMAX>"
-msgstr "å°æ–¼æœ¬ç³»çµ±æ™‚間戳太大:%<PRIuMAX>"
+msgstr "å°æœ¬ç³»çµ±è€Œè¨€æ™‚間戳太大:%<PRIuMAX>"
#: archive.c
msgid "git archive [<options>] <tree-ish> [<path>...]"
-msgstr "git archive [<é¸é …>] <樹或æ交> [<路徑>...]"
+msgstr "git archive [<options>] <tree-ish> [<path>...]"
#: archive.c
msgid ""
"git archive --remote <repo> [--exec <cmd>] [<options>] <tree-ish> [<path>...]"
msgstr ""
-"git archive --remote <版本庫> [--exec <命令>] [<é¸é …>] <樹或æ交> [<路徑>...]"
+"git archive --remote <repo> [--exec <cmd>] [<options>] <tree-ish> [<path>...]"
#: archive.c
msgid "git archive --remote <repo> [--exec <cmd>] --list"
-msgstr "git archive --remote <版本庫> [--exec <命令>] --list"
+msgstr "git archive --remote <repo> [--exec <cmd>] --list"
#: archive.c builtin/gc.c builtin/notes.c builtin/tag.c
#, c-format
msgid "cannot read '%s'"
-msgstr "ä¸èƒ½è®€å– '%s'"
+msgstr "ç„¡æ³•è®€å– â€œ%sâ€"
+
+#: archive.c
+#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr "符åˆè·¯å¾‘è¦æ ¼ “%s†的檔案在目å‰ç›®éŒ„之外"
#: archive.c builtin/add.c builtin/rm.c
#, c-format
msgid "pathspec '%s' did not match any files"
-msgstr "路徑è¦æ ¼ '%s' 未符åˆä»»ä½•æª”案"
+msgstr "路徑è¦æ ¼ “%s†未符åˆä»»ä½•æª”案"
#: archive.c
#, c-format
@@ -1536,16 +1610,12 @@ msgstr "無此引用:%.*s"
#: archive.c
#, c-format
msgid "not a valid object name: %s"
-msgstr "ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„物件å:%s"
+msgstr "éžæœ‰æ•ˆç‰©ä»¶å稱:%s"
-#: archive.c
+#: archive.c t/helper/test-cache-tree.c
#, c-format
msgid "not a tree object: %s"
-msgstr "ä¸æ˜¯ä¸€å€‹æ¨¹ç‹€ç‰©ä»¶ï¼š%s"
-
-#: archive.c
-msgid "current working directory is untracked"
-msgstr "ç›®å‰å·¥ä½œç›®éŒ„未被追蹤"
+msgstr "éžæ¨¹ç‹€ç‰©ä»¶ï¼š%s"
#: archive.c
#, c-format
@@ -1560,59 +1630,68 @@ msgstr "ä¸æ˜¯ä¸€èˆ¬æª”案:%s"
#: archive.c
#, c-format
msgid "unclosed quote: '%s'"
-msgstr "未閉åˆçš„引號:「%sã€"
+msgstr "未閉åˆçš„引號:“%sâ€"
#: archive.c
#, c-format
msgid "missing colon: '%s'"
-msgstr "缺少冒號:「%sã€"
+msgstr "缺少冒號:“%sâ€"
#: archive.c
#, c-format
msgid "empty file name: '%s'"
-msgstr "檔案å稱空白:「%sã€"
+msgstr "檔案å稱空白:“%sâ€"
#: archive.c
msgid "fmt"
-msgstr "æ ¼å¼"
+msgstr "fmt"
#: archive.c
msgid "archive format"
-msgstr "歸檔格å¼"
+msgstr "å°å­˜æ ¼å¼"
-#: archive.c builtin/log.c
+#: archive.c builtin/log.c parse-options.h
msgid "prefix"
msgstr "å‰ç¶´"
#: archive.c
msgid "prepend prefix to each pathname in the archive"
-msgstr "為歸檔中æ¯å€‹è·¯å¾‘å加上å‰ç¶´"
+msgstr "為å°å­˜ä¸­çš„æ¯å€‹è·¯å¾‘å稱加上å‰ç¶´"
#: archive.c builtin/blame.c builtin/commit-tree.c builtin/config.c
-#: builtin/fast-export.c builtin/grep.c builtin/hash-object.c
+#: builtin/fast-export.c builtin/gc.c builtin/grep.c builtin/hash-object.c
#: builtin/ls-files.c builtin/notes.c builtin/read-tree.c parse-options.h
msgid "file"
-msgstr "檔案"
+msgstr "file"
#: archive.c
msgid "add untracked file to archive"
-msgstr "將未追蹤檔案加入歸檔"
+msgstr "將未追蹤檔案加進å°å­˜"
#: archive.c
msgid "path:content"
-msgstr "路徑:內容"
+msgstr "path:content"
#: archive.c builtin/archive.c
msgid "write the archive to this file"
-msgstr "歸檔寫入此檔案"
+msgstr "å°‡å°å­˜å¯«å…¥æ­¤æª”案"
#: archive.c
msgid "read .gitattributes in working directory"
-msgstr "讀å–工作å€ä¸­çš„ .gitattributes"
+msgstr "讀å–工作目錄中的 .gitattributes"
#: archive.c
msgid "report archived files on stderr"
-msgstr "在標準錯誤上報告歸檔檔案"
+msgstr "在 stderr 上回報å°å­˜çš„檔案"
+
+#: archive.c builtin/clone.c builtin/fetch.c builtin/pack-objects.c
+#: builtin/pull.c
+msgid "time"
+msgstr "time"
+
+#: archive.c
+msgid "set modification time of archive entries"
+msgstr "設定å°å­˜é …目的修改時間"
#: archive.c
msgid "set compression level"
@@ -1620,27 +1699,27 @@ msgstr "設定壓縮級別"
#: archive.c
msgid "list supported archive formats"
-msgstr "列出支æ´çš„歸檔格å¼"
+msgstr "列出支æ´çš„å°å­˜æ ¼å¼"
#: archive.c builtin/archive.c builtin/clone.c builtin/submodule--helper.c
msgid "repo"
-msgstr "版本庫"
+msgstr "repo"
#: archive.c builtin/archive.c
msgid "retrieve the archive from remote repository <repo>"
-msgstr "從é ç«¯ç‰ˆæœ¬åº«ï¼ˆ<版本庫>)擷å–歸檔檔案"
+msgstr "從é ç«¯ç‰ˆæœ¬åº« <repo> æ“·å–å°å­˜æª”案"
#: archive.c builtin/archive.c builtin/difftool.c builtin/notes.c
msgid "command"
-msgstr "指令"
+msgstr "command"
#: archive.c builtin/archive.c
msgid "path to the remote git-upload-archive command"
-msgstr "é ç«¯ git-upload-archive 指令的路徑"
+msgstr "é ç«¯ git-upload-archive 命令的路徑"
#: archive.c
msgid "Unexpected option --remote"
-msgstr "未知åƒæ•¸ --remote"
+msgstr "éžé æœŸé¸é … --remote"
#: archive.c builtin/add.c builtin/checkout.c builtin/clone.c builtin/commit.c
#: builtin/fast-export.c builtin/index-pack.c builtin/log.c builtin/reset.c
@@ -1648,26 +1727,40 @@ msgstr "未知åƒæ•¸ --remote"
#: revision.c
#, c-format
msgid "the option '%s' requires '%s'"
-msgstr "「%sã€é¸é …需è¦ã€Œ%sã€"
+msgstr "“%s†é¸é …éœ€è¦ â€œ%sâ€"
#: archive.c
msgid "Unexpected option --output"
-msgstr "未知åƒæ•¸ --output"
+msgstr "éžé æœŸé¸é … --output"
+
+#: archive.c
+#, c-format
+msgid "extra command line parameter '%s'"
+msgstr "多出命令列åƒæ•¸ “%sâ€"
#: archive.c
#, c-format
msgid "Unknown archive format '%s'"
-msgstr "æœªçŸ¥æ­¸æª”æ ¼å¼ '%s'"
+msgstr "å°å­˜æ ¼å¼ “%s†未知"
#: archive.c
#, c-format
msgid "Argument not supported for format '%s': -%d"
-msgstr "åƒæ•¸ä¸æ”¯æ´æ­¤æ ¼å¼ '%s':-%d"
+msgstr "引數ä¸æ”¯æ´ “%s†格å¼ï¼š-%d"
#: attr.c
#, c-format
msgid "%.*s is not a valid attribute name"
-msgstr "%.*s ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„屬性å"
+msgstr "%.*s ä¸æ˜¯æœ‰æ•ˆçš„屬性å稱"
+
+#: attr.c
+msgid "unable to add additional attribute"
+msgstr "無法加入其他屬性"
+
+#: attr.c
+#, c-format
+msgid "ignoring overly long attributes line %d"
+msgstr "忽略éŽé•·çš„屬性列 (第 %d 列)"
#: attr.c
#, c-format
@@ -1679,23 +1772,53 @@ msgid ""
"Negative patterns are ignored in git attributes\n"
"Use '\\!' for literal leading exclamation."
msgstr ""
-"åå‘模å¼åœ¨ git attributes 中被忽略\n"
-"當字串確定è¦ä»¥é©šå˜†è™Ÿé–‹å§‹æ™‚,使用 '\\!'。"
+"git attributes 會忽略åå‘模å¼\n"
+"當字串確定è¦ä»¥é©šå˜†è™Ÿé–‹å§‹æ™‚,請使用 “\\!â€ã€‚"
+
+#: attr.c
+#, c-format
+msgid "cannot fstat gitattributes file '%s'"
+msgstr "無法 fstat gitattributes 檔案 “%sâ€"
+
+#: attr.c
+#, c-format
+msgid "ignoring overly large gitattributes file '%s'"
+msgstr "忽略éŽå¤§çš„ gitattributes 檔案 “%sâ€"
+
+#: attr.c
+#, c-format
+msgid "ignoring overly large gitattributes blob '%s'"
+msgstr "忽略éŽå¤§çš„ gitattributes 資料物件 “%sâ€"
+
+#: attr.c
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "無效的 --attr-source 或 GIT_ATTR_SOURCE"
+
+#: attr.c read-cache.c
+#, c-format
+msgid "unable to stat '%s'"
+msgstr "ç„¡æ³•å° %s 執行 stat"
+
+#: bisect.c builtin/cat-file.c builtin/index-pack.c builtin/notes.c
+#: builtin/pack-objects.c combine-diff.c rerere.c
+#, c-format
+msgid "unable to read %s"
+msgstr "ä¸èƒ½è®€ %s"
#: bisect.c
#, c-format
msgid "Badly quoted content in file '%s': %s"
-msgstr "檔案 '%s' 包å«éŒ¯èª¤çš„引用格å¼ï¼š%s"
+msgstr "檔案 “%s†包å«ç„¡æ•ˆçš„引用內容:%s"
#: bisect.c
#, c-format
msgid "We cannot bisect more!\n"
-msgstr "我們無法進行更多的二分æœå°‹ï¼\n"
+msgstr "已經無法繼續二分æœå°‹ï¼\n"
#: bisect.c
#, c-format
msgid "Not a valid commit name %s"
-msgstr "ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„æ交å %s"
+msgstr "%s ä¸æ˜¯æœ‰æ•ˆçš„æ交å稱"
#: bisect.c
#, c-format
@@ -1704,7 +1827,7 @@ msgid ""
"This means the bug has been fixed between %s and [%s].\n"
msgstr ""
"åˆä½µåŸºç¤Ž %s 是壞的。\n"
-"這æ„味著介於 %s å’Œ [%s] 之間的 bug 已經被修復。\n"
+"這æ„味著 bug 已經在 %s å’Œ [%s] 之間被修正。\n"
#: bisect.c
#, c-format
@@ -1713,7 +1836,7 @@ msgid ""
"The property has changed between %s and [%s].\n"
msgstr ""
"åˆä½µåŸºç¤Ž %s 是新的。\n"
-"介於 %s 和 [%s] 之間的屬性已經被修改。\n"
+"介於 %s 和 [%s] 之間的屬性已被修改。\n"
#: bisect.c
#, c-format
@@ -1722,7 +1845,7 @@ msgid ""
"This means the first '%s' commit is between %s and [%s].\n"
msgstr ""
"åˆä½µåŸºç¤Ž %s 是 %s。\n"
-"這æ„味著第一個 '%s' æ交ä½æ–¼ %s å’Œ [%s] 之間。\n"
+"這æ„味著第一個 “%s†æ交ä½æ–¼ %s å’Œ [%s] 之間。\n"
#: bisect.c
#, c-format
@@ -1731,9 +1854,9 @@ msgid ""
"git bisect cannot work properly in this case.\n"
"Maybe you mistook %s and %s revs?\n"
msgstr ""
-"一些 %s 版本ä¸æ˜¯ %s 版本的祖先。\n"
-"這種情æ³ä¸‹ git 二分æœå°‹ç„¡æ³•æ­£å¸¸å·¥ä½œã€‚\n"
-"您å¯èƒ½å¼„錯了 %s å’Œ %s 版本?\n"
+"部分 %s 修訂版ä¸æ˜¯ %s 修訂版的祖先。\n"
+"這種情æ³ä¸‹ git bisect 無法正常é‹ä½œã€‚\n"
+"您å¯èƒ½å¼„錯了 %s å’Œ %s 修訂版?\n"
#: bisect.c
#, c-format
@@ -1742,33 +1865,33 @@ msgid ""
"So we cannot be sure the first %s commit is between %s and %s.\n"
"We continue anyway."
msgstr ""
-"介於 %s å’Œ [%s] çš„åˆä½µåŸºç¤Žä¸€å®šè¢«å¿½ç•¥äº†ã€‚\n"
+"介於 %s å’Œ [%s] çš„åˆä½µåŸºç¤Žä¸€å®šè¢«ç•¥éŽäº†ã€‚\n"
"所以我們無法確èªç¬¬ä¸€å€‹ %s æ交是å¦ä»‹æ–¼ %s å’Œ %s 之間。\n"
"我們ä»èˆŠç¹¼çºŒã€‚"
#: bisect.c
#, c-format
msgid "Bisecting: a merge base must be tested\n"
-msgstr "二分æœå°‹ä¸­ï¼šåˆä½µåŸºç¤Žå¿…須是經éŽæ¸¬è©¦çš„\n"
+msgstr "二分æœå°‹ä¸­ï¼šåˆä½µåŸºç¤Žå¿…須經éŽæ¸¬è©¦\n"
#: bisect.c
#, c-format
msgid "a %s revision is needed"
-msgstr "需è¦ä¸€å€‹ %s 版本"
+msgstr "需è¦ä¸€å€‹ %s 修訂版"
#: bisect.c
#, c-format
msgid "could not create file '%s'"
-msgstr "ä¸èƒ½å»ºç«‹æª”案 '%s'"
+msgstr "無法建立 “%s†檔案"
#: bisect.c builtin/merge.c
#, c-format
msgid "could not read file '%s'"
-msgstr "ä¸èƒ½è®€å–檔案 '%s'"
+msgstr "ç„¡æ³•è®€å– â€œ%s†檔案"
#: bisect.c
msgid "reading bisect refs failed"
-msgstr "讀å–二分æœå°‹å¼•ç”¨å¤±æ•—"
+msgstr "無法讀å–二分æœå°‹çš„引用"
#: bisect.c
#, c-format
@@ -1782,13 +1905,13 @@ msgid ""
"Maybe you started with bad path arguments?\n"
msgstr ""
"沒找到能夠測試的æ交。\n"
-"å¯èƒ½æ˜¯åŸ·è¡Œå‚³å…¥çš„路徑引數是錯誤的?\n"
+"å¯èƒ½æ˜¯å‚³å…¥çš„路徑引數有誤?\n"
#: bisect.c
#, c-format
msgid "(roughly %d step)"
msgid_plural "(roughly %d steps)"
-msgstr[0] "(大概 %d 步)"
+msgstr[0] "(大約 %d 步)"
#. TRANSLATORS: the last %s will be replaced with "(roughly %d
#. steps)" translation.
@@ -1797,66 +1920,62 @@ msgstr[0] "(大概 %d 步)"
#, c-format
msgid "Bisecting: %d revision left to test after this %s\n"
msgid_plural "Bisecting: %d revisions left to test after this %s\n"
-msgstr[0] "二分æœå°‹ä¸­ï¼šåœ¨æ­¤ä¹‹å¾Œï¼Œé‚„剩 %d 個版本待測試 %s\n"
+msgstr[0] "二分æœå°‹ä¸­ï¼šåœ¨æ­¤ (%2$s) 之後,尚餘 %1$d 個版本待測試\n"
#: blame.c
msgid "--contents and --reverse do not blend well."
msgstr "--contents å’Œ --reverse ä¸èƒ½æ··ç”¨ã€‚"
#: blame.c
-msgid "cannot use --contents with final commit object name"
-msgstr "ä¸èƒ½å°‡ --contents 和最終的æ交物件å共用"
-
-#: blame.c
msgid "--reverse and --first-parent together require specified latest commit"
msgstr "--reverse å’Œ --first-parent 共用,需è¦æŒ‡å®šæœ€æ–°çš„æ交"
#: blame.c builtin/commit.c builtin/log.c builtin/merge.c
-#: builtin/pack-objects.c builtin/shortlog.c bundle.c midx.c ref-filter.c
-#: remote.c sequencer.c submodule.c
+#: builtin/pack-objects.c builtin/shortlog.c midx.c pack-bitmap.c remote.c
+#: sequencer.c submodule.c
msgid "revision walk setup failed"
-msgstr "版本é歷設定失敗"
+msgstr "修訂版é歷設定失敗"
#: blame.c
msgid ""
"--reverse --first-parent together require range along first-parent chain"
-msgstr "--reverse å’Œ --first-parent 共用,需è¦ç¬¬ä¸€ç¥–å…ˆéˆä¸Šçš„æ交範åœ"
+msgstr "--reverse å’Œ --first-parent 共用,需è¦ç¬¬ä¸€ä¸Šç´šéˆçš„æ交範åœ"
#: blame.c
#, c-format
msgid "no such path %s in %s"
-msgstr "在 %2$s 中無此路徑 %1$s"
+msgstr "在 %2$s 中,沒有路徑 %1$s"
#: blame.c
#, c-format
msgid "cannot read blob %s for path %s"
-msgstr "ä¸èƒ½ç‚ºè·¯å¾‘ %2$s 讀å–資料物件 %1$s"
+msgstr "無法為 %2$s 路徑讀å–資料物件 %1$s"
#: branch.c
msgid ""
"cannot inherit upstream tracking configuration of multiple refs when "
"rebasing is requested"
-msgstr "請求é‡å®šåŸºåº•æ™‚,無法繼承多個åƒç…§çš„上游追蹤設定"
+msgstr "請求é‡å®šåŸºåº•æ™‚,無法繼承多個引用的上游追蹤設定"
#: branch.c
#, c-format
msgid "not setting branch '%s' as its own upstream"
-msgstr "未將「%sã€åˆ†æ”¯è¨­å®šç‚ºå…¶è‡ªå·±çš„上游"
+msgstr "未將 “%s†分支設為其自己的上游"
#: branch.c
#, c-format
msgid "branch '%s' set up to track '%s' by rebasing."
-msgstr "已將「%sã€åˆ†æ”¯è¨­å®šç‚ºé€éŽé‡å®šåŸºåº•è¿½è¹¤ã€Œ%sã€ã€‚"
+msgstr "已藉由é‡è¨‚基底,將 “%s†分支設定為追蹤 “%sâ€ã€‚"
#: branch.c
#, c-format
msgid "branch '%s' set up to track '%s'."
-msgstr "已將「%sã€åˆ†æ”¯è¨­å®šç‚ºè¿½è¹¤ã€Œ%sã€ã€‚"
+msgstr "已將 “%s†分支設定為追蹤 “%sâ€ã€‚"
#: branch.c
#, c-format
msgid "branch '%s' set up to track:"
-msgstr "「%sã€åˆ†æ”¯å·²è¨­å®šè¿½è¹¤ï¼š"
+msgstr "“%s†分支已設定追蹤:"
#: branch.c
msgid "unable to write upstream branch configuration"
@@ -1869,23 +1988,23 @@ msgid ""
"the remote tracking information by invoking:"
msgstr ""
"\n"
-"修正錯誤後,您å¯ä»¥åŸ·è¡Œä¸‹è¿°å‘½ä»¤\n"
-"命令修正é ç«¯è¿½è¹¤è³‡è¨Šï¼š"
+"修正病ç¶å¾Œï¼Œæ‚¨å¯ä»¥åŸ·è¡Œä¸‹è¿°å‘½ä»¤\n"
+"修正é ç«¯è¿½è¹¤è³‡è¨Šï¼š"
#: branch.c
#, c-format
msgid "asked to inherit tracking from '%s', but no remote is set"
-msgstr "請求繼承「%sã€çš„追蹤設定,但未設定é ç«¯"
+msgstr "請求繼承 “%s†的追蹤設定,但未設定é ç«¯"
#: branch.c
#, c-format
msgid "asked to inherit tracking from '%s', but no merge configuration is set"
-msgstr "請求繼承「%sã€çš„追蹤設定,但未設定åˆä½µè¨­å®š"
+msgstr "請求繼承 “%s†的追蹤設定,但未設定åˆä½µè¨­å®š"
#: branch.c
#, c-format
msgid "not tracking: ambiguous information for ref '%s'"
-msgstr "未追蹤:「%sã€å¼•ç”¨æœ‰æ­§ç¾©"
+msgstr "未追蹤:“%s†引用有歧義"
# 譯者:為ä¿è­‰åœ¨è¼¸å‡ºä¸­å°é½Šï¼Œæ³¨æ„調整å¥ä¸­ç©ºæ ¼ï¼
#. TRANSLATORS: This is a line listing a remote with duplicate
@@ -1917,37 +2036,38 @@ msgid ""
"different remotes' fetch refspecs map into different\n"
"tracking namespaces."
msgstr ""
-"有多個é ç«¯çš„抓å–引用è¦æ ¼æ˜ å°„到é ç«¯è¿½è¹¤å¼•ç”¨ã€Œ%sã€çš„è¦æ ¼ï¼š\n"
+"有多個é ç«¯çš„抓å–引用è¦æ ¼ï¼Œæ˜ å°„到\n"
+"é ç«¯è¿½è¹¤å¼•ç”¨ “%s†的è¦æ ¼ï¼š\n"
"%s\n"
"這通常是設定錯誤。\n"
"\n"
-"è‹¥è¦æ”¯æ´è¨­å®šè¿½è¹¤åˆ†æ”¯ï¼Œè«‹ç¢ºå®šä¸åŒé ç«¯çš„抓å–引用è¦æ ¼\n"
-"映射到ä¸åŒçš„追蹤命å空間。"
+"è‹¥è¦æ”¯æ´è¨­å®šè¿½è¹¤åˆ†æ”¯ï¼Œè«‹ç¢ºå®šä¸åŒé ç«¯çš„\n"
+"抓å–引用è¦æ ¼ï¼Œæ˜ å°„到ä¸åŒçš„追蹤命å空間。"
#: branch.c
#, c-format
msgid "'%s' is not a valid branch name"
-msgstr "「%sã€ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„分支å稱"
+msgstr "“%s†ä¸æ˜¯æœ‰æ•ˆçš„分支å稱"
#: branch.c
#, c-format
msgid "a branch named '%s' already exists"
-msgstr "已有åŒå「%sã€åˆ†æ”¯"
+msgstr "已有åŒå “%s†分支"
#: branch.c
#, c-format
-msgid "cannot force update the branch '%s' checked out at '%s'"
-msgstr "無法強制更新在「%2$sã€ç°½å‡ºçš„「%1$sã€åˆ†æ”¯"
+msgid "cannot force update the branch '%s' used by worktree at '%s'"
+msgstr "無法強制更新被ä½æ–¼ “%2$s†的工作å€ä½¿ç”¨çš„ “%1$s†分支"
#: branch.c
#, c-format
msgid "cannot set up tracking information; starting point '%s' is not a branch"
-msgstr "無法設定追蹤資訊:起始點「%sã€ä¸æ˜¯åˆ†æ”¯"
+msgstr "無法設定追蹤資訊:起始點 “%s†ä¸æ˜¯åˆ†æ”¯"
#: branch.c
#, c-format
msgid "the requested upstream branch '%s' does not exist"
-msgstr "請求的上游分支 '%s' ä¸å­˜åœ¨"
+msgstr "請求的上游分支 “%s†ä¸å­˜åœ¨"
#: branch.c
msgid ""
@@ -1962,112 +2082,97 @@ msgid ""
msgstr ""
"\n"
"如果您打算以é ç«¯ç¾å­˜çš„上游分支為基礎進行修改,\n"
-"您或許需è¦åŸ·è¡Œã€Œgit fetchã€å–得分支。\n"
+"您或許需è¦åŸ·è¡Œ `git fetch` å–得分支。\n"
"\n"
-"如果您打算將新建立的本機分支推é€è‡³å°æ‡‰çš„é ç«¯åˆ†æ”¯ï¼Œ\n"
-"且建立兩個分支間的追蹤關係,\n"
-"您å¯èƒ½éœ€è¦ä½¿ç”¨ã€Œgit push -uã€æŽ¨é€åˆ†æ”¯ä¸¦è¨­å®šå’Œä¸Šæ¸¸çš„é—œè¯ã€‚"
+"如果您打算將新建立的本機分支,推é€è‡³å°æ‡‰çš„é ç«¯åˆ†æ”¯ï¼Œ\n"
+"並建立兩個分支間的追蹤關係,您å¯èƒ½éœ€è¦ä½¿ç”¨ `git push -u`\n"
+"推é€åˆ†æ”¯ä¸¦è¨­å®šå’Œä¸Šæ¸¸çš„é—œè¯ã€‚"
#: branch.c builtin/replace.c
#, c-format
msgid "not a valid object name: '%s'"
-msgstr "ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„物件å:'%s'"
+msgstr "物件å稱無效:“%sâ€"
#: branch.c
#, c-format
msgid "ambiguous object name: '%s'"
-msgstr "物件å稱有歧義:「%sã€"
+msgstr "物件å稱有歧義:“%sâ€"
#: branch.c
#, c-format
msgid "not a valid branch point: '%s'"
-msgstr "無效的分支點:「%sã€"
+msgstr "分支點無效:“%sâ€"
#: branch.c
#, c-format
msgid "submodule '%s': unable to find submodule"
-msgstr "「%sã€å­æ¨¡çµ„:找ä¸åˆ°å­æ¨¡çµ„"
+msgstr "“%s†å­æ¨¡çµ„:找ä¸åˆ°å­æ¨¡çµ„"
#: branch.c
#, c-format
msgid ""
-"You may try updating the submodules using 'git checkout %s && git submodule "
-"update --init'"
+"You may try updating the submodules using 'git checkout --no-recurse-"
+"submodules %s && git submodule update --init'"
msgstr ""
-"您å¯ä»¥å˜—試使用「git checkout %s && git submodule update --initã€å‘½ä»¤æ›´æ–°å­æ¨¡"
-"組"
+"您å¯ä»¥ä½¿ç”¨ “git checkout --no-recurse-submodules %s && git submodule update "
+"--init†命令嘗試更新å­æ¨¡çµ„"
#: branch.c
#, c-format
msgid "submodule '%s': cannot create branch '%s'"
-msgstr "「%sã€å­æ¨¡çµ„:無法建立「%sã€åˆ†æ”¯"
+msgstr "“%s†å­æ¨¡çµ„:無法建立 “%s†分支"
#: branch.c
#, c-format
-msgid "'%s' is already checked out at '%s'"
-msgstr "'%s' 已經簽出到 '%s'"
-
-#: branch.c
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "å·¥ä½œå€ %s çš„ HEAD 指å‘沒有被更新"
+msgid "'%s' is already used by worktree at '%s'"
+msgstr "“%s†已被ä½æ–¼ “%s†的工作å€ä½¿ç”¨"
#: builtin/add.c
msgid "git add [<options>] [--] <pathspec>..."
-msgstr "git add [<é¸é …>] [--] <路徑è¦æ ¼>..."
+msgstr "git add [<options>] [--] <pathspec>..."
#: builtin/add.c
#, c-format
msgid "cannot chmod %cx '%s'"
-msgstr "無法 chmod %cx ‘%s’"
-
-#: builtin/add.c
-#, c-format
-msgid "unexpected diff status %c"
-msgstr "æ„外的差異狀態 %c"
-
-#: builtin/add.c builtin/commit.c
-msgid "updating files failed"
-msgstr "更新檔案失敗"
-
-#: builtin/add.c
-#, c-format
-msgid "remove '%s'\n"
-msgstr "刪除 '%s'\n"
+msgstr "無法 chmod %cx '%s'"
#: builtin/add.c
msgid "Unstaged changes after refreshing the index:"
-msgstr "é‡æ–°æ•´ç†ç´¢å¼•ä¹‹å¾Œå°šæœªè¢«æš«å­˜çš„變更:"
+msgstr "é‡æ–°æ•´ç†ç´¢å¼•ä¹‹å¾Œï¼Œå°šæœªè¢«æš«å­˜çš„更動:"
-#: builtin/add.c builtin/rev-parse.c
-msgid "Could not read the index"
-msgstr "ä¸èƒ½è®€å–索引"
+#: builtin/add.c
+msgid ""
+"the add.interactive.useBuiltin setting has been removed!\n"
+"See its entry in 'git help config' for details."
+msgstr ""
+"add.interactive.useBuiltin 設定已被移除ï¼\n"
+"深入了解請åƒé–± “git help config†中的å°æ‡‰æ¢ç›®ã€‚"
#: builtin/add.c
-msgid "Could not write patch"
-msgstr "ä¸èƒ½ç”Ÿæˆä¿®è£œæª”"
+msgid "could not read the index"
+msgstr "無法讀å–索引"
#: builtin/add.c
msgid "editing patch failed"
msgstr "編輯修補檔失敗"
-#: builtin/add.c
+#: builtin/add.c read-cache.c
#, c-format
-msgid "Could not stat '%s'"
+msgid "could not stat '%s'"
msgstr "ä¸èƒ½å° '%s' å‘¼å« stat"
#: builtin/add.c
-msgid "Empty patch. Aborted."
-msgstr "空修補檔。異常終止。"
+msgid "empty patch. aborted"
+msgstr "修補檔空白。中止"
#: builtin/add.c
#, c-format
-msgid "Could not apply '%s'"
-msgstr "ä¸èƒ½å¥—用 '%s'"
+msgid "could not apply '%s'"
+msgstr "無法套用 “%sâ€"
#: builtin/add.c
msgid "The following paths are ignored by one of your .gitignore files:\n"
-msgstr "下列路徑根據您的一個 .gitignore 檔案而被忽略:\n"
+msgstr "下列路徑根據其中一個 .gitignore 檔案而被忽略:\n"
#: builtin/add.c builtin/clean.c builtin/fetch.c builtin/mv.c
#: builtin/prune-packed.c builtin/pull.c builtin/push.c builtin/remote.c
@@ -2083,11 +2188,11 @@ msgstr "詳細輸出"
#: builtin/add.c
msgid "interactive picking"
-msgstr "互動å¼æ€é¸"
+msgstr "互動å¼æŒ‘é¸"
#: builtin/add.c builtin/checkout.c builtin/reset.c
msgid "select hunks interactively"
-msgstr "互動å¼æŒ‘é¸è³‡æ–™å€å¡Š"
+msgstr "互動å¼é¸å–å€å¡Š"
#: builtin/add.c
msgid "edit current diff and apply"
@@ -2095,7 +2200,7 @@ msgstr "編輯目å‰å·®ç•°ä¸¦å¥—用"
#: builtin/add.c
msgid "allow adding otherwise ignored files"
-msgstr "å…許新增忽略的檔案"
+msgstr "å…許加入原先被忽略的檔案"
#: builtin/add.c
msgid "update tracked files"
@@ -2103,15 +2208,15 @@ msgstr "更新已追蹤的檔案"
#: builtin/add.c
msgid "renormalize EOL of tracked files (implies -u)"
-msgstr "å°å·²è¿½è¹¤æª”æ¡ˆï¼ˆéš±å« -u)é‡æ–°æ­¸ä¸€æ›è¡Œç¬¦è™Ÿ"
+msgstr "å°å·²è¿½è¹¤æª”æ¡ˆï¼ˆéš±å« -u)é‡æ–°æ¨™æº–化 EOL"
#: builtin/add.c
msgid "record only the fact that the path will be added later"
-msgstr "åªè¨˜éŒ„,該路徑ç¨å¾Œå†æ–°å¢ž"
+msgstr "åªè¨˜éŒ„「路徑ç¨å¾Œæœƒå†åŠ å…¥ã€"
#: builtin/add.c
msgid "add changes from all tracked and untracked files"
-msgstr "新增所有改變的已追蹤檔案和未追蹤檔案"
+msgstr "從所有已追蹤和未追蹤檔案加入更動"
#: builtin/add.c
msgid "ignore paths removed in the working tree (same as --no-all)"
@@ -2127,7 +2232,7 @@ msgstr "ç•¥éŽå› ç™¼ç”ŸéŒ¯èª¤ä¸èƒ½æ–°å¢žçš„檔案"
#: builtin/add.c
msgid "check if - even missing - files are ignored in dry run"
-msgstr "檢查在測試執行模å¼ä¸‹æª”案(å³ä½¿ä¸å­˜åœ¨ï¼‰æ˜¯å¦è¢«å¿½ç•¥"
+msgstr "檢查(å³ä½¿ä¸å­˜åœ¨çš„)檔案是å¦åœ¨æ¸¬è©¦åŸ·è¡Œæ¨¡å¼ä¸­è¢«å¿½ç•¥"
#: builtin/add.c builtin/mv.c builtin/rm.c
msgid "allow updating entries outside of the sparse-checkout cone"
@@ -2135,11 +2240,11 @@ msgstr "å…許更新稀ç–簽出 cone 外的項目"
#: builtin/add.c builtin/update-index.c
msgid "override the executable bit of the listed files"
-msgstr "覆蓋列表裡檔案的å¯åŸ·è¡Œä½"
+msgstr "覆寫列出檔案中的å¯åŸ·è¡Œä½å…ƒ"
#: builtin/add.c
msgid "warn when adding an embedded repository"
-msgstr "建立一個嵌入å¼ç‰ˆæœ¬åº«æ™‚給予警告"
+msgstr "嵌入版本庫時發出警告"
#: builtin/add.c
#, c-format
@@ -2158,22 +2263,24 @@ msgid ""
"\n"
"See \"git help submodule\" for more information."
msgstr ""
-"您在目å‰ç‰ˆæœ¬åº«ä¸­æ–°å¢žäº†å¦å¤–一個 Git 版本庫。複製外層的版本庫將ä¸åŒ…å«åµŒå…¥ç‰ˆæœ¬åº«"
-"的內容,並且ä¸çŸ¥é“該如何å–得它。\n"
-"如果您è¦æ–°å¢žä¸€å€‹å­æ¨¡çµ„,使用:\n"
+"您在目å‰çš„版本庫中加進å¦ä¸€å€‹ Git 版本庫。\n"
+"複製外層的版本庫,將ä¸åŒ…å«åµŒå…¥ç‰ˆæœ¬åº«çš„內容,\n"
+"並且ä¸åŒ…å«å–得此版本庫的方å¼ã€‚\n"
+"如果您è¦åŠ å…¥å­æ¨¡çµ„,請使用:\n"
"\n"
"\tgit submodule add <url> %s\n"
"\n"
-"如果您ä¸å°å¿ƒæ–°å¢žäº†é€™å€‹è·¯å¾‘,å¯ä»¥ç”¨ä¸‹é¢çš„指令將其從索引中刪除:\n"
+"如果您ä¸å°å¿ƒåŠ å…¥äº†é€™å€‹è·¯å¾‘,\n"
+"å¯ä»¥ç”¨ä¸‹é¢çš„命令,將其從索引中移除:\n"
"\n"
"\tgit rm --cached %s\n"
"\n"
-"åƒè¦‹ \"git help submodule\" å–得更多訊æ¯ã€‚"
+"åƒè¦‹ “git help submodule†深入了解。"
#: builtin/add.c
#, c-format
msgid "adding embedded git repository: %s"
-msgstr "æ­£åœ¨æ–°å¢žåµŒå…¥å¼ git 版本庫:%s"
+msgstr "æ­£åœ¨åŠ å…¥åµŒå…¥å¼ git 版本庫:%s"
#: builtin/add.c
msgid ""
@@ -2181,29 +2288,29 @@ msgid ""
"Turn this message off by running\n"
"\"git config advice.addIgnoredFile false\""
msgstr ""
-"如果您真的想加入,請使用 -f。\n"
+"若您真的想加入,請傳入 -f。\n"
"如è¦é—œé–‰æ­¤è¨Šæ¯ï¼Œè«‹åŸ·è¡Œ\n"
-"\"git config advice.addIgnoredFile false\""
+"“git config advice.addIgnoredFile falseâ€"
#: builtin/add.c
msgid "adding files failed"
-msgstr "新增檔案失敗"
+msgstr "加入檔案失敗"
#: builtin/add.c
#, c-format
msgid "--chmod param '%s' must be either -x or +x"
-msgstr "åƒæ•¸ --chmod å–值 '%s' 必須是 -x 或 +x"
+msgstr "--chmod çš„åƒæ•¸ “%s†必須是 -x 或 +x"
#: builtin/add.c builtin/checkout.c builtin/commit.c builtin/reset.c
#: builtin/rm.c builtin/stash.c
#, c-format
msgid "'%s' and pathspec arguments cannot be used together"
-msgstr "「%sã€å’Œè·¯å¾‘è¦æ ¼å¼•æ•¸ä¸å¾—åŒæ™‚使用"
+msgstr "“%s†和路徑è¦æ ¼å¼•æ•¸ä¸å¾—åŒæ™‚使用"
#: builtin/add.c
#, c-format
msgid "Nothing specified, nothing added.\n"
-msgstr "沒有指定檔案,也沒有檔案被新增。\n"
+msgstr "沒有指定,亦未加入檔案。\n"
#: builtin/add.c
msgid ""
@@ -2211,9 +2318,9 @@ msgid ""
"Turn this message off by running\n"
"\"git config advice.addEmptyPathspec false\""
msgstr ""
-"å¯èƒ½ä½ è¦åšçš„是 'git add .'?\n"
+"å¯èƒ½æ‚¨æƒ³åš “git add .â€ï¼Ÿ\n"
"如è¦é—œé–‰æ­¤è¨Šæ¯ï¼Œè«‹åŸ·è¡Œ\n"
-"\"git config advice.addEmptyPathspec false\""
+"“git config advice.addEmptyPathspec falseâ€"
#: builtin/add.c builtin/check-ignore.c builtin/checkout.c builtin/clean.c
#: builtin/commit.c builtin/diff-tree.c builtin/grep.c builtin/mv.c
@@ -2222,46 +2329,51 @@ msgstr ""
msgid "index file corrupt"
msgstr "索引檔案æ壞"
+#: builtin/add.c builtin/am.c builtin/checkout.c builtin/clone.c
+#: builtin/commit.c builtin/stash.c merge.c rerere.c
+msgid "unable to write new index file"
+msgstr "無法寫入新的索引檔案"
+
#: builtin/am.c builtin/mailinfo.c mailinfo.c
#, c-format
msgid "bad action '%s' for '%s'"
-msgstr "「%sã€å‹•ä½œå°ã€Œ%sã€ç„¡æ•ˆ"
+msgstr "“%sâ€ å‹•ä½œå° â€œ%s†無效"
#: builtin/am.c builtin/blame.c builtin/fetch.c builtin/pack-objects.c
-#: builtin/pull.c diff-merges.c gpg-interface.c ls-refs.c parallel-checkout.c
-#: sequencer.c setup.c
+#: builtin/pull.c config.c diff-merges.c gpg-interface.c ls-refs.c
+#: parallel-checkout.c sequencer.c setup.c
#, c-format
msgid "invalid value for '%s': '%s'"
-msgstr "「%sã€çš„值無效:「%sã€"
+msgstr "“%s†的值無效:“%sâ€"
#: builtin/am.c builtin/commit.c builtin/merge.c sequencer.c
#, c-format
msgid "could not read '%s'"
-msgstr "ä¸èƒ½è®€å– '%s'"
+msgstr "ç„¡æ³•è®€å– â€œ%sâ€"
#: builtin/am.c
msgid "could not parse author script"
-msgstr "ä¸èƒ½è§£æžä½œè€…腳本"
+msgstr "無法解æžä½œè€…文稿"
#: builtin/am.c builtin/replace.c commit.c sequencer.c
#, c-format
msgid "could not parse %s"
-msgstr "ä¸èƒ½è§£æž %s"
+msgstr "ç„¡æ³•è§£æž %s"
#: builtin/am.c
#, c-format
msgid "'%s' was deleted by the applypatch-msg hook"
-msgstr "'%s' 被 applypatch-msg 掛鉤刪除"
+msgstr "“%s†被 applypatch-msg 掛鉤刪除"
#: builtin/am.c
#, c-format
msgid "Malformed input line: '%s'."
-msgstr "éžæ³•çš„輸入行:'%s'。"
+msgstr "æ ¼å¼éŒ¯èª¤çš„輸入列:“%sâ€ã€‚"
#: builtin/am.c
#, c-format
msgid "Failed to copy notes from '%s' to '%s'"
-msgstr "從 '%s' 複製註解到 '%s' 時失敗"
+msgstr "從 “%s†拷è²è¨»è§£åˆ° “%s†失敗"
#: builtin/am.c
msgid "fseek failed"
@@ -2270,21 +2382,21 @@ msgstr "fseek 失敗"
#: builtin/am.c builtin/rebase.c sequencer.c wrapper.c
#, c-format
msgid "could not open '%s' for reading"
-msgstr "無法開啟 '%s' 進行讀å–"
+msgstr "無法開啟 “%s†進行讀å–"
-#: builtin/am.c builtin/rebase.c strbuf.c wrapper.c
+#: builtin/am.c builtin/rebase.c editor.c sequencer.c wrapper.c
#, c-format
msgid "could not open '%s' for writing"
-msgstr "無法開啟 '%s' 進行寫入"
+msgstr "無法開啟 “%s†進行寫入"
#: builtin/am.c
#, c-format
msgid "could not parse patch '%s'"
-msgstr "無法解æžä¿®è£œæª” '%s'"
+msgstr "無法解æžä¿®è£œæª” “%sâ€"
#: builtin/am.c
msgid "Only one StGIT patch series can be applied at once"
-msgstr "一次åªèƒ½æœ‰ä¸€å€‹ StGIT 修補檔佇列被套用"
+msgstr "一次åªèƒ½å¥—用一個 StGIT 修補檔åºåˆ—"
#: builtin/am.c
msgid "invalid timestamp"
@@ -2292,11 +2404,11 @@ msgstr "無效的時間戳"
#: builtin/am.c
msgid "invalid Date line"
-msgstr "無效的日期行"
+msgstr "無效的 Date 列"
#: builtin/am.c
msgid "invalid timezone offset"
-msgstr "無效的時å€ä½ç§»å€¼"
+msgstr "無效的時å€å移"
#: builtin/am.c
msgid "Patch format detection failed."
@@ -2305,74 +2417,74 @@ msgstr "修補檔格å¼åµæ¸¬å¤±æ•—。"
#: builtin/am.c builtin/clone.c
#, c-format
msgid "failed to create directory '%s'"
-msgstr "建立目錄 '%s' 失敗"
+msgstr "無法建立目錄 “%sâ€"
#: builtin/am.c
msgid "Failed to split patches."
-msgstr "分割修補檔失敗。"
+msgstr "無法切割修補檔。"
#: builtin/am.c
#, c-format
msgid "When you have resolved this problem, run \"%s --continue\"."
-msgstr "當您解決這一å•é¡Œï¼ŒåŸ·è¡Œ \"%s --continue\"。"
+msgstr "解決此å•é¡Œå¾Œï¼Œè«‹åŸ·è¡Œ “%s --continueâ€ã€‚"
#: builtin/am.c
#, c-format
msgid "If you prefer to skip this patch, run \"%s --skip\" instead."
-msgstr "如果您想è¦ç•¥éŽé€™ä¸€ä¿®è£œæª”,則執行 \"%s --skip\"。"
+msgstr "è‹¥è¦ç•¥éŽæ­¤ä¿®è£œï¼Œè«‹æ”¹åŸ·è¡Œ “%s --skipâ€ã€‚"
#: builtin/am.c
#, c-format
msgid "To record the empty patch as an empty commit, run \"%s --allow-empty\"."
-msgstr "è‹¥è¦å°‡ç©ºç™½ä¿®è£œæª”錄製為空白æ交,請執行「%s --allow-emptyã€ã€‚"
+msgstr "è‹¥è¦å°‡ç©ºç™½ä¿®è£œæª”錄入為空白æ交,請執行 “%s --allow-emptyâ€ã€‚"
#: builtin/am.c
#, c-format
msgid "To restore the original branch and stop patching, run \"%s --abort\"."
-msgstr "è‹¥è¦å¾©åŽŸè‡³åŽŸå§‹åˆ†æ”¯ä¸¦åœæ­¢ä¿®è£œå‹•ä½œï¼ŒåŸ·è¡Œ \"%s --abort\"。"
+msgstr "è‹¥è¦é‚„原至原始分支,並åœæ­¢ä¿®è£œå‹•ä½œï¼Œè«‹åŸ·è¡Œ “%s --abortâ€ã€‚"
#: builtin/am.c
msgid "Patch sent with format=flowed; space at the end of lines might be lost."
-msgstr "修補檔使用 format=flowed æ ¼å¼å‚³é€ï¼Œè¡Œå°¾çš„空格å¯èƒ½æœƒéºå¤±ã€‚"
+msgstr "修補檔使用 format=flowed æ ¼å¼å‚³é€ï¼šåˆ—尾的空格å¯èƒ½æœƒéºå¤±ã€‚"
#: builtin/am.c
#, c-format
msgid "missing author line in commit %s"
-msgstr "在æ交 %s 中缺少作者行"
+msgstr "在æ交 %s 中缺少作者列"
#: builtin/am.c
#, c-format
msgid "invalid ident line: %.*s"
-msgstr "無效的身份標記:%.*s"
+msgstr "ident 列無效:%.*s"
#: builtin/am.c builtin/checkout.c builtin/clone.c commit-graph.c
#, c-format
msgid "unable to parse commit %s"
-msgstr "ä¸èƒ½è§£æžæ交 %s"
+msgstr "ç„¡æ³•è§£æž %s æ交"
#: builtin/am.c
msgid "Repository lacks necessary blobs to fall back on 3-way merge."
-msgstr "版本庫缺ä¹å¿…è¦çš„資料物件以進行三方åˆä½µã€‚"
+msgstr "版本庫缺少必è¦çš„資料物件,無法進行三方åˆä½µã€‚"
#: builtin/am.c
msgid "Using index info to reconstruct a base tree..."
-msgstr "使用索引來é‡å»ºä¸€å€‹ï¼ˆä¸‰æ–¹åˆä½µçš„)基礎目錄樹..."
+msgstr "正在使用索引資訊é‡å»ºåŸºç¤Žæ¨¹â€¦â€¦"
#: builtin/am.c
msgid ""
"Did you hand edit your patch?\n"
"It does not apply to blobs recorded in its index."
msgstr ""
-"您是å¦æ›¾æ‰‹å‹•ç·¨è¼¯éŽæ‚¨çš„修補檔?\n"
-"無法套用修補檔到索引中的資料物件上。"
+"您是å¦æ›¾è‡ªè¡Œç·¨è¼¯éŽæ‚¨çš„修補檔?\n"
+"未能套用至索引錄入的資料物件。"
#: builtin/am.c
msgid "Falling back to patching base and 3-way merge..."
-msgstr "回è½åˆ°åŸºç¤Žç‰ˆæœ¬ä¸Šä¿®è£œåŠé€²è¡Œä¸‰æ–¹åˆä½µ..."
+msgstr "正在回復到修補基礎處,並進行三方åˆä½µâ€¦â€¦"
#: builtin/am.c
msgid "Failed to merge in the changes."
-msgstr "無法åˆä½µè®Šæ›´ã€‚"
+msgstr "無法åˆä½µæ›´å‹•ã€‚"
#: builtin/am.c builtin/merge.c sequencer.c
msgid "git write-tree failed to write a tree"
@@ -2380,12 +2492,11 @@ msgstr "git write-tree 無法寫入樹狀物件"
#: builtin/am.c
msgid "applying to an empty history"
-msgstr "正套用到一個空歷å²ä¸Š"
+msgstr "正在套用至空白歷å²è¨˜éŒ„上"
-#: builtin/am.c builtin/commit.c builtin/merge.c sequencer.c
-#: t/helper/test-fast-rebase.c
+#: builtin/am.c builtin/commit.c builtin/merge.c builtin/replay.c sequencer.c
msgid "failed to write commit object"
-msgstr "寫æ交物件失敗"
+msgstr "無法寫入æ交物件"
#: builtin/am.c
#, c-format
@@ -2394,7 +2505,7 @@ msgstr "無法繼續:%s ä¸å­˜åœ¨ã€‚"
#: builtin/am.c
msgid "Commit Body is:"
-msgstr "æ交內容為:"
+msgstr "æ交內文為:"
# 譯者:請維æŒå¥å°¾ç©ºæ ¼
#. TRANSLATORS: Make sure to include [y], [n], [e], [v] and [a]
@@ -2404,7 +2515,7 @@ msgstr "æ交內容為:"
#: builtin/am.c
#, c-format
msgid "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all: "
-msgstr "套用?是[y]/å¦[n]/編輯[e]/檢視修補檔[v]/全部接å—[a]: "
+msgstr "是å¦å¥—用?是[y]/å¦[n]/編輯[e]/檢視修補檔[v]/全部接å—[a]: "
#: builtin/am.c builtin/commit.c
msgid "unable to write index file"
@@ -2413,7 +2524,7 @@ msgstr "無法寫入索引檔案"
#: builtin/am.c
#, c-format
msgid "Dirty index: cannot apply patches (dirty: %s)"
-msgstr "髒索引:ä¸èƒ½å¥—用修補檔(髒檔案:%s)"
+msgstr "有異動索引:無法套用修補檔(異動處:%s)"
#: builtin/am.c
#, c-format
@@ -2427,7 +2538,7 @@ msgstr "建立空白æ交:%.*s"
#: builtin/am.c
msgid "Patch is empty."
-msgstr "修補檔為空。"
+msgstr "修補檔空白。"
#: builtin/am.c
#, c-format
@@ -2436,20 +2547,20 @@ msgstr "套用:%.*s"
#: builtin/am.c
msgid "No changes -- Patch already applied."
-msgstr "沒有變更——修補檔已經套用éŽã€‚"
+msgstr "沒有變更——修補檔已套用éŽã€‚"
#: builtin/am.c
#, c-format
msgid "Patch failed at %s %.*s"
-msgstr "打修補檔失敗於 %s %.*s"
+msgstr "在 %s %.*s 處修補失敗"
#: builtin/am.c
msgid "Use 'git am --show-current-patch=diff' to see the failed patch"
-msgstr "用 'git am --show-current-patch=diff' 命令檢視失敗的修補檔"
+msgstr "使用 “git am --show-current-patch=diff†命令檢視失敗的修補檔"
#: builtin/am.c
msgid "No changes - recorded it as an empty commit."
-msgstr "沒有變更 ï¼ å°‡å…¶éŒ„è£½ç‚ºç©ºç™½æ交。"
+msgstr "沒有變更:將其錄入為空白æ交。"
#: builtin/am.c
msgid ""
@@ -2457,9 +2568,9 @@ msgid ""
"If there is nothing left to stage, chances are that something else\n"
"already introduced the same changes; you might want to skip this patch."
msgstr ""
-"沒有變更 —— 您是ä¸æ˜¯å¿˜äº†åŸ·è¡Œ 'git add'?\n"
-"如果沒有什麼è¦æ–°å¢žåˆ°æš«å­˜å€çš„,則很å¯èƒ½æ˜¯å…¶å®ƒæ交已經引入了相åŒçš„變更。\n"
-"您也許想è¦ç•¥éŽé€™å€‹ä¿®è£œæª”。"
+"沒有變更:是å¦å¿˜è¨˜åŸ·è¡Œ “git addâ€ï¼Ÿ\n"
+"如果沒有其他è¦æ–°å¢žåˆ°æš«å­˜å€çš„,則很å¯èƒ½æ˜¯å…¶å®ƒæ交\n"
+"已經引入了相åŒçš„變更。您也許想è¦ç•¥éŽé€™å€‹ä¿®è£œæª”。"
#: builtin/am.c
msgid ""
@@ -2468,59 +2579,55 @@ msgid ""
"such.\n"
"You might run `git rm` on a file to accept \"deleted by them\" for it."
msgstr ""
-"在您的索引中ä»å­˜åœ¨æœªåˆä½µçš„路徑。\n"
-"您應該å°å·²ç¶“è¡çªè§£æ±ºçš„æ¯ä¸€å€‹æª”案執行 'git add' 來標記已經完æˆã€‚ \n"
-"ä½ å¯ä»¥å° \"由他們刪除\" 的檔案執行 `git rm` 指令。"
-
-#: builtin/am.c builtin/checkout.c builtin/clone.c builtin/stash.c merge.c
-#: rerere.c
-msgid "unable to write new index file"
-msgstr "無法寫新的索引檔案"
+"索引中ä»æœ‰æœªåˆä½µè·¯å¾‘。\n"
+"您應該å°å·²ç¶“解決è¡çªçš„æ¯ä¸€å€‹æª”案執行 `git add`,標記為已經完æˆã€‚\n"
+"ä½ å¯ä»¥å°ã€Œç”±ä»–們刪除ã€çš„檔案,執行 `git rm` 指令。"
#: 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"
-msgstr "清空索引失敗"
+msgstr "無法清除索引"
#: builtin/am.c
msgid ""
"You seem to have moved HEAD since the last 'am' failure.\n"
"Not rewinding to ORIG_HEAD"
-msgstr "您好åƒåœ¨ä¸Šä¸€æ¬¡ 'am' 失敗後移動了 HEAD。未還原至 ORIG_HEAD"
+msgstr ""
+"您似乎在上一次 “am†失敗後移動了 HEAD。\n"
+"未倒轉回 ORIG_HEAD"
-#: builtin/am.c builtin/bisect--helper.c worktree.c
+#: builtin/am.c builtin/bisect.c worktree.c
#, c-format
msgid "failed to read '%s'"
-msgstr "è®€å– '%s' 失敗"
-
-#: builtin/am.c
-#, c-format
-msgid "options '%s=%s' and '%s=%s' cannot be used together"
-msgstr "「%s=%sã€å’Œã€Œ%s=%sã€é¸é …ä¸å¾—åŒæ™‚使用"
+msgstr "ç„¡æ³•è®€å– â€œ%sâ€"
#: builtin/am.c
msgid "git am [<options>] [(<mbox> | <Maildir>)...]"
-msgstr "git am [<é¸é …>] [(<mbox> | <Maildir>)...]"
+msgstr "git am [<options>] [(<mbox> | <Maildir>)...]"
#: builtin/am.c
msgid "git am [<options>] (--continue | --skip | --abort)"
-msgstr "git am [<é¸é …>] (--continue | --skip | --abort)"
+msgstr "git am [<options>] (--continue | --skip | --abort)"
#: builtin/am.c
msgid "run interactively"
-msgstr "以互動å¼æ–¹å¼åŸ·è¡Œ"
+msgstr "互動å¼åŸ·è¡Œ"
+
+#: builtin/am.c
+msgid "bypass pre-applypatch and applypatch-msg hooks"
+msgstr "ç¹žéŽ pre-applypatch å’Œ applypatch-msg 掛鉤"
#: builtin/am.c
msgid "historical option -- no-op"
-msgstr "è€çš„åƒæ•¸ —— 無作用"
+msgstr "æ­·å²éºç•™é¸é …——無作用"
#: builtin/am.c
msgid "allow fall back on 3way merging if needed"
-msgstr "如果必è¦ï¼Œå…許使用三方åˆä½µ"
+msgstr "å¿…è¦æ™‚å…許回復至三方åˆä½µ"
#: builtin/am.c builtin/init-db.c builtin/prune-packed.c builtin/repack.c
#: builtin/stash.c
@@ -2529,43 +2636,39 @@ msgstr "éœé»˜æ¨¡å¼"
#: builtin/am.c
msgid "add a Signed-off-by trailer to the commit message"
-msgstr "在æ交說明çµå°¾åŠ å…¥ Signed-off-by"
+msgstr "在æ交說明çµå°¾è™•åŠ å…¥ Signed-off-by"
#: builtin/am.c
msgid "recode into utf8 (default)"
-msgstr "使用 utf8 字元集(é è¨­ï¼‰"
+msgstr "使用 utf8 字元集(é è¨­å€¼ï¼‰"
#: builtin/am.c
msgid "pass -k flag to git-mailinfo"
-msgstr "å‘ git-mailinfo å‚³éž -k åƒæ•¸"
+msgstr "å‘ git-mailinfo 傳入 -k åƒæ•¸"
#: builtin/am.c
msgid "pass -b flag to git-mailinfo"
-msgstr "å‘ git-mailinfo å‚³éž -b åƒæ•¸"
+msgstr "å‘ git-mailinfo 傳入 -b åƒæ•¸"
#: builtin/am.c
msgid "pass -m flag to git-mailinfo"
-msgstr "å‘ git-mailinfo å‚³éž -m åƒæ•¸"
+msgstr "å‘ git-mailinfo 傳入 -m åƒæ•¸"
#: builtin/am.c
msgid "pass --keep-cr flag to git-mailsplit for mbox format"
-msgstr "é‡å° mbox æ ¼å¼ï¼Œå‘ git-mailsplit å‚³éž --keep-cr åƒæ•¸"
-
-#: builtin/am.c
-msgid "do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"
-msgstr "ä¸å‘ git-mailsplit å‚³éž --keep-cr åƒæ•¸ï¼Œè¦†è“‹ am.keepcr 的設定"
+msgstr "若為 mbox æ ¼å¼ï¼Œå‘ git-mailsplit 傳入 --keep-cr 標記"
#: builtin/am.c
msgid "strip everything before a scissors line"
-msgstr "æ¨æ£„è£åˆ‡ç·šå‰çš„所有內容"
+msgstr "截掉è£åˆ‡ç·šå‰çš„所有內容"
#: builtin/am.c
msgid "pass it through git-mailinfo"
-msgstr "é€éŽ git-mailinfo 傳éž"
+msgstr "é€éŽ git-mailinfo 傳入"
#: builtin/am.c
msgid "pass it through git-apply"
-msgstr "傳éžçµ¦ git-apply"
+msgstr "é€éŽ git-apply 傳入"
#: builtin/am.c builtin/commit.c builtin/fmt-merge-msg.c builtin/grep.c
#: builtin/merge.c builtin/pull.c builtin/rebase.c builtin/repack.c
@@ -2574,10 +2677,11 @@ msgid "n"
msgstr "n"
#: builtin/am.c builtin/branch.c builtin/bugreport.c builtin/cat-file.c
-#: builtin/for-each-ref.c builtin/ls-tree.c builtin/replace.c builtin/tag.c
+#: builtin/clone.c builtin/diagnose.c builtin/for-each-ref.c builtin/init-db.c
+#: builtin/ls-files.c builtin/ls-tree.c builtin/replace.c builtin/tag.c
#: builtin/verify-tag.c
msgid "format"
-msgstr "æ ¼å¼"
+msgstr "format"
#: builtin/am.c
msgid "format the patch(es) are in"
@@ -2585,7 +2689,7 @@ msgstr "修補檔的格å¼"
#: builtin/am.c
msgid "override error message when patch failure occurs"
-msgstr "打修補檔失敗時顯示的錯誤訊æ¯"
+msgstr "覆蓋修補失敗時顯示的錯誤訊æ¯"
#: builtin/am.c
msgid "continue applying patches after resolving a conflict"
@@ -2605,7 +2709,7 @@ msgstr "還原原始分支並中止修補動作"
#: builtin/am.c
msgid "abort the patching operation but keep HEAD where it is"
-msgstr "終止修補動作但ä¿æŒ HEAD ä¸è®Š"
+msgstr "中止修補動作但ä¿æŒ HEAD ä¸è®Š"
#: builtin/am.c
msgid "show the patch being applied"
@@ -2613,15 +2717,15 @@ msgstr "顯示正在套用的修補檔"
#: builtin/am.c
msgid "record the empty patch as an empty commit"
-msgstr "將空白修補檔錄製為空白æ交"
+msgstr "將空白修補檔錄入為空白æ交"
#: builtin/am.c
msgid "lie about committer date"
-msgstr "將作者日期作為æ交日期"
+msgstr "將作者日期當作æ交日期"
#: builtin/am.c
msgid "use current timestamp for author date"
-msgstr "用目å‰æ™‚間作為作者日期"
+msgstr "把目å‰æ™‚間戳當作是作者日期"
#: builtin/am.c builtin/commit-tree.c builtin/commit.c builtin/merge.c
#: builtin/pull.c builtin/rebase.c builtin/revert.c builtin/tag.c
@@ -2645,8 +2749,8 @@ msgid ""
"The -b/--binary option has been a no-op for long time, and\n"
"it will be removed. Please do not use it anymore."
msgstr ""
-"åƒæ•¸ -b/--binary 已經很長時間ä¸åšä»»ä½•å¯¦è³ªå‹•ä½œäº†ï¼Œä¸¦ä¸”將被移除。\n"
-"è«‹ä¸è¦å†ä½¿ç”¨å®ƒäº†ã€‚"
+"-b/--binary é¸é …已經有很長時間ä¸åšä»»ä½•å¯¦è³ªå‹•ä½œäº†ï¼Œ\n"
+"並且將被移除。請ä¸è¦å†ä½¿ç”¨å®ƒäº†ã€‚"
#: builtin/am.c
msgid "failed to read the index"
@@ -2663,170 +2767,165 @@ msgid ""
"Stray %s directory found.\n"
"Use \"git am --abort\" to remove it."
msgstr ""
-"發ç¾äº†éŒ¯èª¤çš„ %s 目錄。\n"
-"使用 \"git am --abort\" 刪除它。"
+"發ç¾å¤±æ•£çš„ %s 目錄。\n"
+"使用 “git am --abort†移除。"
#: builtin/am.c
msgid "Resolve operation not in progress, we are not resuming."
-msgstr "解決動作未進行,我們ä¸æœƒç¹¼çºŒã€‚"
+msgstr "未在進行解決動作,ä¸æœƒç¹¼çºŒã€‚"
#: builtin/am.c
msgid "interactive mode requires patches on the command line"
-msgstr "互動å¼æ¨¡å¼éœ€è¦æŒ‡ä»¤åˆ—上æ供修補檔"
+msgstr "互動模å¼éœ€è¦å‘½ä»¤åˆ—上æ供修補檔"
#: builtin/apply.c
msgid "git apply [<options>] [<patch>...]"
-msgstr "git apply [<é¸é …>] [<修補檔>...]"
+msgstr "git apply [<options>] [<patch>...]"
-#: builtin/archive.c contrib/scalar/scalar.c
+#: builtin/archive.c diagnose.c
msgid "could not redirect output"
-msgstr "ä¸èƒ½é‡å®šå‘輸出"
+msgstr "無法é‡æ–°å°Žå‘輸出"
#: builtin/archive.c
msgid "git archive: Remote with no URL"
-msgstr "git archive:未æä¾›é ç«¯ URL"
+msgstr "git archive: 未æä¾›é ç«¯ URL"
#: builtin/archive.c
msgid "git archive: expected ACK/NAK, got a flush packet"
-msgstr "git archive:期望是 ACK/NAK,å»å¾—到 flush 包"
+msgstr "git archive:é æœŸæ˜¯ ACK/NAK,å»æ”¶åˆ° flush å°åŒ…"
#: builtin/archive.c
#, c-format
msgid "git archive: NACK %s"
-msgstr "git archive:NACK %s"
+msgstr "git archive: NACK %s"
#: builtin/archive.c
msgid "git archive: protocol error"
-msgstr "git archive:å”定錯誤"
+msgstr "git archive:通訊å”定錯誤"
#: builtin/archive.c
msgid "git archive: expected a flush"
-msgstr "git archive:應有一個 flush 包"
-
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-reset [<commit>]"
-msgstr "git bisect--helper --bisect-reset [<æ交>]"
+msgstr "git archive:é æœŸæ”¶åˆ° flush å°åŒ…"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<term> --term-{old,good}"
-"=<term>] [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] "
-"[<paths>...]"
+"git bisect start [--term-(new|bad)=<term> --term-(old|good)=<term>] [--no-"
+"checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]"
msgstr ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<術語> --term-{old,good}"
-"=<術語>] [--no-checkout] [--first-parent] [<壞> [<好>...]] [--] [<路徑>...]"
+"git bisect start [--term-(new|bad)=<term> --term-(old|good)=<term>] [--no-"
+"checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-state (bad|new) [<rev>]"
-msgstr "git bisect--helper --bisect-state (bad|new) [<修訂版>]"
+#: builtin/bisect.c
+msgid "git bisect (good|bad) [<rev>...]"
+msgstr "git bisect (good|bad) [<rev>...]"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-state (good|old) [<rev>...]"
-msgstr "git bisect--helper --bisect-state (good|old) [<修訂版>...]"
+#: builtin/bisect.c
+msgid "git bisect skip [(<rev>|<range>)...]"
+msgstr "git bisect skip [(<rev>|<range>)...]"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-replay <filename>"
-msgstr "git bisect--helper --bisect-replay <檔å>"
+#: builtin/bisect.c
+msgid "git bisect reset [<commit>]"
+msgstr "git bisect reset [<commit>]"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-skip [(<rev>|<range>)...]"
-msgstr "git bisect--helper --bisect-skip [(<修訂版>|<範åœ>)...]"
+#: builtin/bisect.c
+msgid "git bisect replay <logfile>"
+msgstr "git bisect replay <logfile>"
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-run <cmd>..."
-msgstr "git bisect--helper --bisect-run <cmd>..."
+#: builtin/bisect.c
+msgid "git bisect run <cmd> [<arg>...]"
+msgstr "git bisect run <cmd> [<arg>...]"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "cannot open file '%s' in mode '%s'"
-msgstr "無法以 '%2$s' 模å¼é–‹å•Ÿ '%1$s' 檔案"
+msgstr "無法以 “%2$s†模å¼é–‹å•Ÿ “%1$s†檔案"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "could not write to file '%s'"
-msgstr "無法寫入 '%s' 檔案"
+msgstr "無法寫入 “%s†檔案"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "cannot open file '%s' for reading"
-msgstr "無法開啟「%sã€æª”案進行讀å–"
+msgstr "無法開啟 “%s†檔案進行讀å–"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "'%s' is not a valid term"
-msgstr "'%s' ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„術語"
+msgstr "“%s†ä¸æ˜¯æœ‰æ•ˆè¡“語"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "can't use the builtin command '%s' as a term"
-msgstr "ä¸èƒ½ä½¿ç”¨å…§å»ºæŒ‡ä»¤ '%s' 作為術語"
+msgstr "ä¸èƒ½å°‡å…§å»ºå‘½ä»¤ “%s†當作術語使用"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "can't change the meaning of the term '%s'"
-msgstr "ä¸èƒ½ä¿®æ”¹è¡“語 '%s' çš„å«ç¾©"
+msgstr "ä¸èƒ½è®Šæ›´è¡“語 “%s†的å«ç¾©"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "please use two different terms"
msgstr "請使用兩個ä¸åŒçš„術語"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "We are not bisecting.\n"
msgstr "我們沒有在二分æœå°‹ã€‚\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "'%s' is not a valid commit"
-msgstr "'%s' ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„æ交"
+msgstr "“%s†ä¸æ˜¯æœ‰æ•ˆçš„æ交"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid ""
"could not check out original HEAD '%s'. Try 'git bisect reset <commit>'."
-msgstr "ä¸èƒ½ç°½å‡ºåŽŸå§‹ HEAD '%s'。嘗試 'git bisect reset <æ交>'。"
+msgstr "ä¸èƒ½ç°½å‡ºåŽŸå§‹ HEAD “%sâ€ã€‚請嘗試 “git bisect reset <commit>â€ã€‚"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "Bad bisect_write argument: %s"
-msgstr "壞的 bisect_write åƒæ•¸ï¼š%s"
+msgstr "bisect_write 引數無效:%s"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "couldn't get the oid of the rev '%s'"
-msgstr "無法å–得版本 '%s' 的物件 ID"
+msgstr "無法å–得修訂版 “%s†的物件 ID"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "couldn't open the file '%s'"
-msgstr "無法開啟檔案 '%s'"
+msgstr "無法開啟檔案 “%sâ€"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "Invalid command: you're currently in a %s/%s bisect"
-msgstr "無效的指令:您目å‰æ­£è™•æ–¼ä¸€å€‹ %s/%s 二分æœå°‹ä¸­"
+msgstr "命令無效:您目å‰æ­£è™•æ–¼äºŒåˆ†æœå°‹ %s/%s 的狀態"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid ""
"You need to give me at least one %s and %s revision.\n"
"You can use \"git bisect %s\" and \"git bisect %s\" for that."
msgstr ""
-"您需è¦çµ¦æˆ‘至少一個 %s 和一個 %s 版本。\n"
-"為此您å¯ä»¥ç”¨ \"git bisect %s\" å’Œ \"git bisect %s\"。"
+"需指定至少一個 %s 和一個 %s 修訂版。\n"
+"為此您å¯ä»¥ç”¨ “git bisect %s†和 “git bisect %sâ€ã€‚"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid ""
"You need to start by \"git bisect start\".\n"
"You then need to give me at least one %s and %s revision.\n"
"You can use \"git bisect %s\" and \"git bisect %s\" for that."
msgstr ""
-"您需è¦åŸ·è¡Œ \"git bisect start\" 來開始。\n"
-"然後需è¦æ供我至少一個 %s 和一個 %s 版本。\n"
-"為此您å¯ä»¥ç”¨ \"git bisect %s\" å’Œ \"git bisect %s\" 指令。"
+"è¦é–‹å§‹ï¼Œè«‹åŸ·è¡Œ “git bisect startâ€ã€‚\n"
+"接著æ供至少一個 %s 和一個 %s 修訂版。\n"
+"為此您å¯ä»¥ç”¨ “git bisect %s†和 “git bisect %sâ€ã€‚"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "bisecting only with a %s commit"
msgstr "在åªæœ‰ä¸€å€‹ %s æ交的情æ³ä¸‹äºŒåˆ†æœå°‹"
@@ -2836,287 +2935,249 @@ msgstr "在åªæœ‰ä¸€å€‹ %s æ交的情æ³ä¸‹äºŒåˆ†æœå°‹"
#. translation. The program will only accept English input
#. at this point.
#.
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "Are you sure [Y/n]? "
-msgstr "您確èªå—Ž[Y/n]? "
+msgstr "是å¦ç¢ºå®š [Y/n]? "
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "status: waiting for both good and bad commits\n"
msgstr "狀態:正在等待好和壞的æ交\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "status: waiting for bad commit, %d good commit known\n"
msgid_plural "status: waiting for bad commit, %d good commits known\n"
msgstr[0] "狀態:正在等待壞的æ交,已知有 %d 個好的æ交\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "status: waiting for good commit(s), bad commit known\n"
msgstr "狀態:正在等待好的æ交,已知有壞的æ交\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "no terms defined"
msgstr "未定義術語"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid ""
"Your current terms are %s for the old state\n"
"and %s for the new state.\n"
-msgstr "您目å‰é‡å°èˆŠç‹€æ…‹çš„術語是 %s,å°æ–°ç‹€æ…‹çš„術語是 %s。\n"
+msgstr ""
+"您目å‰é‡å°èˆŠç‹€æ…‹çš„術語是 %sï¼›\n"
+"å°æ–°ç‹€æ…‹çš„術語是 %s。\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid ""
"invalid argument %s for 'git bisect terms'.\n"
"Supported options are: --term-good|--term-old and --term-bad|--term-new."
msgstr ""
-"指令 'git bisect terms' çš„åƒæ•¸ %s 無效。\n"
+"傳入 “git bisect terms†的 %s 引數無效。\n"
"支æ´çš„é¸é …有:--term-good|--term-old å’Œ --term-bad|--term-new。"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "revision walk setup failed\n"
-msgstr "版本é歷設定失敗\n"
+msgstr "修訂版é歷設定失敗\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "could not open '%s' for appending"
-msgstr "無法開啟 '%s' 進行附加"
+msgstr "無法開啟 “%s†進行附加"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "'' is not a valid term"
-msgstr "'' ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„術語"
+msgstr "“ †ä¸æ˜¯æœ‰æ•ˆè¡“語"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "unrecognized option: '%s'"
-msgstr "未識別的é¸é …:'%s'"
+msgstr "無法識別é¸é …:“%sâ€"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "'%s' does not appear to be a valid revision"
-msgstr "'%s' 看起來ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„版本"
+msgstr "“%s†似乎ä¸æ˜¯æœ‰æ•ˆä¿®è¨‚版"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "bad HEAD - I need a HEAD"
-msgstr "壞的 HEAD - 我需è¦ä¸€å€‹ HEAD"
+msgstr "HEAD 無效 — 需è¦ä¸€å€‹ HEAD"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "checking out '%s' failed. Try 'git bisect start <valid-branch>'."
-msgstr "簽出 '%s' 失敗。嘗試 'git bisect start <有效分支>'。"
-
-#: builtin/bisect--helper.c
-msgid "won't bisect on cg-seek'ed tree"
-msgstr "ä¸æœƒåœ¨åšäº† cg-seek 的樹上åšäºŒåˆ†æœå°‹"
+msgstr "簽出 “%s†失敗。請嘗試 “git bisect start <valid-branch>â€ã€‚"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "bad HEAD - strange symbolic ref"
-msgstr "壞的 HEAD - 奇怪的符號引用"
+msgstr "HEAD 無效 — 異常符號引用"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "invalid ref: '%s'"
-msgstr "無效的引用:'%s'"
+msgstr "引用無效:“%sâ€"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "You need to start by \"git bisect start\"\n"
-msgstr "您需è¦åŸ·è¡Œ \"git bisect start\" 來開始\n"
+msgstr "è¦é–‹å§‹ï¼Œè«‹åŸ·è¡Œ “git bisect startâ€\n"
# 譯者:請維æŒå¥å°¾ç©ºæ ¼
#. TRANSLATORS: Make sure to include [Y] and [n] in your
#. translation. The program will only accept English input
#. at this point.
#.
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "Do you want me to do it for you [Y/n]? "
-msgstr "您想讓我為您這樣åšå—Ž[Y/n]? "
+msgstr "是å¦è¦é€™éº¼åš [Y/n]? "
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "Please call `--bisect-state` with at least one argument"
msgstr "è¦å‘¼å« `--bisect-state`,請傳入一個以上的引數"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "'git bisect %s' can take only one argument."
-msgstr "'git bisect %s' åªèƒ½æœ‰ä¸€å€‹åƒæ•¸ã€‚"
+msgstr "“git bisect %s†åªå–一個引數。"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "Bad rev input: %s"
-msgstr "<修訂版> 輸入格å¼éŒ¯èª¤ï¼š%s"
+msgstr "rev 輸入格å¼éŒ¯èª¤ï¼š%s"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "Bad rev input (not a commit): %s"
-msgstr "修訂版輸入有誤(ä¸æ˜¯æ交):%s"
+msgstr "rev 輸入有誤(ä¸æ˜¯æ交):%s"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "We are not bisecting."
msgstr "我們沒有在二分æœå°‹ã€‚"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "'%s'?? what are you talking about?"
msgstr "「%sã€ï¼Ÿï¼Ÿæ‚¨åœ¨èªªä»€éº¼ï¼Ÿ"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "cannot read file '%s' for replaying"
-msgstr "無法讀å–「%sã€æª”案來é‡æ”¾"
+msgstr "無法讀å–「%sã€æª”案進行é‡æ”¾"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "running %s\n"
msgstr "正在執行 %s\n"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "bisect run failed: no command provided."
-msgstr "二分æœå°‹åŸ·è¡Œå¤±æ•—:沒有æ供指令。"
+msgstr "二分æœå°‹åŸ·è¡Œå¤±æ•—:沒有æ供命令。"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
-msgid "unable to verify '%s' on good revision"
-msgstr "無法在正確修訂版上驗證「%sã€"
+msgid "unable to verify %s on good revision"
+msgstr "無法在好的修訂版上驗證 %s"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "bogus exit code %d for good revision"
-msgstr "正確修訂版回傳å½é€ çš„錯誤代碼 %d"
+msgstr "好的修訂版回傳å½é€ çš„錯誤碼 %d"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
-msgid "bisect run failed: exit code %d from '%s' is < 0 or >= 128"
-msgstr "二分æœå°‹åŸ·è¡Œå¤±æ•—:「%2$sã€è¿”回的離開碼 %1$d å°æ–¼ 0 或 >= 128"
+msgid "bisect run failed: exit code %d from %s is < 0 or >= 128"
+msgstr "二分æœå°‹åŸ·è¡Œå¤±æ•—:%2$s 回傳的çµæŸä»£ç¢¼ %1$d å°æ–¼ 0 或大於 128"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
msgid "cannot open file '%s' for writing"
-msgstr "無法開啟「%sã€æª”案進行寫入"
+msgstr "無法開啟 “%s†檔案進行寫入"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
msgid "bisect run cannot continue any more"
msgstr "二分æœå°‹ä¸èƒ½ç¹¼çºŒåŸ·è¡Œ"
-#: builtin/bisect--helper.c
-#, c-format
+#: builtin/bisect.c
msgid "bisect run success"
msgstr "二分æœå°‹åŸ·è¡ŒæˆåŠŸ"
-#: builtin/bisect--helper.c
-#, c-format
+#: builtin/bisect.c
msgid "bisect found first bad commit"
msgstr "二分æœå°‹ç™¼ç¾åˆ°ç¬¬ä¸€å€‹æœ‰å•é¡Œçš„æ交"
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
#, c-format
-msgid ""
-"bisect run failed: 'git bisect--helper --bisect-state %s' exited with error "
-"code %d"
-msgstr ""
-"二分æœå°‹åŸ·è¡Œå¤±æ•—:'git bisect--helper --bisect-state %s' 以錯誤代碼 %d 離開"
-
-#: builtin/bisect--helper.c
-msgid "reset the bisection state"
-msgstr "清除二分æœå°‹ç‹€æ…‹"
-
-#: builtin/bisect--helper.c
-msgid "check whether bad or good terms exist"
-msgstr "檢查壞的或好的術語是å¦å­˜åœ¨"
-
-#: builtin/bisect--helper.c
-msgid "print out the bisect terms"
-msgstr "列å°äºŒåˆ†æœå°‹è¡“語"
-
-#: builtin/bisect--helper.c
-msgid "start the bisect session"
-msgstr "啟動二分æœå°‹éŽç¨‹"
-
-#: builtin/bisect--helper.c
-msgid "find the next bisection commit"
-msgstr "尋找下一個二分æœå°‹æ交"
-
-#: builtin/bisect--helper.c
-msgid "mark the state of ref (or refs)"
-msgstr "標記 ref (或 refs) 的狀態"
-
-#: builtin/bisect--helper.c
-msgid "list the bisection steps so far"
-msgstr "列出迄今的二分æœå°‹æ­¥é©Ÿ"
-
-#: builtin/bisect--helper.c
-msgid "replay the bisection process from the given file"
-msgstr "從指定檔案é‡æ”¾äºŒåˆ†æœå°‹éŽç¨‹"
-
-#: builtin/bisect--helper.c
-msgid "skip some commits for checkout"
-msgstr "ç•¥éŽè¦ç°½å‡ºçš„部分æ交"
+msgid "bisect run failed: 'git bisect %s' exited with error code %d"
+msgstr "二分æœå°‹åŸ·è¡Œå¤±æ•—:“git bisect %s†以錯誤碼 %d 離開"
-#: builtin/bisect--helper.c
-msgid "visualize the bisection"
-msgstr "視覺化二分æœå°‹éŽç¨‹"
-
-#: builtin/bisect--helper.c
-msgid "use <cmd>... to automatically bisect"
-msgstr "使用 <cmd>... 自動進行二分æœå°‹"
+#: builtin/bisect.c
+#, c-format
+msgid "'%s' requires either no argument or a commit"
+msgstr "“%s†ä¸éœ€è¦å¼•æ•¸ï¼Œæˆ–者得傳入一個æ交"
-#: builtin/bisect--helper.c
-msgid "no log for BISECT_WRITE"
-msgstr "BISECT_WRITE 無日誌"
+#: builtin/bisect.c
+#, c-format
+msgid "'%s' requires 0 or 1 argument"
+msgstr "“%sâ€ éœ€è¦ 0 或 1 個引數"
-#: builtin/bisect--helper.c
-msgid "--bisect-reset requires either no argument or a commit"
-msgstr "--bisect-reset 無需åƒæ•¸æˆ–者需è¦ä¸€å€‹æ交"
+#: builtin/bisect.c
+#, c-format
+msgid "'%s' requires 0 arguments"
+msgstr "“%s†ä¸éœ€å¼•æ•¸"
-#: builtin/bisect--helper.c
-msgid "--bisect-terms requires 0 or 1 argument"
-msgstr "--bisect-terms éœ€è¦ 0 或 1 個åƒæ•¸"
+#: builtin/bisect.c
+msgid "no logfile given"
+msgstr "未æ供日誌檔案"
-#: builtin/bisect--helper.c
-msgid "--bisect-next requires 0 arguments"
-msgstr "--bisect-next éœ€è¦ 0 個引數"
+#: builtin/bisect.c
+#, c-format
+msgid "'%s' failed: no command provided."
+msgstr "“%s†失敗:沒有æ供命令。"
-#: builtin/bisect--helper.c
-msgid "--bisect-log requires 0 arguments"
-msgstr "--bisect-log éœ€è¦ 0 個引數"
+#: builtin/bisect.c
+msgid "need a command"
+msgstr "需è¦æ供命令"
-#: builtin/bisect--helper.c
-msgid "no logfile given"
-msgstr "未æ供日誌檔案"
+#: builtin/bisect.c builtin/cat-file.c
+#, c-format
+msgid "unknown command: '%s'"
+msgstr "未知命令:“%sâ€"
#: builtin/blame.c
msgid "git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"
-msgstr "git blame [<é¸é …>] [<版本é¸é …>] [<版本>] [--] <檔案>"
+msgstr "git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"
+
+#: builtin/blame.c
+msgid "git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"
+msgstr "git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"
#: builtin/blame.c
msgid "<rev-opts> are documented in git-rev-list(1)"
-msgstr "<版本é¸é …> 的檔案記錄在 git-rev-list(1) 中"
+msgstr "<rev-opts> 的文件在 git-rev-list(1)"
#: builtin/blame.c
#, c-format
msgid "expecting a color: %s"
-msgstr "期望一個é¡è‰²ï¼š%s"
+msgstr "é æœŸæ˜¯å€‹é¡è‰²ï¼š%s"
#: builtin/blame.c
msgid "must end with a color"
-msgstr "必須以一個é¡è‰²çµå°¾"
+msgstr "çµå°¾å¿…須是一個é¡è‰²"
#: builtin/blame.c
#, c-format
msgid "cannot find revision %s to ignore"
-msgstr "ä¸èƒ½æ‰¾åˆ°è¦å¿½ç•¥çš„版本 %s"
+msgstr "ä¸èƒ½æ‰¾åˆ°è¦å¿½ç•¥çš„ %s 修訂版"
#: builtin/blame.c
msgid "show blame entries as we find them, incrementally"
-msgstr "增é‡å¼é¡¯ç¤ºç™¼ç¾çš„ blame æ¢ç›®"
+msgstr "漸進å¼é¡¯ç¤ºç™¼ç¾çš„溯æºé …ç›®"
#: builtin/blame.c
msgid "do not show object names of boundary commits (Default: off)"
-msgstr "ä¸è¦é¡¯ç¤ºé‚Šç•Œæ交的物件å稱(é è¨­å€¼: off)"
+msgstr "ä¸è¦é¡¯ç¤ºé‚Šç•Œæ交的物件å稱(é è¨­å€¼ï¼šoff)"
#: builtin/blame.c
msgid "do not treat root commits as boundaries (Default: off)"
-msgstr "ä¸å°‡æ ¹æ交看作邊界(é è¨­å€¼ï¼šoff)"
+msgstr "ä¸æŠŠæ ¹æ交當作邊界(é è¨­å€¼ï¼šoff)"
#: builtin/blame.c
msgid "show work cost statistics"
@@ -3130,7 +3191,7 @@ msgstr "強制顯示進度報告"
#: builtin/blame.c
msgid "show output score for blame entries"
-msgstr "顯示判斷 blame æ¢ç›®ä½ç§»çš„得分診斷訊æ¯"
+msgstr "顯示溯æºé …目的輸出得分"
#: builtin/blame.c
msgid "show original filename (Default: auto)"
@@ -3138,7 +3199,7 @@ msgstr "顯示原始檔案å稱(é è¨­å€¼ï¼šauto)"
#: builtin/blame.c
msgid "show original linenumber (Default: off)"
-msgstr "顯示原始檔案å稱(é è¨­å€¼ï¼šoff)"
+msgstr "顯示原始列碼(é è¨­å€¼ï¼šoff)"
#: builtin/blame.c
msgid "show in a format designed for machine consumption"
@@ -3146,7 +3207,7 @@ msgstr "顯示æˆé©åˆæ©Ÿå™¨è®€å–çš„æ ¼å¼"
#: builtin/blame.c
msgid "show porcelain format with per-line commit information"
-msgstr "顯示æ¯ä¸€åˆ—é©åˆæ©Ÿå™¨çš„æ交說明"
+msgstr "顯示包å«æ¯ä¸€åˆ—æ交資訊,é©åˆæ©Ÿå™¨è®€å–çš„æ ¼å¼"
#: builtin/blame.c
msgid "use the same output mode as git-annotate (Default: off)"
@@ -3174,15 +3235,15 @@ msgstr "忽略空白差異"
#: builtin/blame.c builtin/log.c
msgid "rev"
-msgstr "版本"
+msgstr "rev"
#: builtin/blame.c
msgid "ignore <rev> when blaming"
-msgstr "在執行 blame 動作時忽略 <修訂版>"
+msgstr "在執行溯æºå‹•ä½œæ™‚忽略 <rev>"
#: builtin/blame.c
msgid "ignore revisions from <file>"
-msgstr "忽略 <檔案> 中的修訂版"
+msgstr "忽略 <file> 中的修訂版"
#: builtin/blame.c
msgid "color redundant metadata from previous line differently"
@@ -3190,31 +3251,31 @@ msgstr "使用é¡è‰²é–“隔輸出與å‰ä¸€è¡Œä¸åŒçš„é‡è¤‡ä¸­ä»‹è³‡æ–™"
#: builtin/blame.c
msgid "color lines by age"
-msgstr "ä¾æ“šæ™‚間著色"
+msgstr "根據時間著色"
#: builtin/blame.c
msgid "spend extra cycles to find better match"
-msgstr "循環更多次以找到更佳符åˆ"
+msgstr "循環更多次來找到更佳符åˆé …ç›®"
#: builtin/blame.c
msgid "use revisions from <file> instead of calling git-rev-list"
-msgstr "使用來自 <檔案> 的修訂集而ä¸æ˜¯å‘¼å« git-rev-list"
+msgstr "使用來自 <file> 的修訂集而ä¸æ˜¯å‘¼å« git-rev-list"
#: builtin/blame.c
msgid "use <file>'s contents as the final image"
-msgstr "å°‡ <檔案> 的內容當æˆæ˜¯æœ€çµ‚ image"
+msgstr "å°‡ <file> 的內容當æˆæ˜¯æœ€çµ‚å°è±¡"
#: builtin/blame.c
msgid "score"
-msgstr "得分"
+msgstr "score"
#: builtin/blame.c
msgid "find line copies within and across files"
-msgstr "找到檔案內åŠè·¨æª”案的複製列"
+msgstr "找到檔案內åŠè·¨æª”案的列拷è²å‹•ä½œ"
#: builtin/blame.c
msgid "find line movements within and across files"
-msgstr "找到檔案內åŠè·¨æª”案的移動列"
+msgstr "找到檔案內åŠè·¨æª”案的列移動動作"
#: builtin/blame.c
msgid "range"
@@ -3244,106 +3305,114 @@ msgstr "4 å¹´ 11 個月å‰"
#, c-format
msgid "file %s has only %lu line"
msgid_plural "file %s has only %lu lines"
-msgstr[0] "檔案 %s åªæœ‰ %lu è¡Œ"
+msgstr[0] "檔案 %s åªæœ‰ %lu 列"
#: builtin/blame.c
msgid "Blaming lines"
-msgstr "追蹤程å¼ç¢¼è¡Œ"
+msgstr "溯æºæ–‡å­—列"
#: builtin/branch.c
msgid "git branch [<options>] [-r | -a] [--merged] [--no-merged]"
-msgstr "git branch [<é¸é …>] [-r | -a] [--merged] [--no-merged]"
+msgstr "git branch [<options>] [-r | -a] [--merged] [--no-merged]"
#: builtin/branch.c
msgid ""
"git branch [<options>] [-f] [--recurse-submodules] <branch-name> [<start-"
"point>]"
-msgstr "git branch [<é¸é …>] [-f] [--recurse-submodules] <分支å> [<起始點>]"
+msgstr ""
+"git branch [<options>] [-f] [--recurse-submodules] <branch-name> [<start-"
+"point>]"
#: builtin/branch.c
msgid "git branch [<options>] [-l] [<pattern>...]"
-msgstr "git branch [<é¸é …>] [-l] [<模å¼>...]"
+msgstr "git branch [<options>] [-l] [<pattern>...]"
#: builtin/branch.c
msgid "git branch [<options>] [-r] (-d | -D) <branch-name>..."
-msgstr "git branch [<é¸é …>] [-r] (-d | -D) <分支å>..."
+msgstr "git branch [<options>] [-r] (-d | -D) <branch-name>..."
#: builtin/branch.c
msgid "git branch [<options>] (-m | -M) [<old-branch>] <new-branch>"
-msgstr "git branch [<é¸é …>] (-m | -M) [<舊分支>] <新分支>"
+msgstr "git branch [<options>] (-m | -M) [<old-branch>] <new-branch>"
#: builtin/branch.c
msgid "git branch [<options>] (-c | -C) [<old-branch>] <new-branch>"
-msgstr "git branch [<é¸é …>] (-c | -C) [<è€åˆ†æ”¯>] <新分支>"
+msgstr "git branch [<options>] (-c | -C) [<old-branch>] <new-branch>"
#: builtin/branch.c
msgid "git branch [<options>] [-r | -a] [--points-at]"
-msgstr "git branch [<é¸é …>] [-r | -a] [--points-at]"
+msgstr "git branch [<options>] [-r | -a] [--points-at]"
#: builtin/branch.c
msgid "git branch [<options>] [-r | -a] [--format]"
-msgstr "git branch [<é¸é …>] [-r | -a] [--format]"
+msgstr "git branch [<options>] [-r | -a] [--format]"
# 譯者:ä¿æŒåŽŸæ›è¡Œæ ¼å¼ï¼Œåœ¨è¼¸å‡ºæ™‚ %s 的替代內容會讓字串變長
#: builtin/branch.c
#, c-format
msgid ""
"deleting branch '%s' that has been merged to\n"
-" '%s', but not yet merged to HEAD."
+" '%s', but not yet merged to HEAD"
msgstr ""
-"å°‡è¦åˆªé™¤çš„分支 '%s' 已經被åˆä½µåˆ°\n"
-" '%s',但未åˆä½µåˆ° HEAD。"
+"å°‡è¦åˆªé™¤çš„ “%s†分支已經被åˆä½µåˆ°\n"
+" “%sâ€ï¼Œä½†å°šæœªåˆä½µåˆ° HEAD"
# 譯者:ä¿æŒåŽŸæ›è¡Œæ ¼å¼ï¼Œåœ¨è¼¸å‡ºæ™‚ %s 的替代內容會讓字串變長
#: builtin/branch.c
#, c-format
msgid ""
"not deleting branch '%s' that is not yet merged to\n"
-" '%s', even though it is merged to HEAD."
+" '%s', even though it is merged to HEAD"
msgstr ""
-"並未刪除分支 '%s', 雖然它已經åˆä½µåˆ° HEAD,\n"
-" 然而å»å°šæœªè¢«åˆä½µåˆ°åˆ†æ”¯ '%s' 。"
+"並未刪除分支 “%sâ€ï¼Œ 雖然已經åˆä½µåˆ° HEAD,\n"
+" å»å°šæœªè¢«åˆä½µè‡³ “%s†分支"
#: builtin/branch.c
#, c-format
-msgid "Couldn't look up commit object for '%s'"
-msgstr "無法查詢 '%s' 指å‘çš„æ交物件"
+msgid "couldn't look up commit object for '%s'"
+msgstr "無法查詢 “%s†指å‘çš„æ交物件"
#: builtin/branch.c
#, c-format
-msgid ""
-"The branch '%s' is not fully merged.\n"
-"If you are sure you want to delete it, run 'git branch -D %s'."
-msgstr ""
-"分支 '%s' 沒有完全åˆä½µã€‚\n"
-"如果您確èªè¦åˆªé™¤å®ƒï¼ŒåŸ·è¡Œ 'git branch -D %s'。"
+msgid "the branch '%s' is not fully merged"
+msgstr "分支 “%s†沒有完全åˆä½µ"
+
+#: builtin/branch.c
+#, c-format
+msgid "If you are sure you want to delete it, run 'git branch -D %s'"
+msgstr "如果確定è¦åˆªé™¤å®ƒï¼Œè«‹åŸ·è¡Œ “git branch -D %sâ€"
#: builtin/branch.c
-msgid "Update of config-file failed"
-msgstr "更新設定檔案失敗"
+msgid "update of config-file failed"
+msgstr "更新組態檔案失敗"
#: builtin/branch.c
msgid "cannot use -a with -d"
msgstr "ä¸èƒ½å°‡ -a å’Œ -d åŒæ™‚使用"
#: builtin/branch.c
-msgid "Couldn't look up commit object for HEAD"
-msgstr "無法查詢 HEAD 指å‘çš„æ交物件"
+#, c-format
+msgid "cannot delete branch '%s' used by worktree at '%s'"
+msgstr "無法刪除被ä½æ–¼ “%2$s†的工作å€ä½¿ç”¨çš„ “%1$s†分支"
#: builtin/branch.c
#, c-format
-msgid "Cannot delete branch '%s' checked out at '%s'"
-msgstr "無法刪除在「%2$sã€ç°½å‡ºçš„「%1$sã€åˆ†æ”¯"
+msgid "remote-tracking branch '%s' not found"
+msgstr "找ä¸åˆ° “%s†é ç«¯è¿½è¹¤åˆ†æ”¯"
#: builtin/branch.c
#, c-format
-msgid "remote-tracking branch '%s' not found."
-msgstr "未能找到é ç«¯è¿½è¹¤åˆ†æ”¯ '%s'。"
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"找ä¸åˆ° “%s†分支。\n"
+"您å¯èƒ½è¦åŠ ä¸Š --remote?"
#: builtin/branch.c
#, c-format
-msgid "branch '%s' not found."
-msgstr "分支 '%s' 未發ç¾ã€‚"
+msgid "branch '%s' not found"
+msgstr "找ä¸åˆ° “%s†分支"
#: builtin/branch.c
#, c-format
@@ -3357,70 +3426,77 @@ msgstr "已刪除分支 %s(曾為 %s)。\n"
#: builtin/branch.c builtin/tag.c
msgid "unable to parse format string"
-msgstr "ä¸èƒ½è§£æžæ ¼å¼åŒ–字串"
+msgstr "無法解æžæ ¼å¼åŒ–字串"
#: builtin/branch.c
msgid "could not resolve HEAD"
-msgstr "ä¸èƒ½è§£æž HEAD æ交"
+msgstr "ç„¡æ³•è§£æž HEAD 指é‡"
#: builtin/branch.c
#, c-format
msgid "HEAD (%s) points outside of refs/heads/"
-msgstr "HEAD (%s) æŒ‡å‘ refs/heads/ 之外"
+msgstr "HEAD æŒ‡é‡ (%s) æŒ‡å‘ refs/heads/ 之外"
#: builtin/branch.c
#, c-format
-msgid "Branch %s is being rebased at %s"
-msgstr "分支 %s 正被é‡å®šåŸºåº•åˆ° %s"
+msgid "branch %s is being rebased at %s"
+msgstr "%s 分支正在é‡å®šåŸºåº•è‡³ %s"
#: builtin/branch.c
#, c-format
-msgid "Branch %s is being bisected at %s"
-msgstr "分支 %s 正被二分æœå°‹æ–¼ %s"
+msgid "branch %s is being bisected at %s"
+msgstr "%s 分支正於 %s 進行二分æœå°‹"
#: builtin/branch.c
-msgid "cannot copy the current branch while not on any."
-msgstr "無法複製目å‰åˆ†æ”¯å› ç‚ºä¸è™•æ–¼ä»»ä½•åˆ†æ”¯ä¸Šã€‚"
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "%s 工作å€çš„ HEAD 指é‡æœªè¢«æ›´æ–°"
#: builtin/branch.c
-msgid "cannot rename the current branch while not on any."
-msgstr "無法é‡æ–°å‘½åç›®å‰åˆ†æ”¯å› ç‚ºä¸è™•æ–¼ä»»ä½•åˆ†æ”¯ä¸Šã€‚"
+#, c-format
+msgid "invalid branch name: '%s'"
+msgstr "分支å稱無效:“%sâ€"
+
+#: builtin/branch.c
+#, c-format
+msgid "no commit on branch '%s' yet"
+msgstr "分支 “%s†尚無æ交"
#: builtin/branch.c
#, c-format
-msgid "Invalid branch name: '%s'"
-msgstr "無效的分支å:'%s'"
+msgid "no branch named '%s'"
+msgstr "沒有å為 “%s†的分支"
#: builtin/branch.c
-msgid "Branch rename failed"
+msgid "branch rename failed"
msgstr "分支é‡æ–°å‘½å失敗"
#: builtin/branch.c
-msgid "Branch copy failed"
-msgstr "分支複製失敗"
+msgid "branch copy failed"
+msgstr "分支拷è²å¤±æ•—"
#: builtin/branch.c
#, c-format
-msgid "Created a copy of a misnamed branch '%s'"
-msgstr "已為錯誤命å的分支 '%s' 建立了一個副本"
+msgid "created a copy of a misnamed branch '%s'"
+msgstr "已為誤命åçš„ “%s†分支建立拷è²"
#: builtin/branch.c
#, c-format
-msgid "Renamed a misnamed branch '%s' away"
-msgstr "已將錯誤命å的分支 '%s' é‡æ–°å‘½å"
+msgid "renamed a misnamed branch '%s' away"
+msgstr "已更改誤命åçš„ “%s†分支的å稱"
#: builtin/branch.c
#, c-format
-msgid "Branch renamed to %s, but HEAD is not updated!"
-msgstr "分支é‡æ–°å‘½å為 %s,但 HEAD 沒有更新ï¼"
+msgid "branch renamed to %s, but HEAD is not updated"
+msgstr "分支已é‡æ–°å‘½å為 %s,但 HEAD 指é‡å°šæœªæ›´æ–°"
#: builtin/branch.c
-msgid "Branch is renamed, but update of config-file failed"
-msgstr "分支被é‡æ–°å‘½å,但更新設定檔案失敗"
+msgid "branch is renamed, but update of config-file failed"
+msgstr "分支已é‡æ–°å‘½å,但無法更新組態檔案"
#: builtin/branch.c
-msgid "Branch is copied, but update of config-file failed"
-msgstr "分支已複製,但更新設定檔案失敗"
+msgid "branch is copied, but update of config-file failed"
+msgstr "分支已拷è²ï¼Œä½†ç„¡æ³•æ›´æ–°çµ„態檔案"
#: builtin/branch.c
#, c-format
@@ -3429,41 +3505,41 @@ msgid ""
" %s\n"
"Lines starting with '%c' will be stripped.\n"
msgstr ""
-"請編輯分支的æè¿°\n"
+"請編輯下述分支的æè¿°\n"
" %s\n"
-"以 '%c' 開頭的行將被éŽæ¿¾ã€‚\n"
+"開頭是 “%c†的列將被刪除。\n"
#: builtin/branch.c
msgid "Generic options"
-msgstr "通用é¸é …"
+msgstr "一般性é¸é …"
#: builtin/branch.c
msgid "show hash and subject, give twice for upstream branch"
-msgstr "顯示雜湊值和主題,若åƒæ•¸å‡ºç¾å…©æ¬¡å‰‡é¡¯ç¤ºä¸Šæ¸¸åˆ†æ”¯"
+msgstr "顯示雜湊值和主旨,若傳入兩次則顯示上游分支"
#: builtin/branch.c
msgid "suppress informational messages"
-msgstr "ä¸é¡¯ç¤ºè¨Šæ¯"
+msgstr "ä¸é¡¯ç¤ºè³‡è¨Šè¨Šæ¯"
#: builtin/branch.c builtin/checkout.c builtin/submodule--helper.c
msgid "set branch tracking configuration"
-msgstr "設定分支追蹤設定"
+msgstr "設定分支追蹤組態"
#: builtin/branch.c
msgid "do not use"
-msgstr "ä¸è¦ä½¿ç”¨"
+msgstr "請勿使用"
#: builtin/branch.c
msgid "upstream"
-msgstr "上游"
+msgstr "upstream"
#: builtin/branch.c
msgid "change the upstream info"
-msgstr "改變上游訊æ¯"
+msgstr "變更上游資訊"
#: builtin/branch.c
msgid "unset the upstream info"
-msgstr "å–消上游資訊設定"
+msgstr "å–消設定上游資訊"
#: builtin/branch.c
msgid "use colored output"
@@ -3475,19 +3551,19 @@ msgstr "作用於é ç«¯è¿½è¹¤åˆ†æ”¯"
#: builtin/branch.c
msgid "print only branches that contain the commit"
-msgstr "åªåˆ—å°åŒ…å«è©²æ交的分支"
+msgstr "åªè¼¸å‡ºåŒ…å«æ­¤æ交的分支"
#: builtin/branch.c
msgid "print only branches that don't contain the commit"
-msgstr "åªåˆ—å°ä¸åŒ…å«è©²æ交的分支"
+msgstr "åªè¼¸å‡ºä¸åŒ…å«æ­¤æ交的分支"
#: builtin/branch.c
msgid "Specific git-branch actions:"
-msgstr "具體的 git-branch 動作:"
+msgstr "特定的 git-branch 動作:"
#: builtin/branch.c
msgid "list both remote-tracking and local branches"
-msgstr "列出é ç«¯è¿½è¹¤åŠæœ¬æ©Ÿåˆ†æ”¯"
+msgstr "列出é ç«¯è¿½è¹¤å’Œæœ¬æ©Ÿåˆ†æ”¯"
#: builtin/branch.c
msgid "delete fully merged branch"
@@ -3495,31 +3571,35 @@ msgstr "刪除完全åˆä½µçš„分支"
#: builtin/branch.c
msgid "delete branch (even if not merged)"
-msgstr "刪除分支(å³ä½¿æ²’有åˆä½µï¼‰"
+msgstr "刪除分支(å³ä½¿å°šæœªåˆä½µï¼‰"
#: builtin/branch.c
msgid "move/rename a branch and its reflog"
-msgstr "移動/é‡æ–°å‘½å一個分支,以åŠå®ƒçš„引用日誌"
+msgstr "移動或é‡æ–°å‘½å分支åŠå…¶å¼•ç”¨æ—¥èªŒ"
#: builtin/branch.c
msgid "move/rename a branch, even if target exists"
-msgstr "移動/é‡æ–°å‘½å一個分支,å³ä½¿ç›®æ¨™å·²å­˜åœ¨"
+msgstr "å³ä½¿ç›®æ¨™å·²å­˜åœ¨ï¼Œä»ç§»å‹•æˆ–é‡æ–°å‘½å分支"
+
+#: builtin/branch.c builtin/for-each-ref.c builtin/tag.c
+msgid "do not output a newline after empty formatted refs"
+msgstr "在格å¼åŒ–引用çµæžœç‚ºç©ºä¹‹å¾Œï¼Œä¸è¦è¼¸å‡ºæ›åˆ—符號"
#: builtin/branch.c
msgid "copy a branch and its reflog"
-msgstr "複製分支åŠå…¶å¼•ç”¨æ—¥èªŒ"
+msgstr "æ‹·è²åˆ†æ”¯åŠå…¶å¼•ç”¨æ—¥èªŒ"
#: builtin/branch.c
msgid "copy a branch, even if target exists"
-msgstr "複製一個分支,å³ä½¿ç›®æ¨™å·²å­˜åœ¨"
+msgstr "å³ä½¿ç›®æ¨™å·²å­˜åœ¨ä»æ‹·è²åˆ†æ”¯"
#: builtin/branch.c
msgid "list branch names"
-msgstr "列出分支å"
+msgstr "列出分支å稱"
#: builtin/branch.c
msgid "show current branch name"
-msgstr "顯示目å‰åˆ†æ”¯å"
+msgstr "顯示目å‰åˆ†æ”¯å稱"
#: builtin/branch.c builtin/submodule--helper.c
msgid "create the branch's reflog"
@@ -3527,7 +3607,7 @@ msgstr "建立分支的引用日誌"
#: builtin/branch.c
msgid "edit the description for the branch"
-msgstr "標記分支的æè¿°"
+msgstr "編輯分支的æè¿°"
#: builtin/branch.c
msgid "force creation, move/rename, deletion"
@@ -3535,51 +3615,51 @@ msgstr "強制建立ã€ç§»å‹•/é‡æ–°å‘½åã€åˆªé™¤"
#: builtin/branch.c
msgid "print only branches that are merged"
-msgstr "åªåˆ—å°å·²ç¶“åˆä½µçš„分支"
+msgstr "åªè¼¸å‡ºå·²ç¶“åˆä½µçš„分支"
#: builtin/branch.c
msgid "print only branches that are not merged"
-msgstr "åªåˆ—å°å°šæœªåˆä½µçš„分支"
+msgstr "åªè¼¸å‡ºå°šæœªåˆä½µçš„分支"
#: builtin/branch.c
msgid "list branches in columns"
-msgstr "以列的方å¼é¡¯ç¤ºåˆ†æ”¯"
+msgstr "以行的形å¼åˆ—出分支"
#: builtin/branch.c builtin/for-each-ref.c builtin/notes.c builtin/tag.c
msgid "object"
-msgstr "物件"
+msgstr "object"
#: builtin/branch.c
msgid "print only branches of the object"
-msgstr "åªåˆ—å°æŒ‡å‘該物件的分支"
+msgstr "åªè¼¸å‡ºæŒ‡å‘此物件的分支"
#: builtin/branch.c builtin/for-each-ref.c builtin/tag.c
msgid "sorting and filtering are case insensitive"
-msgstr "排åºå’ŒéŽæ¿¾å±¬æ–¼å¤§å°å¯«ä¸æ•æ„Ÿ"
+msgstr "排åºå’ŒéŽæ¿¾ä¸å€åˆ†å¤§å°å¯«"
#: builtin/branch.c builtin/ls-files.c
msgid "recurse through submodules"
msgstr "在å­æ¨¡çµ„中éžè¿´"
-#: builtin/branch.c builtin/for-each-ref.c builtin/ls-tree.c builtin/tag.c
-#: builtin/verify-tag.c
+#: builtin/branch.c builtin/for-each-ref.c builtin/ls-files.c builtin/ls-tree.c
+#: builtin/tag.c builtin/verify-tag.c
msgid "format to use for the output"
msgstr "輸出格å¼"
-#: builtin/branch.c builtin/submodule--helper.c submodule.c
-msgid "Failed to resolve HEAD as a valid ref."
-msgstr "無法將 HEAD 解æžç‚ºæœ‰æ•ˆå¼•ç”¨ã€‚"
+#: builtin/branch.c
+msgid "failed to resolve HEAD as a valid ref"
+msgstr "無法將 HEAD 解æžç‚ºæœ‰æ•ˆå¼•ç”¨"
#: builtin/branch.c builtin/clone.c
msgid "HEAD not found below refs/heads!"
-msgstr "HEAD 沒有ä½æ–¼ /refs/heads 之下ï¼"
+msgstr "HEAD 指é‡ä¸åœ¨ /refs/heads 中ï¼"
#: builtin/branch.c
msgid ""
"branch with --recurse-submodules can only be used if submodule."
"propagateBranches is enabled"
msgstr ""
-"有 --recurse-submodules 的分支åªèƒ½åœ¨å•Ÿç”¨ submodule.propagateBranches 時使用"
+"有 --recurse-submodules 的分支,åªèƒ½åœ¨å•Ÿç”¨ submodule.propagateBranches 時使用"
#: builtin/branch.c
msgid "--recurse-submodules can only be used to create branches"
@@ -3587,81 +3667,78 @@ msgstr "--recurse-submodules åªèƒ½ç”¨ä¾†å»ºç«‹åˆ†æ”¯"
#: builtin/branch.c
msgid "branch name required"
-msgstr "å¿…é ˆæ供分支å"
+msgstr "å¿…é ˆæ供分支å稱"
#: builtin/branch.c
-msgid "Cannot give description to detached HEAD"
-msgstr "ä¸èƒ½å‘分離開頭指標æä¾›æè¿°"
+msgid "cannot give description to detached HEAD"
+msgstr "無法å‘分離 HEAD 指é‡æä¾›æè¿°"
#: builtin/branch.c
msgid "cannot edit description of more than one branch"
-msgstr "ä¸èƒ½ç‚ºä¸€å€‹ä»¥ä¸Šçš„分支編輯æè¿°"
+msgstr "無法編輯超éŽä¸€å€‹åˆ†æ”¯çš„æè¿°"
#: builtin/branch.c
-#, c-format
-msgid "No commit on branch '%s' yet."
-msgstr "分支 '%s' å°šç„¡æ交。"
+msgid "cannot copy the current branch while not on any"
+msgstr "ä¸åœ¨ä»»ä½•åˆ†æ”¯ä¸Šï¼Œç„¡æ³•æ‹·è²ç›®å‰åˆ†æ”¯"
#: builtin/branch.c
-#, c-format
-msgid "No branch named '%s'."
-msgstr "沒有分支 '%s'。"
+msgid "cannot rename the current branch while not on any"
+msgstr "ä¸åœ¨ä»»ä½•åˆ†æ”¯ä¸Šï¼Œç„¡æ³•é‡æ–°å‘½åç›®å‰åˆ†æ”¯"
#: builtin/branch.c
msgid "too many branches for a copy operation"
-msgstr "為複製動作æ供了太多的分支å"
+msgstr "è¦é€²è¡Œæ‹·è²å‹•ä½œçš„分支太多"
#: builtin/branch.c
msgid "too many arguments for a rename operation"
-msgstr "為é‡æ–°å‘½å動作æ供了太多的åƒæ•¸"
+msgstr "傳入é‡æ–°å‘½å動作的引數太多"
#: builtin/branch.c
msgid "too many arguments to set new upstream"
-msgstr "為設定新上游æ供了太多的åƒæ•¸"
+msgstr "è¦è¨­å®šæ–°ä¸Šæ¸¸çš„引數太多"
#: builtin/branch.c
#, c-format
msgid ""
-"could not set upstream of HEAD to %s when it does not point to any branch."
-msgstr "無法設定 HEAD 的上游為 %s,因為 HEAD 沒有指å‘任何分支。"
+"could not set upstream of HEAD to %s when it does not point to any branch"
+msgstr "無法將 HEAD 的上游設為 %s:其未指å‘任何分支"
#: builtin/branch.c
#, c-format
msgid "no such branch '%s'"
-msgstr "沒有此分支 '%s'"
+msgstr "無 “%s†分支"
#: builtin/branch.c
#, c-format
msgid "branch '%s' does not exist"
-msgstr "分支 '%s' ä¸å­˜åœ¨"
+msgstr "沒有 “%s†分支"
#: builtin/branch.c
msgid "too many arguments to unset upstream"
-msgstr "為å–消上游設定動作æ供了太多的åƒæ•¸"
+msgstr "è¦å–消設定上游的引數太多"
#: builtin/branch.c
-msgid "could not unset upstream of HEAD when it does not point to any branch."
-msgstr "在 HEAD 的上游未指å‘任何分支時無法å–消設定。"
+msgid "could not unset upstream of HEAD when it does not point to any branch"
+msgstr "無法å–消設定 HEAD 的上游:其未指å‘任何分支"
#: builtin/branch.c
#, c-format
-msgid "Branch '%s' has no upstream information"
-msgstr "分支 '%s' 沒有上游訊æ¯"
+msgid "branch '%s' has no upstream information"
+msgstr "分支 “%s†沒有上游資訊"
#: builtin/branch.c
msgid ""
-"The -a, and -r, options to 'git branch' do not take a branch name.\n"
+"the -a, and -r, options to 'git branch' do not take a branch name.\n"
"Did you mean to use: -a|-r --list <pattern>?"
msgstr ""
-"'git branch' çš„ -a å’Œ -r é¸é …ä¸å¸¶ä¸€å€‹åˆ†æ”¯å。\n"
-"您是å¦æƒ³è¦ä½¿ç”¨ï¼š-a|-r --list <模å¼>?"
+"“git branch†的 -a å’Œ -r é¸é …ä¸å–分支å稱。\n"
+"您是想使用:-a|-r --list <pattern> 嗎?"
#: builtin/branch.c
msgid ""
"the '--set-upstream' option is no longer supported. Please use '--track' or "
-"'--set-upstream-to' instead."
-msgstr ""
-"ä¸å†æ”¯æ´é¸é … '--set-upstream'。請使用 '--track' 或 '--set-upstream-to'。"
+"'--set-upstream-to' instead"
+msgstr "ä¸å†æ”¯æ´é¸é … “--set-upstreamâ€ã€‚請改用 “--track†或 “--set-upstream-toâ€"
#: builtin/bugreport.c
msgid "git version:\n"
@@ -3670,7 +3747,7 @@ msgstr "git 版本:\n"
#: builtin/bugreport.c
#, c-format
msgid "uname() failed with error '%s' (%d)\n"
-msgstr "uname() 失敗,錯誤:「%sã€(%d)\n"
+msgstr "uname() 失敗,錯誤:“%s†(%d)\n"
#: builtin/bugreport.c
msgid "compiler info: "
@@ -3682,11 +3759,15 @@ msgstr "libc 資訊: "
#: builtin/bugreport.c
msgid "not run from a git repository - no hooks to show\n"
-msgstr "ä¸æ˜¯å¾ž git 版本庫執行 - 沒有å¯é¡¯ç¤ºçš„掛鉤\n"
+msgstr "ä¸æ˜¯åœ¨ git 版本庫執行 — 沒有å¯é¡¯ç¤ºçš„掛鉤\n"
#: builtin/bugreport.c
-msgid "git bugreport [-o|--output-directory <file>] [-s|--suffix <format>]"
-msgstr "git bugreport [-o|--output-directory <檔案>] [-s|--suffix <æ ¼å¼>]"
+msgid ""
+"git bugreport [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--diagnose[=<mode>]]"
+msgstr ""
+"git bugreport [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--diagnose[=<mode>]]"
#: builtin/bugreport.c
msgid ""
@@ -3707,33 +3788,53 @@ msgid ""
"You can delete any lines you don't wish to share.\n"
msgstr ""
"æ„Ÿè¬æ‚¨å¡«å¯« Git 臭蟲報告ï¼\n"
-"請回答下列å•é¡Œï¼Œä»¥è®“我們能夠了解您的å•é¡Œã€‚\n"
+"請回答下列詢å•ï¼Œå”助我們了解您的å•é¡Œã€‚\n"
"\n"
"臭蟲發生å‰ï¼Œæ‚¨åšäº†ä»€éº¼ï¼Ÿï¼ˆé‡ç¾å•é¡Œçš„步驟)\n"
"\n"
-"你原本期望發生什麼?(期望行為)\n"
+"原本您é æœŸç™¼ç”Ÿä»€éº¼ï¼Ÿï¼ˆé æœŸè¡Œç‚ºï¼‰\n"
"\n"
"那實際上發生了什麼?(實際行為)\n"
"\n"
-"期望行為跟實際發生的行為有什麼ä¸åŒï¼Ÿ\n"
+"é æœŸç™¼ç”Ÿçš„行為,跟實際發生的行為有什麼ä¸åŒï¼Ÿ\n"
"\n"
"其他您想加入的:\n"
"\n"
"請檢閱臭蟲報告下方的剩餘部分。\n"
"您å¯åˆªé™¤ä»»ä½•æ‚¨ä¸æƒ³åˆ†äº«çš„地方。\n"
+#: builtin/bugreport.c builtin/commit.c builtin/fast-export.c builtin/rebase.c
+#: parse-options.h
+msgid "mode"
+msgstr "mode"
+
#: builtin/bugreport.c
-msgid "specify a destination for the bugreport file"
-msgstr "請指定 bugreport 檔案的目的地"
+msgid ""
+"create an additional zip archive of detailed diagnostics (default 'stats')"
+msgstr "å¦å¤–建立有詳細診斷資訊的 ZIP å°å­˜æª”(é è¨­å€¼ “statsâ€ï¼‰"
#: builtin/bugreport.c
-msgid "specify a strftime format suffix for the filename"
-msgstr "請指定檔案å稱的 strftime æ ¼å¼å¾Œç¶´"
+msgid "specify a destination for the bugreport file(s)"
+msgstr "指定臭蟲報告檔案的目的地"
+
+#: builtin/bugreport.c
+msgid "specify a strftime format suffix for the filename(s)"
+msgstr "指定用於檔åçš„ strftime æ ¼å¼å¾Œç¶´"
#: builtin/bugreport.c
#, c-format
+msgid "unknown argument `%s'"
+msgstr "未知引數 “%sâ€"
+
+#: builtin/bugreport.c builtin/diagnose.c
+#, c-format
msgid "could not create leading directories for '%s'"
-msgstr "無法建立 '%s' çš„å‰ç½®ç›®éŒ„"
+msgstr "無法建立 “%s†的å‰ç½®ç›®éŒ„"
+
+#: builtin/bugreport.c builtin/diagnose.c
+#, c-format
+msgid "unable to create diagnostics archive %s"
+msgstr "無法建立 %s 診斷å°å­˜æª”"
#: builtin/bugreport.c
msgid "System Info"
@@ -3751,51 +3852,59 @@ msgstr "無法寫入 %s"
#: builtin/bugreport.c
#, c-format
msgid "Created new report at '%s'.\n"
-msgstr "已在「%sã€å»ºç«‹æ–°å ±å‘Šã€‚\n"
+msgstr "已在 “%s†建立新報告。\n"
#: builtin/bundle.c
-msgid "git bundle create [<options>] <file> <git-rev-list args>"
-msgstr "git bundle create [<é¸é …>] <檔案> <git-rev-list åƒæ•¸>"
+msgid ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<version>] <file> <git-rev-list-args>"
+msgstr ""
+"git bundle create [-q | --quiet | --progress]\n"
+" [--version=<version>] <file> <git-rev-list-args>"
#: builtin/bundle.c
-msgid "git bundle verify [<options>] <file>"
-msgstr "git bundle verify [<é¸é …>] <檔案>"
+msgid "git bundle verify [-q | --quiet] <file>"
+msgstr "git bundle verify [-q | --quiet] <file>"
#: builtin/bundle.c
msgid "git bundle list-heads <file> [<refname>...]"
-msgstr "git bundle list-heads <檔案> [<引用å稱>...]"
+msgstr "git bundle list-heads <file> [<refname>...]"
#: builtin/bundle.c
-msgid "git bundle unbundle <file> [<refname>...]"
-msgstr "git bundle unbundle <檔案> [<引用å稱>...]"
+msgid "git bundle unbundle [--progress] <file> [<refname>...]"
+msgstr "git bundle unbundle [--progress] <file> [<refname>...]"
+
+#: builtin/bundle.c
+msgid "need a <file> argument"
+msgstr "需è¦æä¾› <file> 引數"
#: builtin/bundle.c builtin/pack-objects.c
msgid "do not show progress meter"
-msgstr "ä¸é¡¯ç¤ºé€²åº¦è¡¨"
+msgstr "ä¸é¡¯ç¤ºé€²åº¦åˆ—"
#: builtin/bundle.c builtin/pack-objects.c
msgid "show progress meter"
-msgstr "顯示進度表"
+msgstr "顯示進度列"
-#: builtin/bundle.c builtin/pack-objects.c
-msgid "show progress meter during object writing phase"
-msgstr "在物件寫入階段顯示進度表"
+#: builtin/bundle.c
+msgid "historical; same as --progress"
+msgstr "æ­·å²éºç•™é¸é …;和 --progress 相åŒ"
-#: builtin/bundle.c builtin/pack-objects.c
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "當進度表顯示時類似於 --all-progress"
+#: builtin/bundle.c
+msgid "historical; does nothing"
+msgstr "æ­·å²éºç•™é¸é …;沒有作用"
#: builtin/bundle.c
msgid "specify bundle format version"
-msgstr "指定套件的格å¼ç‰ˆæœ¬"
+msgstr "指定套件包的格å¼ç‰ˆæœ¬"
#: builtin/bundle.c
msgid "Need a repository to create a bundle."
-msgstr "需è¦ç‰ˆæœ¬åº«ä¾†å»ºç«‹å¥—件。"
+msgstr "需è¦ç‰ˆæœ¬åº«ä¾†å»ºç«‹å¥—件包。"
#: builtin/bundle.c
msgid "do not show bundle details"
-msgstr "ä¸é¡¯ç¤ºå¥—件詳細資訊"
+msgstr "ä¸é¡¯ç¤ºå¥—件包的詳細資訊"
#: builtin/bundle.c
#, c-format
@@ -3804,21 +3913,16 @@ msgstr "%s å¯ä»¥\n"
#: builtin/bundle.c
msgid "Need a repository to unbundle."
-msgstr "需è¦ç‰ˆæœ¬åº«æ‰èƒ½æ‹†åˆ†å¥—件。"
+msgstr "需è¦ç‰ˆæœ¬åº«æ‰èƒ½æ‹†åˆ†å¥—件包。"
#: builtin/bundle.c
msgid "Unbundling objects"
-msgstr "正在解包物件"
-
-#: builtin/bundle.c builtin/remote.c
-#, c-format
-msgid "Unknown subcommand: %s"
-msgstr "未知å­æŒ‡ä»¤ï¼š%s"
+msgstr "正在拆分物件"
#: builtin/cat-file.c merge-recursive.c
#, c-format
msgid "cannot read object %s '%s'"
-msgstr "ä¸èƒ½è®€å–物件 %s '%s'"
+msgstr "無法讀å–物件 %s “%sâ€"
#: builtin/cat-file.c
msgid "flush is only for --buffer mode"
@@ -3831,7 +3935,7 @@ msgstr "輸入中沒有命令"
#: builtin/cat-file.c
#, c-format
msgid "whitespace before command: '%s'"
-msgstr "命令å‰ç©ºæ ¼ï¼šã€Œ%sã€"
+msgstr "命令å‰æœ‰ç©ºæ ¼ï¼šâ€œ%sâ€"
#: builtin/cat-file.c
#, c-format
@@ -3844,11 +3948,6 @@ msgid "%s takes no arguments"
msgstr "%s ä¸å–引數"
#: builtin/cat-file.c
-#, c-format
-msgid "unknown command: '%s'"
-msgstr "未知命令:「%sã€"
-
-#: builtin/cat-file.c
msgid "only one batch option may be specified"
msgstr "åªèƒ½æŒ‡å®šä¸€å€‹æ‰¹æ¬¡è™•ç†é¸é …"
@@ -3866,23 +3965,23 @@ msgstr "git cat-file (-t | -s) [--allow-unknown-type] <object>"
#: builtin/cat-file.c
msgid ""
+"git cat-file (--textconv | --filters)\n"
+" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
+msgstr ""
+"git cat-file (--textconv | --filters)\n"
+" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
+
+#: builtin/cat-file.c
+msgid ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
+" [--textconv | --filters] [-Z]"
msgstr ""
"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
"objects]\n"
" [--buffer] [--follow-symlinks] [--unordered]\n"
-" [--textconv | --filters]"
-
-#: builtin/cat-file.c
-msgid ""
-"git cat-file (--textconv | --filters)\n"
-" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
-msgstr ""
-"git cat-file (--textconv | --filters)\n"
-" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
+" [--textconv | --filters] [-Z]"
#: builtin/cat-file.c
msgid "Check object existence or emit object contents"
@@ -3898,7 +3997,7 @@ msgstr "美化輸出 <object> 的內容"
#: builtin/cat-file.c
msgid "Emit [broken] object attributes"
-msgstr "輸出 [æ壞的] 物件屬性"
+msgstr "輸出 [æ壞的] ([broken]) 物件屬性"
#: builtin/cat-file.c
msgid "show object type (one of 'blob', 'tree', 'commit', 'tag', ...)"
@@ -3912,6 +4011,10 @@ msgstr "顯示物件大å°"
msgid "allow -s and -t to work with broken/corrupt objects"
msgstr "å…許 -s å’Œ -t å°æ壞的物件生效"
+#: builtin/cat-file.c builtin/log.c
+msgid "use mail map file"
+msgstr "使用信件映射檔案"
+
#: builtin/cat-file.c
msgid "Batch objects requested on stdin (or --batch-all-objects)"
msgstr "æ‰¹æ¬¡è™•ç† stdin 上請求的物件(或 --batch-all-objects)"
@@ -3925,12 +4028,20 @@ msgid "like --batch, but don't emit <contents>"
msgstr "é¡žä¼¼ --batch 但ä¸è¼¸å‡º <contents>"
#: builtin/cat-file.c
+msgid "stdin is NUL-terminated"
+msgstr "stdin 以 NUL 字元終止"
+
+#: builtin/cat-file.c
+msgid "stdin and stdout is NUL-terminated"
+msgstr "stdin 和 stdout 以 NUL 字元終止"
+
+#: builtin/cat-file.c
msgid "read commands from stdin"
-msgstr "從標準輸入讀å–命令"
+msgstr "從 stdin 讀å–命令"
#: builtin/cat-file.c
msgid "with --batch[-check]: ignores stdin, batches all known objects"
-msgstr "傳入 --batch[-check]:忽略標準輸入,批次處ç†æ‰€æœ‰å·²çŸ¥ç‰©ä»¶"
+msgstr "傳入 --batch[-check]:忽略 stdin,批次處ç†æ‰€æœ‰å·²çŸ¥ç‰©ä»¶"
#: builtin/cat-file.c
msgid "Change or optimize batch output"
@@ -3942,21 +4053,21 @@ msgstr "ç·©è¡ --batch 的輸出"
#: builtin/cat-file.c
msgid "follow in-tree symlinks"
-msgstr "追蹤樹中的符號連çµ"
+msgstr "追蹤樹狀物件中的符號連çµ"
#: builtin/cat-file.c
msgid "do not order objects before emitting them"
-msgstr "ä¸è¦åœ¨è¼¸å‡ºç‰©ä»¶å‰æŽ’åº"
+msgstr "ä¸è¦åœ¨è¼¸å‡ºå‰æŽ’åºç‰©ä»¶"
#: builtin/cat-file.c
msgid ""
"Emit object (blob or tree) with conversion or filter (stand-alone, or with "
"batch)"
-msgstr "轉æ›æˆ–éŽæ¿¾å¾Œè¼¸å‡ºç‰©ä»¶ï¼ˆblob 或樹)(單ç¨æˆ–批次處ç†ï¼‰"
+msgstr "轉æ›æˆ–éŽæ¿¾å¾Œè¼¸å‡ºç‰©ä»¶ (blob 或 tree)(單ç¨æˆ–批次處ç†ï¼‰"
#: builtin/cat-file.c
msgid "run textconv on object's content"
-msgstr "在物件內容執行 textconv"
+msgstr "å°ç‰©ä»¶å…§å®¹é€²è¡Œæ–‡å­—è½‰æ› (textconv)"
#: builtin/cat-file.c
msgid "run filters on object's content"
@@ -3973,7 +4084,7 @@ msgstr "請在 (--textconv | --filters) 使用 <path>ï¼Œè€Œéž â€œbatchâ€"
#: builtin/cat-file.c
#, c-format
msgid "'%s=<%s>' needs '%s' or '%s'"
-msgstr "「%s=<%s>ã€éœ€è¦ã€Œ%sã€æˆ–「%sã€"
+msgstr "“%s=<%s>â€ éœ€è¦ â€œ%s†或 “%sâ€"
#: builtin/cat-file.c
msgid "path|tree-ish"
@@ -3982,12 +4093,12 @@ msgstr "path|tree-ish"
#: builtin/cat-file.c
#, c-format
msgid "'%s' requires a batch mode"
-msgstr "「%sã€éœ€è¦æ‰¹æ¬¡è™•ç†æ¨¡å¼"
+msgstr "“%s†需è¦æ‰¹æ¬¡è™•ç†æ¨¡å¼"
#: builtin/cat-file.c
#, c-format
msgid "'-%c' is incompatible with batch mode"
-msgstr "「-%cã€èˆ‡æ‰¹æ¬¡è™•ç†æ¨¡å¼ä¸ç›¸å®¹"
+msgstr "“-%c†與批次處ç†æ¨¡å¼ä¸ç›¸å®¹"
#: builtin/cat-file.c
msgid "batch modes take no arguments"
@@ -3996,17 +4107,12 @@ msgstr "批次處ç†æ¨¡å¼ä¸å–引數"
#: builtin/cat-file.c
#, c-format
msgid "<rev> required with '%s'"
-msgstr "<rev> 需è¦æ­é…「%sã€"
+msgstr "“%sâ€ éœ€è¦ <rev>"
#: builtin/cat-file.c
#, c-format
msgid "<object> required with '-%c'"
-msgstr "<object> 需è¦æ­é…「-%cã€"
-
-#: builtin/cat-file.c builtin/notes.c builtin/prune-packed.c
-#: builtin/receive-pack.c builtin/tag.c
-msgid "too many arguments"
-msgstr "太多åƒæ•¸"
+msgstr "“-%câ€ éœ€è¦ <object>"
#: builtin/cat-file.c
#, c-format
@@ -4014,16 +4120,22 @@ msgid "only two arguments allowed in <type> <object> mode, not %d"
msgstr "åªå…許在 <type> <object> 模å¼å‚³å…¥å…©å€‹å¼•æ•¸ï¼Œä½†å‚³äº† %d 個"
#: builtin/check-attr.c
-msgid "git check-attr [-a | --all | <attr>...] [--] <pathname>..."
-msgstr "git check-attr [-a | --all | <屬性>...] [--] <路徑å>..."
+msgid ""
+"git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] "
+"<pathname>..."
+msgstr ""
+"git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] "
+"<pathname>..."
#: builtin/check-attr.c
-msgid "git check-attr --stdin [-z] [-a | --all | <attr>...]"
-msgstr "git check-attr --stdin [-z] [-a | --all | <屬性>...]"
+msgid ""
+"git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"
+msgstr ""
+"git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"
#: builtin/check-attr.c
msgid "report all attributes set on file"
-msgstr "報告設定在檔案上的所有屬性"
+msgstr "回報設定在檔案上的所有屬性"
#: builtin/check-attr.c
msgid "use .gitattributes only from the index"
@@ -4031,11 +4143,19 @@ msgstr "åªä½¿ç”¨ç´¢å¼•ä¸­çš„ .gitattributes"
#: builtin/check-attr.c builtin/check-ignore.c builtin/hash-object.c
msgid "read file names from stdin"
-msgstr "從標準輸入讀出檔案å"
+msgstr "從 stdin 讀出檔案å稱"
#: builtin/check-attr.c builtin/check-ignore.c
msgid "terminate input and output records by a NUL character"
-msgstr "輸入和輸出的紀錄使用 NUL 字元終çµ"
+msgstr "輸入和輸出的紀錄使用 NUL 字元終止"
+
+#: builtin/check-attr.c
+msgid "<tree-ish>"
+msgstr "<tree-ish>"
+
+#: builtin/check-attr.c
+msgid "which tree-ish to check attributes at"
+msgstr "è¦ç”¨å“ªä¸€å€‹æ¨¹ç‹€ç‰©ä»¶æª¢æŸ¥å±¬æ€§"
#: builtin/check-ignore.c builtin/checkout.c builtin/gc.c builtin/worktree.c
msgid "suppress progress reporting"
@@ -4043,7 +4163,7 @@ msgstr "ä¸é¡¯ç¤ºé€²åº¦å ±å‘Š"
#: builtin/check-ignore.c
msgid "show non-matching input paths"
-msgstr "顯示未符åˆçš„輸入路徑"
+msgstr "顯示ä¸ç¬¦åˆçš„輸入路徑"
#: builtin/check-ignore.c
msgid "ignore index when checking"
@@ -4051,11 +4171,11 @@ msgstr "檢查時忽略索引"
#: builtin/check-ignore.c
msgid "cannot specify pathnames with --stdin"
-msgstr "ä¸èƒ½åŒæ™‚æŒ‡å®šè·¯å¾‘åŠ --stdin åƒæ•¸"
+msgstr "無法åŒæ™‚指定路徑åç¨±åŠ --stdin"
#: builtin/check-ignore.c
msgid "-z only makes sense with --stdin"
-msgstr "-z 需è¦å’Œ --stdin åƒæ•¸å…±ç”¨æ‰æœ‰æ„義"
+msgstr "-z 需è¦å’Œ --stdin åŒæ™‚使用æ‰æœ‰æ„義"
#: builtin/check-ignore.c
msgid "no path specified"
@@ -4063,11 +4183,11 @@ msgstr "未指定路徑"
#: builtin/check-ignore.c
msgid "--quiet is only valid with a single pathname"
-msgstr "åƒæ•¸ --quiet åªåœ¨æ供一個路徑å時有效"
+msgstr "引數 --quiet åªåœ¨æ供一個路徑å稱時有效"
#: builtin/check-ignore.c
msgid "cannot have both --quiet and --verbose"
-msgstr "ä¸èƒ½åŒæ™‚æä¾› --quiet å’Œ --verbose åƒæ•¸"
+msgstr "無法åŒæ™‚傳入 --quiet å’Œ --verbose"
#: builtin/check-ignore.c
msgid "--non-matching is only valid with --verbose"
@@ -4075,41 +4195,41 @@ msgstr "--non-matching é¸é …åªåœ¨ä½¿ç”¨ --verbose 時有效"
#: builtin/check-mailmap.c
msgid "git check-mailmap [<options>] <contact>..."
-msgstr "git check-mailmap [<é¸é …>] <è¯ç¹«ä½å€>..."
+msgstr "git check-mailmap [<options>] <contact>..."
#: builtin/check-mailmap.c
msgid "also read contacts from stdin"
-msgstr "還從標準輸入讀å–è¯ç¹«ä½å€"
+msgstr "亦從 stdin 讀å–è¯çµ¡åœ°å€"
#: builtin/check-mailmap.c
#, c-format
msgid "unable to parse contact: %s"
-msgstr "ä¸èƒ½è§£æžè¯ç¹«ä½å€ï¼š%s"
+msgstr "無法解æžè¯çµ¡åœ°å€ï¼š%s"
#: builtin/check-mailmap.c
msgid "no contacts specified"
-msgstr "未指定è¯ç¹«ä½å€"
+msgstr "未指定è¯çµ¡åœ°å€"
#: builtin/checkout--worker.c
msgid "git checkout--worker [<options>]"
-msgstr "git checkout--worker [<é¸é …>]"
+msgstr "git checkout--worker [<options>]"
#: builtin/checkout--worker.c builtin/checkout-index.c builtin/column.c
#: builtin/submodule--helper.c builtin/worktree.c
msgid "string"
-msgstr "字串"
+msgstr "string"
#: builtin/checkout--worker.c builtin/checkout-index.c
msgid "when creating files, prepend <string>"
-msgstr "在建立檔案時,在å‰é¢åŠ ä¸Š <字串>"
+msgstr "建立檔案時,在å‰é¢åŠ ä¸Š <string>"
#: builtin/checkout-index.c
msgid "git checkout-index [<options>] [--] [<file>...]"
-msgstr "git checkout-index [<é¸é …>] [--] [<檔案>...]"
+msgstr "git checkout-index [<options>] [--] [<file>...]"
#: builtin/checkout-index.c
msgid "stage should be between 1 and 3 or all"
-msgstr "索引值應該å–值 1 到 3 或者 all"
+msgstr "stage 應該是 1 到 3 的值,或者是 all"
#: builtin/checkout-index.c
msgid "check out all files in the index"
@@ -4133,11 +4253,11 @@ msgstr "ä¸ç°½å‡ºæ–°æª”案"
#: builtin/checkout-index.c
msgid "update stat information in the index file"
-msgstr "更新索引中檔案的狀態訊æ¯"
+msgstr "更新索引檔案的狀態訊æ¯"
#: builtin/checkout-index.c
msgid "read list of paths from the standard input"
-msgstr "從標準輸入讀å–路徑列表"
+msgstr "從標準輸入讀å–路徑清單"
#: builtin/checkout-index.c
msgid "write the content to temporary files"
@@ -4149,49 +4269,49 @@ msgstr "從指定暫存å€ä¸­æ‹·å‡ºæª”案"
#: builtin/checkout.c
msgid "git checkout [<options>] <branch>"
-msgstr "git checkout [<é¸é …>] <分支>"
+msgstr "git checkout [<options>] <branch>"
#: builtin/checkout.c
msgid "git checkout [<options>] [<branch>] -- <file>..."
-msgstr "git checkout [<é¸é …>] [<分支>] -- <檔案>..."
+msgstr "git checkout [<options>] [<branch>] -- <file>..."
#: builtin/checkout.c
msgid "git switch [<options>] [<branch>]"
-msgstr "git switch [<é¸é …>] [<分支>]"
+msgstr "git switch [<options>] [<branch>]"
#: builtin/checkout.c
msgid "git restore [<options>] [--source=<branch>] <file>..."
-msgstr "git restore [<é¸é …>] [--source=<分支>] <檔案>..."
+msgstr "git restore [<options>] [--source=<branch>] <file>..."
#: builtin/checkout.c
#, c-format
msgid "path '%s' does not have our version"
-msgstr "路徑 '%s' 沒有我們的版本"
+msgstr "“%s†路徑沒有我們的版本"
#: builtin/checkout.c
#, c-format
msgid "path '%s' does not have their version"
-msgstr "路徑 '%s' 沒有他們的版本"
+msgstr "“%s†路徑沒有他們的版本"
#: builtin/checkout.c
#, c-format
msgid "path '%s' does not have all necessary versions"
-msgstr "路徑 '%s' 沒有全部必需的版本"
+msgstr "“%s†路徑沒有所有必須的版本"
#: builtin/checkout.c
#, c-format
msgid "path '%s' does not have necessary versions"
-msgstr "路徑 '%s' 沒有必需的版本"
+msgstr "“%s†路徑沒有必須的版本"
#: builtin/checkout.c
#, c-format
msgid "path '%s': cannot merge"
-msgstr "path '%s':無法åˆä½µ"
+msgstr "path “%sâ€ï¼šç„¡æ³•åˆä½µ"
#: builtin/checkout.c
#, c-format
msgid "Unable to add merge result for '%s'"
-msgstr "無法為 '%s' 新增åˆä½µçµæžœ"
+msgstr "無法為 “%s†加上åˆä½µçµæžœ"
#: builtin/checkout.c
#, c-format
@@ -4209,41 +4329,46 @@ msgstr[0] "從 %2$s 更新了 %1$d 個路徑"
#, c-format
msgid "Updated %d path from the index"
msgid_plural "Updated %d paths from the index"
-msgstr[0] "從索引å€æ›´æ–°äº† %d 個路徑"
+msgstr[0] "已從索引å€æ›´æ–° %d 個路徑"
#: builtin/checkout.c
#, c-format
msgid "'%s' cannot be used with updating paths"
-msgstr "'%s' ä¸èƒ½åœ¨æ›´æ–°è·¯å¾‘時使用"
+msgstr "無法在更新路徑時使用 “%sâ€"
#: builtin/checkout.c
#, c-format
msgid "Cannot update paths and switch to branch '%s' at the same time."
-msgstr "ä¸èƒ½åŒæ™‚更新路徑並切æ›åˆ°åˆ†æ”¯'%s'。"
+msgstr "無法åŒæ™‚更新路徑和切æ›è‡³ “%s†分支。"
#: builtin/checkout.c
#, c-format
msgid "neither '%s' or '%s' is specified"
-msgstr "'%s' 或 '%s' 都沒有指定"
+msgstr "“%s†或 “%s†皆未指定"
#: builtin/checkout.c
#, c-format
msgid "'%s' must be used when '%s' is not specified"
-msgstr "未指定 '%2$s' 時,必須使用 '%1$s'"
+msgstr "未指定 “%2$s†時,必須使用 “%1$sâ€"
#: builtin/checkout.c
#, c-format
msgid "'%s' or '%s' cannot be used with %s"
-msgstr "'%s' 或 '%s' ä¸èƒ½å’Œ %s 一起使用"
+msgstr "“%s†或 “%s†無法與 %s 一起使用"
+
+#: builtin/checkout.c
+#, c-format
+msgid "'%s', '%s', or '%s' cannot be used when checking out of a tree"
+msgstr "“%sâ€ã€â€œ%s†或 “%s†無法在簽出樹狀物件時使用"
#: builtin/checkout.c
#, c-format
msgid "path '%s' is unmerged"
-msgstr "路徑 '%s' 未åˆä½µ"
+msgstr "路徑 “%s†未åˆä½µ"
#: builtin/checkout.c
msgid "you need to resolve your current index first"
-msgstr "您需è¦å…ˆè§£æ±ºç›®å‰ç´¢å¼•çš„è¡çª"
+msgstr "您需è¦å…ˆè§£æ±ºç›®å‰ç´¢å¼•å€çš„è¡çª"
#: builtin/checkout.c
#, c-format
@@ -4251,52 +4376,52 @@ msgid ""
"cannot continue with staged changes in the following files:\n"
"%s"
msgstr ""
-"ä¸èƒ½ç¹¼çºŒï¼Œä¸‹åˆ—檔案有暫存的修改:\n"
+"無法繼續,下列檔案有暫存的更動:\n"
"%s"
#: builtin/checkout.c
#, c-format
msgid "Can not do reflog for '%s': %s\n"
-msgstr "ä¸èƒ½å° '%s' 執行 reflog 動作:%s\n"
+msgstr "ç„¡æ³•å° â€œ%s†執行 reflog 動作:%s\n"
#: builtin/checkout.c
msgid "HEAD is now at"
msgstr "HEAD ç›®å‰ä½æ–¼"
-#: builtin/checkout.c builtin/clone.c t/helper/test-fast-rebase.c
+#: builtin/checkout.c builtin/clone.c
msgid "unable to update HEAD"
-msgstr "ä¸èƒ½æ›´æ–° HEAD"
+msgstr "無法更新 HEAD"
#: builtin/checkout.c
#, c-format
msgid "Reset branch '%s'\n"
-msgstr "é‡è¨­åˆ†æ”¯ '%s'\n"
+msgstr "é‡è¨­åˆ†æ”¯ “%sâ€\n"
#: builtin/checkout.c
#, c-format
msgid "Already on '%s'\n"
-msgstr "已經ä½æ–¼ '%s'\n"
+msgstr "已經ä½æ–¼ “%sâ€\n"
#: builtin/checkout.c
#, c-format
msgid "Switched to and reset branch '%s'\n"
-msgstr "切æ›ä¸¦é‡è¨­åˆ†æ”¯ '%s'\n"
+msgstr "已切æ›ä¸¦é‡è¨­åˆ†æ”¯ “%sâ€\n"
#: builtin/checkout.c
#, c-format
msgid "Switched to a new branch '%s'\n"
-msgstr "切æ›åˆ°ä¸€å€‹æ–°åˆ†æ”¯ '%s'\n"
+msgstr "已切æ›è‡³æ–°åˆ†æ”¯ “%sâ€\n"
#: builtin/checkout.c
#, c-format
msgid "Switched to branch '%s'\n"
-msgstr "切æ›åˆ°åˆ†æ”¯ '%s'\n"
+msgstr "已切æ›è‡³åˆ†æ”¯ “%sâ€\n"
# 譯者:請維æŒå‰å°Žç©ºæ ¼
#: builtin/checkout.c
#, c-format
msgid " ... and %d more.\n"
-msgstr " ... åŠå…¶å®ƒ %d 個。\n"
+msgstr " …… åŠå…¶å®ƒ %d 個。\n"
#: builtin/checkout.c
#, c-format
@@ -4311,7 +4436,8 @@ msgid_plural ""
"\n"
"%s\n"
msgstr[0] ""
-"警告:您正丟下 %d 個æ交,未和任何分支關è¯ï¼š\n"
+"警告:您正丟下 %d 個\n"
+"未和任何分支關è¯çš„æ交:\n"
"\n"
"%s\n"
@@ -4330,23 +4456,23 @@ msgid_plural ""
" git branch <new-branch-name> %s\n"
"\n"
msgstr[0] ""
-"如果您想è¦é€éŽå»ºç«‹æ–°åˆ†æ”¯å„²å­˜å®ƒï¼Œé€™å¯èƒ½æ˜¯ä¸€å€‹å¥½æ™‚候。\n"
-"如下動作:\n"
+"如果您想è¦é€éŽå»ºç«‹æ–°åˆ†æ”¯ç•™ä¸‹é€™äº›æ交,\n"
+"ç¾åœ¨å¾ˆé©åˆåŸ·è¡Œï¼š\n"
"\n"
-" git branch <新分支å> %s\n"
+" git branch <新分支å稱> %s\n"
"\n"
#: builtin/checkout.c
msgid "internal error in revision walk"
-msgstr "在版本é歷時é‡åˆ°å…§éƒ¨éŒ¯èª¤"
+msgstr "在修訂版é歷時é‡åˆ°å…§éƒ¨éŒ¯èª¤"
#: builtin/checkout.c
msgid "Previous HEAD position was"
-msgstr "之å‰çš„ HEAD ä½ç½®æ˜¯"
+msgstr "之å‰çš„ HEAD 指é‡ä½ç½®åœ¨"
#: builtin/checkout.c
msgid "You are on a branch yet to be born"
-msgstr "您ä½æ–¼ä¸€å€‹å°šæœªåˆå§‹åŒ–的分支"
+msgstr "您正ä½æ–¼ä¸€å€‹å°šæœªåˆå§‹åŒ–的分支"
#: builtin/checkout.c
#, c-format
@@ -4354,7 +4480,7 @@ msgid ""
"'%s' could be both a local file and a tracking branch.\n"
"Please use -- (and optionally --no-guess) to disambiguate"
msgstr ""
-"'%s' æ—¢å¯ä»¥æ˜¯ä¸€å€‹æœ¬æ©Ÿæª”案,也å¯ä»¥æ˜¯ä¸€å€‹è¿½è¹¤åˆ†æ”¯ã€‚\n"
+"“%s†既å¯ä»¥æ˜¯æœ¬æ©Ÿæª”案,也å¯ä»¥æ˜¯è¿½è¹¤åˆ†æ”¯ã€‚\n"
"請使用 --(和å¯é¸çš„ --no-guess)來消除歧義"
#: builtin/checkout.c
@@ -4368,18 +4494,19 @@ msgid ""
"one remote, e.g. the 'origin' remote, consider setting\n"
"checkout.defaultRemote=origin in your config."
msgstr ""
-"如果您想è¦ç°½å‡ºä¸€å€‹é ç«¯è¿½è¹¤åˆ†æ”¯ï¼Œä¾‹å¦‚ 'origin',您å¯ä»¥\n"
-"使用 --track é¸é …寫出全å:\n"
+"如果您想è¦ç°½å‡ºé ç«¯è¿½è¹¤åˆ†æ”¯ï¼Œä¾‹å¦‚ “originâ€ï¼Œ\n"
+"您å¯ä»¥ä½¿ç”¨ --track é¸é …寫出全å:\n"
"\n"
" git checkout --track origin/<name>\n"
"\n"
-"如果您總是喜歡使用模糊的簡短分支å <name>,而ä¸å–œæ­¡å¦‚ 'origin' çš„é ç«¯\n"
-"版本庫å,å¯ä»¥åœ¨è¨­å®šä¸­è¨­å®š checkout.defaultRemote=origin。"
+"如果您平時比較想è¦ä½¿ç”¨æ¨¡ç³Šçš„簡短分支å稱 <name>,\n"
+"而ä¸å¤ªæƒ³å¯«å¦‚ “origin†的é ç«¯ç‰ˆæœ¬åº«å稱,\n"
+"å¯ä»¥åœ¨çµ„態中設定 checkout.defaultRemote=origin。"
#: builtin/checkout.c
#, c-format
msgid "'%s' matched multiple (%d) remote tracking branches"
-msgstr "'%s' 符åˆå¤šå€‹ (%d) é ç«¯è¿½è¹¤åˆ†æ”¯"
+msgstr "“%s†符åˆå¤šå€‹ (%d) é ç«¯è¿½è¹¤åˆ†æ”¯"
#: builtin/checkout.c
msgid "only one reference expected"
@@ -4388,7 +4515,7 @@ msgstr "é æœŸåªæœ‰ä¸€å€‹å¼•ç”¨"
#: builtin/checkout.c
#, c-format
msgid "only one reference expected, %d given."
-msgstr "應åªæœ‰ä¸€å€‹å¼•ç”¨ï¼Œå»æ供了 %d 個。"
+msgstr "é æœŸåªæœ‰ä¸€å€‹å¼•ç”¨ï¼Œå»æ供了 %d 個。"
#: builtin/checkout.c builtin/worktree.c
#, c-format
@@ -4398,112 +4525,112 @@ msgstr "無效引用:%s"
#: builtin/checkout.c
#, c-format
msgid "reference is not a tree: %s"
-msgstr "引用ä¸æ˜¯ä¸€å€‹æ¨¹ï¼š%s"
+msgstr "引用ä¸æ˜¯æ¨¹ç‹€ç‰©ä»¶ï¼š%s"
#: builtin/checkout.c
#, c-format
msgid "a branch is expected, got tag '%s'"
-msgstr "期望一個分支,得到標籤 '%s'"
+msgstr "é æœŸæ”¶åˆ°åˆ†æ”¯ï¼Œå»æ”¶åˆ°æ¨™ç±¤ “%sâ€"
#: builtin/checkout.c
#, c-format
msgid "a branch is expected, got remote branch '%s'"
-msgstr "期望一個分支,得到é ç«¯åˆ†æ”¯ '%s'"
+msgstr "é æœŸæ”¶åˆ°åˆ†æ”¯ï¼Œå»æ”¶åˆ°é ç«¯åˆ†æ”¯ “%sâ€"
#: builtin/checkout.c
#, c-format
msgid "a branch is expected, got '%s'"
-msgstr "期望一個分支,得到 '%s'"
+msgstr "é æœŸæ”¶åˆ°åˆ†æ”¯ï¼Œå»æ”¶åˆ° “%sâ€"
#: builtin/checkout.c
#, c-format
msgid "a branch is expected, got commit '%s'"
-msgstr "期望一個分支,得到æ交 '%s'"
+msgstr "é æœŸæ”¶åˆ°åˆ†æ”¯ï¼Œå»æ”¶åˆ°æ交 “%sâ€"
#: builtin/checkout.c
msgid ""
"If you want to detach HEAD at the commit, try again with the --detach option."
-msgstr "若您想è¦åˆ†é›¢æ交的 HEAD,請傳入 --detach é¸é …é‡è©¦ã€‚"
+msgstr "若您想è¦åœ¨æ­¤æ交分離 HEAD 指é‡ï¼Œè«‹å‚³å…¥ --detach é¸é …é‡è©¦ã€‚"
#: builtin/checkout.c
msgid ""
"cannot switch branch while merging\n"
"Consider \"git merge --quit\" or \"git worktree add\"."
msgstr ""
-"ä¸èƒ½åœ¨åˆä½µæ™‚切æ›åˆ†æ”¯\n"
-"考慮使用 \"git merge --quit\" 或 \"git worktree add\"。"
+"無法在åˆä½µæ™‚切æ›åˆ†æ”¯\n"
+"請試試 “git merge --quit†或 “git worktree addâ€ã€‚"
#: builtin/checkout.c
msgid ""
"cannot switch branch in the middle of an am session\n"
"Consider \"git am --quit\" or \"git worktree add\"."
msgstr ""
-"ä¸èƒ½åœ¨ am 工作階段期間切æ›åˆ†æ”¯\n"
-"考慮使用 \"git am --quit\" 或 \"git worktree add\"。"
+"無法在 am 工作階段期間時切æ›åˆ†æ”¯\n"
+"請試試 “git am --quit†或 “git worktree addâ€ã€‚"
#: builtin/checkout.c
msgid ""
"cannot switch branch while rebasing\n"
"Consider \"git rebase --quit\" or \"git worktree add\"."
msgstr ""
-"ä¸èƒ½åœ¨é‡å®šåŸºåº•æ™‚切æ›åˆ†æ”¯\n"
-"考慮使用 \"git rebase --quit\" 或 \"git worktree add\"。"
+"無法在é‡å®šåŸºåº•æ™‚切æ›åˆ†æ”¯\n"
+"請試試 “git rebase --quit†或 “git worktree addâ€ã€‚"
#: builtin/checkout.c
msgid ""
"cannot switch branch while cherry-picking\n"
"Consider \"git cherry-pick --quit\" or \"git worktree add\"."
msgstr ""
-"ä¸èƒ½åœ¨æ€é¸æ™‚切æ›åˆ†æ”¯\n"
-"考慮使用 \"git cherry-pick --quit\" 或 \"git worktree add\"。"
+"無法在æ€é¸æ™‚切æ›åˆ†æ”¯\n"
+"請試試 “git cherry-pick --quit†或 “git worktree addâ€ã€‚"
#: builtin/checkout.c
msgid ""
"cannot switch branch while reverting\n"
"Consider \"git revert --quit\" or \"git worktree add\"."
msgstr ""
-"ä¸èƒ½åœ¨é‚„原時切æ›åˆ†æ”¯\n"
-"考慮使用 \"git revert --quit\" 或 \"git worktree add\"。"
+"無法在還原時切æ›åˆ†æ”¯\n"
+"請試試 “git revert --quit†或 “git worktree addâ€ã€‚"
#: builtin/checkout.c
msgid "you are switching branch while bisecting"
-msgstr "您在執行二分æœå°‹æ™‚切æ›åˆ†æ”¯"
+msgstr "您在進行二分æœå°‹æ™‚切æ›åˆ†æ”¯"
#: builtin/checkout.c
msgid "paths cannot be used with switching branches"
-msgstr "路徑ä¸èƒ½å’Œåˆ‡æ›åˆ†æ”¯åŒæ™‚使用"
+msgstr "路徑ä¸èƒ½èˆ‡åˆ‡æ›åˆ†æ”¯åŒæ™‚使用"
#: builtin/checkout.c
#, c-format
msgid "'%s' cannot be used with switching branches"
-msgstr "'%s' ä¸èƒ½å’Œåˆ‡æ›åˆ†æ”¯åŒæ™‚使用"
+msgstr "“%s†ä¸èƒ½èˆ‡åˆ‡æ›åˆ†æ”¯åŒæ™‚使用"
#: builtin/checkout.c
#, c-format
msgid "'%s' cannot be used with '%s'"
-msgstr "'%s' ä¸èƒ½å’Œ '%s' åŒæ™‚使用"
+msgstr "“%s†ä¸èƒ½èˆ‡ “%s†åŒæ™‚使用"
#: builtin/checkout.c
#, c-format
msgid "'%s' cannot take <start-point>"
-msgstr "'%s' ä¸å¸¶ <起始點>"
+msgstr "“%s†ä¸å– <start-point>"
#: builtin/checkout.c
#, c-format
msgid "Cannot switch branch to a non-commit '%s'"
-msgstr "ä¸èƒ½åˆ‡æ›åˆ†æ”¯åˆ°ä¸€å€‹éžæ交 '%s'"
+msgstr "無法將分支切æ›è‡³éžæ交項目 “%sâ€"
#: builtin/checkout.c
msgid "missing branch or commit argument"
-msgstr "缺少分支或æ交åƒæ•¸"
+msgstr "缺少分支或æ交引數"
#: builtin/checkout.c
msgid "perform a 3-way merge with the new branch"
-msgstr "和新的分支執行三方åˆä½µ"
+msgstr "和新分支進行三方åˆä½µ"
#: builtin/checkout.c builtin/log.c parse-options.h
msgid "style"
-msgstr "風格"
+msgstr "style"
#: builtin/checkout.c
msgid "conflict style (merge, diff3, or zdiff3)"
@@ -4511,7 +4638,7 @@ msgstr "è¡çªè¼¸å‡ºé¢¨æ ¼ï¼ˆmergeã€diff3 或 zdiff3)"
#: builtin/checkout.c builtin/worktree.c
msgid "detach HEAD at named commit"
-msgstr "HEAD 從指定的æ交分離"
+msgstr "自指定æ交分離 HEAD 指é‡"
#: builtin/checkout.c
msgid "force checkout (throw away local modifications)"
@@ -4519,19 +4646,19 @@ msgstr "強制簽出(æ¨æ£„本機修改)"
#: builtin/checkout.c
msgid "new-branch"
-msgstr "新分支"
+msgstr "new-branch"
#: builtin/checkout.c
-msgid "new unparented branch"
-msgstr "新的沒有父æ交的分支"
+msgid "new unborn branch"
+msgstr "新的未誕生分支"
#: builtin/checkout.c builtin/merge.c
msgid "update ignored files (default)"
-msgstr "更新忽略的檔案(é è¨­ï¼‰"
+msgstr "更新忽略的檔案(é è¨­å€¼ï¼‰"
#: builtin/checkout.c
msgid "do not check if another worktree is holding the given ref"
-msgstr "ä¸æª¢æŸ¥æŒ‡å®šçš„引用是å¦è¢«å…¶ä»–工作å€æ‰€å ç”¨"
+msgstr "ä¸æª¢æŸ¥å…¶ä»–工作å€æ˜¯å¦æ­£åœ¨ä½”用指定的引用"
#: builtin/checkout.c
msgid "checkout our version for unmerged files"
@@ -4543,16 +4670,16 @@ msgstr "å°å°šæœªåˆä½µçš„檔案簽出他們的版本"
#: builtin/checkout.c
msgid "do not limit pathspecs to sparse entries only"
-msgstr "å°è·¯å¾‘ä¸åšç¨€ç–簽出的é™åˆ¶"
+msgstr "å°è·¯å¾‘è¦æ ¼ä¸åšç¨€ç–簽出的é™åˆ¶"
#: builtin/checkout.c
#, c-format
msgid "options '-%c', '-%c', and '%s' cannot be used together"
-msgstr "「-%cã€ã€ã€Œ-%cã€å’Œã€Œ%sã€é¸é …ä¸å¾—åŒæ™‚使用"
+msgstr "“-%câ€ã€â€œ-%c†和 “%s†é¸é …ä¸å¾—åŒæ™‚使用"
#: builtin/checkout.c
msgid "--track needs a branch name"
-msgstr "--track 需è¦ä¸€å€‹åˆ†æ”¯å"
+msgstr "--track 需è¦åˆ†æ”¯å稱"
#: builtin/checkout.c
#, c-format
@@ -4571,60 +4698,61 @@ msgstr "無效的路徑è¦æ ¼"
#: builtin/checkout.c
#, c-format
msgid "'%s' is not a commit and a branch '%s' cannot be created from it"
-msgstr "'%s' ä¸æ˜¯ä¸€å€‹æ交,ä¸èƒ½åŸºæ–¼å®ƒå»ºç«‹åˆ†æ”¯ '%s'"
+msgstr "“%s†ä¸æ˜¯æ交,因此ä¸èƒ½ä»¥é€™ç‚ºåŸºç¤Žå»ºç«‹ “%s†分支"
#: builtin/checkout.c
#, c-format
msgid "git checkout: --detach does not take a path argument '%s'"
-msgstr "git checkout:--detach ä¸èƒ½æŽ¥æ”¶è·¯å¾‘åƒæ•¸ '%s'"
+msgstr "git checkout:--detach ä¸å–路徑引數 “%sâ€"
#: builtin/checkout.c
msgid ""
"git checkout: --ours/--theirs, --force and --merge are incompatible when\n"
"checking out of the index."
msgstr ""
-"git checkout:在從索引簽出時,--ours/--theirsã€--force å’Œ --merge ä¸ç›¸å®¹ã€‚"
+"git checkout:在從索引簽出時,--ours/--theirsã€--force\n"
+"å’Œ --merge ä¸ç›¸å®¹ã€‚"
#: builtin/checkout.c
msgid "you must specify path(s) to restore"
-msgstr "您必須指定一個è¦å¾©åŽŸçš„路徑"
+msgstr "您必須指定è¦é‚„原的路徑"
-#: builtin/checkout.c builtin/clone.c builtin/remote.c
+#: builtin/checkout.c builtin/clone.c builtin/remote.c builtin/replay.c
#: builtin/submodule--helper.c builtin/worktree.c
msgid "branch"
-msgstr "分支"
+msgstr "branch"
#: builtin/checkout.c
msgid "create and checkout a new branch"
-msgstr "建立並簽出一個新的分支"
+msgstr "建立並簽出新分支"
#: builtin/checkout.c
msgid "create/reset and checkout a branch"
-msgstr "建立/é‡è¨­ä¸¦ç°½å‡ºä¸€å€‹åˆ†æ”¯"
+msgstr "建立/é‡è¨­ä¸¦ç°½å‡ºåˆ†æ”¯"
#: builtin/checkout.c
msgid "create reflog for new branch"
-msgstr "為新的分支建立引用日誌"
+msgstr "為新分支建立引用日誌"
#: builtin/checkout.c
msgid "second guess 'git checkout <no-such-branch>' (default)"
-msgstr "二次猜測 'git checkout <無此分支>'(é è¨­ï¼‰"
+msgstr "二次猜測 “git checkout <無此分支>â€ï¼ˆé è¨­å€¼ï¼‰"
#: builtin/checkout.c
msgid "use overlay mode (default)"
-msgstr "使用疊加模å¼ï¼ˆé è¨­ï¼‰"
+msgstr "使用疊加模å¼ï¼ˆé è¨­å€¼ï¼‰"
#: builtin/checkout.c
msgid "create and switch to a new branch"
-msgstr "建立並切æ›ä¸€å€‹æ–°åˆ†æ”¯"
+msgstr "建立並切æ›è‡³æ–°åˆ†æ”¯"
#: builtin/checkout.c
msgid "create/reset and switch to a branch"
-msgstr "建立/é‡è¨­ä¸¦åˆ‡æ›ä¸€å€‹åˆ†æ”¯"
+msgstr "建立/é‡è¨­ä¸¦åˆ‡æ›è‡³æŒ‡å®šåˆ†æ”¯"
#: builtin/checkout.c
msgid "second guess 'git switch <no-such-branch>'"
-msgstr "二次猜測 'git switch <無此分支>'"
+msgstr "二次猜測 “git switch <無此分支>â€"
#: builtin/checkout.c
msgid "throw away local modifications"
@@ -4632,19 +4760,19 @@ msgstr "æ¨æ£„本機修改"
#: builtin/checkout.c
msgid "which tree-ish to checkout from"
-msgstr "è¦ç°½å‡ºå“ªä¸€å€‹æ¨¹"
+msgstr "è¦è‡ªå“ªä¸€å€‹æ¨¹ç‹€ç‰©ä»¶æŒ‡ç¤ºå…ƒç°½å‡º"
#: builtin/checkout.c
msgid "restore the index"
-msgstr "復原索引"
+msgstr "還原索引"
#: builtin/checkout.c
msgid "restore the working tree (default)"
-msgstr "復原工作å€ï¼ˆé è¨­ï¼‰"
+msgstr "還原工作å€ï¼ˆé è¨­å€¼ï¼‰"
#: builtin/checkout.c
msgid "ignore unmerged entries"
-msgstr "忽略未åˆä½µæ¢ç›®"
+msgstr "忽略未åˆä½µé …ç›®"
#: builtin/checkout.c
msgid "use overlay mode"
@@ -4652,19 +4780,21 @@ msgstr "使用疊加模å¼"
#: builtin/clean.c
msgid ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <paths>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] "
+"[<pathspec>...]"
msgstr ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <模å¼>] [-x | -X] [--] <路徑>..."
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] "
+"[<pathspec>...]"
#: builtin/clean.c
#, c-format
msgid "Removing %s\n"
-msgstr "正刪除 %s\n"
+msgstr "正在刪除 %s\n"
#: builtin/clean.c
#, c-format
msgid "Would remove %s\n"
-msgstr "將刪除 %s\n"
+msgstr "將會刪除 %s\n"
#: builtin/clean.c
#, c-format
@@ -4679,12 +4809,12 @@ msgstr "將忽略版本庫 %s\n"
#: builtin/clean.c midx.c
#, c-format
msgid "failed to remove %s"
-msgstr "刪除 %s 失敗"
+msgstr "無法移除 %s"
#: builtin/clean.c
#, c-format
msgid "could not lstat %s\n"
-msgstr "ä¸èƒ½å° %s å‘¼å« lstat\n"
+msgstr "ä¸èƒ½å° %s 進行 lstat\n"
#: builtin/clean.c
msgid "Refusing to remove current working directory\n"
@@ -4694,7 +4824,7 @@ msgstr "拒絕移除目å‰å·¥ä½œç›®éŒ„\n"
msgid "Would refuse to remove current working directory\n"
msgstr "會拒絕移除目å‰çš„工作目錄\n"
-#: builtin/clean.c git-add--interactive.perl
+#: builtin/clean.c
#, c-format
msgid ""
"Prompt help:\n"
@@ -4702,12 +4832,12 @@ msgid ""
"foo - select item based on unique prefix\n"
" - (empty) select nothing\n"
msgstr ""
-"å”助:\n"
-"1 - é€éŽç·¨è™Ÿé¸æ“‡ä¸€å€‹é¸é …\n"
-"foo - é€éŽå”¯ä¸€å‰ç¶´é¸æ“‡ä¸€å€‹é¸é …\n"
+"æ示說明:\n"
+"1 - é€éŽç·¨è™Ÿé¸æ“‡é …ç›®\n"
+"foo - 根據ç¨ç‰¹å‰ç¶´é¸æ“‡é …ç›®\n"
" - (空)什麼也ä¸é¸æ“‡\n"
-#: builtin/clean.c git-add--interactive.perl
+#: builtin/clean.c
#, c-format
msgid ""
"Prompt help:\n"
@@ -4719,39 +4849,39 @@ msgid ""
"* - choose all items\n"
" - (empty) finish selecting\n"
msgstr ""
-"å”助:\n"
-"1 - é¸æ“‡ä¸€å€‹é¸é …\n"
-"3-5 - é¸æ“‡ä¸€å€‹ç¯„åœå…§çš„所有é¸é …\n"
-"2-3,6-9 - é¸æ“‡å¤šå€‹ç¯„åœå…§çš„所有é¸é …\n"
-"foo - é€éŽå”¯ä¸€å‰ç¶´é¸æ“‡ä¸€å€‹é¸é …\n"
-"-... - åé¸ç‰¹å®šçš„é¸é …\n"
-"* - é¸æ“‡æ‰€æœ‰é¸é …\n"
-" - (空)çµæŸé¸æ“‡\n"
-
-#: builtin/clean.c git-add--interactive.perl
-#, c-format, perl-format
+"æ示說明:\n"
+"1 - é¸æ“‡ä¸€å€‹é …ç›®\n"
+"3-5 - é¸æ“‡ä¸€å€‹é …目範åœ\n"
+"2-3,6-9 - é¸æ“‡å¤šå€‹é …目範åœ\n"
+"foo - 根據ç¨ç‰¹å‰ç¶´é¸æ“‡é …ç›®\n"
+"-... - å–消é¸å–指定項目\n"
+"* - é¸æ“‡æ‰€æœ‰é …ç›®\n"
+" - (空)完æˆé¸æ“‡\n"
+
+#: builtin/clean.c
+#, c-format
msgid "Huh (%s)?\n"
-msgstr "嗯(%s)?\n"
+msgstr "嗯(%s)?\n"
#: builtin/clean.c
#, c-format
msgid "Input ignore patterns>> "
-msgstr "輸入範本以排除æ¢ç›®>> "
+msgstr "輸入è¦å¿½ç•¥çš„模å¼é …ç›®>> "
#: builtin/clean.c
#, c-format
msgid "WARNING: Cannot find items matched by: %s"
-msgstr "警告:無法找到和 %s 符åˆçš„æ¢ç›®"
+msgstr "警告:無法找到和 %s 符åˆçš„é …ç›®"
#: builtin/clean.c
msgid "Select items to delete"
-msgstr "é¸æ“‡è¦åˆªé™¤çš„æ¢ç›®"
+msgstr "é¸æ“‡è¦åˆªé™¤çš„é …ç›®"
#. TRANSLATORS: Make sure to keep [y/N] as is
#: builtin/clean.c
#, c-format
msgid "Remove %s [y/N]? "
-msgstr "移除 %s [y/N]? "
+msgstr "移除 %s [y/N]? "
#: builtin/clean.c
msgid ""
@@ -4766,15 +4896,15 @@ msgstr ""
"clean - 開始清ç†\n"
"filter by pattern - é€éŽç¯„本排除è¦åˆªé™¤çš„æ¢ç›®\n"
"select by numbers - é€éŽæ•¸å­—é¸æ“‡è¦åˆªé™¤çš„æ¢ç›®\n"
-"ask each - é‡å°åˆªé™¤é€ä¸€è©¢å•ï¼ˆå°±åƒ \"rm -i\")\n"
+"ask each - é‡å°åˆªé™¤é€ä¸€è©¢å•ï¼ˆå°±åƒ “rm -iâ€ï¼‰\n"
"quit - åœæ­¢åˆªé™¤ä¸¦é›¢é–‹\n"
-"help - 顯示本å”助\n"
-"? - 顯示如何在æ示符下é¸æ“‡çš„å”助"
+"help - 顯示本輔助說明\n"
+"? - 顯示如何在æ示下é¸æ“‡çš„å”助"
#: builtin/clean.c
msgid "Would remove the following item:"
msgid_plural "Would remove the following items:"
-msgstr[0] "將刪除如下æ¢ç›®ï¼š"
+msgstr[0] "將移除以下項目:"
#: builtin/clean.c
msgid "No more files to clean, exiting."
@@ -4782,11 +4912,11 @@ msgstr "沒有è¦æ¸…ç†çš„檔案,離開。"
#: builtin/clean.c
msgid "do not print names of files removed"
-msgstr "ä¸åˆ—å°åˆªé™¤æª”案的å稱"
+msgstr "ä¸è¼¸å‡ºç§»é™¤çš„檔案的å稱"
#: builtin/clean.c
msgid "force"
-msgstr "強制"
+msgstr "force"
#: builtin/clean.c
msgid "interactive cleaning"
@@ -4794,24 +4924,25 @@ msgstr "互動å¼æ¸…除"
#: builtin/clean.c
msgid "remove whole directories"
-msgstr "刪除整個目錄"
+msgstr "移除整個目錄"
#: builtin/clean.c builtin/describe.c builtin/grep.c builtin/log.c
-#: builtin/ls-files.c builtin/name-rev.c builtin/show-ref.c
+#: builtin/ls-files.c builtin/name-rev.c builtin/pack-refs.c builtin/show-ref.c
+#: ref-filter.h
msgid "pattern"
-msgstr "模å¼"
+msgstr "pattern"
#: builtin/clean.c
msgid "add <pattern> to ignore rules"
-msgstr "新增 <模å¼> 到忽略è¦å‰‡"
+msgstr "å°‡ <pattern> 加到忽略è¦å‰‡"
#: builtin/clean.c
msgid "remove ignored files, too"
-msgstr "也刪除忽略的檔案"
+msgstr "亦移除忽略的檔案"
#: builtin/clean.c
msgid "remove only ignored files"
-msgstr "åªåˆªé™¤å¿½ç•¥çš„檔案"
+msgstr "åªç§»é™¤å¿½ç•¥çš„檔案"
#: builtin/clean.c
msgid ""
@@ -4827,29 +4958,25 @@ msgid ""
msgstr ""
"clean.requireForce é è¨­ç‚º true 且未æä¾› -iã€-n 或 -f é¸é …,拒絕執行清ç†å‹•ä½œ"
-#: builtin/clean.c
-msgid "-x and -X cannot be used together"
-msgstr "-x å’Œ -X ä¸èƒ½åŒæ™‚使用"
-
#: builtin/clone.c
msgid "git clone [<options>] [--] <repo> [<dir>]"
-msgstr "git clone [<é¸é …>] [--] <版本庫> [<路徑>]"
+msgstr "git clone [<options>] [--] <repo> [<dir>]"
#: builtin/clone.c
msgid "don't clone shallow repository"
-msgstr "ä¸è¦è¤‡è£½æ·ºç‰ˆæœ¬åº«"
+msgstr "ä¸è¦è¤‡è£½æ·ºå±¤ç‰ˆæœ¬åº«"
#: builtin/clone.c
msgid "don't create a checkout"
-msgstr "ä¸å»ºç«‹ä¸€å€‹ç°½å‡º"
+msgstr "ä¸è¦å»ºç«‹ç°½å‡º"
#: builtin/clone.c builtin/init-db.c
msgid "create a bare repository"
-msgstr "建立一個純版本庫"
+msgstr "建立裸版本庫"
#: builtin/clone.c
msgid "create a mirror repository (implies bare)"
-msgstr "建立一個é¡åƒç‰ˆæœ¬åº«ï¼ˆä¹Ÿæ˜¯ç´”版本庫)"
+msgstr "建立é¡åƒç‰ˆæœ¬åº«ï¼ˆäº¦å³è£¸ç‰ˆæœ¬åº«ï¼‰"
#: builtin/clone.c
msgid "to clone from a local repository"
@@ -4857,7 +4984,7 @@ msgstr "從本機版本庫複製"
#: builtin/clone.c
msgid "don't use local hardlinks, always copy"
-msgstr "ä¸ä½¿ç”¨æœ¬æ©Ÿç¡¬é€£çµï¼Œå§‹çµ‚複製"
+msgstr "ä¸ä½¿ç”¨æœ¬æ©Ÿç¡¬é€£çµï¼Œå§‹çµ‚æ‹·è²"
#: builtin/clone.c
msgid "setup as shared repository"
@@ -4873,15 +5000,15 @@ msgstr "在複製時åˆå§‹åŒ–å­æ¨¡çµ„"
#: builtin/clone.c
msgid "number of submodules cloned in parallel"
-msgstr "並行複製的å­æ¨¡çµ„數"
+msgstr "平行複製的å­æ¨¡çµ„數é‡"
#: builtin/clone.c builtin/init-db.c
msgid "template-directory"
-msgstr "範本目錄"
+msgstr "模æ¿ç›®éŒ„"
#: builtin/clone.c builtin/init-db.c
msgid "directory from which templates will be used"
-msgstr "範本目錄將被使用"
+msgstr "將被使用的模æ¿ç›®éŒ„"
#: builtin/clone.c builtin/submodule--helper.c
msgid "reference repository"
@@ -4889,49 +5016,46 @@ msgstr "引用版本庫"
#: builtin/clone.c builtin/submodule--helper.c
msgid "use --reference only while cloning"
-msgstr "僅在複製時åƒè€ƒ --reference 指å‘的本機版本庫"
+msgstr "僅在複製時使用 --reference"
#: builtin/clone.c builtin/column.c builtin/fmt-merge-msg.c builtin/init-db.c
#: builtin/merge-file.c builtin/merge.c builtin/pack-objects.c builtin/repack.c
#: builtin/submodule--helper.c t/helper/test-simple-ipc.c
msgid "name"
-msgstr "å稱"
+msgstr "name"
#: builtin/clone.c
msgid "use <name> instead of 'origin' to track upstream"
-msgstr "使用 <å稱> 而ä¸æ˜¯ 'origin' 去追蹤上游"
+msgstr "使用 <name> 而ä¸æ˜¯ “origin†追蹤上游"
#: builtin/clone.c
msgid "checkout <branch> instead of the remote's HEAD"
-msgstr "簽出 <分支> 而ä¸æ˜¯é ç«¯ HEAD"
+msgstr "簽出 <branch> 而ä¸æ˜¯é ç«¯ HEAD"
#: builtin/clone.c
msgid "path to git-upload-pack on the remote"
msgstr "é ç«¯ git-upload-pack 路徑"
-#: builtin/clone.c builtin/fetch.c builtin/grep.c builtin/pull.c
+#: builtin/clone.c builtin/fetch.c builtin/pull.c
msgid "depth"
-msgstr "深度"
+msgstr "depth"
#: builtin/clone.c
msgid "create a shallow clone of that depth"
-msgstr "建立一個指定深度的淺複製"
-
-#: builtin/clone.c builtin/fetch.c builtin/pack-objects.c builtin/pull.c
-msgid "time"
-msgstr "時間"
+msgstr "建立指定深度的淺層複製"
#: builtin/clone.c
msgid "create a shallow clone since a specific time"
-msgstr "建立從指定時間到ç¾åœ¨çš„淺複製"
+msgstr "建立從指定時間到ç¾åœ¨çš„淺層複製"
#: builtin/clone.c builtin/fetch.c builtin/pull.c builtin/rebase.c
+#: builtin/replay.c
msgid "revision"
-msgstr "修訂版"
+msgstr "revision"
#: builtin/clone.c builtin/fetch.c builtin/pull.c
msgid "deepen history of shallow clone, excluding rev"
-msgstr "å–得更多淺複製的éŽåŽ»æ­·å²è¨˜éŒ„,除了特定版本"
+msgstr "å–得更多淺層複製的éŽåŽ»æ­·å²è¨˜éŒ„,除了特定修訂版"
#: builtin/clone.c builtin/submodule--helper.c
msgid "clone only one branch, HEAD or --branch"
@@ -4947,11 +5071,15 @@ msgstr "å­æ¨¡çµ„將以淺下載模å¼è¤‡è£½"
#: builtin/clone.c builtin/init-db.c
msgid "gitdir"
-msgstr "git目錄"
+msgstr "gitdir"
#: builtin/clone.c builtin/init-db.c
msgid "separate git dir from working tree"
-msgstr "git目錄和工作å€åˆ†é›¢"
+msgstr "git 目錄和工作å€åˆ†é›¢"
+
+#: builtin/clone.c builtin/init-db.c
+msgid "specify the reference format to use"
+msgstr "指定è¦ä½¿ç”¨çš„引用格å¼"
#: builtin/clone.c
msgid "key=value"
@@ -4971,14 +5099,6 @@ msgstr "server-specific"
msgid "option to transmit"
msgstr "傳輸é¸é …"
-#: builtin/clone.c builtin/fetch.c builtin/pull.c builtin/push.c
-msgid "use IPv4 addresses only"
-msgstr "åªä½¿ç”¨ IPv4 ä½å€"
-
-#: builtin/clone.c builtin/fetch.c builtin/pull.c builtin/push.c
-msgid "use IPv6 addresses only"
-msgstr "åªä½¿ç”¨ IPv6 ä½å€"
-
#: builtin/clone.c
msgid "apply partial clone filters to submodules"
msgstr "將部分複製éŽæ¿¾å™¨å¥—用至å­æ¨¡çµ„"
@@ -4992,6 +5112,14 @@ msgid "initialize sparse-checkout file to include only files at root"
msgstr "åˆå§‹åŒ–稀ç–簽出檔案,åªåŒ…å«æ ¹ç›®éŒ„中的檔案"
#: builtin/clone.c
+msgid "uri"
+msgstr "uri"
+
+#: builtin/clone.c
+msgid "a URI for downloading bundles before fetching from origin remote"
+msgstr "在從 origin é ç«¯æŠ“å–å‰ï¼Œç”¨ä¾†ä¸‹è¼‰å¥—件包的 URI"
+
+#: builtin/clone.c
#, c-format
msgid "info: Could not add alternate for '%s': %s\n"
msgstr "info: ä¸èƒ½ç‚º '%s' 新增一個備用:%s\n"
@@ -5008,13 +5136,23 @@ msgstr "%s 存在且ä¸æ˜¯ä¸€å€‹ç›®éŒ„"
#: builtin/clone.c
#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "“%s†是個符號連çµï¼Œæ•…ä¸èƒ½ä½¿ç”¨ --local 複製"
+
+#: builtin/clone.c
+#, c-format
msgid "failed to start iterator over '%s'"
msgstr "無法在 '%s' 上啟動疊代器"
+#: builtin/clone.c
+#, c-format
+msgid "symlink '%s' exists, refusing to clone with --local"
+msgstr "「%sã€ç¬¦è™Ÿé€£çµå·²å­˜åœ¨ï¼Œæ‹’絕使用 --local 複製"
+
#: builtin/clone.c compat/precompose_utf8.c
#, c-format
msgid "failed to unlink '%s'"
-msgstr "刪除 '%s' 失敗"
+msgstr "無法刪除 “%sâ€"
#: builtin/clone.c
#, c-format
@@ -5065,8 +5203,8 @@ msgid "failed to initialize sparse-checkout"
msgstr "無法åˆå§‹åŒ–稀ç–簽出"
#: builtin/clone.c
-msgid "remote HEAD refers to nonexistent ref, unable to checkout.\n"
-msgstr "é ç«¯ HEAD 指å‘一個ä¸å­˜åœ¨çš„引用,無法簽出。\n"
+msgid "remote HEAD refers to nonexistent ref, unable to checkout"
+msgstr "é ç«¯ HEAD 指å‘一個ä¸å­˜åœ¨çš„引用,無法簽出"
#: builtin/clone.c
msgid "unable to checkout working tree"
@@ -5082,20 +5220,20 @@ msgstr "無法執行 repack 來清ç†"
#: builtin/clone.c
msgid "cannot unlink temporary alternates file"
-msgstr "無法刪除暫時的 alternates 檔案"
+msgstr "無法刪除暫存 alternates 檔案"
#: builtin/clone.c
msgid "Too many arguments."
msgstr "太多åƒæ•¸ã€‚"
-#: builtin/clone.c contrib/scalar/scalar.c
+#: builtin/clone.c scalar.c
msgid "You must specify a repository to clone."
msgstr "您必須指定è¦è¤‡è£½çš„版本庫。"
-#: builtin/clone.c
+#: builtin/clone.c builtin/init-db.c setup.c
#, c-format
-msgid "options '%s' and '%s %s' cannot be used together"
-msgstr "「%sã€å’Œã€Œ%s %sã€é¸é …ä¸å¾—åŒæ™‚使用"
+msgid "unknown ref storage format '%s'"
+msgstr "æœªçŸ¥çš„å¼•ç”¨å„²å­˜æ ¼å¼ â€œ%sâ€"
#: builtin/clone.c
#, c-format
@@ -5183,7 +5321,20 @@ msgstr "--local 被忽略"
#: builtin/clone.c
msgid "cannot clone from filtered bundle"
-msgstr "無法從éŽæ¿¾å¾Œçš„套件複製"
+msgstr "無法從éŽæ¿¾å¾Œçš„套件包複製"
+
+#: builtin/clone.c
+msgid "failed to initialize the repo, skipping bundle URI"
+msgstr "無法åˆå§‹åŒ–版本庫,略éŽå¥—件包 URI"
+
+#: builtin/clone.c
+#, c-format
+msgid "failed to fetch objects from bundle URI '%s'"
+msgstr "無法從套件包 URL “%s†抓å–物件"
+
+#: builtin/clone.c
+msgid "failed to fetch advertised bundles"
+msgstr "無法抓å–公佈的套件包"
#: builtin/clone.c
msgid "remote transport reported error"
@@ -5232,22 +5383,27 @@ msgstr "--command 必須是第一個åƒæ•¸"
#: builtin/commit-graph.c
msgid ""
-"git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]"
+"git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]"
msgstr ""
-"git commit-graph verify [--object-dir <物件目錄>] [--shallow] [--"
-"[no-]progress]"
+"git commit-graph verify [--object-dir <目錄>] [--shallow] [--[no-]progress]"
#: builtin/commit-graph.c
msgid ""
-"git commit-graph write [--object-dir <objdir>] [--append] [--"
-"split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <n>] [--[no-]progress] <split options>"
-msgstr ""
-"git commit-graph write [--object-dir <objdir>] [--append] [--"
-"split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] [--changed-"
-"paths] [--[no-]max-new-filters <n>] [--[no-]progress] <split options>"
-
-#: builtin/commit-graph.c builtin/fetch.c builtin/log.c
+"git commit-graph write [--object-dir <dir>] [--append]\n"
+" [--split[=<strategy>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <split-options>"
+msgstr ""
+"git commit-graph write [--object-dir <dir>] [--append]\n"
+" [--split[=<strategy>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+" [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+" <split-options>"
+
+#: builtin/commit-graph.c builtin/fetch.c builtin/log.c builtin/repack.c
msgid "dir"
msgstr "目錄"
@@ -5266,6 +5422,11 @@ msgstr "無法開啟æ交圖形 '%s'"
#: builtin/commit-graph.c
#, c-format
+msgid "could not open commit-graph chain '%s'"
+msgstr "無法開啟æäº¤åœ–éˆ â€œ%sâ€"
+
+#: builtin/commit-graph.c
+#, c-format
msgid "unrecognized --split argument, %s"
msgstr "無法識別的 --split åƒæ•¸ï¼Œ%s"
@@ -5332,18 +5493,17 @@ msgstr "ä¸èƒ½åŒæ™‚使用 --reachableã€--stdin-commits 或 --stdin-packs"
msgid "Collecting commits from input"
msgstr "正在從輸入收集æ交"
-#: builtin/commit-graph.c builtin/multi-pack-index.c
-#, c-format
-msgid "unrecognized subcommand: %s"
-msgstr "未識別的å­æŒ‡ä»¤ï¼š%s"
+#: builtin/commit-tree.c
+msgid "git commit-tree <tree> [(-p <parent>)...]"
+msgstr "git commit-tree <tree> [(-p <parent>)...]"
#: builtin/commit-tree.c
msgid ""
-"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...] [(-F "
-"<file>)...] <tree>"
+"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]\n"
+" [(-F <file>)...] <tree>"
msgstr ""
-"git commit-tree [(-p <父æ交>)...] [-S[<keyid>]] [(-m <消æ¯>)...] [(-F <檔案"
-">)...] <樹>"
+"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]\n"
+" [(-F <file>)...] <tree>"
#: builtin/commit-tree.c
#, c-format
@@ -5400,12 +5560,30 @@ msgid "git commit-tree: failed to read"
msgstr "git commit-tree:讀å–失敗"
#: builtin/commit.c
-msgid "git commit [<options>] [--] <pathspec>..."
-msgstr "git commit [<é¸é …>] [--] <路徑è¦æ ¼>..."
+msgid ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|"
+"reword):]<commit>)]\n"
+" [-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n"
+" [--date=<date>] [--cleanup=<mode>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
+" [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|"
+"reword):]<commit>)]\n"
+" [-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n"
+" [--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n"
+" [--date=<date>] [--cleanup=<mode>] [--[no-]status]\n"
+" [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n"
+" [--] [<pathspec>...]"
#: builtin/commit.c
-msgid "git status [<options>] [--] <pathspec>..."
-msgstr "git status [<é¸é …>] [--] <路徑è¦æ ¼>..."
+msgid "git status [<options>] [--] [<pathspec>...]"
+msgstr "git status [<é¸é …>] [--] [<路徑è¦æ ¼>...]"
#: builtin/commit.c
msgid ""
@@ -5459,6 +5637,10 @@ msgstr ""
" git cherry-pick --skip\n"
"\n"
+#: builtin/commit.c read-cache.c
+msgid "updating files failed"
+msgstr "更新檔案失敗"
+
#: builtin/commit.c
msgid "failed to unpack HEAD tree object"
msgstr "解包 HEAD 樹狀物件失敗"
@@ -5484,10 +5666,6 @@ msgid "Failed to update main cache tree"
msgstr "ä¸èƒ½æ›´æ–°æ¨¹çš„主快å–"
#: builtin/commit.c
-msgid "unable to write new_index file"
-msgstr "無法寫 new_index 檔案"
-
-#: builtin/commit.c
msgid "cannot do a partial commit during a merge."
msgstr "在åˆä½µéŽç¨‹ä¸­ä¸èƒ½åšéƒ¨åˆ†æ交。"
@@ -5532,10 +5710,10 @@ msgid ""
"in the current commit message"
msgstr "無法é¸æ“‡ä¸€å€‹æœªè¢«ç›®å‰æ交說明使用的備註字元"
-#: builtin/commit.c
+#: builtin/commit.c builtin/merge-tree.c
#, c-format
-msgid "could not lookup commit %s"
-msgstr "ä¸èƒ½æŸ¥è©¢æ交 %s"
+msgid "could not lookup commit '%s'"
+msgstr "無法查詢æ交 “%sâ€"
#: builtin/commit.c builtin/shortlog.c
#, c-format
@@ -5747,7 +5925,7 @@ msgstr "顯示分支訊æ¯"
#: builtin/commit.c
msgid "show stash information"
-msgstr "顯示儲è—å€è¨Šæ¯"
+msgstr "顯示貯存å€è¨Šæ¯"
#: builtin/commit.c
msgid "compute full ahead/behind values"
@@ -5757,22 +5935,18 @@ msgstr "計算完整的領先/è½å¾Œå€¼"
msgid "version"
msgstr "版本"
-#: builtin/commit.c builtin/push.c builtin/worktree.c
+#: builtin/commit.c builtin/fetch.c builtin/push.c builtin/worktree.c
msgid "machine-readable output"
msgstr "機器å¯è®€çš„輸出"
#: builtin/commit.c
msgid "show status in long format (default)"
-msgstr "以長格å¼é¡¯ç¤ºç‹€æ…‹ï¼ˆé è¨­ï¼‰"
+msgstr "以長格å¼é¡¯ç¤ºç‹€æ…‹ï¼ˆé è¨­å€¼ï¼‰"
#: builtin/commit.c
msgid "terminate entries with NUL"
msgstr "æ¢ç›®ä»¥ NUL å­—å…ƒçµå°¾"
-#: builtin/commit.c builtin/fast-export.c builtin/rebase.c parse-options.h
-msgid "mode"
-msgstr "模å¼"
-
#: builtin/commit.c
msgid "show untracked files, optional modes: all, normal, no. (Default: all)"
msgstr "顯示未追蹤的檔案,「模å¼ã€çš„å¯é¸åƒæ•¸ï¼šallã€normalã€no。(é è¨­å€¼ï¼šall)"
@@ -5844,7 +6018,7 @@ msgstr "日期"
msgid "override date for commit"
msgstr "æ交時覆蓋日期"
-#: builtin/commit.c parse-options.h ref-filter.h
+#: builtin/commit.c builtin/merge-tree.c parse-options.h ref-filter.h
msgid "commit"
msgstr "æ交"
@@ -5985,17 +6159,17 @@ msgstr "æ交說明內文空白,中止æ交作業。\n"
#: builtin/commit.c
msgid ""
"repository has been updated, but unable to write\n"
-"new_index file. Check that disk is not full and quota is\n"
+"new index file. Check that disk is not full and quota is\n"
"not exceeded, and then \"git restore --staged :/\" to recover."
msgstr ""
-"版本庫已更新,但無法寫 new_index 檔案。檢查是å¦ç£ç¢Ÿå·²æ»¿æˆ–\n"
-"ç£ç¢Ÿé…é¡å·²è€—盡,然後執行 \"git restore --staged :/\" 復原。"
+"版本庫已更新,但無法寫入新的索引檔案。請檢查ç£ç¢Ÿæ˜¯å¦\n"
+"已滿或ç£ç¢Ÿé…é¡å·²è€—盡,然後執行 “git restore --staged :/†復原。"
#: builtin/config.c
msgid "git config [<options>]"
msgstr "git config [<é¸é …>]"
-#: builtin/config.c builtin/env--helper.c
+#: builtin/config.c
#, c-format
msgid "unrecognized --type argument, %s"
msgstr "無法識別的 --type åƒæ•¸ï¼Œ%s"
@@ -6024,7 +6198,7 @@ msgstr "使用版本庫級設定檔案"
msgid "use per-worktree config file"
msgstr "使用工作å€ç´šåˆ¥çš„設定檔案"
-#: builtin/config.c
+#: builtin/config.c builtin/gc.c
msgid "use given config file"
msgstr "使用指定的設定檔案"
@@ -6094,7 +6268,7 @@ msgstr "開啟一個編輯器"
#: builtin/config.c
msgid "find the color configured: slot [default]"
-msgstr "ç²å¾—設定的é¡è‰²ï¼šè¨­å®š [é è¨­]"
+msgstr "ç²å¾—設定的é¡è‰²ï¼šè¨­å®š [é è¨­å€¼]"
#: builtin/config.c
msgid "find the color setting: slot [stdout-is-tty]"
@@ -6104,11 +6278,11 @@ msgstr "ç²å¾—é¡è‰²è¨­å®šï¼šè¨­å®š [stdout-is-tty]"
msgid "Type"
msgstr "é¡žåž‹"
-#: builtin/config.c builtin/env--helper.c builtin/hash-object.c
+#: builtin/config.c builtin/hash-object.c
msgid "type"
msgstr "é¡žåž‹"
-#: builtin/config.c builtin/env--helper.c
+#: builtin/config.c
msgid "value is given this type"
msgstr "å–值為該類型"
@@ -6150,11 +6324,11 @@ msgstr "åªé¡¯ç¤ºè®Šæ•¸å"
#: builtin/config.c
msgid "respect include directives on lookup"
-msgstr "查詢時åƒç…§ include 指令éžè¿´å°‹æ‰¾"
+msgstr "查詢時引用 include 指令éžè¿´å°‹æ‰¾"
#: builtin/config.c
msgid "show origin of config (file, standard input, blob, command line)"
-msgstr "顯示設定的來æºï¼ˆæª”案ã€æ¨™æº–輸入ã€è³‡æ–™ç‰©ä»¶ï¼Œæˆ–指令列)"
+msgstr "顯示設定的來æºï¼ˆæª”案ã€æ¨™æº–輸入ã€è³‡æ–™ç‰©ä»¶ï¼Œæˆ–命令列)"
#: builtin/config.c
msgid "show scope of config (worktree, local, global, system, command)"
@@ -6162,7 +6336,7 @@ msgstr ""
"顯示設定檔的作用域 (å·¥ä½œå€ worktreeã€æœ¬æ©Ÿ localã€å…¨åŸŸ globalã€ç³»çµ± systemã€æŒ‡"
"令 command)"
-#: builtin/config.c builtin/env--helper.c
+#: builtin/config.c
msgid "value"
msgstr "å–值"
@@ -6247,7 +6421,7 @@ msgstr "--blob åªèƒ½åœ¨ä¸€å€‹ç‰ˆæœ¬åº«å…§ä½¿ç”¨"
msgid "--worktree can only be used inside a git repository"
msgstr "--worktree åªèƒ½åœ¨ git 版本庫中使用"
-#: builtin/config.c
+#: builtin/config.c builtin/gc.c
msgid "$HOME not set"
msgstr "$HOME 未設定"
@@ -6357,12 +6531,20 @@ msgid "unable to get credential storage lock in %d ms"
msgstr "無法在 %d 毫秒內å–得憑證儲存空間的鎖"
#: builtin/describe.c
-msgid "git describe [<options>] [<commit-ish>...]"
-msgstr "git describe [<é¸é …>] [<æ交號>...]"
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"
#: builtin/describe.c
-msgid "git describe [<options>] --dirty"
-msgstr "git describe [<é¸é …>] --dirty"
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]"
+msgstr ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]"
+
+#: builtin/describe.c
+msgid "git describe <blob>"
+msgstr "git describe <blob>"
#: builtin/describe.c
msgid "head"
@@ -6513,6 +6695,26 @@ msgstr "沒有發ç¾å稱,無法æ述任何æ±è¥¿ã€‚"
msgid "option '%s' and commit-ishes cannot be used together"
msgstr "「%sã€é¸é …å’Œæ交號ä¸å¾—åŒæ™‚使用"
+#: builtin/diagnose.c
+msgid ""
+"git diagnose [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--mode=<mode>]"
+msgstr ""
+"git diagnose [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+" [--mode=<mode>]"
+
+#: builtin/diagnose.c
+msgid "specify a destination for the diagnostics archive"
+msgstr "請指定診斷å°å­˜æª”的目的地"
+
+#: builtin/diagnose.c
+msgid "specify a strftime format suffix for the filename"
+msgstr "請指定檔案å稱的 strftime æ ¼å¼å¾Œç¶´"
+
+#: builtin/diagnose.c
+msgid "specify the content of the diagnostic archive"
+msgstr "指定診斷å°å­˜æª”的內容"
+
#: builtin/diff-tree.c
msgid "--merge-base only works with two commits"
msgstr "--merge-base åªå° 2 個以上的æ交有用"
@@ -6523,6 +6725,10 @@ msgid "'%s': not a regular file or symlink"
msgstr "'%s':ä¸æ˜¯ä¸€å€‹æ­£è¦æª”案或符號連çµ"
#: builtin/diff.c
+msgid "no merge given, only parents."
+msgstr "沒有æä¾›åˆä½µæ交,åªæœ‰æ供父æ交。"
+
+#: builtin/diff.c
#, c-format
msgid "invalid option: %s"
msgstr "無效é¸é …:%s"
@@ -6665,30 +6871,6 @@ msgstr "沒有為 --tool=<工具> åƒæ•¸æä¾› <工具>"
msgid "no <cmd> given for --extcmd=<cmd>"
msgstr "沒有為 --extcmd=<命令> åƒæ•¸æä¾› <命令>"
-#: builtin/env--helper.c
-msgid "git env--helper --type=[bool|ulong] <options> <env-var>"
-msgstr "git env--helper --type=[bool|ulong] <é¸é …> <環境變數>"
-
-#: builtin/env--helper.c
-msgid "default for git_env_*(...) to fall back on"
-msgstr "git_env_*(...) çš„é è¨­å€¼"
-
-#: builtin/env--helper.c
-msgid "be quiet only use git_env_*() value as exit code"
-msgstr "安éœæ¨¡å¼ï¼Œåªä½¿ç”¨ git_env_*() 的值作為離開碼"
-
-#: builtin/env--helper.c
-#, c-format
-msgid "option `--default' expects a boolean value with `--type=bool`, not `%s`"
-msgstr "é¸é …「--defaultã€é æœŸæ”¶åˆ°ã€Œ--type=boolã€çš„布林值,而éžã€Œ%sã€"
-
-#: builtin/env--helper.c
-#, c-format
-msgid ""
-"option `--default' expects an unsigned long value with `--type=ulong`, not `"
-"%s`"
-msgstr "é¸é …「--defaultã€é æœŸæ”¶åˆ°ã€Œ--type=ulongã€çš„無號 long 數值,而éžã€Œ%sã€"
-
#: builtin/fast-export.c
msgid "git fast-export [<rev-list-opts>]"
msgstr "git fast-export [<rev-list-opts>]"
@@ -6831,147 +7013,17 @@ msgstr "git fetch --all [<é¸é …>]"
msgid "fetch.parallel cannot be negative"
msgstr "fetch.parallel ä¸èƒ½ç‚ºè² æ•¸"
-#: builtin/fetch.c builtin/pull.c
-msgid "fetch from all remotes"
-msgstr "從所有的é ç«¯æŠ“å–"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "set upstream for git pull/fetch"
-msgstr "為 git pull/fetch 設定上游"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "追加到 .git/FETCH_HEAD 而ä¸æ˜¯è¦†è“‹å®ƒ"
-
-#: builtin/fetch.c
-msgid "use atomic transaction to update references"
-msgstr "使用 atomic 事務更新引用"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "path to upload pack on remote end"
-msgstr "上傳包到é ç«¯çš„路徑"
-
-#: builtin/fetch.c
-msgid "force overwrite of local reference"
-msgstr "強制覆蓋本機引用"
-
-#: builtin/fetch.c
-msgid "fetch from multiple remotes"
-msgstr "從多個é ç«¯æŠ“å–"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "fetch all tags and associated objects"
-msgstr "抓å–所有的標籤和關è¯ç‰©ä»¶"
-
-#: builtin/fetch.c
-msgid "do not fetch all tags (--no-tags)"
-msgstr "ä¸æŠ“å–任何標籤(--no-tags)"
-
-#: builtin/fetch.c
-msgid "number of submodules fetched in parallel"
-msgstr "並行å–å¾—çš„å­æ¨¡çµ„數é‡"
-
-#: builtin/fetch.c
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr "修改引用è¦æ ¼ (refspec) 以便將所有引用 (refs) 放置在 refs/prefetch/ 中"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "prune remote-tracking branches no longer on remote"
-msgstr "清除é ç«¯å·²ç¶“ä¸å­˜åœ¨çš„分支的追蹤分支"
-
-#: builtin/fetch.c
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr "清除é ç«¯ä¸å­˜åœ¨çš„本機標籤,並且å–代變更標籤"
-
-# 譯者:å¯é¸å€¼ï¼Œä¸èƒ½ç¿»è­¯
-#: builtin/fetch.c builtin/pull.c
-msgid "on-demand"
-msgstr "on-demand"
-
-#: builtin/fetch.c
-msgid "control recursive fetching of submodules"
-msgstr "控制å­æ¨¡çµ„çš„éžè¿´æŠ“å–"
-
-#: builtin/fetch.c
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "å°‡å–得的引用寫入 FETCH_HEAD 檔案"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "keep downloaded pack"
-msgstr "ä¿æŒä¸‹è¼‰åŒ…"
-
-#: builtin/fetch.c
-msgid "allow updating of HEAD ref"
-msgstr "å…許更新 HEAD 引用"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "deepen history of shallow clone"
-msgstr "å–得淺複製的更多éŽåŽ»æ­·å²è¨˜éŒ„"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "deepen history of shallow repository based on time"
-msgstr "基於時間來深化淺複製的歷å²"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "convert to a complete repository"
-msgstr "轉æ›ç‚ºä¸€å€‹å®Œæ•´çš„版本庫"
-
-#: builtin/fetch.c
-msgid "re-fetch without negotiating common commits"
-msgstr "é‡æ–°æŠ“å–而ä¸å”商共åŒæ交"
-
-#: builtin/fetch.c
-msgid "prepend this to submodule path output"
-msgstr "在å­æ¨¡çµ„路徑輸出的å‰é¢åŠ ä¸Šæ­¤ç›®éŒ„"
-
-#: builtin/fetch.c
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr "éžè¿´å–å¾—å­æ¨¡çµ„çš„é è¨­å€¼ï¼ˆæ¯”設定檔案優先度低)"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "accept refs that update .git/shallow"
-msgstr "接å—æ›´æ–° .git/shallow 的引用"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "refmap"
-msgstr "引用映射"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "specify fetch refmap"
-msgstr "指定å–得動作的引用映射"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "report that we have only objects reachable from this object"
-msgstr "報告我們åªæ“有從該物件開始å¯ä»¥å–得的物件"
-
-#: builtin/fetch.c
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr "ä¸å–å¾— packfile,而是輸出å”商的祖先æ交"
-
-#: builtin/fetch.c
-msgid "run 'maintenance --auto' after fetching"
-msgstr "å–å¾— (fetch) 後執行 'maintenance --auto'"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "check for forced-updates on all updated branches"
-msgstr "在所有更新分支上檢查強制更新"
-
-#: builtin/fetch.c
-msgid "write the commit-graph after fetching"
-msgstr "抓å–後寫入分支圖"
-
-#: builtin/fetch.c
-msgid "accept refspecs from stdin"
-msgstr "從標準輸入中接å—引用è¦æ ¼"
-
#: builtin/fetch.c
msgid "couldn't find remote ref HEAD"
msgstr "找ä¸åˆ°é ç«¯ HEAD 引用"
#: builtin/fetch.c
#, c-format
+msgid "From %.*s\n"
+msgstr "來自 %.*s\n"
+
+#: builtin/fetch.c
+#, c-format
msgid "object %s not found"
msgstr "物件 %s 未發ç¾"
@@ -6984,12 +7036,8 @@ msgid "[rejected]"
msgstr "[已拒絕]"
#: builtin/fetch.c
-msgid "can't fetch in current branch"
-msgstr "ç›®å‰åˆ†æ”¯ä¸‹ä¸èƒ½åŸ·è¡Œå–得動作"
-
-#: builtin/fetch.c
-msgid "checked out in another worktree"
-msgstr "已在其他工作å€ç°½å‡º"
+msgid "can't fetch into checked-out branch"
+msgstr "無法抓å–至已簽出分支"
#: builtin/fetch.c
msgid "[tag update]"
@@ -7061,11 +7109,6 @@ msgstr "已拒絕 %s,ä¸å…許更新淺複製"
#: builtin/fetch.c
#, c-format
-msgid "From %.*s\n"
-msgstr "來自 %.*s\n"
-
-#: builtin/fetch.c
-#, c-format
msgid ""
"some local refs could not be updated; try running\n"
" 'git remote prune %s' to remove any old, conflicting branches"
@@ -7177,6 +7220,141 @@ msgstr ""
msgid "you need to specify a tag name"
msgstr "您需è¦æŒ‡å®šæ¨™ç±¤å稱"
+#: builtin/fetch.c builtin/pull.c
+msgid "fetch from all remotes"
+msgstr "從所有的é ç«¯æŠ“å–"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "set upstream for git pull/fetch"
+msgstr "為 git pull/fetch 設定上游"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "追加到 .git/FETCH_HEAD 而ä¸æ˜¯è¦†è“‹å®ƒ"
+
+#: builtin/fetch.c
+msgid "use atomic transaction to update references"
+msgstr "使用 atomic 事務更新引用"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "path to upload pack on remote end"
+msgstr "上傳包到é ç«¯çš„路徑"
+
+#: builtin/fetch.c
+msgid "force overwrite of local reference"
+msgstr "強制覆蓋本機引用"
+
+#: builtin/fetch.c
+msgid "fetch from multiple remotes"
+msgstr "從多個é ç«¯æŠ“å–"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "fetch all tags and associated objects"
+msgstr "抓å–所有的標籤和關è¯ç‰©ä»¶"
+
+#: builtin/fetch.c
+msgid "do not fetch all tags (--no-tags)"
+msgstr "ä¸æŠ“å–任何標籤(--no-tags)"
+
+#: builtin/fetch.c
+msgid "number of submodules fetched in parallel"
+msgstr "並行å–å¾—çš„å­æ¨¡çµ„數é‡"
+
+#: builtin/fetch.c
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr "修改引用è¦æ ¼ (refspec) 以便將所有引用 (refs) 放置在 refs/prefetch/ 中"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "prune remote-tracking branches no longer on remote"
+msgstr "清除é ç«¯å·²ç¶“ä¸å­˜åœ¨çš„分支的追蹤分支"
+
+#: builtin/fetch.c
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr "清除é ç«¯ä¸å­˜åœ¨çš„本機標籤,並且å–代變更標籤"
+
+# 譯者:å¯é¸å€¼ï¼Œä¸èƒ½ç¿»è­¯
+#: builtin/fetch.c builtin/pull.c
+msgid "on-demand"
+msgstr "on-demand"
+
+#: builtin/fetch.c
+msgid "control recursive fetching of submodules"
+msgstr "控制å­æ¨¡çµ„çš„éžè¿´æŠ“å–"
+
+#: builtin/fetch.c
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "å°‡å–得的引用寫入 FETCH_HEAD 檔案"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "keep downloaded pack"
+msgstr "ä¿æŒä¸‹è¼‰åŒ…"
+
+#: builtin/fetch.c
+msgid "allow updating of HEAD ref"
+msgstr "å…許更新 HEAD 引用"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "deepen history of shallow clone"
+msgstr "å–得淺複製的更多éŽåŽ»æ­·å²è¨˜éŒ„"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "deepen history of shallow repository based on time"
+msgstr "基於時間來深化淺複製的歷å²"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "convert to a complete repository"
+msgstr "轉æ›ç‚ºä¸€å€‹å®Œæ•´çš„版本庫"
+
+#: builtin/fetch.c
+msgid "re-fetch without negotiating common commits"
+msgstr "é‡æ–°æŠ“å–而ä¸å”商共åŒæ交"
+
+#: builtin/fetch.c
+msgid "prepend this to submodule path output"
+msgstr "在å­æ¨¡çµ„路徑輸出的å‰é¢åŠ ä¸Šæ­¤ç›®éŒ„"
+
+#: builtin/fetch.c
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr "éžè¿´å–å¾—å­æ¨¡çµ„çš„é è¨­å€¼ï¼ˆæ¯”設定檔案優先度低)"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "accept refs that update .git/shallow"
+msgstr "接å—æ›´æ–° .git/shallow 的引用"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "refmap"
+msgstr "引用映射"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "specify fetch refmap"
+msgstr "指定å–得動作的引用映射"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "report that we have only objects reachable from this object"
+msgstr "報告我們åªæ“有從該物件開始å¯ä»¥å–得的物件"
+
+#: builtin/fetch.c
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr "ä¸å–å¾— packfile,而是輸出å”商的祖先æ交"
+
+#: builtin/fetch.c
+msgid "run 'maintenance --auto' after fetching"
+msgstr "å–å¾— (fetch) 後執行 'maintenance --auto'"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "check for forced-updates on all updated branches"
+msgstr "在所有更新分支上檢查強制更新"
+
+#: builtin/fetch.c
+msgid "write the commit-graph after fetching"
+msgstr "抓å–後寫入分支圖"
+
+#: builtin/fetch.c
+msgid "accept refspecs from stdin"
+msgstr "從標準輸入中接å—引用è¦æ ¼"
+
#: builtin/fetch.c
msgid "--negotiate-only needs one or more --negotiation-tip=*"
msgstr "--negotiate-only 需è¦ä¸€æˆ–多個 --negotiation-tip=*"
@@ -7190,6 +7368,11 @@ msgid "--unshallow on a complete repository does not make sense"
msgstr "å°æ–¼ä¸€å€‹å®Œæ•´çš„版本庫,åƒæ•¸ --unshallow 沒有æ„義"
#: builtin/fetch.c
+#, c-format
+msgid "failed to fetch bundles from '%s'"
+msgstr "無法自「%sã€æŠ“å–套件包"
+
+#: builtin/fetch.c
msgid "fetch --all does not take a repository argument"
msgstr "fetch --all ä¸èƒ½å¸¶ä¸€å€‹ç‰ˆæœ¬åº«åƒæ•¸"
@@ -7317,9 +7500,17 @@ msgstr "åªåˆ—å°åŒ…å«è©²æ交的引用"
msgid "print only refs which don't contain the commit"
msgstr "åªåˆ—å°ä¸åŒ…å«è©²æ交的引用"
+#: builtin/for-each-ref.c
+msgid "read reference patterns from stdin"
+msgstr "從 stdin 讀å–引用模å¼"
+
+#: builtin/for-each-ref.c
+msgid "unknown arguments supplied with --stdin"
+msgstr "為 --stdin æ供的引數未知"
+
#: builtin/for-each-repo.c
-msgid "git for-each-repo --config=<config> <command-args>"
-msgstr "git for-each-repo --config=<設定> <命令引數>"
+msgid "git for-each-repo --config=<config> [--] <arguments>"
+msgstr "git for-each-repo --config=<config> [--] <arguments>"
#: builtin/for-each-repo.c
msgid "config"
@@ -7333,6 +7524,11 @@ msgstr "儲存版本庫路徑清單的設定éµ"
msgid "missing --config=<config>"
msgstr "缺少 --config=<設定>"
+#: builtin/for-each-repo.c
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "收到無效的組態 --config=%s"
+
#: builtin/fsck.c
msgid "unknown"
msgstr "未知"
@@ -7518,21 +7714,45 @@ msgid "notice: %s points to an unborn branch (%s)"
msgstr "注æ„:%s 指å‘一個尚未誕生的分支(%s)"
#: builtin/fsck.c
-msgid "Checking cache tree"
-msgstr "正在檢查快å–樹"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "正在檢查 %s çš„å¿«å–樹"
#: builtin/fsck.c
#, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "%s:cache-tree 中無效的 sha1 指標"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s:%s 的 cache-tree 中的 sha1 指標無效"
#: builtin/fsck.c
msgid "non-tree in cache-tree"
msgstr "cache-tree 中éžæ¨¹ç‹€ç‰©ä»¶"
#: builtin/fsck.c
-msgid "git fsck [<options>] [<object>...]"
-msgstr "git fsck [<é¸é …>] [<物件>...]"
+#, c-format
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s:%s 的 resolve-undo 中的 sha1 指標無效"
+
+#: builtin/fsck.c
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "ç„¡æ³•è®€å– â€œ%s†å°è£çš„修訂版索引 (rev-index)"
+
+#: builtin/fsck.c
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "“%s†å°è£çš„修訂版索引 (rev-index) 無效"
+
+#: builtin/fsck.c
+msgid ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<object>...]"
+msgstr ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+" [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+" [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+" [--[no-]name-objects] [<object>...]"
#: builtin/fsck.c
msgid "show unreachable objects"
@@ -7556,7 +7776,7 @@ msgstr "將索引亦作為檢查的頭節點"
#: builtin/fsck.c
msgid "make reflogs head nodes (default)"
-msgstr "將引用日誌作為檢查的 HEAD 節點(é è¨­ï¼‰"
+msgstr "將引用日誌作為檢查的 HEAD 節點(é è¨­å€¼ï¼‰"
#: builtin/fsck.c
msgid "also consider packs and alternate objects"
@@ -7605,14 +7825,6 @@ msgid "git fsmonitor--daemon run [<options>]"
msgstr "git fsmonitor--daemon run [<options>]"
#: builtin/fsmonitor--daemon.c
-msgid "git fsmonitor--daemon stop"
-msgstr "git fsmonitor--daemon stop"
-
-#: builtin/fsmonitor--daemon.c
-msgid "git fsmonitor--daemon status"
-msgstr "git fsmonitor--daemon status"
-
-#: builtin/fsmonitor--daemon.c
#, c-format
msgid "value of '%s' out of range: %d"
msgstr "「%sã€çš„數值超出範åœï¼š%d"
@@ -7712,7 +7924,7 @@ msgstr "è¦ç­‰å¾…背景守護程å¼å•Ÿå‹•çš„最長秒數"
msgid "invalid 'ipc-threads' value (%d)"
msgstr "無效的「ipc-threadsã€æ•¸å€¼ï¼ˆ%d)"
-#: builtin/fsmonitor--daemon.c
+#: builtin/fsmonitor--daemon.c t/helper/test-cache-tree.c
#, c-format
msgid "Unhandled subcommand '%s'"
msgstr "未處ç†çš„å­å‘½ä»¤ã€Œ%sã€"
@@ -7735,7 +7947,7 @@ msgstr "å° %s å‘¼å« fstat 失敗:%s"
msgid "failed to parse '%s' value '%s'"
msgstr "ç„¡æ³•è§£æž '%s' 值 '%s'"
-#: builtin/gc.c builtin/init-db.c
+#: builtin/gc.c setup.c
#, c-format
msgid "cannot stat '%s'"
msgstr "ä¸èƒ½å° '%s' å‘¼å« stat"
@@ -7760,7 +7972,11 @@ msgstr "清除未引用的物件"
#: builtin/gc.c
msgid "pack unreferenced objects separately"
-msgstr "ç¨ç«‹å°è£ç„¡åƒç…§ç‰©ä»¶"
+msgstr "ç¨ç«‹å°è£ç„¡å¼•ç”¨ç‰©ä»¶"
+
+#: builtin/gc.c builtin/repack.c
+msgid "with --cruft, limit the size of new cruft packs"
+msgstr "æ­é… --cruft,é™åˆ¶æ–°å»¢æ£„å°è£çš„大å°"
#: builtin/gc.c
msgid "be more thorough (increased runtime)"
@@ -7911,8 +8127,23 @@ msgid "use at most one of --auto and --schedule=<frequency>"
msgstr "--auto å’Œ --schedule=<頻率> è«‹ä»»é¸ä¸€"
#: builtin/gc.c
-msgid "failed to run 'git config'"
-msgstr "無法執行 ‘git config’"
+#, c-format
+msgid "unable to add '%s' value of '%s'"
+msgstr "無法為「%2$sã€çš„值加上「%1$sã€"
+
+#: builtin/gc.c
+msgid "return success even if repository was not registered"
+msgstr "å³ä¾¿ç‰ˆæœ¬åº«æœªè¨»å†Šä»å›žå‚³æˆåŠŸç‹€æ…‹"
+
+#: builtin/gc.c
+#, c-format
+msgid "unable to unset '%s' value of '%s'"
+msgstr "無法å–消設定「%2$sã€çš„「%1$sã€å€¼"
+
+#: builtin/gc.c
+#, c-format
+msgid "repository '%s' is not registered"
+msgstr "版本庫「%sã€æœªè¨»å†Š"
#: builtin/gc.c
#, c-format
@@ -7946,24 +8177,20 @@ msgid "failed to run 'crontab -l'; your system might not support 'cron'"
msgstr "無法執行 “crontab -lâ€ï¼›æ‚¨çš„系統å¯èƒ½ä¸æ”¯æ´ “cronâ€"
#: builtin/gc.c
-msgid "failed to run 'crontab'; your system might not support 'cron'"
-msgstr "無法執行 “crontabâ€ï¼›æ‚¨çš„系統å¯èƒ½ä¸æ”¯æ´ “cronâ€"
-
-#: builtin/gc.c
-msgid "failed to open stdin of 'crontab'"
-msgstr "無法開啟 ‘crontab’ 的標準輸入"
+msgid "failed to create crontab temporary file"
+msgstr "無法建立 crontab 暫存檔"
#: builtin/gc.c
-msgid "'crontab' died"
-msgstr "“crontab†çµæŸé‹ä½œ"
+msgid "failed to open temporary file"
+msgstr "無法開啟暫存檔"
#: builtin/gc.c
-msgid "failed to start systemctl"
-msgstr "無法啟動 systemctl"
+msgid "failed to run 'crontab'; your system might not support 'cron'"
+msgstr "無法執行 “crontabâ€ï¼›æ‚¨çš„系統å¯èƒ½ä¸æ”¯æ´ “cronâ€"
#: builtin/gc.c
-msgid "failed to run systemctl"
-msgstr "無法執行 systemctl"
+msgid "'crontab' died"
+msgstr "“crontab†çµæŸé‹ä½œ"
#: builtin/gc.c builtin/worktree.c
#, c-format
@@ -7976,6 +8203,14 @@ msgid "failed to flush '%s'"
msgstr "排清 '%s' 失敗"
#: builtin/gc.c
+msgid "failed to start systemctl"
+msgstr "無法啟動 systemctl"
+
+#: builtin/gc.c
+msgid "failed to run systemctl"
+msgstr "無法執行 systemctl"
+
+#: builtin/gc.c
#, c-format
msgid "unrecognized --scheduler argument '%s'"
msgstr "無法識別的 --scheduler 引數 '%s'"
@@ -8006,6 +8241,10 @@ msgid "scheduler to trigger git maintenance run"
msgstr "è¦è§¸ç™¼ git maintenance run 的排程器"
#: builtin/gc.c
+msgid "failed to set up maintenance schedule"
+msgstr "無法設定維護排程"
+
+#: builtin/gc.c
msgid "failed to add repo to global config"
msgstr "無法將版本庫加至全域設定"
@@ -8013,11 +8252,6 @@ msgstr "無法將版本庫加至全域設定"
msgid "git maintenance <subcommand> [<options>]"
msgstr "git maintenance <å­å‘½ä»¤> [<é¸é …>]"
-#: builtin/gc.c
-#, c-format
-msgid "invalid subcommand: %s"
-msgstr "無效å­å‘½ä»¤ï¼š%s"
-
#: builtin/grep.c
msgid "git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]"
msgstr "git grep [<é¸é …>] [-e] <模å¼> [<版本>...] [[--] <路徑>...]"
@@ -8048,6 +8282,11 @@ msgstr "無法讀å–樹(%s)"
#: builtin/grep.c
#, c-format
+msgid "unable to read tree %s"
+msgstr "ç„¡æ³•è®€å– %s 樹狀物件"
+
+#: builtin/grep.c
+#, c-format
msgid "unable to grep from object of type %s"
msgstr "無法抓å–來自於 %s 類型的物件"
@@ -8103,11 +8342,11 @@ msgstr "用 textconv éŽæ¿¾å™¨è™•ç†äºŒé€²ä½æª”案"
#: builtin/grep.c
msgid "search in subdirectories (default)"
-msgstr "在å­ç›®éŒ„中尋找(é è¨­ï¼‰"
+msgstr "在å­ç›®éŒ„中尋找(é è¨­å€¼ï¼‰"
#: builtin/grep.c
-msgid "descend at most <depth> levels"
-msgstr "最多以指定的深度å‘下尋找"
+msgid "descend at most <n> levels"
+msgstr "最多å‘下尋找 <n> 層"
#: builtin/grep.c
msgid "use extended POSIX regular expressions"
@@ -8115,7 +8354,7 @@ msgstr "使用延伸的 POSIX 常è¦è¡¨ç¤ºå¼"
#: builtin/grep.c
msgid "use basic POSIX regular expressions (default)"
-msgstr "使用基本的 POSIX 常è¦è¡¨ç¤ºå¼ï¼ˆé è¨­ï¼‰"
+msgstr "使用基本的 POSIX 常è¦è¡¨ç¤ºå¼ï¼ˆé è¨­å€¼ï¼‰"
#: builtin/grep.c
msgid "interpret patterns as fixed strings"
@@ -8242,6 +8481,10 @@ msgid "allow calling of grep(1) (ignored by this build)"
msgstr "å…è¨±å‘¼å« grep(1)(本次組建忽略)"
#: builtin/grep.c
+msgid "maximum number of results per file"
+msgstr "æ¯å€‹æª”案的最多çµæžœæ•¸"
+
+#: builtin/grep.c
msgid "no pattern given"
msgstr "未æ供符åˆæ¨¡å¼"
@@ -8285,11 +8528,15 @@ msgstr "åŒæ™‚給出了 --cached 和樹狀物件"
#: builtin/hash-object.c
msgid ""
-"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] "
-"[--] <file>..."
+"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
+" [--stdin [--literally]] [--] <file>..."
msgstr ""
-"git hash-object [-t <類型>] [-w] [--path=<檔案> | --no-filters] [--stdin] "
-"[--] <檔案>..."
+"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
+" [--stdin [--literally]] [--] <file>..."
+
+#: builtin/hash-object.c
+msgid "git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]"
+msgstr "git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]"
#: builtin/hash-object.c
msgid "object type"
@@ -8353,12 +8600,20 @@ msgid "print list of useful guides"
msgstr "顯示有用的指å—列表"
#: builtin/help.c
+msgid "print list of user-facing repository, command and file interfaces"
+msgstr "輸出é¢å‘使用者的版本庫ã€å‘½ä»¤ï¼Œå’Œæª”案介é¢æ¸…å–®"
+
+#: builtin/help.c
+msgid "print list of file formats, protocols and other developer interfaces"
+msgstr "輸出檔案格å¼ã€é€šè¨Šå”定和其他開發者介é¢çš„清單"
+
+#: builtin/help.c
msgid "print all configuration variable names"
msgstr "列å°æ‰€æœ‰è¨­å®šè®Šæ•¸å稱"
#: builtin/help.c
-msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>]"
-msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>]"
+msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"
+msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"
#: builtin/help.c
#, c-format
@@ -8444,13 +8699,21 @@ msgid "'git help config' for more information"
msgstr "'git help config' å–得更多訊æ¯"
#: builtin/hook.c
-msgid "git hook run [--ignore-missing] <hook-name> [-- <hook-args>]"
-msgstr "git hook run [--ignore-missing] <hook-name> [-- <hook-args>]"
+msgid ""
+"git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-"
+"args>]"
+msgstr ""
+"git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-"
+"args>]"
#: builtin/hook.c
msgid "silently ignore missing requested <hook-name>"
msgstr "éœé»˜å¿½ç•¥ä¸å­˜åœ¨è€Œè«‹æ±‚çš„ <hook-name>"
+#: builtin/hook.c
+msgid "file to read into hooks' stdin"
+msgstr "è¦è®€é€²æŽ›é‰¤ stdin 的檔案"
+
#: builtin/index-pack.c
#, c-format
msgid "object type mismatch at %s"
@@ -8544,11 +8807,6 @@ msgstr "解壓縮嚴é‡çš„ä¸ä¸€è‡´"
msgid "SHA1 COLLISION FOUND WITH %s !"
msgstr "ç™¼ç¾ %s å‡ºç¾ SHA1 è¡çªï¼"
-#: builtin/index-pack.c builtin/pack-objects.c
-#, c-format
-msgid "unable to read %s"
-msgstr "ä¸èƒ½è®€ %s"
-
#: builtin/index-pack.c
#, c-format
msgid "cannot read existing object info %s"
@@ -8701,7 +8959,7 @@ msgstr "無法返回目å‰å·¥ä½œç›®éŒ„"
msgid "bad %s"
msgstr "錯誤é¸é … %s"
-#: builtin/index-pack.c builtin/init-db.c
+#: builtin/index-pack.c builtin/init-db.c setup.c
#, c-format
msgid "unknown hash algorithm '%s'"
msgstr "未知的「%sã€é›œæ¹Šç®—法"
@@ -8719,101 +8977,18 @@ msgid "fsck error in pack objects"
msgstr "在打包物件中 fsck 檢查發生錯誤"
#: builtin/init-db.c
-#, c-format
-msgid "cannot stat template '%s'"
-msgstr "ä¸èƒ½å°ç¯„本 '%s' å‘¼å« stat"
-
-#: builtin/init-db.c
-#, c-format
-msgid "cannot opendir '%s'"
-msgstr "ä¸èƒ½é–‹å•Ÿç›®éŒ„ '%s'"
-
-#: builtin/init-db.c
-#, c-format
-msgid "cannot readlink '%s'"
-msgstr "ä¸èƒ½è®€å–é€£çµ '%s'"
-
-#: builtin/init-db.c
-#, c-format
-msgid "cannot symlink '%s' '%s'"
-msgstr "ä¸èƒ½è‡ª '%s' 到 '%s' 建立符號連çµ"
-
-#: builtin/init-db.c
-#, c-format
-msgid "cannot copy '%s' to '%s'"
-msgstr "ä¸èƒ½è¤‡è£½ '%s' 至 '%s'"
-
-#: builtin/init-db.c
-#, c-format
-msgid "ignoring template %s"
-msgstr "忽略範本 %s"
-
-#: builtin/init-db.c
-#, c-format
-msgid "templates not found in %s"
-msgstr "沒有在 %s 中找到範本"
-
-#: builtin/init-db.c
-#, c-format
-msgid "not copying templates from '%s': %s"
-msgstr "沒有從 '%s' 複製範本:%s"
-
-#: builtin/init-db.c
-#, c-format
-msgid "invalid initial branch name: '%s'"
-msgstr "無效的åˆå§‹åˆ†æ”¯å稱:'%s'"
-
-#: builtin/init-db.c
-#, c-format
-msgid "unable to handle file type %d"
-msgstr "ä¸èƒ½è™•ç† %d 類型的檔案"
-
-#: builtin/init-db.c
-#, c-format
-msgid "unable to move %s to %s"
-msgstr "ä¸èƒ½ç§»å‹• %s 至 %s"
-
-#: builtin/init-db.c
-msgid "attempt to reinitialize repository with different hash"
-msgstr "嘗試以ä¸åŒçš„雜湊值é‡æ–°åˆå§‹åŒ–版本庫"
-
-#: builtin/init-db.c
-#, c-format
-msgid "%s already exists"
-msgstr "%s 已經存在"
-
-#: builtin/init-db.c
-#, c-format
-msgid "re-init: ignored --initial-branch=%s"
-msgstr "re-init: 忽略 --initial-branch=%s"
-
-#: builtin/init-db.c
-#, c-format
-msgid "Reinitialized existing shared Git repository in %s%s\n"
-msgstr "é‡æ–°åˆå§‹åŒ–已存在的共享 Git 版本庫於 %s%s\n"
-
-#: builtin/init-db.c
-#, c-format
-msgid "Reinitialized existing Git repository in %s%s\n"
-msgstr "é‡æ–°åˆå§‹åŒ–已存在的 Git 版本庫於 %s%s\n"
-
-#: builtin/init-db.c
-#, c-format
-msgid "Initialized empty shared Git repository in %s%s\n"
-msgstr "å·²åˆå§‹åŒ–空的共享 Git 版本庫於 %s%s\n"
-
-#: builtin/init-db.c
-#, c-format
-msgid "Initialized empty Git repository in %s%s\n"
-msgstr "å·²åˆå§‹åŒ–空的 Git 版本庫於 %s%s\n"
-
-#: builtin/init-db.c
msgid ""
-"git init [-q | --quiet] [--bare] [--template=<template-directory>] [--"
-"shared[=<permissions>]] [<directory>]"
+"git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
+" [--separate-git-dir <git-dir>] [--object-format=<format>]\n"
+" [--ref-format=<format>]\n"
+" [-b <branch-name> | --initial-branch=<branch-name>]\n"
+" [--shared[=<permissions>]] [<directory>]"
msgstr ""
-"git init [-q | --quiet] [--bare] [--template=<範本目錄>] [--shared[=<權é™>]] "
-"[<目錄>]"
+"git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
+" [--separate-git-dir <git-dir>] [--object-format=<format>]\n"
+" [--ref-format=<format>]\n"
+" [-b <branch-name> | --initial-branch=<branch-name>]\n"
+" [--shared[=<permissions>]] [<directory>]"
#: builtin/init-db.c
msgid "permissions"
@@ -8863,11 +9038,13 @@ msgstr "--separate-git-dir 與純版本庫ä¸ç›¸å®¹"
#: builtin/interpret-trailers.c
msgid ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer "
-"<token>[(=|:)<value>])...] [<file>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<key>|<keyAlias>)[(=|:)<value>])...]\n"
+" [--parse] [<file>...]"
msgstr ""
-"git interpret-trailers [--in-place] [--trim-empty] [(--trailer <éµ>[(=|:)<值"
-">])...] [<檔案>...]"
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+" [(--trailer (<key>|<keyAlias>)[(=|:)<value>])...]\n"
+" [--parse] [<file>...]"
#: builtin/interpret-trailers.c
msgid "edit files in place"
@@ -8878,6 +9055,10 @@ msgid "trim empty trailers"
msgstr "刪除空的尾部署å"
#: builtin/interpret-trailers.c
+msgid "placement"
+msgstr "placement"
+
+#: builtin/interpret-trailers.c
msgid "where to place the new trailer"
msgstr "在哪裡放置新的尾部署å"
@@ -8894,20 +9075,20 @@ msgid "output only the trailers"
msgstr "åªè¼¸å‡ºå°¾éƒ¨ç½²å"
#: builtin/interpret-trailers.c
-msgid "do not apply config rules"
-msgstr "ä¸è¦å¥—用組態設定è¦å‰‡"
+msgid "do not apply trailer.* configuration variables"
+msgstr "ä¸å¥—用 trailer.* 組態變數"
#: builtin/interpret-trailers.c
-msgid "join whitespace-continued values"
-msgstr "連線空白折行的值"
+msgid "reformat multiline trailer values as single-line values"
+msgstr "將多列尾注值 (trailer values) é‡æ–°æ ¼å¼åŒ–為單列值"
#: builtin/interpret-trailers.c
-msgid "set parsing options"
-msgstr "設定解æžé¸é …"
+msgid "alias for --only-trailers --only-input --unfold"
+msgstr "--only-trailers --only-input --unfold 的別å"
#: builtin/interpret-trailers.c
-msgid "do not treat --- specially"
-msgstr "ä¸è¦å° --- 特殊處ç†"
+msgid "do not treat \"---\" as the end of input"
+msgstr "ä¸è¦æŠŠ “---†當作輸入çµå°¾"
#: builtin/interpret-trailers.c
msgid "trailer(s) to add"
@@ -8943,8 +9124,8 @@ msgid "show source"
msgstr "顯示來æº"
#: builtin/log.c
-msgid "use mail map file"
-msgstr "使用信件映射檔案"
+msgid "clear all previously-defined decoration filters"
+msgstr "清除所有先å‰å®šç¾©çš„è£é£¾éŽæ¿¾å™¨"
#: builtin/log.c
msgid "only decorate refs that match <pattern>"
@@ -8964,7 +9145,7 @@ msgid ""
"<file>"
msgstr "追蹤 <開始>,<çµæŸ> 範åœä¸­æ©«åˆ—或 <檔案> 中> :<函數å稱> 的變化å²"
-#: builtin/log.c builtin/shortlog.c bundle.c
+#: builtin/log.c builtin/replay.c builtin/shortlog.c bundle.c
#, c-format
msgid "unrecognized argument: %s"
msgstr "無法識別的åƒæ•¸ï¼š%s"
@@ -9020,6 +9201,11 @@ msgid "not a range"
msgstr "ä¸æ˜¯ä¸€å€‹ç¯„åœ"
#: builtin/log.c
+#, c-format
+msgid "unable to read branch description file '%s'"
+msgstr "無法讀å–分支æ述檔 “%sâ€"
+
+#: builtin/log.c
msgid "cover letter needs email format"
msgstr "附函需è¦ä¿¡ä»¶ä½å€æ ¼å¼"
@@ -9146,6 +9332,10 @@ msgid "generate parts of a cover letter based on a branch's description"
msgstr "基於分支æ述產生部分附函"
#: builtin/log.c
+msgid "use branch description from file"
+msgstr "從檔案讀å–分支æ述並使用"
+
+#: builtin/log.c
msgid "use [<prefix>] instead of [PATCH]"
msgstr "使用 [<å‰ç¶´>] 代替 [PATCH]"
@@ -9171,7 +9361,7 @@ msgstr "ä¸åŒ…å«å·²åœ¨ä¸Šæ¸¸æ交中的修補檔"
#: builtin/log.c
msgid "show patch format instead of default (patch + stat)"
-msgstr "顯示純修補檔格å¼è€Œéžé è¨­çš„(修補檔+狀態)"
+msgstr "顯示純修補檔格å¼è€Œéžé è¨­å€¼ï¼ˆä¿®è£œæª”+狀態)"
#: builtin/log.c
msgid "Messaging"
@@ -9187,7 +9377,7 @@ msgstr "新增信件頭"
#: builtin/log.c
msgid "email"
-msgstr "信件ä½å€"
+msgstr "ä¿¡ç®±"
#: builtin/log.c
msgid "add To: header"
@@ -9270,6 +9460,10 @@ msgid "percentage by which creation is weighted"
msgstr "建立權é‡çš„百分比"
#: builtin/log.c
+msgid "show in-body From: even if identical to the e-mail header"
+msgstr "顯示內文中的 From:å³ä¾¿å’Œä¿¡ä»¶æ¨™é ­çš„值相åŒ"
+
+#: builtin/log.c
#, c-format
msgid "invalid ident line: %s"
msgstr "包å«ç„¡æ•ˆçš„身份標記:%s"
@@ -9344,11 +9538,31 @@ msgid ""
"Could not find a tracked remote branch, please specify <upstream> manually.\n"
msgstr "ä¸èƒ½æ‰¾åˆ°è¿½è¹¤çš„é ç«¯åˆ†æ”¯ï¼Œè«‹æ‰‹å‹•æŒ‡å®š <上游>。\n"
+#: builtin/ls-files.c builtin/ls-tree.c
+#, c-format
+msgid "could not get object info about '%s'"
+msgstr "無法å–得「%sã€ç›¸é—œçš„物件資訊"
+
+#: builtin/ls-files.c
+#, c-format
+msgid "bad ls-files format: element '%s' does not start with '('"
+msgstr "ls-files æ ¼å¼éŒ¯èª¤ï¼šâ€œ%s†元素ä¸ä»¥ “(†開頭"
+
+#: builtin/ls-files.c
+#, c-format
+msgid "bad ls-files format: element '%s' does not end in ')'"
+msgstr "ls-files æ ¼å¼éŒ¯èª¤ï¼šâ€œ%s†元素ä¸ä»¥ “)†çµå°¾"
+
+#: builtin/ls-files.c
+#, c-format
+msgid "bad ls-files format: %%%.*s"
+msgstr "ls-files æ ¼å¼éŒ¯èª¤ï¼š%%%.*s"
+
#: builtin/ls-files.c
msgid "git ls-files [<options>] [<file>...]"
msgstr "git ls-files [<é¸é …>] [<檔案>...]"
-#: builtin/ls-files.c
+#: builtin/ls-files.c builtin/merge-tree.c
msgid "separate paths with the NUL character"
msgstr "用 NUL 字元分隔路徑"
@@ -9366,7 +9580,7 @@ msgstr "使用å°å¯«å­—æ¯è¡¨ç¤º 'fsmonitor clean' 檔案"
#: builtin/ls-files.c
msgid "show cached files in the output (default)"
-msgstr "顯示快å–的檔案(é è¨­ï¼‰"
+msgstr "顯示快å–的檔案(é è¨­å€¼ï¼‰"
#: builtin/ls-files.c
msgid "show deleted files in the output"
@@ -9456,15 +9670,22 @@ msgstr "ä¸é¡¯ç¤ºé‡è¤‡é …ç›®"
msgid "show sparse directories in the presence of a sparse index"
msgstr "在稀ç–索引存在時顯示稀ç–目錄"
+#: builtin/ls-files.c
+msgid ""
+"--format cannot be used with -s, -o, -k, -t, --resolve-undo, --deduplicate, "
+"--eol"
+msgstr ""
+"--format ä¸èƒ½å’Œ -sã€-oã€-kã€-tã€--resolve-undoã€--deduplicateã€--eol 一起使用"
+
#: builtin/ls-remote.c
msgid ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<repository> [<refs>...]]"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
+" [--symref] [<repository> [<patterns>...]]"
msgstr ""
"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
-" [-q | --quiet] [--exit-code] [--get-url]\n"
-" [--symref] [<版本庫> [<引用>...]]"
+" [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
+" [--symref] [<repository> [<patterns>...]]"
#: builtin/ls-remote.c
msgid "do not print remote URL"
@@ -9508,11 +9729,6 @@ msgstr "git ls-tree [<é¸é …>] <樹或æ交> [<路徑>...]"
#: builtin/ls-tree.c
#, c-format
-msgid "could not get object info about '%s'"
-msgstr "無法å–得「%sã€ç›¸é—œçš„物件資訊"
-
-#: builtin/ls-tree.c
-#, c-format
msgid "bad ls-tree format: element '%s' does not start with '('"
msgstr "無效的 ls-tree æ ¼å¼ï¼šã€Œ%sã€å…ƒç´ çš„é–‹é ­ä¸æ˜¯ã€Œ(ã€"
@@ -9617,7 +9833,7 @@ msgstr "在訊æ¯å…§æ–‡ä¸­ä½¿ç”¨æ¨™é ­"
#: builtin/mailsplit.c
msgid "reading patches from stdin/tty..."
-msgstr "正在從標準輸入或 tty 讀å–修補檔內容⋯⋯"
+msgstr "正在從標準輸入或 tty 讀å–修補檔內容……"
#: builtin/mailsplit.c
#, c-format
@@ -9633,14 +9849,14 @@ msgid "git merge-base [-a | --all] --octopus <commit>..."
msgstr "git merge-base [-a | --all] --octopus <æ交>..."
#: builtin/merge-base.c
-msgid "git merge-base --independent <commit>..."
-msgstr "git merge-base --independent <æ交>..."
-
-#: builtin/merge-base.c
msgid "git merge-base --is-ancestor <commit> <commit>"
msgstr "git merge-base --is-ancestor <æ交> <æ交>"
#: builtin/merge-base.c
+msgid "git merge-base --independent <commit>..."
+msgstr "git merge-base --independent <æ交>..."
+
+#: builtin/merge-base.c
msgid "git merge-base --fork-point <ref> [<commit>]"
msgstr "git merge-base --fork-point <引用> [<æ交>]"
@@ -9672,11 +9888,22 @@ msgstr ""
"git merge-file [<é¸é …>] [-L <檔案1> [-L <åˆå§‹> [-L <åå­—2>]]] <檔案1> <åˆå§‹æ–‡"
"件> <檔案2>"
+#: builtin/merge-file.c diff.c
+msgid ""
+"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
+"\"histogram\""
+msgstr ""
+"diff-algorithm é¸é …有 \"myers\"ã€\"minimal\"ã€\"patience\" å’Œ \"histogram\""
+
#: builtin/merge-file.c
msgid "send results to standard output"
msgstr "å°‡çµæžœå‚³é€åˆ°æ¨™æº–輸出"
#: builtin/merge-file.c
+msgid "use object IDs instead of filenames"
+msgstr "使用物件 ID å–代檔å"
+
+#: builtin/merge-file.c
msgid "use a diff3 based merge"
msgstr "使用基於 diff3 çš„åˆä½µ"
@@ -9696,6 +9923,14 @@ msgstr "如果è¡çªï¼Œä½¿ç”¨ä»–們的版本"
msgid "for conflicts, use a union version"
msgstr "如果è¡çªï¼Œä½¿ç”¨è¯åˆç‰ˆæœ¬"
+#: builtin/merge-file.c diff.c
+msgid "<algorithm>"
+msgstr "<演算法>"
+
+#: builtin/merge-file.c diff.c
+msgid "choose a diff algorithm"
+msgstr "é¸æ“‡ä¸€å€‹å·®ç•°æ¼”算法"
+
#: builtin/merge-file.c
msgid "for conflicts, use this marker size"
msgstr "如果è¡çªï¼Œä½¿ç”¨æŒ‡å®šé•·åº¦çš„標記"
@@ -9708,6 +9943,15 @@ msgstr "ä¸è¦è­¦å‘Šè¡çª"
msgid "set labels for file1/orig-file/file2"
msgstr "為 檔案1/åˆå§‹æª”案/檔案2 設定標籤"
+#: builtin/merge-file.c
+#, c-format
+msgid "object '%s' does not exist"
+msgstr "物件 “%s†ä¸å­˜åœ¨"
+
+#: builtin/merge-file.c
+msgid "Could not write object file"
+msgstr "無法寫入物件檔案"
+
#: builtin/merge-recursive.c
#, c-format
msgid "unknown option %s"
@@ -9738,6 +9982,81 @@ msgstr "無法解æžå¼•ç”¨ '%s'"
msgid "Merging %s with %s\n"
msgstr "åˆä½µ %s å’Œ %s\n"
+#: builtin/merge-tree.c builtin/merge.c
+msgid "not something we can merge"
+msgstr "ä¸èƒ½åˆä½µ"
+
+#: builtin/merge-tree.c builtin/merge.c
+msgid "refusing to merge unrelated histories"
+msgstr "拒絕åˆä½µç„¡é—œçš„æ­·å²"
+
+#: builtin/merge-tree.c
+msgid "failure to merge"
+msgstr "åˆä½µæ™‚發生錯誤"
+
+#: builtin/merge-tree.c
+msgid "git merge-tree [--write-tree] [<options>] <branch1> <branch2>"
+msgstr "git merge-tree [--write-tree] [<options>] <branch1> <branch2>"
+
+#: builtin/merge-tree.c
+msgid "git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"
+msgstr "git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"
+
+#: builtin/merge-tree.c
+msgid "do a real merge instead of a trivial merge"
+msgstr "執行真實åˆä½µï¼Œè€Œéžç°¡æ˜“åˆä½µ"
+
+#: builtin/merge-tree.c
+msgid "do a trivial merge only"
+msgstr "åªåŸ·è¡Œç°¡æ˜“åˆä½µ"
+
+#: builtin/merge-tree.c
+msgid "also show informational/conflict messages"
+msgstr "亦顯示資訊性或è¡çªè¨Šæ¯"
+
+#: builtin/merge-tree.c
+msgid "list filenames without modes/oids/stages"
+msgstr "列出檔å,但ä¸é™„加 modes/oids/stages"
+
+#: builtin/merge-tree.c builtin/merge.c builtin/pull.c
+msgid "allow merging unrelated histories"
+msgstr "å…許åˆä¸¦ä¸ç›¸é—œçš„æ­·å²"
+
+#: builtin/merge-tree.c
+msgid "perform multiple merges, one per line of input"
+msgstr "執行多次åˆä½µï¼Œä¸€æ¬¡åŸ·è¡Œè¼¸å…¥ä¸€åˆ—"
+
+#: builtin/merge-tree.c
+msgid "specify a merge-base for the merge"
+msgstr "指定用來åˆä½µçš„åˆä½µåŸºåº•"
+
+#: builtin/merge-tree.c builtin/merge.c builtin/pull.c
+msgid "option=value"
+msgstr "option=value"
+
+#: builtin/merge-tree.c builtin/merge.c builtin/pull.c
+msgid "option for selected merge strategy"
+msgstr "所é¸çš„åˆä½µç­–略的é¸é …"
+
+#: builtin/merge-tree.c
+msgid "--trivial-merge is incompatible with all other options"
+msgstr "--trivial-merge 和其他所有é¸é …都ä¸ç›¸å®¹"
+
+#: builtin/merge-tree.c builtin/merge.c
+#, c-format
+msgid "unknown strategy option: -X%s"
+msgstr "未知的策略é¸é …:-X%s"
+
+#: builtin/merge-tree.c builtin/notes.c
+#, c-format
+msgid "malformed input line: '%s'."
+msgstr "æ ¼å¼éŒ¯èª¤çš„輸入行:'%s'。"
+
+#: builtin/merge-tree.c
+#, c-format
+msgid "merging cannot continue; got unclean result of %d"
+msgstr "無法繼續åˆä½µï¼šå¾ž %d 收到的çµæžœä¸ä¹¾æ·¨"
+
#: builtin/merge.c
msgid "git merge [<options>] [<commit>...]"
msgstr "git merge [<é¸é …>] [<æ交>...]"
@@ -9788,7 +10107,7 @@ msgstr "建立一個單ç¨çš„æ交而ä¸æ˜¯åšä¸€æ¬¡åˆä½µ"
#: builtin/merge.c builtin/pull.c
msgid "perform a commit if the merge succeeds (default)"
-msgstr "如果åˆä½µæˆåŠŸï¼ŒåŸ·è¡Œä¸€æ¬¡æ交(é è¨­ï¼‰"
+msgstr "如果åˆä½µæˆåŠŸï¼ŒåŸ·è¡Œä¸€æ¬¡æ交(é è¨­å€¼ï¼‰"
#: builtin/merge.c builtin/pull.c
msgid "edit message before committing"
@@ -9796,7 +10115,7 @@ msgstr "在æ交å‰ç·¨è¼¯æ交說明"
#: builtin/merge.c
msgid "allow fast-forward (default)"
-msgstr "å…許快轉(é è¨­ï¼‰"
+msgstr "å…許快轉(é è¨­å€¼ï¼‰"
#: builtin/merge.c builtin/pull.c
msgid "abort if fast-forward is not possible"
@@ -9815,14 +10134,6 @@ msgstr "ç­–ç•¥"
msgid "merge strategy to use"
msgstr "è¦ä½¿ç”¨çš„åˆä½µç­–ç•¥"
-#: builtin/merge.c builtin/pull.c
-msgid "option=value"
-msgstr "option=value"
-
-#: builtin/merge.c builtin/pull.c
-msgid "option for selected merge strategy"
-msgstr "所é¸çš„åˆä½µç­–略的é¸é …"
-
#: builtin/merge.c
msgid "merge commit message (for a non-fast-forward merge)"
msgstr "åˆä½µçš„æ交說明(é‡å°éžå¿«è½‰å¼åˆä½µï¼‰"
@@ -9844,21 +10155,17 @@ msgstr "--abort,但是ä¿ç•™ç´¢å¼•å’Œå·¥ä½œå€"
msgid "continue the current in-progress merge"
msgstr "繼續目å‰æ­£åœ¨é€²è¡Œçš„åˆä½µ"
-#: builtin/merge.c builtin/pull.c
-msgid "allow merging unrelated histories"
-msgstr "å…許åˆä¸¦ä¸ç›¸é—œçš„æ­·å²"
-
#: builtin/merge.c
msgid "bypass pre-merge-commit and commit-msg hooks"
msgstr "ç¹žéŽ pre-merge-commit å’Œ commit-msg 掛鉤"
#: builtin/merge.c
msgid "could not run stash."
-msgstr "ä¸èƒ½åŸ·è¡Œå„²è—。"
+msgstr "ä¸èƒ½åŸ·è¡Œè²¯å­˜ã€‚"
#: builtin/merge.c
msgid "stash failed"
-msgstr "儲è—失敗"
+msgstr "貯存失敗"
#: builtin/merge.c
#, c-format
@@ -9898,7 +10205,7 @@ msgstr "'%s' 沒有指å‘一個æ交"
msgid "Bad branch.%s.mergeoptions string: %s"
msgstr "壞的 branch.%s.mergeoptions 字串:%s"
-#: builtin/merge.c builtin/stash.c merge-recursive.c
+#: builtin/merge.c merge-recursive.c
msgid "Unable to write index."
msgstr "ä¸èƒ½å¯«å…¥ç´¢å¼•ã€‚"
@@ -9908,11 +10215,6 @@ msgstr "未處ç†å…©å€‹é ­åˆä½µä¹‹å¤–的任何動作。"
#: builtin/merge.c
#, c-format
-msgid "unknown strategy option: -X%s"
-msgstr "未知的策略é¸é …:-X%s"
-
-#: builtin/merge.c t/helper/test-fast-rebase.c
-#, c-format
msgid "unable to write %s"
msgstr "ä¸èƒ½å¯« %s"
@@ -9983,7 +10285,7 @@ msgstr "å°æ–¼ %s 沒有來自 %s çš„é ç«¯è¿½è¹¤åˆ†æ”¯"
msgid "Bad value '%s' in environment '%s'"
msgstr "環境 '%2$s' 中存在壞的å–值 '%1$s'"
-#: builtin/merge.c read-cache.c strbuf.c wrapper.c
+#: builtin/merge.c editor.c read-cache.c wrapper.c
#, c-format
msgid "could not close '%s'"
msgstr "ä¸èƒ½é—œé–‰ '%s'"
@@ -9994,10 +10296,6 @@ msgid "not something we can merge in %s: %s"
msgstr "ä¸èƒ½åœ¨ %s 中åˆä½µï¼š%s"
#: builtin/merge.c
-msgid "not something we can merge"
-msgstr "ä¸èƒ½åˆä½µ"
-
-#: builtin/merge.c
msgid "--abort expects no arguments"
msgstr "--abort ä¸å¸¶åƒæ•¸"
@@ -10059,14 +10357,19 @@ msgid "Can merge only exactly one commit into empty head"
msgstr "åªèƒ½å°‡ä¸€å€‹æ交åˆä¸¦åˆ°ç©ºåˆ†æ”¯ä¸Š"
#: builtin/merge.c
-msgid "refusing to merge unrelated histories"
-msgstr "拒絕åˆä½µç„¡é—œçš„æ­·å²"
-
-#: builtin/merge.c
#, c-format
msgid "Updating %s..%s\n"
msgstr "æ›´æ–° %s..%s\n"
+#: builtin/merge.c merge-ort-wrappers.c merge-recursive.c
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+" %s"
+msgstr ""
+"您å°ä¸‹åˆ—檔案的本機修改將被åˆä½µå‹•ä½œè¦†è“‹ï¼š\n"
+" %s"
+
#: builtin/merge.c
#, c-format
msgid "Trying really trivial in-index merge...\n"
@@ -10107,6 +10410,11 @@ msgstr "使用 %s 策略,準備自行解決。\n"
msgid "Automatic merge went well; stopped before committing as requested\n"
msgstr "自動åˆä½µé€²å±•é †åˆ©ï¼ŒæŒ‰è¦æ±‚在æ交å‰åœæ­¢\n"
+#: builtin/merge.c
+#, c-format
+msgid "When finished, apply stashed changes with `git stash pop`\n"
+msgstr "完æˆæ™‚,使用 `git stash pop` 套用貯存更改\n"
+
#: builtin/mktag.c
#, c-format
msgid "warning: tag input does not pass fsck: %s"
@@ -10225,7 +10533,7 @@ msgstr "目錄 %s 在索引中並且ä¸æ˜¯å­æ¨¡çµ„?"
#: builtin/mv.c
msgid "Please stage your changes to .gitmodules or stash them to proceed"
-msgstr "請將您的修改暫存到 .gitmodules 中或儲è—後å†ç¹¼çºŒ"
+msgstr "請將您的修改暫存到 .gitmodules 中或貯存後å†ç¹¼çºŒ"
#: builtin/mv.c
#, c-format
@@ -10255,12 +10563,16 @@ msgid "bad source"
msgstr "來æºæ壞"
#: builtin/mv.c
+msgid "destination exists"
+msgstr "目的地已存在"
+
+#: builtin/mv.c
msgid "can not move directory into itself"
msgstr "ä¸èƒ½å°‡ç›®éŒ„移動到自身"
#: builtin/mv.c
-msgid "cannot move directory over file"
-msgstr "ä¸èƒ½å°‡ç›®éŒ„移動到檔案"
+msgid "destination already exists"
+msgstr "目的地已存在"
#: builtin/mv.c
msgid "source directory is empty"
@@ -10275,10 +10587,6 @@ msgid "conflicted"
msgstr "è¡çª"
#: builtin/mv.c
-msgid "destination exists"
-msgstr "目的地已存在"
-
-#: builtin/mv.c
#, c-format
msgid "overwriting '%s'"
msgstr "覆蓋 '%s'"
@@ -10296,6 +10604,10 @@ msgid "destination directory does not exist"
msgstr "找ä¸åˆ°ç›®çš„地目錄"
#: builtin/mv.c
+msgid "destination exists in the index"
+msgstr "目的地已存在索引"
+
+#: builtin/mv.c
#, c-format
msgid "%s, source=%s, destination=%s"
msgstr "%s,來æº=%s,目的地=%s"
@@ -10305,7 +10617,7 @@ msgstr "%s,來æº=%s,目的地=%s"
msgid "Renaming %s to %s\n"
msgstr "é‡æ–°å‘½å %s 至 %s\n"
-#: builtin/mv.c builtin/remote.c builtin/repack.c
+#: builtin/mv.c builtin/remote.c
#, c-format
msgid "renaming '%s' failed"
msgstr "é‡æ–°å‘½å '%s' 失敗"
@@ -10352,7 +10664,7 @@ msgstr "註解從標準輸入收到的文字"
#: builtin/name-rev.c
msgid "allow to print `undefined` names (default)"
-msgstr "å…è¨±åˆ—å° `未定義` çš„å稱(é è¨­ï¼‰"
+msgstr "å…è¨±åˆ—å° `未定義` çš„å稱(é è¨­å€¼ï¼‰"
#: builtin/name-rev.c
msgid "dereference tags in the input (internal use)"
@@ -10364,11 +10676,13 @@ msgstr "git notes [--ref <註解引用>] [list [<物件>]]"
#: builtin/notes.c
msgid ""
-"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [-m <msg> | -F <file> "
-"| (-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref <註解引用>] add [-f] [--allow-empty] [-m <說明> | -F <檔案> "
-"| (-c | -C) <物件>] [<物件>]"
+"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
#: builtin/notes.c
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
@@ -10376,11 +10690,13 @@ msgstr "git notes [--ref <註解引用>] copy [-f] <來æºç‰©ä»¶> <目標物件>
#: builtin/notes.c
msgid ""
-"git notes [--ref <notes-ref>] append [--allow-empty] [-m <msg> | -F <file> | "
-"(-c | -C) <object>] [<object>]"
+"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
msgstr ""
-"git notes [--ref <註解引用>] append [--allow-empty] [-m <說明> | -F <檔案> | "
-"(-c | -C) <物件>] [<物件>]"
+"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>]"
#: builtin/notes.c
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
@@ -10508,11 +10824,6 @@ msgstr "ä¸èƒ½å¾žéžè³‡æ–™ç‰©ä»¶ '%s' 中讀å–註解資料。"
#: builtin/notes.c
#, c-format
-msgid "malformed input line: '%s'."
-msgstr "æ ¼å¼éŒ¯èª¤çš„輸入行:'%s'。"
-
-#: builtin/notes.c
-#, c-format
msgid "failed to copy notes from '%s' to '%s'"
msgstr "從 '%s' 複製註解到 '%s' 時失敗"
@@ -10554,6 +10865,18 @@ msgid "replace existing notes"
msgstr "å–代已存在的註解"
#: builtin/notes.c
+msgid "<paragraph-break>"
+msgstr "<paragraph-break>"
+
+#: builtin/notes.c
+msgid "insert <paragraph-break> between paragraphs"
+msgstr "在段è½é–“æ’å…¥ <paragraph-break>"
+
+#: builtin/notes.c
+msgid "remove unnecessary whitespace"
+msgstr "移除ä¸å¿…è¦çš„空白字元"
+
+#: builtin/notes.c
#, c-format
msgid ""
"Cannot add notes. Found existing notes for object %s. Use '-f' to overwrite "
@@ -10737,20 +11060,19 @@ msgstr "註解引用"
msgid "use notes from <notes-ref>"
msgstr "從 <註解引用> 使用註解"
-#: builtin/notes.c builtin/stash.c
+#: builtin/notes.c builtin/remote.c parse-options.c
#, c-format
-msgid "unknown subcommand: %s"
-msgstr "未知å­æŒ‡ä»¤ï¼š%s"
+msgid "unknown subcommand: `%s'"
+msgstr "未知å­æŒ‡ä»¤ï¼šã€Œ%sã€"
#: builtin/pack-objects.c
-msgid ""
-"git pack-objects --stdout [<options>...] [< <ref-list> | < <object-list>]"
-msgstr "git pack-objects --stdout [<é¸é …>...] [< <引用列表> | < <物件列表>]"
+msgid "git pack-objects --stdout [<options>] [< <ref-list> | < <object-list>]"
+msgstr "git pack-objects --stdout [<é¸é …>] [< <引用列表> | < <物件列表>]"
#: builtin/pack-objects.c
msgid ""
-"git pack-objects [<options>...] <base-name> [< <ref-list> | < <object-list>]"
-msgstr "git pack-objects [<é¸é …>...] <å‰ç¶´å稱> [< <引用列表> | < <物件列表>]"
+"git pack-objects [<options>] <base-name> [< <ref-list> | < <object-list>]"
+msgstr "git pack-objects [<é¸é …>] <å‰ç¶´å稱> [< <引用列表> | < <物件列表>]"
#: builtin/pack-objects.c
#, c-format
@@ -10812,7 +11134,7 @@ msgstr "無法寫入ä½åœ–索引"
msgid "wrote %<PRIu32> objects while expecting %<PRIu32>"
msgstr "寫入 %<PRIu32> 個物件而é æœŸ %<PRIu32> 個"
-#: builtin/pack-objects.c
+#: builtin/pack-objects.c builtin/repack.c
msgid "disabling bitmap writing, as some objects are not being packed"
msgstr "åœç”¨ bitmap 寫入,因為一些物件將ä¸æœƒè¢«æ‰“包"
@@ -10879,6 +11201,11 @@ msgstr "ä¸ä¸€è‡´çš„差異計數"
#: builtin/pack-objects.c
#, c-format
+msgid "invalid pack.allowPackReuse value: '%s'"
+msgstr "無效的 pack.allowPackReuse 值:“%sâ€"
+
+#: builtin/pack-objects.c
+#, c-format
msgid ""
"value of uploadpack.blobpackfileuri must be of the form '<object-hash> <pack-"
"hash> <uri>' (got '%s')"
@@ -10979,6 +11306,14 @@ msgid "bad index version '%s'"
msgstr "壞的索引版本 '%s'"
#: builtin/pack-objects.c
+msgid "show progress meter during object writing phase"
+msgstr "在物件寫入階段顯示進度列"
+
+#: builtin/pack-objects.c
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "顯示進度列時類似 --all-progress"
+
+#: builtin/pack-objects.c
msgid "<version>[,<offset>]"
msgstr "<版本>[,<ä½ç§»>]"
@@ -11170,10 +11505,6 @@ msgid "--thin cannot be used to build an indexable pack"
msgstr "--thin ä¸èƒ½ç”¨æ–¼å»ºç«‹ä¸€å€‹å¯ç´¢å¼•åŒ…"
#: builtin/pack-objects.c
-msgid "cannot use --filter without --stdout"
-msgstr "ä¸èƒ½åœ¨æ²’有 --stdout 的情æ³ä¸‹ä½¿ç”¨ --filter"
-
-#: builtin/pack-objects.c
msgid "cannot use --filter with --stdin-packs"
msgstr "無法將 --filter åŠ --stdin-packs çµåˆä½¿ç”¨"
@@ -11190,10 +11521,6 @@ msgid "cannot use --stdin-packs with --cruft"
msgstr "無法將 --stdin-packs 與 --cruft 組åˆä½¿ç”¨"
#: builtin/pack-objects.c
-msgid "cannot use --max-pack-size with --cruft"
-msgstr "無法將 --max-pack-size 與 --cruft 組åˆä½¿ç”¨"
-
-#: builtin/pack-objects.c
msgid "Enumerating objects"
msgstr "枚舉物件"
@@ -11201,10 +11528,10 @@ msgstr "枚舉物件"
#, c-format
msgid ""
"Total %<PRIu32> (delta %<PRIu32>), reused %<PRIu32> (delta %<PRIu32>), pack-"
-"reused %<PRIu32>"
+"reused %<PRIu32> (from %<PRIuMAX>)"
msgstr ""
"總共 %<PRIu32> (差異 %<PRIu32>),復用 %<PRIu32> (差異 %<PRIu32>),é‡ç”¨åŒ… "
-"%<PRIu32>"
+"%<PRIu32> (總共 %<PRIuMAX>)"
#: builtin/pack-redundant.c
msgid ""
@@ -11220,9 +11547,17 @@ msgstr ""
"<git@vger.kernel.org> 讓我們知é“您還在使用。\n"
"æ„Ÿè¬ã€‚\n"
+#: builtin/pack-redundant.c
+msgid "refusing to run without --i-still-use-this"
+msgstr "傳入 --i-still-use-this å‰æ‹’絕執行"
+
#: builtin/pack-refs.c
-msgid "git pack-refs [<options>]"
-msgstr "git pack-refs [<é¸é …>]"
+msgid ""
+"git pack-refs [--all] [--no-prune] [--include <pattern>] [--exclude "
+"<pattern>]"
+msgstr ""
+"git pack-refs [--all] [--no-prune] [--include <pattern>] [--exclude "
+"<pattern>]"
#: builtin/pack-refs.c
msgid "pack everything"
@@ -11230,7 +11565,31 @@ msgstr "打包一切"
#: builtin/pack-refs.c
msgid "prune loose refs (default)"
-msgstr "剪除鬆散引用(é è¨­ï¼‰"
+msgstr "剪除鬆散引用(é è¨­å€¼ï¼‰"
+
+#: builtin/pack-refs.c
+msgid "references to include"
+msgstr "è¦åŒ…å«çš„引用"
+
+#: builtin/pack-refs.c
+msgid "references to exclude"
+msgstr "è¦æŽ’除的引用"
+
+#: builtin/patch-id.c
+msgid "git patch-id [--stable | --unstable | --verbatim]"
+msgstr "git patch-id [--stable | --unstable | --verbatim]"
+
+#: builtin/patch-id.c
+msgid "use the unstable patch-id algorithm"
+msgstr "使用ä¸ç©©å®šçš„ patch-id 演算法"
+
+#: builtin/patch-id.c
+msgid "use the stable patch-id algorithm"
+msgstr "使用穩定的 patch-id 演算法"
+
+#: builtin/patch-id.c
+msgid "don't strip whitespace from the patch"
+msgstr "ä¸è¦åŽ»é™¤ä¿®è£œæª”的空白字元"
#: builtin/prune.c
msgid "git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"
@@ -11278,7 +11637,7 @@ msgstr "控制 pre-merge-commit 和 commit-msg 掛鉤的使用"
#: builtin/pull.c parse-options.h
msgid "automatically stash/stash pop before and after"
-msgstr "在動作å‰å¾ŒåŸ·è¡Œè‡ªå‹•å„²è—和彈出儲è—"
+msgstr "在動作å‰å¾ŒåŸ·è¡Œè‡ªå‹•è²¯å­˜å’Œå½ˆå‡ºè²¯å­˜"
#: builtin/pull.c
msgid "Options related to fetching"
@@ -11292,6 +11651,14 @@ msgstr "強制覆蓋本機分支"
msgid "number of submodules pulled in parallel"
msgstr "並行拉å–çš„å­æ¨¡çµ„數é‡"
+#: builtin/pull.c parse-options.h
+msgid "use IPv4 addresses only"
+msgstr "åªä½¿ç”¨ IPv4 ä½å€"
+
+#: builtin/pull.c parse-options.h
+msgid "use IPv6 addresses only"
+msgstr "åªä½¿ç”¨ IPv6 ä½å€"
+
#: builtin/pull.c
msgid ""
"There is no candidate for rebasing against among the refs that you just "
@@ -11317,7 +11684,7 @@ msgid ""
"for your current branch, you must specify a branch on the command line."
msgstr ""
"您è¦æ±‚從é ç«¯ '%s' 拉å–,但是未指定一個分支。因為這ä¸æ˜¯ç›®å‰\n"
-"分支é è¨­çš„é ç«¯ç‰ˆæœ¬åº«ï¼Œæ‚¨å¿…須在指令列中指定一個分支å。"
+"分支é è¨­çš„é ç«¯ç‰ˆæœ¬åº«ï¼Œæ‚¨å¿…須在命令列中指定一個分支å。"
#: builtin/pull.c builtin/rebase.c
msgid "You are not currently on a branch."
@@ -11339,7 +11706,7 @@ msgstr "詳見 git-pull(1)。"
msgid "<remote>"
msgstr "<é ç«¯>"
-#: builtin/pull.c contrib/scalar/scalar.c
+#: builtin/pull.c scalar.c
msgid "<branch>"
msgstr "<分支>"
@@ -11407,9 +11774,9 @@ msgstr "更新尚未誕生的分支,變更新增至索引。"
msgid "pull with rebase"
msgstr "é‡å®šåŸºåº•å¼æ‹‰å–"
-#: builtin/pull.c
-msgid "please commit or stash them."
-msgstr "è«‹æ交或儲è—它們。"
+#: builtin/pull.c builtin/rebase.c
+msgid "Please commit or stash them."
+msgstr "è«‹æ交或貯存修改。"
#: builtin/pull.c
#, c-format
@@ -11481,14 +11848,14 @@ msgstr ""
#: builtin/push.c
msgid ""
"\n"
-"To avoid automatically configuring upstream branches when their name\n"
-"doesn't match the local branch, see option 'simple' of branch."
-"autoSetupMerge\n"
+"To avoid automatically configuring an upstream branch when its name\n"
+"won't match the local branch, see option 'simple' of branch.autoSetupMerge\n"
"in 'git help config'.\n"
msgstr ""
"\n"
-"為了é¿å…自動在上游分支的å稱與本機ä¸ç¬¦æ™‚,設定上游的分支,請åƒé–±\n"
-"“git help config†中 branch.autoSetupMerge çš„ “simple†é¸é …。\n"
+"è‹¥è¦é¿å…在å稱與本機分支ä¸åŒæ™‚自動設定上游分支,\n"
+"è«‹åƒé–± “git help config†中 branch.autoSetupMerge çš„\n"
+"“simple†é¸é …。\n"
#: builtin/push.c
#, c-format
@@ -11576,37 +11943,37 @@ msgstr ""
#: builtin/push.c
msgid ""
"Updates were rejected because the tip of your current branch is behind\n"
-"its remote counterpart. Integrate the remote changes (e.g.\n"
-"'git pull ...') before pushing again.\n"
+"its remote counterpart. If you want to integrate the remote changes,\n"
+"use 'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
"更新被拒絕,因為您目å‰åˆ†æ”¯çš„最新æ交è½å¾Œæ–¼å…¶å°æ‡‰çš„é ç«¯åˆ†æ”¯ã€‚\n"
-"å†æ¬¡æŽ¨é€å‰ï¼Œå…ˆèˆ‡é ç«¯è®Šæ›´åˆä½µï¼ˆå¦‚ 'git pull ...')。詳見\n"
-"'git push --help' 中的 'Note about fast-forwards' å°ç¯€ã€‚"
+"如果您想è¦æ•´åˆé ç«¯æ›´å‹•ï¼Œè«‹åœ¨å†æ¬¡æŽ¨é€å‰ä½¿ç”¨ “git pullâ€ã€‚詳見\n"
+"“git push --help†中的〈Note about fast-forwards〉å°ç¯€ã€‚"
#: builtin/push.c
msgid ""
"Updates were rejected because a pushed branch tip is behind its remote\n"
-"counterpart. Check out this branch and integrate the remote changes\n"
-"(e.g. 'git pull ...') before pushing again.\n"
+"counterpart. If you want to integrate the remote changes, use 'git pull'\n"
+"before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"更新被拒絕,因為推é€çš„一個分支的最新æ交è½å¾Œæ–¼å…¶å°æ‡‰çš„é ç«¯åˆ†æ”¯ã€‚\n"
-"簽出該分支並整åˆé ç«¯è®Šæ›´ï¼ˆå¦‚ 'git pull ...'),然後å†æŽ¨é€ã€‚詳見\n"
-"'git push --help' 中的 'Note about fast-forwards' å°ç¯€ã€‚"
+"更新被拒絕,因為推é€çš„æŸåˆ†æ”¯çš„最新æ交è½å¾Œæ–¼å…¶å°æ‡‰çš„é ç«¯åˆ†æ”¯ã€‚\n"
+"如果您想è¦æ•´åˆé ç«¯æ›´å‹•ï¼Œè«‹åœ¨å†æ¬¡æŽ¨é€å‰ä½¿ç”¨ “git pullâ€ã€‚詳見\n"
+"“git push --help†中的〈Note about fast-forwards〉å°ç¯€ã€‚"
#: builtin/push.c
msgid ""
-"Updates were rejected because the remote contains work that you do\n"
-"not have locally. This is usually caused by another repository pushing\n"
-"to the same ref. You may want to first integrate the remote changes\n"
-"(e.g., 'git pull ...') before pushing again.\n"
+"Updates were rejected because the remote contains work that you do not\n"
+"have locally. This is usually caused by another repository pushing to\n"
+"the same ref. If you want to integrate the remote changes, use\n"
+"'git pull' before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"因為é ç«¯ç‰ˆæœ¬åº«åŒ…å«æ‚¨æœ¬æ©Ÿå°šä¸å­˜åœ¨çš„æ交,而導致更新被拒絕。這通常是因為å¦å¤–\n"
-"一個版本庫已å‘該引用進行了推é€ã€‚å†æ¬¡æŽ¨é€å‰ï¼Œæ‚¨å¯èƒ½éœ€è¦å…ˆæ•´åˆé ç«¯è®Šæ›´\n"
-"(如 'git pull ...')。\n"
-"詳見 'git push --help' 中的 'Note about fast-forwards' å°ç¯€ã€‚"
+"更新被拒絕,因為é ç«¯åŒ…å«æ‚¨æœ¬æ©Ÿæ²’有的æ交。這通常是因為\n"
+"å¦ä¸€å€‹ç‰ˆæœ¬åº«æœ‰æŽ¨é€æ›´å‹•åˆ°åŒå€‹å¼•ç”¨ã€‚如果您想è¦æ•´åˆé ç«¯æ›´å‹•ï¼Œ\n"
+"請在å†æ¬¡æŽ¨é€å‰ä½¿ç”¨ “git pullâ€ã€‚詳見 “git push --help†中的\n"
+"〈Note about fast-forwards〉å°ç¯€ã€‚"
#: builtin/push.c
msgid "Updates were rejected because the tag already exists in the remote."
@@ -11623,14 +11990,14 @@ msgstr ""
#: builtin/push.c
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"
+"Updates were rejected because the tip of the remote-tracking branch has\n"
+"been updated since the last checkout. If you want to integrate the\n"
+"remote changes, use 'git pull' before pushing again.\n"
+"See the 'Note about fast-forwards' in 'git push --help' for details."
msgstr ""
-"更新被拒,因為é ç«¯è¿½è¹¤åˆ†æ”¯çš„最新指é‡ç¹¼ä¸Šæ¬¡ç°½å‡ºå¾Œæœ‰æ›´æ–°ã€‚\n"
-"您å¯èƒ½æœƒå¸Œæœ›å…ˆå°‡é€™äº›è®Šæ›´æ•´åˆè‡³æœ¬åœ°ï¼ˆä¾‹å¦‚:‘git pull …’)\n"
-"最後æ‰å¼·åˆ¶æ›´æ–°ã€‚\n"
+"更新被拒絕,因為é ç«¯è¿½è¹¤åˆ†æ”¯çš„最新æ交自上次簽出後有改變。\n"
+"如果您想è¦æ•´åˆé ç«¯æ›´å‹•ï¼Œè«‹åœ¨å†æ¬¡æŽ¨é€å‰ä½¿ç”¨ “git pullâ€ã€‚\n"
+"詳見 “git push --help†中的〈Note about fast-forwards〉å°ç¯€ã€‚"
#: builtin/push.c
#, c-format
@@ -11642,6 +12009,12 @@ msgstr "推é€åˆ° %s\n"
msgid "failed to push some refs to '%s'"
msgstr "推é€ä¸€äº›å¼•ç”¨åˆ° '%s' 失敗"
+#: builtin/push.c
+msgid ""
+"recursing into submodule with push.recurseSubmodules=only; using on-demand "
+"instead"
+msgstr "在有 push.recurseSubmodules=only; 的情æ³å˜—試éžè¿´å­æ¨¡çµ„;改用 on-demand"
+
#: builtin/push.c builtin/send-pack.c submodule-config.c
#, c-format
msgid "invalid value for '%s'"
@@ -11651,9 +12024,9 @@ msgstr "「%sã€çš„值無效"
msgid "repository"
msgstr "版本庫"
-#: builtin/push.c builtin/send-pack.c
-msgid "push all refs"
-msgstr "推é€æ‰€æœ‰å¼•ç”¨"
+#: builtin/push.c
+msgid "push all branches"
+msgstr "推é€æ‰€æœ‰åˆ†æ”¯"
#: builtin/push.c builtin/send-pack.c
msgid "mirror all refs"
@@ -11664,8 +12037,8 @@ msgid "delete refs"
msgstr "刪除引用"
#: builtin/push.c
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "推é€æ¨™ç±¤ï¼ˆä¸èƒ½ä½¿ç”¨ --all or --mirror)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr "推é€æ¨™ç±¤ï¼ˆä¸èƒ½å’Œ --allã€--branches 或 --mirror 一起使用)"
#: builtin/push.c builtin/send-pack.c
msgid "force updates"
@@ -11723,7 +12096,7 @@ msgstr "需è¦é ç«¯æ”¯æ´ atomic 事務"
msgid "--delete doesn't make sense without any refs"
msgstr "--delete 未接任何引用沒有æ„義"
-#: builtin/push.c
+#: builtin/push.c t/helper/test-bundle-uri.c
#, c-format
msgid "bad repository '%s'"
msgstr "壞的版本庫 '%s'"
@@ -11795,12 +12168,18 @@ msgstr "åªç™¼å‡ºè·Ÿç¬¬äºŒå€‹ç¯„åœç›¸é—œçš„輸出"
#: builtin/range-diff.c
#, c-format
+msgid "not a revision: '%s'"
+msgstr "éžä¿®è¨‚版:「%sã€"
+
+#: builtin/range-diff.c
+#, c-format
msgid "not a commit range: '%s'"
msgstr "ä¸æ˜¯æ交範åœï¼šã€Œ%sã€"
#: builtin/range-diff.c
-msgid "single arg format must be symmetric range"
-msgstr "單個åƒæ•¸æ ¼å¼å¿…須是å°ç¨±ç¯„åœï¼ˆå³åŒ…å«...)"
+#, c-format
+msgid "not a symmetric range: '%s'"
+msgstr "ä¸æ˜¯å°ç¨±ç¯„åœï¼šã€Œ%sã€"
#: builtin/range-diff.c
msgid "need two commit ranges"
@@ -11808,13 +12187,15 @@ msgstr "需è¦å…©å€‹æ交範åœ"
#: builtin/read-tree.c
msgid ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>) "
-"[-u | -i]] [--no-sparse-checkout] [--index-output=<file>] (--empty | <tree-"
-"ish1> [<tree-ish2> [<tree-ish3>]])"
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<prefix>)\n"
+" [-u | -i]] [--index-output=<file>] [--no-sparse-checkout]\n"
+" (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"
msgstr ""
-"git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<å‰ç¶´>) [-"
-"u | -i]] [--no-sparse-checkout] [--index-output=<檔案>] (--empty | <樹狀物件"
-"1> [<樹狀物件2> [<樹狀物件3>]])"
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<prefix>)\n"
+" [-u | -i]] [--index-output=<file>] [--no-sparse-checkout]\n"
+" (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"
#: builtin/read-tree.c
msgid "write resulting index to <file>"
@@ -11931,8 +12312,8 @@ msgstr "%s 需è¦åˆä½µå¾Œç«¯"
#: builtin/rebase.c
#, c-format
-msgid "could not get 'onto': '%s'"
-msgstr "無法å–å¾— 'onto':'%s'"
+msgid "invalid onto: '%s'"
+msgstr "無效的 onto:「%sã€"
#: builtin/rebase.c
#, c-format
@@ -11982,17 +12363,35 @@ msgstr ""
#: builtin/rebase.c
#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "未知的 rebase-merges 模å¼ï¼š%s"
+
+#: builtin/rebase.c
+#, c-format
msgid "could not switch to %s"
msgstr "無法切æ›åˆ° %s"
#: builtin/rebase.c
+msgid "apply options and merge options cannot be used together"
+msgstr "套用é¸é …與åˆä½µé¸é …ä¸å¾—åŒæ™‚使用"
+
+#: builtin/rebase.c
#, c-format
msgid ""
-"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and \"ask"
-"\"."
+"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and "
+"\"ask\"."
msgstr "無法識別的 '%s' 空類型;有效的數值有 \"drop\"ã€\"keep\" è·Ÿ \"ask\"。"
#: builtin/rebase.c
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"有字串引數的 --rebase-merges 已被棄用,而且會在未來的 Git 版本åœæ­¢é‹ä½œã€‚請改"
+"用無引數的 --rebase-merges,功能相åŒã€‚"
+
+#: builtin/rebase.c
#, c-format
msgid ""
"%s\n"
@@ -12136,6 +12535,10 @@ msgid "move commits that begin with squash!/fixup! under -i"
msgstr "在 -i 互動模å¼ä¸‹ï¼Œç§»å‹•ä»¥ squash!/fixup! é–‹é ­çš„æ交"
#: builtin/rebase.c
+msgid "update branches that point to commits that are being rebased"
+msgstr "更新指å‘正在é‡å®šåŸºåº•çš„æ交之分支"
+
+#: builtin/rebase.c
msgid "add exec lines after each commit of the editable list"
msgstr "å¯ç·¨è¼¯åˆ—表的æ¯ä¸€å€‹æ交下é¢å¢žåŠ ä¸€è¡Œ exec"
@@ -12207,7 +12610,7 @@ msgstr "沒有正在進行的é‡å®šåŸºåº•ï¼Ÿ"
msgid "The --edit-todo action can only be used during interactive rebase."
msgstr "動作 --edit-todo åªèƒ½ç”¨åœ¨äº’å‹•å¼é‡å®šåŸºåº•éŽç¨‹ä¸­ã€‚"
-#: builtin/rebase.c t/helper/test-fast-rebase.c
+#: builtin/rebase.c
msgid "Cannot read HEAD"
msgstr "ä¸èƒ½è®€å– HEAD"
@@ -12252,17 +12655,16 @@ msgid "switch `C' expects a numerical value"
msgstr "開關 `C' 期望一個數字值"
#: builtin/rebase.c
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "未知模å¼ï¼š%s"
-
-#: builtin/rebase.c
-msgid "--strategy requires --merge or --interactive"
-msgstr "--strategy éœ€è¦ --merge 或 --interactive"
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges. Consider adding --"
+"no-rebase-merges"
+msgstr "apply é¸é …與 rebase.rebaseMerges ä¸ç›¸å®¹ã€‚請考慮加上 --no-rebase-merges"
#: builtin/rebase.c
-msgid "apply options and merge options cannot be used together"
-msgstr "套用é¸é …與åˆä½µé¸é …ä¸å¾—åŒæ™‚使用"
+msgid ""
+"apply options are incompatible with rebase.updateRefs. Consider adding --no-"
+"update-refs"
+msgstr "apply é¸é …與 rebase.updateRefs ä¸ç›¸å®¹ã€‚請考慮加上 --no-update-refs"
#: builtin/rebase.c
#, c-format
@@ -12293,8 +12695,8 @@ msgid "No such ref: %s"
msgstr "沒有這樣的引用:%s"
#: builtin/rebase.c
-msgid "Could not resolve HEAD to a revision"
-msgstr "無法將 HEAD 解æžç‚ºä¸€å€‹ç‰ˆæœ¬"
+msgid "Could not resolve HEAD to a commit"
+msgstr "無法將 HEAD 解æžæˆæ交"
#: builtin/rebase.c
#, c-format
@@ -12312,10 +12714,6 @@ msgid "Does not point to a valid commit '%s'"
msgstr "沒有指å‘一個有效的æ交 '%s'"
#: builtin/rebase.c
-msgid "Please commit or stash them."
-msgstr "è«‹æ交或儲è—修改。"
-
-#: builtin/rebase.c
msgid "HEAD is up to date."
msgstr "HEAD 是最新的。"
@@ -12618,12 +13016,12 @@ msgid "fetch the remote branches"
msgstr "抓å–é ç«¯çš„分支"
#: builtin/remote.c
-msgid "import all tags and associated objects when fetching"
-msgstr "抓å–時匯入所有的標籤和關è¯ç‰©ä»¶"
-
-#: builtin/remote.c
-msgid "or do not fetch any tag at all (--no-tags)"
-msgstr "或ä¸æŠ“å–任何標籤(--no-tags)"
+msgid ""
+"import all tags and associated objects when fetching\n"
+"or do not fetch any tag at all (--no-tags)"
+msgstr ""
+"抓å–時匯入所有的標籤和關è¯ç‰©ä»¶\n"
+"或者是完全ä¸æŠ“å–所有標籤 (--no-tags)"
#: builtin/remote.c
msgid "branch(es) to track"
@@ -12741,7 +13139,7 @@ msgid ""
msgid_plural ""
"Note: Some branches outside the refs/remotes/ hierarchy were not removed;\n"
"to delete them, use:"
-msgstr[0] "注æ„:ref/remotes 層級之外的一個分支未被移除。è¦åˆªé™¤å®ƒï¼Œä½¿ç”¨ï¼š"
+msgstr[0] "注æ„:refs/remotes/ 層級之外的一個分支未被移除。è¦åˆªé™¤å®ƒï¼Œä½¿ç”¨ï¼š"
#: builtin/remote.c
#, c-format
@@ -12758,6 +13156,10 @@ msgid " tracked"
msgstr " 已追蹤"
#: builtin/remote.c
+msgid " skipped"
+msgstr " ç•¥éŽ"
+
+#: builtin/remote.c
msgid " stale (use 'git remote prune' to remove)"
msgstr " éŽæ™‚(使用 'git remote prune' 移除)"
@@ -13089,6 +13491,16 @@ msgid "could not close refs snapshot tempfile"
msgstr "無法關閉 refs 的快照暫存檔"
#: builtin/repack.c
+#, c-format
+msgid "could not remove stale bitmap: %s"
+msgstr "無法移除éŽæ™‚ä½åœ–:%s"
+
+#: builtin/repack.c
+#, c-format
+msgid "pack prefix %s does not begin with objdir %s"
+msgstr "å°åŒ…å‰ç¶´ %s ä¸ä»¥ objdir %s é–‹é ­"
+
+#: builtin/repack.c
msgid "pack everything in a single pack"
msgstr "所有內容打包到一個包檔案中"
@@ -13105,8 +13517,8 @@ msgid "approxidate"
msgstr "近似日期"
#: builtin/repack.c
-msgid "with -C, expire objects older than this"
-msgstr "æ­é… -C 會將早於此的物件設為éŽæœŸ"
+msgid "with --cruft, expire objects older than this"
+msgstr "æ­é… --cruft 會將早於此的物件標為éŽæœŸ"
#: builtin/repack.c
msgid "remove redundant packs, and run git-prune-packed"
@@ -13185,27 +13597,40 @@ msgid "write a multi-pack index of the resulting packs"
msgstr "寫入çµæžœåŒ…的多包索引"
#: builtin/repack.c
+msgid "pack prefix to store a pack containing pruned objects"
+msgstr "å°è£å‰ç¶´ï¼Œå„²å­˜ç‚ºåŒ…å«éŽæ™‚物件的套件包"
+
+#: builtin/repack.c
+msgid "pack prefix to store a pack containing filtered out objects"
+msgstr "å°‡å‰ç¶´é€²è¡ŒåŒ…è£ï¼Œå„²å­˜ç‚ºåŒ…å«å·²éŽæ¿¾ç‰©ä»¶çš„å°è£"
+
+#: builtin/repack.c
msgid "cannot delete packs in a precious-objects repo"
msgstr "ä¸èƒ½åˆªé™¤çå“版本庫中的å°åŒ…"
#: builtin/repack.c
+#, c-format
+msgid "option '%s' can only be used along with '%s'"
+msgstr "“%s†é¸é …åªèƒ½èˆ‡ “%s†一起使用"
+
+#: builtin/repack.c
msgid "Nothing new to pack."
msgstr "沒有新的è¦æ‰“包。"
#: builtin/repack.c
#, c-format
-msgid "pack prefix %s does not begin with objdir %s"
-msgstr "å°åŒ…å‰ç¶´ %s ä¸ä»¥ objdir %s é–‹é ­"
+msgid "renaming pack to '%s' failed"
+msgstr "無法將包é‡æ–°å‘½å為「%sã€"
#: builtin/repack.c
#, c-format
-msgid "missing required file: %s"
-msgstr "缺少必è¦æª”案:%s"
+msgid "pack-objects did not write a '%s' file for pack %s-%s"
+msgstr "pack-objects 沒有為 %2$s-%3$s 套件包寫入 “%1$s†檔案"
-#: builtin/repack.c
+#: builtin/repack.c sequencer.c
#, c-format
msgid "could not unlink: %s"
-msgstr "無法å–消連çµï¼š%s"
+msgstr "無法刪除:%s"
#: builtin/replace.c
msgid "git replace [-f] <object> <replacement>"
@@ -13443,9 +13868,91 @@ msgstr "--convert-graft-file ä¸å¸¶åƒæ•¸"
msgid "only one pattern can be given with -l"
msgstr "åªèƒ½ç‚º -l æ供一個模å¼"
+#: builtin/replay.c
+msgid "need some commits to replay"
+msgstr "需è¦ä¸€äº›æ交æ‰èƒ½é‡æ”¾"
+
+#: builtin/replay.c
+msgid "--onto and --advance are incompatible"
+msgstr "--onto å’Œ --advance ä¸ç›¸å®¹"
+
+#: builtin/replay.c
+msgid "all positive revisions given must be references"
+msgstr "æ供的所有正å‘修訂集必須為引用"
+
+#: builtin/replay.c
+msgid "argument to --advance must be a reference"
+msgstr "傳入 --advance 的引數必須為引用"
+
+#: builtin/replay.c
+msgid ""
+"cannot advance target with multiple sources because ordering would be ill-"
+"defined"
+msgstr "無法用多個來æºæ¼”進目的地,以å…無法確定排åº"
+
+#: builtin/replay.c
+msgid ""
+"cannot implicitly determine whether this is an --advance or --onto operation"
+msgstr "無法å‡è¨­é€™æ˜¯ --advance 還是 --onto 動作"
+
+#: builtin/replay.c
+msgid ""
+"cannot advance target with multiple source branches because ordering would "
+"be ill-defined"
+msgstr "無法由多個來æºåˆ†æ”¯æ¼”進目的地,以å…無法確定排åº"
+
+#: builtin/replay.c
+msgid "cannot implicitly determine correct base for --onto"
+msgstr "無法å‡è¨­ --onto 的正確基底"
+
+#: builtin/replay.c
+msgid ""
+"(EXPERIMENTAL!) git replay ([--contained] --onto <newbase> | --advance "
+"<branch>) <revision-range>..."
+msgstr ""
+"(實驗性功能ï¼ï¼‰git replay ([--contained] --onto <newbase> | --advance "
+"<branch>) <revision-range>..."
+
+#: builtin/replay.c
+msgid "make replay advance given branch"
+msgstr "在指定分支上進行é‡æ”¾æ¼”進"
+
+#: builtin/replay.c
+msgid "replay onto given commit"
+msgstr "é‡æ”¾åˆ°æŒ‡å®šæ交"
+
+#: builtin/replay.c
+msgid "advance all branches contained in revision-range"
+msgstr "演進所有包å«åœ¨ revision-range 中的分支"
+
+#: builtin/replay.c
+msgid "option --onto or --advance is mandatory"
+msgstr "必須傳入 --onto 或 --advance é¸é …"
+
+#: builtin/replay.c
+#, c-format
+msgid ""
+"some rev walking options will be overridden as '%s' bit in 'struct rev_info' "
+"will be forced"
+msgstr "將覆寫部分修訂版éæ­·é¸é …,強制使用 “struct rev_info†的 “%s†ä½å…ƒ"
+
+#: builtin/replay.c
+msgid "error preparing revisions"
+msgstr "無法準備修訂集"
+
+#: builtin/replay.c
+msgid "replaying down to root commit is not supported yet!"
+msgstr "å°šä¸æ”¯æ´é‡æ”¾åˆ°æ ¹æ交ï¼"
+
+#: builtin/replay.c
+msgid "replaying merge commits is not supported yet!"
+msgstr "å°šä¸æ”¯æ´é‡æ”¾åˆä½µæ交ï¼"
+
#: builtin/rerere.c
-msgid "git rerere [clear | forget <path>... | status | remaining | diff | gc]"
-msgstr "git rerere [clear | forget <路徑>... | status | remaining | diff | gc]"
+msgid ""
+"git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]"
+msgstr ""
+"git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]"
#: builtin/rerere.c
msgid "register clean resolutions in index"
@@ -13599,12 +14106,17 @@ msgstr "ä¸èƒ½é‡è¨­ç´¢å¼•æª”案至版本 '%s'。"
msgid "Could not write new index file."
msgstr "ä¸èƒ½å¯«å…¥æ–°çš„索引檔案。"
-#: builtin/rev-list.c pack-bitmap.c
+#: builtin/rev-list.c
#, c-format
msgid "unable to get disk usage of %s"
msgstr "無法å–å¾— %s çš„ç£ç¢Ÿç”¨é‡"
#: builtin/rev-list.c
+#, c-format
+msgid "invalid value for '%s': '%s', the only allowed format is '%s'"
+msgstr "「%sã€çš„數值無效:「%sã€ï¼Œå”¯ä¸€å…許的格å¼æ˜¯ã€Œ%sã€"
+
+#: builtin/rev-list.c
msgid "rev-list does not support display of notes"
msgstr "rev-list ä¸æ”¯æ´é¡¯ç¤ºè¨»è§£"
@@ -13638,6 +14150,10 @@ msgid "no usage string given before the `--' separator"
msgstr "「--ã€åˆ†éš”符號å‰æœªæ供用法字串"
#: builtin/rev-parse.c
+msgid "missing opt-spec before option flags"
+msgstr "é¸é …旗標å‰ç¼ºå°‘ opt-spec"
+
+#: builtin/rev-parse.c
msgid "Needed a single revision"
msgstr "需è¦ä¸€å€‹ä¿®è¨‚版本"
@@ -13699,25 +14215,37 @@ msgid "this operation must be run in a work tree"
msgstr "該動作必須在一個工作å€ä¸­åŸ·è¡Œ"
#: builtin/rev-parse.c
+msgid "Could not read the index"
+msgstr "無法讀å–索引"
+
+#: builtin/rev-parse.c
#, c-format
msgid "unknown mode for --show-object-format: %s"
msgstr "--show-object-format 的模å¼æœªçŸ¥ï¼š%s"
#: builtin/revert.c
-msgid "git revert [<options>] <commit-ish>..."
-msgstr "git revert [<é¸é …>] <æ交號>..."
+msgid ""
+"git revert [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] "
+"<commit>..."
+msgstr ""
+"git revert [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] "
+"<commit>..."
#: builtin/revert.c
-msgid "git revert <subcommand>"
-msgstr "git revert <å­æŒ‡ä»¤>"
+msgid "git revert (--continue | --skip | --abort | --quit)"
+msgstr "git revert (--continue | --skip | --abort | --quit)"
#: builtin/revert.c
-msgid "git cherry-pick [<options>] <commit-ish>..."
-msgstr "git cherry-pick [<é¸é …>] <æ交號>..."
+msgid ""
+"git cherry-pick [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff]\n"
+" [-S[<keyid>]] <commit>..."
+msgstr ""
+"git cherry-pick [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff]\n"
+" [-S[<keyid>]] <commit>..."
#: builtin/revert.c
-msgid "git cherry-pick <subcommand>"
-msgstr "git cherry-pick <å­æŒ‡ä»¤>"
+msgid "git cherry-pick (--continue | --skip | --abort | --quit)"
+msgstr "git cherry-pick (--continue | --skip | --abort | --quit)"
#: builtin/revert.c
#, c-format
@@ -13798,8 +14326,14 @@ msgid "cherry-pick failed"
msgstr "æ€é¸å¤±æ•—"
#: builtin/rm.c
-msgid "git rm [<options>] [--] <file>..."
-msgstr "git rm [<é¸é …>] [--] <檔案>..."
+msgid ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [--] [<pathspec>...]"
+msgstr ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+" [--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [--] [<pathspec>...]"
#: builtin/rm.c
msgid ""
@@ -13862,7 +14396,7 @@ msgstr "沒有æ供路徑è¦æ ¼ã€‚我該移除哪個檔案?"
#: builtin/rm.c
msgid "please stage your changes to .gitmodules or stash them to proceed"
-msgstr "請將您的修改暫存到 .gitmodules 中或儲è—後å†ç¹¼çºŒ"
+msgstr "請將您的修改暫存到 .gitmodules 中或貯存後å†ç¹¼çºŒ"
#: builtin/rm.c
#, c-format
@@ -13879,18 +14413,24 @@ msgid ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
" [<host>:]<directory> (--all | <ref>...)"
msgstr ""
"git send-pack [--mirror] [--dry-run] [--force]\n"
" [--receive-pack=<git-receive-pack>]\n"
" [--verbose] [--thin] [--atomic]\n"
-" [<主機>:]<目錄> (--all | <引用>...)"
+" [--[no-]signed | --signed=(true|false|if-asked)]\n"
+" [<host>:]<directory> (--all | <ref>...)"
#: builtin/send-pack.c
msgid "remote name"
msgstr "é ç«¯å稱"
#: builtin/send-pack.c
+msgid "push all refs"
+msgstr "推é€æ‰€æœ‰å¼•ç”¨"
+
+#: builtin/send-pack.c
msgid "use stateless RPC protocol"
msgstr "使用無狀態的 RPC å”定"
@@ -13915,8 +14455,9 @@ msgid "using multiple --group options with stdin is not supported"
msgstr "ä¸æ”¯æ´åœ¨æ¨™æº–輸入使用多個 --group é¸é …"
#: builtin/shortlog.c
-msgid "using --group=trailer with stdin is not supported"
-msgstr "ä¸æ”¯æ´åœ¨æ¨™æº–輸入使用 --group=trailer"
+#, c-format
+msgid "using %s with stdin is not supported"
+msgstr "ä¸æ”¯æ´å° %s 使用 stdin"
#: builtin/shortlog.c
#, c-format
@@ -13964,13 +14505,14 @@ msgid ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
" [--current] [--color[=<when>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<rev> | <glob>)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<rev> | <glob>)...]"
msgstr ""
"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
-" [--current] [--color[=<何時>] | --no-color] [--sparse]\n"
+" [--current] [--color[=<when>] | --no-color] [--sparse]\n"
" [--more=<n> | --list | --independent | --merge-base]\n"
-" [--no-name | --sha1-name] [--topics] [(<版本> | <è¬ç”¨å­—å…ƒ"
-">)...]"
+" [--no-name | --sha1-name] [--topics]\n"
+" [(<rev> | <glob>)...]"
#: builtin/show-branch.c
msgid "git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]"
@@ -14096,17 +14638,41 @@ msgstr "未知的雜湊算法"
#: builtin/show-ref.c
msgid ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...]"
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<pattern>...]"
+msgstr ""
+"git show-ref [--head] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+" [--heads] [--] [<pattern>...]"
+
+#: builtin/show-ref.c
+msgid ""
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<ref>...]"
msgstr ""
-"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --"
-"hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<模å¼>...]"
+"git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+" [--] [<ref>...]"
#: builtin/show-ref.c
msgid "git show-ref --exclude-existing[=<pattern>]"
msgstr "git show-ref --exclude-existing[=<模å¼>]"
#: builtin/show-ref.c
+msgid "git show-ref --exists <ref>"
+msgstr "git show-ref --exists <ref>"
+
+#: builtin/show-ref.c
+msgid "reference does not exist"
+msgstr "引用ä¸å­˜åœ¨"
+
+#: builtin/show-ref.c
+msgid "failed to look up reference"
+msgstr "無法查詢引用"
+
+#: builtin/show-ref.c
msgid "only show tags (can be combined with heads)"
msgstr "åªé¡¯ç¤ºæ¨™ç±¤ï¼ˆå¯ä»¥å’Œé ­å…±ç”¨ï¼‰"
@@ -14115,6 +14681,10 @@ msgid "only show heads (can be combined with tags)"
msgstr "åªé¡¯ç¤ºé ­ï¼ˆå¯ä»¥å’Œæ¨™ç±¤å…±ç”¨ï¼‰"
#: builtin/show-ref.c
+msgid "check for reference existence without resolving"
+msgstr "檢查引用是å¦å­˜åœ¨ä½†ä¸è§£æž"
+
+#: builtin/show-ref.c
msgid "stricter reference checking, requires exact ref path"
msgstr "更嚴格的引用檢測,需è¦ç²¾ç¢ºçš„引用路徑"
@@ -14139,8 +14709,12 @@ msgid "show refs from stdin that aren't in local repository"
msgstr "顯示從標準輸入中讀入的ä¸åœ¨æœ¬æ©Ÿç‰ˆæœ¬åº«ä¸­çš„引用"
#: builtin/sparse-checkout.c
-msgid "git sparse-checkout (init|list|set|add|reapply|disable) <options>"
-msgstr "git sparse-checkout (init|list|set|add|reapply|disable) <é¸é …>"
+msgid ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
+msgstr ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
#: builtin/sparse-checkout.c
msgid "this worktree is not sparse"
@@ -14182,7 +14756,7 @@ msgstr "以 cone 模å¼åˆå§‹åŒ–稀ç–簽出"
msgid "toggle the use of a sparse index"
msgstr "切æ›æ˜¯å¦ä½¿ç”¨ç¨€ç–索引"
-#: builtin/sparse-checkout.c commit-graph.c midx.c
+#: builtin/sparse-checkout.c commit-graph.c midx.c sequencer.c
#, c-format
msgid "unable to create leading directories of %s"
msgstr "ä¸èƒ½ç‚º %s 建立先導目錄"
@@ -14281,84 +14855,93 @@ msgstr "必須在稀ç–æ交æ‰èƒ½é‡æ–°å¥—用稀ç–æ¨£å¼ (sparsity pattern)"
msgid "error while refreshing working directory"
msgstr "é‡æ–°æ•´ç†å·¥ä½œç›®éŒ„時發生錯誤"
-#: builtin/stash.c
-msgid "git stash list [<options>]"
-msgstr "git stash list [<é¸é …>]"
+#: builtin/sparse-checkout.c
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
-#: builtin/stash.c
-msgid "git stash show [<options>] [<stash>]"
-msgstr "git stash show [<é¸é …>] [<stash>]"
+#: builtin/sparse-checkout.c
+msgid "terminate input and output files by a NUL character"
+msgstr "使用 NUL 字元終止輸入和輸出檔案"
-#: builtin/stash.c
-msgid "git stash drop [-q|--quiet] [<stash>]"
-msgstr "git stash drop [-q|--quiet] [<stash>]"
+#: builtin/sparse-checkout.c
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
+"與 --rules-file æ­é…使用時,將 patterns (模å¼) 解釋為 cone 模å¼çš„ patterns"
-#: builtin/stash.c
-msgid "git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"
+#: builtin/sparse-checkout.c
+msgid "use patterns in <file> instead of the current ones."
+msgstr "使用 <file> 中的(而éžç›®å‰ä½¿ç”¨çš„)模å¼ã€‚"
#: builtin/stash.c
-msgid "git stash branch <branchname> [<stash>]"
-msgstr "git stash branch <分支å> [<stash>]"
+msgid "git stash list [<log-options>]"
+msgstr "git stash list [<log-options>]"
#: builtin/stash.c
msgid ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
-" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
-" [--] [<pathspec>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<diff-"
+"options>] [<stash>]"
msgstr ""
-"git stash [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <訊æ¯>]\n"
-" [--pathspec-from-file=<檔案> [--pathspec-file-nul]]\n"
-" [--] [<路徑è¦æ ¼>...]]"
+"git stash show [-u | --include-untracked | --only-untracked] [<diff-"
+"options>] [<stash>]"
#: builtin/stash.c
-msgid ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
-msgstr ""
-"git stash save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--"
-"quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<訊æ¯>]"
+msgid "git stash drop [-q | --quiet] [<stash>]"
+msgstr "git stash drop [-q | --quiet] [<stash>]"
+
+#: builtin/stash.c
+msgid "git stash pop [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash pop [--index] [-q | --quiet] [<stash>]"
#: builtin/stash.c
-msgid "git stash pop [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash pop [--index] [-q|--quiet] [<stash>]"
+msgid "git stash apply [--index] [-q | --quiet] [<stash>]"
+msgstr "git stash apply [--index] [-q | --quiet] [<stash>]"
#: builtin/stash.c
-msgid "git stash apply [--index] [-q|--quiet] [<stash>]"
-msgstr "git stash apply [--index] [-q|--quiet] [<stash>]"
+msgid "git stash branch <branchname> [<stash>]"
+msgstr "git stash branch <分支å> [<stash>]"
#: builtin/stash.c
-msgid "git stash store [-m|--message <message>] [-q|--quiet] <commit>"
-msgstr "git stash store [-m|--message <消æ¯>] [-q|--quiet] <æ交>"
+msgid "git stash store [(-m | --message) <message>] [-q | --quiet] <commit>"
+msgstr "git stash store [(-m | --message) <message>] [-q | --quiet] <commit>"
#: builtin/stash.c
msgid ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<message>]\n"
+" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
" [--] [<pathspec>...]]"
msgstr ""
-"git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [-m|--message <消æ¯>]\n"
-" [--] [<路徑è¦æ ¼>...]]"
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+" [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<message>]\n"
+" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+" [--] [<pathspec>...]]"
#: builtin/stash.c
msgid ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<message>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<message>]"
msgstr ""
-"git stash save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
-" [-u|--include-untracked] [-a|--all] [<消æ¯>]"
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+" [-u | --include-untracked] [-a | --all] [<message>]"
+
+#: builtin/stash.c
+msgid "git stash create [<message>]"
+msgstr "git stash create [<message>]"
#: builtin/stash.c
#, c-format
msgid "'%s' is not a stash-like commit"
-msgstr "'%s' ä¸åƒæ˜¯ä¸€å€‹å„²è—æ交"
+msgstr "'%s' ä¸åƒæ˜¯ä¸€å€‹è²¯å­˜æ交"
#: builtin/stash.c
#, c-format
@@ -14367,7 +14950,7 @@ msgstr "指定了太多的版本:%s"
#: builtin/stash.c
msgid "No stash entries found."
-msgstr "未發ç¾å„²è—æ¢ç›®ã€‚"
+msgstr "未發ç¾è²¯å­˜æ¢ç›®ã€‚"
#: builtin/stash.c
#, c-format
@@ -14391,7 +14974,7 @@ msgstr ""
#: builtin/stash.c
msgid "cannot apply a stash in the middle of a merge"
-msgstr "無法在åˆä½µéŽç¨‹å¥—用儲è—"
+msgstr "無法在åˆä½µéŽç¨‹å¥—用貯存"
#: builtin/stash.c
#, c-format
@@ -14413,11 +14996,11 @@ msgstr "正在åˆä½µ %s å’Œ %s"
#: builtin/stash.c
msgid "Index was not unstashed."
-msgstr "索引未從儲è—中復原。"
+msgstr "索引未從貯存中復原。"
#: builtin/stash.c
msgid "could not restore untracked files from stash"
-msgstr "無法從儲è—æ¢ç›®ä¸­å¾©åŽŸæœªè¿½è¹¤æª”案"
+msgstr "無法從貯存æ¢ç›®ä¸­å¾©åŽŸæœªè¿½è¹¤æª”案"
#: builtin/stash.c
msgid "attempt to recreate the index"
@@ -14431,16 +15014,16 @@ msgstr "æ¨æ£„了 %s(%s)"
#: builtin/stash.c
#, c-format
msgid "%s: Could not drop stash entry"
-msgstr "%s:無法æ¨æ£„儲è—æ¢ç›®"
+msgstr "%s:無法æ¨æ£„貯存æ¢ç›®"
#: builtin/stash.c
#, c-format
msgid "'%s' is not a stash reference"
-msgstr "'%s' ä¸æ˜¯ä¸€å€‹å„²è—引用"
+msgstr "'%s' ä¸æ˜¯ä¸€å€‹è²¯å­˜å¼•ç”¨"
#: builtin/stash.c
msgid "The stash entry is kept in case you need it again."
-msgstr "儲è—æ¢ç›®è¢«ä¿ç•™ä»¥å‚™æ‚¨å†æ¬¡éœ€è¦ã€‚"
+msgstr "貯存æ¢ç›®è¢«ä¿ç•™ä»¥å‚™æ‚¨å†æ¬¡éœ€è¦ã€‚"
#: builtin/stash.c
msgid "No branch name specified"
@@ -14456,11 +15039,11 @@ msgstr "無法解包樹"
#: builtin/stash.c
msgid "include untracked files in the stash"
-msgstr "在儲è—å€åŒ…å«æœªè¿½è¹¤æª”案"
+msgstr "在貯存å€åŒ…å«æœªè¿½è¹¤æª”案"
#: builtin/stash.c
msgid "only show untracked files in the stash"
-msgstr "åªåœ¨å„²è—å€é¡¯ç¤ºæœªè¿½è¹¤æª”案"
+msgstr "åªåœ¨è²¯å­˜å€é¡¯ç¤ºæœªè¿½è¹¤æª”案"
#: builtin/stash.c
#, c-format
@@ -14469,7 +15052,7 @@ msgstr "無法用 %2$s 更新 %1$s"
#: builtin/stash.c
msgid "stash message"
-msgstr "儲è—說明"
+msgstr "貯存說明"
#: builtin/stash.c
msgid "\"git stash store\" requires one <commit> argument"
@@ -14525,7 +15108,7 @@ msgstr "沒有è¦å„²å­˜çš„本機修改"
#: builtin/stash.c
msgid "Cannot initialize stash"
-msgstr "無法åˆå§‹åŒ–儲è—"
+msgstr "無法åˆå§‹åŒ–貯存"
#: builtin/stash.c
msgid "Cannot save the current status"
@@ -14546,11 +15129,11 @@ msgstr "ä¿æŒç´¢å¼•"
#: builtin/stash.c
msgid "stash staged changes only"
-msgstr "åªå„²è—暫存變更"
+msgstr "åªè²¯å­˜æš«å­˜è®Šæ›´"
#: builtin/stash.c
msgid "stash in patch mode"
-msgstr "以修補檔模å¼å„²è—"
+msgstr "以修補檔模å¼è²¯å­˜"
#: builtin/stash.c
msgid "quiet mode"
@@ -14558,7 +15141,7 @@ msgstr "éœé»˜æ¨¡å¼"
#: builtin/stash.c
msgid "include untracked files in stash"
-msgstr "儲è—中包å«æœªè¿½è¹¤æª”案"
+msgstr "貯存中包å«æœªè¿½è¹¤æª”案"
#: builtin/stash.c
msgid "include ignore files"
@@ -14579,20 +15162,17 @@ msgstr "期望一個完整的引用å稱,å»å¾—到 %s"
#: builtin/submodule--helper.c
#, c-format
+msgid "could not get a repository handle for submodule '%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'。å‡å®šé€™å€‹ç‰ˆæœ¬åº«æ˜¯å…¶è‡ªèº«çš„官方上游。"
#: builtin/submodule--helper.c
-msgid "alternative anchor for relative paths"
-msgstr "相å°è·¯å¾‘的替代錨記(anchor)"
-
-#: builtin/submodule--helper.c
-msgid "git submodule--helper list [--prefix=<path>] [<path>...]"
-msgstr "git submodule--helper list [--prefix=<路徑>] [<路徑>...]"
-
-#: builtin/submodule--helper.c
#, c-format
msgid "No url found for submodule path '%s' in .gitmodules"
msgstr "在 .gitmodules 中未找到å­æ¨¡çµ„ '%s' çš„ url"
@@ -14630,8 +15210,8 @@ msgid "recurse into nested submodules"
msgstr "éžè¿´é€²å…¥åµŒå¥—å­æ¨¡çµ„中"
#: builtin/submodule--helper.c
-msgid "git submodule--helper foreach [--quiet] [--recursive] [--] <command>"
-msgstr "git submodule--helper foreach [--quiet] [--recursive] [--] <命令>"
+msgid "git submodule foreach [--quiet] [--recursive] [--] <command>"
+msgstr "git submodule foreach [--quiet] [--recursive] [--] <command>"
#: builtin/submodule--helper.c
#, c-format
@@ -14658,8 +15238,8 @@ msgid "suppress output for initializing a submodule"
msgstr "éš±è—åˆå§‹åŒ–å­æ¨¡çµ„的輸出"
#: builtin/submodule--helper.c
-msgid "git submodule--helper init [<options>] [<path>]"
-msgstr "git submodule--helper init [<é¸é …>] [<路徑>]"
+msgid "git submodule init [<options>] [<path>]"
+msgstr "git submodule init [<options>] [<path>]"
#: builtin/submodule--helper.c
#, c-format
@@ -14691,10 +15271,6 @@ msgid "git submodule status [--quiet] [--cached] [--recursive] [<path>...]"
msgstr "git submodule status [--quiet] [--cached] [--recursive] [<路徑>...]"
#: builtin/submodule--helper.c
-msgid "git submodule--helper name <path>"
-msgstr "git submodule--helper name <路徑>"
-
-#: builtin/submodule--helper.c
#, c-format
msgid "* %s %s(blob)->%s(submodule)"
msgstr "* %s %s(blob)->%s(submodule)"
@@ -14736,8 +15312,8 @@ msgid "limit the summary size"
msgstr "é™åˆ¶æ‘˜è¦å¤§å°"
#: builtin/submodule--helper.c
-msgid "git submodule--helper summary [<options>] [<commit>] [--] [<path>]"
-msgstr "git submodule--helper summary [<é¸é …>] [<æ交>] [--] [<路徑>]"
+msgid "git submodule summary [<options>] [<commit>] [--] [<path>]"
+msgstr "git submodule summary [<options>] [<commit>] [--] [<path>]"
#: builtin/submodule--helper.c
msgid "could not fetch a revision for HEAD"
@@ -14755,11 +15331,6 @@ msgstr "無法為å­æ¨¡çµ„路徑 '%s' 註冊 url"
#: builtin/submodule--helper.c
#, c-format
-msgid "failed to get the default remote for submodule '%s'"
-msgstr "無法得到å­æ¨¡çµ„ '%s' çš„é è¨­é ç«¯é—œè¯"
-
-#: builtin/submodule--helper.c
-#, c-format
msgid "failed to update remote for submodule '%s'"
msgstr "無法為å­æ¨¡çµ„ '%s' æ›´æ–°é ç«¯é—œè¯"
@@ -14768,8 +15339,8 @@ msgid "suppress output of synchronizing submodule url"
msgstr "éš±è—å­æ¨¡çµ„ URL åŒæ­¥çš„輸出"
#: builtin/submodule--helper.c
-msgid "git submodule--helper sync [--quiet] [--recursive] [<path>]"
-msgstr "git submodule--helper sync [--quiet] [--recursive] [<路徑>]"
+msgid "git submodule sync [--quiet] [--recursive] [<path>]"
+msgstr "git submodule sync [--quiet] [--recursive] [<path>]"
#: builtin/submodule--helper.c
#, c-format
@@ -14838,6 +15409,11 @@ msgstr ""
#: builtin/submodule--helper.c
#, c-format
+msgid "could not get a repository handle for gitdir '%s'"
+msgstr "無法å–å¾— gitdir “%s†的版本庫控點"
+
+#: builtin/submodule--helper.c
+#, c-format
msgid "submodule '%s' cannot add alternate: %s"
msgstr "å­æ¨¡çµ„ '%s' ä¸èƒ½æ–°å¢žç‰ˆæœ¬åº«å‚™é¸ï¼š%s"
@@ -14872,6 +15448,10 @@ msgid "could not get submodule directory for '%s'"
msgstr "無法得到 '%s' çš„å­æ¨¡çµ„目錄"
#: builtin/submodule--helper.c
+msgid "alternative anchor for relative paths"
+msgstr "相å°è·¯å¾‘的替代錨記(anchor)"
+
+#: builtin/submodule--helper.c
msgid "where the new submodule will be cloned to"
msgstr "æ–°çš„å­æ¨¡çµ„å°‡è¦è¤‡è£½çš„路徑"
@@ -14907,11 +15487,6 @@ msgstr ""
#: builtin/submodule--helper.c
#, c-format
-msgid "Invalid update mode '%s' for submodule path '%s'"
-msgstr "å­æ¨¡çµ„ '%2$s' çš„æ›´æ–°æ¨¡å¼ '%1$s' 無效"
-
-#: builtin/submodule--helper.c
-#, c-format
msgid "Invalid update mode '%s' configured for submodule path '%s'"
msgstr "為å­æ¨¡çµ„ '%2$s' è¨­å®šçš„æ›´æ–°æ¨¡å¼ '%1$s' 無效"
@@ -14936,6 +15511,11 @@ msgstr "ç•¥éŽå­æ¨¡çµ„ '%s'"
#: builtin/submodule--helper.c
#, c-format
+msgid "cannot clone submodule '%s' without a URL"
+msgstr "無法在沒有網å€çš„情æ³ä¸‹è¤‡è£½ “%s†å­æ¨¡çµ„"
+
+#: builtin/submodule--helper.c
+#, c-format
msgid "Failed to clone '%s'. Retry scheduled"
msgstr "複製 '%s' 失敗。已排程é‡è©¦ä½œæ¥­"
@@ -14998,6 +15578,11 @@ msgstr "已經å–得「%sã€å­æ¨¡çµ„路徑,這個路徑å»æœªåŒ…å«ã€Œ%sã€ã€
#: builtin/submodule--helper.c
#, c-format
+msgid "could not initialize submodule at path '%s'"
+msgstr "無法在「%sã€è·¯å¾‘åˆå§‹åŒ–å­æ¨¡çµ„"
+
+#: builtin/submodule--helper.c
+#, c-format
msgid ""
"Submodule (%s) branch configured to inherit branch from superproject, but "
"the superproject is not on any branch"
@@ -15005,11 +15590,6 @@ msgstr "å­æ¨¡çµ„(%s)的分支設定為繼承上級專案的分支,但是ä
#: builtin/submodule--helper.c
#, c-format
-msgid "could not get a repository handle for submodule '%s'"
-msgstr "無法ç²å¾—å­æ¨¡çµ„ '%s' 的版本庫å¥æŸ„"
-
-#: builtin/submodule--helper.c
-#, c-format
msgid "Unable to find current revision in submodule path '%s'"
msgstr "無法在å­æ¨¡çµ„路徑「%sã€ä¸­å°‹æ‰¾ç›®å‰çš„修訂版本"
@@ -15049,16 +15629,16 @@ msgid "don't fetch new objects from the remote site"
msgstr "ä¸å¾žé ç«¯ç«™å°å–得新物件"
#: builtin/submodule--helper.c
-msgid "path into the working tree"
-msgstr "到工作å€çš„路徑"
+msgid "use the 'checkout' update strategy (default)"
+msgstr "使用 “checkout†更新策略(é è¨­å€¼ï¼‰"
#: builtin/submodule--helper.c
-msgid "path into the working tree, across nested submodule boundaries"
-msgstr "工作å€ä¸­çš„路徑,éžè¿´åµŒå¥—å­æ¨¡çµ„"
+msgid "use the 'merge' update strategy"
+msgstr "使用 “merge†更新策略"
#: builtin/submodule--helper.c
-msgid "rebase, merge, checkout or none"
-msgstr "rebaseã€mergeã€checkout 或 none"
+msgid "use the 'rebase' update strategy"
+msgstr "使用 “rebase†更新策略"
#: builtin/submodule--helper.c
msgid "create a shallow clone truncated to the specified number of revisions"
@@ -15077,6 +15657,10 @@ msgid "don't print cloning progress"
msgstr "ä¸è¦è¼¸å‡ºè¤‡è£½é€²åº¦"
#: builtin/submodule--helper.c
+msgid "disallow cloning into non-empty directory, implies --init"
+msgstr "ä¸å…許複製進éžç©ºç™½ç›®éŒ„ï¼Œéš±å« --init"
+
+#: builtin/submodule--helper.c
msgid ""
"git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] "
"[-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-"
@@ -15088,45 +15672,21 @@ msgstr ""
"shallow] [--reference <repository>] [--recursive] [--[no-]single-branch] "
"[--] [<path>...]"
-#: builtin/submodule--helper.c
-msgid "bad value for update parameter"
-msgstr "update åƒæ•¸å–值錯誤"
-
-#: builtin/submodule--helper.c
-msgid "recurse into submodules"
-msgstr "在å­æ¨¡çµ„中éžè¿´"
-
-#: builtin/submodule--helper.c
-msgid "git submodule--helper absorb-git-dirs [<options>] [<path>...]"
-msgstr "git submodule--helper absorb-git-dirs [<é¸é …>] [<路徑>...]"
-
-#: builtin/submodule--helper.c
-msgid "check if it is safe to write to the .gitmodules file"
-msgstr "檢查寫入 .gitmodules 檔案是å¦å®‰å…¨"
-
-#: builtin/submodule--helper.c
-msgid "unset the config in the .gitmodules file"
-msgstr "å–消 .gitmodules 檔案中的設定"
-
-#: builtin/submodule--helper.c
-msgid "git submodule--helper config <name> [<value>]"
-msgstr "git submodule--helper config <å稱> [<值>]"
-
-#: builtin/submodule--helper.c
-msgid "git submodule--helper config --unset <name>"
-msgstr "git submodule--helper config --unset <å稱>"
+#: builtin/submodule--helper.c submodule.c
+msgid "Failed to resolve HEAD as a valid ref."
+msgstr "無法將 HEAD 解æžç‚ºæœ‰æ•ˆå¼•ç”¨ã€‚"
#: builtin/submodule--helper.c
-msgid "please make sure that the .gitmodules file is in the working tree"
-msgstr "è«‹ç¢ºèª .gitmodules 檔案在工作å€è£¡"
+msgid "git submodule absorbgitdirs [<options>] [<path>...]"
+msgstr "git submodule absorbgitdirs [<options>] [<path>...]"
#: builtin/submodule--helper.c
msgid "suppress output for setting url of a submodule"
msgstr "éš±è—å­æ¨¡çµ„設定 URL 的輸出"
#: builtin/submodule--helper.c
-msgid "git submodule--helper set-url [--quiet] <path> <newurl>"
-msgstr "git submodule--helper set-url [--quiet] <路徑> <新 URL>"
+msgid "git submodule set-url [--quiet] <path> <newurl>"
+msgstr "git submodule set-url [--quiet] <path> <newurl>"
#: builtin/submodule--helper.c
msgid "set the default tracking branch to master"
@@ -15137,14 +15697,12 @@ msgid "set the default tracking branch"
msgstr "設定é è¨­è¿½è¹¤åˆ†æ”¯"
#: builtin/submodule--helper.c
-msgid "git submodule--helper set-branch [-q|--quiet] (-d|--default) <path>"
-msgstr "git submodule--helper set-branch [-q|--quiet] (-d|--default) <path>"
+msgid "git submodule set-branch [-q|--quiet] (-d|--default) <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-d|--default) <path>"
#: builtin/submodule--helper.c
-msgid ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
-msgstr ""
-"git submodule--helper set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
+msgid "git submodule set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
+msgstr "git submodule set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
#: builtin/submodule--helper.c
msgid "--branch or --default required"
@@ -15216,6 +15774,10 @@ msgid "unable to checkout submodule '%s'"
msgstr "無法簽出「%sã€å­æ¨¡çµ„"
#: builtin/submodule--helper.c
+msgid "please make sure that the .gitmodules file is in the working tree"
+msgstr "è«‹ç¢ºèª .gitmodules 檔案在工作å€è£¡"
+
+#: builtin/submodule--helper.c
#, c-format
msgid "Failed to add submodule '%s'"
msgstr "無法加入å­æ¨¡çµ„「%sã€"
@@ -15259,8 +15821,8 @@ msgid ""
msgstr "å°‡å­æ¨¡çµ„çš„å稱設為指定字串,而éžé è¨­ç‚ºå…¶è·¯å¾‘"
#: builtin/submodule--helper.c
-msgid "git submodule--helper add [<options>] [--] <repository> [<path>]"
-msgstr "git submodule--helper add [<é¸é …>] [--] <版本庫> [<路徑>]"
+msgid "git submodule add [<options>] [--] <repository> [<path>]"
+msgstr "git submodule add [<options>] [--] <repository> [<path>]"
#: builtin/submodule--helper.c
msgid "Relative path can only be used from the toplevel of the working tree"
@@ -15276,23 +15838,21 @@ msgstr "版本庫 URL:「%sã€å¿…須是絕å°è·¯å¾‘,或開頭是 ./|../"
msgid "'%s' is not a valid submodule name"
msgstr "「%sã€ä¸æ˜¯æœ‰æ•ˆçš„å­æ¨¡çµ„å稱"
-#: builtin/submodule--helper.c git.c
-#, c-format
-msgid "%s doesn't support --super-prefix"
-msgstr "%s ä¸æ”¯æ´ --super-prefix"
-
#: builtin/submodule--helper.c
-#, c-format
-msgid "'%s' is not a valid submodule--helper subcommand"
-msgstr "'%s' ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„ submodule--helper å­æŒ‡ä»¤"
+msgid "git submodule--helper <command>"
+msgstr "git submodule--helper <command>"
+
+#: builtin/symbolic-ref.c
+msgid "git symbolic-ref [-m <reason>] <name> <ref>"
+msgstr "git symbolic-ref [-m <reason>] <name> <ref>"
#: builtin/symbolic-ref.c
-msgid "git symbolic-ref [<options>] <name> [<ref>]"
-msgstr "git symbolic-ref [<é¸é …>] <å稱> [<引用>]"
+msgid "git symbolic-ref [-q] [--short] [--no-recurse] <name>"
+msgstr "git symbolic-ref [-q] [--short] [--no-recurse] <name>"
#: builtin/symbolic-ref.c
-msgid "git symbolic-ref -d [-q] <name>"
-msgstr "git symbolic-ref -d [-q] <å稱>"
+msgid "git symbolic-ref --delete [-q] <name>"
+msgstr "git symbolic-ref --delete [-q] <name>"
#: builtin/symbolic-ref.c
msgid "suppress error message for non-symbolic (detached) refs"
@@ -15306,6 +15866,10 @@ msgstr "刪除符號引用"
msgid "shorten ref output"
msgstr "縮短引用輸出"
+#: builtin/symbolic-ref.c
+msgid "recursively dereference (default)"
+msgstr "éžè¿´å解引用(é è¨­ï¼‰"
+
#: builtin/symbolic-ref.c builtin/update-ref.c
msgid "reason"
msgstr "原因"
@@ -15316,11 +15880,11 @@ msgstr "更新的原因"
#: builtin/tag.c
msgid ""
-"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]\n"
-" <tagname> [<head>]"
+"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
+" <tagname> [<commit> | <object>]"
msgstr ""
-"git tag [-a | -s | -u <key-id>] [-f] [-m <消æ¯> | -F <檔案>]\n"
-" <標籤å> [<head>]"
+"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
+" <tagname> [<commit> | <object>]"
#: builtin/tag.c
msgid "git tag -d <tagname>..."
@@ -15328,14 +15892,15 @@ msgstr "git tag -d <標籤å>..."
#: builtin/tag.c
msgid ""
-"git tag -l [-n[<num>]] [--contains <commit>] [--no-contains <commit>] [--"
-"points-at <object>]\n"
-" [--format=<format>] [--merged <commit>] [--no-merged <commit>] "
-"[<pattern>...]"
+"git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]\n"
+" [--points-at <object>] [--column[=<options>] | --no-column]\n"
+" [--create-reflog] [--sort=<key>] [--format=<format>]\n"
+" [--merged <commit>] [--no-merged <commit>] [<pattern>...]"
msgstr ""
-"git tag -l [-n[<數字>]] [--contains <æ交>] [--no-contains <æ交>] [--points-"
-"at <物件>]\n"
-" [--format=<æ ¼å¼>] [--merged <æ交>] [--no-merged <æ交>] [<模å¼>...]"
+"git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]\n"
+" [--points-at <object>] [--column[=<options>] | --no-column]\n"
+" [--create-reflog] [--sort=<key>] [--format=<format>]\n"
+" [--merged <commit>] [--no-merged <commit>] [<pattern>...]"
#: builtin/tag.c
msgid "git tag -v [--format=<format>] <tagname>..."
@@ -15514,6 +16079,19 @@ msgid "pack exceeds maximum allowed size"
msgstr "包超éŽäº†æœ€å¤§å…許值"
#: builtin/unpack-objects.c
+msgid "failed to write object in stream"
+msgstr "無法在串æµä¸­å¯«å…¥ç‰©ä»¶"
+
+#: builtin/unpack-objects.c
+#, c-format
+msgid "inflate returned (%d)"
+msgstr "inflate 回傳 (%d)"
+
+#: builtin/unpack-objects.c
+msgid "invalid blob object from stream"
+msgstr "æºè‡ªä¸²æµçš„ blob 物件無效"
+
+#: builtin/unpack-objects.c
msgid "Unpacking objects"
msgstr "展開物件中"
@@ -15674,6 +16252,10 @@ msgid "write index in this format"
msgstr "以這種格å¼å¯«å…¥ç´¢å¼•å€"
#: builtin/update-index.c
+msgid "report on-disk index format version"
+msgstr "回報ç£ç¢Ÿä¸Šç´¢å¼•æ ¼å¼çš„版本"
+
+#: builtin/update-index.c
msgid "enable or disable split index"
msgstr "啟用或åœç”¨ç´¢å¼•åˆ†å‰²"
@@ -15706,6 +16288,16 @@ msgid "clear fsmonitor valid bit"
msgstr "清除 fsmonitor 有效ä½"
#: builtin/update-index.c
+#, c-format
+msgid "%d\n"
+msgstr "%d\n"
+
+#: builtin/update-index.c
+#, c-format
+msgid "index-version: was %d, set to %d"
+msgstr "index-version:曾是 %d,已設為 %d"
+
+#: builtin/update-index.c
msgid ""
"core.splitIndex is set to false; remove or change it, if you really want to "
"enable split index"
@@ -15792,8 +16384,12 @@ msgid "update the info files from scratch"
msgstr "從頭開始更新檔案訊æ¯"
#: builtin/upload-pack.c
-msgid "git upload-pack [<options>] <dir>"
-msgstr "git upload-pack [<é¸é …>] <目錄>"
+msgid ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <directory>"
+msgstr ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+" [--advertise-refs] <directory>"
#: builtin/upload-pack.c t/helper/test-serve-v2.c
msgid "quit after a single request/response exchange"
@@ -15812,8 +16408,8 @@ msgid "interrupt transfer after <n> seconds of inactivity"
msgstr "ä¸æ´»å‹• <n> 秒é˜å¾Œçµ‚止傳輸"
#: builtin/verify-commit.c
-msgid "git verify-commit [-v | --verbose] <commit>..."
-msgstr "git verify-commit [-v | --verbose] <æ交>..."
+msgid "git verify-commit [-v | --verbose] [--raw] <commit>..."
+msgstr "git verify-commit [-v | --verbose] [--raw] <commit>..."
#: builtin/verify-commit.c
msgid "print commit contents"
@@ -15824,8 +16420,8 @@ msgid "print raw gpg status output"
msgstr "列å°åŽŸå§‹ gpg 狀態輸出"
#: builtin/verify-pack.c
-msgid "git verify-pack [-v | --verbose] [-s | --stat-only] <pack>..."
-msgstr "git verify-pack [-v | --verbose] [-s | --stat-only] <包>..."
+msgid "git verify-pack [-v | --verbose] [-s | --stat-only] [--] <pack>.idx..."
+msgstr "git verify-pack [-v | --verbose] [-s | --stat-only] [--] <pack>.idx..."
#: builtin/verify-pack.c
msgid "verbose"
@@ -15836,44 +16432,82 @@ msgid "show statistics only"
msgstr "åªé¡¯ç¤ºçµ±è¨ˆ"
#: builtin/verify-tag.c
-msgid "git verify-tag [-v | --verbose] [--format=<format>] <tag>..."
-msgstr "git verify-tag [-v | --verbose] [--format=<æ ¼å¼>] <標籤>..."
+msgid "git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."
+msgstr "git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."
#: builtin/verify-tag.c
msgid "print tag contents"
msgstr "列å°æ¨™ç±¤å…§å®¹"
#: builtin/worktree.c
-msgid "git worktree add [<options>] <path> [<commit-ish>]"
-msgstr "git worktree add [<é¸é …>] <路徑> [<æ交>]"
+msgid ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <string>]]\n"
+" [--orphan] [(-b | -B) <new-branch>] <path> [<commit-ish>]"
+msgstr ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <string>]]\n"
+" [--orphan] [(-b | -B) <new-branch>] <path> [<commit-ish>]"
#: builtin/worktree.c
-msgid "git worktree list [<options>]"
-msgstr "git worktree list [<é¸é …>]"
+msgid "git worktree list [-v | --porcelain [-z]]"
+msgstr "git worktree list [-v | --porcelain [-z]]"
#: builtin/worktree.c
-msgid "git worktree lock [<options>] <path>"
-msgstr "git worktree lock [<é¸é …>] <路徑>"
+msgid "git worktree lock [--reason <string>] <worktree>"
+msgstr "git worktree lock [--reason <string>] <worktree>"
#: builtin/worktree.c
msgid "git worktree move <worktree> <new-path>"
msgstr "git worktree move <工作å€> <新路徑>"
#: builtin/worktree.c
-msgid "git worktree prune [<options>]"
-msgstr "git worktree prune [<é¸é …>]"
+msgid "git worktree prune [-n] [-v] [--expire <expire>]"
+msgstr "git worktree prune [-n] [-v] [--expire <expire>]"
#: builtin/worktree.c
-msgid "git worktree remove [<options>] <worktree>"
-msgstr "git worktree remove [<é¸é …>] <工作å€>"
+msgid "git worktree remove [-f] <worktree>"
+msgstr "git worktree remove [-f] <worktree>"
#: builtin/worktree.c
msgid "git worktree repair [<path>...]"
msgstr "git worktree repair [<路徑>...]"
#: builtin/worktree.c
-msgid "git worktree unlock <path>"
-msgstr "git worktree unlock <路徑>"
+msgid "git worktree unlock <worktree>"
+msgstr "git worktree unlock <worktree>"
+
+#: builtin/worktree.c
+msgid "No possible source branch, inferring '--orphan'"
+msgstr "沒有å¯èƒ½çš„來æºåˆ†æ”¯ï¼ŒæŽ¨æ¸¬ç‚º “--orphanâ€"
+
+#: builtin/worktree.c
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+msgstr ""
+"如果您是想è¦åœ¨é€™å€‹ç‰ˆæœ¬åº«å»ºç«‹ä¸€å€‹å·¥ä½œå€ï¼Œè£¡é¢åŒ…å«ä¸€å€‹\n"
+"未誕生分支(å³æ²’有æ交的分支),å¯ä»¥ä½¿ç”¨ --orphan é”到\n"
+"這個效果:\n"
+"\n"
+" git worktree add --orphan -b %s %s\n"
+
+#: builtin/worktree.c
+#, c-format
+msgid ""
+"If you meant to create a worktree containing a new unborn branch\n"
+"(branch with no commits) for this repository, you can do so\n"
+"using the --orphan flag:\n"
+"\n"
+" git worktree add --orphan %s\n"
+msgstr ""
+"如果您是想è¦åœ¨é€™å€‹ç‰ˆæœ¬åº«å»ºç«‹ä¸€å€‹å·¥ä½œå€ï¼Œè£¡é¢åŒ…å«ä¸€å€‹\n"
+"未誕生分支(å³æ²’有æ交的分支),å¯ä»¥ä½¿ç”¨ --orphan é”到\n"
+"這個效果:\n"
+"\n"
+" git worktree add --orphan %s\n"
#: builtin/worktree.c
#, c-format
@@ -15942,6 +16576,11 @@ msgstr "正在åˆå§‹åŒ–"
#: builtin/worktree.c
#, c-format
+msgid "could not find created worktree '%s'"
+msgstr "找ä¸åˆ°å»ºç«‹çš„工作å€ã€Œ%sã€"
+
+#: builtin/worktree.c
+#, c-format
msgid "Preparing worktree (new branch '%s')"
msgstr "準備工作å€ï¼ˆæ–°åˆ†æ”¯ '%s')"
@@ -15957,10 +16596,34 @@ msgstr "準備工作å€ï¼ˆç°½å‡º '%s')"
#: builtin/worktree.c
#, c-format
+msgid "unreachable: invalid reference: %s"
+msgstr "ä¸å¯é”:無效引用:%s"
+
+#: builtin/worktree.c
+#, c-format
msgid "Preparing worktree (detached HEAD %s)"
msgstr "準備工作å€ï¼ˆåˆ†é›¢é–‹é ­æŒ‡æ¨™ %s)"
#: builtin/worktree.c
+#, c-format
+msgid ""
+"HEAD points to an invalid (or orphaned) reference.\n"
+"HEAD path: '%s'\n"
+"HEAD contents: '%s'"
+msgstr ""
+"HEAD 指å‘無效(或孤立)引用。\n"
+"HEAD 路徑:“%sâ€\n"
+"HEAD 內容:“%sâ€"
+
+#: builtin/worktree.c
+msgid ""
+"No local or remote refs exist despite at least one remote\n"
+"present, stopping; use 'add -f' to override or fetch a remote first"
+msgstr ""
+"å³ä½¿æœ‰æ供一個é ç«¯ï¼Œå»ä¸å­˜åœ¨æœ¬æ©Ÿæˆ–é ç«¯å¼•ç”¨ï¼Œ\n"
+"æ•…åœæ­¢ã€‚使用 “add -f†先覆蓋或抓å–é ç«¯"
+
+#: builtin/worktree.c
msgid "checkout <branch> even if already checked out in other worktree"
msgstr "簽出 <分支>,å³ä½¿å·²ç¶“被簽出到其它工作å€"
@@ -15973,6 +16636,10 @@ msgid "create or reset a branch"
msgstr "建立或é‡è¨­ä¸€å€‹åˆ†æ”¯"
#: builtin/worktree.c
+msgid "create unborn branch"
+msgstr "建立未誕生分支"
+
+#: builtin/worktree.c
msgid "populate the new working tree"
msgstr "生æˆæ–°çš„工作å€"
@@ -15998,6 +16665,11 @@ msgid "options '%s', '%s', and '%s' cannot be used together"
msgstr "「%sã€ã€ã€Œ%sã€å’Œã€Œ%sã€é¸é …ä¸å¾—åŒæ™‚使用"
#: builtin/worktree.c
+#, c-format
+msgid "option '%s' and commit-ish cannot be used together"
+msgstr "“%s†é¸é …å’Œæ交號ä¸å¾—åŒæ™‚使用"
+
+#: builtin/worktree.c
msgid "added with --lock"
msgstr "已使用 --lock 加入"
@@ -16153,10 +16825,82 @@ msgstr "å°‡ <å‰ç¶´> å­ç›®éŒ„內容寫到一個樹狀物件"
msgid "only useful for debugging"
msgstr "åªå°é™¤éŒ¯æœ‰ç”¨"
+#: bulk-checkin.c
+msgid "core.fsyncMethod = batch is unsupported on this platform"
+msgstr "core.fsyncMethod = batch ä¸æ”¯æ´æœ¬å¹³å°"
+
+#: bundle-uri.c
+#, c-format
+msgid "could not parse bundle list key %s with value '%s'"
+msgstr "無法解æžå¥—ä»¶åŒ…æ¸…å–®éµ %s 的值 “%sâ€"
+
+#: bundle-uri.c
+#, c-format
+msgid "bundle list at '%s' has no mode"
+msgstr "ä½æ–¼ “%s†的套件包清單沒有模å¼"
+
+#: bundle-uri.c
+msgid "failed to create temporary file"
+msgstr "無法建立暫存檔"
+
+#: bundle-uri.c
+msgid "insufficient capabilities"
+msgstr "功能ä¸è¶³"
+
+#: bundle-uri.c
+#, c-format
+msgid "file downloaded from '%s' is not a bundle"
+msgstr "從 “%s†下載的檔案ä¸æ˜¯å¥—件包"
+
+#: bundle-uri.c
+msgid "failed to store maximum creation token"
+msgstr "無法儲存最大的建立權æ–"
+
+#: bundle-uri.c
+#, c-format
+msgid "unrecognized bundle mode from URI '%s'"
+msgstr "無法識別從 URI “%s†å–回的套件包模å¼"
+
+#: bundle-uri.c
+#, c-format
+msgid "exceeded bundle URI recursion limit (%d)"
+msgstr "超出套件包 URI éžè¿´é™åˆ¶ (%d)"
+
+#: bundle-uri.c
+#, c-format
+msgid "failed to download bundle from URI '%s'"
+msgstr "無法從 “%s†URI 下載套件包"
+
+#: bundle-uri.c
+#, c-format
+msgid "file at URI '%s' is not a bundle or bundle list"
+msgstr "ä½æ–¼ URI “%s†的檔案ä¸æ˜¯å¥—件包或套件包清單"
+
+#: bundle-uri.c
+#, c-format
+msgid "bundle-uri: unexpected argument: '%s'"
+msgstr "bundle-uri: éžé æœŸçš„引數:“%sâ€"
+
+#: bundle-uri.c
+msgid "bundle-uri: expected flush after arguments"
+msgstr "bundle-uri: 引數後應該有一個 flush 包"
+
+#: bundle-uri.c
+msgid "bundle-uri: got an empty line"
+msgstr "bundle-uri: 收到空白列"
+
+#: bundle-uri.c
+msgid "bundle-uri: line is not of the form 'key=value'"
+msgstr "bundle-uri: 列的格å¼ä¸æ˜¯ “key=valueâ€"
+
+#: bundle-uri.c
+msgid "bundle-uri: line has empty key or value"
+msgstr "bundle-uri: 列有空éµæˆ–空值"
+
#: bundle.c
#, c-format
msgid "unrecognized bundle hash algorithm: %s"
-msgstr "無法識別的套件雜湊演算法:%s"
+msgstr "無法識別的套件包雜湊演算法:%s"
#: bundle.c
#, c-format
@@ -16166,7 +16910,7 @@ msgstr "未知功能 '%s'"
#: bundle.c
#, c-format
msgid "'%s' does not look like a v2 or v3 bundle file"
-msgstr "'%s' ä¸åƒæ˜¯ä¸€å€‹ v2 或 v3 版本的套件檔案"
+msgstr "“%s†ä¸åƒæ˜¯ä¸€å€‹ v2 或 v3 版本的套件包檔案"
#: bundle.c
#, c-format
@@ -16179,27 +16923,43 @@ msgstr "版本庫中缺少這些必備的æ交:"
#: bundle.c
msgid "need a repository to verify a bundle"
-msgstr "需è¦ç‰ˆæœ¬åº«é©—證套件"
+msgstr "需è¦ç‰ˆæœ¬åº«é©—證套件包"
+
+#: bundle.c
+msgid ""
+"some prerequisite commits exist in the object store, but are not connected "
+"to the repository's history"
+msgstr "一些å‰ææ交存在於物件儲存å€ï¼Œä½†æœªé€£æŽ¥åˆ°ç‰ˆæœ¬åº«çš„æ­·å²è¨˜éŒ„"
#: bundle.c
#, c-format
msgid "The bundle contains this ref:"
msgid_plural "The bundle contains these %<PRIuMAX> refs:"
-msgstr[0] "這個套件å«æœ‰é€™ %<PRIuMAX> 個引用:"
+msgstr[0] "這個套件包,å«æœ‰é€™ %<PRIuMAX> 個引用:"
#: bundle.c
msgid "The bundle records a complete history."
-msgstr "這個套件記錄完整歷å²ç´€éŒ„。"
+msgstr "這個套件包記下了完整歷å²ç´€éŒ„。"
#: bundle.c
#, c-format
msgid "The bundle requires this ref:"
msgid_plural "The bundle requires these %<PRIuMAX> refs:"
-msgstr[0] "這個套件需è¦é€™ %<PRIuMAX> 個引用:"
+msgstr[0] "這個套件包需è¦é€™ %<PRIuMAX> 個引用:"
+
+#: bundle.c
+#, c-format
+msgid "The bundle uses this hash algorithm: %s"
+msgstr "本套件包採用此雜湊演算法:%s"
+
+#: bundle.c
+#, c-format
+msgid "The bundle uses this filter: %s"
+msgstr "本套件包使用此éŽæ¿¾å™¨ï¼š%s"
#: bundle.c
msgid "unable to dup bundle descriptor"
-msgstr "無法複製套件æ述符"
+msgstr "無法複製套件包æè¿°å…ƒ"
#: bundle.c
msgid "Could not spawn pack-objects"
@@ -16217,16 +16977,16 @@ msgstr "引用 '%s' 被 rev-list é¸é …排除"
#: bundle.c
#, c-format
msgid "unsupported bundle version %d"
-msgstr "ä¸æ”¯æ´çš„套件版本 %d"
+msgstr "ä¸æ”¯æ´çš„套件包版本 %d"
#: bundle.c
#, c-format
msgid "cannot write bundle version %d with algorithm %s"
-msgstr "無法寫入 %2$s 演算法的套件版本 %1$d"
+msgstr "無法寫入使用 %2$s 演算法的套件包版本 %1$d"
#: bundle.c
msgid "Refusing to create empty bundle."
-msgstr "ä¸èƒ½å»ºç«‹ç©ºå¥—件。"
+msgstr "ä¸èƒ½å»ºç«‹ç©ºå¥—件包。"
#: bundle.c
#, c-format
@@ -16243,6 +17003,11 @@ msgstr "終止å€å¡Š id 出ç¾çš„時間早於é æœŸ"
#: chunk-format.c
#, c-format
+msgid "chunk id %<PRIx32> not %d-byte aligned"
+msgstr "å€å¡Š ID %<PRIx32> 沒有以 %d ä½å…ƒçµ„為單ä½å°é½Š"
+
+#: chunk-format.c
+#, c-format
msgid "improper chunk offset(s) %<PRIx64> and %<PRIx64>"
msgstr "ä¸æ­£ç¢ºçš„å€å¡Šå移 %<PRIx64> åŠ %<PRIx64>"
@@ -16310,8 +17075,8 @@ msgid "Move objects and refs by archive"
msgstr "é€éŽæ­¸æª”移動物件和引用"
#: command-list.h
-msgid "Provide content or type and size information for repository objects"
-msgstr "æ供版本庫物件的內容ã€é¡žåž‹æˆ–大å°"
+msgid "Provide contents or details of repository objects"
+msgstr "æ供版本庫物件的內容或詳細資訊"
#: command-list.h
msgid "Display gitattributes information"
@@ -16379,7 +17144,7 @@ msgstr "å–得和設定版本庫或者全域é¸é …"
#: command-list.h
msgid "Count unpacked number of objects and their disk consumption"
-msgstr "計算未打包物件的數é‡å’Œç£ç¢Ÿç©ºé–“å ç”¨"
+msgstr "計算未打包物件的數é‡å’Œç£ç¢Ÿç©ºé–“佔用"
#: command-list.h
msgid "Retrieve and store user credentials"
@@ -16414,6 +17179,10 @@ msgid "Give an object a human readable name based on an available ref"
msgstr "基於一個ç¾å­˜çš„引用為一個物件起一個å¯è®€çš„å稱"
#: command-list.h
+msgid "Generate a zip archive of diagnostic information"
+msgstr "產生診斷資訊的 zip å°å­˜æª”"
+
+#: command-list.h
msgid "Show changes between commits, commit and working tree, etc"
msgstr "顯示æ交之間ã€æ交和工作å€ä¹‹é–“等的差異"
@@ -16490,8 +17259,8 @@ msgid "A portable graphical interface to Git"
msgstr "一個便攜的 Git 圖形用戶端"
#: command-list.h
-msgid "Compute object ID and optionally creates a blob from a file"
-msgstr "從一個檔案計算物件 ID,並å¯ä»¥å»ºç«‹ blob 資料物件"
+msgid "Compute object ID and optionally create an object from a file"
+msgstr "從一個檔案計算物件 ID,也能順帶建立一個物件"
#: command-list.h
msgid "Display help information about Git"
@@ -16582,8 +17351,8 @@ msgid "The standard helper program to use with git-merge-index"
msgstr "與 git-merge-index 一起使用的標準嚮導程å¼"
#: command-list.h
-msgid "Show three-way merge without touching index"
-msgstr "顯示三路åˆä½µè€Œä¸å‹•ç´¢å¼•"
+msgid "Perform merge without touching index or working tree"
+msgstr "在ä¸æŽ¥è§¸ç´¢å¼•æˆ–工作å€çš„情æ³ä¸‹åŸ·è¡Œåˆä½µ"
#: command-list.h
msgid "Run merge conflict resolution tools to resolve merge conflicts"
@@ -16687,6 +17456,10 @@ msgid "Create, list, delete refs to replace objects"
msgstr "建立ã€åˆ—出ã€åˆªé™¤ç‰©ä»¶å–代引用"
#: command-list.h
+msgid "EXPERIMENTAL: Replay commits on a new base, works with bare repos too"
+msgstr "實驗性功能:在新的基底é‡æ”¾æ交,亦支æ´è£¸ç‰ˆæœ¬åº«"
+
+#: command-list.h
msgid "Generates a summary of pending changes"
msgstr "生æˆå¾…定更改的摘è¦"
@@ -16769,7 +17542,7 @@ msgstr "將檔案內容新增到索引"
#: command-list.h
msgid "Stash the changes in a dirty working directory away"
-msgstr "儲è—髒工作å€ä¸­çš„修改"
+msgstr "貯存髒工作å€ä¸­çš„修改"
#: command-list.h
msgid "Show the working tree status"
@@ -16844,7 +17617,11 @@ msgid "Check the GPG signature of tags"
msgstr "檢查標籤的 GPG ç°½å"
#: command-list.h
-msgid "Show logs with difference each commit introduces"
+msgid "Display version information about Git"
+msgstr "顯示 Git 的版本資訊"
+
+#: command-list.h
+msgid "Show logs with differences each commit introduces"
msgstr "顯示æ¯ä¸€å€‹æ交引入的差異日誌"
#: command-list.h
@@ -16861,7 +17638,7 @@ msgstr "定義路徑的屬性"
#: command-list.h
msgid "Git command-line interface and conventions"
-msgstr "Git 指令列介é¢å’Œç´„定"
+msgstr "Git 命令列介é¢å’Œç´„定"
#: command-list.h
msgid "A Git core tutorial for developers"
@@ -16888,6 +17665,30 @@ msgid "Frequently asked questions about using Git"
msgstr "Git 使用的常見å•é¡Œ"
#: command-list.h
+msgid "The bundle file format"
+msgstr "套件包檔案格å¼"
+
+#: command-list.h
+msgid "Chunk-based file formats"
+msgstr "以å€å¡Šç‚ºåŸºç¤Žçš„檔案格å¼"
+
+#: command-list.h
+msgid "Git commit-graph format"
+msgstr "Git æ交圖格å¼"
+
+#: command-list.h
+msgid "Git index format"
+msgstr "Git 索引格å¼"
+
+#: command-list.h
+msgid "Git pack format"
+msgstr "Git å°åŒ…æ ¼å¼"
+
+#: command-list.h
+msgid "Git cryptographic signature formats"
+msgstr "Git 密碼編譯簽章格å¼"
+
+#: command-list.h
msgid "A Git Glossary"
msgstr "Git 詞彙表"
@@ -16916,6 +17717,26 @@ msgid "Git namespaces"
msgstr "Git å字空間"
#: command-list.h
+msgid "Protocol v0 and v1 capabilities"
+msgstr "v0 å’Œ v1 版通訊å”定功能"
+
+#: command-list.h
+msgid "Things common to various protocols"
+msgstr "å„種通訊å”定共通的部分"
+
+#: command-list.h
+msgid "Git HTTP-based protocols"
+msgstr "Git 以 HTTP 為基礎的通訊å”定"
+
+#: command-list.h
+msgid "How packs are transferred over-the-wire"
+msgstr "å°åŒ…在線上傳輸的方å¼"
+
+#: command-list.h
+msgid "Git Wire Protocol, Version 2"
+msgstr "Git Wire 通訊å”定,第 2 版"
+
+#: command-list.h
msgid "Helper programs to interact with remote repositories"
msgstr "用來與é ç«¯ç‰ˆæœ¬åº«äº’å‹•çš„å”助工具"
@@ -16947,11 +17768,46 @@ msgstr "Git web 介é¢ï¼ˆGit 版本庫的 web å‰ç«¯ï¼‰"
msgid "An overview of recommended workflows with Git"
msgstr "Git 推薦的工作æµæ¦‚覽"
+#: command-list.h
+msgid "A tool for managing large Git repositories"
+msgstr "用來管ç†å¤§åž‹ Git 版本庫的工具"
+
#: commit-graph.c
msgid "commit-graph file is too small"
msgstr "æ交圖形檔案太å°"
#: commit-graph.c
+msgid "commit-graph oid fanout chunk is wrong size"
+msgstr "æ交圖形 OID 扇出å€å¡Šå¤§å°æœ‰èª¤"
+
+#: commit-graph.c
+msgid "commit-graph fanout values out of order"
+msgstr "æ交圖形扇出的數值失åº"
+
+#: commit-graph.c
+msgid "commit-graph OID lookup chunk is the wrong size"
+msgstr "æ交圖形 OID 查詢å€å¡Šçš„大å°æœ‰èª¤"
+
+#: commit-graph.c
+msgid "commit-graph commit data chunk is wrong size"
+msgstr "æ交圖形的æ交資料å€å¡Šå¤§å°æœ‰èª¤"
+
+#: commit-graph.c
+msgid "commit-graph generations chunk is wrong size"
+msgstr "æ交圖形的世代å€å¡Šå¤§å°æœ‰èª¤"
+
+#: commit-graph.c
+msgid "commit-graph changed-path index chunk is too small"
+msgstr "æ交圖形的更動路徑索引å€å¡ŠéŽå°"
+
+#: commit-graph.c
+#, c-format
+msgid ""
+"ignoring too-small changed-path chunk (%<PRIuMAX> < %<PRIuMAX>) in commit-"
+"graph file"
+msgstr "忽略æ交圖形檔案中éŽå°çš„更動路徑å€å¡Š (%<PRIuMAX> < %<PRIuMAX>)"
+
+#: commit-graph.c
#, c-format
msgid "commit-graph signature %X does not match signature %X"
msgstr "æ交圖形簽å %X 和簽å %X ä¸ç¬¦åˆ"
@@ -16969,20 +17825,45 @@ msgstr "æ交圖形雜湊版本 %X 和版本 %X ä¸ç¬¦åˆ"
#: commit-graph.c
#, c-format
msgid "commit-graph file is too small to hold %u chunks"
-msgstr "commit-graph 檔案ä¸å¤ æ”¾ç½® %u 個å€å¡Š"
+msgstr "æ交圖形檔案ä¸å¤ æ”¾ç½® %u 個å€å¡Š"
+
+#: commit-graph.c
+msgid "commit-graph required OID fanout chunk missing or corrupted"
+msgstr "æ交圖形需è¦çš„ OID 扇出å€å¡Šéºå¤±æˆ–æ壞"
+
+#: commit-graph.c
+msgid "commit-graph required OID lookup chunk missing or corrupted"
+msgstr "æ交圖形需è¦çš„ OID 查詢å€å¡Šéºå¤±æˆ–æ壞"
+
+#: commit-graph.c
+msgid "commit-graph required commit data chunk missing or corrupted"
+msgstr "æ交圖形需è¦çš„æ交資料å€å¡Šéºå¤±æˆ–æ壞"
#: commit-graph.c
msgid "commit-graph has no base graphs chunk"
msgstr "æ交圖形沒有基礎圖形å€å¡Š"
#: commit-graph.c
+msgid "commit-graph base graphs chunk is too small"
+msgstr "æ交圖形的基礎圖形å€å¡ŠéŽå°"
+
+#: commit-graph.c
msgid "commit-graph chain does not match"
msgstr "æ交圖形éˆä¸ç¬¦åˆ"
#: commit-graph.c
#, c-format
+msgid "commit count in base graph too high: %<PRIuMAX>"
+msgstr "基礎圖 (base graph) 中的æ交數éŽå¤šï¼š%<PRIuMAX>"
+
+#: commit-graph.c
+msgid "commit-graph chain file too small"
+msgstr "æ交圖形éˆæª”案éŽå°"
+
+#: commit-graph.c
+#, c-format
msgid "invalid commit-graph chain: line '%s' not a hash"
-msgstr "無效的æ交圖形éˆï¼šè¡Œ '%s' ä¸æ˜¯ä¸€å€‹é›œæ¹Šå€¼"
+msgstr "無效的æ交圖形éˆï¼šã€Œ%sã€åˆ—ä¸æ˜¯é›œæ¹Šå€¼"
#: commit-graph.c
msgid "unable to find all commit-graph files"
@@ -17002,6 +17883,14 @@ msgid "commit-graph requires overflow generation data but has none"
msgstr "æ交圖需è¦æ¯”ç›®å‰æ›´å¤šçš„世代資料,但沒有相關資料"
#: commit-graph.c
+msgid "commit-graph overflow generation data is too small"
+msgstr "æ交圖形的溢出世代資料éŽå°"
+
+#: commit-graph.c
+msgid "commit-graph extra-edges pointer out of bounds"
+msgstr "æ交圖形的延伸邊界指é‡è¶…出範åœ"
+
+#: commit-graph.c
msgid "Loading known commits in commit graph"
msgstr "正在載入æ交圖中的已知æ交"
@@ -17085,6 +17974,16 @@ msgid "failed to rename temporary commit-graph file"
msgstr "無法é‡æ–°å‘½å暫時æ交圖形檔案"
#: commit-graph.c
+#, c-format
+msgid "cannot merge graphs with %<PRIuMAX>, %<PRIuMAX> commits"
+msgstr "無法將圖與 %<PRIuMAX>, %<PRIuMAX> 個æ交進行åˆä½µ"
+
+#: commit-graph.c
+#, c-format
+msgid "cannot merge graph %s, too many commits: %<PRIuMAX>"
+msgstr "無法åˆä½µ %s 圖,太多æ交:%<PRIuMAX>"
+
+#: commit-graph.c
msgid "Scanning merged commits"
msgstr "正在掃æåˆä½µæ交"
@@ -17120,10 +18019,6 @@ msgid "failed to parse commit %s from commit-graph"
msgstr "無法從æ交圖形中解æžæ交 %s"
#: commit-graph.c
-msgid "Verifying commits in commit graph"
-msgstr "正在驗證æ交圖中的æ交"
-
-#: commit-graph.c
#, c-format
msgid "failed to parse commit %s from object database for commit-graph"
msgstr "無法從æ交圖形的物件庫中解æžæ交 %s"
@@ -17150,25 +18045,24 @@ msgstr "æ交 %s çš„æ交圖形父æ交列表éŽæ—©çµ‚æ­¢"
#: commit-graph.c
#, c-format
-msgid ""
-"commit-graph has generation number zero for commit %s, but non-zero elsewhere"
-msgstr "æ交圖形中æ交 %s 的世代號是零,但其它地方éžé›¶"
+msgid "commit-graph generation for commit %s is %<PRIuMAX> < %<PRIuMAX>"
+msgstr "æ交 %s çš„æ交圖形處於 %<PRIuMAX> < %<PRIuMAX> 世代"
#: commit-graph.c
#, c-format
-msgid ""
-"commit-graph has non-zero generation number for commit %s, but zero elsewhere"
-msgstr "æ交圖形中æ交 %s 的世代號éžé›¶ï¼Œä½†å…¶å®ƒåœ°æ–¹æ˜¯é›¶"
+msgid "commit date for commit %s in commit-graph is %<PRIuMAX> != %<PRIuMAX>"
+msgstr "æ交圖形中æ交 %s çš„æ交日期是 %<PRIuMAX> != %<PRIuMAX>"
#: commit-graph.c
#, c-format
-msgid "commit-graph generation for commit %s is %<PRIuMAX> < %<PRIuMAX>"
-msgstr "æ交 %s çš„æ交圖形處於 %<PRIuMAX> < %<PRIuMAX> 世代"
+msgid ""
+"commit-graph has both zero and non-zero generations (e.g., commits '%s' and "
+"'%s')"
+msgstr "æäº¤åœ–å½¢ä¸­åŒ…å« 0 å’Œéž 0 兩個世代號(例如 “%s†和 “%s†æ交)"
#: commit-graph.c
-#, c-format
-msgid "commit date for commit %s in commit-graph is %<PRIuMAX> != %<PRIuMAX>"
-msgstr "æ交圖形中æ交 %s çš„æ交日期是 %<PRIuMAX> != %<PRIuMAX>"
+msgid "Verifying commits in commit graph"
+msgstr "正在驗證æ交圖中的æ交"
#: commit.c
#, c-format
@@ -17197,6 +18091,11 @@ msgstr ""
#: commit.c
#, c-format
+msgid "commit %s exists in commit-graph but not in the object database"
+msgstr "%s æ交在æ交圖形中,但ä¸åœ¨ç‰©ä»¶è³‡æ–™åº«ä¸­"
+
+#: commit.c
+#, c-format
msgid "Commit %s has an untrusted GPG signature, allegedly by %s."
msgstr "æ交 %s 有一個éžå¯ä¿¡çš„è²ç¨±ä¾†è‡ª %s çš„ GPG ç°½å。"
@@ -17233,6 +18132,16 @@ msgstr "沒有å¯ç”¨çš„編譯器資訊\n"
msgid "no libc information available\n"
msgstr "沒有å¯ç”¨çš„ libc 資訊\n"
+#: compat/disk.h
+#, c-format
+msgid "could not determine free disk size for '%s'"
+msgstr "無法判斷 “%s†的剩餘ç£ç¢Ÿå¤§å°"
+
+#: compat/disk.h
+#, c-format
+msgid "could not get info for '%s'"
+msgstr "無法å–å¾— “%s†的資訊"
+
#: compat/fsmonitor/fsm-health-win32.c
#, c-format
msgid "[GLE %ld] health thread could not open '%ls'"
@@ -17263,6 +18172,11 @@ msgstr "“has_worktree_moved†中有未處置的情æ³ï¼š%d"
msgid "health thread wait failed [GLE %ld]"
msgstr "å¥åº·ç›£è½åŸ·è¡Œç·’等待失敗 [GLE %ld]"
+#: compat/fsmonitor/fsm-ipc-darwin.c
+#, c-format
+msgid "Invalid path: %s"
+msgstr "無效路徑:%s"
+
#: compat/fsmonitor/fsm-listen-darwin.c
msgid "Unable to create FSEventStream."
msgstr "無法建立 FSEventStream。"
@@ -17301,6 +18215,36 @@ msgstr "在 “%sâ€ ä¸Šå‘¼å« GetOverlappedResult 失敗 [GLE %ld]"
msgid "could not read directory changes [GLE %ld]"
msgstr "無法讀å–目錄變化 [GLE %ld]"
+#: compat/fsmonitor/fsm-path-utils-darwin.c
+#, c-format
+msgid "opendir('%s') failed"
+msgstr "opendir('%s') 失敗"
+
+#: compat/fsmonitor/fsm-path-utils-darwin.c
+#, c-format
+msgid "lstat('%s') failed"
+msgstr "lstat('%s') 失敗"
+
+#: compat/fsmonitor/fsm-path-utils-darwin.c
+#, c-format
+msgid "strbuf_readlink('%s') failed"
+msgstr "strbuf_readlink('%s') 失敗"
+
+#: compat/fsmonitor/fsm-path-utils-darwin.c
+#, c-format
+msgid "closedir('%s') failed"
+msgstr "closedir('%s') 失敗"
+
+#: compat/fsmonitor/fsm-path-utils-win32.c
+#, c-format
+msgid "[GLE %ld] unable to open for read '%ls'"
+msgstr "[GLE %ld] 無法開啟以讀å–「%lsã€"
+
+#: compat/fsmonitor/fsm-path-utils-win32.c
+#, c-format
+msgid "[GLE %ld] unable to get protocol information for '%ls'"
+msgstr "[GLE %ld] 無法å–得「%lsã€çš„通訊å”定資訊"
+
#: compat/mingw.c
#, c-format
msgid "failed to copy SID (%ld)"
@@ -17561,7 +18505,7 @@ msgstr "å­æ¨¡çµ„資料物件 %2$s 中錯誤的設定行 %1$d"
#: config.c
#, c-format
msgid "bad config line %d in command line %s"
-msgstr "指令列 %2$s 中錯誤的設定行 %1$d"
+msgstr "命令列 %2$s 中錯誤的設定行 %1$d"
#: config.c
#, c-format
@@ -17604,7 +18548,7 @@ msgstr "å­æ¨¡çµ„資料 %3$s 中設定變數 '%2$s' 錯誤的å–值 '%1$s':%4$
#: config.c
#, c-format
msgid "bad numeric config value '%s' for '%s' in command line %s: %s"
-msgstr "指令列 %3$s 中設定變數 '%2$s' 錯誤的å–值 '%1$s':%4$s"
+msgstr "命令列 %3$s 中設定變數 '%2$s' 錯誤的å–值 '%1$s':%4$s"
#: config.c
#, c-format
@@ -17647,8 +18591,8 @@ msgid "bad zlib compression level %d"
msgstr "錯誤的 zlib 壓縮級別 %d"
#: config.c
-msgid "core.commentChar should only be one character"
-msgstr "core.commentChar 應該是一個字元"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar 應該是一個 ASCII 字元"
#: config.c
#, c-format
@@ -17694,13 +18638,8 @@ msgid "unable to resolve config blob '%s'"
msgstr "ä¸èƒ½è§£æžè¨­å®šç‰©ä»¶ '%s'"
#: config.c
-#, c-format
-msgid "failed to parse %s"
-msgstr "è§£æž %s 失敗"
-
-#: config.c
msgid "unable to parse command-line config"
-msgstr "無法解æžæŒ‡ä»¤åˆ—中的設定"
+msgstr "無法解æžå‘½ä»¤åˆ—中的設定"
#: config.c
msgid "unknown error occurred while reading the configuration files"
@@ -17719,7 +18658,7 @@ msgstr "splitIndex.maxPercentChange çš„å–值 '%d' 應該介於 0 å’Œ 100 之間
#: config.c
#, c-format
msgid "unable to parse '%s' from command-line config"
-msgstr "無法解æžæŒ‡ä»¤åˆ—設定中的 '%s'"
+msgstr "無法解æžå‘½ä»¤åˆ—設定中的 '%s'"
#: config.c
#, c-format
@@ -17788,6 +18727,11 @@ msgstr "無效的å°ç¯€å稱:%s"
#: config.c
#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr "因為第 %2$<PRIuMAX> 列中 “%1$s†的文字列太長,故拒絕é‹ä½œ"
+
+#: config.c
+#, c-format
msgid "missing value for '%s'"
msgstr "%s çš„å–值缺少"
@@ -17854,12 +18798,12 @@ msgstr "伺æœå™¨æŒ‡å®šçš„「%sã€ç‰©ä»¶æ ¼å¼ç„¡æ•ˆ"
#: connect.c
#, c-format
-msgid "invalid ls-refs response: %s"
-msgstr "無效的 ls-refs 回應:%s"
+msgid "error on bundle-uri response line %d: %s"
+msgstr "在 bundle-uri 回應的第 %d 列發ç¾éŒ¯èª¤ï¼š%s"
#: connect.c
-msgid "expected flush after ref listing"
-msgstr "在引用列表之後應該有一個 flush 包"
+msgid "expected flush after bundle-uri listing"
+msgstr "在 bundle-uri 清單後應該有一個 flush 包"
#: connect.c
msgid "expected response end packet after ref listing"
@@ -17867,6 +18811,15 @@ msgstr "在引用列表後é æœŸè¦æœ‰å›žæ‡‰çµæŸå°åŒ…"
#: connect.c
#, c-format
+msgid "invalid ls-refs response: %s"
+msgstr "無效的 ls-refs 回應:%s"
+
+#: connect.c
+msgid "expected flush after ref listing"
+msgstr "在引用列表之後應該有一個 flush 包"
+
+#: connect.c
+#, c-format
msgid "protocol '%s' is not supported"
msgstr "ä¸æ”¯æ´ '%s' å”定"
@@ -17974,229 +18927,6 @@ msgstr "寫入 rev-list 失敗"
msgid "failed to close rev-list's stdin"
msgstr "關閉 rev-list 的標準輸入失敗"
-#: contrib/scalar/scalar.c worktree.c
-#, c-format
-msgid "'%s' does not exist"
-msgstr "'%s' ä¸å­˜åœ¨"
-
-#: contrib/scalar/scalar.c
-msgid "need a working directory"
-msgstr "需è¦å·¥ä½œç›®éŒ„"
-
-#: contrib/scalar/scalar.c
-msgid "could not find enlistment root"
-msgstr "找ä¸åˆ°ç·¨åˆ—å單的根目錄"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not switch to '%s'"
-msgstr "無法切æ›è‡³ã€Œ%sã€"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not configure %s=%s"
-msgstr "無法設定 %s=%s"
-
-#: contrib/scalar/scalar.c
-msgid "could not configure log.excludeDecoration"
-msgstr "無法設定 log.excludeDecoration"
-
-#: contrib/scalar/scalar.c
-msgid "Scalar enlistments require a worktree"
-msgstr "ç´”é‡ç·¨åˆ—å單需è¦å·¥ä½œç›®éŒ„"
-
-#: contrib/scalar/scalar.c dir.c
-#, c-format
-msgid "could not open directory '%s'"
-msgstr "ä¸èƒ½é–‹å•Ÿç›®éŒ„ '%s'"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "skipping '%s', which is neither file nor directory"
-msgstr "ç•¥éŽ â€œ%sâ€ï¼Œå…¶éžæª”案或目錄"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not determine free disk size for '%s'"
-msgstr "無法判斷 “%s†的剩餘ç£ç¢Ÿå¤§å°"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not get info for '%s'"
-msgstr "無法å–å¾— “%s†的資訊"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "remote HEAD is not a branch: '%.*s'"
-msgstr "é ç«¯ HEAD ä¸æ˜¯åˆ†æ”¯ï¼šã€Œ%.*sã€"
-
-#: contrib/scalar/scalar.c
-msgid "failed to get default branch name from remote; using local default"
-msgstr "無法從é ç«¯å–å¾—é è¨­åˆ†æ”¯å稱。改用本機é è¨­å稱"
-
-#: contrib/scalar/scalar.c
-msgid "failed to get default branch name"
-msgstr "無法å–å¾—é è¨­åˆ†æ”¯å稱"
-
-#: contrib/scalar/scalar.c
-msgid "failed to unregister repository"
-msgstr "無法å–消註冊版本庫"
-
-#: contrib/scalar/scalar.c
-msgid "failed to delete enlistment directory"
-msgstr "無法刪除編列å單目錄"
-
-#: contrib/scalar/scalar.c
-msgid "branch to checkout after clone"
-msgstr "複製後è¦ç°½å‡ºçš„分支"
-
-#: contrib/scalar/scalar.c
-msgid "when cloning, create full working directory"
-msgstr "複製時建立完整的工作目錄"
-
-#: contrib/scalar/scalar.c
-msgid "only download metadata for the branch that will be checked out"
-msgstr "åªä¸‹è¼‰æœƒç°½å‡ºçš„分支中介資料"
-
-#: contrib/scalar/scalar.c
-msgid "scalar clone [<options>] [--] <repo> [<dir>]"
-msgstr "scalar clone [<options>] [--] <repo> [<dir>]"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "cannot deduce worktree name from '%s'"
-msgstr "無法從「%sã€æŽ¨è«–工作å€å稱"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "directory '%s' exists already"
-msgstr "「%sã€ç›®éŒ„已經存在"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "failed to get default branch for '%s'"
-msgstr "無法å–得「%sã€çš„é è¨­åˆ†æ”¯"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not configure remote in '%s'"
-msgstr "無法設定「%sã€ä¸­çš„é ç«¯"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not configure '%s'"
-msgstr "無法設定「%sã€"
-
-#: contrib/scalar/scalar.c
-msgid "partial clone failed; attempting full clone"
-msgstr "部分複製失敗。嘗試完整複製"
-
-#: contrib/scalar/scalar.c
-msgid "could not configure for full clone"
-msgstr "無法設定完整複製"
-
-#: contrib/scalar/scalar.c
-msgid "scalar diagnose [<enlistment>]"
-msgstr "scalar diagnose [<enlistment>]"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not create directory for '%s'"
-msgstr "無法建立 “%s†的目錄"
-
-#: contrib/scalar/scalar.c
-msgid "could not duplicate stdout"
-msgstr "無法複製 stdout"
-
-#: contrib/scalar/scalar.c
-msgid "failed to write archive"
-msgstr "無法寫入å°å­˜"
-
-#: contrib/scalar/scalar.c
-msgid "`scalar list` does not take arguments"
-msgstr "`scalar list` 未å–引數"
-
-#: contrib/scalar/scalar.c
-msgid "scalar register [<enlistment>]"
-msgstr "scalar register [<enlistment>]"
-
-#: contrib/scalar/scalar.c
-msgid "reconfigure all registered enlistments"
-msgstr "é‡æ–°è¨­å®šæ‰€æœ‰è¨»å†Šçš„編列åå–®"
-
-#: contrib/scalar/scalar.c
-msgid "scalar reconfigure [--all | <enlistment>]"
-msgstr "scalar reconfigure [--all | <enlistment>]"
-
-#: contrib/scalar/scalar.c
-msgid "--all or <enlistment>, but not both"
-msgstr "--all 或 <enlistment> 但ä¸èƒ½å‚³å…¥å…©è€…"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "git repository gone in '%s'"
-msgstr "git 版本庫在「%sã€éºå¤±"
-
-#: contrib/scalar/scalar.c
-msgid ""
-"scalar run <task> [<enlistment>]\n"
-"Tasks:\n"
-msgstr ""
-"scalar run <task> [<enlistment>]\n"
-"作業:\n"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "no such task: '%s'"
-msgstr "無此作業:「%sã€"
-
-#: contrib/scalar/scalar.c
-msgid "scalar unregister [<enlistment>]"
-msgstr "scalar unregister [<enlistment>]"
-
-#: contrib/scalar/scalar.c
-msgid "scalar delete <enlistment>"
-msgstr "scalar delete <enlistment>"
-
-#: contrib/scalar/scalar.c
-msgid "refusing to delete current working directory"
-msgstr "拒絕刪除目å‰å·¥ä½œç›®éŒ„"
-
-#: contrib/scalar/scalar.c
-msgid "include Git version"
-msgstr "åŒ…å« Git 版本"
-
-#: contrib/scalar/scalar.c
-msgid "include Git's build options"
-msgstr "åŒ…å« Git 組建é¸é …"
-
-#: contrib/scalar/scalar.c
-msgid "scalar verbose [-v | --verbose] [--build-options]"
-msgstr "scalar verbose [-v | --verbose] [--build-options]"
-
-#: contrib/scalar/scalar.c
-msgid "-C requires a <directory>"
-msgstr "-C éœ€è¦ <directory>"
-
-#: contrib/scalar/scalar.c
-#, c-format
-msgid "could not change to '%s'"
-msgstr "無法更改為「%sã€"
-
-#: contrib/scalar/scalar.c
-msgid "-c requires a <key>=<value> argument"
-msgstr "-c éœ€è¦ <key>=<value> 引數"
-
-#: contrib/scalar/scalar.c
-msgid ""
-"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
-"\n"
-"Commands:\n"
-msgstr ""
-"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
-"\n"
-"命令:\n"
-
#: convert.c
#, c-format
msgid "illegal crlf_action %d"
@@ -18427,15 +19157,44 @@ msgstr "來自 config 的資料島常è¦è¡¨ç¤ºå¼æœ‰å¤ªå¤šçš„æ“·å–群組(最å
msgid "Marked %d islands, done.\n"
msgstr "已標記 %d 個資料島,çµæŸã€‚\n"
+#: diagnose.c
+#, c-format
+msgid "invalid --%s value '%s'"
+msgstr "無效的 --%s 值「%sã€"
+
+#: diagnose.c
+#, c-format
+msgid "could not archive missing directory '%s'"
+msgstr "無法å°å­˜ä¸å­˜åœ¨çš„路徑「%sã€"
+
+#: diagnose.c dir.c
+#, c-format
+msgid "could not open directory '%s'"
+msgstr "ä¸èƒ½é–‹å•Ÿç›®éŒ„ '%s'"
+
+#: diagnose.c
+#, c-format
+msgid "skipping '%s', which is neither file nor directory"
+msgstr "ç•¥éŽ â€œ%sâ€ï¼Œå…¶éžæª”案或目錄"
+
+#: diagnose.c
+msgid "could not duplicate stdout"
+msgstr "無法複製 stdout"
+
+#: diagnose.c
+#, c-format
+msgid "could not add directory '%s' to archiver"
+msgstr "無法將「%sã€è·¯å¾‘加入å°å­˜å·¥å…·ä¸­"
+
+#: diagnose.c
+msgid "failed to write archive"
+msgstr "無法寫入å°å­˜"
+
#: diff-lib.c
msgid "--merge-base does not work with ranges"
msgstr "--merge-base 跟範åœç„¡æ³•æ­é…é‹ä½œ"
#: diff-lib.c
-msgid "--merge-base only works with commits"
-msgstr "--merge-base åªèƒ½è·Ÿæ交æ­é…æ‰èƒ½é‹ä½œ"
-
-#: diff-lib.c
msgid "unable to get HEAD"
msgstr "ä¸èƒ½å–å¾— HEAD"
@@ -18448,6 +19207,14 @@ msgid "multiple merge bases found"
msgstr "找到多個åˆä½µåŸºåº•"
#: diff-no-index.c
+msgid "cannot compare stdin to a directory"
+msgstr "ç„¡æ³•æ¯”å° stdin 和目錄"
+
+#: diff-no-index.c
+msgid "cannot compare a named pipe to a directory"
+msgstr "無法比å°å‘½å管線 (pipe) 和目錄"
+
+#: diff-no-index.c
msgid "git diff --no-index [<options>] <path> <path>"
msgstr "git diff --no-index [<é¸é …>] <路徑> <路徑>"
@@ -18497,6 +19264,11 @@ msgstr "color-moved-ws:allow-indentation-change ä¸èƒ½èˆ‡å…¶å®ƒç©ºç™½å­—元模
msgid "Unknown value for 'diff.submodule' config variable: '%s'"
msgstr "設定變數 'diff.submodule' 未知的å–值:'%s'"
+#: diff.c transport.c
+#, c-format
+msgid "unknown value for config '%s': %s"
+msgstr "設定 '%s' çš„å–值未知:%s"
+
#: diff.c
#, c-format
msgid ""
@@ -18511,6 +19283,15 @@ msgstr ""
msgid "external diff died, stopping at %s"
msgstr "外部 diff 離開,åœæ­¢åœ¨ %s"
+#: diff.c
+msgid "--follow requires exactly one pathspec"
+msgstr "--follow 明確è¦æ±‚åªè·Ÿä¸€å€‹è·¯å¾‘è¦æ ¼"
+
+#: diff.c
+#, c-format
+msgid "pathspec magic not supported by --follow: %s"
+msgstr "--follow ä¸æ”¯æ´è·¯å¾‘è¦æ ¼é­”法:%s"
+
#: diff.c parse-options.c
#, c-format
msgid "options '%s', '%s', '%s', and '%s' cannot be used together"
@@ -18528,10 +19309,6 @@ msgid ""
msgstr "「%sã€å’Œã€Œ%sã€é¸é …ä¸å¾—åŒæ™‚使用,請使用「%sã€æ­é…「%sã€ã€ã€Œ%sã€"
#: diff.c
-msgid "--follow requires exactly one pathspec"
-msgstr "--follow 明確è¦æ±‚åªè·Ÿä¸€å€‹è·¯å¾‘è¦æ ¼"
-
-#: diff.c
#, c-format
msgid "invalid --stat value: %s"
msgstr "無效的 --stat 值:%s"
@@ -18586,13 +19363,6 @@ msgid "invalid mode '%s' in --color-moved-ws"
msgstr "--color-moved-ws ä¸­çš„ç„¡æ•ˆæ¨¡å¼ '%s'"
#: diff.c
-msgid ""
-"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
-"\"histogram\""
-msgstr ""
-"diff-algorithm é¸é …有 \"myers\"ã€\"minimal\"ã€\"patience\" å’Œ \"histogram\""
-
-#: diff.c
#, c-format
msgid "invalid argument to %s"
msgstr "%s çš„åƒæ•¸ç„¡æ•ˆ"
@@ -18649,21 +19419,22 @@ msgid "output only the last line of --stat"
msgstr "åªè¼¸å‡º --stat 的最後一行"
#: diff.c
-msgid "<param1,param2>..."
-msgstr "<åƒæ•¸1,åƒæ•¸2>..."
+#| msgid "<param1,param2>..."
+msgid "<param1>,<param2>..."
+msgstr "<param1>,<param2>..."
#: diff.c
msgid ""
"output the distribution of relative amount of changes for each sub-directory"
-msgstr "輸出æ¯å€‹å­ç›®éŒ„相å°è®Šæ›´çš„分布"
+msgstr "輸出æ¯å€‹å­ç›®éŒ„相å°è®Šæ›´çš„分佈"
#: diff.c
msgid "synonym for --dirstat=cumulative"
msgstr "å’Œ --dirstat=cumulative åŒç¾©"
#: diff.c
-msgid "synonym for --dirstat=files,param1,param2..."
-msgstr "是 --dirstat=files,param1,param2... çš„åŒç¾©è©ž"
+msgid "synonym for --dirstat=files,<param1>,<param2>..."
+msgstr "是 --dirstat=files,<param1>,<param2>... çš„åŒç¾©è©ž"
#: diff.c
msgid "warn if changes introduce conflict markers or whitespace errors"
@@ -18768,6 +19539,10 @@ msgid "do not show any source or destination prefix"
msgstr "ä¸é¡¯ç¤ºä»»ä½•ä¾†æºå’Œç›®çš„地å‰ç¶´"
#: diff.c
+msgid "use default prefixes a/ and b/"
+msgstr "使用é è¨­çš„å‰ç½®å稱 a/ å’Œ b/"
+
+#: diff.c
msgid "show context between diff hunks up to the specified number of lines"
msgstr "顯示指定行數的差異å€å¡Šé–“的上下文"
@@ -18882,14 +19657,6 @@ msgid "generate diff using the \"histogram diff\" algorithm"
msgstr "使用 \"histogram diff\" 演算法生æˆå·®ç•°"
#: diff.c
-msgid "<algorithm>"
-msgstr "<演算法>"
-
-#: diff.c
-msgid "choose a diff algorithm"
-msgstr "é¸æ“‡ä¸€å€‹å·®ç•°æ¼”算法"
-
-#: diff.c
msgid "<text>"
msgstr "<文字>"
@@ -19114,7 +19881,7 @@ msgid ""
"Please specify a directory on the command line"
msgstr ""
"無法猜到目錄å。\n"
-"請在指令列指定一個目錄"
+"請在命令列指定一個目錄"
#: dir.c
#, c-format
@@ -19136,6 +19903,16 @@ msgstr "ä¸èƒ½å¾ž '%s' é·ç§» git 目錄到 '%s'"
msgid "hint: Waiting for your editor to close the file...%c"
msgstr "æ示:等待您的編輯器關閉檔案...%c"
+#: editor.c sequencer.c wrapper.c
+#, c-format
+msgid "could not write to '%s'"
+msgstr "ä¸èƒ½å¯«å…¥ '%s'"
+
+#: editor.c
+#, c-format
+msgid "could not edit '%s'"
+msgstr "無法編輯 '%s'"
+
#: entry.c
msgid "Filtering content"
msgstr "éŽæ¿¾å…§å®¹"
@@ -19177,6 +19954,10 @@ msgid "unable to write to remote"
msgstr "無法寫到é ç«¯"
#: fetch-pack.c
+msgid "Server supports filter"
+msgstr "伺æœå™¨æ”¯æ´ filter"
+
+#: fetch-pack.c
#, c-format
msgid "invalid shallow line: %s"
msgstr "無效的 shallow 訊æ¯ï¼š%s"
@@ -19318,10 +20099,6 @@ msgid "Server does not support shallow requests"
msgstr "伺æœå™¨ä¸æ”¯æ´ shallow 請求"
#: fetch-pack.c
-msgid "Server supports filter"
-msgstr "伺æœå™¨æ”¯æ´ filter"
-
-#: fetch-pack.c
msgid "unable to write request to remote"
msgstr "無法將請求寫到é ç«¯"
@@ -19445,8 +20222,9 @@ msgstr "虛擬版本庫 “%s†與 fsmonitor ä¸ç›¸å®¹"
#: fsmonitor-settings.c
#, c-format
msgid ""
-"repository '%s' is incompatible with fsmonitor due to lack of Unix sockets"
-msgstr "版本庫 “%s†因缺少 Unix 通訊端而與 fsmonitor ä¸ç›¸å®¹"
+"socket directory '%s' is incompatible with fsmonitor due to lack of Unix "
+"sockets support"
+msgstr "通訊端 “%s†因缺少 Unix 通訊端支æ´ï¼Œè€Œèˆ‡ fsmonitor ä¸ç›¸å®¹"
#: git.c
msgid ""
@@ -19455,16 +20233,14 @@ msgid ""
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
-" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
-" <command> [<args>]"
+" [--config-env=<name>=<envvar>] <command> [<args>]"
msgstr ""
"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
-" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
-" <command> [<args>]"
+" [--config-env=<name>=<envvar>] <command> [<args>]"
#: git.c
msgid ""
@@ -19481,7 +20257,7 @@ msgstr ""
#: git.c help.c
#, c-format
msgid "unsupported command listing type '%s'"
-msgstr "ä¸æ”¯æ´çš„指令列表類型 '%s'"
+msgstr "ä¸æ”¯æ´çš„命令列表類型 '%s'"
#: git.c
#, c-format
@@ -19495,11 +20271,6 @@ msgstr "沒有為 --namespace æ供命å空間\n"
#: git.c
#, c-format
-msgid "no prefix given for --super-prefix\n"
-msgstr "沒有為 --super-prefix æä¾›å‰ç¶´\n"
-
-#: git.c
-#, c-format
msgid "-c expects a configuration string\n"
msgstr "應為 -c æ供一個設定字串\n"
@@ -19510,6 +20281,11 @@ msgstr "未傳入設定éµè‡³ --config-env\n"
#: git.c
#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "沒有為 --attr-source æ供屬性來æº\n"
+
+#: git.c
+#, c-format
msgid "unknown option: %s\n"
msgstr "未知é¸é …:%s\n"
@@ -19632,8 +20408,13 @@ msgid "gpg.ssh.defaultKeyCommand failed: %s %s"
msgstr "gpg.ssh.defaultKeyCommand 執行失敗:%s %s"
#: gpg-interface.c
-msgid "gpg failed to sign the data"
-msgstr "gpg 無法為資料簽å"
+#, c-format
+msgid ""
+"gpg failed to sign the data:\n"
+"%s"
+msgstr ""
+"gpg 無法簽å資料:\n"
+"%s"
#: gpg-interface.c
msgid "user.signingKey needs to be set for ssh signing"
@@ -19736,6 +20517,14 @@ msgid "Low-level Commands / Internal Helpers"
msgstr "低級指令/內部å”助工具"
#: help.c
+msgid "User-facing repository, command and file interfaces"
+msgstr "é¢å‘使用者的版本庫ã€å‘½ä»¤å’Œæª”案介é¢"
+
+#: help.c
+msgid "Developer-facing file formats, protocols and other interfaces"
+msgstr "é¢å‘開發者的檔案格å¼ã€é€šè¨Šå”定和介é¢"
+
+#: help.c
#, c-format
msgid "available git commands in '%s'"
msgstr "在 '%s' 下å¯ç”¨çš„ git 指令"
@@ -19753,6 +20542,14 @@ msgid "The Git concept guides are:"
msgstr "Git 概念嚮導有:"
#: help.c
+msgid "User-facing repository, command and file interfaces:"
+msgstr "é¢å‘使用者的版本庫ã€å‘½ä»¤å’Œæª”案介é¢ï¼š"
+
+#: help.c
+msgid "File formats, protocols and other developer interfaces:"
+msgstr "檔案格å¼ã€é€šè¨Šå”定和其他開發者介é¢ï¼š"
+
+#: help.c
msgid "External commands"
msgstr "外部指令"
@@ -19814,8 +20611,8 @@ msgstr[0] ""
"最類似的指令有"
#: help.c
-msgid "git version [<options>]"
-msgstr "git version [<é¸é …>]"
+msgid "git version [--build-options]"
+msgstr "git version [--build-options]"
#: help.c
#, c-format
@@ -19842,11 +20639,6 @@ msgstr ""
"因為沒有將掛鉤 '%s' 設定為å¯åŸ·è¡Œï¼ŒæŽ›é‰¤è¢«å¿½ç•¥ã€‚您å¯ä»¥é€éŽ\n"
"設定 `git config advice.ignoredHook false` 來關閉這æ¢è­¦å‘Šã€‚"
-#: hook.c
-#, c-format
-msgid "Couldn't start hook '%s'\n"
-msgstr "無法啟動「%sã€æŽ›é‰¤\n"
-
#: http-fetch.c
#, c-format
msgid "argument to --packfile must be a valid hash (got '%s')"
@@ -20066,20 +20858,16 @@ msgstr "在 ls-refs 引數之後應該有一個 flush 包"
msgid "quoted CRLF detected"
msgstr "åµæ¸¬åˆ°ç”±å¯åˆ—å°å­—å…ƒ (quoted) 所組æˆçš„ CRLF"
-#: merge-ort-wrappers.c merge-recursive.c
-#, c-format
-msgid ""
-"Your local changes to the following files would be overwritten by merge:\n"
-" %s"
-msgstr ""
-"您å°ä¸‹åˆ—檔案的本機修改將被åˆä½µå‹•ä½œè¦†è“‹ï¼š\n"
-" %s"
-
#: merge-ort.c merge-recursive.c
#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "無法åˆä½µå­æ¨¡çµ„ %s (沒有簽出)"
+#: merge-ort.c
+#, c-format
+msgid "Failed to merge submodule %s (no merge base)"
+msgstr "無法åˆä½µ %s å­æ¨¡çµ„(沒有åˆä½µåŸºåº•ï¼‰"
+
#: merge-ort.c merge-recursive.c
#, c-format
msgid "Failed to merge submodule %s (commits not present)"
@@ -20103,27 +20891,8 @@ msgstr "無法åˆä½µ %s å­æ¨¡çµ„"
#: merge-ort.c
#, c-format
msgid ""
-"Failed to merge submodule %s, but a possible merge resolution exists:\n"
-"%s\n"
-msgstr ""
-"無法åˆä½µ %s å­æ¨¡çµ„,但有找到一個å¯è¡Œçš„åˆä½µæ–¹æ¡ˆï¼š\n"
-"%s\n"
-
-#: merge-ort.c merge-recursive.c
-#, c-format
-msgid ""
-"If this is correct simply add it to the index for example\n"
-"by using:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"which will accept this suggestion.\n"
-msgstr ""
-"正確的話,就能直接加進索引,例如執行下述命令:\n"
-"\n"
-" git update-index --cacheinfo 160000 %s \"%s\"\n"
-"\n"
-"接å—本建議。\n"
+"Failed to merge submodule %s, but a possible merge resolution exists: %s"
+msgstr "無法åˆä½µ %s å­æ¨¡çµ„,但存在åˆä½µå¯è¡Œæ–¹æ¡ˆï¼š%s"
#: merge-ort.c
#, c-format
@@ -20135,13 +20904,13 @@ msgstr ""
"%s"
#: merge-ort.c merge-recursive.c
-msgid "Failed to execute internal merge"
+msgid "failed to execute internal merge"
msgstr "無法執行內部åˆä½µ"
#: merge-ort.c merge-recursive.c
#, c-format
-msgid "Unable to add %s to database"
-msgstr "ä¸èƒ½æ–°å¢ž %s 至物件庫"
+msgid "unable to add %s to database"
+msgstr "無法將 %s 加進資料庫"
#: merge-ort.c merge-recursive.c
#, c-format
@@ -20302,12 +21071,45 @@ msgstr ""
"è¡çªï¼ˆä¿®æ”¹/刪除):%1$s 已在 %2$s 刪除和在 %3$s 修改。%5$s çš„ %4$s 版本留在樹"
"上。"
+#. TRANSLATORS: This is a line of advice to resolve a merge
+#. conflict in a submodule. The first argument is the submodule
+#. name, and the second argument is the abbreviated id of the
+#. commit that needs to be merged. For example:
+#. - go to submodule (mysubmodule), and either merge commit abc1234"
+#.
#: merge-ort.c
#, c-format
msgid ""
-"Note: %s not up to date and in way of checking out conflicted version; old "
-"copy renamed to %s"
-msgstr "註:%s ä¸æ˜¯æœ€æ–°ä¸”干擾到簽出è¡çªç‰ˆæœ¬ã€‚已將舊拷è²é‡æ–°å‘½å至 %s"
+" - go to submodule (%s), and either merge commit %s\n"
+" or update to an existing commit which has merged those changes\n"
+msgstr ""
+" - å‰å¾€å­æ¨¡çµ„ (%s),並åˆä½µ %s æ交或\n"
+" 更新至已經åˆä½µé€™äº›æ›´æ”¹çš„æ交\n"
+
+#: merge-ort.c
+#, c-format
+msgid ""
+"Recursive merging with submodules currently only supports trivial cases.\n"
+"Please manually handle the merging of each conflicted submodule.\n"
+"This can be accomplished with the following steps:\n"
+"%s - come back to superproject and run:\n"
+"\n"
+" git add %s\n"
+"\n"
+" to record the above merge or update\n"
+" - resolve any other conflicts in the superproject\n"
+" - commit the resulting index in the superproject\n"
+msgstr ""
+"與å­æ¨¡çµ„進行éžè¿´åˆä½µï¼Œç›®å‰åƒ…支æ´ç°¡å–®çš„情æ³ã€‚\n"
+"請自行處ç†æ¯å€‹æœ‰è¡çªä¹‹å­æ¨¡çµ„çš„åˆä½µå•é¡Œã€‚\n"
+"處ç†æ­¥é©Ÿæœ‰ä»¥ä¸‹å¹¾æ­¥ï¼š\n"
+"%s - 回到上級專案,並執行:\n"
+"\n"
+" git add %s\n"
+"\n"
+" 來記錄上述的åˆä½µæˆ–æ›´æ–°\n"
+" - 解決上級專案中的其它è¡çª\n"
+" - 在上級專案中,æ交產生之索引資訊\n"
#. TRANSLATORS: The %s arguments are: 1) tree hash of a merge
#. base, and 2-3) the trees for the two trees we're merging.
@@ -20396,6 +21198,22 @@ msgstr "找到å­æ¨¡çµ„的一個å¯èƒ½çš„åˆä½µæ–¹æ¡ˆï¼š\n"
#: merge-recursive.c
#, c-format
+msgid ""
+"If this is correct simply add it to the index for example\n"
+"by using:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"which will accept this suggestion.\n"
+msgstr ""
+"正確的話,就能直接加進索引,例如執行下述命令:\n"
+"\n"
+" git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"接å—本建議。\n"
+
+#: merge-recursive.c
+#, c-format
msgid "Failed to merge submodule %s (multiple merges found)"
msgstr "無法åˆä½µå­æ¨¡çµ„ %s (發ç¾å¤šå€‹åˆä½µï¼‰"
@@ -20446,7 +21264,7 @@ msgstr "é‡æ–°å‘½å"
#: merge-recursive.c
msgid "renamed"
-msgstr "é‡æ–°å‘½å"
+msgstr "å·²é‡æ–°å‘½å"
#: merge-recursive.c
#, c-format
@@ -20477,8 +21295,8 @@ msgstr "拒絕éºå¤±æœªè¿½è¹¤æª”案 '%s',而是新增為 %s"
#: merge-recursive.c
#, c-format
msgid ""
-"CONFLICT (rename/rename): Rename \"%s\"->\"%s\" in branch \"%s\" rename \"%s"
-"\"->\"%s\" in \"%s\"%s"
+"CONFLICT (rename/rename): Rename \"%s\"->\"%s\" in branch \"%s\" rename "
+"\"%s\"->\"%s\" in \"%s\"%s"
msgstr ""
"è¡çªï¼ˆé‡æ–°å‘½å/é‡æ–°å‘½å):在分支 \"%3$s\" 中é‡æ–°å‘½å \"%1$s\"->\"%2$s\",在"
"分支 \"%6$s\" 中é‡æ–°å‘½å \"%4$s\"->\"%5$s\"%7$s"
@@ -20593,6 +21411,20 @@ msgstr "多包索引的物件 ID fanout 大å°éŒ¯èª¤"
#: midx.c
#, c-format
+msgid ""
+"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
+msgstr "物件 ID 扇出無åºï¼šfanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
+
+#: midx.c
+msgid "multi-pack-index OID lookup chunk is the wrong size"
+msgstr "多包索引 OID 查詢å€å¡Šçš„大å°æœ‰èª¤"
+
+#: midx.c
+msgid "multi-pack-index object offset chunk is the wrong size"
+msgstr "多包索引的物件å移å€å¡Šå¤§å°æœ‰èª¤"
+
+#: midx.c
+#, c-format
msgid "multi-pack-index file %s is too small"
msgstr "多包索引檔案 %s 太å°"
@@ -20612,20 +21444,24 @@ msgid "multi-pack-index hash version %u does not match version %u"
msgstr "multi-pack-index 雜湊版本 %u 與版本 %u ä¸ç¬¦åˆ"
#: midx.c
-msgid "multi-pack-index missing required pack-name chunk"
-msgstr "多包索引缺少必需的包åå€å¡Š"
+msgid "multi-pack-index required pack-name chunk missing or corrupted"
+msgstr "多包索引所需的å°è£å稱å€å¡Šä¸å­˜åœ¨æˆ–æ壞"
#: midx.c
-msgid "multi-pack-index missing required OID fanout chunk"
-msgstr "多包索引缺少必需的物件 ID fanout å€å¡Š"
+msgid "multi-pack-index required OID fanout chunk missing or corrupted"
+msgstr "多包索引所需的 OID fanout å€å¡Šä¸å­˜åœ¨æˆ–æ壞"
#: midx.c
-msgid "multi-pack-index missing required OID lookup chunk"
-msgstr "多包索引缺少必需的物件 ID 查詢å€å¡Š"
+msgid "multi-pack-index required OID lookup chunk missing or corrupted"
+msgstr "多包索引所需的 OID 查詢å€å¡Šä¸å­˜åœ¨æˆ–æ壞"
#: midx.c
-msgid "multi-pack-index missing required object offsets chunk"
-msgstr "多包索引缺少必需的物件ä½ç§»å€å¡Š"
+msgid "multi-pack-index required object offsets chunk missing or corrupted"
+msgstr "多包索引所需的物件å移å€å¡Šä¸å­˜åœ¨æˆ–æ壞"
+
+#: midx.c
+msgid "multi-pack-index pack-name chunk is too short"
+msgstr "多包索引的å°è£å稱å€å¡ŠéŽçŸ­"
#: midx.c
#, c-format
@@ -20638,10 +21474,23 @@ msgid "bad pack-int-id: %u (%u total packs)"
msgstr "錯的 pack-int-id:%u(共有 %u 個包)"
#: midx.c
+msgid "MIDX does not contain the BTMP chunk"
+msgstr "MIDX æœªåŒ…å« BTMP å€å¡Š"
+
+#: midx.c
+#, c-format
+msgid "could not load bitmapped pack %<PRIu32>"
+msgstr "無法載入ä½åœ–化 (bitmapped) çš„å°è£ %<PRIu32>"
+
+#: midx.c
msgid "multi-pack-index stores a 64-bit offset, but off_t is too small"
msgstr "多包索引儲存一個64ä½ä½ç§»ï¼Œä½†æ˜¯ off_t 太å°"
#: midx.c
+msgid "multi-pack-index large offset out of bounds"
+msgstr "多包索引的最大å移超出邊界"
+
+#: midx.c
#, c-format
msgid "failed to add packfile '%s'"
msgstr "新增 packfile '%s' 失敗"
@@ -20741,12 +21590,6 @@ msgid "Looking for referenced packfiles"
msgstr "正在尋找引用的 packfile"
#: midx.c
-#, c-format
-msgid ""
-"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
-msgstr "物件 ID 扇出無åºï¼šfanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
-
-#: midx.c
msgid "the midx contains no oid"
msgstr "midx 沒有 oid"
@@ -20868,11 +21711,6 @@ msgid "%s: ignoring alternate object stores, nesting too deep"
msgstr "%s:忽略備用物件庫,嵌套太深"
#: object-file.c
-#, c-format
-msgid "unable to normalize object directory: %s"
-msgstr "無法è¦ç¯„化物件目錄: %s"
-
-#: object-file.c
msgid "unable to fdopen alternates lockfile"
msgstr "無法 fdopen å–代鎖檔案"
@@ -20946,6 +21784,11 @@ msgstr "鬆散物件 '%s' 後é¢æœ‰åžƒåœ¾è³‡æ–™"
#: object-file.c
#, c-format
+msgid "unable to open loose object %s"
+msgstr "無法打開鬆散物件 %s"
+
+#: object-file.c
+#, c-format
msgid "unable to parse %s header"
msgstr "ç„¡æ³•è§£æž %s 頭部"
@@ -20965,8 +21808,8 @@ msgstr "%s 的標頭éŽé•·ï¼Œè¶…出 %d ä½å…ƒçµ„"
#: object-file.c
#, c-format
-msgid "failed to read object %s"
-msgstr "讀å–物件 %s 失敗"
+msgid "loose object %s (stored in %s) is corrupt"
+msgstr "鬆散物件 %s(儲存在 %s)已æ壞"
#: object-file.c
#, c-format
@@ -20975,11 +21818,6 @@ msgstr "找ä¸åˆ° %2$s 的替代 %1$s"
#: object-file.c
#, c-format
-msgid "loose object %s (stored in %s) is corrupt"
-msgstr "鬆散物件 %s(儲存在 %s)已æ壞"
-
-#: object-file.c
-#, c-format
msgid "packed object %s (stored in %s) is corrupt"
msgstr "打包物件 %s(儲存在 %s)已æ壞"
@@ -20994,10 +21832,6 @@ msgid "unable to set permission to '%s'"
msgstr "無法為 '%s' 設定權é™"
#: object-file.c
-msgid "file write error"
-msgstr "檔案寫錯誤"
-
-#: object-file.c
msgid "error when closing loose object file"
msgstr "關閉鬆散物件檔案時發生錯誤"
@@ -21031,16 +21865,37 @@ msgstr "被 %s çš„ä¸ç©©å®šç‰©ä»¶ä¾†æºè³‡æ–™æ··æ·†"
#: object-file.c
#, c-format
+msgid "write stream object %ld != %<PRIuMAX>"
+msgstr "寫入串æµç‰©ä»¶ %ld != %<PRIuMAX>"
+
+#: object-file.c
+#, c-format
+msgid "unable to stream deflate new object (%d)"
+msgstr "ä¸èƒ½ä¸²æµå£“縮新物件 (%d)"
+
+#: object-file.c
+#, c-format
+msgid "deflateEnd on stream object failed (%d)"
+msgstr "串æµç‰©ä»¶ä¸Šçš„ deflateEnd 失敗 (%d)"
+
+#: object-file.c
+#, c-format
+msgid "unable to create directory %s"
+msgstr "無法建立 %s 目錄"
+
+#: object-file.c
+#, c-format
msgid "cannot read object for %s"
msgstr "ä¸èƒ½è®€å–物件 %s"
#: object-file.c
-msgid "corrupt commit"
-msgstr "æ壞的æ交"
+#, c-format
+msgid "object fails fsck: %s"
+msgstr "物件 fsck 失敗:%s"
#: object-file.c
-msgid "corrupt tag"
-msgstr "æ壞的標籤"
+msgid "refusing to create malformed object"
+msgstr "拒絕建立格å¼éŒ¯èª¤çš„物件"
#: object-file.c
#, c-format
@@ -21109,7 +21964,7 @@ msgstr "%s [無效物件]"
#. TRANSLATORS: This is a line of ambiguous commit
#. object output. E.g.:
#. *
-#. "deadbeef commit 2021-01-01 - Some Commit Message"
+#. "deadbeef commit 2021-01-01 - Some Commit Message"
#.
#: object-name.c
#, c-format
@@ -21119,7 +21974,7 @@ msgstr "%s æ交 %s - %s"
#. TRANSLATORS: This is a line of ambiguous
#. tag object output. E.g.:
#. *
-#. "deadbeef tag 2022-01-01 - Some Tag Message"
+#. "deadbeef tag 2022-01-01 - Some Tag Message"
#. *
#. The second argument is the YYYY-MM-DD found
#. in the tag.
@@ -21136,7 +21991,7 @@ msgstr "%s 標籤 %s - %s"
#. tag object output where we couldn't parse
#. the tag itself. E.g.:
#. *
-#. "deadbeef [bad tag, could not parse it]"
+#. "deadbeef [bad tag, could not parse it]"
#.
#: object-name.c
#, c-format
@@ -21295,6 +22150,66 @@ msgstr "ä¸èƒ½è§£æžç‰©ä»¶ï¼š%s"
msgid "hash mismatch %s"
msgstr "雜湊值與 %s ä¸ç¬¦åˆ"
+#: pack-bitmap-write.c
+msgid "trying to write commit not in index"
+msgstr "嘗試寫入ä¸åœ¨ç´¢å¼•çš„æ交"
+
+#: pack-bitmap.c
+msgid "failed to load bitmap index (corrupted?)"
+msgstr "無法載入ä½åœ–索引(æ壞?)"
+
+#: pack-bitmap.c
+msgid "corrupted bitmap index (too small)"
+msgstr "ä½åœ–索引æ壞(éŽå°ï¼‰"
+
+#: pack-bitmap.c
+msgid "corrupted bitmap index file (wrong header)"
+msgstr "ä½åœ–索引檔案æ壞(標頭錯誤)"
+
+#: pack-bitmap.c
+#, c-format
+msgid "unsupported version '%d' for bitmap index file"
+msgstr "ä½åœ–索引檔案的版本 “%d†ä¸æ”¯æ´"
+
+#: pack-bitmap.c
+msgid "corrupted bitmap index file (too short to fit hash cache)"
+msgstr "ä½åœ–索引檔案æ壞(ä¸å¤ é•·ï¼Œç„¡æ³•ç½®å…¥é›œæ¹Šå¿«å–)"
+
+#: pack-bitmap.c
+msgid "corrupted bitmap index file (too short to fit lookup table)"
+msgstr "ä½åœ–索引檔案æ壞(ä¸å¤ é•·ï¼Œç„¡æ³•ç½®å…¥æŸ¥è©¢è¡¨ï¼‰"
+
+#: pack-bitmap.c
+#, c-format
+msgid "duplicate entry in bitmap index: '%s'"
+msgstr "ä½åœ–索引中有é‡è¤‡é …目:「%sã€"
+
+#: pack-bitmap.c
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for entry %d"
+msgstr "ewah ä½åœ–æ壞:項目 %d 的標頭é­æˆªæ–·"
+
+#: pack-bitmap.c
+#, c-format
+msgid "corrupt ewah bitmap: commit index %u out of range"
+msgstr "ewah ä½åœ–æ壞:æ交索引 %u 超出範åœ"
+
+#: pack-bitmap.c
+msgid "corrupted bitmap pack index"
+msgstr "ä½åœ–包索引æ壞"
+
+#: pack-bitmap.c
+msgid "invalid XOR offset in bitmap pack index"
+msgstr "ä½åœ–包索引的 XOR å移無效"
+
+#: pack-bitmap.c
+msgid "cannot fstat bitmap file"
+msgstr "無法 fstat ä½åœ–檔案"
+
+#: pack-bitmap.c
+msgid "checksum doesn't match in MIDX and bitmap"
+msgstr "總和檢查碼在 MIDX å’Œä½åœ–中無符åˆé …ç›®"
+
#: pack-bitmap.c
msgid "multi-pack bitmap is missing required reverse index"
msgstr "多包ä½åœ–缺少需è¦çš„åå‘索引"
@@ -21304,15 +22219,89 @@ 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 "ä½åœ–查詢表æ壞:三元組ä½ç½®è¶…出索引"
+
+#: pack-bitmap.c
+msgid "corrupt bitmap lookup table: xor chain exceeds entry count"
+msgstr "ä½åœ–查詢表æ壞:XOR éˆè¶…出項目數"
+
+#: pack-bitmap.c
+#, c-format
+msgid "corrupt bitmap lookup table: commit index %u out of range"
+msgstr "ä½åœ–查詢表æ壞:æ交索引 %u 超出範åœ"
+
+#: pack-bitmap.c
#, c-format
-msgid "could not find %s in pack %s at offset %<PRIuMAX>"
-msgstr "找ä¸åˆ° %2$s 包,å移ä½ç½® %3$<PRIuMAX> çš„ %1$s"
+msgid "corrupt ewah bitmap: truncated header for bitmap of commit \"%s\""
+msgstr "ewah ä½åœ–æ壞:æ交 “%s†之ä½åœ–的標頭é­æˆªæ–·"
+
+#: pack-bitmap.c
+#, c-format
+msgid "unable to load pack: '%s', disabling pack-reuse"
+msgstr "無法載入「%sã€å°è£ï¼Œåœç”¨ pack-reuse"
+
+#: pack-bitmap.c
+#, c-format
+msgid "object '%s' not found in type bitmaps"
+msgstr "在類型ä½åœ–中,找ä¸åˆ°ã€Œ%sã€ç‰©ä»¶"
+
+#: pack-bitmap.c
+#, c-format
+msgid "object '%s' does not have a unique type"
+msgstr "「%sã€ç‰©ä»¶çš„é¡žåž‹ä¸å”¯ä¸€"
+
+#: pack-bitmap.c
+#, c-format
+msgid "object '%s': real type '%s', expected: '%s'"
+msgstr "「%sã€ç‰©ä»¶ï¼šå¯¦éš›é¡žåž‹æ˜¯ã€Œ%sã€ï¼Œä½†é æœŸæ˜¯ã€Œ%sã€"
+
+#: pack-bitmap.c
+#, c-format
+msgid "object not in bitmap: '%s'"
+msgstr "物件ä¸åœ¨ä½åœ–中:「%sã€"
+
+#: pack-bitmap.c
+msgid "failed to load bitmap indexes"
+msgstr "無法載入ä½åœ–索引"
+
+#: pack-bitmap.c
+msgid "you must specify exactly one commit to test"
+msgstr "您必須指定剛好一個è¦æ¸¬è©¦çš„æ交"
+
+#: pack-bitmap.c
+#, c-format
+msgid "commit '%s' doesn't have an indexed bitmap"
+msgstr "æ交「%sã€ç„¡ç´¢å¼•éŽçš„ä½åœ–"
+
+#: pack-bitmap.c
+msgid "mismatch in bitmap results"
+msgstr "ä½åœ–çµæžœä¸­æœ‰ä¸ç¬¦é …ç›®"
+
+#: pack-bitmap.c
+#, c-format
+msgid "could not find '%s' in pack '%s' at offset %<PRIuMAX>"
+msgstr "在「%2$sã€å°åŒ…,ä½ç§» %3$<PRIuMAX> 的地方找ä¸åˆ°ã€Œ%1$sã€"
+
+#: pack-bitmap.c
+#, c-format
+msgid "unable to get disk usage of '%s'"
+msgstr "無法å–得「%sã€çš„ç£ç¢Ÿç”¨é‡"
+
+#: pack-bitmap.c
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "“%s†ä½åœ–檔案的總和檢查碼無效"
#: pack-mtimes.c
#, c-format
@@ -21364,6 +22353,23 @@ msgstr "倒排索引檔案 %s 有ä¸æ”¯æ´çš„版本 %<PRIu32>"
msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
msgstr "倒排索引檔案 %s 有ä¸æ”¯æ´çš„雜湊 ID %<PRIu32>"
+#: pack-revindex.c
+msgid "invalid checksum"
+msgstr "無效的總和檢查碼"
+
+#: pack-revindex.c
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr "%<PRIu64> ä½ç½®çš„修訂版索引 (rev-index) 無效:%<PRIu32> != %<PRIu32>"
+
+#: pack-revindex.c
+msgid "multi-pack-index reverse-index chunk is the wrong size"
+msgstr "多包索引的åå‘索引å€å¡Šå¤§å°æœ‰èª¤"
+
+#: pack-revindex.c
+msgid "could not determine preferred pack"
+msgstr "無法確定å好å°è£"
+
#: pack-write.c
msgid "cannot both write and verify reverse index"
msgstr "無法åŒæ™‚寫入和驗證倒排索引"
@@ -21429,16 +22435,6 @@ msgstr "%s 需è¦ä¸€å€‹å€¼"
#: parse-options.c
#, c-format
-msgid "%s is incompatible with %s"
-msgstr "%s 與 %s ä¸ç›¸å®¹"
-
-#: parse-options.c
-#, c-format
-msgid "%s : incompatible with something else"
-msgstr "%s:和其它的ä¸ç›¸å®¹"
-
-#: parse-options.c
-#, c-format
msgid "%s takes no value"
msgstr "%s ä¸å–值"
@@ -21468,6 +22464,10 @@ msgid "alias of --%s"
msgstr "--%s 的別å"
#: parse-options.c
+msgid "need a subcommand"
+msgstr "需è¦å­å‘½ä»¤"
+
+#: parse-options.c
#, c-format
msgid "unknown option `%s'"
msgstr "未知é¸é … `%s'"
@@ -21533,6 +22533,11 @@ msgstr " %s"
msgid "-NUM"
msgstr "-數字"
+#: parse-options.c
+#, c-format
+msgid "opposite of --no-%s"
+msgstr "--no-%s 的相å行為"
+
#: parse-options.h
msgid "expiry-date"
msgstr "到期時間"
@@ -21554,6 +22559,10 @@ msgid "use <n> digits to display object names"
msgstr "用 <n> ä½æ•¸å­—顯示物件å稱"
#: parse-options.h
+msgid "prefixed path to initial superproject"
+msgstr "åˆå§‹çˆ¶å°ˆæ¡ˆçš„å‰ç¶´è·¯å¾‘"
+
+#: parse-options.h
msgid "how to strip spaces and #comments from message"
msgstr "設定如何刪除æ交說明裡的空格和 #備註"
@@ -21566,6 +22575,16 @@ msgid ""
"with --pathspec-from-file, pathspec elements are separated with NUL character"
msgstr "如使用 --pathspec-from-file,則 <路徑è¦æ ¼> 元件會使用 NUL 字元分隔"
+#: parse.c
+#, c-format
+msgid "bad boolean environment value '%s' for '%s'"
+msgstr "「%2$sã€çš„「%1$sã€å¸ƒæž—環境值無效"
+
+#: parse.c
+#, c-format
+msgid "failed to parse %s"
+msgstr "è§£æž %s 失敗"
+
#: path.c
#, c-format
msgid "Could not make %s writable by group"
@@ -21624,6 +22643,11 @@ msgstr "%s:'literal' å’Œ 'glob' ä¸ç›¸å®¹"
#: pathspec.c
#, c-format
+msgid "'%s' is outside the directory tree"
+msgstr "“%s†在目錄樹之外"
+
+#: pathspec.c
+#, c-format
msgid "%s: '%s' is outside repository at '%s'"
msgstr "%s:'%s' 在ä½æ–¼ '%s' 的版本庫之外"
@@ -21733,6 +22757,11 @@ msgstr "promisor-remote: 無法關閉 fetch å­è™•ç†ç¨‹åºçš„ stdin"
msgid "promisor remote name cannot begin with '/': %s"
msgstr "promisor é ç«¯å稱ä¸èƒ½ä»¥ '/' 開始:%s"
+#: promisor-remote.c
+#, c-format
+msgid "could not fetch %s from promisor remote"
+msgstr "無法從承諾者é ç«¯æŠ“å– %s"
+
#: protocol-caps.c
msgid "object-info: expected flush after arguments"
msgstr "object-info:引數後é æœŸè¦æœ‰ flush"
@@ -21775,6 +22804,15 @@ msgstr "ç”Ÿæˆ diff 失敗"
msgid "could not parse log for '%s'"
msgstr "ä¸èƒ½è§£æž '%s' 的日誌"
+#: reachable.c
+#, c-format
+msgid "invalid extra cruft tip: '%s'"
+msgstr "無效的é¡å¤–廢棄æ交修訂版:“%sâ€"
+
+#: reachable.c
+msgid "unable to enumerate additional recent objects"
+msgstr "無法列舉多出來的近期物件"
+
#: read-cache.c
#, c-format
msgid "will not add file alias '%s' ('%s' already exists in index)"
@@ -21801,11 +22839,6 @@ msgstr "無法在索引中新增 '%s'"
#: read-cache.c
#, c-format
-msgid "unable to stat '%s'"
-msgstr "ç„¡æ³•å° %s 執行 stat"
-
-#: read-cache.c
-#, c-format
msgid "'%s' appears as both a file and as a directory"
msgstr "'%s' 看起來既是檔案åˆæ˜¯ç›®éŒ„"
@@ -21940,11 +22973,6 @@ msgstr "無法轉æ›æˆç¨€ç–索引"
#: read-cache.c
#, c-format
-msgid "could not stat '%s'"
-msgstr "ä¸èƒ½å° '%s' å‘¼å« stat"
-
-#: read-cache.c
-#, c-format
msgid "unable to open git dir: %s"
msgstr "ä¸èƒ½é–‹å•Ÿ git 目錄:%s"
@@ -21963,6 +22991,16 @@ msgstr "ä¸èƒ½ä¿®å¾© '%s' 的權é™ä½"
msgid "%s: cannot drop to stage #0"
msgstr "%s:ä¸èƒ½è½åˆ°æš«å­˜å€ #0"
+#: read-cache.c
+#, c-format
+msgid "unexpected diff status %c"
+msgstr "éžé æœŸçš„ diff 狀態 %c"
+
+#: read-cache.c
+#, c-format
+msgid "remove '%s'\n"
+msgstr "移除 “%sâ€\n"
+
#: rebase-interactive.c
msgid ""
"You can fix this with 'git rebase --edit-todo' and then run 'git rebase --"
@@ -21996,32 +23034,38 @@ msgid ""
"l, label <label> = label current HEAD with a name\n"
"t, reset <label> = reset HEAD to a label\n"
"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
-". create a merge commit using the original merge commit's\n"
-". message (or the oneline, if no original merge commit was\n"
-". specified); use -c <commit> to reword the commit message\n"
+" create a merge commit using the original merge commit's\n"
+" message (or the oneline, if no original merge commit was\n"
+" specified); use -c <commit> to reword the commit message\n"
+"u, update-ref <ref> = track a placeholder for the <ref> to be updated\n"
+" to this position in the new commits. The <ref> is\n"
+" updated at the end of the rebase\n"
"\n"
"These lines can be re-ordered; they are executed from top to bottom.\n"
msgstr ""
"\n"
-"指令:\n"
+"命令:\n"
"p, pick <æ交> = 使用æ交\n"
"r, reword <æ交> = 使用æ交,但編輯æ交說明\n"
"e, edit <æ交> = 使用æ交,但ä¸ç›´æŽ¥ä¿®è£œ (amend) \n"
"s, squash <æ交> = 使用æ交,但èžåˆè‡³ä¸Šå€‹æ交\n"
-"f, fixup [-C | -c] <æ交> = è·Ÿ “squash†相似,但除éžå‚³å…¥ã€Œ-Cã€\n"
+"f, fixup [-C | -c] <æ交> = è·Ÿ “squash†相似,但除éžå‚³å…¥ -C,\n"
" å¦å‰‡åªä¿ç•™ä¸Šä¸€å€‹æ交的日誌訊æ¯ã€‚傳入 -C 表示åªä¿ç•™é€™å€‹\n"
" æ交的訊æ¯ï¼›å‚³å…¥ -c 與 -C 功能相åŒï¼Œä½†æœƒé–‹å•Ÿç·¨è¼¯å™¨\n"
-"x, exec <命令> = 使用 shell 執行指令(這一行的剩餘部分)\n"
-"b, break = 在這åœæ­¢ï¼ˆä½¿ç”¨ 'git rebase --continue' 繼續é‡å®šåŸºåº•ï¼‰\n"
+"x, exec <命令> = 使用 shell 執行命令(這一列的剩餘部分)\n"
+"b, break = 在此åœæ­¢ï¼ˆä½¿ç”¨ “git rebase --continue†繼續é‡å®šåŸºåº•ï¼‰\n"
"d, drop <æ交> = 移除æ交\n"
"l, label <標籤> = ç‚ºç›®å‰ HEAD 打上指定å字標籤\n"
"t, reset <標籤> = é‡è¨­ HEAD 到指定標籤\n"
"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
-". 建立一個åˆä½µæ交,並使用原始的åˆä½µæ交說明(如果沒有指定\n"
-". 原始æ交,使用備註部分的 oneline 作為æ交說明)。使用\n"
-". -c <commit> å¯ä»¥ç·¨è¼¯æ交說明。\n"
+" 建立一個åˆä½µæ交,並使用原始的åˆä½µæ交說明(如果沒有指定\n"
+" 原始æ交,則使用 <oneline> 作為æ交說明)。\n"
+" 使用 -c <commit> 編輯æ交說明。\n"
+"u, update-ref <ref> = 為 <ref> 引用設立佔ä½ç¬¦è™Ÿï¼Œ\n"
+" 以將這個引用更新為此處的新æ交。\n"
+" <ref> 會在é‡å®šåŸºåº•å¾Œæ›´æ–°ã€‚\n"
"\n"
-"å¯ä»¥å°é€™äº›è¡Œé‡æ–°æŽ’åºï¼Œæœƒå¾žä¸Šè‡³ä¸‹åŸ·è¡Œã€‚\n"
+"å¯ä»¥å°é€™äº›åˆ—é‡æ–°æŽ’åºï¼›åŸ·è¡Œé †åºç”±ä¸Šåˆ°ä¸‹ã€‚\n"
#: rebase-interactive.c
#, c-format
@@ -22125,6 +23169,16 @@ msgstr "領先 %d,è½å¾Œ %d"
#: ref-filter.c
#, c-format
+msgid "%%(%.*s) does not take arguments"
+msgstr "%%(%.*s) ä¸å–引數"
+
+#: ref-filter.c
+#, c-format
+msgid "unrecognized %%(%.*s) argument: %s"
+msgstr "無法識別的 %%(%.*s) 引數:%s"
+
+#: ref-filter.c
+#, c-format
msgid "expected format: %%(color:<color>)"
msgstr "期望的格å¼ï¼š%%(color:<é¡è‰²>)"
@@ -22145,38 +23199,38 @@ msgstr "期望整數值 refname:rstrip=%s"
#: ref-filter.c
#, c-format
-msgid "unrecognized %%(%s) argument: %s"
-msgstr "無法識別的 %%(%s) åƒæ•¸ï¼š%s"
+msgid "expected %%(trailers:key=<value>)"
+msgstr "é æœŸæ˜¯ %%(trailers:key=<value>)"
#: ref-filter.c
#, c-format
-msgid "%%(objecttype) does not take arguments"
-msgstr "%%(objecttype) ä¸å¸¶åƒæ•¸"
+msgid "unknown %%(trailers) argument: %s"
+msgstr "未知的 %%(trailers) åƒæ•¸ï¼š%s"
#: ref-filter.c
#, c-format
-msgid "%%(deltabase) does not take arguments"
-msgstr "%%(deltabase) ä¸å¸¶åƒæ•¸"
+msgid "positive value expected contents:lines=%s"
+msgstr "期望一個正數 contents:lines=%s"
#: ref-filter.c
#, c-format
-msgid "%%(body) does not take arguments"
-msgstr "%%(body) ä¸å¸¶åƒæ•¸"
+msgid "argument expected for %s"
+msgstr "引數é æœŸ %s"
#: ref-filter.c
#, c-format
-msgid "expected %%(trailers:key=<value>)"
-msgstr "é æœŸæ˜¯ %%(trailers:key=<value>)"
+msgid "positive value expected %s=%s"
+msgstr "期望一個正數 %s=%s"
#: ref-filter.c
#, c-format
-msgid "unknown %%(trailers) argument: %s"
-msgstr "未知的 %%(trailers) åƒæ•¸ï¼š%s"
+msgid "cannot fully parse %s=%s"
+msgstr "ç„¡æ³•å®Œå…¨è§£æž %s=%s"
#: ref-filter.c
#, c-format
-msgid "positive value expected contents:lines=%s"
-msgstr "期望一個正數 contents:lines=%s"
+msgid "value expected %s="
+msgstr "數值é æœŸ %s="
#: ref-filter.c
#, c-format
@@ -22185,11 +23239,6 @@ msgstr "%%(%2$s) 中的 '%1$s' é æœŸæ˜¯æ­£æ•¸å€¼"
#: ref-filter.c
#, c-format
-msgid "unrecognized email option: %s"
-msgstr "無法識別的 email é¸é …:%s"
-
-#: ref-filter.c
-#, c-format
msgid "expected format: %%(align:<width>,<position>)"
msgstr "期望的格å¼ï¼š%%(align:<寬度>,<ä½ç½®>)"
@@ -22205,13 +23254,18 @@ msgstr "無法識別的寬度:%s"
#: ref-filter.c
#, c-format
+msgid "unrecognized %%(%s) argument: %s"
+msgstr "無法識別的 %%(%s) åƒæ•¸ï¼š%s"
+
+#: ref-filter.c
+#, c-format
msgid "positive width expected with the %%(align) atom"
msgstr "元素 %%(align) 需è¦ä¸€å€‹æ­£æ•¸çš„寬度"
#: ref-filter.c
#, c-format
-msgid "%%(rest) does not take arguments"
-msgstr "%%(rest) 未å–引數"
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "é æœŸæ ¼å¼ï¼š%%(ahead-behind:<committish>)"
#: ref-filter.c
#, c-format
@@ -22270,6 +23324,10 @@ msgid "--format=%.*s cannot be used with --python, --shell, --tcl"
msgstr "--format=%.*s ä¸èƒ½å’Œ --pythonã€--shellã€--tcl 一起使用"
#: ref-filter.c
+msgid "failed to run 'describe'"
+msgstr "無法執行 “describeâ€"
+
+#: ref-filter.c
#, c-format
msgid "(no branch, rebasing %s)"
msgstr "(無分支,é‡å®š %s 的基底)"
@@ -22346,6 +23404,10 @@ msgstr "key"
msgid "field name to sort on"
msgstr "排åºçš„欄ä½å"
+#: ref-filter.h
+msgid "exclude refs which match pattern"
+msgstr "排除符åˆæ¨¡å¼çš„引用"
+
#: reflog.c
#, c-format
msgid "not a reflog: %s"
@@ -22449,17 +23511,12 @@ msgstr "'%s' 已存在,無法建立 '%s'"
msgid "cannot process '%s' and '%s' at the same time"
msgstr "無法åŒæ™‚è™•ç† '%s' å’Œ '%s'"
-#: refs/files-backend.c
-#, c-format
-msgid "could not remove reference %s"
-msgstr "無法刪除引用 %s"
-
-#: refs/files-backend.c refs/packed-backend.c
+#: refs.c
#, c-format
msgid "could not delete reference %s: %s"
msgstr "無法刪除引用 %s:%s"
-#: refs/files-backend.c refs/packed-backend.c
+#: refs.c
#, c-format
msgid "could not delete references: %s"
msgstr "無法刪除引用:%s"
@@ -22586,6 +23643,15 @@ msgid "http transport does not support %s"
msgstr "http 傳輸å”定ä¸æ”¯æ´ %s"
#: remote-curl.c
+msgid "protocol error: expected '<url> <path>', missing space"
+msgstr "å”定錯誤:é æœŸæ˜¯ã€Œ<URL> <路徑>ã€ï¼Œä½†ç¼ºå°‘空白"
+
+#: remote-curl.c
+#, c-format
+msgid "failed to download file at URL '%s'"
+msgstr "無法下載ä½æ–¼ URL “%s†的檔案"
+
+#: remote-curl.c
msgid "git-http-push failed"
msgstr "git-http-push 失敗"
@@ -22866,8 +23932,9 @@ msgstr[0] ""
# 譯者:請維æŒå‰å°Žç©ºæ ¼
#: remote.c
-msgid " (use \"git pull\" to merge the remote branch into yours)\n"
-msgstr " (使用 \"git pull\" 來åˆä½µé ç«¯åˆ†æ”¯ï¼‰\n"
+msgid ""
+" (use \"git pull\" if you want to integrate the remote branch with yours)\n"
+msgstr " (使用 “git pull†來將é ç«¯åˆ†æ”¯æ•´åˆé€²æ‚¨çš„分支)\n"
#: remote.c
#, c-format
@@ -22940,7 +24007,7 @@ msgstr "使用之å‰çš„解決方案解決 '%s'。"
#: rerere.c
#, c-format
msgid "cannot unlink stray '%s'"
-msgstr "ä¸èƒ½åˆªé™¤ stray '%s'"
+msgstr "無法刪除失散檔案 “%sâ€"
#: rerere.c
#, c-format
@@ -22959,11 +24026,6 @@ msgstr "沒有為 '%s' 記憶的解決方案"
#: rerere.c
#, c-format
-msgid "cannot unlink '%s'"
-msgstr "ä¸èƒ½åˆªé™¤ '%s'"
-
-#: rerere.c
-#, c-format
msgid "Updated preimage for '%s'"
msgstr "已為 '%s' 更新 preimage"
@@ -22990,10 +24052,34 @@ msgid "failed to find tree of %s"
msgstr "無法找到 %s 指å‘的樹"
#: revision.c
+#, c-format
+msgid "unsupported section for hidden refs: %s"
+msgstr "ä¸æ”¯æ´çš„éš±è—引用å€å¡Šï¼š%s"
+
+#: revision.c
+msgid "--exclude-hidden= passed more than once"
+msgstr "--exclude-hidden= 傳入了ä¸æ­¢ä¸€æ¬¡"
+
+#: revision.c
+#, c-format
+msgid "resolve-undo records `%s` which is missing"
+msgstr "resolve-undo ä¸å­˜åœ¨çš„「%sã€è¨˜éŒ„"
+
+#: revision.c
+#, c-format
+msgid "could not get commit for ancestry-path argument %s"
+msgstr "無法å–å¾— ancestry-path 引數 %s çš„æ交"
+
+#: revision.c
msgid "--unpacked=<packfile> no longer supported"
msgstr "--unpacked=<packfile> å·²ä¸å—支æ´"
#: revision.c
+#, c-format
+msgid "invalid option '%s' in --stdin mode"
+msgstr "在 --stdin 模å¼ä¸‹ï¼Œâ€œ%s†é¸é …無效"
+
+#: revision.c
msgid "your current branch appears to be broken"
msgstr "您的目å‰åˆ†æ”¯å¥½åƒè¢«æ壞"
@@ -23015,6 +24101,257 @@ msgstr "-L å°šä¸æ”¯æ´ -p å’Œ -s 之外的差異格å¼"
msgid "cannot create async thread: %s"
msgstr "ä¸èƒ½å»ºç«‹ async 執行緒:%s"
+#: scalar.c worktree.c
+#, c-format
+msgid "'%s' does not exist"
+msgstr "'%s' ä¸å­˜åœ¨"
+
+#: scalar.c
+#, c-format
+msgid "could not switch to '%s'"
+msgstr "無法切æ›è‡³ã€Œ%sã€"
+
+#: scalar.c
+msgid "need a working directory"
+msgstr "需è¦å·¥ä½œç›®éŒ„"
+
+#: scalar.c
+msgid "Scalar enlistments require a worktree"
+msgstr "ç´”é‡ç·¨åˆ—å單需è¦å·¥ä½œç›®éŒ„"
+
+#: scalar.c
+#, c-format
+msgid "could not configure %s=%s"
+msgstr "無法設定 %s=%s"
+
+#: scalar.c
+msgid "could not configure log.excludeDecoration"
+msgstr "無法設定 log.excludeDecoration"
+
+#: scalar.c
+msgid "could not add enlistment"
+msgstr "無法加入編列清單"
+
+#: scalar.c
+msgid "could not set recommended config"
+msgstr "無法設定建議組態"
+
+#: scalar.c
+msgid "could not turn on maintenance"
+msgstr "無法開啟維護模å¼"
+
+#: scalar.c
+msgid "could not start the FSMonitor daemon"
+msgstr "無法啟動 FSMonitor 守護程å¼"
+
+#: scalar.c
+msgid "could not turn off maintenance"
+msgstr "無法關閉維護模å¼"
+
+#: scalar.c
+msgid "could not remove enlistment"
+msgstr "無法移除編列清單"
+
+#: scalar.c
+#, c-format
+msgid "remote HEAD is not a branch: '%.*s'"
+msgstr "é ç«¯ HEAD ä¸æ˜¯åˆ†æ”¯ï¼šã€Œ%.*sã€"
+
+#: scalar.c
+msgid "failed to get default branch name from remote; using local default"
+msgstr "無法從é ç«¯å–å¾—é è¨­åˆ†æ”¯å稱。改用本機é è¨­å稱"
+
+#: scalar.c
+msgid "failed to get default branch name"
+msgstr "無法å–å¾—é è¨­åˆ†æ”¯å稱"
+
+#: scalar.c
+msgid "failed to unregister repository"
+msgstr "無法å–消註冊版本庫"
+
+#: scalar.c
+msgid "failed to stop the FSMonitor daemon"
+msgstr "無法åœæ­¢ FSMonitor 守護程å¼"
+
+#: scalar.c
+msgid "failed to delete enlistment directory"
+msgstr "無法刪除編列å單目錄"
+
+#: scalar.c
+msgid "branch to checkout after clone"
+msgstr "複製後è¦ç°½å‡ºçš„分支"
+
+#: scalar.c
+msgid "when cloning, create full working directory"
+msgstr "複製時建立完整的工作目錄"
+
+#: scalar.c
+msgid "only download metadata for the branch that will be checked out"
+msgstr "åªä¸‹è¼‰æœƒç°½å‡ºçš„分支中介資料"
+
+#: scalar.c
+msgid "create repository within 'src' directory"
+msgstr "在 “src†目錄建立版本庫"
+
+#: scalar.c
+msgid ""
+"scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n"
+"\t[--[no-]src] <url> [<enlistment>]"
+msgstr ""
+"scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n"
+"\t[--[no-]src] <url> [<enlistment>]"
+
+#: scalar.c
+#, c-format
+msgid "cannot deduce worktree name from '%s'"
+msgstr "無法從「%sã€æŽ¨è«–工作å€å稱"
+
+#: scalar.c
+#, c-format
+msgid "directory '%s' exists already"
+msgstr "「%sã€ç›®éŒ„已經存在"
+
+#: scalar.c
+#, c-format
+msgid "failed to get default branch for '%s'"
+msgstr "無法å–得「%sã€çš„é è¨­åˆ†æ”¯"
+
+#: scalar.c
+#, c-format
+msgid "could not configure remote in '%s'"
+msgstr "無法設定「%sã€ä¸­çš„é ç«¯"
+
+#: scalar.c
+#, c-format
+msgid "could not configure '%s'"
+msgstr "無法設定「%sã€"
+
+#: scalar.c
+msgid "partial clone failed; attempting full clone"
+msgstr "部分複製失敗。嘗試完整複製"
+
+#: scalar.c
+msgid "could not configure for full clone"
+msgstr "無法設定完整複製"
+
+#: scalar.c
+msgid "scalar diagnose [<enlistment>]"
+msgstr "scalar diagnose [<enlistment>]"
+
+#: scalar.c
+msgid "`scalar list` does not take arguments"
+msgstr "`scalar list` 未å–引數"
+
+#: scalar.c
+msgid "scalar register [<enlistment>]"
+msgstr "scalar register [<enlistment>]"
+
+#: scalar.c
+msgid "reconfigure all registered enlistments"
+msgstr "é‡æ–°è¨­å®šæ‰€æœ‰è¨»å†Šçš„編列åå–®"
+
+#: scalar.c
+msgid "scalar reconfigure [--all | <enlistment>]"
+msgstr "scalar reconfigure [--all | <enlistment>]"
+
+#: scalar.c
+msgid "--all or <enlistment>, but not both"
+msgstr "--all 或 <enlistment> 但ä¸èƒ½å‚³å…¥å…©è€…"
+
+#: scalar.c
+#, c-format
+msgid "could not remove stale scalar.repo '%s'"
+msgstr "無法移除éŽæ™‚çš„ scalar.repo “%sâ€"
+
+#: scalar.c
+#, c-format
+msgid "removed stale scalar.repo '%s'"
+msgstr "已移除éŽæ™‚çš„ scalar.repo “%sâ€"
+
+#: scalar.c
+#, c-format
+msgid "repository at '%s' has different owner"
+msgstr "ä½æ–¼ “%s†的版本庫有ä¸åŒçš„æ“有者"
+
+#: scalar.c
+#, c-format
+msgid "repository at '%s' has a format issue"
+msgstr "ä½æ–¼ “%s†的版本庫有格å¼å•é¡Œ"
+
+#: scalar.c
+#, c-format
+msgid "repository not found in '%s'"
+msgstr "版本庫ä¸åœ¨ “%sâ€"
+
+#: scalar.c
+#, c-format
+msgid ""
+"to unregister this repository from Scalar, run\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+msgstr ""
+"如果è¦å¾ž Scalar 解除這個版本庫的註冊,請執行\n"
+"\tgit config --global --unset --fixed-value scalar.repo \"%s\""
+
+#: scalar.c
+msgid ""
+"scalar run <task> [<enlistment>]\n"
+"Tasks:\n"
+msgstr ""
+"scalar run <task> [<enlistment>]\n"
+"作業:\n"
+
+#: scalar.c
+#, c-format
+msgid "no such task: '%s'"
+msgstr "無此作業:「%sã€"
+
+#: scalar.c
+msgid "scalar unregister [<enlistment>]"
+msgstr "scalar unregister [<enlistment>]"
+
+#: scalar.c
+msgid "scalar delete <enlistment>"
+msgstr "scalar delete <enlistment>"
+
+#: scalar.c
+msgid "refusing to delete current working directory"
+msgstr "拒絕刪除目å‰å·¥ä½œç›®éŒ„"
+
+#: scalar.c
+msgid "include Git version"
+msgstr "åŒ…å« Git 版本"
+
+#: scalar.c
+msgid "include Git's build options"
+msgstr "åŒ…å« Git 組建é¸é …"
+
+#: scalar.c
+msgid "scalar verbose [-v | --verbose] [--build-options]"
+msgstr "scalar verbose [-v | --verbose] [--build-options]"
+
+#: scalar.c
+msgid "-C requires a <directory>"
+msgstr "-C éœ€è¦ <directory>"
+
+#: scalar.c
+#, c-format
+msgid "could not change to '%s'"
+msgstr "無法更改為「%sã€"
+
+#: scalar.c
+msgid "-c requires a <key>=<value> argument"
+msgstr "-c éœ€è¦ <key>=<value> 引數"
+
+#: scalar.c
+msgid ""
+"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
+"\n"
+"Commands:\n"
+msgstr ""
+"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
+"\n"
+"命令:\n"
+
#: send-pack.c
msgid "unexpected flush packet while reading remote unpack status"
msgstr "讀å–é ç«¯è§£åŒ…狀態時收到æ„外的 flush 包"
@@ -23083,7 +24420,7 @@ msgstr "摘å–"
#: sequencer.c
msgid "rebase"
-msgstr "rebase"
+msgstr "é‡å®šåŸºåº•"
#: sequencer.c
#, c-format
@@ -23135,11 +24472,6 @@ msgstr ""
msgid "could not lock '%s'"
msgstr "ä¸èƒ½éŽ–定 '%s'"
-#: sequencer.c strbuf.c wrapper.c
-#, c-format
-msgid "could not write to '%s'"
-msgstr "ä¸èƒ½å¯«å…¥ '%s'"
-
#: sequencer.c
#, c-format
msgid "could not write eol to '%s'"
@@ -23157,12 +24489,7 @@ msgstr "您的本機修改將被%s覆蓋。"
#: sequencer.c
msgid "commit your changes or stash them to proceed."
-msgstr "æ交您的修改或儲è—後å†ç¹¼çºŒã€‚"
-
-#: sequencer.c
-#, c-format
-msgid "%s: fast-forward"
-msgstr "%s:快轉"
+msgstr "æ交您的修改或貯存後å†ç¹¼çºŒã€‚"
#. TRANSLATORS: %s will be "revert", "cherry-pick" or
#. "rebase".
@@ -23347,7 +24674,7 @@ msgstr "無效的作者身分 '%s'"
msgid "corrupt author: missing date information"
msgstr "作者資訊æ壞:缺少日期資訊"
-#: sequencer.c t/helper/test-fast-rebase.c
+#: sequencer.c
#, c-format
msgid "could not update %s"
msgstr "ä¸èƒ½æ›´æ–° %s"
@@ -23444,11 +24771,6 @@ msgstr "%s:ä¸èƒ½è§£æžçˆ¶æ交 %s"
#: sequencer.c
#, c-format
-msgid "could not rename '%s' to '%s'"
-msgstr "ä¸èƒ½å°‡ '%s' é‡æ–°å‘½å為 '%s'"
-
-#: sequencer.c
-#, c-format
msgid "could not revert %s... %s"
msgstr "ä¸èƒ½é‚„原 %s... %s"
@@ -23474,6 +24796,26 @@ msgstr "git %s:無法é‡æ–°æ•´ç†ç´¢å¼•"
#: sequencer.c
#, c-format
+msgid "'%s' is not a valid label"
+msgstr "“%s†ä¸æ˜¯æœ‰æ•ˆçš„標籤"
+
+#: sequencer.c
+#, c-format
+msgid "'%s' is not a valid refname"
+msgstr "“%s†ä¸æ˜¯æœ‰æ•ˆçš„引用å稱"
+
+#: sequencer.c
+#, c-format
+msgid "update-ref requires a fully qualified refname e.g. refs/heads/%s"
+msgstr "update-ref 需è¦å®Œå…¨é™å®šçš„引用å稱,比如:refs/heads/%s"
+
+#: sequencer.c
+#, c-format
+msgid "invalid command '%.*s'"
+msgstr "無效的命令 “%.*sâ€"
+
+#: sequencer.c
+#, c-format
msgid "%s does not accept arguments: '%s'"
msgstr "%s ä¸æŽ¥å—åƒæ•¸ï¼š'%s'"
@@ -23563,10 +24905,6 @@ msgid "could not create sequencer directory '%s'"
msgstr "ä¸èƒ½å»ºç«‹åºåˆ—目錄 '%s'"
#: sequencer.c
-msgid "could not lock HEAD"
-msgstr "ä¸èƒ½éŽ–定 HEAD"
-
-#: sequencer.c
msgid "no cherry-pick or revert in progress"
msgstr "æ€é¸æˆ–還原動作並未進行"
@@ -23681,22 +25019,22 @@ msgstr ""
"\n"
#: sequencer.c
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "並且修改索引和/或工作å€\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "並且更改索引和(或)工作å€ã€‚\n"
#: sequencer.c
#, c-format
msgid ""
"execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
"Commit or stash your changes, and then run\n"
"\n"
" git rebase --continue\n"
"\n"
msgstr ""
"執行æˆåŠŸï¼š%s\n"
-"但是在索引和/或工作å€ä¸­å­˜åœ¨è®Šæ›´\n"
-"æ交或儲è—修改,然後執行\n"
+"但是在索引和(或)工作å€ä¸­å­˜åœ¨è®Šæ›´ã€‚\n"
+"è«‹æ交或貯存修改,然後執行\n"
"\n"
" git rebase --continue\n"
"\n"
@@ -23707,6 +25045,11 @@ msgid "illegal label name: '%.*s'"
msgstr "éžæ³•çš„標籤å稱:'%.*s'"
#: sequencer.c
+#, c-format
+msgid "could not resolve '%s'"
+msgstr "ç„¡æ³•è§£æž '%s'"
+
+#: sequencer.c
msgid "writing fake root commit"
msgstr "寫å½æ ¹æ交"
@@ -23715,11 +25058,6 @@ msgid "writing squash-onto"
msgstr "寫入 squash-onto"
#: sequencer.c
-#, c-format
-msgid "could not resolve '%s'"
-msgstr "ç„¡æ³•è§£æž '%s'"
-
-#: sequencer.c
msgid "cannot merge without a current revision"
msgstr "沒有目å‰ç‰ˆæœ¬ä¸èƒ½åˆä½µ"
@@ -23752,6 +25090,30 @@ msgid "merge: Unable to write new index file"
msgstr "åˆä½µï¼šç„¡æ³•å¯«å…¥æ–°ç´¢å¼•æª”案"
#: sequencer.c
+#, c-format
+msgid ""
+"another 'rebase' process appears to be running; '%s.lock' already exists"
+msgstr "似乎有å¦ä¸€å€‹ “rebase†程åºæ­£åœ¨é€²è¡Œï¼›â€œ%s.lock†已經存在"
+
+#: sequencer.c
+#, c-format
+msgid ""
+"Updated the following refs with %s:\n"
+"%s"
+msgstr ""
+"已使用 %s 更新下述引用:\n"
+"%s"
+
+#: sequencer.c
+#, c-format
+msgid ""
+"Failed to update the following refs with %s:\n"
+"%s"
+msgstr ""
+"無法使用 %s 更新下述引用:\n"
+"%s"
+
+#: sequencer.c
msgid "Cannot autostash"
msgstr "無法 autostash"
@@ -23792,16 +25154,20 @@ msgid ""
"You can run \"git stash pop\" or \"git stash drop\" at any time.\n"
msgstr ""
"%s\n"
-"您的修改安全地儲存在儲è—å€ä¸­ã€‚\n"
+"您的修改安全地儲存在貯存å€ä¸­ã€‚\n"
"您å¯ä»¥åœ¨ä»»ä½•æ™‚候執行 \"git stash pop\" 或 \"git stash drop\"。\n"
#: sequencer.c
msgid "Applying autostash resulted in conflicts."
-msgstr "因套用自動儲è—而導致è¡çªã€‚"
+msgstr "因套用自動貯存而導致è¡çªã€‚"
#: sequencer.c
msgid "Autostash exists; creating a new stash entry."
-msgstr "已有自動儲è—;建立新儲è—項目。"
+msgstr "已有自動貯存;建立新貯存項目。"
+
+#: sequencer.c
+msgid "autostash reference is a symref"
+msgstr "autostash 引用是符號引用"
#: sequencer.c
msgid "could not detach HEAD"
@@ -23839,13 +25205,13 @@ msgstr ""
#: sequencer.c
#, c-format
-msgid "Rebasing (%d/%d)%s"
-msgstr "正在é‡å®šåŸºåº• (%d/%d)%s"
+msgid "Stopped at %s... %.*s\n"
+msgstr "åœæ­¢åœ¨ %s... %.*s\n"
#: sequencer.c
#, c-format
-msgid "Stopped at %s... %.*s\n"
-msgstr "åœæ­¢åœ¨ %s... %.*s\n"
+msgid "Rebasing (%d/%d)%s"
+msgstr "正在é‡å®šåŸºåº• (%d/%d)%s"
#: sequencer.c
#, c-format
@@ -23953,6 +25319,11 @@ msgstr "無法略éŽä¸å¿…è¦çš„æ€é¸"
msgid "the script was already rearranged."
msgstr "腳本已經é‡æ–°ç·¨æŽ’。"
+#: sequencer.c
+#, c-format
+msgid "update-refs file at '%s' is invalid"
+msgstr "ä½æ–¼ã€Œ%sã€çš„ update-refs 檔案無效"
+
#: setup.c
#, c-format
msgid "'%s' is outside repository at '%s'"
@@ -24093,18 +25464,23 @@ msgstr ""
#: setup.c
#, c-format
msgid ""
-"unsafe repository ('%s' is owned by someone else)\n"
-"To add an exception for this directory, call:\n"
+"detected dubious ownership in repository at '%s'\n"
+"%sTo add an exception for this directory, call:\n"
"\n"
"\tgit config --global --add safe.directory %s"
msgstr ""
-"ä¸å®‰å…¨ç‰ˆæœ¬åº«ï¼ˆã€Œ%sã€ç”±å…¶ä»–人所有)\n"
-"è‹¥è¦æ”¾è¡Œæœ¬ç›®éŒ„,請呼å«ï¼š\n"
+"在ä½æ–¼ã€Œ%sã€çš„版本庫åµæ¸¬åˆ°å¯ç–‘所有權\n"
+"%sè‹¥è¦æ”¾è¡Œæœ¬ç›®éŒ„,請呼å«ï¼š\n"
"\n"
"\tgit config --global --add safe.directory %s"
#: setup.c
#, c-format
+msgid "cannot use bare repository '%s' (safe.bareRepository is '%s')"
+msgstr "無法使用 “%s†純版本庫(safe.bareRepository 是 “%sâ€ï¼‰"
+
+#: setup.c
+#, c-format
msgid ""
"problem with core.sharedRepository filemode value (0%.3o).\n"
"The owner of files must always have read and write permissions."
@@ -24120,6 +25496,100 @@ msgstr "fork 失敗"
msgid "setsid failed"
msgstr "setsid 失敗"
+#: setup.c
+#, c-format
+msgid "cannot stat template '%s'"
+msgstr "ä¸èƒ½å°ç¯„本 '%s' å‘¼å« stat"
+
+#: setup.c
+#, c-format
+msgid "cannot opendir '%s'"
+msgstr "ä¸èƒ½é–‹å•Ÿç›®éŒ„ '%s'"
+
+#: setup.c
+#, c-format
+msgid "cannot readlink '%s'"
+msgstr "ä¸èƒ½è®€å–é€£çµ '%s'"
+
+#: setup.c
+#, c-format
+msgid "cannot symlink '%s' '%s'"
+msgstr "ä¸èƒ½è‡ª '%s' 到 '%s' 建立符號連çµ"
+
+#: setup.c
+#, c-format
+msgid "cannot copy '%s' to '%s'"
+msgstr "ä¸èƒ½è¤‡è£½ '%s' 至 '%s'"
+
+#: setup.c
+#, c-format
+msgid "ignoring template %s"
+msgstr "忽略範本 %s"
+
+#: setup.c
+#, c-format
+msgid "templates not found in %s"
+msgstr "沒有在 %s 中找到範本"
+
+#: setup.c
+#, c-format
+msgid "not copying templates from '%s': %s"
+msgstr "沒有從 '%s' 複製範本:%s"
+
+#: setup.c
+#, c-format
+msgid "invalid initial branch name: '%s'"
+msgstr "無效的åˆå§‹åˆ†æ”¯å稱:'%s'"
+
+#: setup.c
+#, c-format
+msgid "re-init: ignored --initial-branch=%s"
+msgstr "re-init: 忽略 --initial-branch=%s"
+
+#: setup.c
+#, c-format
+msgid "unable to handle file type %d"
+msgstr "ä¸èƒ½è™•ç† %d 類型的檔案"
+
+#: setup.c
+#, c-format
+msgid "unable to move %s to %s"
+msgstr "ä¸èƒ½ç§»å‹• %s 至 %s"
+
+#: setup.c
+msgid "attempt to reinitialize repository with different hash"
+msgstr "嘗試以ä¸åŒçš„雜湊值é‡æ–°åˆå§‹åŒ–版本庫"
+
+#: setup.c
+msgid ""
+"attempt to reinitialize repository with different reference storage format"
+msgstr "嘗試以ä¸åŒçš„引用儲存格å¼é‡æ–°åˆå§‹åŒ–版本庫"
+
+#: setup.c
+#, c-format
+msgid "%s already exists"
+msgstr "%s 已經存在"
+
+#: setup.c
+#, c-format
+msgid "Reinitialized existing shared Git repository in %s%s\n"
+msgstr "é‡æ–°åˆå§‹åŒ–已存在的共享 Git 版本庫於 %s%s\n"
+
+#: setup.c
+#, c-format
+msgid "Reinitialized existing Git repository in %s%s\n"
+msgstr "é‡æ–°åˆå§‹åŒ–已存在的 Git 版本庫於 %s%s\n"
+
+#: setup.c
+#, c-format
+msgid "Initialized empty shared Git repository in %s%s\n"
+msgstr "å·²åˆå§‹åŒ–空的共享 Git 版本庫於 %s%s\n"
+
+#: setup.c
+#, c-format
+msgid "Initialized empty Git repository in %s%s\n"
+msgstr "å·²åˆå§‹åŒ–空的 Git 版本庫於 %s%s\n"
+
#: sparse-index.c
#, c-format
msgid "index entry is a directory, but not sparse (%08x)"
@@ -24179,11 +25649,6 @@ msgid "%u byte/s"
msgid_plural "%u bytes/s"
msgstr[0] "%u ä½å…ƒçµ„/秒"
-#: strbuf.c
-#, c-format
-msgid "could not edit '%s'"
-msgstr "無法編輯 '%s'"
-
#: submodule-config.c
#, c-format
msgid "ignoring suspicious submodule name: %s"
@@ -24196,7 +25661,7 @@ msgstr "submodule.fetchJobs ä¸å…許為負值"
#: submodule-config.c
#, c-format
msgid "ignoring '%s' which may be interpreted as a command-line option: %s"
-msgstr "忽略å¯èƒ½è¢«è§£æžç‚ºæŒ‡ä»¤åˆ—é¸é …çš„ '%s':%s"
+msgstr "忽略å¯èƒ½è¢«è§£æžç‚ºå‘½ä»¤åˆ—é¸é …çš„ '%s':%s"
#: submodule-config.c
#, c-format
@@ -24394,13 +25859,30 @@ msgstr "ls-tree 返回未知返回值 %d"
msgid "failed to lstat '%s'"
msgstr "無法 lstat “%sâ€"
-#: t/helper/test-fast-rebase.c
-msgid "unhandled options"
-msgstr "未處ç†é¸é …"
+#: t/helper/test-bundle-uri.c
+msgid "no remote configured to get bundle URIs from"
+msgstr "沒有設定å¯ä»¥ç”¨ä¾†å–得套件包 URIs çš„é ç«¯"
-#: t/helper/test-fast-rebase.c
-msgid "error preparing revisions"
-msgstr "準備修訂版本時發生錯誤"
+#: t/helper/test-bundle-uri.c
+#, c-format
+msgid "remote '%s' has no configured URL"
+msgstr "“%s†é ç«¯æœªè¨­å®š URL"
+
+#: t/helper/test-bundle-uri.c
+msgid "could not get the bundle-uri list"
+msgstr "無法å–å¾— bundle-uri 清單"
+
+#: t/helper/test-cache-tree.c
+msgid "test-tool cache-tree <options> (control|prime|update)"
+msgstr "test-tool cache-tree <options> (control|prime|update)"
+
+#: t/helper/test-cache-tree.c
+msgid "clear the cache tree before each iteration"
+msgstr "æ¯æ¬¡è¿­ä»£å‰æ¸…除快å–樹狀物件"
+
+#: t/helper/test-cache-tree.c
+msgid "number of entries in the cache tree to invalidate (default 0)"
+msgstr "在快å–樹狀物件中,è¦ä½¿å¤±æ•ˆçš„項目數é‡ï¼ˆé è¨­å€¼ç‚º 0)"
#: t/helper/test-reach.c
#, c-format
@@ -24595,10 +26077,6 @@ msgstr "å”定ä¸æ”¯æ´è¨­å®šé ç«¯æœå‹™è·¯å¾‘"
msgid "invalid remote service path"
msgstr "無效的é ç«¯æœå‹™è·¯å¾‘"
-#: transport-helper.c transport.c
-msgid "operation not supported by protocol"
-msgstr "å”定ä¸æ”¯æ´è©²å‹•ä½œ"
-
#: transport-helper.c
#, c-format
msgid "can't connect to subservice %s"
@@ -24735,7 +26213,7 @@ msgstr "å°‡è¦è¨­å®š '%1$s' 的上游為 '%3$s' çš„ '%2$s'\n"
#: transport.c
#, c-format
msgid "could not read bundle '%s'"
-msgstr "無法讀å–「%sã€å¥—件"
+msgstr "無法讀å–「%sã€å¥—件包"
#: transport.c
#, c-format
@@ -24764,11 +26242,6 @@ msgstr "å”定 v2 的支æ´å°šæœªå¯¦ç¾"
#: transport.c
#, c-format
-msgid "unknown value for config '%s': %s"
-msgstr "設定 '%s' çš„å–值未知:%s"
-
-#: transport.c
-#, c-format
msgid "transport '%s' not allowed"
msgstr "傳輸 '%s' ä¸å…許"
@@ -24818,6 +26291,18 @@ msgstr "正在終止。"
msgid "failed to push all needed submodules"
msgstr "ä¸èƒ½æŽ¨é€å…¨éƒ¨éœ€è¦çš„å­æ¨¡çµ„"
+#: transport.c
+msgid "bundle-uri operation not supported by protocol"
+msgstr "通訊å”定ä¸æ”¯æ´ bundle-uri 動作"
+
+#: transport.c
+msgid "could not retrieve server-advertised bundle-uri list"
+msgstr "無法å–得伺æœå™¨å…¬ä½ˆçš„ bundle-uri 清單"
+
+#: transport.c
+msgid "operation not supported by protocol"
+msgstr "å”定ä¸æ”¯æ´è©²å‹•ä½œ"
+
#: tree-walk.c
msgid "too-short tree object"
msgstr "太短的樹狀物件"
@@ -24841,7 +26326,7 @@ msgid ""
"%%sPlease commit your changes or stash them before you switch branches."
msgstr ""
"您å°ä¸‹åˆ—檔案的本機修改將被簽出動作覆蓋:\n"
-"%%s請在切æ›åˆ†æ”¯å‰æ交或儲è—您的修改。"
+"%%s請在切æ›åˆ†æ”¯å‰æ交或貯存您的修改。"
#: unpack-trees.c
#, c-format
@@ -24859,7 +26344,7 @@ msgid ""
"%%sPlease commit your changes or stash them before you merge."
msgstr ""
"您å°ä¸‹åˆ—檔案的本機修改將被åˆä½µå‹•ä½œè¦†è“‹ï¼š\n"
-"%%s請在åˆä½µå‰æ交或儲è—您的修改。"
+"%%s請在åˆä½µå‰æ交或貯存您的修改。"
#: unpack-trees.c
#, c-format
@@ -24877,7 +26362,7 @@ msgid ""
"%%sPlease commit your changes or stash them before you %s."
msgstr ""
"您å°ä¸‹åˆ—檔案的本機修改將被 %s 覆蓋:\n"
-"%%s請在 %s 之å‰æ交或儲è—您的修改。"
+"%%s請在 %s 之å‰æ交或貯存您的修改。"
#: unpack-trees.c
#, c-format
@@ -25126,6 +26611,22 @@ msgstr "無效的埠號"
msgid "invalid '..' path segment"
msgstr "無效的 '..' 路徑å€å¡Š"
+#: usage.c
+msgid "usage: "
+msgstr "用法: "
+
+#: usage.c
+msgid "fatal: "
+msgstr "致命錯誤: "
+
+#: usage.c
+msgid "error: "
+msgstr "錯誤: "
+
+#: usage.c
+msgid "warning: "
+msgstr "警告: "
+
#: walker.c
msgid "Fetching objects"
msgstr "正在抓å–物件"
@@ -25254,6 +26755,10 @@ msgstr "ä¸èƒ½å­˜å– '%s'"
msgid "unable to get current working directory"
msgstr "ä¸èƒ½å–å¾—ç›®å‰å·¥ä½œç›®éŒ„"
+#: wrapper.c
+msgid "unable to get random bytes"
+msgstr "無法å–得隨機ä½å…ƒçµ„"
+
#: wt-status.c
msgid "Unmerged paths:"
msgstr "未åˆä½µçš„路徑:"
@@ -25403,7 +26908,7 @@ msgstr "未追蹤的內容, "
#, c-format
msgid "Your stash currently has %d entry"
msgid_plural "Your stash currently has %d entries"
-msgstr[0] "您的儲è—å€ç›®å‰æœ‰ %d æ¢ç´€éŒ„"
+msgstr[0] "您的貯存å€ç›®å‰æœ‰ %d æ¢ç´€éŒ„"
#: wt-status.c
msgid "Submodules changed but not updated:"
@@ -25716,12 +27221,20 @@ msgstr "忽略的檔案"
#: wt-status.c
#, c-format
msgid ""
-"It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
-"may speed it up, but you have to be careful not to forget to add\n"
-"new files yourself (see 'git help status')."
+"It took %.2f seconds to enumerate untracked files,\n"
+"but the results were cached, and subsequent runs may be faster."
msgstr ""
-"耗費了 %.2f 秒以枚舉未追蹤的檔案。'status -uno' 也許能æ高速度,\n"
-"但您需è¦å°å¿ƒä¸è¦å¿˜äº†æ–°å¢žæ–°æª”案(åƒè¦‹ 'git help status')。"
+"列舉未追蹤檔案花費 %.2f 秒,\n"
+"ä¸éŽå·²ç¶“å¿«å–çµæžœï¼Œä¹‹å¾ŒåŸ·è¡Œçš„速度或許能比較快。"
+
+#: wt-status.c
+#, c-format
+msgid "It took %.2f seconds to enumerate untracked files."
+msgstr "列舉未追蹤檔案花費 %.2f 秒。"
+
+#: wt-status.c
+msgid "See 'git help status' for information on how to improve this."
+msgstr "è«‹åƒé–± “git help status†深入了解如何改善。"
#: wt-status.c
#, c-format
@@ -25818,7 +27331,12 @@ msgstr "å¦å¤–,您的索引中包å«æœªæ交的變更。"
msgid "cannot %s: Your index contains uncommitted changes."
msgstr "ä¸èƒ½%s:您的索引中包å«æœªæ交的變更。"
-#: git-merge-octopus.sh
+#: xdiff-interface.c
+#, c-format
+msgid "unknown style '%s' given for '%s'"
+msgstr "給予「%2$sã€çš„「%1$sã€æ¨£å¼æœªçŸ¥"
+
+#: git-merge-octopus.sh git-merge-resolve.sh
msgid ""
"Error: Your local changes to the following files would be overwritten by "
"merge"
@@ -25897,317 +27415,6 @@ msgstr "您需è¦åœ¨å·¥ä½œå€çš„頂級目錄中執行這個指令。"
msgid "Unable to determine absolute path of git directory"
msgstr "ä¸èƒ½ç¢ºå®š git 目錄的絕å°è·¯å¾‘"
-#. TRANSLATORS: you can adjust this to align "git add -i" status menu
-#: git-add--interactive.perl
-#, perl-format
-msgid "%12s %12s %s"
-msgstr "%12s %12s %s"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "touched %d path\n"
-msgid_plural "touched %d paths\n"
-msgstr[0] "建立了 %d 個路徑\n"
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for staging."
-msgstr "如果修補檔能乾淨地套用,編輯å€å¡Šå°‡ç«‹å³æ¨™è¨˜ç‚ºæš«å­˜ã€‚"
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for stashing."
-msgstr "如果修補檔能乾淨地套用,編輯å€å¡Šå°‡ç«‹å³æ¨™è¨˜ç‚ºå„²è—。"
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for unstaging."
-msgstr "如果修補檔能乾淨地套用,編輯å€å¡Šå°‡ç«‹å³æ¨™è¨˜ç‚ºæœªæš«å­˜ã€‚"
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for applying."
-msgstr "如果修補檔能乾淨地套用,編輯å€å¡Šå°‡ç«‹å³æ¨™è¨˜ç‚ºå¥—用。"
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for discarding."
-msgstr "如果修補檔能乾淨地套用,編輯塊將立å³æ¨™è¨˜ç‚ºæ¨æ£„。"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "failed to open hunk edit file for writing: %s"
-msgstr "為寫入開啟å€å¡Šç·¨è¼¯æª”案失敗:%s"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid ""
-"---\n"
-"To remove '%s' lines, make them ' ' lines (context).\n"
-"To remove '%s' lines, delete them.\n"
-"Lines starting with %s will be removed.\n"
-msgstr ""
-"---\n"
-"è¦åˆªé™¤ '%s' 開始的行,使其æˆç‚º ' ' 開始的行(上下文)。\n"
-"è¦åˆªé™¤ '%s' 開始的行,刪除它們。\n"
-"以 %s 開始的行將被刪除。\n"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "failed to open hunk edit file for reading: %s"
-msgstr "無法讀å–å€å¡Šç·¨è¼¯æª”案:%s"
-
-#: git-add--interactive.perl
-msgid ""
-"y - stage this hunk\n"
-"n - do not stage this hunk\n"
-"q - quit; do not stage this hunk or any of the remaining ones\n"
-"a - stage this hunk and all later hunks in the file\n"
-"d - do not stage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 暫存此å€å¡Š\n"
-"n - ä¸è¦æš«å­˜æ­¤å€å¡Š\n"
-"q - 離開。ä¸æš«å­˜æ­¤å€å¡ŠåŠå¾Œé¢çš„全部å€å¡Š\n"
-"a - 暫存此å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
-"d - ä¸æš«å­˜æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š"
-
-#: git-add--interactive.perl
-msgid ""
-"y - stash this hunk\n"
-"n - do not stash this hunk\n"
-"q - quit; do not stash this hunk or any of the remaining ones\n"
-"a - stash this hunk and all later hunks in the file\n"
-"d - do not stash this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 儲è—æ­¤å€å¡Š\n"
-"n - ä¸è¦å„²è—æ­¤å€å¡Š\n"
-"q - 離開。ä¸å„²è—æ­¤å€å¡ŠåŠå¾Œé¢çš„全部å€å¡Š\n"
-"a - 儲è—æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
-"d - ä¸å„²è—æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š"
-
-#: git-add--interactive.perl
-msgid ""
-"y - unstage this hunk\n"
-"n - do not unstage this hunk\n"
-"q - quit; do not unstage this hunk or any of the remaining ones\n"
-"a - unstage this hunk and all later hunks in the file\n"
-"d - do not unstage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - ä¸æš«å­˜æ­¤å€å¡Š\n"
-"n - ä¸è¦ä¸æš«å­˜æ­¤å€å¡Š\n"
-"q - 離開。ä¸è¦ä¸æš«å­˜æ­¤å€å¡ŠåŠå¾Œé¢çš„全部å€å¡Š\n"
-"a - ä¸æš«å­˜æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
-"d - ä¸è¦ä¸æš«å­˜æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š"
-
-#: git-add--interactive.perl
-msgid ""
-"y - apply this hunk to index\n"
-"n - do not apply this hunk to index\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 在索引中套用此å€å¡Š\n"
-"n - ä¸è¦åœ¨ç´¢å¼•ä¸­å¥—用此å€å¡Š\n"
-"q - 離開。ä¸è¦å¥—用此å€å¡ŠåŠå¾Œé¢çš„全部å€å¡Š\n"
-"a - 套用此å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
-"d - ä¸è¦å¥—用此å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š"
-
-#: git-add--interactive.perl
-msgid ""
-"y - discard this hunk from worktree\n"
-"n - do not discard this hunk from worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 在工作å€ä¸­æ¨æ£„æ­¤å€å¡Š\n"
-"n - ä¸è¦åœ¨å·¥ä½œå€ä¸­æ¨æ£„æ­¤å€å¡Š\n"
-"q - 離開。ä¸è¦æ¨æ£„æ­¤å€å¡ŠåŠå¾Œé¢çš„全部å€å¡Š\n"
-"a - æ¨æ£„æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
-"d - ä¸è¦æ¨æ£„æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š"
-
-#: git-add--interactive.perl
-msgid ""
-"y - discard this hunk from index and worktree\n"
-"n - do not discard this hunk from index and worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 在索引和工作å€ä¸­æ¨æ£„æ­¤å€å¡Š\n"
-"n - ä¸è¦åœ¨ç´¢å¼•å’Œå·¥ä½œå€ä¸­æ¨æ£„æ­¤å€å¡Š\n"
-"q - 離開。ä¸è¦æ¨æ£„æ­¤å€å¡ŠåŠå¾Œé¢çš„全部å€å¡Š\n"
-"a - æ¨æ£„æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
-"d - ä¸è¦æ¨æ£„æ­¤å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š"
-
-#: git-add--interactive.perl
-msgid ""
-"y - apply this hunk to index and worktree\n"
-"n - do not apply this hunk to index and worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 在索引和工作å€ä¸­å¥—用此å€å¡Š\n"
-"n - ä¸è¦åœ¨ç´¢å¼•å’Œå·¥ä½œå€ä¸­å¥—用此å€å¡Š\n"
-"q - 離開。ä¸è¦å¥—用此å€å¡ŠåŠå¾Œé¢çš„全部å€å¡Š\n"
-"a - 套用此å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
-"d - ä¸è¦å¥—用此å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š"
-
-#: git-add--interactive.perl
-msgid ""
-"y - apply this hunk to worktree\n"
-"n - do not apply this hunk to worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 在工作å€ä¸­å¥—用此å€å¡Š\n"
-"n - ä¸è¦åœ¨å·¥ä½œå€ä¸­å¥—用此å€å¡Š\n"
-"q - 離開。ä¸è¦å¥—用此å€å¡ŠåŠå¾Œé¢çš„全部å€å¡Š\n"
-"a - 套用此å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š\n"
-"d - ä¸è¦å¥—用此å€å¡Šå’Œæœ¬æª”案中後é¢çš„全部å€å¡Š"
-
-#: git-add--interactive.perl
-msgid ""
-"g - select a hunk to go to\n"
-"/ - search for a hunk matching the given regex\n"
-"j - leave this hunk undecided, see next undecided hunk\n"
-"J - leave this hunk undecided, see next hunk\n"
-"k - leave this hunk undecided, see previous undecided hunk\n"
-"K - leave this hunk undecided, see previous hunk\n"
-"s - split the current hunk into smaller hunks\n"
-"e - manually edit the current hunk\n"
-"? - print help\n"
-msgstr ""
-"g - é¸æ“‡è·³è½‰åˆ°ä¸€å€‹å€å¡Š\n"
-"/ - 尋找和æ供常è¦è¡¨ç¤ºå¼ç¬¦åˆçš„å€å¡Š\n"
-"j - 維æŒæ­¤å€å¡Šæœªæ±ºç‹€æ…‹ï¼Œæª¢è¦–下一個未決定å€å¡Š\n"
-"J - 維æŒæ­¤å€å¡Šæœªæ±ºç‹€æ…‹ï¼Œæª¢è¦–下一個å€å¡Š\n"
-"k - 維æŒæ­¤å€å¡Šæœªæ±ºç‹€æ…‹ï¼Œæª¢è¦–上一個未決定å€å¡Š\n"
-"K - 維æŒæ­¤å€å¡Šæœªæ±ºç‹€æ…‹ï¼Œæª¢è¦–上一個å€å¡Š\n"
-"s - 分割目å‰å€å¡Šç‚ºæ›´å°çš„å€å¡Š\n"
-"e - 手動編輯目å‰å€å¡Š\n"
-"? - 顯示說明\n"
-
-#: git-add--interactive.perl
-msgid "The selected hunks do not apply to the index!\n"
-msgstr "é¸å–å€å¡Šä¸èƒ½å¥—用到索引ï¼\n"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "ignoring unmerged: %s\n"
-msgstr "忽略未套用的:%s\n"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
-msgstr "將模å¼è®Šæ›´å¥—ç”¨åˆ°å·¥ä½œå€ [y,n,q,a,d%s,?]? "
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
-msgstr "å°‡åˆªé™¤è®Šæ›´å¥—ç”¨åˆ°å·¥ä½œå€ [y,n,q,a,d%s,?]? "
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
-msgstr "å°‡æ–°å¢žè®Šæ›´å¥—ç”¨åˆ°å·¥ä½œå€ [y,n,q,a,d%s,?]? "
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
-msgstr "將此å€å¡Šå¥—ç”¨åˆ°å·¥ä½œå€ [y,n,q,a,d%s,?]? "
-
-#: git-add--interactive.perl
-msgid "No other hunks to goto\n"
-msgstr "沒有其它å¯ä¾›è·³è½‰çš„å€å¡Š\n"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Invalid number: '%s'\n"
-msgstr "無效數字:'%s'\n"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Sorry, only %d hunk available.\n"
-msgid_plural "Sorry, only %d hunks available.\n"
-msgstr[0] "å°ä¸èµ·ï¼Œåªæœ‰ %d 個å¯ç”¨å€å¡Šã€‚\n"
-
-#: git-add--interactive.perl
-msgid "No other hunks to search\n"
-msgstr "沒有其它å¯ä¾›å°‹æ‰¾çš„å€å¡Š\n"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Malformed search regexp %s: %s\n"
-msgstr "錯誤的常è¦è¡¨ç¤ºå¼ %s:%s\n"
-
-#: git-add--interactive.perl
-msgid "No hunk matches the given pattern\n"
-msgstr "沒有和æ供模å¼ç›¸ç¬¦åˆçš„å€å¡Š\n"
-
-#: git-add--interactive.perl
-msgid "No previous hunk\n"
-msgstr "沒有上一個å€å¡Š\n"
-
-#: git-add--interactive.perl
-msgid "No next hunk\n"
-msgstr "沒有下一個å€å¡Š\n"
-
-#: git-add--interactive.perl
-msgid "Sorry, cannot split this hunk\n"
-msgstr "å°ä¸èµ·ï¼Œä¸èƒ½åˆ†å‰²é€™å€‹å€å¡Š\n"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "Split into %d hunk.\n"
-msgid_plural "Split into %d hunks.\n"
-msgstr[0] "分割為 %d 塊。\n"
-
-#: git-add--interactive.perl
-msgid "Sorry, cannot edit this hunk\n"
-msgstr "å°ä¸èµ·ï¼Œä¸èƒ½ç·¨è¼¯é€™å€‹å€å¡Š\n"
-
-#. TRANSLATORS: please do not translate the command names
-#. 'status', 'update', 'revert', etc.
-#: git-add--interactive.perl
-msgid ""
-"status - show paths with changes\n"
-"update - add working tree state to the staged set of changes\n"
-"revert - revert staged set of changes back to the HEAD version\n"
-"patch - pick hunks and update selectively\n"
-"diff - view diff between HEAD and index\n"
-"add untracked - add contents of untracked files to the staged set of "
-"changes\n"
-msgstr ""
-"status - 顯示å«è®Šæ›´çš„路徑\n"
-"update - 新增工作å€ç‹€æ…‹è‡³æš«å­˜åˆ—表\n"
-"revert - 還原修改的暫存集至 HEAD 版本\n"
-"patch - 挑é¸å€å¡Šä¸¦ä¸”有é¸æ“‡åœ°æ›´æ–°\n"
-"diff - 顯示 HEAD 和索引間差異\n"
-"add untracked - 新增未追蹤檔案的內容至暫存列表\n"
-
-#: git-add--interactive.perl
-msgid "missing --"
-msgstr "缺少 --"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "unknown --patch mode: %s"
-msgstr "未知的 --patch 模å¼ï¼š%s"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "invalid argument %s, expecting --"
-msgstr "無效的åƒæ•¸ %s,期望是 --"
-
#: git-send-email.perl
msgid "local zone differs from GMT by a non-minute interval\n"
msgstr "本機時間和 GMT 有ä¸åˆ°ä¸€åˆ†é˜é–“éš”\n"
@@ -26223,7 +27430,7 @@ msgstr "致命錯誤:命令「%sã€ä¸­æ­¢ï¼ŒçµæŸç¢¼ï¼š%d"
#: git-send-email.perl
msgid "the editor exited uncleanly, aborting everything"
-msgstr "編輯器éžæ­£å¸¸é›¢é–‹ï¼Œçµ‚止所有動作"
+msgstr "編輯器éžæ­£å¸¸é›¢é–‹ï¼Œä¸­æ­¢æ‰€æœ‰å‹•ä½œ"
#: git-send-email.perl
#, perl-format
@@ -26258,7 +27465,7 @@ msgstr "ä¸èƒ½åœ¨ç‰ˆæœ¬åº«ä¹‹å¤–執行 git format-patch\n"
msgid ""
"`batch-size` and `relogin` must be specified together (via command-line or "
"configuration option)\n"
-msgstr "`batch-size` å’Œ `relogin` å¿…é ˆåŒæ™‚定義(é€éŽæŒ‡ä»¤åˆ—或者設定é¸é …)\n"
+msgstr "`batch-size` å’Œ `relogin` å¿…é ˆåŒæ™‚定義(é€éŽå‘½ä»¤åˆ—或者設定é¸é …)\n"
#: git-send-email.perl
#, perl-format
@@ -26345,13 +27552,13 @@ msgstr ""
#: git-send-email.perl
#, perl-format
-msgid "Failed to open %s: %s"
-msgstr "無法開啟 %s: %s"
+msgid "Failed to open %s.final: %s"
+msgstr "無法開啟 %s.final: %s"
#: git-send-email.perl
#, perl-format
-msgid "Failed to open %s.final: %s"
-msgstr "無法開啟 %s.final: %s"
+msgid "Failed to open %s: %s"
+msgstr "無法開啟 %s: %s"
#: git-send-email.perl
msgid "Summary email is empty, skipping it\n"
@@ -26529,8 +27736,8 @@ msgstr "(%s) ä¸èƒ½åŸ·è¡Œ '%s'"
#: git-send-email.perl
#, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) 新增 %s: %s 自:'%s'\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) 從 “%s†讀到格å¼éŒ¯èª¤çš„輸出"
#: git-send-email.perl
#, perl-format
@@ -26538,6 +27745,11 @@ msgid "(%s) failed to close pipe to '%s'"
msgstr "(%s) 無法關閉管é“至 '%s'"
#: git-send-email.perl
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) 新增 %s: %s 自:'%s'\n"
+
+#: git-send-email.perl
msgid "cannot send message as 7bit"
msgstr "ä¸èƒ½ä»¥ 7bit å½¢å¼å‚³é€è¨Šæ¯"
@@ -26580,3 +27792,55 @@ msgstr "ç•¥éŽ %s å«å‚™ä»½å¾Œç¶´ '%s'。\n"
#, perl-format
msgid "Do you really want to send %s? [y|N]: "
msgstr "您真的è¦å‚³é€ %s?[y|N]: "
+
+#~ msgid "-x and -X cannot be used together"
+#~ msgstr "-x å’Œ -X ä¸èƒ½åŒæ™‚使用"
+
+#~ msgid ""
+#~ "--bundle-uri is incompatible with --depth, --shallow-since, and --shallow-"
+#~ "exclude"
+#~ msgstr ""
+#~ "--bundle-uri 與 --depthã€--shallow-since å’Œ --shallow-exclude ä¸ç›¸å®¹"
+
+#~ msgid "--merge-base is incompatible with --stdin"
+#~ msgstr "--merge-base 與 --stdin ä¸ç›¸å®¹"
+
+#~ msgid ""
+#~ "apply options are incompatible with rebase.autoSquash. Consider adding --"
+#~ "no-autosquash"
+#~ msgstr "apply é¸é …與 rebase.autoSquash ä¸ç›¸å®¹ã€‚請考慮加上 --no-autosquash"
+
+#~ msgid "--exclude-hidden cannot be used together with --branches"
+#~ msgstr "--exclude-hidden 無法與 --branches åŒæ™‚使用"
+
+#~ msgid "--exclude-hidden cannot be used together with --tags"
+#~ msgstr "--exclude-hidden 無法與 --tags åŒæ™‚使用"
+
+#~ msgid "--exclude-hidden cannot be used together with --remotes"
+#~ msgstr "--exclude-hidden 無法與 --remotes åŒæ™‚使用"
+
+#, c-format
+#~ msgid "only one of '%s', '%s' or '%s' can be given"
+#~ msgstr "åªèƒ½å‚³å…¥ “%sâ€ã€â€œ%s†或 “%sâ€"
+
+#, c-format
+#~ msgid "'%s' and '%s' cannot be used together"
+#~ msgstr "無法åŒæ™‚使用 “%s†和 “%sâ€"
+
+#, c-format
+#~ msgid "options '%s', and '%s' cannot be used together"
+#~ msgstr "無法åŒæ™‚使用 “%s†和 “%s†é¸é …"
+
+#~ msgid "<commit-ish>"
+#~ msgstr "<æ交指示元>"
+
+#, c-format
+#~ msgid "%s is incompatible with %s"
+#~ msgstr "%s 與 %s ä¸ç›¸å®¹"
+
+#, c-format
+#~ msgid "could not remove reference %s"
+#~ msgstr "無法刪除引用 %s"
+
+#~ msgid "unhandled options"
+#~ msgstr "未處ç†é¸é …"
diff --git a/ppc/sha1.c b/ppc/sha1.c
deleted file mode 100644
index 1b705ce..0000000
--- a/ppc/sha1.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * SHA-1 implementation.
- *
- * Copyright (C) 2005 Paul Mackerras <paulus@samba.org>
- *
- * This version assumes we are running on a big-endian machine.
- * It calls an external sha1_core() to process blocks of 64 bytes.
- */
-#include <stdio.h>
-#include <string.h>
-#include "sha1.h"
-
-void ppc_sha1_core(uint32_t *hash, const unsigned char *p,
- unsigned int nblocks);
-
-int ppc_SHA1_Init(ppc_SHA_CTX *c)
-{
- c->hash[0] = 0x67452301;
- c->hash[1] = 0xEFCDAB89;
- c->hash[2] = 0x98BADCFE;
- c->hash[3] = 0x10325476;
- c->hash[4] = 0xC3D2E1F0;
- c->len = 0;
- c->cnt = 0;
- return 0;
-}
-
-int ppc_SHA1_Update(ppc_SHA_CTX *c, const void *ptr, unsigned long n)
-{
- unsigned long nb;
- const unsigned char *p = ptr;
-
- c->len += (uint64_t) n << 3;
- while (n != 0) {
- if (c->cnt || n < 64) {
- nb = 64 - c->cnt;
- if (nb > n)
- nb = n;
- memcpy(&c->buf.b[c->cnt], p, nb);
- if ((c->cnt += nb) == 64) {
- ppc_sha1_core(c->hash, c->buf.b, 1);
- c->cnt = 0;
- }
- } else {
- nb = n >> 6;
- ppc_sha1_core(c->hash, p, nb);
- nb <<= 6;
- }
- n -= nb;
- p += nb;
- }
- return 0;
-}
-
-int ppc_SHA1_Final(unsigned char *hash, ppc_SHA_CTX *c)
-{
- unsigned int cnt = c->cnt;
-
- c->buf.b[cnt++] = 0x80;
- if (cnt > 56) {
- if (cnt < 64)
- memset(&c->buf.b[cnt], 0, 64 - cnt);
- ppc_sha1_core(c->hash, c->buf.b, 1);
- cnt = 0;
- }
- if (cnt < 56)
- memset(&c->buf.b[cnt], 0, 56 - cnt);
- c->buf.l[7] = c->len;
- ppc_sha1_core(c->hash, c->buf.b, 1);
- memcpy(hash, c->hash, 20);
- return 0;
-}
diff --git a/ppc/sha1.h b/ppc/sha1.h
deleted file mode 100644
index 9b24b32..0000000
--- a/ppc/sha1.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * SHA-1 implementation.
- *
- * Copyright (C) 2005 Paul Mackerras <paulus@samba.org>
- */
-#include <stdint.h>
-
-typedef struct {
- uint32_t hash[5];
- uint32_t cnt;
- uint64_t len;
- union {
- unsigned char b[64];
- uint64_t l[8];
- } buf;
-} ppc_SHA_CTX;
-
-int ppc_SHA1_Init(ppc_SHA_CTX *c);
-int ppc_SHA1_Update(ppc_SHA_CTX *c, const void *p, unsigned long n);
-int ppc_SHA1_Final(unsigned char *hash, ppc_SHA_CTX *c);
-
-#define platform_SHA_CTX ppc_SHA_CTX
-#define platform_SHA1_Init ppc_SHA1_Init
-#define platform_SHA1_Update ppc_SHA1_Update
-#define platform_SHA1_Final ppc_SHA1_Final
diff --git a/ppc/sha1ppc.S b/ppc/sha1ppc.S
deleted file mode 100644
index 1711eef..0000000
--- a/ppc/sha1ppc.S
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * SHA-1 implementation for PowerPC.
- *
- * Copyright (C) 2005 Paul Mackerras <paulus@samba.org>
- */
-
-/*
- * PowerPC calling convention:
- * %r0 - volatile temp
- * %r1 - stack pointer.
- * %r2 - reserved
- * %r3-%r12 - Incoming arguments & return values; volatile.
- * %r13-%r31 - Callee-save registers
- * %lr - Return address, volatile
- * %ctr - volatile
- *
- * Register usage in this routine:
- * %r0 - temp
- * %r3 - argument (pointer to 5 words of SHA state)
- * %r4 - argument (pointer to data to hash)
- * %r5 - Constant K in SHA round (initially number of blocks to hash)
- * %r6-%r10 - Working copies of SHA variables A..E (actually E..A order)
- * %r11-%r26 - Data being hashed W[].
- * %r27-%r31 - Previous copies of A..E, for final add back.
- * %ctr - loop count
- */
-
-
-/*
- * We roll the registers for A, B, C, D, E around on each
- * iteration; E on iteration t is D on iteration t+1, and so on.
- * We use registers 6 - 10 for this. (Registers 27 - 31 hold
- * the previous values.)
- */
-#define RA(t) (((t)+4)%5+6)
-#define RB(t) (((t)+3)%5+6)
-#define RC(t) (((t)+2)%5+6)
-#define RD(t) (((t)+1)%5+6)
-#define RE(t) (((t)+0)%5+6)
-
-/* We use registers 11 - 26 for the W values */
-#define W(t) ((t)%16+11)
-
-/* Register 5 is used for the constant k */
-
-/*
- * The basic SHA-1 round function is:
- * E += ROTL(A,5) + F(B,C,D) + W[i] + K; B = ROTL(B,30)
- * Then the variables are renamed: (A,B,C,D,E) = (E,A,B,C,D).
- *
- * Every 20 rounds, the function F() and the constant K changes:
- * - 20 rounds of f0(b,c,d) = "bit wise b ? c : d" = (^b & d) + (b & c)
- * - 20 rounds of f1(b,c,d) = b^c^d = (b^d)^c
- * - 20 rounds of f2(b,c,d) = majority(b,c,d) = (b&d) + ((b^d)&c)
- * - 20 more rounds of f1(b,c,d)
- *
- * These are all scheduled for near-optimal performance on a G4.
- * The G4 is a 3-issue out-of-order machine with 3 ALUs, but it can only
- * *consider* starting the oldest 3 instructions per cycle. So to get
- * maximum performance out of it, you have to treat it as an in-order
- * machine. Which means interleaving the computation round t with the
- * computation of W[t+4].
- *
- * The first 16 rounds use W values loaded directly from memory, while the
- * remaining 64 use values computed from those first 16. We preload
- * 4 values before starting, so there are three kinds of rounds:
- * - The first 12 (all f0) also load the W values from memory.
- * - The next 64 compute W(i+4) in parallel. 8*f0, 20*f1, 20*f2, 16*f1.
- * - The last 4 (all f1) do not do anything with W.
- *
- * Therefore, we have 6 different round functions:
- * STEPD0_LOAD(t,s) - Perform round t and load W(s). s < 16
- * STEPD0_UPDATE(t,s) - Perform round t and compute W(s). s >= 16.
- * STEPD1_UPDATE(t,s)
- * STEPD2_UPDATE(t,s)
- * STEPD1(t) - Perform round t with no load or update.
- *
- * The G5 is more fully out-of-order, and can find the parallelism
- * by itself. The big limit is that it has a 2-cycle ALU latency, so
- * even though it's 2-way, the code has to be scheduled as if it's
- * 4-way, which can be a limit. To help it, we try to schedule the
- * read of RA(t) as late as possible so it doesn't stall waiting for
- * the previous round's RE(t-1), and we try to rotate RB(t) as early
- * as possible while reading RC(t) (= RB(t-1)) as late as possible.
- */
-
-/* the initial loads. */
-#define LOADW(s) \
- lwz W(s),(s)*4(%r4)
-
-/*
- * Perform a step with F0, and load W(s). Uses W(s) as a temporary
- * before loading it.
- * This is actually 10 instructions, which is an awkward fit.
- * It can execute grouped as listed, or delayed one instruction.
- * (If delayed two instructions, there is a stall before the start of the
- * second line.) Thus, two iterations take 7 cycles, 3.5 cycles per round.
- */
-#define STEPD0_LOAD(t,s) \
-add RE(t),RE(t),W(t); andc %r0,RD(t),RB(t); and W(s),RC(t),RB(t); \
-add RE(t),RE(t),%r0; rotlwi %r0,RA(t),5; rotlwi RB(t),RB(t),30; \
-add RE(t),RE(t),W(s); add %r0,%r0,%r5; lwz W(s),(s)*4(%r4); \
-add RE(t),RE(t),%r0
-
-/*
- * This is likewise awkward, 13 instructions. However, it can also
- * execute starting with 2 out of 3 possible moduli, so it does 2 rounds
- * in 9 cycles, 4.5 cycles/round.
- */
-#define STEPD0_UPDATE(t,s,loadk...) \
-add RE(t),RE(t),W(t); andc %r0,RD(t),RB(t); xor W(s),W((s)-16),W((s)-3); \
-add RE(t),RE(t),%r0; and %r0,RC(t),RB(t); xor W(s),W(s),W((s)-8); \
-add RE(t),RE(t),%r0; rotlwi %r0,RA(t),5; xor W(s),W(s),W((s)-14); \
-add RE(t),RE(t),%r5; loadk; rotlwi RB(t),RB(t),30; rotlwi W(s),W(s),1; \
-add RE(t),RE(t),%r0
-
-/* Nicely optimal. Conveniently, also the most common. */
-#define STEPD1_UPDATE(t,s,loadk...) \
-add RE(t),RE(t),W(t); xor %r0,RD(t),RB(t); xor W(s),W((s)-16),W((s)-3); \
-add RE(t),RE(t),%r5; loadk; xor %r0,%r0,RC(t); xor W(s),W(s),W((s)-8); \
-add RE(t),RE(t),%r0; rotlwi %r0,RA(t),5; xor W(s),W(s),W((s)-14); \
-add RE(t),RE(t),%r0; rotlwi RB(t),RB(t),30; rotlwi W(s),W(s),1
-
-/*
- * The naked version, no UPDATE, for the last 4 rounds. 3 cycles per.
- * We could use W(s) as a temp register, but we don't need it.
- */
-#define STEPD1(t) \
- add RE(t),RE(t),W(t); xor %r0,RD(t),RB(t); \
-rotlwi RB(t),RB(t),30; add RE(t),RE(t),%r5; xor %r0,%r0,RC(t); \
-add RE(t),RE(t),%r0; rotlwi %r0,RA(t),5; /* spare slot */ \
-add RE(t),RE(t),%r0
-
-/*
- * 14 instructions, 5 cycles per. The majority function is a bit
- * awkward to compute. This can execute with a 1-instruction delay,
- * but it causes a 2-instruction delay, which triggers a stall.
- */
-#define STEPD2_UPDATE(t,s,loadk...) \
-add RE(t),RE(t),W(t); and %r0,RD(t),RB(t); xor W(s),W((s)-16),W((s)-3); \
-add RE(t),RE(t),%r0; xor %r0,RD(t),RB(t); xor W(s),W(s),W((s)-8); \
-add RE(t),RE(t),%r5; loadk; and %r0,%r0,RC(t); xor W(s),W(s),W((s)-14); \
-add RE(t),RE(t),%r0; rotlwi %r0,RA(t),5; rotlwi W(s),W(s),1; \
-add RE(t),RE(t),%r0; rotlwi RB(t),RB(t),30
-
-#define STEP0_LOAD4(t,s) \
- STEPD0_LOAD(t,s); \
- STEPD0_LOAD((t+1),(s)+1); \
- STEPD0_LOAD((t)+2,(s)+2); \
- STEPD0_LOAD((t)+3,(s)+3)
-
-#define STEPUP4(fn, t, s, loadk...) \
- STEP##fn##_UPDATE(t,s,); \
- STEP##fn##_UPDATE((t)+1,(s)+1,); \
- STEP##fn##_UPDATE((t)+2,(s)+2,); \
- STEP##fn##_UPDATE((t)+3,(s)+3,loadk)
-
-#define STEPUP20(fn, t, s, loadk...) \
- STEPUP4(fn, t, s,); \
- STEPUP4(fn, (t)+4, (s)+4,); \
- STEPUP4(fn, (t)+8, (s)+8,); \
- STEPUP4(fn, (t)+12, (s)+12,); \
- STEPUP4(fn, (t)+16, (s)+16, loadk)
-
- .globl ppc_sha1_core
-ppc_sha1_core:
- stwu %r1,-80(%r1)
- stmw %r13,4(%r1)
-
- /* Load up A - E */
- lmw %r27,0(%r3)
-
- mtctr %r5
-
-1:
- LOADW(0)
- lis %r5,0x5a82
- mr RE(0),%r31
- LOADW(1)
- mr RD(0),%r30
- mr RC(0),%r29
- LOADW(2)
- ori %r5,%r5,0x7999 /* K0-19 */
- mr RB(0),%r28
- LOADW(3)
- mr RA(0),%r27
-
- STEP0_LOAD4(0, 4)
- STEP0_LOAD4(4, 8)
- STEP0_LOAD4(8, 12)
- STEPUP4(D0, 12, 16,)
- STEPUP4(D0, 16, 20, lis %r5,0x6ed9)
-
- ori %r5,%r5,0xeba1 /* K20-39 */
- STEPUP20(D1, 20, 24, lis %r5,0x8f1b)
-
- ori %r5,%r5,0xbcdc /* K40-59 */
- STEPUP20(D2, 40, 44, lis %r5,0xca62)
-
- ori %r5,%r5,0xc1d6 /* K60-79 */
- STEPUP4(D1, 60, 64,)
- STEPUP4(D1, 64, 68,)
- STEPUP4(D1, 68, 72,)
- STEPUP4(D1, 72, 76,)
- addi %r4,%r4,64
- STEPD1(76)
- STEPD1(77)
- STEPD1(78)
- STEPD1(79)
-
- /* Add results to original values */
- add %r31,%r31,RE(0)
- add %r30,%r30,RD(0)
- add %r29,%r29,RC(0)
- add %r28,%r28,RB(0)
- add %r27,%r27,RA(0)
-
- bdnz 1b
-
- /* Save final hash, restore registers, and return */
- stmw %r27,0(%r3)
- lmw %r13,4(%r1)
- addi %r1,%r1,80
- blr
diff --git a/preload-index.c b/preload-index.c
index e5529a5..63fd35d 100644
--- a/preload-index.c
+++ b/preload-index.c
@@ -1,14 +1,20 @@
/*
* Copyright (C) 2008 Linus Torvalds
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "pathspec.h"
#include "dir.h"
+#include "environment.h"
#include "fsmonitor.h"
-#include "config.h"
+#include "gettext.h"
+#include "parse.h"
+#include "preload-index.h"
#include "progress.h"
+#include "read-cache.h"
#include "thread-utils.h"
#include "repository.h"
+#include "symlinks.h"
+#include "trace2.h"
/*
* Mostly randomly chosen maximum thread counts: we
@@ -151,6 +157,12 @@ void preload_index(struct index_state *index,
}
stop_progress(&pd.progress);
+ if (pathspec) {
+ /* earlier we made deep copies for each thread to work with */
+ for (i = 0; i < threads; i++)
+ clear_pathspec(&data[i].pathspec);
+ }
+
trace_performance_leave("preload index");
trace2_data_intmax("index", NULL, "preload/sum_lstat", t2_sum_lstat);
diff --git a/preload-index.h b/preload-index.h
new file mode 100644
index 0000000..251b1ed
--- /dev/null
+++ b/preload-index.h
@@ -0,0 +1,15 @@
+#ifndef PRELOAD_INDEX_H
+#define PRELOAD_INDEX_H
+
+struct index_state;
+struct pathspec;
+struct repository;
+
+void preload_index(struct index_state *index,
+ const struct pathspec *pathspec,
+ unsigned int refresh_flags);
+int repo_read_index_preload(struct repository *,
+ const struct pathspec *pathspec,
+ unsigned refresh_flags);
+
+#endif /* PRELOAD_INDEX_H */
diff --git a/pretty.c b/pretty.c
index ee6114e..7ead078 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1,8 +1,13 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "commit.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hash.h"
+#include "hex.h"
#include "utf8.h"
#include "diff.h"
+#include "pager.h"
#include "revision.h"
#include "string-list.h"
#include "mailmap.h"
@@ -13,6 +18,14 @@
#include "gpg-interface.h"
#include "trailer.h"
#include "run-command.h"
+#include "object-name.h"
+
+/*
+ * The limit for formatting directives, which enable the caller to append
+ * arbitrarily many bytes to the formatted buffer. This includes padding
+ * and wrapping formatters.
+ */
+#define FORMATTING_LIMIT (16 * 1024)
static char *user_format;
static struct cmt_fmt_map {
@@ -43,7 +56,9 @@ static void save_user_format(struct rev_info *rev, const char *cp, int is_tforma
rev->commit_format = CMIT_FMT_USERFORMAT;
}
-static int git_pretty_formats_config(const char *var, const char *value, void *cb)
+static int git_pretty_formats_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *cb UNUSED)
{
struct cmt_fmt_map *commit_format = NULL;
const char *name;
@@ -132,7 +147,7 @@ static struct cmt_fmt_map *find_commit_format_recursive(const char *sought,
for (i = 0; i < commit_formats_len; i++) {
size_t match_len;
- if (!starts_with(commit_formats[i].name, sought))
+ if (!istarts_with(commit_formats[i].name, sought))
continue;
match_len = strlen(commit_formats[i].name);
@@ -413,7 +428,7 @@ static void add_rfc2047(struct strbuf *sb, const char *line, size_t len,
}
const char *show_ident_date(const struct ident_split *ident,
- const struct date_mode *mode)
+ struct date_mode mode)
{
timestamp_t date = 0;
long tz = 0;
@@ -477,6 +492,16 @@ end:
}
}
+static int use_in_body_from(const struct pretty_print_context *pp,
+ const struct ident_split *ident)
+{
+ if (pp->rev && pp->rev->force_in_body_from)
+ return 1;
+ if (ident_cmp(pp->from_ident, ident))
+ return 1;
+ return 0;
+}
+
void pp_user_info(struct pretty_print_context *pp,
const char *what, struct strbuf *sb,
const char *line, const char *encoding)
@@ -503,7 +528,7 @@ void pp_user_info(struct pretty_print_context *pp,
map_user(pp->mailmap, &mailbuf, &maillen, &namebuf, &namelen);
if (cmit_fmt_is_mail(pp->fmt)) {
- if (pp->from_ident && ident_cmp(pp->from_ident, &ident)) {
+ if (pp->from_ident && use_in_body_from(pp, &ident)) {
struct strbuf buf = STRBUF_INIT;
strbuf_addstr(&buf, "From: ");
@@ -567,7 +592,7 @@ void pp_user_info(struct pretty_print_context *pp,
switch (pp->fmt) {
case CMIT_FMT_MEDIUM:
strbuf_addf(sb, "Date: %s\n",
- show_ident_date(&ident, &pp->date_mode));
+ show_ident_date(&ident, pp->date_mode));
break;
case CMIT_FMT_EMAIL:
case CMIT_FMT_MBOXRD:
@@ -576,7 +601,7 @@ void pp_user_info(struct pretty_print_context *pp,
break;
case CMIT_FMT_FULLER:
strbuf_addf(sb, "%sDate: %s\n", what,
- show_ident_date(&ident, &pp->date_mode));
+ show_ident_date(&ident, pp->date_mode));
break;
default:
/* notin' */
@@ -701,7 +726,7 @@ const char *repo_logmsg_reencode(struct repository *r,
* Otherwise, we still want to munge the encoding header in the
* result, which will be done by modifying the buffer. If we
* are using a fresh copy, we can reuse it. But if we are using
- * the cached copy from get_commit_buffer, we need to duplicate it
+ * the cached copy from repo_get_commit_buffer, we need to duplicate it
* to avoid munging the cached copy.
*/
if (msg == get_cached_commit_buffer(r, commit, NULL))
@@ -750,7 +775,7 @@ static int mailmap_name(const char **email, size_t *email_len,
static size_t format_person_part(struct strbuf *sb, char part,
const char *msg, int len,
- const struct date_mode *dmode)
+ struct date_mode dmode)
{
/* currently all placeholders have same length */
const int placeholder_len = 2;
@@ -983,7 +1008,9 @@ static void strbuf_wrap(struct strbuf *sb, size_t pos,
if (pos)
strbuf_add(&tmp, sb->buf, pos);
strbuf_add_wrapped_text(&tmp, sb->buf + pos,
- (int) indent1, (int) indent2, (int) width);
+ cast_size_t_to_int(indent1),
+ cast_size_t_to_int(indent2),
+ cast_size_t_to_int(width));
strbuf_swap(&tmp, sb);
strbuf_release(&tmp);
}
@@ -1007,7 +1034,7 @@ static void rewrap_message_tail(struct strbuf *sb,
static int format_reflog_person(struct strbuf *sb,
char part,
struct reflog_walk_info *log,
- const struct date_mode *dmode)
+ struct date_mode dmode)
{
const char *ident;
@@ -1109,9 +1136,18 @@ static size_t parse_padding_placeholder(const char *placeholder,
const char *end = start + strcspn(start, ",)");
char *next;
int width;
- if (!end || end == start)
+ if (!*end || end == start)
return 0;
width = strtol(start, &next, 10);
+
+ /*
+ * We need to limit the amount of padding, or otherwise this
+ * would allow the user to pad the buffer by arbitrarily many
+ * bytes and thus cause resource exhaustion.
+ */
+ if (width < -FORMATTING_LIMIT || width > FORMATTING_LIMIT)
+ return 0;
+
if (next == start || width == 0)
return 0;
if (width < 0) {
@@ -1216,6 +1252,27 @@ static int format_trailer_match_cb(const struct strbuf *key, void *ud)
return 0;
}
+static struct strbuf *expand_string_arg(struct strbuf *sb,
+ const char *argval, size_t arglen)
+{
+ char *fmt = xstrndup(argval, arglen);
+ const char *format = fmt;
+
+ strbuf_reset(sb);
+ while (strbuf_expand_step(sb, &format)) {
+ size_t len;
+
+ if (skip_prefix(format, "%", &format))
+ strbuf_addch(sb, '%');
+ else if ((len = strbuf_expand_literal(sb, format)))
+ format += len;
+ else
+ strbuf_addch(sb, '%');
+ }
+ free(fmt);
+ return sb;
+}
+
int format_set_trailers_options(struct process_trailer_options *opts,
struct string_list *filter_list,
struct strbuf *sepbuf,
@@ -1244,21 +1301,9 @@ int format_set_trailers_options(struct process_trailer_options *opts,
opts->filter_data = filter_list;
opts->only_trailers = 1;
} else if (match_placeholder_arg_value(*arg, "separator", arg, &argval, &arglen)) {
- char *fmt;
-
- strbuf_reset(sepbuf);
- fmt = xstrndup(argval, arglen);
- strbuf_expand(sepbuf, fmt, strbuf_expand_literal_cb, NULL);
- free(fmt);
- opts->separator = sepbuf;
+ opts->separator = expand_string_arg(sepbuf, argval, arglen);
} else if (match_placeholder_arg_value(*arg, "key_value_separator", arg, &argval, &arglen)) {
- char *fmt;
-
- strbuf_reset(kvsepbuf);
- fmt = xstrndup(argval, arglen);
- strbuf_expand(kvsepbuf, fmt, strbuf_expand_literal_cb, NULL);
- free(fmt);
- opts->key_value_separator = kvsepbuf;
+ opts->key_value_separator = expand_string_arg(kvsepbuf, argval, arglen);
} else if (!match_placeholder_bool_arg(*arg, "only", arg, &opts->only_trailers) &&
!match_placeholder_bool_arg(*arg, "unfold", arg, &opts->unfold) &&
!match_placeholder_bool_arg(*arg, "keyonly", arg, &opts->key_only) &&
@@ -1339,6 +1384,44 @@ static size_t parse_describe_args(const char *start, struct strvec *args)
return arg - start;
}
+
+static int parse_decoration_option(const char **arg,
+ const char *name,
+ char **opt)
+{
+ const char *argval;
+ size_t arglen;
+
+ if (match_placeholder_arg_value(*arg, name, arg, &argval, &arglen)) {
+ struct strbuf sb = STRBUF_INIT;
+
+ expand_string_arg(&sb, argval, arglen);
+ *opt = strbuf_detach(&sb, NULL);
+ return 1;
+ }
+ return 0;
+}
+
+static void parse_decoration_options(const char **arg,
+ struct decoration_options *opts)
+{
+ while (parse_decoration_option(arg, "prefix", &opts->prefix) ||
+ parse_decoration_option(arg, "suffix", &opts->suffix) ||
+ parse_decoration_option(arg, "separator", &opts->separator) ||
+ parse_decoration_option(arg, "pointer", &opts->pointer) ||
+ parse_decoration_option(arg, "tag", &opts->tag))
+ ;
+}
+
+static void free_decoration_options(const struct decoration_options *opts)
+{
+ free(opts->prefix);
+ free(opts->suffix);
+ free(opts->separator);
+ free(opts->pointer);
+ free(opts->tag);
+}
+
static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
const char *placeholder,
void *context)
@@ -1352,7 +1435,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
char **slot;
/* these are independent of the commit */
- res = strbuf_expand_literal_cb(sb, placeholder, NULL);
+ res = strbuf_expand_literal(sb, placeholder);
if (res)
return res;
@@ -1394,6 +1477,16 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
if (*next != ')')
return 0;
}
+
+ /*
+ * We need to limit the format here as it allows the
+ * user to prepend arbitrarily many bytes to the buffer
+ * when rewrapping.
+ */
+ if (width > FORMATTING_LIMIT ||
+ indent1 > FORMATTING_LIMIT ||
+ indent2 > FORMATTING_LIMIT)
+ return 0;
rewrap_message_tail(sb, c, width, indent1, indent2);
return end - placeholder + 1;
} else
@@ -1482,11 +1575,18 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
strbuf_addstr(sb, get_revision_mark(NULL, commit));
return 1;
case 'd':
- format_decorations(sb, commit, c->auto_color);
+ format_decorations(sb, commit, c->auto_color, NULL);
return 1;
case 'D':
- format_decorations_extended(sb, commit, c->auto_color, "", ", ", "");
- return 1;
+ {
+ const struct decoration_options opts = {
+ .prefix = "",
+ .suffix = ""
+ };
+
+ format_decorations(sb, commit, c->auto_color, &opts);
+ return 1;
+ }
case 'S': /* tag/branch like --source */
if (!(c->pretty_ctx->rev && c->pretty_ctx->rev->sources))
return 0;
@@ -1502,7 +1602,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
if (c->pretty_ctx->reflog_info)
get_reflog_selector(sb,
c->pretty_ctx->reflog_info,
- &c->pretty_ctx->date_mode,
+ c->pretty_ctx->date_mode,
c->pretty_ctx->date_mode_explicit,
(placeholder[1] == 'd'));
return 2;
@@ -1517,7 +1617,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
return format_reflog_person(sb,
placeholder[1],
c->pretty_ctx->reflog_info,
- &c->pretty_ctx->date_mode);
+ c->pretty_ctx->date_mode);
}
return 0; /* unknown %g placeholder */
case 'N':
@@ -1575,23 +1675,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
strbuf_addstr(sb, c->signature_check.primary_key_fingerprint);
break;
case 'T':
- switch (c->signature_check.trust_level) {
- case TRUST_UNDEFINED:
- strbuf_addstr(sb, "undefined");
- break;
- case TRUST_NEVER:
- strbuf_addstr(sb, "never");
- break;
- case TRUST_MARGINAL:
- strbuf_addstr(sb, "marginal");
- break;
- case TRUST_FULLY:
- strbuf_addstr(sb, "fully");
- break;
- case TRUST_ULTIMATE:
- strbuf_addstr(sb, "ultimate");
- break;
- }
+ strbuf_addstr(sb, gpg_trust_level_to_str(c->signature_check.trust_level));
break;
default:
return 0;
@@ -1599,6 +1683,23 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
return 2;
}
+ if (skip_prefix(placeholder, "(decorate", &arg)) {
+ struct decoration_options opts = { NULL };
+ size_t ret = 0;
+
+ if (*arg == ':') {
+ arg++;
+ parse_decoration_options(&arg, &opts);
+ }
+ if (*arg == ')') {
+ format_decorations(sb, commit, c->auto_color, &opts);
+ ret = arg - placeholder + 1;
+ }
+
+ free_decoration_options(&opts);
+ return ret;
+ }
+
/* For the rest we have to parse the commit header. */
if (!c->commit_header_parsed) {
msg = c->message =
@@ -1611,11 +1712,11 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
case 'a': /* author ... */
return format_person_part(sb, placeholder[1],
msg + c->author.off, c->author.len,
- &c->pretty_ctx->date_mode);
+ c->pretty_ctx->date_mode);
case 'c': /* committer ... */
return format_person_part(sb, placeholder[1],
msg + c->committer.off, c->committer.len,
- &c->pretty_ctx->date_mode);
+ c->pretty_ctx->date_mode);
case 'e': /* encoding */
if (c->commit_encoding)
strbuf_addstr(sb, c->commit_encoding);
@@ -1658,7 +1759,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
goto trailer_out;
}
if (*arg == ')') {
- format_trailers_from_commit(sb, msg + c->subject_off, &opts);
+ format_trailers_from_commit(&opts, msg + c->subject_off, sb);
ret = arg - placeholder + 1;
}
trailer_out:
@@ -1675,19 +1776,21 @@ static size_t format_and_pad_commit(struct strbuf *sb, /* in UTF-8 */
struct format_commit_context *c)
{
struct strbuf local_sb = STRBUF_INIT;
- int total_consumed = 0, len, padding = c->padding;
+ size_t total_consumed = 0;
+ int len, padding = c->padding;
+
if (padding < 0) {
const char *start = strrchr(sb->buf, '\n');
int occupied;
if (!start)
start = sb->buf;
- occupied = utf8_strnwidth(start, -1, 1);
+ occupied = utf8_strnwidth(start, strlen(start), 1);
occupied += c->pretty_ctx->graph_width;
padding = (-padding) - occupied;
}
while (1) {
int modifier = *placeholder == 'C';
- int consumed = format_commit_one(&local_sb, placeholder, c);
+ size_t consumed = format_commit_one(&local_sb, placeholder, c);
total_consumed += consumed;
if (!modifier)
@@ -1699,7 +1802,7 @@ static size_t format_and_pad_commit(struct strbuf *sb, /* in UTF-8 */
placeholder++;
total_consumed++;
}
- len = utf8_strnwidth(local_sb.buf, -1, 1);
+ len = utf8_strnwidth(local_sb.buf, local_sb.len, 1);
if (c->flush_type == flush_left_and_steal) {
const char *ch = sb->buf + sb->len - 1;
@@ -1714,7 +1817,7 @@ static size_t format_and_pad_commit(struct strbuf *sb, /* in UTF-8 */
if (*ch != 'm')
break;
p = ch - 1;
- while (ch - p < 10 && *p != '\033')
+ while (p > sb->buf && ch - p < 10 && *p != '\033')
p--;
if (*p != '\033' ||
ch + 1 - p != display_mode_esc_sequence_len(p))
@@ -1753,7 +1856,7 @@ static size_t format_and_pad_commit(struct strbuf *sb, /* in UTF-8 */
}
strbuf_addbuf(sb, &local_sb);
} else {
- int sb_len = sb->len, offset = 0;
+ size_t sb_len = sb->len, offset = 0;
if (c->flush_type == flush_left)
offset = padding - len;
else if (c->flush_type == flush_both)
@@ -1774,10 +1877,9 @@ static size_t format_and_pad_commit(struct strbuf *sb, /* in UTF-8 */
static size_t format_commit_item(struct strbuf *sb, /* in UTF-8 */
const char *placeholder,
- void *context)
+ struct format_commit_context *context)
{
- int consumed;
- size_t orig_len;
+ size_t consumed, orig_len;
enum {
NO_MAGIC,
ADD_LF_BEFORE_NON_EMPTY,
@@ -1798,14 +1900,26 @@ static size_t format_commit_item(struct strbuf *sb, /* in UTF-8 */
default:
break;
}
- if (magic != NO_MAGIC)
+ if (magic != NO_MAGIC) {
placeholder++;
+ switch (placeholder[0]) {
+ case 'w':
+ /*
+ * `%+w()` cannot ever expand to a non-empty string,
+ * and it potentially changes the layout of preceding
+ * contents. We're thus not able to handle the magic in
+ * this combination and refuse the pattern.
+ */
+ return 0;
+ };
+ }
+
orig_len = sb->len;
- if (((struct format_commit_context *)context)->flush_type != no_flush)
- consumed = format_and_pad_commit(sb, placeholder, context);
- else
+ if (context->flush_type == no_flush)
consumed = format_commit_one(sb, placeholder, context);
+ else
+ consumed = format_and_pad_commit(sb, placeholder, context);
if (magic == NO_MAGIC)
return consumed;
@@ -1821,40 +1935,38 @@ static size_t format_commit_item(struct strbuf *sb, /* in UTF-8 */
return consumed + 1;
}
-static size_t userformat_want_item(struct strbuf *sb, const char *placeholder,
- void *context)
-{
- struct userformat_want *w = context;
-
- if (*placeholder == '+' || *placeholder == '-' || *placeholder == ' ')
- placeholder++;
-
- switch (*placeholder) {
- case 'N':
- w->notes = 1;
- break;
- case 'S':
- w->source = 1;
- break;
- case 'd':
- case 'D':
- w->decorate = 1;
- break;
- }
- return 0;
-}
-
void userformat_find_requirements(const char *fmt, struct userformat_want *w)
{
- struct strbuf dummy = STRBUF_INIT;
-
if (!fmt) {
if (!user_format)
return;
fmt = user_format;
}
- strbuf_expand(&dummy, fmt, userformat_want_item, w);
- strbuf_release(&dummy);
+ while ((fmt = strchr(fmt, '%'))) {
+ fmt++;
+ if (skip_prefix(fmt, "%", &fmt))
+ continue;
+
+ if (*fmt == '+' || *fmt == '-' || *fmt == ' ')
+ fmt++;
+
+ switch (*fmt) {
+ case 'N':
+ w->notes = 1;
+ break;
+ case 'S':
+ w->source = 1;
+ break;
+ case 'd':
+ case 'D':
+ w->decorate = 1;
+ break;
+ case '(':
+ if (starts_with(fmt + 1, "decorate"))
+ w->decorate = 1;
+ break;
+ }
+ }
}
void repo_format_commit_message(struct repository *r,
@@ -1871,7 +1983,16 @@ void repo_format_commit_message(struct repository *r,
const char *output_enc = pretty_ctx->output_encoding;
const char *utf8 = "UTF-8";
- strbuf_expand(sb, format, format_commit_item, &context);
+ while (strbuf_expand_step(sb, &format)) {
+ size_t len;
+
+ if (skip_prefix(format, "%", &format))
+ strbuf_addch(sb, '%');
+ else if ((len = format_commit_item(sb, format, &context)))
+ format += len;
+ else
+ strbuf_addch(sb, '%');
+ }
rewrap_message_tail(sb, &context, 0, 0, 0);
/*
@@ -1956,11 +2077,11 @@ static void pp_header(struct pretty_print_context *pp,
}
}
-void pp_title_line(struct pretty_print_context *pp,
- const char **msg_p,
- struct strbuf *sb,
- const char *encoding,
- int need_8bit_cte)
+void pp_email_subject(struct pretty_print_context *pp,
+ const char **msg_p,
+ struct strbuf *sb,
+ const char *encoding,
+ int need_8bit_cte)
{
static const int max_length = 78; /* per rfc2047 */
struct strbuf title;
@@ -1970,19 +2091,14 @@ void pp_title_line(struct pretty_print_context *pp,
pp->preserve_subject ? "\n" : " ");
strbuf_grow(sb, title.len + 1024);
- if (pp->print_email_subject) {
- if (pp->rev)
- fmt_output_email_subject(sb, pp->rev);
- if (pp->encode_email_headers &&
- needs_rfc2047_encoding(title.buf, title.len))
- add_rfc2047(sb, title.buf, title.len,
- encoding, RFC2047_SUBJECT);
- else
- strbuf_add_wrapped_bytes(sb, title.buf, title.len,
+ fmt_output_email_subject(sb, pp->rev);
+ if (pp->encode_email_headers &&
+ needs_rfc2047_encoding(title.buf, title.len))
+ add_rfc2047(sb, title.buf, title.len,
+ encoding, RFC2047_SUBJECT);
+ else
+ strbuf_add_wrapped_bytes(sb, title.buf, title.len,
-last_line_length(sb), 1, max_length);
- } else {
- strbuf_addbuf(sb, &title);
- }
strbuf_addch(sb, '\n');
if (need_8bit_cte == 0) {
@@ -2005,9 +2121,8 @@ void pp_title_line(struct pretty_print_context *pp,
if (pp->after_subject) {
strbuf_addstr(sb, pp->after_subject);
}
- if (cmit_fmt_is_mail(pp->fmt)) {
- strbuf_addch(sb, '\n');
- }
+
+ strbuf_addch(sb, '\n');
if (pp->in_body_headers.nr) {
int i;
@@ -2163,12 +2278,14 @@ void pretty_print_commit(struct pretty_print_context *pp,
int need_8bit_cte = pp->need_8bit_cte;
if (pp->fmt == CMIT_FMT_USERFORMAT) {
- format_commit_message(commit, user_format, sb, pp);
+ repo_format_commit_message(the_repository, commit,
+ user_format, sb, pp);
return;
}
encoding = get_log_output_encoding();
- msg = reencoded = logmsg_reencode(commit, NULL, encoding);
+ msg = reencoded = repo_logmsg_reencode(the_repository, commit, NULL,
+ encoding);
if (pp->fmt == CMIT_FMT_ONELINE || cmit_fmt_is_mail(pp->fmt))
indent = 0;
@@ -2197,7 +2314,7 @@ void pretty_print_commit(struct pretty_print_context *pp,
}
pp_header(pp, encoding, commit, &msg, sb);
- if (pp->fmt != CMIT_FMT_ONELINE && !pp->print_email_subject) {
+ if (pp->fmt != CMIT_FMT_ONELINE && !cmit_fmt_is_mail(pp->fmt)) {
strbuf_addch(sb, '\n');
}
@@ -2205,8 +2322,11 @@ void pretty_print_commit(struct pretty_print_context *pp,
msg = skip_blank_lines(msg);
/* These formats treat the title line specially. */
- if (pp->fmt == CMIT_FMT_ONELINE || cmit_fmt_is_mail(pp->fmt))
- pp_title_line(pp, &msg, sb, encoding, need_8bit_cte);
+ if (pp->fmt == CMIT_FMT_ONELINE) {
+ msg = format_subject(sb, msg, " ");
+ strbuf_addch(sb, '\n');
+ } else if (cmit_fmt_is_mail(pp->fmt))
+ pp_email_subject(pp, &msg, sb, encoding, need_8bit_cte);
beginning_of_body = sb->len;
if (pp->fmt != CMIT_FMT_ONELINE)
@@ -2225,7 +2345,7 @@ void pretty_print_commit(struct pretty_print_context *pp,
if (cmit_fmt_is_mail(pp->fmt) && sb->len <= beginning_of_body)
strbuf_addch(sb, '\n');
- unuse_commit_buffer(commit, reencoded);
+ repo_unuse_commit_buffer(the_repository, commit, reencoded);
}
void pp_commit_easy(enum cmit_fmt fmt, const struct commit *commit,
diff --git a/pretty.h b/pretty.h
index f34e24c..df267af 100644
--- a/pretty.h
+++ b/pretty.h
@@ -1,11 +1,11 @@
#ifndef PRETTY_H
#define PRETTY_H
-#include "cache.h"
#include "date.h"
#include "string-list.h"
struct commit;
+struct repository;
struct strbuf;
struct process_trailer_options;
@@ -35,11 +35,10 @@ struct pretty_print_context {
*/
enum cmit_fmt fmt;
int abbrev;
- const char *after_subject;
+ char *after_subject;
int preserve_subject;
struct date_mode date_mode;
unsigned date_mode_explicit:1;
- int print_email_subject;
int expand_tabs_in_log;
int need_8bit_cte;
char *notes_message;
@@ -96,13 +95,13 @@ void pp_user_info(struct pretty_print_context *pp, const char *what,
const char *encoding);
/*
- * Format title line of commit message taken from "msg_p" and
+ * Format subject line of commit message taken from "msg_p" and
* put it into "sb".
* First line of "msg_p" is also affected.
*/
-void pp_title_line(struct pretty_print_context *pp, const char **msg_p,
- struct strbuf *sb, const char *encoding,
- int need_8bit_cte);
+void pp_email_subject(struct pretty_print_context *pp, const char **msg_p,
+ struct strbuf *sb, const char *encoding,
+ int need_8bit_cte);
/*
* Get current state of commit message from "msg_p" and continue formatting
@@ -120,10 +119,6 @@ void repo_format_commit_message(struct repository *r,
const struct commit *commit,
const char *format, struct strbuf *sb,
const struct pretty_print_context *context);
-#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
-#define format_commit_message(c, f, s, con) \
- repo_format_commit_message(the_repository, c, f, s, con)
-#endif
/*
* Parse given arguments from "arg", check it for correctness and
@@ -153,6 +148,8 @@ int commit_format_is_empty(enum cmit_fmt);
/* Make subject of commit message suitable for filename */
void format_sanitized_subject(struct strbuf *sb, const char *msg, size_t len);
+int has_non_ascii(const char *text);
+
/*
* Set values of fields in "struct process_trailer_options"
* according to trailers arguments.
@@ -170,7 +167,7 @@ int format_set_trailers_options(struct process_trailer_options *opts,
* a well-known sentinel date if they appear bogus.
*/
const char *show_ident_date(const struct ident_split *id,
- const struct date_mode *mode);
+ struct date_mode mode);
#endif /* PRETTY_H */
diff --git a/prio-queue.c b/prio-queue.c
index d31b48e..450775a 100644
--- a/prio-queue.c
+++ b/prio-queue.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "prio-queue.h"
static inline int compare(struct prio_queue *queue, int i, int j)
diff --git a/progress.c b/progress.c
index 0cdd875..c83cb60 100644
--- a/progress.c
+++ b/progress.c
@@ -9,13 +9,15 @@
*/
#define GIT_TEST_PROGRESS_ONLY
-#include "cache.h"
-#include "gettext.h"
+#include "git-compat-util.h"
+#include "pager.h"
#include "progress.h"
+#include "repository.h"
#include "strbuf.h"
#include "trace.h"
+#include "trace2.h"
#include "utf8.h"
-#include "config.h"
+#include "parse.h"
#define TP_IDX_MAX 8
@@ -59,7 +61,7 @@ void progress_test_force_update(void)
}
-static void progress_interval(int signum)
+static void progress_interval(int signum UNUSED)
{
progress_update = 1;
}
diff --git a/promisor-remote.c b/promisor-remote.c
index 5b33f88..ac3aa1e 100644
--- a/promisor-remote.c
+++ b/promisor-remote.c
@@ -1,9 +1,13 @@
-#include "cache.h"
-#include "object-store.h"
+#include "git-compat-util.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-store-ll.h"
#include "promisor-remote.h"
#include "config.h"
+#include "trace2.h"
#include "transport.h"
#include "strvec.h"
+#include "packfile.h"
struct promisor_remote_config {
struct promisor_remote *promisors;
@@ -96,7 +100,9 @@ static void promisor_remote_move_to_tail(struct promisor_remote_config *config,
config->promisors_tail = &r->next;
}
-static int promisor_remote_config(const char *var, const char *value, void *data)
+static int promisor_remote_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *data)
{
struct promisor_remote_config *config = data;
const char *name;
@@ -146,7 +152,7 @@ static void promisor_remote_init(struct repository *r)
if (r->promisor_remote_config)
return;
config = r->promisor_remote_config =
- xcalloc(sizeof(*r->promisor_remote_config), 1);
+ xcalloc(1, sizeof(*r->promisor_remote_config));
config->promisors_tail = &config->promisors;
repo_config(r, promisor_remote_config, config);
@@ -230,18 +236,18 @@ static int remove_fetched_oids(struct repository *repo,
return remaining_nr;
}
-int promisor_remote_get_direct(struct repository *repo,
- const struct object_id *oids,
- int oid_nr)
+void promisor_remote_get_direct(struct repository *repo,
+ const struct object_id *oids,
+ int oid_nr)
{
struct promisor_remote *r;
struct object_id *remaining_oids = (struct object_id *)oids;
int remaining_nr = oid_nr;
int to_free = 0;
- int res = -1;
+ int i;
if (oid_nr == 0)
- return 0;
+ return;
promisor_remote_init(repo);
@@ -256,12 +262,16 @@ int promisor_remote_get_direct(struct repository *repo,
continue;
}
}
- res = 0;
- break;
+ goto all_fetched;
}
+ for (i = 0; i < remaining_nr; i++) {
+ if (is_promisor_object(&remaining_oids[i]))
+ die(_("could not fetch %s from promisor remote"),
+ oid_to_hex(&remaining_oids[i]));
+ }
+
+all_fetched:
if (to_free)
free(remaining_oids);
-
- return res;
}
diff --git a/promisor-remote.h b/promisor-remote.h
index edc45ab..2cb9eda 100644
--- a/promisor-remote.h
+++ b/promisor-remote.h
@@ -18,34 +18,18 @@ struct promisor_remote {
};
void repo_promisor_remote_reinit(struct repository *r);
-static inline void promisor_remote_reinit(void)
-{
- repo_promisor_remote_reinit(the_repository);
-}
-
void promisor_remote_clear(struct promisor_remote_config *config);
-
struct promisor_remote *repo_promisor_remote_find(struct repository *r, const char *remote_name);
-static inline struct promisor_remote *promisor_remote_find(const char *remote_name)
-{
- return repo_promisor_remote_find(the_repository, remote_name);
-}
-
int repo_has_promisor_remote(struct repository *r);
-static inline int has_promisor_remote(void)
-{
- return repo_has_promisor_remote(the_repository);
-}
/*
* Fetches all requested objects from all promisor remotes, trying them one at
- * a time until all objects are fetched. Returns 0 upon success, and non-zero
- * otherwise.
+ * a time until all objects are fetched.
*
- * If oid_nr is 0, this function returns 0 (success) immediately.
+ * If oid_nr is 0, this function returns immediately.
*/
-int promisor_remote_get_direct(struct repository *repo,
- const struct object_id *oids,
- int oid_nr);
+void promisor_remote_get_direct(struct repository *repo,
+ const struct object_id *oids,
+ int oid_nr);
#endif /* PROMISOR_REMOTE_H */
diff --git a/prompt.c b/prompt.c
index 50df172..8935fe4 100644
--- a/prompt.c
+++ b/prompt.c
@@ -1,5 +1,6 @@
-#include "cache.h"
-#include "config.h"
+#include "git-compat-util.h"
+#include "parse.h"
+#include "environment.h"
#include "run-command.h"
#include "strbuf.h"
#include "prompt.h"
diff --git a/protocol-caps.c b/protocol-caps.c
index bbde918..75f4cbb 100644
--- a/protocol-caps.c
+++ b/protocol-caps.c
@@ -1,11 +1,12 @@
#include "git-compat-util.h"
#include "protocol-caps.h"
#include "gettext.h"
+#include "hex.h"
#include "pkt-line.h"
-#include "strvec.h"
-#include "hash.h"
+#include "hash-ll.h"
+#include "hex.h"
#include "object.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "string-list.h"
#include "strbuf.h"
@@ -77,7 +78,7 @@ static void send_info(struct repository *r, struct packet_writer *writer,
int cap_object_info(struct repository *r, struct packet_reader *request)
{
- struct requested_info info;
+ struct requested_info info = { 0 };
struct packet_writer writer;
struct string_list oid_str_list = STRING_LIST_INIT_DUP;
diff --git a/protocol.c b/protocol.c
index c53f7df..079ba75 100644
--- a/protocol.c
+++ b/protocol.c
@@ -1,6 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "environment.h"
#include "protocol.h"
+#include "trace2.h"
static enum protocol_version parse_protocol_version(const char *value)
{
diff --git a/protocol.h b/protocol.h
index cef1a4a..1e574bb 100644
--- a/protocol.h
+++ b/protocol.h
@@ -1,6 +1,27 @@
#ifndef PROTOCOL_H
#define PROTOCOL_H
+/*
+ * Intensive research over the course of many years has shown that
+ * port 9418 is totally unused by anything else. Or
+ *
+ * Your search - "port 9418" - did not match any documents.
+ *
+ * as www.google.com puts it.
+ *
+ * This port has been properly assigned for git use by IANA:
+ * git (Assigned-9418) [I06-050728-0001].
+ *
+ * git 9418/tcp git pack transfer service
+ * git 9418/udp git pack transfer service
+ *
+ * with Linus Torvalds <torvalds@osdl.org> as the point of
+ * contact. September 2005.
+ *
+ * See https://www.iana.org/assignments/port-numbers
+ */
+#define DEFAULT_GIT_PORT 9418
+
enum protocol_version {
protocol_unknown_version = -1,
protocol_v0 = 0,
diff --git a/prune-packed.c b/prune-packed.c
index 261520b..e54daf7 100644
--- a/prune-packed.c
+++ b/prune-packed.c
@@ -1,4 +1,7 @@
-#include "object-store.h"
+#include "git-compat-util.h"
+#include "environment.h"
+#include "gettext.h"
+#include "object-store-ll.h"
#include "packfile.h"
#include "progress.h"
#include "prune-packed.h"
diff --git a/quote.c b/quote.c
index 26719d2..3c05194 100644
--- a/quote.c
+++ b/quote.c
@@ -1,5 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "path.h"
#include "quote.h"
+#include "strbuf.h"
#include "strvec.h"
int quote_path_fully = 1;
diff --git a/quote.h b/quote.h
index 87ff458..0300c29 100644
--- a/quote.h
+++ b/quote.h
@@ -3,6 +3,8 @@
struct strbuf;
+extern int quote_path_fully;
+
/* Help to copy the thing properly quoted for the shell safety.
* any single quote is replaced with '\'', any exclamation point
* is replaced with '\!', and the whole thing is enclosed in a
diff --git a/range-diff.c b/range-diff.c
index f63b3ff..c45b6d8 100644
--- a/range-diff.c
+++ b/range-diff.c
@@ -1,5 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "environment.h"
+#include "gettext.h"
#include "range-diff.h"
+#include "object-name.h"
#include "string-list.h"
#include "run-command.h"
#include "strvec.h"
@@ -8,7 +11,9 @@
#include "linear-assignment.h"
#include "diffcore.h"
#include "commit.h"
+#include "pager.h"
#include "pretty.h"
+#include "repository.h"
#include "userdiff.h"
#include "apply.h"
#include "revision.h"
@@ -55,11 +60,11 @@ static int read_patches(const char *range, struct string_list *list,
"--output-indicator-context=#",
"--no-abbrev-commit",
"--pretty=medium",
- "--notes",
+ "--show-notes-by-default",
NULL);
+ strvec_push(&cp.args, range);
if (other_arg)
strvec_pushv(&cp.args, other_arg->v);
- strvec_push(&cp.args, range);
cp.out = -1;
cp.no_stdin = 1;
cp.git_cmd = 1;
@@ -94,7 +99,7 @@ static int read_patches(const char *range, struct string_list *list,
strbuf_reset(&buf);
}
CALLOC_ARRAY(util, 1);
- if (get_oid(p, &util->oid)) {
+ if (repo_get_oid(the_repository, p, &util->oid)) {
error(_("could not parse commit '%s'"), p);
FREE_AND_NULL(util);
string_list_clear(list, 1);
@@ -224,15 +229,20 @@ cleanup:
return ret;
}
-static int patch_util_cmp(const void *dummy, const struct patch_util *a,
- const struct patch_util *b, const char *keydata)
+static int patch_util_cmp(const void *cmp_data UNUSED,
+ const struct hashmap_entry *ha,
+ const struct hashmap_entry *hb,
+ const void *keydata)
{
+ const struct patch_util
+ *a = container_of(ha, const struct patch_util, e),
+ *b = container_of(hb, const struct patch_util, e);
return strcmp(a->diff, keydata ? keydata : b->diff);
}
static void find_exact_matches(struct string_list *a, struct string_list *b)
{
- struct hashmap map = HASHMAP_INIT((hashmap_cmp_fn)patch_util_cmp, NULL);
+ struct hashmap map = HASHMAP_INIT(patch_util_cmp, NULL);
int i;
/* First, add the patches of a to a hash map */
@@ -267,14 +277,18 @@ static void find_exact_matches(struct string_list *a, struct string_list *b)
hashmap_clear(&map);
}
-static int diffsize_consume(void *data, char *line, unsigned long len)
+static int diffsize_consume(void *data,
+ char *line UNUSED,
+ unsigned long len UNUSED)
{
(*(int *)data)++;
return 0;
}
-static void diffsize_hunk(void *data, long ob, long on, long nb, long nn,
- const char *funcline, long funclen)
+static void diffsize_hunk(void *data,
+ long ob UNUSED, long on UNUSED,
+ long nb UNUSED, long nn UNUSED,
+ const char *func UNUSED, long funclen UNUSED)
{
diffsize_consume(data, NULL, 0);
}
@@ -377,11 +391,14 @@ static void output_pair_header(struct diff_options *diffopt,
const char *color_new = diff_get_color_opt(diffopt, DIFF_FILE_NEW);
const char *color_commit = diff_get_color_opt(diffopt, DIFF_COMMIT);
const char *color;
+ int abbrev = diffopt->abbrev;
+
+ if (abbrev < 0)
+ abbrev = DEFAULT_ABBREV;
if (!dashes->len)
strbuf_addchars(dashes, '-',
- strlen(find_unique_abbrev(oid,
- DEFAULT_ABBREV)));
+ strlen(repo_find_unique_abbrev(the_repository, oid, abbrev)));
if (!b_util) {
color = color_old;
@@ -403,7 +420,7 @@ static void output_pair_header(struct diff_options *diffopt,
strbuf_addf(buf, "%*s: %s ", patch_no_width, "-", dashes->buf);
else
strbuf_addf(buf, "%*d: %s ", patch_no_width, a_util->i + 1,
- find_unique_abbrev(&a_util->oid, DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, &a_util->oid, abbrev));
if (status == '!')
strbuf_addf(buf, "%s%s", color_reset, color);
@@ -415,7 +432,7 @@ static void output_pair_header(struct diff_options *diffopt,
strbuf_addf(buf, " %*s: %s", patch_no_width, "-", dashes->buf);
else
strbuf_addf(buf, " %*d: %s", patch_no_width, b_util->i + 1,
- find_unique_abbrev(&b_util->oid, DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, &b_util->oid, abbrev));
commit = lookup_commit_reference(the_repository, oid);
if (commit) {
@@ -459,7 +476,7 @@ static void patch_diff(const char *a, const char *b,
diff_flush(diffopt);
}
-static struct strbuf *output_prefix_cb(struct diff_options *opt, void *data)
+static struct strbuf *output_prefix_cb(struct diff_options *opt UNUSED, void *data)
{
return data;
}
@@ -476,7 +493,7 @@ static void output(struct string_list *a, struct string_list *b,
if (range_diff_opts->diffopt)
memcpy(&opts, range_diff_opts->diffopt, sizeof(opts));
else
- diff_setup(&opts);
+ repo_diff_setup(the_repository, &opts);
opts.no_free = 1;
if (!opts.output_format)
@@ -579,7 +596,7 @@ int is_range_diff_range(const char *arg)
int i, positive = 0, negative = 0;
struct rev_info revs;
- init_revisions(&revs, NULL);
+ repo_init_revisions(the_repository, &revs, NULL);
if (setup_revisions(3, argv, &revs, NULL) == 1) {
for (i = 0; i < revs.pending.nr; i++)
if (revs.pending.objects[i].item->flags & UNINTERESTING)
diff --git a/reachable.c b/reachable.c
index aba63eb..3b85add 100644
--- a/reachable.c
+++ b/reachable.c
@@ -1,6 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "gettext.h"
+#include "hex.h"
#include "refs.h"
-#include "tag.h"
#include "commit.h"
#include "blob.h"
#include "diff.h"
@@ -11,9 +12,12 @@
#include "list-objects.h"
#include "packfile.h"
#include "worktree.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "pack-bitmap.h"
#include "pack-mtimes.h"
+#include "config.h"
+#include "run-command.h"
+#include "sequencer.h"
struct connectivity_progress {
struct progress *progress;
@@ -27,6 +31,52 @@ static void update_progress(struct connectivity_progress *cp)
display_progress(cp->progress, cp->count);
}
+static void add_one_file(const char *path, struct rev_info *revs)
+{
+ struct strbuf buf = STRBUF_INIT;
+ struct object_id oid;
+ struct object *object;
+
+ if (!read_oneliner(&buf, path, READ_ONELINER_SKIP_IF_EMPTY)) {
+ strbuf_release(&buf);
+ return;
+ }
+ strbuf_trim(&buf);
+ if (!get_oid_hex(buf.buf, &oid)) {
+ object = parse_object_or_die(&oid, buf.buf);
+ add_pending_object(revs, object, "");
+ }
+ strbuf_release(&buf);
+}
+
+/* Mark objects recorded in rebase state files as reachable. */
+static void add_rebase_files(struct rev_info *revs)
+{
+ struct strbuf buf = STRBUF_INIT;
+ size_t len;
+ const char *path[] = {
+ "rebase-apply/autostash",
+ "rebase-apply/orig-head",
+ "rebase-merge/autostash",
+ "rebase-merge/orig-head",
+ };
+ struct worktree **worktrees = get_worktrees();
+
+ for (struct worktree **wt = worktrees; *wt; wt++) {
+ strbuf_reset(&buf);
+ strbuf_addstr(&buf, get_worktree_git_dir(*wt));
+ strbuf_complete(&buf, '/');
+ len = buf.len;
+ for (size_t i = 0; i < ARRAY_SIZE(path); i++) {
+ strbuf_setlen(&buf, len);
+ strbuf_addstr(&buf, path[i]);
+ add_one_file(buf.buf, revs);
+ }
+ }
+ strbuf_release(&buf);
+ free_worktrees(worktrees);
+}
+
static int add_one_ref(const char *path, const struct object_id *oid,
int flag, void *cb_data)
{
@@ -48,7 +98,9 @@ static int add_one_ref(const char *path, const struct object_id *oid,
* The traversal will have already marked us as SEEN, so we
* only need to handle any progress reporting here.
*/
-static void mark_object(struct object *obj, const char *name, void *data)
+static void mark_object(struct object *obj UNUSED,
+ const char *name UNUSED,
+ void *data)
{
update_progress(data);
}
@@ -63,8 +115,77 @@ struct recent_data {
timestamp_t timestamp;
report_recent_object_fn *cb;
int ignore_in_core_kept_packs;
+
+ struct oidset extra_recent_oids;
+ int extra_recent_oids_loaded;
};
+static int run_one_gc_recent_objects_hook(struct oidset *set,
+ const char *args)
+{
+ struct child_process cmd = CHILD_PROCESS_INIT;
+ struct strbuf buf = STRBUF_INIT;
+ FILE *out;
+ int ret = 0;
+
+ cmd.use_shell = 1;
+ cmd.out = -1;
+
+ strvec_push(&cmd.args, args);
+
+ if (start_command(&cmd))
+ return -1;
+
+ out = xfdopen(cmd.out, "r");
+ while (strbuf_getline(&buf, out) != EOF) {
+ struct object_id oid;
+ const char *rest;
+
+ if (parse_oid_hex(buf.buf, &oid, &rest) || *rest) {
+ ret = error(_("invalid extra cruft tip: '%s'"), buf.buf);
+ break;
+ }
+
+ oidset_insert(set, &oid);
+ }
+
+ fclose(out);
+ ret |= finish_command(&cmd);
+
+ strbuf_release(&buf);
+ return ret;
+}
+
+static void load_gc_recent_objects(struct recent_data *data)
+{
+ const struct string_list *programs;
+ int ret = 0;
+ size_t i;
+
+ data->extra_recent_oids_loaded = 1;
+
+ if (git_config_get_string_multi("gc.recentobjectshook", &programs))
+ return;
+
+ for (i = 0; i < programs->nr; i++) {
+ ret = run_one_gc_recent_objects_hook(&data->extra_recent_oids,
+ programs->items[i].string);
+ if (ret)
+ die(_("unable to enumerate additional recent objects"));
+ }
+}
+
+static int obj_is_recent(const struct object_id *oid, timestamp_t mtime,
+ struct recent_data *data)
+{
+ if (mtime > data->timestamp)
+ return 1;
+
+ if (!data->extra_recent_oids_loaded)
+ load_gc_recent_objects(data);
+ return oidset_contains(&data->extra_recent_oids, oid);
+}
+
static void add_recent_object(const struct object_id *oid,
struct packed_git *pack,
off_t offset,
@@ -74,7 +195,7 @@ static void add_recent_object(const struct object_id *oid,
struct object *obj;
enum object_type type;
- if (mtime <= data->timestamp)
+ if (!obj_is_recent(oid, mtime, data))
return;
/*
@@ -152,7 +273,8 @@ static int add_recent_loose(const struct object_id *oid,
}
static int add_recent_packed(const struct object_id *oid,
- struct packed_git *p, uint32_t pos,
+ struct packed_git *p,
+ uint32_t pos,
void *data)
{
struct object *obj;
@@ -188,24 +310,32 @@ int add_unseen_recent_objects_to_traversal(struct rev_info *revs,
data.cb = cb;
data.ignore_in_core_kept_packs = ignore_in_core_kept_packs;
+ oidset_init(&data.extra_recent_oids, 0);
+ data.extra_recent_oids_loaded = 0;
+
r = for_each_loose_object(add_recent_loose, &data,
FOR_EACH_OBJECT_LOCAL_ONLY);
if (r)
- return r;
+ goto done;
flags = FOR_EACH_OBJECT_LOCAL_ONLY | FOR_EACH_OBJECT_PACK_ORDER;
if (ignore_in_core_kept_packs)
flags |= FOR_EACH_OBJECT_SKIP_IN_CORE_KEPT_PACKS;
- return for_each_packed_object(add_recent_packed, &data, flags);
+ r = for_each_packed_object(add_recent_packed, &data, flags);
+
+done:
+ oidset_clear(&data.extra_recent_oids);
+
+ return r;
}
static int mark_object_seen(const struct object_id *oid,
enum object_type type,
- int exclude,
- uint32_t name_hash,
- struct packed_git *found_pack,
- off_t found_offset)
+ int exclude UNUSED,
+ uint32_t name_hash UNUSED,
+ struct packed_git *found_pack UNUSED,
+ off_t found_offset UNUSED)
{
struct object *obj = lookup_object_by_type(the_repository, oid, type);
if (!obj)
@@ -239,6 +369,9 @@ void mark_reachable_objects(struct rev_info *revs, int mark_reflog,
head_ref(add_one_ref, revs);
other_head_refs(add_one_ref, revs);
+ /* rebase autostash and orig-head */
+ add_rebase_files(revs);
+
/* Add all reflog info */
if (mark_reflog)
add_reflogs_to_pending(revs, 0);
diff --git a/read-cache-ll.h b/read-cache-ll.h
new file mode 100644
index 0000000..09414af
--- /dev/null
+++ b/read-cache-ll.h
@@ -0,0 +1,489 @@
+#ifndef READ_CACHE_LL_H
+#define READ_CACHE_LL_H
+
+#include "hash-ll.h"
+#include "hashmap.h"
+#include "statinfo.h"
+
+/*
+ * Basic data structures for the directory cache
+ */
+
+#define CACHE_SIGNATURE 0x44495243 /* "DIRC" */
+struct cache_header {
+ uint32_t hdr_signature;
+ uint32_t hdr_version;
+ uint32_t hdr_entries;
+};
+
+#define INDEX_FORMAT_LB 2
+#define INDEX_FORMAT_UB 4
+
+struct cache_entry {
+ struct hashmap_entry ent;
+ struct stat_data ce_stat_data;
+ unsigned int ce_mode;
+ unsigned int ce_flags;
+ unsigned int mem_pool_allocated;
+ unsigned int ce_namelen;
+ unsigned int index; /* for link extension */
+ struct object_id oid;
+ char name[FLEX_ARRAY]; /* more */
+};
+
+#define CE_STAGEMASK (0x3000)
+#define CE_EXTENDED (0x4000)
+#define CE_VALID (0x8000)
+#define CE_STAGESHIFT 12
+
+/*
+ * Range 0xFFFF0FFF in ce_flags is divided into
+ * two parts: in-memory flags and on-disk ones.
+ * Flags in CE_EXTENDED_FLAGS will get saved on-disk
+ * if you want to save a new flag, add it in
+ * CE_EXTENDED_FLAGS
+ *
+ * In-memory only flags
+ */
+#define CE_UPDATE (1 << 16)
+#define CE_REMOVE (1 << 17)
+#define CE_UPTODATE (1 << 18)
+#define CE_ADDED (1 << 19)
+
+#define CE_HASHED (1 << 20)
+#define CE_FSMONITOR_VALID (1 << 21)
+#define CE_WT_REMOVE (1 << 22) /* remove in work directory */
+#define CE_CONFLICTED (1 << 23)
+
+#define CE_UNPACKED (1 << 24)
+#define CE_NEW_SKIP_WORKTREE (1 << 25)
+
+/* used to temporarily mark paths matched by pathspecs */
+#define CE_MATCHED (1 << 26)
+
+#define CE_UPDATE_IN_BASE (1 << 27)
+#define CE_STRIP_NAME (1 << 28)
+
+/*
+ * Extended on-disk flags
+ */
+#define CE_INTENT_TO_ADD (1 << 29)
+#define CE_SKIP_WORKTREE (1 << 30)
+/* CE_EXTENDED2 is for future extension */
+#define CE_EXTENDED2 (1U << 31)
+
+#define CE_EXTENDED_FLAGS (CE_INTENT_TO_ADD | CE_SKIP_WORKTREE)
+
+/*
+ * Safeguard to avoid saving wrong flags:
+ * - CE_EXTENDED2 won't get saved until its semantic is known
+ * - Bits in 0x0000FFFF have been saved in ce_flags already
+ * - Bits in 0x003F0000 are currently in-memory flags
+ */
+#if CE_EXTENDED_FLAGS & 0x803FFFFF
+#error "CE_EXTENDED_FLAGS out of range"
+#endif
+
+/* Forward structure decls */
+struct pathspec;
+struct tree;
+
+/*
+ * Copy the sha1 and stat state of a cache entry from one to
+ * another. But we never change the name, or the hash state!
+ */
+static inline void copy_cache_entry(struct cache_entry *dst,
+ const struct cache_entry *src)
+{
+ unsigned int state = dst->ce_flags & CE_HASHED;
+ int mem_pool_allocated = dst->mem_pool_allocated;
+
+ /* Don't copy hash chain and name */
+ memcpy(&dst->ce_stat_data, &src->ce_stat_data,
+ offsetof(struct cache_entry, name) -
+ offsetof(struct cache_entry, ce_stat_data));
+
+ /* Restore the hash state */
+ dst->ce_flags = (dst->ce_flags & ~CE_HASHED) | state;
+
+ /* Restore the mem_pool_allocated flag */
+ dst->mem_pool_allocated = mem_pool_allocated;
+}
+
+static inline unsigned create_ce_flags(unsigned stage)
+{
+ return (stage << CE_STAGESHIFT);
+}
+
+#define ce_namelen(ce) ((ce)->ce_namelen)
+#define ce_size(ce) cache_entry_size(ce_namelen(ce))
+#define ce_stage(ce) ((CE_STAGEMASK & (ce)->ce_flags) >> CE_STAGESHIFT)
+#define ce_uptodate(ce) ((ce)->ce_flags & CE_UPTODATE)
+#define ce_skip_worktree(ce) ((ce)->ce_flags & CE_SKIP_WORKTREE)
+#define ce_mark_uptodate(ce) ((ce)->ce_flags |= CE_UPTODATE)
+#define ce_intent_to_add(ce) ((ce)->ce_flags & CE_INTENT_TO_ADD)
+
+#define cache_entry_size(len) (offsetof(struct cache_entry,name) + (len) + 1)
+
+#define SOMETHING_CHANGED (1 << 0) /* unclassified changes go here */
+#define CE_ENTRY_CHANGED (1 << 1)
+#define CE_ENTRY_REMOVED (1 << 2)
+#define CE_ENTRY_ADDED (1 << 3)
+#define RESOLVE_UNDO_CHANGED (1 << 4)
+#define CACHE_TREE_CHANGED (1 << 5)
+#define SPLIT_INDEX_ORDERED (1 << 6)
+#define UNTRACKED_CHANGED (1 << 7)
+#define FSMONITOR_CHANGED (1 << 8)
+
+struct split_index;
+struct untracked_cache;
+struct progress;
+struct pattern_list;
+
+enum sparse_index_mode {
+ /*
+ * There are no sparse directories in the index at all.
+ *
+ * Repositories that don't use cone-mode sparse-checkout will
+ * always have their indexes in this mode.
+ */
+ INDEX_EXPANDED = 0,
+
+ /*
+ * The index has already been collapsed to sparse directories
+ * whereever possible.
+ */
+ INDEX_COLLAPSED,
+
+ /*
+ * The sparse directories that exist are outside the
+ * sparse-checkout boundary, but it is possible that some file
+ * entries could collapse to sparse directory entries.
+ */
+ INDEX_PARTIALLY_SPARSE,
+};
+
+struct index_state {
+ struct cache_entry **cache;
+ unsigned int version;
+ unsigned int cache_nr, cache_alloc, cache_changed;
+ struct string_list *resolve_undo;
+ struct cache_tree *cache_tree;
+ struct split_index *split_index;
+ struct cache_time timestamp;
+ unsigned name_hash_initialized : 1,
+ initialized : 1,
+ drop_cache_tree : 1,
+ updated_workdir : 1,
+ updated_skipworktree : 1,
+ fsmonitor_has_run_once : 1;
+ enum sparse_index_mode sparse_index;
+ struct hashmap name_hash;
+ struct hashmap dir_hash;
+ struct object_id oid;
+ struct untracked_cache *untracked;
+ char *fsmonitor_last_update;
+ struct ewah_bitmap *fsmonitor_dirty;
+ struct mem_pool *ce_mem_pool;
+ struct progress *progress;
+ struct repository *repo;
+ struct pattern_list *sparse_checkout_patterns;
+};
+
+/**
+ * A "struct index_state istate" must be initialized with
+ * INDEX_STATE_INIT or the corresponding index_state_init().
+ *
+ * If the variable won't be used again, use release_index() to free()
+ * its resources. If it needs to be used again use discard_index(),
+ * which does the same thing, but will use use index_state_init() at
+ * the end. The discard_index() will use its own "istate->repo" as the
+ * "r" argument to index_state_init() in that case.
+ */
+#define INDEX_STATE_INIT(r) { \
+ .repo = (r), \
+}
+void index_state_init(struct index_state *istate, struct repository *r);
+void release_index(struct index_state *istate);
+
+/* Cache entry creation and cleanup */
+
+/*
+ * Create cache_entry intended for use in the specified index. Caller
+ * is responsible for discarding the cache_entry with
+ * `discard_cache_entry`.
+ */
+struct cache_entry *make_cache_entry(struct index_state *istate,
+ unsigned int mode,
+ const struct object_id *oid,
+ const char *path,
+ int stage,
+ unsigned int refresh_options);
+
+struct cache_entry *make_empty_cache_entry(struct index_state *istate,
+ size_t name_len);
+
+/*
+ * Create a cache_entry that is not intended to be added to an index. If
+ * `ce_mem_pool` is not NULL, the entry is allocated within the given memory
+ * pool. Caller is responsible for discarding "loose" entries with
+ * `discard_cache_entry()` and the memory pool with
+ * `mem_pool_discard(ce_mem_pool, should_validate_cache_entries())`.
+ */
+struct cache_entry *make_transient_cache_entry(unsigned int mode,
+ const struct object_id *oid,
+ const char *path,
+ int stage,
+ struct mem_pool *ce_mem_pool);
+
+struct cache_entry *make_empty_transient_cache_entry(size_t len,
+ struct mem_pool *ce_mem_pool);
+
+/*
+ * Discard cache entry.
+ */
+void discard_cache_entry(struct cache_entry *ce);
+
+/*
+ * Check configuration if we should perform extra validation on cache
+ * entries.
+ */
+int should_validate_cache_entries(void);
+
+/*
+ * Duplicate a cache_entry. Allocate memory for the new entry from a
+ * memory_pool. Takes into account cache_entry fields that are meant
+ * for managing the underlying memory allocation of the cache_entry.
+ */
+struct cache_entry *dup_cache_entry(const struct cache_entry *ce, struct index_state *istate);
+
+/*
+ * Validate the cache entries in the index. This is an internal
+ * consistency check that the cache_entry structs are allocated from
+ * the expected memory pool.
+ */
+void validate_cache_entries(const struct index_state *istate);
+
+/*
+ * Bulk prefetch all missing cache entries that are not GITLINKs and that match
+ * the given predicate. This function should only be called if
+ * repo_has_promisor_remote() returns true.
+ */
+typedef int (*must_prefetch_predicate)(const struct cache_entry *);
+void prefetch_cache_entries(const struct index_state *istate,
+ must_prefetch_predicate must_prefetch);
+
+/* Initialize and use the cache information */
+struct lock_file;
+int do_read_index(struct index_state *istate, const char *path,
+ int must_exist); /* for testting only! */
+int read_index_from(struct index_state *, const char *path,
+ const char *gitdir);
+int is_index_unborn(struct index_state *);
+
+/* For use with `write_locked_index()`. */
+#define COMMIT_LOCK (1 << 0)
+#define SKIP_IF_UNCHANGED (1 << 1)
+
+/*
+ * Write the index while holding an already-taken lock. Close the lock,
+ * and if `COMMIT_LOCK` is given, commit it.
+ *
+ * Unless a split index is in use, write the index into the lockfile.
+ *
+ * With a split index, write the shared index to a temporary file,
+ * adjust its permissions and rename it into place, then write the
+ * split index to the lockfile. If the temporary file for the shared
+ * index cannot be created, fall back to the behavior described in
+ * the previous paragraph.
+ *
+ * With `COMMIT_LOCK`, the lock is always committed or rolled back.
+ * Without it, the lock is closed, but neither committed nor rolled
+ * back.
+ *
+ * If `SKIP_IF_UNCHANGED` is given and the index is unchanged, nothing
+ * is written (and the lock is rolled back if `COMMIT_LOCK` is given).
+ */
+int write_locked_index(struct index_state *, struct lock_file *lock, unsigned flags);
+
+void discard_index(struct index_state *);
+void move_index_extensions(struct index_state *dst, struct index_state *src);
+int unmerged_index(const struct index_state *);
+
+/**
+ * Returns 1 if istate differs from tree, 0 otherwise. If tree is NULL,
+ * compares istate to HEAD. If tree is NULL and on an unborn branch,
+ * returns 1 if there are entries in istate, 0 otherwise. If an strbuf is
+ * provided, the space-separated list of files that differ will be appended
+ * to it.
+ */
+int repo_index_has_changes(struct repository *repo,
+ struct tree *tree,
+ struct strbuf *sb);
+
+int verify_path(const char *path, unsigned mode);
+int strcmp_offset(const char *s1, const char *s2, size_t *first_change);
+
+/*
+ * Searches for an entry defined by name and namelen in the given index.
+ * If the return value is positive (including 0) it is the position of an
+ * exact match. If the return value is negative, the negated value minus 1
+ * is the position where the entry would be inserted.
+ * Example: The current index consists of these files and its stages:
+ *
+ * b#0, d#0, f#1, f#3
+ *
+ * index_name_pos(&index, "a", 1) -> -1
+ * index_name_pos(&index, "b", 1) -> 0
+ * index_name_pos(&index, "c", 1) -> -2
+ * index_name_pos(&index, "d", 1) -> 1
+ * index_name_pos(&index, "e", 1) -> -3
+ * index_name_pos(&index, "f", 1) -> -3
+ * index_name_pos(&index, "g", 1) -> -5
+ */
+int index_name_pos(struct index_state *, const char *name, int namelen);
+
+/*
+ * Like index_name_pos, returns the position of an entry of the given name in
+ * the index if one exists, otherwise returns a negative value where the negated
+ * value minus 1 is the position where the index entry would be inserted. Unlike
+ * index_name_pos, however, a sparse index is not expanded to find an entry
+ * inside a sparse directory.
+ */
+int index_name_pos_sparse(struct index_state *, const char *name, int namelen);
+
+/*
+ * Determines whether an entry with the given name exists within the
+ * given index. The return value is 1 if an exact match is found, otherwise
+ * it is 0. Note that, unlike index_name_pos, this function does not expand
+ * the index if it is sparse. If an item exists within the full index but it
+ * is contained within a sparse directory (and not in the sparse index), 0 is
+ * returned.
+ */
+int index_entry_exists(struct index_state *, const char *name, int namelen);
+
+/*
+ * Some functions return the negative complement of an insert position when a
+ * precise match was not found but a position was found where the entry would
+ * need to be inserted. This helper protects that logic from any integer
+ * underflow.
+ */
+static inline int index_pos_to_insert_pos(uintmax_t pos)
+{
+ if (pos > INT_MAX)
+ die("overflow: -1 - %"PRIuMAX, pos);
+ return -1 - (int)pos;
+}
+
+#define ADD_CACHE_OK_TO_ADD 1 /* Ok to add */
+#define ADD_CACHE_OK_TO_REPLACE 2 /* Ok to replace file/directory */
+#define ADD_CACHE_SKIP_DFCHECK 4 /* Ok to skip DF conflict checks */
+#define ADD_CACHE_JUST_APPEND 8 /* Append only */
+#define ADD_CACHE_NEW_ONLY 16 /* Do not replace existing ones */
+#define ADD_CACHE_KEEP_CACHE_TREE 32 /* Do not invalidate cache-tree */
+#define ADD_CACHE_RENORMALIZE 64 /* Pass along HASH_RENORMALIZE */
+int add_index_entry(struct index_state *, struct cache_entry *ce, int option);
+void rename_index_entry_at(struct index_state *, int pos, const char *new_name);
+
+/* Remove entry, return true if there are more entries to go. */
+int remove_index_entry_at(struct index_state *, int pos);
+
+void remove_marked_cache_entries(struct index_state *istate, int invalidate);
+int remove_file_from_index(struct index_state *, const char *path);
+#define ADD_CACHE_VERBOSE 1
+#define ADD_CACHE_PRETEND 2
+#define ADD_CACHE_IGNORE_ERRORS 4
+#define ADD_CACHE_IGNORE_REMOVAL 8
+#define ADD_CACHE_INTENT 16
+/*
+ * These two are used to add the contents of the file at path
+ * to the index, marking the working tree up-to-date by storing
+ * the cached stat info in the resulting cache entry. A caller
+ * that has already run lstat(2) on the path can call
+ * add_to_index(), and all others can call add_file_to_index();
+ * the latter will do necessary lstat(2) internally before
+ * calling the former.
+ */
+int add_to_index(struct index_state *, const char *path, struct stat *, int flags);
+int add_file_to_index(struct index_state *, const char *path, int flags);
+
+int chmod_index_entry(struct index_state *, struct cache_entry *ce, char flip);
+int ce_same_name(const struct cache_entry *a, const struct cache_entry *b);
+void set_object_name_for_intent_to_add_entry(struct cache_entry *ce);
+int index_name_is_other(struct index_state *, const char *, int);
+void *read_blob_data_from_index(struct index_state *, const char *, unsigned long *);
+
+/* do stat comparison even if CE_VALID is true */
+#define CE_MATCH_IGNORE_VALID 01
+/* do not check the contents but report dirty on racily-clean entries */
+#define CE_MATCH_RACY_IS_DIRTY 02
+/* do stat comparison even if CE_SKIP_WORKTREE is true */
+#define CE_MATCH_IGNORE_SKIP_WORKTREE 04
+/* ignore non-existent files during stat update */
+#define CE_MATCH_IGNORE_MISSING 0x08
+/* enable stat refresh */
+#define CE_MATCH_REFRESH 0x10
+/* don't refresh_fsmonitor state or do stat comparison even if CE_FSMONITOR_VALID is true */
+#define CE_MATCH_IGNORE_FSMONITOR 0X20
+int is_racy_timestamp(const struct index_state *istate,
+ const struct cache_entry *ce);
+int has_racy_timestamp(struct index_state *istate);
+int ie_match_stat(struct index_state *, const struct cache_entry *, struct stat *, unsigned int);
+int ie_modified(struct index_state *, const struct cache_entry *, struct stat *, unsigned int);
+
+int match_stat_data_racy(const struct index_state *istate,
+ const struct stat_data *sd, struct stat *st);
+
+void fill_stat_cache_info(struct index_state *istate, struct cache_entry *ce, struct stat *st);
+
+/*
+ * Fill members of st by members of sd enough to convince match_stat()
+ * to consider that they match. It should be usable as a replacement
+ * for lstat() for a tracked path that is known to be up-to-date via
+ * some out-of-line means (like fsmonitor).
+ */
+int fake_lstat(const struct cache_entry *ce, struct stat *st);
+
+#define REFRESH_REALLY (1 << 0) /* ignore_valid */
+#define REFRESH_UNMERGED (1 << 1) /* allow unmerged */
+#define REFRESH_QUIET (1 << 2) /* be quiet about it */
+#define REFRESH_IGNORE_MISSING (1 << 3) /* ignore non-existent */
+#define REFRESH_IGNORE_SUBMODULES (1 << 4) /* ignore submodules */
+#define REFRESH_IN_PORCELAIN (1 << 5) /* user friendly output, not "needs update" */
+#define REFRESH_PROGRESS (1 << 6) /* show progress bar if stderr is tty */
+#define REFRESH_IGNORE_SKIP_WORKTREE (1 << 7) /* ignore skip_worktree entries */
+int refresh_index(struct index_state *, unsigned int flags, const struct pathspec *pathspec, char *seen, const char *header_msg);
+/*
+ * Refresh the index and write it to disk.
+ *
+ * 'refresh_flags' is passed directly to 'refresh_index()', while
+ * 'COMMIT_LOCK | write_flags' is passed to 'write_locked_index()', so
+ * the lockfile is always either committed or rolled back.
+ *
+ * If 'gentle' is passed, errors locking the index are ignored.
+ *
+ * Return 1 if refreshing the index returns an error, -1 if writing
+ * the index to disk fails, 0 on success.
+ *
+ * Note that if refreshing the index returns an error, we still write
+ * out the index (unless locking fails).
+ */
+int repo_refresh_and_write_index(struct repository*, unsigned int refresh_flags, unsigned int write_flags, int gentle, const struct pathspec *, char *seen, const char *header_msg);
+
+struct cache_entry *refresh_cache_entry(struct index_state *, struct cache_entry *, unsigned int);
+
+void set_alternate_index_output(const char *);
+
+extern int verify_index_checksum;
+extern int verify_ce_order;
+
+int cmp_cache_name_compare(const void *a_, const void *b_);
+
+int add_files_to_cache(struct repository *repo, const char *prefix,
+ const struct pathspec *pathspec, char *ps_matched,
+ int include_sparse, int flags);
+
+void overlay_tree_on_index(struct index_state *istate,
+ const char *tree_name, const char *prefix);
+
+#endif /* READ_CACHE_LL_H */
diff --git a/read-cache.c b/read-cache.c
index 4de2077..e1723ad 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -3,24 +3,38 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "bulk-checkin.h"
#include "config.h"
+#include "date.h"
#include "diff.h"
#include "diffcore.h"
+#include "hex.h"
#include "tempfile.h"
#include "lockfile.h"
#include "cache-tree.h"
#include "refs.h"
#include "dir.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "oid-array.h"
#include "tree.h"
#include "commit.h"
-#include "blob.h"
+#include "environment.h"
+#include "gettext.h"
+#include "mem-pool.h"
+#include "name-hash.h"
+#include "object-name.h"
+#include "path.h"
+#include "preload-index.h"
+#include "read-cache.h"
#include "resolve-undo.h"
-#include "run-command.h"
+#include "revision.h"
#include "strbuf.h"
+#include "trace2.h"
#include "varint.h"
#include "split-index.h"
+#include "symlinks.h"
#include "utf8.h"
#include "fsmonitor.h"
#include "thread-utils.h"
@@ -163,61 +177,6 @@ void rename_index_entry_at(struct index_state *istate, int nr, const char *new_n
add_index_entry(istate, new_entry, ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE);
}
-void fill_stat_data(struct stat_data *sd, struct stat *st)
-{
- sd->sd_ctime.sec = (unsigned int)st->st_ctime;
- sd->sd_mtime.sec = (unsigned int)st->st_mtime;
- sd->sd_ctime.nsec = ST_CTIME_NSEC(*st);
- sd->sd_mtime.nsec = ST_MTIME_NSEC(*st);
- sd->sd_dev = st->st_dev;
- sd->sd_ino = st->st_ino;
- sd->sd_uid = st->st_uid;
- sd->sd_gid = st->st_gid;
- sd->sd_size = st->st_size;
-}
-
-int match_stat_data(const struct stat_data *sd, struct stat *st)
-{
- int changed = 0;
-
- if (sd->sd_mtime.sec != (unsigned int)st->st_mtime)
- changed |= MTIME_CHANGED;
- if (trust_ctime && check_stat &&
- sd->sd_ctime.sec != (unsigned int)st->st_ctime)
- changed |= CTIME_CHANGED;
-
-#ifdef USE_NSEC
- if (check_stat && sd->sd_mtime.nsec != ST_MTIME_NSEC(*st))
- changed |= MTIME_CHANGED;
- if (trust_ctime && check_stat &&
- sd->sd_ctime.nsec != ST_CTIME_NSEC(*st))
- changed |= CTIME_CHANGED;
-#endif
-
- if (check_stat) {
- if (sd->sd_uid != (unsigned int) st->st_uid ||
- sd->sd_gid != (unsigned int) st->st_gid)
- changed |= OWNER_CHANGED;
- if (sd->sd_ino != (unsigned int) st->st_ino)
- changed |= INODE_CHANGED;
- }
-
-#ifdef USE_STDEV
- /*
- * st_dev breaks on network filesystems where different
- * clients will have different views of what "device"
- * the filesystem is on
- */
- if (check_stat && sd->sd_dev != (unsigned int) st->st_dev)
- changed |= INODE_CHANGED;
-#endif
-
- if (sd->sd_size != (unsigned int) st->st_size)
- changed |= DATA_CHANGED;
-
- return changed;
-}
-
/*
* This only updates the "non-critical" parts of the directory
* cache, ie the parts that aren't tracked by GIT, and only used
@@ -236,6 +195,33 @@ void fill_stat_cache_info(struct index_state *istate, struct cache_entry *ce, st
}
}
+static unsigned int st_mode_from_ce(const struct cache_entry *ce)
+{
+ extern int trust_executable_bit, has_symlinks;
+
+ switch (ce->ce_mode & S_IFMT) {
+ case S_IFLNK:
+ return has_symlinks ? S_IFLNK : (S_IFREG | 0644);
+ case S_IFREG:
+ return (ce->ce_mode & (trust_executable_bit ? 0755 : 0644)) | S_IFREG;
+ case S_IFGITLINK:
+ return S_IFDIR | 0755;
+ case S_IFDIR:
+ return ce->ce_mode;
+ default:
+ BUG("unsupported ce_mode: %o", ce->ce_mode);
+ }
+}
+
+int fake_lstat(const struct cache_entry *ce, struct stat *st)
+{
+ fake_lstat_data(&ce->ce_stat_data, st);
+ st->st_mode = st_mode_from_ce(ce);
+
+ /* always succeed as lstat() replacement */
+ return 0;
+}
+
static int ce_compare_data(struct index_state *istate,
const struct cache_entry *ce,
struct stat *st)
@@ -263,7 +249,7 @@ static int ce_compare_link(const struct cache_entry *ce, size_t expected_size)
if (strbuf_readlink(&sb, ce->name, expected_size))
return -1;
- buffer = read_object_file(&ce->oid, &type, &size);
+ buffer = repo_read_object_file(the_repository, &ce->oid, &type, &size);
if (buffer) {
if (size == sb.len)
match = memcmp(buffer, sb.buf, size);
@@ -488,86 +474,30 @@ int ie_modified(struct index_state *istate,
return 0;
}
-int base_name_compare(const char *name1, int len1, int mode1,
- const char *name2, int len2, int mode2)
+static int cache_name_stage_compare(const char *name1, int len1, int stage1,
+ const char *name2, int len2, int stage2)
{
- unsigned char c1, c2;
- int len = len1 < len2 ? len1 : len2;
int cmp;
- cmp = memcmp(name1, name2, len);
- if (cmp)
- return cmp;
- c1 = name1[len];
- c2 = name2[len];
- if (!c1 && S_ISDIR(mode1))
- c1 = '/';
- if (!c2 && S_ISDIR(mode2))
- c2 = '/';
- return (c1 < c2) ? -1 : (c1 > c2) ? 1 : 0;
-}
-
-/*
- * df_name_compare() is identical to base_name_compare(), except it
- * compares conflicting directory/file entries as equal. Note that
- * while a directory name compares as equal to a regular file, they
- * then individually compare _differently_ to a filename that has
- * a dot after the basename (because '\0' < '.' < '/').
- *
- * This is used by routines that want to traverse the git namespace
- * but then handle conflicting entries together when possible.
- */
-int df_name_compare(const char *name1, int len1, int mode1,
- const char *name2, int len2, int mode2)
-{
- int len = len1 < len2 ? len1 : len2, cmp;
- unsigned char c1, c2;
-
- cmp = memcmp(name1, name2, len);
+ cmp = name_compare(name1, len1, name2, len2);
if (cmp)
return cmp;
- /* Directories and files compare equal (same length, same name) */
- if (len1 == len2)
- return 0;
- c1 = name1[len];
- if (!c1 && S_ISDIR(mode1))
- c1 = '/';
- c2 = name2[len];
- if (!c2 && S_ISDIR(mode2))
- c2 = '/';
- if (c1 == '/' && !c2)
- return 0;
- if (c2 == '/' && !c1)
- return 0;
- return c1 - c2;
-}
-int name_compare(const char *name1, size_t len1, const char *name2, size_t len2)
-{
- size_t min_len = (len1 < len2) ? len1 : len2;
- int cmp = memcmp(name1, name2, min_len);
- if (cmp)
- return cmp;
- if (len1 < len2)
+ if (stage1 < stage2)
return -1;
- if (len1 > len2)
+ if (stage1 > stage2)
return 1;
return 0;
}
-int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2)
+int cmp_cache_name_compare(const void *a_, const void *b_)
{
- int cmp;
+ const struct cache_entry *ce1, *ce2;
- cmp = name_compare(name1, len1, name2, len2);
- if (cmp)
- return cmp;
-
- if (stage1 < stage2)
- return -1;
- if (stage1 > stage2)
- return 1;
- return 0;
+ ce1 = *((const struct cache_entry **)a_);
+ ce2 = *((const struct cache_entry **)b_);
+ return cache_name_stage_compare(ce1->name, ce1->ce_namelen, ce_stage(ce1),
+ ce2->name, ce2->ce_namelen, ce_stage(ce2));
}
static int index_name_stage_pos(struct index_state *istate,
@@ -620,6 +550,11 @@ int index_name_pos(struct index_state *istate, const char *name, int namelen)
return index_name_stage_pos(istate, name, namelen, 0, EXPAND_SPARSE);
}
+int index_name_pos_sparse(struct index_state *istate, const char *name, int namelen)
+{
+ return index_name_stage_pos(istate, name, namelen, 0, NO_EXPAND_SPARSE);
+}
+
int index_entry_exists(struct index_state *istate, const char *name, int namelen)
{
return index_name_stage_pos(istate, name, namelen, 0, NO_EXPAND_SPARSE) >= 0;
@@ -1812,6 +1747,8 @@ static int verify_hdr(const struct cache_header *hdr, unsigned long size)
git_hash_ctx c;
unsigned char hash[GIT_MAX_RAWSZ];
int hdr_version;
+ unsigned char *start, *end;
+ struct object_id oid;
if (hdr->hdr_signature != htonl(CACHE_SIGNATURE))
return error(_("bad signature 0x%08x"), hdr->hdr_signature);
@@ -1822,10 +1759,16 @@ static int verify_hdr(const struct cache_header *hdr, unsigned long size)
if (!verify_index_checksum)
return 0;
+ end = (unsigned char *)hdr + size;
+ start = end - the_hash_algo->rawsz;
+ oidread(&oid, start);
+ if (oideq(&oid, null_oid()))
+ return 0;
+
the_hash_algo->init_fn(&c);
the_hash_algo->update_fn(&c, hdr, size - the_hash_algo->rawsz);
the_hash_algo->final_fn(hash, &c);
- if (!hasheq(hash, (unsigned char *)hdr + size - the_hash_algo->rawsz))
+ if (!hasheq(hash, start))
return error(_("bad index file sha1 signature"));
return 0;
}
@@ -1868,9 +1811,20 @@ static int read_index_extension(struct index_state *istate,
return 0;
}
+/*
+ * Parses the contents of the cache entry contained within the 'ondisk' buffer
+ * into a new incore 'cache_entry'.
+ *
+ * Note that 'char *ondisk' may not be aligned to a 4-byte address interval in
+ * index v4, so we cannot cast it to 'struct ondisk_cache_entry *' and access
+ * its members. Instead, we use the byte offsets of members within the struct to
+ * identify where 'get_be16()', 'get_be32()', and 'oidread()' (which can all
+ * read from an unaligned memory buffer) should read from the 'ondisk' buffer
+ * into the corresponding incore 'cache_entry' members.
+ */
static struct cache_entry *create_from_disk(struct mem_pool *ce_mem_pool,
unsigned int version,
- struct ondisk_cache_entry *ondisk,
+ const char *ondisk,
unsigned long *ent_size,
const struct cache_entry *previous_ce)
{
@@ -1878,7 +1832,7 @@ static struct cache_entry *create_from_disk(struct mem_pool *ce_mem_pool,
size_t len;
const char *name;
const unsigned hashsz = the_hash_algo->rawsz;
- const uint16_t *flagsp = (const uint16_t *)(ondisk->data + hashsz);
+ const char *flagsp = ondisk + offsetof(struct ondisk_cache_entry, data) + hashsz;
unsigned int flags;
size_t copy_len = 0;
/*
@@ -1896,15 +1850,15 @@ static struct cache_entry *create_from_disk(struct mem_pool *ce_mem_pool,
if (flags & CE_EXTENDED) {
int extended_flags;
- extended_flags = get_be16(flagsp + 1) << 16;
+ extended_flags = get_be16(flagsp + sizeof(uint16_t)) << 16;
/* We do not yet understand any bit out of CE_EXTENDED_FLAGS */
if (extended_flags & ~CE_EXTENDED_FLAGS)
die(_("unknown index entry format 0x%08x"), extended_flags);
flags |= extended_flags;
- name = (const char *)(flagsp + 2);
+ name = (const char *)(flagsp + 2 * sizeof(uint16_t));
}
else
- name = (const char *)(flagsp + 1);
+ name = (const char *)(flagsp + sizeof(uint16_t));
if (expand_name_field) {
const unsigned char *cp = (const unsigned char *)name;
@@ -1930,20 +1884,32 @@ static struct cache_entry *create_from_disk(struct mem_pool *ce_mem_pool,
ce = mem_pool__ce_alloc(ce_mem_pool, len);
- ce->ce_stat_data.sd_ctime.sec = get_be32(&ondisk->ctime.sec);
- ce->ce_stat_data.sd_mtime.sec = get_be32(&ondisk->mtime.sec);
- ce->ce_stat_data.sd_ctime.nsec = get_be32(&ondisk->ctime.nsec);
- ce->ce_stat_data.sd_mtime.nsec = get_be32(&ondisk->mtime.nsec);
- ce->ce_stat_data.sd_dev = get_be32(&ondisk->dev);
- ce->ce_stat_data.sd_ino = get_be32(&ondisk->ino);
- ce->ce_mode = get_be32(&ondisk->mode);
- ce->ce_stat_data.sd_uid = get_be32(&ondisk->uid);
- ce->ce_stat_data.sd_gid = get_be32(&ondisk->gid);
- ce->ce_stat_data.sd_size = get_be32(&ondisk->size);
+ /*
+ * NEEDSWORK: using 'offsetof()' is cumbersome and should be replaced
+ * with something more akin to 'load_bitmap_entries_v1()'s use of
+ * 'read_be16'/'read_be32'. For consistency with the corresponding
+ * ondisk entry write function ('copy_cache_entry_to_ondisk()'), this
+ * should be done at the same time as removing references to
+ * 'ondisk_cache_entry' there.
+ */
+ ce->ce_stat_data.sd_ctime.sec = get_be32(ondisk + offsetof(struct ondisk_cache_entry, ctime)
+ + offsetof(struct cache_time, sec));
+ ce->ce_stat_data.sd_mtime.sec = get_be32(ondisk + offsetof(struct ondisk_cache_entry, mtime)
+ + offsetof(struct cache_time, sec));
+ ce->ce_stat_data.sd_ctime.nsec = get_be32(ondisk + offsetof(struct ondisk_cache_entry, ctime)
+ + offsetof(struct cache_time, nsec));
+ ce->ce_stat_data.sd_mtime.nsec = get_be32(ondisk + offsetof(struct ondisk_cache_entry, mtime)
+ + offsetof(struct cache_time, nsec));
+ ce->ce_stat_data.sd_dev = get_be32(ondisk + offsetof(struct ondisk_cache_entry, dev));
+ ce->ce_stat_data.sd_ino = get_be32(ondisk + offsetof(struct ondisk_cache_entry, ino));
+ ce->ce_mode = get_be32(ondisk + offsetof(struct ondisk_cache_entry, mode));
+ ce->ce_stat_data.sd_uid = get_be32(ondisk + offsetof(struct ondisk_cache_entry, uid));
+ ce->ce_stat_data.sd_gid = get_be32(ondisk + offsetof(struct ondisk_cache_entry, gid));
+ ce->ce_stat_data.sd_size = get_be32(ondisk + offsetof(struct ondisk_cache_entry, size));
ce->ce_flags = flags & ~CE_NAMEMASK;
ce->ce_namelen = len;
ce->index = 0;
- oidread(&ce->oid, ondisk->data);
+ oidread(&ce->oid, (const unsigned char *)ondisk + offsetof(struct ondisk_cache_entry, data));
if (expand_name_field) {
if (copy_len)
@@ -2112,12 +2078,12 @@ static unsigned long load_cache_entry_block(struct index_state *istate,
unsigned long src_offset = start_offset;
for (i = offset; i < offset + nr; i++) {
- struct ondisk_cache_entry *disk_ce;
struct cache_entry *ce;
unsigned long consumed;
- disk_ce = (struct ondisk_cache_entry *)(mmap + src_offset);
- ce = create_from_disk(ce_mem_pool, istate->version, disk_ce, &consumed, previous_ce);
+ ce = create_from_disk(ce_mem_pool, istate->version,
+ mmap + src_offset,
+ &consumed, previous_ce);
set_index_entry(istate, i, ce);
src_offset += consumed;
@@ -2264,12 +2230,10 @@ static void set_new_index_sparsity(struct index_state *istate)
* If the index's repo exists, mark it sparse according to
* repo settings.
*/
- if (istate->repo) {
- prepare_repo_settings(istate->repo);
- if (!istate->repo->settings.command_requires_full_index &&
- is_sparse_index_allowed(istate, 0))
- istate->sparse_index = 1;
- }
+ prepare_repo_settings(istate->repo);
+ if (!istate->repo->settings.command_requires_full_index &&
+ is_sparse_index_allowed(istate, 0))
+ istate->sparse_index = 1;
}
/* remember to discard_cache() before reading a different cache! */
@@ -2294,9 +2258,8 @@ int do_read_index(struct index_state *istate, const char *path, int must_exist)
fd = open(path, O_RDONLY);
if (fd < 0) {
if (!must_exist && errno == ENOENT) {
- if (!istate->repo)
- istate->repo = the_repository;
set_new_index_sparsity(istate);
+ istate->initialized = 1;
return 0;
}
die_errno(_("%s: index file open failed"), path);
@@ -2397,9 +2360,6 @@ int do_read_index(struct index_state *istate, const char *path, int must_exist)
trace2_data_intmax("index", the_repository, "read/cache_nr",
istate->cache_nr);
- if (!istate->repo)
- istate->repo = the_repository;
-
/*
* If the command explicitly requires a full index, force it
* to be full. Otherwise, correct the sparsity based on repository
@@ -2462,18 +2422,21 @@ int read_index_from(struct index_state *istate, const char *path,
trace_performance_enter();
if (split_index->base)
- discard_index(split_index->base);
+ release_index(split_index->base);
else
- CALLOC_ARRAY(split_index->base, 1);
+ ALLOC_ARRAY(split_index->base, 1);
+ index_state_init(split_index->base, istate->repo);
base_oid_hex = oid_to_hex(&split_index->base_oid);
base_path = xstrfmt("%s/sharedindex.%s", gitdir, base_oid_hex);
- trace2_region_enter_printf("index", "shared/do_read_index",
- the_repository, "%s", base_path);
- ret = do_read_index(split_index->base, base_path, 0);
- trace2_region_leave_printf("index", "shared/do_read_index",
- the_repository, "%s", base_path);
- if (!ret) {
+ if (file_exists(base_path)) {
+ trace2_region_enter_printf("index", "shared/do_read_index",
+ the_repository, "%s", base_path);
+
+ ret = do_read_index(split_index->base, base_path, 0);
+ trace2_region_leave_printf("index", "shared/do_read_index",
+ the_repository, "%s", base_path);
+ } else {
char *path_copy = xstrdup(path);
char *base_path2 = xstrfmt("%s/sharedindex.%s",
dirname(path_copy), base_oid_hex);
@@ -2503,7 +2466,13 @@ int is_index_unborn(struct index_state *istate)
return (!istate->cache_nr && !istate->timestamp.sec);
}
-int discard_index(struct index_state *istate)
+void index_state_init(struct index_state *istate, struct repository *r)
+{
+ struct index_state blank = INDEX_STATE_INIT(r);
+ memcpy(istate, &blank, sizeof(*istate));
+}
+
+void release_index(struct index_state *istate)
{
/*
* Cache entries in istate->cache[] should have been allocated
@@ -2515,27 +2484,28 @@ int discard_index(struct index_state *istate)
validate_cache_entries(istate);
resolve_undo_clear_index(istate);
- istate->cache_nr = 0;
- istate->cache_changed = 0;
- istate->timestamp.sec = 0;
- istate->timestamp.nsec = 0;
free_name_hash(istate);
cache_tree_free(&(istate->cache_tree));
- istate->initialized = 0;
- istate->fsmonitor_has_run_once = 0;
- FREE_AND_NULL(istate->fsmonitor_last_update);
- FREE_AND_NULL(istate->cache);
- istate->cache_alloc = 0;
+ free(istate->fsmonitor_last_update);
+ free(istate->cache);
discard_split_index(istate);
free_untracked_cache(istate->untracked);
- istate->untracked = NULL;
+
+ if (istate->sparse_checkout_patterns) {
+ clear_pattern_list(istate->sparse_checkout_patterns);
+ FREE_AND_NULL(istate->sparse_checkout_patterns);
+ }
if (istate->ce_mem_pool) {
mem_pool_discard(istate->ce_mem_pool, should_validate_cache_entries());
FREE_AND_NULL(istate->ce_mem_pool);
}
+}
- return 0;
+void discard_index(struct index_state *istate)
+{
+ release_index(istate);
+ index_state_init(istate, istate->repo);
}
/*
@@ -2590,7 +2560,7 @@ int repo_index_has_changes(struct repository *repo,
if (tree)
cmp = tree->object.oid;
- if (tree || !get_oid_tree("HEAD", &cmp)) {
+ if (tree || !repo_get_oid_tree(repo, "HEAD", &cmp)) {
struct diff_options opt;
repo_diff_setup(repo, &opt);
@@ -2863,6 +2833,16 @@ static int record_ieot(void)
return !git_config_get_index_threads(&val) && val != 1;
}
+enum write_extensions {
+ WRITE_NO_EXTENSION = 0,
+ WRITE_SPLIT_INDEX_EXTENSION = 1<<0,
+ WRITE_CACHE_TREE_EXTENSION = 1<<1,
+ WRITE_RESOLVE_UNDO_EXTENSION = 1<<2,
+ WRITE_UNTRACKED_CACHE_EXTENSION = 1<<3,
+ WRITE_FSMONITOR_EXTENSION = 1<<4,
+};
+#define WRITE_ALL_EXTENSIONS ((enum write_extensions)-1)
+
/*
* On success, `tempfile` is closed. If it is the temporary file
* of a `struct lock_file`, we will therefore effectively perform
@@ -2871,7 +2851,7 @@ static int record_ieot(void)
* rely on it.
*/
static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
- int strip_extensions, unsigned flags)
+ enum write_extensions write_extensions, unsigned flags)
{
uint64_t start = getnanotime();
struct hashfile *f;
@@ -2889,9 +2869,13 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
int ieot_entries = 1;
struct index_entry_offset_table *ieot = NULL;
int nr, nr_threads;
+ struct repository *r = istate->repo;
f = hashfd(tempfile->fd, tempfile->filename.buf);
+ prepare_repo_settings(r);
+ f->skip_hash = r->settings.index_skip_hash;
+
for (i = removed = extended = 0; i < entries; i++) {
if (cache[i]->ce_flags & CE_REMOVE)
removed++;
@@ -2905,7 +2889,7 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
}
if (!istate->version)
- istate->version = get_index_format_default(the_repository);
+ istate->version = get_index_format_default(r);
/* demote version 3 to version 2 when the latter suffices */
if (istate->version == 3 || istate->version == 2)
@@ -3040,8 +3024,8 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
return -1;
}
- if (!strip_extensions && istate->split_index &&
- !is_null_oid(&istate->split_index->base_oid)) {
+ if (write_extensions & WRITE_SPLIT_INDEX_EXTENSION &&
+ istate->split_index) {
struct strbuf sb = STRBUF_INIT;
if (istate->sparse_index)
@@ -3055,7 +3039,8 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
if (err)
return -1;
}
- if (!strip_extensions && !drop_cache_tree && istate->cache_tree) {
+ if (write_extensions & WRITE_CACHE_TREE_EXTENSION &&
+ !drop_cache_tree && istate->cache_tree) {
struct strbuf sb = STRBUF_INIT;
cache_tree_write(&sb, istate->cache_tree);
@@ -3065,7 +3050,8 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
if (err)
return -1;
}
- if (!strip_extensions && istate->resolve_undo) {
+ if (write_extensions & WRITE_RESOLVE_UNDO_EXTENSION &&
+ istate->resolve_undo) {
struct strbuf sb = STRBUF_INIT;
resolve_undo_write(&sb, istate->resolve_undo);
@@ -3076,7 +3062,8 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
if (err)
return -1;
}
- if (!strip_extensions && istate->untracked) {
+ if (write_extensions & WRITE_UNTRACKED_CACHE_EXTENSION &&
+ istate->untracked) {
struct strbuf sb = STRBUF_INIT;
write_untracked_extension(&sb, istate->untracked);
@@ -3087,7 +3074,8 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
if (err)
return -1;
}
- if (!strip_extensions && istate->fsmonitor_last_update) {
+ if (write_extensions & WRITE_FSMONITOR_EXTENSION &&
+ istate->fsmonitor_last_update) {
struct strbuf sb = STRBUF_INIT;
write_fsmonitor_extension(&sb, istate);
@@ -3161,8 +3149,10 @@ static int commit_locked_index(struct lock_file *lk)
return commit_lock_file(lk);
}
-static int do_write_locked_index(struct index_state *istate, struct lock_file *lock,
- unsigned flags)
+static int do_write_locked_index(struct index_state *istate,
+ struct lock_file *lock,
+ unsigned flags,
+ enum write_extensions write_extensions)
{
int ret;
int was_full = istate->sparse_index == INDEX_EXPANDED;
@@ -3180,7 +3170,7 @@ static int do_write_locked_index(struct index_state *istate, struct lock_file *l
*/
trace2_region_enter_printf("index", "do_write_index", the_repository,
"%s", get_lock_file_path(lock));
- ret = do_write_index(istate, lock->tempfile, 0, flags);
+ ret = do_write_index(istate, lock->tempfile, write_extensions, flags);
trace2_region_leave_printf("index", "do_write_index", the_repository,
"%s", get_lock_file_path(lock));
@@ -3209,7 +3199,7 @@ static int write_split_index(struct index_state *istate,
{
int ret;
prepare_to_write_split_index(istate);
- ret = do_write_locked_index(istate, lock, flags);
+ ret = do_write_locked_index(istate, lock, flags, WRITE_ALL_EXTENSIONS);
finish_writing_split_index(istate);
return ret;
}
@@ -3284,7 +3274,7 @@ static int write_shared_index(struct index_state *istate,
trace2_region_enter_printf("index", "shared/do_write_index",
the_repository, "%s", get_tempfile_path(*temp));
- ret = do_write_index(si->base, *temp, 1, flags);
+ ret = do_write_index(si->base, *temp, WRITE_NO_EXTENSION, flags);
trace2_region_leave_printf("index", "shared/do_write_index",
the_repository, "%s", get_tempfile_path(*temp));
@@ -3361,9 +3351,8 @@ int write_locked_index(struct index_state *istate, struct lock_file *lock,
if ((!si && !test_split_index_env) ||
alternate_index_output ||
(istate->cache_changed & ~EXTMASK)) {
- if (si)
- oidclr(&si->base_oid);
- ret = do_write_locked_index(istate, lock, flags);
+ ret = do_write_locked_index(istate, lock, flags,
+ ~WRITE_SPLIT_INDEX_EXTENSION);
goto out;
}
@@ -3389,8 +3378,8 @@ int write_locked_index(struct index_state *istate, struct lock_file *lock,
/* Same initial permissions as the main .git/index file */
temp = mks_tempfile_sm(git_path("sharedindex_XXXXXX"), 0, 0666);
if (!temp) {
- oidclr(&si->base_oid);
- ret = do_write_locked_index(istate, lock, flags);
+ ret = do_write_locked_index(istate, lock, flags,
+ ~WRITE_SPLIT_INDEX_EXTENSION);
goto out;
}
ret = write_shared_index(istate, &temp, flags);
@@ -3511,7 +3500,8 @@ void *read_blob_data_from_index(struct index_state *istate,
}
if (pos < 0)
return NULL;
- data = read_object_file(&istate->cache[pos]->oid, &type, &sz);
+ data = repo_read_object_file(the_repository, &istate->cache[pos]->oid,
+ &type, &sz);
if (!data || type != OBJ_BLOB) {
free(data);
return NULL;
@@ -3521,35 +3511,6 @@ void *read_blob_data_from_index(struct index_state *istate,
return data;
}
-void stat_validity_clear(struct stat_validity *sv)
-{
- FREE_AND_NULL(sv->sd);
-}
-
-int stat_validity_check(struct stat_validity *sv, const char *path)
-{
- struct stat st;
-
- if (stat(path, &st) < 0)
- return sv->sd == NULL;
- if (!sv->sd)
- return 0;
- return S_ISREG(st.st_mode) && !match_stat_data(sv->sd, &st);
-}
-
-void stat_validity_update(struct stat_validity *sv, int fd)
-{
- struct stat st;
-
- if (fstat(fd, &st) < 0 || !S_ISREG(st.st_mode))
- stat_validity_clear(sv);
- else {
- if (!sv->sd)
- CALLOC_ARRAY(sv->sd, 1);
- fill_stat_data(sv->sd, &st);
- }
-}
-
void move_index_extensions(struct index_state *dst, struct index_state *src)
{
dst->untracked = src->untracked;
@@ -3793,3 +3754,242 @@ void prefetch_cache_entries(const struct index_state *istate,
to_fetch.oid, to_fetch.nr);
oid_array_clear(&to_fetch);
}
+
+static int read_one_entry_opt(struct index_state *istate,
+ const struct object_id *oid,
+ struct strbuf *base,
+ const char *pathname,
+ unsigned mode, int opt)
+{
+ int len;
+ struct cache_entry *ce;
+
+ if (S_ISDIR(mode))
+ return READ_TREE_RECURSIVE;
+
+ len = strlen(pathname);
+ ce = make_empty_cache_entry(istate, base->len + len);
+
+ ce->ce_mode = create_ce_mode(mode);
+ ce->ce_flags = create_ce_flags(1);
+ ce->ce_namelen = base->len + len;
+ memcpy(ce->name, base->buf, base->len);
+ memcpy(ce->name + base->len, pathname, len+1);
+ oidcpy(&ce->oid, oid);
+ return add_index_entry(istate, ce, opt);
+}
+
+static int read_one_entry(const struct object_id *oid, struct strbuf *base,
+ const char *pathname, unsigned mode,
+ void *context)
+{
+ struct index_state *istate = context;
+ return read_one_entry_opt(istate, oid, base, pathname,
+ mode,
+ ADD_CACHE_OK_TO_ADD|ADD_CACHE_SKIP_DFCHECK);
+}
+
+/*
+ * This is used when the caller knows there is no existing entries at
+ * the stage that will conflict with the entry being added.
+ */
+static int read_one_entry_quick(const struct object_id *oid, struct strbuf *base,
+ const char *pathname, unsigned mode,
+ void *context)
+{
+ struct index_state *istate = context;
+ return read_one_entry_opt(istate, oid, base, pathname,
+ mode, ADD_CACHE_JUST_APPEND);
+}
+
+/*
+ * Read the tree specified with --with-tree option
+ * (typically, HEAD) into stage #1 and then
+ * squash them down to stage #0. This is used for
+ * --error-unmatch to list and check the path patterns
+ * that were given from the command line. We are not
+ * going to write this index out.
+ */
+void overlay_tree_on_index(struct index_state *istate,
+ const char *tree_name, const char *prefix)
+{
+ struct tree *tree;
+ struct object_id oid;
+ struct pathspec pathspec;
+ struct cache_entry *last_stage0 = NULL;
+ int i;
+ read_tree_fn_t fn = NULL;
+ int err;
+
+ if (repo_get_oid(the_repository, tree_name, &oid))
+ die("tree-ish %s not found.", tree_name);
+ tree = parse_tree_indirect(&oid);
+ if (!tree)
+ die("bad tree-ish %s", tree_name);
+
+ /* Hoist the unmerged entries up to stage #3 to make room */
+ /* TODO: audit for interaction with sparse-index. */
+ ensure_full_index(istate);
+ for (i = 0; i < istate->cache_nr; i++) {
+ struct cache_entry *ce = istate->cache[i];
+ if (!ce_stage(ce))
+ continue;
+ ce->ce_flags |= CE_STAGEMASK;
+ }
+
+ if (prefix) {
+ static const char *(matchbuf[1]);
+ matchbuf[0] = NULL;
+ parse_pathspec(&pathspec, PATHSPEC_ALL_MAGIC,
+ PATHSPEC_PREFER_CWD, prefix, matchbuf);
+ } else
+ memset(&pathspec, 0, sizeof(pathspec));
+
+ /*
+ * See if we have cache entry at the stage. If so,
+ * do it the original slow way, otherwise, append and then
+ * sort at the end.
+ */
+ for (i = 0; !fn && i < istate->cache_nr; i++) {
+ const struct cache_entry *ce = istate->cache[i];
+ if (ce_stage(ce) == 1)
+ fn = read_one_entry;
+ }
+
+ if (!fn)
+ fn = read_one_entry_quick;
+ err = read_tree(the_repository, tree, &pathspec, fn, istate);
+ clear_pathspec(&pathspec);
+ if (err)
+ die("unable to read tree entries %s", tree_name);
+
+ /*
+ * Sort the cache entry -- we need to nuke the cache tree, though.
+ */
+ if (fn == read_one_entry_quick) {
+ cache_tree_free(&istate->cache_tree);
+ QSORT(istate->cache, istate->cache_nr, cmp_cache_name_compare);
+ }
+
+ for (i = 0; i < istate->cache_nr; i++) {
+ struct cache_entry *ce = istate->cache[i];
+ switch (ce_stage(ce)) {
+ case 0:
+ last_stage0 = ce;
+ /* fallthru */
+ default:
+ continue;
+ case 1:
+ /*
+ * If there is stage #0 entry for this, we do not
+ * need to show it. We use CE_UPDATE bit to mark
+ * such an entry.
+ */
+ if (last_stage0 &&
+ !strcmp(last_stage0->name, ce->name))
+ ce->ce_flags |= CE_UPDATE;
+ }
+ }
+}
+
+struct update_callback_data {
+ struct index_state *index;
+ int include_sparse;
+ int flags;
+ int add_errors;
+};
+
+static int fix_unmerged_status(struct diff_filepair *p,
+ struct update_callback_data *data)
+{
+ if (p->status != DIFF_STATUS_UNMERGED)
+ return p->status;
+ if (!(data->flags & ADD_CACHE_IGNORE_REMOVAL) && !p->two->mode)
+ /*
+ * This is not an explicit add request, and the
+ * path is missing from the working tree (deleted)
+ */
+ return DIFF_STATUS_DELETED;
+ else
+ /*
+ * Either an explicit add request, or path exists
+ * in the working tree. An attempt to explicitly
+ * add a path that does not exist in the working tree
+ * will be caught as an error by the caller immediately.
+ */
+ return DIFF_STATUS_MODIFIED;
+}
+
+static void update_callback(struct diff_queue_struct *q,
+ struct diff_options *opt UNUSED, void *cbdata)
+{
+ int i;
+ struct update_callback_data *data = cbdata;
+
+ for (i = 0; i < q->nr; i++) {
+ struct diff_filepair *p = q->queue[i];
+ const char *path = p->one->path;
+
+ if (!data->include_sparse &&
+ !path_in_sparse_checkout(path, data->index))
+ continue;
+
+ switch (fix_unmerged_status(p, data)) {
+ default:
+ die(_("unexpected diff status %c"), p->status);
+ case DIFF_STATUS_MODIFIED:
+ case DIFF_STATUS_TYPE_CHANGED:
+ if (add_file_to_index(data->index, path, data->flags)) {
+ if (!(data->flags & ADD_CACHE_IGNORE_ERRORS))
+ die(_("updating files failed"));
+ data->add_errors++;
+ }
+ break;
+ case DIFF_STATUS_DELETED:
+ if (data->flags & ADD_CACHE_IGNORE_REMOVAL)
+ break;
+ if (!(data->flags & ADD_CACHE_PRETEND))
+ remove_file_from_index(data->index, path);
+ if (data->flags & (ADD_CACHE_PRETEND|ADD_CACHE_VERBOSE))
+ printf(_("remove '%s'\n"), path);
+ break;
+ }
+ }
+}
+
+int add_files_to_cache(struct repository *repo, const char *prefix,
+ const struct pathspec *pathspec, char *ps_matched,
+ int include_sparse, int flags)
+{
+ struct update_callback_data data;
+ struct rev_info rev;
+
+ memset(&data, 0, sizeof(data));
+ data.index = repo->index;
+ data.include_sparse = include_sparse;
+ data.flags = flags;
+
+ repo_init_revisions(repo, &rev, prefix);
+ setup_revisions(0, NULL, &rev, NULL);
+ if (pathspec) {
+ copy_pathspec(&rev.prune_data, pathspec);
+ rev.ps_matched = ps_matched;
+ }
+ rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;
+ rev.diffopt.format_callback = update_callback;
+ rev.diffopt.format_callback_data = &data;
+ rev.diffopt.flags.override_submodule_config = 1;
+ rev.max_count = 0; /* do not compare unmerged paths with stage #2 */
+
+ /*
+ * Use an ODB transaction to optimize adding multiple objects.
+ * This function is invoked from commands other than 'add', which
+ * may not have their own transaction active.
+ */
+ begin_odb_transaction();
+ run_diff_files(&rev, DIFF_RACY_IS_MODIFIED);
+ end_odb_transaction();
+
+ release_revisions(&rev);
+ return !!data.add_errors;
+}
diff --git a/read-cache.h b/read-cache.h
new file mode 100644
index 0000000..043da1f
--- /dev/null
+++ b/read-cache.h
@@ -0,0 +1,45 @@
+#ifndef READ_CACHE_H
+#define READ_CACHE_H
+
+#include "read-cache-ll.h"
+#include "object.h"
+#include "pathspec.h"
+
+static inline unsigned int ce_mode_from_stat(const struct cache_entry *ce,
+ unsigned int mode)
+{
+ extern int trust_executable_bit, has_symlinks;
+ if (!has_symlinks && S_ISREG(mode) &&
+ ce && S_ISLNK(ce->ce_mode))
+ return ce->ce_mode;
+ if (!trust_executable_bit && S_ISREG(mode)) {
+ if (ce && S_ISREG(ce->ce_mode))
+ return ce->ce_mode;
+ return create_ce_mode(0666);
+ }
+ return create_ce_mode(mode);
+}
+
+static inline int ce_to_dtype(const struct cache_entry *ce)
+{
+ unsigned ce_mode = ntohl(ce->ce_mode);
+ if (S_ISREG(ce_mode))
+ return DT_REG;
+ else if (S_ISDIR(ce_mode) || S_ISGITLINK(ce_mode))
+ return DT_DIR;
+ else if (S_ISLNK(ce_mode))
+ return DT_LNK;
+ else
+ return DT_UNKNOWN;
+}
+
+static inline int ce_path_match(struct index_state *istate,
+ const struct cache_entry *ce,
+ const struct pathspec *pathspec,
+ char *seen)
+{
+ return match_pathspec(istate, pathspec, ce->name, ce_namelen(ce), 0, seen,
+ S_ISDIR(ce->ce_mode) || S_ISGITLINK(ce->ce_mode));
+}
+
+#endif /* READ_CACHE_H */
diff --git a/rebase-interactive.c b/rebase-interactive.c
index 87649d0..c343e16 100644
--- a/rebase-interactive.c
+++ b/rebase-interactive.c
@@ -1,11 +1,16 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "commit.h"
+#include "editor.h"
+#include "environment.h"
+#include "gettext.h"
#include "sequencer.h"
#include "rebase-interactive.h"
+#include "repository.h"
#include "strbuf.h"
#include "commit-slab.h"
#include "config.h"
#include "dir.h"
+#include "object-name.h"
static const char edit_todo_list_advice[] =
N_("You can fix this with 'git rebase --edit-todo' "
@@ -54,22 +59,26 @@ void append_todo_help(int command_count,
"l, label <label> = label current HEAD with a name\n"
"t, reset <label> = reset HEAD to a label\n"
"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
-". create a merge commit using the original merge commit's\n"
-". message (or the oneline, if no original merge commit was\n"
-". specified); use -c <commit> to reword the commit message\n"
+" create a merge commit using the original merge commit's\n"
+" message (or the oneline, if no original merge commit was\n"
+" specified); use -c <commit> to reword the commit message\n"
+"u, update-ref <ref> = track a placeholder for the <ref> to be updated\n"
+" to this position in the new commits. The <ref> is\n"
+" updated at the end of the rebase\n"
"\n"
"These lines can be re-ordered; they are executed from top to bottom.\n");
unsigned edit_todo = !(shortrevisions && shortonto);
if (!edit_todo) {
strbuf_addch(buf, '\n');
- strbuf_commented_addf(buf, Q_("Rebase %s onto %s (%d command)",
- "Rebase %s onto %s (%d commands)",
- command_count),
+ strbuf_commented_addf(buf, comment_line_str,
+ Q_("Rebase %s onto %s (%d command)",
+ "Rebase %s onto %s (%d commands)",
+ command_count),
shortrevisions, shortonto, command_count);
}
- strbuf_add_commented_lines(buf, msg, strlen(msg));
+ strbuf_add_commented_lines(buf, msg, strlen(msg), comment_line_str);
if (get_missing_commit_check_level() == MISSING_COMMIT_CHECK_ERROR)
msg = _("\nDo not remove any line. Use 'drop' "
@@ -78,7 +87,7 @@ void append_todo_help(int command_count,
msg = _("\nIf you remove a line here "
"THAT COMMIT WILL BE LOST.\n");
- strbuf_add_commented_lines(buf, msg, strlen(msg));
+ strbuf_add_commented_lines(buf, msg, strlen(msg), comment_line_str);
if (edit_todo)
msg = _("\nYou are editing the todo file "
@@ -89,7 +98,7 @@ void append_todo_help(int command_count,
msg = _("\nHowever, if you remove everything, "
"the rebase will be aborted.\n\n");
- strbuf_add_commented_lines(buf, msg, strlen(msg));
+ strbuf_add_commented_lines(buf, msg, strlen(msg), comment_line_str);
}
int edit_todo_list(struct repository *r, struct todo_list *todo_list,
@@ -121,7 +130,7 @@ int edit_todo_list(struct repository *r, struct todo_list *todo_list,
if (launch_sequence_editor(todo_file, &new_todo->buf, NULL))
return -2;
- strbuf_stripspace(&new_todo->buf, 1);
+ strbuf_stripspace(&new_todo->buf, comment_line_str);
if (initial && new_todo->buf.len == 0)
return -3;
@@ -143,6 +152,12 @@ int edit_todo_list(struct repository *r, struct todo_list *todo_list,
return -4;
}
+ /*
+ * See if branches need to be added or removed from the update-refs
+ * file based on the new todo list.
+ */
+ todo_list_filter_update_refs(r, new_todo);
+
return 0;
}
@@ -178,7 +193,7 @@ int todo_list_check(struct todo_list *old_todo, struct todo_list *new_todo)
struct commit *commit = item->commit;
if (commit && !*commit_seen_at(&commit_seen, commit)) {
strbuf_addf(&missing, " - %s %.*s\n",
- find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV),
+ repo_find_unique_abbrev(the_repository, &commit->object.oid, DEFAULT_ABBREV),
item->arg_len,
todo_item_get_arg(old_todo, item));
*commit_seen_at(&commit_seen, commit) = 1;
diff --git a/rebase.c b/rebase.c
index 6775cdd..69a1822 100644
--- a/rebase.c
+++ b/rebase.c
@@ -1,5 +1,6 @@
+#include "git-compat-util.h"
#include "rebase.h"
-#include "config.h"
+#include "parse.h"
#include "gettext.h"
/*
diff --git a/ref-filter.c b/ref-filter.c
index d3c90e5..59ad6f5 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -1,11 +1,20 @@
-#include "builtin.h"
-#include "cache.h"
+#include "git-compat-util.h"
+#include "environment.h"
+#include "gettext.h"
+#include "config.h"
+#include "gpg-interface.h"
+#include "hex.h"
#include "parse-options.h"
+#include "run-command.h"
#include "refs.h"
#include "wildmatch.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "oid-array.h"
#include "repository.h"
#include "commit.h"
+#include "mailmap.h"
+#include "ident.h"
#include "remote.h"
#include "color.h"
#include "tag.h"
@@ -13,16 +22,13 @@
#include "ref-filter.h"
#include "revision.h"
#include "utf8.h"
-#include "git-compat-util.h"
-#include "version.h"
+#include "versioncmp.h"
#include "trailer.h"
#include "wt-status.h"
#include "commit-slab.h"
-#include "commit-graph.h"
#include "commit-reach.h"
#include "worktree.h"
#include "hashmap.h"
-#include "strvec.h"
static struct ref_msg {
const char *gone;
@@ -89,7 +95,7 @@ struct ref_to_worktree_entry {
struct worktree *wt; /* key is wt->head_ref */
};
-static int ref_to_worktree_map_cmpfnc(const void *unused_lookupdata,
+static int ref_to_worktree_map_cmpfnc(const void *lookupdata UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *kptr,
const void *keydata_aka_refname)
@@ -140,10 +146,12 @@ enum atom_type {
ATOM_TAGGERDATE,
ATOM_CREATOR,
ATOM_CREATORDATE,
+ ATOM_DESCRIBE,
ATOM_SUBJECT,
ATOM_BODY,
ATOM_TRAILERS,
ATOM_CONTENTS,
+ ATOM_SIGNATURE,
ATOM_RAW,
ATOM_UPSTREAM,
ATOM_PUSH,
@@ -158,6 +166,7 @@ enum atom_type {
ATOM_THEN,
ATOM_ELSE,
ATOM_REST,
+ ATOM_AHEADBEHIND,
};
/*
@@ -205,9 +214,22 @@ static struct used_atom {
struct {
enum { O_SIZE, O_SIZE_DISK } option;
} objectsize;
- struct email_option {
- enum { EO_RAW, EO_TRIM, EO_LOCALPART } option;
+ struct {
+ enum { N_RAW, N_MAILMAP } option;
+ } name_option;
+ struct {
+ enum {
+ EO_RAW = 0,
+ EO_TRIM = 1<<0,
+ EO_LOCALPART = 1<<1,
+ EO_MAILMAP = 1<<2,
+ } option;
} email_option;
+ struct {
+ enum { S_BARE, S_GRADE, S_SIGNER, S_KEY,
+ S_FINGERPRINT, S_PRI_KEY_FP, S_TRUST_LEVEL } option;
+ } signature;
+ const char **describe_args;
struct refname_atom refname;
char *head;
} u;
@@ -228,6 +250,126 @@ static int strbuf_addf_ret(struct strbuf *sb, int ret, const char *fmt, ...)
return ret;
}
+static int err_no_arg(struct strbuf *sb, const char *name)
+{
+ size_t namelen = strchrnul(name, ':') - name;
+ strbuf_addf(sb, _("%%(%.*s) does not take arguments"),
+ (int)namelen, name);
+ return -1;
+}
+
+static int err_bad_arg(struct strbuf *sb, const char *name, const char *arg)
+{
+ size_t namelen = strchrnul(name, ':') - name;
+ strbuf_addf(sb, _("unrecognized %%(%.*s) argument: %s"),
+ (int)namelen, name, arg);
+ return -1;
+}
+
+/*
+ * Parse option of name "candidate" in the option string "to_parse" of
+ * the form
+ *
+ * "candidate1[=val1],candidate2[=val2],candidate3[=val3],..."
+ *
+ * The remaining part of "to_parse" is stored in "end" (if we are
+ * parsing the last candidate, then this is NULL) and the value of
+ * the candidate is stored in "valuestart" and its length in "valuelen",
+ * that is the portion after "=". Since it is possible for a "candidate"
+ * to not have a value, in such cases, "valuestart" is set to point to
+ * NULL and "valuelen" to 0.
+ *
+ * The function returns 1 on success. It returns 0 if we don't find
+ * "candidate" in "to_parse" or we find "candidate" but it is followed
+ * by more chars (for example, "candidatefoo"), that is, we don't find
+ * an exact match.
+ *
+ * This function only does the above for one "candidate" at a time. So
+ * it has to be called each time trying to parse a "candidate" in the
+ * option string "to_parse".
+ */
+static int match_atom_arg_value(const char *to_parse, const char *candidate,
+ const char **end, const char **valuestart,
+ size_t *valuelen)
+{
+ const char *atom;
+
+ if (!skip_prefix(to_parse, candidate, &atom))
+ return 0; /* definitely not "candidate" */
+
+ if (*atom == '=') {
+ /* we just saw "candidate=" */
+ *valuestart = atom + 1;
+ atom = strchrnul(*valuestart, ',');
+ *valuelen = atom - *valuestart;
+ } else if (*atom != ',' && *atom != '\0') {
+ /* key begins with "candidate" but has more chars */
+ return 0;
+ } else {
+ /* just "candidate" without "=val" */
+ *valuestart = NULL;
+ *valuelen = 0;
+ }
+
+ /* atom points at either the ',' or NUL after this key[=val] */
+ if (*atom == ',')
+ atom++;
+ else if (*atom)
+ BUG("Why is *atom not NULL yet?");
+
+ *end = atom;
+ return 1;
+}
+
+/*
+ * Parse boolean option of name "candidate" in the option list "to_parse"
+ * of the form
+ *
+ * "candidate1[=bool1],candidate2[=bool2],candidate3[=bool3],..."
+ *
+ * The remaining part of "to_parse" is stored in "end" (if we are parsing
+ * the last candidate, then this is NULL) and the value (if given) is
+ * parsed and stored in "val", so "val" always points to either 0 or 1.
+ * If the value is not given, then "val" is set to point to 1.
+ *
+ * The boolean value is parsed using "git_parse_maybe_bool()", so the
+ * accepted values are
+ *
+ * to set true - "1", "yes", "true"
+ * to set false - "0", "no", "false"
+ *
+ * This function returns 1 on success. It returns 0 when we don't find
+ * an exact match for "candidate" or when the boolean value given is
+ * not valid.
+ */
+static int match_atom_bool_arg(const char *to_parse, const char *candidate,
+ const char **end, int *val)
+{
+ const char *argval;
+ char *strval;
+ size_t arglen;
+ int v;
+
+ if (!match_atom_arg_value(to_parse, candidate, end, &argval, &arglen))
+ return 0;
+
+ if (!argval) {
+ *val = 1;
+ return 1;
+ }
+
+ strval = xstrndup(argval, arglen);
+ v = git_parse_maybe_bool(strval);
+ free(strval);
+
+ if (v == -1)
+ return 0;
+
+ *val = v;
+
+ return 1;
+}
+
static int color_atom_parser(struct ref_format *format, struct used_atom *atom,
const char *color_value, struct strbuf *err)
{
@@ -262,11 +404,12 @@ static int refname_atom_parser_internal(struct refname_atom *atom, const char *a
if (strtol_i(arg, 10, &atom->rstrip))
return strbuf_addf_ret(err, -1, _("Integer value expected refname:rstrip=%s"), arg);
} else
- return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), name, arg);
+ return err_bad_arg(err, name, arg);
return 0;
}
-static int remote_ref_atom_parser(struct ref_format *format, struct used_atom *atom,
+static int remote_ref_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
const char *arg, struct strbuf *err)
{
struct string_list params = STRING_LIST_INIT_DUP;
@@ -313,11 +456,12 @@ static int remote_ref_atom_parser(struct ref_format *format, struct used_atom *a
return 0;
}
-static int objecttype_atom_parser(struct ref_format *format, struct used_atom *atom,
+static int objecttype_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
const char *arg, struct strbuf *err)
{
if (arg)
- return strbuf_addf_ret(err, -1, _("%%(objecttype) does not take arguments"));
+ return err_no_arg(err, "objecttype");
if (*atom->name == '*')
oi_deref.info.typep = &oi_deref.type;
else
@@ -325,7 +469,8 @@ static int objecttype_atom_parser(struct ref_format *format, struct used_atom *a
return 0;
}
-static int objectsize_atom_parser(struct ref_format *format, struct used_atom *atom,
+static int objectsize_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
const char *arg, struct strbuf *err)
{
if (!arg) {
@@ -341,15 +486,16 @@ static int objectsize_atom_parser(struct ref_format *format, struct used_atom *a
else
oi.info.disk_sizep = &oi.disk_size;
} else
- return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "objectsize", arg);
+ return err_bad_arg(err, "objectsize", arg);
return 0;
}
-static int deltabase_atom_parser(struct ref_format *format, struct used_atom *atom,
+static int deltabase_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
const char *arg, struct strbuf *err)
{
if (arg)
- return strbuf_addf_ret(err, -1, _("%%(deltabase) does not take arguments"));
+ return err_no_arg(err, "deltabase");
if (*atom->name == '*')
oi_deref.info.delta_base_oid = &oi_deref.delta_base_oid;
else
@@ -357,16 +503,18 @@ static int deltabase_atom_parser(struct ref_format *format, struct used_atom *at
return 0;
}
-static int body_atom_parser(struct ref_format *format, struct used_atom *atom,
+static int body_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
const char *arg, struct strbuf *err)
{
if (arg)
- return strbuf_addf_ret(err, -1, _("%%(body) does not take arguments"));
+ return err_no_arg(err, "body");
atom->u.contents.option = C_BODY_DEP;
return 0;
}
-static int subject_atom_parser(struct ref_format *format, struct used_atom *atom,
+static int subject_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
const char *arg, struct strbuf *err)
{
if (!arg)
@@ -374,11 +522,42 @@ static int subject_atom_parser(struct ref_format *format, struct used_atom *atom
else if (!strcmp(arg, "sanitize"))
atom->u.contents.option = C_SUB_SANITIZE;
else
- return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "subject", arg);
+ return err_bad_arg(err, "subject", arg);
+ return 0;
+}
+
+static int parse_signature_option(const char *arg)
+{
+ if (!arg)
+ return S_BARE;
+ else if (!strcmp(arg, "signer"))
+ return S_SIGNER;
+ else if (!strcmp(arg, "grade"))
+ return S_GRADE;
+ else if (!strcmp(arg, "key"))
+ return S_KEY;
+ else if (!strcmp(arg, "fingerprint"))
+ return S_FINGERPRINT;
+ else if (!strcmp(arg, "primarykeyfingerprint"))
+ return S_PRI_KEY_FP;
+ else if (!strcmp(arg, "trustlevel"))
+ return S_TRUST_LEVEL;
+ return -1;
+}
+
+static int signature_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
+ const char *arg, struct strbuf *err)
+{
+ int opt = parse_signature_option(arg);
+ if (opt < 0)
+ return err_bad_arg(err, "signature", arg);
+ atom->u.signature.option = opt;
return 0;
}
-static int trailers_atom_parser(struct ref_format *format, struct used_atom *atom,
+static int trailers_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
const char *arg, struct strbuf *err)
{
atom->u.contents.trailer_opts.no_divider = 1;
@@ -411,9 +590,10 @@ static int contents_atom_parser(struct ref_format *format, struct used_atom *ato
atom->u.contents.option = C_BARE;
else if (!strcmp(arg, "body"))
atom->u.contents.option = C_BODY;
- else if (!strcmp(arg, "size"))
+ else if (!strcmp(arg, "size")) {
+ atom->type = FIELD_ULONG;
atom->u.contents.option = C_LENGTH;
- else if (!strcmp(arg, "signature"))
+ } else if (!strcmp(arg, "signature"))
atom->u.contents.option = C_SIG;
else if (!strcmp(arg, "subject"))
atom->u.contents.option = C_SUB;
@@ -428,23 +608,107 @@ static int contents_atom_parser(struct ref_format *format, struct used_atom *ato
if (strtoul_ui(arg, 10, &atom->u.contents.nlines))
return strbuf_addf_ret(err, -1, _("positive value expected contents:lines=%s"), arg);
} else
- return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "contents", arg);
+ return err_bad_arg(err, "contents", arg);
+ return 0;
+}
+
+static int describe_atom_option_parser(struct strvec *args, const char **arg,
+ struct strbuf *err)
+{
+ const char *argval;
+ size_t arglen = 0;
+ int optval = 0;
+
+ if (match_atom_bool_arg(*arg, "tags", arg, &optval)) {
+ if (!optval)
+ strvec_push(args, "--no-tags");
+ else
+ strvec_push(args, "--tags");
+ return 1;
+ }
+
+ if (match_atom_arg_value(*arg, "abbrev", arg, &argval, &arglen)) {
+ char *endptr;
+
+ if (!arglen)
+ return strbuf_addf_ret(err, -1,
+ _("argument expected for %s"),
+ "describe:abbrev");
+ if (strtol(argval, &endptr, 10) < 0)
+ return strbuf_addf_ret(err, -1,
+ _("positive value expected %s=%s"),
+ "describe:abbrev", argval);
+ if (endptr - argval != arglen)
+ return strbuf_addf_ret(err, -1,
+ _("cannot fully parse %s=%s"),
+ "describe:abbrev", argval);
+
+ strvec_pushf(args, "--abbrev=%.*s", (int)arglen, argval);
+ return 1;
+ }
+
+ if (match_atom_arg_value(*arg, "match", arg, &argval, &arglen)) {
+ if (!arglen)
+ return strbuf_addf_ret(err, -1,
+ _("value expected %s="),
+ "describe:match");
+
+ strvec_pushf(args, "--match=%.*s", (int)arglen, argval);
+ return 1;
+ }
+
+ if (match_atom_arg_value(*arg, "exclude", arg, &argval, &arglen)) {
+ if (!arglen)
+ return strbuf_addf_ret(err, -1,
+ _("value expected %s="),
+ "describe:exclude");
+
+ strvec_pushf(args, "--exclude=%.*s", (int)arglen, argval);
+ return 1;
+ }
+
return 0;
}
-static int raw_atom_parser(struct ref_format *format, struct used_atom *atom,
+static int describe_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
const char *arg, struct strbuf *err)
{
+ struct strvec args = STRVEC_INIT;
+
+ for (;;) {
+ int found = 0;
+ const char *bad_arg = arg;
+
+ if (!arg || !*arg)
+ break;
+
+ found = describe_atom_option_parser(&args, &arg, err);
+ if (found < 0)
+ return found;
+ if (!found)
+ return err_bad_arg(err, "describe", bad_arg);
+ }
+ atom->u.describe_args = strvec_detach(&args);
+ return 0;
+}
+
+static int raw_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
+ const char *arg, struct strbuf *err)
+{
if (!arg)
atom->u.raw_data.option = RAW_BARE;
- else if (!strcmp(arg, "size"))
+ else if (!strcmp(arg, "size")) {
+ atom->type = FIELD_ULONG;
atom->u.raw_data.option = RAW_LENGTH;
- else
- return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "raw", arg);
+ } else
+ return err_bad_arg(err, "raw", arg);
return 0;
}
-static int oid_atom_parser(struct ref_format *format, struct used_atom *atom,
+static int oid_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
const char *arg, struct strbuf *err)
{
if (!arg)
@@ -459,25 +723,61 @@ static int oid_atom_parser(struct ref_format *format, struct used_atom *atom,
if (atom->u.oid.length < MINIMUM_ABBREV)
atom->u.oid.length = MINIMUM_ABBREV;
} else
- return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), atom->name, arg);
+ return err_bad_arg(err, atom->name, arg);
return 0;
}
-static int person_email_atom_parser(struct ref_format *format, struct used_atom *atom,
- const char *arg, struct strbuf *err)
+static int person_name_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
+ const char *arg, struct strbuf *err)
{
if (!arg)
- atom->u.email_option.option = EO_RAW;
- else if (!strcmp(arg, "trim"))
- atom->u.email_option.option = EO_TRIM;
- else if (!strcmp(arg, "localpart"))
- atom->u.email_option.option = EO_LOCALPART;
+ atom->u.name_option.option = N_RAW;
+ else if (!strcmp(arg, "mailmap"))
+ atom->u.name_option.option = N_MAILMAP;
else
- return strbuf_addf_ret(err, -1, _("unrecognized email option: %s"), arg);
+ return err_bad_arg(err, atom->name, arg);
return 0;
}
-static int refname_atom_parser(struct ref_format *format, struct used_atom *atom,
+static int email_atom_option_parser(struct used_atom *atom,
+ const char **arg, struct strbuf *err)
+{
+ if (!*arg)
+ return EO_RAW;
+ if (skip_prefix(*arg, "trim", arg))
+ return EO_TRIM;
+ if (skip_prefix(*arg, "localpart", arg))
+ return EO_LOCALPART;
+ if (skip_prefix(*arg, "mailmap", arg))
+ return EO_MAILMAP;
+ return -1;
+}
+
+static int person_email_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
+ const char *arg, struct strbuf *err)
+{
+ for (;;) {
+ int opt = email_atom_option_parser(atom, &arg, err);
+ const char *bad_arg = arg;
+
+ if (opt < 0)
+ return err_bad_arg(err, atom->name, bad_arg);
+ atom->u.email_option.option |= opt;
+
+ if (!arg || !*arg)
+ break;
+ if (*arg == ',')
+ arg++;
+ else
+ return err_bad_arg(err, atom->name, bad_arg);
+ }
+ return 0;
+}
+
+static int refname_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
const char *arg, struct strbuf *err)
{
return refname_atom_parser_internal(&atom->u.refname, arg, atom->name, err);
@@ -494,7 +794,8 @@ static align_type parse_align_position(const char *s)
return -1;
}
-static int align_atom_parser(struct ref_format *format, struct used_atom *atom,
+static int align_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
const char *arg, struct strbuf *err)
{
struct align *align = &atom->u.align;
@@ -546,7 +847,8 @@ static int align_atom_parser(struct ref_format *format, struct used_atom *atom,
return 0;
}
-static int if_atom_parser(struct ref_format *format, struct used_atom *atom,
+static int if_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
const char *arg, struct strbuf *err)
{
if (!arg) {
@@ -557,22 +859,42 @@ static int if_atom_parser(struct ref_format *format, struct used_atom *atom,
} else if (skip_prefix(arg, "notequals=", &atom->u.if_then_else.str)) {
atom->u.if_then_else.cmp_status = COMPARE_UNEQUAL;
} else
- return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "if", arg);
+ return err_bad_arg(err, "if", arg);
return 0;
}
-static int rest_atom_parser(struct ref_format *format, struct used_atom *atom,
+static int rest_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom UNUSED,
const char *arg, struct strbuf *err)
{
if (arg)
- return strbuf_addf_ret(err, -1, _("%%(rest) does not take arguments"));
- format->use_rest = 1;
+ return err_no_arg(err, "rest");
return 0;
}
-static int head_atom_parser(struct ref_format *format, struct used_atom *atom,
- const char *arg, struct strbuf *unused_err)
+static int ahead_behind_atom_parser(struct ref_format *format,
+ struct used_atom *atom UNUSED,
+ 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)
+ die("failed to find '%s'", arg);
+
+ return 0;
+}
+
+static int head_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
+ const char *arg, struct strbuf *err)
+{
+ if (arg)
+ return err_no_arg(err, "HEAD");
atom->u.head = resolve_refdup("HEAD", RESOLVE_REF_READING, NULL, NULL);
return 0;
}
@@ -596,23 +918,25 @@ static struct {
[ATOM_TYPE] = { "type", SOURCE_OBJ },
[ATOM_TAG] = { "tag", SOURCE_OBJ },
[ATOM_AUTHOR] = { "author", SOURCE_OBJ },
- [ATOM_AUTHORNAME] = { "authorname", SOURCE_OBJ },
+ [ATOM_AUTHORNAME] = { "authorname", SOURCE_OBJ, FIELD_STR, person_name_atom_parser },
[ATOM_AUTHOREMAIL] = { "authoremail", SOURCE_OBJ, FIELD_STR, person_email_atom_parser },
[ATOM_AUTHORDATE] = { "authordate", SOURCE_OBJ, FIELD_TIME },
[ATOM_COMMITTER] = { "committer", SOURCE_OBJ },
- [ATOM_COMMITTERNAME] = { "committername", SOURCE_OBJ },
+ [ATOM_COMMITTERNAME] = { "committername", SOURCE_OBJ, FIELD_STR, person_name_atom_parser },
[ATOM_COMMITTEREMAIL] = { "committeremail", SOURCE_OBJ, FIELD_STR, person_email_atom_parser },
[ATOM_COMMITTERDATE] = { "committerdate", SOURCE_OBJ, FIELD_TIME },
[ATOM_TAGGER] = { "tagger", SOURCE_OBJ },
- [ATOM_TAGGERNAME] = { "taggername", SOURCE_OBJ },
+ [ATOM_TAGGERNAME] = { "taggername", SOURCE_OBJ, FIELD_STR, person_name_atom_parser },
[ATOM_TAGGEREMAIL] = { "taggeremail", SOURCE_OBJ, FIELD_STR, person_email_atom_parser },
[ATOM_TAGGERDATE] = { "taggerdate", SOURCE_OBJ, FIELD_TIME },
[ATOM_CREATOR] = { "creator", SOURCE_OBJ },
[ATOM_CREATORDATE] = { "creatordate", SOURCE_OBJ, FIELD_TIME },
+ [ATOM_DESCRIBE] = { "describe", SOURCE_OBJ, FIELD_STR, describe_atom_parser },
[ATOM_SUBJECT] = { "subject", SOURCE_OBJ, FIELD_STR, subject_atom_parser },
[ATOM_BODY] = { "body", SOURCE_OBJ, FIELD_STR, body_atom_parser },
[ATOM_TRAILERS] = { "trailers", SOURCE_OBJ, FIELD_STR, trailers_atom_parser },
[ATOM_CONTENTS] = { "contents", SOURCE_OBJ, FIELD_STR, contents_atom_parser },
+ [ATOM_SIGNATURE] = { "signature", SOURCE_OBJ, FIELD_STR, signature_atom_parser },
[ATOM_RAW] = { "raw", SOURCE_OBJ, FIELD_STR, raw_atom_parser },
[ATOM_UPSTREAM] = { "upstream", SOURCE_NONE, FIELD_STR, remote_ref_atom_parser },
[ATOM_PUSH] = { "push", SOURCE_NONE, FIELD_STR, remote_ref_atom_parser },
@@ -627,6 +951,7 @@ static struct {
[ATOM_THEN] = { "then", SOURCE_NONE },
[ATOM_ELSE] = { "else", SOURCE_NONE },
[ATOM_REST] = { "rest", SOURCE_NONE, FIELD_STR, rest_atom_parser },
+ [ATOM_AHEADBEHIND] = { "ahead-behind", SOURCE_OTHER, FIELD_STR, ahead_behind_atom_parser },
/*
* Please update $__git_ref_fieldlist in git-completion.bash
* when you add new atoms
@@ -773,7 +1098,7 @@ static void quote_formatting(struct strbuf *s, const char *str, ssize_t len, int
}
static int append_atom(struct atom_value *v, struct ref_formatting_state *state,
- struct strbuf *unused_err)
+ struct strbuf *err UNUSED)
{
/*
* Quote formatting is only done when the stack has a single
@@ -823,7 +1148,7 @@ static void end_align_handler(struct ref_formatting_stack **stack)
}
static int align_atom_handler(struct atom_value *atomv, struct ref_formatting_state *state,
- struct strbuf *unused_err)
+ struct strbuf *err UNUSED)
{
struct ref_formatting_stack *new_stack;
@@ -870,7 +1195,7 @@ static void if_then_else_handler(struct ref_formatting_stack **stack)
}
static int if_atom_handler(struct atom_value *atomv, struct ref_formatting_state *state,
- struct strbuf *unused_err)
+ struct strbuf *err UNUSED)
{
struct ref_formatting_stack *new_stack;
struct if_then_else *if_then_else = xcalloc(1,
@@ -897,7 +1222,8 @@ static int is_empty(struct strbuf *buf)
return cur == end;
}
-static int then_atom_handler(struct atom_value *atomv, struct ref_formatting_state *state,
+static int then_atom_handler(struct atom_value *atomv UNUSED,
+ struct ref_formatting_state *state,
struct strbuf *err)
{
struct ref_formatting_stack *cur = state->stack;
@@ -934,7 +1260,8 @@ static int then_atom_handler(struct atom_value *atomv, struct ref_formatting_sta
return 0;
}
-static int else_atom_handler(struct atom_value *atomv, struct ref_formatting_state *state,
+static int else_atom_handler(struct atom_value *atomv UNUSED,
+ struct ref_formatting_state *state,
struct strbuf *err)
{
struct ref_formatting_stack *prev = state->stack;
@@ -955,7 +1282,8 @@ static int else_atom_handler(struct atom_value *atomv, struct ref_formatting_sta
return 0;
}
-static int end_atom_handler(struct atom_value *atomv, struct ref_formatting_state *state,
+static int end_atom_handler(struct atom_value *atomv UNUSED,
+ struct ref_formatting_state *state,
struct strbuf *err)
{
struct ref_formatting_stack *current = state->stack;
@@ -1057,9 +1385,11 @@ static const char *do_grab_oid(const char *field, const struct object_id *oid,
case O_FULL:
return oid_to_hex(oid);
case O_LENGTH:
- return find_unique_abbrev(oid, atom->u.oid.length);
+ return repo_find_unique_abbrev(the_repository, oid,
+ atom->u.oid.length);
case O_SHORT:
- return find_unique_abbrev(oid, DEFAULT_ABBREV);
+ return repo_find_unique_abbrev(the_repository, oid,
+ DEFAULT_ABBREV);
default:
BUG("unknown %%(%s) option", field);
}
@@ -1191,38 +1521,55 @@ static const char *copy_name(const char *buf)
{
const char *cp;
for (cp = buf; *cp && *cp != '\n'; cp++) {
- if (!strncmp(cp, " <", 2))
+ if (starts_with(cp, " <"))
return xmemdupz(buf, cp - buf);
}
return xstrdup("");
}
+static const char *find_end_of_email(const char *email, int opt)
+{
+ const char *eoemail;
+
+ if (opt & EO_LOCALPART) {
+ eoemail = strchr(email, '@');
+ if (eoemail)
+ return eoemail;
+ return strchr(email, '>');
+ }
+
+ if (opt & EO_TRIM)
+ return strchr(email, '>');
+
+ /*
+ * The option here is either the raw email option or the raw
+ * mailmap option (that is EO_RAW or EO_MAILMAP). In such cases,
+ * we directly grab the whole email including the closing
+ * angle brackets.
+ *
+ * If EO_MAILMAP was set with any other option (that is either
+ * EO_TRIM or EO_LOCALPART), we already grab the end of email
+ * above.
+ */
+ eoemail = strchr(email, '>');
+ if (eoemail)
+ eoemail++;
+ return eoemail;
+}
+
static const char *copy_email(const char *buf, struct used_atom *atom)
{
const char *email = strchr(buf, '<');
const char *eoemail;
+ int opt = atom->u.email_option.option;
+
if (!email)
return xstrdup("");
- switch (atom->u.email_option.option) {
- case EO_RAW:
- eoemail = strchr(email, '>');
- if (eoemail)
- eoemail++;
- break;
- case EO_TRIM:
- email++;
- eoemail = strchr(email, '>');
- break;
- case EO_LOCALPART:
+
+ if (opt & (EO_LOCALPART | EO_TRIM))
email++;
- eoemail = strchr(email, '@');
- if (!eoemail)
- eoemail = strchr(email, '>');
- break;
- default:
- BUG("unknown email option");
- }
+ eoemail = find_end_of_email(email, opt);
if (!eoemail)
return xstrdup("");
return xmemdupz(email, eoemail - email);
@@ -1264,6 +1611,12 @@ static void grab_date(const char *buf, struct atom_value *v, const char *atomnam
if (formatp) {
formatp++;
parse_date_format(formatp, &date_mode);
+
+ /*
+ * If this is a sort field and a format was specified, we'll
+ * want to compare formatted date by string value.
+ */
+ v->atom->type = FIELD_STR;
}
if (!eoemail)
@@ -1274,7 +1627,7 @@ static void grab_date(const char *buf, struct atom_value *v, const char *atomnam
tz = strtol(zone, NULL, 10);
if ((tz == LONG_MIN || tz == LONG_MAX) && errno == ERANGE)
goto bad;
- v->s = xstrdup(show_date(timestamp, tz, &date_mode));
+ v->s = xstrdup(show_date(timestamp, tz, date_mode));
v->value = timestamp;
date_mode_release(&date_mode);
return;
@@ -1283,16 +1636,23 @@ static void grab_date(const char *buf, struct atom_value *v, const char *atomnam
v->value = 0;
}
+static struct string_list mailmap = STRING_LIST_INIT_NODUP;
+
/* See grab_values */
static void grab_person(const char *who, struct atom_value *val, int deref, void *buf)
{
int i;
int wholen = strlen(who);
const char *wholine = NULL;
+ const char *headers[] = { "author ", "committer ",
+ "tagger ", NULL };
for (i = 0; i < used_atom_cnt; i++) {
- const char *name = used_atom[i].name;
+ struct used_atom *atom = &used_atom[i];
+ const char *name = atom->name;
struct atom_value *v = &val[i];
+ struct strbuf mailmap_buf = STRBUF_INIT;
+
if (!!deref != (*name == '*'))
continue;
if (deref)
@@ -1300,22 +1660,36 @@ static void grab_person(const char *who, struct atom_value *val, int deref, void
if (strncmp(who, name, wholen))
continue;
if (name[wholen] != 0 &&
- strcmp(name + wholen, "name") &&
+ !starts_with(name + wholen, "name") &&
!starts_with(name + wholen, "email") &&
!starts_with(name + wholen, "date"))
continue;
- if (!wholine)
+
+ if ((starts_with(name + wholen, "name") &&
+ (atom->u.name_option.option == N_MAILMAP)) ||
+ (starts_with(name + wholen, "email") &&
+ (atom->u.email_option.option & EO_MAILMAP))) {
+ if (!mailmap.items)
+ read_mailmap(&mailmap);
+ strbuf_addstr(&mailmap_buf, buf);
+ apply_mailmap_to_header(&mailmap_buf, headers, &mailmap);
+ wholine = find_wholine(who, wholen, mailmap_buf.buf);
+ } else {
wholine = find_wholine(who, wholen, buf);
+ }
+
if (!wholine)
return; /* no point looking for it */
if (name[wholen] == 0)
v->s = copy_line(wholine);
- else if (!strcmp(name + wholen, "name"))
+ else if (starts_with(name + wholen, "name"))
v->s = copy_name(wholine);
else if (starts_with(name + wholen, "email"))
v->s = copy_email(wholine, &used_atom[i]);
else if (starts_with(name + wholen, "date"))
grab_date(wholine, v, name);
+
+ strbuf_release(&mailmap_buf);
}
/*
@@ -1344,6 +1718,92 @@ static void grab_person(const char *who, struct atom_value *val, int deref, void
}
}
+static void grab_signature(struct atom_value *val, int deref, struct object *obj)
+{
+ int i;
+ struct commit *commit = (struct commit *) obj;
+ struct signature_check sigc = { 0 };
+ int signature_checked = 0;
+
+ for (i = 0; i < used_atom_cnt; i++) {
+ struct used_atom *atom = &used_atom[i];
+ const char *name = atom->name;
+ struct atom_value *v = &val[i];
+ int opt;
+
+ if (!!deref != (*name == '*'))
+ continue;
+ if (deref)
+ name++;
+
+ if (!skip_prefix(name, "signature", &name) ||
+ (*name && *name != ':'))
+ continue;
+ if (!*name)
+ name = NULL;
+ else
+ name++;
+
+ opt = parse_signature_option(name);
+ if (opt < 0)
+ continue;
+
+ if (!signature_checked) {
+ check_commit_signature(commit, &sigc);
+ signature_checked = 1;
+ }
+
+ switch (opt) {
+ case S_BARE:
+ v->s = xstrdup(sigc.output ? sigc.output: "");
+ break;
+ case S_SIGNER:
+ v->s = xstrdup(sigc.signer ? sigc.signer : "");
+ break;
+ case S_GRADE:
+ switch (sigc.result) {
+ case 'G':
+ switch (sigc.trust_level) {
+ case TRUST_UNDEFINED:
+ case TRUST_NEVER:
+ v->s = xstrfmt("%c", (char)'U');
+ break;
+ default:
+ v->s = xstrfmt("%c", (char)'G');
+ break;
+ }
+ break;
+ case 'B':
+ case 'E':
+ case 'N':
+ case 'X':
+ case 'Y':
+ case 'R':
+ v->s = xstrfmt("%c", (char)sigc.result);
+ break;
+ }
+ break;
+ case S_KEY:
+ v->s = xstrdup(sigc.key ? sigc.key : "");
+ break;
+ case S_FINGERPRINT:
+ v->s = xstrdup(sigc.fingerprint ?
+ sigc.fingerprint : "");
+ break;
+ case S_PRI_KEY_FP:
+ v->s = xstrdup(sigc.primary_key_fingerprint ?
+ sigc.primary_key_fingerprint : "");
+ break;
+ case S_TRUST_LEVEL:
+ v->s = xstrdup(gpg_trust_level_to_str(sigc.trust_level));
+ break;
+ }
+ }
+
+ if (signature_checked)
+ signature_check_clear(&sigc);
+}
+
static void find_subpos(const char *buf,
const char **sub, size_t *sublen,
const char **body, size_t *bodylen,
@@ -1358,6 +1818,7 @@ static void find_subpos(const char *buf,
/* parse signature first; we might not even have a subject line */
parse_signature(buf, end - buf, &payload, &signature);
+ strbuf_release(&payload);
/* skip past header until we hit empty line */
while (*buf && *buf != '\n') {
@@ -1375,12 +1836,12 @@ static void find_subpos(const char *buf,
/* subject is first non-empty line */
*sub = buf;
/* subject goes to first empty line before signature begins */
- if ((eol = strstr(*sub, "\n\n"))) {
+ if ((eol = strstr(*sub, "\n\n")) ||
+ (eol = strstr(*sub, "\r\n\r\n"))) {
eol = eol < sigstart ? eol : sigstart;
- /* check if message uses CRLF */
- } else if (! (eol = strstr(*sub, "\r\n\r\n"))) {
+ } else {
/* treat whole message as subject */
- eol = strrchr(*sub, '\0');
+ eol = sigstart;
}
buf = eol;
*sublen = buf - *sub;
@@ -1421,6 +1882,44 @@ static void append_lines(struct strbuf *out, const char *buf, unsigned long size
}
}
+static void grab_describe_values(struct atom_value *val, int deref,
+ struct object *obj)
+{
+ struct commit *commit = (struct commit *)obj;
+ int i;
+
+ for (i = 0; i < used_atom_cnt; i++) {
+ struct used_atom *atom = &used_atom[i];
+ enum atom_type type = atom->atom_type;
+ const char *name = atom->name;
+ struct atom_value *v = &val[i];
+
+ struct child_process cmd = CHILD_PROCESS_INIT;
+ struct strbuf out = STRBUF_INIT;
+ struct strbuf err = STRBUF_INIT;
+
+ if (type != ATOM_DESCRIBE)
+ continue;
+
+ if (!!deref != (*name == '*'))
+ continue;
+
+ cmd.git_cmd = 1;
+ strvec_push(&cmd.args, "describe");
+ strvec_pushv(&cmd.args, atom->u.describe_args);
+ strvec_push(&cmd.args, oid_to_hex(&commit->object.oid));
+ if (pipe_command(&cmd, NULL, 0, &out, 0, &err, 0) < 0) {
+ error(_("failed to run 'describe'"));
+ v->s = xstrdup("");
+ continue;
+ }
+ strbuf_rtrim(&out);
+ v->s = strbuf_detach(&out, NULL);
+
+ strbuf_release(&err);
+ }
+}
+
/* See grab_values */
static void grab_sub_body_contents(struct atom_value *val, int deref, struct expand_data *data)
{
@@ -1447,7 +1946,8 @@ static void grab_sub_body_contents(struct atom_value *val, int deref, struct exp
v->s = xmemdupz(buf, buf_size);
v->s_size = buf_size;
} else if (atom->u.raw_data.option == RAW_LENGTH) {
- v->s = xstrfmt("%"PRIuMAX, (uintmax_t)buf_size);
+ v->value = buf_size;
+ v->s = xstrfmt("%"PRIuMAX, v->value);
}
continue;
}
@@ -1473,9 +1973,10 @@ static void grab_sub_body_contents(struct atom_value *val, int deref, struct exp
v->s = strbuf_detach(&sb, NULL);
} else if (atom->u.contents.option == C_BODY_DEP)
v->s = xmemdupz(bodypos, bodylen);
- else if (atom->u.contents.option == C_LENGTH)
- v->s = xstrfmt("%"PRIuMAX, (uintmax_t)strlen(subpos));
- else if (atom->u.contents.option == C_BODY)
+ else if (atom->u.contents.option == C_LENGTH) {
+ v->value = strlen(subpos);
+ v->s = xstrfmt("%"PRIuMAX, v->value);
+ } else if (atom->u.contents.option == C_BODY)
v->s = xmemdupz(bodypos, nonsiglen);
else if (atom->u.contents.option == C_SIG)
v->s = xmemdupz(sigpos, siglen);
@@ -1490,7 +1991,7 @@ static void grab_sub_body_contents(struct atom_value *val, int deref, struct exp
struct strbuf s = STRBUF_INIT;
/* Format the trailer info according to the trailer_opts given */
- format_trailers_from_commit(&s, subpos, &atom->u.contents.trailer_opts);
+ format_trailers_from_commit(&atom->u.contents.trailer_opts, subpos, &s);
v->s = strbuf_detach(&s, NULL);
} else if (atom->u.contents.option == C_BARE)
@@ -1530,12 +2031,15 @@ static void grab_values(struct atom_value *val, int deref, struct object *obj, s
grab_tag_values(val, deref, obj);
grab_sub_body_contents(val, deref, data);
grab_person("tagger", val, deref, buf);
+ grab_describe_values(val, deref, obj);
break;
case OBJ_COMMIT:
grab_commit_values(val, deref, obj);
grab_sub_body_contents(val, deref, data);
grab_person("author", val, deref, buf);
grab_person("committer", val, deref, buf);
+ grab_signature(val, deref, obj);
+ grab_describe_values(val, deref, obj);
break;
case OBJ_TREE:
/* grab_tree_values(val, deref, obj, buf, sz); */
@@ -1711,7 +2215,7 @@ char *get_head_description(void)
state.detached_from);
} else if (state.bisect_in_progress)
strbuf_addf(&desc, _("(no branch, bisect started on %s)"),
- state.branch);
+ state.bisecting_from);
else if (state.detached_from) {
if (state.detached_at)
strbuf_addf(&desc, _("(HEAD detached at %s)"),
@@ -1722,6 +2226,8 @@ char *get_head_description(void)
} else
strbuf_addstr(&desc, _("(no branch)"));
+ wt_status_state_free_buffers(&state);
+
return strbuf_detach(&desc, NULL);
}
@@ -1801,7 +2307,7 @@ static void lazy_init_worktree_map(void)
populate_worktree_map(&(ref_to_worktree_map.map), ref_to_worktree_map.worktrees);
}
-static char *get_worktree_path(const struct used_atom *atom, const struct ref_array_item *ref)
+static char *get_worktree_path(const struct ref_array_item *ref)
{
struct hashmap_entry entry, *e;
struct ref_to_worktree_entry *lookup_result;
@@ -1827,6 +2333,7 @@ static int populate_value(struct ref_array_item *ref, struct strbuf *err)
struct object *obj;
int i;
struct object_info empty = OBJECT_INFO_INIT;
+ int ahead_behind_atoms = 0;
CALLOC_ARRAY(ref->value, used_atom_cnt);
@@ -1849,6 +2356,7 @@ static int populate_value(struct ref_array_item *ref, struct strbuf *err)
v->s_size = ATOM_SIZE_UNSPECIFIED;
v->handler = append_atom;
+ v->value = 0;
v->atom = atom;
if (*name == '*') {
@@ -1860,7 +2368,7 @@ static int populate_value(struct ref_array_item *ref, struct strbuf *err)
refname = get_refname(atom, ref);
else if (atom_type == ATOM_WORKTREEPATH) {
if (ref->kind == FILTER_REFS_BRANCHES)
- v->s = get_worktree_path(atom, ref);
+ v->s = get_worktree_path(ref);
else
v->s = xstrdup("");
continue;
@@ -1957,6 +2465,16 @@ static int populate_value(struct ref_array_item *ref, struct strbuf *err)
else
v->s = xstrdup("");
continue;
+ } else if (atom_type == ATOM_AHEADBEHIND) {
+ if (ref->counts) {
+ const struct ahead_behind_count *count;
+ count = ref->counts[ahead_behind_atoms++];
+ v->s = xstrfmt("%d %d", count->ahead, count->behind);
+ } else {
+ /* Not a commit. */
+ v->s = xstrdup("");
+ }
+ continue;
} else
continue;
@@ -1993,17 +2511,12 @@ static int populate_value(struct ref_array_item *ref, struct strbuf *err)
return 0;
/*
- * If it is a tag object, see if we use a value that derefs
- * the object, and if we do grab the object it refers to.
+ * If it is a tag object, see if we use the peeled value. If we do,
+ * grab the peeled OID.
*/
- oi_deref.oid = *get_tagged_oid((struct tag *)obj);
+ if (need_tagged && peel_iterated_oid(&obj->oid, &oi_deref.oid))
+ die("bad tag");
- /*
- * NEEDSWORK: This derefs tag only once, which
- * is good to deal with chains of trust, but
- * is not consistent with what deref_tag() does
- * which peels the onion to the core.
- */
return get_object(ref, 1, &obj, &oi_deref, err);
}
@@ -2029,12 +2542,12 @@ static int get_ref_atom_value(struct ref_array_item *ref, int atom,
* matches a pattern "refs/heads/mas") or a wildcard (e.g. the same ref
* matches "refs/heads/mas*", too).
*/
-static int match_pattern(const struct ref_filter *filter, const char *refname)
+static int match_pattern(const char **patterns, const char *refname,
+ int ignore_case)
{
- const char **patterns = filter->name_patterns;
unsigned flags = 0;
- if (filter->ignore_case)
+ if (ignore_case)
flags |= WM_CASEFOLD;
/*
@@ -2059,13 +2572,13 @@ static int match_pattern(const struct ref_filter *filter, const char *refname)
* matches a pattern "refs/heads/" but not "refs/heads/m") or a
* wildcard (e.g. the same ref matches "refs/heads/m*", too).
*/
-static int match_name_as_path(const struct ref_filter *filter, const char *refname)
+static int match_name_as_path(const char **pattern, const char *refname,
+ int ignore_case)
{
- const char **pattern = filter->name_patterns;
int namelen = strlen(refname);
unsigned flags = WM_PATHNAME;
- if (filter->ignore_case)
+ if (ignore_case)
flags |= WM_CASEFOLD;
for (; *pattern; pattern++) {
@@ -2090,8 +2603,20 @@ static int filter_pattern_match(struct ref_filter *filter, const char *refname)
if (!*filter->name_patterns)
return 1; /* No pattern always matches */
if (filter->match_as_path)
- return match_name_as_path(filter, refname);
- return match_pattern(filter, refname);
+ return match_name_as_path(filter->name_patterns, refname,
+ filter->ignore_case);
+ return match_pattern(filter->name_patterns, refname,
+ filter->ignore_case);
+}
+
+static int filter_exclude_match(struct ref_filter *filter, const char *refname)
+{
+ if (!filter->exclude.nr)
+ return 0;
+ if (filter->match_as_path)
+ return match_name_as_path(filter->exclude.v, refname,
+ filter->ignore_case);
+ return match_pattern(filter->exclude.v, refname, filter->ignore_case);
}
/*
@@ -2103,6 +2628,12 @@ static int for_each_fullref_in_pattern(struct ref_filter *filter,
each_ref_fn cb,
void *cb_data)
{
+ if (filter->kind == FILTER_REFS_KIND_MASK) {
+ /* In this case, we want to print all refs including root refs. */
+ return refs_for_each_include_root_refs(get_main_ref_store(the_repository),
+ cb, cb_data);
+ }
+
if (!filter->match_as_path) {
/*
* in this case, the patterns are applied after
@@ -2123,42 +2654,53 @@ static int for_each_fullref_in_pattern(struct ref_filter *filter,
if (!filter->name_patterns[0]) {
/* no patterns; we have to look at everything */
- return for_each_fullref_in("", cb, cb_data);
+ return refs_for_each_fullref_in(get_main_ref_store(the_repository),
+ "", filter->exclude.v, cb, cb_data);
}
- return for_each_fullref_in_prefixes(NULL, filter->name_patterns,
- cb, cb_data);
+ return refs_for_each_fullref_in_prefixes(get_main_ref_store(the_repository),
+ NULL, filter->name_patterns,
+ filter->exclude.v,
+ cb, cb_data);
}
/*
* Given a ref (oid, refname), check if the ref belongs to the array
* of oids. If the given ref is a tag, check if the given tag points
- * at one of the oids in the given oid array.
+ * at one of the oids in the given oid array. Returns non-zero if a
+ * match is found.
+ *
* NEEDSWORK:
- * 1. Only a single level of indirection is obtained, we might want to
- * change this to account for multiple levels (e.g. annotated tags
- * pointing to annotated tags pointing to a commit.)
- * 2. As the refs are cached we might know what refname peels to without
+ * As the refs are cached we might know what refname peels to without
* the need to parse the object via parse_object(). peel_ref() might be a
* more efficient alternative to obtain the pointee.
*/
-static const struct object_id *match_points_at(struct oid_array *points_at,
- const struct object_id *oid,
- const char *refname)
+static int match_points_at(struct oid_array *points_at,
+ const struct object_id *oid,
+ const char *refname)
{
- const struct object_id *tagged_oid = NULL;
struct object *obj;
if (oid_array_lookup(points_at, oid) >= 0)
- return oid;
- obj = parse_object(the_repository, oid);
+ return 1;
+ obj = parse_object_with_flags(the_repository, oid,
+ PARSE_OBJECT_SKIP_HASH_CHECK);
+ while (obj && obj->type == OBJ_TAG) {
+ struct tag *tag = (struct tag *)obj;
+
+ if (parse_tag(tag) < 0) {
+ obj = NULL;
+ break;
+ }
+
+ if (oid_array_lookup(points_at, get_tagged_oid(tag)) >= 0)
+ return 1;
+
+ obj = tag->tagged;
+ }
if (!obj)
die(_("malformed object at '%s'"), refname);
- if (obj->type == OBJ_TAG)
- tagged_oid = get_tagged_oid((struct tag *)obj);
- if (tagged_oid && oid_array_lookup(points_at, tagged_oid) >= 0)
- return tagged_oid;
- return NULL;
+ return 0;
}
/*
@@ -2178,15 +2720,18 @@ static struct ref_array_item *new_ref_array_item(const char *refname,
return ref;
}
+static void ref_array_append(struct ref_array *array, struct ref_array_item *ref)
+{
+ ALLOC_GROW(array->items, array->nr + 1, array->alloc);
+ array->items[array->nr++] = ref;
+}
+
struct ref_array_item *ref_array_push(struct ref_array *array,
const char *refname,
const struct object_id *oid)
{
struct ref_array_item *ref = new_ref_array_item(refname, oid);
-
- ALLOC_GROW(array->items, array->nr + 1, array->alloc);
- array->items[array->nr++] = ref;
-
+ ref_array_append(array, ref);
return ref;
}
@@ -2211,6 +2756,9 @@ static int ref_kind_from_refname(const char *refname)
return ref_kind[i].kind;
}
+ if (is_pseudoref(get_main_ref_store(the_repository), refname))
+ return FILTER_REFS_PSEUDOREFS;
+
return FILTER_REFS_OTHERS;
}
@@ -2223,45 +2771,45 @@ static int filter_ref_kind(struct ref_filter *filter, const char *refname)
return ref_kind_from_refname(refname);
}
-struct ref_filter_cbdata {
- struct ref_array *array;
- struct ref_filter *filter;
- struct contains_cache contains_cache;
- struct contains_cache no_contains_cache;
-};
-
-/*
- * A call-back given to for_each_ref(). Filter refs and keep them for
- * later object processing.
- */
-static int ref_filter_handler(const char *refname, const struct object_id *oid, int flag, void *cb_data)
+static struct ref_array_item *apply_ref_filter(const char *refname, const struct object_id *oid,
+ int flag, struct ref_filter *filter)
{
- struct ref_filter_cbdata *ref_cbdata = cb_data;
- struct ref_filter *filter = ref_cbdata->filter;
struct ref_array_item *ref;
struct commit *commit = NULL;
unsigned int kind;
if (flag & REF_BAD_NAME) {
warning(_("ignoring ref with broken name %s"), refname);
- return 0;
+ return NULL;
}
if (flag & REF_ISBROKEN) {
warning(_("ignoring broken ref %s"), refname);
- return 0;
+ return NULL;
}
/* Obtain the current ref kind from filter_ref_kind() and ignore unwanted refs. */
kind = filter_ref_kind(filter, refname);
- if (!(kind & filter->kind))
- return 0;
+
+ /*
+ * Generally HEAD refs are printed with special description denoting a rebase,
+ * detached state and so forth. This is useful when only printing the HEAD ref
+ * But when it is being printed along with other pseudorefs, it makes sense to
+ * keep the formatting consistent. So we mask the type to act like a pseudoref.
+ */
+ if (filter->kind == FILTER_REFS_KIND_MASK && kind == FILTER_REFS_DETACHED_HEAD)
+ kind = FILTER_REFS_PSEUDOREFS;
+ else if (!(kind & filter->kind))
+ return NULL;
if (!filter_pattern_match(filter, refname))
- return 0;
+ return NULL;
+
+ if (filter_exclude_match(filter, refname))
+ return NULL;
if (filter->points_at.nr && !match_points_at(&filter->points_at, oid, refname))
- return 0;
+ return NULL;
/*
* A merge filter is applied on refs pointing to commits. Hence
@@ -2272,15 +2820,15 @@ static int ref_filter_handler(const char *refname, const struct object_id *oid,
filter->with_commit || filter->no_commit || filter->verbose) {
commit = lookup_commit_reference_gently(the_repository, oid, 1);
if (!commit)
- return 0;
+ return NULL;
/* We perform the filtering for the '--contains' option... */
if (filter->with_commit &&
- !commit_contains(filter, commit, filter->with_commit, &ref_cbdata->contains_cache))
- return 0;
+ !commit_contains(filter, commit, filter->with_commit, &filter->internal.contains_cache))
+ return NULL;
/* ...or for the `--no-contains' option */
if (filter->no_commit &&
- commit_contains(filter, commit, filter->no_commit, &ref_cbdata->no_contains_cache))
- return 0;
+ commit_contains(filter, commit, filter->no_commit, &filter->internal.no_contains_cache))
+ return NULL;
}
/*
@@ -2288,11 +2836,32 @@ static int ref_filter_handler(const char *refname, const struct object_id *oid,
* to do its job and the resulting list may yet to be pruned
* by maxcount logic.
*/
- ref = ref_array_push(ref_cbdata->array, refname, oid);
+ ref = new_ref_array_item(refname, oid);
ref->commit = commit;
ref->flag = flag;
ref->kind = kind;
+ return ref;
+}
+
+struct ref_filter_cbdata {
+ struct ref_array *array;
+ struct ref_filter *filter;
+};
+
+/*
+ * A call-back given to for_each_ref(). Filter refs and keep them for
+ * later object processing.
+ */
+static int filter_one(const char *refname, const struct object_id *oid, int flag, void *cb_data)
+{
+ struct ref_filter_cbdata *ref_cbdata = cb_data;
+ struct ref_array_item *ref;
+
+ ref = apply_ref_filter(refname, oid, flag, ref_cbdata->filter);
+ if (ref)
+ ref_array_append(ref_cbdata->array, ref);
+
return 0;
}
@@ -2306,9 +2875,53 @@ static void free_array_item(struct ref_array_item *item)
free((char *)item->value[i].s);
free(item->value);
}
+ free(item->counts);
free(item);
}
+struct ref_filter_and_format_cbdata {
+ struct ref_filter *filter;
+ struct ref_format *format;
+
+ struct ref_filter_and_format_internal {
+ int count;
+ } internal;
+};
+
+static int filter_and_format_one(const char *refname, const struct object_id *oid, int flag, void *cb_data)
+{
+ struct ref_filter_and_format_cbdata *ref_cbdata = cb_data;
+ struct ref_array_item *ref;
+ struct strbuf output = STRBUF_INIT, err = STRBUF_INIT;
+
+ ref = apply_ref_filter(refname, oid, flag, ref_cbdata->filter);
+ if (!ref)
+ return 0;
+
+ if (format_ref_array_item(ref, ref_cbdata->format, &output, &err))
+ die("%s", err.buf);
+
+ if (output.len || !ref_cbdata->format->array_opts.omit_empty) {
+ fwrite(output.buf, 1, output.len, stdout);
+ putchar('\n');
+ }
+
+ strbuf_release(&output);
+ strbuf_release(&err);
+ free_array_item(ref);
+
+ /*
+ * Increment the running count of refs that match the filter. If
+ * max_count is set and we've reached the max, stop the ref
+ * iteration by returning a nonzero value.
+ */
+ if (ref_cbdata->format->array_opts.max_count &&
+ ++ref_cbdata->internal.count >= ref_cbdata->format->array_opts.max_count)
+ return 1;
+
+ return 0;
+}
+
/* Free all memory allocated for ref_array */
void ref_array_clear(struct ref_array *array)
{
@@ -2334,41 +2947,32 @@ void ref_array_clear(struct ref_array *array)
free_worktrees(ref_to_worktree_map.worktrees);
ref_to_worktree_map.worktrees = NULL;
}
+
+ FREE_AND_NULL(array->counts);
}
#define EXCLUDE_REACHED 0
#define INCLUDE_REACHED 1
static void reach_filter(struct ref_array *array,
- struct commit_list *check_reachable,
+ struct commit_list **check_reachable,
int include_reached)
{
- struct rev_info revs;
int i, old_nr;
struct commit **to_clear;
- struct commit_list *cr;
- if (!check_reachable)
+ if (!*check_reachable)
return;
CALLOC_ARRAY(to_clear, array->nr);
-
- repo_init_revisions(the_repository, &revs, NULL);
-
for (i = 0; i < array->nr; i++) {
struct ref_array_item *item = array->items[i];
- add_pending_object(&revs, &item->commit->object, item->refname);
to_clear[i] = item->commit;
}
- for (cr = check_reachable; cr; cr = cr->next) {
- struct commit *merge_commit = cr->item;
- merge_commit->object.flags |= UNINTERESTING;
- add_pending_object(&revs, &merge_commit->object, "");
- }
-
- revs.limited = 1;
- if (prepare_revision_walk(&revs))
- die(_("revision walk setup failed"));
+ tips_reachable_from_bases(the_repository,
+ *check_reachable,
+ to_clear, array->nr,
+ UNINTERESTING);
old_nr = array->nr;
array->nr = 0;
@@ -2387,33 +2991,63 @@ static void reach_filter(struct ref_array *array,
clear_commit_marks_many(old_nr, to_clear, ALL_REV_FLAGS);
- while (check_reachable) {
- struct commit *merge_commit = pop_commit(&check_reachable);
+ while (*check_reachable) {
+ struct commit *merge_commit = pop_commit(check_reachable);
clear_commit_marks(merge_commit, ALL_REV_FLAGS);
}
- release_revisions(&revs);
free(to_clear);
}
-/*
- * API for filtering a set of refs. Based on the type of refs the user
- * has requested, we iterate through those refs and apply filters
- * as per the given ref_filter structure and finally store the
- * filtered refs in the ref_array structure.
- */
-int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned int type)
+void filter_ahead_behind(struct repository *r,
+ struct ref_format *format,
+ struct ref_array *array)
{
- struct ref_filter_cbdata ref_cbdata;
- int ret = 0;
+ struct commit **commits;
+ size_t commits_nr = format->bases.nr + array->nr;
- ref_cbdata.array = array;
- ref_cbdata.filter = filter;
+ if (!format->bases.nr || !array->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(array->counts, st_mult(format->bases.nr, array->nr));
+
+ commits_nr = format->bases.nr;
+ array->counts_nr = 0;
+ for (size_t i = 0; i < array->nr; i++) {
+ const char *name = array->items[i]->refname;
+ commits[commits_nr] = lookup_commit_reference_by_name(name);
+
+ if (!commits[commits_nr])
+ continue;
+
+ CALLOC_ARRAY(array->items[i]->counts, format->bases.nr);
+ for (size_t j = 0; j < format->bases.nr; j++) {
+ struct ahead_behind_count *count;
+ count = &array->counts[array->counts_nr++];
+ count->tip_index = commits_nr;
+ count->base_index = j;
+
+ array->items[i]->counts[j] = count;
+ }
+ commits_nr++;
+ }
+
+ ahead_behind(r, commits, commits_nr, array->counts, array->counts_nr);
+ free(commits);
+}
+
+static int do_filter_refs(struct ref_filter *filter, unsigned int type, each_ref_fn fn, void *cb_data)
+{
+ int ret = 0;
filter->kind = type & FILTER_REFS_KIND_MASK;
- init_contains_cache(&ref_cbdata.contains_cache);
- init_contains_cache(&ref_cbdata.no_contains_cache);
+ init_contains_cache(&filter->internal.contains_cache);
+ init_contains_cache(&filter->internal.no_contains_cache);
/* Simple per-ref filtering */
if (!filter->kind)
@@ -2426,27 +3060,102 @@ int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned int
* of filter_ref_kind().
*/
if (filter->kind == FILTER_REFS_BRANCHES)
- ret = for_each_fullref_in("refs/heads/", ref_filter_handler, &ref_cbdata);
+ ret = for_each_fullref_in("refs/heads/", fn, cb_data);
else if (filter->kind == FILTER_REFS_REMOTES)
- ret = for_each_fullref_in("refs/remotes/", ref_filter_handler, &ref_cbdata);
+ ret = for_each_fullref_in("refs/remotes/", fn, cb_data);
else if (filter->kind == FILTER_REFS_TAGS)
- ret = for_each_fullref_in("refs/tags/", ref_filter_handler, &ref_cbdata);
- else if (filter->kind & FILTER_REFS_ALL)
- ret = for_each_fullref_in_pattern(filter, ref_filter_handler, &ref_cbdata);
- if (!ret && (filter->kind & FILTER_REFS_DETACHED_HEAD))
- head_ref(ref_filter_handler, &ref_cbdata);
+ ret = for_each_fullref_in("refs/tags/", fn, cb_data);
+ else if (filter->kind & FILTER_REFS_REGULAR)
+ ret = for_each_fullref_in_pattern(filter, fn, cb_data);
+
+ /*
+ * When printing all ref types, HEAD is already included,
+ * so we don't want to print HEAD again.
+ */
+ if (!ret && (filter->kind != FILTER_REFS_KIND_MASK) &&
+ (filter->kind & FILTER_REFS_DETACHED_HEAD))
+ head_ref(fn, cb_data);
}
- clear_contains_cache(&ref_cbdata.contains_cache);
- clear_contains_cache(&ref_cbdata.no_contains_cache);
+ clear_contains_cache(&filter->internal.contains_cache);
+ clear_contains_cache(&filter->internal.no_contains_cache);
+
+ return ret;
+}
+
+/*
+ * API for filtering a set of refs. Based on the type of refs the user
+ * has requested, we iterate through those refs and apply filters
+ * as per the given ref_filter structure and finally store the
+ * filtered refs in the ref_array structure.
+ */
+int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned int type)
+{
+ struct ref_filter_cbdata ref_cbdata;
+ int save_commit_buffer_orig;
+ int ret = 0;
+
+ ref_cbdata.array = array;
+ ref_cbdata.filter = filter;
+
+ save_commit_buffer_orig = save_commit_buffer;
+ save_commit_buffer = 0;
+
+ ret = do_filter_refs(filter, type, filter_one, &ref_cbdata);
/* Filters that need revision walking */
- reach_filter(array, filter->reachable_from, INCLUDE_REACHED);
- reach_filter(array, filter->unreachable_from, EXCLUDE_REACHED);
+ reach_filter(array, &filter->reachable_from, INCLUDE_REACHED);
+ reach_filter(array, &filter->unreachable_from, EXCLUDE_REACHED);
+ save_commit_buffer = save_commit_buffer_orig;
return ret;
}
+static inline int can_do_iterative_format(struct ref_filter *filter,
+ struct ref_sorting *sorting,
+ struct ref_format *format)
+{
+ /*
+ * Filtering & formatting results within a single ref iteration
+ * callback is not compatible with options that require
+ * post-processing a filtered ref_array. These include:
+ * - filtering on reachability
+ * - sorting the filtered results
+ * - including ahead-behind information in the formatted output
+ */
+ return !(filter->reachable_from ||
+ filter->unreachable_from ||
+ sorting ||
+ format->bases.nr);
+}
+
+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)) {
+ int save_commit_buffer_orig;
+ struct ref_filter_and_format_cbdata ref_cbdata = {
+ .filter = filter,
+ .format = format,
+ };
+
+ save_commit_buffer_orig = save_commit_buffer;
+ save_commit_buffer = 0;
+
+ do_filter_refs(filter, type, filter_and_format_one, &ref_cbdata);
+
+ save_commit_buffer = save_commit_buffer_orig;
+ } else {
+ struct ref_array array = { 0 };
+ filter_refs(&array, filter, type);
+ filter_ahead_behind(the_repository, format, &array);
+ ref_array_sort(sorting, &array);
+ print_formatted_ref_array(&array, format);
+ ref_array_clear(&array);
+ }
+}
+
static int compare_detached_head(struct ref_array_item *a, struct ref_array_item *b)
{
if (!(a->kind ^ b->kind))
@@ -2564,7 +3273,8 @@ void ref_sorting_set_sort_flags_all(struct ref_sorting *sorting,
void ref_array_sort(struct ref_sorting *sorting, struct ref_array *array)
{
- QSORT_S(array->items, array->nr, compare_refs, sorting);
+ if (sorting)
+ QSORT_S(array->items, array->nr, compare_refs, sorting);
}
static void append_literal(const char *cp, const char *ep, struct ref_formatting_state *state)
@@ -2635,6 +3345,29 @@ int format_ref_array_item(struct ref_array_item *info,
return 0;
}
+void print_formatted_ref_array(struct ref_array *array, struct ref_format *format)
+{
+ int total;
+ struct strbuf output = STRBUF_INIT, err = STRBUF_INIT;
+
+ total = format->array_opts.max_count;
+ if (!total || array->nr < total)
+ total = array->nr;
+ for (int i = 0; i < total; i++) {
+ strbuf_reset(&err);
+ strbuf_reset(&output);
+ if (format_ref_array_item(array->items[i], format, &output, &err))
+ die("%s", err.buf);
+ if (output.len || !format->array_opts.omit_empty) {
+ fwrite(output.buf, 1, output.len, stdout);
+ putchar('\n');
+ }
+ }
+
+ strbuf_release(&err);
+ strbuf_release(&output);
+}
+
void pretty_print_ref(const char *name, const struct object_id *oid,
struct ref_format *format)
{
@@ -2670,18 +3403,6 @@ static int parse_sorting_atom(const char *atom)
return res;
}
-/* If no sorting option is given, use refname to sort as default */
-static struct ref_sorting *ref_default_sorting(void)
-{
- static const char cstr_name[] = "refname";
-
- struct ref_sorting *sorting = xcalloc(1, sizeof(*sorting));
-
- sorting->next = NULL;
- sorting->atom = parse_sorting_atom(cstr_name);
- return sorting;
-}
-
static void parse_ref_sorting(struct ref_sorting **sorting_tail, const char *arg)
{
struct ref_sorting *s;
@@ -2705,9 +3426,7 @@ struct ref_sorting *ref_sorting_options(struct string_list *options)
struct string_list_item *item;
struct ref_sorting *sorting = NULL, **tail = &sorting;
- if (!options->nr) {
- sorting = ref_default_sorting();
- } else {
+ if (options->nr) {
for_each_string_list_item(item, options)
parse_ref_sorting(tail, item->string);
}
@@ -2738,7 +3457,7 @@ int parse_opt_merge_filter(const struct option *opt, const char *arg, int unset)
BUG_ON_OPT_NEG(unset);
- if (get_oid(arg, &oid))
+ if (repo_get_oid(the_repository, arg, &oid))
die(_("malformed object name %s"), arg);
merge_commit = lookup_commit_reference_gently(the_repository, &oid, 0);
@@ -2753,3 +3472,20 @@ int parse_opt_merge_filter(const struct option *opt, const char *arg, int unset)
return 0;
}
+
+void ref_filter_init(struct ref_filter *filter)
+{
+ struct ref_filter blank = REF_FILTER_INIT;
+ memcpy(filter, &blank, sizeof(blank));
+}
+
+void ref_filter_clear(struct ref_filter *filter)
+{
+ strvec_clear(&filter->exclude);
+ oid_array_clear(&filter->points_at);
+ free_commit_list(filter->with_commit);
+ free_commit_list(filter->no_commit);
+ free_commit_list(filter->reachable_from);
+ free_commit_list(filter->unreachable_from);
+ ref_filter_init(filter);
+}
diff --git a/ref-filter.h b/ref-filter.h
index aa0eea4..0ca28d2 100644
--- a/ref-filter.h
+++ b/ref-filter.h
@@ -1,10 +1,12 @@
#ifndef REF_FILTER_H
#define REF_FILTER_H
+#include "gettext.h"
#include "oid-array.h"
-#include "refs.h"
#include "commit.h"
-#include "parse-options.h"
+#include "string-list.h"
+#include "strvec.h"
+#include "commit-reach.h"
/* Quoting styles */
#define QUOTE_NONE 0
@@ -17,13 +19,18 @@
#define FILTER_REFS_BRANCHES 0x0004
#define FILTER_REFS_REMOTES 0x0008
#define FILTER_REFS_OTHERS 0x0010
-#define FILTER_REFS_ALL (FILTER_REFS_TAGS | FILTER_REFS_BRANCHES | \
+#define FILTER_REFS_REGULAR (FILTER_REFS_TAGS | FILTER_REFS_BRANCHES | \
FILTER_REFS_REMOTES | FILTER_REFS_OTHERS)
#define FILTER_REFS_DETACHED_HEAD 0x0020
-#define FILTER_REFS_KIND_MASK (FILTER_REFS_ALL | FILTER_REFS_DETACHED_HEAD)
+#define FILTER_REFS_PSEUDOREFS 0x0040
+#define FILTER_REFS_ROOT_REFS (FILTER_REFS_DETACHED_HEAD | FILTER_REFS_PSEUDOREFS)
+#define FILTER_REFS_KIND_MASK (FILTER_REFS_REGULAR | FILTER_REFS_DETACHED_HEAD | \
+ FILTER_REFS_PSEUDOREFS)
struct atom_value;
struct ref_sorting;
+struct ahead_behind_count;
+struct option;
enum ref_sorting_order {
REF_SORTING_REVERSE = 1<<0,
@@ -40,6 +47,8 @@ struct ref_array_item {
const char *symref;
struct commit *commit;
struct atom_value *value;
+ struct ahead_behind_count **counts;
+
char refname[FLEX_ARRAY];
};
@@ -47,10 +56,14 @@ struct ref_array {
int nr, alloc;
struct ref_array_item **items;
struct rev_info *revs;
+
+ struct ahead_behind_count *counts;
+ size_t counts_nr;
};
struct ref_filter {
const char **name_patterns;
+ struct strvec exclude;
struct oid_array points_at;
struct commit_list *with_commit;
struct commit_list *no_commit;
@@ -65,6 +78,11 @@ struct ref_filter {
lines;
int abbrev,
verbose;
+
+ struct {
+ struct contains_cache contains_cache;
+ struct contains_cache no_contains_cache;
+ } internal;
};
struct ref_format {
@@ -75,14 +93,28 @@ struct ref_format {
const char *format;
const char *rest;
int quote_style;
- int use_rest;
int use_color;
/* Internal state to ref-filter */
int need_color_reset_at_eol;
+
+ /* List of bases for ahead-behind counts. */
+ struct string_list bases;
+
+ struct {
+ int max_count;
+ int omit_empty;
+ } array_opts;
};
-#define REF_FORMAT_INIT { .use_color = -1 }
+#define REF_FILTER_INIT { \
+ .points_at = OID_ARRAY_INIT, \
+ .exclude = STRVEC_INIT, \
+}
+#define REF_FORMAT_INIT { \
+ .use_color = -1, \
+ .bases = STRING_LIST_INIT_DUP, \
+}
/* Macros for checking --merged and --no-merged options */
#define _OPT_MERGED_NO_MERGED(option, filter, h) \
@@ -96,6 +128,9 @@ struct ref_format {
#define OPT_REF_SORT(var) \
OPT_STRING_LIST(0, "sort", (var), \
N_("key"), N_("field name to sort on"))
+#define OPT_REF_FILTER_EXCLUDE(var) \
+ OPT_STRVEC(0, "exclude", &(var)->exclude, \
+ N_("pattern"), N_("exclude refs which match pattern"))
/*
* API for filtering a set of refs. Based on the type of refs the user
@@ -104,6 +139,14 @@ struct ref_format {
* filtered refs in the ref_array structure.
*/
int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned int type);
+/*
+ * Filter refs using the given ref_filter and type, sort the contents
+ * according to the given ref_sorting, format the filtered refs with the
+ * given ref_format, and print them to stdout.
+ */
+void filter_and_format_refs(struct ref_filter *filter, unsigned int type,
+ struct ref_sorting *sorting,
+ struct ref_format *format);
/* Clear all memory allocated to ref_array */
void ref_array_clear(struct ref_array *array);
/* Used to verify if the given format is correct and to parse out the used atoms */
@@ -129,6 +172,12 @@ char *get_head_description(void);
void setup_ref_filter_porcelain_msg(void);
/*
+ * Print up to maxcount ref_array elements to stdout using the given
+ * ref_format.
+ */
+void print_formatted_ref_array(struct ref_array *array, struct ref_format *format);
+
+/*
* Print a single ref, outside of any ref-filter. Note that the
* name must be a fully qualified refname.
*/
@@ -143,4 +192,18 @@ struct ref_array_item *ref_array_push(struct ref_array *array,
const char *refname,
const struct object_id *oid);
+/*
+ * If the provided format includes ahead-behind atoms, then compute the
+ * ahead-behind values for the array of filtered references. Must be
+ * called after filter_refs() but before outputting the formatted refs.
+ *
+ * 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);
+
+void ref_filter_init(struct ref_filter *filter);
+void ref_filter_clear(struct ref_filter *filter);
+
#endif /* REF_FILTER_H */
diff --git a/reflog-walk.c b/reflog-walk.c
index 7aa6595..66484f4 100644
--- a/reflog-walk.c
+++ b/reflog-walk.c
@@ -1,7 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "commit.h"
#include "refs.h"
#include "diff.h"
+#include "repository.h"
#include "revision.h"
#include "string-list.h"
#include "reflog-walk.h"
@@ -55,7 +56,7 @@ static void free_complete_reflog(struct complete_reflogs *array)
free(array);
}
-static void complete_reflogs_clear(void *util, const char *str)
+static void complete_reflogs_clear(void *util, const char *str UNUSED)
{
struct complete_reflogs *array = util;
free_complete_reflog(array);
@@ -222,7 +223,7 @@ int add_reflog_for_walk(struct reflog_walk_info *info,
void get_reflog_selector(struct strbuf *sb,
struct reflog_walk_info *reflog_info,
- const struct date_mode *dmode, int force_date,
+ struct date_mode dmode, int force_date,
int shorten)
{
struct commit_reflog *commit_reflog = reflog_info->last_commit_reflog;
@@ -296,7 +297,7 @@ timestamp_t get_reflog_timestamp(struct reflog_walk_info *reflog_info)
}
void show_reflog_message(struct reflog_walk_info *reflog_info, int oneline,
- const struct date_mode *dmode, int force_date)
+ struct date_mode dmode, int force_date)
{
if (reflog_info && reflog_info->last_commit_reflog) {
struct commit_reflog *commit_reflog = reflog_info->last_commit_reflog;
diff --git a/reflog-walk.h b/reflog-walk.h
index 8076f10..989583d 100644
--- a/reflog-walk.h
+++ b/reflog-walk.h
@@ -1,8 +1,6 @@
#ifndef REFLOG_WALK_H
#define REFLOG_WALK_H
-#include "cache.h"
-
struct commit;
struct reflog_walk_info;
struct date_mode;
@@ -12,14 +10,14 @@ void reflog_walk_info_release(struct reflog_walk_info *info);
int add_reflog_for_walk(struct reflog_walk_info *info,
struct commit *commit, const char *name);
void show_reflog_message(struct reflog_walk_info *info, int,
- const struct date_mode *, int force_date);
+ struct date_mode, int force_date);
void get_reflog_message(struct strbuf *sb,
struct reflog_walk_info *reflog_info);
const char *get_reflog_ident(struct reflog_walk_info *reflog_info);
timestamp_t get_reflog_timestamp(struct reflog_walk_info *reflog_info);
void get_reflog_selector(struct strbuf *sb,
struct reflog_walk_info *reflog_info,
- const struct date_mode *dmode, int force_date,
+ struct date_mode dmode, int force_date,
int shorten);
int reflog_walk_empty(struct reflog_walk_info *walk);
diff --git a/reflog.c b/reflog.c
index 135a1a6..647f3ca 100644
--- a/reflog.c
+++ b/reflog.c
@@ -1,9 +1,11 @@
-#include "cache.h"
-#include "object-store.h"
+#include "git-compat-util.h"
+#include "gettext.h"
+#include "object-store-ll.h"
#include "reflog.h"
#include "refs.h"
#include "revision.h"
-#include "worktree.h"
+#include "tree.h"
+#include "tree-walk.h"
/* Remember to update object flag allocation in object.h */
#define INCOMPLETE (1u<<10)
@@ -28,7 +30,8 @@ static int tree_is_complete(const struct object_id *oid)
if (!tree->buffer) {
enum object_type type;
unsigned long size;
- void *data = read_object_file(oid, &type, &size);
+ void *data = repo_read_object_file(the_repository, oid, &type,
+ &size);
if (!data) {
tree->object.flags |= INCOMPLETE;
return 0;
@@ -36,10 +39,10 @@ static int tree_is_complete(const struct object_id *oid)
tree->buffer = data;
tree->size = size;
}
- init_tree_desc(&desc, tree->buffer, tree->size);
+ init_tree_desc(&desc, &tree->object.oid, tree->buffer, tree->size);
complete = 1;
while (tree_entry(&desc, &entry)) {
- if (!has_object_file(&entry.oid) ||
+ if (!repo_has_object_file(the_repository, &entry.oid) ||
(S_ISDIR(entry.mode) && !tree_is_complete(&entry.oid))) {
tree->object.flags |= INCOMPLETE;
complete = 0;
@@ -186,14 +189,13 @@ static void mark_reachable(struct expire_reflog_policy_cb *cb)
struct commit *commit = pop_commit(&pending);
if (commit->object.flags & REACHABLE)
continue;
- if (parse_commit(commit))
+ if (repo_parse_commit(the_repository, commit))
continue;
commit->object.flags |= REACHABLE;
if (commit->date < expire_limit) {
commit_list_insert(commit, &leftover);
continue;
}
- commit->object.flags |= REACHABLE;
parent = commit->parents;
while (parent) {
commit = parent->item;
@@ -240,8 +242,9 @@ static int unreachable(struct expire_reflog_policy_cb *cb, struct commit *commit
* Return true iff the specified reflog entry should be expired.
*/
int should_expire_reflog_ent(struct object_id *ooid, struct object_id *noid,
- const char *email, timestamp_t timestamp, int tz,
- const char *message, void *cb_data)
+ const char *email UNUSED,
+ timestamp_t timestamp, int tz UNUSED,
+ const char *message UNUSED, void *cb_data)
{
struct expire_reflog_policy_cb *cb = cb_data;
struct commit *old_commit, *new_commit;
@@ -294,7 +297,8 @@ int should_expire_reflog_ent_verbose(struct object_id *ooid,
return expire;
}
-static int push_tip_to_list(const char *refname, const struct object_id *oid,
+static int push_tip_to_list(const char *refname UNUSED,
+ const struct object_id *oid,
int flags, void *cb_data)
{
struct commit_list **list = cb_data;
@@ -310,16 +314,9 @@ static int push_tip_to_list(const char *refname, const struct object_id *oid,
static int is_head(const char *refname)
{
- switch (ref_type(refname)) {
- case REF_TYPE_OTHER_PSEUDOREF:
- case REF_TYPE_MAIN_PSEUDOREF:
- if (parse_worktree_ref(refname, NULL, NULL, &refname))
- BUG("not a worktree ref: %s", refname);
- break;
- default:
- break;
- }
- return !strcmp(refname, "HEAD");
+ const char *stripped_refname;
+ parse_worktree_ref(refname, NULL, NULL, &stripped_refname);
+ return !strcmp(stripped_refname, "HEAD");
}
void reflog_expiry_prepare(const char *refname,
@@ -376,11 +373,16 @@ void reflog_expiry_cleanup(void *cb_data)
clear_commit_marks(cb->tip_commit, REACHABLE);
break;
}
+ for (elem = cb->mark_list; elem; elem = elem->next)
+ clear_commit_marks(elem->item, REACHABLE);
+ free_commit_list(cb->mark_list);
}
-int count_reflog_ent(struct object_id *ooid, struct object_id *noid,
- const char *email, timestamp_t timestamp, int tz,
- const char *message, void *cb_data)
+int count_reflog_ent(struct object_id *ooid UNUSED,
+ struct object_id *noid UNUSED,
+ const char *email UNUSED,
+ timestamp_t timestamp, int tz UNUSED,
+ const char *message UNUSED, void *cb_data)
{
struct cmd_reflog_expire_cb *cb = cb_data;
if (!cb->expire_total || timestamp < cb->expire_total)
diff --git a/refs.c b/refs.c
index 90bcb27..55d2e0b 100644
--- a/refs.c
+++ b/refs.c
@@ -2,39 +2,65 @@
* The backend-independent part of the reference module.
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "advice.h"
#include "config.h"
+#include "environment.h"
#include "hashmap.h"
+#include "gettext.h"
+#include "hex.h"
#include "lockfile.h"
#include "iterator.h"
#include "refs.h"
#include "refs/refs-internal.h"
#include "run-command.h"
#include "hook.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "object.h"
+#include "path.h"
#include "tag.h"
#include "submodule.h"
#include "worktree.h"
#include "strvec.h"
#include "repository.h"
+#include "setup.h"
#include "sigchain.h"
#include "date.h"
+#include "commit.h"
+#include "wildmatch.h"
/*
* List of all available backends
*/
-static struct ref_storage_be *refs_backends = &refs_be_files;
+static const struct ref_storage_be *refs_backends[] = {
+ [REF_STORAGE_FORMAT_FILES] = &refs_be_files,
+ [REF_STORAGE_FORMAT_REFTABLE] = &refs_be_reftable,
+};
-static struct ref_storage_be *find_ref_storage_backend(const char *name)
+static const struct ref_storage_be *find_ref_storage_backend(unsigned int ref_storage_format)
{
- struct ref_storage_be *be;
- for (be = refs_backends; be; be = be->next)
- if (!strcmp(be->name, name))
- return be;
+ if (ref_storage_format < ARRAY_SIZE(refs_backends))
+ return refs_backends[ref_storage_format];
return NULL;
}
+unsigned int ref_storage_format_by_name(const char *name)
+{
+ for (unsigned int i = 0; i < ARRAY_SIZE(refs_backends); i++)
+ if (refs_backends[i] && !strcmp(refs_backends[i]->name, name))
+ return i;
+ return REF_STORAGE_FORMAT_UNKNOWN;
+}
+
+const char *ref_storage_format_to_name(unsigned int ref_storage_format)
+{
+ const struct ref_storage_be *be = find_ref_storage_backend(ref_storage_format);
+ if (!be)
+ return "unknown";
+ return be->name;
+}
+
/*
* How to handle various characters in refnames:
* 0: An acceptable character for refs
@@ -56,6 +82,88 @@ static unsigned char refname_disposition[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 4, 4
};
+struct ref_namespace_info ref_namespace[] = {
+ [NAMESPACE_HEAD] = {
+ .ref = "HEAD",
+ .decoration = DECORATION_REF_HEAD,
+ .exact = 1,
+ },
+ [NAMESPACE_BRANCHES] = {
+ .ref = "refs/heads/",
+ .decoration = DECORATION_REF_LOCAL,
+ },
+ [NAMESPACE_TAGS] = {
+ .ref = "refs/tags/",
+ .decoration = DECORATION_REF_TAG,
+ },
+ [NAMESPACE_REMOTE_REFS] = {
+ /*
+ * The default refspec for new remotes copies refs from
+ * refs/heads/ on the remote into refs/remotes/<remote>/.
+ * As such, "refs/remotes/" has special handling.
+ */
+ .ref = "refs/remotes/",
+ .decoration = DECORATION_REF_REMOTE,
+ },
+ [NAMESPACE_STASH] = {
+ /*
+ * The single ref "refs/stash" stores the latest stash.
+ * Older stashes can be found in the reflog.
+ */
+ .ref = "refs/stash",
+ .exact = 1,
+ .decoration = DECORATION_REF_STASH,
+ },
+ [NAMESPACE_REPLACE] = {
+ /*
+ * This namespace allows Git to act as if one object ID
+ * points to the content of another. Unlike the other
+ * ref namespaces, this one can be changed by the
+ * GIT_REPLACE_REF_BASE environment variable. This
+ * .namespace value will be overwritten in setup_git_env().
+ */
+ .ref = "refs/replace/",
+ .decoration = DECORATION_GRAFTED,
+ },
+ [NAMESPACE_NOTES] = {
+ /*
+ * The refs/notes/commit ref points to the tip of a
+ * parallel commit history that adds metadata to commits
+ * in the normal history. This ref can be overwritten
+ * by the core.notesRef config variable or the
+ * GIT_NOTES_REFS environment variable.
+ */
+ .ref = "refs/notes/commit",
+ .exact = 1,
+ },
+ [NAMESPACE_PREFETCH] = {
+ /*
+ * Prefetch refs are written by the background 'fetch'
+ * maintenance task. It allows faster foreground fetches
+ * by advertising these previously-downloaded tips without
+ * updating refs/remotes/ without user intervention.
+ */
+ .ref = "refs/prefetch/",
+ },
+ [NAMESPACE_REWRITTEN] = {
+ /*
+ * Rewritten refs are used by the 'label' command in the
+ * sequencer. These are particularly useful during an
+ * interactive rebase that uses the 'merge' command.
+ */
+ .ref = "refs/rewritten/",
+ },
+};
+
+void update_ref_namespace(enum ref_namespace namespace, char *ref)
+{
+ struct ref_namespace_info *info = &ref_namespace[namespace];
+ if (info->ref_updated)
+ free(info->ref);
+ info->ref = ref;
+ info->ref_updated = 1;
+}
+
/*
* Try to read one refname component from the front of refname.
* Return the length of the component found, or -1 if the component is
@@ -284,8 +392,8 @@ char *resolve_refdup(const char *refname, int resolve_flags,
oid, flags);
}
-/* The argument to filter_refs */
-struct ref_filter {
+/* The argument to for_each_filter_refs */
+struct for_each_ref_filter {
const char *pattern;
const char *prefix;
each_ref_fn *fn;
@@ -318,10 +426,11 @@ int ref_exists(const char *refname)
return refs_ref_exists(get_main_ref_store(the_repository), refname);
}
-static int filter_refs(const char *refname, const struct object_id *oid,
- int flags, void *data)
+static int for_each_filter_refs(const char *refname,
+ const struct object_id *oid,
+ int flags, void *data)
{
- struct ref_filter *filter = (struct ref_filter *)data;
+ struct for_each_ref_filter *filter = data;
if (wildmatch(filter->pattern, refname, 0))
return 0;
@@ -358,7 +467,8 @@ struct warn_if_dangling_data {
const char *msg_fmt;
};
-static int warn_if_dangling_symref(const char *refname, const struct object_id *oid,
+static int warn_if_dangling_symref(const char *refname,
+ const struct object_id *oid UNUSED,
int flags, void *cb_data)
{
struct warn_if_dangling_data *d = cb_data;
@@ -455,11 +565,16 @@ void normalize_glob_ref(struct string_list_item *item, const char *prefix,
if (*pattern == '/')
BUG("pattern must not start with '/'");
- if (prefix) {
+ if (prefix)
strbuf_addstr(&normalized_pattern, prefix);
- }
- else if (!starts_with(pattern, "refs/"))
+ else if (!starts_with(pattern, "refs/") &&
+ strcmp(pattern, "HEAD"))
strbuf_addstr(&normalized_pattern, "refs/");
+ /*
+ * NEEDSWORK: Special case other symrefs such as REBASE_HEAD,
+ * MERGE_HEAD, etc.
+ */
+
strbuf_addstr(&normalized_pattern, pattern);
strbuf_strip_suffix(&normalized_pattern, "/");
@@ -472,7 +587,7 @@ int for_each_glob_ref_in(each_ref_fn fn, const char *pattern,
const char *prefix, void *cb_data)
{
struct strbuf real_pattern = STRBUF_INIT;
- struct ref_filter filter;
+ struct for_each_ref_filter filter;
int ret;
if (!prefix && !starts_with(pattern, "refs/"))
@@ -492,7 +607,7 @@ int for_each_glob_ref_in(each_ref_fn fn, const char *pattern,
filter.prefix = prefix;
filter.fn = fn;
filter.cb_data = cb_data;
- ret = for_each_ref(filter_refs, &filter);
+ ret = for_each_ref(for_each_filter_refs, &filter);
strbuf_release(&real_pattern);
return ret;
@@ -722,7 +837,7 @@ int dwim_log(const char *str, int len, struct object_id *oid, char **log)
return repo_dwim_log(the_repository, str, len, oid, log);
}
-static int is_per_worktree_ref(const char *refname)
+int is_per_worktree_ref(const char *refname)
{
return starts_with(refname, "refs/worktree/") ||
starts_with(refname, "refs/bisect/") ||
@@ -738,37 +853,104 @@ static int is_pseudoref_syntax(const char *refname)
return 0;
}
+ /*
+ * HEAD is not a pseudoref, but it certainly uses the
+ * pseudoref syntax.
+ */
return 1;
}
-static int is_main_pseudoref_syntax(const char *refname)
+int is_pseudoref(struct ref_store *refs, const char *refname)
{
- return skip_prefix(refname, "main-worktree/", &refname) &&
- *refname &&
- is_pseudoref_syntax(refname);
+ static const char *const irregular_pseudorefs[] = {
+ "AUTO_MERGE",
+ "BISECT_EXPECTED_REV",
+ "NOTES_MERGE_PARTIAL",
+ "NOTES_MERGE_REF",
+ "MERGE_AUTOSTASH",
+ };
+ struct object_id oid;
+ size_t i;
+
+ if (!is_pseudoref_syntax(refname))
+ return 0;
+
+ if (ends_with(refname, "_HEAD")) {
+ refs_resolve_ref_unsafe(refs, refname,
+ RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
+ &oid, NULL);
+ return !is_null_oid(&oid);
+ }
+
+ for (i = 0; i < ARRAY_SIZE(irregular_pseudorefs); i++)
+ if (!strcmp(refname, irregular_pseudorefs[i])) {
+ refs_resolve_ref_unsafe(refs, refname,
+ RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
+ &oid, NULL);
+ return !is_null_oid(&oid);
+ }
+
+ return 0;
}
-static int is_other_pseudoref_syntax(const char *refname)
+int is_headref(struct ref_store *refs, const char *refname)
{
- if (!skip_prefix(refname, "worktrees/", &refname))
- return 0;
- refname = strchr(refname, '/');
- if (!refname || !refname[1])
- return 0;
- return is_pseudoref_syntax(refname + 1);
+ if (!strcmp(refname, "HEAD"))
+ return refs_ref_exists(refs, refname);
+
+ return 0;
+}
+
+static int is_current_worktree_ref(const char *ref) {
+ return is_pseudoref_syntax(ref) || is_per_worktree_ref(ref);
}
-enum ref_type ref_type(const char *refname)
+enum ref_worktree_type parse_worktree_ref(const char *maybe_worktree_ref,
+ const char **worktree_name, int *worktree_name_length,
+ const char **bare_refname)
{
- if (is_per_worktree_ref(refname))
- return REF_TYPE_PER_WORKTREE;
- if (is_pseudoref_syntax(refname))
- return REF_TYPE_PSEUDOREF;
- if (is_main_pseudoref_syntax(refname))
- return REF_TYPE_MAIN_PSEUDOREF;
- if (is_other_pseudoref_syntax(refname))
- return REF_TYPE_OTHER_PSEUDOREF;
- return REF_TYPE_NORMAL;
+ const char *name_dummy;
+ int name_length_dummy;
+ const char *ref_dummy;
+
+ if (!worktree_name)
+ worktree_name = &name_dummy;
+ if (!worktree_name_length)
+ worktree_name_length = &name_length_dummy;
+ if (!bare_refname)
+ bare_refname = &ref_dummy;
+
+ if (skip_prefix(maybe_worktree_ref, "worktrees/", bare_refname)) {
+ const char *slash = strchr(*bare_refname, '/');
+
+ *worktree_name = *bare_refname;
+ if (!slash) {
+ *worktree_name_length = strlen(*worktree_name);
+
+ /* This is an error condition, and the caller tell because the bare_refname is "" */
+ *bare_refname = *worktree_name + *worktree_name_length;
+ return REF_WORKTREE_OTHER;
+ }
+
+ *worktree_name_length = slash - *bare_refname;
+ *bare_refname = slash + 1;
+
+ if (is_current_worktree_ref(*bare_refname))
+ return REF_WORKTREE_OTHER;
+ }
+
+ *worktree_name = NULL;
+ *worktree_name_length = 0;
+
+ if (skip_prefix(maybe_worktree_ref, "main-worktree/", bare_refname)
+ && is_current_worktree_ref(*bare_refname))
+ return REF_WORKTREE_MAIN;
+
+ *bare_refname = maybe_worktree_ref;
+ if (is_current_worktree_ref(maybe_worktree_ref))
+ return REF_WORKTREE_CURRENT;
+
+ return REF_WORKTREE_SHARED;
}
long get_files_ref_lock_timeout_ms(void)
@@ -893,68 +1075,57 @@ static void set_read_ref_cutoffs(struct read_ref_at_cb *cb,
}
static int read_ref_at_ent(struct object_id *ooid, struct object_id *noid,
- const char *email, timestamp_t timestamp, int tz,
- const char *message, void *cb_data)
+ const char *email UNUSED,
+ timestamp_t timestamp, int tz,
+ const char *message, void *cb_data)
{
struct read_ref_at_cb *cb = cb_data;
- int reached_count;
cb->tz = tz;
cb->date = timestamp;
- /*
- * It is not possible for cb->cnt == 0 on the first iteration because
- * that special case is handled in read_ref_at().
- */
- if (cb->cnt > 0)
- cb->cnt--;
- reached_count = cb->cnt == 0 && !is_null_oid(ooid);
- if (timestamp <= cb->at_time || reached_count) {
+ if (timestamp <= cb->at_time || cb->cnt == 0) {
set_read_ref_cutoffs(cb, timestamp, tz, message);
/*
* we have not yet updated cb->[n|o]oid so they still
* hold the values for the previous record.
*/
- if (!is_null_oid(&cb->ooid) && !oideq(&cb->ooid, noid))
- warning(_("log for ref %s has gap after %s"),
+ if (!is_null_oid(&cb->ooid)) {
+ oidcpy(cb->oid, noid);
+ if (!oideq(&cb->ooid, noid))
+ warning(_("log for ref %s has gap after %s"),
cb->refname, show_date(cb->date, cb->tz, DATE_MODE(RFC2822)));
- if (reached_count)
- oidcpy(cb->oid, ooid);
- else if (!is_null_oid(&cb->ooid) || cb->date == cb->at_time)
+ }
+ else if (cb->date == cb->at_time)
oidcpy(cb->oid, noid);
else if (!oideq(noid, cb->oid))
warning(_("log for ref %s unexpectedly ended on %s"),
cb->refname, show_date(cb->date, cb->tz,
DATE_MODE(RFC2822)));
+ cb->reccnt++;
+ oidcpy(&cb->ooid, ooid);
+ oidcpy(&cb->noid, noid);
cb->found_it = 1;
+ return 1;
}
cb->reccnt++;
oidcpy(&cb->ooid, ooid);
oidcpy(&cb->noid, noid);
- return cb->found_it;
-}
-
-static int read_ref_at_ent_newest(struct object_id *ooid, struct object_id *noid,
- const char *email, timestamp_t timestamp,
- int tz, const char *message, void *cb_data)
-{
- struct read_ref_at_cb *cb = cb_data;
-
- set_read_ref_cutoffs(cb, timestamp, tz, message);
- oidcpy(cb->oid, noid);
- /* We just want the first entry */
- return 1;
+ if (cb->cnt > 0)
+ cb->cnt--;
+ return 0;
}
static int read_ref_at_ent_oldest(struct object_id *ooid, struct object_id *noid,
- const char *email, timestamp_t timestamp,
- int tz, const char *message, void *cb_data)
+ const char *email UNUSED,
+ timestamp_t timestamp, int tz,
+ const char *message, void *cb_data)
{
struct read_ref_at_cb *cb = cb_data;
set_read_ref_cutoffs(cb, timestamp, tz, message);
oidcpy(cb->oid, ooid);
- if (is_null_oid(cb->oid))
+ if (cb->at_time && is_null_oid(cb->oid))
oidcpy(cb->oid, noid);
/* We just want the first entry */
return 1;
@@ -977,14 +1148,24 @@ int read_ref_at(struct ref_store *refs, const char *refname,
cb.cutoff_cnt = cutoff_cnt;
cb.oid = oid;
- if (cb.cnt == 0) {
- refs_for_each_reflog_ent_reverse(refs, refname, read_ref_at_ent_newest, &cb);
- return 0;
- }
-
refs_for_each_reflog_ent_reverse(refs, refname, read_ref_at_ent, &cb);
if (!cb.reccnt) {
+ if (cnt == 0) {
+ /*
+ * The caller asked for ref@{0}, and we had no entries.
+ * It's a bit subtle, but in practice all callers have
+ * prepped the "oid" field with the current value of
+ * the ref, which is the most reasonable fallback.
+ *
+ * We'll put dummy values into the out-parameters (so
+ * they're not just uninitialized garbage), and the
+ * caller can take our return value as a hint that
+ * we did not find any such reflog.
+ */
+ set_read_ref_cutoffs(&cb, 0, 0, "empty reflog");
+ return 1;
+ }
if (flags & GET_OID_QUIETLY)
exit(128);
else
@@ -1191,65 +1372,68 @@ int update_ref(const char *msg, const char *refname,
old_oid, flags, onerr);
}
+/*
+ * Check that the string refname matches a rule of the form
+ * "{prefix}%.*s{suffix}". So "foo/bar/baz" would match the rule
+ * "foo/%.*s/baz", and return the string "bar".
+ */
+static const char *match_parse_rule(const char *refname, const char *rule,
+ size_t *len)
+{
+ /*
+ * Check that rule matches refname up to the first percent in the rule.
+ * We can bail immediately if not, but otherwise we leave "rule" at the
+ * %-placeholder, and "refname" at the start of the potential matched
+ * name.
+ */
+ while (*rule != '%') {
+ if (!*rule)
+ BUG("rev-parse rule did not have percent");
+ if (*refname++ != *rule++)
+ return NULL;
+ }
+
+ /*
+ * Check that our "%" is the expected placeholder. This assumes there
+ * are no other percents (placeholder or quoted) in the string, but
+ * that is sufficient for our rev-parse rules.
+ */
+ if (!skip_prefix(rule, "%.*s", &rule))
+ return NULL;
+
+ /*
+ * And now check that our suffix (if any) matches.
+ */
+ if (!strip_suffix(refname, rule, len))
+ return NULL;
+
+ return refname; /* len set by strip_suffix() */
+}
+
char *refs_shorten_unambiguous_ref(struct ref_store *refs,
const char *refname, int strict)
{
int i;
- static char **scanf_fmts;
- static int nr_rules;
- char *short_name;
struct strbuf resolved_buf = STRBUF_INIT;
- if (!nr_rules) {
- /*
- * Pre-generate scanf formats from ref_rev_parse_rules[].
- * Generate a format suitable for scanf from a
- * ref_rev_parse_rules rule by interpolating "%s" at the
- * location of the "%.*s".
- */
- size_t total_len = 0;
- size_t offset = 0;
-
- /* the rule list is NULL terminated, count them first */
- for (nr_rules = 0; ref_rev_parse_rules[nr_rules]; nr_rules++)
- /* -2 for strlen("%.*s") - strlen("%s"); +1 for NUL */
- total_len += strlen(ref_rev_parse_rules[nr_rules]) - 2 + 1;
-
- scanf_fmts = xmalloc(st_add(st_mult(sizeof(char *), nr_rules), total_len));
-
- offset = 0;
- for (i = 0; i < nr_rules; i++) {
- assert(offset < total_len);
- scanf_fmts[i] = (char *)&scanf_fmts[nr_rules] + offset;
- offset += xsnprintf(scanf_fmts[i], total_len - offset,
- ref_rev_parse_rules[i], 2, "%s") + 1;
- }
- }
-
- /* bail out if there are no rules */
- if (!nr_rules)
- return xstrdup(refname);
-
- /* buffer for scanf result, at most refname must fit */
- short_name = xstrdup(refname);
-
/* skip first rule, it will always match */
- for (i = nr_rules - 1; i > 0 ; --i) {
+ for (i = NUM_REV_PARSE_RULES - 1; i > 0 ; --i) {
int j;
int rules_to_fail = i;
- int short_name_len;
+ const char *short_name;
+ size_t short_name_len;
- if (1 != sscanf(refname, scanf_fmts[i], short_name))
+ short_name = match_parse_rule(refname, ref_rev_parse_rules[i],
+ &short_name_len);
+ if (!short_name)
continue;
- short_name_len = strlen(short_name);
-
/*
* in strict mode, all (except the matched one) rules
* must fail to resolve to a valid non-ambiguous ref
*/
if (strict)
- rules_to_fail = nr_rules;
+ rules_to_fail = NUM_REV_PARSE_RULES;
/*
* check if the short name resolves to a valid ref,
@@ -1269,7 +1453,8 @@ char *refs_shorten_unambiguous_ref(struct ref_store *refs,
*/
strbuf_reset(&resolved_buf);
strbuf_addf(&resolved_buf, rule,
- short_name_len, short_name);
+ cast_size_t_to_int(short_name_len),
+ short_name);
if (refs_ref_exists(refs, resolved_buf.buf))
break;
}
@@ -1280,12 +1465,11 @@ char *refs_shorten_unambiguous_ref(struct ref_store *refs,
*/
if (j == rules_to_fail) {
strbuf_release(&resolved_buf);
- return short_name;
+ return xmemdupz(short_name, short_name_len);
}
}
strbuf_release(&resolved_buf);
- free(short_name);
return xstrdup(refname);
}
@@ -1295,9 +1479,8 @@ char *shorten_unambiguous_ref(const char *refname, int strict)
refname, strict);
}
-static struct string_list *hide_refs;
-
-int parse_hide_refs_config(const char *var, const char *value, const char *section)
+int parse_hide_refs_config(const char *var, const char *value, const char *section,
+ struct strvec *hide_refs)
{
const char *key;
if (!strcmp("transfer.hiderefs", var) ||
@@ -1308,27 +1491,23 @@ int parse_hide_refs_config(const char *var, const char *value, const char *secti
if (!value)
return config_error_nonbool(var);
- ref = xstrdup(value);
+
+ /* drop const to remove trailing '/' characters */
+ ref = (char *)strvec_push(hide_refs, value);
len = strlen(ref);
while (len && ref[len - 1] == '/')
ref[--len] = '\0';
- if (!hide_refs) {
- CALLOC_ARRAY(hide_refs, 1);
- hide_refs->strdup_strings = 1;
- }
- string_list_append(hide_refs, ref);
}
return 0;
}
-int ref_is_hidden(const char *refname, const char *refname_full)
+int ref_is_hidden(const char *refname, const char *refname_full,
+ const struct strvec *hide_refs)
{
int i;
- if (!hide_refs)
- return 0;
for (i = hide_refs->nr - 1; i >= 0; i--) {
- const char *match = hide_refs->items[i].string;
+ const char *match = hide_refs->v[i];
const char *subject;
int neg = 0;
const char *p;
@@ -1354,6 +1533,30 @@ int ref_is_hidden(const char *refname, const char *refname_full)
return 0;
}
+const char **hidden_refs_to_excludes(const struct strvec *hide_refs)
+{
+ const char **pattern;
+ for (pattern = hide_refs->v; *pattern; pattern++) {
+ /*
+ * We can't feed any excludes from hidden refs config
+ * sections, since later rules may override previous
+ * ones. For example, with rules "refs/foo" and
+ * "!refs/foo/bar", we should show "refs/foo/bar" (and
+ * everything underneath it), but the earlier exclusion
+ * would cause us to skip all of "refs/foo". We
+ * likewise don't implement the namespace stripping
+ * required for '^' rules.
+ *
+ * Both are possible to do, but complicated, so avoid
+ * populating the jump list at all if we see either of
+ * these patterns.
+ */
+ if (**pattern == '!' || **pattern == '^')
+ return NULL;
+ }
+ return hide_refs->v;
+}
+
const char *find_descendant_ref(const char *dirname,
const struct string_list *extras,
const struct string_list *skip)
@@ -1401,7 +1604,9 @@ int head_ref(each_ref_fn fn, void *cb_data)
struct ref_iterator *refs_ref_iterator_begin(
struct ref_store *refs,
- const char *prefix, int trim,
+ const char *prefix,
+ const char **exclude_patterns,
+ int trim,
enum do_for_each_ref_flags flags)
{
struct ref_iterator *iter;
@@ -1417,8 +1622,7 @@ struct ref_iterator *refs_ref_iterator_begin(
}
}
- iter = refs->be->iterator_begin(refs, prefix, flags);
-
+ iter = refs->be->iterator_begin(refs, prefix, exclude_patterns, flags);
/*
* `iterator_begin()` already takes care of prefix, but we
* might need to do some trimming:
@@ -1426,10 +1630,6 @@ struct ref_iterator *refs_ref_iterator_begin(
if (trim)
iter = prefix_ref_iterator_begin(iter, "", trim);
- /* Sanity check for subclasses: */
- if (!iter->ordered)
- BUG("reference iterator is not ordered");
-
return iter;
}
@@ -1452,7 +1652,7 @@ static int do_for_each_repo_ref(struct repository *r, const char *prefix,
if (!refs)
return 0;
- iter = refs_ref_iterator_begin(refs, prefix, trim, flags);
+ iter = refs_ref_iterator_begin(refs, prefix, NULL, trim, flags);
return do_for_each_repo_ref_iterator(r, iter, fn, cb_data);
}
@@ -1462,7 +1662,7 @@ struct do_for_each_ref_help {
void *cb_data;
};
-static int do_for_each_ref_helper(struct repository *r,
+static int do_for_each_ref_helper(struct repository *r UNUSED,
const char *refname,
const struct object_id *oid,
int flags,
@@ -1474,6 +1674,7 @@ static int do_for_each_ref_helper(struct repository *r,
}
static int do_for_each_ref(struct ref_store *refs, const char *prefix,
+ const char **exclude_patterns,
each_ref_fn fn, int trim,
enum do_for_each_ref_flags flags, void *cb_data)
{
@@ -1483,7 +1684,8 @@ static int do_for_each_ref(struct ref_store *refs, const char *prefix,
if (!refs)
return 0;
- iter = refs_ref_iterator_begin(refs, prefix, trim, flags);
+ iter = refs_ref_iterator_begin(refs, prefix, exclude_patterns, trim,
+ flags);
return do_for_each_repo_ref_iterator(the_repository, iter,
do_for_each_ref_helper, &hp);
@@ -1491,7 +1693,7 @@ static int do_for_each_ref(struct ref_store *refs, const char *prefix,
int refs_for_each_ref(struct ref_store *refs, each_ref_fn fn, void *cb_data)
{
- return do_for_each_ref(refs, "", fn, 0, 0, cb_data);
+ return do_for_each_ref(refs, "", NULL, fn, 0, 0, cb_data);
}
int for_each_ref(each_ref_fn fn, void *cb_data)
@@ -1502,7 +1704,7 @@ int for_each_ref(each_ref_fn fn, void *cb_data)
int refs_for_each_ref_in(struct ref_store *refs, const char *prefix,
each_ref_fn fn, void *cb_data)
{
- return do_for_each_ref(refs, prefix, fn, strlen(prefix), 0, cb_data);
+ return do_for_each_ref(refs, prefix, NULL, fn, strlen(prefix), 0, cb_data);
}
int for_each_ref_in(const char *prefix, each_ref_fn fn, void *cb_data)
@@ -1513,36 +1715,39 @@ int for_each_ref_in(const char *prefix, each_ref_fn fn, void *cb_data)
int for_each_fullref_in(const char *prefix, each_ref_fn fn, void *cb_data)
{
return do_for_each_ref(get_main_ref_store(the_repository),
- prefix, fn, 0, 0, cb_data);
+ prefix, NULL, fn, 0, 0, cb_data);
}
int refs_for_each_fullref_in(struct ref_store *refs, const char *prefix,
+ const char **exclude_patterns,
each_ref_fn fn, void *cb_data)
{
- return do_for_each_ref(refs, prefix, fn, 0, 0, cb_data);
+ return do_for_each_ref(refs, prefix, exclude_patterns, fn, 0, 0, cb_data);
}
int for_each_replace_ref(struct repository *r, each_repo_ref_fn fn, void *cb_data)
{
+ const char *git_replace_ref_base = ref_namespace[NAMESPACE_REPLACE].ref;
return do_for_each_repo_ref(r, git_replace_ref_base, fn,
strlen(git_replace_ref_base),
DO_FOR_EACH_INCLUDE_BROKEN, cb_data);
}
-int for_each_namespaced_ref(each_ref_fn fn, void *cb_data)
+int for_each_namespaced_ref(const char **exclude_patterns,
+ each_ref_fn fn, void *cb_data)
{
struct strbuf buf = STRBUF_INIT;
int ret;
strbuf_addf(&buf, "%srefs/", get_git_namespace());
ret = do_for_each_ref(get_main_ref_store(the_repository),
- buf.buf, fn, 0, 0, cb_data);
+ buf.buf, exclude_patterns, fn, 0, 0, cb_data);
strbuf_release(&buf);
return ret;
}
int refs_for_each_rawref(struct ref_store *refs, each_ref_fn fn, void *cb_data)
{
- return do_for_each_ref(refs, "", fn, 0,
+ return do_for_each_ref(refs, "", NULL, fn, 0,
DO_FOR_EACH_INCLUDE_BROKEN, cb_data);
}
@@ -1551,6 +1756,13 @@ int for_each_rawref(each_ref_fn fn, void *cb_data)
return refs_for_each_rawref(get_main_ref_store(the_repository), fn, cb_data);
}
+int refs_for_each_include_root_refs(struct ref_store *refs, each_ref_fn fn,
+ void *cb_data)
+{
+ return do_for_each_ref(refs, "", NULL, fn, 0,
+ DO_FOR_EACH_INCLUDE_ROOT_REFS, cb_data);
+}
+
static int qsort_strcmp(const void *va, const void *vb)
{
const char *a = *(const char **)va;
@@ -1609,9 +1821,11 @@ static void find_longest_prefixes(struct string_list *out,
strbuf_release(&prefix);
}
-int for_each_fullref_in_prefixes(const char *namespace,
- const char **patterns,
- each_ref_fn fn, void *cb_data)
+int refs_for_each_fullref_in_prefixes(struct ref_store *ref_store,
+ const char *namespace,
+ const char **patterns,
+ const char **exclude_patterns,
+ each_ref_fn fn, void *cb_data)
{
struct string_list prefixes = STRING_LIST_INIT_DUP;
struct string_list_item *prefix;
@@ -1626,7 +1840,8 @@ int for_each_fullref_in_prefixes(const char *namespace,
for_each_string_list_item(prefix, &prefixes) {
strbuf_addstr(&buf, prefix->string);
- ret = for_each_fullref_in(buf.buf, fn, cb_data);
+ ret = refs_for_each_fullref_in(ref_store, buf.buf,
+ exclude_patterns, fn, cb_data);
if (ret)
break;
strbuf_setlen(&buf, namespace_len);
@@ -1647,8 +1862,10 @@ static int refs_read_special_head(struct ref_store *ref_store,
int result = -1;
strbuf_addf(&full_path, "%s/%s", ref_store->gitdir, refname);
- if (strbuf_read_file(&content, full_path.buf, 0) < 0)
+ if (strbuf_read_file(&content, full_path.buf, 0) < 0) {
+ *failure_errno = errno;
goto done;
+ }
result = parse_loose_ref_contents(content.buf, oid, referent, type,
failure_errno);
@@ -1659,15 +1876,45 @@ done:
return result;
}
+static int is_special_ref(const char *refname)
+{
+ /*
+ * Special references are refs that have different semantics compared
+ * to "normal" refs. These refs can thus not be stored in the ref
+ * backend, but must always be accessed via the filesystem. The
+ * following refs are special:
+ *
+ * - FETCH_HEAD may contain multiple object IDs, and each one of them
+ * carries additional metadata like where it came from.
+ *
+ * - MERGE_HEAD may contain multiple object IDs when merging multiple
+ * heads.
+ *
+ * Reading, writing or deleting references must consistently go either
+ * through the filesystem (special refs) or through the reference
+ * backend (normal ones).
+ */
+ static const char * const special_refs[] = {
+ "FETCH_HEAD",
+ "MERGE_HEAD",
+ };
+ size_t i;
+
+ for (i = 0; i < ARRAY_SIZE(special_refs); i++)
+ if (!strcmp(refname, special_refs[i]))
+ return 1;
+
+ return 0;
+}
+
int refs_read_raw_ref(struct ref_store *ref_store, const char *refname,
struct object_id *oid, struct strbuf *referent,
unsigned int *type, int *failure_errno)
{
assert(failure_errno);
- if (!strcmp(refname, "FETCH_HEAD") || !strcmp(refname, "MERGE_HEAD")) {
+ if (is_special_ref(refname))
return refs_read_special_head(ref_store, refname, oid, referent,
type, failure_errno);
- }
return ref_store->be->read_raw_ref(ref_store, refname, oid, referent,
type, failure_errno);
@@ -1703,7 +1950,7 @@ const char *refs_resolve_ref_unsafe(struct ref_store *refs,
return NULL;
/*
- * dwim_ref() uses REF_ISBROKEN to distinguish between
+ * repo_dwim_ref() uses REF_ISBROKEN to distinguish between
* missing refs and refs that were present but invalid,
* to complain about the latter to stderr.
*
@@ -1769,11 +2016,9 @@ const char *refs_resolve_ref_unsafe(struct ref_store *refs,
}
/* backend functions */
-int refs_init_db(struct strbuf *err)
+int refs_init_db(struct ref_store *refs, int flags, struct strbuf *err)
{
- struct ref_store *refs = get_main_ref_store(the_repository);
-
- return refs->be->init_db(refs, err);
+ return refs->be->init_db(refs, flags, err);
}
const char *resolve_ref_unsafe(const char *refname, int resolve_flags,
@@ -1810,7 +2055,7 @@ struct ref_store_hash_entry
char name[FLEX_ARRAY];
};
-static int ref_store_hash_cmp(const void *unused_cmp_data,
+static int ref_store_hash_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *keydata)
@@ -1870,12 +2115,12 @@ static struct ref_store *ref_store_init(struct repository *repo,
const char *gitdir,
unsigned int flags)
{
- const char *be_name = "files";
- struct ref_storage_be *be = find_ref_storage_backend(be_name);
+ const struct ref_storage_be *be;
struct ref_store *refs;
+ be = find_ref_storage_backend(repo->ref_storage_format);
if (!be)
- BUG("reference backend %s is unknown", be_name);
+ BUG("reference backend is unknown");
refs = be->init(repo, gitdir, flags);
return refs;
@@ -2006,9 +2251,9 @@ void base_ref_store_init(struct ref_store *refs, struct repository *repo,
}
/* backend functions */
-int refs_pack_refs(struct ref_store *refs, unsigned int flags)
+int refs_pack_refs(struct ref_store *refs, struct pack_refs_opts *opts)
{
- return refs->be->pack_refs(refs, flags);
+ return refs->be->pack_refs(refs, opts);
}
int peel_iterated_oid(const struct object_id *base, struct object_id *peeled)
@@ -2281,7 +2526,7 @@ int refs_verify_refname_available(struct ref_store *refs,
strbuf_addstr(&dirname, refname + dirname.len);
strbuf_addch(&dirname, '/');
- iter = refs_ref_iterator_begin(refs, dirname.buf, 0,
+ iter = refs_ref_iterator_begin(refs, dirname.buf, NULL, 0,
DO_FOR_EACH_INCLUDE_BROKEN);
while ((ok = ref_iterator_advance(iter)) == ITER_OK) {
if (skip &&
@@ -2310,18 +2555,33 @@ cleanup:
return ret;
}
-int refs_for_each_reflog(struct ref_store *refs, each_ref_fn fn, void *cb_data)
+struct do_for_each_reflog_help {
+ each_reflog_fn *fn;
+ void *cb_data;
+};
+
+static int do_for_each_reflog_helper(struct repository *r UNUSED,
+ const char *refname,
+ const struct object_id *oid UNUSED,
+ int flags,
+ void *cb_data)
+{
+ struct do_for_each_reflog_help *hp = cb_data;
+ return hp->fn(refname, hp->cb_data);
+}
+
+int refs_for_each_reflog(struct ref_store *refs, each_reflog_fn fn, void *cb_data)
{
struct ref_iterator *iter;
- struct do_for_each_ref_help hp = { fn, cb_data };
+ struct do_for_each_reflog_help hp = { fn, cb_data };
iter = refs->be->reflog_iterator_begin(refs);
return do_for_each_repo_ref_iterator(the_repository, iter,
- do_for_each_ref_helper, &hp);
+ do_for_each_reflog_helper, &hp);
}
-int for_each_reflog(each_ref_fn fn, void *cb_data)
+int for_each_reflog(each_reflog_fn fn, void *cb_data)
{
return refs_for_each_reflog(get_main_ref_store(the_repository), fn, cb_data);
}
@@ -2440,13 +2700,55 @@ void ref_transaction_for_each_queued_update(struct ref_transaction *transaction,
int refs_delete_refs(struct ref_store *refs, const char *logmsg,
struct string_list *refnames, unsigned int flags)
{
+ struct ref_transaction *transaction;
+ struct strbuf err = STRBUF_INIT;
+ struct string_list_item *item;
+ int ret = 0, failures = 0;
char *msg;
- int retval;
+
+ if (!refnames->nr)
+ return 0;
msg = normalize_reflog_message(logmsg);
- retval = refs->be->delete_refs(refs, msg, refnames, flags);
+
+ /*
+ * Since we don't check the references' old_oids, the
+ * individual updates can't fail, so we can pack all of the
+ * updates into a single transaction.
+ */
+ transaction = ref_store_transaction_begin(refs, &err);
+ if (!transaction) {
+ ret = error("%s", err.buf);
+ goto out;
+ }
+
+ for_each_string_list_item(item, refnames) {
+ ret = ref_transaction_delete(transaction, item->string,
+ NULL, flags, msg, &err);
+ if (ret) {
+ warning(_("could not delete reference %s: %s"),
+ item->string, err.buf);
+ strbuf_reset(&err);
+ failures = 1;
+ }
+ }
+
+ ret = ref_transaction_commit(transaction, &err);
+ if (ret) {
+ if (refnames->nr == 1)
+ error(_("could not delete reference %s: %s"),
+ refnames->items[0].string, err.buf);
+ else
+ error(_("could not delete references: %s"), err.buf);
+ }
+
+out:
+ if (!ret && failures)
+ ret = -1;
+ ref_transaction_free(transaction);
+ strbuf_release(&err);
free(msg);
- return retval;
+ return ret;
}
int delete_refs(const char *msg, struct string_list *refnames,
diff --git a/refs.h b/refs.h
index 47cb9ed..d278775 100644
--- a/refs.h
+++ b/refs.h
@@ -1,7 +1,7 @@
#ifndef REFS_H
#define REFS_H
-#include "cache.h"
+#include "commit.h"
struct object_id;
struct ref_store;
@@ -11,6 +11,9 @@ struct string_list;
struct string_list_item;
struct worktree;
+unsigned int ref_storage_format_by_name(const char *name);
+const char *ref_storage_format_to_name(unsigned int ref_storage_format);
+
/*
* Resolve a reference, recursively following symbolic refererences.
*
@@ -56,7 +59,7 @@ struct worktree;
* Even with RESOLVE_REF_ALLOW_BAD_NAME, names that escape the refs/
* directory and do not consist of all caps and underscores cannot be
* resolved. The function returns NULL for such ref names.
- * Caps and underscores refers to the special refs, such as HEAD,
+ * Caps and underscores refers to the pseudorefs, such as HEAD,
* FETCH_HEAD and friends, that all live outside of the refs/ directory.
*/
#define RESOLVE_REF_READING 0x01
@@ -117,7 +120,9 @@ int should_autocreate_reflog(const char *refname);
int is_branch(const char *refname);
-int refs_init_db(struct strbuf *err);
+#define REFS_INIT_DB_IS_WORKTREE (1 << 0)
+
+int refs_init_db(struct ref_store *refs, int flags, struct strbuf *err);
/*
* Return the peeled value of the oid currently being iterated via
@@ -158,12 +163,6 @@ int expand_ref(struct repository *r, const char *str, int len, struct object_id
int repo_dwim_ref(struct repository *r, const char *str, int len,
struct object_id *oid, char **ref, int nonfatal_dangling_mark);
int repo_dwim_log(struct repository *r, const char *str, int len, struct object_id *oid, char **ref);
-static inline int dwim_ref(const char *str, int len, struct object_id *oid,
- char **ref, int nonfatal_dangling_mark)
-{
- return repo_dwim_ref(the_repository, str, len, oid, ref,
- nonfatal_dangling_mark);
-}
int dwim_log(const char *str, int len, struct object_id *oid, char **ref);
/*
@@ -343,7 +342,12 @@ int for_each_ref(each_ref_fn fn, void *cb_data);
*/
int for_each_ref_in(const char *prefix, each_ref_fn fn, void *cb_data);
+/*
+ * references matching any pattern in "exclude_patterns" are omitted from the
+ * result set on a best-effort basis.
+ */
int refs_for_each_fullref_in(struct ref_store *refs, const char *prefix,
+ const char **exclude_patterns,
each_ref_fn fn, void *cb_data);
int for_each_fullref_in(const char *prefix, each_ref_fn fn, void *cb_data);
@@ -351,10 +355,17 @@ int for_each_fullref_in(const char *prefix, each_ref_fn fn, void *cb_data);
* iterate all refs in "patterns" by partitioning patterns into disjoint sets
* and iterating the longest-common prefix of each set.
*
+ * references matching any pattern in "exclude_patterns" are omitted from the
+ * result set on a best-effort basis.
+ *
* callers should be prepared to ignore references that they did not ask for.
*/
-int for_each_fullref_in_prefixes(const char *namespace, const char **patterns,
- each_ref_fn fn, void *cb_data);
+int refs_for_each_fullref_in_prefixes(struct ref_store *refs,
+ const char *namespace,
+ const char **patterns,
+ const char **exclude_patterns,
+ each_ref_fn fn, void *cb_data);
+
/**
* iterate refs from the respective area.
*/
@@ -370,13 +381,24 @@ int for_each_glob_ref_in(each_ref_fn fn, const char *pattern,
const char *prefix, void *cb_data);
int head_ref_namespaced(each_ref_fn fn, void *cb_data);
-int for_each_namespaced_ref(each_ref_fn fn, void *cb_data);
+/*
+ * references matching any pattern in "exclude_patterns" are omitted from the
+ * result set on a best-effort basis.
+ */
+int for_each_namespaced_ref(const char **exclude_patterns,
+ each_ref_fn fn, void *cb_data);
/* can be used to learn about broken ref and symref */
int refs_for_each_rawref(struct ref_store *refs, each_ref_fn fn, void *cb_data);
int for_each_rawref(each_ref_fn fn, void *cb_data);
/*
+ * Iterates over all refs including root refs, i.e. pseudorefs and HEAD.
+ */
+int refs_for_each_include_root_refs(struct ref_store *refs, each_ref_fn fn,
+ void *cb_data);
+
+/*
* Normalizes partial refs to their fully qualified form.
* Will prepend <prefix> to the <pattern> if it doesn't start with 'refs/'.
* <prefix> will default to 'refs/' if NULL.
@@ -400,16 +422,24 @@ void warn_dangling_symrefs(FILE *fp, const char *msg_fmt,
/*
* Flags for controlling behaviour of pack_refs()
* PACK_REFS_PRUNE: Prune loose refs after packing
- * PACK_REFS_ALL: Pack _all_ refs, not just tags and already packed refs
+ * PACK_REFS_AUTO: Pack refs on a best effort basis. The heuristics and end
+ * result are decided by the ref backend. Backends may ignore
+ * this flag and fall back to a normal repack.
*/
-#define PACK_REFS_PRUNE 0x0001
-#define PACK_REFS_ALL 0x0002
+#define PACK_REFS_PRUNE (1 << 0)
+#define PACK_REFS_AUTO (1 << 1)
+
+struct pack_refs_opts {
+ unsigned int flags;
+ struct ref_exclusions *exclusions;
+ struct string_list *includes;
+};
/*
* Write a packed-refs file for the current repository.
* flags: Combination of the above PACK_REFS_* flags.
*/
-int refs_pack_refs(struct ref_store *refs, unsigned int flags);
+int refs_pack_refs(struct ref_store *refs, struct pack_refs_opts *opts);
/*
* Setup reflog before using. Fill in err and return -1 on failure.
@@ -418,7 +448,20 @@ int refs_create_reflog(struct ref_store *refs, const char *refname,
struct strbuf *err);
int safe_create_reflog(const char *refname, struct strbuf *err);
-/** Reads log for the value of ref during at_time. **/
+/**
+ * Reads log for the value of ref during at_time (in which case "cnt" should be
+ * negative) or the reflog "cnt" entries from the top (in which case "at_time"
+ * should be 0).
+ *
+ * If we found the reflog entry in question, returns 0 (and details of the
+ * entry can be found in the out-parameters).
+ *
+ * If we ran out of reflog entries, the out-parameters are filled with the
+ * details of the oldest entry we did find, and the function returns 1. Note
+ * that there is one important special case here! If the reflog was empty
+ * and the caller asked for the 0-th cnt, we will return "1" but leave the
+ * "oid" field untouched.
+ **/
int read_ref_at(struct ref_store *refs,
const char *refname, unsigned int flags,
timestamp_t at_time, int cnt,
@@ -513,11 +556,18 @@ int for_each_reflog_ent(const char *refname, each_reflog_ent_fn fn, void *cb_dat
int for_each_reflog_ent_reverse(const char *refname, each_reflog_ent_fn fn, void *cb_data);
/*
+ * The signature for the callback function for the {refs_,}for_each_reflog()
+ * functions below. The memory pointed to by the refname argument is only
+ * guaranteed to be valid for the duration of a single callback invocation.
+ */
+typedef int each_reflog_fn(const char *refname, void *cb_data);
+
+/*
* Calls the specified function for each reflog file until it returns nonzero,
* and returns the value. Reflog file order is unspecified.
*/
-int refs_for_each_reflog(struct ref_store *refs, each_ref_fn fn, void *cb_data);
-int for_each_reflog(each_ref_fn fn, void *cb_data);
+int refs_for_each_reflog(struct ref_store *refs, each_reflog_fn fn, void *cb_data);
+int for_each_reflog(each_reflog_fn fn, void *cb_data);
#define REFNAME_ALLOW_ONELEVEL 1
#define REFNAME_REFSPEC_PATTERN 2
@@ -807,7 +857,8 @@ int update_ref(const char *msg, const char *refname,
const struct object_id *new_oid, const struct object_id *old_oid,
unsigned int flags, enum action_on_err onerr);
-int parse_hide_refs_config(const char *var, const char *value, const char *);
+int parse_hide_refs_config(const char *var, const char *value, const char *,
+ struct strvec *);
/*
* Check whether a ref is hidden. If no namespace is set, both the first and
@@ -817,17 +868,42 @@ int parse_hide_refs_config(const char *var, const char *value, const char *);
* the ref is outside that namespace, the first parameter is NULL. The second
* parameter always points to the full ref name.
*/
-int ref_is_hidden(const char *, const char *);
+int ref_is_hidden(const char *, const char *, const struct strvec *);
-enum ref_type {
- REF_TYPE_PER_WORKTREE, /* refs inside refs/ but not shared */
- REF_TYPE_PSEUDOREF, /* refs outside refs/ in current worktree */
- REF_TYPE_MAIN_PSEUDOREF, /* pseudo refs from the main worktree */
- REF_TYPE_OTHER_PSEUDOREF, /* pseudo refs from other worktrees */
- REF_TYPE_NORMAL, /* normal/shared refs inside refs/ */
+/*
+ * Returns an array of patterns to use as excluded_patterns, if none of the
+ * hidden references use the token '!' or '^'.
+ */
+const char **hidden_refs_to_excludes(const struct strvec *hide_refs);
+
+/* Is this a per-worktree ref living in the refs/ namespace? */
+int is_per_worktree_ref(const char *refname);
+
+/* Describes how a refname relates to worktrees */
+enum ref_worktree_type {
+ REF_WORKTREE_CURRENT, /* implicitly per worktree, eg. HEAD or
+ refs/bisect/SOMETHING */
+ REF_WORKTREE_MAIN, /* explicitly in main worktree, eg.
+ main-worktree/HEAD */
+ REF_WORKTREE_OTHER, /* explicitly in named worktree, eg.
+ worktrees/bla/HEAD */
+ REF_WORKTREE_SHARED, /* the default, eg. refs/heads/main */
};
-enum ref_type ref_type(const char *refname);
+/*
+ * Parse a `maybe_worktree_ref` as a ref that possibly refers to a worktree ref
+ * (ie. either REFNAME, main-worktree/REFNAME or worktree/WORKTREE/REFNAME). It
+ * returns what kind of ref was found, and in case of REF_WORKTREE_OTHER, the
+ * worktree name is returned in `worktree_name` (pointing into
+ * `maybe_worktree_ref`) and `worktree_name_length`. The bare refname (the
+ * refname stripped of prefixes) is returned in `bare_refname`. The
+ * `worktree_name`, `worktree_name_length` and `bare_refname` arguments may be
+ * NULL.
+ */
+enum ref_worktree_type parse_worktree_ref(const char *maybe_worktree_ref,
+ const char **worktree_name,
+ int *worktree_name_length,
+ const char **bare_refname);
enum expire_reflog_flags {
EXPIRE_REFLOGS_DRY_RUN = 1 << 0,
@@ -930,4 +1006,52 @@ struct ref_store *get_main_ref_store(struct repository *r);
struct ref_store *get_submodule_ref_store(const char *submodule);
struct ref_store *get_worktree_ref_store(const struct worktree *wt);
+/*
+ * Some of the names specified by refs have special meaning to Git.
+ * Organize these namespaces in a comon 'ref_namespace' array for
+ * reference from multiple places in the codebase.
+ */
+
+struct ref_namespace_info {
+ char *ref;
+ enum decoration_type decoration;
+
+ /*
+ * If 'exact' is true, then we must match the 'ref' exactly.
+ * Otherwise, use a prefix match.
+ *
+ * 'ref_updated' is for internal use. It represents whether the
+ * 'ref' value was replaced from its original literal version.
+ */
+ unsigned exact:1,
+ ref_updated:1;
+};
+
+enum ref_namespace {
+ NAMESPACE_HEAD,
+ NAMESPACE_BRANCHES,
+ NAMESPACE_TAGS,
+ NAMESPACE_REMOTE_REFS,
+ NAMESPACE_STASH,
+ NAMESPACE_REPLACE,
+ NAMESPACE_NOTES,
+ NAMESPACE_PREFETCH,
+ NAMESPACE_REWRITTEN,
+
+ /* Must be last */
+ NAMESPACE__COUNT
+};
+
+/* See refs.c for the contents of this array. */
+extern struct ref_namespace_info ref_namespace[NAMESPACE__COUNT];
+
+/*
+ * Some ref namespaces can be modified by config values or environment
+ * variables. Modify a namespace as specified by its ref_namespace key.
+ */
+void update_ref_namespace(enum ref_namespace namespace, char *ref);
+
+int is_pseudoref(struct ref_store *refs, const char *refname);
+int is_headref(struct ref_store *refs, const char *refname);
+
#endif /* REFS_H */
diff --git a/refs/debug.c b/refs/debug.c
index eed8bc9..c7531b1 100644
--- a/refs/debug.c
+++ b/refs/debug.c
@@ -1,5 +1,7 @@
-
+#include "git-compat-util.h"
+#include "hex.h"
#include "refs-internal.h"
+#include "string-list.h"
#include "trace.h"
static struct trace_key trace_refs = TRACE_KEY_INIT(REFS);
@@ -31,10 +33,10 @@ struct ref_store *maybe_debug_wrap_ref_store(const char *gitdir, struct ref_stor
return (struct ref_store *)res;
}
-static int debug_init_db(struct ref_store *refs, struct strbuf *err)
+static int debug_init_db(struct ref_store *refs, int flags, struct strbuf *err)
{
struct debug_ref_store *drefs = (struct debug_ref_store *)refs;
- int res = drefs->refs->be->init_db(drefs->refs, err);
+ int res = drefs->refs->be->init_db(drefs->refs, flags, err);
trace_printf_key(&trace_refs, "init_db: %d\n", res);
return res;
}
@@ -121,10 +123,10 @@ static int debug_initial_transaction_commit(struct ref_store *refs,
return res;
}
-static int debug_pack_refs(struct ref_store *ref_store, unsigned int flags)
+static int debug_pack_refs(struct ref_store *ref_store, struct pack_refs_opts *opts)
{
struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store;
- int res = drefs->refs->be->pack_refs(drefs->refs, flags);
+ int res = drefs->refs->be->pack_refs(drefs->refs, opts);
trace_printf_key(&trace_refs, "pack_refs: %d\n", res);
return res;
}
@@ -141,20 +143,6 @@ static int debug_create_symref(struct ref_store *ref_store,
return res;
}
-static int debug_delete_refs(struct ref_store *ref_store, const char *msg,
- struct string_list *refnames, unsigned int flags)
-{
- struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store;
- int res =
- drefs->refs->be->delete_refs(drefs->refs, msg, refnames, flags);
- int i;
- trace_printf_key(&trace_refs, "delete_refs {\n");
- for (i = 0; i < refnames->nr; i++)
- trace_printf_key(&trace_refs, "%s\n", refnames->items[i].string);
- trace_printf_key(&trace_refs, "}: %d\n", res);
- return res;
-}
-
static int debug_rename_ref(struct ref_store *ref_store, const char *oldref,
const char *newref, const char *logmsg)
{
@@ -193,7 +181,6 @@ static int debug_ref_iterator_advance(struct ref_iterator *ref_iterator)
trace_printf_key(&trace_refs, "iterator_advance: %s (0)\n",
diter->iter->refname);
- diter->base.ordered = diter->iter->ordered;
diter->base.refname = diter->iter->refname;
diter->base.oid = diter->iter->oid;
diter->base.flags = diter->iter->flags;
@@ -227,13 +214,14 @@ static struct ref_iterator_vtable debug_ref_iterator_vtable = {
static struct ref_iterator *
debug_ref_iterator_begin(struct ref_store *ref_store, const char *prefix,
- unsigned int flags)
+ const char **exclude_patterns, unsigned int flags)
{
struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store;
struct ref_iterator *res =
- drefs->refs->be->iterator_begin(drefs->refs, prefix, flags);
+ drefs->refs->be->iterator_begin(drefs->refs, prefix,
+ exclude_patterns, flags);
struct debug_ref_iterator *diter = xcalloc(1, sizeof(*diter));
- base_ref_iterator_init(&diter->base, &debug_ref_iterator_vtable, 1);
+ base_ref_iterator_init(&diter->base, &debug_ref_iterator_vtable);
diter->iter = res;
trace_printf_key(&trace_refs, "ref_iterator_begin: \"%s\" (0x%x)\n",
prefix, flags);
@@ -437,7 +425,6 @@ static int debug_reflog_expire(struct ref_store *ref_store, const char *refname,
}
struct ref_storage_be refs_be_debug = {
- .next = NULL,
.name = "debug",
.init = NULL,
.init_db = debug_init_db,
@@ -455,7 +442,6 @@ struct ref_storage_be refs_be_debug = {
.pack_refs = debug_pack_refs,
.create_symref = debug_create_symref,
- .delete_refs = debug_delete_refs,
.rename_ref = debug_rename_ref,
.copy_ref = debug_copy_ref,
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 8db7882..a098d14 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1,16 +1,27 @@
-#include "../cache.h"
-#include "../config.h"
+#include "../git-compat-util.h"
+#include "../copy.h"
+#include "../environment.h"
+#include "../gettext.h"
+#include "../hash.h"
+#include "../hex.h"
#include "../refs.h"
#include "refs-internal.h"
#include "ref-cache.h"
#include "packed-backend.h"
+#include "../ident.h"
#include "../iterator.h"
#include "../dir-iterator.h"
#include "../lockfile.h"
#include "../object.h"
+#include "../object-file.h"
+#include "../path.h"
#include "../dir.h"
#include "../chdir-notify.h"
-#include "worktree.h"
+#include "../setup.h"
+#include "../wrapper.h"
+#include "../write-or-die.h"
+#include "../revision.h"
+#include <wildmatch.h>
/*
* This backend uses the following flags in `ref_update::flags` for
@@ -138,44 +149,30 @@ static struct files_ref_store *files_downcast(struct ref_store *ref_store,
return refs;
}
-static void files_reflog_path_other_worktrees(struct files_ref_store *refs,
- struct strbuf *sb,
- const char *refname)
-{
- const char *real_ref;
- const char *worktree_name;
- int length;
-
- if (parse_worktree_ref(refname, &worktree_name, &length, &real_ref))
- BUG("refname %s is not a other-worktree ref", refname);
-
- if (worktree_name)
- strbuf_addf(sb, "%s/worktrees/%.*s/logs/%s", refs->gitcommondir,
- length, worktree_name, real_ref);
- else
- strbuf_addf(sb, "%s/logs/%s", refs->gitcommondir,
- real_ref);
-}
-
static void files_reflog_path(struct files_ref_store *refs,
struct strbuf *sb,
const char *refname)
{
- switch (ref_type(refname)) {
- case REF_TYPE_PER_WORKTREE:
- case REF_TYPE_PSEUDOREF:
+ const char *bare_refname;
+ const char *wtname;
+ int wtname_len;
+ enum ref_worktree_type wt_type = parse_worktree_ref(
+ refname, &wtname, &wtname_len, &bare_refname);
+
+ switch (wt_type) {
+ case REF_WORKTREE_CURRENT:
strbuf_addf(sb, "%s/logs/%s", refs->base.gitdir, refname);
break;
- case REF_TYPE_OTHER_PSEUDOREF:
- case REF_TYPE_MAIN_PSEUDOREF:
- files_reflog_path_other_worktrees(refs, sb, refname);
+ case REF_WORKTREE_SHARED:
+ case REF_WORKTREE_MAIN:
+ strbuf_addf(sb, "%s/logs/%s", refs->gitcommondir, bare_refname);
break;
- case REF_TYPE_NORMAL:
- strbuf_addf(sb, "%s/logs/%s", refs->gitcommondir, refname);
+ case REF_WORKTREE_OTHER:
+ strbuf_addf(sb, "%s/worktrees/%.*s/logs/%s", refs->gitcommondir,
+ wtname_len, wtname, bare_refname);
break;
default:
- BUG("unknown ref type %d of ref %s",
- ref_type(refname), refname);
+ BUG("unknown ref type %d of ref %s", wt_type, refname);
}
}
@@ -183,22 +180,25 @@ static void files_ref_path(struct files_ref_store *refs,
struct strbuf *sb,
const char *refname)
{
- switch (ref_type(refname)) {
- case REF_TYPE_PER_WORKTREE:
- case REF_TYPE_PSEUDOREF:
+ const char *bare_refname;
+ const char *wtname;
+ int wtname_len;
+ enum ref_worktree_type wt_type = parse_worktree_ref(
+ refname, &wtname, &wtname_len, &bare_refname);
+ switch (wt_type) {
+ case REF_WORKTREE_CURRENT:
strbuf_addf(sb, "%s/%s", refs->base.gitdir, refname);
break;
- case REF_TYPE_MAIN_PSEUDOREF:
- if (!skip_prefix(refname, "main-worktree/", &refname))
- BUG("ref %s is not a main pseudoref", refname);
- /* fallthrough */
- case REF_TYPE_OTHER_PSEUDOREF:
- case REF_TYPE_NORMAL:
- strbuf_addf(sb, "%s/%s", refs->gitcommondir, refname);
+ case REF_WORKTREE_OTHER:
+ strbuf_addf(sb, "%s/worktrees/%.*s/%s", refs->gitcommondir,
+ wtname_len, wtname, bare_refname);
+ break;
+ case REF_WORKTREE_SHARED:
+ case REF_WORKTREE_MAIN:
+ strbuf_addf(sb, "%s/%s", refs->gitcommondir, bare_refname);
break;
default:
- BUG("unknown ref type %d of ref %s",
- ref_type(refname), refname);
+ BUG("unknown ref type %d of ref %s", wt_type, refname);
}
}
@@ -229,6 +229,38 @@ static void add_per_worktree_entries_to_dir(struct ref_dir *dir, const char *dir
}
}
+static void loose_fill_ref_dir_regular_file(struct files_ref_store *refs,
+ const char *refname,
+ struct ref_dir *dir)
+{
+ struct object_id oid;
+ int flag;
+
+ if (!refs_resolve_ref_unsafe(&refs->base, refname, RESOLVE_REF_READING,
+ &oid, &flag)) {
+ oidclr(&oid);
+ flag |= REF_ISBROKEN;
+ } else if (is_null_oid(&oid)) {
+ /*
+ * It is so astronomically unlikely
+ * that null_oid is the OID of an
+ * actual object that we consider its
+ * appearance in a loose reference
+ * file to be repo corruption
+ * (probably due to a software bug).
+ */
+ flag |= REF_ISBROKEN;
+ }
+
+ if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) {
+ if (!refname_is_safe(refname))
+ die("loose refname is dangerous: %s", refname);
+ oidclr(&oid);
+ flag |= REF_BAD_NAME | REF_ISBROKEN;
+ }
+ add_entry_to_dir(dir, create_ref_entry(refname, &oid, flag));
+}
+
/*
* Read the loose references from the namespace dirname into dir
* (without recursing). dirname must end with '/'. dir must be the
@@ -244,10 +276,8 @@ static void loose_fill_ref_dir(struct ref_store *ref_store,
int dirnamelen = strlen(dirname);
struct strbuf refname;
struct strbuf path = STRBUF_INIT;
- size_t path_baselen;
files_ref_path(refs, &path, dirname);
- path_baselen = path.len;
d = opendir(path.buf);
if (!d) {
@@ -259,54 +289,24 @@ static void loose_fill_ref_dir(struct ref_store *ref_store,
strbuf_add(&refname, dirname, dirnamelen);
while ((de = readdir(d)) != NULL) {
- struct object_id oid;
- struct stat st;
- int flag;
+ unsigned char dtype;
if (de->d_name[0] == '.')
continue;
if (ends_with(de->d_name, ".lock"))
continue;
strbuf_addstr(&refname, de->d_name);
- strbuf_addstr(&path, de->d_name);
- if (stat(path.buf, &st) < 0) {
- ; /* silently ignore */
- } else if (S_ISDIR(st.st_mode)) {
+
+ dtype = get_dtype(de, &path, 1);
+ if (dtype == DT_DIR) {
strbuf_addch(&refname, '/');
add_entry_to_dir(dir,
create_dir_entry(dir->cache, refname.buf,
refname.len));
- } else {
- if (!refs_resolve_ref_unsafe(&refs->base,
- refname.buf,
- RESOLVE_REF_READING,
- &oid, &flag)) {
- oidclr(&oid);
- flag |= REF_ISBROKEN;
- } else if (is_null_oid(&oid)) {
- /*
- * It is so astronomically unlikely
- * that null_oid is the OID of an
- * actual object that we consider its
- * appearance in a loose reference
- * file to be repo corruption
- * (probably due to a software bug).
- */
- flag |= REF_ISBROKEN;
- }
-
- if (check_refname_format(refname.buf,
- REFNAME_ALLOW_ONELEVEL)) {
- if (!refname_is_safe(refname.buf))
- die("loose refname is dangerous: %s", refname.buf);
- oidclr(&oid);
- flag |= REF_BAD_NAME | REF_ISBROKEN;
- }
- add_entry_to_dir(dir,
- create_ref_entry(refname.buf, &oid, flag));
+ } else if (dtype == DT_REG) {
+ loose_fill_ref_dir_regular_file(refs, refname.buf, dir);
}
strbuf_setlen(&refname, dirnamelen);
- strbuf_setlen(&path, path_baselen);
}
strbuf_release(&refname);
strbuf_release(&path);
@@ -315,9 +315,59 @@ static void loose_fill_ref_dir(struct ref_store *ref_store,
add_per_worktree_entries_to_dir(dir, dirname);
}
-static struct ref_cache *get_loose_ref_cache(struct files_ref_store *refs)
+/*
+ * Add pseudorefs to the ref dir by parsing the directory for any files
+ * which follow the pseudoref syntax.
+ */
+static void add_pseudoref_and_head_entries(struct ref_store *ref_store,
+ struct ref_dir *dir,
+ const char *dirname)
+{
+ struct files_ref_store *refs =
+ files_downcast(ref_store, REF_STORE_READ, "fill_ref_dir");
+ struct strbuf path = STRBUF_INIT, refname = STRBUF_INIT;
+ struct dirent *de;
+ size_t dirnamelen;
+ DIR *d;
+
+ files_ref_path(refs, &path, dirname);
+
+ d = opendir(path.buf);
+ if (!d) {
+ strbuf_release(&path);
+ return;
+ }
+
+ strbuf_addstr(&refname, dirname);
+ dirnamelen = refname.len;
+
+ while ((de = readdir(d)) != NULL) {
+ unsigned char dtype;
+
+ if (de->d_name[0] == '.')
+ continue;
+ if (ends_with(de->d_name, ".lock"))
+ continue;
+ strbuf_addstr(&refname, de->d_name);
+
+ dtype = get_dtype(de, &path, 1);
+ if (dtype == DT_REG && (is_pseudoref(ref_store, de->d_name) ||
+ is_headref(ref_store, de->d_name)))
+ loose_fill_ref_dir_regular_file(refs, refname.buf, dir);
+
+ strbuf_setlen(&refname, dirnamelen);
+ }
+ strbuf_release(&refname);
+ strbuf_release(&path);
+ closedir(d);
+}
+
+static struct ref_cache *get_loose_ref_cache(struct files_ref_store *refs,
+ unsigned int flags)
{
if (!refs->loose) {
+ struct ref_dir *dir;
+
/*
* Mark the top-level directory complete because we
* are about to read the only subdirectory that can
@@ -328,12 +378,17 @@ static struct ref_cache *get_loose_ref_cache(struct files_ref_store *refs)
/* We're going to fill the top level ourselves: */
refs->loose->root->flag &= ~REF_INCOMPLETE;
+ dir = get_ref_dir(refs->loose->root);
+
+ if (flags & DO_FOR_EACH_INCLUDE_ROOT_REFS)
+ add_pseudoref_and_head_entries(dir->cache->ref_store, dir,
+ refs->loose->root->name);
+
/*
* Add an incomplete entry for "refs/" (to be filled
* lazily):
*/
- add_entry_to_dir(get_ref_dir(refs->loose->root),
- create_dir_entry(refs->loose, "refs/", 5));
+ add_entry_to_dir(dir, create_dir_entry(refs->loose, "refs/", 5));
}
return refs->loose;
}
@@ -771,7 +826,8 @@ static int files_ref_iterator_advance(struct ref_iterator *ref_iterator)
while ((ok = ref_iterator_advance(iter->iter0)) == ITER_OK) {
if (iter->flags & DO_FOR_EACH_PER_WORKTREE_ONLY &&
- ref_type(iter->iter0->refname) != REF_TYPE_PER_WORKTREE)
+ parse_worktree_ref(iter->iter0->refname, NULL, NULL,
+ NULL) != REF_WORKTREE_CURRENT)
continue;
if ((iter->flags & DO_FOR_EACH_OMIT_DANGLING_SYMREFS) &&
@@ -829,7 +885,8 @@ static struct ref_iterator_vtable files_ref_iterator_vtable = {
static struct ref_iterator *files_ref_iterator_begin(
struct ref_store *ref_store,
- const char *prefix, unsigned int flags)
+ const char *prefix, const char **exclude_patterns,
+ unsigned int flags)
{
struct files_ref_store *refs;
struct ref_iterator *loose_iter, *packed_iter, *overlay_iter;
@@ -859,7 +916,7 @@ static struct ref_iterator *files_ref_iterator_begin(
* disk, and re-reads it if not.
*/
- loose_iter = cache_ref_iterator_begin(get_loose_ref_cache(refs),
+ loose_iter = cache_ref_iterator_begin(get_loose_ref_cache(refs, flags),
prefix, ref_store->repo, 1);
/*
@@ -874,15 +931,14 @@ static struct ref_iterator *files_ref_iterator_begin(
* the packed and loose references.
*/
packed_iter = refs_ref_iterator_begin(
- refs->packed_ref_store, prefix, 0,
+ refs->packed_ref_store, prefix, exclude_patterns, 0,
DO_FOR_EACH_INCLUDE_BROKEN);
overlay_iter = overlay_ref_iterator_begin(loose_iter, packed_iter);
CALLOC_ARRAY(iter, 1);
ref_iterator = &iter->base;
- base_ref_iterator_init(ref_iterator, &files_ref_iterator_vtable,
- overlay_iter->ordered);
+ base_ref_iterator_init(ref_iterator, &files_ref_iterator_vtable);
iter->iter0 = overlay_iter;
iter->repo = ref_store->repo;
iter->flags = flags;
@@ -1175,14 +1231,13 @@ static void prune_refs(struct files_ref_store *refs, struct ref_to_prune **refs_
*/
static int should_pack_ref(const char *refname,
const struct object_id *oid, unsigned int ref_flags,
- unsigned int pack_flags)
+ struct pack_refs_opts *opts)
{
- /* Do not pack per-worktree refs: */
- if (ref_type(refname) != REF_TYPE_NORMAL)
- return 0;
+ struct string_list_item *item;
- /* Do not pack non-tags unless PACK_REFS_ALL is set: */
- if (!(pack_flags & PACK_REFS_ALL) && !starts_with(refname, "refs/tags/"))
+ /* Do not pack per-worktree refs: */
+ if (parse_worktree_ref(refname, NULL, NULL, NULL) !=
+ REF_WORKTREE_SHARED)
return 0;
/* Do not pack symbolic refs: */
@@ -1193,10 +1248,18 @@ static int should_pack_ref(const char *refname,
if (!ref_resolves_to_object(refname, the_repository, oid, ref_flags))
return 0;
- return 1;
+ if (ref_excluded(opts->exclusions, refname))
+ return 0;
+
+ for_each_string_list_item(item, opts->includes)
+ if (!wildmatch(item->string, refname, 0))
+ return 1;
+
+ return 0;
}
-static int files_pack_refs(struct ref_store *ref_store, unsigned int flags)
+static int files_pack_refs(struct ref_store *ref_store,
+ struct pack_refs_opts *opts)
{
struct files_ref_store *refs =
files_downcast(ref_store, REF_STORE_WRITE | REF_STORE_ODB,
@@ -1213,7 +1276,7 @@ static int files_pack_refs(struct ref_store *ref_store, unsigned int flags)
packed_refs_lock(refs->packed_ref_store, LOCK_DIE_ON_ERROR, &err);
- iter = cache_ref_iterator_begin(get_loose_ref_cache(refs), NULL,
+ iter = cache_ref_iterator_begin(get_loose_ref_cache(refs, 0), NULL,
the_repository, 0);
while ((ok = ref_iterator_advance(iter)) == ITER_OK) {
/*
@@ -1221,8 +1284,7 @@ static int files_pack_refs(struct ref_store *ref_store, unsigned int flags)
* in the packed ref cache. If the reference should be
* pruned, also add it to refs_to_prune.
*/
- if (!should_pack_ref(iter->refname, iter->oid, iter->flags,
- flags))
+ if (!should_pack_ref(iter->refname, iter->oid, iter->flags, opts))
continue;
/*
@@ -1236,7 +1298,7 @@ static int files_pack_refs(struct ref_store *ref_store, unsigned int flags)
iter->refname, err.buf);
/* Schedule the loose reference for pruning if requested. */
- if ((flags & PACK_REFS_PRUNE)) {
+ if ((opts->flags & PACK_REFS_PRUNE)) {
struct ref_to_prune *n;
FLEX_ALLOC_STR(n, name, iter->refname);
oidcpy(&n->oid, iter->oid);
@@ -1259,54 +1321,6 @@ static int files_pack_refs(struct ref_store *ref_store, unsigned int flags)
return 0;
}
-static int files_delete_refs(struct ref_store *ref_store, const char *msg,
- struct string_list *refnames, unsigned int flags)
-{
- struct files_ref_store *refs =
- files_downcast(ref_store, REF_STORE_WRITE, "delete_refs");
- struct strbuf err = STRBUF_INIT;
- int i, result = 0;
-
- if (!refnames->nr)
- return 0;
-
- if (packed_refs_lock(refs->packed_ref_store, 0, &err))
- goto error;
-
- if (refs_delete_refs(refs->packed_ref_store, msg, refnames, flags)) {
- packed_refs_unlock(refs->packed_ref_store);
- goto error;
- }
-
- packed_refs_unlock(refs->packed_ref_store);
-
- for (i = 0; i < refnames->nr; i++) {
- const char *refname = refnames->items[i].string;
-
- if (refs_delete_ref(&refs->base, msg, refname, NULL, flags))
- result |= error(_("could not remove reference %s"), refname);
- }
-
- strbuf_release(&err);
- return result;
-
-error:
- /*
- * If we failed to rewrite the packed-refs file, then it is
- * unsafe to try to remove loose refs, because doing so might
- * expose an obsolete packed value for a reference that might
- * even point at an object that has been garbage collected.
- */
- if (refnames->nr == 1)
- error(_("could not delete reference %s: %s"),
- refnames->items[0].string, err.buf);
- else
- error(_("could not delete references: %s"), err.buf);
-
- strbuf_release(&err);
- return -1;
-}
-
/*
* People using contrib's git-new-workdir have .git/logs/refs ->
* /some/other/path/.git/logs/refs, and that may live on another device.
@@ -2160,10 +2174,8 @@ static int files_for_each_reflog_ent(struct ref_store *ref_store,
struct files_reflog_iterator {
struct ref_iterator base;
-
struct ref_store *ref_store;
struct dir_iterator *dir_iterator;
- struct object_id oid;
};
static int files_reflog_iterator_advance(struct ref_iterator *ref_iterator)
@@ -2174,25 +2186,13 @@ static int files_reflog_iterator_advance(struct ref_iterator *ref_iterator)
int ok;
while ((ok = dir_iterator_advance(diter)) == ITER_OK) {
- int flags;
-
if (!S_ISREG(diter->st.st_mode))
continue;
- if (diter->basename[0] == '.')
+ if (check_refname_format(diter->basename,
+ REFNAME_ALLOW_ONELEVEL))
continue;
- if (ends_with(diter->basename, ".lock"))
- continue;
-
- if (!refs_resolve_ref_unsafe(iter->ref_store,
- diter->relative_path, 0,
- &iter->oid, &flags)) {
- error("bad ref for %s", diter->path.buf);
- continue;
- }
iter->base.refname = diter->relative_path;
- iter->base.oid = &iter->oid;
- iter->base.flags = flags;
return ITER_OK;
}
@@ -2202,8 +2202,8 @@ static int files_reflog_iterator_advance(struct ref_iterator *ref_iterator)
return ok;
}
-static int files_reflog_iterator_peel(struct ref_iterator *ref_iterator,
- struct object_id *peeled)
+static int files_reflog_iterator_peel(struct ref_iterator *ref_iterator UNUSED,
+ struct object_id *peeled UNUSED)
{
BUG("ref_iterator_peel() called for reflog_iterator");
}
@@ -2237,7 +2237,7 @@ static struct ref_iterator *reflog_iterator_begin(struct ref_store *ref_store,
strbuf_addf(&sb, "%s/logs", gitdir);
- diter = dir_iterator_begin(sb.buf, 0);
+ diter = dir_iterator_begin(sb.buf, DIR_ITERATOR_SORTED);
if (!diter) {
strbuf_release(&sb);
return empty_ref_iterator_begin();
@@ -2246,7 +2246,7 @@ static struct ref_iterator *reflog_iterator_begin(struct ref_store *ref_store,
CALLOC_ARRAY(iter, 1);
ref_iterator = &iter->base;
- base_ref_iterator_init(ref_iterator, &files_reflog_iterator_vtable, 0);
+ base_ref_iterator_init(ref_iterator, &files_reflog_iterator_vtable);
iter->dir_iterator = diter;
iter->ref_store = ref_store;
strbuf_release(&sb);
@@ -2254,31 +2254,6 @@ static struct ref_iterator *reflog_iterator_begin(struct ref_store *ref_store,
return ref_iterator;
}
-static enum iterator_selection reflog_iterator_select(
- struct ref_iterator *iter_worktree,
- struct ref_iterator *iter_common,
- void *cb_data)
-{
- if (iter_worktree) {
- /*
- * We're a bit loose here. We probably should ignore
- * common refs if they are accidentally added as
- * per-worktree refs.
- */
- return ITER_SELECT_0;
- } else if (iter_common) {
- if (ref_type(iter_common->refname) == REF_TYPE_NORMAL)
- return ITER_SELECT_1;
-
- /*
- * The main ref store may contain main worktree's
- * per-worktree refs, which should be ignored
- */
- return ITER_SKIP_1;
- } else
- return ITER_DONE;
-}
-
static struct ref_iterator *files_reflog_iterator_begin(struct ref_store *ref_store)
{
struct files_ref_store *refs =
@@ -2289,9 +2264,9 @@ static struct ref_iterator *files_reflog_iterator_begin(struct ref_store *ref_st
return reflog_iterator_begin(ref_store, refs->gitcommondir);
} else {
return merge_ref_iterator_begin(
- 0, reflog_iterator_begin(ref_store, refs->base.gitdir),
+ reflog_iterator_begin(ref_store, refs->base.gitdir),
reflog_iterator_begin(ref_store, refs->gitcommondir),
- reflog_iterator_select, refs);
+ ref_iterator_select, refs);
}
}
@@ -2985,7 +2960,7 @@ cleanup:
static int files_transaction_abort(struct ref_store *ref_store,
struct ref_transaction *transaction,
- struct strbuf *err)
+ struct strbuf *err UNUSED)
{
struct files_ref_store *refs =
files_downcast(ref_store, 0, "ref_transaction_abort");
@@ -2995,7 +2970,9 @@ static int files_transaction_abort(struct ref_store *ref_store,
}
static int ref_present(const char *refname,
- const struct object_id *oid, int flags, void *cb_data)
+ const struct object_id *oid UNUSED,
+ int flags UNUSED,
+ void *cb_data)
{
struct string_list *affected_refnames = cb_data;
@@ -3259,28 +3236,52 @@ static int files_reflog_expire(struct ref_store *ref_store,
return -1;
}
-static int files_init_db(struct ref_store *ref_store, struct strbuf *err)
+static int files_init_db(struct ref_store *ref_store,
+ int flags,
+ struct strbuf *err UNUSED)
{
struct files_ref_store *refs =
files_downcast(ref_store, REF_STORE_WRITE, "init_db");
struct strbuf sb = STRBUF_INIT;
/*
- * Create .git/refs/{heads,tags}
+ * We need to create a "refs" dir in any case so that older versions of
+ * Git can tell that this is a repository. This serves two main purposes:
+ *
+ * - Clients will know to stop walking the parent-directory chain when
+ * detecting the Git repository. Otherwise they may end up detecting
+ * a Git repository in a parent directory instead.
+ *
+ * - Instead of failing to detect a repository with unknown reference
+ * format altogether, old clients will print an error saying that
+ * they do not understand the reference format extension.
*/
- files_ref_path(refs, &sb, "refs/heads");
+ strbuf_addf(&sb, "%s/refs", ref_store->gitdir);
safe_create_dir(sb.buf, 1);
+ adjust_shared_perm(sb.buf);
- strbuf_reset(&sb);
- files_ref_path(refs, &sb, "refs/tags");
- safe_create_dir(sb.buf, 1);
+ /*
+ * There is no need to create directories for common refs when creating
+ * a worktree ref store.
+ */
+ if (!(flags & REFS_INIT_DB_IS_WORKTREE)) {
+ /*
+ * Create .git/refs/{heads,tags}
+ */
+ strbuf_reset(&sb);
+ files_ref_path(refs, &sb, "refs/heads");
+ safe_create_dir(sb.buf, 1);
+
+ strbuf_reset(&sb);
+ files_ref_path(refs, &sb, "refs/tags");
+ safe_create_dir(sb.buf, 1);
+ }
strbuf_release(&sb);
return 0;
}
struct ref_storage_be refs_be_files = {
- .next = NULL,
.name = "files",
.init = files_ref_store_create,
.init_db = files_init_db,
@@ -3291,7 +3292,6 @@ struct ref_storage_be refs_be_files = {
.pack_refs = files_pack_refs,
.create_symref = files_create_symref,
- .delete_refs = files_delete_refs,
.rename_ref = files_rename_ref,
.copy_ref = files_copy_ref,
diff --git a/refs/iterator.c b/refs/iterator.c
index b2e56ba..9db8b05 100644
--- a/refs/iterator.c
+++ b/refs/iterator.c
@@ -3,7 +3,7 @@
* documentation about the design and use of reference iterators.
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "refs.h"
#include "refs/refs-internal.h"
#include "iterator.h"
@@ -25,11 +25,9 @@ int ref_iterator_abort(struct ref_iterator *ref_iterator)
}
void base_ref_iterator_init(struct ref_iterator *iter,
- struct ref_iterator_vtable *vtable,
- int ordered)
+ struct ref_iterator_vtable *vtable)
{
iter->vtable = vtable;
- iter->ordered = !!ordered;
iter->refname = NULL;
iter->oid = NULL;
iter->flags = 0;
@@ -51,8 +49,8 @@ static int empty_ref_iterator_advance(struct ref_iterator *ref_iterator)
return ref_iterator_abort(ref_iterator);
}
-static int empty_ref_iterator_peel(struct ref_iterator *ref_iterator,
- struct object_id *peeled)
+static int empty_ref_iterator_peel(struct ref_iterator *ref_iterator UNUSED,
+ struct object_id *peeled UNUSED)
{
BUG("peel called for empty iterator");
}
@@ -74,7 +72,7 @@ struct ref_iterator *empty_ref_iterator_begin(void)
struct empty_ref_iterator *iter = xcalloc(1, sizeof(*iter));
struct ref_iterator *ref_iterator = &iter->base;
- base_ref_iterator_init(ref_iterator, &empty_ref_iterator_vtable, 1);
+ base_ref_iterator_init(ref_iterator, &empty_ref_iterator_vtable);
return ref_iterator;
}
@@ -98,6 +96,49 @@ struct merge_ref_iterator {
struct ref_iterator **current;
};
+enum iterator_selection ref_iterator_select(struct ref_iterator *iter_worktree,
+ struct ref_iterator *iter_common,
+ void *cb_data UNUSED)
+{
+ if (iter_worktree && !iter_common) {
+ /*
+ * Return the worktree ref if there are no more common refs.
+ */
+ return ITER_SELECT_0;
+ } else if (iter_common) {
+ /*
+ * In case we have pending worktree and common refs we need to
+ * yield them based on their lexicographical order. Worktree
+ * refs that have the same name as common refs shadow the
+ * latter.
+ */
+ if (iter_worktree) {
+ int cmp = strcmp(iter_worktree->refname,
+ iter_common->refname);
+ if (cmp < 0)
+ return ITER_SELECT_0;
+ else if (!cmp)
+ return ITER_SELECT_0_SKIP_1;
+ }
+
+ /*
+ * We now know that the lexicographically-next ref is a common
+ * ref. When the common ref is a shared one we return it.
+ */
+ if (parse_worktree_ref(iter_common->refname, NULL, NULL,
+ NULL) == REF_WORKTREE_SHARED)
+ return ITER_SELECT_1;
+
+ /*
+ * Otherwise, if the common ref is a per-worktree ref we skip
+ * it because it would belong to the main worktree, not ours.
+ */
+ return ITER_SKIP_1;
+ } else {
+ return ITER_DONE;
+ }
+}
+
static int merge_ref_iterator_advance(struct ref_iterator *ref_iterator)
{
struct merge_ref_iterator *iter =
@@ -207,7 +248,6 @@ static struct ref_iterator_vtable merge_ref_iterator_vtable = {
};
struct ref_iterator *merge_ref_iterator_begin(
- int ordered,
struct ref_iterator *iter0, struct ref_iterator *iter1,
ref_iterator_select_fn *select, void *cb_data)
{
@@ -222,7 +262,7 @@ struct ref_iterator *merge_ref_iterator_begin(
* references through only if they exist in both iterators.
*/
- base_ref_iterator_init(ref_iterator, &merge_ref_iterator_vtable, ordered);
+ base_ref_iterator_init(ref_iterator, &merge_ref_iterator_vtable);
iter->iter0 = iter0;
iter->iter1 = iter1;
iter->select = select;
@@ -238,7 +278,7 @@ struct ref_iterator *merge_ref_iterator_begin(
*/
static enum iterator_selection overlay_iterator_select(
struct ref_iterator *front, struct ref_iterator *back,
- void *cb_data)
+ void *cb_data UNUSED)
{
int cmp;
@@ -271,12 +311,9 @@ struct ref_iterator *overlay_ref_iterator_begin(
} else if (is_empty_ref_iterator(back)) {
ref_iterator_abort(back);
return front;
- } else if (!front->ordered || !back->ordered) {
- BUG("overlay_ref_iterator requires ordered inputs");
}
- return merge_ref_iterator_begin(1, front, back,
- overlay_iterator_select, NULL);
+ return merge_ref_iterator_begin(front, back, overlay_iterator_select, NULL);
}
struct prefix_ref_iterator {
@@ -315,16 +352,12 @@ static int prefix_ref_iterator_advance(struct ref_iterator *ref_iterator)
if (cmp > 0) {
/*
- * If the source iterator is ordered, then we
+ * As the source iterator is ordered, we
* can stop the iteration as soon as we see a
* refname that comes after the prefix:
*/
- if (iter->iter0->ordered) {
- ok = ref_iterator_abort(iter->iter0);
- break;
- } else {
- continue;
- }
+ ok = ref_iterator_abort(iter->iter0);
+ break;
}
if (iter->trim) {
@@ -396,7 +429,7 @@ struct ref_iterator *prefix_ref_iterator_begin(struct ref_iterator *iter0,
CALLOC_ARRAY(iter, 1);
ref_iterator = &iter->base;
- base_ref_iterator_init(ref_iterator, &prefix_ref_iterator_vtable, iter0->ordered);
+ base_ref_iterator_init(ref_iterator, &prefix_ref_iterator_vtable);
iter->iter0 = iter0;
iter->prefix = xstrdup(prefix);
diff --git a/refs/packed-backend.c b/refs/packed-backend.c
index 97b6837..4e826c0 100644
--- a/refs/packed-backend.c
+++ b/refs/packed-backend.c
@@ -1,11 +1,18 @@
-#include "../cache.h"
+#include "../git-compat-util.h"
#include "../config.h"
+#include "../gettext.h"
+#include "../hash.h"
+#include "../hex.h"
#include "../refs.h"
#include "refs-internal.h"
#include "packed-backend.h"
#include "../iterator.h"
#include "../lockfile.h"
#include "../chdir-notify.h"
+#include "../statinfo.h"
+#include "../wrapper.h"
+#include "../write-or-die.h"
+#include "../trace2.h"
enum mmap_strategy {
/*
@@ -297,7 +304,8 @@ static int cmp_packed_ref_records(const void *v1, const void *v2)
* Compare a snapshot record at `rec` to the specified NUL-terminated
* refname.
*/
-static int cmp_record_to_refname(const char *rec, const char *refname)
+static int cmp_record_to_refname(const char *rec, const char *refname,
+ int start)
{
const char *r1 = rec + the_hash_algo->hexsz + 1;
const char *r2 = refname;
@@ -306,7 +314,7 @@ static int cmp_record_to_refname(const char *rec, const char *refname)
if (*r1 == '\n')
return *r2 ? -1 : 0;
if (!*r2)
- return 1;
+ return start ? 1 : -1;
if (*r1 != *r2)
return (unsigned char)*r1 < (unsigned char)*r2 ? -1 : +1;
r1++;
@@ -521,22 +529,9 @@ static int load_contents(struct snapshot *snapshot)
return 1;
}
-/*
- * Find the place in `snapshot->buf` where the start of the record for
- * `refname` starts. If `mustexist` is true and the reference doesn't
- * exist, then return NULL. If `mustexist` is false and the reference
- * doesn't exist, then return the point where that reference would be
- * inserted, or `snapshot->eof` (which might be NULL) if it would be
- * inserted at the end of the file. In the latter mode, `refname`
- * doesn't have to be a proper reference name; for example, one could
- * search for "refs/replace/" to find the start of any replace
- * references.
- *
- * The record is sought using a binary search, so `snapshot->buf` must
- * be sorted.
- */
-static const char *find_reference_location(struct snapshot *snapshot,
- const char *refname, int mustexist)
+static const char *find_reference_location_1(struct snapshot *snapshot,
+ const char *refname, int mustexist,
+ int start)
{
/*
* This is not *quite* a garden-variety binary search, because
@@ -566,7 +561,7 @@ static const char *find_reference_location(struct snapshot *snapshot,
mid = lo + (hi - lo) / 2;
rec = find_start_of_record(lo, mid);
- cmp = cmp_record_to_refname(rec, refname);
+ cmp = cmp_record_to_refname(rec, refname, start);
if (cmp < 0) {
lo = find_end_of_record(mid, hi);
} else if (cmp > 0) {
@@ -583,6 +578,41 @@ static const char *find_reference_location(struct snapshot *snapshot,
}
/*
+ * Find the place in `snapshot->buf` where the start of the record for
+ * `refname` starts. If `mustexist` is true and the reference doesn't
+ * exist, then return NULL. If `mustexist` is false and the reference
+ * doesn't exist, then return the point where that reference would be
+ * inserted, or `snapshot->eof` (which might be NULL) if it would be
+ * inserted at the end of the file. In the latter mode, `refname`
+ * doesn't have to be a proper reference name; for example, one could
+ * search for "refs/replace/" to find the start of any replace
+ * references.
+ *
+ * The record is sought using a binary search, so `snapshot->buf` must
+ * be sorted.
+ */
+static const char *find_reference_location(struct snapshot *snapshot,
+ const char *refname, int mustexist)
+{
+ return find_reference_location_1(snapshot, refname, mustexist, 1);
+}
+
+/*
+ * Find the place in `snapshot->buf` after the end of the record for
+ * `refname`. In other words, find the location of first thing *after*
+ * `refname`.
+ *
+ * Other semantics are identical to the ones in
+ * `find_reference_location()`.
+ */
+static const char *find_reference_location_end(struct snapshot *snapshot,
+ const char *refname,
+ int mustexist)
+{
+ return find_reference_location_1(snapshot, refname, mustexist, 0);
+}
+
+/*
* Create a newly-allocated `snapshot` of the `packed-refs` file in
* its current state and return it. The return value will already have
* its reference count incremented.
@@ -646,7 +676,7 @@ static struct snapshot *create_snapshot(struct packed_ref_store *refs)
snapshot->buf,
snapshot->eof - snapshot->buf);
- string_list_split_in_place(&traits, p, ' ', -1);
+ string_list_split_in_place(&traits, p, " ", -1);
if (unsorted_string_list_has_string(&traits, "fully-peeled"))
snapshot->peeled = PEELED_FULLY;
@@ -726,7 +756,7 @@ static struct snapshot *get_snapshot(struct packed_ref_store *refs)
}
static int packed_read_raw_ref(struct ref_store *ref_store, const char *refname,
- struct object_id *oid, struct strbuf *referent,
+ struct object_id *oid, struct strbuf *referent UNUSED,
unsigned int *type, int *failure_errno)
{
struct packed_ref_store *refs =
@@ -773,6 +803,13 @@ struct packed_ref_iterator {
/* The end of the part of the buffer that will be iterated over: */
const char *eof;
+ struct jump_list_entry {
+ const char *start;
+ const char *end;
+ } *jump;
+ size_t jump_nr, jump_alloc;
+ size_t jump_cur;
+
/* Scratch space for current values: */
struct object_id oid, peeled;
struct strbuf refname_buf;
@@ -790,14 +827,36 @@ struct packed_ref_iterator {
*/
static int next_record(struct packed_ref_iterator *iter)
{
- const char *p = iter->pos, *eol;
+ const char *p, *eol;
strbuf_reset(&iter->refname_buf);
+ /*
+ * If iter->pos is contained within a skipped region, jump past
+ * it.
+ *
+ * Note that each skipped region is considered at most once,
+ * since they are ordered based on their starting position.
+ */
+ while (iter->jump_cur < iter->jump_nr) {
+ struct jump_list_entry *curr = &iter->jump[iter->jump_cur];
+ if (iter->pos < curr->start)
+ break; /* not to the next jump yet */
+
+ iter->jump_cur++;
+ if (iter->pos < curr->end) {
+ iter->pos = curr->end;
+ trace2_counter_add(TRACE2_COUNTER_ID_PACKED_REFS_JUMPS, 1);
+ /* jumps are coalesced, so only one jump is necessary */
+ break;
+ }
+ }
+
if (iter->pos == iter->eof)
return ITER_DONE;
iter->base.flags = REF_ISPACKED;
+ p = iter->pos;
if (iter->eof - p < the_hash_algo->hexsz + 2 ||
parse_oid_hex(p, &iter->oid, &p) ||
@@ -862,7 +921,7 @@ static int packed_ref_iterator_advance(struct ref_iterator *ref_iterator)
while ((ok = next_record(iter)) == ITER_OK) {
if (iter->flags & DO_FOR_EACH_PER_WORKTREE_ONLY &&
- ref_type(iter->base.refname) != REF_TYPE_PER_WORKTREE)
+ !is_per_worktree_ref(iter->base.refname))
continue;
if (!(iter->flags & DO_FOR_EACH_INCLUDE_BROKEN) &&
@@ -905,6 +964,7 @@ static int packed_ref_iterator_abort(struct ref_iterator *ref_iterator)
int ok = ITER_DONE;
strbuf_release(&iter->refname_buf);
+ free(iter->jump);
release_snapshot(iter->snapshot);
base_ref_iterator_free(ref_iterator);
return ok;
@@ -916,9 +976,112 @@ static struct ref_iterator_vtable packed_ref_iterator_vtable = {
.abort = packed_ref_iterator_abort
};
+static int jump_list_entry_cmp(const void *va, const void *vb)
+{
+ const struct jump_list_entry *a = va;
+ const struct jump_list_entry *b = vb;
+
+ if (a->start < b->start)
+ return -1;
+ if (a->start > b->start)
+ return 1;
+ return 0;
+}
+
+static int has_glob_special(const char *str)
+{
+ const char *p;
+ for (p = str; *p; p++) {
+ if (is_glob_special(*p))
+ return 1;
+ }
+ return 0;
+}
+
+static void populate_excluded_jump_list(struct packed_ref_iterator *iter,
+ struct snapshot *snapshot,
+ const char **excluded_patterns)
+{
+ size_t i, j;
+ const char **pattern;
+ struct jump_list_entry *last_disjoint;
+
+ if (!excluded_patterns)
+ return;
+
+ for (pattern = excluded_patterns; *pattern; pattern++) {
+ struct jump_list_entry *e;
+ const char *start, *end;
+
+ /*
+ * We can't feed any excludes with globs in them to the
+ * refs machinery. It only understands prefix matching.
+ * We likewise can't even feed the string leading up to
+ * the first meta-character, as something like "foo[a]"
+ * should not exclude "foobar" (but the prefix "foo"
+ * would match that and mark it for exclusion).
+ */
+ if (has_glob_special(*pattern))
+ continue;
+
+ start = find_reference_location(snapshot, *pattern, 0);
+ end = find_reference_location_end(snapshot, *pattern, 0);
+
+ if (start == end)
+ continue; /* nothing to jump over */
+
+ ALLOC_GROW(iter->jump, iter->jump_nr + 1, iter->jump_alloc);
+
+ e = &iter->jump[iter->jump_nr++];
+ e->start = start;
+ e->end = end;
+ }
+
+ if (!iter->jump_nr) {
+ /*
+ * Every entry in exclude_patterns has a meta-character,
+ * nothing to do here.
+ */
+ return;
+ }
+
+ QSORT(iter->jump, iter->jump_nr, jump_list_entry_cmp);
+
+ /*
+ * As an optimization, merge adjacent entries in the jump list
+ * to jump forwards as far as possible when entering a skipped
+ * region.
+ *
+ * For example, if we have two skipped regions:
+ *
+ * [[A, B], [B, C]]
+ *
+ * we want to combine that into a single entry jumping from A to
+ * C.
+ */
+ last_disjoint = iter->jump;
+
+ for (i = 1, j = 1; i < iter->jump_nr; i++) {
+ struct jump_list_entry *ours = &iter->jump[i];
+ if (ours->start <= last_disjoint->end) {
+ /* overlapping regions extend the previous one */
+ last_disjoint->end = last_disjoint->end > ours->end
+ ? last_disjoint->end : ours->end;
+ } else {
+ /* otherwise, insert a new region */
+ iter->jump[j++] = *ours;
+ last_disjoint = ours;
+ }
+ }
+
+ iter->jump_nr = j;
+ iter->jump_cur = 0;
+}
+
static struct ref_iterator *packed_ref_iterator_begin(
struct ref_store *ref_store,
- const char *prefix, unsigned int flags)
+ const char *prefix, const char **exclude_patterns,
+ unsigned int flags)
{
struct packed_ref_store *refs;
struct snapshot *snapshot;
@@ -948,7 +1111,10 @@ static struct ref_iterator *packed_ref_iterator_begin(
CALLOC_ARRAY(iter, 1);
ref_iterator = &iter->base;
- base_ref_iterator_init(ref_iterator, &packed_ref_iterator_vtable, 1);
+ base_ref_iterator_init(ref_iterator, &packed_ref_iterator_vtable);
+
+ if (exclude_patterns)
+ populate_excluded_jump_list(iter, snapshot, exclude_patterns);
iter->snapshot = snapshot;
acquire_snapshot(snapshot);
@@ -1078,7 +1244,9 @@ int packed_refs_is_locked(struct ref_store *ref_store)
static const char PACKED_REFS_HEADER[] =
"# pack-refs with: peeled fully-peeled sorted \n";
-static int packed_init_db(struct ref_store *ref_store, struct strbuf *err)
+static int packed_init_db(struct ref_store *ref_store UNUSED,
+ int flags UNUSED,
+ struct strbuf *err UNUSED)
{
/* Nothing to do. */
return 0;
@@ -1142,7 +1310,7 @@ static int write_with_updates(struct packed_ref_store *refs,
* list of refs is exhausted, set iter to NULL. When the list
* of updates is exhausted, leave i set to updates->nr.
*/
- iter = packed_ref_iterator_begin(&refs->base, "",
+ iter = packed_ref_iterator_begin(&refs->base, "", NULL,
DO_FOR_EACH_INCLUDE_BROKEN);
if ((ok = ref_iterator_advance(iter)) != ITER_OK)
iter = NULL;
@@ -1262,7 +1430,8 @@ static int write_with_updates(struct packed_ref_store *refs,
goto error;
}
- if (fsync_component(FSYNC_COMPONENT_REFERENCE, get_tempfile_fd(refs->tempfile)) ||
+ if (fflush(out) ||
+ fsync_component(FSYNC_COMPONENT_REFERENCE, get_tempfile_fd(refs->tempfile)) ||
close_tempfile_gently(refs->tempfile)) {
strbuf_addf(err, "error closing file %s: %s",
get_tempfile_path(refs->tempfile),
@@ -1473,7 +1642,7 @@ failure:
static int packed_transaction_abort(struct ref_store *ref_store,
struct ref_transaction *transaction,
- struct strbuf *err)
+ struct strbuf *err UNUSED)
{
struct packed_ref_store *refs = packed_downcast(
ref_store,
@@ -1512,63 +1681,15 @@ cleanup:
return ret;
}
-static int packed_initial_transaction_commit(struct ref_store *ref_store,
+static int packed_initial_transaction_commit(struct ref_store *ref_store UNUSED,
struct ref_transaction *transaction,
struct strbuf *err)
{
return ref_transaction_commit(transaction, err);
}
-static int packed_delete_refs(struct ref_store *ref_store, const char *msg,
- struct string_list *refnames, unsigned int flags)
-{
- struct packed_ref_store *refs =
- packed_downcast(ref_store, REF_STORE_WRITE, "delete_refs");
- struct strbuf err = STRBUF_INIT;
- struct ref_transaction *transaction;
- struct string_list_item *item;
- int ret;
-
- (void)refs; /* We need the check above, but don't use the variable */
-
- if (!refnames->nr)
- return 0;
-
- /*
- * Since we don't check the references' old_oids, the
- * individual updates can't fail, so we can pack all of the
- * updates into a single transaction.
- */
-
- transaction = ref_store_transaction_begin(ref_store, &err);
- if (!transaction)
- return -1;
-
- for_each_string_list_item(item, refnames) {
- if (ref_transaction_delete(transaction, item->string, NULL,
- flags, msg, &err)) {
- warning(_("could not delete reference %s: %s"),
- item->string, err.buf);
- strbuf_reset(&err);
- }
- }
-
- ret = ref_transaction_commit(transaction, &err);
-
- if (ret) {
- if (refnames->nr == 1)
- error(_("could not delete reference %s: %s"),
- refnames->items[0].string, err.buf);
- else
- error(_("could not delete references: %s"), err.buf);
- }
-
- ref_transaction_free(transaction);
- strbuf_release(&err);
- return ret;
-}
-
-static int packed_pack_refs(struct ref_store *ref_store, unsigned int flags)
+static int packed_pack_refs(struct ref_store *ref_store UNUSED,
+ struct pack_refs_opts *pack_opts UNUSED)
{
/*
* Packed refs are already packed. It might be that loose refs
@@ -1578,13 +1699,12 @@ static int packed_pack_refs(struct ref_store *ref_store, unsigned int flags)
return 0;
}
-static struct ref_iterator *packed_reflog_iterator_begin(struct ref_store *ref_store)
+static struct ref_iterator *packed_reflog_iterator_begin(struct ref_store *ref_store UNUSED)
{
return empty_ref_iterator_begin();
}
struct ref_storage_be refs_be_packed = {
- .next = NULL,
.name = "packed",
.init = packed_ref_store_create,
.init_db = packed_init_db,
@@ -1595,7 +1715,6 @@ struct ref_storage_be refs_be_packed = {
.pack_refs = packed_pack_refs,
.create_symref = NULL,
- .delete_refs = packed_delete_refs,
.rename_ref = NULL,
.copy_ref = NULL,
diff --git a/refs/ref-cache.c b/refs/ref-cache.c
index 32afd8a..9f97972 100644
--- a/refs/ref-cache.c
+++ b/refs/ref-cache.c
@@ -1,5 +1,7 @@
-#include "../cache.h"
+#include "../git-compat-util.h"
+#include "../hash.h"
#include "../refs.h"
+#include "../repository.h"
#include "refs-internal.h"
#include "ref-cache.h"
#include "../iterator.h"
@@ -409,7 +411,8 @@ static int cache_ref_iterator_advance(struct ref_iterator *ref_iterator)
if (level->prefix_state == PREFIX_WITHIN_DIR) {
entry_prefix_state = overlaps_prefix(entry->name, iter->prefix);
- if (entry_prefix_state == PREFIX_EXCLUDES_DIR)
+ if (entry_prefix_state == PREFIX_EXCLUDES_DIR ||
+ (entry_prefix_state == PREFIX_WITHIN_DIR && !(entry->flag & REF_DIR)))
continue;
} else {
entry_prefix_state = level->prefix_state;
@@ -483,7 +486,7 @@ struct ref_iterator *cache_ref_iterator_begin(struct ref_cache *cache,
CALLOC_ARRAY(iter, 1);
ref_iterator = &iter->base;
- base_ref_iterator_init(ref_iterator, &cache_ref_iterator_vtable, 1);
+ base_ref_iterator_init(ref_iterator, &cache_ref_iterator_vtable);
ALLOC_GROW(iter->levels, 10, iter->levels_alloc);
iter->levels_nr = 1;
diff --git a/refs/ref-cache.h b/refs/ref-cache.h
index 850d9d3..95c76e2 100644
--- a/refs/ref-cache.h
+++ b/refs/ref-cache.h
@@ -1,10 +1,11 @@
#ifndef REFS_REF_CACHE_H
#define REFS_REF_CACHE_H
-#include "cache.h"
+#include "hash-ll.h"
struct ref_dir;
struct ref_store;
+struct repository;
/*
* If this ref_cache is filled lazily, this function is used to load
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 69f93b0..56641aa 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -1,7 +1,6 @@
#ifndef REFS_REFS_INTERNAL_H
#define REFS_REFS_INTERNAL_H
-#include "cache.h"
#include "refs.h"
#include "iterator.h"
@@ -261,6 +260,12 @@ enum do_for_each_ref_flags {
* INCLUDE_BROKEN, since they are otherwise not included at all.
*/
DO_FOR_EACH_OMIT_DANGLING_SYMREFS = (1 << 2),
+
+ /*
+ * Include root refs i.e. HEAD and pseudorefs along with the regular
+ * refs.
+ */
+ DO_FOR_EACH_INCLUDE_ROOT_REFS = (1 << 3),
};
/*
@@ -313,13 +318,6 @@ enum do_for_each_ref_flags {
*/
struct ref_iterator {
struct ref_iterator_vtable *vtable;
-
- /*
- * Does this `ref_iterator` iterate over references in order
- * by refname?
- */
- unsigned int ordered : 1;
-
const char *refname;
const struct object_id *oid;
unsigned int flags;
@@ -368,8 +366,8 @@ int is_empty_ref_iterator(struct ref_iterator *ref_iterator);
*/
struct ref_iterator *refs_ref_iterator_begin(
struct ref_store *refs,
- const char *prefix, int trim,
- enum do_for_each_ref_flags flags);
+ const char *prefix, const char **exclude_patterns,
+ int trim, enum do_for_each_ref_flags flags);
/*
* A callback function used to instruct merge_ref_iterator how to
@@ -388,14 +386,21 @@ typedef enum iterator_selection ref_iterator_select_fn(
void *cb_data);
/*
+ * An implementation of ref_iterator_select_fn that merges worktree and common
+ * refs. Per-worktree refs from the common iterator are ignored, worktree refs
+ * override common refs. Refs are selected lexicographically.
+ */
+enum iterator_selection ref_iterator_select(struct ref_iterator *iter_worktree,
+ struct ref_iterator *iter_common,
+ void *cb_data);
+
+/*
* Iterate over the entries from iter0 and iter1, with the values
* interleaved as directed by the select function. The iterator takes
* ownership of iter0 and iter1 and frees them when the iteration is
- * over. A derived class should set `ordered` to 1 or 0 based on
- * whether it generates its output in order by reference name.
+ * over.
*/
struct ref_iterator *merge_ref_iterator_begin(
- int ordered,
struct ref_iterator *iter0, struct ref_iterator *iter1,
ref_iterator_select_fn *select, void *cb_data);
@@ -424,8 +429,6 @@ struct ref_iterator *overlay_ref_iterator_begin(
* As an convenience to callers, if prefix is the empty string and
* trim is zero, this function returns iter0 directly, without
* wrapping it.
- *
- * The resulting ref_iterator is ordered if iter0 is.
*/
struct ref_iterator *prefix_ref_iterator_begin(struct ref_iterator *iter0,
const char *prefix,
@@ -436,14 +439,11 @@ struct ref_iterator *prefix_ref_iterator_begin(struct ref_iterator *iter0,
/*
* Base class constructor for ref_iterators. Initialize the
* ref_iterator part of iter, setting its vtable pointer as specified.
- * `ordered` should be set to 1 if the iterator will iterate over
- * references in order by refname; otherwise it should be set to 0.
* This is meant to be called only by the initializers of derived
* classes.
*/
void base_ref_iterator_init(struct ref_iterator *iter,
- struct ref_iterator_vtable *vtable,
- int ordered);
+ struct ref_iterator_vtable *vtable);
/*
* Base class destructor for ref_iterators. Destroy the ref_iterator
@@ -530,7 +530,9 @@ typedef struct ref_store *ref_store_init_fn(struct repository *repo,
const char *gitdir,
unsigned int flags);
-typedef int ref_init_db_fn(struct ref_store *refs, struct strbuf *err);
+typedef int ref_init_db_fn(struct ref_store *refs,
+ int flags,
+ struct strbuf *err);
typedef int ref_transaction_prepare_fn(struct ref_store *refs,
struct ref_transaction *transaction,
@@ -548,13 +550,12 @@ typedef int ref_transaction_commit_fn(struct ref_store *refs,
struct ref_transaction *transaction,
struct strbuf *err);
-typedef int pack_refs_fn(struct ref_store *ref_store, unsigned int flags);
+typedef int pack_refs_fn(struct ref_store *ref_store,
+ struct pack_refs_opts *opts);
typedef int create_symref_fn(struct ref_store *ref_store,
const char *ref_target,
const char *refs_heads_master,
const char *logmsg);
-typedef int delete_refs_fn(struct ref_store *ref_store, const char *msg,
- struct string_list *refnames, unsigned int flags);
typedef int rename_ref_fn(struct ref_store *ref_store,
const char *oldref, const char *newref,
const char *logmsg);
@@ -571,7 +572,8 @@ typedef int copy_ref_fn(struct ref_store *ref_store,
*/
typedef struct ref_iterator *ref_iterator_begin_fn(
struct ref_store *ref_store,
- const char *prefix, unsigned int flags);
+ const char *prefix, const char **exclude_patterns,
+ unsigned int flags);
/* reflog functions */
@@ -664,7 +666,6 @@ typedef int read_symbolic_ref_fn(struct ref_store *ref_store, const char *refnam
struct strbuf *referent);
struct ref_storage_be {
- struct ref_storage_be *next;
const char *name;
ref_store_init_fn *init;
ref_init_db_fn *init_db;
@@ -676,7 +677,6 @@ struct ref_storage_be {
pack_refs_fn *pack_refs;
create_symref_fn *create_symref;
- delete_refs_fn *delete_refs;
rename_ref_fn *rename_ref;
copy_ref_fn *copy_ref;
@@ -694,6 +694,7 @@ struct ref_storage_be {
};
extern struct ref_storage_be refs_be_files;
+extern struct ref_storage_be refs_be_reftable;
extern struct ref_storage_be refs_be_packed;
/*
diff --git a/refs/reftable-backend.c b/refs/reftable-backend.c
new file mode 100644
index 0000000..1cda48c
--- /dev/null
+++ b/refs/reftable-backend.c
@@ -0,0 +1,2242 @@
+#include "../git-compat-util.h"
+#include "../abspath.h"
+#include "../chdir-notify.h"
+#include "../environment.h"
+#include "../gettext.h"
+#include "../hash.h"
+#include "../hex.h"
+#include "../iterator.h"
+#include "../ident.h"
+#include "../lockfile.h"
+#include "../object.h"
+#include "../path.h"
+#include "../refs.h"
+#include "../reftable/reftable-stack.h"
+#include "../reftable/reftable-record.h"
+#include "../reftable/reftable-error.h"
+#include "../reftable/reftable-iterator.h"
+#include "../reftable/reftable-merged.h"
+#include "../setup.h"
+#include "../strmap.h"
+#include "parse.h"
+#include "refs-internal.h"
+
+/*
+ * Used as a flag in ref_update::flags when the ref_update was via an
+ * update to HEAD.
+ */
+#define REF_UPDATE_VIA_HEAD (1 << 8)
+
+struct reftable_ref_store {
+ struct ref_store base;
+
+ /*
+ * The main stack refers to the common dir and thus contains common
+ * refs as well as refs of the main repository.
+ */
+ struct reftable_stack *main_stack;
+ /*
+ * The worktree stack 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;
+ /*
+ * Map of worktree stacks by their respective worktree names. The map
+ * is populated lazily when we try to resolve `worktrees/$worktree` refs.
+ */
+ struct strmap worktree_stacks;
+ struct reftable_write_options write_options;
+
+ unsigned int store_flags;
+ int err;
+};
+
+/*
+ * Downcast ref_store to reftable_ref_store. Die if ref_store is not a
+ * reftable_ref_store. required_flags is compared with ref_store's store_flags
+ * to ensure the ref_store has all required capabilities. "caller" is used in
+ * any necessary error messages.
+ */
+static struct reftable_ref_store *reftable_be_downcast(struct ref_store *ref_store,
+ unsigned int required_flags,
+ const char *caller)
+{
+ struct reftable_ref_store *refs;
+
+ if (ref_store->be != &refs_be_reftable)
+ BUG("ref_store is type \"%s\" not \"reftables\" in %s",
+ ref_store->be->name, caller);
+
+ refs = (struct reftable_ref_store *)ref_store;
+
+ if ((refs->store_flags & required_flags) != required_flags)
+ BUG("operation %s requires abilities 0x%x, but only have 0x%x",
+ caller, required_flags, refs->store_flags);
+
+ return refs;
+}
+
+/*
+ * Some refs are global to the repository (refs/heads/{*}), while others are
+ * local to the worktree (eg. HEAD, refs/bisect/{*}). We solve this by having
+ * multiple separate databases (ie. multiple reftable/ directories), one for
+ * the shared refs, one for the current worktree refs, and one for each
+ * additional worktree. For reading, we merge the view of both the shared and
+ * the current worktree's refs, when necessary.
+ *
+ * This function also optionally assigns the rewritten reference name that is
+ * local to the stack. This translation is required when using worktree refs
+ * 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)
+{
+ const char *wtname;
+ int wtname_len;
+
+ if (!refname)
+ return store->main_stack;
+
+ 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
+ * allocate the worktree name whenever we look up a reference.
+ * This could be avoided if the strmap interface knew how to
+ * handle keys with a length.
+ */
+ strbuf_reset(&wtname_buf);
+ strbuf_add(&wtname_buf, wtname, wtname_len);
+
+ /*
+ * 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
+ * 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) {
+ 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);
+ assert(store->err != REFTABLE_API_ERROR);
+ strmap_put(&store->worktree_stacks, wtname_buf.buf, stack);
+ }
+
+ strbuf_release(&wt_dir);
+ return stack;
+ }
+ 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;
+ case REF_WORKTREE_MAIN:
+ case REF_WORKTREE_SHARED:
+ return store->main_stack;
+ default:
+ BUG("unhandled worktree reference type");
+ }
+}
+
+static int should_write_log(struct ref_store *refs, const char *refname)
+{
+ if (log_all_ref_updates == LOG_REFS_UNSET)
+ log_all_ref_updates = is_bare_repository() ? LOG_REFS_NONE : LOG_REFS_NORMAL;
+
+ switch (log_all_ref_updates) {
+ case LOG_REFS_NONE:
+ return refs_reflog_exists(refs, refname);
+ case LOG_REFS_ALWAYS:
+ return 1;
+ case LOG_REFS_NORMAL:
+ if (should_autocreate_reflog(refname))
+ return 1;
+ return refs_reflog_exists(refs, refname);
+ default:
+ BUG("unhandled core.logAllRefUpdates value %d", log_all_ref_updates);
+ }
+}
+
+static void fill_reftable_log_record(struct reftable_log_record *log)
+{
+ const char *info = git_committer_info(0);
+ struct ident_split split = {0};
+ int sign = 1;
+
+ if (split_ident_line(&split, info, strlen(info)))
+ BUG("failed splitting committer info");
+
+ reftable_log_record_release(log);
+ log->value_type = REFTABLE_LOG_UPDATE;
+ log->value.update.name =
+ xstrndup(split.name_begin, split.name_end - split.name_begin);
+ log->value.update.email =
+ xstrndup(split.mail_begin, split.mail_end - split.mail_begin);
+ log->value.update.time = atol(split.date_begin);
+ if (*split.tz_begin == '-') {
+ sign = -1;
+ split.tz_begin++;
+ }
+ if (*split.tz_begin == '+') {
+ sign = 1;
+ split.tz_begin++;
+ }
+
+ log->value.update.tz_offset = sign * atoi(split.tz_begin);
+}
+
+static int read_ref_without_reload(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));
+ } 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 struct ref_store *reftable_be_init(struct repository *repo,
+ const char *gitdir,
+ unsigned int store_flags)
+{
+ struct reftable_ref_store *refs = xcalloc(1, sizeof(*refs));
+ struct strbuf path = STRBUF_INIT;
+ int is_worktree;
+ mode_t mask;
+
+ mask = umask(0);
+ umask(mask);
+
+ base_ref_store_init(&refs->base, repo, gitdir, &refs_be_reftable);
+ strmap_init(&refs->worktree_stacks);
+ refs->store_flags = store_flags;
+ refs->write_options.block_size = 4096;
+ refs->write_options.hash_id = 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);
+
+ /*
+ * Set up the main reftable stack that is hosted in GIT_COMMON_DIR.
+ * This stack contains both the shared and the main worktree refs.
+ *
+ * Note that we don't try to resolve the path in case we have a
+ * worktree because `get_common_dir_noenv()` already does it for us.
+ */
+ is_worktree = get_common_dir_noenv(&path, gitdir);
+ if (!is_worktree) {
+ strbuf_reset(&path);
+ strbuf_realpath(&path, gitdir, 0);
+ }
+ strbuf_addstr(&path, "/reftable");
+ refs->err = reftable_new_stack(&refs->main_stack, path.buf,
+ refs->write_options);
+ if (refs->err)
+ goto done;
+
+ /*
+ * If we're in a worktree we also need to set up the worktree reftable
+ * stack that is contained in the per-worktree GIT_DIR.
+ *
+ * Ideally, we would also add the stack to our worktree stack map. But
+ * we have no way to figure out the worktree name here and thus can't
+ * do it efficiently.
+ */
+ if (is_worktree) {
+ strbuf_reset(&path);
+ strbuf_addf(&path, "%s/reftable", gitdir);
+
+ refs->err = reftable_new_stack(&refs->worktree_stack, path.buf,
+ refs->write_options);
+ if (refs->err)
+ goto done;
+ }
+
+ chdir_notify_reparent("reftables-backend $GIT_DIR", &refs->base.gitdir);
+
+done:
+ assert(refs->err != REFTABLE_API_ERROR);
+ strbuf_release(&path);
+ return &refs->base;
+}
+
+static int reftable_be_init_db(struct ref_store *ref_store,
+ int flags UNUSED,
+ struct strbuf *err UNUSED)
+{
+ struct reftable_ref_store *refs =
+ reftable_be_downcast(ref_store, REF_STORE_WRITE, "init_db");
+ struct strbuf sb = STRBUF_INIT;
+
+ strbuf_addf(&sb, "%s/reftable", refs->base.gitdir);
+ safe_create_dir(sb.buf, 1);
+ strbuf_reset(&sb);
+
+ strbuf_addf(&sb, "%s/HEAD", refs->base.gitdir);
+ write_file(sb.buf, "ref: refs/heads/.invalid");
+ adjust_shared_perm(sb.buf);
+ strbuf_reset(&sb);
+
+ strbuf_addf(&sb, "%s/refs", refs->base.gitdir);
+ safe_create_dir(sb.buf, 1);
+ strbuf_reset(&sb);
+
+ strbuf_addf(&sb, "%s/refs/heads", refs->base.gitdir);
+ write_file(sb.buf, "this repository uses the reftable format");
+ adjust_shared_perm(sb.buf);
+
+ strbuf_release(&sb);
+ return 0;
+}
+
+struct reftable_ref_iterator {
+ struct ref_iterator base;
+ struct reftable_ref_store *refs;
+ struct reftable_iterator iter;
+ struct reftable_ref_record ref;
+ struct object_id oid;
+
+ const char *prefix;
+ size_t prefix_len;
+ unsigned int flags;
+ int err;
+};
+
+static int reftable_ref_iterator_advance(struct ref_iterator *ref_iterator)
+{
+ struct reftable_ref_iterator *iter =
+ (struct reftable_ref_iterator *)ref_iterator;
+ struct reftable_ref_store *refs = iter->refs;
+
+ while (!iter->err) {
+ int flags = 0;
+
+ iter->err = reftable_iterator_next_ref(&iter->iter, &iter->ref);
+ if (iter->err)
+ break;
+
+ /*
+ * The files backend only lists references contained in "refs/" unless
+ * the root refs are to be included. We emulate the same behaviour here.
+ */
+ if (!starts_with(iter->ref.refname, "refs/") &&
+ !(iter->flags & DO_FOR_EACH_INCLUDE_ROOT_REFS &&
+ (is_pseudoref(&iter->refs->base, iter->ref.refname) ||
+ is_headref(&iter->refs->base, iter->ref.refname)))) {
+ continue;
+ }
+
+ if (iter->prefix_len &&
+ strncmp(iter->prefix, iter->ref.refname, iter->prefix_len)) {
+ iter->err = 1;
+ break;
+ }
+
+ if (iter->flags & DO_FOR_EACH_PER_WORKTREE_ONLY &&
+ parse_worktree_ref(iter->ref.refname, NULL, NULL, NULL) !=
+ REF_WORKTREE_CURRENT)
+ continue;
+
+ switch (iter->ref.value_type) {
+ case REFTABLE_REF_VAL1:
+ oidread(&iter->oid, iter->ref.value.val1);
+ break;
+ case REFTABLE_REF_VAL2:
+ oidread(&iter->oid, iter->ref.value.val2.value);
+ break;
+ case REFTABLE_REF_SYMREF:
+ if (!refs_resolve_ref_unsafe(&iter->refs->base, iter->ref.refname,
+ RESOLVE_REF_READING, &iter->oid, &flags))
+ oidclr(&iter->oid);
+ break;
+ default:
+ BUG("unhandled reference value type %d", iter->ref.value_type);
+ }
+
+ if (is_null_oid(&iter->oid))
+ flags |= REF_ISBROKEN;
+
+ if (check_refname_format(iter->ref.refname, REFNAME_ALLOW_ONELEVEL)) {
+ if (!refname_is_safe(iter->ref.refname))
+ die(_("refname is dangerous: %s"), iter->ref.refname);
+ oidclr(&iter->oid);
+ flags |= REF_BAD_NAME | REF_ISBROKEN;
+ }
+
+ if (iter->flags & DO_FOR_EACH_OMIT_DANGLING_SYMREFS &&
+ flags & REF_ISSYMREF &&
+ flags & REF_ISBROKEN)
+ continue;
+
+ if (!(iter->flags & DO_FOR_EACH_INCLUDE_BROKEN) &&
+ !ref_resolves_to_object(iter->ref.refname, refs->base.repo,
+ &iter->oid, flags))
+ continue;
+
+ iter->base.refname = iter->ref.refname;
+ iter->base.oid = &iter->oid;
+ iter->base.flags = flags;
+
+ break;
+ }
+
+ if (iter->err > 0) {
+ if (ref_iterator_abort(ref_iterator) != ITER_DONE)
+ return ITER_ERROR;
+ return ITER_DONE;
+ }
+
+ if (iter->err < 0) {
+ ref_iterator_abort(ref_iterator);
+ return ITER_ERROR;
+ }
+
+ return ITER_OK;
+}
+
+static int reftable_ref_iterator_peel(struct ref_iterator *ref_iterator,
+ struct object_id *peeled)
+{
+ struct reftable_ref_iterator *iter =
+ (struct reftable_ref_iterator *)ref_iterator;
+
+ if (iter->ref.value_type == REFTABLE_REF_VAL2) {
+ oidread(peeled, iter->ref.value.val2.target_value);
+ return 0;
+ }
+
+ return -1;
+}
+
+static int reftable_ref_iterator_abort(struct ref_iterator *ref_iterator)
+{
+ struct reftable_ref_iterator *iter =
+ (struct reftable_ref_iterator *)ref_iterator;
+ reftable_ref_record_release(&iter->ref);
+ reftable_iterator_destroy(&iter->iter);
+ free(iter);
+ return ITER_DONE;
+}
+
+static struct ref_iterator_vtable reftable_ref_iterator_vtable = {
+ .advance = reftable_ref_iterator_advance,
+ .peel = reftable_ref_iterator_peel,
+ .abort = reftable_ref_iterator_abort
+};
+
+static struct reftable_ref_iterator *ref_iterator_for_stack(struct reftable_ref_store *refs,
+ struct reftable_stack *stack,
+ const char *prefix,
+ int flags)
+{
+ struct reftable_merged_table *merged_table;
+ struct reftable_ref_iterator *iter;
+ int ret;
+
+ iter = xcalloc(1, sizeof(*iter));
+ base_ref_iterator_init(&iter->base, &reftable_ref_iterator_vtable);
+ iter->prefix = prefix;
+ iter->prefix_len = prefix ? strlen(prefix) : 0;
+ iter->base.oid = &iter->oid;
+ iter->flags = flags;
+ iter->refs = refs;
+
+ ret = refs->err;
+ if (ret)
+ goto done;
+
+ ret = reftable_stack_reload(stack);
+ if (ret)
+ goto done;
+
+ merged_table = reftable_stack_merged_table(stack);
+
+ ret = reftable_merged_table_seek_ref(merged_table, &iter->iter, prefix);
+ if (ret)
+ goto done;
+
+done:
+ iter->err = ret;
+ return iter;
+}
+
+static struct ref_iterator *reftable_be_iterator_begin(struct ref_store *ref_store,
+ const char *prefix,
+ const char **exclude_patterns,
+ unsigned int flags)
+{
+ struct reftable_ref_iterator *main_iter, *worktree_iter;
+ struct reftable_ref_store *refs;
+ unsigned int required_flags = REF_STORE_READ;
+
+ if (!(flags & DO_FOR_EACH_INCLUDE_BROKEN))
+ 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, flags);
+
+ /*
+ * The worktree stack is only set when we're in an actual worktree
+ * right now. If we aren't, then we return the common reftable
+ * iterator, only.
+ */
+ if (!refs->worktree_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, flags);
+ return merge_ref_iterator_begin(&worktree_iter->base, &main_iter->base,
+ ref_iterator_select, NULL);
+}
+
+static int reftable_be_read_raw_ref(struct ref_store *ref_store,
+ const char *refname,
+ struct object_id *oid,
+ struct strbuf *referent,
+ unsigned int *type,
+ int *failure_errno)
+{
+ 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);
+ int ret;
+
+ if (refs->err < 0)
+ return refs->err;
+
+ ret = reftable_stack_reload(stack);
+ if (ret)
+ return ret;
+
+ ret = read_ref_without_reload(stack, refname, oid, referent, type);
+ if (ret < 0)
+ return ret;
+ if (ret > 0) {
+ *failure_errno = ENOENT;
+ return -1;
+ }
+
+ return 0;
+}
+
+static int reftable_be_read_symbolic_ref(struct ref_store *ref_store,
+ const char *refname,
+ struct strbuf *referent)
+{
+ 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};
+ int ret;
+
+ ret = reftable_stack_reload(stack);
+ 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 = -1;
+
+ reftable_ref_record_release(&ref);
+ return ret;
+}
+
+/*
+ * Return the refname under which update was originally requested.
+ */
+static const char *original_update_refname(struct ref_update *update)
+{
+ while (update->parent_update)
+ update = update->parent_update;
+ return update->refname;
+}
+
+struct reftable_transaction_update {
+ struct ref_update *update;
+ struct object_id current_oid;
+};
+
+struct write_transaction_table_arg {
+ struct reftable_ref_store *refs;
+ struct reftable_stack *stack;
+ struct reftable_addition *addition;
+ struct reftable_transaction_update *updates;
+ size_t updates_nr;
+ size_t updates_alloc;
+ size_t updates_expected;
+};
+
+struct reftable_transaction_data {
+ struct write_transaction_table_arg *args;
+ size_t args_nr, args_alloc;
+};
+
+static void free_transaction_data(struct reftable_transaction_data *tx_data)
+{
+ if (!tx_data)
+ return;
+ for (size_t i = 0; i < tx_data->args_nr; i++) {
+ reftable_addition_destroy(tx_data->args[i].addition);
+ free(tx_data->args[i].updates);
+ }
+ free(tx_data->args);
+ free(tx_data);
+}
+
+/*
+ * Prepare transaction update for the given reference update. This will cause
+ * us to lock the corresponding reftable stack for concurrent modification.
+ */
+static int prepare_transaction_update(struct write_transaction_table_arg **out,
+ struct reftable_ref_store *refs,
+ struct reftable_transaction_data *tx_data,
+ struct ref_update *update,
+ struct strbuf *err)
+{
+ struct reftable_stack *stack = stack_for(refs, update->refname, NULL);
+ struct write_transaction_table_arg *arg = NULL;
+ size_t i;
+ int 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)
+ arg = &tx_data->args[i];
+
+ if (!arg) {
+ struct reftable_addition *addition;
+
+ ret = reftable_stack_reload(stack);
+ if (ret)
+ return ret;
+
+ ret = reftable_stack_new_addition(&addition, stack);
+ if (ret) {
+ if (ret == REFTABLE_LOCK_ERROR)
+ strbuf_addstr(err, "cannot lock references");
+ return ret;
+ }
+
+ ALLOC_GROW(tx_data->args, tx_data->args_nr + 1,
+ tx_data->args_alloc);
+ arg = &tx_data->args[tx_data->args_nr++];
+ arg->refs = refs;
+ arg->stack = stack;
+ arg->addition = addition;
+ arg->updates = NULL;
+ arg->updates_nr = 0;
+ arg->updates_alloc = 0;
+ arg->updates_expected = 0;
+ }
+
+ arg->updates_expected++;
+
+ if (out)
+ *out = arg;
+
+ return 0;
+}
+
+/*
+ * Queue a reference update for the correct stack. We potentially need to
+ * handle multiple stack updates in a single transaction when it spans across
+ * multiple worktrees.
+ */
+static int queue_transaction_update(struct reftable_ref_store *refs,
+ struct reftable_transaction_data *tx_data,
+ struct ref_update *update,
+ struct object_id *current_oid,
+ struct strbuf *err)
+{
+ struct write_transaction_table_arg *arg = NULL;
+ int ret;
+
+ if (update->backend_data)
+ BUG("reference update queued more than once");
+
+ ret = prepare_transaction_update(&arg, refs, tx_data, update, err);
+ if (ret < 0)
+ return ret;
+
+ ALLOC_GROW(arg->updates, arg->updates_nr + 1,
+ arg->updates_alloc);
+ arg->updates[arg->updates_nr].update = update;
+ oidcpy(&arg->updates[arg->updates_nr].current_oid, current_oid);
+ update->backend_data = &arg->updates[arg->updates_nr++];
+
+ return 0;
+}
+
+static int reftable_be_transaction_prepare(struct ref_store *ref_store,
+ struct ref_transaction *transaction,
+ struct strbuf *err)
+{
+ struct reftable_ref_store *refs =
+ reftable_be_downcast(ref_store, REF_STORE_WRITE|REF_STORE_MAIN, "ref_transaction_prepare");
+ 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 object_id head_oid;
+ unsigned int head_type = 0;
+ size_t i;
+ int ret;
+
+ ret = refs->err;
+ if (ret < 0)
+ goto done;
+
+ tx_data = xcalloc(1, sizeof(*tx_data));
+
+ /*
+ * Preprocess all updates. For one we check that there are no duplicate
+ * reference updates in this transaction. Second, we lock all stacks
+ * that will be modified during the transaction.
+ */
+ for (i = 0; i < transaction->nr; i++) {
+ ret = prepare_transaction_update(NULL, refs, tx_data,
+ transaction->updates[i], err);
+ if (ret)
+ goto done;
+
+ string_list_append(&affected_refnames,
+ transaction->updates[i]->refname);
+ }
+
+ /*
+ * Now that we have counted updates per stack we can preallocate their
+ * arrays. This avoids having to reallocate many times.
+ */
+ for (i = 0; i < tx_data->args_nr; i++) {
+ CALLOC_ARRAY(tx_data->args[i].updates, tx_data->args[i].updates_expected);
+ tx_data->args[i].updates_alloc = tx_data->args[i].updates_expected;
+ }
+
+ /*
+ * Fail if a refname appears more than once in the transaction.
+ * This code is taken from the files backend and is a good candidate to
+ * be moved into the generic layer.
+ */
+ string_list_sort(&affected_refnames);
+ if (ref_update_reject_duplicates(&affected_refnames, err)) {
+ ret = TRANSACTION_GENERIC_ERROR;
+ goto done;
+ }
+
+ ret = read_ref_without_reload(stack_for(refs, "HEAD", NULL), "HEAD", &head_oid,
+ &head_referent, &head_type);
+ if (ret < 0)
+ goto done;
+ ret = 0;
+
+ 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);
+
+ /* Verify that the new object ID is valid. */
+ if ((u->flags & REF_HAVE_NEW) && !is_null_oid(&u->new_oid) &&
+ !(u->flags & REF_SKIP_OID_VERIFICATION) &&
+ !(u->flags & REF_LOG_ONLY)) {
+ struct object *o = parse_object(refs->base.repo, &u->new_oid);
+ if (!o) {
+ strbuf_addf(err,
+ _("trying to write ref '%s' with nonexistent object %s"),
+ u->refname, oid_to_hex(&u->new_oid));
+ ret = -1;
+ goto done;
+ }
+
+ if (o->type != OBJ_COMMIT && is_branch(u->refname)) {
+ strbuf_addf(err, _("trying to write non-commit object %s to branch '%s'"),
+ oid_to_hex(&u->new_oid), u->refname);
+ ret = -1;
+ goto done;
+ }
+ }
+
+ /*
+ * When we update the reference that HEAD points to we enqueue
+ * a second log-only update for HEAD so that its reflog is
+ * updated accordingly.
+ */
+ if (head_type == REF_ISSYMREF &&
+ !(u->flags & REF_LOG_ONLY) &&
+ !(u->flags & REF_UPDATE_VIA_HEAD) &&
+ !strcmp(rewritten_ref, head_referent.buf)) {
+ struct ref_update *new_update;
+
+ /*
+ * First make sure that HEAD is not already in the
+ * transaction. This check is O(lg N) in the transaction
+ * size, but it happens at most once per transaction.
+ */
+ if (string_list_has_string(&affected_refnames, "HEAD")) {
+ /* An entry already existed */
+ strbuf_addf(err,
+ _("multiple updates for 'HEAD' (including one "
+ "via its referent '%s') are not allowed"),
+ u->refname);
+ ret = TRANSACTION_NAME_CONFLICT;
+ goto done;
+ }
+
+ new_update = ref_transaction_add_update(
+ transaction, "HEAD",
+ u->flags | REF_LOG_ONLY | REF_NO_DEREF,
+ &u->new_oid, &u->old_oid, u->msg);
+ string_list_insert(&affected_refnames, new_update->refname);
+ }
+
+ ret = read_ref_without_reload(stack, rewritten_ref,
+ &current_oid, &referent, &u->type);
+ if (ret < 0)
+ goto done;
+ if (ret > 0 && (!(u->flags & REF_HAVE_OLD) || is_null_oid(&u->old_oid))) {
+ /*
+ * The reference does not exist, and we either have no
+ * old object ID or expect the reference to not exist.
+ * We can thus skip below safety checks as well as the
+ * symref splitting. But we do want to verify that
+ * there is no conflicting reference here so that we
+ * can output a proper error message instead of failing
+ * at a later point.
+ */
+ ret = refs_verify_refname_available(ref_store, u->refname,
+ &affected_refnames, NULL, err);
+ if (ret < 0)
+ goto done;
+
+ /*
+ * There is no need to write the reference deletion
+ * when the reference in question doesn't exist.
+ */
+ if (u->flags & REF_HAVE_NEW && !is_null_oid(&u->new_oid)) {
+ ret = queue_transaction_update(refs, tx_data, u,
+ &current_oid, err);
+ if (ret)
+ goto done;
+ }
+
+ continue;
+ }
+ if (ret > 0) {
+ /* The reference does not exist, but we expected it to. */
+ strbuf_addf(err, _("cannot lock ref '%s': "
+ "unable to resolve reference '%s'"),
+ original_update_refname(u), u->refname);
+ ret = -1;
+ goto done;
+ }
+
+ if (u->type & REF_ISSYMREF) {
+ /*
+ * The reftable stack is locked at this point already,
+ * so it is safe to call `refs_resolve_ref_unsafe()`
+ * here without causing races.
+ */
+ const char *resolved = refs_resolve_ref_unsafe(&refs->base, u->refname, 0,
+ &current_oid, NULL);
+
+ if (u->flags & REF_NO_DEREF) {
+ if (u->flags & REF_HAVE_OLD && !resolved) {
+ strbuf_addf(err, _("cannot lock ref '%s': "
+ "error reading reference"), u->refname);
+ ret = -1;
+ goto done;
+ }
+ } else {
+ struct ref_update *new_update;
+ int new_flags;
+
+ new_flags = u->flags;
+ if (!strcmp(rewritten_ref, "HEAD"))
+ new_flags |= REF_UPDATE_VIA_HEAD;
+
+ /*
+ * If we are updating a symref (eg. HEAD), we should also
+ * update the branch that the symref points to.
+ *
+ * This is generic functionality, and would be better
+ * done in refs.c, but the current implementation is
+ * intertwined with the locking in files-backend.c.
+ */
+ new_update = ref_transaction_add_update(
+ transaction, referent.buf, new_flags,
+ &u->new_oid, &u->old_oid, u->msg);
+ new_update->parent_update = u;
+
+ /*
+ * Change the symbolic ref update to log only. Also, it
+ * doesn't need to check its old OID value, as that will be
+ * done when new_update is processed.
+ */
+ u->flags |= REF_LOG_ONLY | REF_NO_DEREF;
+ u->flags &= ~REF_HAVE_OLD;
+
+ if (string_list_has_string(&affected_refnames, new_update->refname)) {
+ strbuf_addf(err,
+ _("multiple updates for '%s' (including one "
+ "via symref '%s') are not allowed"),
+ referent.buf, u->refname);
+ ret = TRANSACTION_NAME_CONFLICT;
+ goto done;
+ }
+ string_list_insert(&affected_refnames, new_update->refname);
+ }
+ }
+
+ /*
+ * Verify that the old object matches our expectations. Note
+ * that the error messages here do not make a lot of sense in
+ * the context of the reftable backend as we never lock
+ * individual refs. But the error messages match what the files
+ * backend returns, which keeps our tests happy.
+ */
+ if (u->flags & REF_HAVE_OLD && !oideq(&current_oid, &u->old_oid)) {
+ if (is_null_oid(&u->old_oid))
+ strbuf_addf(err, _("cannot lock ref '%s': "
+ "reference already exists"),
+ original_update_refname(u));
+ else if (is_null_oid(&current_oid))
+ strbuf_addf(err, _("cannot lock ref '%s': "
+ "reference is missing but expected %s"),
+ original_update_refname(u),
+ oid_to_hex(&u->old_oid));
+ else
+ strbuf_addf(err, _("cannot lock ref '%s': "
+ "is at %s but expected %s"),
+ original_update_refname(u),
+ oid_to_hex(&current_oid),
+ oid_to_hex(&u->old_oid));
+ ret = -1;
+ goto done;
+ }
+
+ /*
+ * If all of the following conditions are true:
+ *
+ * - We're not about to write a symref.
+ * - We're not about to write a log-only entry.
+ * - Old and new object ID are different.
+ *
+ * Then we're essentially doing a no-op update that can be
+ * skipped. This is not only for the sake of efficiency, but
+ * also skips writing unneeded reflog entries.
+ */
+ if ((u->type & REF_ISSYMREF) ||
+ (u->flags & REF_LOG_ONLY) ||
+ (u->flags & REF_HAVE_NEW && !oideq(&current_oid, &u->new_oid))) {
+ ret = queue_transaction_update(refs, tx_data, u,
+ &current_oid, err);
+ if (ret)
+ goto done;
+ }
+ }
+
+ transaction->backend_data = tx_data;
+ transaction->state = REF_TRANSACTION_PREPARED;
+
+done:
+ assert(ret != REFTABLE_API_ERROR);
+ if (ret < 0) {
+ free_transaction_data(tx_data);
+ transaction->state = REF_TRANSACTION_CLOSED;
+ if (!err->len)
+ strbuf_addf(err, _("reftable: transaction prepare: %s"),
+ reftable_error_str(ret));
+ }
+ string_list_clear(&affected_refnames, 0);
+ strbuf_release(&referent);
+ strbuf_release(&head_referent);
+
+ return ret;
+}
+
+static int reftable_be_transaction_abort(struct ref_store *ref_store,
+ struct ref_transaction *transaction,
+ struct strbuf *err)
+{
+ struct reftable_transaction_data *tx_data = transaction->backend_data;
+ free_transaction_data(tx_data);
+ transaction->state = REF_TRANSACTION_CLOSED;
+ return 0;
+}
+
+static int transaction_update_cmp(const void *a, const void *b)
+{
+ return strcmp(((struct reftable_transaction_update *)a)->update->refname,
+ ((struct reftable_transaction_update *)b)->update->refname);
+}
+
+static int write_transaction_table(struct reftable_writer *writer, void *cb_data)
+{
+ struct write_transaction_table_arg *arg = cb_data;
+ struct reftable_merged_table *mt =
+ reftable_stack_merged_table(arg->stack);
+ uint64_t ts = reftable_stack_next_update_index(arg->stack);
+ struct reftable_log_record *logs = NULL;
+ size_t logs_nr = 0, logs_alloc = 0, i;
+ int ret = 0;
+
+ QSORT(arg->updates, arg->updates_nr, transaction_update_cmp);
+
+ reftable_writer_set_limits(writer, ts, ts);
+
+ for (i = 0; i < arg->updates_nr; i++) {
+ struct reftable_transaction_update *tx_update = &arg->updates[i];
+ struct ref_update *u = tx_update->update;
+
+ /*
+ * Write a reflog entry when updating a ref to point to
+ * something new in either of the following cases:
+ *
+ * - The reference is about to be deleted. We always want to
+ * delete the reflog in that case.
+ * - REF_FORCE_CREATE_REFLOG is set, asking us to always create
+ * the reflog entry.
+ * - `core.logAllRefUpdates` tells us to create the reflog for
+ * the given ref.
+ */
+ if (u->flags & REF_HAVE_NEW && !(u->type & REF_ISSYMREF) && is_null_oid(&u->new_oid)) {
+ struct reftable_log_record log = {0};
+ struct reftable_iterator it = {0};
+
+ /*
+ * When deleting refs we also delete all reflog entries
+ * with them. While it is not strictly required to
+ * delete reflogs together with their refs, this
+ * matches the behaviour of the files backend.
+ *
+ * Unfortunately, we have no better way than to delete
+ * all reflog entries one by one.
+ */
+ ret = reftable_merged_table_seek_log(mt, &it, u->refname);
+ while (ret == 0) {
+ struct reftable_log_record *tombstone;
+
+ ret = reftable_iterator_next_log(&it, &log);
+ if (ret < 0)
+ break;
+ if (ret > 0 || strcmp(log.refname, u->refname)) {
+ ret = 0;
+ break;
+ }
+
+ ALLOC_GROW(logs, logs_nr + 1, logs_alloc);
+ tombstone = &logs[logs_nr++];
+ tombstone->refname = xstrdup(u->refname);
+ tombstone->value_type = REFTABLE_LOG_DELETION;
+ tombstone->update_index = log.update_index;
+ }
+
+ reftable_log_record_release(&log);
+ reftable_iterator_destroy(&it);
+
+ if (ret)
+ goto done;
+ } else if (u->flags & REF_HAVE_NEW &&
+ (u->flags & REF_FORCE_CREATE_REFLOG ||
+ should_write_log(&arg->refs->base, u->refname))) {
+ struct reftable_log_record *log;
+
+ ALLOC_GROW(logs, logs_nr + 1, logs_alloc);
+ log = &logs[logs_nr++];
+ memset(log, 0, sizeof(*log));
+
+ fill_reftable_log_record(log);
+ log->update_index = ts;
+ log->refname = xstrdup(u->refname);
+ memcpy(log->value.update.new_hash, u->new_oid.hash, GIT_MAX_RAWSZ);
+ memcpy(log->value.update.old_hash, tx_update->current_oid.hash, GIT_MAX_RAWSZ);
+ log->value.update.message =
+ xstrndup(u->msg, arg->refs->write_options.block_size / 2);
+ }
+
+ if (u->flags & REF_LOG_ONLY)
+ continue;
+
+ if (u->flags & REF_HAVE_NEW && is_null_oid(&u->new_oid)) {
+ struct reftable_ref_record ref = {
+ .refname = (char *)u->refname,
+ .update_index = ts,
+ .value_type = REFTABLE_REF_DELETION,
+ };
+
+ ret = reftable_writer_add_ref(writer, &ref);
+ if (ret < 0)
+ goto done;
+ } else if (u->flags & REF_HAVE_NEW) {
+ struct reftable_ref_record ref = {0};
+ struct object_id peeled;
+ int peel_error;
+
+ ref.refname = (char *)u->refname;
+ ref.update_index = ts;
+
+ peel_error = peel_object(&u->new_oid, &peeled);
+ if (!peel_error) {
+ ref.value_type = REFTABLE_REF_VAL2;
+ memcpy(ref.value.val2.target_value, peeled.hash, GIT_MAX_RAWSZ);
+ memcpy(ref.value.val2.value, u->new_oid.hash, GIT_MAX_RAWSZ);
+ } else if (!is_null_oid(&u->new_oid)) {
+ ref.value_type = REFTABLE_REF_VAL1;
+ memcpy(ref.value.val1, u->new_oid.hash, GIT_MAX_RAWSZ);
+ }
+
+ ret = reftable_writer_add_ref(writer, &ref);
+ if (ret < 0)
+ goto done;
+ }
+ }
+
+ /*
+ * Logs are written at the end so that we do not have intermixed ref
+ * and log blocks.
+ */
+ if (logs) {
+ ret = reftable_writer_add_logs(writer, logs, logs_nr);
+ if (ret < 0)
+ goto done;
+ }
+
+done:
+ assert(ret != REFTABLE_API_ERROR);
+ for (i = 0; i < logs_nr; i++)
+ reftable_log_record_release(&logs[i]);
+ free(logs);
+ return ret;
+}
+
+static int reftable_be_transaction_finish(struct ref_store *ref_store,
+ struct ref_transaction *transaction,
+ struct strbuf *err)
+{
+ struct reftable_transaction_data *tx_data = transaction->backend_data;
+ int ret = 0;
+
+ for (size_t i = 0; i < tx_data->args_nr; i++) {
+ ret = reftable_addition_add(tx_data->args[i].addition,
+ write_transaction_table, &tx_data->args[i]);
+ if (ret < 0)
+ goto done;
+
+ ret = reftable_addition_commit(tx_data->args[i].addition);
+ if (ret < 0)
+ goto done;
+ }
+
+done:
+ assert(ret != REFTABLE_API_ERROR);
+ free_transaction_data(tx_data);
+ transaction->state = REF_TRANSACTION_CLOSED;
+
+ if (ret) {
+ strbuf_addf(err, _("reftable: transaction failure: %s"),
+ reftable_error_str(ret));
+ return -1;
+ }
+ return ret;
+}
+
+static int reftable_be_initial_transaction_commit(struct ref_store *ref_store UNUSED,
+ struct ref_transaction *transaction,
+ struct strbuf *err)
+{
+ return ref_transaction_commit(transaction, err);
+}
+
+static int reftable_be_pack_refs(struct ref_store *ref_store,
+ struct pack_refs_opts *opts)
+{
+ struct reftable_ref_store *refs =
+ reftable_be_downcast(ref_store, REF_STORE_WRITE | REF_STORE_ODB, "pack_refs");
+ struct reftable_stack *stack;
+ int ret;
+
+ if (refs->err)
+ return refs->err;
+
+ stack = refs->worktree_stack;
+ if (!stack)
+ stack = refs->main_stack;
+
+ if (opts->flags & PACK_REFS_AUTO)
+ ret = reftable_stack_auto_compact(stack);
+ else
+ ret = reftable_stack_compact_all(stack, NULL);
+ if (ret < 0) {
+ ret = error(_("unable to compact stack: %s"),
+ reftable_error_str(ret));
+ goto out;
+ }
+
+ ret = reftable_stack_clean(stack);
+ if (ret)
+ goto out;
+
+out:
+ return ret;
+}
+
+struct write_create_symref_arg {
+ struct reftable_ref_store *refs;
+ struct reftable_stack *stack;
+ const char *refname;
+ const char *target;
+ const char *logmsg;
+};
+
+static int write_create_symref_table(struct reftable_writer *writer, void *cb_data)
+{
+ struct write_create_symref_arg *create = cb_data;
+ uint64_t ts = reftable_stack_next_update_index(create->stack);
+ struct reftable_ref_record ref = {
+ .refname = (char *)create->refname,
+ .value_type = REFTABLE_REF_SYMREF,
+ .value.symref = (char *)create->target,
+ .update_index = ts,
+ };
+ struct reftable_log_record log = {0};
+ struct object_id new_oid;
+ struct object_id old_oid;
+ int ret;
+
+ reftable_writer_set_limits(writer, ts, ts);
+
+ ret = reftable_writer_add_ref(writer, &ref);
+ if (ret)
+ return ret;
+
+ /*
+ * Note that it is important to try and resolve the reference before we
+ * write the log entry. This is because `should_write_log()` will munge
+ * `core.logAllRefUpdates`, which is undesirable when we create a new
+ * repository because it would be written into the config. As HEAD will
+ * not resolve for new repositories this ordering will ensure that this
+ * never happens.
+ */
+ if (!create->logmsg ||
+ !refs_resolve_ref_unsafe(&create->refs->base, create->target,
+ RESOLVE_REF_READING, &new_oid, NULL) ||
+ !should_write_log(&create->refs->base, create->refname))
+ return 0;
+
+ fill_reftable_log_record(&log);
+ log.refname = xstrdup(create->refname);
+ log.update_index = ts;
+ log.value.update.message = xstrndup(create->logmsg,
+ create->refs->write_options.block_size / 2);
+ memcpy(log.value.update.new_hash, new_oid.hash, GIT_MAX_RAWSZ);
+ if (refs_resolve_ref_unsafe(&create->refs->base, create->refname,
+ RESOLVE_REF_READING, &old_oid, NULL))
+ memcpy(log.value.update.old_hash, old_oid.hash, GIT_MAX_RAWSZ);
+
+ ret = reftable_writer_add_log(writer, &log);
+ reftable_log_record_release(&log);
+ return ret;
+}
+
+static int reftable_be_create_symref(struct ref_store *ref_store,
+ const char *refname,
+ const char *target,
+ const char *logmsg)
+{
+ struct reftable_ref_store *refs =
+ reftable_be_downcast(ref_store, REF_STORE_WRITE, "create_symref");
+ struct reftable_stack *stack = stack_for(refs, refname, &refname);
+ struct write_create_symref_arg arg = {
+ .refs = refs,
+ .stack = stack,
+ .refname = refname,
+ .target = target,
+ .logmsg = logmsg,
+ };
+ int ret;
+
+ ret = refs->err;
+ if (ret < 0)
+ goto done;
+
+ ret = reftable_stack_reload(stack);
+ if (ret)
+ goto done;
+
+ ret = reftable_stack_add(stack, &write_create_symref_table, &arg);
+
+done:
+ assert(ret != REFTABLE_API_ERROR);
+ if (ret)
+ error("unable to write symref for %s: %s", refname,
+ reftable_error_str(ret));
+ return ret;
+}
+
+struct write_copy_arg {
+ struct reftable_ref_store *refs;
+ struct reftable_stack *stack;
+ const char *oldname;
+ const char *newname;
+ const char *logmsg;
+ int delete_old;
+};
+
+static int write_copy_table(struct reftable_writer *writer, void *cb_data)
+{
+ struct write_copy_arg *arg = cb_data;
+ uint64_t deletion_ts, creation_ts;
+ struct reftable_merged_table *mt = reftable_stack_merged_table(arg->stack);
+ struct reftable_ref_record old_ref = {0}, refs[2] = {0};
+ struct reftable_log_record old_log = {0}, *logs = NULL;
+ struct reftable_iterator it = {0};
+ struct string_list skip = STRING_LIST_INIT_NODUP;
+ struct strbuf errbuf = STRBUF_INIT;
+ size_t logs_nr = 0, logs_alloc = 0, i;
+ int ret;
+
+ if (reftable_stack_read_ref(arg->stack, arg->oldname, &old_ref)) {
+ ret = error(_("refname %s not found"), arg->oldname);
+ goto done;
+ }
+ if (old_ref.value_type == REFTABLE_REF_SYMREF) {
+ ret = error(_("refname %s is a symbolic ref, copying it is not supported"),
+ arg->oldname);
+ goto done;
+ }
+
+ /*
+ * There's nothing to do in case the old and new name are the same, so
+ * we exit early in that case.
+ */
+ if (!strcmp(arg->oldname, arg->newname)) {
+ ret = 0;
+ goto done;
+ }
+
+ /*
+ * Verify that the new refname is available.
+ */
+ string_list_insert(&skip, arg->oldname);
+ ret = refs_verify_refname_available(&arg->refs->base, arg->newname,
+ NULL, &skip, &errbuf);
+ if (ret < 0) {
+ error("%s", errbuf.buf);
+ goto done;
+ }
+
+ /*
+ * When deleting the old reference we have to use two update indices:
+ * once to delete the old ref and its reflog, and once to create the
+ * new ref and its reflog. They need to be staged with two separate
+ * indices because the new reflog needs to encode both the deletion of
+ * 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);
+ if (arg->delete_old)
+ creation_ts++;
+ reftable_writer_set_limits(writer, deletion_ts, creation_ts);
+
+ /*
+ * Add the new reference. If this is a rename then we also delete the
+ * old reference.
+ */
+ refs[0] = old_ref;
+ refs[0].refname = (char *)arg->newname;
+ refs[0].update_index = creation_ts;
+ if (arg->delete_old) {
+ refs[1].refname = (char *)arg->oldname;
+ refs[1].value_type = REFTABLE_REF_DELETION;
+ refs[1].update_index = deletion_ts;
+ }
+ ret = reftable_writer_add_refs(writer, refs, arg->delete_old ? 2 : 1);
+ if (ret < 0)
+ goto done;
+
+ /*
+ * When deleting the old branch we need to create a reflog entry on the
+ * new branch name that indicates that the old branch has been deleted
+ * and then recreated. This is a tad weird, but matches what the files
+ * backend does.
+ */
+ if (arg->delete_old) {
+ struct strbuf head_referent = STRBUF_INIT;
+ struct object_id head_oid;
+ int append_head_reflog;
+ unsigned head_type = 0;
+
+ ALLOC_GROW(logs, logs_nr + 1, logs_alloc);
+ memset(&logs[logs_nr], 0, sizeof(logs[logs_nr]));
+ fill_reftable_log_record(&logs[logs_nr]);
+ logs[logs_nr].refname = (char *)arg->newname;
+ logs[logs_nr].update_index = deletion_ts;
+ logs[logs_nr].value.update.message =
+ xstrndup(arg->logmsg, arg->refs->write_options.block_size / 2);
+ memcpy(logs[logs_nr].value.update.old_hash, old_ref.value.val1, GIT_MAX_RAWSZ);
+ logs_nr++;
+
+ ret = read_ref_without_reload(arg->stack, "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);
+ strbuf_release(&head_referent);
+
+ /*
+ * The files backend uses `refs_delete_ref()` to delete the old
+ * branch name, which will append a reflog entry for HEAD in
+ * case it points to the old branch.
+ */
+ if (append_head_reflog) {
+ ALLOC_GROW(logs, logs_nr + 1, logs_alloc);
+ logs[logs_nr] = logs[logs_nr - 1];
+ logs[logs_nr].refname = "HEAD";
+ logs_nr++;
+ }
+ }
+
+ /*
+ * Create the reflog entry for the newly created branch.
+ */
+ ALLOC_GROW(logs, logs_nr + 1, logs_alloc);
+ memset(&logs[logs_nr], 0, sizeof(logs[logs_nr]));
+ fill_reftable_log_record(&logs[logs_nr]);
+ logs[logs_nr].refname = (char *)arg->newname;
+ logs[logs_nr].update_index = creation_ts;
+ logs[logs_nr].value.update.message =
+ xstrndup(arg->logmsg, arg->refs->write_options.block_size / 2);
+ memcpy(logs[logs_nr].value.update.new_hash, old_ref.value.val1, GIT_MAX_RAWSZ);
+ logs_nr++;
+
+ /*
+ * In addition to writing the reflog entry for the new branch, we also
+ * 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_merged_table_seek_log(mt, &it, arg->oldname);
+ if (ret < 0)
+ goto done;
+
+ while (1) {
+ ret = reftable_iterator_next_log(&it, &old_log);
+ if (ret < 0)
+ goto done;
+ if (ret > 0 || strcmp(old_log.refname, arg->oldname)) {
+ ret = 0;
+ break;
+ }
+
+ free(old_log.refname);
+
+ /*
+ * Copy over the old reflog entry with the new refname.
+ */
+ ALLOC_GROW(logs, logs_nr + 1, logs_alloc);
+ logs[logs_nr] = old_log;
+ logs[logs_nr].refname = (char *)arg->newname;
+ logs_nr++;
+
+ /*
+ * Delete the old reflog entry in case we are renaming.
+ */
+ if (arg->delete_old) {
+ ALLOC_GROW(logs, logs_nr + 1, logs_alloc);
+ memset(&logs[logs_nr], 0, sizeof(logs[logs_nr]));
+ logs[logs_nr].refname = (char *)arg->oldname;
+ logs[logs_nr].value_type = REFTABLE_LOG_DELETION;
+ logs[logs_nr].update_index = old_log.update_index;
+ logs_nr++;
+ }
+
+ /*
+ * Transfer ownership of the log record we're iterating over to
+ * the array of log records. Otherwise, the pointers would get
+ * free'd or reallocated by the iterator.
+ */
+ memset(&old_log, 0, sizeof(old_log));
+ }
+
+ ret = reftable_writer_add_logs(writer, logs, logs_nr);
+ if (ret < 0)
+ goto done;
+
+done:
+ assert(ret != REFTABLE_API_ERROR);
+ reftable_iterator_destroy(&it);
+ string_list_clear(&skip, 0);
+ strbuf_release(&errbuf);
+ for (i = 0; i < logs_nr; i++) {
+ if (!strcmp(logs[i].refname, "HEAD"))
+ continue;
+ logs[i].refname = NULL;
+ reftable_log_record_release(&logs[i]);
+ }
+ free(logs);
+ reftable_ref_record_release(&old_ref);
+ reftable_log_record_release(&old_log);
+ return ret;
+}
+
+static int reftable_be_rename_ref(struct ref_store *ref_store,
+ const char *oldrefname,
+ const char *newrefname,
+ const char *logmsg)
+{
+ 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,
+ .delete_old = 1,
+ };
+ int ret;
+
+ ret = refs->err;
+ if (ret < 0)
+ goto done;
+
+ ret = reftable_stack_reload(stack);
+ if (ret)
+ goto done;
+ ret = reftable_stack_add(stack, &write_copy_table, &arg);
+
+done:
+ assert(ret != REFTABLE_API_ERROR);
+ return ret;
+}
+
+static int reftable_be_copy_ref(struct ref_store *ref_store,
+ const char *oldrefname,
+ const char *newrefname,
+ const char *logmsg)
+{
+ 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,
+ };
+ int ret;
+
+ ret = refs->err;
+ if (ret < 0)
+ goto done;
+
+ ret = reftable_stack_reload(stack);
+ if (ret)
+ goto done;
+ ret = reftable_stack_add(stack, &write_copy_table, &arg);
+
+done:
+ assert(ret != REFTABLE_API_ERROR);
+ return ret;
+}
+
+struct reftable_reflog_iterator {
+ struct ref_iterator base;
+ struct reftable_ref_store *refs;
+ struct reftable_iterator iter;
+ struct reftable_log_record log;
+ struct strbuf last_name;
+ int err;
+};
+
+static int reftable_reflog_iterator_advance(struct ref_iterator *ref_iterator)
+{
+ struct reftable_reflog_iterator *iter =
+ (struct reftable_reflog_iterator *)ref_iterator;
+
+ while (!iter->err) {
+ iter->err = reftable_iterator_next_log(&iter->iter, &iter->log);
+ if (iter->err)
+ break;
+
+ /*
+ * We want the refnames that we have reflogs for, so we skip if
+ * we've already produced this name. This could be faster by
+ * seeking directly to reflog@update_index==0.
+ */
+ if (!strcmp(iter->log.refname, iter->last_name.buf))
+ continue;
+
+ if (check_refname_format(iter->log.refname,
+ REFNAME_ALLOW_ONELEVEL))
+ continue;
+
+ strbuf_reset(&iter->last_name);
+ strbuf_addstr(&iter->last_name, iter->log.refname);
+ iter->base.refname = iter->log.refname;
+
+ break;
+ }
+
+ if (iter->err > 0) {
+ if (ref_iterator_abort(ref_iterator) != ITER_DONE)
+ return ITER_ERROR;
+ return ITER_DONE;
+ }
+
+ if (iter->err < 0) {
+ ref_iterator_abort(ref_iterator);
+ return ITER_ERROR;
+ }
+
+ return ITER_OK;
+}
+
+static int reftable_reflog_iterator_peel(struct ref_iterator *ref_iterator,
+ struct object_id *peeled)
+{
+ BUG("reftable reflog iterator cannot be peeled");
+ return -1;
+}
+
+static int reftable_reflog_iterator_abort(struct ref_iterator *ref_iterator)
+{
+ struct reftable_reflog_iterator *iter =
+ (struct reftable_reflog_iterator *)ref_iterator;
+ reftable_log_record_release(&iter->log);
+ reftable_iterator_destroy(&iter->iter);
+ strbuf_release(&iter->last_name);
+ free(iter);
+ return ITER_DONE;
+}
+
+static struct ref_iterator_vtable reftable_reflog_iterator_vtable = {
+ .advance = reftable_reflog_iterator_advance,
+ .peel = reftable_reflog_iterator_peel,
+ .abort = reftable_reflog_iterator_abort
+};
+
+static struct reftable_reflog_iterator *reflog_iterator_for_stack(struct reftable_ref_store *refs,
+ struct reftable_stack *stack)
+{
+ struct reftable_merged_table *merged_table;
+ struct reftable_reflog_iterator *iter;
+ int ret;
+
+ iter = xcalloc(1, sizeof(*iter));
+ base_ref_iterator_init(&iter->base, &reftable_reflog_iterator_vtable);
+ strbuf_init(&iter->last_name, 0);
+ iter->refs = refs;
+
+ ret = refs->err;
+ if (ret)
+ goto done;
+
+ ret = reftable_stack_reload(stack);
+ if (ret < 0)
+ goto done;
+
+ merged_table = reftable_stack_merged_table(stack);
+
+ ret = reftable_merged_table_seek_log(merged_table, &iter->iter, "");
+ if (ret < 0)
+ goto done;
+
+done:
+ iter->err = ret;
+ return iter;
+}
+
+static struct ref_iterator *reftable_be_reflog_iterator_begin(struct ref_store *ref_store)
+{
+ struct reftable_ref_store *refs =
+ 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)
+ return &main_iter->base;
+
+ worktree_iter = reflog_iterator_for_stack(refs, refs->worktree_stack);
+
+ return merge_ref_iterator_begin(&worktree_iter->base, &main_iter->base,
+ ref_iterator_select, NULL);
+}
+
+static int yield_log_record(struct reftable_log_record *log,
+ each_reflog_ent_fn fn,
+ void *cb_data)
+{
+ struct object_id old_oid, new_oid;
+ const char *full_committer;
+
+ oidread(&old_oid, log->value.update.old_hash);
+ oidread(&new_oid, log->value.update.new_hash);
+
+ /*
+ * When both the old object ID and the new object ID are null
+ * then this is the reflog existence marker. The caller must
+ * not be aware of it.
+ */
+ if (is_null_oid(&old_oid) && is_null_oid(&new_oid))
+ return 0;
+
+ full_committer = fmt_ident(log->value.update.name, log->value.update.email,
+ WANT_COMMITTER_IDENT, NULL, IDENT_NO_DATE);
+ return fn(&old_oid, &new_oid, full_committer,
+ log->value.update.time, log->value.update.tz_offset,
+ log->value.update.message, cb_data);
+}
+
+static int reftable_be_for_each_reflog_ent_reverse(struct ref_store *ref_store,
+ const char *refname,
+ each_reflog_ent_fn fn,
+ void *cb_data)
+{
+ 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_merged_table *mt = NULL;
+ struct reftable_log_record log = {0};
+ struct reftable_iterator it = {0};
+ int ret;
+
+ if (refs->err < 0)
+ return refs->err;
+
+ mt = reftable_stack_merged_table(stack);
+ ret = reftable_merged_table_seek_log(mt, &it, refname);
+ while (!ret) {
+ ret = reftable_iterator_next_log(&it, &log);
+ if (ret < 0)
+ break;
+ if (ret > 0 || strcmp(log.refname, refname)) {
+ ret = 0;
+ break;
+ }
+
+ ret = yield_log_record(&log, fn, cb_data);
+ if (ret)
+ break;
+ }
+
+ reftable_log_record_release(&log);
+ reftable_iterator_destroy(&it);
+ return ret;
+}
+
+static int reftable_be_for_each_reflog_ent(struct ref_store *ref_store,
+ const char *refname,
+ each_reflog_ent_fn fn,
+ void *cb_data)
+{
+ 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_merged_table *mt = NULL;
+ struct reftable_log_record *logs = NULL;
+ struct reftable_iterator it = {0};
+ size_t logs_alloc = 0, logs_nr = 0, i;
+ int ret;
+
+ if (refs->err < 0)
+ return refs->err;
+
+ mt = reftable_stack_merged_table(stack);
+ ret = reftable_merged_table_seek_log(mt, &it, refname);
+ while (!ret) {
+ struct reftable_log_record log = {0};
+
+ ret = reftable_iterator_next_log(&it, &log);
+ if (ret < 0)
+ goto done;
+ if (ret > 0 || strcmp(log.refname, refname)) {
+ reftable_log_record_release(&log);
+ ret = 0;
+ break;
+ }
+
+ ALLOC_GROW(logs, logs_nr + 1, logs_alloc);
+ logs[logs_nr++] = log;
+ }
+
+ for (i = logs_nr; i--;) {
+ ret = yield_log_record(&logs[i], fn, cb_data);
+ if (ret)
+ goto done;
+ }
+
+done:
+ reftable_iterator_destroy(&it);
+ for (i = 0; i < logs_nr; i++)
+ reftable_log_record_release(&logs[i]);
+ free(logs);
+ return ret;
+}
+
+static int reftable_be_reflog_exists(struct ref_store *ref_store,
+ const char *refname)
+{
+ 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_merged_table *mt = reftable_stack_merged_table(stack);
+ struct reftable_log_record log = {0};
+ struct reftable_iterator it = {0};
+ int ret;
+
+ ret = refs->err;
+ if (ret < 0)
+ goto done;
+
+ ret = reftable_stack_reload(stack);
+ if (ret < 0)
+ goto done;
+
+ ret = reftable_merged_table_seek_log(mt, &it, refname);
+ if (ret < 0)
+ goto done;
+
+ /*
+ * Check whether we get at least one log record for the given ref name.
+ * If so, the reflog exists, otherwise it doesn't.
+ */
+ ret = reftable_iterator_next_log(&it, &log);
+ if (ret < 0)
+ goto done;
+ if (ret > 0) {
+ ret = 0;
+ goto done;
+ }
+
+ ret = strcmp(log.refname, refname) == 0;
+
+done:
+ reftable_iterator_destroy(&it);
+ reftable_log_record_release(&log);
+ if (ret < 0)
+ ret = 0;
+ return ret;
+}
+
+struct write_reflog_existence_arg {
+ struct reftable_ref_store *refs;
+ const char *refname;
+ struct reftable_stack *stack;
+};
+
+static int write_reflog_existence_table(struct reftable_writer *writer,
+ void *cb_data)
+{
+ struct write_reflog_existence_arg *arg = cb_data;
+ uint64_t ts = reftable_stack_next_update_index(arg->stack);
+ struct reftable_log_record log = {0};
+ int ret;
+
+ ret = reftable_stack_read_log(arg->stack, arg->refname, &log);
+ if (ret <= 0)
+ goto done;
+
+ reftable_writer_set_limits(writer, ts, ts);
+
+ /*
+ * The existence entry has both old and new object ID set to the the
+ * null object ID. Our iterators are aware of this and will not present
+ * them to their callers.
+ */
+ log.refname = xstrdup(arg->refname);
+ log.update_index = ts;
+ log.value_type = REFTABLE_LOG_UPDATE;
+ ret = reftable_writer_add_log(writer, &log);
+
+done:
+ assert(ret != REFTABLE_API_ERROR);
+ reftable_log_record_release(&log);
+ return ret;
+}
+
+static int reftable_be_create_reflog(struct ref_store *ref_store,
+ const char *refname,
+ struct strbuf *errmsg)
+{
+ 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 write_reflog_existence_arg arg = {
+ .refs = refs,
+ .stack = stack,
+ .refname = refname,
+ };
+ int ret;
+
+ ret = refs->err;
+ if (ret < 0)
+ goto done;
+
+ ret = reftable_stack_reload(stack);
+ if (ret)
+ goto done;
+
+ ret = reftable_stack_add(stack, &write_reflog_existence_table, &arg);
+
+done:
+ return ret;
+}
+
+struct write_reflog_delete_arg {
+ struct reftable_stack *stack;
+ const char *refname;
+};
+
+static int write_reflog_delete_table(struct reftable_writer *writer, void *cb_data)
+{
+ struct write_reflog_delete_arg *arg = cb_data;
+ struct reftable_merged_table *mt =
+ reftable_stack_merged_table(arg->stack);
+ struct reftable_log_record log = {0}, tombstone = {0};
+ struct reftable_iterator it = {0};
+ uint64_t ts = reftable_stack_next_update_index(arg->stack);
+ int ret;
+
+ reftable_writer_set_limits(writer, ts, ts);
+
+ /*
+ * In order to delete a table we need to delete all reflog entries one
+ * by one. This is inefficient, but the reftable format does not have a
+ * better marker right now.
+ */
+ ret = reftable_merged_table_seek_log(mt, &it, arg->refname);
+ while (ret == 0) {
+ ret = reftable_iterator_next_log(&it, &log);
+ if (ret < 0)
+ break;
+ if (ret > 0 || strcmp(log.refname, arg->refname)) {
+ ret = 0;
+ break;
+ }
+
+ tombstone.refname = (char *)arg->refname;
+ tombstone.value_type = REFTABLE_LOG_DELETION;
+ tombstone.update_index = log.update_index;
+
+ ret = reftable_writer_add_log(writer, &tombstone);
+ }
+
+ reftable_log_record_release(&log);
+ reftable_iterator_destroy(&it);
+ return ret;
+}
+
+static int reftable_be_delete_reflog(struct ref_store *ref_store,
+ const char *refname)
+{
+ 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 write_reflog_delete_arg arg = {
+ .stack = stack,
+ .refname = refname,
+ };
+ int ret;
+
+ ret = reftable_stack_reload(stack);
+ if (ret)
+ return ret;
+ ret = reftable_stack_add(stack, &write_reflog_delete_table, &arg);
+
+ assert(ret != REFTABLE_API_ERROR);
+ return ret;
+}
+
+struct reflog_expiry_arg {
+ struct reftable_stack *stack;
+ struct reftable_log_record *records;
+ struct object_id update_oid;
+ const char *refname;
+ size_t len;
+};
+
+static int write_reflog_expiry_table(struct reftable_writer *writer, void *cb_data)
+{
+ struct reflog_expiry_arg *arg = cb_data;
+ uint64_t ts = reftable_stack_next_update_index(arg->stack);
+ uint64_t live_records = 0;
+ size_t i;
+ int ret;
+
+ for (i = 0; i < arg->len; i++)
+ if (arg->records[i].value_type == REFTABLE_LOG_UPDATE)
+ live_records++;
+
+ reftable_writer_set_limits(writer, ts, ts);
+
+ if (!is_null_oid(&arg->update_oid)) {
+ struct reftable_ref_record ref = {0};
+ struct object_id peeled;
+
+ ref.refname = (char *)arg->refname;
+ ref.update_index = ts;
+
+ if (!peel_object(&arg->update_oid, &peeled)) {
+ ref.value_type = REFTABLE_REF_VAL2;
+ memcpy(ref.value.val2.target_value, peeled.hash, GIT_MAX_RAWSZ);
+ memcpy(ref.value.val2.value, arg->update_oid.hash, GIT_MAX_RAWSZ);
+ } else {
+ ref.value_type = REFTABLE_REF_VAL1;
+ memcpy(ref.value.val1, arg->update_oid.hash, GIT_MAX_RAWSZ);
+ }
+
+ ret = reftable_writer_add_ref(writer, &ref);
+ if (ret < 0)
+ return ret;
+ }
+
+ /*
+ * When there are no more entries left in the reflog we empty it
+ * completely, but write a placeholder reflog entry that indicates that
+ * the reflog still exists.
+ */
+ if (!live_records) {
+ struct reftable_log_record log = {
+ .refname = (char *)arg->refname,
+ .value_type = REFTABLE_LOG_UPDATE,
+ .update_index = ts,
+ };
+
+ ret = reftable_writer_add_log(writer, &log);
+ if (ret)
+ return ret;
+ }
+
+ for (i = 0; i < arg->len; i++) {
+ ret = reftable_writer_add_log(writer, &arg->records[i]);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
+}
+
+static int reftable_be_reflog_expire(struct ref_store *ref_store,
+ const char *refname,
+ unsigned int flags,
+ reflog_expiry_prepare_fn prepare_fn,
+ reflog_expiry_should_prune_fn should_prune_fn,
+ reflog_expiry_cleanup_fn cleanup_fn,
+ void *policy_cb_data)
+{
+ /*
+ * For log expiry, we write tombstones for every single reflog entry
+ * that is to be expired. This means that the entries are still
+ * retrievable by delving into the stack, and expiring entries
+ * paradoxically takes extra memory. This memory is only reclaimed when
+ * compacting the reftable stack.
+ *
+ * It would be better if the refs backend supported an API that sets a
+ * criterion for all refs, passing the criterion to pack_refs().
+ *
+ * On the plus side, because we do the expiration per ref, we can easily
+ * insert the reflog existence dummies.
+ */
+ 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_merged_table *mt = reftable_stack_merged_table(stack);
+ 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 object_id oid = {0};
+ uint8_t *last_hash = NULL;
+ size_t logs_nr = 0, logs_alloc = 0, i;
+ int ret;
+
+ if (refs->err < 0)
+ return refs->err;
+
+ ret = reftable_stack_reload(stack);
+ if (ret < 0)
+ goto done;
+
+ ret = reftable_merged_table_seek_log(mt, &it, refname);
+ if (ret < 0)
+ goto done;
+
+ ret = reftable_stack_new_addition(&add, stack);
+ if (ret < 0)
+ goto done;
+
+ ret = reftable_stack_read_ref(stack, refname, &ref_record);
+ if (ret < 0)
+ goto done;
+ if (reftable_ref_record_val1(&ref_record))
+ oidread(&oid, reftable_ref_record_val1(&ref_record));
+ prepare_fn(refname, &oid, policy_cb_data);
+
+ while (1) {
+ struct reftable_log_record log = {0};
+ struct object_id old_oid, new_oid;
+
+ ret = reftable_iterator_next_log(&it, &log);
+ if (ret < 0)
+ goto done;
+ if (ret > 0 || strcmp(log.refname, refname)) {
+ reftable_log_record_release(&log);
+ break;
+ }
+
+ oidread(&old_oid, log.value.update.old_hash);
+ oidread(&new_oid, log.value.update.new_hash);
+
+ /*
+ * Skip over the reflog existence marker. We will add it back
+ * in when there are no live reflog records.
+ */
+ if (is_null_oid(&old_oid) && is_null_oid(&new_oid)) {
+ reftable_log_record_release(&log);
+ continue;
+ }
+
+ ALLOC_GROW(logs, logs_nr + 1, logs_alloc);
+ logs[logs_nr++] = log;
+ }
+
+ /*
+ * We need to rewrite all reflog entries according to the pruning
+ * callback function:
+ *
+ * - If a reflog entry shall be pruned we mark the record for
+ * deletion.
+ *
+ * - Otherwise we may have to rewrite the chain of reflog entries so
+ * that gaps created by just-deleted records get backfilled.
+ */
+ CALLOC_ARRAY(rewritten, logs_nr);
+ for (i = logs_nr; i--;) {
+ struct reftable_log_record *dest = &rewritten[i];
+ struct object_id old_oid, new_oid;
+
+ *dest = logs[i];
+ oidread(&old_oid, logs[i].value.update.old_hash);
+ oidread(&new_oid, logs[i].value.update.new_hash);
+
+ if (should_prune_fn(&old_oid, &new_oid, logs[i].value.update.email,
+ (timestamp_t)logs[i].value.update.time,
+ logs[i].value.update.tz_offset,
+ logs[i].value.update.message,
+ policy_cb_data)) {
+ dest->value_type = REFTABLE_LOG_DELETION;
+ } else {
+ if ((flags & EXPIRE_REFLOGS_REWRITE) && last_hash)
+ memcpy(dest->value.update.old_hash, last_hash, GIT_MAX_RAWSZ);
+ last_hash = logs[i].value.update.new_hash;
+ }
+ }
+
+ if (flags & EXPIRE_REFLOGS_UPDATE_REF && last_hash &&
+ reftable_ref_record_val1(&ref_record))
+ oidread(&arg.update_oid, last_hash);
+
+ arg.records = rewritten;
+ arg.len = logs_nr;
+ arg.stack = stack,
+ arg.refname = refname,
+
+ ret = reftable_addition_add(add, &write_reflog_expiry_table, &arg);
+ if (ret < 0)
+ goto done;
+
+ /*
+ * Future improvement: we could skip writing records that were
+ * not changed.
+ */
+ if (!(flags & EXPIRE_REFLOGS_DRY_RUN))
+ ret = reftable_addition_commit(add);
+
+done:
+ if (add)
+ 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]);
+ free(logs);
+ free(rewritten);
+ return ret;
+}
+
+struct ref_storage_be refs_be_reftable = {
+ .name = "reftable",
+ .init = reftable_be_init,
+ .init_db = reftable_be_init_db,
+ .transaction_prepare = reftable_be_transaction_prepare,
+ .transaction_finish = reftable_be_transaction_finish,
+ .transaction_abort = reftable_be_transaction_abort,
+ .initial_transaction_commit = reftable_be_initial_transaction_commit,
+
+ .pack_refs = reftable_be_pack_refs,
+ .create_symref = reftable_be_create_symref,
+ .rename_ref = reftable_be_rename_ref,
+ .copy_ref = reftable_be_copy_ref,
+
+ .iterator_begin = reftable_be_iterator_begin,
+ .read_raw_ref = reftable_be_read_raw_ref,
+ .read_symbolic_ref = reftable_be_read_symbolic_ref,
+
+ .reflog_iterator_begin = reftable_be_reflog_iterator_begin,
+ .for_each_reflog_ent = reftable_be_for_each_reflog_ent,
+ .for_each_reflog_ent_reverse = reftable_be_for_each_reflog_ent_reverse,
+ .reflog_exists = reftable_be_reflog_exists,
+ .create_reflog = reftable_be_create_reflog,
+ .delete_reflog = reftable_be_delete_reflog,
+ .reflog_expire = reftable_be_reflog_expire,
+};
diff --git a/refspec.c b/refspec.c
index 63e3112..d60932f 100644
--- a/refspec.c
+++ b/refspec.c
@@ -1,7 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "gettext.h"
+#include "hash.h"
+#include "hex.h"
#include "strvec.h"
#include "refs.h"
#include "refspec.h"
+#include "strbuf.h"
static struct refspec_item s_tag_refspec = {
.force = 0,
diff --git a/refspec.h b/refspec.h
index 8b79891..8c0c446 100644
--- a/refspec.h
+++ b/refspec.h
@@ -69,7 +69,7 @@ int valid_remote_name(const char *name);
struct strvec;
/*
* Determine what <prefix> values to pass to the peer in ref-prefix lines
- * (see Documentation/technical/protocol-v2.txt).
+ * (see linkgit:gitprotocol-v2[5]).
*/
void refspec_ref_prefixes(const struct refspec *rs,
struct strvec *ref_prefixes);
diff --git a/reftable/basics.c b/reftable/basics.c
index f761e48..fea711d 100644
--- a/reftable/basics.c
+++ b/reftable/basics.c
@@ -27,7 +27,7 @@ void put_be16(uint8_t *out, uint16_t i)
out[1] = (uint8_t)(i & 0xff);
}
-int binsearch(size_t sz, int (*f)(size_t k, void *args), void *args)
+size_t binsearch(size_t sz, int (*f)(size_t k, void *args), void *args)
{
size_t lo = 0;
size_t hi = sz;
@@ -39,8 +39,11 @@ int binsearch(size_t sz, int (*f)(size_t k, void *args), void *args)
*/
while (hi - lo > 1) {
size_t mid = lo + (hi - lo) / 2;
+ int ret = f(mid, args);
+ if (ret < 0)
+ return sz;
- if (f(mid, args))
+ if (ret > 0)
hi = mid;
else
lo = mid;
@@ -64,12 +67,11 @@ void free_names(char **a)
reftable_free(a);
}
-int names_length(char **names)
+size_t names_length(char **names)
{
char **p = names;
- for (; *p; p++) {
- /* empty */
- }
+ while (*p)
+ p++;
return p - names;
}
@@ -89,17 +91,13 @@ void parse_names(char *buf, int size, char ***namesp)
next = end;
}
if (p < next) {
- if (names_len == names_cap) {
- names_cap = 2 * names_cap + 1;
- names = reftable_realloc(
- names, names_cap * sizeof(*names));
- }
+ REFTABLE_ALLOC_GROW(names, names_len + 1, names_cap);
names[names_len++] = xstrdup(p);
}
p = next + 1;
}
- names = reftable_realloc(names, (names_len + 1) * sizeof(*names));
+ REFTABLE_REALLOC_ARRAY(names, names_len + 1);
names[names_len] = NULL;
*namesp = names;
}
diff --git a/reftable/basics.h b/reftable/basics.h
index 096b368..523ecd5 100644
--- a/reftable/basics.h
+++ b/reftable/basics.h
@@ -22,13 +22,14 @@ uint32_t get_be24(uint8_t *in);
void put_be16(uint8_t *out, uint16_t i);
/*
- * find smallest index i in [0, sz) at which f(i) is true, assuming
- * that f is ascending. Return sz if f(i) is false for all indices.
+ * find smallest index i in [0, sz) at which `f(i) > 0`, assuming that f is
+ * ascending. Return sz if `f(i) == 0` for all indices. The search is aborted
+ * and `sz` is returned in case `f(i) < 0`.
*
* Contrary to bsearch(3), this returns something useful if the argument is not
* found.
*/
-int binsearch(size_t sz, int (*f)(size_t k, void *args), void *args);
+size_t binsearch(size_t sz, int (*f)(size_t k, void *args), void *args);
/*
* Frees a NULL terminated array of malloced strings. The array itself is also
@@ -44,14 +45,27 @@ void parse_names(char *buf, int size, char ***namesp);
int names_equal(char **a, char **b);
/* returns the array size of a NULL-terminated array of strings. */
-int names_length(char **names);
+size_t names_length(char **names);
/* Allocation routines; they invoke the functions set through
* reftable_set_alloc() */
void *reftable_malloc(size_t sz);
void *reftable_realloc(void *p, size_t sz);
void reftable_free(void *p);
-void *reftable_calloc(size_t sz);
+void *reftable_calloc(size_t nelem, size_t elsize);
+
+#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)
/* Find the longest shared prefix size of `a` and `b` */
struct strbuf;
diff --git a/reftable/basics_test.c b/reftable/basics_test.c
index 1fcd229..997c4d9 100644
--- a/reftable/basics_test.c
+++ b/reftable/basics_test.c
@@ -12,40 +12,47 @@ https://developers.google.com/open-source/licenses/bsd
#include "test_framework.h"
#include "reftable-tests.h"
-struct binsearch_args {
- int key;
- int *arr;
+struct integer_needle_lesseq_args {
+ int needle;
+ int *haystack;
};
-static int binsearch_func(size_t i, void *void_args)
+static int integer_needle_lesseq(size_t i, void *_args)
{
- struct binsearch_args *args = void_args;
-
- return args->key < args->arr[i];
+ struct integer_needle_lesseq_args *args = _args;
+ return args->needle <= args->haystack[i];
}
static void test_binsearch(void)
{
- int arr[] = { 2, 4, 6, 8, 10 };
- size_t sz = ARRAY_SIZE(arr);
- struct binsearch_args args = {
- .arr = arr,
+ int haystack[] = { 2, 4, 6, 8, 10 };
+ struct {
+ int needle;
+ size_t expected_idx;
+ } testcases[] = {
+ {-9000, 0},
+ {-1, 0},
+ {0, 0},
+ {2, 0},
+ {3, 1},
+ {4, 1},
+ {7, 3},
+ {9, 4},
+ {10, 4},
+ {11, 5},
+ {9000, 5},
};
+ size_t i = 0;
- int i = 0;
- for (i = 1; i < 11; i++) {
- int res;
- args.key = i;
- res = binsearch(sz, &binsearch_func, &args);
+ for (i = 0; i < ARRAY_SIZE(testcases); i++) {
+ struct integer_needle_lesseq_args args = {
+ .haystack = haystack,
+ .needle = testcases[i].needle,
+ };
+ size_t idx;
- if (res < sz) {
- EXPECT(args.key < arr[res]);
- if (res > 0) {
- EXPECT(args.key >= arr[res - 1]);
- }
- } else {
- EXPECT(args.key == 10 || args.key == 11);
- }
+ idx = binsearch(ARRAY_SIZE(haystack), &integer_needle_lesseq, &args);
+ EXPECT(idx == testcases[i].expected_idx);
}
}
diff --git a/reftable/block.c b/reftable/block.c
index 34d4d07..298e8c5 100644
--- a/reftable/block.c
+++ b/reftable/block.c
@@ -51,12 +51,7 @@ static int block_writer_register_restart(struct block_writer *w, int n,
if (2 + 3 * rlen + n > w->block_size - w->next)
return -1;
if (is_restart) {
- if (w->restart_len == w->restart_cap) {
- w->restart_cap = w->restart_cap * 2 + 1;
- w->restarts = reftable_realloc(
- w->restarts, sizeof(uint32_t) * w->restart_cap);
- }
-
+ REFTABLE_ALLOC_GROW(w->restarts, w->restart_len + 1, w->restart_cap);
w->restarts[w->restart_len++] = w->next;
}
@@ -148,8 +143,10 @@ int block_writer_finish(struct block_writer *w)
int block_header_skip = 4 + w->header_off;
uLongf src_len = w->next - block_header_skip;
uLongf dest_cap = src_len * 1.001 + 12;
+ uint8_t *compressed;
+
+ REFTABLE_ALLOC_ARRAY(compressed, dest_cap);
- uint8_t *compressed = reftable_malloc(dest_cap);
while (1) {
uLongf out_dest_len = dest_cap;
int zresult = compress2(compressed, &out_dest_len,
@@ -206,9 +203,9 @@ int block_reader_init(struct block_reader *br, struct reftable_block *block,
uLongf dst_len = sz - block_header_skip; /* total size of dest
buffer. */
uLongf src_len = block->len - block_header_skip;
- /* Log blocks specify the *uncompressed* size in their header.
- */
- uncompressed = reftable_malloc(sz);
+
+ /* Log blocks specify the *uncompressed* size in their header. */
+ REFTABLE_ALLOC_ARRAY(uncompressed, sz);
/* Copy over the block header verbatim. It's not compressed. */
memcpy(uncompressed, block->data, block_header_skip);
@@ -276,36 +273,46 @@ void block_reader_start(struct block_reader *br, struct block_iter *it)
it->next_off = br->header_off + 4;
}
-struct restart_find_args {
+struct restart_needle_less_args {
int error;
- struct strbuf key;
- struct block_reader *r;
+ struct strbuf needle;
+ struct block_reader *reader;
};
-static int restart_key_less(size_t idx, void *args)
+static int restart_needle_less(size_t idx, void *_args)
{
- struct restart_find_args *a = args;
- uint32_t off = block_reader_restart_offset(a->r, idx);
+ struct restart_needle_less_args *args = _args;
+ uint32_t off = block_reader_restart_offset(args->reader, idx);
struct string_view in = {
- .buf = a->r->block.data + off,
- .len = a->r->block_len - off,
+ .buf = args->reader->block.data + off,
+ .len = args->reader->block_len - off,
};
+ uint64_t prefix_len, suffix_len;
+ uint8_t extra;
+ int n;
+
+ /*
+ * Records at restart points are stored without prefix compression, so
+ * there is no need to fully decode the record key here. This removes
+ * the need for allocating memory.
+ */
+ n = reftable_decode_keylen(in, &prefix_len, &suffix_len, &extra);
+ if (n < 0 || prefix_len) {
+ args->error = 1;
+ return -1;
+ }
- /* the restart key is verbatim in the block, so this could avoid the
- alloc for decoding the key */
- struct strbuf rkey = STRBUF_INIT;
- struct strbuf last_key = STRBUF_INIT;
- uint8_t unused_extra;
- int n = reftable_decode_key(&rkey, &unused_extra, last_key, in);
- int result;
- if (n < 0) {
- a->error = 1;
+ string_view_consume(&in, n);
+ if (suffix_len > in.len) {
+ args->error = 1;
return -1;
}
- result = strbuf_cmp(&a->key, &rkey);
- strbuf_release(&rkey);
- return result;
+ n = memcmp(args->needle.buf, in.buf,
+ args->needle.len < suffix_len ? args->needle.len : suffix_len);
+ if (n)
+ return n < 0;
+ return args->needle.len < suffix_len;
}
void block_iter_copy_from(struct block_iter *dest, struct block_iter *src)
@@ -323,44 +330,41 @@ int block_iter_next(struct block_iter *it, struct reftable_record *rec)
.len = it->br->block_len - it->next_off,
};
struct string_view start = in;
- struct strbuf key = STRBUF_INIT;
uint8_t extra = 0;
int n = 0;
if (it->next_off >= it->br->block_len)
return 1;
- n = reftable_decode_key(&key, &extra, it->last_key, in);
+ n = reftable_decode_key(&it->last_key, &extra, in);
if (n < 0)
return -1;
-
- if (!key.len)
+ if (!it->last_key.len)
return REFTABLE_FORMAT_ERROR;
string_view_consume(&in, n);
- n = reftable_record_decode(rec, key, extra, in, it->br->hash_size);
+ n = reftable_record_decode(rec, it->last_key, extra, in, it->br->hash_size,
+ &it->scratch);
if (n < 0)
return -1;
string_view_consume(&in, n);
- strbuf_reset(&it->last_key);
- strbuf_addbuf(&it->last_key, &key);
it->next_off += start.len - in.len;
- strbuf_release(&key);
return 0;
}
int block_reader_first_key(struct block_reader *br, struct strbuf *key)
{
- struct strbuf empty = STRBUF_INIT;
- int off = br->header_off + 4;
+ int off = br->header_off + 4, n;
struct string_view in = {
.buf = br->block.data + off,
.len = br->block_len - off,
};
-
uint8_t extra = 0;
- int n = reftable_decode_key(key, &extra, empty, in);
+
+ strbuf_reset(key);
+
+ n = reftable_decode_key(key, &extra, in);
if (n < 0)
return n;
if (!key->len)
@@ -377,57 +381,98 @@ int block_iter_seek(struct block_iter *it, struct strbuf *want)
void block_iter_close(struct block_iter *it)
{
strbuf_release(&it->last_key);
+ strbuf_release(&it->scratch);
}
int block_reader_seek(struct block_reader *br, struct block_iter *it,
struct strbuf *want)
{
- struct restart_find_args args = {
- .key = *want,
- .r = br,
+ struct restart_needle_less_args args = {
+ .needle = *want,
+ .reader = br,
};
- struct reftable_record rec = reftable_new_record(block_reader_type(br));
- struct strbuf key = STRBUF_INIT;
+ struct block_iter next = BLOCK_ITER_INIT;
+ struct reftable_record rec;
int err = 0;
- struct block_iter next = {
- .last_key = STRBUF_INIT,
- };
-
- int i = binsearch(br->restart_count, &restart_key_less, &args);
+ size_t i;
+
+ /*
+ * Perform a binary search over the block's restart points, which
+ * avoids doing a linear scan over the whole block. Like this, we
+ * identify the section of the block that should contain our key.
+ *
+ * Note that we explicitly search for the first restart point _greater_
+ * than the sought-after record, not _greater or equal_ to it. In case
+ * the sought-after record is located directly at the restart point we
+ * would otherwise start doing the linear search at the preceding
+ * restart point. While that works alright, we would end up scanning
+ * too many record.
+ */
+ i = binsearch(br->restart_count, &restart_needle_less, &args);
if (args.error) {
err = REFTABLE_FORMAT_ERROR;
goto done;
}
- it->br = br;
- if (i > 0) {
- i--;
- it->next_off = block_reader_restart_offset(br, i);
- } else {
+ /*
+ * Now there are multiple cases:
+ *
+ * - `i == 0`: The wanted record is smaller than the record found at
+ * the first restart point. As the first restart point is the first
+ * record in the block, our wanted record cannot be located in this
+ * block at all. We still need to position the iterator so that the
+ * next call to `block_iter_next()` will yield an end-of-iterator
+ * signal.
+ *
+ * - `i == restart_count`: The wanted record was not found at any of
+ * the restart points. As there is no restart point at the end of
+ * the section the record may thus be contained in the last block.
+ *
+ * - `i > 0`: The wanted record must be contained in the section
+ * before the found restart point. We thus do a linear search
+ * starting from the preceding restart point.
+ */
+ if (i > 0)
+ it->next_off = block_reader_restart_offset(br, i - 1);
+ else
it->next_off = br->header_off + 4;
- }
+ it->br = br;
+
+ reftable_record_init(&rec, block_reader_type(br));
- /* We're looking for the last entry less/equal than the wanted key, so
- we have to go one entry too far and then back up.
- */
+ /*
+ * We're looking for the last entry less than the wanted key so that
+ * the next call to `block_reader_next()` would yield the wanted
+ * record. We thus don't want to position our reader at the sought
+ * after record, but one before. To do so, we have to go one entry too
+ * far and then back up.
+ */
while (1) {
block_iter_copy_from(&next, it);
err = block_iter_next(&next, &rec);
if (err < 0)
goto done;
-
- reftable_record_key(&rec, &key);
- if (err > 0 || strbuf_cmp(&key, want) >= 0) {
+ if (err > 0) {
err = 0;
goto done;
}
+ /*
+ * Check whether the current key is greater or equal to the
+ * sought-after key. In case it is greater we know that the
+ * record does not exist in the block and can thus abort early.
+ * In case it is equal to the sought-after key we have found
+ * the desired record.
+ */
+ reftable_record_key(&rec, &it->last_key);
+ if (strbuf_cmp(&it->last_key, want) >= 0)
+ goto done;
+
block_iter_copy_from(it, &next);
}
done:
- strbuf_release(&key);
- strbuf_release(&next.last_key);
+ block_iter_close(&next);
reftable_record_release(&rec);
return err;
diff --git a/reftable/block.h b/reftable/block.h
index 87c7753..47acc62 100644
--- a/reftable/block.h
+++ b/reftable/block.h
@@ -84,8 +84,14 @@ struct block_iter {
/* key for last entry we read. */
struct strbuf last_key;
+ struct strbuf scratch;
};
+#define BLOCK_ITER_INIT { \
+ .last_key = STRBUF_INIT, \
+ .scratch = STRBUF_INIT, \
+}
+
/* 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,
diff --git a/reftable/block_test.c b/reftable/block_test.c
index cb88af4..e162c6e 100644
--- a/reftable/block_test.c
+++ b/reftable/block_test.c
@@ -32,11 +32,11 @@ static void test_block_read_write(void)
int i = 0;
int n;
struct block_reader br = { 0 };
- struct block_iter it = { .last_key = STRBUF_INIT };
+ struct block_iter it = BLOCK_ITER_INIT;
int j = 0;
struct strbuf want = STRBUF_INIT;
- block.data = reftable_calloc(block_size);
+ REFTABLE_CALLOC_ARRAY(block.data, block_size);
block.len = block_size;
block.source = malloc_block_source();
block_writer_init(&bw, BLOCK_TYPE_REF, block.data, block_size,
@@ -49,13 +49,11 @@ static void test_block_read_write(void)
for (i = 0; i < N; i++) {
char name[100];
- uint8_t hash[GIT_SHA1_RAWSZ];
snprintf(name, sizeof(name), "branch%02d", i);
- memset(hash, i, sizeof(hash));
rec.u.ref.refname = name;
rec.u.ref.value_type = REFTABLE_REF_VAL1;
- rec.u.ref.value.val1 = hash;
+ memset(rec.u.ref.value.val1, i, GIT_SHA1_RAWSZ);
names[i] = xstrdup(name);
n = block_writer_add(&bw, &rec);
@@ -87,7 +85,7 @@ static void test_block_read_write(void)
block_iter_close(&it);
for (i = 0; i < N; i++) {
- struct block_iter it = { .last_key = STRBUF_INIT };
+ struct block_iter it = BLOCK_ITER_INIT;
strbuf_reset(&want);
strbuf_addstr(&want, names[i]);
diff --git a/reftable/blocksource.c b/reftable/blocksource.c
index 8331b34..eeed254 100644
--- a/reftable/blocksource.c
+++ b/reftable/blocksource.c
@@ -29,7 +29,7 @@ static int strbuf_read_block(void *v, struct reftable_block *dest, uint64_t off,
{
struct strbuf *b = v;
assert(off + size <= b->len);
- dest->data = reftable_calloc(size);
+ REFTABLE_CALLOC_ARRAY(dest->data, size);
memcpy(dest->data, b->buf + off, size);
dest->len = size;
return size;
@@ -76,8 +76,8 @@ struct reftable_block_source malloc_block_source(void)
}
struct file_block_source {
- int fd;
uint64_t size;
+ unsigned char *data;
};
static uint64_t file_size(void *b)
@@ -87,19 +87,12 @@ static uint64_t file_size(void *b)
static void file_return_block(void *b, struct reftable_block *dest)
{
- if (dest->len)
- memset(dest->data, 0xff, dest->len);
- reftable_free(dest->data);
}
-static void file_close(void *b)
+static void file_close(void *v)
{
- int fd = ((struct file_block_source *)b)->fd;
- if (fd > 0) {
- close(fd);
- ((struct file_block_source *)b)->fd = 0;
- }
-
+ struct file_block_source *b = v;
+ munmap(b->data, b->size);
reftable_free(b);
}
@@ -108,9 +101,7 @@ static int file_read_block(void *v, struct reftable_block *dest, uint64_t off,
{
struct file_block_source *b = v;
assert(off + size <= b->size);
- dest->data = reftable_malloc(size);
- if (pread(b->fd, dest->data, size, off) != size)
- return -1;
+ dest->data = b->data + off;
dest->len = size;
return size;
}
@@ -125,26 +116,26 @@ static struct reftable_block_source_vtable file_vtable = {
int reftable_block_source_from_file(struct reftable_block_source *bs,
const char *name)
{
- struct stat st = { 0 };
- int err = 0;
- int fd = open(name, O_RDONLY);
- struct file_block_source *p = NULL;
+ struct file_block_source *p;
+ struct stat st;
+ int fd;
+
+ fd = open(name, O_RDONLY);
if (fd < 0) {
- if (errno == ENOENT) {
+ if (errno == ENOENT)
return REFTABLE_NOT_EXIST_ERROR;
- }
return -1;
}
- err = fstat(fd, &st);
- if (err < 0) {
+ if (fstat(fd, &st) < 0) {
close(fd);
return REFTABLE_IO_ERROR;
}
- p = reftable_calloc(sizeof(struct file_block_source));
+ REFTABLE_CALLOC_ARRAY(p, 1);
p->size = st.st_size;
- p->fd = fd;
+ p->data = xmmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+ close(fd);
assert(!bs->ops);
bs->ops = &file_vtable;
diff --git a/reftable/dump.c b/reftable/dump.c
index 155953d..26e0393 100644
--- a/reftable/dump.c
+++ b/reftable/dump.c
@@ -7,18 +7,16 @@ https://developers.google.com/open-source/licenses/bsd
*/
#include "git-compat-util.h"
-#include "hash.h"
+#include "hash-ll.h"
#include "reftable-blocksource.h"
#include "reftable-error.h"
-#include "reftable-merged.h"
#include "reftable-record.h"
#include "reftable-tests.h"
#include "reftable-writer.h"
#include "reftable-iterator.h"
#include "reftable-reader.h"
#include "reftable-stack.h"
-#include "reftable-generic.h"
#include <stddef.h>
#include <stdio.h>
diff --git a/reftable/error.c b/reftable/error.c
index 93941f2..cfb7a0f 100644
--- a/reftable/error.c
+++ b/reftable/error.c
@@ -6,6 +6,7 @@ license that can be found in the LICENSE file or at
https://developers.google.com/open-source/licenses/bsd
*/
+#include "system.h"
#include "reftable-error.h"
#include <stdio.h>
@@ -21,7 +22,7 @@ const char *reftable_error_str(int err)
case REFTABLE_NOT_EXIST_ERROR:
return "file does not exist";
case REFTABLE_LOCK_ERROR:
- return "data is outdated";
+ return "data is locked";
case REFTABLE_API_ERROR:
return "misuse of the reftable API";
case REFTABLE_ZLIB_ERROR:
@@ -34,6 +35,8 @@ const char *reftable_error_str(int err)
return "invalid refname";
case REFTABLE_ENTRY_TOO_BIG_ERROR:
return "entry too large";
+ case REFTABLE_OUTDATED_ERROR:
+ return "data concurrently modified";
case -1:
return "general error";
default:
diff --git a/reftable/generic.c b/reftable/generic.c
index 57f8032..b9f1c7c 100644
--- a/reftable/generic.c
+++ b/reftable/generic.c
@@ -6,7 +6,6 @@ license that can be found in the LICENSE file or at
https://developers.google.com/open-source/licenses/bsd
*/
-#include "basics.h"
#include "constants.h"
#include "record.h"
#include "generic.h"
diff --git a/reftable/iter.c b/reftable/iter.c
index a8d174c..7aa30c4 100644
--- a/reftable/iter.c
+++ b/reftable/iter.c
@@ -16,11 +16,6 @@ https://developers.google.com/open-source/licenses/bsd
#include "reader.h"
#include "reftable-error.h"
-int iterator_is_null(struct reftable_iterator *it)
-{
- return !it->ops;
-}
-
static void filtering_ref_iterator_close(void *iter_arg)
{
struct filtering_ref_iterator *fri = iter_arg;
@@ -160,8 +155,7 @@ int new_indexed_table_ref_iter(struct indexed_table_ref_iter **dest,
int oid_len, uint64_t *offsets, int offset_len)
{
struct indexed_table_ref_iter empty = INDEXED_TABLE_REF_ITER_INIT;
- struct indexed_table_ref_iter *itr =
- reftable_calloc(sizeof(struct indexed_table_ref_iter));
+ struct indexed_table_ref_iter *itr = reftable_calloc(1, sizeof(*itr));
int err = 0;
*itr = empty;
diff --git a/reftable/iter.h b/reftable/iter.h
index 09eb0cb..537431b 100644
--- a/reftable/iter.h
+++ b/reftable/iter.h
@@ -16,10 +16,6 @@ https://developers.google.com/open-source/licenses/bsd
#include "reftable-iterator.h"
#include "reftable-generic.h"
-/* Returns true for a zeroed out iterator, such as the one returned from
- * iterator_destroy. */
-int iterator_is_null(struct reftable_iterator *it);
-
/* iterator that produces only ref records that point to `oid` */
struct filtering_ref_iterator {
int double_check;
@@ -53,10 +49,10 @@ struct indexed_table_ref_iter {
int is_finished;
};
-#define INDEXED_TABLE_REF_ITER_INIT \
- { \
- .cur = { .last_key = STRBUF_INIT }, .oid = STRBUF_INIT, \
- }
+#define INDEXED_TABLE_REF_ITER_INIT { \
+ .cur = BLOCK_ITER_INIT, \
+ .oid = STRBUF_INIT, \
+}
void iterator_from_indexed_table_ref_iter(struct reftable_iterator *it,
struct indexed_table_ref_iter *itr);
diff --git a/reftable/merged.c b/reftable/merged.c
index 2a6efa1..f85a24c 100644
--- a/reftable/merged.c
+++ b/reftable/merged.c
@@ -11,33 +11,45 @@ https://developers.google.com/open-source/licenses/bsd
#include "constants.h"
#include "iter.h"
#include "pq.h"
-#include "reader.h"
#include "record.h"
#include "generic.h"
#include "reftable-merged.h"
#include "reftable-error.h"
#include "system.h"
+struct merged_subiter {
+ struct reftable_iterator iter;
+ struct reftable_record rec;
+};
+
+struct merged_iter {
+ struct merged_subiter *subiters;
+ struct merged_iter_pqueue pq;
+ uint32_t hash_id;
+ size_t stack_len;
+ uint8_t typ;
+ int suppress_deletions;
+ ssize_t advance_index;
+};
+
static int merged_iter_init(struct merged_iter *mi)
{
- int i = 0;
- for (i = 0; i < mi->stack_len; i++) {
- struct reftable_record rec = reftable_new_record(mi->typ);
- int err = iterator_next(&mi->stack[i], &rec);
- if (err < 0) {
+ for (size_t i = 0; i < mi->stack_len; i++) {
+ struct pq_entry e = {
+ .index = i,
+ .rec = &mi->subiters[i].rec,
+ };
+ int err;
+
+ reftable_record_init(&mi->subiters[i].rec, mi->typ);
+ err = iterator_next(&mi->subiters[i].iter,
+ &mi->subiters[i].rec);
+ if (err < 0)
return err;
- }
+ if (err > 0)
+ continue;
- if (err > 0) {
- reftable_iterator_destroy(&mi->stack[i]);
- reftable_record_release(&rec);
- } else {
- struct pq_entry e = {
- .rec = rec,
- .index = i,
- };
- merged_iter_pqueue_add(&mi->pq, e);
- }
+ merged_iter_pqueue_add(&mi->pq, &e);
}
return 0;
@@ -46,56 +58,68 @@ static int merged_iter_init(struct merged_iter *mi)
static void merged_iter_close(void *p)
{
struct merged_iter *mi = p;
- int i = 0;
+
merged_iter_pqueue_release(&mi->pq);
- for (i = 0; i < mi->stack_len; i++) {
- reftable_iterator_destroy(&mi->stack[i]);
+ for (size_t i = 0; i < mi->stack_len; i++) {
+ reftable_iterator_destroy(&mi->subiters[i].iter);
+ reftable_record_release(&mi->subiters[i].rec);
}
- reftable_free(mi->stack);
+ reftable_free(mi->subiters);
}
-static int merged_iter_advance_nonnull_subiter(struct merged_iter *mi,
- size_t idx)
+static int merged_iter_advance_subiter(struct merged_iter *mi, size_t idx)
{
struct pq_entry e = {
- .rec = reftable_new_record(mi->typ),
.index = idx,
+ .rec = &mi->subiters[idx].rec,
};
- int err = iterator_next(&mi->stack[idx], &e.rec);
- if (err < 0)
- return err;
+ int err;
- if (err > 0) {
- reftable_iterator_destroy(&mi->stack[idx]);
- reftable_record_release(&e.rec);
- return 0;
- }
+ err = iterator_next(&mi->subiters[idx].iter, &mi->subiters[idx].rec);
+ if (err)
+ return err;
- merged_iter_pqueue_add(&mi->pq, e);
+ merged_iter_pqueue_add(&mi->pq, &e);
return 0;
}
-static int merged_iter_advance_subiter(struct merged_iter *mi, size_t idx)
-{
- if (iterator_is_null(&mi->stack[idx]))
- return 0;
- return merged_iter_advance_nonnull_subiter(mi, idx);
-}
-
static int merged_iter_next_entry(struct merged_iter *mi,
struct reftable_record *rec)
{
- struct strbuf entry_key = STRBUF_INIT;
struct pq_entry entry = { 0 };
- int err = 0;
+ int err = 0, empty;
+
+ empty = merged_iter_pqueue_is_empty(mi->pq);
+
+ if (mi->advance_index >= 0) {
+ /*
+ * When there are no pqueue entries then we only have a single
+ * subiter left. There is no need to use the pqueue in that
+ * case anymore as we know that the subiter will return entries
+ * in the correct order already.
+ *
+ * While this may sound like a very specific edge case, it may
+ * happen more frequently than you think. Most repositories
+ * will end up having a single large base table that contains
+ * most of the refs. It's thus likely that we exhaust all
+ * subiters but the one from that base ref.
+ */
+ if (empty)
+ return iterator_next(&mi->subiters[mi->advance_index].iter,
+ rec);
+
+ err = merged_iter_advance_subiter(mi, mi->advance_index);
+ if (err < 0)
+ return err;
+ if (!err)
+ empty = 0;
+ mi->advance_index = -1;
+ }
- if (merged_iter_pqueue_is_empty(mi->pq))
+ if (empty)
return 1;
entry = merged_iter_pqueue_remove(&mi->pq);
- err = merged_iter_advance_subiter(mi, entry.index);
- if (err < 0)
- return err;
/*
One can also use reftable as datacenter-local storage, where the ref
@@ -105,57 +129,38 @@ static int merged_iter_next_entry(struct merged_iter *mi,
such a deployment, the loop below must be changed to collect all
entries for the same key, and return new the newest one.
*/
- reftable_record_key(&entry.rec, &entry_key);
while (!merged_iter_pqueue_is_empty(mi->pq)) {
struct pq_entry top = merged_iter_pqueue_top(mi->pq);
- struct strbuf k = STRBUF_INIT;
- int err = 0, cmp = 0;
-
- reftable_record_key(&top.rec, &k);
+ int cmp;
- cmp = strbuf_cmp(&k, &entry_key);
- strbuf_release(&k);
-
- if (cmp > 0) {
+ cmp = reftable_record_cmp(top.rec, entry.rec);
+ if (cmp > 0)
break;
- }
merged_iter_pqueue_remove(&mi->pq);
err = merged_iter_advance_subiter(mi, top.index);
- if (err < 0) {
+ if (err < 0)
return err;
- }
- reftable_record_release(&top.rec);
}
- reftable_record_copy_from(rec, &entry.rec, hash_size(mi->hash_id));
- reftable_record_release(&entry.rec);
- strbuf_release(&entry_key);
+ mi->advance_index = entry.index;
+ SWAP(*rec, *entry.rec);
return 0;
}
-static int merged_iter_next(struct merged_iter *mi, struct reftable_record *rec)
+static int merged_iter_next_void(void *p, struct reftable_record *rec)
{
+ struct merged_iter *mi = p;
while (1) {
int err = merged_iter_next_entry(mi, rec);
- if (err == 0 && mi->suppress_deletions &&
- reftable_record_is_deletion(rec)) {
+ if (err)
+ return err;
+ if (mi->suppress_deletions && reftable_record_is_deletion(rec))
continue;
- }
-
- return err;
+ return 0;
}
}
-static int merged_iter_next_void(void *p, struct reftable_record *rec)
-{
- struct merged_iter *mi = p;
- if (merged_iter_pqueue_is_empty(mi->pq))
- return 1;
-
- return merged_iter_next(mi, rec);
-}
-
static struct reftable_iterator_vtable merged_iter_vtable = {
.next = &merged_iter_next_void,
.close = &merged_iter_close,
@@ -170,14 +175,14 @@ static void iterator_from_merged_iter(struct reftable_iterator *it,
}
int reftable_new_merged_table(struct reftable_merged_table **dest,
- struct reftable_table *stack, int n,
+ struct reftable_table *stack, size_t n,
uint32_t hash_id)
{
struct reftable_merged_table *m = NULL;
uint64_t last_max = 0;
uint64_t first_min = 0;
- int i = 0;
- for (i = 0; i < n; i++) {
+
+ for (size_t i = 0; i < n; i++) {
uint64_t min = reftable_table_min_update_index(&stack[i]);
uint64_t max = reftable_table_max_update_index(&stack[i]);
@@ -192,7 +197,7 @@ int reftable_new_merged_table(struct reftable_merged_table **dest,
}
}
- m = reftable_calloc(sizeof(struct reftable_merged_table));
+ REFTABLE_CALLOC_ARRAY(m, 1);
m->stack = stack;
m->stack_len = n;
m->min = first_min;
@@ -241,48 +246,37 @@ static int merged_table_seek_record(struct reftable_merged_table *mt,
struct reftable_iterator *it,
struct reftable_record *rec)
{
- struct reftable_iterator *iters = reftable_calloc(
- sizeof(struct reftable_iterator) * mt->stack_len);
struct merged_iter merged = {
- .stack = iters,
.typ = reftable_record_type(rec),
.hash_id = mt->hash_id,
.suppress_deletions = mt->suppress_deletions,
+ .advance_index = -1,
};
- int n = 0;
- int err = 0;
- int i = 0;
- for (i = 0; i < mt->stack_len && err == 0; i++) {
- int e = reftable_table_seek_record(&mt->stack[i], &iters[n],
- rec);
- if (e < 0) {
- err = e;
- }
- if (e == 0) {
- n++;
- }
- }
- if (err < 0) {
- int i = 0;
- for (i = 0; i < n; i++) {
- reftable_iterator_destroy(&iters[i]);
- }
- reftable_free(iters);
- return err;
+ struct merged_iter *p;
+ int err;
+
+ REFTABLE_CALLOC_ARRAY(merged.subiters, mt->stack_len);
+ for (size_t i = 0; i < mt->stack_len; i++) {
+ err = reftable_table_seek_record(&mt->stack[i],
+ &merged.subiters[merged.stack_len].iter, rec);
+ if (err < 0)
+ goto out;
+ if (!err)
+ merged.stack_len++;
}
- merged.stack_len = n;
err = merged_iter_init(&merged);
- if (err < 0) {
+ if (err < 0)
+ goto out;
+
+ p = reftable_malloc(sizeof(struct merged_iter));
+ *p = merged;
+ iterator_from_merged_iter(it, p);
+
+out:
+ if (err < 0)
merged_iter_close(&merged);
- return err;
- } else {
- struct merged_iter *p =
- reftable_malloc(sizeof(struct merged_iter));
- *p = merged;
- iterator_from_merged_iter(it, p);
- }
- return 0;
+ return err;
}
int reftable_merged_table_seek_ref(struct reftable_merged_table *mt,
diff --git a/reftable/merged.h b/reftable/merged.h
index 7d9f95d..a2571db 100644
--- a/reftable/merged.h
+++ b/reftable/merged.h
@@ -9,7 +9,7 @@ https://developers.google.com/open-source/licenses/bsd
#ifndef MERGED_H
#define MERGED_H
-#include "pq.h"
+#include "system.h"
struct reftable_merged_table {
struct reftable_table *stack;
@@ -24,15 +24,6 @@ struct reftable_merged_table {
uint64_t max;
};
-struct merged_iter {
- struct reftable_iterator *stack;
- uint32_t hash_id;
- size_t stack_len;
- uint8_t typ;
- int suppress_deletions;
- struct merged_iter_pqueue pq;
-};
-
void merged_table_release(struct reftable_merged_table *mt);
#endif
diff --git a/reftable/merged_test.c b/reftable/merged_test.c
index d08c16a..530fc82 100644
--- a/reftable/merged_test.c
+++ b/reftable/merged_test.c
@@ -12,7 +12,6 @@ https://developers.google.com/open-source/licenses/bsd
#include "basics.h"
#include "blocksource.h"
-#include "constants.h"
#include "reader.h"
#include "record.h"
#include "test_framework.h"
@@ -43,7 +42,7 @@ static void write_test_table(struct strbuf *buf,
}
}
- w = reftable_new_writer(&strbuf_add_void, buf, &opts);
+ w = reftable_new_writer(&strbuf_add_void, &noop_flush, buf, &opts);
reftable_writer_set_limits(w, min, max);
for (i = 0; i < n; i++) {
@@ -71,7 +70,7 @@ static void write_test_log_table(struct strbuf *buf,
.exact_log_message = 1,
};
struct reftable_writer *w = NULL;
- w = reftable_new_writer(&strbuf_add_void, buf, &opts);
+ w = reftable_new_writer(&strbuf_add_void, &noop_flush, buf, &opts);
reftable_writer_set_limits(w, update_index, update_index);
for (i = 0; i < n; i++) {
@@ -89,16 +88,17 @@ static struct reftable_merged_table *
merged_table_from_records(struct reftable_ref_record **refs,
struct reftable_block_source **source,
struct reftable_reader ***readers, int *sizes,
- struct strbuf *buf, int n)
+ struct strbuf *buf, size_t n)
{
- int i = 0;
struct reftable_merged_table *mt = NULL;
+ struct reftable_table *tabs;
int err;
- struct reftable_table *tabs =
- reftable_calloc(n * sizeof(struct reftable_table));
- *readers = reftable_calloc(n * sizeof(struct reftable_reader *));
- *source = reftable_calloc(n * sizeof(**source));
- for (i = 0; i < n; i++) {
+
+ REFTABLE_CALLOC_ARRAY(tabs, n);
+ REFTABLE_CALLOC_ARRAY(*readers, n);
+ REFTABLE_CALLOC_ARRAY(*source, n);
+
+ for (size_t i = 0; i < n; i++) {
write_test_table(&buf[i], refs[i], sizes[i]);
block_source_from_strbuf(&(*source)[i], &buf[i]);
@@ -123,13 +123,11 @@ static void readers_destroy(struct reftable_reader **readers, size_t n)
static void test_merged_between(void)
{
- uint8_t hash1[GIT_SHA1_RAWSZ] = { 1, 2, 3, 0 };
-
struct reftable_ref_record r1[] = { {
.refname = "b",
.update_index = 1,
.value_type = REFTABLE_REF_VAL1,
- .value.val1 = hash1,
+ .value.val1 = { 1, 2, 3, 0 },
} };
struct reftable_ref_record r2[] = { {
.refname = "a",
@@ -165,26 +163,24 @@ static void test_merged_between(void)
static void test_merged(void)
{
- uint8_t hash1[GIT_SHA1_RAWSZ] = { 1 };
- uint8_t hash2[GIT_SHA1_RAWSZ] = { 2 };
struct reftable_ref_record r1[] = {
{
.refname = "a",
.update_index = 1,
.value_type = REFTABLE_REF_VAL1,
- .value.val1 = hash1,
+ .value.val1 = { 1 },
},
{
.refname = "b",
.update_index = 1,
.value_type = REFTABLE_REF_VAL1,
- .value.val1 = hash1,
+ .value.val1 = { 1 },
},
{
.refname = "c",
.update_index = 1,
.value_type = REFTABLE_REF_VAL1,
- .value.val1 = hash1,
+ .value.val1 = { 1 },
}
};
struct reftable_ref_record r2[] = { {
@@ -197,13 +193,13 @@ static void test_merged(void)
.refname = "c",
.update_index = 3,
.value_type = REFTABLE_REF_VAL1,
- .value.val1 = hash2,
+ .value.val1 = { 2 },
},
{
.refname = "d",
.update_index = 3,
.value_type = REFTABLE_REF_VAL1,
- .value.val1 = hash1,
+ .value.val1 = { 1 },
},
};
@@ -236,14 +232,10 @@ static void test_merged(void)
while (len < 100) { /* cap loops/recursion. */
struct reftable_ref_record ref = { NULL };
int err = reftable_iterator_next_ref(&it, &ref);
- if (err > 0) {
+ if (err > 0)
break;
- }
- if (len == cap) {
- cap = 2 * cap + 1;
- out = reftable_realloc(
- out, sizeof(struct reftable_ref_record) * cap);
- }
+
+ REFTABLE_ALLOC_GROW(out, len + 1, cap);
out[len++] = ref;
}
reftable_iterator_destroy(&it);
@@ -270,16 +262,17 @@ static struct reftable_merged_table *
merged_table_from_log_records(struct reftable_log_record **logs,
struct reftable_block_source **source,
struct reftable_reader ***readers, int *sizes,
- struct strbuf *buf, int n)
+ struct strbuf *buf, size_t n)
{
- int i = 0;
struct reftable_merged_table *mt = NULL;
+ struct reftable_table *tabs;
int err;
- struct reftable_table *tabs =
- reftable_calloc(n * sizeof(struct reftable_table));
- *readers = reftable_calloc(n * sizeof(struct reftable_reader *));
- *source = reftable_calloc(n * sizeof(**source));
- for (i = 0; i < n; i++) {
+
+ REFTABLE_CALLOC_ARRAY(tabs, n);
+ REFTABLE_CALLOC_ARRAY(*readers, n);
+ REFTABLE_CALLOC_ARRAY(*source, n);
+
+ for (size_t i = 0; i < n; i++) {
write_test_log_table(&buf[i], logs[i], sizes[i], i + 1);
block_source_from_strbuf(&(*source)[i], &buf[i]);
@@ -296,16 +289,13 @@ merged_table_from_log_records(struct reftable_log_record **logs,
static void test_merged_logs(void)
{
- uint8_t hash1[GIT_SHA1_RAWSZ] = { 1 };
- uint8_t hash2[GIT_SHA1_RAWSZ] = { 2 };
- uint8_t hash3[GIT_SHA1_RAWSZ] = { 3 };
struct reftable_log_record r1[] = {
{
.refname = "a",
.update_index = 2,
.value_type = REFTABLE_LOG_UPDATE,
.value.update = {
- .old_hash = hash2,
+ .old_hash = { 2 },
/* deletion */
.name = "jane doe",
.email = "jane@invalid",
@@ -317,8 +307,8 @@ static void test_merged_logs(void)
.update_index = 1,
.value_type = REFTABLE_LOG_UPDATE,
.value.update = {
- .old_hash = hash1,
- .new_hash = hash2,
+ .old_hash = { 1 },
+ .new_hash = { 2 },
.name = "jane doe",
.email = "jane@invalid",
.message = "message1",
@@ -331,7 +321,7 @@ static void test_merged_logs(void)
.update_index = 3,
.value_type = REFTABLE_LOG_UPDATE,
.value.update = {
- .new_hash = hash3,
+ .new_hash = { 3 },
.name = "jane doe",
.email = "jane@invalid",
.message = "message3",
@@ -373,14 +363,10 @@ static void test_merged_logs(void)
while (len < 100) { /* cap loops/recursion. */
struct reftable_log_record log = { NULL };
int err = reftable_iterator_next_log(&it, &log);
- if (err > 0) {
+ if (err > 0)
break;
- }
- if (len == cap) {
- cap = 2 * cap + 1;
- out = reftable_realloc(
- out, sizeof(struct reftable_log_record) * cap);
- }
+
+ REFTABLE_ALLOC_GROW(out, len + 1, cap);
out[len++] = log;
}
reftable_iterator_destroy(&it);
@@ -417,7 +403,7 @@ static void test_default_write_opts(void)
struct reftable_write_options opts = { 0 };
struct strbuf buf = STRBUF_INIT;
struct reftable_writer *w =
- reftable_new_writer(&strbuf_add_void, &buf, &opts);
+ reftable_new_writer(&strbuf_add_void, &noop_flush, &buf, &opts);
struct reftable_ref_record rec = {
.refname = "master",
@@ -425,7 +411,7 @@ static void test_default_write_opts(void)
};
int err;
struct reftable_block_source source = { NULL };
- struct reftable_table *tab = reftable_calloc(sizeof(*tab) * 1);
+ struct reftable_table *tab = reftable_calloc(1, sizeof(*tab));
uint32_t hash_id;
struct reftable_reader *rd = NULL;
struct reftable_merged_table *merged = NULL;
diff --git a/reftable/pq.c b/reftable/pq.c
index 96ca6dd..7fb45d8 100644
--- a/reftable/pq.c
+++ b/reftable/pq.c
@@ -14,33 +14,12 @@ https://developers.google.com/open-source/licenses/bsd
int pq_less(struct pq_entry *a, struct pq_entry *b)
{
- struct strbuf ak = STRBUF_INIT;
- struct strbuf bk = STRBUF_INIT;
- int cmp = 0;
- reftable_record_key(&a->rec, &ak);
- reftable_record_key(&b->rec, &bk);
-
- cmp = strbuf_cmp(&ak, &bk);
-
- strbuf_release(&ak);
- strbuf_release(&bk);
-
+ int cmp = reftable_record_cmp(a->rec, b->rec);
if (cmp == 0)
return a->index > b->index;
-
return cmp < 0;
}
-struct pq_entry merged_iter_pqueue_top(struct merged_iter_pqueue pq)
-{
- return pq.heap[0];
-}
-
-int merged_iter_pqueue_is_empty(struct merged_iter_pqueue pq)
-{
- return pq.len == 0;
-}
-
struct pq_entry merged_iter_pqueue_remove(struct merged_iter_pqueue *pq)
{
int i = 0;
@@ -71,17 +50,13 @@ struct pq_entry merged_iter_pqueue_remove(struct merged_iter_pqueue *pq)
return e;
}
-void merged_iter_pqueue_add(struct merged_iter_pqueue *pq, struct pq_entry e)
+void merged_iter_pqueue_add(struct merged_iter_pqueue *pq, const struct pq_entry *e)
{
int i = 0;
- if (pq->len == pq->cap) {
- pq->cap = 2 * pq->cap + 1;
- pq->heap = reftable_realloc(pq->heap,
- pq->cap * sizeof(struct pq_entry));
- }
+ REFTABLE_ALLOC_GROW(pq->heap, pq->len + 1, pq->cap);
+ pq->heap[pq->len++] = *e;
- pq->heap[pq->len++] = e;
i = pq->len - 1;
while (i > 0) {
int j = (i - 1) / 2;
@@ -97,10 +72,6 @@ void merged_iter_pqueue_add(struct merged_iter_pqueue *pq, struct pq_entry e)
void merged_iter_pqueue_release(struct merged_iter_pqueue *pq)
{
- int i = 0;
- for (i = 0; i < pq->len; i++) {
- reftable_record_release(&pq->heap[i].rec);
- }
FREE_AND_NULL(pq->heap);
- pq->len = pq->cap = 0;
+ memset(pq, 0, sizeof(*pq));
}
diff --git a/reftable/pq.h b/reftable/pq.h
index 56fc1b6..f796c23 100644
--- a/reftable/pq.h
+++ b/reftable/pq.h
@@ -12,8 +12,8 @@ https://developers.google.com/open-source/licenses/bsd
#include "record.h"
struct pq_entry {
- int index;
- struct reftable_record rec;
+ size_t index;
+ struct reftable_record *rec;
};
struct merged_iter_pqueue {
@@ -22,12 +22,20 @@ struct merged_iter_pqueue {
size_t cap;
};
-struct pq_entry merged_iter_pqueue_top(struct merged_iter_pqueue pq);
-int merged_iter_pqueue_is_empty(struct merged_iter_pqueue pq);
void merged_iter_pqueue_check(struct merged_iter_pqueue pq);
struct pq_entry merged_iter_pqueue_remove(struct merged_iter_pqueue *pq);
-void merged_iter_pqueue_add(struct merged_iter_pqueue *pq, struct pq_entry e);
+void merged_iter_pqueue_add(struct merged_iter_pqueue *pq, const struct pq_entry *e);
void merged_iter_pqueue_release(struct merged_iter_pqueue *pq);
int pq_less(struct pq_entry *a, struct pq_entry *b);
+static inline struct pq_entry merged_iter_pqueue_top(struct merged_iter_pqueue pq)
+{
+ return pq.heap[0];
+}
+
+static inline int merged_iter_pqueue_is_empty(struct merged_iter_pqueue pq)
+{
+ return pq.len == 0;
+}
+
#endif
diff --git a/reftable/pq_test.c b/reftable/pq_test.c
index 7de5e88..b7d3c80 100644
--- a/reftable/pq_test.c
+++ b/reftable/pq_test.c
@@ -27,48 +27,43 @@ void merged_iter_pqueue_check(struct merged_iter_pqueue pq)
static void test_pq(void)
{
- char *names[54] = { NULL };
- int N = ARRAY_SIZE(names) - 1;
-
struct merged_iter_pqueue pq = { NULL };
+ struct reftable_record recs[54];
+ int N = ARRAY_SIZE(recs) - 1, i;
char *last = NULL;
- int i = 0;
for (i = 0; i < N; i++) {
- char name[100];
- snprintf(name, sizeof(name), "%02d", i);
- names[i] = xstrdup(name);
+ struct strbuf refname = STRBUF_INIT;
+ strbuf_addf(&refname, "%02d", i);
+
+ reftable_record_init(&recs[i], BLOCK_TYPE_REF);
+ recs[i].u.ref.refname = strbuf_detach(&refname, NULL);
}
i = 1;
do {
- struct pq_entry e = { .rec = { .type = BLOCK_TYPE_REF,
- .u.ref = {
- .refname = names[i],
- } } };
- merged_iter_pqueue_add(&pq, e);
+ struct pq_entry e = {
+ .rec = &recs[i],
+ };
+
+ merged_iter_pqueue_add(&pq, &e);
merged_iter_pqueue_check(pq);
+
i = (i * 7) % N;
} while (i != 1);
while (!merged_iter_pqueue_is_empty(pq)) {
struct pq_entry e = merged_iter_pqueue_remove(&pq);
- struct reftable_record *rec = &e.rec;
merged_iter_pqueue_check(pq);
- EXPECT(reftable_record_type(rec) == BLOCK_TYPE_REF);
- if (last) {
- EXPECT(strcmp(last, rec->u.ref.refname) < 0);
- }
- // this is names[i], so don't dealloc.
- last = rec->u.ref.refname;
- rec->u.ref.refname = NULL;
- reftable_record_release(rec);
- }
- for (i = 0; i < N; i++) {
- reftable_free(names[i]);
+ EXPECT(reftable_record_type(e.rec) == BLOCK_TYPE_REF);
+ if (last)
+ EXPECT(strcmp(last, e.rec->u.ref.refname) < 0);
+ last = e.rec->u.ref.refname;
}
+ for (i = 0; i < N; i++)
+ reftable_record_release(&recs[i]);
merged_iter_pqueue_release(&pq);
}
diff --git a/reftable/publicbasics.c b/reftable/publicbasics.c
index 0ad7d5c..44b84a1 100644
--- a/reftable/publicbasics.c
+++ b/reftable/publicbasics.c
@@ -6,10 +6,10 @@ license that can be found in the LICENSE file or at
https://developers.google.com/open-source/licenses/bsd
*/
+#include "system.h"
#include "reftable-malloc.h"
#include "basics.h"
-#include "system.h"
static void *(*reftable_malloc_ptr)(size_t sz);
static void *(*reftable_realloc_ptr)(void *, size_t);
@@ -37,8 +37,9 @@ void reftable_free(void *p)
free(p);
}
-void *reftable_calloc(size_t sz)
+void *reftable_calloc(size_t nelem, size_t elsize)
{
+ size_t sz = st_mult(nelem, elsize);
void *p = reftable_malloc(sz);
memset(p, 0, sz);
return p;
diff --git a/reftable/reader.c b/reftable/reader.c
index 54b4025..b113daa 100644
--- a/reftable/reader.c
+++ b/reftable/reader.c
@@ -16,7 +16,6 @@ https://developers.google.com/open-source/licenses/bsd
#include "record.h"
#include "reftable-error.h"
#include "reftable-generic.h"
-#include "tree.h"
uint64_t block_source_size(struct reftable_block_source *source)
{
@@ -224,10 +223,9 @@ struct table_iter {
struct block_iter bi;
int is_finished;
};
-#define TABLE_ITER_INIT \
- { \
- .bi = {.last_key = STRBUF_INIT } \
- }
+#define TABLE_ITER_INIT { \
+ .bi = BLOCK_ITER_INIT \
+}
static void table_iter_copy_from(struct table_iter *dest,
struct table_iter *src)
@@ -359,24 +357,32 @@ static int table_iter_next(struct table_iter *ti, struct reftable_record *rec)
while (1) {
struct table_iter next = TABLE_ITER_INIT;
- int err = 0;
- if (ti->is_finished) {
+ int err;
+
+ if (ti->is_finished)
return 1;
- }
+ /*
+ * Check whether the current block still has more records. If
+ * so, return it. If the iterator returns positive then the
+ * current block has been exhausted.
+ */
err = table_iter_next_in_block(ti, rec);
- if (err <= 0) {
+ if (err <= 0)
return err;
- }
+ /*
+ * Otherwise, we need to continue to the next block in the
+ * table and retry. If there are no more blocks then the
+ * iterator is drained.
+ */
err = table_iter_next_block(&next, ti);
- if (err != 0) {
- ti->is_finished = 1;
- }
table_iter_block_done(ti);
- if (err != 0) {
+ if (err) {
+ ti->is_finished = 1;
return err;
}
+
table_iter_copy_from(ti, &next);
block_iter_close(&next.bi);
}
@@ -443,16 +449,16 @@ static int reader_start(struct reftable_reader *r, struct table_iter *ti,
return reader_table_iter_at(r, ti, off, typ);
}
-static int reader_seek_linear(struct reftable_reader *r, struct table_iter *ti,
+static int reader_seek_linear(struct table_iter *ti,
struct reftable_record *want)
{
- struct reftable_record rec =
- reftable_new_record(reftable_record_type(want));
struct strbuf want_key = STRBUF_INIT;
struct strbuf got_key = STRBUF_INIT;
struct table_iter next = TABLE_ITER_INIT;
+ struct reftable_record rec;
int err = -1;
+ reftable_record_init(&rec, reftable_record_type(want));
reftable_record_key(want, &want_key);
while (1) {
@@ -510,8 +516,38 @@ static int reader_seek_indexed(struct reftable_reader *r,
if (err < 0)
goto done;
- err = reader_seek_linear(r, &index_iter, &want_index);
+ /*
+ * The index may consist of multiple levels, where each level may have
+ * multiple index blocks. We start by doing a linear search in the
+ * highest layer that identifies the relevant index block as well as
+ * the record inside that block that corresponds to our wanted key.
+ */
+ err = reader_seek_linear(&index_iter, &want_index);
+ if (err < 0)
+ goto done;
+
+ /*
+ * Traverse down the levels until we find a non-index entry.
+ */
while (1) {
+ /*
+ * In case we seek a record that does not exist the index iter
+ * will tell us that the iterator is over. This works because
+ * the last index entry of the current level will contain the
+ * last key it knows about. So in case our seeked key is larger
+ * than the last indexed key we know that it won't exist.
+ *
+ * There is one subtlety in the layout of the index section
+ * that makes this work as expected: the highest-level index is
+ * at end of the section and will point backwards and thus we
+ * start reading from the end of the index section, not the
+ * beginning.
+ *
+ * If that wasn't the case and the order was reversed then the
+ * linear seek would seek into the lower levels and traverse
+ * all levels of the index only to find out that the key does
+ * not exist.
+ */
err = table_iter_next(&index_iter, &index_result);
table_iter_block_done(&index_iter);
if (err != 0)
@@ -541,8 +577,7 @@ static int reader_seek_indexed(struct reftable_reader *r,
if (err == 0) {
struct table_iter empty = TABLE_ITER_INIT;
- struct table_iter *malloced =
- reftable_calloc(sizeof(struct table_iter));
+ struct table_iter *malloced = reftable_calloc(1, sizeof(*malloced));
*malloced = empty;
table_iter_copy_from(malloced, &next);
iterator_from_table_iter(it, malloced);
@@ -570,7 +605,7 @@ static int reader_seek_internal(struct reftable_reader *r,
err = reader_start(r, &ti, reftable_record_type(rec), 0);
if (err < 0)
return err;
- err = reader_seek_linear(r, &ti, rec);
+ err = reader_seek_linear(&ti, rec);
if (err < 0)
return err;
else {
@@ -637,8 +672,7 @@ void reader_close(struct reftable_reader *r)
int reftable_new_reader(struct reftable_reader **p,
struct reftable_block_source *src, char const *name)
{
- struct reftable_reader *rd =
- reftable_calloc(sizeof(struct reftable_reader));
+ struct reftable_reader *rd = reftable_calloc(1, sizeof(*rd));
int err = init_reader(rd, src, name);
if (err == 0) {
*p = rd;
@@ -713,7 +747,7 @@ static int reftable_reader_refs_for_unindexed(struct reftable_reader *r,
uint8_t *oid)
{
struct table_iter ti_empty = TABLE_ITER_INIT;
- struct table_iter *ti = reftable_calloc(sizeof(struct table_iter));
+ struct table_iter *ti = reftable_calloc(1, sizeof(*ti));
struct filtering_ref_iterator *filter = NULL;
struct filtering_ref_iterator empty = FILTERING_REF_ITERATOR_INIT;
int oid_len = hash_size(r->hash_id);
diff --git a/reftable/readwrite_test.c b/reftable/readwrite_test.c
index 469ab79..a6dbd21 100644
--- a/reftable/readwrite_test.c
+++ b/reftable/readwrite_test.c
@@ -11,7 +11,6 @@ https://developers.google.com/open-source/licenses/bsd
#include "basics.h"
#include "block.h"
#include "blocksource.h"
-#include "constants.h"
#include "reader.h"
#include "record.h"
#include "test_framework.h"
@@ -52,26 +51,25 @@ static void write_table(char ***names, struct strbuf *buf, int N,
.hash_id = hash_id,
};
struct reftable_writer *w =
- reftable_new_writer(&strbuf_add_void, buf, &opts);
+ reftable_new_writer(&strbuf_add_void, &noop_flush, buf, &opts);
struct reftable_ref_record ref = { NULL };
int i = 0, n;
struct reftable_log_record log = { NULL };
const struct reftable_stats *stats = NULL;
- *names = reftable_calloc(sizeof(char *) * (N + 1));
+
+ REFTABLE_CALLOC_ARRAY(*names, N + 1);
+
reftable_writer_set_limits(w, update_index, update_index);
for (i = 0; i < N; i++) {
- uint8_t hash[GIT_SHA256_RAWSZ] = { 0 };
char name[100];
int n;
- set_test_hash(hash, i);
-
snprintf(name, sizeof(name), "refs/heads/branch%02d", i);
ref.refname = name;
ref.update_index = update_index;
ref.value_type = REFTABLE_REF_VAL1;
- ref.value.val1 = hash;
+ set_test_hash(ref.value.val1, i);
(*names)[i] = xstrdup(name);
n = reftable_writer_add_ref(w, &ref);
@@ -79,18 +77,15 @@ static void write_table(char ***names, struct strbuf *buf, int N,
}
for (i = 0; i < N; i++) {
- uint8_t hash[GIT_SHA256_RAWSZ] = { 0 };
char name[100];
int n;
- set_test_hash(hash, i);
-
snprintf(name, sizeof(name), "refs/heads/branch%02d", i);
log.refname = name;
log.update_index = update_index;
log.value_type = REFTABLE_LOG_UPDATE;
- log.value.update.new_hash = hash;
+ set_test_hash(log.value.update.new_hash, i);
log.value.update.message = "message";
n = reftable_writer_add_log(w, &log);
@@ -134,18 +129,15 @@ static void test_log_buffer_size(void)
.message = "commit: 9\n",
} } };
struct reftable_writer *w =
- reftable_new_writer(&strbuf_add_void, &buf, &opts);
+ reftable_new_writer(&strbuf_add_void, &noop_flush, &buf, &opts);
/* This tests buffer extension for log compression. Must use a random
hash, to ensure that the compressed part is larger than the original.
*/
- uint8_t hash1[GIT_SHA1_RAWSZ], hash2[GIT_SHA1_RAWSZ];
for (i = 0; i < GIT_SHA1_RAWSZ; i++) {
- hash1[i] = (uint8_t)(rand() % 256);
- hash2[i] = (uint8_t)(rand() % 256);
+ log.value.update.old_hash[i] = (uint8_t)(git_rand() % 256);
+ log.value.update.new_hash[i] = (uint8_t)(git_rand() % 256);
}
- log.value.update.old_hash = hash1;
- log.value.update.new_hash = hash2;
reftable_writer_set_limits(w, update_index, update_index);
err = reftable_writer_add_log(w, &log);
EXPECT_ERR(err);
@@ -163,25 +155,26 @@ static void test_log_overflow(void)
.block_size = ARRAY_SIZE(msg),
};
int err;
- struct reftable_log_record
- log = { .refname = "refs/heads/master",
- .update_index = 0xa,
- .value_type = REFTABLE_LOG_UPDATE,
- .value = { .update = {
- .name = "Han-Wen Nienhuys",
- .email = "hanwen@google.com",
- .tz_offset = 100,
- .time = 0x5e430672,
- .message = msg,
- } } };
+ struct reftable_log_record log = {
+ .refname = "refs/heads/master",
+ .update_index = 0xa,
+ .value_type = REFTABLE_LOG_UPDATE,
+ .value = {
+ .update = {
+ .old_hash = { 1 },
+ .new_hash = { 2 },
+ .name = "Han-Wen Nienhuys",
+ .email = "hanwen@google.com",
+ .tz_offset = 100,
+ .time = 0x5e430672,
+ .message = msg,
+ },
+ },
+ };
struct reftable_writer *w =
- reftable_new_writer(&strbuf_add_void, &buf, &opts);
-
- uint8_t hash1[GIT_SHA1_RAWSZ] = {1}, hash2[GIT_SHA1_RAWSZ] = { 2 };
+ reftable_new_writer(&strbuf_add_void, &noop_flush, &buf, &opts);
memset(msg, 'x', sizeof(msg) - 1);
- log.value.update.old_hash = hash1;
- log.value.update.new_hash = hash2;
reftable_writer_set_limits(w, update_index, update_index);
err = reftable_writer_add_log(w, &log);
EXPECT(err == REFTABLE_ENTRY_TOO_BIG_ERROR);
@@ -192,7 +185,7 @@ static void test_log_overflow(void)
static void test_log_write_read(void)
{
int N = 2;
- char **names = reftable_calloc(sizeof(char *) * (N + 1));
+ char **names = reftable_calloc(N + 1, sizeof(*names));
int err;
struct reftable_write_options opts = {
.block_size = 256,
@@ -206,7 +199,7 @@ static void test_log_write_read(void)
struct reftable_block_source source = { NULL };
struct strbuf buf = STRBUF_INIT;
struct reftable_writer *w =
- reftable_new_writer(&strbuf_add_void, &buf, &opts);
+ reftable_new_writer(&strbuf_add_void, &noop_flush, &buf, &opts);
const struct reftable_stats *stats = NULL;
reftable_writer_set_limits(w, 0, N);
for (i = 0; i < N; i++) {
@@ -221,16 +214,13 @@ static void test_log_write_read(void)
EXPECT_ERR(err);
}
for (i = 0; i < N; i++) {
- uint8_t hash1[GIT_SHA1_RAWSZ], hash2[GIT_SHA1_RAWSZ];
struct reftable_log_record log = { NULL };
- set_test_hash(hash1, i);
- set_test_hash(hash2, i + 1);
log.refname = names[i];
log.update_index = i;
log.value_type = REFTABLE_LOG_UPDATE;
- log.value.update.old_hash = hash1;
- log.value.update.new_hash = hash2;
+ set_test_hash(log.value.update.old_hash, i);
+ set_test_hash(log.value.update.new_hash, i + 1);
err = reftable_writer_add_log(w, &log);
EXPECT_ERR(err);
@@ -298,20 +288,17 @@ static void test_log_zlib_corruption(void)
struct reftable_block_source source = { 0 };
struct strbuf buf = STRBUF_INIT;
struct reftable_writer *w =
- reftable_new_writer(&strbuf_add_void, &buf, &opts);
+ reftable_new_writer(&strbuf_add_void, &noop_flush, &buf, &opts);
const struct reftable_stats *stats = NULL;
- uint8_t hash1[GIT_SHA1_RAWSZ] = { 1 };
- uint8_t hash2[GIT_SHA1_RAWSZ] = { 2 };
char message[100] = { 0 };
int err, i, n;
-
struct reftable_log_record log = {
.refname = "refname",
.value_type = REFTABLE_LOG_UPDATE,
.value = {
.update = {
- .new_hash = hash1,
- .old_hash = hash2,
+ .new_hash = { 1 },
+ .old_hash = { 2 },
.name = "My Name",
.email = "myname@invalid",
.message = message,
@@ -320,7 +307,7 @@ static void test_log_zlib_corruption(void)
};
for (i = 0; i < sizeof(message) - 1; i++)
- message[i] = (uint8_t)(rand() % 64 + ' ');
+ message[i] = (uint8_t)(git_rand() % 64 + ' ');
reftable_writer_set_limits(w, 1, 1);
@@ -523,7 +510,7 @@ static void test_table_read_write_seek_index(void)
static void test_table_refs_for(int indexed)
{
int N = 50;
- char **want_names = reftable_calloc(sizeof(char *) * (N + 1));
+ char **want_names = reftable_calloc(N + 1, sizeof(*want_names));
int want_names_len = 0;
uint8_t want_hash[GIT_SHA1_RAWSZ];
@@ -539,7 +526,7 @@ static void test_table_refs_for(int indexed)
struct strbuf buf = STRBUF_INIT;
struct reftable_writer *w =
- reftable_new_writer(&strbuf_add_void, &buf, &opts);
+ reftable_new_writer(&strbuf_add_void, &noop_flush, &buf, &opts);
struct reftable_iterator it = { NULL };
int j;
@@ -550,8 +537,6 @@ static void test_table_refs_for(int indexed)
uint8_t hash[GIT_SHA1_RAWSZ];
char fill[51] = { 0 };
char name[100];
- uint8_t hash1[GIT_SHA1_RAWSZ];
- uint8_t hash2[GIT_SHA1_RAWSZ];
struct reftable_ref_record ref = { NULL };
memset(hash, i, sizeof(hash));
@@ -561,11 +546,9 @@ static void test_table_refs_for(int indexed)
name[40] = 0;
ref.refname = name;
- set_test_hash(hash1, i / 4);
- set_test_hash(hash2, 3 + i / 4);
ref.value_type = REFTABLE_REF_VAL2;
- ref.value.val2.value = hash1;
- ref.value.val2.target_value = hash2;
+ set_test_hash(ref.value.val2.value, i / 4);
+ set_test_hash(ref.value.val2.target_value, 3 + i / 4);
/* 80 bytes / entry, so 3 entries per block. Yields 17
*/
@@ -573,8 +556,8 @@ static void test_table_refs_for(int indexed)
n = reftable_writer_add_ref(w, &ref);
EXPECT(n == 0);
- if (!memcmp(hash1, want_hash, GIT_SHA1_RAWSZ) ||
- !memcmp(hash2, want_hash, GIT_SHA1_RAWSZ)) {
+ if (!memcmp(ref.value.val2.value, want_hash, GIT_SHA1_RAWSZ) ||
+ !memcmp(ref.value.val2.target_value, want_hash, GIT_SHA1_RAWSZ)) {
want_names[want_names_len++] = xstrdup(name);
}
}
@@ -636,7 +619,7 @@ static void test_write_empty_table(void)
struct reftable_write_options opts = { 0 };
struct strbuf buf = STRBUF_INIT;
struct reftable_writer *w =
- reftable_new_writer(&strbuf_add_void, &buf, &opts);
+ reftable_new_writer(&strbuf_add_void, &noop_flush, &buf, &opts);
struct reftable_block_source source = { NULL };
struct reftable_reader *rd = NULL;
struct reftable_ref_record rec = { NULL };
@@ -674,12 +657,11 @@ static void test_write_object_id_min_length(void)
};
struct strbuf buf = STRBUF_INIT;
struct reftable_writer *w =
- reftable_new_writer(&strbuf_add_void, &buf, &opts);
- uint8_t hash[GIT_SHA1_RAWSZ] = {42};
+ reftable_new_writer(&strbuf_add_void, &noop_flush, &buf, &opts);
struct reftable_ref_record ref = {
.update_index = 1,
.value_type = REFTABLE_REF_VAL1,
- .value.val1 = hash,
+ .value.val1 = {42},
};
int err;
int i;
@@ -710,12 +692,11 @@ static void test_write_object_id_length(void)
};
struct strbuf buf = STRBUF_INIT;
struct reftable_writer *w =
- reftable_new_writer(&strbuf_add_void, &buf, &opts);
- uint8_t hash[GIT_SHA1_RAWSZ] = {42};
+ reftable_new_writer(&strbuf_add_void, &noop_flush, &buf, &opts);
struct reftable_ref_record ref = {
.update_index = 1,
.value_type = REFTABLE_REF_VAL1,
- .value.val1 = hash,
+ .value.val1 = {42},
};
int err;
int i;
@@ -745,7 +726,7 @@ static void test_write_empty_key(void)
struct reftable_write_options opts = { 0 };
struct strbuf buf = STRBUF_INIT;
struct reftable_writer *w =
- reftable_new_writer(&strbuf_add_void, &buf, &opts);
+ reftable_new_writer(&strbuf_add_void, &noop_flush, &buf, &opts);
struct reftable_ref_record ref = {
.refname = "",
.update_index = 1,
@@ -768,7 +749,7 @@ static void test_write_key_order(void)
struct reftable_write_options opts = { 0 };
struct strbuf buf = STRBUF_INIT;
struct reftable_writer *w =
- reftable_new_writer(&strbuf_add_void, &buf, &opts);
+ reftable_new_writer(&strbuf_add_void, &noop_flush, &buf, &opts);
struct reftable_ref_record refs[2] = {
{
.refname = "b",
@@ -798,6 +779,138 @@ static void test_write_key_order(void)
strbuf_release(&buf);
}
+static void test_write_multiple_indices(void)
+{
+ struct reftable_write_options opts = {
+ .block_size = 100,
+ };
+ struct strbuf writer_buf = STRBUF_INIT, buf = STRBUF_INIT;
+ struct reftable_block_source source = { 0 };
+ struct reftable_iterator it = { 0 };
+ const struct reftable_stats *stats;
+ struct reftable_writer *writer;
+ struct reftable_reader *reader;
+ int err, i;
+
+ writer = reftable_new_writer(&strbuf_add_void, &noop_flush, &writer_buf, &opts);
+ reftable_writer_set_limits(writer, 1, 1);
+ for (i = 0; i < 100; i++) {
+ struct reftable_ref_record ref = {
+ .update_index = 1,
+ .value_type = REFTABLE_REF_VAL1,
+ .value.val1 = {i},
+ };
+
+ strbuf_reset(&buf);
+ strbuf_addf(&buf, "refs/heads/%04d", i);
+ ref.refname = buf.buf,
+
+ err = reftable_writer_add_ref(writer, &ref);
+ EXPECT_ERR(err);
+ }
+
+ for (i = 0; i < 100; i++) {
+ struct reftable_log_record log = {
+ .update_index = 1,
+ .value_type = REFTABLE_LOG_UPDATE,
+ .value.update = {
+ .old_hash = { i },
+ .new_hash = { i },
+ },
+ };
+
+ strbuf_reset(&buf);
+ strbuf_addf(&buf, "refs/heads/%04d", i);
+ log.refname = buf.buf,
+
+ err = reftable_writer_add_log(writer, &log);
+ EXPECT_ERR(err);
+ }
+
+ reftable_writer_close(writer);
+
+ /*
+ * The written data should be sufficiently large to result in indices
+ * for each of the block types.
+ */
+ stats = reftable_writer_stats(writer);
+ EXPECT(stats->ref_stats.index_offset > 0);
+ EXPECT(stats->obj_stats.index_offset > 0);
+ EXPECT(stats->log_stats.index_offset > 0);
+
+ block_source_from_strbuf(&source, &writer_buf);
+ err = reftable_new_reader(&reader, &source, "filename");
+ EXPECT_ERR(err);
+
+ /*
+ * Seeking the log uses the log index now. In case there is any
+ * confusion regarding indices we would notice here.
+ */
+ err = reftable_reader_seek_log(reader, &it, "");
+ EXPECT_ERR(err);
+
+ reftable_iterator_destroy(&it);
+ reftable_writer_free(writer);
+ reftable_reader_free(reader);
+ strbuf_release(&writer_buf);
+ strbuf_release(&buf);
+}
+
+static void test_write_multi_level_index(void)
+{
+ struct reftable_write_options opts = {
+ .block_size = 100,
+ };
+ struct strbuf writer_buf = STRBUF_INIT, buf = STRBUF_INIT;
+ struct reftable_block_source source = { 0 };
+ struct reftable_iterator it = { 0 };
+ const struct reftable_stats *stats;
+ struct reftable_writer *writer;
+ struct reftable_reader *reader;
+ int err;
+
+ writer = reftable_new_writer(&strbuf_add_void, &noop_flush, &writer_buf, &opts);
+ reftable_writer_set_limits(writer, 1, 1);
+ for (size_t i = 0; i < 200; i++) {
+ struct reftable_ref_record ref = {
+ .update_index = 1,
+ .value_type = REFTABLE_REF_VAL1,
+ .value.val1 = {i},
+ };
+
+ strbuf_reset(&buf);
+ strbuf_addf(&buf, "refs/heads/%03" PRIuMAX, (uintmax_t)i);
+ ref.refname = buf.buf,
+
+ err = reftable_writer_add_ref(writer, &ref);
+ EXPECT_ERR(err);
+ }
+ reftable_writer_close(writer);
+
+ /*
+ * The written refs should be sufficiently large to result in a
+ * multi-level index.
+ */
+ stats = reftable_writer_stats(writer);
+ EXPECT(stats->ref_stats.max_index_level == 2);
+
+ block_source_from_strbuf(&source, &writer_buf);
+ err = reftable_new_reader(&reader, &source, "filename");
+ EXPECT_ERR(err);
+
+ /*
+ * Seeking the last ref should work as expected.
+ */
+ err = reftable_reader_seek_ref(reader, &it, "refs/heads/199");
+ EXPECT_ERR(err);
+
+ reftable_iterator_destroy(&it);
+ reftable_writer_free(writer);
+ reftable_reader_free(reader);
+ strbuf_release(&writer_buf);
+ strbuf_release(&buf);
+}
+
static void test_corrupt_table_empty(void)
{
struct strbuf buf = STRBUF_INIT;
@@ -847,5 +960,7 @@ int readwrite_test_main(int argc, const char *argv[])
RUN_TEST(test_log_overflow);
RUN_TEST(test_write_object_id_length);
RUN_TEST(test_write_object_id_min_length);
+ RUN_TEST(test_write_multiple_indices);
+ RUN_TEST(test_write_multi_level_index);
return 0;
}
diff --git a/reftable/record.c b/reftable/record.c
index fbaa1fb..5506f3e 100644
--- a/reftable/record.c
+++ b/reftable/record.c
@@ -76,7 +76,7 @@ int reftable_is_block_type(uint8_t typ)
return 0;
}
-uint8_t *reftable_ref_record_val1(const struct reftable_ref_record *rec)
+const unsigned char *reftable_ref_record_val1(const struct reftable_ref_record *rec)
{
switch (rec->value_type) {
case REFTABLE_REF_VAL1:
@@ -88,7 +88,7 @@ uint8_t *reftable_ref_record_val1(const struct reftable_ref_record *rec)
}
}
-uint8_t *reftable_ref_record_val2(const struct reftable_ref_record *rec)
+const unsigned char *reftable_ref_record_val2(const struct reftable_ref_record *rec)
{
switch (rec->value_type) {
case REFTABLE_REF_VAL2:
@@ -159,34 +159,49 @@ int reftable_encode_key(int *restart, struct string_view dest,
return start.len - dest.len;
}
-int reftable_decode_key(struct strbuf *key, uint8_t *extra,
- struct strbuf last_key, struct string_view in)
+int reftable_decode_keylen(struct string_view in,
+ uint64_t *prefix_len,
+ uint64_t *suffix_len,
+ uint8_t *extra)
{
- int start_len = in.len;
- uint64_t prefix_len = 0;
- uint64_t suffix_len = 0;
- int n = get_var_int(&prefix_len, &in);
+ size_t start_len = in.len;
+ int n;
+
+ n = get_var_int(prefix_len, &in);
if (n < 0)
return -1;
string_view_consume(&in, n);
- if (prefix_len > last_key.len)
- return -1;
-
- n = get_var_int(&suffix_len, &in);
+ n = get_var_int(suffix_len, &in);
if (n <= 0)
return -1;
string_view_consume(&in, n);
- *extra = (uint8_t)(suffix_len & 0x7);
- suffix_len >>= 3;
+ *extra = (uint8_t)(*suffix_len & 0x7);
+ *suffix_len >>= 3;
+
+ return start_len - in.len;
+}
+
+int reftable_decode_key(struct strbuf *last_key, uint8_t *extra,
+ struct string_view in)
+{
+ int start_len = in.len;
+ uint64_t prefix_len = 0;
+ uint64_t suffix_len = 0;
+ int n;
+
+ n = reftable_decode_keylen(in, &prefix_len, &suffix_len, extra);
+ if (n < 0)
+ return -1;
+ string_view_consume(&in, n);
- if (in.len < suffix_len)
+ if (in.len < suffix_len ||
+ prefix_len > last_key->len)
return -1;
- strbuf_reset(key);
- strbuf_add(key, last_key.buf, prefix_len);
- strbuf_add(key, in.buf, suffix_len);
+ strbuf_setlen(last_key, prefix_len);
+ strbuf_add(last_key, in.buf, suffix_len);
string_view_consume(&in, suffix_len);
return start_len - in.len;
@@ -205,27 +220,36 @@ static void reftable_ref_record_copy_from(void *rec, const void *src_rec,
{
struct reftable_ref_record *ref = rec;
const struct reftable_ref_record *src = src_rec;
+ char *refname = NULL;
+ size_t refname_cap = 0;
+
assert(hash_size > 0);
- /* This is simple and correct, but we could probably reuse the hash
- * fields. */
+ SWAP(refname, ref->refname);
+ SWAP(refname_cap, ref->refname_cap);
reftable_ref_record_release(ref);
+ SWAP(ref->refname, refname);
+ SWAP(ref->refname_cap, refname_cap);
+
if (src->refname) {
- ref->refname = xstrdup(src->refname);
+ size_t refname_len = strlen(src->refname);
+
+ REFTABLE_ALLOC_GROW(ref->refname, refname_len + 1,
+ ref->refname_cap);
+ memcpy(ref->refname, src->refname, refname_len);
+ ref->refname[refname_len] = 0;
}
+
ref->update_index = src->update_index;
ref->value_type = src->value_type;
switch (src->value_type) {
case REFTABLE_REF_DELETION:
break;
case REFTABLE_REF_VAL1:
- ref->value.val1 = reftable_malloc(hash_size);
memcpy(ref->value.val1, src->value.val1, hash_size);
break;
case REFTABLE_REF_VAL2:
- ref->value.val2.value = reftable_malloc(hash_size);
memcpy(ref->value.val2.value, src->value.val2.value, hash_size);
- ref->value.val2.target_value = reftable_malloc(hash_size);
memcpy(ref->value.val2.target_value,
src->value.val2.target_value, hash_size);
break;
@@ -242,7 +266,7 @@ static char hexdigit(int c)
return 'a' + (c - 10);
}
-static void hex_format(char *dest, uint8_t *src, int hash_size)
+static void hex_format(char *dest, const unsigned char *src, int hash_size)
{
assert(hash_size > 0);
if (src) {
@@ -299,11 +323,8 @@ void reftable_ref_record_release(struct reftable_ref_record *ref)
reftable_free(ref->value.symref);
break;
case REFTABLE_REF_VAL2:
- reftable_free(ref->value.val2.target_value);
- reftable_free(ref->value.val2.value);
break;
case REFTABLE_REF_VAL1:
- reftable_free(ref->value.val1);
break;
case REFTABLE_REF_DELETION:
break;
@@ -369,24 +390,33 @@ static int reftable_ref_record_encode(const void *rec, struct string_view s,
static int reftable_ref_record_decode(void *rec, struct strbuf key,
uint8_t val_type, struct string_view in,
- int hash_size)
+ int hash_size, struct strbuf *scratch)
{
struct reftable_ref_record *r = rec;
struct string_view start = in;
uint64_t update_index = 0;
- int n = get_var_int(&update_index, &in);
+ const char *refname = NULL;
+ size_t refname_cap = 0;
+ int n;
+
+ assert(hash_size > 0);
+
+ n = get_var_int(&update_index, &in);
if (n < 0)
return n;
string_view_consume(&in, n);
+ SWAP(refname, r->refname);
+ SWAP(refname_cap, r->refname_cap);
reftable_ref_record_release(r);
+ SWAP(r->refname, refname);
+ SWAP(r->refname_cap, refname_cap);
- assert(hash_size > 0);
-
- r->refname = reftable_realloc(r->refname, key.len + 1);
+ REFTABLE_ALLOC_GROW(r->refname, key.len + 1, r->refname_cap);
memcpy(r->refname, key.buf, key.len);
- r->update_index = update_index;
r->refname[key.len] = 0;
+
+ r->update_index = update_index;
r->value_type = val_type;
switch (val_type) {
case REFTABLE_REF_VAL1:
@@ -394,7 +424,6 @@ static int reftable_ref_record_decode(void *rec, struct strbuf key,
return -1;
}
- r->value.val1 = reftable_malloc(hash_size);
memcpy(r->value.val1, in.buf, hash_size);
string_view_consume(&in, hash_size);
break;
@@ -404,23 +433,20 @@ static int reftable_ref_record_decode(void *rec, struct strbuf key,
return -1;
}
- r->value.val2.value = reftable_malloc(hash_size);
memcpy(r->value.val2.value, in.buf, hash_size);
string_view_consume(&in, hash_size);
- r->value.val2.target_value = reftable_malloc(hash_size);
memcpy(r->value.val2.target_value, in.buf, hash_size);
string_view_consume(&in, hash_size);
break;
case REFTABLE_REF_SYMREF: {
- struct strbuf dest = STRBUF_INIT;
- int n = decode_string(&dest, in);
+ int n = decode_string(scratch, in);
if (n < 0) {
return -1;
}
string_view_consume(&in, n);
- r->value.symref = dest.buf;
+ r->value.symref = strbuf_detach(scratch, NULL);
} break;
case REFTABLE_REF_DELETION:
@@ -439,7 +465,6 @@ static int reftable_ref_record_is_deletion_void(const void *p)
(const struct reftable_ref_record *)p);
}
-
static int reftable_ref_record_equal_void(const void *a,
const void *b, int hash_size)
{
@@ -448,6 +473,13 @@ static int reftable_ref_record_equal_void(const void *a,
return reftable_ref_record_equal(ra, rb, hash_size);
}
+static int reftable_ref_record_cmp_void(const void *_a, const void *_b)
+{
+ const struct reftable_ref_record *a = _a;
+ const struct reftable_ref_record *b = _b;
+ return strcmp(a->refname, b->refname);
+}
+
static void reftable_ref_record_print_void(const void *rec,
int hash_size)
{
@@ -464,6 +496,7 @@ static struct reftable_record_vtable reftable_ref_record_vtable = {
.release = &reftable_ref_record_release_void,
.is_deletion = &reftable_ref_record_is_deletion_void,
.equal = &reftable_ref_record_equal_void,
+ .cmp = &reftable_ref_record_cmp_void,
.print = &reftable_ref_record_print_void,
};
@@ -506,12 +539,13 @@ static void reftable_obj_record_copy_from(void *rec, const void *src_rec,
(const struct reftable_obj_record *)src_rec;
reftable_obj_record_release(obj);
- obj->hash_prefix = reftable_malloc(src->hash_prefix_len);
+
+ REFTABLE_ALLOC_ARRAY(obj->hash_prefix, src->hash_prefix_len);
obj->hash_prefix_len = src->hash_prefix_len;
if (src->hash_prefix_len)
memcpy(obj->hash_prefix, src->hash_prefix, obj->hash_prefix_len);
- obj->offsets = reftable_malloc(src->offset_len * sizeof(uint64_t));
+ REFTABLE_ALLOC_ARRAY(obj->offsets, src->offset_len);
obj->offset_len = src->offset_len;
COPY_ARRAY(obj->offsets, src->offsets, src->offset_len);
}
@@ -560,7 +594,7 @@ static int reftable_obj_record_encode(const void *rec, struct string_view s,
static int reftable_obj_record_decode(void *rec, struct strbuf key,
uint8_t val_type, struct string_view in,
- int hash_size)
+ int hash_size, struct strbuf *scratch UNUSED)
{
struct string_view start = in;
struct reftable_obj_record *r = rec;
@@ -568,7 +602,10 @@ static int reftable_obj_record_decode(void *rec, struct strbuf key,
int n = 0;
uint64_t last;
int j;
- r->hash_prefix = reftable_malloc(key.len);
+
+ reftable_obj_record_release(r);
+
+ REFTABLE_ALLOC_ARRAY(r->hash_prefix, key.len);
memcpy(r->hash_prefix, key.buf, key.len);
r->hash_prefix_len = key.len;
@@ -586,7 +623,7 @@ static int reftable_obj_record_decode(void *rec, struct strbuf key,
if (count == 0)
return start.len - in.len;
- r->offsets = reftable_malloc(count * sizeof(uint64_t));
+ REFTABLE_ALLOC_ARRAY(r->offsets, count);
r->offset_len = count;
n = get_var_int(&r->offsets[0], &in);
@@ -634,6 +671,25 @@ static int reftable_obj_record_equal_void(const void *a, const void *b, int hash
return 1;
}
+static int reftable_obj_record_cmp_void(const void *_a, const void *_b)
+{
+ const struct reftable_obj_record *a = _a;
+ const struct reftable_obj_record *b = _b;
+ int cmp;
+
+ cmp = memcmp(a->hash_prefix, b->hash_prefix,
+ a->hash_prefix_len > b->hash_prefix_len ?
+ a->hash_prefix_len : b->hash_prefix_len);
+ if (cmp)
+ return cmp;
+
+ /*
+ * When the prefix is the same then the object record that is longer is
+ * considered to be bigger.
+ */
+ return a->hash_prefix_len - b->hash_prefix_len;
+}
+
static struct reftable_record_vtable reftable_obj_record_vtable = {
.key = &reftable_obj_record_key,
.type = BLOCK_TYPE_OBJ,
@@ -644,6 +700,7 @@ static struct reftable_record_vtable reftable_obj_record_vtable = {
.release = &reftable_obj_record_release,
.is_deletion = &not_a_deletion,
.equal = &reftable_obj_record_equal_void,
+ .cmp = &reftable_obj_record_cmp_void,
.print = &reftable_obj_record_print,
};
@@ -723,16 +780,10 @@ static void reftable_log_record_copy_from(void *rec, const void *src_rec,
xstrdup(dst->value.update.message);
}
- if (dst->value.update.new_hash) {
- dst->value.update.new_hash = reftable_malloc(hash_size);
- memcpy(dst->value.update.new_hash,
- src->value.update.new_hash, hash_size);
- }
- if (dst->value.update.old_hash) {
- dst->value.update.old_hash = reftable_malloc(hash_size);
- memcpy(dst->value.update.old_hash,
- src->value.update.old_hash, hash_size);
- }
+ memcpy(dst->value.update.new_hash,
+ src->value.update.new_hash, hash_size);
+ memcpy(dst->value.update.old_hash,
+ src->value.update.old_hash, hash_size);
break;
}
}
@@ -750,8 +801,6 @@ void reftable_log_record_release(struct reftable_log_record *r)
case REFTABLE_LOG_DELETION:
break;
case REFTABLE_LOG_UPDATE:
- reftable_free(r->value.update.new_hash);
- reftable_free(r->value.update.old_hash);
reftable_free(r->value.update.name);
reftable_free(r->value.update.email);
reftable_free(r->value.update.message);
@@ -768,33 +817,20 @@ static uint8_t reftable_log_record_val_type(const void *rec)
return reftable_log_record_is_deletion(log) ? 0 : 1;
}
-static uint8_t zero[GIT_SHA256_RAWSZ] = { 0 };
-
static int reftable_log_record_encode(const void *rec, struct string_view s,
int hash_size)
{
const struct reftable_log_record *r = rec;
struct string_view start = s;
int n = 0;
- uint8_t *oldh = NULL;
- uint8_t *newh = NULL;
if (reftable_log_record_is_deletion(r))
return 0;
- oldh = r->value.update.old_hash;
- newh = r->value.update.new_hash;
- if (!oldh) {
- oldh = zero;
- }
- if (!newh) {
- newh = zero;
- }
-
if (s.len < 2 * hash_size)
return -1;
- memcpy(s.buf, oldh, hash_size);
- memcpy(s.buf + hash_size, newh, hash_size);
+ memcpy(s.buf, r->value.update.old_hash, hash_size);
+ memcpy(s.buf + hash_size, r->value.update.new_hash, hash_size);
string_view_consume(&s, 2 * hash_size);
n = encode_string(r->value.update.name ? r->value.update.name : "", s);
@@ -830,19 +866,18 @@ static int reftable_log_record_encode(const void *rec, struct string_view s,
static int reftable_log_record_decode(void *rec, struct strbuf key,
uint8_t val_type, struct string_view in,
- int hash_size)
+ int hash_size, struct strbuf *scratch)
{
struct string_view start = in;
struct reftable_log_record *r = rec;
uint64_t max = 0;
uint64_t ts = 0;
- struct strbuf dest = STRBUF_INIT;
int n;
if (key.len <= 9 || key.buf[key.len - 9] != 0)
return REFTABLE_FORMAT_ERROR;
- r->refname = reftable_realloc(r->refname, key.len - 8);
+ REFTABLE_ALLOC_GROW(r->refname, key.len - 8, r->refname_cap);
memcpy(r->refname, key.buf, key.len - 8);
ts = get_be64(key.buf + key.len - 8);
@@ -851,9 +886,8 @@ static int reftable_log_record_decode(void *rec, struct strbuf key,
if (val_type != r->value_type) {
switch (r->value_type) {
case REFTABLE_LOG_UPDATE:
- FREE_AND_NULL(r->value.update.old_hash);
- FREE_AND_NULL(r->value.update.new_hash);
FREE_AND_NULL(r->value.update.message);
+ r->value.update.message_cap = 0;
FREE_AND_NULL(r->value.update.email);
FREE_AND_NULL(r->value.update.name);
break;
@@ -869,36 +903,43 @@ static int reftable_log_record_decode(void *rec, struct strbuf key,
if (in.len < 2 * hash_size)
return REFTABLE_FORMAT_ERROR;
- r->value.update.old_hash =
- reftable_realloc(r->value.update.old_hash, hash_size);
- r->value.update.new_hash =
- reftable_realloc(r->value.update.new_hash, hash_size);
-
memcpy(r->value.update.old_hash, in.buf, hash_size);
memcpy(r->value.update.new_hash, in.buf + hash_size, hash_size);
string_view_consume(&in, 2 * hash_size);
- n = decode_string(&dest, in);
+ n = decode_string(scratch, in);
if (n < 0)
goto done;
string_view_consume(&in, n);
- r->value.update.name =
- reftable_realloc(r->value.update.name, dest.len + 1);
- memcpy(r->value.update.name, dest.buf, dest.len);
- r->value.update.name[dest.len] = 0;
+ /*
+ * In almost all cases we can expect the reflog name to not change for
+ * reflog entries as they are tied to the local identity, not to the
+ * target commits. As an optimization for this common case we can thus
+ * skip copying over the name in case it's accurate already.
+ */
+ if (!r->value.update.name ||
+ strcmp(r->value.update.name, scratch->buf)) {
+ r->value.update.name =
+ reftable_realloc(r->value.update.name, scratch->len + 1);
+ memcpy(r->value.update.name, scratch->buf, scratch->len);
+ r->value.update.name[scratch->len] = 0;
+ }
- strbuf_reset(&dest);
- n = decode_string(&dest, in);
+ n = decode_string(scratch, in);
if (n < 0)
goto done;
string_view_consume(&in, n);
- r->value.update.email =
- reftable_realloc(r->value.update.email, dest.len + 1);
- memcpy(r->value.update.email, dest.buf, dest.len);
- r->value.update.email[dest.len] = 0;
+ /* Same as above, but for the reflog email. */
+ if (!r->value.update.email ||
+ strcmp(r->value.update.email, scratch->buf)) {
+ r->value.update.email =
+ reftable_realloc(r->value.update.email, scratch->len + 1);
+ memcpy(r->value.update.email, scratch->buf, scratch->len);
+ r->value.update.email[scratch->len] = 0;
+ }
ts = 0;
n = get_var_int(&ts, &in);
@@ -912,22 +953,19 @@ static int reftable_log_record_decode(void *rec, struct strbuf key,
r->value.update.tz_offset = get_be16(in.buf);
string_view_consume(&in, 2);
- strbuf_reset(&dest);
- n = decode_string(&dest, in);
+ n = decode_string(scratch, in);
if (n < 0)
goto done;
string_view_consume(&in, n);
- r->value.update.message =
- reftable_realloc(r->value.update.message, dest.len + 1);
- memcpy(r->value.update.message, dest.buf, dest.len);
- r->value.update.message[dest.len] = 0;
+ REFTABLE_ALLOC_GROW(r->value.update.message, scratch->len + 1,
+ r->value.update.message_cap);
+ memcpy(r->value.update.message, scratch->buf, scratch->len);
+ r->value.update.message[scratch->len] = 0;
- strbuf_release(&dest);
return start.len - in.len;
done:
- strbuf_release(&dest);
return REFTABLE_FORMAT_ERROR;
}
@@ -943,17 +981,6 @@ static int null_streq(char *a, char *b)
return 0 == strcmp(a, b);
}
-static int zero_hash_eq(uint8_t *a, uint8_t *b, int sz)
-{
- if (!a)
- a = zero;
-
- if (!b)
- b = zero;
-
- return !memcmp(a, b, sz);
-}
-
static int reftable_log_record_equal_void(const void *a,
const void *b, int hash_size)
{
@@ -962,6 +989,22 @@ static int reftable_log_record_equal_void(const void *a,
hash_size);
}
+static int reftable_log_record_cmp_void(const void *_a, const void *_b)
+{
+ const struct reftable_log_record *a = _a;
+ const struct reftable_log_record *b = _b;
+ int cmp = strcmp(a->refname, b->refname);
+ if (cmp)
+ return cmp;
+
+ /*
+ * Note that the comparison here is reversed. This is because the
+ * update index is reversed when comparing keys. For reference, see how
+ * we handle this in reftable_log_record_key()`.
+ */
+ return b->update_index - a->update_index;
+}
+
int reftable_log_record_equal(const struct reftable_log_record *a,
const struct reftable_log_record *b, int hash_size)
{
@@ -981,10 +1024,10 @@ int reftable_log_record_equal(const struct reftable_log_record *a,
b->value.update.email) &&
null_streq(a->value.update.message,
b->value.update.message) &&
- zero_hash_eq(a->value.update.old_hash,
- b->value.update.old_hash, hash_size) &&
- zero_hash_eq(a->value.update.new_hash,
- b->value.update.new_hash, hash_size);
+ !memcmp(a->value.update.old_hash,
+ b->value.update.old_hash, hash_size) &&
+ !memcmp(a->value.update.new_hash,
+ b->value.update.new_hash, hash_size);
}
abort();
@@ -1011,6 +1054,7 @@ static struct reftable_record_vtable reftable_log_record_vtable = {
.release = &reftable_log_record_release_void,
.is_deletion = &reftable_log_record_is_deletion_void,
.equal = &reftable_log_record_equal_void,
+ .cmp = &reftable_log_record_cmp_void,
.print = &reftable_log_record_print_void,
};
@@ -1061,7 +1105,7 @@ static int reftable_index_record_encode(const void *rec, struct string_view out,
static int reftable_index_record_decode(void *rec, struct strbuf key,
uint8_t val_type, struct string_view in,
- int hash_size)
+ int hash_size, struct strbuf *scratch UNUSED)
{
struct string_view start = in;
struct reftable_index_record *r = rec;
@@ -1086,6 +1130,13 @@ static int reftable_index_record_equal(const void *a, const void *b, int hash_si
return ia->offset == ib->offset && !strbuf_cmp(&ia->last_key, &ib->last_key);
}
+static int reftable_index_record_cmp(const void *_a, const void *_b)
+{
+ const struct reftable_index_record *a = _a;
+ const struct reftable_index_record *b = _b;
+ return strbuf_cmp(&a->last_key, &b->last_key);
+}
+
static void reftable_index_record_print(const void *rec, int hash_size)
{
const struct reftable_index_record *idx = rec;
@@ -1103,6 +1154,7 @@ static struct reftable_record_vtable reftable_index_record_vtable = {
.release = &reftable_index_record_release,
.is_deletion = &not_a_deletion,
.equal = &reftable_index_record_equal,
+ .cmp = &reftable_index_record_cmp,
.print = &reftable_index_record_print,
};
@@ -1111,11 +1163,6 @@ void reftable_record_key(struct reftable_record *rec, struct strbuf *dest)
reftable_record_vtable(rec)->key(reftable_record_data(rec), dest);
}
-uint8_t reftable_record_type(struct reftable_record *rec)
-{
- return rec->type;
-}
-
int reftable_record_encode(struct reftable_record *rec, struct string_view dest,
int hash_size)
{
@@ -1139,10 +1186,12 @@ uint8_t reftable_record_val_type(struct reftable_record *rec)
}
int reftable_record_decode(struct reftable_record *rec, struct strbuf key,
- uint8_t extra, struct string_view src, int hash_size)
+ uint8_t extra, struct string_view src, int hash_size,
+ struct strbuf *scratch)
{
return reftable_record_vtable(rec)->decode(reftable_record_data(rec),
- key, extra, src, hash_size);
+ key, extra, src, hash_size,
+ scratch);
}
void reftable_record_release(struct reftable_record *rec)
@@ -1156,6 +1205,14 @@ int reftable_record_is_deletion(struct reftable_record *rec)
reftable_record_data(rec));
}
+int reftable_record_cmp(struct reftable_record *a, struct reftable_record *b)
+{
+ if (a->type != b->type)
+ BUG("cannot compare reftable records of different type");
+ return reftable_record_vtable(a)->cmp(
+ reftable_record_data(a), reftable_record_data(b));
+}
+
int reftable_record_equal(struct reftable_record *a, struct reftable_record *b, int hash_size)
{
if (a->type != b->type)
@@ -1164,7 +1221,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(uint8_t *a, uint8_t *b, int hash_size)
+static int hash_equal(const unsigned char *a, const unsigned char *b, int hash_size)
{
if (a && b)
return !memcmp(a, b, hash_size);
@@ -1229,12 +1286,6 @@ int reftable_log_record_is_deletion(const struct reftable_log_record *log)
return (log->value_type == REFTABLE_LOG_DELETION);
}
-void string_view_consume(struct string_view *s, int n)
-{
- s->buf += n;
- s->len -= n;
-}
-
static void *reftable_record_data(struct reftable_record *rec)
{
switch (rec->type) {
@@ -1266,45 +1317,22 @@ reftable_record_vtable(struct reftable_record *rec)
abort();
}
-struct reftable_record reftable_new_record(uint8_t typ)
+void reftable_record_init(struct reftable_record *rec, uint8_t typ)
{
- struct reftable_record clean = {
- .type = typ,
- };
+ memset(rec, 0, sizeof(*rec));
+ rec->type = typ;
- /* the following is involved, but the naive solution (just return
- * `clean` as is, except for BLOCK_TYPE_INDEX), returns a garbage
- * clean.u.obj.offsets pointer on Windows VS CI. Go figure.
- */
switch (typ) {
- case BLOCK_TYPE_OBJ:
- {
- struct reftable_obj_record obj = { 0 };
- clean.u.obj = obj;
- break;
- }
- case BLOCK_TYPE_INDEX:
- {
- struct reftable_index_record idx = {
- .last_key = STRBUF_INIT,
- };
- clean.u.idx = idx;
- break;
- }
case BLOCK_TYPE_REF:
- {
- struct reftable_ref_record ref = { 0 };
- clean.u.ref = ref;
- break;
- }
case BLOCK_TYPE_LOG:
- {
- struct reftable_log_record log = { 0 };
- clean.u.log = log;
- break;
- }
+ case BLOCK_TYPE_OBJ:
+ return;
+ case BLOCK_TYPE_INDEX:
+ strbuf_init(&rec->u.idx.last_key, 0);
+ return;
+ default:
+ BUG("unhandled record type");
}
- return clean;
}
void reftable_record_print(struct reftable_record *rec, int hash_size)
diff --git a/reftable/record.h b/reftable/record.h
index fd80cd4..d778133 100644
--- a/reftable/record.h
+++ b/reftable/record.h
@@ -25,7 +25,11 @@ struct string_view {
};
/* Advance `s.buf` by `n`, and decrease length. */
-void string_view_consume(struct string_view *s, int n);
+static inline void string_view_consume(struct string_view *s, int n)
+{
+ s->buf += n;
+ s->len -= n;
+}
/* utilities for de/encoding varints */
@@ -51,7 +55,8 @@ struct reftable_record_vtable {
/* decode data from `src` into the record. */
int (*decode)(void *rec, struct strbuf key, uint8_t extra,
- struct string_view src, int hash_size);
+ struct string_view src, int hash_size,
+ struct strbuf *scratch);
/* deallocate and null the record. */
void (*release)(void *rec);
@@ -62,6 +67,12 @@ struct reftable_record_vtable {
/* 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);
+ /*
+ * 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);
};
@@ -69,18 +80,24 @@ struct reftable_record_vtable {
/* returns true for recognized block types. Block start with the block type. */
int reftable_is_block_type(uint8_t typ);
-/* return an initialized record for the given type */
-struct reftable_record reftable_new_record(uint8_t typ);
-
/* Encode `key` into `dest`. Sets `is_restart` to indicate a restart. Returns
* number of bytes written. */
int reftable_encode_key(int *is_restart, struct string_view dest,
struct strbuf prev_key, struct strbuf key,
uint8_t extra);
-/* Decode into `key` and `extra` from `in` */
-int reftable_decode_key(struct strbuf *key, uint8_t *extra,
- struct strbuf last_key, struct string_view in);
+/* Decode a record's key lengths. */
+int reftable_decode_keylen(struct string_view in,
+ uint64_t *prefix_len,
+ uint64_t *suffix_len,
+ uint8_t *extra);
+
+/*
+ * Decode into `last_key` and `extra` from `in`. `last_key` is expected to
+ * contain the decoded key of the preceding record, if any.
+ */
+int reftable_decode_key(struct strbuf *last_key, uint8_t *extra,
+ struct string_view in);
/* reftable_index_record are used internally to speed up lookups. */
struct reftable_index_record {
@@ -100,8 +117,8 @@ struct reftable_obj_record {
/* record is a generic wrapper for different types of records. It is normally
* created on the stack, or embedded within another struct. If the type is
* known, a fresh instance can be initialized explicitly. Otherwise, use
- * reftable_new_record() to initialize generically (as the index_record is not
- * valid as 0-initialized structure)
+ * `reftable_record_init()` to initialize generically (as the index_record is
+ * not valid as 0-initialized structure)
*/
struct reftable_record {
uint8_t type;
@@ -113,11 +130,14 @@ struct reftable_record {
} u;
};
+/* Initialize the reftable record for the given type */
+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);
void reftable_record_print(struct reftable_record *rec, int hash_size);
void reftable_record_key(struct reftable_record *rec, struct strbuf *dest);
-uint8_t reftable_record_type(struct reftable_record *rec);
void reftable_record_copy_from(struct reftable_record *rec,
struct reftable_record *src, int hash_size);
uint8_t reftable_record_val_type(struct reftable_record *rec);
@@ -125,9 +145,14 @@ int reftable_record_encode(struct reftable_record *rec, struct string_view dest,
int hash_size);
int reftable_record_decode(struct reftable_record *rec, struct strbuf key,
uint8_t extra, struct string_view src,
- int hash_size);
+ int hash_size, struct strbuf *scratch);
int reftable_record_is_deletion(struct reftable_record *rec);
+static inline uint8_t reftable_record_type(struct reftable_record *rec)
+{
+ return rec->type;
+}
+
/* frees and zeroes out the embedded record */
void reftable_record_release(struct reftable_record *rec);
diff --git a/reftable/record_test.c b/reftable/record_test.c
index 70ae78f..c158ee7 100644
--- a/reftable/record_test.c
+++ b/reftable/record_test.c
@@ -16,11 +16,11 @@
static void test_copy(struct reftable_record *rec)
{
- struct reftable_record copy = { 0 };
+ struct reftable_record copy;
uint8_t typ;
typ = reftable_record_type(rec);
- copy = reftable_new_record(typ);
+ reftable_record_init(&copy, typ);
reftable_record_copy_from(&copy, rec, GIT_SHA1_RAWSZ);
/* do it twice to catch memory leaks */
reftable_record_copy_from(&copy, rec, GIT_SHA1_RAWSZ);
@@ -99,6 +99,7 @@ static void set_hash(uint8_t *h, int j)
static void test_reftable_ref_record_roundtrip(void)
{
+ struct strbuf scratch = STRBUF_INIT;
int i = 0;
for (i = REFTABLE_REF_DELETION; i < REFTABLE_NR_REF_VALUETYPES; i++) {
@@ -119,15 +120,10 @@ static void test_reftable_ref_record_roundtrip(void)
case REFTABLE_REF_DELETION:
break;
case REFTABLE_REF_VAL1:
- in.u.ref.value.val1 = reftable_malloc(GIT_SHA1_RAWSZ);
set_hash(in.u.ref.value.val1, 1);
break;
case REFTABLE_REF_VAL2:
- in.u.ref.value.val2.value =
- reftable_malloc(GIT_SHA1_RAWSZ);
set_hash(in.u.ref.value.val2.value, 1);
- in.u.ref.value.val2.target_value =
- reftable_malloc(GIT_SHA1_RAWSZ);
set_hash(in.u.ref.value.val2.target_value, 2);
break;
case REFTABLE_REF_SYMREF:
@@ -145,7 +141,7 @@ static void test_reftable_ref_record_roundtrip(void)
EXPECT(n > 0);
/* decode into a non-zero reftable_record to test for leaks. */
- m = reftable_record_decode(&out, key, i, dest, GIT_SHA1_RAWSZ);
+ m = reftable_record_decode(&out, key, i, dest, GIT_SHA1_RAWSZ, &scratch);
EXPECT(n == m);
EXPECT(reftable_ref_record_equal(&in.u.ref, &out.u.ref,
@@ -155,6 +151,8 @@ static void test_reftable_ref_record_roundtrip(void)
strbuf_release(&key);
reftable_record_release(&out);
}
+
+ strbuf_release(&scratch);
}
static void test_reftable_log_record_equal(void)
@@ -180,7 +178,6 @@ static void test_reftable_log_record_equal(void)
static void test_reftable_log_record_roundtrip(void)
{
int i;
-
struct reftable_log_record in[] = {
{
.refname = xstrdup("refs/heads/master"),
@@ -188,8 +185,6 @@ static void test_reftable_log_record_roundtrip(void)
.value_type = REFTABLE_LOG_UPDATE,
.value = {
.update = {
- .old_hash = reftable_malloc(GIT_SHA1_RAWSZ),
- .new_hash = reftable_malloc(GIT_SHA1_RAWSZ),
.name = xstrdup("han-wen"),
.email = xstrdup("hanwen@google.com"),
.message = xstrdup("test"),
@@ -207,15 +202,10 @@ static void test_reftable_log_record_roundtrip(void)
.refname = xstrdup("branch"),
.update_index = 33,
.value_type = REFTABLE_LOG_UPDATE,
- .value = {
- .update = {
- .old_hash = reftable_malloc(GIT_SHA1_RAWSZ),
- .new_hash = reftable_malloc(GIT_SHA1_RAWSZ),
- /* rest of fields left empty. */
- },
- },
}
};
+ struct strbuf scratch = STRBUF_INIT;
+
set_test_hash(in[0].value.update.new_hash, 1);
set_test_hash(in[0].value.update.old_hash, 2);
set_test_hash(in[2].value.update.new_hash, 3);
@@ -236,8 +226,6 @@ static void test_reftable_log_record_roundtrip(void)
.value_type = REFTABLE_LOG_UPDATE,
.value = {
.update = {
- .new_hash = reftable_calloc(GIT_SHA1_RAWSZ),
- .old_hash = reftable_calloc(GIT_SHA1_RAWSZ),
.name = xstrdup("old name"),
.email = xstrdup("old@email"),
.message = xstrdup("old message"),
@@ -257,7 +245,7 @@ static void test_reftable_log_record_roundtrip(void)
EXPECT(n >= 0);
valtype = reftable_record_val_type(&rec);
m = reftable_record_decode(&out, key, valtype, dest,
- GIT_SHA1_RAWSZ);
+ GIT_SHA1_RAWSZ, &scratch);
EXPECT(n == m);
EXPECT(reftable_log_record_equal(&in[i], &out.u.log,
@@ -266,6 +254,8 @@ static void test_reftable_log_record_roundtrip(void)
strbuf_release(&key);
reftable_record_release(&out);
}
+
+ strbuf_release(&scratch);
}
static void test_u24_roundtrip(void)
@@ -300,7 +290,8 @@ static void test_key_roundtrip(void)
EXPECT(!restart);
EXPECT(n > 0);
- m = reftable_decode_key(&roundtrip, &rt_extra, last_key, dest);
+ strbuf_addstr(&roundtrip, "refs/heads/master");
+ m = reftable_decode_key(&roundtrip, &rt_extra, dest);
EXPECT(n == m);
EXPECT(0 == strbuf_cmp(&key, &roundtrip));
EXPECT(rt_extra == extra);
@@ -314,23 +305,27 @@ static void test_reftable_obj_record_roundtrip(void)
{
uint8_t testHash1[GIT_SHA1_RAWSZ] = { 1, 2, 3, 4, 0 };
uint64_t till9[] = { 1, 2, 3, 4, 500, 600, 700, 800, 9000 };
- struct reftable_obj_record recs[3] = { {
- .hash_prefix = testHash1,
- .hash_prefix_len = 5,
- .offsets = till9,
- .offset_len = 3,
- },
- {
- .hash_prefix = testHash1,
- .hash_prefix_len = 5,
- .offsets = till9,
- .offset_len = 9,
- },
- {
- .hash_prefix = testHash1,
- .hash_prefix_len = 5,
- } };
+ struct reftable_obj_record recs[3] = {
+ {
+ .hash_prefix = testHash1,
+ .hash_prefix_len = 5,
+ .offsets = till9,
+ .offset_len = 3,
+ },
+ {
+ .hash_prefix = testHash1,
+ .hash_prefix_len = 5,
+ .offsets = till9,
+ .offset_len = 9,
+ },
+ {
+ .hash_prefix = testHash1,
+ .hash_prefix_len = 5,
+ },
+ };
+ struct strbuf scratch = STRBUF_INIT;
int i = 0;
+
for (i = 0; i < ARRAY_SIZE(recs); i++) {
uint8_t buffer[1024] = { 0 };
struct string_view dest = {
@@ -354,13 +349,15 @@ static void test_reftable_obj_record_roundtrip(void)
EXPECT(n > 0);
extra = reftable_record_val_type(&in);
m = reftable_record_decode(&out, key, extra, dest,
- GIT_SHA1_RAWSZ);
+ GIT_SHA1_RAWSZ, &scratch);
EXPECT(n == m);
EXPECT(reftable_record_equal(&in, &out, GIT_SHA1_RAWSZ));
strbuf_release(&key);
reftable_record_release(&out);
}
+
+ strbuf_release(&scratch);
}
static void test_reftable_index_record_roundtrip(void)
@@ -377,6 +374,7 @@ static void test_reftable_index_record_roundtrip(void)
.buf = buffer,
.len = sizeof(buffer),
};
+ struct strbuf scratch = STRBUF_INIT;
struct strbuf key = STRBUF_INIT;
struct reftable_record out = {
.type = BLOCK_TYPE_INDEX,
@@ -394,13 +392,15 @@ static void test_reftable_index_record_roundtrip(void)
EXPECT(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, GIT_SHA1_RAWSZ,
+ &scratch);
EXPECT(m == n);
EXPECT(reftable_record_equal(&in, &out, GIT_SHA1_RAWSZ));
reftable_record_release(&out);
strbuf_release(&key);
+ strbuf_release(&scratch);
strbuf_release(&in.u.idx.last_key);
}
diff --git a/reftable/refname.c b/reftable/refname.c
index 9573496..bbfde15 100644
--- a/reftable/refname.c
+++ b/reftable/refname.c
@@ -12,15 +12,15 @@
#include "refname.h"
#include "reftable-iterator.h"
-struct find_arg {
- char **names;
- const char *want;
+struct refname_needle_lesseq_args {
+ char **haystack;
+ const char *needle;
};
-static int find_name(size_t k, void *arg)
+static int refname_needle_lesseq(size_t k, void *_args)
{
- struct find_arg *f_arg = arg;
- return strcmp(f_arg->names[k], f_arg->want) >= 0;
+ struct refname_needle_lesseq_args *args = _args;
+ return strcmp(args->needle, args->haystack[k]) <= 0;
}
static int modification_has_ref(struct modification *mod, const char *name)
@@ -29,25 +29,23 @@ static int modification_has_ref(struct modification *mod, const char *name)
int err = 0;
if (mod->add_len > 0) {
- struct find_arg arg = {
- .names = mod->add,
- .want = name,
+ struct refname_needle_lesseq_args args = {
+ .haystack = mod->add,
+ .needle = name,
};
- int idx = binsearch(mod->add_len, find_name, &arg);
- if (idx < mod->add_len && !strcmp(mod->add[idx], name)) {
+ size_t idx = binsearch(mod->add_len, refname_needle_lesseq, &args);
+ if (idx < mod->add_len && !strcmp(mod->add[idx], name))
return 0;
- }
}
if (mod->del_len > 0) {
- struct find_arg arg = {
- .names = mod->del,
- .want = name,
+ struct refname_needle_lesseq_args args = {
+ .haystack = mod->del,
+ .needle = name,
};
- int idx = binsearch(mod->del_len, find_name, &arg);
- if (idx < mod->del_len && !strcmp(mod->del[idx], name)) {
+ size_t idx = binsearch(mod->del_len, refname_needle_lesseq, &args);
+ if (idx < mod->del_len && !strcmp(mod->del[idx], name))
return 1;
- }
}
err = reftable_table_read_ref(&mod->tab, name, &ref);
@@ -73,11 +71,11 @@ static int modification_has_ref_with_prefix(struct modification *mod,
int err = 0;
if (mod->add_len > 0) {
- struct find_arg arg = {
- .names = mod->add,
- .want = prefix,
+ struct refname_needle_lesseq_args args = {
+ .haystack = mod->add,
+ .needle = prefix,
};
- int idx = binsearch(mod->add_len, find_name, &arg);
+ size_t idx = binsearch(mod->add_len, refname_needle_lesseq, &args);
if (idx < mod->add_len &&
!strncmp(prefix, mod->add[idx], strlen(prefix)))
goto done;
@@ -92,15 +90,14 @@ static int modification_has_ref_with_prefix(struct modification *mod,
goto done;
if (mod->del_len > 0) {
- struct find_arg arg = {
- .names = mod->del,
- .want = ref.refname,
+ struct refname_needle_lesseq_args args = {
+ .haystack = mod->del,
+ .needle = ref.refname,
};
- int idx = binsearch(mod->del_len, find_name, &arg);
+ size_t idx = binsearch(mod->del_len, refname_needle_lesseq, &args);
if (idx < mod->del_len &&
- !strcmp(ref.refname, mod->del[idx])) {
+ !strcmp(ref.refname, mod->del[idx]))
continue;
- }
}
if (strncmp(ref.refname, prefix, strlen(prefix))) {
@@ -140,8 +137,8 @@ int validate_ref_record_addition(struct reftable_table tab,
{
struct modification mod = {
.tab = tab,
- .add = reftable_calloc(sizeof(char *) * sz),
- .del = reftable_calloc(sizeof(char *) * sz),
+ .add = reftable_calloc(sz, sizeof(*mod.add)),
+ .del = reftable_calloc(sz, sizeof(*mod.del)),
};
int i = 0;
int err = 0;
diff --git a/reftable/refname_test.c b/reftable/refname_test.c
index 8645cd9..b9cc625 100644
--- a/reftable/refname_test.c
+++ b/reftable/refname_test.c
@@ -9,7 +9,6 @@ https://developers.google.com/open-source/licenses/bsd
#include "basics.h"
#include "block.h"
#include "blocksource.h"
-#include "constants.h"
#include "reader.h"
#include "record.h"
#include "refname.h"
@@ -31,7 +30,7 @@ static void test_conflict(void)
struct reftable_write_options opts = { 0 };
struct strbuf buf = STRBUF_INIT;
struct reftable_writer *w =
- reftable_new_writer(&strbuf_add_void, &buf, &opts);
+ reftable_new_writer(&strbuf_add_void, &noop_flush, &buf, &opts);
struct reftable_ref_record rec = {
.refname = "a/b",
.value_type = REFTABLE_REF_SYMREF,
diff --git a/reftable/reftable-error.h b/reftable/reftable-error.h
index 4c457aa..e9b07c9 100644
--- a/reftable/reftable-error.h
+++ b/reftable/reftable-error.h
@@ -25,7 +25,7 @@ enum reftable_error {
*/
REFTABLE_NOT_EXIST_ERROR = -4,
- /* Trying to write out-of-date data. */
+ /* Trying to access locked data. */
REFTABLE_LOCK_ERROR = -5,
/* Misuse of the API:
@@ -57,6 +57,9 @@ enum reftable_error {
/* Entry does not fit. This can happen when writing outsize reflog
messages. */
REFTABLE_ENTRY_TOO_BIG_ERROR = -11,
+
+ /* Trying to write out-of-date data. */
+ REFTABLE_OUTDATED_ERROR = -12,
};
/* convert the numeric error code to a string. The string should not be
diff --git a/reftable/reftable-merged.h b/reftable/reftable-merged.h
index 1a6d169..c91a2d8 100644
--- a/reftable/reftable-merged.h
+++ b/reftable/reftable-merged.h
@@ -33,7 +33,7 @@ struct reftable_table;
the stack array.
*/
int reftable_new_merged_table(struct reftable_merged_table **dest,
- struct reftable_table *stack, int n,
+ struct reftable_table *stack, size_t n,
uint32_t hash_id);
/* returns an iterator positioned just before 'name' */
diff --git a/reftable/reftable-record.h b/reftable/reftable-record.h
index 67104f8..2a2943c 100644
--- a/reftable/reftable-record.h
+++ b/reftable/reftable-record.h
@@ -9,6 +9,7 @@ https://developers.google.com/open-source/licenses/bsd
#ifndef REFTABLE_RECORD_H
#define REFTABLE_RECORD_H
+#include "hash-ll.h"
#include <stdint.h>
/*
@@ -21,6 +22,7 @@ https://developers.google.com/open-source/licenses/bsd
/* reftable_ref_record holds a ref database entry target_value */
struct reftable_ref_record {
char *refname; /* Name of the ref, malloced. */
+ size_t refname_cap;
uint64_t update_index; /* Logical timestamp at which this value is
* written */
@@ -38,10 +40,10 @@ struct reftable_ref_record {
#define REFTABLE_NR_REF_VALUETYPES 4
} value_type;
union {
- uint8_t *val1; /* malloced hash. */
+ unsigned char val1[GIT_MAX_RAWSZ];
struct {
- uint8_t *value; /* first value, malloced hash */
- uint8_t *target_value; /* second value, malloced hash */
+ unsigned char value[GIT_MAX_RAWSZ]; /* first hash */
+ unsigned char target_value[GIT_MAX_RAWSZ]; /* second hash */
} val2;
char *symref; /* referent, malloced 0-terminated string */
} value;
@@ -49,11 +51,11 @@ struct reftable_ref_record {
/* Returns the first hash, or NULL if `rec` is not of type
* REFTABLE_REF_VAL1 or REFTABLE_REF_VAL2. */
-uint8_t *reftable_ref_record_val1(const struct reftable_ref_record *rec);
+const unsigned char *reftable_ref_record_val1(const struct reftable_ref_record *rec);
/* Returns the second hash, or NULL if `rec` is not of type
* REFTABLE_REF_VAL2. */
-uint8_t *reftable_ref_record_val2(const struct reftable_ref_record *rec);
+const unsigned char *reftable_ref_record_val2(const struct reftable_ref_record *rec);
/* returns whether 'ref' represents a deletion */
int reftable_ref_record_is_deletion(const struct reftable_ref_record *ref);
@@ -72,6 +74,7 @@ int reftable_ref_record_equal(const struct reftable_ref_record *a,
/* reftable_log_record holds a reflog entry */
struct reftable_log_record {
char *refname;
+ size_t refname_cap;
uint64_t update_index; /* logical timestamp of a transactional update.
*/
@@ -86,13 +89,14 @@ struct reftable_log_record {
union {
struct {
- uint8_t *new_hash;
- uint8_t *old_hash;
+ unsigned char new_hash[GIT_MAX_RAWSZ];
+ unsigned char old_hash[GIT_MAX_RAWSZ];
char *name;
char *email;
uint64_t time;
int16_t tz_offset;
char *message;
+ size_t message_cap;
} update;
} value;
};
diff --git a/reftable/reftable-writer.h b/reftable/reftable-writer.h
index db8de19..155bf0b 100644
--- a/reftable/reftable-writer.h
+++ b/reftable/reftable-writer.h
@@ -46,6 +46,9 @@ struct reftable_write_options {
* is a single line, and add '\n' if missing.
*/
unsigned exact_log_message : 1;
+
+ /* boolean: Prevent auto-compaction of tables. */
+ unsigned disable_auto_compact : 1;
};
/* reftable_block_stats holds statistics for a single block type */
@@ -88,6 +91,7 @@ struct reftable_stats {
/* reftable_new_writer creates a new writer */
struct reftable_writer *
reftable_new_writer(ssize_t (*writer_func)(void *, const void *, size_t),
+ int (*flush_func)(void *),
void *writer_arg, struct reftable_write_options *opts);
/* Set the range of update indices for the records we will add. When writing a
diff --git a/reftable/stack.c b/reftable/stack.c
index ddbdf1b..80266bc 100644
--- a/reftable/stack.c
+++ b/reftable/stack.c
@@ -8,6 +8,7 @@ https://developers.google.com/open-source/licenses/bsd
#include "stack.h"
+#include "../write-or-die.h"
#include "system.h"
#include "merged.h"
#include "reader.h"
@@ -16,13 +17,15 @@ 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,
void *arg),
void *arg);
static int stack_write_compact(struct reftable_stack *st,
- struct reftable_writer *wr, int first, int last,
+ struct reftable_writer *wr,
+ size_t first, size_t last,
struct reftable_log_expiry_config *config);
static int stack_check_addition(struct reftable_stack *st,
const char *new_tab_name);
@@ -42,14 +45,20 @@ static void stack_filename(struct strbuf *dest, struct reftable_stack *st,
static ssize_t reftable_fd_write(void *arg, const void *data, size_t sz)
{
int *fdp = (int *)arg;
- return write(*fdp, data, sz);
+ return write_in_full(*fdp, data, sz);
+}
+
+static int reftable_fd_flush(void *arg)
+{
+ int *fdp = (int *)arg;
+
+ return fsync_component(FSYNC_COMPONENT_REFERENCE, *fdp);
}
int reftable_new_stack(struct reftable_stack **dest, const char *dir,
struct reftable_write_options config)
{
- struct reftable_stack *p =
- reftable_calloc(sizeof(struct reftable_stack));
+ struct reftable_stack *p = reftable_calloc(1, sizeof(*p));
struct strbuf list_file_name = STRBUF_INIT;
int err = 0;
@@ -64,6 +73,7 @@ int reftable_new_stack(struct reftable_stack **dest, const char *dir,
strbuf_addstr(&list_file_name, "/tables.list");
p->list_file = strbuf_detach(&list_file_name, NULL);
+ p->list_fd = -1;
p->reftable_dir = xstrdup(dir);
p->config = config;
@@ -91,8 +101,8 @@ static int fd_read_lines(int fd, char ***namesp)
goto done;
}
- buf = reftable_malloc(size + 1);
- if (read(fd, buf, size) != size) {
+ REFTABLE_ALLOC_ARRAY(buf, size + 1);
+ if (read_in_full(fd, buf, size) != size) {
err = REFTABLE_IO_ERROR;
goto done;
}
@@ -111,7 +121,7 @@ int read_lines(const char *filename, char ***namesp)
int err = 0;
if (fd < 0) {
if (errno == ENOENT) {
- *namesp = reftable_calloc(sizeof(char *));
+ REFTABLE_CALLOC_ARRAY(*namesp, 1);
return 0;
}
@@ -173,6 +183,12 @@ void reftable_stack_destroy(struct reftable_stack *st)
st->readers_len = 0;
FREE_AND_NULL(st->readers);
}
+
+ if (st->list_fd >= 0) {
+ close(st->list_fd);
+ st->list_fd = -1;
+ }
+
FREE_AND_NULL(st->list_file);
FREE_AND_NULL(st->reftable_dir);
reftable_free(st);
@@ -182,8 +198,7 @@ void reftable_stack_destroy(struct reftable_stack *st)
static struct reftable_reader **stack_copy_readers(struct reftable_stack *st,
int cur_len)
{
- struct reftable_reader **cur =
- reftable_calloc(sizeof(struct reftable_reader *) * cur_len);
+ struct reftable_reader **cur = reftable_calloc(cur_len, sizeof(*cur));
int i = 0;
for (i = 0; i < cur_len; i++) {
cur[i] = st->readers[i];
@@ -194,17 +209,18 @@ static struct reftable_reader **stack_copy_readers(struct reftable_stack *st,
static int reftable_stack_reload_once(struct reftable_stack *st, char **names,
int reuse_open)
{
- int cur_len = !st->merged ? 0 : st->merged->stack_len;
+ size_t cur_len = !st->merged ? 0 : st->merged->stack_len;
struct reftable_reader **cur = stack_copy_readers(st, cur_len);
- int err = 0;
- int names_len = names_length(names);
+ size_t names_len = names_length(names);
struct reftable_reader **new_readers =
- reftable_calloc(sizeof(struct reftable_reader *) * names_len);
+ reftable_calloc(names_len, sizeof(*new_readers));
struct reftable_table *new_tables =
- reftable_calloc(sizeof(struct reftable_table) * names_len);
- int new_readers_len = 0;
+ reftable_calloc(names_len, sizeof(*new_tables));
+ size_t new_readers_len = 0;
struct reftable_merged_table *new_merged = NULL;
- int i;
+ struct strbuf table_path = STRBUF_INIT;
+ int err = 0;
+ size_t i;
while (*names) {
struct reftable_reader *rd = NULL;
@@ -212,24 +228,20 @@ static int reftable_stack_reload_once(struct reftable_stack *st, char **names,
/* this is linear; we assume compaction keeps the number of
tables under control so this is not quadratic. */
- int j = 0;
- for (j = 0; reuse_open && j < cur_len; j++) {
- if (cur[j] && 0 == strcmp(cur[j]->name, name)) {
- rd = cur[j];
- cur[j] = NULL;
+ for (i = 0; reuse_open && i < cur_len; i++) {
+ if (cur[i] && 0 == strcmp(cur[i]->name, name)) {
+ rd = cur[i];
+ cur[i] = NULL;
break;
}
}
if (!rd) {
struct reftable_block_source src = { NULL };
- struct strbuf table_path = STRBUF_INIT;
stack_filename(&table_path, st, name);
err = reftable_block_source_from_file(&src,
table_path.buf);
- strbuf_release(&table_path);
-
if (err < 0)
goto done;
@@ -267,16 +279,13 @@ static int reftable_stack_reload_once(struct reftable_stack *st, char **names,
for (i = 0; i < cur_len; i++) {
if (cur[i]) {
const char *name = reader_name(cur[i]);
- struct strbuf filename = STRBUF_INIT;
- stack_filename(&filename, st, name);
+ stack_filename(&table_path, st, name);
reader_close(cur[i]);
reftable_reader_free(cur[i]);
/* On Windows, can only unlink after closing. */
- unlink(filename.buf);
-
- strbuf_release(&filename);
+ unlink(table_path.buf);
}
}
@@ -288,6 +297,7 @@ done:
reftable_free(new_readers);
reftable_free(new_tables);
reftable_free(cur);
+ strbuf_release(&table_path);
return err;
}
@@ -306,69 +316,134 @@ static int tv_cmp(struct timeval *a, struct timeval *b)
static int reftable_stack_reload_maybe_reuse(struct reftable_stack *st,
int reuse_open)
{
- struct timeval deadline = { 0 };
- int err = gettimeofday(&deadline, NULL);
+ char **names = NULL, **names_after = NULL;
+ struct timeval deadline;
int64_t delay = 0;
- int tries = 0;
- if (err < 0)
- return err;
+ int tries = 0, err;
+ int fd = -1;
+ err = gettimeofday(&deadline, NULL);
+ if (err < 0)
+ goto out;
deadline.tv_sec += 3;
+
while (1) {
- char **names = NULL;
- char **names_after = NULL;
- struct timeval now = { 0 };
- int err = gettimeofday(&now, NULL);
- int err2 = 0;
- if (err < 0) {
- return err;
- }
+ struct timeval now;
+
+ err = gettimeofday(&now, NULL);
+ if (err < 0)
+ goto out;
- /* Only look at deadlines after the first few times. This
- simplifies debugging in GDB */
+ /*
+ * Only look at deadlines after the first few times. This
+ * simplifies debugging in GDB.
+ */
tries++;
- if (tries > 3 && tv_cmp(&now, &deadline) >= 0) {
- break;
- }
+ if (tries > 3 && tv_cmp(&now, &deadline) >= 0)
+ goto out;
- err = read_lines(st->list_file, &names);
- if (err < 0) {
- free_names(names);
- return err;
- }
- err = reftable_stack_reload_once(st, names, reuse_open);
- if (err == 0) {
- free_names(names);
- break;
- }
- if (err != REFTABLE_NOT_EXIST_ERROR) {
- free_names(names);
- return err;
- }
+ fd = open(st->list_file, O_RDONLY);
+ if (fd < 0) {
+ if (errno != ENOENT) {
+ err = REFTABLE_IO_ERROR;
+ goto out;
+ }
- /* err == REFTABLE_NOT_EXIST_ERROR can be caused by a concurrent
- writer. Check if there was one by checking if the name list
- changed.
- */
- err2 = read_lines(st->list_file, &names_after);
- if (err2 < 0) {
- free_names(names);
- return err2;
+ REFTABLE_CALLOC_ARRAY(names, 1);
+ } else {
+ err = fd_read_lines(fd, &names);
+ if (err < 0)
+ goto out;
}
+ err = reftable_stack_reload_once(st, names, reuse_open);
+ if (!err)
+ break;
+ if (err != REFTABLE_NOT_EXIST_ERROR)
+ goto out;
+
+ /*
+ * REFTABLE_NOT_EXIST_ERROR can be caused by a concurrent
+ * writer. Check if there was one by checking if the name list
+ * changed.
+ */
+ err = read_lines(st->list_file, &names_after);
+ if (err < 0)
+ goto out;
if (names_equal(names_after, names)) {
- free_names(names);
- free_names(names_after);
- return err;
+ err = REFTABLE_NOT_EXIST_ERROR;
+ goto out;
}
+
free_names(names);
+ names = NULL;
free_names(names_after);
+ names_after = NULL;
+ close(fd);
+ fd = -1;
delay = delay + (delay * rand()) / RAND_MAX + 1;
sleep_millisec(delay);
}
- return 0;
+out:
+ /*
+ * Invalidate the stat cache. It is sufficient to only close the file
+ * descriptor and keep the cached stat info because we never use the
+ * latter when the former is negative.
+ */
+ if (st->list_fd >= 0) {
+ close(st->list_fd);
+ st->list_fd = -1;
+ }
+
+ /*
+ * Cache stat information in case it provides a useful signal to us.
+ * According to POSIX, "The st_ino and st_dev fields taken together
+ * uniquely identify the file within the system." That being said,
+ * Windows is not POSIX compliant and we do not have these fields
+ * available. So the information we have there is insufficient to
+ * determine whether two file descriptors point to the same file.
+ *
+ * While we could fall back to using other signals like the file's
+ * mtime, those are not sufficient to avoid races. We thus refrain from
+ * using the stat cache on such systems and fall back to the secondary
+ * caching mechanism, which is to check whether contents of the file
+ * have changed.
+ *
+ * On other systems which are POSIX compliant we must keep the file
+ * descriptor open. This is to avoid a race condition where two
+ * processes access the reftable stack at the same point in time:
+ *
+ * 1. A reads the reftable stack and caches its stat info.
+ *
+ * 2. B updates the stack, appending a new table to "tables.list".
+ * This will both use a new inode and result in a different file
+ * size, thus invalidating A's cache in theory.
+ *
+ * 3. B decides to auto-compact the stack and merges two tables. The
+ * file size now matches what A has cached again. Furthermore, the
+ * filesystem may decide to recycle the inode number of the file
+ * we have replaced in (2) because it is not in use anymore.
+ *
+ * 4. A reloads the reftable stack. Neither the inode number nor the
+ * file size changed. If the timestamps did not change either then
+ * we think the cached copy of our stack is up-to-date.
+ *
+ * By keeping the file descriptor open the inode number cannot be
+ * recycled, mitigating the race.
+ */
+ if (!err && fd >= 0 && !fstat(fd, &st->list_st) &&
+ st->list_st.st_dev && st->list_st.st_ino) {
+ st->list_fd = fd;
+ fd = -1;
+ }
+
+ if (fd >= 0)
+ close(fd);
+ free_names(names);
+ free_names(names_after);
+ return err;
}
/* -1 = error
@@ -377,8 +452,44 @@ static int reftable_stack_reload_maybe_reuse(struct reftable_stack *st,
static int stack_uptodate(struct reftable_stack *st)
{
char **names = NULL;
- int err = read_lines(st->list_file, &names);
+ int err;
int i = 0;
+
+ /*
+ * When we have cached stat information available then we use it to
+ * verify whether the file has been rewritten.
+ *
+ * Note that we explicitly do not want to use `stat_validity_check()`
+ * and friends here because they may end up not comparing the `st_dev`
+ * and `st_ino` fields. These functions thus cannot guarantee that we
+ * indeed still have the same file.
+ */
+ if (st->list_fd >= 0) {
+ struct stat list_st;
+
+ if (stat(st->list_file, &list_st) < 0) {
+ /*
+ * It's fine for "tables.list" to not exist. In that
+ * case, we have to refresh when the loaded stack has
+ * any readers.
+ */
+ if (errno == ENOENT)
+ return !!st->readers_len;
+ return REFTABLE_IO_ERROR;
+ }
+
+ /*
+ * When "tables.list" refers to the same file we can assume
+ * that it didn't change. This is because we always use
+ * rename(3P) to update the file and never write to it
+ * directly.
+ */
+ if (st->list_st.st_dev == list_st.st_dev &&
+ st->list_st.st_ino == list_st.st_ino)
+ return 0;
+ }
+
+ err = read_lines(st->list_file, &names);
if (err < 0)
return err;
@@ -418,25 +529,22 @@ int reftable_stack_add(struct reftable_stack *st,
{
int err = stack_try_add(st, write, arg);
if (err < 0) {
- if (err == REFTABLE_LOCK_ERROR) {
+ if (err == REFTABLE_OUTDATED_ERROR) {
/* Ignore error return, we want to propagate
- REFTABLE_LOCK_ERROR.
+ REFTABLE_OUTDATED_ERROR.
*/
reftable_stack_reload(st);
}
return err;
}
- if (!st->disable_auto_compact)
- return reftable_stack_auto_compact(st);
-
return 0;
}
static void format_name(struct strbuf *dest, uint64_t min, uint64_t max)
{
char buf[100];
- uint32_t rnd = (uint32_t)rand();
+ uint32_t rnd = (uint32_t)git_rand();
snprintf(buf, sizeof(buf), "0x%012" PRIx64 "-0x%012" PRIx64 "-%08x",
min, max, rnd);
strbuf_reset(dest);
@@ -444,33 +552,27 @@ static void format_name(struct strbuf *dest, uint64_t min, uint64_t max)
}
struct reftable_addition {
- int lock_file_fd;
- struct strbuf lock_file_name;
+ struct tempfile *lock_file;
struct reftable_stack *stack;
char **new_tables;
- int new_tables_len;
+ size_t new_tables_len, new_tables_cap;
uint64_t next_update_index;
};
-#define REFTABLE_ADDITION_INIT \
- { \
- .lock_file_name = STRBUF_INIT \
- }
+#define REFTABLE_ADDITION_INIT {0}
static int reftable_stack_init_addition(struct reftable_addition *add,
struct reftable_stack *st)
{
+ struct strbuf lock_file_name = STRBUF_INIT;
int err = 0;
add->stack = st;
- strbuf_reset(&add->lock_file_name);
- strbuf_addstr(&add->lock_file_name, st->list_file);
- strbuf_addstr(&add->lock_file_name, ".lock");
+ strbuf_addf(&lock_file_name, "%s.lock", st->list_file);
- add->lock_file_fd = open(add->lock_file_name.buf,
- O_EXCL | O_CREAT | O_WRONLY, 0666);
- if (add->lock_file_fd < 0) {
+ add->lock_file = create_tempfile(lock_file_name.buf);
+ if (!add->lock_file) {
if (errno == EEXIST) {
err = REFTABLE_LOCK_ERROR;
} else {
@@ -479,7 +581,7 @@ static int reftable_stack_init_addition(struct reftable_addition *add,
goto done;
}
if (st->config.default_permissions) {
- if (chmod(add->lock_file_name.buf, st->config.default_permissions) < 0) {
+ if (chmod(add->lock_file->filename.buf, st->config.default_permissions) < 0) {
err = REFTABLE_IO_ERROR;
goto done;
}
@@ -488,9 +590,8 @@ static int reftable_stack_init_addition(struct reftable_addition *add,
err = stack_uptodate(st);
if (err < 0)
goto done;
-
- if (err > 1) {
- err = REFTABLE_LOCK_ERROR;
+ if (err > 0) {
+ err = REFTABLE_OUTDATED_ERROR;
goto done;
}
@@ -499,13 +600,15 @@ done:
if (err) {
reftable_addition_close(add);
}
+ strbuf_release(&lock_file_name);
return err;
}
static void reftable_addition_close(struct reftable_addition *add)
{
- int i = 0;
struct strbuf nm = STRBUF_INIT;
+ size_t i;
+
for (i = 0; i < add->new_tables_len; i++) {
stack_filename(&nm, add->stack, add->new_tables[i]);
unlink(nm.buf);
@@ -515,16 +618,9 @@ static void reftable_addition_close(struct reftable_addition *add)
reftable_free(add->new_tables);
add->new_tables = NULL;
add->new_tables_len = 0;
+ add->new_tables_cap = 0;
- if (add->lock_file_fd > 0) {
- close(add->lock_file_fd);
- add->lock_file_fd = 0;
- }
- if (add->lock_file_name.len > 0) {
- unlink(add->lock_file_name.buf);
- strbuf_release(&add->lock_file_name);
- }
-
+ delete_tempfile(&add->lock_file);
strbuf_release(&nm);
}
@@ -540,8 +636,10 @@ void reftable_addition_destroy(struct reftable_addition *add)
int reftable_addition_commit(struct reftable_addition *add)
{
struct strbuf table_list = STRBUF_INIT;
- int i = 0;
+ int lock_file_fd = get_tempfile_fd(add->lock_file);
int err = 0;
+ size_t i;
+
if (add->new_tables_len == 0)
goto done;
@@ -554,36 +652,48 @@ int reftable_addition_commit(struct reftable_addition *add)
strbuf_addstr(&table_list, "\n");
}
- err = write(add->lock_file_fd, table_list.buf, table_list.len);
+ err = write_in_full(lock_file_fd, table_list.buf, table_list.len);
strbuf_release(&table_list);
if (err < 0) {
err = REFTABLE_IO_ERROR;
goto done;
}
- err = close(add->lock_file_fd);
- add->lock_file_fd = 0;
- if (err < 0) {
- err = REFTABLE_IO_ERROR;
- goto done;
- }
+ fsync_component_or_die(FSYNC_COMPONENT_REFERENCE, lock_file_fd,
+ get_tempfile_path(add->lock_file));
- err = rename(add->lock_file_name.buf, add->stack->list_file);
+ err = rename_tempfile(&add->lock_file, add->stack->list_file);
if (err < 0) {
err = REFTABLE_IO_ERROR;
goto done;
}
/* success, no more state to clean up. */
- strbuf_release(&add->lock_file_name);
- for (i = 0; i < add->new_tables_len; i++) {
+ for (i = 0; i < add->new_tables_len; i++)
reftable_free(add->new_tables[i]);
- }
reftable_free(add->new_tables);
add->new_tables = NULL;
add->new_tables_len = 0;
+ add->new_tables_cap = 0;
+
+ err = reftable_stack_reload_maybe_reuse(add->stack, 1);
+ if (err)
+ goto done;
+
+ if (!add->stack->config.disable_auto_compact) {
+ /*
+ * Auto-compact the stack to keep the number of tables in
+ * control. It is possible that a concurrent writer is already
+ * trying to compact parts of the stack, which would lead to a
+ * `REFTABLE_LOCK_ERROR` because parts of the stack are locked
+ * already. This is a benign error though, so we ignore it.
+ */
+ err = reftable_stack_auto_compact(add->stack);
+ if (err < 0 && err != REFTABLE_LOCK_ERROR)
+ goto done;
+ err = 0;
+ }
- err = reftable_stack_reload(add->stack);
done:
reftable_addition_close(add);
return err;
@@ -594,7 +704,7 @@ int reftable_stack_new_addition(struct reftable_addition **dest,
{
int err = 0;
struct reftable_addition empty = REFTABLE_ADDITION_INIT;
- *dest = reftable_calloc(sizeof(**dest));
+ REFTABLE_CALLOC_ARRAY(*dest, 1);
**dest = empty;
err = reftable_stack_init_addition(*dest, st);
if (err) {
@@ -613,10 +723,6 @@ static int stack_try_add(struct reftable_stack *st,
int err = reftable_stack_init_addition(&add, st);
if (err < 0)
goto done;
- if (err > 0) {
- err = REFTABLE_LOCK_ERROR;
- goto done;
- }
err = reftable_addition_add(&add, write_table, arg);
if (err < 0)
@@ -637,8 +743,9 @@ int reftable_addition_add(struct reftable_addition *add,
struct strbuf tab_file_name = STRBUF_INIT;
struct strbuf next_name = STRBUF_INIT;
struct reftable_writer *wr = NULL;
+ struct tempfile *tab_file = NULL;
int err = 0;
- int tab_fd = 0;
+ int tab_fd;
strbuf_reset(&next_name);
format_name(&next_name, add->next_update_index, add->next_update_index);
@@ -646,18 +753,21 @@ int reftable_addition_add(struct reftable_addition *add,
stack_filename(&temp_tab_file_name, add->stack, next_name.buf);
strbuf_addstr(&temp_tab_file_name, ".temp.XXXXXX");
- tab_fd = mkstemp(temp_tab_file_name.buf);
- if (tab_fd < 0) {
+ tab_file = mks_tempfile(temp_tab_file_name.buf);
+ if (!tab_file) {
err = REFTABLE_IO_ERROR;
goto done;
}
if (add->stack->config.default_permissions) {
- if (chmod(temp_tab_file_name.buf, add->stack->config.default_permissions)) {
+ if (chmod(get_tempfile_path(tab_file),
+ add->stack->config.default_permissions)) {
err = REFTABLE_IO_ERROR;
goto done;
}
}
- wr = reftable_new_writer(reftable_fd_write, &tab_fd,
+ tab_fd = get_tempfile_fd(tab_file);
+
+ wr = reftable_new_writer(reftable_fd_write, reftable_fd_flush, &tab_fd,
&add->stack->config);
err = write_table(wr, arg);
if (err < 0)
@@ -671,14 +781,13 @@ int reftable_addition_add(struct reftable_addition *add,
if (err < 0)
goto done;
- err = close(tab_fd);
- tab_fd = 0;
+ err = close_tempfile_gently(tab_file);
if (err < 0) {
err = REFTABLE_IO_ERROR;
goto done;
}
- err = stack_check_addition(add->stack, temp_tab_file_name.buf);
+ err = stack_check_addition(add->stack, get_tempfile_path(tab_file));
if (err < 0)
goto done;
@@ -689,33 +798,23 @@ int reftable_addition_add(struct reftable_addition *add,
format_name(&next_name, wr->min_update_index, wr->max_update_index);
strbuf_addstr(&next_name, ".ref");
-
stack_filename(&tab_file_name, add->stack, next_name.buf);
/*
On windows, this relies on rand() picking a unique destination name.
Maybe we should do retry loop as well?
*/
- err = rename(temp_tab_file_name.buf, tab_file_name.buf);
+ err = rename_tempfile(&tab_file, tab_file_name.buf);
if (err < 0) {
err = REFTABLE_IO_ERROR;
goto done;
}
- add->new_tables = reftable_realloc(add->new_tables,
- sizeof(*add->new_tables) *
- (add->new_tables_len + 1));
- add->new_tables[add->new_tables_len] = strbuf_detach(&next_name, NULL);
- add->new_tables_len++;
+ REFTABLE_ALLOC_GROW(add->new_tables, add->new_tables_len + 1,
+ add->new_tables_cap);
+ add->new_tables[add->new_tables_len++] = strbuf_detach(&next_name, NULL);
done:
- if (tab_fd > 0) {
- close(tab_fd);
- tab_fd = 0;
- }
- if (temp_tab_file_name.len > 0) {
- unlink(temp_tab_file_name.buf);
- }
-
+ delete_tempfile(&tab_file);
strbuf_release(&temp_tab_file_name);
strbuf_release(&tab_file_name);
strbuf_release(&next_name);
@@ -732,66 +831,77 @@ uint64_t reftable_stack_next_update_index(struct reftable_stack *st)
return 1;
}
-static int stack_compact_locked(struct reftable_stack *st, int first, int last,
- struct strbuf *temp_tab,
- struct reftable_log_expiry_config *config)
+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 strbuf next_name = STRBUF_INIT;
- int tab_fd = -1;
+ struct strbuf tab_file_path = STRBUF_INIT;
struct reftable_writer *wr = NULL;
- int err = 0;
+ struct tempfile *tab_file;
+ int tab_fd, err = 0;
format_name(&next_name,
reftable_reader_min_update_index(st->readers[first]),
reftable_reader_max_update_index(st->readers[last]));
+ stack_filename(&tab_file_path, st, next_name.buf);
+ strbuf_addstr(&tab_file_path, ".temp.XXXXXX");
- stack_filename(temp_tab, st, next_name.buf);
- strbuf_addstr(temp_tab, ".temp.XXXXXX");
+ tab_file = mks_tempfile(tab_file_path.buf);
+ if (!tab_file) {
+ err = REFTABLE_IO_ERROR;
+ goto done;
+ }
+ tab_fd = get_tempfile_fd(tab_file);
- tab_fd = mkstemp(temp_tab->buf);
- wr = reftable_new_writer(reftable_fd_write, &tab_fd, &st->config);
+ if (st->config.default_permissions &&
+ chmod(get_tempfile_path(tab_file), st->config.default_permissions) < 0) {
+ err = REFTABLE_IO_ERROR;
+ goto done;
+ }
+ wr = reftable_new_writer(reftable_fd_write, reftable_fd_flush,
+ &tab_fd, &st->config);
err = stack_write_compact(st, wr, first, last, config);
if (err < 0)
goto done;
+
err = reftable_writer_close(wr);
if (err < 0)
goto done;
- err = close(tab_fd);
- tab_fd = 0;
+ err = close_tempfile_gently(tab_file);
+ if (err < 0)
+ goto done;
+
+ *tab_file_out = tab_file;
+ tab_file = NULL;
done:
+ delete_tempfile(&tab_file);
reftable_writer_free(wr);
- if (tab_fd > 0) {
- close(tab_fd);
- tab_fd = 0;
- }
- if (err != 0 && temp_tab->len > 0) {
- unlink(temp_tab->buf);
- strbuf_release(temp_tab);
- }
strbuf_release(&next_name);
+ strbuf_release(&tab_file_path);
return err;
}
static int stack_write_compact(struct reftable_stack *st,
- struct reftable_writer *wr, int first, int last,
+ struct reftable_writer *wr,
+ size_t first, size_t last,
struct reftable_log_expiry_config *config)
{
- int subtabs_len = last - first + 1;
+ size_t subtabs_len = last - first + 1;
struct reftable_table *subtabs = reftable_calloc(
- sizeof(struct reftable_table) * (last - first + 1));
+ last - first + 1, sizeof(*subtabs));
struct reftable_merged_table *mt = NULL;
- int err = 0;
struct reftable_iterator it = { NULL };
struct reftable_ref_record ref = { NULL };
struct reftable_log_record log = { NULL };
-
uint64_t entries = 0;
+ int err = 0;
- int i = 0, j = 0;
- for (i = first, j = 0; i <= last; i++) {
+ for (size_t i = first, j = 0; i <= last; i++) {
struct reftable_reader *t = st->readers[i];
reftable_table_from_reader(&subtabs[j++], t);
st->stats.bytes += t->size;
@@ -816,18 +926,16 @@ static int stack_write_compact(struct reftable_stack *st,
err = 0;
break;
}
- if (err < 0) {
- break;
- }
+ if (err < 0)
+ goto done;
if (first == 0 && reftable_ref_record_is_deletion(&ref)) {
continue;
}
err = reftable_writer_add_ref(wr, &ref);
- if (err < 0) {
- break;
- }
+ if (err < 0)
+ goto done;
entries++;
}
reftable_iterator_destroy(&it);
@@ -842,9 +950,8 @@ static int stack_write_compact(struct reftable_stack *st,
err = 0;
break;
}
- if (err < 0) {
- break;
- }
+ if (err < 0)
+ goto done;
if (first == 0 && reftable_log_record_is_deletion(&log)) {
continue;
}
@@ -860,9 +967,8 @@ static int stack_write_compact(struct reftable_stack *st,
}
err = reftable_writer_add_log(wr, &log);
- if (err < 0) {
- break;
- }
+ if (err < 0)
+ goto done;
entries++;
}
@@ -878,27 +984,28 @@ done:
return err;
}
-/* < 0: error. 0 == OK, > 0 attempt failed; could retry. */
-static int stack_compact_range(struct reftable_stack *st, int first, int last,
+/*
+ * Compact all tables in the range `[first, last)` into a single new table.
+ *
+ * This function returns `0` on success or a code `< 0` on failure. When the
+ * stack or any of the tables in the specified range are already locked then
+ * this function returns `REFTABLE_LOCK_ERROR`. This is a benign error that
+ * callers can either ignore, or they may choose to retry compaction after some
+ * amount of time.
+ */
+static int stack_compact_range(struct reftable_stack *st,
+ size_t first, size_t last,
struct reftable_log_expiry_config *expiry)
{
- struct strbuf temp_tab_file_name = STRBUF_INIT;
+ struct strbuf tables_list_buf = STRBUF_INIT;
struct strbuf new_table_name = STRBUF_INIT;
- struct strbuf lock_file_name = STRBUF_INIT;
- struct strbuf ref_list_contents = STRBUF_INIT;
struct strbuf new_table_path = STRBUF_INIT;
- int err = 0;
- int have_lock = 0;
- int lock_file_fd = -1;
- int compact_count = last - first + 1;
- char **listp = NULL;
- char **delete_on_success =
- reftable_calloc(sizeof(char *) * (compact_count + 1));
- char **subtable_locks =
- reftable_calloc(sizeof(char *) * (compact_count + 1));
- int i = 0;
- int j = 0;
- int is_empty_table = 0;
+ struct strbuf table_name = STRBUF_INIT;
+ struct lock_file tables_list_lock = LOCK_INIT;
+ struct lock_file *table_locks = NULL;
+ struct tempfile *new_table = NULL;
+ int is_empty_table = 0, err = 0;
+ size_t i;
if (first > last || (!expiry && first == last)) {
err = 0;
@@ -907,196 +1014,200 @@ static int stack_compact_range(struct reftable_stack *st, int first, int last,
st->stats.attempts++;
- strbuf_reset(&lock_file_name);
- strbuf_addstr(&lock_file_name, st->list_file);
- strbuf_addstr(&lock_file_name, ".lock");
-
- lock_file_fd =
- open(lock_file_name.buf, O_EXCL | O_CREAT | O_WRONLY, 0666);
- if (lock_file_fd < 0) {
- if (errno == EEXIST) {
- err = 1;
- } else {
+ /*
+ * 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(&tables_list_lock, st->list_file,
+ LOCK_NO_DEREF);
+ if (err < 0) {
+ if (errno == EEXIST)
+ err = REFTABLE_LOCK_ERROR;
+ else
err = REFTABLE_IO_ERROR;
- }
goto done;
}
- /* Don't want to write to the lock for now. */
- close(lock_file_fd);
- lock_file_fd = -1;
- have_lock = 1;
err = stack_uptodate(st);
- if (err != 0)
+ if (err)
goto done;
- for (i = first, j = 0; i <= last; i++) {
- struct strbuf subtab_file_name = STRBUF_INIT;
- struct strbuf subtab_lock = STRBUF_INIT;
- int sublock_file_fd = -1;
-
- stack_filename(&subtab_file_name, st,
- reader_name(st->readers[i]));
-
- strbuf_reset(&subtab_lock);
- strbuf_addbuf(&subtab_lock, &subtab_file_name);
- strbuf_addstr(&subtab_lock, ".lock");
-
- sublock_file_fd = open(subtab_lock.buf,
- O_EXCL | O_CREAT | O_WRONLY, 0666);
- if (sublock_file_fd >= 0) {
- close(sublock_file_fd);
- } else if (sublock_file_fd < 0) {
- if (errno == EEXIST) {
- err = 1;
- } else {
+ /*
+ * Lock all tables in the user-provided range. This is the slice of our
+ * stack which we'll compact.
+ */
+ REFTABLE_CALLOC_ARRAY(table_locks, last - first + 1);
+ for (i = first; i <= last; i++) {
+ stack_filename(&table_name, st, reader_name(st->readers[i]));
+
+ err = hold_lock_file_for_update(&table_locks[i - first],
+ table_name.buf, LOCK_NO_DEREF);
+ if (err < 0) {
+ if (errno == EEXIST)
+ err = REFTABLE_LOCK_ERROR;
+ else
err = REFTABLE_IO_ERROR;
- }
+ goto done;
}
- subtable_locks[j] = subtab_lock.buf;
- delete_on_success[j] = subtab_file_name.buf;
- j++;
-
- if (err != 0)
+ /*
+ * We need to close the lockfiles as we might otherwise easily
+ * run into file descriptor exhaustion when we compress a lot
+ * of tables.
+ */
+ err = close_lock_file_gently(&table_locks[i - first]);
+ if (err < 0) {
+ err = REFTABLE_IO_ERROR;
goto done;
+ }
}
- err = unlink(lock_file_name.buf);
- if (err < 0)
+ /*
+ * We have locked all tables in our range and can thus release the
+ * "tables.list" lock while compacting the locked tables. This allows
+ * concurrent updates to the stack to proceed.
+ */
+ err = rollback_lock_file(&tables_list_lock);
+ if (err < 0) {
+ err = REFTABLE_IO_ERROR;
goto done;
- have_lock = 0;
-
- err = stack_compact_locked(st, first, last, &temp_tab_file_name,
- expiry);
- /* Compaction + tombstones can create an empty table out of non-empty
- * tables. */
- is_empty_table = (err == REFTABLE_EMPTY_TABLE_ERROR);
- if (is_empty_table) {
- err = 0;
}
- if (err < 0)
- goto done;
- lock_file_fd =
- open(lock_file_name.buf, O_EXCL | O_CREAT | O_WRONLY, 0666);
- if (lock_file_fd < 0) {
- if (errno == EEXIST) {
- err = 1;
- } else {
+ /*
+ * Compact the now-locked tables into a new table. Note that compacting
+ * these tables may end up with an empty new table in case tombstones
+ * end up cancelling out all refs in that range.
+ */
+ err = stack_compact_locked(st, first, last, expiry, &new_table);
+ if (err < 0) {
+ if (err != REFTABLE_EMPTY_TABLE_ERROR)
+ goto done;
+ is_empty_table = 1;
+ }
+
+ /*
+ * Now that we have written the new, compacted table we need to re-lock
+ * "tables.list". We'll then replace the compacted range of tables with
+ * the new table.
+ */
+ err = hold_lock_file_for_update(&tables_list_lock, st->list_file,
+ LOCK_NO_DEREF);
+ if (err < 0) {
+ if (errno == EEXIST)
+ err = REFTABLE_LOCK_ERROR;
+ else
err = REFTABLE_IO_ERROR;
- }
goto done;
}
- have_lock = 1;
+
if (st->config.default_permissions) {
- if (chmod(lock_file_name.buf, st->config.default_permissions) < 0) {
+ if (chmod(get_lock_file_path(&tables_list_lock),
+ st->config.default_permissions) < 0) {
err = REFTABLE_IO_ERROR;
goto done;
}
}
- format_name(&new_table_name, st->readers[first]->min_update_index,
- st->readers[last]->max_update_index);
- strbuf_addstr(&new_table_name, ".ref");
-
- stack_filename(&new_table_path, st, new_table_name.buf);
-
+ /*
+ * If the resulting compacted table is not empty, then we need to move
+ * it into place now.
+ */
if (!is_empty_table) {
- /* retry? */
- err = rename(temp_tab_file_name.buf, new_table_path.buf);
+ format_name(&new_table_name, st->readers[first]->min_update_index,
+ st->readers[last]->max_update_index);
+ strbuf_addstr(&new_table_name, ".ref");
+ stack_filename(&new_table_path, st, new_table_name.buf);
+
+ err = rename_tempfile(&new_table, new_table_path.buf);
if (err < 0) {
err = REFTABLE_IO_ERROR;
goto done;
}
}
- for (i = 0; i < first; i++) {
- strbuf_addstr(&ref_list_contents, st->readers[i]->name);
- strbuf_addstr(&ref_list_contents, "\n");
- }
- if (!is_empty_table) {
- strbuf_addbuf(&ref_list_contents, &new_table_name);
- strbuf_addstr(&ref_list_contents, "\n");
- }
- for (i = last + 1; i < st->merged->stack_len; i++) {
- strbuf_addstr(&ref_list_contents, st->readers[i]->name);
- strbuf_addstr(&ref_list_contents, "\n");
- }
-
- err = write(lock_file_fd, ref_list_contents.buf, ref_list_contents.len);
+ /*
+ * Write the new "tables.list" contents with the compacted table we
+ * have just written. In case the compacted table became empty we
+ * simply skip writing it.
+ */
+ for (i = 0; i < first; i++)
+ strbuf_addf(&tables_list_buf, "%s\n", st->readers[i]->name);
+ if (!is_empty_table)
+ strbuf_addf(&tables_list_buf, "%s\n", new_table_name.buf);
+ for (i = last + 1; i < st->merged->stack_len; i++)
+ strbuf_addf(&tables_list_buf, "%s\n", st->readers[i]->name);
+
+ err = write_in_full(get_lock_file_fd(&tables_list_lock),
+ tables_list_buf.buf, tables_list_buf.len);
if (err < 0) {
err = REFTABLE_IO_ERROR;
unlink(new_table_path.buf);
goto done;
}
- err = close(lock_file_fd);
- lock_file_fd = -1;
+
+ err = fsync_component(FSYNC_COMPONENT_REFERENCE, get_lock_file_fd(&tables_list_lock));
if (err < 0) {
err = REFTABLE_IO_ERROR;
unlink(new_table_path.buf);
goto done;
}
- err = rename(lock_file_name.buf, st->list_file);
+ err = commit_lock_file(&tables_list_lock);
if (err < 0) {
err = REFTABLE_IO_ERROR;
unlink(new_table_path.buf);
goto done;
}
- have_lock = 0;
- /* Reload the stack before deleting. On windows, we can only delete the
- files after we closed them.
- */
+ /*
+ * Reload the stack before deleting the compacted tables. We can only
+ * delete the files after we closed them on Windows, so this needs to
+ * happen first.
+ */
err = reftable_stack_reload_maybe_reuse(st, first < last);
+ if (err < 0)
+ goto done;
- listp = delete_on_success;
- while (*listp) {
- if (strcmp(*listp, new_table_path.buf)) {
- unlink(*listp);
- }
- listp++;
+ /*
+ * Delete the old tables. They may still be in use by concurrent
+ * readers, so it is expected that unlinking tables may fail.
+ */
+ for (i = first; i <= last; i++) {
+ struct lock_file *table_lock = &table_locks[i - first];
+ char *table_path = get_locked_file_path(table_lock);
+ unlink(table_path);
+ free(table_path);
}
done:
- free_names(delete_on_success);
+ rollback_lock_file(&tables_list_lock);
+ for (i = first; table_locks && i <= last; i++)
+ rollback_lock_file(&table_locks[i - first]);
+ reftable_free(table_locks);
- listp = subtable_locks;
- while (*listp) {
- unlink(*listp);
- listp++;
- }
- free_names(subtable_locks);
- if (lock_file_fd >= 0) {
- close(lock_file_fd);
- lock_file_fd = -1;
- }
- if (have_lock) {
- unlink(lock_file_name.buf);
- }
+ delete_tempfile(&new_table);
strbuf_release(&new_table_name);
strbuf_release(&new_table_path);
- strbuf_release(&ref_list_contents);
- strbuf_release(&temp_tab_file_name);
- strbuf_release(&lock_file_name);
+
+ strbuf_release(&tables_list_buf);
+ strbuf_release(&table_name);
return err;
}
int reftable_stack_compact_all(struct reftable_stack *st,
struct reftable_log_expiry_config *config)
{
- return stack_compact_range(st, 0, st->merged->stack_len - 1, config);
+ return stack_compact_range(st, 0, st->merged->stack_len ?
+ st->merged->stack_len - 1 : 0, config);
}
-static int stack_compact_range_stats(struct reftable_stack *st, int first,
- int last,
+static int stack_compact_range_stats(struct reftable_stack *st,
+ size_t first, size_t last,
struct reftable_log_expiry_config *config)
{
int err = stack_compact_range(st, first, last, config);
- if (err > 0) {
+ if (err == REFTABLE_LOCK_ERROR)
st->stats.failures++;
- }
return err;
}
@@ -1105,84 +1216,82 @@ static int segment_size(struct segment *s)
return s->end - s->start;
}
-int fastlog2(uint64_t sz)
+struct segment suggest_compaction_segment(uint64_t *sizes, size_t n)
{
- int l = 0;
- if (sz == 0)
- return 0;
- for (; sz; sz /= 2) {
- l++;
- }
- return l - 1;
-}
-
-struct segment *sizes_to_segments(int *seglen, uint64_t *sizes, int n)
-{
- struct segment *segs = reftable_calloc(sizeof(struct segment) * n);
- int next = 0;
- struct segment cur = { 0 };
- int i = 0;
+ struct segment seg = { 0 };
+ uint64_t bytes;
+ size_t i;
- if (n == 0) {
- *seglen = 0;
- return segs;
- }
- for (i = 0; i < n; i++) {
- int log = fastlog2(sizes[i]);
- if (cur.log != log && cur.bytes > 0) {
- struct segment fresh = {
- .start = i,
- };
+ /*
+ * If there are no tables or only a single one then we don't have to
+ * compact anything. The sequence is geometric by definition already.
+ */
+ if (n <= 1)
+ return seg;
- segs[next++] = cur;
- cur = fresh;
+ /*
+ * Find the ending table of the compaction segment needed to restore the
+ * geometric sequence. Note that the segment end is exclusive.
+ *
+ * To do so, we iterate backwards starting from the most recent table
+ * until a valid segment end is found. If the preceding table is smaller
+ * than the current table multiplied by the geometric factor (2), the
+ * compaction segment end has been identified.
+ *
+ * Tables after the ending point are not added to the byte count because
+ * they are already valid members of the geometric sequence. Due to the
+ * properties of a geometric sequence, it is not possible for the sum of
+ * these tables to exceed the value of the ending point table.
+ *
+ * Example table size sequence requiring no compaction:
+ * 64, 32, 16, 8, 4, 2, 1
+ *
+ * Example table size sequence where compaction segment end is set to
+ * the last table. Since the segment end is exclusive, the last table is
+ * excluded during subsequent compaction and the table with size 3 is
+ * the final table included:
+ * 64, 32, 16, 8, 4, 3, 1
+ */
+ for (i = n - 1; i > 0; i--) {
+ if (sizes[i - 1] < sizes[i] * 2) {
+ seg.end = i + 1;
+ bytes = sizes[i];
+ break;
}
-
- cur.log = log;
- cur.end = i + 1;
- cur.bytes += sizes[i];
}
- segs[next++] = cur;
- *seglen = next;
- return segs;
-}
-struct segment suggest_compaction_segment(uint64_t *sizes, int n)
-{
- int seglen = 0;
- struct segment *segs = sizes_to_segments(&seglen, sizes, n);
- struct segment min_seg = {
- .log = 64,
- };
- int i = 0;
- for (i = 0; i < seglen; i++) {
- if (segment_size(&segs[i]) == 1) {
- continue;
- }
-
- if (segs[i].log < min_seg.log) {
- min_seg = segs[i];
- }
- }
+ /*
+ * Find the starting table of the compaction segment by iterating
+ * through the remaining tables and keeping track of the accumulated
+ * size of all tables seen from the segment end table. The previous
+ * table is compared to the accumulated size because the tables from the
+ * segment end are merged backwards recursively.
+ *
+ * Note that we keep iterating even after we have found the first
+ * starting point. This is because there may be tables in the stack
+ * preceding that first starting point which violate the geometric
+ * sequence.
+ *
+ * Example compaction segment start set to table with size 32:
+ * 128, 32, 16, 8, 4, 3, 1
+ */
+ for (; i > 0; i--) {
+ uint64_t curr = bytes;
+ bytes += sizes[i - 1];
- while (min_seg.start > 0) {
- int prev = min_seg.start - 1;
- if (fastlog2(min_seg.bytes) < fastlog2(sizes[prev])) {
- break;
+ if (sizes[i - 1] < curr * 2) {
+ seg.start = i - 1;
+ seg.bytes = bytes;
}
-
- min_seg.start = prev;
- min_seg.bytes += sizes[prev];
}
- reftable_free(segs);
- return min_seg;
+ return seg;
}
static uint64_t *stack_table_sizes_for_compaction(struct reftable_stack *st)
{
uint64_t *sizes =
- reftable_calloc(sizeof(uint64_t) * st->merged->stack_len);
+ reftable_calloc(st->merged->stack_len, sizeof(*sizes));
int version = (st->config.hash_id == GIT_SHA1_FORMAT_ID) ? 1 : 2;
int overhead = header_size(version) - 1;
int i = 0;
@@ -1281,17 +1390,12 @@ static int stack_check_addition(struct reftable_stack *st,
while (1) {
struct reftable_ref_record ref = { NULL };
err = reftable_iterator_next_ref(&it, &ref);
- if (err > 0) {
+ if (err > 0)
break;
- }
if (err < 0)
goto done;
- if (len >= cap) {
- cap = 2 * cap + 1;
- refs = reftable_realloc(refs, cap * sizeof(refs[0]));
- }
-
+ REFTABLE_ALLOC_GROW(refs, len + 1, cap);
refs[len++] = ref;
}
diff --git a/reftable/stack.h b/reftable/stack.h
index f570058..d43efa4 100644
--- a/reftable/stack.h
+++ b/reftable/stack.h
@@ -14,9 +14,11 @@ https://developers.google.com/open-source/licenses/bsd
#include "reftable-stack.h"
struct reftable_stack {
+ struct stat list_st;
char *list_file;
+ int list_fd;
+
char *reftable_dir;
- int disable_auto_compact;
struct reftable_write_options config;
@@ -29,13 +31,10 @@ struct reftable_stack {
int read_lines(const char *filename, char ***lines);
struct segment {
- int start, end;
- int log;
+ size_t start, end;
uint64_t bytes;
};
-int fastlog2(uint64_t sz);
-struct segment *sizes_to_segments(int *seglen, uint64_t *sizes, int n);
-struct segment suggest_compaction_segment(uint64_t *sizes, int n);
+struct segment suggest_compaction_segment(uint64_t *sizes, size_t n);
#endif
diff --git a/reftable/stack_test.c b/reftable/stack_test.c
index d0b7175..1df3ffc 100644
--- a/reftable/stack_test.c
+++ b/reftable/stack_test.c
@@ -13,7 +13,6 @@ https://developers.google.com/open-source/licenses/bsd
#include "reftable-reader.h"
#include "merged.h"
#include "basics.h"
-#include "constants.h"
#include "record.h"
#include "test_framework.h"
#include "reftable-tests.h"
@@ -39,7 +38,17 @@ static int count_dir_entries(const char *dirname)
return 0;
while ((d = readdir(dir))) {
- if (!strcmp(d->d_name, "..") || !strcmp(d->d_name, "."))
+ /*
+ * Besides skipping over "." and "..", we also need to
+ * skip over other files that have a leading ".". This
+ * is due to behaviour of NFS, which will rename files
+ * to ".nfs*" to emulate delete-on-last-close.
+ *
+ * In any case this should be fine as the reftable
+ * library will never write files with leading dots
+ * anyway.
+ */
+ if (starts_with(d->d_name, "."))
continue;
len++;
}
@@ -78,7 +87,7 @@ static void test_read_file(void)
int i = 0;
EXPECT(fd > 0);
- n = write(fd, out, strlen(out));
+ n = write_in_full(fd, out, strlen(out));
EXPECT(n == strlen(out));
err = close(fd);
EXPECT(err >= 0);
@@ -233,7 +242,7 @@ static void test_reftable_stack_uptodate(void)
EXPECT_ERR(err);
err = reftable_stack_add(st2, &write_test_ref, &ref2);
- EXPECT(err == REFTABLE_LOCK_ERROR);
+ EXPECT(err == REFTABLE_OUTDATED_ERROR);
err = reftable_stack_reload(st2);
EXPECT_ERR(err);
@@ -289,6 +298,104 @@ static void test_reftable_stack_transaction_api(void)
clear_dir(dir);
}
+static void test_reftable_stack_transaction_api_performs_auto_compaction(void)
+{
+ char *dir = get_tmp_dir(__LINE__);
+ struct reftable_write_options cfg = {0};
+ struct reftable_addition *add = NULL;
+ struct reftable_stack *st = NULL;
+ int i, n = 20, err;
+
+ err = reftable_new_stack(&st, dir, cfg);
+ EXPECT_ERR(err);
+
+ for (i = 0; i <= n; i++) {
+ struct reftable_ref_record ref = {
+ .update_index = reftable_stack_next_update_index(st),
+ .value_type = REFTABLE_REF_SYMREF,
+ .value.symref = "master",
+ };
+ char name[100];
+
+ snprintf(name, sizeof(name), "branch%04d", i);
+ ref.refname = name;
+
+ /*
+ * Disable auto-compaction for all but the last runs. Like this
+ * we can ensure that we indeed honor this setting and have
+ * better control over when exactly auto compaction runs.
+ */
+ st->config.disable_auto_compact = i != n;
+
+ err = reftable_stack_new_addition(&add, st);
+ EXPECT_ERR(err);
+
+ err = reftable_addition_add(add, &write_test_ref, &ref);
+ EXPECT_ERR(err);
+
+ err = reftable_addition_commit(add);
+ EXPECT_ERR(err);
+
+ reftable_addition_destroy(add);
+
+ /*
+ * The stack length should grow continuously for all runs where
+ * auto compaction is disabled. When enabled, we should merge
+ * all tables in the stack.
+ */
+ if (i != n)
+ EXPECT(st->merged->stack_len == i + 1);
+ else
+ EXPECT(st->merged->stack_len == 1);
+ }
+
+ reftable_stack_destroy(st);
+ clear_dir(dir);
+}
+
+static void test_reftable_stack_auto_compaction_fails_gracefully(void)
+{
+ struct reftable_ref_record ref = {
+ .refname = "refs/heads/master",
+ .update_index = 1,
+ .value_type = REFTABLE_REF_VAL1,
+ .value.val1 = {0x01},
+ };
+ struct reftable_write_options cfg = {0};
+ struct reftable_stack *st;
+ struct strbuf table_path = STRBUF_INIT;
+ char *dir = get_tmp_dir(__LINE__);
+ int err;
+
+ err = reftable_new_stack(&st, dir, cfg);
+ EXPECT_ERR(err);
+
+ err = reftable_stack_add(st, write_test_ref, &ref);
+ EXPECT_ERR(err);
+ EXPECT(st->merged->stack_len == 1);
+ EXPECT(st->stats.attempts == 0);
+ EXPECT(st->stats.failures == 0);
+
+ /*
+ * Lock the newly written table such that it cannot be compacted.
+ * Adding a new table to the stack should not be impacted by this, even
+ * though auto-compaction will now fail.
+ */
+ strbuf_addf(&table_path, "%s/%s.lock", dir, st->readers[0]->name);
+ write_file_buf(table_path.buf, "", 0);
+
+ ref.update_index = 2;
+ err = reftable_stack_add(st, write_test_ref, &ref);
+ EXPECT_ERR(err);
+ EXPECT(st->merged->stack_len == 2);
+ EXPECT(st->stats.attempts == 1);
+ EXPECT(st->stats.failures == 1);
+
+ reftable_stack_destroy(st);
+ strbuf_release(&table_path);
+ clear_dir(dir);
+}
+
static void test_reftable_stack_validate_refname(void)
{
struct reftable_write_options cfg = { 0 };
@@ -389,18 +496,19 @@ static void test_reftable_stack_add(void)
int err = 0;
struct reftable_write_options cfg = {
.exact_log_message = 1,
+ .default_permissions = 0660,
+ .disable_auto_compact = 1,
};
struct reftable_stack *st = NULL;
char *dir = get_tmp_dir(__LINE__);
-
struct reftable_ref_record refs[2] = { { NULL } };
struct reftable_log_record logs[2] = { { NULL } };
+ struct strbuf path = STRBUF_INIT;
+ struct stat stat_result;
int N = ARRAY_SIZE(refs);
-
err = reftable_new_stack(&st, dir, cfg);
EXPECT_ERR(err);
- st->disable_auto_compact = 1;
for (i = 0; i < N; i++) {
char buf[256];
@@ -408,14 +516,11 @@ static void test_reftable_stack_add(void)
refs[i].refname = xstrdup(buf);
refs[i].update_index = i + 1;
refs[i].value_type = REFTABLE_REF_VAL1;
- refs[i].value.val1 = reftable_malloc(GIT_SHA1_RAWSZ);
set_test_hash(refs[i].value.val1, i);
logs[i].refname = xstrdup(buf);
logs[i].update_index = N + i + 1;
logs[i].value_type = REFTABLE_LOG_UPDATE;
-
- logs[i].value.update.new_hash = reftable_malloc(GIT_SHA1_RAWSZ);
logs[i].value.update.email = xstrdup("identity@invalid");
set_test_hash(logs[i].value.update.new_hash, i);
}
@@ -456,12 +561,32 @@ static void test_reftable_stack_add(void)
reftable_log_record_release(&dest);
}
+#ifndef GIT_WINDOWS_NATIVE
+ strbuf_addstr(&path, dir);
+ strbuf_addstr(&path, "/tables.list");
+ err = stat(path.buf, &stat_result);
+ EXPECT(!err);
+ EXPECT((stat_result.st_mode & 0777) == cfg.default_permissions);
+
+ strbuf_reset(&path);
+ strbuf_addstr(&path, dir);
+ strbuf_addstr(&path, "/");
+ /* do not try at home; not an external API for reftable. */
+ strbuf_addstr(&path, st->readers[0]->name);
+ err = stat(path.buf, &stat_result);
+ EXPECT(!err);
+ EXPECT((stat_result.st_mode & 0777) == cfg.default_permissions);
+#else
+ (void) stat_result;
+#endif
+
/* cleanup */
reftable_stack_destroy(st);
for (i = 0; i < N; i++) {
reftable_ref_record_release(&refs[i]);
reftable_log_record_release(&logs[i]);
}
+ strbuf_release(&path);
clear_dir(dir);
}
@@ -473,16 +598,17 @@ static void test_reftable_stack_log_normalize(void)
};
struct reftable_stack *st = NULL;
char *dir = get_tmp_dir(__LINE__);
-
- uint8_t h1[GIT_SHA1_RAWSZ] = { 0x01 }, h2[GIT_SHA1_RAWSZ] = { 0x02 };
-
- struct reftable_log_record input = { .refname = "branch",
- .update_index = 1,
- .value_type = REFTABLE_LOG_UPDATE,
- .value = { .update = {
- .new_hash = h1,
- .old_hash = h2,
- } } };
+ struct reftable_log_record input = {
+ .refname = "branch",
+ .update_index = 1,
+ .value_type = REFTABLE_LOG_UPDATE,
+ .value = {
+ .update = {
+ .new_hash = { 1 },
+ .old_hash = { 2 },
+ },
+ },
+ };
struct reftable_log_record dest = {
.update_index = 0,
};
@@ -545,7 +671,6 @@ static void test_reftable_stack_tombstone(void)
refs[i].update_index = i + 1;
if (i % 2 == 0) {
refs[i].value_type = REFTABLE_REF_VAL1;
- refs[i].value.val1 = reftable_malloc(GIT_SHA1_RAWSZ);
set_test_hash(refs[i].value.val1, i);
}
@@ -554,8 +679,6 @@ static void test_reftable_stack_tombstone(void)
logs[i].update_index = 42;
if (i % 2 == 0) {
logs[i].value_type = REFTABLE_LOG_UPDATE;
- logs[i].value.update.new_hash =
- reftable_malloc(GIT_SHA1_RAWSZ);
set_test_hash(logs[i].value.update.new_hash, i);
logs[i].value.update.email =
xstrdup("identity@invalid");
@@ -647,60 +770,13 @@ static void test_reftable_stack_hash_id(void)
clear_dir(dir);
}
-static void test_log2(void)
-{
- EXPECT(1 == fastlog2(3));
- EXPECT(2 == fastlog2(4));
- EXPECT(2 == fastlog2(5));
-}
-
-static void test_sizes_to_segments(void)
-{
- uint64_t sizes[] = { 2, 3, 4, 5, 7, 9 };
- /* .................0 1 2 3 4 5 */
-
- int seglen = 0;
- struct segment *segs =
- sizes_to_segments(&seglen, sizes, ARRAY_SIZE(sizes));
- EXPECT(segs[2].log == 3);
- EXPECT(segs[2].start == 5);
- EXPECT(segs[2].end == 6);
-
- EXPECT(segs[1].log == 2);
- EXPECT(segs[1].start == 2);
- EXPECT(segs[1].end == 5);
- reftable_free(segs);
-}
-
-static void test_sizes_to_segments_empty(void)
-{
- int seglen = 0;
- struct segment *segs = sizes_to_segments(&seglen, NULL, 0);
- EXPECT(seglen == 0);
- reftable_free(segs);
-}
-
-static void test_sizes_to_segments_all_equal(void)
-{
- uint64_t sizes[] = { 5, 5 };
-
- int seglen = 0;
- struct segment *segs =
- sizes_to_segments(&seglen, sizes, ARRAY_SIZE(sizes));
- EXPECT(seglen == 1);
- EXPECT(segs[0].start == 0);
- EXPECT(segs[0].end == 2);
- reftable_free(segs);
-}
-
static void test_suggest_compaction_segment(void)
{
- uint64_t sizes[] = { 128, 64, 17, 16, 9, 9, 9, 16, 16 };
- /* .................0 1 2 3 4 5 6 */
+ uint64_t sizes[] = { 512, 64, 17, 16, 9, 9, 9, 16, 2, 16 };
struct segment min =
suggest_compaction_segment(sizes, ARRAY_SIZE(sizes));
- EXPECT(min.start == 2);
- EXPECT(min.end == 7);
+ EXPECT(min.start == 1);
+ EXPECT(min.end == 10);
}
static void test_suggest_compaction_segment_nothing(void)
@@ -738,7 +814,6 @@ static void test_reflog_expire(void)
logs[i].update_index = i;
logs[i].value_type = REFTABLE_LOG_UPDATE;
logs[i].value.update.time = i;
- logs[i].value.update.new_hash = reftable_malloc(GIT_SHA1_RAWSZ);
logs[i].value.update.email = xstrdup("identity@invalid");
set_test_hash(logs[i].value.update.new_hash, i);
}
@@ -812,9 +887,21 @@ static void test_empty_add(void)
reftable_stack_destroy(st2);
}
+static int fastlog2(uint64_t sz)
+{
+ int l = 0;
+ if (sz == 0)
+ return 0;
+ for (; sz; sz /= 2)
+ l++;
+ return l - 1;
+}
+
static void test_reftable_stack_auto_compaction(void)
{
- struct reftable_write_options cfg = { 0 };
+ struct reftable_write_options cfg = {
+ .disable_auto_compact = 1,
+ };
struct reftable_stack *st = NULL;
char *dir = get_tmp_dir(__LINE__);
@@ -824,7 +911,6 @@ static void test_reftable_stack_auto_compaction(void)
err = reftable_new_stack(&st, dir, cfg);
EXPECT_ERR(err);
- st->disable_auto_compact = 1; /* call manually below for coverage. */
for (i = 0; i < N; i++) {
char name[100];
struct reftable_ref_record ref = {
@@ -850,6 +936,54 @@ static void test_reftable_stack_auto_compaction(void)
clear_dir(dir);
}
+static void test_reftable_stack_add_performs_auto_compaction(void)
+{
+ struct reftable_write_options cfg = { 0 };
+ struct reftable_stack *st = NULL;
+ struct strbuf refname = STRBUF_INIT;
+ char *dir = get_tmp_dir(__LINE__);
+ int err, i, n = 20;
+
+ err = reftable_new_stack(&st, dir, cfg);
+ EXPECT_ERR(err);
+
+ for (i = 0; i <= n; i++) {
+ struct reftable_ref_record ref = {
+ .update_index = reftable_stack_next_update_index(st),
+ .value_type = REFTABLE_REF_SYMREF,
+ .value.symref = "master",
+ };
+
+ /*
+ * Disable auto-compaction for all but the last runs. Like this
+ * we can ensure that we indeed honor this setting and have
+ * better control over when exactly auto compaction runs.
+ */
+ st->config.disable_auto_compact = i != n;
+
+ strbuf_reset(&refname);
+ strbuf_addf(&refname, "branch-%04d", i);
+ ref.refname = refname.buf;
+
+ err = reftable_stack_add(st, &write_test_ref, &ref);
+ EXPECT_ERR(err);
+
+ /*
+ * The stack length should grow continuously for all runs where
+ * auto compaction is disabled. When enabled, we should merge
+ * all tables in the stack.
+ */
+ if (i != n)
+ EXPECT(st->merged->stack_len == i + 1);
+ else
+ EXPECT(st->merged->stack_len == 1);
+ }
+
+ reftable_stack_destroy(st);
+ strbuf_release(&refname);
+ clear_dir(dir);
+}
+
static void test_reftable_stack_compaction_concurrent(void)
{
struct reftable_write_options cfg = { 0 };
@@ -952,7 +1086,6 @@ static void test_reftable_stack_compaction_concurrent_clean(void)
int stack_test_main(int argc, const char *argv[])
{
RUN_TEST(test_empty_add);
- RUN_TEST(test_log2);
RUN_TEST(test_names_equal);
RUN_TEST(test_parse_names);
RUN_TEST(test_read_file);
@@ -960,6 +1093,7 @@ int stack_test_main(int argc, const char *argv[])
RUN_TEST(test_reftable_stack_add);
RUN_TEST(test_reftable_stack_add_one);
RUN_TEST(test_reftable_stack_auto_compaction);
+ RUN_TEST(test_reftable_stack_add_performs_auto_compaction);
RUN_TEST(test_reftable_stack_compaction_concurrent);
RUN_TEST(test_reftable_stack_compaction_concurrent_clean);
RUN_TEST(test_reftable_stack_hash_id);
@@ -967,12 +1101,11 @@ int stack_test_main(int argc, const char *argv[])
RUN_TEST(test_reftable_stack_log_normalize);
RUN_TEST(test_reftable_stack_tombstone);
RUN_TEST(test_reftable_stack_transaction_api);
+ RUN_TEST(test_reftable_stack_transaction_api_performs_auto_compaction);
+ RUN_TEST(test_reftable_stack_auto_compaction_fails_gracefully);
RUN_TEST(test_reftable_stack_update_index_check);
RUN_TEST(test_reftable_stack_uptodate);
RUN_TEST(test_reftable_stack_validate_refname);
- RUN_TEST(test_sizes_to_segments);
- RUN_TEST(test_sizes_to_segments_all_equal);
- RUN_TEST(test_sizes_to_segments_empty);
RUN_TEST(test_suggest_compaction_segment);
RUN_TEST(test_suggest_compaction_segment_nothing);
return 0;
diff --git a/reftable/system.h b/reftable/system.h
index 18f9207..5d8b6de 100644
--- a/reftable/system.h
+++ b/reftable/system.h
@@ -12,8 +12,10 @@ 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 "strbuf.h"
-#include "hash.h" /* hash ID, sizes.*/
+#include "tempfile.h"
+#include "hash-ll.h" /* hash ID, sizes.*/
#include "dir.h" /* remove_dir_recursively, for tests.*/
int hash_size(uint32_t id);
diff --git a/reftable/test_framework.c b/reftable/test_framework.c
index 84ac972..4066924 100644
--- a/reftable/test_framework.c
+++ b/reftable/test_framework.c
@@ -9,7 +9,6 @@ https://developers.google.com/open-source/licenses/bsd
#include "system.h"
#include "test_framework.h"
-#include "basics.h"
void set_test_hash(uint8_t *p, int i)
{
@@ -21,3 +20,8 @@ ssize_t strbuf_add_void(void *b, const void *data, size_t sz)
strbuf_add(b, data, sz);
return sz;
}
+
+int noop_flush(void *arg)
+{
+ return 0;
+}
diff --git a/reftable/test_framework.h b/reftable/test_framework.h
index 774cb27..687390f 100644
--- a/reftable/test_framework.h
+++ b/reftable/test_framework.h
@@ -12,32 +12,38 @@ https://developers.google.com/open-source/licenses/bsd
#include "system.h"
#include "reftable-error.h"
-#define EXPECT_ERR(c) \
- if (c != 0) { \
- fflush(stderr); \
- fflush(stdout); \
- fprintf(stderr, "%s: %d: error == %d (%s), want 0\n", \
- __FILE__, __LINE__, c, reftable_error_str(c)); \
- abort(); \
- }
-
-#define EXPECT_STREQ(a, b) \
- if (strcmp(a, b)) { \
- fflush(stderr); \
- fflush(stdout); \
- fprintf(stderr, "%s:%d: %s (%s) != %s (%s)\n", __FILE__, \
- __LINE__, #a, a, #b, b); \
- abort(); \
- }
-
-#define EXPECT(c) \
- if (!(c)) { \
- fflush(stderr); \
- fflush(stdout); \
- fprintf(stderr, "%s: %d: failed assertion %s\n", __FILE__, \
- __LINE__, #c); \
- abort(); \
- }
+#define EXPECT_ERR(c) \
+ do { \
+ if (c != 0) { \
+ fflush(stderr); \
+ fflush(stdout); \
+ fprintf(stderr, "%s: %d: error == %d (%s), want 0\n", \
+ __FILE__, __LINE__, c, reftable_error_str(c)); \
+ abort(); \
+ } \
+ } while (0)
+
+#define EXPECT_STREQ(a, b) \
+ do { \
+ if (strcmp(a, b)) { \
+ fflush(stderr); \
+ fflush(stdout); \
+ fprintf(stderr, "%s:%d: %s (%s) != %s (%s)\n", __FILE__, \
+ __LINE__, #a, a, #b, b); \
+ abort(); \
+ } \
+ } while (0)
+
+#define EXPECT(c) \
+ do { \
+ if (!(c)) { \
+ fflush(stderr); \
+ fflush(stdout); \
+ fprintf(stderr, "%s: %d: failed assertion %s\n", __FILE__, \
+ __LINE__, #c); \
+ abort(); \
+ } \
+ } while (0)
#define RUN_TEST(f) \
fprintf(stderr, "running %s\n", #f); \
@@ -50,4 +56,6 @@ void set_test_hash(uint8_t *p, int i);
*/
ssize_t strbuf_add_void(void *b, const void *data, size_t sz);
+int noop_flush(void *);
+
#endif
diff --git a/reftable/tree.c b/reftable/tree.c
index b8899e0..528f33a 100644
--- a/reftable/tree.c
+++ b/reftable/tree.c
@@ -6,10 +6,10 @@ license that can be found in the LICENSE file or at
https://developers.google.com/open-source/licenses/bsd
*/
+#include "system.h"
#include "tree.h"
#include "basics.h"
-#include "system.h"
struct tree_node *tree_search(void *key, struct tree_node **rootp,
int (*compare)(const void *, const void *),
@@ -20,8 +20,8 @@ struct tree_node *tree_search(void *key, struct tree_node **rootp,
if (!insert) {
return NULL;
} else {
- struct tree_node *n =
- reftable_calloc(sizeof(struct tree_node));
+ struct tree_node *n;
+ REFTABLE_CALLOC_ARRAY(n, 1);
n->key = key;
*rootp = n;
return *rootp;
diff --git a/reftable/tree_test.c b/reftable/tree_test.c
index cbff125..6961a65 100644
--- a/reftable/tree_test.c
+++ b/reftable/tree_test.c
@@ -6,10 +6,9 @@ license that can be found in the LICENSE file or at
https://developers.google.com/open-source/licenses/bsd
*/
+#include "system.h"
#include "tree.h"
-#include "basics.h"
-#include "record.h"
#include "test_framework.h"
#include "reftable-tests.h"
diff --git a/reftable/writer.c b/reftable/writer.c
index 2e322a5..1d9ff0f 100644
--- a/reftable/writer.c
+++ b/reftable/writer.c
@@ -49,7 +49,7 @@ static int padded_write(struct reftable_writer *w, uint8_t *data, size_t len,
{
int n = 0;
if (w->pending_padding > 0) {
- uint8_t *zeroed = reftable_calloc(w->pending_padding);
+ uint8_t *zeroed = reftable_calloc(w->pending_padding, sizeof(*zeroed));
int n = w->write(w->write_arg, zeroed, w->pending_padding);
if (n < 0)
return n;
@@ -121,10 +121,10 @@ static struct strbuf reftable_empty_strbuf = STRBUF_INIT;
struct reftable_writer *
reftable_new_writer(ssize_t (*writer_func)(void *, const void *, size_t),
+ int (*flush_func)(void *),
void *writer_arg, struct reftable_write_options *opts)
{
- struct reftable_writer *wp =
- reftable_calloc(sizeof(struct reftable_writer));
+ struct reftable_writer *wp = reftable_calloc(1, sizeof(*wp));
strbuf_init(&wp->block_writer_data.last_key, 0);
options_set_defaults(opts);
if (opts->block_size >= (1 << 24)) {
@@ -132,10 +132,11 @@ reftable_new_writer(ssize_t (*writer_func)(void *, const void *, size_t),
abort();
}
wp->last_key = reftable_empty_strbuf;
- wp->block = reftable_calloc(opts->block_size);
+ REFTABLE_CALLOC_ARRAY(wp->block, opts->block_size);
wp->write = writer_func;
wp->write_arg = writer_arg;
wp->opts = *opts;
+ wp->flush = flush_func;
writer_reinit_block_writer(wp, BLOCK_TYPE_REF);
return wp;
@@ -200,12 +201,7 @@ static void writer_index_hash(struct reftable_writer *w, struct strbuf *hash)
return;
}
- if (key->offset_len == key->offset_cap) {
- key->offset_cap = 2 * key->offset_cap + 1;
- key->offsets = reftable_realloc(
- key->offsets, sizeof(uint64_t) * key->offset_cap);
- }
-
+ REFTABLE_ALLOC_GROW(key->offsets, key->offset_len + 1, key->offset_cap);
key->offsets[key->offset_len++] = off;
}
@@ -377,20 +373,39 @@ int reftable_writer_add_logs(struct reftable_writer *w,
static int writer_finish_section(struct reftable_writer *w)
{
+ struct reftable_block_stats *bstats = NULL;
uint8_t typ = block_writer_type(w->block_writer);
uint64_t index_start = 0;
int max_level = 0;
- int threshold = w->opts.unpadded ? 1 : 3;
+ size_t threshold = w->opts.unpadded ? 1 : 3;
int before_blocks = w->stats.idx_stats.blocks;
- int err = writer_flush_block(w);
- int i = 0;
- struct reftable_block_stats *bstats = NULL;
+ int err;
+
+ err = writer_flush_block(w);
if (err < 0)
return err;
+ /*
+ * When the section we are about to index has a lot of blocks then the
+ * index itself may span across multiple blocks, as well. This would
+ * require a linear scan over index blocks only to find the desired
+ * indexed block, which is inefficient. Instead, we write a multi-level
+ * index where index records of level N+1 will refer to index blocks of
+ * level N. This isn't constant time, either, but at least logarithmic.
+ *
+ * This loop handles writing this multi-level index. Note that we write
+ * the lowest-level index pointing to the indexed blocks first. We then
+ * continue writing additional index levels until the current level has
+ * less blocks than the threshold so that the highest level will be at
+ * the end of the index section.
+ *
+ * Readers are thus required to start reading the index section from
+ * its end, which is why we set `index_start` to the beginning of the
+ * last index section.
+ */
while (w->index_len > threshold) {
struct reftable_index_record *idx = NULL;
- int idx_len = 0;
+ size_t i, idx_len;
max_level++;
index_start = w->next;
@@ -409,35 +424,28 @@ static int writer_finish_section(struct reftable_writer *w)
.idx = idx[i],
},
};
- if (block_writer_add(w->block_writer, &rec) == 0) {
- continue;
- }
- err = writer_flush_block(w);
+ err = writer_add_record(w, &rec);
if (err < 0)
return err;
+ }
- writer_reinit_block_writer(w, BLOCK_TYPE_INDEX);
+ err = writer_flush_block(w);
+ if (err < 0)
+ return err;
- err = block_writer_add(w->block_writer, &rec);
- if (err != 0) {
- /* write into fresh block should always succeed
- */
- abort();
- }
- }
- for (i = 0; i < idx_len; i++) {
+ for (i = 0; i < idx_len; i++)
strbuf_release(&idx[i].last_key);
- }
reftable_free(idx);
}
+ /*
+ * The index may still contain a number of index blocks lower than the
+ * threshold. Clear it so that these entries don't leak into the next
+ * index section.
+ */
writer_clear_index(w);
- err = writer_flush_block(w);
- if (err < 0)
- return err;
-
bstats = writer_reftable_block_stats(w, typ);
bstats->index_blocks = w->stats.idx_stats.blocks - before_blocks;
bstats->index_offset = index_start;
@@ -603,6 +611,12 @@ int reftable_writer_close(struct reftable_writer *w)
put_be32(p, crc32(0, footer, p - footer));
p += 4;
+ err = w->flush(w->write_arg);
+ if (err < 0) {
+ err = REFTABLE_IO_ERROR;
+ goto done;
+ }
+
err = padded_write(w, footer, footer_size(writer_version(w)), 0);
if (err < 0)
goto done;
@@ -622,11 +636,8 @@ done:
static void writer_clear_index(struct reftable_writer *w)
{
- int i = 0;
- for (i = 0; i < w->index_len; i++) {
+ for (size_t i = 0; i < w->index_len; i++)
strbuf_release(&w->index[i].last_key);
- }
-
FREE_AND_NULL(w->index);
w->index_len = 0;
w->index_cap = 0;
@@ -674,12 +685,7 @@ static int writer_flush_nonempty_block(struct reftable_writer *w)
if (err < 0)
return err;
- if (w->index_cap == w->index_len) {
- w->index_cap = 2 * w->index_cap + 1;
- w->index = reftable_realloc(
- w->index,
- sizeof(struct reftable_index_record) * w->index_cap);
- }
+ REFTABLE_ALLOC_GROW(w->index, w->index_len + 1, w->index_cap);
ir.offset = w->next;
strbuf_reset(&ir.last_key);
diff --git a/reftable/writer.h b/reftable/writer.h
index 09b8867..8d0df9c 100644
--- a/reftable/writer.h
+++ b/reftable/writer.h
@@ -16,6 +16,7 @@ https://developers.google.com/open-source/licenses/bsd
struct reftable_writer {
ssize_t (*write)(void *, const void *, size_t);
+ int (*flush)(void *);
void *write_arg;
int pending_padding;
struct strbuf last_key;
diff --git a/remote-curl.c b/remote-curl.c
index 67f178b..0b6d781 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -1,22 +1,28 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "git-curl-compat.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "remote.h"
#include "connect.h"
#include "strbuf.h"
#include "walker.h"
#include "http.h"
-#include "exec-cmd.h"
#include "run-command.h"
#include "pkt-line.h"
#include "string-list.h"
-#include "sideband.h"
#include "strvec.h"
#include "credential.h"
#include "oid-array.h"
#include "send-pack.h"
+#include "setup.h"
#include "protocol.h"
#include "quote.h"
+#include "trace2.h"
#include "transport.h"
+#include "url.h"
+#include "write-or-die.h"
static struct remote *remote;
/* always ends with a trailing slash */
@@ -206,14 +212,9 @@ static int set_option(const char *name, const char *value)
options.filter = xstrdup(value);
return 0;
} else if (!strcmp(name, "object-format")) {
- int algo;
options.object_format = 1;
- if (strcmp(value, "true")) {
- algo = hash_algo_by_name(value);
- if (algo == GIT_HASH_UNKNOWN)
- die("unknown object format '%s'", value);
- options.hash_algo = &hash_algos[algo];
- }
+ if (strcmp(value, "true"))
+ die(_("unknown value for object-format: %s"), value);
return 0;
} else {
return 1 /* unsupported */;
@@ -472,10 +473,11 @@ static struct discovery *discover_refs(const char *service, int for_push)
/*
* NEEDSWORK: If we are trying to use protocol v2 and we are planning
- * to perform a push, then fallback to v0 since the client doesn't know
- * how to push yet using v2.
+ * to perform any operation that doesn't involve upload-pack (i.e., a
+ * fetch, ls-remote, etc), then fallback to v0 since we don't know how
+ * to do anything else (like push or remote archive) via v2.
*/
- if (version == protocol_v2 && !strcmp("git-receive-pack", service))
+ if (version == protocol_v2 && strcmp("git-upload-pack", service))
version = protocol_v0;
/* Add the extra Git-Protocol header */
@@ -580,6 +582,7 @@ struct rpc_state {
char *service_url;
char *hdr_content_type;
char *hdr_accept;
+ char *hdr_accept_language;
char *protocol_header;
char *buf;
size_t alloc;
@@ -607,6 +610,8 @@ struct rpc_state {
unsigned flush_read_but_not_sent : 1;
};
+#define RPC_STATE_INIT { 0 }
+
/*
* Appends the result of reading from rpc->out to the string represented by
* rpc->buf and rpc->len if there is enough space. Returns 1 if there was
@@ -714,25 +719,23 @@ static size_t rpc_out(void *ptr, size_t eltsize,
return avail;
}
-static curlioerr rpc_ioctl(CURL *handle, int cmd, void *clientp)
+static int rpc_seek(void *clientp, curl_off_t offset, int origin)
{
struct rpc_state *rpc = clientp;
- switch (cmd) {
- case CURLIOCMD_NOP:
- return CURLIOE_OK;
+ if (origin != SEEK_SET)
+ BUG("rpc_seek only handles SEEK_SET, not %d", origin);
- case CURLIOCMD_RESTARTREAD:
- if (rpc->initial_buffer) {
- rpc->pos = 0;
- return CURLIOE_OK;
+ if (rpc->initial_buffer) {
+ if (offset < 0 || offset > rpc->len) {
+ error("curl seek would be outside of rpc buffer");
+ return CURL_SEEKFUNC_FAIL;
}
- error(_("unable to rewind rpc post data - try increasing http.postBuffer"));
- return CURLIOE_FAILRESTART;
-
- default:
- return CURLIOE_UNKNOWNCMD;
+ rpc->pos = offset;
+ return CURL_SEEKFUNC_OK;
}
+ error(_("unable to rewind rpc post data - try increasing http.postBuffer"));
+ return CURL_SEEKFUNC_FAIL;
}
struct check_pktline_state {
@@ -754,7 +757,8 @@ static void check_pktline(struct check_pktline_state *state, const char *ptr, si
size -= digits_remaining;
if (state->len_filled == 4) {
- state->remaining = packet_length(state->len_buf);
+ state->remaining = packet_length(state->len_buf,
+ sizeof(state->len_buf));
if (state->remaining < 0) {
die(_("remote-curl: bad line length character: %.4s"), state->len_buf);
} else if (state->remaining == 2) {
@@ -932,6 +936,10 @@ static int post_rpc(struct rpc_state *rpc, int stateless_connect, int flush_rece
headers = curl_slist_append(headers, needs_100_continue ?
"Expect: 100-continue" : "Expect:");
+ /* Add Accept-Language header */
+ if (rpc->hdr_accept_language)
+ headers = curl_slist_append(headers, rpc->hdr_accept_language);
+
/* Add the extra Git-Protocol header */
if (rpc->protocol_header)
headers = curl_slist_append(headers, rpc->protocol_header);
@@ -948,12 +956,14 @@ retry:
/* The request body is large and the size cannot be predicted.
* We must use chunked encoding to send it.
*/
+#ifdef GIT_CURL_NEED_TRANSFER_ENCODING_HEADER
headers = curl_slist_append(headers, "Transfer-Encoding: chunked");
+#endif
rpc->initial_buffer = 1;
curl_easy_setopt(slot->curl, CURLOPT_READFUNCTION, rpc_out);
curl_easy_setopt(slot->curl, CURLOPT_INFILE, rpc);
- curl_easy_setopt(slot->curl, CURLOPT_IOCTLFUNCTION, rpc_ioctl);
- curl_easy_setopt(slot->curl, CURLOPT_IOCTLDATA, rpc);
+ curl_easy_setopt(slot->curl, CURLOPT_SEEKFUNCTION, rpc_seek);
+ curl_easy_setopt(slot->curl, CURLOPT_SEEKDATA, rpc);
if (options.verbosity > 1) {
fprintf(stderr, "POST %s (chunked)\n", rpc->service_name);
fflush(stderr);
@@ -1080,6 +1090,8 @@ static int rpc_service(struct rpc_state *rpc, struct discovery *heads,
strbuf_addf(&buf, "%s%s", url.buf, svc);
rpc->service_url = strbuf_detach(&buf, NULL);
+ rpc->hdr_accept_language = xstrdup_or_null(http_get_accept_language_header());
+
strbuf_addf(&buf, "Content-Type: application/x-%s-request", svc);
rpc->hdr_content_type = strbuf_detach(&buf, NULL);
@@ -1118,6 +1130,7 @@ static int rpc_service(struct rpc_state *rpc, struct discovery *heads,
free(rpc->service_url);
free(rpc->hdr_content_type);
free(rpc->hdr_accept);
+ free(rpc->hdr_accept_language);
free(rpc->protocol_header);
free(rpc->buf);
strbuf_release(&buf);
@@ -1153,7 +1166,7 @@ static int fetch_dumb(int nr_heads, struct ref **to_fetch)
static int fetch_git(struct discovery *heads,
int nr_heads, struct ref **to_fetch)
{
- struct rpc_state rpc;
+ struct rpc_state rpc = RPC_STATE_INIT;
struct strbuf preamble = STRBUF_INIT;
int i, err;
struct strvec args = STRVEC_INIT;
@@ -1276,6 +1289,29 @@ static void parse_fetch(struct strbuf *buf)
strbuf_reset(buf);
}
+static void parse_get(const char *arg)
+{
+ struct strbuf url = STRBUF_INIT;
+ struct strbuf path = STRBUF_INIT;
+ const char *space;
+
+ space = strchr(arg, ' ');
+
+ if (!space)
+ die(_("protocol error: expected '<url> <path>', missing space"));
+
+ strbuf_add(&url, arg, space - arg);
+ strbuf_addstr(&path, space + 1);
+
+ if (http_get_file(url.buf, path.buf, NULL))
+ die(_("failed to download file at URL '%s'"), url.buf);
+
+ strbuf_release(&url);
+ strbuf_release(&path);
+ printf("\n");
+ fflush(stdout);
+}
+
static int push_dav(int nr_spec, const char **specs)
{
struct child_process child = CHILD_PROCESS_INIT;
@@ -1299,7 +1335,7 @@ static int push_dav(int nr_spec, const char **specs)
static int push_git(struct discovery *heads, int nr_spec, const char **specs)
{
- struct rpc_state rpc;
+ struct rpc_state rpc = RPC_STATE_INIT;
int i, err;
struct strvec args;
struct string_list_item *cas_option;
@@ -1398,8 +1434,9 @@ free_specs:
static int stateless_connect(const char *service_name)
{
struct discovery *discover;
- struct rpc_state rpc;
+ struct rpc_state rpc = RPC_STATE_INIT;
struct strbuf buf = STRBUF_INIT;
+ const char *accept_language;
/*
* Run the info/refs request and see if the server supports protocol
@@ -1407,8 +1444,14 @@ static int stateless_connect(const char *service_name)
* establish a stateless connection, otherwise we need to tell the
* client to fallback to using other transport helper functions to
* complete their request.
+ *
+ * The "git-upload-archive" service is a read-only operation. Fallback
+ * to use "git-upload-pack" service to discover protocol version.
*/
- discover = discover_refs(service_name, 0);
+ if (!strcmp(service_name, "git-upload-archive"))
+ discover = discover_refs("git-upload-pack", 0);
+ else
+ discover = discover_refs(service_name, 0);
if (discover->version != protocol_v2) {
printf("fallback\n");
fflush(stdout);
@@ -1418,6 +1461,9 @@ static int stateless_connect(const char *service_name)
printf("\n");
fflush(stdout);
}
+ accept_language = http_get_accept_language_header();
+ if (accept_language)
+ rpc.hdr_accept_language = xstrfmt("%s", accept_language);
rpc.service_name = service_name;
rpc.service_url = xstrfmt("%s%s", url.buf, rpc.service_name);
@@ -1443,9 +1489,11 @@ static int stateless_connect(const char *service_name)
/*
* Dump the capability listing that we got from the server earlier
- * during the info/refs request.
+ * during the info/refs request. This does not work with the
+ * "git-upload-archive" service.
*/
- write_or_die(rpc.in, discover->buf, discover->len);
+ if (strcmp(service_name, "git-upload-archive"))
+ write_or_die(rpc.in, discover->buf, discover->len);
/* Until we see EOF keep sending POSTs */
while (1) {
@@ -1467,6 +1515,7 @@ static int stateless_connect(const char *service_name)
free(rpc.service_url);
free(rpc.hdr_content_type);
free(rpc.hdr_accept);
+ free(rpc.hdr_accept_language);
free(rpc.protocol_header);
free(rpc.buf);
strbuf_release(&buf);
@@ -1520,8 +1569,11 @@ int cmd_main(int argc, const char **argv)
if (buf.len == 0)
break;
if (starts_with(buf.buf, "fetch ")) {
- if (nongit)
- die(_("remote-curl: fetch attempted without a local repo"));
+ if (nongit) {
+ setup_git_directory_gently(&nongit);
+ if (nongit)
+ die(_("remote-curl: fetch attempted without a local repo"));
+ }
parse_fetch(&buf);
} else if (!strcmp(buf.buf, "list") || starts_with(buf.buf, "list ")) {
@@ -1549,9 +1601,14 @@ int cmd_main(int argc, const char **argv)
printf("unsupported\n");
fflush(stdout);
+ } else if (skip_prefix(buf.buf, "get ", &arg)) {
+ parse_get(arg);
+ fflush(stdout);
+
} else if (!strcmp(buf.buf, "capabilities")) {
printf("stateless-connect\n");
printf("fetch\n");
+ printf("get\n");
printf("option\n");
printf("push\n");
printf("check-connectivity\n");
diff --git a/remote.c b/remote.c
index b19e3a2..2b650b8 100644
--- a/remote.c
+++ b/remote.c
@@ -1,21 +1,27 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "remote.h"
#include "urlmatch.h"
#include "refs.h"
#include "refspec.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "path.h"
#include "commit.h"
#include "diff.h"
#include "revision.h"
#include "dir.h"
-#include "tag.h"
+#include "setup.h"
#include "string-list.h"
-#include "mergesort.h"
#include "strvec.h"
#include "commit-reach.h"
#include "advice.h"
#include "connect.h"
+#include "parse-options.h"
enum map_direction { FROM_SRC, FROM_DST };
@@ -87,7 +93,7 @@ struct remotes_hash_key {
int len;
};
-static int remotes_hash_cmp(const void *unused_cmp_data,
+static int remotes_hash_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *keydata)
@@ -99,7 +105,7 @@ static int remotes_hash_cmp(const void *unused_cmp_data,
b = container_of(entry_or_key, const struct remote, ent);
if (key)
- return strncmp(a->name, key->str, key->len) || a->name[key->len];
+ return !!xstrncmpz(a->name, key->str, key->len);
else
return strcmp(a->name, b->name);
}
@@ -171,7 +177,7 @@ struct branches_hash_key {
int len;
};
-static int branches_hash_cmp(const void *unused_cmp_data,
+static int branches_hash_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *keydata)
@@ -183,8 +189,7 @@ static int branches_hash_cmp(const void *unused_cmp_data,
b = container_of(entry_or_key, const struct branch, ent);
if (key)
- return strncmp(a->name, key->str, key->len) ||
- a->name[key->len];
+ return !!xstrncmpz(a->name, key->str, key->len);
else
return strcmp(a->name, b->name);
}
@@ -342,7 +347,8 @@ static void read_branches_file(struct remote_state *remote_state,
remote->fetch_tags = 1; /* always auto-follow */
}
-static int handle_config(const char *key, const char *value, void *cb)
+static int handle_config(const char *key, const char *value,
+ const struct config_context *ctx, void *cb)
{
const char *name;
size_t namelen;
@@ -350,6 +356,7 @@ static int handle_config(const char *key, const char *value, void *cb)
struct remote *remote;
struct branch *branch;
struct remote_state *remote_state = cb;
+ const struct key_value_info *kvi = ctx->kvi;
if (parse_config_key(key, "branch", &name, &namelen, &subkey) >= 0) {
/* There is no subsection. */
@@ -407,8 +414,8 @@ static int handle_config(const char *key, const char *value, void *cb)
}
remote = make_remote(remote_state, name, namelen);
remote->origin = REMOTE_CONFIG;
- if (current_config_scope() == CONFIG_SCOPE_LOCAL ||
- current_config_scope() == CONFIG_SCOPE_WORKTREE)
+ if (kvi->scope == CONFIG_SCOPE_LOCAL ||
+ kvi->scope == CONFIG_SCOPE_WORKTREE)
remote->configured_in_repo = 1;
if (!strcmp(subkey, "mirror"))
remote->mirror = git_config_bool(key, value);
@@ -500,7 +507,7 @@ static void alias_all_urls(struct remote_state *remote_state)
}
}
-static void read_config(struct repository *repo)
+static void read_config(struct repository *repo, int early)
{
int flag;
@@ -509,7 +516,7 @@ static void read_config(struct repository *repo)
repo->remote_state->initialized = 1;
repo->remote_state->current_branch = NULL;
- if (startup_info->have_repository) {
+ if (startup_info->have_repository && !early) {
const char *head_ref = refs_resolve_ref_unsafe(
get_main_ref_store(repo), "HEAD", 0, NULL, &flag);
if (head_ref && (flag & REF_ISSYMREF) &&
@@ -552,7 +559,7 @@ static const char *remotes_remote_for_branch(struct remote_state *remote_state,
const char *remote_for_branch(struct branch *branch, int *explicit)
{
- read_config(the_repository);
+ read_config(the_repository, 0);
die_on_missing_branch(the_repository, branch);
return remotes_remote_for_branch(the_repository->remote_state, branch,
@@ -578,7 +585,7 @@ remotes_pushremote_for_branch(struct remote_state *remote_state,
const char *pushremote_for_branch(struct branch *branch, int *explicit)
{
- read_config(the_repository);
+ read_config(the_repository, 0);
die_on_missing_branch(the_repository, branch);
return remotes_pushremote_for_branch(the_repository->remote_state,
@@ -590,7 +597,7 @@ static struct remote *remotes_remote_get(struct remote_state *remote_state,
const char *remote_ref_for_branch(struct branch *branch, int for_push)
{
- read_config(the_repository);
+ read_config(the_repository, 0);
die_on_missing_branch(the_repository, branch);
if (branch) {
@@ -700,7 +707,13 @@ remotes_remote_get(struct remote_state *remote_state, const char *name)
struct remote *remote_get(const char *name)
{
- read_config(the_repository);
+ read_config(the_repository, 0);
+ return remotes_remote_get(the_repository->remote_state, name);
+}
+
+struct remote *remote_get_early(const char *name)
+{
+ read_config(the_repository, 1);
return remotes_remote_get(the_repository->remote_state, name);
}
@@ -713,7 +726,7 @@ remotes_pushremote_get(struct remote_state *remote_state, const char *name)
struct remote *pushremote_get(const char *name)
{
- read_config(the_repository);
+ read_config(the_repository, 0);
return remotes_pushremote_get(the_repository->remote_state, name);
}
@@ -729,7 +742,7 @@ int remote_is_configured(struct remote *remote, int in_repo)
int for_each_remote(each_remote_fn fn, void *priv)
{
int i, result = 0;
- read_config(the_repository);
+ read_config(the_repository, 0);
for (i = 0; i < the_repository->remote_state->remotes_nr && !result;
i++) {
struct remote *remote =
@@ -850,7 +863,7 @@ static int refspec_match(const struct refspec_item *refspec,
return !strcmp(refspec->src, name);
}
-static int omit_name_by_refspec(const char *name, struct refspec *rs)
+int omit_name_by_refspec(const char *name, struct refspec *rs)
{
int i;
@@ -883,7 +896,7 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite
{
int i, matched_negative = 0;
int find_src = !query->src;
- struct string_list reversed = STRING_LIST_INIT_NODUP;
+ struct string_list reversed = STRING_LIST_INIT_DUP;
const char *needle = find_src ? query->dst : query->src;
/*
@@ -1082,27 +1095,6 @@ void free_refs(struct ref *ref)
}
}
-int ref_compare_name(const void *va, const void *vb)
-{
- const struct ref *a = va, *b = vb;
- return strcmp(a->name, b->name);
-}
-
-static void *ref_list_get_next(const void *a)
-{
- return ((const struct ref *)a)->next;
-}
-
-static void ref_list_set_next(void *a, void *next)
-{
- ((struct ref *)a)->next = next;
-}
-
-void sort_ref_list(struct ref **l, int (*cmp)(const void *, const void *))
-{
- *l = llist_mergesort(*l, ref_list_get_next, ref_list_set_next, cmp);
-}
-
int count_refspec_match(const char *pattern,
struct ref *refs,
struct ref **matched_ref)
@@ -1185,7 +1177,7 @@ static int try_explicit_object_name(const char *name,
return 0;
}
- if (get_oid(name, &oid))
+ if (repo_get_oid(the_repository, name, &oid))
return -1;
if (match) {
@@ -1273,7 +1265,7 @@ static void show_push_unqualified_ref_name_error(const char *dst_value,
if (!advice_enabled(ADVICE_PUSH_UNQUALIFIED_REF_NAME))
return;
- if (get_oid(matched_src_name, &oid))
+ if (repo_get_oid(the_repository, matched_src_name, &oid))
BUG("'%s' is not a valid object, "
"match_explicit_lhs() should catch this!",
matched_src_name);
@@ -1781,7 +1773,7 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
if (!reject_reason && !ref->deletion && !is_null_oid(&ref->old_oid)) {
if (starts_with(ref->name, "refs/tags/"))
reject_reason = REF_STATUS_REJECT_ALREADY_EXISTS;
- else if (!has_object_file(&ref->old_oid))
+ else if (!repo_has_object_file(the_repository, &ref->old_oid))
reject_reason = REF_STATUS_REJECT_FETCH_FIRST;
else if (!lookup_commit_reference_gently(the_repository, &ref->old_oid, 1) ||
!lookup_commit_reference_gently(the_repository, &ref->new_oid, 1))
@@ -1830,8 +1822,9 @@ static void set_merge(struct remote_state *remote_state, struct branch *ret)
if (!remote_find_tracking(remote, ret->merge[i]) ||
strcmp(ret->remote_name, "."))
continue;
- if (dwim_ref(ret->merge_name[i], strlen(ret->merge_name[i]),
- &oid, &ref, 0) == 1)
+ if (repo_dwim_ref(the_repository, ret->merge_name[i],
+ strlen(ret->merge_name[i]), &oid, &ref,
+ 0) == 1)
ret->merge[i]->dst = ref;
else
ret->merge[i]->dst = xstrdup(ret->merge_name[i]);
@@ -1842,7 +1835,7 @@ struct branch *branch_get(const char *name)
{
struct branch *ret;
- read_config(the_repository);
+ read_config(the_repository, 0);
if (!name || !*name || !strcmp(name, "HEAD"))
ret = the_repository->remote_state->current_branch;
else
@@ -1984,7 +1977,7 @@ static const char *branch_get_push_1(struct remote_state *remote_state,
const char *branch_get_push(struct branch *branch, struct strbuf *err)
{
- read_config(the_repository);
+ read_config(the_repository, 0);
die_on_missing_branch(the_repository, branch);
if (!branch)
@@ -2169,6 +2162,9 @@ static int stat_branch_pair(const char *branch_name, const char *base,
struct object_id oid;
struct commit *ours, *theirs;
struct rev_info revs;
+ struct setup_revision_opt opt = {
+ .free_removed_argv_elements = 1,
+ };
struct strvec argv = STRVEC_INIT;
/* Cannot stat if what we used to build on no longer exists */
@@ -2203,7 +2199,7 @@ static int stat_branch_pair(const char *branch_name, const char *base,
strvec_push(&argv, "--");
repo_init_revisions(the_repository, &revs, NULL);
- setup_revisions(argv.nr, argv.v, &revs, NULL);
+ setup_revisions(argv.nr, argv.v, &revs, &opt);
if (prepare_revision_walk(&revs))
die(_("revision walk setup failed"));
@@ -2267,7 +2263,8 @@ int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs,
* Return true when there is anything to report, otherwise false.
*/
int format_tracking_info(struct branch *branch, struct strbuf *sb,
- enum ahead_behind_flags abf)
+ enum ahead_behind_flags abf,
+ int show_divergence_advice)
{
int ours, theirs, sti;
const char *full_base;
@@ -2330,16 +2327,18 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb,
"respectively.\n",
ours + theirs),
base, ours, theirs);
- if (advice_enabled(ADVICE_STATUS_HINTS))
+ if (show_divergence_advice &&
+ advice_enabled(ADVICE_STATUS_HINTS))
strbuf_addstr(sb,
- _(" (use \"git pull\" to merge the remote branch into yours)\n"));
+ _(" (use \"git pull\" if you want to integrate the remote branch with yours)\n"));
}
free(base);
return 1;
}
static int one_local_ref(const char *refname, const struct object_id *oid,
- int flag, void *cb_data)
+ int flag UNUSED,
+ void *cb_data)
{
struct ref ***local_tail = cb_data;
struct ref *ref;
@@ -2523,7 +2522,7 @@ static int parse_push_cas_option(struct push_cas_option *cas, const char *arg, i
entry->use_tracking = 1;
else if (!colon[1])
oidclr(&entry->expect);
- else if (get_oid(colon + 1, &entry->expect))
+ else if (repo_get_oid(the_repository, colon + 1, &entry->expect))
return error(_("cannot parse expected object name '%s'"),
colon + 1);
return 0;
@@ -2595,19 +2594,22 @@ struct check_and_collect_until_cb_data {
};
/* Get the timestamp of the latest entry. */
-static int peek_reflog(struct object_id *o_oid, struct object_id *n_oid,
- const char *ident, timestamp_t timestamp,
- int tz, const char *message, void *cb_data)
+static int peek_reflog(struct object_id *o_oid UNUSED,
+ struct object_id *n_oid UNUSED,
+ const char *ident UNUSED,
+ timestamp_t timestamp, int tz UNUSED,
+ const char *message UNUSED, void *cb_data)
{
timestamp_t *ts = cb_data;
*ts = timestamp;
return 1;
}
-static int check_and_collect_until(struct object_id *o_oid,
+static int check_and_collect_until(struct object_id *o_oid UNUSED,
struct object_id *n_oid,
- const char *ident, timestamp_t timestamp,
- int tz, const char *message, void *cb_data)
+ const char *ident UNUSED,
+ timestamp_t timestamp, int tz UNUSED,
+ const char *message UNUSED, void *cb_data)
{
struct commit *commit;
struct check_and_collect_until_cb_data *cb = cb_data;
@@ -2677,7 +2679,7 @@ static int is_reachable_in_reflog(const char *local, const struct ref *remote)
if (MERGE_BASES_BATCH_SIZE < size)
size = MERGE_BASES_BATCH_SIZE;
- if ((ret = in_merge_bases_many(commit, size, chunk)))
+ if ((ret = repo_in_merge_bases_many(the_repository, commit, size, chunk, 0)))
break;
}
diff --git a/remote.h b/remote.h
index dd44024..dfd4837 100644
--- a/remote.h
+++ b/remote.h
@@ -1,11 +1,11 @@
#ifndef REMOTE_H
#define REMOTE_H
-#include "cache.h"
-#include "parse-options.h"
+#include "hash-ll.h"
#include "hashmap.h"
#include "refspec.h"
+struct option;
struct transport_ls_refs_options;
/**
@@ -118,6 +118,7 @@ struct remote {
* and configuration.
*/
struct remote *remote_get(const char *name);
+struct remote *remote_get_early(const char *name);
struct remote *pushremote_get(const char *name);
int remote_is_configured(struct remote *remote, int in_repo);
@@ -207,9 +208,7 @@ struct ref *find_ref_by_name(const struct ref *list, const char *name);
struct ref *alloc_ref(const char *name);
struct ref *copy_ref(const struct ref *ref);
struct ref *copy_ref_list(const struct ref *ref);
-void sort_ref_list(struct ref **, int (*cmp)(const void *, const void *));
int count_refspec_match(const char *, struct ref *refs, struct ref **matched_ref);
-int ref_compare_name(const void *, const void *);
int check_ref_type(const struct ref *ref, int flags);
@@ -236,6 +235,11 @@ struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,
const struct string_list *server_options,
int stateless_rpc);
+/* Used for protocol v2 in order to retrieve refs from a remote */
+struct bundle_list;
+int get_remote_bundle_uri(int fd_out, struct packet_reader *reader,
+ struct bundle_list *bundles, int stateless_rpc);
+
int resolve_remote_symref(struct ref *ref, struct ref *list);
/*
@@ -248,6 +252,12 @@ int resolve_remote_symref(struct ref *ref, struct ref *list);
struct ref *ref_remove_duplicates(struct ref *ref_map);
/*
+ * Check whether a name matches any negative refspec in rs. Returns 1 if the
+ * name matches at least one negative refspec, and 0 otherwise.
+ */
+int omit_name_by_refspec(const char *name, struct refspec *rs);
+
+/*
* Remove all entries in the input list which match any negative refspec in
* the refspec list.
*/
@@ -371,7 +381,8 @@ int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs,
const char **upstream_name, int for_push,
enum ahead_behind_flags abf);
int format_tracking_info(struct branch *branch, struct strbuf *sb,
- enum ahead_behind_flags abf);
+ enum ahead_behind_flags abf,
+ int show_divergence_advice);
struct ref *get_local_heads(void);
/*
@@ -390,8 +401,6 @@ struct ref *get_stale_heads(struct refspec *rs, struct ref *fetch_map);
/*
* Compare-and-swap
*/
-#define CAS_OPT_NAME "force-with-lease"
-
struct push_cas_option {
unsigned use_tracking_for_rest:1;
unsigned use_force_if_includes:1;
diff --git a/replace-object.c b/replace-object.c
index 7bd9aba..5232155 100644
--- a/replace-object.c
+++ b/replace-object.c
@@ -1,6 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "gettext.h"
+#include "hex.h"
#include "oidmap.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "replace-object.h"
#include "refs.h"
#include "repository.h"
@@ -9,7 +11,8 @@
static int register_replace_ref(struct repository *r,
const char *refname,
const struct object_id *oid,
- int flag, void *cb_data)
+ int flag UNUSED,
+ void *cb_data UNUSED)
{
/* Get sha1 from refname */
const char *slash = strrchr(refname, '/');
@@ -61,7 +64,7 @@ void prepare_replace_object(struct repository *r)
* replacement object's name (replaced recursively, if necessary).
* The return value is either oid or a pointer to a
* permanently-allocated value. This function always respects replace
- * references, regardless of the value of read_replace_refs.
+ * references, regardless of the value of r->settings.read_replace_refs.
*/
const struct object_id *do_lookup_replace_object(struct repository *r,
const struct object_id *oid)
@@ -81,3 +84,29 @@ const struct object_id *do_lookup_replace_object(struct repository *r,
}
die(_("replace depth too high for object %s"), oid_to_hex(oid));
}
+
+/*
+ * This indicator determines whether replace references should be
+ * respected process-wide, regardless of which repository is being
+ * using at the time.
+ */
+static int read_replace_refs = 1;
+
+void disable_replace_refs(void)
+{
+ read_replace_refs = 0;
+}
+
+int replace_refs_enabled(struct repository *r)
+{
+ if (!read_replace_refs)
+ return 0;
+
+ if (r->gitdir) {
+ prepare_repo_settings(r);
+ return r->settings.read_replace_refs;
+ }
+
+ /* repository has no objects or refs. */
+ return 0;
+}
diff --git a/replace-object.h b/replace-object.h
index 3fbc32e..66c41b9 100644
--- a/replace-object.h
+++ b/replace-object.h
@@ -3,7 +3,7 @@
#include "oidmap.h"
#include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
struct replace_object {
struct oidmap_entry original;
@@ -20,6 +20,18 @@ const struct object_id *do_lookup_replace_object(struct repository *r,
const struct object_id *oid);
/*
+ * Some commands disable replace-refs unconditionally, and otherwise each
+ * repository could alter the core.useReplaceRefs config value.
+ *
+ * Return 1 if and only if all of the following are true:
+ *
+ * a. disable_replace_refs() has not been called.
+ * b. GIT_NO_REPLACE_OBJECTS is unset or zero.
+ * c. the given repository does not have core.useReplaceRefs=false.
+ */
+int replace_refs_enabled(struct repository *r);
+
+/*
* If object sha1 should be replaced, return the replacement object's
* name (replaced recursively, if necessary). The return value is
* either sha1 or a pointer to a permanently-allocated value. When
@@ -33,11 +45,19 @@ const struct object_id *do_lookup_replace_object(struct repository *r,
static inline const struct object_id *lookup_replace_object(struct repository *r,
const struct object_id *oid)
{
- if (!read_replace_refs ||
+ if (!replace_refs_enabled(r) ||
(r->objects->replace_map_initialized &&
r->objects->replace_map->map.tablesize == 0))
return oid;
return do_lookup_replace_object(r, oid);
}
+/*
+ * Some commands override config and environment settings for using
+ * replace references. Use this method to disable the setting and ensure
+ * those other settings will not override this choice. This applies
+ * globally to all in-process repositories.
+ */
+void disable_replace_refs(void);
+
#endif /* REPLACE_OBJECT_H */
diff --git a/repo-settings.c b/repo-settings.c
index 2dfcb2b..a0b590b 100644
--- a/repo-settings.c
+++ b/repo-settings.c
@@ -1,8 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "repository.h"
#include "midx.h"
-#include "compat/fsmonitor/fsm-listen.h"
static void repo_cfg_bool(struct repository *r, const char *key, int *dest,
int def)
@@ -11,11 +10,18 @@ static void repo_cfg_bool(struct repository *r, const char *key, int *dest,
*dest = def;
}
+static void repo_cfg_int(struct repository *r, const char *key, int *dest,
+ int def)
+{
+ if (repo_config_get_int(r, key, dest))
+ *dest = def;
+}
+
void prepare_repo_settings(struct repository *r)
{
int experimental;
int value;
- char *strval;
+ const char *strval;
int manyfiles;
if (!r->gitdir)
@@ -36,20 +42,32 @@ void prepare_repo_settings(struct repository *r)
/* Defaults modified by feature.* */
if (experimental) {
r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_SKIPPING;
+ r->settings.pack_use_bitmap_boundary_traversal = 1;
+ r->settings.pack_use_multi_pack_reuse = 1;
}
if (manyfiles) {
r->settings.index_version = 4;
+ r->settings.index_skip_hash = 1;
r->settings.core_untracked_cache = UNTRACKED_CACHE_WRITE;
}
- /* Boolean config or default, does not cascade (simple) */
+ /* Commit graph config or default, does not cascade (simple) */
repo_cfg_bool(r, "core.commitgraph", &r->settings.core_commit_graph, 1);
+ repo_cfg_int(r, "commitgraph.generationversion", &r->settings.commit_graph_generation_version, 2);
repo_cfg_bool(r, "commitgraph.readchangedpaths", &r->settings.commit_graph_read_changed_paths, 1);
repo_cfg_bool(r, "gc.writecommitgraph", &r->settings.gc_write_commit_graph, 1);
repo_cfg_bool(r, "fetch.writecommitgraph", &r->settings.fetch_write_commit_graph, 0);
+
+ /* Boolean config or default, does not cascade (simple) */
repo_cfg_bool(r, "pack.usesparse", &r->settings.pack_use_sparse, 1);
repo_cfg_bool(r, "core.multipackindex", &r->settings.core_multi_pack_index, 1);
repo_cfg_bool(r, "index.sparse", &r->settings.sparse_index, 0);
+ repo_cfg_bool(r, "index.skiphash", &r->settings.index_skip_hash, r->settings.index_skip_hash);
+ repo_cfg_bool(r, "pack.readreverseindex", &r->settings.pack_read_reverse_index, 1);
+ repo_cfg_bool(r, "pack.usebitmapboundarytraversal",
+ &r->settings.pack_use_bitmap_boundary_traversal,
+ r->settings.pack_use_bitmap_boundary_traversal);
+ repo_cfg_bool(r, "core.usereplacerefs", &r->settings.read_replace_refs, 1);
/*
* The GIT_TEST_MULTI_PACK_INDEX variable is special in that
@@ -67,7 +85,7 @@ void prepare_repo_settings(struct repository *r)
if (!repo_config_get_int(r, "index.version", &value))
r->settings.index_version = value;
- if (!repo_config_get_string(r, "core.untrackedcache", &strval)) {
+ if (!repo_config_get_string_tmp(r, "core.untrackedcache", &strval)) {
int v = git_parse_maybe_bool(strval);
/*
@@ -78,10 +96,9 @@ void prepare_repo_settings(struct repository *r)
if (v >= 0)
r->settings.core_untracked_cache = v ?
UNTRACKED_CACHE_WRITE : UNTRACKED_CACHE_REMOVE;
- free(strval);
}
- if (!repo_config_get_string(r, "fetch.negotiationalgorithm", &strval)) {
+ if (!repo_config_get_string_tmp(r, "fetch.negotiationalgorithm", &strval)) {
int fetch_default = r->settings.fetch_negotiation_algorithm;
if (!strcasecmp(strval, "skipping"))
r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_SKIPPING;
diff --git a/repository.c b/repository.c
index 5d166b6..e15b416 100644
--- a/repository.c
+++ b/repository.c
@@ -2,16 +2,22 @@
* not really _using_ the compat macros, just make sure the_index
* declaration matches the definition in this file.
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "cache.h"
+#define USE_THE_INDEX_VARIABLE
+#include "git-compat-util.h"
+#include "abspath.h"
#include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "config.h"
#include "object.h"
#include "lockfile.h"
+#include "path.h"
+#include "read-cache-ll.h"
#include "remote.h"
+#include "setup.h"
+#include "loose.h"
#include "submodule-config.h"
#include "sparse-index.h"
+#include "trace2.h"
#include "promisor-remote.h"
/* The main repository */
@@ -28,6 +34,8 @@ void initialize_the_repository(void)
the_repo.remote_state = remote_state_new();
the_repo.parsed_objects = parsed_object_pool_new();
+ index_state_init(&the_index, the_repository);
+
repo_set_hash_algo(&the_repo, GIT_HASH_SHA1);
}
@@ -97,6 +105,20 @@ void repo_set_hash_algo(struct repository *repo, int hash_algo)
repo->hash_algo = &hash_algos[hash_algo];
}
+void repo_set_compat_hash_algo(struct repository *repo, int algo)
+{
+ if (hash_algo_by_ptr(repo->hash_algo) == algo)
+ BUG("hash_algo and compat_hash_algo match");
+ repo->compat_hash_algo = algo ? &hash_algos[algo] : NULL;
+ if (repo->compat_hash_algo)
+ repo_read_loose_object_map(repo);
+}
+
+void repo_set_ref_storage_format(struct repository *repo, unsigned int format)
+{
+ repo->ref_storage_format = format;
+}
+
/*
* Attempt to resolve and set the provided 'gitdir' for repository 'repo'.
* Return 0 upon success and a non-zero value upon failure.
@@ -177,6 +199,9 @@ int repo_init(struct repository *repo,
goto error;
repo_set_hash_algo(repo, format.hash_algo);
+ 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;
/* take ownership of format.partial_clone */
repo->repository_format_partial_clone = format.partial_clone;
@@ -185,6 +210,9 @@ int repo_init(struct repository *repo,
if (worktree)
repo_set_worktree(repo, worktree);
+ if (repo->compat_hash_algo)
+ repo_read_loose_object_map(repo);
+
clear_repository_format(&format);
return 0;
@@ -248,8 +276,6 @@ static void repo_clear_path_cache(struct repo_path_cache *cache)
FREE_AND_NULL(cache->merge_rr);
FREE_AND_NULL(cache->merge_mode);
FREE_AND_NULL(cache->merge_head);
- FREE_AND_NULL(cache->merge_autostash);
- FREE_AND_NULL(cache->auto_merge);
FREE_AND_NULL(cache->fetch_head);
FREE_AND_NULL(cache->shallow);
}
@@ -302,14 +328,13 @@ int repo_read_index(struct repository *repo)
{
int res;
- if (!repo->index)
- CALLOC_ARRAY(repo->index, 1);
-
/* Complete the double-reference */
- if (!repo->index->repo)
- repo->index->repo = repo;
- else if (repo->index->repo != repo)
+ if (!repo->index) {
+ ALLOC_ARRAY(repo->index, 1);
+ index_state_init(repo->index, repo);
+ } else if (repo->index->repo != repo) {
BUG("repo's index should point back at itself");
+ }
res = read_index_from(repo->index, repo->index_file, repo->gitdir);
diff --git a/repository.h b/repository.h
index 6cc661e..2684367 100644
--- a/repository.h
+++ b/repository.h
@@ -1,8 +1,6 @@
#ifndef REPOSITORY_H
#define REPOSITORY_H
-#include "path.h"
-
struct config_set;
struct fsmonitor_settings;
struct git_hash_algo;
@@ -26,19 +24,37 @@ enum fetch_negotiation_setting {
FETCH_NEGOTIATION_NOOP,
};
+#define REF_STORAGE_FORMAT_UNKNOWN 0
+#define REF_STORAGE_FORMAT_FILES 1
+#define REF_STORAGE_FORMAT_REFTABLE 2
+
struct repo_settings {
int initialized;
int core_commit_graph;
+ int commit_graph_generation_version;
int commit_graph_read_changed_paths;
int gc_write_commit_graph;
int fetch_write_commit_graph;
int command_requires_full_index;
int sparse_index;
+ int pack_read_reverse_index;
+ int pack_use_bitmap_boundary_traversal;
+ int pack_use_multi_pack_reuse;
+
+ /*
+ * Does this repository have core.useReplaceRefs=true (on by
+ * default)? This provides a repository-scoped version of this
+ * config, though it could be disabled process-wide via some Git
+ * builtins or the --no-replace-objects option. See
+ * replace_refs_enabled() for more details.
+ */
+ int read_replace_refs;
struct fsmonitor_settings *fsmonitor; /* lazily loaded */
int index_version;
+ int index_skip_hash;
enum untracked_cache_setting core_untracked_cache;
int pack_use_sparse;
@@ -53,8 +69,6 @@ struct repo_path_cache {
char *merge_rr;
char *merge_mode;
char *merge_head;
- char *merge_autostash;
- char *auto_merge;
char *fetch_head;
char *shallow;
};
@@ -149,6 +163,12 @@ struct repository {
/* Repository's current hash algorithm, as serialized on disk. */
const struct git_hash_algo *hash_algo;
+ /* Repository's compatibility hash algorithm. */
+ const struct git_hash_algo *compat_hash_algo;
+
+ /* Repository's reference storage format, as serialized on disk. */
+ unsigned int ref_storage_format;
+
/* A unique-id for tracing purposes. */
int trace2_repo_id;
@@ -160,12 +180,16 @@ struct repository {
struct promisor_remote_config *promisor_remote_config;
/* Configurations */
+ int repository_format_worktree_config;
/* Indicate if a repository has a different 'commondir' from 'gitdir' */
unsigned different_commondir:1;
};
extern struct repository *the_repository;
+#ifdef USE_THE_INDEX_VARIABLE
+extern struct index_state the_index;
+#endif
/*
* Define a custom repository layout. Any field can be NULL, which
@@ -184,7 +208,10 @@ void repo_set_gitdir(struct repository *repo, const char *root,
const struct set_gitdir_args *extra_args);
void repo_set_worktree(struct repository *repo, const char *path);
void repo_set_hash_algo(struct repository *repo, int algo);
+void repo_set_compat_hash_algo(struct repository *repo, int compat_algo);
+void repo_set_ref_storage_format(struct repository *repo, unsigned int format);
void initialize_the_repository(void);
+RESULT_MUST_BE_USED
int repo_init(struct repository *r, const char *gitdir, const char *worktree);
/*
@@ -196,6 +223,7 @@ int repo_init(struct repository *r, const char *gitdir, const char *worktree);
* Return 0 upon success and a non-zero value upon failure.
*/
struct object_id;
+RESULT_MUST_BE_USED
int repo_submodule_init(struct repository *subrepo,
struct repository *superproject,
const char *path,
@@ -215,9 +243,6 @@ int repo_hold_locked_index(struct repository *repo,
struct lock_file *lf,
int flags);
-int repo_read_index_preload(struct repository *,
- const struct pathspec *pathspec,
- unsigned refresh_flags);
int repo_read_index_unmerged(struct repository *);
/*
* Opportunistically update the index but do not complain if we can't.
diff --git a/rerere.c b/rerere.c
index 876ab43..13c94de 100644
--- a/rerere.c
+++ b/rerere.c
@@ -1,16 +1,21 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
#include "config.h"
+#include "copy.h"
+#include "gettext.h"
+#include "hex.h"
#include "lockfile.h"
#include "string-list.h"
+#include "read-cache-ll.h"
#include "rerere.h"
#include "xdiff-interface.h"
#include "dir.h"
#include "resolve-undo.h"
-#include "ll-merge.h"
-#include "attr.h"
+#include "merge-ll.h"
+#include "path.h"
#include "pathspec.h"
-#include "object-store.h"
-#include "hash-lookup.h"
+#include "object-file.h"
+#include "object-store-ll.h"
#include "strmap.h"
#define RESOLVED 0
@@ -197,7 +202,7 @@ static void read_rr(struct repository *r, struct string_list *rr)
const unsigned hexsz = the_hash_algo->hexsz;
/* There has to be the hash, tab, path and then NUL */
- if (buf.len < hexsz + 2 || get_sha1_hex(buf.buf, hash))
+ if (buf.len < hexsz + 2 || get_hash_hex(buf.buf, hash))
die(_("corrupt MERGE_RR"));
if (buf.buf[hexsz] != '.') {
@@ -965,8 +970,12 @@ static int handle_cache(struct index_state *istate,
break;
i = ce_stage(ce) - 1;
if (!mmfile[i].ptr) {
- mmfile[i].ptr = read_object_file(&ce->oid, &type,
- &size);
+ mmfile[i].ptr = repo_read_object_file(the_repository,
+ &ce->oid, &type,
+ &size);
+ if (!mmfile[i].ptr)
+ die(_("unable to read %s"),
+ oid_to_hex(&ce->oid));
mmfile[i].size = size;
}
}
@@ -1104,7 +1113,7 @@ int rerere_forget(struct repository *r, struct pathspec *pathspec)
* recover the original conflicted state and then
* find the conflicted paths.
*/
- unmerge_index(r->index, pathspec);
+ unmerge_index(r->index, pathspec, 0);
find_conflict(r, &conflict);
for (i = 0; i < conflict.nr; i++) {
struct string_list_item *it = &conflict.items[i];
diff --git a/rerere.h b/rerere.h
index c32d79c..5d6cb63 100644
--- a/rerere.h
+++ b/rerere.h
@@ -1,6 +1,7 @@
#ifndef RERERE_H
#define RERERE_H
+#include "gettext.h"
#include "string-list.h"
struct pathspec;
@@ -24,9 +25,6 @@ struct rerere_id {
};
int setup_rerere(struct repository *,struct string_list *, int);
-#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
-#define rerere(flags) repo_rerere(the_repository, flags)
-#endif
int repo_rerere(struct repository *, int);
/*
* Given the conflict ID and the name of a "file" used for replaying
diff --git a/reset.c b/reset.c
index e3383a9..d619cb7 100644
--- a/reset.c
+++ b/reset.c
@@ -1,9 +1,11 @@
#include "git-compat-util.h"
#include "cache-tree.h"
+#include "gettext.h"
+#include "hex.h"
#include "lockfile.h"
+#include "object-name.h"
#include "refs.h"
#include "reset.h"
-#include "run-command.h"
#include "tree-walk.h"
#include "tree.h"
#include "unpack-trees.h"
@@ -38,7 +40,7 @@ static int update_refs(const struct reset_head_opts *opts,
prefix_len = msg.len;
if (update_orig_head) {
- if (!get_oid("ORIG_HEAD", &oid_old_orig))
+ if (!repo_get_oid(the_repository, "ORIG_HEAD", &oid_old_orig))
old_orig = &oid_old_orig;
if (head) {
if (!reflog_orig_head) {
@@ -106,7 +108,7 @@ int reset_head(struct repository *r, const struct reset_head_opts *opts)
goto leave_reset_head;
}
- if (!get_oid("HEAD", &head_oid)) {
+ if (!repo_get_oid(r, "HEAD", &head_oid)) {
head = &head_oid;
} else if (!oid || !reset_hard) {
ret = error(_("could not determine HEAD revision"));
@@ -128,6 +130,7 @@ int reset_head(struct repository *r, const struct reset_head_opts *opts)
unpack_tree_opts.update = 1;
unpack_tree_opts.merge = 1;
unpack_tree_opts.preserve_ignored = 0; /* FIXME: !overwrite_ignore */
+ unpack_tree_opts.skip_cache_tree_update = 1;
init_checkout_metadata(&unpack_tree_opts.meta, switch_to_branch, oid, NULL);
if (reset_hard)
unpack_tree_opts.reset = UNPACK_RESET_PROTECT_UNTRACKED;
@@ -154,6 +157,11 @@ int reset_head(struct repository *r, const struct reset_head_opts *opts)
}
tree = parse_tree_indirect(oid);
+ if (!tree) {
+ ret = error(_("unable to read tree (%s)"), oid_to_hex(oid));
+ goto leave_reset_head;
+ }
+
prime_cache_tree(r, r->index, tree);
if (write_locked_index(r->index, &lock, COMMIT_LOCK) < 0) {
diff --git a/reset.h b/reset.h
index a28f818..10708d8 100644
--- a/reset.h
+++ b/reset.h
@@ -1,7 +1,7 @@
#ifndef RESET_H
#define RESET_H
-#include "hash.h"
+#include "hash-ll.h"
#include "repository.h"
#define GIT_REFLOG_ACTION_ENVIRONMENT "GIT_REFLOG_ACTION"
diff --git a/resolve-undo.c b/resolve-undo.c
index e81096e..cd02dc9 100644
--- a/resolve-undo.c
+++ b/resolve-undo.c
@@ -1,6 +1,9 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "dir.h"
+#include "hash.h"
+#include "read-cache.h"
#include "resolve-undo.h"
+#include "sparse-index.h"
#include "string-list.h"
/* The only error case is to run out of memory in string-list */
@@ -114,86 +117,59 @@ void resolve_undo_clear_index(struct index_state *istate)
istate->cache_changed |= RESOLVE_UNDO_CHANGED;
}
-int unmerge_index_entry_at(struct index_state *istate, int pos)
+int unmerge_index_entry(struct index_state *istate, const char *path,
+ struct resolve_undo_info *ru, unsigned ce_flags)
{
- const struct cache_entry *ce;
- struct string_list_item *item;
- struct resolve_undo_info *ru;
- int i, err = 0, matched;
- char *name;
-
- if (!istate->resolve_undo)
- return pos;
-
- ce = istate->cache[pos];
- if (ce_stage(ce)) {
- /* already unmerged */
- while ((pos < istate->cache_nr) &&
- ! strcmp(istate->cache[pos]->name, ce->name))
- pos++;
- return pos - 1; /* return the last entry processed */
+ int i = index_name_pos(istate, path, strlen(path));
+
+ if (i < 0) {
+ /* unmerged? */
+ i = -i - 1;
+ if (i < istate->cache_nr &&
+ !strcmp(istate->cache[i]->name, path))
+ /* yes, it is already unmerged */
+ return 0;
+ /* fallthru: resolved to removal */
+ } else {
+ /* merged - remove it to replace it with unmerged entries */
+ remove_index_entry_at(istate, i);
}
- item = string_list_lookup(istate->resolve_undo, ce->name);
- if (!item)
- return pos;
- ru = item->util;
- if (!ru)
- return pos;
- matched = ce->ce_flags & CE_MATCHED;
- name = xstrdup(ce->name);
- remove_index_entry_at(istate, pos);
+
for (i = 0; i < 3; i++) {
- struct cache_entry *nce;
+ struct cache_entry *ce;
if (!ru->mode[i])
continue;
- nce = make_cache_entry(istate,
- ru->mode[i],
- &ru->oid[i],
- name, i + 1, 0);
- if (matched)
- nce->ce_flags |= CE_MATCHED;
- if (add_index_entry(istate, nce, ADD_CACHE_OK_TO_ADD)) {
- err = 1;
- error("cannot unmerge '%s'", name);
- }
+ ce = make_cache_entry(istate, ru->mode[i], &ru->oid[i],
+ path, i + 1, 0);
+ ce->ce_flags |= ce_flags;
+ if (add_index_entry(istate, ce, ADD_CACHE_OK_TO_ADD))
+ return error("cannot unmerge '%s'", path);
}
- free(name);
- if (err)
- return pos;
- free(ru);
- item->util = NULL;
- return unmerge_index_entry_at(istate, pos);
+ return 0;
}
-void unmerge_marked_index(struct index_state *istate)
+void unmerge_index(struct index_state *istate, const struct pathspec *pathspec,
+ unsigned ce_flags)
{
- int i;
+ struct string_list_item *item;
if (!istate->resolve_undo)
return;
/* TODO: audit for interaction with sparse-index. */
ensure_full_index(istate);
- for (i = 0; i < istate->cache_nr; i++) {
- const struct cache_entry *ce = istate->cache[i];
- if (ce->ce_flags & CE_MATCHED)
- i = unmerge_index_entry_at(istate, i);
- }
-}
-void unmerge_index(struct index_state *istate, const struct pathspec *pathspec)
-{
- int i;
-
- if (!istate->resolve_undo)
- return;
-
- /* TODO: audit for interaction with sparse-index. */
- ensure_full_index(istate);
- for (i = 0; i < istate->cache_nr; i++) {
- const struct cache_entry *ce = istate->cache[i];
- if (!ce_path_match(istate, ce, pathspec, NULL))
+ for_each_string_list_item(item, istate->resolve_undo) {
+ const char *path = item->string;
+ struct resolve_undo_info *ru = item->util;
+ if (!item->util)
+ continue;
+ if (!match_pathspec(istate, pathspec,
+ item->string, strlen(item->string),
+ 0, NULL, 0))
continue;
- i = unmerge_index_entry_at(istate, i);
+ unmerge_index_entry(istate, path, ru, ce_flags);
+ free(ru);
+ item->util = NULL;
}
}
diff --git a/resolve-undo.h b/resolve-undo.h
index 2b3f0f9..f3f8462 100644
--- a/resolve-undo.h
+++ b/resolve-undo.h
@@ -1,7 +1,12 @@
#ifndef RESOLVE_UNDO_H
#define RESOLVE_UNDO_H
-#include "cache.h"
+struct cache_entry;
+struct index_state;
+struct pathspec;
+struct string_list;
+
+#include "hash-ll.h"
struct resolve_undo_info {
unsigned int mode[3];
@@ -12,8 +17,7 @@ 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_clear_index(struct index_state *);
-int unmerge_index_entry_at(struct index_state *, int);
-void unmerge_index(struct index_state *, const struct pathspec *);
-void unmerge_marked_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);
#endif
diff --git a/revision.c b/revision.c
index 0c6e26c..7e45f76 100644
--- a/revision.c
+++ b/revision.c
@@ -1,5 +1,12 @@
-#include "cache.h"
-#include "object-store.h"
+#include "git-compat-util.h"
+#include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-name.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "oidset.h"
#include "tag.h"
#include "blob.h"
#include "tree.h"
@@ -14,17 +21,19 @@
#include "reflog-walk.h"
#include "patch-ids.h"
#include "decorate.h"
-#include "log-tree.h"
#include "string-list.h"
#include "line-log.h"
#include "mailmap.h"
#include "commit-slab.h"
-#include "dir.h"
#include "cache-tree.h"
#include "bisect.h"
#include "packfile.h"
#include "worktree.h"
+#include "read-cache.h"
+#include "setup.h"
+#include "sparse-index.h"
#include "strvec.h"
+#include "trace2.h"
#include "commit-reach.h"
#include "commit-graph.h"
#include "prio-queue.h"
@@ -34,6 +43,8 @@
#include "json-writer.h"
#include "list-objects-filter-options.h"
#include "resolve-undo.h"
+#include "parse-options.h"
+#include "wildmatch.h"
volatile show_early_output_fn_t show_early_output;
@@ -47,13 +58,6 @@ static inline int want_ancestry(const struct rev_info *revs);
void show_object_with_name(FILE *out, struct object *obj, const char *name)
{
fprintf(out, "%s ", oid_to_hex(&obj->oid));
- /*
- * This "for (const char *p = ..." is made as a first step towards
- * making use of such declarations elsewhere in our codebase. If
- * it causes compilation problems on your platform, please report
- * it to the Git mailing list at git@vger.kernel.org. In the meantime,
- * adding -std=gnu99 to CFLAGS may help if you are with older GCC.
- */
for (const char *p = name; *p && *p != '\n'; p++)
fputc(*p, out);
fputc('\n', out);
@@ -77,7 +81,7 @@ static void mark_tree_contents_uninteresting(struct repository *r,
if (parse_tree_gently(tree, 1) < 0)
return;
- init_tree_desc(&desc, tree->buffer, tree->size);
+ init_tree_desc(&desc, &tree->object.oid, tree->buffer, tree->size);
while (tree_entry(&desc, &entry)) {
switch (object_type(entry.mode)) {
case OBJ_TREE:
@@ -119,10 +123,10 @@ struct path_and_oids_entry {
struct oidset trees;
};
-static int path_and_oids_cmp(const void *hashmap_cmp_fn_data,
+static int path_and_oids_cmp(const void *hashmap_cmp_fn_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
- const void *keydata)
+ const void *keydata UNUSED)
{
const struct path_and_oids_entry *e1, *e2;
@@ -184,7 +188,7 @@ static void add_children_by_path(struct repository *r,
if (parse_tree_gently(tree, 1) < 0)
return;
- init_tree_desc(&desc, tree->buffer, tree->size);
+ init_tree_desc(&desc, &tree->object.oid, tree->buffer, tree->size);
while (tree_entry(&desc, &entry)) {
switch (object_type(entry.mode)) {
case OBJ_TREE:
@@ -330,7 +334,8 @@ static void add_pending_object_with_path(struct rev_info *revs,
if (revs->reflog_info && obj->type == OBJ_COMMIT) {
struct strbuf buf = STRBUF_INIT;
size_t namelen = strlen(name);
- int len = interpret_branch_name(name, namelen, &buf, &options);
+ int len = repo_interpret_branch_name(the_repository, name,
+ namelen, &buf, &options);
if (0 < len && len < namelen && buf.len)
strbuf_addstr(&buf, name + len);
@@ -360,7 +365,7 @@ void add_head_to_pending(struct rev_info *revs)
{
struct object_id oid;
struct object *obj;
- if (get_oid("HEAD", &oid))
+ if (repo_get_oid(the_repository, "HEAD", &oid))
return;
obj = parse_object(revs->repo, &oid);
if (!obj)
@@ -373,24 +378,21 @@ static struct object *get_reference(struct rev_info *revs, const char *name,
unsigned int flags)
{
struct object *object;
- struct commit *commit;
- /*
- * If the repository has commit graphs, we try to opportunistically
- * look up the object ID in those graphs. Like this, we can avoid
- * parsing commit data from disk.
- */
- commit = lookup_commit_in_graph(revs->repo, oid);
- if (commit)
- object = &commit->object;
- else
- object = parse_object(revs->repo, oid);
+ object = parse_object_with_flags(revs->repo, oid,
+ revs->verify_objects ? 0 :
+ PARSE_OBJECT_SKIP_HASH_CHECK |
+ PARSE_OBJECT_DISCARD_TREE);
if (!object) {
if (revs->ignore_missing)
- return object;
+ return NULL;
if (revs->exclude_promisor_objects && is_promisor_object(oid))
return NULL;
+ if (revs->do_not_die_on_missing_objects) {
+ oidset_insert(&revs->missing_commits, oid);
+ return NULL;
+ }
die("bad object %s", name);
}
object->flags |= flags;
@@ -418,15 +420,21 @@ static struct commit *handle_commit(struct rev_info *revs,
*/
while (object->type == OBJ_TAG) {
struct tag *tag = (struct tag *) object;
+ struct object_id *oid;
if (revs->tag_objects && !(flags & UNINTERESTING))
add_pending_object(revs, object, tag->tag);
- object = parse_object(revs->repo, get_tagged_oid(tag));
+ oid = get_tagged_oid(tag);
+ object = parse_object(revs->repo, oid);
if (!object) {
if (revs->ignore_missing_links || (flags & UNINTERESTING))
return NULL;
if (revs->exclude_promisor_objects &&
is_promisor_object(&tag->tagged->oid))
return NULL;
+ if (revs->do_not_die_on_missing_objects && oid) {
+ oidset_insert(&revs->missing_commits, oid);
+ return NULL;
+ }
die("bad object %s", oid_to_hex(&tag->tagged->oid));
}
object->flags |= flags;
@@ -614,10 +622,12 @@ static struct commit *one_relevant_parent(const struct rev_info *revs,
static int tree_difference = REV_TREE_SAME;
static void file_add_remove(struct diff_options *options,
- int addremove, unsigned mode,
- const struct object_id *oid,
- int oid_valid,
- const char *fullpath, unsigned dirty_submodule)
+ int addremove,
+ unsigned mode UNUSED,
+ const struct object_id *oid UNUSED,
+ int oid_valid UNUSED,
+ const char *fullpath UNUSED,
+ unsigned dirty_submodule UNUSED)
{
int diff = addremove == '+' ? REV_TREE_NEW : REV_TREE_OLD;
struct rev_info *revs = options->change_fn_data;
@@ -628,12 +638,15 @@ static void file_add_remove(struct diff_options *options,
}
static void file_change(struct diff_options *options,
- unsigned old_mode, unsigned new_mode,
- const struct object_id *old_oid,
- const struct object_id *new_oid,
- int old_oid_valid, int new_oid_valid,
- const char *fullpath,
- unsigned old_dirty_submodule, unsigned new_dirty_submodule)
+ unsigned old_mode UNUSED,
+ unsigned new_mode UNUSED,
+ const struct object_id *old_oid UNUSED,
+ const struct object_id *new_oid UNUSED,
+ int old_oid_valid UNUSED,
+ int new_oid_valid UNUSED,
+ const char *fullpath UNUSED,
+ unsigned old_dirty_submodule UNUSED,
+ unsigned new_dirty_submodule UNUSED)
{
tree_difference = REV_TREE_DIFFERENT;
options->flags.has_changes = 1;
@@ -786,8 +799,8 @@ static int check_maybe_different_in_bloom_filter(struct rev_info *revs,
static int rev_compare_tree(struct rev_info *revs,
struct commit *parent, struct commit *commit, int nth_parent)
{
- struct tree *t1 = get_commit_tree(parent);
- struct tree *t2 = get_commit_tree(commit);
+ struct tree *t1 = repo_get_commit_tree(the_repository, parent);
+ struct tree *t2 = repo_get_commit_tree(the_repository, commit);
int bloom_ret = 1;
if (!t1)
@@ -833,7 +846,7 @@ static int rev_compare_tree(struct rev_info *revs,
static int rev_same_tree_as_empty(struct rev_info *revs, struct commit *commit)
{
- struct tree *t1 = get_commit_tree(commit);
+ struct tree *t1 = repo_get_commit_tree(the_repository, commit);
if (!t1)
return 0;
@@ -971,7 +984,7 @@ static void try_to_simplify_commit(struct rev_info *revs, struct commit *commit)
if (!revs->prune)
return;
- if (!get_commit_tree(commit))
+ if (!repo_get_commit_tree(the_repository, commit))
return;
if (!commit->parents) {
@@ -1105,10 +1118,13 @@ static int process_parents(struct rev_info *revs, struct commit *commit,
struct commit_list **list, struct prio_queue *queue)
{
struct commit_list *parent = commit->parents;
- unsigned left_flag;
+ unsigned pass_flags;
if (commit->object.flags & ADDED)
return 0;
+ if (revs->do_not_die_on_missing_objects &&
+ oidset_contains(&revs->missing_commits, &commit->object.oid))
+ return 0;
commit->object.flags |= ADDED;
if (revs->include_check &&
@@ -1160,12 +1176,13 @@ static int process_parents(struct rev_info *revs, struct commit *commit,
if (revs->no_walk)
return 0;
- left_flag = (commit->object.flags & SYMMETRIC_LEFT);
+ pass_flags = (commit->object.flags & (SYMMETRIC_LEFT | ANCESTRY_PATH));
for (parent = commit->parents; parent; parent = parent->next) {
struct commit *p = parent->item;
int gently = revs->ignore_missing_links ||
- revs->exclude_promisor_objects;
+ revs->exclude_promisor_objects ||
+ 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)) {
@@ -1173,7 +1190,11 @@ static int process_parents(struct rev_info *revs, struct commit *commit,
break;
continue;
}
- return -1;
+
+ if (revs->do_not_die_on_missing_objects)
+ oidset_insert(&revs->missing_commits, &p->object.oid);
+ else
+ return -1; /* corrupt repository */
}
if (revs->sources) {
char **slot = revision_sources_at(revs->sources, p);
@@ -1181,7 +1202,7 @@ static int process_parents(struct rev_info *revs, struct commit *commit,
if (!*slot)
*slot = *revision_sources_at(revs->sources, commit);
}
- p->object.flags |= left_flag;
+ p->object.flags |= pass_flags;
if (!(p->object.flags & SEEN)) {
p->object.flags |= (SEEN | NOT_USER_GIVEN);
if (list)
@@ -1304,13 +1325,24 @@ static int still_interesting(struct commit_list *src, timestamp_t date, int slop
}
/*
- * "rev-list --ancestry-path A..B" computes commits that are ancestors
- * of B but not ancestors of A but further limits the result to those
- * that are descendants of A. This takes the list of bottom commits and
- * the result of "A..B" without --ancestry-path, and limits the latter
- * further to the ones that can reach one of the commits in "bottom".
+ * "rev-list --ancestry-path=C_0 [--ancestry-path=C_1 ...] A..B"
+ * computes commits that are ancestors of B but not ancestors of A but
+ * further limits the result to those that have any of C in their
+ * ancestry path (i.e. are either ancestors of any of C, descendants
+ * of any of C, or are any of C). If --ancestry-path is specified with
+ * no commit, we use all bottom commits for C.
+ *
+ * Before this function is called, ancestors of C will have already
+ * been marked with ANCESTRY_PATH previously.
+ *
+ * This takes the list of bottom commits and the result of "A..B"
+ * without --ancestry-path, and limits the latter further to the ones
+ * that have any of C in their ancestry path. Since the ancestors of C
+ * have already been marked (a prerequisite of this function), we just
+ * need to mark the descendants, then exclude any commit that does not
+ * have any of these marks.
*/
-static void limit_to_ancestry(struct commit_list *bottom, struct commit_list *list)
+static void limit_to_ancestry(struct commit_list *bottoms, struct commit_list *list)
{
struct commit_list *p;
struct commit_list *rlist = NULL;
@@ -1323,7 +1355,7 @@ static void limit_to_ancestry(struct commit_list *bottom, struct commit_list *li
for (p = list; p; p = p->next)
commit_list_insert(p->item, &rlist);
- for (p = bottom; p; p = p->next)
+ for (p = bottoms; p; p = p->next)
p->item->object.flags |= TMP_MARK;
/*
@@ -1356,38 +1388,39 @@ static void limit_to_ancestry(struct commit_list *bottom, struct commit_list *li
*/
/*
- * The ones that are not marked with TMP_MARK are uninteresting
+ * The ones that are not marked with either TMP_MARK or
+ * ANCESTRY_PATH are uninteresting
*/
for (p = list; p; p = p->next) {
struct commit *c = p->item;
- if (c->object.flags & TMP_MARK)
+ if (c->object.flags & (TMP_MARK | ANCESTRY_PATH))
continue;
c->object.flags |= UNINTERESTING;
}
- /* We are done with the TMP_MARK */
+ /* We are done with TMP_MARK and ANCESTRY_PATH */
for (p = list; p; p = p->next)
- p->item->object.flags &= ~TMP_MARK;
- for (p = bottom; p; p = p->next)
- p->item->object.flags &= ~TMP_MARK;
+ p->item->object.flags &= ~(TMP_MARK | ANCESTRY_PATH);
+ for (p = bottoms; p; p = p->next)
+ p->item->object.flags &= ~(TMP_MARK | ANCESTRY_PATH);
free_commit_list(rlist);
}
/*
- * Before walking the history, keep the set of "negative" refs the
- * caller has asked to exclude.
+ * Before walking the history, add the set of "negative" refs the
+ * caller has asked to exclude to the bottom list.
*
* This is used to compute "rev-list --ancestry-path A..B", as we need
* to filter the result of "A..B" further to the ones that can actually
* reach A.
*/
-static struct commit_list *collect_bottom_commits(struct commit_list *list)
+static void collect_bottom_commits(struct commit_list *list,
+ struct commit_list **bottom)
{
- struct commit_list *elem, *bottom = NULL;
+ struct commit_list *elem;
for (elem = list; elem; elem = elem->next)
if (elem->item->object.flags & BOTTOM)
- commit_list_insert(elem->item, &bottom);
- return bottom;
+ commit_list_insert(elem->item, bottom);
}
/* Assumes either left_only or right_only is set */
@@ -1414,12 +1447,12 @@ static int limit_list(struct rev_info *revs)
struct commit_list *original_list = revs->commits;
struct commit_list *newlist = NULL;
struct commit_list **p = &newlist;
- struct commit_list *bottom = NULL;
struct commit *interesting_cache = NULL;
- if (revs->ancestry_path) {
- bottom = collect_bottom_commits(original_list);
- if (!bottom)
+ if (revs->ancestry_path_implicit_bottoms) {
+ collect_bottom_commits(original_list,
+ &revs->ancestry_path_bottoms);
+ if (!revs->ancestry_path_bottoms)
die("--ancestry-path given but there are no bottom commits");
}
@@ -1464,9 +1497,8 @@ static int limit_list(struct rev_info *revs)
if (revs->left_only || revs->right_only)
limit_left_right(newlist, revs);
- if (bottom)
- limit_to_ancestry(bottom, newlist);
- free_commit_list(bottom);
+ if (revs->ancestry_path)
+ limit_to_ancestry(revs->ancestry_path_bottoms, newlist);
/*
* Check if any commits have become TREESAME by some of their parents
@@ -1521,34 +1553,88 @@ static void add_rev_cmdline_list(struct rev_info *revs,
}
}
-struct all_refs_cb {
- int all_flags;
- int warned_bad_reflog;
- struct rev_info *all_revs;
- const char *name_for_errormsg;
- struct worktree *wt;
-};
-
-int ref_excluded(struct string_list *ref_excludes, const char *path)
+int ref_excluded(const struct ref_exclusions *exclusions, const char *path)
{
+ const char *stripped_path = strip_namespace(path);
struct string_list_item *item;
- if (!ref_excludes)
- return 0;
- for_each_string_list_item(item, ref_excludes) {
+ for_each_string_list_item(item, &exclusions->excluded_refs) {
if (!wildmatch(item->string, path, 0))
return 1;
}
+
+ if (ref_is_hidden(stripped_path, path, &exclusions->hidden_refs))
+ return 1;
+
return 0;
}
+void init_ref_exclusions(struct ref_exclusions *exclusions)
+{
+ struct ref_exclusions blank = REF_EXCLUSIONS_INIT;
+ memcpy(exclusions, &blank, sizeof(*exclusions));
+}
+
+void clear_ref_exclusions(struct ref_exclusions *exclusions)
+{
+ string_list_clear(&exclusions->excluded_refs, 0);
+ strvec_clear(&exclusions->hidden_refs);
+ exclusions->hidden_refs_configured = 0;
+}
+
+void add_ref_exclusion(struct ref_exclusions *exclusions, const char *exclude)
+{
+ string_list_append(&exclusions->excluded_refs, exclude);
+}
+
+struct exclude_hidden_refs_cb {
+ struct ref_exclusions *exclusions;
+ const char *section;
+};
+
+static int hide_refs_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *cb_data)
+{
+ struct exclude_hidden_refs_cb *cb = cb_data;
+ cb->exclusions->hidden_refs_configured = 1;
+ return parse_hide_refs_config(var, value, cb->section,
+ &cb->exclusions->hidden_refs);
+}
+
+void exclude_hidden_refs(struct ref_exclusions *exclusions, const char *section)
+{
+ struct exclude_hidden_refs_cb cb;
+
+ if (strcmp(section, "fetch") && strcmp(section, "receive") &&
+ strcmp(section, "uploadpack"))
+ die(_("unsupported section for hidden refs: %s"), section);
+
+ if (exclusions->hidden_refs_configured)
+ die(_("--exclude-hidden= passed more than once"));
+
+ cb.exclusions = exclusions;
+ cb.section = section;
+
+ git_config(hide_refs_config, &cb);
+}
+
+struct all_refs_cb {
+ int all_flags;
+ int warned_bad_reflog;
+ struct rev_info *all_revs;
+ const char *name_for_errormsg;
+ struct worktree *wt;
+};
+
static int handle_one_ref(const char *path, const struct object_id *oid,
- int flag, void *cb_data)
+ int flag UNUSED,
+ void *cb_data)
{
struct all_refs_cb *cb = cb_data;
struct object *object;
- if (ref_excluded(cb->all_revs->ref_excludes, path))
+ if (ref_excluded(&cb->all_revs->ref_excludes, path))
return 0;
object = get_reference(cb->all_revs, path, oid, cb->all_flags);
@@ -1566,24 +1652,6 @@ static void init_all_refs_cb(struct all_refs_cb *cb, struct rev_info *revs,
cb->wt = NULL;
}
-void clear_ref_exclusion(struct string_list **ref_excludes_p)
-{
- if (*ref_excludes_p) {
- string_list_clear(*ref_excludes_p, 0);
- free(*ref_excludes_p);
- }
- *ref_excludes_p = NULL;
-}
-
-void add_ref_exclusion(struct string_list **ref_excludes_p, const char *exclude)
-{
- if (!*ref_excludes_p) {
- CALLOC_ARRAY(*ref_excludes_p, 1);
- (*ref_excludes_p)->strdup_strings = 1;
- }
- string_list_append(*ref_excludes_p, exclude);
-}
-
static void handle_refs(struct ref_store *refs,
struct rev_info *revs, unsigned flags,
int (*for_each)(struct ref_store *, each_ref_fn, void *))
@@ -1618,17 +1686,18 @@ static void handle_one_reflog_commit(struct object_id *oid, void *cb_data)
}
static int handle_one_reflog_ent(struct object_id *ooid, struct object_id *noid,
- const char *email, timestamp_t timestamp, int tz,
- const char *message, void *cb_data)
+ const char *email UNUSED,
+ timestamp_t timestamp UNUSED,
+ int tz UNUSED,
+ const char *message UNUSED,
+ void *cb_data)
{
handle_one_reflog_commit(ooid, cb_data);
handle_one_reflog_commit(noid, cb_data);
return 0;
}
-static int handle_one_reflog(const char *refname_in_wt,
- const struct object_id *oid,
- int flag, void *cb_data)
+static int handle_one_reflog(const char *refname_in_wt, void *cb_data)
{
struct all_refs_cb *cb = cb_data;
struct strbuf refname = STRBUF_INIT;
@@ -1775,7 +1844,7 @@ void add_index_objects_to_pending(struct rev_info *revs, unsigned int flags)
worktrees = get_worktrees();
for (p = worktrees; *p; p++) {
struct worktree *wt = *p;
- struct index_state istate = { NULL };
+ struct index_state istate = INDEX_STATE_INIT(revs->repo);
if (wt->is_current)
continue; /* current index already taken care of */
@@ -1829,7 +1898,7 @@ static int add_parents_only(struct rev_info *revs, const char *arg_, int flags,
flags ^= UNINTERESTING | BOTTOM;
arg++;
}
- if (get_oid_committish(arg, &oid))
+ if (repo_get_oid_committish(the_repository, arg, &oid))
return 0;
while (1) {
it = get_reference(revs, arg, &oid, 0);
@@ -1865,30 +1934,15 @@ void repo_init_revisions(struct repository *r,
struct rev_info *revs,
const char *prefix)
{
- memset(revs, 0, sizeof(*revs));
+ struct rev_info blank = REV_INFO_INIT;
+ memcpy(revs, &blank, sizeof(*revs));
revs->repo = r;
- revs->abbrev = DEFAULT_ABBREV;
- revs->simplify_history = 1;
revs->pruning.repo = r;
- revs->pruning.flags.recursive = 1;
- revs->pruning.flags.quick = 1;
revs->pruning.add_remove = file_add_remove;
revs->pruning.change = file_change;
revs->pruning.change_fn_data = revs;
- revs->sort_order = REV_SORT_IN_GRAPH_ORDER;
- revs->dense = 1;
revs->prefix = prefix;
- revs->max_age = -1;
- revs->max_age_as_filter = -1;
- revs->min_age = -1;
- revs->skip_count = -1;
- revs->max_count = -1;
- revs->max_parents = -1;
- revs->expand_tabs_in_log = -1;
-
- revs->commit_format = CMIT_FMT_DEFAULT;
- revs->expand_tabs_in_log_default = 8;
grep_init(&revs->grep_filter, revs->repo);
revs->grep_filter.status_only = 1;
@@ -1900,6 +1954,9 @@ void repo_init_revisions(struct repository *r,
}
init_display_notes(&revs->notes_opt);
+ list_objects_filter_init(&revs->filter);
+ init_ref_exclusions(&revs->ref_excludes);
+ oidset_init(&revs->missing_commits, 0);
}
static void add_pending_commit_list(struct rev_info *revs,
@@ -1914,24 +1971,44 @@ static void add_pending_commit_list(struct rev_info *revs,
}
}
+static const char *lookup_other_head(struct object_id *oid)
+{
+ int i;
+ static const char *const other_head[] = {
+ "MERGE_HEAD", "CHERRY_PICK_HEAD", "REVERT_HEAD", "REBASE_HEAD"
+ };
+
+ for (i = 0; i < ARRAY_SIZE(other_head); i++)
+ if (!read_ref_full(other_head[i],
+ RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
+ oid, NULL)) {
+ if (is_null_oid(oid))
+ die(_("%s exists but is a symbolic ref"), other_head[i]);
+ return other_head[i];
+ }
+
+ die(_("--merge requires one of the pseudorefs MERGE_HEAD, CHERRY_PICK_HEAD, REVERT_HEAD or REBASE_HEAD"));
+}
+
static void prepare_show_merge(struct rev_info *revs)
{
- struct commit_list *bases;
+ struct commit_list *bases = NULL;
struct commit *head, *other;
struct object_id oid;
+ const char *other_name;
const char **prune = NULL;
int i, prune_num = 1; /* counting terminating NULL */
struct index_state *istate = revs->repo->index;
- if (get_oid("HEAD", &oid))
+ if (repo_get_oid(the_repository, "HEAD", &oid))
die("--merge without HEAD?");
head = lookup_commit_or_die(&oid, "HEAD");
- if (get_oid("MERGE_HEAD", &oid))
- die("--merge without MERGE_HEAD?");
- other = lookup_commit_or_die(&oid, "MERGE_HEAD");
+ other_name = lookup_other_head(&oid);
+ other = lookup_commit_or_die(&oid, other_name);
add_pending_object(revs, &head->object, "HEAD");
- add_pending_object(revs, &other->object, "MERGE_HEAD");
- bases = get_merge_bases(head, other);
+ add_pending_object(revs, &other->object, other_name);
+ if (repo_get_merge_bases(the_repository, head, other, &bases) < 0)
+ exit(128);
add_rev_cmdline_list(revs, bases, REV_CMD_MERGE_BASE, UNINTERESTING | BOTTOM);
add_pending_commit_list(revs, bases, UNINTERESTING | BOTTOM);
free_commit_list(bases);
@@ -2019,14 +2096,17 @@ static int handle_dotdot_1(const char *arg, char *dotdot,
} else {
/* A...B -- find merge bases between the two */
struct commit *a, *b;
- struct commit_list *exclude;
+ struct commit_list *exclude = NULL;
a = lookup_commit_reference(revs->repo, &a_obj->oid);
b = lookup_commit_reference(revs->repo, &b_obj->oid);
if (!a || !b)
return dotdot_missing(arg, dotdot, revs, symmetric);
- exclude = get_merge_bases(a, b);
+ if (repo_get_merge_bases(the_repository, a, b, &exclude) < 0) {
+ free_commit_list(exclude);
+ return -1;
+ }
add_rev_cmdline_list(revs, exclude, REV_CMD_MERGE_BASE,
flags_exclude);
add_pending_commit_list(revs, exclude, flags_exclude);
@@ -2112,9 +2192,8 @@ static int handle_revision_arg_1(const char *arg_, struct rev_info *revs, int fl
int exclude_parent = 1;
if (mark[2]) {
- char *end;
- exclude_parent = strtoul(mark + 2, &end, 10);
- if (*end != '\0' || !exclude_parent)
+ if (strtol_i(mark + 2, 10, &exclude_parent) ||
+ exclude_parent < 1)
return -1;
}
@@ -2132,13 +2211,18 @@ static int handle_revision_arg_1(const char *arg_, struct rev_info *revs, int fl
if (revarg_opt & REVARG_COMMITTISH)
get_sha1_flags |= GET_OID_COMMITTISH;
+ /*
+ * Even if revs->do_not_die_on_missing_objects is set, we
+ * should error out if we can't even get an oid, as
+ * `--missing=print` should be able to report missing oids.
+ */
if (get_oid_with_context(revs->repo, arg, get_sha1_flags, &oid, &oc))
return revs->ignore_missing ? 0 : -1;
if (!cant_be_filename)
verify_non_filename(revs->prefix, arg);
object = get_reference(revs, arg, &oid, flags ^ local_flags);
if (!object)
- return revs->ignore_missing ? 0 : -1;
+ return (revs->ignore_missing || revs->do_not_die_on_missing_objects) ? 0 : -1;
add_rev_cmdline(revs, object, arg_, REV_CMD_REV, flags ^ local_flags);
add_pending_object_with_path(revs, object, arg, oc.mode, oc.path);
free(oc.path);
@@ -2160,39 +2244,6 @@ static void read_pathspec_from_stdin(struct strbuf *sb,
strvec_push(prune, sb->buf);
}
-static void read_revisions_from_stdin(struct rev_info *revs,
- struct strvec *prune)
-{
- struct strbuf sb;
- int seen_dashdash = 0;
- int save_warning;
-
- save_warning = warn_on_object_refname_ambiguity;
- warn_on_object_refname_ambiguity = 0;
-
- strbuf_init(&sb, 1000);
- while (strbuf_getline(&sb, stdin) != EOF) {
- int len = sb.len;
- if (!len)
- break;
- if (sb.buf[0] == '-') {
- if (len == 2 && sb.buf[1] == '-') {
- seen_dashdash = 1;
- break;
- }
- die("options not supported in --stdin mode");
- }
- if (handle_revision_arg(sb.buf, revs, 0,
- REVARG_CANNOT_BE_FILENAME))
- die("bad revision '%s'", sb.buf);
- }
- if (seen_dashdash)
- read_pathspec_from_stdin(&sb, prune);
-
- strbuf_release(&sb);
- warn_on_object_refname_ambiguity = save_warning;
-}
-
static void add_grep(struct rev_info *revs, const char *ptn, enum grep_pat_token what)
{
append_grep_pattern(&revs->grep_filter, ptn, "command line", 0, what);
@@ -2208,12 +2259,33 @@ static void add_message_grep(struct rev_info *revs, const char *pattern)
add_grep(revs, pattern, GREP_PATTERN_BODY);
}
+static int parse_count(const char *arg)
+{
+ int count;
+
+ if (strtol_i(arg, 10, &count) < 0)
+ die("'%s': not an integer", arg);
+ return count;
+}
+
+static timestamp_t parse_age(const char *arg)
+{
+ timestamp_t num;
+ char *p;
+
+ errno = 0;
+ num = parse_timestamp(arg, &p, 10);
+ if (errno || *p || p == arg)
+ die("'%s': not a number of seconds since epoch", arg);
+ return num;
+}
+
static int handle_revision_opt(struct rev_info *revs, int argc, const char **argv,
int *unkc, const char **unkv,
const struct setup_revision_opt* opt)
{
const char *arg = argv[0];
- const char *optarg;
+ const char *optarg = NULL;
int argcount;
const unsigned hexsz = the_hash_algo->hexsz;
@@ -2225,7 +2297,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
!strcmp(arg, "--bisect") || starts_with(arg, "--glob=") ||
!strcmp(arg, "--indexed-objects") ||
!strcmp(arg, "--alternate-refs") ||
- starts_with(arg, "--exclude=") ||
+ starts_with(arg, "--exclude=") || starts_with(arg, "--exclude-hidden=") ||
starts_with(arg, "--branches=") || starts_with(arg, "--tags=") ||
starts_with(arg, "--remotes=") || starts_with(arg, "--no-walk="))
{
@@ -2234,29 +2306,27 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
}
if ((argcount = parse_long_opt("max-count", argv, &optarg))) {
- revs->max_count = atoi(optarg);
+ revs->max_count = parse_count(optarg);
revs->no_walk = 0;
return argcount;
} else if ((argcount = parse_long_opt("skip", argv, &optarg))) {
- revs->skip_count = atoi(optarg);
+ revs->skip_count = parse_count(optarg);
return argcount;
} else if ((*arg == '-') && isdigit(arg[1])) {
/* accept -<digit>, like traditional "head" */
- if (strtol_i(arg + 1, 10, &revs->max_count) < 0 ||
- revs->max_count < 0)
- die("'%s': not a non-negative integer", arg + 1);
+ revs->max_count = parse_count(arg + 1);
revs->no_walk = 0;
} else if (!strcmp(arg, "-n")) {
if (argc <= 1)
return error("-n requires an argument");
- revs->max_count = atoi(argv[1]);
+ revs->max_count = parse_count(argv[1]);
revs->no_walk = 0;
return 2;
} else if (skip_prefix(arg, "-n", &optarg)) {
- revs->max_count = atoi(optarg);
+ revs->max_count = parse_count(optarg);
revs->no_walk = 0;
} else if ((argcount = parse_long_opt("max-age", argv, &optarg))) {
- revs->max_age = atoi(optarg);
+ revs->max_age = parse_age(optarg);
return argcount;
} else if ((argcount = parse_long_opt("since", argv, &optarg))) {
revs->max_age = approxidate(optarg);
@@ -2268,7 +2338,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
revs->max_age = approxidate(optarg);
return argcount;
} else if ((argcount = parse_long_opt("min-age", argv, &optarg))) {
- revs->min_age = atoi(optarg);
+ revs->min_age = parse_age(optarg);
return argcount;
} else if ((argcount = parse_long_opt("before", argv, &optarg))) {
revs->min_age = approxidate(optarg);
@@ -2284,6 +2354,23 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
revs->ancestry_path = 1;
revs->simplify_history = 0;
revs->limited = 1;
+ revs->ancestry_path_implicit_bottoms = 1;
+ } else if (skip_prefix(arg, "--ancestry-path=", &optarg)) {
+ struct commit *c;
+ struct object_id oid;
+ const char *msg = _("could not get commit for --ancestry-path argument %s");
+
+ revs->ancestry_path = 1;
+ revs->simplify_history = 0;
+ revs->limited = 1;
+
+ if (repo_get_oid_committish(revs->repo, optarg, &oid))
+ return error(msg, optarg);
+ get_reference(revs, optarg, &oid, ANCESTRY_PATH);
+ c = lookup_commit_reference(revs->repo, &oid);
+ if (!c)
+ return error(msg, optarg);
+ commit_list_insert(c, &revs->ancestry_path_bottoms);
} else if (!strcmp(arg, "-g") || !strcmp(arg, "--walk-reflogs")) {
init_reflog_walk(&revs->reflog_info);
} else if (!strcmp(arg, "--default")) {
@@ -2339,11 +2426,11 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
} else if (!strcmp(arg, "--no-merges")) {
revs->max_parents = 1;
} else if (skip_prefix(arg, "--min-parents=", &optarg)) {
- revs->min_parents = atoi(optarg);
+ revs->min_parents = parse_count(optarg);
} else if (!strcmp(arg, "--no-min-parents")) {
revs->min_parents = 0;
} else if (skip_prefix(arg, "--max-parents=", &optarg)) {
- revs->max_parents = atoi(optarg);
+ revs->max_parents = parse_count(optarg);
} else if (!strcmp(arg, "--no-max-parents")) {
revs->max_parents = -1;
} else if (!strcmp(arg, "--boundary")) {
@@ -2352,8 +2439,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
revs->left_right = 1;
} else if (!strcmp(arg, "--left-only")) {
if (revs->right_only)
- die("--left-only is incompatible with --right-only"
- " or --cherry");
+ die(_("options '%s' and '%s' cannot be used together"),
+ "--left-only", "--right-only/--cherry");
revs->left_only = 1;
} else if (!strcmp(arg, "--right-only")) {
if (revs->left_only)
@@ -2398,6 +2485,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
revs->tree_objects = 1;
revs->blob_objects = 1;
revs->verify_objects = 1;
+ disable_commit_graph(revs->repo);
} else if (!strcmp(arg, "--unpacked")) {
revs->unpacked = 1;
} else if (starts_with(arg, "--unpacked=")) {
@@ -2460,6 +2548,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
revs->break_bar = xstrdup(optarg);
revs->track_linear = 1;
revs->track_first_time = 1;
+ } else if (!strcmp(arg, "--show-notes-by-default")) {
+ revs->show_notes_by_default = 1;
} else if (skip_prefix(arg, "--show-notes=", &optarg) ||
skip_prefix(arg, "--notes=", &optarg)) {
if (starts_with(arg, "--show-notes=") &&
@@ -2617,7 +2707,7 @@ static int for_each_bisect_ref(struct ref_store *refs, each_ref_fn fn,
struct strbuf bisect_refs = STRBUF_INIT;
int status;
strbuf_addf(&bisect_refs, "refs/bisect/%s", term);
- status = refs_for_each_fullref_in(refs, bisect_refs.buf, fn, cb_data);
+ status = refs_for_each_fullref_in(refs, bisect_refs.buf, NULL, fn, cb_data);
strbuf_release(&bisect_refs);
return status;
}
@@ -2671,10 +2761,13 @@ static int handle_revision_pseudo_opt(struct rev_info *revs,
init_all_refs_cb(&cb, revs, *flags);
other_head_refs(handle_one_ref, &cb);
}
- clear_ref_exclusion(&revs->ref_excludes);
+ clear_ref_exclusions(&revs->ref_excludes);
} else if (!strcmp(arg, "--branches")) {
+ if (revs->ref_excludes.hidden_refs_configured)
+ return error(_("options '%s' and '%s' cannot be used together"),
+ "--exclude-hidden", "--branches");
handle_refs(refs, revs, *flags, refs_for_each_branch_ref);
- clear_ref_exclusion(&revs->ref_excludes);
+ clear_ref_exclusions(&revs->ref_excludes);
} else if (!strcmp(arg, "--bisect")) {
read_bisect_terms(&term_bad, &term_good);
handle_refs(refs, revs, *flags, for_each_bad_bisect_ref);
@@ -2682,35 +2775,53 @@ static int handle_revision_pseudo_opt(struct rev_info *revs,
for_each_good_bisect_ref);
revs->bisect = 1;
} else if (!strcmp(arg, "--tags")) {
+ if (revs->ref_excludes.hidden_refs_configured)
+ return error(_("options '%s' and '%s' cannot be used together"),
+ "--exclude-hidden", "--tags");
handle_refs(refs, revs, *flags, refs_for_each_tag_ref);
- clear_ref_exclusion(&revs->ref_excludes);
+ clear_ref_exclusions(&revs->ref_excludes);
} else if (!strcmp(arg, "--remotes")) {
+ if (revs->ref_excludes.hidden_refs_configured)
+ return error(_("options '%s' and '%s' cannot be used together"),
+ "--exclude-hidden", "--remotes");
handle_refs(refs, revs, *flags, refs_for_each_remote_ref);
- clear_ref_exclusion(&revs->ref_excludes);
+ clear_ref_exclusions(&revs->ref_excludes);
} else if ((argcount = parse_long_opt("glob", argv, &optarg))) {
struct all_refs_cb cb;
init_all_refs_cb(&cb, revs, *flags);
for_each_glob_ref(handle_one_ref, optarg, &cb);
- clear_ref_exclusion(&revs->ref_excludes);
+ clear_ref_exclusions(&revs->ref_excludes);
return argcount;
} else if ((argcount = parse_long_opt("exclude", argv, &optarg))) {
add_ref_exclusion(&revs->ref_excludes, optarg);
return argcount;
+ } else if ((argcount = parse_long_opt("exclude-hidden", argv, &optarg))) {
+ exclude_hidden_refs(&revs->ref_excludes, optarg);
+ return argcount;
} else if (skip_prefix(arg, "--branches=", &optarg)) {
struct all_refs_cb cb;
+ if (revs->ref_excludes.hidden_refs_configured)
+ return error(_("options '%s' and '%s' cannot be used together"),
+ "--exclude-hidden", "--branches");
init_all_refs_cb(&cb, revs, *flags);
for_each_glob_ref_in(handle_one_ref, optarg, "refs/heads/", &cb);
- clear_ref_exclusion(&revs->ref_excludes);
+ clear_ref_exclusions(&revs->ref_excludes);
} else if (skip_prefix(arg, "--tags=", &optarg)) {
struct all_refs_cb cb;
+ if (revs->ref_excludes.hidden_refs_configured)
+ return error(_("options '%s' and '%s' cannot be used together"),
+ "--exclude-hidden", "--tags");
init_all_refs_cb(&cb, revs, *flags);
for_each_glob_ref_in(handle_one_ref, optarg, "refs/tags/", &cb);
- clear_ref_exclusion(&revs->ref_excludes);
+ clear_ref_exclusions(&revs->ref_excludes);
} else if (skip_prefix(arg, "--remotes=", &optarg)) {
struct all_refs_cb cb;
+ if (revs->ref_excludes.hidden_refs_configured)
+ return error(_("options '%s' and '%s' cannot be used together"),
+ "--exclude-hidden", "--remotes");
init_all_refs_cb(&cb, revs, *flags);
for_each_glob_ref_in(handle_one_ref, optarg, "refs/remotes/", &cb);
- clear_ref_exclusion(&revs->ref_excludes);
+ clear_ref_exclusions(&revs->ref_excludes);
} else if (!strcmp(arg, "--reflog")) {
add_reflogs_to_pending(revs, *flags);
} else if (!strcmp(arg, "--indexed-objects")) {
@@ -2748,6 +2859,53 @@ static int handle_revision_pseudo_opt(struct rev_info *revs,
return 1;
}
+static void read_revisions_from_stdin(struct rev_info *revs,
+ struct strvec *prune)
+{
+ struct strbuf sb;
+ int seen_dashdash = 0;
+ int seen_end_of_options = 0;
+ int save_warning;
+ int flags = 0;
+
+ save_warning = warn_on_object_refname_ambiguity;
+ warn_on_object_refname_ambiguity = 0;
+
+ strbuf_init(&sb, 1000);
+ while (strbuf_getline(&sb, stdin) != EOF) {
+ if (!sb.len)
+ break;
+
+ if (!strcmp(sb.buf, "--")) {
+ seen_dashdash = 1;
+ break;
+ }
+
+ if (!seen_end_of_options && sb.buf[0] == '-') {
+ const char *argv[] = { sb.buf, NULL };
+
+ if (!strcmp(sb.buf, "--end-of-options")) {
+ seen_end_of_options = 1;
+ continue;
+ }
+
+ if (handle_revision_pseudo_opt(revs, argv, &flags) > 0)
+ continue;
+
+ die(_("invalid option '%s' in --stdin mode"), sb.buf);
+ }
+
+ if (handle_revision_arg(sb.buf, revs, flags,
+ REVARG_CANNOT_BE_FILENAME))
+ die("bad revision '%s'", sb.buf);
+ }
+ if (seen_dashdash)
+ read_pathspec_from_stdin(&sb, prune);
+
+ strbuf_release(&sb);
+ warn_on_object_refname_ambiguity = save_warning;
+}
+
static void NORETURN diagnose_missing_default(const char *def)
{
int flags;
@@ -2784,6 +2942,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
const char *arg = argv[i];
if (strcmp(arg, "--"))
continue;
+ if (opt && opt->free_removed_argv_elements)
+ free((char *)argv[i]);
argv[i] = NULL;
argc = i;
if (argv[i + 1])
@@ -2882,7 +3042,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
if (!revs->def)
revs->def = opt ? opt->def : NULL;
if (opt && opt->tweak)
- opt->tweak(revs, opt);
+ opt->tweak(revs);
if (revs->show_merge)
prepare_show_merge(revs);
if (revs->def && !revs->pending.nr && !revs->rev_input_given) {
@@ -2937,8 +3097,6 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
revs->grep_filter.ignore_locale = 1;
compile_grep_patterns(&revs->grep_filter);
- if (revs->reverse && revs->reflog_info)
- die(_("options '%s' and '%s' cannot be used together"), "--reverse", "--walk-reflogs");
if (revs->reflog_info && revs->limited)
die("cannot combine --walk-reflogs with history-limiting options");
if (revs->rewrite_parents && revs->children.name)
@@ -2949,11 +3107,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
/*
* Limitations on the graph functionality
*/
- if (revs->reverse && revs->graph)
- die(_("options '%s' and '%s' cannot be used together"), "--reverse", "--graph");
+ die_for_incompatible_opt3(!!revs->graph, "--graph",
+ !!revs->reverse, "--reverse",
+ !!revs->reflog_info, "--walk-reflogs");
- if (revs->reflog_info && revs->graph)
- die(_("options '%s' and '%s' cannot be used together"), "--walk-reflogs", "--graph");
if (revs->no_walk && revs->graph)
die(_("options '%s' and '%s' cannot be used together"), "--no-walk", "--graph");
if (!revs->reflog_info && revs->grep_filter.use_reflog_filter)
@@ -2966,6 +3123,11 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
if (revs->expand_tabs_in_log < 0)
revs->expand_tabs_in_log = revs->expand_tabs_in_log_default;
+ if (!revs->show_notes_given && revs->show_notes_by_default) {
+ enable_default_display_notes(&revs->notes_opt, &revs->show_notes);
+ revs->show_notes_given = 1;
+ }
+
return left;
}
@@ -2988,9 +3150,15 @@ static void release_revisions_mailmap(struct string_list *mailmap)
static void release_revisions_topo_walk_info(struct topo_walk_info *info);
+static void free_void_commit_list(void *list)
+{
+ free_commit_list(list);
+}
+
void release_revisions(struct rev_info *revs)
{
free_commit_list(revs->commits);
+ free_commit_list(revs->ancestry_path_bottoms);
object_array_clear(&revs->pending);
object_array_clear(&revs->boundary_commits);
release_revisions_cmdline(&revs->cmdline);
@@ -2999,10 +3167,16 @@ void release_revisions(struct rev_info *revs)
date_mode_release(&revs->date_mode);
release_revisions_mailmap(revs->mailmap);
free_grep_patterns(&revs->grep_filter);
+ graph_clear(revs->graph);
/* TODO (need to handle "no_free"): diff_free(&revs->diffopt) */
diff_free(&revs->pruning);
reflog_walk_info_release(revs->reflog_info);
release_revisions_topo_walk_info(revs->topo_walk_info);
+ clear_decoration(&revs->children, free_void_commit_list);
+ clear_decoration(&revs->merge_simplification, free);
+ clear_decoration(&revs->treesame, free);
+ line_log_free(revs);
+ oidset_clear(&revs->missing_commits);
}
static void add_child(struct rev_info *revs, struct commit *parent, struct commit *child)
@@ -3379,8 +3553,8 @@ void reset_revision_walk(void)
}
static int mark_uninteresting(const struct object_id *oid,
- struct packed_git *pack,
- uint32_t pos,
+ struct packed_git *pack UNUSED,
+ uint32_t pos UNUSED,
void *cb)
{
struct rev_info *revs = cb;
@@ -3791,51 +3965,6 @@ int rewrite_parents(struct rev_info *revs, struct commit *commit,
return 0;
}
-static int commit_rewrite_person(struct strbuf *buf, const char *what, struct string_list *mailmap)
-{
- char *person, *endp;
- size_t len, namelen, maillen;
- const char *name;
- const char *mail;
- struct ident_split ident;
-
- person = strstr(buf->buf, what);
- if (!person)
- return 0;
-
- person += strlen(what);
- endp = strchr(person, '\n');
- if (!endp)
- return 0;
-
- len = endp - person;
-
- if (split_ident_line(&ident, person, len))
- return 0;
-
- mail = ident.mail_begin;
- maillen = ident.mail_end - ident.mail_begin;
- name = ident.name_begin;
- namelen = ident.name_end - ident.name_begin;
-
- if (map_user(mailmap, &mail, &maillen, &name, &namelen)) {
- struct strbuf namemail = STRBUF_INIT;
-
- strbuf_addf(&namemail, "%.*s <%.*s>",
- (int)namelen, name, (int)maillen, mail);
-
- strbuf_splice(buf, ident.name_begin - buf->buf,
- ident.mail_end - ident.name_begin + 1,
- namemail.buf, namemail.len);
-
- strbuf_release(&namemail);
-
- return 1;
- }
-
- return 0;
-}
-
static int commit_match(struct commit *commit, struct rev_info *opt)
{
int retval;
@@ -3861,18 +3990,19 @@ static int commit_match(struct commit *commit, struct rev_info *opt)
* in it.
*/
encoding = get_log_output_encoding();
- message = logmsg_reencode(commit, NULL, encoding);
+ message = repo_logmsg_reencode(the_repository, commit, NULL, encoding);
/* Copy the commit to temporary if we are using "fake" headers */
if (buf.len)
strbuf_addstr(&buf, message);
if (opt->grep_filter.header_list && opt->mailmap) {
+ const char *commit_headers[] = { "author ", "committer ", NULL };
+
if (!buf.len)
strbuf_addstr(&buf, message);
- commit_rewrite_person(&buf, "\nauthor ", opt->mailmap);
- commit_rewrite_person(&buf, "\ncommitter ", opt->mailmap);
+ apply_mailmap_to_header(&buf, commit_headers, opt->mailmap);
}
/* Append "fake" message parts as needed */
@@ -3896,7 +4026,7 @@ static int commit_match(struct commit *commit, struct rev_info *opt)
retval = grep_buffer(&opt->grep_filter,
(char *)message, strlen(message));
strbuf_release(&buf);
- unuse_commit_buffer(commit, message);
+ repo_unuse_commit_buffer(the_repository, commit, message);
return retval;
}
@@ -4142,7 +4272,7 @@ static struct commit *get_revision_1(struct rev_info *revs)
* Return true for entries that have not yet been shown. (This is an
* object_array_each_func_t.)
*/
-static int entry_unshown(struct object_array_entry *entry, void *cb_data_unused)
+static int entry_unshown(struct object_array_entry *entry, void *cb_data UNUSED)
{
return !(entry->item->flags & SHOWN);
}
diff --git a/revision.h b/revision.h
index e576845..0e470d1 100644
--- a/revision.h
+++ b/revision.h
@@ -2,13 +2,16 @@
#define REVISION_H
#include "commit.h"
-#include "parse-options.h"
#include "grep.h"
#include "notes.h"
+#include "oidset.h"
#include "pretty.h"
#include "diff.h"
#include "commit-slab-decl.h"
+#include "decorate.h"
+#include "ident.h"
#include "list-objects-filter-options.h"
+#include "strvec.h"
/**
* The revision walking API offers functions to build a list of revisions
@@ -48,6 +51,7 @@
*/
#define NOT_USER_GIVEN (1u<<25)
#define TRACK_LINEAR (1u<<26)
+#define ANCESTRY_PATH (1u<<27)
#define ALL_REV_FLAGS (((1u<<11)-1) | NOT_USER_GIVEN | TRACK_LINEAR | PULL_MERGE)
#define DECORATE_SHORT_REFS 1
@@ -60,6 +64,8 @@ struct string_list;
struct saved_parents;
struct bloom_key;
struct bloom_filter_settings;
+struct option;
+struct parse_opt_ctx_t;
define_shared_commit_slab(revision_sources, char *);
struct rev_cmdline_info {
@@ -80,6 +86,35 @@ struct rev_cmdline_info {
} *rev;
};
+struct ref_exclusions {
+ /*
+ * Excluded refs is a list of wildmatch patterns. If any of the
+ * patterns match, the reference will be excluded.
+ */
+ struct string_list excluded_refs;
+
+ /*
+ * Hidden refs is a list of patterns that is to be hidden via
+ * `ref_is_hidden()`.
+ */
+ struct strvec hidden_refs;
+
+ /*
+ * Indicates whether hidden refs have been configured. This is to
+ * distinguish between no hidden refs existing and hidden refs not
+ * being parsed.
+ */
+ char hidden_refs_configured;
+};
+
+/**
+ * Initialize a `struct ref_exclusions` with a macro.
+ */
+#define REF_EXCLUSIONS_INIT { \
+ .excluded_refs = STRING_LIST_INIT_DUP, \
+ .hidden_refs = STRVEC_INIT, \
+}
+
struct oidset;
struct topo_walk_info;
@@ -102,11 +137,12 @@ struct rev_info {
struct list_objects_filter_options filter;
/* excluding from --branches, --refs, etc. expansion */
- struct string_list *ref_excludes;
+ struct ref_exclusions ref_excludes;
/* Basic information */
const char *prefix;
const char *def;
+ char *ps_matched; /* optionally record matches of prune_data */
struct pathspec prune_data;
/*
@@ -164,6 +200,13 @@ struct rev_info {
cherry_mark:1,
bisect:1,
ancestry_path:1,
+
+ /* True if --ancestry-path was specified without an
+ * argument. The bottom revisions are implicitly
+ * the arguments in this case.
+ */
+ ancestry_path_implicit_bottoms:1,
+
first_parent_only:1,
exclude_first_parent_only:1,
line_level_traverse:1,
@@ -171,18 +214,19 @@ struct rev_info {
/*
* Blobs are shown without regard for their existence.
- * But not so for trees: unless exclude_promisor_objects
+ * But not so for trees/commits: unless exclude_promisor_objects
* is set and the tree in question is a promisor object;
* OR ignore_missing_links is set, the revision walker
- * dies with a "bad tree object HASH" message when
- * encountering a missing tree. For callers that can
- * handle missing trees and want them to be filterable
+ * dies with a "bad <type> object HASH" message when
+ * encountering a missing object. For callers that can
+ * handle missing trees/commits and want them to be filterable
* and showable, set this to true. The revision walker
- * will filter and show such a missing tree as usual,
- * but will not attempt to recurse into this tree
- * object.
+ * will filter and show such a missing object as usual,
+ * but will not attempt to recurse into this tree/commit
+ * object. The revision walker will also set the MISSING
+ * flag for such objects.
*/
- do_not_die_on_missing_tree:1,
+ do_not_die_on_missing_objects:1,
/* for internal use only */
exclude_promisor_objects:1;
@@ -212,6 +256,7 @@ struct rev_info {
shown_dashes:1,
show_merge:1,
show_notes_given:1,
+ show_notes_by_default:1,
show_signature:1,
pretty_given:1,
abbrev_commit:1,
@@ -221,6 +266,7 @@ struct rev_info {
missing_newline:1,
date_mode_explicit:1,
preserve_subject:1,
+ force_in_body_from:1,
encode_email_headers:1,
include_header:1;
unsigned int disable_stdin:1;
@@ -306,6 +352,7 @@ struct rev_info {
struct saved_parents *saved_parents_slab;
struct commit_list *previous_parents;
+ struct commit_list *ancestry_path_bottoms;
const char *break_bar;
struct revision_sources *sources;
@@ -328,6 +375,9 @@ struct rev_info {
/* Location where temporary objects for remerge-diff are written. */
struct tmp_objdir *remerge_objdir;
+
+ /* Missing commits to be tracked without failing traversal. */
+ struct oidset missing_commits;
};
/**
@@ -347,7 +397,23 @@ struct rev_info {
* called before release_revisions() the "struct rev_info" can be left
* uninitialized.
*/
-#define REV_INFO_INIT { 0 }
+#define REV_INFO_INIT { \
+ .abbrev = DEFAULT_ABBREV, \
+ .simplify_history = 1, \
+ .pruning.flags.recursive = 1, \
+ .pruning.flags.quick = 1, \
+ .sort_order = REV_SORT_IN_GRAPH_ORDER, \
+ .dense = 1, \
+ .max_age = -1, \
+ .max_age_as_filter = -1, \
+ .min_age = -1, \
+ .skip_count = -1, \
+ .max_count = -1, \
+ .max_parents = -1, \
+ .expand_tabs_in_log = -1, \
+ .commit_format = CMIT_FMT_DEFAULT, \
+ .expand_tabs_in_log_default = 8, \
+}
/**
* Initialize a rev_info structure with default values. The third parameter may
@@ -360,9 +426,6 @@ struct rev_info {
void repo_init_revisions(struct repository *r,
struct rev_info *revs,
const char *prefix);
-#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
-#define init_revisions(revs, prefix) repo_init_revisions(the_repository, revs, prefix)
-#endif
/**
* Parse revision information, filling in the `rev_info` structure, and
@@ -373,9 +436,10 @@ void repo_init_revisions(struct repository *r,
*/
struct setup_revision_opt {
const char *def;
- void (*tweak)(struct rev_info *, struct setup_revision_opt *);
+ void (*tweak)(struct rev_info *);
unsigned int assume_dashdash:1,
- allow_exclude_promisor_objects:1;
+ allow_exclude_promisor_objects:1,
+ free_removed_argv_elements:1;
unsigned revarg_opt;
};
int setup_revisions(int argc, const char **argv, struct rev_info *revs,
@@ -428,12 +492,14 @@ void mark_trees_uninteresting_sparse(struct repository *r, struct oidset *trees)
void show_object_with_name(FILE *, struct object *, const char *);
/**
- * Helpers to check if a "struct string_list" item matches with
- * wildmatch().
+ * Helpers to check if a reference should be excluded.
*/
-int ref_excluded(struct string_list *, const char *path);
-void clear_ref_exclusion(struct string_list **);
-void add_ref_exclusion(struct string_list **, const char *exclude);
+
+int ref_excluded(const struct ref_exclusions *exclusions, const char *path);
+void init_ref_exclusions(struct ref_exclusions *);
+void clear_ref_exclusions(struct ref_exclusions *);
+void add_ref_exclusion(struct ref_exclusions *, const char *exclude);
+void exclude_hidden_refs(struct ref_exclusions *, const char *section);
/**
* This function can be used if you want to add commit objects as revision
diff --git a/run-command.c b/run-command.c
index 14f1783..0e74357 100644
--- a/run-command.c
+++ b/run-command.c
@@ -1,15 +1,20 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "run-command.h"
+#include "environment.h"
#include "exec-cmd.h"
+#include "gettext.h"
#include "sigchain.h"
#include "strvec.h"
+#include "symlinks.h"
#include "thread-utils.h"
#include "strbuf.h"
#include "string-list.h"
+#include "trace.h"
+#include "trace2.h"
#include "quote.h"
#include "config.h"
#include "packfile.h"
-#include "hook.h"
+#include "compat/nonblock.h"
void child_process_init(struct child_process *child)
{
@@ -163,6 +168,7 @@ int is_executable(const char *name)
return st.st_mode & S_IXUSR;
}
+#ifndef locate_in_PATH
/*
* Search $PATH for a command. This emulates the path search that
* execvp would perform, without actually executing the command so it
@@ -211,6 +217,7 @@ static char *locate_in_PATH(const char *file)
strbuf_release(&buf);
return NULL;
}
+#endif
int exists_in_PATH(const char *command)
{
@@ -300,7 +307,6 @@ enum child_errcode {
CHILD_ERR_DUP2,
CHILD_ERR_CLOSE,
CHILD_ERR_SIGPROCMASK,
- CHILD_ERR_ENOENT,
CHILD_ERR_SILENT,
CHILD_ERR_ERRNO
};
@@ -340,19 +346,19 @@ static void child_close_pair(int fd[2])
child_close(fd[1]);
}
-static void child_error_fn(const char *err, va_list params)
+static void child_error_fn(const char *err UNUSED, va_list params UNUSED)
{
const char msg[] = "error() should not be called in child\n";
xwrite(2, msg, sizeof(msg) - 1);
}
-static void child_warn_fn(const char *err, va_list params)
+static void child_warn_fn(const char *err UNUSED, va_list params UNUSED)
{
const char msg[] = "warn() should not be called in child\n";
xwrite(2, msg, sizeof(msg) - 1);
}
-static void NORETURN child_die_fn(const char *err, va_list params)
+static void NORETURN child_die_fn(const char *err UNUSED, va_list params UNUSED)
{
const char msg[] = "die() should not be called in child\n";
xwrite(2, msg, sizeof(msg) - 1);
@@ -383,9 +389,6 @@ static void child_err_spew(struct child_process *cmd, struct child_err *cerr)
case CHILD_ERR_SIGPROCMASK:
error_errno("sigprocmask failed restoring signals");
break;
- case CHILD_ERR_ENOENT:
- error_errno("cannot run %s", cmd->args.v[0]);
- break;
case CHILD_ERR_SILENT:
break;
case CHILD_ERR_ERRNO:
@@ -839,13 +842,9 @@ fail_pipe:
execve(argv.v[0], (char *const *) argv.v,
(char *const *) childenv);
- if (errno == ENOENT) {
- if (cmd->silent_exec_failure)
- child_die(CHILD_ERR_SILENT);
- child_die(CHILD_ERR_ENOENT);
- } else {
- child_die(CHILD_ERR_ERRNO);
- }
+ if (cmd->silent_exec_failure && errno == ENOENT)
+ child_die(CHILD_ERR_SILENT);
+ child_die(CHILD_ERR_ERRNO);
}
atfork_parent(&as);
if (cmd->pid < 0)
@@ -1003,41 +1002,6 @@ int run_command(struct child_process *cmd)
return finish_command(cmd);
}
-int run_command_v_opt(const char **argv, int opt)
-{
- return run_command_v_opt_cd_env(argv, opt, NULL, NULL);
-}
-
-int run_command_v_opt_tr2(const char **argv, int opt, const char *tr2_class)
-{
- return run_command_v_opt_cd_env_tr2(argv, opt, NULL, NULL, tr2_class);
-}
-
-int run_command_v_opt_cd_env(const char **argv, int opt, const char *dir, const char *const *env)
-{
- return run_command_v_opt_cd_env_tr2(argv, opt, dir, env, NULL);
-}
-
-int run_command_v_opt_cd_env_tr2(const char **argv, int opt, const char *dir,
- const char *const *env, const char *tr2_class)
-{
- struct child_process cmd = CHILD_PROCESS_INIT;
- strvec_pushv(&cmd.args, argv);
- cmd.no_stdin = opt & RUN_COMMAND_NO_STDIN ? 1 : 0;
- cmd.git_cmd = opt & RUN_GIT_CMD ? 1 : 0;
- cmd.stdout_to_stderr = opt & RUN_COMMAND_STDOUT_TO_STDERR ? 1 : 0;
- cmd.silent_exec_failure = opt & RUN_SILENT_EXEC_FAILURE ? 1 : 0;
- cmd.use_shell = opt & RUN_USING_SHELL ? 1 : 0;
- cmd.clean_on_exit = opt & RUN_CLEAN_ON_EXIT ? 1 : 0;
- cmd.wait_after_clean = opt & RUN_WAIT_AFTER_CLEAN ? 1 : 0;
- cmd.close_object_store = opt & RUN_CLOSE_OBJECT_STORE ? 1 : 0;
- cmd.dir = dir;
- if (env)
- strvec_pushv(&cmd.env, (const char **)env);
- cmd.trace2_child_class = tr2_class;
- return run_command(&cmd);
-}
-
#ifndef NO_PTHREADS
static pthread_t main_thread;
static int main_thread_set;
@@ -1053,7 +1017,7 @@ static void *run_thread(void *data)
sigset_t mask;
sigemptyset(&mask);
sigaddset(&mask, SIGPIPE);
- if (pthread_sigmask(SIG_BLOCK, &mask, NULL) < 0) {
+ if (pthread_sigmask(SIG_BLOCK, &mask, NULL)) {
ret = error("unable to block SIGPIPE in async thread");
return (void *)ret;
}
@@ -1364,12 +1328,25 @@ static int pump_io_round(struct io_pump *slots, int nr, struct pollfd *pfd)
continue;
if (io->type == POLLOUT) {
- ssize_t len = xwrite(io->fd,
- io->u.out.buf, io->u.out.len);
+ ssize_t len;
+
+ /*
+ * Don't use xwrite() here. It loops forever on EAGAIN,
+ * and we're in our own poll() loop here.
+ *
+ * Note that we lose xwrite()'s handling of MAX_IO_SIZE
+ * and EINTR, so we have to implement those ourselves.
+ */
+ len = write(io->fd, io->u.out.buf,
+ io->u.out.len <= MAX_IO_SIZE ?
+ io->u.out.len : MAX_IO_SIZE);
if (len < 0) {
- io->error = errno;
- close(io->fd);
- io->fd = -1;
+ if (errno != EINTR && errno != EAGAIN &&
+ errno != ENOSPC) {
+ io->error = errno;
+ close(io->fd);
+ io->fd = -1;
+ }
} else {
io->u.out.buf += len;
io->u.out.len -= len;
@@ -1438,6 +1415,15 @@ int pipe_command(struct child_process *cmd,
return -1;
if (in) {
+ if (enable_pipe_nonblock(cmd->in) < 0) {
+ error_errno("unable to make pipe non-blocking");
+ close(cmd->in);
+ if (out)
+ close(cmd->out);
+ if (err)
+ close(cmd->err);
+ return -1;
+ }
io[nr].fd = cmd->in;
io[nr].type = POLLOUT;
io[nr].u.out.buf = in;
@@ -1473,16 +1459,8 @@ enum child_state {
GIT_CP_WAIT_CLEANUP,
};
-int run_processes_parallel_ungroup;
struct parallel_processes {
- void *data;
-
- int max_processes;
- int nr_processes;
-
- get_next_task_fn get_next_task;
- start_failure_fn start_failure;
- task_finished_fn task_finished;
+ size_t nr_processes;
struct {
enum child_state state;
@@ -1497,81 +1475,60 @@ struct parallel_processes {
struct pollfd *pfd;
unsigned shutdown : 1;
- unsigned ungroup : 1;
- int output_owner;
+ size_t output_owner;
struct strbuf buffered_output; /* of finished children */
};
-static int default_start_failure(struct strbuf *out,
- void *pp_cb,
- void *pp_task_cb)
-{
- return 0;
-}
+struct parallel_processes_for_signal {
+ const struct run_process_parallel_opts *opts;
+ const struct parallel_processes *pp;
+};
-static int default_task_finished(int result,
- struct strbuf *out,
- void *pp_cb,
- void *pp_task_cb)
+static void kill_children(const struct parallel_processes *pp,
+ const struct run_process_parallel_opts *opts,
+ int signo)
{
- return 0;
+ for (size_t i = 0; i < opts->processes; i++)
+ if (pp->children[i].state == GIT_CP_WORKING)
+ kill(pp->children[i].process.pid, signo);
}
-static void kill_children(struct parallel_processes *pp, int signo)
+static void kill_children_signal(const struct parallel_processes_for_signal *pp_sig,
+ int signo)
{
- int i, n = pp->max_processes;
-
- for (i = 0; i < n; i++)
- if (pp->children[i].state == GIT_CP_WORKING)
- kill(pp->children[i].process.pid, signo);
+ kill_children(pp_sig->pp, pp_sig->opts, signo);
}
-static struct parallel_processes *pp_for_signal;
+static struct parallel_processes_for_signal *pp_for_signal;
static void handle_children_on_signal(int signo)
{
- kill_children(pp_for_signal, signo);
+ kill_children_signal(pp_for_signal, signo);
sigchain_pop(signo);
raise(signo);
}
static void pp_init(struct parallel_processes *pp,
- int n,
- get_next_task_fn get_next_task,
- start_failure_fn start_failure,
- task_finished_fn task_finished,
- void *data, int ungroup)
+ const struct run_process_parallel_opts *opts,
+ struct parallel_processes_for_signal *pp_sig)
{
- int i;
-
- if (n < 1)
- n = online_cpus();
+ const size_t n = opts->processes;
- pp->max_processes = n;
+ if (!n)
+ BUG("you must provide a non-zero number of processes!");
- trace_printf("run_processes_parallel: preparing to run up to %d tasks", n);
+ trace_printf("run_processes_parallel: preparing to run up to %"PRIuMAX" tasks",
+ (uintmax_t)n);
- pp->data = data;
- if (!get_next_task)
+ if (!opts->get_next_task)
BUG("you need to specify a get_next_task function");
- pp->get_next_task = get_next_task;
- pp->start_failure = start_failure ? start_failure : default_start_failure;
- pp->task_finished = task_finished ? task_finished : default_task_finished;
-
- pp->nr_processes = 0;
- pp->output_owner = 0;
- pp->shutdown = 0;
- pp->ungroup = ungroup;
CALLOC_ARRAY(pp->children, n);
- if (pp->ungroup)
- pp->pfd = NULL;
- else
+ if (!opts->ungroup)
CALLOC_ARRAY(pp->pfd, n);
- strbuf_init(&pp->buffered_output, 0);
- for (i = 0; i < n; i++) {
+ for (size_t i = 0; i < n; i++) {
strbuf_init(&pp->children[i].err, 0);
child_process_init(&pp->children[i].process);
if (pp->pfd) {
@@ -1580,16 +1537,17 @@ static void pp_init(struct parallel_processes *pp,
}
}
- pp_for_signal = pp;
+ pp_sig->pp = pp;
+ pp_sig->opts = opts;
+ pp_for_signal = pp_sig;
sigchain_push_common(handle_children_on_signal);
}
-static void pp_cleanup(struct parallel_processes *pp)
+static void pp_cleanup(struct parallel_processes *pp,
+ const struct run_process_parallel_opts *opts)
{
- int i;
-
trace_printf("run_processes_parallel: done");
- for (i = 0; i < pp->max_processes; i++) {
+ for (size_t i = 0; i < opts->processes; i++) {
strbuf_release(&pp->children[i].err);
child_process_clear(&pp->children[i].process);
}
@@ -1614,39 +1572,52 @@ static void pp_cleanup(struct parallel_processes *pp)
* <0 no new job was started, user wishes to shutdown early. Use negative code
* to signal the children.
*/
-static int pp_start_one(struct parallel_processes *pp)
+static int pp_start_one(struct parallel_processes *pp,
+ const struct run_process_parallel_opts *opts)
{
- int i, code;
+ size_t i;
+ int code;
- for (i = 0; i < pp->max_processes; i++)
+ for (i = 0; i < opts->processes; i++)
if (pp->children[i].state == GIT_CP_FREE)
break;
- if (i == pp->max_processes)
+ if (i == opts->processes)
BUG("bookkeeping is hard");
- code = pp->get_next_task(&pp->children[i].process,
- pp->ungroup ? NULL : &pp->children[i].err,
- pp->data,
- &pp->children[i].data);
+ /*
+ * By default, do not inherit stdin from the parent process - otherwise,
+ * all children would share stdin! Users may overwrite this to provide
+ * something to the child's stdin by having their 'get_next_task'
+ * callback assign 0 to .no_stdin and an appropriate integer to .in.
+ */
+ pp->children[i].process.no_stdin = 1;
+
+ code = opts->get_next_task(&pp->children[i].process,
+ opts->ungroup ? NULL : &pp->children[i].err,
+ opts->data,
+ &pp->children[i].data);
if (!code) {
- if (!pp->ungroup) {
+ if (!opts->ungroup) {
strbuf_addbuf(&pp->buffered_output, &pp->children[i].err);
strbuf_reset(&pp->children[i].err);
}
return 1;
}
- if (!pp->ungroup) {
+ if (!opts->ungroup) {
pp->children[i].process.err = -1;
pp->children[i].process.stdout_to_stderr = 1;
}
- pp->children[i].process.no_stdin = 1;
if (start_command(&pp->children[i].process)) {
- code = pp->start_failure(pp->ungroup ? NULL :
- &pp->children[i].err,
- pp->data,
- pp->children[i].data);
- if (!pp->ungroup) {
+ if (opts->start_failure)
+ code = opts->start_failure(opts->ungroup ? NULL :
+ &pp->children[i].err,
+ opts->data,
+ pp->children[i].data);
+ else
+ code = 0;
+
+ if (!opts->ungroup) {
strbuf_addbuf(&pp->buffered_output, &pp->children[i].err);
strbuf_reset(&pp->children[i].err);
}
@@ -1662,19 +1633,19 @@ static int pp_start_one(struct parallel_processes *pp)
return 0;
}
-static void pp_buffer_stderr(struct parallel_processes *pp, int output_timeout)
+static void pp_buffer_stderr(struct parallel_processes *pp,
+ const struct run_process_parallel_opts *opts,
+ int output_timeout)
{
- int i;
-
- while ((i = poll(pp->pfd, pp->max_processes, output_timeout)) < 0) {
+ while (poll(pp->pfd, opts->processes, output_timeout) < 0) {
if (errno == EINTR)
continue;
- pp_cleanup(pp);
+ pp_cleanup(pp, opts);
die_errno("poll");
}
/* Buffer output from all pipes. */
- for (i = 0; i < pp->max_processes; i++) {
+ for (size_t i = 0; i < opts->processes; i++) {
if (pp->children[i].state == GIT_CP_WORKING &&
pp->pfd[i].revents & (POLLIN | POLLHUP)) {
int n = strbuf_read_once(&pp->children[i].err,
@@ -1689,9 +1660,9 @@ static void pp_buffer_stderr(struct parallel_processes *pp, int output_timeout)
}
}
-static void pp_output(struct parallel_processes *pp)
+static void pp_output(const struct parallel_processes *pp)
{
- int i = pp->output_owner;
+ size_t i = pp->output_owner;
if (pp->children[i].state == GIT_CP_WORKING &&
pp->children[i].err.len) {
@@ -1700,24 +1671,28 @@ static void pp_output(struct parallel_processes *pp)
}
}
-static int pp_collect_finished(struct parallel_processes *pp)
+static int pp_collect_finished(struct parallel_processes *pp,
+ const struct run_process_parallel_opts *opts)
{
- int i, code;
- int n = pp->max_processes;
+ int code;
+ size_t i;
int result = 0;
while (pp->nr_processes > 0) {
- for (i = 0; i < pp->max_processes; i++)
+ for (i = 0; i < opts->processes; i++)
if (pp->children[i].state == GIT_CP_WAIT_CLEANUP)
break;
- if (i == pp->max_processes)
+ if (i == opts->processes)
break;
code = finish_command(&pp->children[i].process);
- code = pp->task_finished(code, pp->ungroup ? NULL :
- &pp->children[i].err, pp->data,
- pp->children[i].data);
+ if (opts->task_finished)
+ code = opts->task_finished(code, opts->ungroup ? NULL :
+ &pp->children[i].err, opts->data,
+ pp->children[i].data);
+ else
+ code = 0;
if (code)
result = code;
@@ -1730,12 +1705,14 @@ static int pp_collect_finished(struct parallel_processes *pp)
pp->pfd[i].fd = -1;
child_process_init(&pp->children[i].process);
- if (pp->ungroup) {
+ if (opts->ungroup) {
; /* no strbuf_*() work to do here */
} else if (i != pp->output_owner) {
strbuf_addbuf(&pp->buffered_output, &pp->children[i].err);
strbuf_reset(&pp->children[i].err);
} else {
+ const size_t n = opts->processes;
+
strbuf_write(&pp->children[i].err, stderr);
strbuf_reset(&pp->children[i].err);
@@ -1760,76 +1737,60 @@ static int pp_collect_finished(struct parallel_processes *pp)
return result;
}
-int run_processes_parallel(int n,
- get_next_task_fn get_next_task,
- start_failure_fn start_failure,
- task_finished_fn task_finished,
- void *pp_cb)
+void run_processes_parallel(const struct run_process_parallel_opts *opts)
{
int i, code;
int output_timeout = 100;
int spawn_cap = 4;
- int ungroup = run_processes_parallel_ungroup;
- struct parallel_processes pp;
-
- /* unset for the next API user */
- run_processes_parallel_ungroup = 0;
-
- pp_init(&pp, n, get_next_task, start_failure, task_finished, pp_cb,
- ungroup);
+ struct parallel_processes_for_signal pp_sig;
+ struct parallel_processes pp = {
+ .buffered_output = STRBUF_INIT,
+ };
+ /* options */
+ const char *tr2_category = opts->tr2_category;
+ const char *tr2_label = opts->tr2_label;
+ const int do_trace2 = tr2_category && tr2_label;
+
+ if (do_trace2)
+ trace2_region_enter_printf(tr2_category, tr2_label, NULL,
+ "max:%d", opts->processes);
+
+ pp_init(&pp, opts, &pp_sig);
while (1) {
for (i = 0;
i < spawn_cap && !pp.shutdown &&
- pp.nr_processes < pp.max_processes;
+ pp.nr_processes < opts->processes;
i++) {
- code = pp_start_one(&pp);
+ code = pp_start_one(&pp, opts);
if (!code)
continue;
if (code < 0) {
pp.shutdown = 1;
- kill_children(&pp, -code);
+ kill_children(&pp, opts, -code);
}
break;
}
if (!pp.nr_processes)
break;
- if (ungroup) {
- int i;
-
- for (i = 0; i < pp.max_processes; i++)
+ if (opts->ungroup) {
+ for (size_t i = 0; i < opts->processes; i++)
pp.children[i].state = GIT_CP_WAIT_CLEANUP;
} else {
- pp_buffer_stderr(&pp, output_timeout);
+ pp_buffer_stderr(&pp, opts, output_timeout);
pp_output(&pp);
}
- code = pp_collect_finished(&pp);
+ code = pp_collect_finished(&pp, opts);
if (code) {
pp.shutdown = 1;
if (code < 0)
- kill_children(&pp, -code);
+ kill_children(&pp, opts,-code);
}
}
- pp_cleanup(&pp);
- return 0;
-}
-
-int run_processes_parallel_tr2(int n, get_next_task_fn get_next_task,
- start_failure_fn start_failure,
- task_finished_fn task_finished, void *pp_cb,
- const char *tr2_category, const char *tr2_label)
-{
- int result;
+ pp_cleanup(&pp, opts);
- trace2_region_enter_printf(tr2_category, tr2_label, NULL, "max:%d",
- ((n < 1) ? online_cpus() : n));
-
- result = run_processes_parallel(n, get_next_task, start_failure,
- task_finished, pp_cb);
-
- trace2_region_leave(tr2_category, tr2_label, NULL);
-
- return result;
+ if (do_trace2)
+ trace2_region_leave(tr2_category, tr2_label, NULL);
}
int run_auto_maintenance(int quiet)
@@ -1895,7 +1856,7 @@ enum start_bg_result start_bg_command(struct child_process *cmd,
*
* We also assume that `start_command()` does not add
* us to the cleanup list. And that it calls
- * calls `child_process_clear()`.
+ * `child_process_clear()`.
*/
sbgr = SBGR_ERROR;
goto done;
diff --git a/run-command.h b/run-command.h
index 0e85e58..1f22cc3 100644
--- a/run-command.h
+++ b/run-command.h
@@ -150,9 +150,7 @@ struct child_process {
}
/**
- * The functions: child_process_init, start_command, finish_command,
- * run_command, run_command_v_opt, run_command_v_opt_cd_env, child_process_clear
- * do the following:
+ * The functions: start_command, finish_command, run_command do the following:
*
* - If a system call failed, errno is set and -1 is returned. A diagnostic
* is printed.
@@ -224,36 +222,6 @@ int run_command(struct child_process *);
*/
int run_auto_maintenance(int quiet);
-#define RUN_COMMAND_NO_STDIN (1<<0)
-#define RUN_GIT_CMD (1<<1)
-#define RUN_COMMAND_STDOUT_TO_STDERR (1<<2)
-#define RUN_SILENT_EXEC_FAILURE (1<<3)
-#define RUN_USING_SHELL (1<<4)
-#define RUN_CLEAN_ON_EXIT (1<<5)
-#define RUN_WAIT_AFTER_CLEAN (1<<6)
-#define RUN_CLOSE_OBJECT_STORE (1<<7)
-
-/**
- * Convenience functions that encapsulate a sequence of
- * start_command() followed by finish_command(). The argument argv
- * specifies the program and its arguments. The argument opt is zero
- * or more of the flags `RUN_COMMAND_NO_STDIN`, `RUN_GIT_CMD`,
- * `RUN_COMMAND_STDOUT_TO_STDERR`, or `RUN_SILENT_EXEC_FAILURE`
- * that correspond to the members .no_stdin, .git_cmd,
- * .stdout_to_stderr, .silent_exec_failure of `struct child_process`.
- * The argument dir corresponds the member .dir. The argument env
- * corresponds to the member .env.
- */
-int run_command_v_opt(const char **argv, int opt);
-int run_command_v_opt_tr2(const char **argv, int opt, const char *tr2_class);
-/*
- * env (the environment) is to be formatted like environ: "VAR=VALUE".
- * To unset an environment variable use just "VAR".
- */
-int run_command_v_opt_cd_env(const char **argv, int opt, const char *dir, const char *const *env);
-int run_command_v_opt_cd_env_tr2(const char **argv, int opt, const char *dir,
- const char *const *env, const char *tr2_class);
-
/**
* Execute the given command, sending "in" to its stdin, and capturing its
* stdout and stderr in the "out" and "err" strbufs. Any of the three may
@@ -459,17 +427,64 @@ typedef int (*task_finished_fn)(int result,
void *pp_task_cb);
/**
- * Runs up to n processes at the same time. Whenever a process can be
- * started, the callback get_next_task_fn is called to obtain the data
+ * Option used by run_processes_parallel(), { 0 }-initialized means no
+ * options.
+ */
+struct run_process_parallel_opts
+{
+ /**
+ * tr2_category & tr2_label: sets the trace2 category and label for
+ * logging. These must either be unset, or both of them must be set.
+ */
+ const char *tr2_category;
+ const char *tr2_label;
+
+ /**
+ * processes: see 'processes' in run_processes_parallel() below.
+ */
+ size_t processes;
+
+ /**
+ * ungroup: see 'ungroup' in run_processes_parallel() below.
+ */
+ unsigned int ungroup:1;
+
+ /**
+ * get_next_task: See get_next_task_fn() above. This must be
+ * specified.
+ */
+ get_next_task_fn get_next_task;
+
+ /**
+ * start_failure: See start_failure_fn() above. This can be
+ * NULL to omit any special handling.
+ */
+ start_failure_fn start_failure;
+
+ /**
+ * task_finished: See task_finished_fn() above. This can be
+ * NULL to omit any special handling.
+ */
+ task_finished_fn task_finished;
+
+ /**
+ * data: user data, will be passed as "pp_cb" to the callback
+ * parameters.
+ */
+ void *data;
+};
+
+/**
+ * Options are passed via the "struct run_process_parallel_opts" above.
+ *
+ * Runs N 'processes' at the same time. Whenever a process can be
+ * started, the callback opts.get_next_task is called to obtain the data
* required to start another child process.
*
* The children started via this function run in parallel. Their output
* (both stdout and stderr) is routed to stderr in a manner that output
* from different tasks does not interleave (but see "ungroup" below).
*
- * start_failure_fn and task_finished_fn can be NULL to omit any
- * special handling.
- *
* If the "ungroup" option isn't specified, the API will set the
* "stdout_to_stderr" parameter in "struct child_process" and provide
* the callbacks with a "struct strbuf *out" parameter to write output
@@ -479,20 +494,8 @@ typedef int (*task_finished_fn)(int result,
* NULL "struct strbuf *out" parameter, and are responsible for
* emitting their own output, including dealing with any race
* conditions due to writing in parallel to stdout and stderr.
- * The "ungroup" option can be enabled by setting the global
- * "run_processes_parallel_ungroup" to "1" before invoking
- * run_processes_parallel(), it will be set back to "0" as soon as the
- * API reads that setting.
*/
-extern int run_processes_parallel_ungroup;
-int run_processes_parallel(int n,
- get_next_task_fn,
- start_failure_fn,
- task_finished_fn,
- void *pp_cb);
-int run_processes_parallel_tr2(int n, get_next_task_fn, start_failure_fn,
- task_finished_fn, void *pp_cb,
- const char *tr2_category, const char *tr2_label);
+void run_processes_parallel(const struct run_process_parallel_opts *opts);
/**
* Convenience function which prepares env for a command to be run in a
@@ -500,7 +503,7 @@ int run_processes_parallel_tr2(int n, get_next_task_fn, start_failure_fn,
* exception of GIT_CONFIG_PARAMETERS and GIT_CONFIG_COUNT (which cause the
* corresponding environment variables to be unset in the subprocess) and adds
* an environment variable pointing to new_git_dir. See local_repo_env in
- * cache.h for more information.
+ * environment.h for more information.
*/
void prepare_other_repo_env(struct strvec *env, const char *new_git_dir);
@@ -561,4 +564,6 @@ enum start_bg_result start_bg_command(struct child_process *cmd,
void *cb_data,
unsigned int timeout_sec);
+int sane_execvp(const char *file, char *const argv[]);
+
#endif
diff --git a/sane-ctype.h b/sane-ctype.h
new file mode 100644
index 0000000..cbea1b2
--- /dev/null
+++ b/sane-ctype.h
@@ -0,0 +1,66 @@
+#ifndef SANE_CTYPE_H
+#define SANE_CTYPE_H
+
+/* Sane ctype - no locale, and works with signed chars */
+#undef isascii
+#undef isspace
+#undef isdigit
+#undef isalpha
+#undef isalnum
+#undef isprint
+#undef islower
+#undef isupper
+#undef tolower
+#undef toupper
+#undef iscntrl
+#undef ispunct
+#undef isxdigit
+
+extern const unsigned char sane_ctype[256];
+extern const signed char hexval_table[256];
+#define GIT_SPACE 0x01
+#define GIT_DIGIT 0x02
+#define GIT_ALPHA 0x04
+#define GIT_GLOB_SPECIAL 0x08
+#define GIT_REGEX_SPECIAL 0x10
+#define GIT_PATHSPEC_MAGIC 0x20
+#define GIT_CNTRL 0x40
+#define GIT_PUNCT 0x80
+#define sane_istest(x,mask) ((sane_ctype[(unsigned char)(x)] & (mask)) != 0)
+#define isascii(x) (((x) & ~0x7f) == 0)
+#define isspace(x) sane_istest(x,GIT_SPACE)
+#define isdigit(x) sane_istest(x,GIT_DIGIT)
+#define isalpha(x) sane_istest(x,GIT_ALPHA)
+#define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT)
+#define isprint(x) ((x) >= 0x20 && (x) <= 0x7e)
+#define islower(x) sane_iscase(x, 1)
+#define isupper(x) sane_iscase(x, 0)
+#define is_glob_special(x) sane_istest(x,GIT_GLOB_SPECIAL)
+#define is_regex_special(x) sane_istest(x,GIT_GLOB_SPECIAL | GIT_REGEX_SPECIAL)
+#define iscntrl(x) (sane_istest(x,GIT_CNTRL))
+#define ispunct(x) sane_istest(x, GIT_PUNCT | GIT_REGEX_SPECIAL | \
+ GIT_GLOB_SPECIAL | GIT_PATHSPEC_MAGIC)
+#define isxdigit(x) (hexval_table[(unsigned char)(x)] != -1)
+#define tolower(x) sane_case((unsigned char)(x), 0x20)
+#define toupper(x) sane_case((unsigned char)(x), 0)
+#define is_pathspec_magic(x) sane_istest(x,GIT_PATHSPEC_MAGIC)
+
+static inline int sane_case(int x, int high)
+{
+ if (sane_istest(x, GIT_ALPHA))
+ x = (x & ~0x20) | high;
+ return x;
+}
+
+static inline int sane_iscase(int x, int is_lower)
+{
+ if (!sane_istest(x, GIT_ALPHA))
+ return 0;
+
+ if (is_lower)
+ return (x & 0x20) != 0;
+ else
+ return (x & 0x20) == 0;
+}
+
+#endif
diff --git a/contrib/scalar/scalar.c b/scalar.c
index 2817691..fb2940c 100644
--- a/contrib/scalar/scalar.c
+++ b/scalar.c
@@ -2,32 +2,21 @@
* The Scalar command-line interface.
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
#include "gettext.h"
#include "parse-options.h"
#include "config.h"
#include "run-command.h"
+#include "simple-ipc.h"
+#include "fsmonitor-ipc.h"
+#include "fsmonitor-settings.h"
#include "refs.h"
#include "dir.h"
#include "packfile.h"
#include "help.h"
-#include "archive.h"
-#include "object-store.h"
-
-/*
- * Remove the deepest subdirectory in the provided path string. Path must not
- * include a trailing path separator. Returns 1 if parent directory found,
- * otherwise 0.
- */
-static int strbuf_parent_directory(struct strbuf *buf)
-{
- size_t len = buf->len;
- size_t offset = offset_1st_component(buf->buf);
- char *path_sep = find_last_dir_sep(buf->buf + offset);
- strbuf_setlen(buf, path_sep ? path_sep - buf->buf : offset);
-
- return buf->len < len;
-}
+#include "setup.h"
+#include "trace2.h"
static void setup_enlistment_directory(int argc, const char **argv,
const char * const *usagestr,
@@ -35,8 +24,8 @@ static void setup_enlistment_directory(int argc, const char **argv,
struct strbuf *enlistment_root)
{
struct strbuf path = STRBUF_INIT;
- char *root;
- int enlistment_found = 0;
+ int enlistment_is_repo_parent = 0;
+ size_t len;
if (startup_info->have_repository)
BUG("gitdir already set up?!?");
@@ -49,79 +38,87 @@ static void setup_enlistment_directory(int argc, const char **argv,
strbuf_add_absolute_path(&path, argv[0]);
if (!is_directory(path.buf))
die(_("'%s' does not exist"), path.buf);
+ if (chdir(path.buf) < 0)
+ die_errno(_("could not switch to '%s'"), path.buf);
} else if (strbuf_getcwd(&path) < 0)
die(_("need a working directory"));
strbuf_trim_trailing_dir_sep(&path);
- do {
- const size_t len = path.len;
-
- /* check if currently in enlistment root with src/ workdir */
- strbuf_addstr(&path, "/src");
- if (is_nonbare_repository_dir(&path)) {
- if (enlistment_root)
- strbuf_add(enlistment_root, path.buf, len);
-
- enlistment_found = 1;
- break;
- }
- /* reset to original path */
- strbuf_setlen(&path, len);
-
- /* check if currently in workdir */
- if (is_nonbare_repository_dir(&path)) {
- if (enlistment_root) {
- /*
- * If the worktree's directory's name is `src`, the enlistment is the
- * parent directory, otherwise it is identical to the worktree.
- */
- root = strip_path_suffix(path.buf, "src");
- strbuf_addstr(enlistment_root, root ? root : path.buf);
- free(root);
- }
+ /* check if currently in enlistment root with src/ workdir */
+ len = path.len;
+ strbuf_addstr(&path, "/src");
+ if (is_nonbare_repository_dir(&path)) {
+ enlistment_is_repo_parent = 1;
+ if (chdir(path.buf) < 0)
+ die_errno(_("could not switch to '%s'"), path.buf);
+ }
+ strbuf_setlen(&path, len);
- enlistment_found = 1;
- break;
- }
- } while (strbuf_parent_directory(&path));
+ setup_git_directory();
- if (!enlistment_found)
- die(_("could not find enlistment root"));
+ if (!the_repository->worktree)
+ die(_("Scalar enlistments require a worktree"));
- if (chdir(path.buf) < 0)
- die_errno(_("could not switch to '%s'"), path.buf);
+ if (enlistment_root) {
+ if (enlistment_is_repo_parent)
+ strbuf_addbuf(enlistment_root, &path);
+ else
+ strbuf_addstr(enlistment_root, the_repository->worktree);
+ }
strbuf_release(&path);
- setup_git_directory();
}
static int run_git(const char *arg, ...)
{
- struct strvec argv = STRVEC_INIT;
+ struct child_process cmd = CHILD_PROCESS_INIT;
va_list args;
const char *p;
- int res;
va_start(args, arg);
- strvec_push(&argv, arg);
+ strvec_push(&cmd.args, arg);
while ((p = va_arg(args, const char *)))
- strvec_push(&argv, p);
+ strvec_push(&cmd.args, p);
va_end(args);
- res = run_command_v_opt(argv.v, RUN_GIT_CMD);
+ cmd.git_cmd = 1;
+ return run_command(&cmd);
+}
+
+struct scalar_config {
+ const char *key;
+ const char *value;
+ int overwrite_on_reconfigure;
+};
+
+static int set_scalar_config(const struct scalar_config *config, int reconfigure)
+{
+ char *value = NULL;
+ int res;
+
+ if ((reconfigure && config->overwrite_on_reconfigure) ||
+ git_config_get_string(config->key, &value)) {
+ trace2_data_string("scalar", the_repository, config->key, "created");
+ res = git_config_set_gently(config->key, config->value);
+ } else {
+ trace2_data_string("scalar", the_repository, config->key, "exists");
+ res = 0;
+ }
- strvec_clear(&argv);
+ free(value);
return res;
}
+static int have_fsmonitor_support(void)
+{
+ return fsmonitor_ipc__is_supported() &&
+ fsm_settings__get_reason(the_repository) == FSMONITOR_REASON_OK;
+}
+
static int set_recommended_config(int reconfigure)
{
- struct {
- const char *key;
- const char *value;
- int overwrite_on_reconfigure;
- } config[] = {
+ struct scalar_config config[] = {
/* Required */
{ "am.keepCR", "true", 1 },
{ "core.FSCache", "true", 1 },
@@ -149,6 +146,7 @@ static int set_recommended_config(int reconfigure)
{ "credential.validate", "false", 1 }, /* GCM4W-only */
{ "gc.auto", "0", 1 },
{ "gui.GCWarning", "false", 1 },
+ { "index.skipHash", "false", 1 },
{ "index.threads", "true", 1 },
{ "index.version", "4", 1 },
{ "merge.stat", "false", 1 },
@@ -175,17 +173,16 @@ static int set_recommended_config(int reconfigure)
char *value;
for (i = 0; config[i].key; i++) {
- if ((reconfigure && config[i].overwrite_on_reconfigure) ||
- git_config_get_string(config[i].key, &value)) {
- trace2_data_string("scalar", the_repository, config[i].key, "created");
- if (git_config_set_gently(config[i].key,
- config[i].value) < 0)
- return error(_("could not configure %s=%s"),
- config[i].key, config[i].value);
- } else {
- trace2_data_string("scalar", the_repository, config[i].key, "exists");
- free(value);
- }
+ if (set_scalar_config(config + i, reconfigure))
+ return error(_("could not configure %s=%s"),
+ config[i].key, config[i].value);
+ }
+
+ if (have_fsmonitor_support()) {
+ struct scalar_config fsmonitor = { "core.fsmonitor", "true" };
+ if (set_scalar_config(&fsmonitor, reconfigure))
+ return error(_("could not configure %s=%s"),
+ fsmonitor.key, fsmonitor.value);
}
/*
@@ -211,7 +208,10 @@ static int set_recommended_config(int reconfigure)
static int toggle_maintenance(int enable)
{
- return run_git("maintenance", enable ? "start" : "unregister", NULL);
+ return run_git("maintenance",
+ enable ? "start" : "unregister",
+ enable ? NULL : "--force",
+ NULL);
}
static int add_or_remove_enlistment(int add)
@@ -236,123 +236,55 @@ static int add_or_remove_enlistment(int add)
"scalar.repo", the_repository->worktree, NULL);
}
-static int register_dir(void)
+static int start_fsmonitor_daemon(void)
{
- int res = add_or_remove_enlistment(1);
-
- if (!res)
- res = set_recommended_config(0);
+ assert(have_fsmonitor_support());
- if (!res)
- res = toggle_maintenance(1);
+ if (fsmonitor_ipc__get_state() != IPC_STATE__LISTENING)
+ return run_git("fsmonitor--daemon", "start", NULL);
- return res;
+ return 0;
}
-static int unregister_dir(void)
+static int stop_fsmonitor_daemon(void)
{
- int res = 0;
-
- if (toggle_maintenance(0) < 0)
- res = -1;
+ assert(have_fsmonitor_support());
- if (add_or_remove_enlistment(0) < 0)
- res = -1;
+ if (fsmonitor_ipc__get_state() == IPC_STATE__LISTENING)
+ return run_git("fsmonitor--daemon", "stop", NULL);
- return res;
+ return 0;
}
-static int add_directory_to_archiver(struct strvec *archiver_args,
- const char *path, int recurse)
+static int register_dir(void)
{
- int at_root = !*path;
- DIR *dir = opendir(at_root ? "." : path);
- struct dirent *e;
- struct strbuf buf = STRBUF_INIT;
- size_t len;
- int res = 0;
+ if (add_or_remove_enlistment(1))
+ return error(_("could not add enlistment"));
- if (!dir)
- return error_errno(_("could not open directory '%s'"), path);
-
- if (!at_root)
- strbuf_addf(&buf, "%s/", path);
- len = buf.len;
- strvec_pushf(archiver_args, "--prefix=%s", buf.buf);
-
- while (!res && (e = readdir(dir))) {
- if (!strcmp(".", e->d_name) || !strcmp("..", e->d_name))
- continue;
-
- strbuf_setlen(&buf, len);
- strbuf_addstr(&buf, e->d_name);
-
- if (e->d_type == DT_REG)
- strvec_pushf(archiver_args, "--add-file=%s", buf.buf);
- else if (e->d_type != DT_DIR)
- warning(_("skipping '%s', which is neither file nor "
- "directory"), buf.buf);
- else if (recurse &&
- add_directory_to_archiver(archiver_args,
- buf.buf, recurse) < 0)
- res = -1;
+ if (set_recommended_config(0))
+ return error(_("could not set recommended config"));
+
+ if (toggle_maintenance(1))
+ warning(_("could not turn on maintenance"));
+
+ if (have_fsmonitor_support() && start_fsmonitor_daemon()) {
+ return error(_("could not start the FSMonitor daemon"));
}
- closedir(dir);
- strbuf_release(&buf);
- return res;
+ return 0;
}
-#ifndef WIN32
-#include <sys/statvfs.h>
-#endif
-
-static int get_disk_info(struct strbuf *out)
+static int unregister_dir(void)
{
-#ifdef WIN32
- struct strbuf buf = STRBUF_INIT;
- char volume_name[MAX_PATH], fs_name[MAX_PATH];
- DWORD serial_number, component_length, flags;
- ULARGE_INTEGER avail2caller, total, avail;
-
- strbuf_realpath(&buf, ".", 1);
- if (!GetDiskFreeSpaceExA(buf.buf, &avail2caller, &total, &avail)) {
- error(_("could not determine free disk size for '%s'"),
- buf.buf);
- strbuf_release(&buf);
- return -1;
- }
+ int res = 0;
- strbuf_setlen(&buf, offset_1st_component(buf.buf));
- if (!GetVolumeInformationA(buf.buf, volume_name, sizeof(volume_name),
- &serial_number, &component_length, &flags,
- fs_name, sizeof(fs_name))) {
- error(_("could not get info for '%s'"), buf.buf);
- strbuf_release(&buf);
- return -1;
- }
- strbuf_addf(out, "Available space on '%s': ", buf.buf);
- strbuf_humanise_bytes(out, avail2caller.QuadPart);
- strbuf_addch(out, '\n');
- strbuf_release(&buf);
-#else
- struct strbuf buf = STRBUF_INIT;
- struct statvfs stat;
+ if (toggle_maintenance(0))
+ res = error(_("could not turn off maintenance"));
- strbuf_realpath(&buf, ".", 1);
- if (statvfs(buf.buf, &stat) < 0) {
- error_errno(_("could not determine free disk size for '%s'"),
- buf.buf);
- strbuf_release(&buf);
- return -1;
- }
+ if (add_or_remove_enlistment(0))
+ res = error(_("could not remove enlistment"));
- strbuf_addf(out, "Available space on '%s': ", buf.buf);
- strbuf_humanise_bytes(out, st_mult(stat.f_bsize, stat.f_bavail));
- strbuf_addf(out, " (mount flags 0x%lx)\n", stat.f_flag);
- strbuf_release(&buf);
-#endif
- return 0;
+ return res;
}
/* printf-style interface, expects `<key>=<value>` argument */
@@ -431,25 +363,35 @@ static int delete_enlistment(struct strbuf *enlistment)
{
#ifdef WIN32
struct strbuf parent = STRBUF_INIT;
+ size_t offset;
+ char *path_sep;
#endif
if (unregister_dir())
- die(_("failed to unregister repository"));
+ return error(_("failed to unregister repository"));
#ifdef WIN32
/*
* Change the current directory to one outside of the enlistment so
* that we may delete everything underneath it.
*/
- strbuf_addbuf(&parent, enlistment);
- strbuf_parent_directory(&parent);
- if (chdir(parent.buf) < 0)
- die_errno(_("could not switch to '%s'"), parent.buf);
+ 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);
+ if (chdir(parent.buf) < 0) {
+ int res = error_errno(_("could not switch to '%s'"), parent.buf);
+ strbuf_release(&parent);
+ return res;
+ }
strbuf_release(&parent);
#endif
+ if (have_fsmonitor_support() && stop_fsmonitor_daemon())
+ return error(_("failed to stop the FSMonitor daemon"));
+
if (remove_dir_recursively(enlistment, 0))
- die(_("failed to delete enlistment directory"));
+ return error(_("failed to delete enlistment directory"));
return 0;
}
@@ -466,7 +408,8 @@ void load_builtin_commands(const char *prefix, struct cmdnames *cmds)
static int cmd_clone(int argc, const char **argv)
{
const char *branch = NULL;
- int full_clone = 0, single_branch = 0;
+ int full_clone = 0, single_branch = 0, show_progress = isatty(2);
+ int src = 1;
struct option clone_options[] = {
OPT_STRING('b', "branch", &branch, N_("<branch>"),
N_("branch to checkout after clone")),
@@ -475,10 +418,13 @@ static int cmd_clone(int argc, const char **argv)
OPT_BOOL(0, "single-branch", &single_branch,
N_("only download metadata for the branch that will "
"be checked out")),
+ OPT_BOOL(0, "src", &src,
+ N_("create repository within 'src' directory")),
OPT_END(),
};
const char * const clone_usage[] = {
- N_("scalar clone [<options>] [--] <repo> [<dir>]"),
+ N_("scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n"
+ "\t[--[no-]src] <url> [<enlistment>]"),
NULL
};
const char *url;
@@ -514,7 +460,10 @@ static int cmd_clone(int argc, const char **argv)
if (is_directory(enlistment))
die(_("directory '%s' exists already"), enlistment);
- dir = xstrfmt("%s/src", enlistment);
+ if (src)
+ dir = xstrfmt("%s/src", enlistment);
+ else
+ dir = xstrdup(enlistment);
strbuf_reset(&buf);
if (branch)
@@ -561,7 +510,9 @@ static int cmd_clone(int argc, const char **argv)
if (set_recommended_config(0))
return error(_("could not configure '%s'"), dir);
- if ((res = run_git("fetch", "--quiet", "origin", NULL))) {
+ if ((res = run_git("fetch", "--quiet",
+ show_progress ? "--progress" : "--no-progress",
+ "origin", NULL))) {
warning(_("partial clone failed; attempting full clone"));
if (set_config("remote.origin.promisor") ||
@@ -570,7 +521,9 @@ static int cmd_clone(int argc, const char **argv)
goto cleanup;
}
- if ((res = run_git("fetch", "--quiet", "origin", NULL)))
+ if ((res = run_git("fetch", "--quiet",
+ show_progress ? "--progress" : "--no-progress",
+ "origin", NULL)))
goto cleanup;
}
@@ -595,83 +548,6 @@ cleanup:
return res;
}
-static void dir_file_stats_objects(const char *full_path, size_t full_path_len,
- const char *file_name, void *data)
-{
- struct strbuf *buf = data;
- struct stat st;
-
- if (!stat(full_path, &st))
- strbuf_addf(buf, "%-70s %16" PRIuMAX "\n", file_name,
- (uintmax_t)st.st_size);
-}
-
-static int dir_file_stats(struct object_directory *object_dir, void *data)
-{
- struct strbuf *buf = data;
-
- strbuf_addf(buf, "Contents of %s:\n", object_dir->path);
-
- for_each_file_in_pack_dir(object_dir->path, dir_file_stats_objects,
- data);
-
- return 0;
-}
-
-static int count_files(char *path)
-{
- DIR *dir = opendir(path);
- struct dirent *e;
- int count = 0;
-
- if (!dir)
- return 0;
-
- while ((e = readdir(dir)) != NULL)
- if (!is_dot_or_dotdot(e->d_name) && e->d_type == DT_REG)
- count++;
-
- closedir(dir);
- return count;
-}
-
-static void loose_objs_stats(struct strbuf *buf, const char *path)
-{
- DIR *dir = opendir(path);
- struct dirent *e;
- int count;
- int total = 0;
- unsigned char c;
- struct strbuf count_path = STRBUF_INIT;
- size_t base_path_len;
-
- if (!dir)
- return;
-
- strbuf_addstr(buf, "Object directory stats for ");
- strbuf_add_absolute_path(buf, path);
- strbuf_addstr(buf, ":\n");
-
- strbuf_add_absolute_path(&count_path, path);
- strbuf_addch(&count_path, '/');
- base_path_len = count_path.len;
-
- while ((e = readdir(dir)) != NULL)
- if (!is_dot_or_dotdot(e->d_name) &&
- e->d_type == DT_DIR && strlen(e->d_name) == 2 &&
- !hex_to_bytes(&c, e->d_name, 1)) {
- strbuf_setlen(&count_path, base_path_len);
- strbuf_addstr(&count_path, e->d_name);
- total += (count = count_files(count_path.buf));
- strbuf_addf(buf, "%s : %7d files\n", e->d_name, count);
- }
-
- strbuf_addf(buf, "Total: %d loose objects", total);
-
- strbuf_release(&count_path);
- closedir(dir);
-}
-
static int cmd_diagnose(int argc, const char **argv)
{
struct option options[] = {
@@ -681,111 +557,23 @@ static int cmd_diagnose(int argc, const char **argv)
N_("scalar diagnose [<enlistment>]"),
NULL
};
- struct strbuf zip_path = STRBUF_INIT;
- struct strvec archiver_args = STRVEC_INIT;
- char **argv_copy = NULL;
- int stdout_fd = -1, archiver_fd = -1;
- time_t now = time(NULL);
- struct tm tm;
- struct strbuf path = STRBUF_INIT, buf = STRBUF_INIT;
+ struct strbuf diagnostics_root = STRBUF_INIT;
int res = 0;
argc = parse_options(argc, argv, NULL, options,
usage, 0);
- setup_enlistment_directory(argc, argv, usage, options, &zip_path);
-
- strbuf_addstr(&zip_path, "/.scalarDiagnostics/scalar_");
- strbuf_addftime(&zip_path,
- "%Y%m%d_%H%M%S", localtime_r(&now, &tm), 0, 0);
- strbuf_addstr(&zip_path, ".zip");
- switch (safe_create_leading_directories(zip_path.buf)) {
- case SCLD_EXISTS:
- case SCLD_OK:
- break;
- default:
- error_errno(_("could not create directory for '%s'"),
- zip_path.buf);
- goto diagnose_cleanup;
- }
- stdout_fd = dup(1);
- if (stdout_fd < 0) {
- res = error_errno(_("could not duplicate stdout"));
- goto diagnose_cleanup;
- }
-
- archiver_fd = xopen(zip_path.buf, O_CREAT | O_WRONLY | O_TRUNC, 0666);
- if (archiver_fd < 0 || dup2(archiver_fd, 1) < 0) {
- res = error_errno(_("could not redirect output"));
- goto diagnose_cleanup;
- }
-
- init_zip_archiver();
- strvec_pushl(&archiver_args, "scalar-diagnose", "--format=zip", NULL);
-
- strbuf_reset(&buf);
- strbuf_addstr(&buf, "Collecting diagnostic info\n\n");
- get_version_info(&buf, 1);
-
- strbuf_addf(&buf, "Enlistment root: %s\n", the_repository->worktree);
- get_disk_info(&buf);
- write_or_die(stdout_fd, buf.buf, buf.len);
- strvec_pushf(&archiver_args,
- "--add-virtual-file=diagnostics.log:%.*s",
- (int)buf.len, buf.buf);
-
- strbuf_reset(&buf);
- strbuf_addstr(&buf, "--add-virtual-file=packs-local.txt:");
- dir_file_stats(the_repository->objects->odb, &buf);
- foreach_alt_odb(dir_file_stats, &buf);
- strvec_push(&archiver_args, buf.buf);
-
- strbuf_reset(&buf);
- strbuf_addstr(&buf, "--add-virtual-file=objects-local.txt:");
- loose_objs_stats(&buf, ".git/objects");
- strvec_push(&archiver_args, buf.buf);
-
- if ((res = add_directory_to_archiver(&archiver_args, ".git", 0)) ||
- (res = add_directory_to_archiver(&archiver_args, ".git/hooks", 0)) ||
- (res = add_directory_to_archiver(&archiver_args, ".git/info", 0)) ||
- (res = add_directory_to_archiver(&archiver_args, ".git/logs", 1)) ||
- (res = add_directory_to_archiver(&archiver_args, ".git/objects/info", 0)))
- goto diagnose_cleanup;
-
- strvec_pushl(&archiver_args, "--prefix=",
- oid_to_hex(the_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);
- if (res) {
- error(_("failed to write archive"));
- goto diagnose_cleanup;
- }
-
- if (!res)
- fprintf(stderr, "\n"
- "Diagnostics complete.\n"
- "All of the gathered info is captured in '%s'\n",
- zip_path.buf);
+ setup_enlistment_directory(argc, argv, usage, options, &diagnostics_root);
+ strbuf_addstr(&diagnostics_root, "/.scalarDiagnostics");
-diagnose_cleanup:
- if (archiver_fd >= 0) {
- close(1);
- dup2(stdout_fd, 1);
- }
- free(argv_copy);
- strvec_clear(&archiver_args);
- strbuf_release(&zip_path);
- strbuf_release(&path);
- strbuf_release(&buf);
+ res = run_git("diagnose", "--mode=all", "-s", "%Y%m%d_%H%M%S",
+ "-o", diagnostics_root.buf, NULL);
+ strbuf_release(&diagnostics_root);
return res;
}
-static int cmd_list(int argc, const char **argv)
+static int cmd_list(int argc, const char **argv UNUSED)
{
if (argc != 1)
die(_("`scalar list` does not take arguments"));
@@ -813,7 +601,9 @@ static int cmd_register(int argc, const char **argv)
return register_dir();
}
-static int get_scalar_repos(const char *key, const char *value, void *data)
+static int get_scalar_repos(const char *key, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *data)
{
struct string_list *list = data;
@@ -823,6 +613,24 @@ static int get_scalar_repos(const char *key, const char *value, void *data)
return 0;
}
+static int remove_deleted_enlistment(struct strbuf *path)
+{
+ int res = 0;
+ strbuf_realpath_forgiving(path, path->buf, 1);
+
+ if (run_git("config", "--global",
+ "--unset", "--fixed-value",
+ "scalar.repo", path->buf, NULL) < 0)
+ res = -1;
+
+ if (run_git("config", "--global",
+ "--unset", "--fixed-value",
+ "maintenance.repo", path->buf, NULL) < 0)
+ res = -1;
+
+ return res;
+}
+
static int cmd_reconfigure(int argc, const char **argv)
{
int all = 0;
@@ -856,26 +664,67 @@ static int cmd_reconfigure(int argc, const char **argv)
git_config(get_scalar_repos, &scalar_repos);
for (i = 0; i < scalar_repos.nr; i++) {
+ int succeeded = 0;
const char *dir = scalar_repos.items[i].string;
strbuf_reset(&commondir);
strbuf_reset(&gitdir);
if (chdir(dir) < 0) {
- warning_errno(_("could not switch to '%s'"), dir);
- res = -1;
- } else if (discover_git_directory(&commondir, &gitdir) < 0) {
- warning_errno(_("git repository gone in '%s'"), dir);
- res = -1;
- } else {
- git_config_clear();
+ struct strbuf buf = STRBUF_INIT;
- the_repository = &r;
- r.commondir = commondir.buf;
- r.gitdir = gitdir.buf;
+ if (errno != ENOENT) {
+ warning_errno(_("could not switch to '%s'"), dir);
+ goto loop_end;
+ }
- if (set_recommended_config(1) < 0)
- res = -1;
+ strbuf_addstr(&buf, dir);
+ if (remove_deleted_enlistment(&buf))
+ error(_("could not remove stale "
+ "scalar.repo '%s'"), dir);
+ else {
+ warning(_("removed stale scalar.repo '%s'"),
+ dir);
+ succeeded = 1;
+ }
+ strbuf_release(&buf);
+ goto loop_end;
+ }
+
+ switch (discover_git_directory_reason(&commondir, &gitdir)) {
+ case GIT_DIR_INVALID_OWNERSHIP:
+ warning(_("repository at '%s' has different owner"), dir);
+ goto loop_end;
+
+ case GIT_DIR_INVALID_GITFILE:
+ case GIT_DIR_INVALID_FORMAT:
+ warning(_("repository at '%s' has a format issue"), dir);
+ goto loop_end;
+
+ case GIT_DIR_DISCOVERED:
+ succeeded = 1;
+ break;
+
+ default:
+ warning(_("repository not found in '%s'"), dir);
+ break;
+ }
+
+ git_config_clear();
+
+ the_repository = &r;
+ r.commondir = commondir.buf;
+ r.gitdir = gitdir.buf;
+
+ if (set_recommended_config(1) >= 0)
+ succeeded = 1;
+
+loop_end:
+ if (!succeeded) {
+ res = -1;
+ warning(_("to unregister this repository from Scalar, run\n"
+ "\tgit config --global --unset --fixed-value scalar.repo \"%s\""),
+ dir);
}
}
@@ -949,24 +798,6 @@ static int cmd_run(int argc, const char **argv)
return 0;
}
-static int remove_deleted_enlistment(struct strbuf *path)
-{
- int res = 0;
- strbuf_realpath_forgiving(path, path->buf, 1);
-
- if (run_git("config", "--global",
- "--unset", "--fixed-value",
- "scalar.repo", path->buf, NULL) < 0)
- res = -1;
-
- if (run_git("config", "--global",
- "--unset", "--fixed-value",
- "maintenance.repo", path->buf, NULL) < 0)
- res = -1;
-
- return res;
-}
-
static int cmd_unregister(int argc, const char **argv)
{
struct option options[] = {
@@ -1046,6 +877,25 @@ static int cmd_delete(int argc, const char **argv)
return res;
}
+static int cmd_help(int argc, const char **argv)
+{
+ struct option options[] = {
+ OPT_END(),
+ };
+ const char * const usage[] = {
+ "scalar help",
+ NULL
+ };
+
+ argc = parse_options(argc, argv, NULL, options,
+ usage, 0);
+
+ if (argc != 0)
+ usage_with_options(usage, options);
+
+ return run_git("help", "scalar", NULL);
+}
+
static int cmd_version(int argc, const char **argv)
{
int verbose = 0, build_options = 0;
@@ -1085,6 +935,7 @@ static struct {
{ "run", cmd_run },
{ "reconfigure", cmd_reconfigure },
{ "delete", cmd_delete },
+ { "help", cmd_help },
{ "version", cmd_version },
{ "diagnose", cmd_diagnose },
{ NULL, NULL},
diff --git a/send-pack.c b/send-pack.c
index bc0fcdb..37f59d4 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -1,21 +1,24 @@
-#include "builtin.h"
+#include "git-compat-util.h"
#include "config.h"
#include "commit.h"
-#include "refs.h"
-#include "object-store.h"
+#include "date.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-store-ll.h"
#include "pkt-line.h"
#include "sideband.h"
#include "run-command.h"
#include "remote.h"
#include "connect.h"
#include "send-pack.h"
-#include "quote.h"
#include "transport.h"
#include "version.h"
#include "oid-array.h"
#include "gpg-interface.h"
-#include "cache.h"
#include "shallow.h"
+#include "parse-options.h"
+#include "trace2.h"
+#include "write-or-die.h"
int option_parse_push_signed(const struct option *opt,
const char *arg, int unset)
@@ -42,9 +45,9 @@ int option_parse_push_signed(const struct option *opt,
static void feed_object(const struct object_id *oid, FILE *fh, int negative)
{
if (negative &&
- !has_object_file_with_flags(oid,
- OBJECT_INFO_SKIP_FETCH_OBJECT |
- OBJECT_INFO_QUICK))
+ !repo_has_object_file_with_flags(the_repository, oid,
+ OBJECT_INFO_SKIP_FETCH_OBJECT |
+ OBJECT_INFO_QUICK))
return;
if (negative)
@@ -84,6 +87,8 @@ static int pack_objects(int fd, struct ref *refs, struct oid_array *advertised,
strvec_push(&po.args, "--progress");
if (is_repository_shallow(the_repository))
strvec_push(&po.args, "--shallow");
+ if (args->disable_bitmaps)
+ strvec_push(&po.args, "--no-use-bitmap-index");
po.in = -1;
po.out = args->stateless_rpc ? -1 : fd;
po.git_cmd = 1;
@@ -264,7 +269,7 @@ static int receive_status(struct packet_reader *reader, struct ref *refs)
return ret;
}
-static int sideband_demux(int in, int out, void *data)
+static int sideband_demux(int in UNUSED, int out, void *data)
{
int *fd = data, ret;
if (async_with_fork())
@@ -487,6 +492,7 @@ int send_pack(struct send_pack_args *args,
struct async demux;
const char *push_cert_nonce = NULL;
struct packet_reader reader;
+ int use_bitmaps;
if (!remote_refs) {
fprintf(stderr, "No refs in common and none specified; doing nothing.\n"
@@ -498,6 +504,9 @@ int send_pack(struct send_pack_args *args,
if (push_negotiate)
get_commons_through_negotiation(args->url, remote_refs, &commons);
+ if (!git_config_get_bool("push.usebitmaps", &use_bitmaps))
+ args->disable_bitmaps = !use_bitmaps;
+
git_config_get_bool("transfer.advertisesid", &advertise_sid);
/* Does the other end support the reporting? */
@@ -528,7 +537,7 @@ int send_pack(struct send_pack_args *args,
die(_("the receiving end does not support this repository's hash algorithm"));
if (args->push_cert != SEND_PACK_PUSH_CERT_NEVER) {
- int len;
+ size_t len;
push_cert_nonce = server_feature_value("push-cert", &len);
if (push_cert_nonce) {
reject_invalid_nonce(push_cert_nonce, len);
diff --git a/send-pack.h b/send-pack.h
index e148fcd..7edb805 100644
--- a/send-pack.h
+++ b/send-pack.h
@@ -26,7 +26,8 @@ struct send_pack_args {
/* One of the SEND_PACK_PUSH_CERT_* constants. */
push_cert:2,
stateless_rpc:1,
- atomic:1;
+ atomic:1,
+ disable_bitmaps:1;
const struct string_list *push_options;
};
diff --git a/sequencer.c b/sequencer.c
index 61a8e00..2c19846 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1,23 +1,33 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "advice.h"
#include "config.h"
+#include "copy.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "lockfile.h"
#include "dir.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "object.h"
+#include "pager.h"
#include "commit.h"
#include "sequencer.h"
-#include "tag.h"
#include "run-command.h"
#include "hook.h"
-#include "exec-cmd.h"
#include "utf8.h"
#include "cache-tree.h"
#include "diff.h"
+#include "path.h"
#include "revision.h"
#include "rerere.h"
+#include "merge.h"
#include "merge-ort.h"
#include "merge-ort-wrappers.h"
#include "refs.h"
+#include "sparse-index.h"
#include "strvec.h"
#include "quote.h"
#include "trailer.h"
@@ -27,7 +37,6 @@
#include "notes-utils.h"
#include "sigchain.h"
#include "unpack-trees.h"
-#include "worktree.h"
#include "oidmap.h"
#include "oidset.h"
#include "commit-slab.h"
@@ -35,9 +44,19 @@
#include "commit-reach.h"
#include "rebase-interactive.h"
#include "reset.h"
+#include "branch.h"
#define GIT_REFLOG_ACTION "GIT_REFLOG_ACTION"
+/*
+ * To accommodate common filesystem limitations, where the loose refs' file
+ * names must not exceed `NAME_MAX`, the labels generated by `git rebase
+ * --rebase-merges` need to be truncated if the corresponding commit subjects
+ * are too long.
+ * Add some margin to stay clear from reaching `NAME_MAX`.
+ */
+#define GIT_MAX_LABEL_LENGTH ((NAME_MAX) - (LOCK_SUFFIX_LEN) - 16)
+
static const char sign_off_header[] = "Signed-off-by: ";
static const char cherry_picked_prefix[] = "(cherry picked from commit ";
@@ -126,6 +145,11 @@ static GIT_PATH_FUNC(rebase_path_amend, "rebase-merge/amend")
*/
static GIT_PATH_FUNC(rebase_path_stopped_sha, "rebase-merge/stopped-sha")
/*
+ * When we stop for the user to resolve conflicts this file contains
+ * the patch of the commit that is being picked.
+ */
+static GIT_PATH_FUNC(rebase_path_patch, "rebase-merge/patch")
+/*
* For the post-rewrite hook, we make a list of rewritten commits and
* their new sha1s. The rewritten-pending list keeps the sha1s of
* commits that have been processed, but not committed yet,
@@ -148,6 +172,20 @@ static GIT_PATH_FUNC(rebase_path_squash_onto, "rebase-merge/squash-onto")
static GIT_PATH_FUNC(rebase_path_refs_to_delete, "rebase-merge/refs-to-delete")
/*
+ * The update-refs file stores a list of refs that will be updated at the end
+ * of the rebase sequence. The 'update-ref <ref>' commands in the todo file
+ * update the OIDs for the refs in this file, but the refs are not updated
+ * until the end of the rebase sequence.
+ *
+ * rebase_path_update_refs() returns the path to this file for a given
+ * worktree directory. For the current worktree, pass the_repository->gitdir.
+ */
+static char *rebase_path_update_refs(const char *wt_git_dir)
+{
+ return xstrfmt("%s/rebase-merge/update-refs", wt_git_dir);
+}
+
+/*
* The following files are written by git-rebase just after parsing the
* command-line.
*/
@@ -169,37 +207,57 @@ static GIT_PATH_FUNC(rebase_path_no_reschedule_failed_exec, "rebase-merge/no-res
static GIT_PATH_FUNC(rebase_path_drop_redundant_commits, "rebase-merge/drop_redundant_commits")
static GIT_PATH_FUNC(rebase_path_keep_redundant_commits, "rebase-merge/keep_redundant_commits")
-static int git_sequencer_config(const char *k, const char *v, void *cb)
+/**
+ * A 'struct update_refs_record' represents a value in the update-refs
+ * list. We use a string_list to map refs to these (before, after) pairs.
+ */
+struct update_ref_record {
+ struct object_id before;
+ struct object_id after;
+};
+
+static struct update_ref_record *init_update_ref_record(const char *ref)
+{
+ struct update_ref_record *rec;
+
+ CALLOC_ARRAY(rec, 1);
+
+ oidcpy(&rec->before, null_oid());
+ oidcpy(&rec->after, null_oid());
+
+ /* This may fail, but that's fine, we will keep the null OID. */
+ read_ref(ref, &rec->before);
+
+ return rec;
+}
+
+static int git_sequencer_config(const char *k, const char *v,
+ const struct config_context *ctx, void *cb)
{
struct replay_opts *opts = cb;
- int status;
if (!strcmp(k, "commit.cleanup")) {
- const char *s;
-
- status = git_config_string(&s, k, v);
- if (status)
- return status;
+ if (!v)
+ return config_error_nonbool(k);
- if (!strcmp(s, "verbatim")) {
+ if (!strcmp(v, "verbatim")) {
opts->default_msg_cleanup = COMMIT_MSG_CLEANUP_NONE;
opts->explicit_cleanup = 1;
- } else if (!strcmp(s, "whitespace")) {
+ } else if (!strcmp(v, "whitespace")) {
opts->default_msg_cleanup = COMMIT_MSG_CLEANUP_SPACE;
opts->explicit_cleanup = 1;
- } else if (!strcmp(s, "strip")) {
+ } else if (!strcmp(v, "strip")) {
opts->default_msg_cleanup = COMMIT_MSG_CLEANUP_ALL;
opts->explicit_cleanup = 1;
- } else if (!strcmp(s, "scissors")) {
+ } else if (!strcmp(v, "scissors")) {
opts->default_msg_cleanup = COMMIT_MSG_CLEANUP_SCISSORS;
opts->explicit_cleanup = 1;
} else {
warning(_("invalid commit message cleanup mode '%s'"),
- s);
+ v);
}
- free((char *)s);
- return status;
+ return 0;
}
if (!strcmp(k, "commit.gpgsign")) {
@@ -224,11 +282,7 @@ static int git_sequencer_config(const char *k, const char *v, void *cb)
if (opts->action == REPLAY_REVERT && !strcmp(k, "revert.reference"))
opts->commit_use_reference = git_config_bool(k, v);
- status = git_gpg_config(k, v, NULL);
- if (status)
- return status;
-
- return git_diff_basic_config(k, v, NULL);
+ return git_diff_basic_config(k, v, ctx, NULL);
}
void sequencer_init_config(struct replay_opts *opts)
@@ -278,12 +332,12 @@ static int has_conforming_footer(struct strbuf *sb, struct strbuf *sob,
sb->buf[sb->len - ignore_footer] = '\0';
}
- trailer_info_get(&info, sb->buf, &opts);
+ trailer_info_get(&opts, sb->buf, &info);
if (ignore_footer)
sb->buf[sb->len - ignore_footer] = saved_char;
- if (info.trailer_start == info.trailer_end)
+ if (info.trailer_block_start == info.trailer_block_end)
return 0;
for (i = 0; i < info.trailer_nr; i++)
@@ -312,10 +366,23 @@ static const char *gpg_sign_opt_quoted(struct replay_opts *opts)
return buf.buf;
}
+void replay_opts_release(struct replay_opts *opts)
+{
+ free(opts->gpg_sign);
+ free(opts->reflog_action);
+ free(opts->default_strategy);
+ free(opts->strategy);
+ strvec_clear (&opts->xopts);
+ strbuf_release(&opts->current_fixups);
+ if (opts->revs)
+ release_revisions(opts->revs);
+ free(opts->revs);
+}
+
int sequencer_remove_state(struct replay_opts *opts)
{
struct strbuf buf = STRBUF_INIT;
- int i, ret = 0;
+ int ret = 0;
if (is_rebase_i(opts) &&
strbuf_read_file(&buf, rebase_path_refs_to_delete(), 0) > 0) {
@@ -334,14 +401,6 @@ int sequencer_remove_state(struct replay_opts *opts)
}
}
- free(opts->gpg_sign);
- free(opts->default_strategy);
- free(opts->strategy);
- for (i = 0; i < opts->xopts_nr; i++)
- free(opts->xopts[i]);
- free(opts->xopts);
- strbuf_release(&opts->current_fixups);
-
strbuf_reset(&buf);
strbuf_addstr(&buf, get_dir(opts));
if (remove_dir_recursively(&buf, 0))
@@ -371,9 +430,9 @@ struct commit_message {
const char *message;
};
-static const char *short_commit_name(struct commit *commit)
+static const char *short_commit_name(struct repository *r, struct commit *commit)
{
- return find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV);
+ return repo_find_unique_abbrev(r, &commit->object.oid, DEFAULT_ABBREV);
}
static int get_message(struct commit *commit, struct commit_message *out)
@@ -381,8 +440,9 @@ static int get_message(struct commit *commit, struct commit_message *out)
const char *abbrev, *subject;
int subject_len;
- out->message = logmsg_reencode(commit, NULL, get_commit_output_encoding());
- abbrev = short_commit_name(commit);
+ out->message = repo_logmsg_reencode(the_repository, commit, NULL,
+ get_commit_output_encoding());
+ abbrev = short_commit_name(the_repository, commit);
subject_len = find_commit_subject(out->message, &subject);
@@ -398,44 +458,59 @@ static void free_message(struct commit *commit, struct commit_message *msg)
free(msg->parent_label);
free(msg->label);
free(msg->subject);
- unuse_commit_buffer(commit, msg->message);
+ repo_unuse_commit_buffer(the_repository, commit, msg->message);
}
+const char *rebase_resolvemsg =
+N_("Resolve all conflicts manually, mark them as resolved with\n"
+"\"git add/rm <conflicted_files>\", then run \"git rebase --continue\".\n"
+"You can instead skip this commit: run \"git rebase --skip\".\n"
+"To abort and get back to the state before \"git rebase\", run "
+"\"git rebase --abort\".");
+
static void print_advice(struct repository *r, int show_hint,
struct replay_opts *opts)
{
- char *msg = getenv("GIT_CHERRY_PICK_HELP");
+ const char *msg;
+
+ if (is_rebase_i(opts))
+ msg = rebase_resolvemsg;
+ else
+ msg = getenv("GIT_CHERRY_PICK_HELP");
if (msg) {
- advise("%s\n", msg);
+ advise_if_enabled(ADVICE_MERGE_CONFLICT, "%s", msg);
/*
* A conflict has occurred but the porcelain
* (typically rebase --interactive) wants to take care
* of the commit itself so remove CHERRY_PICK_HEAD
*/
refs_delete_ref(get_main_ref_store(r), "", "CHERRY_PICK_HEAD",
- NULL, 0);
+ NULL, REF_NO_DEREF);
return;
}
if (show_hint) {
if (opts->no_commit)
- advise(_("after resolving the conflicts, mark the corrected paths\n"
- "with 'git add <paths>' or 'git rm <paths>'"));
+ advise_if_enabled(ADVICE_MERGE_CONFLICT,
+ _("after resolving the conflicts, mark the corrected paths\n"
+ "with 'git add <paths>' or 'git rm <paths>'"));
else if (opts->action == REPLAY_PICK)
- advise(_("After resolving the conflicts, mark them with\n"
- "\"git add/rm <pathspec>\", then run\n"
- "\"git cherry-pick --continue\".\n"
- "You can instead skip this commit with \"git cherry-pick --skip\".\n"
- "To abort and get back to the state before \"git cherry-pick\",\n"
- "run \"git cherry-pick --abort\"."));
+ advise_if_enabled(ADVICE_MERGE_CONFLICT,
+ _("After resolving the conflicts, mark them with\n"
+ "\"git add/rm <pathspec>\", then run\n"
+ "\"git cherry-pick --continue\".\n"
+ "You can instead skip this commit with \"git cherry-pick --skip\".\n"
+ "To abort and get back to the state before \"git cherry-pick\",\n"
+ "run \"git cherry-pick --abort\"."));
else if (opts->action == REPLAY_REVERT)
- advise(_("After resolving the conflicts, mark them with\n"
- "\"git add/rm <pathspec>\", then run\n"
- "\"git revert --continue\".\n"
- "You can instead skip this commit with \"git revert --skip\".\n"
- "To abort and get back to the state before \"git revert\",\n"
- "run \"git revert --abort\"."));
+ advise_if_enabled(ADVICE_MERGE_CONFLICT,
+ _("After resolving the conflicts, mark them with\n"
+ "\"git add/rm <pathspec>\", then run\n"
+ "\"git revert --continue\".\n"
+ "You can instead skip this commit with \"git revert --skip\".\n"
+ "To abort and get back to the state before \"git revert\",\n"
+ "run \"git revert --abort\"."));
else
BUG("unexpected pick action in print_advice()");
}
@@ -497,7 +572,7 @@ static struct tree *empty_tree(struct repository *r)
static int error_dirty_index(struct repository *repo, struct replay_opts *opts)
{
if (repo_read_index_unmerged(repo))
- return error_resolve_conflict(_(action_name(opts)));
+ return error_resolve_conflict(action_name(opts));
error(_("your local changes would be overwritten by %s."),
_(action_name(opts)));
@@ -515,7 +590,7 @@ static void update_abort_safety_file(void)
if (!file_exists(git_path_seq_dir()))
return;
- if (!get_oid("HEAD", &head))
+ if (!repo_get_oid(the_repository, "HEAD", &head))
write_file(git_path_abort_safety_file(), "%s", oid_to_hex(&head));
else
write_file(git_path_abort_safety_file(), "%s", "");
@@ -535,7 +610,7 @@ static int fast_forward_to(struct repository *r,
if (checkout_fast_forward(r, from, to, 1))
return -1; /* the callee should have complained already */
- strbuf_addf(&sb, _("%s: fast-forward"), _(action_name(opts)));
+ strbuf_addf(&sb, "%s: fast-forward", action_name(opts));
transaction = ref_transaction_begin(&err);
if (!transaction ||
@@ -603,15 +678,16 @@ void append_conflicts_hint(struct index_state *istate,
if (cleanup_mode == COMMIT_MSG_CLEANUP_SCISSORS) {
strbuf_addch(msgbuf, '\n');
wt_status_append_cut_line(msgbuf);
- strbuf_addch(msgbuf, comment_line_char);
+ strbuf_addstr(msgbuf, comment_line_str);
}
strbuf_addch(msgbuf, '\n');
- strbuf_commented_addf(msgbuf, "Conflicts:\n");
+ strbuf_commented_addf(msgbuf, comment_line_str, "Conflicts:\n");
for (i = 0; i < istate->cache_nr;) {
const struct cache_entry *ce = istate->cache[i++];
if (ce_stage(ce)) {
- strbuf_commented_addf(msgbuf, "\t%s\n", ce->name);
+ strbuf_commented_addf(msgbuf, comment_line_str,
+ "\t%s\n", ce->name);
while (i < istate->cache_nr &&
!strcmp(ce->name, istate->cache[i]->name))
i++;
@@ -646,11 +722,13 @@ static int do_recursive_merge(struct repository *r,
o.show_rename_progress = 1;
head_tree = parse_tree_indirect(head);
- next_tree = next ? get_commit_tree(next) : empty_tree(r);
- base_tree = base ? get_commit_tree(base) : empty_tree(r);
+ if (!head_tree)
+ return error(_("unable to read tree (%s)"), oid_to_hex(head));
+ next_tree = next ? repo_get_commit_tree(r, next) : empty_tree(r);
+ base_tree = base ? repo_get_commit_tree(r, base) : empty_tree(r);
- for (i = 0; i < opts->xopts_nr; i++)
- parse_merge_opt(&o, opts->xopts[i]);
+ for (i = 0; i < opts->xopts.nr; i++)
+ parse_merge_opt(&o, opts->xopts.v[i]);
if (!opts->strategy || !strcmp(opts->strategy, "ort")) {
memset(&result, 0, sizeof(result));
@@ -709,29 +787,42 @@ static struct object_id *get_cache_tree_oid(struct index_state *istate)
static int is_index_unchanged(struct repository *r)
{
struct object_id head_oid, *cache_tree_oid;
+ const struct object_id *head_tree_oid;
struct commit *head_commit;
struct index_state *istate = r->index;
+ const char *head_name;
+
+ if (!resolve_ref_unsafe("HEAD", RESOLVE_REF_READING, &head_oid, NULL)) {
+ /* Check to see if this is an unborn branch */
+ head_name = resolve_ref_unsafe("HEAD",
+ RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
+ &head_oid, NULL);
+ if (!head_name ||
+ !starts_with(head_name, "refs/heads/") ||
+ !is_null_oid(&head_oid))
+ return error(_("could not resolve HEAD commit"));
+ head_tree_oid = the_hash_algo->empty_tree;
+ } else {
+ head_commit = lookup_commit(r, &head_oid);
- if (!resolve_ref_unsafe("HEAD", RESOLVE_REF_READING, &head_oid, NULL))
- return error(_("could not resolve HEAD commit"));
-
- head_commit = lookup_commit(r, &head_oid);
+ /*
+ * If head_commit is NULL, check_commit, called from
+ * lookup_commit, would have indicated that head_commit is not
+ * a commit object already. repo_parse_commit() will return failure
+ * without further complaints in such a case. Otherwise, if
+ * the commit is invalid, repo_parse_commit() will complain. So
+ * there is nothing for us to say here. Just return failure.
+ */
+ if (repo_parse_commit(r, head_commit))
+ return -1;
- /*
- * If head_commit is NULL, check_commit, called from
- * lookup_commit, would have indicated that head_commit is not
- * a commit object already. parse_commit() will return failure
- * without further complaints in such a case. Otherwise, if
- * the commit is invalid, parse_commit() will complain. So
- * there is nothing for us to say here. Just return failure.
- */
- if (parse_commit(head_commit))
- return -1;
+ head_tree_oid = get_commit_tree_oid(head_commit);
+ }
if (!(cache_tree_oid = get_cache_tree_oid(istate)))
return -1;
- return oideq(cache_tree_oid, get_commit_tree_oid(head_commit));
+ return oideq(cache_tree_oid, head_tree_oid);
}
static int write_author_script(const char *message)
@@ -875,7 +966,7 @@ int read_author_script(const char *path, char **name, char **email, char **date,
error(_("missing 'GIT_AUTHOR_EMAIL'"));
if (date_i == -2)
error(_("missing 'GIT_AUTHOR_DATE'"));
- if (date_i < 0 || email_i < 0 || date_i < 0 || err)
+ if (name_i < 0 || email_i < 0 || date_i < 0 || err)
goto finish;
*name = kv.items[name_i].util;
*email = kv.items[email_i].util;
@@ -1010,6 +1101,8 @@ static int run_git_commit(const char *defmsg,
gpg_opt, gpg_opt);
}
+ strvec_pushf(&cmd.env, GIT_REFLOG_ACTION "=%s", opts->reflog_message);
+
if (opts->committer_date_is_author_date)
strvec_pushf(&cmd.env, "GIT_COMMITTER_DATE=%s",
opts->ignore_date ?
@@ -1088,7 +1181,8 @@ void cleanup_message(struct strbuf *msgbuf,
cleanup_mode == COMMIT_MSG_CLEANUP_SCISSORS)
strbuf_setlen(msgbuf, wt_status_locate_end(msgbuf->buf, msgbuf->len));
if (cleanup_mode != COMMIT_MSG_CLEANUP_NONE)
- strbuf_stripspace(msgbuf, cleanup_mode == COMMIT_MSG_CLEANUP_ALL);
+ strbuf_stripspace(msgbuf,
+ cleanup_mode == COMMIT_MSG_CLEANUP_ALL ? comment_line_str : NULL);
}
/*
@@ -1119,7 +1213,8 @@ int template_untouched(const struct strbuf *sb, const char *template_file,
if (!template_file || strbuf_read_file(&tmpl, template_file, 0) <= 0)
return 0;
- strbuf_stripspace(&tmpl, cleanup_mode == COMMIT_MSG_CLEANUP_ALL);
+ strbuf_stripspace(&tmpl,
+ cleanup_mode == COMMIT_MSG_CLEANUP_ALL ? comment_line_str : NULL);
if (!skip_prefix(sb->buf, tmpl.buf, &start))
start = sb->buf;
strbuf_release(&tmpl);
@@ -1288,13 +1383,15 @@ void print_commit_summary(struct repository *r,
commit = lookup_commit(r, oid);
if (!commit)
die(_("couldn't look up newly created commit"));
- if (parse_commit(commit))
+ if (repo_parse_commit(r, commit))
die(_("could not parse newly created commit"));
strbuf_addstr(&format, "format:%h] %s");
- format_commit_message(commit, "%an <%ae>", &author_ident, &pctx);
- format_commit_message(commit, "%cn <%ce>", &committer_ident, &pctx);
+ repo_format_commit_message(r, commit, "%an <%ae>", &author_ident,
+ &pctx);
+ repo_format_commit_message(r, commit, "%cn <%ce>", &committer_ident,
+ &pctx);
if (strbuf_cmp(&author_ident, &committer_ident)) {
strbuf_addstr(&format, "\n Author: ");
strbuf_addbuf_percentquote(&format, &author_ident);
@@ -1302,7 +1399,7 @@ void print_commit_summary(struct repository *r,
if (flags & SUMMARY_SHOW_AUTHOR_DATE) {
struct strbuf date = STRBUF_INIT;
- format_commit_message(commit, "%ad", &date, &pctx);
+ repo_format_commit_message(r, commit, "%ad", &date, &pctx);
strbuf_addstr(&format, "\n Date: ");
strbuf_addbuf_percentquote(&format, &date);
strbuf_release(&date);
@@ -1332,7 +1429,7 @@ void print_commit_summary(struct repository *r,
rev.diffopt.detect_rename = DIFF_DETECT_RENAME;
diff_setup_done(&rev.diffopt);
- refs = get_main_ref_store(the_repository);
+ refs = get_main_ref_store(r);
head = refs_resolve_ref_unsafe(refs, "HEAD", 0, NULL, NULL);
if (!head)
die(_("unable to resolve HEAD after creating commit"));
@@ -1358,7 +1455,7 @@ static int parse_head(struct repository *r, struct commit **head)
struct commit *current_head;
struct object_id oid;
- if (get_oid("HEAD", &oid)) {
+ if (repo_get_oid(r, "HEAD", &oid)) {
current_head = NULL;
} else {
current_head = lookup_commit_reference(r, &oid);
@@ -1368,7 +1465,7 @@ static int parse_head(struct repository *r, struct commit **head)
warning(_("HEAD %s is not a commit!"),
oid_to_hex(&oid));
}
- if (parse_commit(current_head))
+ if (repo_parse_commit(r, current_head))
return error(_("could not parse HEAD commit"));
}
*head = current_head;
@@ -1411,8 +1508,8 @@ static int try_to_commit(struct repository *r,
if (flags & AMEND_MSG) {
const char *exclude_gpgsig[] = { "gpgsig", "gpgsig-sha256", NULL };
const char *out_enc = get_commit_output_encoding();
- const char *message = logmsg_reencode(current_head, NULL,
- out_enc);
+ const char *message = repo_logmsg_reencode(r, current_head,
+ NULL, out_enc);
if (!msg) {
const char *orig_message = NULL;
@@ -1423,7 +1520,8 @@ static int try_to_commit(struct repository *r,
hook_commit = "HEAD";
}
author = amend_author = get_author(message);
- unuse_commit_buffer(current_head, message);
+ repo_unuse_commit_buffer(r, current_head,
+ message);
if (!author) {
res = error(_("unable to parse commit author"));
goto out;
@@ -1488,7 +1586,8 @@ static int try_to_commit(struct repository *r,
cleanup = opts->default_msg_cleanup;
if (cleanup != COMMIT_MSG_CLEANUP_NONE)
- strbuf_stripspace(msg, cleanup == COMMIT_MSG_CLEANUP_ALL);
+ strbuf_stripspace(msg,
+ cleanup == COMMIT_MSG_CLEANUP_ALL ? comment_line_str : NULL);
if ((flags & EDIT_MSG) && message_is_empty(msg, cleanup)) {
res = 1; /* run 'git commit' to display error message */
goto out;
@@ -1549,8 +1648,8 @@ static int try_to_commit(struct repository *r,
goto out;
}
- if (update_head_with_reflog(current_head, oid,
- getenv("GIT_REFLOG_ACTION"), msg, &err)) {
+ if (update_head_with_reflog(current_head, oid, opts->reflog_message,
+ msg, &err)) {
res = error("%s", err.buf);
goto out;
}
@@ -1598,7 +1697,7 @@ static int do_commit(struct repository *r,
strbuf_release(&sb);
if (!res) {
refs_delete_ref(get_main_ref_store(r), "",
- "CHERRY_PICK_HEAD", NULL, 0);
+ "CHERRY_PICK_HEAD", NULL, REF_NO_DEREF);
unlink(git_path_merge_msg(r));
if (!is_rebase_i(opts))
print_commit_summary(r, NULL, &oid,
@@ -1620,12 +1719,12 @@ static int is_original_commit_empty(struct commit *commit)
{
const struct object_id *ptree_oid;
- if (parse_commit(commit))
+ if (repo_parse_commit(the_repository, commit))
return error(_("could not parse commit %s"),
oid_to_hex(&commit->object.oid));
if (commit->parents) {
struct commit *parent = commit->parents->item;
- if (parse_commit(parent))
+ if (repo_parse_commit(the_repository, parent))
return error(_("could not parse parent commit %s"),
oid_to_hex(&parent->object.oid));
ptree_oid = get_commit_tree_oid(parent);
@@ -1650,34 +1749,25 @@ static int allow_empty(struct repository *r,
int index_unchanged, originally_empty;
/*
- * Four cases:
- *
- * (1) we do not allow empty at all and error out.
- *
- * (2) we allow ones that were initially empty, and
- * just drop the ones that become empty
- *
- * (3) we allow ones that were initially empty, but
- * halt for the ones that become empty;
+ * For a commit that is initially empty, allow_empty determines if it
+ * should be kept or not
*
- * (4) we allow both.
+ * For a commit that becomes empty, keep_redundant_commits and
+ * drop_redundant_commits determine whether the commit should be kept or
+ * dropped. If neither is specified, halt.
*/
- if (!opts->allow_empty)
- return 0; /* let "git commit" barf as necessary */
-
index_unchanged = is_index_unchanged(r);
if (index_unchanged < 0)
return index_unchanged;
if (!index_unchanged)
return 0; /* we do not have to say --allow-empty */
- if (opts->keep_redundant_commits)
- return 1;
-
originally_empty = is_original_commit_empty(commit);
if (originally_empty < 0)
return originally_empty;
if (originally_empty)
+ return opts->allow_empty;
+ else if (opts->keep_redundant_commits)
return 1;
else if (opts->drop_redundant_commits)
return 2;
@@ -1689,26 +1779,29 @@ static struct {
char c;
const char *str;
} todo_command_info[] = {
- { 'p', "pick" },
- { 0, "revert" },
- { 'e', "edit" },
- { 'r', "reword" },
- { 'f', "fixup" },
- { 's', "squash" },
- { 'x', "exec" },
- { 'b', "break" },
- { 'l', "label" },
- { 't', "reset" },
- { 'm', "merge" },
- { 0, "noop" },
- { 'd', "drop" },
- { 0, NULL }
+ [TODO_PICK] = { 'p', "pick" },
+ [TODO_REVERT] = { 0, "revert" },
+ [TODO_EDIT] = { 'e', "edit" },
+ [TODO_REWORD] = { 'r', "reword" },
+ [TODO_FIXUP] = { 'f', "fixup" },
+ [TODO_SQUASH] = { 's', "squash" },
+ [TODO_EXEC] = { 'x', "exec" },
+ [TODO_BREAK] = { 'b', "break" },
+ [TODO_LABEL] = { 'l', "label" },
+ [TODO_RESET] = { 't', "reset" },
+ [TODO_MERGE] = { 'm', "merge" },
+ [TODO_UPDATE_REF] = { 'u', "update-ref" },
+ [TODO_NOOP] = { 0, "noop" },
+ [TODO_DROP] = { 'd', "drop" },
+ [TODO_COMMENT] = { 0, NULL },
};
static const char *command_to_string(const enum todo_command command)
{
if (command < TODO_COMMENT)
return todo_command_info[command].str;
+ if (command == TODO_COMMENT)
+ return comment_line_str;
die(_("unknown command: %d"), command);
}
@@ -1716,7 +1809,7 @@ static char command_to_char(const enum todo_command command)
{
if (command < TODO_COMMENT)
return todo_command_info[command].c;
- return comment_line_char;
+ return 0;
}
static int is_noop(const enum todo_command command)
@@ -1770,7 +1863,7 @@ static int is_fixup_flag(enum todo_command command, unsigned flag)
static void add_commented_lines(struct strbuf *buf, const void *str, size_t len)
{
const char *s = str;
- while (len > 0 && s[0] == comment_line_char) {
+ while (starts_with_mem(s, len, comment_line_str)) {
size_t count;
const char *n = memchr(s, '\n', len);
if (!n)
@@ -1781,7 +1874,7 @@ static void add_commented_lines(struct strbuf *buf, const void *str, size_t len)
s += count;
len -= count;
}
- strbuf_add_commented_lines(buf, s, len);
+ strbuf_add_commented_lines(buf, s, len, comment_line_str);
}
/* Does the current fixup chain contain a squash command? */
@@ -1876,11 +1969,11 @@ static int append_squash_message(struct strbuf *buf, const char *body,
(starts_with(body, "squash!") || starts_with(body, "fixup!"))))
commented_len = commit_subject_length(body);
- strbuf_addf(buf, "\n%c ", comment_line_char);
+ strbuf_addf(buf, "\n%s ", comment_line_str);
strbuf_addf(buf, _(nth_commit_msg_fmt),
++opts->current_fixup_count + 1);
strbuf_addstr(buf, "\n\n");
- strbuf_add_commented_lines(buf, body, commented_len);
+ strbuf_add_commented_lines(buf, body, commented_len, comment_line_str);
/* buf->buf may be reallocated so store an offset into the buffer */
fixup_off = buf->len;
strbuf_addstr(buf, body + commented_len);
@@ -1933,10 +2026,10 @@ static int update_squash_messages(struct repository *r,
return error(_("could not read '%s'"),
rebase_path_squash_msg());
- eol = buf.buf[0] != comment_line_char ?
+ eol = !starts_with(buf.buf, comment_line_str) ?
buf.buf : strchrnul(buf.buf, '\n');
- strbuf_addf(&header, "%c ", comment_line_char);
+ strbuf_addf(&header, "%s ", comment_line_str);
strbuf_addf(&header, _(combined_commit_msg_fmt),
opts->current_fixup_count + 2);
strbuf_splice(&buf, 0, eol - buf.buf, header.buf, header.len);
@@ -1948,35 +2041,37 @@ static int update_squash_messages(struct repository *r,
struct commit *head_commit;
const char *head_message, *body;
- if (get_oid("HEAD", &head))
+ if (repo_get_oid(r, "HEAD", &head))
return error(_("need a HEAD to fixup"));
if (!(head_commit = lookup_commit_reference(r, &head)))
return error(_("could not read HEAD"));
- if (!(head_message = logmsg_reencode(head_commit, NULL, encoding)))
+ if (!(head_message = repo_logmsg_reencode(r, head_commit, NULL,
+ encoding)))
return error(_("could not read HEAD's commit message"));
find_commit_subject(head_message, &body);
if (command == TODO_FIXUP && !flag && write_message(body, strlen(body),
rebase_path_fixup_msg(), 0) < 0) {
- unuse_commit_buffer(head_commit, head_message);
+ repo_unuse_commit_buffer(r, head_commit, head_message);
return error(_("cannot write '%s'"), rebase_path_fixup_msg());
}
- strbuf_addf(&buf, "%c ", comment_line_char);
+ strbuf_addf(&buf, "%s ", comment_line_str);
strbuf_addf(&buf, _(combined_commit_msg_fmt), 2);
- strbuf_addf(&buf, "\n%c ", comment_line_char);
+ strbuf_addf(&buf, "\n%s ", comment_line_str);
strbuf_addstr(&buf, is_fixup_flag(command, flag) ?
_(skip_first_commit_msg_str) :
_(first_commit_msg_str));
strbuf_addstr(&buf, "\n\n");
if (is_fixup_flag(command, flag))
- strbuf_add_commented_lines(&buf, body, strlen(body));
+ strbuf_add_commented_lines(&buf, body, strlen(body),
+ comment_line_str);
else
strbuf_addstr(&buf, body);
- unuse_commit_buffer(head_commit, head_message);
+ repo_unuse_commit_buffer(r, head_commit, head_message);
}
- if (!(message = logmsg_reencode(commit, NULL, encoding)))
+ if (!(message = repo_logmsg_reencode(r, commit, NULL, encoding)))
return error(_("could not read commit message of %s"),
oid_to_hex(&commit->object.oid));
find_commit_subject(message, &body);
@@ -1984,14 +2079,15 @@ static int update_squash_messages(struct repository *r,
if (command == TODO_SQUASH || is_fixup_flag(command, flag)) {
res = append_squash_message(&buf, body, command, opts, flag);
} else if (command == TODO_FIXUP) {
- strbuf_addf(&buf, "\n%c ", comment_line_char);
+ strbuf_addf(&buf, "\n%s ", comment_line_str);
strbuf_addf(&buf, _(skip_nth_commit_msg_fmt),
++opts->current_fixup_count + 1);
strbuf_addstr(&buf, "\n\n");
- strbuf_add_commented_lines(&buf, body, strlen(body));
+ strbuf_add_commented_lines(&buf, body, strlen(body),
+ comment_line_str);
} else
return error(_("unknown command: %d"), command);
- unuse_commit_buffer(commit, message);
+ repo_unuse_commit_buffer(r, commit, message);
if (!res)
res = write_message(buf.buf, buf.len, rebase_path_squash_msg(),
@@ -2018,7 +2114,7 @@ static void flush_rewritten_pending(void)
FILE *out;
if (strbuf_read_file(&buf, rebase_path_rewritten_pending(), (GIT_MAX_HEXSZ + 1) * 2) > 0 &&
- !get_oid("HEAD", &newoid) &&
+ !repo_get_oid(the_repository, "HEAD", &newoid) &&
(out = fopen_or_warn(rebase_path_rewritten_list(), "a"))) {
char *bol = buf.buf, *eol;
@@ -2070,7 +2166,8 @@ static void refer_to_commit(struct replay_opts *opts,
.abbrev = DEFAULT_ABBREV,
.date_mode.type = DATE_SHORT,
};
- format_commit_message(commit, "%h (%s, %ad)", msgbuf, &ctx);
+ repo_format_commit_message(the_repository, commit,
+ "%h (%s, %ad)", msgbuf, &ctx);
} else {
strbuf_addstr(msgbuf, oid_to_hex(&commit->object.oid));
}
@@ -2103,7 +2200,7 @@ static int do_pick_commit(struct repository *r,
if (write_index_as_tree(&head, r->index, r->index_file, 0, NULL))
return error(_("your index file is unmerged."));
} else {
- unborn = get_oid("HEAD", &head);
+ unborn = repo_get_oid(r, "HEAD", &head);
/* Do we want to generate a root commit? */
if (is_pick_or_similar(command) && opts->have_squash_onto &&
oideq(&head, &opts->squash_onto)) {
@@ -2165,7 +2262,7 @@ static int do_pick_commit(struct repository *r,
msg_file = NULL;
goto fast_forward_edit;
}
- if (parent && parse_commit(parent) < 0)
+ if (parent && repo_parse_commit(r, parent) < 0)
/* TRANSLATORS: The first %s will be a "todo" command like
"revert" or "pick", the second %s a SHA1. */
return error(_("%s: cannot parse parent commit %s"),
@@ -2180,6 +2277,8 @@ static int do_pick_commit(struct repository *r,
*/
if (command == TODO_REVERT) {
+ const char *orig_subject;
+
base = commit;
base_label = msg.label;
next = parent;
@@ -2187,6 +2286,15 @@ static int do_pick_commit(struct repository *r,
if (opts->commit_use_reference) {
strbuf_addstr(&msgbuf,
"# *** SAY WHY WE ARE REVERTING ON THE TITLE LINE ***");
+ } else if (skip_prefix(msg.subject, "Revert \"", &orig_subject) &&
+ /*
+ * We don't touch pre-existing repeated reverts, because
+ * theoretically these can be nested arbitrarily deeply,
+ * thus requiring excessive complexity to deal with.
+ */
+ !starts_with(orig_subject, "Revert \"")) {
+ strbuf_addstr(&msgbuf, "Reapply \"");
+ strbuf_addstr(&msgbuf, orig_subject);
} else {
strbuf_addstr(&msgbuf, "Revert \"");
strbuf_addstr(&msgbuf, msg.subject);
@@ -2228,8 +2336,10 @@ static int do_pick_commit(struct repository *r,
reword = 1;
else if (is_fixup(command)) {
if (update_squash_messages(r, command, commit,
- opts, item->flags))
- return -1;
+ opts, item->flags)) {
+ res = -1;
+ goto leave;
+ }
flags |= AMEND_MSG;
if (!final_fixup)
msg_file = rebase_path_squash_msg();
@@ -2239,9 +2349,11 @@ static int do_pick_commit(struct repository *r,
} else {
const char *dest = git_path_squash_msg(r);
unlink(dest);
- if (copy_file(dest, rebase_path_squash_msg(), 0666))
- return error(_("could not rename '%s' to '%s'"),
- rebase_path_squash_msg(), dest);
+ if (copy_file(dest, rebase_path_squash_msg(), 0666)) {
+ res = error(_("could not copy '%s' to '%s'"),
+ rebase_path_squash_msg(), dest);
+ goto leave;
+ }
unlink(git_path_merge_msg(r));
msg_file = dest;
flags |= EDIT_MSG;
@@ -2274,12 +2386,11 @@ static int do_pick_commit(struct repository *r,
commit_list_insert(base, &common);
commit_list_insert(next, &remotes);
res |= try_merge_command(r, opts->strategy,
- opts->xopts_nr, (const char **)opts->xopts,
+ opts->xopts.nr, opts->xopts.v,
common, oid_to_hex(&head), remotes);
free_commit_list(common);
free_commit_list(remotes);
}
- strbuf_release(&msgbuf);
/*
* If the merge was clean or if it failed due to conflict, we write
@@ -2302,7 +2413,7 @@ static int do_pick_commit(struct repository *r,
error(command == TODO_REVERT
? _("could not revert %s... %s")
: _("could not apply %s... %s"),
- short_commit_name(commit), msg.subject);
+ short_commit_name(r, commit), msg.subject);
print_advice(r, res == 1, opts);
repo_rerere(r, opts->allow_rerere_auto);
goto leave;
@@ -2318,9 +2429,10 @@ static int do_pick_commit(struct repository *r,
} else if (allow == 2) {
drop_commit = 1;
refs_delete_ref(get_main_ref_store(r), "", "CHERRY_PICK_HEAD",
- NULL, 0);
+ NULL, REF_NO_DEREF);
unlink(git_path_merge_msg(r));
- unlink(git_path_auto_merge(r));
+ refs_delete_ref(get_main_ref_store(r), "", "AUTO_MERGE",
+ NULL, REF_NO_DEREF);
fprintf(stderr,
_("dropping %s %s -- patch contents already upstream\n"),
oid_to_hex(&commit->object.oid), msg.subject);
@@ -2353,6 +2465,7 @@ fast_forward_edit:
leave:
free_message(commit, &msg);
free(author);
+ strbuf_release(&msgbuf);
update_abort_safety_file();
return res;
@@ -2381,7 +2494,7 @@ static int read_and_refresh_cache(struct repository *r,
if (repo_read_index(r) < 0) {
rollback_lock_file(&index_lock);
return error(_("git %s: failed to read the index"),
- _(action_name(opts)));
+ action_name(opts));
}
refresh_index(r->index, REFRESH_QUIET|REFRESH_UNMERGED, NULL, NULL, NULL);
@@ -2389,7 +2502,7 @@ static int read_and_refresh_cache(struct repository *r,
if (write_locked_index(r->index, &index_lock,
COMMIT_LOCK | SKIP_IF_UNCHANGED)) {
return error(_("git %s: failed to refresh the index"),
- _(action_name(opts)));
+ action_name(opts));
}
}
@@ -2412,7 +2525,6 @@ void todo_list_release(struct todo_list *todo_list)
static struct todo_item *append_new_todo(struct todo_list *todo_list)
{
ALLOC_GROW(todo_list->items, todo_list->nr + 1, todo_list->alloc);
- todo_list->total_nr++;
return todo_list->items + todo_list->nr++;
}
@@ -2426,12 +2538,39 @@ static int is_command(enum todo_command command, const char **bol)
{
const char *str = todo_command_info[command].str;
const char nick = todo_command_info[command].c;
- const char *p = *bol + 1;
+ const char *p = *bol;
+
+ return (skip_prefix(p, str, &p) || (nick && *p++ == nick)) &&
+ (*p == ' ' || *p == '\t' || *p == '\n' || *p == '\r' || !*p) &&
+ (*bol = p);
+}
+
+static int check_label_or_ref_arg(enum todo_command command, const char *arg)
+{
+ switch (command) {
+ case TODO_LABEL:
+ /*
+ * '#' is not a valid label as the merge command uses it to
+ * separate merge parents from the commit subject.
+ */
+ if (!strcmp(arg, "#") ||
+ check_refname_format(arg, REFNAME_ALLOW_ONELEVEL))
+ return error(_("'%s' is not a valid label"), arg);
+ break;
- return skip_prefix(*bol, str, bol) ||
- ((nick && **bol == nick) &&
- (*p == ' ' || *p == '\t' || *p == '\n' || *p == '\r' || !*p) &&
- (*bol = p));
+ case TODO_UPDATE_REF:
+ if (check_refname_format(arg, REFNAME_ALLOW_ONELEVEL))
+ return error(_("'%s' is not a valid refname"), arg);
+ if (check_refname_format(arg, 0))
+ return error(_("update-ref requires a fully qualified "
+ "refname e.g. refs/heads/%s"), arg);
+ break;
+
+ default:
+ BUG("unexpected todo_command");
+ }
+
+ return 0;
}
static int parse_insn_line(struct repository *r, struct todo_item *item,
@@ -2446,7 +2585,7 @@ static int parse_insn_line(struct repository *r, struct todo_item *item,
/* left-trim */
bol += strspn(bol, " \t");
- if (bol == eol || *bol == '\r' || *bol == comment_line_char) {
+ if (bol == eol || *bol == '\r' || starts_with_mem(bol, eol - bol, comment_line_str)) {
item->command = TODO_COMMENT;
item->commit = NULL;
item->arg_offset = bol - buf;
@@ -2460,7 +2599,8 @@ static int parse_insn_line(struct repository *r, struct todo_item *item,
break;
}
if (i >= TODO_COMMENT)
- return -1;
+ return error(_("invalid command '%.*s'"),
+ (int)strcspn(bol, " \t\r\n"), bol);
/* Eat up extra spaces/ tabs before object name */
padding = strspn(bol, " \t");
@@ -2481,20 +2621,27 @@ static int parse_insn_line(struct repository *r, struct todo_item *item,
command_to_string(item->command));
if (item->command == TODO_EXEC || item->command == TODO_LABEL ||
- item->command == TODO_RESET) {
+ item->command == TODO_RESET || item->command == TODO_UPDATE_REF) {
+ int ret = 0;
+
item->commit = NULL;
item->arg_offset = bol - buf;
item->arg_len = (int)(eol - bol);
- return 0;
+ if (item->command == TODO_LABEL ||
+ item->command == TODO_UPDATE_REF) {
+ saved = *eol;
+ *eol = '\0';
+ ret = check_label_or_ref_arg(item->command, bol);
+ *eol = saved;
+ }
+ return ret;
}
if (item->command == TODO_FIXUP) {
- if (skip_prefix(bol, "-C", &bol) &&
- (*bol == ' ' || *bol == '\t')) {
+ if (skip_prefix(bol, "-C", &bol)) {
bol += strspn(bol, " \t");
item->flags |= TODO_REPLACE_FIXUP_MSG;
- } else if (skip_prefix(bol, "-c", &bol) &&
- (*bol == ' ' || *bol == '\t')) {
+ } else if (skip_prefix(bol, "-c", &bol)) {
bol += strspn(bol, " \t");
item->flags |= TODO_EDIT_FIXUP_MSG;
}
@@ -2518,7 +2665,7 @@ static int parse_insn_line(struct repository *r, struct todo_item *item,
end_of_object_name = (char *) bol + strcspn(bol, " \t\n");
saved = *end_of_object_name;
*end_of_object_name = '\0';
- status = get_oid(bol, &commit_oid);
+ status = repo_get_oid(r, bol, &commit_oid);
if (status < 0)
error(_("could not parse '%s'"), bol); /* return later */
*end_of_object_name = saved;
@@ -2534,7 +2681,7 @@ static int parse_insn_line(struct repository *r, struct todo_item *item,
return item->commit ? 0 : -1;
}
-int sequencer_get_last_command(struct repository *r, enum replay_action *action)
+int sequencer_get_last_command(struct repository *r UNUSED, enum replay_action *action)
{
const char *todo_file, *bol;
struct strbuf buf = STRBUF_INIT;
@@ -2568,7 +2715,7 @@ int todo_list_parse_insn_buffer(struct repository *r, char *buf,
char *p = buf, *next_p;
int i, res = 0, fixup_okay = file_exists(rebase_path_done());
- todo_list->current = todo_list->nr = 0;
+ todo_list->current = todo_list->nr = todo_list->total_nr = 0;
for (i = 1; *p; i++, p = next_p) {
char *eol = strchrnul(p, '\n');
@@ -2589,10 +2736,13 @@ int todo_list_parse_insn_buffer(struct repository *r, char *buf,
item->commit = NULL;
}
+ if (item->command != TODO_COMMENT)
+ todo_list->total_nr++;
+
if (fixup_okay)
; /* do nothing */
else if (is_fixup(item->command))
- return error(_("cannot '%s' without a previous commit"),
+ res = error(_("cannot '%s' without a previous commit"),
command_to_string(item->command));
else if (!is_noop(item->command))
fixup_okay = 1;
@@ -2676,7 +2826,7 @@ void sequencer_post_commit_cleanup(struct repository *r, int verbose)
if (refs_ref_exists(get_main_ref_store(r), "CHERRY_PICK_HEAD")) {
if (!refs_delete_ref(get_main_ref_store(r), "",
- "CHERRY_PICK_HEAD", NULL, 0) &&
+ "CHERRY_PICK_HEAD", NULL, REF_NO_DEREF) &&
verbose)
warning(_("cancelling a cherry picking in progress"));
opts.action = REPLAY_PICK;
@@ -2685,14 +2835,15 @@ void sequencer_post_commit_cleanup(struct repository *r, int verbose)
if (refs_ref_exists(get_main_ref_store(r), "REVERT_HEAD")) {
if (!refs_delete_ref(get_main_ref_store(r), "", "REVERT_HEAD",
- NULL, 0) &&
+ NULL, REF_NO_DEREF) &&
verbose)
warning(_("cancelling a revert in progress"));
opts.action = REPLAY_REVERT;
need_cleanup = 1;
}
- unlink(git_path_auto_merge(r));
+ refs_delete_ref(get_main_ref_store(r), "", "AUTO_MERGE",
+ NULL, REF_NO_DEREF);
if (!need_cleanup)
return;
@@ -2779,7 +2930,9 @@ static int git_config_string_dup(char **dest,
return 0;
}
-static int populate_opts_cb(const char *key, const char *value, void *data)
+static int populate_opts_cb(const char *key, const char *value,
+ const struct config_context *ctx,
+ void *data)
{
struct replay_opts *opts = data;
int error_flag = 1;
@@ -2787,36 +2940,38 @@ static int populate_opts_cb(const char *key, const char *value, void *data)
if (!value)
error_flag = 0;
else if (!strcmp(key, "options.no-commit"))
- opts->no_commit = git_config_bool_or_int(key, value, &error_flag);
+ opts->no_commit = git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
else if (!strcmp(key, "options.edit"))
- opts->edit = git_config_bool_or_int(key, value, &error_flag);
+ opts->edit = git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
else if (!strcmp(key, "options.allow-empty"))
opts->allow_empty =
- git_config_bool_or_int(key, value, &error_flag);
+ git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
else if (!strcmp(key, "options.allow-empty-message"))
opts->allow_empty_message =
- git_config_bool_or_int(key, value, &error_flag);
+ git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
+ else if (!strcmp(key, "options.drop-redundant-commits"))
+ opts->drop_redundant_commits =
+ git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
else if (!strcmp(key, "options.keep-redundant-commits"))
opts->keep_redundant_commits =
- git_config_bool_or_int(key, value, &error_flag);
+ git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
else if (!strcmp(key, "options.signoff"))
- opts->signoff = git_config_bool_or_int(key, value, &error_flag);
+ opts->signoff = git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
else if (!strcmp(key, "options.record-origin"))
- opts->record_origin = git_config_bool_or_int(key, value, &error_flag);
+ opts->record_origin = git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
else if (!strcmp(key, "options.allow-ff"))
- opts->allow_ff = git_config_bool_or_int(key, value, &error_flag);
+ opts->allow_ff = git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
else if (!strcmp(key, "options.mainline"))
- opts->mainline = git_config_int(key, value);
+ opts->mainline = git_config_int(key, value, ctx->kvi);
else if (!strcmp(key, "options.strategy"))
git_config_string_dup(&opts->strategy, key, value);
else if (!strcmp(key, "options.gpg-sign"))
git_config_string_dup(&opts->gpg_sign, key, value);
else if (!strcmp(key, "options.strategy-option")) {
- ALLOC_GROW(opts->xopts, opts->xopts_nr + 1, opts->xopts_alloc);
- opts->xopts[opts->xopts_nr++] = xstrdup(value);
+ strvec_push(&opts->xopts, value);
} else if (!strcmp(key, "options.allow-rerere-auto"))
opts->allow_rerere_auto =
- git_config_bool_or_int(key, value, &error_flag) ?
+ git_config_bool_or_int(key, value, ctx->kvi, &error_flag) ?
RERERE_AUTOUPDATE : RERERE_NOAUTOUPDATE;
else if (!strcmp(key, "options.default-msg-cleanup")) {
opts->explicit_cleanup = 1;
@@ -2830,22 +2985,27 @@ static int populate_opts_cb(const char *key, const char *value, void *data)
return 0;
}
-void parse_strategy_opts(struct replay_opts *opts, char *raw_opts)
+static void parse_strategy_opts(struct replay_opts *opts, char *raw_opts)
{
int i;
+ int count;
+ const char **argv;
char *strategy_opts_string = raw_opts;
if (*strategy_opts_string == ' ')
strategy_opts_string++;
- opts->xopts_nr = split_cmdline(strategy_opts_string,
- (const char ***)&opts->xopts);
- for (i = 0; i < opts->xopts_nr; i++) {
- const char *arg = opts->xopts[i];
+ count = split_cmdline(strategy_opts_string, &argv);
+ if (count < 0)
+ BUG("could not split '%s': %s", strategy_opts_string,
+ split_cmdline_strerror(count));
+ for (i = 0; i < count; i++) {
+ const char *arg = argv[i];
skip_prefix(arg, "--", &arg);
- opts->xopts[i] = xstrdup(arg);
+ strvec_push(&opts->xopts, arg);
}
+ free(argv);
}
static void read_strategy_opts(struct replay_opts *opts, struct strbuf *buf)
@@ -2933,7 +3093,7 @@ static int read_populate_opts(struct replay_opts *opts)
}
if (read_oneliner(&buf, rebase_path_squash_onto(), 0)) {
- if (get_oid_committish(buf.buf, &opts->squash_onto) < 0) {
+ if (repo_get_oid_committish(the_repository, buf.buf, &opts->squash_onto) < 0) {
ret = error(_("unusable squash-onto"));
goto done_rebase_i;
}
@@ -2961,12 +3121,13 @@ done_rebase_i:
static void write_strategy_opts(struct replay_opts *opts)
{
- int i;
struct strbuf buf = STRBUF_INIT;
- for (i = 0; i < opts->xopts_nr; ++i)
- strbuf_addf(&buf, " --%s", opts->xopts[i]);
-
+ /*
+ * Quote strategy options so that they can be read correctly
+ * by split_cmdline().
+ */
+ quote_cmdline(&buf, opts->xopts.v);
write_file(rebase_path_strategy_opts(), "%s\n", buf.buf);
strbuf_release(&buf);
}
@@ -2989,7 +3150,7 @@ int write_basic_state(struct replay_opts *opts, const char *head_name,
write_file(rebase_path_verbose(), "%s", "");
if (opts->strategy)
write_file(rebase_path_strategy(), "%s\n", opts->strategy);
- if (opts->xopts_nr > 0)
+ if (opts->xopts.nr > 0)
write_strategy_opts(opts);
if (opts->allow_rerere_auto == RERERE_AUTOUPDATE)
@@ -3033,7 +3194,9 @@ static int walk_revs_populate_todo(struct todo_list *todo_list,
while ((commit = get_revision(opts->revs))) {
struct todo_item *item = append_new_todo(todo_list);
- const char *commit_buffer = logmsg_reencode(commit, NULL, encoding);
+ const char *commit_buffer = repo_logmsg_reencode(the_repository,
+ commit, NULL,
+ encoding);
const char *subject;
int subject_len;
@@ -3044,8 +3207,10 @@ static int walk_revs_populate_todo(struct todo_list *todo_list,
item->offset_in_buf = todo_list->buf.len;
subject_len = find_commit_subject(commit_buffer, &subject);
strbuf_addf(&todo_list->buf, "%s %s %.*s\n", command_string,
- short_commit_name(commit), subject_len, subject);
- unuse_commit_buffer(commit, commit_buffer);
+ short_commit_name(the_repository, commit),
+ subject_len, subject);
+ repo_unuse_commit_buffer(the_repository, commit,
+ commit_buffer);
}
if (!todo_list->nr)
@@ -3095,25 +3260,7 @@ static int create_seq_dir(struct repository *r)
static int save_head(const char *head)
{
- struct lock_file head_lock = LOCK_INIT;
- struct strbuf buf = STRBUF_INIT;
- int fd;
- ssize_t written;
-
- fd = hold_lock_file_for_update(&head_lock, git_path_head_file(), 0);
- if (fd < 0)
- return error_errno(_("could not lock HEAD"));
- strbuf_addf(&buf, "%s\n", head);
- written = write_in_full(fd, buf.buf, buf.len);
- strbuf_release(&buf);
- if (written < 0) {
- error_errno(_("could not write to '%s'"), git_path_head_file());
- rollback_lock_file(&head_lock);
- return -1;
- }
- if (commit_lock_file(&head_lock) < 0)
- return error(_("failed to finalize '%s'"), git_path_head_file());
- return 0;
+ return write_message(head, strlen(head), git_path_head_file(), 1);
}
static int rollback_is_safe(void)
@@ -3134,7 +3281,7 @@ static int rollback_is_safe(void)
else
die_errno(_("could not read '%s'"), git_path_abort_safety_file());
- if (get_oid("HEAD", &actual_head))
+ if (repo_get_oid(the_repository, "HEAD", &actual_head))
oidclr(&actual_head);
return oideq(&actual_head, &expected_head);
@@ -3142,18 +3289,15 @@ static int rollback_is_safe(void)
static int reset_merge(const struct object_id *oid)
{
- int ret;
- struct strvec argv = STRVEC_INIT;
+ struct child_process cmd = CHILD_PROCESS_INIT;
- strvec_pushl(&argv, "reset", "--merge", NULL);
+ cmd.git_cmd = 1;
+ strvec_pushl(&cmd.args, "reset", "--merge", NULL);
if (!is_null_oid(oid))
- strvec_push(&argv, oid_to_hex(oid));
-
- ret = run_command_v_opt(argv.v, RUN_GIT_CMD);
- strvec_clear(&argv);
+ strvec_push(&cmd.args, oid_to_hex(oid));
- return ret;
+ return run_command(&cmd);
}
static int rollback_single_pick(struct repository *r)
@@ -3293,7 +3437,8 @@ give_advice:
return -1;
}
-static int save_todo(struct todo_list *todo_list, struct replay_opts *opts)
+static int save_todo(struct todo_list *todo_list, struct replay_opts *opts,
+ int reschedule)
{
struct lock_file todo_lock = LOCK_INIT;
const char *todo_path = get_todo_path(opts);
@@ -3303,7 +3448,7 @@ static int save_todo(struct todo_list *todo_list, struct replay_opts *opts)
* rebase -i writes "git-rebase-todo" without the currently executing
* command, appending it to "done" instead.
*/
- if (is_rebase_i(opts))
+ if (is_rebase_i(opts) && !reschedule)
next++;
fd = hold_lock_file_for_update(&todo_lock, todo_path, 0);
@@ -3316,7 +3461,7 @@ static int save_todo(struct todo_list *todo_list, struct replay_opts *opts)
if (commit_lock_file(&todo_lock) < 0)
return error(_("failed to finalize '%s'"), todo_path);
- if (is_rebase_i(opts) && next > 0) {
+ if (is_rebase_i(opts) && !reschedule && next > 0) {
const char *done = rebase_path_done();
int fd = open(done, O_CREAT | O_WRONLY | O_APPEND, 0666);
int ret = 0;
@@ -3341,57 +3486,57 @@ static int save_opts(struct replay_opts *opts)
if (opts->no_commit)
res |= git_config_set_in_file_gently(opts_file,
- "options.no-commit", "true");
+ "options.no-commit", NULL, "true");
if (opts->edit >= 0)
- res |= git_config_set_in_file_gently(opts_file, "options.edit",
+ res |= git_config_set_in_file_gently(opts_file, "options.edit", NULL,
opts->edit ? "true" : "false");
if (opts->allow_empty)
res |= git_config_set_in_file_gently(opts_file,
- "options.allow-empty", "true");
+ "options.allow-empty", NULL, "true");
if (opts->allow_empty_message)
res |= git_config_set_in_file_gently(opts_file,
- "options.allow-empty-message", "true");
+ "options.allow-empty-message", NULL, "true");
+ if (opts->drop_redundant_commits)
+ res |= git_config_set_in_file_gently(opts_file,
+ "options.drop-redundant-commits", NULL, "true");
if (opts->keep_redundant_commits)
res |= git_config_set_in_file_gently(opts_file,
- "options.keep-redundant-commits", "true");
+ "options.keep-redundant-commits", NULL, "true");
if (opts->signoff)
res |= git_config_set_in_file_gently(opts_file,
- "options.signoff", "true");
+ "options.signoff", NULL, "true");
if (opts->record_origin)
res |= git_config_set_in_file_gently(opts_file,
- "options.record-origin", "true");
+ "options.record-origin", NULL, "true");
if (opts->allow_ff)
res |= git_config_set_in_file_gently(opts_file,
- "options.allow-ff", "true");
+ "options.allow-ff", NULL, "true");
if (opts->mainline) {
struct strbuf buf = STRBUF_INIT;
strbuf_addf(&buf, "%d", opts->mainline);
res |= git_config_set_in_file_gently(opts_file,
- "options.mainline", buf.buf);
+ "options.mainline", NULL, buf.buf);
strbuf_release(&buf);
}
if (opts->strategy)
res |= git_config_set_in_file_gently(opts_file,
- "options.strategy", opts->strategy);
+ "options.strategy", NULL, opts->strategy);
if (opts->gpg_sign)
res |= git_config_set_in_file_gently(opts_file,
- "options.gpg-sign", opts->gpg_sign);
- if (opts->xopts) {
- int i;
- for (i = 0; i < opts->xopts_nr; i++)
- res |= git_config_set_multivar_in_file_gently(opts_file,
- "options.strategy-option",
- opts->xopts[i], "^$", 0);
- }
+ "options.gpg-sign", NULL, opts->gpg_sign);
+ for (size_t i = 0; i < opts->xopts.nr; i++)
+ res |= git_config_set_multivar_in_file_gently(opts_file,
+ "options.strategy-option",
+ opts->xopts.v[i], "^$", NULL, 0);
if (opts->allow_rerere_auto)
res |= git_config_set_in_file_gently(opts_file,
- "options.allow-rerere-auto",
+ "options.allow-rerere-auto", NULL,
opts->allow_rerere_auto == RERERE_AUTOUPDATE ?
"true" : "false");
if (opts->explicit_cleanup)
res |= git_config_set_in_file_gently(opts_file,
- "options.default-msg-cleanup",
+ "options.default-msg-cleanup", NULL,
describe_cleanup_mode(opts->default_msg_cleanup));
return res;
}
@@ -3400,18 +3545,19 @@ static int make_patch(struct repository *r,
struct commit *commit,
struct replay_opts *opts)
{
- struct strbuf buf = STRBUF_INIT;
struct rev_info log_tree_opt;
const char *subject;
char hex[GIT_MAX_HEXSZ + 1];
int res = 0;
+ if (!is_rebase_i(opts))
+ BUG("make_patch should only be called when rebasing");
+
oid_to_hex_r(hex, &commit->object.oid);
if (write_message(hex, strlen(hex), rebase_path_stopped_sha(), 1) < 0)
return -1;
res |= write_rebase_head(&commit->object.oid);
- strbuf_addf(&buf, "%s/patch", get_dir(opts));
memset(&log_tree_opt, 0, sizeof(log_tree_opt));
repo_init_revisions(r, &log_tree_opt, NULL);
log_tree_opt.abbrev = 0;
@@ -3419,25 +3565,26 @@ static int make_patch(struct repository *r,
log_tree_opt.diffopt.output_format = DIFF_FORMAT_PATCH;
log_tree_opt.disable_stdin = 1;
log_tree_opt.no_commit_id = 1;
- log_tree_opt.diffopt.file = fopen(buf.buf, "w");
+ log_tree_opt.diffopt.file = fopen(rebase_path_patch(), "w");
log_tree_opt.diffopt.use_color = GIT_COLOR_NEVER;
if (!log_tree_opt.diffopt.file)
- res |= error_errno(_("could not open '%s'"), buf.buf);
+ res |= error_errno(_("could not open '%s'"),
+ rebase_path_patch());
else {
res |= log_tree_commit(&log_tree_opt, commit);
fclose(log_tree_opt.diffopt.file);
}
- strbuf_reset(&buf);
- strbuf_addf(&buf, "%s/message", get_dir(opts));
- if (!file_exists(buf.buf)) {
+ if (!file_exists(rebase_path_message())) {
const char *encoding = get_commit_output_encoding();
- const char *commit_buffer = logmsg_reencode(commit, NULL, encoding);
+ const char *commit_buffer = repo_logmsg_reencode(r,
+ commit, NULL,
+ encoding);
find_commit_subject(commit_buffer, &subject);
- res |= write_message(subject, strlen(subject), buf.buf, 1);
- unuse_commit_buffer(commit, commit_buffer);
+ res |= write_message(subject, strlen(subject), rebase_path_message(), 1);
+ repo_unuse_commit_buffer(r, commit,
+ commit_buffer);
}
- strbuf_release(&buf);
release_revisions(&log_tree_opt);
return res;
@@ -3448,7 +3595,7 @@ static int intend_to_amend(void)
struct object_id head;
char *p;
- if (get_oid("HEAD", &head))
+ if (repo_get_oid(the_repository, "HEAD", &head))
return error(_("cannot read HEAD"));
p = oid_to_hex(&head);
@@ -3485,7 +3632,7 @@ static int error_with_patch(struct repository *r,
} else if (exit_code) {
if (commit)
fprintf_ln(stderr, _("Could not apply %s... %.*s"),
- short_commit_name(commit), subject_len, subject);
+ short_commit_name(r, commit), subject_len, subject);
else
/*
* We don't have the hash of the parent so
@@ -3517,15 +3664,18 @@ static int error_failed_squash(struct repository *r,
static int do_exec(struct repository *r, const char *command_line)
{
- const char *child_argv[] = { NULL, NULL };
+ struct child_process cmd = CHILD_PROCESS_INIT;
int dirty, status;
fprintf(stderr, _("Executing: %s\n"), command_line);
- child_argv[0] = command_line;
- status = run_command_v_opt(child_argv, RUN_USING_SHELL);
+ cmd.use_shell = 1;
+ strvec_push(&cmd.args, command_line);
+ strvec_push(&cmd.env, "GIT_CHERRY_PICK_HELP");
+ status = run_command(&cmd);
/* force re-reading of the cache */
- if (discard_index(r->index) < 0 || repo_read_index(r) < 0)
+ discard_index(r->index);
+ if (repo_read_index(r) < 0)
return error(_("could not read index"));
dirty = require_clean_work_tree(r, "rebase", NULL, 1, 1);
@@ -3537,14 +3687,14 @@ static int do_exec(struct repository *r, const char *command_line)
" git rebase --continue\n"
"\n"),
command_line,
- dirty ? N_("and made changes to the index and/or the "
- "working tree\n") : "");
+ dirty ? _("and made changes to the index and/or the "
+ "working tree.\n") : "");
if (status == 127)
/* command not found */
status = 1;
} else if (dirty) {
warning(_("execution succeeded: %s\nbut "
- "left changes to the index and/or the working tree\n"
+ "left changes to the index and/or the working tree.\n"
"Commit or stash your changes, and then run\n"
"\n"
" git rebase --continue\n"
@@ -3585,7 +3735,6 @@ static int safe_append(const char *filename, const char *fmt, ...)
}
if (commit_lock_file(&lock) < 0) {
strbuf_release(&buf);
- rollback_lock_file(&lock);
return error(_("failed to finalize '%s'"), filename);
}
@@ -3612,7 +3761,7 @@ static int do_label(struct repository *r, const char *name, int len)
if (!transaction) {
error("%s", err.buf);
ret = -1;
- } else if (get_oid("HEAD", &head_oid)) {
+ } else if (repo_get_oid(r, "HEAD", &head_oid)) {
error(_("could not read HEAD"));
ret = -1;
} else if (ref_transaction_update(transaction, ref_name.buf, &head_oid,
@@ -3633,17 +3782,28 @@ static int do_label(struct repository *r, const char *name, int len)
return ret;
}
+static const char *sequencer_reflog_action(struct replay_opts *opts)
+{
+ if (!opts->reflog_action) {
+ opts->reflog_action = getenv(GIT_REFLOG_ACTION);
+ opts->reflog_action =
+ xstrdup(opts->reflog_action ? opts->reflog_action
+ : action_name(opts));
+ }
+
+ return opts->reflog_action;
+}
+
__attribute__((format (printf, 3, 4)))
static const char *reflog_message(struct replay_opts *opts,
const char *sub_action, const char *fmt, ...)
{
va_list ap;
static struct strbuf buf = STRBUF_INIT;
- char *reflog_action = getenv(GIT_REFLOG_ACTION);
va_start(ap, fmt);
strbuf_reset(&buf);
- strbuf_addstr(&buf, reflog_action ? reflog_action : action_name(opts));
+ strbuf_addstr(&buf, sequencer_reflog_action(opts));
if (sub_action)
strbuf_addf(&buf, " (%s)", sub_action);
if (fmt) {
@@ -3655,6 +3815,28 @@ static const char *reflog_message(struct replay_opts *opts,
return buf.buf;
}
+static struct commit *lookup_label(struct repository *r, const char *label,
+ int len, struct strbuf *buf)
+{
+ struct commit *commit;
+ struct object_id oid;
+
+ strbuf_reset(buf);
+ strbuf_addf(buf, "refs/rewritten/%.*s", len, label);
+ if (!read_ref(buf->buf, &oid)) {
+ commit = lookup_commit_object(r, &oid);
+ } else {
+ /* fall back to non-rewritten ref or commit */
+ strbuf_splice(buf, 0, strlen("refs/rewritten/"), "", 0);
+ commit = lookup_commit_reference_by_name(buf->buf);
+ }
+
+ if (!commit)
+ error(_("could not resolve '%s'"), buf->buf);
+
+ return commit;
+}
+
static int do_reset(struct repository *r,
const char *name, int len,
struct replay_opts *opts)
@@ -3686,6 +3868,7 @@ static int do_reset(struct repository *r,
oidcpy(&oid, &opts->squash_onto);
} else {
int i;
+ struct commit *commit;
/* Determine the length of the label */
for (i = 0; i < len; i++)
@@ -3693,12 +3876,12 @@ static int do_reset(struct repository *r,
break;
len = i;
- strbuf_addf(&ref_name, "refs/rewritten/%.*s", len, name);
- if (get_oid(ref_name.buf, &oid) &&
- get_oid(ref_name.buf + strlen("refs/rewritten/"), &oid)) {
- ret = error(_("could not read '%s'"), ref_name.buf);
+ commit = lookup_label(r, name, len, &ref_name);
+ if (!commit) {
+ ret = -1;
goto cleanup;
}
+ oid = commit->object.oid;
}
setup_unpack_trees_porcelain(&unpack_tree_opts, "reset");
@@ -3709,10 +3892,11 @@ static int do_reset(struct repository *r,
unpack_tree_opts.merge = 1;
unpack_tree_opts.update = 1;
unpack_tree_opts.preserve_ignored = 0; /* FIXME: !overwrite_ignore */
+ unpack_tree_opts.skip_cache_tree_update = 1;
init_checkout_metadata(&unpack_tree_opts.meta, name, &oid, NULL);
if (repo_read_index_unmerged(r)) {
- ret = error_resolve_conflict(_(action_name(opts)));
+ ret = error_resolve_conflict(action_name(opts));
goto cleanup;
}
@@ -3727,6 +3911,8 @@ static int do_reset(struct repository *r,
}
tree = parse_tree_indirect(&oid);
+ if (!tree)
+ return error(_("unable to read tree (%s)"), oid_to_hex(&oid));
prime_cache_tree(r, r->index, tree);
if (write_locked_index(r->index, &lock, COMMIT_LOCK) < 0)
@@ -3745,26 +3931,6 @@ cleanup:
return ret;
}
-static struct commit *lookup_label(const char *label, int len,
- struct strbuf *buf)
-{
- struct commit *commit;
-
- strbuf_reset(buf);
- strbuf_addf(buf, "refs/rewritten/%.*s", len, label);
- commit = lookup_commit_reference_by_name(buf->buf);
- if (!commit) {
- /* fall back to non-rewritten ref or commit */
- strbuf_splice(buf, 0, strlen("refs/rewritten/"), "", 0);
- commit = lookup_commit_reference_by_name(buf->buf);
- }
-
- if (!commit)
- error(_("could not resolve '%s'"), buf->buf);
-
- return commit;
-}
-
static int do_merge(struct repository *r,
struct commit *commit,
const char *arg, int arg_len,
@@ -3773,9 +3939,9 @@ static int do_merge(struct repository *r,
int run_commit_flags = 0;
struct strbuf ref_name = STRBUF_INIT;
struct commit *head_commit, *merge_commit, *i;
- struct commit_list *bases, *j;
+ struct commit_list *bases = NULL, *j;
struct commit_list *to_merge = NULL, **tail = &to_merge;
- const char *strategy = !opts->xopts_nr &&
+ const char *strategy = !opts->xopts.nr &&
(!opts->strategy ||
!strcmp(opts->strategy, "recursive") ||
!strcmp(opts->strategy, "ort")) ?
@@ -3812,7 +3978,7 @@ static int do_merge(struct repository *r,
k = strcspn(p, " \t\n");
if (!k)
continue;
- merge_commit = lookup_label(p, k, &ref_name);
+ merge_commit = lookup_label(r, p, k, &ref_name);
if (!merge_commit) {
ret = error(_("unable to parse '%.*s'"), k, p);
goto leave_merge;
@@ -3885,7 +4051,8 @@ static int do_merge(struct repository *r,
if (commit) {
const char *encoding = get_commit_output_encoding();
- const char *message = logmsg_reencode(commit, NULL, encoding);
+ const char *message = repo_logmsg_reencode(r, commit, NULL,
+ encoding);
const char *body;
int len;
@@ -3898,7 +4065,7 @@ static int do_merge(struct repository *r,
find_commit_subject(message, &body);
len = strlen(body);
ret = write_message(body, len, git_path_merge_msg(r), 0);
- unuse_commit_buffer(commit, message);
+ repo_unuse_commit_buffer(r, commit, message);
if (ret) {
error_errno(_("could not write '%s'"),
git_path_merge_msg(r));
@@ -3958,9 +4125,9 @@ static int do_merge(struct repository *r,
strvec_push(&cmd.args, "octopus");
else {
strvec_push(&cmd.args, strategy);
- for (k = 0; k < opts->xopts_nr; k++)
+ for (k = 0; k < opts->xopts.nr; k++)
strvec_pushf(&cmd.args,
- "-X%s", opts->xopts[k]);
+ "-X%s", opts->xopts.v[k]);
}
if (!(flags & TODO_EDIT_MERGE_MSG))
strvec_push(&cmd.args, "--no-edit");
@@ -3983,20 +4150,26 @@ static int do_merge(struct repository *r,
strbuf_release(&ref_name);
refs_delete_ref(get_main_ref_store(r), "", "CHERRY_PICK_HEAD",
- NULL, 0);
+ NULL, REF_NO_DEREF);
rollback_lock_file(&lock);
ret = run_command(&cmd);
/* force re-reading of the cache */
- if (!ret && (discard_index(r->index) < 0 ||
- repo_read_index(r) < 0))
- ret = error(_("could not read index"));
+ if (!ret) {
+ discard_index(r->index);
+ if (repo_read_index(r) < 0)
+ ret = error(_("could not read index"));
+ }
goto leave_merge;
}
merge_commit = to_merge->item;
- bases = get_merge_bases(head_commit, merge_commit);
+ if (repo_get_merge_bases(r, head_commit, merge_commit, &bases) < 0) {
+ ret = -1;
+ goto leave_merge;
+ }
+
if (bases && oideq(&merge_commit->object.oid,
&bases->item->object.oid)) {
ret = 0;
@@ -4036,6 +4209,7 @@ static int do_merge(struct repository *r,
if (ret < 0) {
error(_("could not even attempt to merge '%.*s'"),
merge_arg_len, arg);
+ unlink(git_path_merge_msg(r));
goto leave_merge;
}
/*
@@ -4081,6 +4255,224 @@ leave_merge:
return ret;
}
+static int write_update_refs_state(struct string_list *refs_to_oids)
+{
+ int result = 0;
+ struct lock_file lock = LOCK_INIT;
+ FILE *fp = NULL;
+ struct string_list_item *item;
+ char *path;
+
+ path = rebase_path_update_refs(the_repository->gitdir);
+
+ if (!refs_to_oids->nr) {
+ if (unlink(path) && errno != ENOENT)
+ result = error_errno(_("could not unlink: %s"), path);
+ goto cleanup;
+ }
+
+ if (safe_create_leading_directories(path)) {
+ result = error(_("unable to create leading directories of %s"),
+ path);
+ goto cleanup;
+ }
+
+ if (hold_lock_file_for_update(&lock, path, 0) < 0) {
+ result = error(_("another 'rebase' process appears to be running; "
+ "'%s.lock' already exists"),
+ path);
+ goto cleanup;
+ }
+
+ fp = fdopen_lock_file(&lock, "w");
+ if (!fp) {
+ result = error_errno(_("could not open '%s' for writing"), path);
+ rollback_lock_file(&lock);
+ goto cleanup;
+ }
+
+ for_each_string_list_item(item, refs_to_oids) {
+ struct update_ref_record *rec = item->util;
+ fprintf(fp, "%s\n%s\n%s\n", item->string,
+ oid_to_hex(&rec->before), oid_to_hex(&rec->after));
+ }
+
+ result = commit_lock_file(&lock);
+
+cleanup:
+ free(path);
+ return result;
+}
+
+/*
+ * Parse the update-refs file for the current rebase, then remove the
+ * refs that do not appear in the todo_list (and have not had updated
+ * values stored) and add refs that are in the todo_list but not
+ * represented in the update-refs file.
+ *
+ * If there are changes to the update-refs list, then write the new state
+ * to disk.
+ */
+void todo_list_filter_update_refs(struct repository *r,
+ struct todo_list *todo_list)
+{
+ int i;
+ int updated = 0;
+ struct string_list update_refs = STRING_LIST_INIT_DUP;
+
+ sequencer_get_update_refs_state(r->gitdir, &update_refs);
+
+ /*
+ * For each item in the update_refs list, if it has no updated
+ * value and does not appear in the todo_list, then remove it
+ * from the update_refs list.
+ */
+ for (i = 0; i < update_refs.nr; i++) {
+ int j;
+ int found = 0;
+ const char *ref = update_refs.items[i].string;
+ size_t reflen = strlen(ref);
+ struct update_ref_record *rec = update_refs.items[i].util;
+
+ /* OID already stored as updated. */
+ if (!is_null_oid(&rec->after))
+ continue;
+
+ for (j = 0; !found && j < todo_list->nr; j++) {
+ struct todo_item *item = &todo_list->items[j];
+ const char *arg = todo_list->buf.buf + item->arg_offset;
+
+ if (item->command != TODO_UPDATE_REF)
+ continue;
+
+ if (item->arg_len != reflen ||
+ strncmp(arg, ref, reflen))
+ continue;
+
+ found = 1;
+ }
+
+ if (!found) {
+ free(update_refs.items[i].string);
+ free(update_refs.items[i].util);
+
+ update_refs.nr--;
+ MOVE_ARRAY(update_refs.items + i, update_refs.items + i + 1, update_refs.nr - i);
+
+ updated = 1;
+ i--;
+ }
+ }
+
+ /*
+ * For each todo_item, check if its ref is in the update_refs list.
+ * If not, then add it as an un-updated ref.
+ */
+ for (i = 0; i < todo_list->nr; i++) {
+ struct todo_item *item = &todo_list->items[i];
+ const char *arg = todo_list->buf.buf + item->arg_offset;
+ int j, found = 0;
+
+ if (item->command != TODO_UPDATE_REF)
+ continue;
+
+ for (j = 0; !found && j < update_refs.nr; j++) {
+ const char *ref = update_refs.items[j].string;
+
+ found = strlen(ref) == item->arg_len &&
+ !strncmp(ref, arg, item->arg_len);
+ }
+
+ if (!found) {
+ struct string_list_item *inserted;
+ struct strbuf argref = STRBUF_INIT;
+
+ strbuf_add(&argref, arg, item->arg_len);
+ inserted = string_list_insert(&update_refs, argref.buf);
+ inserted->util = init_update_ref_record(argref.buf);
+ strbuf_release(&argref);
+ updated = 1;
+ }
+ }
+
+ if (updated)
+ write_update_refs_state(&update_refs);
+ string_list_clear(&update_refs, 1);
+}
+
+static int do_update_ref(struct repository *r, const char *refname)
+{
+ struct string_list_item *item;
+ struct string_list list = STRING_LIST_INIT_DUP;
+
+ if (sequencer_get_update_refs_state(r->gitdir, &list))
+ return -1;
+
+ for_each_string_list_item(item, &list) {
+ if (!strcmp(item->string, refname)) {
+ struct update_ref_record *rec = item->util;
+ if (read_ref("HEAD", &rec->after))
+ return -1;
+ break;
+ }
+ }
+
+ write_update_refs_state(&list);
+ string_list_clear(&list, 1);
+ return 0;
+}
+
+static int do_update_refs(struct repository *r, int quiet)
+{
+ int res = 0;
+ struct string_list_item *item;
+ struct string_list refs_to_oids = STRING_LIST_INIT_DUP;
+ struct ref_store *refs = get_main_ref_store(r);
+ struct strbuf update_msg = STRBUF_INIT;
+ struct strbuf error_msg = STRBUF_INIT;
+
+ if ((res = sequencer_get_update_refs_state(r->gitdir, &refs_to_oids)))
+ return res;
+
+ for_each_string_list_item(item, &refs_to_oids) {
+ struct update_ref_record *rec = item->util;
+ int loop_res;
+
+ loop_res = refs_update_ref(refs, "rewritten during rebase",
+ item->string,
+ &rec->after, &rec->before,
+ 0, UPDATE_REFS_MSG_ON_ERR);
+ res |= loop_res;
+
+ if (quiet)
+ continue;
+
+ if (loop_res)
+ strbuf_addf(&error_msg, "\t%s\n", item->string);
+ else
+ strbuf_addf(&update_msg, "\t%s\n", item->string);
+ }
+
+ if (!quiet &&
+ (update_msg.len || error_msg.len)) {
+ fprintf(stderr,
+ _("Updated the following refs with %s:\n%s"),
+ "--update-refs",
+ update_msg.buf);
+
+ if (res)
+ fprintf(stderr,
+ _("Failed to update the following refs with %s:\n%s"),
+ "--update-refs",
+ error_msg.buf);
+ }
+
+ string_list_clear(&refs_to_oids, 1);
+ strbuf_release(&update_msg);
+ strbuf_release(&error_msg);
+ return res;
+}
+
static int is_final_fixup(struct todo_list *todo_list)
{
int i = todo_list->current;
@@ -4107,12 +4499,17 @@ static enum todo_command peek_command(struct todo_list *todo_list, int offset)
return -1;
}
-void create_autostash(struct repository *r, const char *path)
+static void create_autostash_internal(struct repository *r,
+ const char *path,
+ const char *refname)
{
struct strbuf buf = STRBUF_INIT;
struct lock_file lock_file = LOCK_INIT;
int fd;
+ if (path && refname)
+ BUG("can only pass path or refname");
+
fd = repo_hold_locked_index(r, &lock_file, 0);
refresh_index(r->index, REFRESH_QUIET, NULL, NULL, NULL);
if (0 <= fd)
@@ -4133,26 +4530,42 @@ void create_autostash(struct repository *r, const char *path)
if (capture_command(&stash, &buf, GIT_MAX_HEXSZ))
die(_("Cannot autostash"));
strbuf_trim_trailing_newline(&buf);
- if (get_oid(buf.buf, &oid))
+ if (repo_get_oid(r, buf.buf, &oid))
die(_("Unexpected stash response: '%s'"),
buf.buf);
strbuf_reset(&buf);
strbuf_add_unique_abbrev(&buf, &oid, DEFAULT_ABBREV);
- if (safe_create_leading_directories_const(path))
- die(_("Could not create directory for '%s'"),
- path);
- write_file(path, "%s", oid_to_hex(&oid));
+ if (path) {
+ if (safe_create_leading_directories_const(path))
+ die(_("Could not create directory for '%s'"),
+ path);
+ write_file(path, "%s", oid_to_hex(&oid));
+ } else {
+ refs_update_ref(get_main_ref_store(r), "", refname,
+ &oid, null_oid(), 0, UPDATE_REFS_DIE_ON_ERR);
+ }
+
printf(_("Created autostash: %s\n"), buf.buf);
if (reset_head(r, &ropts) < 0)
die(_("could not reset --hard"));
- if (discard_index(r->index) < 0 ||
- repo_read_index(r) < 0)
+ discard_index(r->index);
+ if (repo_read_index(r) < 0)
die(_("could not read index"));
}
strbuf_release(&buf);
}
+void create_autostash(struct repository *r, const char *path)
+{
+ create_autostash_internal(r, path, NULL);
+}
+
+void create_autostash_ref(struct repository *r, const char *refname)
+{
+ create_autostash_internal(r, NULL, refname);
+}
+
static int apply_save_autostash_oid(const char *stash_oid, int attempt_apply)
{
struct child_process child = CHILD_PROCESS_INIT;
@@ -4230,6 +4643,41 @@ int apply_autostash_oid(const char *stash_oid)
return apply_save_autostash_oid(stash_oid, 1);
}
+static int apply_save_autostash_ref(struct repository *r, const char *refname,
+ int attempt_apply)
+{
+ struct object_id stash_oid;
+ char stash_oid_hex[GIT_MAX_HEXSZ + 1];
+ int flag, ret;
+
+ if (!refs_ref_exists(get_main_ref_store(r), refname))
+ return 0;
+
+ if (!refs_resolve_ref_unsafe(get_main_ref_store(r), refname,
+ RESOLVE_REF_READING, &stash_oid, &flag))
+ return -1;
+ if (flag & REF_ISSYMREF)
+ return error(_("autostash reference is a symref"));
+
+ oid_to_hex_r(stash_oid_hex, &stash_oid);
+ ret = apply_save_autostash_oid(stash_oid_hex, attempt_apply);
+
+ refs_delete_ref(get_main_ref_store(r), "", refname,
+ &stash_oid, REF_NO_DEREF);
+
+ return ret;
+}
+
+int save_autostash_ref(struct repository *r, const char *refname)
+{
+ return apply_save_autostash_ref(r, refname, 0);
+}
+
+int apply_autostash_ref(struct repository *r, const char *refname)
+{
+ return apply_save_autostash_ref(r, refname, 1);
+}
+
static int checkout_onto(struct repository *r, struct replay_opts *opts,
const char *onto_name, const struct object_id *onto,
const struct object_id *orig_head)
@@ -4241,7 +4689,7 @@ static int checkout_onto(struct repository *r, struct replay_opts *opts,
RESET_HEAD_RUN_POST_CHECKOUT_HOOK,
.head_msg = reflog_message(opts, "start", "checkout %s",
onto_name),
- .default_reflog_action = "rebase"
+ .default_reflog_action = sequencer_reflog_action(opts)
};
if (reset_head(r, &ropts)) {
apply_autostash(rebase_path_autostash());
@@ -4258,9 +4706,9 @@ static int stopped_at_head(struct repository *r)
struct commit *commit;
struct commit_message message;
- if (get_oid("HEAD", &head) ||
+ if (repo_get_oid(r, "HEAD", &head) ||
!(commit = lookup_commit(r, &head)) ||
- parse_commit(commit) || get_message(commit, &message))
+ repo_parse_commit(r, commit) || get_message(commit, &message))
fprintf(stderr, _("Stopped at HEAD\n"));
else {
fprintf(stderr, _("Stopped at %s\n"), message.label);
@@ -4305,16 +4753,75 @@ N_("Could not execute the todo command\n"
" git rebase --edit-todo\n"
" git rebase --continue\n");
+static int pick_one_commit(struct repository *r,
+ struct todo_list *todo_list,
+ struct replay_opts *opts,
+ int *check_todo, int* reschedule)
+{
+ int res;
+ struct todo_item *item = todo_list->items + todo_list->current;
+ const char *arg = todo_item_get_arg(todo_list, item);
+ if (is_rebase_i(opts))
+ opts->reflog_message = reflog_message(
+ opts, command_to_string(item->command), NULL);
+
+ res = do_pick_commit(r, item, opts, is_final_fixup(todo_list),
+ check_todo);
+ if (is_rebase_i(opts) && res < 0) {
+ /* Reschedule */
+ *reschedule = 1;
+ return -1;
+ }
+ if (item->command == TODO_EDIT) {
+ struct commit *commit = item->commit;
+ if (!res) {
+ if (!opts->verbose)
+ term_clear_line();
+ fprintf(stderr, _("Stopped at %s... %.*s\n"),
+ short_commit_name(r, commit), item->arg_len, arg);
+ }
+ return error_with_patch(r, commit,
+ arg, item->arg_len, opts, res, !res);
+ }
+ if (is_rebase_i(opts) && !res)
+ record_in_rewritten(&item->commit->object.oid,
+ peek_command(todo_list, 1));
+ if (res && is_fixup(item->command)) {
+ if (res == 1)
+ intend_to_amend();
+ return error_failed_squash(r, item->commit, opts,
+ item->arg_len, arg);
+ } else if (res && is_rebase_i(opts) && item->commit) {
+ int to_amend = 0;
+ struct object_id oid;
+
+ /*
+ * If we are rewording and have either
+ * fast-forwarded already, or are about to
+ * create a new root commit, we want to amend,
+ * otherwise we do not.
+ */
+ if (item->command == TODO_REWORD &&
+ !repo_get_oid(r, "HEAD", &oid) &&
+ (oideq(&item->commit->object.oid, &oid) ||
+ (opts->have_squash_onto &&
+ oideq(&opts->squash_onto, &oid))))
+ to_amend = 1;
+
+ return res | error_with_patch(r, item->commit,
+ arg, item->arg_len, opts,
+ res, to_amend);
+ }
+ return res;
+}
+
static int pick_commits(struct repository *r,
struct todo_list *todo_list,
struct replay_opts *opts)
{
int res = 0, reschedule = 0;
- char *prev_reflog_action;
- /* Note that 0 for 3rd parameter of setenv means set only if not set */
- setenv(GIT_REFLOG_ACTION, action_name(opts), 0);
- prev_reflog_action = xstrdup(getenv(GIT_REFLOG_ACTION));
+ opts->reflog_message = sequencer_reflog_action(opts);
if (opts->allow_ff)
assert(!(opts->signoff || opts->no_commit ||
opts->record_origin || should_edit(opts) ||
@@ -4323,12 +4830,17 @@ static int pick_commits(struct repository *r,
if (read_and_refresh_cache(r, opts))
return -1;
+ unlink(rebase_path_message());
+ unlink(rebase_path_stopped_sha());
+ unlink(rebase_path_amend());
+ unlink(rebase_path_patch());
+
while (todo_list->current < todo_list->nr) {
struct todo_item *item = todo_list->items + todo_list->current;
const char *arg = todo_item_get_arg(todo_list, item);
int check_todo = 0;
- if (save_todo(todo_list, opts))
+ if (save_todo(todo_list, opts, reschedule))
return -1;
if (is_rebase_i(opts)) {
if (item->command != TODO_COMMENT) {
@@ -4346,13 +4858,12 @@ static int pick_commits(struct repository *r,
todo_list->total_nr,
opts->verbose ? "\n" : "\r");
}
- unlink(rebase_path_message());
unlink(rebase_path_author_script());
- unlink(rebase_path_stopped_sha());
- unlink(rebase_path_amend());
unlink(git_path_merge_head(r));
- unlink(git_path_auto_merge(r));
- delete_ref(NULL, "REBASE_HEAD", NULL, REF_NO_DEREF);
+ refs_delete_ref(get_main_ref_store(r), "", "AUTO_MERGE",
+ NULL, REF_NO_DEREF);
+ refs_delete_ref(get_main_ref_store(r), "", "REBASE_HEAD",
+ NULL, REF_NO_DEREF);
if (item->command == TODO_BREAK) {
if (!opts->verbose)
@@ -4361,68 +4872,10 @@ static int pick_commits(struct repository *r,
}
}
if (item->command <= TODO_SQUASH) {
- if (is_rebase_i(opts))
- setenv(GIT_REFLOG_ACTION, reflog_message(opts,
- command_to_string(item->command), NULL),
- 1);
- res = do_pick_commit(r, item, opts,
- is_final_fixup(todo_list),
- &check_todo);
- if (is_rebase_i(opts))
- setenv(GIT_REFLOG_ACTION, prev_reflog_action, 1);
- if (is_rebase_i(opts) && res < 0) {
- /* Reschedule */
- advise(_(rescheduled_advice),
- get_item_line_length(todo_list,
- todo_list->current),
- get_item_line(todo_list,
- todo_list->current));
- todo_list->current--;
- if (save_todo(todo_list, opts))
- return -1;
- }
- if (item->command == TODO_EDIT) {
- struct commit *commit = item->commit;
- if (!res) {
- if (!opts->verbose)
- term_clear_line();
- fprintf(stderr,
- _("Stopped at %s... %.*s\n"),
- short_commit_name(commit),
- item->arg_len, arg);
- }
- return error_with_patch(r, commit,
- arg, item->arg_len, opts, res, !res);
- }
- if (is_rebase_i(opts) && !res)
- record_in_rewritten(&item->commit->object.oid,
- peek_command(todo_list, 1));
- if (res && is_fixup(item->command)) {
- if (res == 1)
- intend_to_amend();
- return error_failed_squash(r, item->commit, opts,
- item->arg_len, arg);
- } else if (res && is_rebase_i(opts) && item->commit) {
- int to_amend = 0;
- struct object_id oid;
-
- /*
- * If we are rewording and have either
- * fast-forwarded already, or are about to
- * create a new root commit, we want to amend,
- * otherwise we do not.
- */
- if (item->command == TODO_REWORD &&
- !get_oid("HEAD", &oid) &&
- (oideq(&item->commit->object.oid, &oid) ||
- (opts->have_squash_onto &&
- oideq(&opts->squash_onto, &oid))))
- to_amend = 1;
-
- return res | error_with_patch(r, item->commit,
- arg, item->arg_len, opts,
- res, to_amend);
- }
+ res = pick_one_commit(r, todo_list, opts, &check_todo,
+ &reschedule);
+ if (!res && item->command == TODO_EDIT)
+ return 0;
} else if (item->command == TODO_EXEC) {
char *end_of_arg = (char *)(arg + item->arg_len);
int saved = *end_of_arg;
@@ -4456,6 +4909,12 @@ static int pick_commits(struct repository *r,
return error_with_patch(r, item->commit,
arg, item->arg_len,
opts, res, 0);
+ } else if (item->command == TODO_UPDATE_REF) {
+ struct strbuf ref = STRBUF_INIT;
+ strbuf_add(&ref, arg, item->arg_len);
+ if ((res = do_update_ref(r, ref.buf)))
+ reschedule = 1;
+ strbuf_release(&ref);
} else if (!is_noop(item->command))
return error(_("unknown command %d"), item->command);
@@ -4464,39 +4923,32 @@ static int pick_commits(struct repository *r,
get_item_line_length(todo_list,
todo_list->current),
get_item_line(todo_list, todo_list->current));
- todo_list->current--;
- if (save_todo(todo_list, opts))
+ if (save_todo(todo_list, opts, reschedule))
return -1;
if (item->commit)
- return error_with_patch(r,
- item->commit,
- arg, item->arg_len,
- opts, res, 0);
+ write_rebase_head(&item->commit->object.oid);
} else if (is_rebase_i(opts) && check_todo && !res &&
reread_todo_if_changed(r, todo_list, opts)) {
return -1;
}
- todo_list->current++;
if (res)
return res;
+
+ todo_list->current++;
}
if (is_rebase_i(opts)) {
struct strbuf head_ref = STRBUF_INIT, buf = STRBUF_INIT;
struct stat st;
- /* Stopped in the middle, as planned? */
- if (todo_list->current < todo_list->nr)
- return 0;
-
if (read_oneliner(&head_ref, rebase_path_head_name(), 0) &&
starts_with(head_ref.buf, "refs/")) {
const char *msg;
struct object_id head, orig;
int res;
- if (get_oid("HEAD", &head)) {
+ if (repo_get_oid(r, "HEAD", &head)) {
res = error(_("cannot read HEAD"));
cleanup_head_ref:
strbuf_release(&head_ref);
@@ -4543,8 +4995,8 @@ cleanup_head_ref:
log_tree_opt.disable_stdin = 1;
if (read_oneliner(&buf, rebase_path_orig_head(), 0) &&
- !get_oid(buf.buf, &orig) &&
- !get_oid("HEAD", &head)) {
+ !repo_get_oid(r, buf.buf, &orig) &&
+ !repo_get_oid(r, "HEAD", &head)) {
diff_tree_oid(&orig, &head, "",
&log_tree_opt.diffopt);
log_tree_diff_flush(&log_tree_opt);
@@ -4555,8 +5007,7 @@ cleanup_head_ref:
if (!stat(rebase_path_rewritten_list(), &st) &&
st.st_size > 0) {
struct child_process child = CHILD_PROCESS_INIT;
- const char *post_rewrite_hook =
- find_hook("post-rewrite");
+ struct run_hooks_opt hook_opt = RUN_HOOKS_OPT_INIT;
child.in = open(rebase_path_rewritten_list(), O_RDONLY);
child.git_cmd = 1;
@@ -4566,18 +5017,9 @@ cleanup_head_ref:
/* we don't care if this copying failed */
run_command(&child);
- if (post_rewrite_hook) {
- struct child_process hook = CHILD_PROCESS_INIT;
-
- hook.in = open(rebase_path_rewritten_list(),
- O_RDONLY);
- hook.stdout_to_stderr = 1;
- hook.trace2_hook_name = "post-rewrite";
- strvec_push(&hook.args, post_rewrite_hook);
- strvec_push(&hook.args, "rebase");
- /* we don't care if this hook failed */
- run_command(&hook);
- }
+ hook_opt.path_to_stdin = rebase_path_rewritten_list();
+ strvec_push(&hook_opt.args, "rebase");
+ run_hooks_opt("post-rewrite", &hook_opt);
}
apply_autostash(rebase_path_autostash());
@@ -4591,6 +5033,9 @@ cleanup_head_ref:
strbuf_release(&buf);
strbuf_release(&head_ref);
+
+ if (do_update_refs(r, opts->quiet))
+ return -1;
}
/*
@@ -4602,14 +5047,14 @@ cleanup_head_ref:
static int continue_single_pick(struct repository *r, struct replay_opts *opts)
{
- struct strvec argv = STRVEC_INIT;
- int ret;
+ struct child_process cmd = CHILD_PROCESS_INIT;
if (!refs_ref_exists(get_main_ref_store(r), "CHERRY_PICK_HEAD") &&
!refs_ref_exists(get_main_ref_store(r), "REVERT_HEAD"))
return error(_("no cherry-pick or revert in progress"));
- strvec_push(&argv, "commit");
+ cmd.git_cmd = 1;
+ strvec_push(&cmd.args, "commit");
/*
* continue_single_pick() handles the case of recovering from a
@@ -4622,11 +5067,9 @@ static int continue_single_pick(struct repository *r, struct replay_opts *opts)
* Include --cleanup=strip as well because we don't want the
* "# Conflicts:" messages.
*/
- strvec_pushl(&argv, "--no-edit", "--cleanup=strip", NULL);
+ strvec_pushl(&cmd.args, "--no-edit", "--cleanup=strip", NULL);
- ret = run_command_v_opt(argv.v, RUN_GIT_CMD);
- strvec_clear(&argv);
- return ret;
+ return run_command(&cmd);
}
static int commit_staged_changes(struct repository *r,
@@ -4641,11 +5084,16 @@ static int commit_staged_changes(struct repository *r,
is_clean = !has_uncommitted_changes(r, 0);
+ if (!is_clean && !file_exists(rebase_path_message())) {
+ const char *gpg_opt = gpg_sign_opt_quoted(opts);
+
+ return error(_(staged_changes_advice), gpg_opt, gpg_opt);
+ }
if (file_exists(rebase_path_amend())) {
struct strbuf rev = STRBUF_INIT;
struct object_id head, to_amend;
- if (get_oid("HEAD", &head))
+ if (repo_get_oid(r, "HEAD", &head))
return error(_("cannot amend non-existing commit"));
if (!read_oneliner(&rev, rebase_path_amend(), 0))
return error(_("invalid file: '%s'"), rebase_path_amend());
@@ -4720,18 +5168,31 @@ static int commit_staged_changes(struct repository *r,
* We need to update the squash message to skip
* the latest commit message.
*/
+ int res = 0;
struct commit *commit;
+ const char *msg;
const char *path = rebase_path_squash_msg();
const char *encoding = get_commit_output_encoding();
- if (parse_head(r, &commit) ||
- !(p = logmsg_reencode(commit, NULL, encoding)) ||
- write_message(p, strlen(p), path, 0)) {
- unuse_commit_buffer(commit, p);
- return error(_("could not write file: "
+ if (parse_head(r, &commit))
+ return error(_("could not parse HEAD"));
+
+ p = repo_logmsg_reencode(r, commit, NULL, encoding);
+ if (!p) {
+ res = error(_("could not parse commit %s"),
+ oid_to_hex(&commit->object.oid));
+ goto unuse_commit_buffer;
+ }
+ find_commit_subject(p, &msg);
+ if (write_message(msg, strlen(msg), path, 0)) {
+ res = error(_("could not write file: "
"'%s'"), path);
+ goto unuse_commit_buffer;
}
- unuse_commit_buffer(commit, p);
+ unuse_commit_buffer:
+ repo_unuse_commit_buffer(r, commit, p);
+ if (res)
+ return res;
}
}
@@ -4743,7 +5204,7 @@ static int commit_staged_changes(struct repository *r,
if (refs_ref_exists(get_main_ref_store(r),
"CHERRY_PICK_HEAD") &&
refs_delete_ref(get_main_ref_store(r), "",
- "CHERRY_PICK_HEAD", NULL, 0))
+ "CHERRY_PICK_HEAD", NULL, REF_NO_DEREF))
return error(_("could not remove CHERRY_PICK_HEAD"));
if (unlink(git_path_merge_msg(r)) && errno != ENOENT)
return error_errno(_("could not remove '%s'"),
@@ -4757,7 +5218,8 @@ static int commit_staged_changes(struct repository *r,
return error(_("could not commit staged changes."));
unlink(rebase_path_amend());
unlink(git_path_merge_head(r));
- unlink(git_path_auto_merge(r));
+ refs_delete_ref(get_main_ref_store(r), "", "AUTO_MERGE",
+ NULL, REF_NO_DEREF);
if (final_fixup) {
unlink(rebase_path_fixup_msg());
unlink(rebase_path_squash_msg());
@@ -4795,6 +5257,7 @@ int sequencer_continue(struct repository *r, struct replay_opts *opts)
unlink(rebase_path_dropped());
}
+ opts->reflog_message = reflog_message(opts, "continue", NULL);
if (commit_staged_changes(r, opts, &todo_list)) {
res = -1;
goto release_todo_list;
@@ -4846,7 +5309,7 @@ static int single_pick(struct repository *r,
TODO_PICK : TODO_REVERT;
item.commit = cmit;
- setenv(GIT_REFLOG_ACTION, action_name(opts), 0);
+ opts->reflog_message = sequencer_reflog_action(opts);
return do_pick_commit(r, &item, opts, 0, &check_todo);
}
@@ -4869,7 +5332,7 @@ int sequencer_pick_revisions(struct repository *r,
if (!strlen(name))
continue;
- if (!get_oid(name, &oid)) {
+ if (!repo_get_oid(r, name, &oid)) {
if (!lookup_commit_reference_gently(r, &oid, 1)) {
enum object_type type = oid_object_info(r,
&oid,
@@ -4912,7 +5375,7 @@ int sequencer_pick_revisions(struct repository *r,
if (walk_revs_populate_todo(&todo_list, opts) ||
create_seq_dir(r) < 0)
return -1;
- if (get_oid("HEAD", &oid) && (opts->action == REPLAY_REVERT))
+ if (repo_get_oid(r, "HEAD", &oid) && (opts->action == REPLAY_REVERT))
return error(_("can't revert as initial commit"));
if (save_head(oid_to_hex(&oid)))
return -1;
@@ -4989,7 +5452,8 @@ struct labels_entry {
char label[FLEX_ARRAY];
};
-static int labels_cmp(const void *fndata, const struct hashmap_entry *eptr,
+static int labels_cmp(const void *fndata UNUSED,
+ const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key, const void *key)
{
const struct labels_entry *a, *b;
@@ -5009,6 +5473,7 @@ struct label_state {
struct oidmap commit2label;
struct hashmap labels;
struct strbuf buf;
+ int max_label_length;
};
static const char *label_oid(struct object_id *oid, const char *label,
@@ -5027,7 +5492,7 @@ static const char *label_oid(struct object_id *oid, const char *label,
* For "uninteresting" commits, i.e. commits that are not to be
* rebased, and which can therefore not be labeled, we use a unique
* abbreviation of the commit name. This is slightly more complicated
- * than calling find_unique_abbrev() because we also need to make
+ * than calling repo_find_unique_abbrev() because we also need to make
* sure that the abbreviation does not conflict with any other
* label.
*
@@ -5043,7 +5508,8 @@ static const char *label_oid(struct object_id *oid, const char *label,
strbuf_grow(&state->buf, GIT_MAX_HEXSZ);
label = p = state->buf.buf;
- find_unique_abbrev_r(p, oid, default_abbrev);
+ repo_find_unique_abbrev_r(the_repository, p, oid,
+ default_abbrev);
/*
* We may need to extend the abbreviated hash so that there is
@@ -5064,6 +5530,8 @@ static const char *label_oid(struct object_id *oid, const char *label,
}
} else {
struct strbuf *buf = &state->buf;
+ int label_is_utf8 = 1; /* start with this assumption */
+ size_t max_len = buf->len + state->max_label_length;
/*
* Sanitize labels by replacing non-alpha-numeric characters
@@ -5072,14 +5540,34 @@ static const char *label_oid(struct object_id *oid, const char *label,
*
* Note that we retain non-ASCII UTF-8 characters (identified
* via the most significant bit). They should be all acceptable
- * in file names. We do not validate the UTF-8 here, that's not
- * the job of this function.
+ * in file names.
+ *
+ * As we will use the labels as names of (loose) refs, it is
+ * vital that the name not be longer than the maximum component
+ * size of the file system (`NAME_MAX`). We are careful to
+ * truncate the label accordingly, allowing for the `.lock`
+ * suffix and for the label to be UTF-8 encoded (i.e. we avoid
+ * truncating in the middle of a character).
*/
- for (; *label; label++)
- if ((*label & 0x80) || isalnum(*label))
+ for (; *label && buf->len + 1 < max_len; label++)
+ if (isalnum(*label) ||
+ (!label_is_utf8 && (*label & 0x80)))
strbuf_addch(buf, *label);
+ else if (*label & 0x80) {
+ const char *p = label;
+
+ utf8_width(&p, NULL);
+ if (p) {
+ if (buf->len + (p - label) > max_len)
+ break;
+ strbuf_add(buf, label, p - label);
+ label = p - 1;
+ } else {
+ label_is_utf8 = 0;
+ strbuf_addch(buf, *label);
+ }
/* avoid leading dash and double-dashes */
- else if (buf->len && buf->buf[buf->len - 1] != '-')
+ } else if (buf->len && buf->buf[buf->len - 1] != '-')
strbuf_addch(buf, '-');
if (!buf->len) {
strbuf_addstr(buf, "rev-");
@@ -5141,7 +5629,8 @@ static int make_script_with_merges(struct pretty_print_context *pp,
struct string_entry *entry;
struct oidset interesting = OIDSET_INIT, child_seen = OIDSET_INIT,
shown = OIDSET_INIT;
- struct label_state state = { OIDMAP_INIT, { NULL }, STRBUF_INIT };
+ struct label_state state =
+ { OIDMAP_INIT, { NULL }, STRBUF_INIT, GIT_MAX_LABEL_LENGTH };
int abbr = flags & TODO_LIST_ABBREVIATE_CMDS;
const char *cmd_pick = abbr ? "p" : "pick",
@@ -5149,6 +5638,8 @@ static int make_script_with_merges(struct pretty_print_context *pp,
*cmd_reset = abbr ? "t" : "reset",
*cmd_merge = abbr ? "m" : "merge";
+ git_config_get_int("rebase.maxlabellength", &state.max_label_length);
+
oidmap_init(&commit2todo, 0);
oidmap_init(&state.commit2label, 0);
hashmap_init(&state.labels, labels_cmp, NULL, 0);
@@ -5185,7 +5676,7 @@ static int make_script_with_merges(struct pretty_print_context *pp,
if (!is_empty && (commit->object.flags & PATCHSAME)) {
if (flags & TODO_LIST_WARN_SKIPPED_CHERRY_PICKS)
warning(_("skipped previously applied commit %s"),
- short_commit_name(commit));
+ short_commit_name(the_repository, commit));
skipped_commit = 1;
continue;
}
@@ -5203,8 +5694,8 @@ static int make_script_with_merges(struct pretty_print_context *pp,
oid_to_hex(&commit->object.oid),
oneline.buf);
if (is_empty)
- strbuf_addf(&buf, " %c empty",
- comment_line_char);
+ strbuf_addf(&buf, " %s empty",
+ comment_line_str);
FLEX_ALLOC_STR(entry, string, buf.buf);
oidcpy(&entry->entry.oid, &commit->object.oid);
@@ -5294,7 +5785,7 @@ static int make_script_with_merges(struct pretty_print_context *pp,
entry = oidmap_get(&state.commit2label, &commit->object.oid);
if (entry)
- strbuf_addf(out, "\n%c Branch %s\n", comment_line_char, entry->string);
+ strbuf_addf(out, "\n%s Branch %s\n", comment_line_str, entry->string);
else
strbuf_addch(out, '\n');
@@ -5421,7 +5912,7 @@ int sequencer_make_script(struct repository *r, struct strbuf *out, int argc,
if (!is_empty && (commit->object.flags & PATCHSAME)) {
if (flags & TODO_LIST_WARN_SKIPPED_CHERRY_PICKS)
warning(_("skipped previously applied commit %s"),
- short_commit_name(commit));
+ short_commit_name(r, commit));
skipped_commit = 1;
continue;
}
@@ -5431,7 +5922,7 @@ int sequencer_make_script(struct repository *r, struct strbuf *out, int argc,
oid_to_hex(&commit->object.oid));
pretty_print_commit(&pp, commit, out);
if (is_empty)
- strbuf_addf(out, " %c empty", comment_line_char);
+ strbuf_addf(out, " %s empty", comment_line_str);
strbuf_addch(out, '\n');
}
if (skipped_commit)
@@ -5463,8 +5954,8 @@ static void todo_list_add_exec_commands(struct todo_list *todo_list,
base_items[i].command = TODO_EXEC;
base_items[i].offset_in_buf = base_offset;
- base_items[i].arg_offset = base_offset + strlen("exec ");
- base_items[i].arg_len = command_len - strlen("exec ");
+ base_items[i].arg_offset = base_offset;
+ base_items[i].arg_len = command_len;
base_offset += command_len + 1;
}
@@ -5513,7 +6004,8 @@ static void todo_list_add_exec_commands(struct todo_list *todo_list,
todo_list->alloc = alloc;
}
-static void todo_list_to_strbuf(struct repository *r, struct todo_list *todo_list,
+static void todo_list_to_strbuf(struct repository *r,
+ struct todo_list *todo_list,
struct strbuf *buf, int num, unsigned flags)
{
struct todo_item *item;
@@ -5542,7 +6034,7 @@ static void todo_list_to_strbuf(struct repository *r, struct todo_list *todo_lis
/* add commit id */
if (item->commit) {
const char *oid = flags & TODO_LIST_SHORTEN_IDS ?
- short_commit_name(item->commit) :
+ short_commit_name(r, item->commit) :
oid_to_hex(&item->commit->object.oid);
if (item->command == TODO_FIXUP) {
@@ -5605,7 +6097,7 @@ static int skip_unnecessary_picks(struct repository *r,
continue;
if (item->command != TODO_PICK)
break;
- if (parse_commit(item->commit)) {
+ if (repo_parse_commit(r, item->commit)) {
return error(_("could not parse commit '%s'"),
oid_to_hex(&item->commit->object.oid));
}
@@ -5638,10 +6130,135 @@ static int skip_unnecessary_picks(struct repository *r,
return 0;
}
+struct todo_add_branch_context {
+ struct todo_item *items;
+ size_t items_nr;
+ size_t items_alloc;
+ struct strbuf *buf;
+ struct commit *commit;
+ struct string_list refs_to_oids;
+};
+
+static int add_decorations_to_list(const struct commit *commit,
+ struct todo_add_branch_context *ctx)
+{
+ const struct name_decoration *decoration = get_name_decoration(&commit->object);
+ const char *head_ref = resolve_ref_unsafe("HEAD",
+ RESOLVE_REF_READING,
+ NULL,
+ NULL);
+
+ while (decoration) {
+ struct todo_item *item;
+ const char *path;
+ size_t base_offset = ctx->buf->len;
+
+ /*
+ * If the branch is the current HEAD, then it will be
+ * updated by the default rebase behavior.
+ */
+ if (head_ref && !strcmp(head_ref, decoration->name)) {
+ decoration = decoration->next;
+ continue;
+ }
+
+ ALLOC_GROW(ctx->items,
+ ctx->items_nr + 1,
+ ctx->items_alloc);
+ item = &ctx->items[ctx->items_nr];
+ memset(item, 0, sizeof(*item));
+
+ /* If the branch is checked out, then leave a comment instead. */
+ if ((path = branch_checked_out(decoration->name))) {
+ item->command = TODO_COMMENT;
+ strbuf_addf(ctx->buf, "# Ref %s checked out at '%s'\n",
+ decoration->name, path);
+ } else {
+ struct string_list_item *sti;
+ item->command = TODO_UPDATE_REF;
+ strbuf_addf(ctx->buf, "%s\n", decoration->name);
+
+ sti = string_list_insert(&ctx->refs_to_oids,
+ decoration->name);
+ sti->util = init_update_ref_record(decoration->name);
+ }
+
+ item->offset_in_buf = base_offset;
+ item->arg_offset = base_offset;
+ item->arg_len = ctx->buf->len - base_offset;
+ ctx->items_nr++;
+
+ decoration = decoration->next;
+ }
+
+ return 0;
+}
+
+/*
+ * For each 'pick' command, find out if the commit has a decoration in
+ * refs/heads/. If so, then add a 'label for-update-refs/' command.
+ */
+static int todo_list_add_update_ref_commands(struct todo_list *todo_list)
+{
+ int i, res;
+ static struct string_list decorate_refs_exclude = STRING_LIST_INIT_NODUP;
+ static struct string_list decorate_refs_exclude_config = STRING_LIST_INIT_NODUP;
+ static struct string_list decorate_refs_include = STRING_LIST_INIT_NODUP;
+ struct decoration_filter decoration_filter = {
+ .include_ref_pattern = &decorate_refs_include,
+ .exclude_ref_pattern = &decorate_refs_exclude,
+ .exclude_ref_config_pattern = &decorate_refs_exclude_config,
+ };
+ struct todo_add_branch_context ctx = {
+ .buf = &todo_list->buf,
+ .refs_to_oids = STRING_LIST_INIT_DUP,
+ };
+
+ ctx.items_alloc = 2 * todo_list->nr + 1;
+ ALLOC_ARRAY(ctx.items, ctx.items_alloc);
+
+ string_list_append(&decorate_refs_include, "refs/heads/");
+ load_ref_decorations(&decoration_filter, 0);
+
+ for (i = 0; i < todo_list->nr; ) {
+ struct todo_item *item = &todo_list->items[i];
+
+ /* insert ith item into new list */
+ ALLOC_GROW(ctx.items,
+ ctx.items_nr + 1,
+ ctx.items_alloc);
+
+ ctx.items[ctx.items_nr++] = todo_list->items[i++];
+
+ if (item->commit) {
+ ctx.commit = item->commit;
+ add_decorations_to_list(item->commit, &ctx);
+ }
+ }
+
+ res = write_update_refs_state(&ctx.refs_to_oids);
+
+ string_list_clear(&ctx.refs_to_oids, 1);
+
+ if (res) {
+ /* we failed, so clean up the new list. */
+ free(ctx.items);
+ return res;
+ }
+
+ free(todo_list->items);
+ todo_list->items = ctx.items;
+ todo_list->nr = ctx.items_nr;
+ todo_list->alloc = ctx.items_alloc;
+
+ return 0;
+}
+
int complete_action(struct repository *r, struct replay_opts *opts, unsigned flags,
const char *shortrevisions, const char *onto_name,
struct commit *onto, const struct object_id *orig_head,
struct string_list *commands, unsigned autosquash,
+ unsigned update_refs,
struct todo_list *todo_list)
{
char shortonto[GIT_MAX_HEXSZ + 1];
@@ -5651,7 +6268,8 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla
struct object_id oid = onto->object.oid;
int res;
- find_unique_abbrev_r(shortonto, &oid, DEFAULT_ABBREV);
+ repo_find_unique_abbrev_r(r, shortonto, &oid,
+ DEFAULT_ABBREV);
if (buf->len == 0) {
struct todo_item *item = append_new_todo(todo_list);
@@ -5660,6 +6278,9 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla
item->arg_len = item->arg_offset = item->flags = item->offset_in_buf = 0;
}
+ if (update_refs && todo_list_add_update_ref_commands(todo_list))
+ return -1;
+
if (autosquash && todo_list_rearrange_squash(todo_list))
return -1;
@@ -5699,7 +6320,8 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla
todo_list_to_strbuf(r, &new_todo, &buf2, -1, 0);
strbuf_swap(&new_todo.buf, &buf2);
strbuf_release(&buf2);
- new_todo.total_nr -= new_todo.nr;
+ /* Nothing is done yet, and we're reparsing, so let's reset the count */
+ new_todo.total_nr = 0;
if (todo_list_parse_insn_buffer(r, new_todo.buf.buf, &new_todo) < 0)
BUG("invalid todo list after expanding IDs:\n%s",
new_todo.buf.buf);
@@ -5720,7 +6342,7 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla
if (checkout_onto(r, opts, onto_name, &oid, orig_head))
goto cleanup;
- if (require_clean_work_tree(r, "rebase", "", 1, 1))
+ if (require_clean_work_tree(r, "rebase", NULL, 1, 1))
goto cleanup;
todo_list_write_total_nr(&new_todo);
@@ -5738,7 +6360,7 @@ struct subject2item_entry {
char subject[FLEX_ARRAY];
};
-static int subject2item_cmp(const void *fndata,
+static int subject2item_cmp(const void *fndata UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *key)
@@ -5771,7 +6393,7 @@ static int skip_fixupish(const char *subject, const char **p) {
int todo_list_rearrange_squash(struct todo_list *todo_list)
{
struct hashmap subject2item;
- int rearranged = 0, *next, *tail, i, nr = 0, alloc = 0;
+ int rearranged = 0, *next, *tail, i, nr = 0;
char **subjects;
struct commit_todo_item commit_todo;
struct todo_item *items = NULL;
@@ -5809,14 +6431,15 @@ int todo_list_rearrange_squash(struct todo_list *todo_list)
return error(_("the script was already rearranged."));
}
- *commit_todo_item_at(&commit_todo, item->commit) = item;
-
- parse_commit(item->commit);
- commit_buffer = logmsg_reencode(item->commit, NULL, "UTF-8");
+ repo_parse_commit(the_repository, item->commit);
+ commit_buffer = repo_logmsg_reencode(the_repository,
+ item->commit, NULL,
+ "UTF-8");
find_commit_subject(commit_buffer, &subject);
format_subject(&buf, subject, " ");
subject = subjects[i] = strbuf_detach(&buf, &subject_len);
- unuse_commit_buffer(item->commit, commit_buffer);
+ repo_unuse_commit_buffer(the_repository, item->commit,
+ commit_buffer);
if (skip_fixupish(subject, &p)) {
struct commit *commit2;
@@ -5877,9 +6500,13 @@ int todo_list_rearrange_squash(struct todo_list *todo_list)
strhash(entry->subject));
hashmap_put(&subject2item, &entry->entry);
}
+
+ *commit_todo_item_at(&commit_todo, item->commit) = item;
}
if (rearranged) {
+ ALLOC_ARRAY(items, todo_list->nr);
+
for (i = 0; i < todo_list->nr; i++) {
enum todo_command command = todo_list->items[i].command;
int cur = i;
@@ -5892,16 +6519,15 @@ int todo_list_rearrange_squash(struct todo_list *todo_list)
continue;
while (cur >= 0) {
- ALLOC_GROW(items, nr + 1, alloc);
items[nr++] = todo_list->items[cur];
cur = next[cur];
}
}
+ assert(nr == todo_list->nr);
+ todo_list->alloc = nr;
FREE_AND_NULL(todo_list->items);
todo_list->items = items;
- todo_list->nr = nr;
- todo_list->alloc = alloc;
}
free(next);
@@ -5924,8 +6550,8 @@ int sequencer_determine_whence(struct repository *r, enum commit_whence *whence)
if (file_exists(git_path_seq_dir()))
*whence = FROM_CHERRY_PICK_MULTI;
if (file_exists(rebase_path()) &&
- !get_oid("REBASE_HEAD", &rebase_head) &&
- !get_oid("CHERRY_PICK_HEAD", &cherry_pick_head) &&
+ !repo_get_oid(r, "REBASE_HEAD", &rebase_head) &&
+ !repo_get_oid(r, "CHERRY_PICK_HEAD", &cherry_pick_head) &&
oideq(&rebase_head, &cherry_pick_head))
*whence = FROM_REBASE_PICK;
else
@@ -5936,3 +6562,54 @@ int sequencer_determine_whence(struct repository *r, enum commit_whence *whence)
return 0;
}
+
+int sequencer_get_update_refs_state(const char *wt_dir,
+ struct string_list *refs)
+{
+ int result = 0;
+ FILE *fp = NULL;
+ struct strbuf ref = STRBUF_INIT;
+ struct strbuf hash = STRBUF_INIT;
+ struct update_ref_record *rec = NULL;
+
+ char *path = rebase_path_update_refs(wt_dir);
+
+ fp = fopen(path, "r");
+ if (!fp)
+ goto cleanup;
+
+ while (strbuf_getline(&ref, fp) != EOF) {
+ struct string_list_item *item;
+
+ CALLOC_ARRAY(rec, 1);
+
+ if (strbuf_getline(&hash, fp) == EOF ||
+ get_oid_hex(hash.buf, &rec->before)) {
+ warning(_("update-refs file at '%s' is invalid"),
+ path);
+ result = -1;
+ goto cleanup;
+ }
+
+ if (strbuf_getline(&hash, fp) == EOF ||
+ get_oid_hex(hash.buf, &rec->after)) {
+ warning(_("update-refs file at '%s' is invalid"),
+ path);
+ result = -1;
+ goto cleanup;
+ }
+
+ item = string_list_insert(refs, ref.buf);
+ item->util = rec;
+ rec = NULL;
+ }
+
+cleanup:
+ if (fp)
+ fclose(fp);
+ free(path);
+ free(rec);
+ strbuf_release(&ref);
+ strbuf_release(&hash);
+ return result;
+}
diff --git a/sequencer.h b/sequencer.h
index 698599f..437eabd 100644
--- a/sequencer.h
+++ b/sequencer.h
@@ -1,11 +1,12 @@
#ifndef SEQUENCER_H
#define SEQUENCER_H
-#include "cache.h"
#include "strbuf.h"
+#include "strvec.h"
#include "wt-status.h"
struct commit;
+struct index_state;
struct repository;
const char *git_path_commit_editmsg(void);
@@ -13,6 +14,8 @@ const char *rebase_path_todo(void);
const char *rebase_path_todo_backup(void);
const char *rebase_path_dropped(void);
+extern const char *rebase_resolvemsg;
+
#define APPEND_SIGNOFF_DEDUP (1u << 0)
enum replay_action {
@@ -60,8 +63,10 @@ struct replay_opts {
/* Merge strategy */
char *default_strategy; /* from config options */
char *strategy;
- char **xopts;
- size_t xopts_nr, xopts_alloc;
+ struct strvec xopts;
+
+ /* Reflog */
+ char *reflog_action;
/* Used by fixup/squash */
struct strbuf current_fixups;
@@ -73,8 +78,16 @@ struct replay_opts {
/* Only used by REPLAY_NONE */
struct rev_info *revs;
+
+ /* Private use */
+ const char *reflog_message;
};
-#define REPLAY_OPTS_INIT { .edit = -1, .action = -1, .current_fixups = STRBUF_INIT }
+#define REPLAY_OPTS_INIT { \
+ .edit = -1, \
+ .action = -1, \
+ .current_fixups = STRBUF_INIT, \
+ .xopts = STRVEC_INIT, \
+}
/*
* Note that ordering matters in this enum. Not only must it match the mapping
@@ -96,6 +109,7 @@ enum todo_command {
TODO_LABEL,
TODO_RESET,
TODO_MERGE,
+ TODO_UPDATE_REF,
/* commands that do nothing but are counted for reporting progress */
TODO_NOOP,
TODO_DROP,
@@ -132,6 +146,18 @@ void todo_list_release(struct todo_list *todo_list);
const char *todo_item_get_arg(struct todo_list *todo_list,
struct todo_item *item);
+/*
+ * Parse the update-refs file for the current rebase, then remove the
+ * refs that do not appear in the todo_list (and have not had updated
+ * values stored) and add refs that are in the todo_list but not
+ * represented in the update-refs file.
+ *
+ * If there are changes to the update-refs list, then write the new state
+ * to disk.
+ */
+void todo_list_filter_update_refs(struct repository *r,
+ struct todo_list *todo_list);
+
/* Call this to setup defaults before parsing command line options */
void sequencer_init_config(struct replay_opts *opts);
int sequencer_pick_revisions(struct repository *repo,
@@ -139,6 +165,7 @@ int sequencer_pick_revisions(struct repository *repo,
int sequencer_continue(struct repository *repo, struct replay_opts *opts);
int sequencer_rollback(struct repository *repo, struct replay_opts *opts);
int sequencer_skip(struct repository *repo, struct replay_opts *opts);
+void replay_opts_release(struct replay_opts *opts);
int sequencer_remove_state(struct replay_opts *opts);
#define TODO_LIST_KEEP_EMPTY (1U << 0)
@@ -167,6 +194,7 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla
const char *shortrevisions, const char *onto_name,
struct commit *onto, const struct object_id *orig_head,
struct string_list *commands, unsigned autosquash,
+ unsigned update_refs,
struct todo_list *todo_list);
int todo_list_rearrange_squash(struct todo_list *todo_list);
@@ -199,9 +227,12 @@ void commit_post_rewrite(struct repository *r,
const struct object_id *new_head);
void create_autostash(struct repository *r, const char *path);
+void create_autostash_ref(struct repository *r, const char *refname);
int save_autostash(const char *path);
+int save_autostash_ref(struct repository *r, const char *refname);
int apply_autostash(const char *path);
int apply_autostash_oid(const char *stash_oid);
+int apply_autostash_ref(struct repository *r, const char *refname);
#define SUMMARY_INITIAL_COMMIT (1 << 0)
#define SUMMARY_SHOW_AUTHOR_DATE (1 << 1)
@@ -226,11 +257,19 @@ int read_oneliner(struct strbuf *buf,
const char *path, unsigned flags);
int read_author_script(const char *path, char **name, char **email, char **date,
int allow_missing);
-void parse_strategy_opts(struct replay_opts *opts, char *raw_opts);
int write_basic_state(struct replay_opts *opts, const char *head_name,
struct commit *onto, const struct object_id *orig_head);
void sequencer_post_commit_cleanup(struct repository *r, int verbose);
int sequencer_get_last_command(struct repository* r,
enum replay_action *action);
int sequencer_determine_whence(struct repository *r, enum commit_whence *whence);
+
+/**
+ * Append the set of ref-OID pairs that are currently stored for the 'git
+ * rebase --update-refs' feature if such a rebase is currently happening.
+ *
+ * Localized to a worktree's git dir.
+ */
+int sequencer_get_update_refs_state(const char *wt_dir, struct string_list *refs);
+
#endif /* SEQUENCER_H */
diff --git a/serve.c b/serve.c
index 733347f..aa651b7 100644
--- a/serve.c
+++ b/serve.c
@@ -1,23 +1,27 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "repository.h"
#include "config.h"
+#include "hash-ll.h"
#include "pkt-line.h"
#include "version.h"
#include "ls-refs.h"
#include "protocol-caps.h"
#include "serve.h"
#include "upload-pack.h"
+#include "bundle-uri.h"
+#include "trace2.h"
static int advertise_sid = -1;
+static int advertise_object_info = -1;
static int client_hash_algo = GIT_HASH_SHA1;
-static int always_advertise(struct repository *r,
- struct strbuf *value)
+static int always_advertise(struct repository *r UNUSED,
+ struct strbuf *value UNUSED)
{
return 1;
}
-static int agent_advertise(struct repository *r,
+static int agent_advertise(struct repository *r UNUSED,
struct strbuf *value)
{
if (value)
@@ -33,7 +37,7 @@ static int object_format_advertise(struct repository *r,
return 1;
}
-static void object_format_receive(struct repository *r,
+static void object_format_receive(struct repository *r UNUSED,
const char *algo_name)
{
if (!algo_name)
@@ -47,7 +51,7 @@ static void object_format_receive(struct repository *r,
static int session_id_advertise(struct repository *r, struct strbuf *value)
{
if (advertise_sid == -1 &&
- git_config_get_bool("transfer.advertisesid", &advertise_sid))
+ repo_config_get_bool(r, "transfer.advertisesid", &advertise_sid))
advertise_sid = 0;
if (!advertise_sid)
return 0;
@@ -56,7 +60,7 @@ static int session_id_advertise(struct repository *r, struct strbuf *value)
return 1;
}
-static void session_id_receive(struct repository *r,
+static void session_id_receive(struct repository *r UNUSED,
const char *client_sid)
{
if (!client_sid)
@@ -64,6 +68,17 @@ static void session_id_receive(struct repository *r,
trace2_data_string("transfer", NULL, "client-sid", client_sid);
}
+static int object_info_advertise(struct repository *r, struct strbuf *value UNUSED)
+{
+ if (advertise_object_info == -1 &&
+ repo_config_get_bool(r, "transfer.advertiseobjectinfo",
+ &advertise_object_info)) {
+ /* disabled by default */
+ advertise_object_info = 0;
+ }
+ return advertise_object_info;
+}
+
struct protocol_capability {
/*
* The name of the capability. The server uses this name when
@@ -132,9 +147,14 @@ static struct protocol_capability capabilities[] = {
},
{
.name = "object-info",
- .advertise = always_advertise,
+ .advertise = object_info_advertise,
.command = cap_object_info,
},
+ {
+ .name = "bundle-uri",
+ .advertise = bundle_uri_advertise,
+ .command = bundle_uri_command,
+ },
};
void protocol_v2_advertise_capabilities(void)
diff --git a/server-info.c b/server-info.c
index 7701d7c..e2fe0f9 100644
--- a/server-info.c
+++ b/server-info.c
@@ -1,12 +1,17 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "dir.h"
+#include "environment.h"
+#include "hex.h"
#include "repository.h"
#include "refs.h"
#include "object.h"
#include "commit.h"
#include "tag.h"
#include "packfile.h"
-#include "object-store.h"
+#include "path.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "server-info.h"
#include "strbuf.h"
struct update_info_ctx {
@@ -147,7 +152,8 @@ out:
}
static int add_info_ref(const char *path, const struct object_id *oid,
- int flag, void *cb_data)
+ int flag UNUSED,
+ void *cb_data)
{
struct update_info_ctx *uic = cb_data;
struct object *o = parse_object(the_repository, oid);
diff --git a/server-info.h b/server-info.h
new file mode 100644
index 0000000..13bbde2
--- /dev/null
+++ b/server-info.h
@@ -0,0 +1,7 @@
+#ifndef SERVER_INFO_H
+#define SERVER_INFO_H
+
+/* Dumb servers support */
+int update_server_info(int);
+
+#endif /* SERVER_INFO_H */
diff --git a/setup.c b/setup.c
index 09b6549..f4b32f7 100644
--- a/setup.c
+++ b/setup.c
@@ -1,15 +1,29 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "copy.h"
+#include "environment.h"
+#include "exec-cmd.h"
+#include "gettext.h"
+#include "object-name.h"
+#include "refs.h"
#include "repository.h"
#include "config.h"
#include "dir.h"
+#include "setup.h"
#include "string-list.h"
#include "chdir-notify.h"
-#include "promisor-remote.h"
+#include "path.h"
#include "quote.h"
+#include "trace2.h"
+#include "worktree.h"
static int inside_git_dir = -1;
static int inside_work_tree = -1;
static int work_tree_config_is_bogus;
+enum allowed_bare_repo {
+ ALLOWED_BARE_REPO_EXPLICIT = 0,
+ ALLOWED_BARE_REPO_ALL,
+};
static struct startup_info the_startup_info;
struct startup_info *startup_info = &the_startup_info;
@@ -506,7 +520,9 @@ no_prevention_needed:
startup_info->original_cwd = NULL;
}
-static int read_worktree_config(const char *var, const char *value, void *vdata)
+static int read_worktree_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *vdata)
{
struct repository_format *data = vdata;
@@ -542,6 +558,8 @@ static enum extension_result handle_extension_v0(const char *var,
data->precious_objects = git_config_bool(var, value);
return EXTENSION_OK;
} else if (!strcmp(ext, "partialclone")) {
+ if (!value)
+ return config_error_nonbool(var);
data->partial_clone = xstrdup(value);
return EXTENSION_OK;
} else if (!strcmp(ext, "worktreeconfig")) {
@@ -573,17 +591,48 @@ static enum extension_result handle_extension(const char *var,
"extensions.objectformat", value);
data->hash_algo = format;
return EXTENSION_OK;
+ } else if (!strcmp(ext, "compatobjectformat")) {
+ struct string_list_item *item;
+ int format;
+
+ if (!value)
+ return config_error_nonbool(var);
+ format = hash_algo_by_name(value);
+ if (format == GIT_HASH_UNKNOWN)
+ return error(_("invalid value for '%s': '%s'"),
+ "extensions.compatobjectformat", value);
+ /* For now only support compatObjectFormat being specified once. */
+ for_each_string_list_item(item, &data->v1_only_extensions) {
+ if (!strcmp(item->string, "compatobjectformat"))
+ return error(_("'%s' already specified as '%s'"),
+ "extensions.compatobjectformat",
+ hash_algos[data->compat_hash_algo].name);
+ }
+ data->compat_hash_algo = format;
+ return EXTENSION_OK;
+ } else if (!strcmp(ext, "refstorage")) {
+ unsigned int format;
+
+ if (!value)
+ return config_error_nonbool(var);
+ format = ref_storage_format_by_name(value);
+ if (format == REF_STORAGE_FORMAT_UNKNOWN)
+ return error(_("invalid value for '%s': '%s'"),
+ "extensions.refstorage", value);
+ data->ref_storage_format = format;
+ return EXTENSION_OK;
}
return EXTENSION_UNKNOWN;
}
-static int check_repo_format(const char *var, const char *value, void *vdata)
+static int check_repo_format(const char *var, const char *value,
+ const struct config_context *ctx, void *vdata)
{
struct repository_format *data = vdata;
const char *ext;
if (strcmp(var, "core.repositoryformatversion") == 0)
- data->version = git_config_int(var, value);
+ data->version = git_config_int(var, value, ctx->kvi);
else if (skip_prefix(var, "extensions.", &ext)) {
switch (handle_extension_v0(var, value, ext, data)) {
case EXTENSION_ERROR:
@@ -606,7 +655,7 @@ static int check_repo_format(const char *var, const char *value, void *vdata)
}
}
- return read_worktree_config(var, value, vdata);
+ return read_worktree_config(var, value, ctx, vdata);
}
static int check_repository_format_gently(const char *gitdir, struct repository_format *candidate, int *nongit_ok)
@@ -639,11 +688,10 @@ static int check_repository_format_gently(const char *gitdir, struct repository_
}
repository_format_precious_objects = candidate->precious_objects;
- repository_format_worktree_config = candidate->worktree_config;
string_list_clear(&candidate->unknown_extensions, 0);
string_list_clear(&candidate->v1_only_extensions, 0);
- if (repository_format_worktree_config) {
+ if (candidate->worktree_config) {
/*
* pick up core.bare and core.worktree from per-worktree
* config if present
@@ -676,29 +724,39 @@ int upgrade_repository_format(int target_version)
struct strbuf err = STRBUF_INIT;
struct strbuf repo_version = STRBUF_INIT;
struct repository_format repo_fmt = REPOSITORY_FORMAT_INIT;
+ int ret;
strbuf_git_common_path(&sb, the_repository, "config");
read_repository_format(&repo_fmt, sb.buf);
strbuf_release(&sb);
- if (repo_fmt.version >= target_version)
- return 0;
+ if (repo_fmt.version >= target_version) {
+ ret = 0;
+ goto out;
+ }
if (verify_repository_format(&repo_fmt, &err) < 0) {
- error("cannot upgrade repository format from %d to %d: %s",
- repo_fmt.version, target_version, err.buf);
- strbuf_release(&err);
- return -1;
+ ret = error("cannot upgrade repository format from %d to %d: %s",
+ repo_fmt.version, target_version, err.buf);
+ goto out;
+ }
+ if (!repo_fmt.version && repo_fmt.unknown_extensions.nr) {
+ ret = error("cannot upgrade repository format: "
+ "unknown extension %s",
+ repo_fmt.unknown_extensions.items[0].string);
+ goto out;
}
- if (!repo_fmt.version && repo_fmt.unknown_extensions.nr)
- return error("cannot upgrade repository format: "
- "unknown extension %s",
- repo_fmt.unknown_extensions.items[0].string);
strbuf_addf(&repo_version, "%d", target_version);
git_config_set("core.repositoryformatversion", repo_version.buf);
+
+ ret = 1;
+
+out:
+ clear_repository_format(&repo_fmt);
strbuf_release(&repo_version);
- return 1;
+ strbuf_release(&err);
+ return ret;
}
static void init_repository_format(struct repository_format *format)
@@ -1105,7 +1163,8 @@ struct safe_directory_data {
int is_safe;
};
-static int safe_directory_cb(const char *key, const char *value, void *d)
+static int safe_directory_cb(const char *key, const char *value,
+ const struct config_context *ctx UNUSED, void *d)
{
struct safe_directory_data *data = d;
@@ -1138,16 +1197,17 @@ static int safe_directory_cb(const char *key, const char *value, void *d)
* added, for bare ones their git directory.
*/
static int ensure_valid_ownership(const char *gitfile,
- const char *worktree, const char *gitdir)
+ const char *worktree, const char *gitdir,
+ struct strbuf *report)
{
struct safe_directory_data data = {
.path = worktree ? worktree : gitdir
};
if (!git_env_bool("GIT_TEST_ASSUME_DIFFERENT_OWNER", 0) &&
- (!gitfile || is_path_owned_by_current_user(gitfile)) &&
- (!worktree || is_path_owned_by_current_user(worktree)) &&
- (!gitdir || is_path_owned_by_current_user(gitdir)))
+ (!gitfile || is_path_owned_by_current_user(gitfile, report)) &&
+ (!worktree || is_path_owned_by_current_user(worktree, report)) &&
+ (!gitdir || is_path_owned_by_current_user(gitdir, report)))
return 1;
/*
@@ -1155,22 +1215,78 @@ static int ensure_valid_ownership(const char *gitfile,
* constant regardless of what failed above. data.is_safe should be
* initialized to false, and might be changed by the callback.
*/
- read_very_early_config(safe_directory_cb, &data);
+ git_protected_config(safe_directory_cb, &data);
return data.is_safe;
}
-enum discovery_result {
- GIT_DIR_NONE = 0,
- GIT_DIR_EXPLICIT,
- GIT_DIR_DISCOVERED,
- GIT_DIR_BARE,
- /* these are errors */
- GIT_DIR_HIT_CEILING = -1,
- GIT_DIR_HIT_MOUNT_POINT = -2,
- GIT_DIR_INVALID_GITFILE = -3,
- GIT_DIR_INVALID_OWNERSHIP = -4
-};
+static int allowed_bare_repo_cb(const char *key, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *d)
+{
+ enum allowed_bare_repo *allowed_bare_repo = d;
+
+ if (strcasecmp(key, "safe.bareRepository"))
+ return 0;
+
+ if (!strcmp(value, "explicit")) {
+ *allowed_bare_repo = ALLOWED_BARE_REPO_EXPLICIT;
+ return 0;
+ }
+ if (!strcmp(value, "all")) {
+ *allowed_bare_repo = ALLOWED_BARE_REPO_ALL;
+ return 0;
+ }
+ return -1;
+}
+
+static enum allowed_bare_repo get_allowed_bare_repo(void)
+{
+ enum allowed_bare_repo result = ALLOWED_BARE_REPO_ALL;
+ git_protected_config(allowed_bare_repo_cb, &result);
+ return result;
+}
+
+static const char *allowed_bare_repo_to_string(
+ enum allowed_bare_repo allowed_bare_repo)
+{
+ switch (allowed_bare_repo) {
+ case ALLOWED_BARE_REPO_EXPLICIT:
+ return "explicit";
+ case ALLOWED_BARE_REPO_ALL:
+ return "all";
+ default:
+ BUG("invalid allowed_bare_repo %d",
+ allowed_bare_repo);
+ }
+ return NULL;
+}
+
+static int is_implicit_bare_repo(const char *path)
+{
+ /*
+ * what we found is a ".git" directory at the root of
+ * the working tree.
+ */
+ if (ends_with_path_components(path, ".git"))
+ return 1;
+
+ /*
+ * we are inside $GIT_DIR of a secondary worktree of a
+ * non-bare repository.
+ */
+ if (strstr(path, "/.git/worktrees/"))
+ return 1;
+
+ /*
+ * we are inside $GIT_DIR of a worktree of a non-embedded
+ * submodule, whose superproject is not a bare repository.
+ */
+ if (strstr(path, "/.git/modules/"))
+ return 1;
+
+ return 0;
+}
/*
* We cannot decide in this function whether we are in the work tree or
@@ -1187,6 +1303,7 @@ enum discovery_result {
*/
static enum discovery_result setup_git_directory_gently_1(struct strbuf *dir,
struct strbuf *gitdir,
+ struct strbuf *report,
int die_on_error)
{
const char *env_ceiling_dirs = getenv(CEILING_DIRECTORIES_ENVIRONMENT);
@@ -1271,10 +1388,11 @@ static enum discovery_result setup_git_directory_gently_1(struct strbuf *dir,
strbuf_setlen(dir, offset);
if (gitdirenv) {
enum discovery_result ret;
+ const char *gitdir_candidate =
+ gitdir_path ? gitdir_path : gitdirenv;
- if (ensure_valid_ownership(gitfile,
- dir->buf,
- (gitdir_path ? gitdir_path : gitdirenv))) {
+ if (ensure_valid_ownership(gitfile, dir->buf,
+ gitdir_candidate, report)) {
strbuf_addstr(gitdir, gitdirenv);
ret = GIT_DIR_DISCOVERED;
} else
@@ -1297,7 +1415,11 @@ static enum discovery_result setup_git_directory_gently_1(struct strbuf *dir,
}
if (is_git_directory(dir->buf)) {
- if (!ensure_valid_ownership(NULL, NULL, dir->buf))
+ trace2_data_string("setup", NULL, "implicit-bare-repository", dir->buf);
+ if (get_allowed_bare_repo() == ALLOWED_BARE_REPO_EXPLICIT &&
+ !is_implicit_bare_repo(dir->buf))
+ return GIT_DIR_DISALLOWED_BARE;
+ if (!ensure_valid_ownership(NULL, NULL, dir->buf, report))
return GIT_DIR_INVALID_OWNERSHIP;
strbuf_addstr(gitdir, ".");
return GIT_DIR_BARE;
@@ -1318,21 +1440,23 @@ static enum discovery_result setup_git_directory_gently_1(struct strbuf *dir,
}
}
-int discover_git_directory(struct strbuf *commondir,
- struct strbuf *gitdir)
+enum discovery_result discover_git_directory_reason(struct strbuf *commondir,
+ struct strbuf *gitdir)
{
struct strbuf dir = STRBUF_INIT, err = STRBUF_INIT;
size_t gitdir_offset = gitdir->len, cwd_len;
size_t commondir_offset = commondir->len;
struct repository_format candidate = REPOSITORY_FORMAT_INIT;
+ enum discovery_result result;
if (strbuf_getcwd(&dir))
- return -1;
+ return GIT_DIR_CWD_FAILURE;
cwd_len = dir.len;
- if (setup_git_directory_gently_1(&dir, gitdir, 0) <= 0) {
+ result = setup_git_directory_gently_1(&dir, gitdir, NULL, 0);
+ if (result <= 0) {
strbuf_release(&dir);
- return -1;
+ return result;
}
/*
@@ -1362,22 +1486,17 @@ int discover_git_directory(struct strbuf *commondir,
strbuf_setlen(commondir, commondir_offset);
strbuf_setlen(gitdir, gitdir_offset);
clear_repository_format(&candidate);
- return -1;
+ return GIT_DIR_INVALID_FORMAT;
}
- /* take ownership of candidate.partial_clone */
- the_repository->repository_format_partial_clone =
- candidate.partial_clone;
- candidate.partial_clone = NULL;
-
clear_repository_format(&candidate);
- return 0;
+ return result;
}
const char *setup_git_directory_gently(int *nongit_ok)
{
static struct strbuf cwd = STRBUF_INIT;
- struct strbuf dir = STRBUF_INIT, gitdir = STRBUF_INIT;
+ struct strbuf dir = STRBUF_INIT, gitdir = STRBUF_INIT, report = STRBUF_INIT;
const char *prefix = NULL;
struct repository_format repo_fmt = REPOSITORY_FORMAT_INIT;
@@ -1402,7 +1521,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
die_errno(_("Unable to read current working directory"));
strbuf_addbuf(&dir, &cwd);
- switch (setup_git_directory_gently_1(&dir, &gitdir, 1)) {
+ switch (setup_git_directory_gently_1(&dir, &gitdir, &report, 1)) {
case GIT_DIR_EXPLICIT:
prefix = setup_explicit_git_dir(gitdir.buf, &cwd, &repo_fmt, nongit_ok);
break;
@@ -1434,19 +1553,30 @@ const char *setup_git_directory_gently(int *nongit_ok)
if (!nongit_ok) {
struct strbuf quoted = STRBUF_INIT;
+ strbuf_complete(&report, '\n');
sq_quote_buf_pretty(&quoted, dir.buf);
die(_("detected dubious ownership in repository at '%s'\n"
+ "%s"
"To add an exception for this directory, call:\n"
"\n"
"\tgit config --global --add safe.directory %s"),
- dir.buf, quoted.buf);
+ dir.buf, report.buf, quoted.buf);
}
*nongit_ok = 1;
break;
- case GIT_DIR_NONE:
+ case GIT_DIR_DISALLOWED_BARE:
+ if (!nongit_ok) {
+ die(_("cannot use bare repository '%s' (safe.bareRepository is '%s')"),
+ dir.buf,
+ allowed_bare_repo_to_string(get_allowed_bare_repo()));
+ }
+ *nongit_ok = 1;
+ break;
+ case GIT_DIR_CWD_FAILURE:
+ case GIT_DIR_INVALID_FORMAT:
/*
* As a safeguard against setup_git_directory_gently_1 returning
- * this value, fallthrough to BUG. Otherwise it is possible to
+ * these values, fallthrough to BUG. Otherwise it is possible to
* set startup_info->have_repository to 1 when we did nothing to
* find a repository.
*/
@@ -1492,6 +1622,12 @@ const char *setup_git_directory_gently(int *nongit_ok)
}
if (startup_info->have_repository) {
repo_set_hash_algo(the_repository, repo_fmt.hash_algo);
+ repo_set_compat_hash_algo(the_repository,
+ repo_fmt.compat_hash_algo);
+ repo_set_ref_storage_format(the_repository,
+ repo_fmt.ref_storage_format);
+ the_repository->repository_format_worktree_config =
+ repo_fmt.worktree_config;
/* take ownership of repo_fmt.partial_clone */
the_repository->repository_format_partial_clone =
repo_fmt.partial_clone;
@@ -1518,6 +1654,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
strbuf_release(&dir);
strbuf_release(&gitdir);
+ strbuf_release(&report);
clear_repository_format(&repo_fmt);
return prefix;
@@ -1582,6 +1719,11 @@ void check_repository_format(struct repository_format *fmt)
check_repository_format_gently(get_git_dir(), fmt, NULL);
startup_info->have_repository = 1;
repo_set_hash_algo(the_repository, fmt->hash_algo);
+ repo_set_compat_hash_algo(the_repository, fmt->compat_hash_algo);
+ repo_set_ref_storage_format(the_repository,
+ fmt->ref_storage_format);
+ the_repository->repository_format_worktree_config =
+ fmt->worktree_config;
the_repository->repository_format_partial_clone =
xstrdup_or_null(fmt->partial_clone);
clear_repository_format(&repo_fmt);
@@ -1638,3 +1780,517 @@ int daemonize(void)
return 0;
#endif
}
+
+#ifdef NO_TRUSTABLE_FILEMODE
+#define TEST_FILEMODE 0
+#else
+#define TEST_FILEMODE 1
+#endif
+
+#define GIT_DEFAULT_HASH_ENVIRONMENT "GIT_DEFAULT_HASH"
+
+static void copy_templates_1(struct strbuf *path, struct strbuf *template_path,
+ DIR *dir)
+{
+ size_t path_baselen = path->len;
+ size_t template_baselen = template_path->len;
+ struct dirent *de;
+
+ /* Note: if ".git/hooks" file exists in the repository being
+ * re-initialized, /etc/core-git/templates/hooks/update would
+ * cause "git init" to fail here. I think this is sane but
+ * it means that the set of templates we ship by default, along
+ * with the way the namespace under .git/ is organized, should
+ * be really carefully chosen.
+ */
+ safe_create_dir(path->buf, 1);
+ while ((de = readdir(dir)) != NULL) {
+ struct stat st_git, st_template;
+ int exists = 0;
+
+ strbuf_setlen(path, path_baselen);
+ strbuf_setlen(template_path, template_baselen);
+
+ if (de->d_name[0] == '.')
+ continue;
+ strbuf_addstr(path, de->d_name);
+ strbuf_addstr(template_path, de->d_name);
+ if (lstat(path->buf, &st_git)) {
+ if (errno != ENOENT)
+ die_errno(_("cannot stat '%s'"), path->buf);
+ }
+ else
+ exists = 1;
+
+ if (lstat(template_path->buf, &st_template))
+ die_errno(_("cannot stat template '%s'"), template_path->buf);
+
+ if (S_ISDIR(st_template.st_mode)) {
+ DIR *subdir = opendir(template_path->buf);
+ if (!subdir)
+ die_errno(_("cannot opendir '%s'"), template_path->buf);
+ strbuf_addch(path, '/');
+ strbuf_addch(template_path, '/');
+ copy_templates_1(path, template_path, subdir);
+ closedir(subdir);
+ }
+ else if (exists)
+ continue;
+ else if (S_ISLNK(st_template.st_mode)) {
+ struct strbuf lnk = STRBUF_INIT;
+ if (strbuf_readlink(&lnk, template_path->buf,
+ st_template.st_size) < 0)
+ die_errno(_("cannot readlink '%s'"), template_path->buf);
+ if (symlink(lnk.buf, path->buf))
+ die_errno(_("cannot symlink '%s' '%s'"),
+ lnk.buf, path->buf);
+ strbuf_release(&lnk);
+ }
+ else if (S_ISREG(st_template.st_mode)) {
+ if (copy_file(path->buf, template_path->buf, st_template.st_mode))
+ die_errno(_("cannot copy '%s' to '%s'"),
+ template_path->buf, path->buf);
+ }
+ else
+ error(_("ignoring template %s"), template_path->buf);
+ }
+}
+
+static void copy_templates(const char *template_dir, const char *init_template_dir)
+{
+ struct strbuf path = STRBUF_INIT;
+ struct strbuf template_path = STRBUF_INIT;
+ size_t template_len;
+ struct repository_format template_format = REPOSITORY_FORMAT_INIT;
+ struct strbuf err = STRBUF_INIT;
+ DIR *dir;
+ char *to_free = NULL;
+
+ if (!template_dir)
+ template_dir = getenv(TEMPLATE_DIR_ENVIRONMENT);
+ if (!template_dir)
+ template_dir = init_template_dir;
+ if (!template_dir)
+ template_dir = to_free = system_path(DEFAULT_GIT_TEMPLATE_DIR);
+ if (!template_dir[0]) {
+ free(to_free);
+ return;
+ }
+
+ strbuf_addstr(&template_path, template_dir);
+ strbuf_complete(&template_path, '/');
+ template_len = template_path.len;
+
+ dir = opendir(template_path.buf);
+ if (!dir) {
+ warning(_("templates not found in %s"), template_dir);
+ goto free_return;
+ }
+
+ /* Make sure that template is from the correct vintage */
+ strbuf_addstr(&template_path, "config");
+ read_repository_format(&template_format, template_path.buf);
+ strbuf_setlen(&template_path, template_len);
+
+ /*
+ * No mention of version at all is OK, but anything else should be
+ * verified.
+ */
+ if (template_format.version >= 0 &&
+ verify_repository_format(&template_format, &err) < 0) {
+ warning(_("not copying templates from '%s': %s"),
+ template_dir, err.buf);
+ strbuf_release(&err);
+ goto close_free_return;
+ }
+
+ strbuf_addstr(&path, get_git_common_dir());
+ strbuf_complete(&path, '/');
+ copy_templates_1(&path, &template_path, dir);
+close_free_return:
+ closedir(dir);
+free_return:
+ free(to_free);
+ strbuf_release(&path);
+ strbuf_release(&template_path);
+ clear_repository_format(&template_format);
+}
+
+/*
+ * If the git_dir is not directly inside the working tree, then git will not
+ * find it by default, and we need to set the worktree explicitly.
+ */
+static int needs_work_tree_config(const char *git_dir, const char *work_tree)
+{
+ if (!strcmp(work_tree, "/") && !strcmp(git_dir, "/.git"))
+ return 0;
+ if (skip_prefix(git_dir, work_tree, &git_dir) &&
+ !strcmp(git_dir, "/.git"))
+ return 0;
+ return 1;
+}
+
+void initialize_repository_version(int hash_algo,
+ unsigned int ref_storage_format,
+ int reinit)
+{
+ char repo_version_string[10];
+ int repo_version = GIT_REPO_VERSION;
+
+ /*
+ * Note that we initialize the repository version to 1 when the ref
+ * storage format is unknown. This is on purpose so that we can add the
+ * correct object format to the config during git-clone(1). The format
+ * version will get adjusted by git-clone(1) once it has learned about
+ * the remote repository's format.
+ */
+ 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);
+
+ if (hash_algo != GIT_HASH_SHA1 && hash_algo != GIT_HASH_UNKNOWN)
+ git_config_set("extensions.objectformat",
+ hash_algos[hash_algo].name);
+ else if (reinit)
+ git_config_set_gently("extensions.objectformat", NULL);
+
+ if (ref_storage_format != REF_STORAGE_FORMAT_FILES)
+ git_config_set("extensions.refstorage",
+ ref_storage_format_to_name(ref_storage_format));
+}
+
+static int is_reinit(void)
+{
+ struct strbuf buf = STRBUF_INIT;
+ char junk[2];
+ int ret;
+
+ git_path_buf(&buf, "HEAD");
+ ret = !access(buf.buf, R_OK) || readlink(buf.buf, junk, sizeof(junk) - 1) != -1;
+ strbuf_release(&buf);
+ return ret;
+}
+
+void create_reference_database(unsigned int ref_storage_format,
+ const char *initial_branch, int quiet)
+{
+ struct strbuf err = STRBUF_INIT;
+ int reinit = is_reinit();
+
+ repo_set_ref_storage_format(the_repository, ref_storage_format);
+ if (refs_init_db(get_main_ref_store(the_repository), 0, &err))
+ die("failed to set up refs db: %s", err.buf);
+
+ /*
+ * Point the HEAD symref to the initial branch with if HEAD does
+ * not yet exist.
+ */
+ if (!reinit) {
+ char *ref;
+
+ if (!initial_branch)
+ initial_branch = git_default_branch_name(quiet);
+
+ ref = xstrfmt("refs/heads/%s", initial_branch);
+ if (check_refname_format(ref, 0) < 0)
+ die(_("invalid initial branch name: '%s'"),
+ initial_branch);
+
+ if (create_symref("HEAD", ref, NULL) < 0)
+ exit(1);
+ free(ref);
+ }
+
+ if (reinit && initial_branch)
+ warning(_("re-init: ignored --initial-branch=%s"),
+ initial_branch);
+
+ strbuf_release(&err);
+}
+
+static int create_default_files(const char *template_path,
+ const char *original_git_dir,
+ const struct repository_format *fmt,
+ int init_shared_repository)
+{
+ struct stat st1;
+ struct strbuf buf = STRBUF_INIT;
+ char *path;
+ int reinit;
+ int filemode;
+ const char *init_template_dir = NULL;
+ const char *work_tree = get_git_work_tree();
+
+ /*
+ * First copy the templates -- we might have the default
+ * config file there, in which case we would want to read
+ * from it after installing.
+ *
+ * Before reading that config, we also need to clear out any cached
+ * values (since we've just potentially changed what's available on
+ * disk).
+ */
+ git_config_get_pathname("init.templatedir", &init_template_dir);
+ copy_templates(template_path, init_template_dir);
+ free((char *)init_template_dir);
+ git_config_clear();
+ reset_shared_repository();
+ git_config(git_default_config, NULL);
+
+ reinit = is_reinit();
+
+ /*
+ * We must make sure command-line options continue to override any
+ * values we might have just re-read from the config.
+ */
+ if (init_shared_repository != -1)
+ set_shared_repository(init_shared_repository);
+
+ is_bare_repository_cfg = !work_tree;
+
+ /*
+ * We would have created the above under user's umask -- under
+ * shared-repository settings, we would need to fix them up.
+ */
+ if (get_shared_repository()) {
+ adjust_shared_perm(get_git_dir());
+ }
+
+ initialize_repository_version(fmt->hash_algo, fmt->ref_storage_format, 0);
+
+ /* Check filemode trustability */
+ path = git_path_buf(&buf, "config");
+ filemode = TEST_FILEMODE;
+ if (TEST_FILEMODE && !lstat(path, &st1)) {
+ struct stat st2;
+ filemode = (!chmod(path, st1.st_mode ^ S_IXUSR) &&
+ !lstat(path, &st2) &&
+ st1.st_mode != st2.st_mode &&
+ !chmod(path, st1.st_mode));
+ if (filemode && !reinit && (st1.st_mode & S_IXUSR))
+ filemode = 0;
+ }
+ git_config_set("core.filemode", filemode ? "true" : "false");
+
+ if (is_bare_repository())
+ git_config_set("core.bare", "true");
+ else {
+ git_config_set("core.bare", "false");
+ /* allow template config file to override the default */
+ if (log_all_ref_updates == LOG_REFS_UNSET)
+ git_config_set("core.logallrefupdates", "true");
+ if (needs_work_tree_config(original_git_dir, work_tree))
+ git_config_set("core.worktree", work_tree);
+ }
+
+ if (!reinit) {
+ /* Check if symlink is supported in the work tree */
+ path = git_path_buf(&buf, "tXXXXXX");
+ if (!close(xmkstemp(path)) &&
+ !unlink(path) &&
+ !symlink("testing", path) &&
+ !lstat(path, &st1) &&
+ S_ISLNK(st1.st_mode))
+ unlink(path); /* good */
+ else
+ git_config_set("core.symlinks", "false");
+
+ /* Check if the filesystem is case-insensitive */
+ path = git_path_buf(&buf, "CoNfIg");
+ if (!access(path, F_OK))
+ git_config_set("core.ignorecase", "true");
+ probe_utf8_pathname_composition();
+ }
+
+ strbuf_release(&buf);
+ return reinit;
+}
+
+static void create_object_directory(void)
+{
+ struct strbuf path = STRBUF_INIT;
+ size_t baselen;
+
+ strbuf_addstr(&path, get_object_directory());
+ baselen = path.len;
+
+ safe_create_dir(path.buf, 1);
+
+ strbuf_setlen(&path, baselen);
+ strbuf_addstr(&path, "/pack");
+ safe_create_dir(path.buf, 1);
+
+ strbuf_setlen(&path, baselen);
+ strbuf_addstr(&path, "/info");
+ safe_create_dir(path.buf, 1);
+
+ strbuf_release(&path);
+}
+
+static void separate_git_dir(const char *git_dir, const char *git_link)
+{
+ struct stat st;
+
+ if (!stat(git_link, &st)) {
+ const char *src;
+
+ if (S_ISREG(st.st_mode))
+ src = read_gitfile(git_link);
+ else if (S_ISDIR(st.st_mode))
+ src = git_link;
+ else
+ die(_("unable to handle file type %d"), (int)st.st_mode);
+
+ if (rename(src, git_dir))
+ die_errno(_("unable to move %s to %s"), src, git_dir);
+ repair_worktrees(NULL, NULL);
+ }
+
+ write_file(git_link, "gitdir: %s", git_dir);
+}
+
+static void validate_hash_algorithm(struct repository_format *repo_fmt, int hash)
+{
+ const char *env = getenv(GIT_DEFAULT_HASH_ENVIRONMENT);
+ /*
+ * If we already have an initialized repo, don't allow the user to
+ * specify a different algorithm, as that could cause corruption.
+ * Otherwise, if the user has specified one on the command line, use it.
+ */
+ if (repo_fmt->version >= 0 && hash != GIT_HASH_UNKNOWN && hash != repo_fmt->hash_algo)
+ die(_("attempt to reinitialize repository with different hash"));
+ else if (hash != GIT_HASH_UNKNOWN)
+ repo_fmt->hash_algo = hash;
+ else if (env) {
+ int env_algo = hash_algo_by_name(env);
+ if (env_algo == GIT_HASH_UNKNOWN)
+ die(_("unknown hash algorithm '%s'"), env);
+ repo_fmt->hash_algo = env_algo;
+ }
+}
+
+static void validate_ref_storage_format(struct repository_format *repo_fmt,
+ unsigned int format)
+{
+ const char *name = getenv("GIT_DEFAULT_REF_FORMAT");
+
+ if (repo_fmt->version >= 0 &&
+ format != REF_STORAGE_FORMAT_UNKNOWN &&
+ format != repo_fmt->ref_storage_format) {
+ die(_("attempt to reinitialize repository with different reference storage format"));
+ } else if (format != REF_STORAGE_FORMAT_UNKNOWN) {
+ repo_fmt->ref_storage_format = format;
+ } else if (name) {
+ format = ref_storage_format_by_name(name);
+ if (format == REF_STORAGE_FORMAT_UNKNOWN)
+ die(_("unknown ref storage format '%s'"), name);
+ repo_fmt->ref_storage_format = format;
+ }
+}
+
+int init_db(const char *git_dir, const char *real_git_dir,
+ const char *template_dir, int hash,
+ unsigned int ref_storage_format,
+ const char *initial_branch,
+ int init_shared_repository, unsigned int flags)
+{
+ int reinit;
+ int exist_ok = flags & INIT_DB_EXIST_OK;
+ char *original_git_dir = real_pathdup(git_dir, 1);
+ struct repository_format repo_fmt = REPOSITORY_FORMAT_INIT;
+
+ if (real_git_dir) {
+ struct stat st;
+
+ if (!exist_ok && !stat(git_dir, &st))
+ die(_("%s already exists"), git_dir);
+
+ if (!exist_ok && !stat(real_git_dir, &st))
+ die(_("%s already exists"), real_git_dir);
+
+ set_git_dir(real_git_dir, 1);
+ git_dir = get_git_dir();
+ separate_git_dir(git_dir, original_git_dir);
+ }
+ else {
+ set_git_dir(git_dir, 1);
+ git_dir = get_git_dir();
+ }
+ startup_info->have_repository = 1;
+
+ /* Ensure `core.hidedotfiles` is processed */
+ git_config(platform_core_config, NULL);
+
+ safe_create_dir(git_dir, 0);
+
+
+ /* Check to see if the repository version is right.
+ * Note that a newly created repository does not have
+ * config file, so this will not fail. What we are catching
+ * is an attempt to reinitialize new repository with an old tool.
+ */
+ check_repository_format(&repo_fmt);
+
+ validate_hash_algorithm(&repo_fmt, hash);
+ validate_ref_storage_format(&repo_fmt, ref_storage_format);
+
+ reinit = create_default_files(template_dir, original_git_dir,
+ &repo_fmt, init_shared_repository);
+
+ /*
+ * Now that we have set up both the hash algorithm and the ref storage
+ * format we can update the repository's settings accordingly.
+ */
+ repo_set_hash_algo(the_repository, repo_fmt.hash_algo);
+ repo_set_ref_storage_format(the_repository, repo_fmt.ref_storage_format);
+
+ if (!(flags & INIT_DB_SKIP_REFDB))
+ create_reference_database(repo_fmt.ref_storage_format,
+ initial_branch, flags & INIT_DB_QUIET);
+ create_object_directory();
+
+ if (get_shared_repository()) {
+ char buf[10];
+ /* We do not spell "group" and such, so that
+ * the configuration can be read by older version
+ * of git. Note, we use octal numbers for new share modes,
+ * and compatibility values for PERM_GROUP and
+ * PERM_EVERYBODY.
+ */
+ if (get_shared_repository() < 0)
+ /* force to the mode value */
+ xsnprintf(buf, sizeof(buf), "0%o", -get_shared_repository());
+ else if (get_shared_repository() == PERM_GROUP)
+ xsnprintf(buf, sizeof(buf), "%d", OLD_PERM_GROUP);
+ else if (get_shared_repository() == PERM_EVERYBODY)
+ xsnprintf(buf, sizeof(buf), "%d", OLD_PERM_EVERYBODY);
+ else
+ BUG("invalid value for shared_repository");
+ git_config_set("core.sharedrepository", buf);
+ git_config_set("receive.denyNonFastforwards", "true");
+ }
+
+ if (!(flags & INIT_DB_QUIET)) {
+ int len = strlen(git_dir);
+
+ if (reinit)
+ printf(get_shared_repository()
+ ? _("Reinitialized existing shared Git repository in %s%s\n")
+ : _("Reinitialized existing Git repository in %s%s\n"),
+ git_dir, len && git_dir[len-1] != '/' ? "/" : "");
+ else
+ printf(get_shared_repository()
+ ? _("Initialized empty shared Git repository in %s%s\n")
+ : _("Initialized empty Git repository in %s%s\n"),
+ git_dir, len && git_dir[len-1] != '/' ? "/" : "");
+ }
+
+ clear_repository_format(&repo_fmt);
+ free(original_git_dir);
+ return 0;
+}
diff --git a/setup.h b/setup.h
new file mode 100644
index 0000000..d88bb37
--- /dev/null
+++ b/setup.h
@@ -0,0 +1,215 @@
+#ifndef SETUP_H
+#define SETUP_H
+
+#include "string-list.h"
+
+int is_inside_git_dir(void);
+int is_inside_work_tree(void);
+int get_common_dir_noenv(struct strbuf *sb, const char *gitdir);
+int get_common_dir(struct strbuf *sb, const char *gitdir);
+
+/*
+ * Return true if the given path is a git directory; note that this _just_
+ * looks at the directory itself. If you want to know whether "foo/.git"
+ * is a repository, you must feed that path, not just "foo".
+ */
+int is_git_directory(const char *path);
+
+/*
+ * Return 1 if the given path is the root of a git repository or
+ * submodule, else 0. Will not return 1 for bare repositories with the
+ * exception of creating a bare repository in "foo/.git" and calling
+ * is_git_repository("foo").
+ *
+ * If we run into read errors, we err on the side of saying "yes, it is",
+ * as we usually consider sub-repos precious, and would prefer to err on the
+ * side of not disrupting or deleting them.
+ */
+int is_nonbare_repository_dir(struct strbuf *path);
+
+#define READ_GITFILE_ERR_STAT_FAILED 1
+#define READ_GITFILE_ERR_NOT_A_FILE 2
+#define READ_GITFILE_ERR_OPEN_FAILED 3
+#define READ_GITFILE_ERR_READ_FAILED 4
+#define READ_GITFILE_ERR_INVALID_FORMAT 5
+#define READ_GITFILE_ERR_NO_PATH 6
+#define READ_GITFILE_ERR_NOT_A_REPO 7
+#define READ_GITFILE_ERR_TOO_LARGE 8
+void read_gitfile_error_die(int error_code, const char *path, const char *dir);
+const char *read_gitfile_gently(const char *path, int *return_error_code);
+#define read_gitfile(path) read_gitfile_gently((path), NULL)
+const char *resolve_gitdir_gently(const char *suspect, int *return_error_code);
+#define resolve_gitdir(path) resolve_gitdir_gently((path), NULL)
+
+void setup_work_tree(void);
+
+/*
+ * discover_git_directory_reason() is similar to discover_git_directory(),
+ * except it returns an enum value instead. It is important to note that
+ * a zero-valued return here is actually GIT_DIR_NONE, which is different
+ * from discover_git_directory.
+ */
+enum discovery_result {
+ GIT_DIR_EXPLICIT = 1,
+ GIT_DIR_DISCOVERED = 2,
+ GIT_DIR_BARE = 3,
+ /* these are errors */
+ GIT_DIR_HIT_CEILING = -1,
+ GIT_DIR_HIT_MOUNT_POINT = -2,
+ GIT_DIR_INVALID_GITFILE = -3,
+ GIT_DIR_INVALID_OWNERSHIP = -4,
+ GIT_DIR_DISALLOWED_BARE = -5,
+ GIT_DIR_INVALID_FORMAT = -6,
+ GIT_DIR_CWD_FAILURE = -7,
+};
+enum discovery_result discover_git_directory_reason(struct strbuf *commondir,
+ struct strbuf *gitdir);
+
+/*
+ * Find the commondir and gitdir of the repository that contains the current
+ * working directory, without changing the working directory or other global
+ * state. The result is appended to commondir and gitdir. If the discovered
+ * gitdir does not correspond to a worktree, then 'commondir' and 'gitdir' will
+ * both have the same result appended to the buffer. The return value is
+ * either 0 upon success and -1 if no repository was found.
+ */
+static inline int discover_git_directory(struct strbuf *commondir,
+ struct strbuf *gitdir)
+{
+ if (discover_git_directory_reason(commondir, gitdir) <= 0)
+ return -1;
+ return 0;
+}
+
+const char *setup_git_directory_gently(int *);
+const char *setup_git_directory(void);
+char *prefix_path(const char *prefix, int len, const char *path);
+char *prefix_path_gently(const char *prefix, int len, int *remaining, const char *path);
+
+int check_filename(const char *prefix, const char *name);
+void verify_filename(const char *prefix,
+ const char *name,
+ int diagnose_misspelt_rev);
+void verify_non_filename(const char *prefix, const char *name);
+int path_inside_repo(const char *prefix, const char *path);
+
+void sanitize_stdfds(void);
+int daemonize(void);
+
+/*
+ * GIT_REPO_VERSION is the version we write by default. The
+ * _READ variant is the highest number we know how to
+ * handle.
+ */
+#define GIT_REPO_VERSION 0
+#define GIT_REPO_VERSION_READ 1
+
+/*
+ * You _have_ to initialize a `struct repository_format` using
+ * `= REPOSITORY_FORMAT_INIT` before calling `read_repository_format()`.
+ */
+struct repository_format {
+ int version;
+ int precious_objects;
+ char *partial_clone; /* value of extensions.partialclone */
+ int worktree_config;
+ int is_bare;
+ int hash_algo;
+ int compat_hash_algo;
+ unsigned int ref_storage_format;
+ int sparse_index;
+ char *work_tree;
+ struct string_list unknown_extensions;
+ struct string_list v1_only_extensions;
+};
+
+/*
+ * Always use this to initialize a `struct repository_format`
+ * to a well-defined, default state before calling
+ * `read_repository()`.
+ */
+#define REPOSITORY_FORMAT_INIT \
+{ \
+ .version = -1, \
+ .is_bare = -1, \
+ .hash_algo = GIT_HASH_SHA1, \
+ .ref_storage_format = REF_STORAGE_FORMAT_FILES, \
+ .unknown_extensions = STRING_LIST_INIT_DUP, \
+ .v1_only_extensions = STRING_LIST_INIT_DUP, \
+}
+
+/*
+ * Read the repository format characteristics from the config file "path" into
+ * "format" struct. Returns the numeric version. On error, or if no version is
+ * found in the configuration, -1 is returned, format->version is set to -1,
+ * and all other fields in the struct are set to the default configuration
+ * (REPOSITORY_FORMAT_INIT). Always initialize the struct using
+ * REPOSITORY_FORMAT_INIT before calling this function.
+ */
+int read_repository_format(struct repository_format *format, const char *path);
+
+/*
+ * Free the memory held onto by `format`, but not the struct itself.
+ * (No need to use this after `read_repository_format()` fails.)
+ */
+void clear_repository_format(struct repository_format *format);
+
+/*
+ * Verify that the repository described by repository_format is something we
+ * can read. If it is, return 0. Otherwise, return -1, and "err" will describe
+ * any errors encountered.
+ */
+int verify_repository_format(const struct repository_format *format,
+ struct strbuf *err);
+
+/*
+ * Check the repository format version in the path found in get_git_dir(),
+ * and die if it is a version we don't understand. Generally one would
+ * set_git_dir() before calling this, and use it only for "are we in a valid
+ * repo?".
+ *
+ * If successful and fmt is not NULL, fill fmt with data.
+ */
+void check_repository_format(struct repository_format *fmt);
+
+#define INIT_DB_QUIET (1 << 0)
+#define INIT_DB_EXIST_OK (1 << 1)
+#define INIT_DB_SKIP_REFDB (1 << 2)
+
+int init_db(const char *git_dir, const char *real_git_dir,
+ const char *template_dir, int hash_algo,
+ unsigned int ref_storage_format,
+ const char *initial_branch, int init_shared_repository,
+ unsigned int flags);
+void initialize_repository_version(int hash_algo,
+ unsigned int ref_storage_format,
+ int reinit);
+void create_reference_database(unsigned int ref_storage_format,
+ const char *initial_branch, int quiet);
+
+/*
+ * NOTE NOTE NOTE!!
+ *
+ * PERM_UMASK, OLD_PERM_GROUP and OLD_PERM_EVERYBODY enumerations must
+ * not be changed. Old repositories have core.sharedrepository written in
+ * numeric format, and therefore these values are preserved for compatibility
+ * reasons.
+ */
+enum sharedrepo {
+ PERM_UMASK = 0,
+ OLD_PERM_GROUP = 1,
+ OLD_PERM_EVERYBODY = 2,
+ PERM_GROUP = 0660,
+ PERM_EVERYBODY = 0664
+};
+int git_config_perm(const char *var, const char *value);
+
+struct startup_info {
+ int have_repository;
+ const char *prefix;
+ const char *original_cwd;
+};
+extern struct startup_info *startup_info;
+extern const char *tmp_original_cwd;
+
+#endif /* SETUP_H */
diff --git a/sh-i18n--envsubst.c b/sh-i18n--envsubst.c
index 133496b..f69fd16 100644
--- a/sh-i18n--envsubst.c
+++ b/sh-i18n--envsubst.c
@@ -31,7 +31,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, see <https://www.gnu.org/licenses/>. */
/* closeout.c - close standard output and standard error
Copyright (C) 1998-2007 Free Software Foundation, Inc.
@@ -47,7 +47,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, see <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stdio.h>
diff --git a/sha1/openssl.h b/sha1/openssl.h
new file mode 100644
index 0000000..006c1f4
--- /dev/null
+++ b/sha1/openssl.h
@@ -0,0 +1,49 @@
+/* wrappers for the EVP API of OpenSSL 3+ */
+#ifndef SHA1_OPENSSL_H
+#define SHA1_OPENSSL_H
+#include <openssl/evp.h>
+
+struct openssl_SHA1_CTX {
+ EVP_MD_CTX *ectx;
+};
+
+typedef struct openssl_SHA1_CTX openssl_SHA1_CTX;
+
+static inline void openssl_SHA1_Init(struct openssl_SHA1_CTX *ctx)
+{
+ const EVP_MD *type = EVP_sha1();
+
+ ctx->ectx = EVP_MD_CTX_new();
+ if (!ctx->ectx)
+ die("EVP_MD_CTX_new: out of memory");
+
+ EVP_DigestInit_ex(ctx->ectx, type, NULL);
+}
+
+static inline void openssl_SHA1_Update(struct openssl_SHA1_CTX *ctx,
+ const void *data,
+ size_t len)
+{
+ EVP_DigestUpdate(ctx->ectx, data, len);
+}
+
+static inline void openssl_SHA1_Final(unsigned char *digest,
+ struct openssl_SHA1_CTX *ctx)
+{
+ EVP_DigestFinal_ex(ctx->ectx, digest, NULL);
+ EVP_MD_CTX_free(ctx->ectx);
+}
+
+static inline void openssl_SHA1_Clone(struct openssl_SHA1_CTX *dst,
+ const struct openssl_SHA1_CTX *src)
+{
+ EVP_MD_CTX_copy_ex(dst->ectx, src->ectx);
+}
+
+#define platform_SHA_CTX openssl_SHA1_CTX
+#define platform_SHA1_Init openssl_SHA1_Init
+#define platform_SHA1_Clone openssl_SHA1_Clone
+#define platform_SHA1_Update openssl_SHA1_Update
+#define platform_SHA1_Final openssl_SHA1_Final
+
+#endif /* SHA1_OPENSSL_H */
diff --git a/sha1dc/sha1.c b/sha1dc/sha1.c
index dede2cb..f993ef9 100644
--- a/sha1dc/sha1.c
+++ b/sha1dc/sha1.c
@@ -88,7 +88,7 @@
/*
* Should define Big Endian for a whitelist of known processors. See
* https://sourceforge.net/p/predef/wiki/Endianness/ and
- * http://www.oracle.com/technetwork/server-storage/solaris/portingtosolaris-138514.html
+ * https://web.archive.org/web/20140421151132/http://www.perforce.com/perforce/doc.current/manuals/p4sag/chapter.superuser.html
*/
#define SHA1DC_BIGENDIAN
diff --git a/sha1dc_git.c b/sha1dc_git.c
index 5c300e8..9b675a0 100644
--- a/sha1dc_git.c
+++ b/sha1dc_git.c
@@ -1,4 +1,6 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "sha1dc_git.h"
+#include "hex.h"
#ifdef DC_SHA1_EXTERNAL
/*
diff --git a/sha1dc_git.h b/sha1dc_git.h
index 41e1c3f..60e3ce8 100644
--- a/sha1dc_git.h
+++ b/sha1dc_git.h
@@ -17,6 +17,7 @@ void git_SHA1DCInit(SHA1_CTX *);
void git_SHA1DCFinal(unsigned char [20], SHA1_CTX *);
void git_SHA1DCUpdate(SHA1_CTX *ctx, const void *data, unsigned long len);
+#define platform_SHA_IS_SHA1DC /* used by "test-tool sha1-is-sha1dc" */
#define platform_SHA_CTX SHA1_CTX
#define platform_SHA1_Init git_SHA1DCInit
#define platform_SHA1_Update git_SHA1DCUpdate
diff --git a/sha256/gcrypt.h b/sha256/gcrypt.h
index 501da5e..17a90f1 100644
--- a/sha256/gcrypt.h
+++ b/sha256/gcrypt.h
@@ -7,22 +7,25 @@
typedef gcry_md_hd_t gcrypt_SHA256_CTX;
-inline void gcrypt_SHA256_Init(gcrypt_SHA256_CTX *ctx)
+static inline void gcrypt_SHA256_Init(gcrypt_SHA256_CTX *ctx)
{
- gcry_md_open(ctx, GCRY_MD_SHA256, 0);
+ gcry_error_t err = gcry_md_open(ctx, GCRY_MD_SHA256, 0);
+ if (err)
+ die("gcry_md_open: %s", gcry_strerror(err));
}
-inline void gcrypt_SHA256_Update(gcrypt_SHA256_CTX *ctx, const void *data, size_t len)
+static inline void gcrypt_SHA256_Update(gcrypt_SHA256_CTX *ctx, const void *data, size_t len)
{
gcry_md_write(*ctx, data, len);
}
-inline void gcrypt_SHA256_Final(unsigned char *digest, gcrypt_SHA256_CTX *ctx)
+static inline void gcrypt_SHA256_Final(unsigned char *digest, gcrypt_SHA256_CTX *ctx)
{
memcpy(digest, gcry_md_read(*ctx, GCRY_MD_SHA256), SHA256_DIGEST_SIZE);
+ gcry_md_close(*ctx);
}
-inline void gcrypt_SHA256_Clone(gcrypt_SHA256_CTX *dst, const gcrypt_SHA256_CTX *src)
+static inline void gcrypt_SHA256_Clone(gcrypt_SHA256_CTX *dst, const gcrypt_SHA256_CTX *src)
{
gcry_md_copy(dst, *src);
}
diff --git a/sha256/nettle.h b/sha256/nettle.h
new file mode 100644
index 0000000..b63e1c8
--- /dev/null
+++ b/sha256/nettle.h
@@ -0,0 +1,31 @@
+#ifndef SHA256_NETTLE_H
+#define SHA256_NETTLE_H
+
+#include <nettle/sha2.h>
+
+typedef struct sha256_ctx nettle_SHA256_CTX;
+
+static inline void nettle_SHA256_Init(nettle_SHA256_CTX *ctx)
+{
+ sha256_init(ctx);
+}
+
+static inline void nettle_SHA256_Update(nettle_SHA256_CTX *ctx,
+ const void *data,
+ size_t len)
+{
+ sha256_update(ctx, len, data);
+}
+
+static inline void nettle_SHA256_Final(unsigned char *digest,
+ nettle_SHA256_CTX *ctx)
+{
+ sha256_digest(ctx, SHA256_DIGEST_SIZE, digest);
+}
+
+#define platform_SHA256_CTX nettle_SHA256_CTX
+#define platform_SHA256_Init nettle_SHA256_Init
+#define platform_SHA256_Update nettle_SHA256_Update
+#define platform_SHA256_Final nettle_SHA256_Final
+
+#endif
diff --git a/sha256/openssl.h b/sha256/openssl.h
new file mode 100644
index 0000000..c1083d9
--- /dev/null
+++ b/sha256/openssl.h
@@ -0,0 +1,49 @@
+/* wrappers for the EVP API of OpenSSL 3+ */
+#ifndef SHA256_OPENSSL_H
+#define SHA256_OPENSSL_H
+#include <openssl/evp.h>
+
+struct openssl_SHA256_CTX {
+ EVP_MD_CTX *ectx;
+};
+
+typedef struct openssl_SHA256_CTX openssl_SHA256_CTX;
+
+static inline void openssl_SHA256_Init(struct openssl_SHA256_CTX *ctx)
+{
+ const EVP_MD *type = EVP_sha256();
+
+ ctx->ectx = EVP_MD_CTX_new();
+ if (!ctx->ectx)
+ die("EVP_MD_CTX_new: out of memory");
+
+ EVP_DigestInit_ex(ctx->ectx, type, NULL);
+}
+
+static inline void openssl_SHA256_Update(struct openssl_SHA256_CTX *ctx,
+ const void *data,
+ size_t len)
+{
+ EVP_DigestUpdate(ctx->ectx, data, len);
+}
+
+static inline void openssl_SHA256_Final(unsigned char *digest,
+ struct openssl_SHA256_CTX *ctx)
+{
+ EVP_DigestFinal_ex(ctx->ectx, digest, NULL);
+ EVP_MD_CTX_free(ctx->ectx);
+}
+
+static inline void openssl_SHA256_Clone(struct openssl_SHA256_CTX *dst,
+ const struct openssl_SHA256_CTX *src)
+{
+ EVP_MD_CTX_copy_ex(dst->ectx, src->ectx);
+}
+
+#define platform_SHA256_CTX openssl_SHA256_CTX
+#define platform_SHA256_Init openssl_SHA256_Init
+#define platform_SHA256_Clone openssl_SHA256_Clone
+#define platform_SHA256_Update openssl_SHA256_Update
+#define platform_SHA256_Final openssl_SHA256_Final
+
+#endif /* SHA256_OPENSSL_H */
diff --git a/shallow.c b/shallow.c
index 8cb768e..7ff50dd 100644
--- a/shallow.c
+++ b/shallow.c
@@ -1,20 +1,23 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "hex.h"
#include "repository.h"
#include "tempfile.h"
#include "lockfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "commit.h"
#include "tag.h"
#include "pkt-line.h"
-#include "remote.h"
#include "refs.h"
#include "oid-array.h"
+#include "path.h"
#include "diff.h"
#include "revision.h"
#include "commit-slab.h"
#include "list-objects.h"
#include "commit-reach.h"
#include "shallow.h"
+#include "statinfo.h"
+#include "trace.h"
void set_alternate_shallow_file(struct repository *r, const char *path, int override)
{
@@ -30,12 +33,14 @@ int register_shallow(struct repository *r, const struct object_id *oid)
{
struct commit_graft *graft =
xmalloc(sizeof(struct commit_graft));
- struct commit *commit = lookup_commit(the_repository, oid);
+ struct commit *commit = lookup_commit(r, oid);
oidcpy(&graft->oid, oid);
graft->nr_parent = -1;
- if (commit && commit->object.parsed)
+ if (commit && commit->object.parsed) {
+ free_commit_list(commit->parents);
commit->parents = NULL;
+ }
return register_commit_graft(r, graft, 0);
}
@@ -247,7 +252,7 @@ struct commit_list *get_shallow_commits_by_rev_list(int ac, const char **av,
struct commit *c = p->item;
struct commit_list *parent;
- if (parse_commit(c))
+ if (repo_parse_commit(the_repository, c))
die("unable to parse commit %s",
oid_to_hex(&c->object.oid));
@@ -301,7 +306,7 @@ static int write_one_shallow(const struct commit_graft *graft, void *cb_data)
if (graft->nr_parent != -1)
return 0;
if (data->flags & QUICK) {
- if (!has_object_file(&graft->oid))
+ if (!repo_has_object_file(the_repository, &graft->oid))
return 0;
} else if (data->flags & SEEN_ONLY) {
struct commit *c = lookup_commit(the_repository, &graft->oid);
@@ -466,7 +471,7 @@ void prepare_shallow_info(struct shallow_info *info, struct oid_array *sa)
ALLOC_ARRAY(info->ours, sa->nr);
ALLOC_ARRAY(info->theirs, sa->nr);
for (i = 0; i < sa->nr; i++) {
- if (has_object_file(sa->oid + i)) {
+ if (repo_has_object_file(the_repository, sa->oid + i)) {
struct commit_graft *graft;
graft = lookup_commit_graft(the_repository,
&sa->oid[i]);
@@ -494,7 +499,7 @@ void remove_nonexistent_theirs_shallow(struct shallow_info *info)
for (i = dst = 0; i < info->nr_theirs; i++) {
if (i != dst)
info->theirs[dst] = info->theirs[i];
- if (has_object_file(oid + info->theirs[i]))
+ if (repo_has_object_file(the_repository, oid + info->theirs[i]))
dst++;
}
info->nr_theirs = dst;
@@ -583,7 +588,7 @@ static void paint_down(struct paint_info *info, const struct object_id *oid,
if (c->object.flags & BOTTOM)
continue;
- if (parse_commit(c))
+ if (repo_parse_commit(the_repository, c))
die("unable to parse commit %s",
oid_to_hex(&c->object.oid));
@@ -604,8 +609,10 @@ static void paint_down(struct paint_info *info, const struct object_id *oid,
free(tmp);
}
-static int mark_uninteresting(const char *refname, const struct object_id *oid,
- int flags, void *cb_data)
+static int mark_uninteresting(const char *refname UNUSED,
+ const struct object_id *oid,
+ int flags UNUSED,
+ void *cb_data UNUSED)
{
struct commit *commit = lookup_commit_reference_gently(the_repository,
oid, 1);
@@ -715,8 +722,10 @@ struct commit_array {
int nr, alloc;
};
-static int add_ref(const char *refname, const struct object_id *oid,
- int flags, void *cb_data)
+static int add_ref(const char *refname UNUSED,
+ const struct object_id *oid,
+ int flags UNUSED,
+ void *cb_data)
{
struct commit_array *ca = cb_data;
ALLOC_GROW(ca->commits, ca->nr + 1, ca->alloc);
@@ -785,12 +794,16 @@ static void post_assign_shallow(struct shallow_info *info,
if (!*bitmap)
continue;
for (j = 0; j < bitmap_nr; j++)
- if (bitmap[0][j] &&
- /* Step 7, reachability test at commit level */
- !in_merge_bases_many(c, ca.nr, ca.commits)) {
- update_refstatus(ref_status, info->ref->nr, *bitmap);
- dst++;
- break;
+ if (bitmap[0][j]) {
+ /* Step 7, reachability test at commit level */
+ int ret = repo_in_merge_bases_many(the_repository, c, ca.nr, ca.commits, 1);
+ if (ret < 0)
+ exit(128);
+ if (!ret) {
+ update_refstatus(ref_status, info->ref->nr, *bitmap);
+ dst++;
+ break;
+ }
}
}
info->nr_ours = dst;
@@ -815,9 +828,13 @@ int delayed_reachability_test(struct shallow_info *si, int c)
si->nr_commits = ca.nr;
}
- si->reachable[c] = in_merge_bases_many(commit,
- si->nr_commits,
- si->commits);
+ si->reachable[c] = repo_in_merge_bases_many(the_repository,
+ commit,
+ si->nr_commits,
+ si->commits,
+ 1);
+ if (si->reachable[c] < 0)
+ exit(128);
si->need_reachability_test[c] = 0;
}
return si->reachable[c];
diff --git a/shallow.h b/shallow.h
index aba6ff5..e9ca7e4 100644
--- a/shallow.h
+++ b/shallow.h
@@ -6,6 +6,8 @@
#include "repository.h"
#include "strbuf.h"
+struct oid_array;
+
void set_alternate_shallow_file(struct repository *r, const char *path, int override);
int register_shallow(struct repository *r, const struct object_id *oid);
int unregister_shallow(const struct object_id *oid);
diff --git a/shared.mak b/shared.mak
index 4330192..29bebd3 100644
--- a/shared.mak
+++ b/shared.mak
@@ -37,13 +37,13 @@ space := $(empty) $(empty)
QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
QUIET_SUBDIR1 =
-ifneq ($(findstring w,$(MAKEFLAGS)),w)
+ifneq ($(findstring w,$(firstword -$(MAKEFLAGS))),w)
PRINT_DIR = --no-print-directory
else # "make -w"
NO_SUBDIR = :
endif
-ifneq ($(findstring s,$(MAKEFLAGS)),s)
+ifneq ($(findstring s,$(firstword -$(MAKEFLAGS))),s)
ifndef V
## common
QUIET_SUBDIR0 = +@subdir=
@@ -60,6 +60,7 @@ ifndef V
QUIET_AR = @echo ' ' AR $@;
QUIET_LINK = @echo ' ' LINK $@;
QUIET_BUILT_IN = @echo ' ' BUILTIN $@;
+ QUIET_CP = @echo ' ' CP $< $@;
QUIET_LNCP = @echo ' ' LN/CP $@;
QUIET_XGETTEXT = @echo ' ' XGETTEXT $@;
QUIET_MSGINIT = @echo ' ' MSGINIT $@;
@@ -69,7 +70,11 @@ ifndef V
QUIET_SP = @echo ' ' SP $<;
QUIET_HDR = @echo ' ' HDR $(<:hcc=h);
QUIET_RC = @echo ' ' RC $@;
- QUIET_SPATCH = @echo ' ' SPATCH $<;
+
+## Used in "Makefile": SPATCH
+ QUIET_SPATCH = @echo ' ' SPATCH $< \>$@;
+ QUIET_SPATCH_TEST = @echo ' ' SPATCH TEST $(@:.build/%=%);
+ QUIET_SPATCH_CAT = @echo ' ' SPATCH CAT $(@:%.patch=%.d/)\*\*.patch \>$@;
## Used in "Documentation/Makefile"
QUIET_ASCIIDOC = @echo ' ' ASCIIDOC $@;
@@ -103,3 +108,11 @@ endif
define mkdir_p_parent_template
$(if $(wildcard $(@D)),,$(QUIET_MKDIR_P_PARENT)$(shell mkdir -p $(@D)))
endef
+
+## Getting sick of writing -L$(SOMELIBDIR) $(CC_LD_DYNPATH)$(SOMELIBDIR)?
+## Write $(call libpath_template,$(SOMELIBDIR)) instead, perhaps?
+## With CC_LD_DYNPATH set to either an empty string or to "-L", the
+## the directory is not shown the second time.
+define libpath_template
+-L$(1) $(if $(filter-out -L,$(CC_LD_DYNPATH)),$(CC_LD_DYNPATH)$(1))
+endef
diff --git a/shell.c b/shell.c
index 811e13b..2ece8b1 100644
--- a/shell.c
+++ b/shell.c
@@ -1,10 +1,9 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "quote.h"
#include "exec-cmd.h"
#include "strbuf.h"
#include "run-command.h"
#include "alias.h"
-#include "prompt.h"
#define COMMAND_DIR "git-shell-commands"
#define HELP_COMMAND COMMAND_DIR "/help"
@@ -47,42 +46,71 @@ static void cd_to_homedir(void)
die("could not chdir to user's home directory");
}
+#define MAX_INTERACTIVE_COMMAND (4*1024*1024)
+
static void run_shell(void)
{
int done = 0;
- static const char *help_argv[] = { HELP_COMMAND, NULL };
+ struct child_process help_cmd = CHILD_PROCESS_INIT;
if (!access(NOLOGIN_COMMAND, F_OK)) {
/* Interactive login disabled. */
- const char *argv[] = { NOLOGIN_COMMAND, NULL };
+ struct child_process nologin_cmd = CHILD_PROCESS_INIT;
int status;
- status = run_command_v_opt(argv, 0);
+ strvec_push(&nologin_cmd.args, NOLOGIN_COMMAND);
+ status = run_command(&nologin_cmd);
if (status < 0)
exit(127);
exit(status);
}
/* Print help if enabled */
- run_command_v_opt(help_argv, RUN_SILENT_EXEC_FAILURE);
+ help_cmd.silent_exec_failure = 1;
+ strvec_push(&help_cmd.args, HELP_COMMAND);
+ run_command(&help_cmd);
do {
- struct strbuf line = STRBUF_INIT;
const char *prog;
char *full_cmd;
char *rawargs;
+ size_t len;
char *split_args;
const char **argv;
int code;
int count;
fprintf(stderr, "git> ");
- if (git_read_line_interactively(&line) == EOF) {
+
+ /*
+ * Avoid using a strbuf or git_read_line_interactively() here.
+ * We don't want to allocate arbitrary amounts of memory on
+ * behalf of a possibly untrusted client, and we're subject to
+ * OS limits on command length anyway.
+ */
+ fflush(stdout);
+ rawargs = xmalloc(MAX_INTERACTIVE_COMMAND);
+ if (!fgets(rawargs, MAX_INTERACTIVE_COMMAND, stdin)) {
fprintf(stderr, "\n");
- strbuf_release(&line);
+ free(rawargs);
break;
}
- rawargs = strbuf_detach(&line, NULL);
+ len = strlen(rawargs);
+
+ /*
+ * If we truncated due to our input buffer size, reject the
+ * command. That's better than running bogus input, and
+ * there's a good chance it's just malicious garbage anyway.
+ */
+ if (len >= MAX_INTERACTIVE_COMMAND - 1)
+ die("invalid command format: input too long");
+
+ if (len > 0 && rawargs[len - 1] == '\n') {
+ if (--len > 0 && rawargs[len - 1] == '\r')
+ --len;
+ rawargs[len] = '\0';
+ }
+
split_args = xstrdup(rawargs);
count = split_cmdline(split_args, &argv);
if (count < 0) {
@@ -99,9 +127,13 @@ static void run_shell(void)
!strcmp(prog, "exit") || !strcmp(prog, "bye")) {
done = 1;
} else if (is_valid_cmd_name(prog)) {
+ struct child_process cmd = CHILD_PROCESS_INIT;
+
full_cmd = make_cmd(prog);
argv[0] = full_cmd;
- code = run_command_v_opt(argv, RUN_SILENT_EXEC_FAILURE);
+ cmd.silent_exec_failure = 1;
+ strvec_pushv(&cmd.args, argv);
+ code = run_command(&cmd);
if (code == -1 && errno == ENOENT) {
fprintf(stderr, "unrecognized command '%s'\n", prog);
}
diff --git a/shortlog.h b/shortlog.h
index 3f7e9aa..28d04f9 100644
--- a/shortlog.h
+++ b/shortlog.h
@@ -2,6 +2,7 @@
#define SHORTLOG_H
#include "string-list.h"
+#include "date.h"
struct commit;
@@ -15,13 +16,16 @@ struct shortlog {
int in2;
int user_format;
int abbrev;
+ struct date_mode date_mode;
enum {
SHORTLOG_GROUP_AUTHOR = (1 << 0),
SHORTLOG_GROUP_COMMITTER = (1 << 1),
SHORTLOG_GROUP_TRAILER = (1 << 2),
+ SHORTLOG_GROUP_FORMAT = (1 << 3),
} groups;
struct string_list trailers;
+ struct string_list format;
int email;
struct string_list mailmap;
@@ -29,6 +33,7 @@ struct shortlog {
};
void shortlog_init(struct shortlog *log);
+void shortlog_finish_setup(struct shortlog *log);
void shortlog_add_commit(struct shortlog *log, struct commit *commit);
diff --git a/sideband.c b/sideband.c
index 85bddfd..5d89071 100644
--- a/sideband.c
+++ b/sideband.c
@@ -1,9 +1,12 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "color.h"
#include "config.h"
+#include "editor.h"
+#include "gettext.h"
#include "sideband.h"
#include "help.h"
#include "pkt-line.h"
+#include "write-or-die.h"
struct keyword_entry {
/*
@@ -66,7 +69,10 @@ void list_config_color_sideband_slots(struct string_list *list, const char *pref
* of the line. This should be called for a single line only, which is
* passed as the first N characters of the SRC array.
*
- * NEEDSWORK: use "size_t n" instead for clarity.
+ * It is fine to use "int n" here instead of "size_t n" as all calls to this
+ * function pass an 'int' parameter. Additionally, the buffer involved in
+ * storing these 'int' values takes input from a packet via the pkt-line
+ * interface, which is capable of transferring only 64kB at a time.
*/
static void maybe_colorize_sideband(struct strbuf *dest, const char *src, int n)
{
@@ -214,7 +220,7 @@ int demultiplex_sideband(const char *me, int status,
}
strbuf_addch(scratch, *brk);
- xwrite(2, scratch->buf, scratch->len);
+ write_in_full(2, scratch->buf, scratch->len);
strbuf_reset(scratch);
b = brk + 1;
@@ -241,7 +247,7 @@ cleanup:
die("%s", scratch->buf);
if (scratch->len) {
strbuf_addch(scratch, '\n');
- xwrite(2, scratch->buf, scratch->len);
+ write_in_full(2, scratch->buf, scratch->len);
}
strbuf_release(scratch);
return 1;
diff --git a/sigchain.c b/sigchain.c
index 022677b..66123bd 100644
--- a/sigchain.c
+++ b/sigchain.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "sigchain.h"
#define SIGCHAIN_MAX_SIGNALS 32
diff --git a/sparse-index.c b/sparse-index.c
index e4a54ce..e48e40c 100644
--- a/sparse-index.c
+++ b/sparse-index.c
@@ -1,4 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "environment.h"
+#include "gettext.h"
+#include "name-hash.h"
+#include "read-cache-ll.h"
#include "repository.h"
#include "sparse-index.h"
#include "tree.h"
@@ -7,7 +11,7 @@
#include "cache-tree.h"
#include "config.h"
#include "dir.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
struct modify_index_context {
struct index_state *write;
@@ -128,9 +132,6 @@ int is_sparse_index_allowed(struct index_state *istate, int flags)
if (!core_apply_sparse_checkout || !core_sparse_checkout_cone)
return 0;
- if (!istate->repo)
- istate->repo = the_repository;
-
if (!(flags & SPARSE_INDEX_MEMORY_ONLY)) {
int test_env;
@@ -299,7 +300,7 @@ void expand_index(struct index_state *istate, struct pattern_list *pl)
* If the index is already full, then keep it full. We will convert
* it to a sparse index on write, if possible.
*/
- if (!istate || istate->sparse_index == INDEX_EXPANDED)
+ if (istate->sparse_index == INDEX_EXPANDED)
return;
/*
@@ -327,9 +328,6 @@ void expand_index(struct index_state *istate, struct pattern_list *pl)
pl = NULL;
}
- if (!istate->repo)
- istate->repo = the_repository;
-
/*
* A NULL pattern set indicates we are expanding a full index, so
* we use a special region name that indicates the full expansion.
@@ -393,7 +391,7 @@ void expand_index(struct index_state *istate, struct pattern_list *pl)
strbuf_setlen(&base, 0);
strbuf_add(&base, ce->name, strlen(ce->name));
- read_tree_at(istate->repo, tree, &base, &ps,
+ read_tree_at(istate->repo, tree, &base, 0, &ps,
add_path_to_index, &ctx);
/* free directory entries. full entries are re-used */
@@ -424,6 +422,8 @@ void expand_index(struct index_state *istate, struct pattern_list *pl)
void ensure_full_index(struct index_state *istate)
{
+ if (!istate)
+ BUG("ensure_full_index() must get an index!");
expand_index(istate, NULL);
}
@@ -493,24 +493,42 @@ void clear_skip_worktree_from_present_files(struct index_state *istate)
int dir_found = 1;
int i;
+ int path_count[2] = {0, 0};
+ int restarted = 0;
if (!core_apply_sparse_checkout ||
sparse_expect_files_outside_of_patterns)
return;
+ trace2_region_enter("index", "clear_skip_worktree_from_present_files",
+ istate->repo);
restart:
for (i = 0; i < istate->cache_nr; i++) {
struct cache_entry *ce = istate->cache[i];
- if (ce_skip_worktree(ce) &&
- path_found(ce->name, &last_dirname, &dir_len, &dir_found)) {
- if (S_ISSPARSEDIR(ce->ce_mode)) {
- ensure_full_index(istate);
- goto restart;
+ if (ce_skip_worktree(ce)) {
+ path_count[restarted]++;
+ if (path_found(ce->name, &last_dirname, &dir_len, &dir_found)) {
+ if (S_ISSPARSEDIR(ce->ce_mode)) {
+ if (restarted)
+ BUG("ensure-full-index did not fully flatten?");
+ ensure_full_index(istate);
+ restarted = 1;
+ goto restart;
+ }
+ ce->ce_flags &= ~CE_SKIP_WORKTREE;
}
- ce->ce_flags &= ~CE_SKIP_WORKTREE;
}
}
+
+ if (path_count[0])
+ trace2_data_intmax("index", istate->repo,
+ "sparse_path_count", path_count[0]);
+ if (restarted)
+ trace2_data_intmax("index", istate->repo,
+ "sparse_path_count_full", path_count[1]);
+ trace2_region_leave("index", "clear_skip_worktree_from_present_files",
+ istate->repo);
}
/*
@@ -529,12 +547,9 @@ void expand_to_path(struct index_state *istate,
if (in_expand_to_path)
return;
- if (!istate || !istate->sparse_index)
+ if (!istate->sparse_index)
return;
- if (!istate->repo)
- istate->repo = the_repository;
-
in_expand_to_path = 1;
/*
@@ -564,8 +579,9 @@ void expand_to_path(struct index_state *istate,
replace++;
temp = *replace;
*replace = '\0';
+ substr_len = replace - path_mutable.buf;
if (index_file_exists(istate, path_mutable.buf,
- path_mutable.len, icase)) {
+ substr_len, icase)) {
/*
* We found a parent directory in the name-hash
* hashtable, because only sparse directory entries
@@ -578,7 +594,6 @@ void expand_to_path(struct index_state *istate,
}
*replace = temp;
- substr_len = replace - path_mutable.buf;
}
cleanup:
diff --git a/sparse-index.h b/sparse-index.h
index 59a92d8..a16f3e6 100644
--- a/sparse-index.h
+++ b/sparse-index.h
@@ -37,4 +37,6 @@ struct pattern_list;
*/
void expand_index(struct index_state *istate, struct pattern_list *pl);
+void ensure_full_index(struct index_state *istate);
+
#endif
diff --git a/split-index.c b/split-index.c
index 9d0ccc3..8c38687 100644
--- a/split-index.c
+++ b/split-index.c
@@ -1,5 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "gettext.h"
+#include "hash.h"
+#include "mem-pool.h"
+#include "read-cache-ll.h"
#include "split-index.h"
+#include "strbuf.h"
#include "ewah/ewok.h"
struct split_index *init_split_index(struct index_state *istate)
@@ -90,7 +95,8 @@ void move_cache_to_base_index(struct index_state *istate)
mem_pool_combine(istate->ce_mem_pool, istate->split_index->base->ce_mem_pool);
}
- CALLOC_ARRAY(si->base, 1);
+ ALLOC_ARRAY(si->base, 1);
+ index_state_init(si->base, istate->repo);
si->base->version = istate->version;
/* zero timestamp disables racy test in ce_write_index() */
si->base->timestamp = istate->timestamp;
diff --git a/split-index.h b/split-index.h
index 7a435ca..15a29cd 100644
--- a/split-index.h
+++ b/split-index.h
@@ -1,7 +1,7 @@
#ifndef SPLIT_INDEX_H
#define SPLIT_INDEX_H
-#include "cache.h"
+#include "hash-ll.h"
struct index_state;
struct strbuf;
diff --git a/statinfo.c b/statinfo.c
new file mode 100644
index 0000000..3c6bc04
--- /dev/null
+++ b/statinfo.c
@@ -0,0 +1,130 @@
+#include "git-compat-util.h"
+#include "environment.h"
+#include "statinfo.h"
+
+/*
+ * Munge st_size into an unsigned int.
+ */
+static unsigned int munge_st_size(off_t st_size) {
+ unsigned int sd_size = st_size;
+
+ /*
+ * If the file is an exact multiple of 4 GiB, modify the value so it
+ * doesn't get marked as racily clean (zero).
+ */
+ if (!sd_size && st_size)
+ return 0x80000000;
+ else
+ return sd_size;
+}
+
+void fill_stat_data(struct stat_data *sd, struct stat *st)
+{
+ sd->sd_ctime.sec = (unsigned int)st->st_ctime;
+ sd->sd_mtime.sec = (unsigned int)st->st_mtime;
+ sd->sd_ctime.nsec = ST_CTIME_NSEC(*st);
+ sd->sd_mtime.nsec = ST_MTIME_NSEC(*st);
+ sd->sd_dev = st->st_dev;
+ sd->sd_ino = st->st_ino;
+ sd->sd_uid = st->st_uid;
+ sd->sd_gid = st->st_gid;
+ sd->sd_size = munge_st_size(st->st_size);
+}
+
+static void set_times(struct stat *st, const struct stat_data *sd)
+{
+ st->st_ctime = sd->sd_ctime.sec;
+ st->st_mtime = sd->sd_mtime.sec;
+#ifdef NO_NSEC
+ ; /* nothing */
+#else
+#ifdef USE_ST_TIMESPEC
+ st->st_ctimespec.tv_nsec = sd->sd_ctime.nsec;
+ st->st_mtimespec.tv_nsec = sd->sd_mtime.nsec;
+#else
+ st->st_ctim.tv_nsec = sd->sd_ctime.nsec;
+ st->st_mtim.tv_nsec = sd->sd_mtime.nsec;
+#endif
+#endif
+}
+
+void fake_lstat_data(const struct stat_data *sd, struct stat *st)
+{
+ set_times(st, sd);
+ st->st_dev = sd->sd_dev;
+ st->st_ino = sd->sd_ino;
+ st->st_uid = sd->sd_uid;
+ st->st_gid = sd->sd_gid;
+ st->st_size = sd->sd_size;
+}
+
+int match_stat_data(const struct stat_data *sd, struct stat *st)
+{
+ int changed = 0;
+
+ if (sd->sd_mtime.sec != (unsigned int)st->st_mtime)
+ changed |= MTIME_CHANGED;
+ if (trust_ctime && check_stat &&
+ sd->sd_ctime.sec != (unsigned int)st->st_ctime)
+ changed |= CTIME_CHANGED;
+
+#ifdef USE_NSEC
+ if (check_stat && sd->sd_mtime.nsec != ST_MTIME_NSEC(*st))
+ changed |= MTIME_CHANGED;
+ if (trust_ctime && check_stat &&
+ sd->sd_ctime.nsec != ST_CTIME_NSEC(*st))
+ changed |= CTIME_CHANGED;
+#endif
+
+ if (check_stat) {
+ if (sd->sd_uid != (unsigned int) st->st_uid ||
+ sd->sd_gid != (unsigned int) st->st_gid)
+ changed |= OWNER_CHANGED;
+ if (sd->sd_ino != (unsigned int) st->st_ino)
+ changed |= INODE_CHANGED;
+ }
+
+#ifdef USE_STDEV
+ /*
+ * st_dev breaks on network filesystems where different
+ * clients will have different views of what "device"
+ * the filesystem is on
+ */
+ if (check_stat && sd->sd_dev != (unsigned int) st->st_dev)
+ changed |= INODE_CHANGED;
+#endif
+
+ if (sd->sd_size != munge_st_size(st->st_size))
+ changed |= DATA_CHANGED;
+
+ return changed;
+}
+
+void stat_validity_clear(struct stat_validity *sv)
+{
+ FREE_AND_NULL(sv->sd);
+}
+
+int stat_validity_check(struct stat_validity *sv, const char *path)
+{
+ struct stat st;
+
+ if (stat(path, &st) < 0)
+ return sv->sd == NULL;
+ if (!sv->sd)
+ return 0;
+ return S_ISREG(st.st_mode) && !match_stat_data(sv->sd, &st);
+}
+
+void stat_validity_update(struct stat_validity *sv, int fd)
+{
+ struct stat st;
+
+ if (fstat(fd, &st) < 0 || !S_ISREG(st.st_mode))
+ stat_validity_clear(sv);
+ else {
+ if (!sv->sd)
+ CALLOC_ARRAY(sv->sd, 1);
+ fill_stat_data(sv->sd, &st);
+ }
+}
diff --git a/statinfo.h b/statinfo.h
new file mode 100644
index 0000000..5b21a30
--- /dev/null
+++ b/statinfo.h
@@ -0,0 +1,97 @@
+#ifndef STATINFO_H
+#define STATINFO_H
+
+struct index_state;
+
+/*
+ * The "cache_time" is just the low 32 bits of the
+ * time. It doesn't matter if it overflows - we only
+ * check it for equality in the 32 bits we save.
+ */
+struct cache_time {
+ uint32_t sec;
+ uint32_t nsec;
+};
+
+struct stat_data {
+ struct cache_time sd_ctime;
+ struct cache_time sd_mtime;
+ unsigned int sd_dev;
+ unsigned int sd_ino;
+ unsigned int sd_uid;
+ unsigned int sd_gid;
+ unsigned int sd_size;
+};
+
+/*
+ * A struct to encapsulate the concept of whether a file has changed
+ * since we last checked it. This uses criteria similar to those used
+ * for the index.
+ */
+struct stat_validity {
+ struct stat_data *sd;
+};
+
+#define MTIME_CHANGED 0x0001
+#define CTIME_CHANGED 0x0002
+#define OWNER_CHANGED 0x0004
+#define MODE_CHANGED 0x0008
+#define INODE_CHANGED 0x0010
+#define DATA_CHANGED 0x0020
+#define TYPE_CHANGED 0x0040
+
+/*
+ * Record to sd the data from st that we use to check whether a file
+ * might have changed.
+ */
+void fill_stat_data(struct stat_data *sd, struct stat *st);
+
+/*
+ * The inverse of the above. When we know the cache_entry that
+ * contains sd is up-to-date, but still need to pretend we called
+ * lstat() to learn that fact, this function fills "st" enough to
+ * fool ie_match_stat().
+ */
+void fake_lstat_data(const struct stat_data *sd, struct stat *st);
+
+/*
+ * Return 0 if st is consistent with a file not having been changed
+ * since sd was filled. If there are differences, return a
+ * combination of MTIME_CHANGED, CTIME_CHANGED, OWNER_CHANGED,
+ * INODE_CHANGED, and DATA_CHANGED.
+ */
+int match_stat_data(const struct stat_data *sd, struct stat *st);
+
+void stat_validity_clear(struct stat_validity *sv);
+
+/*
+ * Returns 1 if the path is a regular file (or a symlink to a regular
+ * file) and matches the saved stat_validity, 0 otherwise. A missing
+ * or inaccessible file is considered a match if the struct was just
+ * initialized, or if the previous update found an inaccessible file.
+ */
+int stat_validity_check(struct stat_validity *sv, const char *path);
+
+/*
+ * Update the stat_validity from a file opened at descriptor fd. If
+ * the file is missing, inaccessible, or not a regular file, then
+ * future calls to stat_validity_check will match iff one of those
+ * conditions continues to be true.
+ */
+void stat_validity_update(struct stat_validity *sv, int fd);
+
+#if defined(DT_UNKNOWN) && !defined(NO_D_TYPE_IN_DIRENT)
+#define DTYPE(de) ((de)->d_type)
+#else
+#undef DT_UNKNOWN
+#undef DT_DIR
+#undef DT_REG
+#undef DT_LNK
+#define DT_UNKNOWN 0
+#define DT_DIR 1
+#define DT_REG 2
+#define DT_LNK 3
+#define DTYPE(de) DT_UNKNOWN
+#endif
+
+#endif
diff --git a/strbuf.c b/strbuf.c
index dd9eb85..1492a08 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -1,5 +1,7 @@
-#include "cache.h"
-#include "refs.h"
+#include "git-compat-util.h"
+#include "gettext.h"
+#include "hex-ll.h"
+#include "strbuf.h"
#include "string-list.h"
#include "utf8.h"
#include "date.h"
@@ -22,6 +24,17 @@ int istarts_with(const char *str, const char *prefix)
return 0;
}
+int starts_with_mem(const char *str, size_t len, const char *prefix)
+{
+ const char *end = str + len;
+ for (; ; str++, prefix++) {
+ if (!*prefix)
+ return 1;
+ else if (str == end || *str != *prefix)
+ return 0;
+ }
+}
+
int skip_to_optional_arg_default(const char *str, const char *prefix,
const char **arg, const char *def)
{
@@ -338,18 +351,17 @@ void strbuf_addf(struct strbuf *sb, const char *fmt, ...)
}
static void add_lines(struct strbuf *out,
- const char *prefix1,
- const char *prefix2,
- const char *buf, size_t size)
+ const char *prefix,
+ const char *buf, size_t size,
+ int space_after_prefix)
{
while (size) {
- const char *prefix;
const char *next = memchr(buf, '\n', size);
next = next ? (next + 1) : (buf + size);
- prefix = ((prefix2 && (buf[0] == '\n' || buf[0] == '\t'))
- ? prefix2 : prefix1);
strbuf_addstr(out, prefix);
+ if (space_after_prefix && buf[0] != '\n' && buf[0] != '\t')
+ strbuf_addch(out, ' ');
strbuf_add(out, buf, next - buf);
size -= next - buf;
buf = next;
@@ -357,19 +369,14 @@ static void add_lines(struct strbuf *out,
strbuf_complete_line(out);
}
-void strbuf_add_commented_lines(struct strbuf *out, const char *buf, size_t size)
+void strbuf_add_commented_lines(struct strbuf *out, const char *buf,
+ size_t size, const char *comment_prefix)
{
- static char prefix1[3];
- static char prefix2[2];
-
- if (prefix1[0] != comment_line_char) {
- xsnprintf(prefix1, sizeof(prefix1), "%c ", comment_line_char);
- xsnprintf(prefix2, sizeof(prefix2), "%c", comment_line_char);
- }
- add_lines(out, prefix1, prefix2, buf, size);
+ add_lines(out, comment_prefix, buf, size, 1);
}
-void strbuf_commented_addf(struct strbuf *sb, const char *fmt, ...)
+void strbuf_commented_addf(struct strbuf *sb, const char *comment_prefix,
+ const char *fmt, ...)
{
va_list params;
struct strbuf buf = STRBUF_INIT;
@@ -379,7 +386,7 @@ void strbuf_commented_addf(struct strbuf *sb, const char *fmt, ...)
strbuf_vaddf(&buf, fmt, params);
va_end(params);
- strbuf_add_commented_lines(sb, buf.buf, buf.len);
+ strbuf_add_commented_lines(sb, buf.buf, buf.len, comment_prefix);
if (incomplete_line)
sb->buf[--sb->len] = '\0';
@@ -407,36 +414,19 @@ void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap)
strbuf_setlen(sb, sb->len + len);
}
-void strbuf_expand(struct strbuf *sb, const char *format, expand_fn_t fn,
- void *context)
+int strbuf_expand_step(struct strbuf *sb, const char **formatp)
{
- for (;;) {
- const char *percent;
- size_t consumed;
+ const char *format = *formatp;
+ const char *percent = strchrnul(format, '%');
- percent = strchrnul(format, '%');
- strbuf_add(sb, format, percent - format);
- if (!*percent)
- break;
- format = percent + 1;
-
- if (*format == '%') {
- strbuf_addch(sb, '%');
- format++;
- continue;
- }
-
- consumed = fn(sb, format, context);
- if (consumed)
- format += consumed;
- else
- strbuf_addch(sb, '%');
- }
+ strbuf_add(sb, format, percent - format);
+ if (!*percent)
+ return 0;
+ *formatp = percent + 1;
+ return 1;
}
-size_t strbuf_expand_literal_cb(struct strbuf *sb,
- const char *placeholder,
- void *context)
+size_t strbuf_expand_literal(struct strbuf *sb, const char *placeholder)
{
int ch;
@@ -455,20 +445,24 @@ size_t strbuf_expand_literal_cb(struct strbuf *sb,
return 0;
}
-size_t strbuf_expand_dict_cb(struct strbuf *sb, const char *placeholder,
- void *context)
+void strbuf_expand_bad_format(const char *format, const char *command)
{
- struct strbuf_expand_dict_entry *e = context;
- size_t len;
+ const char *end;
- for (; e->placeholder && (len = strlen(e->placeholder)); e++) {
- if (!strncmp(placeholder, e->placeholder, len)) {
- if (e->value)
- strbuf_addstr(sb, e->value);
- return len;
- }
- }
- return 0;
+ if (*format != '(')
+ /* TRANSLATORS: The first %s is a command like "ls-tree". */
+ die(_("bad %s format: element '%s' does not start with '('"),
+ command, format);
+
+ end = strchr(format + 1, ')');
+ if (!end)
+ /* TRANSLATORS: The first %s is a command like "ls-tree". */
+ die(_("bad %s format: element '%s' does not end in ')'"),
+ command, format);
+
+ /* TRANSLATORS: %s is a command like "ls-tree". */
+ die(_("bad %s format: %%%.*s"),
+ command, (int)(end - format + 1), format);
}
void strbuf_addbuf_percentquote(struct strbuf *dst, const struct strbuf *src)
@@ -713,11 +707,11 @@ static int strbuf_getdelim(struct strbuf *sb, FILE *fp, int term)
return 0;
}
-int strbuf_getline(struct strbuf *sb, FILE *fp)
+int strbuf_getdelim_strip_crlf(struct strbuf *sb, FILE *fp, int term)
{
- if (strbuf_getwholeline(sb, fp, '\n'))
+ if (strbuf_getwholeline(sb, fp, term))
return EOF;
- if (sb->buf[sb->len - 1] == '\n') {
+ if (term == '\n' && sb->buf[sb->len - 1] == '\n') {
strbuf_setlen(sb, sb->len - 1);
if (sb->len && sb->buf[sb->len - 1] == '\r')
strbuf_setlen(sb, sb->len - 1);
@@ -725,6 +719,11 @@ int strbuf_getline(struct strbuf *sb, FILE *fp)
return 0;
}
+int strbuf_getline(struct strbuf *sb, FILE *fp)
+{
+ return strbuf_getdelim_strip_crlf(sb, fp, '\n');
+}
+
int strbuf_getline_lf(struct strbuf *sb, FILE *fp)
{
return strbuf_getdelim(sb, fp, '\n');
@@ -774,7 +773,7 @@ ssize_t strbuf_read_file(struct strbuf *sb, const char *path, size_t hint)
void strbuf_add_lines(struct strbuf *out, const char *prefix,
const char *buf, size_t size)
{
- add_lines(out, prefix, NULL, buf, size);
+ add_lines(out, prefix, buf, size, 0);
}
void strbuf_addstr_xml_quoted(struct strbuf *buf, const char *s)
@@ -803,25 +802,6 @@ void strbuf_addstr_xml_quoted(struct strbuf *buf, const char *s)
}
}
-int is_rfc3986_reserved_or_unreserved(char ch)
-{
- if (is_rfc3986_unreserved(ch))
- return 1;
- switch (ch) {
- case '!': case '*': case '\'': case '(': case ')': case ';':
- case ':': case '@': case '&': case '=': case '+': case '$':
- case ',': case '/': case '?': case '#': case '[': case ']':
- return 1;
- }
- return 0;
-}
-
-int is_rfc3986_unreserved(char ch)
-{
- return isalnum(ch) ||
- ch == '-' || ch == '_' || ch == '.' || ch == '~';
-}
-
static void strbuf_add_urlencode(struct strbuf *sb, const char *s, size_t len,
char_predicate allow_unencoded_fn)
{
@@ -892,42 +872,6 @@ void strbuf_humanise_rate(struct strbuf *buf, off_t bytes)
strbuf_humanise(buf, bytes, 1);
}
-void strbuf_add_absolute_path(struct strbuf *sb, const char *path)
-{
- if (!*path)
- die("The empty string is not a valid path");
- if (!is_absolute_path(path)) {
- struct stat cwd_stat, pwd_stat;
- size_t orig_len = sb->len;
- char *cwd = xgetcwd();
- char *pwd = getenv("PWD");
- if (pwd && strcmp(pwd, cwd) &&
- !stat(cwd, &cwd_stat) &&
- (cwd_stat.st_dev || cwd_stat.st_ino) &&
- !stat(pwd, &pwd_stat) &&
- pwd_stat.st_dev == cwd_stat.st_dev &&
- pwd_stat.st_ino == cwd_stat.st_ino)
- strbuf_addstr(sb, pwd);
- else
- strbuf_addstr(sb, cwd);
- if (sb->len > orig_len && !is_dir_sep(sb->buf[sb->len - 1]))
- strbuf_addch(sb, '/');
- free(cwd);
- }
- strbuf_addstr(sb, path);
-}
-
-void strbuf_add_real_path(struct strbuf *sb, const char *path)
-{
- if (sb->len) {
- struct strbuf resolved = STRBUF_INIT;
- strbuf_realpath(&resolved, path, 1);
- strbuf_addbuf(sb, &resolved);
- strbuf_release(&resolved);
- } else
- strbuf_realpath(sb, path, 1);
-}
-
int printf_ln(const char *fmt, ...)
{
int ret;
@@ -1014,37 +958,20 @@ void strbuf_addftime(struct strbuf *sb, const char *fmt, const struct tm *tm,
* we want for %z, but the computation for %s has to convert to number
* of seconds.
*/
- for (;;) {
- const char *percent = strchrnul(fmt, '%');
- strbuf_add(&munged_fmt, fmt, percent - fmt);
- if (!*percent)
- break;
- fmt = percent + 1;
- switch (*fmt) {
- case '%':
+ while (strbuf_expand_step(&munged_fmt, &fmt)) {
+ if (skip_prefix(fmt, "%", &fmt))
strbuf_addstr(&munged_fmt, "%%");
- fmt++;
- break;
- case 's':
+ else if (skip_prefix(fmt, "s", &fmt))
strbuf_addf(&munged_fmt, "%"PRItime,
(timestamp_t)tm_to_time_t(tm) -
3600 * (tz_offset / 100) -
60 * (tz_offset % 100));
- fmt++;
- break;
- case 'z':
+ else if (skip_prefix(fmt, "z", &fmt))
strbuf_addf(&munged_fmt, "%+05d", tz_offset);
- fmt++;
- break;
- case 'Z':
- if (suppress_tz_name) {
- fmt++;
- break;
- }
- /* FALLTHROUGH */
- default:
+ else if (suppress_tz_name && skip_prefix(fmt, "Z", &fmt))
+ ; /* nothing */
+ else
strbuf_addch(&munged_fmt, '%');
- }
}
fmt = munged_fmt.buf;
@@ -1072,21 +999,6 @@ void strbuf_addftime(struct strbuf *sb, const char *fmt, const struct tm *tm,
strbuf_setlen(sb, sb->len + len);
}
-void strbuf_repo_add_unique_abbrev(struct strbuf *sb, struct repository *repo,
- const struct object_id *oid, int abbrev_len)
-{
- int r;
- strbuf_grow(sb, GIT_MAX_HEXSZ + 1);
- r = repo_find_unique_abbrev_r(repo, sb->buf + sb->len, oid, abbrev_len);
- strbuf_setlen(sb, sb->len + r);
-}
-
-void strbuf_add_unique_abbrev(struct strbuf *sb, const struct object_id *oid,
- int abbrev_len)
-{
- strbuf_repo_add_unique_abbrev(sb, the_repository, oid, abbrev_len);
-}
-
/*
* Returns the length of a line, without trailing spaces.
*
@@ -1116,10 +1028,10 @@ static size_t cleanup(char *line, size_t len)
*
* If last line does not have a newline at the end, one is added.
*
- * Enable skip_comments to skip every line starting with comment
- * character.
+ * Pass a non-NULL comment_prefix to skip every line starting
+ * with it.
*/
-void strbuf_stripspace(struct strbuf *sb, int skip_comments)
+void strbuf_stripspace(struct strbuf *sb, const char *comment_prefix)
{
size_t empties = 0;
size_t i, j, len, newlen;
@@ -1132,7 +1044,8 @@ void strbuf_stripspace(struct strbuf *sb, int skip_comments)
eol = memchr(sb->buf + i, '\n', sb->len - i);
len = eol ? eol - (sb->buf + i) + 1 : sb->len - i;
- if (skip_comments && len && sb->buf[i] == comment_line_char) {
+ if (comment_prefix && len &&
+ starts_with(sb->buf + i, comment_prefix)) {
newlen = 0;
continue;
}
@@ -1153,50 +1066,8 @@ void strbuf_stripspace(struct strbuf *sb, int skip_comments)
strbuf_setlen(sb, j);
}
-int strbuf_normalize_path(struct strbuf *src)
+void strbuf_strip_file_from_path(struct strbuf *sb)
{
- struct strbuf dst = STRBUF_INIT;
-
- strbuf_grow(&dst, src->len);
- if (normalize_path_copy(dst.buf, src->buf) < 0) {
- strbuf_release(&dst);
- return -1;
- }
-
- /*
- * normalize_path does not tell us the new length, so we have to
- * compute it by looking for the new NUL it placed
- */
- strbuf_setlen(&dst, strlen(dst.buf));
- strbuf_swap(src, &dst);
- strbuf_release(&dst);
- return 0;
-}
-
-int strbuf_edit_interactively(struct strbuf *buffer, const char *path,
- const char *const *env)
-{
- char *path2 = NULL;
- int fd, res = 0;
-
- if (!is_absolute_path(path))
- path = path2 = xstrdup(git_path("%s", path));
-
- fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0666);
- if (fd < 0)
- res = error_errno(_("could not open '%s' for writing"), path);
- else if (write_in_full(fd, buffer->buf, buffer->len) < 0) {
- res = error_errno(_("could not write to '%s'"), path);
- close(fd);
- } else if (close(fd) < 0)
- res = error_errno(_("could not close '%s'"), path);
- else {
- strbuf_reset(buffer);
- if (launch_editor(path, buffer, env) < 0)
- res = error_errno(_("could not edit '%s'"), path);
- unlink(path);
- }
-
- free(path2);
- return res;
+ char *path_sep = find_last_dir_sep(sb->buf);
+ strbuf_setlen(sb, path_sep ? path_sep - sb->buf + 1 : 0);
}
diff --git a/strbuf.h b/strbuf.h
index 76965a1..97fa4a3 100644
--- a/strbuf.h
+++ b/strbuf.h
@@ -1,12 +1,20 @@
#ifndef STRBUF_H
#define STRBUF_H
+/*
+ * NOTE FOR STRBUF DEVELOPERS
+ *
+ * strbuf is a low-level primitive; as such it should interact only
+ * with other low-level primitives. Do not introduce new functions
+ * which interact with higher-level APIs.
+ */
+
struct string_list;
/**
- * strbuf's are meant to be used with all the usual C string and memory
+ * strbufs are meant to be used with all the usual C string and memory
* APIs. Given that the length of the buffer is known, it's often better to
- * use the mem* functions than a str* one (memchr vs. strchr e.g.).
+ * use the mem* functions than a str* one (e.g., memchr vs. strchr).
* Though, one has to be careful about the fact that str* functions often
* stop on NULs and that strbufs may have embedded NULs.
*
@@ -16,7 +24,7 @@ struct string_list;
* strbufs have some invariants that are very important to keep in mind:
*
* - The `buf` member is never NULL, so it can be used in any usual C
- * string operations safely. strbuf's _have_ to be initialized either by
+ * string operations safely. strbufs _have_ to be initialized either by
* `strbuf_init()` or by `= STRBUF_INIT` before the invariants, though.
*
* Do *not* assume anything on what `buf` really is (e.g. if it is
@@ -29,7 +37,7 @@ struct string_list;
*
* - The `buf` member is a byte array that has at least `len + 1` bytes
* allocated. The extra byte is used to store a `'\0'`, allowing the
- * `buf` member to be a valid C-string. Every strbuf function ensure this
+ * `buf` member to be a valid C-string. All strbuf functions ensure this
* invariant is preserved.
*
* NOTE: It is OK to "play" with the buffer directly if you work it this
@@ -72,10 +80,6 @@ struct strbuf {
extern char strbuf_slopbuf[];
#define STRBUF_INIT { .buf = strbuf_slopbuf }
-/*
- * Predeclare this here, since cache.h includes this file before it defines the
- * struct.
- */
struct object_id;
/**
@@ -283,7 +287,8 @@ void strbuf_splice(struct strbuf *sb, size_t pos, size_t len,
* by a comment character and a blank.
*/
void strbuf_add_commented_lines(struct strbuf *out,
- const char *buf, size_t size);
+ const char *buf, size_t size,
+ const char *comment_prefix);
/**
@@ -318,58 +323,24 @@ const char *strbuf_join_argv(struct strbuf *buf, int argc,
const char **argv, char delim);
/**
- * This function can be used to expand a format string containing
- * placeholders. To that end, it parses the string and calls the specified
- * function for every percent sign found.
- *
- * The callback function is given a pointer to the character after the `%`
- * and a pointer to the struct strbuf. It is expected to add the expanded
- * version of the placeholder to the strbuf, e.g. to add a newline
- * character if the letter `n` appears after a `%`. The function returns
- * the length of the placeholder recognized and `strbuf_expand()` skips
- * over it.
- *
- * The format `%%` is automatically expanded to a single `%` as a quoting
- * mechanism; callers do not need to handle the `%` placeholder themselves,
- * and the callback function will not be invoked for this placeholder.
- *
- * All other characters (non-percent and not skipped ones) are copied
- * verbatim to the strbuf. If the callback returned zero, meaning that the
- * placeholder is unknown, then the percent sign is copied, too.
- *
- * In order to facilitate caching and to make it possible to give
- * parameters to the callback, `strbuf_expand()` passes a context
- * pointer with any kind of data.
+ * Used with `strbuf_expand_step` to expand the literals %n and %x
+ * followed by two hexadecimal digits. Returns the number of recognized
+ * characters.
*/
-typedef size_t (*expand_fn_t) (struct strbuf *sb,
- const char *placeholder,
- void *context);
-void strbuf_expand(struct strbuf *sb,
- const char *format,
- expand_fn_t fn,
- void *context);
+size_t strbuf_expand_literal(struct strbuf *sb, const char *placeholder);
/**
- * Used as callback for `strbuf_expand` to only expand literals
- * (i.e. %n and %xNN). The context argument is ignored.
+ * If the string pointed to by `formatp` contains a percent sign ("%"),
+ * advance it to point to the character following the next one and
+ * return 1, otherwise return 0. Append the substring before that
+ * percent sign to `sb`, or the whole string if there is none.
*/
-size_t strbuf_expand_literal_cb(struct strbuf *sb,
- const char *placeholder,
- void *context);
+int strbuf_expand_step(struct strbuf *sb, const char **formatp);
/**
- * Used as callback for `strbuf_expand()`, expects an array of
- * struct strbuf_expand_dict_entry as context, i.e. pairs of
- * placeholder and replacement string. The array needs to be
- * terminated by an entry with placeholder set to NULL.
+ * Used with `strbuf_expand_step` to report unknown placeholders.
*/
-struct strbuf_expand_dict_entry {
- const char *placeholder;
- const char *value;
-};
-size_t strbuf_expand_dict_cb(struct strbuf *sb,
- const char *placeholder,
- void *context);
+void strbuf_expand_bad_format(const char *format, const char *command);
/**
* Append the contents of one strbuf to another, quoting any
@@ -412,8 +383,8 @@ void strbuf_addf(struct strbuf *sb, const char *fmt, ...);
* Add a formatted string prepended by a comment character and a
* blank to the buffer.
*/
-__attribute__((format (printf, 2, 3)))
-void strbuf_commented_addf(struct strbuf *sb, const char *fmt, ...);
+__attribute__((format (printf, 3, 4)))
+void strbuf_commented_addf(struct strbuf *sb, const char *comment_prefix, const char *fmt, ...);
__attribute__((format (printf,2,0)))
void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap);
@@ -476,6 +447,18 @@ int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint);
ssize_t strbuf_write(struct strbuf *sb, FILE *stream);
/**
+ * Read from a FILE * until the specified terminator is encountered,
+ * overwriting the existing contents of the strbuf.
+ *
+ * Reading stops after the terminator or at EOF. The terminator is
+ * removed from the buffer before returning. If the terminator is LF
+ * and if it is preceded by a CR, then the whole CRLF is stripped.
+ * Returns 0 unless there was nothing left before EOF, in which case
+ * it returns `EOF`.
+ */
+int strbuf_getdelim_strip_crlf(struct strbuf *sb, FILE *fp, int term);
+
+/**
* Read a line from a FILE *, overwriting the existing contents of
* the strbuf. The strbuf_getline*() family of functions share
* this signature, but have different line termination conventions.
@@ -528,28 +511,6 @@ int strbuf_getwholeline_fd(struct strbuf *sb, int fd, int term);
int strbuf_getcwd(struct strbuf *sb);
/**
- * Add a path to a buffer, converting a relative path to an
- * absolute one in the process. Symbolic links are not
- * resolved.
- */
-void strbuf_add_absolute_path(struct strbuf *sb, const char *path);
-
-/**
- * Canonize `path` (make it absolute, resolve symlinks, remove extra
- * slashes) and append it to `sb`. Die with an informative error
- * message if there is a problem.
- *
- * The directory part of `path` (i.e., everything up to the last
- * dir_sep) must denote a valid, existing directory, but the last
- * component need not exist.
- *
- * Callers that don't mind links should use the more lightweight
- * strbuf_add_absolute_path() instead.
- */
-void strbuf_add_real_path(struct strbuf *sb, const char *path);
-
-
-/**
* Normalize in-place the path contained in the strbuf. See
* normalize_path_copy() for details. If an error occurs, the contents of "sb"
* are left untouched, and -1 is returned.
@@ -557,10 +518,11 @@ void strbuf_add_real_path(struct strbuf *sb, const char *path);
int strbuf_normalize_path(struct strbuf *sb);
/**
- * Strip whitespace from a buffer. The second parameter controls if
- * comments are considered contents to be removed or not.
+ * Strip whitespace from a buffer. If comment_prefix is non-NULL,
+ * then lines beginning with that character are considered comments,
+ * thus removed.
*/
-void strbuf_stripspace(struct strbuf *buf, int skip_comments);
+void strbuf_stripspace(struct strbuf *buf, const char *comment_prefix);
static inline int strbuf_strip_suffix(struct strbuf *sb, const char *suffix)
{
@@ -630,39 +592,16 @@ void strbuf_add_separated_string_list(struct strbuf *str,
*/
void strbuf_list_free(struct strbuf **list);
-/**
- * Add the abbreviation, as generated by find_unique_abbrev, of `sha1` to
- * the strbuf `sb`.
- */
-struct repository;
-void strbuf_repo_add_unique_abbrev(struct strbuf *sb, struct repository *repo,
- const struct object_id *oid, int abbrev_len);
-void strbuf_add_unique_abbrev(struct strbuf *sb, const struct object_id *oid,
- int abbrev_len);
-
-/**
- * Launch the user preferred editor to edit a file and fill the buffer
- * with the file's contents upon the user completing their editing. The
- * third argument can be used to set the environment which the editor is
- * run in. If the buffer is NULL the editor is launched as usual but the
- * file's contents are not read into the buffer upon completion.
- */
-int launch_editor(const char *path, struct strbuf *buffer,
- const char *const *env);
-
-int launch_sequence_editor(const char *path, struct strbuf *buffer,
- const char *const *env);
-
/*
- * In contrast to `launch_editor()`, this function writes out the contents
- * of the specified file first, then clears the `buffer`, then launches
- * the editor and reads back in the file contents into the `buffer`.
- * Finally, it deletes the temporary file.
+ * Remove the filename from the provided path string. If the path
+ * contains a trailing separator, then the path is considered a directory
+ * and nothing is modified.
*
- * If `path` is relative, it refers to a file in the `.git` directory.
+ * Examples:
+ * - "/path/to/file" -> "/path/to/"
+ * - "/path/to/dir/" -> "/path/to/dir/"
*/
-int strbuf_edit_interactively(struct strbuf *buffer, const char *path,
- const char *const *env);
+void strbuf_strip_file_from_path(struct strbuf *sb);
void strbuf_add_lines(struct strbuf *sb,
const char *prefix,
@@ -695,14 +634,14 @@ static inline void strbuf_complete_line(struct strbuf *sb)
/*
* Copy "name" to "sb", expanding any special @-marks as handled by
- * interpret_branch_name(). The result is a non-qualified branch name
+ * 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
- * interpret_branch_name() for details.
+ * repo_interpret_branch_name() for details.
*/
void strbuf_branchname(struct strbuf *sb, const char *name,
unsigned allowed);
@@ -717,9 +656,6 @@ int strbuf_check_branch_ref(struct strbuf *sb, const char *name);
typedef int (*char_predicate)(char ch);
-int is_rfc3986_unreserved(char ch);
-int is_rfc3986_reserved_or_unreserved(char ch);
-
void strbuf_addstr_urlencode(struct strbuf *sb, const char *name,
char_predicate allow_unencoded_fn);
@@ -740,4 +676,37 @@ char *xstrvfmt(const char *fmt, va_list ap);
__attribute__((format (printf, 1, 2)))
char *xstrfmt(const char *fmt, ...);
+int starts_with(const char *str, const char *prefix);
+int istarts_with(const char *str, const char *prefix);
+int starts_with_mem(const char *str, size_t len, const char *prefix);
+
+/*
+ * If the string "str" is the same as the string in "prefix", then the "arg"
+ * parameter is set to the "def" parameter and 1 is returned.
+ * If the string "str" begins with the string found in "prefix" and then a
+ * "=" sign, then the "arg" parameter is set to "str + strlen(prefix) + 1"
+ * (i.e., to the point in the string right after the prefix and the "=" sign),
+ * and 1 is returned.
+ *
+ * Otherwise, return 0 and leave "arg" untouched.
+ *
+ * When we accept both a "--key" and a "--key=<val>" option, this function
+ * can be used instead of !strcmp(arg, "--key") and then
+ * skip_prefix(arg, "--key=", &arg) to parse such an option.
+ */
+int skip_to_optional_arg_default(const char *str, const char *prefix,
+ const char **arg, const char *def);
+
+static inline int skip_to_optional_arg(const char *str, const char *prefix,
+ const char **arg)
+{
+ return skip_to_optional_arg_default(str, prefix, arg, "");
+}
+
+static inline int ends_with(const char *str, const char *suffix)
+{
+ size_t len;
+ return strip_suffix(str, suffix, &len);
+}
+
#endif /* STRBUF_H */
diff --git a/streaming.c b/streaming.c
index fe54665..10adf62 100644
--- a/streaming.c
+++ b/streaming.c
@@ -1,10 +1,13 @@
/*
* Copyright (c) 2011, Google Inc.
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "convert.h"
+#include "environment.h"
#include "streaming.h"
#include "repository.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
#include "replace-object.h"
#include "packfile.h"
@@ -38,7 +41,7 @@ struct git_istream {
union {
struct {
- char *buf; /* from read_object() */
+ char *buf; /* from oid_object_info_extended() */
unsigned long read_ptr;
} incore;
@@ -328,9 +331,9 @@ static int close_istream_pack_non_delta(struct git_istream *st)
}
static int open_istream_pack_non_delta(struct git_istream *st,
- struct repository *r,
- const struct object_id *oid,
- enum object_type *type)
+ struct repository *r UNUSED,
+ const struct object_id *oid UNUSED,
+ enum object_type *type UNUSED)
{
struct pack_window *window;
enum object_type in_pack_type;
@@ -388,12 +391,17 @@ static ssize_t read_istream_incore(struct git_istream *st, char *buf, size_t sz)
static int open_istream_incore(struct git_istream *st, struct repository *r,
const struct object_id *oid, enum object_type *type)
{
- st->u.incore.buf = read_object_file_extended(r, oid, type, &st->size, 0);
+ struct object_info oi = OBJECT_INFO_INIT;
+
st->u.incore.read_ptr = 0;
st->close = close_istream_incore;
st->read = read_istream_incore;
- return st->u.incore.buf ? 0 : -1;
+ oi.typep = type;
+ oi.sizep = &st->size;
+ oi.contentp = (void **)&st->u.incore.buf;
+ return oid_object_info_extended(r, oid, &oi,
+ OBJECT_INFO_DIE_IF_CORRUPT);
}
/*****************************************************************************
diff --git a/streaming.h b/streaming.h
index 5e4e6ac..bd27f59 100644
--- a/streaming.h
+++ b/streaming.h
@@ -3,10 +3,12 @@
*/
#ifndef STREAMING_H
#define STREAMING_H 1
-#include "cache.h"
+
+#include "object.h"
/* opaque */
struct git_istream;
+struct stream_filter;
struct git_istream *open_istream(struct repository *, const struct object_id *,
enum object_type *, unsigned long *,
diff --git a/string-list.c b/string-list.c
index 549fc41..954569f 100644
--- a/string-list.c
+++ b/string-list.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "string-list.h"
void string_list_init_nodup(struct string_list *list)
@@ -156,7 +156,7 @@ void filter_string_list(struct string_list *list, int free_util,
list->nr = dst;
}
-static int item_is_not_empty(struct string_list_item *item, void *unused)
+static int item_is_not_empty(struct string_list_item *item, void *data UNUSED)
{
return *item->string != '\0';
}
@@ -202,6 +202,15 @@ void string_list_clear_func(struct string_list *list, string_list_clear_func_t c
list->nr = list->alloc = 0;
}
+void string_list_setlen(struct string_list *list, size_t nr)
+{
+ if (list->strdup_strings)
+ BUG("cannot setlen a string_list which owns its entries");
+ if (nr > list->nr)
+ BUG("cannot grow a string_list with setlen");
+ list->nr = nr;
+}
+
struct string_list_item *string_list_append_nodup(struct string_list *list,
char *string)
{
@@ -300,7 +309,7 @@ int string_list_split(struct string_list *list, const char *string,
}
int string_list_split_in_place(struct string_list *list, char *string,
- int delim, int maxsplit)
+ const char *delim, int maxsplit)
{
int count = 0;
char *p = string, *end;
@@ -314,7 +323,7 @@ int string_list_split_in_place(struct string_list *list, char *string,
string_list_append(list, p);
return count;
}
- end = strchr(p, delim);
+ end = strpbrk(p, delim);
if (end) {
*end = '\0';
string_list_append(list, p);
diff --git a/string-list.h b/string-list.h
index d5a744e..122b318 100644
--- a/string-list.h
+++ b/string-list.h
@@ -134,6 +134,16 @@ typedef void (*string_list_clear_func_t)(void *p, const char *str);
/** Call a custom clear function on each util pointer */
void string_list_clear_func(struct string_list *list, string_list_clear_func_t clearfunc);
+/*
+ * Set the length of a string_list to `nr`, provided that (a) `list`
+ * does not own its own storage, and (b) that `nr` is no larger than
+ * `list->nr`.
+ *
+ * Useful when "shrinking" `list` to write over existing entries that
+ * are no longer used without reallocating.
+ */
+void string_list_setlen(struct string_list *list, size_t nr);
+
/**
* Apply `func` to each item. If `func` returns nonzero, the
* iteration aborts and the return value is propagated.
@@ -141,7 +151,12 @@ void string_list_clear_func(struct string_list *list, string_list_clear_func_t c
int for_each_string_list(struct string_list *list,
string_list_each_func_t func, void *cb_data);
-/** Iterate over each item, as a macro. */
+/**
+ * Iterate over each item, as a macro.
+ *
+ * Be sure that 'list' is non-NULL. The macro cannot perform NULL
+ * checks due to -Werror=address errors.
+ */
#define for_each_string_list_item(item,list) \
for (item = (list)->items; \
item && item < (list)->items + (list)->nr; \
@@ -265,5 +280,5 @@ int string_list_split(struct string_list *list, const char *string,
* list->strdup_strings must *not* be set.
*/
int string_list_split_in_place(struct string_list *list, char *string,
- int delim, int maxsplit);
+ const char *delim, int maxsplit);
#endif /* STRING_LIST_H */
diff --git a/strmap.c b/strmap.c
index ee48635..c7b9c52 100644
--- a/strmap.c
+++ b/strmap.c
@@ -2,10 +2,10 @@
#include "strmap.h"
#include "mem-pool.h"
-int cmp_strmap_entry(const void *hashmap_cmp_fn_data,
+int cmp_strmap_entry(const void *hashmap_cmp_fn_data UNUSED,
const struct hashmap_entry *entry1,
const struct hashmap_entry *entry2,
- const void *keydata)
+ const void *keydata UNUSED)
{
const struct strmap_entry *e1, *e2;
diff --git a/strvec.c b/strvec.c
index 61a76ce..178f4f3 100644
--- a/strvec.c
+++ b/strvec.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "strvec.h"
#include "strbuf.h"
diff --git a/strvec.h b/strvec.h
index 9f55c87..4715d3e 100644
--- a/strvec.h
+++ b/strvec.h
@@ -4,8 +4,8 @@
/**
* The strvec API allows one to dynamically build and store
* NULL-terminated arrays of strings. A strvec maintains the invariant that the
- * `items` member always points to a non-NULL array, and that the array is
- * always NULL-terminated at the element pointed to by `items[nr]`. This
+ * `v` member always points to a non-NULL array, and that the array is
+ * always NULL-terminated at the element pointed to by `v[nr]`. This
* makes the result suitable for passing to functions expecting to receive
* argv from main().
*
@@ -22,7 +22,7 @@ extern const char *empty_strvec[];
/**
* A single array. This should be initialized by assignment from
- * `STRVEC_INIT`, or by calling `strvec_init`. The `items`
+ * `STRVEC_INIT`, or by calling `strvec_init`. The `v`
* member contains the actual array; the `nr` member contains the
* number of elements in the array, not including the terminating
* NULL.
@@ -80,7 +80,7 @@ void strvec_split(struct strvec *, const char *);
void strvec_clear(struct strvec *);
/**
- * Disconnect the `items` member from the `strvec` struct and
+ * Disconnect the `v` member from the `strvec` struct and
* return it. The caller is responsible for freeing the memory used
* by the array, and by the strings it references. After detaching,
* the `strvec` is in a reinitialized state and can be pushed
diff --git a/sub-process.c b/sub-process.c
index cae56ae..1daf5a9 100644
--- a/sub-process.c
+++ b/sub-process.c
@@ -1,14 +1,15 @@
/*
* Generic implementation of background process infrastructure.
*/
+#include "git-compat-util.h"
#include "sub-process.h"
#include "sigchain.h"
#include "pkt-line.h"
-int cmd2process_cmp(const void *unused_cmp_data,
+int cmd2process_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
- const void *unused_keydata)
+ const void *keydata UNUSED)
{
const struct subprocess_entry *e1, *e2;
diff --git a/sub-process.h b/sub-process.h
index e85f21f..6a61638 100644
--- a/sub-process.h
+++ b/sub-process.h
@@ -1,7 +1,6 @@
#ifndef SUBPROCESS_H
#define SUBPROCESS_H
-#include "git-compat-util.h"
#include "hashmap.h"
#include "run-command.h"
diff --git a/submodule-config.c b/submodule-config.c
index c2ac7e7..11428b4 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -1,13 +1,21 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
+#include "path.h"
#include "repository.h"
#include "config.h"
#include "submodule-config.h"
#include "submodule.h"
#include "strbuf.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "parse-options.h"
+#include "thread-utils.h"
#include "tree-walk.h"
+#include "url.h"
+#include "urlmatch.h"
/*
* submodule cache lookup structure
@@ -38,10 +46,10 @@ enum lookup_type {
lookup_path
};
-static int config_path_cmp(const void *unused_cmp_data,
+static int config_path_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
- const void *unused_keydata)
+ const void *keydata UNUSED)
{
const struct submodule_entry *a, *b;
@@ -52,10 +60,10 @@ static int config_path_cmp(const void *unused_cmp_data,
!oideq(&a->config->gitmodules_oid, &b->config->gitmodules_oid);
}
-static int config_name_cmp(const void *unused_cmp_data,
+static int config_name_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
- const void *unused_keydata)
+ const void *keydata UNUSED)
{
const struct submodule_entry *a, *b;
@@ -222,6 +230,144 @@ in_component:
return 0;
}
+static int starts_with_dot_slash(const char *const path)
+{
+ return path_match_flags(path, PATH_MATCH_STARTS_WITH_DOT_SLASH |
+ PATH_MATCH_XPLATFORM);
+}
+
+static int starts_with_dot_dot_slash(const char *const path)
+{
+ return path_match_flags(path, PATH_MATCH_STARTS_WITH_DOT_DOT_SLASH |
+ PATH_MATCH_XPLATFORM);
+}
+
+static int submodule_url_is_relative(const char *url)
+{
+ return starts_with_dot_slash(url) || starts_with_dot_dot_slash(url);
+}
+
+/*
+ * Count directory components that a relative submodule URL should chop
+ * from the remote_url it is to be resolved against.
+ *
+ * In other words, this counts "../" components at the start of a
+ * submodule URL.
+ *
+ * Returns the number of directory components to chop and writes a
+ * pointer to the next character of url after all leading "./" and
+ * "../" components to out.
+ */
+static int count_leading_dotdots(const char *url, const char **out)
+{
+ int result = 0;
+ while (1) {
+ if (starts_with_dot_dot_slash(url)) {
+ result++;
+ url += strlen("../");
+ continue;
+ }
+ if (starts_with_dot_slash(url)) {
+ url += strlen("./");
+ continue;
+ }
+ *out = url;
+ return result;
+ }
+}
+/*
+ * Check whether a transport is implemented by git-remote-curl.
+ *
+ * If it is, returns 1 and writes the URL that would be passed to
+ * git-remote-curl to the "out" parameter.
+ *
+ * Otherwise, returns 0 and leaves "out" untouched.
+ *
+ * Examples:
+ * http::https://example.com/repo.git -> 1, https://example.com/repo.git
+ * https://example.com/repo.git -> 1, https://example.com/repo.git
+ * git://example.com/repo.git -> 0
+ *
+ * This is for use in checking for previously exploitable bugs that
+ * required a submodule URL to be passed to git-remote-curl.
+ */
+static int url_to_curl_url(const char *url, const char **out)
+{
+ /*
+ * We don't need to check for case-aliases, "http.exe", and so
+ * on because in the default configuration, is_transport_allowed
+ * prevents URLs with those schemes from being cloned
+ * automatically.
+ */
+ if (skip_prefix(url, "http::", out) ||
+ skip_prefix(url, "https::", out) ||
+ skip_prefix(url, "ftp::", out) ||
+ skip_prefix(url, "ftps::", out))
+ return 1;
+ if (starts_with(url, "http://") ||
+ starts_with(url, "https://") ||
+ starts_with(url, "ftp://") ||
+ starts_with(url, "ftps://")) {
+ *out = url;
+ return 1;
+ }
+ return 0;
+}
+
+int check_submodule_url(const char *url)
+{
+ const char *curl_url;
+
+ if (looks_like_command_line_option(url))
+ return -1;
+
+ if (submodule_url_is_relative(url) || starts_with(url, "git://")) {
+ char *decoded;
+ const char *next;
+ int has_nl;
+
+ /*
+ * This could be appended to an http URL and url-decoded;
+ * check for malicious characters.
+ */
+ decoded = url_decode(url);
+ has_nl = !!strchr(decoded, '\n');
+
+ free(decoded);
+ if (has_nl)
+ return -1;
+
+ /*
+ * URLs which escape their root via "../" can overwrite
+ * the host field and previous components, resolving to
+ * URLs like https::example.com/submodule.git and
+ * https:///example.com/submodule.git that were
+ * susceptible to CVE-2020-11008.
+ */
+ if (count_leading_dotdots(url, &next) > 0 &&
+ (*next == ':' || *next == '/'))
+ return -1;
+ }
+
+ else if (url_to_curl_url(url, &curl_url)) {
+ int ret = 0;
+ char *normalized = url_normalize(curl_url, NULL);
+ if (normalized) {
+ char *decoded = url_decode(normalized);
+ if (strchr(decoded, '\n'))
+ ret = -1;
+ free(normalized);
+ free(decoded);
+ } else {
+ ret = -1;
+ }
+
+ return ret;
+ }
+
+ return 0;
+}
+
static int name_and_item_from_var(const char *var, struct strbuf *name,
struct strbuf *item)
{
@@ -298,11 +444,14 @@ static int parse_fetch_recurse(const char *opt, const char *arg,
}
}
-int parse_submodule_fetchjobs(const char *var, const char *value)
+int parse_submodule_fetchjobs(const char *var, const char *value,
+ const struct key_value_info *kvi)
{
- int fetchjobs = git_config_int(var, value);
+ int fetchjobs = git_config_int(var, value, kvi);
if (fetchjobs < 0)
die(_("negative values not allowed for submodule.fetchJobs"));
+ if (!fetchjobs)
+ fetchjobs = online_cpus();
return fetchjobs;
}
@@ -418,7 +567,8 @@ struct parse_config_parameter {
* config store (.git/config, etc). Callers are responsible for
* checking for overrides in the main config store when appropriate.
*/
-static int parse_config(const char *var, const char *value, void *data)
+static int parse_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED, void *data)
{
struct parse_config_parameter *me = data;
struct submodule *submodule;
@@ -506,7 +656,9 @@ static int parse_config(const char *var, const char *value, void *data)
submodule->recommend_shallow =
git_config_bool(var, value);
} else if (!strcmp(item.buf, "branch")) {
- if (!me->overwrite && submodule->branch)
+ if (!value)
+ ret = config_error_nonbool(var);
+ else if (!me->overwrite && submodule->branch)
warn_multiple_config(me->treeish_name, submodule->name,
"branch");
else {
@@ -533,7 +685,7 @@ static int gitmodule_oid_from_commit(const struct object_id *treeish_name,
}
strbuf_addf(rev, "%s:.gitmodules", oid_to_hex(treeish_name));
- if (get_oid(rev->buf, gitmodules_oid) >= 0)
+ if (repo_get_oid(the_repository, rev->buf, gitmodules_oid) >= 0)
ret = 1;
return ret;
@@ -586,7 +738,8 @@ static const struct submodule *config_from(struct submodule_cache *cache,
if (submodule)
goto out;
- config = read_object_file(&oid, &type, &config_size);
+ config = repo_read_object_file(the_repository, &oid, &type,
+ &config_size);
if (!config || type != OBJ_BLOB)
goto out;
@@ -596,7 +749,7 @@ static const struct submodule *config_from(struct submodule_cache *cache,
parameter.gitmodules_oid = &oid;
parameter.overwrite = 0;
git_config_from_mem(parse_config, CONFIG_ORIGIN_SUBMODULE_BLOB, rev.buf,
- config, config_size, &parameter, NULL);
+ config, config_size, &parameter, CONFIG_SCOPE_UNKNOWN, NULL);
strbuf_release(&rev);
free(config);
@@ -650,7 +803,6 @@ static void config_from_gitmodules(config_fn_t fn, struct repository *repo, void
config_source.file = file;
} else if (repo_get_oid(repo, GITMODULES_INDEX, &oid) >= 0 ||
repo_get_oid(repo, GITMODULES_HEAD, &oid) >= 0) {
- config_source.repo = repo;
config_source.blob = oidstr = xstrdup(oid_to_hex(&oid));
if (repo != the_repository)
add_submodule_odb_by_path(repo->objects->odb->path);
@@ -658,7 +810,7 @@ static void config_from_gitmodules(config_fn_t fn, struct repository *repo, void
goto out;
}
- config_with_options(fn, data, &config_source, &opts);
+ config_with_options(fn, data, &config_source, repo, &opts);
out:
free(oidstr);
@@ -666,7 +818,8 @@ out:
}
}
-static int gitmodules_cb(const char *var, const char *value, void *data)
+static int gitmodules_cb(const char *var, const char *value,
+ const struct config_context *ctx, void *data)
{
struct repository *repo = data;
struct parse_config_parameter parameter;
@@ -676,7 +829,7 @@ static int gitmodules_cb(const char *var, const char *value, void *data)
parameter.gitmodules_oid = null_oid();
parameter.overwrite = 1;
- return parse_config(var, value, &parameter);
+ return parse_config(var, value, ctx, &parameter);
}
void repo_read_gitmodules(struct repository *repo, int skip_if_read)
@@ -704,7 +857,8 @@ void gitmodules_config_oid(const struct object_id *commit_oid)
if (gitmodule_oid_from_commit(commit_oid, &oid, &rev)) {
git_config_from_blob_oid(gitmodules_cb, rev.buf,
- the_repository, &oid, the_repository);
+ the_repository, &oid, the_repository,
+ CONFIG_SCOPE_UNKNOWN);
}
strbuf_release(&rev);
@@ -793,7 +947,9 @@ void submodule_free(struct repository *r)
submodule_cache_clear(r->submodule_cache);
}
-static int config_print_callback(const char *var, const char *value, void *cb_data)
+static int config_print_callback(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *cb_data)
{
char *wanted_key = cb_data;
@@ -822,7 +978,7 @@ int config_set_in_gitmodules_file_gently(const char *key, const char *value)
{
int ret;
- ret = git_config_set_in_file_gently(GITMODULES_FILE, key, value);
+ ret = git_config_set_in_file_gently(GITMODULES_FILE, key, NULL, value);
if (ret < 0)
/* Maybe the user already did that, don't error out here */
warning(_("Could not update .gitmodules entry %s"), key);
@@ -835,13 +991,15 @@ struct fetch_config {
int *recurse_submodules;
};
-static int gitmodules_fetch_config(const char *var, const char *value, void *cb)
+static int gitmodules_fetch_config(const char *var, const char *value,
+ const struct config_context *ctx,
+ void *cb)
{
struct fetch_config *config = cb;
if (!strcmp(var, "submodule.fetchjobs")) {
if (config->max_children)
*(config->max_children) =
- parse_submodule_fetchjobs(var, value);
+ parse_submodule_fetchjobs(var, value, ctx->kvi);
return 0;
} else if (!strcmp(var, "fetch.recursesubmodules")) {
if (config->recurse_submodules)
@@ -863,11 +1021,12 @@ void fetch_config_from_gitmodules(int *max_children, int *recurse_submodules)
}
static int gitmodules_update_clone_config(const char *var, const char *value,
+ const struct config_context *ctx,
void *cb)
{
int *max_jobs = cb;
if (!strcmp(var, "submodule.fetchjobs"))
- *max_jobs = parse_submodule_fetchjobs(var, value);
+ *max_jobs = parse_submodule_fetchjobs(var, value, ctx->kvi);
return 0;
}
diff --git a/submodule-config.h b/submodule-config.h
index 28a8ca6..b6133af 100644
--- a/submodule-config.h
+++ b/submodule-config.h
@@ -1,11 +1,8 @@
#ifndef SUBMODULE_CONFIG_CACHE_H
#define SUBMODULE_CONFIG_CACHE_H
-#include "cache.h"
#include "config.h"
-#include "hashmap.h"
#include "submodule.h"
-#include "strbuf.h"
#include "tree-walk.h"
/**
@@ -51,7 +48,8 @@ struct repository;
void submodule_cache_free(struct submodule_cache *cache);
-int parse_submodule_fetchjobs(const char *var, const char *value);
+int parse_submodule_fetchjobs(const char *var, const char *value,
+ const struct key_value_info *kvi);
int parse_fetch_recurse_submodules_arg(const char *opt, const char *arg);
struct option;
int option_fetch_parse_recurse_submodules(const struct option *opt,
@@ -91,6 +89,9 @@ int config_set_in_gitmodules_file_gently(const char *key, const char *value);
*/
int check_submodule_name(const char *name);
+/* Returns 0 if the URL valid per RFC3986 and -1 otherwise. */
+int check_submodule_url(const char *url);
+
/*
* Note: these helper functions exist solely to maintain backward
* compatibility with 'fetch' and 'update_clone' storing configuration in
diff --git a/submodule.c b/submodule.c
index 4e299f5..ce2d032 100644
--- a/submodule.c
+++ b/submodule.c
@@ -1,5 +1,5 @@
-
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
#include "repository.h"
#include "config.h"
#include "submodule-config.h"
@@ -7,6 +7,9 @@
#include "dir.h"
#include "diff.h"
#include "commit.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "revision.h"
#include "run-command.h"
#include "diffcore.h"
@@ -14,15 +17,18 @@
#include "string-list.h"
#include "oid-array.h"
#include "strvec.h"
-#include "blob.h"
#include "thread-utils.h"
-#include "quote.h"
+#include "path.h"
#include "remote.h"
#include "worktree.h"
#include "parse-options.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "commit-reach.h"
-#include "shallow.h"
+#include "read-cache-ll.h"
+#include "setup.h"
+#include "trace2.h"
static int config_update_recurse_submodules = RECURSE_SUBMODULES_OFF;
static int initialized_fetch_ref_tips;
@@ -65,7 +71,7 @@ int is_writing_gitmodules_ok(void)
{
struct object_id oid;
return file_exists(GITMODULES_FILE) ||
- (get_oid(GITMODULES_INDEX, &oid) < 0 && get_oid(GITMODULES_HEAD, &oid) < 0);
+ (repo_get_oid(the_repository, GITMODULES_INDEX, &oid) < 0 && repo_get_oid(the_repository, GITMODULES_HEAD, &oid) < 0);
}
/*
@@ -213,7 +219,8 @@ void set_diffopt_flags_from_submodule_config(struct diff_options *diffopt,
}
/* Cheap function that only determines if we're interested in submodules at all */
-int git_default_submodule_config(const char *var, const char *value, void *cb)
+int git_default_submodule_config(const char *var, const char *value,
+ void *cb UNUSED)
{
if (!strcmp(var, "submodule.recurse")) {
int v = git_config_bool(var, value) ?
@@ -273,8 +280,7 @@ int is_tree_submodule_active(struct repository *repo,
free(key);
/* submodule.active is set */
- sl = repo_config_get_value_multi(repo, "submodule.active");
- if (sl) {
+ if (!repo_config_get_string_multi(repo, "submodule.active", &sl)) {
struct pathspec ps;
struct strvec args = STRVEC_INIT;
const struct string_list_item *item;
@@ -415,10 +421,9 @@ int parse_submodule_update_strategy(const char *value,
return 0;
}
-const char *submodule_strategy_to_string(const struct submodule_update_strategy *s)
+const char *submodule_update_type_to_string(enum submodule_update_type type)
{
- struct strbuf sb = STRBUF_INIT;
- switch (s->type) {
+ switch (type) {
case SM_UPDATE_CHECKOUT:
return "checkout";
case SM_UPDATE_MERGE:
@@ -428,12 +433,11 @@ const char *submodule_strategy_to_string(const struct submodule_update_strategy
case SM_UPDATE_NONE:
return "none";
case SM_UPDATE_UNSPECIFIED:
- return NULL;
case SM_UPDATE_COMMAND:
- strbuf_addf(&sb, "!%s", s->command);
- return strbuf_detach(&sb, NULL);
+ BUG("init_submodule() should handle type %d", type);
+ default:
+ BUG("unexpected update strategy type: %d", type);
}
- return NULL;
}
void handle_ignore_submodules_arg(struct diff_options *diffopt,
@@ -588,7 +592,12 @@ static void show_submodule_header(struct diff_options *o,
(!is_null_oid(two) && !*right))
message = "(commits not present)";
- *merge_bases = repo_get_merge_bases(sub, *left, *right);
+ *merge_bases = NULL;
+ if (repo_get_merge_bases(sub, *left, *right, merge_bases) < 0) {
+ message = "(corrupt repository)";
+ goto output_header;
+ }
+
if (*merge_bases) {
if ((*merge_bases)->item == *left)
fast_forward = 1;
@@ -833,7 +842,7 @@ static void changed_submodule_data_clear(struct changed_submodule_data *cs_data)
}
static void collect_changed_submodules_cb(struct diff_queue_struct *q,
- struct diff_options *options,
+ struct diff_options *options UNUSED,
void *data)
{
struct collect_changed_submodules_cb_data *me = data;
@@ -940,8 +949,9 @@ static void free_submodules_data(struct string_list *submodules)
string_list_clear(submodules, 1);
}
-static int has_remote(const char *refname, const struct object_id *oid,
- int flags, void *cb_data)
+static int has_remote(const char *refname UNUSED,
+ const struct object_id *oid UNUSED,
+ int flags UNUSED, void *cb_data UNUSED)
{
return 1;
}
@@ -1130,6 +1140,12 @@ static int push_submodule(const char *path,
if (for_each_remote_ref_submodule(path, has_remote, NULL) > 0) {
struct child_process cp = CHILD_PROCESS_INIT;
strvec_push(&cp.args, "push");
+ /*
+ * When recursing into a submodule, treat any "only" configurations as "on-
+ * demand", since "only" would not work (we need all submodules to be pushed
+ * in order to be able to push the superproject).
+ */
+ strvec_push(&cp.args, "--recurse-submodules=only-is-on-demand");
if (dry_run)
strvec_push(&cp.args, "--dry-run");
@@ -1243,8 +1259,9 @@ int push_unpushed_submodules(struct repository *r,
return ret;
}
-static int append_oid_to_array(const char *ref, const struct object_id *oid,
- int flags, void *data)
+static int append_oid_to_array(const char *ref UNUSED,
+ const struct object_id *oid,
+ int flags UNUSED, void *data)
{
struct oid_array *array = data;
oid_array_append(array, oid);
@@ -1618,7 +1635,7 @@ get_fetch_task_from_changed(struct submodule_parallel_fetch *spf,
if (!task->repo) {
strbuf_addf(err, _("Could not access submodule '%s' at commit %s\n"),
cs_data->path,
- find_unique_abbrev(cs_data->super_oid, DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, cs_data->super_oid, DEFAULT_ABBREV));
fetch_task_release(task);
free(task);
@@ -1629,8 +1646,8 @@ get_fetch_task_from_changed(struct submodule_parallel_fetch *spf,
strbuf_addf(err,
_("Fetching submodule %s%s at commit %s\n"),
spf->prefix, task->sub->path,
- find_unique_abbrev(cs_data->super_oid,
- DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, cs_data->super_oid,
+ DEFAULT_ABBREV));
spf->changed_count++;
/*
@@ -1675,8 +1692,6 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
task = get_fetch_task_from_changed(spf, err);
if (task) {
- struct strbuf submodule_prefix = STRBUF_INIT;
-
child_process_init(cp);
cp->dir = task->repo->gitdir;
prepare_submodule_repo_env_in_gitdir(&cp->env);
@@ -1686,15 +1701,11 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
strvec_pushv(&cp->args, task->git_args.v);
strvec_pushv(&cp->args, spf->args.v);
strvec_push(&cp->args, task->default_argv);
- strvec_push(&cp->args, "--submodule-prefix");
+ strvec_pushf(&cp->args, "--submodule-prefix=%s%s/",
+ spf->prefix, task->sub->path);
- strbuf_addf(&submodule_prefix, "%s%s/",
- spf->prefix,
- task->sub->path);
- strvec_push(&cp->args, submodule_prefix.buf);
*task_cb = task;
- strbuf_release(&submodule_prefix);
string_list_insert(&spf->seen_submodule_names, task->sub->name);
return 1;
}
@@ -1702,12 +1713,8 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
if (spf->oid_fetch_tasks_nr) {
struct fetch_task *task =
spf->oid_fetch_tasks[spf->oid_fetch_tasks_nr - 1];
- struct strbuf submodule_prefix = STRBUF_INIT;
spf->oid_fetch_tasks_nr--;
- strbuf_addf(&submodule_prefix, "%s%s/",
- spf->prefix, task->sub->path);
-
child_process_init(cp);
prepare_submodule_repo_env_in_gitdir(&cp->env);
cp->git_cmd = 1;
@@ -1716,8 +1723,8 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
strvec_init(&cp->args);
strvec_pushv(&cp->args, spf->args.v);
strvec_push(&cp->args, "on-demand");
- strvec_push(&cp->args, "--submodule-prefix");
- strvec_push(&cp->args, submodule_prefix.buf);
+ strvec_pushf(&cp->args, "--submodule-prefix=%s%s/",
+ spf->prefix, task->sub->path);
/* NEEDSWORK: have get_default_remote from submodule--helper */
strvec_push(&cp->args, "origin");
@@ -1725,14 +1732,13 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
append_oid_to_argv, &cp->args);
*task_cb = task;
- strbuf_release(&submodule_prefix);
return 1;
}
return 0;
}
-static int fetch_start_failure(struct strbuf *err,
+static int fetch_start_failure(struct strbuf *err UNUSED,
void *cb, void *task_cb)
{
struct submodule_parallel_fetch *spf = cb;
@@ -1753,7 +1759,7 @@ static int commit_missing_in_sub(const struct object_id *oid, void *data)
return type != OBJ_COMMIT;
}
-static int fetch_finish(int retvalue, struct strbuf *err,
+static int fetch_finish(int retvalue, struct strbuf *err UNUSED,
void *cb, void *task_cb)
{
struct submodule_parallel_fetch *spf = cb;
@@ -1818,6 +1824,17 @@ int fetch_submodules(struct repository *r,
{
int i;
struct submodule_parallel_fetch spf = SPF_INIT;
+ const struct run_process_parallel_opts opts = {
+ .tr2_category = "submodule",
+ .tr2_label = "parallel/fetch",
+
+ .processes = max_parallel_jobs,
+
+ .get_next_task = get_next_submodule,
+ .start_failure = fetch_start_failure,
+ .task_finished = fetch_finish,
+ .data = &spf,
+ };
spf.r = r;
spf.command_line_option = command_line_option;
@@ -1839,12 +1856,7 @@ int fetch_submodules(struct repository *r,
calculate_changed_submodule_paths(r, &spf.changed_submodule_names);
string_list_sort(&spf.changed_submodule_names);
- run_processes_parallel_tr2(max_parallel_jobs,
- get_next_submodule,
- fetch_start_failure,
- fetch_finish,
- &spf,
- "submodule", "parallel/fetch");
+ run_processes_parallel(&opts);
if (spf.submodules_with_errors.len > 0)
fprintf(stderr, _("Errors during submodule fetch:\n%s"),
@@ -2034,21 +2046,13 @@ void submodule_unset_core_worktree(const struct submodule *sub)
submodule_name_to_gitdir(&config_path, the_repository, sub->name);
strbuf_addstr(&config_path, "/config");
- if (git_config_set_in_file_gently(config_path.buf, "core.worktree", NULL))
+ if (git_config_set_in_file_gently(config_path.buf, "core.worktree", NULL, NULL))
warning(_("Could not unset core.worktree setting in submodule '%s'"),
sub->path);
strbuf_release(&config_path);
}
-static const char *get_super_prefix_or_empty(void)
-{
- const char *s = get_super_prefix();
- if (!s)
- s = "";
- return s;
-}
-
static int submodule_has_dirty_index(const struct submodule *sub)
{
struct child_process cp = CHILD_PROCESS_INIT;
@@ -2067,7 +2071,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)
return finish_command(&cp);
}
-static void submodule_reset_index(const char *path)
+static void submodule_reset_index(const char *path, const char *super_prefix)
{
struct child_process cp = CHILD_PROCESS_INIT;
prepare_submodule_repo_env(&cp.env);
@@ -2076,10 +2080,10 @@ static void submodule_reset_index(const char *path)
cp.no_stdin = 1;
cp.dir = path;
- strvec_pushf(&cp.args, "--super-prefix=%s%s/",
- get_super_prefix_or_empty(), path);
/* TODO: determine if this might overwright untracked files */
strvec_pushl(&cp.args, "read-tree", "-u", "--reset", NULL);
+ strvec_pushf(&cp.args, "--super-prefix=%s%s/",
+ (super_prefix ? super_prefix : ""), path);
strvec_push(&cp.args, empty_tree_oid_hex());
@@ -2092,10 +2096,9 @@ static void submodule_reset_index(const char *path)
* For edge cases (a submodule coming into existence or removing a submodule)
* pass NULL for old or new respectively.
*/
-int submodule_move_head(const char *path,
- const char *old_head,
- const char *new_head,
- unsigned flags)
+int submodule_move_head(const char *path, const char *super_prefix,
+ const char *old_head, const char *new_head,
+ unsigned flags)
{
int ret = 0;
struct child_process cp = CHILD_PROCESS_INIT;
@@ -2133,7 +2136,7 @@ int submodule_move_head(const char *path,
if (old_head) {
if (!submodule_uses_gitfile(path))
absorb_git_dir_into_superproject(path,
- ABSORB_GITDIR_RECURSE_SUBMODULES);
+ super_prefix);
} else {
struct strbuf gitdir = STRBUF_INIT;
submodule_name_to_gitdir(&gitdir, the_repository,
@@ -2142,7 +2145,7 @@ int submodule_move_head(const char *path,
strbuf_release(&gitdir);
/* make sure the index is clean as well */
- submodule_reset_index(path);
+ submodule_reset_index(path, super_prefix);
}
if (old_head && (flags & SUBMODULE_MOVE_HEAD_FORCE)) {
@@ -2160,9 +2163,9 @@ int submodule_move_head(const char *path,
cp.no_stdin = 1;
cp.dir = path;
- strvec_pushf(&cp.args, "--super-prefix=%s%s/",
- get_super_prefix_or_empty(), path);
strvec_pushl(&cp.args, "read-tree", "--recurse-submodules", NULL);
+ strvec_pushf(&cp.args, "--super-prefix=%s%s/",
+ (super_prefix ? super_prefix : ""), path);
if (flags & SUBMODULE_MOVE_HEAD_DRY_RUN)
strvec_push(&cp.args, "-n");
@@ -2262,7 +2265,8 @@ int validate_submodule_git_dir(char *git_dir, const char *submodule_name)
* Embeds a single submodules git directory into the superprojects git dir,
* non recursively.
*/
-static void relocate_single_git_dir_into_superproject(const char *path)
+static void relocate_single_git_dir_into_superproject(const char *path,
+ const char *super_prefix)
{
char *old_git_dir = NULL, *real_old_git_dir = NULL, *real_new_git_dir = NULL;
struct strbuf new_gitdir = STRBUF_INIT;
@@ -2292,7 +2296,7 @@ static void relocate_single_git_dir_into_superproject(const char *path)
real_new_git_dir = real_pathdup(new_gitdir.buf, 1);
fprintf(stderr, _("Migrating git directory of '%s%s' from\n'%s' to\n'%s'\n"),
- get_super_prefix_or_empty(), path,
+ super_prefix ? super_prefix : "", path,
real_old_git_dir, real_new_git_dir);
relocate_gitdir(path, real_old_git_dir, real_new_git_dir);
@@ -2303,13 +2307,32 @@ static void relocate_single_git_dir_into_superproject(const char *path)
strbuf_release(&new_gitdir);
}
+static void absorb_git_dir_into_superproject_recurse(const char *path,
+ const char *super_prefix)
+{
+
+ struct child_process cp = CHILD_PROCESS_INIT;
+
+ cp.dir = path;
+ cp.git_cmd = 1;
+ cp.no_stdin = 1;
+ strvec_pushl(&cp.args, "submodule--helper",
+ "absorbgitdirs", NULL);
+ strvec_pushf(&cp.args, "--super-prefix=%s%s/", super_prefix ?
+ super_prefix : "", path);
+
+ prepare_submodule_repo_env(&cp.env);
+ if (run_command(&cp))
+ die(_("could not recurse into submodule '%s'"), path);
+}
+
/*
* Migrate the git directory of the submodule given by path from
* having its git directory within the working tree to the git dir nested
* in its superprojects git dir under modules/.
*/
void absorb_git_dir_into_superproject(const char *path,
- unsigned flags)
+ const char *super_prefix)
{
int err_code;
const char *sub_git_dir;
@@ -2351,36 +2374,14 @@ void absorb_git_dir_into_superproject(const char *path,
char *real_common_git_dir = real_pathdup(get_git_common_dir(), 1);
if (!starts_with(real_sub_git_dir, real_common_git_dir))
- relocate_single_git_dir_into_superproject(path);
+ relocate_single_git_dir_into_superproject(path, super_prefix);
free(real_sub_git_dir);
free(real_common_git_dir);
}
strbuf_release(&gitdir);
- if (flags & ABSORB_GITDIR_RECURSE_SUBMODULES) {
- struct child_process cp = CHILD_PROCESS_INIT;
- struct strbuf sb = STRBUF_INIT;
-
- if (flags & ~ABSORB_GITDIR_RECURSE_SUBMODULES)
- BUG("we don't know how to pass the flags down?");
-
- strbuf_addstr(&sb, get_super_prefix_or_empty());
- strbuf_addstr(&sb, path);
- strbuf_addch(&sb, '/');
-
- cp.dir = path;
- cp.git_cmd = 1;
- cp.no_stdin = 1;
- strvec_pushl(&cp.args, "--super-prefix", sb.buf,
- "submodule--helper",
- "absorb-git-dirs", NULL);
- prepare_submodule_repo_env(&cp.env);
- if (run_command(&cp))
- die(_("could not recurse into submodule '%s'"), path);
-
- strbuf_release(&sb);
- }
+ absorb_git_dir_into_superproject_recurse(path, super_prefix);
}
int get_superproject_working_tree(struct strbuf *buf)
@@ -2388,7 +2389,7 @@ int get_superproject_working_tree(struct strbuf *buf)
struct child_process cp = CHILD_PROCESS_INIT;
struct strbuf sb = STRBUF_INIT;
struct strbuf one_up = STRBUF_INIT;
- const char *cwd = xgetcwd();
+ char *cwd = xgetcwd();
int ret = 0;
const char *subpath;
int code;
@@ -2451,6 +2452,7 @@ int get_superproject_working_tree(struct strbuf *buf)
ret = 1;
free(super_wt);
}
+ free(cwd);
strbuf_release(&sb);
code = finish_command(&cp);
diff --git a/submodule.h b/submodule.h
index bfaa9da..c55a25c 100644
--- a/submodule.h
+++ b/submodule.h
@@ -72,7 +72,7 @@ void die_path_inside_submodule(struct index_state *istate,
enum submodule_update_type parse_submodule_update_type(const char *value);
int parse_submodule_update_strategy(const char *value,
struct submodule_update_strategy *dst);
-const char *submodule_strategy_to_string(const struct submodule_update_strategy *s);
+const char *submodule_update_type_to_string(enum submodule_update_type type);
void handle_ignore_submodules_arg(struct diff_options *, const char *);
void show_submodule_diff_summary(struct diff_options *o, const char *path,
struct object_id *one, struct object_id *two,
@@ -150,9 +150,8 @@ int validate_submodule_git_dir(char *git_dir, const char *submodule_name);
#define SUBMODULE_MOVE_HEAD_DRY_RUN (1<<0)
#define SUBMODULE_MOVE_HEAD_FORCE (1<<1)
-int submodule_move_head(const char *path,
- const char *old,
- const char *new_head,
+int submodule_move_head(const char *path, const char *super_prefix,
+ const char *old_head, const char *new_head,
unsigned flags);
void submodule_unset_core_worktree(const struct submodule *sub);
@@ -164,9 +163,8 @@ void submodule_unset_core_worktree(const struct submodule *sub);
*/
void prepare_submodule_repo_env(struct strvec *env);
-#define ABSORB_GITDIR_RECURSE_SUBMODULES (1<<0)
void absorb_git_dir_into_superproject(const char *path,
- unsigned flags);
+ const char *super_prefix);
/*
* Return the absolute path of the working tree of the superproject, which this
diff --git a/symlinks.c b/symlinks.c
index c667baa..b29e340 100644
--- a/symlinks.c
+++ b/symlinks.c
@@ -1,4 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "gettext.h"
+#include "setup.h"
+#include "symlinks.h"
static int threaded_check_leading_path(struct cache_def *cache, const char *name,
int len, int warn_on_lstat_err);
diff --git a/symlinks.h b/symlinks.h
new file mode 100644
index 0000000..7ae3d5b
--- /dev/null
+++ b/symlinks.h
@@ -0,0 +1,28 @@
+#ifndef SYMLINKS_H
+#define SYMLINKS_H
+
+#include "strbuf.h"
+
+struct cache_def {
+ struct strbuf path;
+ int flags;
+ int track_flags;
+ int prefix_len_stat_func;
+};
+#define CACHE_DEF_INIT { \
+ .path = STRBUF_INIT, \
+}
+static inline void cache_def_clear(struct cache_def *cache)
+{
+ strbuf_release(&cache->path);
+}
+
+int has_symlink_leading_path(const char *name, int len);
+int threaded_has_symlink_leading_path(struct cache_def *, const char *, int);
+int check_leading_path(const char *name, int len, int warn_on_lstat_err);
+int has_dirs_only_path(const char *name, int len, int prefix_len);
+void invalidate_lstat_cache(void);
+void schedule_dir_for_removal(const char *name, int len);
+void remove_scheduled_dirs(void);
+
+#endif /* SYMLINKS_H */
diff --git a/t/.gitattributes b/t/.gitattributes
index 9930e28..b9cea17 100644
--- a/t/.gitattributes
+++ b/t/.gitattributes
@@ -22,3 +22,4 @@ t[0-9][0-9][0-9][0-9]/* -whitespace
/t7500/* eol=lf
/t8005/*.txt eol=lf
/t9*/*.dump eol=lf
+/t0040*.sh whitespace=-indent-with-non-tab
diff --git a/t/Makefile b/t/Makefile
index 056ce55..2d95046 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -1,3 +1,6 @@
+# The default target of this Makefile is...
+all::
+
# Import tree-wide shared Makefile behavior and libraries
include ../shared.mak
@@ -6,6 +9,7 @@ include ../shared.mak
# Copyright (c) 2005 Junio C Hamano
#
+-include ../config.mak.uname
-include ../config.mak.autogen
-include ../config.mak
@@ -17,6 +21,7 @@ TAR ?= $(TAR)
RM ?= rm -f
PROVE ?= prove
DEFAULT_TEST_TARGET ?= test
+DEFAULT_UNIT_TEST_TARGET ?= unit-tests-raw
TEST_LINT ?= test-lint
ifdef TEST_OUTPUT_DIRECTORY
@@ -35,16 +40,25 @@ TEST_RESULTS_DIRECTORY_SQ = $(subst ','\'',$(TEST_RESULTS_DIRECTORY))
CHAINLINTTMP_SQ = $(subst ','\'',$(CHAINLINTTMP))
T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
-TGITWEB = $(sort $(wildcard t95[0-9][0-9]-*.sh))
THELPERS = $(sort $(filter-out $(T),$(wildcard *.sh)))
+TLIBS = $(sort $(wildcard lib-*.sh)) annotate-tests.sh
TPERF = $(sort $(wildcard perf/p[0-9][0-9][0-9][0-9]-*.sh))
+TINTEROP = $(sort $(wildcard interop/i[0-9][0-9][0-9][0-9]-*.sh))
CHAINLINTTESTS = $(sort $(patsubst chainlint/%.test,%,$(wildcard chainlint/*.test)))
-CHAINLINT = sed -f chainlint.sed
+CHAINLINT = '$(PERL_PATH_SQ)' chainlint.pl
+UNIT_TEST_SOURCES = $(wildcard unit-tests/t-*.c)
+UNIT_TEST_PROGRAMS = $(patsubst unit-tests/%.c,unit-tests/bin/%$(X),$(UNIT_TEST_SOURCES))
+UNIT_TESTS = $(sort $(filter-out unit-tests/bin/t-basic%,$(UNIT_TEST_PROGRAMS)))
+
+# `test-chainlint` (which is a dependency of `test-lint`, `test` and `prove`)
+# checks all tests in all scripts via a single invocation, so tell individual
+# scripts not to run the external "chainlint.pl" script themselves
+CHAINLINTSUPPRESS = GIT_TEST_EXT_CHAIN_LINT=0 && export GIT_TEST_EXT_CHAIN_LINT &&
-all: $(DEFAULT_TEST_TARGET)
+all:: $(DEFAULT_TEST_TARGET)
test: pre-clean check-chainlint $(TEST_LINT)
- $(MAKE) aggregate-results-and-cleanup
+ $(CHAINLINTSUPPRESS) $(MAKE) aggregate-results-and-cleanup
failed:
@failed=$$(cd '$(TEST_RESULTS_DIRECTORY_SQ)' && \
@@ -53,20 +67,32 @@ failed:
test -z "$$failed" || $(MAKE) $$failed
prove: pre-clean check-chainlint $(TEST_LINT)
- @echo "*** prove ***"; $(PROVE) --exec '$(TEST_SHELL_PATH_SQ)' $(GIT_PROVE_OPTS) $(T) :: $(GIT_TEST_OPTS)
+ @echo "*** prove ***"; $(CHAINLINTSUPPRESS) $(PROVE) --exec '$(TEST_SHELL_PATH_SQ)' $(GIT_PROVE_OPTS) $(T) :: $(GIT_TEST_OPTS)
$(MAKE) clean-except-prove-cache
$(T):
@echo "*** $@ ***"; '$(TEST_SHELL_PATH_SQ)' $@ $(GIT_TEST_OPTS)
+$(UNIT_TESTS):
+ @echo "*** $@ ***"; $@
+
+.PHONY: unit-tests unit-tests-raw unit-tests-prove
+unit-tests: $(DEFAULT_UNIT_TEST_TARGET)
+
+unit-tests-raw: $(UNIT_TESTS)
+
+unit-tests-prove:
+ @echo "*** prove - unit tests ***"; $(PROVE) $(GIT_PROVE_OPTS) $(UNIT_TESTS)
+
pre-clean:
$(RM) -r '$(TEST_RESULTS_DIRECTORY_SQ)'
clean-except-prove-cache: clean-chainlint
- $(RM) -r 'trash directory'.* '$(TEST_RESULTS_DIRECTORY_SQ)'
+ $(RM) -r 'trash directory'.*
$(RM) -r valgrind/bin
clean: clean-except-prove-cache
+ $(RM) -r '$(TEST_RESULTS_DIRECTORY_SQ)'
$(RM) .prove
clean-chainlint:
@@ -74,13 +100,27 @@ clean-chainlint:
check-chainlint:
@mkdir -p '$(CHAINLINTTMP_SQ)' && \
- sed -e '/^# LINT: /d' $(patsubst %,chainlint/%.test,$(CHAINLINTTESTS)) >'$(CHAINLINTTMP_SQ)'/tests && \
- sed -e '/^[ ]*$$/d' $(patsubst %,chainlint/%.expect,$(CHAINLINTTESTS)) >'$(CHAINLINTTMP_SQ)'/expect && \
- $(CHAINLINT) '$(CHAINLINTTMP_SQ)'/tests | grep -v '^[ ]*$$' >'$(CHAINLINTTMP_SQ)'/actual && \
+ for i in $(CHAINLINTTESTS); do \
+ echo "test_expect_success '$$i' '" && \
+ sed -e '/^# LINT: /d' chainlint/$$i.test && \
+ echo "'"; \
+ done >'$(CHAINLINTTMP_SQ)'/tests && \
+ { \
+ echo "# chainlint: $(CHAINLINTTMP_SQ)/tests" && \
+ for i in $(CHAINLINTTESTS); do \
+ echo "# chainlint: $$i" && \
+ cat chainlint/$$i.expect; \
+ done \
+ } >'$(CHAINLINTTMP_SQ)'/expect && \
+ $(CHAINLINT) --emit-all '$(CHAINLINTTMP_SQ)'/tests | \
+ sed -e 's/^[1-9][0-9]* //' >'$(CHAINLINTTMP_SQ)'/actual && \
diff -u '$(CHAINLINTTMP_SQ)'/expect '$(CHAINLINTTMP_SQ)'/actual
test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \
test-lint-filenames
+ifneq ($(GIT_TEST_CHAIN_LINT),0)
+test-lint: test-chainlint
+endif
test-lint-duplicates:
@dups=`echo $(T) $(TPERF) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
@@ -103,17 +143,15 @@ test-lint-filenames:
test -z "$$bad" || { \
echo >&2 "non-portable file name(s): $$bad"; exit 1; }
+test-chainlint:
+ @$(CHAINLINT) $(T) $(TLIBS) $(TPERF) $(TINTEROP)
+
aggregate-results-and-cleanup: $(T)
$(MAKE) aggregate-results
$(MAKE) clean
aggregate-results:
- for f in '$(TEST_RESULTS_DIRECTORY_SQ)'/t*-*.counts; do \
- echo "$$f"; \
- done | '$(SHELL_PATH_SQ)' ./aggregate-results.sh
-
-gitweb-test:
- $(MAKE) $(TGITWEB)
+ @'$(SHELL_PATH_SQ)' ./aggregate-results.sh '$(TEST_RESULTS_DIRECTORY_SQ)'
valgrind:
$(MAKE) GIT_TEST_OPTS="$(GIT_TEST_OPTS) --valgrind"
@@ -121,4 +159,5 @@ valgrind:
perf:
$(MAKE) -C perf/ all
-.PHONY: pre-clean $(T) aggregate-results clean valgrind perf check-chainlint clean-chainlint
+.PHONY: pre-clean $(T) aggregate-results clean valgrind perf \
+ check-chainlint clean-chainlint test-chainlint $(UNIT_TESTS)
diff --git a/t/README b/t/README
index 4f9981c..d9e0e07 100644
--- a/t/README
+++ b/t/README
@@ -32,7 +32,14 @@ the tests.
ok 2 - plain with GIT_WORK_TREE
ok 3 - plain bare
-Since the tests all output TAP (see http://testanything.org) they can
+t/Makefile defines a target for each test file, such that you can also use
+shell pattern matching to run a subset of the tests:
+
+ make *checkout*
+
+will run all tests with 'checkout' in their filename.
+
+Since the tests all output TAP (see https://testanything.org) they can
be run with any TAP harness. Here's an example of parallel testing
powered by a recent version of prove(1):
@@ -196,11 +203,6 @@ appropriately before running "make". Short options can be bundled, i.e.
this feature by setting the GIT_TEST_CHAIN_LINT environment
variable to "1" or "0", respectively.
- A few test scripts disable some of the more advanced
- chain-linting detection in the name of efficiency. You can
- override this by setting the GIT_TEST_CHAIN_LINT_HARDER
- environment variable to "1".
-
--stress::
Run the test script repeatedly in multiple parallel jobs until
one of them fails. Useful for reproducing rare failures in
@@ -267,8 +269,8 @@ The argument for --run, <test-selector>, is a list of description
substrings or globs or individual test numbers or ranges with an
optional negation prefix (of '!') that define what tests in a test
suite to include (or exclude, if negated) in the run. A range is two
-numbers separated with a dash and matches a range of tests with both
-ends been included. You may omit the first or the second number to
+numbers separated with a dash and specifies an inclusive range of tests
+to run. You may omit the first or the second number to
mean "from the first test" or "up to the very last test" respectively.
The argument to --run is split on commas into separate strings,
@@ -279,10 +281,10 @@ text that you want to match includes a comma, use the glob character
on all tests that match either the glob *rebase* or the glob
*merge?cherry-pick*.
-If --run starts with an unprefixed number or range the initial
-set of tests to run is empty. If the first item starts with '!'
+If --run starts with an unprefixed number or range, the initial
+set of tests to run is empty. If the first item starts with '!',
all the tests are added to the initial set. After initial set is
-determined every test number or range is added or excluded from
+determined, every test number or range is added or excluded from
the set one by one, from left to right.
For example, to run only tests up to a specific test (21), one
@@ -366,12 +368,47 @@ excluded as so much relies on it, but this might change in the future.
GIT_TEST_SPLIT_INDEX=<boolean> forces split-index mode on the whole
test suite. Accept any boolean values that are accepted by git-config.
-GIT_TEST_PASSING_SANITIZE_LEAK=<boolean> when compiled with
-SANITIZE=leak will run only those tests that have whitelisted
-themselves as passing with no memory leaks. Tests can be whitelisted
-by setting "TEST_PASSES_SANITIZE_LEAK=true" before sourcing
-"test-lib.sh" itself at the top of the test script. This test mode is
-used by the "linux-leaks" CI target.
+GIT_TEST_PASSING_SANITIZE_LEAK=true skips those tests that haven't
+declared themselves as leak-free by setting
+"TEST_PASSES_SANITIZE_LEAK=true" before sourcing "test-lib.sh". This
+test mode is used by the "linux-leaks" CI target.
+
+GIT_TEST_PASSING_SANITIZE_LEAK=check checks that our
+"TEST_PASSES_SANITIZE_LEAK=true" markings are current. Rather than
+skipping those tests that haven't set "TEST_PASSES_SANITIZE_LEAK=true"
+before sourcing "test-lib.sh" this mode runs them with
+"--invert-exit-code". This is used to check that there's a one-to-one
+mapping between "TEST_PASSES_SANITIZE_LEAK=true" and those tests that
+pass under "SANITIZE=leak". This is especially useful when testing a
+series that fixes various memory leaks with "git rebase -x".
+
+GIT_TEST_SANITIZE_LEAK_LOG=true will log memory leaks to
+"test-results/$TEST_NAME.leak/trace.*" files. The logs include a
+"dedup_token" (see +"ASAN_OPTIONS=help=1 ./git") and other options to
+make logs +machine-readable.
+
+With GIT_TEST_SANITIZE_LEAK_LOG=true we'll look at the leak logs
+before exiting and exit on failure if the logs showed that we had a
+memory leak, even if the test itself would have otherwise passed. This
+allows us to catch e.g. missing &&-chaining. This is especially useful
+when combined with "GIT_TEST_PASSING_SANITIZE_LEAK", see below.
+
+GIT_TEST_PASSING_SANITIZE_LEAK=check when combined with "--immediate"
+will run to completion faster, and result in the same failing
+tests. The only practical reason to run
+GIT_TEST_PASSING_SANITIZE_LEAK=check without "--immediate" is to
+combine it with "GIT_TEST_SANITIZE_LEAK_LOG=true". If we stop at the
+first failing test case our leak logs won't show subsequent leaks we
+might have run into.
+
+GIT_TEST_PASSING_SANITIZE_LEAK=(true|check) will not catch all memory
+leaks unless combined with GIT_TEST_SANITIZE_LEAK_LOG=true. Some tests
+run "git" (or "test-tool" etc.) without properly checking the exit
+code, or git will invoke itself and fail to ferry the abort() exit
+code to the original caller. When the two modes are combined we'll
+look at the "test-results/$TEST_NAME.leak/trace.*" files at the end of
+the test run to see if had memory leaks which the test itself didn't
+catch.
GIT_TEST_PROTOCOL_VERSION=<n>, when set, makes 'protocol.version'
default to n.
@@ -412,6 +449,10 @@ GIT_TEST_INDEX_VERSION=<n> exercises the index read/write code path
for the index version specified. Can be set to any valid version
(currently 2, 3, or 4).
+GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL=<boolean> if enabled will
+use the boundary-based bitmap traversal algorithm. See the documentation
+of `pack.useBitmapBoundaryTraversal` for more details.
+
GIT_TEST_PACK_SPARSE=<boolean> if disabled will default the pack-objects
builtin to use the non-sparse object walk. This can still be overridden by
the --sparse command-line argument.
@@ -419,10 +460,6 @@ the --sparse command-line argument.
GIT_TEST_PRELOAD_INDEX=<boolean> exercises the preload-index code path
by overriding the minimum number of cache entries required per thread.
-GIT_TEST_ADD_I_USE_BUILTIN=<boolean>, when false, disables the
-built-in version of git add -i. See 'add.interactive.useBuiltin' in
-git-config(1).
-
GIT_TEST_INDEX_THREADS=<n> enables exercising the multi-threaded loading
of the index for the whole test suite by bypassing the default number of
cache entries and thread minimums. Setting this to 1 will make the
@@ -449,7 +486,10 @@ GIT_TEST_DEFAULT_HASH=<hash-algo> specifies which hash algorithm to
use in the test scripts. Recognized values for <hash-algo> are "sha1"
and "sha256".
-GIT_TEST_WRITE_REV_INDEX=<boolean>, when true enables the
+GIT_TEST_DEFAULT_REF_FORMAT=<format> specifies which ref storage format
+to use in the test scripts. Recognized values for <format> are "files".
+
+GIT_TEST_NO_WRITE_REV_INDEX=<boolean>, when true disables the
'pack.writeReverseIndex' setting.
GIT_TEST_SPARSE_INDEX=<boolean>, when true enables index writes to use the
@@ -549,11 +589,11 @@ This test harness library does the following things:
Recommended style
-----------------
-Here are some recommented styles when writing test case.
- - Keep test title the same line with test helper function itself.
+ - Keep the test_expect_* function call and test title on
+ the same line.
- Take test_expect_success helper for example, write it like:
+ For example, with test_expect_success, write it like:
test_expect_success 'test title' '
... test body ...
@@ -565,10 +605,9 @@ Here are some recommented styles when writing test case.
'test title' \
'... test body ...'
+ - End the line with an opening single quote.
- - End the line with a single quote.
-
- - Indent the body of here-document, and use "<<-" instead of "<<"
+ - Indent here-document bodies, and use "<<-" instead of "<<"
to strip leading TABs used for indentation:
test_expect_success 'test something' '
@@ -594,7 +633,7 @@ Here are some recommented styles when writing test case.
'
- Quote or escape the EOF delimiter that begins a here-document if
- there is no parameter and other expansion in it, to signal readers
+ there is no parameter or other expansion in it, to signal readers
that they can skim it more casually:
cmd <<-\EOF
@@ -608,7 +647,7 @@ Do's & don'ts
Here are a few examples of things you probably should and shouldn't do
when writing tests.
-Here are the "do's:"
+The "do's:"
- Put all code inside test_expect_success and other assertions.
@@ -692,6 +731,26 @@ Here are the "do's:"
Note that we still &&-chain the loop to propagate failures from
earlier commands.
+ - Repeat tests with slightly different arguments in a loop.
+
+ In some cases it may make sense to re-run the same set of tests with
+ different options or commands to ensure that the command behaves
+ despite the different parameters. This can be achieved by looping
+ around a specific parameter:
+
+ for arg in '' "--foo"
+ do
+ test_expect_success "test command ${arg:-without arguments}" '
+ command $arg
+ '
+ done
+
+ Note that while the test title uses double quotes ("), the test body
+ should continue to use single quotes (') to avoid breakage in case the
+ values contain e.g. quoting characters. The loop variable will be
+ accessible regardless of the single quotes as the test body is passed
+ to `eval`.
+
And here are the "don'ts:"
@@ -858,7 +917,7 @@ see test-lib-functions.sh for the full list and their options.
rare case where your test depends on more than one:
test_expect_success PERL,PYTHON 'yo dawg' \
- ' test $(perl -E 'print eval "1 +" . qx[python -c "print 2"]') == "4" '
+ ' test $(perl -E '\''print eval "1 +" . qx[python -c "print(2)"]'\'') = "4" '
- test_expect_failure [<prereq>] <message> <script>
@@ -935,32 +994,6 @@ see test-lib-functions.sh for the full list and their options.
test_done
fi
- - test_external [<prereq>] <message> <external> <script>
-
- Execute a <script> with an <external> interpreter (like perl). This
- was added for tests like t9700-perl-git.sh which do most of their
- work in an external test script.
-
- test_external \
- 'GitwebCache::*FileCache*' \
- perl "$TEST_DIRECTORY"/t9503/test_cache_interface.pl
-
- If the test is outputting its own TAP you should set the
- test_external_has_tap variable somewhere before calling the first
- test_external* function. See t9700-perl-git.sh for an example.
-
- # The external test will outputs its own plan
- test_external_has_tap=1
-
- - test_external_without_stderr [<prereq>] <message> <external> <script>
-
- Like test_external but fail if there's any output on stderr,
- instead of checking the exit code.
-
- test_external_without_stderr \
- 'Perl API' \
- perl "$TEST_DIRECTORY"/t9700/test.pl
-
- test_expect_code <exit-code> <command>
Run a command and ensure that it exits with the given exit code.
@@ -1098,6 +1131,12 @@ see test-lib-functions.sh for the full list and their options.
the symbolic link in the file system and a part that does; then only
the latter part need be protected by a SYMLINKS prerequisite (see below).
+ - test_path_is_executable
+
+ This tests whether a file is executable and prints an error message
+ if not. This must be used only under the POSIXPERM prerequisite
+ (see below).
+
- test_oid_init
This function loads facts and useful object IDs related to the hash
@@ -1227,8 +1266,8 @@ and it knows that the object ID of an empty tree is a certain
because the things the very basic core test tries to achieve is
to serve as a basis for people who are changing the Git internals
drastically. For these people, after making certain changes,
-not seeing failures from the basic test _is_ a failure. And
-such drastic changes to the core Git that even changes these
+not seeing failures from the basic test _is_ a failure. Any
+Git core changes so drastic that they change even these
otherwise supposedly stable object IDs should be accompanied by
an update to t0000-basic.sh.
@@ -1238,7 +1277,7 @@ knowledge of the core Git internals. If all the test scripts
hardcoded the object IDs like t0000-basic.sh does, that defeats
the purpose of t0000-basic.sh, which is to isolate that level of
validation in one place. Your test also ends up needing
-updating when such a change to the internal happens, so do _not_
+an update whenever the internals change, so do _not_
do it and leave the low level of validation to t0000-basic.sh.
Test coverage
@@ -1269,7 +1308,7 @@ Devel::Cover module. To install it do:
sudo aptitude install libdevel-cover-perl
# From the CPAN with cpanminus
- curl -L http://cpanmin.us | perl - --sudo --self-upgrade
+ curl -L https://cpanmin.us/ | perl - --sudo --self-upgrade
cpanm --sudo Devel::Cover
Then, at the top-level:
diff --git a/t/aggregate-results.sh b/t/aggregate-results.sh
index 7f2b83b..6e3bcc4 100755
--- a/t/aggregate-results.sh
+++ b/t/aggregate-results.sh
@@ -8,7 +8,7 @@ broken=0
total=0
missing_prereq=
-while read file
+for file in "$1"/t*-*.counts
do
while read type value
do
diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index cc01d89..8757245 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -72,6 +72,32 @@ test_expect_success 'blame 1 author' '
check_count A 2
'
+test_expect_success 'blame working copy' '
+ test_when_finished "git restore file" &&
+ echo "1A quick brown fox jumps over the" >file &&
+ echo "another lazy dog" >>file &&
+ check_count A 1 "Not Committed Yet" 1
+'
+
+test_expect_success 'blame with --contents' '
+ check_count --contents=file A 2
+'
+
+test_expect_success 'blame with --contents in a bare repo' '
+ git clone --bare . bare-contents.git &&
+ (
+ cd bare-contents.git &&
+ echo "1A quick brown fox jumps over the" >contents &&
+ check_count --contents=contents A 1
+ )
+'
+
+test_expect_success 'blame with --contents changed' '
+ echo "1A quick brown fox jumps over the" >contents &&
+ echo "another lazy dog" >>contents &&
+ check_count --contents=contents A 1 "External file (--contents)" 1
+'
+
test_expect_success 'blame in a bare repo without starting commit' '
git clone --bare . bare.git &&
(
@@ -98,6 +124,10 @@ test_expect_success 'blame 2 authors' '
check_count A 2 B 2
'
+test_expect_success 'blame with --contents and revision' '
+ check_count -h testTag --contents=file A 2 "External file (--contents)" 2
+'
+
test_expect_success 'setup B1 lines (branch1)' '
git checkout -b branch1 main &&
echo "3A slow green fox jumps into the" >>file &&
@@ -153,7 +183,7 @@ test_expect_success 'blame evil merge' '
test_expect_success 'blame huge graft' '
test_when_finished "git checkout branch2" &&
- test_when_finished "rm -f .git/info/grafts" &&
+ test_when_finished "rm -rf .git/info" &&
graft= &&
for i in 0 1 2
do
@@ -168,6 +198,7 @@ test_expect_success 'blame huge graft' '
graft="$graft$commit " || return 1
done
done &&
+ mkdir .git/info &&
printf "%s " $graft >.git/info/grafts &&
check_count -h 00 01 1 10 1
'
@@ -501,7 +532,7 @@ test_expect_success 'blame -L :funcname with userdiff driver' '
"$(cat file.template)" &&
test_commit --author "B <B@test.git>" \
"change" "$fortran_file" \
- "$(cat file.template | sed -e s/ChangeMe/IWasChanged/)" &&
+ "$(sed -e s/ChangeMe/IWasChanged/ file.template)" &&
check_count -f "$fortran_file" -L:RIGHT A 3 B 1
'
diff --git a/t/chainlint.pl b/t/chainlint.pl
new file mode 100755
index 0000000..556ee91
--- /dev/null
+++ b/t/chainlint.pl
@@ -0,0 +1,832 @@
+#!/usr/bin/env perl
+#
+# Copyright (c) 2021-2022 Eric Sunshine <sunshine@sunshineco.com>
+#
+# This tool scans shell scripts for test definitions and checks those tests for
+# problems, such as broken &&-chains, which might hide bugs in the tests
+# themselves or in behaviors being exercised by the tests.
+#
+# Input arguments are pathnames of shell scripts containing test definitions,
+# or globs referencing a collection of scripts. For each problem discovered,
+# the pathname of the script containing the test is printed along with the test
+# name and the test body with a `?!FOO?!` annotation at the location of each
+# detected problem, where "FOO" is a tag such as "AMP" which indicates a broken
+# &&-chain. Returns zero if no problems are discovered, otherwise non-zero.
+
+use warnings;
+use strict;
+use Config;
+use File::Glob;
+use Getopt::Long;
+
+my $jobs = -1;
+my $show_stats;
+my $emit_all;
+
+# Lexer tokenizes POSIX shell scripts. It is roughly modeled after section 2.3
+# "Token Recognition" of POSIX chapter 2 "Shell Command Language". Although
+# similar to lexical analyzers for other languages, this one differs in a few
+# substantial ways due to quirks of the shell command language.
+#
+# For instance, in many languages, newline is just whitespace like space or
+# TAB, but in shell a newline is a command separator, thus a distinct lexical
+# token. A newline is significant and returned as a distinct token even at the
+# end of a shell comment.
+#
+# In other languages, `1+2` would typically be scanned as three tokens
+# (`1`, `+`, and `2`), but in shell it is a single token. However, the similar
+# `1 + 2`, which embeds whitepace, is scanned as three token in shell, as well.
+# In shell, several characters with special meaning lose that meaning when not
+# surrounded by whitespace. For instance, the negation operator `!` is special
+# when standing alone surrounded by whitespace; whereas in `foo!uucp` it is
+# just a plain character in the longer token "foo!uucp". In many other
+# languages, `"string"/foo:'string'` might be scanned as five tokens ("string",
+# `/`, `foo`, `:`, and 'string'), but in shell, it is just a single token.
+#
+# The lexical analyzer for the shell command language is also somewhat unusual
+# in that it recursively invokes the parser to handle the body of `$(...)`
+# expressions which can contain arbitrary shell code. Such expressions may be
+# encountered both inside and outside of double-quoted strings.
+#
+# The lexical analyzer is responsible for consuming shell here-doc bodies which
+# extend from the line following a `<<TAG` operator until a line consisting
+# solely of `TAG`. Here-doc consumption begins when a newline is encountered.
+# It is legal for multiple here-doc `<<TAG` operators to be present on a single
+# line, in which case their bodies must be present one following the next, and
+# are consumed in the (left-to-right) order the `<<TAG` operators appear on the
+# line. A special complication is that the bodies of all here-docs must be
+# consumed when the newline is encountered even if the parse context depth has
+# changed. For instance, in `cat <<A && x=$(cat <<B &&\n`, bodies of here-docs
+# "A" and "B" must be consumed even though "A" was introduced outside the
+# recursive parse context in which "B" was introduced and in which the newline
+# is encountered.
+package Lexer;
+
+sub new {
+ my ($class, $parser, $s) = @_;
+ bless {
+ parser => $parser,
+ buff => $s,
+ lineno => 1,
+ heretags => []
+ } => $class;
+}
+
+sub scan_heredoc_tag {
+ my $self = shift @_;
+ ${$self->{buff}} =~ /\G(-?)/gc;
+ my $indented = $1;
+ my $token = $self->scan_token();
+ return "<<$indented" unless $token;
+ my $tag = $token->[0];
+ $tag =~ s/['"\\]//g;
+ $$token[0] = $indented ? "\t$tag" : "$tag";
+ push(@{$self->{heretags}}, $token);
+ return "<<$indented$tag";
+}
+
+sub scan_op {
+ my ($self, $c) = @_;
+ my $b = $self->{buff};
+ return $c unless $$b =~ /\G(.)/sgc;
+ my $cc = $c . $1;
+ return scan_heredoc_tag($self) if $cc eq '<<';
+ return $cc if $cc =~ /^(?:&&|\|\||>>|;;|<&|>&|<>|>\|)$/;
+ pos($$b)--;
+ return $c;
+}
+
+sub scan_sqstring {
+ my $self = shift @_;
+ ${$self->{buff}} =~ /\G([^']*'|.*\z)/sgc;
+ my $s = $1;
+ $self->{lineno} += () = $s =~ /\n/sg;
+ return "'" . $s;
+}
+
+sub scan_dqstring {
+ my $self = shift @_;
+ my $b = $self->{buff};
+ my $s = '"';
+ while (1) {
+ # slurp up non-special characters
+ $s .= $1 if $$b =~ /\G([^"\$\\]+)/gc;
+ # handle special characters
+ last unless $$b =~ /\G(.)/sgc;
+ my $c = $1;
+ $s .= '"', last if $c eq '"';
+ $s .= '$' . $self->scan_dollar(), next if $c eq '$';
+ if ($c eq '\\') {
+ $s .= '\\', last unless $$b =~ /\G(.)/sgc;
+ $c = $1;
+ $self->{lineno}++, next if $c eq "\n"; # line splice
+ # backslash escapes only $, `, ", \ in dq-string
+ $s .= '\\' unless $c =~ /^[\$`"\\]$/;
+ $s .= $c;
+ next;
+ }
+ die("internal error scanning dq-string '$c'\n");
+ }
+ $self->{lineno} += () = $s =~ /\n/sg;
+ return $s;
+}
+
+sub scan_balanced {
+ my ($self, $c1, $c2) = @_;
+ my $b = $self->{buff};
+ my $depth = 1;
+ my $s = $c1;
+ while ($$b =~ /\G([^\Q$c1$c2\E]*(?:[\Q$c1$c2\E]|\z))/gc) {
+ $s .= $1;
+ $depth++, next if $s =~ /\Q$c1\E$/;
+ $depth--;
+ last if $depth == 0;
+ }
+ $self->{lineno} += () = $s =~ /\n/sg;
+ return $s;
+}
+
+sub scan_subst {
+ my $self = shift @_;
+ my @tokens = $self->{parser}->parse(qr/^\)$/);
+ $self->{parser}->next_token(); # closing ")"
+ return @tokens;
+}
+
+sub scan_dollar {
+ my $self = shift @_;
+ my $b = $self->{buff};
+ return $self->scan_balanced('(', ')') if $$b =~ /\G\((?=\()/gc; # $((...))
+ return '(' . join(' ', map {$_->[0]} $self->scan_subst()) . ')' if $$b =~ /\G\(/gc; # $(...)
+ return $self->scan_balanced('{', '}') if $$b =~ /\G\{/gc; # ${...}
+ return $1 if $$b =~ /\G(\w+)/gc; # $var
+ return $1 if $$b =~ /\G([@*#?$!0-9-])/gc; # $*, $1, $$, etc.
+ return '';
+}
+
+sub swallow_heredocs {
+ my $self = shift @_;
+ my $b = $self->{buff};
+ my $tags = $self->{heretags};
+ while (my $tag = shift @$tags) {
+ my $start = pos($$b);
+ my $indent = $$tag[0] =~ s/^\t// ? '\\s*' : '';
+ $$b =~ /(?:\G|\n)$indent\Q$$tag[0]\E(?:\n|\z)/gc;
+ if (pos($$b) > $start) {
+ my $body = substr($$b, $start, pos($$b) - $start);
+ $self->{lineno} += () = $body =~ /\n/sg;
+ next;
+ }
+ push(@{$self->{parser}->{problems}}, ['UNCLOSED-HEREDOC', $tag]);
+ $$b =~ /(?:\G|\n).*\z/gc; # consume rest of input
+ my $body = substr($$b, $start, pos($$b) - $start);
+ $self->{lineno} += () = $body =~ /\n/sg;
+ last;
+ }
+}
+
+sub scan_token {
+ my $self = shift @_;
+ my $b = $self->{buff};
+ my $token = '';
+ my ($start, $startln);
+RESTART:
+ $startln = $self->{lineno};
+ $$b =~ /\G[ \t]+/gc; # skip whitespace (but not newline)
+ $start = pos($$b) || 0;
+ $self->{lineno}++, return ["\n", $start, pos($$b), $startln, $startln] if $$b =~ /\G#[^\n]*(?:\n|\z)/gc; # comment
+ while (1) {
+ # slurp up non-special characters
+ $token .= $1 if $$b =~ /\G([^\\;&|<>(){}'"\$\s]+)/gc;
+ # handle special characters
+ last unless $$b =~ /\G(.)/sgc;
+ my $c = $1;
+ pos($$b)--, last if $c =~ /^[ \t]$/; # whitespace ends token
+ pos($$b)--, last if length($token) && $c =~ /^[;&|<>(){}\n]$/;
+ $token .= $self->scan_sqstring(), next if $c eq "'";
+ $token .= $self->scan_dqstring(), next if $c eq '"';
+ $token .= $c . $self->scan_dollar(), next if $c eq '$';
+ $self->{lineno}++, $self->swallow_heredocs(), $token = $c, last if $c eq "\n";
+ $token = $self->scan_op($c), last if $c =~ /^[;&|<>]$/;
+ $token = $c, last if $c =~ /^[(){}]$/;
+ if ($c eq '\\') {
+ $token .= '\\', last unless $$b =~ /\G(.)/sgc;
+ $c = $1;
+ $self->{lineno}++, next if $c eq "\n" && length($token); # line splice
+ $self->{lineno}++, goto RESTART if $c eq "\n"; # line splice
+ $token .= '\\' . $c;
+ next;
+ }
+ die("internal error scanning character '$c'\n");
+ }
+ return length($token) ? [$token, $start, pos($$b), $startln, $self->{lineno}] : undef;
+}
+
+# ShellParser parses POSIX shell scripts (with minor extensions for Bash). It
+# is a recursive descent parser very roughly modeled after section 2.10 "Shell
+# Grammar" of POSIX chapter 2 "Shell Command Language".
+package ShellParser;
+
+sub new {
+ my ($class, $s) = @_;
+ my $self = bless {
+ buff => [],
+ stop => [],
+ output => []
+ } => $class;
+ $self->{lexer} = Lexer->new($self, $s);
+ return $self;
+}
+
+sub next_token {
+ my $self = shift @_;
+ return pop(@{$self->{buff}}) if @{$self->{buff}};
+ return $self->{lexer}->scan_token();
+}
+
+sub untoken {
+ my $self = shift @_;
+ push(@{$self->{buff}}, @_);
+}
+
+sub peek {
+ my $self = shift @_;
+ my $token = $self->next_token();
+ return undef unless defined($token);
+ $self->untoken($token);
+ return $token;
+}
+
+sub stop_at {
+ my ($self, $token) = @_;
+ return 1 unless defined($token);
+ my $stop = ${$self->{stop}}[-1] if @{$self->{stop}};
+ return defined($stop) && $token->[0] =~ $stop;
+}
+
+sub expect {
+ my ($self, $expect) = @_;
+ my $token = $self->next_token();
+ return $token if defined($token) && $token->[0] eq $expect;
+ push(@{$self->{output}}, "?!ERR?! expected '$expect' but found '" . (defined($token) ? $token->[0] : "<end-of-input>") . "'\n");
+ $self->untoken($token) if defined($token);
+ return ();
+}
+
+sub optional_newlines {
+ my $self = shift @_;
+ my @tokens;
+ while (my $token = $self->peek()) {
+ last unless $token->[0] eq "\n";
+ push(@tokens, $self->next_token());
+ }
+ return @tokens;
+}
+
+sub parse_group {
+ my $self = shift @_;
+ return ($self->parse(qr/^}$/),
+ $self->expect('}'));
+}
+
+sub parse_subshell {
+ my $self = shift @_;
+ return ($self->parse(qr/^\)$/),
+ $self->expect(')'));
+}
+
+sub parse_case_pattern {
+ my $self = shift @_;
+ my @tokens;
+ while (defined(my $token = $self->next_token())) {
+ push(@tokens, $token);
+ last if $token->[0] eq ')';
+ }
+ return @tokens;
+}
+
+sub parse_case {
+ my $self = shift @_;
+ my @tokens;
+ push(@tokens,
+ $self->next_token(), # subject
+ $self->optional_newlines(),
+ $self->expect('in'),
+ $self->optional_newlines());
+ while (1) {
+ my $token = $self->peek();
+ last unless defined($token) && $token->[0] ne 'esac';
+ push(@tokens,
+ $self->parse_case_pattern(),
+ $self->optional_newlines(),
+ $self->parse(qr/^(?:;;|esac)$/)); # item body
+ $token = $self->peek();
+ last unless defined($token) && $token->[0] ne 'esac';
+ push(@tokens,
+ $self->expect(';;'),
+ $self->optional_newlines());
+ }
+ push(@tokens, $self->expect('esac'));
+ return @tokens;
+}
+
+sub parse_for {
+ my $self = shift @_;
+ my @tokens;
+ push(@tokens,
+ $self->next_token(), # variable
+ $self->optional_newlines());
+ my $token = $self->peek();
+ if (defined($token) && $token->[0] eq 'in') {
+ push(@tokens,
+ $self->expect('in'),
+ $self->optional_newlines());
+ }
+ push(@tokens,
+ $self->parse(qr/^do$/), # items
+ $self->expect('do'),
+ $self->optional_newlines(),
+ $self->parse_loop_body(),
+ $self->expect('done'));
+ return @tokens;
+}
+
+sub parse_if {
+ my $self = shift @_;
+ my @tokens;
+ while (1) {
+ push(@tokens,
+ $self->parse(qr/^then$/), # if/elif condition
+ $self->expect('then'),
+ $self->optional_newlines(),
+ $self->parse(qr/^(?:elif|else|fi)$/)); # if/elif body
+ my $token = $self->peek();
+ last unless defined($token) && $token->[0] eq 'elif';
+ push(@tokens, $self->expect('elif'));
+ }
+ my $token = $self->peek();
+ if (defined($token) && $token->[0] eq 'else') {
+ push(@tokens,
+ $self->expect('else'),
+ $self->optional_newlines(),
+ $self->parse(qr/^fi$/)); # else body
+ }
+ push(@tokens, $self->expect('fi'));
+ return @tokens;
+}
+
+sub parse_loop_body {
+ my $self = shift @_;
+ return $self->parse(qr/^done$/);
+}
+
+sub parse_loop {
+ my $self = shift @_;
+ return ($self->parse(qr/^do$/), # condition
+ $self->expect('do'),
+ $self->optional_newlines(),
+ $self->parse_loop_body(),
+ $self->expect('done'));
+}
+
+sub parse_func {
+ my $self = shift @_;
+ return ($self->expect('('),
+ $self->expect(')'),
+ $self->optional_newlines(),
+ $self->parse_cmd()); # body
+}
+
+sub parse_bash_array_assignment {
+ my $self = shift @_;
+ my @tokens = $self->expect('(');
+ while (defined(my $token = $self->next_token())) {
+ push(@tokens, $token);
+ last if $token->[0] eq ')';
+ }
+ return @tokens;
+}
+
+my %compound = (
+ '{' => \&parse_group,
+ '(' => \&parse_subshell,
+ 'case' => \&parse_case,
+ 'for' => \&parse_for,
+ 'if' => \&parse_if,
+ 'until' => \&parse_loop,
+ 'while' => \&parse_loop);
+
+sub parse_cmd {
+ my $self = shift @_;
+ my $cmd = $self->next_token();
+ return () unless defined($cmd);
+ return $cmd if $cmd->[0] eq "\n";
+
+ my $token;
+ my @tokens = $cmd;
+ if ($cmd->[0] eq '!') {
+ push(@tokens, $self->parse_cmd());
+ return @tokens;
+ } elsif (my $f = $compound{$cmd->[0]}) {
+ push(@tokens, $self->$f());
+ } elsif (defined($token = $self->peek()) && $token->[0] eq '(') {
+ if ($cmd->[0] !~ /\w=$/) {
+ push(@tokens, $self->parse_func());
+ return @tokens;
+ }
+ my @array = $self->parse_bash_array_assignment();
+ $tokens[-1]->[0] .= join(' ', map {$_->[0]} @array);
+ $tokens[-1]->[2] = $array[$#array][2] if @array;
+ }
+
+ while (defined(my $token = $self->next_token())) {
+ $self->untoken($token), last if $self->stop_at($token);
+ push(@tokens, $token);
+ last if $token->[0] =~ /^(?:[;&\n|]|&&|\|\|)$/;
+ }
+ push(@tokens, $self->next_token()) if $tokens[-1]->[0] ne "\n" && defined($token = $self->peek()) && $token->[0] eq "\n";
+ return @tokens;
+}
+
+sub accumulate {
+ my ($self, $tokens, $cmd) = @_;
+ push(@$tokens, @$cmd);
+}
+
+sub parse {
+ my ($self, $stop) = @_;
+ push(@{$self->{stop}}, $stop);
+ goto DONE if $self->stop_at($self->peek());
+ my @tokens;
+ while (my @cmd = $self->parse_cmd()) {
+ $self->accumulate(\@tokens, \@cmd);
+ last if $self->stop_at($self->peek());
+ }
+DONE:
+ pop(@{$self->{stop}});
+ return @tokens;
+}
+
+# TestParser is a subclass of ShellParser which, beyond parsing shell script
+# code, is also imbued with semantic knowledge of test construction, and checks
+# tests for common problems (such as broken &&-chains) which might hide bugs in
+# the tests themselves or in behaviors being exercised by the tests. As such,
+# TestParser is only called upon to parse test bodies, not the top-level
+# scripts in which the tests are defined.
+package TestParser;
+
+use base 'ShellParser';
+
+sub new {
+ my $class = shift @_;
+ my $self = $class->SUPER::new(@_);
+ $self->{problems} = [];
+ return $self;
+}
+
+sub find_non_nl {
+ my $tokens = shift @_;
+ my $n = shift @_;
+ $n = $#$tokens if !defined($n);
+ $n-- while $n >= 0 && $$tokens[$n]->[0] eq "\n";
+ return $n;
+}
+
+sub ends_with {
+ my ($tokens, $needles) = @_;
+ my $n = find_non_nl($tokens);
+ for my $needle (reverse(@$needles)) {
+ return undef if $n < 0;
+ $n = find_non_nl($tokens, $n), next if $needle eq "\n";
+ return undef if $$tokens[$n]->[0] !~ $needle;
+ $n--;
+ }
+ return 1;
+}
+
+sub match_ending {
+ my ($tokens, $endings) = @_;
+ for my $needles (@$endings) {
+ next if @$tokens < scalar(grep {$_ ne "\n"} @$needles);
+ return 1 if ends_with($tokens, $needles);
+ }
+ return undef;
+}
+
+sub parse_loop_body {
+ my $self = shift @_;
+ my @tokens = $self->SUPER::parse_loop_body(@_);
+ # did loop signal failure via "|| return" or "|| exit"?
+ return @tokens if !@tokens || grep {$_->[0] =~ /^(?:return|exit|\$\?)$/} @tokens;
+ # did loop upstream of a pipe signal failure via "|| echo 'impossible
+ # text'" as the final command in the loop body?
+ return @tokens if ends_with(\@tokens, [qr/^\|\|$/, "\n", qr/^echo$/, qr/^.+$/]);
+ # flag missing "return/exit" handling explicit failure in loop body
+ my $n = find_non_nl(\@tokens);
+ push(@{$self->{problems}}, ['LOOP', $tokens[$n]]);
+ return @tokens;
+}
+
+my @safe_endings = (
+ [qr/^(?:&&|\|\||\||&)$/],
+ [qr/^(?:exit|return)$/, qr/^(?:\d+|\$\?)$/],
+ [qr/^(?:exit|return)$/, qr/^(?:\d+|\$\?)$/, qr/^;$/],
+ [qr/^(?:exit|return|continue)$/],
+ [qr/^(?:exit|return|continue)$/, qr/^;$/]);
+
+sub accumulate {
+ my ($self, $tokens, $cmd) = @_;
+ my $problems = $self->{problems};
+
+ # no previous command to check for missing "&&"
+ goto DONE unless @$tokens;
+
+ # new command is empty line; can't yet check if previous is missing "&&"
+ goto DONE if @$cmd == 1 && $$cmd[0]->[0] eq "\n";
+
+ # did previous command end with "&&", "|", "|| return" or similar?
+ goto DONE if match_ending($tokens, \@safe_endings);
+
+ # if this command handles "$?" specially, then okay for previous
+ # command to be missing "&&"
+ for my $token (@$cmd) {
+ goto DONE if $token->[0] =~ /\$\?/;
+ }
+
+ # if this command is "false", "return 1", or "exit 1" (which signal
+ # failure explicitly), then okay for all preceding commands to be
+ # missing "&&"
+ if ($$cmd[0]->[0] =~ /^(?:false|return|exit)$/) {
+ @$problems = grep {$_->[0] ne 'AMP'} @$problems;
+ goto DONE;
+ }
+
+ # flag missing "&&" at end of previous command
+ my $n = find_non_nl($tokens);
+ push(@$problems, ['AMP', $tokens->[$n]]) unless $n < 0;
+
+DONE:
+ $self->SUPER::accumulate($tokens, $cmd);
+}
+
+# ScriptParser is a subclass of ShellParser which identifies individual test
+# definitions within test scripts, and passes each test body through TestParser
+# to identify possible problems. ShellParser detects test definitions not only
+# at the top-level of test scripts but also within compound commands such as
+# loops and function definitions.
+package ScriptParser;
+
+use base 'ShellParser';
+
+sub new {
+ my $class = shift @_;
+ my $self = $class->SUPER::new(@_);
+ $self->{ntests} = 0;
+ return $self;
+}
+
+# extract the raw content of a token, which may be a single string or a
+# composition of multiple strings and non-string character runs; for instance,
+# `"test body"` unwraps to `test body`; `word"a b"42'c d'` to `worda b42c d`
+sub unwrap {
+ my $token = (@_ ? shift @_ : $_)->[0];
+ # simple case: 'sqstring' or "dqstring"
+ return $token if $token =~ s/^'([^']*)'$/$1/;
+ return $token if $token =~ s/^"([^"]*)"$/$1/;
+
+ # composite case
+ my ($s, $q, $escaped);
+ while (1) {
+ # slurp up non-special characters
+ $s .= $1 if $token =~ /\G([^\\'"]*)/gc;
+ # handle special characters
+ last unless $token =~ /\G(.)/sgc;
+ my $c = $1;
+ $q = undef, next if defined($q) && $c eq $q;
+ $q = $c, next if !defined($q) && $c =~ /^['"]$/;
+ if ($c eq '\\') {
+ last unless $token =~ /\G(.)/sgc;
+ $c = $1;
+ $s .= '\\' if $c eq "\n"; # preserve line splice
+ }
+ $s .= $c;
+ }
+ return $s
+}
+
+sub check_test {
+ my $self = shift @_;
+ my ($title, $body) = map(unwrap, @_);
+ $self->{ntests}++;
+ my $parser = TestParser->new(\$body);
+ my @tokens = $parser->parse();
+ my $problems = $parser->{problems};
+ return unless $emit_all || @$problems;
+ my $c = main::fd_colors(1);
+ my $lineno = $_[1]->[3];
+ my $start = 0;
+ my $checked = '';
+ for (sort {$a->[1]->[2] <=> $b->[1]->[2]} @$problems) {
+ my ($label, $token) = @$_;
+ my $pos = $token->[2];
+ $checked .= substr($body, $start, $pos - $start) . " ?!$label?! ";
+ $start = $pos;
+ }
+ $checked .= substr($body, $start);
+ $checked =~ s/^/$lineno++ . ' '/mge;
+ $checked =~ s/^\d+ \n//;
+ $checked =~ s/(\s) \?!/$1?!/mg;
+ $checked =~ s/\?! (\s)/?!$1/mg;
+ $checked =~ s/(\?![^?]+\?!)/$c->{rev}$c->{red}$1$c->{reset}/mg;
+ $checked =~ s/^\d+/$c->{dim}$&$c->{reset}/mg;
+ $checked .= "\n" unless $checked =~ /\n$/;
+ push(@{$self->{output}}, "$c->{blue}# chainlint: $title$c->{reset}\n$checked");
+}
+
+sub parse_cmd {
+ my $self = shift @_;
+ my @tokens = $self->SUPER::parse_cmd();
+ return @tokens unless @tokens && $tokens[0]->[0] =~ /^test_expect_(?:success|failure)$/;
+ my $n = $#tokens;
+ $n-- while $n >= 0 && $tokens[$n]->[0] =~ /^(?:[;&\n|]|&&|\|\|)$/;
+ $self->check_test($tokens[1], $tokens[2]) if $n == 2; # title body
+ $self->check_test($tokens[2], $tokens[3]) if $n > 2; # prereq title body
+ return @tokens;
+}
+
+# main contains high-level functionality for processing command-line switches,
+# feeding input test scripts to ScriptParser, and reporting results.
+package main;
+
+my $getnow = sub { return time(); };
+my $interval = sub { return time() - shift; };
+if (eval {require Time::HiRes; Time::HiRes->import(); 1;}) {
+ $getnow = sub { return [Time::HiRes::gettimeofday()]; };
+ $interval = sub { return Time::HiRes::tv_interval(shift); };
+}
+
+# Restore TERM if test framework set it to "dumb" so 'tput' will work; do this
+# outside of get_colors() since under 'ithreads' all threads use %ENV of main
+# thread and ignore %ENV changes in subthreads.
+$ENV{TERM} = $ENV{USER_TERM} if $ENV{USER_TERM};
+
+my @NOCOLORS = (bold => '', rev => '', dim => '', reset => '', blue => '', green => '', red => '');
+my %COLORS = ();
+sub get_colors {
+ return \%COLORS if %COLORS;
+ if (exists($ENV{NO_COLOR})) {
+ %COLORS = @NOCOLORS;
+ return \%COLORS;
+ }
+ if ($ENV{TERM} =~ /xterm|xterm-\d+color|xterm-new|xterm-direct|nsterm|nsterm-\d+color|nsterm-direct/) {
+ %COLORS = (bold => "\e[1m",
+ rev => "\e[7m",
+ dim => "\e[2m",
+ reset => "\e[0m",
+ blue => "\e[34m",
+ green => "\e[32m",
+ red => "\e[31m");
+ return \%COLORS;
+ }
+ if (system("tput sgr0 >/dev/null 2>&1") == 0 &&
+ system("tput bold >/dev/null 2>&1") == 0 &&
+ system("tput rev >/dev/null 2>&1") == 0 &&
+ system("tput dim >/dev/null 2>&1") == 0 &&
+ system("tput setaf 1 >/dev/null 2>&1") == 0) {
+ %COLORS = (bold => `tput bold`,
+ rev => `tput rev`,
+ dim => `tput dim`,
+ reset => `tput sgr0`,
+ blue => `tput setaf 4`,
+ green => `tput setaf 2`,
+ red => `tput setaf 1`);
+ return \%COLORS;
+ }
+ %COLORS = @NOCOLORS;
+ return \%COLORS;
+}
+
+my %FD_COLORS = ();
+sub fd_colors {
+ my $fd = shift;
+ return $FD_COLORS{$fd} if exists($FD_COLORS{$fd});
+ $FD_COLORS{$fd} = -t $fd ? get_colors() : {@NOCOLORS};
+ return $FD_COLORS{$fd};
+}
+
+sub ncores {
+ # Windows
+ return $ENV{NUMBER_OF_PROCESSORS} if exists($ENV{NUMBER_OF_PROCESSORS});
+ # Linux / MSYS2 / Cygwin / WSL
+ do { local @ARGV='/proc/cpuinfo'; return scalar(grep(/^processor[\s\d]*:/, <>)); } if -r '/proc/cpuinfo';
+ # macOS & BSD
+ return qx/sysctl -n hw.ncpu/ if $^O =~ /(?:^darwin$|bsd)/;
+ return 1;
+}
+
+sub show_stats {
+ my ($start_time, $stats) = @_;
+ my $walltime = $interval->($start_time);
+ my ($usertime) = times();
+ my ($total_workers, $total_scripts, $total_tests, $total_errs) = (0, 0, 0, 0);
+ my $c = fd_colors(2);
+ print(STDERR $c->{green});
+ for (@$stats) {
+ my ($worker, $nscripts, $ntests, $nerrs) = @$_;
+ print(STDERR "worker $worker: $nscripts scripts, $ntests tests, $nerrs errors\n");
+ $total_workers++;
+ $total_scripts += $nscripts;
+ $total_tests += $ntests;
+ $total_errs += $nerrs;
+ }
+ printf(STDERR "total: %d workers, %d scripts, %d tests, %d errors, %.2fs/%.2fs (wall/user)$c->{reset}\n", $total_workers, $total_scripts, $total_tests, $total_errs, $walltime, $usertime);
+}
+
+sub check_script {
+ my ($id, $next_script, $emit) = @_;
+ my ($nscripts, $ntests, $nerrs) = (0, 0, 0);
+ while (my $path = $next_script->()) {
+ $nscripts++;
+ my $fh;
+ unless (open($fh, "<", $path)) {
+ $emit->("?!ERR?! $path: $!\n");
+ next;
+ }
+ my $s = do { local $/; <$fh> };
+ close($fh);
+ my $parser = ScriptParser->new(\$s);
+ 1 while $parser->parse_cmd();
+ if (@{$parser->{output}}) {
+ my $c = fd_colors(1);
+ my $s = join('', @{$parser->{output}});
+ $emit->("$c->{bold}$c->{blue}# chainlint: $path$c->{reset}\n" . $s);
+ $nerrs += () = $s =~ /\?![^?]+\?!/g;
+ }
+ $ntests += $parser->{ntests};
+ }
+ return [$id, $nscripts, $ntests, $nerrs];
+}
+
+sub exit_code {
+ my $stats = shift @_;
+ for (@$stats) {
+ my ($worker, $nscripts, $ntests, $nerrs) = @$_;
+ return 1 if $nerrs;
+ }
+ return 0;
+}
+
+Getopt::Long::Configure(qw{bundling});
+GetOptions(
+ "emit-all!" => \$emit_all,
+ "jobs|j=i" => \$jobs,
+ "stats|show-stats!" => \$show_stats) or die("option error\n");
+$jobs = ncores() if $jobs < 1;
+
+my $start_time = $getnow->();
+my @stats;
+
+my @scripts;
+push(@scripts, File::Glob::bsd_glob($_)) for (@ARGV);
+unless (@scripts) {
+ show_stats($start_time, \@stats) if $show_stats;
+ exit;
+}
+
+unless ($Config{useithreads} && eval {
+ require threads; threads->import();
+ require Thread::Queue; Thread::Queue->import();
+ 1;
+ }) {
+ push(@stats, check_script(1, sub { shift(@scripts); }, sub { print(@_); }));
+ show_stats($start_time, \@stats) if $show_stats;
+ exit(exit_code(\@stats));
+}
+
+my $script_queue = Thread::Queue->new();
+my $output_queue = Thread::Queue->new();
+
+sub next_script { return $script_queue->dequeue(); }
+sub emit { $output_queue->enqueue(@_); }
+
+sub monitor {
+ while (my $s = $output_queue->dequeue()) {
+ print($s);
+ }
+}
+
+my $mon = threads->create({'context' => 'void'}, \&monitor);
+threads->create({'context' => 'list'}, \&check_script, $_, \&next_script, \&emit) for 1..$jobs;
+
+$script_queue->enqueue(@scripts);
+$script_queue->end();
+
+for (threads->list()) {
+ push(@stats, $_->join()) unless $_ == $mon;
+}
+
+$output_queue->end();
+$mon->join();
+
+show_stats($start_time, \@stats) if $show_stats;
+exit(exit_code(\@stats));
diff --git a/t/chainlint.sed b/t/chainlint.sed
deleted file mode 100644
index dc4ce37..0000000
--- a/t/chainlint.sed
+++ /dev/null
@@ -1,399 +0,0 @@
-#------------------------------------------------------------------------------
-# Detect broken &&-chains in tests.
-#
-# At present, only &&-chains in subshells are examined by this linter;
-# top-level &&-chains are instead checked directly by the test framework. Like
-# the top-level &&-chain linter, the subshell linter (intentionally) does not
-# check &&-chains within {...} blocks.
-#
-# Checking for &&-chain breakage is done line-by-line by pure textual
-# inspection.
-#
-# Incomplete lines (those ending with "\") are stitched together with following
-# lines to simplify processing, particularly of "one-liner" statements.
-# Top-level here-docs are swallowed to avoid false positives within the
-# here-doc body, although the statement to which the here-doc is attached is
-# retained.
-#
-# Heuristics are used to detect end-of-subshell when the closing ")" is cuddled
-# with the final subshell statement on the same line:
-#
-# (cd foo &&
-# bar)
-#
-# in order to avoid misinterpreting the ")" in constructs such as "x=$(...)"
-# and "case $x in *)" as ending the subshell.
-#
-# Lines missing a final "&&" are flagged with "?!AMP?!", as are lines which
-# chain commands with ";" internally rather than "&&". A line may be flagged
-# for both violations.
-#
-# Detection of a missing &&-link in a multi-line subshell is complicated by the
-# fact that the last statement before the closing ")" must not end with "&&".
-# Since processing is line-by-line, it is not known whether a missing "&&" is
-# legitimate or not until the _next_ line is seen. To accommodate this, within
-# multi-line subshells, each line is stored in sed's "hold" area until after
-# the next line is seen and processed. If the next line is a stand-alone ")",
-# then a missing "&&" on the previous line is legitimate; otherwise a missing
-# "&&" is a break in the &&-chain.
-#
-# (
-# cd foo &&
-# bar
-# )
-#
-# In practical terms, when "bar" is encountered, it is flagged with "?!AMP?!",
-# but when the stand-alone ")" line is seen which closes the subshell, the
-# "?!AMP?!" violation is removed from the "bar" line (retrieved from the "hold"
-# area) since the final statement of a subshell must not end with "&&". The
-# final line of a subshell may still break the &&-chain by using ";" internally
-# to chain commands together rather than "&&", but an internal "?!AMP?!" is
-# never removed from a line even though a line-ending "?!AMP?!" might be.
-#
-# Care is taken to recognize the last _statement_ of a multi-line subshell, not
-# necessarily the last textual _line_ within the subshell, since &&-chaining
-# applies to statements, not to lines. Consequently, blank lines, comment
-# lines, and here-docs are swallowed (but not the command to which the here-doc
-# is attached), leaving the last statement in the "hold" area, not the last
-# line, thus simplifying &&-link checking.
-#
-# The final statement before "done" in for- and while-loops, and before "elif",
-# "else", and "fi" in if-then-else likewise must not end with "&&", thus
-# receives similar treatment.
-#
-# Swallowing here-docs with arbitrary tags requires a bit of finesse. When a
-# line such as "cat <<EOF" is seen, the here-doc tag is copied to the front of
-# the line enclosed in angle brackets as a sentinel, giving "<EOF>cat <<EOF".
-# As each subsequent line is read, it is appended to the target line and a
-# (whitespace-loose) back-reference match /^<(.*)>\n\1$/ is attempted to see if
-# the content inside "<...>" matches the entirety of the newly-read line. For
-# instance, if the next line read is "some data", when concatenated with the
-# target line, it becomes "<EOF>cat <<EOF\nsome data", and a match is attempted
-# to see if "EOF" matches "some data". Since it doesn't, the next line is
-# attempted. When a line consisting of only "EOF" (and possible whitespace) is
-# encountered, it is appended to the target line giving "<EOF>cat <<EOF\nEOF",
-# in which case the "EOF" inside "<...>" does match the text following the
-# newline, thus the closing here-doc tag has been found. The closing tag line
-# and the "<...>" prefix on the target line are then discarded, leaving just
-# the target line "cat <<EOF".
-#------------------------------------------------------------------------------
-
-# incomplete line -- slurp up next line
-:squash
-/\\$/ {
- N
- s/\\\n//
- bsquash
-}
-
-# here-doc -- swallow it to avoid false hits within its body (but keep the
-# command to which it was attached)
-/<<-*[ ]*[\\'"]*[A-Za-z0-9_]/ {
- /"[^"]*<<[^"]*"/bnotdoc
- s/^\(.*<<-*[ ]*\)[\\'"]*\([A-Za-z0-9_][A-Za-z0-9_]*\)['"]*/<\2>\1\2/
- :hered
- N
- /^<\([^>]*\)>.*\n[ ]*\1[ ]*$/!{
- s/\n.*$//
- bhered
- }
- s/^<[^>]*>//
- s/\n.*$//
-}
-:notdoc
-
-# one-liner "(...) &&"
-/^[ ]*!*[ ]*(..*)[ ]*&&[ ]*$/boneline
-
-# same as above but without trailing "&&"
-/^[ ]*!*[ ]*(..*)[ ]*$/boneline
-
-# one-liner "(...) >x" (or "2>x" or "<x" or "|x" or "&"
-/^[ ]*!*[ ]*(..*)[ ]*[0-9]*[<>|&]/boneline
-
-# multi-line "(...\n...)"
-/^[ ]*(/bsubsh
-
-# innocuous line -- print it and advance to next line
-b
-
-# found one-liner "(...)" -- mark suspect if it uses ";" internally rather than
-# "&&" (but not ";" in a string)
-:oneline
-/;/{
- /"[^"]*;[^"]*"/!s/;/; ?!AMP?!/
-}
-b
-
-:subsh
-# bare "(" line? -- stash for later printing
-/^[ ]*([ ]*$/ {
- h
- bnextln
-}
-# "(..." line -- "(" opening subshell cuddled with command; temporarily replace
-# "(" with sentinel "^" and process the line as if "(" had been seen solo on
-# the preceding line; this temporary replacement prevents several rules from
-# accidentally thinking "(" introduces a nested subshell; "^" is changed back
-# to "(" at output time
-x
-s/.*//
-x
-s/(/^/
-bslurp
-
-:nextln
-N
-s/.*\n//
-
-:slurp
-# incomplete line "...\"
-/\\$/bicmplte
-# multi-line quoted string "...\n..."?
-/"/bdqstr
-# multi-line quoted string '...\n...'? (but not contraction in string "it's")
-/'/{
- /"[^'"]*'[^'"]*"/!bsqstr
-}
-:folded
-# here-doc -- swallow it (but not "<<" in a string)
-/<<-*[ ]*[\\'"]*[A-Za-z0-9_]/{
- /"[^"]*<<[^"]*"/!bheredoc
-}
-# comment or empty line -- discard since final non-comment, non-empty line
-# before closing ")", "done", "elsif", "else", or "fi" will need to be
-# re-visited to drop "suspect" marking since final line of those constructs
-# legitimately lacks "&&", so "suspect" mark must be removed
-/^[ ]*#/bnextln
-/^[ ]*$/bnextln
-# in-line comment -- strip it (but not "#" in a string, Bash ${#...} array
-# length, or Perforce "//depot/path#42" revision in filespec)
-/[ ]#/{
- /"[^"]*#[^"]*"/!s/[ ]#.*$//
-}
-# one-liner "case ... esac"
-/^[ ^]*case[ ]*..*esac/bchkchn
-# multi-line "case ... esac"
-/^[ ^]*case[ ]..*[ ]in/bcase
-# multi-line "for ... done" or "while ... done"
-/^[ ^]*for[ ]..*[ ]in/bcont
-/^[ ^]*while[ ]/bcont
-/^[ ]*do[ ]/bcont
-/^[ ]*do[ ]*$/bcont
-/;[ ]*do/bcont
-/^[ ]*done[ ]*&&[ ]*$/bdone
-/^[ ]*done[ ]*$/bdone
-/^[ ]*done[ ]*[<>|]/bdone
-/^[ ]*done[ ]*)/bdone
-/||[ ]*exit[ ]/bcont
-/||[ ]*exit[ ]*$/bcont
-# multi-line "if...elsif...else...fi"
-/^[ ^]*if[ ]/bcont
-/^[ ]*then[ ]/bcont
-/^[ ]*then[ ]*$/bcont
-/;[ ]*then/bcont
-/^[ ]*elif[ ]/belse
-/^[ ]*elif[ ]*$/belse
-/^[ ]*else[ ]/belse
-/^[ ]*else[ ]*$/belse
-/^[ ]*fi[ ]*&&[ ]*$/bdone
-/^[ ]*fi[ ]*$/bdone
-/^[ ]*fi[ ]*[<>|]/bdone
-/^[ ]*fi[ ]*)/bdone
-# nested one-liner "(...) &&"
-/^[ ^]*(.*)[ ]*&&[ ]*$/bchkchn
-# nested one-liner "(...)"
-/^[ ^]*(.*)[ ]*$/bchkchn
-# nested one-liner "(...) >x" (or "2>x" or "<x" or "|x")
-/^[ ^]*(.*)[ ]*[0-9]*[<>|]/bchkchn
-# nested multi-line "(...\n...)"
-/^[ ^]*(/bnest
-# multi-line "{...\n...}"
-/^[ ^]*{/bblock
-# closing ")" on own line -- exit subshell
-/^[ ]*)/bclssolo
-# "$((...))" -- arithmetic expansion; not closing ")"
-/\$(([^)][^)]*))[^)]*$/bchkchn
-# "$(...)" -- command substitution; not closing ")"
-/\$([^)][^)]*)[^)]*$/bchkchn
-# multi-line "$(...\n...)" -- command substitution; treat as nested subshell
-/\$([^)]*$/bnest
-# "=(...)" -- Bash array assignment; not closing ")"
-/=(/bchkchn
-# closing "...) &&"
-/)[ ]*&&[ ]*$/bclose
-# closing "...)"
-/)[ ]*$/bclose
-# closing "...) >x" (or "2>x" or "<x" or "|x")
-/)[ ]*[<>|]/bclose
-:chkchn
-# mark suspect if line uses ";" internally rather than "&&" (but not ";" in a
-# string and not ";;" in one-liner "case...esac")
-/;/{
- /;;/!{
- /"[^"]*;[^"]*"/!s/;/; ?!AMP?!/
- }
-}
-# line ends with pipe "...|" -- valid; not missing "&&"
-/|[ ]*$/bcont
-# missing end-of-line "&&" -- mark suspect
-/&&[ ]*$/!s/$/ ?!AMP?!/
-:cont
-# retrieve and print previous line
-x
-s/^\([ ]*\)^/\1(/
-s/?!HERE?!/<</g
-n
-bslurp
-
-# found incomplete line "...\" -- slurp up next line
-:icmplte
-N
-s/\\\n//
-bslurp
-
-# check for multi-line double-quoted string "...\n..." -- fold to one line
-:dqstr
-# remove all quote pairs
-s/"\([^"]*\)"/@!\1@!/g
-# done if no dangling quote
-/"/!bdqdone
-# otherwise, slurp next line and try again
-N
-s/\n//
-bdqstr
-:dqdone
-s/@!/"/g
-bfolded
-
-# check for multi-line single-quoted string '...\n...' -- fold to one line
-:sqstr
-# remove all quote pairs
-s/'\([^']*\)'/@!\1@!/g
-# done if no dangling quote
-/'/!bsqdone
-# otherwise, slurp next line and try again
-N
-s/\n//
-bsqstr
-:sqdone
-s/@!/'/g
-bfolded
-
-# found here-doc -- swallow it to avoid false hits within its body (but keep
-# the command to which it was attached)
-:heredoc
-s/^\(.*\)<<\(-*[ ]*\)[\\'"]*\([A-Za-z0-9_][A-Za-z0-9_]*\)['"]*/<\3>\1?!HERE?!\2\3/
-:hdocsub
-N
-/^<\([^>]*\)>.*\n[ ]*\1[ ]*$/!{
- s/\n.*$//
- bhdocsub
-}
-s/^<[^>]*>//
-s/\n.*$//
-bfolded
-
-# found "case ... in" -- pass through untouched
-:case
-x
-s/^\([ ]*\)^/\1(/
-s/?!HERE?!/<</g
-n
-:cascom
-/^[ ]*#/{
- N
- s/.*\n//
- bcascom
-}
-/^[ ]*esac/bslurp
-bcase
-
-# found "else" or "elif" -- drop "suspect" from final line before "else" since
-# that line legitimately lacks "&&"
-:else
-x
-s/\( ?!AMP?!\)* ?!AMP?!$//
-x
-bcont
-
-# found "done" closing for-loop or while-loop, or "fi" closing if-then -- drop
-# "suspect" from final contained line since that line legitimately lacks "&&"
-:done
-x
-s/\( ?!AMP?!\)* ?!AMP?!$//
-x
-# is 'done' or 'fi' cuddled with ")" to close subshell?
-/done.*)/bclose
-/fi.*)/bclose
-bchkchn
-
-# found nested multi-line "(...\n...)" -- pass through untouched
-:nest
-x
-:nstslrp
-s/^\([ ]*\)^/\1(/
-s/?!HERE?!/<</g
-n
-:nstcom
-# comment -- not closing ")" if in comment
-/^[ ]*#/{
- N
- s/.*\n//
- bnstcom
-}
-# closing ")" on own line -- stop nested slurp
-/^[ ]*)/bnstcl
-# "$((...))" -- arithmetic expansion; not closing ")"
-/\$(([^)][^)]*))[^)]*$/bnstcnt
-# "$(...)" -- command substitution; not closing ")"
-/\$([^)][^)]*)[^)]*$/bnstcnt
-# closing "...)" -- stop nested slurp
-/)/bnstcl
-:nstcnt
-x
-bnstslrp
-:nstcl
-# is it "))" which closes nested and parent subshells?
-/)[ ]*)/bslurp
-bchkchn
-
-# found multi-line "{...\n...}" block -- pass through untouched
-:block
-x
-s/^\([ ]*\)^/\1(/
-s/?!HERE?!/<</g
-n
-:blkcom
-/^[ ]*#/{
- N
- s/.*\n//
- bblkcom
-}
-# closing "}" -- stop block slurp
-/}/bchkchn
-bblock
-
-# found closing ")" on own line -- drop "suspect" from final line of subshell
-# since that line legitimately lacks "&&" and exit subshell loop
-:clssolo
-x
-s/\( ?!AMP?!\)* ?!AMP?!$//
-s/^\([ ]*\)^/\1(/
-s/?!HERE?!/<</g
-p
-x
-s/^\([ ]*\)^/\1(/
-s/?!HERE?!/<</g
-b
-
-# found closing "...)" -- exit subshell loop
-:close
-x
-s/^\([ ]*\)^/\1(/
-s/?!HERE?!/<</g
-p
-x
-s/^\([ ]*\)^/\1(/
-s/?!HERE?!/<</g
-b
diff --git a/t/chainlint/blank-line-before-esac.expect b/t/chainlint/blank-line-before-esac.expect
new file mode 100644
index 0000000..056e030
--- /dev/null
+++ b/t/chainlint/blank-line-before-esac.expect
@@ -0,0 +1,18 @@
+test_done () {
+ case "$test_failure" in
+ 0)
+ test_at_end_hook_
+
+ exit 0 ;;
+
+ *)
+ if test $test_external_has_tap -eq 0
+ then
+ say_color error "# failed $test_failure among $msg"
+ say "1..$test_count"
+ fi
+
+ exit 1 ;;
+
+ esac
+}
diff --git a/t/chainlint/blank-line-before-esac.test b/t/chainlint/blank-line-before-esac.test
new file mode 100644
index 0000000..cecccad
--- /dev/null
+++ b/t/chainlint/blank-line-before-esac.test
@@ -0,0 +1,19 @@
+# LINT: blank line before "esac"
+test_done () {
+ case "$test_failure" in
+ 0)
+ test_at_end_hook_
+
+ exit 0 ;;
+
+ *)
+ if test $test_external_has_tap -eq 0
+ then
+ say_color error "# failed $test_failure among $msg"
+ say "1..$test_count"
+ fi
+
+ exit 1 ;;
+
+ esac
+}
diff --git a/t/chainlint/blank-line.expect b/t/chainlint/blank-line.expect
index f76fde1..b47827d 100644
--- a/t/chainlint/blank-line.expect
+++ b/t/chainlint/blank-line.expect
@@ -1,4 +1,8 @@
(
+
nothing &&
+
something
+
+
)
diff --git a/t/chainlint/block-comment.expect b/t/chainlint/block-comment.expect
index d10b2ee..df2beea 100644
--- a/t/chainlint/block-comment.expect
+++ b/t/chainlint/block-comment.expect
@@ -1,6 +1,8 @@
(
{
+ # show a
echo a &&
+ # show b
echo b
}
)
diff --git a/t/chainlint/block.expect b/t/chainlint/block.expect
index da60257..1c87326 100644
--- a/t/chainlint/block.expect
+++ b/t/chainlint/block.expect
@@ -1,7 +1,7 @@
(
foo &&
{
- echo a
+ echo a ?!AMP?!
echo b
} &&
bar &&
@@ -9,4 +9,15 @@
echo c
} ?!AMP?!
baz
-)
+) &&
+
+{
+ echo a; ?!AMP?! echo b
+} &&
+{ echo a; ?!AMP?! echo b; } &&
+
+{
+ echo "${var}9" &&
+ echo "done"
+} &&
+finis
diff --git a/t/chainlint/block.test b/t/chainlint/block.test
index 0a82fd5..4ab69a4 100644
--- a/t/chainlint/block.test
+++ b/t/chainlint/block.test
@@ -11,4 +11,17 @@
echo c
}
baz
-)
+) &&
+
+# LINT: ";" not allowed in place of "&&"
+{
+ echo a; echo b
+} &&
+{ echo a; echo b; } &&
+
+# LINT: "}" inside string not mistaken as end of block
+{
+ echo "${var}9" &&
+ echo "done"
+} &&
+finis
diff --git a/t/chainlint/case-comment.expect b/t/chainlint/case-comment.expect
index 1e4b054..641c157 100644
--- a/t/chainlint/case-comment.expect
+++ b/t/chainlint/case-comment.expect
@@ -1,7 +1,10 @@
(
case "$x" in
+ # found foo
x) foo ;;
+ # found other
*)
+ # treat it as bar
bar
;;
esac
diff --git a/t/chainlint/chain-break-background.expect b/t/chainlint/chain-break-background.expect
new file mode 100644
index 0000000..20d0bb5
--- /dev/null
+++ b/t/chainlint/chain-break-background.expect
@@ -0,0 +1,9 @@
+JGIT_DAEMON_PID= &&
+git init --bare empty.git &&
+>empty.git/git-daemon-export-ok &&
+mkfifo jgit_daemon_output &&
+{
+ jgit daemon --port="$JGIT_DAEMON_PORT" . >jgit_daemon_output &
+ JGIT_DAEMON_PID=$!
+} &&
+test_expect_code 2 git ls-remote --exit-code git://localhost:$JGIT_DAEMON_PORT/empty.git
diff --git a/t/chainlint/chain-break-background.test b/t/chainlint/chain-break-background.test
new file mode 100644
index 0000000..e10f656
--- /dev/null
+++ b/t/chainlint/chain-break-background.test
@@ -0,0 +1,10 @@
+JGIT_DAEMON_PID= &&
+git init --bare empty.git &&
+>empty.git/git-daemon-export-ok &&
+mkfifo jgit_daemon_output &&
+{
+# LINT: exit status of "&" is always 0 so &&-chaining immaterial
+ jgit daemon --port="$JGIT_DAEMON_PORT" . >jgit_daemon_output &
+ JGIT_DAEMON_PID=$!
+} &&
+test_expect_code 2 git ls-remote --exit-code git://localhost:$JGIT_DAEMON_PORT/empty.git
diff --git a/t/chainlint/chain-break-continue.expect b/t/chainlint/chain-break-continue.expect
new file mode 100644
index 0000000..47a3457
--- /dev/null
+++ b/t/chainlint/chain-break-continue.expect
@@ -0,0 +1,12 @@
+git ls-tree --name-only -r refs/notes/many_notes |
+while read path
+do
+ test "$path" = "foobar/non-note.txt" && continue
+ test "$path" = "deadbeef" && continue
+ test "$path" = "de/adbeef" && continue
+
+ if test $(expr length "$path") -ne $hexsz
+ then
+ return 1
+ fi
+done
diff --git a/t/chainlint/chain-break-continue.test b/t/chainlint/chain-break-continue.test
new file mode 100644
index 0000000..f0af71d
--- /dev/null
+++ b/t/chainlint/chain-break-continue.test
@@ -0,0 +1,13 @@
+git ls-tree --name-only -r refs/notes/many_notes |
+while read path
+do
+# LINT: broken &&-chain okay if explicit "continue"
+ test "$path" = "foobar/non-note.txt" && continue
+ test "$path" = "deadbeef" && continue
+ test "$path" = "de/adbeef" && continue
+
+ if test $(expr length "$path") -ne $hexsz
+ then
+ return 1
+ fi
+done
diff --git a/t/chainlint/chain-break-false.expect b/t/chainlint/chain-break-false.expect
new file mode 100644
index 0000000..989766f
--- /dev/null
+++ b/t/chainlint/chain-break-false.expect
@@ -0,0 +1,9 @@
+if condition not satisified
+then
+ echo it did not work...
+ echo failed!
+ false
+else
+ echo it went okay ?!AMP?!
+ congratulate user
+fi
diff --git a/t/chainlint/chain-break-false.test b/t/chainlint/chain-break-false.test
new file mode 100644
index 0000000..a5aaff8
--- /dev/null
+++ b/t/chainlint/chain-break-false.test
@@ -0,0 +1,10 @@
+# LINT: broken &&-chain okay if explicit "false" signals failure
+if condition not satisified
+then
+ echo it did not work...
+ echo failed!
+ false
+else
+ echo it went okay
+ congratulate user
+fi
diff --git a/t/chainlint/chain-break-return-exit.expect b/t/chainlint/chain-break-return-exit.expect
new file mode 100644
index 0000000..4cd18e2
--- /dev/null
+++ b/t/chainlint/chain-break-return-exit.expect
@@ -0,0 +1,19 @@
+case "$(git ls-files)" in
+one) echo pass one ;;
+*) echo bad one; return 1 ;;
+esac &&
+(
+ case "$(git ls-files)" in
+ two) echo pass two ;;
+ *) echo bad two; exit 1 ;;
+ esac
+) &&
+case "$(git ls-files)" in
+dir/two"$LF"one) echo pass both ;;
+*) echo bad; return 1 ;;
+esac &&
+
+for i in 1 2 3 4 ; do
+ git checkout main -b $i || return $?
+ test_commit $i $i $i tag$i || return $?
+done
diff --git a/t/chainlint/chain-break-return-exit.test b/t/chainlint/chain-break-return-exit.test
new file mode 100644
index 0000000..46542ed
--- /dev/null
+++ b/t/chainlint/chain-break-return-exit.test
@@ -0,0 +1,23 @@
+case "$(git ls-files)" in
+one) echo pass one ;;
+# LINT: broken &&-chain okay if explicit "return 1" signals failuire
+*) echo bad one; return 1 ;;
+esac &&
+(
+ case "$(git ls-files)" in
+ two) echo pass two ;;
+# LINT: broken &&-chain okay if explicit "exit 1" signals failuire
+ *) echo bad two; exit 1 ;;
+ esac
+) &&
+case "$(git ls-files)" in
+dir/two"$LF"one) echo pass both ;;
+# LINT: broken &&-chain okay if explicit "return 1" signals failuire
+*) echo bad; return 1 ;;
+esac &&
+
+for i in 1 2 3 4 ; do
+# LINT: broken &&-chain okay if explicit "return $?" signals failure
+ git checkout main -b $i || return $?
+ test_commit $i $i $i tag$i || return $?
+done
diff --git a/t/chainlint/chain-break-status.expect b/t/chainlint/chain-break-status.expect
new file mode 100644
index 0000000..e6b3b21
--- /dev/null
+++ b/t/chainlint/chain-break-status.expect
@@ -0,0 +1,9 @@
+OUT=$( ((large_git; echo $? 1>&3) | :) 3>&1 ) &&
+test_match_signal 13 "$OUT" &&
+
+{ test-tool sigchain >actual; ret=$?; } &&
+{
+ test_match_signal 15 "$ret" ||
+ test "$ret" = 3
+} &&
+test_cmp expect actual
diff --git a/t/chainlint/chain-break-status.test b/t/chainlint/chain-break-status.test
new file mode 100644
index 0000000..a6602a7
--- /dev/null
+++ b/t/chainlint/chain-break-status.test
@@ -0,0 +1,11 @@
+# LINT: broken &&-chain okay if next command handles "$?" explicitly
+OUT=$( ((large_git; echo $? 1>&3) | :) 3>&1 ) &&
+test_match_signal 13 "$OUT" &&
+
+# LINT: broken &&-chain okay if next command handles "$?" explicitly
+{ test-tool sigchain >actual; ret=$?; } &&
+{
+ test_match_signal 15 "$ret" ||
+ test "$ret" = 3
+} &&
+test_cmp expect actual
diff --git a/t/chainlint/chained-block.expect b/t/chainlint/chained-block.expect
new file mode 100644
index 0000000..574cdce
--- /dev/null
+++ b/t/chainlint/chained-block.expect
@@ -0,0 +1,9 @@
+echo nobody home && {
+ test the doohicky ?!AMP?!
+ right now
+} &&
+
+GIT_EXTERNAL_DIFF=echo git diff | {
+ read path oldfile oldhex oldmode newfile newhex newmode &&
+ test "z$oh" = "z$oldhex"
+}
diff --git a/t/chainlint/chained-block.test b/t/chainlint/chained-block.test
new file mode 100644
index 0000000..86f81ec
--- /dev/null
+++ b/t/chainlint/chained-block.test
@@ -0,0 +1,11 @@
+# LINT: start of block chained to preceding command
+echo nobody home && {
+ test the doohicky
+ right now
+} &&
+
+# LINT: preceding command pipes to block on same line
+GIT_EXTERNAL_DIFF=echo git diff | {
+ read path oldfile oldhex oldmode newfile newhex newmode &&
+ test "z$oh" = "z$oldhex"
+}
diff --git a/t/chainlint/chained-subshell.expect b/t/chainlint/chained-subshell.expect
new file mode 100644
index 0000000..83810ea
--- /dev/null
+++ b/t/chainlint/chained-subshell.expect
@@ -0,0 +1,10 @@
+mkdir sub && (
+ cd sub &&
+ foo the bar ?!AMP?!
+ nuff said
+) &&
+
+cut "-d " -f actual | (read s1 s2 s3 &&
+test -f $s1 ?!AMP?!
+test $(cat $s2) = tree2path1 &&
+test $(cat $s3) = tree3path1)
diff --git a/t/chainlint/chained-subshell.test b/t/chainlint/chained-subshell.test
new file mode 100644
index 0000000..4ff6ddd
--- /dev/null
+++ b/t/chainlint/chained-subshell.test
@@ -0,0 +1,13 @@
+# LINT: start of subshell chained to preceding command
+mkdir sub && (
+ cd sub &&
+ foo the bar
+ nuff said
+) &&
+
+# LINT: preceding command pipes to subshell on same line
+cut "-d " -f actual | (read s1 s2 s3 &&
+test -f $s1
+test $(cat $s2) = tree2path1 &&
+# LINT: closing subshell ")" correctly detected on same line as "$(...)"
+test $(cat $s3) = tree3path1)
diff --git a/t/chainlint/close-subshell.expect b/t/chainlint/close-subshell.expect
index 0f87db9..2192a28 100644
--- a/t/chainlint/close-subshell.expect
+++ b/t/chainlint/close-subshell.expect
@@ -15,7 +15,8 @@
) | wuzzle &&
(
bop
-) | fazz fozz &&
+) | fazz \
+ fozz &&
(
bup
) |
diff --git a/t/chainlint/command-substitution-subsubshell.expect b/t/chainlint/command-substitution-subsubshell.expect
new file mode 100644
index 0000000..ec42f2c
--- /dev/null
+++ b/t/chainlint/command-substitution-subsubshell.expect
@@ -0,0 +1,2 @@
+OUT=$( ((large_git 1>&3) | :) 3>&1 ) &&
+test_match_signal 13 "$OUT"
diff --git a/t/chainlint/command-substitution-subsubshell.test b/t/chainlint/command-substitution-subsubshell.test
new file mode 100644
index 0000000..321de29
--- /dev/null
+++ b/t/chainlint/command-substitution-subsubshell.test
@@ -0,0 +1,3 @@
+# LINT: subshell nested in subshell nested in command substitution
+OUT=$( ((large_git 1>&3) | :) 3>&1 ) &&
+test_match_signal 13 "$OUT"
diff --git a/t/chainlint/comment.expect b/t/chainlint/comment.expect
index f76fde1..a68f1f9 100644
--- a/t/chainlint/comment.expect
+++ b/t/chainlint/comment.expect
@@ -1,4 +1,8 @@
(
+ # comment 1
nothing &&
+ # comment 2
something
+ # comment 3
+ # comment 4
)
diff --git a/t/chainlint/complex-if-in-cuddled-loop.expect b/t/chainlint/complex-if-in-cuddled-loop.expect
index 2fca183..dac2d0f 100644
--- a/t/chainlint/complex-if-in-cuddled-loop.expect
+++ b/t/chainlint/complex-if-in-cuddled-loop.expect
@@ -4,6 +4,6 @@
:
else
echo >file
- fi
+ fi ?!LOOP?!
done) &&
test ! -f file
diff --git a/t/chainlint/double-here-doc.expect b/t/chainlint/double-here-doc.expect
new file mode 100644
index 0000000..cd584a4
--- /dev/null
+++ b/t/chainlint/double-here-doc.expect
@@ -0,0 +1,12 @@
+run_sub_test_lib_test_err run-inv-range-start \
+ "--run invalid range start" \
+ --run="a-5" <<-\EOF &&
+test_expect_success "passing test #1" "true"
+test_done
+EOF
+check_sub_test_lib_test_err run-inv-range-start \
+ <<-\EOF_OUT 3<<-EOF_ERR
+> FATAL: Unexpected exit with code 1
+EOF_OUT
+> error: --run: invalid non-numeric in range start: ${SQ}a-5${SQ}
+EOF_ERR
diff --git a/t/chainlint/double-here-doc.test b/t/chainlint/double-here-doc.test
new file mode 100644
index 0000000..cd584a4
--- /dev/null
+++ b/t/chainlint/double-here-doc.test
@@ -0,0 +1,12 @@
+run_sub_test_lib_test_err run-inv-range-start \
+ "--run invalid range start" \
+ --run="a-5" <<-\EOF &&
+test_expect_success "passing test #1" "true"
+test_done
+EOF
+check_sub_test_lib_test_err run-inv-range-start \
+ <<-\EOF_OUT 3<<-EOF_ERR
+> FATAL: Unexpected exit with code 1
+EOF_OUT
+> error: --run: invalid non-numeric in range start: ${SQ}a-5${SQ}
+EOF_ERR
diff --git a/t/chainlint/dqstring-line-splice.expect b/t/chainlint/dqstring-line-splice.expect
new file mode 100644
index 0000000..37eab80
--- /dev/null
+++ b/t/chainlint/dqstring-line-splice.expect
@@ -0,0 +1,5 @@
+
+echo 'fatal: reword option of --fixup is mutually exclusive with' '--patch/--interactive/--all/--include/--only' >expect &&
+test_must_fail git commit --fixup=reword:HEAD~ $1 2>actual &&
+test_cmp expect actual
+
diff --git a/t/chainlint/dqstring-line-splice.test b/t/chainlint/dqstring-line-splice.test
new file mode 100644
index 0000000..b407144
--- /dev/null
+++ b/t/chainlint/dqstring-line-splice.test
@@ -0,0 +1,7 @@
+# LINT: line-splice within DQ-string
+'"
+echo 'fatal: reword option of --fixup is mutually exclusive with'\
+ '--patch/--interactive/--all/--include/--only' >expect &&
+test_must_fail git commit --fixup=reword:HEAD~ $1 2>actual &&
+test_cmp expect actual
+"'
diff --git a/t/chainlint/dqstring-no-interpolate.expect b/t/chainlint/dqstring-no-interpolate.expect
new file mode 100644
index 0000000..087eda1
--- /dev/null
+++ b/t/chainlint/dqstring-no-interpolate.expect
@@ -0,0 +1,12 @@
+grep "^ ! [rejected][ ]*$BRANCH -> $BRANCH (non-fast-forward)$" out &&
+
+grep "^\.git$" output.txt &&
+
+
+(
+ cd client$version &&
+ GIT_TEST_PROTOCOL_VERSION=$version git fetch-pack --no-progress .. $(cat ../input)
+) >output &&
+ cut -d ' ' -f 2 <output | sort >actual &&
+ test_cmp expect actual
+
diff --git a/t/chainlint/dqstring-no-interpolate.test b/t/chainlint/dqstring-no-interpolate.test
new file mode 100644
index 0000000..d2f4219
--- /dev/null
+++ b/t/chainlint/dqstring-no-interpolate.test
@@ -0,0 +1,15 @@
+# LINT: regex dollar-sign eol anchor in double-quoted string not special
+grep "^ ! \[rejected\][ ]*$BRANCH -> $BRANCH (non-fast-forward)$" out &&
+
+# LINT: escaped "$" not mistaken for variable expansion
+grep "^\\.git\$" output.txt &&
+
+'"
+(
+ cd client$version &&
+# LINT: escaped dollar-sign in double-quoted test body
+ GIT_TEST_PROTOCOL_VERSION=$version git fetch-pack --no-progress .. \$(cat ../input)
+) >output &&
+ cut -d ' ' -f 2 <output | sort >actual &&
+ test_cmp expect actual
+"'
diff --git a/t/chainlint/empty-here-doc.expect b/t/chainlint/empty-here-doc.expect
new file mode 100644
index 0000000..8507721
--- /dev/null
+++ b/t/chainlint/empty-here-doc.expect
@@ -0,0 +1,4 @@
+git ls-tree $tree path >current &&
+cat >expected <<\EOF &&
+EOF
+test_output
diff --git a/t/chainlint/empty-here-doc.test b/t/chainlint/empty-here-doc.test
new file mode 100644
index 0000000..24fc165
--- /dev/null
+++ b/t/chainlint/empty-here-doc.test
@@ -0,0 +1,5 @@
+git ls-tree $tree path >current &&
+# LINT: empty here-doc
+cat >expected <<\EOF &&
+EOF
+test_output
diff --git a/t/chainlint/exclamation.expect b/t/chainlint/exclamation.expect
new file mode 100644
index 0000000..765a35b
--- /dev/null
+++ b/t/chainlint/exclamation.expect
@@ -0,0 +1,4 @@
+if ! condition; then echo nope; else yep; fi &&
+test_prerequisite !MINGW &&
+mail uucp!address &&
+echo !whatever!
diff --git a/t/chainlint/exclamation.test b/t/chainlint/exclamation.test
new file mode 100644
index 0000000..323595b
--- /dev/null
+++ b/t/chainlint/exclamation.test
@@ -0,0 +1,8 @@
+# LINT: "! word" is two tokens
+if ! condition; then echo nope; else yep; fi &&
+# LINT: "!word" is single token, not two tokens "!" and "word"
+test_prerequisite !MINGW &&
+# LINT: "word!word" is single token, not three tokens "word", "!", and "word"
+mail uucp!address &&
+# LINT: "!word!" is single token, not three tokens "!", "word", and "!"
+echo !whatever!
diff --git a/t/chainlint/for-loop-abbreviated.expect b/t/chainlint/for-loop-abbreviated.expect
new file mode 100644
index 0000000..02c0d15
--- /dev/null
+++ b/t/chainlint/for-loop-abbreviated.expect
@@ -0,0 +1,5 @@
+for it
+do
+ path=$(expr "$it" : ([^:]*)) &&
+ git update-index --add "$path" || exit
+done
diff --git a/t/chainlint/for-loop-abbreviated.test b/t/chainlint/for-loop-abbreviated.test
new file mode 100644
index 0000000..1084ecc
--- /dev/null
+++ b/t/chainlint/for-loop-abbreviated.test
@@ -0,0 +1,6 @@
+# LINT: for-loop lacking optional "in [word...]" before "do"
+for it
+do
+ path=$(expr "$it" : '\([^:]*\)') &&
+ git update-index --add "$path" || exit
+done
diff --git a/t/chainlint/for-loop.expect b/t/chainlint/for-loop.expect
index 6671b8c..d2237f1 100644
--- a/t/chainlint/for-loop.expect
+++ b/t/chainlint/for-loop.expect
@@ -2,10 +2,13 @@
for i in a b c
do
echo $i ?!AMP?!
- cat <<-EOF
+ cat <<-\EOF ?!LOOP?!
+ bar
+ EOF
done ?!AMP?!
+
for i in a b c; do
echo $i &&
- cat $i
+ cat $i ?!LOOP?!
done
)
diff --git a/t/chainlint/function.expect b/t/chainlint/function.expect
new file mode 100644
index 0000000..dd7c997
--- /dev/null
+++ b/t/chainlint/function.expect
@@ -0,0 +1,11 @@
+sha1_file() {
+ echo "$*" | sed "s#..#.git/objects/&/#"
+} &&
+
+remove_object() {
+ file=$(sha1_file "$*") &&
+ test -e "$file" ?!AMP?!
+ rm -f "$file"
+} ?!AMP?!
+
+sha1_file arg && remove_object arg
diff --git a/t/chainlint/function.test b/t/chainlint/function.test
new file mode 100644
index 0000000..5ee5956
--- /dev/null
+++ b/t/chainlint/function.test
@@ -0,0 +1,13 @@
+# LINT: "()" in function definition not mistaken for subshell
+sha1_file() {
+ echo "$*" | sed "s#..#.git/objects/&/#"
+} &&
+
+# LINT: broken &&-chain in function and after function
+remove_object() {
+ file=$(sha1_file "$*") &&
+ test -e "$file"
+ rm -f "$file"
+}
+
+sha1_file arg && remove_object arg
diff --git a/t/chainlint/here-doc-close-subshell.expect b/t/chainlint/here-doc-close-subshell.expect
index 2af9ced..7d9c2b5 100644
--- a/t/chainlint/here-doc-close-subshell.expect
+++ b/t/chainlint/here-doc-close-subshell.expect
@@ -1,2 +1,4 @@
(
- cat <<-INPUT)
+ cat <<-\INPUT)
+ fizz
+ INPUT
diff --git a/t/chainlint/here-doc-indent-operator.expect b/t/chainlint/here-doc-indent-operator.expect
new file mode 100644
index 0000000..f92a7ce
--- /dev/null
+++ b/t/chainlint/here-doc-indent-operator.expect
@@ -0,0 +1,11 @@
+cat >expect <<- EOF &&
+header: 43475048 1 $(test_oid oid_version) $NUM_CHUNKS 0
+num_commits: $1
+chunks: oid_fanout oid_lookup commit_metadata generation_data bloom_indexes bloom_data
+EOF
+
+cat >expect << -EOF ?!AMP?!
+this is not indented
+-EOF
+
+cleanup
diff --git a/t/chainlint/here-doc-indent-operator.test b/t/chainlint/here-doc-indent-operator.test
new file mode 100644
index 0000000..c8a6f18
--- /dev/null
+++ b/t/chainlint/here-doc-indent-operator.test
@@ -0,0 +1,13 @@
+# LINT: whitespace between operator "<<-" and tag legal
+cat >expect <<- EOF &&
+header: 43475048 1 $(test_oid oid_version) $NUM_CHUNKS 0
+num_commits: $1
+chunks: oid_fanout oid_lookup commit_metadata generation_data bloom_indexes bloom_data
+EOF
+
+# LINT: not an indented here-doc; just a plain here-doc with tag named "-EOF"
+cat >expect << -EOF
+this is not indented
+-EOF
+
+cleanup
diff --git a/t/chainlint/here-doc-multi-line-command-subst.expect b/t/chainlint/here-doc-multi-line-command-subst.expect
index f8b3aa7..b7364c8 100644
--- a/t/chainlint/here-doc-multi-line-command-subst.expect
+++ b/t/chainlint/here-doc-multi-line-command-subst.expect
@@ -1,5 +1,8 @@
(
- x=$(bobble <<-END &&
+ x=$(bobble <<-\END &&
+ fossil
+ vegetable
+ END
wiffle) ?!AMP?!
echo $x
)
diff --git a/t/chainlint/here-doc-multi-line-string.expect b/t/chainlint/here-doc-multi-line-string.expect
index 2578191..6c13bdc 100644
--- a/t/chainlint/here-doc-multi-line-string.expect
+++ b/t/chainlint/here-doc-multi-line-string.expect
@@ -1,4 +1,7 @@
(
- cat <<-TXT && echo "multi-line string" ?!AMP?!
+ cat <<-\TXT && echo "multi-line
+ string" ?!AMP?!
+ fizzle
+ TXT
bap
)
diff --git a/t/chainlint/here-doc.expect b/t/chainlint/here-doc.expect
index 110059b..91b9612 100644
--- a/t/chainlint/here-doc.expect
+++ b/t/chainlint/here-doc.expect
@@ -1,7 +1,25 @@
-boodle wobba gorgo snoot wafta snurb <<EOF &&
+boodle wobba \
+ gorgo snoot \
+ wafta snurb <<EOF &&
+quoth the raven,
+nevermore...
+EOF
cat <<-Arbitrary_Tag_42 >foo &&
+snoz
+boz
+woz
+Arbitrary_Tag_42
-cat <<zump >boo &&
+cat <<"zump" >boo &&
+snoz
+boz
+woz
+zump
-horticulture <<EOF
+horticulture <<\EOF
+gomez
+morticia
+wednesday
+pugsly
+EOF
diff --git a/t/chainlint/if-condition-split.expect b/t/chainlint/if-condition-split.expect
new file mode 100644
index 0000000..ee745ef
--- /dev/null
+++ b/t/chainlint/if-condition-split.expect
@@ -0,0 +1,7 @@
+if bob &&
+ marcia ||
+ kevin
+then
+ echo "nomads" ?!AMP?!
+ echo "for sure"
+fi
diff --git a/t/chainlint/if-condition-split.test b/t/chainlint/if-condition-split.test
new file mode 100644
index 0000000..240daa9
--- /dev/null
+++ b/t/chainlint/if-condition-split.test
@@ -0,0 +1,8 @@
+# LINT: "if" condition split across multiple lines at "&&" or "||"
+if bob &&
+ marcia ||
+ kevin
+then
+ echo "nomads"
+ echo "for sure"
+fi
diff --git a/t/chainlint/if-in-loop.expect b/t/chainlint/if-in-loop.expect
index 03b82a3..d6514ae 100644
--- a/t/chainlint/if-in-loop.expect
+++ b/t/chainlint/if-in-loop.expect
@@ -3,7 +3,7 @@
do
if false
then
- echo "err" ?!AMP?!
+ echo "err"
exit 1
fi ?!AMP?!
foo
diff --git a/t/chainlint/if-in-loop.test b/t/chainlint/if-in-loop.test
index f0cf19c..90c2397 100644
--- a/t/chainlint/if-in-loop.test
+++ b/t/chainlint/if-in-loop.test
@@ -3,7 +3,7 @@
do
if false
then
-# LINT: missing "&&" on "echo"
+# LINT: missing "&&" on "echo" okay since "exit 1" signals error explicitly
echo "err"
exit 1
# LINT: missing "&&" on "fi"
diff --git a/t/chainlint/if-then-else.expect b/t/chainlint/if-then-else.expect
index 44d86c3..cbaaf85 100644
--- a/t/chainlint/if-then-else.expect
+++ b/t/chainlint/if-then-else.expect
@@ -8,7 +8,9 @@
echo foo
else
echo foo &&
- cat <<-EOF
+ cat <<-\EOF
+ bar
+ EOF
fi ?!AMP?!
echo poodle
) &&
diff --git a/t/chainlint/incomplete-line.expect b/t/chainlint/incomplete-line.expect
index ffac8f9..134d3a1 100644
--- a/t/chainlint/incomplete-line.expect
+++ b/t/chainlint/incomplete-line.expect
@@ -1,4 +1,10 @@
-line 1 line 2 line 3 line 4 &&
+line 1 \
+line 2 \
+line 3 \
+line 4 &&
(
- line 5 line 6 line 7 line 8
+ line 5 \
+ line 6 \
+ line 7 \
+ line 8
)
diff --git a/t/chainlint/inline-comment.expect b/t/chainlint/inline-comment.expect
index dd0dace..6bad218 100644
--- a/t/chainlint/inline-comment.expect
+++ b/t/chainlint/inline-comment.expect
@@ -1,6 +1,6 @@
(
- foobar &&
- barfoo ?!AMP?!
+ foobar && # comment 1
+ barfoo ?!AMP?! # wrong position for &&
flibble "not a # comment"
) &&
diff --git a/t/chainlint/loop-detect-failure.expect b/t/chainlint/loop-detect-failure.expect
new file mode 100644
index 0000000..a66025c
--- /dev/null
+++ b/t/chainlint/loop-detect-failure.expect
@@ -0,0 +1,15 @@
+git init r1 &&
+for n in 1 2 3 4 5
+do
+ echo "This is file: $n" > r1/file.$n &&
+ git -C r1 add file.$n &&
+ git -C r1 commit -m "$n" || return 1
+done &&
+
+git init r2 &&
+for n in 1000 10000
+do
+ printf "%"$n"s" X > r2/large.$n &&
+ git -C r2 add large.$n &&
+ git -C r2 commit -m "$n" ?!LOOP?!
+done
diff --git a/t/chainlint/loop-detect-failure.test b/t/chainlint/loop-detect-failure.test
new file mode 100644
index 0000000..b9791cc
--- /dev/null
+++ b/t/chainlint/loop-detect-failure.test
@@ -0,0 +1,17 @@
+git init r1 &&
+# LINT: loop handles failure explicitly with "|| return 1"
+for n in 1 2 3 4 5
+do
+ echo "This is file: $n" > r1/file.$n &&
+ git -C r1 add file.$n &&
+ git -C r1 commit -m "$n" || return 1
+done &&
+
+git init r2 &&
+# LINT: loop fails to handle failure explicitly with "|| return 1"
+for n in 1000 10000
+do
+ printf "%"$n"s" X > r2/large.$n &&
+ git -C r2 add large.$n &&
+ git -C r2 commit -m "$n"
+done
diff --git a/t/chainlint/loop-detect-status.expect b/t/chainlint/loop-detect-status.expect
new file mode 100644
index 0000000..7ce3a34
--- /dev/null
+++ b/t/chainlint/loop-detect-status.expect
@@ -0,0 +1,18 @@
+(while test $i -le $blobcount
+ do
+ printf "Generating blob $i/$blobcount\r" >&2 &&
+ printf "blob\nmark :$i\ndata $blobsize\n" &&
+ #test-tool genrandom $i $blobsize &&
+ printf "%-${blobsize}s" $i &&
+ echo "M 100644 :$i $i" >> commit &&
+ i=$(($i+1)) ||
+ echo $? > exit-status
+ done &&
+ echo "commit refs/heads/main" &&
+ echo "author A U Thor <author@email.com> 123456789 +0000" &&
+ echo "committer C O Mitter <committer@email.com> 123456789 +0000" &&
+ echo "data 5" &&
+ echo ">2gb" &&
+ cat commit) |
+git fast-import --big-file-threshold=2 &&
+test ! -f exit-status
diff --git a/t/chainlint/loop-detect-status.test b/t/chainlint/loop-detect-status.test
new file mode 100644
index 0000000..1c6c23c
--- /dev/null
+++ b/t/chainlint/loop-detect-status.test
@@ -0,0 +1,19 @@
+# LINT: "$?" handled explicitly within loop body
+(while test $i -le $blobcount
+ do
+ printf "Generating blob $i/$blobcount\r" >&2 &&
+ printf "blob\nmark :$i\ndata $blobsize\n" &&
+ #test-tool genrandom $i $blobsize &&
+ printf "%-${blobsize}s" $i &&
+ echo "M 100644 :$i $i" >> commit &&
+ i=$(($i+1)) ||
+ echo $? > exit-status
+ done &&
+ echo "commit refs/heads/main" &&
+ echo "author A U Thor <author@email.com> 123456789 +0000" &&
+ echo "committer C O Mitter <committer@email.com> 123456789 +0000" &&
+ echo "data 5" &&
+ echo ">2gb" &&
+ cat commit) |
+git fast-import --big-file-threshold=2 &&
+test ! -f exit-status
diff --git a/t/chainlint/loop-in-if.expect b/t/chainlint/loop-in-if.expect
index e1be423..6c5d6e5 100644
--- a/t/chainlint/loop-in-if.expect
+++ b/t/chainlint/loop-in-if.expect
@@ -4,7 +4,7 @@
while true
do
echo "pop" ?!AMP?!
- echo "glup"
+ echo "glup" ?!LOOP?!
done ?!AMP?!
foo
fi ?!AMP?!
diff --git a/t/chainlint/loop-upstream-pipe.expect b/t/chainlint/loop-upstream-pipe.expect
new file mode 100644
index 0000000..0b82ecc
--- /dev/null
+++ b/t/chainlint/loop-upstream-pipe.expect
@@ -0,0 +1,10 @@
+(
+ git rev-list --objects --no-object-names base..loose |
+ while read oid
+ do
+ path="$objdir/$(test_oid_to_path "$oid")" &&
+ printf "%s %d\n" "$oid" "$(test-tool chmtime --get "$path")" ||
+ echo "object list generation failed for $oid"
+ done |
+ sort -k1
+) >expect &&
diff --git a/t/chainlint/loop-upstream-pipe.test b/t/chainlint/loop-upstream-pipe.test
new file mode 100644
index 0000000..efb77da
--- /dev/null
+++ b/t/chainlint/loop-upstream-pipe.test
@@ -0,0 +1,11 @@
+(
+ git rev-list --objects --no-object-names base..loose |
+ while read oid
+ do
+# LINT: "|| echo" signals failure in loop upstream of a pipe
+ path="$objdir/$(test_oid_to_path "$oid")" &&
+ printf "%s %d\n" "$oid" "$(test-tool chmtime --get "$path")" ||
+ echo "object list generation failed for $oid"
+ done |
+ sort -k1
+) >expect &&
diff --git a/t/chainlint/multi-line-string.expect b/t/chainlint/multi-line-string.expect
index ab0dadf..27ff952 100644
--- a/t/chainlint/multi-line-string.expect
+++ b/t/chainlint/multi-line-string.expect
@@ -1,9 +1,14 @@
(
- x="line 1 line 2 line 3" &&
- y="line 1 line2" ?!AMP?!
+ x="line 1
+ line 2
+ line 3" &&
+ y="line 1
+ line2" ?!AMP?!
foobar
) &&
(
- echo "xyz" "abc def ghi" &&
+ echo "xyz" "abc
+ def
+ ghi" &&
barfoo
)
diff --git a/t/chainlint/nested-cuddled-subshell.expect b/t/chainlint/nested-cuddled-subshell.expect
index 2a86885..3836049 100644
--- a/t/chainlint/nested-cuddled-subshell.expect
+++ b/t/chainlint/nested-cuddled-subshell.expect
@@ -2,18 +2,24 @@
(cd foo &&
bar
) &&
+
(cd foo &&
bar
) ?!AMP?!
+
(
cd foo &&
bar) &&
+
(
cd foo &&
bar) ?!AMP?!
+
(cd foo &&
bar) &&
+
(cd foo &&
bar) ?!AMP?!
+
foobar
)
diff --git a/t/chainlint/nested-here-doc.expect b/t/chainlint/nested-here-doc.expect
index e3bef63..29b3832 100644
--- a/t/chainlint/nested-here-doc.expect
+++ b/t/chainlint/nested-here-doc.expect
@@ -1,7 +1,30 @@
cat <<ARBITRARY >foop &&
+naddle
+fub <<EOF
+ nozzle
+ noodle
+EOF
+formp
+ARBITRARY
(
- cat <<-INPUT_END &&
- cat <<-EOT ?!AMP?!
+ cat <<-\INPUT_END &&
+ fish are mice
+ but geese go slow
+ data <<EOF
+ perl is lerp
+ and nothing else
+ EOF
+ toink
+ INPUT_END
+
+ cat <<-\EOT ?!AMP?!
+ text goes here
+ data <<EOF
+ data goes here
+ EOF
+ more test here
+ EOT
+
foobar
)
diff --git a/t/chainlint/nested-loop-detect-failure.expect b/t/chainlint/nested-loop-detect-failure.expect
new file mode 100644
index 0000000..3461df4
--- /dev/null
+++ b/t/chainlint/nested-loop-detect-failure.expect
@@ -0,0 +1,31 @@
+for i in 0 1 2 3 4 5 6 7 8 9;
+do
+ for j in 0 1 2 3 4 5 6 7 8 9;
+ do
+ echo "$i$j" >"path$i$j" ?!LOOP?!
+ done ?!LOOP?!
+done &&
+
+for i in 0 1 2 3 4 5 6 7 8 9;
+do
+ for j in 0 1 2 3 4 5 6 7 8 9;
+ do
+ echo "$i$j" >"path$i$j" || return 1
+ done
+done &&
+
+for i in 0 1 2 3 4 5 6 7 8 9;
+do
+ for j in 0 1 2 3 4 5 6 7 8 9;
+ do
+ echo "$i$j" >"path$i$j" ?!LOOP?!
+ done || return 1
+done &&
+
+for i in 0 1 2 3 4 5 6 7 8 9;
+do
+ for j in 0 1 2 3 4 5 6 7 8 9;
+ do
+ echo "$i$j" >"path$i$j" || return 1
+ done || return 1
+done
diff --git a/t/chainlint/nested-loop-detect-failure.test b/t/chainlint/nested-loop-detect-failure.test
new file mode 100644
index 0000000..e6f0c1a
--- /dev/null
+++ b/t/chainlint/nested-loop-detect-failure.test
@@ -0,0 +1,35 @@
+# LINT: neither loop handles failure explicitly with "|| return 1"
+for i in 0 1 2 3 4 5 6 7 8 9;
+do
+ for j in 0 1 2 3 4 5 6 7 8 9;
+ do
+ echo "$i$j" >"path$i$j"
+ done
+done &&
+
+# LINT: inner loop handles failure explicitly with "|| return 1"
+for i in 0 1 2 3 4 5 6 7 8 9;
+do
+ for j in 0 1 2 3 4 5 6 7 8 9;
+ do
+ echo "$i$j" >"path$i$j" || return 1
+ done
+done &&
+
+# LINT: outer loop handles failure explicitly with "|| return 1"
+for i in 0 1 2 3 4 5 6 7 8 9;
+do
+ for j in 0 1 2 3 4 5 6 7 8 9;
+ do
+ echo "$i$j" >"path$i$j"
+ done || return 1
+done &&
+
+# LINT: inner & outer loops handles failure explicitly with "|| return 1"
+for i in 0 1 2 3 4 5 6 7 8 9;
+do
+ for j in 0 1 2 3 4 5 6 7 8 9;
+ do
+ echo "$i$j" >"path$i$j" || return 1
+ done || return 1
+done
diff --git a/t/chainlint/nested-subshell-comment.expect b/t/chainlint/nested-subshell-comment.expect
index be4b27a..9138cf3 100644
--- a/t/chainlint/nested-subshell-comment.expect
+++ b/t/chainlint/nested-subshell-comment.expect
@@ -2,6 +2,8 @@
foo &&
(
bar &&
+ # bottles wobble while fiddles gobble
+ # minor numbers of cows (or do they?)
baz &&
snaff
) ?!AMP?!
diff --git a/t/chainlint/nested-subshell.expect b/t/chainlint/nested-subshell.expect
index 41a48ad..73ff285 100644
--- a/t/chainlint/nested-subshell.expect
+++ b/t/chainlint/nested-subshell.expect
@@ -4,9 +4,10 @@
echo a &&
echo b
) >file &&
+
cd foo &&
(
- echo a
+ echo a ?!AMP?!
echo b
) >file
)
diff --git a/t/chainlint/one-liner-for-loop.expect b/t/chainlint/one-liner-for-loop.expect
new file mode 100644
index 0000000..51a3dc7
--- /dev/null
+++ b/t/chainlint/one-liner-for-loop.expect
@@ -0,0 +1,9 @@
+git init dir-rename-and-content &&
+(
+ cd dir-rename-and-content &&
+ test_write_lines 1 2 3 4 5 >foo &&
+ mkdir olddir &&
+ for i in a b c; do echo $i >olddir/$i; ?!LOOP?! done ?!AMP?!
+ git add foo olddir &&
+ git commit -m "original" &&
+)
diff --git a/t/chainlint/one-liner-for-loop.test b/t/chainlint/one-liner-for-loop.test
new file mode 100644
index 0000000..4bd8c06
--- /dev/null
+++ b/t/chainlint/one-liner-for-loop.test
@@ -0,0 +1,10 @@
+git init dir-rename-and-content &&
+(
+ cd dir-rename-and-content &&
+ test_write_lines 1 2 3 4 5 >foo &&
+ mkdir olddir &&
+# LINT: one-liner for-loop missing "|| exit"; also broken &&-chain
+ for i in a b c; do echo $i >olddir/$i; done
+ git add foo olddir &&
+ git commit -m "original" &&
+)
diff --git a/t/chainlint/pipe.expect b/t/chainlint/pipe.expect
index 2cfc028..811971b 100644
--- a/t/chainlint/pipe.expect
+++ b/t/chainlint/pipe.expect
@@ -2,7 +2,9 @@
foo |
bar |
baz &&
+
fish |
cow ?!AMP?!
+
sunder
)
diff --git a/t/chainlint/return-loop.expect b/t/chainlint/return-loop.expect
new file mode 100644
index 0000000..cfc0549
--- /dev/null
+++ b/t/chainlint/return-loop.expect
@@ -0,0 +1,5 @@
+while test $i -lt $((num - 5))
+do
+ git notes add -m "notes for commit$i" HEAD~$i || return 1
+ i=$((i + 1))
+done
diff --git a/t/chainlint/return-loop.test b/t/chainlint/return-loop.test
new file mode 100644
index 0000000..f90b171
--- /dev/null
+++ b/t/chainlint/return-loop.test
@@ -0,0 +1,6 @@
+while test $i -lt $((num - 5))
+do
+# LINT: "|| return {n}" valid loop escape outside subshell; no "&&" needed
+ git notes add -m "notes for commit$i" HEAD~$i || return 1
+ i=$((i + 1))
+done
diff --git a/t/chainlint/semicolon.expect b/t/chainlint/semicolon.expect
index ed0b370..3aa2259 100644
--- a/t/chainlint/semicolon.expect
+++ b/t/chainlint/semicolon.expect
@@ -15,5 +15,5 @@
) &&
(cd foo &&
for i in a b c; do
- echo;
+ echo; ?!LOOP?!
done)
diff --git a/t/chainlint/sqstring-in-sqstring.expect b/t/chainlint/sqstring-in-sqstring.expect
new file mode 100644
index 0000000..cf0b591
--- /dev/null
+++ b/t/chainlint/sqstring-in-sqstring.expect
@@ -0,0 +1,4 @@
+perl -e '
+ defined($_ = -s $_) or die for @ARGV;
+ exit 1 if $ARGV[0] <= $ARGV[1];
+' test-2-$packname_2.pack test-3-$packname_3.pack
diff --git a/t/chainlint/sqstring-in-sqstring.test b/t/chainlint/sqstring-in-sqstring.test
new file mode 100644
index 0000000..77a425e
--- /dev/null
+++ b/t/chainlint/sqstring-in-sqstring.test
@@ -0,0 +1,5 @@
+# LINT: SQ-string Perl code fragment within SQ-string
+perl -e '\''
+ defined($_ = -s $_) or die for @ARGV;
+ exit 1 if $ARGV[0] <= $ARGV[1];
+'\'' test-2-$packname_2.pack test-3-$packname_3.pack
diff --git a/t/chainlint/subshell-here-doc.expect b/t/chainlint/subshell-here-doc.expect
index 029d129..75d6f60 100644
--- a/t/chainlint/subshell-here-doc.expect
+++ b/t/chainlint/subshell-here-doc.expect
@@ -1,10 +1,30 @@
(
- echo wobba gorgo snoot wafta snurb <<-EOF &&
+ echo wobba \
+ gorgo snoot \
+ wafta snurb <<-EOF &&
+ quoth the raven,
+ nevermore...
+ EOF
+
cat <<EOF >bip ?!AMP?!
- echo <<-EOF >bop
+ fish fly high
+EOF
+
+ echo <<-\EOF >bop
+ gomez
+ morticia
+ wednesday
+ pugsly
+ EOF
) &&
(
- cat <<-ARBITRARY >bup &&
- cat <<-ARBITRARY3 >bup3 &&
+ cat <<-\ARBITRARY >bup &&
+ glink
+ FIZZ
+ ARBITRARY
+ cat <<-"ARBITRARY3" >bup3 &&
+ glink
+ FIZZ
+ ARBITRARY3
meep
)
diff --git a/t/chainlint/subshell-one-liner.expect b/t/chainlint/subshell-one-liner.expect
index b701536..8f69499 100644
--- a/t/chainlint/subshell-one-liner.expect
+++ b/t/chainlint/subshell-one-liner.expect
@@ -2,13 +2,18 @@
(foo && bar) &&
(foo && bar) |
(foo && bar) >baz &&
+
(foo; ?!AMP?! bar) &&
(foo; ?!AMP?! bar) |
(foo; ?!AMP?! bar) >baz &&
+
(foo || exit 1) &&
(foo || exit 1) |
(foo || exit 1) >baz &&
+
(foo && bar) ?!AMP?!
+
(foo && bar; ?!AMP?! baz) ?!AMP?!
+
foobar
)
diff --git a/t/chainlint/t7900-subtree.expect b/t/chainlint/t7900-subtree.expect
index 1cccc7b..02f3129 100644
--- a/t/chainlint/t7900-subtree.expect
+++ b/t/chainlint/t7900-subtree.expect
@@ -1,10 +1,22 @@
(
- chks="sub1sub2sub3sub4" &&
+ chks="sub1
+sub2
+sub3
+sub4" &&
chks_sub=$(cat <<TXT | sed "s,^,sub dir/,"
+$chks
+TXT
) &&
- chkms="main-sub1main-sub2main-sub3main-sub4" &&
+ chkms="main-sub1
+main-sub2
+main-sub3
+main-sub4" &&
chkms_sub=$(cat <<TXT | sed "s,^,sub dir/,"
+$chkms
+TXT
) &&
+
subfiles=$(git ls-files) &&
- check_equal "$subfiles" "$chkms$chks"
+ check_equal "$subfiles" "$chkms
+$chks"
)
diff --git a/t/chainlint/token-pasting.expect b/t/chainlint/token-pasting.expect
new file mode 100644
index 0000000..6a38791
--- /dev/null
+++ b/t/chainlint/token-pasting.expect
@@ -0,0 +1,27 @@
+git config filter.rot13.smudge ./rot13.sh &&
+git config filter.rot13.clean ./rot13.sh &&
+
+{
+ echo "*.t filter=rot13" ?!AMP?!
+ echo "*.i ident"
+} >.gitattributes &&
+
+{
+ echo a b c d e f g h i j k l m ?!AMP?!
+ echo n o p q r s t u v w x y z ?!AMP?!
+ echo '$Id$'
+} >test &&
+cat test >test.t &&
+cat test >test.o &&
+cat test >test.i &&
+git add test test.t test.i &&
+rm -f test test.t test.i &&
+git checkout -- test test.t test.i &&
+
+echo "content-test2" >test2.o &&
+echo "content-test3 - filename with special characters" >"test3 'sq',$x=.o" ?!AMP?!
+
+downstream_url_for_sed=$(
+ printf "%sn" "$downstream_url" |
+ sed -e 's/\/\\/g' -e 's/[[/.*^$]/\&/g'
+)
diff --git a/t/chainlint/token-pasting.test b/t/chainlint/token-pasting.test
new file mode 100644
index 0000000..b4610ce
--- /dev/null
+++ b/t/chainlint/token-pasting.test
@@ -0,0 +1,32 @@
+# LINT: single token; composite of multiple strings
+git config filter.rot13.smudge ./rot13.sh &&
+git config filter.rot13.clean ./rot13.sh &&
+
+{
+ echo "*.t filter=rot13"
+ echo "*.i ident"
+} >.gitattributes &&
+
+{
+ echo a b c d e f g h i j k l m
+ echo n o p q r s t u v w x y z
+# LINT: exit/enter string context and escaped-quote outside of string
+ echo '\''$Id$'\''
+} >test &&
+cat test >test.t &&
+cat test >test.o &&
+cat test >test.i &&
+git add test test.t test.i &&
+rm -f test test.t test.i &&
+git checkout -- test test.t test.i &&
+
+echo "content-test2" >test2.o &&
+# LINT: exit/enter string context and escaped-quote outside of string
+echo "content-test3 - filename with special characters" >"test3 '\''sq'\'',\$x=.o"
+
+# LINT: single token; composite of multiple strings
+downstream_url_for_sed=$(
+ printf "%s\n" "$downstream_url" |
+# LINT: exit/enter string context; "&" inside string not command terminator
+ sed -e '\''s/\\/\\\\/g'\'' -e '\''s/[[/.*^$]/\\&/g'\''
+)
diff --git a/t/chainlint/unclosed-here-doc-indent.expect b/t/chainlint/unclosed-here-doc-indent.expect
new file mode 100644
index 0000000..7c30a1a
--- /dev/null
+++ b/t/chainlint/unclosed-here-doc-indent.expect
@@ -0,0 +1,4 @@
+command_which_is_run &&
+cat >expect <<-\EOF ?!UNCLOSED-HEREDOC?! &&
+we forget to end the here-doc
+command_which_is_gobbled
diff --git a/t/chainlint/unclosed-here-doc-indent.test b/t/chainlint/unclosed-here-doc-indent.test
new file mode 100644
index 0000000..5c841a9
--- /dev/null
+++ b/t/chainlint/unclosed-here-doc-indent.test
@@ -0,0 +1,4 @@
+command_which_is_run &&
+cat >expect <<-\EOF &&
+we forget to end the here-doc
+command_which_is_gobbled
diff --git a/t/chainlint/unclosed-here-doc.expect b/t/chainlint/unclosed-here-doc.expect
new file mode 100644
index 0000000..d65e50f
--- /dev/null
+++ b/t/chainlint/unclosed-here-doc.expect
@@ -0,0 +1,7 @@
+command_which_is_run &&
+cat >expect <<\EOF ?!UNCLOSED-HEREDOC?! &&
+ we try to end the here-doc below,
+ but the indentation throws us off
+ since the operator is not "<<-".
+ EOF
+command_which_is_gobbled
diff --git a/t/chainlint/unclosed-here-doc.test b/t/chainlint/unclosed-here-doc.test
new file mode 100644
index 0000000..69d3786
--- /dev/null
+++ b/t/chainlint/unclosed-here-doc.test
@@ -0,0 +1,7 @@
+command_which_is_run &&
+cat >expect <<\EOF &&
+ we try to end the here-doc below,
+ but the indentation throws us off
+ since the operator is not "<<-".
+ EOF
+command_which_is_gobbled
diff --git a/t/chainlint/while-loop.expect b/t/chainlint/while-loop.expect
index 0d3a9b3..06c1567 100644
--- a/t/chainlint/while-loop.expect
+++ b/t/chainlint/while-loop.expect
@@ -2,10 +2,13 @@
while true
do
echo foo ?!AMP?!
- cat <<-EOF
+ cat <<-\EOF ?!LOOP?!
+ bar
+ EOF
done ?!AMP?!
+
while true; do
echo foo &&
- cat bar
+ cat bar ?!LOOP?!
done
)
diff --git a/t/check-non-portable-shell.pl b/t/check-non-portable-shell.pl
index fd33035..b2b28c2 100755
--- a/t/check-non-portable-shell.pl
+++ b/t/check-non-portable-shell.pl
@@ -45,7 +45,10 @@ while (<>) {
/\bhead\s+-c\b/ and err 'head -c is not portable (use test_copy_bytes BYTES <file >out)';
/(?:\$\(seq|^\s*seq\b)/ and err 'seq is not portable (use test_seq)';
/\bgrep\b.*--file\b/ and err 'grep --file FILE is not portable (use grep -f FILE)';
+ /\b[ef]grep\b/ and err 'egrep/fgrep obsolescent (use grep -E/-F)';
/\bexport\s+[A-Za-z0-9_]*=/ and err '"export FOO=bar" is not portable (use FOO=bar && export FOO)';
+ /\blocal\s+[A-Za-z0-9_]*=\$([A-Za-z0-9_{]|[(][^(])/ and
+ err q(quote "$val" in 'local var=$val');
/^\s*([A-Z0-9_]+=(\w*|(["']).*?\3)\s+)+(\w+)/ and exists($func{$4}) and
err '"FOO=bar shell_func" assignment extends beyond "shell_func"';
$line = '';
diff --git a/t/helper/test-advise.c b/t/helper/test-advise.c
index cb88113..8a3fd00 100644
--- a/t/helper/test-advise.c
+++ b/t/helper/test-advise.c
@@ -1,7 +1,7 @@
#include "test-tool.h"
-#include "cache.h"
#include "advice.h"
#include "config.h"
+#include "setup.h"
int cmd__advise_if_enabled(int argc, const char **argv)
{
diff --git a/t/helper/test-bitmap.c b/t/helper/test-bitmap.c
index ff35f59..af43ee1 100644
--- a/t/helper/test-bitmap.c
+++ b/t/helper/test-bitmap.c
@@ -1,6 +1,7 @@
#include "test-tool.h"
-#include "cache.h"
+#include "git-compat-util.h"
#include "pack-bitmap.h"
+#include "setup.h"
static int bitmap_list_commits(void)
{
diff --git a/t/helper/test-bloom.c b/t/helper/test-bloom.c
index ad3ef1c..1281e66 100644
--- a/t/helper/test-bloom.c
+++ b/t/helper/test-bloom.c
@@ -1,7 +1,9 @@
-#include "git-compat-util.h"
-#include "bloom.h"
#include "test-tool.h"
+#include "bloom.h"
+#include "hex.h"
#include "commit.h"
+#include "repository.h"
+#include "setup.h"
static struct bloom_filter_settings settings = DEFAULT_BLOOM_FILTER_SETTINGS;
@@ -16,6 +18,7 @@ static void add_string_to_filter(const char *data, struct bloom_filter *filter)
}
printf("\n");
add_key_to_filter(&key, filter, &settings);
+ clear_bloom_key(&key);
}
static void print_bloom_filter(struct bloom_filter *filter) {
@@ -37,7 +40,6 @@ static void get_bloom_filter_for_commit(const struct object_id *commit_oid)
{
struct commit *c;
struct bloom_filter *filter;
- setup_git_directory();
c = lookup_commit(the_repository, commit_oid);
filter = get_or_compute_bloom_filter(the_repository, c, 1,
&settings,
@@ -80,6 +82,7 @@ int cmd__bloom(int argc, const char **argv)
}
print_bloom_filter(&filter);
+ free(filter.data);
}
if (!strcmp(argv[1], "get_filter_for_commit")) {
diff --git a/t/helper/test-bundle-uri.c b/t/helper/test-bundle-uri.c
new file mode 100644
index 0000000..09dc787
--- /dev/null
+++ b/t/helper/test-bundle-uri.c
@@ -0,0 +1,135 @@
+#include "test-tool.h"
+#include "parse-options.h"
+#include "bundle-uri.h"
+#include "gettext.h"
+#include "strbuf.h"
+#include "string-list.h"
+#include "transport.h"
+#include "remote.h"
+
+enum input_mode {
+ KEY_VALUE_PAIRS,
+ CONFIG_FILE,
+};
+
+static int cmd__bundle_uri_parse(int argc, const char **argv, enum input_mode mode)
+{
+ const char *key_value_usage[] = {
+ "test-tool bundle-uri parse-key-values <input>",
+ NULL
+ };
+ const char *config_usage[] = {
+ "test-tool bundle-uri parse-config <input>",
+ NULL
+ };
+ const char **usage = key_value_usage;
+ struct option options[] = {
+ OPT_END(),
+ };
+ struct strbuf sb = STRBUF_INIT;
+ struct bundle_list list;
+ int err = 0;
+ FILE *fp;
+
+ if (mode == CONFIG_FILE)
+ usage = config_usage;
+
+ argc = parse_options(argc, argv, NULL, options, usage,
+ PARSE_OPT_STOP_AT_NON_OPTION);
+
+ init_bundle_list(&list);
+
+ list.baseURI = xstrdup("<uri>");
+
+ switch (mode) {
+ case KEY_VALUE_PAIRS:
+ if (argc != 1)
+ goto usage;
+ fp = fopen(argv[0], "r");
+ if (!fp)
+ die("failed to open '%s'", argv[0]);
+ while (strbuf_getline(&sb, fp) != EOF) {
+ if (bundle_uri_parse_line(&list, sb.buf))
+ err = error("bad line: '%s'", sb.buf);
+ }
+ fclose(fp);
+ break;
+
+ case CONFIG_FILE:
+ if (argc != 1)
+ goto usage;
+ err = bundle_uri_parse_config_format("<uri>", argv[0], &list);
+ break;
+ }
+ strbuf_release(&sb);
+
+ print_bundle_list(stdout, &list);
+
+ clear_bundle_list(&list);
+
+ return !!err;
+
+usage:
+ usage_with_options(usage, options);
+}
+
+static int cmd_ls_remote(int argc, const char **argv)
+{
+ const char *dest;
+ struct remote *remote;
+ struct transport *transport;
+ int status = 0;
+
+ dest = argc > 1 ? argv[1] : NULL;
+
+ remote = remote_get(dest);
+ if (!remote) {
+ if (dest)
+ die(_("bad repository '%s'"), dest);
+ die(_("no remote configured to get bundle URIs from"));
+ }
+ if (!remote->url_nr)
+ die(_("remote '%s' has no configured URL"), dest);
+
+ transport = transport_get(remote, NULL);
+ if (transport_get_remote_bundle_uri(transport) < 0) {
+ error(_("could not get the bundle-uri list"));
+ status = 1;
+ goto cleanup;
+ }
+
+ print_bundle_list(stdout, transport->bundles);
+
+cleanup:
+ if (transport_disconnect(transport))
+ return 1;
+ return status;
+}
+
+int cmd__bundle_uri(int argc, const char **argv)
+{
+ const char *usage[] = {
+ "test-tool bundle-uri <subcommand> [<options>]",
+ NULL
+ };
+ struct option options[] = {
+ OPT_END(),
+ };
+
+ argc = parse_options(argc, argv, NULL, options, usage,
+ PARSE_OPT_STOP_AT_NON_OPTION |
+ PARSE_OPT_KEEP_ARGV0);
+ if (argc == 1)
+ goto usage;
+
+ if (!strcmp(argv[1], "parse-key-values"))
+ return cmd__bundle_uri_parse(argc - 1, argv + 1, KEY_VALUE_PAIRS);
+ if (!strcmp(argv[1], "parse-config"))
+ return cmd__bundle_uri_parse(argc - 1, argv + 1, CONFIG_FILE);
+ if (!strcmp(argv[1], "ls-remote"))
+ return cmd_ls_remote(argc - 1, argv + 1);
+ error("there is no test-tool bundle-uri tool '%s'", argv[1]);
+
+usage:
+ usage_with_options(usage, options);
+}
diff --git a/t/helper/test-cache-tree.c b/t/helper/test-cache-tree.c
new file mode 100644
index 0000000..e723639
--- /dev/null
+++ b/t/helper/test-cache-tree.c
@@ -0,0 +1,69 @@
+#define USE_THE_INDEX_VARIABLE
+#include "test-tool.h"
+#include "gettext.h"
+#include "hex.h"
+#include "tree.h"
+#include "cache-tree.h"
+#include "parse-options.h"
+#include "read-cache-ll.h"
+#include "repository.h"
+#include "setup.h"
+
+static char const * const test_cache_tree_usage[] = {
+ N_("test-tool cache-tree <options> (control|prime|update)"),
+ NULL
+};
+
+int cmd__cache_tree(int argc, const char **argv)
+{
+ struct object_id oid;
+ struct tree *tree;
+ int empty = 0;
+ int invalidate_qty = 0;
+ int i;
+
+ struct option options[] = {
+ OPT_BOOL(0, "empty", &empty,
+ N_("clear the cache tree before each iteration")),
+ OPT_INTEGER_F(0, "invalidate", &invalidate_qty,
+ N_("number of entries in the cache tree to invalidate (default 0)"),
+ PARSE_OPT_NONEG),
+ OPT_END()
+ };
+
+ setup_git_directory();
+
+ argc = parse_options(argc, argv, NULL, options, test_cache_tree_usage, 0);
+
+ if (repo_read_index(the_repository) < 0)
+ die(_("unable to read index file"));
+
+ oidcpy(&oid, &the_index.cache_tree->oid);
+ tree = parse_tree_indirect(&oid);
+ if (!tree)
+ die(_("not a tree object: %s"), oid_to_hex(&oid));
+
+ if (empty) {
+ /* clear the cache tree & allocate a new one */
+ cache_tree_free(&the_index.cache_tree);
+ the_index.cache_tree = cache_tree();
+ } else if (invalidate_qty) {
+ /* invalidate the specified number of unique paths */
+ float f_interval = (float)the_index.cache_nr / invalidate_qty;
+ int interval = f_interval < 1.0 ? 1 : (int)f_interval;
+ for (i = 0; i < invalidate_qty && i * interval < the_index.cache_nr; i++)
+ cache_tree_invalidate_path(&the_index, the_index.cache[i * interval]->name);
+ }
+
+ if (argc != 1)
+ usage_with_options(test_cache_tree_usage, options);
+ else if (!strcmp(argv[0], "prime"))
+ prime_cache_tree(the_repository, &the_index, tree);
+ else if (!strcmp(argv[0], "update"))
+ cache_tree_update(&the_index, WRITE_TREE_SILENT | WRITE_TREE_REPAIR);
+ /* use "control" subcommand to specify no-op */
+ else if (!!strcmp(argv[0], "control"))
+ die(_("Unhandled subcommand '%s'"), argv[0]);
+
+ return 0;
+}
diff --git a/t/helper/test-chmtime.c b/t/helper/test-chmtime.c
index dc28890..0e55388 100644
--- a/t/helper/test-chmtime.c
+++ b/t/helper/test-chmtime.c
@@ -94,7 +94,7 @@ int cmd__chmtime(int argc, const char **argv)
if (timespec_arg(argv[i], &set_time, &set_eq)) {
++i;
} else {
- if (get == 0) {
+ if (get == 0 && verbose == 0) {
fprintf(stderr, "Not a base-10 integer: %s\n", argv[i] + 1);
goto usage;
}
diff --git a/t/helper/test-config.c b/t/helper/test-config.c
index a6e9367..ed444ca 100644
--- a/t/helper/test-config.c
+++ b/t/helper/test-config.c
@@ -1,6 +1,6 @@
#include "test-tool.h"
-#include "cache.h"
#include "config.h"
+#include "setup.h"
#include "string-list.h"
/*
@@ -14,6 +14,8 @@
* get_value_multi -> prints all values for the entered key in increasing order
* of priority
*
+ * get -> print return value for the entered key
+ *
* get_int -> print integer value for the entered key or die
*
* get_bool -> print bool value for the entered key or die
@@ -30,6 +32,9 @@
* iterate -> iterate over all values using git_config(), and print some
* data for each
*
+ * git_config_int -> iterate over all values using git_config() and print the
+ * integer value for the entered key or die
+ *
* Examples:
*
* To print the value with highest priority for key "foo.bAr Baz.rock":
@@ -37,8 +42,11 @@
*
*/
-static int iterate_cb(const char *var, const char *value, void *data)
+static int iterate_cb(const char *var, const char *value,
+ const struct config_context *ctx,
+ void *data UNUSED)
{
+ const struct key_value_info *kvi = ctx->kvi;
static int nr;
if (nr++)
@@ -46,15 +54,29 @@ static int iterate_cb(const char *var, const char *value, void *data)
printf("key=%s\n", var);
printf("value=%s\n", value ? value : "(null)");
- printf("origin=%s\n", current_config_origin_type());
- printf("name=%s\n", current_config_name());
- printf("lno=%d\n", current_config_line());
- printf("scope=%s\n", config_scope_name(current_config_scope()));
+ printf("origin=%s\n", config_origin_type_name(kvi->origin_type));
+ printf("name=%s\n", kvi->filename ? kvi->filename : "");
+ printf("lno=%d\n", kvi->linenr);
+ printf("scope=%s\n", config_scope_name(kvi->scope));
return 0;
}
-static int early_config_cb(const char *var, const char *value, void *vdata)
+static int parse_int_cb(const char *var, const char *value,
+ const struct config_context *ctx, void *data)
+{
+ const char *key_to_match = data;
+
+ if (!strcmp(key_to_match, var)) {
+ int parsed = git_config_int(value, value, ctx->kvi);
+ printf("%d\n", parsed);
+ }
+ return 0;
+}
+
+static int early_config_cb(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *vdata)
{
const char *key = vdata;
@@ -95,8 +117,7 @@ int cmd__config(int argc, const char **argv)
goto exit1;
}
} else if (argc == 3 && !strcmp(argv[1], "get_value_multi")) {
- strptr = git_config_get_value_multi(argv[2]);
- if (strptr) {
+ if (!git_config_get_value_multi(argv[2], &strptr)) {
for (i = 0; i < strptr->nr; i++) {
v = strptr->items[i].string;
if (!v)
@@ -109,6 +130,26 @@ int cmd__config(int argc, const char **argv)
printf("Value not found for \"%s\"\n", argv[2]);
goto exit1;
}
+ } else if (argc == 3 && !strcmp(argv[1], "get")) {
+ int ret;
+
+ if (!(ret = git_config_get(argv[2])))
+ goto exit0;
+ else if (ret == 1)
+ printf("Value not found for \"%s\"\n", argv[2]);
+ else if (ret == -CONFIG_INVALID_KEY)
+ printf("Key \"%s\" is invalid\n", argv[2]);
+ else if (ret == -CONFIG_NO_SECTION_OR_NAME)
+ printf("Key \"%s\" has no section\n", argv[2]);
+ else
+ /*
+ * A normal caller should just check "ret <
+ * 0", but for our own tests let's BUG() if
+ * our whitelist of git_config_parse_key()
+ * return values isn't exhaustive.
+ */
+ BUG("Key \"%s\" has unknown return %d", argv[2], ret);
+ goto exit1;
} else if (argc == 3 && !strcmp(argv[1], "get_int")) {
if (!git_config_get_int(argv[2], &val)) {
printf("%d\n", val);
@@ -141,7 +182,7 @@ int cmd__config(int argc, const char **argv)
goto exit2;
}
}
- if (!git_configset_get_value(&cs, argv[2], &v)) {
+ if (!git_configset_get_value(&cs, argv[2], &v, NULL)) {
if (!v)
printf("(NULL)\n");
else
@@ -159,8 +200,7 @@ int cmd__config(int argc, const char **argv)
goto exit2;
}
}
- strptr = git_configset_get_value_multi(&cs, argv[2]);
- if (strptr) {
+ if (!git_configset_get_value_multi(&cs, argv[2], &strptr)) {
for (i = 0; i < strptr->nr; i++) {
v = strptr->items[i].string;
if (!v)
@@ -176,6 +216,9 @@ int cmd__config(int argc, const char **argv)
} else if (!strcmp(argv[1], "iterate")) {
git_config(iterate_cb, NULL);
goto exit0;
+ } else if (argc == 3 && !strcmp(argv[1], "git_config_int")) {
+ git_config(parse_int_cb, (void *) argv[2]);
+ goto exit0;
}
die("%s: Please check the syntax and the function name", argv[0]);
diff --git a/t/helper/test-crontab.c b/t/helper/test-crontab.c
index e7c0137..597027a 100644
--- a/t/helper/test-crontab.c
+++ b/t/helper/test-crontab.c
@@ -1,34 +1,34 @@
#include "test-tool.h"
-#include "cache.h"
/*
- * Usage: test-tool cron <file> [-l]
+ * Usage: test-tool crontab <file> -l|<input>
*
* If -l is specified, then write the contents of <file> to stdout.
- * Otherwise, write from stdin into <file>.
+ * Otherwise, copy the contents of <input> into <file>.
*/
int cmd__crontab(int argc, const char **argv)
{
int a;
FILE *from, *to;
- if (argc == 3 && !strcmp(argv[2], "-l")) {
+ if (argc != 3)
+ usage("test-tool crontab <file> -l|<input>");
+
+ if (!strcmp(argv[2], "-l")) {
from = fopen(argv[1], "r");
if (!from)
return 0;
to = stdout;
- } else if (argc == 2) {
- from = stdin;
- to = fopen(argv[1], "w");
- } else
- return error("unknown arguments");
+ } else {
+ from = xfopen(argv[2], "r");
+ to = xfopen(argv[1], "w");
+ }
while ((a = fgetc(from)) != EOF)
fputc(a, to);
- if (argc == 3)
- fclose(from);
- else
+ fclose(from);
+ if (to != stdout)
fclose(to);
return 0;
diff --git a/t/helper/test-ctype.c b/t/helper/test-ctype.c
deleted file mode 100644
index 92c4c23..0000000
--- a/t/helper/test-ctype.c
+++ /dev/null
@@ -1,43 +0,0 @@
-#include "test-tool.h"
-#include "cache.h"
-
-static int rc;
-
-static void report_error(const char *class, int ch)
-{
- printf("%s classifies char %d (0x%02x) wrongly\n", class, ch, ch);
- rc = 1;
-}
-
-static int is_in(const char *s, int ch)
-{
- /* We can't find NUL using strchr. It's classless anyway. */
- if (ch == '\0')
- return 0;
- return !!strchr(s, ch);
-}
-
-#define TEST_CLASS(t,s) { \
- int i; \
- for (i = 0; i < 256; i++) { \
- if (is_in(s, i) != t(i)) \
- report_error(#t, i); \
- } \
-}
-
-#define DIGIT "0123456789"
-#define LOWER "abcdefghijklmnopqrstuvwxyz"
-#define UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-
-int cmd__ctype(int argc, const char **argv)
-{
- TEST_CLASS(isdigit, DIGIT);
- TEST_CLASS(isspace, " \n\r\t");
- TEST_CLASS(isalpha, LOWER UPPER);
- TEST_CLASS(isalnum, LOWER UPPER DIGIT);
- TEST_CLASS(is_glob_special, "*?[\\");
- TEST_CLASS(is_regex_special, "$()*+.?[\\^{|");
- TEST_CLASS(is_pathspec_magic, "!\"#%&',-/:;<=>@_`~");
-
- return rc;
-}
diff --git a/t/helper/test-date.c b/t/helper/test-date.c
index 45951b1..f25512d 100644
--- a/t/helper/test-date.c
+++ b/t/helper/test-date.c
@@ -1,6 +1,6 @@
#include "test-tool.h"
-#include "cache.h"
#include "date.h"
+#include "trace.h"
static const char *usage_msg = "\n"
" test-tool date relative [time_t]...\n"
@@ -52,7 +52,7 @@ static void show_dates(const char **argv, const char *format)
arg++;
tz = atoi(arg);
- printf("%s -> %s\n", *argv, show_date(t, tz, &mode));
+ printf("%s -> %s\n", *argv, show_date(t, tz, mode));
}
date_mode_release(&mode);
@@ -81,7 +81,7 @@ static void parse_approxidate(const char **argv)
{
for (; *argv; argv++) {
timestamp_t t;
- t = approxidate_relative(*argv);
+ t = approxidate(*argv);
printf("%s -> %s\n", *argv, show_date(t, 0, DATE_MODE(ISO8601)));
}
}
@@ -90,7 +90,7 @@ static void parse_approx_timestamp(const char **argv)
{
for (; *argv; argv++) {
timestamp_t t;
- t = approxidate_relative(*argv);
+ t = approxidate(*argv);
printf("%s -> %"PRItime"\n", *argv, t);
}
}
@@ -104,7 +104,7 @@ static void getnanos(const char **argv)
printf("%lf\n", seconds);
}
-int cmd__date(int argc, const char **argv)
+int cmd__date(int argc UNUSED, const char **argv)
{
const char *x;
diff --git a/t/helper/test-delete-gpgsig.c b/t/helper/test-delete-gpgsig.c
new file mode 100644
index 0000000..e36831a
--- /dev/null
+++ b/t/helper/test-delete-gpgsig.c
@@ -0,0 +1,62 @@
+#include "test-tool.h"
+#include "gpg-interface.h"
+#include "strbuf.h"
+
+
+int cmd__delete_gpgsig(int argc, const char **argv)
+{
+ struct strbuf buf = STRBUF_INIT;
+ const char *pattern = "gpgsig";
+ const char *bufptr, *tail, *eol;
+ int deleting = 0;
+ size_t plen;
+
+ if (argc >= 2) {
+ pattern = argv[1];
+ argv++;
+ argc--;
+ }
+
+ plen = strlen(pattern);
+ strbuf_read(&buf, 0, 0);
+
+ if (!strcmp(pattern, "trailer")) {
+ size_t payload_size = parse_signed_buffer(buf.buf, buf.len);
+ fwrite(buf.buf, 1, payload_size, stdout);
+ fflush(stdout);
+ return 0;
+ }
+
+ bufptr = buf.buf;
+ tail = bufptr + buf.len;
+
+ while (bufptr < tail) {
+ /* Find the end of the line */
+ eol = memchr(bufptr, '\n', tail - bufptr);
+ if (!eol)
+ eol = tail;
+
+ /* Drop continuation lines */
+ if (deleting && (bufptr < eol) && (bufptr[0] == ' ')) {
+ bufptr = eol + 1;
+ continue;
+ }
+ deleting = 0;
+
+ /* Does the line match the prefix? */
+ if (((bufptr + plen) < eol) &&
+ !memcmp(bufptr, pattern, plen) &&
+ (bufptr[plen] == ' ')) {
+ deleting = 1;
+ bufptr = eol + 1;
+ continue;
+ }
+
+ /* Print all other lines */
+ fwrite(bufptr, 1, (eol - bufptr) + 1, stdout);
+ bufptr = eol + 1;
+ }
+ fflush(stdout);
+
+ return 0;
+}
diff --git a/t/helper/test-delta.c b/t/helper/test-delta.c
index e749a49..6bc787a 100644
--- a/t/helper/test-delta.c
+++ b/t/helper/test-delta.c
@@ -11,7 +11,6 @@
#include "test-tool.h"
#include "git-compat-util.h"
#include "delta.h"
-#include "cache.h"
static const char usage_str[] =
"test-tool delta (-d|-p) <from_file> <data_file> <out_file>";
@@ -20,8 +19,9 @@ int cmd__delta(int argc, const char **argv)
{
int fd;
struct stat st;
- void *from_buf, *data_buf, *out_buf;
+ void *from_buf = NULL, *data_buf = NULL, *out_buf = NULL;
unsigned long from_size, data_size, out_size;
+ int ret = 1;
if (argc != 5 || (strcmp(argv[1], "-d") && strcmp(argv[1], "-p"))) {
fprintf(stderr, "usage: %s\n", usage_str);
@@ -38,21 +38,21 @@ int cmd__delta(int argc, const char **argv)
if (read_in_full(fd, from_buf, from_size) < 0) {
perror(argv[2]);
close(fd);
- return 1;
+ goto cleanup;
}
close(fd);
fd = open(argv[3], O_RDONLY);
if (fd < 0 || fstat(fd, &st)) {
perror(argv[3]);
- return 1;
+ goto cleanup;
}
data_size = st.st_size;
data_buf = xmalloc(data_size);
if (read_in_full(fd, data_buf, data_size) < 0) {
perror(argv[3]);
close(fd);
- return 1;
+ goto cleanup;
}
close(fd);
@@ -66,14 +66,20 @@ int cmd__delta(int argc, const char **argv)
&out_size);
if (!out_buf) {
fprintf(stderr, "delta operation failed (returned NULL)\n");
- return 1;
+ goto cleanup;
}
fd = open (argv[4], O_WRONLY|O_CREAT|O_TRUNC, 0666);
if (fd < 0 || write_in_full(fd, out_buf, out_size) < 0) {
perror(argv[4]);
- return 1;
+ goto cleanup;
}
- return 0;
+ ret = 0;
+cleanup:
+ free(from_buf);
+ free(data_buf);
+ free(out_buf);
+
+ return ret;
}
diff --git a/t/helper/test-dir-iterator.c b/t/helper/test-dir-iterator.c
index 659b6bf..6b297bd 100644
--- a/t/helper/test-dir-iterator.c
+++ b/t/helper/test-dir-iterator.c
@@ -15,7 +15,7 @@ static const char *error_name(int error_number)
/*
* usage:
- * tool-test dir-iterator [--follow-symlinks] [--pedantic] directory_path
+ * tool-test dir-iterator [--pedantic] directory_path
*/
int cmd__dir_iterator(int argc, const char **argv)
{
@@ -24,9 +24,7 @@ int cmd__dir_iterator(int argc, const char **argv)
int iter_status;
for (++argv, --argc; *argv && starts_with(*argv, "--"); ++argv, --argc) {
- if (strcmp(*argv, "--follow-symlinks") == 0)
- flags |= DIR_ITERATOR_FOLLOW_SYMLINKS;
- else if (strcmp(*argv, "--pedantic") == 0)
+ if (strcmp(*argv, "--pedantic") == 0)
flags |= DIR_ITERATOR_PEDANTIC;
else
die("invalid option '%s'", *argv);
diff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c
index e37396d..73e551c 100644
--- a/t/helper/test-drop-caches.c
+++ b/t/helper/test-drop-caches.c
@@ -155,7 +155,7 @@ static int cmd_dropcaches(void)
#endif
-int cmd__drop_caches(int argc, const char **argv)
+int cmd__drop_caches(int argc UNUSED, const char **argv UNUSED)
{
cmd_sync();
return cmd_dropcaches();
diff --git a/t/helper/test-dump-cache-tree.c b/t/helper/test-dump-cache-tree.c
index 6a3f88f..c38f546 100644
--- a/t/helper/test-dump-cache-tree.c
+++ b/t/helper/test-dump-cache-tree.c
@@ -1,8 +1,12 @@
+#define USE_THE_INDEX_VARIABLE
#include "test-tool.h"
-#include "cache.h"
+#include "hash.h"
+#include "hex.h"
#include "tree.h"
#include "cache-tree.h"
-
+#include "read-cache-ll.h"
+#include "repository.h"
+#include "setup.h"
static void dump_one(struct cache_tree *it, const char *pfx, const char *x)
{
@@ -55,15 +59,20 @@ static int dump_cache_tree(struct cache_tree *it,
return errs;
}
-int cmd__dump_cache_tree(int ac, const char **av)
+int cmd__dump_cache_tree(int ac UNUSED, const char **av UNUSED)
{
struct index_state istate;
struct cache_tree *another = cache_tree();
+ int ret;
+
setup_git_directory();
- if (read_cache() < 0)
+ if (repo_read_index(the_repository) < 0)
die("unable to read index file");
istate = the_index;
istate.cache_tree = another;
cache_tree_update(&istate, WRITE_TREE_DRY_RUN);
- return dump_cache_tree(active_cache_tree, another, "");
+ ret = dump_cache_tree(the_index.cache_tree, another, "");
+ cache_tree_free(&another);
+
+ return ret;
}
diff --git a/t/helper/test-dump-fsmonitor.c b/t/helper/test-dump-fsmonitor.c
index 975f0ac..4f215fe 100644
--- a/t/helper/test-dump-fsmonitor.c
+++ b/t/helper/test-dump-fsmonitor.c
@@ -1,7 +1,9 @@
#include "test-tool.h"
-#include "cache.h"
+#include "read-cache-ll.h"
+#include "repository.h"
+#include "setup.h"
-int cmd__dump_fsmonitor(int ac, const char **av)
+int cmd__dump_fsmonitor(int ac UNUSED, const char **av UNUSED)
{
struct index_state *istate = the_repository->index;
int i;
diff --git a/t/helper/test-dump-split-index.c b/t/helper/test-dump-split-index.c
index a209880..f29d18e 100644
--- a/t/helper/test-dump-split-index.c
+++ b/t/helper/test-dump-split-index.c
@@ -1,14 +1,18 @@
+#define USE_THE_INDEX_VARIABLE
#include "test-tool.h"
-#include "cache.h"
+#include "hex.h"
+#include "read-cache-ll.h"
+#include "repository.h"
+#include "setup.h"
#include "split-index.h"
#include "ewah/ewok.h"
-static void show_bit(size_t pos, void *data)
+static void show_bit(size_t pos, void *data UNUSED)
{
printf(" %d", (int)pos);
}
-int cmd__dump_split_index(int ac, const char **av)
+int cmd__dump_split_index(int ac UNUSED, const char **av)
{
struct split_index *si;
int i;
diff --git a/t/helper/test-dump-untracked-cache.c b/t/helper/test-dump-untracked-cache.c
index 9901061..b4af971 100644
--- a/t/helper/test-dump-untracked-cache.c
+++ b/t/helper/test-dump-untracked-cache.c
@@ -1,7 +1,10 @@
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "test-tool.h"
-#include "cache.h"
#include "dir.h"
+#include "hex.h"
+#include "read-cache-ll.h"
+#include "repository.h"
+#include "setup.h"
static int compare_untracked(const void *a_, const void *b_)
{
@@ -40,7 +43,7 @@ static void dump(struct untracked_cache_dir *ucd, struct strbuf *base)
strbuf_setlen(base, len);
}
-int cmd__dump_untracked_cache(int ac, const char **av)
+int cmd__dump_untracked_cache(int ac UNUSED, const char **av UNUSED)
{
struct untracked_cache *uc;
struct strbuf base = STRBUF_INIT;
@@ -51,7 +54,7 @@ int cmd__dump_untracked_cache(int ac, const char **av)
xsetenv("GIT_CONFIG_VALUE_0", "keep", 1);
setup_git_directory();
- if (read_cache() < 0)
+ if (repo_read_index(the_repository) < 0)
die("unable to read index file");
uc = the_index.untracked;
if (!uc) {
diff --git a/builtin/env--helper.c b/t/helper/test-env-helper.c
index 2734909..1c48688 100644
--- a/builtin/env--helper.c
+++ b/t/helper/test-env-helper.c
@@ -1,9 +1,9 @@
-#include "builtin.h"
-#include "config.h"
+#include "test-tool.h"
+#include "parse.h"
#include "parse-options.h"
static char const * const env__helper_usage[] = {
- N_("git env--helper --type=[bool|ulong] <options> <env-var>"),
+ "test-tool env-helper --type=[bool|ulong] <options> <env-var>",
NULL
};
@@ -24,12 +24,12 @@ static int option_parse_type(const struct option *opt, const char *arg,
else if (!strcmp(arg, "ulong"))
*cmdmode = ENV_HELPER_TYPE_ULONG;
else
- die(_("unrecognized --type argument, %s"), arg);
+ die("unrecognized --type argument, %s", arg);
return 0;
}
-int cmd_env__helper(int argc, const char **argv, const char *prefix)
+int cmd__env_helper(int argc, const char **argv)
{
int exit_code = 0;
const char *env_variable = NULL;
@@ -39,18 +39,18 @@ int cmd_env__helper(int argc, const char **argv, const char *prefix)
unsigned long ret_ulong, default_ulong;
enum cmdmode cmdmode = 0;
struct option opts[] = {
- OPT_CALLBACK_F(0, "type", &cmdmode, N_("type"),
- N_("value is given this type"), PARSE_OPT_NONEG,
+ OPT_CALLBACK_F(0, "type", &cmdmode, "type",
+ "value is given this type", PARSE_OPT_NONEG,
option_parse_type),
- OPT_STRING(0, "default", &env_default, N_("value"),
- N_("default for git_env_*(...) to fall back on")),
+ OPT_STRING(0, "default", &env_default, "value",
+ "default for git_env_*(...) to fall back on"),
OPT_BOOL(0, "exit-code", &exit_code,
- N_("be quiet only use git_env_*() value as exit code")),
+ "be quiet only use git_env_*() value as exit code"),
OPT_END(),
};
- argc = parse_options(argc, argv, prefix, opts, env__helper_usage,
- PARSE_OPT_KEEP_UNKNOWN);
+ argc = parse_options(argc, argv, NULL, opts, env__helper_usage,
+ PARSE_OPT_KEEP_UNKNOWN_OPT);
if (env_default && !*env_default)
usage_with_options(env__helper_usage, opts);
if (!cmdmode)
@@ -64,7 +64,7 @@ int cmd_env__helper(int argc, const char **argv, const char *prefix)
if (env_default) {
default_int = git_parse_maybe_bool(env_default);
if (default_int == -1) {
- error(_("option `--default' expects a boolean value with `--type=bool`, not `%s`"),
+ error("option `--default' expects a boolean value with `--type=bool`, not `%s`",
env_default);
usage_with_options(env__helper_usage, opts);
}
@@ -79,7 +79,7 @@ int cmd_env__helper(int argc, const char **argv, const char *prefix)
case ENV_HELPER_TYPE_ULONG:
if (env_default) {
if (!git_parse_ulong(env_default, &default_ulong)) {
- error(_("option `--default' expects an unsigned long value with `--type=ulong`, not `%s`"),
+ error("option `--default' expects an unsigned long value with `--type=ulong`, not `%s`",
env_default);
usage_with_options(env__helper_usage, opts);
}
diff --git a/t/helper/test-example-decorate.c b/t/helper/test-example-decorate.c
index b9d1200..8f59f6b 100644
--- a/t/helper/test-example-decorate.c
+++ b/t/helper/test-example-decorate.c
@@ -1,9 +1,10 @@
#include "test-tool.h"
-#include "cache.h"
+#include "git-compat-util.h"
#include "object.h"
#include "decorate.h"
+#include "repository.h"
-int cmd__example_decorate(int argc, const char **argv)
+int cmd__example_decorate(int argc UNUSED, const char **argv UNUSED)
{
struct decoration n;
struct object_id one_oid = { {1} };
@@ -71,5 +72,7 @@ int cmd__example_decorate(int argc, const char **argv)
if (objects_noticed != 2)
BUG("should have 2 objects");
+ clear_decoration(&n, NULL);
+
return 0;
}
diff --git a/t/helper/test-fake-ssh.c b/t/helper/test-fake-ssh.c
index 12beee9..27323cb 100644
--- a/t/helper/test-fake-ssh.c
+++ b/t/helper/test-fake-ssh.c
@@ -8,7 +8,7 @@ int cmd_main(int argc, const char **argv)
struct strbuf buf = STRBUF_INIT;
FILE *f;
int i;
- const char *child_argv[] = { NULL, NULL };
+ struct child_process cmd = CHILD_PROCESS_INIT;
/* First, print all parameters into $TRASH_DIRECTORY/ssh-output */
if (!trash_directory)
@@ -17,6 +17,7 @@ int cmd_main(int argc, const char **argv)
f = fopen(buf.buf, "w");
if (!f)
die("Could not write to %s", buf.buf);
+ strbuf_release(&buf);
for (i = 0; i < argc; i++)
fprintf(f, "%s%s", i > 0 ? " " : "", i > 0 ? argv[i] : "ssh:");
fprintf(f, "\n");
@@ -25,6 +26,7 @@ int cmd_main(int argc, const char **argv)
/* Now, evaluate the *last* parameter */
if (argc < 2)
return 0;
- child_argv[0] = argv[argc - 1];
- return run_command_v_opt(child_argv, RUN_USING_SHELL);
+ cmd.use_shell = 1;
+ strvec_push(&cmd.args, argv[argc - 1]);
+ return run_command(&cmd);
}
diff --git a/t/helper/test-fast-rebase.c b/t/helper/test-fast-rebase.c
deleted file mode 100644
index 4e5553e..0000000
--- a/t/helper/test-fast-rebase.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * "git fast-rebase" builtin command
- *
- * FAST: Forking Any Subprocesses (is) Taboo
- *
- * This is meant SOLELY as a demo of what is possible. sequencer.c and
- * rebase.c should be refactored to use the ideas here, rather than attempting
- * to extend this file to replace those (unless Phillip or Dscho say that
- * refactoring is too hard and we need a clean slate, but I'm guessing that
- * refactoring is the better route).
- */
-
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
-#include "test-tool.h"
-
-#include "cache-tree.h"
-#include "commit.h"
-#include "lockfile.h"
-#include "merge-ort.h"
-#include "refs.h"
-#include "revision.h"
-#include "sequencer.h"
-#include "strvec.h"
-#include "tree.h"
-
-static const char *short_commit_name(struct commit *commit)
-{
- return find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV);
-}
-
-static struct commit *peel_committish(const char *name)
-{
- struct object *obj;
- struct object_id oid;
-
- if (get_oid(name, &oid))
- return NULL;
- obj = parse_object(the_repository, &oid);
- return (struct commit *)peel_to_type(name, 0, obj, OBJ_COMMIT);
-}
-
-static char *get_author(const char *message)
-{
- size_t len;
- const char *a;
-
- a = find_commit_header(message, "author", &len);
- if (a)
- return xmemdupz(a, len);
-
- return NULL;
-}
-
-static struct commit *create_commit(struct tree *tree,
- struct commit *based_on,
- struct commit *parent)
-{
- struct object_id ret;
- struct object *obj;
- struct commit_list *parents = NULL;
- char *author;
- char *sign_commit = NULL;
- struct commit_extra_header *extra;
- struct strbuf msg = STRBUF_INIT;
- const char *out_enc = get_commit_output_encoding();
- const char *message = logmsg_reencode(based_on, NULL, out_enc);
- const char *orig_message = NULL;
- const char *exclude_gpgsig[] = { "gpgsig", NULL };
-
- commit_list_insert(parent, &parents);
- extra = read_commit_extra_headers(based_on, exclude_gpgsig);
- find_commit_subject(message, &orig_message);
- strbuf_addstr(&msg, orig_message);
- author = get_author(message);
- reset_ident_date();
- if (commit_tree_extended(msg.buf, msg.len, &tree->object.oid, parents,
- &ret, author, NULL, sign_commit, extra)) {
- error(_("failed to write commit object"));
- return NULL;
- }
- free(author);
- strbuf_release(&msg);
-
- obj = parse_object(the_repository, &ret);
- return (struct commit *)obj;
-}
-
-int cmd__fast_rebase(int argc, const char **argv)
-{
- struct commit *onto;
- struct commit *last_commit = NULL, *last_picked_commit = NULL;
- struct object_id head;
- struct lock_file lock = LOCK_INIT;
- struct strvec rev_walk_args = STRVEC_INIT;
- struct rev_info revs;
- struct commit *commit;
- struct merge_options merge_opt;
- struct tree *next_tree, *base_tree, *head_tree;
- struct merge_result result;
- struct strbuf reflog_msg = STRBUF_INIT;
- struct strbuf branch_name = STRBUF_INIT;
- int ret = 0;
-
- /*
- * test-tool stuff doesn't set up the git directory by default; need to
- * do that manually.
- */
- setup_git_directory();
-
- if (argc == 2 && !strcmp(argv[1], "-h")) {
- printf("Sorry, I am not a psychiatrist; I can not give you the help you need. Oh, you meant usage...\n");
- exit(129);
- }
-
- if (argc != 5 || strcmp(argv[1], "--onto"))
- die("usage: read the code, figure out how to use it, then do so");
-
- onto = peel_committish(argv[2]);
- strbuf_addf(&branch_name, "refs/heads/%s", argv[4]);
-
- /* Sanity check */
- if (get_oid("HEAD", &head))
- die(_("Cannot read HEAD"));
- assert(oideq(&onto->object.oid, &head));
-
- hold_locked_index(&lock, LOCK_DIE_ON_ERROR);
- if (repo_read_index(the_repository) < 0)
- BUG("Could not read index");
-
- repo_init_revisions(the_repository, &revs, NULL);
- revs.verbose_header = 1;
- revs.max_parents = 1;
- revs.cherry_mark = 1;
- revs.limited = 1;
- revs.reverse = 1;
- revs.right_only = 1;
- revs.sort_order = REV_SORT_IN_GRAPH_ORDER;
- revs.topo_order = 1;
- strvec_pushl(&rev_walk_args, "", argv[4], "--not", argv[3], NULL);
-
- if (setup_revisions(rev_walk_args.nr, rev_walk_args.v, &revs, NULL) > 1) {
- ret = error(_("unhandled options"));
- goto cleanup;
- }
-
- strvec_clear(&rev_walk_args);
-
- if (prepare_revision_walk(&revs) < 0) {
- ret = error(_("error preparing revisions"));
- goto cleanup;
- }
-
- init_merge_options(&merge_opt, the_repository);
- memset(&result, 0, sizeof(result));
- merge_opt.show_rename_progress = 1;
- merge_opt.branch1 = "HEAD";
- head_tree = get_commit_tree(onto);
- result.tree = head_tree;
- last_commit = onto;
- while ((commit = get_revision(&revs))) {
- struct commit *base;
-
- fprintf(stderr, "Rebasing %s...\r",
- oid_to_hex(&commit->object.oid));
- assert(commit->parents && !commit->parents->next);
- base = commit->parents->item;
-
- next_tree = get_commit_tree(commit);
- base_tree = get_commit_tree(base);
-
- merge_opt.branch2 = short_commit_name(commit);
- merge_opt.ancestor = xstrfmt("parent of %s", merge_opt.branch2);
-
- merge_incore_nonrecursive(&merge_opt,
- base_tree,
- result.tree,
- next_tree,
- &result);
-
- free((char*)merge_opt.ancestor);
- merge_opt.ancestor = NULL;
- if (!result.clean)
- break;
- last_picked_commit = commit;
- last_commit = create_commit(result.tree, commit, last_commit);
- }
- /* TODO: There should be some kind of rev_info_free(&revs) call... */
- memset(&revs, 0, sizeof(revs));
-
- merge_switch_to_result(&merge_opt, head_tree, &result, 1, !result.clean);
-
- if (result.clean < 0)
- exit(128);
-
- if (result.clean) {
- fprintf(stderr, "\nDone.\n");
- strbuf_addf(&reflog_msg, "finish rebase %s onto %s",
- oid_to_hex(&last_picked_commit->object.oid),
- oid_to_hex(&last_commit->object.oid));
- if (update_ref(reflog_msg.buf, branch_name.buf,
- &last_commit->object.oid,
- &last_picked_commit->object.oid,
- REF_NO_DEREF, UPDATE_REFS_MSG_ON_ERR)) {
- error(_("could not update %s"), argv[4]);
- die("Failed to update %s", argv[4]);
- }
- if (create_symref("HEAD", branch_name.buf, reflog_msg.buf) < 0)
- die(_("unable to update HEAD"));
-
- prime_cache_tree(the_repository, the_repository->index,
- result.tree);
- } else {
- fprintf(stderr, "\nAborting: Hit a conflict.\n");
- strbuf_addf(&reflog_msg, "rebase progress up to %s",
- oid_to_hex(&last_picked_commit->object.oid));
- if (update_ref(reflog_msg.buf, "HEAD",
- &last_commit->object.oid,
- &head,
- REF_NO_DEREF, UPDATE_REFS_MSG_ON_ERR)) {
- error(_("could not update %s"), argv[4]);
- die("Failed to update %s", argv[4]);
- }
- }
- if (write_locked_index(&the_index, &lock,
- COMMIT_LOCK | SKIP_IF_UNCHANGED))
- die(_("unable to write %s"), get_index_file());
-
- ret = (result.clean == 0);
-cleanup:
- strbuf_release(&reflog_msg);
- strbuf_release(&branch_name);
- release_revisions(&revs);
- return ret;
-}
diff --git a/t/helper/test-find-pack.c b/t/helper/test-find-pack.c
new file mode 100644
index 0000000..e8bd793
--- /dev/null
+++ b/t/helper/test-find-pack.c
@@ -0,0 +1,50 @@
+#include "test-tool.h"
+#include "object-name.h"
+#include "object-store.h"
+#include "packfile.h"
+#include "parse-options.h"
+#include "setup.h"
+
+/*
+ * Display the path(s), one per line, of the packfile(s) containing
+ * the given object.
+ *
+ * If '--check-count <n>' is passed, then error out if the number of
+ * packfiles containing the object is not <n>.
+ */
+
+static const char *find_pack_usage[] = {
+ "test-tool find-pack [--check-count <n>] <object>",
+ NULL
+};
+
+int cmd__find_pack(int argc, const char **argv)
+{
+ struct object_id oid;
+ struct packed_git *p;
+ int count = -1, actual_count = 0;
+ const char *prefix = setup_git_directory();
+
+ struct option options[] = {
+ OPT_INTEGER('c', "check-count", &count, "expected number of packs"),
+ OPT_END(),
+ };
+
+ argc = parse_options(argc, argv, prefix, options, find_pack_usage, 0);
+ if (argc != 1)
+ usage(find_pack_usage[0]);
+
+ if (repo_get_oid(the_repository, argv[0], &oid))
+ die("cannot parse %s as an object name", argv[0]);
+
+ for (p = get_all_packs(the_repository); p; p = p->next)
+ if (find_pack_entry_one(oid.hash, p)) {
+ printf("%s\n", p->pack_name);
+ actual_count++;
+ }
+
+ if (count > -1 && count != actual_count)
+ die("bad packfile count %d instead of %d", actual_count, count);
+
+ return 0;
+}
diff --git a/t/helper/test-fsmonitor-client.c b/t/helper/test-fsmonitor-client.c
index 54a4856..8280984 100644
--- a/t/helper/test-fsmonitor-client.c
+++ b/t/helper/test-fsmonitor-client.c
@@ -4,14 +4,16 @@
*/
#include "test-tool.h"
-#include "cache.h"
#include "parse-options.h"
#include "fsmonitor-ipc.h"
+#include "read-cache-ll.h"
+#include "repository.h"
+#include "setup.h"
#include "thread-utils.h"
#include "trace2.h"
#ifndef HAVE_FSMONITOR_DAEMON_BACKEND
-int cmd__fsmonitor_client(int argc, const char **argv)
+int cmd__fsmonitor_client(int argc UNUSED, const char **argv UNUSED)
{
die("fsmonitor--daemon not available on this platform");
}
diff --git a/t/helper/test-genzeros.c b/t/helper/test-genzeros.c
index 8ca988d..47af843 100644
--- a/t/helper/test-genzeros.c
+++ b/t/helper/test-genzeros.c
@@ -17,15 +17,16 @@ int cmd__genzeros(int argc, const char **argv)
/* Writing out individual NUL bytes is slow... */
while (count < 0)
- if (write(1, zeros, ARRAY_SIZE(zeros)) < 0)
- return -1;
+ if (xwrite(1, zeros, ARRAY_SIZE(zeros)) < 0)
+ die_errno("write error");
while (count > 0) {
- n = write(1, zeros, count < ARRAY_SIZE(zeros) ?
- count : ARRAY_SIZE(zeros));
+ n = xwrite(1, zeros,
+ count < ARRAY_SIZE(zeros)
+ ? count : ARRAY_SIZE(zeros));
if (n < 0)
- return -1;
+ die_errno("write error");
count -= n;
}
diff --git a/t/helper/test-hash-speed.c b/t/helper/test-hash-speed.c
index f40d9ad..b235da5 100644
--- a/t/helper/test-hash-speed.c
+++ b/t/helper/test-hash-speed.c
@@ -1,5 +1,5 @@
#include "test-tool.h"
-#include "cache.h"
+#include "hash-ll.h"
#define NUM_SECONDS 3
diff --git a/t/helper/test-hash.c b/t/helper/test-hash.c
index 261c545..45d829c 100644
--- a/t/helper/test-hash.c
+++ b/t/helper/test-hash.c
@@ -1,5 +1,5 @@
#include "test-tool.h"
-#include "cache.h"
+#include "hex.h"
int cmd_hash_impl(int ac, const char **av, int algo)
{
@@ -54,5 +54,6 @@ int cmd_hash_impl(int ac, const char **av, int algo)
fwrite(hash, 1, algop->rawsz, stdout);
else
puts(hash_to_hex_algop(hash, algop));
+ free(buffer);
return 0;
}
diff --git a/t/helper/test-hashmap.c b/t/helper/test-hashmap.c
index 36ff07b..0eb0b3d 100644
--- a/t/helper/test-hashmap.c
+++ b/t/helper/test-hashmap.c
@@ -2,6 +2,7 @@
#include "git-compat-util.h"
#include "hashmap.h"
#include "strbuf.h"
+#include "string-list.h"
struct test_entry
{
@@ -150,6 +151,7 @@ static void perf_hashmap(unsigned int method, unsigned int rounds)
*/
int cmd__hashmap(int argc, const char **argv)
{
+ struct string_list parts = STRING_LIST_INIT_NODUP;
struct strbuf line = STRBUF_INIT;
int icase;
struct hashmap map = HASHMAP_INIT(test_entry_cmp, &icase);
@@ -159,21 +161,26 @@ int cmd__hashmap(int argc, const char **argv)
/* process commands from stdin */
while (strbuf_getline(&line, stdin) != EOF) {
- char *cmd, *p1 = NULL, *p2 = NULL;
+ char *cmd, *p1, *p2;
unsigned int hash = 0;
struct test_entry *entry;
/* break line into command and up to two parameters */
- cmd = strtok(line.buf, DELIM);
+ string_list_setlen(&parts, 0);
+ string_list_split_in_place(&parts, line.buf, DELIM, 2);
+ string_list_remove_empty_items(&parts, 0);
+
/* ignore empty lines */
- if (!cmd || *cmd == '#')
+ if (!parts.nr)
+ continue;
+ if (!*parts.items[0].string || *parts.items[0].string == '#')
continue;
- p1 = strtok(NULL, DELIM);
- if (p1) {
+ cmd = parts.items[0].string;
+ p1 = parts.nr >= 1 ? parts.items[1].string : NULL;
+ p2 = parts.nr >= 2 ? parts.items[2].string : NULL;
+ if (p1)
hash = icase ? strihash(p1) : strhash(p1);
- p2 = strtok(NULL, DELIM);
- }
if (!strcmp("add", cmd) && p1 && p2) {
@@ -260,6 +267,7 @@ int cmd__hashmap(int argc, const char **argv)
}
}
+ string_list_clear(&parts, 0);
strbuf_release(&line);
hashmap_clear_and_free(&map, struct test_entry, ent);
return 0;
diff --git a/t/helper/test-hexdump.c b/t/helper/test-hexdump.c
index 811e89c..05f55ec 100644
--- a/t/helper/test-hexdump.c
+++ b/t/helper/test-hexdump.c
@@ -4,7 +4,7 @@
/*
* Read stdin and print a hexdump to stdout.
*/
-int cmd__hexdump(int argc, const char **argv)
+int cmd__hexdump(int argc UNUSED, const char **argv UNUSED)
{
char buf[1024];
ssize_t i, len;
diff --git a/t/helper/test-index-version.c b/t/helper/test-index-version.c
deleted file mode 100644
index fcd1096..0000000
--- a/t/helper/test-index-version.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include "test-tool.h"
-#include "cache.h"
-
-int cmd__index_version(int argc, const char **argv)
-{
- struct cache_header hdr;
- int version;
-
- memset(&hdr,0,sizeof(hdr));
- if (read(0, &hdr, sizeof(hdr)) != sizeof(hdr))
- return 0;
- version = ntohl(hdr.hdr_version);
- printf("%d\n", version);
- return 0;
-}
diff --git a/t/helper/test-json-writer.c b/t/helper/test-json-writer.c
index 37c4525..afe393f 100644
--- a/t/helper/test-json-writer.c
+++ b/t/helper/test-json-writer.c
@@ -1,6 +1,6 @@
#include "test-tool.h"
-#include "cache.h"
#include "json-writer.h"
+#include "string-list.h"
static const char *expect_obj1 = "{\"a\":\"abc\",\"b\":42,\"c\":true}";
static const char *expect_obj2 = "{\"a\":-1,\"b\":2147483647,\"c\":0}";
@@ -181,12 +181,18 @@ static struct json_writer nest1 = JSON_WRITER_INIT;
static void make_nest1(int pretty)
{
+ make_obj1(0);
+ make_arr1(0);
+
jw_object_begin(&nest1, pretty);
{
jw_object_sub_jw(&nest1, "obj1", &obj1);
jw_object_sub_jw(&nest1, "arr1", &arr1);
}
jw_end(&nest1);
+
+ jw_release(&obj1);
+ jw_release(&arr1);
}
static char *expect_inline1 =
@@ -313,6 +319,9 @@ static void make_mixed1(int pretty)
jw_object_sub_jw(&mixed1, "arr1", &arr1);
}
jw_end(&mixed1);
+
+ jw_release(&obj1);
+ jw_release(&arr1);
}
static void cmp(const char *test, const struct json_writer *jw, const char *exp)
@@ -325,8 +334,8 @@ static void cmp(const char *test, const struct json_writer *jw, const char *exp)
exit(1);
}
-#define t(v) do { make_##v(0); cmp(#v, &v, expect_##v); } while (0)
-#define p(v) do { make_##v(1); cmp(#v, &v, pretty_##v); } while (0)
+#define t(v) do { make_##v(0); cmp(#v, &v, expect_##v); jw_release(&v); } while (0)
+#define p(v) do { make_##v(1); cmp(#v, &v, pretty_##v); jw_release(&v); } while (0)
/*
* Run some basic regression tests with some known patterns.
@@ -381,41 +390,46 @@ static int unit_tests(void)
/* mixed forms */
t(mixed1);
- jw_init(&mixed1);
p(mixed1);
return 0;
}
-static void get_s(int line_nr, char **s_in)
+struct line {
+ struct string_list *parts;
+ size_t consumed_nr;
+ int nr;
+};
+
+static void get_s(struct line *line, char **s_in)
{
- *s_in = strtok(NULL, " ");
- if (!*s_in)
- die("line[%d]: expected: <s>", line_nr);
+ if (line->consumed_nr > line->parts->nr)
+ die("line[%d]: expected: <s>", line->nr);
+ *s_in = line->parts->items[line->consumed_nr++].string;
}
-static void get_i(int line_nr, intmax_t *s_in)
+static void get_i(struct line *line, intmax_t *s_in)
{
char *s;
char *endptr;
- get_s(line_nr, &s);
+ get_s(line, &s);
*s_in = strtol(s, &endptr, 10);
if (*endptr || errno == ERANGE)
- die("line[%d]: invalid integer value", line_nr);
+ die("line[%d]: invalid integer value", line->nr);
}
-static void get_d(int line_nr, double *s_in)
+static void get_d(struct line *line, double *s_in)
{
char *s;
char *endptr;
- get_s(line_nr, &s);
+ get_s(line, &s);
*s_in = strtod(s, &endptr);
if (*endptr || errno == ERANGE)
- die("line[%d]: invalid float value", line_nr);
+ die("line[%d]: invalid float value", line->nr);
}
static int pretty;
@@ -446,6 +460,7 @@ static char *get_trimmed_line(char *buf, int buf_size)
static int scripted(void)
{
+ struct string_list parts = STRING_LIST_INIT_NODUP;
struct json_writer jw = JSON_WRITER_INIT;
char buf[MAX_LINE_LENGTH];
char *line;
@@ -463,66 +478,77 @@ static int scripted(void)
die("expected first line to be 'object' or 'array'");
while ((line = get_trimmed_line(buf, MAX_LINE_LENGTH)) != NULL) {
+ struct line state = { 0 };
char *verb;
char *key;
char *s_value;
intmax_t i_value;
double d_value;
- line_nr++;
+ state.parts = &parts;
+ state.nr = ++line_nr;
+
+ /* break line into command and zero or more tokens */
+ string_list_setlen(&parts, 0);
+ string_list_split_in_place(&parts, line, " ", -1);
+ string_list_remove_empty_items(&parts, 0);
+
+ /* ignore empty lines */
+ if (!parts.nr || !*parts.items[0].string)
+ continue;
- verb = strtok(line, " ");
+ verb = parts.items[state.consumed_nr++].string;
if (!strcmp(verb, "end")) {
jw_end(&jw);
}
else if (!strcmp(verb, "object-string")) {
- get_s(line_nr, &key);
- get_s(line_nr, &s_value);
+ get_s(&state, &key);
+ get_s(&state, &s_value);
jw_object_string(&jw, key, s_value);
}
else if (!strcmp(verb, "object-int")) {
- get_s(line_nr, &key);
- get_i(line_nr, &i_value);
+ get_s(&state, &key);
+ get_i(&state, &i_value);
jw_object_intmax(&jw, key, i_value);
}
else if (!strcmp(verb, "object-double")) {
- get_s(line_nr, &key);
- get_i(line_nr, &i_value);
- get_d(line_nr, &d_value);
+ get_s(&state, &key);
+ get_i(&state, &i_value);
+ get_d(&state, &d_value);
jw_object_double(&jw, key, i_value, d_value);
}
else if (!strcmp(verb, "object-true")) {
- get_s(line_nr, &key);
+ get_s(&state, &key);
jw_object_true(&jw, key);
}
else if (!strcmp(verb, "object-false")) {
- get_s(line_nr, &key);
+ get_s(&state, &key);
jw_object_false(&jw, key);
}
else if (!strcmp(verb, "object-null")) {
- get_s(line_nr, &key);
+ get_s(&state, &key);
jw_object_null(&jw, key);
}
else if (!strcmp(verb, "object-object")) {
- get_s(line_nr, &key);
+ get_s(&state, &key);
jw_object_inline_begin_object(&jw, key);
}
else if (!strcmp(verb, "object-array")) {
- get_s(line_nr, &key);
+ get_s(&state, &key);
jw_object_inline_begin_array(&jw, key);
}
else if (!strcmp(verb, "array-string")) {
- get_s(line_nr, &s_value);
+ get_s(&state, &s_value);
jw_array_string(&jw, s_value);
}
else if (!strcmp(verb, "array-int")) {
- get_i(line_nr, &i_value);
+ get_i(&state, &i_value);
jw_array_intmax(&jw, i_value);
}
else if (!strcmp(verb, "array-double")) {
- get_i(line_nr, &i_value);
- get_d(line_nr, &d_value);
+ get_i(&state, &i_value);
+ get_d(&state, &d_value);
jw_array_double(&jw, i_value, d_value);
}
else if (!strcmp(verb, "array-true"))
@@ -544,7 +570,8 @@ static int scripted(void)
printf("%s\n", jw.json.buf);
- strbuf_release(&jw.json);
+ jw_release(&jw);
+ string_list_clear(&parts, 0);
return 0;
}
diff --git a/t/helper/test-lazy-init-name-hash.c b/t/helper/test-lazy-init-name-hash.c
index cd1b4c9..187a115 100644
--- a/t/helper/test-lazy-init-name-hash.c
+++ b/t/helper/test-lazy-init-name-hash.c
@@ -1,6 +1,12 @@
+#define USE_THE_INDEX_VARIABLE
#include "test-tool.h"
-#include "cache.h"
+#include "environment.h"
+#include "name-hash.h"
#include "parse-options.h"
+#include "read-cache-ll.h"
+#include "repository.h"
+#include "setup.h"
+#include "trace.h"
static int single;
static int multi;
@@ -32,7 +38,7 @@ static void dump_run(void)
struct dir_entry *dir;
struct cache_entry *ce;
- read_cache();
+ repo_read_index(the_repository);
if (single) {
test_lazy_init_name_hash(&the_index, 0);
} else {
@@ -49,7 +55,7 @@ static void dump_run(void)
ent /* member name */)
printf("name %08x %s\n", ce->ent.hash, ce->name);
- discard_cache();
+ discard_index(&the_index);
}
/*
@@ -66,7 +72,7 @@ static uint64_t time_runs(int try_threaded)
for (i = 0; i < count; i++) {
t0 = getnanotime();
- read_cache();
+ repo_read_index(the_repository);
t1 = getnanotime();
nr_threads_used = test_lazy_init_name_hash(&the_index, try_threaded);
t2 = getnanotime();
@@ -89,7 +95,7 @@ static uint64_t time_runs(int try_threaded)
the_index.cache_nr);
fflush(stdout);
- discard_cache();
+ discard_index(&the_index);
}
avg = sum / count;
@@ -113,9 +119,9 @@ static void analyze_run(void)
int i;
int nr;
- read_cache();
+ repo_read_index(the_repository);
cache_nr_limit = the_index.cache_nr;
- discard_cache();
+ discard_index(&the_index);
nr = analyze;
while (1) {
@@ -128,23 +134,23 @@ static void analyze_run(void)
nr = cache_nr_limit;
for (i = 0; i < count; i++) {
- read_cache();
+ repo_read_index(the_repository);
the_index.cache_nr = nr; /* cheap truncate of index */
t1s = getnanotime();
test_lazy_init_name_hash(&the_index, 0);
t2s = getnanotime();
sum_single += (t2s - t1s);
the_index.cache_nr = cache_nr_limit;
- discard_cache();
+ discard_index(&the_index);
- read_cache();
+ repo_read_index(the_repository);
the_index.cache_nr = nr; /* cheap truncate of index */
t1m = getnanotime();
nr_threads_used = test_lazy_init_name_hash(&the_index, 1);
t2m = getnanotime();
sum_multi += (t2m - t1m);
the_index.cache_nr = cache_nr_limit;
- discard_cache();
+ discard_index(&the_index);
if (!nr_threads_used)
printf(" [size %8d] [single %f] non-threaded code path used\n",
diff --git a/t/helper/test-match-trees.c b/t/helper/test-match-trees.c
index 4079fde..d0db5ff 100644
--- a/t/helper/test-match-trees.c
+++ b/t/helper/test-match-trees.c
@@ -1,17 +1,21 @@
#include "test-tool.h"
-#include "cache.h"
+#include "hex.h"
+#include "match-trees.h"
+#include "object-name.h"
+#include "repository.h"
+#include "setup.h"
#include "tree.h"
-int cmd__match_trees(int ac, const char **av)
+int cmd__match_trees(int ac UNUSED, const char **av)
{
struct object_id hash1, hash2, shifted;
struct tree *one, *two;
setup_git_directory();
- if (get_oid(av[1], &hash1))
+ if (repo_get_oid(the_repository, av[1], &hash1))
die("cannot parse %s as an object name", av[1]);
- if (get_oid(av[2], &hash2))
+ if (repo_get_oid(the_repository, av[2], &hash2))
die("cannot parse %s as an object name", av[2]);
one = parse_tree_indirect(&hash1);
if (!one)
diff --git a/t/helper/test-mergesort.c b/t/helper/test-mergesort.c
index ebf68f7..42ccc87 100644
--- a/t/helper/test-mergesort.c
+++ b/t/helper/test-mergesort.c
@@ -1,6 +1,7 @@
#include "test-tool.h"
-#include "cache.h"
+#include "mem-pool.h"
#include "mergesort.h"
+#include "strbuf.h"
static uint32_t minstd_rand(uint32_t *state)
{
@@ -13,41 +14,46 @@ struct line {
struct line *next;
};
-static void *get_next(const void *a)
-{
- return ((const struct line *)a)->next;
-}
+DEFINE_LIST_SORT(static, sort_lines, struct line, next);
-static void set_next(void *a, void *b)
+static int compare_strings(const struct line *x, const struct line *y)
{
- ((struct line *)a)->next = b;
-}
-
-static int compare_strings(const void *a, const void *b)
-{
- const struct line *x = a, *y = b;
return strcmp(x->text, y->text);
}
static int sort_stdin(void)
{
- struct line *line, *p = NULL, *lines = NULL;
+ struct line *lines;
+ struct line **tail = &lines;
struct strbuf sb = STRBUF_INIT;
-
- while (!strbuf_getline(&sb, stdin)) {
- line = xmalloc(sizeof(struct line));
- line->text = strbuf_detach(&sb, NULL);
- if (p) {
- line->next = p->next;
- p->next = line;
- } else {
- line->next = NULL;
- lines = line;
- }
- p = line;
+ struct mem_pool lines_pool;
+ char *p;
+
+ strbuf_read(&sb, 0, 0);
+
+ /*
+ * Split by newline, but don't create an item
+ * for the empty string after the last separator.
+ */
+ if (sb.len && sb.buf[sb.len - 1] == '\n')
+ strbuf_setlen(&sb, sb.len - 1);
+
+ mem_pool_init(&lines_pool, 0);
+ p = sb.buf;
+ for (;;) {
+ char *eol = strchr(p, '\n');
+ struct line *line = mem_pool_alloc(&lines_pool, sizeof(*line));
+ line->text = p;
+ *tail = line;
+ tail = &line->next;
+ if (!eol)
+ break;
+ *eol = '\0';
+ p = eol + 1;
}
+ *tail = NULL;
- lines = llist_mergesort(lines, get_next, set_next, compare_strings);
+ sort_lines(&lines, compare_strings);
while (lines) {
puts(lines->text);
@@ -273,21 +279,11 @@ struct number {
struct number *next;
};
-static void *get_next_number(const void *a)
-{
- stats.get_next++;
- return ((const struct number *)a)->next;
-}
-
-static void set_next_number(void *a, void *b)
-{
- stats.set_next++;
- ((struct number *)a)->next = b;
-}
+DEFINE_LIST_SORT_DEBUG(static, sort_numbers, struct number, next,
+ stats.get_next++, stats.set_next++);
-static int compare_numbers(const void *av, const void *bv)
+static int compare_numbers(const struct number *an, const struct number *bn)
{
- const struct number *an = av, *bn = bv;
int a = an->value, b = bn->value;
stats.compare++;
return (a > b) - (a < b);
@@ -325,8 +321,7 @@ static int test(const struct dist *dist, const struct mode *mode, int n, int m)
*tail = NULL;
stats.get_next = stats.set_next = stats.compare = 0;
- list = llist_mergesort(list, get_next_number, set_next_number,
- compare_numbers);
+ sort_numbers(&list, compare_numbers);
QSORT(arr, n, compare_ints);
for (i = 0, curr = list; i < n && curr; i++, curr = curr->next) {
diff --git a/t/helper/test-oid-array.c b/t/helper/test-oid-array.c
index d1324d0..aafe398 100644
--- a/t/helper/test-oid-array.c
+++ b/t/helper/test-oid-array.c
@@ -1,14 +1,16 @@
#include "test-tool.h"
-#include "cache.h"
+#include "hex.h"
#include "oid-array.h"
+#include "setup.h"
+#include "strbuf.h"
-static int print_oid(const struct object_id *oid, void *data)
+static int print_oid(const struct object_id *oid, void *data UNUSED)
{
puts(oid_to_hex(oid));
return 0;
}
-int cmd__oid_array(int argc, const char **argv)
+int cmd__oid_array(int argc UNUSED, const char **argv UNUSED)
{
struct oid_array array = OID_ARRAY_INIT;
struct strbuf line = STRBUF_INIT;
diff --git a/t/helper/test-oidmap.c b/t/helper/test-oidmap.c
index 0acf999..bd30244 100644
--- a/t/helper/test-oidmap.c
+++ b/t/helper/test-oidmap.c
@@ -1,7 +1,11 @@
#include "test-tool.h"
-#include "cache.h"
+#include "hex.h"
+#include "object-name.h"
#include "oidmap.h"
+#include "repository.h"
+#include "setup.h"
#include "strbuf.h"
+#include "string-list.h"
/* key is an oid and value is a name (could be a refname for example) */
struct test_entry {
@@ -21,8 +25,9 @@ struct test_entry {
* iterate -> oidkey1 namevalue1\noidkey2 namevalue2\n...
*
*/
-int cmd__oidmap(int argc, const char **argv)
+int cmd__oidmap(int argc UNUSED, const char **argv UNUSED)
{
+ struct string_list parts = STRING_LIST_INIT_NODUP;
struct strbuf line = STRBUF_INIT;
struct oidmap map = OIDMAP_INIT;
@@ -33,23 +38,28 @@ int cmd__oidmap(int argc, const char **argv)
/* process commands from stdin */
while (strbuf_getline(&line, stdin) != EOF) {
- char *cmd, *p1 = NULL, *p2 = NULL;
+ char *cmd, *p1, *p2;
struct test_entry *entry;
struct object_id oid;
/* break line into command and up to two parameters */
- cmd = strtok(line.buf, DELIM);
+ string_list_setlen(&parts, 0);
+ string_list_split_in_place(&parts, line.buf, DELIM, 2);
+ string_list_remove_empty_items(&parts, 0);
+
/* ignore empty lines */
- if (!cmd || *cmd == '#')
+ if (!parts.nr)
+ continue;
+ if (!*parts.items[0].string || *parts.items[0].string == '#')
continue;
- p1 = strtok(NULL, DELIM);
- if (p1)
- p2 = strtok(NULL, DELIM);
+ cmd = parts.items[0].string;
+ p1 = parts.nr >= 1 ? parts.items[1].string : NULL;
+ p2 = parts.nr >= 2 ? parts.items[2].string : NULL;
if (!strcmp("put", cmd) && p1 && p2) {
- if (get_oid(p1, &oid)) {
+ if (repo_get_oid(the_repository, p1, &oid)) {
printf("Unknown oid: %s\n", p1);
continue;
}
@@ -67,7 +77,7 @@ int cmd__oidmap(int argc, const char **argv)
} else if (!strcmp("get", cmd) && p1) {
- if (get_oid(p1, &oid)) {
+ if (repo_get_oid(the_repository, p1, &oid)) {
printf("Unknown oid: %s\n", p1);
continue;
}
@@ -80,7 +90,7 @@ int cmd__oidmap(int argc, const char **argv)
} else if (!strcmp("remove", cmd) && p1) {
- if (get_oid(p1, &oid)) {
+ if (repo_get_oid(the_repository, p1, &oid)) {
printf("Unknown oid: %s\n", p1);
continue;
}
@@ -106,6 +116,7 @@ int cmd__oidmap(int argc, const char **argv)
}
}
+ string_list_clear(&parts, 0);
strbuf_release(&line);
oidmap_free(&map, 1);
return 0;
diff --git a/t/helper/test-oidtree.c b/t/helper/test-oidtree.c
index d48a409..c7a1d4c 100644
--- a/t/helper/test-oidtree.c
+++ b/t/helper/test-oidtree.c
@@ -1,14 +1,16 @@
#include "test-tool.h"
-#include "cache.h"
+#include "hex.h"
#include "oidtree.h"
+#include "setup.h"
+#include "strbuf.h"
-static enum cb_next print_oid(const struct object_id *oid, void *data)
+static enum cb_next print_oid(const struct object_id *oid, void *data UNUSED)
{
puts(oid_to_hex(oid));
return CB_CONTINUE;
}
-int cmd__oidtree(int argc, const char **argv)
+int cmd__oidtree(int argc UNUSED, const char **argv UNUSED)
{
struct oidtree ot;
struct strbuf line = STRBUF_INIT;
diff --git a/t/helper/test-online-cpus.c b/t/helper/test-online-cpus.c
index 8cb0d53..47dc211 100644
--- a/t/helper/test-online-cpus.c
+++ b/t/helper/test-online-cpus.c
@@ -2,7 +2,7 @@
#include "git-compat-util.h"
#include "thread-utils.h"
-int cmd__online_cpus(int argc, const char **argv)
+int cmd__online_cpus(int argc UNUSED, const char **argv UNUSED)
{
printf("%d\n", online_cpus());
return 0;
diff --git a/t/helper/test-pack-mtimes.c b/t/helper/test-pack-mtimes.c
index f7b79da..67a964e 100644
--- a/t/helper/test-pack-mtimes.c
+++ b/t/helper/test-pack-mtimes.c
@@ -1,9 +1,10 @@
-#include "git-compat-util.h"
#include "test-tool.h"
+#include "hex.h"
#include "strbuf.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "packfile.h"
#include "pack-mtimes.h"
+#include "setup.h"
static void dump_mtimes(struct packed_git *p)
{
diff --git a/t/helper/test-parse-options.c b/t/helper/test-parse-options.c
index 48d3cf6..ded8116 100644
--- a/t/helper/test-parse-options.c
+++ b/t/helper/test-parse-options.c
@@ -1,6 +1,6 @@
#include "test-tool.h"
-#include "cache.h"
#include "parse-options.h"
+#include "strbuf.h"
#include "string-list.h"
#include "trace2.h"
@@ -21,6 +21,19 @@ static struct {
int unset;
} length_cb;
+static int mode34_callback(const struct option *opt, const char *arg, int unset)
+{
+ if (unset)
+ *(int *)opt->value = 0;
+ else if (!strcmp(arg, "3"))
+ *(int *)opt->value = 3;
+ else if (!strcmp(arg, "4"))
+ *(int *)opt->value = 4;
+ else
+ return error("invalid value for '%s': '%s'", "--mode34", arg);
+ return 0;
+}
+
static int length_callback(const struct option *opt, const char *arg, int unset)
{
length_cb.called = 1;
@@ -124,6 +137,9 @@ int cmd__parse_options(int argc, const char **argv)
OPT_SET_INT(0, "set23", &integer, "set integer to 23", 23),
OPT_CMDMODE(0, "mode1", &integer, "set integer to 1 (cmdmode option)", 1),
OPT_CMDMODE(0, "mode2", &integer, "set integer to 2 (cmdmode option)", 2),
+ OPT_CALLBACK_F(0, "mode34", &integer, "(3|4)",
+ "set integer to 3 or 4 (cmdmode option)",
+ PARSE_OPT_CMDMODE, mode34_callback),
OPT_CALLBACK('L', "length", &integer, "str",
"get length of <str>", length_callback),
OPT_FILENAME('F', "file", &file, "set file to <file>"),
@@ -133,6 +149,8 @@ int cmd__parse_options(int argc, const char **argv)
OPT_STRING(0, "st", &string, "st", "get another string (pervert ordering)"),
OPT_STRING('o', NULL, &string, "str", "get another string"),
OPT_NOOP_NOARG(0, "obsolete"),
+ OPT_SET_INT_F(0, "longhelp", &integer, "help text of this entry\n"
+ "spans multiple lines", 0, PARSE_OPT_NONEG),
OPT_STRING_LIST(0, "list", &list, "str", "add str to list"),
OPT_GROUP("Magic arguments"),
OPT_NUMBER_CALLBACK(&integer, "set integer to NUM",
@@ -192,3 +210,131 @@ int cmd__parse_options(int argc, const char **argv)
return ret;
}
+
+static void print_args(int argc, const char **argv)
+{
+ int i;
+ for (i = 0; i < argc; i++)
+ printf("arg %02d: %s\n", i, argv[i]);
+}
+
+static int parse_options_flags__cmd(int argc, const char **argv,
+ enum parse_opt_flags test_flags)
+{
+ const char *usage[] = {
+ "<...> cmd [options]",
+ NULL
+ };
+ int opt = 0;
+ const struct option options[] = {
+ OPT_INTEGER('o', "opt", &opt, "an integer option"),
+ OPT_END()
+ };
+
+ argc = parse_options(argc, argv, NULL, options, usage, test_flags);
+
+ printf("opt: %d\n", opt);
+ print_args(argc, argv);
+
+ return 0;
+}
+
+static enum parse_opt_flags test_flags = 0;
+static const struct option test_flag_options[] = {
+ OPT_GROUP("flag-options:"),
+ OPT_BIT(0, "keep-dashdash", &test_flags,
+ "pass PARSE_OPT_KEEP_DASHDASH to parse_options()",
+ PARSE_OPT_KEEP_DASHDASH),
+ OPT_BIT(0, "stop-at-non-option", &test_flags,
+ "pass PARSE_OPT_STOP_AT_NON_OPTION to parse_options()",
+ PARSE_OPT_STOP_AT_NON_OPTION),
+ OPT_BIT(0, "keep-argv0", &test_flags,
+ "pass PARSE_OPT_KEEP_ARGV0 to parse_options()",
+ PARSE_OPT_KEEP_ARGV0),
+ OPT_BIT(0, "keep-unknown-opt", &test_flags,
+ "pass PARSE_OPT_KEEP_UNKNOWN_OPT to parse_options()",
+ PARSE_OPT_KEEP_UNKNOWN_OPT),
+ OPT_BIT(0, "no-internal-help", &test_flags,
+ "pass PARSE_OPT_NO_INTERNAL_HELP to parse_options()",
+ PARSE_OPT_NO_INTERNAL_HELP),
+ OPT_BIT(0, "subcommand-optional", &test_flags,
+ "pass PARSE_OPT_SUBCOMMAND_OPTIONAL to parse_options()",
+ PARSE_OPT_SUBCOMMAND_OPTIONAL),
+ OPT_END()
+};
+
+int cmd__parse_options_flags(int argc, const char **argv)
+{
+ const char *usage[] = {
+ "test-tool parse-options-flags [flag-options] cmd [options]",
+ NULL
+ };
+
+ argc = parse_options(argc, argv, NULL, test_flag_options, usage,
+ PARSE_OPT_STOP_AT_NON_OPTION);
+
+ if (!argc || strcmp(argv[0], "cmd")) {
+ error("'cmd' is mandatory");
+ usage_with_options(usage, test_flag_options);
+ }
+
+ return parse_options_flags__cmd(argc, argv, test_flags);
+}
+
+static int subcmd_one(int argc, const char **argv, const char *prefix UNUSED)
+{
+ printf("fn: subcmd_one\n");
+ print_args(argc, argv);
+ return 0;
+}
+
+static int subcmd_two(int argc, const char **argv, const char *prefix UNUSED)
+{
+ printf("fn: subcmd_two\n");
+ print_args(argc, argv);
+ return 0;
+}
+
+static int parse_subcommand__cmd(int argc, const char **argv,
+ enum parse_opt_flags test_flags)
+{
+ const char *usage[] = {
+ "<...> cmd subcmd-one",
+ "<...> cmd subcmd-two",
+ NULL
+ };
+ parse_opt_subcommand_fn *fn = NULL;
+ int opt = 0;
+ struct option options[] = {
+ OPT_SUBCOMMAND("subcmd-one", &fn, subcmd_one),
+ OPT_SUBCOMMAND("subcmd-two", &fn, subcmd_two),
+ OPT_INTEGER('o', "opt", &opt, "an integer option"),
+ OPT_END()
+ };
+
+ if (test_flags & PARSE_OPT_SUBCOMMAND_OPTIONAL)
+ fn = subcmd_one;
+ argc = parse_options(argc, argv, NULL, options, usage, test_flags);
+
+ printf("opt: %d\n", opt);
+
+ return fn(argc, argv, NULL);
+}
+
+int cmd__parse_subcommand(int argc, const char **argv)
+{
+ const char *usage[] = {
+ "test-tool parse-subcommand [flag-options] cmd <subcommand>",
+ NULL
+ };
+
+ argc = parse_options(argc, argv, NULL, test_flag_options, usage,
+ PARSE_OPT_STOP_AT_NON_OPTION);
+
+ if (!argc || strcmp(argv[0], "cmd")) {
+ error("'cmd' is mandatory");
+ usage_with_options(usage, test_flag_options);
+ }
+
+ return parse_subcommand__cmd(argc, argv, test_flags);
+}
diff --git a/t/helper/test-parse-pathspec-file.c b/t/helper/test-parse-pathspec-file.c
index b3e08ce..89ecefd 100644
--- a/t/helper/test-parse-pathspec-file.c
+++ b/t/helper/test-parse-pathspec-file.c
@@ -1,12 +1,11 @@
#include "test-tool.h"
#include "parse-options.h"
#include "pathspec.h"
-#include "gettext.h"
int cmd__parse_pathspec_file(int argc, const char **argv)
{
struct pathspec pathspec;
- const char *pathspec_from_file = NULL;
+ char *pathspec_from_file = NULL;
int pathspec_file_nul = 0, i;
static const char *const usage[] = {
@@ -29,5 +28,6 @@ int cmd__parse_pathspec_file(int argc, const char **argv)
printf("%s\n", pathspec.items[i].original);
clear_pathspec(&pathspec);
+ free(pathspec_from_file);
return 0;
}
diff --git a/t/helper/test-partial-clone.c b/t/helper/test-partial-clone.c
index 3f102cf..910a128 100644
--- a/t/helper/test-partial-clone.c
+++ b/t/helper/test-partial-clone.c
@@ -1,7 +1,8 @@
-#include "cache.h"
#include "test-tool.h"
+#include "hex.h"
#include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
+#include "setup.h"
/*
* Prints the size of the object corresponding to the given hash in a specific
diff --git a/t/helper/test-path-utils.c b/t/helper/test-path-utils.c
index 229ed41..70396fa 100644
--- a/t/helper/test-path-utils.c
+++ b/t/helper/test-path-utils.c
@@ -1,6 +1,11 @@
#include "test-tool.h"
-#include "cache.h"
+#include "abspath.h"
+#include "environment.h"
+#include "path.h"
+#include "read-cache-ll.h"
+#include "setup.h"
#include "string-list.h"
+#include "trace.h"
#include "utf8.h"
/*
@@ -8,7 +13,8 @@
* GIT_CEILING_DIRECTORIES. If the path is unusable for some reason,
* die with an explanation.
*/
-static int normalize_ceiling_entry(struct string_list_item *item, void *unused)
+static int normalize_ceiling_entry(struct string_list_item *item,
+ void *data UNUSED)
{
char *ceil = item->string;
@@ -296,9 +302,8 @@ int cmd__path_utils(int argc, const char **argv)
if (argc == 3 && !strcmp(argv[1], "normalize_path_copy")) {
char *buf = xmallocz(strlen(argv[2]));
int rv = normalize_path_copy(buf, argv[2]);
- if (rv)
- buf = "++failed++";
- puts(buf);
+ puts(rv ? "++failed++" : buf);
+ free(buf);
return 0;
}
@@ -356,7 +361,10 @@ int cmd__path_utils(int argc, const char **argv)
int nongit_ok;
setup_git_directory_gently(&nongit_ok);
while (argc > 3) {
- puts(prefix_path(prefix, prefix_len, argv[3]));
+ char *pfx = prefix_path(prefix, prefix_len, argv[3]);
+
+ puts(pfx);
+ free(pfx);
argc--;
argv++;
}
@@ -366,6 +374,7 @@ int cmd__path_utils(int argc, const char **argv)
if (argc == 4 && !strcmp(argv[1], "strip_path_suffix")) {
char *prefix = strip_path_suffix(argv[2], argv[3]);
printf("%s\n", prefix ? prefix : "(null)");
+ free(prefix);
return 0;
}
diff --git a/t/helper/test-pcre2-config.c b/t/helper/test-pcre2-config.c
index 5258fdd..5d0b2a2 100644
--- a/t/helper/test-pcre2-config.c
+++ b/t/helper/test-pcre2-config.c
@@ -1,5 +1,4 @@
#include "test-tool.h"
-#include "cache.h"
#include "grep.h"
int cmd__pcre2_config(int argc, const char **argv)
diff --git a/t/helper/test-pkt-line.c b/t/helper/test-pkt-line.c
index c5e052e..4daa82f 100644
--- a/t/helper/test-pkt-line.c
+++ b/t/helper/test-pkt-line.c
@@ -1,6 +1,9 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "test-tool.h"
#include "pkt-line.h"
+#include "sideband.h"
+#include "write-or-die.h"
+#include "parse-options.h"
static void pack_line(const char *line)
{
@@ -63,12 +66,33 @@ static void unpack(void)
}
}
-static void unpack_sideband(void)
+static void unpack_sideband(int argc, const char **argv)
{
struct packet_reader reader;
- packet_reader_init(&reader, 0, NULL, 0,
- PACKET_READ_GENTLE_ON_EOF |
- PACKET_READ_CHOMP_NEWLINE);
+ int options = PACKET_READ_GENTLE_ON_EOF;
+ int chomp_newline = 1;
+ int reader_use_sideband = 0;
+ const char *const unpack_sideband_usage[] = {
+ "test_tool unpack_sideband [options...]", NULL
+ };
+ struct option cmd_options[] = {
+ OPT_BOOL(0, "reader-use-sideband", &reader_use_sideband,
+ "set use_sideband bit for packet reader (Default: off)"),
+ OPT_BOOL(0, "chomp-newline", &chomp_newline,
+ "chomp newline in packet (Default: on)"),
+ OPT_END()
+ };
+
+ argc = parse_options(argc, argv, "", cmd_options, unpack_sideband_usage,
+ 0);
+ if (argc > 0)
+ usage_msg_opt(_("too many arguments"), unpack_sideband_usage,
+ cmd_options);
+
+ if (chomp_newline)
+ options |= PACKET_READ_CHOMP_NEWLINE;
+ packet_reader_init(&reader, 0, NULL, 0, options);
+ reader.use_sideband = reader_use_sideband;
while (packet_reader_read(&reader) != PACKET_READ_EOF) {
int band;
@@ -78,6 +102,17 @@ static void unpack_sideband(void)
case PACKET_READ_EOF:
break;
case PACKET_READ_NORMAL:
+ /*
+ * When the "use_sideband" field of the reader is turned
+ * on, sideband packets other than the payload have been
+ * parsed and consumed in packet_reader_read(), and only
+ * the payload arrives here.
+ */
+ if (reader.use_sideband) {
+ write_or_die(1, reader.line, reader.pktlen - 1);
+ break;
+ }
+
band = reader.line[0] & 0xff;
if (band < 1 || band > 2)
continue; /* skip non-sideband packets */
@@ -96,15 +131,31 @@ static void unpack_sideband(void)
static int send_split_sideband(void)
{
+ const char *foo = "Foo.\n";
+ const char *bar = "Bar.\n";
const char *part1 = "Hello,";
const char *primary = "\001primary: regular output\n";
const char *part2 = " world!\n";
+ /* Each sideband message has a trailing newline character. */
+ send_sideband(1, 2, foo, strlen(foo), LARGE_PACKET_MAX);
+ send_sideband(1, 2, bar, strlen(bar), LARGE_PACKET_MAX);
+
+ /*
+ * One sideband message is divided into part1 and part2
+ * by the primary message.
+ */
send_sideband(1, 2, part1, strlen(part1), LARGE_PACKET_MAX);
packet_write(1, primary, strlen(primary));
send_sideband(1, 2, part2, strlen(part2), LARGE_PACKET_MAX);
packet_response_end(1);
+ /*
+ * We use unpack_sideband() to consume packets. A flush packet
+ * is required to end parsing.
+ */
+ packet_flush(1);
+
return 0;
}
@@ -125,7 +176,7 @@ int cmd__pkt_line(int argc, const char **argv)
else if (!strcmp(argv[1], "unpack"))
unpack();
else if (!strcmp(argv[1], "unpack-sideband"))
- unpack_sideband();
+ unpack_sideband(argc - 1, argv + 1);
else if (!strcmp(argv[1], "send-split-sideband"))
send_split_sideband();
else if (!strcmp(argv[1], "receive-sideband"))
diff --git a/t/helper/test-prio-queue.c b/t/helper/test-prio-queue.c
deleted file mode 100644
index 133b5e6..0000000
--- a/t/helper/test-prio-queue.c
+++ /dev/null
@@ -1,52 +0,0 @@
-#include "test-tool.h"
-#include "cache.h"
-#include "prio-queue.h"
-
-static int intcmp(const void *va, const void *vb, void *data)
-{
- const int *a = va, *b = vb;
- return *a - *b;
-}
-
-static void show(int *v)
-{
- if (!v)
- printf("NULL\n");
- else
- printf("%d\n", *v);
- free(v);
-}
-
-int cmd__prio_queue(int argc, const char **argv)
-{
- struct prio_queue pq = { intcmp };
-
- while (*++argv) {
- if (!strcmp(*argv, "get")) {
- void *peek = prio_queue_peek(&pq);
- void *get = prio_queue_get(&pq);
- if (peek != get)
- BUG("peek and get results do not match");
- show(get);
- } else if (!strcmp(*argv, "dump")) {
- void *peek;
- void *get;
- while ((peek = prio_queue_peek(&pq))) {
- get = prio_queue_get(&pq);
- if (peek != get)
- BUG("peek and get results do not match");
- show(get);
- }
- } else if (!strcmp(*argv, "stack")) {
- pq.compare = NULL;
- } else {
- int *v = xmalloc(sizeof(*v));
- *v = atoi(*argv);
- prio_queue_put(&pq, v);
- }
- }
-
- clear_prio_queue(&pq);
-
- return 0;
-}
diff --git a/t/helper/test-proc-receive.c b/t/helper/test-proc-receive.c
index cc08506..f30022d 100644
--- a/t/helper/test-proc-receive.c
+++ b/t/helper/test-proc-receive.c
@@ -1,12 +1,13 @@
-#include "cache.h"
+#include "test-tool.h"
#include "connect.h"
+#include "hex.h"
#include "parse-options.h"
#include "pkt-line.h"
+#include "setup.h"
#include "sigchain.h"
-#include "test-tool.h"
static const char *proc_receive_usage[] = {
- "test-tool proc-receive [<options>...]",
+ "test-tool proc-receive [<options>]",
NULL
};
diff --git a/t/helper/test-progress.c b/t/helper/test-progress.c
index 6cc9735..66acb6a 100644
--- a/t/helper/test-progress.c
+++ b/t/helper/test-progress.c
@@ -19,7 +19,6 @@
*/
#define GIT_TEST_PROGRESS_ONLY
#include "test-tool.h"
-#include "gettext.h"
#include "parse-options.h"
#include "progress.h"
#include "strbuf.h"
diff --git a/t/helper/test-reach.c b/t/helper/test-reach.c
index 2f65c7f..1e3b431 100644
--- a/t/helper/test-reach.c
+++ b/t/helper/test-reach.c
@@ -1,10 +1,11 @@
#include "test-tool.h"
-#include "cache.h"
#include "commit.h"
#include "commit-reach.h"
-#include "config.h"
-#include "parse-options.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-name.h"
#include "ref-filter.h"
+#include "setup.h"
#include "string-list.h"
#include "tag.h"
@@ -57,7 +58,7 @@ int cmd__reach(int ac, const char **av)
if (buf.len < 3)
continue;
- if (get_oid_committish(buf.buf + 2, &oid))
+ if (repo_get_oid_committish(the_repository, buf.buf + 2, &oid))
die("failed to resolve %s", buf.buf + 2);
orig = parse_object(r, &oid);
@@ -106,13 +107,20 @@ int cmd__reach(int ac, const char **av)
if (!strcmp(av[1], "ref_newer"))
printf("%s(A,B):%d\n", av[1], ref_newer(&oid_A, &oid_B));
else if (!strcmp(av[1], "in_merge_bases"))
- printf("%s(A,B):%d\n", av[1], in_merge_bases(A, B));
+ printf("%s(A,B):%d\n", av[1],
+ repo_in_merge_bases(the_repository, A, B));
else if (!strcmp(av[1], "in_merge_bases_many"))
- printf("%s(A,X):%d\n", av[1], in_merge_bases_many(A, X_nr, X_array));
+ printf("%s(A,X):%d\n", av[1],
+ repo_in_merge_bases_many(the_repository, A, X_nr, X_array, 0));
else if (!strcmp(av[1], "is_descendant_of"))
printf("%s(A,X):%d\n", av[1], repo_is_descendant_of(r, A, X));
else if (!strcmp(av[1], "get_merge_bases_many")) {
- struct commit_list *list = get_merge_bases_many(A, X_nr, X_array);
+ struct commit_list *list = NULL;
+ if (repo_get_merge_bases_many(the_repository,
+ A, X_nr,
+ X_array,
+ &list) < 0)
+ exit(128);
printf("%s(A,X):\n", av[1]);
print_sorted_commit_ids(list);
} else if (!strcmp(av[1], "reduce_heads")) {
@@ -131,7 +139,7 @@ int cmd__reach(int ac, const char **av)
printf("%s(X,_,_,0,0):%d\n", av[1], can_all_from_reach_with_flag(&X_obj, 2, 4, 0, 0));
} else if (!strcmp(av[1], "commit_contains")) {
- struct ref_filter filter;
+ struct ref_filter filter = REF_FILTER_INIT;
struct contains_cache cache;
init_contains_cache(&cache);
diff --git a/t/helper/test-read-cache.c b/t/helper/test-read-cache.c
index b736ef1..1acd362 100644
--- a/t/helper/test-read-cache.c
+++ b/t/helper/test-read-cache.c
@@ -1,6 +1,9 @@
+#define USE_THE_INDEX_VARIABLE
#include "test-tool.h"
-#include "cache.h"
#include "config.h"
+#include "read-cache-ll.h"
+#include "repository.h"
+#include "setup.h"
int cmd__read_cache(int argc, const char **argv)
{
@@ -20,7 +23,7 @@ int cmd__read_cache(int argc, const char **argv)
git_config(git_default_config, NULL);
for (i = 0; i < cnt; i++) {
- read_cache();
+ repo_read_index(the_repository);
if (name) {
int pos;
@@ -33,7 +36,7 @@ int cmd__read_cache(int argc, const char **argv)
ce_uptodate(the_index.cache[pos]) ? "" : " not");
write_file(name, "%d\n", i);
}
- discard_cache();
+ discard_index(&the_index);
}
return 0;
}
diff --git a/t/helper/test-read-graph.c b/t/helper/test-read-graph.c
index 98b73bb..8c7a83f 100644
--- a/t/helper/test-read-graph.c
+++ b/t/helper/test-read-graph.c
@@ -1,11 +1,11 @@
#include "test-tool.h"
-#include "cache.h"
#include "commit-graph.h"
#include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "bloom.h"
+#include "setup.h"
-int cmd__read_graph(int argc, const char **argv)
+int cmd__read_graph(int argc UNUSED, const char **argv UNUSED)
{
struct commit_graph *graph = NULL;
struct object_directory *odb;
diff --git a/t/helper/test-read-midx.c b/t/helper/test-read-midx.c
index 27072ba..4acae41 100644
--- a/t/helper/test-read-midx.c
+++ b/t/helper/test-read-midx.c
@@ -1,9 +1,12 @@
#include "test-tool.h"
-#include "cache.h"
+#include "hex.h"
#include "midx.h"
#include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "pack-bitmap.h"
+#include "packfile.h"
+#include "setup.h"
+#include "gettext.h"
static int read_midx_file(const char *object_dir, int show_objects)
{
@@ -77,7 +80,7 @@ static int read_midx_checksum(const char *object_dir)
static int read_midx_preferred_pack(const char *object_dir)
{
struct multi_pack_index *midx = NULL;
- struct bitmap_index *bitmap = NULL;
+ uint32_t preferred_pack;
setup_git_directory();
@@ -85,23 +88,45 @@ static int read_midx_preferred_pack(const char *object_dir)
if (!midx)
return 1;
- bitmap = prepare_bitmap_git(the_repository);
- if (!bitmap)
+ if (midx_preferred_pack(midx, &preferred_pack) < 0) {
+ warning(_("could not determine MIDX preferred pack"));
return 1;
- if (!bitmap_is_midx(bitmap)) {
- free_bitmap_index(bitmap);
+ }
+
+ printf("%s\n", midx->pack_names[preferred_pack]);
+ return 0;
+}
+
+static int read_midx_bitmapped_packs(const char *object_dir)
+{
+ struct multi_pack_index *midx = NULL;
+ struct bitmapped_pack pack;
+ uint32_t i;
+
+ setup_git_directory();
+
+ midx = load_multi_pack_index(object_dir, 1);
+ if (!midx)
return 1;
+
+ for (i = 0; i < midx->num_packs; i++) {
+ if (nth_bitmapped_pack(the_repository, midx, &pack, i) < 0)
+ return 1;
+
+ printf("%s\n", pack_basename(pack.p));
+ printf(" bitmap_pos: %"PRIuMAX"\n", (uintmax_t)pack.bitmap_pos);
+ printf(" bitmap_nr: %"PRIuMAX"\n", (uintmax_t)pack.bitmap_nr);
}
- printf("%s\n", midx->pack_names[midx_preferred_pack(bitmap)]);
- free_bitmap_index(bitmap);
+ close_midx(midx);
+
return 0;
}
int cmd__read_midx(int argc, const char **argv)
{
if (!(argc == 2 || argc == 3))
- usage("read-midx [--show-objects|--checksum|--preferred-pack] <object-dir>");
+ usage("read-midx [--show-objects|--checksum|--preferred-pack|--bitmap] <object-dir>");
if (!strcmp(argv[1], "--show-objects"))
return read_midx_file(argv[2], 1);
@@ -109,5 +134,7 @@ int cmd__read_midx(int argc, const char **argv)
return read_midx_checksum(argv[2]);
else if (!strcmp(argv[1], "--preferred-pack"))
return read_midx_preferred_pack(argv[2]);
+ else if (!strcmp(argv[1], "--bitmap"))
+ return read_midx_bitmapped_packs(argv[2]);
return read_midx_file(argv[1], 0);
}
diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c
index 9646d85..82bbf6e 100644
--- a/t/helper/test-ref-store.c
+++ b/t/helper/test-ref-store.c
@@ -1,9 +1,13 @@
#include "test-tool.h"
-#include "cache.h"
+#include "hex.h"
#include "refs.h"
+#include "setup.h"
#include "worktree.h"
-#include "object-store.h"
+#include "object-store-ll.h"
+#include "path.h"
#include "repository.h"
+#include "strbuf.h"
+#include "revision.h"
struct flag_definition {
const char *name;
@@ -96,6 +100,7 @@ static const char **get_store(const char **argv, struct ref_store **refs)
die("no such worktree: %s", gitdir);
*refs = get_worktree_ref_store(*p);
+ free_worktrees(worktrees);
} else
die("unknown backend %s", argv[0]);
@@ -107,17 +112,6 @@ static const char **get_store(const char **argv, struct ref_store **refs)
return argv + 1;
}
-static struct flag_definition pack_flags[] = { FLAG_DEF(PACK_REFS_PRUNE),
- FLAG_DEF(PACK_REFS_ALL),
- { NULL, 0 } };
-
-static int cmd_pack_refs(struct ref_store *refs, const char **argv)
-{
- unsigned int flags = arg_flags(*argv++, "flags", pack_flags);
-
- return refs_pack_refs(refs, flags);
-}
-
static int cmd_create_symref(struct ref_store *refs, const char **argv)
{
const char *refname = notnull(*argv++, "refname");
@@ -160,7 +154,7 @@ static int cmd_rename_ref(struct ref_store *refs, const char **argv)
}
static int each_ref(const char *refname, const struct object_id *oid,
- int flags, void *cb_data)
+ int flags, void *cb_data UNUSED)
{
printf("%s %s 0x%x\n", oid_to_hex(oid), refname, flags);
return 0;
@@ -173,6 +167,15 @@ static int cmd_for_each_ref(struct ref_store *refs, const char **argv)
return refs_for_each_ref_in(refs, prefix, each_ref, NULL);
}
+static int cmd_for_each_ref__exclude(struct ref_store *refs, const char **argv)
+{
+ const char *prefix = notnull(*argv++, "prefix");
+ const char **exclude_patterns = argv;
+
+ return refs_for_each_fullref_in(refs, prefix, exclude_patterns, each_ref,
+ NULL);
+}
+
static int cmd_resolve_ref(struct ref_store *refs, const char **argv)
{
struct object_id oid = *null_oid();
@@ -199,14 +202,21 @@ static int cmd_verify_ref(struct ref_store *refs, const char **argv)
return ret;
}
-static int cmd_for_each_reflog(struct ref_store *refs, const char **argv)
+static int each_reflog(const char *refname, void *cb_data UNUSED)
{
- return refs_for_each_reflog(refs, each_ref, NULL);
+ printf("%s\n", refname);
+ return 0;
}
-static int each_reflog(struct object_id *old_oid, struct object_id *new_oid,
- const char *committer, timestamp_t timestamp,
- int tz, const char *msg, void *cb_data)
+static int cmd_for_each_reflog(struct ref_store *refs,
+ const char **argv UNUSED)
+{
+ return refs_for_each_reflog(refs, each_reflog, NULL);
+}
+
+static int each_reflog_ent(struct object_id *old_oid, struct object_id *new_oid,
+ const char *committer, timestamp_t timestamp,
+ int tz, const char *msg, void *cb_data UNUSED)
{
printf("%s %s %s %" PRItime " %+05d%s%s", oid_to_hex(old_oid),
oid_to_hex(new_oid), committer, timestamp, tz,
@@ -218,14 +228,14 @@ static int cmd_for_each_reflog_ent(struct ref_store *refs, const char **argv)
{
const char *refname = notnull(*argv++, "refname");
- return refs_for_each_reflog_ent(refs, refname, each_reflog, refs);
+ return refs_for_each_reflog_ent(refs, refname, each_reflog_ent, refs);
}
static int cmd_for_each_reflog_ent_reverse(struct ref_store *refs, const char **argv)
{
const char *refname = notnull(*argv++, "refname");
- return refs_for_each_reflog_ent_reverse(refs, refname, each_reflog, refs);
+ return refs_for_each_reflog_ent_reverse(refs, refname, each_reflog_ent, refs);
}
static int cmd_reflog_exists(struct ref_store *refs, const char **argv)
@@ -254,11 +264,6 @@ static int cmd_delete_reflog(struct ref_store *refs, const char **argv)
return refs_delete_reflog(refs, refname);
}
-static int cmd_reflog_expire(struct ref_store *refs, const char **argv)
-{
- die("not supported yet");
-}
-
static int cmd_delete_ref(struct ref_store *refs, const char **argv)
{
const char *msg = notnull(*argv++, "msg");
@@ -280,16 +285,19 @@ static int cmd_update_ref(struct ref_store *refs, const char **argv)
const char *new_sha1_buf = notnull(*argv++, "new-sha1");
const char *old_sha1_buf = notnull(*argv++, "old-sha1");
unsigned int flags = arg_flags(*argv++, "flags", transaction_flags);
- struct object_id old_oid;
+ struct object_id old_oid, *old_oid_ptr = NULL;
struct object_id new_oid;
- if (get_oid_hex(old_sha1_buf, &old_oid))
- die("cannot parse %s as %s", old_sha1_buf, the_hash_algo->name);
+ if (*old_sha1_buf) {
+ if (get_oid_hex(old_sha1_buf, &old_oid))
+ die("cannot parse %s as %s", old_sha1_buf, the_hash_algo->name);
+ old_oid_ptr = &old_oid;
+ }
if (get_oid_hex(new_sha1_buf, &new_oid))
die("cannot parse %s as %s", new_sha1_buf, the_hash_algo->name);
return refs_update_ref(refs, msg, refname,
- &new_oid, &old_oid,
+ &new_oid, old_oid_ptr,
flags, UPDATE_REFS_DIE_ON_ERR);
}
@@ -299,11 +307,11 @@ struct command {
};
static struct command commands[] = {
- { "pack-refs", cmd_pack_refs },
{ "create-symref", cmd_create_symref },
{ "delete-refs", cmd_delete_refs },
{ "rename-ref", cmd_rename_ref },
{ "for-each-ref", cmd_for_each_ref },
+ { "for-each-ref--exclude", cmd_for_each_ref__exclude },
{ "resolve-ref", cmd_resolve_ref },
{ "verify-ref", cmd_verify_ref },
{ "for-each-reflog", cmd_for_each_reflog },
@@ -312,7 +320,6 @@ static struct command commands[] = {
{ "reflog-exists", cmd_reflog_exists },
{ "create-reflog", cmd_create_reflog },
{ "delete-reflog", cmd_delete_reflog },
- { "reflog-expire", cmd_reflog_expire },
/*
* backend transaction functions can't be tested separately
*/
@@ -321,7 +328,7 @@ static struct command commands[] = {
{ NULL, NULL }
};
-int cmd__ref_store(int argc, const char **argv)
+int cmd__ref_store(int argc UNUSED, const char **argv)
{
struct ref_store *refs;
const char *func;
diff --git a/t/helper/test-reftable.c b/t/helper/test-reftable.c
index 1f0a28c..00237ef 100644
--- a/t/helper/test-reftable.c
+++ b/t/helper/test-reftable.c
@@ -1,3 +1,4 @@
+#include "reftable/system.h"
#include "reftable/reftable-tests.h"
#include "test-tool.h"
diff --git a/t/helper/test-regex.c b/t/helper/test-regex.c
index d6f28ca..80042ea 100644
--- a/t/helper/test-regex.c
+++ b/t/helper/test-regex.c
@@ -30,10 +30,11 @@ static int test_regex_bug(void)
if (regexec(&r, str, 1, m, 0))
die("no match of pattern '%s' to string '%s'", pat, str);
- /* http://sourceware.org/bugzilla/show_bug.cgi?id=3957 */
+ /* https://sourceware.org/bugzilla/show_bug.cgi?id=3957 */
if (m[0].rm_so == 3) /* matches '\n' when it should not */
die("regex bug confirmed: re-build git with NO_REGEX=1");
+ regfree(&r);
return 0;
}
@@ -94,18 +95,20 @@ int cmd__regex(int argc, const char **argv)
die("failed regcomp() for pattern '%s' (%s)", pat, errbuf);
}
if (!str)
- return 0;
+ goto cleanup;
ret = regexec(&r, str, 1, m, 0);
if (ret) {
if (silent || ret == REG_NOMATCH)
- return ret;
+ goto cleanup;
regerror(ret, &r, errbuf, sizeof(errbuf));
die("failed regexec() for subject '%s' (%s)", str, errbuf);
}
- return 0;
+cleanup:
+ regfree(&r);
+ return ret;
usage:
usage("\ttest-tool regex --bug\n"
"\ttest-tool regex [--silent] <pattern>\n"
diff --git a/t/helper/test-repository.c b/t/helper/test-repository.c
index 56f0e3c..0c7c5aa 100644
--- a/t/helper/test-repository.c
+++ b/t/helper/test-repository.c
@@ -1,11 +1,11 @@
#include "test-tool.h"
-#include "cache.h"
#include "commit-graph.h"
#include "commit.h"
-#include "config.h"
-#include "object-store.h"
+#include "environment.h"
+#include "hex.h"
#include "object.h"
#include "repository.h"
+#include "setup.h"
#include "tree.h"
static void test_parse_commit_in_graph(const char *gitdir, const char *worktree,
diff --git a/t/helper/test-revision-walking.c b/t/helper/test-revision-walking.c
index 4a45d5b..f346951 100644
--- a/t/helper/test-revision-walking.c
+++ b/t/helper/test-revision-walking.c
@@ -9,17 +9,19 @@
*/
#include "test-tool.h"
-#include "cache.h"
#include "commit.h"
#include "diff.h"
+#include "repository.h"
#include "revision.h"
+#include "setup.h"
static void print_commit(struct commit *commit)
{
struct strbuf sb = STRBUF_INIT;
struct pretty_print_context ctx = {0};
ctx.date_mode.type = DATE_NORMAL;
- format_commit_message(commit, " %m %s", &sb, &ctx);
+ repo_format_commit_message(the_repository, commit, " %m %s", &sb,
+ &ctx);
printf("%s\n", sb.buf);
strbuf_release(&sb);
}
diff --git a/t/helper/test-rot13-filter.c b/t/helper/test-rot13-filter.c
new file mode 100644
index 0000000..f8d564c
--- /dev/null
+++ b/t/helper/test-rot13-filter.c
@@ -0,0 +1,382 @@
+/*
+ * Example implementation for the Git filter protocol version 2
+ * See Documentation/gitattributes.txt, section "Filter Protocol"
+ *
+ * Usage: test-tool rot13-filter [--always-delay] --log=<path> <capabilities>
+ *
+ * Log path defines a debug log file that the script writes to. The
+ * subsequent arguments define a list of supported protocol capabilities
+ * ("clean", "smudge", etc).
+ *
+ * When --always-delay is given all pathnames with the "can-delay" flag
+ * that don't appear on the list bellow are delayed with a count of 1
+ * (see more below).
+ *
+ * This implementation supports special test cases:
+ * (1) If data with the pathname "clean-write-fail.r" is processed with
+ * a "clean" operation then the write operation will die.
+ * (2) If data with the pathname "smudge-write-fail.r" is processed with
+ * a "smudge" operation then the write operation will die.
+ * (3) If data with the pathname "error.r" is processed with any
+ * operation then the filter signals that it cannot or does not want
+ * to process the file.
+ * (4) If data with the pathname "abort.r" is processed with any
+ * operation then the filter signals that it cannot or does not want
+ * to process the file and any file after that is processed with the
+ * same command.
+ * (5) If data with a pathname that is a key in the delay hash is
+ * requested (e.g. "test-delay10.a") then the filter responds with
+ * a "delay" status and sets the "requested" field in the delay hash.
+ * The filter will signal the availability of this object after
+ * "count" (field in delay hash) "list_available_blobs" commands.
+ * (6) If data with the pathname "missing-delay.a" is processed that the
+ * filter will drop the path from the "list_available_blobs" response.
+ * (7) If data with the pathname "invalid-delay.a" is processed that the
+ * filter will add the path "unfiltered" which was not delayed before
+ * to the "list_available_blobs" response.
+ */
+
+#include "test-tool.h"
+#include "pkt-line.h"
+#include "string-list.h"
+#include "strmap.h"
+#include "parse-options.h"
+
+static FILE *logfile;
+static int always_delay, has_clean_cap, has_smudge_cap;
+static struct strmap delay = STRMAP_INIT;
+
+static inline const char *str_or_null(const char *str)
+{
+ return str ? str : "(null)";
+}
+
+static char *rot13(char *str)
+{
+ char *c;
+ for (c = str; *c; c++)
+ if (isalpha(*c))
+ *c += tolower(*c) < 'n' ? 13 : -13;
+ return str;
+}
+
+static char *get_value(char *buf, const char *key)
+{
+ const char *orig_buf = buf;
+ if (!buf ||
+ !skip_prefix((const char *)buf, key, (const char **)&buf) ||
+ !skip_prefix((const char *)buf, "=", (const char **)&buf) ||
+ !*buf)
+ die("expected key '%s', got '%s'", key, str_or_null(orig_buf));
+ return buf;
+}
+
+/*
+ * Read a text packet, expecting that it is in the form "key=value" for
+ * the given key. An EOF does not trigger any error and is reported
+ * back to the caller with NULL. Die if the "key" part of "key=value" does
+ * not match the given key, or the value part is empty.
+ */
+static char *packet_key_val_read(const char *key)
+{
+ char *buf;
+ if (packet_read_line_gently(0, NULL, &buf) < 0)
+ return NULL;
+ return xstrdup(get_value(buf, key));
+}
+
+static inline void assert_remote_capability(struct strset *caps, const char *cap)
+{
+ if (!strset_contains(caps, cap))
+ die("required '%s' capability not available from remote", cap);
+}
+
+static void read_capabilities(struct strset *remote_caps)
+{
+ for (;;) {
+ char *buf = packet_read_line(0, NULL);
+ if (!buf)
+ break;
+ strset_add(remote_caps, get_value(buf, "capability"));
+ }
+
+ assert_remote_capability(remote_caps, "clean");
+ assert_remote_capability(remote_caps, "smudge");
+ assert_remote_capability(remote_caps, "delay");
+}
+
+static void check_and_write_capabilities(struct strset *remote_caps,
+ const char **caps, int nr_caps)
+{
+ int i;
+ for (i = 0; i < nr_caps; i++) {
+ if (!strset_contains(remote_caps, caps[i]))
+ die("our capability '%s' is not available from remote",
+ caps[i]);
+ packet_write_fmt(1, "capability=%s\n", caps[i]);
+ }
+ packet_flush(1);
+}
+
+struct delay_entry {
+ int requested, count;
+ char *output;
+};
+
+static void free_delay_entries(void)
+{
+ struct hashmap_iter iter;
+ struct strmap_entry *ent;
+
+ strmap_for_each_entry(&delay, &iter, ent) {
+ struct delay_entry *delay_entry = ent->value;
+ free(delay_entry->output);
+ free(delay_entry);
+ }
+ strmap_clear(&delay, 0);
+}
+
+static void add_delay_entry(char *pathname, int count, int requested)
+{
+ struct delay_entry *entry = xcalloc(1, sizeof(*entry));
+ entry->count = count;
+ entry->requested = requested;
+ if (strmap_put(&delay, pathname, entry))
+ BUG("adding the same path twice to delay hash?");
+}
+
+static void reply_list_available_blobs_cmd(void)
+{
+ struct hashmap_iter iter;
+ struct strmap_entry *ent;
+ struct string_list_item *str_item;
+ struct string_list paths = STRING_LIST_INIT_NODUP;
+
+ /* flush */
+ if (packet_read_line(0, NULL))
+ die("bad list_available_blobs end");
+
+ strmap_for_each_entry(&delay, &iter, ent) {
+ struct delay_entry *delay_entry = ent->value;
+ if (!delay_entry->requested)
+ continue;
+ delay_entry->count--;
+ if (!strcmp(ent->key, "invalid-delay.a")) {
+ /* Send Git a pathname that was not delayed earlier */
+ packet_write_fmt(1, "pathname=unfiltered");
+ }
+ if (!strcmp(ent->key, "missing-delay.a")) {
+ /* Do not signal Git that this file is available */
+ } else if (!delay_entry->count) {
+ string_list_append(&paths, ent->key);
+ packet_write_fmt(1, "pathname=%s", ent->key);
+ }
+ }
+
+ /* Print paths in sorted order. */
+ string_list_sort(&paths);
+ for_each_string_list_item(str_item, &paths)
+ fprintf(logfile, " %s", str_item->string);
+ string_list_clear(&paths, 0);
+
+ packet_flush(1);
+
+ fprintf(logfile, " [OK]\n");
+ packet_write_fmt(1, "status=success");
+ packet_flush(1);
+}
+
+static void command_loop(void)
+{
+ for (;;) {
+ char *buf, *output;
+ char *pathname;
+ struct delay_entry *entry;
+ struct strbuf input = STRBUF_INIT;
+ char *command = packet_key_val_read("command");
+
+ if (!command) {
+ fprintf(logfile, "STOP\n");
+ break;
+ }
+ fprintf(logfile, "IN: %s", command);
+
+ if (!strcmp(command, "list_available_blobs")) {
+ reply_list_available_blobs_cmd();
+ free(command);
+ continue;
+ }
+
+ pathname = packet_key_val_read("pathname");
+ if (!pathname)
+ die("unexpected EOF while expecting pathname");
+ fprintf(logfile, " %s", pathname);
+
+ /* Read until flush */
+ while ((buf = packet_read_line(0, NULL))) {
+ if (!strcmp(buf, "can-delay=1")) {
+ entry = strmap_get(&delay, pathname);
+ if (entry && !entry->requested)
+ entry->requested = 1;
+ else if (!entry && always_delay)
+ add_delay_entry(pathname, 1, 1);
+ } else if (starts_with(buf, "ref=") ||
+ starts_with(buf, "treeish=") ||
+ starts_with(buf, "blob=")) {
+ fprintf(logfile, " %s", buf);
+ } else {
+ /*
+ * In general, filters need to be graceful about
+ * new metadata, since it's documented that we
+ * can pass any key-value pairs, but for tests,
+ * let's be a little stricter.
+ */
+ die("Unknown message '%s'", buf);
+ }
+ }
+
+ read_packetized_to_strbuf(0, &input, 0);
+ fprintf(logfile, " %"PRIuMAX" [OK] -- ", (uintmax_t)input.len);
+
+ entry = strmap_get(&delay, pathname);
+ if (entry && entry->output) {
+ output = entry->output;
+ } else if (!strcmp(pathname, "error.r") || !strcmp(pathname, "abort.r")) {
+ output = "";
+ } else if (!strcmp(command, "clean") && has_clean_cap) {
+ output = rot13(input.buf);
+ } else if (!strcmp(command, "smudge") && has_smudge_cap) {
+ output = rot13(input.buf);
+ } else {
+ die("bad command '%s'", command);
+ }
+
+ if (!strcmp(pathname, "error.r")) {
+ fprintf(logfile, "[ERROR]\n");
+ packet_write_fmt(1, "status=error");
+ packet_flush(1);
+ } else if (!strcmp(pathname, "abort.r")) {
+ fprintf(logfile, "[ABORT]\n");
+ packet_write_fmt(1, "status=abort");
+ packet_flush(1);
+ } else if (!strcmp(command, "smudge") &&
+ (entry = strmap_get(&delay, pathname)) &&
+ entry->requested == 1) {
+ fprintf(logfile, "[DELAYED]\n");
+ packet_write_fmt(1, "status=delayed");
+ packet_flush(1);
+ entry->requested = 2;
+ if (entry->output != output) {
+ free(entry->output);
+ entry->output = xstrdup(output);
+ }
+ } else {
+ int i, nr_packets = 0;
+ size_t output_len;
+ const char *p;
+ packet_write_fmt(1, "status=success");
+ packet_flush(1);
+
+ if (skip_prefix(pathname, command, &p) &&
+ !strcmp(p, "-write-fail.r")) {
+ fprintf(logfile, "[WRITE FAIL]\n");
+ die("%s write error", command);
+ }
+
+ output_len = strlen(output);
+ fprintf(logfile, "OUT: %"PRIuMAX" ", (uintmax_t)output_len);
+
+ if (write_packetized_from_buf_no_flush_count(output,
+ output_len, 1, &nr_packets))
+ die("failed to write buffer to stdout");
+ packet_flush(1);
+
+ for (i = 0; i < nr_packets; i++)
+ fprintf(logfile, ".");
+ fprintf(logfile, " [OK]\n");
+
+ packet_flush(1);
+ }
+ free(pathname);
+ strbuf_release(&input);
+ free(command);
+ }
+}
+
+static void packet_initialize(void)
+{
+ char *pkt_buf = packet_read_line(0, NULL);
+
+ if (!pkt_buf || strcmp(pkt_buf, "git-filter-client"))
+ die("bad initialize: '%s'", str_or_null(pkt_buf));
+
+ pkt_buf = packet_read_line(0, NULL);
+ if (!pkt_buf || strcmp(pkt_buf, "version=2"))
+ die("bad version: '%s'", str_or_null(pkt_buf));
+
+ pkt_buf = packet_read_line(0, NULL);
+ if (pkt_buf)
+ die("bad version end: '%s'", pkt_buf);
+
+ packet_write_fmt(1, "git-filter-server");
+ packet_write_fmt(1, "version=2");
+ packet_flush(1);
+}
+
+static const char *rot13_usage[] = {
+ "test-tool rot13-filter [--always-delay] --log=<path> <capabilities>",
+ NULL
+};
+
+int cmd__rot13_filter(int argc, const char **argv)
+{
+ int i, nr_caps;
+ struct strset remote_caps = STRSET_INIT;
+ const char *log_path = NULL;
+
+ struct option options[] = {
+ OPT_BOOL(0, "always-delay", &always_delay,
+ "delay all paths with the can-delay flag"),
+ OPT_STRING(0, "log", &log_path, "path",
+ "path to the debug log file"),
+ OPT_END()
+ };
+ nr_caps = parse_options(argc, argv, NULL, options, rot13_usage,
+ PARSE_OPT_STOP_AT_NON_OPTION);
+
+ if (!log_path || !nr_caps)
+ usage_with_options(rot13_usage, options);
+
+ logfile = fopen(log_path, "a");
+ if (!logfile)
+ die_errno("failed to open log file");
+
+ for (i = 0; i < nr_caps; i++) {
+ if (!strcmp(argv[i], "smudge"))
+ has_smudge_cap = 1;
+ if (!strcmp(argv[i], "clean"))
+ has_clean_cap = 1;
+ }
+
+ add_delay_entry("test-delay10.a", 1, 0);
+ add_delay_entry("test-delay11.a", 1, 0);
+ add_delay_entry("test-delay20.a", 2, 0);
+ add_delay_entry("test-delay10.b", 1, 0);
+ add_delay_entry("missing-delay.a", 1, 0);
+ add_delay_entry("invalid-delay.a", 1, 0);
+
+ fprintf(logfile, "START\n");
+ packet_initialize();
+
+ read_capabilities(&remote_caps);
+ check_and_write_capabilities(&remote_caps, argv, nr_caps);
+ fprintf(logfile, "init handshake complete\n");
+ strset_clear(&remote_caps);
+
+ command_loop();
+
+ if (fclose(logfile))
+ die_errno("error closing logfile");
+ free_delay_entries();
+ return 0;
+}
diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c
index c9283b4..c0ed872 100644
--- a/t/helper/test-run-command.c
+++ b/t/helper/test-run-command.c
@@ -9,8 +9,6 @@
*/
#include "test-tool.h"
-#include "git-compat-util.h"
-#include "cache.h"
#include "run-command.h"
#include "strvec.h"
#include "strbuf.h"
@@ -18,13 +16,12 @@
#include "string-list.h"
#include "thread-utils.h"
#include "wildmatch.h"
-#include "gettext.h"
static int number_callbacks;
static int parallel_next(struct child_process *cp,
struct strbuf *err,
void *cb,
- void **task_cb)
+ void **task_cb UNUSED)
{
struct child_process *d = cb;
if (number_callbacks >= 4)
@@ -40,10 +37,10 @@ static int parallel_next(struct child_process *cp,
return 1;
}
-static int no_job(struct child_process *cp,
+static int no_job(struct child_process *cp UNUSED,
struct strbuf *err,
- void *cb,
- void **task_cb)
+ void *cb UNUSED,
+ void **task_cb UNUSED)
{
if (err)
strbuf_addstr(err, "no further jobs available\n");
@@ -52,10 +49,10 @@ static int no_job(struct child_process *cp,
return 0;
}
-static int task_finished(int result,
+static int task_finished(int result UNUSED,
struct strbuf *err,
- void *pp_cb,
- void *pp_task_cb)
+ void *pp_cb UNUSED,
+ void *pp_task_cb UNUSED)
{
if (err)
strbuf_addstr(err, "asking for a quick stop\n");
@@ -136,7 +133,7 @@ static const char * const testsuite_usage[] = {
static int testsuite(int argc, const char **argv)
{
struct testsuite suite = TESTSUITE_INIT;
- int max_jobs = 1, i, ret;
+ int max_jobs = 1, i, ret = 0;
DIR *dir;
struct dirent *d;
struct option options[] = {
@@ -152,6 +149,12 @@ static int testsuite(int argc, const char **argv)
"write JUnit-style XML files"),
OPT_END()
};
+ struct run_process_parallel_opts opts = {
+ .get_next_task = next_test,
+ .start_failure = test_failed,
+ .task_finished = test_finished,
+ .data = &suite,
+ };
argc = parse_options(argc, argv, NULL, options,
testsuite_usage, PARSE_OPT_STOP_AT_NON_OPTION);
@@ -192,8 +195,8 @@ static int testsuite(int argc, const char **argv)
fprintf(stderr, "Running %"PRIuMAX" tests (%d at a time)\n",
(uintmax_t)suite.tests.nr, max_jobs);
- ret = run_processes_parallel(max_jobs, next_test, test_failed,
- test_finished, &suite);
+ opts.processes = max_jobs;
+ run_processes_parallel(&opts);
if (suite.failed.nr > 0) {
ret = 1;
@@ -206,7 +209,7 @@ static int testsuite(int argc, const char **argv)
string_list_clear(&suite.tests, 0);
string_list_clear(&suite.failed, 0);
- return !!ret;
+ return ret;
}
static uint64_t my_random_next = 1234;
@@ -381,13 +384,17 @@ int cmd__run_command(int argc, const char **argv)
{
struct child_process proc = CHILD_PROCESS_INIT;
int jobs;
+ int ret;
+ struct run_process_parallel_opts opts = {
+ .data = &proc,
+ };
if (argc > 1 && !strcmp(argv[1], "testsuite"))
- exit(testsuite(argc - 1, argv + 1));
+ return testsuite(argc - 1, argv + 1);
if (!strcmp(argv[1], "inherited-handle"))
- exit(inherit_handle(argv[0]));
+ return inherit_handle(argv[0]);
if (!strcmp(argv[1], "inherited-handle-child"))
- exit(inherit_handle_child());
+ return inherit_handle_child();
if (argc >= 2 && !strcmp(argv[1], "quote-stress-test"))
return !!quote_stress_test(argc - 1, argv + 1);
@@ -404,41 +411,52 @@ int cmd__run_command(int argc, const char **argv)
argv += 2;
argc -= 2;
}
- if (argc < 3)
- return 1;
+ if (argc < 3) {
+ ret = 1;
+ goto cleanup;
+ }
strvec_pushv(&proc.args, (const char **)argv + 2);
if (!strcmp(argv[1], "start-command-ENOENT")) {
- if (start_command(&proc) < 0 && errno == ENOENT)
- return 0;
+ if (start_command(&proc) < 0 && errno == ENOENT) {
+ ret = 0;
+ goto cleanup;
+ }
fprintf(stderr, "FAIL %s\n", argv[1]);
return 1;
}
- if (!strcmp(argv[1], "run-command"))
- exit(run_command(&proc));
+ if (!strcmp(argv[1], "run-command")) {
+ ret = run_command(&proc);
+ goto cleanup;
+ }
if (!strcmp(argv[1], "--ungroup")) {
argv += 1;
argc -= 1;
- run_processes_parallel_ungroup = 1;
+ opts.ungroup = 1;
}
jobs = atoi(argv[2]);
strvec_clear(&proc.args);
strvec_pushv(&proc.args, (const char **)argv + 3);
- if (!strcmp(argv[1], "run-command-parallel"))
- exit(run_processes_parallel(jobs, parallel_next,
- NULL, NULL, &proc));
-
- if (!strcmp(argv[1], "run-command-abort"))
- exit(run_processes_parallel(jobs, parallel_next,
- NULL, task_finished, &proc));
-
- if (!strcmp(argv[1], "run-command-no-jobs"))
- exit(run_processes_parallel(jobs, no_job,
- NULL, task_finished, &proc));
-
- fprintf(stderr, "check usage\n");
- return 1;
+ if (!strcmp(argv[1], "run-command-parallel")) {
+ opts.get_next_task = parallel_next;
+ } else if (!strcmp(argv[1], "run-command-abort")) {
+ opts.get_next_task = parallel_next;
+ opts.task_finished = task_finished;
+ } else if (!strcmp(argv[1], "run-command-no-jobs")) {
+ opts.get_next_task = no_job;
+ opts.task_finished = task_finished;
+ } else {
+ ret = 1;
+ fprintf(stderr, "check usage\n");
+ goto cleanup;
+ }
+ opts.processes = jobs;
+ run_processes_parallel(&opts);
+ ret = 0;
+cleanup:
+ child_process_clear(&proc);
+ return ret;
}
diff --git a/t/helper/test-scrap-cache-tree.c b/t/helper/test-scrap-cache-tree.c
index 393f160..0a816a9 100644
--- a/t/helper/test-scrap-cache-tree.c
+++ b/t/helper/test-scrap-cache-tree.c
@@ -1,18 +1,22 @@
+#define USE_THE_INDEX_VARIABLE
#include "test-tool.h"
-#include "cache.h"
#include "lockfile.h"
+#include "read-cache-ll.h"
+#include "repository.h"
+#include "setup.h"
#include "tree.h"
#include "cache-tree.h"
-int cmd__scrap_cache_tree(int ac, const char **av)
+int cmd__scrap_cache_tree(int ac UNUSED, const char **av UNUSED)
{
struct lock_file index_lock = LOCK_INIT;
setup_git_directory();
- hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
- if (read_cache() < 0)
+ repo_hold_locked_index(the_repository, &index_lock, LOCK_DIE_ON_ERROR);
+ if (repo_read_index(the_repository) < 0)
die("unable to read index file");
- active_cache_tree = NULL;
+ cache_tree_free(&the_index.cache_tree);
+ the_index.cache_tree = NULL;
if (write_locked_index(&the_index, &index_lock, COMMIT_LOCK))
die("unable to write index file");
return 0;
diff --git a/t/helper/test-serve-v2.c b/t/helper/test-serve-v2.c
index 28e905a..054cbcf 100644
--- a/t/helper/test-serve-v2.c
+++ b/t/helper/test-serve-v2.c
@@ -1,7 +1,8 @@
#include "test-tool.h"
-#include "cache.h"
+#include "gettext.h"
#include "parse-options.h"
#include "serve.h"
+#include "setup.h"
static char const * const serve_usage[] = {
N_("test-tool serve-v2 [<options>]"),
@@ -24,7 +25,7 @@ int cmd__serve_v2(int argc, const char **argv)
/* ignore all unknown cmdline switches for now */
argc = parse_options(argc, argv, prefix, options, serve_usage,
PARSE_OPT_KEEP_DASHDASH |
- PARSE_OPT_KEEP_UNKNOWN);
+ PARSE_OPT_KEEP_UNKNOWN_OPT);
if (advertise_capabilities)
protocol_v2_advertise_capabilities();
diff --git a/t/helper/test-sha1.c b/t/helper/test-sha1.c
index d860c38..dcb7f6c 100644
--- a/t/helper/test-sha1.c
+++ b/t/helper/test-sha1.c
@@ -1,7 +1,15 @@
#include "test-tool.h"
-#include "cache.h"
+#include "hash-ll.h"
int cmd__sha1(int ac, const char **av)
{
return cmd_hash_impl(ac, av, GIT_HASH_SHA1);
}
+
+int cmd__sha1_is_sha1dc(int argc UNUSED, const char **argv UNUSED)
+{
+#ifdef platform_SHA_IS_SHA1DC
+ return 0;
+#endif
+ return 1;
+}
diff --git a/t/helper/test-sha256.c b/t/helper/test-sha256.c
index 0ac6a99..08cf149 100644
--- a/t/helper/test-sha256.c
+++ b/t/helper/test-sha256.c
@@ -1,5 +1,5 @@
#include "test-tool.h"
-#include "cache.h"
+#include "hash-ll.h"
int cmd__sha256(int ac, const char **av)
{
diff --git a/t/helper/test-sigchain.c b/t/helper/test-sigchain.c
index d013bcc..2d5ecf7 100644
--- a/t/helper/test-sigchain.c
+++ b/t/helper/test-sigchain.c
@@ -1,5 +1,4 @@
#include "test-tool.h"
-#include "cache.h"
#include "sigchain.h"
#define X(f) \
@@ -14,7 +13,7 @@ X(two)
X(three)
#undef X
-int cmd__sigchain(int argc, const char **argv)
+int cmd__sigchain(int argc UNUSED, const char **argv UNUSED)
{
sigchain_push(SIGTERM, one);
sigchain_push(SIGTERM, two);
diff --git a/t/helper/test-simple-ipc.c b/t/helper/test-simple-ipc.c
index 28365ff..fb59277 100644
--- a/t/helper/test-simple-ipc.c
+++ b/t/helper/test-simple-ipc.c
@@ -3,13 +3,13 @@
*/
#include "test-tool.h"
-#include "cache.h"
-#include "strbuf.h"
+#include "gettext.h"
#include "simple-ipc.h"
#include "parse-options.h"
#include "thread-utils.h"
#include "strvec.h"
#include "run-command.h"
+#include "trace2.h"
#ifndef SUPPORTS_SIMPLE_IPC
int cmd__simple_ipc(int argc, const char **argv)
@@ -277,7 +277,8 @@ static int daemon__run_server(void)
static start_bg_wait_cb bg_wait_cb;
-static int bg_wait_cb(const struct child_process *cp, void *cb_data)
+static int bg_wait_cb(const struct child_process *cp UNUSED,
+ void *cb_data UNUSED)
{
int s = ipc_get_active_state(cl_args.path);
diff --git a/t/helper/test-strcmp-offset.c b/t/helper/test-strcmp-offset.c
index 44e4a6d..d8473cf 100644
--- a/t/helper/test-strcmp-offset.c
+++ b/t/helper/test-strcmp-offset.c
@@ -1,7 +1,7 @@
#include "test-tool.h"
-#include "cache.h"
+#include "read-cache-ll.h"
-int cmd__strcmp_offset(int argc, const char **argv)
+int cmd__strcmp_offset(int argc UNUSED, const char **argv)
{
int result;
size_t offset;
diff --git a/t/helper/test-string-list.c b/t/helper/test-string-list.c
index 2123dda..e2aad61 100644
--- a/t/helper/test-string-list.c
+++ b/t/helper/test-string-list.c
@@ -1,5 +1,5 @@
#include "test-tool.h"
-#include "cache.h"
+#include "strbuf.h"
#include "string-list.h"
/*
@@ -62,7 +62,7 @@ int cmd__string_list(int argc, const char **argv)
struct string_list list = STRING_LIST_INIT_NODUP;
int i;
char *s = xstrdup(argv[2]);
- int delim = *argv[3];
+ const char *delim = argv[3];
int maxsplit = atoi(argv[4]);
i = string_list_split_in_place(&list, s, delim, maxsplit);
@@ -111,7 +111,7 @@ int cmd__string_list(int argc, const char **argv)
*/
if (sb.len && sb.buf[sb.len - 1] == '\n')
strbuf_setlen(&sb, sb.len - 1);
- string_list_split_in_place(&list, sb.buf, '\n', -1);
+ string_list_split_in_place(&list, sb.buf, "\n", -1);
string_list_sort(&list);
diff --git a/t/helper/test-submodule-config.c b/t/helper/test-submodule-config.c
index e269274..9df2f03 100644
--- a/t/helper/test-submodule-config.c
+++ b/t/helper/test-submodule-config.c
@@ -1,10 +1,13 @@
#include "test-tool.h"
-#include "cache.h"
#include "config.h"
+#include "hash.h"
+#include "object-name.h"
+#include "repository.h"
+#include "setup.h"
#include "submodule-config.h"
#include "submodule.h"
-static void die_usage(int argc, const char **argv, const char *msg)
+static void die_usage(int argc UNUSED, const char **argv, const char *msg)
{
fprintf(stderr, "%s\n", msg);
fprintf(stderr, "Usage: %s [<commit> <submodulepath>] ...\n", argv[0]);
@@ -15,14 +18,11 @@ int cmd__submodule_config(int argc, const char **argv)
{
const char **arg = argv;
int my_argc = argc;
- int output_url = 0;
int lookup_name = 0;
arg++;
my_argc--;
while (arg[0] && starts_with(arg[0], "--")) {
- if (!strcmp(arg[0], "--url"))
- output_url = 1;
if (!strcmp(arg[0], "--name"))
lookup_name = 1;
arg++;
@@ -45,7 +45,7 @@ int cmd__submodule_config(int argc, const char **argv)
if (commit[0] == '\0')
oidclr(&commit_oid);
- else if (get_oid(commit, &commit_oid) < 0)
+ else if (repo_get_oid(the_repository, commit, &commit_oid) < 0)
die_usage(argc, argv, "Commit not found.");
if (lookup_name) {
@@ -57,12 +57,8 @@ int cmd__submodule_config(int argc, const char **argv)
if (!submodule)
die_usage(argc, argv, "Submodule not found.");
- if (output_url)
- printf("Submodule url: '%s' for path '%s'\n",
- submodule->url, submodule->path);
- else
- printf("Submodule name: '%s' for path '%s'\n",
- submodule->name, submodule->path);
+ printf("Submodule name: '%s' for path '%s'\n", submodule->name,
+ submodule->path);
arg += 2;
}
diff --git a/t/helper/test-submodule-nested-repo-config.c b/t/helper/test-submodule-nested-repo-config.c
index dc1c14b..ecd40de 100644
--- a/t/helper/test-submodule-nested-repo-config.c
+++ b/t/helper/test-submodule-nested-repo-config.c
@@ -1,4 +1,6 @@
#include "test-tool.h"
+#include "repository.h"
+#include "setup.h"
#include "submodule-config.h"
static void die_usage(const char **argv, const char *msg)
diff --git a/t/helper/test-submodule.c b/t/helper/test-submodule.c
new file mode 100644
index 0000000..7197969
--- /dev/null
+++ b/t/helper/test-submodule.c
@@ -0,0 +1,242 @@
+#include "test-tool.h"
+#include "test-tool-utils.h"
+#include "parse-options.h"
+#include "remote.h"
+#include "repository.h"
+#include "setup.h"
+#include "strbuf.h"
+#include "submodule-config.h"
+#include "submodule.h"
+
+#define TEST_TOOL_CHECK_NAME_USAGE \
+ "test-tool submodule check-name"
+static const char *submodule_check_name_usage[] = {
+ TEST_TOOL_CHECK_NAME_USAGE,
+ NULL
+};
+
+#define TEST_TOOL_CHECK_URL_USAGE \
+ "test-tool submodule check-url"
+static const char *submodule_check_url_usage[] = {
+ TEST_TOOL_CHECK_URL_USAGE,
+ NULL
+};
+
+#define TEST_TOOL_IS_ACTIVE_USAGE \
+ "test-tool submodule is-active <name>"
+static const char *submodule_is_active_usage[] = {
+ TEST_TOOL_IS_ACTIVE_USAGE,
+ NULL
+};
+
+#define TEST_TOOL_RESOLVE_RELATIVE_URL_USAGE \
+ "test-tool submodule resolve-relative-url <up_path> <remoteurl> <url>"
+static const char *submodule_resolve_relative_url_usage[] = {
+ TEST_TOOL_RESOLVE_RELATIVE_URL_USAGE,
+ NULL,
+};
+
+static const char *submodule_usage[] = {
+ TEST_TOOL_CHECK_NAME_USAGE,
+ TEST_TOOL_CHECK_URL_USAGE,
+ TEST_TOOL_IS_ACTIVE_USAGE,
+ TEST_TOOL_RESOLVE_RELATIVE_URL_USAGE,
+ NULL
+};
+
+typedef int (*check_fn_t)(const char *);
+
+/*
+ * Apply 'check_fn' to each line of stdin, printing values that pass the check
+ * to stdout.
+ */
+static int check_submodule(check_fn_t check_fn)
+{
+ struct strbuf buf = STRBUF_INIT;
+ while (strbuf_getline(&buf, stdin) != EOF) {
+ if (!check_fn(buf.buf))
+ printf("%s\n", buf.buf);
+ }
+ strbuf_release(&buf);
+ return 0;
+}
+
+static int cmd__submodule_check_name(int argc, const char **argv)
+{
+ struct option options[] = {
+ OPT_END()
+ };
+ argc = parse_options(argc, argv, "test-tools", options,
+ submodule_check_name_usage, 0);
+ if (argc)
+ usage_with_options(submodule_check_name_usage, options);
+
+ return check_submodule(check_submodule_name);
+}
+
+static int cmd__submodule_check_url(int argc, const char **argv)
+{
+ struct option options[] = {
+ OPT_END()
+ };
+ argc = parse_options(argc, argv, "test-tools", options,
+ submodule_check_url_usage, 0);
+ if (argc)
+ usage_with_options(submodule_check_url_usage, options);
+
+ return check_submodule(check_submodule_url);
+}
+
+static int cmd__submodule_is_active(int argc, const char **argv)
+{
+ struct option options[] = {
+ OPT_END()
+ };
+ argc = parse_options(argc, argv, "test-tools", options,
+ submodule_is_active_usage, 0);
+ if (argc != 1)
+ usage_with_options(submodule_is_active_usage, options);
+
+ setup_git_directory();
+
+ return !is_submodule_active(the_repository, argv[0]);
+}
+
+static int cmd__submodule_resolve_relative_url(int argc, const char **argv)
+{
+ char *remoteurl, *res;
+ const char *up_path, *url;
+ struct option options[] = {
+ OPT_END()
+ };
+ argc = parse_options(argc, argv, "test-tools", options,
+ submodule_resolve_relative_url_usage, 0);
+ if (argc != 3)
+ usage_with_options(submodule_resolve_relative_url_usage, options);
+
+ up_path = argv[0];
+ remoteurl = xstrdup(argv[1]);
+ url = argv[2];
+
+ if (!strcmp(up_path, "(null)"))
+ up_path = NULL;
+
+ res = relative_url(remoteurl, url, up_path);
+ puts(res);
+ free(res);
+ free(remoteurl);
+ return 0;
+}
+
+static int cmd__submodule_config_list(int argc, const char **argv)
+{
+ struct option options[] = {
+ OPT_END()
+ };
+ const char *const usage[] = {
+ "test-tool submodule config-list <key>",
+ NULL
+ };
+ argc = parse_options(argc, argv, "test-tools", options, usage,
+ PARSE_OPT_KEEP_ARGV0);
+
+ setup_git_directory();
+
+ if (argc == 2)
+ return print_config_from_gitmodules(the_repository, argv[1]);
+ usage_with_options(usage, options);
+}
+
+static int cmd__submodule_config_set(int argc, const char **argv)
+{
+ struct option options[] = {
+ OPT_END()
+ };
+ const char *const usage[] = {
+ "test-tool submodule config-set <key> <value>",
+ NULL
+ };
+ argc = parse_options(argc, argv, "test-tools", options, usage,
+ PARSE_OPT_KEEP_ARGV0);
+
+ setup_git_directory();
+
+ /* Equivalent to ACTION_SET in builtin/config.c */
+ if (argc == 3) {
+ if (!is_writing_gitmodules_ok())
+ die("please make sure that the .gitmodules file is in the working tree");
+
+ return config_set_in_gitmodules_file_gently(argv[1], argv[2]);
+ }
+ usage_with_options(usage, options);
+}
+
+static int cmd__submodule_config_unset(int argc, const char **argv)
+{
+ struct option options[] = {
+ OPT_END()
+ };
+ const char *const usage[] = {
+ "test-tool submodule config-unset <key>",
+ NULL
+ };
+
+ setup_git_directory();
+
+ if (argc == 2) {
+ if (!is_writing_gitmodules_ok())
+ die("please make sure that the .gitmodules file is in the working tree");
+ return config_set_in_gitmodules_file_gently(argv[1], NULL);
+ }
+ usage_with_options(usage, options);
+}
+
+static int cmd__submodule_config_writeable(int argc, const char **argv UNUSED)
+{
+ struct option options[] = {
+ OPT_END()
+ };
+ const char *const usage[] = {
+ "test-tool submodule config-writeable",
+ NULL
+ };
+ setup_git_directory();
+
+ if (argc == 1)
+ return is_writing_gitmodules_ok() ? 0 : -1;
+
+ usage_with_options(usage, options);
+}
+
+static struct test_cmd cmds[] = {
+ { "check-name", cmd__submodule_check_name },
+ { "check-url", cmd__submodule_check_url },
+ { "is-active", cmd__submodule_is_active },
+ { "resolve-relative-url", cmd__submodule_resolve_relative_url},
+ { "config-list", cmd__submodule_config_list },
+ { "config-set", cmd__submodule_config_set },
+ { "config-unset", cmd__submodule_config_unset },
+ { "config-writeable", cmd__submodule_config_writeable },
+};
+
+int cmd__submodule(int argc, const char **argv)
+{
+ struct option options[] = {
+ OPT_END()
+ };
+ size_t i;
+
+ argc = parse_options(argc, argv, "test-tools", options, submodule_usage,
+ PARSE_OPT_STOP_AT_NON_OPTION);
+ if (argc < 1)
+ usage_with_options(submodule_usage, options);
+
+ for (i = 0; i < ARRAY_SIZE(cmds); i++)
+ if (!strcmp(cmds[i].name, argv[0]))
+ return cmds[i].fn(argc, argv);
+
+ usage_msg_optf("unknown subcommand '%s'", submodule_usage, options,
+ argv[0]);
+
+ return 0;
+}
diff --git a/t/helper/test-subprocess.c b/t/helper/test-subprocess.c
index ff22f2f..c344f16 100644
--- a/t/helper/test-subprocess.c
+++ b/t/helper/test-subprocess.c
@@ -1,6 +1,6 @@
#include "test-tool.h"
-#include "cache.h"
#include "run-command.h"
+#include "setup.h"
int cmd__subprocess(int argc, const char **argv)
{
diff --git a/t/helper/test-tool-utils.h b/t/helper/test-tool-utils.h
new file mode 100644
index 0000000..6a0e5e0
--- /dev/null
+++ b/t/helper/test-tool-utils.h
@@ -0,0 +1,9 @@
+#ifndef TEST_TOOL_UTILS_H
+#define TEST_TOOL_UTILS_H
+
+struct test_cmd {
+ const char *name;
+ int (*fn)(int argc, const char **argv);
+};
+
+#endif
diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c
index 318fdba..80a946b 100644
--- a/t/helper/test-tool.c
+++ b/t/helper/test-tool.c
@@ -1,5 +1,6 @@
#include "git-compat-util.h"
#include "test-tool.h"
+#include "test-tool-utils.h"
#include "trace2.h"
#include "parse-options.h"
@@ -8,21 +9,18 @@ static const char * const test_tool_usage[] = {
NULL
};
-struct test_cmd {
- const char *name;
- int (*fn)(int argc, const char **argv);
-};
-
static struct test_cmd cmds[] = {
{ "advise", cmd__advise_if_enabled },
{ "bitmap", cmd__bitmap },
{ "bloom", cmd__bloom },
+ { "bundle-uri", cmd__bundle_uri },
+ { "cache-tree", cmd__cache_tree },
{ "chmtime", cmd__chmtime },
{ "config", cmd__config },
{ "crontab", cmd__crontab },
{ "csprng", cmd__csprng },
- { "ctype", cmd__ctype },
{ "date", cmd__date },
+ { "delete-gpgsig", cmd__delete_gpgsig },
{ "delta", cmd__delta },
{ "dir-iterator", cmd__dir_iterator },
{ "drop-caches", cmd__drop_caches },
@@ -30,8 +28,9 @@ static struct test_cmd cmds[] = {
{ "dump-fsmonitor", cmd__dump_fsmonitor },
{ "dump-split-index", cmd__dump_split_index },
{ "dump-untracked-cache", cmd__dump_untracked_cache },
+ { "env-helper", cmd__env_helper },
{ "example-decorate", cmd__example_decorate },
- { "fast-rebase", cmd__fast_rebase },
+ { "find-pack", cmd__find_pack },
{ "fsmonitor-client", cmd__fsmonitor_client },
{ "genrandom", cmd__genrandom },
{ "genzeros", cmd__genzeros },
@@ -39,7 +38,6 @@ static struct test_cmd cmds[] = {
{ "hashmap", cmd__hashmap },
{ "hash-speed", cmd__hash_speed },
{ "hexdump", cmd__hexdump },
- { "index-version", cmd__index_version },
{ "json-writer", cmd__json_writer },
{ "lazy-init-name-hash", cmd__lazy_init_name_hash },
{ "match-trees", cmd__match_trees },
@@ -51,12 +49,13 @@ static struct test_cmd cmds[] = {
{ "online-cpus", cmd__online_cpus },
{ "pack-mtimes", cmd__pack_mtimes },
{ "parse-options", cmd__parse_options },
+ { "parse-options-flags", cmd__parse_options_flags },
{ "parse-pathspec-file", cmd__parse_pathspec_file },
+ { "parse-subcommand", cmd__parse_subcommand },
{ "partial-clone", cmd__partial_clone },
{ "path-utils", cmd__path_utils },
{ "pcre2-config", cmd__pcre2_config },
{ "pkt-line", cmd__pkt_line },
- { "prio-queue", cmd__prio_queue },
{ "proc-receive", cmd__proc_receive },
{ "progress", cmd__progress },
{ "reach", cmd__reach },
@@ -65,6 +64,7 @@ static struct test_cmd cmds[] = {
{ "read-midx", cmd__read_midx },
{ "ref-store", cmd__ref_store },
{ "reftable", cmd__reftable },
+ { "rot13-filter", cmd__rot13_filter },
{ "dump-reftable", cmd__dump_reftable },
{ "regex", cmd__regex },
{ "repository", cmd__repository },
@@ -73,15 +73,18 @@ static struct test_cmd cmds[] = {
{ "scrap-cache-tree", cmd__scrap_cache_tree },
{ "serve-v2", cmd__serve_v2 },
{ "sha1", cmd__sha1 },
+ { "sha1-is-sha1dc", cmd__sha1_is_sha1dc },
{ "sha256", cmd__sha256 },
{ "sigchain", cmd__sigchain },
{ "simple-ipc", cmd__simple_ipc },
{ "strcmp-offset", cmd__strcmp_offset },
{ "string-list", cmd__string_list },
+ { "submodule", cmd__submodule },
{ "submodule-config", cmd__submodule_config },
{ "submodule-nested-repo-config", cmd__submodule_nested_repo_config },
{ "subprocess", cmd__subprocess },
{ "trace2", cmd__trace2 },
+ { "truncate", cmd__truncate },
{ "userdiff", cmd__userdiff },
{ "urlmatch-normalization", cmd__urlmatch_normalization },
{ "xml-encode", cmd__xml_encode },
diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h
index bb79927..2808b92 100644
--- a/t/helper/test-tool.h
+++ b/t/helper/test-tool.h
@@ -1,19 +1,20 @@
#ifndef TEST_TOOL_H
#define TEST_TOOL_H
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
#include "git-compat-util.h"
int cmd__advise_if_enabled(int argc, const char **argv);
int cmd__bitmap(int argc, const char **argv);
int cmd__bloom(int argc, const char **argv);
+int cmd__bundle_uri(int argc, const char **argv);
+int cmd__cache_tree(int argc, const char **argv);
int cmd__chmtime(int argc, const char **argv);
int cmd__config(int argc, const char **argv);
int cmd__crontab(int argc, const char **argv);
int cmd__csprng(int argc, const char **argv);
-int cmd__ctype(int argc, const char **argv);
int cmd__date(int argc, const char **argv);
int cmd__delta(int argc, const char **argv);
+int cmd__delete_gpgsig(int argc, const char **argv);
int cmd__dir_iterator(int argc, const char **argv);
int cmd__drop_caches(int argc, const char **argv);
int cmd__dump_cache_tree(int argc, const char **argv);
@@ -21,8 +22,9 @@ int cmd__dump_fsmonitor(int argc, const char **argv);
int cmd__dump_split_index(int argc, const char **argv);
int cmd__dump_untracked_cache(int argc, const char **argv);
int cmd__dump_reftable(int argc, const char **argv);
+int cmd__env_helper(int argc, const char **argv);
int cmd__example_decorate(int argc, const char **argv);
-int cmd__fast_rebase(int argc, const char **argv);
+int cmd__find_pack(int argc, const char **argv);
int cmd__fsmonitor_client(int argc, const char **argv);
int cmd__genrandom(int argc, const char **argv);
int cmd__genzeros(int argc, const char **argv);
@@ -30,7 +32,6 @@ int cmd__getcwd(int argc, const char **argv);
int cmd__hashmap(int argc, const char **argv);
int cmd__hash_speed(int argc, const char **argv);
int cmd__hexdump(int argc, const char **argv);
-int cmd__index_version(int argc, const char **argv);
int cmd__json_writer(int argc, const char **argv);
int cmd__lazy_init_name_hash(int argc, const char **argv);
int cmd__match_trees(int argc, const char **argv);
@@ -41,12 +42,13 @@ int cmd__oidtree(int argc, const char **argv);
int cmd__online_cpus(int argc, const char **argv);
int cmd__pack_mtimes(int argc, const char **argv);
int cmd__parse_options(int argc, const char **argv);
+int cmd__parse_options_flags(int argc, const char **argv);
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__pcre2_config(int argc, const char **argv);
int cmd__pkt_line(int argc, const char **argv);
-int cmd__prio_queue(int argc, const char **argv);
int cmd__proc_receive(int argc, const char **argv);
int cmd__progress(int argc, const char **argv);
int cmd__reach(int argc, const char **argv);
@@ -54,6 +56,7 @@ int cmd__read_cache(int argc, const char **argv);
int cmd__read_graph(int argc, const char **argv);
int cmd__read_midx(int argc, const char **argv);
int cmd__ref_store(int argc, const char **argv);
+int cmd__rot13_filter(int argc, const char **argv);
int cmd__reftable(int argc, const char **argv);
int cmd__regex(int argc, const char **argv);
int cmd__repository(int argc, const char **argv);
@@ -62,16 +65,19 @@ int cmd__run_command(int argc, const char **argv);
int cmd__scrap_cache_tree(int argc, const char **argv);
int cmd__serve_v2(int argc, const char **argv);
int cmd__sha1(int argc, const char **argv);
+int cmd__sha1_is_sha1dc(int argc, const char **argv);
int cmd__oid_array(int argc, const char **argv);
int cmd__sha256(int argc, const char **argv);
int cmd__sigchain(int argc, const char **argv);
int cmd__simple_ipc(int argc, const char **argv);
int cmd__strcmp_offset(int argc, const char **argv);
int cmd__string_list(int argc, const char **argv);
+int cmd__submodule(int argc, const char **argv);
int cmd__submodule_config(int argc, const char **argv);
int cmd__submodule_nested_repo_config(int argc, const char **argv);
int cmd__subprocess(int argc, const char **argv);
int cmd__trace2(int argc, const char **argv);
+int cmd__truncate(int argc, const char **argv);
int cmd__userdiff(int argc, const char **argv);
int cmd__urlmatch_normalization(int argc, const char **argv);
int cmd__xml_encode(int argc, const char **argv);
diff --git a/t/helper/test-trace2.c b/t/helper/test-trace2.c
index a714130..1adac29 100644
--- a/t/helper/test-trace2.c
+++ b/t/helper/test-trace2.c
@@ -1,9 +1,10 @@
#include "test-tool.h"
-#include "cache.h"
#include "strvec.h"
#include "run-command.h"
#include "exec-cmd.h"
#include "config.h"
+#include "repository.h"
+#include "trace2.h"
typedef int(fn_unit_test)(int argc, const char **argv);
@@ -44,7 +45,7 @@ static int get_i(int *p_value, const char *data)
* [] "def_param" events for all of the "interesting" pre-defined
* config settings.
*/
-static int ut_001return(int argc, const char **argv)
+static int ut_001return(int argc UNUSED, const char **argv)
{
int rc;
@@ -64,7 +65,7 @@ static int ut_001return(int argc, const char **argv)
* [] "def_param" events for all of the "interesting" pre-defined
* config settings.
*/
-static int ut_002exit(int argc, const char **argv)
+static int ut_002exit(int argc UNUSED, const char **argv)
{
int rc;
@@ -132,6 +133,7 @@ static int ut_003error(int argc, const char **argv)
*/
static int ut_004child(int argc, const char **argv)
{
+ struct child_process cmd = CHILD_PROCESS_INIT;
int result;
/*
@@ -141,7 +143,8 @@ static int ut_004child(int argc, const char **argv)
if (!argc)
return 0;
- result = run_command_v_opt(argv, 0);
+ strvec_pushv(&cmd.args, argv);
+ result = run_command(&cmd);
exit(result);
}
@@ -198,7 +201,7 @@ static int ut_006data(int argc, const char **argv)
return 0;
}
-static int ut_007BUG(int argc, const char **argv)
+static int ut_007BUG(int argc UNUSED, const char **argv UNUSED)
{
/*
* Exercise BUG() to ensure that the message is printed to trace2.
@@ -206,7 +209,7 @@ static int ut_007BUG(int argc, const char **argv)
BUG("the bug message");
}
-static int ut_008bug(int argc, const char **argv)
+static int ut_008bug(int argc UNUSED, const char **argv UNUSED)
{
bug("a bug message");
bug("another bug message");
@@ -214,7 +217,7 @@ static int ut_008bug(int argc, const char **argv)
return 0;
}
-static int ut_009bug_BUG(int argc, const char **argv)
+static int ut_009bug_BUG(int argc UNUSED, const char **argv UNUSED)
{
bug("a bug message");
bug("another bug message");
@@ -222,13 +225,244 @@ static int ut_009bug_BUG(int argc, const char **argv)
return 0;
}
-static int ut_010bug_BUG(int argc, const char **argv)
+static int ut_010bug_BUG(int argc UNUSED, const char **argv UNUSED)
{
bug("a %s message", "bug");
BUG("a %s message", "BUG");
}
/*
+ * Single-threaded timer test. Create several intervals using the
+ * TEST1 timer. The test script can verify that an aggregate Trace2
+ * "timer" event is emitted indicating that we started+stopped the
+ * timer the requested number of times.
+ */
+static int ut_100timer(int argc, const char **argv)
+{
+ const char *usage_error =
+ "expect <count> <ms_delay>";
+
+ int count = 0;
+ int delay = 0;
+ int k;
+
+ if (argc != 2)
+ die("%s", usage_error);
+ if (get_i(&count, argv[0]))
+ die("%s", usage_error);
+ if (get_i(&delay, argv[1]))
+ die("%s", usage_error);
+
+ for (k = 0; k < count; k++) {
+ trace2_timer_start(TRACE2_TIMER_ID_TEST1);
+ sleep_millisec(delay);
+ trace2_timer_stop(TRACE2_TIMER_ID_TEST1);
+ }
+
+ return 0;
+}
+
+struct ut_101_data {
+ int count;
+ int delay;
+};
+
+static void *ut_101timer_thread_proc(void *_ut_101_data)
+{
+ struct ut_101_data *data = _ut_101_data;
+ int k;
+
+ trace2_thread_start("ut_101");
+
+ for (k = 0; k < data->count; k++) {
+ trace2_timer_start(TRACE2_TIMER_ID_TEST2);
+ sleep_millisec(data->delay);
+ trace2_timer_stop(TRACE2_TIMER_ID_TEST2);
+ }
+
+ trace2_thread_exit();
+ return NULL;
+}
+
+/*
+ * Multi-threaded timer test. Create several threads that each create
+ * several intervals using the TEST2 timer. The test script can verify
+ * that an individual Trace2 "th_timer" events for each thread and an
+ * aggregate "timer" event are generated.
+ */
+static int ut_101timer(int argc, const char **argv)
+{
+ const char *usage_error =
+ "expect <count> <ms_delay> <threads>";
+
+ struct ut_101_data data = { 0, 0 };
+ int nr_threads = 0;
+ int k;
+ pthread_t *pids = NULL;
+
+ if (argc != 3)
+ die("%s", usage_error);
+ if (get_i(&data.count, argv[0]))
+ die("%s", usage_error);
+ if (get_i(&data.delay, argv[1]))
+ die("%s", usage_error);
+ if (get_i(&nr_threads, argv[2]))
+ die("%s", usage_error);
+
+ CALLOC_ARRAY(pids, nr_threads);
+
+ for (k = 0; k < nr_threads; k++) {
+ if (pthread_create(&pids[k], NULL, ut_101timer_thread_proc, &data))
+ die("failed to create thread[%d]", k);
+ }
+
+ for (k = 0; k < nr_threads; k++) {
+ if (pthread_join(pids[k], NULL))
+ die("failed to join thread[%d]", k);
+ }
+
+ free(pids);
+
+ return 0;
+}
+
+/*
+ * Single-threaded counter test. Add several values to the TEST1 counter.
+ * The test script can verify that the final sum is reported in the "counter"
+ * event.
+ */
+static int ut_200counter(int argc, const char **argv)
+{
+ const char *usage_error =
+ "expect <v1> [<v2> [...]]";
+ int value;
+ int k;
+
+ if (argc < 1)
+ die("%s", usage_error);
+
+ for (k = 0; k < argc; k++) {
+ if (get_i(&value, argv[k]))
+ die("invalid value[%s] -- %s",
+ argv[k], usage_error);
+ trace2_counter_add(TRACE2_COUNTER_ID_TEST1, value);
+ }
+
+ return 0;
+}
+
+/*
+ * Multi-threaded counter test. Create seveal threads that each increment
+ * the TEST2 global counter. The test script can verify that an individual
+ * "th_counter" event is generated with a partial sum for each thread and
+ * that a final aggregate "counter" event is generated.
+ */
+
+struct ut_201_data {
+ int v1;
+ int v2;
+};
+
+static void *ut_201counter_thread_proc(void *_ut_201_data)
+{
+ struct ut_201_data *data = _ut_201_data;
+
+ trace2_thread_start("ut_201");
+
+ trace2_counter_add(TRACE2_COUNTER_ID_TEST2, data->v1);
+ trace2_counter_add(TRACE2_COUNTER_ID_TEST2, data->v2);
+
+ trace2_thread_exit();
+ return NULL;
+}
+
+static int ut_201counter(int argc, const char **argv)
+{
+ const char *usage_error =
+ "expect <v1> <v2> <threads>";
+
+ struct ut_201_data data = { 0, 0 };
+ int nr_threads = 0;
+ int k;
+ pthread_t *pids = NULL;
+
+ if (argc != 3)
+ die("%s", usage_error);
+ if (get_i(&data.v1, argv[0]))
+ die("%s", usage_error);
+ if (get_i(&data.v2, argv[1]))
+ die("%s", usage_error);
+ if (get_i(&nr_threads, argv[2]))
+ die("%s", usage_error);
+
+ CALLOC_ARRAY(pids, nr_threads);
+
+ for (k = 0; k < nr_threads; k++) {
+ if (pthread_create(&pids[k], NULL, ut_201counter_thread_proc, &data))
+ die("failed to create thread[%d]", k);
+ }
+
+ for (k = 0; k < nr_threads; k++) {
+ if (pthread_join(pids[k], NULL))
+ die("failed to join thread[%d]", k);
+ }
+
+ free(pids);
+
+ return 0;
+}
+
+static int ut_300redact_start(int argc, const char **argv)
+{
+ if (!argc)
+ die("expect <argv...>");
+
+ trace2_cmd_start(argv);
+
+ return 0;
+}
+
+static int ut_301redact_child_start(int argc, const char **argv)
+{
+ struct child_process cmd = CHILD_PROCESS_INIT;
+ int k;
+
+ if (!argc)
+ die("expect <argv...>");
+
+ for (k = 0; argv[k]; k++)
+ strvec_push(&cmd.args, argv[k]);
+
+ trace2_child_start(&cmd);
+
+ strvec_clear(&cmd.args);
+
+ return 0;
+}
+
+static int ut_302redact_exec(int argc, const char **argv)
+{
+ if (!argc)
+ die("expect <exe> <argv...>");
+
+ trace2_exec(argv[0], &argv[1]);
+
+ return 0;
+}
+
+static int ut_303redact_def_param(int argc, const char **argv)
+{
+ struct key_value_info kvi = KVI_INIT;
+
+ if (argc < 2)
+ die("expect <key> <value>");
+
+ trace2_def_param(argv[0], argv[1], &kvi);
+
+ return 0;
+}
+
+/*
* Usage:
* test-tool trace2 <ut_name_1> <ut_usage_1>
* test-tool trace2 <ut_name_2> <ut_usage_2>
@@ -248,6 +482,17 @@ static struct unit_test ut_table[] = {
{ ut_008bug, "008bug", "" },
{ ut_009bug_BUG, "009bug_BUG","" },
{ ut_010bug_BUG, "010bug_BUG","" },
+
+ { ut_100timer, "100timer", "<count> <ms_delay>" },
+ { ut_101timer, "101timer", "<count> <ms_delay> <threads>" },
+
+ { ut_200counter, "200counter", "<v1> [<v2> [<v3> [...]]]" },
+ { ut_201counter, "201counter", "<v1> <v2> <threads>" },
+
+ { ut_300redact_start, "300redact_start", "<argv...>" },
+ { ut_301redact_child_start, "301redact_child_start", "<argv...>" },
+ { ut_302redact_exec, "302redact_exec", "<exe> <argv...>" },
+ { ut_303redact_def_param, "303redact_def_param", "<key> <value>" },
};
/* clang-format on */
diff --git a/t/helper/test-truncate.c b/t/helper/test-truncate.c
new file mode 100644
index 0000000..3931dea
--- /dev/null
+++ b/t/helper/test-truncate.c
@@ -0,0 +1,25 @@
+#include "test-tool.h"
+#include "git-compat-util.h"
+
+/*
+ * Truncate a file to the given size.
+ */
+int cmd__truncate(int argc, const char **argv)
+{
+ char *p = NULL;
+ uintmax_t sz = 0;
+ int fd = -1;
+
+ if (argc != 3)
+ die("expected filename and size");
+
+ sz = strtoumax(argv[2], &p, 0);
+ if (*p)
+ die("invalid size");
+
+ fd = xopen(argv[1], O_WRONLY | O_CREAT, 0600);
+
+ if (ftruncate(fd, (off_t) sz) < 0)
+ die_errno("failed to truncate file");
+ return 0;
+}
diff --git a/t/helper/test-urlmatch-normalization.c b/t/helper/test-urlmatch-normalization.c
index 8f4d67e..86edd45 100644
--- a/t/helper/test-urlmatch-normalization.c
+++ b/t/helper/test-urlmatch-normalization.c
@@ -5,8 +5,9 @@
int cmd__urlmatch_normalization(int argc, const char **argv)
{
const char usage[] = "test-tool urlmatch-normalization [-p | -l] <url1> | <url1> <url2>";
- char *url1, *url2;
+ char *url1 = NULL, *url2 = NULL;
int opt_p = 0, opt_l = 0;
+ int ret = 0;
/*
* For one url, succeed if url_normalize succeeds on it, fail otherwise.
@@ -39,7 +40,7 @@ int cmd__urlmatch_normalization(int argc, const char **argv)
printf("%s\n", url1);
if (opt_l)
printf("%u\n", (unsigned)info.url_len);
- return 0;
+ goto cleanup;
}
if (opt_p || opt_l)
@@ -47,5 +48,9 @@ int cmd__urlmatch_normalization(int argc, const char **argv)
url1 = url_normalize(argv[1], NULL);
url2 = url_normalize(argv[2], NULL);
- return (url1 && url2 && !strcmp(url1, url2)) ? 0 : 1;
+ ret = (url1 && url2 && !strcmp(url1, url2)) ? 0 : 1;
+cleanup:
+ free(url1);
+ free(url2);
+ return ret;
}
diff --git a/t/helper/test-userdiff.c b/t/helper/test-userdiff.c
index f013f8a..0ce31ce 100644
--- a/t/helper/test-userdiff.c
+++ b/t/helper/test-userdiff.c
@@ -1,5 +1,5 @@
#include "test-tool.h"
-#include "cache.h"
+#include "setup.h"
#include "userdiff.h"
#include "config.h"
@@ -12,7 +12,9 @@ static int driver_cb(struct userdiff_driver *driver,
return 0;
}
-static int cmd__userdiff_config(const char *var, const char *value, void *cb)
+static int cmd__userdiff_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *cb UNUSED)
{
if (userdiff_config(var, value) < 0)
return -1;
diff --git a/t/helper/test-wildmatch.c b/t/helper/test-wildmatch.c
index 2c103d1..b4ff5f9 100644
--- a/t/helper/test-wildmatch.c
+++ b/t/helper/test-wildmatch.c
@@ -1,5 +1,5 @@
#include "test-tool.h"
-#include "cache.h"
+#include "wildmatch.h"
int cmd__wildmatch(int argc, const char **argv)
{
diff --git a/t/helper/test-write-cache.c b/t/helper/test-write-cache.c
index 8837717..f084034 100644
--- a/t/helper/test-write-cache.c
+++ b/t/helper/test-write-cache.c
@@ -1,6 +1,9 @@
+#define USE_THE_INDEX_VARIABLE
#include "test-tool.h"
-#include "cache.h"
#include "lockfile.h"
+#include "read-cache-ll.h"
+#include "repository.h"
+#include "setup.h"
int cmd__write_cache(int argc, const char **argv)
{
@@ -9,9 +12,10 @@ int cmd__write_cache(int argc, const char **argv)
if (argc == 2)
cnt = strtol(argv[1], NULL, 0);
setup_git_directory();
- read_cache();
+ repo_read_index(the_repository);
for (i = 0; i < cnt; i++) {
- hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
+ repo_hold_locked_index(the_repository, &index_lock,
+ LOCK_DIE_ON_ERROR);
if (write_locked_index(&the_index, &index_lock, COMMIT_LOCK))
die("unable to write index file");
}
diff --git a/t/helper/test-xml-encode.c b/t/helper/test-xml-encode.c
index a648bbd..b2f330d 100644
--- a/t/helper/test-xml-encode.c
+++ b/t/helper/test-xml-encode.c
@@ -6,7 +6,7 @@ static const char *utf8_replace_character = "&#xfffd;";
* Encodes (possibly incorrect) UTF-8 on <stdin> to <stdout>, to be embedded
* in an XML file.
*/
-int cmd__xml_encode(int argc, const char **argv)
+int cmd__xml_encode(int argc UNUSED, const char **argv UNUSED)
{
unsigned char buf[1024], tmp[4], *tmp2 = NULL;
ssize_t cur = 0, len = 1, remaining = 0;
diff --git a/t/interop/interop-lib.sh b/t/interop/interop-lib.sh
index 3e0a291..62f4481 100644
--- a/t/interop/interop-lib.sh
+++ b/t/interop/interop-lib.sh
@@ -68,7 +68,7 @@ generate_wrappers () {
wrap_git .bin/git.a "$DIR_A" &&
wrap_git .bin/git.b "$DIR_B" &&
write_script .bin/git <<-\EOF &&
- echo >&2 fatal: test tried to run generic git
+ echo >&2 fatal: test tried to run generic git: $*
exit 1
EOF
PATH=$(pwd)/.bin:$PATH
diff --git a/t/lib-bitmap.sh b/t/lib-bitmap.sh
index a95537e..f595937 100644
--- a/t/lib-bitmap.sh
+++ b/t/lib-bitmap.sh
@@ -440,7 +440,7 @@ midx_bitmap_partial_tests () {
test_commit packed &&
git repack &&
test_commit loose &&
- git multi-pack-index write --bitmap 2>err &&
+ git multi-pack-index write --bitmap &&
test_path_is_file $midx &&
test_path_is_file $midx-$(midx_checksum $objdir).bitmap
'
diff --git a/t/lib-bundle-uri-protocol.sh b/t/lib-bundle-uri-protocol.sh
new file mode 100644
index 0000000..a4a1af8
--- /dev/null
+++ b/t/lib-bundle-uri-protocol.sh
@@ -0,0 +1,216 @@
+# Set up and run tests of the 'bundle-uri' command in protocol v2
+#
+# The test that includes this script should set BUNDLE_URI_PROTOCOL
+# to one of "file", "git", or "http".
+
+BUNDLE_URI_TEST_PARENT=
+BUNDLE_URI_TEST_URI=
+BUNDLE_URI_TEST_BUNDLE_URI=
+case "$BUNDLE_URI_PROTOCOL" in
+file)
+ BUNDLE_URI_PARENT=file_parent
+ BUNDLE_URI_REPO_URI="file://$PWD/file_parent"
+ BUNDLE_URI_BUNDLE_URI="$BUNDLE_URI_REPO_URI/fake.bdl"
+ test_set_prereq BUNDLE_URI_FILE
+ ;;
+git)
+ . "$TEST_DIRECTORY"/lib-git-daemon.sh
+ start_git_daemon --export-all --enable=receive-pack
+ BUNDLE_URI_PARENT="$GIT_DAEMON_DOCUMENT_ROOT_PATH/parent"
+ BUNDLE_URI_REPO_URI="$GIT_DAEMON_URL/parent"
+ BUNDLE_URI_BUNDLE_URI="https://example.com/fake.bdl"
+ test_set_prereq BUNDLE_URI_GIT
+ ;;
+http)
+ . "$TEST_DIRECTORY"/lib-httpd.sh
+ start_httpd
+ BUNDLE_URI_PARENT="$HTTPD_DOCUMENT_ROOT_PATH/http_parent"
+ BUNDLE_URI_REPO_URI="$HTTPD_URL/smart/http_parent"
+ BUNDLE_URI_BUNDLE_URI="https://example.com/fake.bdl"
+ test_set_prereq BUNDLE_URI_HTTP
+ ;;
+*)
+ BUG "Need to pass valid BUNDLE_URI_PROTOCOL (was \"$BUNDLE_URI_PROTOCOL\")"
+ ;;
+esac
+
+test_expect_success "setup protocol v2 $BUNDLE_URI_PROTOCOL:// tests" '
+ git init "$BUNDLE_URI_PARENT" &&
+ test_commit -C "$BUNDLE_URI_PARENT" one &&
+ git -C "$BUNDLE_URI_PARENT" config uploadpack.advertiseBundleURIs true
+'
+
+case "$BUNDLE_URI_PROTOCOL" in
+http)
+ test_expect_success "setup config for $BUNDLE_URI_PROTOCOL:// tests" '
+ git -C "$BUNDLE_URI_PARENT" config http.receivepack true
+ '
+ ;;
+*)
+ ;;
+esac
+BUNDLE_URI_BUNDLE_URI_ESCAPED=$(echo "$BUNDLE_URI_BUNDLE_URI" | test_uri_escape)
+
+test_expect_success "connect with $BUNDLE_URI_PROTOCOL:// using protocol v2: no bundle-uri" '
+ test_when_finished "rm -f log" &&
+ test_when_finished "git -C \"$BUNDLE_URI_PARENT\" config uploadpack.advertiseBundleURIs true" &&
+ git -C "$BUNDLE_URI_PARENT" config uploadpack.advertiseBundleURIs false &&
+
+ GIT_TRACE_PACKET="$PWD/log" \
+ git \
+ -c protocol.version=2 \
+ ls-remote --symref "$BUNDLE_URI_REPO_URI" \
+ >actual 2>err &&
+
+ # Server responded using protocol v2
+ grep "< version 2" log &&
+
+ ! grep bundle-uri log
+'
+
+test_expect_success "connect with $BUNDLE_URI_PROTOCOL:// using protocol v2: have bundle-uri" '
+ test_when_finished "rm -f log" &&
+
+ GIT_TRACE_PACKET="$PWD/log" \
+ git \
+ -c protocol.version=2 \
+ ls-remote --symref "$BUNDLE_URI_REPO_URI" \
+ >actual 2>err &&
+
+ # Server responded using protocol v2
+ grep "< version 2" log &&
+
+ # Server advertised bundle-uri capability
+ grep "< bundle-uri" log
+'
+
+test_expect_success "clone with $BUNDLE_URI_PROTOCOL:// using protocol v2: request bundle-uris" '
+ test_when_finished "rm -rf log* cloned*" &&
+
+ GIT_TRACE_PACKET="$PWD/log" \
+ git \
+ -c transfer.bundleURI=false \
+ -c protocol.version=2 \
+ clone "$BUNDLE_URI_REPO_URI" cloned \
+ >actual 2>err &&
+
+ # Server responded using protocol v2
+ grep "< version 2" log &&
+
+ # Server advertised bundle-uri capability
+ grep "< bundle-uri" log &&
+
+ # Client did not issue bundle-uri command
+ ! grep "> command=bundle-uri" log &&
+
+ GIT_TRACE_PACKET="$PWD/log" \
+ git \
+ -c transfer.bundleURI=true \
+ -c protocol.version=2 \
+ clone "$BUNDLE_URI_REPO_URI" cloned2 \
+ >actual 2>err &&
+
+ # Server responded using protocol v2
+ grep "< version 2" log &&
+
+ # Server advertised bundle-uri capability
+ grep "< bundle-uri" log &&
+
+ # Client issued bundle-uri command
+ grep "> command=bundle-uri" log &&
+
+ GIT_TRACE_PACKET="$PWD/log3" \
+ git \
+ -c transfer.bundleURI=true \
+ -c protocol.version=2 \
+ clone --bundle-uri="$BUNDLE_URI_BUNDLE_URI" \
+ "$BUNDLE_URI_REPO_URI" cloned3 \
+ >actual 2>err &&
+
+ # Server responded using protocol v2
+ grep "< version 2" log3 &&
+
+ # Server advertised bundle-uri capability
+ grep "< bundle-uri" log3 &&
+
+ # Client did not issue bundle-uri command (--bundle-uri override)
+ ! grep "> command=bundle-uri" log3
+'
+
+# The remaining tests will all assume transfer.bundleURI=true
+#
+# This test can be removed when transfer.bundleURI is enabled by default.
+test_expect_success 'enable transfer.bundleURI for remaining tests' '
+ git config --global transfer.bundleURI true
+'
+
+test_expect_success "test bundle-uri with $BUNDLE_URI_PROTOCOL:// using protocol v2" '
+ test_config -C "$BUNDLE_URI_PARENT" \
+ bundle.only.uri "$BUNDLE_URI_BUNDLE_URI_ESCAPED" &&
+
+ # All data about bundle URIs
+ cat >expect <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ [bundle "only"]
+ uri = $BUNDLE_URI_BUNDLE_URI_ESCAPED
+ EOF
+
+ test-tool bundle-uri \
+ ls-remote \
+ "$BUNDLE_URI_REPO_URI" \
+ >actual &&
+ test_cmp_config_output expect actual
+'
+
+test_expect_success "test bundle-uri with $BUNDLE_URI_PROTOCOL:// using protocol v2 and extra data" '
+ test_config -C "$BUNDLE_URI_PARENT" \
+ bundle.only.uri "$BUNDLE_URI_BUNDLE_URI_ESCAPED" &&
+
+ # Extra data should be ignored
+ test_config -C "$BUNDLE_URI_PARENT" bundle.only.extra bogus &&
+
+ # All data about bundle URIs
+ cat >expect <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ [bundle "only"]
+ uri = $BUNDLE_URI_BUNDLE_URI_ESCAPED
+ EOF
+
+ test-tool bundle-uri \
+ ls-remote \
+ "$BUNDLE_URI_REPO_URI" \
+ >actual &&
+ test_cmp_config_output expect actual
+'
+
+test_expect_success "test bundle-uri with $BUNDLE_URI_PROTOCOL:// using protocol v2 with list" '
+ test_config -C "$BUNDLE_URI_PARENT" \
+ bundle.bundle1.uri "$BUNDLE_URI_BUNDLE_URI_ESCAPED-1.bdl" &&
+ test_config -C "$BUNDLE_URI_PARENT" \
+ bundle.bundle2.uri "$BUNDLE_URI_BUNDLE_URI_ESCAPED-2.bdl" &&
+ test_config -C "$BUNDLE_URI_PARENT" \
+ bundle.bundle3.uri "$BUNDLE_URI_BUNDLE_URI_ESCAPED-3.bdl" &&
+
+ # All data about bundle URIs
+ cat >expect <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ [bundle "bundle1"]
+ uri = $BUNDLE_URI_BUNDLE_URI_ESCAPED-1.bdl
+ [bundle "bundle2"]
+ uri = $BUNDLE_URI_BUNDLE_URI_ESCAPED-2.bdl
+ [bundle "bundle3"]
+ uri = $BUNDLE_URI_BUNDLE_URI_ESCAPED-3.bdl
+ EOF
+
+ test-tool bundle-uri \
+ ls-remote \
+ "$BUNDLE_URI_REPO_URI" \
+ >actual &&
+ test_cmp_config_output expect actual
+'
diff --git a/t/lib-chunk.sh b/t/lib-chunk.sh
new file mode 100644
index 0000000..a7cd9c3
--- /dev/null
+++ b/t/lib-chunk.sh
@@ -0,0 +1,17 @@
+# Shell library for working with "chunk" files (commit-graph, midx, etc).
+
+# corrupt_chunk_file <fn> <chunk> <offset> <bytes>
+#
+# Corrupt a chunk-based file (like a commit-graph) by overwriting the bytes
+# found in the chunk specified by the 4-byte <chunk> identifier. If <offset> is
+# "clear", replace the chunk entirely. Otherwise, overwrite data <offset> bytes
+# into the chunk.
+#
+# The <bytes> are interpreted as pairs of hex digits (so "000000FE" would be
+# big-endian 254).
+corrupt_chunk_file () {
+ fn=$1; shift
+ perl "$TEST_DIRECTORY"/lib-chunk/corrupt-chunk-file.pl \
+ "$@" <"$fn" >"$fn.tmp" &&
+ mv "$fn.tmp" "$fn"
+}
diff --git a/t/lib-chunk/corrupt-chunk-file.pl b/t/lib-chunk/corrupt-chunk-file.pl
new file mode 100644
index 0000000..0e11aad
--- /dev/null
+++ b/t/lib-chunk/corrupt-chunk-file.pl
@@ -0,0 +1,90 @@
+#!/usr/bin/perl
+
+my ($chunk, $seek, $bytes) = @ARGV;
+$bytes =~ s/../chr(hex($&))/ge;
+
+binmode STDIN;
+binmode STDOUT;
+
+# A few helpers to read bytes, or read and copy them to the
+# output.
+sub get {
+ my $n = shift;
+ return unless $n;
+ read(STDIN, my $buf, $n)
+ or die "read error or eof: $!\n";
+ return $buf;
+}
+sub copy {
+ my $buf = get(@_);
+ print $buf;
+ return $buf;
+}
+
+# Some platforms' perl builds don't support 64-bit integers, and hence do not
+# allow packing/unpacking quadwords with "Q". The chunk format uses 64-bit file
+# offsets to support files of any size, but in practice our test suite will
+# only use small files. So we can fake it by asking for two 32-bit values and
+# discarding the first (most significant) one, which is equivalent as long as
+# it's just zero.
+sub unpack_quad {
+ my $bytes = shift;
+ my ($n1, $n2) = unpack("NN", $bytes);
+ die "quad value exceeds 32 bits" if $n1;
+ return $n2;
+}
+sub pack_quad {
+ my $n = shift;
+ my $ret = pack("NN", 0, $n);
+ # double check that our original $n did not exceed the 32-bit limit.
+ # This is presumably impossible on a 32-bit system (which would have
+ # truncated much earlier), but would still alert us on a 64-bit build
+ # of a new test that would fail on a 32-bit build (though we'd
+ # presumably see the die() from unpack_quad() in such a case).
+ die "quad round-trip failed" if unpack_quad($ret) != $n;
+ return $ret;
+}
+
+# read until we find table-of-contents entry for chunk;
+# note that we cheat a bit by assuming 4-byte alignment and
+# that no ToC entry will accidentally look like a header.
+#
+# If we don't find the entry, copy() will hit EOF and exit
+# (which should cause the caller to fail the test).
+while (copy(4) ne $chunk) { }
+my $offset = unpack_quad(copy(8));
+
+# In clear mode, our length will change. So figure out
+# the length by comparing to the offset of the next chunk, and
+# then adjust that offset (and all subsequent) ones.
+my $len;
+if ($seek eq "clear") {
+ my $id;
+ do {
+ $id = copy(4);
+ my $next = unpack_quad(get(8));
+ if (!defined $len) {
+ $len = $next - $offset;
+ }
+ print pack_quad($next - $len + length($bytes));
+ } while (unpack("N", $id));
+}
+
+# and now copy up to our existing chunk data
+copy($offset - tell(STDIN));
+if ($seek eq "clear") {
+ # if clearing, skip past existing data
+ get($len);
+} else {
+ # otherwise, copy up to the requested offset,
+ # and skip past the overwritten bytes
+ copy($seek);
+ get(length($bytes));
+}
+
+# now write out the requested bytes, along
+# with any other remaining data
+print $bytes;
+while (read(STDIN, my $buf, 4096)) {
+ print $buf;
+}
diff --git a/t/lib-commit-graph.sh b/t/lib-commit-graph.sh
index 5d79e1a..89b2667 100755
--- a/t/lib-commit-graph.sh
+++ b/t/lib-commit-graph.sh
@@ -14,24 +14,37 @@ graph_git_two_modes() {
test_cmp expect output
}
+# graph_git_behavior <name> <directory> <branch> <compare>
+#
+# Ensures that a handful of traversal operations produce the same
+# results with and without the commit-graph in use.
+#
+# NOTE: it is a bug to call this function with <directory> containing
+# any characters in $IFS.
graph_git_behavior() {
MSG=$1
DIR=$2
BRANCH=$3
COMPARE=$4
test_expect_success "check normal git operations: $MSG" '
- cd "$TRASH_DIRECTORY/$DIR" &&
- graph_git_two_modes "log --oneline $BRANCH" &&
- graph_git_two_modes "log --topo-order $BRANCH" &&
- graph_git_two_modes "log --graph $COMPARE..$BRANCH" &&
- graph_git_two_modes "branch -vv" &&
- graph_git_two_modes "merge-base -a $BRANCH $COMPARE"
+ graph_git_two_modes "${DIR:+-C $DIR} log --oneline $BRANCH" &&
+ graph_git_two_modes "${DIR:+-C $DIR} log --topo-order $BRANCH" &&
+ graph_git_two_modes "${DIR:+-C $DIR} log --graph $COMPARE..$BRANCH" &&
+ graph_git_two_modes "${DIR:+-C $DIR} branch -vv" &&
+ graph_git_two_modes "${DIR:+-C $DIR} merge-base -a $BRANCH $COMPARE"
'
}
graph_read_expect() {
OPTIONAL=""
NUM_CHUNKS=3
+ DIR="."
+ if test "$1" = -C
+ then
+ shift
+ DIR="$1"
+ shift
+ fi
if test -n "$2"
then
OPTIONAL=" $2"
@@ -47,12 +60,15 @@ graph_read_expect() {
then
OPTIONS=" read_generation_data"
fi
- cat >expect <<- EOF
+ cat >"$DIR/expect" <<-EOF
header: 43475048 1 $(test_oid oid_version) $NUM_CHUNKS 0
num_commits: $1
chunks: oid_fanout oid_lookup commit_metadata$OPTIONAL
options:$OPTIONS
EOF
- test-tool read-graph >output &&
- test_cmp expect output
+ (
+ cd "$DIR" &&
+ test-tool read-graph >output &&
+ test_cmp expect output
+ )
}
diff --git a/t/lib-credential.sh b/t/lib-credential.sh
index 5ea8bc9..44799c0 100644
--- a/t/lib-credential.sh
+++ b/t/lib-credential.sh
@@ -43,6 +43,14 @@ helper_test_clean() {
reject $1 https example.com store-user
reject $1 https example.com user1
reject $1 https example.com user2
+ reject $1 https example.com user-expiry
+ reject $1 https example.com user-expiry-overwrite
+ reject $1 https example.com user4
+ reject $1 https example.com user-distinct-pass
+ reject $1 https example.com user-overwrite
+ reject $1 https example.com user-erase1
+ reject $1 https example.com user-erase2
+ reject $1 https victim.example.com user
reject $1 http path.tld user
reject $1 https timeout.tld user
reject $1 https sso.tld
@@ -166,6 +174,49 @@ helper_test() {
EOF
'
+ test_expect_success "helper ($HELPER) overwrites on store" '
+ check approve $HELPER <<-\EOF &&
+ protocol=https
+ host=example.com
+ username=user-overwrite
+ password=pass1
+ EOF
+ check approve $HELPER <<-\EOF &&
+ protocol=https
+ host=example.com
+ username=user-overwrite
+ password=pass2
+ EOF
+ check fill $HELPER <<-\EOF &&
+ protocol=https
+ host=example.com
+ username=user-overwrite
+ --
+ protocol=https
+ host=example.com
+ username=user-overwrite
+ password=pass2
+ EOF
+ check reject $HELPER <<-\EOF &&
+ protocol=https
+ host=example.com
+ username=user-overwrite
+ password=pass2
+ EOF
+ check fill $HELPER <<-\EOF
+ protocol=https
+ host=example.com
+ username=user-overwrite
+ --
+ protocol=https
+ host=example.com
+ username=user-overwrite
+ password=askpass-password
+ --
+ askpass: Password for '\''https://user-overwrite@example.com'\'':
+ EOF
+ '
+
test_expect_success "helper ($HELPER) can forget host" '
check reject $HELPER <<-\EOF &&
protocol=https
@@ -220,6 +271,31 @@ helper_test() {
EOF
'
+ test_expect_success "helper ($HELPER) does not erase a password distinct from input" '
+ check approve $HELPER <<-\EOF &&
+ protocol=https
+ host=example.com
+ username=user-distinct-pass
+ password=pass1
+ EOF
+ check reject $HELPER <<-\EOF &&
+ protocol=https
+ host=example.com
+ username=user-distinct-pass
+ password=pass2
+ EOF
+ check fill $HELPER <<-\EOF
+ protocol=https
+ host=example.com
+ username=user-distinct-pass
+ --
+ protocol=https
+ host=example.com
+ username=user-distinct-pass
+ password=pass1
+ EOF
+ '
+
test_expect_success "helper ($HELPER) can forget user" '
check reject $HELPER <<-\EOF &&
protocol=https
@@ -270,6 +346,66 @@ helper_test() {
password=
EOF
'
+
+ test_expect_success "helper ($HELPER) erases all matching credentials" '
+ check approve $HELPER <<-\EOF &&
+ protocol=https
+ host=example.com
+ username=user-erase1
+ password=pass1
+ EOF
+ check approve $HELPER <<-\EOF &&
+ protocol=https
+ host=example.com
+ username=user-erase2
+ password=pass1
+ EOF
+ check reject $HELPER <<-\EOF &&
+ protocol=https
+ host=example.com
+ EOF
+ check fill $HELPER <<-\EOF
+ protocol=https
+ host=example.com
+ --
+ protocol=https
+ host=example.com
+ username=askpass-username
+ password=askpass-password
+ --
+ askpass: Username for '\''https://example.com'\'':
+ askpass: Password for '\''https://askpass-username@example.com'\'':
+ EOF
+ '
+
+ : ${GIT_TEST_LONG_CRED_BUFFER:=1024}
+ # 23 bytes accounts for "wwwauth[]=basic realm=" plus NUL
+ LONG_VALUE_LEN=$((GIT_TEST_LONG_CRED_BUFFER - 23))
+ LONG_VALUE=$(perl -e 'print "a" x shift' $LONG_VALUE_LEN)
+
+ test_expect_success "helper ($HELPER) not confused by long header" '
+ check approve $HELPER <<-\EOF &&
+ protocol=https
+ host=victim.example.com
+ username=user
+ password=to-be-stolen
+ EOF
+
+ check fill $HELPER <<-EOF
+ protocol=https
+ host=badguy.example.com
+ wwwauth[]=basic realm=${LONG_VALUE}host=victim.example.com
+ --
+ protocol=https
+ host=badguy.example.com
+ username=askpass-username
+ password=askpass-password
+ wwwauth[]=basic realm=${LONG_VALUE}host=victim.example.com
+ --
+ askpass: Username for '\''https://badguy.example.com'\'':
+ askpass: Password for '\''https://askpass-username@badguy.example.com'\'':
+ EOF
+ '
}
helper_test_timeout() {
@@ -298,6 +434,110 @@ helper_test_timeout() {
'
}
+helper_test_password_expiry_utc() {
+ HELPER=$1
+
+ test_expect_success "helper ($HELPER) stores password_expiry_utc" '
+ check approve $HELPER <<-\EOF
+ protocol=https
+ host=example.com
+ username=user-expiry
+ password=pass
+ password_expiry_utc=9999999999
+ EOF
+ '
+
+ test_expect_success "helper ($HELPER) gets password_expiry_utc" '
+ check fill $HELPER <<-\EOF
+ protocol=https
+ host=example.com
+ username=user-expiry
+ --
+ protocol=https
+ host=example.com
+ username=user-expiry
+ password=pass
+ password_expiry_utc=9999999999
+ --
+ EOF
+ '
+
+ test_expect_success "helper ($HELPER) overwrites when password_expiry_utc changes" '
+ check approve $HELPER <<-\EOF &&
+ protocol=https
+ host=example.com
+ username=user-expiry-overwrite
+ password=pass1
+ password_expiry_utc=9999999998
+ EOF
+ check approve $HELPER <<-\EOF &&
+ protocol=https
+ host=example.com
+ username=user-expiry-overwrite
+ password=pass2
+ password_expiry_utc=9999999999
+ EOF
+ check fill $HELPER <<-\EOF &&
+ protocol=https
+ host=example.com
+ username=user-expiry-overwrite
+ --
+ protocol=https
+ host=example.com
+ username=user-expiry-overwrite
+ password=pass2
+ password_expiry_utc=9999999999
+ EOF
+ check reject $HELPER <<-\EOF &&
+ protocol=https
+ host=example.com
+ username=user-expiry-overwrite
+ password=pass2
+ EOF
+ check fill $HELPER <<-\EOF
+ protocol=https
+ host=example.com
+ username=user-expiry-overwrite
+ --
+ protocol=https
+ host=example.com
+ username=user-expiry-overwrite
+ password=askpass-password
+ --
+ askpass: Password for '\''https://user-expiry-overwrite@example.com'\'':
+ EOF
+ '
+}
+
+helper_test_oauth_refresh_token() {
+ HELPER=$1
+
+ test_expect_success "helper ($HELPER) stores oauth_refresh_token" '
+ check approve $HELPER <<-\EOF
+ protocol=https
+ host=example.com
+ username=user4
+ password=pass
+ oauth_refresh_token=xyzzy
+ EOF
+ '
+
+ test_expect_success "helper ($HELPER) gets oauth_refresh_token" '
+ check fill $HELPER <<-\EOF
+ protocol=https
+ host=example.com
+ username=user4
+ --
+ protocol=https
+ host=example.com
+ username=user4
+ password=pass
+ oauth_refresh_token=xyzzy
+ --
+ EOF
+ '
+}
+
write_script askpass <<\EOF
echo >&2 askpass: $*
what=$(echo $1 | cut -d" " -f1 | tr A-Z a-z | tr -cd a-z)
diff --git a/t/lib-cvs.sh b/t/lib-cvs.sh
index 32b3473..57b9b2d 100644
--- a/t/lib-cvs.sh
+++ b/t/lib-cvs.sh
@@ -71,8 +71,8 @@ test_cmp_branch_tree () {
find . -type d -name .git -prune -o -type f -print
) | sort >module-git-"$1".list &&
test_cmp module-cvs-"$1".list module-git-"$1".list &&
- cat module-cvs-"$1".list | while read f
+ while read f
do
test_cmp_branch_file "$1" "$f" || return 1
- done
+ done <module-cvs-"$1".list
}
diff --git a/t/lib-diff-alternative.sh b/t/lib-diff-alternative.sh
index 8d1e408..c4dc2d4 100644
--- a/t/lib-diff-alternative.sh
+++ b/t/lib-diff-alternative.sh
@@ -105,10 +105,67 @@ index $file1..$file2 100644
}
EOF
+ cat >expect_diffstat <<EOF
+ file1 => file2 | 21 ++++++++++-----------
+ 1 file changed, 10 insertions(+), 11 deletions(-)
+EOF
+
STRATEGY=$1
+ test_expect_success "setup attributes files for tests with $STRATEGY" '
+ git checkout -b master &&
+ echo "file* diff=driver" >.gitattributes &&
+ git add file1 file2 .gitattributes &&
+ git commit -m "adding files" &&
+ git checkout -b branchA &&
+ echo "file* diff=driverA" >.gitattributes &&
+ git add .gitattributes &&
+ git commit -m "adding driverA as diff driver" &&
+ git checkout master &&
+ git clone --bare --no-local . bare.git
+ '
+
+ test_expect_success "$STRATEGY diff from attributes" '
+ test_must_fail git -c diff.driver.algorithm=$STRATEGY diff --no-index file1 file2 > output &&
+ test_cmp expect output
+ '
+
+ test_expect_success "diff from attributes with bare repo with source" '
+ git -C bare.git --attr-source=branchA -c diff.driver.algorithm=myers \
+ -c diff.driverA.algorithm=$STRATEGY \
+ diff HEAD:file1 HEAD:file2 >output &&
+ test_cmp expect output
+ '
+
+ test_expect_success "diff from attributes with bare repo with invalid source" '
+ test_must_fail git -C bare.git --attr-source=invalid-branch diff \
+ HEAD:file1 HEAD:file2
+ '
+
+ test_expect_success "$STRATEGY diff from attributes has valid diffstat" '
+ echo "file* diff=driver" >.gitattributes &&
+ git config diff.driver.algorithm "$STRATEGY" &&
+ test_must_fail git diff --stat --no-index file1 file2 > output &&
+ test_cmp expect_diffstat output
+ '
+
test_expect_success "$STRATEGY diff" '
- test_must_fail git diff --no-index "--$STRATEGY" file1 file2 > output &&
+ test_must_fail git diff --no-index "--diff-algorithm=$STRATEGY" file1 file2 > output &&
+ test_cmp expect output
+ '
+
+ test_expect_success "$STRATEGY diff command line precedence before attributes" '
+ echo "file* diff=driver" >.gitattributes &&
+ git config diff.driver.algorithm myers &&
+ test_must_fail git diff --no-index "--diff-algorithm=$STRATEGY" file1 file2 > output &&
+ test_cmp expect output
+ '
+
+ test_expect_success "$STRATEGY diff attributes precedence before config" '
+ git config diff.algorithm default &&
+ echo "file* diff=driver" >.gitattributes &&
+ git config diff.driver.algorithm "$STRATEGY" &&
+ test_must_fail git diff --no-index file1 file2 > output &&
test_cmp expect output
'
diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh
index 1147855..add11e8 100644
--- a/t/lib-gpg.sh
+++ b/t/lib-gpg.sh
@@ -13,7 +13,7 @@ test_lazy_prereq GPG '
gpg_version=$(gpg --version 2>&1)
test $? != 127 || exit 1
- # As said here: http://www.gnupg.org/documentation/faqs.html#q6.19
+ # As said here: https://web.archive.org/web/20130212022238/https://www.gnupg.org/faq/gnupg-faq.html#why-does-gnupg-1.0.6-bail-out-on-keyrings-used-with-1.0.7
# the gpg version 1.0.6 did not parse trust packets correctly, so for
# that version, creation of signed tags using the generated key fails.
case "$gpg_version" in
@@ -45,6 +45,28 @@ test_lazy_prereq GPG '
"$TEST_DIRECTORY"/lib-gpg/keyring.gpg &&
gpg --homedir "${GNUPGHOME}" --import-ownertrust \
"$TEST_DIRECTORY"/lib-gpg/ownertrust &&
+ gpg --homedir "${GNUPGHOME}" --update-trustdb &&
+ gpg --homedir "${GNUPGHOME}" </dev/null >/dev/null \
+ --sign -u committer@example.com
+ ;;
+ esac
+'
+
+test_lazy_prereq GPG2 '
+ gpg_version=$(gpg --version 2>&1)
+ test $? != 127 || exit 1
+
+ case "$gpg_version" in
+ "gpg (GnuPG) "[01].*)
+ say "This test requires a GPG version >= v2.0.0"
+ exit 1
+ ;;
+ *)
+ (gpgconf --kill all || : ) &&
+ gpg --homedir "${GNUPGHOME}" --import \
+ "$TEST_DIRECTORY"/lib-gpg/keyring.gpg &&
+ gpg --homedir "${GNUPGHOME}" --import-ownertrust \
+ "$TEST_DIRECTORY"/lib-gpg/ownertrust &&
gpg --homedir "${GNUPGHOME}" </dev/null >/dev/null \
--sign -u committer@example.com
;;
@@ -135,8 +157,9 @@ test_lazy_prereq GPGSSH '
'
test_lazy_prereq GPGSSH_VERIFYTIME '
+ test_have_prereq GPGSSH &&
# Check if ssh-keygen has a verify-time option by passing an invalid date to it
- ssh-keygen -Overify-time=INVALID -Y check-novalidate -s doesnotmatter 2>&1 | grep -q -F "Invalid \"verify-time\"" &&
+ ssh-keygen -Overify-time=INVALID -Y check-novalidate -n "git" -s doesnotmatter 2>&1 | grep -q -F "Invalid \"verify-time\"" &&
# Set up keys with key lifetimes
ssh-keygen -t ed25519 -N "" -C "timeboxed valid key" -f "${GPGSSH_KEY_TIMEBOXEDVALID}" >/dev/null &&
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index 1f6b9b0..d83bafe 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -25,6 +25,7 @@
# LIB_HTTPD_DAV enable DAV
# LIB_HTTPD_SVN enable SVN at given location (e.g. "svn")
# LIB_HTTPD_SSL enable SSL
+# LIB_HTTPD_PROXY enable proxy
#
# Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>
#
@@ -54,20 +55,31 @@ fi
HTTPD_PARA=""
-for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' '/usr/sbin/apache2'
+for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' \
+ '/usr/sbin/apache2' \
+ "$(command -v httpd)" \
+ "$(command -v apache2)"
do
- if test -x "$DEFAULT_HTTPD_PATH"
+ if test -n "$DEFAULT_HTTPD_PATH" && test -x "$DEFAULT_HTTPD_PATH"
then
break
fi
done
+if test -x "$DEFAULT_HTTPD_PATH"
+then
+ DETECTED_HTTPD_ROOT="$("$DEFAULT_HTTPD_PATH" -V 2>/dev/null | sed -n 's/^ -D HTTPD_ROOT="\(.*\)"$/\1/p')"
+fi
+
for DEFAULT_HTTPD_MODULE_PATH in '/usr/libexec/apache2' \
'/usr/lib/apache2/modules' \
'/usr/lib64/httpd/modules' \
- '/usr/lib/httpd/modules'
+ '/usr/lib/httpd/modules' \
+ '/usr/libexec/httpd' \
+ '/usr/lib/apache2' \
+ "${DETECTED_HTTPD_ROOT:+${DETECTED_HTTPD_ROOT}/modules}"
do
- if test -d "$DEFAULT_HTTPD_MODULE_PATH"
+ if test -n "$DEFAULT_HTTPD_MODULE_PATH" && test -d "$DEFAULT_HTTPD_MODULE_PATH"
then
break
fi
@@ -98,16 +110,19 @@ then
fi
HTTPD_VERSION=$($LIB_HTTPD_PATH -v | \
- sed -n 's/^Server version: Apache\/\([0-9]*\)\..*$/\1/p; q')
+ sed -n 's/^Server version: Apache\/\([0-9.]*\).*$/\1/p; q')
+HTTPD_VERSION_MAJOR=$(echo $HTTPD_VERSION | cut -d. -f1)
+HTTPD_VERSION_MINOR=$(echo $HTTPD_VERSION | cut -d. -f2)
-if test -n "$HTTPD_VERSION"
+if test -n "$HTTPD_VERSION_MAJOR"
then
if test -z "$LIB_HTTPD_MODULE_PATH"
then
- if ! test $HTTPD_VERSION -ge 2
+ if ! test "$HTTPD_VERSION_MAJOR" -eq 2 ||
+ ! test "$HTTPD_VERSION_MINOR" -ge 4
then
test_skip_or_die GIT_TEST_HTTPD \
- "at least Apache version 2 is required"
+ "at least Apache version 2.4 is required"
fi
if ! test -d "$DEFAULT_HTTPD_MODULE_PATH"
then
@@ -122,6 +137,20 @@ else
"Could not identify web server at '$LIB_HTTPD_PATH'"
fi
+if test -n "$LIB_HTTPD_DAV" && test -f /etc/os-release
+then
+ case "$(grep "^ID=" /etc/os-release | cut -d= -f2-)" in
+ alpine)
+ # The WebDAV module in Alpine Linux is broken at least up to
+ # Alpine v3.16 as the default DBM driver is missing.
+ #
+ # https://gitlab.alpinelinux.org/alpine/aports/-/issues/13112
+ test_skip_or_die GIT_TEST_HTTPD \
+ "Apache WebDAV module does not have default DBM backend driver"
+ ;;
+ esac
+fi
+
install_script () {
write_script "$HTTPD_ROOT_PATH/$1" <"$TEST_PATH/$1"
}
@@ -129,6 +158,7 @@ install_script () {
prepare_httpd() {
mkdir -p "$HTTPD_DOCUMENT_ROOT_PATH"
cp "$TEST_PATH"/passwd "$HTTPD_ROOT_PATH"
+ cp "$TEST_PATH"/proxy-passwd "$HTTPD_ROOT_PATH"
install_script incomplete-length-upload-pack-v2-http.sh
install_script incomplete-body-upload-pack-v2-http.sh
install_script error-no-report.sh
@@ -136,6 +166,7 @@ prepare_httpd() {
install_script error-smart-http.sh
install_script error.sh
install_script apply-one-time-perl.sh
+ install_script nph-custom-auth.sh
ln -s "$LIB_HTTPD_MODULE_PATH" "$HTTPD_ROOT_PATH/modules"
@@ -172,6 +203,30 @@ prepare_httpd() {
export LIB_HTTPD_SVN LIB_HTTPD_SVNPATH
fi
fi
+
+ if test -n "$LIB_HTTPD_PROXY"
+ then
+ HTTPD_PARA="$HTTPD_PARA -DPROXY"
+ fi
+}
+
+enable_http2 () {
+ HTTPD_PARA="$HTTPD_PARA -DHTTP2"
+ test_set_prereq HTTP2
+}
+
+enable_cgipassauth () {
+ # We are looking for 2.4.13 or more recent. Since we only support
+ # 2.4 and up, no need to check for older major/minor.
+ if test "$HTTPD_VERSION_MAJOR" = 2 &&
+ test "$HTTPD_VERSION_MINOR" = 4 &&
+ test "$(echo $HTTPD_VERSION | cut -d. -f3)" -lt 13
+ then
+ echo >&4 "apache $HTTPD_VERSION too old for CGIPassAuth"
+ return
+ fi
+ HTTPD_PARA="$HTTPD_PARA -DUSE_CGIPASSAUTH"
+ test_set_prereq CGIPASSAUTH
}
start_httpd() {
@@ -211,8 +266,12 @@ test_http_push_nonff () {
git commit -a -m path2 --amend &&
test_must_fail git push -v origin >output 2>&1 &&
- (cd "$REMOTE_REPO" &&
- test $HEAD = $(git rev-parse --verify HEAD))
+ (
+ cd "$REMOTE_REPO" &&
+ echo "$HEAD" >expect &&
+ git rev-parse --verify HEAD >actual &&
+ test_cmp expect actual
+ )
'
test_expect_success 'non-fast-forward push show ref status' '
@@ -220,7 +279,7 @@ test_http_push_nonff () {
'
test_expect_success 'non-fast-forward push shows help message' '
- test_i18ngrep "Updates were rejected because" output
+ test_grep "Updates were rejected because" output
'
test_expect_${EXPECT_CAS_RESULT} 'force with lease aka cas' '
@@ -274,11 +333,11 @@ expect_askpass() {
none)
;;
pass)
- echo "askpass: Password for 'http://$2@$dest': "
+ echo "askpass: Password for '$HTTPD_PROTO://$2@$dest': "
;;
both)
- echo "askpass: Username for 'http://$dest': "
- echo "askpass: Password for 'http://$2@$dest': "
+ echo "askpass: Username for '$HTTPD_PROTO://$dest': "
+ echo "askpass: Password for '$HTTPD_PROTO://$2@$dest': "
;;
*)
false
diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index 497b9b9..022276a 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -29,17 +29,11 @@ ErrorLog error.log
LoadModule setenvif_module modules/mod_setenvif.so
</IfModule>
-<IfVersion < 2.4>
-LockFile accept.lock
-</IfVersion>
-
-<IfVersion < 2.1>
-<IfModule !mod_auth.c>
- LoadModule auth_module modules/mod_auth.so
-</IfModule>
-</IfVersion>
+<IfDefine HTTP2>
+LoadModule http2_module modules/mod_http2.so
+Protocols h2 h2c
+</IfDefine>
-<IfVersion >= 2.1>
<IfModule !mod_auth_basic.c>
LoadModule auth_basic_module modules/mod_auth_basic.so
</IfModule>
@@ -52,9 +46,23 @@ LockFile accept.lock
<IfModule !mod_authz_host.c>
LoadModule authz_host_module modules/mod_authz_host.so
</IfModule>
-</IfVersion>
-<IfVersion >= 2.4>
+<IfDefine PROXY>
+<IfModule !mod_proxy.c>
+ LoadModule proxy_module modules/mod_proxy.so
+</IfModule>
+<IfModule !mod_proxy_http.c>
+ LoadModule proxy_http_module modules/mod_proxy_http.so
+</IfModule>
+ProxyRequests On
+<Proxy "*">
+ AuthType Basic
+ AuthName "proxy-auth"
+ AuthUserFile proxy-passwd
+ Require valid-user
+</Proxy>
+</IfDefine>
+
<IfModule !mod_authn_core.c>
LoadModule authn_core_module modules/mod_authn_core.so
</IfModule>
@@ -64,26 +72,38 @@ LockFile accept.lock
<IfModule !mod_access_compat.c>
LoadModule access_compat_module modules/mod_access_compat.so
</IfModule>
-<IfModule !mod_mpm_prefork.c>
- LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
-</IfModule>
<IfModule !mod_unixd.c>
LoadModule unixd_module modules/mod_unixd.so
</IfModule>
-</IfVersion>
+
+<IfDefine HTTP2>
+<IfModule !mod_mpm_event.c>
+ LoadModule mpm_event_module modules/mod_mpm_event.so
+</IfModule>
+</IfDefine>
+<IfDefine !HTTP2>
+<IfModule !mod_mpm_prefork.c>
+ LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
+</IfModule>
+</IfDefine>
PassEnv GIT_VALGRIND
PassEnv GIT_VALGRIND_OPTIONS
PassEnv GNUPGHOME
PassEnv ASAN_OPTIONS
PassEnv LSAN_OPTIONS
+PassEnv UBSAN_OPTIONS
PassEnv GIT_TRACE
PassEnv GIT_CONFIG_NOSYSTEM
PassEnv GIT_TEST_SIDEBAND_ALL
+PassEnv LANG
+PassEnv LC_ALL
Alias /dumb/ www/
Alias /auth/dumb/ www/auth/dumb/
+SetEnv PERL_PATH ${PERL_PATH}
+
<LocationMatch /smart/>
SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
SetEnv GIT_HTTP_EXPORT_ALL
@@ -108,6 +128,10 @@ Alias /auth/dumb/ www/auth/dumb/
Header set Set-Cookie name=value
</LocationMatch>
<LocationMatch /smart_headers/>
+ <RequireAll>
+ Require expr %{HTTP:x-magic-one} == 'abra'
+ Require expr %{HTTP:x-magic-two} == 'cadabra'
+ </RequireAll>
SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
SetEnv GIT_HTTP_EXPORT_ALL
</LocationMatch>
@@ -120,6 +144,13 @@ Alias /auth/dumb/ www/auth/dumb/
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv GIT_PROTOCOL
</LocationMatch>
+<LocationMatch /custom_auth/>
+ SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
+ SetEnv GIT_HTTP_EXPORT_ALL
+ <IfDefine USE_CGIPASSAUTH>
+ CGIPassAuth on
+ </IfDefine>
+</LocationMatch>
ScriptAlias /smart/incomplete_length/git-upload-pack incomplete-length-upload-pack-v2-http.sh/
ScriptAlias /smart/incomplete_body/git-upload-pack incomplete-body-upload-pack-v2-http.sh/
ScriptAlias /smart/no_report/git-receive-pack error-no-report.sh/
@@ -129,6 +160,7 @@ ScriptAlias /broken_smart/ broken-smart-http.sh/
ScriptAlias /error_smart/ error-smart-http.sh/
ScriptAlias /error/ error.sh/
ScriptAliasMatch /one_time_perl/(.*) apply-one-time-perl.sh/$1
+ScriptAliasMatch /custom_auth/(.*) nph-custom-auth.sh/$1
<Directory ${GIT_EXEC_PATH}>
Options FollowSymlinks
</Directory>
@@ -190,18 +222,6 @@ RewriteRule ^/intern-redir/(.*)/foo$ /smart/$1 [PT]
RewriteRule ^/redir-objects/(.*/info/refs)$ /dumb/$1 [PT]
RewriteRule ^/redir-objects/(.*/objects/.*)$ /dumb/$1 [R=301]
-# Apache 2.2 does not understand <RequireAll>, so we use RewriteCond.
-# And as RewriteCond does not allow testing for non-matches, we match
-# the desired case first (one has abra, two has cadabra), and let it
-# pass by marking the RewriteRule as [L], "last rule, do not process
-# any other matching RewriteRules after this"), and then have another
-# RewriteRule that matches all other cases and lets them fail via '[F]',
-# "fail the request".
-RewriteCond %{HTTP:x-magic-one} =abra
-RewriteCond %{HTTP:x-magic-two} =cadabra
-RewriteRule ^/smart_headers/.* - [L]
-RewriteRule ^/smart_headers/.* - [F]
-
<IfDefine SSL>
LoadModule ssl_module modules/mod_ssl.so
@@ -210,7 +230,6 @@ SSLCertificateKeyFile httpd.pem
SSLRandomSeed startup file:/dev/urandom 512
SSLRandomSeed connect file:/dev/urandom 512
SSLSessionCache none
-SSLMutex file:ssl_mutex
SSLEngine On
</IfDefine>
diff --git a/t/lib-httpd/apply-one-time-perl.sh b/t/lib-httpd/apply-one-time-perl.sh
index 09a0abd..d7f9fed 100644
--- a/t/lib-httpd/apply-one-time-perl.sh
+++ b/t/lib-httpd/apply-one-time-perl.sh
@@ -13,7 +13,7 @@ then
export LC_ALL
"$GIT_EXEC_PATH/git-http-backend" >out
- perl -pe "$(cat one-time-perl)" out >out_modified
+ "$PERL_PATH" -pe "$(cat one-time-perl)" out >out_modified
if cmp -s out out_modified
then
diff --git a/t/lib-httpd/nph-custom-auth.sh b/t/lib-httpd/nph-custom-auth.sh
new file mode 100644
index 0000000..f5345e7
--- /dev/null
+++ b/t/lib-httpd/nph-custom-auth.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+VALID_CREDS_FILE=custom-auth.valid
+CHALLENGE_FILE=custom-auth.challenge
+
+#
+# If $VALID_CREDS_FILE exists in $HTTPD_ROOT_PATH, consider each line as a valid
+# credential for the current request. Each line in the file is considered a
+# valid HTTP Authorization header value. For example:
+#
+# Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
+#
+# If $CHALLENGE_FILE exists in $HTTPD_ROOT_PATH, output the contents as headers
+# in a 401 response if no valid authentication credentials were included in the
+# request. For example:
+#
+# WWW-Authenticate: Bearer authorize_uri="id.example.com" p=1 q=0
+# WWW-Authenticate: Basic realm="example.com"
+#
+
+if test -n "$HTTP_AUTHORIZATION" && \
+ grep -Fqsx "${HTTP_AUTHORIZATION}" "$VALID_CREDS_FILE"
+then
+ # Note that although git-http-backend returns a status line, it
+ # does so using a CGI 'Status' header. Because this script is an
+ # No Parsed Headers (NPH) script, we must return a real HTTP
+ # status line.
+ # This is only a test script, so we don't bother to check for
+ # the actual status from git-http-backend and always return 200.
+ echo 'HTTP/1.1 200 OK'
+ exec "$GIT_EXEC_PATH"/git-http-backend
+fi
+
+echo 'HTTP/1.1 401 Authorization Required'
+if test -f "$CHALLENGE_FILE"
+then
+ cat "$CHALLENGE_FILE"
+fi
+echo
diff --git a/t/lib-httpd/passwd b/t/lib-httpd/passwd
index 99a34d6..d9c122f 100644
--- a/t/lib-httpd/passwd
+++ b/t/lib-httpd/passwd
@@ -1 +1 @@
-user@host:xb4E8pqD81KQs
+user@host:$apr1$LGPmCZWj$9vxEwj5Z5GzQLBMxp3mCx1
diff --git a/t/lib-httpd/proxy-passwd b/t/lib-httpd/proxy-passwd
new file mode 100644
index 0000000..2ad7705
--- /dev/null
+++ b/t/lib-httpd/proxy-passwd
@@ -0,0 +1 @@
+proxuser:$apr1$RxS6MLkD$DYsqQdflheq4GPNxzJpx5.
diff --git a/t/lib-httpd/ssl.cnf b/t/lib-httpd/ssl.cnf
index 6dab257..812e825 100644
--- a/t/lib-httpd/ssl.cnf
+++ b/t/lib-httpd/ssl.cnf
@@ -1,7 +1,7 @@
RANDFILE = $ENV::RANDFILE_PATH
[ req ]
-default_bits = 1024
+default_bits = 2048
distinguished_name = req_distinguished_name
prompt = no
[ req_distinguished_name ]
diff --git a/t/lib-parallel-checkout.sh b/t/lib-parallel-checkout.sh
index acaee9c..8324d6c 100644
--- a/t/lib-parallel-checkout.sh
+++ b/t/lib-parallel-checkout.sh
@@ -20,7 +20,7 @@ test_checkout_workers () {
BUG "too few arguments to test_checkout_workers"
fi &&
- local expected_workers=$1 &&
+ local expected_workers="$1" &&
shift &&
local trace_file=trace-test-checkout-workers &&
diff --git a/t/lib-patch-mode.sh b/t/lib-patch-mode.sh
index cfd76bf..89ca1f7 100644
--- a/t/lib-patch-mode.sh
+++ b/t/lib-patch-mode.sh
@@ -29,8 +29,12 @@ set_and_save_state () {
# verify_state <path> <expected-worktree-content> <expected-index-content>
verify_state () {
- test "$(cat "$1")" = "$2" &&
- test "$(git show :"$1")" = "$3"
+ echo "$2" >expect &&
+ test_cmp expect "$1" &&
+
+ echo "$3" >expect &&
+ git show :"$1" >actual &&
+ test_cmp expect actual
}
# verify_saved_state <path>
@@ -46,5 +50,6 @@ save_head () {
}
verify_saved_head () {
- test "$(cat _head)" = "$(git rev-parse HEAD)"
+ git rev-parse HEAD >actual &&
+ test_cmp _head actual
}
diff --git a/t/lib-perl.sh b/t/lib-perl.sh
new file mode 100644
index 0000000..d0bf509
--- /dev/null
+++ b/t/lib-perl.sh
@@ -0,0 +1,19 @@
+# Copyright (c) 2022 Ævar Arnfjörð Bjarmason
+
+test_lazy_prereq PERL_TEST_MORE '
+ perl -MTest::More -e 0
+'
+
+skip_all_if_no_Test_More () {
+ if ! test_have_prereq PERL
+ then
+ skip_all='skipping perl interface tests, perl not available'
+ test_done
+ fi
+
+ if ! test_have_prereq PERL_TEST_MORE
+ then
+ skip_all="Perl Test::More unavailable, skipping test"
+ test_done
+ fi
+}
diff --git a/t/lib-rebase.sh b/t/lib-rebase.sh
index ec6b9b1..11d2dc9 100644
--- a/t/lib-rebase.sh
+++ b/t/lib-rebase.sh
@@ -8,18 +8,21 @@
# - check that non-commit messages have a certain line count with $EXPECT_COUNT
# - check the commit count in the commit message header with $EXPECT_HEADER_COUNT
# - rewrite a rebase -i script as directed by $FAKE_LINES.
-# $FAKE_LINES consists of a sequence of words separated by spaces.
-# The following word combinations are possible:
+# $FAKE_LINES consists of a sequence of words separated by spaces;
+# spaces inside the words are encoded as underscores.
+# The following words are possible:
#
-# "<lineno>" -- add a "pick" line with the SHA1 taken from the
-# specified line.
+# "<cmd>" -- override the command for the next line specification. Can be
+# "pick", "squash", "fixup[_-(c|C)]", "edit", "reword", "drop",
+# "merge[_-(c|C)_<rev>]", or "bad" for an invalid command.
#
-# "<cmd> <lineno>" -- add a line with the specified command
-# ("pick", "squash", "fixup"|"fixup_-C"|"fixup_-c", "edit", "reword" or "drop")
-# and the SHA1 taken from the specified line.
+# "<lineno>" -- add a command, using the specified line as a template.
+# If the command has not been overridden, the line will be copied
+# verbatim, usually resulting in a "pick" line.
#
-# "_" -- add a space, like "fixup_-C" implies "fixup -C" and
-# "exec_cmd_with_args" add an "exec cmd with args" line.
+# "fakesha" -- add a command ("pick" by default), using a fake SHA1.
+#
+# "exec_[command...]", "break" -- add the specified command.
#
# "#" -- Add a comment line.
#
@@ -49,7 +52,7 @@ set_fake_editor () {
action=\&
for line in $FAKE_LINES; do
case $line in
- pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d|label|l|reset|r|merge|m)
+ pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d|label|l|reset|t|merge|m)
action="$line";;
exec_*|x_*|break|b)
echo "$line" | sed 's/_/ /g' >> "$1";;
@@ -60,11 +63,11 @@ set_fake_editor () {
">")
echo >> "$1";;
bad)
- action="badcmd";;
+ action="pickled";;
fakesha)
test \& != "$action" || action=pick
echo "$action XXXXXXX False commit" >> "$1"
- action=pick;;
+ action=\&;;
*)
sed -n "${line}s/^[a-z][a-z]*/$action/p" < "$1".tmp >> "$1"
action=\&;;
@@ -207,3 +210,22 @@ check_reworded_commits () {
>reword-log &&
test_cmp reword-expected reword-log
}
+
+# usage: set_replace_editor <file>
+#
+# Replace the todo file with the exact contents of the given file.
+# N.B. sets GIT_SEQUENCE_EDITOR rather than EDITOR so it can be
+# combined with set_fake_editor to reword commits and replace the
+# todo list
+set_replace_editor () {
+ cat >script <<-\EOF &&
+ cat FILENAME >"$1"
+
+ echo 'rebase -i script after editing:'
+ cat "$1"
+ EOF
+
+ sed -e "s/FILENAME/$1/g" script |
+ write_script fake-sequence-editor.sh &&
+ test_set_sequence_editor "$(pwd)/fake-sequence-editor.sh"
+}
diff --git a/t/lib-submodule-update.sh b/t/lib-submodule-update.sh
index f7c7df0..36f767c 100644
--- a/t/lib-submodule-update.sh
+++ b/t/lib-submodule-update.sh
@@ -168,20 +168,16 @@ replace_gitfile_with_git_dir () {
# Note that this only supports submodules at the root level of the
# superproject, with the default name, i.e. same as its path.
test_git_directory_is_unchanged () {
- (
- cd ".git/modules/$1" &&
- # does core.worktree point at the right place?
- test "$(git config core.worktree)" = "../../../$1" &&
- # remove it temporarily before comparing, as
- # "$1/.git/config" lacks it...
- git config --unset core.worktree
- ) &&
+ # does core.worktree point at the right place?
+ echo "../../../$1" >expect &&
+ git -C ".git/modules/$1" config core.worktree >actual &&
+ test_cmp expect actual &&
+ # remove it temporarily before comparing, as
+ # "$1/.git/config" lacks it...
+ git -C ".git/modules/$1" config --unset core.worktree &&
diff -r ".git/modules/$1" "$1/.git" &&
- (
- # ... and then restore.
- cd ".git/modules/$1" &&
- git config core.worktree "../../../$1"
- )
+ # ... and then restore.
+ git -C ".git/modules/$1" config core.worktree "../../../$1"
}
test_git_directory_exists () {
@@ -189,7 +185,9 @@ test_git_directory_exists () {
if test -f sub1/.git
then
# does core.worktree point at the right place?
- test "$(git -C .git/modules/$1 config core.worktree)" = "../../../$1"
+ echo "../../../$1" >expect &&
+ git -C ".git/modules/$1" config core.worktree >actual &&
+ test_cmp expect actual
fi
}
@@ -197,6 +195,7 @@ test_git_directory_exists () {
# the submodule repo if it doesn't exist and configures the most problematic
# settings for diff.ignoreSubmodules.
prolog () {
+ test_config_global protocol.file.allow always &&
(test -d submodule_update_repo || create_lib_submodule_repo) &&
test_config_global diff.ignoreSubmodules all &&
test_config diff.ignoreSubmodules all
@@ -207,7 +206,7 @@ prolog () {
# should be updated to an existing commit.
reset_work_tree_to () {
rm -rf submodule_update &&
- git clone submodule_update_repo submodule_update &&
+ git clone --template= submodule_update_repo submodule_update &&
(
cd submodule_update &&
rm -rf sub1 &&
@@ -803,7 +802,7 @@ test_submodule_recursing_with_args_common () {
git branch -t no_submodule origin/no_submodule &&
$command no_submodule &&
test_superproject_content origin/no_submodule &&
- ! test_path_is_dir sub1 &&
+ test_path_is_missing sub1 &&
test_must_fail git config -f .git/modules/sub1/config core.worktree &&
test_must_fail git config -f .git/modules/sub1/modules/sub2/config core.worktree
)
@@ -831,7 +830,7 @@ test_submodule_recursing_with_args_common () {
cd submodule_update &&
git branch -t invalid_sub1 origin/invalid_sub1 &&
test_must_fail $command invalid_sub1 2>err &&
- test_i18ngrep sub1 err &&
+ test_grep sub1 err &&
test_superproject_content origin/add_sub1 &&
test_submodule_content sub1 origin/add_sub1
)
@@ -902,13 +901,14 @@ test_submodule_switch_recursing_with_args () {
'
# ... but an ignored file is fine.
test_expect_$RESULTOI "$command: added submodule removes an untracked ignored file" '
- test_when_finished "rm submodule_update/.git/info/exclude" &&
+ test_when_finished "rm -rf submodule_update/.git/info" &&
prolog &&
reset_work_tree_to_interested no_submodule &&
(
cd submodule_update &&
git branch -t add_sub1 origin/add_sub1 &&
: >sub1 &&
+ mkdir .git/info &&
echo sub1 >.git/info/exclude &&
$command add_sub1 &&
test_superproject_content origin/add_sub1 &&
@@ -951,7 +951,9 @@ test_submodule_switch_recursing_with_args () {
reset_work_tree_to_interested add_sub1 &&
(
cd submodule_update &&
+ rm -rf .git/modules/sub1/info &&
git branch -t replace_sub1_with_file origin/replace_sub1_with_file &&
+ mkdir .git/modules/sub1/info &&
echo ignored >.git/modules/sub1/info/exclude &&
: >sub1/ignored &&
$command replace_sub1_with_file &&
diff --git a/t/oid-info/hash-info b/t/oid-info/hash-info
index d0736dd..b8a5bcb 100644
--- a/t/oid-info/hash-info
+++ b/t/oid-info/hash-info
@@ -15,3 +15,15 @@ empty_blob sha256:473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a3037218
empty_tree sha1:4b825dc642cb6eb9a060e54bf8d69288fbee4904
empty_tree sha256:6ef19b41225c5369f1c104d45d8d85efa9b057b53b14b4b9b939dd74decc5321
+
+blob17_1 sha1:263
+blob17_1 sha256:34
+
+blob17_2 sha1:410
+blob17_2 sha256:174
+
+blob17_3 sha1:523
+blob17_3 sha256:313
+
+blob17_4 sha1:790
+blob17_4 sha256:481
diff --git a/t/perf/README b/t/perf/README
index fb9127a..8f217d7 100644
--- a/t/perf/README
+++ b/t/perf/README
@@ -95,6 +95,10 @@ You can set the following variables (also in your config.mak):
Git (e.g., performance of index-pack as the number of threads
changes). These can be enabled with GIT_PERF_EXTRA.
+ GIT_PERF_USE_SCALAR
+ Boolean indicating whether to register test repo(s) with Scalar
+ before executing tests.
+
You can also pass the options taken by ordinary git tests; the most
useful one is:
diff --git a/t/perf/lib-bitmap.sh b/t/perf/lib-bitmap.sh
index 63d3bc7..55a8feb 100644
--- a/t/perf/lib-bitmap.sh
+++ b/t/perf/lib-bitmap.sh
@@ -67,3 +67,34 @@ test_partial_bitmap () {
--filter=tree:0 >/dev/null
'
}
+
+test_pack_bitmap () {
+ test_perf "repack to disk" '
+ git repack -ad
+ '
+
+ test_full_bitmap
+
+ test_expect_success "create partial bitmap state" '
+ # pick a commit to represent the repo tip in the past
+ cutoff=$(git rev-list HEAD~100 -1) &&
+ orig_tip=$(git rev-parse HEAD) &&
+
+ # now kill off all of the refs and pretend we had
+ # just the one tip
+ rm -rf .git/logs .git/refs/* .git/packed-refs &&
+ git update-ref HEAD $cutoff &&
+
+ # and then repack, which will leave us with a nice
+ # big bitmap pack of the "old" history, and all of
+ # the new history will be loose, as if it had been pushed
+ # up incrementally and exploded via unpack-objects
+ git repack -Ad &&
+
+ # and now restore our original tip, as if the pushes
+ # had happened
+ git update-ref HEAD $orig_tip
+ '
+
+ test_partial_bitmap
+}
diff --git a/t/perf/p0004-lazy-init-name-hash.sh b/t/perf/p0004-lazy-init-name-hash.sh
index 1afc08f..85be14e 100755
--- a/t/perf/p0004-lazy-init-name-hash.sh
+++ b/t/perf/p0004-lazy-init-name-hash.sh
@@ -49,7 +49,7 @@ test_perf "single-threaded, $desc" "
test-tool lazy-init-name-hash --single --count=$count
"
-test_perf REPO_BIG_ENOUGH_FOR_MULTI "multi-threaded, $desc" "
+test_perf "multi-threaded, $desc" --prereq REPO_BIG_ENOUGH_FOR_MULTI "
test-tool lazy-init-name-hash --multi --count=$count
"
diff --git a/t/perf/p0006-read-tree-checkout.sh b/t/perf/p0006-read-tree-checkout.sh
index 900b385..325566e 100755
--- a/t/perf/p0006-read-tree-checkout.sh
+++ b/t/perf/p0006-read-tree-checkout.sh
@@ -46,7 +46,15 @@ test_expect_success "setup repo" '
'
test_perf "read-tree br_base br_ballast ($nr_files)" '
- git read-tree -m br_base br_ballast -n
+ git read-tree -n -m br_base br_ballast
+'
+
+test_perf "read-tree br_ballast_plus_1 ($nr_files)" '
+ # Run read-tree 100 times for clearer performance results & comparisons
+ for i in $(test_seq 100)
+ do
+ git read-tree -n -m br_ballast_plus_1 || return 1
+ done
'
test_perf "switch between br_base br_ballast ($nr_files)" '
diff --git a/t/perf/p0071-sort.sh b/t/perf/p0071-sort.sh
index ed366e2..ae4ddac 100755
--- a/t/perf/p0071-sort.sh
+++ b/t/perf/p0071-sort.sh
@@ -40,11 +40,11 @@ done
for file in unsorted sorted reversed
do
- test_perf "llist_mergesort() $file" "
+ test_perf "DEFINE_LIST_SORT $file" "
test-tool mergesort sort <$file >actual
"
- test_expect_success "llist_mergesort() $file sorts like sort(1)" "
+ test_expect_success "DEFINE_LIST_SORT $file sorts like sort(1)" "
test_cmp_bin sorted actual
"
done
diff --git a/t/perf/p0090-cache-tree.sh b/t/perf/p0090-cache-tree.sh
new file mode 100755
index 0000000..a8eabca
--- /dev/null
+++ b/t/perf/p0090-cache-tree.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+test_description="Tests performance of cache tree update operations"
+
+. ./perf-lib.sh
+
+test_perf_large_repo
+test_checkout_worktree
+
+count=100
+
+test_expect_success 'setup cache tree' '
+ git write-tree
+'
+
+test_cache_tree () {
+ test_perf "$1, $3" "
+ for i in \$(test_seq $count)
+ do
+ test-tool cache-tree $4 $2
+ done
+ "
+}
+
+test_cache_tree_update_functions () {
+ test_cache_tree 'no-op' 'control' "$1" "$2"
+ test_cache_tree 'prime_cache_tree' 'prime' "$1" "$2"
+ test_cache_tree 'cache_tree_update' 'update' "$1" "$2"
+}
+
+test_cache_tree_update_functions "clean" ""
+test_cache_tree_update_functions "invalidate 2" "--invalidate 2"
+test_cache_tree_update_functions "invalidate 50" "--invalidate 50"
+test_cache_tree_update_functions "empty" "--empty"
+
+test_done
diff --git a/t/perf/p1500-graph-walks.sh b/t/perf/p1500-graph-walks.sh
new file mode 100755
index 0000000..e14e762
--- /dev/null
+++ b/t/perf/p1500-graph-walks.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+test_description='Commit walk performance tests'
+. ./perf-lib.sh
+
+test_perf_large_repo
+
+test_expect_success 'setup' '
+ git for-each-ref --format="%(refname)" "refs/heads/*" "refs/tags/*" >allrefs &&
+ sort -r allrefs | head -n 50 >refs &&
+ for ref in $(cat refs)
+ do
+ git branch -f ref-$ref $ref &&
+ echo ref-$ref ||
+ return 1
+ done >branches &&
+ for ref in $(cat refs)
+ do
+ git tag -f tag-$ref $ref &&
+ echo tag-$ref ||
+ return 1
+ done >tags &&
+ git commit-graph write --reachable
+'
+
+test_perf 'ahead-behind counts: git for-each-ref' '
+ git for-each-ref --format="%(ahead-behind:HEAD)" --stdin <refs
+'
+
+test_perf 'ahead-behind counts: git branch' '
+ xargs git branch -l --format="%(ahead-behind:HEAD)" <branches
+'
+
+test_perf 'ahead-behind counts: git tag' '
+ xargs git tag -l --format="%(ahead-behind:HEAD)" <tags
+'
+
+test_perf 'contains: git for-each-ref --merged' '
+ git for-each-ref --merged=HEAD --stdin <refs
+'
+
+test_perf 'contains: git branch --merged' '
+ xargs git branch --merged=HEAD <branches
+'
+
+test_perf 'contains: git tag --merged' '
+ xargs git tag --merged=HEAD <tags
+'
+
+test_done
diff --git a/t/perf/p2000-sparse-operations.sh b/t/perf/p2000-sparse-operations.sh
index c181110..39e92b0 100755
--- a/t/perf/p2000-sparse-operations.sh
+++ b/t/perf/p2000-sparse-operations.sh
@@ -43,6 +43,7 @@ test_expect_success 'setup repo and indexes' '
done &&
git sparse-checkout init --cone &&
+ git tag -a v1.0 -m "Final" &&
git sparse-checkout set $SPARSE_CONE &&
git checkout -b wide $OLD_COMMIT &&
@@ -123,5 +124,16 @@ test_perf_on_all git blame $SPARSE_CONE/f3/a
test_perf_on_all git read-tree -mu HEAD
test_perf_on_all git checkout-index -f --all
test_perf_on_all git update-index --add --remove $SPARSE_CONE/a
+test_perf_on_all "git rm -f $SPARSE_CONE/a && git checkout HEAD -- $SPARSE_CONE/a"
+test_perf_on_all git grep --cached bogus -- "f2/f1/f1/*"
+test_perf_on_all git write-tree
+test_perf_on_all git describe --dirty
+test_perf_on_all 'echo >>new && git describe --dirty'
+test_perf_on_all git diff-files
+test_perf_on_all git diff-files -- $SPARSE_CONE/a
+test_perf_on_all git diff-tree HEAD
+test_perf_on_all git diff-tree HEAD -- $SPARSE_CONE/a
+test_perf_on_all "git worktree add ../temp && git worktree remove ../temp"
+test_perf_on_all git check-attr -a -- $SPARSE_CONE/a
test_done
diff --git a/t/perf/p5310-pack-bitmaps.sh b/t/perf/p5310-pack-bitmaps.sh
index 7ad4f23..b1399f1 100755
--- a/t/perf/p5310-pack-bitmaps.sh
+++ b/t/perf/p5310-pack-bitmaps.sh
@@ -4,51 +4,37 @@ test_description='Tests pack performance using bitmaps'
. ./perf-lib.sh
. "${TEST_DIRECTORY}/perf/lib-bitmap.sh"
-test_perf_large_repo
-
-# note that we do everything through config,
-# since we want to be able to compare bitmap-aware
-# git versus non-bitmap git
-#
-# We intentionally use the deprecated pack.writebitmaps
-# config so that we can test against older versions of git.
-test_expect_success 'setup bitmap config' '
- git config pack.writebitmaps true
-'
-
-# we need to create the tag up front such that it is covered by the repack and
-# thus by generated bitmaps.
-test_expect_success 'create tags' '
- git tag --message="tag pointing to HEAD" perf-tag HEAD
-'
-
-test_perf 'repack to disk' '
- git repack -ad
-'
-
-test_full_bitmap
-
-test_expect_success 'create partial bitmap state' '
- # pick a commit to represent the repo tip in the past
- cutoff=$(git rev-list HEAD~100 -1) &&
- orig_tip=$(git rev-parse HEAD) &&
-
- # now kill off all of the refs and pretend we had
- # just the one tip
- rm -rf .git/logs .git/refs/* .git/packed-refs &&
- git update-ref HEAD $cutoff &&
-
- # and then repack, which will leave us with a nice
- # big bitmap pack of the "old" history, and all of
- # the new history will be loose, as if it had been pushed
- # up incrementally and exploded via unpack-objects
- git repack -Ad &&
-
- # and now restore our original tip, as if the pushes
- # had happened
- git update-ref HEAD $orig_tip
-'
-
-test_partial_bitmap
+test_lookup_pack_bitmap () {
+ test_expect_success 'start the test from scratch' '
+ rm -rf * .git
+ '
+
+ test_perf_large_repo
+
+ # note that we do everything through config,
+ # since we want to be able to compare bitmap-aware
+ # git versus non-bitmap git
+ #
+ # We intentionally use the deprecated pack.writebitmaps
+ # config so that we can test against older versions of git.
+ test_expect_success 'setup bitmap config' '
+ git config pack.writebitmaps true
+ '
+
+ # we need to create the tag up front such that it is covered by the repack and
+ # thus by generated bitmaps.
+ test_expect_success 'create tags' '
+ git tag --message="tag pointing to HEAD" perf-tag HEAD
+ '
+
+ test_perf "enable lookup table: $1" '
+ git config pack.writeBitmapLookupTable '"$1"'
+ '
+
+ test_pack_bitmap
+}
+
+test_lookup_pack_bitmap false
+test_lookup_pack_bitmap true
test_done
diff --git a/t/perf/p5311-pack-bitmaps-fetch.sh b/t/perf/p5311-pack-bitmaps-fetch.sh
index 47c3fd7..426fab8 100755
--- a/t/perf/p5311-pack-bitmaps-fetch.sh
+++ b/t/perf/p5311-pack-bitmaps-fetch.sh
@@ -3,42 +3,52 @@
test_description='performance of fetches from bitmapped packs'
. ./perf-lib.sh
-test_perf_default_repo
-
-test_expect_success 'create bitmapped server repo' '
- git config pack.writebitmaps true &&
- git repack -ad
-'
-
-# simulate a fetch from a repository that last fetched N days ago, for
-# various values of N. We do so by following the first-parent chain,
-# and assume the first entry in the chain that is N days older than the current
-# HEAD is where the HEAD would have been then.
-for days in 1 2 4 8 16 32 64 128; do
- title=$(printf '%10s' "($days days)")
- test_expect_success "setup revs from $days days ago" '
- now=$(git log -1 --format=%ct HEAD) &&
- then=$(($now - ($days * 86400))) &&
- tip=$(git rev-list -1 --first-parent --until=$then HEAD) &&
- {
- echo HEAD &&
- echo ^$tip
- } >revs
+test_fetch_bitmaps () {
+ test_expect_success 'setup test directory' '
+ rm -fr * .git
'
- test_perf "server $title" '
- git pack-objects --stdout --revs \
- --thin --delta-base-offset \
- <revs >tmp.pack
- '
+ test_perf_default_repo
- test_size "size $title" '
- wc -c <tmp.pack
+ test_expect_success 'create bitmapped server repo' '
+ git config pack.writebitmaps true &&
+ git config pack.writeBitmapLookupTable '"$1"' &&
+ git repack -ad
'
- test_perf "client $title" '
- git index-pack --stdin --fix-thin <tmp.pack
- '
-done
+ # simulate a fetch from a repository that last fetched N days ago, for
+ # various values of N. We do so by following the first-parent chain,
+ # and assume the first entry in the chain that is N days older than the current
+ # HEAD is where the HEAD would have been then.
+ for days in 1 2 4 8 16 32 64 128; do
+ title=$(printf '%10s' "($days days)")
+ test_expect_success "setup revs from $days days ago" '
+ now=$(git log -1 --format=%ct HEAD) &&
+ then=$(($now - ($days * 86400))) &&
+ tip=$(git rev-list -1 --first-parent --until=$then HEAD) &&
+ {
+ echo HEAD &&
+ echo ^$tip
+ } >revs
+ '
+
+ test_perf "server $title (lookup=$1)" '
+ git pack-objects --stdout --revs \
+ --thin --delta-base-offset \
+ <revs >tmp.pack
+ '
+
+ test_size "size $title" '
+ wc -c <tmp.pack
+ '
+
+ test_perf "client $title (lookup=$1)" '
+ git index-pack --stdin --fix-thin <tmp.pack
+ '
+ done
+}
+
+test_fetch_bitmaps true
+test_fetch_bitmaps false
test_done
diff --git a/t/perf/p5312-pack-bitmaps-revs.sh b/t/perf/p5312-pack-bitmaps-revs.sh
new file mode 100755
index 0000000..ceec606
--- /dev/null
+++ b/t/perf/p5312-pack-bitmaps-revs.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+test_description='Tests pack performance using bitmaps (rev index enabled)'
+. ./perf-lib.sh
+. "${TEST_DIRECTORY}/perf/lib-bitmap.sh"
+
+test_lookup_pack_bitmap () {
+ test_expect_success 'start the test from scratch' '
+ rm -rf * .git
+ '
+
+ test_perf_large_repo
+
+ test_expect_success 'setup bitmap config' '
+ git config pack.writebitmaps true
+ '
+
+ # we need to create the tag up front such that it is covered by the repack and
+ # thus by generated bitmaps.
+ test_expect_success 'create tags' '
+ git tag --message="tag pointing to HEAD" perf-tag HEAD
+ '
+
+ test_perf "enable lookup table: $1" '
+ git config pack.writeBitmapLookupTable '"$1"'
+ '
+
+ test_pack_bitmap
+}
+
+test_lookup_pack_bitmap false
+test_lookup_pack_bitmap true
+
+test_done
diff --git a/t/perf/p5326-multi-pack-bitmaps.sh b/t/perf/p5326-multi-pack-bitmaps.sh
index f2fa228..d082e6c 100755
--- a/t/perf/p5326-multi-pack-bitmaps.sh
+++ b/t/perf/p5326-multi-pack-bitmaps.sh
@@ -4,49 +4,64 @@ test_description='Tests performance using midx bitmaps'
. ./perf-lib.sh
. "${TEST_DIRECTORY}/perf/lib-bitmap.sh"
-test_perf_large_repo
-
-# we need to create the tag up front such that it is covered by the repack and
-# thus by generated bitmaps.
-test_expect_success 'create tags' '
- git tag --message="tag pointing to HEAD" perf-tag HEAD
-'
-
-test_expect_success 'start with bitmapped pack' '
- git repack -adb
-'
-
-test_perf 'setup multi-pack index' '
- git multi-pack-index write --bitmap
-'
-
-test_expect_success 'drop pack bitmap' '
- rm -f .git/objects/pack/pack-*.bitmap
-'
-
-test_full_bitmap
-
-test_expect_success 'create partial bitmap state' '
- # pick a commit to represent the repo tip in the past
- cutoff=$(git rev-list HEAD~100 -1) &&
- orig_tip=$(git rev-parse HEAD) &&
-
- # now pretend we have just one tip
- rm -rf .git/logs .git/refs/* .git/packed-refs &&
- git update-ref HEAD $cutoff &&
-
- # and then repack, which will leave us with a nice
- # big bitmap pack of the "old" history, and all of
- # the new history will be loose, as if it had been pushed
- # up incrementally and exploded via unpack-objects
- git repack -Ad &&
- git multi-pack-index write --bitmap &&
-
- # and now restore our original tip, as if the pushes
- # had happened
- git update-ref HEAD $orig_tip
-'
-
-test_partial_bitmap
+test_bitmap () {
+ local enabled="$1"
+
+ test_expect_success "remove existing repo (lookup=$enabled)" '
+ rm -fr * .git
+ '
+
+ test_perf_large_repo
+
+ # we need to create the tag up front such that it is covered by the repack and
+ # thus by generated bitmaps.
+ test_expect_success 'create tags' '
+ git tag --message="tag pointing to HEAD" perf-tag HEAD
+ '
+
+ test_expect_success "use lookup table: $enabled" '
+ git config pack.writeBitmapLookupTable '"$enabled"'
+ '
+
+ test_expect_success "start with bitmapped pack (lookup=$enabled)" '
+ git repack -adb
+ '
+
+ test_perf "setup multi-pack index (lookup=$enabled)" '
+ git multi-pack-index write --bitmap
+ '
+
+ test_expect_success "drop pack bitmap (lookup=$enabled)" '
+ rm -f .git/objects/pack/pack-*.bitmap
+ '
+
+ test_full_bitmap
+
+ test_expect_success "create partial bitmap state (lookup=$enabled)" '
+ # pick a commit to represent the repo tip in the past
+ cutoff=$(git rev-list HEAD~100 -1) &&
+ orig_tip=$(git rev-parse HEAD) &&
+
+ # now pretend we have just one tip
+ rm -rf .git/logs .git/refs/* .git/packed-refs &&
+ git update-ref HEAD $cutoff &&
+
+ # and then repack, which will leave us with a nice
+ # big bitmap pack of the "old" history, and all of
+ # the new history will be loose, as if it had been pushed
+ # up incrementally and exploded via unpack-objects
+ git repack -Ad &&
+ git multi-pack-index write --bitmap &&
+
+ # and now restore our original tip, as if the pushes
+ # had happened
+ git update-ref HEAD $orig_tip
+ '
+
+ test_partial_bitmap
+}
+
+test_bitmap false
+test_bitmap true
test_done
diff --git a/t/perf/p5332-multi-pack-reuse.sh b/t/perf/p5332-multi-pack-reuse.sh
new file mode 100755
index 0000000..5c6c575
--- /dev/null
+++ b/t/perf/p5332-multi-pack-reuse.sh
@@ -0,0 +1,81 @@
+#!/bin/sh
+
+test_description='tests pack performance with multi-pack reuse'
+
+. ./perf-lib.sh
+. "${TEST_DIRECTORY}/perf/lib-pack.sh"
+
+packdir=.git/objects/pack
+
+test_perf_large_repo
+
+find_pack () {
+ for idx in $packdir/pack-*.idx
+ do
+ if git show-index <$idx | grep -q "$1"
+ then
+ basename $idx
+ fi || return 1
+ done
+}
+
+repack_into_n_chunks () {
+ git repack -adk &&
+
+ test "$1" -eq 1 && return ||
+
+ find $packdir -type f | sort >packs.before &&
+
+ # partition the repository into $1 chunks of consecutive commits, and
+ # then create $1 packs with the objects reachable from each chunk
+ # (excluding any objects reachable from the previous chunks)
+ sz="$(($(git rev-list --count --all) / $1))"
+ for rev in $(git rev-list --all | awk "NR % $sz == 0" | tac)
+ do
+ pack="$(echo "$rev" | git pack-objects --revs \
+ --honor-pack-keep --delta-base-offset $packdir/pack)" &&
+ touch $packdir/pack-$pack.keep || return 1
+ done
+
+ # grab any remaining objects not packed by the previous step(s)
+ git pack-objects --revs --all --honor-pack-keep --delta-base-offset \
+ $packdir/pack &&
+
+ find $packdir -type f | sort >packs.after &&
+
+ # and install the whole thing
+ for f in $(comm -12 packs.before packs.after)
+ do
+ rm -f "$f" || return 1
+ done
+ rm -fr $packdir/*.keep
+}
+
+for nr_packs in 1 10 100
+do
+ test_expect_success "create $nr_packs-pack scenario" '
+ repack_into_n_chunks $nr_packs
+ '
+
+ test_expect_success "setup bitmaps for $nr_packs-pack scenario" '
+ find $packdir -type f -name "*.idx" | sed -e "s/.*\/\(.*\)$/+\1/g" |
+ git multi-pack-index write --stdin-packs --bitmap \
+ --preferred-pack="$(find_pack $(git rev-parse HEAD))"
+ '
+
+ for reuse in single multi
+ do
+ test_perf "clone for $nr_packs-pack scenario ($reuse-pack reuse)" "
+ git for-each-ref --format='%(objectname)' refs/heads refs/tags >in &&
+ git -c pack.allowPackReuse=$reuse pack-objects \
+ --revs --delta-base-offset --use-bitmap-index \
+ --stdout <in >result
+ "
+
+ test_size "clone size for $nr_packs-pack scenario ($reuse-pack reuse)" '
+ wc -c <result
+ '
+ done
+done
+
+test_done
diff --git a/t/perf/p6300-for-each-ref.sh b/t/perf/p6300-for-each-ref.sh
new file mode 100755
index 0000000..fa7289c
--- /dev/null
+++ b/t/perf/p6300-for-each-ref.sh
@@ -0,0 +1,87 @@
+#!/bin/sh
+
+test_description='performance of for-each-ref'
+. ./perf-lib.sh
+
+test_perf_fresh_repo
+
+ref_count_per_type=10000
+test_iteration_count=10
+
+test_expect_success "setup" '
+ test_commit_bulk $(( 1 + $ref_count_per_type )) &&
+
+ # Create refs
+ test_seq $ref_count_per_type |
+ sed "s,.*,update refs/heads/branch_& HEAD~&\nupdate refs/custom/special_& HEAD~&," |
+ git update-ref --stdin &&
+
+ # Create annotated tags
+ for i in $(test_seq $ref_count_per_type)
+ do
+ # Base tags
+ echo "tag tag_$i" &&
+ echo "mark :$i" &&
+ echo "from HEAD~$i" &&
+ printf "tagger %s <%s> %s\n" \
+ "$GIT_COMMITTER_NAME" \
+ "$GIT_COMMITTER_EMAIL" \
+ "$GIT_COMMITTER_DATE" &&
+ echo "data <<EOF" &&
+ echo "tag $i" &&
+ echo "EOF" &&
+
+ # Nested tags
+ echo "tag nested_$i" &&
+ echo "from :$i" &&
+ printf "tagger %s <%s> %s\n" \
+ "$GIT_COMMITTER_NAME" \
+ "$GIT_COMMITTER_EMAIL" \
+ "$GIT_COMMITTER_DATE" &&
+ echo "data <<EOF" &&
+ echo "nested tag $i" &&
+ echo "EOF" || return 1
+ done | git fast-import
+'
+
+test_for_each_ref () {
+ title="for-each-ref"
+ if test $# -gt 0; then
+ title="$title ($1)"
+ shift
+ fi
+ args="$@"
+
+ test_perf "$title" "
+ for i in \$(test_seq $test_iteration_count); do
+ git for-each-ref $args >/dev/null
+ done
+ "
+}
+
+run_tests () {
+ test_for_each_ref "$1"
+ test_for_each_ref "$1, no sort" --no-sort
+ test_for_each_ref "$1, --count=1" --count=1
+ test_for_each_ref "$1, --count=1, no sort" --no-sort --count=1
+ test_for_each_ref "$1, tags" refs/tags/
+ test_for_each_ref "$1, tags, no sort" --no-sort refs/tags/
+ test_for_each_ref "$1, tags, dereferenced" '--format="%(refname) %(objectname) %(*objectname)"' refs/tags/
+ test_for_each_ref "$1, tags, dereferenced, no sort" --no-sort '--format="%(refname) %(objectname) %(*objectname)"' refs/tags/
+
+ test_perf "for-each-ref ($1, tags) + cat-file --batch-check (dereferenced)" "
+ for i in \$(test_seq $test_iteration_count); do
+ git for-each-ref --format='%(objectname)^{} %(refname) %(objectname)' refs/tags/ | \
+ git cat-file --batch-check='%(objectname) %(rest)' >/dev/null
+ done
+ "
+}
+
+run_tests "loose"
+
+test_expect_success 'pack refs' '
+ git pack-refs --all
+'
+run_tests "packed"
+
+test_done
diff --git a/t/perf/p7102-reset.sh b/t/perf/p7102-reset.sh
new file mode 100755
index 0000000..9b039e8
--- /dev/null
+++ b/t/perf/p7102-reset.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+test_description='performance of reset'
+. ./perf-lib.sh
+
+test_perf_default_repo
+test_checkout_worktree
+
+test_perf 'reset --hard with change in tree' '
+ base=$(git rev-parse HEAD) &&
+ test_commit --no-tag A &&
+ new=$(git rev-parse HEAD) &&
+
+ for i in $(test_seq 10)
+ do
+ git reset --hard $new &&
+ git reset --hard $base || return $?
+ done
+'
+
+test_done
diff --git a/t/perf/p7527-builtin-fsmonitor.sh b/t/perf/p7527-builtin-fsmonitor.sh
index 9338b9e..c3f9a4c 100755
--- a/t/perf/p7527-builtin-fsmonitor.sh
+++ b/t/perf/p7527-builtin-fsmonitor.sh
@@ -249,7 +249,7 @@ test_expect_success "Cleanup temp and matrix branches" "
do
for fsm_val in $fsm_values
do
- cleanup $uc_val $fsm_val
+ cleanup $uc_val $fsm_val || return 1
done
done
"
diff --git a/t/perf/p7822-grep-perl-character.sh b/t/perf/p7822-grep-perl-character.sh
new file mode 100755
index 0000000..87009c6
--- /dev/null
+++ b/t/perf/p7822-grep-perl-character.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+test_description="git-grep's perl regex
+
+If GIT_PERF_GREP_THREADS is set to a list of threads (e.g. '1 4 8'
+etc.) we will test the patterns under those numbers of threads.
+"
+
+. ./perf-lib.sh
+
+test_perf_large_repo
+test_checkout_worktree
+
+if test -n "$GIT_PERF_GREP_THREADS"
+then
+ test_set_prereq PERF_GREP_ENGINES_THREADS
+fi
+
+for pattern in \
+ '\\bhow' \
+ '\\bÆvar' \
+ '\\d+ \\bÆvar' \
+ '\\bBelón\\b' \
+ '\\w{12}\\b'
+do
+ echo '$pattern' >pat
+ if ! test_have_prereq PERF_GREP_ENGINES_THREADS
+ then
+ test_perf "grep -P '$pattern'" --prereq PCRE "
+ git -P grep -f pat || :
+ "
+ else
+ for threads in $GIT_PERF_GREP_THREADS
+ do
+ test_perf "grep -P '$pattern' with $threads threads" --prereq PTHREADS,PCRE "
+ git -c grep.threads=$threads -P grep -f pat || :
+ "
+ done
+ fi
+done
+
+test_done
diff --git a/t/perf/p9210-scalar.sh b/t/perf/p9210-scalar.sh
new file mode 100755
index 0000000..265f7cd
--- /dev/null
+++ b/t/perf/p9210-scalar.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+test_description='test scalar performance'
+. ./perf-lib.sh
+
+test_perf_large_repo "$TRASH_DIRECTORY/to-clone"
+
+test_expect_success 'enable server-side partial clone' '
+ git -C to-clone config uploadpack.allowFilter true &&
+ git -C to-clone config uploadpack.allowAnySHA1InWant true
+'
+
+test_perf 'scalar clone' '
+ rm -rf scalar-clone &&
+ scalar clone "file://$(pwd)/to-clone" scalar-clone
+'
+
+test_perf 'git clone' '
+ rm -rf git-clone &&
+ git clone "file://$(pwd)/to-clone" git-clone
+'
+
+test_compare_perf () {
+ command=$1
+ shift
+ args=$*
+ test_perf "$command $args (scalar)" "
+ $command -C scalar-clone/src $args
+ "
+
+ test_perf "$command $args (non-scalar)" "
+ $command -C git-clone $args
+ "
+}
+
+test_compare_perf git status
+test_compare_perf test_commit --append --no-tag A
+
+test_done
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index 27c2801..ab0c763 100644
--- a/t/perf/perf-lib.sh
+++ b/t/perf/perf-lib.sh
@@ -15,7 +15,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see http://www.gnu.org/licenses/ .
+# along with this program. If not, see https://www.gnu.org/licenses/ .
# These variables must be set before the inclusion of test-lib.sh below,
# because it will change our working directory.
@@ -31,7 +31,7 @@ unset GIT_CONFIG_NOSYSTEM
GIT_CONFIG_SYSTEM="$TEST_DIRECTORY/perf/config"
export GIT_CONFIG_SYSTEM
-if test -n "$GIT_TEST_INSTALLED" -a -z "$PERF_SET_GIT_TEST_INSTALLED"
+if test -n "$GIT_TEST_INSTALLED" && test -z "$PERF_SET_GIT_TEST_INSTALLED"
then
error "Do not use GIT_TEST_INSTALLED with the perf tests.
@@ -49,6 +49,9 @@ export TEST_DIRECTORY TRASH_DIRECTORY GIT_BUILD_DIR GIT_TEST_CMP
MODERN_GIT=$GIT_BUILD_DIR/bin-wrappers/git
export MODERN_GIT
+MODERN_SCALAR=$GIT_BUILD_DIR/bin-wrappers/scalar
+export MODERN_SCALAR
+
perf_results_dir=$TEST_RESULTS_DIR
test -n "$GIT_PERF_SUBSECTION" && perf_results_dir="$perf_results_dir/$GIT_PERF_SUBSECTION"
mkdir -p "$perf_results_dir"
@@ -120,6 +123,10 @@ test_perf_create_repo_from () {
# status" due to a locked index. Since we have
# a copy it's fine to remove the lock.
rm .git/index.lock
+ fi &&
+ if test_bool_env GIT_PERF_USE_SCALAR false
+ then
+ "$MODERN_SCALAR" register
fi
) || error "failed to copy repository '$source' to '$repo'"
}
@@ -130,7 +137,11 @@ test_perf_fresh_repo () {
"$MODERN_GIT" init -q "$repo" &&
(
cd "$repo" &&
- test_perf_do_repo_symlink_config_
+ test_perf_do_repo_symlink_config_ &&
+ if test_bool_env GIT_PERF_USE_SCALAR false
+ then
+ "$MODERN_SCALAR" register
+ fi
)
}
diff --git a/t/perf/repos/inflate-repo.sh b/t/perf/repos/inflate-repo.sh
index fcfc992..412e4b4 100755
--- a/t/perf/repos/inflate-repo.sh
+++ b/t/perf/repos/inflate-repo.sh
@@ -33,7 +33,7 @@ do
done
git ls-tree -r HEAD >GEN_src_list
-nr_src_files=$(cat GEN_src_list | wc -l)
+nr_src_files=$(wc -l <GEN_src_list)
src_branch=$(git symbolic-ref --short HEAD)
diff --git a/t/perf/run b/t/perf/run
index 55219aa..486ead2 100755
--- a/t/perf/run
+++ b/t/perf/run
@@ -91,10 +91,10 @@ set_git_test_installed () {
run_dirs_helper () {
mydir=${1%/}
shift
- while test $# -gt 0 -a "$1" != -- -a ! -f "$1"; do
+ while test $# -gt 0 && test "$1" != -- && test ! -f "$1"; do
shift
done
- if test $# -gt 0 -a "$1" = --; then
+ if test $# -gt 0 && test "$1" = --; then
shift
fi
@@ -124,7 +124,7 @@ run_dirs_helper () {
}
run_dirs () {
- while test $# -gt 0 -a "$1" != -- -a ! -f "$1"; do
+ while test $# -gt 0 && test "$1" != -- && test ! -f "$1"; do
run_dirs_helper "$@"
shift
done
@@ -171,13 +171,17 @@ run_subsection () {
get_var_from_env_or_config "GIT_PERF_MAKE_COMMAND" "perf" "makeCommand"
get_var_from_env_or_config "GIT_PERF_MAKE_OPTS" "perf" "makeOpts"
+ get_var_from_env_or_config "GIT_PERF_USE_SCALAR" "perf" "useScalar" "--bool"
+ export GIT_PERF_USE_SCALAR
+
get_var_from_env_or_config "GIT_PERF_REPO_NAME" "perf" "repoName"
export GIT_PERF_REPO_NAME
GIT_PERF_AGGREGATING_LATER=t
export GIT_PERF_AGGREGATING_LATER
- if test $# = 0 -o "$1" = -- -o -f "$1"; then
+ if test $# = 0 || test "$1" = -- || test -f "$1"
+ then
set -- . "$@"
fi
@@ -229,10 +233,10 @@ then
)
elif test -n "$GIT_PERF_SUBSECTION"
then
- egrep "^$GIT_PERF_SUBSECTION\$" "$TEST_RESULTS_DIR"/run_subsections.names >/dev/null ||
+ grep -E "^$GIT_PERF_SUBSECTION\$" "$TEST_RESULTS_DIR"/run_subsections.names >/dev/null ||
die "subsection '$GIT_PERF_SUBSECTION' not found in '$GIT_PERF_CONFIG_FILE'"
- egrep "^$GIT_PERF_SUBSECTION\$" "$TEST_RESULTS_DIR"/run_subsections.names | while read -r subsec
+ grep -E "^$GIT_PERF_SUBSECTION\$" "$TEST_RESULTS_DIR"/run_subsections.names | while read -r subsec
do
(
GIT_PERF_SUBSECTION="$subsec"
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index 17a268c..6e300be 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -578,6 +578,78 @@ test_expect_success 'subtest: --run invalid range end' '
EOF_ERR
'
+test_expect_success 'subtest: --invert-exit-code without --immediate' '
+ run_sub_test_lib_test_err full-pass \
+ --invert-exit-code &&
+ check_sub_test_lib_test_err full-pass \
+ <<-\EOF_OUT 3<<-EOF_ERR
+ ok 1 - passing test #1
+ ok 2 - passing test #2
+ ok 3 - passing test #3
+ # passed all 3 test(s)
+ 1..3
+ # faking up non-zero exit with --invert-exit-code
+ EOF_OUT
+ EOF_ERR
+'
+
+test_expect_success 'subtest: --invert-exit-code with --immediate: all passed' '
+ run_sub_test_lib_test_err full-pass \
+ --invert-exit-code --immediate &&
+ check_sub_test_lib_test_err full-pass \
+ <<-\EOF_OUT 3<<-EOF_ERR
+ ok 1 - passing test #1
+ ok 2 - passing test #2
+ ok 3 - passing test #3
+ # passed all 3 test(s)
+ 1..3
+ # faking up non-zero exit with --invert-exit-code
+ EOF_OUT
+ EOF_ERR
+'
+
+test_expect_success 'subtest: --invert-exit-code without --immediate: partial pass' '
+ run_sub_test_lib_test partial-pass \
+ --invert-exit-code &&
+ check_sub_test_lib_test partial-pass <<-\EOF
+ ok 1 - passing test #1
+ not ok 2 - # TODO induced breakage (--invert-exit-code): failing test #2
+ # false
+ ok 3 - passing test #3
+ # failed 1 among 3 test(s)
+ 1..3
+ # faked up failures as TODO & now exiting with 0 due to --invert-exit-code
+ EOF
+'
+
+test_expect_success 'subtest: --invert-exit-code with --immediate: partial pass' '
+ run_sub_test_lib_test partial-pass \
+ --invert-exit-code --immediate &&
+ check_sub_test_lib_test partial-pass \
+ <<-\EOF_OUT 3<<-EOF_ERR
+ ok 1 - passing test #1
+ not ok 2 - # TODO induced breakage (--invert-exit-code): failing test #2
+ # false
+ 1..2
+ # faked up failures as TODO & now exiting with 0 due to --invert-exit-code
+ EOF_OUT
+ EOF_ERR
+'
+
+test_expect_success 'subtest: --invert-exit-code --immediate: got a failure' '
+ run_sub_test_lib_test partial-pass \
+ --invert-exit-code --immediate &&
+ check_sub_test_lib_test_err partial-pass \
+ <<-\EOF_OUT 3<<-EOF_ERR
+ ok 1 - passing test #1
+ not ok 2 - # TODO induced breakage (--invert-exit-code): failing test #2
+ # false
+ 1..2
+ # faked up failures as TODO & now exiting with 0 due to --invert-exit-code
+ EOF_OUT
+ EOF_ERR
+'
+
test_expect_success 'subtest: tests respect prerequisites' '
write_and_run_sub_test_lib_test prereqs <<-\EOF &&
@@ -743,7 +815,8 @@ test_expect_success 'test_oid provides sane info by default' '
grep "^00*\$" actual &&
rawsz="$(test_oid rawsz)" &&
hexsz="$(test_oid hexsz)" &&
- test "$hexsz" -eq $(wc -c <actual) &&
+ # +1 accounts for the trailing newline
+ test $(( $hexsz + 1)) -eq $(wc -c <actual) &&
test $(( $rawsz * 2)) -eq "$hexsz"
'
@@ -754,7 +827,7 @@ test_expect_success 'test_oid can look up data for SHA-1' '
grep "^00*\$" actual &&
rawsz="$(test_oid rawsz)" &&
hexsz="$(test_oid hexsz)" &&
- test $(wc -c <actual) -eq 40 &&
+ test $(wc -c <actual) -eq 41 &&
test "$rawsz" -eq 20 &&
test "$hexsz" -eq 40
'
@@ -766,7 +839,7 @@ test_expect_success 'test_oid can look up data for SHA-256' '
grep "^00*\$" actual &&
rawsz="$(test_oid rawsz)" &&
hexsz="$(test_oid hexsz)" &&
- test $(wc -c <actual) -eq 64 &&
+ test $(wc -c <actual) -eq 65 &&
test "$rawsz" -eq 32 &&
test "$hexsz" -eq 64
'
@@ -941,7 +1014,7 @@ test_expect_success 'validate object ID for a known tree' '
'
test_expect_success 'showing tree with git ls-tree' '
- git ls-tree $tree >current
+ git ls-tree $tree >current
'
test_expect_success 'git ls-tree output for a known tree' '
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index d479303..b131d66 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -168,8 +168,8 @@ test_expect_success 'reinit' '
git -c init.defaultBranch=initial init >out1 2>err1 &&
git init >out2 2>err2
) &&
- test_i18ngrep "Initialized empty" again/out1 &&
- test_i18ngrep "Reinitialized existing" again/out2 &&
+ test_grep "Initialized empty" again/out1 &&
+ test_grep "Reinitialized existing" again/out2 &&
test_must_be_empty again/err1 &&
test_must_be_empty again/err2
'
@@ -332,7 +332,7 @@ test_expect_success 'init with separate gitdir' '
test_expect_success 'explicit bare & --separate-git-dir incompatible' '
test_must_fail git init --bare --separate-git-dir goop.git bare.git 2>err &&
- test_i18ngrep "cannot be used together" err
+ test_grep "cannot be used together" err
'
test_expect_success 'implicit bare & --separate-git-dir incompatible' '
@@ -340,7 +340,7 @@ test_expect_success 'implicit bare & --separate-git-dir incompatible' '
mkdir -p bare.git &&
test_must_fail env GIT_DIR=. \
git -C bare.git init --separate-git-dir goop.git 2>err &&
- test_i18ngrep "incompatible" err
+ test_grep "incompatible" err
'
test_expect_success 'bare & --separate-git-dir incompatible within worktree' '
@@ -349,7 +349,7 @@ test_expect_success 'bare & --separate-git-dir incompatible within worktree' '
git clone --bare . bare.git &&
git -C bare.git worktree add --detach ../linkwt &&
test_must_fail git -C linkwt init --separate-git-dir seprepo 2>err &&
- test_i18ngrep "incompatible" err
+ test_grep "incompatible" err
'
test_lazy_prereq GETCWD_IGNORES_PERMS '
@@ -532,6 +532,76 @@ test_expect_success 'init rejects attempts to initialize with different hash' '
test_must_fail git -C sha256 init --object-format=sha1
'
+test_expect_success DEFAULT_REPO_FORMAT 'extensions.refStorage is not allowed with repo version 0' '
+ test_when_finished "rm -rf refstorage" &&
+ git init refstorage &&
+ git -C refstorage config extensions.refStorage files &&
+ test_must_fail git -C refstorage rev-parse 2>err &&
+ grep "repo version is 0, but v1-only extension found" err
+'
+
+test_expect_success DEFAULT_REPO_FORMAT 'extensions.refStorage with files backend' '
+ test_when_finished "rm -rf refstorage" &&
+ git init refstorage &&
+ git -C refstorage config core.repositoryformatversion 1 &&
+ git -C refstorage config extensions.refStorage files &&
+ test_commit -C refstorage A &&
+ git -C refstorage rev-parse --verify HEAD
+'
+
+test_expect_success DEFAULT_REPO_FORMAT 'extensions.refStorage with unknown backend' '
+ test_when_finished "rm -rf refstorage" &&
+ git init refstorage &&
+ git -C refstorage config core.repositoryformatversion 1 &&
+ git -C refstorage config extensions.refStorage garbage &&
+ test_must_fail git -C refstorage rev-parse 2>err &&
+ grep "invalid value for ${SQ}extensions.refstorage${SQ}: ${SQ}garbage${SQ}" err
+'
+
+test_expect_success DEFAULT_REPO_FORMAT 'init with GIT_DEFAULT_REF_FORMAT=files' '
+ test_when_finished "rm -rf refformat" &&
+ GIT_DEFAULT_REF_FORMAT=files git init refformat &&
+ echo 0 >expect &&
+ git -C refformat config core.repositoryformatversion >actual &&
+ test_cmp expect actual &&
+ test_must_fail git -C refformat config extensions.refstorage
+'
+
+test_expect_success 'init with GIT_DEFAULT_REF_FORMAT=garbage' '
+ test_when_finished "rm -rf refformat" &&
+ cat >expect <<-EOF &&
+ fatal: unknown ref storage format ${SQ}garbage${SQ}
+ EOF
+ test_must_fail env GIT_DEFAULT_REF_FORMAT=garbage git init refformat 2>err &&
+ test_cmp expect err
+'
+
+test_expect_success 'init with --ref-format=files' '
+ test_when_finished "rm -rf refformat" &&
+ git init --ref-format=files refformat &&
+ echo files >expect &&
+ git -C refformat rev-parse --show-ref-format >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 're-init with same format' '
+ test_when_finished "rm -rf refformat" &&
+ git init --ref-format=files refformat &&
+ git init --ref-format=files refformat &&
+ echo files >expect &&
+ git -C refformat rev-parse --show-ref-format >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'init with --ref-format=garbage' '
+ test_when_finished "rm -rf refformat" &&
+ cat >expect <<-EOF &&
+ fatal: unknown ref storage format ${SQ}garbage${SQ}
+ EOF
+ test_must_fail git init --ref-format=garbage refformat 2>err &&
+ test_cmp expect err
+'
+
test_expect_success MINGW 'core.hidedotfiles = false' '
git config --global core.hidedotfiles false &&
rm -rf newdir &&
@@ -563,7 +633,7 @@ test_expect_success '--initial-branch' '
: re-initializing should not change the branch name &&
git init --initial-branch=ignore initial-branch-option 2>err &&
- test_i18ngrep "ignored --initial-branch" err &&
+ test_grep "ignored --initial-branch" err &&
git -C initial-branch-option symbolic-ref HEAD >actual &&
grep hello actual
'
@@ -579,7 +649,7 @@ test_expect_success 'advice on unconfigured init.defaultBranch' '
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= git -c color.advice=always \
init unconfigured-default-branch-name 2>err &&
test_decode_color <err >decoded &&
- test_i18ngrep "<YELLOW>hint: " decoded
+ test_grep "<YELLOW>hint: " decoded
'
test_expect_success 'overridden default main branch name (env)' '
@@ -592,15 +662,20 @@ test_expect_success 'overridden default main branch name (env)' '
test_expect_success 'invalid default branch name' '
test_must_fail env GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME="with space" \
git init initial-branch-invalid 2>err &&
- test_i18ngrep "invalid branch name" err
+ test_grep "invalid branch name" err
'
test_expect_success 'branch -m with the initial branch' '
git init rename-initial &&
git -C rename-initial branch -m renamed &&
- test renamed = $(git -C rename-initial symbolic-ref --short HEAD) &&
+ echo renamed >expect &&
+ git -C rename-initial symbolic-ref --short HEAD >actual &&
+ test_cmp expect actual &&
+
git -C rename-initial branch -m renamed again &&
- test again = $(git -C rename-initial symbolic-ref --short HEAD)
+ echo again >expect &&
+ git -C rename-initial symbolic-ref --short HEAD >actual &&
+ test_cmp expect actual
'
test_done
diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh
index f6356db..bf3bf60 100755
--- a/t/t0002-gitfile.sh
+++ b/t/t0002-gitfile.sh
@@ -22,23 +22,25 @@ test_expect_success 'initial setup' '
test_expect_success 'bad setup: invalid .git file format' '
echo "gitdir $REAL" >.git &&
test_must_fail git rev-parse 2>.err &&
- test_i18ngrep "invalid gitfile format" .err
+ test_grep "invalid gitfile format" .err
'
test_expect_success 'bad setup: invalid .git file path' '
echo "gitdir: $REAL.not" >.git &&
test_must_fail git rev-parse 2>.err &&
- test_i18ngrep "not a git repository" .err
+ test_grep "not a git repository" .err
'
test_expect_success 'final setup + check rev-parse --git-dir' '
echo "gitdir: $REAL" >.git &&
- test "$REAL" = "$(git rev-parse --git-dir)"
+ echo "$REAL" >expect &&
+ git rev-parse --git-dir >actual &&
+ test_cmp expect actual
'
test_expect_success 'check hash-object' '
echo "foo" >bar &&
- SHA=$(cat bar | git hash-object -w --stdin) &&
+ SHA=$(git hash-object -w --stdin <bar) &&
test_path_is_file "$REAL/objects/$(objpath $SHA)"
'
@@ -65,7 +67,7 @@ test_expect_success 'check commit-tree' '
test_path_is_file "$REAL/objects/$(objpath $SHA)"
'
-test_expect_success !SANITIZE_LEAK 'check rev-list' '
+test_expect_success 'check rev-list' '
git update-ref "HEAD" "$SHA" &&
git rev-list HEAD >actual &&
echo $SHA >expected &&
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh
index 143f100..774b52c 100755
--- a/t/t0003-attributes.sh
+++ b/t/t0003-attributes.sh
@@ -3,6 +3,7 @@
test_description=gitattributes
TEST_PASSES_SANITIZE_LEAK=true
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
attr_check_basic () {
@@ -18,13 +19,48 @@ attr_check () {
test_must_be_empty err
}
+attr_check_object_mode_basic () {
+ path="$1" &&
+ expect="$2" &&
+ check_opts="$3" &&
+ git check-attr $check_opts builtin_objectmode -- "$path" >actual 2>err &&
+ echo "$path: builtin_objectmode: $expect" >expect &&
+ test_cmp expect actual
+}
+
+attr_check_object_mode () {
+ attr_check_object_mode_basic "$@" &&
+ test_must_be_empty err
+}
+
attr_check_quote () {
path="$1" quoted_path="$2" expect="$3" &&
git check-attr test -- "$path" >actual &&
echo "\"$quoted_path\": test: $expect" >expect &&
test_cmp expect actual
+}
+
+attr_check_source () {
+ path="$1" expect="$2" source="$3" git_opts="$4" &&
+ echo "$path: test: $expect" >expect &&
+
+ git $git_opts check-attr --source $source test -- "$path" >actual 2>err &&
+ test_cmp expect actual &&
+ test_must_be_empty err &&
+
+ git $git_opts --attr-source="$source" check-attr test -- "$path" >actual 2>err &&
+ test_cmp expect actual &&
+ test_must_be_empty err
+
+ git $git_opts -c "attr.tree=$source" check-attr test -- "$path" >actual 2>err &&
+ test_cmp expect actual &&
+ test_must_be_empty err
+
+ GIT_ATTR_SOURCE="$source" git $git_opts check-attr test -- "$path" >actual 2>err &&
+ test_cmp expect actual &&
+ test_must_be_empty err
}
test_expect_success 'open-quoted pathname' '
@@ -32,7 +68,6 @@ test_expect_success 'open-quoted pathname' '
attr_check a unspecified
'
-
test_expect_success 'setup' '
mkdir -p a/b/d a/c b &&
(
@@ -79,12 +114,23 @@ test_expect_success 'setup' '
EOF
'
+test_expect_success 'setup branches' '
+ mkdir -p foo/bar &&
+ test_commit --printf "add .gitattributes" foo/bar/.gitattributes \
+ "f test=f\na/i test=n\n" tag-1 &&
+ test_commit --printf "add .gitattributes" foo/bar/.gitattributes \
+ "g test=g\na/i test=m\n" tag-2 &&
+ rm foo/bar/.gitattributes
+'
+
test_expect_success 'command line checks' '
test_must_fail git check-attr &&
test_must_fail git check-attr -- &&
test_must_fail git check-attr test &&
test_must_fail git check-attr test -- &&
test_must_fail git check-attr -- f &&
+ test_must_fail git check-attr --source &&
+ test_must_fail git check-attr --source not-a-valid-ref &&
echo "f" | test_must_fail git check-attr --stdin &&
echo "f" | test_must_fail git check-attr --stdin -- f &&
echo "f" | test_must_fail git check-attr --stdin test -- f &&
@@ -202,9 +248,12 @@ test_expect_success 'attribute test: read paths from stdin' '
test_cmp expect actual
'
-test_expect_success 'attribute test: --all option' '
+test_expect_success 'setup --all option' '
grep -v unspecified <expect-all | sort >specified-all &&
- sed -e "s/:.*//" <expect-all | uniq >stdin-all &&
+ sed -e "s/:.*//" <expect-all | uniq >stdin-all
+'
+
+test_expect_success 'attribute test: --all option' '
git check-attr --stdin --all <stdin-all >tmp &&
sort tmp >actual &&
test_cmp specified-all actual
@@ -228,7 +277,7 @@ test_expect_success 'root subdir attribute test' '
test_expect_success 'negative patterns' '
echo "!f test=bar" >.gitattributes &&
git check-attr test -- '"'"'!f'"'"' 2>errors &&
- test_i18ngrep "Negative patterns are ignored" errors
+ test_grep "Negative patterns are ignored" errors
'
test_expect_success 'patterns starting with exclamation' '
@@ -283,8 +332,17 @@ test_expect_success 'using --git-dir and --work-tree' '
)
'
+test_expect_success 'using --source' '
+ attr_check_source foo/bar/f f tag-1 &&
+ attr_check_source foo/bar/a/i n tag-1 &&
+ attr_check_source foo/bar/f unspecified tag-2 &&
+ attr_check_source foo/bar/a/i m tag-2 &&
+ attr_check_source foo/bar/g g tag-2 &&
+ attr_check_source foo/bar/g unspecified tag-1
+'
+
test_expect_success 'setup bare' '
- git clone --bare . bare.git
+ git clone --template= --bare . bare.git
'
test_expect_success 'bare repository: check that .gitattribute is ignored' '
@@ -302,6 +360,86 @@ test_expect_success 'bare repository: check that .gitattribute is ignored' '
)
'
+bad_attr_source_err="fatal: bad --attr-source or GIT_ATTR_SOURCE"
+
+test_expect_success '--attr-source is bad' '
+ test_when_finished rm -rf empty &&
+ git init empty &&
+ (
+ cd empty &&
+ echo "$bad_attr_source_err" >expect_err &&
+ test_must_fail git --attr-source=HEAD check-attr test -- f/path 2>err &&
+ test_cmp expect_err err
+ )
+'
+
+test_expect_success 'attr.tree when HEAD is unborn' '
+ test_when_finished rm -rf empty &&
+ git init empty &&
+ (
+ cd empty &&
+ echo "f/path: test: unspecified" >expect &&
+ git -c attr.tree=HEAD check-attr test -- f/path >actual 2>err &&
+ test_must_be_empty err &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'bad attr source defaults to reading .gitattributes file' '
+ test_when_finished rm -rf empty &&
+ git init empty &&
+ (
+ cd empty &&
+ echo "f/path test=val" >.gitattributes &&
+ echo "f/path: test: val" >expect &&
+ git -c attr.tree=HEAD check-attr test -- f/path >actual 2>err &&
+ test_must_be_empty err &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'bare repo defaults to reading .gitattributes from HEAD' '
+ test_when_finished rm -rf test bare_with_gitattribute &&
+ git init test &&
+ test_commit -C test gitattributes .gitattributes "f/path test=val" &&
+ git clone --bare test bare_with_gitattribute &&
+ echo "f/path: test: val" >expect &&
+ git -C bare_with_gitattribute check-attr test -- f/path >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'precedence of --attr-source, GIT_ATTR_SOURCE, then attr.tree' '
+ test_when_finished rm -rf empty &&
+ git init empty &&
+ (
+ cd empty &&
+ git checkout -b attr-source &&
+ test_commit "val1" .gitattributes "f/path test=val1" &&
+ git checkout -b attr-tree &&
+ test_commit "val2" .gitattributes "f/path test=val2" &&
+ git checkout attr-source &&
+ echo "f/path: test: val1" >expect &&
+ GIT_ATTR_SOURCE=attr-source git -c attr.tree=attr-tree --attr-source=attr-source \
+ check-attr test -- f/path >actual &&
+ test_cmp expect actual &&
+ GIT_ATTR_SOURCE=attr-source git -c attr.tree=attr-tree \
+ check-attr test -- f/path >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'bare repository: with --source' '
+ (
+ cd bare.git &&
+ attr_check_source foo/bar/f f tag-1 &&
+ attr_check_source foo/bar/a/i n tag-1 &&
+ attr_check_source foo/bar/f unspecified tag-2 &&
+ attr_check_source foo/bar/a/i m tag-2 &&
+ attr_check_source foo/bar/g g tag-2 &&
+ attr_check_source foo/bar/g unspecified tag-1
+ )
+'
+
test_expect_success 'bare repository: check that --cached honors index' '
(
cd bare.git &&
@@ -315,6 +453,7 @@ test_expect_success 'bare repository: check that --cached honors index' '
test_expect_success 'bare repository: test info/attributes' '
(
cd bare.git &&
+ mkdir info &&
(
echo "f test=f" &&
echo "a/i test=a/i"
@@ -360,6 +499,7 @@ test_expect_success SYMLINKS 'symlinks respected in core.attributesFile' '
test_expect_success SYMLINKS 'symlinks respected in info/attributes' '
test_when_finished "rm .git/info/attributes" &&
+ mkdir .git/info &&
ln -s ../../attr .git/info/attributes &&
attr_check file set
'
@@ -370,7 +510,128 @@ test_expect_success SYMLINKS 'symlinks not respected in-tree' '
mkdir subdir &&
ln -s ../attr subdir/.gitattributes &&
attr_check_basic subdir/file unspecified &&
- test_i18ngrep "unable to access.*gitattributes" err
+ test_grep "unable to access.*gitattributes" err
+'
+
+test_expect_success 'large attributes line ignored in tree' '
+ test_when_finished "rm .gitattributes" &&
+ printf "path %02043d" 1 >.gitattributes &&
+ git check-attr --all path >actual 2>err &&
+ echo "warning: ignoring overly long attributes line 1" >expect &&
+ test_cmp expect err &&
+ test_must_be_empty actual
+'
+
+test_expect_success 'large attributes line ignores trailing content in tree' '
+ test_when_finished "rm .gitattributes" &&
+ # older versions of Git broke lines at 2048 bytes; the 2045 bytes
+ # of 0-padding here is accounting for the three bytes of "a 1", which
+ # would knock "trailing" to the "next" line, where it would be
+ # erroneously parsed.
+ printf "a %02045dtrailing attribute\n" 1 >.gitattributes &&
+ git check-attr --all trailing >actual 2>err &&
+ echo "warning: ignoring overly long attributes line 1" >expect &&
+ test_cmp expect err &&
+ test_must_be_empty actual
+'
+
+test_expect_success EXPENSIVE 'large attributes file ignored in tree' '
+ test_when_finished "rm .gitattributes" &&
+ dd if=/dev/zero of=.gitattributes bs=1048576 count=101 2>/dev/null &&
+ git check-attr --all path >/dev/null 2>err &&
+ echo "warning: ignoring overly large gitattributes file ${SQ}.gitattributes${SQ}" >expect &&
+ test_cmp expect err
+'
+
+test_expect_success 'large attributes line ignored in index' '
+ test_when_finished "git update-index --remove .gitattributes" &&
+ blob=$(printf "path %02043d" 1 | git hash-object -w --stdin) &&
+ git update-index --add --cacheinfo 100644,$blob,.gitattributes &&
+ git check-attr --cached --all path >actual 2>err &&
+ echo "warning: ignoring overly long attributes line 1" >expect &&
+ test_cmp expect err &&
+ test_must_be_empty actual
+'
+
+test_expect_success 'large attributes line ignores trailing content in index' '
+ test_when_finished "git update-index --remove .gitattributes" &&
+ blob=$(printf "a %02045dtrailing attribute\n" 1 | git hash-object -w --stdin) &&
+ git update-index --add --cacheinfo 100644,$blob,.gitattributes &&
+ git check-attr --cached --all trailing >actual 2>err &&
+ echo "warning: ignoring overly long attributes line 1" >expect &&
+ test_cmp expect err &&
+ test_must_be_empty actual
+'
+
+test_expect_success EXPENSIVE 'large attributes file ignored in index' '
+ test_when_finished "git update-index --remove .gitattributes" &&
+ blob=$(dd if=/dev/zero bs=1048576 count=101 2>/dev/null | git hash-object -w --stdin) &&
+ git update-index --add --cacheinfo 100644,$blob,.gitattributes &&
+ git check-attr --cached --all path >/dev/null 2>err &&
+ echo "warning: ignoring overly large gitattributes blob ${SQ}.gitattributes${SQ}" >expect &&
+ test_cmp expect err
+'
+
+test_expect_success 'builtin object mode attributes work (dir and regular paths)' '
+ >normal &&
+ attr_check_object_mode normal 100644 &&
+ mkdir dir &&
+ attr_check_object_mode dir 040000
+'
+
+test_expect_success POSIXPERM 'builtin object mode attributes work (executable)' '
+ >exec &&
+ chmod +x exec &&
+ attr_check_object_mode exec 100755
+'
+
+test_expect_success SYMLINKS 'builtin object mode attributes work (symlinks)' '
+ ln -s to_sym sym &&
+ attr_check_object_mode sym 120000
+'
+
+test_expect_success 'native object mode attributes work with --cached' '
+ >normal &&
+ git add normal &&
+ empty_blob=$(git rev-parse :normal) &&
+ git update-index --index-info <<-EOF &&
+ 100755 $empty_blob 0 exec
+ 120000 $empty_blob 0 symlink
+ EOF
+ attr_check_object_mode normal 100644 --cached &&
+ attr_check_object_mode exec 100755 --cached &&
+ attr_check_object_mode symlink 120000 --cached
+'
+
+test_expect_success 'check object mode attributes work for submodules' '
+ mkdir sub &&
+ (
+ cd sub &&
+ git init &&
+ mv .git .real &&
+ echo "gitdir: .real" >.git &&
+ test_commit first
+ ) &&
+ attr_check_object_mode sub 160000 &&
+ attr_check_object_mode sub unspecified --cached &&
+ git add sub &&
+ attr_check_object_mode sub 160000 --cached
+'
+
+test_expect_success 'we do not allow user defined builtin_* attributes' '
+ echo "foo* builtin_foo" >.gitattributes &&
+ git add .gitattributes 2>actual &&
+ echo "builtin_foo is not a valid attribute name: .gitattributes:1" >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'user defined builtin_objectmode values are ignored' '
+ echo "foo* builtin_objectmode=12345" >.gitattributes &&
+ git add .gitattributes &&
+ >foo_1 &&
+ attr_check_object_mode_basic foo_1 100644 &&
+ echo "builtin_objectmode is not a valid attribute name: .gitattributes:1" >expect &&
+ test_cmp expect err
'
test_done
diff --git a/t/t0004-unwritable.sh b/t/t0004-unwritable.sh
index 2e9d652..8114fac 100755
--- a/t/t0004-unwritable.sh
+++ b/t/t0004-unwritable.sh
@@ -31,7 +31,7 @@ test_expect_success WRITE_TREE_OUT 'write-tree output on unwritable repository'
test_cmp expect out.write-tree
'
-test_expect_success POSIXPERM,SANITY,!SANITIZE_LEAK 'commit should notice unwritable repository' '
+test_expect_success POSIXPERM,SANITY 'commit should notice unwritable repository' '
test_when_finished "chmod 775 .git/objects .git/objects/??" &&
chmod a-w .git/objects .git/objects/?? &&
test_must_fail git commit -m second 2>out.commit
diff --git a/t/t0006-date.sh b/t/t0006-date.sh
index 2490162..3031256 100755
--- a/t/t0006-date.sh
+++ b/t/t0006-date.sh
@@ -46,6 +46,7 @@ check_show () {
TIME='1466000000 +0200'
check_show iso8601 "$TIME" '2016-06-15 16:13:20 +0200'
check_show iso8601-strict "$TIME" '2016-06-15T16:13:20+02:00'
+check_show iso8601-strict "$(echo "$TIME" | sed 's/+0200$/+0000/')" '2016-06-15T14:13:20Z'
check_show rfc2822 "$TIME" 'Wed, 15 Jun 2016 16:13:20 +0200'
check_show short "$TIME" '2016-06-15'
check_show default "$TIME" 'Wed Jun 15 16:13:20 2016 +0200'
@@ -69,6 +70,14 @@ check_show 'format:%s' '123456789 +1234' 123456789
check_show 'format:%s' '123456789 -1234' 123456789
check_show 'format-local:%s' '123456789 -1234' 123456789
+# negative TZ offset
+TIME='1466000000 -0200'
+check_show iso8601 "$TIME" '2016-06-15 12:13:20 -0200'
+check_show iso8601-strict "$TIME" '2016-06-15T12:13:20-02:00'
+check_show rfc2822 "$TIME" 'Wed, 15 Jun 2016 12:13:20 -0200'
+check_show default "$TIME" 'Wed Jun 15 12:13:20 2016 -0200'
+check_show raw "$TIME" '1466000000 -0200'
+
# arbitrary time absurdly far in the future
FUTURE="5758122296 -0400"
check_show iso "$FUTURE" "2152-06-19 18:24:56 -0400" TIME_IS_64BIT,TIME_T_IS_64BIT
@@ -88,6 +97,13 @@ check_parse 2008-02-14 bad
check_parse '2008-02-14 20:30:45' '2008-02-14 20:30:45 +0000'
check_parse '2008-02-14 20:30:45 -0500' '2008-02-14 20:30:45 -0500'
check_parse '2008.02.14 20:30:45 -0500' '2008-02-14 20:30:45 -0500'
+check_parse '20080214T20:30:45' '2008-02-14 20:30:45 +0000'
+check_parse '20080214T20:30' '2008-02-14 20:30:00 +0000'
+check_parse '20080214T20' '2008-02-14 20:00:00 +0000'
+check_parse '20080214T203045' '2008-02-14 20:30:45 +0000'
+check_parse '20080214T2030' '2008-02-14 20:30:00 +0000'
+check_parse '20080214T000000.20' '2008-02-14 00:00:00 +0000'
+check_parse '20080214T00:00:00.20' '2008-02-14 00:00:00 +0000'
check_parse '20080214T203045-04:00' '2008-02-14 20:30:45 -0400'
check_parse '20080214T203045 -04:00' '2008-02-14 20:30:45 -0400'
check_parse '20080214T203045.019-04:00' '2008-02-14 20:30:45 -0400'
@@ -99,6 +115,7 @@ check_parse '2008-02-14 20:30:45 -05' '2008-02-14 20:30:45 -0500'
check_parse '2008-02-14 20:30:45 -:30' '2008-02-14 20:30:45 +0000'
check_parse '2008-02-14 20:30:45 -05:00' '2008-02-14 20:30:45 -0500'
check_parse '2008-02-14 20:30:45' '2008-02-14 20:30:45 -0500' EST5
+check_parse 'Thu, 7 Apr 2005 15:14:13 -0700' '2005-04-07 15:14:13 -0700'
check_approxidate() {
echo "$1 -> $2 +0000" >expect
diff --git a/t/t0007-git-var.sh b/t/t0007-git-var.sh
index e56f4b9..ff4fd93 100755
--- a/t/t0007-git-var.sh
+++ b/t/t0007-git-var.sh
@@ -5,6 +5,12 @@ test_description='basic sanity checks for git var'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
+sane_unset_all_editors () {
+ sane_unset GIT_EDITOR &&
+ sane_unset VISUAL &&
+ sane_unset EDITOR
+}
+
test_expect_success 'get GIT_AUTHOR_IDENT' '
test_tick &&
echo "$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> $GIT_AUTHOR_DATE" >expect &&
@@ -47,6 +53,178 @@ test_expect_success 'get GIT_DEFAULT_BRANCH with configuration' '
)
'
+test_expect_success 'get GIT_EDITOR without configuration' '
+ (
+ sane_unset_all_editors &&
+ test_expect_code 1 git var GIT_EDITOR >out &&
+ test_must_be_empty out
+ )
+'
+
+test_expect_success 'get GIT_EDITOR with configuration' '
+ test_config core.editor foo &&
+ (
+ sane_unset_all_editors &&
+ echo foo >expect &&
+ git var GIT_EDITOR >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'get GIT_EDITOR with environment variable GIT_EDITOR' '
+ (
+ sane_unset_all_editors &&
+ echo bar >expect &&
+ GIT_EDITOR=bar git var GIT_EDITOR >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'get GIT_EDITOR with environment variable EDITOR' '
+ (
+ sane_unset_all_editors &&
+ echo bar >expect &&
+ EDITOR=bar git var GIT_EDITOR >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'get GIT_EDITOR with configuration and environment variable GIT_EDITOR' '
+ test_config core.editor foo &&
+ (
+ sane_unset_all_editors &&
+ echo bar >expect &&
+ GIT_EDITOR=bar git var GIT_EDITOR >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'get GIT_EDITOR with configuration and environment variable EDITOR' '
+ test_config core.editor foo &&
+ (
+ sane_unset_all_editors &&
+ echo foo >expect &&
+ EDITOR=bar git var GIT_EDITOR >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'get GIT_SEQUENCE_EDITOR without configuration' '
+ (
+ sane_unset GIT_SEQUENCE_EDITOR &&
+ git var GIT_EDITOR >expect &&
+ git var GIT_SEQUENCE_EDITOR >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'get GIT_SEQUENCE_EDITOR with configuration' '
+ test_config sequence.editor foo &&
+ (
+ sane_unset GIT_SEQUENCE_EDITOR &&
+ echo foo >expect &&
+ git var GIT_SEQUENCE_EDITOR >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'get GIT_SEQUENCE_EDITOR with environment variable' '
+ (
+ sane_unset GIT_SEQUENCE_EDITOR &&
+ echo bar >expect &&
+ GIT_SEQUENCE_EDITOR=bar git var GIT_SEQUENCE_EDITOR >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'get GIT_SEQUENCE_EDITOR with configuration and environment variable' '
+ test_config sequence.editor foo &&
+ (
+ sane_unset GIT_SEQUENCE_EDITOR &&
+ echo bar >expect &&
+ GIT_SEQUENCE_EDITOR=bar git var GIT_SEQUENCE_EDITOR >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success POSIXPERM 'GIT_SHELL_PATH points to a valid executable' '
+ shellpath=$(git var GIT_SHELL_PATH) &&
+ test_path_is_executable "$shellpath"
+'
+
+# We know in this environment that our shell will be one of a few fixed values
+# that all end in "sh".
+test_expect_success MINGW 'GIT_SHELL_PATH points to a suitable shell' '
+ shellpath=$(git var GIT_SHELL_PATH) &&
+ case "$shellpath" in
+ *sh) ;;
+ *) return 1;;
+ esac
+'
+
+test_expect_success 'GIT_ATTR_SYSTEM produces expected output' '
+ test_must_fail env GIT_ATTR_NOSYSTEM=1 git var GIT_ATTR_SYSTEM &&
+ (
+ sane_unset GIT_ATTR_NOSYSTEM &&
+ systempath=$(git var GIT_ATTR_SYSTEM) &&
+ test "$systempath" != ""
+ )
+'
+
+test_expect_success 'GIT_ATTR_GLOBAL points to the correct location' '
+ TRASHDIR="$(test-tool path-utils normalize_path_copy "$(pwd)")" &&
+ globalpath=$(XDG_CONFIG_HOME="$TRASHDIR/.config" git var GIT_ATTR_GLOBAL) &&
+ test "$globalpath" = "$TRASHDIR/.config/git/attributes" &&
+ (
+ sane_unset XDG_CONFIG_HOME &&
+ globalpath=$(HOME="$TRASHDIR" git var GIT_ATTR_GLOBAL) &&
+ test "$globalpath" = "$TRASHDIR/.config/git/attributes"
+ )
+'
+
+test_expect_success 'GIT_CONFIG_SYSTEM points to the correct location' '
+ TRASHDIR="$(test-tool path-utils normalize_path_copy "$(pwd)")" &&
+ test_must_fail env GIT_CONFIG_NOSYSTEM=1 git var GIT_CONFIG_SYSTEM &&
+ (
+ sane_unset GIT_CONFIG_NOSYSTEM &&
+ systempath=$(git var GIT_CONFIG_SYSTEM) &&
+ test "$systempath" != "" &&
+ systempath=$(GIT_CONFIG_SYSTEM=/dev/null git var GIT_CONFIG_SYSTEM) &&
+ if test_have_prereq MINGW
+ then
+ test "$systempath" = "nul"
+ else
+ test "$systempath" = "/dev/null"
+ fi &&
+ systempath=$(GIT_CONFIG_SYSTEM="$TRASHDIR/gitconfig" git var GIT_CONFIG_SYSTEM) &&
+ test "$systempath" = "$TRASHDIR/gitconfig"
+ )
+'
+
+test_expect_success 'GIT_CONFIG_GLOBAL points to the correct location' '
+ TRASHDIR="$(test-tool path-utils normalize_path_copy "$(pwd)")" &&
+ HOME="$TRASHDIR" XDG_CONFIG_HOME="$TRASHDIR/foo" git var GIT_CONFIG_GLOBAL >actual &&
+ echo "$TRASHDIR/foo/git/config" >expected &&
+ echo "$TRASHDIR/.gitconfig" >>expected &&
+ test_cmp expected actual &&
+ (
+ sane_unset XDG_CONFIG_HOME &&
+ HOME="$TRASHDIR" git var GIT_CONFIG_GLOBAL >actual &&
+ echo "$TRASHDIR/.config/git/config" >expected &&
+ echo "$TRASHDIR/.gitconfig" >>expected &&
+ test_cmp expected actual &&
+ globalpath=$(GIT_CONFIG_GLOBAL=/dev/null git var GIT_CONFIG_GLOBAL) &&
+ if test_have_prereq MINGW
+ then
+ test "$globalpath" = "nul"
+ else
+ test "$globalpath" = "/dev/null"
+ fi &&
+ globalpath=$(GIT_CONFIG_GLOBAL="$TRASHDIR/gitconfig" git var GIT_CONFIG_GLOBAL) &&
+ test "$globalpath" = "$TRASHDIR/gitconfig"
+ )
+'
+
# For git var -l, we check only a representative variable;
# testing the whole output would make our test too brittle with
# respect to unrelated changes in the test suite's environment.
@@ -64,8 +242,39 @@ test_expect_success 'git var -l lists config' '
test_cmp expect actual.bare
'
+test_expect_success 'git var -l lists multiple global configs' '
+ TRASHDIR="$(test-tool path-utils normalize_path_copy "$(pwd)")" &&
+ HOME="$TRASHDIR" XDG_CONFIG_HOME="$TRASHDIR/foo" git var -l >actual &&
+ grep "^GIT_CONFIG_GLOBAL=" actual >filtered &&
+ echo "GIT_CONFIG_GLOBAL=$TRASHDIR/foo/git/config" >expected &&
+ echo "GIT_CONFIG_GLOBAL=$TRASHDIR/.gitconfig" >>expected &&
+ test_cmp expected filtered
+'
+
+test_expect_success 'git var -l does not split multiline editors' '
+ (
+ GIT_EDITOR="!f() {
+ echo Hello!
+ }; f" &&
+ export GIT_EDITOR &&
+ echo "GIT_EDITOR=$GIT_EDITOR" >expected &&
+ git var -l >var &&
+ sed -n -e "/^GIT_EDITOR/,\$p" var | head -n 3 >actual &&
+ test_cmp expected actual
+ )
+'
+
test_expect_success 'listing and asking for variables are exclusive' '
test_must_fail git var -l GIT_COMMITTER_IDENT
'
+test_expect_success '`git var -l` works even without HOME' '
+ (
+ XDG_CONFIG_HOME= &&
+ export XDG_CONFIG_HOME &&
+ unset HOME &&
+ git var -l
+ )
+'
+
test_done
diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh
index 5575dad..361446b 100755
--- a/t/t0008-ignores.sh
+++ b/t/t0008-ignores.sh
@@ -3,6 +3,7 @@
test_description=check-ignore
TEST_PASSES_SANITIZE_LEAK=true
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
init_vars () {
@@ -48,7 +49,7 @@ broken_c_unquote_verbose () {
stderr_contains () {
regexp="$1"
- if test_i18ngrep "$regexp" "$HOME/stderr"
+ if test_grep "$regexp" "$HOME/stderr"
then
return 0
else
@@ -225,7 +226,8 @@ test_expect_success 'setup' '
!globaltwo
globalthree
EOF
- cat <<-\EOF >>.git/info/exclude
+ mkdir .git/info &&
+ cat <<-\EOF >.git/info/exclude
per-repo
EOF
'
@@ -543,9 +545,9 @@ test_expect_success_multi 'submodule from subdirectory' '' '
test_expect_success 'global ignore not yet enabled' '
expect_from_stdin <<-\EOF &&
- .git/info/exclude:7:per-repo per-repo
+ .git/info/exclude:1:per-repo per-repo
a/.gitignore:2:*three a/globalthree
- .git/info/exclude:7:per-repo a/per-repo
+ .git/info/exclude:1:per-repo a/per-repo
EOF
test_check_ignore "-v globalone per-repo a/globalthree a/per-repo not-ignored a/globaltwo"
'
@@ -566,10 +568,10 @@ test_expect_success 'global ignore with -v' '
enable_global_excludes &&
expect_from_stdin <<-EOF &&
$global_excludes:1:globalone globalone
- .git/info/exclude:7:per-repo per-repo
+ .git/info/exclude:1:per-repo per-repo
$global_excludes:3:globalthree globalthree
a/.gitignore:2:*three a/globalthree
- .git/info/exclude:7:per-repo a/per-repo
+ .git/info/exclude:1:per-repo a/per-repo
$global_excludes:2:!globaltwo globaltwo
EOF
test_check_ignore "-v globalone per-repo globalthree a/globalthree a/per-repo not-ignored globaltwo"
@@ -940,7 +942,7 @@ test_expect_success SYMLINKS 'symlinks not respected in-tree' '
ln -s ignore subdir/.gitignore &&
test_must_fail git check-ignore subdir/file >actual 2>err &&
test_must_be_empty actual &&
- test_i18ngrep "unable to access.*gitignore" err
+ test_grep "unable to access.*gitignore" err
'
test_done
diff --git a/t/t0009-prio-queue.sh b/t/t0009-prio-queue.sh
deleted file mode 100755
index eea9910..0000000
--- a/t/t0009-prio-queue.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh
-
-test_description='basic tests for priority queue implementation'
-
-TEST_PASSES_SANITIZE_LEAK=true
-. ./test-lib.sh
-
-cat >expect <<'EOF'
-1
-2
-3
-4
-5
-5
-6
-7
-8
-9
-10
-EOF
-test_expect_success 'basic ordering' '
- test-tool prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&
- test_cmp expect actual
-'
-
-cat >expect <<'EOF'
-2
-3
-4
-1
-5
-6
-EOF
-test_expect_success 'mixed put and get' '
- test-tool prio-queue 6 2 4 get 5 3 get get 1 dump >actual &&
- test_cmp expect actual
-'
-
-cat >expect <<'EOF'
-1
-2
-NULL
-1
-2
-NULL
-EOF
-test_expect_success 'notice empty queue' '
- test-tool prio-queue 1 2 get get get 1 2 get get get >actual &&
- test_cmp expect actual
-'
-
-cat >expect <<'EOF'
-3
-2
-6
-4
-5
-1
-8
-EOF
-test_expect_success 'stack order' '
- test-tool prio-queue stack 8 1 5 4 6 2 3 dump >actual &&
- test_cmp expect actual
-'
-
-test_done
diff --git a/t/t0010-racy-git.sh b/t/t0010-racy-git.sh
index 837c8b7..84172a3 100755
--- a/t/t0010-racy-git.sh
+++ b/t/t0010-racy-git.sh
@@ -10,25 +10,24 @@ TEST_PASSES_SANITIZE_LEAK=true
for trial in 0 1 2 3 4
do
- rm -f .git/index
- echo frotz >infocom
- git update-index --add infocom
- echo xyzzy >infocom
-
- files=$(git diff-files -p)
- test_expect_success \
- "Racy GIT trial #$trial part A" \
- 'test "" != "$files"'
-
+ test_expect_success "Racy git trial #$trial part A" '
+ rm -f .git/index &&
+ echo frotz >infocom &&
+ git update-index --add infocom &&
+ echo xyzzy >infocom &&
+
+ git diff-files -p >out &&
+ test_file_not_empty out
+ '
sleep 1
- echo xyzzy >cornerstone
- git update-index --add cornerstone
- files=$(git diff-files -p)
- test_expect_success \
- "Racy GIT trial #$trial part B" \
- 'test "" != "$files"'
+ test_expect_success "Racy git trial #$trial part B" '
+ echo xyzzy >cornerstone &&
+ git update-index --add cornerstone &&
+ git diff-files -p >out &&
+ test_file_not_empty out
+ '
done
test_done
diff --git a/t/t0011-hashmap.sh b/t/t0011-hashmap.sh
index 1cb6aa6..46e74ad 100755
--- a/t/t0011-hashmap.sh
+++ b/t/t0011-hashmap.sh
@@ -239,7 +239,7 @@ test_expect_success 'grow / shrink' '
echo value40 >> expect &&
echo size >> in &&
echo 64 39 >> expect &&
- cat in | test-tool hashmap > out &&
+ test-tool hashmap <in >out &&
test_cmp expect out
'
diff --git a/t/t0012-help.sh b/t/t0012-help.sh
index 6c33a43..1d273d9 100755
--- a/t/t0012-help.sh
+++ b/t/t0012-help.sh
@@ -44,6 +44,8 @@ test_expect_success 'invalid usage' '
test_expect_code 129 git help -g add &&
test_expect_code 129 git help -a -g &&
+ test_expect_code 129 git help --user-interfaces add &&
+
test_expect_code 129 git help -g -c &&
test_expect_code 129 git help --config-for-completion add &&
test_expect_code 129 git help --config-sections-for-completion add
@@ -98,17 +100,17 @@ test_expect_success "--help does not work for guides" "
test_expect_success 'git help' '
git help >help.output &&
- test_i18ngrep "^ clone " help.output &&
- test_i18ngrep "^ add " help.output &&
- test_i18ngrep "^ log " help.output &&
- test_i18ngrep "^ commit " help.output &&
- test_i18ngrep "^ fetch " help.output
+ test_grep "^ clone " help.output &&
+ test_grep "^ add " help.output &&
+ test_grep "^ log " help.output &&
+ test_grep "^ commit " help.output &&
+ test_grep "^ fetch " help.output
'
+
test_expect_success 'git help -g' '
git help -g >help.output &&
- test_i18ngrep "^ attributes " help.output &&
- test_i18ngrep "^ everyday " help.output &&
- test_i18ngrep "^ tutorial " help.output
+ test_grep "^ everyday " help.output &&
+ test_grep "^ tutorial " help.output
'
test_expect_success 'git help fails for non-existing html pages' '
@@ -127,6 +129,12 @@ test_expect_success 'git help succeeds without git.html' '
test_cmp expect test-browser.log
'
+test_expect_success 'git help --user-interfaces' '
+ git help --user-interfaces >help.output &&
+ grep "^ attributes " help.output &&
+ grep "^ mailmap " help.output
+'
+
test_expect_success 'git help -c' '
git help -c >help.output &&
cat >expect <<-\EOF &&
@@ -220,6 +228,10 @@ test_expect_success "'git help -a' section spacing" '
Low-level Commands / Syncing Repositories
Low-level Commands / Internal Helpers
+
+ User-facing repository, command and file interfaces
+
+ Developer-facing file formats, protocols and other interfaces
EOF
test_cmp expect actual
'
@@ -245,7 +257,7 @@ do
export GIT_CEILING_DIRECTORIES &&
test_expect_code 129 git -C sub $builtin -h >output 2>&1
) &&
- test_i18ngrep usage output
+ test_grep usage output
'
done <builtins
diff --git a/t/t0013-sha1dc.sh b/t/t0013-sha1dc.sh
index 9ad7608..0881417 100755
--- a/t/t0013-sha1dc.sh
+++ b/t/t0013-sha1dc.sh
@@ -6,15 +6,17 @@ TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
TEST_DATA="$TEST_DIRECTORY/t0013"
-if test -z "$DC_SHA1"
+test_lazy_prereq SHA1_IS_SHA1DC 'test-tool sha1-is-sha1dc'
+
+if ! test_have_prereq SHA1_IS_SHA1DC
then
- skip_all='skipping sha1 collision tests, DC_SHA1 not set'
+ skip_all='skipping sha1 collision tests, not using sha1collisiondetection'
test_done
fi
test_expect_success 'test-sha1 detects shattered pdf' '
test_must_fail test-tool sha1 <"$TEST_DATA/shattered-1.pdf" 2>err &&
- test_i18ngrep collision err &&
+ test_grep collision err &&
grep 38762cf7f55934b34d179ae6a4c80cadccbb7f0a err
'
diff --git a/t/t0014-alias.sh b/t/t0014-alias.sh
index 8d3d914..9556834 100755
--- a/t/t0014-alias.sh
+++ b/t/t0014-alias.sh
@@ -8,7 +8,7 @@ test_expect_success 'nested aliases - internal execution' '
git config alias.nested-internal-1 nested-internal-2 &&
git config alias.nested-internal-2 status &&
git nested-internal-1 >output &&
- test_i18ngrep "^On branch " output
+ test_grep "^On branch " output
'
test_expect_success 'nested aliases - mixed execution' '
@@ -16,7 +16,7 @@ test_expect_success 'nested aliases - mixed execution' '
git config alias.nested-external-2 "!git nested-external-3" &&
git config alias.nested-external-3 status &&
git nested-external-1 >output &&
- test_i18ngrep "^On branch " output
+ test_grep "^On branch " output
'
test_expect_success 'looping aliases - internal execution' '
@@ -24,7 +24,7 @@ test_expect_success 'looping aliases - internal execution' '
git config alias.loop-internal-2 loop-internal-3 &&
git config alias.loop-internal-3 loop-internal-2 &&
test_must_fail git loop-internal-1 2>output &&
- test_i18ngrep "^fatal: alias loop detected: expansion of" output
+ test_grep "^fatal: alias loop detected: expansion of" output
'
# This test is disabled until external loops are fixed, because would block
@@ -34,7 +34,7 @@ test_expect_success 'looping aliases - internal execution' '
# git config alias.loop-mixed-1 loop-mixed-2 &&
# git config alias.loop-mixed-2 "!git loop-mixed-1" &&
# test_must_fail git loop-mixed-1 2>output &&
-# test_i18ngrep "^fatal: alias loop detected: expansion of" output
+# test_grep "^fatal: alias loop detected: expansion of" output
#'
test_expect_success 'run-command formats empty args properly' '
diff --git a/t/t0015-hash.sh b/t/t0015-hash.sh
index 086822f..0a087a1 100755
--- a/t/t0015-hash.sh
+++ b/t/t0015-hash.sh
@@ -1,8 +1,9 @@
#!/bin/sh
test_description='test basic hash implementation'
-. ./test-lib.sh
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
test_expect_success 'test basic SHA-1 hash values' '
test-tool sha1 </dev/null >actual &&
diff --git a/t/t0017-env-helper.sh b/t/t0017-env-helper.sh
index 2e42fba..fc14ba0 100755
--- a/t/t0017-env-helper.sh
+++ b/t/t0017-env-helper.sh
@@ -1,87 +1,87 @@
#!/bin/sh
-test_description='test env--helper'
+test_description='test test-tool env-helper'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
-test_expect_success 'env--helper usage' '
- test_must_fail git env--helper &&
- test_must_fail git env--helper --type=bool &&
- test_must_fail git env--helper --type=ulong &&
- test_must_fail git env--helper --type=bool &&
- test_must_fail git env--helper --type=bool --default &&
- test_must_fail git env--helper --type=bool --default= &&
- test_must_fail git env--helper --defaultxyz
+test_expect_success 'test-tool env-helper usage' '
+ test_must_fail test-tool env-helper &&
+ test_must_fail test-tool env-helper --type=bool &&
+ test_must_fail test-tool env-helper --type=ulong &&
+ test_must_fail test-tool env-helper --type=bool &&
+ test_must_fail test-tool env-helper --type=bool --default &&
+ test_must_fail test-tool env-helper --type=bool --default= &&
+ test_must_fail test-tool env-helper --defaultxyz
'
-test_expect_success 'env--helper bad default values' '
- test_must_fail git env--helper --type=bool --default=1xyz MISSING &&
- test_must_fail git env--helper --type=ulong --default=1xyz MISSING
+test_expect_success 'test-tool env-helper bad default values' '
+ test_must_fail test-tool env-helper --type=bool --default=1xyz MISSING &&
+ test_must_fail test-tool env-helper --type=ulong --default=1xyz MISSING
'
-test_expect_success 'env--helper --type=bool' '
+test_expect_success 'test-tool env-helper --type=bool' '
# Test various --default bool values
echo true >expected &&
- git env--helper --type=bool --default=1 MISSING >actual &&
+ test-tool env-helper --type=bool --default=1 MISSING >actual &&
test_cmp expected actual &&
- git env--helper --type=bool --default=yes MISSING >actual &&
+ test-tool env-helper --type=bool --default=yes MISSING >actual &&
test_cmp expected actual &&
- git env--helper --type=bool --default=true MISSING >actual &&
+ test-tool env-helper --type=bool --default=true MISSING >actual &&
test_cmp expected actual &&
echo false >expected &&
- test_must_fail git env--helper --type=bool --default=0 MISSING >actual &&
+ test_must_fail test-tool env-helper --type=bool --default=0 MISSING >actual &&
test_cmp expected actual &&
- test_must_fail git env--helper --type=bool --default=no MISSING >actual &&
+ test_must_fail test-tool env-helper --type=bool --default=no MISSING >actual &&
test_cmp expected actual &&
- test_must_fail git env--helper --type=bool --default=false MISSING >actual &&
+ test_must_fail test-tool env-helper --type=bool --default=false MISSING >actual &&
test_cmp expected actual &&
# No output with --exit-code
- git env--helper --type=bool --default=true --exit-code MISSING >actual.out 2>actual.err &&
+ test-tool env-helper --type=bool --default=true --exit-code MISSING >actual.out 2>actual.err &&
test_must_be_empty actual.out &&
test_must_be_empty actual.err &&
- test_must_fail git env--helper --type=bool --default=false --exit-code MISSING >actual.out 2>actual.err &&
+ test_must_fail test-tool env-helper --type=bool --default=false --exit-code MISSING >actual.out 2>actual.err &&
test_must_be_empty actual.out &&
test_must_be_empty actual.err &&
# Existing variable
- EXISTS=true git env--helper --type=bool --default=false --exit-code EXISTS >actual.out 2>actual.err &&
+ EXISTS=true test-tool env-helper --type=bool --default=false --exit-code EXISTS >actual.out 2>actual.err &&
test_must_be_empty actual.out &&
test_must_be_empty actual.err &&
test_must_fail \
env EXISTS=false \
- git env--helper --type=bool --default=true --exit-code EXISTS >actual.out 2>actual.err &&
+ test-tool env-helper --type=bool --default=true --exit-code EXISTS >actual.out 2>actual.err &&
test_must_be_empty actual.out &&
test_must_be_empty actual.err
'
-test_expect_success 'env--helper --type=ulong' '
+test_expect_success 'test-tool env-helper --type=ulong' '
echo 1234567890 >expected &&
- git env--helper --type=ulong --default=1234567890 MISSING >actual.out 2>actual.err &&
+ test-tool env-helper --type=ulong --default=1234567890 MISSING >actual.out 2>actual.err &&
test_cmp expected actual.out &&
test_must_be_empty actual.err &&
echo 0 >expected &&
- test_must_fail git env--helper --type=ulong --default=0 MISSING >actual &&
+ test_must_fail test-tool env-helper --type=ulong --default=0 MISSING >actual &&
test_cmp expected actual &&
- git env--helper --type=ulong --default=1234567890 --exit-code MISSING >actual.out 2>actual.err &&
+ test-tool env-helper --type=ulong --default=1234567890 --exit-code MISSING >actual.out 2>actual.err &&
test_must_be_empty actual.out &&
test_must_be_empty actual.err &&
- EXISTS=1234567890 git env--helper --type=ulong --default=0 EXISTS --exit-code >actual.out 2>actual.err &&
+ EXISTS=1234567890 test-tool env-helper --type=ulong --default=0 EXISTS --exit-code >actual.out 2>actual.err &&
test_must_be_empty actual.out &&
test_must_be_empty actual.err &&
echo 1234567890 >expected &&
- EXISTS=1234567890 git env--helper --type=ulong --default=0 EXISTS >actual.out 2>actual.err &&
+ EXISTS=1234567890 test-tool env-helper --type=ulong --default=0 EXISTS >actual.out 2>actual.err &&
test_cmp expected actual.out &&
test_must_be_empty actual.err
'
-test_expect_success 'env--helper reads config thanks to trace2' '
+test_expect_success 'test-tool env-helper reads config thanks to trace2' '
mkdir home &&
git config -f home/.gitconfig include.path cycle &&
git config -f home/cycle include.path .gitconfig &&
@@ -93,7 +93,7 @@ test_expect_success 'env--helper reads config thanks to trace2' '
test_must_fail \
env HOME="$(pwd)/home" GIT_TEST_ENV_HELPER=true \
- git -C cycle env--helper --type=bool --default=0 --exit-code GIT_TEST_ENV_HELPER 2>err &&
+ test-tool -C cycle env-helper --type=bool --default=0 --exit-code GIT_TEST_ENV_HELPER 2>err &&
grep "exceeded maximum include depth" err
'
diff --git a/t/t0018-advice.sh b/t/t0018-advice.sh
index c13057a..0dcfb76 100755
--- a/t/t0018-advice.sh
+++ b/t/t0018-advice.sh
@@ -17,7 +17,6 @@ test_expect_success 'advice should be printed when config variable is unset' '
test_expect_success 'advice should be printed when config variable is set to true' '
cat >expect <<-\EOF &&
hint: This is a piece of advice
- hint: Disable this message with "git config advice.nestedTag false"
EOF
test_config advice.nestedTag true &&
test-tool advise "This is a piece of advice" 2>actual &&
diff --git a/t/t0019-json-writer.sh b/t/t0019-json-writer.sh
index 3b0c336..19a730c 100755
--- a/t/t0019-json-writer.sh
+++ b/t/t0019-json-writer.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='test json-writer JSON generation'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'unit test of json-writer routines' '
diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index 35cc8c3..81946e8 100755
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
@@ -125,7 +125,7 @@ test_expect_success 'update with autocrlf=input' '
munge_cr append dir/two &&
git update-index -- one dir/two &&
differs=$(git diff-index --cached HEAD) &&
- verbose test -z "$differs"
+ test -z "$differs"
'
@@ -138,7 +138,7 @@ test_expect_success 'update with autocrlf=true' '
munge_cr append dir/two &&
git update-index -- one dir/two &&
differs=$(git diff-index --cached HEAD) &&
- verbose test -z "$differs"
+ test -z "$differs"
'
@@ -153,7 +153,7 @@ test_expect_success 'checkout with autocrlf=true' '
test "$one" = $(git hash-object --stdin <one) &&
test "$two" = $(git hash-object --stdin <dir/two) &&
differs=$(git diff-index --cached HEAD) &&
- verbose test -z "$differs"
+ test -z "$differs"
'
test_expect_success 'checkout with autocrlf=input' '
@@ -167,7 +167,7 @@ test_expect_success 'checkout with autocrlf=input' '
test "$one" = $(git hash-object --stdin <one) &&
test "$two" = $(git hash-object --stdin <dir/two) &&
differs=$(git diff-index --cached HEAD) &&
- verbose test -z "$differs"
+ test -z "$differs"
'
test_expect_success 'apply patch (autocrlf=input)' '
@@ -177,7 +177,7 @@ test_expect_success 'apply patch (autocrlf=input)' '
git read-tree --reset -u HEAD &&
git apply patch.file &&
- verbose test "$patched" = "$(git hash-object --stdin <one)"
+ test "$patched" = "$(git hash-object --stdin <one)"
'
test_expect_success 'apply patch --cached (autocrlf=input)' '
@@ -187,7 +187,7 @@ test_expect_success 'apply patch --cached (autocrlf=input)' '
git read-tree --reset -u HEAD &&
git apply --cached patch.file &&
- verbose test "$patched" = $(git rev-parse :one)
+ test "$patched" = $(git rev-parse :one)
'
test_expect_success 'apply patch --index (autocrlf=input)' '
@@ -197,8 +197,8 @@ test_expect_success 'apply patch --index (autocrlf=input)' '
git read-tree --reset -u HEAD &&
git apply --index patch.file &&
- verbose test "$patched" = $(git rev-parse :one) &&
- verbose test "$patched" = $(git hash-object --stdin <one)
+ test "$patched" = $(git rev-parse :one) &&
+ test "$patched" = $(git hash-object --stdin <one)
'
test_expect_success 'apply patch (autocrlf=true)' '
@@ -208,7 +208,7 @@ test_expect_success 'apply patch (autocrlf=true)' '
git read-tree --reset -u HEAD &&
git apply patch.file &&
- verbose test "$patched" = "$(remove_cr <one | git hash-object --stdin)"
+ test "$patched" = "$(remove_cr <one | git hash-object --stdin)"
'
test_expect_success 'apply patch --cached (autocrlf=true)' '
@@ -218,7 +218,7 @@ test_expect_success 'apply patch --cached (autocrlf=true)' '
git read-tree --reset -u HEAD &&
git apply --cached patch.file &&
- verbose test "$patched" = $(git rev-parse :one)
+ test "$patched" = $(git rev-parse :one)
'
test_expect_success 'apply patch --index (autocrlf=true)' '
@@ -228,8 +228,8 @@ test_expect_success 'apply patch --index (autocrlf=true)' '
git read-tree --reset -u HEAD &&
git apply --index patch.file &&
- verbose test "$patched" = $(git rev-parse :one) &&
- verbose test "$patched" = "$(remove_cr <one | git hash-object --stdin)"
+ test "$patched" = $(git rev-parse :one) &&
+ test "$patched" = "$(remove_cr <one | git hash-object --stdin)"
'
test_expect_success '.gitattributes says two is binary' '
@@ -240,7 +240,7 @@ test_expect_success '.gitattributes says two is binary' '
git read-tree --reset -u HEAD &&
! has_cr dir/two &&
- verbose has_cr one &&
+ has_cr one &&
! has_cr three
'
@@ -259,8 +259,8 @@ test_expect_success '.gitattributes says two and three are text' '
echo "t* crlf" >.gitattributes &&
git read-tree --reset -u HEAD &&
- verbose has_cr dir/two &&
- verbose has_cr three
+ has_cr dir/two &&
+ has_cr three
'
test_expect_success 'in-tree .gitattributes (1)' '
@@ -273,7 +273,7 @@ test_expect_success 'in-tree .gitattributes (1)' '
git read-tree --reset -u HEAD &&
! has_cr one &&
- verbose has_cr three
+ has_cr three
'
test_expect_success 'in-tree .gitattributes (2)' '
@@ -283,7 +283,7 @@ test_expect_success 'in-tree .gitattributes (2)' '
git checkout-index -f -q -u -a &&
! has_cr one &&
- verbose has_cr three
+ has_cr three
'
test_expect_success 'in-tree .gitattributes (3)' '
@@ -294,7 +294,7 @@ test_expect_success 'in-tree .gitattributes (3)' '
git checkout-index -u one dir/two three &&
! has_cr one &&
- verbose has_cr three
+ has_cr three
'
test_expect_success 'in-tree .gitattributes (4)' '
@@ -305,7 +305,7 @@ test_expect_success 'in-tree .gitattributes (4)' '
git checkout-index -u .gitattributes &&
! has_cr one &&
- verbose has_cr three
+ has_cr three
'
test_expect_success 'checkout with existing .gitattributes' '
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index 1c84034..0b49970 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -8,8 +8,8 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-terminal.sh
-TEST_ROOT="$PWD"
-PATH=$TEST_ROOT:$PATH
+PATH=$PWD:$PATH
+TEST_ROOT="$(pwd)"
write_script <<\EOF "$TEST_ROOT/rot13.sh"
tr \
@@ -17,9 +17,6 @@ tr \
'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM'
EOF
-write_script rot13-filter.pl "$PERL_PATH" \
- <"$TEST_DIRECTORY"/t0021/rot13-filter.pl
-
generate_random_characters () {
LEN=$1
NAME=$2
@@ -266,7 +263,7 @@ test_expect_success 'required filter with absent clean field' '
echo test >test.ac &&
test_must_fail git add test.ac 2>stderr &&
- test_i18ngrep "fatal: test.ac: clean filter .absentclean. failed" stderr
+ test_grep "fatal: test.ac: clean filter .absentclean. failed" stderr
'
test_expect_success 'required filter with absent smudge field' '
@@ -279,7 +276,7 @@ test_expect_success 'required filter with absent smudge field' '
git add test.as &&
rm -f test.as &&
test_must_fail git checkout -- test.as 2>stderr &&
- test_i18ngrep "fatal: test.as: smudge filter absentsmudge failed" stderr
+ test_grep "fatal: test.as: smudge filter absentsmudge failed" stderr
'
test_expect_success 'filtering large input to small output should use little memory' '
@@ -365,8 +362,8 @@ test_expect_success 'diff does not reuse worktree files that need cleaning' '
test_line_count = 0 count
'
-test_expect_success PERL 'required process filter should filter data' '
- test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
+test_expect_success 'required process filter should filter data' '
+ test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean smudge" &&
test_config_global filter.protocol.required true &&
rm -rf repo &&
mkdir repo &&
@@ -450,8 +447,8 @@ test_expect_success PERL 'required process filter should filter data' '
)
'
-test_expect_success PERL 'required process filter should filter data for various subcommands' '
- test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
+test_expect_success 'required process filter should filter data for various subcommands' '
+ test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean smudge" &&
test_config_global filter.protocol.required true &&
(
cd repo &&
@@ -561,9 +558,9 @@ test_expect_success PERL 'required process filter should filter data for various
)
'
-test_expect_success PERL 'required process filter takes precedence' '
+test_expect_success 'required process filter takes precedence' '
test_config_global filter.protocol.clean false &&
- test_config_global filter.protocol.process "rot13-filter.pl debug.log clean" &&
+ test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean" &&
test_config_global filter.protocol.required true &&
rm -rf repo &&
mkdir repo &&
@@ -587,8 +584,8 @@ test_expect_success PERL 'required process filter takes precedence' '
)
'
-test_expect_success PERL 'required process filter should be used only for "clean" operation only' '
- test_config_global filter.protocol.process "rot13-filter.pl debug.log clean" &&
+test_expect_success 'required process filter should be used only for "clean" operation only' '
+ test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean" &&
rm -rf repo &&
mkdir repo &&
(
@@ -622,8 +619,8 @@ test_expect_success PERL 'required process filter should be used only for "clean
)
'
-test_expect_success PERL 'required process filter should process multiple packets' '
- test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
+test_expect_success 'required process filter should process multiple packets' '
+ test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean smudge" &&
test_config_global filter.protocol.required true &&
rm -rf repo &&
@@ -687,8 +684,8 @@ test_expect_success PERL 'required process filter should process multiple packet
)
'
-test_expect_success PERL 'required process filter with clean error should fail' '
- test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
+test_expect_success 'required process filter with clean error should fail' '
+ test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean smudge" &&
test_config_global filter.protocol.required true &&
rm -rf repo &&
mkdir repo &&
@@ -706,8 +703,8 @@ test_expect_success PERL 'required process filter with clean error should fail'
)
'
-test_expect_success PERL 'process filter should restart after unexpected write failure' '
- test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
+test_expect_success 'process filter should restart after unexpected write failure' '
+ test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean smudge" &&
rm -rf repo &&
mkdir repo &&
(
@@ -735,8 +732,8 @@ test_expect_success PERL 'process filter should restart after unexpected write f
rm -f debug.log &&
git checkout --quiet --no-progress . 2>git-stderr.log &&
- grep "smudge write error at" git-stderr.log &&
- test_i18ngrep "error: external filter" git-stderr.log &&
+ grep "smudge write error" git-stderr.log &&
+ test_grep "error: external filter" git-stderr.log &&
cat >expected.log <<-EOF &&
START
@@ -761,8 +758,8 @@ test_expect_success PERL 'process filter should restart after unexpected write f
)
'
-test_expect_success PERL 'process filter should not be restarted if it signals an error' '
- test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
+test_expect_success 'process filter should not be restarted if it signals an error' '
+ test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean smudge" &&
rm -rf repo &&
mkdir repo &&
(
@@ -804,8 +801,8 @@ test_expect_success PERL 'process filter should not be restarted if it signals a
)
'
-test_expect_success PERL 'process filter abort stops processing of all further files' '
- test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
+test_expect_success 'process filter abort stops processing of all further files' '
+ test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean smudge" &&
rm -rf repo &&
mkdir repo &&
(
@@ -861,10 +858,10 @@ test_expect_success PERL 'invalid process filter must fail (and not hang!)' '
)
'
-test_expect_success PERL 'delayed checkout in process filter' '
- test_config_global filter.a.process "rot13-filter.pl a.log clean smudge delay" &&
+test_expect_success 'delayed checkout in process filter' '
+ test_config_global filter.a.process "test-tool rot13-filter --log=a.log clean smudge delay" &&
test_config_global filter.a.required true &&
- test_config_global filter.b.process "rot13-filter.pl b.log clean smudge delay" &&
+ test_config_global filter.b.process "test-tool rot13-filter --log=b.log clean smudge delay" &&
test_config_global filter.b.required true &&
rm -rf repo &&
@@ -940,8 +937,8 @@ test_expect_success PERL 'delayed checkout in process filter' '
)
'
-test_expect_success PERL 'missing file in delayed checkout' '
- test_config_global filter.bug.process "rot13-filter.pl bug.log clean smudge delay" &&
+test_expect_success 'missing file in delayed checkout' '
+ test_config_global filter.bug.process "test-tool rot13-filter --log=bug.log clean smudge delay" &&
test_config_global filter.bug.required true &&
rm -rf repo &&
@@ -960,8 +957,8 @@ test_expect_success PERL 'missing file in delayed checkout' '
grep "error: .missing-delay\.a. was not filtered properly" git-stderr.log
'
-test_expect_success PERL 'invalid file in delayed checkout' '
- test_config_global filter.bug.process "rot13-filter.pl bug.log clean smudge delay" &&
+test_expect_success 'invalid file in delayed checkout' '
+ test_config_global filter.bug.process "test-tool rot13-filter --log=bug.log clean smudge delay" &&
test_config_global filter.bug.required true &&
rm -rf repo &&
@@ -990,10 +987,10 @@ do
mode_prereq='UTF8_NFD_TO_NFC' ;;
esac
- test_expect_success PERL,SYMLINKS,$mode_prereq \
+ test_expect_success SYMLINKS,$mode_prereq \
"delayed checkout with $mode-collision don't write to the wrong place" '
test_config_global filter.delay.process \
- "\"$TEST_ROOT/rot13-filter.pl\" --always-delay delayed.log clean smudge delay" &&
+ "test-tool rot13-filter --always-delay --log=delayed.log clean smudge delay" &&
test_config_global filter.delay.required true &&
git init $mode-collision &&
@@ -1026,12 +1023,12 @@ do
'
done
-test_expect_success PERL,SYMLINKS,CASE_INSENSITIVE_FS \
+test_expect_success SYMLINKS,CASE_INSENSITIVE_FS \
"delayed checkout with submodule collision don't write to the wrong place" '
git init collision-with-submodule &&
(
cd collision-with-submodule &&
- git config filter.delay.process "\"$TEST_ROOT/rot13-filter.pl\" --always-delay delayed.log clean smudge delay" &&
+ git config filter.delay.process "test-tool rot13-filter --always-delay --log=delayed.log clean smudge delay" &&
git config filter.delay.required true &&
# We need Git to treat the submodule "a" and the
@@ -1062,11 +1059,11 @@ test_expect_success PERL,SYMLINKS,CASE_INSENSITIVE_FS \
)
'
-test_expect_success PERL 'setup for progress tests' '
+test_expect_success 'setup for progress tests' '
git init progress &&
(
cd progress &&
- git config filter.delay.process "rot13-filter.pl delay-progress.log clean smudge delay" &&
+ git config filter.delay.process "test-tool rot13-filter --log=delay-progress.log clean smudge delay" &&
git config filter.delay.required true &&
echo "*.a filter=delay" >.gitattributes &&
@@ -1132,12 +1129,12 @@ do
'
done
-test_expect_success PERL 'delayed checkout correctly reports the number of updated entries' '
+test_expect_success 'delayed checkout correctly reports the number of updated entries' '
rm -rf repo &&
git init repo &&
(
cd repo &&
- git config filter.delay.process "../rot13-filter.pl delayed.log clean smudge delay" &&
+ git config filter.delay.process "test-tool rot13-filter --log=delayed.log clean smudge delay" &&
git config filter.delay.required true &&
echo "*.a filter=delay" >.gitattributes &&
diff --git a/t/t0021/rot13-filter.pl b/t/t0021/rot13-filter.pl
deleted file mode 100644
index 7bb9376..0000000
--- a/t/t0021/rot13-filter.pl
+++ /dev/null
@@ -1,247 +0,0 @@
-#
-# Example implementation for the Git filter protocol version 2
-# See Documentation/gitattributes.txt, section "Filter Protocol"
-#
-# Usage: rot13-filter.pl [--always-delay] <log path> <capabilities>
-#
-# Log path defines a debug log file that the script writes to. The
-# subsequent arguments define a list of supported protocol capabilities
-# ("clean", "smudge", etc).
-#
-# When --always-delay is given all pathnames with the "can-delay" flag
-# that don't appear on the list bellow are delayed with a count of 1
-# (see more below).
-#
-# This implementation supports special test cases:
-# (1) If data with the pathname "clean-write-fail.r" is processed with
-# a "clean" operation then the write operation will die.
-# (2) If data with the pathname "smudge-write-fail.r" is processed with
-# a "smudge" operation then the write operation will die.
-# (3) If data with the pathname "error.r" is processed with any
-# operation then the filter signals that it cannot or does not want
-# to process the file.
-# (4) If data with the pathname "abort.r" is processed with any
-# operation then the filter signals that it cannot or does not want
-# to process the file and any file after that is processed with the
-# same command.
-# (5) If data with a pathname that is a key in the DELAY hash is
-# requested (e.g. "test-delay10.a") then the filter responds with
-# a "delay" status and sets the "requested" field in the DELAY hash.
-# The filter will signal the availability of this object after
-# "count" (field in DELAY hash) "list_available_blobs" commands.
-# (6) If data with the pathname "missing-delay.a" is processed that the
-# filter will drop the path from the "list_available_blobs" response.
-# (7) If data with the pathname "invalid-delay.a" is processed that the
-# filter will add the path "unfiltered" which was not delayed before
-# to the "list_available_blobs" response.
-#
-
-use 5.008;
-sub gitperllib {
- # Git assumes that all path lists are Unix-y colon-separated ones. But
- # when the Git for Windows executes the test suite, its MSYS2 Bash
- # calls git.exe, and colon-separated path lists are converted into
- # Windows-y semicolon-separated lists of *Windows* paths (which
- # naturally contain a colon after the drive letter, so splitting by
- # colons simply does not cut it).
- #
- # Detect semicolon-separated path list and handle them appropriately.
-
- if ($ENV{GITPERLLIB} =~ /;/) {
- return split(/;/, $ENV{GITPERLLIB});
- }
- return split(/:/, $ENV{GITPERLLIB});
-}
-use lib (gitperllib());
-use strict;
-use warnings;
-use IO::File;
-use Git::Packet;
-
-my $MAX_PACKET_CONTENT_SIZE = 65516;
-
-my $always_delay = 0;
-if ( $ARGV[0] eq '--always-delay' ) {
- $always_delay = 1;
- shift @ARGV;
-}
-
-my $log_file = shift @ARGV;
-my @capabilities = @ARGV;
-
-open my $debug, ">>", $log_file or die "cannot open log file: $!";
-
-my %DELAY = (
- 'test-delay10.a' => { "requested" => 0, "count" => 1 },
- 'test-delay11.a' => { "requested" => 0, "count" => 1 },
- 'test-delay20.a' => { "requested" => 0, "count" => 2 },
- 'test-delay10.b' => { "requested" => 0, "count" => 1 },
- 'missing-delay.a' => { "requested" => 0, "count" => 1 },
- 'invalid-delay.a' => { "requested" => 0, "count" => 1 },
-);
-
-sub rot13 {
- my $str = shift;
- $str =~ y/A-Za-z/N-ZA-Mn-za-m/;
- return $str;
-}
-
-print $debug "START\n";
-$debug->flush();
-
-packet_initialize("git-filter", 2);
-
-my %remote_caps = packet_read_and_check_capabilities("clean", "smudge", "delay");
-packet_check_and_write_capabilities(\%remote_caps, @capabilities);
-
-print $debug "init handshake complete\n";
-$debug->flush();
-
-while (1) {
- my ( $res, $command ) = packet_key_val_read("command");
- if ( $res == -1 ) {
- print $debug "STOP\n";
- exit();
- }
- print $debug "IN: $command";
- $debug->flush();
-
- if ( $command eq "list_available_blobs" ) {
- # Flush
- packet_compare_lists([1, ""], packet_bin_read()) ||
- die "bad list_available_blobs end";
-
- foreach my $pathname ( sort keys %DELAY ) {
- if ( $DELAY{$pathname}{"requested"} >= 1 ) {
- $DELAY{$pathname}{"count"} = $DELAY{$pathname}{"count"} - 1;
- if ( $pathname eq "invalid-delay.a" ) {
- # Send Git a pathname that was not delayed earlier
- packet_txt_write("pathname=unfiltered");
- }
- if ( $pathname eq "missing-delay.a" ) {
- # Do not signal Git that this file is available
- } elsif ( $DELAY{$pathname}{"count"} == 0 ) {
- print $debug " $pathname";
- packet_txt_write("pathname=$pathname");
- }
- }
- }
-
- packet_flush();
-
- print $debug " [OK]\n";
- $debug->flush();
- packet_txt_write("status=success");
- packet_flush();
- } else {
- my ( $res, $pathname ) = packet_key_val_read("pathname");
- if ( $res == -1 ) {
- die "unexpected EOF while expecting pathname";
- }
- print $debug " $pathname";
- $debug->flush();
-
- # Read until flush
- my ( $done, $buffer ) = packet_txt_read();
- while ( $buffer ne '' ) {
- if ( $buffer eq "can-delay=1" ) {
- if ( exists $DELAY{$pathname} and $DELAY{$pathname}{"requested"} == 0 ) {
- $DELAY{$pathname}{"requested"} = 1;
- } elsif ( !exists $DELAY{$pathname} and $always_delay ) {
- $DELAY{$pathname} = { "requested" => 1, "count" => 1 };
- }
- } elsif ($buffer =~ /^(ref|treeish|blob)=/) {
- print $debug " $buffer";
- } else {
- # In general, filters need to be graceful about
- # new metadata, since it's documented that we
- # can pass any key-value pairs, but for tests,
- # let's be a little stricter.
- die "Unknown message '$buffer'";
- }
-
- ( $done, $buffer ) = packet_txt_read();
- }
- if ( $done == -1 ) {
- die "unexpected EOF after pathname '$pathname'";
- }
-
- my $input = "";
- {
- binmode(STDIN);
- my $buffer;
- my $done = 0;
- while ( !$done ) {
- ( $done, $buffer ) = packet_bin_read();
- $input .= $buffer;
- }
- if ( $done == -1 ) {
- die "unexpected EOF while reading input for '$pathname'";
- }
- print $debug " " . length($input) . " [OK] -- ";
- $debug->flush();
- }
-
- my $output;
- if ( exists $DELAY{$pathname} and exists $DELAY{$pathname}{"output"} ) {
- $output = $DELAY{$pathname}{"output"}
- } elsif ( $pathname eq "error.r" or $pathname eq "abort.r" ) {
- $output = "";
- } elsif ( $command eq "clean" and grep( /^clean$/, @capabilities ) ) {
- $output = rot13($input);
- } elsif ( $command eq "smudge" and grep( /^smudge$/, @capabilities ) ) {
- $output = rot13($input);
- } else {
- die "bad command '$command'";
- }
-
- if ( $pathname eq "error.r" ) {
- print $debug "[ERROR]\n";
- $debug->flush();
- packet_txt_write("status=error");
- packet_flush();
- } elsif ( $pathname eq "abort.r" ) {
- print $debug "[ABORT]\n";
- $debug->flush();
- packet_txt_write("status=abort");
- packet_flush();
- } elsif ( $command eq "smudge" and
- exists $DELAY{$pathname} and
- $DELAY{$pathname}{"requested"} == 1 ) {
- print $debug "[DELAYED]\n";
- $debug->flush();
- packet_txt_write("status=delayed");
- packet_flush();
- $DELAY{$pathname}{"requested"} = 2;
- $DELAY{$pathname}{"output"} = $output;
- } else {
- packet_txt_write("status=success");
- packet_flush();
-
- if ( $pathname eq "${command}-write-fail.r" ) {
- print $debug "[WRITE FAIL]\n";
- $debug->flush();
- die "${command} write error";
- }
-
- print $debug "OUT: " . length($output) . " ";
- $debug->flush();
-
- while ( length($output) > 0 ) {
- my $packet = substr( $output, 0, $MAX_PACKET_CONTENT_SIZE );
- packet_bin_write($packet);
- # dots represent the number of packets
- print $debug ".";
- if ( length($output) > $MAX_PACKET_CONTENT_SIZE ) {
- $output = substr( $output, $MAX_PACKET_CONTENT_SIZE );
- } else {
- $output = "";
- }
- }
- packet_flush();
- print $debug " [OK]\n";
- $debug->flush();
- packet_flush();
- }
- }
-}
diff --git a/t/t0023-crlf-am.sh b/t/t0023-crlf-am.sh
index f9bbb91..5758055 100755
--- a/t/t0023-crlf-am.sh
+++ b/t/t0023-crlf-am.sh
@@ -2,6 +2,7 @@
test_description='Test am with auto.crlf'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
cat >patchfile <<\EOF
diff --git a/t/t0024-crlf-archive.sh b/t/t0024-crlf-archive.sh
index a34de56..a7f4de4 100755
--- a/t/t0024-crlf-archive.sh
+++ b/t/t0024-crlf-archive.sh
@@ -9,7 +9,7 @@ test_expect_success setup '
git config core.autocrlf true &&
- printf "CRLF line ending\r\nAnd another\r\n" > sample &&
+ printf "CRLF line ending\r\nAnd another\r\n" >sample &&
git add sample &&
test_tick &&
@@ -19,8 +19,9 @@ test_expect_success setup '
test_expect_success 'tar archive' '
- git archive --format=tar HEAD |
- ( mkdir untarred && cd untarred && "$TAR" -xf - ) &&
+ git archive --format=tar HEAD >test.tar &&
+ mkdir untarred &&
+ "$TAR" xf test.tar -C untarred &&
test_cmp sample untarred/sample
@@ -30,7 +31,11 @@ test_expect_success UNZIP 'zip archive' '
git archive --format=zip HEAD >test.zip &&
- ( mkdir unzipped && cd unzipped && "$GIT_UNZIP" ../test.zip ) &&
+ mkdir unzipped &&
+ (
+ cd unzipped &&
+ "$GIT_UNZIP" ../test.zip
+ ) &&
test_cmp sample unzipped/sample
diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh
index 7f80f46..2f57c86 100755
--- a/t/t0027-auto-crlf.sh
+++ b/t/t0027-auto-crlf.sh
@@ -2,6 +2,7 @@
test_description='CRLF conversion all combinations'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
compare_files () {
@@ -69,7 +70,8 @@ create_NNO_MIX_files () {
cp CRLF ${pfx}_CRLF.txt &&
cp CRLF_mix_LF ${pfx}_CRLF_mix_LF.txt &&
cp LF_mix_CR ${pfx}_LF_mix_CR.txt &&
- cp CRLF_nul ${pfx}_CRLF_nul.txt
+ cp CRLF_nul ${pfx}_CRLF_nul.txt ||
+ return 1
done
done
done
@@ -100,7 +102,8 @@ commit_check_warn () {
do
fname=${pfx}_$f.txt &&
cp $f $fname &&
- git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err"
+ git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err" ||
+ return 1
done &&
git commit -m "core.autocrlf $crlf" &&
check_warning "$lfname" ${pfx}_LF.err &&
@@ -120,15 +123,19 @@ commit_chk_wrnNNO () {
lfmixcr=$1 ; shift
crlfnul=$1 ; shift
pfx=NNO_attr_${attr}_aeol_${aeol}_${crlf}
- #Commit files on top of existing file
- create_gitattributes "$attr" $aeol &&
- for f in LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
- do
- fname=${pfx}_$f.txt &&
- cp $f $fname &&
- printf Z >>"$fname" &&
- git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err"
- done
+
+ test_expect_success 'setup commit NNO files' '
+ #Commit files on top of existing file
+ create_gitattributes "$attr" $aeol &&
+ for f in LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
+ do
+ fname=${pfx}_$f.txt &&
+ cp $f $fname &&
+ printf Z >>"$fname" &&
+ git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err" ||
+ return 1
+ done
+ '
test_expect_success "commit NNO files crlf=$crlf attr=$attr LF" '
check_warning "$lfwarn" ${pfx}_LF.err
@@ -162,15 +169,19 @@ commit_MIX_chkwrn () {
lfmixcr=$1 ; shift
crlfnul=$1 ; shift
pfx=MIX_attr_${attr}_aeol_${aeol}_${crlf}
- #Commit file with CLRF_mix_LF on top of existing file
- create_gitattributes "$attr" $aeol &&
- for f in LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
- do
- fname=${pfx}_$f.txt &&
- cp CRLF_mix_LF $fname &&
- printf Z >>"$fname" &&
- git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err"
- done
+
+ test_expect_success 'setup commit file with mixed EOL' '
+ #Commit file with CLRF_mix_LF on top of existing file
+ create_gitattributes "$attr" $aeol &&
+ for f in LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
+ do
+ fname=${pfx}_$f.txt &&
+ cp CRLF_mix_LF $fname &&
+ printf Z >>"$fname" &&
+ git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err" ||
+ return 1
+ done
+ '
test_expect_success "commit file with mixed EOL onto LF crlf=$crlf attr=$attr" '
check_warning "$lfwarn" ${pfx}_LF.err
@@ -288,17 +299,17 @@ checkout_files () {
lfmixcrlf=$1 ; shift
lfmixcr=$1 ; shift
crlfnul=$1 ; shift
- create_gitattributes "$attr" $ident $aeol &&
- git config core.autocrlf $crlf &&
+ test_expect_success "setup config for checkout attr=$attr ident=$ident aeol=$aeol core.autocrlf=$crlf" '
+ create_gitattributes "$attr" $ident $aeol &&
+ git config core.autocrlf $crlf
+ '
pfx=eol_${ceol}_crlf_${crlf}_attr_${attr}_ &&
for f in LF CRLF LF_mix_CR CRLF_mix_LF LF_nul
do
- rm crlf_false_attr__$f.txt &&
- if test -z "$ceol"; then
- git checkout -- crlf_false_attr__$f.txt
- else
- git -c core.eol=$ceol checkout -- crlf_false_attr__$f.txt
- fi
+ test_expect_success "setup $f checkout ${ceol:+ with -c core.eol=$ceol}" '
+ rm -f crlf_false_attr__$f.txt &&
+ git ${ceol:+-c core.eol=$ceol} checkout -- crlf_false_attr__$f.txt
+ '
done
test_expect_success "ls-files --eol attr=$attr $ident aeol=$aeol core.autocrlf=$crlf core.eol=$ceol" '
@@ -386,9 +397,7 @@ test_expect_success 'setup main' '
test_tick
'
-# Disable extra chain-linting for the next set of tests. There are many
-# auto-generated ones that are not worth checking over and over.
-GIT_TEST_CHAIN_LINT_HARDER_DEFAULT=0
+
warn_LF_CRLF="LF will be replaced by CRLF"
warn_CRLF_LF="CRLF will be replaced by LF"
@@ -605,9 +614,6 @@ do
checkout_files "" "$id" "crlf" true "" CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
done
-# The rest of the tests are unique; do the usual linting.
-unset GIT_TEST_CHAIN_LINT_HARDER_DEFAULT
-
# Should be the last test case: remove some files from the worktree
test_expect_success 'ls-files --eol -d -z' '
rm crlf_false_attr__CRLF.txt crlf_false_attr__CRLF_mix_LF.txt crlf_false_attr__LF.txt .gitattributes &&
diff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh
index 82905a2..ad151a3 100755
--- a/t/t0028-working-tree-encoding.sh
+++ b/t/t0028-working-tree-encoding.sh
@@ -5,6 +5,8 @@ test_description='working-tree-encoding conversion via gitattributes'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
. "$TEST_DIRECTORY/lib-encoding.sh"
@@ -69,6 +71,7 @@ test_expect_success 'check $GIT_DIR/info/attributes support' '
test_when_finished "rm -f test.utf32.git" &&
test_when_finished "git reset --hard HEAD" &&
+ mkdir .git/info &&
echo "*.utf32 text working-tree-encoding=utf-32" >.git/info/attributes &&
git add test.utf32 &&
@@ -89,23 +92,23 @@ do
# In these cases the BOM is prohibited.
cp bebom.utf${i}be.raw bebom.utf${i}be &&
test_must_fail git add bebom.utf${i}be 2>err.out &&
- test_i18ngrep "fatal: BOM is prohibited .* utf-${i}be" err.out &&
- test_i18ngrep "use UTF-${i} as working-tree-encoding" err.out &&
+ test_grep "fatal: BOM is prohibited .* utf-${i}be" err.out &&
+ test_grep "use UTF-${i} as working-tree-encoding" err.out &&
cp lebom.utf${i}le.raw lebom.utf${i}be &&
test_must_fail git add lebom.utf${i}be 2>err.out &&
- test_i18ngrep "fatal: BOM is prohibited .* utf-${i}be" err.out &&
- test_i18ngrep "use UTF-${i} as working-tree-encoding" err.out &&
+ test_grep "fatal: BOM is prohibited .* utf-${i}be" err.out &&
+ test_grep "use UTF-${i} as working-tree-encoding" err.out &&
cp bebom.utf${i}be.raw bebom.utf${i}le &&
test_must_fail git add bebom.utf${i}le 2>err.out &&
- test_i18ngrep "fatal: BOM is prohibited .* utf-${i}LE" err.out &&
- test_i18ngrep "use UTF-${i} as working-tree-encoding" err.out &&
+ test_grep "fatal: BOM is prohibited .* utf-${i}LE" err.out &&
+ test_grep "use UTF-${i} as working-tree-encoding" err.out &&
cp lebom.utf${i}le.raw lebom.utf${i}le &&
test_must_fail git add lebom.utf${i}le 2>err.out &&
- test_i18ngrep "fatal: BOM is prohibited .* utf-${i}LE" err.out &&
- test_i18ngrep "use UTF-${i} as working-tree-encoding" err.out
+ test_grep "fatal: BOM is prohibited .* utf-${i}LE" err.out &&
+ test_grep "use UTF-${i} as working-tree-encoding" err.out
'
test_expect_success "check required UTF-${i} BOM" '
@@ -115,21 +118,21 @@ do
cp nobom.utf${i}be.raw nobom.utf${i} &&
test_must_fail git add nobom.utf${i} 2>err.out &&
- test_i18ngrep "fatal: BOM is required .* utf-${i}" err.out &&
- test_i18ngrep "use UTF-${i}BE or UTF-${i}LE" err.out &&
+ test_grep "fatal: BOM is required .* utf-${i}" err.out &&
+ test_grep "use UTF-${i}BE or UTF-${i}LE" err.out &&
cp nobom.utf${i}le.raw nobom.utf${i} &&
test_must_fail git add nobom.utf${i} 2>err.out &&
- test_i18ngrep "fatal: BOM is required .* utf-${i}" err.out &&
- test_i18ngrep "use UTF-${i}BE or UTF-${i}LE" err.out
+ test_grep "fatal: BOM is required .* utf-${i}" err.out &&
+ test_grep "use UTF-${i}BE or UTF-${i}LE" err.out
'
test_expect_success "eol conversion for UTF-${i} encoded files on checkout" '
test_when_finished "rm -f crlf.utf${i}.raw lf.utf${i}.raw" &&
test_when_finished "git reset --hard HEAD^" &&
- cat lf.utf8.raw | write_utf${i} >lf.utf${i}.raw &&
- cat crlf.utf8.raw | write_utf${i} >crlf.utf${i}.raw &&
+ write_utf${i} <lf.utf8.raw >lf.utf${i}.raw &&
+ write_utf${i} <crlf.utf8.raw >crlf.utf${i}.raw &&
cp crlf.utf${i}.raw eol.utf${i} &&
cat >expectIndexLF <<-EOF &&
@@ -166,7 +169,7 @@ test_expect_success 'check unsupported encodings' '
echo "*.set text working-tree-encoding" >.gitattributes &&
printf "set" >t.set &&
test_must_fail git add t.set 2>err.out &&
- test_i18ngrep "true/false are no valid working-tree-encodings" err.out &&
+ test_grep "true/false are no valid working-tree-encodings" err.out &&
echo "*.unset text -working-tree-encoding" >.gitattributes &&
printf "unset" >t.unset &&
@@ -179,7 +182,7 @@ test_expect_success 'check unsupported encodings' '
echo "*.garbage text working-tree-encoding=garbage" >.gitattributes &&
printf "garbage" >t.garbage &&
test_must_fail git add t.garbage 2>err.out &&
- test_i18ngrep "failed to encode" err.out
+ test_grep "failed to encode" err.out
'
test_expect_success 'error if encoding round trip is not the same during refresh' '
@@ -198,7 +201,7 @@ test_expect_success 'error if encoding round trip is not the same during refresh
git update-ref refs/heads/main $COMMIT &&
test_must_fail git checkout HEAD^ 2>err.out &&
- test_i18ngrep "error: .* overwritten by checkout:" err.out
+ test_grep "error: .* overwritten by checkout:" err.out
'
test_expect_success 'error if encoding garbage is already in Git' '
@@ -214,7 +217,7 @@ test_expect_success 'error if encoding garbage is already in Git' '
git update-ref refs/heads/main $COMMIT &&
git diff 2>err.out &&
- test_i18ngrep "error: BOM is required" err.out
+ test_grep "error: BOM is required" err.out
'
test_lazy_prereq ICONV_SHIFT_JIS '
diff --git a/t/t0030-stripspace.sh b/t/t0030-stripspace.sh
index 0a5713c..f10f42f 100755
--- a/t/t0030-stripspace.sh
+++ b/t/t0030-stripspace.sh
@@ -17,396 +17,378 @@ printf_git_stripspace () {
printf "$1" | git stripspace
}
-test_expect_success \
- 'long lines without spaces should be unchanged' '
- echo "$ttt" >expect &&
- git stripspace <expect >actual &&
- test_cmp expect actual &&
-
- echo "$ttt$ttt" >expect &&
- git stripspace <expect >actual &&
- test_cmp expect actual &&
-
- echo "$ttt$ttt$ttt" >expect &&
- git stripspace <expect >actual &&
- test_cmp expect actual &&
-
- echo "$ttt$ttt$ttt$ttt" >expect &&
- git stripspace <expect >actual &&
- test_cmp expect actual
+test_expect_success 'long lines without spaces should be unchanged' '
+ echo "$ttt" >expect &&
+ git stripspace <expect >actual &&
+ test_cmp expect actual &&
+
+ echo "$ttt$ttt" >expect &&
+ git stripspace <expect >actual &&
+ test_cmp expect actual &&
+
+ echo "$ttt$ttt$ttt" >expect &&
+ git stripspace <expect >actual &&
+ test_cmp expect actual &&
+
+ echo "$ttt$ttt$ttt$ttt" >expect &&
+ git stripspace <expect >actual &&
+ test_cmp expect actual
'
-test_expect_success \
- 'lines with spaces at the beginning should be unchanged' '
- echo "$sss$ttt" >expect &&
- git stripspace <expect >actual &&
- test_cmp expect actual &&
+test_expect_success 'lines with spaces at the beginning should be unchanged' '
+ echo "$sss$ttt" >expect &&
+ git stripspace <expect >actual &&
+ test_cmp expect actual &&
- echo "$sss$sss$ttt" >expect &&
- git stripspace <expect >actual &&
- test_cmp expect actual &&
+ echo "$sss$sss$ttt" >expect &&
+ git stripspace <expect >actual &&
+ test_cmp expect actual &&
- echo "$sss$sss$sss$ttt" >expect &&
- git stripspace <expect >actual &&
- test_cmp expect actual
+ echo "$sss$sss$sss$ttt" >expect &&
+ git stripspace <expect >actual &&
+ test_cmp expect actual
'
-test_expect_success \
- 'lines with intermediate spaces should be unchanged' '
- echo "$ttt$sss$ttt" >expect &&
- git stripspace <expect >actual &&
- test_cmp expect actual &&
+test_expect_success 'lines with intermediate spaces should be unchanged' '
+ echo "$ttt$sss$ttt" >expect &&
+ git stripspace <expect >actual &&
+ test_cmp expect actual &&
- echo "$ttt$sss$sss$ttt" >expect &&
- git stripspace <expect >actual &&
- test_cmp expect actual
+ echo "$ttt$sss$sss$ttt" >expect &&
+ git stripspace <expect >actual &&
+ test_cmp expect actual
'
-test_expect_success \
- 'consecutive blank lines should be unified' '
- printf "$ttt\n\n$ttt\n" > expect &&
- printf "$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+test_expect_success 'consecutive blank lines should be unified' '
+ printf "$ttt\n\n$ttt\n" > expect &&
+ printf "$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt$ttt\n\n$ttt\n" > expect &&
- printf "$ttt$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt$ttt\n\n$ttt\n" > expect &&
+ printf "$ttt$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt$ttt$ttt\n\n$ttt\n" > expect &&
- printf "$ttt$ttt$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt$ttt$ttt\n\n$ttt\n" > expect &&
+ printf "$ttt$ttt$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n\n$ttt\n" > expect &&
- printf "$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n\n$ttt\n" > expect &&
+ printf "$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n\n$ttt$ttt\n" > expect &&
- printf "$ttt\n\n\n\n\n$ttt$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n\n$ttt$ttt\n" > expect &&
+ printf "$ttt\n\n\n\n\n$ttt$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n\n$ttt$ttt$ttt\n" > expect &&
- printf "$ttt\n\n\n\n\n$ttt$ttt$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n\n$ttt$ttt$ttt\n" > expect &&
+ printf "$ttt\n\n\n\n\n$ttt$ttt$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n\n$ttt\n" > expect &&
- printf "$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n\n$ttt\n" > expect &&
+ printf "$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt$ttt\n\n$ttt\n" > expect &&
- printf "$ttt$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt$ttt\n\n$ttt\n" > expect &&
+ printf "$ttt$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt$ttt$ttt\n\n$ttt\n" > expect &&
- printf "$ttt$ttt$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt$ttt$ttt\n\n$ttt\n" > expect &&
+ printf "$ttt$ttt$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n\n$ttt\n" > expect &&
- printf "$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n\n$ttt\n" > expect &&
+ printf "$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n\n$ttt$ttt\n" > expect &&
- printf "$ttt\n\t\n \n\n \t\t\n$ttt$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n\n$ttt$ttt\n" > expect &&
+ printf "$ttt\n\t\n \n\n \t\t\n$ttt$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n\n$ttt$ttt$ttt\n" > expect &&
- printf "$ttt\n\t\n \n\n \t\t\n$ttt$ttt$ttt\n" | git stripspace >actual &&
- test_cmp expect actual
+ printf "$ttt\n\n$ttt$ttt$ttt\n" > expect &&
+ printf "$ttt\n\t\n \n\n \t\t\n$ttt$ttt$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual
'
-test_expect_success \
- 'only consecutive blank lines should be completely removed' '
-
- printf "\n" | git stripspace >actual &&
- test_must_be_empty actual &&
+test_expect_success 'only consecutive blank lines should be completely removed' '
+ printf "\n" | git stripspace >actual &&
+ test_must_be_empty actual &&
- printf "\n\n\n" | git stripspace >actual &&
- test_must_be_empty actual &&
+ printf "\n\n\n" | git stripspace >actual &&
+ test_must_be_empty actual &&
- printf "$sss\n$sss\n$sss\n" | git stripspace >actual &&
- test_must_be_empty actual &&
+ printf "$sss\n$sss\n$sss\n" | git stripspace >actual &&
+ test_must_be_empty actual &&
- printf "$sss$sss\n$sss\n\n" | git stripspace >actual &&
- test_must_be_empty actual &&
+ printf "$sss$sss\n$sss\n\n" | git stripspace >actual &&
+ test_must_be_empty actual &&
- printf "\n$sss\n$sss$sss\n" | git stripspace >actual &&
- test_must_be_empty actual &&
+ printf "\n$sss\n$sss$sss\n" | git stripspace >actual &&
+ test_must_be_empty actual &&
- printf "$sss$sss$sss$sss\n\n\n" | git stripspace >actual &&
- test_must_be_empty actual &&
+ printf "$sss$sss$sss$sss\n\n\n" | git stripspace >actual &&
+ test_must_be_empty actual &&
- printf "\n$sss$sss$sss$sss\n\n" | git stripspace >actual &&
- test_must_be_empty actual &&
+ printf "\n$sss$sss$sss$sss\n\n" | git stripspace >actual &&
+ test_must_be_empty actual &&
- printf "\n\n$sss$sss$sss$sss\n" | git stripspace >actual &&
- test_must_be_empty actual
+ printf "\n\n$sss$sss$sss$sss\n" | git stripspace >actual &&
+ test_must_be_empty actual
'
-test_expect_success \
- 'consecutive blank lines at the beginning should be removed' '
- printf "$ttt\n" > expect &&
- printf "\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+test_expect_success 'consecutive blank lines at the beginning should be removed' '
+ printf "$ttt\n" > expect &&
+ printf "\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n" > expect &&
- printf "\n\n\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n" > expect &&
+ printf "\n\n\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt$ttt\n" > expect &&
- printf "\n\n\n$ttt$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt$ttt\n" > expect &&
+ printf "\n\n\n$ttt$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt$ttt$ttt\n" > expect &&
- printf "\n\n\n$ttt$ttt$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt$ttt$ttt\n" > expect &&
+ printf "\n\n\n$ttt$ttt$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt$ttt$ttt$ttt\n" > expect &&
- printf "\n\n\n$ttt$ttt$ttt$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt$ttt$ttt$ttt\n" > expect &&
+ printf "\n\n\n$ttt$ttt$ttt$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n" > expect &&
+ printf "$ttt\n" > expect &&
- printf "$sss\n$sss\n$sss\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$sss\n$sss\n$sss\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "\n$sss\n$sss$sss\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "\n$sss\n$sss$sss\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$sss$sss\n$sss\n\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$sss$sss\n$sss\n\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$sss$sss$sss\n\n\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$sss$sss$sss\n\n\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "\n$sss$sss$sss\n\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "\n$sss$sss$sss\n\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "\n\n$sss$sss$sss\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual
+ printf "\n\n$sss$sss$sss\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual
'
-test_expect_success \
- 'consecutive blank lines at the end should be removed' '
- printf "$ttt\n" > expect &&
- printf "$ttt\n\n" | git stripspace >actual &&
- test_cmp expect actual &&
+test_expect_success 'consecutive blank lines at the end should be removed' '
+ printf "$ttt\n" > expect &&
+ printf "$ttt\n\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n" > expect &&
- printf "$ttt\n\n\n\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n" > expect &&
+ printf "$ttt\n\n\n\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt$ttt\n" > expect &&
- printf "$ttt$ttt\n\n\n\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt$ttt\n" > expect &&
+ printf "$ttt$ttt\n\n\n\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt$ttt$ttt\n" > expect &&
- printf "$ttt$ttt$ttt\n\n\n\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt$ttt$ttt\n" > expect &&
+ printf "$ttt$ttt$ttt\n\n\n\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt$ttt$ttt$ttt\n" > expect &&
- printf "$ttt$ttt$ttt$ttt\n\n\n\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt$ttt$ttt$ttt\n" > expect &&
+ printf "$ttt$ttt$ttt$ttt\n\n\n\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n" > expect &&
+ printf "$ttt\n" > expect &&
- printf "$ttt\n$sss\n$sss\n$sss\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n$sss\n$sss\n$sss\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n\n$sss\n$sss$sss\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n\n$sss\n$sss$sss\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n$sss$sss\n$sss\n\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n$sss$sss\n$sss\n\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n$sss$sss$sss\n\n\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n$sss$sss$sss\n\n\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n\n$sss$sss$sss\n\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n\n$sss$sss$sss\n\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n\n\n$sss$sss$sss\n" | git stripspace >actual &&
- test_cmp expect actual
+ printf "$ttt\n\n\n$sss$sss$sss\n" | git stripspace >actual &&
+ test_cmp expect actual
'
-test_expect_success \
- 'text without newline at end should end with newline' '
- test_stdout_line_count -gt 0 printf_git_stripspace "$ttt" &&
- test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt" &&
- test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$ttt" &&
- test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$ttt$ttt"
+test_expect_success 'text without newline at end should end with newline' '
+ test_stdout_line_count -gt 0 printf_git_stripspace "$ttt" &&
+ test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt" &&
+ test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$ttt" &&
+ test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$ttt$ttt"
'
# text plus spaces at the end:
-test_expect_success \
- 'text plus spaces without newline at end should end with newline' '
- test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$sss" &&
- test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$sss" &&
- test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$ttt$sss" &&
- test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$sss$sss" &&
- test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$sss$sss" &&
- test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$sss$sss$sss"
+test_expect_success 'text plus spaces without newline at end should end with newline' '
+ test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$sss" &&
+ test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$sss" &&
+ test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$ttt$sss" &&
+ test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$sss$sss" &&
+ test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$sss$sss" &&
+ test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$sss$sss$sss"
'
-test_expect_success \
- 'text plus spaces without newline at end should not show spaces' '
- printf "$ttt$sss" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null &&
- printf "$ttt$ttt$sss" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null &&
- printf "$ttt$ttt$ttt$sss" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null &&
- printf "$ttt$sss$sss" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null &&
- printf "$ttt$ttt$sss$sss" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null &&
- printf "$ttt$sss$sss$sss" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null
+test_expect_success 'text plus spaces without newline at end should not show spaces' '
+ printf "$ttt$sss" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null &&
+ printf "$ttt$ttt$sss" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null &&
+ printf "$ttt$ttt$ttt$sss" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null &&
+ printf "$ttt$sss$sss" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null &&
+ printf "$ttt$ttt$sss$sss" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null &&
+ printf "$ttt$sss$sss$sss" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null
'
-test_expect_success \
- 'text plus spaces without newline should show the correct lines' '
- printf "$ttt\n" >expect &&
- printf "$ttt$sss" | git stripspace >actual &&
- test_cmp expect actual &&
+test_expect_success 'text plus spaces without newline should show the correct lines' '
+ printf "$ttt\n" >expect &&
+ printf "$ttt$sss" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n" >expect &&
- printf "$ttt$sss$sss" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n" >expect &&
+ printf "$ttt$sss$sss" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n" >expect &&
- printf "$ttt$sss$sss$sss" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n" >expect &&
+ printf "$ttt$sss$sss$sss" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt$ttt\n" >expect &&
- printf "$ttt$ttt$sss" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt$ttt\n" >expect &&
+ printf "$ttt$ttt$sss" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt$ttt\n" >expect &&
- printf "$ttt$ttt$sss$sss" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt$ttt\n" >expect &&
+ printf "$ttt$ttt$sss$sss" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt$ttt$ttt\n" >expect &&
- printf "$ttt$ttt$ttt$sss" | git stripspace >actual &&
- test_cmp expect actual
+ printf "$ttt$ttt$ttt\n" >expect &&
+ printf "$ttt$ttt$ttt$sss" | git stripspace >actual &&
+ test_cmp expect actual
'
-test_expect_success \
- 'text plus spaces at end should not show spaces' '
- echo "$ttt$sss" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null &&
- echo "$ttt$ttt$sss" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null &&
- echo "$ttt$ttt$ttt$sss" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null &&
- echo "$ttt$sss$sss" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null &&
- echo "$ttt$ttt$sss$sss" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null &&
- echo "$ttt$sss$sss$sss" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null
+test_expect_success 'text plus spaces at end should not show spaces' '
+ echo "$ttt$sss" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null &&
+ echo "$ttt$ttt$sss" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null &&
+ echo "$ttt$ttt$ttt$sss" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null &&
+ echo "$ttt$sss$sss" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null &&
+ echo "$ttt$ttt$sss$sss" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null &&
+ echo "$ttt$sss$sss$sss" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null
'
-test_expect_success \
- 'text plus spaces at end should be cleaned and newline must remain' '
- echo "$ttt" >expect &&
- echo "$ttt$sss" | git stripspace >actual &&
- test_cmp expect actual &&
+test_expect_success 'text plus spaces at end should be cleaned and newline must remain' '
+ echo "$ttt" >expect &&
+ echo "$ttt$sss" | git stripspace >actual &&
+ test_cmp expect actual &&
- echo "$ttt" >expect &&
- echo "$ttt$sss$sss" | git stripspace >actual &&
- test_cmp expect actual &&
+ echo "$ttt" >expect &&
+ echo "$ttt$sss$sss" | git stripspace >actual &&
+ test_cmp expect actual &&
- echo "$ttt" >expect &&
- echo "$ttt$sss$sss$sss" | git stripspace >actual &&
- test_cmp expect actual &&
+ echo "$ttt" >expect &&
+ echo "$ttt$sss$sss$sss" | git stripspace >actual &&
+ test_cmp expect actual &&
- echo "$ttt$ttt" >expect &&
- echo "$ttt$ttt$sss" | git stripspace >actual &&
- test_cmp expect actual &&
+ echo "$ttt$ttt" >expect &&
+ echo "$ttt$ttt$sss" | git stripspace >actual &&
+ test_cmp expect actual &&
- echo "$ttt$ttt" >expect &&
- echo "$ttt$ttt$sss$sss" | git stripspace >actual &&
- test_cmp expect actual &&
+ echo "$ttt$ttt" >expect &&
+ echo "$ttt$ttt$sss$sss" | git stripspace >actual &&
+ test_cmp expect actual &&
- echo "$ttt$ttt$ttt" >expect &&
- echo "$ttt$ttt$ttt$sss" | git stripspace >actual &&
- test_cmp expect actual
+ echo "$ttt$ttt$ttt" >expect &&
+ echo "$ttt$ttt$ttt$sss" | git stripspace >actual &&
+ test_cmp expect actual
'
# spaces only:
-test_expect_success \
- 'spaces with newline at end should be replaced with empty string' '
- echo | git stripspace >actual &&
- test_must_be_empty actual &&
+test_expect_success 'spaces with newline at end should be replaced with empty string' '
+ echo | git stripspace >actual &&
+ test_must_be_empty actual &&
- echo "$sss" | git stripspace >actual &&
- test_must_be_empty actual &&
+ echo "$sss" | git stripspace >actual &&
+ test_must_be_empty actual &&
- echo "$sss$sss" | git stripspace >actual &&
- test_must_be_empty actual &&
+ echo "$sss$sss" | git stripspace >actual &&
+ test_must_be_empty actual &&
- echo "$sss$sss$sss" | git stripspace >actual &&
- test_must_be_empty actual &&
+ echo "$sss$sss$sss" | git stripspace >actual &&
+ test_must_be_empty actual &&
- echo "$sss$sss$sss$sss" | git stripspace >actual &&
- test_must_be_empty actual
+ echo "$sss$sss$sss$sss" | git stripspace >actual &&
+ test_must_be_empty actual
'
-test_expect_success \
- 'spaces without newline at end should not show spaces' '
- printf "" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null &&
- printf "$sss" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null &&
- printf "$sss$sss" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null &&
- printf "$sss$sss$sss" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null &&
- printf "$sss$sss$sss$sss" | git stripspace >tmp &&
- ! grep " " tmp >/dev/null
+test_expect_success 'spaces without newline at end should not show spaces' '
+ printf "" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null &&
+ printf "$sss" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null &&
+ printf "$sss$sss" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null &&
+ printf "$sss$sss$sss" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null &&
+ printf "$sss$sss$sss$sss" | git stripspace >tmp &&
+ ! grep " " tmp >/dev/null
'
-test_expect_success \
- 'spaces without newline at end should be replaced with empty string' '
- printf "" | git stripspace >actual &&
- test_must_be_empty actual &&
+test_expect_success 'spaces without newline at end should be replaced with empty string' '
+ printf "" | git stripspace >actual &&
+ test_must_be_empty actual &&
- printf "$sss$sss" | git stripspace >actual &&
- test_must_be_empty actual &&
+ printf "$sss$sss" | git stripspace >actual &&
+ test_must_be_empty actual &&
- printf "$sss$sss$sss" | git stripspace >actual &&
- test_must_be_empty actual &&
+ printf "$sss$sss$sss" | git stripspace >actual &&
+ test_must_be_empty actual &&
- printf "$sss$sss$sss$sss" | git stripspace >actual &&
- test_must_be_empty actual
+ printf "$sss$sss$sss$sss" | git stripspace >actual &&
+ test_must_be_empty actual
'
-test_expect_success \
- 'consecutive text lines should be unchanged' '
- printf "$ttt$ttt\n$ttt\n" >expect &&
- printf "$ttt$ttt\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+test_expect_success 'consecutive text lines should be unchanged' '
+ printf "$ttt$ttt\n$ttt\n" >expect &&
+ printf "$ttt$ttt\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n$ttt$ttt\n$ttt\n" >expect &&
- printf "$ttt\n$ttt$ttt\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n$ttt$ttt\n$ttt\n" >expect &&
+ printf "$ttt\n$ttt$ttt\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n$ttt\n$ttt\n$ttt$ttt\n" >expect &&
- printf "$ttt\n$ttt\n$ttt\n$ttt$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n$ttt\n$ttt\n$ttt$ttt\n" >expect &&
+ printf "$ttt\n$ttt\n$ttt\n$ttt$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n$ttt\n\n$ttt$ttt\n$ttt\n" >expect &&
- printf "$ttt\n$ttt\n\n$ttt$ttt\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt\n$ttt\n\n$ttt$ttt\n$ttt\n" >expect &&
+ printf "$ttt\n$ttt\n\n$ttt$ttt\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt$ttt\n\n$ttt\n$ttt$ttt\n" >expect &&
- printf "$ttt$ttt\n\n$ttt\n$ttt$ttt\n" | git stripspace >actual &&
- test_cmp expect actual &&
+ printf "$ttt$ttt\n\n$ttt\n$ttt$ttt\n" >expect &&
+ printf "$ttt$ttt\n\n$ttt\n$ttt$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual &&
- printf "$ttt\n$ttt$ttt\n\n$ttt\n" >expect &&
- printf "$ttt\n$ttt$ttt\n\n$ttt\n" | git stripspace >actual &&
- test_cmp expect actual
+ printf "$ttt\n$ttt$ttt\n\n$ttt\n" >expect &&
+ printf "$ttt\n$ttt$ttt\n\n$ttt\n" | git stripspace >actual &&
+ test_cmp expect actual
'
test_expect_success 'strip comments, too' '
@@ -419,6 +401,21 @@ test_expect_success 'strip comments with changed comment char' '
test -z "$(echo "; comment" | git -c core.commentchar=";" stripspace -s)"
'
+test_expect_success 'strip comments with changed comment string' '
+ test ! -z "$(echo "// comment" | git -c core.commentchar=// stripspace)" &&
+ test -z "$(echo "// comment" | git -c core.commentchar="//" stripspace -s)"
+'
+
+test_expect_success 'newline as commentchar is forbidden' '
+ test_must_fail git -c core.commentChar="$LF" stripspace -s 2>err &&
+ grep "core.commentchar cannot contain newline" err
+'
+
+test_expect_success 'empty commentchar is forbidden' '
+ test_must_fail git -c core.commentchar= stripspace -s 2>err &&
+ grep "core.commentchar must have at least one character" err
+'
+
test_expect_success '-c with single line' '
printf "# foo\n" >expect &&
printf "foo" | git stripspace -c >actual &&
diff --git a/t/t0032-reftable-unittest.sh b/t/t0032-reftable-unittest.sh
index 0ed1497..471cb37 100755
--- a/t/t0032-reftable-unittest.sh
+++ b/t/t0032-reftable-unittest.sh
@@ -5,6 +5,7 @@
test_description='reftable unittests'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'unittests' '
diff --git a/t/t0033-safe-directory.sh b/t/t0033-safe-directory.sh
index 3908597..dc34968 100755
--- a/t/t0033-safe-directory.sh
+++ b/t/t0033-safe-directory.sh
@@ -2,6 +2,7 @@
test_description='verify safe.directory checks'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
GIT_TEST_ASSUME_DIFFERENT_OWNER=1
@@ -16,24 +17,20 @@ test_expect_success 'safe.directory is not set' '
expect_rejected_dir
'
-test_expect_success 'ignoring safe.directory on the command line' '
- test_must_fail git -c safe.directory="$(pwd)" status 2>err &&
- grep "dubious ownership" err
+test_expect_success 'safe.directory on the command line' '
+ git -c safe.directory="$(pwd)" status
'
-test_expect_success 'ignoring safe.directory in the environment' '
- test_must_fail env GIT_CONFIG_COUNT=1 \
- GIT_CONFIG_KEY_0="safe.directory" \
- GIT_CONFIG_VALUE_0="$(pwd)" \
- git status 2>err &&
- grep "dubious ownership" err
+test_expect_success 'safe.directory in the environment' '
+ env GIT_CONFIG_COUNT=1 \
+ GIT_CONFIG_KEY_0="safe.directory" \
+ GIT_CONFIG_VALUE_0="$(pwd)" \
+ git status
'
-test_expect_success 'ignoring safe.directory in GIT_CONFIG_PARAMETERS' '
- test_must_fail env \
- GIT_CONFIG_PARAMETERS="${SQ}safe.directory${SQ}=${SQ}$(pwd)${SQ}" \
- git status 2>err &&
- grep "dubious ownership" err
+test_expect_success 'safe.directory in GIT_CONFIG_PARAMETERS' '
+ env GIT_CONFIG_PARAMETERS="${SQ}safe.directory${SQ}=${SQ}$(pwd)${SQ}" \
+ git status
'
test_expect_success 'ignoring safe.directory in repo config' '
@@ -74,4 +71,13 @@ test_expect_success 'safe.directory=*, but is reset' '
expect_rejected_dir
'
+test_expect_success 'safe.directory in included file' '
+ cat >gitconfig-include <<-EOF &&
+ [safe]
+ directory = "$(pwd)"
+ EOF
+ git config --global --add include.path "$(pwd)/gitconfig-include" &&
+ git status
+'
+
test_done
diff --git a/t/t0035-safe-bare-repository.sh b/t/t0035-safe-bare-repository.sh
new file mode 100755
index 0000000..d3cb2a1
--- /dev/null
+++ b/t/t0035-safe-bare-repository.sh
@@ -0,0 +1,107 @@
+#!/bin/sh
+
+test_description='verify safe.bareRepository checks'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+pwd="$(pwd)"
+
+expect_accepted_implicit () {
+ test_when_finished 'rm "$pwd/trace.perf"' &&
+ GIT_TRACE2_PERF="$pwd/trace.perf" git "$@" rev-parse --git-dir &&
+ # Note: we're intentionally only checking that the bare repo has a
+ # directory *prefix* of $pwd
+ grep -F "implicit-bare-repository:$pwd" "$pwd/trace.perf"
+}
+
+expect_accepted_explicit () {
+ test_when_finished 'rm "$pwd/trace.perf"' &&
+ GIT_DIR="$1" GIT_TRACE2_PERF="$pwd/trace.perf" git rev-parse --git-dir &&
+ ! grep -F "implicit-bare-repository:$pwd" "$pwd/trace.perf"
+}
+
+expect_rejected () {
+ test_when_finished 'rm "$pwd/trace.perf"' &&
+ test_env GIT_TRACE2_PERF="$pwd/trace.perf" \
+ test_must_fail git "$@" rev-parse --git-dir 2>err &&
+ grep -F "cannot use bare repository" err &&
+ grep -F "implicit-bare-repository:$pwd" "$pwd/trace.perf"
+}
+
+test_expect_success 'setup an embedded bare repo, secondary worktree and submodule' '
+ git init outer-repo &&
+ git init --bare --initial-branch=main outer-repo/bare-repo &&
+ git -C outer-repo worktree add ../outer-secondary &&
+ test_path_is_dir outer-secondary &&
+ (
+ cd outer-repo &&
+ test_commit A &&
+ git push bare-repo +HEAD:refs/heads/main &&
+ git -c protocol.file.allow=always \
+ submodule add --name subn -- ./bare-repo subd
+ ) &&
+ test_path_is_dir outer-repo/.git/worktrees/outer-secondary &&
+ test_path_is_dir outer-repo/.git/modules/subn
+'
+
+test_expect_success 'safe.bareRepository unset' '
+ test_unconfig --global safe.bareRepository &&
+ expect_accepted_implicit -C outer-repo/bare-repo
+'
+
+test_expect_success 'safe.bareRepository=all' '
+ test_config_global safe.bareRepository all &&
+ expect_accepted_implicit -C outer-repo/bare-repo
+'
+
+test_expect_success 'safe.bareRepository=explicit' '
+ test_config_global safe.bareRepository explicit &&
+ expect_rejected -C outer-repo/bare-repo
+'
+
+test_expect_success 'safe.bareRepository in the repository' '
+ # safe.bareRepository must not be "explicit", otherwise
+ # git config fails with "fatal: not in a git directory" (like
+ # safe.directory)
+ test_config -C outer-repo/bare-repo safe.bareRepository all &&
+ test_config_global safe.bareRepository explicit &&
+ expect_rejected -C outer-repo/bare-repo
+'
+
+test_expect_success 'safe.bareRepository on the command line' '
+ test_config_global safe.bareRepository explicit &&
+ expect_accepted_implicit -C outer-repo/bare-repo \
+ -c safe.bareRepository=all
+'
+
+test_expect_success 'safe.bareRepository in included file' '
+ cat >gitconfig-include <<-\EOF &&
+ [safe]
+ bareRepository = explicit
+ EOF
+ git config --global --add include.path "$(pwd)/gitconfig-include" &&
+ expect_rejected -C outer-repo/bare-repo
+'
+
+test_expect_success 'no trace when GIT_DIR is explicitly provided' '
+ expect_accepted_explicit "$pwd/outer-repo/bare-repo"
+'
+
+test_expect_success 'no trace when "bare repository" is .git' '
+ expect_accepted_implicit -C outer-repo/.git
+'
+
+test_expect_success 'no trace when "bare repository" is a subdir of .git' '
+ expect_accepted_implicit -C outer-repo/.git/objects
+'
+
+test_expect_success 'no trace in $GIT_DIR of secondary worktree' '
+ expect_accepted_implicit -C outer-repo/.git/worktrees/outer-secondary
+'
+
+test_expect_success 'no trace in $GIT_DIR of a submodule' '
+ expect_accepted_implicit -C outer-repo/.git/modules/subn
+'
+
+test_done
diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh
index ed2fb62..8bb2a8b 100755
--- a/t/t0040-parse-options.sh
+++ b/t/t0040-parse-options.sh
@@ -13,29 +13,36 @@ usage: test-tool parse-options <options>
A helper function for the parse-options API.
- --yes get a boolean
+ --[no-]yes get a boolean
-D, --no-doubt begins with 'no-'
+ --doubt opposite of --no-doubt
-B, --no-fear be brave
- -b, --boolean increment by one
- -4, --or4 bitwise-or boolean with ...0100
- --neg-or4 same as --no-or4
+ -b, --[no-]boolean increment by one
+ -4, --[no-]or4 bitwise-or boolean with ...0100
+ --[no-]neg-or4 same as --no-or4
- -i, --integer <n> get a integer
+ -i, --[no-]integer <n>
+ get a integer
-j <n> get a integer, too
-m, --magnitude <n> get a magnitude
- --set23 set integer to 23
+ --[no-]set23 set integer to 23
--mode1 set integer to 1 (cmdmode option)
--mode2 set integer to 2 (cmdmode option)
- -L, --length <str> get length of <str>
- -F, --file <file> set file to <file>
+ --[no-]mode34 (3|4) set integer to 3 or 4 (cmdmode option)
+ -L, --[no-]length <str>
+ get length of <str>
+ -F, --[no-]file <file>
+ set file to <file>
String options
- -s, --string <string>
+ -s, --[no-]string <string>
get a string
- --string2 <str> get another string
- --st <st> get another string (pervert ordering)
+ --[no-]string2 <str> get another string
+ --[no-]st <st> get another string (pervert ordering)
-o <str> get another string
- --list <str> add str to list
+ --longhelp help text of this entry
+ spans multiple lines
+ --[no-]list <str> add str to list
Magic arguments
-NUM set integer to NUM
@@ -44,16 +51,17 @@ Magic arguments
--no-ambiguous negative ambiguity
Standard options
- --abbrev[=<n>] use <n> digits to display object names
- -v, --verbose be verbose
- -n, --dry-run dry run
- -q, --quiet be quiet
- --expect <string> expected output in the variable dump
+ --[no-]abbrev[=<n>] use <n> digits to display object names
+ -v, --[no-]verbose be verbose
+ -n, --[no-]dry-run dry run
+ -q, --[no-]quiet be quiet
+ --[no-]expect <string>
+ expected output in the variable dump
Alias
- -A, --alias-source <string>
+ -A, --[no-]alias-source <string>
get a string
- -Z, --alias-target <string>
+ -Z, --[no-]alias-target <string>
alias of --alias-source
EOF
@@ -202,6 +210,22 @@ test_expect_success 'superfluous value provided: boolean' '
test_cmp expect actual
'
+test_expect_success 'superfluous value provided: boolean, abbreviated' '
+ cat >expect <<-\EOF &&
+ error: option `yes'\'' takes no value
+ EOF
+ test_expect_code 129 env GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS=false \
+ test-tool parse-options --ye=hi 2>actual &&
+ test_cmp expect actual &&
+
+ cat >expect <<-\EOF &&
+ error: option `no-yes'\'' takes no value
+ EOF
+ test_expect_code 129 env GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS=false \
+ test-tool parse-options --no-ye=hi 2>actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'superfluous value provided: cmdmode' '
cat >expect <<-\EOF &&
error: option `mode1'\'' takes no value
@@ -359,19 +383,41 @@ test_expect_success 'OPT_NEGBIT() works' '
'
test_expect_success 'OPT_CMDMODE() works' '
- test-tool parse-options --expect="integer: 1" --mode1
+ test-tool parse-options --expect="integer: 1" --mode1 &&
+ test-tool parse-options --expect="integer: 3" --mode34=3
'
-test_expect_success 'OPT_CMDMODE() detects incompatibility' '
+test_expect_success 'OPT_CMDMODE() detects incompatibility (1)' '
test_must_fail test-tool parse-options --mode1 --mode2 >output 2>output.err &&
test_must_be_empty output &&
- test_i18ngrep "incompatible with --mode" output.err
+ test_grep "mode1" output.err &&
+ test_grep "mode2" output.err &&
+ test_grep "cannot be used together" output.err
'
-test_expect_success 'OPT_CMDMODE() detects incompatibility with something else' '
+test_expect_success 'OPT_CMDMODE() detects incompatibility (2)' '
test_must_fail test-tool parse-options --set23 --mode2 >output 2>output.err &&
test_must_be_empty output &&
- test_i18ngrep "incompatible with something else" output.err
+ test_grep "mode2" output.err &&
+ test_grep "set23" output.err &&
+ test_grep "cannot be used together" output.err
+'
+
+test_expect_success 'OPT_CMDMODE() detects incompatibility (3)' '
+ test_must_fail test-tool parse-options --mode2 --set23 >output 2>output.err &&
+ test_must_be_empty output &&
+ test_grep "mode2" output.err &&
+ test_grep "set23" output.err &&
+ test_grep "cannot be used together" output.err
+'
+
+test_expect_success 'OPT_CMDMODE() detects incompatibility (4)' '
+ test_must_fail test-tool parse-options --mode2 --mode34=3 \
+ >output 2>output.err &&
+ test_must_be_empty output &&
+ test_grep "mode2" output.err &&
+ test_grep "mode34.3" output.err &&
+ test_grep "cannot be used together" output.err
'
test_expect_success 'OPT_COUNTUP() with PARSE_OPT_NODASH works' '
@@ -456,4 +502,269 @@ test_expect_success '--end-of-options treats remainder as args' '
--end-of-options --verbose
'
+test_expect_success 'KEEP_DASHDASH works' '
+ test-tool parse-options-flags --keep-dashdash cmd --opt=1 -- --opt=2 --unknown >actual &&
+ cat >expect <<-\EOF &&
+ opt: 1
+ arg 00: --
+ arg 01: --opt=2
+ arg 02: --unknown
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'KEEP_ARGV0 works' '
+ test-tool parse-options-flags --keep-argv0 cmd arg0 --opt=3 >actual &&
+ cat >expect <<-\EOF &&
+ opt: 3
+ arg 00: cmd
+ arg 01: arg0
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'STOP_AT_NON_OPTION works' '
+ test-tool parse-options-flags --stop-at-non-option cmd --opt=4 arg0 --opt=5 --unknown >actual &&
+ cat >expect <<-\EOF &&
+ opt: 4
+ arg 00: arg0
+ arg 01: --opt=5
+ arg 02: --unknown
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'KEEP_UNKNOWN_OPT works' '
+ test-tool parse-options-flags --keep-unknown-opt cmd --unknown=1 --opt=6 -u2 >actual &&
+ cat >expect <<-\EOF &&
+ opt: 6
+ arg 00: --unknown=1
+ arg 01: -u2
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'NO_INTERNAL_HELP works for -h' '
+ test_expect_code 129 test-tool parse-options-flags --no-internal-help cmd -h 2>err &&
+ grep "^error: unknown switch \`h$SQ" err &&
+ grep "^usage: " err
+'
+
+for help_opt in help help-all
+do
+ test_expect_success "NO_INTERNAL_HELP works for --$help_opt" "
+ test_expect_code 129 test-tool parse-options-flags --no-internal-help cmd --$help_opt 2>err &&
+ grep '^error: unknown option \`'$help_opt\' err &&
+ grep '^usage: ' err
+ "
+done
+
+test_expect_success 'KEEP_UNKNOWN_OPT | NO_INTERNAL_HELP works' '
+ test-tool parse-options-flags --keep-unknown-opt --no-internal-help cmd -h --help --help-all >actual &&
+ cat >expect <<-\EOF &&
+ opt: 0
+ arg 00: -h
+ arg 01: --help
+ arg 02: --help-all
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'subcommand - no subcommand shows error and usage' '
+ test_expect_code 129 test-tool parse-subcommand cmd 2>err &&
+ grep "^error: need a subcommand" err &&
+ grep ^usage: err
+'
+
+test_expect_success 'subcommand - subcommand after -- shows error and usage' '
+ test_expect_code 129 test-tool parse-subcommand cmd -- subcmd-one 2>err &&
+ grep "^error: need a subcommand" err &&
+ grep ^usage: err
+'
+
+test_expect_success 'subcommand - subcommand after --end-of-options shows error and usage' '
+ test_expect_code 129 test-tool parse-subcommand cmd --end-of-options subcmd-one 2>err &&
+ grep "^error: need a subcommand" err &&
+ grep ^usage: err
+'
+
+test_expect_success 'subcommand - unknown subcommand shows error and usage' '
+ test_expect_code 129 test-tool parse-subcommand cmd nope 2>err &&
+ grep "^error: unknown subcommand: \`nope$SQ" err &&
+ grep ^usage: err
+'
+
+test_expect_success 'subcommand - subcommands cannot be abbreviated' '
+ test_expect_code 129 test-tool parse-subcommand cmd subcmd-o 2>err &&
+ grep "^error: unknown subcommand: \`subcmd-o$SQ$" err &&
+ grep ^usage: err
+'
+
+test_expect_success 'subcommand - no negated subcommands' '
+ test_expect_code 129 test-tool parse-subcommand cmd no-subcmd-one 2>err &&
+ grep "^error: unknown subcommand: \`no-subcmd-one$SQ" err &&
+ grep ^usage: err
+'
+
+test_expect_success 'subcommand - simple' '
+ test-tool parse-subcommand cmd subcmd-two >actual &&
+ cat >expect <<-\EOF &&
+ opt: 0
+ fn: subcmd_two
+ arg 00: subcmd-two
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'subcommand - stop parsing at the first subcommand' '
+ test-tool parse-subcommand cmd --opt=1 subcmd-two subcmd-one --opt=2 >actual &&
+ cat >expect <<-\EOF &&
+ opt: 1
+ fn: subcmd_two
+ arg 00: subcmd-two
+ arg 01: subcmd-one
+ arg 02: --opt=2
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'subcommand - KEEP_ARGV0' '
+ test-tool parse-subcommand --keep-argv0 cmd subcmd-two >actual &&
+ cat >expect <<-\EOF &&
+ opt: 0
+ fn: subcmd_two
+ arg 00: cmd
+ arg 01: subcmd-two
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'subcommand - SUBCOMMAND_OPTIONAL + subcommand not given' '
+ test-tool parse-subcommand --subcommand-optional cmd >actual &&
+ cat >expect <<-\EOF &&
+ opt: 0
+ fn: subcmd_one
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'subcommand - SUBCOMMAND_OPTIONAL + given subcommand' '
+ test-tool parse-subcommand --subcommand-optional cmd subcmd-two branch file >actual &&
+ cat >expect <<-\EOF &&
+ opt: 0
+ fn: subcmd_two
+ arg 00: subcmd-two
+ arg 01: branch
+ arg 02: file
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'subcommand - SUBCOMMAND_OPTIONAL + subcommand not given + unknown dashless args' '
+ test-tool parse-subcommand --subcommand-optional cmd branch file >actual &&
+ cat >expect <<-\EOF &&
+ opt: 0
+ fn: subcmd_one
+ arg 00: branch
+ arg 01: file
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'subcommand - SUBCOMMAND_OPTIONAL + subcommand not given + unknown option' '
+ test_expect_code 129 test-tool parse-subcommand --subcommand-optional cmd --subcommand-opt 2>err &&
+ grep "^error: unknown option" err &&
+ grep ^usage: err
+'
+
+test_expect_success 'subcommand - SUBCOMMAND_OPTIONAL | KEEP_UNKNOWN_OPT + subcommand not given + unknown option' '
+ test-tool parse-subcommand --subcommand-optional --keep-unknown-opt cmd --subcommand-opt >actual &&
+ cat >expect <<-\EOF &&
+ opt: 0
+ fn: subcmd_one
+ arg 00: --subcommand-opt
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'subcommand - SUBCOMMAND_OPTIONAL | KEEP_UNKNOWN_OPT + subcommand ignored after unknown option' '
+ test-tool parse-subcommand --subcommand-optional --keep-unknown-opt cmd --subcommand-opt subcmd-two >actual &&
+ cat >expect <<-\EOF &&
+ opt: 0
+ fn: subcmd_one
+ arg 00: --subcommand-opt
+ arg 01: subcmd-two
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'subcommand - SUBCOMMAND_OPTIONAL | KEEP_UNKNOWN_OPT + command and subcommand options cannot be mixed' '
+ test-tool parse-subcommand --subcommand-optional --keep-unknown-opt cmd --subcommand-opt branch --opt=1 >actual &&
+ cat >expect <<-\EOF &&
+ opt: 0
+ fn: subcmd_one
+ arg 00: --subcommand-opt
+ arg 01: branch
+ arg 02: --opt=1
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'subcommand - SUBCOMMAND_OPTIONAL | KEEP_UNKNOWN_OPT | KEEP_ARGV0' '
+ test-tool parse-subcommand --subcommand-optional --keep-unknown-opt --keep-argv0 cmd --subcommand-opt branch >actual &&
+ cat >expect <<-\EOF &&
+ opt: 0
+ fn: subcmd_one
+ arg 00: cmd
+ arg 01: --subcommand-opt
+ arg 02: branch
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'subcommand - SUBCOMMAND_OPTIONAL | KEEP_UNKNOWN_OPT | KEEP_DASHDASH' '
+ test-tool parse-subcommand --subcommand-optional --keep-unknown-opt --keep-dashdash cmd -- --subcommand-opt file >actual &&
+ cat >expect <<-\EOF &&
+ opt: 0
+ fn: subcmd_one
+ arg 00: --
+ arg 01: --subcommand-opt
+ arg 02: file
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'subcommand - completion helper' '
+ test-tool parse-subcommand cmd --git-completion-helper >actual &&
+ echo "subcmd-one subcmd-two --opt= --no-opt" >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'subcommands are incompatible with STOP_AT_NON_OPTION' '
+ test_must_fail test-tool parse-subcommand --stop-at-non-option cmd subcmd-one 2>err &&
+ grep ^BUG err
+'
+
+test_expect_success 'subcommands are incompatible with KEEP_UNKNOWN_OPT unless in combination with SUBCOMMAND_OPTIONAL' '
+ test_must_fail test-tool parse-subcommand --keep-unknown-opt cmd subcmd-two 2>err &&
+ grep ^BUG err
+'
+
+test_expect_success 'subcommands are incompatible with KEEP_DASHDASH unless in combination with SUBCOMMAND_OPTIONAL' '
+ test_must_fail test-tool parse-subcommand --keep-dashdash cmd subcmd-two 2>err &&
+ grep ^BUG err
+'
+
+test_expect_success 'negative magnitude' '
+ test_must_fail test-tool parse-options --magnitude -1 >out 2>err &&
+ grep "non-negative integer" err &&
+ test_must_be_empty out
+'
+
+test_expect_success 'magnitude with units but no numbers' '
+ test_must_fail test-tool parse-options --magnitude m >out 2>err &&
+ grep "non-negative integer" err &&
+ test_must_be_empty out
+'
+
test_done
diff --git a/t/t0041-usage.sh b/t/t0041-usage.sh
index c4fc34e..1464294 100755
--- a/t/t0041-usage.sh
+++ b/t/t0041-usage.sh
@@ -5,6 +5,7 @@ test_description='Test commands behavior when given invalid argument value'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup ' '
@@ -20,8 +21,8 @@ test_expect_success 'tag --contains <existent_tag>' '
test_expect_success 'tag --contains <inexistent_tag>' '
test_must_fail git tag --contains "notag" >actual 2>actual.err &&
test_line_count = 0 actual &&
- test_i18ngrep "error" actual.err &&
- test_i18ngrep ! "usage" actual.err
+ test_grep "error" actual.err &&
+ test_grep ! "usage" actual.err
'
test_expect_success 'tag --no-contains <existent_tag>' '
@@ -33,27 +34,27 @@ test_expect_success 'tag --no-contains <existent_tag>' '
test_expect_success 'tag --no-contains <inexistent_tag>' '
test_must_fail git tag --no-contains "notag" >actual 2>actual.err &&
test_line_count = 0 actual &&
- test_i18ngrep "error" actual.err &&
- test_i18ngrep ! "usage" actual.err
+ test_grep "error" actual.err &&
+ test_grep ! "usage" actual.err
'
test_expect_success 'tag usage error' '
test_must_fail git tag --noopt >actual 2>actual.err &&
test_line_count = 0 actual &&
- test_i18ngrep "usage" actual.err
+ test_grep "usage" actual.err
'
test_expect_success 'branch --contains <existent_commit>' '
git branch --contains "main" >actual 2>actual.err &&
- test_i18ngrep "main" actual &&
+ test_grep "main" actual &&
test_line_count = 0 actual.err
'
test_expect_success 'branch --contains <inexistent_commit>' '
test_must_fail git branch --no-contains "nocommit" >actual 2>actual.err &&
test_line_count = 0 actual &&
- test_i18ngrep "error" actual.err &&
- test_i18ngrep ! "usage" actual.err
+ test_grep "error" actual.err &&
+ test_grep ! "usage" actual.err
'
test_expect_success 'branch --no-contains <existent_commit>' '
@@ -65,14 +66,14 @@ test_expect_success 'branch --no-contains <existent_commit>' '
test_expect_success 'branch --no-contains <inexistent_commit>' '
test_must_fail git branch --no-contains "nocommit" >actual 2>actual.err &&
test_line_count = 0 actual &&
- test_i18ngrep "error" actual.err &&
- test_i18ngrep ! "usage" actual.err
+ test_grep "error" actual.err &&
+ test_grep ! "usage" actual.err
'
test_expect_success 'branch usage error' '
test_must_fail git branch --noopt >actual 2>actual.err &&
test_line_count = 0 actual &&
- test_i18ngrep "usage" actual.err
+ test_grep "usage" actual.err
'
test_expect_success 'for-each-ref --contains <existent_object>' '
@@ -84,8 +85,8 @@ test_expect_success 'for-each-ref --contains <existent_object>' '
test_expect_success 'for-each-ref --contains <inexistent_object>' '
test_must_fail git for-each-ref --no-contains "noobject" >actual 2>actual.err &&
test_line_count = 0 actual &&
- test_i18ngrep "error" actual.err &&
- test_i18ngrep ! "usage" actual.err
+ test_grep "error" actual.err &&
+ test_grep ! "usage" actual.err
'
test_expect_success 'for-each-ref --no-contains <existent_object>' '
@@ -97,14 +98,14 @@ test_expect_success 'for-each-ref --no-contains <existent_object>' '
test_expect_success 'for-each-ref --no-contains <inexistent_object>' '
test_must_fail git for-each-ref --no-contains "noobject" >actual 2>actual.err &&
test_line_count = 0 actual &&
- test_i18ngrep "error" actual.err &&
- test_i18ngrep ! "usage" actual.err
+ test_grep "error" actual.err &&
+ test_grep ! "usage" actual.err
'
test_expect_success 'for-each-ref usage error' '
test_must_fail git for-each-ref --noopt >actual 2>actual.err &&
test_line_count = 0 actual &&
- test_i18ngrep "usage" actual.err
+ test_grep "usage" actual.err
'
test_done
diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh
index 5c9dc90..325eb1c 100755
--- a/t/t0050-filesystem.sh
+++ b/t/t0050-filesystem.sh
@@ -5,6 +5,7 @@ test_description='Various filesystem issues'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
auml=$(printf '\303\244')
diff --git a/t/t0055-beyond-symlinks.sh b/t/t0055-beyond-symlinks.sh
index 6bada37..c3eb115 100755
--- a/t/t0055-beyond-symlinks.sh
+++ b/t/t0055-beyond-symlinks.sh
@@ -15,12 +15,22 @@ test_expect_success SYMLINKS setup '
test_expect_success SYMLINKS 'update-index --add beyond symlinks' '
test_must_fail git update-index --add c/d &&
- ! ( git ls-files | grep c/d )
+ cat >expect <<-\EOF &&
+ a
+ b/d
+ EOF
+ git ls-files >actual &&
+ test_cmp expect actual
'
test_expect_success SYMLINKS 'add beyond symlinks' '
test_must_fail git add c/d &&
- ! ( git ls-files | grep c/d )
+ cat >expect <<-\EOF &&
+ a
+ b/d
+ EOF
+ git ls-files >actual &&
+ test_cmp expect actual
'
test_done
diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh
index aa35350..0afa3d0 100755
--- a/t/t0060-path-utils.sh
+++ b/t/t0060-path-utils.sh
@@ -5,24 +5,32 @@
test_description='Test various path utilities'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
norm_path() {
expected=$(test-tool path-utils print_path "$2")
- test_expect_success $3 "normalize path: $1 => $2" \
- "test \"\$(test-tool path-utils normalize_path_copy '$1')\" = '$expected'"
+ test_expect_success $3 "normalize path: $1 => $2" "
+ echo '$expected' >expect &&
+ test-tool path-utils normalize_path_copy '$1' >actual &&
+ test_cmp expect actual
+ "
}
relative_path() {
expected=$(test-tool path-utils print_path "$3")
- test_expect_success $4 "relative path: $1 $2 => $3" \
- "test \"\$(test-tool path-utils relative_path '$1' '$2')\" = '$expected'"
+ test_expect_success $4 "relative path: $1 $2 => $3" "
+ echo '$expected' >expect &&
+ test-tool path-utils relative_path '$1' '$2' >actual &&
+ test_cmp expect actual
+ "
}
test_submodule_relative_url() {
test_expect_success "test_submodule_relative_url: $1 $2 $3 => $4" "
- actual=\$(git submodule--helper resolve-relative-url-test '$1' '$2' '$3') &&
- test \"\$actual\" = '$4'
+ echo '$4' >expect &&
+ test-tool submodule resolve-relative-url '$1' '$2' '$3' >actual &&
+ test_cmp expect actual
"
}
@@ -63,9 +71,11 @@ ancestor() {
expected=$(($expected-$rootslash+$rootoff))
;;
esac
- test_expect_success $4 "longest ancestor: $1 $2 => $expected" \
- "actual=\$(test-tool path-utils longest_ancestor_length '$1' '$2') &&
- test \"\$actual\" = '$expected'"
+ test_expect_success $4 "longest ancestor: $1 $2 => $expected" "
+ echo '$expected' >expect &&
+ test-tool path-utils longest_ancestor_length '$1' '$2' >actual &&
+ test_cmp expect actual
+ "
}
# Some absolute path tests should be skipped on Windows due to path mangling
@@ -165,8 +175,10 @@ ancestor D:/Users/me C:/ -1 MINGW
ancestor //server/share/my-directory //server/share/ 14 MINGW
test_expect_success 'strip_path_suffix' '
- test c:/msysgit = $(test-tool path-utils strip_path_suffix \
- c:/msysgit/libexec//git-core libexec/git-core)
+ echo c:/msysgit >expect &&
+ test-tool path-utils strip_path_suffix \
+ c:/msysgit/libexec//git-core libexec/git-core >actual &&
+ test_cmp expect actual
'
test_expect_success 'absolute path rejects the empty string' '
@@ -187,35 +199,61 @@ test_expect_success 'real path rejects the empty string' '
'
test_expect_success POSIX 'real path works on absolute paths 1' '
+ echo / >expect &&
+ test-tool path-utils real_path "/" >actual &&
+ test_cmp expect actual &&
+
nopath="hopefully-absent-path" &&
- test "/" = "$(test-tool path-utils real_path "/")" &&
- test "/$nopath" = "$(test-tool path-utils real_path "/$nopath")"
+ echo "/$nopath" >expect &&
+ test-tool path-utils real_path "/$nopath" >actual &&
+ test_cmp expect actual
'
test_expect_success 'real path works on absolute paths 2' '
- nopath="hopefully-absent-path" &&
# Find an existing top-level directory for the remaining tests:
d=$(pwd -P | sed -e "s|^\([^/]*/[^/]*\)/.*|\1|") &&
- test "$d" = "$(test-tool path-utils real_path "$d")" &&
- test "$d/$nopath" = "$(test-tool path-utils real_path "$d/$nopath")"
+ echo "$d" >expect &&
+ test-tool path-utils real_path "$d" >actual &&
+ test_cmp expect actual &&
+
+ nopath="hopefully-absent-path" &&
+ echo "$d/$nopath" >expect &&
+ test-tool path-utils real_path "$d/$nopath" >actual &&
+ test_cmp expect actual
'
test_expect_success POSIX 'real path removes extra leading slashes' '
+ echo "/" >expect &&
+ test-tool path-utils real_path "///" >actual &&
+ test_cmp expect actual &&
+
nopath="hopefully-absent-path" &&
- test "/" = "$(test-tool path-utils real_path "///")" &&
- test "/$nopath" = "$(test-tool path-utils real_path "///$nopath")" &&
+ echo "/$nopath" >expect &&
+ test-tool path-utils real_path "///$nopath" >actual &&
+ test_cmp expect actual &&
+
# Find an existing top-level directory for the remaining tests:
d=$(pwd -P | sed -e "s|^\([^/]*/[^/]*\)/.*|\1|") &&
- test "$d" = "$(test-tool path-utils real_path "//$d")" &&
- test "$d/$nopath" = "$(test-tool path-utils real_path "//$d/$nopath")"
+ echo "$d" >expect &&
+ test-tool path-utils real_path "//$d" >actual &&
+ test_cmp expect actual &&
+
+ echo "$d/$nopath" >expect &&
+ test-tool path-utils real_path "//$d/$nopath" >actual &&
+ test_cmp expect actual
'
test_expect_success 'real path removes other extra slashes' '
- nopath="hopefully-absent-path" &&
# Find an existing top-level directory for the remaining tests:
d=$(pwd -P | sed -e "s|^\([^/]*/[^/]*\)/.*|\1|") &&
- test "$d" = "$(test-tool path-utils real_path "$d///")" &&
- test "$d/$nopath" = "$(test-tool path-utils real_path "$d///$nopath")"
+ echo "$d" >expect &&
+ test-tool path-utils real_path "$d///" >actual &&
+ test_cmp expect actual &&
+
+ nopath="hopefully-absent-path" &&
+ echo "$d/$nopath" >expect &&
+ test-tool path-utils real_path "$d///$nopath" >actual &&
+ test_cmp expect actual
'
test_expect_success SYMLINKS 'real path works on symlinks' '
@@ -226,19 +264,29 @@ test_expect_success SYMLINKS 'real path works on symlinks' '
mkdir third &&
dir="$(cd .git && pwd -P)" &&
dir2=third/../second/other/.git &&
- test "$dir" = "$(test-tool path-utils real_path $dir2)" &&
+ echo "$dir" >expect &&
+ test-tool path-utils real_path $dir2 >actual &&
+ test_cmp expect actual &&
file="$dir"/index &&
- test "$file" = "$(test-tool path-utils real_path $dir2/index)" &&
+ echo "$file" >expect &&
+ test-tool path-utils real_path $dir2/index >actual &&
+ test_cmp expect actual &&
basename=blub &&
- test "$dir/$basename" = "$(cd .git && test-tool path-utils real_path "$basename")" &&
+ echo "$dir/$basename" >expect &&
+ test-tool -C .git path-utils real_path "$basename" >actual &&
+ test_cmp expect actual &&
ln -s ../first/file .git/syml &&
sym="$(cd first && pwd -P)"/file &&
- test "$sym" = "$(test-tool path-utils real_path "$dir2/syml")"
+ echo "$sym" >expect &&
+ test-tool path-utils real_path "$dir2/syml" >actual &&
+ test_cmp expect actual
'
test_expect_success SYMLINKS 'prefix_path works with absolute paths to work tree symlinks' '
ln -s target symlink &&
- test "$(test-tool path-utils prefix_path prefix "$(pwd)/symlink")" = "symlink"
+ echo "symlink" >expect &&
+ test-tool path-utils prefix_path prefix "$(pwd)/symlink" >actual &&
+ test_cmp expect actual
'
test_expect_success 'prefix_path works with only absolute path to work tree' '
@@ -254,7 +302,10 @@ test_expect_success 'prefix_path rejects absolute path to dir with same beginnin
test_expect_success SYMLINKS 'prefix_path works with absolute path to a symlink to work tree having same beginning as work tree' '
git init repo &&
ln -s repo repolink &&
- test "a" = "$(cd repo && test-tool path-utils prefix_path prefix "$(pwd)/../repolink/a")"
+ echo "a" >expect &&
+ repo_path="$(cd repo && pwd)" &&
+ test-tool -C repo path-utils prefix_path prefix "$repo_path/../repolink/a" >actual &&
+ test_cmp expect actual
'
relative_path /foo/a/b/c/ /foo/a/b/ c/
diff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh
index 7b5423e..20986b6 100755
--- a/t/t0061-run-command.sh
+++ b/t/t0061-run-command.sh
@@ -19,12 +19,12 @@ test_expect_success MINGW 'subprocess inherits only std handles' '
test_expect_success 'start_command reports ENOENT (slash)' '
test-tool run-command start-command-ENOENT ./does-not-exist 2>err &&
- test_i18ngrep "\./does-not-exist" err
+ test_grep "\./does-not-exist" err
'
test_expect_success 'start_command reports ENOENT (no slash)' '
test-tool run-command start-command-ENOENT does-not-exist 2>err &&
- test_i18ngrep "does-not-exist" err
+ test_grep "does-not-exist" err
'
test_expect_success 'run_command can run a command' '
@@ -49,7 +49,7 @@ test_expect_success !RUNS_COMMANDS_FROM_PWD 'run_command is restricted to PATH'
echo yikes
EOF
test_must_fail test-tool run-command run-command should-not-run 2>err &&
- test_i18ngrep "should-not-run" err
+ test_grep "should-not-run" err
'
test_expect_success !MINGW 'run_command can run a script without a #! line' '
@@ -130,7 +130,8 @@ World
EOF
test_expect_success 'run_command runs in parallel with more jobs available than tasks' '
- test-tool run-command run-command-parallel 5 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual &&
+ test-tool run-command run-command-parallel 5 sh -c "printf \"%s\n%s\n\" Hello World" >out 2>actual &&
+ test_must_be_empty out &&
test_cmp expect actual
'
@@ -141,7 +142,8 @@ test_expect_success 'run_command runs ungrouped in parallel with more jobs avail
'
test_expect_success 'run_command runs in parallel with as many jobs as tasks' '
- test-tool run-command run-command-parallel 4 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual &&
+ test-tool run-command run-command-parallel 4 sh -c "printf \"%s\n%s\n\" Hello World" >out 2>actual &&
+ test_must_be_empty out &&
test_cmp expect actual
'
@@ -152,7 +154,8 @@ test_expect_success 'run_command runs ungrouped in parallel with as many jobs as
'
test_expect_success 'run_command runs in parallel with more tasks than jobs available' '
- test-tool run-command run-command-parallel 3 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual &&
+ test-tool run-command run-command-parallel 3 sh -c "printf \"%s\n%s\n\" Hello World" >out 2>actual &&
+ test_must_be_empty out &&
test_cmp expect actual
'
@@ -172,7 +175,8 @@ asking for a quick stop
EOF
test_expect_success 'run_command is asked to abort gracefully' '
- test-tool run-command run-command-abort 3 false 2>actual &&
+ test-tool run-command run-command-abort 3 false >out 2>actual &&
+ test_must_be_empty out &&
test_cmp expect actual
'
@@ -187,7 +191,8 @@ no further jobs available
EOF
test_expect_success 'run_command outputs ' '
- test-tool run-command run-command-no-jobs 3 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual &&
+ test-tool run-command run-command-no-jobs 3 sh -c "printf \"%s\n%s\n\" Hello World" >out 2>actual &&
+ test_must_be_empty out &&
test_cmp expect actual
'
diff --git a/t/t0063-string-list.sh b/t/t0063-string-list.sh
index 46d4839..1fee6d9 100755
--- a/t/t0063-string-list.sh
+++ b/t/t0063-string-list.sh
@@ -18,6 +18,14 @@ test_split () {
"
}
+test_split_in_place() {
+ cat >expected &&
+ test_expect_success "split (in place) $1 at $2, max $3" "
+ test-tool string-list split_in_place '$1' '$2' '$3' >actual &&
+ test_cmp expected actual
+ "
+}
+
test_split "foo:bar:baz" ":" "-1" <<EOF
3
[0]: "foo"
@@ -61,6 +69,49 @@ test_split ":" ":" "-1" <<EOF
[1]: ""
EOF
+test_split_in_place "foo:;:bar:;:baz:;:" ":;" "-1" <<EOF
+10
+[0]: "foo"
+[1]: ""
+[2]: ""
+[3]: "bar"
+[4]: ""
+[5]: ""
+[6]: "baz"
+[7]: ""
+[8]: ""
+[9]: ""
+EOF
+
+test_split_in_place "foo:;:bar:;:baz" ":;" "0" <<EOF
+1
+[0]: "foo:;:bar:;:baz"
+EOF
+
+test_split_in_place "foo:;:bar:;:baz" ":;" "1" <<EOF
+2
+[0]: "foo"
+[1]: ";:bar:;:baz"
+EOF
+
+test_split_in_place "foo:;:bar:;:baz" ":;" "2" <<EOF
+3
+[0]: "foo"
+[1]: ""
+[2]: ":bar:;:baz"
+EOF
+
+test_split_in_place "foo:;:bar:;:" ":;" "-1" <<EOF
+7
+[0]: "foo"
+[1]: ""
+[2]: ""
+[3]: "bar"
+[4]: ""
+[5]: ""
+[6]: ""
+EOF
+
test_expect_success "test filter_string_list" '
test "x-" = "x$(test-tool string-list filter - y)" &&
test "x-" = "x$(test-tool string-list filter no y)" &&
diff --git a/t/t0066-dir-iterator.sh b/t/t0066-dir-iterator.sh
index 63a1a45..7d0a0da 100755
--- a/t/t0066-dir-iterator.sh
+++ b/t/t0066-dir-iterator.sh
@@ -106,11 +106,7 @@ test_expect_success SYMLINKS 'setup dirs with symlinks' '
ln -s d dir4/a/e &&
ln -s ../b dir4/a/f &&
- mkdir -p dir5/a/b &&
- mkdir -p dir5/a/c &&
- ln -s ../c dir5/a/b/d &&
- ln -s ../ dir5/a/b/e &&
- ln -s ../../ dir5/a/b/f
+ ln -s dir4 dir5
'
test_expect_success SYMLINKS 'dir-iterator should not follow symlinks by default' '
@@ -129,21 +125,10 @@ test_expect_success SYMLINKS 'dir-iterator should not follow symlinks by default
test_cmp expected-no-follow-sorted-output actual-no-follow-sorted-output
'
-test_expect_success SYMLINKS 'dir-iterator should follow symlinks w/ follow flag' '
- cat >expected-follow-sorted-output <<-EOF &&
- [d] (a) [a] ./dir4/a
- [d] (a/f) [f] ./dir4/a/f
- [d] (a/f/c) [c] ./dir4/a/f/c
- [d] (b) [b] ./dir4/b
- [d] (b/c) [c] ./dir4/b/c
- [f] (a/d) [d] ./dir4/a/d
- [f] (a/e) [e] ./dir4/a/e
- EOF
-
- test-tool dir-iterator --follow-symlinks ./dir4 >out &&
- sort out >actual-follow-sorted-output &&
+test_expect_success SYMLINKS 'dir-iterator does not resolve top-level symlinks' '
+ test_must_fail test-tool dir-iterator ./dir5 >out &&
- test_cmp expected-follow-sorted-output actual-follow-sorted-output
+ grep "ENOTDIR" out
'
test_done
diff --git a/t/t0068-for-each-repo.sh b/t/t0068-for-each-repo.sh
index 4675e85..4b90b74 100755
--- a/t/t0068-for-each-repo.sh
+++ b/t/t0068-for-each-repo.sh
@@ -2,15 +2,18 @@
test_description='git for-each-repo builtin'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'run based on configured value' '
git init one &&
git init two &&
git init three &&
+ git init ~/four &&
git -C two commit --allow-empty -m "DID NOT RUN" &&
git config run.key "$TRASH_DIRECTORY/one" &&
git config --add run.key "$TRASH_DIRECTORY/three" &&
+ git config --add run.key "~/four" &&
git for-each-repo --config=run.key commit --allow-empty -m "ran" &&
git -C one log -1 --pretty=format:%s >message &&
grep ran message &&
@@ -18,12 +21,16 @@ test_expect_success 'run based on configured value' '
! grep ran message &&
git -C three log -1 --pretty=format:%s >message &&
grep ran message &&
+ git -C ~/four log -1 --pretty=format:%s >message &&
+ grep ran message &&
git for-each-repo --config=run.key -- commit --allow-empty -m "ran again" &&
git -C one log -1 --pretty=format:%s >message &&
grep again message &&
git -C two log -1 --pretty=format:%s >message &&
! grep again message &&
git -C three log -1 --pretty=format:%s >message &&
+ grep again message &&
+ git -C ~/four log -1 --pretty=format:%s >message &&
grep again message
'
@@ -33,4 +40,23 @@ test_expect_success 'do nothing on empty config' '
git for-each-repo --config=bogus.config -- help --no-such-option
'
+test_expect_success 'error on bad config keys' '
+ test_expect_code 129 git for-each-repo --config=a &&
+ test_expect_code 129 git for-each-repo --config=a.b. &&
+ test_expect_code 129 git for-each-repo --config="'\''.b"
+'
+
+test_expect_success 'error on NULL value for config keys' '
+ cat >>.git/config <<-\EOF &&
+ [empty]
+ key
+ EOF
+ cat >expect <<-\EOF &&
+ error: missing value for '\''empty.key'\''
+ EOF
+ test_expect_code 129 git for-each-repo --config=empty.key 2>actual.raw &&
+ grep ^error actual.raw >actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t0070-fundamental.sh b/t/t0070-fundamental.sh
index 8d59905..0ecec2b 100755
--- a/t/t0070-fundamental.sh
+++ b/t/t0070-fundamental.sh
@@ -6,12 +6,9 @@ test_description='check that the most basic functions work
Verify wrappers and compatibility functions.
'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
-test_expect_success 'character classes (isspace, isalpha etc.)' '
- test-tool ctype
-'
-
test_expect_success 'mktemp to nonexistent directory prints filename' '
test_must_fail test-tool mktemp doesnotexist/testXXXXXX 2>err &&
grep "doesnotexist/test" err
@@ -43,13 +40,71 @@ test_expect_success 'incomplete sideband messages are reassembled' '
test_expect_success 'eof on sideband message is reported' '
printf 1234 >input &&
test-tool pkt-line receive-sideband <input 2>err &&
- test_i18ngrep "unexpected disconnect" err
+ test_grep "unexpected disconnect" err
'
test_expect_success 'missing sideband designator is reported' '
printf 0004 >input &&
test-tool pkt-line receive-sideband <input 2>err &&
- test_i18ngrep "missing sideband" err
+ test_grep "missing sideband" err
+'
+
+test_expect_success 'unpack-sideband: --no-chomp-newline' '
+ test_when_finished "rm -f expect-out expect-err" &&
+ test-tool pkt-line send-split-sideband >split-sideband &&
+ test-tool pkt-line unpack-sideband \
+ --no-chomp-newline <split-sideband >out 2>err &&
+ cat >expect-out <<-EOF &&
+ primary: regular output
+ EOF
+ cat >expect-err <<-EOF &&
+ Foo.
+ Bar.
+ Hello, world!
+ EOF
+ test_cmp expect-out out &&
+ test_cmp expect-err err
+'
+
+test_expect_success 'unpack-sideband: --chomp-newline (default)' '
+ test_when_finished "rm -f expect-out expect-err" &&
+ test-tool pkt-line send-split-sideband >split-sideband &&
+ test-tool pkt-line unpack-sideband \
+ --chomp-newline <split-sideband >out 2>err &&
+ printf "primary: regular output" >expect-out &&
+ printf "Foo.Bar.Hello, world!" >expect-err &&
+ test_cmp expect-out out &&
+ test_cmp expect-err err
+'
+
+test_expect_success 'unpack-sideband: packet_reader_read() consumes sideband, no chomp payload' '
+ test_when_finished "rm -f expect-out expect-err" &&
+ test-tool pkt-line send-split-sideband >split-sideband &&
+ test-tool pkt-line unpack-sideband \
+ --reader-use-sideband \
+ --no-chomp-newline <split-sideband >out 2>err &&
+ cat >expect-out <<-EOF &&
+ primary: regular output
+ EOF
+ printf "remote: Foo. \n" >expect-err &&
+ printf "remote: Bar. \n" >>expect-err &&
+ printf "remote: Hello, world! \n" >>expect-err &&
+ test_cmp expect-out out &&
+ test_cmp expect-err err
+'
+
+test_expect_success 'unpack-sideband: packet_reader_read() consumes sideband, chomp payload' '
+ test_when_finished "rm -f expect-out expect-err" &&
+ test-tool pkt-line send-split-sideband >split-sideband &&
+ test-tool pkt-line unpack-sideband \
+ --reader-use-sideband \
+ --chomp-newline <split-sideband >out 2>err &&
+ printf "primary: regular output" >expect-out &&
+ printf "remote: Foo. \n" >expect-err &&
+ printf "remote: Bar. \n" >>expect-err &&
+ printf "remote: Hello, world! \n" >>expect-err &&
+ test_cmp expect-out out &&
+ test_cmp expect-err err
'
test_done
diff --git a/t/t0071-sort.sh b/t/t0071-sort.sh
index 6f9a501..ba8ad1d 100755
--- a/t/t0071-sort.sh
+++ b/t/t0071-sort.sh
@@ -5,7 +5,7 @@ test_description='verify sort functions'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
-test_expect_success 'llist_mergesort()' '
+test_expect_success 'DEFINE_LIST_SORT_DEBUG' '
test-tool mergesort test
'
diff --git a/t/t0080-unit-test-output.sh b/t/t0080-unit-test-output.sh
new file mode 100755
index 0000000..6657c11
--- /dev/null
+++ b/t/t0080-unit-test-output.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+test_description='Test the output of the unit test framework'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+test_expect_success 'TAP output from unit tests' '
+ cat >expect <<-EOF &&
+ ok 1 - passing test
+ ok 2 - passing test and assertion return 1
+ # check "1 == 2" failed at t/unit-tests/t-basic.c:76
+ # left: 1
+ # right: 2
+ not ok 3 - failing test
+ ok 4 - failing test and assertion return 0
+ not ok 5 - passing TEST_TODO() # TODO
+ ok 6 - passing TEST_TODO() returns 1
+ # todo check ${SQ}check(x)${SQ} succeeded at t/unit-tests/t-basic.c:25
+ not ok 7 - failing TEST_TODO()
+ ok 8 - failing TEST_TODO() returns 0
+ # check "0" failed at t/unit-tests/t-basic.c:30
+ # skipping test - missing prerequisite
+ # skipping check ${SQ}1${SQ} at t/unit-tests/t-basic.c:32
+ ok 9 - test_skip() # SKIP
+ ok 10 - skipped test returns 1
+ # skipping test - missing prerequisite
+ ok 11 - test_skip() inside TEST_TODO() # SKIP
+ ok 12 - test_skip() inside TEST_TODO() returns 1
+ # check "0" failed at t/unit-tests/t-basic.c:48
+ not ok 13 - TEST_TODO() after failing check
+ ok 14 - TEST_TODO() after failing check returns 0
+ # check "0" failed at t/unit-tests/t-basic.c:56
+ not ok 15 - failing check after TEST_TODO()
+ ok 16 - failing check after TEST_TODO() returns 0
+ # check "!strcmp("\thello\\\\", "there\"\n")" failed at t/unit-tests/t-basic.c:61
+ # left: "\011hello\\\\"
+ # right: "there\"\012"
+ # check "!strcmp("NULL", NULL)" failed at t/unit-tests/t-basic.c:62
+ # left: "NULL"
+ # right: NULL
+ # check "${SQ}a${SQ} == ${SQ}\n${SQ}" failed at t/unit-tests/t-basic.c:63
+ # left: ${SQ}a${SQ}
+ # right: ${SQ}\012${SQ}
+ # check "${SQ}\\\\${SQ} == ${SQ}\\${SQ}${SQ}" failed at t/unit-tests/t-basic.c:64
+ # left: ${SQ}\\\\${SQ}
+ # right: ${SQ}\\${SQ}${SQ}
+ not ok 17 - messages from failing string and char comparison
+ # BUG: test has no checks at t/unit-tests/t-basic.c:91
+ not ok 18 - test with no checks
+ ok 19 - test with no checks returns 0
+ 1..19
+ EOF
+
+ ! "$GIT_BUILD_DIR"/t/unit-tests/bin/t-basic >actual &&
+ test_cmp expect actual
+'
+
+test_done
diff --git a/t/t0081-find-pack.sh b/t/t0081-find-pack.sh
new file mode 100755
index 0000000..67b1121
--- /dev/null
+++ b/t/t0081-find-pack.sh
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+test_description='test `test-tool find-pack`'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+ test_commit one &&
+ test_commit two &&
+ test_commit three &&
+ test_commit four &&
+ test_commit five
+'
+
+test_expect_success 'repack everything into a single packfile' '
+ git repack -a -d --no-write-bitmap-index &&
+
+ head_commit_pack=$(test-tool find-pack HEAD) &&
+ head_tree_pack=$(test-tool find-pack HEAD^{tree}) &&
+ one_pack=$(test-tool find-pack HEAD:one.t) &&
+ three_pack=$(test-tool find-pack HEAD:three.t) &&
+ old_commit_pack=$(test-tool find-pack HEAD~4) &&
+
+ test-tool find-pack --check-count 1 HEAD &&
+ test-tool find-pack --check-count=1 HEAD^{tree} &&
+ ! test-tool find-pack --check-count=0 HEAD:one.t &&
+ ! test-tool find-pack -c 2 HEAD:one.t &&
+ test-tool find-pack -c 1 HEAD:three.t &&
+
+ # Packfile exists at the right path
+ case "$head_commit_pack" in
+ ".git/objects/pack/pack-"*".pack") true ;;
+ *) false ;;
+ esac &&
+ test -f "$head_commit_pack" &&
+
+ # Everything is in the same pack
+ test "$head_commit_pack" = "$head_tree_pack" &&
+ test "$head_commit_pack" = "$one_pack" &&
+ test "$head_commit_pack" = "$three_pack" &&
+ test "$head_commit_pack" = "$old_commit_pack"
+'
+
+test_expect_success 'add more packfiles' '
+ git rev-parse HEAD^{tree} HEAD:two.t HEAD:four.t >objects &&
+ git pack-objects .git/objects/pack/mypackname1 >packhash1 <objects &&
+
+ git rev-parse HEAD~ HEAD~^{tree} HEAD:five.t >objects &&
+ git pack-objects .git/objects/pack/mypackname2 >packhash2 <objects &&
+
+ head_commit_pack=$(test-tool find-pack HEAD) &&
+
+ # HEAD^{tree} is in 2 packfiles
+ test-tool find-pack HEAD^{tree} >head_tree_packs &&
+ grep "$head_commit_pack" head_tree_packs &&
+ grep mypackname1 head_tree_packs &&
+ ! grep mypackname2 head_tree_packs &&
+ test-tool find-pack --check-count 2 HEAD^{tree} &&
+ ! test-tool find-pack --check-count 1 HEAD^{tree} &&
+
+ # HEAD:five.t is also in 2 packfiles
+ test-tool find-pack HEAD:five.t >five_packs &&
+ grep "$head_commit_pack" five_packs &&
+ ! grep mypackname1 five_packs &&
+ grep mypackname2 five_packs &&
+ test-tool find-pack -c 2 HEAD:five.t &&
+ ! test-tool find-pack --check-count=0 HEAD:five.t
+'
+
+test_expect_success 'add more commits (as loose objects)' '
+ test_commit six &&
+ test_commit seven &&
+
+ test -z "$(test-tool find-pack HEAD)" &&
+ test -z "$(test-tool find-pack HEAD:six.t)" &&
+ test-tool find-pack --check-count 0 HEAD &&
+ test-tool find-pack -c 0 HEAD:six.t &&
+ ! test-tool find-pack -c 1 HEAD:seven.t
+'
+
+test_done
diff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh
index 9067572..d8e2fc4 100755
--- a/t/t0090-cache-tree.sh
+++ b/t/t0090-cache-tree.sh
@@ -5,6 +5,8 @@ test_description="Test whether cache-tree is properly updated
Tests whether various commands properly update and/or rewrite the
cache-tree extension.
"
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
cmp_cache_tree () {
diff --git a/t/t0091-bugreport.sh b/t/t0091-bugreport.sh
index 08f5fe9..fca3904 100755
--- a/t/t0091-bugreport.sh
+++ b/t/t0091-bugreport.sh
@@ -5,29 +5,50 @@ test_description='git bugreport'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
-# Headers "[System Info]" will be followed by a non-empty line if we put some
-# information there; we can make sure all our headers were followed by some
-# information to check if the command was successful.
-HEADER_PATTERN="^\[.*\]$"
-
-check_all_headers_populated () {
- while read -r line
- do
- if test "$(grep "$HEADER_PATTERN" "$line")"
- then
- echo "$line"
- read -r nextline
- if test -z "$nextline"; then
- return 1;
- fi
- fi
- done
-}
-
-test_expect_success 'creates a report with content in the right places' '
- test_when_finished rm git-bugreport-check-headers.txt &&
- git bugreport -s check-headers &&
- check_all_headers_populated <git-bugreport-check-headers.txt
+test_expect_success 'create a report' '
+ git bugreport -s format &&
+ test_file_not_empty git-bugreport-format.txt
+'
+
+test_expect_success 'report contains wanted template (before first section)' '
+ sed -ne "/^\[/q;p" git-bugreport-format.txt >actual &&
+ cat >expect <<-\EOF &&
+ Thank you for filling out a Git bug report!
+ Please answer the following questions to help us understand your issue.
+
+ What did you do before the bug happened? (Steps to reproduce your issue)
+
+ What did you expect to happen? (Expected behavior)
+
+ What happened instead? (Actual behavior)
+
+ What'\''s different between what you expected and what actually happened?
+
+ Anything else you want to add:
+
+ Please review the rest of the bug report below.
+ You can delete any lines you don'\''t wish to share.
+
+
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'sanity check "System Info" section' '
+ test_when_finished rm -f git-bugreport-format.txt &&
+
+ sed -ne "/^\[System Info\]$/,/^$/p" <git-bugreport-format.txt >system &&
+
+ # The beginning should match "git version --build-options" verbatim,
+ # but rather than checking bit-for-bit equality, just test some basics.
+ grep "git version " system &&
+ grep "shell-path: ." system &&
+
+ # After the version, there should be some more info.
+ # This is bound to differ from environment to environment,
+ # so we just do some rather high-level checks.
+ grep "uname: ." system &&
+ grep "compiler info: ." system
'
test_expect_success 'dies if file with same name as report already exists' '
@@ -44,7 +65,14 @@ test_expect_success '--output-directory puts the report in the provided dir' '
test_expect_success 'incorrect arguments abort with usage' '
test_must_fail git bugreport --false 2>output &&
- test_i18ngrep usage output &&
+ test_grep usage output &&
+ test_path_is_missing git-bugreport-*
+'
+
+test_expect_success 'incorrect positional arguments abort with usage and hint' '
+ test_must_fail git bugreport false 2>output &&
+ test_grep usage output &&
+ test_grep false output &&
test_path_is_missing git-bugreport-*
'
@@ -78,4 +106,52 @@ test_expect_success 'indicates populated hooks' '
test_cmp expect actual
'
+test_expect_success UNZIP '--diagnose creates diagnostics zip archive' '
+ test_when_finished rm -rf report &&
+
+ git bugreport --diagnose -o report -s test >out &&
+
+ zip_path=report/git-diagnostics-test.zip &&
+ grep "Available space" out &&
+ test_path_is_file "$zip_path" &&
+
+ # Check zipped archive content
+ "$GIT_UNZIP" -p "$zip_path" diagnostics.log >out &&
+ test_file_not_empty out &&
+
+ "$GIT_UNZIP" -p "$zip_path" packs-local.txt >out &&
+ grep ".git/objects" out &&
+
+ "$GIT_UNZIP" -p "$zip_path" objects-local.txt >out &&
+ grep "^Total: [0-9][0-9]*" out &&
+
+ # Should not include .git directory contents by default
+ ! "$GIT_UNZIP" -l "$zip_path" | grep ".git/"
+'
+
+test_expect_success UNZIP '--diagnose=stats excludes .git dir contents' '
+ test_when_finished rm -rf report &&
+
+ git bugreport --diagnose=stats -o report -s test >out &&
+
+ # Includes pack quantity/size info
+ "$GIT_UNZIP" -p "$zip_path" packs-local.txt >out &&
+ grep ".git/objects" out &&
+
+ # Does not include .git directory contents
+ ! "$GIT_UNZIP" -l "$zip_path" | grep ".git/"
+'
+
+test_expect_success UNZIP '--diagnose=all includes .git dir contents' '
+ test_when_finished rm -rf report &&
+
+ git bugreport --diagnose=all -o report -s test >out &&
+
+ # Includes .git directory contents
+ "$GIT_UNZIP" -l "$zip_path" | grep ".git/" &&
+
+ "$GIT_UNZIP" -p "$zip_path" .git/HEAD >out &&
+ test_file_not_empty out
+'
+
test_done
diff --git a/t/t0092-diagnose.sh b/t/t0092-diagnose.sh
new file mode 100755
index 0000000..133e574
--- /dev/null
+++ b/t/t0092-diagnose.sh
@@ -0,0 +1,72 @@
+#!/bin/sh
+
+test_description='git diagnose'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+test_expect_success UNZIP 'creates diagnostics zip archive' '
+ test_when_finished rm -rf report &&
+
+ git diagnose -o report -s test >out &&
+ grep "Available space" out &&
+
+ zip_path=report/git-diagnostics-test.zip &&
+ test_path_is_file "$zip_path" &&
+
+ # Check zipped archive content
+ "$GIT_UNZIP" -p "$zip_path" diagnostics.log >out &&
+ test_file_not_empty out &&
+
+ "$GIT_UNZIP" -p "$zip_path" packs-local.txt >out &&
+ grep ".git/objects" out &&
+
+ "$GIT_UNZIP" -p "$zip_path" objects-local.txt >out &&
+ grep "^Total: [0-9][0-9]*" out &&
+
+ # Should not include .git directory contents by default
+ ! "$GIT_UNZIP" -l "$zip_path" | grep ".git/"
+'
+
+test_expect_success UNZIP 'counts loose objects' '
+ test_commit A &&
+
+ # After committing, should have non-zero loose objects
+ git diagnose -o test-count -s 1 >out &&
+ zip_path=test-count/git-diagnostics-1.zip &&
+ "$GIT_UNZIP" -p "$zip_path" objects-local.txt >out &&
+ grep "^Total: [1-9][0-9]* loose objects" out
+'
+
+test_expect_success UNZIP '--mode=stats excludes .git dir contents' '
+ test_when_finished rm -rf report &&
+
+ git diagnose -o report -s test --mode=stats >out &&
+
+ # Includes pack quantity/size info
+ zip_path=report/git-diagnostics-test.zip &&
+ "$GIT_UNZIP" -p "$zip_path" packs-local.txt >out &&
+ grep ".git/objects" out &&
+
+ # Does not include .git directory contents
+ ! "$GIT_UNZIP" -l "$zip_path" | grep ".git/"
+'
+
+test_expect_success UNZIP '--mode=all includes .git dir contents' '
+ test_when_finished rm -rf report &&
+
+ git diagnose -o report -s test --mode=all >out &&
+
+ # Includes pack quantity/size info
+ zip_path=report/git-diagnostics-test.zip &&
+ "$GIT_UNZIP" -p "$zip_path" packs-local.txt >out &&
+ grep ".git/objects" out &&
+
+ # Includes .git directory contents
+ "$GIT_UNZIP" -l "$zip_path" | grep ".git/" &&
+
+ "$GIT_UNZIP" -p "$zip_path" .git/HEAD >out &&
+ test_file_not_empty out
+'
+
+test_done
diff --git a/t/t0095-bloom.sh b/t/t0095-bloom.sh
index 5945973..b567383 100755
--- a/t/t0095-bloom.sh
+++ b/t/t0095-bloom.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='Testing the various Bloom filter computations in bloom.c'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'compute unseeded murmur3 hash for empty string' '
@@ -67,7 +69,7 @@ test_expect_success 'compute bloom key for test string 2' '
test_cmp expect actual
'
-test_expect_success 'get bloom filters for commit with no changes' '
+test_expect_success !SANITIZE_LEAK 'get bloom filters for commit with no changes' '
git init &&
git commit --allow-empty -m "c0" &&
cat >expect <<-\EOF &&
diff --git a/t/t0100-previous.sh b/t/t0100-previous.sh
index a16cc3d..70a3223 100755
--- a/t/t0100-previous.sh
+++ b/t/t0100-previous.sh
@@ -12,7 +12,9 @@ test_expect_success 'branch -d @{-1}' '
test_commit A &&
git checkout -b junk &&
git checkout - &&
- test "$(git symbolic-ref HEAD)" = refs/heads/main &&
+ echo refs/heads/main >expect &&
+ git symbolic-ref HEAD >actual &&
+ test_cmp expect actual &&
git branch -d @{-1} &&
test_must_fail git rev-parse --verify refs/heads/junk
'
@@ -21,7 +23,9 @@ test_expect_success 'branch -d @{-12} when there is not enough switches yet' '
git reflog expire --expire=now &&
git checkout -b junk2 &&
git checkout - &&
- test "$(git symbolic-ref HEAD)" = refs/heads/main &&
+ echo refs/heads/main >expect &&
+ git symbolic-ref HEAD >actual &&
+ test_cmp expect actual &&
test_must_fail git branch -d @{-12} &&
git rev-parse --verify refs/heads/main
'
diff --git a/t/t0110-urlmatch-normalization.sh b/t/t0110-urlmatch-normalization.sh
index 4dc9fec..12d817f 100755
--- a/t/t0110-urlmatch-normalization.sh
+++ b/t/t0110-urlmatch-normalization.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='urlmatch URL normalization'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# The base name of the test url files
diff --git a/t/t0202-gettext-perl.sh b/t/t0202-gettext-perl.sh
index df2ea34..5a6f280 100755
--- a/t/t0202-gettext-perl.sh
+++ b/t/t0202-gettext-perl.sh
@@ -7,22 +7,12 @@ test_description='Perl gettext interface (Git::I18N)'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-gettext.sh
+. "$TEST_DIRECTORY"/lib-perl.sh
+skip_all_if_no_Test_More
-if ! test_have_prereq PERL; then
- skip_all='skipping perl interface tests, perl not available'
- test_done
-fi
-
-perl -MTest::More -e 0 2>/dev/null || {
- skip_all="Perl Test::More unavailable, skipping test"
- test_done
-}
-
-# The external test will outputs its own plan
-test_external_has_tap=1
-
-test_external_without_stderr \
- 'Perl Git::I18N API' \
- perl "$TEST_DIRECTORY"/t0202/test.pl
+test_expect_success 'run t0202/test.pl to test Git::I18N.pm' '
+ "$PERL_PATH" "$TEST_DIRECTORY"/t0202/test.pl 2>stderr &&
+ test_must_be_empty stderr
+'
test_done
diff --git a/t/t0202/test.pl b/t/t0202/test.pl
index 2cbf7b9..47d96a2 100755
--- a/t/t0202/test.pl
+++ b/t/t0202/test.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-use 5.008;
+use 5.008001;
use lib (split(/:/, $ENV{GITPERLLIB}));
use strict;
use warnings;
diff --git a/t/t0203-gettext-setlocale-sanity.sh b/t/t0203-gettext-setlocale-sanity.sh
index 0ce1f22..86cff32 100755
--- a/t/t0203-gettext-setlocale-sanity.sh
+++ b/t/t0203-gettext-setlocale-sanity.sh
@@ -5,6 +5,7 @@
test_description="The Git C functions aren't broken by setlocale(3)"
+TEST_PASSES_SANITIZE_LEAK=true
. ./lib-gettext.sh
test_expect_success 'git show a ISO-8859-1 commit under C locale' '
diff --git a/t/t0204-gettext-reencode-sanity.sh b/t/t0204-gettext-reencode-sanity.sh
index 4f2e0dc..310a450 100755
--- a/t/t0204-gettext-reencode-sanity.sh
+++ b/t/t0204-gettext-reencode-sanity.sh
@@ -82,7 +82,7 @@ test_expect_success GETTEXT_ISO_LOCALE 'gettext.c: git init UTF-8 -> ISO-8859-1'
printf "Bjó til tóma Git lind" >expect &&
LANGUAGE=is LC_ALL="$is_IS_iso_locale" git init repo >actual &&
test_when_finished "rm -rf repo" &&
- grep "^$(cat expect | iconv -f UTF-8 -t ISO8859-1) " actual
+ grep "^$(iconv -f UTF-8 -t ISO8859-1 <expect) " actual
'
test_done
diff --git a/t/t0210-trace2-normal.sh b/t/t0210-trace2-normal.sh
index 80e76a4..c312657 100755
--- a/t/t0210-trace2-normal.sh
+++ b/t/t0210-trace2-normal.sh
@@ -2,7 +2,7 @@
test_description='test trace2 facility (normal target)'
-TEST_PASSES_SANITIZE_LEAK=true
+TEST_PASSES_SANITIZE_LEAK=false
. ./test-lib.sh
# Turn off any inherited trace2 settings for this test.
@@ -283,4 +283,22 @@ test_expect_success 'using global config with include' '
test_cmp expect actual
'
+test_expect_success 'unsafe URLs are redacted by default' '
+ test_when_finished \
+ "rm -r trace.normal unredacted.normal clone clone2" &&
+
+ test_config_global \
+ "url.$(pwd).insteadOf" https://user:pwd@example.com/ &&
+ test_config_global trace2.configParams "core.*,remote.*.url" &&
+
+ GIT_TRACE2="$(pwd)/trace.normal" \
+ git clone https://user:pwd@example.com/ clone &&
+ ! grep user:pwd trace.normal &&
+
+ GIT_TRACE2_REDACT=0 GIT_TRACE2="$(pwd)/unredacted.normal" \
+ git clone https://user:pwd@example.com/ clone2 &&
+ grep "start .* clone https://user:pwd@example.com" unredacted.normal &&
+ grep "remote.origin.url=https://user:pwd@example.com" unredacted.normal
+'
+
test_done
diff --git a/t/t0211-trace2-perf.sh b/t/t0211-trace2-perf.sh
index 22d0845..13ef69b 100755
--- a/t/t0211-trace2-perf.sh
+++ b/t/t0211-trace2-perf.sh
@@ -2,7 +2,7 @@
test_description='test trace2 facility (perf target)'
-TEST_PASSES_SANITIZE_LEAK=true
+TEST_PASSES_SANITIZE_LEAK=false
. ./test-lib.sh
# Turn off any inherited trace2 settings for this test.
@@ -173,4 +173,349 @@ test_expect_success 'using global config, perf stream, return code 0' '
test_cmp expect actual
'
+# Exercise the stopwatch timers in a loop and confirm that we have
+# as many start/stop intervals as expected. We cannot really test the
+# actual (total, min, max) timer values, so we have to assume that they
+# are good, but we can verify the interval count.
+#
+# The timer "test/test1" should only emit a global summary "timer" event.
+# The timer "test/test2" should emit per-thread "th_timer" events and a
+# global summary "timer" event.
+
+have_timer_event () {
+ thread=$1 event=$2 category=$3 name=$4 intervals=$5 file=$6 &&
+
+ pattern="d0|${thread}|${event}||||${category}|name:${name} intervals:${intervals}" &&
+
+ grep "${pattern}" ${file}
+}
+
+test_expect_success 'stopwatch timer test/test1' '
+ test_when_finished "rm trace.perf actual" &&
+ test_config_global trace2.perfBrief 1 &&
+ test_config_global trace2.perfTarget "$(pwd)/trace.perf" &&
+
+ # Use the timer "test1" 5 times from "main".
+ test-tool trace2 100timer 5 10 &&
+
+ perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <trace.perf >actual &&
+
+ have_timer_event "main" "timer" "test" "test1" 5 actual
+'
+
+test_expect_success PTHREADS 'stopwatch timer test/test2' '
+ test_when_finished "rm trace.perf actual" &&
+ test_config_global trace2.perfBrief 1 &&
+ test_config_global trace2.perfTarget "$(pwd)/trace.perf" &&
+
+ # Use the timer "test2" 5 times each in 3 threads.
+ test-tool trace2 101timer 5 10 3 &&
+
+ perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <trace.perf >actual &&
+
+ # So we should have 3 per-thread events of 5 each.
+ have_timer_event "th01:ut_101" "th_timer" "test" "test2" 5 actual &&
+ have_timer_event "th02:ut_101" "th_timer" "test" "test2" 5 actual &&
+ have_timer_event "th03:ut_101" "th_timer" "test" "test2" 5 actual &&
+
+ # And we should have 15 total uses.
+ have_timer_event "main" "timer" "test" "test2" 15 actual
+'
+
+# Exercise the global counters and confirm that we get the expected values.
+#
+# The counter "test/test1" should only emit a global summary "counter" event.
+# The counter "test/test2" could emit per-thread "th_counter" events and a
+# global summary "counter" event.
+
+have_counter_event () {
+ thread=$1 event=$2 category=$3 name=$4 value=$5 file=$6 &&
+
+ pattern="d0|${thread}|${event}||||${category}|name:${name} value:${value}" &&
+
+ grep "${patern}" ${file}
+}
+
+test_expect_success 'global counter test/test1' '
+ test_when_finished "rm trace.perf actual" &&
+ test_config_global trace2.perfBrief 1 &&
+ test_config_global trace2.perfTarget "$(pwd)/trace.perf" &&
+
+ # Use the counter "test1" and add n integers.
+ test-tool trace2 200counter 1 2 3 4 5 &&
+
+ perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <trace.perf >actual &&
+
+ have_counter_event "main" "counter" "test" "test1" 15 actual
+'
+
+test_expect_success PTHREADS 'global counter test/test2' '
+ test_when_finished "rm trace.perf actual" &&
+ test_config_global trace2.perfBrief 1 &&
+ test_config_global trace2.perfTarget "$(pwd)/trace.perf" &&
+
+ # Add 2 integers to the counter "test2" in each of 3 threads.
+ test-tool trace2 201counter 7 13 3 &&
+
+ perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <trace.perf >actual &&
+
+ # So we should have 3 per-thread events of 5 each.
+ have_counter_event "th01:ut_201" "th_counter" "test" "test2" 20 actual &&
+ have_counter_event "th02:ut_201" "th_counter" "test" "test2" 20 actual &&
+ have_counter_event "th03:ut_201" "th_counter" "test" "test2" 20 actual &&
+
+ # And we should have a single event with the total across all threads.
+ have_counter_event "main" "counter" "test" "test2" 60 actual
+'
+
+test_expect_success 'unsafe URLs are redacted by default' '
+ test_when_finished \
+ "rm -r actual trace.perf unredacted.perf clone clone2" &&
+
+ test_config_global \
+ "url.$(pwd).insteadOf" https://user:pwd@example.com/ &&
+ test_config_global trace2.configParams "core.*,remote.*.url" &&
+
+ GIT_TRACE2_PERF="$(pwd)/trace.perf" \
+ git clone https://user:pwd@example.com/ clone &&
+ ! grep user:pwd trace.perf &&
+
+ GIT_TRACE2_REDACT=0 GIT_TRACE2_PERF="$(pwd)/unredacted.perf" \
+ git clone https://user:pwd@example.com/ clone2 &&
+ perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <unredacted.perf >actual &&
+ grep "d0|main|start|.* clone https://user:pwd@example.com" actual &&
+ grep "d0|main|def_param|.*|remote.origin.url:https://user:pwd@example.com" actual
+'
+
+# Confirm that the requested command produces a "cmd_name" and a
+# set of "def_param" events.
+#
+try_simple () {
+ test_when_finished "rm prop.perf actual" &&
+
+ cmd=$1 &&
+ cmd_name=$2 &&
+
+ test_config_global "trace2.configParams" "cfg.prop.*" &&
+ test_config_global "trace2.envvars" "ENV_PROP_FOO,ENV_PROP_BAR" &&
+
+ test_config_global "cfg.prop.foo" "red" &&
+
+ ENV_PROP_FOO=blue \
+ GIT_TRACE2_PERF="$(pwd)/prop.perf" \
+ $cmd &&
+ perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <prop.perf >actual &&
+ grep "d0|main|cmd_name|.*|$cmd_name" actual &&
+ grep "d0|main|def_param|.*|cfg.prop.foo:red" actual &&
+ grep "d0|main|def_param|.*|ENV_PROP_FOO:blue" actual
+}
+
+# Representative mainstream builtin Git command dispatched
+# in run_builtin() in git.c
+#
+test_expect_success 'expect def_params for normal builtin command' '
+ try_simple "git version" "version"
+'
+
+# Representative query command dispatched in handle_options()
+# in git.c
+#
+test_expect_success 'expect def_params for query command' '
+ try_simple "git --man-path" "_query_"
+'
+
+# remote-curl.c does not use the builtin setup in git.c, so confirm
+# that executables built from remote-curl.c emit def_params.
+#
+# Also tests the dashed-command handling where "git foo" silently
+# spawns "git-foo". Make sure that both commands should emit
+# def_params.
+#
+# Pass bogus arguments to remote-https and allow the command to fail
+# because we don't actually have a remote to fetch from. We just want
+# to see the run-dashed code run an executable built from
+# remote-curl.c rather than git.c. Confirm that we get def_param
+# events from both layers.
+#
+test_expect_success 'expect def_params for remote-curl and _run_dashed_' '
+ test_when_finished "rm prop.perf actual" &&
+
+ test_config_global "trace2.configParams" "cfg.prop.*" &&
+ test_config_global "trace2.envvars" "ENV_PROP_FOO,ENV_PROP_BAR" &&
+
+ test_config_global "cfg.prop.foo" "red" &&
+
+ test_might_fail env \
+ ENV_PROP_FOO=blue \
+ GIT_TRACE2_PERF="$(pwd)/prop.perf" \
+ git remote-http x y &&
+
+ perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <prop.perf >actual &&
+
+ grep "d0|main|cmd_name|.*|_run_dashed_" actual &&
+ grep "d0|main|def_param|.*|cfg.prop.foo:red" actual &&
+ grep "d0|main|def_param|.*|ENV_PROP_FOO:blue" actual &&
+
+ grep "d1|main|cmd_name|.*|remote-curl" actual &&
+ grep "d1|main|def_param|.*|cfg.prop.foo:red" actual &&
+ grep "d1|main|def_param|.*|ENV_PROP_FOO:blue" actual
+'
+
+# Similarly, `git-http-fetch` is not built from git.c so do a
+# trivial fetch so that the main git.c run-dashed code spawns
+# an executable built from http-fetch.c. Confirm that we get
+# def_param events from both layers.
+#
+test_expect_success 'expect def_params for http-fetch and _run_dashed_' '
+ test_when_finished "rm prop.perf actual" &&
+
+ test_config_global "trace2.configParams" "cfg.prop.*" &&
+ test_config_global "trace2.envvars" "ENV_PROP_FOO,ENV_PROP_BAR" &&
+
+ test_config_global "cfg.prop.foo" "red" &&
+
+ test_might_fail env \
+ ENV_PROP_FOO=blue \
+ GIT_TRACE2_PERF="$(pwd)/prop.perf" \
+ git http-fetch --stdin file:/// <<-EOF &&
+ EOF
+
+ perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <prop.perf >actual &&
+
+ grep "d0|main|cmd_name|.*|_run_dashed_" actual &&
+ grep "d0|main|def_param|.*|cfg.prop.foo:red" actual &&
+ grep "d0|main|def_param|.*|ENV_PROP_FOO:blue" actual &&
+
+ grep "d1|main|cmd_name|.*|http-fetch" actual &&
+ grep "d1|main|def_param|.*|cfg.prop.foo:red" actual &&
+ grep "d1|main|def_param|.*|ENV_PROP_FOO:blue" actual
+'
+
+# Historically, alias expansion explicitly emitted the def_param
+# events (independent of whether the command was a builtin, a Git
+# command or arbitrary shell command) so that it wasn't dependent
+# upon the unpeeling of the alias. Let's make sure that we preserve
+# the net effect.
+#
+test_expect_success 'expect def_params during git alias expansion' '
+ test_when_finished "rm prop.perf actual" &&
+
+ test_config_global "trace2.configParams" "cfg.prop.*" &&
+ test_config_global "trace2.envvars" "ENV_PROP_FOO,ENV_PROP_BAR" &&
+
+ test_config_global "cfg.prop.foo" "red" &&
+
+ test_config_global "alias.xxx" "version" &&
+
+ ENV_PROP_FOO=blue \
+ GIT_TRACE2_PERF="$(pwd)/prop.perf" \
+ git xxx &&
+
+ perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <prop.perf >actual &&
+
+ # "git xxx" is first mapped to "git-xxx" and the child will fail.
+ grep "d0|main|cmd_name|.*|_run_dashed_ (_run_dashed_)" actual &&
+
+ # We unpeel that and substitute "version" into "xxx" (giving
+ # "git version") and update the cmd_name event.
+ grep "d0|main|cmd_name|.*|_run_git_alias_ (_run_dashed_/_run_git_alias_)" actual &&
+
+ # These def_param events could be associated with either of the
+ # above cmd_name events. It does not matter.
+ grep "d0|main|def_param|.*|cfg.prop.foo:red" actual &&
+ grep "d0|main|def_param|.*|ENV_PROP_FOO:blue" actual &&
+
+ # The "git version" child sees a different cmd_name hierarchy.
+ # Also test the def_param (only for completeness).
+ grep "d1|main|cmd_name|.*|version (_run_dashed_/_run_git_alias_/version)" actual &&
+ grep "d1|main|def_param|.*|cfg.prop.foo:red" actual &&
+ grep "d1|main|def_param|.*|ENV_PROP_FOO:blue" actual
+'
+
+test_expect_success 'expect def_params during shell alias expansion' '
+ test_when_finished "rm prop.perf actual" &&
+
+ test_config_global "trace2.configParams" "cfg.prop.*" &&
+ test_config_global "trace2.envvars" "ENV_PROP_FOO,ENV_PROP_BAR" &&
+
+ test_config_global "cfg.prop.foo" "red" &&
+
+ test_config_global "alias.xxx" "!git version" &&
+
+ ENV_PROP_FOO=blue \
+ GIT_TRACE2_PERF="$(pwd)/prop.perf" \
+ git xxx &&
+
+ perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <prop.perf >actual &&
+
+ # "git xxx" is first mapped to "git-xxx" and the child will fail.
+ grep "d0|main|cmd_name|.*|_run_dashed_ (_run_dashed_)" actual &&
+
+ # We unpeel that and substitute "git version" for "git xxx" (as a
+ # shell command. Another cmd_name event is emitted as we unpeel.
+ grep "d0|main|cmd_name|.*|_run_shell_alias_ (_run_dashed_/_run_shell_alias_)" actual &&
+
+ # These def_param events could be associated with either of the
+ # above cmd_name events. It does not matter.
+ grep "d0|main|def_param|.*|cfg.prop.foo:red" actual &&
+ grep "d0|main|def_param|.*|ENV_PROP_FOO:blue" actual &&
+
+ # We get the following only because we used a git command for the
+ # shell command. In general, it could have been a shell script and
+ # we would see nothing.
+ #
+ # The child knows the cmd_name hierarchy so it includes it.
+ grep "d1|main|cmd_name|.*|version (_run_dashed_/_run_shell_alias_/version)" actual &&
+ grep "d1|main|def_param|.*|cfg.prop.foo:red" actual &&
+ grep "d1|main|def_param|.*|ENV_PROP_FOO:blue" actual
+'
+
+test_expect_success 'expect def_params during nested git alias expansion' '
+ test_when_finished "rm prop.perf actual" &&
+
+ test_config_global "trace2.configParams" "cfg.prop.*" &&
+ test_config_global "trace2.envvars" "ENV_PROP_FOO,ENV_PROP_BAR" &&
+
+ test_config_global "cfg.prop.foo" "red" &&
+
+ test_config_global "alias.xxx" "yyy" &&
+ test_config_global "alias.yyy" "version" &&
+
+ ENV_PROP_FOO=blue \
+ GIT_TRACE2_PERF="$(pwd)/prop.perf" \
+ git xxx &&
+
+ perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <prop.perf >actual &&
+
+ # "git xxx" is first mapped to "git-xxx" and try to spawn "git-xxx"
+ # and the child will fail.
+ grep "d0|main|cmd_name|.*|_run_dashed_ (_run_dashed_)" actual &&
+ grep "d0|main|child_start|.*|.* class:dashed argv:\[git-xxx\]" actual &&
+
+ # We unpeel that and substitute "yyy" into "xxx" (giving "git yyy")
+ # and spawn "git-yyy" and the child will fail.
+ grep "d0|main|alias|.*|alias:xxx argv:\[yyy\]" actual &&
+ grep "d0|main|cmd_name|.*|_run_dashed_ (_run_dashed_/_run_dashed_)" actual &&
+ grep "d0|main|child_start|.*|.* class:dashed argv:\[git-yyy\]" actual &&
+
+ # We unpeel that and substitute "version" into "xxx" (giving
+ # "git version") and update the cmd_name event.
+ grep "d0|main|alias|.*|alias:yyy argv:\[version\]" actual &&
+ grep "d0|main|cmd_name|.*|_run_git_alias_ (_run_dashed_/_run_dashed_/_run_git_alias_)" actual &&
+
+ # These def_param events could be associated with any of the
+ # above cmd_name events. It does not matter.
+ grep "d0|main|def_param|.*|cfg.prop.foo:red" actual >actual.matches &&
+ grep "d0|main|def_param|.*|ENV_PROP_FOO:blue" actual &&
+
+ # However, we do not want them repeated each time we unpeel.
+ test_line_count = 1 actual.matches &&
+
+ # The "git version" child sees a different cmd_name hierarchy.
+ # Also test the def_param (only for completeness).
+ grep "d1|main|cmd_name|.*|version (_run_dashed_/_run_dashed_/_run_git_alias_/version)" actual &&
+ grep "d1|main|def_param|.*|cfg.prop.foo:red" actual &&
+ grep "d1|main|def_param|.*|ENV_PROP_FOO:blue" actual
+'
+
test_done
diff --git a/t/t0211/scrub_perf.perl b/t/t0211/scrub_perf.perl
index 299999f..7a50bae 100644
--- a/t/t0211/scrub_perf.perl
+++ b/t/t0211/scrub_perf.perl
@@ -64,6 +64,12 @@ while (<>) {
goto SKIP_LINE;
}
}
+ elsif ($tokens[$col_event] =~ m/timer/) {
+ # This also captures "th_timer" events
+ $tokens[$col_rest] =~ s/ total:\d+\.\d*/ total:_T_TOTAL_/;
+ $tokens[$col_rest] =~ s/ min:\d+\.\d*/ min:_T_MIN_/;
+ $tokens[$col_rest] =~ s/ max:\d+\.\d*/ max:_T_MAX_/;
+ }
# t_abs and t_rel are either blank or a float. Replace the float
# with a constant for matching the HEREDOC in the test script.
diff --git a/t/t0212-trace2-event.sh b/t/t0212-trace2-event.sh
index 6d3374f..147643d 100755
--- a/t/t0212-trace2-event.sh
+++ b/t/t0212-trace2-event.sh
@@ -323,4 +323,44 @@ test_expect_success 'discard traces when there are too many files' '
head -n2 trace_target_dir/git-trace2-discard | tail -n1 | grep \"event\":\"too_many_files\"
'
+# In the following "...redact..." tests, skip testing the GIT_TRACE2_REDACT=0
+# case because we would need to exactly model the full JSON event stream like
+# we did in the basic tests above and I do not think it is worth it.
+
+test_expect_success 'unsafe URLs are redacted by default in cmd_start events' '
+ test_when_finished \
+ "rm -r trace.event" &&
+
+ GIT_TRACE2_EVENT="$(pwd)/trace.event" \
+ test-tool trace2 300redact_start git clone https://user:pwd@example.com/ clone2 &&
+ ! grep user:pwd trace.event
+'
+
+test_expect_success 'unsafe URLs are redacted by default in child_start events' '
+ test_when_finished \
+ "rm -r trace.event" &&
+
+ GIT_TRACE2_EVENT="$(pwd)/trace.event" \
+ test-tool trace2 301redact_child_start git clone https://user:pwd@example.com/ clone2 &&
+ ! grep user:pwd trace.event
+'
+
+test_expect_success 'unsafe URLs are redacted by default in exec events' '
+ test_when_finished \
+ "rm -r trace.event" &&
+
+ GIT_TRACE2_EVENT="$(pwd)/trace.event" \
+ test-tool trace2 302redact_exec git clone https://user:pwd@example.com/ clone2 &&
+ ! grep user:pwd trace.event
+'
+
+test_expect_success 'unsafe URLs are redacted by default in def_param events' '
+ test_when_finished \
+ "rm -r trace.event" &&
+
+ GIT_TRACE2_EVENT="$(pwd)/trace.event" \
+ test-tool trace2 303redact_def_param url https://user:pwd@example.com/ &&
+ ! grep user:pwd trace.event
+'
+
test_done
diff --git a/t/t0212/parse_events.perl b/t/t0212/parse_events.perl
index b640856..30a9f51 100644
--- a/t/t0212/parse_events.perl
+++ b/t/t0212/parse_events.perl
@@ -216,12 +216,19 @@ while (<>) {
elsif ($event eq 'data') {
my $cat = $line->{'category'};
- if ($cat eq 'test_category') {
-
- my $key = $line->{'key'};
- my $value = $line->{'value'};
- $processes->{$sid}->{'data'}->{$cat}->{$key} = $value;
- }
+ my $key = $line->{'key'};
+ my $value = $line->{'value'};
+ $processes->{$sid}->{'data'}->{$cat}->{$key} = $value;
+ }
+
+ elsif ($event eq 'data_json') {
+ # NEEDSWORK: Ignore due to
+ # compat/win32/trace2_win32_process_info.c, which should log a
+ # "cmd_ancestry" event instead.
+ }
+
+ else {
+ push @{$processes->{$sid}->{$event}} => $line->{value};
}
# This trace2 target does not emit 'printf' events.
diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh
index 3485c05..400f6bd 100755
--- a/t/t0300-credentials.sh
+++ b/t/t0300-credentials.sh
@@ -35,6 +35,16 @@ test_expect_success 'setup helper scripts' '
test -z "$pass" || echo password=$pass
EOF
+ write_script git-credential-verbatim-with-expiry <<-\EOF &&
+ user=$1; shift
+ pass=$1; shift
+ pexpiry=$1; shift
+ . ./dump
+ test -z "$user" || echo username=$user
+ test -z "$pass" || echo password=$pass
+ test -z "$pexpiry" || echo password_expiry_utc=$pexpiry
+ EOF
+
PATH="$PWD:$PATH"
'
@@ -109,6 +119,43 @@ test_expect_success 'credential_fill continues through partial response' '
EOF
'
+test_expect_success 'credential_fill populates password_expiry_utc' '
+ check fill "verbatim-with-expiry one two 9999999999" <<-\EOF
+ protocol=http
+ host=example.com
+ --
+ protocol=http
+ host=example.com
+ username=one
+ password=two
+ password_expiry_utc=9999999999
+ --
+ verbatim-with-expiry: get
+ verbatim-with-expiry: protocol=http
+ verbatim-with-expiry: host=example.com
+ EOF
+'
+
+test_expect_success 'credential_fill ignores expired password' '
+ check fill "verbatim-with-expiry one two 5" "verbatim three four" <<-\EOF
+ protocol=http
+ host=example.com
+ --
+ protocol=http
+ host=example.com
+ username=three
+ password=four
+ --
+ verbatim-with-expiry: get
+ verbatim-with-expiry: protocol=http
+ verbatim-with-expiry: host=example.com
+ verbatim: get
+ verbatim: protocol=http
+ verbatim: host=example.com
+ verbatim: username=one
+ EOF
+'
+
test_expect_success 'credential_fill passes along metadata' '
check fill "verbatim one two" <<-\EOF
protocol=ftp
@@ -149,6 +196,42 @@ test_expect_success 'credential_approve calls all helpers' '
EOF
'
+test_expect_success 'credential_approve stores password expiry' '
+ check approve useless <<-\EOF
+ protocol=http
+ host=example.com
+ username=foo
+ password=bar
+ password_expiry_utc=9999999999
+ --
+ --
+ useless: store
+ useless: protocol=http
+ useless: host=example.com
+ useless: username=foo
+ useless: password=bar
+ useless: password_expiry_utc=9999999999
+ EOF
+'
+
+test_expect_success 'credential_approve stores oauth refresh token' '
+ check approve useless <<-\EOF
+ protocol=http
+ host=example.com
+ username=foo
+ password=bar
+ oauth_refresh_token=xyzzy
+ --
+ --
+ useless: store
+ useless: protocol=http
+ useless: host=example.com
+ useless: username=foo
+ useless: password=bar
+ useless: oauth_refresh_token=xyzzy
+ EOF
+'
+
test_expect_success 'do not bother storing password-less credential' '
check approve useless <<-\EOF
protocol=http
@@ -159,6 +242,17 @@ test_expect_success 'do not bother storing password-less credential' '
EOF
'
+test_expect_success 'credential_approve does not store expired password' '
+ check approve useless <<-\EOF
+ protocol=http
+ host=example.com
+ username=foo
+ password=bar
+ password_expiry_utc=5
+ --
+ --
+ EOF
+'
test_expect_success 'credential_reject calls all helpers' '
check reject useless "verbatim one two" <<-\EOF
@@ -181,6 +275,24 @@ test_expect_success 'credential_reject calls all helpers' '
EOF
'
+test_expect_success 'credential_reject erases credential regardless of expiry' '
+ check reject useless <<-\EOF
+ protocol=http
+ host=example.com
+ username=foo
+ password=bar
+ password_expiry_utc=5
+ --
+ --
+ useless: erase
+ useless: protocol=http
+ useless: host=example.com
+ useless: username=foo
+ useless: password=bar
+ useless: password_expiry_utc=5
+ EOF
+'
+
test_expect_success 'usernames can be preserved' '
check fill "verbatim \"\" three" <<-\EOF
protocol=http
@@ -714,8 +826,8 @@ test_expect_success 'credential config with partial URLs' '
git -c credential.$partial.helper=yep \
-c credential.with%0anewline.username=uh-oh \
- credential fill <stdin >stdout 2>stderr &&
- test_i18ngrep "skipping credential lookup for key" stderr
+ credential fill <stdin 2>stderr &&
+ test_grep "skipping credential lookup for key" stderr
'
test_done
diff --git a/t/t0301-credential-cache.sh b/t/t0301-credential-cache.sh
index 698b715..f2c146f 100755
--- a/t/t0301-credential-cache.sh
+++ b/t/t0301-credential-cache.sh
@@ -8,6 +8,14 @@ test -z "$NO_UNIX_SOCKETS" || {
skip_all='skipping credential-cache tests, unix sockets not available'
test_done
}
+if test_have_prereq MINGW
+then
+ service_running=$(sc query afunix | grep "4 RUNNING")
+ test -z "$service_running" || {
+ skip_all='skipping credential-cache tests, unix sockets not available'
+ test_done
+ }
+fi
uname_s=$(uname -s)
case $uname_s in
@@ -29,6 +37,8 @@ test_atexit 'git credential-cache exit'
# test that the daemon works with no special setup
helper_test cache
+helper_test_password_expiry_utc cache
+helper_test_oauth_refresh_token cache
test_expect_success 'socket defaults to ~/.cache/git/credential/socket' '
test_when_finished "
diff --git a/t/t0303-credential-external.sh b/t/t0303-credential-external.sh
index f028fd1..72ae405 100755
--- a/t/t0303-credential-external.sh
+++ b/t/t0303-credential-external.sh
@@ -32,9 +32,24 @@ commands.
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-credential.sh
+# If we're not given a specific external helper to run against,
+# there isn't much to test. But we can still run through our
+# battery of tests with a fake helper and check that the
+# test themselves are self-consistent and clean up after
+# themselves.
+#
+# We'll use the "store" helper, since we can easily inspect
+# its state by looking at the on-disk file. But since it doesn't
+# implement any caching or expiry logic, we'll cheat and override
+# the "check" function to just report all results as OK.
if test -z "$GIT_TEST_CREDENTIAL_HELPER"; then
- skip_all="used to test external credential helpers"
- test_done
+ GIT_TEST_CREDENTIAL_HELPER=store
+ GIT_TEST_CREDENTIAL_HELPER_TIMEOUT=store
+ check () {
+ test "$1" = "approve" || return 0
+ git -c credential.helper=store credential approve
+ }
+ check_cleanup=t
fi
test -z "$GIT_TEST_CREDENTIAL_HELPER_SETUP" ||
@@ -45,6 +60,8 @@ test -z "$GIT_TEST_CREDENTIAL_HELPER_SETUP" ||
helper_test_clean "$GIT_TEST_CREDENTIAL_HELPER"
helper_test "$GIT_TEST_CREDENTIAL_HELPER"
+helper_test_password_expiry_utc "$GIT_TEST_CREDENTIAL_HELPER"
+helper_test_oauth_refresh_token "$GIT_TEST_CREDENTIAL_HELPER"
if test -z "$GIT_TEST_CREDENTIAL_HELPER_TIMEOUT"; then
say "# skipping timeout tests (GIT_TEST_CREDENTIAL_HELPER_TIMEOUT not set)"
@@ -57,4 +74,11 @@ fi
# might be long-term system storage
helper_test_clean "$GIT_TEST_CREDENTIAL_HELPER"
+if test "$check_cleanup" = "t"
+then
+ test_expect_success 'test cleanup removes everything' '
+ test_must_be_empty "$HOME/.git-credentials"
+ '
+fi
+
test_done
diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh
index 1e864cf..88a66f0 100755
--- a/t/t0410-partial-clone.sh
+++ b/t/t0410-partial-clone.sh
@@ -49,7 +49,7 @@ test_expect_success 'convert shallow clone to partial clone' '
test_cmp_config -C client 1 core.repositoryformatversion
'
-test_expect_success SHA1 'convert to partial clone with noop extension' '
+test_expect_success DEFAULT_REPO_FORMAT 'convert to partial clone with noop extension' '
rm -fr server client &&
test_create_repo server &&
test_commit -C server my_commit 1 &&
@@ -60,7 +60,7 @@ test_expect_success SHA1 'convert to partial clone with noop extension' '
git -C client fetch --unshallow --filter="blob:none"
'
-test_expect_success SHA1 'converting to partial clone fails with unrecognized extension' '
+test_expect_success DEFAULT_REPO_FORMAT 'converting to partial clone fails with unrecognized extension' '
rm -fr server client &&
test_create_repo server &&
test_commit -C server my_commit 1 &&
@@ -215,6 +215,20 @@ test_expect_success 'fetching of missing objects' '
grep "$HASH" out
'
+test_expect_success 'fetching of a promised object that promisor remote no longer has' '
+ rm -f err &&
+ test_create_repo unreliable-server &&
+ git -C unreliable-server config uploadpack.allowanysha1inwant 1 &&
+ git -C unreliable-server config uploadpack.allowfilter 1 &&
+ test_commit -C unreliable-server foo &&
+
+ git clone --filter=blob:none --no-checkout "file://$(pwd)/unreliable-server" unreliable-client &&
+
+ rm -rf unreliable-server/.git/objects/* &&
+ test_must_fail git -C unreliable-client checkout HEAD 2>err &&
+ grep "could not fetch.*from promisor remote" err
+'
+
test_expect_success 'fetching of missing objects works with ref-in-want enabled' '
# ref-in-want requires protocol version 2
git -C server config protocol.version 2 &&
@@ -651,6 +665,21 @@ test_expect_success 'lazy-fetch when accessing object not in the_repository' '
git -C partial.git rev-list --objects --missing=print HEAD >out &&
grep "[?]$FILE_HASH" out &&
+ # The no-lazy-fetch mechanism prevents Git from fetching
+ test_must_fail env GIT_NO_LAZY_FETCH=1 \
+ git -C partial.git cat-file -e "$FILE_HASH" &&
+
+ # The same with command line option to "git"
+ test_must_fail git --no-lazy-fetch -C partial.git cat-file -e "$FILE_HASH" &&
+
+ # The same, forcing a subprocess via an alias
+ test_must_fail git --no-lazy-fetch -C partial.git \
+ -c alias.foo="!git cat-file" foo -e "$FILE_HASH" &&
+
+ # Sanity check that the file is still missing
+ git -C partial.git rev-list --objects --missing=print HEAD >out &&
+ grep "[?]$FILE_HASH" out &&
+
git -C full cat-file -s "$FILE_HASH" >expect &&
test-tool partial-clone object-info partial.git "$FILE_HASH" >actual &&
test_cmp expect actual &&
diff --git a/t/t0450-txt-doc-vs-help.sh b/t/t0450-txt-doc-vs-help.sh
new file mode 100755
index 0000000..69917d7
--- /dev/null
+++ b/t/t0450-txt-doc-vs-help.sh
@@ -0,0 +1,174 @@
+#!/bin/sh
+
+test_description='assert (unbuilt) Documentation/*.txt and -h output
+
+Run this with --debug to see a summary of where we still fail to make
+the two versions consistent with one another.'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+test_expect_success 'setup: list of builtins' '
+ git --list-cmds=builtins >builtins
+'
+
+test_expect_success 'list of txt and help mismatches is sorted' '
+ sort -u "$TEST_DIRECTORY"/t0450/txt-help-mismatches >expect &&
+ if ! test_cmp expect "$TEST_DIRECTORY"/t0450/txt-help-mismatches
+ then
+ BUG "please keep the list of txt and help mismatches sorted"
+ fi
+'
+
+help_to_synopsis () {
+ builtin="$1" &&
+ out_dir="out/$builtin" &&
+ out="$out_dir/help.synopsis" &&
+ if test -f "$out"
+ then
+ echo "$out" &&
+ return 0
+ fi &&
+ mkdir -p "$out_dir" &&
+ test_expect_code 129 git $builtin -h >"$out.raw" 2>&1 &&
+ sed -n \
+ -e '1,/^$/ {
+ /^$/d;
+ s/^usage: //;
+ s/^ *or: //;
+ p;
+ }' <"$out.raw" >"$out" &&
+ echo "$out"
+}
+
+builtin_to_txt () {
+ echo "$GIT_BUILD_DIR/Documentation/git-$1.txt"
+}
+
+txt_to_synopsis () {
+ builtin="$1" &&
+ out_dir="out/$builtin" &&
+ out="$out_dir/txt.synopsis" &&
+ if test -f "$out"
+ then
+ echo "$out" &&
+ return 0
+ fi &&
+ b2t="$(builtin_to_txt "$builtin")" &&
+ sed -n \
+ -e '/^\[verse\]$/,/^$/ {
+ /^$/d;
+ /^\[verse\]$/d;
+ s/_//g;
+ s/++//g;
+ s/`//g;
+ s/{litdd}/--/g;
+ s/'\''\(git[ a-z-]*\)'\''/\1/g;
+
+ p;
+ }' \
+ <"$b2t" >"$out" &&
+ echo "$out"
+}
+
+check_dashed_labels () {
+ ! grep -E "<[^>_-]+_" "$1"
+}
+
+HT=" "
+
+align_after_nl () {
+ builtin="$1" &&
+ len=$(printf "git %s " "$builtin" | wc -c) &&
+ pad=$(printf "%${len}s" "") &&
+
+ sed "s/^[ $HT][ $HT]*/$pad/"
+}
+
+test_debug '>failing'
+while read builtin
+do
+ # -h output assertions
+ test_expect_success "$builtin -h output has no \t" '
+ h2s="$(help_to_synopsis "$builtin")" &&
+ ! grep "$HT" "$h2s"
+ '
+
+ test_expect_success "$builtin -h output has dashed labels" '
+ check_dashed_labels "$(help_to_synopsis "$builtin")"
+ '
+
+ test_expect_success "$builtin -h output has consistent spacing" '
+ h2s="$(help_to_synopsis "$builtin")" &&
+ sed -n \
+ -e "/^ / {
+ s/[^ ].*//;
+ p;
+ }" \
+ <"$h2s" >help &&
+ sort -u help >help.ws &&
+ if test -s help.ws
+ then
+ test_line_count = 1 help.ws
+ fi
+ '
+
+ txt="$(builtin_to_txt "$builtin")" &&
+ preq="$(echo BUILTIN_TXT_$builtin | tr '[:lower:]-' '[:upper:]_')" &&
+
+ if test -f "$txt"
+ then
+ test_set_prereq "$preq"
+ fi &&
+
+ # *.txt output assertions
+ test_expect_success "$preq" "$builtin *.txt SYNOPSIS has dashed labels" '
+ check_dashed_labels "$(txt_to_synopsis "$builtin")"
+ '
+
+ # *.txt output consistency assertions
+ result=
+ if grep -q "^$builtin$" "$TEST_DIRECTORY"/t0450/txt-help-mismatches
+ then
+ result=failure
+ else
+ result=success
+ fi &&
+ test_expect_$result "$preq" "$builtin -h output and SYNOPSIS agree" '
+ t2s="$(txt_to_synopsis "$builtin")" &&
+ if test "$builtin" = "merge-tree"
+ then
+ test_when_finished "rm -f t2s.new" &&
+ sed -e '\''s/ (deprecated)$//g'\'' <"$t2s" >t2s.new
+ t2s=t2s.new
+ fi &&
+ h2s="$(help_to_synopsis "$builtin")" &&
+
+ # The *.txt and -h use different spacing for the
+ # alignment of continued usage output, normalize it.
+ align_after_nl "$builtin" <"$t2s" >txt &&
+ align_after_nl "$builtin" <"$h2s" >help &&
+ test_cmp txt help
+ '
+
+ if test_have_prereq "$preq" && test -e txt && test -e help
+ then
+ test_debug '
+ if test_cmp txt help >cmp 2>/dev/null
+ then
+ echo "=== DONE: $builtin ==="
+ else
+ echo "=== TODO: $builtin ===" &&
+ cat cmp
+ fi >>failing
+ '
+
+ # Not in test_expect_success in case --run is being
+ # used with --debug
+ rm -f txt help tmp 2>/dev/null
+ fi
+done <builtins
+
+test_debug 'say "$(cat failing)"'
+
+test_done
diff --git a/t/t0450/txt-help-mismatches b/t/t0450/txt-help-mismatches
new file mode 100644
index 0000000..a0777ac
--- /dev/null
+++ b/t/t0450/txt-help-mismatches
@@ -0,0 +1,58 @@
+add
+am
+apply
+archive
+bisect
+blame
+branch
+check-ref-format
+checkout
+checkout-index
+clone
+column
+config
+credential
+credential-cache
+credential-store
+fast-export
+fast-import
+fetch-pack
+fmt-merge-msg
+for-each-ref
+format-patch
+fsck-objects
+fsmonitor--daemon
+gc
+grep
+index-pack
+init-db
+log
+ls-files
+ls-tree
+mailinfo
+mailsplit
+maintenance
+merge
+merge-file
+merge-index
+merge-one-file
+multi-pack-index
+name-rev
+notes
+pack-objects
+push
+range-diff
+rebase
+remote
+remote-ext
+remote-fd
+repack
+reset
+restore
+rev-parse
+show
+stage
+switch
+update-index
+update-ref
+whatchanged
diff --git a/t/t0600-reffiles-backend.sh b/t/t0600-reffiles-backend.sh
new file mode 100755
index 0000000..6421434
--- /dev/null
+++ b/t/t0600-reffiles-backend.sh
@@ -0,0 +1,475 @@
+#!/bin/sh
+
+test_description='Test reffiles backend'
+
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+if ! test_have_prereq REFFILES
+then
+ skip_all='skipping reffiles specific tests'
+ test_done
+fi
+
+test_expect_success 'setup' '
+ git commit --allow-empty -m Initial &&
+ C=$(git rev-parse HEAD) &&
+ git commit --allow-empty -m Second &&
+ D=$(git rev-parse HEAD) &&
+ git commit --allow-empty -m Third &&
+ E=$(git rev-parse HEAD)
+'
+
+test_expect_success 'empty directory should not fool rev-parse' '
+ prefix=refs/e-rev-parse &&
+ git update-ref $prefix/foo $C &&
+ git pack-refs --all &&
+ mkdir -p .git/$prefix/foo/bar/baz &&
+ echo "$C" >expected &&
+ git rev-parse $prefix/foo >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'empty directory should not fool for-each-ref' '
+ prefix=refs/e-for-each-ref &&
+ git update-ref $prefix/foo $C &&
+ git for-each-ref $prefix >expected &&
+ git pack-refs --all &&
+ mkdir -p .git/$prefix/foo/bar/baz &&
+ git for-each-ref $prefix >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'empty directory should not fool create' '
+ prefix=refs/e-create &&
+ mkdir -p .git/$prefix/foo/bar/baz &&
+ printf "create %s $C\n" $prefix/foo |
+ git update-ref --stdin
+'
+
+test_expect_success 'empty directory should not fool verify' '
+ prefix=refs/e-verify &&
+ git update-ref $prefix/foo $C &&
+ git pack-refs --all &&
+ mkdir -p .git/$prefix/foo/bar/baz &&
+ printf "verify %s $C\n" $prefix/foo |
+ git update-ref --stdin
+'
+
+test_expect_success 'empty directory should not fool 1-arg update' '
+ prefix=refs/e-update-1 &&
+ git update-ref $prefix/foo $C &&
+ git pack-refs --all &&
+ mkdir -p .git/$prefix/foo/bar/baz &&
+ printf "update %s $D\n" $prefix/foo |
+ git update-ref --stdin
+'
+
+test_expect_success 'empty directory should not fool 2-arg update' '
+ prefix=refs/e-update-2 &&
+ git update-ref $prefix/foo $C &&
+ git pack-refs --all &&
+ mkdir -p .git/$prefix/foo/bar/baz &&
+ printf "update %s $D $C\n" $prefix/foo |
+ git update-ref --stdin
+'
+
+test_expect_success 'empty directory should not fool 0-arg delete' '
+ prefix=refs/e-delete-0 &&
+ git update-ref $prefix/foo $C &&
+ git pack-refs --all &&
+ mkdir -p .git/$prefix/foo/bar/baz &&
+ printf "delete %s\n" $prefix/foo |
+ git update-ref --stdin
+'
+
+test_expect_success 'empty directory should not fool 1-arg delete' '
+ prefix=refs/e-delete-1 &&
+ git update-ref $prefix/foo $C &&
+ git pack-refs --all &&
+ mkdir -p .git/$prefix/foo/bar/baz &&
+ printf "delete %s $C\n" $prefix/foo |
+ git update-ref --stdin
+'
+
+test_expect_success 'non-empty directory blocks create' '
+ prefix=refs/ne-create &&
+ mkdir -p .git/$prefix/foo/bar &&
+ : >.git/$prefix/foo/bar/baz.lock &&
+ test_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" &&
+ cat >expected <<-EOF &&
+ fatal: cannot lock ref $SQ$prefix/foo$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ
+ EOF
+ printf "%s\n" "update $prefix/foo $C" |
+ test_must_fail git update-ref --stdin 2>output.err &&
+ test_cmp expected output.err &&
+ cat >expected <<-EOF &&
+ fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ
+ EOF
+ printf "%s\n" "update $prefix/foo $D $C" |
+ test_must_fail git update-ref --stdin 2>output.err &&
+ test_cmp expected output.err
+'
+
+test_expect_success 'broken reference blocks create' '
+ prefix=refs/broken-create &&
+ mkdir -p .git/$prefix &&
+ echo "gobbledigook" >.git/$prefix/foo &&
+ test_when_finished "rm -f .git/$prefix/foo" &&
+ cat >expected <<-EOF &&
+ fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken
+ EOF
+ printf "%s\n" "update $prefix/foo $C" |
+ test_must_fail git update-ref --stdin 2>output.err &&
+ test_cmp expected output.err &&
+ cat >expected <<-EOF &&
+ fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken
+ EOF
+ printf "%s\n" "update $prefix/foo $D $C" |
+ test_must_fail git update-ref --stdin 2>output.err &&
+ test_cmp expected output.err
+'
+
+test_expect_success 'non-empty directory blocks indirect create' '
+ prefix=refs/ne-indirect-create &&
+ git symbolic-ref $prefix/symref $prefix/foo &&
+ mkdir -p .git/$prefix/foo/bar &&
+ : >.git/$prefix/foo/bar/baz.lock &&
+ test_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" &&
+ cat >expected <<-EOF &&
+ fatal: cannot lock ref $SQ$prefix/symref$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ
+ EOF
+ printf "%s\n" "update $prefix/symref $C" |
+ test_must_fail git update-ref --stdin 2>output.err &&
+ test_cmp expected output.err &&
+ cat >expected <<-EOF &&
+ fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ
+ EOF
+ printf "%s\n" "update $prefix/symref $D $C" |
+ test_must_fail git update-ref --stdin 2>output.err &&
+ test_cmp expected output.err
+'
+
+test_expect_success 'broken reference blocks indirect create' '
+ prefix=refs/broken-indirect-create &&
+ git symbolic-ref $prefix/symref $prefix/foo &&
+ echo "gobbledigook" >.git/$prefix/foo &&
+ test_when_finished "rm -f .git/$prefix/foo" &&
+ cat >expected <<-EOF &&
+ fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken
+ EOF
+ printf "%s\n" "update $prefix/symref $C" |
+ test_must_fail git update-ref --stdin 2>output.err &&
+ test_cmp expected output.err &&
+ cat >expected <<-EOF &&
+ fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken
+ EOF
+ printf "%s\n" "update $prefix/symref $D $C" |
+ test_must_fail git update-ref --stdin 2>output.err &&
+ test_cmp expected output.err
+'
+
+test_expect_success 'no bogus intermediate values during delete' '
+ prefix=refs/slow-transaction &&
+ # Set up a reference with differing loose and packed versions:
+ git update-ref $prefix/foo $C &&
+ git pack-refs --all &&
+ git update-ref $prefix/foo $D &&
+ # Now try to update the reference, but hold the `packed-refs` lock
+ # for a while to see what happens while the process is blocked:
+ : >.git/packed-refs.lock &&
+ test_when_finished "rm -f .git/packed-refs.lock" &&
+ {
+ # Note: the following command is intentionally run in the
+ # background. We increase the timeout so that `update-ref`
+ # attempts to acquire the `packed-refs` lock for much longer
+ # than it takes for us to do the check then delete it:
+ git -c core.packedrefstimeout=30000 update-ref -d $prefix/foo &
+ } &&
+ pid2=$! &&
+ # Give update-ref plenty of time to get to the point where it tries
+ # to lock packed-refs:
+ sleep 1 &&
+ # Make sure that update-ref did not complete despite the lock:
+ kill -0 $pid2 &&
+ # Verify that the reference still has its old value:
+ sha1=$(git rev-parse --verify --quiet $prefix/foo || echo undefined) &&
+ case "$sha1" in
+ $D)
+ # This is what we hope for; it means that nothing
+ # user-visible has changed yet.
+ : ;;
+ undefined)
+ # This is not correct; it means the deletion has happened
+ # already even though update-ref should not have been
+ # able to acquire the lock yet.
+ echo "$prefix/foo deleted prematurely" &&
+ break
+ ;;
+ $C)
+ # This value should never be seen. Probably the loose
+ # reference has been deleted but the packed reference
+ # is still there:
+ echo "$prefix/foo incorrectly observed to be C" &&
+ break
+ ;;
+ *)
+ # WTF?
+ echo "unexpected value observed for $prefix/foo: $sha1" &&
+ break
+ ;;
+ esac >out &&
+ rm -f .git/packed-refs.lock &&
+ wait $pid2 &&
+ test_must_be_empty out &&
+ test_must_fail git rev-parse --verify --quiet $prefix/foo
+'
+
+test_expect_success 'delete fails cleanly if packed-refs file is locked' '
+ prefix=refs/locked-packed-refs &&
+ # Set up a reference with differing loose and packed versions:
+ git update-ref $prefix/foo $C &&
+ git pack-refs --all &&
+ git update-ref $prefix/foo $D &&
+ git for-each-ref $prefix >unchanged &&
+ # Now try to delete it while the `packed-refs` lock is held:
+ : >.git/packed-refs.lock &&
+ test_when_finished "rm -f .git/packed-refs.lock" &&
+ test_must_fail git update-ref -d $prefix/foo >out 2>err &&
+ git for-each-ref $prefix >actual &&
+ test_grep "Unable to create $SQ.*packed-refs.lock$SQ: " err &&
+ test_cmp unchanged actual
+'
+
+test_expect_success 'delete fails cleanly if packed-refs.new write fails' '
+ # Setup and expectations are similar to the test above.
+ prefix=refs/failed-packed-refs &&
+ git update-ref $prefix/foo $C &&
+ git pack-refs --all &&
+ git update-ref $prefix/foo $D &&
+ git for-each-ref $prefix >unchanged &&
+ # This should not happen in practice, but it is an easy way to get a
+ # reliable error (we open with create_tempfile(), which uses O_EXCL).
+ : >.git/packed-refs.new &&
+ test_when_finished "rm -f .git/packed-refs.new" &&
+ test_must_fail git update-ref -d $prefix/foo &&
+ git for-each-ref $prefix >actual &&
+ test_cmp unchanged actual
+'
+
+RWT="test-tool ref-store worktree:wt"
+RMAIN="test-tool ref-store worktree:main"
+
+test_expect_success 'setup worktree' '
+ test_commit first &&
+ git worktree add -b wt-main wt &&
+ (
+ cd wt &&
+ test_commit second
+ )
+'
+
+# Some refs (refs/bisect/*, pseudorefs) are kept per worktree, so they should
+# only appear in the for-each-reflog output if it is called from the correct
+# worktree, which is exercised in this test. This test is poorly written for
+# mulitple reasons: 1) it creates invalidly formatted log entres. 2) it uses
+# direct FS access for creating the reflogs. 3) PSEUDO-WT and refs/bisect/random
+# do not create reflogs by default, so it is not testing a realistic scenario.
+test_expect_success 'for_each_reflog()' '
+ echo $ZERO_OID >.git/logs/PSEUDO_MAIN_HEAD &&
+ mkdir -p .git/logs/refs/bisect &&
+ echo $ZERO_OID >.git/logs/refs/bisect/random &&
+
+ echo $ZERO_OID >.git/worktrees/wt/logs/PSEUDO_WT_HEAD &&
+ mkdir -p .git/worktrees/wt/logs/refs/bisect &&
+ echo $ZERO_OID >.git/worktrees/wt/logs/refs/bisect/wt-random &&
+
+ $RWT for-each-reflog >actual &&
+ cat >expected <<-\EOF &&
+ HEAD
+ PSEUDO_WT_HEAD
+ refs/bisect/wt-random
+ refs/heads/main
+ refs/heads/wt-main
+ EOF
+ test_cmp expected actual &&
+
+ $RMAIN for-each-reflog >actual &&
+ cat >expected <<-\EOF &&
+ HEAD
+ PSEUDO_MAIN_HEAD
+ refs/bisect/random
+ refs/heads/main
+ refs/heads/wt-main
+ EOF
+ test_cmp expected actual
+'
+
+# Triggering the bug detected by this test requires a newline to fall
+# exactly BUFSIZ-1 bytes from the end of the file. We don't know
+# what that value is, since it's platform dependent. However, if
+# we choose some value N, we also catch any D which divides N evenly
+# (since we will read backwards in chunks of D). So we choose 8K,
+# which catches glibc (with an 8K BUFSIZ) and *BSD (1K).
+#
+# Each line is 114 characters, so we need 75 to still have a few before the
+# last 8K. The 89-character padding on the final entry lines up our
+# newline exactly.
+test_expect_success SHA1 'parsing reverse reflogs at BUFSIZ boundaries' '
+ git checkout -b reflogskip &&
+ zf=$(test_oid zero_2) &&
+ ident="abc <xyz> 0000000001 +0000" &&
+ for i in $(test_seq 1 75); do
+ printf "$zf%02d $zf%02d %s\t" $i $(($i+1)) "$ident" &&
+ if test $i = 75; then
+ for j in $(test_seq 1 89); do
+ printf X || return 1
+ done
+ else
+ printf X
+ fi &&
+ printf "\n" || return 1
+ done >.git/logs/refs/heads/reflogskip &&
+ git rev-parse reflogskip@{73} >actual &&
+ echo ${zf}03 >expect &&
+ test_cmp expect actual
+'
+
+# This test takes a lock on an individual ref; this is not supported in
+# reftable.
+test_expect_success 'reflog expire operates on symref not referrent' '
+ git branch --create-reflog the_symref &&
+ git branch --create-reflog referrent &&
+ git update-ref referrent HEAD &&
+ git symbolic-ref refs/heads/the_symref refs/heads/referrent &&
+ test_when_finished "rm -f .git/refs/heads/referrent.lock" &&
+ touch .git/refs/heads/referrent.lock &&
+ git reflog expire --expire=all the_symref
+'
+
+test_expect_success 'empty reflog' '
+ test_when_finished "rm -rf empty" &&
+ git init empty &&
+ test_commit -C empty A &&
+ >empty/.git/logs/refs/heads/foo &&
+ git -C empty reflog expire --all 2>err &&
+ test_must_be_empty err
+'
+
+test_expect_success SYMLINKS 'ref resolution not confused by broken symlinks' '
+ ln -s does-not-exist .git/refs/heads/broken &&
+ test_must_fail git rev-parse --verify broken
+'
+
+test_expect_success 'log diagnoses bogus HEAD hash' '
+ git init empty &&
+ test_when_finished "rm -rf empty" &&
+ echo 1234abcd >empty/.git/refs/heads/main &&
+ test_must_fail git -C empty log 2>stderr &&
+ test_grep broken stderr
+'
+
+test_expect_success 'log diagnoses bogus HEAD symref' '
+ git init empty &&
+ test-tool -C empty ref-store main create-symref HEAD refs/heads/invalid.lock &&
+ test_must_fail git -C empty log 2>stderr &&
+ test_grep broken stderr &&
+ test_must_fail git -C empty log --default totally-bogus 2>stderr &&
+ test_grep broken stderr
+'
+
+test_expect_success 'empty directory removal' '
+ git branch d1/d2/r1 HEAD &&
+ git branch d1/r2 HEAD &&
+ test_path_is_file .git/refs/heads/d1/d2/r1 &&
+ test_path_is_file .git/logs/refs/heads/d1/d2/r1 &&
+ git branch -d d1/d2/r1 &&
+ test_must_fail git show-ref --verify -q refs/heads/d1/d2 &&
+ test_must_fail git show-ref --verify -q logs/refs/heads/d1/d2 &&
+ test_path_is_file .git/refs/heads/d1/r2 &&
+ test_path_is_file .git/logs/refs/heads/d1/r2
+'
+
+test_expect_success 'symref empty directory removal' '
+ git branch e1/e2/r1 HEAD &&
+ git branch e1/r2 HEAD &&
+ git checkout e1/e2/r1 &&
+ test_when_finished "git checkout main" &&
+ test_path_is_file .git/refs/heads/e1/e2/r1 &&
+ test_path_is_file .git/logs/refs/heads/e1/e2/r1 &&
+ git update-ref -d HEAD &&
+ test_must_fail git show-ref --verify -q refs/heads/e1/e2 &&
+ test_must_fail git show-ref --verify -q logs/refs/heads/e1/e2 &&
+ test_path_is_file .git/refs/heads/e1/r2 &&
+ test_path_is_file .git/logs/refs/heads/e1/r2 &&
+ test_path_is_file .git/logs/HEAD
+'
+
+test_expect_success 'directory not created deleting packed ref' '
+ git branch d1/d2/r1 HEAD &&
+ git pack-refs --all &&
+ test_path_is_missing .git/refs/heads/d1/d2 &&
+ git update-ref -d refs/heads/d1/d2/r1 &&
+ test_path_is_missing .git/refs/heads/d1/d2 &&
+ test_path_is_missing .git/refs/heads/d1
+'
+
+test_expect_success SYMLINKS 'git branch -m u v should fail when the reflog for u is a symlink' '
+ git branch --create-reflog u &&
+ mv .git/logs/refs/heads/u real-u &&
+ ln -s real-u .git/logs/refs/heads/u &&
+ test_must_fail git branch -m u v
+'
+
+test_expect_success SYMLINKS 'git branch -m with symlinked .git/refs' '
+ test_when_finished "rm -rf subdir" &&
+ git init --bare subdir &&
+
+ rm -rfv subdir/refs subdir/objects subdir/packed-refs &&
+ ln -s ../.git/refs subdir/refs &&
+ ln -s ../.git/objects subdir/objects &&
+ ln -s ../.git/packed-refs subdir/packed-refs &&
+
+ git -C subdir rev-parse --absolute-git-dir >subdir.dir &&
+ git rev-parse --absolute-git-dir >our.dir &&
+ ! test_cmp subdir.dir our.dir &&
+
+ git -C subdir log &&
+ git -C subdir branch rename-src &&
+ git rev-parse rename-src >expect &&
+ git -C subdir branch -m rename-src rename-dest &&
+ git rev-parse rename-dest >actual &&
+ test_cmp expect actual &&
+ git branch -D rename-dest
+'
+
+test_expect_success MINGW,SYMLINKS_WINDOWS 'rebase when .git/logs is a symlink' '
+ git checkout main &&
+ mv .git/logs actual_logs &&
+ cmd //c "mklink /D .git\logs ..\actual_logs" &&
+ git rebase -f HEAD^ &&
+ test -L .git/logs &&
+ rm .git/logs &&
+ mv actual_logs .git/logs
+'
+
+test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
+ umask 077 &&
+ git config core.sharedRepository group &&
+ git reflog expire --all &&
+ actual="$(ls -l .git/logs/refs/heads/main)" &&
+ case "$actual" in
+ -rw-rw-*)
+ : happy
+ ;;
+ *)
+ echo Ooops, .git/logs/refs/heads/main is not 066x [$actual]
+ false
+ ;;
+ esac
+'
+
+test_done
diff --git a/t/t0601-reffiles-pack-refs.sh b/t/t0601-reffiles-pack-refs.sh
new file mode 100755
index 0000000..7d4ab0b
--- /dev/null
+++ b/t/t0601-reffiles-pack-refs.sh
@@ -0,0 +1,383 @@
+#!/bin/sh
+#
+# Copyright (c) 2005 Amos Waterland
+# Copyright (c) 2006 Christian Couder
+#
+
+test_description='git pack-refs should not change the branch semantic
+
+This test runs git pack-refs and git show-ref and checks that the branch
+semantic is still the same.
+'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+if ! test_have_prereq REFFILES
+then
+ skip_all='skipping reffiles specific tests'
+ test_done
+fi
+
+test_expect_success 'enable reflogs' '
+ git config core.logallrefupdates true
+'
+
+test_expect_success 'prepare a trivial repository' '
+ echo Hello > A &&
+ git update-index --add A &&
+ git commit -m "Initial commit." &&
+ HEAD=$(git rev-parse --verify HEAD)
+'
+
+test_expect_success 'pack-refs --prune --all' '
+ test_path_is_missing .git/packed-refs &&
+ git pack-refs --no-prune --all &&
+ test_path_is_file .git/packed-refs &&
+ N=$(find .git/refs -type f | wc -l) &&
+ test "$N" != 0 &&
+
+ git pack-refs --prune --all &&
+ test_path_is_file .git/packed-refs &&
+ N=$(find .git/refs -type f) &&
+ test -z "$N"
+'
+
+SHA1=
+
+test_expect_success 'see if git show-ref works as expected' '
+ git branch a &&
+ SHA1=$(cat .git/refs/heads/a) &&
+ echo "$SHA1 refs/heads/a" >expect &&
+ git show-ref a >result &&
+ test_cmp expect result
+'
+
+test_expect_success 'see if a branch still exists when packed' '
+ git branch b &&
+ git pack-refs --all &&
+ rm -f .git/refs/heads/b &&
+ echo "$SHA1 refs/heads/b" >expect &&
+ git show-ref b >result &&
+ test_cmp expect result
+'
+
+test_expect_success 'git branch c/d should barf if branch c exists' '
+ git branch c &&
+ git pack-refs --all &&
+ rm -f .git/refs/heads/c &&
+ test_must_fail git branch c/d
+'
+
+test_expect_success 'see if a branch still exists after git pack-refs --prune' '
+ git branch e &&
+ git pack-refs --all --prune &&
+ echo "$SHA1 refs/heads/e" >expect &&
+ git show-ref e >result &&
+ test_cmp expect result
+'
+
+test_expect_success 'see if git pack-refs --prune remove ref files' '
+ git branch f &&
+ git pack-refs --all --prune &&
+ ! test -f .git/refs/heads/f
+'
+
+test_expect_success 'see if git pack-refs --prune removes empty dirs' '
+ git branch r/s/t &&
+ git pack-refs --all --prune &&
+ ! test -e .git/refs/heads/r
+'
+
+test_expect_success 'git branch g should work when git branch g/h has been deleted' '
+ git branch g/h &&
+ git pack-refs --all --prune &&
+ git branch -d g/h &&
+ git branch g &&
+ git pack-refs --all &&
+ git branch -d g
+'
+
+test_expect_success 'git branch i/j/k should barf if branch i exists' '
+ git branch i &&
+ git pack-refs --all --prune &&
+ test_must_fail git branch i/j/k
+'
+
+test_expect_success 'test git branch k after branch k/l/m and k/lm have been deleted' '
+ git branch k/l &&
+ git branch k/lm &&
+ git branch -d k/l &&
+ git branch k/l/m &&
+ git branch -d k/l/m &&
+ git branch -d k/lm &&
+ git branch k
+'
+
+test_expect_success 'test git branch n after some branch deletion and pruning' '
+ git branch n/o &&
+ git branch n/op &&
+ git branch -d n/o &&
+ git branch n/o/p &&
+ git branch -d n/op &&
+ git pack-refs --all --prune &&
+ git branch -d n/o/p &&
+ git branch n
+'
+
+test_expect_success 'test excluded refs are not packed' '
+ git branch dont_pack1 &&
+ git branch dont_pack2 &&
+ git branch pack_this &&
+ git pack-refs --all --exclude "refs/heads/dont_pack*" &&
+ test -f .git/refs/heads/dont_pack1 &&
+ test -f .git/refs/heads/dont_pack2 &&
+ ! test -f .git/refs/heads/pack_this'
+
+test_expect_success 'test --no-exclude refs clears excluded refs' '
+ git branch dont_pack3 &&
+ git branch dont_pack4 &&
+ git pack-refs --all --exclude "refs/heads/dont_pack*" --no-exclude &&
+ ! test -f .git/refs/heads/dont_pack3 &&
+ ! test -f .git/refs/heads/dont_pack4'
+
+test_expect_success 'test only included refs are packed' '
+ git branch pack_this1 &&
+ git branch pack_this2 &&
+ git tag dont_pack5 &&
+ git pack-refs --include "refs/heads/pack_this*" &&
+ test -f .git/refs/tags/dont_pack5 &&
+ ! test -f .git/refs/heads/pack_this1 &&
+ ! test -f .git/refs/heads/pack_this2'
+
+test_expect_success 'test --no-include refs clears included refs' '
+ git branch pack1 &&
+ git branch pack2 &&
+ git pack-refs --include "refs/heads/pack*" --no-include &&
+ test -f .git/refs/heads/pack1 &&
+ test -f .git/refs/heads/pack2'
+
+test_expect_success 'test --exclude takes precedence over --include' '
+ git branch dont_pack5 &&
+ git pack-refs --include "refs/heads/pack*" --exclude "refs/heads/pack*" &&
+ test -f .git/refs/heads/dont_pack5'
+
+test_expect_success '--auto packs and prunes refs as usual' '
+ git branch auto &&
+ test_path_is_file .git/refs/heads/auto &&
+ git pack-refs --auto --all &&
+ test_path_is_missing .git/refs/heads/auto
+'
+
+test_expect_success 'see if up-to-date packed refs are preserved' '
+ git branch q &&
+ git pack-refs --all --prune &&
+ git update-ref refs/heads/q refs/heads/q &&
+ ! test -f .git/refs/heads/q
+'
+
+test_expect_success 'pack, prune and repack' '
+ git tag foo &&
+ git pack-refs --all --prune &&
+ git show-ref >all-of-them &&
+ git pack-refs &&
+ git show-ref >again &&
+ test_cmp all-of-them again
+'
+
+test_expect_success 'explicit pack-refs with dangling packed reference' '
+ git commit --allow-empty -m "soon to be garbage-collected" &&
+ git pack-refs --all &&
+ git reset --hard HEAD^ &&
+ git reflog expire --expire=all --all &&
+ git prune --expire=all &&
+ git pack-refs --all 2>result &&
+ test_must_be_empty result
+'
+
+test_expect_success 'delete ref with dangling packed version' '
+ git checkout -b lamb &&
+ git commit --allow-empty -m "future garbage" &&
+ git pack-refs --all &&
+ git reset --hard HEAD^ &&
+ git checkout main &&
+ git reflog expire --expire=all --all &&
+ git prune --expire=all &&
+ git branch -d lamb 2>result &&
+ test_must_be_empty result
+'
+
+test_expect_success 'delete ref while another dangling packed ref' '
+ git branch lamb &&
+ git commit --allow-empty -m "future garbage" &&
+ git pack-refs --all &&
+ git reset --hard HEAD^ &&
+ git reflog expire --expire=all --all &&
+ git prune --expire=all &&
+ git branch -d lamb 2>result &&
+ test_must_be_empty result
+'
+
+test_expect_success 'pack ref directly below refs/' '
+ git update-ref refs/top HEAD &&
+ git pack-refs --all --prune &&
+ grep refs/top .git/packed-refs &&
+ test_path_is_missing .git/refs/top
+'
+
+test_expect_success 'do not pack ref in refs/bisect' '
+ git update-ref refs/bisect/local HEAD &&
+ git pack-refs --all --prune &&
+ ! grep refs/bisect/local .git/packed-refs >/dev/null &&
+ test_path_is_file .git/refs/bisect/local
+'
+
+test_expect_success 'disable reflogs' '
+ git config core.logallrefupdates false &&
+ rm -rf .git/logs
+'
+
+test_expect_success 'create packed foo/bar/baz branch' '
+ git branch foo/bar/baz &&
+ git pack-refs --all --prune &&
+ test_path_is_missing .git/refs/heads/foo/bar/baz &&
+ test_must_fail git reflog exists refs/heads/foo/bar/baz
+'
+
+test_expect_success 'notice d/f conflict with existing directory' '
+ test_must_fail git branch foo &&
+ test_must_fail git branch foo/bar
+'
+
+test_expect_success 'existing directory reports concrete ref' '
+ test_must_fail git branch foo 2>stderr &&
+ test_grep refs/heads/foo/bar/baz stderr
+'
+
+test_expect_success 'notice d/f conflict with existing ref' '
+ test_must_fail git branch foo/bar/baz/extra &&
+ test_must_fail git branch foo/bar/baz/lots/of/extra/components
+'
+
+test_expect_success 'reject packed-refs with unterminated line' '
+ cp .git/packed-refs .git/packed-refs.bak &&
+ test_when_finished "mv .git/packed-refs.bak .git/packed-refs" &&
+ printf "%s" "$HEAD refs/zzzzz" >>.git/packed-refs &&
+ echo "fatal: unterminated line in .git/packed-refs: $HEAD refs/zzzzz" >expected_err &&
+ test_must_fail git for-each-ref >out 2>err &&
+ test_cmp expected_err err
+'
+
+test_expect_success 'reject packed-refs containing junk' '
+ cp .git/packed-refs .git/packed-refs.bak &&
+ test_when_finished "mv .git/packed-refs.bak .git/packed-refs" &&
+ printf "%s\n" "bogus content" >>.git/packed-refs &&
+ echo "fatal: unexpected line in .git/packed-refs: bogus content" >expected_err &&
+ test_must_fail git for-each-ref >out 2>err &&
+ test_cmp expected_err err
+'
+
+test_expect_success 'reject packed-refs with a short SHA-1' '
+ cp .git/packed-refs .git/packed-refs.bak &&
+ test_when_finished "mv .git/packed-refs.bak .git/packed-refs" &&
+ printf "%.7s %s\n" $HEAD refs/zzzzz >>.git/packed-refs &&
+ printf "fatal: unexpected line in .git/packed-refs: %.7s %s\n" $HEAD refs/zzzzz >expected_err &&
+ test_must_fail git for-each-ref >out 2>err &&
+ test_cmp expected_err err
+'
+
+test_expect_success 'timeout if packed-refs.lock exists' '
+ LOCK=.git/packed-refs.lock &&
+ >"$LOCK" &&
+ test_when_finished "rm -f $LOCK" &&
+ test_must_fail git pack-refs --all --prune
+'
+
+test_expect_success 'retry acquiring packed-refs.lock' '
+ LOCK=.git/packed-refs.lock &&
+ >"$LOCK" &&
+ test_when_finished "wait && rm -f $LOCK" &&
+ {
+ ( sleep 1 && rm -f $LOCK ) &
+ } &&
+ git -c core.packedrefstimeout=3000 pack-refs --all --prune
+'
+
+test_expect_success SYMLINKS 'pack symlinked packed-refs' '
+ # First make sure that symlinking works when reading:
+ git update-ref refs/heads/lossy refs/heads/main &&
+ git for-each-ref >all-refs-before &&
+ mv .git/packed-refs .git/my-deviant-packed-refs &&
+ ln -s my-deviant-packed-refs .git/packed-refs &&
+ git for-each-ref >all-refs-linked &&
+ test_cmp all-refs-before all-refs-linked &&
+ git pack-refs --all --prune &&
+ git for-each-ref >all-refs-packed &&
+ test_cmp all-refs-before all-refs-packed &&
+ test -h .git/packed-refs &&
+ test "$(test_readlink .git/packed-refs)" = "my-deviant-packed-refs"
+'
+
+# The 'packed-refs' file is stored directly in .git/. This means it is global
+# to the repository, and can only contain refs that are shared across all
+# worktrees.
+test_expect_success 'refs/worktree must not be packed' '
+ test_commit initial &&
+ test_commit wt1 &&
+ test_commit wt2 &&
+ git worktree add wt1 wt1 &&
+ git worktree add wt2 wt2 &&
+ git checkout initial &&
+ git update-ref refs/worktree/foo HEAD &&
+ git -C wt1 update-ref refs/worktree/foo HEAD &&
+ git -C wt2 update-ref refs/worktree/foo HEAD &&
+ git pack-refs --all &&
+ test_path_is_missing .git/refs/tags/wt1 &&
+ test_path_is_file .git/refs/worktree/foo &&
+ test_path_is_file .git/worktrees/wt1/refs/worktree/foo &&
+ test_path_is_file .git/worktrees/wt2/refs/worktree/foo
+'
+
+# we do not want to count on running pack-refs to
+# actually pack it, as it is perfectly reasonable to
+# skip processing a broken ref
+test_expect_success 'create packed-refs file with broken ref' '
+ test_tick && git commit --allow-empty -m one &&
+ recoverable=$(git rev-parse HEAD) &&
+ test_tick && git commit --allow-empty -m two &&
+ missing=$(git rev-parse HEAD) &&
+ rm -f .git/refs/heads/main &&
+ cat >.git/packed-refs <<-EOF &&
+ $missing refs/heads/main
+ $recoverable refs/heads/other
+ EOF
+ echo $missing >expect &&
+ git rev-parse refs/heads/main >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'pack-refs does not silently delete broken packed ref' '
+ git pack-refs --all --prune &&
+ git rev-parse refs/heads/main >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'pack-refs does not drop broken refs during deletion' '
+ git update-ref -d refs/heads/other &&
+ git rev-parse refs/heads/main >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'maintenance --auto unconditionally packs loose refs' '
+ git update-ref refs/heads/something HEAD &&
+ test_path_is_file .git/refs/heads/something &&
+ git rev-parse refs/heads/something >expect &&
+ git maintenance run --task=pack-refs --auto &&
+ test_path_is_missing .git/refs/heads/something &&
+ git rev-parse refs/heads/something >actual &&
+ test_cmp expect actual
+'
+
+test_done
diff --git a/t/t0610-reftable-basics.sh b/t/t0610-reftable-basics.sh
new file mode 100755
index 0000000..178791e
--- /dev/null
+++ b/t/t0610-reftable-basics.sh
@@ -0,0 +1,1032 @@
+#!/bin/sh
+#
+# Copyright (c) 2020 Google LLC
+#
+
+test_description='reftable basics'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+. ./test-lib.sh
+
+if ! test_have_prereq REFTABLE
+then
+ skip_all='skipping reftable tests; set GIT_TEST_DEFAULT_REF_FORMAT=reftable'
+ test_done
+fi
+
+INVALID_OID=$(test_oid 001)
+
+test_expect_success 'init: creates basic reftable structures' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_path_is_dir repo/.git/reftable &&
+ test_path_is_file repo/.git/reftable/tables.list &&
+ echo reftable >expect &&
+ git -C repo rev-parse --show-ref-format >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'init: sha256 object format via environment variable' '
+ test_when_finished "rm -rf repo" &&
+ GIT_DEFAULT_HASH=sha256 git init repo &&
+ cat >expect <<-EOF &&
+ sha256
+ reftable
+ EOF
+ git -C repo rev-parse --show-object-format --show-ref-format >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'init: sha256 object format via option' '
+ test_when_finished "rm -rf repo" &&
+ git init --object-format=sha256 repo &&
+ cat >expect <<-EOF &&
+ sha256
+ reftable
+ EOF
+ git -C repo rev-parse --show-object-format --show-ref-format >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'init: reinitializing reftable backend succeeds' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_commit -C repo A &&
+
+ git -C repo for-each-ref >expect &&
+ git init --ref-format=reftable repo &&
+ git -C repo for-each-ref >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'init: reinitializing files with reftable backend fails' '
+ test_when_finished "rm -rf repo" &&
+ git init --ref-format=files repo &&
+ test_commit -C repo file &&
+
+ cp repo/.git/HEAD expect &&
+ test_must_fail git init --ref-format=reftable repo &&
+ test_cmp expect repo/.git/HEAD
+'
+
+test_expect_success 'init: reinitializing reftable with files backend fails' '
+ test_when_finished "rm -rf repo" &&
+ git init --ref-format=reftable repo &&
+ test_commit -C repo file &&
+
+ cp repo/.git/HEAD expect &&
+ test_must_fail git init --ref-format=files repo &&
+ test_cmp expect repo/.git/HEAD
+'
+
+test_expect_perms () {
+ local perms="$1"
+ local file="$2"
+ local actual="$(ls -l "$file")" &&
+
+ case "$actual" in
+ $perms*)
+ : happy
+ ;;
+ *)
+ echo "$(basename $2) is not $perms but $actual"
+ false
+ ;;
+ esac
+}
+
+test_expect_reftable_perms () {
+ local umask="$1"
+ local shared="$2"
+ local expect="$3"
+
+ test_expect_success POSIXPERM "init: honors --shared=$shared with umask $umask" '
+ test_when_finished "rm -rf repo" &&
+ (
+ umask $umask &&
+ git init --shared=$shared repo
+ ) &&
+ test_expect_perms "$expect" repo/.git/reftable/tables.list &&
+ for table in repo/.git/reftable/*.ref
+ do
+ test_expect_perms "$expect" "$table" ||
+ return 1
+ done
+ '
+
+ test_expect_success POSIXPERM "pack-refs: honors --shared=$shared with umask $umask" '
+ test_when_finished "rm -rf repo" &&
+ (
+ umask $umask &&
+ git init --shared=$shared repo &&
+ test_commit -C repo A &&
+ test_line_count = 2 repo/.git/reftable/tables.list &&
+ git -C repo pack-refs
+ ) &&
+ test_expect_perms "$expect" repo/.git/reftable/tables.list &&
+ for table in repo/.git/reftable/*.ref
+ do
+ test_expect_perms "$expect" "$table" ||
+ return 1
+ done
+ '
+}
+
+test_expect_reftable_perms 002 umask "-rw-rw-r--"
+test_expect_reftable_perms 022 umask "-rw-r--r--"
+test_expect_reftable_perms 027 umask "-rw-r-----"
+
+test_expect_reftable_perms 002 group "-rw-rw-r--"
+test_expect_reftable_perms 022 group "-rw-rw-r--"
+test_expect_reftable_perms 027 group "-rw-rw----"
+
+test_expect_reftable_perms 002 world "-rw-rw-r--"
+test_expect_reftable_perms 022 world "-rw-rw-r--"
+test_expect_reftable_perms 027 world "-rw-rw-r--"
+
+test_expect_success 'clone: can clone reftable repository' '
+ test_when_finished "rm -rf repo clone" &&
+ git init repo &&
+ test_commit -C repo message1 file1 &&
+
+ git clone repo cloned &&
+ echo reftable >expect &&
+ git -C cloned rev-parse --show-ref-format >actual &&
+ test_cmp expect actual &&
+ test_path_is_file cloned/file1
+'
+
+test_expect_success 'clone: can clone reffiles into reftable repository' '
+ test_when_finished "rm -rf reffiles reftable" &&
+ git init --ref-format=files reffiles &&
+ test_commit -C reffiles A &&
+ git clone --ref-format=reftable ./reffiles reftable &&
+
+ git -C reffiles rev-parse HEAD >expect &&
+ git -C reftable rev-parse HEAD >actual &&
+ test_cmp expect actual &&
+
+ git -C reftable rev-parse --show-ref-format >actual &&
+ echo reftable >expect &&
+ test_cmp expect actual &&
+
+ git -C reffiles rev-parse --show-ref-format >actual &&
+ echo files >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'clone: can clone reftable into reffiles repository' '
+ test_when_finished "rm -rf reffiles reftable" &&
+ git init --ref-format=reftable reftable &&
+ test_commit -C reftable A &&
+ git clone --ref-format=files ./reftable reffiles &&
+
+ git -C reftable rev-parse HEAD >expect &&
+ git -C reffiles rev-parse HEAD >actual &&
+ test_cmp expect actual &&
+
+ git -C reftable rev-parse --show-ref-format >actual &&
+ echo reftable >expect &&
+ test_cmp expect actual &&
+
+ git -C reffiles rev-parse --show-ref-format >actual &&
+ echo files >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'ref transaction: corrupted tables cause failure' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit file1 &&
+ for f in .git/reftable/*.ref
+ do
+ : >"$f" || return 1
+ done &&
+ test_must_fail git update-ref refs/heads/main HEAD
+ )
+'
+
+test_expect_success 'ref transaction: corrupted tables.list cause failure' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit file1 &&
+ echo garbage >.git/reftable/tables.list &&
+ test_must_fail git update-ref refs/heads/main HEAD
+ )
+'
+
+test_expect_success 'ref transaction: refuses to write ref causing F/D conflict' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_commit -C repo file &&
+ test_must_fail git -C repo update-ref refs/heads/main/forbidden
+'
+
+test_expect_success 'ref transaction: deleting ref with invalid name fails' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_commit -C repo file &&
+ test_must_fail git -C repo update-ref -d ../../my-private-file
+'
+
+test_expect_success 'ref transaction: can skip object ID verification' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_must_fail test-tool -C repo ref-store main update-ref msg refs/heads/branch $INVALID_OID $ZERO_OID 0 &&
+ test-tool -C repo ref-store main update-ref msg refs/heads/branch $INVALID_OID $ZERO_OID REF_SKIP_OID_VERIFICATION
+'
+
+test_expect_success 'ref transaction: updating same ref multiple times fails' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_commit -C repo A &&
+ cat >updates <<-EOF &&
+ update refs/heads/main $A
+ update refs/heads/main $A
+ EOF
+ cat >expect <<-EOF &&
+ fatal: multiple updates for ref ${SQ}refs/heads/main${SQ} not allowed
+ EOF
+ test_must_fail git -C repo update-ref --stdin <updates 2>err &&
+ test_cmp expect err
+'
+
+test_expect_success 'ref transaction: can delete symbolic self-reference with git-symbolic-ref(1)' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ git -C repo symbolic-ref refs/heads/self refs/heads/self &&
+ git -C repo symbolic-ref -d refs/heads/self
+'
+
+test_expect_success 'ref transaction: deleting symbolic self-reference without --no-deref fails' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ git -C repo symbolic-ref refs/heads/self refs/heads/self &&
+ cat >expect <<-EOF &&
+ error: multiple updates for ${SQ}refs/heads/self${SQ} (including one via symref ${SQ}refs/heads/self${SQ}) are not allowed
+ EOF
+ test_must_fail git -C repo update-ref -d refs/heads/self 2>err &&
+ test_cmp expect err
+'
+
+test_expect_success 'ref transaction: deleting symbolic self-reference with --no-deref succeeds' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ git -C repo symbolic-ref refs/heads/self refs/heads/self &&
+ git -C repo update-ref -d --no-deref refs/heads/self
+'
+
+test_expect_success 'ref transaction: creating symbolic ref fails with F/D conflict' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_commit -C repo A &&
+ cat >expect <<-EOF &&
+ error: unable to write symref for refs/heads: file/directory conflict
+ EOF
+ test_must_fail git -C repo symbolic-ref refs/heads refs/heads/foo 2>err &&
+ test_cmp expect err
+'
+
+test_expect_success 'ref transaction: ref deletion' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit file &&
+ HEAD_OID=$(git show-ref -s --verify HEAD) &&
+ cat >expect <<-EOF &&
+ $HEAD_OID refs/heads/main
+ $HEAD_OID refs/tags/file
+ EOF
+ git show-ref >actual &&
+ test_cmp expect actual &&
+
+ test_must_fail git update-ref -d refs/tags/file $INVALID_OID &&
+ git show-ref >actual &&
+ test_cmp expect actual &&
+
+ git update-ref -d refs/tags/file $HEAD_OID &&
+ echo "$HEAD_OID refs/heads/main" >expect &&
+ git show-ref >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'ref transaction: writes cause auto-compaction' '
+ test_when_finished "rm -rf repo" &&
+
+ git init repo &&
+ test_line_count = 1 repo/.git/reftable/tables.list &&
+
+ test_commit -C repo --no-tag A &&
+ test_line_count = 1 repo/.git/reftable/tables.list &&
+
+ test_commit -C repo --no-tag B &&
+ test_line_count = 1 repo/.git/reftable/tables.list
+'
+
+test_expect_success 'ref transaction: env var disables compaction' '
+ test_when_finished "rm -rf repo" &&
+
+ git init repo &&
+ test_commit -C repo A &&
+
+ start=$(wc -l <repo/.git/reftable/tables.list) &&
+ iterations=5 &&
+ expected=$((start + iterations)) &&
+
+ for i in $(test_seq $iterations)
+ do
+ GIT_TEST_REFTABLE_AUTOCOMPACTION=false \
+ git -C repo update-ref branch-$i HEAD || return 1
+ done &&
+ test_line_count = $expected repo/.git/reftable/tables.list &&
+
+ git -C repo update-ref foo HEAD &&
+ test_line_count -lt $expected repo/.git/reftable/tables.list
+'
+
+test_expect_success 'ref transaction: alternating table sizes are compacted' '
+ test_when_finished "rm -rf repo" &&
+
+ git init repo &&
+ test_commit -C repo A &&
+ for i in $(test_seq 5)
+ do
+ git -C repo branch -f foo &&
+ git -C repo branch -d foo || return 1
+ done &&
+ test_line_count = 2 repo/.git/reftable/tables.list
+'
+
+check_fsync_events () {
+ local trace="$1" &&
+ shift &&
+
+ cat >expect &&
+ sed -n \
+ -e '/^{"event":"counter",.*"category":"fsync",/ {
+ s/.*"category":"fsync",//;
+ s/}$//;
+ p;
+ }' \
+ <"$trace" >actual &&
+ test_cmp expect actual
+}
+
+test_expect_success 'ref transaction: writes are synced' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_commit -C repo initial &&
+
+ GIT_TRACE2_EVENT="$(pwd)/trace2.txt" \
+ GIT_TEST_FSYNC=true \
+ git -C repo -c core.fsync=reference \
+ -c core.fsyncMethod=fsync update-ref refs/heads/branch HEAD &&
+ check_fsync_events trace2.txt <<-EOF
+ "name":"hardware-flush","count":4
+ EOF
+'
+
+test_expect_success 'ref transaction: empty transaction in empty repo' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_commit -C repo --no-tag A &&
+ git -C repo update-ref -d refs/heads/main &&
+ test-tool -C repo ref-store main delete-refs REF_NO_DEREF msg HEAD &&
+ git -C repo update-ref --stdin <<-EOF
+ prepare
+ commit
+ EOF
+'
+
+test_expect_success 'ref transaction: fails gracefully when auto compaction fails' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+
+ test_commit A &&
+ for i in $(test_seq 10)
+ do
+ git branch branch-$i &&
+ for table in .git/reftable/*.ref
+ do
+ touch "$table.lock" || exit 1
+ done ||
+ exit 1
+ done &&
+ test_line_count = 10 .git/reftable/tables.list
+ )
+'
+
+test_expect_success 'pack-refs: compacts tables' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+
+ test_commit -C repo A &&
+ ls -1 repo/.git/reftable >table-files &&
+ test_line_count = 3 table-files &&
+ test_line_count = 2 repo/.git/reftable/tables.list &&
+
+ git -C repo pack-refs &&
+ ls -1 repo/.git/reftable >table-files &&
+ test_line_count = 2 table-files &&
+ test_line_count = 1 repo/.git/reftable/tables.list
+'
+
+test_expect_success 'pack-refs: compaction raises locking errors' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_commit -C repo A &&
+ touch repo/.git/reftable/tables.list.lock &&
+ cat >expect <<-EOF &&
+ error: unable to compact stack: data is locked
+ EOF
+ test_must_fail git -C repo pack-refs 2>err &&
+ test_cmp expect err
+'
+
+for command in pack-refs gc "maintenance run --task=pack-refs"
+do
+test_expect_success "$command: auto compaction" '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+
+ test_commit A &&
+
+ # We need a bit of setup to ensure that git-gc(1) actually
+ # triggers, and that it does not write anything to the refdb.
+ git config gc.auto 1 &&
+ git config gc.autoDetach 0 &&
+ git config gc.reflogExpire never &&
+ git config gc.reflogExpireUnreachable never &&
+ test_oid blob17_1 | git hash-object -w --stdin &&
+
+ # The tables should have been auto-compacted, and thus auto
+ # compaction should not have to do anything.
+ ls -1 .git/reftable >tables-expect &&
+ test_line_count = 3 tables-expect &&
+ git $command --auto &&
+ ls -1 .git/reftable >tables-actual &&
+ test_cmp tables-expect tables-actual &&
+
+ test_oid blob17_2 | git hash-object -w --stdin &&
+
+ # Lock all tables write some refs. Auto-compaction will be
+ # unable to compact tables and thus fails gracefully, leaving
+ # the stack in a sub-optimal state.
+ ls .git/reftable/*.ref |
+ while read table
+ do
+ touch "$table.lock" || exit 1
+ done &&
+ git branch B &&
+ git branch C &&
+ rm .git/reftable/*.lock &&
+ test_line_count = 4 .git/reftable/tables.list &&
+
+ git $command --auto &&
+ test_line_count = 1 .git/reftable/tables.list
+ )
+'
+done
+
+test_expect_success 'pack-refs: prunes stale tables' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ touch repo/.git/reftable/stale-table.ref &&
+ git -C repo pack-refs &&
+ test_path_is_missing repo/.git/reftable/stable-ref.ref
+'
+
+test_expect_success 'pack-refs: does not prune non-table files' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ touch repo/.git/reftable/garbage &&
+ git -C repo pack-refs &&
+ test_path_is_file repo/.git/reftable/garbage
+'
+
+test_expect_success 'packed-refs: writes are synced' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_commit -C repo initial &&
+ test_line_count = 2 table-files &&
+
+ : >trace2.txt &&
+ GIT_TRACE2_EVENT="$(pwd)/trace2.txt" \
+ GIT_TEST_FSYNC=true \
+ git -C repo -c core.fsync=reference \
+ -c core.fsyncMethod=fsync pack-refs &&
+ check_fsync_events trace2.txt <<-EOF
+ "name":"hardware-flush","count":2
+ EOF
+'
+
+test_expect_success 'ref iterator: bogus names are flagged' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit --no-tag file &&
+ test-tool ref-store main update-ref msg "refs/heads/bogus..name" $(git rev-parse HEAD) $ZERO_OID REF_SKIP_REFNAME_VERIFICATION &&
+
+ cat >expect <<-EOF &&
+ $ZERO_OID refs/heads/bogus..name 0xc
+ $(git rev-parse HEAD) refs/heads/main 0x0
+ EOF
+ test-tool ref-store main for-each-ref "" >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'ref iterator: missing object IDs are not flagged' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test-tool ref-store main update-ref msg "refs/heads/broken-hash" $INVALID_OID $ZERO_OID REF_SKIP_OID_VERIFICATION &&
+
+ cat >expect <<-EOF &&
+ $INVALID_OID refs/heads/broken-hash 0x0
+ EOF
+ test-tool ref-store main for-each-ref "" >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'basic: commit and list refs' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_commit -C repo file &&
+ test_write_lines refs/heads/main refs/tags/file >expect &&
+ git -C repo for-each-ref --format="%(refname)" >actual &&
+ test_cmp actual expect
+'
+
+test_expect_success 'basic: can write large commit message' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ perl -e "
+ print \"this is a long commit message\" x 50000
+ " >commit-msg &&
+ git -C repo commit --allow-empty --file=../commit-msg
+'
+
+test_expect_success 'basic: show-ref fails with empty repository' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_must_fail git -C repo show-ref >actual &&
+ test_must_be_empty actual
+'
+
+test_expect_success 'basic: can check out unborn branch' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ git -C repo checkout -b main
+'
+
+test_expect_success 'basic: peeled tags are stored' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_commit -C repo file &&
+ git -C repo tag -m "annotated tag" test_tag HEAD &&
+ for ref in refs/heads/main refs/tags/file refs/tags/test_tag refs/tags/test_tag^{}
+ do
+ echo "$(git -C repo rev-parse "$ref") $ref" || return 1
+ done >expect &&
+ git -C repo show-ref -d >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'basic: for-each-ref can print symrefs' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit file &&
+ git branch &&
+ git symbolic-ref refs/heads/sym refs/heads/main &&
+ cat >expected <<-EOF &&
+ refs/heads/main
+ EOF
+ git for-each-ref --format="%(symref)" refs/heads/sym >actual &&
+ test_cmp expected actual
+ )
+'
+
+test_expect_success 'basic: notes' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ write_script fake_editor <<-\EOF &&
+ echo "$MSG" >"$1"
+ echo "$MSG" >&2
+ EOF
+
+ test_commit 1st &&
+ test_commit 2nd &&
+ GIT_EDITOR=./fake_editor MSG=b4 git notes add &&
+ GIT_EDITOR=./fake_editor MSG=b3 git notes edit &&
+ echo b4 >expect &&
+ git notes --ref commits@{1} show >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'basic: stash' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit file &&
+ git stash list >expect &&
+ test_line_count = 0 expect &&
+
+ echo hoi >>file.t &&
+ git stash push -m stashed &&
+ git stash list >expect &&
+ test_line_count = 1 expect &&
+
+ git stash clear &&
+ git stash list >expect &&
+ test_line_count = 0 expect
+ )
+'
+
+test_expect_success 'basic: cherry-pick' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit message1 file1 &&
+ test_commit message2 file2 &&
+ git branch source &&
+ git checkout HEAD^ &&
+ test_commit message3 file3 &&
+ git cherry-pick source &&
+ test_path_is_file file2
+ )
+'
+
+test_expect_success 'basic: rebase' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit message1 file1 &&
+ test_commit message2 file2 &&
+ git branch source &&
+ git checkout HEAD^ &&
+ test_commit message3 file3 &&
+ git rebase source &&
+ test_path_is_file file2
+ )
+'
+
+test_expect_success 'reflog: can delete separate reflog entries' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+
+ test_commit file &&
+ test_commit file2 &&
+ test_commit file3 &&
+ test_commit file4 &&
+ git reflog >actual &&
+ grep file3 actual &&
+
+ git reflog delete HEAD@{1} &&
+ git reflog >actual &&
+ ! grep file3 actual
+ )
+'
+
+test_expect_success 'reflog: can switch to previous branch' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit file1 &&
+ git checkout -b branch1 &&
+ test_commit file2 &&
+ git checkout -b branch2 &&
+ git switch - &&
+ git rev-parse --symbolic-full-name HEAD >actual &&
+ echo refs/heads/branch1 >expect &&
+ test_cmp actual expect
+ )
+'
+
+test_expect_success 'reflog: copying branch writes reflog entry' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit file1 &&
+ test_commit file2 &&
+ oid=$(git rev-parse --short HEAD) &&
+ git branch src &&
+ cat >expect <<-EOF &&
+ ${oid} dst@{0}: Branch: copied refs/heads/src to refs/heads/dst
+ ${oid} dst@{1}: branch: Created from main
+ EOF
+ git branch -c src dst &&
+ git reflog dst >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'reflog: renaming branch writes reflog entry' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ git symbolic-ref HEAD refs/heads/before &&
+ test_commit file &&
+ git show-ref >expected.refs &&
+ sed s/before/after/g <expected.refs >expected &&
+ git branch -M after &&
+ git show-ref >actual &&
+ test_cmp expected actual &&
+ echo refs/heads/after >expected &&
+ git symbolic-ref HEAD >actual &&
+ test_cmp expected actual
+ )
+'
+
+test_expect_success 'reflog: can store empty logs' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+
+ test_must_fail test-tool ref-store main reflog-exists refs/heads/branch &&
+ test-tool ref-store main create-reflog refs/heads/branch &&
+ test-tool ref-store main reflog-exists refs/heads/branch &&
+ test-tool ref-store main for-each-reflog-ent-reverse refs/heads/branch >actual &&
+ test_must_be_empty actual
+ )
+'
+
+test_expect_success 'reflog: expiry empties reflog' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+
+ test_commit initial &&
+ git checkout -b branch &&
+ test_commit fileA &&
+ test_commit fileB &&
+
+ cat >expect <<-EOF &&
+ commit: fileB
+ commit: fileA
+ branch: Created from HEAD
+ EOF
+ git reflog show --format="%gs" refs/heads/branch >actual &&
+ test_cmp expect actual &&
+
+ git reflog expire branch --expire=all &&
+ git reflog show --format="%gs" refs/heads/branch >actual &&
+ test_must_be_empty actual &&
+ test-tool ref-store main reflog-exists refs/heads/branch
+ )
+'
+
+test_expect_success 'reflog: can be deleted' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit initial &&
+ test-tool ref-store main reflog-exists refs/heads/main &&
+ test-tool ref-store main delete-reflog refs/heads/main &&
+ test_must_fail test-tool ref-store main reflog-exists refs/heads/main
+ )
+'
+
+test_expect_success 'reflog: garbage collection deletes reflog entries' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+
+ for count in $(test_seq 1 10)
+ do
+ test_commit "number $count" file.t $count number-$count ||
+ return 1
+ done &&
+ git reflog refs/heads/main >actual &&
+ test_line_count = 10 actual &&
+ grep "commit (initial): number 1" actual &&
+ grep "commit: number 10" actual &&
+
+ git gc &&
+ git reflog refs/heads/main >actual &&
+ test_line_count = 0 actual
+ )
+'
+
+test_expect_success 'reflog: updates via HEAD update HEAD reflog' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit main-one &&
+ git checkout -b new-branch &&
+ test_commit new-one &&
+ test_commit new-two &&
+
+ echo new-one >expect &&
+ git log -1 --format=%s HEAD@{1} >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'worktree: adding worktree creates separate stack' '
+ test_when_finished "rm -rf repo worktree" &&
+ git init repo &&
+ test_commit -C repo A &&
+
+ git -C repo worktree add ../worktree &&
+ test_path_is_file repo/.git/worktrees/worktree/refs/heads &&
+ echo "ref: refs/heads/.invalid" >expect &&
+ test_cmp expect repo/.git/worktrees/worktree/HEAD &&
+ test_path_is_dir repo/.git/worktrees/worktree/reftable &&
+ test_path_is_file repo/.git/worktrees/worktree/reftable/tables.list
+'
+
+test_expect_success 'worktree: pack-refs in main repo packs main refs' '
+ test_when_finished "rm -rf repo worktree" &&
+ git init repo &&
+ test_commit -C repo A &&
+
+ GIT_TEST_REFTABLE_AUTOCOMPACTION=false \
+ git -C repo worktree add ../worktree &&
+ GIT_TEST_REFTABLE_AUTOCOMPACTION=false \
+ git -C worktree update-ref refs/worktree/per-worktree HEAD &&
+
+ test_line_count = 4 repo/.git/worktrees/worktree/reftable/tables.list &&
+ test_line_count = 3 repo/.git/reftable/tables.list &&
+ git -C repo pack-refs &&
+ test_line_count = 4 repo/.git/worktrees/worktree/reftable/tables.list &&
+ test_line_count = 1 repo/.git/reftable/tables.list
+'
+
+test_expect_success 'worktree: pack-refs in worktree packs worktree refs' '
+ test_when_finished "rm -rf repo worktree" &&
+ git init repo &&
+ test_commit -C repo A &&
+
+ GIT_TEST_REFTABLE_AUTOCOMPACTION=false \
+ git -C repo worktree add ../worktree &&
+ GIT_TEST_REFTABLE_AUTOCOMPACTION=false \
+ git -C worktree update-ref refs/worktree/per-worktree HEAD &&
+
+ test_line_count = 4 repo/.git/worktrees/worktree/reftable/tables.list &&
+ test_line_count = 3 repo/.git/reftable/tables.list &&
+ git -C worktree pack-refs &&
+ test_line_count = 1 repo/.git/worktrees/worktree/reftable/tables.list &&
+ test_line_count = 3 repo/.git/reftable/tables.list
+'
+
+test_expect_success 'worktree: creating shared ref updates main stack' '
+ test_when_finished "rm -rf repo worktree" &&
+ git init repo &&
+ test_commit -C repo A &&
+
+ git -C repo worktree add ../worktree &&
+ git -C repo pack-refs &&
+ git -C worktree pack-refs &&
+ test_line_count = 1 repo/.git/worktrees/worktree/reftable/tables.list &&
+ test_line_count = 1 repo/.git/reftable/tables.list &&
+
+ GIT_TEST_REFTABLE_AUTOCOMPACTION=false \
+ git -C worktree update-ref refs/heads/shared HEAD &&
+ test_line_count = 1 repo/.git/worktrees/worktree/reftable/tables.list &&
+ test_line_count = 2 repo/.git/reftable/tables.list
+'
+
+test_expect_success 'worktree: creating per-worktree ref updates worktree stack' '
+ test_when_finished "rm -rf repo worktree" &&
+ git init repo &&
+ test_commit -C repo A &&
+
+ git -C repo worktree add ../worktree &&
+ git -C repo pack-refs &&
+ git -C worktree pack-refs &&
+ test_line_count = 1 repo/.git/worktrees/worktree/reftable/tables.list &&
+ test_line_count = 1 repo/.git/reftable/tables.list &&
+
+ git -C worktree update-ref refs/bisect/per-worktree HEAD &&
+ test_line_count = 2 repo/.git/worktrees/worktree/reftable/tables.list &&
+ test_line_count = 1 repo/.git/reftable/tables.list
+'
+
+test_expect_success 'worktree: creating per-worktree ref from main repo' '
+ test_when_finished "rm -rf repo worktree" &&
+ git init repo &&
+ test_commit -C repo A &&
+
+ git -C repo worktree add ../worktree &&
+ git -C repo pack-refs &&
+ git -C worktree pack-refs &&
+ test_line_count = 1 repo/.git/worktrees/worktree/reftable/tables.list &&
+ test_line_count = 1 repo/.git/reftable/tables.list &&
+
+ git -C repo update-ref worktrees/worktree/refs/bisect/per-worktree HEAD &&
+ test_line_count = 2 repo/.git/worktrees/worktree/reftable/tables.list &&
+ test_line_count = 1 repo/.git/reftable/tables.list
+'
+
+test_expect_success 'worktree: creating per-worktree ref from second worktree' '
+ test_when_finished "rm -rf repo wt1 wt2" &&
+ git init repo &&
+ test_commit -C repo A &&
+
+ git -C repo worktree add ../wt1 &&
+ git -C repo worktree add ../wt2 &&
+ git -C repo pack-refs &&
+ git -C wt1 pack-refs &&
+ git -C wt2 pack-refs &&
+ test_line_count = 1 repo/.git/worktrees/wt1/reftable/tables.list &&
+ test_line_count = 1 repo/.git/worktrees/wt2/reftable/tables.list &&
+ test_line_count = 1 repo/.git/reftable/tables.list &&
+
+ git -C wt1 update-ref worktrees/wt2/refs/bisect/per-worktree HEAD &&
+ test_line_count = 1 repo/.git/worktrees/wt1/reftable/tables.list &&
+ test_line_count = 2 repo/.git/worktrees/wt2/reftable/tables.list &&
+ test_line_count = 1 repo/.git/reftable/tables.list
+'
+
+test_expect_success 'worktree: can create shared and per-worktree ref in one transaction' '
+ test_when_finished "rm -rf repo worktree" &&
+ git init repo &&
+ test_commit -C repo A &&
+
+ git -C repo worktree add ../worktree &&
+ git -C repo pack-refs &&
+ git -C worktree pack-refs &&
+ test_line_count = 1 repo/.git/worktrees/worktree/reftable/tables.list &&
+ test_line_count = 1 repo/.git/reftable/tables.list &&
+
+ cat >stdin <<-EOF &&
+ create worktrees/worktree/refs/bisect/per-worktree HEAD
+ create refs/branches/shared HEAD
+ EOF
+ git -C repo update-ref --stdin <stdin &&
+ test_line_count = 2 repo/.git/worktrees/worktree/reftable/tables.list &&
+ test_line_count = 2 repo/.git/reftable/tables.list
+'
+
+test_expect_success 'worktree: can access common refs' '
+ test_when_finished "rm -rf repo worktree" &&
+ git init repo &&
+ test_commit -C repo file1 &&
+ git -C repo branch branch1 &&
+ git -C repo worktree add ../worktree &&
+
+ echo refs/heads/worktree >expect &&
+ git -C worktree symbolic-ref HEAD >actual &&
+ test_cmp expect actual &&
+ git -C worktree checkout branch1
+'
+
+test_expect_success 'worktree: adds worktree with detached HEAD' '
+ test_when_finished "rm -rf repo worktree" &&
+
+ git init repo &&
+ test_commit -C repo A &&
+ git -C repo rev-parse main >expect &&
+
+ git -C repo worktree add --detach ../worktree main &&
+ git -C worktree rev-parse HEAD >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'fetch: accessing FETCH_HEAD special ref works' '
+ test_when_finished "rm -rf repo sub" &&
+
+ git init sub &&
+ test_commit -C sub two &&
+ git -C sub rev-parse HEAD >expect &&
+
+ git init repo &&
+ test_commit -C repo one &&
+ git -C repo fetch ../sub &&
+ git -C repo rev-parse FETCH_HEAD >actual &&
+ test_cmp expect actual
+'
+
+test_done
diff --git a/t/t0611-reftable-httpd.sh b/t/t0611-reftable-httpd.sh
new file mode 100755
index 0000000..5e05b9c
--- /dev/null
+++ b/t/t0611-reftable-httpd.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+test_description='reftable HTTPD tests'
+
+. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-httpd.sh
+
+start_httpd
+
+REPO="$HTTPD_DOCUMENT_ROOT_PATH/repo"
+
+test_expect_success 'serving ls-remote' '
+ git init --ref-format=reftable -b main "$REPO" &&
+ cd "$REPO" &&
+ test_commit m1 &&
+ >.git/git-daemon-export-ok &&
+ git ls-remote "http://127.0.0.1:$LIB_HTTPD_PORT/smart/repo" | cut -f 2-2 -d " " >actual &&
+ cat >expect <<-EOF &&
+ HEAD
+ refs/heads/main
+ refs/tags/m1
+ EOF
+ test_cmp actual expect
+'
+
+test_done
diff --git a/t/t1001-read-tree-m-2way.sh b/t/t1001-read-tree-m-2way.sh
index 516a611..88c524f 100755
--- a/t/t1001-read-tree-m-2way.sh
+++ b/t/t1001-read-tree-m-2way.sh
@@ -26,7 +26,7 @@ TEST_PASSES_SANITIZE_LEAK=true
. "$TEST_DIRECTORY"/lib-read-tree.sh
read_tree_twoway () {
- git read-tree -m "$1" "$2" && git ls-files --stage
+ git read-tree -m "$1" "$2" && git ls-files --stage
}
compare_change () {
@@ -370,7 +370,7 @@ test_expect_success 'read-tree supports the super-prefix' '
cat <<-EOF >expect &&
error: Updating '\''fictional/a'\'' would lose untracked files in it
EOF
- test_must_fail git --super-prefix fictional/ read-tree -u -m "$treeH" "$treeM" 2>actual &&
+ test_must_fail git read-tree --super-prefix fictional/ -u -m "$treeH" "$treeM" 2>actual &&
test_cmp expect actual
'
diff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh
index bd5313c..a7c2ed0 100755
--- a/t/t1002-read-tree-m-u-2way.sh
+++ b/t/t1002-read-tree-m-u-2way.sh
@@ -37,315 +37,312 @@ check_cache_at () {
esac
}
-test_expect_success \
- setup \
- 'echo frotz >frotz &&
- echo nitfol >nitfol &&
- echo bozbar >bozbar &&
- echo rezrov >rezrov &&
- git update-index --add nitfol bozbar rezrov &&
- treeH=$(git write-tree) &&
- echo treeH $treeH &&
- git ls-tree $treeH &&
-
- echo gnusto >bozbar &&
- git update-index --add frotz bozbar --force-remove rezrov &&
- git ls-files --stage >M.out &&
- treeM=$(git write-tree) &&
- echo treeM $treeM &&
- git ls-tree $treeM &&
- cp bozbar bozbar.M &&
- cp frotz frotz.M &&
- cp nitfol nitfol.M &&
- git diff-tree $treeH $treeM'
-
-test_expect_success \
- '1, 2, 3 - no carry forward' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- read_tree_u_must_succeed -m -u $treeH $treeM &&
- git ls-files --stage >1-3.out &&
- cmp M.out 1-3.out &&
- test_cmp bozbar.M bozbar &&
- test_cmp frotz.M frotz &&
- test_cmp nitfol.M nitfol &&
- check_cache_at bozbar clean &&
- check_cache_at frotz clean &&
- check_cache_at nitfol clean'
-
-test_expect_success \
- '4 - carry forward local addition.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo "+100644 X 0 yomin" >expected &&
- echo yomin >yomin &&
- git update-index --add yomin &&
- read_tree_u_must_succeed -m -u $treeH $treeM &&
- git ls-files --stage >4.out &&
- test_might_fail git diff -U0 --no-index M.out 4.out >4diff.out &&
- compare_change 4diff.out expected &&
- check_cache_at yomin clean &&
- test_cmp bozbar.M bozbar &&
- test_cmp frotz.M frotz &&
- test_cmp nitfol.M nitfol &&
- echo yomin >yomin1 &&
- diff yomin yomin1 &&
- rm -f yomin1'
-
-test_expect_success \
- '5 - carry forward local addition.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- read_tree_u_must_succeed -m -u $treeH &&
- echo yomin >yomin &&
- git update-index --add yomin &&
- echo yomin yomin >yomin &&
- read_tree_u_must_succeed -m -u $treeH $treeM &&
- git ls-files --stage >5.out &&
- test_might_fail git diff -U0 --no-index M.out 5.out >5diff.out &&
- compare_change 5diff.out expected &&
- check_cache_at yomin dirty &&
- test_cmp bozbar.M bozbar &&
- test_cmp frotz.M frotz &&
- test_cmp nitfol.M nitfol &&
- : dirty index should have prevented -u from checking it out. &&
- echo yomin yomin >yomin1 &&
- diff yomin yomin1 &&
- rm -f yomin1'
-
-test_expect_success \
- '6 - local addition already has the same.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo frotz >frotz &&
- git update-index --add frotz &&
- read_tree_u_must_succeed -m -u $treeH $treeM &&
- git ls-files --stage >6.out &&
- test_cmp M.out 6.out &&
- check_cache_at frotz clean &&
- test_cmp bozbar.M bozbar &&
- test_cmp frotz.M frotz &&
- test_cmp nitfol.M nitfol &&
- echo frotz >frotz1 &&
- diff frotz frotz1 &&
- rm -f frotz1'
-
-test_expect_success \
- '7 - local addition already has the same.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo frotz >frotz &&
- git update-index --add frotz &&
- echo frotz frotz >frotz &&
- read_tree_u_must_succeed -m -u $treeH $treeM &&
- git ls-files --stage >7.out &&
- test_cmp M.out 7.out &&
- check_cache_at frotz dirty &&
- test_cmp bozbar.M bozbar &&
- test_cmp nitfol.M nitfol &&
- : dirty index should have prevented -u from checking it out. &&
- echo frotz frotz >frotz1 &&
- diff frotz frotz1 &&
- rm -f frotz1'
-
-test_expect_success \
- '8 - conflicting addition.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo frotz frotz >frotz &&
- git update-index --add frotz &&
- if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
-
-test_expect_success \
- '9 - conflicting addition.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo frotz frotz >frotz &&
- git update-index --add frotz &&
- echo frotz >frotz &&
- if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
-
-test_expect_success \
- '10 - path removed.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo rezrov >rezrov &&
- git update-index --add rezrov &&
- read_tree_u_must_succeed -m -u $treeH $treeM &&
- git ls-files --stage >10.out &&
- cmp M.out 10.out &&
- test_cmp bozbar.M bozbar &&
- test_cmp frotz.M frotz &&
- test_cmp nitfol.M nitfol
+test_expect_success setup '
+ echo frotz >frotz &&
+ echo nitfol >nitfol &&
+ echo bozbar >bozbar &&
+ echo rezrov >rezrov &&
+ git update-index --add nitfol bozbar rezrov &&
+ treeH=$(git write-tree) &&
+ echo treeH $treeH &&
+ git ls-tree $treeH &&
+
+ echo gnusto >bozbar &&
+ git update-index --add frotz bozbar --force-remove rezrov &&
+ git ls-files --stage >M.out &&
+ treeM=$(git write-tree) &&
+ echo treeM $treeM &&
+ git ls-tree $treeM &&
+ cp bozbar bozbar.M &&
+ cp frotz frotz.M &&
+ cp nitfol nitfol.M &&
+ git diff-tree $treeH $treeM
'
-test_expect_success \
- '11 - dirty path removed.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo rezrov >rezrov &&
- git update-index --add rezrov &&
- echo rezrov rezrov >rezrov &&
- if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
-
-test_expect_success \
- '12 - unmatching local changes being removed.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo rezrov rezrov >rezrov &&
- git update-index --add rezrov &&
- if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
-
-test_expect_success \
- '13 - unmatching local changes being removed.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo rezrov rezrov >rezrov &&
- git update-index --add rezrov &&
- echo rezrov >rezrov &&
- if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+test_expect_success '1, 2, 3 - no carry forward' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ read_tree_u_must_succeed -m -u $treeH $treeM &&
+ git ls-files --stage >1-3.out &&
+ cmp M.out 1-3.out &&
+ test_cmp bozbar.M bozbar &&
+ test_cmp frotz.M frotz &&
+ test_cmp nitfol.M nitfol &&
+ check_cache_at bozbar clean &&
+ check_cache_at frotz clean &&
+ check_cache_at nitfol clean
+'
+
+test_expect_success '4 - carry forward local addition.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo "+100644 X 0 yomin" >expected &&
+ echo yomin >yomin &&
+ git update-index --add yomin &&
+ read_tree_u_must_succeed -m -u $treeH $treeM &&
+ git ls-files --stage >4.out &&
+ test_might_fail git diff -U0 --no-index M.out 4.out >4diff.out &&
+ compare_change 4diff.out expected &&
+ check_cache_at yomin clean &&
+ test_cmp bozbar.M bozbar &&
+ test_cmp frotz.M frotz &&
+ test_cmp nitfol.M nitfol &&
+ echo yomin >yomin1 &&
+ diff yomin yomin1 &&
+ rm -f yomin1
+'
+
+test_expect_success '5 - carry forward local addition.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ read_tree_u_must_succeed -m -u $treeH &&
+ echo yomin >yomin &&
+ git update-index --add yomin &&
+ echo yomin yomin >yomin &&
+ read_tree_u_must_succeed -m -u $treeH $treeM &&
+ git ls-files --stage >5.out &&
+ test_might_fail git diff -U0 --no-index M.out 5.out >5diff.out &&
+ compare_change 5diff.out expected &&
+ check_cache_at yomin dirty &&
+ test_cmp bozbar.M bozbar &&
+ test_cmp frotz.M frotz &&
+ test_cmp nitfol.M nitfol &&
+ : dirty index should have prevented -u from checking it out. &&
+ echo yomin yomin >yomin1 &&
+ diff yomin yomin1 &&
+ rm -f yomin1
+'
+
+test_expect_success '6 - local addition already has the same.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo frotz >frotz &&
+ git update-index --add frotz &&
+ read_tree_u_must_succeed -m -u $treeH $treeM &&
+ git ls-files --stage >6.out &&
+ test_cmp M.out 6.out &&
+ check_cache_at frotz clean &&
+ test_cmp bozbar.M bozbar &&
+ test_cmp frotz.M frotz &&
+ test_cmp nitfol.M nitfol &&
+ echo frotz >frotz1 &&
+ diff frotz frotz1 &&
+ rm -f frotz1
+'
+
+test_expect_success '7 - local addition already has the same.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo frotz >frotz &&
+ git update-index --add frotz &&
+ echo frotz frotz >frotz &&
+ read_tree_u_must_succeed -m -u $treeH $treeM &&
+ git ls-files --stage >7.out &&
+ test_cmp M.out 7.out &&
+ check_cache_at frotz dirty &&
+ test_cmp bozbar.M bozbar &&
+ test_cmp nitfol.M nitfol &&
+ : dirty index should have prevented -u from checking it out. &&
+ echo frotz frotz >frotz1 &&
+ diff frotz frotz1 &&
+ rm -f frotz1
+'
+
+test_expect_success '8 - conflicting addition.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo frotz frotz >frotz &&
+ git update-index --add frotz &&
+ ! read_tree_u_must_succeed -m -u $treeH $treeM
+'
+
+test_expect_success '9 - conflicting addition.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo frotz frotz >frotz &&
+ git update-index --add frotz &&
+ echo frotz >frotz &&
+ ! read_tree_u_must_succeed -m -u $treeH $treeM
+'
+
+test_expect_success '10 - path removed.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo rezrov >rezrov &&
+ git update-index --add rezrov &&
+ read_tree_u_must_succeed -m -u $treeH $treeM &&
+ git ls-files --stage >10.out &&
+ cmp M.out 10.out &&
+ test_cmp bozbar.M bozbar &&
+ test_cmp frotz.M frotz &&
+ test_cmp nitfol.M nitfol
+'
+
+test_expect_success '11 - dirty path removed.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo rezrov >rezrov &&
+ git update-index --add rezrov &&
+ echo rezrov rezrov >rezrov &&
+ ! read_tree_u_must_succeed -m -u $treeH $treeM
+'
+
+test_expect_success '12 - unmatching local changes being removed.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo rezrov rezrov >rezrov &&
+ git update-index --add rezrov &&
+ ! read_tree_u_must_succeed -m -u $treeH $treeM
+'
+
+test_expect_success '13 - unmatching local changes being removed.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo rezrov rezrov >rezrov &&
+ git update-index --add rezrov &&
+ echo rezrov >rezrov &&
+ ! read_tree_u_must_succeed -m -u $treeH $treeM
+'
cat >expected <<EOF
-100644 X 0 nitfol
+100644 X 0 nitfol
EOF
-test_expect_success \
- '14 - unchanged in two heads.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo nitfol nitfol >nitfol &&
- git update-index --add nitfol &&
- read_tree_u_must_succeed -m -u $treeH $treeM &&
- git ls-files --stage >14.out &&
- test_must_fail git diff -U0 --no-index M.out 14.out >14diff.out &&
- compare_change 14diff.out expected &&
- test_cmp bozbar.M bozbar &&
- test_cmp frotz.M frotz &&
- check_cache_at nitfol clean &&
- echo nitfol nitfol >nitfol1 &&
- diff nitfol nitfol1 &&
- rm -f nitfol1'
-
-test_expect_success \
- '15 - unchanged in two heads.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo nitfol nitfol >nitfol &&
- git update-index --add nitfol &&
- echo nitfol nitfol nitfol >nitfol &&
- read_tree_u_must_succeed -m -u $treeH $treeM &&
- git ls-files --stage >15.out &&
- test_must_fail git diff -U0 --no-index M.out 15.out >15diff.out &&
- compare_change 15diff.out expected &&
- check_cache_at nitfol dirty &&
- test_cmp bozbar.M bozbar &&
- test_cmp frotz.M frotz &&
- echo nitfol nitfol nitfol >nitfol1 &&
- diff nitfol nitfol1 &&
- rm -f nitfol1'
-
-test_expect_success \
- '16 - conflicting local change.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo bozbar bozbar >bozbar &&
- git update-index --add bozbar &&
- if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
-
-test_expect_success \
- '17 - conflicting local change.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo bozbar bozbar >bozbar &&
- git update-index --add bozbar &&
- echo bozbar bozbar bozbar >bozbar &&
- if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
-
-test_expect_success \
- '18 - local change already having a good result.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo gnusto >bozbar &&
- git update-index --add bozbar &&
- read_tree_u_must_succeed -m -u $treeH $treeM &&
- git ls-files --stage >18.out &&
- test_cmp M.out 18.out &&
- check_cache_at bozbar clean &&
- test_cmp bozbar.M bozbar &&
- test_cmp frotz.M frotz &&
- test_cmp nitfol.M nitfol
+test_expect_success '14 - unchanged in two heads.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo nitfol nitfol >nitfol &&
+ git update-index --add nitfol &&
+ read_tree_u_must_succeed -m -u $treeH $treeM &&
+ git ls-files --stage >14.out &&
+ test_must_fail git diff -U0 --no-index M.out 14.out >14diff.out &&
+ compare_change 14diff.out expected &&
+ test_cmp bozbar.M bozbar &&
+ test_cmp frotz.M frotz &&
+ check_cache_at nitfol clean &&
+ echo nitfol nitfol >nitfol1 &&
+ diff nitfol nitfol1 &&
+ rm -f nitfol1
'
-test_expect_success \
- '19 - local change already having a good result, further modified.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo gnusto >bozbar &&
- git update-index --add bozbar &&
- echo gnusto gnusto >bozbar &&
- read_tree_u_must_succeed -m -u $treeH $treeM &&
- git ls-files --stage >19.out &&
- test_cmp M.out 19.out &&
- check_cache_at bozbar dirty &&
- test_cmp frotz.M frotz &&
- test_cmp nitfol.M nitfol &&
- echo gnusto gnusto >bozbar1 &&
- diff bozbar bozbar1 &&
- rm -f bozbar1'
-
-test_expect_success \
- '20 - no local change, use new tree.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo bozbar >bozbar &&
- git update-index --add bozbar &&
- read_tree_u_must_succeed -m -u $treeH $treeM &&
- git ls-files --stage >20.out &&
- test_cmp M.out 20.out &&
- check_cache_at bozbar clean &&
- test_cmp bozbar.M bozbar &&
- test_cmp frotz.M frotz &&
- test_cmp nitfol.M nitfol
+test_expect_success '15 - unchanged in two heads.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo nitfol nitfol >nitfol &&
+ git update-index --add nitfol &&
+ echo nitfol nitfol nitfol >nitfol &&
+ read_tree_u_must_succeed -m -u $treeH $treeM &&
+ git ls-files --stage >15.out &&
+ test_must_fail git diff -U0 --no-index M.out 15.out >15diff.out &&
+ compare_change 15diff.out expected &&
+ check_cache_at nitfol dirty &&
+ test_cmp bozbar.M bozbar &&
+ test_cmp frotz.M frotz &&
+ echo nitfol nitfol nitfol >nitfol1 &&
+ diff nitfol nitfol1 &&
+ rm -f nitfol1
'
-test_expect_success \
- '21 - no local change, dirty cache.' \
- 'rm -f .git/index nitfol bozbar rezrov frotz &&
- read_tree_u_must_succeed --reset -u $treeH &&
- echo bozbar >bozbar &&
- git update-index --add bozbar &&
- echo gnusto gnusto >bozbar &&
- if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+test_expect_success '16 - conflicting local change.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo bozbar bozbar >bozbar &&
+ git update-index --add bozbar &&
+ ! read_tree_u_must_succeed -m -u $treeH $treeM
+'
+
+test_expect_success '17 - conflicting local change.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo bozbar bozbar >bozbar &&
+ git update-index --add bozbar &&
+ echo bozbar bozbar bozbar >bozbar &&
+ ! read_tree_u_must_succeed -m -u $treeH $treeM
+'
+
+test_expect_success '18 - local change already having a good result.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo gnusto >bozbar &&
+ git update-index --add bozbar &&
+ read_tree_u_must_succeed -m -u $treeH $treeM &&
+ git ls-files --stage >18.out &&
+ test_cmp M.out 18.out &&
+ check_cache_at bozbar clean &&
+ test_cmp bozbar.M bozbar &&
+ test_cmp frotz.M frotz &&
+ test_cmp nitfol.M nitfol
+'
+
+test_expect_success '19 - local change already having a good result, further modified.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo gnusto >bozbar &&
+ git update-index --add bozbar &&
+ echo gnusto gnusto >bozbar &&
+ read_tree_u_must_succeed -m -u $treeH $treeM &&
+ git ls-files --stage >19.out &&
+ test_cmp M.out 19.out &&
+ check_cache_at bozbar dirty &&
+ test_cmp frotz.M frotz &&
+ test_cmp nitfol.M nitfol &&
+ echo gnusto gnusto >bozbar1 &&
+ diff bozbar bozbar1 &&
+ rm -f bozbar1
+'
+
+test_expect_success '20 - no local change, use new tree.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo bozbar >bozbar &&
+ git update-index --add bozbar &&
+ read_tree_u_must_succeed -m -u $treeH $treeM &&
+ git ls-files --stage >20.out &&
+ test_cmp M.out 20.out &&
+ check_cache_at bozbar clean &&
+ test_cmp bozbar.M bozbar &&
+ test_cmp frotz.M frotz &&
+ test_cmp nitfol.M nitfol
+'
+
+test_expect_success '21 - no local change, dirty cache.' '
+ rm -f .git/index nitfol bozbar rezrov frotz &&
+ read_tree_u_must_succeed --reset -u $treeH &&
+ echo bozbar >bozbar &&
+ git update-index --add bozbar &&
+ echo gnusto gnusto >bozbar &&
+ ! read_tree_u_must_succeed -m -u $treeH $treeM
+'
# Also make sure we did not break DF vs DF/DF case.
-test_expect_success \
- 'DF vs DF/DF case setup.' \
- 'rm -f .git/index &&
- echo DF >DF &&
- git update-index --add DF &&
- treeDF=$(git write-tree) &&
- echo treeDF $treeDF &&
- git ls-tree $treeDF &&
-
- rm -f DF &&
- mkdir DF &&
- echo DF/DF >DF/DF &&
- git update-index --add --remove DF DF/DF &&
- treeDFDF=$(git write-tree) &&
- echo treeDFDF $treeDFDF &&
- git ls-tree $treeDFDF &&
- git ls-files --stage >DFDF.out'
-
-test_expect_success \
- 'DF vs DF/DF case test.' \
- 'rm -f .git/index &&
- rm -fr DF &&
- echo DF >DF &&
- git update-index --add DF &&
- read_tree_u_must_succeed -m -u $treeDF $treeDFDF &&
- git ls-files --stage >DFDFcheck.out &&
- test_cmp DFDF.out DFDFcheck.out &&
- check_cache_at DF/DF clean'
+test_expect_success 'DF vs DF/DF case setup.' '
+ rm -f .git/index &&
+ echo DF >DF &&
+ git update-index --add DF &&
+ treeDF=$(git write-tree) &&
+ echo treeDF $treeDF &&
+ git ls-tree $treeDF &&
+
+ rm -f DF &&
+ mkdir DF &&
+ echo DF/DF >DF/DF &&
+ git update-index --add --remove DF DF/DF &&
+ treeDFDF=$(git write-tree) &&
+ echo treeDFDF $treeDFDF &&
+ git ls-tree $treeDFDF &&
+ git ls-files --stage >DFDF.out
+'
+
+test_expect_success 'DF vs DF/DF case test.' '
+ rm -f .git/index &&
+ rm -fr DF &&
+ echo DF >DF &&
+ git update-index --add DF &&
+ read_tree_u_must_succeed -m -u $treeDF $treeDFDF &&
+ git ls-files --stage >DFDFcheck.out &&
+ test_cmp DFDF.out DFDFcheck.out &&
+ check_cache_at DF/DF clean
+'
test_done
diff --git a/t/t1005-read-tree-reset.sh b/t/t1005-read-tree-reset.sh
index 12e30d7..26be4a2 100755
--- a/t/t1005-read-tree-reset.sh
+++ b/t/t1005-read-tree-reset.sh
@@ -41,7 +41,8 @@ test_expect_success 'reset should remove remnants from a failed merge' '
git ls-files -s &&
read_tree_u_must_succeed --reset -u HEAD &&
git ls-files -s >actual &&
- ! test -f old
+ ! test -f old &&
+ test_cmp expect actual
'
test_expect_success 'two-way reset should remove remnants too' '
@@ -56,7 +57,8 @@ test_expect_success 'two-way reset should remove remnants too' '
git ls-files -s &&
read_tree_u_must_succeed --reset -u HEAD HEAD &&
git ls-files -s >actual &&
- ! test -f old
+ ! test -f old &&
+ test_cmp expect actual
'
test_expect_success 'Porcelain reset should remove remnants too' '
@@ -71,7 +73,8 @@ test_expect_success 'Porcelain reset should remove remnants too' '
git ls-files -s &&
git reset --hard &&
git ls-files -s >actual &&
- ! test -f old
+ ! test -f old &&
+ test_cmp expect actual
'
test_expect_success 'Porcelain checkout -f should remove remnants too' '
@@ -86,7 +89,8 @@ test_expect_success 'Porcelain checkout -f should remove remnants too' '
git ls-files -s &&
git checkout -f &&
git ls-files -s >actual &&
- ! test -f old
+ ! test -f old &&
+ test_cmp expect actual
'
test_expect_success 'Porcelain checkout -f HEAD should remove remnants too' '
@@ -101,7 +105,8 @@ test_expect_success 'Porcelain checkout -f HEAD should remove remnants too' '
git ls-files -s &&
git checkout -f HEAD &&
git ls-files -s >actual &&
- ! test -f old
+ ! test -f old &&
+ test_cmp expect actual
'
test_done
diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh
index dadf3b1..e12b221 100755
--- a/t/t1006-cat-file.sh
+++ b/t/t1006-cat-file.sh
@@ -6,7 +6,7 @@ test_description='git cat-file'
test_cmdmode_usage () {
test_expect_code 129 "$@" 2>err &&
- grep "^error:.*is incompatible with" err
+ grep "^error: .* cannot be used together" err
}
for switches in \
@@ -88,7 +88,9 @@ done
for opt in --buffer \
--follow-symlinks \
- --batch-all-objects
+ --batch-all-objects \
+ -z \
+ -Z
do
test_expect_success "usage: bad option combination: $opt without batch mode" '
test_incompatible_usage git cat-file $opt &&
@@ -100,85 +102,75 @@ echo_without_newline () {
printf '%s' "$*"
}
-strlen () {
- echo_without_newline "$1" | wc -c | sed -e 's/^ *//'
-}
-
-maybe_remove_timestamp () {
- if test -z "$2"; then
- echo_without_newline "$1"
- else
- echo_without_newline "$(printf '%s\n' "$1" | remove_timestamp)"
- fi
+echo_without_newline_nul () {
+ echo_without_newline "$@" | tr '\n' '\0'
}
-remove_timestamp () {
- sed -e 's/ [0-9][0-9]* [-+][0-9][0-9][0-9][0-9]$//'
+strlen () {
+ echo_without_newline "$1" | wc -c | sed -e 's/^ *//'
}
-
run_tests () {
type=$1
- sha1=$2
+ oid=$2
size=$3
content=$4
pretty_content=$5
- no_ts=$6
- batch_output="$sha1 $type $size
+ batch_output="$oid $type $size
$content"
test_expect_success "$type exists" '
- git cat-file -e $sha1
+ git cat-file -e $oid
'
test_expect_success "Type of $type is correct" '
echo $type >expect &&
- git cat-file -t $sha1 >actual &&
+ git cat-file -t $oid >actual &&
test_cmp expect actual
'
test_expect_success "Size of $type is correct" '
echo $size >expect &&
- git cat-file -s $sha1 >actual &&
+ git cat-file -s $oid >actual &&
test_cmp expect actual
'
test_expect_success "Type of $type is correct using --allow-unknown-type" '
echo $type >expect &&
- git cat-file -t --allow-unknown-type $sha1 >actual &&
+ git cat-file -t --allow-unknown-type $oid >actual &&
test_cmp expect actual
'
test_expect_success "Size of $type is correct using --allow-unknown-type" '
echo $size >expect &&
- git cat-file -s --allow-unknown-type $sha1 >actual &&
+ git cat-file -s --allow-unknown-type $oid >actual &&
test_cmp expect actual
'
test -z "$content" ||
test_expect_success "Content of $type is correct" '
- maybe_remove_timestamp "$content" $no_ts >expect &&
- maybe_remove_timestamp "$(git cat-file $type $sha1)" $no_ts >actual &&
+ echo_without_newline "$content" >expect &&
+ git cat-file $type $oid >actual &&
test_cmp expect actual
'
test_expect_success "Pretty content of $type is correct" '
- maybe_remove_timestamp "$pretty_content" $no_ts >expect &&
- maybe_remove_timestamp "$(git cat-file -p $sha1)" $no_ts >actual &&
+ echo_without_newline "$pretty_content" >expect &&
+ git cat-file -p $oid >actual &&
test_cmp expect actual
'
test -z "$content" ||
test_expect_success "--batch output of $type is correct" '
- maybe_remove_timestamp "$batch_output" $no_ts >expect &&
- maybe_remove_timestamp "$(echo $sha1 | git cat-file --batch)" $no_ts >actual &&
+ echo "$batch_output" >expect &&
+ echo $oid | git cat-file --batch >actual &&
test_cmp expect actual
'
test_expect_success "--batch-check output of $type is correct" '
- echo "$sha1 $type $size" >expect &&
- echo_without_newline $sha1 | git cat-file --batch-check >actual &&
+ echo "$oid $type $size" >expect &&
+ echo_without_newline $oid | git cat-file --batch-check >actual &&
test_cmp expect actual
'
@@ -186,35 +178,34 @@ $content"
do
test -z "$content" ||
test_expect_success "--batch-command $opt output of $type content is correct" '
- maybe_remove_timestamp "$batch_output" $no_ts >expect &&
- maybe_remove_timestamp "$(test_write_lines "contents $sha1" |
- git cat-file --batch-command $opt)" $no_ts >actual &&
+ echo "$batch_output" >expect &&
+ test_write_lines "contents $oid" | git cat-file --batch-command $opt >actual &&
test_cmp expect actual
'
test_expect_success "--batch-command $opt output of $type info is correct" '
- echo "$sha1 $type $size" >expect &&
- test_write_lines "info $sha1" |
+ echo "$oid $type $size" >expect &&
+ test_write_lines "info $oid" |
git cat-file --batch-command $opt >actual &&
test_cmp expect actual
'
done
test_expect_success "custom --batch-check format" '
- echo "$type $sha1" >expect &&
- echo $sha1 | git cat-file --batch-check="%(objecttype) %(objectname)" >actual &&
+ echo "$type $oid" >expect &&
+ echo $oid | git cat-file --batch-check="%(objecttype) %(objectname)" >actual &&
test_cmp expect actual
'
test_expect_success "custom --batch-command format" '
- echo "$type $sha1" >expect &&
- echo "info $sha1" | git cat-file --batch-command="%(objecttype) %(objectname)" >actual &&
+ echo "$type $oid" >expect &&
+ echo "info $oid" | git cat-file --batch-command="%(objecttype) %(objectname)" >actual &&
test_cmp expect actual
'
test_expect_success '--batch-check with %(rest)' '
echo "$type this is some extra content" >expect &&
- echo "$sha1 this is some extra content" |
+ echo "$oid this is some extra content" |
git cat-file --batch-check="%(objecttype) %(rest)" >actual &&
test_cmp expect actual
'
@@ -223,10 +214,9 @@ $content"
test_expect_success "--batch without type ($type)" '
{
echo "$size" &&
- maybe_remove_timestamp "$content" $no_ts
+ echo "$content"
} >expect &&
- echo $sha1 | git cat-file --batch="%(objectsize)" >actual.full &&
- maybe_remove_timestamp "$(cat actual.full)" $no_ts >actual &&
+ echo $oid | git cat-file --batch="%(objectsize)" >actual &&
test_cmp expect actual
'
@@ -234,142 +224,200 @@ $content"
test_expect_success "--batch without size ($type)" '
{
echo "$type" &&
- maybe_remove_timestamp "$content" $no_ts
+ echo "$content"
} >expect &&
- echo $sha1 | git cat-file --batch="%(objecttype)" >actual.full &&
- maybe_remove_timestamp "$(cat actual.full)" $no_ts >actual &&
+ echo $oid | git cat-file --batch="%(objecttype)" >actual &&
test_cmp expect actual
'
}
hello_content="Hello World"
hello_size=$(strlen "$hello_content")
-hello_sha1=$(echo_without_newline "$hello_content" | git hash-object --stdin)
+hello_oid=$(echo_without_newline "$hello_content" | git hash-object --stdin)
test_expect_success "setup" '
+ git config core.repositoryformatversion 1 &&
+ 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
'
-run_tests 'blob' $hello_sha1 $hello_size "$hello_content" "$hello_content"
+run_blob_tests () {
+ oid=$1
+
+ run_tests 'blob' $oid $hello_size "$hello_content" "$hello_content"
-test_expect_success '--batch-command --buffer with flush for blob info' '
- echo "$hello_sha1 blob $hello_size" >expect &&
- test_write_lines "info $hello_sha1" "flush" |
+ test_expect_success '--batch-command --buffer with flush for blob info' '
+ echo "$oid blob $hello_size" >expect &&
+ test_write_lines "info $oid" "flush" |
GIT_TEST_CAT_FILE_NO_FLUSH_ON_EXIT=1 \
git cat-file --batch-command --buffer >actual &&
test_cmp expect actual
-'
+ '
-test_expect_success '--batch-command --buffer without flush for blob info' '
+ test_expect_success '--batch-command --buffer without flush for blob info' '
touch output &&
- test_write_lines "info $hello_sha1" |
+ test_write_lines "info $oid" |
GIT_TEST_CAT_FILE_NO_FLUSH_ON_EXIT=1 \
git cat-file --batch-command --buffer >>output &&
test_must_be_empty output
-'
+ '
+}
+
+hello_compat_oid=$(git rev-parse --output-object-format=$test_compat_hash_algo $hello_oid)
+run_blob_tests $hello_oid
+run_blob_tests $hello_compat_oid
test_expect_success '--batch-check without %(rest) considers whole line' '
- echo "$hello_sha1 blob $hello_size" >expect &&
- git update-index --add --cacheinfo 100644 $hello_sha1 "white space" &&
+ echo "$hello_oid blob $hello_size" >expect &&
+ git update-index --add --cacheinfo 100644 $hello_oid "white space" &&
test_when_finished "git update-index --remove \"white space\"" &&
echo ":white space" | git cat-file --batch-check >actual &&
test_cmp expect actual
'
-tree_sha1=$(git write-tree)
+tree_oid=$(git write-tree)
+tree_compat_oid=$(git rev-parse --output-object-format=$test_compat_hash_algo $tree_oid)
tree_size=$(($(test_oid rawsz) + 13))
-tree_pretty_content="100644 blob $hello_sha1 hello"
+tree_compat_size=$(($(test_oid --hash=compat rawsz) + 13))
+tree_pretty_content="100644 blob $hello_oid hello${LF}"
+tree_compat_pretty_content="100644 blob $hello_compat_oid hello${LF}"
-run_tests 'tree' $tree_sha1 $tree_size "" "$tree_pretty_content"
+run_tests 'tree' $tree_oid $tree_size "" "$tree_pretty_content"
+run_tests 'tree' $tree_compat_oid $tree_compat_size "" "$tree_compat_pretty_content"
commit_message="Initial commit"
-commit_sha1=$(echo_without_newline "$commit_message" | git commit-tree $tree_sha1)
+commit_oid=$(echo_without_newline "$commit_message" | git commit-tree $tree_oid)
+commit_compat_oid=$(git rev-parse --output-object-format=$test_compat_hash_algo $commit_oid)
commit_size=$(($(test_oid hexsz) + 137))
-commit_content="tree $tree_sha1
-author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> 0000000000 +0000
-committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 0000000000 +0000
+commit_compat_size=$(($(test_oid --hash=compat hexsz) + 137))
+commit_content="tree $tree_oid
+author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> $GIT_AUTHOR_DATE
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
$commit_message"
-run_tests 'commit' $commit_sha1 $commit_size "$commit_content" "$commit_content" 1
+commit_compat_content="tree $tree_compat_oid
+author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> $GIT_AUTHOR_DATE
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
-tag_header_without_timestamp="object $hello_sha1
-type blob
+$commit_message"
+
+run_tests 'commit' $commit_oid $commit_size "$commit_content" "$commit_content"
+run_tests 'commit' $commit_compat_oid $commit_compat_size "$commit_compat_content" "$commit_compat_content"
+
+tag_header_without_oid="type blob
tag hellotag
tagger $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"
+tag_header_without_timestamp="object $hello_oid
+$tag_header_without_oid"
+tag_compat_header_without_timestamp="object $hello_compat_oid
+$tag_header_without_oid"
tag_description="This is a tag"
-tag_content="$tag_header_without_timestamp 0000000000 +0000
+tag_content="$tag_header_without_timestamp 0 +0000
+
+$tag_description"
+tag_compat_content="$tag_compat_header_without_timestamp 0 +0000
$tag_description"
-tag_sha1=$(echo_without_newline "$tag_content" | git hash-object -t tag --stdin -w)
+tag_oid=$(echo_without_newline "$tag_content" | git hash-object -t tag --stdin -w)
tag_size=$(strlen "$tag_content")
-run_tests 'tag' $tag_sha1 $tag_size "$tag_content" "$tag_content" 1
+tag_compat_oid=$(git rev-parse --output-object-format=$test_compat_hash_algo $tag_oid)
+tag_compat_size=$(strlen "$tag_compat_content")
-test_expect_success \
- "Reach a blob from a tag pointing to it" \
- "test '$hello_content' = \"\$(git cat-file blob $tag_sha1)\""
+run_tests 'tag' $tag_oid $tag_size "$tag_content" "$tag_content"
+run_tests 'tag' $tag_compat_oid $tag_compat_size "$tag_compat_content" "$tag_compat_content"
+
+test_expect_success "Reach a blob from a tag pointing to it" '
+ echo_without_newline "$hello_content" >expect &&
+ git cat-file blob $tag_oid >actual &&
+ test_cmp expect actual
+'
-for batch in batch batch-check batch-command
+for oid in $hello_oid $hello_compat_oid
do
- for opt in t s e p
+ for batch in batch batch-check batch-command
do
+ for opt in t s e p
+ do
test_expect_success "Passing -$opt with --$batch fails" '
- test_must_fail git cat-file --$batch -$opt $hello_sha1
+ test_must_fail git cat-file --$batch -$opt $oid
'
test_expect_success "Passing --$batch with -$opt fails" '
- test_must_fail git cat-file -$opt --$batch $hello_sha1
+ test_must_fail git cat-file -$opt --$batch $oid
'
- done
+ done
- test_expect_success "Passing <type> with --$batch fails" '
- test_must_fail git cat-file --$batch blob $hello_sha1
- '
+ test_expect_success "Passing <type> with --$batch fails" '
+ test_must_fail git cat-file --$batch blob $oid
+ '
- test_expect_success "Passing --$batch with <type> fails" '
- test_must_fail git cat-file blob --$batch $hello_sha1
- '
+ test_expect_success "Passing --$batch with <type> fails" '
+ test_must_fail git cat-file blob --$batch $oid
+ '
- test_expect_success "Passing sha1 with --$batch fails" '
- test_must_fail git cat-file --$batch $hello_sha1
- '
+ test_expect_success "Passing oid with --$batch fails" '
+ test_must_fail git cat-file --$batch $oid
+ '
+ done
done
-for opt in t s e p
+for oid in $hello_oid $hello_compat_oid
do
- test_expect_success "Passing -$opt with --follow-symlinks fails" '
- test_must_fail git cat-file --follow-symlinks -$opt $hello_sha1
+ for opt in t s e p
+ do
+ test_expect_success "Passing -$opt with --follow-symlinks fails" '
+ test_must_fail git cat-file --follow-symlinks -$opt $oid
'
+ done
done
test_expect_success "--batch-check for a non-existent named object" '
- test "foobar42 missing
-foobar84 missing" = \
- "$( ( echo foobar42 && echo_without_newline foobar84 ) | git cat-file --batch-check)"
+ cat >expect <<-EOF &&
+ foobar42 missing
+ foobar84 missing
+ EOF
+
+ printf "foobar42\nfoobar84" >in &&
+ git cat-file --batch-check <in >actual &&
+ test_cmp expect actual
'
test_expect_success "--batch-check for a non-existent hash" '
- test "0000000000000000000000000000000000000042 missing
-0000000000000000000000000000000000000084 missing" = \
- "$( ( echo 0000000000000000000000000000000000000042 &&
- echo_without_newline 0000000000000000000000000000000000000084 ) |
- git cat-file --batch-check)"
+ cat >expect <<-EOF &&
+ 0000000000000000000000000000000000000042 missing
+ 0000000000000000000000000000000000000084 missing
+ EOF
+
+ printf "0000000000000000000000000000000000000042\n0000000000000000000000000000000000000084" >in &&
+ git cat-file --batch-check <in >actual &&
+ test_cmp expect actual
'
test_expect_success "--batch for an existent and a non-existent hash" '
- test "$tag_sha1 tag $tag_size
-$tag_content
-0000000000000000000000000000000000000000 missing" = \
- "$( ( echo $tag_sha1 &&
- echo_without_newline 0000000000000000000000000000000000000000 ) |
- git cat-file --batch)"
+ cat >expect <<-EOF &&
+ $tag_oid tag $tag_size
+ $tag_content
+ 0000000000000000000000000000000000000000 missing
+ EOF
+
+ printf "$tag_oid\n0000000000000000000000000000000000000000" >in &&
+ git cat-file --batch <in >actual &&
+ test_cmp expect actual
'
test_expect_success "--batch-check for an empty line" '
- test " missing" = "$(echo | git cat-file --batch-check)"
+ cat >expect <<-EOF &&
+ missing
+ EOF
+
+ echo >in &&
+ git cat-file --batch-check <in >actual &&
+ test_cmp expect actual
'
test_expect_success 'empty --batch-check notices missing object' '
@@ -378,86 +426,179 @@ test_expect_success 'empty --batch-check notices missing object' '
test_cmp expect actual
'
-batch_input="$hello_sha1
-$commit_sha1
-$tag_sha1
+batch_tests () {
+ boid=$1
+ loid=$2
+ lsize=$3
+ coid=$4
+ csize=$5
+ ccontent=$6
+ toid=$7
+ tsize=$8
+ tcontent=$9
+
+ batch_input="$boid
+$coid
+$toid
deadbeef
"
-batch_output="$hello_sha1 blob $hello_size
-$hello_content
-$commit_sha1 commit $commit_size
-$commit_content
-$tag_sha1 tag $tag_size
-$tag_content
-deadbeef missing
- missing"
+ printf "%s\0" \
+ "$boid blob $hello_size" \
+ "$hello_content" \
+ "$coid commit $csize" \
+ "$ccontent" \
+ "$toid tag $tsize" \
+ "$tcontent" \
+ "deadbeef missing" \
+ " missing" >batch_output
+
+ test_expect_success '--batch with multiple oids gives correct format' '
+ tr "\0" "\n" <batch_output >expect &&
+ echo_without_newline "$batch_input" >in &&
+ git cat-file --batch <in >actual &&
+ test_cmp expect actual
+ '
-test_expect_success '--batch with multiple sha1s gives correct format' '
- test "$(maybe_remove_timestamp "$batch_output" 1)" = "$(maybe_remove_timestamp "$(echo_without_newline "$batch_input" | git cat-file --batch)" 1)"
-'
+ test_expect_success '--batch, -z with multiple oids gives correct format' '
+ echo_without_newline_nul "$batch_input" >in &&
+ tr "\0" "\n" <batch_output >expect &&
+ git cat-file --batch -z <in >actual &&
+ test_cmp expect actual
+ '
-batch_check_input="$hello_sha1
-$tree_sha1
-$commit_sha1
-$tag_sha1
+ test_expect_success '--batch, -Z with multiple oids gives correct format' '
+ echo_without_newline_nul "$batch_input" >in &&
+ git cat-file --batch -Z <in >actual &&
+ test_cmp batch_output actual
+ '
+
+batch_check_input="$boid
+$loid
+$coid
+$toid
deadbeef
"
-batch_check_output="$hello_sha1 blob $hello_size
-$tree_sha1 tree $tree_size
-$commit_sha1 commit $commit_size
-$tag_sha1 tag $tag_size
-deadbeef missing
- missing"
+ printf "%s\0" \
+ "$boid blob $hello_size" \
+ "$loid tree $lsize" \
+ "$coid commit $csize" \
+ "$toid tag $tsize" \
+ "deadbeef missing" \
+ " missing" >batch_check_output
+
+ test_expect_success "--batch-check with multiple oids gives correct format" '
+ tr "\0" "\n" <batch_check_output >expect &&
+ echo_without_newline "$batch_check_input" >in &&
+ git cat-file --batch-check <in >actual &&
+ test_cmp expect actual
+ '
-test_expect_success "--batch-check with multiple sha1s gives correct format" '
- test "$batch_check_output" = \
- "$(echo_without_newline "$batch_check_input" | git cat-file --batch-check)"
-'
+ test_expect_success "--batch-check, -z with multiple oids gives correct format" '
+ tr "\0" "\n" <batch_check_output >expect &&
+ echo_without_newline_nul "$batch_check_input" >in &&
+ git cat-file --batch-check -z <in >actual &&
+ test_cmp expect actual
+ '
-test_expect_success '--batch-command with multiple info calls gives correct format' '
+ test_expect_success "--batch-check, -Z with multiple oids gives correct format" '
+ echo_without_newline_nul "$batch_check_input" >in &&
+ git cat-file --batch-check -Z <in >actual &&
+ test_cmp batch_check_output actual
+ '
+
+batch_command_multiple_info="info $boid
+info $loid
+info $coid
+info $toid
+info deadbeef"
+
+ test_expect_success '--batch-command with multiple info calls gives correct format' '
cat >expect <<-EOF &&
- $hello_sha1 blob $hello_size
- $tree_sha1 tree $tree_size
- $commit_sha1 commit $commit_size
- $tag_sha1 tag $tag_size
+ $boid blob $hello_size
+ $loid tree $lsize
+ $coid commit $csize
+ $toid tag $tsize
deadbeef missing
EOF
- git cat-file --batch-command --buffer >actual <<-EOF &&
- info $hello_sha1
- info $tree_sha1
- info $commit_sha1
- info $tag_sha1
- info deadbeef
- EOF
+ echo "$batch_command_multiple_info" >in &&
+ git cat-file --batch-command --buffer <in >actual &&
- test_cmp expect actual
-'
+ test_cmp expect actual &&
-test_expect_success '--batch-command with multiple command calls gives correct format' '
- remove_timestamp >expect <<-EOF &&
- $hello_sha1 blob $hello_size
- $hello_content
- $commit_sha1 commit $commit_size
- $commit_content
- $tag_sha1 tag $tag_size
- $tag_content
- deadbeef missing
- EOF
+ echo "$batch_command_multiple_info" | tr "\n" "\0" >in &&
+ git cat-file --batch-command --buffer -z <in >actual &&
- git cat-file --batch-command --buffer >actual_raw <<-EOF &&
- contents $hello_sha1
- contents $commit_sha1
- contents $tag_sha1
- contents deadbeef
- flush
- EOF
+ test_cmp expect actual &&
+
+ echo "$batch_command_multiple_info" | tr "\n" "\0" >in &&
+ tr "\n" "\0" <expect >expect_nul &&
+ git cat-file --batch-command --buffer -Z <in >actual &&
+
+ test_cmp expect_nul actual
+ '
+
+batch_command_multiple_contents="contents $boid
+contents $coid
+contents $toid
+contents deadbeef
+flush"
+
+ test_expect_success '--batch-command with multiple command calls gives correct format' '
+ printf "%s\0" \
+ "$boid blob $hello_size" \
+ "$hello_content" \
+ "$coid commit $csize" \
+ "$ccontent" \
+ "$toid tag $tsize" \
+ "$tcontent" \
+ "deadbeef missing" >expect_nul &&
+ tr "\0" "\n" <expect_nul >expect &&
+
+ echo "$batch_command_multiple_contents" >in &&
+ git cat-file --batch-command --buffer <in >actual &&
+
+ test_cmp expect actual &&
+
+ echo "$batch_command_multiple_contents" | tr "\n" "\0" >in &&
+ git cat-file --batch-command --buffer -z <in >actual &&
+
+ test_cmp expect actual &&
+
+ echo "$batch_command_multiple_contents" | tr "\n" "\0" >in &&
+ git cat-file --batch-command --buffer -Z <in >actual &&
- remove_timestamp <actual_raw >actual &&
+ test_cmp expect_nul actual
+ '
+
+}
+
+batch_tests $hello_oid $tree_oid $tree_size $commit_oid $commit_size "$commit_content" $tag_oid $tag_size "$tag_content"
+batch_tests $hello_compat_oid $tree_compat_oid $tree_compat_size $commit_compat_oid $commit_compat_size "$commit_compat_content" $tag_compat_oid $tag_compat_size "$tag_compat_content"
+
+
+test_expect_success FUNNYNAMES 'setup with newline in input' '
+ touch -- "newline${LF}embedded" &&
+ git add -- "newline${LF}embedded" &&
+ git commit -m "file with newline embedded" &&
+ test_tick &&
+
+ printf "HEAD:newline${LF}embedded" >in
+'
+
+test_expect_success FUNNYNAMES '--batch-check, -z with newline in input' '
+ git cat-file --batch-check -z <in >actual &&
+ echo "$(git rev-parse "HEAD:newline${LF}embedded") blob 0" >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success FUNNYNAMES '--batch-check, -Z with newline in input' '
+ git cat-file --batch-check -Z <in >actual &&
+ printf "%s\0" "$(git rev-parse "HEAD:newline${LF}embedded") blob 0" >expect &&
test_cmp expect actual
'
@@ -485,7 +626,7 @@ test_expect_success 'confirm that neither loose blob is a delta' '
# we will check only that one of the two objects is a delta
# against the other, but not the order. We can do so by just
# asking for the base of both, and checking whether either
-# sha1 appears in the output.
+# oid appears in the output.
test_expect_success '%(deltabase) reports packed delta bases' '
git repack -ad &&
git cat-file --batch-check="%(deltabase)" <blobs >actual &&
@@ -499,12 +640,12 @@ test_expect_success 'setup bogus data' '
bogus_short_type="bogus" &&
bogus_short_content="bogus" &&
bogus_short_size=$(strlen "$bogus_short_content") &&
- bogus_short_sha1=$(echo_without_newline "$bogus_short_content" | git hash-object -t $bogus_short_type --literally -w --stdin) &&
+ bogus_short_oid=$(echo_without_newline "$bogus_short_content" | git hash-object -t $bogus_short_type --literally -w --stdin) &&
bogus_long_type="abcdefghijklmnopqrstuvwxyz1234679" &&
bogus_long_content="bogus" &&
bogus_long_size=$(strlen "$bogus_long_content") &&
- bogus_long_sha1=$(echo_without_newline "$bogus_long_content" | git hash-object -t $bogus_long_type --literally -w --stdin)
+ bogus_long_oid=$(echo_without_newline "$bogus_long_content" | git hash-object -t $bogus_long_type --literally -w --stdin)
'
for arg1 in '' --allow-unknown-type
@@ -524,9 +665,9 @@ do
if test "$arg1" = "--allow-unknown-type"
then
- git cat-file $arg1 $arg2 $bogus_short_sha1
+ git cat-file $arg1 $arg2 $bogus_short_oid
else
- test_must_fail git cat-file $arg1 $arg2 $bogus_short_sha1 >out 2>actual &&
+ test_must_fail git cat-file $arg1 $arg2 $bogus_short_oid >out 2>actual &&
test_must_be_empty out &&
test_cmp expect actual
fi
@@ -536,21 +677,21 @@ do
if test "$arg2" = "-p"
then
cat >expect <<-EOF
- error: header for $bogus_long_sha1 too long, exceeds 32 bytes
- fatal: Not a valid object name $bogus_long_sha1
+ error: header for $bogus_long_oid too long, exceeds 32 bytes
+ fatal: Not a valid object name $bogus_long_oid
EOF
else
cat >expect <<-EOF
- error: header for $bogus_long_sha1 too long, exceeds 32 bytes
+ error: header for $bogus_long_oid too long, exceeds 32 bytes
fatal: git cat-file: could not get object info
EOF
fi &&
if test "$arg1" = "--allow-unknown-type"
then
- git cat-file $arg1 $arg2 $bogus_short_sha1
+ git cat-file $arg1 $arg2 $bogus_short_oid
else
- test_must_fail git cat-file $arg1 $arg2 $bogus_long_sha1 >out 2>actual &&
+ test_must_fail git cat-file $arg1 $arg2 $bogus_long_oid >out 2>actual &&
test_must_be_empty out &&
test_cmp expect actual
fi
@@ -561,7 +702,8 @@ do
fatal: Not a valid object name $(test_oid deadbeef_short)
EOF
test_must_fail git cat-file $arg1 $arg2 $(test_oid deadbeef_short) >out 2>err.actual &&
- test_must_be_empty out
+ test_must_be_empty out &&
+ test_cmp expect.err err.actual
'
test_expect_success "cat-file $arg1 $arg2 error on missing full OID" '
@@ -583,28 +725,28 @@ do
done
test_expect_success '-e is OK with a broken object without --allow-unknown-type' '
- git cat-file -e $bogus_short_sha1
+ git cat-file -e $bogus_short_oid
'
test_expect_success '-e can not be combined with --allow-unknown-type' '
- test_expect_code 128 git cat-file -e --allow-unknown-type $bogus_short_sha1
+ test_expect_code 128 git cat-file -e --allow-unknown-type $bogus_short_oid
'
test_expect_success '-p cannot print a broken object even with --allow-unknown-type' '
- test_must_fail git cat-file -p $bogus_short_sha1 &&
- test_expect_code 128 git cat-file -p --allow-unknown-type $bogus_short_sha1
+ test_must_fail git cat-file -p $bogus_short_oid &&
+ test_expect_code 128 git cat-file -p --allow-unknown-type $bogus_short_oid
'
test_expect_success '<type> <hash> does not work with objects of broken types' '
cat >err.expect <<-\EOF &&
fatal: invalid object type "bogus"
EOF
- test_must_fail git cat-file $bogus_short_type $bogus_short_sha1 2>err.actual &&
+ test_must_fail git cat-file $bogus_short_type $bogus_short_oid 2>err.actual &&
test_cmp err.expect err.actual
'
test_expect_success 'broken types combined with --batch and --batch-check' '
- echo $bogus_short_sha1 >bogus-oid &&
+ echo $bogus_short_oid >bogus-oid &&
cat >err.expect <<-\EOF &&
fatal: invalid object type
@@ -626,52 +768,52 @@ test_expect_success 'the --allow-unknown-type option does not consider replaceme
cat >expect <<-EOF &&
$bogus_short_type
EOF
- git cat-file -t --allow-unknown-type $bogus_short_sha1 >actual &&
+ git cat-file -t --allow-unknown-type $bogus_short_oid >actual &&
test_cmp expect actual &&
# Create it manually, as "git replace" will die on bogus
# types.
head=$(git rev-parse --verify HEAD) &&
- test_when_finished "test-tool ref-store main delete-refs 0 msg refs/replace/$bogus_short_sha1" &&
- test-tool ref-store main update-ref msg "refs/replace/$bogus_short_sha1" $head $ZERO_OID REF_SKIP_OID_VERIFICATION &&
+ test_when_finished "test-tool ref-store main delete-refs 0 msg refs/replace/$bogus_short_oid" &&
+ test-tool ref-store main update-ref msg "refs/replace/$bogus_short_oid" $head $ZERO_OID REF_SKIP_OID_VERIFICATION &&
cat >expect <<-EOF &&
commit
EOF
- git cat-file -t --allow-unknown-type $bogus_short_sha1 >actual &&
+ git cat-file -t --allow-unknown-type $bogus_short_oid >actual &&
test_cmp expect actual
'
test_expect_success "Type of broken object is correct" '
echo $bogus_short_type >expect &&
- git cat-file -t --allow-unknown-type $bogus_short_sha1 >actual &&
+ git cat-file -t --allow-unknown-type $bogus_short_oid >actual &&
test_cmp expect actual
'
test_expect_success "Size of broken object is correct" '
echo $bogus_short_size >expect &&
- git cat-file -s --allow-unknown-type $bogus_short_sha1 >actual &&
+ git cat-file -s --allow-unknown-type $bogus_short_oid >actual &&
test_cmp expect actual
'
test_expect_success 'clean up broken object' '
- rm .git/objects/$(test_oid_to_path $bogus_short_sha1)
+ rm .git/objects/$(test_oid_to_path $bogus_short_oid)
'
test_expect_success "Type of broken object is correct when type is large" '
echo $bogus_long_type >expect &&
- git cat-file -t --allow-unknown-type $bogus_long_sha1 >actual &&
+ git cat-file -t --allow-unknown-type $bogus_long_oid >actual &&
test_cmp expect actual
'
test_expect_success "Size of large broken object is correct when type is large" '
echo $bogus_long_size >expect &&
- git cat-file -s --allow-unknown-type $bogus_long_sha1 >actual &&
+ git cat-file -s --allow-unknown-type $bogus_long_oid >actual &&
test_cmp expect actual
'
test_expect_success 'clean up broken object' '
- rm .git/objects/$(test_oid_to_path $bogus_long_sha1)
+ rm .git/objects/$(test_oid_to_path $bogus_long_oid)
'
test_expect_success 'cat-file -t and -s on corrupt loose object' '
@@ -768,7 +910,7 @@ test_expect_success 'prep for symlink tests' '
test_ln_s_add loop2 loop1 &&
git add morx dir/subdir/ind2 dir/ind1 &&
git commit -am "test" &&
- echo $hello_sha1 blob $hello_size >found
+ echo $hello_oid blob $hello_size >found
'
test_expect_success 'git cat-file --batch-check --follow-symlinks works for non-links' '
@@ -797,6 +939,13 @@ test_expect_success 'git cat-file --batch-check --follow-symlinks works for brok
test_cmp expect actual
'
+test_expect_success 'git cat-file --batch-check --follow-symlinks -Z works for broken in-repo, same-dir links' '
+ printf "HEAD:broken-same-dir-link\0" >in &&
+ printf "dangling 25\0HEAD:broken-same-dir-link\0" >expect &&
+ git cat-file --batch-check --follow-symlinks -Z <in >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'git cat-file --batch-check --follow-symlinks works for same-dir links-to-links' '
echo HEAD:link-to-link | git cat-file --batch-check --follow-symlinks >actual &&
test_cmp found actual
@@ -811,6 +960,15 @@ test_expect_success 'git cat-file --batch-check --follow-symlinks works for pare
test_cmp expect actual
'
+test_expect_success 'git cat-file --batch-check --follow-symlinks -Z works for parent-dir links' '
+ echo HEAD:dir/parent-dir-link | git cat-file --batch-check --follow-symlinks >actual &&
+ test_cmp found actual &&
+ printf "notdir 29\0HEAD:dir/parent-dir-link/nope\0" >expect &&
+ printf "HEAD:dir/parent-dir-link/nope\0" >in &&
+ git cat-file --batch-check --follow-symlinks -Z <in >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'git cat-file --batch-check --follow-symlinks works for .. links' '
echo dangling 22 >expect &&
echo HEAD:dir/link-dir/nope >>expect &&
@@ -840,7 +998,7 @@ test_expect_success 'git cat-file --batch-check --follow-symlinks works for dir/
echo HEAD:dirlink/morx >>expect &&
echo HEAD:dirlink/morx | git cat-file --batch-check --follow-symlinks >actual &&
test_cmp expect actual &&
- echo $hello_sha1 blob $hello_size >expect &&
+ echo $hello_oid blob $hello_size >expect &&
echo HEAD:dirlink/ind1 | git cat-file --batch-check --follow-symlinks >actual &&
test_cmp expect actual
'
@@ -925,6 +1083,13 @@ test_expect_success 'git cat-file --batch-check --follow-symlink breaks loops' '
test_cmp expect actual
'
+test_expect_success 'git cat-file --batch-check --follow-symlink -Z breaks loops' '
+ printf "loop 10\0HEAD:loop1\0" >expect &&
+ printf "HEAD:loop1\0" >in &&
+ git cat-file --batch-check --follow-symlinks -Z <in >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'git cat-file --batch --follow-symlink returns correct sha and mode' '
echo HEAD:morx | git cat-file --batch >expect &&
echo HEAD:morx | git cat-file --batch --follow-symlinks >actual &&
@@ -992,6 +1157,42 @@ test_expect_success 'cat-file --batch="batman" with --batch-all-objects will wor
cmp expect actual
'
+test_expect_success 'cat-file %(objectsize:disk) with --batch-all-objects' '
+ # our state has both loose and packed objects,
+ # so find both for our expected output
+ {
+ find .git/objects/?? -type f |
+ awk -F/ "{ print \$0, \$3\$4 }" |
+ while read path oid
+ do
+ size=$(test_file_size "$path") &&
+ echo "$oid $size" ||
+ return 1
+ done &&
+ rawsz=$(test_oid rawsz) &&
+ find .git/objects/pack -name "*.idx" |
+ while read idx
+ do
+ git show-index <"$idx" >idx.raw &&
+ sort -nr <idx.raw >idx.sorted &&
+ packsz=$(test_file_size "${idx%.idx}.pack") &&
+ end=$((packsz - rawsz)) &&
+ while read start oid rest
+ do
+ size=$((end - start)) &&
+ end=$start &&
+ echo "$oid $size" ||
+ return 1
+ done <idx.sorted ||
+ return 1
+ done
+ } >expect.raw &&
+ sort <expect.raw >expect &&
+ git cat-file --batch-all-objects \
+ --batch-check="%(objectname) %(objectsize:disk)" >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'set up replacement object' '
orig=$(git rev-parse HEAD) &&
git cat-file commit $orig >orig &&
diff --git a/t/t1007-hash-object.sh b/t/t1007-hash-object.sh
index ac5ad8c..64aea38 100755
--- a/t/t1007-hash-object.sh
+++ b/t/t1007-hash-object.sh
@@ -124,8 +124,8 @@ test_expect_success 'check that appropriate filter is invoke when --path is used
path0_sha=$(git hash-object --path=file0 file1) &&
test "$file0_sha" = "$path0_sha" &&
test "$file1_sha" = "$path1_sha" &&
- path1_sha=$(cat file0 | git hash-object --path=file1 --stdin) &&
- path0_sha=$(cat file1 | git hash-object --path=file0 --stdin) &&
+ path1_sha=$(git hash-object --path=file1 --stdin <file0) &&
+ path0_sha=$(git hash-object --path=file0 --stdin <file1) &&
test "$file0_sha" = "$path0_sha" &&
test "$file1_sha" = "$path1_sha"
'
@@ -154,7 +154,7 @@ test_expect_success '--path works in a subdirectory' '
test_expect_success 'check that --no-filters option works' '
nofilters_file1=$(git hash-object --no-filters file1) &&
test "$file0_sha" = "$nofilters_file1" &&
- nofilters_file1=$(cat file1 | git hash-object --stdin) &&
+ nofilters_file1=$(git hash-object --stdin <file1) &&
test "$file0_sha" = "$nofilters_file1"
'
@@ -203,23 +203,34 @@ done
test_expect_success 'too-short tree' '
echo abc >malformed-tree &&
test_must_fail git hash-object -t tree malformed-tree 2>err &&
- test_i18ngrep "too-short tree object" err
+ grep "too-short tree object" err
'
test_expect_success 'malformed mode in tree' '
- hex_sha1=$(echo foo | git hash-object --stdin -w) &&
- bin_sha1=$(echo $hex_sha1 | hex2oct) &&
- printf "9100644 \0$bin_sha1" >tree-with-malformed-mode &&
+ hex_oid=$(echo foo | git hash-object --stdin -w) &&
+ bin_oid=$(echo $hex_oid | hex2oct) &&
+ printf "9100644 \0$bin_oid" >tree-with-malformed-mode &&
test_must_fail git hash-object -t tree tree-with-malformed-mode 2>err &&
- test_i18ngrep "malformed mode in tree entry" err
+ grep "malformed mode in tree entry" err
'
test_expect_success 'empty filename in tree' '
- hex_sha1=$(echo foo | git hash-object --stdin -w) &&
- bin_sha1=$(echo $hex_sha1 | hex2oct) &&
- printf "100644 \0$bin_sha1" >tree-with-empty-filename &&
+ hex_oid=$(echo foo | git hash-object --stdin -w) &&
+ bin_oid=$(echo $hex_oid | hex2oct) &&
+ printf "100644 \0$bin_oid" >tree-with-empty-filename &&
test_must_fail git hash-object -t tree tree-with-empty-filename 2>err &&
- test_i18ngrep "empty filename in tree entry" err
+ grep "empty filename in tree entry" err
+'
+
+test_expect_success 'duplicate filename in tree' '
+ hex_oid=$(echo foo | git hash-object --stdin -w) &&
+ bin_oid=$(echo $hex_oid | hex2oct) &&
+ {
+ printf "100644 file\0$bin_oid" &&
+ printf "100644 file\0$bin_oid"
+ } >tree-with-duplicate-filename &&
+ test_must_fail git hash-object -t tree tree-with-duplicate-filename 2>err &&
+ grep "duplicateEntries" err
'
test_expect_success 'corrupt commit' '
diff --git a/t/t1010-mktree.sh b/t/t1010-mktree.sh
index 3c08194..22875ba 100755
--- a/t/t1010-mktree.sh
+++ b/t/t1010-mktree.sh
@@ -60,11 +60,11 @@ test_expect_success 'allow missing object with --missing' '
'
test_expect_success 'mktree refuses to read ls-tree -r output (1)' '
- test_must_fail git mktree <all >actual
+ test_must_fail git mktree <all
'
test_expect_success 'mktree refuses to read ls-tree -r output (2)' '
- test_must_fail git mktree <all.withsub >actual
+ test_must_fail git mktree <all.withsub
'
test_done
diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh
index 63a553d..595b24c 100755
--- a/t/t1011-read-tree-sparse-checkout.sh
+++ b/t/t1011-read-tree-sparse-checkout.sh
@@ -11,6 +11,8 @@ test_description='sparse checkout tests
A init.t
'
+TEST_CREATE_REPO_NO_TEMPLATE=1
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-read-tree.sh
@@ -53,6 +55,7 @@ test_expect_success 'read-tree without .git/info/sparse-checkout' '
'
test_expect_success 'read-tree with .git/info/sparse-checkout but disabled' '
+ mkdir .git/info &&
echo >.git/info/sparse-checkout &&
read_tree_u_must_succeed -m -u HEAD &&
git ls-files -t >result &&
diff --git a/t/t1016-compatObjectFormat.sh b/t/t1016-compatObjectFormat.sh
new file mode 100755
index 0000000..be3206a
--- /dev/null
+++ b/t/t1016-compatObjectFormat.sh
@@ -0,0 +1,281 @@
+#!/bin/sh
+#
+# Copyright (c) 2023 Eric Biederman
+#
+
+test_description='Test how well compatObjectFormat works'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-gpg.sh
+
+# All of the follow variables must be defined in the environment:
+# GIT_AUTHOR_NAME
+# GIT_AUTHOR_EMAIL
+# GIT_AUTHOR_DATE
+# GIT_COMMITTER_NAME
+# GIT_COMMITTER_EMAIL
+# GIT_COMMITTER_DATE
+#
+# The test relies on these variables being set so that the two
+# different commits in two different repositories encoded with two
+# different hash functions result in the same content in the commits.
+# This means that when the commit is translated between hash functions
+# the commit is identical to the commit in the other repository.
+
+compat_hash () {
+ case "$1" in
+ "sha1")
+ echo "sha256"
+ ;;
+ "sha256")
+ echo "sha1"
+ ;;
+ esac
+}
+
+hello_oid () {
+ case "$1" in
+ "sha1")
+ echo "$hello_sha1_oid"
+ ;;
+ "sha256")
+ echo "$hello_sha256_oid"
+ ;;
+ esac
+}
+
+tree_oid () {
+ case "$1" in
+ "sha1")
+ echo "$tree_sha1_oid"
+ ;;
+ "sha256")
+ echo "$tree_sha256_oid"
+ ;;
+ esac
+}
+
+commit_oid () {
+ case "$1" in
+ "sha1")
+ echo "$commit_sha1_oid"
+ ;;
+ "sha256")
+ echo "$commit_sha256_oid"
+ ;;
+ esac
+}
+
+commit2_oid () {
+ case "$1" in
+ "sha1")
+ echo "$commit2_sha1_oid"
+ ;;
+ "sha256")
+ echo "$commit2_sha256_oid"
+ ;;
+ esac
+}
+
+del_sigcommit () {
+ local delete="$1"
+
+ if test "$delete" = "sha256" ; then
+ local pattern="gpgsig-sha256"
+ else
+ local pattern="gpgsig"
+ fi
+ test-tool delete-gpgsig "$pattern"
+}
+
+
+del_sigtag () {
+ local storage="$1"
+ local delete="$2"
+
+ if test "$storage" = "$delete" ; then
+ local pattern="trailer"
+ elif test "$storage" = "sha256" ; then
+ local pattern="gpgsig"
+ else
+ local pattern="gpgsig-sha256"
+ fi
+ test-tool delete-gpgsig "$pattern"
+}
+
+base=$(pwd)
+for hash in sha1 sha256
+do
+ cd "$base"
+ mkdir -p repo-$hash
+ cd repo-$hash
+
+ test_expect_success "setup $hash repository" '
+ git init --object-format=$hash &&
+ git config core.repositoryformatversion 1 &&
+ git config extensions.objectformat $hash &&
+ git config extensions.compatobjectformat $(compat_hash $hash) &&
+ git config gpg.program $TEST_DIRECTORY/t1016/gpg &&
+ echo "Hellow World!" > hello &&
+ eval hello_${hash}_oid=$(git hash-object hello) &&
+ git update-index --add hello &&
+ git commit -m "Initial commit" &&
+ eval commit_${hash}_oid=$(git rev-parse HEAD) &&
+ eval tree_${hash}_oid=$(git rev-parse HEAD^{tree})
+ '
+ test_expect_success "create a $hash tagged blob" '
+ git tag --no-sign -m "This is a tag" hellotag $(hello_oid $hash) &&
+ eval hellotag_${hash}_oid=$(git rev-parse hellotag)
+ '
+ test_expect_success "create a $hash tagged tree" '
+ git tag --no-sign -m "This is a tag" treetag $(tree_oid $hash) &&
+ eval treetag_${hash}_oid=$(git rev-parse treetag)
+ '
+ test_expect_success "create a $hash tagged commit" '
+ git tag --no-sign -m "This is a tag" committag $(commit_oid $hash) &&
+ eval committag_${hash}_oid=$(git rev-parse committag)
+ '
+ test_expect_success GPG2 "create a $hash signed commit" '
+ git commit --gpg-sign --allow-empty -m "This is a signed commit" &&
+ eval signedcommit_${hash}_oid=$(git rev-parse HEAD)
+ '
+ test_expect_success GPG2 "create a $hash signed tag" '
+ git tag -s -m "This is a signed tag" signedtag HEAD &&
+ eval signedtag_${hash}_oid=$(git rev-parse signedtag)
+ '
+ test_expect_success "create a $hash branch" '
+ git checkout -b branch $(commit_oid $hash) &&
+ echo "More more more give me more!" > more &&
+ eval more_${hash}_oid=$(git hash-object more) &&
+ echo "Another and another and another" > another &&
+ eval another_${hash}_oid=$(git hash-object another) &&
+ git update-index --add more another &&
+ git commit -m "Add more files!" &&
+ eval commit2_${hash}_oid=$(git rev-parse HEAD) &&
+ eval tree2_${hash}_oid=$(git rev-parse HEAD^{tree})
+ '
+ test_expect_success GPG2 "create another $hash signed tag" '
+ git tag -s -m "This is another signed tag" signedtag2 $(commit2_oid $hash) &&
+ eval signedtag2_${hash}_oid=$(git rev-parse signedtag2)
+ '
+ test_expect_success GPG2 "merge the $hash branches together" '
+ git merge -S -m "merge some signed tags together" signedtag signedtag2 &&
+ eval signedcommit2_${hash}_oid=$(git rev-parse HEAD)
+ '
+ test_expect_success GPG2 "create additional $hash signed commits" '
+ git commit --gpg-sign --allow-empty -m "This is an additional signed commit" &&
+ git cat-file commit HEAD | del_sigcommit sha256 > "../${hash}_signedcommit3" &&
+ git cat-file commit HEAD | del_sigcommit sha1 > "../${hash}_signedcommit4" &&
+ eval signedcommit3_${hash}_oid=$(git hash-object -t commit -w ../${hash}_signedcommit3) &&
+ eval signedcommit4_${hash}_oid=$(git hash-object -t commit -w ../${hash}_signedcommit4)
+ '
+ test_expect_success GPG2 "create additional $hash signed tags" '
+ git tag -s -m "This is an additional signed tag" signedtag34 HEAD &&
+ git cat-file tag signedtag34 | del_sigtag "${hash}" sha256 > ../${hash}_signedtag3 &&
+ git cat-file tag signedtag34 | del_sigtag "${hash}" sha1 > ../${hash}_signedtag4 &&
+ eval signedtag3_${hash}_oid=$(git hash-object -t tag -w ../${hash}_signedtag3) &&
+ eval signedtag4_${hash}_oid=$(git hash-object -t tag -w ../${hash}_signedtag4)
+ '
+done
+cd "$base"
+
+compare_oids () {
+ test "$#" = 5 && { local PREREQ="$1"; shift; } || PREREQ=
+ local type="$1"
+ local name="$2"
+ local sha1_oid="$3"
+ local sha256_oid="$4"
+
+ echo ${sha1_oid} > ${name}_sha1_expected
+ echo ${sha256_oid} > ${name}_sha256_expected
+ echo ${type} > ${name}_type_expected
+
+ git --git-dir=repo-sha1/.git rev-parse --output-object-format=sha256 ${sha1_oid} > ${name}_sha1_sha256_found
+ git --git-dir=repo-sha256/.git rev-parse --output-object-format=sha1 ${sha256_oid} > ${name}_sha256_sha1_found
+ local sha1_sha256_oid="$(cat ${name}_sha1_sha256_found)"
+ local sha256_sha1_oid="$(cat ${name}_sha256_sha1_found)"
+
+ test_expect_success $PREREQ "Verify ${type} ${name}'s sha1 oid" '
+ git --git-dir=repo-sha256/.git rev-parse --output-object-format=sha1 ${sha256_oid} > ${name}_sha1 &&
+ test_cmp ${name}_sha1 ${name}_sha1_expected
+'
+
+ test_expect_success $PREREQ "Verify ${type} ${name}'s sha256 oid" '
+ git --git-dir=repo-sha1/.git rev-parse --output-object-format=sha256 ${sha1_oid} > ${name}_sha256 &&
+ test_cmp ${name}_sha256 ${name}_sha256_expected
+'
+
+ test_expect_success $PREREQ "Verify ${name}'s sha1 type" '
+ git --git-dir=repo-sha1/.git cat-file -t ${sha1_oid} > ${name}_type1 &&
+ git --git-dir=repo-sha256/.git cat-file -t ${sha256_sha1_oid} > ${name}_type2 &&
+ test_cmp ${name}_type1 ${name}_type2 &&
+ test_cmp ${name}_type1 ${name}_type_expected
+'
+
+ test_expect_success $PREREQ "Verify ${name}'s sha256 type" '
+ git --git-dir=repo-sha256/.git cat-file -t ${sha256_oid} > ${name}_type3 &&
+ git --git-dir=repo-sha1/.git cat-file -t ${sha1_sha256_oid} > ${name}_type4 &&
+ test_cmp ${name}_type3 ${name}_type4 &&
+ test_cmp ${name}_type3 ${name}_type_expected
+'
+
+ test_expect_success $PREREQ "Verify ${name}'s sha1 size" '
+ git --git-dir=repo-sha1/.git cat-file -s ${sha1_oid} > ${name}_size1 &&
+ git --git-dir=repo-sha256/.git cat-file -s ${sha256_sha1_oid} > ${name}_size2 &&
+ test_cmp ${name}_size1 ${name}_size2
+'
+
+ test_expect_success $PREREQ "Verify ${name}'s sha256 size" '
+ git --git-dir=repo-sha256/.git cat-file -s ${sha256_oid} > ${name}_size3 &&
+ git --git-dir=repo-sha1/.git cat-file -s ${sha1_sha256_oid} > ${name}_size4 &&
+ test_cmp ${name}_size3 ${name}_size4
+'
+
+ test_expect_success $PREREQ "Verify ${name}'s sha1 pretty content" '
+ git --git-dir=repo-sha1/.git cat-file -p ${sha1_oid} > ${name}_content1 &&
+ git --git-dir=repo-sha256/.git cat-file -p ${sha256_sha1_oid} > ${name}_content2 &&
+ test_cmp ${name}_content1 ${name}_content2
+'
+
+ test_expect_success $PREREQ "Verify ${name}'s sha256 pretty content" '
+ git --git-dir=repo-sha256/.git cat-file -p ${sha256_oid} > ${name}_content3 &&
+ git --git-dir=repo-sha1/.git cat-file -p ${sha1_sha256_oid} > ${name}_content4 &&
+ test_cmp ${name}_content3 ${name}_content4
+'
+
+ test_expect_success $PREREQ "Verify ${name}'s sha1 content" '
+ git --git-dir=repo-sha1/.git cat-file ${type} ${sha1_oid} > ${name}_content5 &&
+ git --git-dir=repo-sha256/.git cat-file ${type} ${sha256_sha1_oid} > ${name}_content6 &&
+ test_cmp ${name}_content5 ${name}_content6
+'
+
+ test_expect_success $PREREQ "Verify ${name}'s sha256 content" '
+ git --git-dir=repo-sha256/.git cat-file ${type} ${sha256_oid} > ${name}_content7 &&
+ git --git-dir=repo-sha1/.git cat-file ${type} ${sha1_sha256_oid} > ${name}_content8 &&
+ test_cmp ${name}_content7 ${name}_content8
+'
+
+}
+
+compare_oids 'blob' hello "$hello_sha1_oid" "$hello_sha256_oid"
+compare_oids 'tree' tree "$tree_sha1_oid" "$tree_sha256_oid"
+compare_oids 'commit' commit "$commit_sha1_oid" "$commit_sha256_oid"
+compare_oids GPG2 'commit' signedcommit "$signedcommit_sha1_oid" "$signedcommit_sha256_oid"
+compare_oids 'tag' hellotag "$hellotag_sha1_oid" "$hellotag_sha256_oid"
+compare_oids 'tag' treetag "$treetag_sha1_oid" "$treetag_sha256_oid"
+compare_oids 'tag' committag "$committag_sha1_oid" "$committag_sha256_oid"
+compare_oids GPG2 'tag' signedtag "$signedtag_sha1_oid" "$signedtag_sha256_oid"
+
+compare_oids 'blob' more "$more_sha1_oid" "$more_sha256_oid"
+compare_oids 'blob' another "$another_sha1_oid" "$another_sha256_oid"
+compare_oids 'tree' tree2 "$tree2_sha1_oid" "$tree2_sha256_oid"
+compare_oids 'commit' commit2 "$commit2_sha1_oid" "$commit2_sha256_oid"
+compare_oids GPG2 'tag' signedtag2 "$signedtag2_sha1_oid" "$signedtag2_sha256_oid"
+compare_oids GPG2 'commit' signedcommit2 "$signedcommit2_sha1_oid" "$signedcommit2_sha256_oid"
+compare_oids GPG2 'commit' signedcommit3 "$signedcommit3_sha1_oid" "$signedcommit3_sha256_oid"
+compare_oids GPG2 'commit' signedcommit4 "$signedcommit4_sha1_oid" "$signedcommit4_sha256_oid"
+compare_oids GPG2 'tag' signedtag3 "$signedtag3_sha1_oid" "$signedtag3_sha256_oid"
+compare_oids GPG2 'tag' signedtag4 "$signedtag4_sha1_oid" "$signedtag4_sha256_oid"
+
+test_done
diff --git a/t/t1016/gpg b/t/t1016/gpg
new file mode 100755
index 0000000..2601cb1
--- /dev/null
+++ b/t/t1016/gpg
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec gpg --faked-system-time "20230918T154812" "$@"
diff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh
index 9fdbb2a..45eef94 100755
--- a/t/t1020-subdirectory.sh
+++ b/t/t1020-subdirectory.sh
@@ -6,6 +6,7 @@
test_description='Try various core-level commands in subdirectory.
'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-read-tree.sh
diff --git a/t/t1022-read-tree-partial-clone.sh b/t/t1022-read-tree-partial-clone.sh
index a9953b6..cca4380 100755
--- a/t/t1022-read-tree-partial-clone.sh
+++ b/t/t1022-read-tree-partial-clone.sh
@@ -3,7 +3,7 @@
test_description='git read-tree in partial clones'
TEST_NO_CREATE_REPO=1
-
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'read-tree in partial clone prefetches in one batch' '
@@ -19,7 +19,7 @@ test_expect_success 'read-tree in partial clone prefetches in one batch' '
git -C server config uploadpack.allowfilter 1 &&
git -C server config uploadpack.allowanysha1inwant 1 &&
git clone --bare --filter=blob:none "file://$(pwd)/server" client &&
- GIT_TRACE_PACKET="$(pwd)/trace" git -C client read-tree $TREE &&
+ GIT_TRACE_PACKET="$(pwd)/trace" git -C client read-tree $TREE $TREE &&
# "done" marks the end of negotiation (once per fetch). Expect that
# only one fetch occurs.
diff --git a/t/t1050-large.sh b/t/t1050-large.sh
index 4f3aa17..c71932b 100755
--- a/t/t1050-large.sh
+++ b/t/t1050-large.sh
@@ -5,6 +5,12 @@ test_description='adding and checking out large blobs'
. ./test-lib.sh
+test_expect_success 'core.bigFileThreshold must be non-negative' '
+ test_must_fail git -c core.bigFileThreshold=-1 rev-parse >out 2>err &&
+ grep "bad numeric config value" err &&
+ test_must_be_empty out
+'
+
test_expect_success setup '
# clone does not allow us to pass core.bigfilethreshold to
# new repos, so set core.bigfilethreshold globally
diff --git a/t/t1051-large-conversion.sh b/t/t1051-large-conversion.sh
index 042b0e4..f6709c9 100755
--- a/t/t1051-large-conversion.sh
+++ b/t/t1051-large-conversion.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='test conversion filters on large files'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
set_attr() {
diff --git a/t/t1060-object-corruption.sh b/t/t1060-object-corruption.sh
index 5b8e47e..5e0f0a3 100755
--- a/t/t1060-object-corruption.sh
+++ b/t/t1060-object-corruption.sh
@@ -125,7 +125,7 @@ test_expect_success 'fetch into corrupted repo with index-pack' '
cd bit-error-cp &&
test_must_fail git -c transfer.unpackLimit=1 \
fetch ../no-bit-error 2>stderr &&
- test_i18ngrep ! -i collision stderr
+ test_grep ! -i collision stderr
)
'
@@ -139,4 +139,11 @@ test_expect_success 'internal tree objects are not "missing"' '
)
'
+test_expect_success 'partial clone of corrupted repository' '
+ test_config -C misnamed uploadpack.allowFilter true &&
+ git clone --no-local --no-checkout --filter=blob:none \
+ misnamed corrupt-partial && \
+ test_must_fail git -C corrupt-partial checkout --force
+'
+
test_done
diff --git a/t/t1090-sparse-checkout-scope.sh b/t/t1090-sparse-checkout-scope.sh
index d1833c0..3a14218 100755
--- a/t/t1090-sparse-checkout-scope.sh
+++ b/t/t1090-sparse-checkout-scope.sh
@@ -5,6 +5,7 @@ test_description='sparse checkout scope tests'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
test_expect_success 'setup' '
@@ -25,6 +26,7 @@ test_expect_success 'create feature branch' '
test_expect_success 'perform sparse checkout of main' '
git config --local --bool core.sparsecheckout true &&
+ mkdir .git/info &&
echo "!/*" >.git/info/sparse-checkout &&
echo "/a" >>.git/info/sparse-checkout &&
echo "/c" >>.git/info/sparse-checkout &&
@@ -73,7 +75,7 @@ test_expect_success 'skip-worktree on files outside sparse patterns' '
test_expect_success 'in partial clone, sparse checkout only fetches needed blobs' '
test_create_repo server &&
- git clone "file://$(pwd)/server" client &&
+ git clone --template= "file://$(pwd)/server" client &&
test_config -C server uploadpack.allowfilter 1 &&
test_config -C server uploadpack.allowanysha1inwant 1 &&
@@ -85,6 +87,7 @@ test_expect_success 'in partial clone, sparse checkout only fetches needed blobs
git -C server commit -m message &&
test_config -C client core.sparsecheckout 1 &&
+ mkdir client/.git/info &&
echo "!/*" >client/.git/info/sparse-checkout &&
echo "/a" >>client/.git/info/sparse-checkout &&
git -C client fetch --filter=blob:none origin &&
diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh
index de1ec89..ab3a105 100755
--- a/t/t1091-sparse-checkout-builtin.sh
+++ b/t/t1091-sparse-checkout-builtin.sh
@@ -47,7 +47,7 @@ test_expect_success 'setup' '
test_expect_success 'git sparse-checkout list (not sparse)' '
test_must_fail git -C repo sparse-checkout list >list 2>err &&
test_must_be_empty list &&
- test_i18ngrep "this worktree is not sparse" err
+ test_grep "this worktree is not sparse" err
'
test_expect_success 'git sparse-checkout list (not sparse)' '
@@ -55,7 +55,7 @@ test_expect_success 'git sparse-checkout list (not sparse)' '
rm repo/.git/info/sparse-checkout &&
git -C repo sparse-checkout list >list 2>err &&
test_must_be_empty list &&
- test_i18ngrep "this worktree is not sparse (sparse-checkout file may not exist)" err
+ test_grep "this worktree is not sparse (sparse-checkout file may not exist)" err
'
test_expect_success 'git sparse-checkout list (populated)' '
@@ -230,7 +230,7 @@ test_expect_success 'cone mode: match patterns' '
git -C repo config --worktree core.sparseCheckoutCone true &&
rm -rf repo/a repo/folder1 repo/folder2 &&
git -C repo read-tree -mu HEAD 2>err &&
- test_i18ngrep ! "disabling cone patterns" err &&
+ test_grep ! "disabling cone patterns" err &&
git -C repo reset --hard &&
check_files repo a folder1 folder2
'
@@ -238,9 +238,9 @@ test_expect_success 'cone mode: match patterns' '
test_expect_success 'cone mode: warn on bad pattern' '
test_when_finished mv sparse-checkout repo/.git/info/ &&
cp repo/.git/info/sparse-checkout . &&
- echo "!/deep/deeper/*" >>repo/.git/info/sparse-checkout &&
+ echo "!/deep/deeper/*/" >>repo/.git/info/sparse-checkout &&
git -C repo read-tree -mu HEAD 2>err &&
- test_i18ngrep "unrecognized negative pattern" err
+ test_grep "unrecognized negative pattern" err
'
test_expect_success 'sparse-checkout disable' '
@@ -283,7 +283,7 @@ test_expect_success 'sparse-index enabled and disabled' '
test_expect_success 'cone mode: init and set' '
git -C repo sparse-checkout init --cone &&
git -C repo config --list >config &&
- test_i18ngrep "core.sparsecheckoutcone=true" config &&
+ test_grep "core.sparsecheckoutcone=true" config &&
list_files repo >dir &&
echo a >expect &&
test_cmp expect dir &&
@@ -334,7 +334,7 @@ test_expect_success 'cone mode: set with nested folders' '
test_expect_success 'cone mode: add independent path' '
git -C repo sparse-checkout set deep/deeper1 &&
- git -C repo sparse-checkout add folder1 &&
+ git -C repo sparse-checkout add --end-of-options folder1 &&
cat >expect <<-\EOF &&
/*
!/*/
@@ -386,7 +386,7 @@ test_expect_success 'not-up-to-date does not block rest of sparsification' '
git -C repo sparse-checkout set deep/deeper1 2>err &&
- test_i18ngrep "The following paths are not up to date" err &&
+ test_grep "The following paths are not up to date" err &&
test_cmp expect repo/.git/info/sparse-checkout &&
check_files repo/deep a deeper1 deeper2 &&
check_files repo/deep/deeper1 a deepest &&
@@ -401,8 +401,8 @@ test_expect_success 'revert to old sparse-checkout on empty update' '
git add file &&
git commit -m "test" &&
git sparse-checkout set nothing 2>err &&
- test_i18ngrep ! "Sparse checkout leaves no entry on working directory" err &&
- test_i18ngrep ! ".git/index.lock" err &&
+ test_grep ! "Sparse checkout leaves no entry on working directory" err &&
+ test_grep ! ".git/index.lock" err &&
git sparse-checkout set --no-cone file
)
'
@@ -411,14 +411,14 @@ test_expect_success 'fail when lock is taken' '
test_when_finished rm -rf repo/.git/info/sparse-checkout.lock &&
touch repo/.git/info/sparse-checkout.lock &&
test_must_fail git -C repo sparse-checkout set deep 2>err &&
- test_i18ngrep "Unable to create .*\.lock" err
+ test_grep "Unable to create .*\.lock" err
'
test_expect_success '.gitignore should not warn about cone mode' '
git -C repo config --worktree core.sparseCheckoutCone true &&
echo "**/bin/*" >repo/.gitignore &&
git -C repo reset --hard 2>err &&
- test_i18ngrep ! "disabling cone patterns" err
+ test_grep ! "disabling cone patterns" err
'
test_expect_success 'sparse-checkout (init|set|disable) warns with dirty status' '
@@ -426,10 +426,10 @@ test_expect_success 'sparse-checkout (init|set|disable) warns with dirty status'
echo dirty >dirty/folder1/a &&
git -C dirty sparse-checkout init --no-cone 2>err &&
- test_i18ngrep "warning.*The following paths are not up to date" err &&
+ test_grep "warning.*The following paths are not up to date" err &&
git -C dirty sparse-checkout set /folder2/* /deep/deeper1/* 2>err &&
- test_i18ngrep "warning.*The following paths are not up to date" err &&
+ test_grep "warning.*The following paths are not up to date" err &&
test_path_is_file dirty/folder1/a &&
git -C dirty sparse-checkout disable 2>err &&
@@ -453,14 +453,14 @@ test_expect_success 'sparse-checkout (init|set|disable) warns with unmerged stat
git -C unmerged update-index --index-info <input &&
git -C unmerged sparse-checkout init --no-cone 2>err &&
- test_i18ngrep "warning.*The following paths are unmerged" err &&
+ test_grep "warning.*The following paths are unmerged" err &&
git -C unmerged sparse-checkout set /folder2/* /deep/deeper1/* 2>err &&
- test_i18ngrep "warning.*The following paths are unmerged" err &&
+ test_grep "warning.*The following paths are unmerged" err &&
test_path_is_file dirty/folder1/a &&
git -C unmerged sparse-checkout disable 2>err &&
- test_i18ngrep "warning.*The following paths are unmerged" err &&
+ test_grep "warning.*The following paths are unmerged" err &&
git -C unmerged reset --hard &&
git -C unmerged sparse-checkout init --no-cone &&
@@ -480,24 +480,24 @@ test_expect_failure 'sparse-checkout reapply' '
git -C tweak update-index --index-info <input &&
git -C tweak sparse-checkout init --cone 2>err &&
- test_i18ngrep "warning.*The following paths are not up to date" err &&
- test_i18ngrep "warning.*The following paths are unmerged" err &&
+ test_grep "warning.*The following paths are not up to date" err &&
+ test_grep "warning.*The following paths are unmerged" err &&
git -C tweak sparse-checkout set folder2 deep/deeper1 2>err &&
- test_i18ngrep "warning.*The following paths are not up to date" err &&
- test_i18ngrep "warning.*The following paths are unmerged" err &&
+ test_grep "warning.*The following paths are not up to date" err &&
+ test_grep "warning.*The following paths are unmerged" err &&
git -C tweak sparse-checkout reapply 2>err &&
- test_i18ngrep "warning.*The following paths are not up to date" err &&
+ test_grep "warning.*The following paths are not up to date" err &&
test_path_is_file tweak/deep/deeper2/a &&
- test_i18ngrep "warning.*The following paths are unmerged" err &&
+ test_grep "warning.*The following paths are unmerged" err &&
test_path_is_file tweak/folder1/a &&
git -C tweak checkout HEAD deep/deeper2/a &&
git -C tweak sparse-checkout reapply 2>err &&
- test_i18ngrep ! "warning.*The following paths are not up to date" err &&
+ test_grep ! "warning.*The following paths are not up to date" err &&
test_path_is_missing tweak/deep/deeper2/a &&
- test_i18ngrep "warning.*The following paths are unmerged" err &&
+ test_grep "warning.*The following paths are unmerged" err &&
test_path_is_file tweak/folder1/a &&
# NEEDSWORK: We are asking to update a file outside of the
@@ -555,21 +555,33 @@ test_expect_success 'cone mode: set with core.ignoreCase=true' '
check_files repo a folder1
'
-test_expect_success 'interaction with submodules' '
+test_expect_success 'setup submodules' '
git clone repo super &&
(
cd super &&
mkdir modules &&
- git submodule add ../repo modules/child &&
+ git -c protocol.file.allow=always \
+ submodule add ../repo modules/child &&
git add . &&
git commit -m "add submodule" &&
git sparse-checkout init --cone &&
git sparse-checkout set folder1
- ) &&
+ )
+'
+
+test_expect_success 'interaction with submodules' '
check_files super a folder1 modules &&
check_files super/modules/child a deep folder1 folder2
'
+test_expect_success 'check-rules interaction with submodules' '
+ git -C super ls-tree --name-only -r HEAD >all-files &&
+ git -C super sparse-checkout check-rules >check-rules-matches <all-files &&
+
+ test_grep ! "modules/" check-rules-matches &&
+ test_grep "folder1/" check-rules-matches
+'
+
test_expect_success 'different sparse-checkouts with worktrees' '
git -C repo sparse-checkout set --cone deep folder1 &&
git -C repo worktree add --detach ../worktree &&
@@ -604,7 +616,7 @@ check_read_tree_errors () {
then
test_must_be_empty err
else
- test_i18ngrep "$ERRORS" err
+ test_grep "$ERRORS" err
fi &&
check_files $REPO $FILES
}
@@ -666,6 +678,15 @@ test_expect_success 'pattern-checks: starting "*"' '
check_read_tree_errors repo "a deep" "disabling cone pattern matching"
'
+test_expect_success 'pattern-checks: non directory pattern' '
+ cat >repo/.git/info/sparse-checkout <<-\EOF &&
+ /deep/deeper1/a
+ EOF
+ check_read_tree_errors repo deep "disabling cone pattern matching" &&
+ check_files repo/deep deeper1 &&
+ check_files repo/deep/deeper1 a
+'
+
test_expect_success 'pattern-checks: contained glob characters' '
for c in "[a]" "\\" "?" "*"
do
@@ -865,6 +886,12 @@ test_expect_success 'by default, cone mode will error out when passed files' '
grep ".gitignore.*is not a directory" error
'
+test_expect_success 'error on mistyped command line options' '
+ test_must_fail git -C repo sparse-checkout add --sikp-checks .gitignore 2>error &&
+
+ grep "unknown option.*sikp-checks" error
+'
+
test_expect_success 'by default, non-cone mode will warn on individual files' '
git -C repo sparse-checkout reapply --no-cone &&
git -C repo sparse-checkout add .gitignore 2>warning &&
@@ -872,4 +899,156 @@ test_expect_success 'by default, non-cone mode will warn on individual files' '
grep "pass a leading slash before paths.*if you want a single file" warning
'
+test_expect_success 'setup bare repo' '
+ git clone --bare "file://$(pwd)/repo" bare
+'
+test_expect_success 'list fails outside work tree' '
+ test_must_fail git -C bare sparse-checkout list 2>err &&
+ test_grep "this operation must be run in a work tree" err
+'
+
+test_expect_success 'add fails outside work tree' '
+ test_must_fail git -C bare sparse-checkout add deeper 2>err &&
+ test_grep "this operation must be run in a work tree" err
+'
+
+test_expect_success 'set fails outside work tree' '
+ test_must_fail git -C bare sparse-checkout set deeper 2>err &&
+ test_grep "this operation must be run in a work tree" err
+'
+
+test_expect_success 'init fails outside work tree' '
+ test_must_fail git -C bare sparse-checkout init 2>err &&
+ test_grep "this operation must be run in a work tree" err
+'
+
+test_expect_success 'reapply fails outside work tree' '
+ test_must_fail git -C bare sparse-checkout reapply 2>err &&
+ test_grep "this operation must be run in a work tree" err
+'
+
+test_expect_success 'disable fails outside work tree' '
+ test_must_fail git -C bare sparse-checkout disable 2>err &&
+ test_grep "this operation must be run in a work tree" err
+'
+
+test_expect_success 'setup clean' '
+ git -C repo clean -fdx
+'
+
+test_expect_success 'check-rules cone mode' '
+ cat >rules <<-\EOF &&
+ folder1
+ deep/deeper1/deepest
+ EOF
+
+ git -C bare ls-tree -r --name-only HEAD >all-files &&
+ git -C bare sparse-checkout check-rules --cone \
+ --rules-file ../rules >check-rules-file <all-files &&
+
+ git -C repo sparse-checkout set --cone --stdin <rules&&
+ git -C repo ls-files -t >out &&
+ sed -n "/^S /!s/^. //p" out >ls-files &&
+
+ git -C repo sparse-checkout check-rules >check-rules-default <all-files &&
+
+ test_grep "deep/deeper1/deepest/a" check-rules-file &&
+ test_grep ! "deep/deeper2" check-rules-file &&
+
+ test_cmp check-rules-file ls-files &&
+ test_cmp check-rules-file check-rules-default
+'
+
+test_expect_success 'check-rules non-cone mode' '
+ cat >rules <<-\EOF &&
+ deep/deeper1/deepest/a
+ EOF
+
+ git -C bare ls-tree -r --name-only HEAD >all-files &&
+ git -C bare sparse-checkout check-rules --no-cone --rules-file ../rules\
+ >check-rules-file <all-files &&
+
+ git -C repo sparse-checkout set --no-cone --stdin <rules &&
+ git -C repo ls-files -t >out &&
+ sed -n "/^S /!s/^. //p" out >ls-files &&
+
+ git -C repo sparse-checkout check-rules >check-rules-default <all-files &&
+
+ cat >expect <<-\EOF &&
+ deep/deeper1/deepest/a
+ EOF
+
+ test_cmp expect check-rules-file &&
+ test_cmp check-rules-file ls-files &&
+ test_cmp check-rules-file check-rules-default
+'
+
+test_expect_success 'check-rules cone mode is default' '
+ cat >rules <<-\EOF &&
+ folder1
+ EOF
+
+ cat >all-files <<-\EOF &&
+ toplevel
+ folder2/file
+ folder1/file
+ EOF
+
+ cat >expect <<-\EOF &&
+ toplevel
+ folder1/file
+ EOF
+
+ git -C repo sparse-checkout set --no-cone &&
+ git -C repo sparse-checkout check-rules \
+ --rules-file ../rules >actual <all-files &&
+
+ git -C bare sparse-checkout check-rules \
+ --rules-file ../rules >actual-bare <all-files &&
+
+ test_cmp expect actual &&
+ test_cmp expect actual-bare
+'
+
+test_expect_success 'check-rules quoting' '
+ cat >rules <<-EOF &&
+ "folder\" a"
+ EOF
+ cat >files <<-EOF &&
+ "folder\" a/file"
+ "folder\" b/file"
+ EOF
+ cat >expect <<-EOF &&
+ "folder\" a/file"
+ EOF
+ git sparse-checkout check-rules --cone \
+ --rules-file rules >actual <files &&
+
+ test_cmp expect actual
+'
+
+test_expect_success 'check-rules null termination' '
+ cat >rules <<-EOF &&
+ "folder\" a"
+ EOF
+
+ lf_to_nul >files <<-EOF &&
+ folder" a/a
+ folder" a/b
+ folder" b/fileQ
+ EOF
+
+ cat >expect <<-EOF &&
+ folder" a/aQfolder" a/bQ
+ EOF
+
+ git sparse-checkout check-rules --cone -z \
+ --rules-file rules >actual.nul <files &&
+ nul_to_q <actual.nul >actual &&
+ echo >>actual &&
+
+ test_cmp expect actual
+'
+
+
test_done
diff --git a/t/t1092-sparse-checkout-compatibility.sh b/t/t1092-sparse-checkout-compatibility.sh
index f9f8c98..2f1ae5f 100755
--- a/t/t1092-sparse-checkout-compatibility.sh
+++ b/t/t1092-sparse-checkout-compatibility.sh
@@ -162,6 +162,19 @@ init_repos () {
git -C sparse-index sparse-checkout set deep
}
+init_repos_as_submodules () {
+ git reset --hard &&
+ init_repos &&
+ git submodule add ./full-checkout &&
+ git submodule add ./sparse-checkout &&
+ git submodule add ./sparse-index &&
+
+ git submodule status >actual &&
+ grep full-checkout actual &&
+ grep sparse-checkout actual &&
+ grep sparse-index actual
+}
+
run_on_sparse () {
(
cd sparse-checkout &&
@@ -324,8 +337,8 @@ test_expect_success 'status reports sparse-checkout' '
init_repos &&
git -C sparse-checkout status >full &&
git -C sparse-index status >sparse &&
- test_i18ngrep "You are in a sparse checkout with " full &&
- test_i18ngrep "You are in a sparse checkout." sparse
+ test_grep "You are in a sparse checkout with " full &&
+ test_grep "You are in a sparse checkout." sparse
'
test_expect_success 'add, commit, checkout' '
@@ -372,6 +385,23 @@ test_expect_success 'deep changes during checkout' '
test_all_match git checkout base
'
+test_expect_success 'checkout with modified sparse directory' '
+ init_repos &&
+
+ test_all_match git checkout rename-in-to-out -- . &&
+ test_sparse_match git sparse-checkout reapply &&
+ test_all_match git checkout base
+'
+
+test_expect_success 'checkout orphan then non-orphan' '
+ init_repos &&
+
+ test_all_match git checkout --orphan test-orphan &&
+ test_all_match git status --porcelain=v2 &&
+ test_all_match git checkout base &&
+ test_all_match git status --porcelain=v2
+'
+
test_expect_success 'add outside sparse cone' '
init_repos &&
@@ -548,7 +578,7 @@ test_expect_success 'blame with pathspec inside sparse definition' '
deep/deeper1/a \
deep/deeper1/deepest/a
do
- test_all_match git blame $file
+ test_all_match git blame $file || return 1
done
'
@@ -559,7 +589,7 @@ test_expect_success 'blame with pathspec outside sparse definition' '
init_repos &&
test_sparse_match git sparse-checkout set &&
- for file in a \
+ for file in \
deep/a \
deep/deeper1/a \
deep/deeper1/deepest/a
@@ -571,7 +601,7 @@ test_expect_success 'blame with pathspec outside sparse definition' '
# We compare sparse-checkout-err and sparse-index-err in
# `test_sparse_match`. Given we know they are the same, we
# only check the content of sparse-index-err here.
- test_cmp expect sparse-index-err
+ test_cmp expect sparse-index-err || return 1
done
'
@@ -687,6 +717,23 @@ test_expect_success 'reset with wildcard pathspec' '
test_all_match git ls-files -s -- folder1
'
+test_expect_success 'reset hard with removed sparse dir' '
+ init_repos &&
+
+ run_on_all git rm -r --sparse folder1 &&
+ test_all_match git status --porcelain=v2 &&
+
+ test_all_match git reset --hard &&
+ test_all_match git status --porcelain=v2 &&
+
+ cat >expect <<-\EOF &&
+ folder1/
+ EOF
+
+ git -C sparse-index ls-files --sparse folder1 >out &&
+ test_cmp expect out
+'
+
test_expect_success 'update-index modify outside sparse definition' '
init_repos &&
@@ -912,7 +959,7 @@ test_expect_success 'read-tree --prefix' '
test_all_match git read-tree --prefix=deep/deeper1/deepest -u deepest &&
test_all_match git status --porcelain=v2 &&
- test_all_match git rm -rf --sparse folder1/ &&
+ run_on_all git rm -rf --sparse folder1/ &&
test_all_match git read-tree --prefix=folder1/ -u update-folder1 &&
test_all_match git status --porcelain=v2 &&
@@ -1135,7 +1182,7 @@ test_expect_success 'checkout-index outside sparse definition' '
# Without --ignore-skip-worktree-bits, outside-of-cone files will trigger
# an error
test_sparse_match test_must_fail git checkout-index -- folder1/a &&
- test_i18ngrep "folder1/a has skip-worktree enabled" sparse-checkout-err &&
+ test_grep "folder1/a has skip-worktree enabled" sparse-checkout-err &&
test_path_is_missing folder1/a &&
# With --ignore-skip-worktree-bits, outside-of-cone files are checked out
@@ -1268,6 +1315,8 @@ test_expect_success 'submodule handling' '
test_all_match git add modules &&
test_all_match git commit -m "add modules directory" &&
+ test_config_global protocol.file.allow always &&
+
run_on_all git submodule add "$(pwd)/initial-repo" modules/sub &&
test_all_match git commit -m "add submodule" &&
@@ -1328,7 +1377,7 @@ test_expect_success 'index.sparse disabled inline uses full index' '
! test_region index ensure_full_index trace2.txt
'
-ensure_not_expanded () {
+run_sparse_index_trace2 () {
rm -f trace2.txt &&
if test -z "$WITHOUT_UNTRACKED_TXT"
then
@@ -1340,11 +1389,24 @@ ensure_not_expanded () {
shift &&
test_must_fail env \
GIT_TRACE2_EVENT="$(pwd)/trace2.txt" \
- git -C sparse-index "$@" || return 1
+ git -C sparse-index "$@" \
+ >sparse-index-out \
+ 2>sparse-index-error || return 1
else
GIT_TRACE2_EVENT="$(pwd)/trace2.txt" \
- git -C sparse-index "$@" || return 1
- fi &&
+ git -C sparse-index "$@" \
+ >sparse-index-out \
+ 2>sparse-index-error || return 1
+ fi
+}
+
+ensure_expanded () {
+ run_sparse_index_trace2 "$@" &&
+ test_region index ensure_full_index trace2.txt
+}
+
+ensure_not_expanded () {
+ run_sparse_index_trace2 "$@" &&
test_region ! index ensure_full_index trace2.txt
}
@@ -1461,6 +1523,31 @@ test_expect_success 'sparse-index is not expanded: stash' '
ensure_not_expanded stash pop
'
+test_expect_success 'describe tested on all' '
+ init_repos &&
+
+ # Add tag to be read by describe
+
+ run_on_all git tag -a v1.0 -m "Version 1" &&
+ test_all_match git describe --dirty &&
+ run_on_all rm g &&
+ test_all_match git describe --dirty
+'
+
+
+test_expect_success 'sparse-index is not expanded: describe' '
+ init_repos &&
+
+ # Add tag to be read by describe
+
+ git -C sparse-index tag -a v1.0 -m "Version 1" &&
+
+ ensure_not_expanded describe --dirty &&
+ echo "test" >>sparse-index/g &&
+ ensure_not_expanded describe --dirty &&
+ ensure_not_expanded describe
+'
+
test_expect_success 'sparse index is not expanded: diff' '
init_repos &&
@@ -1542,7 +1629,7 @@ test_expect_success 'sparse index is not expanded: blame' '
deep/deeper1/a \
deep/deeper1/deepest/a
do
- ensure_not_expanded blame $file
+ ensure_not_expanded blame $file || return 1
done
'
@@ -1828,4 +1915,420 @@ test_expect_success 'checkout behaves oddly with df-conflict-2' '
test_cmp full-checkout-err sparse-index-err
'
+test_expect_success 'mv directory from out-of-cone to in-cone' '
+ init_repos &&
+
+ # <source> as a sparse directory (or SKIP_WORKTREE_DIR without enabling
+ # sparse index).
+ test_all_match git mv --sparse folder1 deep &&
+ test_all_match git status --porcelain=v2 &&
+ test_sparse_match git ls-files -t &&
+ git -C sparse-checkout ls-files -t >actual &&
+ grep -e "H deep/folder1/0/0/0" actual &&
+ grep -e "H deep/folder1/0/1" actual &&
+ grep -e "H deep/folder1/a" actual &&
+
+ test_all_match git reset --hard &&
+
+ # <source> as a directory deeper than sparse index boundary (where
+ # sparse index will expand).
+ test_sparse_match git mv --sparse folder1/0 deep &&
+ test_sparse_match git status --porcelain=v2 &&
+ test_sparse_match git ls-files -t &&
+ git -C sparse-checkout ls-files -t >actual &&
+ grep -e "H deep/0/0/0" actual &&
+ grep -e "H deep/0/1" actual
+'
+
+test_expect_success 'rm pathspec inside sparse definition' '
+ init_repos &&
+
+ test_all_match git rm deep/a &&
+ test_all_match git status --porcelain=v2 &&
+
+ # test wildcard
+ run_on_all git reset --hard &&
+ test_all_match git rm deep/* &&
+ test_all_match git status --porcelain=v2 &&
+
+ # test recursive rm
+ run_on_all git reset --hard &&
+ test_all_match git rm -r deep &&
+ test_all_match git status --porcelain=v2
+'
+
+test_expect_success 'rm pathspec outside sparse definition' '
+ init_repos &&
+
+ for file in folder1/a folder1/0/1
+ do
+ test_sparse_match test_must_fail git rm $file &&
+ test_sparse_match test_must_fail git rm --cached $file &&
+ test_sparse_match git rm --sparse $file &&
+ test_sparse_match git status --porcelain=v2 || return 1
+ done &&
+
+ cat >folder1-full <<-EOF &&
+ rm ${SQ}folder1/0/0/0${SQ}
+ rm ${SQ}folder1/0/1${SQ}
+ rm ${SQ}folder1/a${SQ}
+ EOF
+
+ cat >folder1-sparse <<-EOF &&
+ rm ${SQ}folder1/${SQ}
+ EOF
+
+ # test wildcard
+ run_on_sparse git reset --hard &&
+ run_on_sparse git sparse-checkout reapply &&
+ test_sparse_match test_must_fail git rm folder1/* &&
+ run_on_sparse git rm --sparse folder1/* &&
+ test_cmp folder1-full sparse-checkout-out &&
+ test_cmp folder1-sparse sparse-index-out &&
+ test_sparse_match git status --porcelain=v2 &&
+
+ # test recursive rm
+ run_on_sparse git reset --hard &&
+ run_on_sparse git sparse-checkout reapply &&
+ test_sparse_match test_must_fail git rm --sparse folder1 &&
+ run_on_sparse git rm --sparse -r folder1 &&
+ test_cmp folder1-full sparse-checkout-out &&
+ test_cmp folder1-sparse sparse-index-out &&
+ test_sparse_match git status --porcelain=v2
+'
+
+test_expect_success 'rm pathspec expands index when necessary' '
+ init_repos &&
+
+ # in-cone pathspec (do not expand)
+ ensure_not_expanded rm "deep/deep*" &&
+ test_must_be_empty sparse-index-err &&
+
+ # out-of-cone pathspec (expand)
+ ! ensure_not_expanded rm --sparse "folder1/a*" &&
+ test_must_be_empty sparse-index-err &&
+
+ # pathspec that should expand index
+ ! ensure_not_expanded rm "*/a" &&
+ test_must_be_empty sparse-index-err &&
+
+ ! ensure_not_expanded rm "**a" &&
+ test_must_be_empty sparse-index-err
+'
+
+test_expect_success 'sparse index is not expanded: rm' '
+ init_repos &&
+
+ ensure_not_expanded rm deep/a &&
+
+ # test in-cone wildcard
+ git -C sparse-index reset --hard &&
+ ensure_not_expanded rm deep/* &&
+
+ # test recursive rm
+ git -C sparse-index reset --hard &&
+ ensure_not_expanded rm -r deep
+'
+
+test_expect_success 'grep with and --cached' '
+ init_repos &&
+
+ test_all_match git grep --cached a &&
+ test_all_match git grep --cached a -- "folder1/*"
+'
+
+test_expect_success 'grep is not expanded' '
+ init_repos &&
+
+ ensure_not_expanded grep a &&
+ ensure_not_expanded grep a -- deep/* &&
+
+ # All files within the folder1/* pathspec are sparse,
+ # so this command does not find any matches
+ ensure_not_expanded ! grep a -- folder1/* &&
+
+ # test out-of-cone pathspec with or without wildcard
+ ensure_not_expanded grep --cached a -- "folder1/a" &&
+ ensure_not_expanded grep --cached a -- "folder1/*" &&
+
+ # test in-cone pathspec with or without wildcard
+ ensure_not_expanded grep --cached a -- "deep/a" &&
+ ensure_not_expanded grep --cached a -- "deep/*"
+'
+
+# NEEDSWORK: when running `grep` in the superproject with --recurse-submodules,
+# Git expands the index of the submodules unexpectedly. Even though `grep`
+# builtin is marked as "command_requires_full_index = 0", this config is only
+# useful for the superproject. Namely, the submodules have their own configs,
+# which are _not_ populated by the one-time sparse-index feature switch.
+test_expect_failure 'grep within submodules is not expanded' '
+ init_repos_as_submodules &&
+
+ # do not use ensure_not_expanded() here, becasue `grep` should be
+ # run in the superproject, not in "./sparse-index"
+ GIT_TRACE2_EVENT="$(pwd)/trace2.txt" \
+ git grep --cached --recurse-submodules a -- "*/folder1/*" &&
+ test_region ! index ensure_full_index trace2.txt
+'
+
+# NEEDSWORK: this test is not actually testing the code. The design purpose
+# of this test is to verify the grep result when the submodules are using a
+# sparse-index. Namely, we want "folder1/" as a tree (a sparse directory); but
+# because of the index expansion, we are now grepping the "folder1/a" blob.
+# Because of the problem stated above 'grep within submodules is not expanded',
+# we don't have the ideal test environment yet.
+test_expect_success 'grep sparse directory within submodules' '
+ init_repos_as_submodules &&
+
+ cat >expect <<-\EOF &&
+ full-checkout/folder1/a:a
+ sparse-checkout/folder1/a:a
+ sparse-index/folder1/a:a
+ EOF
+ git grep --cached --recurse-submodules a -- "*/folder1/*" >actual &&
+ test_cmp actual expect
+'
+
+test_expect_success 'write-tree' '
+ init_repos &&
+
+ test_all_match git write-tree &&
+
+ write_script edit-contents <<-\EOF &&
+ echo text >>"$1"
+ EOF
+
+ # make a change inside the sparse cone
+ run_on_all ../edit-contents deep/a &&
+ test_all_match git update-index deep/a &&
+ test_all_match git write-tree &&
+ test_all_match git status --porcelain=v2 &&
+
+ # make a change outside the sparse cone
+ run_on_all mkdir -p folder1 &&
+ run_on_all cp a folder1/a &&
+ run_on_all ../edit-contents folder1/a &&
+ test_all_match git update-index folder1/a &&
+ test_all_match git write-tree &&
+ test_all_match git status --porcelain=v2 &&
+
+ # check that SKIP_WORKTREE files are not materialized
+ test_path_is_missing sparse-checkout/folder2/a &&
+ test_path_is_missing sparse-index/folder2/a
+'
+
+test_expect_success 'sparse-index is not expanded: write-tree' '
+ init_repos &&
+
+ ensure_not_expanded write-tree &&
+
+ echo "test1" >>sparse-index/a &&
+ git -C sparse-index update-index a &&
+ ensure_not_expanded write-tree
+'
+
+test_expect_success 'diff-files with pathspec inside sparse definition' '
+ init_repos &&
+
+ write_script edit-contents <<-\EOF &&
+ echo text >>"$1"
+ EOF
+
+ run_on_all ../edit-contents deep/a &&
+
+ test_all_match git diff-files &&
+
+ test_all_match git diff-files -- deep/a &&
+
+ # test wildcard
+ test_all_match git diff-files -- "deep/*"
+'
+
+test_expect_success 'diff-files with pathspec outside sparse definition' '
+ init_repos &&
+
+ test_sparse_match git diff-files -- folder2/a &&
+
+ write_script edit-contents <<-\EOF &&
+ echo text >>"$1"
+ EOF
+
+ # The directory "folder1" is outside the cone of interest
+ # and will not exist in the sparse checkout repositories.
+ # Create it as needed, add file "folder1/a" there with
+ # contents that is different from the staged version.
+ run_on_all mkdir -p folder1 &&
+ run_on_all cp a folder1/a &&
+
+ run_on_all ../edit-contents folder1/a &&
+ test_all_match git diff-files &&
+ test_all_match git diff-files -- folder1/a &&
+ test_all_match git diff-files -- "folder*/a"
+'
+
+test_expect_success 'sparse index is not expanded: diff-files' '
+ init_repos &&
+
+ write_script edit-contents <<-\EOF &&
+ echo text >>"$1"
+ EOF
+
+ run_on_all ../edit-contents deep/a &&
+
+ ensure_not_expanded diff-files &&
+ ensure_not_expanded diff-files -- deep/a &&
+ ensure_not_expanded diff-files -- "deep/*"
+'
+
+test_expect_success 'diff-tree' '
+ init_repos &&
+
+ # Test change inside sparse cone
+ tree1=$(git -C sparse-index rev-parse HEAD^{tree}) &&
+ tree2=$(git -C sparse-index rev-parse update-deep^{tree}) &&
+ test_all_match git diff-tree $tree1 $tree2 &&
+ test_all_match git diff-tree $tree1 $tree2 -- deep/a &&
+ test_all_match git diff-tree HEAD update-deep &&
+ test_all_match git diff-tree HEAD update-deep -- deep/a &&
+
+ # Test change outside sparse cone
+ tree3=$(git -C sparse-index rev-parse update-folder1^{tree}) &&
+ test_all_match git diff-tree $tree1 $tree3 &&
+ test_all_match git diff-tree $tree1 $tree3 -- folder1/a &&
+ test_all_match git diff-tree HEAD update-folder1 &&
+ test_all_match git diff-tree HEAD update-folder1 -- folder1/a &&
+
+ # Check that SKIP_WORKTREE files are not materialized
+ test_path_is_missing sparse-checkout/folder1/a &&
+ test_path_is_missing sparse-index/folder1/a &&
+ test_path_is_missing sparse-checkout/folder2/a &&
+ test_path_is_missing sparse-index/folder2/a
+'
+
+test_expect_success 'sparse-index is not expanded: diff-tree' '
+ init_repos &&
+
+ tree1=$(git -C sparse-index rev-parse HEAD^{tree}) &&
+ tree2=$(git -C sparse-index rev-parse update-deep^{tree}) &&
+ tree3=$(git -C sparse-index rev-parse update-folder1^{tree}) &&
+
+ ensure_not_expanded diff-tree $tree1 $tree2 &&
+ ensure_not_expanded diff-tree $tree1 $tree2 -- deep/a &&
+ ensure_not_expanded diff-tree HEAD update-deep &&
+ ensure_not_expanded diff-tree HEAD update-deep -- deep/a &&
+ ensure_not_expanded diff-tree $tree1 $tree3 &&
+ ensure_not_expanded diff-tree $tree1 $tree3 -- folder1/a &&
+ ensure_not_expanded diff-tree HEAD update-folder1 &&
+ ensure_not_expanded diff-tree HEAD update-folder1 -- folder1/a
+'
+
+test_expect_success 'worktree' '
+ init_repos &&
+
+ write_script edit-contents <<-\EOF &&
+ echo text >>"$1"
+ EOF
+
+ for repo in full-checkout sparse-checkout sparse-index
+ do
+ worktree=${repo}-wt &&
+ git -C $repo worktree add ../$worktree &&
+
+ # Compare worktree content with "ls"
+ (cd $repo && ls) >worktree_contents &&
+ (cd $worktree && ls) >new_worktree_contents &&
+ test_cmp worktree_contents new_worktree_contents &&
+
+ # Compare index content with "ls-files --sparse"
+ git -C $repo ls-files --sparse >index_contents &&
+ git -C $worktree ls-files --sparse >new_index_contents &&
+ test_cmp index_contents new_index_contents &&
+
+ git -C $repo worktree remove ../$worktree || return 1
+ done &&
+
+ test_all_match git worktree add .worktrees/hotfix &&
+ run_on_all ../edit-contents .worktrees/hotfix/deep/a &&
+ test_all_match test_must_fail git worktree remove .worktrees/hotfix
+'
+
+test_expect_success 'worktree is not expanded' '
+ init_repos &&
+
+ ensure_not_expanded worktree add .worktrees/hotfix &&
+ ensure_not_expanded worktree remove .worktrees/hotfix
+'
+
+test_expect_success 'check-attr with pathspec inside sparse definition' '
+ init_repos &&
+
+ echo "a -crlf myAttr" >>.gitattributes &&
+ run_on_all cp ../.gitattributes ./deep &&
+
+ test_all_match git check-attr -a -- deep/a &&
+
+ test_all_match git add deep/.gitattributes &&
+ test_all_match git check-attr -a --cached -- deep/a
+'
+
+test_expect_success 'check-attr with pathspec outside sparse definition' '
+ init_repos &&
+
+ echo "a -crlf myAttr" >>.gitattributes &&
+ run_on_sparse mkdir folder1 &&
+ run_on_all cp ../.gitattributes ./folder1 &&
+ run_on_all cp a folder1/a &&
+
+ test_all_match git check-attr -a -- folder1/a &&
+
+ git -C full-checkout add folder1/.gitattributes &&
+ test_sparse_match git add --sparse folder1/.gitattributes &&
+ test_all_match git commit -m "add .gitattributes" &&
+ test_sparse_match git sparse-checkout reapply &&
+ test_all_match git check-attr -a --cached -- folder1/a
+'
+
+# NEEDSWORK: The 'diff --check' test is left as 'test_expect_failure' due
+# to an underlying issue in oneway_diff() within diff-lib.c.
+# 'do_oneway_diff()' is not called as expected for paths that could match
+# inside of a sparse directory. Specifically, the 'ce_path_match()' function
+# fails to recognize files inside a sparse directory (e.g., when 'folder1/'
+# is a sparse directory, 'folder1/a' cannot be recognized). The goal is to
+# proceed with 'do_oneway_diff()' if the pathspec could match inside of a
+# sparse directory.
+test_expect_failure 'diff --check with pathspec outside sparse definition' '
+ init_repos &&
+
+ write_script edit-contents <<-\EOF &&
+ echo "a " >"$1"
+ EOF
+
+ test_all_match git config core.whitespace -trailing-space,-space-before-tab &&
+
+ echo "a whitespace=trailing-space,space-before-tab" >>.gitattributes &&
+ run_on_all mkdir -p folder1 &&
+ run_on_all cp ../.gitattributes ./folder1 &&
+ test_all_match git add --sparse folder1/.gitattributes &&
+ run_on_all ../edit-contents folder1/a &&
+ test_all_match git add --sparse folder1/a &&
+
+ test_sparse_match git sparse-checkout reapply &&
+ test_all_match test_must_fail git diff --check --cached -- folder1/a
+'
+
+test_expect_success 'sparse-index is not expanded: check-attr' '
+ init_repos &&
+
+ echo "a -crlf myAttr" >>.gitattributes &&
+ mkdir ./sparse-index/folder1 &&
+ cp ./sparse-index/a ./sparse-index/folder1/a &&
+ cp .gitattributes ./sparse-index/deep &&
+ cp .gitattributes ./sparse-index/folder1 &&
+
+ git -C sparse-index add deep/.gitattributes &&
+ git -C sparse-index add --sparse folder1/.gitattributes &&
+ ensure_not_expanded check-attr -a --cached -- deep/a &&
+ ensure_not_expanded check-attr -a --cached -- folder1/a
+'
+
test_done
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index c6661e6..9b65d9e 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -11,6 +11,98 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
+test_expect_success 'setup whitespace config' '
+ sed -e "s/^|//" \
+ -e "s/[$]$//" \
+ -e "s/X/ /g" >.git/config <<-\EOF
+ [section]
+ | solid = rock
+ | sparse = big XX blue
+ | sparseAndTail = big XX blue $
+ | sparseAndTailQuoted = "big XX blue "
+ | sparseAndBiggerTail = big XX blue X X
+ | sparseAndBiggerTailQuoted = "big XX blue X X"
+ | sparseAndBiggerTailQuotedPlus = "big XX blue X X"X $
+ | headAndTail = Xbig blue $
+ | headAndTailQuoted = "Xbig blue "
+ | headAndTailQuotedPlus = "Xbig blue " $
+ | annotated = big blueX# to be discarded
+ | annotatedQuoted = "big blue"X# to be discarded
+ EOF
+'
+
+test_expect_success 'no internal whitespace' '
+ echo "rock" >expect &&
+ git config --get section.solid >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'internal whitespace' '
+ echo "big QQ blue" | q_to_tab >expect &&
+ git config --get section.sparse >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'internal and trailing whitespace' '
+ echo "big QQ blue" | q_to_tab >expect &&
+ git config --get section.sparseAndTail >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'internal and trailing whitespace, all quoted' '
+ echo "big QQ blue " | q_to_tab >expect &&
+ git config --get section.sparseAndTailQuoted >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'internal and more trailing whitespace' '
+ echo "big QQ blue" | q_to_tab >expect &&
+ git config --get section.sparseAndBiggerTail >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'internal and more trailing whitespace, all quoted' '
+ echo "big QQ blue Q Q" | q_to_tab >expect &&
+ git config --get section.sparseAndBiggerTailQuoted >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'internal and more trailing whitespace, not all quoted' '
+ echo "big QQ blue Q Q" | q_to_tab >expect &&
+ git config --get section.sparseAndBiggerTailQuotedPlus >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'leading and trailing whitespace' '
+ echo "big blue" >expect &&
+ git config --get section.headAndTail >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'leading and trailing whitespace, all quoted' '
+ echo "Qbig blue " | q_to_tab >expect &&
+ git config --get section.headAndTailQuoted >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'leading and trailing whitespace, not all quoted' '
+ echo "Qbig blue " | q_to_tab >expect &&
+ git config --get section.headAndTailQuotedPlus >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'inline comment' '
+ echo "big blue" >expect &&
+ git config --get section.annotated >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'inline comment, quoted' '
+ echo "big blue" >expect &&
+ git config --get section.annotatedQuoted >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'clear default config' '
rm -f .git/config
'
@@ -69,14 +161,32 @@ test_expect_success 'replace with non-match (actually matching)' '
cat > expect << EOF
[section]
- penguin = very blue
Movie = BadPhysics
UPPERCASE = true
- penguin = kingpin
+ penguin = gentoo # Pygoscelis papua
+ disposition = peckish # find fish
+ foo = bar #abc
+ spsp = value # and comment
+ htsp = value # and comment
[Sections]
WhatEver = Second
EOF
+test_expect_success 'append comments' '
+ git config --replace-all --comment="Pygoscelis papua" section.penguin gentoo &&
+ git config --comment="find fish" section.disposition peckish &&
+ git config --comment="#abc" section.foo bar &&
+
+ git config --comment="and comment" section.spsp value &&
+ git config --comment=" # and comment" section.htsp value &&
+
+ test_cmp expect .git/config
+'
+
+test_expect_success 'Prohibited LF in comment' '
+ test_must_fail git config --comment="a${LF}b" section.k v
+'
+
test_expect_success 'non-match result' 'test_cmp expect .git/config'
test_expect_success 'find mixed-case key by canonical name' '
@@ -98,6 +208,23 @@ test_expect_success 'subsections are not canonicalized by git-config' '
test_cmp_config two section.SubSection.key
'
+test_missing_key () {
+ local key="$1" &&
+ local title="$2" &&
+ test_expect_success "value for $title is not printed" '
+ test_must_fail git config "$key" >out 2>err &&
+ test_must_be_empty out &&
+ test_must_be_empty err
+ '
+}
+
+test_missing_key 'missingsection.missingkey' 'missing section and missing key'
+test_missing_key 'missingsection.penguin' 'missing section and existing key'
+test_missing_key 'section.missingkey' 'existing section and missing key'
+test_missing_key 'section.MissingSubSection.missingkey' 'missing subsection and missing key'
+test_missing_key 'section.SubSection.missingkey' 'existing subsection and missing key'
+test_missing_key 'section.MissingSubSection.key' 'missing subsection and existing key'
+
cat > .git/config <<\EOF
[alpha]
bar = foo
@@ -436,7 +563,7 @@ test_expect_success 'get bool variable with empty value' '
test_expect_success 'no arguments, but no crash' '
test_must_fail git config >output 2>&1 &&
- test_i18ngrep usage output
+ test_grep usage output
'
cat > .git/config << EOF
@@ -617,6 +744,36 @@ test_expect_success 'renaming to bogus section is rejected' '
test_must_fail git config --rename-section branch.zwei "bogus name"
'
+test_expect_success 'renaming a section with a long line' '
+ {
+ printf "[b]\\n" &&
+ printf " c = d %1024s [a] e = f\\n" " " &&
+ printf "[a] g = h\\n"
+ } >y &&
+ git config -f y --rename-section a xyz &&
+ test_must_fail git config -f y b.e
+'
+
+test_expect_success 'renaming an embedded section with a long line' '
+ {
+ printf "[b]\\n" &&
+ printf " c = d %1024s [a] [foo] e = f\\n" " " &&
+ printf "[a] g = h\\n"
+ } >y &&
+ git config -f y --rename-section a xyz &&
+ test_must_fail git config -f y foo.e
+'
+
+test_expect_success 'renaming a section with an overly-long line' '
+ {
+ printf "[b]\\n" &&
+ printf " c = d %525000s e" " " &&
+ printf "[a] g = h\\n"
+ } >y &&
+ test_must_fail git config -f y --rename-section a xyz 2>err &&
+ grep "refusing to work with overly long line in .y. on line 2" err
+'
+
cat >> .git/config << EOF
[branch "zwei"] a = 1 [branch "vier"]
EOF
@@ -673,25 +830,25 @@ test_expect_success 'invalid unit' '
git config aninvalid.unit "1auto" &&
test_cmp_config 1auto aninvalid.unit &&
test_must_fail git config --int --get aninvalid.unit 2>actual &&
- test_i18ngrep "bad numeric config value .1auto. for .aninvalid.unit. in file .git/config: invalid unit" actual
+ test_grep "bad numeric config value .1auto. for .aninvalid.unit. in file .git/config: invalid unit" actual
'
test_expect_success 'invalid unit boolean' '
git config commit.gpgsign "1true" &&
test_cmp_config 1true commit.gpgsign &&
test_must_fail git config --bool --get commit.gpgsign 2>actual &&
- test_i18ngrep "bad boolean config value .1true. for .commit.gpgsign." actual
+ test_grep "bad boolean config value .1true. for .commit.gpgsign." actual
'
test_expect_success 'line number is reported correctly' '
printf "[bool]\n\tvar\n" >invalid &&
test_must_fail git config -f invalid --path bool.var 2>actual &&
- test_i18ngrep "line 2" actual
+ test_grep "line 2" actual
'
test_expect_success 'invalid stdin config' '
echo "[broken" | test_must_fail git config --list --file - >output 2>&1 &&
- test_i18ngrep "bad config line 1 in standard input" output
+ test_grep "bad config line 1 in standard input" output
'
cat > expect << EOF
@@ -872,7 +1029,7 @@ test_expect_success !MINGW 'get --path copes with unset $HOME' '
git config --get --path path.normal >>result &&
git config --get --path path.trailingtilde >>result
) &&
- test_i18ngrep "[Ff]ailed to expand.*~/" msg &&
+ test_grep "[Ff]ailed to expand.*~/" msg &&
test_cmp expect result
'
@@ -939,7 +1096,7 @@ test_expect_success 'get --type=color barfs on non-color' '
test_expect_success 'set --type=color barfs on non-color' '
test_must_fail git config --type=color foo.color "not-a-color" 2>error &&
- test_i18ngrep "cannot parse color" error
+ test_grep "cannot parse color" error
'
cat > expect << EOF
@@ -1019,9 +1176,25 @@ test_expect_success '--null --get-regexp' '
test_cmp expect result
'
-test_expect_success 'inner whitespace kept verbatim' '
- git config section.val "foo bar" &&
- test_cmp_config "foo bar" section.val
+test_expect_success 'inner whitespace kept verbatim, spaces only' '
+ echo "foo bar" >expect &&
+ git config section.val "foo bar" &&
+ git config --get section.val >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'inner whitespace kept verbatim, horizontal tabs only' '
+ echo "fooQQbar" | q_to_tab >expect &&
+ git config section.val "$(cat expect)" &&
+ git config --get section.val >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'inner whitespace kept verbatim, horizontal tabs and spaces' '
+ echo "foo Q bar" | q_to_tab >expect &&
+ git config section.val "$(cat expect)" &&
+ git config --get section.val >actual &&
+ test_cmp expect actual
'
test_expect_success SYMLINKS 'symlinked configuration' '
@@ -1051,15 +1224,20 @@ test_expect_success SYMLINKS 'symlink to nonexistent configuration' '
test_must_fail git config --file=linktolinktonada --list
'
-test_expect_success 'check split_cmdline return' "
- git config alias.split-cmdline-fix 'echo \"' &&
- test_must_fail git split-cmdline-fix &&
- echo foo > foo &&
- git add foo &&
- git commit -m 'initial commit' &&
- git config branch.main.mergeoptions 'echo \"' &&
- test_must_fail git merge main
-"
+test_expect_success 'check split_cmdline return' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ git config alias.split-cmdline-fix "echo \"" &&
+ test_must_fail git split-cmdline-fix &&
+ echo foo >foo &&
+ git add foo &&
+ git commit -m "initial commit" &&
+ git config branch.main.mergeoptions "echo \"" &&
+ test_must_fail git merge main
+ )
+'
test_expect_success 'git -c "key=value" support' '
cat >expect <<-\EOF &&
@@ -1110,10 +1288,16 @@ test_expect_success 'git -c works with aliases of builtins' '
'
test_expect_success 'aliases can be CamelCased' '
- test_config alias.CamelCased "rev-parse HEAD" &&
- git CamelCased >out &&
- git rev-parse HEAD >expect &&
- test_cmp expect out
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit A &&
+ git config alias.CamelCased "rev-parse HEAD" &&
+ git CamelCased >out &&
+ git rev-parse HEAD >expect &&
+ test_cmp expect out
+ )
'
test_expect_success 'git -c does not split values on equals' '
@@ -1400,12 +1584,12 @@ test_expect_success 'git --config-env with missing value' '
test_expect_success 'git --config-env fails with invalid parameters' '
test_must_fail git --config-env=foo.flag config --bool foo.flag 2>error &&
- test_i18ngrep "invalid config format: foo.flag" error &&
+ test_grep "invalid config format: foo.flag" error &&
test_must_fail git --config-env=foo.flag= config --bool foo.flag 2>error &&
- test_i18ngrep "missing environment variable name for configuration ${SQ}foo.flag${SQ}" error &&
+ test_grep "missing environment variable name for configuration ${SQ}foo.flag${SQ}" error &&
sane_unset NONEXISTENT &&
test_must_fail git --config-env=foo.flag=NONEXISTENT config --bool foo.flag 2>error &&
- test_i18ngrep "missing environment variable ${SQ}NONEXISTENT${SQ} for configuration ${SQ}foo.flag${SQ}" error
+ test_grep "missing environment variable ${SQ}NONEXISTENT${SQ} for configuration ${SQ}foo.flag${SQ}" error
'
test_expect_success 'git -c and --config-env work together' '
@@ -1458,55 +1642,49 @@ test_expect_success 'git config ignores pairs without count' '
test_must_be_empty error
'
-test_expect_success 'git config ignores pairs with zero count' '
- test_must_fail env \
- GIT_CONFIG_COUNT=0 \
- GIT_CONFIG_KEY_0="pair.one" GIT_CONFIG_VALUE_0="value" \
- git config pair.one
-'
-
test_expect_success 'git config ignores pairs exceeding count' '
GIT_CONFIG_COUNT=1 \
GIT_CONFIG_KEY_0="pair.one" GIT_CONFIG_VALUE_0="value" \
GIT_CONFIG_KEY_1="pair.two" GIT_CONFIG_VALUE_1="value" \
- git config --get-regexp "pair.*" >actual &&
+ git config --get-regexp "pair.*" >actual 2>error &&
cat >expect <<-EOF &&
pair.one value
EOF
- test_cmp expect actual
+ test_cmp expect actual &&
+ test_must_be_empty error
'
test_expect_success 'git config ignores pairs with zero count' '
test_must_fail env \
GIT_CONFIG_COUNT=0 GIT_CONFIG_KEY_0="pair.one" GIT_CONFIG_VALUE_0="value" \
- git config pair.one >error &&
+ git config pair.one 2>error &&
test_must_be_empty error
'
test_expect_success 'git config ignores pairs with empty count' '
test_must_fail env \
GIT_CONFIG_COUNT= GIT_CONFIG_KEY_0="pair.one" GIT_CONFIG_VALUE_0="value" \
- git config pair.one >error &&
+ git config pair.one 2>error &&
test_must_be_empty error
'
test_expect_success 'git config fails with invalid count' '
test_must_fail env GIT_CONFIG_COUNT=10a git config --list 2>error &&
- test_i18ngrep "bogus count" error &&
+ test_grep "bogus count" error &&
test_must_fail env GIT_CONFIG_COUNT=9999999999999999 git config --list 2>error &&
- test_i18ngrep "too many entries" error
+ test_grep "too many entries" error
'
test_expect_success 'git config fails with missing config key' '
test_must_fail env GIT_CONFIG_COUNT=1 GIT_CONFIG_VALUE_0="value" \
git config --list 2>error &&
- test_i18ngrep "missing config key" error
+ test_grep "missing config key" error
'
test_expect_success 'git config fails with missing config value' '
test_must_fail env GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="pair.one" \
git config --list 2>error &&
- test_i18ngrep "missing config value" error
+ test_grep "missing config value" error
'
test_expect_success 'git config fails with invalid config pair key' '
@@ -1571,12 +1749,12 @@ test_expect_success 'git config --edit respects core.editor' '
# malformed configuration files
test_expect_success 'barf on syntax error' '
cat >.git/config <<-\EOF &&
- # broken section line
+ # broken key=value
[section]
key garbage
EOF
- test_must_fail git config --get section.key >actual 2>error &&
- test_i18ngrep " line 3 " error
+ test_must_fail git config --get section.key 2>error &&
+ test_grep " line 3 " error
'
test_expect_success 'barf on incomplete section header' '
@@ -1585,18 +1763,18 @@ test_expect_success 'barf on incomplete section header' '
[section
key = value
EOF
- test_must_fail git config --get section.key >actual 2>error &&
- test_i18ngrep " line 2 " error
+ test_must_fail git config --get section.key 2>error &&
+ test_grep " line 2 " error
'
test_expect_success 'barf on incomplete string' '
cat >.git/config <<-\EOF &&
- # broken section line
+ # broken value string
[section]
key = "value string
EOF
- test_must_fail git config --get section.key >actual 2>error &&
- test_i18ngrep " line 3 " error
+ test_must_fail git config --get section.key 2>error &&
+ test_grep " line 3 " error
'
test_expect_success 'urlmatch' '
@@ -1627,6 +1805,21 @@ test_expect_success 'urlmatch' '
test_cmp expect actual
'
+test_expect_success 'urlmatch with --show-scope' '
+ cat >.git/config <<-\EOF &&
+ [http "https://weak.example.com"]
+ sslVerify = false
+ cookieFile = /tmp/cookie.txt
+ EOF
+
+ cat >expect <<-EOF &&
+ local http.cookiefile /tmp/cookie.txt
+ local http.sslverify false
+ EOF
+ git config --get-urlmatch --show-scope HTTP https://weak.example.com >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'urlmatch favors more specific URLs' '
cat >.git/config <<-\EOF &&
[http "https://example.com/"]
@@ -1953,11 +2146,11 @@ test_expect_success '--show-origin getting a single key' '
'
test_expect_success 'set up custom config file' '
- CUSTOM_CONFIG_FILE="custom.conf" &&
- cat >"$CUSTOM_CONFIG_FILE" <<-\EOF
+ cat >"custom.conf" <<-\EOF &&
[user]
custom = true
EOF
+ CUSTOM_CONFIG_FILE="$(test-tool path-utils real_path custom.conf)"
'
test_expect_success !MINGW 'set up custom config file with special name characters' '
@@ -1996,22 +2189,39 @@ test_expect_success '--show-origin stdin with file include' '
'
test_expect_success '--show-origin blob' '
- blob=$(git hash-object -w "$CUSTOM_CONFIG_FILE") &&
- cat >expect <<-EOF &&
- blob:$blob user.custom=true
- EOF
- git config --blob=$blob --show-origin --list >output &&
- test_cmp expect output
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ blob=$(git hash-object -w "$CUSTOM_CONFIG_FILE") &&
+ cat >expect <<-EOF &&
+ blob:$blob user.custom=true
+ EOF
+ git config --blob=$blob --show-origin --list >output &&
+ test_cmp expect output
+ )
'
test_expect_success '--show-origin blob ref' '
- cat >expect <<-\EOF &&
- blob:main:custom.conf user.custom=true
- EOF
- git add "$CUSTOM_CONFIG_FILE" &&
- git commit -m "new config file" &&
- git config --blob=main:"$CUSTOM_CONFIG_FILE" --show-origin --list >output &&
- test_cmp expect output
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ cat >expect <<-\EOF &&
+ blob:main:custom.conf user.custom=true
+ EOF
+ cp "$CUSTOM_CONFIG_FILE" custom.conf &&
+ git add custom.conf &&
+ git commit -m "new config file" &&
+ git config --blob=main:custom.conf --show-origin --list >output &&
+ test_cmp expect output
+ )
+'
+
+test_expect_success '--show-origin with --default' '
+ git config --show-origin --default foo some.key >actual &&
+ echo "command line: foo" >expect &&
+ test_cmp expect actual
'
test_expect_success '--show-scope with --list' '
@@ -2082,6 +2292,12 @@ test_expect_success '--show-scope with --show-origin' '
test_cmp expect output
'
+test_expect_success '--show-scope with --default' '
+ git config --show-scope --default foo some.key >actual &&
+ echo "command foo" >expect &&
+ test_cmp expect actual
+'
+
test_expect_success 'override global and system config' '
test_when_finished rm -f \"\$HOME\"/.gitconfig &&
cat >"$HOME"/.gitconfig <<-EOF &&
@@ -2198,17 +2414,17 @@ test_expect_success 'identical mixed --type specifiers are allowed' '
test_expect_success 'non-identical modern --type specifiers are not allowed' '
test_must_fail git config --type=int --type=bool section.big 2>error &&
- test_i18ngrep "only one type at a time" error
+ test_grep "only one type at a time" error
'
test_expect_success 'non-identical legacy --type specifiers are not allowed' '
test_must_fail git config --int --bool section.big 2>error &&
- test_i18ngrep "only one type at a time" error
+ test_grep "only one type at a time" error
'
test_expect_success 'non-identical mixed --type specifiers are not allowed' '
test_must_fail git config --type=int --bool section.big 2>error &&
- test_i18ngrep "only one type at a time" error
+ test_grep "only one type at a time" error
'
test_expect_success '--type allows valid type specifiers' '
@@ -2225,7 +2441,13 @@ test_expect_success 'unset type specifiers may be reset to conflicting ones' '
test_expect_success '--type rejects unknown specifiers' '
test_must_fail git config --type=nonsense section.foo 2>error &&
- test_i18ngrep "unrecognized --type argument" error
+ test_grep "unrecognized --type argument" error
+'
+
+test_expect_success '--type=int requires at least one digit' '
+ test_must_fail git config --type int --default m some.key >out 2>error &&
+ grep "bad numeric config value" error &&
+ test_must_be_empty out
'
test_expect_success '--replace-all does not invent newlines' '
@@ -2265,7 +2487,7 @@ test_expect_success 'set all config with value-pattern' '
# multiple matches => failure
test_must_fail git config --file=config abc.key three o+ 2>err &&
- test_i18ngrep "has multiple values" err &&
+ test_grep "has multiple values" err &&
# multiple values, no match => add
git config --file=config abc.key three a+ &&
diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh
index 84bf197..29cf8a9 100755
--- a/t/t1301-shared-repo.sh
+++ b/t/t1301-shared-repo.sh
@@ -8,6 +8,8 @@ test_description='Test shared repository initialization'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_CREATE_REPO_NO_TEMPLATE=1
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# Remove a default ACL from the test dir if possible.
@@ -25,6 +27,7 @@ test_expect_success 'shared = 0400 (faulty permission u-w)' '
for u in 002 022
do
test_expect_success POSIXPERM "shared=1 does not clear bits preset by umask $u" '
+ test_when_finished "rm -rf sub" &&
mkdir sub && (
cd sub &&
umask $u &&
@@ -42,21 +45,30 @@ do
;;
esac
'
- rm -rf sub
done
test_expect_success 'shared=all' '
- mkdir sub &&
- cd sub &&
- git init --shared=all &&
+ git init --template= --shared=all &&
test 2 = $(git config core.sharedrepository)
'
+test_expect_success 'template cannot set core.bare' '
+ test_when_finished "rm -rf subdir" &&
+ test_when_finished "rm -rf templates" &&
+ test_config core.bare true &&
+ umask 0022 &&
+ mkdir -p templates/ &&
+ cp .git/config templates/config &&
+ git init --template=templates subdir &&
+ test_path_is_missing subdir/HEAD
+'
+
test_expect_success POSIXPERM 'update-server-info honors core.sharedRepository' '
: > a1 &&
git add a1 &&
test_tick &&
git commit -m a1 &&
+ mkdir .git/info &&
umask 0277 &&
git update-server-info &&
actual="$(ls -l .git/info/refs)" &&
@@ -88,7 +100,7 @@ do
rm -f .git/info/refs &&
git update-server-info &&
actual="$(test_modebits .git/info/refs)" &&
- verbose test "x$actual" = "x-$y"
+ test "x$actual" = "x-$y"
'
@@ -98,7 +110,7 @@ do
rm -f .git/info/refs &&
git update-server-info &&
actual="$(test_modebits .git/info/refs)" &&
- verbose test "x$actual" = "x-$x"
+ test "x$actual" = "x-$x"
'
@@ -114,23 +126,8 @@ test_expect_success POSIXPERM 'info/refs respects umask in unshared repo' '
test_cmp expect actual
'
-test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
- umask 077 &&
- git config core.sharedRepository group &&
- git reflog expire --all &&
- actual="$(ls -l .git/logs/refs/heads/main)" &&
- case "$actual" in
- -rw-rw-*)
- : happy
- ;;
- *)
- echo Ooops, .git/logs/refs/heads/main is not 066x [$actual]
- false
- ;;
- esac
-'
-
test_expect_success POSIXPERM 'forced modes' '
+ test_when_finished "rm -rf new" &&
mkdir -p templates/hooks &&
echo update-server-info >templates/hooks/post-update &&
chmod +x templates/hooks/post-update &&
@@ -139,7 +136,8 @@ test_expect_success POSIXPERM 'forced modes' '
(
cd new &&
umask 002 &&
- git init --shared=0660 --template=templates &&
+ git init --shared=0660 --template=../templates &&
+ test_path_is_file .git/hooks/post-update &&
>frotz &&
git add frotz &&
git commit -a -m initial &&
@@ -172,6 +170,7 @@ test_expect_success POSIXPERM 'forced modes' '
'
test_expect_success POSIXPERM 'remote init does not use config from cwd' '
+ test_when_finished "rm -rf child.git" &&
git config core.sharedrepository 0666 &&
umask 0022 &&
git init --bare child.git &&
@@ -191,7 +190,7 @@ test_expect_success POSIXPERM 're-init respects core.sharedrepository (local)' '
'
test_expect_success POSIXPERM 're-init respects core.sharedrepository (remote)' '
- rm -rf child.git &&
+ test_when_finished "rm -rf child.git" &&
umask 0022 &&
git init --bare --shared=0666 child.git &&
test_path_is_missing child.git/foo &&
@@ -202,7 +201,7 @@ test_expect_success POSIXPERM 're-init respects core.sharedrepository (remote)'
'
test_expect_success POSIXPERM 'template can set core.sharedrepository' '
- rm -rf child.git &&
+ test_when_finished "rm -rf child.git" &&
umask 0022 &&
git config core.sharedrepository 0666 &&
cp .git/config templates/config &&
diff --git a/t/t1302-repo-version.sh b/t/t1302-repo-version.sh
index 0acabb6..42caa0d 100755
--- a/t/t1302-repo-version.sh
+++ b/t/t1302-repo-version.sh
@@ -5,13 +5,10 @@
test_description='Test repository version check'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
- test_oid_cache <<-\EOF &&
- version sha1:0
- version sha256:1
- EOF
cat >test.patch <<-\EOF &&
diff --git a/test.txt b/test.txt
new file mode 100644
@@ -27,7 +24,12 @@ test_expect_success 'setup' '
'
test_expect_success 'gitdir selection on normal repos' '
- echo $(test_oid version) >expect &&
+ if test_have_prereq DEFAULT_REPO_FORMAT
+ then
+ echo 0
+ else
+ echo 1
+ fi >expect &&
git config core.repositoryformatversion >actual &&
git -C test config core.repositoryformatversion >actual2 &&
test_cmp expect actual &&
@@ -36,7 +38,7 @@ test_expect_success 'gitdir selection on normal repos' '
test_expect_success 'gitdir selection on unsupported repo' '
# Make sure it would stop at test2, not trash
- test_expect_code 1 git -C test2 config core.repositoryformatversion >actual
+ test_expect_code 1 git -C test2 config core.repositoryformatversion
'
test_expect_success 'gitdir not required mode' '
@@ -78,8 +80,13 @@ mkconfig () {
while read outcome version extensions; do
test_expect_success "$outcome version=$version $extensions" "
- mkconfig $version $extensions >.git/config &&
- check_${outcome}
+ test_when_finished 'rm -rf extensions' &&
+ git init extensions &&
+ (
+ cd extensions &&
+ mkconfig $version $extensions >.git/config &&
+ check_${outcome}
+ )
"
done <<\EOF
allow 0
@@ -93,7 +100,8 @@ allow 1 noop-v1
EOF
test_expect_success 'precious-objects allowed' '
- mkconfig 1 preciousObjects >.git/config &&
+ git config core.repositoryFormatVersion 1 &&
+ git config extensions.preciousObjects 1 &&
check_allow
'
diff --git a/t/t1304-default-acl.sh b/t/t1304-default-acl.sh
index 335d3f3..31b89dd 100755
--- a/t/t1304-default-acl.sh
+++ b/t/t1304-default-acl.sh
@@ -9,6 +9,7 @@ test_description='Test repository with default ACL'
# => this must come before . ./test-lib.sh
umask 077
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# We need an arbitrary other user give permission to using ACLs. root
@@ -18,7 +19,7 @@ test_expect_success 'checking for a working acl setup' '
if setfacl -m d:m:rwx -m u:root:rwx . &&
getfacl . | grep user:root:rwx &&
touch should-have-readable-acl &&
- getfacl should-have-readable-acl | egrep "mask::?rw-"
+ getfacl should-have-readable-acl | grep -E "mask::?rw-"
then
test_set_prereq SETFACL
fi
@@ -34,7 +35,7 @@ check_perms_and_acl () {
getfacl "$1" > actual &&
grep -q "user:root:rwx" actual &&
grep -q "user:${LOGNAME}:rwx" actual &&
- egrep "mask::?r--" actual > /dev/null 2>&1 &&
+ grep -E "mask::?r--" actual > /dev/null 2>&1 &&
grep -q "group::---" actual || false
}
diff --git a/t/t1307-config-blob.sh b/t/t1307-config-blob.sh
index 0a7099d..b9852fe 100755
--- a/t/t1307-config-blob.sh
+++ b/t/t1307-config-blob.sh
@@ -63,7 +63,7 @@ test_expect_success 'parse errors in blobs are properly attributed' '
git commit -m broken &&
test_must_fail git config --blob=HEAD:config some.value 2>err &&
- test_i18ngrep "HEAD:config" err
+ test_grep "HEAD:config" err
'
test_expect_success 'can parse blob ending with CR' '
diff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh
index b38e158..3bfec07 100755
--- a/t/t1308-config-set.sh
+++ b/t/t1308-config-set.sh
@@ -58,6 +58,8 @@ test_expect_success 'setup default config' '
skin = false
nose = 1
horns
+ [value]
+ less
EOF
'
@@ -116,10 +118,53 @@ test_expect_success 'find value with the highest priority' '
check_config get_value case.baz "hask"
'
+test_expect_success 'return value for an existing key' '
+ test-tool config get lamb.chop >out 2>err &&
+ test_must_be_empty out &&
+ test_must_be_empty err
+'
+
+test_expect_success 'return value for value-less key' '
+ test-tool config get value.less >out 2>err &&
+ test_must_be_empty out &&
+ test_must_be_empty err
+'
+
+test_expect_success 'return value for a missing key' '
+ cat >expect <<-\EOF &&
+ Value not found for "missing.key"
+ EOF
+ test_expect_code 1 test-tool config get missing.key >actual 2>err &&
+ test_cmp actual expect &&
+ test_must_be_empty err
+'
+
+test_expect_success 'return value for a bad key: CONFIG_INVALID_KEY' '
+ cat >expect <<-\EOF &&
+ Key "fails.iskeychar.-" is invalid
+ EOF
+ test_expect_code 1 test-tool config get fails.iskeychar.- >actual 2>err &&
+ test_cmp actual expect &&
+ test_must_be_empty out
+'
+
+test_expect_success 'return value for a bad key: CONFIG_NO_SECTION_OR_NAME' '
+ cat >expect <<-\EOF &&
+ Key "keynosection" has no section
+ EOF
+ test_expect_code 1 test-tool config get keynosection >actual 2>err &&
+ test_cmp actual expect &&
+ test_must_be_empty out
+'
+
test_expect_success 'find integer value for a key' '
check_config get_int lamb.chop 65
'
+test_expect_success 'parse integer value during iteration' '
+ check_config git_config_int lamb.chop 65
+'
+
test_expect_success 'find string value for a key' '
check_config get_string case.baz hask &&
check_config expect_code 1 get_string case.ba "Value not found for \"case.ba\""
@@ -127,13 +172,18 @@ test_expect_success 'find string value for a key' '
test_expect_success 'check line error when NULL string is queried' '
test_expect_code 128 test-tool config get_string case.foo 2>result &&
- test_i18ngrep "fatal: .*case\.foo.*\.git/config.*line 7" result
+ test_grep "fatal: .*case\.foo.*\.git/config.*line 7" result
'
test_expect_success 'find integer if value is non parse-able' '
check_config expect_code 128 get_int lamb.head
'
+test_expect_success 'non parse-able integer value during iteration' '
+ check_config expect_code 128 git_config_int lamb.head 2>result &&
+ grep "fatal: bad numeric config value .* in file \.git/config" result
+'
+
test_expect_success 'find bool value for the entered key' '
check_config get_bool goat.head 1 &&
check_config get_bool goat.skin 0 &&
@@ -146,6 +196,71 @@ test_expect_success 'find multiple values' '
check_config get_value_multi case.baz sam bat hask
'
+test_NULL_in_multi () {
+ local op="$1" &&
+ local file="$2" &&
+
+ test_expect_success "$op: NULL value in config${file:+ in $file}" '
+ config="$file" &&
+ if test -z "$config"
+ then
+ config=.git/config &&
+ test_when_finished "mv $config.old $config" &&
+ mv "$config" "$config".old
+ fi &&
+
+ # Value-less in the middle of a list
+ cat >"$config" <<-\EOF &&
+ [a]key=x
+ [a]key
+ [a]key=y
+ EOF
+ case "$op" in
+ *_multi)
+ cat >expect <<-\EOF
+ x
+ (NULL)
+ y
+ EOF
+ ;;
+ *)
+ cat >expect <<-\EOF
+ y
+ EOF
+ ;;
+ esac &&
+ test-tool config "$op" a.key $file >actual &&
+ test_cmp expect actual &&
+
+ # Value-less at the end of a least
+ cat >"$config" <<-\EOF &&
+ [a]key=x
+ [a]key=y
+ [a]key
+ EOF
+ case "$op" in
+ *_multi)
+ cat >expect <<-\EOF
+ x
+ y
+ (NULL)
+ EOF
+ ;;
+ *)
+ cat >expect <<-\EOF
+ (NULL)
+ EOF
+ ;;
+ esac &&
+ test-tool config "$op" a.key $file >actual &&
+ test_cmp expect actual
+ '
+}
+
+test_NULL_in_multi "get_value_multi"
+test_NULL_in_multi "configset_get_value" "my.config"
+test_NULL_in_multi "configset_get_value_multi" "my.config"
+
test_expect_success 'find value from a configset' '
cat >config2 <<-\EOF &&
[case]
@@ -207,7 +322,7 @@ test_expect_success 'proper error on error in default config files' '
cp .git/config .git/config.old &&
test_when_finished "mv .git/config.old .git/config" &&
echo "[" >>.git/config &&
- echo "fatal: bad config line 34 in file .git/config" >expect &&
+ echo "fatal: bad config line 36 in file .git/config" >expect &&
test_expect_code 128 test-tool config get_value foo.bar 2>actual &&
test_cmp expect actual
'
@@ -227,14 +342,14 @@ test_expect_success 'check line errors for malformed values' '
br
EOF
test_expect_code 128 git br 2>result &&
- test_i18ngrep "missing value for .alias\.br" result &&
- test_i18ngrep "fatal: .*\.git/config" result &&
- test_i18ngrep "fatal: .*line 2" result
+ test_grep "missing value for .alias\.br" result &&
+ test_grep "fatal: .*\.git/config" result &&
+ test_grep "fatal: .*line 2" result
'
test_expect_success 'error on modifying repo config without repo' '
nongit test_must_fail git config a.b c 2>err &&
- test_i18ngrep "not in a git directory" err
+ test_grep "not in a git directory" err
'
cmdline_config="'foo.bar=from-cmdline'"
diff --git a/t/t1309-early-config.sh b/t/t1309-early-config.sh
index 537435b..523aa99 100755
--- a/t/t1309-early-config.sh
+++ b/t/t1309-early-config.sh
@@ -78,7 +78,7 @@ test_with_config () {
test_expect_success 'ignore .git/ with incompatible repository version' '
test_with_config "[core]repositoryformatversion = 999999" 2>err &&
- test_i18ngrep "warning:.* Expected git repo version <= [1-9]" err
+ test_grep "warning:.* Expected git repo version <= [1-9]" err
'
test_expect_failure 'ignore .git/ with invalid repository version' '
diff --git a/t/t1310-config-default.sh b/t/t1310-config-default.sh
index 09b10c1..1a90d31 100755
--- a/t/t1310-config-default.sh
+++ b/t/t1310-config-default.sh
@@ -26,12 +26,12 @@ test_expect_success 'canonicalizes --default with appropriate type' '
test_expect_success 'dies when --default cannot be parsed' '
test_must_fail git config -f config --type=expiry-date --default=x --get \
not.a.section 2>error &&
- test_i18ngrep "failed to format default config value" error
+ test_grep "failed to format default config value" error
'
test_expect_success 'does not allow --default without --get' '
test_must_fail git config --default=quux --unset a.section >output 2>&1 &&
- test_i18ngrep "\-\-default is only applicable to" output
+ test_grep "\-\-default is only applicable to" output
'
test_done
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index cf58cf0..ec3443c 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -9,8 +9,6 @@ test_description='Test git update-ref and basic ref logging'
Z=$ZERO_OID
m=refs/heads/main
-n_dir=refs/heads/gu
-n=$n_dir/fixes
outside=refs/foo
bare=bare-repo
@@ -62,10 +60,10 @@ test_expect_success "delete $m without oldvalue verification" '
test_must_fail git show-ref --verify -q $m
'
-test_expect_success "fail to create $n" '
- test_when_finished "rm -f .git/$n_dir" &&
- touch .git/$n_dir &&
- test_must_fail git update-ref $n $A
+test_expect_success "fail to create $n due to file/directory conflict" '
+ test_when_finished "git update-ref -d refs/heads/gu" &&
+ git update-ref refs/heads/gu $A &&
+ test_must_fail git update-ref refs/heads/gu/fixes $A
'
test_expect_success "create $m (by HEAD)" '
@@ -92,7 +90,8 @@ test_expect_success "deleting current branch adds message to HEAD's log" '
git symbolic-ref HEAD $m &&
git update-ref -m delete-$m -d $m &&
test_must_fail git show-ref --verify -q $m &&
- grep "delete-$m$" .git/logs/HEAD
+ test-tool ref-store main for-each-reflog-ent HEAD >actual &&
+ grep "delete-$m$" actual
'
test_expect_success "deleting by HEAD adds message to HEAD's log" '
@@ -101,7 +100,8 @@ test_expect_success "deleting by HEAD adds message to HEAD's log" '
git symbolic-ref HEAD $m &&
git update-ref -m delete-by-head -d HEAD &&
test_must_fail git show-ref --verify -q $m &&
- grep "delete-by-head$" .git/logs/HEAD
+ test-tool ref-store main for-each-reflog-ent HEAD >actual &&
+ grep "delete-by-head$" actual
'
test_expect_success 'update-ref does not create reflogs by default' '
@@ -132,7 +132,7 @@ test_expect_success 'creates no reflog in bare repository' '
test_expect_success 'core.logAllRefUpdates=true creates reflog in bare repository' '
test_when_finished "git -C $bare config --unset core.logAllRefUpdates && \
- rm $bare/logs/$m" &&
+ test-tool ref-store main delete-reflog $m" &&
git -C $bare config core.logAllRefUpdates true &&
git -C $bare update-ref $m $bareB &&
git -C $bare rev-parse $bareB >expect &&
@@ -221,27 +221,27 @@ test_expect_success 'delete symref without dereference when the referred ref is
'
test_expect_success 'update-ref -d is not confused by self-reference' '
+ test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF refs/heads/self" &&
git symbolic-ref refs/heads/self refs/heads/self &&
- test_when_finished "rm -f .git/refs/heads/self" &&
- test_path_is_file .git/refs/heads/self &&
+ git symbolic-ref --no-recurse refs/heads/self &&
test_must_fail git update-ref -d refs/heads/self &&
- test_path_is_file .git/refs/heads/self
+ git symbolic-ref --no-recurse refs/heads/self
'
test_expect_success 'update-ref --no-deref -d can delete self-reference' '
+ test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF refs/heads/self" &&
git symbolic-ref refs/heads/self refs/heads/self &&
- test_when_finished "rm -f .git/refs/heads/self" &&
- test_path_is_file .git/refs/heads/self &&
+ git symbolic-ref --no-recurse refs/heads/self &&
git update-ref --no-deref -d refs/heads/self &&
test_must_fail git show-ref --verify -q refs/heads/self
'
-test_expect_success 'update-ref --no-deref -d can delete reference to bad ref' '
+test_expect_success REFFILES 'update-ref --no-deref -d can delete reference to bad ref' '
>.git/refs/heads/bad &&
test_when_finished "rm -f .git/refs/heads/bad" &&
git symbolic-ref refs/heads/ref-to-bad refs/heads/bad &&
test_when_finished "git update-ref -d refs/heads/ref-to-bad" &&
- test_path_is_file .git/refs/heads/ref-to-bad &&
+ git symbolic-ref --no-recurse refs/heads/ref-to-bad &&
git update-ref --no-deref -d refs/heads/ref-to-bad &&
test_must_fail git show-ref --verify -q refs/heads/ref-to-bad
'
@@ -265,7 +265,10 @@ test_expect_success "(not) changed .git/$m" '
! test $B = $(git show-ref -s --verify $m)
'
-rm -f .git/logs/refs/heads/main
+test_expect_success "clean up reflog" '
+ test-tool ref-store main delete-reflog $m
+'
+
test_expect_success "create $m (logged by touch)" '
test_config core.logAllRefUpdates false &&
GIT_COMMITTER_DATE="2005-05-26 23:30" \
@@ -285,40 +288,13 @@ test_expect_success "set $m (logged by touch)" '
test $A = $(git show-ref -s --verify $m)
'
-test_expect_success 'empty directory removal' '
- git branch d1/d2/r1 HEAD &&
- git branch d1/r2 HEAD &&
- test_path_is_file .git/refs/heads/d1/d2/r1 &&
- test_path_is_file .git/logs/refs/heads/d1/d2/r1 &&
- git branch -d d1/d2/r1 &&
- test_must_fail git show-ref --verify -q refs/heads/d1/d2 &&
- test_must_fail git show-ref --verify -q logs/refs/heads/d1/d2 &&
- test_path_is_file .git/refs/heads/d1/r2 &&
- test_path_is_file .git/logs/refs/heads/d1/r2
-'
-
-test_expect_success 'symref empty directory removal' '
- git branch e1/e2/r1 HEAD &&
- git branch e1/r2 HEAD &&
- git checkout e1/e2/r1 &&
- test_when_finished "git checkout main" &&
- test_path_is_file .git/refs/heads/e1/e2/r1 &&
- test_path_is_file .git/logs/refs/heads/e1/e2/r1 &&
- git update-ref -d HEAD &&
- test_must_fail git show-ref --verify -q refs/heads/e1/e2 &&
- test_must_fail git show-ref --verify -q logs/refs/heads/e1/e2 &&
- test_path_is_file .git/refs/heads/e1/r2 &&
- test_path_is_file .git/logs/refs/heads/e1/r2 &&
- test_path_is_file .git/logs/HEAD
-'
-
cat >expect <<EOF
$Z $A $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 Initial Creation
$A $B $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150260 +0000 Switch
$B $A $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150860 +0000
EOF
test_expect_success "verifying $m's log (logged by touch)" '
- test_when_finished "git update-ref -d $m && rm -rf .git/logs actual expect" &&
+ test_when_finished "git update-ref -d $m && git reflog expire --expire=all --all && rm -rf actual expect" &&
test-tool ref-store main for-each-reflog-ent $m >actual &&
test_cmp actual expect
'
@@ -348,20 +324,34 @@ $A $B $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150380 +0000 Switch
$B $A $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150980 +0000
EOF
test_expect_success "verifying $m's log (logged by config)" '
- test_when_finished "git update-ref -d $m && rm -rf .git/logs actual expect" &&
+ test_when_finished "git update-ref -d $m && git reflog expire --expire=all --all && rm -rf actual expect" &&
test-tool ref-store main for-each-reflog-ent $m >actual &&
test_cmp actual expect
'
test_expect_success 'set up for querying the reflog' '
+ git update-ref -d $m &&
+ test-tool ref-store main delete-reflog $m &&
+
+ GIT_COMMITTER_DATE="1117150320 -0500" git update-ref $m $C &&
+ GIT_COMMITTER_DATE="1117150350 -0500" git update-ref $m $A &&
+ GIT_COMMITTER_DATE="1117150380 -0500" git update-ref $m $B &&
+ GIT_COMMITTER_DATE="1117150680 -0500" git update-ref $m $F &&
+ GIT_COMMITTER_DATE="1117150980 -0500" git update-ref $m $E &&
git update-ref $m $D &&
- cat >.git/logs/$m <<-EOF
+ # Delete the last reflog entry so that the tip of m and the reflog for
+ # it disagree.
+ git reflog delete $m@{0} &&
+
+ cat >expect <<-EOF &&
$Z $C $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150320 -0500
$C $A $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150350 -0500
$A $B $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150380 -0500
- $F $Z $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150680 -0500
- $Z $E $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150980 -0500
+ $B $F $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150680 -0500
+ $F $E $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150980 -0500
EOF
+ test-tool ref-store main for-each-reflog-ent $m >actual &&
+ test_cmp expect actual
'
ed="Thu, 26 May 2005 18:32:00 -0500"
@@ -409,13 +399,12 @@ test_expect_success 'Query "main@{2005-05-26 23:33:01}" (middle of history with
test_when_finished "rm -f o e" &&
git rev-parse --verify "main@{2005-05-26 23:33:01}" >o 2>e &&
echo "$B" >expect &&
- test_cmp expect o &&
- test_i18ngrep -F "warning: log for ref $m has gap after $gd" e
+ test_cmp expect o
'
test_expect_success 'Query "main@{2005-05-26 23:38:00}" (middle of history)' '
test_when_finished "rm -f o e" &&
git rev-parse --verify "main@{2005-05-26 23:38:00}" >o 2>e &&
- echo "$Z" >expect &&
+ echo "$F" >expect &&
test_cmp expect o &&
test_must_be_empty e
'
@@ -431,10 +420,27 @@ test_expect_success 'Query "main@{2005-05-28}" (past end of history)' '
git rev-parse --verify "main@{2005-05-28}" >o 2>e &&
echo "$D" >expect &&
test_cmp expect o &&
- test_i18ngrep -F "warning: log for ref $m unexpectedly ended on $ld" e
+ test_grep -F "warning: log for ref $m unexpectedly ended on $ld" e
'
-rm -f .git/$m .git/logs/$m expect
+rm -f expect
+git update-ref -d $m
+
+test_expect_success 'query reflog with gap' '
+ test_when_finished "git update-ref -d $m" &&
+
+ GIT_COMMITTER_DATE="1117150320 -0500" git update-ref $m $A &&
+ GIT_COMMITTER_DATE="1117150380 -0500" git update-ref $m $B &&
+ GIT_COMMITTER_DATE="1117150480 -0500" git update-ref $m $C &&
+ GIT_COMMITTER_DATE="1117150580 -0500" git update-ref $m $D &&
+ GIT_COMMITTER_DATE="1117150680 -0500" git update-ref $m $F &&
+ git reflog delete $m@{2} &&
+
+ git rev-parse --verify "main@{2005-05-26 23:33:01}" >actual 2>stderr &&
+ echo "$B" >expect &&
+ test_cmp expect actual &&
+ test_grep -F "warning: log for ref $m has gap after $gd" stderr
+'
test_expect_success 'creating initial files' '
test_when_finished rm -f M &&
@@ -486,57 +492,57 @@ test_expect_success 'git cat-file blob main@{2005-05-26 23:42}:F (expect OTHER)'
test_expect_success 'given old value for missing pseudoref, do not create' '
test_must_fail git update-ref PSEUDOREF $A $B 2>err &&
test_must_fail git rev-parse PSEUDOREF &&
- test_i18ngrep "unable to resolve reference" err
+ test_grep "unable to resolve reference" err
'
test_expect_success 'create pseudoref' '
git update-ref PSEUDOREF $A &&
- test $A = $(git rev-parse PSEUDOREF)
+ test $A = $(git show-ref -s --verify PSEUDOREF)
'
test_expect_success 'overwrite pseudoref with no old value given' '
git update-ref PSEUDOREF $B &&
- test $B = $(git rev-parse PSEUDOREF)
+ test $B = $(git show-ref -s --verify PSEUDOREF)
'
test_expect_success 'overwrite pseudoref with correct old value' '
git update-ref PSEUDOREF $C $B &&
- test $C = $(git rev-parse PSEUDOREF)
+ test $C = $(git show-ref -s --verify PSEUDOREF)
'
test_expect_success 'do not overwrite pseudoref with wrong old value' '
test_must_fail git update-ref PSEUDOREF $D $E 2>err &&
- test $C = $(git rev-parse PSEUDOREF) &&
- test_i18ngrep "cannot lock ref.*expected" err
+ test $C = $(git show-ref -s --verify PSEUDOREF) &&
+ test_grep "cannot lock ref.*expected" err
'
test_expect_success 'delete pseudoref' '
git update-ref -d PSEUDOREF &&
- test_must_fail git rev-parse PSEUDOREF
+ test_must_fail git show-ref -s --verify PSEUDOREF
'
test_expect_success 'do not delete pseudoref with wrong old value' '
git update-ref PSEUDOREF $A &&
test_must_fail git update-ref -d PSEUDOREF $B 2>err &&
- test $A = $(git rev-parse PSEUDOREF) &&
- test_i18ngrep "cannot lock ref.*expected" err
+ test $A = $(git show-ref -s --verify PSEUDOREF) &&
+ test_grep "cannot lock ref.*expected" err
'
test_expect_success 'delete pseudoref with correct old value' '
git update-ref -d PSEUDOREF $A &&
- test_must_fail git rev-parse PSEUDOREF
+ test_must_fail git show-ref -s --verify PSEUDOREF
'
test_expect_success 'create pseudoref with old OID zero' '
git update-ref PSEUDOREF $A $Z &&
- test $A = $(git rev-parse PSEUDOREF)
+ test $A = $(git show-ref -s --verify PSEUDOREF)
'
test_expect_success 'do not overwrite pseudoref with old OID zero' '
test_when_finished git update-ref -d PSEUDOREF &&
test_must_fail git update-ref PSEUDOREF $B $Z 2>err &&
- test $A = $(git rev-parse PSEUDOREF) &&
- test_i18ngrep "already exists" err
+ test $A = $(git show-ref -s --verify PSEUDOREF) &&
+ test_grep "already exists" err
'
# Test --stdin
@@ -556,7 +562,7 @@ test_expect_success 'stdin test setup' '
test_expect_success '-z fails without --stdin' '
test_must_fail git update-ref -z $m $m $m 2>err &&
- test_i18ngrep "usage: git update-ref" err
+ test_grep "usage: git update-ref" err
'
test_expect_success 'stdin works with no input' '
@@ -616,7 +622,7 @@ test_expect_success 'stdin fails create with no ref' '
test_expect_success 'stdin fails create with no new value' '
echo "create $a" >stdin &&
test_must_fail git update-ref --stdin <stdin 2>err &&
- grep "fatal: create $a: missing <newvalue>" err
+ grep "fatal: create $a: missing <new-oid>" err
'
test_expect_success 'stdin fails create with too many arguments' '
@@ -634,7 +640,7 @@ test_expect_success 'stdin fails update with no ref' '
test_expect_success 'stdin fails update with no new value' '
echo "update $a" >stdin &&
test_must_fail git update-ref --stdin <stdin 2>err &&
- grep "fatal: update $a: missing <newvalue>" err
+ grep "fatal: update $a: missing <new-oid>" err
'
test_expect_success 'stdin fails update with too many arguments' '
@@ -674,7 +680,7 @@ test_expect_success 'stdin fails with duplicate refs' '
create $a $m
EOF
test_must_fail git update-ref --stdin <stdin 2>err &&
- test_i18ngrep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err
+ test_grep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err
'
test_expect_success 'stdin create ref works' '
@@ -759,21 +765,21 @@ test_expect_success 'stdin update ref fails with wrong old value' '
test_expect_success 'stdin update ref fails with bad old value' '
echo "update $c $m does-not-exist" >stdin &&
test_must_fail git update-ref --stdin <stdin 2>err &&
- grep "fatal: update $c: invalid <oldvalue>: does-not-exist" err &&
+ grep "fatal: update $c: invalid <old-oid>: does-not-exist" err &&
test_must_fail git rev-parse --verify -q $c
'
test_expect_success 'stdin create ref fails with bad new value' '
echo "create $c does-not-exist" >stdin &&
test_must_fail git update-ref --stdin <stdin 2>err &&
- grep "fatal: create $c: invalid <newvalue>: does-not-exist" err &&
+ grep "fatal: create $c: invalid <new-oid>: does-not-exist" err &&
test_must_fail git rev-parse --verify -q $c
'
test_expect_success 'stdin create ref fails with zero new value' '
echo "create $c " >stdin &&
test_must_fail git update-ref --stdin <stdin 2>err &&
- grep "fatal: create $c: zero <newvalue>" err &&
+ grep "fatal: create $c: zero <new-oid>" err &&
test_must_fail git rev-parse --verify -q $c
'
@@ -797,7 +803,7 @@ test_expect_success 'stdin delete ref fails with wrong old value' '
test_expect_success 'stdin delete ref fails with zero old value' '
echo "delete $a " >stdin &&
test_must_fail git update-ref --stdin <stdin 2>err &&
- grep "fatal: delete $a: zero <oldvalue>" err &&
+ grep "fatal: delete $a: zero <old-oid>" err &&
git rev-parse $m >expect &&
git rev-parse $a >actual &&
test_cmp expect actual
@@ -1021,7 +1027,7 @@ test_expect_success 'stdin -z fails create with no ref' '
test_expect_success 'stdin -z fails create with no new value' '
printf $F "create $a" >stdin &&
test_must_fail git update-ref -z --stdin <stdin 2>err &&
- grep "fatal: create $a: unexpected end of input when reading <newvalue>" err
+ grep "fatal: create $a: unexpected end of input when reading <new-oid>" err
'
test_expect_success 'stdin -z fails create with too many arguments' '
@@ -1039,27 +1045,27 @@ test_expect_success 'stdin -z fails update with no ref' '
test_expect_success 'stdin -z fails update with too few args' '
printf $F "update $a" "$m" >stdin &&
test_must_fail git update-ref -z --stdin <stdin 2>err &&
- grep "fatal: update $a: unexpected end of input when reading <oldvalue>" err
+ grep "fatal: update $a: unexpected end of input when reading <old-oid>" err
'
test_expect_success 'stdin -z emits warning with empty new value' '
git update-ref $a $m &&
printf $F "update $a" "" "" >stdin &&
git update-ref -z --stdin <stdin 2>err &&
- grep "warning: update $a: missing <newvalue>, treating as zero" err &&
+ grep "warning: update $a: missing <new-oid>, treating as zero" err &&
test_must_fail git rev-parse --verify -q $a
'
test_expect_success 'stdin -z fails update with no new value' '
printf $F "update $a" >stdin &&
test_must_fail git update-ref -z --stdin <stdin 2>err &&
- grep "fatal: update $a: unexpected end of input when reading <newvalue>" err
+ grep "fatal: update $a: unexpected end of input when reading <new-oid>" err
'
test_expect_success 'stdin -z fails update with no old value' '
printf $F "update $a" "$m" >stdin &&
test_must_fail git update-ref -z --stdin <stdin 2>err &&
- grep "fatal: update $a: unexpected end of input when reading <oldvalue>" err
+ grep "fatal: update $a: unexpected end of input when reading <old-oid>" err
'
test_expect_success 'stdin -z fails update with too many arguments' '
@@ -1077,7 +1083,7 @@ test_expect_success 'stdin -z fails delete with no ref' '
test_expect_success 'stdin -z fails delete with no old value' '
printf $F "delete $a" >stdin &&
test_must_fail git update-ref -z --stdin <stdin 2>err &&
- grep "fatal: delete $a: unexpected end of input when reading <oldvalue>" err
+ grep "fatal: delete $a: unexpected end of input when reading <old-oid>" err
'
test_expect_success 'stdin -z fails delete with too many arguments' '
@@ -1095,7 +1101,7 @@ test_expect_success 'stdin -z fails verify with too many arguments' '
test_expect_success 'stdin -z fails verify with no old value' '
printf $F "verify $a" >stdin &&
test_must_fail git update-ref -z --stdin <stdin 2>err &&
- grep "fatal: verify $a: unexpected end of input when reading <oldvalue>" err
+ grep "fatal: verify $a: unexpected end of input when reading <old-oid>" err
'
test_expect_success 'stdin -z fails option with unknown name' '
@@ -1107,7 +1113,7 @@ test_expect_success 'stdin -z fails option with unknown name' '
test_expect_success 'stdin -z fails with duplicate refs' '
printf $F "create $a" "$m" "create $b" "$m" "create $a" "$m" >stdin &&
test_must_fail git update-ref -z --stdin <stdin 2>err &&
- test_i18ngrep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err
+ test_grep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err
'
test_expect_success 'stdin -z create ref works' '
@@ -1154,7 +1160,7 @@ test_expect_success 'stdin -z update ref fails with wrong old value' '
test_expect_success 'stdin -z update ref fails with bad old value' '
printf $F "update $c" "$m" "does-not-exist" >stdin &&
test_must_fail git update-ref -z --stdin <stdin 2>err &&
- grep "fatal: update $c: invalid <oldvalue>: does-not-exist" err &&
+ grep "fatal: update $c: invalid <old-oid>: does-not-exist" err &&
test_must_fail git rev-parse --verify -q $c
'
@@ -1172,14 +1178,14 @@ test_expect_success 'stdin -z create ref fails with bad new value' '
git update-ref -d "$c" &&
printf $F "create $c" "does-not-exist" >stdin &&
test_must_fail git update-ref -z --stdin <stdin 2>err &&
- grep "fatal: create $c: invalid <newvalue>: does-not-exist" err &&
+ grep "fatal: create $c: invalid <new-oid>: does-not-exist" err &&
test_must_fail git rev-parse --verify -q $c
'
test_expect_success 'stdin -z create ref fails with empty new value' '
printf $F "create $c" "" >stdin &&
test_must_fail git update-ref -z --stdin <stdin 2>err &&
- grep "fatal: create $c: missing <newvalue>" err &&
+ grep "fatal: create $c: missing <new-oid>" err &&
test_must_fail git rev-parse --verify -q $c
'
@@ -1203,7 +1209,7 @@ test_expect_success 'stdin -z delete ref fails with wrong old value' '
test_expect_success 'stdin -z delete ref fails with zero old value' '
printf $F "delete $a" "$Z" >stdin &&
test_must_fail git update-ref -z --stdin <stdin 2>err &&
- grep "fatal: delete $a: zero <oldvalue>" err &&
+ grep "fatal: delete $a: zero <old-oid>" err &&
git rev-parse $m >expect &&
git rev-parse $a >actual &&
test_cmp expect actual
@@ -1338,7 +1344,7 @@ test_expect_success 'fails with duplicate HEAD update' '
update HEAD $B
EOF
test_must_fail git update-ref --stdin <stdin 2>err &&
- test_i18ngrep "fatal: multiple updates for '\''HEAD'\'' (including one via its referent .refs/heads/target1.) are not allowed" err &&
+ test_grep "fatal: multiple updates for '\''HEAD'\'' (including one via its referent .refs/heads/target1.) are not allowed" err &&
echo "refs/heads/target1" >expect &&
git symbolic-ref HEAD >actual &&
test_cmp expect actual &&
@@ -1355,7 +1361,7 @@ test_expect_success 'fails with duplicate ref update via symref' '
update refs/heads/symref2 $B
EOF
test_must_fail git update-ref --stdin <stdin 2>err &&
- test_i18ngrep "fatal: multiple updates for '\''refs/heads/target2'\'' (including one via symref .refs/heads/symref2.) are not allowed" err &&
+ test_grep "fatal: multiple updates for '\''refs/heads/target2'\'' (including one via symref .refs/heads/symref2.) are not allowed" err &&
echo "refs/heads/target2" >expect &&
git symbolic-ref refs/heads/symref2 >actual &&
test_cmp expect actual &&
@@ -1568,6 +1574,7 @@ test_expect_success 'transaction can create and delete' '
EOF
git update-ref --stdin <stdin >actual &&
printf "%s: ok\n" start commit start commit >expect &&
+ test_cmp expect actual &&
test_must_fail git show-ref --verify refs/heads/create-and-delete
'
@@ -1595,6 +1602,8 @@ test_expect_success 'transaction cannot restart ongoing transaction' '
commit
EOF
test_must_fail git update-ref --stdin <stdin >actual &&
+ printf "%s: ok\n" start >expect &&
+ test_cmp expect actual &&
test_must_fail git show-ref --verify refs/heads/restart
'
@@ -1632,13 +1641,4 @@ test_expect_success PIPE 'transaction flushes status updates' '
test_cmp expected actual
'
-test_expect_success 'directory not created deleting packed ref' '
- git branch d1/d2/r1 HEAD &&
- git pack-refs --all &&
- test_path_is_missing .git/refs/heads/d1/d2 &&
- git update-ref -d refs/heads/d1/d2/r1 &&
- test_path_is_missing .git/refs/heads/d1/d2 &&
- test_path_is_missing .git/refs/heads/d1
-'
-
test_done
diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh
index 9fb0b90..5c60d6f 100755
--- a/t/t1401-symbolic-ref.sh
+++ b/t/t1401-symbolic-ref.sh
@@ -33,7 +33,8 @@ test_expect_success 'symbolic-ref refuses non-ref for HEAD' '
reset_to_sane
test_expect_success 'symbolic-ref refuses bare sha1' '
- test_must_fail git symbolic-ref HEAD $(git rev-parse HEAD)
+ rev=$(git rev-parse HEAD) &&
+ test_must_fail git symbolic-ref HEAD "$rev"
'
reset_to_sane
@@ -105,9 +106,8 @@ test_expect_success LONG_REF 'we can parse long symbolic ref' '
'
test_expect_success 'symbolic-ref reports failure in exit code' '
- test_when_finished "rm -f .git/HEAD.lock" &&
- >.git/HEAD.lock &&
- test_must_fail git symbolic-ref HEAD refs/heads/whatever
+ # Create d/f conflict to simulate failure.
+ test_must_fail git symbolic-ref refs/heads refs/heads/foo
'
test_expect_success 'symbolic-ref writes reflog entry' '
@@ -165,4 +165,62 @@ test_expect_success 'symbolic-ref can resolve d/f name (ENOTDIR)' '
test_cmp expect actual
'
+test_expect_success 'symbolic-ref refuses invalid target for non-HEAD' '
+ test_must_fail git symbolic-ref refs/heads/invalid foo..bar
+'
+
+test_expect_success 'symbolic-ref allows top-level target for non-HEAD' '
+ git symbolic-ref refs/heads/top-level ORIG_HEAD &&
+ git update-ref ORIG_HEAD HEAD &&
+ test_cmp_rev top-level HEAD
+'
+
+test_expect_success 'symbolic-ref pointing at another' '
+ git update-ref refs/heads/maint-2.37 HEAD &&
+ git symbolic-ref refs/heads/maint refs/heads/maint-2.37 &&
+ git checkout maint &&
+
+ git symbolic-ref HEAD >actual &&
+ echo refs/heads/maint-2.37 >expect &&
+ test_cmp expect actual &&
+
+ git symbolic-ref --no-recurse HEAD >actual &&
+ echo refs/heads/maint >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'symbolic-ref --short handles complex utf8 case' '
+ name="测试-加-增加-加-增加" &&
+ git symbolic-ref TEST_SYMREF "refs/heads/$name" &&
+ # In the real world, we saw problems with this case only
+ # when the locale includes UTF-8. Set it here to try to make things as
+ # hard as possible for us to pass, but in practice we should do the
+ # right thing regardless (and of course some platforms may not even
+ # have this locale).
+ LC_ALL=en_US.UTF-8 git symbolic-ref --short TEST_SYMREF >actual &&
+ echo "$name" >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'symbolic-ref --short handles name with suffix' '
+ git symbolic-ref TEST_SYMREF "refs/remotes/origin/HEAD" &&
+ git symbolic-ref --short TEST_SYMREF >actual &&
+ echo "origin" >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'symbolic-ref --short handles almost-matching name' '
+ git symbolic-ref TEST_SYMREF "refs/headsXfoo" &&
+ git symbolic-ref --short TEST_SYMREF >actual &&
+ echo "headsXfoo" >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'symbolic-ref --short handles name with percent' '
+ git symbolic-ref TEST_SYMREF "refs/heads/%foo" &&
+ git symbolic-ref --short TEST_SYMREF >actual &&
+ echo "%foo" >expect &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh
index cabc516..5ed9d73 100755
--- a/t/t1402-check-ref-format.sh
+++ b/t/t1402-check-ref-format.sh
@@ -2,6 +2,7 @@
test_description='Test git check-ref-format'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
valid_ref() {
diff --git a/t/t1403-show-ref.sh b/t/t1403-show-ref.sh
index 9252a58..33fb7a3 100755
--- a/t/t1403-show-ref.sh
+++ b/t/t1403-show-ref.sh
@@ -174,6 +174,14 @@ test_expect_success 'show-ref --verify HEAD' '
test_must_be_empty actual
'
+test_expect_success 'show-ref --verify pseudorefs' '
+ git update-ref CHERRY_PICK_HEAD HEAD $ZERO_OID &&
+ test_when_finished "git update-ref -d CHERRY_PICK_HEAD" &&
+ git show-ref -s --verify HEAD >actual &&
+ git show-ref -s --verify CHERRY_PICK_HEAD >expect &&
+ test_cmp actual expect
+'
+
test_expect_success 'show-ref --verify with dangling ref' '
sha1_file() {
echo "$*" | sed "s#..#.git/objects/&/#"
@@ -196,4 +204,86 @@ test_expect_success 'show-ref --verify with dangling ref' '
)
'
+test_expect_success 'show-ref sub-modes are mutually exclusive' '
+ test_must_fail git show-ref --verify --exclude-existing 2>err &&
+ grep "verify" err &&
+ grep "exclude-existing" err &&
+ grep "cannot be used together" err &&
+
+ test_must_fail git show-ref --verify --exists 2>err &&
+ grep "verify" err &&
+ grep "exists" err &&
+ grep "cannot be used together" err &&
+
+ test_must_fail git show-ref --exclude-existing --exists 2>err &&
+ grep "exclude-existing" err &&
+ grep "exists" err &&
+ grep "cannot be used together" err
+'
+
+test_expect_success '--exists with existing reference' '
+ git show-ref --exists refs/heads/$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+'
+
+test_expect_success '--exists with missing reference' '
+ test_expect_code 2 git show-ref --exists refs/heads/does-not-exist
+'
+
+test_expect_success '--exists does not use DWIM' '
+ test_expect_code 2 git show-ref --exists $GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME 2>err &&
+ grep "reference does not exist" err
+'
+
+test_expect_success '--exists with HEAD' '
+ git show-ref --exists HEAD
+'
+
+test_expect_success '--exists with bad reference name' '
+ test_when_finished "git update-ref -d refs/heads/bad...name" &&
+ new_oid=$(git rev-parse HEAD) &&
+ test-tool ref-store main update-ref msg refs/heads/bad...name $new_oid $ZERO_OID REF_SKIP_REFNAME_VERIFICATION &&
+ git show-ref --exists refs/heads/bad...name
+'
+
+test_expect_success '--exists with arbitrary symref' '
+ test_when_finished "git symbolic-ref -d refs/symref" &&
+ git symbolic-ref refs/symref refs/heads/$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME &&
+ git show-ref --exists refs/symref
+'
+
+test_expect_success '--exists with dangling symref' '
+ test_when_finished "git symbolic-ref -d refs/heads/dangling" &&
+ git symbolic-ref refs/heads/dangling refs/heads/does-not-exist &&
+ git show-ref --exists refs/heads/dangling
+'
+
+test_expect_success '--exists with nonexistent object ID' '
+ test-tool ref-store main update-ref msg refs/heads/missing-oid $(test_oid 001) $ZERO_OID REF_SKIP_OID_VERIFICATION &&
+ git show-ref --exists refs/heads/missing-oid
+'
+
+test_expect_success '--exists with non-commit object' '
+ tree_oid=$(git rev-parse HEAD^{tree}) &&
+ test-tool ref-store main update-ref msg refs/heads/tree ${tree_oid} $ZERO_OID REF_SKIP_OID_VERIFICATION &&
+ git show-ref --exists refs/heads/tree
+'
+
+test_expect_success '--exists with directory fails with generic error' '
+ cat >expect <<-EOF &&
+ error: reference does not exist
+ EOF
+ test_expect_code 2 git show-ref --exists refs/heads 2>err &&
+ test_cmp expect err
+'
+
+test_expect_success '--exists with non-existent special ref' '
+ test_expect_code 2 git show-ref --exists FETCH_HEAD
+'
+
+test_expect_success '--exists with existing special ref' '
+ test_when_finished "rm .git/FETCH_HEAD" &&
+ git rev-parse HEAD >.git/FETCH_HEAD &&
+ git show-ref --exists FETCH_HEAD
+'
+
test_done
diff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh
index 13c2b43..98e9158 100755
--- a/t/t1404-update-ref-errors.sh
+++ b/t/t1404-update-ref-errors.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='Test git update-ref error handling'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# Create some references, perhaps run pack-refs --all, then try to
@@ -27,7 +29,7 @@ test_update_rejected () {
fi &&
printf "create $prefix/%s $C\n" $create >input &&
test_must_fail git update-ref --stdin <input 2>output.err &&
- test_i18ngrep -F "$error" output.err &&
+ test_grep -F "$error" output.err &&
git for-each-ref $prefix >actual &&
test_cmp unchanged actual
}
@@ -90,9 +92,6 @@ df_test() {
else
delname="$delref"
fi &&
- cat >expected-err <<-EOF &&
- fatal: cannot lock ref $SQ$addname$SQ: $SQ$delref$SQ exists; cannot create $SQ$addref$SQ
- EOF
$pack &&
if $add_del
then
@@ -101,7 +100,7 @@ df_test() {
printf "%s\n" "delete $delname" "create $addname $D"
fi >commands &&
test_must_fail git update-ref --stdin <commands 2>output.err &&
- test_cmp expected-err output.err &&
+ grep "fatal:\( cannot lock ref $SQ$addname$SQ:\)\? $SQ$delref$SQ exists; cannot create $SQ$addref$SQ" output.err &&
printf "%s\n" "$C $delref" >expected-refs &&
git for-each-ref --format="%(objectname) %(refname)" $prefix/r >actual-refs &&
test_cmp expected-refs actual-refs
@@ -189,141 +188,69 @@ test_expect_success 'one new ref is a simple prefix of another' '
'
-test_expect_success REFFILES 'empty directory should not fool rev-parse' '
- prefix=refs/e-rev-parse &&
- git update-ref $prefix/foo $C &&
- git pack-refs --all &&
- mkdir -p .git/$prefix/foo/bar/baz &&
- echo "$C" >expected &&
- git rev-parse $prefix/foo >actual &&
- test_cmp expected actual
-'
-
-test_expect_success REFFILES 'empty directory should not fool for-each-ref' '
- prefix=refs/e-for-each-ref &&
- git update-ref $prefix/foo $C &&
- git for-each-ref $prefix >expected &&
- git pack-refs --all &&
- mkdir -p .git/$prefix/foo/bar/baz &&
- git for-each-ref $prefix >actual &&
- test_cmp expected actual
-'
-
-test_expect_success REFFILES 'empty directory should not fool create' '
- prefix=refs/e-create &&
- mkdir -p .git/$prefix/foo/bar/baz &&
- printf "create %s $C\n" $prefix/foo |
- git update-ref --stdin
-'
-
-test_expect_success REFFILES 'empty directory should not fool verify' '
- prefix=refs/e-verify &&
- git update-ref $prefix/foo $C &&
- git pack-refs --all &&
- mkdir -p .git/$prefix/foo/bar/baz &&
- printf "verify %s $C\n" $prefix/foo |
- git update-ref --stdin
-'
-
-test_expect_success REFFILES 'empty directory should not fool 1-arg update' '
- prefix=refs/e-update-1 &&
- git update-ref $prefix/foo $C &&
- git pack-refs --all &&
- mkdir -p .git/$prefix/foo/bar/baz &&
- printf "update %s $D\n" $prefix/foo |
- git update-ref --stdin
-'
-
-test_expect_success REFFILES 'empty directory should not fool 2-arg update' '
- prefix=refs/e-update-2 &&
- git update-ref $prefix/foo $C &&
- git pack-refs --all &&
- mkdir -p .git/$prefix/foo/bar/baz &&
- printf "update %s $D $C\n" $prefix/foo |
- git update-ref --stdin
-'
-
-test_expect_success REFFILES 'empty directory should not fool 0-arg delete' '
- prefix=refs/e-delete-0 &&
- git update-ref $prefix/foo $C &&
- git pack-refs --all &&
- mkdir -p .git/$prefix/foo/bar/baz &&
- printf "delete %s\n" $prefix/foo |
- git update-ref --stdin
-'
-
-test_expect_success REFFILES 'empty directory should not fool 1-arg delete' '
- prefix=refs/e-delete-1 &&
- git update-ref $prefix/foo $C &&
- git pack-refs --all &&
- mkdir -p .git/$prefix/foo/bar/baz &&
- printf "delete %s $C\n" $prefix/foo |
- git update-ref --stdin
-'
-
-test_expect_success REFFILES 'D/F conflict prevents add long + delete short' '
+test_expect_success 'D/F conflict prevents add long + delete short' '
df_test refs/df-al-ds --add-del foo/bar foo
'
-test_expect_success REFFILES 'D/F conflict prevents add short + delete long' '
+test_expect_success 'D/F conflict prevents add short + delete long' '
df_test refs/df-as-dl --add-del foo foo/bar
'
-test_expect_success REFFILES 'D/F conflict prevents delete long + add short' '
+test_expect_success 'D/F conflict prevents delete long + add short' '
df_test refs/df-dl-as --del-add foo/bar foo
'
-test_expect_success REFFILES 'D/F conflict prevents delete short + add long' '
+test_expect_success 'D/F conflict prevents delete short + add long' '
df_test refs/df-ds-al --del-add foo foo/bar
'
-test_expect_success REFFILES 'D/F conflict prevents add long + delete short packed' '
+test_expect_success 'D/F conflict prevents add long + delete short packed' '
df_test refs/df-al-dsp --pack --add-del foo/bar foo
'
-test_expect_success REFFILES 'D/F conflict prevents add short + delete long packed' '
+test_expect_success 'D/F conflict prevents add short + delete long packed' '
df_test refs/df-as-dlp --pack --add-del foo foo/bar
'
-test_expect_success REFFILES 'D/F conflict prevents delete long packed + add short' '
+test_expect_success 'D/F conflict prevents delete long packed + add short' '
df_test refs/df-dlp-as --pack --del-add foo/bar foo
'
-test_expect_success REFFILES 'D/F conflict prevents delete short packed + add long' '
+test_expect_success 'D/F conflict prevents delete short packed + add long' '
df_test refs/df-dsp-al --pack --del-add foo foo/bar
'
# Try some combinations involving symbolic refs...
-test_expect_success REFFILES 'D/F conflict prevents indirect add long + delete short' '
+test_expect_success 'D/F conflict prevents indirect add long + delete short' '
df_test refs/df-ial-ds --sym-add --add-del foo/bar foo
'
-test_expect_success REFFILES 'D/F conflict prevents indirect add long + indirect delete short' '
+test_expect_success 'D/F conflict prevents indirect add long + indirect delete short' '
df_test refs/df-ial-ids --sym-add --sym-del --add-del foo/bar foo
'
-test_expect_success REFFILES 'D/F conflict prevents indirect add short + indirect delete long' '
+test_expect_success 'D/F conflict prevents indirect add short + indirect delete long' '
df_test refs/df-ias-idl --sym-add --sym-del --add-del foo foo/bar
'
-test_expect_success REFFILES 'D/F conflict prevents indirect delete long + indirect add short' '
+test_expect_success 'D/F conflict prevents indirect delete long + indirect add short' '
df_test refs/df-idl-ias --sym-add --sym-del --del-add foo/bar foo
'
-test_expect_success REFFILES 'D/F conflict prevents indirect add long + delete short packed' '
+test_expect_success 'D/F conflict prevents indirect add long + delete short packed' '
df_test refs/df-ial-dsp --sym-add --pack --add-del foo/bar foo
'
-test_expect_success REFFILES 'D/F conflict prevents indirect add long + indirect delete short packed' '
+test_expect_success 'D/F conflict prevents indirect add long + indirect delete short packed' '
df_test refs/df-ial-idsp --sym-add --sym-del --pack --add-del foo/bar foo
'
-test_expect_success REFFILES 'D/F conflict prevents add long + indirect delete short packed' '
+test_expect_success 'D/F conflict prevents add long + indirect delete short packed' '
df_test refs/df-al-idsp --sym-del --pack --add-del foo/bar foo
'
-test_expect_success REFFILES 'D/F conflict prevents indirect delete long packed + indirect add short' '
+test_expect_success 'D/F conflict prevents indirect delete long packed + indirect add short' '
df_test refs/df-idlp-ias --sym-add --sym-del --pack --del-add foo/bar foo
'
@@ -466,170 +393,4 @@ test_expect_success 'incorrect old value blocks indirect no-deref delete' '
test_cmp expected output.err
'
-test_expect_success REFFILES 'non-empty directory blocks create' '
- prefix=refs/ne-create &&
- mkdir -p .git/$prefix/foo/bar &&
- : >.git/$prefix/foo/bar/baz.lock &&
- test_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" &&
- cat >expected <<-EOF &&
- fatal: cannot lock ref $SQ$prefix/foo$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ
- EOF
- printf "%s\n" "update $prefix/foo $C" |
- test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err &&
- cat >expected <<-EOF &&
- fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ
- EOF
- printf "%s\n" "update $prefix/foo $D $C" |
- test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err
-'
-
-test_expect_success REFFILES 'broken reference blocks create' '
- prefix=refs/broken-create &&
- mkdir -p .git/$prefix &&
- echo "gobbledigook" >.git/$prefix/foo &&
- test_when_finished "rm -f .git/$prefix/foo" &&
- cat >expected <<-EOF &&
- fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken
- EOF
- printf "%s\n" "update $prefix/foo $C" |
- test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err &&
- cat >expected <<-EOF &&
- fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken
- EOF
- printf "%s\n" "update $prefix/foo $D $C" |
- test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err
-'
-
-test_expect_success REFFILES 'non-empty directory blocks indirect create' '
- prefix=refs/ne-indirect-create &&
- git symbolic-ref $prefix/symref $prefix/foo &&
- mkdir -p .git/$prefix/foo/bar &&
- : >.git/$prefix/foo/bar/baz.lock &&
- test_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" &&
- cat >expected <<-EOF &&
- fatal: cannot lock ref $SQ$prefix/symref$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ
- EOF
- printf "%s\n" "update $prefix/symref $C" |
- test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err &&
- cat >expected <<-EOF &&
- fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ
- EOF
- printf "%s\n" "update $prefix/symref $D $C" |
- test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err
-'
-
-test_expect_success REFFILES 'broken reference blocks indirect create' '
- prefix=refs/broken-indirect-create &&
- git symbolic-ref $prefix/symref $prefix/foo &&
- echo "gobbledigook" >.git/$prefix/foo &&
- test_when_finished "rm -f .git/$prefix/foo" &&
- cat >expected <<-EOF &&
- fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken
- EOF
- printf "%s\n" "update $prefix/symref $C" |
- test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err &&
- cat >expected <<-EOF &&
- fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken
- EOF
- printf "%s\n" "update $prefix/symref $D $C" |
- test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err
-'
-
-test_expect_success REFFILES 'no bogus intermediate values during delete' '
- prefix=refs/slow-transaction &&
- # Set up a reference with differing loose and packed versions:
- git update-ref $prefix/foo $C &&
- git pack-refs --all &&
- git update-ref $prefix/foo $D &&
- git for-each-ref $prefix >unchanged &&
- # Now try to update the reference, but hold the `packed-refs` lock
- # for a while to see what happens while the process is blocked:
- : >.git/packed-refs.lock &&
- test_when_finished "rm -f .git/packed-refs.lock" &&
- {
- # Note: the following command is intentionally run in the
- # background. We increase the timeout so that `update-ref`
- # attempts to acquire the `packed-refs` lock for much longer
- # than it takes for us to do the check then delete it:
- git -c core.packedrefstimeout=30000 update-ref -d $prefix/foo &
- } &&
- pid2=$! &&
- # Give update-ref plenty of time to get to the point where it tries
- # to lock packed-refs:
- sleep 1 &&
- # Make sure that update-ref did not complete despite the lock:
- kill -0 $pid2 &&
- # Verify that the reference still has its old value:
- sha1=$(git rev-parse --verify --quiet $prefix/foo || echo undefined) &&
- case "$sha1" in
- $D)
- # This is what we hope for; it means that nothing
- # user-visible has changed yet.
- : ;;
- undefined)
- # This is not correct; it means the deletion has happened
- # already even though update-ref should not have been
- # able to acquire the lock yet.
- echo "$prefix/foo deleted prematurely" &&
- break
- ;;
- $C)
- # This value should never be seen. Probably the loose
- # reference has been deleted but the packed reference
- # is still there:
- echo "$prefix/foo incorrectly observed to be C" &&
- break
- ;;
- *)
- # WTF?
- echo "unexpected value observed for $prefix/foo: $sha1" &&
- break
- ;;
- esac >out &&
- rm -f .git/packed-refs.lock &&
- wait $pid2 &&
- test_must_be_empty out &&
- test_must_fail git rev-parse --verify --quiet $prefix/foo
-'
-
-test_expect_success REFFILES 'delete fails cleanly if packed-refs file is locked' '
- prefix=refs/locked-packed-refs &&
- # Set up a reference with differing loose and packed versions:
- git update-ref $prefix/foo $C &&
- git pack-refs --all &&
- git update-ref $prefix/foo $D &&
- git for-each-ref $prefix >unchanged &&
- # Now try to delete it while the `packed-refs` lock is held:
- : >.git/packed-refs.lock &&
- test_when_finished "rm -f .git/packed-refs.lock" &&
- test_must_fail git update-ref -d $prefix/foo >out 2>err &&
- git for-each-ref $prefix >actual &&
- test_i18ngrep "Unable to create $SQ.*packed-refs.lock$SQ: " err &&
- test_cmp unchanged actual
-'
-
-test_expect_success REFFILES 'delete fails cleanly if packed-refs.new write fails' '
- # Setup and expectations are similar to the test above.
- prefix=refs/failed-packed-refs &&
- git update-ref $prefix/foo $C &&
- git pack-refs --all &&
- git update-ref $prefix/foo $D &&
- git for-each-ref $prefix >unchanged &&
- # This should not happen in practice, but it is an easy way to get a
- # reliable error (we open with create_tempfile(), which uses O_EXCL).
- : >.git/packed-refs.new &&
- test_when_finished "rm -f .git/packed-refs.new" &&
- test_must_fail git update-ref -d $prefix/foo &&
- git for-each-ref $prefix >actual &&
- test_cmp unchanged actual
-'
-
test_done
diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh
index 51f8291..a6bcd62 100755
--- a/t/t1405-main-ref-store.sh
+++ b/t/t1405-main-ref-store.sh
@@ -5,6 +5,7 @@ test_description='test main ref store api'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
RUN="test-tool ref-store main"
@@ -14,14 +15,6 @@ test_expect_success 'setup' '
test_commit one
'
-test_expect_success REFFILES 'pack_refs(PACK_REFS_ALL | PACK_REFS_PRUNE)' '
- N=`find .git/refs -type f | wc -l` &&
- test "$N" != 0 &&
- $RUN pack-refs PACK_REFS_PRUNE,PACK_REFS_ALL &&
- N=`find .git/refs -type f` &&
- test -z "$N"
-'
-
test_expect_success 'create_symref(FOO, refs/heads/main)' '
$RUN create-symref FOO refs/heads/main nothing &&
echo refs/heads/main >expected &&
@@ -40,12 +33,6 @@ test_expect_success 'delete_refs(FOO, refs/tags/new-tag)' '
test_must_fail git rev-parse refs/tags/new-tag --
'
-# In reftable, we keep the reflogs around for deleted refs.
-test_expect_success !REFFILES 'delete-reflog(FOO, refs/tags/new-tag)' '
- $RUN delete-reflog FOO &&
- $RUN delete-reflog refs/tags/new-tag
-'
-
test_expect_success 'rename_refs(main, new-main)' '
git rev-parse main >expected &&
$RUN rename-ref refs/heads/main refs/heads/new-main &&
@@ -81,11 +68,11 @@ test_expect_success 'verify_ref(new-main)' '
'
test_expect_success 'for_each_reflog()' '
- $RUN for-each-reflog | sort -k2 | cut -d" " -f 2- >actual &&
+ $RUN for-each-reflog >actual &&
cat >expected <<-\EOF &&
- HEAD 0x1
- refs/heads/main 0x0
- refs/heads/new-main 0x0
+ HEAD
+ refs/heads/main
+ refs/heads/new-main
EOF
test_cmp expected actual
'
@@ -111,7 +98,7 @@ test_expect_success 'delete_reflog(HEAD)' '
test_must_fail git reflog exists HEAD
'
-test_expect_success REFFILES 'create-reflog(HEAD)' '
+test_expect_success 'create-reflog(HEAD)' '
$RUN create-reflog HEAD &&
git reflog exists HEAD
'
diff --git a/t/t1406-submodule-ref-store.sh b/t/t1406-submodule-ref-store.sh
index e6a7f73..c01f0f1 100755
--- a/t/t1406-submodule-ref-store.sh
+++ b/t/t1406-submodule-ref-store.sh
@@ -63,11 +63,11 @@ test_expect_success 'verify_ref(new-main)' '
'
test_expect_success 'for_each_reflog()' '
- $RUN for-each-reflog | sort | cut -d" " -f 2- >actual &&
+ $RUN for-each-reflog >actual &&
cat >expected <<-\EOF &&
- HEAD 0x1
- refs/heads/main 0x0
- refs/heads/new-main 0x0
+ HEAD
+ refs/heads/main
+ refs/heads/new-main
EOF
test_cmp expected actual
'
diff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh
index ad8006c..48b1c92 100755
--- a/t/t1407-worktree-ref-store.sh
+++ b/t/t1407-worktree-ref-store.sh
@@ -5,6 +5,7 @@ test_description='test worktree ref store api'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
RWT="test-tool ref-store worktree:wt"
@@ -52,41 +53,4 @@ test_expect_success 'create_symref(FOO, refs/heads/main)' '
test_cmp expected actual
'
-# Some refs (refs/bisect/*, pseudorefs) are kept per worktree, so they should
-# only appear in the for-each-reflog output if it is called from the correct
-# worktree, which is exercised in this test. This test is poorly written (and
-# therefore marked REFFILES) for mulitple reasons: 1) it creates invalidly
-# formatted log entres. 2) it uses direct FS access for creating the reflogs. 3)
-# PSEUDO-WT and refs/bisect/random do not create reflogs by default, so it is
-# not testing a realistic scenario.
-test_expect_success REFFILES 'for_each_reflog()' '
- echo $ZERO_OID > .git/logs/PSEUDO-MAIN &&
- mkdir -p .git/logs/refs/bisect &&
- echo $ZERO_OID > .git/logs/refs/bisect/random &&
-
- echo $ZERO_OID > .git/worktrees/wt/logs/PSEUDO-WT &&
- mkdir -p .git/worktrees/wt/logs/refs/bisect &&
- echo $ZERO_OID > .git/worktrees/wt/logs/refs/bisect/wt-random &&
-
- $RWT for-each-reflog | cut -d" " -f 2- | sort >actual &&
- cat >expected <<-\EOF &&
- HEAD 0x1
- PSEUDO-WT 0x0
- refs/bisect/wt-random 0x0
- refs/heads/main 0x0
- refs/heads/wt-main 0x0
- EOF
- test_cmp expected actual &&
-
- $RMAIN for-each-reflog | cut -d" " -f 2- | sort >actual &&
- cat >expected <<-\EOF &&
- HEAD 0x1
- PSEUDO-MAIN 0x0
- refs/bisect/random 0x0
- refs/heads/main 0x0
- refs/heads/wt-main 0x0
- EOF
- test_cmp expected actual
-'
-
test_done
diff --git a/t/t1408-packed-refs.sh b/t/t1408-packed-refs.sh
index 41ba1f1..9469c79 100755
--- a/t/t1408-packed-refs.sh
+++ b/t/t1408-packed-refs.sh
@@ -5,6 +5,7 @@ test_description='packed-refs entries are covered by loose refs'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t1409-avoid-packing-refs.sh b/t/t1409-avoid-packing-refs.sh
index be12fb6..7748973 100755
--- a/t/t1409-avoid-packing-refs.sh
+++ b/t/t1409-avoid-packing-refs.sh
@@ -2,8 +2,15 @@
test_description='avoid rewriting packed-refs unnecessarily'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
+if test_have_prereq !REFFILES
+then
+ skip_all='skipping files-backend specific pack-refs tests'
+ test_done
+fi
+
# Add an identifying mark to the packed-refs file header line. This
# shouldn't upset readers, and it should be omitted if the file is
# ever rewritten.
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index aa59954..5bf883f 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -7,6 +7,7 @@ test_description='Test prune and reflog expiration'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
check_have () {
@@ -28,7 +29,7 @@ check_fsck () {
'')
test_must_be_empty fsck.output ;;
*)
- test_i18ngrep "$1" fsck.output ;;
+ test_grep "$1" fsck.output ;;
esac
}
@@ -307,9 +308,9 @@ test_expect_success 'git reflog expire unknown reference' '
test_config gc.reflogexpireunreachable never &&
test_must_fail git reflog expire main@{123} 2>stderr &&
- test_i18ngrep "points nowhere" stderr &&
+ test_grep "points nowhere" stderr &&
test_must_fail git reflog expire does-not-exist 2>stderr &&
- test_i18ngrep "points nowhere" stderr
+ test_grep "points nowhere" stderr
'
test_expect_success 'checkout should not delete log for packed ref' '
@@ -353,36 +354,6 @@ test_expect_success 'stale dirs do not cause d/f conflicts (reflogs off)' '
test_must_be_empty actual
'
-# Triggering the bug detected by this test requires a newline to fall
-# exactly BUFSIZ-1 bytes from the end of the file. We don't know
-# what that value is, since it's platform dependent. However, if
-# we choose some value N, we also catch any D which divides N evenly
-# (since we will read backwards in chunks of D). So we choose 8K,
-# which catches glibc (with an 8K BUFSIZ) and *BSD (1K).
-#
-# Each line is 114 characters, so we need 75 to still have a few before the
-# last 8K. The 89-character padding on the final entry lines up our
-# newline exactly.
-test_expect_success REFFILES,SHA1 'parsing reverse reflogs at BUFSIZ boundaries' '
- git checkout -b reflogskip &&
- zf=$(test_oid zero_2) &&
- ident="abc <xyz> 0000000001 +0000" &&
- for i in $(test_seq 1 75); do
- printf "$zf%02d $zf%02d %s\t" $i $(($i+1)) "$ident" &&
- if test $i = 75; then
- for j in $(test_seq 1 89); do
- printf X || return 1
- done
- else
- printf X
- fi &&
- printf "\n" || return 1
- done >.git/logs/refs/heads/reflogskip &&
- git rev-parse reflogskip@{73} >actual &&
- echo ${zf}03 >expect &&
- test_cmp expect actual
-'
-
test_expect_success 'no segfaults for reflog containing non-commit sha1s' '
git update-ref --create-reflog -m "Creating ref" \
refs/tests/tree-in-reflog HEAD &&
@@ -396,18 +367,6 @@ test_expect_failure 'reflog with non-commit entries displays all entries' '
test_line_count = 3 actual
'
-# This test takes a lock on an individual ref; this is not supported in
-# reftable.
-test_expect_success REFFILES 'reflog expire operates on symref not referrent' '
- git branch --create-reflog the_symref &&
- git branch --create-reflog referrent &&
- git update-ref referrent HEAD &&
- git symbolic-ref refs/heads/the_symref refs/heads/referrent &&
- test_when_finished "rm -f .git/refs/heads/referrent.lock" &&
- touch .git/refs/heads/referrent.lock &&
- git reflog expire --expire=all the_symref
-'
-
test_expect_success 'continue walking past root commits' '
git init orphanage &&
(
@@ -445,13 +404,144 @@ test_expect_success 'expire with multiple worktrees' '
)
'
-test_expect_success REFFILES 'empty reflog' '
+test_expect_success 'expire one of multiple worktrees' '
+ git init main-wt2 &&
+ (
+ cd main-wt2 &&
+ test_tick &&
+ test_commit foo &&
+ git worktree add link-wt &&
+ test_tick &&
+ test_commit -C link-wt foobar &&
+ test_tick &&
+ test-tool ref-store worktree:link-wt for-each-reflog-ent HEAD \
+ >expect-link-wt &&
+ git reflog expire --verbose --all --expire=$test_tick \
+ --single-worktree &&
+ test-tool ref-store worktree:main for-each-reflog-ent HEAD \
+ >actual-main &&
+ test-tool ref-store worktree:link-wt for-each-reflog-ent HEAD \
+ >actual-link-wt &&
+ test_must_be_empty actual-main &&
+ test_cmp expect-link-wt actual-link-wt
+ )
+'
+
+test_expect_success 'empty reflog' '
test_when_finished "rm -rf empty" &&
git init empty &&
test_commit -C empty A &&
- >empty/.git/logs/refs/heads/foo &&
+ test-tool ref-store main create-reflog refs/heads/foo &&
git -C empty reflog expire --all 2>err &&
test_must_be_empty err
'
+test_expect_success 'list reflogs' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ git reflog list >actual &&
+ test_must_be_empty actual &&
+
+ test_commit A &&
+ cat >expect <<-EOF &&
+ HEAD
+ refs/heads/main
+ EOF
+ git reflog list >actual &&
+ test_cmp expect actual &&
+
+ git branch b &&
+ cat >expect <<-EOF &&
+ HEAD
+ refs/heads/b
+ refs/heads/main
+ EOF
+ git reflog list >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'list reflogs with worktree' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+
+ test_commit A &&
+ git worktree add wt &&
+ git -c core.logAllRefUpdates=always \
+ update-ref refs/worktree/main HEAD &&
+ git -c core.logAllRefUpdates=always \
+ update-ref refs/worktree/per-worktree HEAD &&
+ git -c core.logAllRefUpdates=always -C wt \
+ update-ref refs/worktree/per-worktree HEAD &&
+ git -c core.logAllRefUpdates=always -C wt \
+ update-ref refs/worktree/worktree HEAD &&
+
+ cat >expect <<-EOF &&
+ HEAD
+ refs/heads/main
+ refs/heads/wt
+ refs/worktree/main
+ refs/worktree/per-worktree
+ EOF
+ git reflog list >actual &&
+ test_cmp expect actual &&
+
+ cat >expect <<-EOF &&
+ HEAD
+ refs/heads/main
+ refs/heads/wt
+ refs/worktree/per-worktree
+ refs/worktree/worktree
+ EOF
+ git -C wt reflog list >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'reflog list returns error with additional args' '
+ cat >expect <<-EOF &&
+ error: list does not accept arguments: ${SQ}bogus${SQ}
+ EOF
+ test_must_fail git reflog list bogus 2>err &&
+ test_cmp expect err
+'
+
+test_expect_success 'reflog for symref with unborn target can be listed' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit A &&
+ git symbolic-ref HEAD refs/heads/unborn &&
+ cat >expect <<-EOF &&
+ HEAD
+ refs/heads/main
+ EOF
+ git reflog list >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'reflog with invalid object ID can be listed' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit A &&
+ test-tool ref-store main update-ref msg refs/heads/missing \
+ $(test_oid deadbeef) "$ZERO_OID" REF_SKIP_OID_VERIFICATION &&
+ cat >expect <<-EOF &&
+ HEAD
+ refs/heads/main
+ refs/heads/missing
+ EOF
+ git reflog list >actual &&
+ test_cmp expect actual
+ )
+'
+
test_done
diff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh
index 934688a..d2a4822 100755
--- a/t/t1413-reflog-detach.sh
+++ b/t/t1413-reflog-detach.sh
@@ -4,6 +4,7 @@ test_description='Test reflog interaction with detached HEAD'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
reset_state () {
diff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh
index ea64cec..be6c3f4 100755
--- a/t/t1414-reflog-walk.sh
+++ b/t/t1414-reflog-walk.sh
@@ -121,13 +121,12 @@ test_expect_success 'min/max age uses entry date to limit' '
# Create a situation where the reflog and ref database disagree about the latest
# state of HEAD.
-test_expect_success REFFILES 'walk prefers reflog to ref tip' '
+test_expect_success 'walk prefers reflog to ref tip' '
+ test_commit A &&
+ test_commit B &&
+ git reflog delete HEAD@{0} &&
head=$(git rev-parse HEAD) &&
- one=$(git rev-parse one) &&
- ident="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE" &&
- echo "$head $one $ident broken reflog entry" >>.git/logs/HEAD &&
-
- echo $one >expect &&
+ git rev-parse A >expect &&
git log -g --format=%H -1 >actual &&
test_cmp expect actual
'
diff --git a/t/t1415-worktree-refs.sh b/t/t1415-worktree-refs.sh
index 3b53184..eb4eec8 100755
--- a/t/t1415-worktree-refs.sh
+++ b/t/t1415-worktree-refs.sh
@@ -17,17 +17,6 @@ test_expect_success 'setup' '
git -C wt2 update-ref refs/worktree/foo HEAD
'
-# The 'packed-refs' file is stored directly in .git/. This means it is global
-# to the repository, and can only contain refs that are shared across all
-# worktrees.
-test_expect_success REFFILES 'refs/worktree must not be packed' '
- git pack-refs --all &&
- test_path_is_missing .git/refs/tags/wt1 &&
- test_path_is_file .git/refs/worktree/foo &&
- test_path_is_file .git/worktrees/wt1/refs/worktree/foo &&
- test_path_is_file .git/worktrees/wt2/refs/worktree/foo
-'
-
test_expect_success 'refs/worktree are per-worktree' '
test_cmp_rev worktree/foo initial &&
( cd wt1 && test_cmp_rev worktree/foo wt1 ) &&
diff --git a/t/t1416-ref-transaction-hooks.sh b/t/t1416-ref-transaction-hooks.sh
index 2773172..2092488 100755
--- a/t/t1416-ref-transaction-hooks.sh
+++ b/t/t1416-ref-transaction-hooks.sh
@@ -5,6 +5,7 @@ test_description='reference transaction hooks'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
@@ -36,7 +37,7 @@ test_expect_success 'hook aborts updating ref in prepared state' '
fi
EOF
test_must_fail git update-ref HEAD POST 2>err &&
- test_i18ngrep "ref updates aborted by hook" err
+ test_grep "ref updates aborted by hook" err
'
test_expect_success 'hook gets all queued updates in prepared state' '
diff --git a/t/t1417-reflog-updateref.sh b/t/t1417-reflog-updateref.sh
index 14f13b5..0eb5e67 100755
--- a/t/t1417-reflog-updateref.sh
+++ b/t/t1417-reflog-updateref.sh
@@ -14,9 +14,13 @@ test_expect_success 'setup' '
test_commit B &&
test_commit C &&
- cp .git/logs/HEAD HEAD.old &&
+ git reflog HEAD >expect &&
git reset --hard HEAD~ &&
- cp HEAD.old .git/logs/HEAD
+ # Make sure that the reflog does not point to the same commit
+ # as HEAD.
+ git reflog delete HEAD@{0} &&
+ git reflog HEAD >actual &&
+ test_cmp expect actual
)
'
@@ -25,7 +29,7 @@ test_reflog_updateref () {
shift
args="$@"
- test_expect_success REFFILES "get '$exp' with '$args'" '
+ test_expect_success "get '$exp' with '$args'" '
test_when_finished "rm -rf copy" &&
cp -R repo copy &&
diff --git a/t/t1418-reflog-exists.sh b/t/t1418-reflog-exists.sh
index d51ecd5..2268bca 100755
--- a/t/t1418-reflog-exists.sh
+++ b/t/t1418-reflog-exists.sh
@@ -4,6 +4,7 @@ test_description='Test reflog display routines'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
diff --git a/t/t1419-exclude-refs.sh b/t/t1419-exclude-refs.sh
new file mode 100755
index 0000000..1359574
--- /dev/null
+++ b/t/t1419-exclude-refs.sh
@@ -0,0 +1,128 @@
+#!/bin/sh
+
+test_description='test exclude_patterns functionality in main ref store'
+
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+if test_have_prereq !REFFILES
+then
+ skip_all='skipping `git for-each-ref --exclude` tests; need files backend'
+ test_done
+fi
+
+for_each_ref__exclude () {
+ GIT_TRACE2_PERF=1 test-tool ref-store main \
+ for-each-ref--exclude "$@" >actual.raw
+ cut -d ' ' -f 2 actual.raw
+}
+
+for_each_ref () {
+ git for-each-ref --format='%(refname)' "$@"
+}
+
+assert_jumps () {
+ local nr="$1"
+ local trace="$2"
+
+ grep -q "name:jumps_made value:$nr$" $trace
+}
+
+assert_no_jumps () {
+ ! assert_jumps ".*" "$1"
+}
+
+test_expect_success 'setup' '
+ test_commit --no-tag base &&
+ base="$(git rev-parse HEAD)" &&
+
+ for name in foo bar baz quux
+ do
+ for i in 1 2 3
+ do
+ echo "create refs/heads/$name/$i $base" || return 1
+ done || return 1
+ done >in &&
+ echo "delete refs/heads/main" >>in &&
+
+ git update-ref --stdin <in &&
+ git pack-refs --all
+'
+
+test_expect_success 'excluded region in middle' '
+ for_each_ref__exclude refs/heads refs/heads/foo >actual 2>perf &&
+ for_each_ref refs/heads/bar refs/heads/baz refs/heads/quux >expect &&
+
+ test_cmp expect actual &&
+ assert_jumps 1 perf
+'
+
+test_expect_success 'excluded region at beginning' '
+ for_each_ref__exclude refs/heads refs/heads/bar >actual 2>perf &&
+ for_each_ref refs/heads/baz refs/heads/foo refs/heads/quux >expect &&
+
+ test_cmp expect actual &&
+ assert_jumps 1 perf
+'
+
+test_expect_success 'excluded region at end' '
+ for_each_ref__exclude refs/heads refs/heads/quux >actual 2>perf &&
+ for_each_ref refs/heads/foo refs/heads/bar refs/heads/baz >expect &&
+
+ test_cmp expect actual &&
+ assert_jumps 1 perf
+'
+
+test_expect_success 'disjoint excluded regions' '
+ for_each_ref__exclude refs/heads refs/heads/bar refs/heads/quux >actual 2>perf &&
+ for_each_ref refs/heads/baz refs/heads/foo >expect &&
+
+ test_cmp expect actual &&
+ assert_jumps 2 perf
+'
+
+test_expect_success 'adjacent, non-overlapping excluded regions' '
+ for_each_ref__exclude refs/heads refs/heads/bar refs/heads/baz >actual 2>perf &&
+ for_each_ref refs/heads/foo refs/heads/quux >expect &&
+
+ test_cmp expect actual &&
+ assert_jumps 1 perf
+'
+
+test_expect_success 'overlapping excluded regions' '
+ for_each_ref__exclude refs/heads refs/heads/ba refs/heads/baz >actual 2>perf &&
+ for_each_ref refs/heads/foo refs/heads/quux >expect &&
+
+ test_cmp expect actual &&
+ assert_jumps 1 perf
+'
+
+test_expect_success 'several overlapping excluded regions' '
+ for_each_ref__exclude refs/heads \
+ refs/heads/bar refs/heads/baz refs/heads/foo >actual 2>perf &&
+ for_each_ref refs/heads/quux >expect &&
+
+ test_cmp expect actual &&
+ assert_jumps 1 perf
+'
+
+test_expect_success 'non-matching excluded section' '
+ for_each_ref__exclude refs/heads refs/heads/does/not/exist >actual 2>perf &&
+ for_each_ref >expect &&
+
+ test_cmp expect actual &&
+ assert_no_jumps perf
+'
+
+test_expect_success 'meta-characters are discarded' '
+ for_each_ref__exclude refs/heads "refs/heads/ba*" >actual 2>perf &&
+ for_each_ref >expect &&
+
+ test_cmp expect actual &&
+ assert_no_jumps perf
+'
+
+test_done
diff --git a/t/t1430-bad-ref-name.sh b/t/t1430-bad-ref-name.sh
index ff1c967..0c00118 100755
--- a/t/t1430-bad-ref-name.sh
+++ b/t/t1430-bad-ref-name.sh
@@ -47,7 +47,7 @@ test_expect_success 'git branch shows badly named ref as warning' '
test-tool ref-store main update-ref msg "refs/heads/broken...ref" $main_sha1 $ZERO_OID REF_SKIP_REFNAME_VERIFICATION &&
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...ref" &&
git branch >output 2>error &&
- test_i18ngrep -e "ignoring ref with broken name refs/heads/broken\.\.\.ref" error &&
+ test_grep -e "ignoring ref with broken name refs/heads/broken\.\.\.ref" error &&
! grep -e "broken\.\.\.ref" output
'
@@ -158,23 +158,23 @@ test_expect_success 'rev-parse skips symref pointing to broken name' '
git rev-parse --verify one >expect &&
git rev-parse --verify shadow >actual 2>err &&
test_cmp expect actual &&
- test_i18ngrep "ignoring dangling symref refs/tags/shadow" err
+ test_grep "ignoring dangling symref refs/tags/shadow" err
'
test_expect_success 'for-each-ref emits warnings for broken names' '
test-tool ref-store main update-ref msg "refs/heads/broken...ref" $main_sha1 $ZERO_OID REF_SKIP_REFNAME_VERIFICATION &&
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...ref" &&
- printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
+ test-tool ref-store main create-symref refs/heads/badname refs/heads/broken...ref &&
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/badname" &&
- printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
+ test-tool ref-store main create-symref refs/heads/broken...symref refs/heads/main &&
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...symref" &&
git for-each-ref >output 2>error &&
! grep -e "broken\.\.\.ref" output &&
! grep -e "badname" output &&
! grep -e "broken\.\.\.symref" output &&
- test_i18ngrep "ignoring ref with broken name refs/heads/broken\.\.\.ref" error &&
- test_i18ngrep ! "ignoring broken ref refs/heads/badname" error &&
- test_i18ngrep "ignoring ref with broken name refs/heads/broken\.\.\.symref" error
+ test_grep "ignoring ref with broken name refs/heads/broken\.\.\.ref" error &&
+ test_grep ! "ignoring broken ref refs/heads/badname" error &&
+ test_grep "ignoring ref with broken name refs/heads/broken\.\.\.symref" error
'
test_expect_success 'update-ref -d can delete broken name' '
@@ -192,7 +192,7 @@ test_expect_success 'branch -d can delete broken name' '
test-tool ref-store main update-ref msg "refs/heads/broken...ref" $main_sha1 $ZERO_OID REF_SKIP_REFNAME_VERIFICATION &&
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...ref" &&
git branch -d broken...ref >output 2>error &&
- test_i18ngrep "Deleted branch broken...ref (was broken)" output &&
+ test_grep "Deleted branch broken...ref (was broken)" output &&
test_must_be_empty error &&
git branch >output 2>error &&
! grep -e "broken\.\.\.ref" error &&
@@ -205,8 +205,9 @@ test_expect_success 'update-ref --no-deref -d can delete symref to broken name'
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...ref" &&
test-tool ref-store main create-symref refs/heads/badname refs/heads/broken...ref msg &&
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/badname" &&
+ test_ref_exists refs/heads/badname &&
git update-ref --no-deref -d refs/heads/badname >output 2>error &&
- test_path_is_missing .git/refs/heads/badname &&
+ test_ref_missing refs/heads/badname &&
test_must_be_empty output &&
test_must_be_empty error
'
@@ -216,17 +217,19 @@ test_expect_success 'branch -d can delete symref to broken name' '
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...ref" &&
test-tool ref-store main create-symref refs/heads/badname refs/heads/broken...ref msg &&
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/badname" &&
+ test_ref_exists refs/heads/badname &&
git branch -d badname >output 2>error &&
- test_path_is_missing .git/refs/heads/badname &&
- test_i18ngrep "Deleted branch badname (was refs/heads/broken\.\.\.ref)" output &&
+ test_ref_missing refs/heads/badname &&
+ test_grep "Deleted branch badname (was refs/heads/broken\.\.\.ref)" output &&
test_must_be_empty error
'
test_expect_success 'update-ref --no-deref -d can delete dangling symref to broken name' '
test-tool ref-store main create-symref refs/heads/badname refs/heads/broken...ref msg &&
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/badname" &&
+ test_ref_exists refs/heads/badname &&
git update-ref --no-deref -d refs/heads/badname >output 2>error &&
- test_path_is_missing .git/refs/heads/badname &&
+ test_ref_missing refs/heads/badname &&
test_must_be_empty output &&
test_must_be_empty error
'
@@ -234,9 +237,10 @@ test_expect_success 'update-ref --no-deref -d can delete dangling symref to brok
test_expect_success 'branch -d can delete dangling symref to broken name' '
test-tool ref-store main create-symref refs/heads/badname refs/heads/broken...ref msg &&
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/badname" &&
+ test_ref_exists refs/heads/badname &&
git branch -d badname >output 2>error &&
- test_path_is_missing .git/refs/heads/badname &&
- test_i18ngrep "Deleted branch badname (was refs/heads/broken\.\.\.ref)" output &&
+ test_ref_missing refs/heads/badname &&
+ test_grep "Deleted branch badname (was refs/heads/broken\.\.\.ref)" output &&
test_must_be_empty error
'
@@ -245,45 +249,50 @@ test_expect_success 'update-ref -d can delete broken name through symref' '
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...ref" &&
test-tool ref-store main create-symref refs/heads/badname refs/heads/broken...ref msg &&
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/badname" &&
+ test_ref_exists refs/heads/broken...ref &&
git update-ref -d refs/heads/badname >output 2>error &&
- test_path_is_missing .git/refs/heads/broken...ref &&
+ test_ref_missing refs/heads/broken...ref &&
test_must_be_empty output &&
test_must_be_empty error
'
test_expect_success 'update-ref --no-deref -d can delete symref with broken name' '
- printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
+ test-tool ref-store main create-symref refs/heads/broken...symref refs/heads/main &&
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...symref" &&
+ test_ref_exists refs/heads/broken...symref &&
git update-ref --no-deref -d refs/heads/broken...symref >output 2>error &&
- test_path_is_missing .git/refs/heads/broken...symref &&
+ test_ref_missing refs/heads/broken...symref &&
test_must_be_empty output &&
test_must_be_empty error
'
test_expect_success 'branch -d can delete symref with broken name' '
- printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
+ test-tool ref-store main create-symref refs/heads/broken...symref refs/heads/main &&
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...symref" &&
+ test_ref_exists refs/heads/broken...symref &&
git branch -d broken...symref >output 2>error &&
- test_path_is_missing .git/refs/heads/broken...symref &&
- test_i18ngrep "Deleted branch broken...symref (was refs/heads/main)" output &&
+ test_ref_missing refs/heads/broken...symref &&
+ test_grep "Deleted branch broken...symref (was refs/heads/main)" output &&
test_must_be_empty error
'
test_expect_success 'update-ref --no-deref -d can delete dangling symref with broken name' '
- printf "ref: refs/heads/idonotexist\n" >.git/refs/heads/broken...symref &&
+ test-tool ref-store main create-symref refs/heads/broken...symref refs/heads/idonotexist &&
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...symref" &&
+ test_ref_exists refs/heads/broken...symref &&
git update-ref --no-deref -d refs/heads/broken...symref >output 2>error &&
- test_path_is_missing .git/refs/heads/broken...symref &&
+ test_ref_missing refs/heads/broken...symref &&
test_must_be_empty output &&
test_must_be_empty error
'
test_expect_success 'branch -d can delete dangling symref with broken name' '
- printf "ref: refs/heads/idonotexist\n" >.git/refs/heads/broken...symref &&
+ test-tool ref-store main create-symref refs/heads/broken...symref refs/heads/idonotexist &&
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...symref" &&
+ test_ref_exists refs/heads/broken...symref &&
git branch -d broken...symref >output 2>error &&
- test_path_is_missing .git/refs/heads/broken...symref &&
- test_i18ngrep "Deleted branch broken...symref (was refs/heads/idonotexist)" output &&
+ test_ref_missing refs/heads/broken...symref &&
+ test_grep "Deleted branch broken...symref (was refs/heads/idonotexist)" output &&
test_must_be_empty error
'
@@ -292,7 +301,7 @@ test_expect_success 'update-ref -d cannot delete non-ref in .git dir' '
echo precious >expect &&
test_must_fail git update-ref -d my-private-file >output 2>error &&
test_must_be_empty output &&
- test_i18ngrep -e "refusing to update ref with bad name" error &&
+ test_grep -e "refusing to update ref with bad name" error &&
test_cmp expect .git/my-private-file
'
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index ab7f31f..8a456b1 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -15,6 +15,7 @@ test_expect_success setup '
git config --unset i18n.commitencoding &&
git checkout HEAD^0 &&
test_commit B fileB two &&
+ orig_head=$(git rev-parse HEAD) &&
git tag -d A B &&
git reflog expire --expire=now --all
'
@@ -115,63 +116,62 @@ test_expect_success 'zlib corrupt loose object output ' '
'
test_expect_success 'branch pointing to non-commit' '
- git rev-parse HEAD^{tree} >.git/refs/heads/invalid &&
+ tree_oid=$(git rev-parse --verify HEAD^{tree}) &&
test_when_finished "git update-ref -d refs/heads/invalid" &&
+ test-tool ref-store main update-ref msg refs/heads/invalid $tree_oid $ZERO_OID REF_SKIP_OID_VERIFICATION &&
test_must_fail git fsck 2>out &&
- test_i18ngrep "not a commit" out
+ test_grep "not a commit" out
'
-test_expect_success 'HEAD link pointing at a funny object' '
- test_when_finished "mv .git/SAVED_HEAD .git/HEAD" &&
- mv .git/HEAD .git/SAVED_HEAD &&
+test_expect_success REFFILES 'HEAD link pointing at a funny object' '
+ test_when_finished "git update-ref HEAD $orig_head" &&
echo $ZERO_OID >.git/HEAD &&
# avoid corrupt/broken HEAD from interfering with repo discovery
test_must_fail env GIT_DIR=.git git fsck 2>out &&
- test_i18ngrep "detached HEAD points" out
+ test_grep "detached HEAD points" out
'
test_expect_success 'HEAD link pointing at a funny place' '
- test_when_finished "mv .git/SAVED_HEAD .git/HEAD" &&
- mv .git/HEAD .git/SAVED_HEAD &&
- echo "ref: refs/funny/place" >.git/HEAD &&
+ test_when_finished "git update-ref --no-deref HEAD $orig_head" &&
+ test-tool ref-store main create-symref HEAD refs/funny/place &&
# avoid corrupt/broken HEAD from interfering with repo discovery
test_must_fail env GIT_DIR=.git git fsck 2>out &&
- test_i18ngrep "HEAD points to something strange" out
+ test_grep "HEAD points to something strange" out
'
-test_expect_success 'HEAD link pointing at a funny object (from different wt)' '
- test_when_finished "mv .git/SAVED_HEAD .git/HEAD" &&
- test_when_finished "rm -rf .git/worktrees wt" &&
+test_expect_success REFFILES 'HEAD link pointing at a funny object (from different wt)' '
+ test_when_finished "git update-ref HEAD $orig_head" &&
+ test_when_finished "git worktree remove -f wt" &&
git worktree add wt &&
- mv .git/HEAD .git/SAVED_HEAD &&
echo $ZERO_OID >.git/HEAD &&
# avoid corrupt/broken HEAD from interfering with repo discovery
test_must_fail git -C wt fsck 2>out &&
- test_i18ngrep "main-worktree/HEAD: detached HEAD points" out
+ test_grep "main-worktree/HEAD: detached HEAD points" out
'
-test_expect_success 'other worktree HEAD link pointing at a funny object' '
- test_when_finished "rm -rf .git/worktrees other" &&
+test_expect_success REFFILES 'other worktree HEAD link pointing at a funny object' '
+ test_when_finished "git worktree remove -f other" &&
git worktree add other &&
echo $ZERO_OID >.git/worktrees/other/HEAD &&
test_must_fail git fsck 2>out &&
- test_i18ngrep "worktrees/other/HEAD: detached HEAD points" out
+ test_grep "worktrees/other/HEAD: detached HEAD points" out
'
test_expect_success 'other worktree HEAD link pointing at missing object' '
- test_when_finished "rm -rf .git/worktrees other" &&
+ test_when_finished "git worktree remove -f other" &&
git worktree add other &&
- echo "Contents missing from repo" | git hash-object --stdin >.git/worktrees/other/HEAD &&
+ object_id=$(echo "Contents missing from repo" | git hash-object --stdin) &&
+ test-tool -C other ref-store main update-ref msg HEAD $object_id "" REF_NO_DEREF,REF_SKIP_OID_VERIFICATION &&
test_must_fail git fsck 2>out &&
- test_i18ngrep "worktrees/other/HEAD: invalid sha1 pointer" out
+ test_grep "worktrees/other/HEAD: invalid sha1 pointer" out
'
test_expect_success 'other worktree HEAD link pointing at a funny place' '
- test_when_finished "rm -rf .git/worktrees other" &&
+ test_when_finished "git worktree remove -f other" &&
git worktree add other &&
- echo "ref: refs/funny/place" >.git/worktrees/other/HEAD &&
+ git -C other symbolic-ref HEAD refs/funny/place &&
test_must_fail git fsck 2>out &&
- test_i18ngrep "worktrees/other/HEAD points to something strange" out
+ test_grep "worktrees/other/HEAD points to something strange" out
'
test_expect_success 'commit with multiple signatures is okay' '
@@ -212,45 +212,45 @@ test_expect_success 'email without @ is okay' '
test_expect_success 'email with embedded > is not okay' '
git cat-file commit HEAD >basis &&
sed "s/@[a-z]/&>/" basis >bad-email &&
- new=$(git hash-object -t commit -w --stdin <bad-email) &&
+ new=$(git hash-object --literally -t commit -w --stdin <bad-email) &&
test_when_finished "remove_object $new" &&
git update-ref refs/heads/bogus "$new" &&
test_when_finished "git update-ref -d refs/heads/bogus" &&
test_must_fail git fsck 2>out &&
- test_i18ngrep "error in commit $new" out
+ test_grep "error in commit $new" out
'
test_expect_success 'missing < email delimiter is reported nicely' '
git cat-file commit HEAD >basis &&
sed "s/<//" basis >bad-email-2 &&
- new=$(git hash-object -t commit -w --stdin <bad-email-2) &&
+ new=$(git hash-object --literally -t commit -w --stdin <bad-email-2) &&
test_when_finished "remove_object $new" &&
git update-ref refs/heads/bogus "$new" &&
test_when_finished "git update-ref -d refs/heads/bogus" &&
test_must_fail git fsck 2>out &&
- test_i18ngrep "error in commit $new.* - bad name" out
+ test_grep "error in commit $new.* - bad name" out
'
test_expect_success 'missing email is reported nicely' '
git cat-file commit HEAD >basis &&
sed "s/[a-z]* <[^>]*>//" basis >bad-email-3 &&
- new=$(git hash-object -t commit -w --stdin <bad-email-3) &&
+ new=$(git hash-object --literally -t commit -w --stdin <bad-email-3) &&
test_when_finished "remove_object $new" &&
git update-ref refs/heads/bogus "$new" &&
test_when_finished "git update-ref -d refs/heads/bogus" &&
test_must_fail git fsck 2>out &&
- test_i18ngrep "error in commit $new.* - missing email" out
+ test_grep "error in commit $new.* - missing email" out
'
test_expect_success '> in name is reported' '
git cat-file commit HEAD >basis &&
sed "s/ </> </" basis >bad-email-4 &&
- new=$(git hash-object -t commit -w --stdin <bad-email-4) &&
+ new=$(git hash-object --literally -t commit -w --stdin <bad-email-4) &&
test_when_finished "remove_object $new" &&
git update-ref refs/heads/bogus "$new" &&
test_when_finished "git update-ref -d refs/heads/bogus" &&
test_must_fail git fsck 2>out &&
- test_i18ngrep "error in commit $new" out
+ test_grep "error in commit $new" out
'
# date is 2^64 + 1
@@ -258,23 +258,23 @@ test_expect_success 'integer overflow in timestamps is reported' '
git cat-file commit HEAD >basis &&
sed "s/^\\(author .*>\\) [0-9]*/\\1 18446744073709551617/" \
<basis >bad-timestamp &&
- new=$(git hash-object -t commit -w --stdin <bad-timestamp) &&
+ new=$(git hash-object --literally -t commit -w --stdin <bad-timestamp) &&
test_when_finished "remove_object $new" &&
git update-ref refs/heads/bogus "$new" &&
test_when_finished "git update-ref -d refs/heads/bogus" &&
test_must_fail git fsck 2>out &&
- test_i18ngrep "error in commit $new.*integer overflow" out
+ test_grep "error in commit $new.*integer overflow" out
'
test_expect_success 'commit with NUL in header' '
git cat-file commit HEAD >basis &&
sed "s/author ./author Q/" <basis | q_to_nul >commit-NUL-header &&
- new=$(git hash-object -t commit -w --stdin <commit-NUL-header) &&
+ new=$(git hash-object --literally -t commit -w --stdin <commit-NUL-header) &&
test_when_finished "remove_object $new" &&
git update-ref refs/heads/bogus "$new" &&
test_when_finished "git update-ref -d refs/heads/bogus" &&
test_must_fail git fsck 2>out &&
- test_i18ngrep "error in commit $new.*unterminated header: NUL at offset" out
+ test_grep "error in commit $new.*unterminated header: NUL at offset" out
'
test_expect_success 'tree object with duplicate entries' '
@@ -292,10 +292,10 @@ test_expect_success 'tree object with duplicate entries' '
git cat-file tree $T &&
git cat-file tree $T
) |
- git hash-object -w -t tree --stdin
+ git hash-object --literally -w -t tree --stdin
) &&
test_must_fail git fsck 2>out &&
- test_i18ngrep "error in tree .*contains duplicate file entries" out
+ test_grep "error in tree .*contains duplicate file entries" out
'
check_duplicate_names () {
@@ -318,8 +318,8 @@ check_duplicate_names () {
done >badtree &&
badtree=$(git mktree <badtree) &&
test_must_fail git fsck 2>out &&
- test_i18ngrep "$badtree" out &&
- test_i18ngrep "error in tree .*contains duplicate file entries" out
+ test_grep "$badtree" out &&
+ test_grep "error in tree .*contains duplicate file entries" out
'
}
@@ -341,9 +341,9 @@ test_expect_success 'unparseable tree object' '
commit_sha1=$(git commit-tree $tree_sha1) &&
git update-ref refs/heads/wrong $commit_sha1 &&
test_must_fail git fsck 2>out &&
- test_i18ngrep "error: empty filename in tree entry" out &&
- test_i18ngrep "$tree_sha1" out &&
- test_i18ngrep ! "fatal: empty filename in tree entry" out
+ test_grep "error: empty filename in tree entry" out &&
+ test_grep "$tree_sha1" out &&
+ test_grep ! "fatal: empty filename in tree entry" out
'
test_expect_success 'tree entry with type mismatch' '
@@ -360,8 +360,22 @@ test_expect_success 'tree entry with type mismatch' '
commit=$(git commit-tree $tree) &&
git update-ref refs/heads/type_mismatch $commit &&
test_must_fail git fsck >out 2>&1 &&
- test_i18ngrep "is a blob, not a tree" out &&
- test_i18ngrep ! "dangling blob" out
+ test_grep "is a blob, not a tree" out &&
+ test_grep ! "dangling blob" out
+'
+
+test_expect_success 'tree entry with bogus mode' '
+ test_when_finished "remove_object \$blob" &&
+ test_when_finished "remove_object \$tree" &&
+ blob=$(echo blob | git hash-object -w --stdin) &&
+ blob_oct=$(echo $blob | hex2oct) &&
+ tree=$(printf "100000 foo\0${blob_oct}" |
+ git hash-object -t tree --stdin -w --literally) &&
+ git fsck 2>err &&
+ cat >expect <<-EOF &&
+ warning in tree $tree: badFilemode: contains bad file modes
+ EOF
+ test_cmp expect err
'
test_expect_success 'tag pointing to nonexistent' '
@@ -377,10 +391,10 @@ test_expect_success 'tag pointing to nonexistent' '
tag=$(git hash-object -t tag -w --stdin <invalid-tag) &&
test_when_finished "remove_object $tag" &&
- echo $tag >.git/refs/tags/invalid &&
+ git update-ref refs/tags/invalid $tag &&
test_when_finished "git update-ref -d refs/tags/invalid" &&
test_must_fail git fsck --tags >out &&
- test_i18ngrep "broken link" out
+ test_grep "broken link" out
'
test_expect_success 'tag pointing to something else than its type' '
@@ -397,7 +411,7 @@ test_expect_success 'tag pointing to something else than its type' '
tag=$(git hash-object -t tag -w --stdin <wrong-tag) &&
test_when_finished "remove_object $tag" &&
- echo $tag >.git/refs/tags/wrong &&
+ git update-ref refs/tags/wrong $tag &&
test_when_finished "git update-ref -d refs/tags/wrong" &&
test_must_fail git fsck --tags
'
@@ -412,9 +426,9 @@ test_expect_success 'tag with incorrect tag name & missing tagger' '
This is an invalid tag.
EOF
- tag=$(git hash-object -t tag -w --stdin <wrong-tag) &&
+ tag=$(git hash-object --literally -t tag -w --stdin <wrong-tag) &&
test_when_finished "remove_object $tag" &&
- echo $tag >.git/refs/tags/wrong &&
+ git update-ref refs/tags/wrong $tag &&
test_when_finished "git update-ref -d refs/tags/wrong" &&
git fsck --tags 2>out &&
@@ -438,10 +452,10 @@ test_expect_success 'tag with bad tagger' '
tag=$(git hash-object --literally -t tag -w --stdin <wrong-tag) &&
test_when_finished "remove_object $tag" &&
- echo $tag >.git/refs/tags/wrong &&
+ git update-ref refs/tags/wrong $tag &&
test_when_finished "git update-ref -d refs/tags/wrong" &&
test_must_fail git fsck --tags 2>out &&
- test_i18ngrep "error in tag .*: invalid author/committer" out
+ test_grep "error in tag .*: invalid author/committer" out
'
test_expect_success 'tag with NUL in header' '
@@ -457,10 +471,10 @@ test_expect_success 'tag with NUL in header' '
tag=$(git hash-object --literally -t tag -w --stdin <tag-NUL-header) &&
test_when_finished "remove_object $tag" &&
- echo $tag >.git/refs/tags/wrong &&
+ git update-ref refs/tags/wrong $tag &&
test_when_finished "git update-ref -d refs/tags/wrong" &&
test_must_fail git fsck --tags 2>out &&
- test_i18ngrep "error in tag $tag.*unterminated header: NUL at offset" out
+ test_grep "error in tag $tag.*unterminated header: NUL at offset" out
'
test_expect_success 'cleaned up' '
@@ -490,13 +504,61 @@ test_expect_success 'rev-list --verify-objects with bad sha1' '
test_when_finished "git update-ref -d refs/heads/bogus" &&
test_might_fail git rev-list --verify-objects refs/heads/bogus >/dev/null 2>out &&
- test_i18ngrep -q "error: hash mismatch $(dirname $new)$(test_oid ff_2)" out
+ test_grep -q "error: hash mismatch $(dirname $new)$(test_oid ff_2)" out
+'
+
+# An actual bit corruption is more likely than swapped commits, but
+# this provides an easy way to have commits which don't match their purported
+# hashes, but which aren't so broken we can't read them at all.
+test_expect_success 'rev-list --verify-objects notices swapped commits' '
+ git init swapped-commits &&
+ (
+ cd swapped-commits &&
+ test_commit one &&
+ test_commit two &&
+ one_oid=$(git rev-parse HEAD) &&
+ two_oid=$(git rev-parse HEAD^) &&
+ one=.git/objects/$(test_oid_to_path $one_oid) &&
+ two=.git/objects/$(test_oid_to_path $two_oid) &&
+ mv $one tmp &&
+ mv $two $one &&
+ mv tmp $two &&
+ test_must_fail git rev-list --verify-objects HEAD
+ )
+'
+
+test_expect_success 'set up repository with commit-graph' '
+ git init corrupt-graph &&
+ (
+ cd corrupt-graph &&
+ test_commit one &&
+ test_commit two &&
+ git commit-graph write --reachable
+ )
+'
+
+corrupt_graph_obj () {
+ oid=$(git -C corrupt-graph rev-parse "$1") &&
+ obj=corrupt-graph/.git/objects/$(test_oid_to_path $oid) &&
+ test_when_finished 'mv backup $obj' &&
+ mv $obj backup &&
+ echo garbage >$obj
+}
+
+test_expect_success 'rev-list --verify-objects with commit graph (tip)' '
+ corrupt_graph_obj HEAD &&
+ test_must_fail git -C corrupt-graph rev-list --verify-objects HEAD
+'
+
+test_expect_success 'rev-list --verify-objects with commit graph (parent)' '
+ corrupt_graph_obj HEAD^ &&
+ test_must_fail git -C corrupt-graph rev-list --verify-objects HEAD
'
test_expect_success 'force fsck to ignore double author' '
git cat-file commit HEAD >basis &&
sed "s/^author .*/&,&/" <basis | tr , \\n >multiple-authors &&
- new=$(git hash-object -t commit -w --stdin <multiple-authors) &&
+ new=$(git hash-object --literally -t commit -w --stdin <multiple-authors) &&
test_when_finished "remove_object $new" &&
git update-ref refs/heads/bogus "$new" &&
test_when_finished "git update-ref -d refs/heads/bogus" &&
@@ -511,9 +573,9 @@ test_expect_success 'fsck notices blob entry pointing to null sha1' '
(git init null-blob &&
cd null-blob &&
sha=$(printf "100644 file$_bz$_bzoid" |
- git hash-object -w --stdin -t tree) &&
+ git hash-object --literally -w --stdin -t tree) &&
git fsck 2>out &&
- test_i18ngrep "warning.*null sha1" out
+ test_grep "warning.*null sha1" out
)
'
@@ -521,9 +583,19 @@ test_expect_success 'fsck notices submodule entry pointing to null sha1' '
(git init null-commit &&
cd null-commit &&
sha=$(printf "160000 submodule$_bz$_bzoid" |
- git hash-object -w --stdin -t tree) &&
+ git hash-object --literally -w --stdin -t tree) &&
git fsck 2>out &&
- test_i18ngrep "warning.*null sha1" out
+ test_grep "warning.*null sha1" out
+ )
+'
+
+test_expect_success 'fsck notices excessively large tree entry name' '
+ git init large-name &&
+ (
+ cd large-name &&
+ test_commit a-long-name &&
+ git -c fsck.largePathname=warn:10 fsck 2>out &&
+ grep "warning.*large pathname" out
)
'
@@ -544,7 +616,7 @@ while read name path pretty; do
printf "$mode $type %s\t%s" "$value" "$path" >bad &&
bad_tree=$(git mktree <bad) &&
git fsck 2>out &&
- test_i18ngrep "warning.*tree $bad_tree" out
+ test_grep "warning.*tree $bad_tree" out
)'
done <<-\EOF
100644 blob
@@ -586,13 +658,13 @@ test_expect_success 'NUL in commit' '
git commit --allow-empty -m "initial commitQNUL after message" &&
git cat-file commit HEAD >original &&
q_to_nul <original >munged &&
- git hash-object -w -t commit --stdin <munged >name &&
+ git hash-object --literally -w -t commit --stdin <munged >name &&
git branch bad $(cat name) &&
test_must_fail git -c fsck.nulInCommit=error fsck 2>warn.1 &&
- test_i18ngrep nulInCommit warn.1 &&
+ test_grep nulInCommit warn.1 &&
git fsck 2>warn.2 &&
- test_i18ngrep nulInCommit warn.2
+ test_grep nulInCommit warn.2
)
'
@@ -712,7 +784,7 @@ test_expect_success 'fsck --name-objects' '
tree=$(git rev-parse --verify julius:) &&
git tag -d julius &&
test_must_fail git fsck --name-objects >out &&
- test_i18ngrep "$tree (refs/tags/augustus44\\^:" out
+ test_grep "$tree (refs/tags/augustus44\\^:" out
)
'
@@ -725,15 +797,15 @@ test_expect_success 'alternate objects are correctly blamed' '
mkdir alt.git/objects/$(dirname $path) &&
>alt.git/objects/$(dirname $path)/$(basename $path) &&
test_must_fail git fsck >out 2>&1 &&
- test_i18ngrep alt.git out
+ test_grep alt.git out
'
test_expect_success 'fsck errors in packed objects' '
git cat-file commit HEAD >basis &&
sed "s/</one/" basis >one &&
sed "s/</foo/" basis >two &&
- one=$(git hash-object -t commit -w one) &&
- two=$(git hash-object -t commit -w two) &&
+ one=$(git hash-object --literally -t commit -w one) &&
+ two=$(git hash-object --literally -t commit -w two) &&
pack=$(
{
echo $one &&
@@ -744,8 +816,8 @@ test_expect_success 'fsck errors in packed objects' '
remove_object $one &&
remove_object $two &&
test_must_fail git fsck 2>out &&
- test_i18ngrep "error in commit $one.* - bad name" out &&
- test_i18ngrep "error in commit $two.* - bad name" out &&
+ test_grep "error in commit $one.* - bad name" out &&
+ test_grep "error in commit $two.* - bad name" out &&
! grep corrupt out
'
@@ -762,7 +834,7 @@ test_expect_success 'fsck fails on corrupt packfile' '
test_when_finished "rm -f .git/objects/pack/pack-$pack.*" &&
remove_object $hsh &&
test_must_fail git fsck 2>out &&
- test_i18ngrep "checksum mismatch" out
+ test_grep "checksum mismatch" out
'
test_expect_success 'fsck finds problems in duplicate loose objects' '
@@ -799,7 +871,7 @@ test_expect_success 'fsck detects trailing loose garbage (commit)' '
chmod +w "$file" &&
echo garbage >>"$file" &&
test_must_fail git fsck 2>out &&
- test_i18ngrep "garbage.*$commit" out
+ test_grep "garbage.*$commit" out
'
test_expect_success 'fsck detects trailing loose garbage (large blob)' '
@@ -809,7 +881,7 @@ test_expect_success 'fsck detects trailing loose garbage (large blob)' '
chmod +w "$file" &&
echo garbage >>"$file" &&
test_must_fail git -c core.bigfilethreshold=5 fsck 2>out &&
- test_i18ngrep "garbage.*$blob" out
+ test_grep "garbage.*$blob" out
'
test_expect_success 'fsck detects truncated loose object' '
@@ -825,10 +897,10 @@ test_expect_success 'fsck detects truncated loose object' '
# check both regular and streaming code paths
test_must_fail git fsck 2>out &&
- test_i18ngrep corrupt.*$blob out &&
+ test_grep corrupt.*$blob out &&
test_must_fail git -c core.bigfilethreshold=128 fsck 2>out &&
- test_i18ngrep corrupt.*$blob out
+ test_grep corrupt.*$blob out
'
# for each of type, we have one version which is referenced by another object
@@ -917,7 +989,7 @@ test_expect_success 'detect corrupt index file in fsck' '
test_when_finished "mv .git/index.backup .git/index" &&
corrupt_index_checksum &&
test_must_fail git fsck --cache 2>errors &&
- test_i18ngrep "bad index file" errors
+ test_grep "bad index file" errors
'
test_expect_success 'fsck error and recovery on invalid object type' '
@@ -927,14 +999,65 @@ test_expect_success 'fsck error and recovery on invalid object type' '
garbage_blob=$(git hash-object --stdin -w -t garbage --literally </dev/null) &&
- cat >err.expect <<-\EOF &&
- fatal: invalid object type
- EOF
- test_must_fail git fsck >out 2>err &&
+ test_must_fail git fsck 2>err &&
grep -e "^error" -e "^fatal" err >errors &&
test_line_count = 1 errors &&
grep "$garbage_blob: object is of unknown type '"'"'garbage'"'"':" err
)
'
+test_expect_success 'fsck error on gitattributes with excessive line lengths' '
+ blob=$(printf "pattern %02048d" 1 | git hash-object -w --stdin) &&
+ test_when_finished "remove_object $blob" &&
+ tree=$(printf "100644 blob %s\t%s\n" $blob .gitattributes | git mktree) &&
+ test_when_finished "remove_object $tree" &&
+ cat >expected <<-EOF &&
+ error in blob $blob: gitattributesLineLength: .gitattributes has too long lines to parse
+ EOF
+ test_must_fail git fsck --no-dangling >actual 2>&1 &&
+ test_cmp expected actual
+'
+
+test_expect_success 'fsck error on gitattributes with excessive size' '
+ blob=$(test-tool genzeros $((100 * 1024 * 1024 + 1)) | git hash-object -w --stdin) &&
+ test_when_finished "remove_object $blob" &&
+ tree=$(printf "100644 blob %s\t%s\n" $blob .gitattributes | git mktree) &&
+ test_when_finished "remove_object $tree" &&
+ cat >expected <<-EOF &&
+ error in blob $blob: gitattributesLarge: .gitattributes too large to parse
+ EOF
+ test_must_fail git fsck --no-dangling >actual 2>&1 &&
+ test_cmp expected actual
+'
+
+test_expect_success 'fsck detects problems in worktree index' '
+ test_when_finished "git worktree remove -f wt" &&
+ git worktree add wt &&
+
+ echo "this will be removed to break the worktree index" >wt/file &&
+ git -C wt add file &&
+ blob=$(git -C wt rev-parse :file) &&
+ remove_object $blob &&
+
+ test_must_fail git fsck --name-objects >actual 2>&1 &&
+ cat >expect <<-EOF &&
+ missing blob $blob (.git/worktrees/wt/index:file)
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'fsck reports problems in current worktree index without filename' '
+ test_when_finished "rm -f .git/index && git read-tree HEAD" &&
+ echo "this object will be removed to break current worktree index" >file &&
+ git add file &&
+ blob=$(git rev-parse :file) &&
+ remove_object $blob &&
+
+ test_must_fail git fsck --name-objects >actual 2>&1 &&
+ cat >expect <<-EOF &&
+ missing blob $blob (:file)
+ EOF
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t1451-fsck-buffer.sh b/t/t1451-fsck-buffer.sh
new file mode 100755
index 0000000..3413da4
--- /dev/null
+++ b/t/t1451-fsck-buffer.sh
@@ -0,0 +1,142 @@
+#!/bin/sh
+
+test_description='fsck on buffers without NUL termination
+
+The goal here is to make sure that the various fsck parsers never look
+past the end of the buffer they are given, even when encountering broken
+or truncated objects.
+
+We have to use "hash-object" for this because most code paths that read objects
+append an extra NUL for safety after the buffer. But hash-object, since it is
+reading straight from a file (and possibly even mmap-ing it) cannot always do
+so.
+
+These tests _might_ catch such overruns in normal use, but should be run with
+ASan or valgrind for more confidence.
+'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+# the general idea for tags and commits is to build up the "base" file
+# progressively, and then test new truncations on top of it.
+reset () {
+ test_expect_success 'reset input to empty' '
+ >base
+ '
+}
+
+add () {
+ content="$1"
+ type=${content%% *}
+ test_expect_success "add $type line" '
+ echo "$content" >>base
+ '
+}
+
+check () {
+ type=$1
+ fsck=$2
+ content=$3
+ test_expect_success "truncated $type ($fsck, \"$content\")" '
+ # do not pipe into hash-object here; we want to increase
+ # the chance that it uses a fixed-size buffer or mmap,
+ # and a pipe would be read into a strbuf.
+ {
+ cat base &&
+ echo "$content"
+ } >input &&
+ test_must_fail git hash-object -t "$type" input 2>err &&
+ grep "$fsck" err
+ '
+}
+
+test_expect_success 'create valid objects' '
+ git commit --allow-empty -m foo &&
+ commit=$(git rev-parse --verify HEAD) &&
+ tree=$(git rev-parse --verify HEAD^{tree})
+'
+
+reset
+check commit missingTree ""
+check commit missingTree "tr"
+check commit missingTree "tree"
+check commit badTreeSha1 "tree "
+check commit badTreeSha1 "tree 1234"
+add "tree $tree"
+
+# these expect missingAuthor because "parent" is optional
+check commit missingAuthor ""
+check commit missingAuthor "par"
+check commit missingAuthor "parent"
+check commit badParentSha1 "parent "
+check commit badParentSha1 "parent 1234"
+add "parent $commit"
+
+check commit missingAuthor ""
+check commit missingAuthor "au"
+check commit missingAuthor "author"
+ident_checks () {
+ check $1 missingEmail "$2 "
+ check $1 missingEmail "$2 name"
+ check $1 badEmail "$2 name <"
+ check $1 badEmail "$2 name <email"
+ check $1 missingSpaceBeforeDate "$2 name <email>"
+ check $1 badDate "$2 name <email> "
+ check $1 badDate "$2 name <email> 1234"
+ check $1 badTimezone "$2 name <email> 1234 "
+ check $1 badTimezone "$2 name <email> 1234 +"
+}
+ident_checks commit author
+add "author name <email> 1234 +0000"
+
+check commit missingCommitter ""
+check commit missingCommitter "co"
+check commit missingCommitter "committer"
+ident_checks commit committer
+add "committer name <email> 1234 +0000"
+
+reset
+check tag missingObject ""
+check tag missingObject "obj"
+check tag missingObject "object"
+check tag badObjectSha1 "object "
+check tag badObjectSha1 "object 1234"
+add "object $commit"
+
+check tag missingType ""
+check tag missingType "ty"
+check tag missingType "type"
+check tag badType "type "
+check tag badType "type com"
+add "type commit"
+
+check tag missingTagEntry ""
+check tag missingTagEntry "ta"
+check tag missingTagEntry "tag"
+check tag badTagName "tag "
+add "tag foo"
+
+check tag missingTagger ""
+check tag missingTagger "ta"
+check tag missingTagger "tagger"
+ident_checks tag tagger
+
+# trees are a binary format and can't use our earlier helpers
+test_expect_success 'truncated tree (short hash)' '
+ printf "100644 foo\0\1\1\1\1" >input &&
+ test_must_fail git hash-object -t tree input 2>err &&
+ grep badTree err
+'
+
+test_expect_success 'truncated tree (missing nul)' '
+ # these two things are indistinguishable to the parser. The important
+ # thing about this is example is that there are enough bytes to
+ # make up a hash, and that there is no NUL (and we confirm that the
+ # parser does not walk past the end of the buffer).
+ printf "100644 a long filename, or a hash with missing nul?" >input &&
+ test_must_fail git hash-object -t tree input 2>err &&
+ grep badTree err
+'
+
+test_done
diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh
index 1c2df08..a669e59 100755
--- a/t/t1500-rev-parse.sh
+++ b/t/t1500-rev-parse.sh
@@ -4,6 +4,7 @@ test_description='test git rev-parse'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_one () {
@@ -194,7 +195,7 @@ test_expect_success 'rev-parse --is-shallow-repository in non-shallow repo' '
'
test_expect_success 'rev-parse --show-object-format in repo' '
- echo "$(test_oid algo)" >expect &&
+ test_oid algo >expect &&
git rev-parse --show-object-format >actual &&
test_cmp expect actual &&
git rev-parse --show-object-format=storage >actual &&
@@ -207,6 +208,23 @@ test_expect_success 'rev-parse --show-object-format in repo' '
grep "unknown mode for --show-object-format: squeamish-ossifrage" err
'
+test_expect_success 'rev-parse --show-ref-format' '
+ test_detect_ref_format >expect &&
+ git rev-parse --show-ref-format >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'rev-parse --show-ref-format with invalid storage' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ git config extensions.refstorage broken &&
+ test_must_fail git rev-parse --show-ref-format 2>err &&
+ grep "error: invalid value for ${SQ}extensions.refstorage${SQ}: ${SQ}broken${SQ}" err
+ )
+'
+
test_expect_success '--show-toplevel from subdir of working tree' '
pwd >expect &&
git -C sub/dir rev-parse --show-toplevel >actual &&
@@ -225,7 +243,8 @@ test_expect_success 'showing the superproject correctly' '
test_commit -C super test_commit &&
test_create_repo sub &&
test_commit -C sub test_commit &&
- git -C super submodule add ../sub dir/sub &&
+ git -c protocol.file.allow=always \
+ -C super submodule add ../sub dir/sub &&
echo $(pwd)/super >expect &&
git -C super/dir/sub rev-parse --show-superproject-working-tree >out &&
test_cmp expect out &&
@@ -262,4 +281,27 @@ test_expect_success 'rev-parse --since= unsqueezed ordering' '
test_cmp expect actual
'
+test_expect_success 'rev-parse --bisect includes bad, excludes good' '
+ test_commit_bulk 6 &&
+
+ git update-ref refs/bisect/bad-1 HEAD~1 &&
+ git update-ref refs/bisect/b HEAD~2 &&
+ git update-ref refs/bisect/bad-3 HEAD~3 &&
+ git update-ref refs/bisect/good-3 HEAD~3 &&
+ git update-ref refs/bisect/bad-4 HEAD~4 &&
+ git update-ref refs/bisect/go HEAD~4 &&
+
+ # Note: refs/bisect/b and refs/bisect/go should be ignored because they
+ # do not match the refs/bisect/bad or refs/bisect/good prefixes.
+ cat >expect <<-EOF &&
+ refs/bisect/bad-1
+ refs/bisect/bad-3
+ refs/bisect/bad-4
+ ^refs/bisect/good-3
+ EOF
+
+ git rev-parse --symbolic-full-name --bisect >actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t1501-work-tree.sh b/t/t1501-work-tree.sh
index b755580..ae6528a 100755
--- a/t/t1501-work-tree.sh
+++ b/t/t1501-work-tree.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='test separate work tree'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
diff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh
index 284fe18..b754b9f 100755
--- a/t/t1502-rev-parse-parseopt.sh
+++ b/t/t1502-rev-parse-parseopt.sh
@@ -3,13 +3,29 @@
test_description='test git rev-parse --parseopt'
. ./test-lib.sh
+check_invalid_long_option () {
+ spec="$1"
+ opt="$2"
+ test_expect_success "test --parseopt invalid switch $opt help output for $spec" '
+ {
+ cat <<-\EOF &&
+ error: unknown option `'${opt#--}\''
+ EOF
+ sed -e 1d -e \$d <"$TEST_DIRECTORY/t1502/$spec.help"
+ } >expect &&
+ test_expect_code 129 git rev-parse --parseopt -- $opt \
+ 2>output <"$TEST_DIRECTORY/t1502/$spec" &&
+ test_cmp expect output
+ '
+}
+
test_expect_success 'setup optionspec' '
sed -e "s/^|//" >optionspec <<\EOF
|some-command [options] <args>...
|
|some-command does foo and bar!
|--
-|h,help show the help
+|h,help! show the help
|
|foo some nifty option --foo
|bar= some cool option --bar with an argument
@@ -58,44 +74,8 @@ EOF
'
test_expect_success 'test --parseopt help output' '
- sed -e "s/^|//" >expect <<\END_EXPECT &&
-|cat <<\EOF
-|usage: some-command [options] <args>...
-|
-| some-command does foo and bar!
-|
-| -h, --help show the help
-| --foo some nifty option --foo
-| --bar ... some cool option --bar with an argument
-| -b, --baz a short and long option
-|
-|An option group Header
-| -C[...] option C with an optional argument
-| -d, --data[=...] short and long option with an optional argument
-|
-|Argument hints
-| -B <arg> short option required argument
-| --bar2 <arg> long option required argument
-| -e, --fuz <with-space>
-| short and long option required argument
-| -s[<some>] short option optional argument
-| --long[=<data>] long option optional argument
-| -g, --fluf[=<path>] short and long option optional argument
-| --longest <very-long-argument-hint>
-| a very long argument hint
-| --pair <key=value> with an equals sign in the hint
-| --aswitch help te=t contains? fl*g characters!`
-| --bswitch <hint> hint has trailing tab character
-| --cswitch switch has trailing tab character
-| --short-hint <a> with a one symbol hint
-|
-|Extras
-| --extra1 line above used to cause a segfault but no longer does
-|
-|EOF
-END_EXPECT
test_expect_code 129 git rev-parse --parseopt -- -h > output < optionspec &&
- test_cmp expect output
+ test_cmp "$TEST_DIRECTORY/t1502/optionspec.help" output
'
test_expect_success 'test --parseopt help output no switches' '
@@ -131,7 +111,7 @@ test_expect_success 'test --parseopt help-all output hidden switches' '
|
| some-command does foo and bar!
|
-| --hidden1 A hidden switch
+| --[no-]hidden1 A hidden switch
|
|EOF
END_EXPECT
@@ -140,41 +120,12 @@ END_EXPECT
'
test_expect_success 'test --parseopt invalid switch help output' '
- sed -e "s/^|//" >expect <<\END_EXPECT &&
-|error: unknown option `does-not-exist'\''
-|usage: some-command [options] <args>...
-|
-| some-command does foo and bar!
-|
-| -h, --help show the help
-| --foo some nifty option --foo
-| --bar ... some cool option --bar with an argument
-| -b, --baz a short and long option
-|
-|An option group Header
-| -C[...] option C with an optional argument
-| -d, --data[=...] short and long option with an optional argument
-|
-|Argument hints
-| -B <arg> short option required argument
-| --bar2 <arg> long option required argument
-| -e, --fuz <with-space>
-| short and long option required argument
-| -s[<some>] short option optional argument
-| --long[=<data>] long option optional argument
-| -g, --fluf[=<path>] short and long option optional argument
-| --longest <very-long-argument-hint>
-| a very long argument hint
-| --pair <key=value> with an equals sign in the hint
-| --aswitch help te=t contains? fl*g characters!`
-| --bswitch <hint> hint has trailing tab character
-| --cswitch switch has trailing tab character
-| --short-hint <a> with a one symbol hint
-|
-|Extras
-| --extra1 line above used to cause a segfault but no longer does
-|
-END_EXPECT
+ {
+ cat <<-\EOF &&
+ error: unknown option `does-not-exist'\''
+ EOF
+ sed -e 1d -e \$d <"$TEST_DIRECTORY/t1502/optionspec.help"
+ } >expect &&
test_expect_code 129 git rev-parse --parseopt -- --does-not-exist 1>/dev/null 2>output < optionspec &&
test_cmp expect output
'
@@ -288,7 +239,7 @@ test_expect_success 'test --parseopt help output: "wrapped" options normal "or:"
| [--another-option]
|cmd [--yet-another-option]
|--
- |h,help show the help
+ |h,help! show the help
EOF
sed -e "s/^|//" >expect <<-\END_EXPECT &&
@@ -302,10 +253,17 @@ test_expect_success 'test --parseopt help output: "wrapped" options normal "or:"
|EOF
END_EXPECT
- test_must_fail git rev-parse --parseopt -- -h >out <spec >actual &&
+ test_must_fail git rev-parse --parseopt -- -h <spec >actual &&
test_cmp expect actual
'
+test_expect_success 'test --parseopt invalid opt-spec' '
+ test_write_lines x -- "=, x" >spec &&
+ echo "fatal: missing opt-spec before option flags" >expect &&
+ test_must_fail git rev-parse --parseopt -- <spec 2>err &&
+ test_cmp expect err
+'
+
test_expect_success 'test --parseopt help output: multi-line blurb after empty line' '
sed -e "s/^|//" >spec <<-\EOF &&
|cmd [--some-option]
@@ -315,7 +273,7 @@ test_expect_success 'test --parseopt help output: multi-line blurb after empty l
|line
|blurb
|--
- |h,help show the help
+ |h,help! show the help
EOF
sed -e "s/^|//" >expect <<-\END_EXPECT &&
@@ -332,8 +290,47 @@ test_expect_success 'test --parseopt help output: multi-line blurb after empty l
|EOF
END_EXPECT
- test_must_fail git rev-parse --parseopt -- -h >out <spec >actual &&
+ test_must_fail git rev-parse --parseopt -- -h <spec >actual &&
test_cmp expect actual
'
+test_expect_success 'test --parseopt help output for optionspec-neg' '
+ test_expect_code 129 git rev-parse --parseopt -- \
+ -h >output <"$TEST_DIRECTORY/t1502/optionspec-neg" &&
+ test_cmp "$TEST_DIRECTORY/t1502/optionspec-neg.help" output
+'
+
+test_expect_success 'test --parseopt valid options for optionspec-neg' '
+ cat >expect <<-\EOF &&
+ set -- --foo --no-foo --no-bar --positive-only --no-negative --
+ EOF
+ git rev-parse --parseopt -- <"$TEST_DIRECTORY/t1502/optionspec-neg" >output \
+ --foo --no-foo --no-bar --positive-only --no-negative &&
+ test_cmp expect output
+'
+
+test_expect_success 'test --parseopt positivated option for optionspec-neg' '
+ cat >expect <<-\EOF &&
+ set -- --no-no-bar --no-no-bar --
+ EOF
+ git rev-parse --parseopt -- <"$TEST_DIRECTORY/t1502/optionspec-neg" >output \
+ --no-no-bar --bar &&
+ test_cmp expect output
+'
+
+check_invalid_long_option optionspec-neg --no-positive-only
+check_invalid_long_option optionspec-neg --negative
+check_invalid_long_option optionspec-neg --no-no-negative
+
+test_expect_success 'ambiguous: --no matches both --noble and --no-noble' '
+ cat >spec <<-\EOF &&
+ some-command [options]
+ --
+ noble The feudal switch.
+ EOF
+ test_expect_code 129 env GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS=false \
+ git rev-parse --parseopt -- <spec 2>err --no &&
+ grep "error: ambiguous option: no (could be --noble or --no-noble)" err
+'
+
test_done
diff --git a/t/t1502/.gitattributes b/t/t1502/.gitattributes
new file mode 100644
index 0000000..562b12e
--- /dev/null
+++ b/t/t1502/.gitattributes
@@ -0,0 +1 @@
+* -whitespace
diff --git a/t/t1502/optionspec-neg b/t/t1502/optionspec-neg
new file mode 100644
index 0000000..392f43e
--- /dev/null
+++ b/t/t1502/optionspec-neg
@@ -0,0 +1,8 @@
+some-command [options] <args>...
+
+some-command does foo and bar!
+--
+foo can be negated
+no-bar can be positivated
+positive-only! cannot be negated
+no-negative! cannot be positivated
diff --git a/t/t1502/optionspec-neg.help b/t/t1502/optionspec-neg.help
new file mode 100644
index 0000000..7a29f8c
--- /dev/null
+++ b/t/t1502/optionspec-neg.help
@@ -0,0 +1,12 @@
+cat <<\EOF
+usage: some-command [options] <args>...
+
+ some-command does foo and bar!
+
+ --[no-]foo can be negated
+ --no-bar can be positivated
+ --bar opposite of --no-bar
+ --positive-only cannot be negated
+ --no-negative cannot be positivated
+
+EOF
diff --git a/t/t1502/optionspec.help b/t/t1502/optionspec.help
new file mode 100755
index 0000000..cbdd54d
--- /dev/null
+++ b/t/t1502/optionspec.help
@@ -0,0 +1,36 @@
+cat <<\EOF
+usage: some-command [options] <args>...
+
+ some-command does foo and bar!
+
+ -h, --help show the help
+ --[no-]foo some nifty option --foo
+ --[no-]bar ... some cool option --bar with an argument
+ -b, --[no-]baz a short and long option
+
+An option group Header
+ -C[...] option C with an optional argument
+ -d, --[no-]data[=...] short and long option with an optional argument
+
+Argument hints
+ -B <arg> short option required argument
+ --[no-]bar2 <arg> long option required argument
+ -e, --[no-]fuz <with-space>
+ short and long option required argument
+ -s[<some>] short option optional argument
+ --[no-]long[=<data>] long option optional argument
+ -g, --[no-]fluf[=<path>]
+ short and long option optional argument
+ --[no-]longest <very-long-argument-hint>
+ a very long argument hint
+ --[no-]pair <key=value>
+ with an equals sign in the hint
+ --[no-]aswitch help te=t contains? fl*g characters!`
+ --[no-]bswitch <hint> hint has trailing tab character
+ --[no-]cswitch switch has trailing tab character
+ --[no-]short-hint <a> with a one symbol hint
+
+Extras
+ --[no-]extra1 line above used to cause a segfault but no longer does
+
+EOF
diff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh
index ba43168..79df65e 100755
--- a/t/t1503-rev-parse-verify.sh
+++ b/t/t1503-rev-parse-verify.sh
@@ -132,7 +132,7 @@ test_expect_success 'use --default' '
test_must_fail git rev-parse --verify --default bar
'
-test_expect_success !SANITIZE_LEAK 'main@{n} for various n' '
+test_expect_success 'main@{n} for various n' '
git reflog >out &&
N=$(wc -l <out) &&
Nm1=$(($N-1)) &&
@@ -144,11 +144,6 @@ test_expect_success !SANITIZE_LEAK 'main@{n} for various n' '
test_must_fail git rev-parse --verify main@{$Np1}
'
-test_expect_success SYMLINKS,REFFILES 'ref resolution not confused by broken symlinks' '
- ln -s does-not-exist .git/refs/heads/broken &&
- test_must_fail git rev-parse --verify broken
-'
-
test_expect_success 'options can appear after --verify' '
git rev-parse --verify HEAD >expect &&
git rev-parse --verify -q HEAD >actual &&
diff --git a/t/t1504-ceiling-dirs.sh b/t/t1504-ceiling-dirs.sh
index 0fafcf9..c1679e3 100755
--- a/t/t1504-ceiling-dirs.sh
+++ b/t/t1504-ceiling-dirs.sh
@@ -6,8 +6,12 @@ TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_prefix() {
- test_expect_success "$1" \
- "test '$2' = \"\$(git rev-parse --show-prefix)\""
+ local expect="$2" &&
+ test_expect_success "$1: git rev-parse --show-prefix is '$2'" '
+ echo "$expect" >expect &&
+ git rev-parse --show-prefix >actual &&
+ test_cmp expect actual
+ '
}
test_fail() {
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
index 18688ca..ef40511 100755
--- a/t/t1506-rev-parse-diagnosis.sh
+++ b/t/t1506-rev-parse-diagnosis.sh
@@ -107,16 +107,16 @@ test_expect_success 'correct relative file objects (6)' '
test_expect_success 'incorrect revision id' '
test_must_fail git rev-parse foobar:file.txt 2>error &&
- test_i18ngrep "invalid object name .foobar." error &&
+ test_grep "invalid object name .foobar." error &&
test_must_fail git rev-parse foobar 2>error &&
- test_i18ngrep "unknown revision or path not in the working tree." error
+ test_grep "unknown revision or path not in the working tree." error
'
test_expect_success 'incorrect file in sha1:path' '
test_must_fail git rev-parse HEAD:nothing.txt 2>error &&
- test_i18ngrep "path .nothing.txt. does not exist in .HEAD." error &&
+ test_grep "path .nothing.txt. does not exist in .HEAD." error &&
test_must_fail git rev-parse HEAD:index-only.txt 2>error &&
- test_i18ngrep "path .index-only.txt. exists on disk, but not in .HEAD." error &&
+ test_grep "path .index-only.txt. exists on disk, but not in .HEAD." error &&
(cd subdir &&
test_must_fail git rev-parse HEAD:file2.txt 2>error &&
test_did_you_mean HEAD subdir/ file2.txt exists )
@@ -124,9 +124,9 @@ test_expect_success 'incorrect file in sha1:path' '
test_expect_success 'incorrect file in :path and :N:path' '
test_must_fail git rev-parse :nothing.txt 2>error &&
- test_i18ngrep "path .nothing.txt. does not exist (neither on disk nor in the index)" error &&
+ test_grep "path .nothing.txt. does not exist (neither on disk nor in the index)" error &&
test_must_fail git rev-parse :1:nothing.txt 2>error &&
- test_i18ngrep "path .nothing.txt. does not exist (neither on disk nor in the index)" error &&
+ test_grep "path .nothing.txt. does not exist (neither on disk nor in the index)" error &&
test_must_fail git rev-parse :1:file.txt 2>error &&
test_did_you_mean ":0" "" file.txt "is in the index" "at stage 1" &&
(cd subdir &&
@@ -137,42 +137,42 @@ test_expect_success 'incorrect file in :path and :N:path' '
test_must_fail git rev-parse :2:file2.txt 2>error &&
test_did_you_mean :0 subdir/ file2.txt "is in the index") &&
test_must_fail git rev-parse :disk-only.txt 2>error &&
- test_i18ngrep "path .disk-only.txt. exists on disk, but not in the index" error
+ test_grep "path .disk-only.txt. exists on disk, but not in the index" error
'
test_expect_success 'invalid @{n} reference' '
test_must_fail git rev-parse main@{99999} >output 2>error &&
test_must_be_empty output &&
- test_i18ngrep "log for [^ ]* only has [0-9][0-9]* entries" error &&
+ test_grep "log for [^ ]* only has [0-9][0-9]* entries" error &&
test_must_fail git rev-parse --verify main@{99999} >output 2>error &&
test_must_be_empty output &&
- test_i18ngrep "log for [^ ]* only has [0-9][0-9]* entries" error
+ test_grep "log for [^ ]* only has [0-9][0-9]* entries" error
'
test_expect_success 'relative path not found' '
(
cd subdir &&
test_must_fail git rev-parse HEAD:./nonexistent.txt 2>error &&
- test_i18ngrep subdir/nonexistent.txt error
+ test_grep subdir/nonexistent.txt error
)
'
test_expect_success 'relative path outside worktree' '
test_must_fail git rev-parse HEAD:../file.txt >output 2>error &&
test_must_be_empty output &&
- test_i18ngrep "outside repository" error
+ test_grep "outside repository" error
'
test_expect_success 'relative path when cwd is outside worktree' '
test_must_fail git --git-dir=.git --work-tree=subdir rev-parse HEAD:./file.txt >output 2>error &&
test_must_be_empty output &&
- test_i18ngrep "relative path syntax can.t be used outside working tree" error
+ test_grep "relative path syntax can.t be used outside working tree" error
'
test_expect_success '<commit>:file correctly diagnosed after a pathname' '
test_must_fail git rev-parse file.txt HEAD:file.txt 1>actual 2>error &&
- test_i18ngrep ! "exists on disk" error &&
- test_i18ngrep "no such path in the working tree" error &&
+ test_grep ! "exists on disk" error &&
+ test_grep "no such path in the working tree" error &&
cat >expect <<-\EOF &&
file.txt
HEAD:file.txt
@@ -214,13 +214,13 @@ test_expect_success 'dotdot does not peel endpoints' '
test_expect_success 'arg before dashdash must be a revision (missing)' '
test_must_fail git rev-parse foobar -- 2>stderr &&
- test_i18ngrep "bad revision" stderr
+ test_grep "bad revision" stderr
'
test_expect_success 'arg before dashdash must be a revision (file)' '
>foobar &&
test_must_fail git rev-parse foobar -- 2>stderr &&
- test_i18ngrep "bad revision" stderr
+ test_grep "bad revision" stderr
'
test_expect_success 'arg before dashdash must be a revision (ambiguous)' '
@@ -269,7 +269,7 @@ test_expect_success 'arg after dashdash not interpreted as option' '
test_expect_success 'arg after end-of-options not interpreted as option' '
test_must_fail git rev-parse --end-of-options --not-real -- 2>err &&
- test_i18ngrep bad.revision.*--not-real err
+ test_grep bad.revision.*--not-real err
'
test_expect_success 'end-of-options still allows --' '
diff --git a/t/t1507-rev-parse-upstream.sh b/t/t1507-rev-parse-upstream.sh
index c34714f..b9af6b3 100755
--- a/t/t1507-rev-parse-upstream.sh
+++ b/t/t1507-rev-parse-upstream.sh
@@ -5,6 +5,7 @@ test_description='test <branch>@{upstream} syntax'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
@@ -97,7 +98,8 @@ test_expect_success 'my-side@{u} resolves to correct commit' '
commit_subject my-side >actual &&
test_cmp expect actual &&
echo 5 >expect &&
- commit_subject my-side@{u} >actual
+ commit_subject my-side@{u} >actual &&
+ test_cmp expect actual
'
test_expect_success 'not-tracking@{u} fails' '
@@ -183,6 +185,11 @@ test_expect_success '@{u} error message when no upstream' '
test_cmp expect actual
'
+test_expect_success '@{u} silent error when no upstream' '
+ test_must_fail git rev-parse --verify --quiet @{u} 2>actual &&
+ test_must_be_empty actual
+'
+
test_expect_success 'branch@{u} error message with misspelt branch' '
cat >expect <<-EOF &&
fatal: no such branch: ${SQ}no-such-branch${SQ}
@@ -258,7 +265,8 @@ test_expect_success '@{reflog}-parsing does not look beyond colon' '
git add @{yesterday} &&
git commit -m "funny reflog file" &&
git hash-object @{yesterday} >expect &&
- git rev-parse HEAD:@{yesterday} >actual
+ git rev-parse HEAD:@{yesterday} >actual &&
+ test_cmp expect actual
'
test_expect_success '@{upstream}-parsing does not look beyond colon' '
@@ -266,7 +274,8 @@ test_expect_success '@{upstream}-parsing does not look beyond colon' '
git add @{upstream} &&
git commit -m "funny upstream file" &&
git hash-object @{upstream} >expect &&
- git rev-parse HEAD:@{upstream} >actual
+ git rev-parse HEAD:@{upstream} >actual &&
+ test_cmp expect actual
'
test_done
diff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh
index 87a4286..e841309 100755
--- a/t/t1508-at-combinations.sh
+++ b/t/t1508-at-combinations.sh
@@ -4,6 +4,7 @@ test_description='test various @{X} syntax combinations together'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
check() {
diff --git a/t/t1509-root-work-tree.sh b/t/t1509-root-work-tree.sh
index 553a3f6..c799f5b 100755
--- a/t/t1509-root-work-tree.sh
+++ b/t/t1509-root-work-tree.sh
@@ -221,7 +221,8 @@ test_expect_success 'setup' '
rm -rf /.git &&
echo "Initialized empty Git repository in /.git/" > expected &&
git init > result &&
- test_cmp expected result
+ test_cmp expected result &&
+ git config --global --add safe.directory /
'
test_vars 'auto gitdir, root' ".git" "/" ""
@@ -242,7 +243,7 @@ say "auto bare gitdir"
# DESTROYYYYY!!!!!
test_expect_success 'setup' '
rm -rf /refs /objects /info /hooks &&
- rm -f /expected /ls.expected /me /result &&
+ rm -f /HEAD /expected /ls.expected /me /result &&
cd / &&
echo "Initialized empty Git repository in /" > expected &&
git init --bare > result &&
@@ -255,4 +256,9 @@ test_expect_success 'go to /foo' 'cd /foo'
test_vars 'auto gitdir, root' "/" "" ""
+test_expect_success 'cleanup root' '
+ rm -rf /.git /refs /objects /info /hooks /branches /foo &&
+ rm -f /HEAD /config /description /expected /ls.expected /me /result
+'
+
test_done
diff --git a/t/t1509/prepare-chroot.sh b/t/t1509/prepare-chroot.sh
index 6d47e2c..dc997e0 100755
--- a/t/t1509/prepare-chroot.sh
+++ b/t/t1509/prepare-chroot.sh
@@ -43,7 +43,7 @@ rsync --exclude-from t/t1509/excludes -Ha . "$R$(pwd)"
# env might slip through, see test-lib.sh, unset.*PERL_PATH
sed 's|^PERL_PATH=.*|PERL_PATH=/bin/true|' GIT-BUILD-OPTIONS > "$R$(pwd)/GIT-BUILD-OPTIONS"
for cmd in git $BB;do
- ldd $cmd | grep '/' | sed 's,.*\s\(/[^ ]*\).*,\1,' | while read i; do
+ ldd $cmd | sed -n '/\//s,.*\s\(/[^ ]*\).*,\1,p' | while read i; do
mkdir -p "$R$(dirname $i)"
cp "$i" "$R/$i"
done
diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh
index 98cefe3..70f1e0a 100755
--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -129,7 +129,7 @@ test_expect_success 'blob and tree' '
test_expect_success 'warn ambiguity when no candidate matches type hint' '
test_must_fail git rev-parse --verify 000000000^{commit} 2>actual &&
- test_i18ngrep "short object ID 000000000 is ambiguous" actual
+ test_grep "short object ID 000000000 is ambiguous" actual
'
test_expect_success 'disambiguate tree-ish' '
@@ -470,10 +470,10 @@ test_expect_success 'cat-file --batch and --batch-check show ambiguous' '
echo "0000 ambiguous" >expect &&
echo 0000 | git cat-file --batch-check >actual 2>err &&
test_cmp expect actual &&
- test_i18ngrep hint: err &&
+ test_grep hint: err &&
echo 0000 | git cat-file --batch >actual 2>err &&
test_cmp expect actual &&
- test_i18ngrep hint: err
+ test_grep hint: err
'
test_done
diff --git a/t/t1514-rev-parse-push.sh b/t/t1514-rev-parse-push.sh
index d868a08..a835a19 100755
--- a/t/t1514-rev-parse-push.sh
+++ b/t/t1514-rev-parse-push.sh
@@ -4,6 +4,7 @@ test_description='test <branch>@{push} syntax'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
resolve () {
diff --git a/t/t1600-index.sh b/t/t1600-index.sh
index 010989f..62e7fd1 100755
--- a/t/t1600-index.sh
+++ b/t/t1600-index.sh
@@ -65,6 +65,37 @@ test_expect_success 'out of bounds index.version issues warning' '
)
'
+test_expect_success 'index.skipHash config option' '
+ rm -f .git/index &&
+ git -c index.skipHash=true add a &&
+ test_trailing_hash .git/index >hash &&
+ echo $(test_oid zero) >expect &&
+ test_cmp expect hash &&
+ git fsck &&
+
+ rm -f .git/index &&
+ git -c feature.manyFiles=true add a &&
+ test_trailing_hash .git/index >hash &&
+ cmp expect hash &&
+
+ rm -f .git/index &&
+ git -c feature.manyFiles=true \
+ -c index.skipHash=false add a &&
+ test_trailing_hash .git/index >hash &&
+ ! cmp expect hash &&
+
+ test_commit start &&
+ git -c protocol.file.allow=always submodule add ./ sub &&
+ git config index.skipHash false &&
+ git -C sub config index.skipHash true &&
+ rm -f .git/modules/sub/index &&
+ >sub/file &&
+ git -C sub add a &&
+ test_trailing_hash .git/modules/sub/index >hash &&
+ test_cmp expect hash &&
+ git -C sub fsck
+'
+
test_index_version () {
INDEX_VERSION_CONFIG=$1 &&
FEATURE_MANY_FILES=$2 &&
@@ -87,7 +118,7 @@ test_index_version () {
fi &&
git add a &&
echo $EXPECTED_OUTPUT_VERSION >expect &&
- test-tool index-version <.git/index >actual &&
+ git update-index --show-index-version >actual &&
test_cmp expect actual
)
}
diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
index b4ab166..a7b7263 100755
--- a/t/t1700-split-index.sh
+++ b/t/t1700-split-index.sh
@@ -43,7 +43,7 @@ test_expect_success 'enable split index' '
git config splitIndex.maxPercentChange 100 &&
git update-index --split-index &&
test-tool dump-split-index .git/index >actual &&
- indexversion=$(test-tool index-version <.git/index) &&
+ indexversion=$(git update-index --show-index-version) &&
# NEEDSWORK: Stop hard-coding checksums.
if test "$indexversion" = "4"
diff --git a/t/t1701-racy-split-index.sh b/t/t1701-racy-split-index.sh
index 5dc221e..d8fa489 100755
--- a/t/t1701-racy-split-index.sh
+++ b/t/t1701-racy-split-index.sh
@@ -5,6 +5,7 @@
test_description='racy split index'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
diff --git a/t/t1800-hook.sh b/t/t1800-hook.sh
index 210f429..8b0234c 100755
--- a/t/t1800-hook.sh
+++ b/t/t1800-hook.sh
@@ -95,7 +95,7 @@ test_expect_success 'git hook run -- out-of-repo runs excluded' '
test_expect_success 'git -c core.hooksPath=<PATH> hook run' '
mkdir my-hooks &&
write_script my-hooks/test-hook <<-\EOF &&
- echo Hook ran $1 >>actual
+ echo Hook ran $1
EOF
cat >expect <<-\EOF &&
@@ -151,4 +151,38 @@ test_expect_success TTY 'git commit: stdout and stderr are connected to a TTY' '
test_hook_tty commit -m"B.new"
'
+test_expect_success 'git hook run a hook with a bad shebang' '
+ test_when_finished "rm -rf bad-hooks" &&
+ mkdir bad-hooks &&
+ write_script bad-hooks/test-hook "/bad/path/no/spaces" </dev/null &&
+
+ test_expect_code 1 git \
+ -c core.hooksPath=bad-hooks \
+ hook run test-hook >out 2>err &&
+ test_must_be_empty out &&
+
+ # TODO: We should emit the same (or at least a more similar)
+ # error on MINGW (essentially Git for Windows) and all other
+ # platforms.. See the OS-specific code in start_command()
+ grep -E "^(error|fatal): cannot (exec|spawn) .*bad-hooks/test-hook" err
+'
+
+test_expect_success 'stdin to hooks' '
+ write_script .git/hooks/test-hook <<-\EOF &&
+ echo BEGIN stdin
+ cat
+ echo END stdin
+ EOF
+
+ cat >expect <<-EOF &&
+ BEGIN stdin
+ hello
+ END stdin
+ EOF
+
+ echo hello >input &&
+ git hook run --to-stdin=input test-hook 2>actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t2004-checkout-cache-temp.sh b/t/t2004-checkout-cache-temp.sh
index b16d69c..98e818f 100755
--- a/t/t2004-checkout-cache-temp.sh
+++ b/t/t2004-checkout-cache-temp.sh
@@ -93,7 +93,7 @@ test_expect_success 'checkout all stages of unknown path' '
rm -f path* .merge_* actual &&
test_must_fail git checkout-index --stage=all --temp \
-- does-not-exist 2>stderr &&
- test_i18ngrep not.in.the.cache stderr
+ test_grep not.in.the.cache stderr
'
test_expect_success 'checkout all stages/one file to nothing' '
@@ -117,6 +117,26 @@ test_expect_success 'checkout all stages/one file to temporary files' '
test $(cat $s3) = tree3path1)
'
+test_expect_success '--stage=all implies --temp' '
+ rm -f path* .merge_* actual &&
+ git checkout-index --stage=all -- path1 &&
+ test_path_is_missing path1
+'
+
+test_expect_success 'overriding --stage=all resets implied --temp' '
+ rm -f path* .merge_* actual &&
+ git checkout-index --stage=all --stage=2 -- path1 &&
+ echo tree2path1 >expect &&
+ test_cmp expect path1
+'
+
+test_expect_success '--stage=all --no-temp is rejected' '
+ rm -f path* .merge_* actual &&
+ test_must_fail git checkout-index --stage=all --no-temp -- path1 2>err &&
+ grep -v "already exists" err &&
+ grep "options .--stage=all. and .--no-temp. cannot be used together" err
+'
+
test_expect_success 'checkout some stages/one file to temporary files' '
rm -f path* .merge_* actual &&
git checkout-index --stage=all --temp -- path2 >actual &&
diff --git a/t/t2005-checkout-index-symlinks.sh b/t/t2005-checkout-index-symlinks.sh
index 112682a..67d18cf 100755
--- a/t/t2005-checkout-index-symlinks.sh
+++ b/t/t2005-checkout-index-symlinks.sh
@@ -22,8 +22,10 @@ test_expect_success \
git checkout-index symlink &&
test -f symlink'
-test_expect_success \
-'the file must be the blob we added during the setup' '
-test "$(git hash-object -t blob symlink)" = $l'
+test_expect_success 'the file must be the blob we added during the setup' '
+ echo "$l" >expect &&
+ git hash-object -t blob symlink >actual &&
+ test_cmp expect actual
+'
test_done
diff --git a/t/t2006-checkout-index-basic.sh b/t/t2006-checkout-index-basic.sh
index 7705e3a..570ba38 100755
--- a/t/t2006-checkout-index-basic.sh
+++ b/t/t2006-checkout-index-basic.sh
@@ -3,11 +3,12 @@
test_description='basic checkout-index tests
'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'checkout-index --gobbledegook' '
test_expect_code 129 git checkout-index --gobbledegook 2>err &&
- test_i18ngrep "[Uu]sage" err
+ test_grep "[Uu]sage" err
'
test_expect_success 'checkout-index -h in broken repository' '
@@ -18,18 +19,18 @@ test_expect_success 'checkout-index -h in broken repository' '
>.git/index &&
test_expect_code 129 git checkout-index -h >usage 2>&1
) &&
- test_i18ngrep "[Uu]sage" broken/usage
+ test_grep "[Uu]sage" broken/usage
'
test_expect_success 'checkout-index reports errors (cmdline)' '
test_must_fail git checkout-index -- does-not-exist 2>stderr &&
- test_i18ngrep not.in.the.cache stderr
+ test_grep not.in.the.cache stderr
'
test_expect_success 'checkout-index reports errors (stdin)' '
echo does-not-exist |
test_must_fail git checkout-index --stdin 2>stderr &&
- test_i18ngrep not.in.the.cache stderr
+ test_grep not.in.the.cache stderr
'
for mode in 'case' 'utf-8'
do
@@ -87,8 +88,8 @@ test_expect_success 'checkout-index --temp correctly reports error on missing bl
git update-index --index-info <objs &&
test_must_fail git checkout-index --temp symlink file 2>stderr &&
- test_i18ngrep "unable to read sha1 file of file ($missing_blob)" stderr &&
- test_i18ngrep "unable to read sha1 file of symlink ($missing_blob)" stderr
+ test_grep "unable to read sha1 file of file ($missing_blob)" stderr &&
+ test_grep "unable to read sha1 file of symlink ($missing_blob)" stderr
'
test_expect_success 'checkout-index --temp correctly reports error for submodules' '
@@ -97,7 +98,7 @@ test_expect_success 'checkout-index --temp correctly reports error for submodule
git submodule add ./sub &&
git commit -m sub &&
test_must_fail git checkout-index --temp sub 2>stderr &&
- test_i18ngrep "cannot create temporary submodule sub" stderr
+ test_grep "cannot create temporary submodule sub" stderr
'
test_done
diff --git a/t/t2010-checkout-ambiguous.sh b/t/t2010-checkout-ambiguous.sh
index 9d4b375..82c3bfe 100755
--- a/t/t2010-checkout-ambiguous.sh
+++ b/t/t2010-checkout-ambiguous.sh
@@ -62,8 +62,8 @@ test_expect_success 'disambiguate checking out from a tree-ish' '
test_expect_success 'accurate error message with more than one ref' '
test_must_fail git checkout HEAD main -- 2>actual &&
- test_i18ngrep 2 actual &&
- test_i18ngrep "one reference expected, 2 given" actual
+ test_grep 2 actual &&
+ test_grep "one reference expected, 2 given" actual
'
test_done
diff --git a/t/t2011-checkout-invalid-head.sh b/t/t2011-checkout-invalid-head.sh
index d9997e7..04f53b1 100755
--- a/t/t2011-checkout-invalid-head.sh
+++ b/t/t2011-checkout-invalid-head.sh
@@ -18,12 +18,12 @@ test_expect_success 'checkout should not start branch from a tree' '
test_must_fail git checkout -b newbranch main^{tree}
'
-test_expect_success 'checkout main from invalid HEAD' '
+test_expect_success REFFILES 'checkout main from invalid HEAD' '
echo $ZERO_OID >.git/HEAD &&
git checkout main --
'
-test_expect_success 'checkout notices failure to lock HEAD' '
+test_expect_success REFFILES 'checkout notices failure to lock HEAD' '
test_when_finished "rm -f .git/HEAD.lock" &&
>.git/HEAD.lock &&
test_must_fail git checkout -b other
@@ -31,11 +31,8 @@ test_expect_success 'checkout notices failure to lock HEAD' '
test_expect_success 'create ref directory/file conflict scenario' '
git update-ref refs/heads/outer/inner main &&
-
- # do not rely on symbolic-ref to get a known state,
- # as it may use the same code we are testing
reset_to_df () {
- echo "ref: refs/heads/outer" >.git/HEAD
+ git symbolic-ref HEAD refs/heads/outer
}
'
diff --git a/t/t2012-checkout-last.sh b/t/t2012-checkout-last.sh
index 1f6c4ed..4b6372f 100755
--- a/t/t2012-checkout-last.sh
+++ b/t/t2012-checkout-last.sh
@@ -5,6 +5,7 @@ test_description='checkout can switch to last branch and merge base'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
diff --git a/t/t2015-checkout-unborn.sh b/t/t2015-checkout-unborn.sh
index 9425aae..fb0e138 100755
--- a/t/t2015-checkout-unborn.sh
+++ b/t/t2015-checkout-unborn.sh
@@ -9,11 +9,12 @@ TEST_PASSES_SANITIZE_LEAK=true
test_expect_success 'setup' '
mkdir parent &&
- (cd parent &&
- git init &&
- echo content >file &&
- git add file &&
- git commit -m base
+ (
+ cd parent &&
+ git init &&
+ echo content >file &&
+ git add file &&
+ git commit -m base
) &&
git fetch parent main:origin
'
diff --git a/t/t2016-checkout-patch.sh b/t/t2016-checkout-patch.sh
index a5822e4..c4f9bf0 100755
--- a/t/t2016-checkout-patch.sh
+++ b/t/t2016-checkout-patch.sh
@@ -4,12 +4,6 @@ test_description='git checkout --patch'
. ./lib-patch-mode.sh
-if ! test_have_prereq ADD_I_USE_BUILTIN && ! test_have_prereq PERL
-then
- skip_all='skipping interactive add tests, PERL not set'
- test_done
-fi
-
test_expect_success 'setup' '
mkdir dir &&
echo parent > dir/foo &&
@@ -44,26 +38,32 @@ test_expect_success 'git checkout -p with staged changes' '
verify_state dir/foo index index
'
-test_expect_success 'git checkout -p HEAD with NO staged changes: abort' '
- set_and_save_state dir/foo work head &&
- test_write_lines n y n | git checkout -p HEAD &&
- verify_saved_state bar &&
- verify_saved_state dir/foo
-'
-
-test_expect_success 'git checkout -p HEAD with NO staged changes: apply' '
- test_write_lines n y y | git checkout -p HEAD &&
- verify_saved_state bar &&
- verify_state dir/foo head head
-'
-
-test_expect_success 'git checkout -p HEAD with change already staged' '
- set_state dir/foo index index &&
- # the third n is to get out in case it mistakenly does not apply
- test_write_lines n y n | git checkout -p HEAD &&
- verify_saved_state bar &&
- verify_state dir/foo head head
-'
+for opt in "HEAD" "@"
+do
+ test_expect_success "git checkout -p $opt with NO staged changes: abort" '
+ set_and_save_state dir/foo work head &&
+ test_write_lines n y n | git checkout -p $opt >output &&
+ verify_saved_state bar &&
+ verify_saved_state dir/foo &&
+ test_grep "Discard" output
+ '
+
+ test_expect_success "git checkout -p $opt with NO staged changes: apply" '
+ test_write_lines n y y | git checkout -p $opt >output &&
+ verify_saved_state bar &&
+ verify_state dir/foo head head &&
+ test_grep "Discard" output
+ '
+
+ test_expect_success "git checkout -p $opt with change already staged" '
+ set_state dir/foo index index &&
+ # the third n is to get out in case it mistakenly does not apply
+ test_write_lines n y n | git checkout -p $opt >output &&
+ verify_saved_state bar &&
+ verify_state dir/foo head head &&
+ test_grep "Discard" output
+ '
+done
test_expect_success 'git checkout -p HEAD^...' '
# the third n is to get out in case it mistakenly does not apply
diff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh
index 947d158..a5c7358 100755
--- a/t/t2017-checkout-orphan.sh
+++ b/t/t2017-checkout-orphan.sh
@@ -86,7 +86,7 @@ test_expect_success '--orphan makes reflog by default' '
git rev-parse --verify delta@{0}
'
-test_expect_success REFFILES '--orphan does not make reflog when core.logAllRefUpdates = false' '
+test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = false' '
git checkout main &&
git config core.logAllRefUpdates false &&
git checkout --orphan epsilon &&
diff --git a/t/t2018-checkout-branch.sh b/t/t2018-checkout-branch.sh
index 52e51b0..43551cc 100755
--- a/t/t2018-checkout-branch.sh
+++ b/t/t2018-checkout-branch.sh
@@ -2,6 +2,8 @@
test_description='checkout'
+TEST_CREATE_REPO_NO_TEMPLATE=1
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# Arguments: [!] <branch> <oid> [<checkout options>]
@@ -257,11 +259,12 @@ test_expect_success 'checkout -b to a new branch preserves mergeable changes des
git checkout branch1-scratch &&
test_might_fail git branch -D branch3 &&
git config core.sparseCheckout false &&
- rm .git/info/sparse-checkout" &&
+ rm -rf .git/info" &&
test_commit file2 &&
echo stuff >>file1 &&
+ mkdir .git/info &&
echo file2 >.git/info/sparse-checkout &&
git config core.sparseCheckout true &&
@@ -275,12 +278,12 @@ test_expect_success 'checkout -b to a new branch preserves mergeable changes des
test_expect_success 'checkout -b rejects an invalid start point' '
test_must_fail git checkout -b branch4 file1 2>err &&
- test_i18ngrep "is not a commit" err
+ test_grep "is not a commit" err
'
test_expect_success 'checkout -b rejects an extra path argument' '
test_must_fail git checkout -b branch5 branch1 file1 2>err &&
- test_i18ngrep "Cannot update paths and switch to branch" err
+ test_grep "Cannot update paths and switch to branch" err
'
test_done
diff --git a/t/t2019-checkout-ambiguous-ref.sh b/t/t2019-checkout-ambiguous-ref.sh
index 2c8c926..c67261e 100755
--- a/t/t2019-checkout-ambiguous-ref.sh
+++ b/t/t2019-checkout-ambiguous-ref.sh
@@ -16,7 +16,7 @@ test_expect_success 'setup ambiguous refs' '
'
test_expect_success 'checkout ambiguous ref succeeds' '
- git checkout ambiguity >stdout 2>stderr
+ git checkout ambiguity 2>stderr
'
test_expect_success 'checkout produces ambiguity warning' '
@@ -32,12 +32,12 @@ test_expect_success 'checkout chooses branch over tag' '
'
test_expect_success 'checkout reports switch to branch' '
- test_i18ngrep "Switched to branch" stderr &&
- test_i18ngrep ! "^HEAD is now at" stderr
+ test_grep "Switched to branch" stderr &&
+ test_grep ! "^HEAD is now at" stderr
'
test_expect_success 'checkout vague ref succeeds' '
- git checkout vagueness >stdout 2>stderr &&
+ git checkout vagueness 2>stderr &&
test_set_prereq VAGUENESS_SUCCESS
'
@@ -54,8 +54,8 @@ test_expect_success VAGUENESS_SUCCESS 'checkout chooses branch over tag' '
'
test_expect_success VAGUENESS_SUCCESS 'checkout reports switch to branch' '
- test_i18ngrep "Switched to branch" stderr &&
- test_i18ngrep ! "^HEAD is now at" stderr
+ test_grep "Switched to branch" stderr &&
+ test_grep ! "^HEAD is now at" stderr
'
test_done
diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh
index bc46713..8d90d02 100755
--- a/t/t2020-checkout-detach.sh
+++ b/t/t2020-checkout-detach.sh
@@ -4,6 +4,7 @@ test_description='checkout into detached HEAD state'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
check_detached () {
@@ -16,12 +17,12 @@ check_not_detached () {
PREV_HEAD_DESC='Previous HEAD position was'
check_orphan_warning() {
- test_i18ngrep "you are leaving $2 behind" "$1" &&
- test_i18ngrep ! "$PREV_HEAD_DESC" "$1"
+ test_grep "you are leaving $2 behind" "$1" &&
+ test_grep ! "$PREV_HEAD_DESC" "$1"
}
check_no_orphan_warning() {
- test_i18ngrep ! "you are leaving .* commit.*behind" "$1" &&
- test_i18ngrep "$PREV_HEAD_DESC" "$1"
+ test_grep ! "you are leaving .* commit.*behind" "$1" &&
+ test_grep "$PREV_HEAD_DESC" "$1"
}
reset () {
@@ -44,6 +45,18 @@ test_expect_success 'checkout branch does not detach' '
check_not_detached
'
+for opt in "HEAD" "@"
+do
+ test_expect_success "checkout $opt no-op/don't detach" '
+ reset &&
+ cat .git/HEAD >expect &&
+ git checkout $opt &&
+ cat .git/HEAD >actual &&
+ check_not_detached &&
+ test_cmp expect actual
+ '
+done
+
test_expect_success 'checkout tag detaches' '
reset &&
git checkout tag &&
@@ -163,7 +176,10 @@ test_expect_success 'tracking count is accurate after orphan check' '
git config branch.child.merge refs/heads/main &&
git checkout child^ &&
git checkout child >stdout &&
- test_cmp expect stdout
+ test_cmp expect stdout &&
+
+ git checkout --detach child >stdout &&
+ test_grep ! "can be fast-forwarded\." stdout
'
test_expect_success 'no advice given for explicit detached head state' '
diff --git a/t/t2021-checkout-overwrite.sh b/t/t2021-checkout-overwrite.sh
index 713c3fa..ecfacf0 100755
--- a/t/t2021-checkout-overwrite.sh
+++ b/t/t2021-checkout-overwrite.sh
@@ -50,10 +50,13 @@ test_expect_success 'checkout commit with dir must not remove untracked a/b' '
test_expect_success SYMLINKS 'the symlink remained' '
- test_when_finished "rm a/b" &&
test -h a/b
'
+test_expect_success 'cleanup after previous symlink tests' '
+ rm a/b
+'
+
test_expect_success SYMLINKS 'checkout -f must not follow symlinks when removing entries' '
git checkout -f start &&
mkdir dir &&
@@ -66,4 +69,15 @@ test_expect_success SYMLINKS 'checkout -f must not follow symlinks when removing
test_path_is_file untracked/f
'
+test_expect_success 'checkout --overwrite-ignore should succeed if only ignored files in the way' '
+ git checkout -b df_conflict &&
+ test_commit contents some_dir &&
+ git checkout start &&
+ mkdir some_dir &&
+ echo autogenerated information >some_dir/ignore &&
+ echo ignore >.git/info/exclude &&
+ git checkout --overwrite-ignore df_conflict &&
+ test_path_is_file some_dir
+'
+
test_done
diff --git a/t/t2023-checkout-m.sh b/t/t2023-checkout-m.sh
index 7b327b7..81e772f 100755
--- a/t/t2023-checkout-m.sh
+++ b/t/t2023-checkout-m.sh
@@ -7,6 +7,7 @@ Ensures that checkout -m on a resolved file restores the conflicted file'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t2024-checkout-dwim.sh b/t/t2024-checkout-dwim.sh
index 4a1c901..a3b1449 100755
--- a/t/t2024-checkout-dwim.sh
+++ b/t/t2024-checkout-dwim.sh
@@ -93,7 +93,7 @@ test_expect_success 'when arg matches multiple remotes, do not fallback to inter
test_must_fail git checkout ambiguous_branch_and_file 2>err &&
- test_i18ngrep "matched multiple (2) remote tracking branches" err &&
+ test_grep "matched multiple (2) remote tracking branches" err &&
# file must not be altered
test_cmp expect ambiguous_branch_and_file
@@ -105,20 +105,20 @@ test_expect_success 'checkout of branch from multiple remotes fails with advice'
test_must_fail git checkout foo 2>stderr &&
test_branch main &&
status_uno_is_clean &&
- test_i18ngrep "^hint: " stderr &&
+ test_grep "^hint: " stderr &&
test_must_fail git -c advice.checkoutAmbiguousRemoteBranchName=false \
checkout foo 2>stderr &&
test_branch main &&
status_uno_is_clean &&
- test_i18ngrep ! "^hint: " stderr
+ test_grep ! "^hint: " stderr
'
-test_expect_success PERL 'checkout -p with multiple remotes does not print advice' '
+test_expect_success 'checkout -p with multiple remotes does not print advice' '
git checkout -B main &&
test_might_fail git branch -D foo &&
git checkout -p foo 2>stderr &&
- test_i18ngrep ! "^hint: " stderr &&
+ test_grep ! "^hint: " stderr &&
status_uno_is_clean
'
@@ -305,10 +305,13 @@ test_expect_success 'loosely defined local base branch is reported correctly' '
test_config branch.strict.merge refs/heads/main &&
test_config branch.loose.merge main &&
- git checkout strict | sed -e "s/strict/BRANCHNAME/g" >expect &&
+ git checkout strict >expect.raw 2>&1 &&
+ sed -e "s/strict/BRANCHNAME/g" <expect.raw >expect &&
status_uno_is_clean &&
- git checkout loose | sed -e "s/loose/BRANCHNAME/g" >actual &&
+ git checkout loose >actual.raw 2>&1 &&
+ sed -e "s/loose/BRANCHNAME/g" <actual.raw >actual &&
status_uno_is_clean &&
+ grep BRANCHNAME actual &&
test_cmp expect actual
'
diff --git a/t/t2025-checkout-no-overlay.sh b/t/t2025-checkout-no-overlay.sh
index 8f13341..246609d 100755
--- a/t/t2025-checkout-no-overlay.sh
+++ b/t/t2025-checkout-no-overlay.sh
@@ -2,6 +2,7 @@
test_description='checkout --no-overlay <tree-ish> -- <pathspec>'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -25,7 +26,7 @@ test_expect_success 'checkout --no-overlay removing last file from directory' '
test_expect_success 'checkout -p --overlay is disallowed' '
test_must_fail git checkout -p --overlay HEAD 2>actual &&
- test_i18ngrep "fatal: options .-p. and .--overlay. cannot be used together" actual
+ test_grep "fatal: options .-p. and .--overlay. cannot be used together" actual
'
test_expect_success '--no-overlay --theirs with D/F conflict deletes file' '
diff --git a/t/t2026-checkout-pathspec-file.sh b/t/t2026-checkout-pathspec-file.sh
index 9c651ae..acd5521 100755
--- a/t/t2026-checkout-pathspec-file.sh
+++ b/t/t2026-checkout-pathspec-file.sh
@@ -149,16 +149,16 @@ test_expect_success 'error conditions' '
echo fileA.t >list &&
test_must_fail git checkout --pathspec-from-file=list --detach 2>err &&
- test_i18ngrep -e "options .--pathspec-from-file. and .--detach. cannot be used together" err &&
+ test_grep -e "options .--pathspec-from-file. and .--detach. cannot be used together" err &&
test_must_fail git checkout --pathspec-from-file=list --patch 2>err &&
- test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err &&
+ test_grep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err &&
test_must_fail git checkout --pathspec-from-file=list -- fileA.t 2>err &&
- test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
+ test_grep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
test_must_fail git checkout --pathspec-file-nul 2>err &&
- test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err
+ test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err
'
test_done
diff --git a/t/t2027-checkout-track.sh b/t/t2027-checkout-track.sh
index dca35aa..98f16c7 100755
--- a/t/t2027-checkout-track.sh
+++ b/t/t2027-checkout-track.sh
@@ -5,6 +5,7 @@ test_description='tests for git branch --track'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -21,7 +22,7 @@ test_expect_success 'checkout --track -b creates a new tracking branch' '
test_expect_success 'checkout --track -b rejects an extra path argument' '
test_must_fail git checkout --track -b branch2 main one.t 2>err &&
- test_i18ngrep "cannot be used with updating paths" err
+ test_grep "cannot be used with updating paths" err
'
test_expect_success 'checkout --track -b overrides autoSetupMerge=inherit' '
diff --git a/t/t2030-unresolve-info.sh b/t/t2030-unresolve-info.sh
index 2d8c70b..be3fcdd 100755
--- a/t/t2030-unresolve-info.sh
+++ b/t/t2030-unresolve-info.sh
@@ -37,11 +37,17 @@ prime_resolve_undo () {
git checkout second^0 &&
test_tick &&
test_must_fail git merge third^0 &&
- echo merge does not leave anything &&
check_resolve_undo empty &&
- echo different >fi/le &&
- git add fi/le &&
- echo resolving records &&
+
+ # how should the conflict be resolved?
+ case "$1" in
+ remove)
+ rm -f file/le && git rm fi/le
+ ;;
+ *) # modify
+ echo different >fi/le && git add fi/le
+ ;;
+ esac
check_resolve_undo recorded fi/le initial:fi/le second:fi/le third:fi/le
}
@@ -122,6 +128,37 @@ test_expect_success 'add records checkout -m undoes' '
test_expect_success 'unmerge with plumbing' '
prime_resolve_undo &&
git update-index --unresolve fi/le &&
+ git ls-files --resolve-undo fi/le >actual &&
+ test_must_be_empty actual &&
+ git ls-files -u >actual &&
+ test_line_count = 3 actual
+'
+
+test_expect_success 'unmerge can be done even after committing' '
+ prime_resolve_undo &&
+ git commit -m "record to nuke MERGE_HEAD" &&
+ git update-index --unresolve fi/le &&
+ git ls-files --resolve-undo fi/le >actual &&
+ test_must_be_empty actual &&
+ git ls-files -u >actual &&
+ test_line_count = 3 actual
+'
+
+test_expect_success 'unmerge removal' '
+ prime_resolve_undo remove &&
+ git update-index --unresolve fi/le &&
+ git ls-files --resolve-undo fi/le >actual &&
+ test_must_be_empty actual &&
+ git ls-files -u >actual &&
+ test_line_count = 3 actual
+'
+
+test_expect_success 'unmerge removal after committing' '
+ prime_resolve_undo remove &&
+ git commit -m "record to nuke MERGE_HEAD" &&
+ git update-index --unresolve fi/le &&
+ git ls-files --resolve-undo fi/le >actual &&
+ test_must_be_empty actual &&
git ls-files -u >actual &&
test_line_count = 3 actual
'
@@ -191,7 +228,7 @@ test_expect_success 'rerere forget (add-add conflict)' '
git commit -m "add differently" &&
test_must_fail git merge fifth &&
git rerere forget add-differently 2>actual &&
- test_i18ngrep "no remembered" actual
+ test_grep "no remembered" actual
'
test_expect_success 'resolve-undo keeps blobs from gc' '
diff --git a/t/t2060-switch.sh b/t/t2060-switch.sh
index 5a7caf9..c91c4db 100755
--- a/t/t2060-switch.sh
+++ b/t/t2060-switch.sh
@@ -146,4 +146,35 @@ test_expect_success 'tracking info copied with autoSetupMerge=inherit' '
test_cmp_config "" --default "" branch.main2.merge
'
+test_expect_success 'switch back when temporarily detached and checked out elsewhere ' '
+ test_when_finished "
+ git worktree remove wt1 ||:
+ git worktree remove wt2 ||:
+ git checkout - ||:
+ git branch -D shared ||:
+ " &&
+ git checkout -b shared &&
+ test_commit shared-first &&
+ HASH1=$(git rev-parse --verify HEAD) &&
+ test_commit shared-second &&
+ test_commit shared-third &&
+ HASH2=$(git rev-parse --verify HEAD) &&
+ git worktree add wt1 -f shared &&
+ git -C wt1 bisect start &&
+ git -C wt1 bisect good $HASH1 &&
+ git -C wt1 bisect bad $HASH2 &&
+ git worktree add wt2 -f shared &&
+ git -C wt2 bisect start &&
+ git -C wt2 bisect good $HASH1 &&
+ git -C wt2 bisect bad $HASH2 &&
+ # we test in both worktrees to ensure that works
+ # as expected with "first" and "next" worktrees
+ test_must_fail git -C wt1 switch shared &&
+ test_must_fail git -C wt1 switch -C shared &&
+ git -C wt1 switch --ignore-other-worktrees shared &&
+ test_must_fail git -C wt2 switch shared &&
+ test_must_fail git -C wt2 switch -C shared &&
+ git -C wt2 switch --ignore-other-worktrees shared
+'
+
test_done
diff --git a/t/t2070-restore.sh b/t/t2070-restore.sh
index 7c43ddf..ac40494 100755
--- a/t/t2070-restore.sh
+++ b/t/t2070-restore.sh
@@ -5,6 +5,7 @@ test_description='restore basic functionality'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -137,4 +138,87 @@ test_expect_success 'restore --staged invalidates cache tree for deletions' '
test_must_fail git rev-parse HEAD:new1
'
+test_expect_success 'restore --merge to unresolve' '
+ O=$(echo original | git hash-object -w --stdin) &&
+ A=$(echo ourside | git hash-object -w --stdin) &&
+ B=$(echo theirside | git hash-object -w --stdin) &&
+ {
+ echo "100644 $O 1 file" &&
+ echo "100644 $A 2 file" &&
+ echo "100644 $B 3 file"
+ } | git update-index --index-info &&
+ echo nothing >file &&
+ git restore --worktree --merge file &&
+ cat >expect <<-\EOF &&
+ <<<<<<< ours
+ ourside
+ =======
+ theirside
+ >>>>>>> theirs
+ EOF
+ test_cmp expect file
+'
+
+test_expect_success 'restore --merge to unresolve after (mistaken) resolution' '
+ O=$(echo original | git hash-object -w --stdin) &&
+ A=$(echo ourside | git hash-object -w --stdin) &&
+ B=$(echo theirside | git hash-object -w --stdin) &&
+ {
+ echo "100644 $O 1 file" &&
+ echo "100644 $A 2 file" &&
+ echo "100644 $B 3 file"
+ } | git update-index --index-info &&
+ echo nothing >file &&
+ git add file &&
+ git restore --worktree --merge file &&
+ cat >expect <<-\EOF &&
+ <<<<<<< ours
+ ourside
+ =======
+ theirside
+ >>>>>>> theirs
+ EOF
+ test_cmp expect file
+'
+
+test_expect_success 'restore --merge to unresolve after (mistaken) resolution' '
+ O=$(echo original | git hash-object -w --stdin) &&
+ A=$(echo ourside | git hash-object -w --stdin) &&
+ B=$(echo theirside | git hash-object -w --stdin) &&
+ {
+ echo "100644 $O 1 file" &&
+ echo "100644 $A 2 file" &&
+ echo "100644 $B 3 file"
+ } | git update-index --index-info &&
+ git rm -f file &&
+ git restore --worktree --merge file &&
+ cat >expect <<-\EOF &&
+ <<<<<<< ours
+ ourside
+ =======
+ theirside
+ >>>>>>> theirs
+ EOF
+ test_cmp expect file
+'
+
+test_expect_success 'restore with merge options are incompatible with certain options' '
+ for opts in \
+ "--staged --ours" \
+ "--staged --theirs" \
+ "--staged --merge" \
+ "--source=HEAD --ours" \
+ "--source=HEAD --theirs" \
+ "--source=HEAD --merge" \
+ "--staged --conflict=diff3" \
+ "--staged --worktree --ours" \
+ "--staged --worktree --theirs" \
+ "--staged --worktree --merge" \
+ "--staged --worktree --conflict=zdiff3"
+ do
+ test_must_fail git restore $opts . 2>err &&
+ grep "cannot be used" err || return
+ done
+'
+
test_done
diff --git a/t/t2071-restore-patch.sh b/t/t2071-restore-patch.sh
index b5c5c0f..42d5522 100755
--- a/t/t2071-restore-patch.sh
+++ b/t/t2071-restore-patch.sh
@@ -2,9 +2,10 @@
test_description='git restore --patch'
+TEST_PASSES_SANITIZE_LEAK=true
. ./lib-patch-mode.sh
-test_expect_success PERL 'setup' '
+test_expect_success 'setup' '
mkdir dir &&
echo parent >dir/foo &&
echo dummy >bar &&
@@ -16,43 +17,47 @@ test_expect_success PERL 'setup' '
save_head
'
-test_expect_success PERL 'restore -p without pathspec is fine' '
+test_expect_success 'restore -p without pathspec is fine' '
echo q >cmd &&
git restore -p <cmd
'
# note: bar sorts before dir/foo, so the first 'n' is always to skip 'bar'
-test_expect_success PERL 'saying "n" does nothing' '
+test_expect_success 'saying "n" does nothing' '
set_and_save_state dir/foo work head &&
test_write_lines n n | git restore -p &&
verify_saved_state bar &&
verify_saved_state dir/foo
'
-test_expect_success PERL 'git restore -p' '
+test_expect_success 'git restore -p' '
set_and_save_state dir/foo work head &&
test_write_lines n y | git restore -p &&
verify_saved_state bar &&
verify_state dir/foo head head
'
-test_expect_success PERL 'git restore -p with staged changes' '
+test_expect_success 'git restore -p with staged changes' '
set_state dir/foo work index &&
test_write_lines n y | git restore -p &&
verify_saved_state bar &&
verify_state dir/foo index index
'
-test_expect_success PERL 'git restore -p --source=HEAD' '
- set_state dir/foo work index &&
- # the third n is to get out in case it mistakenly does not apply
- test_write_lines n y n | git restore -p --source=HEAD &&
- verify_saved_state bar &&
- verify_state dir/foo head index
-'
-
-test_expect_success PERL 'git restore -p --source=HEAD^' '
+for opt in "HEAD" "@"
+do
+ test_expect_success "git restore -p --source=$opt" '
+ set_state dir/foo work index &&
+ # the third n is to get out in case it mistakenly does not apply
+ test_write_lines n y n | git restore -p --source=$opt >output &&
+ verify_saved_state bar &&
+ verify_state dir/foo head index &&
+ test_grep "Discard" output
+ '
+done
+
+test_expect_success 'git restore -p --source=HEAD^' '
set_state dir/foo work index &&
# the third n is to get out in case it mistakenly does not apply
test_write_lines n y n | git restore -p --source=HEAD^ &&
@@ -60,7 +65,7 @@ test_expect_success PERL 'git restore -p --source=HEAD^' '
verify_state dir/foo parent index
'
-test_expect_success PERL 'git restore -p --source=HEAD^...' '
+test_expect_success 'git restore -p --source=HEAD^...' '
set_state dir/foo work index &&
# the third n is to get out in case it mistakenly does not apply
test_write_lines n y n | git restore -p --source=HEAD^... &&
@@ -68,7 +73,7 @@ test_expect_success PERL 'git restore -p --source=HEAD^...' '
verify_state dir/foo parent index
'
-test_expect_success PERL 'git restore -p handles deletion' '
+test_expect_success 'git restore -p handles deletion' '
set_state dir/foo work index &&
rm dir/foo &&
test_write_lines n y | git restore -p &&
@@ -81,21 +86,21 @@ test_expect_success PERL 'git restore -p handles deletion' '
# dir/foo. There's always an extra 'n' to reject edits to dir/foo in
# the failure case (and thus get out of the loop).
-test_expect_success PERL 'path limiting works: dir' '
+test_expect_success 'path limiting works: dir' '
set_state dir/foo work head &&
test_write_lines y n | git restore -p dir &&
verify_saved_state bar &&
verify_state dir/foo head head
'
-test_expect_success PERL 'path limiting works: -- dir' '
+test_expect_success 'path limiting works: -- dir' '
set_state dir/foo work head &&
test_write_lines y n | git restore -p -- dir &&
verify_saved_state bar &&
verify_state dir/foo head head
'
-test_expect_success PERL 'path limiting works: HEAD^ -- dir' '
+test_expect_success 'path limiting works: HEAD^ -- dir' '
set_state dir/foo work head &&
# the third n is to get out in case it mistakenly does not apply
test_write_lines y n n | git restore -p --source=HEAD^ -- dir &&
@@ -103,7 +108,7 @@ test_expect_success PERL 'path limiting works: HEAD^ -- dir' '
verify_state dir/foo parent head
'
-test_expect_success PERL 'path limiting works: foo inside dir' '
+test_expect_success 'path limiting works: foo inside dir' '
set_state dir/foo work head &&
# the third n is to get out in case it mistakenly does not apply
test_write_lines y n n | (cd dir && git restore -p foo) &&
@@ -111,7 +116,7 @@ test_expect_success PERL 'path limiting works: foo inside dir' '
verify_state dir/foo head head
'
-test_expect_success PERL 'none of this moved HEAD' '
+test_expect_success 'none of this moved HEAD' '
verify_saved_head
'
diff --git a/t/t2072-restore-pathspec-file.sh b/t/t2072-restore-pathspec-file.sh
index c22669b..86c9c88 100755
--- a/t/t2072-restore-pathspec-file.sh
+++ b/t/t2072-restore-pathspec-file.sh
@@ -2,6 +2,7 @@
test_description='restore --pathspec-from-file'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_tick
@@ -152,16 +153,16 @@ test_expect_success 'error conditions' '
>empty_list &&
test_must_fail git restore --pathspec-from-file=list --patch --source=HEAD^1 2>err &&
- test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err &&
+ test_grep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err &&
test_must_fail git restore --pathspec-from-file=list --source=HEAD^1 -- fileA.t 2>err &&
- test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
+ test_grep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
test_must_fail git restore --pathspec-file-nul --source=HEAD^1 2>err &&
- test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
+ test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
test_must_fail git restore --pathspec-from-file=empty_list --source=HEAD^1 2>err &&
- test_i18ngrep -e "you must specify path(s) to restore" err
+ test_grep -e "you must specify path(s) to restore" err
'
test_expect_success 'wildcard pathspec matches file in subdirectory' '
diff --git a/t/t2080-parallel-checkout-basics.sh b/t/t2080-parallel-checkout-basics.sh
index c683e60..5ffe1a4 100755
--- a/t/t2080-parallel-checkout-basics.sh
+++ b/t/t2080-parallel-checkout-basics.sh
@@ -41,6 +41,8 @@ TEST_NO_CREATE_REPO=1
# - m/m (file)
#
test_expect_success 'setup repo for checkout with various types of changes' '
+ test_config_global protocol.file.allow always &&
+
git init sub &&
(
cd sub &&
@@ -140,6 +142,7 @@ do
esac
test_expect_success "$mode checkout on clone" '
+ test_config_global protocol.file.allow always &&
repo=various_${mode}_clone &&
set_checkout_config $workers $threshold &&
test_checkout_workers $expected_workers \
@@ -230,12 +233,9 @@ test_expect_success SYMLINKS 'parallel checkout checks for symlinks in leading d
# check the final report including sequential, parallel, and delayed entries
# all at the same time. So we must have finer control of the parallel checkout
# variables.
-test_expect_success PERL '"git checkout ." report should not include failed entries' '
- write_script rot13-filter.pl "$PERL_PATH" \
- <"$TEST_DIRECTORY"/t0021/rot13-filter.pl &&
-
+test_expect_success '"git checkout ." report should not include failed entries' '
test_config_global filter.delay.process \
- "\"$(pwd)/rot13-filter.pl\" --always-delay delayed.log clean smudge delay" &&
+ "test-tool rot13-filter --always-delay --log=delayed.log clean smudge delay" &&
test_config_global filter.delay.required true &&
test_config_global filter.cat.clean cat &&
test_config_global filter.cat.smudge cat &&
diff --git a/t/t2082-parallel-checkout-attributes.sh b/t/t2082-parallel-checkout-attributes.sh
index 2525457..f3511cd 100755
--- a/t/t2082-parallel-checkout-attributes.sh
+++ b/t/t2082-parallel-checkout-attributes.sh
@@ -138,12 +138,9 @@ test_expect_success 'parallel-checkout and external filter' '
# The delayed queue is independent from the parallel queue, and they should be
# able to work together in the same checkout process.
#
-test_expect_success PERL 'parallel-checkout and delayed checkout' '
- write_script rot13-filter.pl "$PERL_PATH" \
- <"$TEST_DIRECTORY"/t0021/rot13-filter.pl &&
-
+test_expect_success 'parallel-checkout and delayed checkout' '
test_config_global filter.delay.process \
- "\"$(pwd)/rot13-filter.pl\" --always-delay \"$(pwd)/delayed.log\" clean smudge delay" &&
+ "test-tool rot13-filter --always-delay --log=\"$(pwd)/delayed.log\" clean smudge delay" &&
test_config_global filter.delay.required true &&
echo "abcd" >original &&
diff --git a/t/t2104-update-index-skip-worktree.sh b/t/t2104-update-index-skip-worktree.sh
index b8686aa..7ec7f30 100755
--- a/t/t2104-update-index-skip-worktree.sh
+++ b/t/t2104-update-index-skip-worktree.sh
@@ -11,27 +11,27 @@ TEST_PASSES_SANITIZE_LEAK=true
sane_unset GIT_TEST_SPLIT_INDEX
test_set_index_version () {
- GIT_INDEX_VERSION="$1"
- export GIT_INDEX_VERSION
+ GIT_INDEX_VERSION="$1"
+ export GIT_INDEX_VERSION
}
test_set_index_version 3
-cat >expect.full <<EOF
-H 1
-H 2
-H sub/1
-H sub/2
-EOF
+test_expect_success 'setup' '
+ cat >expect.full <<-\EOF &&
+ H 1
+ H 2
+ H sub/1
+ H sub/2
+ EOF
-cat >expect.skip <<EOF
-S 1
-H 2
-S sub/1
-H sub/2
-EOF
+ cat >expect.skip <<-\EOF &&
+ S 1
+ H 2
+ S sub/1
+ H sub/2
+ EOF
-test_expect_success 'setup' '
mkdir sub &&
touch ./1 ./2 sub/1 sub/2 &&
git add 1 2 sub/1 sub/2 &&
@@ -39,7 +39,7 @@ test_expect_success 'setup' '
'
test_expect_success 'index is at version 2' '
- test "$(test-tool index-version < .git/index)" = 2
+ test "$(git update-index --show-index-version)" = 2
'
test_expect_success 'update-index --skip-worktree' '
@@ -48,7 +48,7 @@ test_expect_success 'update-index --skip-worktree' '
'
test_expect_success 'index is at version 3 after having some skip-worktree entries' '
- test "$(test-tool index-version < .git/index)" = 3
+ test "$(git update-index --show-index-version)" = 3
'
test_expect_success 'ls-files -t' '
@@ -61,7 +61,7 @@ test_expect_success 'update-index --no-skip-worktree' '
'
test_expect_success 'index version is back to 2 when there is no skip-worktree entry' '
- test "$(test-tool index-version < .git/index)" = 2
+ test "$(git update-index --show-index-version)" = 2
'
test_done
diff --git a/t/t2106-update-index-assume-unchanged.sh b/t/t2106-update-index-assume-unchanged.sh
index d943ddf..95c004d 100755
--- a/t/t2106-update-index-assume-unchanged.sh
+++ b/t/t2106-update-index-assume-unchanged.sh
@@ -22,7 +22,7 @@ test_expect_success 'do not switch branches with dirty file' '
echo dirt >file &&
git update-index --assume-unchanged file &&
test_must_fail git checkout - 2>err &&
- test_i18ngrep overwritten err
+ test_grep overwritten err
'
test_done
diff --git a/t/t2107-update-index-basic.sh b/t/t2107-update-index-basic.sh
index 07e6de8..cc72ead 100755
--- a/t/t2107-update-index-basic.sh
+++ b/t/t2107-update-index-basic.sh
@@ -14,7 +14,7 @@ test_expect_success 'update-index --nonsense fails' '
test_expect_success 'update-index --nonsense dumps usage' '
test_expect_code 129 git update-index --nonsense 2>err &&
- test_i18ngrep "[Uu]sage: git update-index" err
+ test_grep "[Uu]sage: git update-index" err
'
test_expect_success 'update-index -h with corrupt index' '
@@ -25,7 +25,7 @@ test_expect_success 'update-index -h with corrupt index' '
>.git/index &&
test_expect_code 129 git update-index -h >usage 2>&1
) &&
- test_i18ngrep "[Uu]sage: git update-index" broken/usage
+ test_grep "[Uu]sage: git update-index" broken/usage
'
test_expect_success '--cacheinfo complains of missing arguments' '
@@ -83,7 +83,7 @@ test_expect_success '.lock files cleaned up' '
cd repo &&
git config core.worktree ../../worktree &&
# --refresh triggers late setup_work_tree,
- # active_cache_changed is zero, rollback_lock_file fails
+ # the_index.cache_changed is zero, rollback_lock_file fails
git update-index --refresh --verbose >out &&
test_must_be_empty out &&
! test -f .git/index.lock
@@ -111,4 +111,35 @@ test_expect_success '--chmod=+x and chmod=-x in the same argument list' '
test_cmp expect actual
'
+test_expect_success '--index-version' '
+ git commit --allow-empty -m snap &&
+ git reset --hard &&
+ git rm -f -r --cached . &&
+
+ # The default index version is 2 --- update this test
+ # when you change it in the code
+ git update-index --show-index-version >actual &&
+ echo 2 >expect &&
+ test_cmp expect actual &&
+
+ # The next test wants us to be using version 2
+ git update-index --index-version 2 &&
+
+ git update-index --index-version 4 --verbose >actual &&
+ echo "index-version: was 2, set to 4" >expect &&
+ test_cmp expect actual &&
+
+ git update-index --index-version 4 --verbose >actual &&
+ echo "index-version: was 4, set to 4" >expect &&
+ test_cmp expect actual &&
+
+ git update-index --index-version 2 --verbose >actual &&
+ echo "index-version: was 4, set to 2" >expect &&
+ test_cmp expect actual &&
+
+ # non-verbose should be silent
+ git update-index --index-version 4 >actual &&
+ test_must_be_empty actual
+'
+
test_done
diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh
index be394f1..df235ac 100755
--- a/t/t2200-add-update.sh
+++ b/t/t2200-add-update.sh
@@ -65,6 +65,16 @@ test_expect_success 'update did not touch untracked files' '
test_must_be_empty out
'
+test_expect_success 'error out when passing untracked path' '
+ git reset --hard &&
+ echo content >>baz &&
+ echo content >>top &&
+ test_must_fail git add -u baz top 2>err &&
+ test_grep -e "error: pathspec .baz. did not match any file(s) known to git" err &&
+ git diff --cached --name-only >actual &&
+ test_must_be_empty actual
+'
+
test_expect_success 'cache tree has not been corrupted' '
git ls-files -s |
@@ -197,4 +207,15 @@ test_expect_success '"add -u non-existent" should fail' '
! grep "non-existent" actual
'
+test_expect_success '"commit -a" implies "add -u" if index becomes empty' '
+ git rm -rf \* &&
+ git commit -m clean-slate &&
+ test_commit file1 &&
+ rm file1.t &&
+ test_tick &&
+ git commit -a -m remove &&
+ git ls-tree HEAD: >out &&
+ test_must_be_empty out
+'
+
test_done
diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh
index ebf58db..8fa44a9 100755
--- a/t/t2203-add-intent.sh
+++ b/t/t2203-add-intent.sh
@@ -173,7 +173,7 @@ test_expect_success 'rename detection finds the right names' '
git add -N third &&
git status | grep -v "^?" >actual.1 &&
- test_i18ngrep "renamed: *first -> third" actual.1 &&
+ test_grep "renamed: *first -> third" actual.1 &&
git status --porcelain | grep -v "^?" >actual.2 &&
cat >expected.2 <<-\EOF &&
@@ -213,8 +213,8 @@ test_expect_success 'double rename detection in status' '
git add -N third &&
git status | grep -v "^?" >actual.1 &&
- test_i18ngrep "renamed: *first -> second" actual.1 &&
- test_i18ngrep "renamed: *second -> third" actual.1 &&
+ test_grep "renamed: *first -> second" actual.1 &&
+ test_grep "renamed: *second -> third" actual.1 &&
git status --porcelain | grep -v "^?" >actual.2 &&
cat >expected.2 <<-\EOF &&
diff --git a/t/t2204-add-ignored.sh b/t/t2204-add-ignored.sh
index 89424ab..b7cf1e4 100755
--- a/t/t2204-add-ignored.sh
+++ b/t/t2204-add-ignored.sh
@@ -36,7 +36,7 @@ do
'
test_expect_success "complaints for ignored $i output" '
- test_i18ngrep -e "Use -f if" err
+ test_grep -e "Use -f if" err
'
test_expect_success "complaints for ignored $i with unignored file" '
@@ -46,7 +46,7 @@ do
test_must_be_empty out
'
test_expect_success "complaints for ignored $i with unignored file output" '
- test_i18ngrep -e "Use -f if" err
+ test_grep -e "Use -f if" err
'
done
@@ -65,7 +65,7 @@ do
test_expect_success "complaints for ignored $i in dir output" '
(
cd dir &&
- test_i18ngrep -e "Use -f if" err
+ test_grep -e "Use -f if" err
)
'
done
@@ -85,7 +85,7 @@ do
test_expect_success "complaints for ignored $i in sub output" '
(
cd sub &&
- test_i18ngrep -e "Use -f if" err
+ test_grep -e "Use -f if" err
)
'
done
diff --git a/t/t2205-add-worktree-config.sh b/t/t2205-add-worktree-config.sh
index 43d950d..98265ba 100755
--- a/t/t2205-add-worktree-config.sh
+++ b/t/t2205-add-worktree-config.sh
@@ -17,6 +17,7 @@ outside the repository. Two instances for which this can occur are tested:
repository can be added to the index.
'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success '1a: setup--config worktree' '
diff --git a/t/t2400-worktree-add.sh b/t/t2400-worktree-add.sh
index 2f564d5..ba320dc 100755
--- a/t/t2400-worktree-add.sh
+++ b/t/t2400-worktree-add.sh
@@ -5,6 +5,7 @@ test_description='test git worktree add'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-rebase.sh
@@ -120,7 +121,30 @@ test_expect_success '"add" worktree creating new branch' '
test_expect_success 'die the same branch is already checked out' '
(
cd here &&
- test_must_fail git checkout newmain
+ test_must_fail git checkout newmain 2>actual &&
+ grep "already used by worktree at" actual
+ )
+'
+
+test_expect_success 'refuse to reset a branch in use elsewhere' '
+ (
+ cd here &&
+
+ # we know we are on detached HEAD but just in case ...
+ git checkout --detach HEAD &&
+ git rev-parse --verify HEAD >old.head &&
+
+ git rev-parse --verify refs/heads/newmain >old.branch &&
+ test_must_fail git checkout -B newmain 2>error &&
+ git rev-parse --verify refs/heads/newmain >new.branch &&
+ git rev-parse --verify HEAD >new.head &&
+
+ grep "already used by worktree at" error &&
+ test_cmp old.branch new.branch &&
+ test_cmp old.head new.head &&
+
+ # and we must be still on the same detached HEAD state
+ test_must_fail git symbolic-ref HEAD
)
'
@@ -229,6 +253,7 @@ test_expect_success 'checkout with grafts' '
SHA1=$(git rev-parse HEAD) &&
test_commit def &&
test_commit xyz &&
+ mkdir .git/info &&
echo "$(git rev-parse HEAD) $SHA1" >.git/info/grafts &&
cat >expected <<-\EOF &&
xyz
@@ -296,17 +321,24 @@ test_expect_success '"add" no auto-vivify with --detach and <branch> omitted' '
test_must_fail git -C mish/mash symbolic-ref HEAD
'
-test_expect_success '"add" -b/-B mutually exclusive' '
- test_must_fail git worktree add -b poodle -B poodle bamboo main
-'
-
-test_expect_success '"add" -b/--detach mutually exclusive' '
- test_must_fail git worktree add -b poodle --detach bamboo main
-'
+# Helper function to test mutually exclusive options.
+#
+# Note: Quoted arguments containing spaces are not supported.
+test_wt_add_excl () {
+ local opts="$*" &&
+ test_expect_success "'worktree add' with '$opts' has mutually exclusive options" '
+ test_must_fail git worktree add $opts 2>actual &&
+ grep -E "fatal:( options)? .* cannot be used together" actual
+ '
+}
-test_expect_success '"add" -B/--detach mutually exclusive' '
- test_must_fail git worktree add -B poodle --detach bamboo main
-'
+test_wt_add_excl -b poodle -B poodle bamboo main
+test_wt_add_excl -b poodle --detach bamboo main
+test_wt_add_excl -B poodle --detach bamboo main
+test_wt_add_excl --orphan --detach bamboo
+test_wt_add_excl --orphan --no-checkout bamboo
+test_wt_add_excl --orphan bamboo main
+test_wt_add_excl --orphan -b bamboo wtdir/ main
test_expect_success '"add -B" fails if the branch is checked out' '
git rev-parse newmain >before &&
@@ -324,10 +356,111 @@ test_expect_success 'add -B' '
'
test_expect_success 'add --quiet' '
+ test_when_finished "git worktree remove -f -f another-worktree" &&
git worktree add --quiet another-worktree main 2>actual &&
test_must_be_empty actual
'
+test_expect_success 'add --quiet -b' '
+ test_when_finished "git branch -D quietnewbranch" &&
+ test_when_finished "git worktree remove -f -f another-worktree" &&
+ git worktree add --quiet -b quietnewbranch another-worktree 2>actual &&
+ test_must_be_empty actual
+'
+
+test_expect_success '"add --orphan"' '
+ test_when_finished "git worktree remove -f -f orphandir" &&
+ git worktree add --orphan -b neworphan orphandir &&
+ echo refs/heads/neworphan >expected &&
+ git -C orphandir symbolic-ref HEAD >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success '"add --orphan (no -b)"' '
+ test_when_finished "git worktree remove -f -f neworphan" &&
+ git worktree add --orphan neworphan &&
+ echo refs/heads/neworphan >expected &&
+ git -C neworphan symbolic-ref HEAD >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success '"add --orphan --quiet"' '
+ test_when_finished "git worktree remove -f -f orphandir" &&
+ git worktree add --quiet --orphan -b neworphan orphandir 2>log.actual &&
+ test_must_be_empty log.actual &&
+ echo refs/heads/neworphan >expected &&
+ git -C orphandir symbolic-ref HEAD >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success '"add --orphan" fails if the branch already exists' '
+ test_when_finished "git branch -D existingbranch" &&
+ git worktree add -b existingbranch orphandir main &&
+ git worktree remove orphandir &&
+ test_must_fail git worktree add --orphan -b existingbranch orphandir
+'
+
+test_expect_success '"add --orphan" with empty repository' '
+ test_when_finished "rm -rf empty_repo" &&
+ echo refs/heads/newbranch >expected &&
+ GIT_DIR="empty_repo" git init --bare &&
+ git -C empty_repo worktree add --orphan -b newbranch worktreedir &&
+ git -C empty_repo/worktreedir symbolic-ref HEAD >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success '"add" worktree with orphan branch and lock' '
+ git worktree add --lock --orphan -b orphanbr orphan-with-lock &&
+ test_when_finished "git worktree unlock orphan-with-lock || :" &&
+ test -f .git/worktrees/orphan-with-lock/locked
+'
+
+test_expect_success '"add" worktree with orphan branch, lock, and reason' '
+ lock_reason="why not" &&
+ git worktree add --detach --lock --reason "$lock_reason" orphan-with-lock-reason main &&
+ test_when_finished "git worktree unlock orphan-with-lock-reason || :" &&
+ test -f .git/worktrees/orphan-with-lock-reason/locked &&
+ echo "$lock_reason" >expect &&
+ test_cmp expect .git/worktrees/orphan-with-lock-reason/locked
+'
+
+# Note: Quoted arguments containing spaces are not supported.
+test_wt_add_orphan_hint () {
+ local context="$1" &&
+ local use_branch="$2" &&
+ shift 2 &&
+ local opts="$*" &&
+ test_expect_success "'worktree add' show orphan hint in bad/orphan HEAD w/ $context" '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (cd repo && test_commit commit) &&
+ git -C repo switch --orphan noref &&
+ test_must_fail git -C repo worktree add $opts foobar/ 2>actual &&
+ ! grep "error: unknown switch" actual &&
+ grep "hint: If you meant to create a worktree containing a new unborn branch" actual &&
+ if [ $use_branch -eq 1 ]
+ then
+ grep -E "^hint: +git worktree add --orphan -b [^ ]+ [^ ]+$" actual
+ else
+ grep -E "^hint: +git worktree add --orphan [^ ]+$" actual
+ fi
+
+ '
+}
+
+test_wt_add_orphan_hint 'no opts' 0
+test_wt_add_orphan_hint '-b' 1 -b foobar_branch
+test_wt_add_orphan_hint '-B' 1 -B foobar_branch
+
+test_expect_success "'worktree add' doesn't show orphan hint in bad/orphan HEAD w/ --quiet" '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (cd repo && test_commit commit) &&
+ test_must_fail git -C repo worktree add --quiet foobar_branch foobar/ 2>actual &&
+ ! grep "error: unknown switch" actual &&
+ ! grep "hint: If you meant to create a worktree containing a new unborn branch" actual
+'
+
test_expect_success 'local clone from linked checkout' '
git clone --local here here-clone &&
( cd here-clone && git fsck )
@@ -357,7 +490,8 @@ test_expect_success 'put a worktree under rebase' '
cd under-rebase &&
set_fake_editor &&
FAKE_LINES="edit 1" git rebase -i HEAD^ &&
- git worktree list | grep "under-rebase.*detached HEAD"
+ git worktree list >actual &&
+ grep "under-rebase.*detached HEAD" actual
)
'
@@ -398,7 +532,8 @@ test_expect_success 'checkout a branch under bisect' '
git bisect start &&
git bisect bad &&
git bisect good HEAD~2 &&
- git worktree list | grep "under-bisect.*detached HEAD" &&
+ git worktree list >actual &&
+ grep "under-bisect.*detached HEAD" actual &&
test_must_fail git worktree add new-bisect under-bisect &&
! test -d new-bisect
)
@@ -444,6 +579,14 @@ setup_remote_repo () {
)
}
+test_expect_success '"add" <path> <remote/branch> w/ no HEAD' '
+ test_when_finished rm -rf repo_upstream repo_local foo &&
+ setup_remote_repo repo_upstream repo_local &&
+ git -C repo_local config --bool core.bare true &&
+ git -C repo_local branch -D main &&
+ git -C repo_local worktree add ./foo repo_upstream/foo
+'
+
test_expect_success '--no-track avoids setting up tracking' '
test_when_finished rm -rf repo_upstream repo_local foo &&
setup_remote_repo repo_upstream repo_local &&
@@ -526,6 +669,35 @@ test_expect_success 'git worktree add --guess-remote sets up tracking' '
test_cmp_rev refs/remotes/repo_a/foo refs/heads/foo
)
'
+test_expect_success 'git worktree add --guess-remote sets up tracking (quiet)' '
+ test_when_finished rm -rf repo_a repo_b foo &&
+ setup_remote_repo repo_a repo_b &&
+ (
+ cd repo_b &&
+ git worktree add --quiet --guess-remote ../foo 2>actual &&
+ test_must_be_empty actual
+ ) &&
+ (
+ cd foo &&
+ test_branch_upstream foo repo_a foo &&
+ test_cmp_rev refs/remotes/repo_a/foo refs/heads/foo
+ )
+'
+
+test_expect_success 'git worktree --no-guess-remote (quiet)' '
+ test_when_finished rm -rf repo_a repo_b foo &&
+ setup_remote_repo repo_a repo_b &&
+ (
+ cd repo_b &&
+ git worktree add --quiet --no-guess-remote ../foo
+ ) &&
+ (
+ cd foo &&
+ test_must_fail git config "branch.foo.remote" &&
+ test_must_fail git config "branch.foo.merge" &&
+ test_cmp_rev ! refs/remotes/repo_a/foo refs/heads/foo
+ )
+'
test_expect_success 'git worktree add with worktree.guessRemote sets up tracking' '
test_when_finished rm -rf repo_a repo_b foo &&
@@ -558,7 +730,351 @@ test_expect_success 'git worktree --no-guess-remote option overrides config' '
)
'
+test_dwim_orphan () {
+ local info_text="No possible source branch, inferring '--orphan'" &&
+ local fetch_error_text="fatal: No local or remote refs exist despite at least one remote" &&
+ local orphan_hint="hint: If you meant to create a worktree containing a new unborn branch" &&
+ local invalid_ref_regex="^fatal: invalid reference: " &&
+ local bad_combo_regex="^fatal: options '[-a-z]*' and '[-a-z]*' cannot be used together" &&
+
+ local git_ns="repo" &&
+ local dashc_args="-C $git_ns" &&
+ local use_cd=0 &&
+
+ local bad_head=0 &&
+ local empty_repo=1 &&
+ local local_ref=0 &&
+ local use_quiet=0 &&
+ local remote=0 &&
+ local remote_ref=0 &&
+ local use_detach=0 &&
+ local use_new_branch=0 &&
+
+ local outcome="$1" &&
+ local outcome_text &&
+ local success &&
+ shift &&
+ local args="" &&
+ local context="" &&
+ case "$outcome" in
+ "infer")
+ success=1 &&
+ outcome_text='"add" DWIM infer --orphan'
+ ;;
+ "no_infer")
+ success=1 &&
+ outcome_text='"add" DWIM doesnt infer --orphan'
+ ;;
+ "fetch_error")
+ success=0 &&
+ outcome_text='"add" error need fetch'
+ ;;
+ "fatal_orphan_bad_combo")
+ success=0 &&
+ outcome_text='"add" error inferred "--orphan" gives illegal opts combo'
+ ;;
+ "warn_bad_head")
+ success=0 &&
+ outcome_text='"add" error, warn on bad HEAD, hint use orphan'
+ ;;
+ *)
+ echo "test_dwim_orphan(): invalid outcome: '$outcome'" >&2 &&
+ return 1
+ ;;
+ esac &&
+ while [ $# -gt 0 ]
+ do
+ case "$1" in
+ # How and from where to create the worktree
+ "-C_repo")
+ use_cd=0 &&
+ git_ns="repo" &&
+ dashc_args="-C $git_ns" &&
+ context="$context, 'git -C repo'"
+ ;;
+ "-C_wt")
+ use_cd=0 &&
+ git_ns="wt" &&
+ dashc_args="-C $git_ns" &&
+ context="$context, 'git -C wt'"
+ ;;
+ "cd_repo")
+ use_cd=1 &&
+ git_ns="repo" &&
+ dashc_args="" &&
+ context="$context, 'cd repo && git'"
+ ;;
+ "cd_wt")
+ use_cd=1 &&
+ git_ns="wt" &&
+ dashc_args="" &&
+ context="$context, 'cd wt && git'"
+ ;;
+
+ # Bypass the "pull first" warning
+ "force")
+ args="$args --force" &&
+ context="$context, --force"
+ ;;
+
+ # Try to use remote refs when DWIM
+ "guess_remote")
+ args="$args --guess-remote" &&
+ context="$context, --guess-remote"
+ ;;
+ "no_guess_remote")
+ args="$args --no-guess-remote" &&
+ context="$context, --no-guess-remote"
+ ;;
+
+ # Whether there is at least one local branch present
+ "local_ref")
+ empty_repo=0 &&
+ local_ref=1 &&
+ context="$context, >=1 local branches"
+ ;;
+ "no_local_ref")
+ empty_repo=0 &&
+ context="$context, 0 local branches"
+ ;;
+
+ # Whether the HEAD points at a valid ref (skip this opt when no refs)
+ "good_head")
+ # requires: local_ref
+ context="$context, valid HEAD"
+ ;;
+ "bad_head")
+ bad_head=1 &&
+ context="$context, invalid (or orphan) HEAD"
+ ;;
+
+ # Whether the code path is tested with the base add command, -b, or --detach
+ "no_-b")
+ use_new_branch=0 &&
+ context="$context, no --branch"
+ ;;
+ "-b")
+ use_new_branch=1 &&
+ context="$context, --branch"
+ ;;
+ "detach")
+ use_detach=1 &&
+ context="$context, --detach"
+ ;;
+
+ # Whether to check that all output is suppressed (except errors)
+ # or that the output is as expected
+ "quiet")
+ use_quiet=1 &&
+ args="$args --quiet" &&
+ context="$context, --quiet"
+ ;;
+ "no_quiet")
+ use_quiet=0 &&
+ context="$context, no --quiet (expect output)"
+ ;;
+
+ # Whether there is at least one remote attached to the repo
+ "remote")
+ empty_repo=0 &&
+ remote=1 &&
+ context="$context, >=1 remotes"
+ ;;
+ "no_remote")
+ empty_repo=0 &&
+ remote=0 &&
+ context="$context, 0 remotes"
+ ;;
+
+ # Whether there is at least one valid remote ref
+ "remote_ref")
+ # requires: remote
+ empty_repo=0 &&
+ remote_ref=1 &&
+ context="$context, >=1 fetched remote branches"
+ ;;
+ "no_remote_ref")
+ empty_repo=0 &&
+ remote_ref=0 &&
+ context="$context, 0 fetched remote branches"
+ ;;
+
+ # Options or flags that become illegal when --orphan is inferred
+ "no_checkout")
+ args="$args --no-checkout" &&
+ context="$context, --no-checkout"
+ ;;
+ "track")
+ args="$args --track" &&
+ context="$context, --track"
+ ;;
+
+ # All other options are illegal
+ *)
+ echo "test_dwim_orphan(): invalid arg: '$1'" >&2 &&
+ return 1
+ ;;
+ esac &&
+ shift
+ done &&
+ context="${context#', '}" &&
+ if [ $use_new_branch -eq 1 ]
+ then
+ args="$args -b foo"
+ elif [ $use_detach -eq 1 ]
+ then
+ args="$args --detach"
+ else
+ context="DWIM (no --branch), $context"
+ fi &&
+ if [ $empty_repo -eq 1 ]
+ then
+ context="empty repo, $context"
+ fi &&
+ args="$args ../foo" &&
+ context="${context%', '}" &&
+ test_expect_success "$outcome_text w/ $context" '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ if [ $local_ref -eq 1 ] && [ "$git_ns" = "repo" ]
+ then
+ (cd repo && test_commit commit) &&
+ if [ $bad_head -eq 1 ]
+ then
+ git -C repo symbolic-ref HEAD refs/heads/badbranch
+ fi
+ elif [ $local_ref -eq 1 ] && [ "$git_ns" = "wt" ]
+ then
+ test_when_finished "git -C repo worktree remove -f ../wt" &&
+ git -C repo worktree add --orphan -b main ../wt &&
+ (cd wt && test_commit commit) &&
+ if [ $bad_head -eq 1 ]
+ then
+ git -C wt symbolic-ref HEAD refs/heads/badbranch
+ fi
+ elif [ $local_ref -eq 0 ] && [ "$git_ns" = "wt" ]
+ then
+ test_when_finished "git -C repo worktree remove -f ../wt" &&
+ git -C repo worktree add --orphan -b orphanbranch ../wt
+ fi &&
+
+ if [ $remote -eq 1 ]
+ then
+ test_when_finished "rm -rf upstream" &&
+ git init upstream &&
+ (cd upstream && test_commit commit) &&
+ git -C upstream switch -c foo &&
+ git -C repo remote add upstream ../upstream
+ fi &&
+
+ if [ $remote_ref -eq 1 ]
+ then
+ git -C repo fetch
+ fi &&
+ if [ $success -eq 1 ]
+ then
+ test_when_finished git -C repo worktree remove ../foo
+ fi &&
+ (
+ if [ $use_cd -eq 1 ]
+ then
+ cd $git_ns
+ fi &&
+ if [ "$outcome" = "infer" ]
+ then
+ git $dashc_args worktree add $args 2>actual &&
+ if [ $use_quiet -eq 1 ]
+ then
+ test_must_be_empty actual
+ else
+ grep "$info_text" actual
+ fi
+ elif [ "$outcome" = "no_infer" ]
+ then
+ git $dashc_args worktree add $args 2>actual &&
+ if [ $use_quiet -eq 1 ]
+ then
+ test_must_be_empty actual
+ else
+ ! grep "$info_text" actual
+ fi
+ elif [ "$outcome" = "fetch_error" ]
+ then
+ test_must_fail git $dashc_args worktree add $args 2>actual &&
+ grep "$fetch_error_text" actual
+ elif [ "$outcome" = "fatal_orphan_bad_combo" ]
+ then
+ test_must_fail git $dashc_args worktree add $args 2>actual &&
+ if [ $use_quiet -eq 1 ]
+ then
+ ! grep "$info_text" actual
+ else
+ grep "$info_text" actual
+ fi &&
+ grep "$bad_combo_regex" actual
+ elif [ "$outcome" = "warn_bad_head" ]
+ then
+ test_must_fail git $dashc_args worktree add $args 2>actual &&
+ if [ $use_quiet -eq 1 ]
+ then
+ grep "$invalid_ref_regex" actual &&
+ ! grep "$orphan_hint" actual
+ else
+ headpath=$(git $dashc_args rev-parse --path-format=absolute --git-path HEAD) &&
+ headcontents=$(cat "$headpath") &&
+ grep "HEAD points to an invalid (or orphaned) reference" actual &&
+ grep "HEAD path: .$headpath." actual &&
+ grep "HEAD contents: .$headcontents." actual &&
+ grep "$orphan_hint" actual &&
+ ! grep "$info_text" actual
+ fi &&
+ grep "$invalid_ref_regex" actual
+ else
+ # Unreachable
+ false
+ fi
+ ) &&
+ if [ $success -ne 1 ]
+ then
+ test_path_is_missing foo
+ fi
+ '
+}
+
+for quiet_mode in "no_quiet" "quiet"
+do
+ for changedir_type in "cd_repo" "cd_wt" "-C_repo" "-C_wt"
+ do
+ dwim_test_args="$quiet_mode $changedir_type"
+ test_dwim_orphan 'infer' $dwim_test_args no_-b
+ test_dwim_orphan 'no_infer' $dwim_test_args no_-b local_ref good_head
+ test_dwim_orphan 'infer' $dwim_test_args no_-b no_local_ref no_remote no_remote_ref no_guess_remote
+ test_dwim_orphan 'infer' $dwim_test_args no_-b no_local_ref remote no_remote_ref no_guess_remote
+ test_dwim_orphan 'fetch_error' $dwim_test_args no_-b no_local_ref remote no_remote_ref guess_remote
+ test_dwim_orphan 'infer' $dwim_test_args no_-b no_local_ref remote no_remote_ref guess_remote force
+ test_dwim_orphan 'no_infer' $dwim_test_args no_-b no_local_ref remote remote_ref guess_remote
+
+ test_dwim_orphan 'infer' $dwim_test_args -b
+ test_dwim_orphan 'no_infer' $dwim_test_args -b local_ref good_head
+ test_dwim_orphan 'infer' $dwim_test_args -b no_local_ref no_remote no_remote_ref no_guess_remote
+ test_dwim_orphan 'infer' $dwim_test_args -b no_local_ref remote no_remote_ref no_guess_remote
+ test_dwim_orphan 'infer' $dwim_test_args -b no_local_ref remote no_remote_ref guess_remote
+ test_dwim_orphan 'infer' $dwim_test_args -b no_local_ref remote remote_ref guess_remote
+
+ test_dwim_orphan 'warn_bad_head' $dwim_test_args no_-b local_ref bad_head
+ test_dwim_orphan 'warn_bad_head' $dwim_test_args -b local_ref bad_head
+ test_dwim_orphan 'warn_bad_head' $dwim_test_args detach local_ref bad_head
+ done
+
+ test_dwim_orphan 'fatal_orphan_bad_combo' $quiet_mode no_-b no_checkout
+ test_dwim_orphan 'fatal_orphan_bad_combo' $quiet_mode no_-b track
+ test_dwim_orphan 'fatal_orphan_bad_combo' $quiet_mode -b no_checkout
+ test_dwim_orphan 'fatal_orphan_bad_combo' $quiet_mode -b track
+done
+
post_checkout_hook () {
+ test_when_finished "rm -rf .git/hooks" &&
+ mkdir .git/hooks &&
test_hook -C "$1" post-checkout <<-\EOF
{
echo $*
@@ -665,6 +1181,7 @@ test_expect_success '"add" should not fail because of another bad worktree' '
'
test_expect_success '"add" with uninitialized submodule, with submodule.recurse unset' '
+ test_config_global protocol.file.allow always &&
test_create_repo submodule &&
test_commit -C submodule first &&
test_create_repo project &&
@@ -680,6 +1197,7 @@ test_expect_success '"add" with uninitialized submodule, with submodule.recurse
'
test_expect_success '"add" with initialized submodule, with submodule.recurse unset' '
+ test_config_global protocol.file.allow always &&
git -C project-clone submodule update --init &&
git -C project-clone worktree add ../project-4
'
diff --git a/t/t2401-worktree-prune.sh b/t/t2401-worktree-prune.sh
index 3d28c7f..71aa9bc 100755
--- a/t/t2401-worktree-prune.sh
+++ b/t/t2401-worktree-prune.sh
@@ -5,6 +5,7 @@ test_description='prune $GIT_DIR/worktrees'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success initialize '
@@ -46,7 +47,7 @@ test_expect_success SANITY 'prune directories with unreadable gitdir' '
: >.git/worktrees/def/gitdir &&
chmod u-r .git/worktrees/def/gitdir &&
git worktree prune --verbose 2>actual &&
- test_i18ngrep "Removing worktrees/def: unable to read gitdir file" actual &&
+ test_grep "Removing worktrees/def: unable to read gitdir file" actual &&
! test -d .git/worktrees/def &&
! test -d .git/worktrees
'
@@ -56,7 +57,7 @@ test_expect_success 'prune directories with invalid gitdir' '
: >.git/worktrees/def/def &&
: >.git/worktrees/def/gitdir &&
git worktree prune --verbose 2>actual &&
- test_i18ngrep "Removing worktrees/def: invalid gitdir file" actual &&
+ test_grep "Removing worktrees/def: invalid gitdir file" actual &&
! test -d .git/worktrees/def &&
! test -d .git/worktrees
'
@@ -66,7 +67,7 @@ test_expect_success 'prune directories with gitdir pointing to nowhere' '
: >.git/worktrees/def/def &&
echo "$(pwd)"/nowhere >.git/worktrees/def/gitdir &&
git worktree prune --verbose 2>actual &&
- test_i18ngrep "Removing worktrees/def: gitdir file points to non-existent location" actual &&
+ test_grep "Removing worktrees/def: gitdir file points to non-existent location" actual &&
! test -d .git/worktrees/def &&
! test -d .git/worktrees
'
@@ -102,7 +103,7 @@ test_expect_success 'prune duplicate (linked/linked)' '
sed "s/w2/w1/" .git/worktrees/w2/gitdir >.git/worktrees/w2/gitdir.new &&
mv .git/worktrees/w2/gitdir.new .git/worktrees/w2/gitdir &&
git worktree prune --verbose 2>actual &&
- test_i18ngrep "duplicate entry" actual &&
+ test_grep "duplicate entry" actual &&
test -d .git/worktrees/w1 &&
! test -d .git/worktrees/w2
'
@@ -115,7 +116,7 @@ test_expect_success 'prune duplicate (main/linked)' '
rm -fr wt &&
mv repo wt &&
git -C wt worktree prune --verbose 2>actual &&
- test_i18ngrep "duplicate entry" actual &&
+ test_grep "duplicate entry" actual &&
! test -d .git/worktrees/wt
'
diff --git a/t/t2402-worktree-list.sh b/t/t2402-worktree-list.sh
index 79e0fce..33ea9cb 100755
--- a/t/t2402-worktree-list.sh
+++ b/t/t2402-worktree-list.sh
@@ -5,6 +5,7 @@ test_description='test git worktree list'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -142,7 +143,7 @@ test_expect_success '"list" all worktrees --porcelain with prunable' '
rm -rf prunable &&
git worktree list --porcelain >out &&
sed -n "/^worktree .*\/prunable$/,/^$/p" <out >only_prunable &&
- test_i18ngrep "^prunable gitdir file points to non-existent location$" only_prunable
+ test_grep "^prunable gitdir file points to non-existent location$" only_prunable
'
test_expect_success '"list" all worktrees with prunable consistent with "prune"' '
@@ -154,8 +155,8 @@ test_expect_success '"list" all worktrees with prunable consistent with "prune"'
grep "/prunable *[0-9a-f].* prunable$" out &&
! grep "/unprunable *[0-9a-f].* unprunable$" out &&
git worktree prune --verbose 2>out &&
- test_i18ngrep "^Removing worktrees/prunable" out &&
- test_i18ngrep ! "^Removing worktrees/unprunable" out
+ test_grep "^Removing worktrees/prunable" out &&
+ test_grep ! "^Removing worktrees/unprunable" out
'
test_expect_success '"list" --verbose and --porcelain mutually exclusive' '
diff --git a/t/t2403-worktree-move.sh b/t/t2403-worktree-move.sh
index a4e1a17..901342e 100755
--- a/t/t2403-worktree-move.sh
+++ b/t/t2403-worktree-move.sh
@@ -2,6 +2,7 @@
test_description='test git worktree move, remove, lock and unlock'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -138,7 +139,8 @@ test_expect_success 'move a repo with uninitialized submodule' '
(
cd withsub &&
test_commit initial &&
- git submodule add "$PWD"/.git sub &&
+ git -c protocol.file.allow=always \
+ submodule add "$PWD"/.git sub &&
git commit -m withsub &&
git worktree add second HEAD &&
git worktree move second third
@@ -148,7 +150,7 @@ test_expect_success 'move a repo with uninitialized submodule' '
test_expect_success 'not move a repo with initialized submodule' '
(
cd withsub &&
- git -C third submodule update &&
+ git -c protocol.file.allow=always -C third submodule update &&
test_must_fail git worktree move third forth
)
'
@@ -200,7 +202,7 @@ test_expect_success 'proper error when worktree not found' '
for i in noodle noodle/bork
do
test_must_fail git worktree lock $i 2>err &&
- test_i18ngrep "not a working tree" err || return 1
+ test_grep "not a working tree" err || return 1
done
'
@@ -227,6 +229,7 @@ test_expect_success 'remove cleans up .git/worktrees when empty' '
'
test_expect_success 'remove a repo with uninitialized submodule' '
+ test_config_global protocol.file.allow always &&
(
cd withsub &&
git worktree add to-remove HEAD &&
@@ -235,6 +238,7 @@ test_expect_success 'remove a repo with uninitialized submodule' '
'
test_expect_success 'not remove a repo with initialized submodule' '
+ test_config_global protocol.file.allow always &&
(
cd withsub &&
git worktree add to-remove HEAD &&
diff --git a/t/t2405-worktree-submodule.sh b/t/t2405-worktree-submodule.sh
index b172c26..11018f3 100755
--- a/t/t2405-worktree-submodule.sh
+++ b/t/t2405-worktree-submodule.sh
@@ -10,6 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
base_path=$(pwd -P)
test_expect_success 'setup: create origin repos' '
+ git config --global protocol.file.allow always &&
git init origin/sub &&
test_commit -C origin/sub file1 &&
git init origin/main &&
diff --git a/t/t2406-worktree-repair.sh b/t/t2406-worktree-repair.sh
index 5c44453..edbf502 100755
--- a/t/t2406-worktree-repair.sh
+++ b/t/t2406-worktree-repair.sh
@@ -2,6 +2,7 @@
test_description='test git worktree repair'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
@@ -24,7 +25,7 @@ test_expect_success 'worktree path not directory' '
>notdir &&
test_must_fail git worktree repair >out 2>err &&
test_must_be_empty out &&
- test_i18ngrep "not a directory" err
+ test_grep "not a directory" err
'
test_expect_success "don't clobber .git repo" '
@@ -34,7 +35,7 @@ test_expect_success "don't clobber .git repo" '
test_create_repo repo &&
test_must_fail git worktree repair >out 2>err &&
test_must_be_empty out &&
- test_i18ngrep ".git is not a file" err
+ test_grep ".git is not a file" err
'
test_corrupt_gitfile () {
@@ -46,7 +47,7 @@ test_corrupt_gitfile () {
git -C corrupt rev-parse --absolute-git-dir >expect &&
eval "$butcher" &&
git -C "$repairdir" worktree repair 2>err &&
- test_i18ngrep "$problem" err &&
+ test_grep "$problem" err &&
git -C corrupt rev-parse --absolute-git-dir >actual &&
test_cmp expect actual
}
@@ -92,7 +93,7 @@ test_expect_success 'repair .git file from bare.git' '
test_expect_success 'invalid worktree path' '
test_must_fail git worktree repair /notvalid >out 2>err &&
test_must_be_empty out &&
- test_i18ngrep "not a valid path" err
+ test_grep "not a valid path" err
'
test_expect_success 'repo not found; .git not file' '
@@ -100,7 +101,7 @@ test_expect_success 'repo not found; .git not file' '
test_create_repo not-a-worktree &&
test_must_fail git worktree repair not-a-worktree >out 2>err &&
test_must_be_empty out &&
- test_i18ngrep ".git is not a file" err
+ test_grep ".git is not a file" err
'
test_expect_success 'repo not found; .git not referencing repo' '
@@ -110,7 +111,7 @@ test_expect_success 'repo not found; .git not referencing repo' '
mv side/.newgit side/.git &&
mkdir not-a-repo &&
test_must_fail git worktree repair side 2>err &&
- test_i18ngrep ".git file does not reference a repository" err
+ test_grep ".git file does not reference a repository" err
'
test_expect_success 'repo not found; .git file broken' '
@@ -120,7 +121,7 @@ test_expect_success 'repo not found; .git file broken' '
mv orig moved &&
test_must_fail git worktree repair moved >out 2>err &&
test_must_be_empty out &&
- test_i18ngrep ".git file broken" err
+ test_grep ".git file broken" err
'
test_expect_success 'repair broken gitdir' '
@@ -131,7 +132,7 @@ test_expect_success 'repair broken gitdir' '
mv orig moved &&
git worktree repair moved 2>err &&
test_cmp expect .git/worktrees/orig/gitdir &&
- test_i18ngrep "gitdir unreadable" err
+ test_grep "gitdir unreadable" err
'
test_expect_success 'repair incorrect gitdir' '
@@ -141,7 +142,7 @@ test_expect_success 'repair incorrect gitdir' '
mv orig moved &&
git worktree repair moved 2>err &&
test_cmp expect .git/worktrees/orig/gitdir &&
- test_i18ngrep "gitdir incorrect" err
+ test_grep "gitdir incorrect" err
'
test_expect_success 'repair gitdir (implicit) from linked worktree' '
@@ -151,7 +152,7 @@ test_expect_success 'repair gitdir (implicit) from linked worktree' '
mv orig moved &&
git -C moved worktree repair 2>err &&
test_cmp expect .git/worktrees/orig/gitdir &&
- test_i18ngrep "gitdir incorrect" err
+ test_grep "gitdir incorrect" err
'
test_expect_success 'unable to repair gitdir (implicit) from main worktree' '
@@ -176,8 +177,8 @@ test_expect_success 'repair multiple gitdir files' '
git worktree repair moved1 moved2 2>err &&
test_cmp expect1 .git/worktrees/orig1/gitdir &&
test_cmp expect2 .git/worktrees/orig2/gitdir &&
- test_i18ngrep "gitdir incorrect:.*orig1/gitdir$" err &&
- test_i18ngrep "gitdir incorrect:.*orig2/gitdir$" err
+ test_grep "gitdir incorrect:.*orig1/gitdir$" err &&
+ test_grep "gitdir incorrect:.*orig2/gitdir$" err
'
test_expect_success 'repair moved main and linked worktrees' '
diff --git a/t/t2407-worktree-heads.sh b/t/t2407-worktree-heads.sh
new file mode 100755
index 0000000..f6835c9
--- /dev/null
+++ b/t/t2407-worktree-heads.sh
@@ -0,0 +1,180 @@
+#!/bin/sh
+
+test_description='test operations trying to overwrite refs at worktree HEAD'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+ test_commit init &&
+
+ for i in 1 2 3 4
+ do
+ git checkout -b conflict-$i &&
+ echo "not I" >$i.t &&
+ git add $i.t &&
+ git commit -m "will conflict" &&
+
+ git checkout - &&
+ test_commit $i &&
+ git branch wt-$i &&
+ git branch fake-$i &&
+ git worktree add wt-$i wt-$i || return 1
+ done &&
+
+ # Create a server that updates each branch by one commit
+ git init server &&
+ test_commit -C server initial &&
+ git remote add server ./server &&
+ for i in 1 2 3 4
+ do
+ git -C server checkout -b wt-$i &&
+ test_commit -C server A-$i || return 1
+ done &&
+ for i in 1 2
+ do
+ git -C server checkout -b fake-$i &&
+ test_commit -C server f-$i || return 1
+ done
+'
+
+test_expect_success 'refuse to overwrite: checked out in worktree' '
+ for i in 1 2 3 4
+ do
+ test_must_fail git branch -f wt-$i HEAD 2>err &&
+ grep "cannot force update the branch" err &&
+
+ test_must_fail git branch -D wt-$i 2>err &&
+ grep "cannot delete branch" err || return 1
+ done
+'
+
+test_expect_success !SANITIZE_LEAK 'refuse to overwrite: worktree in bisect' '
+ test_when_finished git -C wt-4 bisect reset &&
+
+ # Set up a bisect so HEAD no longer points to wt-4.
+ git -C wt-4 bisect start &&
+ git -C wt-4 bisect bad wt-4 &&
+ git -C wt-4 bisect good wt-1 &&
+
+ test_must_fail git branch -f wt-4 HEAD 2>err &&
+ grep "cannot force update the branch '\''wt-4'\'' used by worktree at.*wt-4" err
+'
+
+test_expect_success !SANITIZE_LEAK 'refuse to overwrite: worktree in rebase (apply)' '
+ test_when_finished git -C wt-2 rebase --abort &&
+
+ # This will fail part-way through due to a conflict.
+ test_must_fail git -C wt-2 rebase --apply conflict-2 &&
+
+ test_must_fail git branch -f wt-2 HEAD 2>err &&
+ grep "cannot force update the branch '\''wt-2'\'' used by worktree at.*wt-2" err
+'
+
+test_expect_success !SANITIZE_LEAK 'refuse to overwrite: worktree in rebase (merge)' '
+ test_when_finished git -C wt-2 rebase --abort &&
+
+ # This will fail part-way through due to a conflict.
+ test_must_fail git -C wt-2 rebase conflict-2 &&
+
+ test_must_fail git branch -f wt-2 HEAD 2>err &&
+ grep "cannot force update the branch '\''wt-2'\'' used by worktree at.*wt-2" err
+'
+
+test_expect_success !SANITIZE_LEAK 'refuse to overwrite: worktree in rebase with --update-refs' '
+ test_when_finished git -C wt-3 rebase --abort &&
+
+ git branch -f can-be-updated wt-3 &&
+ test_must_fail git -C wt-3 rebase --update-refs conflict-3 &&
+
+ for i in 3 4
+ do
+ test_must_fail git branch -f can-be-updated HEAD 2>err &&
+ grep "cannot force update the branch '\''can-be-updated'\'' used by worktree at.*wt-3" err ||
+ return 1
+ done
+'
+
+test_expect_success !SANITIZE_LEAK 'refuse to fetch over ref: checked out' '
+ test_must_fail git fetch server +refs/heads/wt-3:refs/heads/wt-3 2>err &&
+ grep "refusing to fetch into branch '\''refs/heads/wt-3'\''" err &&
+
+ # General fetch into refs/heads/ will fail on first ref,
+ # so use a generic error message check.
+ test_must_fail git fetch server +refs/heads/*:refs/heads/* 2>err &&
+ grep "refusing to fetch into branch" err
+'
+
+test_expect_success !SANITIZE_LEAK 'refuse to fetch over ref: worktree in bisect' '
+ test_when_finished git -C wt-4 bisect reset &&
+
+ # Set up a bisect so HEAD no longer points to wt-4.
+ git -C wt-4 bisect start &&
+ git -C wt-4 bisect bad wt-4 &&
+ git -C wt-4 bisect good wt-1 &&
+
+ test_must_fail git fetch server +refs/heads/wt-4:refs/heads/wt-4 2>err &&
+ grep "refusing to fetch into branch" err
+'
+
+test_expect_success !SANITIZE_LEAK 'refuse to fetch over ref: worktree in rebase' '
+ test_when_finished git -C wt-3 rebase --abort &&
+
+ # This will fail part-way through due to a conflict.
+ test_must_fail git -C wt-3 rebase conflict-3 &&
+
+ test_must_fail git fetch server +refs/heads/wt-3:refs/heads/wt-3 2>err &&
+ grep "refusing to fetch into branch" err
+'
+
+test_expect_success 'refuse to overwrite when in error states' '
+ test_when_finished rm -rf .git/worktrees/wt-*/rebase-merge &&
+ test_when_finished rm -rf .git/worktrees/wt-*/BISECT_* &&
+
+ # Both branches are currently under rebase.
+ mkdir -p .git/worktrees/wt-3/rebase-merge &&
+ touch .git/worktrees/wt-3/rebase-merge/interactive &&
+ echo refs/heads/fake-1 >.git/worktrees/wt-3/rebase-merge/head-name &&
+ echo refs/heads/fake-2 >.git/worktrees/wt-3/rebase-merge/onto &&
+ mkdir -p .git/worktrees/wt-4/rebase-merge &&
+ touch .git/worktrees/wt-4/rebase-merge/interactive &&
+ echo refs/heads/fake-2 >.git/worktrees/wt-4/rebase-merge/head-name &&
+ echo refs/heads/fake-1 >.git/worktrees/wt-4/rebase-merge/onto &&
+
+ # Both branches are currently under bisect.
+ touch .git/worktrees/wt-4/BISECT_LOG &&
+ echo refs/heads/fake-2 >.git/worktrees/wt-4/BISECT_START &&
+ touch .git/worktrees/wt-1/BISECT_LOG &&
+ echo refs/heads/fake-1 >.git/worktrees/wt-1/BISECT_START &&
+
+ for i in 1 2
+ do
+ test_must_fail git branch -f fake-$i HEAD 2>err &&
+ grep "cannot force update the branch '\''fake-$i'\'' used by worktree at" err ||
+ return 1
+ done
+'
+
+. "$TEST_DIRECTORY"/lib-rebase.sh
+
+test_expect_success !SANITIZE_LEAK 'refuse to overwrite during rebase with --update-refs' '
+ git commit --fixup HEAD~2 --allow-empty &&
+ (
+ set_cat_todo_editor &&
+ test_must_fail git rebase -i --update-refs HEAD~3 >todo &&
+ ! grep "update-refs" todo
+ ) &&
+ git branch -f allow-update HEAD~2 &&
+ (
+ set_cat_todo_editor &&
+ test_must_fail git rebase -i --update-refs HEAD~3 >todo &&
+ grep "update-ref refs/heads/allow-update" todo
+ )
+'
+
+# This must be the last test in this file
+test_expect_success '$EDITOR and friends are unchanged' '
+ test_editor_unchanged
+'
+
+test_done
diff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh
index e07ac6c..1ed0aa9 100755
--- a/t/t3001-ls-files-others-exclude.sh
+++ b/t/t3001-ls-files-others-exclude.sh
@@ -103,7 +103,7 @@ test_expect_success 'git ls-files --others with various exclude options.' '
test_cmp expect output
'
-test_expect_success !SANITIZE_LEAK 'restore gitignore' '
+test_expect_success 'restore gitignore' '
git checkout --ignore-skip-worktree-bits $allignores &&
rm .git/index
'
@@ -126,7 +126,7 @@ cat > expect << EOF
# three/
EOF
-test_expect_success !SANITIZE_LEAK 'git status honors core.excludesfile' \
+test_expect_success 'git status honors core.excludesfile' \
'test_cmp expect output'
test_expect_success 'trailing slash in exclude allows directory match(1)' '
diff --git a/t/t3004-ls-files-basic.sh b/t/t3004-ls-files-basic.sh
index a16e25c..12e41a7 100755
--- a/t/t3004-ls-files-basic.sh
+++ b/t/t3004-ls-files-basic.sh
@@ -21,7 +21,7 @@ test_expect_success 'ls-files with nonexistent path' '
test_expect_success 'ls-files with nonsense option' '
test_expect_code 129 git ls-files --nonsense 2>actual &&
- test_i18ngrep "[Uu]sage: git ls-files" actual
+ test_grep "[Uu]sage: git ls-files" actual
'
test_expect_success 'ls-files -h in corrupt repository' '
@@ -32,7 +32,7 @@ test_expect_success 'ls-files -h in corrupt repository' '
>.git/index &&
test_expect_code 129 git ls-files -h >usage 2>&1
) &&
- test_i18ngrep "[Uu]sage: git ls-files " broken/usage
+ test_grep "[Uu]sage: git ls-files " broken/usage
'
test_expect_success SYMLINKS 'ls-files with absolute paths to symlinks' '
diff --git a/t/t3007-ls-files-recurse-submodules.sh b/t/t3007-ls-files-recurse-submodules.sh
index dd7770e..61771ee 100755
--- a/t/t3007-ls-files-recurse-submodules.sh
+++ b/t/t3007-ls-files-recurse-submodules.sh
@@ -296,13 +296,46 @@ test_expect_success '--recurse-submodules and relative paths' '
test_expect_success '--recurse-submodules does not support --error-unmatch' '
test_must_fail git ls-files --recurse-submodules --error-unmatch 2>actual &&
- test_i18ngrep "does not support --error-unmatch" actual
+ test_grep "does not support --error-unmatch" actual
+'
+
+test_expect_success '--recurse-submodules parses submodule repo config' '
+ test_config -C submodule index.sparse "invalid non-boolean value" &&
+ test_must_fail git ls-files --recurse-submodules 2>err &&
+ grep "bad boolean config value" err
+'
+
+test_expect_success '--recurse-submodules parses submodule worktree config' '
+ test_config -C submodule extensions.worktreeConfig true &&
+ test_config -C submodule --worktree index.sparse "invalid non-boolean value" &&
+
+ test_must_fail git ls-files --recurse-submodules 2>err &&
+ grep "bad boolean config value" err
+'
+
+test_expect_success '--recurse-submodules submodules ignore super project worktreeConfig extension' '
+ # Enable worktree config in both super project & submodule, set an
+ # invalid config in the submodule worktree config
+ test_config extensions.worktreeConfig true &&
+ test_config -C submodule extensions.worktreeConfig true &&
+ test_config -C submodule --worktree index.sparse "invalid non-boolean value" &&
+
+ # Now, disable the worktree config in the submodule. Note that we need
+ # to manually re-enable extensions.worktreeConfig when the test is
+ # finished, otherwise the test_unconfig of index.sparse will not work.
+ test_unconfig -C submodule extensions.worktreeConfig &&
+ test_when_finished "git -C submodule config extensions.worktreeConfig true" &&
+
+ # With extensions.worktreeConfig disabled in the submodule, the invalid
+ # worktree config is not picked up.
+ git ls-files --recurse-submodules 2>err &&
+ ! grep "bad boolean config value" err
'
test_incompatible_with_recurse_submodules () {
test_expect_success "--recurse-submodules and $1 are incompatible" "
test_must_fail git ls-files --recurse-submodules $1 2>actual &&
- test_i18ngrep 'unsupported mode' actual
+ test_grep 'unsupported mode' actual
"
}
diff --git a/t/t3009-ls-files-others-nonsubmodule.sh b/t/t3009-ls-files-others-nonsubmodule.sh
index 963f346..14218b3 100755
--- a/t/t3009-ls-files-others-nonsubmodule.sh
+++ b/t/t3009-ls-files-others-nonsubmodule.sh
@@ -18,6 +18,7 @@ This test runs git ls-files --others with the following working tree:
git repository with a commit and an untracked file
'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup: directories' '
diff --git a/t/t3010-ls-files-killed-modified.sh b/t/t3010-ls-files-killed-modified.sh
index 580e158..0541787 100755
--- a/t/t3010-ls-files-killed-modified.sh
+++ b/t/t3010-ls-files-killed-modified.sh
@@ -41,6 +41,8 @@ Also for modification test, the cache and working tree have:
We should report path0, path1, path2/file2, path3/file3, path7 and path8
modified without reporting path9 and path10. submod1 is also modified.
'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'git update-index --add to add various paths.' '
diff --git a/t/t3012-ls-files-dedup.sh b/t/t3012-ls-files-dedup.sh
index 2682b1f..190e2f6 100755
--- a/t/t3012-ls-files-dedup.sh
+++ b/t/t3012-ls-files-dedup.sh
@@ -2,6 +2,7 @@
test_description='git ls-files --deduplicate test'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
diff --git a/t/t3013-ls-files-format.sh b/t/t3013-ls-files-format.sh
new file mode 100755
index 0000000..6e6ea0b
--- /dev/null
+++ b/t/t3013-ls-files-format.sh
@@ -0,0 +1,146 @@
+#!/bin/sh
+
+test_description='git ls-files --format test'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+for flag in -s -o -k -t --resolve-undo --deduplicate --eol
+do
+ test_expect_success "usage: --format is incompatible with $flag" '
+ test_expect_code 129 git ls-files --format="%(objectname)" $flag
+ '
+done
+
+test_expect_success 'setup' '
+ printf "LINEONE\nLINETWO\nLINETHREE\n" >o1.txt &&
+ printf "LINEONE\r\nLINETWO\r\nLINETHREE\r\n" >o2.txt &&
+ printf "LINEONE\r\nLINETWO\nLINETHREE\n" >o3.txt &&
+ git add o?.txt &&
+ oid=$(git hash-object o1.txt) &&
+ git update-index --add --cacheinfo 120000 $oid o4.txt &&
+ git update-index --add --cacheinfo 160000 $oid o5.txt &&
+ git update-index --add --cacheinfo 100755 $oid o6.txt &&
+ git commit -m base
+'
+
+test_expect_success 'git ls-files --format objectmode v.s. -s' '
+ git ls-files -s >files &&
+ cut -d" " -f1 files >expect &&
+ git ls-files --format="%(objectmode)" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'git ls-files --format objectname v.s. -s' '
+ git ls-files -s >files &&
+ cut -d" " -f2 files >expect &&
+ git ls-files --format="%(objectname)" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'git ls-files --format objecttype' '
+ git ls-files --format="%(objectname)" o1.txt o4.txt o6.txt >objectname &&
+ git cat-file --batch-check="%(objecttype)" >expect <objectname &&
+ git ls-files --format="%(objecttype)" o1.txt o4.txt o6.txt >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'git ls-files --format objectsize' '
+ cat>expect <<-\EOF &&
+26
+29
+27
+26
+-
+26
+ EOF
+ git ls-files --format="%(objectsize)" >actual &&
+
+ test_cmp expect actual
+'
+
+test_expect_success 'git ls-files --format objectsize:padded' '
+ cat>expect <<-\EOF &&
+ 26
+ 29
+ 27
+ 26
+ -
+ 26
+ EOF
+ git ls-files --format="%(objectsize:padded)" >actual &&
+
+ test_cmp expect actual
+'
+
+test_expect_success 'git ls-files --format v.s. --eol' '
+ git ls-files --eol >tmp &&
+ sed -e "s/ / /g" -e "s/ */ /g" tmp >expect 2>err &&
+ test_must_be_empty err &&
+ git ls-files --format="i/%(eolinfo:index) w/%(eolinfo:worktree) attr/%(eolattr) %(path)" >actual 2>err &&
+ test_must_be_empty err &&
+ test_cmp expect actual
+'
+
+test_expect_success 'git ls-files --format path v.s. -s' '
+ git ls-files -s >files &&
+ cut -f2 files >expect &&
+ git ls-files --format="%(path)" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'git ls-files --format with relative path' '
+ cat >expect <<-\EOF &&
+ ../o1.txt
+ ../o2.txt
+ ../o3.txt
+ ../o4.txt
+ ../o5.txt
+ ../o6.txt
+ EOF
+ mkdir sub &&
+ cd sub &&
+ git ls-files --format="%(path)" ":/" >../actual &&
+ cd .. &&
+ test_cmp expect actual
+'
+
+test_expect_success 'git ls-files --format with -m' '
+ echo change >o1.txt &&
+ cat >expect <<-\EOF &&
+ o1.txt
+ o4.txt
+ o5.txt
+ o6.txt
+ EOF
+ git ls-files --format="%(path)" -m >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'git ls-files --format with -d' '
+ echo o7 >o7.txt &&
+ git add o7.txt &&
+ rm o7.txt &&
+ cat >expect <<-\EOF &&
+ o4.txt
+ o5.txt
+ o6.txt
+ o7.txt
+ EOF
+ git ls-files --format="%(path)" -d >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'git ls-files --format v.s -s' '
+ git ls-files --stage >expect &&
+ git ls-files --format="%(objectmode) %(objectname) %(stage)%x09%(path)" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'git ls-files --format with --debug' '
+ git ls-files --debug >expect &&
+ git ls-files --format="%(path)" --debug >actual &&
+ test_cmp expect actual
+'
+
+test_done
diff --git a/t/t3050-subprojects-fetch.sh b/t/t3050-subprojects-fetch.sh
index f1f09ab..3884694 100755
--- a/t/t3050-subprojects-fetch.sh
+++ b/t/t3050-subprojects-fetch.sh
@@ -2,6 +2,7 @@
test_description='fetching and pushing project with subproject'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t3060-ls-files-with-tree.sh b/t/t3060-ls-files-with-tree.sh
index 52f76f7..5a06732 100755
--- a/t/t3060-ls-files-with-tree.sh
+++ b/t/t3060-ls-files-with-tree.sh
@@ -8,6 +8,8 @@ test_description='git ls-files test (--with-tree).
This test runs git ls-files --with-tree and in particular in
a scenario known to trigger a crash with some versions of git.
'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -38,7 +40,7 @@ test_expect_success 'setup' '
git commit -a -m "remove them all" &&
# The bug also requires some entry before our directory so that
- # prune_path will modify the_index.cache
+ # prune_index will modify the_repository->index.cache
mkdir a_directory_that_sorts_before_sub &&
>a_directory_that_sorts_before_sub/file &&
@@ -54,7 +56,7 @@ test_expect_success 'usage' '
'
test_expect_success 'git ls-files --with-tree should succeed from subdir' '
- # We have to run from a sub-directory to trigger prune_path
+ # We have to run from a sub-directory to trigger prune_index
# Then we finally get to run our --with-tree test
(
cd sub &&
diff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh
index f953996..4dd42df 100755
--- a/t/t3070-wildmatch.sh
+++ b/t/t3070-wildmatch.sh
@@ -5,11 +5,6 @@ test_description='wildmatch tests'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
-# Disable expensive chain-lint tests; all of the tests in this script
-# are variants of a few trivial test-tool invocations, and there are a lot of
-# them.
-GIT_TEST_CHAIN_LINT_HARDER_DEFAULT=0
-
should_create_test_file() {
file=$1
@@ -436,4 +431,15 @@ match 1 1 1 1 'a' '[B-a]'
match 0 1 0 1 'z' '[Z-y]'
match 1 1 1 1 'Z' '[Z-y]'
+test_expect_success 'matching does not exhibit exponential behavior' '
+ {
+ test-tool wildmatch wildmatch \
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab \
+ "*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a" &
+ pid=$!
+ } &&
+ sleep 2 &&
+ ! kill $!
+'
+
test_done
diff --git a/t/t3101-ls-tree-dirname.sh b/t/t3101-ls-tree-dirname.sh
index 217006d..5af2dac 100755
--- a/t/t3101-ls-tree-dirname.sh
+++ b/t/t3101-ls-tree-dirname.sh
@@ -154,6 +154,14 @@ EOF
test_output
'
+test_expect_success 'ls-tree --no-full-name' '
+ git -C path0 ls-tree --no-full-name $tree a >current &&
+ cat >expected <<-EOF &&
+ 040000 tree X a
+ EOF
+ test_output
+'
+
test_expect_success 'ls-tree --full-tree' '
(
cd path1/b/c &&
diff --git a/t/t3104-ls-tree-format.sh b/t/t3104-ls-tree-format.sh
index 3838966..3adb206 100755
--- a/t/t3104-ls-tree-format.sh
+++ b/t/t3104-ls-tree-format.sh
@@ -20,7 +20,6 @@ test_ls_tree_format () {
format=$1 &&
opts=$2 &&
fmtopts=$3 &&
- shift 2 &&
test_expect_success "ls-tree '--format=<$format>' is like options '$opts $fmtopts'" '
git ls-tree $opts -r HEAD >expect &&
@@ -36,6 +35,12 @@ test_ls_tree_format () {
'
}
+test_expect_success "ls-tree --format='%(path) %(path) %(path)' HEAD top-file" '
+ git ls-tree --format="%(path) %(path) %(path)" HEAD top-file.t >actual &&
+ echo top-file.t top-file.t top-file.t >expect &&
+ test_cmp expect actual
+'
+
test_ls_tree_format \
"%(objectmode) %(objecttype) %(objectname)%x09%(path)" \
""
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 9723c28..ccfa6a7 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -8,6 +8,7 @@ test_description='git branch assorted tests'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-rebase.sh
@@ -24,10 +25,10 @@ test_expect_success 'prepare a trivial repository' '
test_expect_success 'git branch --help should not have created a bogus branch' '
test_might_fail git branch --man --help </dev/null >/dev/null 2>&1 &&
- test_path_is_missing .git/refs/heads/--help
+ test_ref_missing refs/heads/--help
'
-test_expect_success 'branch -h in broken repository' '
+test_expect_success REFFILES 'branch -h in broken repository' '
mkdir broken &&
(
cd broken &&
@@ -35,11 +36,12 @@ test_expect_success 'branch -h in broken repository' '
>.git/refs/heads/main &&
test_expect_code 129 git branch -h >usage 2>&1
) &&
- test_i18ngrep "[Uu]sage" broken/usage
+ test_grep "[Uu]sage" broken/usage
'
test_expect_success 'git branch abc should create a branch' '
- git branch abc && test_path_is_file .git/refs/heads/abc
+ git branch abc &&
+ test_ref_exists refs/heads/abc
'
test_expect_success 'git branch abc should fail when abc exists' '
@@ -60,31 +62,33 @@ test_expect_success 'git branch --force abc should succeed when abc exists' '
'
test_expect_success 'git branch a/b/c should create a branch' '
- git branch a/b/c && test_path_is_file .git/refs/heads/a/b/c
+ git branch a/b/c &&
+ test_ref_exists refs/heads/a/b/c
'
test_expect_success 'git branch mb main... should create a branch' '
- git branch mb main... && test_path_is_file .git/refs/heads/mb
+ git branch mb main... &&
+ test_ref_exists refs/heads/mb
'
test_expect_success 'git branch HEAD should fail' '
test_must_fail git branch HEAD
'
-cat >expect <<EOF
-$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 branch: Created from main
-EOF
test_expect_success 'git branch --create-reflog d/e/f should create a branch and a log' '
GIT_COMMITTER_DATE="2005-05-26 23:30" \
git -c core.logallrefupdates=false branch --create-reflog d/e/f &&
- test_path_is_file .git/refs/heads/d/e/f &&
- test_path_is_file .git/logs/refs/heads/d/e/f &&
- test_cmp expect .git/logs/refs/heads/d/e/f
+ test_ref_exists refs/heads/d/e/f &&
+ cat >expect <<-EOF &&
+ $HEAD refs/heads/d/e/f@{0}: branch: Created from main
+ EOF
+ git reflog show --no-abbrev-commit refs/heads/d/e/f >actual &&
+ test_cmp expect actual
'
test_expect_success 'git branch -d d/e/f should delete a branch and a log' '
git branch -d d/e/f &&
- test_path_is_missing .git/refs/heads/d/e/f &&
+ test_ref_missing refs/heads/d/e/f &&
test_must_fail git reflog exists refs/heads/d/e/f
'
@@ -102,7 +106,7 @@ test_expect_success 'git branch l should work after branch l/m has been deleted'
test_expect_success 'git branch -m dumps usage' '
test_expect_code 128 git branch -m 2>err &&
- test_i18ngrep "branch name required" err
+ test_grep "branch name required" err
'
test_expect_success 'git branch -m m broken_symref should work' '
@@ -199,10 +203,9 @@ test_expect_success 'git branch -M baz bam should succeed when baz is checked ou
test $(git rev-parse --abbrev-ref HEAD) = bam
'
-test_expect_success 'git branch -M baz bam should add entries to .git/logs/HEAD' '
- msg="Branch: renamed refs/heads/baz to refs/heads/bam" &&
- grep " 0\{40\}.*$msg$" .git/logs/HEAD &&
- grep "^0\{40\}.*$msg$" .git/logs/HEAD
+test_expect_success 'git branch -M baz bam should add entries to HEAD reflog' '
+ git reflog show HEAD >actual &&
+ grep "HEAD@{0}: Branch: renamed refs/heads/baz to refs/heads/bam" actual
'
test_expect_success 'git branch -M should leave orphaned HEAD alone' '
@@ -211,17 +214,20 @@ test_expect_success 'git branch -M should leave orphaned HEAD alone' '
cd orphan &&
test_commit initial &&
git checkout --orphan lonely &&
- grep lonely .git/HEAD &&
- test_path_is_missing .git/refs/head/lonely &&
+ git symbolic-ref HEAD >expect &&
+ echo refs/heads/lonely >actual &&
+ test_cmp expect actual &&
+ test_ref_missing refs/head/lonely &&
git branch -M main mistress &&
- grep lonely .git/HEAD
+ git symbolic-ref HEAD >expect &&
+ test_cmp expect actual
)
'
test_expect_success 'resulting reflog can be shown by log -g' '
oid=$(git rev-parse HEAD) &&
cat >expect <<-EOF &&
- HEAD@{0} $oid $msg
+ HEAD@{0} $oid Branch: renamed refs/heads/baz to refs/heads/bam
HEAD@{2} $oid checkout: moving from foo to baz
EOF
git log -g --format="%gd %H %gs" -2 HEAD >actual &&
@@ -239,15 +245,34 @@ test_expect_success 'git branch -M baz bam should succeed when baz is checked ou
git worktree prune
'
+test_expect_success REFFILES 'git branch -M fails if updating any linked working tree fails' '
+ git worktree add -b baz bazdir1 &&
+ git worktree add -f bazdir2 baz &&
+ touch .git/worktrees/bazdir1/HEAD.lock &&
+ test_must_fail git branch -M baz bam &&
+ test $(git -C bazdir2 rev-parse --abbrev-ref HEAD) = bam &&
+ git branch -M bam baz &&
+ rm .git/worktrees/bazdir1/HEAD.lock &&
+ touch .git/worktrees/bazdir2/HEAD.lock &&
+ test_must_fail git branch -M baz bam &&
+ test $(git -C bazdir1 rev-parse --abbrev-ref HEAD) = bam &&
+ rm -rf bazdir1 bazdir2 &&
+ git worktree prune
+'
+
test_expect_success 'git branch -M baz bam should succeed within a worktree in which baz is checked out' '
git checkout -b baz &&
git worktree add -f bazdir baz &&
(
cd bazdir &&
git branch -M baz bam &&
- test $(git rev-parse --abbrev-ref HEAD) = bam
+ echo bam >expect &&
+ git rev-parse --abbrev-ref HEAD >actual &&
+ test_cmp expect actual
) &&
- test $(git rev-parse --abbrev-ref HEAD) = bam &&
+ echo bam >expect &&
+ git rev-parse --abbrev-ref HEAD >actual &&
+ test_cmp expect actual &&
rm -r bazdir &&
git worktree prune
'
@@ -268,6 +293,67 @@ test_expect_success 'git branch -M topic topic should work when main is checked
git branch -M topic topic
'
+test_expect_success 'git branch -M and -C fail on detached HEAD' '
+ git checkout HEAD^{} &&
+ test_when_finished git checkout - &&
+ echo "fatal: cannot rename the current branch while not on any" >expect &&
+ test_must_fail git branch -M must-fail 2>err &&
+ test_cmp expect err &&
+ echo "fatal: cannot copy the current branch while not on any" >expect &&
+ test_must_fail git branch -C must-fail 2>err &&
+ test_cmp expect err
+'
+
+test_expect_success 'git branch -m should work with orphan branches' '
+ test_when_finished git checkout - &&
+ test_when_finished git worktree remove -f wt &&
+ git worktree add wt --detach &&
+ # rename orphan in another worktreee
+ git -C wt checkout --orphan orphan-foo-wt &&
+ git branch -m orphan-foo-wt orphan-bar-wt &&
+ test orphan-bar-wt=$(git -C orphan-worktree branch --show-current) &&
+ # rename orphan in the current worktree
+ git checkout --orphan orphan-foo &&
+ git branch -m orphan-foo orphan-bar &&
+ test orphan-bar=$(git branch --show-current)
+'
+
+test_expect_success 'git branch -d on orphan HEAD (merged)' '
+ test_when_finished git checkout main &&
+ git checkout --orphan orphan &&
+ test_when_finished "rm -rf .git/objects/commit-graph*" &&
+ git commit-graph write --reachable &&
+ git branch --track to-delete main &&
+ git branch -d to-delete
+'
+
+test_expect_success 'git branch -d on orphan HEAD (merged, graph)' '
+ test_when_finished git checkout main &&
+ git checkout --orphan orphan &&
+ git branch --track to-delete main &&
+ git branch -d to-delete
+'
+
+test_expect_success 'git branch -d on orphan HEAD (unmerged)' '
+ test_when_finished git checkout main &&
+ git checkout --orphan orphan &&
+ test_when_finished "git branch -D to-delete" &&
+ git branch to-delete main &&
+ test_must_fail git branch -d to-delete 2>err &&
+ grep "not fully merged" err
+'
+
+test_expect_success 'git branch -d on orphan HEAD (unmerged, graph)' '
+ test_when_finished git checkout main &&
+ git checkout --orphan orphan &&
+ test_when_finished "git branch -D to-delete" &&
+ git branch to-delete main &&
+ test_when_finished "rm -rf .git/objects/commit-graph*" &&
+ git commit-graph write --reachable &&
+ test_must_fail git branch -d to-delete 2>err &&
+ grep "not fully merged" err
+'
+
test_expect_success 'git branch -v -d t should work' '
git branch t &&
git rev-parse --verify refs/heads/t &&
@@ -306,6 +392,7 @@ test_expect_success 'deleting checked-out branch from repo that is a submodule'
git init repo1 &&
git init repo1/sub &&
test_commit -C repo1/sub x &&
+ test_config_global protocol.file.allow always &&
git -C repo1 submodule add ./sub &&
git -C repo1 commit -m "adding sub" &&
@@ -353,10 +440,10 @@ test_expect_success 'git branch --list -v with --abbrev' '
test_expect_success 'git branch --column' '
COLUMNS=81 git branch --column=column >actual &&
- cat >expect <<\EOF &&
- a/b/c bam foo l * main n o/p r
- abc bar j/k m/m mb o/o q topic
-EOF
+ cat >expect <<-\EOF &&
+ a/b/c bam foo l * main n o/p r
+ abc bar j/k m/m mb o/o q topic
+ EOF
test_cmp expect actual
'
@@ -366,25 +453,25 @@ test_expect_success 'git branch --column with an extremely long branch name' '
test_when_finished "git branch -d $long" &&
git branch $long &&
COLUMNS=80 git branch --column=column >actual &&
- cat >expect <<EOF &&
- a/b/c
- abc
- bam
- bar
- foo
- j/k
- l
- m/m
-* main
- mb
- n
- o/o
- o/p
- q
- r
- topic
- $long
-EOF
+ cat >expect <<-EOF &&
+ a/b/c
+ abc
+ bam
+ bar
+ foo
+ j/k
+ l
+ m/m
+ * main
+ mb
+ n
+ o/o
+ o/p
+ q
+ r
+ topic
+ $long
+ EOF
test_cmp expect actual
'
@@ -394,10 +481,10 @@ test_expect_success 'git branch with column.*' '
COLUMNS=80 git branch >actual &&
git config --unset column.branch &&
git config --unset column.ui &&
- cat >expect <<\EOF &&
- a/b/c bam foo l * main n o/p r
- abc bar j/k m/m mb o/o q topic
-EOF
+ cat >expect <<-\EOF &&
+ a/b/c bam foo l * main n o/p r
+ abc bar j/k m/m mb o/o q topic
+ EOF
test_cmp expect actual
'
@@ -409,39 +496,36 @@ test_expect_success 'git branch -v with column.ui ignored' '
git config column.ui column &&
COLUMNS=80 git branch -v | cut -c -8 | sed "s/ *$//" >actual &&
git config --unset column.ui &&
- cat >expect <<\EOF &&
- a/b/c
- abc
- bam
- bar
- foo
- j/k
- l
- m/m
-* main
- mb
- n
- o/o
- o/p
- q
- r
- topic
-EOF
+ cat >expect <<-\EOF &&
+ a/b/c
+ abc
+ bam
+ bar
+ foo
+ j/k
+ l
+ m/m
+ * main
+ mb
+ n
+ o/o
+ o/p
+ q
+ r
+ topic
+ EOF
test_cmp expect actual
'
-mv .git/config .git/config-saved
-
-test_expect_success SHA1 'git branch -m q q2 without config should succeed' '
+test_expect_success DEFAULT_REPO_FORMAT 'git branch -m q q2 without config should succeed' '
+ test_when_finished mv .git/config-saved .git/config &&
+ mv .git/config .git/config-saved &&
git branch -m q q2 &&
git branch -m q2 q
'
-mv .git/config-saved .git/config
-
-git config branch.s/s.dummy Hello
-
test_expect_success 'git branch -m s/s s should work when s/t is deleted' '
+ git config branch.s/s.dummy Hello &&
git branch --create-reflog s/s &&
git reflog exists refs/heads/s/s &&
git branch --create-reflog s/t &&
@@ -492,19 +576,19 @@ EOF
# ...and that the comments for those sections are also
# preserved.
- cat config.branch | sed "s/\"source\"/\"dest\"/" >expect &&
+ sed "s/\"source\"/\"dest\"/" config.branch >expect &&
sed -n -e "/Note the lack/,\$p" .git/config >actual &&
test_cmp expect actual
'
test_expect_success 'git branch -c dumps usage' '
test_expect_code 128 git branch -c 2>err &&
- test_i18ngrep "branch name required" err
+ test_grep "branch name required" err
'
test_expect_success 'git branch --copy dumps usage' '
test_expect_code 128 git branch --copy 2>err &&
- test_i18ngrep "branch name required" err
+ test_grep "branch name required" err
'
test_expect_success 'git branch -c d e should work' '
@@ -614,7 +698,8 @@ test_expect_success 'git branch -C c1 c2 should succeed when c1 is checked out'
test_expect_success 'git branch -C c1 c2 should never touch HEAD' '
msg="Branch: copied refs/heads/c1 to refs/heads/c2" &&
- ! grep "$msg$" .git/logs/HEAD
+ git reflog HEAD >actual &&
+ ! grep "$msg$" actual
'
test_expect_success 'git branch -C main should work when main is checked out' '
@@ -717,26 +802,26 @@ test_expect_success 'deleting a symref' '
git symbolic-ref refs/heads/symref refs/heads/target &&
echo "Deleted branch symref (was refs/heads/target)." >expect &&
git branch -d symref >actual &&
- test_path_is_file .git/refs/heads/target &&
- test_path_is_missing .git/refs/heads/symref &&
+ test_ref_exists refs/heads/target &&
+ test_ref_missing refs/heads/symref &&
test_cmp expect actual
'
test_expect_success 'deleting a dangling symref' '
git symbolic-ref refs/heads/dangling-symref nowhere &&
- test_path_is_file .git/refs/heads/dangling-symref &&
+ git symbolic-ref --no-recurse refs/heads/dangling-symref &&
echo "Deleted branch dangling-symref (was nowhere)." >expect &&
git branch -d dangling-symref >actual &&
- test_path_is_missing .git/refs/heads/dangling-symref &&
+ test_ref_missing refs/heads/dangling-symref &&
test_cmp expect actual
'
test_expect_success 'deleting a self-referential symref' '
git symbolic-ref refs/heads/self-reference refs/heads/self-reference &&
- test_path_is_file .git/refs/heads/self-reference &&
+ test_ref_exists refs/heads/self-reference &&
echo "Deleted branch self-reference (was refs/heads/self-reference)." >expect &&
git branch -d self-reference >actual &&
- test_path_is_missing .git/refs/heads/self-reference &&
+ test_ref_missing refs/heads/self-reference &&
test_cmp expect actual
'
@@ -744,37 +829,8 @@ test_expect_success 'renaming a symref is not allowed' '
git symbolic-ref refs/heads/topic refs/heads/main &&
test_must_fail git branch -m topic new-topic &&
git symbolic-ref refs/heads/topic &&
- test_path_is_file .git/refs/heads/main &&
- test_path_is_missing .git/refs/heads/new-topic
-'
-
-test_expect_success SYMLINKS 'git branch -m u v should fail when the reflog for u is a symlink' '
- git branch --create-reflog u &&
- mv .git/logs/refs/heads/u real-u &&
- ln -s real-u .git/logs/refs/heads/u &&
- test_must_fail git branch -m u v
-'
-
-test_expect_success SYMLINKS 'git branch -m with symlinked .git/refs' '
- test_when_finished "rm -rf subdir" &&
- git init --bare subdir &&
-
- rm -rfv subdir/refs subdir/objects subdir/packed-refs &&
- ln -s ../.git/refs subdir/refs &&
- ln -s ../.git/objects subdir/objects &&
- ln -s ../.git/packed-refs subdir/packed-refs &&
-
- git -C subdir rev-parse --absolute-git-dir >subdir.dir &&
- git rev-parse --absolute-git-dir >our.dir &&
- ! test_cmp subdir.dir our.dir &&
-
- git -C subdir log &&
- git -C subdir branch rename-src &&
- git rev-parse rename-src >expect &&
- git -C subdir branch -m rename-src rename-dest &&
- git rev-parse rename-dest >actual &&
- test_cmp expect actual &&
- git branch -D rename-dest
+ test_ref_exists refs/heads/main &&
+ test_ref_missing refs/heads/new-topic
'
test_expect_success 'test tracking setup via --track' '
@@ -860,7 +916,19 @@ test_expect_success 'test deleting branch without config' '
test_expect_success 'deleting currently checked out branch fails' '
git worktree add -b my7 my7 &&
test_must_fail git -C my7 branch -d my7 &&
- test_must_fail git branch -d my7 &&
+ test_must_fail git branch -d my7 2>actual &&
+ grep "^error: cannot delete branch .my7. used by worktree at " actual &&
+ rm -r my7 &&
+ git worktree prune
+'
+
+test_expect_success 'deleting in-use branch fails' '
+ git worktree add my7 &&
+ test_commit -C my7 bt7 &&
+ git -C my7 bisect start HEAD HEAD~2 &&
+ test_must_fail git -C my7 branch -d my7 &&
+ test_must_fail git branch -d my7 2>actual &&
+ grep "^error: cannot delete branch .my7. used by worktree at " actual &&
rm -r my7 &&
git worktree prune
'
@@ -930,7 +998,7 @@ test_expect_success '--set-upstream-to fails on multiple branches' '
test_expect_success '--set-upstream-to fails on detached HEAD' '
git checkout HEAD^{} &&
test_when_finished git checkout - &&
- echo "fatal: could not set upstream of HEAD to main when it does not point to any branch." >expect &&
+ echo "fatal: could not set upstream of HEAD to main when it does not point to any branch" >expect &&
test_must_fail git branch --set-upstream-to main 2>err &&
test_cmp expect err
'
@@ -943,7 +1011,7 @@ test_expect_success '--set-upstream-to fails on a missing dst branch' '
test_expect_success '--set-upstream-to fails on a missing src branch' '
test_must_fail git branch --set-upstream-to does-not-exist main 2>err &&
- test_i18ngrep "the requested upstream branch '"'"'does-not-exist'"'"' does not exist" err
+ test_grep "the requested upstream branch '"'"'does-not-exist'"'"' does not exist" err
'
test_expect_success '--set-upstream-to fails on a non-ref' '
@@ -957,7 +1025,7 @@ test_expect_success '--set-upstream-to fails on locked config' '
>.git/config.lock &&
git branch locked &&
test_must_fail git branch --set-upstream-to locked 2>err &&
- test_i18ngrep "could not lock config file .git/config" err
+ test_grep "could not lock config file .git/config" err
'
test_expect_success 'use --set-upstream-to modify HEAD' '
@@ -978,7 +1046,7 @@ test_expect_success 'use --set-upstream-to modify a particular branch' '
'
test_expect_success '--unset-upstream should fail if given a non-existent branch' '
- echo "fatal: Branch '"'"'i-dont-exist'"'"' has no upstream information" >expect &&
+ echo "fatal: branch '"'"'i-dont-exist'"'"' has no upstream information" >expect &&
test_must_fail git branch --unset-upstream i-dont-exist 2>err &&
test_cmp expect err
'
@@ -988,7 +1056,7 @@ test_expect_success '--unset-upstream should fail if config is locked' '
git branch --set-upstream-to locked &&
>.git/config.lock &&
test_must_fail git branch --unset-upstream 2>err &&
- test_i18ngrep "could not lock config file .git/config" err
+ test_grep "could not lock config file .git/config" err
'
test_expect_success 'test --unset-upstream on HEAD' '
@@ -1000,7 +1068,7 @@ test_expect_success 'test --unset-upstream on HEAD' '
test_must_fail git config branch.main.remote &&
test_must_fail git config branch.main.merge &&
# fail for a branch without upstream set
- echo "fatal: Branch '"'"'main'"'"' has no upstream information" >expect &&
+ echo "fatal: branch '"'"'main'"'"' has no upstream information" >expect &&
test_must_fail git branch --unset-upstream 2>err &&
test_cmp expect err
'
@@ -1014,7 +1082,7 @@ test_expect_success '--unset-upstream should fail on multiple branches' '
test_expect_success '--unset-upstream should fail on detached HEAD' '
git checkout HEAD^{} &&
test_when_finished git checkout - &&
- echo "fatal: could not unset upstream of HEAD when it does not point to any branch." >expect &&
+ echo "fatal: could not unset upstream of HEAD when it does not point to any branch" >expect &&
test_must_fail git branch --unset-upstream 2>err &&
test_cmp expect err
'
@@ -1041,16 +1109,16 @@ test_expect_success '--set-upstream-to notices an error to set branch as own ups
test_cmp expect actual
"
-# Keep this test last, as it changes the current branch
-cat >expect <<EOF
-$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 branch: Created from main
-EOF
test_expect_success 'git checkout -b g/h/i -l should create a branch and a log' '
+ test_when_finished git checkout main &&
GIT_COMMITTER_DATE="2005-05-26 23:30" \
git checkout -b g/h/i -l main &&
- test_path_is_file .git/refs/heads/g/h/i &&
- test_path_is_file .git/logs/refs/heads/g/h/i &&
- test_cmp expect .git/logs/refs/heads/g/h/i
+ test_ref_exists refs/heads/g/h/i &&
+ cat >expect <<-EOF &&
+ $HEAD refs/heads/g/h/i@{0}: branch: Created from main
+ EOF
+ git reflog show --no-abbrev-commit refs/heads/g/h/i >actual &&
+ test_cmp expect actual
'
test_expect_success 'checkout -b makes reflog by default' '
@@ -1086,9 +1154,9 @@ test_expect_success 'avoid ambiguous track and advise' '
hint: tracking ref '\''refs/heads/main'\'':
hint: ambi1
hint: ambi2
- hint: ''
+ hint:
hint: This is typically a configuration error.
- hint: ''
+ hint:
hint: To support setting up tracking branches, ensure that
hint: different remotes'\'' fetch refspecs map into different
hint: tracking namespaces.
@@ -1381,6 +1449,9 @@ test_expect_success 'branch --delete --force removes dangling branch' '
'
test_expect_success 'use --edit-description' '
+ EDITOR=: git branch --edit-description &&
+ test_expect_code 1 git config branch.main.description &&
+
write_script editor <<-\EOF &&
echo "New contents" >"$1"
EOF
@@ -1421,7 +1492,7 @@ test_expect_success '--list during rebase' '
set_fake_editor &&
git rebase -i HEAD~2 &&
git branch --list >actual &&
- test_i18ngrep "rebasing main" actual
+ test_grep "rebasing main" actual
'
test_expect_success '--list during rebase from detached HEAD' '
@@ -1433,7 +1504,7 @@ test_expect_success '--list during rebase from detached HEAD' '
set_fake_editor &&
git rebase -i HEAD~2 &&
git branch --list >actual &&
- test_i18ngrep "rebasing detached HEAD $oid" actual
+ test_grep "rebasing detached HEAD $oid" actual
'
test_expect_success 'tracking with unexpected .fetch refspec' '
@@ -1473,9 +1544,10 @@ test_expect_success 'tracking with unexpected .fetch refspec' '
test_expect_success 'configured committerdate sort' '
git init -b main sort &&
+ test_config -C sort branch.sort "committerdate" &&
+
(
cd sort &&
- git config branch.sort committerdate &&
test_commit initial &&
git checkout -b a &&
test_commit a &&
@@ -1495,9 +1567,10 @@ test_expect_success 'configured committerdate sort' '
'
test_expect_success 'option override configured sort' '
+ test_config -C sort branch.sort "committerdate" &&
+
(
cd sort &&
- git config branch.sort committerdate &&
git branch --sort=refname >actual &&
cat >expect <<-\EOF &&
a
@@ -1509,10 +1582,70 @@ test_expect_success 'option override configured sort' '
)
'
+test_expect_success '--no-sort cancels config sort keys' '
+ test_config -C sort branch.sort "-refname" &&
+
+ (
+ cd sort &&
+
+ # objecttype is identical for all of them, so sort falls back on
+ # default (ascending refname)
+ git branch \
+ --no-sort \
+ --sort="objecttype" >actual &&
+ cat >expect <<-\EOF &&
+ a
+ * b
+ c
+ main
+ EOF
+ test_cmp expect actual
+ )
+
+'
+
+test_expect_success '--no-sort cancels command line sort keys' '
+ (
+ cd sort &&
+
+ # objecttype is identical for all of them, so sort falls back on
+ # default (ascending refname)
+ git branch \
+ --sort="-refname" \
+ --no-sort \
+ --sort="objecttype" >actual &&
+ cat >expect <<-\EOF &&
+ a
+ * b
+ c
+ main
+ EOF
+ test_cmp expect actual
+ )
+'
+
+test_expect_success '--no-sort without subsequent --sort prints expected branches' '
+ (
+ cd sort &&
+
+ # Sort the results with `sort` for a consistent comparison
+ # against expected
+ git branch --no-sort | sort >actual &&
+ cat >expect <<-\EOF &&
+ a
+ c
+ main
+ * b
+ EOF
+ test_cmp expect actual
+ )
+'
+
test_expect_success 'invalid sort parameter in configuration' '
+ test_config -C sort branch.sort "v:notvalid" &&
+
(
cd sort &&
- git config branch.sort "v:notvalid" &&
# this works in the "listing" mode, so bad sort key
# is a dying offence.
@@ -1560,4 +1693,14 @@ test_expect_success '--track overrides branch.autoSetupMerge' '
test_cmp_config "" --default "" branch.foo5.merge
'
+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"
+ EOF
+ test_must_fail git branch foo..bar >actual 2>&1 &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t3202-show-branch.sh b/t/t3202-show-branch.sh
index f2b9199..a1139f7 100755
--- a/t/t3202-show-branch.sh
+++ b/t/t3202-show-branch.sh
@@ -4,8 +4,27 @@ test_description='test show-branch'
. ./test-lib.sh
-# arbitrary reference time: 2009-08-30 19:20:00
-GIT_TEST_DATE_NOW=1251660000; export GIT_TEST_DATE_NOW
+test_expect_success 'error descriptions on empty repository' '
+ current=$(git branch --show-current) &&
+ cat >expect <<-EOF &&
+ error: no commit on branch '\''$current'\'' yet
+ EOF
+ test_must_fail git branch --edit-description 2>actual &&
+ test_cmp expect actual &&
+ test_must_fail git branch --edit-description $current 2>actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'fatal descriptions on empty repository' '
+ current=$(git branch --show-current) &&
+ cat >expect <<-EOF &&
+ fatal: no commit on branch '\''$current'\'' yet
+ EOF
+ test_must_fail git branch --set-upstream-to=non-existent 2>actual &&
+ test_cmp expect actual &&
+ test_must_fail git branch -c new-branch 2>actual &&
+ test_cmp expect actual
+'
test_expect_success 'setup' '
test_commit initial &&
@@ -97,6 +116,22 @@ test_expect_success 'show branch --remotes' '
test_must_be_empty actual.out
'
+test_expect_success 'show-branch --sparse' '
+ test_when_finished "git checkout branch10 && git branch -D branchA" &&
+ git checkout -b branchA branch10 &&
+ git merge -s ours -m "merge 1 and 10 to make A" branch1 &&
+ git commit --allow-empty -m "another" &&
+
+ git show-branch --sparse >out &&
+ grep "merge 1 and 10 to make A" out &&
+
+ git show-branch >out &&
+ ! grep "merge 1 and 10 to make A" out &&
+
+ git show-branch --no-sparse >out &&
+ ! grep "merge 1 and 10 to make A" out
+'
+
test_expect_success 'setup show branch --list' '
sed "s/^> //" >expect <<-\EOF
> [branch1] branch1
@@ -149,18 +184,6 @@ test_expect_success 'show branch --merge-base with N arguments' '
test_cmp expect actual
'
-test_expect_success 'show branch --reflog=2' '
- sed "s/^> //" >expect <<-\EOF &&
- > ! [refs/heads/branch10@{0}] (4 years, 5 months ago) commit: branch10
- > ! [refs/heads/branch10@{1}] (4 years, 5 months ago) commit: branch10
- > --
- > + [refs/heads/branch10@{0}] branch10
- > ++ [refs/heads/branch10@{1}] initial
- EOF
- git show-branch --reflog=2 >actual &&
- test_cmp actual expect
-'
-
# incompatible options
while read combo
do
@@ -175,4 +198,89 @@ done <<\EOF
--reflog --current
EOF
+# unnegatable options
+for opt in topo-order date-order reflog
+do
+ test_expect_success "show-branch --no-$opt (should fail)" '
+ test_must_fail git show-branch --no-$opt 2>err &&
+ grep "unknown option .no-$opt." err
+ '
+done
+
+test_expect_success 'error descriptions on non-existent branch' '
+ cat >expect <<-EOF &&
+ error: no branch named '\''non-existent'\''
+ EOF
+ test_must_fail git branch --edit-description non-existent 2>actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'fatal descriptions on non-existent branch' '
+ cat >expect <<-EOF &&
+ fatal: branch '\''non-existent'\'' does not exist
+ EOF
+ test_must_fail git branch --set-upstream-to=non-existent non-existent 2>actual &&
+ test_cmp expect actual &&
+
+ cat >expect <<-EOF &&
+ fatal: no branch named '\''non-existent'\''
+ EOF
+ test_must_fail git branch -c non-existent new-branch 2>actual &&
+ test_cmp expect actual &&
+ test_must_fail git branch -m non-existent new-branch 2>actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'error descriptions on orphan branch' '
+ test_when_finished git worktree remove -f wt &&
+ git worktree add wt --detach &&
+ git -C wt checkout --orphan orphan-branch &&
+ test_branch_op_in_wt() {
+ test_orphan_error() {
+ test_must_fail git $* 2>actual &&
+ test_grep "no commit on branch .orphan-branch. yet$" actual
+ } &&
+ test_orphan_error -C wt branch $1 $2 && # implicit branch
+ test_orphan_error -C wt branch $1 orphan-branch $2 && # explicit branch
+ test_orphan_error branch $1 orphan-branch $2 # different worktree
+ } &&
+ test_branch_op_in_wt --edit-description &&
+ test_branch_op_in_wt --set-upstream-to=ne &&
+ test_branch_op_in_wt -c new-branch
+'
+
+test_expect_success 'setup reflogs' '
+ test_commit base &&
+ git checkout -b branch &&
+ test_commit one &&
+ git reset --hard HEAD^ &&
+ test_commit two &&
+ test_commit three
+'
+
+test_expect_success '--reflog shows reflog entries' '
+ cat >expect <<-\EOF &&
+ ! [branch@{0}] (0 seconds ago) commit: three
+ ! [branch@{1}] (60 seconds ago) commit: two
+ ! [branch@{2}] (2 minutes ago) reset: moving to HEAD^
+ ! [branch@{3}] (2 minutes ago) commit: one
+ ----
+ + [branch@{0}] three
+ ++ [branch@{1}] two
+ + [branch@{3}] one
+ ++++ [branch@{2}] base
+ EOF
+ # the output always contains relative timestamps; use
+ # a known time to get deterministic results
+ GIT_TEST_DATE_NOW=$test_tick \
+ git show-branch --reflog branch >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success '--reflog handles missing reflog' '
+ git reflog expire --expire=now branch &&
+ git show-branch --reflog branch >actual &&
+ test_must_be_empty actual
+'
+
test_done
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index d34d77f..758963b 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -55,9 +55,17 @@ cat >expect <<'EOF'
EOF
test_expect_success 'git branch -r shows remote branches' '
git branch -r >actual &&
+ test_cmp expect actual &&
+
+ git branch --remotes >actual &&
test_cmp expect actual
'
+test_expect_success 'git branch --no-remotes is rejected' '
+ test_must_fail git branch --no-remotes 2>err &&
+ grep "unknown option .no-remotes." err
+'
+
cat >expect <<'EOF'
branch-one
branch-two
@@ -68,9 +76,17 @@ cat >expect <<'EOF'
EOF
test_expect_success 'git branch -a shows local and remote branches' '
git branch -a >actual &&
+ test_cmp expect actual &&
+
+ git branch --all >actual &&
test_cmp expect actual
'
+test_expect_success 'git branch --no-all is rejected' '
+ test_must_fail git branch --no-all 2>err &&
+ grep "unknown option .no-all." err
+'
+
cat >expect <<'EOF'
two
one
@@ -337,10 +353,48 @@ test_expect_success 'git branch --format option' '
test_cmp expect actual
'
+test_expect_success 'git branch --format with ahead-behind' '
+ cat >expect <<-\EOF &&
+ (HEAD detached from fromtag) 0 0
+ refs/heads/ambiguous 0 0
+ refs/heads/branch-one 1 0
+ refs/heads/branch-two 0 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)" >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'git branch with --format=%(rest) must fail' '
test_must_fail git branch --format="%(rest)" >actual
'
+test_expect_success 'git branch --format --omit-empty' '
+ cat >expect <<-\EOF &&
+ Refname is (HEAD detached from fromtag)
+ Refname is refs/heads/ambiguous
+ Refname is refs/heads/branch-one
+ Refname is refs/heads/branch-two
+
+ Refname is refs/heads/ref-to-branch
+ Refname is refs/heads/ref-to-remote
+ EOF
+ git branch --format="%(if:notequals=refs/heads/main)%(refname)%(then)Refname is %(refname)%(end)" >actual &&
+ test_cmp expect actual &&
+ cat >expect <<-\EOF &&
+ Refname is (HEAD detached from fromtag)
+ Refname is refs/heads/ambiguous
+ Refname is refs/heads/branch-one
+ Refname is refs/heads/branch-two
+ Refname is refs/heads/ref-to-branch
+ Refname is refs/heads/ref-to-remote
+ EOF
+ git branch --omit-empty --format="%(if:notequals=refs/heads/main)%(refname)%(then)Refname is %(refname)%(end)" >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'worktree colors correct' '
cat >expect <<-EOF &&
* <GREEN>(HEAD detached from fromtag)<RESET>
diff --git a/t/t3204-branch-name-interpretation.sh b/t/t3204-branch-name-interpretation.sh
index 993a6b5..594e3e4 100755
--- a/t/t3204-branch-name-interpretation.sh
+++ b/t/t3204-branch-name-interpretation.sh
@@ -9,6 +9,7 @@ This script aims to check the behavior of those corner cases.
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
expect_branch() {
@@ -57,6 +58,16 @@ test_expect_success 'create branch with pseudo-qualified name' '
expect_branch refs/heads/refs/heads/qualified two
'
+test_expect_success 'force-copy a branch to itself via @{-1} is no-op' '
+ git branch -t copiable main &&
+ git checkout copiable &&
+ git checkout - &&
+ git branch -C @{-1} copiable &&
+ git config --get-all branch.copiable.merge >actual &&
+ echo refs/heads/main >expect &&
+ test_cmp expect actual
+'
+
test_expect_success 'delete branch via @{-1}' '
git branch previous-del &&
@@ -133,4 +144,28 @@ test_expect_success 'checkout does not treat remote @{upstream} as a branch' '
expect_branch HEAD one
'
+test_expect_success 'edit-description via @{-1}' '
+ git checkout -b desc-branch &&
+ git checkout -b non-desc-branch &&
+ write_script editor <<-\EOF &&
+ echo "Branch description" >"$1"
+ EOF
+ EDITOR=./editor git branch --edit-description @{-1} &&
+ test_must_fail git config branch.non-desc-branch.description &&
+ git config branch.desc-branch.description >actual &&
+ printf "Branch description\n\n" >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'modify branch upstream via "@{-1}" and "@{-1}@{upstream}"' '
+ git checkout -b upstream-branch &&
+ git checkout -b upstream-other -t upstream-branch &&
+ git branch --set-upstream-to upstream-other @{-1} &&
+ git config branch.upstream-branch.merge >actual &&
+ echo "refs/heads/upstream-other" >expect &&
+ test_cmp expect actual &&
+ git branch --unset-upstream @{-1}@{upstream} &&
+ test_must_fail git config branch.upstream-other.merge
+'
+
test_done
diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh
index d12e4e4..7b05bf3 100755
--- a/t/t3206-range-diff.sh
+++ b/t/t3206-range-diff.sh
@@ -33,6 +33,26 @@ test_expect_success 'setup' '
u3 sha256:736c4bc
u4 sha256:673e77d
+ # topic (abbrev=10)
+ t1_abbrev sha1:4de457d2c0
+ t2_abbrev sha1:fccce22f8c
+ t3_abbrev sha1:147e64ef53
+ t4_abbrev sha1:a63e992599
+ t1_abbrev sha256:b89f8b9092
+ t2_abbrev sha256:5f12aadf34
+ t3_abbrev sha256:ea8b273a6c
+ t4_abbrev sha256:14b73361fc
+
+ # unmodified (abbrev=10)
+ u1_abbrev sha1:35b9b25f76
+ u2_abbrev sha1:de345ab3de
+ u3_abbrev sha1:9af6654000
+ u4_abbrev sha1:2901f773f3
+ u1_abbrev sha256:e3731be242
+ u2_abbrev sha256:14fadf8cee
+ u3_abbrev sha256:736c4bcb44
+ u4_abbrev sha256:673e77d589
+
# reordered
r1 sha1:aca177a
r2 sha1:14ad629
@@ -153,6 +173,18 @@ test_expect_success 'simple A B C (unmodified)' '
test_cmp expect actual
'
+test_expect_success 'simple A..B A..C (unmodified) with --abbrev' '
+ git range-diff --no-color --abbrev=10 main..topic main..unmodified \
+ >actual &&
+ cat >expect <<-EOF &&
+ 1: $(test_oid t1_abbrev) = 1: $(test_oid u1_abbrev) s/5/A/
+ 2: $(test_oid t2_abbrev) = 2: $(test_oid u2_abbrev) s/4/A/
+ 3: $(test_oid t3_abbrev) = 3: $(test_oid u3_abbrev) s/11/B/
+ 4: $(test_oid t4_abbrev) = 4: $(test_oid u4_abbrev) s/12/B/
+ EOF
+ test_cmp expect actual
+'
+
test_expect_success 'A^! and A^-<n> (unmodified)' '
git range-diff --no-color topic^! unmodified^-1 >actual &&
cat >expect <<-EOF &&
@@ -162,8 +194,8 @@ test_expect_success 'A^! and A^-<n> (unmodified)' '
'
test_expect_success 'A^{/..} is not mistaken for a range' '
- test_must_fail git range-diff topic^.. topic^{/..} 2>error &&
- test_i18ngrep "not a commit range" error
+ test_must_fail git range-diff topic^.. topic^{/..} -- 2>error &&
+ test_grep "not a commit range" error
'
test_expect_success 'trivial reordering' '
@@ -505,7 +537,7 @@ do
main..unmodified >actual &&
test_when_finished "rm 000?-*" &&
test_line_count = 5 actual &&
- test_i18ngrep "^Range-diff:$" 0000-* &&
+ test_grep "^Range-diff:$" 0000-* &&
grep "= 1: .* s/5/A" 0000-* &&
grep "= 2: .* s/4/A" 0000-* &&
grep "= 3: .* s/11/B" 0000-* &&
@@ -517,7 +549,7 @@ test_expect_success 'format-patch --range-diff as commentary' '
git format-patch --range-diff=HEAD~1 HEAD~1 >actual &&
test_when_finished "rm 0001-*" &&
test_line_count = 1 actual &&
- test_i18ngrep "^Range-diff:$" 0001-* &&
+ test_grep "^Range-diff:$" 0001-* &&
grep "> 1: .* new message" 0001-*
'
@@ -525,7 +557,7 @@ test_expect_success 'format-patch --range-diff reroll-count with a non-integer'
git format-patch --range-diff=HEAD~1 -v2.9 HEAD~1 >actual &&
test_when_finished "rm v2.9-0001-*" &&
test_line_count = 1 actual &&
- test_i18ngrep "^Range-diff:$" v2.9-0001-* &&
+ test_grep "^Range-diff:$" v2.9-0001-* &&
grep "> 1: .* new message" v2.9-0001-*
'
@@ -533,7 +565,7 @@ test_expect_success 'format-patch --range-diff reroll-count with a integer' '
git format-patch --range-diff=HEAD~1 -v2 HEAD~1 >actual &&
test_when_finished "rm v2-0001-*" &&
test_line_count = 1 actual &&
- test_i18ngrep "^Range-diff ..* v1:$" v2-0001-* &&
+ test_grep "^Range-diff ..* v1:$" v2-0001-* &&
grep "> 1: .* new message" v2-0001-*
'
@@ -541,7 +573,7 @@ test_expect_success 'format-patch --range-diff with v0' '
git format-patch --range-diff=HEAD~1 -v0 HEAD~1 >actual &&
test_when_finished "rm v0-0001-*" &&
test_line_count = 1 actual &&
- test_i18ngrep "^Range-diff:$" v0-0001-* &&
+ test_grep "^Range-diff:$" v0-0001-* &&
grep "> 1: .* new message" v0-0001-*
'
@@ -630,6 +662,20 @@ test_expect_success 'range-diff with multiple --notes' '
test_cmp expect actual
'
+# `range-diff` should act like `log` with regards to notes
+test_expect_success 'range-diff with --notes=custom does not show default notes' '
+ git notes add -m "topic note" topic &&
+ git notes add -m "unmodified note" unmodified &&
+ git notes --ref=custom add -m "topic note" topic &&
+ git notes --ref=custom add -m "unmodified note" unmodified &&
+ test_when_finished git notes remove topic unmodified &&
+ test_when_finished git notes --ref=custom remove topic unmodified &&
+ git range-diff --notes=custom main..topic main..unmodified \
+ >actual &&
+ ! grep "## Notes ##" actual &&
+ grep "## Notes (custom) ##" actual
+'
+
test_expect_success 'format-patch --range-diff does not compare notes by default' '
git notes add -m "topic note" topic &&
git notes add -m "unmodified note" unmodified &&
@@ -638,7 +684,7 @@ test_expect_success 'format-patch --range-diff does not compare notes by default
main..unmodified >actual &&
test_when_finished "rm 000?-*" &&
test_line_count = 5 actual &&
- test_i18ngrep "^Range-diff:$" 0000-* &&
+ test_grep "^Range-diff:$" 0000-* &&
grep "= 1: .* s/5/A" 0000-* &&
grep "= 2: .* s/4/A" 0000-* &&
grep "= 3: .* s/11/B" 0000-* &&
@@ -647,6 +693,20 @@ test_expect_success 'format-patch --range-diff does not compare notes by default
! grep "note" 0000-*
'
+test_expect_success 'format-patch --notes=custom --range-diff only compares custom notes' '
+ git notes add -m "topic note" topic &&
+ git notes --ref=custom add -m "topic note (custom)" topic &&
+ git notes add -m "unmodified note" unmodified &&
+ git notes --ref=custom add -m "unmodified note (custom)" unmodified &&
+ test_when_finished git notes remove topic unmodified &&
+ test_when_finished git notes --ref=custom remove topic unmodified &&
+ git format-patch --notes=custom --cover-letter --range-diff=$prev \
+ main..unmodified >actual &&
+ test_when_finished "rm 000?-*" &&
+ grep "## Notes (custom) ##" 0000-* &&
+ ! grep "## Notes ##" 0000-*
+'
+
test_expect_success 'format-patch --range-diff with --no-notes' '
git notes add -m "topic note" topic &&
git notes add -m "unmodified note" unmodified &&
@@ -655,7 +715,7 @@ test_expect_success 'format-patch --range-diff with --no-notes' '
main..unmodified >actual &&
test_when_finished "rm 000?-*" &&
test_line_count = 5 actual &&
- test_i18ngrep "^Range-diff:$" 0000-* &&
+ test_grep "^Range-diff:$" 0000-* &&
grep "= 1: .* s/5/A" 0000-* &&
grep "= 2: .* s/4/A" 0000-* &&
grep "= 3: .* s/11/B" 0000-* &&
@@ -672,7 +732,7 @@ test_expect_success 'format-patch --range-diff with --notes' '
main..unmodified >actual &&
test_when_finished "rm 000?-*" &&
test_line_count = 5 actual &&
- test_i18ngrep "^Range-diff:$" 0000-* &&
+ test_grep "^Range-diff:$" 0000-* &&
grep "= 1: .* s/5/A" 0000-* &&
grep "= 2: .* s/4/A" 0000-* &&
grep "= 3: .* s/11/B" 0000-* &&
@@ -701,7 +761,7 @@ test_expect_success 'format-patch --range-diff with format.notes config' '
main..unmodified >actual &&
test_when_finished "rm 000?-*" &&
test_line_count = 5 actual &&
- test_i18ngrep "^Range-diff:$" 0000-* &&
+ test_grep "^Range-diff:$" 0000-* &&
grep "= 1: .* s/5/A" 0000-* &&
grep "= 2: .* s/4/A" 0000-* &&
grep "= 3: .* s/11/B" 0000-* &&
@@ -732,7 +792,7 @@ test_expect_success 'format-patch --range-diff with multiple notes' '
main..unmodified >actual &&
test_when_finished "rm 000?-*" &&
test_line_count = 5 actual &&
- test_i18ngrep "^Range-diff:$" 0000-* &&
+ test_grep "^Range-diff:$" 0000-* &&
grep "= 1: .* s/5/A" 0000-* &&
grep "= 2: .* s/4/A" 0000-* &&
grep "= 3: .* s/11/B" 0000-* &&
@@ -772,6 +832,17 @@ test_expect_success '--left-only/--right-only' '
test_cmp expect actual
'
+test_expect_success 'ranges with pathspecs' '
+ git range-diff topic...mode-only-change -- other-file >actual &&
+ test_line_count = 2 actual &&
+ topic_oid=$(git rev-parse --short topic) &&
+ mode_change_oid=$(git rev-parse --short mode-only-change^) &&
+ file_change_oid=$(git rev-parse --short mode-only-change) &&
+ grep "$mode_change_oid" actual &&
+ ! grep "$file_change_oid" actual &&
+ ! grep "$topic_oid" actual
+'
+
test_expect_success 'submodule changes are shown irrespective of diff.submodule' '
git init sub-repo &&
test_commit -C sub-repo sub-first &&
@@ -782,7 +853,7 @@ test_expect_success 'submodule changes are shown irrespective of diff.submodule'
sub_oid3=$(git -C sub-repo rev-parse HEAD) &&
git checkout -b main-sub topic &&
- git submodule add ./sub-repo sub &&
+ git -c protocol.file.allow=always submodule add ./sub-repo sub &&
git -C sub checkout --detach sub-first &&
git commit -m "add sub" sub &&
sup_oid1=$(git rev-parse --short HEAD) &&
diff --git a/t/t3207-branch-submodule.sh b/t/t3207-branch-submodule.sh
index cfde6b2..fe72b24 100755
--- a/t/t3207-branch-submodule.sh
+++ b/t/t3207-branch-submodule.sh
@@ -28,6 +28,7 @@ test_no_branch () {
}
test_expect_success 'setup superproject and submodule' '
+ git config --global protocol.file.allow always &&
mkdir test_dirs &&
(
cd test_dirs &&
diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh
deleted file mode 100755
index 577f32d..0000000
--- a/t/t3210-pack-refs.sh
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2005 Amos Waterland
-# Copyright (c) 2006 Christian Couder
-#
-
-test_description='git pack-refs should not change the branch semantic
-
-This test runs git pack-refs and git show-ref and checks that the branch
-semantic is still the same.
-'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
-export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
-
-. ./test-lib.sh
-
-test_expect_success 'enable reflogs' '
- git config core.logallrefupdates true
-'
-
-test_expect_success \
- 'prepare a trivial repository' \
- 'echo Hello > A &&
- git update-index --add A &&
- git commit -m "Initial commit." &&
- HEAD=$(git rev-parse --verify HEAD)'
-
-SHA1=
-
-test_expect_success \
- 'see if git show-ref works as expected' \
- 'git branch a &&
- SHA1=$(cat .git/refs/heads/a) &&
- echo "$SHA1 refs/heads/a" >expect &&
- git show-ref a >result &&
- test_cmp expect result'
-
-test_expect_success \
- 'see if a branch still exists when packed' \
- 'git branch b &&
- git pack-refs --all &&
- rm -f .git/refs/heads/b &&
- echo "$SHA1 refs/heads/b" >expect &&
- git show-ref b >result &&
- test_cmp expect result'
-
-test_expect_success 'git branch c/d should barf if branch c exists' '
- git branch c &&
- git pack-refs --all &&
- rm -f .git/refs/heads/c &&
- test_must_fail git branch c/d
-'
-
-test_expect_success \
- 'see if a branch still exists after git pack-refs --prune' \
- 'git branch e &&
- git pack-refs --all --prune &&
- echo "$SHA1 refs/heads/e" >expect &&
- git show-ref e >result &&
- test_cmp expect result'
-
-test_expect_success 'see if git pack-refs --prune remove ref files' '
- git branch f &&
- git pack-refs --all --prune &&
- ! test -f .git/refs/heads/f
-'
-
-test_expect_success 'see if git pack-refs --prune removes empty dirs' '
- git branch r/s/t &&
- git pack-refs --all --prune &&
- ! test -e .git/refs/heads/r
-'
-
-test_expect_success \
- 'git branch g should work when git branch g/h has been deleted' \
- 'git branch g/h &&
- git pack-refs --all --prune &&
- git branch -d g/h &&
- git branch g &&
- git pack-refs --all &&
- git branch -d g'
-
-test_expect_success 'git branch i/j/k should barf if branch i exists' '
- git branch i &&
- git pack-refs --all --prune &&
- test_must_fail git branch i/j/k
-'
-
-test_expect_success \
- 'test git branch k after branch k/l/m and k/lm have been deleted' \
- 'git branch k/l &&
- git branch k/lm &&
- git branch -d k/l &&
- git branch k/l/m &&
- git branch -d k/l/m &&
- git branch -d k/lm &&
- git branch k'
-
-test_expect_success \
- 'test git branch n after some branch deletion and pruning' \
- 'git branch n/o &&
- git branch n/op &&
- git branch -d n/o &&
- git branch n/o/p &&
- git branch -d n/op &&
- git pack-refs --all --prune &&
- git branch -d n/o/p &&
- git branch n'
-
-test_expect_success \
- 'see if up-to-date packed refs are preserved' \
- 'git branch q &&
- git pack-refs --all --prune &&
- git update-ref refs/heads/q refs/heads/q &&
- ! test -f .git/refs/heads/q'
-
-test_expect_success 'pack, prune and repack' '
- git tag foo &&
- git pack-refs --all --prune &&
- git show-ref >all-of-them &&
- git pack-refs &&
- git show-ref >again &&
- test_cmp all-of-them again
-'
-
-test_expect_success 'explicit pack-refs with dangling packed reference' '
- git commit --allow-empty -m "soon to be garbage-collected" &&
- git pack-refs --all &&
- git reset --hard HEAD^ &&
- git reflog expire --expire=all --all &&
- git prune --expire=all &&
- git pack-refs --all 2>result &&
- test_must_be_empty result
-'
-
-test_expect_success 'delete ref with dangling packed version' '
- git checkout -b lamb &&
- git commit --allow-empty -m "future garbage" &&
- git pack-refs --all &&
- git reset --hard HEAD^ &&
- git checkout main &&
- git reflog expire --expire=all --all &&
- git prune --expire=all &&
- git branch -d lamb 2>result &&
- test_must_be_empty result
-'
-
-test_expect_success 'delete ref while another dangling packed ref' '
- git branch lamb &&
- git commit --allow-empty -m "future garbage" &&
- git pack-refs --all &&
- git reset --hard HEAD^ &&
- git reflog expire --expire=all --all &&
- git prune --expire=all &&
- git branch -d lamb 2>result &&
- test_must_be_empty result
-'
-
-test_expect_success 'pack ref directly below refs/' '
- git update-ref refs/top HEAD &&
- git pack-refs --all --prune &&
- grep refs/top .git/packed-refs &&
- test_path_is_missing .git/refs/top
-'
-
-test_expect_success 'do not pack ref in refs/bisect' '
- git update-ref refs/bisect/local HEAD &&
- git pack-refs --all --prune &&
- ! grep refs/bisect/local .git/packed-refs >/dev/null &&
- test_path_is_file .git/refs/bisect/local
-'
-
-test_expect_success 'disable reflogs' '
- git config core.logallrefupdates false &&
- rm -rf .git/logs
-'
-
-test_expect_success 'create packed foo/bar/baz branch' '
- git branch foo/bar/baz &&
- git pack-refs --all --prune &&
- test_path_is_missing .git/refs/heads/foo/bar/baz &&
- test_must_fail git reflog exists refs/heads/foo/bar/baz
-'
-
-test_expect_success 'notice d/f conflict with existing directory' '
- test_must_fail git branch foo &&
- test_must_fail git branch foo/bar
-'
-
-test_expect_success 'existing directory reports concrete ref' '
- test_must_fail git branch foo 2>stderr &&
- test_i18ngrep refs/heads/foo/bar/baz stderr
-'
-
-test_expect_success 'notice d/f conflict with existing ref' '
- test_must_fail git branch foo/bar/baz/extra &&
- test_must_fail git branch foo/bar/baz/lots/of/extra/components
-'
-
-test_expect_success 'reject packed-refs with unterminated line' '
- cp .git/packed-refs .git/packed-refs.bak &&
- test_when_finished "mv .git/packed-refs.bak .git/packed-refs" &&
- printf "%s" "$HEAD refs/zzzzz" >>.git/packed-refs &&
- echo "fatal: unterminated line in .git/packed-refs: $HEAD refs/zzzzz" >expected_err &&
- test_must_fail git for-each-ref >out 2>err &&
- test_cmp expected_err err
-'
-
-test_expect_success 'reject packed-refs containing junk' '
- cp .git/packed-refs .git/packed-refs.bak &&
- test_when_finished "mv .git/packed-refs.bak .git/packed-refs" &&
- printf "%s\n" "bogus content" >>.git/packed-refs &&
- echo "fatal: unexpected line in .git/packed-refs: bogus content" >expected_err &&
- test_must_fail git for-each-ref >out 2>err &&
- test_cmp expected_err err
-'
-
-test_expect_success 'reject packed-refs with a short SHA-1' '
- cp .git/packed-refs .git/packed-refs.bak &&
- test_when_finished "mv .git/packed-refs.bak .git/packed-refs" &&
- printf "%.7s %s\n" $HEAD refs/zzzzz >>.git/packed-refs &&
- printf "fatal: unexpected line in .git/packed-refs: %.7s %s\n" $HEAD refs/zzzzz >expected_err &&
- test_must_fail git for-each-ref >out 2>err &&
- test_cmp expected_err err
-'
-
-test_expect_success 'timeout if packed-refs.lock exists' '
- LOCK=.git/packed-refs.lock &&
- >"$LOCK" &&
- test_when_finished "rm -f $LOCK" &&
- test_must_fail git pack-refs --all --prune
-'
-
-test_expect_success 'retry acquiring packed-refs.lock' '
- LOCK=.git/packed-refs.lock &&
- >"$LOCK" &&
- test_when_finished "wait && rm -f $LOCK" &&
- {
- ( sleep 1 && rm -f $LOCK ) &
- } &&
- git -c core.packedrefstimeout=3000 pack-refs --all --prune
-'
-
-test_expect_success SYMLINKS 'pack symlinked packed-refs' '
- # First make sure that symlinking works when reading:
- git update-ref refs/heads/lossy refs/heads/main &&
- git for-each-ref >all-refs-before &&
- mv .git/packed-refs .git/my-deviant-packed-refs &&
- ln -s my-deviant-packed-refs .git/packed-refs &&
- git for-each-ref >all-refs-linked &&
- test_cmp all-refs-before all-refs-linked &&
- git pack-refs --all --prune &&
- git for-each-ref >all-refs-packed &&
- test_cmp all-refs-before all-refs-packed &&
- test -h .git/packed-refs &&
- test "$(test_readlink .git/packed-refs)" = "my-deviant-packed-refs"
-'
-
-test_done
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index d742be8..cf23c06 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -362,6 +362,7 @@ test_expect_success 'do not create empty note with -m ""' '
'
test_expect_success 'create note with combination of -m and -F' '
+ test_when_finished git notes remove HEAD &&
cat >expect-combine_m_and_F <<-EOF &&
foo
@@ -380,6 +381,41 @@ test_expect_success 'create note with combination of -m and -F' '
test_cmp expect-combine_m_and_F actual
'
+test_expect_success 'create note with combination of -m and -F and --separator' '
+ test_when_finished git notes remove HEAD &&
+ cat >expect-combine_m_and_F <<-\EOF &&
+ foo
+ -------
+ xyzzy
+ -------
+ bar
+ -------
+ zyxxy
+ -------
+ baz
+ EOF
+ echo "xyzzy" >note_a &&
+ echo "zyxxy" >note_b &&
+ git notes add -m "foo" -F note_a -m "bar" -F note_b -m "baz" --separator="-------" &&
+ git notes show >actual &&
+ test_cmp expect-combine_m_and_F actual
+'
+
+test_expect_success 'create note with combination of -m and -F and --no-separator' '
+ cat >expect-combine_m_and_F <<-\EOF &&
+ foo
+ xyzzy
+ bar
+ zyxxy
+ baz
+ EOF
+ echo "xyzzy" >note_a &&
+ echo "zyxxy" >note_b &&
+ git notes add -m "foo" -F note_a -m "bar" -F note_b -m "baz" --no-separator &&
+ git notes show >actual &&
+ test_cmp expect-combine_m_and_F actual
+'
+
test_expect_success 'remove note with "git notes remove"' '
git notes remove HEAD^ &&
git notes remove &&
@@ -505,6 +541,11 @@ test_expect_success 'list notes with "git notes"' '
test_cmp expect actual
'
+test_expect_success '"git notes" without subcommand does not take arguments' '
+ test_expect_code 129 git notes HEAD^^ 2>err &&
+ grep "^error: unknown subcommand" err
+'
+
test_expect_success 'list specific note with "git notes list <object>"' '
git rev-parse refs/notes/commits:$commit_3 >expect &&
git notes list HEAD^^ >actual &&
@@ -516,6 +557,112 @@ test_expect_success 'listing non-existing notes fails' '
test_must_be_empty actual
'
+test_expect_success 'append: specify a separator with an empty arg' '
+ test_when_finished git notes remove HEAD &&
+ cat >expect <<-\EOF &&
+ notes-1
+
+ notes-2
+ EOF
+
+ git notes add -m "notes-1" &&
+ git notes append --separator="" -m "notes-2" &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'append: specify a separator without arg' '
+ test_when_finished git notes remove HEAD &&
+ cat >expect <<-\EOF &&
+ notes-1
+
+ notes-2
+ EOF
+
+ git notes add -m "notes-1" &&
+ git notes append --separator -m "notes-2" &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'append: specify as --no-separator' '
+ test_when_finished git notes remove HEAD &&
+ cat >expect <<-\EOF &&
+ notes-1
+ notes-2
+ EOF
+
+ git notes add -m "notes-1" &&
+ git notes append --no-separator -m "notes-2" &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'append: specify separator with line break' '
+ test_when_finished git notes remove HEAD &&
+ cat >expect <<-\EOF &&
+ notes-1
+ -------
+ notes-2
+ EOF
+
+ git notes add -m "notes-1" &&
+ git notes append --separator="-------$LF" -m "notes-2" &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'append: specify separator without line break' '
+ test_when_finished git notes remove HEAD &&
+ cat >expect <<-\EOF &&
+ notes-1
+ -------
+ notes-2
+ EOF
+
+ git notes add -m "notes-1" &&
+ git notes append --separator="-------" -m "notes-2" &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'append: specify separator with multiple messages' '
+ test_when_finished git notes remove HEAD &&
+ cat >expect <<-\EOF &&
+ notes-1
+ -------
+ notes-2
+ -------
+ notes-3
+ EOF
+
+ git notes add -m "notes-1" &&
+ git notes append --separator="-------" -m "notes-2" -m "notes-3" &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'append note with combination of -m and -F and --separator' '
+ test_when_finished git notes remove HEAD &&
+ cat >expect-combine_m_and_F <<-\EOF &&
+ m-notes-1
+ -------
+ f-notes-1
+ -------
+ m-notes-2
+ -------
+ f-notes-2
+ -------
+ m-notes-3
+ EOF
+
+ echo "f-notes-1" >note_a &&
+ echo "f-notes-2" >note_b &&
+ git notes append -m "m-notes-1" -F note_a -m "m-notes-2" -F note_b -m "m-notes-3" --separator="-------" &&
+ git notes show >actual &&
+ test_cmp expect-combine_m_and_F actual
+'
+
test_expect_success 'append to existing note with "git notes append"' '
cat >expect <<-EOF &&
Initial set of notes
@@ -813,6 +960,33 @@ test_expect_success 'create note from blob with "git notes add -C" reuses blob i
test_cmp blob actual
'
+test_expect_success 'create note from blob with "-C", also specify "-m", "-F" and "--separator"' '
+ # 8th will be reuseed in following tests, so rollback when the test is done
+ test_when_finished "git notes remove && git notes add -C $(cat blob)" &&
+ commit=$(git rev-parse HEAD) &&
+ cat >expect <<-EOF &&
+ commit $commit
+ Author: A U Thor <author@example.com>
+ Date: Thu Apr 7 15:20:13 2005 -0700
+
+ ${indent}8th
+
+ Notes:
+ ${indent}This is a blob object
+ ${indent}-------
+ ${indent}This is created by -m
+ ${indent}-------
+ ${indent}This is created by -F
+ EOF
+
+ git notes remove &&
+ echo "This is a blob object" | git hash-object -w --stdin >blob &&
+ echo "This is created by -F" >note_a &&
+ git notes add -C $(cat blob) -m "This is created by -m" -F note_a --separator="-------" &&
+ git log -1 >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'create note from other note with "git notes add -c"' '
test_commit 9th &&
commit=$(git rev-parse HEAD) &&
@@ -1295,9 +1469,9 @@ test_expect_success 'GIT_NOTES_REWRITE_REF overrides config' '
test_expect_success 'git notes copy diagnoses too many or too few arguments' '
test_must_fail git notes copy 2>error &&
- test_i18ngrep "too few arguments" error &&
+ test_grep "too few arguments" error &&
test_must_fail git notes copy one two three 2>error &&
- test_i18ngrep "too many arguments" error
+ test_grep "too many arguments" error
'
test_expect_success 'git notes get-ref expands refs/heads/main to refs/notes/refs/heads/main' '
diff --git a/t/t3304-notes-mixed.sh b/t/t3304-notes-mixed.sh
index 03dfcd3..2c3a245 100755
--- a/t/t3304-notes-mixed.sh
+++ b/t/t3304-notes-mixed.sh
@@ -5,6 +5,7 @@ test_description='Test notes trees that also contain non-notes'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
number_of_commits=100
diff --git a/t/t3305-notes-fanout.sh b/t/t3305-notes-fanout.sh
index 64a9915..1ec1fb6 100755
--- a/t/t3305-notes-fanout.sh
+++ b/t/t3305-notes-fanout.sh
@@ -9,7 +9,7 @@ path_has_fanout() {
path=$1 &&
fanout=$2 &&
after_last_slash=$(($(test_oid hexsz) - $fanout * 2)) &&
- echo $path | grep -q "^\([0-9a-f]\{2\}/\)\{$fanout\}[0-9a-f]\{$after_last_slash\}$"
+ echo $path | grep -q -E "^([0-9a-f]{2}/){$fanout}[0-9a-f]{$after_last_slash}$"
}
touched_one_note_with_fanout() {
@@ -51,7 +51,7 @@ test_expect_success 'creating many notes with git-notes' '
done
'
-test_expect_success !SANITIZE_LEAK 'many notes created correctly with git-notes' '
+test_expect_success 'many notes created correctly with git-notes' '
git log >output.raw &&
grep "^ " output.raw >output &&
i=$num_notes &&
diff --git a/t/t3307-notes-man.sh b/t/t3307-notes-man.sh
index 1aa366a..ae31650 100755
--- a/t/t3307-notes-man.sh
+++ b/t/t3307-notes-man.sh
@@ -4,6 +4,7 @@ test_description='Examples from the git-notes man page
Make sure the manual is not full of lies.'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
diff --git a/t/t3309-notes-merge-auto-resolve.sh b/t/t3309-notes-merge-auto-resolve.sh
index 141d3e4..9bd5dbf 100755
--- a/t/t3309-notes-merge-auto-resolve.sh
+++ b/t/t3309-notes-merge-auto-resolve.sh
@@ -360,7 +360,12 @@ test_expect_success 'merge z into y with invalid strategy => Fail/No changes' '
test_expect_success 'merge z into y with invalid configuration option => Fail/No changes' '
git config core.notesRef refs/notes/y &&
- test_must_fail git -c notes.mergeStrategy="foo" notes merge z &&
+ cat >expect <<-\EOF &&
+ error: unknown notes merge strategy foo
+ fatal: unable to parse '\''notes.mergeStrategy'\'' from command-line config
+ EOF
+ test_must_fail git -c notes.mergeStrategy="foo" notes merge z 2>actual &&
+ test_cmp expect actual &&
# Verify no changes (y)
verify_notes y y
'
diff --git a/t/t3310-notes-merge-manual-resolve.sh b/t/t3310-notes-merge-manual-resolve.sh
index d3d72e2..597df5e 100755
--- a/t/t3310-notes-merge-manual-resolve.sh
+++ b/t/t3310-notes-merge-manual-resolve.sh
@@ -216,7 +216,7 @@ test_expect_success 'merge z into m (== y) with default ("manual") resolver => C
git config core.notesRef refs/notes/m &&
test_must_fail git notes merge z >output 2>&1 &&
# Output should point to where to resolve conflicts
- test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output &&
+ test_grep "\\.git/NOTES_MERGE_WORKTREE" output &&
# Inspect merge conflicts
ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
test_cmp expect_conflicts output_conflicts &&
@@ -263,7 +263,7 @@ test_expect_success 'cannot do merge w/conflicts when previous merge is unfinish
test -d .git/NOTES_MERGE_WORKTREE &&
test_must_fail git notes merge z >output 2>&1 &&
# Output should indicate what is wrong
- test_i18ngrep -q "\\.git/NOTES_MERGE_\\* exists" output
+ test_grep -q "\\.git/NOTES_MERGE_\\* exists" output
'
# Setup non-conflicting merge between x and new notes ref w
@@ -417,7 +417,7 @@ test_expect_success 'redo merge of z into m (== y) with default ("manual") resol
git config core.notesRef refs/notes/m &&
test_must_fail git notes merge z >output 2>&1 &&
# Output should point to where to resolve conflicts
- test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output &&
+ test_grep "\\.git/NOTES_MERGE_WORKTREE" output &&
# Inspect merge conflicts
ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
test_cmp expect_conflicts output_conflicts &&
@@ -449,7 +449,7 @@ git rev-parse refs/notes/z > pre_merge_z
test_expect_success 'redo merge of z into m (== y) with default ("manual") resolver => Conflicting 3-way merge' '
test_must_fail git notes merge z >output 2>&1 &&
# Output should point to where to resolve conflicts
- test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output &&
+ test_grep "\\.git/NOTES_MERGE_WORKTREE" output &&
# Inspect merge conflicts
ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
test_cmp expect_conflicts output_conflicts &&
@@ -528,7 +528,7 @@ test_expect_success 'redo merge of z into m (== y) with default ("manual") resol
git update-ref refs/notes/m refs/notes/y &&
test_must_fail git notes merge z >output 2>&1 &&
# Output should point to where to resolve conflicts
- test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output &&
+ test_grep "\\.git/NOTES_MERGE_WORKTREE" output &&
# Inspect merge conflicts
ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
test_cmp expect_conflicts output_conflicts &&
@@ -561,9 +561,9 @@ y and z notes on 4th commit
EOF
# Fail to finalize merge
test_must_fail git notes merge --commit >output 2>&1 &&
- # .git/NOTES_MERGE_* must remain
- test -f .git/NOTES_MERGE_PARTIAL &&
- test -f .git/NOTES_MERGE_REF &&
+ # NOTES_MERGE_* refs and .git/NOTES_MERGE_* state files must remain
+ git rev-parse --verify NOTES_MERGE_PARTIAL &&
+ git rev-parse --verify NOTES_MERGE_REF &&
test -f .git/NOTES_MERGE_WORKTREE/$commit_sha1 &&
test -f .git/NOTES_MERGE_WORKTREE/$commit_sha2 &&
test -f .git/NOTES_MERGE_WORKTREE/$commit_sha3 &&
@@ -573,9 +573,9 @@ EOF
test "$(git rev-parse refs/notes/y)" = "$(git rev-parse NOTES_MERGE_PARTIAL^1)" &&
test "$(git rev-parse refs/notes/m)" != "$(git rev-parse NOTES_MERGE_PARTIAL^1)" &&
# Mention refs/notes/m, and its current and expected value in output
- test_i18ngrep -q "refs/notes/m" output &&
- test_i18ngrep -q "$(git rev-parse refs/notes/m)" output &&
- test_i18ngrep -q "$(git rev-parse NOTES_MERGE_PARTIAL^1)" output &&
+ test_grep -q "refs/notes/m" output &&
+ test_grep -q "$(git rev-parse refs/notes/m)" output &&
+ test_grep -q "$(git rev-parse NOTES_MERGE_PARTIAL^1)" output &&
# Verify that other notes refs has not changed (w, x, y and z)
verify_notes w &&
verify_notes x &&
diff --git a/t/t3320-notes-merge-worktrees.sh b/t/t3320-notes-merge-worktrees.sh
index bff0aea..0fd3328 100755
--- a/t/t3320-notes-merge-worktrees.sh
+++ b/t/t3320-notes-merge-worktrees.sh
@@ -57,7 +57,7 @@ test_expect_success 'merge z into y while mid-merge in another workdir fails' '
cd worktree &&
git config core.notesRef refs/notes/y &&
test_must_fail git notes merge z 2>err &&
- test_i18ngrep "a notes merge into refs/notes/y is already in-progress at" err
+ test_grep "a notes merge into refs/notes/y is already in-progress at" err
) &&
test_must_fail git -C worktree symbolic-ref NOTES_MERGE_REF
'
@@ -67,7 +67,7 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' '
cd worktree2 &&
git config core.notesRef refs/notes/x &&
test_must_fail git notes merge z >out 2>&1 &&
- test_i18ngrep "Automatic notes merge failed" out &&
+ test_grep "Automatic notes merge failed" out &&
grep -v "A notes merge into refs/notes/x is already in-progress in" out
) &&
echo "refs/notes/x" >expect &&
diff --git a/t/t3321-notes-stripspace.sh b/t/t3321-notes-stripspace.sh
new file mode 100755
index 0000000..beca346
--- /dev/null
+++ b/t/t3321-notes-stripspace.sh
@@ -0,0 +1,578 @@
+#!/bin/sh
+#
+# Copyright (c) 2023 Teng Long
+#
+
+test_description='Test commit notes with stripspace behavior'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+MULTI_LF="$LF$LF$LF"
+write_script fake_editor <<\EOF
+echo "$MSG" >"$1"
+echo "$MSG" >&2
+EOF
+GIT_EDITOR=./fake_editor
+export GIT_EDITOR
+
+test_expect_success 'setup the commit' '
+ test_commit 1st
+'
+
+test_expect_success 'add note by editor' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ first-line
+
+ second-line
+ EOF
+
+ MSG="${LF}first-line${MULTI_LF}second-line${LF}" git notes add &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'add note by specifying single "-m", "--stripspace" is the default behavior' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ first-line
+
+ second-line
+ EOF
+
+ git notes add -m "${LF}first-line${MULTI_LF}second-line${LF}" &&
+ git notes show >actual &&
+ test_cmp expect actual &&
+ git notes remove &&
+ git notes add --stripspace -m "${LF}first-line${MULTI_LF}second-line${LF}" &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'add note by specifying single "-m" and "--no-stripspace" ' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ ${LF}first-line${MULTI_LF}second-line
+ EOF
+
+ git notes add --no-stripspace \
+ -m "${LF}first-line${MULTI_LF}second-line${LF}" &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'add note by specifying multiple "-m", "--stripspace" is the default behavior' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ first-line
+
+ second-line
+ EOF
+
+ git notes add -m "${LF}" \
+ -m "first-line" \
+ -m "${MULTI_LF}" \
+ -m "second-line" \
+ -m "${LF}" &&
+ git notes show >actual &&
+ test_cmp expect actual &&
+ git notes remove &&
+ git notes add --stripspace -m "${LF}" \
+ -m "first-line" \
+ -m "${MULTI_LF}" \
+ -m "second-line" \
+ -m "${LF}" &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'add notes by specifying multiple "-m" and "--no-stripspace"' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ ${LF}
+ first-line
+ ${MULTI_LF}
+ second-line${LF}
+ EOF
+
+ git notes add --no-stripspace \
+ -m "${LF}" \
+ -m "first-line" \
+ -m "${MULTI_LF}" \
+ -m "second-line" \
+ -m "${LF}" &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'add note by specifying single "-F", "--stripspace" is the default behavior' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ first-line
+
+ second-line
+ EOF
+
+ cat >note-file <<-EOF &&
+ ${LF}
+ first-line
+ ${MULTI_LF}
+ second-line
+ ${LF}
+ EOF
+
+ git notes add -F note-file &&
+ git notes show >actual &&
+ test_cmp expect actual &&
+ git notes remove &&
+ git notes add --stripspace -F note-file &&
+ git notes show >actual
+'
+
+test_expect_success 'add note by specifying single "-F" and "--no-stripspace"' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ ${LF}
+ first-line
+ ${MULTI_LF}
+ second-line
+ ${LF}
+ EOF
+
+ cat >note-file <<-EOF &&
+ ${LF}
+ first-line
+ ${MULTI_LF}
+ second-line
+ ${LF}
+ EOF
+
+ git notes add --no-stripspace -F note-file &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'add note by specifying multiple "-F", "--stripspace" is the default behavior' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ file-1-first-line
+
+ file-1-second-line
+
+ file-2-first-line
+
+ file-2-second-line
+ EOF
+
+ cat >note-file-1 <<-EOF &&
+ ${LF}
+ file-1-first-line
+ ${MULTI_LF}
+ file-1-second-line
+ ${LF}
+ EOF
+
+ cat >note-file-2 <<-EOF &&
+ ${LF}
+ file-2-first-line
+ ${MULTI_LF}
+ file-2-second-line
+ ${LF}
+ EOF
+
+ git notes add -F note-file-1 -F note-file-2 &&
+ git notes show >actual &&
+ test_cmp expect actual &&
+ git notes remove &&
+ git notes add --stripspace -F note-file-1 -F note-file-2 &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'add note by specifying multiple "-F" with "--no-stripspace"' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ ${LF}
+ file-1-first-line
+ ${MULTI_LF}
+ file-1-second-line
+ ${LF}
+
+ ${LF}
+ file-2-first-line
+ ${MULTI_LF}
+ file-2-second-line
+ ${LF}
+ EOF
+
+ cat >note-file-1 <<-EOF &&
+ ${LF}
+ file-1-first-line
+ ${MULTI_LF}
+ file-1-second-line
+ ${LF}
+ EOF
+
+ cat >note-file-2 <<-EOF &&
+ ${LF}
+ file-2-first-line
+ ${MULTI_LF}
+ file-2-second-line
+ ${LF}
+ EOF
+
+ git notes add --no-stripspace -F note-file-1 -F note-file-2 &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'append note by editor' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ first-line
+
+ second-line
+ EOF
+
+ git notes add -m "first-line" &&
+ MSG="${MULTI_LF}second-line${LF}" git notes append &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'append note by specifying single "-m"' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ first-line
+
+ second-line
+ EOF
+
+ git notes add -m "${LF}first-line" &&
+ git notes append -m "${MULTI_LF}second-line${LF}" &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'append note by specifying multiple "-m"' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ first-line
+
+ second-line
+ EOF
+
+ git notes add -m "${LF}first-line" &&
+ git notes append -m "${MULTI_LF}" \
+ -m "second-line" \
+ -m "${LF}" &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'add note by specifying single "-F"' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ first-line
+
+ second-line
+ EOF
+
+ cat >note-file <<-EOF &&
+ ${LF}
+ first-line
+ ${MULTI_LF}
+ second-line
+ ${LF}
+ EOF
+
+ git notes add -F note-file &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'add notes by specifying multiple "-F"' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ file-1-first-line
+
+ file-1-second-line
+
+ file-2-first-line
+
+ file-2-second-line
+ EOF
+
+ cat >note-file-1 <<-EOF &&
+ ${LF}
+ file-1-first-line
+ ${MULTI_LF}
+ file-1-second-line
+ ${LF}
+ EOF
+
+ cat >note-file-2 <<-EOF &&
+ ${LF}
+ file-2-first-line
+ ${MULTI_LF}
+ file-2-second-line
+ ${LF}
+ EOF
+
+ git notes add -F note-file-1 -F note-file-2 &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'append note by specifying single "-F"' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ initial-line
+
+ first-line
+
+ second-line
+ EOF
+
+ cat >note-file <<-EOF &&
+ ${LF}
+ first-line
+ ${MULTI_LF}
+ second-line
+ ${LF}
+ EOF
+
+ git notes add -m "initial-line" &&
+ git notes append -F note-file &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'append notes by specifying multiple "-F"' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ initial-line
+
+ file-1-first-line
+
+ file-1-second-line
+
+ file-2-first-line
+
+ file-2-second-line
+ EOF
+
+ cat >note-file-1 <<-EOF &&
+ ${LF}
+ file-1-first-line
+ ${MULTI_LF}
+ file-1-second-line
+ ${LF}
+ EOF
+
+ cat >note-file-2 <<-EOF &&
+ ${LF}
+ file-2-first-line
+ ${MULTI_LF}
+ file-2-second-line
+ ${LF}
+ EOF
+
+ git notes add -m "initial-line" &&
+ git notes append -F note-file-1 -F note-file-2 &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'append note by specifying multiple "-F" with "--no-stripspace"' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ initial-line
+ ${LF}${LF}
+ file-1-first-line
+ ${MULTI_LF}
+ file-1-second-line
+ ${LF}
+
+ ${LF}
+ file-2-first-line
+ ${MULTI_LF}
+ file-2-second-line
+ ${LF}
+ EOF
+
+ cat >note-file-1 <<-EOF &&
+ ${LF}
+ file-1-first-line
+ ${MULTI_LF}
+ file-1-second-line
+ ${LF}
+ EOF
+
+ cat >note-file-2 <<-EOF &&
+ ${LF}
+ file-2-first-line
+ ${MULTI_LF}
+ file-2-second-line
+ ${LF}
+ EOF
+
+ git notes add -m "initial-line" &&
+ git notes append --no-stripspace -F note-file-1 -F note-file-2 &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'add notes with empty messages' '
+ rev=$(git rev-parse HEAD) &&
+ git notes add -m "${LF}" \
+ -m "${MULTI_LF}" \
+ -m "${LF}" >actual 2>&1 &&
+ test_grep "Removing note for object" actual
+'
+
+test_expect_success 'add note by specifying "-C", "--no-stripspace" is the default behavior' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ ${LF}
+ first-line
+ ${MULTI_LF}
+ second-line
+ ${LF}
+ EOF
+
+ git hash-object -w --stdin <expect >blob &&
+ git notes add -C $(cat blob) &&
+ git notes show >actual &&
+ test_cmp expect actual &&
+ git notes remove &&
+ git notes add --no-stripspace -C $(cat blob) &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'reuse note by specifying "-C" and "--stripspace"' '
+ test_when_finished "git notes remove" &&
+ cat >data <<-EOF &&
+ ${LF}
+ first-line
+ ${MULTI_LF}
+ second-line
+ ${LF}
+ EOF
+
+ cat >expect <<-EOF &&
+ first-line
+
+ second-line
+ EOF
+
+ git hash-object -w --stdin <data >blob &&
+ git notes add --stripspace -C $(cat blob) &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'reuse with "-C" and add note with "-m", "-m" will stripspace all together' '
+ test_when_finished "git notes remove" &&
+ cat >data <<-EOF &&
+ ${LF}
+ first-line
+ ${MULTI_LF}
+ second-line
+ ${LF}
+ EOF
+
+ cat >expect <<-EOF &&
+ first-line
+
+ second-line
+
+ third-line
+ EOF
+
+ git hash-object -w --stdin <data >blob &&
+ git notes add -C $(cat blob) -m "third-line" &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'add note with "-m" and reuse note with "-C", "-C" will not stripspace all together' '
+ test_when_finished "git notes remove" &&
+ cat >data <<-EOF &&
+
+ second-line
+ EOF
+
+ cat >expect <<-EOF &&
+ first-line
+ ${LF}
+ second-line
+ EOF
+
+ git hash-object -w --stdin <data >blob &&
+ git notes add -m "first-line" -C $(cat blob) &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'add note by specifying "-c", "--stripspace" is the default behavior' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ first-line
+
+ second-line
+ EOF
+
+ echo "initial-line" | git hash-object -w --stdin >blob &&
+ MSG="${LF}first-line${MULTI_LF}second-line${LF}" git notes add -c $(cat blob) &&
+ git notes show >actual &&
+ test_cmp expect actual &&
+ git notes remove &&
+ MSG="${LF}first-line${MULTI_LF}second-line${LF}" git notes add --stripspace -c $(cat blob) &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'add note by specifying "-c" with "--no-stripspace"' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ ${LF}first-line${MULTI_LF}second-line${LF}
+ EOF
+
+ echo "initial-line" | git hash-object -w --stdin >blob &&
+ MSG="${LF}first-line${MULTI_LF}second-line${LF}" git notes add --no-stripspace -c $(cat blob) &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'edit note by specifying "-c", "--stripspace" is the default behavior' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ first-line
+
+ second-line
+ EOF
+
+ MSG="${LF}first-line${MULTI_LF}second-line${LF}" git notes edit &&
+ git notes show >actual &&
+ test_cmp expect actual &&
+ git notes remove &&
+ MSG="${LF}first-line${MULTI_LF}second-line${LF}" git notes edit --stripspace &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'edit note by specifying "-c" with "--no-stripspace"' '
+ test_when_finished "git notes remove" &&
+ cat >expect <<-EOF &&
+ ${LF}first-line${MULTI_LF}second-line${LF}
+ EOF
+
+ MSG="${LF}first-line${MULTI_LF}second-line${LF}" git notes add --no-stripspace &&
+ git notes show >actual &&
+ test_cmp expect actual
+'
+
+test_done
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index d5a8ee3..e1c8c5f 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -143,8 +143,8 @@ test_expect_success 'Show verbose error when HEAD could not be detached' '
>B &&
test_when_finished "rm -f B" &&
test_must_fail git rebase topic 2>output.err >output.out &&
- test_i18ngrep "The following untracked working tree files would be overwritten by checkout:" output.err &&
- test_i18ngrep B output.err
+ test_grep "The following untracked working tree files would be overwritten by checkout:" output.err &&
+ test_grep B output.err
'
test_expect_success 'fail when upstream arg is missing and not on branch' '
@@ -388,6 +388,20 @@ test_expect_success 'switch to branch checked out here' '
git rebase main main
'
+test_expect_success 'switch to branch checked out elsewhere fails' '
+ test_when_finished "
+ git worktree remove wt1 &&
+ git worktree remove wt2 &&
+ git branch -d shared
+ " &&
+ git worktree add wt1 -b shared &&
+ git worktree add wt2 -f shared &&
+ # we test in both worktrees to ensure that works
+ # as expected with "first" and "next" worktrees
+ test_must_fail git -C wt1 rebase shared shared &&
+ test_must_fail git -C wt2 rebase shared shared
+'
+
test_expect_success 'switch to branch not checked out' '
git checkout main &&
git branch other &&
@@ -407,17 +421,7 @@ test_expect_success 'refuse to switch to branch checked out elsewhere' '
git checkout main &&
git worktree add wt &&
test_must_fail git -C wt rebase main main 2>err &&
- test_i18ngrep "already checked out" err
-'
-
-test_expect_success MINGW,SYMLINKS_WINDOWS 'rebase when .git/logs is a symlink' '
- git checkout main &&
- mv .git/logs actual_logs &&
- cmd //c "mklink /D .git\logs ..\actual_logs" &&
- git rebase -f HEAD^ &&
- test -L .git/logs &&
- rm .git/logs &&
- mv actual_logs .git/logs
+ test_grep "already used by worktree at" err
'
test_expect_success 'rebase when inside worktree subdirectory' '
diff --git a/t/t3402-rebase-merge.sh b/t/t3402-rebase-merge.sh
index 7e46f4c..5c67d07 100755
--- a/t/t3402-rebase-merge.sh
+++ b/t/t3402-rebase-merge.sh
@@ -8,6 +8,7 @@ test_description='git rebase --merge test'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
T="A quick brown fox
@@ -131,27 +132,6 @@ test_expect_success 'picking rebase' '
esac
'
-test_expect_success 'rebase -s funny -Xopt' '
- test_when_finished "rm -fr test-bin funny.was.run" &&
- mkdir test-bin &&
- cat >test-bin/git-merge-funny <<-EOF &&
- #!$SHELL_PATH
- case "\$1" in --opt) ;; *) exit 2 ;; esac
- shift &&
- >funny.was.run &&
- exec git merge-recursive "\$@"
- EOF
- chmod +x test-bin/git-merge-funny &&
- git reset --hard &&
- git checkout -b test-funny main^ &&
- test_commit funny &&
- (
- PATH=./test-bin:$PATH &&
- git rebase -s funny -Xopt main
- ) &&
- test -f funny.was.run
-'
-
test_expect_success 'rebase --skip works with two conflicts in a row' '
git checkout second-side &&
tr "[A-Z]" "[a-z]" <newfile >tmp &&
@@ -191,7 +171,7 @@ test_expect_success '--reapply-cherry-picks' '
# Regular rebase fails, because the 1-11 commit is deduplicated
test_must_fail git -C repo rebase --merge main 2> err &&
- test_i18ngrep "error: could not apply.*add 12 in another branch" err &&
+ test_grep "error: could not apply.*add 12 in another branch" err &&
git -C repo rebase --abort &&
# With --reapply-cherry-picks, it works
diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh
index f6e4864..a1911c4 100755
--- a/t/t3403-rebase-skip.sh
+++ b/t/t3403-rebase-skip.sh
@@ -108,10 +108,10 @@ test_expect_success 'correct advice upon picking empty commit' '
test_when_finished "git rebase --abort" &&
test_must_fail git rebase -i --onto goodbye \
amended-goodbye^ amended-goodbye 2>err &&
- test_i18ngrep "previous cherry-pick is now empty" err &&
- test_i18ngrep "git rebase --skip" err &&
+ test_grep "previous cherry-pick is now empty" err &&
+ test_grep "git rebase --skip" err &&
test_must_fail git commit &&
- test_i18ngrep "git rebase --skip" err
+ test_grep "git rebase --skip" err
'
test_expect_success 'correct authorship when committing empty pick' '
@@ -131,10 +131,10 @@ test_expect_success 'correct advice upon rewording empty commit' '
test_must_fail env FAKE_LINES="reword 1" git rebase -i \
--onto goodbye amended-goodbye^ amended-goodbye 2>err
) &&
- test_i18ngrep "previous cherry-pick is now empty" err &&
- test_i18ngrep "git rebase --skip" err &&
+ test_grep "previous cherry-pick is now empty" err &&
+ test_grep "git rebase --skip" err &&
test_must_fail git commit &&
- test_i18ngrep "git rebase --skip" err
+ test_grep "git rebase --skip" err
'
test_expect_success 'correct advice upon editing empty commit' '
@@ -144,10 +144,10 @@ test_expect_success 'correct advice upon editing empty commit' '
test_must_fail env FAKE_LINES="edit 1" git rebase -i \
--onto goodbye amended-goodbye^ amended-goodbye 2>err
) &&
- test_i18ngrep "previous cherry-pick is now empty" err &&
- test_i18ngrep "git rebase --skip" err &&
+ test_grep "previous cherry-pick is now empty" err &&
+ test_grep "git rebase --skip" err &&
test_must_fail git commit &&
- test_i18ngrep "git rebase --skip" err
+ test_grep "git rebase --skip" err
'
test_expect_success 'correct advice upon cherry-picking an empty commit during a rebase' '
@@ -157,10 +157,10 @@ test_expect_success 'correct advice upon cherry-picking an empty commit during a
test_must_fail env FAKE_LINES="1 exec_git_cherry-pick_amended-goodbye" \
git rebase -i goodbye^ goodbye 2>err
) &&
- test_i18ngrep "previous cherry-pick is now empty" err &&
- test_i18ngrep "git cherry-pick --skip" err &&
+ test_grep "previous cherry-pick is now empty" err &&
+ test_grep "git cherry-pick --skip" err &&
test_must_fail git commit 2>err &&
- test_i18ngrep "git cherry-pick --skip" err
+ test_grep "git cherry-pick --skip" err
'
test_expect_success 'correct advice upon multi cherry-pick picking an empty commit during a rebase' '
@@ -170,10 +170,10 @@ test_expect_success 'correct advice upon multi cherry-pick picking an empty comm
test_must_fail env FAKE_LINES="1 exec_git_cherry-pick_goodbye_amended-goodbye" \
git rebase -i goodbye^^ goodbye 2>err
) &&
- test_i18ngrep "previous cherry-pick is now empty" err &&
- test_i18ngrep "git cherry-pick --skip" err &&
+ test_grep "previous cherry-pick is now empty" err &&
+ test_grep "git cherry-pick --skip" err &&
test_must_fail git commit 2>err &&
- test_i18ngrep "git cherry-pick --skip" err
+ test_grep "git cherry-pick --skip" err
'
test_expect_success 'fixup that empties commit fails' '
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index f31afd4..d1bead6 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -153,6 +153,18 @@ test_expect_success 'rebase -i with the exec command checks tree cleanness' '
git rebase --continue
'
+test_expect_success 'cherry-pick works with rebase --exec' '
+ test_when_finished "git cherry-pick --abort; \
+ git rebase --abort; \
+ git checkout primary" &&
+ echo "exec git cherry-pick G" >todo &&
+ (
+ set_replace_editor todo &&
+ test_must_fail git rebase -i D D
+ ) &&
+ test_cmp_rev G CHERRY_PICK_HEAD
+'
+
test_expect_success 'rebase -x with empty command fails' '
test_when_finished "git rebase --abort ||:" &&
test_must_fail env git rebase -x "" @ 2>actual &&
@@ -291,9 +303,9 @@ test_expect_success 'abort with error when new base cannot be checked out' '
git rm --cached file1 &&
git commit -m "remove file in base" &&
test_must_fail git rebase -i primary > output 2>&1 &&
- test_i18ngrep "The following untracked working tree files would be overwritten by checkout:" \
+ test_grep "The following untracked working tree files would be overwritten by checkout:" \
output &&
- test_i18ngrep "file1" output &&
+ test_grep "file1" output &&
test_path_is_missing .git/rebase-merge &&
rm file1 &&
git reset --hard HEAD^
@@ -604,7 +616,8 @@ test_expect_success 'clean error after failed "exec"' '
echo "edited again" > file7 &&
git add file7 &&
test_must_fail git rebase --continue 2>error &&
- test_i18ngrep "you have staged changes in your working tree" error
+ test_grep "you have staged changes in your working tree" error &&
+ test_grep ! "could not open.*for reading" error
'
test_expect_success 'rebase a detached HEAD' '
@@ -758,7 +771,7 @@ test_expect_success 'reword' '
git show HEAD~2 | grep "C changed"
'
-test_expect_success 'no uncommited changes when rewording the todo list is reloaded' '
+test_expect_success 'no uncommitted changes when rewording and the todo list is reloaded' '
git checkout E &&
test_when_finished "git checkout @{-1}" &&
(
@@ -955,7 +968,7 @@ test_expect_success 'rebase --exec works without -i ' '
git reset --hard execute &&
rm -rf exec_output &&
EDITOR="echo >invoked_editor" git rebase --exec "echo a line >>exec_output" HEAD~2 2>actual &&
- test_i18ngrep "Successfully rebased and updated" actual &&
+ test_grep "Successfully rebased and updated" actual &&
test_line_count = 2 exec_output &&
test_path_is_missing invoked_editor
'
@@ -963,7 +976,7 @@ test_expect_success 'rebase --exec works without -i ' '
test_expect_success 'rebase -i --exec without <CMD>' '
git reset --hard execute &&
test_must_fail git rebase -i --exec 2>actual &&
- test_i18ngrep "requires a value" actual &&
+ test_grep "requires a value" actual &&
git checkout primary
'
@@ -1244,9 +1257,9 @@ test_expect_success 'short commit ID collide' '
test $colliding_id = "$(git rev-parse HEAD | cut -c 1-4)" &&
grep "^pick $colliding_id " \
.git/rebase-merge/git-rebase-todo.tmp &&
- grep "^pick [0-9a-f]\{$hexsz\}" \
+ grep -E "^pick [0-9a-f]{$hexsz}" \
.git/rebase-merge/git-rebase-todo &&
- grep "^pick [0-9a-f]\{$hexsz\}" \
+ grep -E "^pick [0-9a-f]{$hexsz}" \
.git/rebase-merge/git-rebase-todo.backup &&
git rebase --continue
) &&
@@ -1261,7 +1274,7 @@ test_expect_success 'respect core.abbrev' '
set_cat_todo_editor &&
test_must_fail git rebase -i HEAD~4 >todo-list
) &&
- test 4 = $(grep -c "pick [0-9a-f]\{12,\}" todo-list)
+ test 4 = $(grep -c -E "pick [0-9a-f]{12,}" todo-list)
'
test_expect_success 'todo count' '
@@ -1272,24 +1285,38 @@ test_expect_success 'todo count' '
test_set_editor "$(pwd)/dump-raw.sh" &&
git rebase -i HEAD~4 >actual
) &&
- test_i18ngrep "^# Rebase ..* onto ..* ([0-9]" actual
+ test_grep "^# Rebase ..* onto ..* ([0-9]" actual
'
test_expect_success 'rebase -i commits that overwrite untracked files (pick)' '
- git checkout --force branch2 &&
+ git checkout --force A &&
git clean -f &&
+ cat >todo <<-EOF &&
+ exec >file2
+ pick $(git rev-parse B) B
+ pick $(git rev-parse C) C
+ pick $(git rev-parse D) D
+ exec cat .git/rebase-merge/done >actual
+ EOF
(
- set_fake_editor &&
- FAKE_LINES="edit 1 2" git rebase -i A
+ set_replace_editor todo &&
+ test_must_fail git rebase -i A
) &&
- test_cmp_rev HEAD F &&
- test_path_is_missing file6 &&
- >file6 &&
- test_must_fail git rebase --continue &&
- test_cmp_rev HEAD F &&
- rm file6 &&
+ test_cmp_rev HEAD B &&
+ test_cmp_rev REBASE_HEAD C &&
+ head -n3 todo >expect &&
+ test_cmp expect .git/rebase-merge/done &&
+ rm file2 &&
+ test_path_is_missing .git/rebase-merge/patch &&
+ echo changed >file1 &&
+ git add file1 &&
+ test_must_fail git rebase --continue 2>err &&
+ grep "error: you have staged changes in your working tree" err &&
+ git reset --hard HEAD &&
git rebase --continue &&
- test_cmp_rev HEAD I
+ test_cmp_rev HEAD D &&
+ tail -n3 todo >>expect &&
+ test_cmp expect actual
'
test_expect_success 'rebase -i commits that overwrite untracked files (squash)' '
@@ -1305,7 +1332,14 @@ test_expect_success 'rebase -i commits that overwrite untracked files (squash)'
>file6 &&
test_must_fail git rebase --continue &&
test_cmp_rev HEAD F &&
+ test_cmp_rev REBASE_HEAD I &&
rm file6 &&
+ test_path_is_missing .git/rebase-merge/patch &&
+ echo changed >file1 &&
+ git add file1 &&
+ test_must_fail git rebase --continue 2>err &&
+ grep "error: you have staged changes in your working tree" err &&
+ git reset --hard HEAD &&
git rebase --continue &&
test $(git cat-file commit HEAD | sed -ne \$p) = I &&
git reset --hard original-branch2
@@ -1323,7 +1357,14 @@ test_expect_success 'rebase -i commits that overwrite untracked files (no ff)' '
>file6 &&
test_must_fail git rebase --continue &&
test $(git cat-file commit HEAD | sed -ne \$p) = F &&
+ test_cmp_rev REBASE_HEAD I &&
rm file6 &&
+ test_path_is_missing .git/rebase-merge/patch &&
+ echo changed >file1 &&
+ git add file1 &&
+ test_must_fail git rebase --continue 2>err &&
+ grep "error: you have staged changes in your working tree" err &&
+ git reset --hard HEAD &&
git rebase --continue &&
test $(git cat-file commit HEAD | sed -ne \$p) = I
'
@@ -1379,7 +1420,7 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = ignore' '
FAKE_LINES="1 2 3 4" git rebase -i --root 2>actual
) &&
test D = $(git cat-file commit HEAD | sed -ne \$p) &&
- test_i18ngrep \
+ test_grep \
"Successfully rebased and updated refs/heads/missing-commit" \
actual
'
@@ -1442,21 +1483,22 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = ig
git rebase --continue 2>actual
) &&
test D = $(git cat-file commit HEAD | sed -ne \$p) &&
- test_i18ngrep \
+ test_grep \
"Successfully rebased and updated refs/heads/missing-commit" \
actual
'
test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = warn' '
cat >expect <<-EOF &&
- error: invalid line 1: badcmd $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)
+ error: invalid command '\''pickled'\''
+ error: invalid line 1: pickled $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)
Warning: some commits may have been dropped accidentally.
Dropped commits (newer to older):
- $(git rev-list --pretty=oneline --abbrev-commit -1 primary)
- $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)
To avoid this message, use "drop" to explicitly remove a commit.
EOF
- head -n4 expect >expect.2 &&
+ head -n5 expect >expect.2 &&
tail -n1 expect >>expect.2 &&
tail -n4 expect.2 >expect.3 &&
test_config rebase.missingCommitsCheck warn &&
@@ -1467,7 +1509,7 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = wa
git rebase -i --root &&
cp .git/rebase-merge/git-rebase-todo.backup orig &&
FAKE_LINES="2 3 4" git rebase --edit-todo 2>actual.2 &&
- head -n6 actual.2 >actual &&
+ head -n7 actual.2 >actual &&
test_cmp expect actual &&
cp orig .git/rebase-merge/git-rebase-todo &&
FAKE_LINES="1 2 3 4" git rebase --edit-todo 2>actual.2 &&
@@ -1476,14 +1518,15 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = wa
git rebase --continue 2>actual
) &&
test D = $(git cat-file commit HEAD | sed -ne \$p) &&
- test_i18ngrep \
+ test_grep \
"Successfully rebased and updated refs/heads/missing-commit" \
actual
'
test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = error' '
cat >expect <<-EOF &&
- error: invalid line 1: badcmd $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)
+ error: invalid command '\''pickled'\''
+ error: invalid line 1: pickled $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)
Warning: some commits may have been dropped accidentally.
Dropped commits (newer to older):
- $(git rev-list --pretty=oneline --abbrev-commit -1 primary)
@@ -1523,7 +1566,7 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = er
git rebase --continue 2>actual
) &&
test D = $(git cat-file commit HEAD | sed -ne \$p) &&
- test_i18ngrep \
+ test_grep \
"Successfully rebased and updated refs/heads/missing-commit" \
actual
'
@@ -1583,9 +1626,9 @@ test_expect_success 'static check of bad command' '
set_fake_editor &&
test_must_fail env FAKE_LINES="1 2 3 bad 4 5" \
git rebase -i --root 2>actual &&
- test_i18ngrep "badcmd $(git rev-list --oneline -1 primary~1)" \
+ test_grep "pickled $(git rev-list --oneline -1 primary~1)" \
actual &&
- test_i18ngrep "You can fix this with .git rebase --edit-todo.." \
+ test_grep "You can fix this with .git rebase --edit-todo.." \
actual &&
FAKE_LINES="1 2 3 drop 4 5" git rebase --edit-todo
) &&
@@ -1594,6 +1637,32 @@ test_expect_success 'static check of bad command' '
test C = $(git cat-file commit HEAD^ | sed -ne \$p)
'
+test_expect_success 'the first command cannot be a fixup' '
+ rebase_setup_and_clean fixup-first &&
+
+ cat >orig <<-EOF &&
+ fixup $(git log -1 --format="%h %s" B)
+ pick $(git log -1 --format="%h %s" C)
+ EOF
+
+ (
+ set_replace_editor orig &&
+ test_must_fail git rebase -i A 2>actual
+ ) &&
+ grep "cannot .fixup. without a previous commit" actual &&
+ grep "You can fix this with .git rebase --edit-todo.." actual &&
+ # verify that the todo list has not been truncated
+ grep -v "^#" .git/rebase-merge/git-rebase-todo >actual &&
+ test_cmp orig actual &&
+
+ test_must_fail git rebase --edit-todo 2>actual &&
+ grep "cannot .fixup. without a previous commit" actual &&
+ grep "You can fix this with .git rebase --edit-todo.." actual &&
+ # verify that the todo list has not been truncated
+ grep -v "^#" .git/rebase-merge/git-rebase-todo >actual &&
+ test_cmp orig actual
+'
+
test_expect_success 'tabs and spaces are accepted in the todolist' '
rebase_setup_and_clean indented-comment &&
write_script add-indent.sh <<-\EOF &&
@@ -1617,8 +1686,8 @@ test_expect_success 'static check of bad SHA-1' '
set_fake_editor &&
test_must_fail env FAKE_LINES="1 2 edit fakesha 3 4 5 #" \
git rebase -i --root 2>actual &&
- test_i18ngrep "edit XXXXXXX False commit" actual &&
- test_i18ngrep "You can fix this with .git rebase --edit-todo.." \
+ test_grep "edit XXXXXXX False commit" actual &&
+ test_grep "You can fix this with .git rebase --edit-todo.." \
actual &&
FAKE_LINES="1 2 4 5 6" git rebase --edit-todo
) &&
@@ -1645,7 +1714,7 @@ test_expect_success 'rebase -i --gpg-sign=<key-id>' '
FAKE_LINES="edit 1" git rebase -i --gpg-sign="\"S I Gner\"" \
HEAD^ >out 2>err
) &&
- test_i18ngrep "$SQ-S\"S I Gner\"$SQ" err
+ test_grep "$SQ-S\"S I Gner\"$SQ" err
'
test_expect_success 'rebase -i --gpg-sign=<key-id> overrides commit.gpgSign' '
@@ -1656,7 +1725,7 @@ test_expect_success 'rebase -i --gpg-sign=<key-id> overrides commit.gpgSign' '
FAKE_LINES="edit 1" git rebase -i --gpg-sign="\"S I Gner\"" \
HEAD^ >out 2>err
) &&
- test_i18ngrep "$SQ-S\"S I Gner\"$SQ" err
+ test_grep "$SQ-S\"S I Gner\"$SQ" err
'
test_expect_success 'valid author header after --root swap' '
@@ -1710,7 +1779,7 @@ test_expect_success 'correct error message for partial commit after empty pick'
) &&
echo x >file1 &&
test_must_fail git commit file1 2>err &&
- test_i18ngrep "cannot do a partial commit during a rebase." err
+ test_grep "cannot do a partial commit during a rebase." err
'
test_expect_success 'correct error message for commit --amend after empty pick' '
@@ -1723,13 +1792,13 @@ test_expect_success 'correct error message for commit --amend after empty pick'
) &&
echo x>file1 &&
test_must_fail git commit -a --amend 2>err &&
- test_i18ngrep "middle of a rebase -- cannot amend." err
+ test_grep "middle of a rebase -- cannot amend." err
'
test_expect_success 'todo has correct onto hash' '
GIT_SEQUENCE_EDITOR=cat git rebase -i no-conflict-branch~4 no-conflict-branch >actual &&
onto=$(git rev-parse --short HEAD~4) &&
- test_i18ngrep "^# Rebase ..* onto $onto" actual
+ test_grep "^# Rebase ..* onto $onto" actual
'
test_expect_success 'ORIG_HEAD is updated correctly' '
@@ -1743,6 +1812,409 @@ test_expect_success 'ORIG_HEAD is updated correctly' '
test_cmp_rev ORIG_HEAD test-orig-head@{1}
'
+test_expect_success '--update-refs adds label and update-ref commands' '
+ git checkout -b update-refs no-conflict-branch &&
+ git branch -f base HEAD~4 &&
+ git branch -f first HEAD~3 &&
+ git branch -f second HEAD~3 &&
+ git branch -f third HEAD~1 &&
+ git commit --allow-empty --fixup=third &&
+ git branch -f is-not-reordered &&
+ git commit --allow-empty --fixup=HEAD~4 &&
+ git branch -f shared-tip &&
+ (
+ set_cat_todo_editor &&
+
+ cat >expect <<-EOF &&
+ pick $(git log -1 --format=%h J) J
+ fixup $(git log -1 --format=%h update-refs) fixup! J # empty
+ update-ref refs/heads/second
+ update-ref refs/heads/first
+ pick $(git log -1 --format=%h K) K
+ pick $(git log -1 --format=%h L) L
+ fixup $(git log -1 --format=%h is-not-reordered) fixup! L # empty
+ update-ref refs/heads/third
+ pick $(git log -1 --format=%h M) M
+ update-ref refs/heads/no-conflict-branch
+ update-ref refs/heads/is-not-reordered
+ update-ref refs/heads/shared-tip
+ EOF
+
+ test_must_fail git rebase -i --autosquash --update-refs primary >todo &&
+ test_cmp expect todo &&
+
+ test_must_fail git -c rebase.autosquash=true \
+ -c rebase.updaterefs=true \
+ rebase -i primary >todo &&
+
+ test_cmp expect todo
+ )
+'
+
+test_expect_success '--update-refs adds commands with --rebase-merges' '
+ git checkout -b update-refs-with-merge no-conflict-branch &&
+ git branch -f base HEAD~4 &&
+ git branch -f first HEAD~3 &&
+ git branch -f second HEAD~3 &&
+ git branch -f third HEAD~1 &&
+ git merge -m merge branch2 &&
+ git branch -f merge-branch &&
+ git commit --fixup=third --allow-empty &&
+ (
+ set_cat_todo_editor &&
+
+ cat >expect <<-EOF &&
+ label onto
+ reset onto
+ pick $(git log -1 --format=%h branch2~1) F
+ pick $(git log -1 --format=%h branch2) I
+ update-ref refs/heads/branch2
+ label merge
+ reset onto
+ pick $(git log -1 --format=%h refs/heads/second) J
+ update-ref refs/heads/second
+ update-ref refs/heads/first
+ pick $(git log -1 --format=%h refs/heads/third~1) K
+ pick $(git log -1 --format=%h refs/heads/third) L
+ fixup $(git log -1 --format=%h update-refs-with-merge) fixup! L # empty
+ update-ref refs/heads/third
+ pick $(git log -1 --format=%h HEAD~2) M
+ update-ref refs/heads/no-conflict-branch
+ merge -C $(git log -1 --format=%h HEAD~1) merge # merge
+ update-ref refs/heads/merge-branch
+ EOF
+
+ test_must_fail git rebase -i --autosquash \
+ --rebase-merges=rebase-cousins \
+ --update-refs primary >todo &&
+
+ test_cmp expect todo &&
+
+ test_must_fail git -c rebase.autosquash=true \
+ -c rebase.updaterefs=true \
+ rebase -i \
+ --rebase-merges=rebase-cousins \
+ primary >todo &&
+
+ test_cmp expect todo
+ )
+'
+
+test_expect_success '--update-refs updates refs correctly' '
+ git checkout -B update-refs no-conflict-branch &&
+ git branch -f base HEAD~4 &&
+ git branch -f first HEAD~3 &&
+ git branch -f second HEAD~3 &&
+ git branch -f third HEAD~1 &&
+ test_commit extra2 fileX &&
+ git commit --amend --fixup=L &&
+
+ git rebase -i --autosquash --update-refs primary 2>err &&
+
+ test_cmp_rev HEAD~3 refs/heads/first &&
+ test_cmp_rev HEAD~3 refs/heads/second &&
+ test_cmp_rev HEAD~1 refs/heads/third &&
+ test_cmp_rev HEAD refs/heads/no-conflict-branch &&
+
+ cat >expect <<-\EOF &&
+ Successfully rebased and updated refs/heads/update-refs.
+ Updated the following refs with --update-refs:
+ refs/heads/first
+ refs/heads/no-conflict-branch
+ refs/heads/second
+ refs/heads/third
+ EOF
+
+ # Clear "Rebasing (X/Y)" progress lines and drop leading tabs.
+ sed -e "s/Rebasing.*Successfully/Successfully/g" -e "s/^\t//g" \
+ <err >err.trimmed &&
+ test_cmp expect err.trimmed
+'
+
+test_expect_success 'respect user edits to update-ref steps' '
+ git checkout -B update-refs-break no-conflict-branch &&
+ git branch -f base HEAD~4 &&
+ git branch -f first HEAD~3 &&
+ git branch -f second HEAD~3 &&
+ git branch -f third HEAD~1 &&
+ git branch -f unseen base &&
+
+ # First, we will add breaks to the expected todo file
+ cat >fake-todo-1 <<-EOF &&
+ pick $(git rev-parse HEAD~3)
+ break
+ update-ref refs/heads/second
+ update-ref refs/heads/first
+
+ pick $(git rev-parse HEAD~2)
+ pick $(git rev-parse HEAD~1)
+ update-ref refs/heads/third
+
+ pick $(git rev-parse HEAD)
+ update-ref refs/heads/no-conflict-branch
+ EOF
+
+ # Second, we will drop some update-refs commands (and move one)
+ cat >fake-todo-2 <<-EOF &&
+ update-ref refs/heads/second
+
+ pick $(git rev-parse HEAD~2)
+ update-ref refs/heads/third
+ pick $(git rev-parse HEAD~1)
+ break
+
+ pick $(git rev-parse HEAD)
+ EOF
+
+ # Third, we will:
+ # * insert a new one (new-branch),
+ # * re-add an old one (first), and
+ # * add a second instance of a previously-stored one (second)
+ cat >fake-todo-3 <<-EOF &&
+ update-ref refs/heads/unseen
+ update-ref refs/heads/new-branch
+ pick $(git rev-parse HEAD)
+ update-ref refs/heads/first
+ update-ref refs/heads/second
+ EOF
+
+ (
+ set_replace_editor fake-todo-1 &&
+ git rebase -i --update-refs primary &&
+
+ # These branches are currently locked.
+ for b in first second third no-conflict-branch
+ do
+ test_must_fail git branch -f $b base || return 1
+ done &&
+
+ set_replace_editor fake-todo-2 &&
+ git rebase --edit-todo &&
+
+ # These branches are currently locked.
+ for b in second third
+ do
+ test_must_fail git branch -f $b base || return 1
+ done &&
+
+ # These branches are currently unlocked for checkout.
+ for b in first no-conflict-branch
+ do
+ git worktree add wt-$b $b &&
+ git worktree remove wt-$b || return 1
+ done &&
+
+ git rebase --continue &&
+
+ set_replace_editor fake-todo-3 &&
+ git rebase --edit-todo &&
+
+ # These branches are currently locked.
+ for b in second third first unseen
+ do
+ test_must_fail git branch -f $b base || return 1
+ done &&
+
+ # These branches are currently unlocked for checkout.
+ for b in no-conflict-branch
+ do
+ git worktree add wt-$b $b &&
+ git worktree remove wt-$b || return 1
+ done &&
+
+ git rebase --continue
+ ) &&
+
+ test_cmp_rev HEAD~2 refs/heads/third &&
+ test_cmp_rev HEAD~1 refs/heads/unseen &&
+ test_cmp_rev HEAD~1 refs/heads/new-branch &&
+ test_cmp_rev HEAD refs/heads/first &&
+ test_cmp_rev HEAD refs/heads/second &&
+ test_cmp_rev HEAD refs/heads/no-conflict-branch
+'
+
+test_expect_success '--update-refs: all update-ref lines removed' '
+ git checkout -b test-refs-not-removed no-conflict-branch &&
+ git branch -f base HEAD~4 &&
+ git branch -f first HEAD~3 &&
+ git branch -f second HEAD~3 &&
+ git branch -f third HEAD~1 &&
+ git branch -f tip &&
+
+ test_commit test-refs-not-removed &&
+ git commit --amend --fixup first &&
+
+ git rev-parse first second third tip no-conflict-branch >expect-oids &&
+
+ (
+ set_cat_todo_editor &&
+ test_must_fail git rebase -i --update-refs base >todo.raw &&
+ sed -e "/^update-ref/d" <todo.raw >todo
+ ) &&
+ (
+ set_replace_editor todo &&
+ git rebase -i --update-refs base
+ ) &&
+
+ # Ensure refs are not deleted and their OIDs have not changed
+ git rev-parse first second third tip no-conflict-branch >actual-oids &&
+ test_cmp expect-oids actual-oids
+'
+
+test_expect_success '--update-refs: all update-ref lines removed, then some re-added' '
+ git checkout -b test-refs-not-removed2 no-conflict-branch &&
+ git branch -f base HEAD~4 &&
+ git branch -f first HEAD~3 &&
+ git branch -f second HEAD~3 &&
+ git branch -f third HEAD~1 &&
+ git branch -f tip &&
+
+ test_commit test-refs-not-removed2 &&
+ git commit --amend --fixup first &&
+
+ git rev-parse first second third >expect-oids &&
+
+ (
+ set_cat_todo_editor &&
+ test_must_fail git rebase -i \
+ --autosquash --update-refs \
+ base >todo.raw &&
+ sed -e "/^update-ref/d" <todo.raw >todo
+ ) &&
+
+ # Add a break to the end of the todo so we can edit later
+ echo "break" >>todo &&
+
+ (
+ set_replace_editor todo &&
+ git rebase -i --autosquash --update-refs base &&
+ echo "update-ref refs/heads/tip" >todo &&
+ git rebase --edit-todo &&
+ git rebase --continue
+ ) &&
+
+ # Ensure first/second/third are unchanged, but tip is updated
+ git rev-parse first second third >actual-oids &&
+ test_cmp expect-oids actual-oids &&
+ test_cmp_rev HEAD tip
+'
+
+test_expect_success '--update-refs: --edit-todo with no update-ref lines' '
+ git checkout -b test-refs-not-removed3 no-conflict-branch &&
+ git branch -f base HEAD~4 &&
+ git branch -f first HEAD~3 &&
+ git branch -f second HEAD~3 &&
+ git branch -f third HEAD~1 &&
+ git branch -f tip &&
+
+ test_commit test-refs-not-removed3 &&
+ git commit --amend --fixup first &&
+
+ git rev-parse first second third tip no-conflict-branch >expect-oids &&
+
+ (
+ set_cat_todo_editor &&
+ test_must_fail git rebase -i \
+ --autosquash --update-refs \
+ base >todo.raw &&
+ sed -e "/^update-ref/d" <todo.raw >todo
+ ) &&
+
+ # Add a break to the beginning of the todo so we can resume with no
+ # update-ref lines
+ echo "break" >todo.new &&
+ cat todo >>todo.new &&
+
+ (
+ set_replace_editor todo.new &&
+ git rebase -i --autosquash --update-refs base &&
+
+ # Make no changes when editing so update-refs is still empty
+ cat todo >todo.new &&
+ git rebase --edit-todo &&
+ git rebase --continue
+ ) &&
+
+ # Ensure refs are not deleted and their OIDs have not changed
+ git rev-parse first second third tip no-conflict-branch >actual-oids &&
+ test_cmp expect-oids actual-oids
+'
+
+test_expect_success '--update-refs: check failed ref update' '
+ test_when_finished "test_might_fail git rebase --abort" &&
+ git checkout -B update-refs-error no-conflict-branch &&
+ git branch -f base HEAD~4 &&
+ git branch -f first HEAD~3 &&
+ git branch -f second HEAD~2 &&
+ git branch -f third HEAD~1 &&
+
+ cat >fake-todo <<-EOF &&
+ pick $(git rev-parse HEAD~3)
+ break
+ update-ref refs/heads/first
+
+ pick $(git rev-parse HEAD~2)
+ update-ref refs/heads/second
+
+ pick $(git rev-parse HEAD~1)
+ update-ref refs/heads/third
+
+ pick $(git rev-parse HEAD)
+ update-ref refs/heads/no-conflict-branch
+ EOF
+
+ (
+ set_replace_editor fake-todo &&
+ git rebase -i --update-refs base
+ ) &&
+
+ # At this point, the values of first, second, and third are
+ # recorded in the update-refs file. We will force-update the
+ # "second" ref, but "git branch -f" will not work because of
+ # the lock in the update-refs file.
+ git update-ref refs/heads/second third &&
+
+ test_must_fail git rebase --continue 2>err &&
+ grep "update_ref failed for ref '\''refs/heads/second'\''" err &&
+
+ cat >expect <<-\EOF &&
+ Updated the following refs with --update-refs:
+ refs/heads/first
+ refs/heads/no-conflict-branch
+ refs/heads/third
+ Failed to update the following refs with --update-refs:
+ refs/heads/second
+ EOF
+
+ # Clear "Rebasing (X/Y)" progress lines and drop leading tabs.
+ tail -n 6 err >err.last &&
+ sed -e "s/Rebasing.*Successfully/Successfully/g" -e "s/^\t//g" \
+ <err.last >err.trimmed &&
+ test_cmp expect err.trimmed
+'
+
+test_expect_success 'bad labels and refs rejected when parsing todo list' '
+ test_when_finished "test_might_fail git rebase --abort" &&
+ cat >todo <<-\EOF &&
+ exec >execed
+ label #
+ label :invalid
+ update-ref :bad
+ update-ref topic
+ EOF
+ rm -f execed &&
+ (
+ set_replace_editor todo &&
+ test_must_fail git rebase -i HEAD 2>err
+ ) &&
+ grep "'\''#'\'' is not a valid label" err &&
+ grep "'\'':invalid'\'' is not a valid label" err &&
+ grep "'\'':bad'\'' is not a valid refname" err &&
+ grep "update-ref requires a fully qualified refname e.g. refs/heads/topic" \
+ err &&
+ test_path_is_missing execed
+'
+
# This must be the last test in this file
test_expect_success '$EDITOR and friends are unchanged' '
test_editor_unchanged
diff --git a/t/t3405-rebase-malformed.sh b/t/t3405-rebase-malformed.sh
index 2524331..8979bc3 100755
--- a/t/t3405-rebase-malformed.sh
+++ b/t/t3405-rebase-malformed.sh
@@ -5,6 +5,7 @@ test_description='rebase should handle arbitrary git message'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-rebase.sh
diff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh
index d17b450..a1d7fa7 100755
--- a/t/t3406-rebase-message.sh
+++ b/t/t3406-rebase-message.sh
@@ -10,10 +10,16 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
test_expect_success 'setup' '
test_commit O fileO &&
test_commit X fileX &&
+ git branch fast-forward &&
test_commit A fileA &&
test_commit B fileB &&
test_commit Y fileY &&
+ git checkout -b conflicts O &&
+ test_commit P &&
+ test_commit conflict-X fileX &&
+ test_commit Q &&
+
git checkout -b topic O &&
git cherry-pick A B &&
test_commit Z fileZ &&
@@ -27,24 +33,24 @@ test_expect_success 'rebase -m' '
test_expect_success 'rebase against main twice' '
git rebase --apply main >out &&
- test_i18ngrep "Current branch topic is up to date" out
+ test_grep "Current branch topic is up to date" out
'
test_expect_success 'rebase against main twice with --force' '
git rebase --force-rebase --apply main >out &&
- test_i18ngrep "Current branch topic is up to date, rebase forced" out
+ test_grep "Current branch topic is up to date, rebase forced" out
'
test_expect_success 'rebase against main twice from another branch' '
git checkout topic^ &&
git rebase --apply main topic >out &&
- test_i18ngrep "Current branch topic is up to date" out
+ test_grep "Current branch topic is up to date" out
'
test_expect_success 'rebase fast-forward to main' '
git checkout topic^ &&
git rebase --apply topic >out &&
- test_i18ngrep "Fast-forwarded HEAD to topic" out
+ test_grep "Fast-forwarded HEAD to topic" out
'
test_expect_success 'rebase --stat' '
@@ -69,64 +75,175 @@ test_expect_success 'rebase -n overrides config rebase.stat config' '
test_expect_success 'rebase --onto outputs the invalid ref' '
test_must_fail git rebase --onto invalid-ref HEAD HEAD 2>err &&
- test_i18ngrep "invalid-ref" err
+ test_grep "invalid-ref" err
'
test_expect_success 'error out early upon -C<n> or --whitespace=<bad>' '
test_must_fail git rebase -Cnot-a-number HEAD 2>err &&
- test_i18ngrep "numerical value" err &&
+ test_grep "numerical value" err &&
test_must_fail git rebase --whitespace=bad HEAD 2>err &&
- test_i18ngrep "Invalid whitespace option" err
+ test_grep "Invalid whitespace option" err
'
-test_expect_success 'GIT_REFLOG_ACTION' '
- git checkout start &&
- test_commit reflog-onto &&
- git checkout -b reflog-topic start &&
- test_commit reflog-to-rebase &&
+write_reflog_expect () {
+ if test $mode = --apply
+ then
+ sed 's/(continue)/(pick)/'
+ else
+ cat
+ fi >expect
+}
- git rebase reflog-onto &&
- git log -g --format=%gs -3 >actual &&
- cat >expect <<-\EOF &&
- rebase (finish): returning to refs/heads/reflog-topic
- rebase (pick): reflog-to-rebase
- rebase (start): checkout reflog-onto
+test_reflog () {
+ mode=$1
+ reflog_action="$2"
+
+ test_expect_success "rebase $mode reflog${reflog_action:+ GIT_REFLOG_ACTION=$reflog_action}" '
+ git checkout conflicts &&
+ test_when_finished "git reset --hard Q" &&
+
+ (
+ if test -n "$reflog_action"
+ then
+ GIT_REFLOG_ACTION="$reflog_action" &&
+ export GIT_REFLOG_ACTION
+ fi &&
+ test_must_fail git rebase $mode main &&
+ echo resolved >fileX &&
+ git add fileX &&
+ git rebase --continue
+ ) &&
+
+ git log -g --format=%gs -5 >actual &&
+ write_reflog_expect <<-EOF &&
+ ${reflog_action:-rebase} (finish): returning to refs/heads/conflicts
+ ${reflog_action:-rebase} (pick): Q
+ ${reflog_action:-rebase} (continue): conflict-X
+ ${reflog_action:-rebase} (pick): P
+ ${reflog_action:-rebase} (start): checkout main
EOF
test_cmp expect actual &&
- git checkout -b reflog-prefix reflog-to-rebase &&
- GIT_REFLOG_ACTION=change-the-reflog git rebase reflog-onto &&
- git log -g --format=%gs -3 >actual &&
- cat >expect <<-\EOF &&
- change-the-reflog (finish): returning to refs/heads/reflog-prefix
- change-the-reflog (pick): reflog-to-rebase
- change-the-reflog (start): checkout reflog-onto
+ git log -g --format=%gs -1 conflicts >actual &&
+ write_reflog_expect <<-EOF &&
+ ${reflog_action:-rebase} (finish): refs/heads/conflicts onto $(git rev-parse main)
+ EOF
+ test_cmp expect actual &&
+
+ # check there is only one new entry in the branch reflog
+ test_cmp_rev conflicts@{1} Q
+ '
+
+ test_expect_success "rebase $mode fast-forward reflog${reflog_action:+ GIT_REFLOG_ACTION=$reflog_action}" '
+ git checkout fast-forward &&
+ test_when_finished "git reset --hard X" &&
+
+ (
+ if test -n "$reflog_action"
+ then
+ GIT_REFLOG_ACTION="$reflog_action" &&
+ export GIT_REFLOG_ACTION
+ fi &&
+ git rebase $mode main
+ ) &&
+
+ git log -g --format=%gs -2 >actual &&
+ write_reflog_expect <<-EOF &&
+ ${reflog_action:-rebase} (finish): returning to refs/heads/fast-forward
+ ${reflog_action:-rebase} (start): checkout main
+ EOF
+ test_cmp expect actual &&
+
+ git log -g --format=%gs -1 fast-forward >actual &&
+ write_reflog_expect <<-EOF &&
+ ${reflog_action:-rebase} (finish): refs/heads/fast-forward onto $(git rev-parse main)
+ EOF
+ test_cmp expect actual &&
+
+ # check there is only one new entry in the branch reflog
+ test_cmp_rev fast-forward@{1} X
+ '
+
+ test_expect_success "rebase $mode --skip reflog${reflog_action:+ GIT_REFLOG_ACTION=$reflog_action}" '
+ git checkout conflicts &&
+ test_when_finished "git reset --hard Q" &&
+
+ (
+ if test -n "$reflog_action"
+ then
+ GIT_REFLOG_ACTION="$reflog_action" &&
+ export GIT_REFLOG_ACTION
+ fi &&
+ test_must_fail git rebase $mode main &&
+ git rebase --skip
+ ) &&
+
+ git log -g --format=%gs -4 >actual &&
+ write_reflog_expect <<-EOF &&
+ ${reflog_action:-rebase} (finish): returning to refs/heads/conflicts
+ ${reflog_action:-rebase} (pick): Q
+ ${reflog_action:-rebase} (pick): P
+ ${reflog_action:-rebase} (start): checkout main
EOF
test_cmp expect actual
-'
+ '
-test_expect_success 'rebase --apply reflog' '
- git checkout -b reflog-apply start &&
- old_head_reflog="$(git log -g --format=%gs -1 HEAD)" &&
+ test_expect_success "rebase $mode --abort reflog${reflog_action:+ GIT_REFLOG_ACTION=$reflog_action}" '
+ git checkout conflicts &&
+ test_when_finished "git reset --hard Q" &&
- git rebase --apply Y &&
+ git log -g -1 conflicts >branch-expect &&
+ (
+ if test -n "$reflog_action"
+ then
+ GIT_REFLOG_ACTION="$reflog_action" &&
+ export GIT_REFLOG_ACTION
+ fi &&
+ test_must_fail git rebase $mode main &&
+ git rebase --abort
+ ) &&
- git log -g --format=%gs -4 HEAD >actual &&
- cat >expect <<-EOF &&
- rebase finished: returning to refs/heads/reflog-apply
- rebase: Z
- rebase: checkout Y
- $old_head_reflog
+ git log -g --format=%gs -3 >actual &&
+ write_reflog_expect <<-EOF &&
+ ${reflog_action:-rebase} (abort): returning to refs/heads/conflicts
+ ${reflog_action:-rebase} (pick): P
+ ${reflog_action:-rebase} (start): checkout main
EOF
test_cmp expect actual &&
- git log -g --format=%gs -2 reflog-apply >actual &&
- cat >expect <<-EOF &&
- rebase finished: refs/heads/reflog-apply onto $(git rev-parse Y)
- branch: Created from start
+ # check branch reflog is unchanged
+ git log -g -1 conflicts >branch-actual &&
+ test_cmp branch-expect branch-actual
+ '
+
+ test_expect_success "rebase $mode --abort detached HEAD reflog${reflog_action:+ GIT_REFLOG_ACTION=$reflog_action}" '
+ git checkout Q &&
+ test_when_finished "git reset --hard Q" &&
+
+ (
+ if test -n "$reflog_action"
+ then
+ GIT_REFLOG_ACTION="$reflog_action" &&
+ export GIT_REFLOG_ACTION
+ fi &&
+ test_must_fail git rebase $mode main &&
+ git rebase --abort
+ ) &&
+
+ git log -g --format=%gs -3 >actual &&
+ write_reflog_expect <<-EOF &&
+ ${reflog_action:-rebase} (abort): returning to $(git rev-parse Q)
+ ${reflog_action:-rebase} (pick): P
+ ${reflog_action:-rebase} (start): checkout main
EOF
test_cmp expect actual
-'
+ '
+}
+
+test_reflog --merge
+test_reflog --merge my-reflog-action
+test_reflog --apply
+test_reflog --apply my-reflog-action
test_expect_success 'rebase -i onto unrelated history' '
git init unrelated &&
@@ -134,8 +251,8 @@ test_expect_success 'rebase -i onto unrelated history' '
git -C unrelated remote add -f origin "$PWD" &&
git -C unrelated branch --set-upstream-to=origin/main &&
git -C unrelated -c core.editor=true rebase -i -v --stat >actual &&
- test_i18ngrep "Changes to " actual &&
- test_i18ngrep "5 files changed" actual
+ test_grep "Changes to " actual &&
+ test_grep "5 files changed" actual
'
test_done
diff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh
index ebbaed1..9f49c42 100755
--- a/t/t3407-rebase-abort.sh
+++ b/t/t3407-rebase-abort.sh
@@ -40,9 +40,24 @@ testrebase() {
test_path_is_missing "$state_dir"
'
+ test_expect_success "pre rebase$type head is marked as reachable" '
+ # Clean up the state from the previous one
+ git checkout -f --detach pre-rebase &&
+ test_tick &&
+ git commit --amend --only -m "reworded" &&
+ orig_head=$(git rev-parse HEAD) &&
+ test_must_fail git rebase$type main &&
+ # Stop ORIG_HEAD marking $state_dir/orig-head as reachable
+ git update-ref -d ORIG_HEAD &&
+ git reflog expire --expire="$GIT_COMMITTER_DATE" --all &&
+ git prune --expire=now &&
+ git rebase --abort &&
+ test_cmp_rev $orig_head HEAD
+ '
+
test_expect_success "rebase$type --abort after --skip" '
# Clean up the state from the previous one
- git reset --hard pre-rebase &&
+ git checkout -B to-rebase pre-rebase &&
test_must_fail git rebase$type main &&
test_path_is_dir "$state_dir" &&
test_must_fail git rebase --skip &&
diff --git a/t/t3409-rebase-environ.sh b/t/t3409-rebase-environ.sh
index 83ffb39..acaf555 100755
--- a/t/t3409-rebase-environ.sh
+++ b/t/t3409-rebase-environ.sh
@@ -2,6 +2,7 @@
test_description='git rebase interactive environment'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
diff --git a/t/t3412-rebase-root.sh b/t/t3412-rebase-root.sh
index 58371d8..e75b3d0 100755
--- a/t/t3412-rebase-root.sh
+++ b/t/t3412-rebase-root.sh
@@ -7,6 +7,7 @@ Tests if git rebase --root --onto <newparent> can rebase the root commit.
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
log_with_names () {
diff --git a/t/t3413-rebase-hook.sh b/t/t3413-rebase-hook.sh
index 9fab0d7..e845683 100755
--- a/t/t3413-rebase-hook.sh
+++ b/t/t3413-rebase-hook.sh
@@ -5,6 +5,7 @@ test_description='git rebase with its hook(s)'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh
index 78c2749..fcc40d6 100755
--- a/t/t3415-rebase-autosquash.sh
+++ b/t/t3415-rebase-autosquash.sh
@@ -43,7 +43,7 @@ test_auto_fixup () {
git tag $1 &&
test_tick &&
- git rebase $2 -i HEAD^^^ &&
+ git rebase $2 HEAD^^^ &&
git log --oneline >actual &&
if test -n "$no_squash"
then
@@ -61,15 +61,24 @@ test_auto_fixup () {
}
test_expect_success 'auto fixup (option)' '
- test_auto_fixup final-fixup-option --autosquash
+ test_auto_fixup fixup-option --autosquash &&
+ test_auto_fixup fixup-option-i "--autosquash -i"
'
-test_expect_success 'auto fixup (config)' '
+test_expect_success 'auto fixup (config true)' '
git config rebase.autosquash true &&
- test_auto_fixup final-fixup-config-true &&
+ test_auto_fixup ! fixup-config-true &&
+ test_auto_fixup fixup-config-true-i -i &&
test_auto_fixup ! fixup-config-true-no --no-autosquash &&
+ test_auto_fixup ! fixup-config-true-i-no "-i --no-autosquash"
+'
+
+test_expect_success 'auto fixup (config false)' '
git config rebase.autosquash false &&
- test_auto_fixup ! final-fixup-config-false
+ test_auto_fixup ! fixup-config-false &&
+ test_auto_fixup ! fixup-config-false-i -i &&
+ test_auto_fixup fixup-config-false-yes --autosquash &&
+ test_auto_fixup fixup-config-false-i-yes "-i --autosquash"
'
test_auto_squash () {
@@ -87,7 +96,7 @@ test_auto_squash () {
git commit -m "squash! first" -m "extra para for first" &&
git tag $1 &&
test_tick &&
- git rebase $2 -i HEAD^^^ &&
+ git rebase $2 HEAD^^^ &&
git log --oneline >actual &&
if test -n "$no_squash"
then
@@ -105,15 +114,24 @@ test_auto_squash () {
}
test_expect_success 'auto squash (option)' '
- test_auto_squash final-squash --autosquash
+ test_auto_squash squash-option --autosquash &&
+ test_auto_squash squash-option-i "--autosquash -i"
'
-test_expect_success 'auto squash (config)' '
+test_expect_success 'auto squash (config true)' '
git config rebase.autosquash true &&
- test_auto_squash final-squash-config-true &&
+ test_auto_squash ! squash-config-true &&
+ test_auto_squash squash-config-true-i -i &&
test_auto_squash ! squash-config-true-no --no-autosquash &&
+ test_auto_squash ! squash-config-true-i-no "-i --no-autosquash"
+'
+
+test_expect_success 'auto squash (config false)' '
git config rebase.autosquash false &&
- test_auto_squash ! final-squash-config-false
+ test_auto_squash ! squash-config-false &&
+ test_auto_squash ! squash-config-false-i -i &&
+ test_auto_squash squash-config-false-yes --autosquash &&
+ test_auto_squash squash-config-false-i-yes "-i --autosquash"
'
test_expect_success 'misspelled auto squash' '
@@ -232,6 +250,19 @@ test_expect_success 'auto squash that matches longer sha1' '
test_line_count = 1 actual
'
+test_expect_success 'auto squash of fixup commit that matches branch name which points back to fixup commit' '
+ git reset --hard base &&
+ git commit --allow-empty -m "fixup! self-cycle" &&
+ git branch self-cycle &&
+ GIT_SEQUENCE_EDITOR="cat >tmp" git rebase --autosquash -i HEAD^^ &&
+ sed -ne "/^[^#]/{s/[0-9a-f]\{7,\}/HASH/g;p;}" tmp >actual &&
+ cat <<-EOF >expect &&
+ pick HASH second commit
+ pick HASH fixup! self-cycle # empty
+ EOF
+ test_cmp expect actual
+'
+
test_auto_commit_flags () {
git reset --hard base &&
echo 1 >file1 &&
diff --git a/t/t3416-rebase-onto-threedots.sh b/t/t3416-rebase-onto-threedots.sh
index 3e04802..f8c4ed7 100755
--- a/t/t3416-rebase-onto-threedots.sh
+++ b/t/t3416-rebase-onto-threedots.sh
@@ -5,6 +5,7 @@ test_description='git rebase --onto A...B'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY/lib-rebase.sh"
@@ -79,8 +80,10 @@ test_expect_success 'rebase -i --onto main...topic' '
git reset --hard &&
git checkout topic &&
git reset --hard G &&
- set_fake_editor &&
- EXPECT_COUNT=1 git rebase -i --onto main...topic F &&
+ (
+ set_fake_editor &&
+ EXPECT_COUNT=1 git rebase -i --onto main...topic F
+ ) &&
git rev-parse HEAD^1 >actual &&
git rev-parse C^0 >expect &&
test_cmp expect actual
@@ -90,20 +93,22 @@ test_expect_success 'rebase -i --onto main...' '
git reset --hard &&
git checkout topic &&
git reset --hard G &&
- set_fake_editor &&
- EXPECT_COUNT=1 git rebase -i --onto main... F &&
+ (
+ set_fake_editor &&
+ EXPECT_COUNT=1 git rebase -i --onto main... F
+ ) &&
git rev-parse HEAD^1 >actual &&
git rev-parse C^0 >expect &&
test_cmp expect actual
'
-test_expect_success 'rebase -i --onto main...side' '
+test_expect_success 'rebase --onto main...side requires a single merge-base' '
git reset --hard &&
git checkout side &&
git reset --hard K &&
- set_fake_editor &&
- test_must_fail git rebase -i --onto main...side J
+ test_must_fail git rebase -i --onto main...side J 2>err &&
+ grep "need exactly one merge base" err
'
test_expect_success 'rebase --keep-base --onto incompatible' '
@@ -156,8 +161,10 @@ test_expect_success 'rebase -i --keep-base main from topic' '
git checkout topic &&
git reset --hard G &&
- set_fake_editor &&
- EXPECT_COUNT=2 git rebase -i --keep-base main &&
+ (
+ set_fake_editor &&
+ EXPECT_COUNT=2 git rebase -i --keep-base main
+ ) &&
git rev-parse C >base.expect &&
git merge-base main HEAD >base.actual &&
test_cmp base.expect base.actual &&
@@ -171,8 +178,10 @@ test_expect_success 'rebase -i --keep-base main topic from main' '
git checkout main &&
git branch -f topic G &&
- set_fake_editor &&
- EXPECT_COUNT=2 git rebase -i --keep-base main topic &&
+ (
+ set_fake_editor &&
+ EXPECT_COUNT=2 git rebase -i --keep-base main topic
+ ) &&
git rev-parse C >base.expect &&
git merge-base main HEAD >base.actual &&
test_cmp base.expect base.actual &&
@@ -182,13 +191,39 @@ test_expect_success 'rebase -i --keep-base main topic from main' '
test_cmp expect actual
'
-test_expect_success 'rebase -i --keep-base main from side' '
+test_expect_success 'rebase --keep-base requires a single merge base' '
git reset --hard &&
git checkout side &&
git reset --hard K &&
- set_fake_editor &&
- test_must_fail git rebase -i --keep-base main
+ test_must_fail git rebase -i --keep-base main 2>err &&
+ grep "need exactly one merge base with branch" err
+'
+
+test_expect_success 'rebase --keep-base keeps cherry picks' '
+ git checkout -f -B main E &&
+ git cherry-pick F &&
+ (
+ set_fake_editor &&
+ EXPECT_COUNT=2 git rebase -i --keep-base HEAD G
+ ) &&
+ test_cmp_rev HEAD G
+'
+
+test_expect_success 'rebase --keep-base --no-reapply-cherry-picks' '
+ git checkout -f -B main E &&
+ git cherry-pick F &&
+ (
+ set_fake_editor &&
+ EXPECT_COUNT=1 git rebase -i --keep-base \
+ --no-reapply-cherry-picks HEAD G
+ ) &&
+ test_cmp_rev HEAD^ C
+'
+
+# This must be the last test in this file
+test_expect_success '$EDITOR and friends are unchanged' '
+ test_editor_unchanged
'
test_done
diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh
index 130e2f9..127216f 100755
--- a/t/t3418-rebase-continue.sh
+++ b/t/t3418-rebase-continue.sh
@@ -62,61 +62,39 @@ test_expect_success 'rebase --continue remembers merge strategy and options' '
rm -fr .git/rebase-* &&
git reset --hard commit-new-file-F2-on-topic-branch &&
test_commit "commit-new-file-F3-on-topic-branch" F3 32 &&
- test_when_finished "rm -fr test-bin funny.was.run" &&
+ test_when_finished "rm -fr test-bin" &&
mkdir test-bin &&
- cat >test-bin/git-merge-funny <<-EOF &&
- #!$SHELL_PATH
- case "\$1" in --opt) ;; *) exit 2 ;; esac
- shift &&
- >funny.was.run &&
- exec git merge-recursive "\$@"
+
+ write_script test-bin/git-merge-funny <<-\EOF &&
+ printf "[%s]\n" $# "$1" "$2" "$3" "$5" >actual
+ shift 3 &&
+ exec git merge-recursive "$@"
EOF
- chmod +x test-bin/git-merge-funny &&
- (
- PATH=./test-bin:$PATH &&
- test_must_fail git rebase -s funny -Xopt main topic
- ) &&
- test -f funny.was.run &&
- rm funny.was.run &&
- echo "Resolved" >F2 &&
- git add F2 &&
- (
- PATH=./test-bin:$PATH &&
- git rebase --continue
- ) &&
- test -f funny.was.run
-'
-test_expect_success 'rebase -i --continue handles merge strategy and options' '
- rm -fr .git/rebase-* &&
- git reset --hard commit-new-file-F2-on-topic-branch &&
- test_commit "commit-new-file-F3-on-topic-branch-for-dash-i" F3 32 &&
- test_when_finished "rm -fr test-bin funny.was.run funny.args" &&
- mkdir test-bin &&
- cat >test-bin/git-merge-funny <<-EOF &&
- #!$SHELL_PATH
- echo "\$@" >>funny.args
- case "\$1" in --opt) ;; *) exit 2 ;; esac
- case "\$2" in --foo) ;; *) exit 2 ;; esac
- case "\$4" in --) ;; *) exit 2 ;; esac
- shift 2 &&
- >funny.was.run &&
- exec git merge-recursive "\$@"
+ cat >expect <<-\EOF &&
+ [7]
+ [--option=arg with space]
+ [--op"tion\]
+ [--new
+ line ]
+ [--]
EOF
- chmod +x test-bin/git-merge-funny &&
+
+ rm -f actual &&
(
PATH=./test-bin:$PATH &&
- test_must_fail git rebase -i -s funny -Xopt -Xfoo main topic
+ test_must_fail git rebase -s funny -X"option=arg with space" \
+ -Xop\"tion\\ -X"new${LF}line " main topic
) &&
- test -f funny.was.run &&
- rm funny.was.run &&
+ test_cmp expect actual &&
+ rm actual &&
echo "Resolved" >F2 &&
git add F2 &&
(
PATH=./test-bin:$PATH &&
git rebase --continue
) &&
- test -f funny.was.run
+ test_cmp expect actual
'
test_expect_success 'rebase -r passes merge strategy options correctly' '
@@ -137,15 +115,23 @@ test_expect_success '--skip after failed fixup cleans commit message' '
test_when_finished "test_might_fail git rebase --abort" &&
git checkout -b with-conflicting-fixup &&
test_commit wants-fixup &&
- test_commit "fixup! wants-fixup" wants-fixup.t 1 wants-fixup-1 &&
- test_commit "fixup! wants-fixup" wants-fixup.t 2 wants-fixup-2 &&
- test_commit "fixup! wants-fixup" wants-fixup.t 3 wants-fixup-3 &&
+ test_commit "fixup 1" wants-fixup.t 1 wants-fixup-1 &&
+ test_commit "fixup 2" wants-fixup.t 2 wants-fixup-2 &&
+ test_commit "fixup 3" wants-fixup.t 3 wants-fixup-3 &&
test_must_fail env FAKE_LINES="1 fixup 2 squash 4" \
git rebase -i HEAD~4 &&
: now there is a conflict, and comments in the commit message &&
- git show HEAD >out &&
- grep "fixup! wants-fixup" out &&
+ test_commit_message HEAD <<-\EOF &&
+ # This is a combination of 2 commits.
+ # This is the 1st commit message:
+
+ wants-fixup
+
+ # The commit message #2 will be skipped:
+
+ # fixup 1
+ EOF
: skip and continue &&
echo "cp \"\$1\" .git/copy.txt" | write_script copy-editor.sh &&
@@ -155,33 +141,49 @@ test_expect_success '--skip after failed fixup cleans commit message' '
test_path_is_missing .git/copy.txt &&
: now the comments in the commit message should have been cleaned up &&
- git show HEAD >out &&
- ! grep "fixup! wants-fixup" out &&
+ test_commit_message HEAD -m wants-fixup &&
: now, let us ensure that "squash" is handled correctly &&
git reset --hard wants-fixup-3 &&
- test_must_fail env FAKE_LINES="1 squash 4 squash 2 squash 4" \
+ test_must_fail env FAKE_LINES="1 squash 2 squash 1 squash 3 squash 1" \
git rebase -i HEAD~4 &&
- : the first squash failed, but there are two more in the chain &&
+ : the second squash failed, but there are two more in the chain &&
(test_set_editor "$PWD/copy-editor.sh" &&
test_must_fail git rebase --skip) &&
: not the final squash, no need to edit the commit message &&
test_path_is_missing .git/copy.txt &&
- : The first squash was skipped, therefore: &&
- git show HEAD >out &&
- test_i18ngrep "# This is a combination of 2 commits" out &&
- test_i18ngrep "# This is the commit message #2:" out &&
+ : The first and third squashes succeeded, therefore: &&
+ test_commit_message HEAD <<-\EOF &&
+ # This is a combination of 3 commits.
+ # This is the 1st commit message:
+
+ wants-fixup
+
+ # This is the commit message #2:
+
+ fixup 1
+
+ # This is the commit message #3:
+
+ fixup 2
+ EOF
(test_set_editor "$PWD/copy-editor.sh" && git rebase --skip) &&
- git show HEAD >out &&
- test_i18ngrep ! "# This is a combination" out &&
+ test_commit_message HEAD <<-\EOF &&
+ wants-fixup
+
+ fixup 1
+
+ fixup 2
+ EOF
: Final squash failed, but there was still a squash &&
- test_i18ngrep "# This is a combination of 2 commits" .git/copy.txt &&
- test_i18ngrep "# This is the commit message #2:" .git/copy.txt
+ head -n1 .git/copy.txt >first-line &&
+ test_grep "# This is a combination of 3 commits" first-line &&
+ test_grep "# This is the commit message #3:" .git/copy.txt
'
test_expect_success 'setup rerere database' '
@@ -266,6 +268,24 @@ test_expect_success 'the todo command "break" works' '
test_path_is_file execed
'
+test_expect_success 'patch file is removed before break command' '
+ test_when_finished "git rebase --abort" &&
+ cat >todo <<-\EOF &&
+ pick commit-new-file-F2-on-topic-branch
+ break
+ EOF
+
+ (
+ set_replace_editor todo &&
+ test_must_fail git rebase -i --onto commit-new-file-F2 HEAD
+ ) &&
+ test_path_is_file .git/rebase-merge/patch &&
+ echo 22>F2 &&
+ git add F2 &&
+ git rebase --continue &&
+ test_path_is_missing .git/rebase-merge/patch
+'
+
test_expect_success '--reschedule-failed-exec' '
test_when_finished "git rebase --abort" &&
test_must_fail git rebase -x false --reschedule-failed-exec HEAD^ &&
@@ -274,7 +294,7 @@ test_expect_success '--reschedule-failed-exec' '
test_must_fail git -c rebase.rescheduleFailedExec=true \
rebase -x false HEAD^ 2>err &&
grep "^exec false" .git/rebase-merge/git-rebase-todo &&
- test_i18ngrep "has been rescheduled" err
+ test_grep "has been rescheduled" err
'
test_expect_success 'rebase.rescheduleFailedExec only affects `rebase -i`' '
diff --git a/t/t3419-rebase-patch-id.sh b/t/t3419-rebase-patch-id.sh
index 295040f..6c61f24 100755
--- a/t/t3419-rebase-patch-id.sh
+++ b/t/t3419-rebase-patch-id.sh
@@ -5,6 +5,7 @@ test_description='git rebase - test patch id computation'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
scramble () {
@@ -43,15 +44,26 @@ test_expect_success 'setup: 500 lines' '
git add newfile &&
git commit -q -m "add small file" &&
- git cherry-pick main >/dev/null 2>&1
-'
+ git cherry-pick main >/dev/null 2>&1 &&
+
+ git branch -f squashed main &&
+ git checkout -q -f squashed &&
+ git reset -q --soft HEAD~2 &&
+ git commit -q -m squashed &&
+
+ git branch -f mode main &&
+ git checkout -q -f mode &&
+ test_chmod +x file &&
+ git commit -q -a --amend &&
-test_expect_success 'setup attributes' '
- echo "file binary" >.gitattributes
+ git branch -f modeother other &&
+ git checkout -q -f modeother &&
+ test_chmod +x file &&
+ git commit -q -a --amend
'
test_expect_success 'detect upstream patch' '
- git checkout -q main &&
+ git checkout -q main^{} &&
scramble file &&
git add file &&
git commit -q -m "change big file again" &&
@@ -61,14 +73,46 @@ test_expect_success 'detect upstream patch' '
test_must_be_empty revs
'
+test_expect_success 'detect upstream patch binary' '
+ echo "file binary" >.gitattributes &&
+ git checkout -q other^{} &&
+ git rebase main &&
+ git rev-list main...HEAD~ >revs &&
+ test_must_be_empty revs &&
+ test_when_finished "rm .gitattributes"
+'
+
+test_expect_success 'detect upstream patch modechange' '
+ git checkout -q modeother^{} &&
+ git rebase mode &&
+ git rev-list mode...HEAD~ >revs &&
+ test_must_be_empty revs
+'
+
test_expect_success 'do not drop patch' '
- git branch -f squashed main &&
- git checkout -q -f squashed &&
- git reset -q --soft HEAD~2 &&
- git commit -q -m squashed &&
git checkout -q other^{} &&
test_must_fail git rebase squashed &&
- git rebase --quit
+ test_when_finished "git rebase --abort"
+'
+
+test_expect_success 'do not drop patch binary' '
+ echo "file binary" >.gitattributes &&
+ git checkout -q other^{} &&
+ test_must_fail git rebase squashed &&
+ test_when_finished "git rebase --abort" &&
+ test_when_finished "rm .gitattributes"
+'
+
+test_expect_success 'do not drop patch modechange' '
+ git checkout -q modeother^{} &&
+ git rebase other &&
+ cat >expected <<-\EOF &&
+ diff --git a/file b/file
+ old mode 100644
+ new mode 100755
+ EOF
+ git diff HEAD~ >modediff &&
+ test_cmp expected modediff
'
test_done
diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh
index 43fcb68..1a820f1 100755
--- a/t/t3420-rebase-autostash.sh
+++ b/t/t3420-rebase-autostash.sh
@@ -310,7 +310,7 @@ test_expect_success 'autostash is saved on editor failure with conflict' '
test_expect_success 'autostash with dirty submodules' '
test_when_finished "git reset --hard && git checkout main" &&
git checkout -b with-submodule &&
- git submodule add ./ sub &&
+ git -c protocol.file.allow=always submodule add ./ sub &&
test_tick &&
git commit -m add-submodule &&
echo changed >sub/file0 &&
@@ -333,4 +333,14 @@ test_expect_success 'never change active branch' '
test_cmp_rev not-the-feature-branch unrelated-onto-branch
'
+test_expect_success 'autostash commit is marked as reachable' '
+ echo changed >file0 &&
+ git rebase --autostash --exec "git prune --expire=now" \
+ feature-branch^ feature-branch &&
+ # git rebase succeeds if the stash cannot be applied so we need to check
+ # the contents of file0
+ echo changed >expect &&
+ test_cmp expect file0
+'
+
test_done
diff --git a/t/t3422-rebase-incompatible-options.sh b/t/t3422-rebase-incompatible-options.sh
index 6dabb05..b40f262 100755
--- a/t/t3422-rebase-incompatible-options.sh
+++ b/t/t3422-rebase-incompatible-options.sh
@@ -25,11 +25,11 @@ test_expect_success 'setup' '
'
#
-# Rebase has lots of useful options like --whitepsace=fix, which are
-# actually all built in terms of flags to git-am. Since neither
-# --merge nor --interactive (nor any options that imply those two) use
-# git-am, using them together will result in flags like --whitespace=fix
-# being ignored. Make sure rebase warns the user and aborts instead.
+# Rebase has a couple options which are specific to the apply backend,
+# and several options which are specific to the merge backend. Flags
+# from the different sets cannot work together, and we do not want to
+# just ignore one of the sets of flags. Make sure rebase warns the
+# user and aborts instead.
#
test_rebase_am_only () {
@@ -50,6 +50,11 @@ test_rebase_am_only () {
test_must_fail git rebase $opt --strategy-option=ours A
"
+ test_expect_success "$opt incompatible with --autosquash" "
+ git checkout B^0 &&
+ test_must_fail git rebase $opt --autosquash A
+ "
+
test_expect_success "$opt incompatible with --interactive" "
git checkout B^0 &&
test_must_fail git rebase $opt --interactive A
@@ -60,9 +65,70 @@ test_rebase_am_only () {
test_must_fail git rebase $opt --exec 'true' A
"
+ test_expect_success "$opt incompatible with --keep-empty" "
+ git checkout B^0 &&
+ test_must_fail git rebase $opt --keep-empty A
+ "
+
+ test_expect_success "$opt incompatible with --empty=..." "
+ git checkout B^0 &&
+ test_must_fail git rebase $opt --empty=ask A
+ "
+
+ test_expect_success "$opt incompatible with --no-reapply-cherry-picks" "
+ git checkout B^0 &&
+ test_must_fail git rebase $opt --no-reapply-cherry-picks A
+ "
+
+ test_expect_success "$opt incompatible with --reapply-cherry-picks" "
+ git checkout B^0 &&
+ test_must_fail git rebase $opt --reapply-cherry-picks A
+ "
+
+ test_expect_success "$opt incompatible with --rebase-merges" "
+ git checkout B^0 &&
+ test_must_fail git rebase $opt --rebase-merges A
+ "
+
+ test_expect_success "$opt incompatible with --update-refs" "
+ git checkout B^0 &&
+ test_must_fail git rebase $opt --update-refs A
+ "
+
+ test_expect_success "$opt incompatible with --root without --onto" "
+ git checkout B^0 &&
+ test_must_fail git rebase $opt --root A
+ "
+
+ test_expect_success "$opt incompatible with rebase.rebaseMerges" "
+ git checkout B^0 &&
+ test_must_fail git -c rebase.rebaseMerges=true rebase $opt A 2>err &&
+ grep -e --no-rebase-merges err
+ "
+
+ test_expect_success "$opt incompatible with rebase.updateRefs" "
+ git checkout B^0 &&
+ test_must_fail git -c rebase.updateRefs=true rebase $opt A 2>err &&
+ grep -e --no-update-refs err
+ "
+
+ test_expect_success "$opt okay with overridden rebase.rebaseMerges" "
+ test_when_finished \"git reset --hard B^0\" &&
+ git checkout B^0 &&
+ git -c rebase.rebaseMerges=true rebase --no-rebase-merges $opt A
+ "
+
+ test_expect_success "$opt okay with overridden rebase.updateRefs" "
+ test_when_finished \"git reset --hard B^0\" &&
+ git checkout B^0 &&
+ git -c rebase.updateRefs=true rebase --no-update-refs $opt A
+ "
}
+# Check options which imply --apply
test_rebase_am_only --whitespace=fix
test_rebase_am_only -C4
+# Also check an explicit --apply
+test_rebase_am_only --apply
test_done
diff --git a/t/t3423-rebase-reword.sh b/t/t3423-rebase-reword.sh
index 4859bb8..2fab703 100755
--- a/t/t3423-rebase-reword.sh
+++ b/t/t3423-rebase-reword.sh
@@ -2,6 +2,7 @@
test_description='git rebase interactive with rewording'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-rebase.sh
diff --git a/t/t3424-rebase-empty.sh b/t/t3424-rebase-empty.sh
index 5e1045a..1ee6b00 100755
--- a/t/t3424-rebase-empty.sh
+++ b/t/t3424-rebase-empty.sh
@@ -72,6 +72,17 @@ test_expect_success 'rebase --merge --empty=keep' '
test_cmp expect actual
'
+test_expect_success 'rebase --merge --empty=stop' '
+ git checkout -B testing localmods &&
+ test_must_fail git rebase --merge --empty=stop upstream &&
+
+ git rebase --skip &&
+
+ test_write_lines D C B A >expect &&
+ git log --format=%s >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'rebase --merge --empty=ask' '
git checkout -B testing localmods &&
test_must_fail git rebase --merge --empty=ask upstream &&
@@ -101,9 +112,9 @@ test_expect_success 'rebase --interactive --empty=keep' '
test_cmp expect actual
'
-test_expect_success 'rebase --interactive --empty=ask' '
+test_expect_success 'rebase --interactive --empty=stop' '
git checkout -B testing localmods &&
- test_must_fail git rebase --interactive --empty=ask upstream &&
+ test_must_fail git rebase --interactive --empty=stop upstream &&
git rebase --skip &&
@@ -112,7 +123,7 @@ test_expect_success 'rebase --interactive --empty=ask' '
test_cmp expect actual
'
-test_expect_success 'rebase --interactive uses default of --empty=ask' '
+test_expect_success 'rebase --interactive uses default of --empty=stop' '
git checkout -B testing localmods &&
test_must_fail git rebase --interactive upstream &&
@@ -167,4 +178,42 @@ test_expect_success 'rebase --merge does not leave state laying around' '
test_path_is_missing .git/MERGE_MSG
'
+test_expect_success 'rebase --exec --empty=drop' '
+ git checkout -B testing localmods &&
+ git rebase --exec "true" --empty=drop upstream &&
+
+ test_write_lines D C B A >expect &&
+ git log --format=%s >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'rebase --exec --empty=keep' '
+ git checkout -B testing localmods &&
+ git rebase --exec "true" --empty=keep upstream &&
+
+ test_write_lines D C2 C B A >expect &&
+ git log --format=%s >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'rebase --exec uses default of --empty=keep' '
+ git checkout -B testing localmods &&
+ git rebase --exec "true" upstream &&
+
+ test_write_lines D C2 C B A >expect &&
+ git log --format=%s >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'rebase --exec --empty=stop' '
+ git checkout -B testing localmods &&
+ test_must_fail git rebase --exec "true" --empty=stop upstream &&
+
+ git rebase --skip &&
+
+ test_write_lines D C B A >expect &&
+ git log --format=%s >actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t3425-rebase-topology-merges.sh b/t/t3425-rebase-topology-merges.sh
index 63acc1e..a16428b 100755
--- a/t/t3425-rebase-topology-merges.sh
+++ b/t/t3425-rebase-topology-merges.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='rebase topology tests with merges'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-rebase.sh
diff --git a/t/t3426-rebase-submodule.sh b/t/t3426-rebase-submodule.sh
index 0ad3a07..ba069dc 100755
--- a/t/t3426-rebase-submodule.sh
+++ b/t/t3426-rebase-submodule.sh
@@ -35,6 +35,7 @@ git_rebase_interactive () {
ls -1pR * >>actual &&
test_cmp expect actual &&
set_fake_editor &&
+ mkdir .git/info &&
echo "fake-editor.sh" >.git/info/exclude &&
may_only_be_test_must_fail "$2" &&
$2 git rebase -i "$1"
@@ -47,7 +48,8 @@ test_expect_success 'rebase interactive ignores modified submodules' '
git init sub &&
git -C sub commit --allow-empty -m "Initial commit" &&
git init super &&
- git -C super submodule add ../sub &&
+ git -c protocol.file.allow=always \
+ -C super submodule add ../sub &&
git -C super config submodule.sub.ignore dirty &&
>super/foo &&
git -C super add foo &&
diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
index 48b76f8..1b3e97c 100755
--- a/t/t3427-rebase-subtree.sh
+++ b/t/t3427-rebase-subtree.sh
@@ -74,9 +74,9 @@ test_expect_success 'Rebase -Xsubtree --empty=ask --onto commit' '
test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --onto files-main main &&
: first pick results in no changes &&
git rebase --skip &&
- verbose test "$(commit_message HEAD~2)" = "topic_4" &&
- verbose test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
- verbose test "$(commit_message HEAD)" = "Empty commit"
+ test "$(commit_message HEAD~2)" = "topic_4" &&
+ test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
+ test "$(commit_message HEAD)" = "Empty commit"
'
test_expect_success 'Rebase -Xsubtree --empty=ask --rebase-merges --onto commit' '
@@ -85,9 +85,9 @@ test_expect_success 'Rebase -Xsubtree --empty=ask --rebase-merges --onto commit'
test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --rebase-merges --onto files-main --root &&
: first pick results in no changes &&
git rebase --skip &&
- verbose test "$(commit_message HEAD~2)" = "topic_4" &&
- verbose test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
- verbose test "$(commit_message HEAD)" = "Empty commit"
+ test "$(commit_message HEAD~2)" = "topic_4" &&
+ test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
+ test "$(commit_message HEAD)" = "Empty commit"
'
test_done
diff --git a/t/t3428-rebase-signoff.sh b/t/t3428-rebase-signoff.sh
index f6993b7..1bebd1c 100755
--- a/t/t3428-rebase-signoff.sh
+++ b/t/t3428-rebase-signoff.sh
@@ -5,49 +5,48 @@ test_description='git rebase --signoff
This test runs git rebase --signoff and make sure that it works.
'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
-# A simple file to commit
-cat >file <<EOF
-a
-EOF
+test_expect_success 'setup' '
+ git commit --allow-empty -m "Initial empty commit" &&
+ test_commit first file a &&
+
+ ident="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" &&
-# Expected commit message for initial commit after rebase --signoff
-cat >expected-initial-signed <<EOF
-Initial empty commit
+ # Expected commit message for initial commit after rebase --signoff
+ cat >expected-initial-signed <<-EOF &&
+ Initial empty commit
-Signed-off-by: $(git var GIT_COMMITTER_IDENT | sed -e "s/>.*/>/")
-EOF
+ Signed-off-by: $ident
+ EOF
-# Expected commit message after rebase --signoff
-cat >expected-signed <<EOF
-first
+ # Expected commit message after rebase --signoff
+ cat >expected-signed <<-EOF &&
+ first
-Signed-off-by: $(git var GIT_COMMITTER_IDENT | sed -e "s/>.*/>/")
-EOF
+ Signed-off-by: $ident
+ EOF
-# Expected commit message after rebase without --signoff (or with --no-signoff)
-cat >expected-unsigned <<EOF
-first
-EOF
+ # Expected commit message after rebase without --signoff (or with --no-signoff)
+ cat >expected-unsigned <<-EOF &&
+ first
+ EOF
+ git config alias.rbs "rebase --signoff"
+'
# We configure an alias to do the rebase --signoff so that
# on the next subtest we can show that --no-signoff overrides the alias
-test_expect_success 'rebase --signoff adds a sign-off line' '
- git commit --allow-empty -m "Initial empty commit" &&
- git add file && git commit -m first &&
- git config alias.rbs "rebase --signoff" &&
- git rbs HEAD^ &&
- git cat-file commit HEAD | sed -e "1,/^\$/d" > actual &&
- test_cmp expected-signed actual
+test_expect_success 'rebase --apply --signoff adds a sign-off line' '
+ git rbs --apply HEAD^ &&
+ test_commit_message HEAD expected-signed
'
test_expect_success 'rebase --no-signoff does not add a sign-off line' '
git commit --amend -m "first" &&
git rbs --no-signoff HEAD^ &&
- git cat-file commit HEAD | sed -e "1,/^\$/d" > actual &&
- test_cmp expected-unsigned actual
+ test_commit_message HEAD expected-unsigned
'
test_expect_success 'rebase --exec --signoff adds a sign-off line' '
@@ -55,30 +54,25 @@ test_expect_success 'rebase --exec --signoff adds a sign-off line' '
git commit --amend -m "first" &&
git rebase --exec "touch exec" --signoff HEAD^ &&
test_path_is_file exec &&
- git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
- test_cmp expected-signed actual
+ test_commit_message HEAD expected-signed
'
test_expect_success 'rebase --root --signoff adds a sign-off line' '
git commit --amend -m "first" &&
git rebase --root --keep-empty --signoff &&
- git cat-file commit HEAD^ | sed -e "1,/^\$/d" >actual &&
- test_cmp expected-initial-signed actual &&
- git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
- test_cmp expected-signed actual
+ test_commit_message HEAD^ expected-initial-signed &&
+ test_commit_message HEAD expected-signed
'
test_expect_success 'rebase -i --signoff fails' '
git commit --amend -m "first" &&
git rebase -i --signoff HEAD^ &&
- git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
- test_cmp expected-signed actual
+ test_commit_message HEAD expected-signed
'
test_expect_success 'rebase -m --signoff fails' '
git commit --amend -m "first" &&
git rebase -m --signoff HEAD^ &&
- git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
- test_cmp expected-signed actual
+ test_commit_message HEAD expected-signed
'
test_done
diff --git a/t/t3429-rebase-edit-todo.sh b/t/t3429-rebase-edit-todo.sh
index abd66f3..8e0d039 100755
--- a/t/t3429-rebase-edit-todo.sh
+++ b/t/t3429-rebase-edit-todo.sh
@@ -2,6 +2,7 @@
test_description='rebase should reread the todo file if an exec modifies it'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-rebase.sh
diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
index f351701..59b5d6b 100755
--- a/t/t3430-rebase-merges.sh
+++ b/t/t3430-rebase-merges.sh
@@ -128,14 +128,41 @@ test_expect_success 'generate correct todo list' '
'
test_expect_success '`reset` refuses to overwrite untracked files' '
- git checkout -b refuse-to-reset &&
+ git checkout B &&
test_commit dont-overwrite-untracked &&
- git checkout @{-1} &&
- : >dont-overwrite-untracked.t &&
- echo "reset refs/tags/dont-overwrite-untracked" >script-from-scratch &&
+ cat >script-from-scratch <<-EOF &&
+ exec >dont-overwrite-untracked.t
+ pick $(git rev-parse B) B
+ reset refs/tags/dont-overwrite-untracked
+ pick $(git rev-parse C) C
+ exec cat .git/rebase-merge/done >actual
+ EOF
test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
- test_must_fail git rebase -ir HEAD &&
- git rebase --abort
+ test_must_fail git rebase -ir A &&
+ test_cmp_rev HEAD B &&
+ head -n3 script-from-scratch >expect &&
+ test_cmp expect .git/rebase-merge/done &&
+ rm dont-overwrite-untracked.t &&
+ git rebase --continue &&
+ tail -n3 script-from-scratch >>expect &&
+ test_cmp expect actual
+'
+
+test_expect_success '`reset` rejects trees' '
+ test_when_finished "test_might_fail git rebase --abort" &&
+ test_must_fail env GIT_SEQUENCE_EDITOR="echo reset A^{tree} >" \
+ git rebase -i B C >out 2>err &&
+ grep "object .* is a tree" err &&
+ test_must_be_empty out
+'
+
+test_expect_success '`reset` only looks for labels under refs/rewritten/' '
+ test_when_finished "test_might_fail git rebase --abort" &&
+ git branch refs/rewritten/my-label A &&
+ test_must_fail env GIT_SEQUENCE_EDITOR="echo reset my-label >" \
+ git rebase -i B C >out 2>err &&
+ grep "could not resolve ${SQ}my-label${SQ}" err &&
+ test_must_be_empty out
'
test_expect_success 'failed `merge -C` writes patch (may be rescheduled, too)' '
@@ -148,12 +175,16 @@ test_expect_success 'failed `merge -C` writes patch (may be rescheduled, too)' '
test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
test_tick &&
test_must_fail git rebase -ir HEAD &&
+ test_cmp_rev REBASE_HEAD H^0 &&
grep "^merge -C .* G$" .git/rebase-merge/done &&
grep "^merge -C .* G$" .git/rebase-merge/git-rebase-todo &&
- test_path_is_file .git/rebase-merge/patch &&
+ test_path_is_missing .git/rebase-merge/patch &&
+ echo changed >file1 &&
+ git add file1 &&
+ test_must_fail git rebase --continue 2>err &&
+ grep "error: you have staged changes in your working tree" err &&
: fail because of merge conflict &&
- rm G.t .git/rebase-merge/patch &&
git reset --hard conflicting-G &&
test_must_fail git rebase --continue &&
! grep "^merge -C .* G$" .git/rebase-merge/git-rebase-todo &&
@@ -233,6 +264,16 @@ test_expect_success 'with a branch tip that was cherry-picked already' '
EOF
'
+test_expect_success '--no-rebase-merges countermands --rebase-merges' '
+ git checkout -b no-rebase-merges E &&
+ git rebase --rebase-merges --no-rebase-merges C &&
+ test_cmp_graph C.. <<-\EOF
+ * B
+ * D
+ o C
+ EOF
+'
+
test_expect_success 'do not rebase cousins unless asked for' '
git checkout -b cousins main &&
before="$(git rev-parse --verify HEAD)" &&
@@ -251,6 +292,40 @@ test_expect_success 'do not rebase cousins unless asked for' '
EOF
'
+test_expect_success 'rebase.rebaseMerges=rebase-cousins is equivalent to --rebase-merges=rebase-cousins' '
+ test_config rebase.rebaseMerges rebase-cousins &&
+ git checkout -b config-rebase-cousins main &&
+ git rebase HEAD^ &&
+ test_cmp_graph HEAD^.. <<-\EOF
+ * Merge the topic branch '\''onebranch'\''
+ |\
+ | * D
+ | * G
+ |/
+ o H
+ EOF
+'
+
+test_expect_success '--no-rebase-merges overrides rebase.rebaseMerges=no-rebase-cousins' '
+ test_config rebase.rebaseMerges no-rebase-cousins &&
+ git checkout -b override-config-no-rebase-cousins E &&
+ git rebase --no-rebase-merges C &&
+ test_cmp_graph C.. <<-\EOF
+ * B
+ * D
+ o C
+ EOF
+'
+
+test_expect_success '--rebase-merges overrides rebase.rebaseMerges=rebase-cousins' '
+ test_config rebase.rebaseMerges rebase-cousins &&
+ git checkout -b override-config-rebase-cousins E &&
+ before="$(git rev-parse --verify HEAD)" &&
+ test_tick &&
+ git rebase --rebase-merges C &&
+ test_cmp_rev HEAD $before
+'
+
test_expect_success 'refs/rewritten/* is worktree-local' '
git worktree add wt &&
cat >wt/script-from-scratch <<-\EOF &&
@@ -517,4 +592,23 @@ test_expect_success '--rebase-merges with message matched with onto label' '
EOF
'
+test_expect_success 'progress shows the correct total' '
+ git checkout -b progress H &&
+ git rebase --rebase-merges --force-rebase --verbose A 2> err &&
+ # Expecting "Rebasing (N/14)" here, no bogus total number
+ grep "^Rebasing.*/14.$" err >progress &&
+ test_line_count = 14 progress
+'
+
+test_expect_success 'truncate label names' '
+ commit=$(git commit-tree -p HEAD^ -p HEAD -m "0123456789 我 123" HEAD^{tree}) &&
+ git merge --ff-only $commit &&
+
+ done="$(git rev-parse --git-path rebase-merge/done)" &&
+ git -c rebase.maxLabelLength=14 rebase --rebase-merges -x "cp \"$done\" out" --root &&
+ grep "label 0123456789-我$" out &&
+ git -c rebase.maxLabelLength=13 rebase --rebase-merges -x "cp \"$done\" out" --root &&
+ grep "label 0123456789-$" out
+'
+
test_done
diff --git a/t/t3431-rebase-fork-point.sh b/t/t3431-rebase-fork-point.sh
index 1d0b153..0bb284d 100755
--- a/t/t3431-rebase-fork-point.sh
+++ b/t/t3431-rebase-fork-point.sh
@@ -8,6 +8,7 @@ test_description='git rebase --fork-point test'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# A---B---D---E (main)
@@ -50,7 +51,7 @@ test_rebase () {
test_rebase 'G F E D B A'
test_rebase 'G F D B A' --onto D
-test_rebase 'G F B A' --keep-base
+test_rebase 'G F C B A' --keep-base
test_rebase 'G F C E D B A' --no-fork-point
test_rebase 'G F C D B A' --no-fork-point --onto D
test_rebase 'G F C B A' --no-fork-point --keep-base
@@ -83,7 +84,7 @@ test_expect_success 'git rebase --fork-point with ambigous refname' '
test_expect_success '--fork-point and --root both given' '
test_must_fail git rebase --fork-point --root 2>err &&
- test_i18ngrep "cannot be used together" err
+ test_grep "cannot be used together" err
'
test_expect_success 'rebase.forkPoint set to false' '
diff --git a/t/t3432-rebase-fast-forward.sh b/t/t3432-rebase-fast-forward.sh
index 5086e14..7f1a5dd 100755
--- a/t/t3432-rebase-fast-forward.sh
+++ b/t/t3432-rebase-fast-forward.sh
@@ -8,6 +8,7 @@ test_description='ensure rebase fast-forwards commits when possible'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t3433-rebase-across-mode-change.sh b/t/t3433-rebase-across-mode-change.sh
index 05df964..c8172b0 100755
--- a/t/t3433-rebase-across-mode-change.sh
+++ b/t/t3433-rebase-across-mode-change.sh
@@ -2,6 +2,7 @@
test_description='git rebase across mode change'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
diff --git a/t/t3435-rebase-gpg-sign.sh b/t/t3435-rebase-gpg-sign.sh
index 5f8ba2c..6aa2aeb 100755
--- a/t/t3435-rebase-gpg-sign.sh
+++ b/t/t3435-rebase-gpg-sign.sh
@@ -64,14 +64,6 @@ test_rebase_gpg_sign ! true -i --no-gpg-sign
test_rebase_gpg_sign ! true -i --gpg-sign --no-gpg-sign
test_rebase_gpg_sign false -i --no-gpg-sign --gpg-sign
-test_expect_failure 'rebase -p --no-gpg-sign override commit.gpgsign' '
- test_when_finished "git clean -f" &&
- git reset --hard merged &&
- git config commit.gpgsign true &&
- git rebase -p --no-gpg-sign --onto=one fork-point main &&
- test_must_fail git verify-commit HEAD
-'
-
test_expect_success 'rebase -r, merge strategy, --gpg-sign will sign commit' '
git reset --hard merged &&
test_unconfig commit.gpgsign &&
diff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh
index c023fef..7929e2e 100755
--- a/t/t3437-rebase-fixup-options.sh
+++ b/t/t3437-rebase-fixup-options.sh
@@ -14,27 +14,13 @@ to the "fixup" command that works with "fixup!", "fixup -C" works with
"amend!" upon --autosquash.
'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-rebase.sh
EMPTY=""
-# test_commit_message <rev> -m <msg>
-# test_commit_message <rev> <path>
-# Verify that the commit message of <rev> matches
-# <msg> or the content of <path>.
-test_commit_message () {
- git show --no-patch --pretty=format:%B "$1" >actual &&
- case "$2" in
- -m)
- echo "$3" >expect &&
- test_cmp expect actual ;;
- *)
- test_cmp "$2" actual ;;
- esac
-}
-
get_author () {
rev="$1" &&
git log -1 --pretty=format:"%an %ae %at" "$rev"
@@ -50,6 +36,7 @@ test_expect_success 'setup' '
body
EOF
+ test_commit initial &&
test_commit A A &&
test_commit B B &&
get_author HEAD >expected-author &&
@@ -208,4 +195,29 @@ test_expect_success 'fixup -C works upon --autosquash with amend!' '
actual-squash-message
'
+test_expect_success 'fixup -[Cc]<commit> works' '
+ test_when_finished "test_might_fail git rebase --abort" &&
+ cat >todo <<-\EOF &&
+ pick A
+ fixup -CA1
+ pick B
+ fixup -cA2
+ EOF
+ (
+ set_replace_editor todo &&
+ FAKE_COMMIT_MESSAGE="edited and fixed up" \
+ git rebase -i initial initial
+ ) &&
+ git log --pretty=format:%B initial.. >actual &&
+ cat >expect <<-EOF &&
+ edited and fixed up
+ $EMPTY
+ new subject
+ $EMPTY
+ new
+ body
+ EOF
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t3438-rebase-broken-files.sh b/t/t3438-rebase-broken-files.sh
new file mode 100755
index 0000000..821f08e
--- /dev/null
+++ b/t/t3438-rebase-broken-files.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+test_description='rebase behavior when on-disk files are broken'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+test_expect_success 'set up conflicting branches' '
+ test_commit base file &&
+ git checkout -b branch1 &&
+ test_commit one file &&
+ git checkout -b branch2 HEAD^ &&
+ test_commit two file
+'
+
+create_conflict () {
+ test_when_finished "git rebase --abort" &&
+ git checkout -B tmp branch2 &&
+ test_must_fail git rebase branch1
+}
+
+check_resolve_fails () {
+ echo resolved >file &&
+ git add file &&
+ test_must_fail git rebase --continue
+}
+
+for item in NAME EMAIL DATE
+do
+ test_expect_success "detect missing GIT_AUTHOR_$item" '
+ create_conflict &&
+
+ grep -v $item .git/rebase-merge/author-script >tmp &&
+ mv tmp .git/rebase-merge/author-script &&
+
+ check_resolve_fails
+ '
+done
+
+for item in NAME EMAIL DATE
+do
+ test_expect_success "detect duplicate GIT_AUTHOR_$item" '
+ create_conflict &&
+
+ grep -i $item .git/rebase-merge/author-script >tmp &&
+ cat tmp >>.git/rebase-merge/author-script &&
+
+ check_resolve_fails
+ '
+done
+
+test_expect_success 'unknown key in author-script' '
+ create_conflict &&
+
+ echo "GIT_AUTHOR_BOGUS=${SQ}whatever${SQ}" \
+ >>.git/rebase-merge/author-script &&
+
+ check_resolve_fails
+'
+
+test_expect_success POSIXPERM,SANITY 'unwritable rebased-patches does not leak' '
+ >.git/rebased-patches &&
+ chmod a-w .git/rebased-patches &&
+
+ git checkout -b side HEAD^ &&
+ test_commit unrelated &&
+ test_must_fail git rebase --apply --onto tmp HEAD^
+'
+
+test_done
diff --git a/t/t3500-cherry.sh b/t/t3500-cherry.sh
index 0458a58..78c3eac 100755
--- a/t/t3500-cherry.sh
+++ b/t/t3500-cherry.sh
@@ -16,46 +16,43 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
GIT_AUTHOR_EMAIL=bogus_email_address
export GIT_AUTHOR_EMAIL
-test_expect_success \
- 'prepare repository with topic branch, and check cherry finds the 2 patches from there' \
- 'echo First > A &&
- git update-index --add A &&
- test_tick &&
- git commit -m "Add A." &&
-
- git checkout -b my-topic-branch &&
-
- echo Second > B &&
- git update-index --add B &&
- test_tick &&
- git commit -m "Add B." &&
-
- echo AnotherSecond > C &&
- git update-index --add C &&
- test_tick &&
- git commit -m "Add C." &&
-
- git checkout -f main &&
- rm -f B C &&
-
- echo Third >> A &&
- git update-index A &&
- test_tick &&
- git commit -m "Modify A." &&
-
- expr "$(echo $(git cherry main my-topic-branch) )" : "+ [^ ]* + .*"
+test_expect_success 'prepare repository with topic branch, and check cherry finds the 2 patches from there' '
+ echo First > A &&
+ git update-index --add A &&
+ test_tick &&
+ git commit -m "Add A." &&
+
+ git checkout -b my-topic-branch &&
+
+ echo Second > B &&
+ git update-index --add B &&
+ test_tick &&
+ git commit -m "Add B." &&
+
+ echo AnotherSecond > C &&
+ git update-index --add C &&
+ test_tick &&
+ git commit -m "Add C." &&
+
+ git checkout -f main &&
+ rm -f B C &&
+
+ echo Third >> A &&
+ git update-index A &&
+ test_tick &&
+ git commit -m "Modify A." &&
+
+ expr "$(echo $(git cherry main my-topic-branch) )" : "+ [^ ]* + .*"
'
-test_expect_success \
- 'check that cherry with limit returns only the top patch'\
- 'expr "$(echo $(git cherry main my-topic-branch my-topic-branch^1) )" : "+ [^ ]*"
+test_expect_success 'check that cherry with limit returns only the top patch' '
+ expr "$(echo $(git cherry main my-topic-branch my-topic-branch^1) )" : "+ [^ ]*"
'
-test_expect_success \
- 'cherry-pick one of the 2 patches, and check cherry recognized one and only one as new' \
- 'git cherry-pick my-topic-branch^0 &&
- echo $(git cherry main my-topic-branch) &&
- expr "$(echo $(git cherry main my-topic-branch) )" : "+ [^ ]* - .*"
+test_expect_success 'cherry-pick one of the 2 patches, and check cherry recognized one and only one as new' '
+ git cherry-pick my-topic-branch^0 &&
+ echo $(git cherry main my-topic-branch) &&
+ expr "$(echo $(git cherry main my-topic-branch) )" : "+ [^ ]* - .*"
'
test_expect_success 'cherry ignores whitespace' '
diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh
index 1f4cfc3..411027f 100755
--- a/t/t3501-revert-cherry-pick.sh
+++ b/t/t3501-revert-cherry-pick.sh
@@ -1,18 +1,11 @@
#!/bin/sh
-test_description='test cherry-pick and revert with renames
-
- --
- + rename2: renames oops to opos
- + rename1: renames oops to spoo
- + added: adds extra line to oops
- ++ initial: has lines in oops
-
-'
+test_description='miscellaneous basic tests for cherry-pick and revert'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
@@ -50,7 +43,7 @@ test_expect_success 'cherry-pick --nonsense' '
git diff --exit-code HEAD &&
test_must_fail git cherry-pick --nonsense 2>msg &&
git diff --exit-code HEAD "$pos" &&
- test_i18ngrep "[Uu]sage:" msg
+ test_grep "[Uu]sage:" msg
'
test_expect_success 'revert --nonsense' '
@@ -59,9 +52,17 @@ test_expect_success 'revert --nonsense' '
git diff --exit-code HEAD &&
test_must_fail git revert --nonsense 2>msg &&
git diff --exit-code HEAD "$pos" &&
- test_i18ngrep "[Uu]sage:" msg
+ test_grep "[Uu]sage:" msg
'
+# the following two test cherry-pick and revert with renames
+#
+# --
+# + rename2: renames oops to opos
+# + rename1: renames oops to spoo
+# + added: adds extra line to oops
+# ++ initial: has lines in oops
+
test_expect_success 'cherry-pick after renaming branch' '
git checkout rename2 &&
@@ -98,16 +99,24 @@ test_expect_success 'revert forbidden on dirty working tree' '
echo content >extra_file &&
git add extra_file &&
test_must_fail git revert HEAD 2>errors &&
- test_i18ngrep "your local changes would be overwritten by " errors
+ test_grep "your local changes would be overwritten by " errors
'
test_expect_success 'cherry-pick on unborn branch' '
- git checkout --orphan unborn &&
+ git switch --orphan unborn &&
git rm --cached -r . &&
- rm -rf * &&
git cherry-pick initial &&
- git diff --quiet initial &&
+ git diff --exit-code initial &&
+ test_cmp_rev ! initial HEAD
+'
+
+test_expect_success 'cherry-pick on unborn branch with --allow-empty' '
+ git checkout --detach &&
+ git branch -D unborn &&
+ git switch --orphan unborn &&
+ git cherry-pick initial --allow-empty &&
+ git diff --exit-code initial &&
test_cmp_rev ! initial HEAD
'
@@ -169,12 +178,36 @@ 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"
EOF
test_commit --append --no-tag "double-add dream" dream dream &&
test_must_fail git revert HEAD^ 2>actual &&
test_cmp expected actual
'
+test_expect_subject () {
+ echo "$1" >expect &&
+ git log -1 --pretty=%s >actual &&
+ test_cmp expect actual
+}
+
+test_expect_success 'titles of fresh reverts' '
+ test_commit --no-tag A file1 &&
+ test_commit --no-tag B file1 &&
+ git revert --no-edit HEAD &&
+ test_expect_subject "Revert \"B\"" &&
+ git revert --no-edit HEAD &&
+ test_expect_subject "Reapply \"B\"" &&
+ git revert --no-edit HEAD &&
+ test_expect_subject "Revert \"Reapply \"B\"\""
+'
+
+test_expect_success 'title of legacy double revert' '
+ test_commit --no-tag "Revert \"Revert \"B\"\"" file1 &&
+ git revert --no-edit HEAD &&
+ test_expect_subject "Revert \"Revert \"Revert \"B\"\"\""
+'
+
test_expect_success 'identification of reverted commit (default)' '
test_commit to-ident &&
test_when_finished "git reset --hard to-ident" &&
diff --git a/t/t3502-cherry-pick-merge.sh b/t/t3502-cherry-pick-merge.sh
index 5495eac..1b2c0d6 100755
--- a/t/t3502-cherry-pick-merge.sh
+++ b/t/t3502-cherry-pick-merge.sh
@@ -11,6 +11,7 @@ test_description='cherry picking and reverting a merge
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t3503-cherry-pick-root.sh b/t/t3503-cherry-pick-root.sh
index 95fe4fe..76d393d 100755
--- a/t/t3503-cherry-pick-root.sh
+++ b/t/t3503-cherry-pick-root.sh
@@ -5,6 +5,7 @@ test_description='test cherry-picking (and reverting) a root commit'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t3505-cherry-pick-empty.sh b/t/t3505-cherry-pick-empty.sh
index eba3c38..9748443 100755
--- a/t/t3505-cherry-pick-empty.sh
+++ b/t/t3505-cherry-pick-empty.sh
@@ -84,7 +84,7 @@ test_expect_success 'cherry-pick a commit that becomes no-op (prep)' '
git commit -m "add file2 on the side"
'
-test_expect_success 'cherry-pick a no-op without --keep-redundant' '
+test_expect_success 'cherry-pick a no-op with neither --keep-redundant nor --empty' '
git reset --hard &&
git checkout fork^0 &&
test_must_fail git cherry-pick main
@@ -99,4 +99,53 @@ test_expect_success 'cherry-pick a no-op with --keep-redundant' '
test_cmp expect actual
'
+test_expect_success '--keep-redundant-commits is incompatible with operations' '
+ test_must_fail git cherry-pick HEAD 2>output &&
+ test_grep "The previous cherry-pick is now empty" output &&
+ test_must_fail git cherry-pick --keep-redundant-commits --continue 2>output &&
+ test_grep "fatal: cherry-pick: --keep-redundant-commits cannot be used with --continue" output &&
+ test_must_fail git cherry-pick --keep-redundant-commits --skip 2>output &&
+ test_grep "fatal: cherry-pick: --keep-redundant-commits cannot be used with --skip" output &&
+ test_must_fail git cherry-pick --keep-redundant-commits --abort 2>output &&
+ test_grep "fatal: cherry-pick: --keep-redundant-commits cannot be used with --abort" output &&
+ test_must_fail git cherry-pick --keep-redundant-commits --quit 2>output &&
+ test_grep "fatal: cherry-pick: --keep-redundant-commits cannot be used with --quit" output &&
+ git cherry-pick --abort
+'
+
+test_expect_success '--empty is incompatible with operations' '
+ test_must_fail git cherry-pick HEAD 2>output &&
+ test_grep "The previous cherry-pick is now empty" output &&
+ test_must_fail git cherry-pick --empty=stop --continue 2>output &&
+ test_grep "fatal: cherry-pick: --empty cannot be used with --continue" output &&
+ test_must_fail git cherry-pick --empty=stop --skip 2>output &&
+ test_grep "fatal: cherry-pick: --empty cannot be used with --skip" output &&
+ test_must_fail git cherry-pick --empty=stop --abort 2>output &&
+ test_grep "fatal: cherry-pick: --empty cannot be used with --abort" output &&
+ test_must_fail git cherry-pick --empty=stop --quit 2>output &&
+ test_grep "fatal: cherry-pick: --empty cannot be used with --quit" output &&
+ git cherry-pick --abort
+'
+
+test_expect_success 'cherry-pick a no-op with --empty=stop' '
+ git reset --hard &&
+ git checkout fork^0 &&
+ test_must_fail git cherry-pick --empty=stop main 2>output &&
+ test_grep "The previous cherry-pick is now empty" output
+'
+
+test_expect_success 'cherry-pick a no-op with --empty=drop' '
+ git reset --hard &&
+ git checkout fork^0 &&
+ git cherry-pick --empty=drop main &&
+ test_commit_message HEAD -m "add file2 on the side"
+'
+
+test_expect_success 'cherry-pick a no-op with --empty=keep' '
+ git reset --hard &&
+ git checkout fork^0 &&
+ git cherry-pick --empty=keep main &&
+ test_commit_message HEAD -m "add file2 on main"
+'
+
test_done
diff --git a/t/t3506-cherry-pick-ff.sh b/t/t3506-cherry-pick-ff.sh
index 7e11bd4..b71bad1 100755
--- a/t/t3506-cherry-pick-ff.sh
+++ b/t/t3506-cherry-pick-ff.sh
@@ -5,6 +5,7 @@ test_description='test cherry-picking with --ff option'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh
index 979e843..f3947b4 100755
--- a/t/t3507-cherry-pick-conflict.sh
+++ b/t/t3507-cherry-pick-conflict.sh
@@ -12,6 +12,7 @@ test_description='test cherry-pick and revert with conflicts
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
pristine_detach () {
@@ -59,6 +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"
EOF
test_must_fail git cherry-pick picked 2>actual &&
@@ -73,6 +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\"
EOF
test_must_fail git cherry-pick --no-commit picked 2>actual &&
@@ -176,7 +179,7 @@ test_expect_success 'partial commit of cherry-pick fails' '
git add foo &&
test_must_fail git commit foo 2>err &&
- test_i18ngrep "cannot do a partial commit during a cherry-pick." err
+ test_grep "cannot do a partial commit during a cherry-pick." err
'
test_expect_success 'commit --amend of cherry-pick fails' '
@@ -187,7 +190,7 @@ test_expect_success 'commit --amend of cherry-pick fails' '
git add foo &&
test_must_fail git commit --amend 2>err &&
- test_i18ngrep "in the middle of a cherry-pick -- cannot amend." err
+ test_grep "in the middle of a cherry-pick -- cannot amend." err
'
test_expect_success 'successful final commit clears cherry-pick state' '
@@ -497,7 +500,7 @@ test_expect_success \
test_expect_success 'failed cherry-pick does not forget -s' '
pristine_detach initial &&
test_must_fail git cherry-pick -s picked &&
- test_i18ngrep -e "Signed-off-by" .git/MERGE_MSG
+ test_grep -e "Signed-off-by" .git/MERGE_MSG
'
test_expect_success 'commit after failed cherry-pick does not add duplicated -s' '
@@ -558,10 +561,11 @@ test_expect_success 'cherry-pick preserves sparse-checkout' '
echo \"/*\" >.git/info/sparse-checkout
git read-tree --reset -u HEAD
rm .git/info/sparse-checkout" &&
+ mkdir .git/info &&
echo /unrelated >.git/info/sparse-checkout &&
git read-tree --reset -u HEAD &&
test_must_fail git cherry-pick -Xours picked>actual &&
- test_i18ngrep ! "Changes not staged for commit:" actual
+ test_grep ! "Changes not staged for commit:" actual
'
test_expect_success 'cherry-pick --continue remembers --keep-redundant-commits' '
diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh
index 3b0fa66..7eb52b1 100755
--- a/t/t3510-cherry-pick-sequence.sh
+++ b/t/t3510-cherry-pick-sequence.sh
@@ -90,6 +90,38 @@ test_expect_success 'cherry-pick persists opts correctly' '
test_cmp expect actual
'
+test_expect_success 'cherry-pick persists --empty=stop correctly' '
+ pristine_detach yetanotherpick &&
+ # Picking `anotherpick` forces a conflict so that we stop. That
+ # commit is then skipped, after which we pick `yetanotherpick`
+ # while already on `yetanotherpick` to cause an empty commit
+ test_must_fail git cherry-pick --empty=stop anotherpick yetanotherpick &&
+ test_must_fail git cherry-pick --skip 2>msg &&
+ test_grep "The previous cherry-pick is now empty" msg &&
+ rm msg &&
+ git cherry-pick --abort
+'
+
+test_expect_success 'cherry-pick persists --empty=drop correctly' '
+ pristine_detach yetanotherpick &&
+ # Picking `anotherpick` forces a conflict so that we stop. That
+ # commit is then skipped, after which we pick `yetanotherpick`
+ # while already on `yetanotherpick` to cause an empty commit
+ test_must_fail git cherry-pick --empty=drop anotherpick yetanotherpick &&
+ git cherry-pick --skip &&
+ test_cmp_rev yetanotherpick HEAD
+'
+
+test_expect_success 'cherry-pick persists --empty=keep correctly' '
+ pristine_detach yetanotherpick &&
+ # Picking `anotherpick` forces a conflict so that we stop. That
+ # commit is then skipped, after which we pick `yetanotherpick`
+ # while already on `yetanotherpick` to cause an empty commit
+ test_must_fail git cherry-pick --empty=keep anotherpick yetanotherpick &&
+ git cherry-pick --skip &&
+ test_cmp_rev yetanotherpick HEAD^
+'
+
test_expect_success 'revert persists opts correctly' '
pristine_detach initial &&
# to make sure that the session to revert a sequence
@@ -154,7 +186,7 @@ test_expect_success 'skip "empty" commit' '
pristine_detach picked &&
test_commit dummy foo d &&
test_must_fail git cherry-pick anotherpick 2>err &&
- test_i18ngrep "git cherry-pick --skip" err &&
+ test_grep "git cherry-pick --skip" err &&
git cherry-pick --skip &&
test_cmp_rev dummy HEAD
'
@@ -314,7 +346,7 @@ test_expect_success '--abort does not unsafely change HEAD' '
git reset --hard base &&
test_must_fail git cherry-pick picked anotherpick &&
git cherry-pick --abort 2>actual &&
- test_i18ngrep "You seem to have moved HEAD" actual &&
+ test_grep "You seem to have moved HEAD" actual &&
test_cmp_rev base HEAD
'
@@ -520,7 +552,7 @@ test_expect_success '--continue asks for help after resolving patch to nil' '
test_cmp_rev unrelatedpick CHERRY_PICK_HEAD &&
git checkout HEAD -- unrelated &&
test_must_fail git cherry-pick --continue 2>msg &&
- test_i18ngrep "The previous cherry-pick is now empty" msg
+ test_grep "The previous cherry-pick is now empty" msg
'
test_expect_success 'follow advice and skip nil patch' '
diff --git a/t/t3511-cherry-pick-x.sh b/t/t3511-cherry-pick-x.sh
index 84a587d..dd5d92e 100755
--- a/t/t3511-cherry-pick-x.sh
+++ b/t/t3511-cherry-pick-x.sh
@@ -2,6 +2,7 @@
test_description='Test cherry-pick -x and -s'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
pristine_detach () {
diff --git a/t/t3512-cherry-pick-submodule.sh b/t/t3512-cherry-pick-submodule.sh
index c657840..f22d1dd 100755
--- a/t/t3512-cherry-pick-submodule.sh
+++ b/t/t3512-cherry-pick-submodule.sh
@@ -16,6 +16,8 @@ fi
test_submodule_switch "cherry-pick"
test_expect_success 'unrelated submodule/file conflict is ignored' '
+ test_config_global protocol.file.allow always &&
+
test_create_repo sub &&
touch sub/file &&
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index e74a318..98259e2 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -276,7 +276,7 @@ test_expect_success 'Resolving by removal is not a warning-worthy event' '
blob=$(echo blob | git hash-object -w --stdin) &&
printf "100644 $blob %d\tblob\n" 1 2 3 | git update-index --index-info &&
git rm blob >msg 2>&1 &&
- test_i18ngrep ! "needs merge" msg &&
+ test_grep ! "needs merge" msg &&
test_must_fail git ls-files -s --error-unmatch blob
'
@@ -333,7 +333,7 @@ test_expect_success 'rm removes empty submodules from work tree' '
test_expect_success 'rm removes removed submodule from index and .gitmodules' '
git reset --hard &&
- git submodule update &&
+ git -c protocol.file.allow=always submodule update &&
rm -rf submod &&
git rm submod &&
git status -s -uno --ignore-submodules=none >actual &&
@@ -631,7 +631,7 @@ test_expect_success 'rm of a populated submodule with a .git directory migrates
test_path_is_missing submod/.git &&
git status -s -uno --ignore-submodules=none >actual &&
test_file_not_empty actual &&
- test_i18ngrep Migrating output.err
+ test_grep Migrating output.err
'
cat >expect.deepmodified <<EOF
@@ -639,6 +639,7 @@ cat >expect.deepmodified <<EOF
EOF
test_expect_success 'setup subsubmodule' '
+ test_config_global protocol.file.allow always &&
git reset --hard &&
git submodule update &&
(
@@ -721,7 +722,7 @@ test_expect_success "rm absorbs submodule's nested .git directory" '
test_path_is_missing submod/subsubmod/.git &&
git status -s -uno --ignore-submodules=none >actual &&
test_file_not_empty actual &&
- test_i18ngrep Migrating output.err
+ test_grep Migrating output.err
'
test_expect_success 'checking out a commit after submodule removal needs manual updates' '
@@ -730,7 +731,7 @@ test_expect_success 'checking out a commit after submodule removal needs manual
git submodule update &&
git checkout -q HEAD^ &&
git checkout -q main 2>actual &&
- test_i18ngrep "^warning: unable to rmdir '\''submod'\'':" actual &&
+ test_grep "^warning: unable to rmdir '\''submod'\'':" actual &&
git status -s submod >actual &&
echo "?? submod/" >expected &&
test_cmp expected actual &&
diff --git a/t/t3601-rm-pathspec-file.sh b/t/t3601-rm-pathspec-file.sh
index a2a0c82..7cef129 100755
--- a/t/t3601-rm-pathspec-file.sh
+++ b/t/t3601-rm-pathspec-file.sh
@@ -67,14 +67,14 @@ test_expect_success 'error conditions' '
echo fileA.t >list &&
test_must_fail git rm --pathspec-from-file=list -- fileA.t 2>err &&
- test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
+ test_grep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
test_must_fail git rm --pathspec-file-nul 2>err &&
- test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
+ test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
>empty_list &&
test_must_fail git rm --pathspec-from-file=empty_list 2>err &&
- test_i18ngrep -e "No pathspec was given. Which files should I remove?" err
+ test_grep -e "No pathspec was given. Which files should I remove?" err
'
test_done
diff --git a/t/t3650-replay-basics.sh b/t/t3650-replay-basics.sh
new file mode 100755
index 0000000..3896702
--- /dev/null
+++ b/t/t3650-replay-basics.sh
@@ -0,0 +1,198 @@
+#!/bin/sh
+
+test_description='basic git replay tests'
+
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+. ./test-lib.sh
+
+GIT_AUTHOR_NAME=author@name
+GIT_AUTHOR_EMAIL=bogus@email@address
+export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL
+
+test_expect_success 'setup' '
+ test_commit A &&
+ test_commit B &&
+
+ git switch -c topic1 &&
+ test_commit C &&
+ git switch -c topic2 &&
+ test_commit D &&
+ test_commit E &&
+ git switch topic1 &&
+ test_commit F &&
+ git switch -c topic3 &&
+ test_commit G &&
+ test_commit H &&
+ git switch -c topic4 main &&
+ test_commit I &&
+ test_commit J &&
+
+ git switch -c next main &&
+ test_commit K &&
+ git merge -m "Merge topic1" topic1 &&
+ git merge -m "Merge topic2" topic2 &&
+ git merge -m "Merge topic3" topic3 &&
+ >evil &&
+ git add evil &&
+ git commit --amend &&
+ git merge -m "Merge topic4" topic4 &&
+
+ git switch main &&
+ test_commit L &&
+ test_commit M &&
+
+ git switch -c conflict B &&
+ test_commit C.conflict C.t conflict
+'
+
+test_expect_success 'setup bare' '
+ git clone --bare . bare
+'
+
+test_expect_success 'using replay to rebase two branches, one on top of other' '
+ git replay --onto main topic1..topic2 >result &&
+
+ test_line_count = 1 result &&
+
+ git log --format=%s $(cut -f 3 -d " " result) >actual &&
+ test_write_lines E D M L B A >expect &&
+ test_cmp expect actual &&
+
+ printf "update refs/heads/topic2 " >expect &&
+ printf "%s " $(cut -f 3 -d " " result) >>expect &&
+ git rev-parse topic2 >>expect &&
+
+ test_cmp expect result
+'
+
+test_expect_success 'using replay on bare repo to rebase two branches, one on top of other' '
+ git -C bare replay --onto main topic1..topic2 >result-bare &&
+ test_cmp expect result-bare
+'
+
+test_expect_success 'using replay to rebase with a conflict' '
+ test_expect_code 1 git replay --onto topic1 B..conflict
+'
+
+test_expect_success 'using replay on bare repo to rebase with a conflict' '
+ test_expect_code 1 git -C bare replay --onto topic1 B..conflict
+'
+
+test_expect_success 'using replay to perform basic cherry-pick' '
+ # The differences between this test and previous ones are:
+ # --advance vs --onto
+ # 2nd field of result is refs/heads/main vs. refs/heads/topic2
+ # 4th field of result is hash for main instead of hash for topic2
+
+ git replay --advance main topic1..topic2 >result &&
+
+ test_line_count = 1 result &&
+
+ git log --format=%s $(cut -f 3 -d " " result) >actual &&
+ test_write_lines E D M L B A >expect &&
+ test_cmp expect actual &&
+
+ printf "update refs/heads/main " >expect &&
+ printf "%s " $(cut -f 3 -d " " result) >>expect &&
+ git rev-parse main >>expect &&
+
+ test_cmp expect result
+'
+
+test_expect_success 'using replay on bare repo to perform basic cherry-pick' '
+ git -C bare replay --advance main topic1..topic2 >result-bare &&
+ test_cmp expect result-bare
+'
+
+test_expect_success 'replay on bare repo fails with both --advance and --onto' '
+ test_must_fail git -C bare replay --advance main --onto main topic1..topic2 >result-bare
+'
+
+test_expect_success 'replay fails when both --advance and --onto are omitted' '
+ test_must_fail git replay topic1..topic2 >result
+'
+
+test_expect_success 'using replay to also rebase a contained branch' '
+ git replay --contained --onto main main..topic3 >result &&
+
+ test_line_count = 2 result &&
+ cut -f 3 -d " " result >new-branch-tips &&
+
+ git log --format=%s $(head -n 1 new-branch-tips) >actual &&
+ test_write_lines F C M L B A >expect &&
+ test_cmp expect actual &&
+
+ git log --format=%s $(tail -n 1 new-branch-tips) >actual &&
+ test_write_lines H G F C M L B A >expect &&
+ test_cmp expect actual &&
+
+ printf "update refs/heads/topic1 " >expect &&
+ printf "%s " $(head -n 1 new-branch-tips) >>expect &&
+ git rev-parse topic1 >>expect &&
+ printf "update refs/heads/topic3 " >>expect &&
+ printf "%s " $(tail -n 1 new-branch-tips) >>expect &&
+ git rev-parse topic3 >>expect &&
+
+ test_cmp expect result
+'
+
+test_expect_success 'using replay on bare repo to also rebase a contained branch' '
+ git -C bare replay --contained --onto main main..topic3 >result-bare &&
+ test_cmp expect result-bare
+'
+
+test_expect_success 'using replay to rebase multiple divergent branches' '
+ git replay --onto main ^topic1 topic2 topic4 >result &&
+
+ test_line_count = 2 result &&
+ cut -f 3 -d " " result >new-branch-tips &&
+
+ git log --format=%s $(head -n 1 new-branch-tips) >actual &&
+ test_write_lines E D M L B A >expect &&
+ test_cmp expect actual &&
+
+ git log --format=%s $(tail -n 1 new-branch-tips) >actual &&
+ test_write_lines J I M L B A >expect &&
+ test_cmp expect actual &&
+
+ printf "update refs/heads/topic2 " >expect &&
+ printf "%s " $(head -n 1 new-branch-tips) >>expect &&
+ git rev-parse topic2 >>expect &&
+ printf "update refs/heads/topic4 " >>expect &&
+ printf "%s " $(tail -n 1 new-branch-tips) >>expect &&
+ git rev-parse topic4 >>expect &&
+
+ test_cmp expect result
+'
+
+test_expect_success 'using replay on bare repo to rebase multiple divergent branches, including contained ones' '
+ git -C bare replay --contained --onto main ^main topic2 topic3 topic4 >result &&
+
+ test_line_count = 4 result &&
+ cut -f 3 -d " " result >new-branch-tips &&
+
+ >expect &&
+ for i in 2 1 3 4
+ do
+ printf "update refs/heads/topic$i " >>expect &&
+ printf "%s " $(grep topic$i result | cut -f 3 -d " ") >>expect &&
+ git -C bare rev-parse topic$i >>expect || return 1
+ done &&
+
+ test_cmp expect result &&
+
+ test_write_lines F C M L B A >expect1 &&
+ test_write_lines E D C M L B A >expect2 &&
+ test_write_lines H G F C M L B A >expect3 &&
+ test_write_lines J I M L B A >expect4 &&
+
+ for i in 1 2 3 4
+ do
+ git -C bare log --format=%s $(grep topic$i result | cut -f 3 -d " ") >actual &&
+ test_cmp expect$i actual || return 1
+ done
+'
+
+test_done
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index 8689b48..839c904 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -24,17 +24,27 @@ test_mode_in_index () {
esac
}
-test_expect_success \
- 'Test of git add' \
- 'touch foo && git add foo'
+test_expect_success 'Test of git add' '
+ touch foo && git add foo
+'
-test_expect_success \
- 'Post-check that foo is in the index' \
- 'git ls-files foo | grep foo'
+test_expect_success '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"
+ EOF
+ git add 2>actual &&
+ test_cmp expect actual
+'
-test_expect_success \
- 'Test that "git add -- -q" works' \
- 'touch -- -q && git add -- -q'
+test_expect_success 'Post-check that foo is in the index' '
+ git ls-files foo | grep foo
+'
+
+test_expect_success 'Test that "git add -- -q" works' '
+ touch -- -q && git add -- -q
+'
BATCH_CONFIGURATION='-c core.fsync=loose-object -c core.fsyncmethod=batch'
@@ -106,24 +116,32 @@ test_expect_success '.gitignore test setup' '
test_expect_success '.gitignore is honored' '
git add . &&
- ! (git ls-files | grep "\\.ig")
+ git ls-files >files &&
+ sed -n "/\\.ig/p" <files >actual &&
+ test_must_be_empty actual
'
test_expect_success 'error out when attempting to add ignored ones without -f' '
test_must_fail git add a.?? &&
- ! (git ls-files | grep "\\.ig")
+ git ls-files >files &&
+ sed -n "/\\.ig/p" <files >actual &&
+ test_must_be_empty actual
'
test_expect_success 'error out when attempting to add ignored ones without -f' '
test_must_fail git add d.?? &&
- ! (git ls-files | grep "\\.ig")
+ git ls-files >files &&
+ sed -n "/\\.ig/p" <files >actual &&
+ test_must_be_empty actual
'
test_expect_success 'error out when attempting to add ignored ones but add others' '
touch a.if &&
test_must_fail git add a.?? &&
- ! (git ls-files | grep "\\.ig") &&
- (git ls-files | grep a.if)
+ git ls-files >files &&
+ sed -n "/\\.ig/p" <files >actual &&
+ test_must_be_empty actual &&
+ grep a.if files
'
test_expect_success 'add ignored ones with -f' '
@@ -276,14 +294,14 @@ test_expect_success POSIXPERM,SANITY 'git add (add.ignore-errors = false)' '
rm -f foo2
test_expect_success POSIXPERM,SANITY '--no-ignore-errors overrides config' '
- git config add.ignore-errors 1 &&
- git reset --hard &&
- date >foo1 &&
- date >foo2 &&
- chmod 0 foo2 &&
- test_must_fail git add --verbose --no-ignore-errors . &&
- ! ( git ls-files foo1 | grep foo1 ) &&
- git config add.ignore-errors 0
+ git config add.ignore-errors 1 &&
+ git reset --hard &&
+ date >foo1 &&
+ date >foo2 &&
+ chmod 0 foo2 &&
+ test_must_fail git add --verbose --no-ignore-errors . &&
+ ! ( git ls-files foo1 | grep foo1 ) &&
+ git config add.ignore-errors 0
'
rm -f foo2
@@ -291,7 +309,7 @@ test_expect_success BSLASHPSPEC "git add 'fo\\[ou\\]bar' ignores foobar" '
git reset --hard &&
touch fo\[ou\]bar foobar &&
git add '\''fo\[ou\]bar'\'' &&
- git ls-files fo\[ou\]bar | fgrep fo\[ou\]bar &&
+ git ls-files fo\[ou\]bar | grep -F fo\[ou\]bar &&
! ( git ls-files foobar | grep foobar )
'
@@ -331,6 +349,40 @@ test_expect_success '"git add ." in empty repo' '
)
'
+test_expect_success '"git add" a embedded repository' '
+ rm -fr outer && git init outer &&
+ (
+ cd outer &&
+ for i in 1 2
+ do
+ name=inner$i &&
+ git init $name &&
+ git -C $name commit --allow-empty -m $name ||
+ return 1
+ done &&
+ git add . 2>actual &&
+ cat >expect <<-EOF &&
+ warning: adding embedded git repository: inner1
+ hint: You${SQ}ve added another git repository inside your current repository.
+ hint: Clones of the outer repository will not contain the contents of
+ hint: the embedded repository and will not know how to obtain it.
+ hint: If you meant to add a submodule, use:
+ hint:
+ hint: git submodule add <url> inner1
+ hint:
+ hint: If you added this path by mistake, you can remove it from the
+ hint: index with:
+ hint:
+ hint: git rm --cached inner1
+ hint:
+ hint: See "git help submodule" for more information.
+ hint: Disable this message with "git config advice.addEmbeddedRepo false"
+ warning: adding embedded git repository: inner2
+ EOF
+ test_cmp expect actual
+ )
+'
+
test_expect_success 'error on a repository with no commits' '
rm -fr empty &&
git init empty &&
@@ -362,8 +414,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: Turn this message off by running
-hint: "git config advice.addIgnoredFile false"
+hint: Disable this message with "git config advice.addIgnoredFile false"
EOF
cat >expect.out <<\EOF
add 'track-this'
@@ -430,7 +481,7 @@ test_expect_success 'git add --chmod fails with non regular files (but updates t
test_ln_s_add foo foo3 &&
touch foo4 &&
test_must_fail git add --chmod=+x foo3 foo4 2>stderr &&
- test_i18ngrep "cannot chmod +x .foo3." stderr &&
+ test_grep "cannot chmod +x .foo3." stderr &&
test_mode_in_index 120000 foo3 &&
test_mode_in_index 100755 foo4
'
@@ -447,12 +498,12 @@ test_expect_success 'git add --chmod --dry-run reports error for non regular fil
git reset --hard &&
test_ln_s_add foo foo4 &&
test_must_fail git add --chmod=+x --dry-run foo4 2>stderr &&
- test_i18ngrep "cannot chmod +x .foo4." stderr
+ test_grep "cannot chmod +x .foo4." stderr
'
test_expect_success 'git add --chmod --dry-run reports error for unmatched pathspec' '
test_must_fail git add --chmod=+x --dry-run nonexistent 2>stderr &&
- test_i18ngrep "pathspec .nonexistent. did not match any files" stderr
+ test_grep "pathspec .nonexistent. did not match any files" stderr
'
test_expect_success 'no file status change if no pathspec is given' '
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index b354fb3..bc55255 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -7,12 +7,6 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-terminal.sh
-if ! test_have_prereq PERL
-then
- skip_all='skipping add -i tests, perl not available'
- test_done
-fi
-
diff_cmp () {
for x
do
@@ -46,6 +40,21 @@ force_color () {
)
}
+test_expect_success 'warn about add.interactive.useBuiltin' '
+ cat >expect <<-\EOF &&
+ warning: the add.interactive.useBuiltin setting has been removed!
+ See its entry in '\''git help config'\'' for details.
+ No changes.
+ EOF
+
+ for v in = =true =false
+ do
+ git -c "add.interactive.useBuiltin$v" add -p >out 2>actual &&
+ test_must_be_empty out &&
+ test_cmp expect actual || return 1
+ done
+'
+
test_expect_success 'setup (initial)' '
echo content >file &&
git add file &&
@@ -296,9 +305,11 @@ test_expect_success FILEMODE 'stage mode and hunk' '
echo content >>file &&
chmod +x file &&
printf "y\\ny\\n" | git add -p &&
- git diff --cached file | grep "new mode" &&
- git diff --cached file | grep "+content" &&
- test -z "$(git diff file)"
+ git diff --cached file >out &&
+ grep "new mode" out &&
+ grep "+content" out &&
+ git diff file >out &&
+ test_must_be_empty out
'
# end of tests disabled when filemode is not usable
@@ -314,9 +325,9 @@ test_expect_success 'different prompts for mode change/deleted' '
git -c core.filemode=true add -p >actual &&
sed -n "s/^\(([0-9/]*) Stage .*?\).*/\1/p" actual >actual.filtered &&
cat >expect <<-\EOF &&
- (1/1) Stage deletion [y,n,q,a,d,?]?
- (1/2) Stage mode change [y,n,q,a,d,j,J,g,/,?]?
- (2/2) Stage this hunk [y,n,q,a,d,K,g,/,e,?]?
+ (1/1) Stage deletion [y,n,q,a,d,p,?]?
+ (1/2) Stage mode change [y,n,q,a,d,j,J,g,/,p,?]?
+ (2/2) Stage this hunk [y,n,q,a,d,K,g,/,e,p,?]?
EOF
test_cmp expect actual.filtered
'
@@ -324,12 +335,12 @@ test_expect_success 'different prompts for mode change/deleted' '
test_expect_success 'correct message when there is nothing to do' '
git reset --hard &&
git add -p 2>err &&
- test_i18ngrep "No changes" err &&
+ test_grep "No changes" err &&
printf "\\0123" >binary &&
git add binary &&
printf "\\0abc" >binary &&
git add -p 2>err &&
- test_i18ngrep "Only binary files changed" err
+ test_grep "Only binary files changed" err
'
test_expect_success 'setup again' '
@@ -486,7 +497,7 @@ test_expect_success 'adding an empty file' '
echo y | git checkout -p added-file -- >actual &&
test_path_is_file empty &&
- test_i18ngrep "Apply addition to index and worktree" actual
+ test_grep "Apply addition to index and worktree" actual
)
'
@@ -503,13 +514,13 @@ test_expect_success 'split hunk setup' '
test_expect_success 'goto hunk' '
test_when_finished "git reset" &&
tr _ " " >expect <<-EOF &&
- (2/2) Stage this hunk [y,n,q,a,d,K,g,/,e,?]? + 1: -1,2 +1,3 +15
+ (2/2) Stage this hunk [y,n,q,a,d,K,g,/,e,p,?]? + 1: -1,2 +1,3 +15
_ 2: -2,4 +3,8 +21
go to which hunk? @@ -1,2 +1,3 @@
_10
+15
_20
- (1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,e,?]?_
+ (1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,e,p,?]?_
EOF
test_write_lines s y g 1 | git add -p >actual &&
tail -n 7 <actual >actual.trimmed &&
@@ -519,11 +530,11 @@ test_expect_success 'goto hunk' '
test_expect_success 'navigate to hunk via regex' '
test_when_finished "git reset" &&
tr _ " " >expect <<-EOF &&
- (2/2) Stage this hunk [y,n,q,a,d,K,g,/,e,?]? @@ -1,2 +1,3 @@
+ (2/2) Stage this hunk [y,n,q,a,d,K,g,/,e,p,?]? @@ -1,2 +1,3 @@
_10
+15
_20
- (1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,e,?]?_
+ (1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,e,p,?]?_
EOF
test_write_lines s y /1,2 | git add -p >actual &&
tail -n 5 <actual >actual.trimmed &&
@@ -547,15 +558,7 @@ test_expect_success 'split hunk "add -p (edit)"' '
! grep "^+15" actual
'
-test_expect_success 'setup ADD_I_USE_BUILTIN check' '
- result=success &&
- if ! test_have_prereq ADD_I_USE_BUILTIN
- then
- result=failure
- fi
-'
-
-test_expect_$result 'split hunk "add -p (no, yes, edit)"' '
+test_expect_success 'split hunk "add -p (no, yes, edit)"' '
test_write_lines 5 10 20 21 30 31 40 50 60 >test &&
git reset &&
# test sequence is s(plit), n(o), y(es), e(dit)
@@ -579,7 +582,7 @@ test_expect_success 'split hunk with incomplete line at end' '
test_must_fail git grep --cached before
'
-test_expect_$result 'edit, adding lines to the first hunk' '
+test_expect_success 'edit, adding lines to the first hunk' '
test_write_lines 10 11 20 30 40 50 51 60 >test &&
git reset &&
tr _ " " >patch <<-EOF &&
@@ -712,25 +715,63 @@ test_expect_success 'colors can be overridden' '
<BLUE>+<RESET><BLUE>new<RESET>
<CYAN> more-context<RESET>
<BLUE>+<RESET><BLUE>another-one<RESET>
- <YELLOW>(1/1) Stage this hunk [y,n,q,a,d,s,e,?]? <RESET><BOLD>Split into 2 hunks.<RESET>
+ <YELLOW>(1/1) Stage this hunk [y,n,q,a,d,s,e,p,?]? <RESET><BOLD>Split into 2 hunks.<RESET>
<MAGENTA>@@ -1,3 +1,3 @@<RESET>
<CYAN> context<RESET>
<BOLD>-old<RESET>
<BLUE>+<RESET><BLUE>new<RESET>
<CYAN> more-context<RESET>
- <YELLOW>(1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,e,?]? <RESET><MAGENTA>@@ -3 +3,2 @@<RESET>
+ <YELLOW>(1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,e,p,?]? <RESET><MAGENTA>@@ -3 +3,2 @@<RESET>
<CYAN> more-context<RESET>
<BLUE>+<RESET><BLUE>another-one<RESET>
- <YELLOW>(2/2) Stage this hunk [y,n,q,a,d,K,g,/,e,?]? <RESET><MAGENTA>@@ -1,3 +1,3 @@<RESET>
+ <YELLOW>(2/2) Stage this hunk [y,n,q,a,d,K,g,/,e,p,?]? <RESET><MAGENTA>@@ -1,3 +1,3 @@<RESET>
<CYAN> context<RESET>
<BOLD>-old<RESET>
<BLUE>+new<RESET>
<CYAN> more-context<RESET>
- <YELLOW>(1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,e,?]? <RESET>
+ <YELLOW>(1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,e,p,?]? <RESET>
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'brackets appear without color' '
+ git reset --hard &&
+ test_when_finished "git rm -f bracket-test" &&
+ test_write_lines context old more-context >bracket-test &&
+ git add bracket-test &&
+ test_write_lines context new more-context another-one >bracket-test &&
+
+ test_write_lines quit >input &&
+ git add -i >actual <input &&
+
+ sed "s/^|//" >expect <<-\EOF &&
+ | staged unstaged path
+ | 1: +3/-0 +2/-1 bracket-test
+ |
+ |*** Commands ***
+ | 1: [s]tatus 2: [u]pdate 3: [r]evert 4: [a]dd untracked
+ | 5: [p]atch 6: [d]iff 7: [q]uit 8: [h]elp
+ |What now> Bye.
EOF
+
test_cmp expect actual
'
+test_expect_success 'colors can be skipped with color.ui=false' '
+ git reset --hard &&
+ test_when_finished "git rm -f color-test" &&
+ test_write_lines context old more-context >color-test &&
+ git add color-test &&
+ test_write_lines context new more-context another-one >color-test &&
+
+ test_write_lines help quit >input &&
+ force_color git \
+ -c color.ui=false \
+ add -i >actual.raw <input &&
+ test_decode_color <actual.raw >actual &&
+ test_cmp actual.raw actual
+'
+
test_expect_success 'colorized diffs respect diff.wsErrorHighlight' '
git reset --hard &&
@@ -761,9 +802,33 @@ test_expect_success 'detect bogus diffFilter output' '
git reset --hard &&
echo content >test &&
- test_config interactive.diffFilter "sed 1d" &&
+ test_config interactive.diffFilter "sed 6d" &&
+ printf y >y &&
+ force_color test_must_fail git add -p <y >output 2>&1 &&
+ grep "mismatched output" output
+'
+
+test_expect_success 'handle iffy colored hunk headers' '
+ git reset --hard &&
+
+ echo content >test &&
+ printf n >n &&
+ force_color git -c interactive.diffFilter="sed s/.*@@.*/XX/" \
+ add -p >output 2>&1 <n &&
+ grep "^XX$" output
+'
+
+test_expect_success 'handle very large filtered diff' '
+ git reset --hard &&
+ # The specific number here is not important, but it must
+ # be large enough that the output of "git diff --color"
+ # fills up the pipe buffer. 10,000 results in ~200k of
+ # colored output.
+ test_seq 10000 >test &&
+ test_config interactive.diffFilter cat &&
printf y >y &&
- force_color test_must_fail git add -p <y
+ force_color git add -p >output 2>&1 <y &&
+ git diff-files --exit-code -- test
'
test_expect_success 'diff.algorithm is passed to `git diff-files`' '
@@ -773,7 +838,7 @@ test_expect_success 'diff.algorithm is passed to `git diff-files`' '
git add file &&
echo changed >file &&
test_must_fail git -c diff.algorithm=bogus add -p 2>err &&
- test_i18ngrep "error: option diff-algorithm accepts " err
+ test_grep "error: option diff-algorithm accepts " err
'
test_expect_success 'patch-mode via -i prompts for files' '
@@ -931,6 +996,18 @@ test_expect_success 'status ignores dirty submodules (except HEAD)' '
! grep dirty-otherwise output
'
+test_expect_success 'handle submodules' '
+ echo 123 >>for-submodules/dirty-otherwise/initial.t &&
+
+ force_color git -C for-submodules add -p dirty-otherwise >output 2>&1 &&
+ grep "No changes" output &&
+
+ force_color git -C for-submodules add -p dirty-head >output 2>&1 <y &&
+ git -C for-submodules ls-files --stage dirty-head >actual &&
+ rev="$(git -C for-submodules/dirty-head rev-parse HEAD)" &&
+ grep "$rev" actual
+'
+
test_expect_success 'set up pathological context' '
git reset --hard &&
test_write_lines a a a a a a a a a a a >a &&
@@ -1032,4 +1109,25 @@ test_expect_success 'show help from add--helper' '
test_cmp expect actual
'
+test_expect_success 'reset -p with unmerged files' '
+ test_when_finished "git checkout --force main" &&
+ test_commit one conflict &&
+ git checkout -B side HEAD^ &&
+ test_commit two conflict &&
+ test_must_fail git merge one &&
+
+ # this is a noop with only an unmerged entry
+ git reset -p &&
+
+ # add files that sort before and after unmerged entry
+ echo a >a &&
+ echo z >z &&
+ git add a z &&
+
+ # confirm that we can reset those files
+ printf "%s\n" y y | git reset -p &&
+ git diff-index --cached --diff-filter=u HEAD >staged &&
+ test_must_be_empty staged
+'
+
test_done
diff --git a/t/t3702-add-edit.sh b/t/t3702-add-edit.sh
index a1801a8..82bfb2f 100755
--- a/t/t3702-add-edit.sh
+++ b/t/t3702-add-edit.sh
@@ -100,7 +100,7 @@ EOF
echo "#!$SHELL_PATH" >fake-editor.sh
cat >> fake-editor.sh <<\EOF
-egrep -v '^index' "$1" >orig-patch &&
+grep -E -v '^index' "$1" >orig-patch &&
mv -f patch "$1"
EOF
diff --git a/t/t3704-add-pathspec-file.sh b/t/t3704-add-pathspec-file.sh
index 4e6b517..3aa59f6 100755
--- a/t/t3704-add-pathspec-file.sh
+++ b/t/t3704-add-pathspec-file.sh
@@ -138,23 +138,23 @@ test_expect_success 'error conditions' '
>empty_list &&
test_must_fail git add --pathspec-from-file=list --interactive 2>err &&
- test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err &&
+ test_grep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err &&
test_must_fail git add --pathspec-from-file=list --patch 2>err &&
- test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err &&
+ test_grep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err &&
test_must_fail git add --pathspec-from-file=list --edit 2>err &&
- test_i18ngrep -e "options .--pathspec-from-file. and .--edit. cannot be used together" err &&
+ test_grep -e "options .--pathspec-from-file. and .--edit. cannot be used together" err &&
test_must_fail git add --pathspec-from-file=list -- fileA.t 2>err &&
- test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
+ test_grep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
test_must_fail git add --pathspec-file-nul 2>err &&
- test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
+ test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
# This case succeeds, but still prints to stderr
git add --pathspec-from-file=empty_list 2>err &&
- test_i18ngrep -e "Nothing specified, nothing added." err
+ test_grep -e "Nothing specified, nothing added." err
'
test_done
diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh
index e3cf0ff..d3e428f 100755
--- a/t/t3800-mktag.sh
+++ b/t/t3800-mktag.sh
@@ -4,6 +4,7 @@
test_description='git mktag: tag object verify test'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
###########################################################
diff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh
index bfab245..f27d09c 100755
--- a/t/t3900-i18n-commit.sh
+++ b/t/t3900-i18n-commit.sh
@@ -45,7 +45,7 @@ test_expect_success 'UTF-8 invalid characters refused' '
printf "Commit message\n\nInvalid surrogate:\355\240\200\n" \
>"$HOME/invalid" &&
git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&
- test_i18ngrep "did not conform" "$HOME"/stderr
+ test_grep "did not conform" "$HOME"/stderr
'
test_expect_success 'UTF-8 overlong sequences rejected' '
@@ -55,7 +55,7 @@ test_expect_success 'UTF-8 overlong sequences rejected' '
printf "\340\202\251ommit message\n\nThis is not a space:\300\240\n" \
>"$HOME/invalid" &&
git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&
- test_i18ngrep "did not conform" "$HOME"/stderr
+ test_grep "did not conform" "$HOME"/stderr
'
test_expect_success 'UTF-8 non-characters refused' '
@@ -64,7 +64,7 @@ test_expect_success 'UTF-8 non-characters refused' '
printf "Commit message\n\nNon-character:\364\217\277\276\n" \
>"$HOME/invalid" &&
git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&
- test_i18ngrep "did not conform" "$HOME"/stderr
+ test_grep "did not conform" "$HOME"/stderr
'
test_expect_success 'UTF-8 non-characters refused' '
@@ -73,7 +73,7 @@ test_expect_success 'UTF-8 non-characters refused' '
printf "Commit message\n\nNon-character:\357\267\220\n" \
>"$HOME/invalid" &&
git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&
- test_i18ngrep "did not conform" "$HOME"/stderr
+ test_grep "did not conform" "$HOME"/stderr
'
for H in ISO8859-1 eucJP ISO-2022-JP
diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh
index 4f16a73..4b37f78 100755
--- a/t/t3901-i18n-patch.sh
+++ b/t/t3901-i18n-patch.sh
@@ -298,7 +298,7 @@ test_expect_success 'am --no-utf8 (U/L)' '
# commit-tree will warn that the commit message does not contain valid UTF-8
# as mailinfo did not convert it
- test_i18ngrep "did not conform" err &&
+ test_grep "did not conform" err &&
check_encoding 2
'
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 2a4c3fd..00db82f 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -25,7 +25,7 @@ test_expect_success 'usage on main command -h emits a summary of subcommands' '
grep -F "or: git stash show" usage
'
-test_expect_failure 'usage for subcommands should emit subcommand usage' '
+test_expect_success 'usage for subcommands should emit subcommand usage' '
test_expect_code 129 git stash push -h >usage &&
grep -F "usage: git stash [push" usage
'
@@ -200,7 +200,7 @@ test_expect_success 'drop stash reflog updates refs/stash' '
test_cmp expect actual
'
-test_expect_success REFFILES 'drop stash reflog updates refs/stash with rewrite' '
+test_expect_success 'drop stash reflog updates refs/stash with rewrite' '
git init repo &&
(
cd repo &&
@@ -213,16 +213,16 @@ test_expect_success REFFILES 'drop stash reflog updates refs/stash with rewrite'
new_oid="$(git -C repo rev-parse stash@{0})" &&
cat >expect <<-EOF &&
- $(test_oid zero) $old_oid
- $old_oid $new_oid
+ $new_oid
+ $old_oid
EOF
- cut -d" " -f1-2 repo/.git/logs/refs/stash >actual &&
+ git -C repo reflog show refs/stash --format=%H >actual &&
test_cmp expect actual &&
git -C repo stash drop stash@{1} &&
- cut -d" " -f1-2 repo/.git/logs/refs/stash >actual &&
+ git -C repo reflog show refs/stash --format=%H >actual &&
cat >expect <<-EOF &&
- $(test_oid zero) $new_oid
+ $new_oid
EOF
test_cmp expect actual
'
@@ -395,7 +395,7 @@ test_expect_success 'stash --staged' '
test_expect_success 'dont assume push with non-option args' '
test_must_fail git stash -q drop 2>err &&
- test_i18ngrep -e "subcommand wasn'\''t specified; '\''push'\'' can'\''t be assumed due to unexpected token '\''drop'\''" err
+ test_grep -e "subcommand wasn'\''t specified; '\''push'\'' can'\''t be assumed due to unexpected token '\''drop'\''" err
'
test_expect_success 'stash --invalid-option' '
@@ -596,7 +596,7 @@ test_expect_success 'giving too many ref arguments does not modify files' '
for type in apply pop "branch stash-branch"
do
test_must_fail git stash $type stash@{0} stash@{1} 2>err &&
- test_i18ngrep "Too many revisions" err &&
+ test_grep "Too many revisions" err &&
test 123456789 = $(test-tool chmtime -g file2) || return 1
done
'
@@ -604,14 +604,14 @@ test_expect_success 'giving too many ref arguments does not modify files' '
test_expect_success 'drop: too many arguments errors out (does nothing)' '
git stash list >expect &&
test_must_fail git stash drop stash@{0} stash@{1} 2>err &&
- test_i18ngrep "Too many revisions" err &&
+ test_grep "Too many revisions" err &&
git stash list >actual &&
test_cmp expect actual
'
test_expect_success 'show: too many arguments errors out (does nothing)' '
test_must_fail git stash show stash@{0} stash@{1} 2>err 1>out &&
- test_i18ngrep "Too many revisions" err &&
+ test_grep "Too many revisions" err &&
test_must_be_empty out
'
@@ -654,7 +654,7 @@ test_expect_success 'stash branch - stashes on stack, stash-like argument' '
test_expect_success 'stash branch complains with no arguments' '
test_must_fail git stash branch 2>err &&
- test_i18ngrep "No branch name specified" err
+ test_grep "No branch name specified" err
'
test_expect_success 'stash show format defaults to --stat' '
@@ -931,6 +931,10 @@ test_expect_success 'store called with invalid commit' '
test_must_fail git stash store foo
'
+test_expect_success 'store called with non-stash commit' '
+ test_must_fail git stash store HEAD
+'
+
test_expect_success 'store updates stash ref and reflog' '
git stash clear &&
git reset --hard &&
@@ -1211,19 +1215,19 @@ test_expect_success 'stash with file including $IFS character' '
'
test_expect_success 'stash with pathspec matching multiple paths' '
- echo original >file &&
- echo original >other-file &&
- git commit -m "two" file other-file &&
- echo modified >file &&
- echo modified >other-file &&
- git stash push -- "*file" &&
- echo original >expect &&
- test_cmp expect file &&
- test_cmp expect other-file &&
- git stash pop &&
- echo modified >expect &&
- test_cmp expect file &&
- test_cmp expect other-file
+ echo original >file &&
+ echo original >other-file &&
+ git commit -m "two" file other-file &&
+ echo modified >file &&
+ echo modified >other-file &&
+ git stash push -- "*file" &&
+ echo original >expect &&
+ test_cmp expect file &&
+ test_cmp expect other-file &&
+ git stash pop &&
+ echo modified >expect &&
+ test_cmp expect file &&
+ test_cmp expect other-file
'
test_expect_success 'stash push -p with pathspec shows no changes only once' '
@@ -1512,4 +1516,56 @@ test_expect_success 'restore untracked files even when we hit conflicts' '
)
'
+test_expect_success 'stash create reports a locked index' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit A A.file &&
+ echo change >A.file &&
+ touch .git/index.lock &&
+
+ cat >expect <<-EOF &&
+ error: could not write index
+ EOF
+ test_must_fail git stash create 2>err &&
+ test_cmp expect err
+ )
+'
+
+test_expect_success 'stash push reports a locked index' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit A A.file &&
+ echo change >A.file &&
+ touch .git/index.lock &&
+
+ cat >expect <<-EOF &&
+ error: could not write index
+ EOF
+ test_must_fail git stash push 2>err &&
+ test_cmp expect err
+ )
+'
+
+test_expect_success 'stash apply reports a locked index' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit A A.file &&
+ echo change >A.file &&
+ git stash push &&
+ touch .git/index.lock &&
+
+ cat >expect <<-EOF &&
+ error: could not write index
+ EOF
+ test_must_fail git stash apply 2>err &&
+ test_cmp expect err
+ )
+'
+
test_done
diff --git a/t/t3904-stash-patch.sh b/t/t3904-stash-patch.sh
index accfe38..368fc2a 100755
--- a/t/t3904-stash-patch.sh
+++ b/t/t3904-stash-patch.sh
@@ -3,12 +3,6 @@
test_description='stash -p'
. ./lib-patch-mode.sh
-if ! test_have_prereq PERL
-then
- skip_all='skipping stash -p tests, perl not available'
- test_done
-fi
-
test_expect_success 'setup' '
mkdir dir &&
echo parent > dir/foo &&
diff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh
index 5390eec..1289ae3 100755
--- a/t/t3905-stash-include-untracked.sh
+++ b/t/t3905-stash-include-untracked.sh
@@ -404,7 +404,7 @@ test_expect_success 'stash show --include-untracked errors on duplicate files' '
) &&
w_commit=$(git commit-tree -p HEAD -p "$i_commit" -p "$u_commit" -m "WIP on any-branch" "$tree") &&
test_must_fail git stash show --include-untracked "$w_commit" 2>err &&
- test_i18ngrep "worktree and untracked commit have duplicate entries: tracked" err
+ test_grep "worktree and untracked commit have duplicate entries: tracked" err
'
test_expect_success 'stash show --{include,only}-untracked on stashes without untracked entries' '
diff --git a/t/t3906-stash-submodule.sh b/t/t3906-stash-submodule.sh
index a52e53d..0f7348e 100755
--- a/t/t3906-stash-submodule.sh
+++ b/t/t3906-stash-submodule.sh
@@ -36,7 +36,7 @@ setup_basic () {
git init main &&
(
cd main &&
- git submodule add ../sub &&
+ git -c protocol.file.allow=always submodule add ../sub &&
test_commit main_file
)
}
diff --git a/t/t3909-stash-pathspec-file.sh b/t/t3909-stash-pathspec-file.sh
index dead9f1..73f2dbd 100755
--- a/t/t3909-stash-pathspec-file.sh
+++ b/t/t3909-stash-pathspec-file.sh
@@ -88,13 +88,13 @@ test_expect_success 'error conditions' '
echo fileA.t >list &&
test_must_fail git stash push --pathspec-from-file=list --patch 2>err &&
- test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err &&
+ test_grep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err &&
test_must_fail git stash push --pathspec-from-file=list -- fileA.t 2>err &&
- test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
+ test_grep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
test_must_fail git stash push --pathspec-file-nul 2>err &&
- test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err
+ test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err
'
test_done
diff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh
index 0276edb..50ae222 100755
--- a/t/t3920-crlf-messages.sh
+++ b/t/t3920-crlf-messages.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='Test ref-filter and pretty APIs for commit and tag messages using CRLF'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
LIB_CRLF_BRANCHES=""
@@ -8,9 +10,9 @@ LIB_CRLF_BRANCHES=""
create_crlf_ref () {
branch="$1" &&
cat >.crlf-orig-$branch.txt &&
- cat .crlf-orig-$branch.txt | append_cr >.crlf-message-$branch.txt &&
+ append_cr <.crlf-orig-$branch.txt >.crlf-message-$branch.txt &&
grep 'Subject' .crlf-orig-$branch.txt | tr '\n' ' ' | sed 's/[ ]*$//' | tr -d '\n' >.crlf-subject-$branch.txt &&
- grep 'Body' .crlf-message-$branch.txt >.crlf-body-$branch.txt || true &&
+ grep 'Body' .crlf-orig-$branch.txt | append_cr >.crlf-body-$branch.txt &&
LIB_CRLF_BRANCHES="${LIB_CRLF_BRANCHES} ${branch}" &&
test_tick &&
hash=$(git commit-tree HEAD^{tree} -p HEAD -F .crlf-message-${branch}.txt) &&
@@ -95,7 +97,7 @@ test_expect_success 'branch: --verbose works with messages using CRLF' '
git branch -v >tmp &&
# Remove first two columns, and the line for the currently checked out branch
current=$(git branch --show-current) &&
- grep -v $current <tmp | awk "{\$1=\$2=\"\"}1" >actual &&
+ awk "/$current/ { next } { \$1 = \$2 = \"\" } 1" <tmp >actual &&
test_cmp expect actual
'
diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh
index bfcaae3..8d50331 100755
--- a/t/t4000-diff-format.sh
+++ b/t/t4000-diff-format.sh
@@ -5,6 +5,9 @@
test_description='Test built-in diff output engine.
+We happen to know that all diff plumbing and diff Porcelain share the
+same command line parser, so testing one should be sufficient; pick
+diff-files as a representative.
'
TEST_PASSES_SANITIZE_LEAK=true
@@ -16,9 +19,11 @@ Line 2
line 3'
cat path0 >path1
chmod +x path1
+mkdir path2
+>path2/path3
test_expect_success 'update-index --add two files with and without +x.' '
- git update-index --add path0 path1
+ git update-index --add path0 path1 path2/path3
'
mv path0 path0-
@@ -91,4 +96,31 @@ test_expect_success 'git diff-files --patch --no-patch does not show the patch'
test_must_be_empty err
'
+
+# Smudge path2/path3 so that dirstat has something to show
+date >path2/path3
+
+for format in stat raw numstat shortstat summary \
+ dirstat cumulative dirstat-by-file \
+ patch-with-raw patch-with-stat compact-summary
+do
+ test_expect_success "--no-patch in 'git diff-files --no-patch --$format' is a no-op" '
+ git diff-files --no-patch "--$format" >actual &&
+ git diff-files "--$format" >expect &&
+ test_cmp expect actual
+ '
+
+ test_expect_success "--no-patch clears all previous ones" '
+ git diff-files --$format -s -p >actual &&
+ git diff-files -p >expect &&
+ test_cmp expect actual
+ '
+
+ test_expect_success "--no-patch in 'git diff --no-patch --$format' is a no-op" '
+ git diff --no-patch "--$format" >actual &&
+ git diff "--$format" >expect &&
+ test_cmp expect actual
+ '
+done
+
test_done
diff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh
index 3dc9047..49c042a 100755
--- a/t/t4001-diff-rename.sh
+++ b/t/t4001-diff-rename.sh
@@ -135,25 +135,25 @@ test_expect_success 'favour same basenames over different ones' '
mkdir subdir &&
git mv another-path subdir/path1 &&
git status >out &&
- test_i18ngrep "renamed: .*path1 -> subdir/path1" out
+ test_grep "renamed: .*path1 -> subdir/path1" out
'
test_expect_success 'test diff.renames=true for git status' '
git -c diff.renames=true status >out &&
- test_i18ngrep "renamed: .*path1 -> subdir/path1" out
+ test_grep "renamed: .*path1 -> subdir/path1" out
'
test_expect_success 'test diff.renames=false for git status' '
git -c diff.renames=false status >out &&
- test_i18ngrep ! "renamed: .*path1 -> subdir/path1" out &&
- test_i18ngrep "new file: .*subdir/path1" out &&
- test_i18ngrep "deleted: .*[^/]path1" out
+ test_grep ! "renamed: .*path1 -> subdir/path1" out &&
+ test_grep "new file: .*subdir/path1" out &&
+ test_grep "deleted: .*[^/]path1" out
'
test_expect_success 'favour same basenames even with minor differences' '
git show HEAD:path1 | sed "s/15/16/" > subdir/path1 &&
git status >out &&
- test_i18ngrep "renamed: .*path1 -> subdir/path1" out
+ test_grep "renamed: .*path1 -> subdir/path1" out
'
test_expect_success 'two files with same basename and same content' '
@@ -165,7 +165,7 @@ test_expect_success 'two files with same basename and same content' '
git commit -m 2 &&
git mv dir other-dir &&
git status >out &&
- test_i18ngrep "renamed: .*dir/A/file -> other-dir/A/file" out
+ test_grep "renamed: .*dir/A/file -> other-dir/A/file" out
'
test_expect_success 'setup for many rename source candidates' '
@@ -202,9 +202,9 @@ test_expect_success 'rename pretty print with nothing in common' '
git mv a/b/c c/b/a &&
git commit -m "a/b/c -> c/b/a" &&
git diff -M --summary HEAD^ HEAD >output &&
- test_i18ngrep " a/b/c => c/b/a " output &&
+ test_grep " a/b/c => c/b/a " output &&
git diff -M --stat HEAD^ HEAD >output &&
- test_i18ngrep " a/b/c => c/b/a " output
+ test_grep " a/b/c => c/b/a " output
'
test_expect_success 'rename pretty print with common prefix' '
@@ -212,9 +212,9 @@ test_expect_success 'rename pretty print with common prefix' '
git mv c/b/a c/d/e &&
git commit -m "c/b/a -> c/d/e" &&
git diff -M --summary HEAD^ HEAD >output &&
- test_i18ngrep " c/{b/a => d/e} " output &&
+ test_grep " c/{b/a => d/e} " output &&
git diff -M --stat HEAD^ HEAD >output &&
- test_i18ngrep " c/{b/a => d/e} " output
+ test_grep " c/{b/a => d/e} " output
'
test_expect_success 'rename pretty print with common suffix' '
@@ -222,9 +222,9 @@ test_expect_success 'rename pretty print with common suffix' '
git mv c/d/e d/e &&
git commit -m "c/d/e -> d/e" &&
git diff -M --summary HEAD^ HEAD >output &&
- test_i18ngrep " {c/d => d}/e " output &&
+ test_grep " {c/d => d}/e " output &&
git diff -M --stat HEAD^ HEAD >output &&
- test_i18ngrep " {c/d => d}/e " output
+ test_grep " {c/d => d}/e " output
'
test_expect_success 'rename pretty print with common prefix and suffix' '
@@ -232,9 +232,9 @@ test_expect_success 'rename pretty print with common prefix and suffix' '
git mv d/e d/f/e &&
git commit -m "d/e -> d/f/e" &&
git diff -M --summary HEAD^ HEAD >output &&
- test_i18ngrep " d/{ => f}/e " output &&
+ test_grep " d/{ => f}/e " output &&
git diff -M --stat HEAD^ HEAD >output &&
- test_i18ngrep " d/{ => f}/e " output
+ test_grep " d/{ => f}/e " output
'
test_expect_success 'rename pretty print common prefix and suffix overlap' '
@@ -242,9 +242,9 @@ test_expect_success 'rename pretty print common prefix and suffix overlap' '
git mv d/f/e d/f/f/e &&
git commit -m "d/f/e d/f/f/e" &&
git diff -M --summary HEAD^ HEAD >output &&
- test_i18ngrep " d/f/{ => f}/e " output &&
+ test_grep " d/f/{ => f}/e " output &&
git diff -M --stat HEAD^ HEAD >output &&
- test_i18ngrep " d/f/{ => f}/e " output
+ test_grep " d/f/{ => f}/e " output
'
test_expect_success 'diff-tree -l0 defaults to a big rename limit, not zero' '
@@ -286,4 +286,28 @@ test_expect_success 'basename similarity vs best similarity' '
test_cmp expected actual
'
+test_expect_success 'last line matters too' '
+ {
+ test_write_lines a 0 1 2 3 4 5 6 7 8 9 &&
+ printf "git ignores final up to 63 characters if not newline terminated"
+ } >no-final-lf &&
+ git add no-final-lf &&
+ git commit -m "original version of file with no final newline" &&
+
+ # Change ONLY the first character of the whole file
+ {
+ test_write_lines b 0 1 2 3 4 5 6 7 8 9 &&
+ printf "git ignores final up to 63 characters if not newline terminated"
+ } >no-final-lf &&
+ git add no-final-lf &&
+ git mv no-final-lf still-absent-final-lf &&
+ git commit -a -m "rename no-final-lf -> still-absent-final-lf" &&
+ git diff-tree -r -M --name-status HEAD^ HEAD >actual &&
+ sed -e "s/^R[0-9]* /R /" actual >actual.munged &&
+ cat >expected <<-\EOF &&
+ R no-final-lf still-absent-final-lf
+ EOF
+ test_cmp expected actual.munged
+'
+
test_done
diff --git a/t/t4002-diff-basic.sh b/t/t4002-diff-basic.sh
index ea52e5b..cb33070 100755
--- a/t/t4002-diff-basic.sh
+++ b/t/t4002-diff-basic.sh
@@ -284,132 +284,131 @@ cmp_diff_files_output () {
test_cmp "$1" .test-tmp
}
-test_expect_success \
- 'diff-tree of known trees.' \
- 'git diff-tree $tree_O $tree_A >.test-a &&
- cmp -s .test-a .test-plain-OA'
-
-test_expect_success \
- 'diff-tree of known trees.' \
- 'git diff-tree -r $tree_O $tree_A >.test-a &&
- cmp -s .test-a .test-recursive-OA'
-
-test_expect_success \
- 'diff-tree of known trees.' \
- 'git diff-tree $tree_O $tree_B >.test-a &&
- cmp -s .test-a .test-plain-OB'
-
-test_expect_success \
- 'diff-tree of known trees.' \
- 'git diff-tree -r $tree_O $tree_B >.test-a &&
- cmp -s .test-a .test-recursive-OB'
-
-test_expect_success \
- 'diff-tree of known trees.' \
- 'git diff-tree $tree_A $tree_B >.test-a &&
- cmp -s .test-a .test-plain-AB'
-
-test_expect_success \
- 'diff-tree of known trees.' \
- 'git diff-tree -r $tree_A $tree_B >.test-a &&
- cmp -s .test-a .test-recursive-AB'
-
-test_expect_success \
- 'diff-tree --stdin of known trees.' \
- 'echo $tree_A $tree_B | git diff-tree --stdin > .test-a &&
- echo $tree_A $tree_B > .test-plain-ABx &&
- cat .test-plain-AB >> .test-plain-ABx &&
- cmp -s .test-a .test-plain-ABx'
-
-test_expect_success \
- 'diff-tree --stdin of known trees.' \
- 'echo $tree_A $tree_B | git diff-tree -r --stdin > .test-a &&
- echo $tree_A $tree_B > .test-recursive-ABx &&
- cat .test-recursive-AB >> .test-recursive-ABx &&
- cmp -s .test-a .test-recursive-ABx'
-
-test_expect_success \
- 'diff-cache O with A in cache' \
- 'git read-tree $tree_A &&
- git diff-index --cached $tree_O >.test-a &&
- cmp -s .test-a .test-recursive-OA'
-
-test_expect_success \
- 'diff-cache O with B in cache' \
- 'git read-tree $tree_B &&
- git diff-index --cached $tree_O >.test-a &&
- cmp -s .test-a .test-recursive-OB'
-
-test_expect_success \
- 'diff-cache A with B in cache' \
- 'git read-tree $tree_B &&
- git diff-index --cached $tree_A >.test-a &&
- cmp -s .test-a .test-recursive-AB'
-
-test_expect_success \
- 'diff-files with O in cache and A checked out' \
- 'rm -fr Z [A-Z][A-Z] &&
- git read-tree $tree_A &&
- git checkout-index -f -a &&
- git read-tree --reset $tree_O &&
- test_must_fail git update-index --refresh -q &&
- git diff-files >.test-a &&
- cmp_diff_files_output .test-a .test-recursive-OA'
-
-test_expect_success \
- 'diff-files with O in cache and B checked out' \
- 'rm -fr Z [A-Z][A-Z] &&
- git read-tree $tree_B &&
- git checkout-index -f -a &&
- git read-tree --reset $tree_O &&
- test_must_fail git update-index --refresh -q &&
- git diff-files >.test-a &&
- cmp_diff_files_output .test-a .test-recursive-OB'
-
-test_expect_success \
- 'diff-files with A in cache and B checked out' \
- 'rm -fr Z [A-Z][A-Z] &&
- git read-tree $tree_B &&
- git checkout-index -f -a &&
- git read-tree --reset $tree_A &&
- test_must_fail git update-index --refresh -q &&
- git diff-files >.test-a &&
- cmp_diff_files_output .test-a .test-recursive-AB'
+test_expect_success 'diff-tree of known trees.' '
+ git diff-tree $tree_O $tree_A >.test-a &&
+ cmp -s .test-a .test-plain-OA
+'
+
+test_expect_success 'diff-tree of known trees.' '
+ git diff-tree -r $tree_O $tree_A >.test-a &&
+ cmp -s .test-a .test-recursive-OA
+'
+
+test_expect_success 'diff-tree of known trees.' '
+ git diff-tree $tree_O $tree_B >.test-a &&
+ cmp -s .test-a .test-plain-OB
+'
+
+test_expect_success 'diff-tree of known trees.' '
+ git diff-tree -r $tree_O $tree_B >.test-a &&
+ cmp -s .test-a .test-recursive-OB
+'
+
+test_expect_success 'diff-tree of known trees.' '
+ git diff-tree $tree_A $tree_B >.test-a &&
+ cmp -s .test-a .test-plain-AB
+'
+
+test_expect_success 'diff-tree of known trees.' '
+ git diff-tree -r $tree_A $tree_B >.test-a &&
+ cmp -s .test-a .test-recursive-AB
+'
+
+test_expect_success 'diff-tree --stdin of known trees.' '
+ echo $tree_A $tree_B | git diff-tree --stdin > .test-a &&
+ echo $tree_A $tree_B > .test-plain-ABx &&
+ cat .test-plain-AB >> .test-plain-ABx &&
+ cmp -s .test-a .test-plain-ABx
+'
+
+test_expect_success 'diff-tree --stdin of known trees.' '
+ echo $tree_A $tree_B | git diff-tree -r --stdin > .test-a &&
+ echo $tree_A $tree_B > .test-recursive-ABx &&
+ cat .test-recursive-AB >> .test-recursive-ABx &&
+ cmp -s .test-a .test-recursive-ABx
+'
+
+test_expect_success 'diff-cache O with A in cache' '
+ git read-tree $tree_A &&
+ git diff-index --cached $tree_O >.test-a &&
+ cmp -s .test-a .test-recursive-OA
+'
+
+test_expect_success 'diff-cache O with B in cache' '
+ git read-tree $tree_B &&
+ git diff-index --cached $tree_O >.test-a &&
+ cmp -s .test-a .test-recursive-OB
+'
+
+test_expect_success 'diff-cache A with B in cache' '
+ git read-tree $tree_B &&
+ git diff-index --cached $tree_A >.test-a &&
+ cmp -s .test-a .test-recursive-AB
+'
+
+test_expect_success 'diff-files with O in cache and A checked out' '
+ rm -fr Z [A-Z][A-Z] &&
+ git read-tree $tree_A &&
+ git checkout-index -f -a &&
+ git read-tree --reset $tree_O &&
+ test_must_fail git update-index --refresh -q &&
+ git diff-files >.test-a &&
+ cmp_diff_files_output .test-a .test-recursive-OA
+'
+
+test_expect_success 'diff-files with O in cache and B checked out' '
+ rm -fr Z [A-Z][A-Z] &&
+ git read-tree $tree_B &&
+ git checkout-index -f -a &&
+ git read-tree --reset $tree_O &&
+ test_must_fail git update-index --refresh -q &&
+ git diff-files >.test-a &&
+ cmp_diff_files_output .test-a .test-recursive-OB
+'
+
+test_expect_success 'diff-files with A in cache and B checked out' '
+ rm -fr Z [A-Z][A-Z] &&
+ git read-tree $tree_B &&
+ git checkout-index -f -a &&
+ git read-tree --reset $tree_A &&
+ test_must_fail git update-index --refresh -q &&
+ git diff-files >.test-a &&
+ cmp_diff_files_output .test-a .test-recursive-AB
+'
################################################################
# Now we have established the baseline, we do not have to
# rely on individual object ID values that much.
-test_expect_success \
- 'diff-tree O A == diff-tree -R A O' \
- 'git diff-tree $tree_O $tree_A >.test-a &&
- git diff-tree -R $tree_A $tree_O >.test-b &&
- cmp -s .test-a .test-b'
-
-test_expect_success \
- 'diff-tree -r O A == diff-tree -r -R A O' \
- 'git diff-tree -r $tree_O $tree_A >.test-a &&
- git diff-tree -r -R $tree_A $tree_O >.test-b &&
- cmp -s .test-a .test-b'
-
-test_expect_success \
- 'diff-tree B A == diff-tree -R A B' \
- 'git diff-tree $tree_B $tree_A >.test-a &&
- git diff-tree -R $tree_A $tree_B >.test-b &&
- cmp -s .test-a .test-b'
-
-test_expect_success \
- 'diff-tree -r B A == diff-tree -r -R A B' \
- 'git diff-tree -r $tree_B $tree_A >.test-a &&
- git diff-tree -r -R $tree_A $tree_B >.test-b &&
- cmp -s .test-a .test-b'
-
-test_expect_success \
- 'diff can read from stdin' \
- 'test_must_fail git diff --no-index -- MN - < NN |
- grep -v "^index" | sed "s#/-#/NN#" >.test-a &&
- test_must_fail git diff --no-index -- MN NN |
- grep -v "^index" >.test-b &&
- test_cmp .test-a .test-b'
+test_expect_success 'diff-tree O A == diff-tree -R A O' '
+ git diff-tree $tree_O $tree_A >.test-a &&
+ git diff-tree -R $tree_A $tree_O >.test-b &&
+ cmp -s .test-a .test-b
+'
+
+test_expect_success 'diff-tree -r O A == diff-tree -r -R A O' '
+ git diff-tree -r $tree_O $tree_A >.test-a &&
+ git diff-tree -r -R $tree_A $tree_O >.test-b &&
+ cmp -s .test-a .test-b
+'
+
+test_expect_success 'diff-tree B A == diff-tree -R A B' '
+ git diff-tree $tree_B $tree_A >.test-a &&
+ git diff-tree -R $tree_A $tree_B >.test-b &&
+ cmp -s .test-a .test-b
+'
+
+test_expect_success 'diff-tree -r B A == diff-tree -r -R A B' '
+ git diff-tree -r $tree_B $tree_A >.test-a &&
+ git diff-tree -r -R $tree_A $tree_B >.test-b &&
+ cmp -s .test-a .test-b'
+
+test_expect_success 'diff can read from stdin' '
+ test_must_fail git diff --no-index -- MN - < NN |
+ sed "/^index/d; s#/-#/NN#" >.test-a &&
+ test_must_fail git diff --no-index -- MN NN |
+ grep -v "^index" >.test-b &&
+ test_cmp .test-a .test-b
+'
test_done
diff --git a/t/t4003-diff-rename-1.sh b/t/t4003-diff-rename-1.sh
index 181e968..ebe0918 100755
--- a/t/t4003-diff-rename-1.sh
+++ b/t/t4003-diff-rename-1.sh
@@ -11,20 +11,20 @@ TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
-test_expect_success \
- 'prepare reference tree' \
- 'COPYING_test_data >COPYING &&
- echo frotz >rezrov &&
- git update-index --add COPYING rezrov &&
- tree=$(git write-tree) &&
- echo $tree'
-
-test_expect_success \
- 'prepare work tree' \
- 'sed -e 's/HOWEVER/However/' <COPYING >COPYING.1 &&
- sed -e 's/GPL/G.P.L/g' <COPYING >COPYING.2 &&
- rm -f COPYING &&
- git update-index --add --remove COPYING COPYING.?'
+test_expect_success 'prepare reference tree' '
+ COPYING_test_data >COPYING &&
+ echo frotz >rezrov &&
+ git update-index --add COPYING rezrov &&
+ tree=$(git write-tree) &&
+ echo $tree
+'
+
+test_expect_success 'prepare work tree' '
+ sed -e 's/HOWEVER/However/' <COPYING >COPYING.1 &&
+ sed -e 's/GPL/G.P.L/g' <COPYING >COPYING.2 &&
+ rm -f COPYING &&
+ git update-index --add --remove COPYING COPYING.?
+'
# tree has COPYING and rezrov. work tree has COPYING.1 and COPYING.2,
# both are slightly edited, and unchanged rezrov. So we say you
@@ -57,14 +57,14 @@ rename to COPYING.2
+ This file is licensed under the G.P.L v2, or a later version
EOF
-test_expect_success \
- 'validate output from rename/copy detection (#1)' \
- 'compare_diff_patch current expected'
+test_expect_success 'validate output from rename/copy detection (#1)' '
+ compare_diff_patch current expected
+'
-test_expect_success \
- 'prepare work tree again' \
- 'mv COPYING.2 COPYING &&
- git update-index --add --remove COPYING COPYING.1 COPYING.2'
+test_expect_success 'prepare work tree again' '
+ mv COPYING.2 COPYING &&
+ git update-index --add --remove COPYING COPYING.1 COPYING.2
+'
# tree has COPYING and rezrov. work tree has COPYING and COPYING.1,
# both are slightly edited, and unchanged rezrov. So we say you
@@ -95,14 +95,14 @@ copy to COPYING.1
+ However, in order to allow a migration to GPLv3 if that seems like
EOF
-test_expect_success \
- 'validate output from rename/copy detection (#2)' \
- 'compare_diff_patch current expected'
+test_expect_success 'validate output from rename/copy detection (#2)' '
+ compare_diff_patch current expected
+'
-test_expect_success \
- 'prepare work tree once again' \
- 'COPYING_test_data >COPYING &&
- git update-index --add --remove COPYING COPYING.1'
+test_expect_success 'prepare work tree once again' '
+ COPYING_test_data >COPYING &&
+ git update-index --add --remove COPYING COPYING.1
+'
# tree has COPYING and rezrov. work tree has COPYING and COPYING.1,
# but COPYING is not edited. We say you copy-and-edit COPYING.1; this
@@ -123,8 +123,8 @@ copy to COPYING.1
+ However, in order to allow a migration to GPLv3 if that seems like
EOF
-test_expect_success \
- 'validate output from rename/copy detection (#3)' \
- 'compare_diff_patch current expected'
+test_expect_success 'validate output from rename/copy detection (#3)' '
+ compare_diff_patch current expected
+'
test_done
diff --git a/t/t4004-diff-rename-symlink.sh b/t/t4004-diff-rename-symlink.sh
index 8def4d4..1d70d4d 100755
--- a/t/t4004-diff-rename-symlink.sh
+++ b/t/t4004-diff-rename-symlink.sh
@@ -14,21 +14,21 @@ TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-diff.sh
-test_expect_success SYMLINKS \
- 'prepare reference tree' \
- 'echo xyzzy | tr -d '\\\\'012 >yomin &&
- ln -s xyzzy frotz &&
- git update-index --add frotz yomin &&
- tree=$(git write-tree) &&
- echo $tree'
+test_expect_success SYMLINKS 'prepare reference tree' '
+ echo xyzzy | tr -d '\\\\'012 >yomin &&
+ ln -s xyzzy frotz &&
+ git update-index --add frotz yomin &&
+ tree=$(git write-tree) &&
+ echo $tree
+'
-test_expect_success SYMLINKS \
- 'prepare work tree' \
- 'mv frotz rezrov &&
- rm -f yomin &&
- ln -s xyzzy nitfol &&
- ln -s xzzzy bozbar &&
- git update-index --add --remove frotz rezrov nitfol bozbar yomin'
+test_expect_success SYMLINKS 'prepare work tree' '
+ mv frotz rezrov &&
+ rm -f yomin &&
+ ln -s xyzzy nitfol &&
+ ln -s xzzzy bozbar &&
+ git update-index --add --remove frotz rezrov nitfol bozbar yomin
+'
# tree has frotz pointing at xyzzy, and yomin that contains xyzzy to
# confuse things. work tree has rezrov (xyzzy) nitfol (xyzzy) and
@@ -36,9 +36,9 @@ test_expect_success SYMLINKS \
# rezrov and nitfol are rename/copy of frotz and bozbar should be
# a new creation.
-test_expect_success SYMLINKS 'setup diff output' "
- GIT_DIFF_OPTS=--unified=0 git diff-index -C -p $tree >current &&
- cat >expected <<\EOF
+test_expect_success SYMLINKS 'setup diff output' '
+ GIT_DIFF_OPTS=--unified=0 git diff-index -C -p $tree >current &&
+ cat >expected <<\EOF
diff --git a/bozbar b/bozbar
new file mode 120000
--- /dev/null
@@ -62,10 +62,10 @@ deleted file mode 100644
-xyzzy
\ No newline at end of file
EOF
-"
+'
-test_expect_success SYMLINKS \
- 'validate diff output' \
- 'compare_diff_patch current expected'
+test_expect_success SYMLINKS 'validate diff output' '
+ compare_diff_patch current expected
+'
test_done
diff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh
index d7a5f7a..bc8ba88 100755
--- a/t/t4011-diff-symlink.sh
+++ b/t/t4011-diff-symlink.sh
@@ -13,13 +13,13 @@ TEST_PASSES_SANITIZE_LEAK=true
# Print the short OID of a symlink with the given name.
symlink_oid () {
- local oid=$(printf "%s" "$1" | git hash-object --stdin) &&
+ local oid="$(printf "%s" "$1" | git hash-object --stdin)" &&
git rev-parse --short "$oid"
}
# Print the short OID of the given file.
short_oid () {
- local oid=$(git hash-object "$1") &&
+ local oid="$(git hash-object "$1")" &&
git rev-parse --short "$oid"
}
diff --git a/t/t4012-diff-binary.sh b/t/t4012-diff-binary.sh
index c509143..c64d9d2 100755
--- a/t/t4012-diff-binary.sh
+++ b/t/t4012-diff-binary.sh
@@ -113,20 +113,20 @@ test_expect_success 'diff --no-index with binary creation' '
'
cat >expect <<EOF
- binfile | Bin 0 -> 1026 bytes
- textfile | 10000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ binfilë | Bin 0 -> 1026 bytes
+ tëxtfilë | 10000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
EOF
test_expect_success 'diff --stat with binary files and big change count' '
- printf "\01\00%1024d" 1 >binfile &&
- git add binfile &&
+ printf "\01\00%1024d" 1 >binfilë &&
+ git add binfilë &&
i=0 &&
while test $i -lt 10000; do
echo $i &&
i=$(($i + 1)) || return 1
- done >textfile &&
- git add textfile &&
- git diff --cached --stat binfile textfile >output &&
+ done >tëxtfilë &&
+ git add tëxtfilë &&
+ git -c core.quotepath=false diff --cached --stat binfilë tëxtfilë >output &&
grep " | " output >actual &&
test_cmp expect actual
'
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index 056e922..3855d68 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -178,32 +178,29 @@ process_diffs () {
V=$(git version | sed -e 's/^git version //' -e 's/\./\\./g')
while read magic cmd
do
- status=success
case "$magic" in
'' | '#'*)
continue ;;
- :*)
- magic=${magic#:}
+ :noellipses)
+ magic=noellipses
label="$magic-$cmd"
- case "$magic" in
- noellipses) ;;
- failure)
- status=failure
- magic=
- label="$cmd" ;;
- *)
- BUG "unknown magic $magic" ;;
- esac ;;
+ ;;
+ :*)
+ BUG "unknown magic $magic"
+ ;;
*)
- cmd="$magic $cmd" magic=
- label="$cmd" ;;
+ cmd="$magic $cmd"
+ magic=
+ label="$cmd"
+ ;;
esac
+
test=$(echo "$label" | sed -e 's|[/ ][/ ]*|_|g')
pfx=$(printf "%04d" $test_count)
expect="$TEST_DIRECTORY/t4013/diff.$test"
actual="$pfx-diff.$test"
- test_expect_$status "git $cmd # magic is ${magic:-(not used)}" '
+ test_expect_success "git $cmd # magic is ${magic:-(not used)}" '
{
echo "$ git $cmd"
case "$magic" in
@@ -352,6 +349,8 @@ log -GF -p --pickaxe-all master
log -IA -IB -I1 -I2 -p master
log --decorate --all
log --decorate=full --all
+log --decorate --clear-decorations --all
+log --decorate=full --clear-decorations --all
rev-list --parents HEAD
rev-list --children HEAD
@@ -471,6 +470,14 @@ test_expect_success 'log --diff-merges=on matches --diff-merges=separate' '
test_cmp expected actual
'
+test_expect_success 'log --dd matches --diff-merges=1 -p' '
+ git log --diff-merges=1 -p master >result &&
+ process_diffs result >expected &&
+ git log --dd master >result &&
+ process_diffs result >actual &&
+ test_cmp expected actual
+'
+
test_expect_success 'deny wrong log.diffMerges config' '
test_config log.diffMerges wrong-value &&
test_expect_code 128 git log
@@ -512,7 +519,7 @@ test_expect_success 'log -S requires an argument' '
'
test_expect_success 'diff --cached on unborn branch' '
- echo ref: refs/heads/unborn >.git/HEAD &&
+ git symbolic-ref HEAD refs/heads/unborn &&
git diff --cached >result &&
process_diffs result >actual &&
process_diffs "$TEST_DIRECTORY/t4013/diff.diff_--cached" >expected &&
@@ -611,7 +618,90 @@ test_expect_success 'diff -I<regex> --stat' '
test_expect_success 'diff -I<regex>: detect malformed regex' '
test_expect_code 129 git diff --ignore-matching-lines="^[124-9" 2>error &&
- test_i18ngrep "invalid regex given to -I: " error
+ test_grep "invalid regex given to -I: " error
+'
+
+# check_prefix <patch> <src> <dst>
+# check only lines with paths to avoid dependency on exact oid/contents
+check_prefix () {
+ grep -E '^(diff|---|\+\+\+) ' "$1" >actual.paths &&
+ cat >expect <<-EOF &&
+ diff --git $2 $3
+ --- $2
+ +++ $3
+ EOF
+ test_cmp expect actual.paths
+}
+
+test_expect_success 'diff-files does not respect diff.noPrefix' '
+ git -c diff.noPrefix diff-files -p >actual &&
+ check_prefix actual a/file0 b/file0
+'
+
+test_expect_success 'diff-files respects --no-prefix' '
+ git diff-files -p --no-prefix >actual &&
+ check_prefix actual file0 file0
+'
+
+test_expect_success 'diff respects diff.noPrefix' '
+ git -c diff.noPrefix diff >actual &&
+ check_prefix actual file0 file0
+'
+
+test_expect_success 'diff --default-prefix overrides diff.noPrefix' '
+ git -c diff.noPrefix diff --default-prefix >actual &&
+ check_prefix actual a/file0 b/file0
+'
+
+test_expect_success 'diff respects diff.mnemonicPrefix' '
+ git -c diff.mnemonicPrefix diff >actual &&
+ check_prefix actual i/file0 w/file0
+'
+
+test_expect_success 'diff --default-prefix overrides diff.mnemonicPrefix' '
+ git -c diff.mnemonicPrefix diff --default-prefix >actual &&
+ check_prefix actual a/file0 b/file0
+'
+
+test_expect_success 'diff respects diff.srcPrefix' '
+ git -c diff.srcPrefix=x/ diff >actual &&
+ check_prefix actual x/file0 b/file0
+'
+
+test_expect_success 'diff respects diff.dstPrefix' '
+ git -c diff.dstPrefix=y/ diff >actual &&
+ check_prefix actual a/file0 y/file0
+'
+
+test_expect_success 'diff --src-prefix overrides diff.srcPrefix' '
+ git -c diff.srcPrefix=y/ diff --src-prefix=z/ >actual &&
+ check_prefix actual z/file0 b/file0
+'
+
+test_expect_success 'diff --dst-prefix overrides diff.dstPrefix' '
+ git -c diff.dstPrefix=y/ diff --dst-prefix=z/ >actual &&
+ check_prefix actual a/file0 z/file0
+'
+
+test_expect_success 'diff.{src,dst}Prefix ignored with diff.noPrefix' '
+ git -c diff.dstPrefix=y/ -c diff.srcPrefix=x/ -c diff.noPrefix diff >actual &&
+ check_prefix actual file0 file0
+'
+
+test_expect_success 'diff.{src,dst}Prefix ignored with diff.mnemonicPrefix' '
+ git -c diff.dstPrefix=x/ -c diff.srcPrefix=y/ -c diff.mnemonicPrefix diff >actual &&
+ check_prefix actual i/file0 w/file0
+'
+
+test_expect_success 'diff.{src,dst}Prefix ignored with --default-prefix' '
+ git -c diff.dstPrefix=x/ -c diff.srcPrefix=y/ diff --default-prefix >actual &&
+ check_prefix actual a/file0 b/file0
+'
+
+test_expect_success 'diff --no-renames cannot be abbreviated' '
+ test_expect_code 129 git diff --no-rename >actual 2>error &&
+ test_must_be_empty actual &&
+ grep "invalid option: --no-rename" error
'
test_done
diff --git a/t/t4013/diff.log_--decorate=full_--all b/t/t4013/diff.log_--decorate=full_--all
index 3f9b872..6b0b334 100644
--- a/t/t4013/diff.log_--decorate=full_--all
+++ b/t/t4013/diff.log_--decorate=full_--all
@@ -20,7 +20,7 @@ Date: Mon Jun 26 00:06:00 2006 +0000
Rearranged lines in dir/sub
-commit cbacedd14cb8b89255a2c02b59e77a2e9a8021a0 (refs/notes/commits)
+commit cbacedd14cb8b89255a2c02b59e77a2e9a8021a0
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:06:00 2006 +0000
diff --git a/t/t4013/diff.log_--decorate=full_--clear-decorations_--all b/t/t4013/diff.log_--decorate=full_--clear-decorations_--all
new file mode 100644
index 0000000..1c030a6
--- /dev/null
+++ b/t/t4013/diff.log_--decorate=full_--clear-decorations_--all
@@ -0,0 +1,61 @@
+$ git log --decorate=full --clear-decorations --all
+commit b7e0bc69303b488b47deca799a7d723971dfa6cd (refs/heads/mode)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:06:00 2006 +0000
+
+ update mode
+
+commit a6f364368ca320bc5a92e18912e16fa6b3dff598 (refs/heads/note)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:06:00 2006 +0000
+
+ update mode (file2)
+
+Notes:
+ note
+
+commit cd4e72fd96faed3f0ba949dc42967430374e2290 (refs/heads/rearrange)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:06:00 2006 +0000
+
+ Rearranged lines in dir/sub
+
+commit cbacedd14cb8b89255a2c02b59e77a2e9a8021a0 (refs/notes/commits)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:06:00 2006 +0000
+
+ Notes added by 'git notes add'
+
+commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (HEAD -> refs/heads/master)
+Merge: 9a6d494 c7a2ab9
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:04:00 2006 +0000
+
+ Merge branch 'side'
+
+commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a (refs/heads/side)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:03:00 2006 +0000
+
+ Side
+
+commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:02:00 2006 +0000
+
+ Third
+
+commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:01:00 2006 +0000
+
+ Second
+
+ This is the second commit.
+
+commit 444ac553ac7612cc88969031b02b3767fb8a353a (refs/heads/initial)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:00:00 2006 +0000
+
+ Initial
+$
diff --git a/t/t4013/diff.log_--decorate=full_--decorate-all_--all b/t/t4013/diff.log_--decorate=full_--decorate-all_--all
new file mode 100644
index 0000000..d6e7928
--- /dev/null
+++ b/t/t4013/diff.log_--decorate=full_--decorate-all_--all
@@ -0,0 +1,61 @@
+$ git log --decorate=full --decorate-all --all
+commit b7e0bc69303b488b47deca799a7d723971dfa6cd (refs/heads/mode)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:06:00 2006 +0000
+
+ update mode
+
+commit a6f364368ca320bc5a92e18912e16fa6b3dff598 (refs/heads/note)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:06:00 2006 +0000
+
+ update mode (file2)
+
+Notes:
+ note
+
+commit cd4e72fd96faed3f0ba949dc42967430374e2290 (refs/heads/rearrange)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:06:00 2006 +0000
+
+ Rearranged lines in dir/sub
+
+commit cbacedd14cb8b89255a2c02b59e77a2e9a8021a0 (refs/notes/commits)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:06:00 2006 +0000
+
+ Notes added by 'git notes add'
+
+commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (HEAD -> refs/heads/master)
+Merge: 9a6d494 c7a2ab9
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:04:00 2006 +0000
+
+ Merge branch 'side'
+
+commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a (refs/heads/side)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:03:00 2006 +0000
+
+ Side
+
+commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:02:00 2006 +0000
+
+ Third
+
+commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:01:00 2006 +0000
+
+ Second
+
+ This is the second commit.
+
+commit 444ac553ac7612cc88969031b02b3767fb8a353a (refs/heads/initial)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:00:00 2006 +0000
+
+ Initial
+$
diff --git a/t/t4013/diff.log_--decorate_--all b/t/t4013/diff.log_--decorate_--all
index f5e20e1..c7df1f5 100644
--- a/t/t4013/diff.log_--decorate_--all
+++ b/t/t4013/diff.log_--decorate_--all
@@ -20,7 +20,7 @@ Date: Mon Jun 26 00:06:00 2006 +0000
Rearranged lines in dir/sub
-commit cbacedd14cb8b89255a2c02b59e77a2e9a8021a0 (refs/notes/commits)
+commit cbacedd14cb8b89255a2c02b59e77a2e9a8021a0
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:06:00 2006 +0000
diff --git a/t/t4013/diff.log_--decorate_--clear-decorations_--all b/t/t4013/diff.log_--decorate_--clear-decorations_--all
new file mode 100644
index 0000000..88be82c
--- /dev/null
+++ b/t/t4013/diff.log_--decorate_--clear-decorations_--all
@@ -0,0 +1,61 @@
+$ git log --decorate --clear-decorations --all
+commit b7e0bc69303b488b47deca799a7d723971dfa6cd (mode)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:06:00 2006 +0000
+
+ update mode
+
+commit a6f364368ca320bc5a92e18912e16fa6b3dff598 (note)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:06:00 2006 +0000
+
+ update mode (file2)
+
+Notes:
+ note
+
+commit cd4e72fd96faed3f0ba949dc42967430374e2290 (rearrange)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:06:00 2006 +0000
+
+ Rearranged lines in dir/sub
+
+commit cbacedd14cb8b89255a2c02b59e77a2e9a8021a0 (refs/notes/commits)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:06:00 2006 +0000
+
+ Notes added by 'git notes add'
+
+commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (HEAD -> master)
+Merge: 9a6d494 c7a2ab9
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:04:00 2006 +0000
+
+ Merge branch 'side'
+
+commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a (side)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:03:00 2006 +0000
+
+ Side
+
+commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:02:00 2006 +0000
+
+ Third
+
+commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:01:00 2006 +0000
+
+ Second
+
+ This is the second commit.
+
+commit 444ac553ac7612cc88969031b02b3767fb8a353a (initial)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:00:00 2006 +0000
+
+ Initial
+$
diff --git a/t/t4013/diff.log_--decorate_--decorate-all_--all b/t/t4013/diff.log_--decorate_--decorate-all_--all
new file mode 100644
index 0000000..5d22618
--- /dev/null
+++ b/t/t4013/diff.log_--decorate_--decorate-all_--all
@@ -0,0 +1,61 @@
+$ git log --decorate --decorate-all --all
+commit b7e0bc69303b488b47deca799a7d723971dfa6cd (mode)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:06:00 2006 +0000
+
+ update mode
+
+commit a6f364368ca320bc5a92e18912e16fa6b3dff598 (note)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:06:00 2006 +0000
+
+ update mode (file2)
+
+Notes:
+ note
+
+commit cd4e72fd96faed3f0ba949dc42967430374e2290 (rearrange)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:06:00 2006 +0000
+
+ Rearranged lines in dir/sub
+
+commit cbacedd14cb8b89255a2c02b59e77a2e9a8021a0 (refs/notes/commits)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:06:00 2006 +0000
+
+ Notes added by 'git notes add'
+
+commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (HEAD -> master)
+Merge: 9a6d494 c7a2ab9
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:04:00 2006 +0000
+
+ Merge branch 'side'
+
+commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a (side)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:03:00 2006 +0000
+
+ Side
+
+commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:02:00 2006 +0000
+
+ Third
+
+commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:01:00 2006 +0000
+
+ Second
+
+ This is the second commit.
+
+commit 444ac553ac7612cc88969031b02b3767fb8a353a (initial)
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:00:00 2006 +0000
+
+ Initial
+$
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index fbec8ad..e37a141 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -59,6 +59,10 @@ test_expect_success setup '
test_tick &&
git commit -m "patchid 3" &&
+ git checkout -b empty main &&
+ test_tick &&
+ git commit --allow-empty -m "empty commit" &&
+
git checkout main
'
@@ -128,6 +132,12 @@ test_expect_success 'replay did not screw up the log message' '
grep "^Side .* with .* backslash-n" actual
'
+test_expect_success 'format-patch empty commit' '
+ git format-patch --stdout main..empty >empty &&
+ grep "^From " empty >from &&
+ test_line_count = 1 from
+'
+
test_expect_success 'extra headers' '
git config format.headers "To: R E Cipient <rcipient@example.com>
" &&
@@ -445,13 +455,13 @@ test_expect_success 'no threading' '
cat >expect.thread <<EOF
---
-Message-Id: <0>
+Message-ID: <0>
---
-Message-Id: <1>
+Message-ID: <1>
In-Reply-To: <0>
References: <0>
---
-Message-Id: <2>
+Message-ID: <2>
In-Reply-To: <0>
References: <0>
EOF
@@ -460,17 +470,22 @@ test_expect_success 'thread' '
check_threading expect.thread --thread main
'
+test_expect_success '--thread overrides format.thread=deep' '
+ test_config format.thread deep &&
+ check_threading expect.thread --thread main
+'
+
cat >expect.in-reply-to <<EOF
---
-Message-Id: <0>
+Message-ID: <0>
In-Reply-To: <1>
References: <1>
---
-Message-Id: <2>
+Message-ID: <2>
In-Reply-To: <1>
References: <1>
---
-Message-Id: <3>
+Message-ID: <3>
In-Reply-To: <1>
References: <1>
EOF
@@ -482,17 +497,17 @@ test_expect_success 'thread in-reply-to' '
cat >expect.cover-letter <<EOF
---
-Message-Id: <0>
+Message-ID: <0>
---
-Message-Id: <1>
+Message-ID: <1>
In-Reply-To: <0>
References: <0>
---
-Message-Id: <2>
+Message-ID: <2>
In-Reply-To: <0>
References: <0>
---
-Message-Id: <3>
+Message-ID: <3>
In-Reply-To: <0>
References: <0>
EOF
@@ -503,21 +518,21 @@ test_expect_success 'thread cover-letter' '
cat >expect.cl-irt <<EOF
---
-Message-Id: <0>
+Message-ID: <0>
In-Reply-To: <1>
References: <1>
---
-Message-Id: <2>
+Message-ID: <2>
In-Reply-To: <0>
References: <1>
<0>
---
-Message-Id: <3>
+Message-ID: <3>
In-Reply-To: <0>
References: <1>
<0>
---
-Message-Id: <4>
+Message-ID: <4>
In-Reply-To: <0>
References: <1>
<0>
@@ -535,13 +550,13 @@ test_expect_success 'thread explicit shallow' '
cat >expect.deep <<EOF
---
-Message-Id: <0>
+Message-ID: <0>
---
-Message-Id: <1>
+Message-ID: <1>
In-Reply-To: <0>
References: <0>
---
-Message-Id: <2>
+Message-ID: <2>
In-Reply-To: <1>
References: <0>
<1>
@@ -553,16 +568,16 @@ test_expect_success 'thread deep' '
cat >expect.deep-irt <<EOF
---
-Message-Id: <0>
+Message-ID: <0>
In-Reply-To: <1>
References: <1>
---
-Message-Id: <2>
+Message-ID: <2>
In-Reply-To: <0>
References: <1>
<0>
---
-Message-Id: <3>
+Message-ID: <3>
In-Reply-To: <2>
References: <1>
<0>
@@ -576,18 +591,18 @@ test_expect_success 'thread deep in-reply-to' '
cat >expect.deep-cl <<EOF
---
-Message-Id: <0>
+Message-ID: <0>
---
-Message-Id: <1>
+Message-ID: <1>
In-Reply-To: <0>
References: <0>
---
-Message-Id: <2>
+Message-ID: <2>
In-Reply-To: <1>
References: <0>
<1>
---
-Message-Id: <3>
+Message-ID: <3>
In-Reply-To: <2>
References: <0>
<1>
@@ -600,22 +615,22 @@ test_expect_success 'thread deep cover-letter' '
cat >expect.deep-cl-irt <<EOF
---
-Message-Id: <0>
+Message-ID: <0>
In-Reply-To: <1>
References: <1>
---
-Message-Id: <2>
+Message-ID: <2>
In-Reply-To: <0>
References: <1>
<0>
---
-Message-Id: <3>
+Message-ID: <3>
In-Reply-To: <2>
References: <1>
<0>
<2>
---
-Message-Id: <4>
+Message-ID: <4>
In-Reply-To: <3>
References: <1>
<0>
@@ -1358,7 +1373,27 @@ test_expect_success '--rfc' '
Subject: [RFC PATCH 1/1] header with . in it
EOF
git format-patch -n -1 --stdout --rfc >patch &&
- grep ^Subject: patch >actual &&
+ grep "^Subject:" patch >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success '--rfc does not overwrite prefix' '
+ cat >expect <<-\EOF &&
+ Subject: [RFC PATCH foobar 1/1] header with . in it
+ EOF
+ git -c format.subjectPrefix="PATCH foobar" \
+ format-patch -n -1 --stdout --rfc >patch &&
+ grep "^Subject:" patch >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success '--rfc is argument order independent' '
+ cat >expect <<-\EOF &&
+ Subject: [RFC PATCH foobar 1/1] header with . in it
+ EOF
+ git format-patch -n -1 --stdout --rfc \
+ --subject-prefix="PATCH foobar" >patch &&
+ grep "^Subject:" patch >actual &&
test_cmp expect actual
'
@@ -1400,6 +1435,43 @@ test_expect_success '--from omits redundant in-body header' '
test_cmp expect patch.head
'
+test_expect_success 'with --force-in-body-from, redundant in-body from is kept' '
+ git format-patch --force-in-body-from \
+ -1 --stdout --from="A U Thor <author@example.com>" >patch &&
+ cat >expect <<-\EOF &&
+ From: A U Thor <author@example.com>
+
+ From: A U Thor <author@example.com>
+
+ EOF
+ sed -ne "/^From:/p; /^$/p; /^---$/q" patch >patch.head &&
+ test_cmp expect patch.head
+'
+
+test_expect_success 'format.forceInBodyFrom, equivalent to --force-in-body-from' '
+ git -c format.forceInBodyFrom=yes format-patch \
+ -1 --stdout --from="A U Thor <author@example.com>" >patch &&
+ cat >expect <<-\EOF &&
+ From: A U Thor <author@example.com>
+
+ From: A U Thor <author@example.com>
+
+ EOF
+ sed -ne "/^From:/p; /^$/p; /^---$/q" patch >patch.head &&
+ test_cmp expect patch.head
+'
+
+test_expect_success 'format.forceInBodyFrom, equivalent to --force-in-body-from' '
+ git -c format.forceInBodyFrom=yes format-patch --no-force-in-body-from \
+ -1 --stdout --from="A U Thor <author@example.com>" >patch &&
+ cat >expect <<-\EOF &&
+ From: A U Thor <author@example.com>
+
+ EOF
+ sed -ne "/^From:/p; /^$/p; /^---$/q" patch >patch.head &&
+ test_cmp expect patch.head
+'
+
test_expect_success 'in-body headers trigger content encoding' '
test_env GIT_AUTHOR_NAME="éxötìc" test_commit exotic &&
test_when_finished "git reset --hard HEAD^" &&
@@ -1420,7 +1492,7 @@ append_signoff()
C=$(git commit-tree HEAD^^{tree} -p HEAD) &&
git format-patch --stdout --signoff $C^..$C >append_signoff.patch &&
sed -n -e "1,/^---$/p" append_signoff.patch |
- egrep -n "^Subject|Sign|^$"
+ grep -E -n "^Subject|Sign|^$"
}
test_expect_success 'signoff: commit with no body' '
@@ -1834,6 +1906,16 @@ body" &&
grep "^body$" actual
'
+test_expect_success 'cover letter with --cover-from-description subject (UTF-8 subject line)' '
+ test_config branch.rebuild-1.description "Café?
+
+body" &&
+ git checkout rebuild-1 &&
+ git format-patch --stdout --cover-letter --cover-from-description subject --encode-email-headers main >actual &&
+ grep "^Subject: \[PATCH 0/2\] =?UTF-8?q?Caf=C3=A9=3F?=$" actual &&
+ ! grep "Café" actual
+'
+
test_expect_success 'cover letter with format.coverFromDescription = auto (short subject line)' '
test_config branch.rebuild-1.description "config subject
@@ -1939,6 +2021,20 @@ test_expect_success 'cover letter using branch description (6)' '
grep hello actual
'
+test_expect_success 'cover letter with --description-file' '
+ test_when_finished "rm -f description.txt" &&
+ cat >description.txt <<-\EOF &&
+ subject from file
+
+ body from file
+ EOF
+ git checkout rebuild-1 &&
+ git format-patch --stdout --cover-letter --cover-from-description auto \
+ --description-file description.txt main >actual &&
+ grep "^Subject: \[PATCH 0/2\] subject from file$" actual &&
+ grep "^body from file$" actual
+'
+
test_expect_success 'cover letter with nothing' '
git format-patch --stdout --cover-letter >actual &&
test_line_count = 0 actual
@@ -2237,14 +2333,32 @@ test_expect_success 'format-patch --base with --attach' '
test_expect_success 'format-patch --attach cover-letter only is non-multipart' '
test_when_finished "rm -fr patches" &&
git format-patch -o patches --cover-letter --attach=mimemime --base=HEAD~ -1 &&
- ! egrep "^--+mimemime" patches/0000*.patch &&
- egrep "^--+mimemime$" patches/0001*.patch >output &&
+ ! grep -E "^--+mimemime" patches/0000*.patch &&
+ grep -E "^--+mimemime$" patches/0001*.patch >output &&
test_line_count = 2 output &&
- egrep "^--+mimemime--$" patches/0001*.patch >output &&
+ grep -E "^--+mimemime--$" patches/0001*.patch >output &&
test_line_count = 1 output
'
-test_expect_success 'format-patch --pretty=mboxrd' '
+test_expect_success 'format-patch with format.attach' '
+ test_when_finished "rm -fr patches" &&
+ separator=attachment-separator &&
+ test_config format.attach "$separator" &&
+ filename=$(git format-patch -o patches -1) &&
+ grep "^Content-Type: multipart/.*$separator" "$filename"
+'
+
+test_expect_success 'format-patch with format.attach=disabled' '
+ test_when_finished "rm -fr patches" &&
+ separator=attachment-separator &&
+ test_config_global format.attach "$separator" &&
+ test_config format.attach "" &&
+ filename=$(git format-patch -o patches -1) &&
+ # The output should not even declare content type for text/plain.
+ ! grep "^Content-Type: multipart/" "$filename"
+'
+
+test_expect_success '-c format.mboxrd format-patch' '
sp=" " &&
cat >msg <<-INPUT_END &&
mboxrd should escape the body
@@ -2279,7 +2393,9 @@ test_expect_success 'format-patch --pretty=mboxrd' '
INPUT_END
C=$(git commit-tree HEAD^^{tree} -p HEAD <msg) &&
- git format-patch --pretty=mboxrd --stdout -1 $C~1..$C >patch &&
+ git -c format.mboxrd format-patch --stdout -1 $C~1..$C >patch &&
+ git format-patch --pretty=mboxrd --stdout -1 $C~1..$C >compat &&
+ test_cmp patch compat &&
git grep -h --no-index -A11 \
"^>From could trip up a loose mbox parser" patch >actual &&
test_cmp expect actual
@@ -2297,25 +2413,25 @@ test_expect_success 'interdiff: cover-letter' '
--q
EOF
git format-patch --cover-letter --interdiff=boop~2 -1 boop &&
- test_i18ngrep "^Interdiff:$" 0000-cover-letter.patch &&
- test_i18ngrep ! "^Interdiff:$" 0001-fleep.patch &&
+ test_grep "^Interdiff:$" 0000-cover-letter.patch &&
+ test_grep ! "^Interdiff:$" 0001-fleep.patch &&
sed "1,/^@@ /d; /^-- $/q" 0000-cover-letter.patch >actual &&
test_cmp expect actual
'
test_expect_success 'interdiff: reroll-count' '
git format-patch --cover-letter --interdiff=boop~2 -v2 -1 boop &&
- test_i18ngrep "^Interdiff ..* v1:$" v2-0000-cover-letter.patch
+ test_grep "^Interdiff ..* v1:$" v2-0000-cover-letter.patch
'
test_expect_success 'interdiff: reroll-count with a non-integer' '
git format-patch --cover-letter --interdiff=boop~2 -v2.2 -1 boop &&
- test_i18ngrep "^Interdiff:$" v2.2-0000-cover-letter.patch
+ test_grep "^Interdiff:$" v2.2-0000-cover-letter.patch
'
test_expect_success 'interdiff: reroll-count with a integer' '
git format-patch --cover-letter --interdiff=boop~2 -v2 -1 boop &&
- test_i18ngrep "^Interdiff ..* v1:$" v2-0000-cover-letter.patch
+ test_grep "^Interdiff ..* v1:$" v2-0000-cover-letter.patch
'
test_expect_success 'interdiff: solo-patch' '
@@ -2324,9 +2440,25 @@ test_expect_success 'interdiff: solo-patch' '
EOF
git format-patch --interdiff=boop~2 -1 boop &&
- test_i18ngrep "^Interdiff:$" 0001-fleep.patch &&
+ test_grep "^Interdiff:$" 0001-fleep.patch &&
sed "1,/^ @@ /d; /^$/q" 0001-fleep.patch >actual &&
test_cmp expect actual
'
+test_expect_success 'format-patch does not respect diff.noprefix' '
+ git -c diff.noprefix format-patch -1 --stdout >actual &&
+ grep "^--- a/blorp" actual
+'
+
+test_expect_success 'format-patch respects format.noprefix' '
+ git -c format.noprefix format-patch -1 --stdout >actual &&
+ grep "^--- blorp" actual
+'
+
+test_expect_success 'format-patch --default-prefix overrides format.noprefix' '
+ git -c format.noprefix \
+ format-patch -1 --default-prefix --stdout >actual &&
+ grep "^--- a/blorp" actual
+'
+
test_done
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index f3e20dd..b443626 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#
# Copyright (c) 2006 Johannes E. Schindelin
-#
+# Copyright (c) 2023 Google LLC
test_description='Test special whitespace in diff engine.
@@ -11,6 +11,43 @@ TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-diff.sh
+for opt_res in --patch --quiet -s --stat --shortstat --dirstat=lines \
+ --raw! --name-only! --name-status!
+do
+ opts=${opt_res%!} expect_failure=
+ test "$opts" = "$opt_res" ||
+ expect_failure="test_expect_code 1"
+
+ test_expect_success "status with $opts (different)" '
+ echo foo >x &&
+ git add x &&
+ echo bar >x &&
+ test_expect_code 1 git diff -w $opts --exit-code x
+ '
+
+ test_expect_success POSIXPERM "status with $opts (mode differs)" '
+ test_when_finished "git update-index --chmod=-x x" &&
+ echo foo >x &&
+ git add x &&
+ git update-index --chmod=+x x &&
+ test_expect_code 1 git diff -w $opts --exit-code x
+ '
+
+ test_expect_success "status with $opts (removing an empty file)" '
+ : >x &&
+ git add x &&
+ rm x &&
+ test_expect_code 1 git diff -w $opts --exit-code -- x
+ '
+
+ test_expect_success "status with $opts (different but equivalent)" '
+ echo foo >x &&
+ git add x &&
+ echo " foo" >x &&
+ $expect_failure git diff -w $opts --exit-code x
+ '
+done
+
test_expect_success "Ray Lehtiniemi's example" '
cat <<-\EOF >x &&
do {
@@ -909,7 +946,7 @@ test_expect_success 'combined diff with autocrlf conversion' '
git commit -m "the other side" x &&
git config core.autocrlf true &&
test_must_fail git merge one-side >actual &&
- test_i18ngrep "Automatic merge failed" actual &&
+ test_grep "Automatic merge failed" actual &&
git diff >actual.raw &&
sed -e "1,/^@@@/d" actual.raw >actual &&
@@ -1638,7 +1675,7 @@ test_expect_success 'no effect on diff from --color-moved with --word-diff' '
test_cmp expect actual
'
-test_expect_success !SANITIZE_LEAK 'no effect on show from --color-moved with --word-diff' '
+test_expect_success 'no effect on show from --color-moved with --word-diff' '
git show --color-moved --word-diff >actual &&
git show --word-diff >expect &&
test_cmp expect actual
@@ -2024,7 +2061,7 @@ test_expect_success '--color-moved rewinds for MIN_ALNUM_COUNT' '
test_cmp expected actual
'
-test_expect_success !SANITIZE_LEAK 'move detection with submodules' '
+test_expect_success 'move detection with submodules' '
test_create_repo bananas &&
echo ripe >bananas/recipe &&
git -C bananas add recipe &&
@@ -2187,27 +2224,27 @@ test_expect_success 'compare whitespace delta across moved blocks' '
test_expect_success 'bogus settings in move detection erroring out' '
test_must_fail git diff --color-moved=bogus 2>err &&
- test_i18ngrep "must be one of" err &&
- test_i18ngrep bogus err &&
+ test_grep "must be one of" err &&
+ test_grep bogus err &&
test_must_fail git -c diff.colormoved=bogus diff 2>err &&
- test_i18ngrep "must be one of" err &&
- test_i18ngrep "from command-line config" err &&
+ test_grep "must be one of" err &&
+ test_grep "from command-line config" err &&
test_must_fail git diff --color-moved-ws=bogus 2>err &&
- test_i18ngrep "possible values" err &&
- test_i18ngrep bogus err &&
+ test_grep "possible values" err &&
+ test_grep bogus err &&
test_must_fail git -c diff.colormovedws=bogus diff 2>err &&
- test_i18ngrep "possible values" err &&
- test_i18ngrep "from command-line config" err
+ test_grep "possible values" err &&
+ test_grep "from command-line config" err
'
test_expect_success 'compare whitespace delta incompatible with other space options' '
test_must_fail git diff \
--color-moved-ws=allow-indentation-change,ignore-all-space \
2>err &&
- test_i18ngrep allow-indentation-change err
+ test_grep allow-indentation-change err
'
EMPTY=''
diff --git a/t/t4017-diff-retval.sh b/t/t4017-diff-retval.sh
index ed461f4..f439f46 100755
--- a/t/t4017-diff-retval.sh
+++ b/t/t4017-diff-retval.sh
@@ -5,6 +5,7 @@ test_description='Return value of diffs'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -137,4 +138,9 @@ test_expect_success 'check honors conflict marker length' '
git reset --hard
'
+test_expect_success 'option errors are not confused by --exit-code' '
+ test_must_fail git diff --exit-code --nonsense 2>err &&
+ grep '^usage:' err
+'
+
test_done
diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh
index 42a2b9a..e026fac 100755
--- a/t/t4018-diff-funcname.sh
+++ b/t/t4018-diff-funcname.sh
@@ -53,15 +53,34 @@ do
echo "*.java diff=$p" >.gitattributes &&
test_expect_code 1 git diff --no-index \
A.java B.java 2>msg &&
- test_i18ngrep ! fatal msg &&
- test_i18ngrep ! error msg
+ test_grep ! fatal msg &&
+ test_grep ! error msg
'
test_expect_success "builtin $p wordRegex pattern compiles" '
echo "*.java diff=$p" >.gitattributes &&
test_expect_code 1 git diff --no-index --word-diff \
A.java B.java 2>msg &&
- test_i18ngrep ! fatal msg &&
- test_i18ngrep ! error msg
+ test_grep ! fatal msg &&
+ test_grep ! error msg
+ '
+
+ test_expect_success "builtin $p pattern compiles on bare repo with --attr-source" '
+ test_when_finished "rm -rf bare.git" &&
+ git checkout -B master &&
+ git add . &&
+ echo "*.java diff=notexist" >.gitattributes &&
+ git add .gitattributes &&
+ git commit -am "changing gitattributes" &&
+ git checkout -B branchA &&
+ echo "*.java diff=$p" >.gitattributes &&
+ git add .gitattributes &&
+ git commit -am "changing gitattributes" &&
+ git clone --bare --no-local . bare.git &&
+ git -C bare.git symbolic-ref HEAD refs/heads/master &&
+ test_expect_code 1 git -C bare.git --attr-source=branchA \
+ diff --exit-code HEAD:A.java HEAD:B.java 2>msg &&
+ test_grep ! fatal msg &&
+ test_grep ! error msg
'
done
@@ -69,7 +88,7 @@ test_expect_success 'last regexp must not be negated' '
echo "*.java diff=java" >.gitattributes &&
test_config diff.java.funcname "!static" &&
test_expect_code 128 git diff --no-index A.java B.java 2>msg &&
- test_i18ngrep ": Last expression must not be negated:" msg
+ test_grep ": Last expression must not be negated:" msg
'
test_expect_success 'setup hunk header tests' '
diff --git a/t/t4018/csharp-exclude-assignments b/t/t4018/csharp-exclude-assignments
new file mode 100644
index 0000000..239f312
--- /dev/null
+++ b/t/t4018/csharp-exclude-assignments
@@ -0,0 +1,20 @@
+class Example
+{
+ string Method(int RIGHT)
+ {
+ var constantAssignment = "test";
+ var methodAssignment = MethodCall();
+ var multiLineMethodAssignment = MethodCall(
+ );
+ var multiLine = "first"
+ + MethodCall()
+ +
+ ( MethodCall()
+ )
+ + MethodCall();
+
+ return "ChangeMe";
+ }
+
+ string MethodCall(int a = 0, int b = 0) => "test";
+}
diff --git a/t/t4018/csharp-exclude-control-statements b/t/t4018/csharp-exclude-control-statements
new file mode 100644
index 0000000..3a0f404
--- /dev/null
+++ b/t/t4018/csharp-exclude-control-statements
@@ -0,0 +1,34 @@
+class Example
+{
+ string Method(int RIGHT)
+ {
+ if (false)
+ {
+ return "out";
+ }
+ else { }
+ if (true) MethodCall(
+ );
+ else MethodCall(
+ );
+ switch ("test")
+ {
+ case "one":
+ return MethodCall(
+ );
+ case "two":
+ break;
+ }
+ (int, int) tuple = (1, 4);
+ switch (tuple)
+ {
+ case (1, 4):
+ MethodCall();
+ break;
+ }
+
+ return "ChangeMe";
+ }
+
+ string MethodCall(int a = 0, int b = 0) => "test";
+}
diff --git a/t/t4018/csharp-exclude-exceptions b/t/t4018/csharp-exclude-exceptions
new file mode 100644
index 0000000..b1e6425
--- /dev/null
+++ b/t/t4018/csharp-exclude-exceptions
@@ -0,0 +1,29 @@
+using System;
+
+class Example
+{
+ string Method(int RIGHT)
+ {
+ try
+ {
+ throw new Exception("fail");
+ }
+ catch (Exception)
+ {
+ }
+ finally
+ {
+ }
+ try { } catch (Exception) {}
+ try
+ {
+ throw GetException(
+ );
+ }
+ catch (Exception) { }
+
+ return "ChangeMe";
+ }
+
+ Exception GetException() => new Exception("fail");
+}
diff --git a/t/t4018/csharp-exclude-generic-method-calls b/t/t4018/csharp-exclude-generic-method-calls
new file mode 100644
index 0000000..31af546
--- /dev/null
+++ b/t/t4018/csharp-exclude-generic-method-calls
@@ -0,0 +1,12 @@
+class Example
+{
+ string Method(int RIGHT)
+ {
+ GenericMethodCall<int, int>(
+ );
+
+ return "ChangeMe";
+ }
+
+ string GenericMethodCall<T, T2>() => "test";
+}
diff --git a/t/t4018/csharp-exclude-init-dispose b/t/t4018/csharp-exclude-init-dispose
new file mode 100644
index 0000000..2bc8e19
--- /dev/null
+++ b/t/t4018/csharp-exclude-init-dispose
@@ -0,0 +1,22 @@
+using System;
+
+class Example : IDisposable
+{
+ string Method(int RIGHT)
+ {
+ new Example();
+ new Example(
+ );
+ new Example { };
+ using (this)
+ {
+ }
+ var def =
+ this is default(
+ Example);
+
+ return "ChangeMe";
+ }
+
+ public void Dispose() {}
+}
diff --git a/t/t4018/csharp-exclude-iterations b/t/t4018/csharp-exclude-iterations
new file mode 100644
index 0000000..960aa18
--- /dev/null
+++ b/t/t4018/csharp-exclude-iterations
@@ -0,0 +1,26 @@
+using System.Linq;
+
+class Example
+{
+ string Method(int RIGHT)
+ {
+ do { } while (true);
+ do MethodCall(
+ ); while (true);
+ while (true);
+ while (true) {
+ break;
+ }
+ for (int i = 0; i < 10; ++i)
+ {
+ }
+ foreach (int i in Enumerable.Range(0, 10))
+ {
+ }
+ int[] numbers = [5, 4, 1, 3, 9, 8, 6, 7, 2, 0];
+
+ return "ChangeMe";
+ }
+
+ string MethodCall(int a = 0, int b = 0) => "test";
+}
diff --git a/t/t4018/csharp-exclude-method-calls b/t/t4018/csharp-exclude-method-calls
new file mode 100644
index 0000000..51e2dc2
--- /dev/null
+++ b/t/t4018/csharp-exclude-method-calls
@@ -0,0 +1,20 @@
+class Example
+{
+ string Method(int RIGHT)
+ {
+ MethodCall();
+ MethodCall(1, 2);
+ MethodCall(
+ 1, 2);
+ MethodCall(
+ 1, 2,
+ 3);
+ MethodCall(
+ 1, MethodCall(),
+ 2);
+
+ return "ChangeMe";
+ }
+
+ int MethodCall(int a = 0, int b = 0, int c = 0) => 42;
+}
diff --git a/t/t4018/csharp-exclude-other b/t/t4018/csharp-exclude-other
new file mode 100644
index 0000000..4d5581c
--- /dev/null
+++ b/t/t4018/csharp-exclude-other
@@ -0,0 +1,18 @@
+class Example
+{
+ string Method(int RIGHT)
+ {
+ lock (this)
+ {
+ }
+ unsafe
+ {
+ byte[] bytes = [1, 2, 3];
+ fixed (byte* pointerToFirst = bytes)
+ {
+ }
+ }
+
+ return "ChangeMe";
+ }
+}
diff --git a/t/t4018/csharp-method b/t/t4018/csharp-method
new file mode 100644
index 0000000..16b367a
--- /dev/null
+++ b/t/t4018/csharp-method
@@ -0,0 +1,10 @@
+class Example
+{
+ string Method(int RIGHT)
+ {
+ // Filler
+ // Filler
+
+ return "ChangeMe";
+ }
+}
diff --git a/t/t4018/csharp-method-array b/t/t4018/csharp-method-array
new file mode 100644
index 0000000..1126de8
--- /dev/null
+++ b/t/t4018/csharp-method-array
@@ -0,0 +1,10 @@
+class Example
+{
+ string[] Method(int RIGHT)
+ {
+ // Filler
+ // Filler
+
+ return ["ChangeMe"];
+ }
+}
diff --git a/t/t4018/csharp-method-explicit b/t/t4018/csharp-method-explicit
new file mode 100644
index 0000000..5a71011
--- /dev/null
+++ b/t/t4018/csharp-method-explicit
@@ -0,0 +1,12 @@
+using System;
+
+class Example : IDisposable
+{
+ void IDisposable.Dispose() // RIGHT
+ {
+ // Filler
+ // Filler
+
+ // ChangeMe
+ }
+}
diff --git a/t/t4018/csharp-method-generics b/t/t4018/csharp-method-generics
new file mode 100644
index 0000000..b3216bf
--- /dev/null
+++ b/t/t4018/csharp-method-generics
@@ -0,0 +1,11 @@
+class Example<T1, T2>
+{
+ Example<int, string> Method<TA, TB>(TA RIGHT, TB b)
+ {
+ // Filler
+ // Filler
+
+ // ChangeMe
+ return null;
+ }
+}
diff --git a/t/t4018/csharp-method-generics-alternate-spaces b/t/t4018/csharp-method-generics-alternate-spaces
new file mode 100644
index 0000000..9583621
--- /dev/null
+++ b/t/t4018/csharp-method-generics-alternate-spaces
@@ -0,0 +1,11 @@
+class Example<T1, T2>
+{
+ Example<int,string> Method<TA ,TB>(TA RIGHT, TB b)
+ {
+ // Filler
+ // Filler
+
+ // ChangeMe
+ return null;
+ }
+}
diff --git a/t/t4018/csharp-method-modifiers b/t/t4018/csharp-method-modifiers
new file mode 100644
index 0000000..caefa8e
--- /dev/null
+++ b/t/t4018/csharp-method-modifiers
@@ -0,0 +1,13 @@
+using System.Threading.Tasks;
+
+class Example
+{
+ static internal async Task Method(int RIGHT)
+ {
+ // Filler
+ // Filler
+
+ // ChangeMe
+ await Task.Delay(1);
+ }
+}
diff --git a/t/t4018/csharp-method-multiline b/t/t4018/csharp-method-multiline
new file mode 100644
index 0000000..3983ff4
--- /dev/null
+++ b/t/t4018/csharp-method-multiline
@@ -0,0 +1,10 @@
+class Example
+{
+ string Method_RIGHT(
+ int a,
+ int b,
+ int c)
+ {
+ return "ChangeMe";
+ }
+}
diff --git a/t/t4018/csharp-method-params b/t/t4018/csharp-method-params
new file mode 100644
index 0000000..3f00410
--- /dev/null
+++ b/t/t4018/csharp-method-params
@@ -0,0 +1,10 @@
+class Example
+{
+ string Method(int RIGHT, int b, int c = 42)
+ {
+ // Filler
+ // Filler
+
+ return "ChangeMe";
+ }
+}
diff --git a/t/t4018/csharp-method-special-chars b/t/t4018/csharp-method-special-chars
new file mode 100644
index 0000000..e6c7bc0
--- /dev/null
+++ b/t/t4018/csharp-method-special-chars
@@ -0,0 +1,11 @@
+class @Some_Type
+{
+ @Some_Type @Method_With_Underscore(int RIGHT)
+ {
+ // Filler
+ // Filler
+
+ // ChangeMe
+ return new @Some_Type();
+ }
+}
diff --git a/t/t4018/csharp-method-with-spacing b/t/t4018/csharp-method-with-spacing
new file mode 100644
index 0000000..233bb97
--- /dev/null
+++ b/t/t4018/csharp-method-with-spacing
@@ -0,0 +1,10 @@
+class Example
+{
+ string Method ( int RIGHT )
+ {
+ // Filler
+ // Filler
+
+ return "ChangeMe";
+ }
+}
diff --git a/t/t4018/csharp-property b/t/t4018/csharp-property
new file mode 100644
index 0000000..e56dfce3
--- /dev/null
+++ b/t/t4018/csharp-property
@@ -0,0 +1,11 @@
+class Example
+{
+ public bool RIGHT
+ {
+ get { return true; }
+ set
+ {
+ // ChangeMe
+ }
+ }
+}
diff --git a/t/t4018/csharp-property-braces-same-line b/t/t4018/csharp-property-braces-same-line
new file mode 100644
index 0000000..608131d
--- /dev/null
+++ b/t/t4018/csharp-property-braces-same-line
@@ -0,0 +1,10 @@
+class Example
+{
+ public bool RIGHT {
+ get { return true; }
+ set
+ {
+ // ChangeMe
+ }
+ }
+}
diff --git a/t/t4018/java-class-brace-on-separate-line b/t/t4018/java-class-brace-on-separate-line
new file mode 100644
index 0000000..8795acd
--- /dev/null
+++ b/t/t4018/java-class-brace-on-separate-line
@@ -0,0 +1,6 @@
+class RIGHT
+{
+ static int ONE;
+ static int TWO;
+ static int ChangeMe;
+}
diff --git a/t/t4018/java-class-space-before-type-parameters b/t/t4018/java-class-space-before-type-parameters
new file mode 100644
index 0000000..0bdef1d
--- /dev/null
+++ b/t/t4018/java-class-space-before-type-parameters
@@ -0,0 +1,6 @@
+class RIGHT <TYPE, PARAMS, AFTER, SPACE> {
+ static int ONE;
+ static int TWO;
+ static int THREE;
+ private A ChangeMe;
+}
diff --git a/t/t4018/java-class-type-parameters b/t/t4018/java-class-type-parameters
new file mode 100644
index 0000000..579aa7a
--- /dev/null
+++ b/t/t4018/java-class-type-parameters
@@ -0,0 +1,6 @@
+class RIGHT<A, B> {
+ static int ONE;
+ static int TWO;
+ static int THREE;
+ private A ChangeMe;
+}
diff --git a/t/t4018/java-class-type-parameters-implements b/t/t4018/java-class-type-parameters-implements
new file mode 100644
index 0000000..b8038b1
--- /dev/null
+++ b/t/t4018/java-class-type-parameters-implements
@@ -0,0 +1,6 @@
+class RIGHT<A, B> implements List<A> {
+ static int ONE;
+ static int TWO;
+ static int THREE;
+ private A ChangeMe;
+}
diff --git a/t/t4018/java-interface-type-parameters b/t/t4018/java-interface-type-parameters
new file mode 100644
index 0000000..a4baa1a
--- /dev/null
+++ b/t/t4018/java-interface-type-parameters
@@ -0,0 +1,6 @@
+interface RIGHT<A, B> {
+ static int ONE;
+ static int TWO;
+ static int THREE;
+ public B foo(A ChangeMe);
+}
diff --git a/t/t4018/java-interface-type-parameters-extends b/t/t4018/java-interface-type-parameters-extends
new file mode 100644
index 0000000..31d7fb3
--- /dev/null
+++ b/t/t4018/java-interface-type-parameters-extends
@@ -0,0 +1,6 @@
+interface RIGHT<A, B> extends Function<A, B> {
+ static int ONE;
+ static int TWO;
+ static int THREE;
+ public B foo(A ChangeMe);
+}
diff --git a/t/t4018/java-non-sealed b/t/t4018/java-non-sealed
new file mode 100644
index 0000000..069087c
--- /dev/null
+++ b/t/t4018/java-non-sealed
@@ -0,0 +1,8 @@
+public abstract sealed class SealedClass {
+ public static non-sealed class RIGHT extends SealedClass {
+ static int ONE;
+ static int TWO;
+ static int THREE;
+ private int ChangeMe;
+ }
+}
diff --git a/t/t4018/java-record b/t/t4018/java-record
new file mode 100644
index 0000000..97aa819
--- /dev/null
+++ b/t/t4018/java-record
@@ -0,0 +1,6 @@
+public record RIGHT(int comp1, double comp2, String comp3) {
+ static int ONE;
+ static int TWO;
+ static int THREE;
+ static int ChangeMe;
+}
diff --git a/t/t4018/java-record-space-before-components b/t/t4018/java-record-space-before-components
new file mode 100644
index 0000000..9827f22
--- /dev/null
+++ b/t/t4018/java-record-space-before-components
@@ -0,0 +1,6 @@
+public record RIGHT (String components, String after, String space) {
+ static int ONE;
+ static int TWO;
+ static int THREE;
+ static int ChangeMe;
+}
diff --git a/t/t4018/java-record-type-parameters b/t/t4018/java-record-type-parameters
new file mode 100644
index 0000000..f62a035
--- /dev/null
+++ b/t/t4018/java-record-type-parameters
@@ -0,0 +1,6 @@
+public record RIGHT<A, N extends Number>(A comp1, N comp2, int comp3) {
+ static int ONE;
+ static int TWO;
+ static int THREE;
+ static int ChangeMe;
+}
diff --git a/t/t4018/java-sealed b/t/t4018/java-sealed
new file mode 100644
index 0000000..785fbc6
--- /dev/null
+++ b/t/t4018/java-sealed
@@ -0,0 +1,7 @@
+public abstract sealed class Sealed { // RIGHT
+ static int ONE;
+ static int TWO;
+ static int THREE;
+ public final class ChangeMe extends Sealed {
+ }
+}
diff --git a/t/t4018/java-sealed-permits b/t/t4018/java-sealed-permits
new file mode 100644
index 0000000..18dd489
--- /dev/null
+++ b/t/t4018/java-sealed-permits
@@ -0,0 +1,6 @@
+public abstract sealed class RIGHT permits PermittedA, PermittedB {
+ static int ONE;
+ static int TWO;
+ static int THREE;
+ private int ChangeMe;
+}
diff --git a/t/t4018/java-sealed-type-parameters b/t/t4018/java-sealed-type-parameters
new file mode 100644
index 0000000..e6530c4
--- /dev/null
+++ b/t/t4018/java-sealed-type-parameters
@@ -0,0 +1,6 @@
+public abstract sealed class RIGHT<A, B> {
+ static int ONE;
+ static int TWO;
+ static int THREE;
+ private int ChangeMe;
+}
diff --git a/t/t4018/java-sealed-type-parameters-implements-permits b/t/t4018/java-sealed-type-parameters-implements-permits
new file mode 100644
index 0000000..bd6e6d3
--- /dev/null
+++ b/t/t4018/java-sealed-type-parameters-implements-permits
@@ -0,0 +1,6 @@
+public abstract sealed class RIGHT<A, B> implements List<A> permits PermittedA, PermittedB {
+ static int ONE;
+ static int TWO;
+ static int THREE;
+ private int ChangeMe;
+}
diff --git a/t/t4018/java-sealed-type-parameters-permits b/t/t4018/java-sealed-type-parameters-permits
new file mode 100644
index 0000000..25a0da6
--- /dev/null
+++ b/t/t4018/java-sealed-type-parameters-permits
@@ -0,0 +1,6 @@
+public abstract sealed class RIGHT<A, B> permits PermittedA, PermittedB {
+ static int ONE;
+ static int TWO;
+ static int THREE;
+ private int ChangeMe;
+}
diff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh
index 858a552..fdd865f 100755
--- a/t/t4020-diff-external.sh
+++ b/t/t4020-diff-external.sh
@@ -33,7 +33,7 @@ test_expect_success 'GIT_EXTERNAL_DIFF environment' '
'
-test_expect_success !SANITIZE_LEAK 'GIT_EXTERNAL_DIFF environment should apply only to diff' '
+test_expect_success 'GIT_EXTERNAL_DIFF environment should apply only to diff' '
GIT_EXTERNAL_DIFF=echo git log -p -1 HEAD >out &&
grep "^diff --git a/file b/file" out
@@ -74,7 +74,7 @@ test_expect_success 'diff.external' '
test_cmp expect actual
'
-test_expect_success !SANITIZE_LEAK 'diff.external should apply only to diff' '
+test_expect_success 'diff.external should apply only to diff' '
test_config diff.external echo &&
git log -p -1 HEAD >out &&
grep "^diff --git a/file b/file" out
@@ -232,7 +232,7 @@ keep_only_cr () {
test_expect_success 'external diff with autocrlf = true' '
test_config core.autocrlf true &&
GIT_EXTERNAL_DIFF=./fake-diff.sh git diff &&
- test $(wc -l < crlfed.txt) = $(cat crlfed.txt | keep_only_cr | wc -c)
+ test $(wc -l <crlfed.txt) = $(keep_only_cr <crlfed.txt | wc -c)
'
test_expect_success 'diff --cached' '
diff --git a/t/t4022-diff-rewrite.sh b/t/t4022-diff-rewrite.sh
index 1c89050..6fed993 100755
--- a/t/t4022-diff-rewrite.sh
+++ b/t/t4022-diff-rewrite.sh
@@ -24,7 +24,7 @@ test_expect_success setup '
test_expect_success 'detect rewrite' '
actual=$(git diff-files -B --summary test) &&
- verbose expr "$actual" : " rewrite test ([0-9]*%)$"
+ expr "$actual" : " rewrite test ([0-9]*%)$"
'
diff --git a/t/t4023-diff-rename-typechange.sh b/t/t4023-diff-rename-typechange.sh
index 7cb9909..787605c 100755
--- a/t/t4023-diff-rename-typechange.sh
+++ b/t/t4023-diff-rename-typechange.sh
@@ -52,8 +52,8 @@ test_expect_success setup '
'
test_expect_success 'cross renames to be detected for regular files' '
-
- git diff-tree five six -r --name-status -B -M | sort >actual &&
+ git diff-tree five six -r --name-status -B -M >out &&
+ sort out >actual &&
{
echo "R100 foo bar" &&
echo "R100 bar foo"
@@ -63,8 +63,8 @@ test_expect_success 'cross renames to be detected for regular files' '
'
test_expect_success 'cross renames to be detected for typechange' '
-
- git diff-tree one two -r --name-status -B -M | sort >actual &&
+ git diff-tree one two -r --name-status -B -M >out &&
+ sort out >actual &&
{
echo "R100 foo bar" &&
echo "R100 bar foo"
@@ -74,8 +74,8 @@ test_expect_success 'cross renames to be detected for typechange' '
'
test_expect_success 'moves and renames' '
-
- git diff-tree three four -r --name-status -B -M | sort >actual &&
+ git diff-tree three four -r --name-status -B -M >out &&
+ sort out >actual &&
{
# see -B -M (#6) in t4008
echo "C100 foo bar" &&
diff --git a/t/t4031-diff-rewrite-binary.sh b/t/t4031-diff-rewrite-binary.sh
index eacc669..c4394a2 100755
--- a/t/t4031-diff-rewrite-binary.sh
+++ b/t/t4031-diff-rewrite-binary.sh
@@ -53,7 +53,7 @@ test_expect_success 'rewrite diff --numstat shows binary changes' '
test_expect_success 'diff --stat counts binary rewrite as 0 lines' '
git diff -B --stat --summary >diff &&
grep "Bin" diff &&
- test_i18ngrep "0 insertions.*0 deletions" diff &&
+ test_grep "0 insertions.*0 deletions" diff &&
grep " rewrite file" diff
'
diff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh
index 15764ee..74586f3 100755
--- a/t/t4034-diff-words.sh
+++ b/t/t4034-diff-words.sh
@@ -69,6 +69,10 @@ test_language_driver () {
echo "* diff='"$lang"'" >.gitattributes &&
word_diff --color-words
'
+ test_expect_success "diff driver '$lang' in Islandic" '
+ LANG=is_IS.UTF-8 LANGUAGE=is LC_ALL="$is_IS_locale" \
+ word_diff --color-words
+ '
}
test_expect_success setup '
diff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh
index 9a292ba..2ce26e5 100755
--- a/t/t4038-diff-combined.sh
+++ b/t/t4038-diff-combined.sh
@@ -80,11 +80,21 @@ test_expect_success 'check combined output (1)' '
verify_helper sidewithone
'
+test_expect_success 'check combined output (1) with git diff <rev>^!' '
+ git diff sidewithone^! -- >sidewithone &&
+ verify_helper sidewithone
+'
+
test_expect_success 'check combined output (2)' '
git show sidesansone -- >sidesansone &&
verify_helper sidesansone
'
+test_expect_success 'check combined output (2) with git diff <rev>^!' '
+ git diff sidesansone^! -- >sidesansone &&
+ verify_helper sidesansone
+'
+
test_expect_success 'diagnose truncated file' '
>file &&
git add file &&
diff --git a/t/t4040-whitespace-status.sh b/t/t4040-whitespace-status.sh
index e70e020..eec3d73 100755
--- a/t/t4040-whitespace-status.sh
+++ b/t/t4040-whitespace-status.sh
@@ -28,8 +28,7 @@ test_expect_success 'diff-tree --exit-code' '
test_expect_success 'diff-tree -b --exit-code' '
git diff -b --exit-code HEAD^ HEAD &&
- git diff-tree -b -p --exit-code HEAD^ HEAD &&
- git diff-tree -b --exit-code HEAD^ HEAD
+ git diff-tree -b -p --exit-code HEAD^ HEAD
'
test_expect_success 'diff-index --cached --exit-code' '
diff --git a/t/t4042-diff-textconv-caching.sh b/t/t4042-diff-textconv-caching.sh
index bf33aed..8ebfa3c 100755
--- a/t/t4042-diff-textconv-caching.sh
+++ b/t/t4042-diff-textconv-caching.sh
@@ -118,4 +118,26 @@ test_expect_success 'log notes cache and still use cache for -p' '
git log --no-walk -p refs/notes/textconv/magic HEAD
'
+test_expect_success 'caching is silently ignored outside repo' '
+ mkdir -p non-repo &&
+ echo one >non-repo/one &&
+ echo two >non-repo/two &&
+ echo "* diff=test" >attr &&
+ test_expect_code 1 \
+ nongit git -c core.attributesFile="$PWD/attr" \
+ -c diff.test.textconv="tr a-z A-Z <" \
+ -c diff.test.cachetextconv=true \
+ diff --no-index one two >actual &&
+ cat >expect <<-\EOF &&
+ diff --git a/one b/two
+ index 5626abf..f719efd 100644
+ --- a/one
+ +++ b/two
+ @@ -1 +1 @@
+ -ONE
+ +TWO
+ EOF
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t4044-diff-index-unique-abbrev.sh b/t/t4044-diff-index-unique-abbrev.sh
index 4701796..9f6043d 100755
--- a/t/t4044-diff-index-unique-abbrev.sh
+++ b/t/t4044-diff-index-unique-abbrev.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='test unique sha1 abbreviation on "index from..to" line'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -32,12 +34,12 @@ test_expect_success 'setup' '
100644 blob $(test_oid hash2) foo
EOF
- echo "$(test_oid val1)" > foo &&
+ test_oid val1 > foo &&
git add foo &&
git commit -m "initial" &&
git cat-file -p HEAD: > actual &&
test_cmp expect_initial actual &&
- echo "$(test_oid val2)" > foo &&
+ test_oid val2 > foo &&
git commit -a -m "update" &&
git cat-file -p HEAD: > actual &&
test_cmp expect_update actual
diff --git a/t/t4045-diff-relative.sh b/t/t4045-diff-relative.sh
index fab351b..9b46c4c 100755
--- a/t/t4045-diff-relative.sh
+++ b/t/t4045-diff-relative.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='diff --relative tests'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -162,6 +164,35 @@ check_diff_relative_option subdir file2 true --no-relative --relative
check_diff_relative_option . file2 false --no-relative --relative=subdir
check_diff_relative_option . file2 true --no-relative --relative=subdir
+test_expect_success 'external diff with --relative' '
+ test_when_finished "git reset --hard" &&
+ echo changed >file1 &&
+ echo changed >subdir/file2 &&
+
+ write_script mydiff <<-\EOF &&
+ # hacky pretend diff; the goal here is just to make sure we got
+ # passed sensible input that we _could_ diff, without relying on
+ # the specific output of a system diff tool.
+ echo "diff a/$1 b/$1" &&
+ echo "--- a/$1" &&
+ echo "+++ b/$1" &&
+ echo "@@ -1 +0,0 @@" &&
+ sed "s/^/-/" "$2" &&
+ sed "s/^/+/" "$5"
+ EOF
+
+ cat >expect <<-\EOF &&
+ diff a/file2 b/file2
+ --- a/file2
+ +++ b/file2
+ @@ -1 +0,0 @@
+ -other content
+ +changed
+ EOF
+ GIT_EXTERNAL_DIFF=./mydiff git diff --relative=subdir >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'setup diff --relative unmerged' '
test_commit zero file0 &&
test_commit base subdir/file0 &&
diff --git a/t/t4046-diff-unmerged.sh b/t/t4046-diff-unmerged.sh
index 0ae0cd3..ffaf693 100755
--- a/t/t4046-diff-unmerged.sh
+++ b/t/t4046-diff-unmerged.sh
@@ -86,4 +86,14 @@ test_expect_success 'diff-files -3' '
test_cmp diff-files-3.expect diff-files-3.actual
'
+test_expect_success 'diff --stat' '
+ for path in $paths
+ do
+ echo " $path | Unmerged" || return 1
+ done >diff-stat.expect &&
+ echo " 0 files changed" >>diff-stat.expect &&
+ git diff --cached --stat >diff-stat.actual &&
+ test_cmp diff-stat.expect diff-stat.actual
+'
+
test_done
diff --git a/t/t4047-diff-dirstat.sh b/t/t4047-diff-dirstat.sh
index 7fec2cb..7b73462 100755
--- a/t/t4047-diff-dirstat.sh
+++ b/t/t4047-diff-dirstat.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='diff --dirstat tests'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# set up two commits where the second commit has these files
@@ -941,37 +943,37 @@ test_expect_success '--dirstat=future_param,lines,0 should fail loudly' '
test_must_fail git diff --dirstat=future_param,lines,0 HEAD^..HEAD >actual_diff_dirstat 2>actual_error &&
test_debug "cat actual_error" &&
test_must_be_empty actual_diff_dirstat &&
- test_i18ngrep -q "future_param" actual_error &&
- test_i18ngrep -q "\--dirstat" actual_error
+ test_grep -q "future_param" actual_error &&
+ test_grep -q "\--dirstat" actual_error
'
test_expect_success '--dirstat=dummy1,cumulative,2dummy should report both unrecognized parameters' '
test_must_fail git diff --dirstat=dummy1,cumulative,2dummy HEAD^..HEAD >actual_diff_dirstat 2>actual_error &&
test_debug "cat actual_error" &&
test_must_be_empty actual_diff_dirstat &&
- test_i18ngrep -q "dummy1" actual_error &&
- test_i18ngrep -q "2dummy" actual_error &&
- test_i18ngrep -q "\--dirstat" actual_error
+ test_grep -q "dummy1" actual_error &&
+ test_grep -q "2dummy" actual_error &&
+ test_grep -q "\--dirstat" actual_error
'
test_expect_success 'diff.dirstat=future_param,0,lines should warn, but still work' '
git -c diff.dirstat=future_param,0,lines diff --dirstat HEAD^..HEAD >actual_diff_dirstat 2>actual_error &&
test_debug "cat actual_error" &&
test_cmp expect_diff_dirstat actual_diff_dirstat &&
- test_i18ngrep -q "future_param" actual_error &&
- test_i18ngrep -q "diff\\.dirstat" actual_error &&
+ test_grep -q "future_param" actual_error &&
+ test_grep -q "diff\\.dirstat" actual_error &&
git -c diff.dirstat=future_param,0,lines diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M 2>actual_error &&
test_debug "cat actual_error" &&
test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
- test_i18ngrep -q "future_param" actual_error &&
- test_i18ngrep -q "diff\\.dirstat" actual_error &&
+ test_grep -q "future_param" actual_error &&
+ test_grep -q "diff\\.dirstat" actual_error &&
git -c diff.dirstat=future_param,0,lines diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC 2>actual_error &&
test_debug "cat actual_error" &&
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC &&
- test_i18ngrep -q "future_param" actual_error &&
- test_i18ngrep -q "diff\\.dirstat" actual_error
+ test_grep -q "future_param" actual_error &&
+ test_grep -q "diff\\.dirstat" actual_error
'
test_expect_success '--shortstat --dirstat should output only one dirstat' '
diff --git a/t/t4051-diff-function-context.sh b/t/t4051-diff-function-context.sh
index 4838a1d..725278a 100755
--- a/t/t4051-diff-function-context.sh
+++ b/t/t4051-diff-function-context.sh
@@ -2,6 +2,7 @@
test_description='diff function context'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
dir="$TEST_DIRECTORY/t4051"
diff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh
index b5c281e..7badd72 100755
--- a/t/t4052-stat-output.sh
+++ b/t/t4052-stat-output.sh
@@ -8,10 +8,11 @@ test_description='test --stat output of various commands'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-terminal.sh
-# 120 character name
+# 120-character name
name=aaaaaaaaaa
name=$name$name$name$name$name$name$name$name$name$name$name$name
test_expect_success 'preparation' '
@@ -48,12 +49,41 @@ log -1 --stat
EOF
cat >expect.60 <<-'EOF'
- ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1 +
+ ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1 +
EOF
cat >expect.6030 <<-'EOF'
...aaaaaaaaaaaaaaaaaaaaaaaaaaa | 1 +
EOF
-cat >expect2.60 <<-'EOF'
+while read verb expect cmd args
+do
+ # No width limit applied when statNameWidth is ignored
+ case "$expect" in expect72|expect.6030)
+ test_expect_success "$cmd $verb diff.statNameWidth with long name" '
+ git -c diff.statNameWidth=30 $cmd $args >output &&
+ grep " | " output >actual &&
+ test_cmp $expect actual
+ ';;
+ esac
+ # Maximum width limit still applied when statNameWidth is ignored
+ case "$expect" in expect.60|expect.6030)
+ test_expect_success "$cmd --stat=width $verb diff.statNameWidth with long name" '
+ git -c diff.statNameWidth=30 $cmd $args --stat=60 >output &&
+ grep " | " output >actual &&
+ test_cmp $expect actual
+ ';;
+ esac
+done <<\EOF
+ignores expect72 format-patch -1 --stdout
+ignores expect.60 format-patch -1 --stdout
+respects expect.6030 diff HEAD^ HEAD --stat
+respects expect.6030 show --stat
+respects expect.6030 log -1 --stat
+EOF
+
+cat >expect.40 <<-'EOF'
+ ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1 +
+EOF
+cat >expect2.40 <<-'EOF'
...aaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1 +
...aaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1 +
EOF
@@ -66,22 +96,22 @@ do
test_expect_success "$cmd --stat=width: a long name is given more room when the bar is short" '
git $cmd $args --stat=40 >output &&
grep " | " output >actual &&
- test_cmp $expect.60 actual
+ test_cmp $expect.40 actual
'
test_expect_success "$cmd --stat-width=width with long name" '
git $cmd $args --stat-width=40 >output &&
grep " | " output >actual &&
- test_cmp $expect.60 actual
+ test_cmp $expect.40 actual
'
- test_expect_success "$cmd --stat=...,name-width with long name" '
+ test_expect_success "$cmd --stat=width,name-width with long name" '
git $cmd $args --stat=60,30 >output &&
grep " | " output >actual &&
test_cmp $expect.6030 actual
'
- test_expect_success "$cmd --stat-name-width with long name" '
+ test_expect_success "$cmd --stat-name-width=width with long name" '
git $cmd $args --stat-name-width=30 >output &&
grep " | " output >actual &&
test_cmp $expect.6030 actual
@@ -93,8 +123,7 @@ expect show --stat
expect log -1 --stat
EOF
-
-test_expect_success 'preparation for big change tests' '
+test_expect_success 'preparation for big-change tests' '
>abcd &&
git add abcd &&
git commit -m message &&
@@ -110,7 +139,7 @@ cat >expect72 <<'EOF'
abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
EOF
-test_expect_success "format-patch --cover-letter ignores COLUMNS (big change)" '
+test_expect_success "format-patch --cover-letter ignores COLUMNS with big change" '
COLUMNS=200 git format-patch -1 --stdout --cover-letter >output &&
grep " | " output >actual &&
test_cmp expect72 actual
@@ -130,7 +159,7 @@ cat >expect200-graph <<'EOF'
EOF
while read verb expect cmd args
do
- test_expect_success "$cmd $verb COLUMNS (big change)" '
+ test_expect_success "$cmd $verb COLUMNS with big change" '
COLUMNS=200 git $cmd $args >output &&
grep " | " output >actual &&
test_cmp "$expect" actual
@@ -138,7 +167,7 @@ do
case "$cmd" in diff|show) continue;; esac
- test_expect_success "$cmd --graph $verb COLUMNS (big change)" '
+ test_expect_success "$cmd --graph $verb COLUMNS with big change" '
COLUMNS=200 git $cmd $args --graph >output &&
grep " | " output >actual &&
test_cmp "$expect-graph" actual
@@ -158,7 +187,7 @@ cat >expect40-graph <<'EOF'
EOF
while read verb expect cmd args
do
- test_expect_success "$cmd $verb not enough COLUMNS (big change)" '
+ test_expect_success "$cmd $verb not enough COLUMNS with big change" '
COLUMNS=40 git $cmd $args >output &&
grep " | " output >actual &&
test_cmp "$expect" actual
@@ -166,7 +195,7 @@ do
case "$cmd" in diff|show) continue;; esac
- test_expect_success "$cmd --graph $verb not enough COLUMNS (big change)" '
+ test_expect_success "$cmd --graph $verb not enough COLUMNS with big change" '
COLUMNS=40 git $cmd $args --graph >output &&
grep " | " output >actual &&
test_cmp "$expect-graph" actual
@@ -186,7 +215,7 @@ cat >expect40-graph <<'EOF'
EOF
while read verb expect cmd args
do
- test_expect_success "$cmd $verb statGraphWidth config" '
+ test_expect_success "$cmd $verb diff.statGraphWidth" '
git -c diff.statGraphWidth=26 $cmd $args >output &&
grep " | " output >actual &&
test_cmp "$expect" actual
@@ -194,7 +223,7 @@ do
case "$cmd" in diff|show) continue;; esac
- test_expect_success "$cmd --graph $verb statGraphWidth config" '
+ test_expect_success "$cmd --graph $verb diff.statGraphWidth" '
git -c diff.statGraphWidth=26 $cmd $args --graph >output &&
grep " | " output >actual &&
test_cmp "$expect-graph" actual
@@ -206,7 +235,6 @@ respects expect40 show --stat
respects expect40 log -1 --stat
EOF
-
cat >expect <<'EOF'
abcd | 1000 ++++++++++++++++++++++++++
EOF
@@ -227,7 +255,7 @@ do
test_cmp expect actual
'
- test_expect_success "$cmd --stat-graph-width with big change" '
+ test_expect_success "$cmd --stat-graph-width=width with big change" '
git $cmd $args --stat-graph-width=26 >output &&
grep " | " output >actual &&
test_cmp expect actual
@@ -241,7 +269,7 @@ do
test_cmp expect-graph actual
'
- test_expect_success "$cmd --stat-graph-width --graph with big change" '
+ test_expect_success "$cmd --stat-graph-width=width --graph with big change" '
git $cmd $args --stat-graph-width=26 --graph >output &&
grep " | " output >actual &&
test_cmp expect-graph actual
@@ -253,7 +281,7 @@ show --stat
log -1 --stat
EOF
-test_expect_success 'preparation for long filename tests' '
+test_expect_success 'preparation for long-name tests' '
cp abcd aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&
git add aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&
git commit -m message
@@ -301,7 +329,7 @@ cat >expect200-graph <<'EOF'
EOF
while read verb expect cmd args
do
- test_expect_success "$cmd $verb COLUMNS (long filename)" '
+ test_expect_success "$cmd $verb COLUMNS with long name" '
COLUMNS=200 git $cmd $args >output &&
grep " | " output >actual &&
test_cmp "$expect" actual
@@ -309,7 +337,7 @@ do
case "$cmd" in diff|show) continue;; esac
- test_expect_success "$cmd --graph $verb COLUMNS (long filename)" '
+ test_expect_success "$cmd --graph $verb COLUMNS with long name" '
COLUMNS=200 git $cmd $args --graph >output &&
grep " | " output >actual &&
test_cmp "$expect-graph" actual
@@ -330,7 +358,7 @@ EOF
while read verb expect cmd args
do
test_expect_success COLUMNS_CAN_BE_1 \
- "$cmd $verb prefix greater than COLUMNS (big change)" '
+ "$cmd $verb prefix greater than COLUMNS with big change" '
COLUMNS=1 git $cmd $args >output &&
grep " | " output >actual &&
test_cmp "$expect" actual
@@ -339,7 +367,7 @@ do
case "$cmd" in diff|show) continue;; esac
test_expect_success COLUMNS_CAN_BE_1 \
- "$cmd --graph $verb prefix greater than COLUMNS (big change)" '
+ "$cmd --graph $verb prefix greater than COLUMNS with big change" '
COLUMNS=1 git $cmd $args --graph >output &&
grep " | " output >actual &&
test_cmp "$expect-graph" actual
@@ -354,8 +382,14 @@ EOF
cat >expect <<'EOF'
abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
EOF
-test_expect_success 'merge --stat respects COLUMNS (big change)' '
- git checkout -b branch HEAD^^ &&
+test_expect_success 'merge --stat respects diff.statGraphWidth with big change' '
+ git checkout -b branch1 HEAD^^ &&
+ git -c diff.statGraphWidth=26 merge --stat --no-ff main^ >output &&
+ grep " | " output >actual &&
+ test_cmp expect40 actual
+'
+test_expect_success 'merge --stat respects COLUMNS with big change' '
+ git checkout -b branch2 HEAD^^ &&
COLUMNS=100 git merge --stat --no-ff main^ >output &&
grep " | " output >actual &&
test_cmp expect actual
@@ -364,7 +398,17 @@ test_expect_success 'merge --stat respects COLUMNS (big change)' '
cat >expect <<'EOF'
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++++++++++++++++++++++++
EOF
-test_expect_success 'merge --stat respects COLUMNS (long filename)' '
+cat >expect.30 <<'EOF'
+ ...aaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 ++++++++++++++++++++++++++++++++++++++++
+EOF
+test_expect_success 'merge --stat respects diff.statNameWidth with long name' '
+ git switch branch1 &&
+ git -c diff.statNameWidth=30 merge --stat --no-ff main >output &&
+ grep " | " output >actual &&
+ test_cmp expect.30 actual
+'
+test_expect_success 'merge --stat respects COLUMNS with long name' '
+ git switch branch2 &&
COLUMNS=100 git merge --stat --no-ff main >output &&
grep " | " output >actual &&
test_cmp expect actual
diff --git a/t/t4053-diff-no-index.sh b/t/t4053-diff-no-index.sh
index 3feadf0..651ec77 100755
--- a/t/t4053-diff-no-index.sh
+++ b/t/t4053-diff-no-index.sh
@@ -2,6 +2,7 @@
test_description='diff --no-index'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -55,7 +56,7 @@ test_expect_success 'git diff --no-index executed outside repo gives correct err
export GIT_CEILING_DIRECTORIES &&
cd non/git &&
test_must_fail git diff --no-index a 2>actual.err &&
- test_i18ngrep "usage: git diff --no-index" actual.err
+ test_grep "usage: git diff --no-index" actual.err
)
'
@@ -204,4 +205,95 @@ test_expect_success POSIXPERM,SYMLINKS 'diff --no-index normalizes: mode not lik
test_cmp expected actual
'
+test_expect_success POSIXPERM 'external diff with mode-only change' '
+ echo content >not-executable &&
+ echo content >executable &&
+ chmod +x executable &&
+ echo executable executable $(test_oid zero) 100755 \
+ not-executable $(test_oid zero) 100644 not-executable \
+ >expect &&
+ test_expect_code 1 git -c diff.external=echo diff \
+ --no-index executable not-executable >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success "diff --no-index treats '-' as stdin" '
+ cat >expect <<-EOF &&
+ diff --git a/- b/a/1
+ index $ZERO_OID..$(git hash-object --stdin <a/1) 100644
+ --- a/-
+ +++ b/a/1
+ @@ -1 +1 @@
+ -x
+ +1
+ EOF
+
+ test_write_lines x | test_expect_code 1 \
+ git -c core.abbrev=no diff --no-index -- - a/1 >actual &&
+ test_cmp expect actual &&
+
+ test_write_lines 1 | git diff --no-index -- a/1 - >actual &&
+ test_must_be_empty actual
+'
+
+test_expect_success "diff --no-index -R treats '-' as stdin" '
+ cat >expect <<-EOF &&
+ diff --git b/a/1 a/-
+ index $(git hash-object --stdin <a/1)..$ZERO_OID 100644
+ --- b/a/1
+ +++ a/-
+ @@ -1 +1 @@
+ -1
+ +x
+ EOF
+
+ test_write_lines x | test_expect_code 1 \
+ git -c core.abbrev=no diff --no-index -R -- - a/1 >actual &&
+ test_cmp expect actual &&
+
+ test_write_lines 1 | git diff --no-index -R -- a/1 - >actual &&
+ test_must_be_empty actual
+'
+
+test_expect_success 'diff --no-index refuses to diff stdin and a directory' '
+ test_must_fail git diff --no-index -- - a </dev/null 2>err &&
+ grep "fatal: cannot compare stdin to a directory" err
+'
+
+test_expect_success PIPE 'diff --no-index refuses to diff a named pipe and a directory' '
+ test_when_finished "rm -f pipe" &&
+ mkfifo pipe &&
+ test_must_fail git diff --no-index -- pipe a 2>err &&
+ grep "fatal: cannot compare a named pipe to a directory" err
+'
+
+test_expect_success PIPE,SYMLINKS 'diff --no-index reads from pipes' '
+ test_when_finished "rm -f old new new-link" &&
+ mkfifo old &&
+ mkfifo new &&
+ ln -s new new-link &&
+ {
+ (test_write_lines a b c >old) &
+ } &&
+ test_when_finished "kill $! || :" &&
+ {
+ (test_write_lines a x c >new) &
+ } &&
+ test_when_finished "kill $! || :" &&
+
+ cat >expect <<-EOF &&
+ diff --git a/old b/new-link
+ --- a/old
+ +++ b/new-link
+ @@ -1,3 +1,3 @@
+ a
+ -b
+ +x
+ c
+ EOF
+
+ test_expect_code 1 git diff --no-index old new-link >actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t4054-diff-bogus-tree.sh b/t/t4054-diff-bogus-tree.sh
index 294fb55..05c88f8 100755
--- a/t/t4054-diff-bogus-tree.sh
+++ b/t/t4054-diff-bogus-tree.sh
@@ -10,7 +10,7 @@ test_expect_success 'create bogus tree' '
bogus_tree=$(
printf "100644 fooQ$name" |
q_to_nul |
- git hash-object -w --stdin -t tree
+ git hash-object --literally -w --stdin -t tree
)
'
diff --git a/t/t4055-diff-context.sh b/t/t4055-diff-context.sh
index 73048d0..3ea9ae9 100755
--- a/t/t4055-diff-context.sh
+++ b/t/t4055-diff-context.sh
@@ -74,13 +74,13 @@ test_expect_success 'plumbing not affected' '
test_expect_success 'non-integer config parsing' '
git config diff.context no &&
test_must_fail git diff 2>output &&
- test_i18ngrep "bad numeric config value" output
+ test_grep "bad numeric config value" output
'
test_expect_success 'negative integer config parsing' '
git config diff.context -1 &&
test_must_fail git diff 2>output &&
- test_i18ngrep "bad config variable" output
+ test_grep "bad config variable" output
'
test_expect_success '-U0 is valid, so is diff.context=0' '
diff --git a/t/t4057-diff-combined-paths.sh b/t/t4057-diff-combined-paths.sh
index 04b8a15..9a7505c 100755
--- a/t/t4057-diff-combined-paths.sh
+++ b/t/t4057-diff-combined-paths.sh
@@ -5,6 +5,7 @@ test_description='combined diff show only paths that are different to all parent
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# verify that diffc.expect matches output of
diff --git a/t/t4058-diff-duplicates.sh b/t/t4058-diff-duplicates.sh
index 54614b8..2501c89 100755
--- a/t/t4058-diff-duplicates.sh
+++ b/t/t4058-diff-duplicates.sh
@@ -29,7 +29,7 @@ make_tree () {
make_tree_entry "$1" "$2" "$3"
shift; shift; shift
done |
- git hash-object -w -t tree --stdin
+ git hash-object --literally -w -t tree --stdin
}
# this is kind of a convoluted setup, but matches
diff --git a/t/t4059-diff-submodule-not-initialized.sh b/t/t4059-diff-submodule-not-initialized.sh
index 49bca7b..d489230 100755
--- a/t/t4059-diff-submodule-not-initialized.sh
+++ b/t/t4059-diff-submodule-not-initialized.sh
@@ -49,7 +49,7 @@ test_expect_success 'setup - submodules' '
'
test_expect_success 'setup - git submodule add' '
- git submodule add ./sm2 sm1 &&
+ git -c protocol.file.allow=always submodule add ./sm2 sm1 &&
commit_file sm1 .gitmodules &&
git diff-tree -p --no-commit-id --submodule=log HEAD -- sm1 >actual &&
cat >expected <<-EOF &&
diff --git a/t/t4060-diff-submodule-option-diff-format.sh b/t/t4060-diff-submodule-option-diff-format.sh
index d86e38a..97c6424 100755
--- a/t/t4060-diff-submodule-option-diff-format.sh
+++ b/t/t4060-diff-submodule-option-diff-format.sh
@@ -840,7 +840,7 @@ rm sm2
mv sm2-bak sm2
test_expect_success 'setup nested submodule' '
- git -C sm2 submodule add ../sm2 nested &&
+ git -c protocol.file.allow=always -C sm2 submodule add ../sm2 nested &&
git -C sm2 commit -a -m "nested sub" &&
head10=$(git -C sm2 rev-parse --short --verify HEAD)
'
diff --git a/t/t4062-diff-pickaxe.sh b/t/t4062-diff-pickaxe.sh
index 9aaa068..a90b46b 100755
--- a/t/t4062-diff-pickaxe.sh
+++ b/t/t4062-diff-pickaxe.sh
@@ -24,7 +24,7 @@ test_expect_success '-G matches' '
test_expect_success '-S --pickaxe-regex' '
git diff --name-only -S0 --pickaxe-regex HEAD^ >out &&
- verbose test 4096-zeroes.txt = "$(cat out)"
+ test 4096-zeroes.txt = "$(cat out)"
'
test_done
diff --git a/t/t4067-diff-partial-clone.sh b/t/t4067-diff-partial-clone.sh
index 804f2a8..7af3a08 100755
--- a/t/t4067-diff-partial-clone.sh
+++ b/t/t4067-diff-partial-clone.sh
@@ -2,6 +2,7 @@
test_description='behavior of diff when reading objects in a partial clone'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'git show batches blobs' '
@@ -77,6 +78,7 @@ test_expect_success 'diff skips same-OID blobs' '
test_expect_success 'when fetching missing objects, diff skips GITLINKs' '
test_when_finished "rm -rf sub server client trace" &&
+ test_config_global protocol.file.allow always &&
test_create_repo sub &&
test_commit -C sub first &&
@@ -149,7 +151,7 @@ test_expect_success 'diff does not fetch anything if inexact rename detection is
# Ensure no fetches.
GIT_TRACE_PACKET="$(pwd)/trace" git -C client diff --raw -M HEAD^ HEAD &&
- ! test_path_exists trace
+ test_path_is_missing trace
'
test_expect_success 'diff --break-rewrites fetches only if necessary, and batches blobs if it does' '
@@ -169,7 +171,7 @@ test_expect_success 'diff --break-rewrites fetches only if necessary, and batche
# Ensure no fetches.
GIT_TRACE_PACKET="$(pwd)/trace" git -C client diff --raw -M HEAD^ HEAD &&
- ! test_path_exists trace &&
+ test_path_is_missing trace &&
# But with --break-rewrites, ensure that there is exactly 1 negotiation
# by checking that there is only 1 "done" line sent. ("done" marks the
diff --git a/t/t4068-diff-symmetric-merge-base.sh b/t/t4068-diff-symmetric-merge-base.sh
index 2d650d8..eff63c1 100755
--- a/t/t4068-diff-symmetric-merge-base.sh
+++ b/t/t4068-diff-symmetric-merge-base.sh
@@ -34,7 +34,7 @@ test_expect_success setup '
echo c >c &&
git add c &&
git commit -m C &&
- git tag commit-C &&
+ git tag -m commit-C commit-C &&
git merge -m D main &&
git tag commit-D &&
git checkout main &&
@@ -68,27 +68,27 @@ test_expect_success 'diff with two merge bases' '
test_expect_success 'diff with no merge bases' '
test_must_fail git diff br2...br3 2>err &&
- test_i18ngrep "fatal: br2...br3: no merge base" err
+ test_grep "fatal: br2...br3: no merge base" err
'
test_expect_success 'diff with too many symmetric differences' '
test_must_fail git diff br1...main br2...br3 2>err &&
- test_i18ngrep "usage" err
+ test_grep "usage" err
'
test_expect_success 'diff with symmetric difference and extraneous arg' '
test_must_fail git diff main br1...main 2>err &&
- test_i18ngrep "usage" err
+ test_grep "usage" err
'
test_expect_success 'diff with two ranges' '
test_must_fail git diff main br1..main br2..br3 2>err &&
- test_i18ngrep "usage" err
+ test_grep "usage" err
'
test_expect_success 'diff with ranges and extra arg' '
test_must_fail git diff main br1..main commit-D 2>err &&
- test_i18ngrep "usage" err
+ test_grep "usage" err
'
test_expect_success 'diff --merge-base with no commits' '
@@ -97,7 +97,7 @@ test_expect_success 'diff --merge-base with no commits' '
test_expect_success 'diff --merge-base with three commits' '
test_must_fail git diff --merge-base br1 br2 main 2>err &&
- test_i18ngrep "usage" err
+ test_grep "usage" err
'
for cmd in diff-index diff
@@ -109,6 +109,13 @@ do
test_cmp expect actual
'
+ test_expect_success "$cmd --merge-base with annotated tag" '
+ git checkout main &&
+ git $cmd commit-C >expect &&
+ git $cmd --merge-base commit-C >actual &&
+ test_cmp expect actual
+ '
+
test_expect_success "$cmd --merge-base with one commit and unstaged changes" '
git checkout main &&
test_when_finished git reset --hard &&
@@ -143,19 +150,19 @@ do
test_expect_success "$cmd --merge-base with non-commit" '
git checkout main &&
test_must_fail git $cmd --merge-base main^{tree} 2>err &&
- test_i18ngrep "fatal: --merge-base only works with commits" err
+ test_grep "is a tree, not a commit" err
'
test_expect_success "$cmd --merge-base with no merge bases and one commit" '
git checkout main &&
test_must_fail git $cmd --merge-base br3 2>err &&
- test_i18ngrep "fatal: no merge base found" err
+ test_grep "fatal: no merge base found" err
'
test_expect_success "$cmd --merge-base with multiple merge bases and one commit" '
git checkout main &&
test_must_fail git $cmd --merge-base br1 2>err &&
- test_i18ngrep "fatal: multiple merge bases found" err
+ test_grep "fatal: multiple merge bases found" err
'
done
@@ -169,28 +176,28 @@ do
test_expect_success "$cmd --merge-base commit and non-commit" '
test_must_fail git $cmd --merge-base br2 main^{tree} 2>err &&
- test_i18ngrep "fatal: --merge-base only works with commits" err
+ test_grep "is a tree, not a commit" err
'
test_expect_success "$cmd --merge-base with no merge bases and two commits" '
test_must_fail git $cmd --merge-base br2 br3 2>err &&
- test_i18ngrep "fatal: no merge base found" err
+ test_grep "fatal: no merge base found" err
'
test_expect_success "$cmd --merge-base with multiple merge bases and two commits" '
test_must_fail git $cmd --merge-base main br1 2>err &&
- test_i18ngrep "fatal: multiple merge bases found" err
+ test_grep "fatal: multiple merge bases found" err
'
done
test_expect_success 'diff-tree --merge-base with one commit' '
test_must_fail git diff-tree --merge-base main 2>err &&
- test_i18ngrep "fatal: --merge-base only works with two commits" err
+ test_grep "fatal: --merge-base only works with two commits" err
'
test_expect_success 'diff --merge-base with range' '
test_must_fail git diff --merge-base br2..br3 2>err &&
- test_i18ngrep "fatal: --merge-base does not work with ranges" err
+ test_grep "fatal: --merge-base does not work with ranges" err
'
test_done
diff --git a/t/t4069-remerge-diff.sh b/t/t4069-remerge-diff.sh
index 35f9495..07323eb 100755
--- a/t/t4069-remerge-diff.sh
+++ b/t/t4069-remerge-diff.sh
@@ -56,6 +56,11 @@ test_expect_success 'remerge-diff on a clean merge' '
test_cmp expect actual
'
+test_expect_success 'remerge-diff on a clean merge with a filter' '
+ git show --oneline --remerge-diff --diff-filter=U bc_resolution >actual &&
+ test_must_be_empty actual
+'
+
test_expect_success 'remerge-diff with both a resolved conflict and an unrelated change' '
git log -1 --oneline ab_resolution >tmp &&
cat <<-EOF >>tmp &&
@@ -89,6 +94,22 @@ test_expect_success 'remerge-diff with both a resolved conflict and an unrelated
test_cmp expect actual
'
+test_expect_success 'pickaxe still includes additional headers for relevant changes' '
+ # reuses "expect" from the previous testcase
+
+ git log --oneline --remerge-diff -Sacht ab_resolution >tmp &&
+ sed -e "s/[0-9a-f]\{7,\}/HASH/g" tmp >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'can filter out additional headers with pickaxe' '
+ git show --remerge-diff --submodule=log --find-object=HEAD ab_resolution >actual &&
+ test_must_be_empty actual &&
+
+ git show --remerge-diff -S"not present" --all >actual &&
+ test_must_be_empty actual
+'
+
test_expect_success 'setup non-content conflicts' '
git switch --orphan base &&
@@ -184,6 +205,14 @@ test_expect_success 'remerge-diff w/ diff-filter=U: all conflict headers, no dif
test_cmp expect actual
'
+test_expect_success 'submodule formatting ignores additional headers' '
+ # Reuses "expect" from last testcase
+
+ git show --oneline --remerge-diff --diff-filter=U --submodule=log >tmp &&
+ sed -e "s/[0-9a-f]\{7,\}/HASH/g" tmp >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'remerge-diff w/ diff-filter=R: relevant file + conflict header' '
git log -1 --oneline resolution >tmp &&
cat <<-EOF >>tmp &&
diff --git a/t/t4111-apply-subdir.sh b/t/t4111-apply-subdir.sh
index 1618a6d..e9a87d7 100755
--- a/t/t4111-apply-subdir.sh
+++ b/t/t4111-apply-subdir.sh
@@ -2,6 +2,7 @@
test_description='patching from inconvenient places'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
diff --git a/t/t4114-apply-typechange.sh b/t/t4114-apply-typechange.sh
index da3e64f..8ff3640 100755
--- a/t/t4114-apply-typechange.sh
+++ b/t/t4114-apply-typechange.sh
@@ -7,6 +7,7 @@ test_description='git apply should not get confused with type changes.
'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup repository and commits' '
diff --git a/t/t4115-apply-symlink.sh b/t/t4115-apply-symlink.sh
index d0f3ede..cbef0a5 100755
--- a/t/t4115-apply-symlink.sh
+++ b/t/t4115-apply-symlink.sh
@@ -45,4 +45,100 @@ test_expect_success 'apply --index symlink patch' '
'
+test_expect_success 'symlink setup' '
+ ln -s .git symlink &&
+ git add symlink &&
+ git commit -m "add symlink"
+'
+
+test_expect_success SYMLINKS 'symlink escape when creating new files' '
+ test_when_finished "git reset --hard && git clean -dfx" &&
+
+ cat >patch <<-EOF &&
+ diff --git a/symlink b/renamed-symlink
+ similarity index 100%
+ rename from symlink
+ rename to renamed-symlink
+ --
+ diff --git /dev/null b/renamed-symlink/create-me
+ new file mode 100644
+ index 0000000..039727e
+ --- /dev/null
+ +++ b/renamed-symlink/create-me
+ @@ -0,0 +1,1 @@
+ +busted
+ EOF
+
+ test_must_fail git apply patch 2>stderr &&
+ cat >expected_stderr <<-EOF &&
+ error: affected file ${SQ}renamed-symlink/create-me${SQ} is beyond a symbolic link
+ EOF
+ test_cmp expected_stderr stderr &&
+ test_path_is_missing .git/create-me
+'
+
+test_expect_success SYMLINKS 'symlink escape when modifying file' '
+ test_when_finished "git reset --hard && git clean -dfx" &&
+ touch .git/modify-me &&
+
+ cat >patch <<-EOF &&
+ diff --git a/symlink b/renamed-symlink
+ similarity index 100%
+ rename from symlink
+ rename to renamed-symlink
+ --
+ diff --git a/renamed-symlink/modify-me b/renamed-symlink/modify-me
+ index 1111111..2222222 100644
+ --- a/renamed-symlink/modify-me
+ +++ b/renamed-symlink/modify-me
+ @@ -0,0 +1,1 @@
+ +busted
+ EOF
+
+ test_must_fail git apply patch 2>stderr &&
+ cat >expected_stderr <<-EOF &&
+ error: renamed-symlink/modify-me: No such file or directory
+ EOF
+ test_cmp expected_stderr stderr &&
+ test_must_be_empty .git/modify-me
+'
+
+test_expect_success SYMLINKS 'symlink escape when deleting file' '
+ test_when_finished "git reset --hard && git clean -dfx && rm .git/delete-me" &&
+ touch .git/delete-me &&
+
+ cat >patch <<-EOF &&
+ diff --git a/symlink b/renamed-symlink
+ similarity index 100%
+ rename from symlink
+ rename to renamed-symlink
+ --
+ diff --git a/renamed-symlink/delete-me b/renamed-symlink/delete-me
+ deleted file mode 100644
+ index 1111111..0000000 100644
+ EOF
+
+ test_must_fail git apply patch 2>stderr &&
+ cat >expected_stderr <<-EOF &&
+ error: renamed-symlink/delete-me: No such file or directory
+ EOF
+ test_cmp expected_stderr stderr &&
+ test_path_is_file .git/delete-me
+'
+
+test_expect_success SYMLINKS '--reject removes .rej symlink if it exists' '
+ test_when_finished "git reset --hard && git clean -dfx" &&
+
+ test_commit file &&
+ echo modified >file.t &&
+ git diff -- file.t >patch &&
+ echo modified-again >file.t &&
+
+ ln -s foo file.t.rej &&
+ test_must_fail git apply patch --reject 2>err &&
+ test_grep "Rejected hunk" err &&
+ test_path_is_missing foo &&
+ test_path_is_file file.t.rej
+'
+
test_done
diff --git a/t/t4120-apply-popt.sh b/t/t4120-apply-popt.sh
index 497b628..697e86c 100755
--- a/t/t4120-apply-popt.sh
+++ b/t/t4120-apply-popt.sh
@@ -31,7 +31,7 @@ test_expect_success 'apply git diff with -p2' '
test_expect_success 'apply with too large -p' '
cp file1.saved file1 &&
test_must_fail git apply --stat -p3 patch.file 2>err &&
- test_i18ngrep "removing 3 leading" err
+ test_grep "removing 3 leading" err
'
test_expect_success 'apply (-p2) traditional diff with funny filenames' '
@@ -53,7 +53,7 @@ test_expect_success 'apply (-p2) traditional diff with funny filenames' '
test_expect_success 'apply with too large -p and fancy filename' '
cp file1.saved file1 &&
test_must_fail git apply --stat -p3 patch.escaped 2>err &&
- test_i18ngrep "removing 3 leading" err
+ test_grep "removing 3 leading" err
'
test_expect_success 'apply (-p2) diff, mode change only' '
diff --git a/t/t4122-apply-symlink-inside.sh b/t/t4122-apply-symlink-inside.sh
index 9696537..2089d84 100755
--- a/t/t4122-apply-symlink-inside.sh
+++ b/t/t4122-apply-symlink-inside.sh
@@ -95,19 +95,19 @@ test_expect_success SYMLINKS 'do not follow symbolic link (same input)' '
# same input creates a confusing symbolic link
test_must_fail git apply patch 2>error-wt &&
- test_i18ngrep "beyond a symbolic link" error-wt &&
+ test_grep "beyond a symbolic link" error-wt &&
test_path_is_missing arch/x86_64/dir &&
test_path_is_missing arch/i386/dir/file &&
test_must_fail git apply --index patch 2>error-ix &&
- test_i18ngrep "beyond a symbolic link" error-ix &&
+ test_grep "beyond a symbolic link" error-ix &&
test_path_is_missing arch/x86_64/dir &&
test_path_is_missing arch/i386/dir/file &&
test_must_fail git ls-files --error-unmatch arch/x86_64/dir &&
test_must_fail git ls-files --error-unmatch arch/i386/dir &&
test_must_fail git apply --cached patch 2>error-ct &&
- test_i18ngrep "beyond a symbolic link" error-ct &&
+ test_grep "beyond a symbolic link" error-ct &&
test_must_fail git ls-files --error-unmatch arch/x86_64/dir &&
test_must_fail git ls-files --error-unmatch arch/i386/dir &&
@@ -135,23 +135,23 @@ test_expect_success SYMLINKS 'do not follow symbolic link (existing)' '
git add arch/x86_64/dir &&
test_must_fail git apply add_file.patch 2>error-wt-add &&
- test_i18ngrep "beyond a symbolic link" error-wt-add &&
+ test_grep "beyond a symbolic link" error-wt-add &&
test_path_is_missing arch/i386/dir/file &&
mkdir arch/i386/dir &&
>arch/i386/dir/file &&
test_must_fail git apply del_file.patch 2>error-wt-del &&
- test_i18ngrep "beyond a symbolic link" error-wt-del &&
+ test_grep "beyond a symbolic link" error-wt-del &&
test_path_is_file arch/i386/dir/file &&
rm arch/i386/dir/file &&
test_must_fail git apply --index add_file.patch 2>error-ix-add &&
- test_i18ngrep "beyond a symbolic link" error-ix-add &&
+ test_grep "beyond a symbolic link" error-ix-add &&
test_path_is_missing arch/i386/dir/file &&
test_must_fail git ls-files --error-unmatch arch/i386/dir &&
test_must_fail git apply --cached add_file.patch 2>error-ct-file &&
- test_i18ngrep "beyond a symbolic link" error-ct-file &&
+ test_grep "beyond a symbolic link" error-ct-file &&
test_must_fail git ls-files --error-unmatch arch/i386/dir
'
diff --git a/t/t4126-apply-empty.sh b/t/t4126-apply-empty.sh
index ece9fae..56210b5 100755
--- a/t/t4126-apply-empty.sh
+++ b/t/t4126-apply-empty.sh
@@ -66,4 +66,28 @@ test_expect_success 'apply --index create' '
git diff --exit-code
'
+test_expect_success !MINGW 'apply with no-contents and a funny pathname' '
+ test_when_finished "rm -fr \"funny \"; git reset --hard" &&
+
+ mkdir "funny " &&
+ >"funny /empty" &&
+ git add "funny /empty" &&
+ git diff HEAD -- "funny /" >sample.patch &&
+ git diff -R HEAD -- "funny /" >elpmas.patch &&
+
+ git reset --hard &&
+
+ git apply --stat --check --apply sample.patch &&
+ test_must_be_empty "funny /empty" &&
+
+ git apply --stat --check --apply elpmas.patch &&
+ test_path_is_missing "funny /empty" &&
+
+ git apply -R --stat --check --apply elpmas.patch &&
+ test_must_be_empty "funny /empty" &&
+
+ git apply -R --stat --check --apply sample.patch &&
+ test_path_is_missing "funny /empty"
+'
+
test_done
diff --git a/t/t4129-apply-samemode.sh b/t/t4129-apply-samemode.sh
index a1c7686..4eb8444 100755
--- a/t/t4129-apply-samemode.sh
+++ b/t/t4129-apply-samemode.sh
@@ -41,7 +41,8 @@ test_expect_success FILEMODE 'same mode (index only)' '
chmod +x file &&
git add file &&
git apply --cached patch-0.txt &&
- git ls-files -s file | grep "^100755"
+ git ls-files -s file >ls-files-output &&
+ test_grep "^100755" ls-files-output
'
test_expect_success FILEMODE 'mode update (no index)' '
@@ -60,19 +61,20 @@ test_expect_success FILEMODE 'mode update (with index)' '
test_expect_success FILEMODE 'mode update (index only)' '
git reset --hard &&
git apply --cached patch-1.txt &&
- git ls-files -s file | grep "^100755"
+ git ls-files -s file >ls-files-output &&
+ test_grep "^100755" ls-files-output
'
test_expect_success FILEMODE 'empty mode is rejected' '
git reset --hard &&
test_must_fail git apply patch-empty-mode.txt 2>err &&
- test_i18ngrep "invalid mode" err
+ test_grep "invalid mode" err
'
test_expect_success FILEMODE 'bogus mode is rejected' '
git reset --hard &&
test_must_fail git apply patch-bogus-mode.txt 2>err &&
- test_i18ngrep "invalid mode" err
+ test_grep "invalid mode" err
'
test_expect_success POSIXPERM 'do not use core.sharedRepository for working tree files' '
@@ -101,4 +103,31 @@ test_expect_success POSIXPERM 'do not use core.sharedRepository for working tree
)
'
+test_expect_success 'git apply respects core.fileMode' '
+ test_config core.fileMode false &&
+ echo true >script.sh &&
+ git add --chmod=+x script.sh &&
+ git ls-files -s script.sh >ls-files-output &&
+ test_grep "^100755" ls-files-output &&
+ test_tick && git commit -m "Add script" &&
+ git ls-tree -r HEAD script.sh >ls-tree-output &&
+ test_grep "^100755" ls-tree-output &&
+
+ echo true >>script.sh &&
+ test_tick && git commit -m "Modify script" script.sh &&
+ git format-patch -1 --stdout >patch &&
+ test_grep "^index.*100755$" patch &&
+
+ git switch -c branch HEAD^ &&
+ git apply --index patch 2>err &&
+ test_grep ! "has type 100644, expected 100755" err &&
+ git reset --hard &&
+
+ git apply patch 2>err &&
+ test_grep ! "has type 100644, expected 100755" err &&
+
+ git apply --cached patch 2>err &&
+ test_grep ! "has type 100644, expected 100755" err
+'
+
test_done
diff --git a/t/t4133-apply-filenames.sh b/t/t4133-apply-filenames.sh
index 35f1060..c21ddb2 100755
--- a/t/t4133-apply-filenames.sh
+++ b/t/t4133-apply-filenames.sh
@@ -32,9 +32,9 @@ EOF
test_expect_success 'apply diff with inconsistent filenames in headers' '
test_must_fail git apply bad1.patch 2>err &&
- test_i18ngrep "inconsistent new filename" err &&
+ test_grep "inconsistent new filename" err &&
test_must_fail git apply bad2.patch 2>err &&
- test_i18ngrep "inconsistent old filename" err
+ test_grep "inconsistent old filename" err
'
test_expect_success 'apply diff with new filename missing from headers' '
@@ -46,7 +46,7 @@ test_expect_success 'apply diff with new filename missing from headers' '
+1
EOF
test_must_fail git apply missing_new_filename.diff 2>err &&
- test_i18ngrep "lacks filename information" err
+ test_grep "lacks filename information" err
'
test_expect_success 'apply diff with old filename missing from headers' '
@@ -58,7 +58,7 @@ test_expect_success 'apply diff with old filename missing from headers' '
-1
EOF
test_must_fail git apply missing_old_filename.diff 2>err &&
- test_i18ngrep "lacks filename information" err
+ test_grep "lacks filename information" err
'
test_done
diff --git a/t/t4135-apply-weird-filenames.sh b/t/t4135-apply-weird-filenames.sh
index 6bc3fb9..d3502c6 100755
--- a/t/t4135-apply-weird-filenames.sh
+++ b/t/t4135-apply-weird-filenames.sh
@@ -2,6 +2,7 @@
test_description='git apply with weird postimage filenames'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
diff --git a/t/t4140-apply-ita.sh b/t/t4140-apply-ita.sh
index c614eaf..b375aca 100755
--- a/t/t4140-apply-ita.sh
+++ b/t/t4140-apply-ita.sh
@@ -2,6 +2,7 @@
test_description='git apply of i-t-a file'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t4141-apply-too-large.sh b/t/t4141-apply-too-large.sh
new file mode 100755
index 0000000..20cc120
--- /dev/null
+++ b/t/t4141-apply-too-large.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+test_description='git apply with too-large patch'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+test_expect_success EXPENSIVE 'git apply rejects patches that are too large' '
+ sz=$((1024 * 1024 * 1023)) &&
+ {
+ cat <<-\EOF &&
+ diff --git a/file b/file
+ new file mode 100644
+ --- /dev/null
+ +++ b/file
+ @@ -0,0 +1 @@
+ EOF
+ test-tool genzeros
+ } | test_copy_bytes $sz | test_must_fail git apply 2>err &&
+ grep "patch too large" err
+'
+
+test_done
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index cdad4b6..5e2b6c8 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -103,7 +103,7 @@ test_expect_success setup '
git format-patch --stdout first >patch1 &&
{
- echo "Message-Id: <1226501681-24923-1-git-send-email-bda@mnsspb.ru>" &&
+ echo "Message-ID: <1226501681-24923-1-git-send-email-bda@mnsspb.ru>" &&
echo "X-Fake-Field: Line One" &&
echo "X-Fake-Field: Line Two" &&
echo "X-Fake-Field: Line Three" &&
@@ -345,6 +345,21 @@ test_expect_success 'am with failing applypatch-msg hook' '
test_cmp_rev first HEAD
'
+test_expect_success 'am with failing applypatch-msg hook (no verify)' '
+ rm -fr .git/rebase-apply &&
+ git reset --hard &&
+ git checkout first &&
+ test_hook applypatch-msg <<-\EOF &&
+ echo hook-message >"$1"
+ exit 1
+ EOF
+ git am --no-verify patch1 &&
+ test_path_is_missing .git/rebase-apply &&
+ git diff --exit-code second &&
+ git log -1 --format=format:%B >actual &&
+ test_cmp msg actual
+'
+
test_expect_success 'am with pre-applypatch hook' '
rm -fr .git/rebase-apply &&
git reset --hard &&
@@ -374,6 +389,23 @@ test_expect_success 'am with failing pre-applypatch hook' '
test_cmp_rev first HEAD
'
+test_expect_success 'am with failing pre-applypatch hook (no verify)' '
+ rm -fr .git/rebase-apply &&
+ git reset --hard &&
+ git checkout first &&
+ touch empty-file &&
+ test_hook pre-applypatch <<-\EOF &&
+ rm empty-file
+ exit 1
+ EOF
+ git am --no-verify patch1 &&
+ test_path_is_missing .git/rebase-apply &&
+ test_path_is_file empty-file &&
+ git diff --exit-code second &&
+ git log -1 --format=format:%B >actual &&
+ test_cmp msg actual
+'
+
test_expect_success 'am with post-applypatch hook' '
rm -fr .git/rebase-apply &&
git reset --hard &&
@@ -747,7 +779,7 @@ test_expect_success 'am --resolved fails if index has unmerged entries' '
test_must_fail git am --resolved >err &&
test_path_is_dir .git/rebase-apply &&
test_cmp_rev second HEAD &&
- test_i18ngrep "still have unmerged paths" err
+ test_grep "still have unmerged paths" err
'
test_expect_success 'am takes patches from a Pine mailbox' '
@@ -881,7 +913,7 @@ test_expect_success 'am newline in subject' '
test_tick &&
sed -e "s/second/second \\\n foo/" patch1 >patchnl &&
git am <patchnl >output.out 2>&1 &&
- test_i18ngrep "^Applying: second \\\n foo$" output.out
+ test_grep "^Applying: second \\\n foo$" output.out
'
test_expect_success 'am -q is quiet' '
@@ -910,7 +942,7 @@ test_expect_success 'am --message-id really adds the message id' '
git am --message-id patch1.eml &&
test_path_is_missing .git/rebase-apply &&
git cat-file commit HEAD | tail -n1 >actual &&
- grep Message-Id patch1.eml >expected &&
+ grep Message-ID patch1.eml >expected &&
test_cmp expected actual
'
@@ -922,7 +954,7 @@ test_expect_success 'am.messageid really adds the message id' '
git am patch1.eml &&
test_path_is_missing .git/rebase-apply &&
git cat-file commit HEAD | tail -n1 >actual &&
- grep Message-Id patch1.eml >expected &&
+ grep Message-ID patch1.eml >expected &&
test_cmp expected actual
'
@@ -933,7 +965,7 @@ test_expect_success 'am --message-id -s signs off after the message id' '
git am -s --message-id patch1.eml &&
test_path_is_missing .git/rebase-apply &&
git cat-file commit HEAD | tail -n2 | head -n1 >actual &&
- grep Message-Id patch1.eml >expected &&
+ grep Message-ID patch1.eml >expected &&
test_cmp expected actual
'
@@ -1033,7 +1065,7 @@ test_expect_success 'am --patch-format=mboxrd handles mboxrd' '
>From extra escape for reversibility
INPUT_END
git commit -F msg &&
- git format-patch --pretty=mboxrd --stdout -1 >mboxrd1 &&
+ git -c format.mboxrd format-patch --stdout -1 >mboxrd1 &&
grep "^>From could trip up a loose mbox parser" mboxrd1 &&
git checkout -f first &&
git am --patch-format=mboxrd mboxrd1 &&
@@ -1192,8 +1224,8 @@ test_expect_success 'record as an empty commit when meeting e-mail message that
test_expect_success 'skip an empty patch in the middle of an am session' '
git checkout empty-commit^ &&
- test_must_fail git am empty-commit.patch >err &&
- grep "Patch is empty." err &&
+ test_must_fail git am empty-commit.patch >out 2>err &&
+ grep "Patch is empty." out &&
grep "To record the empty patch as an empty commit, run \"git am --allow-empty\"." err &&
git am --skip &&
test_path_is_missing .git/rebase-apply &&
@@ -1204,8 +1236,8 @@ test_expect_success 'skip an empty patch in the middle of an am session' '
test_expect_success 'record an empty patch as an empty commit in the middle of an am session' '
git checkout empty-commit^ &&
- test_must_fail git am empty-commit.patch >err &&
- grep "Patch is empty." err &&
+ test_must_fail git am empty-commit.patch >out 2>err &&
+ grep "Patch is empty." out &&
grep "To record the empty patch as an empty commit, run \"git am --allow-empty\"." err &&
git am --allow-empty >output &&
grep "No changes - recorded it as an empty commit." output &&
diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh
index 5ed7e22..edb38da 100755
--- a/t/t4151-am-abort.sh
+++ b/t/t4151-am-abort.sh
@@ -46,7 +46,7 @@ do
test_expect_success "am$with3 --skip continue after failed am$with3" '
test_must_fail git am$with3 --skip >output &&
- test_i18ngrep "^Applying: 6$" output &&
+ test_grep "^Applying: 6$" output &&
test_cmp file-2-expect file-2 &&
test ! -f .git/MERGE_RR
'
diff --git a/t/t4152-am-subjects.sh b/t/t4152-am-subjects.sh
index 4c68245..9f2edba 100755
--- a/t/t4152-am-subjects.sh
+++ b/t/t4152-am-subjects.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='test subject preservation with format-patch | am'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
make_patches() {
diff --git a/t/t4153-am-resume-override-opts.sh b/t/t4153-am-resume-override-opts.sh
index b7c3861..4add7c7 100755
--- a/t/t4153-am-resume-override-opts.sh
+++ b/t/t4153-am-resume-override-opts.sh
@@ -53,7 +53,7 @@ test_expect_success '--no-quiet overrides --quiet' '
# Applying side1 will be quiet.
test_must_fail git am --quiet side[123].eml >out &&
test_path_is_dir .git/rebase-apply &&
- test_i18ngrep ! "^Applying: " out &&
+ test_grep ! "^Applying: " out &&
echo side1 >file &&
git add file &&
diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh
index 7025cfd..fb53ddd 100755
--- a/t/t4200-rerere.sh
+++ b/t/t4200-rerere.sh
@@ -433,13 +433,13 @@ test_expect_success 'rerere --no-no-rerere-autoupdate' '
git update-index --index-info <failedmerge &&
cp file3.conflict file3 &&
test_must_fail git rerere --no-no-rerere-autoupdate 2>err &&
- test_i18ngrep [Uu]sage err &&
+ test_grep [Uu]sage err &&
test_must_fail git update-index --refresh
'
test_expect_success 'rerere -h' '
test_must_fail git rerere -h >help &&
- test_i18ngrep [Uu]sage help
+ test_grep [Uu]sage help
'
concat_insert () {
diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh
index 3095b1b..f698d0c 100755
--- a/t/t4201-shortlog.sh
+++ b/t/t4201-shortlog.sh
@@ -83,6 +83,13 @@ test_expect_success 'pretty format' '
test_cmp expect log.predictable
'
+test_expect_success 'pretty format (with --date)' '
+ sed "s/SUBJECT/2005-04-07 OBJECT_NAME/" expect.template >expect &&
+ git shortlog --format="%ad %H" --date=short HEAD >log &&
+ fuzz log >log.predictable &&
+ test_cmp expect log.predictable
+'
+
test_expect_success '--abbrev' '
sed s/SUBJECT/OBJID/ expect.template >expect &&
git shortlog --format="%h" --abbrev=35 HEAD >log &&
@@ -132,7 +139,7 @@ test_expect_success !MINGW 'shortlog can read --format=raw output' '
test_expect_success 'shortlog from non-git directory refuses extra arguments' '
test_must_fail env GIT_DIR=non-existing git shortlog foo 2>out &&
- test_i18ngrep "too many arguments" out
+ test_grep "too many arguments" out
'
test_expect_success 'shortlog should add newline when input line matches wraplen' '
@@ -237,6 +244,26 @@ test_expect_success 'shortlog --group=trailer:signed-off-by' '
test_cmp expect actual
'
+test_expect_success 'shortlog --group=format' '
+ git shortlog -s --date="format:%Y" --group="format:%cN (%cd)" \
+ HEAD >actual &&
+ cat >expect <<-\EOF &&
+ 4 C O Mitter (2005)
+ 1 Sin Nombre (2005)
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'shortlog --group=<format> DWIM' '
+ git shortlog -s --date="format:%Y" --group="%cN (%cd)" HEAD >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'shortlog bogus --group' '
+ test_must_fail git shortlog --group=bogus HEAD 2>err &&
+ grep "unknown group type" err
+'
+
test_expect_success 'trailer idents are split' '
cat >expect <<-\EOF &&
2 C O Mitter
@@ -285,6 +312,38 @@ test_expect_success 'shortlog de-duplicates trailers in a single commit' '
test_cmp expect actual
'
+# Trailers that have unfolded (single line) and folded (multiline) values which
+# are otherwise identical are treated as the same trailer for de-duplication.
+test_expect_success 'shortlog de-duplicates trailers in a single commit (folded/unfolded values)' '
+ git commit --allow-empty -F - <<-\EOF &&
+ subject one
+
+ this message has two distinct values, plus a repeat (folded)
+
+ Repeated-trailer: Foo foo foo
+ Repeated-trailer: Bar
+ Repeated-trailer: Foo
+ foo foo
+ EOF
+
+ git commit --allow-empty -F - <<-\EOF &&
+ subject two
+
+ similar to the previous, but without the second distinct value
+
+ Repeated-trailer: Foo foo foo
+ Repeated-trailer: Foo
+ foo foo
+ EOF
+
+ cat >expect <<-\EOF &&
+ 2 Foo foo foo
+ 1 Bar
+ EOF
+ git shortlog -ns --group=trailer:repeated-trailer -2 HEAD >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'shortlog can match multiple groups' '
git commit --allow-empty -F - <<-\EOF &&
subject one
@@ -319,6 +378,18 @@ test_expect_success 'shortlog can match multiple groups' '
test_cmp expect actual
'
+test_expect_success 'shortlog can match multiple format groups' '
+ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" \
+ git commit --allow-empty -m "identical names" &&
+ test_tick &&
+ cat >expect <<-\EOF &&
+ 2 A U Thor
+ 1 C O Mitter
+ EOF
+ git shortlog -ns --group="%cn" --group="%an" -2 HEAD >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'set up option selection tests' '
git commit --allow-empty -F - <<-\EOF
subject
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 6e66352..60fe60d 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -187,6 +187,21 @@ test_expect_success 'git config log.follow does not die with no paths' '
git log --
'
+test_expect_success 'git log --follow rejects unsupported pathspec magic' '
+ test_must_fail git log --follow ":(top,glob,icase)ichi" 2>stderr &&
+ # check full error message; we want to be sure we mention both
+ # of the rejected types (glob,icase), but not the allowed one (top)
+ echo "fatal: pathspec magic not supported by --follow: ${SQ}glob${SQ}, ${SQ}icase${SQ}" >expect &&
+ test_cmp expect stderr
+'
+
+test_expect_success 'log.follow disabled with unsupported pathspec magic' '
+ test_config log.follow true &&
+ git log --format=%s ":(glob,icase)ichi" >actual &&
+ echo third >expect &&
+ test_cmp expect actual
+'
+
test_expect_success 'git config log.follow is overridden by --no-follow' '
test_config log.follow true &&
git log --no-follow --pretty="format:%s" ichi >actual &&
@@ -249,6 +264,15 @@ test_expect_success 'log --grep' '
test_cmp expect actual
'
+for noop_opt in --invert-grep --all-match
+do
+ test_expect_success "log $noop_opt without --grep is a NOOP" '
+ git log >expect &&
+ git log $noop_opt >actual &&
+ test_cmp expect actual
+ '
+done
+
cat > expect << EOF
second
initial
@@ -704,9 +728,12 @@ test_expect_success 'set up more tangled history' '
git checkout -b tangle HEAD~6 &&
test_commit tangle-a tangle-a a &&
git merge main~3 &&
+ git update-ref refs/prefetch/merge HEAD &&
git merge side~1 &&
+ git update-ref refs/rewritten/merge HEAD &&
git checkout main &&
git merge tangle &&
+ git update-ref refs/hidden/tangle HEAD &&
git checkout -b reach &&
test_commit reach &&
git checkout main &&
@@ -823,6 +850,21 @@ test_expect_success 'log.decorate configuration' '
'
+test_expect_success 'parse log.excludeDecoration with no value' '
+ cp .git/config .git/config.orig &&
+ test_when_finished mv .git/config.orig .git/config &&
+
+ cat >>.git/config <<-\EOF &&
+ [log]
+ excludeDecoration
+ EOF
+ cat >expect <<-\EOF &&
+ error: missing value for '\''log.excludeDecoration'\''
+ EOF
+ git log --decorate=short 2>actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'decorate-refs with glob' '
cat >expect.decorate <<-\EOF &&
Merge-tag-reach
@@ -974,9 +1016,9 @@ test_expect_success 'decorate-refs-exclude and simplify-by-decoration' '
Merge-tag-reach (HEAD -> main)
reach (tag: reach, reach)
seventh (tag: seventh)
- Merge-branch-tangle
- Merge-branch-side-early-part-into-tangle (tangle)
- tangle-a (tag: tangle-a)
+ Merge-branch-tangle (refs/hidden/tangle)
+ Merge-branch-side-early-part-into-tangle (refs/rewritten/merge, tangle)
+ Merge-branch-main-early-part-into-tangle (refs/prefetch/merge)
EOF
git log -n6 --decorate=short --pretty="tformat:%f%d" \
--decorate-refs-exclude="*octopus*" \
@@ -1025,6 +1067,115 @@ test_expect_success 'decorate-refs and simplify-by-decoration without output' '
test_cmp expect actual
'
+test_expect_success 'decorate-refs-exclude HEAD' '
+ git log --decorate=full --oneline \
+ --decorate-refs-exclude="HEAD" >actual &&
+ ! grep HEAD actual
+'
+
+test_expect_success 'decorate-refs focus from default' '
+ git log --decorate=full --oneline \
+ --decorate-refs="refs/heads" >actual &&
+ ! grep HEAD actual
+'
+
+test_expect_success '--clear-decorations overrides defaults' '
+ cat >expect.default <<-\EOF &&
+ Merge-tag-reach (HEAD -> refs/heads/main)
+ Merge-tags-octopus-a-and-octopus-b
+ seventh (tag: refs/tags/seventh)
+ octopus-b (tag: refs/tags/octopus-b, refs/heads/octopus-b)
+ octopus-a (tag: refs/tags/octopus-a, refs/heads/octopus-a)
+ reach (tag: refs/tags/reach, refs/heads/reach)
+ Merge-branch-tangle
+ Merge-branch-side-early-part-into-tangle (refs/heads/tangle)
+ Merge-branch-main-early-part-into-tangle
+ tangle-a (tag: refs/tags/tangle-a)
+ Merge-branch-side
+ side-2 (tag: refs/tags/side-2, refs/heads/side)
+ side-1 (tag: refs/tags/side-1)
+ Second
+ sixth
+ fifth
+ fourth
+ third
+ second
+ initial
+ EOF
+ git log --decorate=full --pretty="tformat:%f%d" >actual &&
+ test_cmp expect.default actual &&
+
+ cat >expect.all <<-\EOF &&
+ Merge-tag-reach (HEAD -> refs/heads/main)
+ Merge-tags-octopus-a-and-octopus-b
+ seventh (tag: refs/tags/seventh)
+ octopus-b (tag: refs/tags/octopus-b, refs/heads/octopus-b)
+ octopus-a (tag: refs/tags/octopus-a, refs/heads/octopus-a)
+ reach (tag: refs/tags/reach, refs/heads/reach)
+ Merge-branch-tangle (refs/hidden/tangle)
+ Merge-branch-side-early-part-into-tangle (refs/rewritten/merge, refs/heads/tangle)
+ Merge-branch-main-early-part-into-tangle (refs/prefetch/merge)
+ tangle-a (tag: refs/tags/tangle-a)
+ Merge-branch-side
+ side-2 (tag: refs/tags/side-2, refs/heads/side)
+ side-1 (tag: refs/tags/side-1)
+ Second
+ sixth
+ fifth
+ fourth
+ third
+ second
+ initial
+ EOF
+ git log --decorate=full --pretty="tformat:%f%d" \
+ --clear-decorations >actual &&
+ test_cmp expect.all actual &&
+ git -c log.initialDecorationSet=all log \
+ --decorate=full --pretty="tformat:%f%d" >actual &&
+ test_cmp expect.all actual
+'
+
+test_expect_success '--clear-decorations clears previous exclusions' '
+ cat >expect.all <<-\EOF &&
+ Merge-tag-reach (HEAD -> refs/heads/main)
+ reach (tag: refs/tags/reach, refs/heads/reach)
+ Merge-tags-octopus-a-and-octopus-b
+ octopus-b (tag: refs/tags/octopus-b, refs/heads/octopus-b)
+ octopus-a (tag: refs/tags/octopus-a, refs/heads/octopus-a)
+ seventh (tag: refs/tags/seventh)
+ Merge-branch-tangle (refs/hidden/tangle)
+ Merge-branch-side-early-part-into-tangle (refs/rewritten/merge, refs/heads/tangle)
+ Merge-branch-main-early-part-into-tangle (refs/prefetch/merge)
+ tangle-a (tag: refs/tags/tangle-a)
+ side-2 (tag: refs/tags/side-2, refs/heads/side)
+ side-1 (tag: refs/tags/side-1)
+ initial
+ EOF
+
+ git log --decorate=full --pretty="tformat:%f%d" \
+ --simplify-by-decoration \
+ --decorate-refs-exclude="heads/octopus*" \
+ --decorate-refs="heads" \
+ --clear-decorations >actual &&
+ test_cmp expect.all actual &&
+
+ cat >expect.filtered <<-\EOF &&
+ Merge-tags-octopus-a-and-octopus-b
+ octopus-b (refs/heads/octopus-b)
+ octopus-a (refs/heads/octopus-a)
+ initial
+ EOF
+
+ git log --decorate=full --pretty="tformat:%f%d" \
+ --simplify-by-decoration \
+ --decorate-refs-exclude="heads/octopus" \
+ --decorate-refs="heads" \
+ --clear-decorations \
+ --decorate-refs-exclude="tags/" \
+ --decorate-refs="heads/octopus*" >actual &&
+ test_cmp expect.filtered actual
+'
+
test_expect_success 'log.decorate config parsing' '
git log --oneline --decorate=full >expect.full &&
git log --oneline --decorate=short >expect.short &&
@@ -1733,7 +1884,7 @@ test_expect_success '--no-graph does not unset --parents' '
test_expect_success '--reverse and --graph conflict' '
test_must_fail git log --reverse --graph 2>stderr &&
- test_i18ngrep "cannot be used together" stderr
+ test_grep "cannot be used together" stderr
'
test_expect_success '--reverse --graph --no-graph works' '
@@ -1744,7 +1895,7 @@ test_expect_success '--reverse --graph --no-graph works' '
test_expect_success '--show-linear-break and --graph conflict' '
test_must_fail git log --show-linear-break --graph 2>stderr &&
- test_i18ngrep "cannot be used together" stderr
+ test_grep "cannot be used together" stderr
'
test_expect_success '--show-linear-break --graph --no-graph works' '
@@ -1755,7 +1906,7 @@ test_expect_success '--show-linear-break --graph --no-graph works' '
test_expect_success '--no-walk and --graph conflict' '
test_must_fail git log --no-walk --graph 2>stderr &&
- test_i18ngrep "cannot be used together" stderr
+ test_grep "cannot be used together" stderr
'
test_expect_success '--no-walk --graph --no-graph works' '
@@ -1766,8 +1917,8 @@ test_expect_success '--no-walk --graph --no-graph works' '
test_expect_success '--walk-reflogs and --graph conflict' '
test_must_fail git log --walk-reflogs --graph 2>stderr &&
- (test_i18ngrep "cannot combine" stderr ||
- test_i18ngrep "cannot be used together" stderr)
+ (test_grep "cannot combine" stderr ||
+ test_grep "cannot be used together" stderr)
'
test_expect_success '--walk-reflogs --graph --no-graph works' '
@@ -2101,24 +2252,7 @@ test_expect_success 'log on empty repo fails' '
git init empty &&
test_when_finished "rm -rf empty" &&
test_must_fail git -C empty log 2>stderr &&
- test_i18ngrep does.not.have.any.commits stderr
-'
-
-test_expect_success REFFILES 'log diagnoses bogus HEAD hash' '
- git init empty &&
- test_when_finished "rm -rf empty" &&
- echo 1234abcd >empty/.git/refs/heads/main &&
- test_must_fail git -C empty log 2>stderr &&
- test_i18ngrep broken stderr
-'
-
-test_expect_success 'log diagnoses bogus HEAD symref' '
- git init empty &&
- git --git-dir empty/.git symbolic-ref HEAD refs/heads/invalid.lock &&
- test_must_fail git -C empty log 2>stderr &&
- test_i18ngrep broken stderr &&
- test_must_fail git -C empty log --default totally-bogus 2>stderr &&
- test_i18ngrep broken stderr
+ test_grep does.not.have.any.commits stderr
'
test_expect_success 'log does not default to HEAD when rev input is given' '
@@ -2192,11 +2326,25 @@ test_expect_success 'log --decorate includes all levels of tag annotated tags' '
test_cmp expect actual
'
+test_expect_success 'log --decorate does not include things outside filter' '
+ reflist="refs/prefetch refs/rebase-merge refs/bundle" &&
+
+ for ref in $reflist
+ do
+ git update-ref $ref/fake HEAD || return 1
+ done &&
+
+ git log --decorate=full --oneline >actual &&
+
+ # None of the refs are visible:
+ ! grep /fake actual
+'
+
test_expect_success 'log --end-of-options' '
- git update-ref refs/heads/--source HEAD &&
- git log --end-of-options --source >actual &&
- git log >expect &&
- test_cmp expect actual
+ git update-ref refs/heads/--source HEAD &&
+ git log --end-of-options --source >actual &&
+ git log >expect &&
+ test_cmp expect actual
'
test_expect_success 'set up commits with different authors' '
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index 0b2d21e..8a88dd7 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh
@@ -360,7 +360,7 @@ test_expect_success 'mailmap.blob might be the wrong type' '
cp default.map .mailmap &&
git -c mailmap.blob=HEAD: shortlog HEAD >actual 2>err &&
- test_i18ngrep "mailmap is not a blob" err &&
+ test_grep "mailmap is not a blob" err &&
test_cmp expect actual
'
@@ -466,7 +466,7 @@ test_expect_success 'gitmailmap(5) example output: example #1' '
Author Jane Doe <jane@laptop.(none)> maps to Jane Doe <jane@laptop.(none)>
Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
- Author Jane D <jane@desktop.(none)> maps to Jane Doe <jane@desktop.(none)>
+ Author Jane D. <jane@desktop.(none)> maps to Jane Doe <jane@desktop.(none)>
Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
EOF
git -C doc log --reverse --pretty=format:"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n" >actual &&
@@ -494,7 +494,7 @@ test_expect_success 'gitmailmap(5) example output: example #2' '
Author Jane Doe <jane@laptop.(none)> maps to Jane Doe <jane@example.com>
Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
- Author Jane D <jane@desktop.(none)> maps to Jane Doe <jane@example.com>
+ Author Jane D. <jane@desktop.(none)> maps to Jane Doe <jane@example.com>
Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
EOF
git -C doc log --reverse --pretty=format:"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n" >actual &&
@@ -963,4 +963,128 @@ test_expect_success SYMLINKS 'symlinks not respected in-tree' '
test_cmp expect actual
'
+test_expect_success 'prepare for cat-file --mailmap' '
+ rm -f .mailmap &&
+ git commit --allow-empty -m foo --author="Orig <orig@example.com>"
+'
+
+test_expect_success '--no-use-mailmap disables mailmap in cat-file' '
+ test_when_finished "rm .mailmap" &&
+ cat >.mailmap <<-EOF &&
+ A U Thor <author@example.com> Orig <orig@example.com>
+ EOF
+ cat >expect <<-EOF &&
+ author Orig <orig@example.com>
+ EOF
+ git cat-file --no-use-mailmap commit HEAD >log &&
+ sed -n "/^author /s/\([^>]*>\).*/\1/p" log >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success '--use-mailmap enables mailmap in cat-file' '
+ test_when_finished "rm .mailmap" &&
+ cat >.mailmap <<-EOF &&
+ A U Thor <author@example.com> Orig <orig@example.com>
+ EOF
+ cat >expect <<-EOF &&
+ author A U Thor <author@example.com>
+ EOF
+ git cat-file --use-mailmap commit HEAD >log &&
+ sed -n "/^author /s/\([^>]*>\).*/\1/p" log >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success '--no-mailmap disables mailmap in cat-file for annotated tag objects' '
+ test_when_finished "rm .mailmap" &&
+ cat >.mailmap <<-EOF &&
+ Orig <orig@example.com> C O Mitter <committer@example.com>
+ EOF
+ cat >expect <<-EOF &&
+ tagger C O Mitter <committer@example.com>
+ EOF
+ git tag -a -m "annotated tag" v1 &&
+ git cat-file --no-mailmap -p v1 >log &&
+ sed -n "/^tagger /s/\([^>]*>\).*/\1/p" log >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success '--mailmap enables mailmap in cat-file for annotated tag objects' '
+ test_when_finished "rm .mailmap" &&
+ cat >.mailmap <<-EOF &&
+ Orig <orig@example.com> C O Mitter <committer@example.com>
+ EOF
+ cat >expect <<-EOF &&
+ tagger Orig <orig@example.com>
+ EOF
+ git tag -a -m "annotated tag" v2 &&
+ git cat-file --mailmap -p v2 >log &&
+ sed -n "/^tagger /s/\([^>]*>\).*/\1/p" log >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'git cat-file -s returns correct size with --use-mailmap' '
+ test_when_finished "rm .mailmap" &&
+ cat >.mailmap <<-\EOF &&
+ C O Mitter <committer@example.com> Orig <orig@example.com>
+ EOF
+ git cat-file commit HEAD >commit.out &&
+ echo $(wc -c <commit.out) >expect &&
+ git cat-file --use-mailmap commit HEAD >commit.out &&
+ echo $(wc -c <commit.out) >>expect &&
+ git cat-file -s HEAD >actual &&
+ git cat-file --use-mailmap -s HEAD >>actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'git cat-file -s returns correct size with --use-mailmap for tag objects' '
+ test_when_finished "rm .mailmap" &&
+ cat >.mailmap <<-\EOF &&
+ Orig <orig@example.com> C O Mitter <committer@example.com>
+ EOF
+ git tag -a -m "annotated tag" v3 &&
+ git cat-file tag v3 >tag.out &&
+ echo $(wc -c <tag.out) >expect &&
+ git cat-file --use-mailmap tag v3 >tag.out &&
+ echo $(wc -c <tag.out) >>expect &&
+ git cat-file -s v3 >actual &&
+ git cat-file --use-mailmap -s v3 >>actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'git cat-file --batch-check returns correct size with --use-mailmap' '
+ test_when_finished "rm .mailmap" &&
+ cat >.mailmap <<-\EOF &&
+ C O Mitter <committer@example.com> Orig <orig@example.com>
+ EOF
+ git cat-file commit HEAD >commit.out &&
+ commit_size=$(wc -c <commit.out) &&
+ commit_sha=$(git rev-parse HEAD) &&
+ echo $commit_sha commit $commit_size >expect &&
+ git cat-file --use-mailmap commit HEAD >commit.out &&
+ commit_size=$(wc -c <commit.out) &&
+ echo $commit_sha commit $commit_size >>expect &&
+ echo "HEAD" >in &&
+ git cat-file --batch-check <in >actual &&
+ git cat-file --use-mailmap --batch-check <in >>actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'git cat-file --batch-command returns correct size with --use-mailmap' '
+ test_when_finished "rm .mailmap" &&
+ cat >.mailmap <<-\EOF &&
+ C O Mitter <committer@example.com> Orig <orig@example.com>
+ EOF
+ git cat-file commit HEAD >commit.out &&
+ commit_size=$(wc -c <commit.out) &&
+ commit_sha=$(git rev-parse HEAD) &&
+ echo $commit_sha commit $commit_size >expect &&
+ git cat-file --use-mailmap commit HEAD >commit.out &&
+ commit_size=$(wc -c <commit.out) &&
+ echo $commit_sha commit $commit_size >>expect &&
+ echo "info HEAD" >in &&
+ git cat-file --batch-command <in >actual &&
+ git cat-file --use-mailmap --batch-command <in >>actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t4204-patch-id.sh b/t/t4204-patch-id.sh
index a730c0d..a7fa94c 100755
--- a/t/t4204-patch-id.sh
+++ b/t/t4204-patch-id.sh
@@ -8,13 +8,13 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
test_expect_success 'setup' '
- as="a a a a a a a a" && # eight a
- test_write_lines $as >foo &&
- test_write_lines $as >bar &&
+ str="ab cd ef gh ij kl mn op" &&
+ test_write_lines $str >foo &&
+ test_write_lines $str >bar &&
git add foo bar &&
git commit -a -m initial &&
- test_write_lines $as b >foo &&
- test_write_lines $as b >bar &&
+ test_write_lines $str b >foo &&
+ test_write_lines $str b >bar &&
git commit -a -m first &&
git checkout -b same main &&
git commit --amend -m same-msg &&
@@ -22,8 +22,23 @@ test_expect_success 'setup' '
echo c >foo &&
echo c >bar &&
git commit --amend -a -m notsame-msg &&
+ git checkout -b with_space main~ &&
+ cat >foo <<-\EOF &&
+ a b
+ c d
+ e f
+ g h
+ i j
+ k l
+ m n
+ op
+ EOF
+ cp foo bar &&
+ git add foo bar &&
+ git commit --amend -m "with spaces" &&
test_write_lines bar foo >bar-then-foo &&
test_write_lines foo bar >foo-then-bar
+
'
test_expect_success 'patch-id output is well-formed' '
@@ -42,7 +57,7 @@ calc_patch_id () {
}
get_top_diff () {
- git log -p -1 "$@" -O bar-then-foo --
+ git log -p -1 "$@" -O bar-then-foo --full-index --
}
get_patch_id () {
@@ -61,6 +76,33 @@ test_expect_success 'patch-id detects inequality' '
get_patch_id notsame &&
! test_cmp patch-id_main patch-id_notsame
'
+test_expect_success 'patch-id detects equality binary' '
+ cat >.gitattributes <<-\EOF &&
+ foo binary
+ bar binary
+ EOF
+ get_patch_id main &&
+ get_patch_id same &&
+ git log -p -1 --binary main >top-diff.output &&
+ calc_patch_id <top-diff.output main_binpatch &&
+ git log -p -1 --binary same >top-diff.output &&
+ calc_patch_id <top-diff.output same_binpatch &&
+ test_cmp patch-id_main patch-id_main_binpatch &&
+ test_cmp patch-id_same patch-id_same_binpatch &&
+ test_cmp patch-id_main patch-id_same &&
+ test_when_finished "rm .gitattributes"
+'
+
+test_expect_success 'patch-id detects inequality binary' '
+ cat >.gitattributes <<-\EOF &&
+ foo binary
+ bar binary
+ EOF
+ get_patch_id main &&
+ get_patch_id notsame &&
+ ! test_cmp patch-id_main patch-id_notsame &&
+ test_when_finished "rm .gitattributes"
+'
test_expect_success 'patch-id supports git-format-patch output' '
get_patch_id main &&
@@ -101,9 +143,21 @@ test_patch_id_file_order () {
git format-patch -1 --stdout -O foo-then-bar >format-patch.output &&
calc_patch_id <format-patch.output "ordered-$name" "$@" &&
cmp_patch_id $relevant "$name" "ordered-$name"
+}
+test_patch_id_whitespace () {
+ relevant="$1"
+ shift
+ name="ws-${1}-$relevant"
+ shift
+ get_top_diff "main~" >top-diff.output &&
+ calc_patch_id <top-diff.output "$name" "$@" &&
+ get_top_diff "with_space" >top-diff.output &&
+ calc_patch_id <top-diff.output "ws-$name" "$@" &&
+ cmp_patch_id $relevant "$name" "ws-$name"
}
+
# combined test for options: add more tests here to make them
# run with all options
test_patch_id () {
@@ -119,6 +173,14 @@ test_expect_success 'file order is relevant with --unstable' '
test_patch_id_file_order relevant --unstable --unstable
'
+test_expect_success 'whitespace is relevant with --verbatim' '
+ test_patch_id_whitespace relevant --verbatim --verbatim
+'
+
+test_expect_success 'whitespace is irrelevant without --verbatim' '
+ test_patch_id_whitespace irrelevant --stable --stable
+'
+
#Now test various option combinations.
test_expect_success 'default is unstable' '
test_patch_id relevant default
@@ -134,6 +196,17 @@ test_expect_success 'patchid.stable = false is unstable' '
test_patch_id relevant patchid.stable=false
'
+test_expect_success 'patchid.verbatim = true is correct and stable' '
+ test_config patchid.verbatim true &&
+ test_patch_id_whitespace relevant patchid.verbatim=true &&
+ test_patch_id irrelevant patchid.verbatim=true
+'
+
+test_expect_success 'patchid.verbatim = false is unstable' '
+ test_config patchid.verbatim false &&
+ test_patch_id relevant patchid.verbatim=false
+'
+
test_expect_success '--unstable overrides patchid.stable = true' '
test_config patchid.stable true &&
test_patch_id relevant patchid.stable=true--unstable --unstable
@@ -144,6 +217,11 @@ test_expect_success '--stable overrides patchid.stable = false' '
test_patch_id irrelevant patchid.stable=false--stable --stable
'
+test_expect_success '--verbatim overrides patchid.stable = false' '
+ test_config patchid.stable false &&
+ test_patch_id_whitespace relevant stable=false--verbatim --verbatim
+'
+
test_expect_success 'patch-id supports git-format-patch MIME output' '
get_patch_id main &&
git checkout same &&
@@ -198,7 +276,10 @@ test_expect_success 'patch-id handles no-nl-at-eof markers' '
EOF
calc_patch_id nonl <nonl &&
calc_patch_id withnl <withnl &&
- test_cmp patch-id_nonl patch-id_withnl
+ test_cmp patch-id_nonl patch-id_withnl &&
+ calc_patch_id nonl-inc-ws --verbatim <nonl &&
+ calc_patch_id withnl-inc-ws --verbatim <withnl &&
+ ! test_cmp patch-id_nonl-inc-ws patch-id_withnl-inc-ws
'
test_expect_success 'patch-id handles diffs with one line of before/after' '
diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
index e448ef2..158b49d 100755
--- a/t/t4205-log-pretty-formats.sh
+++ b/t/t4205-log-pretty-formats.sh
@@ -30,40 +30,46 @@ test_expect_success 'set up basic repos' '
>bar &&
git add foo &&
test_tick &&
- git config i18n.commitEncoding $test_encoding &&
+ test_config i18n.commitEncoding $test_encoding &&
commit_msg $test_encoding | git commit -F - &&
git add bar &&
test_tick &&
- git commit -m "add bar" &&
- git config --unset i18n.commitEncoding
+ git commit -m "add bar"
'
test_expect_success 'alias builtin format' '
git log --pretty=oneline >expected &&
- git config pretty.test-alias oneline &&
+ test_config pretty.test-alias oneline &&
git log --pretty=test-alias >actual &&
test_cmp expected actual
'
test_expect_success 'alias masking builtin format' '
git log --pretty=oneline >expected &&
- git config pretty.oneline "%H" &&
+ test_config pretty.oneline "%H" &&
git log --pretty=oneline >actual &&
test_cmp expected actual
'
test_expect_success 'alias user-defined format' '
git log --pretty="format:%h" >expected &&
- git config pretty.test-alias "format:%h" &&
+ test_config pretty.test-alias "format:%h" &&
git log --pretty=test-alias >actual &&
test_cmp expected actual
'
+test_expect_success 'alias user-defined format is matched case-insensitively' '
+ git log --pretty="format:%h" >expected &&
+ test_config pretty.testone "format:%h" &&
+ test_config pretty.testtwo testOne &&
+ git log --pretty=testTwo >actual &&
+ test_cmp expected actual
+'
+
test_expect_success 'alias user-defined tformat with %s (ISO8859-1 encoding)' '
- git config i18n.logOutputEncoding $test_encoding &&
+ test_config i18n.logOutputEncoding $test_encoding &&
git log --oneline >expected-s &&
git log --pretty="tformat:%h %s" >actual-s &&
- git config --unset i18n.logOutputEncoding &&
test_cmp expected-s actual-s
'
@@ -75,34 +81,34 @@ test_expect_success 'alias user-defined tformat with %s (utf-8 encoding)' '
test_expect_success 'alias user-defined tformat' '
git log --pretty="tformat:%h" >expected &&
- git config pretty.test-alias "tformat:%h" &&
+ test_config pretty.test-alias "tformat:%h" &&
git log --pretty=test-alias >actual &&
test_cmp expected actual
'
test_expect_success 'alias non-existent format' '
- git config pretty.test-alias format-that-will-never-exist &&
+ test_config pretty.test-alias format-that-will-never-exist &&
test_must_fail git log --pretty=test-alias
'
test_expect_success 'alias of an alias' '
git log --pretty="tformat:%h" >expected &&
- git config pretty.test-foo "tformat:%h" &&
- git config pretty.test-bar test-foo &&
+ test_config pretty.test-foo "tformat:%h" &&
+ test_config pretty.test-bar test-foo &&
git log --pretty=test-bar >actual && test_cmp expected actual
'
test_expect_success 'alias masking an alias' '
git log --pretty=format:"Two %H" >expected &&
- git config pretty.duplicate "format:One %H" &&
- git config --add pretty.duplicate "format:Two %H" &&
+ test_config pretty.duplicate "format:One %H" &&
+ test_config pretty.duplicate "format:Two %H" --add &&
git log --pretty=duplicate >actual &&
test_cmp expected actual
'
test_expect_success 'alias loop' '
- git config pretty.test-foo test-bar &&
- git config pretty.test-bar test-foo &&
+ test_config pretty.test-foo test-bar &&
+ test_config pretty.test-bar test-foo &&
test_must_fail git log --pretty=test-foo
'
@@ -156,7 +162,7 @@ test_expect_success 'NUL termination with --reflog --pretty=oneline' '
for r in $revs
do
git show -s --pretty=oneline "$r" >raw &&
- cat raw | lf_to_nul || exit 1
+ lf_to_nul <raw || return 1
done >expect &&
# the trailing NUL is already produced so we do not need to
# output another one
@@ -576,6 +582,38 @@ test_expect_success 'clean log decoration' '
test_cmp expected actual1
'
+test_expect_success 'pretty format %decorate' '
+ git checkout -b foo &&
+ git commit --allow-empty -m "new commit" &&
+ git tag bar &&
+ git branch qux &&
+
+ echo " (HEAD -> foo, tag: bar, qux)" >expect1 &&
+ git log --format="%(decorate)" -1 >actual1 &&
+ test_cmp expect1 actual1 &&
+
+ echo "HEAD -> foo, tag: bar, qux" >expect2 &&
+ git log --format="%(decorate:prefix=,suffix=)" -1 >actual2 &&
+ test_cmp expect2 actual2 &&
+
+ echo "[ bar; qux; foo ]" >expect3 &&
+ git log --format="%(decorate:prefix=[ ,suffix= ],separator=%x3B ,tag=)" \
+ --decorate-refs=refs/ -1 >actual3 &&
+ test_cmp expect3 actual3 &&
+
+ # Try with a typo (in "separator"), in which case the placeholder should
+ # not be replaced.
+ echo "%(decorate:prefix=[ ,suffix= ],separater=; )" >expect4 &&
+ git log --format="%(decorate:prefix=[ ,suffix= ],separater=%x3B )" \
+ -1 >actual4 &&
+ test_cmp expect4 actual4 &&
+
+ echo "HEAD->foo bar qux" >expect5 &&
+ git log --format="%(decorate:prefix=,suffix=,separator= ,tag=,pointer=->)" \
+ -1 >actual5 &&
+ test_cmp expect5 actual5
+'
+
cat >trailers <<EOF
Signed-off-by: A U Thor <author@example.com>
Acked-by: A U Thor <author@example.com>
@@ -924,6 +962,36 @@ test_expect_success '%S in git log --format works with other placeholders (part
test_cmp expect actual
'
+test_expect_success 'setup more commits for %S with --bisect' '
+ test_commit four &&
+ test_commit five &&
+
+ head1=$(git rev-parse --verify HEAD~0) &&
+ head2=$(git rev-parse --verify HEAD~1) &&
+ head3=$(git rev-parse --verify HEAD~2) &&
+ head4=$(git rev-parse --verify HEAD~3)
+'
+
+test_expect_success '%S with --bisect labels commits with refs/bisect/bad ref' '
+ git update-ref refs/bisect/bad-$head1 $head1 &&
+ git update-ref refs/bisect/go $head1 &&
+ git update-ref refs/bisect/bad-$head2 $head2 &&
+ git update-ref refs/bisect/b $head3 &&
+ git update-ref refs/bisect/bad-$head4 $head4 &&
+ git update-ref refs/bisect/good-$head4 $head4 &&
+
+ # We expect to see the range of commits betwee refs/bisect/good-$head4
+ # and refs/bisect/bad-$head1. The "source" ref is the nearest bisect ref
+ # from which the commit is reachable.
+ cat >expect <<-EOF &&
+ $head1 refs/bisect/bad-$head1
+ $head2 refs/bisect/bad-$head2
+ $head3 refs/bisect/bad-$head2
+ EOF
+ git log --bisect --format="%H %S" >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'log --pretty=reference' '
git log --pretty="tformat:%h (%s, %as)" >expect &&
git log --pretty=reference >actual &&
@@ -1012,10 +1080,128 @@ test_expect_success '%(describe:tags) vs git describe --tags' '
test_expect_success '%(describe:abbrev=...) vs git describe --abbrev=...' '
test_when_finished "git tag -d tagname" &&
+
+ # Case 1: We have commits between HEAD and the most recent tag
+ # reachable from it
+ test_commit --no-tag file &&
+ git describe --abbrev=15 >expect &&
+ git log -1 --format="%(describe:abbrev=15)" >actual &&
+ test_cmp expect actual &&
+
+ # Make sure the hash used is at least 15 digits long
+ sed -e "s/^.*-g\([0-9a-f]*\)$/\1/" <actual >hexpart &&
+ test 16 -le $(wc -c <hexpart) &&
+
+ # Case 2: We have a tag at HEAD, describe directly gives the
+ # name of the tag
git tag -a -m tagged tagname &&
git describe --abbrev=15 >expect &&
git log -1 --format="%(describe:abbrev=15)" >actual &&
+ test_cmp expect actual &&
+ test tagname = $(cat actual)
+'
+
+test_expect_success 'log --pretty with space stealing' '
+ printf mm0 >expect &&
+ git log -1 --pretty="format:mm%>>|(1)%x30" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'log --pretty with invalid padding format' '
+ printf "%s%%<(20" "$(git rev-parse HEAD)" >expect &&
+ git log -1 --pretty="format:%H%<(20" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'log --pretty with magical wrapping directives' '
+ commit_id=$(git commit-tree HEAD^{tree} -m "describe me") &&
+ git tag describe-me $commit_id &&
+ printf "\n(tag:\ndescribe-me)%%+w(2)" >expect &&
+ git log -1 --pretty="format:%w(1)%+d%+w(2)" $commit_id >actual &&
test_cmp expect actual
'
+test_expect_success SIZE_T_IS_64BIT 'log --pretty with overflowing wrapping directive' '
+ printf "%%w(2147483649,1,1)0" >expect &&
+ git log -1 --pretty="format:%w(2147483649,1,1)%x30" >actual &&
+ test_cmp expect actual &&
+ printf "%%w(1,2147483649,1)0" >expect &&
+ git log -1 --pretty="format:%w(1,2147483649,1)%x30" >actual &&
+ test_cmp expect actual &&
+ printf "%%w(1,1,2147483649)0" >expect &&
+ git log -1 --pretty="format:%w(1,1,2147483649)%x30" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success SIZE_T_IS_64BIT 'log --pretty with overflowing padding directive' '
+ printf "%%<(2147483649)0" >expect &&
+ git log -1 --pretty="format:%<(2147483649)%x30" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'log --pretty with padding and preceding control chars' '
+ printf "\20\20 0" >expect &&
+ git log -1 --pretty="format:%x10%x10%>|(4)%x30" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'log --pretty truncation with control chars' '
+ test_commit "$(printf "\20\20\20\20xxxx")" file contents commit-with-control-chars &&
+ printf "\20\20\20\20x.." >expect &&
+ git log -1 --pretty="format:%<(3,trunc)%s" commit-with-control-chars >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success EXPENSIVE,SIZE_T_IS_64BIT 'log --pretty with huge commit message' '
+ # We only assert that this command does not crash. This needs to be
+ # executed with the address sanitizer to demonstrate failure.
+ git log -1 --pretty="format:%>(2147483646)%x41%41%>(2147483646)%x41" >/dev/null
+'
+
+test_expect_success EXPENSIVE,SIZE_T_IS_64BIT 'set up huge commit' '
+ test-tool genzeros 2147483649 | tr "\000" "1" >expect &&
+ huge_commit=$(git commit-tree -F expect HEAD^{tree})
+'
+
+test_expect_success EXPENSIVE,SIZE_T_IS_64BIT 'log --pretty with huge commit message' '
+ git log -1 --format="%B%<(1)%x30" $huge_commit >actual &&
+ echo 0 >>expect &&
+ test_cmp expect actual
+'
+
+test_expect_success EXPENSIVE,SIZE_T_IS_64BIT 'log --pretty with huge commit message does not cause allocation failure' '
+ test_must_fail git log -1 --format="%<(1)%B" $huge_commit 2>error &&
+ cat >expect <<-EOF &&
+ fatal: number too large to represent as int on this platform: 2147483649
+ EOF
+ test_cmp expect error
+'
+
+# pretty-formats note wide char limitations, and add tests
+test_expect_failure 'wide and decomposed characters column counting' '
+
+# from t/lib-unicode-nfc-nfd.sh hex values converted to octal
+ utf8_nfc=$(printf "\303\251") && # e acute combined.
+ utf8_nfd=$(printf "\145\314\201") && # e with a combining acute (i.e. decomposed)
+ utf8_emoji=$(printf "\360\237\221\250") &&
+
+# replacement character when requesting a wide char fits in a single display colum.
+# "half wide" alternative could be a plain ASCII dot `.`
+ utf8_vert_ell=$(printf "\342\213\256") &&
+
+# use ${xxx} here!
+ nfc10="${utf8_nfc}${utf8_nfc}${utf8_nfc}${utf8_nfc}${utf8_nfc}${utf8_nfc}${utf8_nfc}${utf8_nfc}${utf8_nfc}${utf8_nfc}" &&
+ nfd10="${utf8_nfd}${utf8_nfd}${utf8_nfd}${utf8_nfd}${utf8_nfd}${utf8_nfd}${utf8_nfd}${utf8_nfd}${utf8_nfd}${utf8_nfd}" &&
+ emoji5="${utf8_emoji}${utf8_emoji}${utf8_emoji}${utf8_emoji}${utf8_emoji}" &&
+# emoji5 uses 10 display columns
+
+ test_commit "abcdefghij" &&
+ test_commit --no-tag "${nfc10}" &&
+ test_commit --no-tag "${nfd10}" &&
+ test_commit --no-tag "${emoji5}" &&
+ printf "${utf8_emoji}..${utf8_emoji}${utf8_vert_ell}\n${utf8_nfd}..${utf8_nfd}${utf8_nfd}\n${utf8_nfc}..${utf8_nfc}${utf8_nfc}\na..ij\n" >expected &&
+ git log --format="%<(5,mtrunc)%s" -4 >actual &&
+ test_cmp expected actual
+'
+
test_done
diff --git a/t/t4206-log-follow-harder-copies.sh b/t/t4206-log-follow-harder-copies.sh
index 33ecf82..9167b03 100755
--- a/t/t4206-log-follow-harder-copies.sh
+++ b/t/t4206-log-follow-harder-copies.sh
@@ -16,29 +16,29 @@ Line 2
Line 3
'
-test_expect_success \
- 'add a file path0 and commit.' \
- 'git add path0 &&
- git commit -m "Add path0"'
+test_expect_success 'add a file path0 and commit.' '
+ git add path0 &&
+ git commit -m "Add path0"
+'
echo >path0 'New line 1
New line 2
New line 3
'
-test_expect_success \
- 'Change path0.' \
- 'git add path0 &&
- git commit -m "Change path0"'
+test_expect_success 'Change path0.' '
+ git add path0 &&
+ git commit -m "Change path0"
+'
cat <path0 >path1
-test_expect_success \
- 'copy path0 to path1.' \
- 'git add path1 &&
- git commit -m "Copy path1 from path0"'
+test_expect_success 'copy path0 to path1.' '
+ git add path1 &&
+ git commit -m "Copy path1 from path0"
+'
-test_expect_success \
- 'find the copy path0 -> path1 harder' \
- 'git log --follow --name-status --pretty="format:%s" path1 > current'
+test_expect_success 'find the copy path0 -> path1 harder' '
+ git log --follow --name-status --pretty="format:%s" path1 > current
+'
cat >expected <<\EOF
Copy path1 from path0
@@ -51,8 +51,8 @@ Add path0
A path0
EOF
-test_expect_success \
- 'validate the output.' \
- 'compare_diff_patch current expected'
+test_expect_success 'validate the output.' '
+ compare_diff_patch current expected
+'
test_done
diff --git a/t/t4207-log-decoration-colors.sh b/t/t4207-log-decoration-colors.sh
index 36ac6af..73ea9e5 100755
--- a/t/t4207-log-decoration-colors.sh
+++ b/t/t4207-log-decoration-colors.sh
@@ -3,7 +3,7 @@
# Copyright (c) 2010 Nazri Ramliy
#
-test_description='Test for "git log --decorate" colors'
+test_description='test "git log --decorate" colors'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
@@ -17,6 +17,7 @@ test_expect_success setup '
git config color.decorate.remoteBranch red &&
git config color.decorate.tag "reverse bold yellow" &&
git config color.decorate.stash magenta &&
+ git config color.decorate.grafted black &&
git config color.decorate.HEAD cyan &&
c_reset="<RESET>" &&
@@ -27,6 +28,7 @@ test_expect_success setup '
c_tag="<BOLD;REVERSE;YELLOW>" &&
c_stash="<MAGENTA>" &&
c_HEAD="<CYAN>" &&
+ c_grafted="<BLACK>" &&
test_commit A &&
git clone . other &&
@@ -42,25 +44,91 @@ test_expect_success setup '
git stash save Changes to A.t
'
-cat >expected <<EOF
-${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_HEAD}HEAD ->\
- ${c_reset}${c_branch}main${c_reset}${c_commit},\
- ${c_reset}${c_tag}tag: v1.0${c_reset}${c_commit},\
- ${c_reset}${c_tag}tag: B${c_reset}${c_commit})${c_reset} B
-${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_tag}tag: A1${c_reset}${c_commit},\
- ${c_reset}${c_remoteBranch}other/main${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}${c_tag}tag: A${c_reset}${c_commit})${c_reset} A
-EOF
+cmp_filtered_decorations () {
+ sed "s/$OID_REGEX/COMMIT_ID/" actual | test_decode_color >filtered &&
+ test_cmp expect filtered
+}
# We want log to show all, but the second parent to refs/stash is irrelevant
# to this test since it does not contain any decoration, hence --first-parent
-test_expect_success 'Commit Decorations Colored Correctly' '
- git log --first-parent --abbrev=10 --all --decorate --oneline --color=always |
- sed "s/[0-9a-f]\{10,10\}/COMMIT_ID/" |
- test_decode_color >out &&
- test_cmp expected out
+test_expect_success 'commit decorations colored correctly' '
+ cat >expect <<-EOF &&
+ ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_HEAD}HEAD${c_reset}\
+${c_commit} -> ${c_reset}${c_branch}main${c_reset}${c_commit}, \
+${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_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}\
+${c_tag}tag: ${c_reset}${c_tag}A${c_reset}${c_commit})${c_reset} A
+ EOF
+
+ git log --first-parent --no-abbrev --decorate --oneline --color=always --all >actual &&
+ cmp_filtered_decorations
+'
+
+remove_replace_refs () {
+ git for-each-ref 'refs/replace*/**' --format='delete %(refname)' >in &&
+ git update-ref --stdin <in &&
+ rm in
+}
+
+test_expect_success 'test coloring with replace-objects' '
+ test_when_finished remove_replace_refs &&
+ test_commit C &&
+ test_commit D &&
+
+ git replace HEAD~1 HEAD~2 &&
+
+ cat >expect <<-EOF &&
+ ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_HEAD}HEAD${c_reset}\
+${c_commit} -> ${c_reset}${c_branch}main${c_reset}${c_commit}, \
+${c_reset}${c_tag}tag: ${c_reset}${c_tag}D${c_reset}${c_commit})${c_reset} D
+ ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}\
+${c_tag}tag: ${c_reset}${c_tag}C${c_reset}${c_commit}, \
+${c_reset}${c_grafted}replaced${c_reset}${c_commit})${c_reset} B
+ ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}\
+${c_tag}tag: ${c_reset}${c_tag}A${c_reset}${c_commit})${c_reset} A
+EOF
+
+ git log --first-parent --no-abbrev --decorate --oneline --color=always HEAD >actual &&
+ cmp_filtered_decorations &&
+ git replace -d HEAD~1 &&
+
+ GIT_REPLACE_REF_BASE=refs/replace2/ git replace HEAD~1 HEAD~2 &&
+ GIT_REPLACE_REF_BASE=refs/replace2/ git log --first-parent \
+ --no-abbrev --decorate --oneline --color=always HEAD >actual &&
+ cmp_filtered_decorations
+'
+
+test_expect_success 'test coloring with grafted commit' '
+ test_when_finished remove_replace_refs &&
+
+ git replace --graft HEAD HEAD~2 &&
+
+ cat >expect <<-EOF &&
+ ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_HEAD}HEAD${c_reset}\
+${c_commit} -> ${c_reset}${c_branch}main${c_reset}${c_commit}, \
+${c_reset}${c_tag}tag: ${c_reset}${c_tag}D${c_reset}${c_commit}, \
+${c_reset}${c_grafted}replaced${c_reset}${c_commit})${c_reset} D
+ ${c_commit}COMMIT_ID${c_reset}${c_commit} (${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}A${c_reset}${c_commit})${c_reset} A
+ EOF
+
+ git log --first-parent --no-abbrev --decorate --oneline --color=always HEAD >actual &&
+ cmp_filtered_decorations &&
+ git replace -d HEAD &&
+
+ GIT_REPLACE_REF_BASE=refs/replace2/ git replace --graft HEAD HEAD~2 &&
+ GIT_REPLACE_REF_BASE=refs/replace2/ git log --first-parent \
+ --no-abbrev --decorate --oneline --color=always HEAD >actual &&
+ cmp_filtered_decorations
'
test_done
diff --git a/t/t4208-log-magic-pathspec.sh b/t/t4208-log-magic-pathspec.sh
index 7f0c1dc..806b280 100755
--- a/t/t4208-log-magic-pathspec.sh
+++ b/t/t4208-log-magic-pathspec.sh
@@ -21,7 +21,7 @@ test_expect_success '"git log :/" should not be ambiguous' '
test_expect_success '"git log :/a" should be ambiguous (applied both rev and worktree)' '
: >a &&
test_must_fail git log :/a 2>error &&
- test_i18ngrep ambiguous error
+ test_grep ambiguous error
'
test_expect_success '"git log :/a -- " should not be ambiguous' '
@@ -65,7 +65,7 @@ test_expect_success '"git log :/in" should not be ambiguous' '
test_expect_success '"git log :" should be ambiguous' '
test_must_fail git log : 2>error &&
- test_i18ngrep ambiguous error
+ test_grep ambiguous error
'
test_expect_success 'git log -- :' '
@@ -104,7 +104,7 @@ test_expect_success '"git log :(exclude)sub --" must resolve as an object' '
test_expect_success '"git log :(unknown-magic) complains of bogus magic' '
test_must_fail git log ":(unknown-magic)" 2>error &&
- test_i18ngrep pathspec.magic error
+ test_grep pathspec.magic error
'
test_expect_success 'command line pathspec parsing for "git log"' '
@@ -124,6 +124,7 @@ test_expect_success 'command line pathspec parsing for "git log"' '
test_expect_success 'tree_entry_interesting does not match past submodule boundaries' '
test_when_finished "rm -rf repo submodule" &&
+ test_config_global protocol.file.allow always &&
git init submodule &&
test_commit -C submodule initial &&
git init repo &&
diff --git a/t/t4209-log-pickaxe.sh b/t/t4209-log-pickaxe.sh
index 7f6bb27..64e1623 100755
--- a/t/t4209-log-pickaxe.sh
+++ b/t/t4209-log-pickaxe.sh
@@ -57,10 +57,10 @@ test_expect_success setup '
test_expect_success 'usage' '
test_expect_code 129 git log -S 2>err &&
- test_i18ngrep "switch.*requires a value" err &&
+ test_grep "switch.*requires a value" err &&
test_expect_code 129 git log -G 2>err &&
- test_i18ngrep "switch.*requires a value" err &&
+ test_grep "switch.*requires a value" err &&
test_expect_code 128 git log -Gregex -Sstring 2>err &&
grep "cannot be used together" err &&
diff --git a/t/t4210-log-i18n.sh b/t/t4210-log-i18n.sh
index d2dfcf1..75216f1 100755
--- a/t/t4210-log-i18n.sh
+++ b/t/t4210-log-i18n.sh
@@ -64,7 +64,7 @@ test_expect_success 'log --grep does not find non-reencoded values (latin1)' '
'
triggers_undefined_behaviour () {
- local engine=$1
+ local engine="$1"
case $engine in
fixed)
@@ -85,7 +85,7 @@ triggers_undefined_behaviour () {
}
mismatched_git_log () {
- local pattern=$1
+ local pattern="$1"
LC_ALL=$is_IS_locale git log --encoding=ISO-8859-1 --format=%s \
--grep=$pattern
diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh
index ac9e4d0..02d76dc 100755
--- a/t/t4211-line-log.sh
+++ b/t/t4211-line-log.sh
@@ -19,7 +19,7 @@ test_expect_success 'basic command line parsing' '
# -L requires there is no pathspec
test_must_fail git log -L1,1:b.c -- b.c 2>error &&
- test_i18ngrep "cannot be used with pathspec" error &&
+ test_grep "cannot be used with pathspec" error &&
# This would fail because --follow wants a single path, but
# we may fail due to incompatibility between -L/--follow in
@@ -50,7 +50,7 @@ canned_test_failure () {
test_bad_opts () {
test_expect_success "invalid args: $1" "
test_must_fail git log $1 2>errors &&
- test_i18ngrep '$2' errors
+ test_grep '$2' errors
"
}
@@ -315,4 +315,26 @@ test_expect_success 'line-log with --before' '
test_cmp expect actual
'
+test_expect_success 'setup tests for zero-width regular expressions' '
+ cat >expect <<-EOF
+ Modify func1() in file.c
+ Add func1() and func2() in file.c
+ EOF
+'
+
+test_expect_success 'zero-width regex $ matches any function name' '
+ git log --format="%s" --no-patch "-L:$:file.c" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'zero-width regex ^ matches any function name' '
+ git log --format="%s" --no-patch "-L:^:file.c" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'zero-width regex .* matches any function name' '
+ git log --format="%s" --no-patch "-L:.*:file.c" >actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t4212-log-corrupt.sh b/t/t4212-log-corrupt.sh
index 30a2198..e6b5912 100755
--- a/t/t4212-log-corrupt.sh
+++ b/t/t4212-log-corrupt.sh
@@ -8,15 +8,16 @@ TEST_PASSES_SANITIZE_LEAK=true
test_expect_success 'setup' '
test_commit foo &&
- git cat-file commit HEAD |
- sed "/^author /s/>/>-<>/" >broken_email.commit &&
- git hash-object -w -t commit broken_email.commit >broken_email.hash &&
+ git cat-file commit HEAD >ok.commit &&
+ sed "s/>/>-<>/" <ok.commit >broken_email.commit &&
+
+ git hash-object --literally -w -t commit broken_email.commit >broken_email.hash &&
git update-ref refs/heads/broken_email $(cat broken_email.hash)
'
test_expect_success 'fsck notices broken commit' '
test_must_fail git fsck 2>actual &&
- test_i18ngrep invalid.author actual
+ test_grep invalid.author actual
'
test_expect_success 'git log with broken author email' '
@@ -43,10 +44,15 @@ test_expect_success 'git log --format with broken author email' '
test_must_be_empty actual.err
'
+test_expect_success '--until handles broken email' '
+ git rev-list --until=1980-01-01 broken_email >actual &&
+ test_must_be_empty actual
+'
+
munge_author_date () {
git cat-file commit "$1" >commit.orig &&
sed "s/^\(author .*>\) [0-9]*/\1 $2/" <commit.orig >commit.munge &&
- git hash-object -w -t commit commit.munge
+ git hash-object --literally -w -t commit commit.munge
}
test_expect_success 'unparsable dates produce sentinel value' '
@@ -86,4 +92,45 @@ test_expect_success 'absurdly far-in-future date' '
git log -1 --format=%ad $commit
'
+test_expect_success 'create commits with whitespace committer dates' '
+ # It is important that this subject line is numeric, since we want to
+ # be sure we are not confused by skipping whitespace and accidentally
+ # parsing the subject as a timestamp.
+ #
+ # Do not use munge_author_date here. Besides not hitting the committer
+ # line, it leaves the timezone intact, and we want nothing but
+ # whitespace.
+ #
+ # We will make two munged commits here. The first, ws_commit, will
+ # be purely spaces. The second contains a vertical tab, which is
+ # considered a space by strtoumax(), but not by our isspace().
+ test_commit 1234567890 &&
+ git cat-file commit HEAD >commit.orig &&
+ sed "s/>.*/> /" <commit.orig >commit.munge &&
+ ws_commit=$(git hash-object --literally -w -t commit commit.munge) &&
+ sed "s/>.*/> $(printf "\013")/" <commit.orig >commit.munge &&
+ vt_commit=$(git hash-object --literally -w -t commit commit.munge)
+'
+
+test_expect_success '--until treats whitespace date as sentinel' '
+ echo $ws_commit >expect &&
+ git rev-list --until=1980-01-01 $ws_commit >actual &&
+ test_cmp expect actual &&
+
+ echo $vt_commit >expect &&
+ git rev-list --until=1980-01-01 $vt_commit >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'pretty-printer handles whitespace date' '
+ # as with the %ad test above, we will show these as the empty string,
+ # not the 1970 epoch date. This is intentional; see 7d9a281941 (t4212:
+ # test bogus timestamps with git-log, 2014-02-24) for more discussion.
+ echo : >expect &&
+ git log -1 --format="%at:%ct" $ws_commit >actual &&
+ test_cmp expect actual &&
+ git log -1 --format="%at:%ct" $vt_commit >actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t4213-log-tabexpand.sh b/t/t4213-log-tabexpand.sh
index 53a4af3..590fce9 100755
--- a/t/t4213-log-tabexpand.sh
+++ b/t/t4213-log-tabexpand.sh
@@ -2,6 +2,7 @@
test_description='log/show --expand-tabs'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
HT=" "
diff --git a/t/t4214-log-graph-octopus.sh b/t/t4214-log-graph-octopus.sh
index f70c46b..7905597 100755
--- a/t/t4214-log-graph-octopus.sh
+++ b/t/t4214-log-graph-octopus.sh
@@ -5,6 +5,7 @@ test_description='git log --graph of skewed left octopus merge.'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-log-graph.sh
diff --git a/t/t4215-log-skewed-merges.sh b/t/t4215-log-skewed-merges.sh
index 28d0779..b877ac7 100755
--- a/t/t4215-log-skewed-merges.sh
+++ b/t/t4215-log-skewed-merges.sh
@@ -2,6 +2,7 @@
test_description='git log --graph of skewed merges'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-log-graph.sh
diff --git a/t/t4216-log-bloom.sh b/t/t4216-log-bloom.sh
index fa9d32f..2ba0324 100755
--- a/t/t4216-log-bloom.sh
+++ b/t/t4216-log-bloom.sh
@@ -5,6 +5,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-chunk.sh
GIT_TEST_COMMIT_GRAPH=0
GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=0
@@ -404,4 +405,53 @@ test_expect_success 'Bloom generation backfills empty commits' '
)
'
+corrupt_graph () {
+ graph=.git/objects/info/commit-graph &&
+ test_when_finished "rm -rf $graph" &&
+ git commit-graph write --reachable --changed-paths &&
+ corrupt_chunk_file $graph "$@"
+}
+
+check_corrupt_graph () {
+ corrupt_graph "$@" &&
+ git -c core.commitGraph=false log -- A/B/file2 >expect.out &&
+ git -c core.commitGraph=true log -- A/B/file2 >out 2>err &&
+ test_cmp expect.out out
+}
+
+test_expect_success 'Bloom reader notices too-small data chunk' '
+ check_corrupt_graph BDAT clear 00000000 &&
+ echo "warning: ignoring too-small changed-path chunk" \
+ "(4 < 12) in commit-graph file" >expect.err &&
+ test_cmp expect.err err
+'
+
+test_expect_success 'Bloom reader notices out-of-bounds filter offsets' '
+ check_corrupt_graph BIDX 12 FFFFFFFF &&
+ # use grep to avoid depending on exact chunk size
+ grep "warning: ignoring out-of-range offset (4294967295) for changed-path filter at pos 3 of .git/objects/info/commit-graph" err
+'
+
+test_expect_success 'Bloom reader notices too-small index chunk' '
+ # replace the index with a single entry, making most
+ # lookups out-of-bounds
+ check_corrupt_graph BIDX clear 00000000 &&
+ echo "warning: commit-graph changed-path index chunk" \
+ "is too small" >expect.err &&
+ test_cmp expect.err err
+'
+
+test_expect_success 'Bloom reader notices out-of-order index offsets' '
+ # we do not know any real offsets, but we can pick
+ # something plausible; we should not get to the point of
+ # actually reading from the bogus offsets anyway.
+ corrupt_graph BIDX 4 0000000c00000005 &&
+ echo "warning: ignoring decreasing changed-path index offsets" \
+ "(12 > 5) for positions 1 and 2 of .git/objects/info/commit-graph" >expect.err &&
+ git -c core.commitGraph=false log -- A/B/file2 >expect.out &&
+ git -c core.commitGraph=true log -- A/B/file2 >out 2>err &&
+ test_cmp expect.out out &&
+ test_cmp expect.err err
+'
+
test_done
diff --git a/t/t4217-log-limit.sh b/t/t4217-log-limit.sh
index 6e01e26..613f071 100755
--- a/t/t4217-log-limit.sh
+++ b/t/t4217-log-limit.sh
@@ -2,6 +2,7 @@
test_description='git log with filter options limiting the output'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup test' '
diff --git a/t/t4254-am-corrupt.sh b/t/t4254-am-corrupt.sh
index 54be7da..661feb6 100755
--- a/t/t4254-am-corrupt.sh
+++ b/t/t4254-am-corrupt.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='git am with corrupt input'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
make_mbox_with_nul () {
@@ -57,7 +59,7 @@ test_expect_success setup '
# Also, it had the unwanted side-effect of deleting f.
test_expect_success 'try to apply corrupted patch' '
test_when_finished "git am --abort" &&
- test_must_fail git -c advice.amWorkDir=false am bad-patch.diff 2>actual &&
+ test_must_fail git -c advice.amWorkDir=false -c advice.mergeConflict=false am bad-patch.diff 2>actual &&
echo "error: git diff header lacks filename information (line 4)" >expected &&
test_path_is_file f &&
test_cmp expected actual
diff --git a/t/t4256-am-format-flowed.sh b/t/t4256-am-format-flowed.sh
index 2369c4e..92d8c8b 100755
--- a/t/t4256-am-format-flowed.sh
+++ b/t/t4256-am-format-flowed.sh
@@ -2,6 +2,7 @@
test_description='test format=flowed support of git am'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -12,7 +13,7 @@ test_expect_success 'setup' '
test_expect_success 'am with format=flowed' '
git am <"$TEST_DIRECTORY/t4256/1/patch" 2>stderr &&
- test_i18ngrep "warning: Patch sent with format=flowed" stderr &&
+ test_grep "warning: Patch sent with format=flowed" stderr &&
test_cmp "$TEST_DIRECTORY/t4256/1/mailinfo.c" mailinfo.c
'
diff --git a/t/t4257-am-interactive.sh b/t/t4257-am-interactive.sh
index aed8f4d..f26d7fd 100755
--- a/t/t4257-am-interactive.sh
+++ b/t/t4257-am-interactive.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='am --interactive tests'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'set up patches to apply' '
diff --git a/t/t4258/mbox b/t/t4258/mbox
index c62819f..1ae528b 100644
--- a/t/t4258/mbox
+++ b/t/t4258/mbox
@@ -2,7 +2,7 @@ From: A U Thor <mail@example.com>
To: list@example.org
Subject: [PATCH v2] sample
Date: Mon, 3 Aug 2020 22:40:55 +0700
-Message-Id: <msg-id@example.com>
+Message-ID: <msg-id@example.com>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
diff --git a/t/t4300-merge-tree.sh b/t/t4300-merge-tree.sh
index c52c8a2..9c19726 100755
--- a/t/t4300-merge-tree.sh
+++ b/t/t4300-merge-tree.sh
@@ -86,6 +86,33 @@ EXPECTED
test_cmp expected actual
'
+test_expect_success '3-way merge with --attr-source' '
+ test_when_finished rm -rf 3-way &&
+ git init 3-way &&
+ (
+ cd 3-way &&
+ test_commit initial file1 foo &&
+ base=$(git rev-parse HEAD) &&
+ git checkout -b brancha &&
+ echo bar >>file1 &&
+ git commit -am "adding bar" &&
+ source=$(git rev-parse HEAD) &&
+ git checkout @{-1} &&
+ git checkout -b branchb &&
+ echo baz >>file1 &&
+ git commit -am "adding baz" &&
+ merge=$(git rev-parse HEAD) &&
+ git checkout -b gitattributes &&
+ test_commit "gitattributes" .gitattributes "file1 merge=union" &&
+ git checkout @{-1} &&
+ tree=$(git --attr-source=gitattributes merge-tree --write-tree \
+ --merge-base "$base" --end-of-options "$source" "$merge") &&
+ test_write_lines foo bar baz >expect &&
+ git cat-file -p "$tree:file1" >actual &&
+ test_cmp expect actual
+ )
+'
+
test_expect_success 'file change A, B (same)' '
git reset --hard initial &&
test_commit "change-a-b-same-A" "initial-file" "AAA" &&
@@ -334,4 +361,22 @@ test_expect_success 'turn tree to file' '
test_cmp expect actual
'
+test_expect_success 'merge-tree respects core.useReplaceRefs=false' '
+ test_commit merge-to &&
+ test_commit valid base &&
+ git reset --hard HEAD^ &&
+ test_commit malicious base &&
+
+ test_when_finished "git replace -d $(git rev-parse valid^0)" &&
+ git replace valid^0 malicious^0 &&
+
+ tree=$(git -c core.useReplaceRefs=true merge-tree --write-tree merge-to valid) &&
+ merged=$(git cat-file -p $tree:base) &&
+ test malicious = $merged &&
+
+ tree=$(git -c core.useReplaceRefs=false merge-tree --write-tree merge-to valid) &&
+ merged=$(git cat-file -p $tree:base) &&
+ test valid = $merged
+'
+
test_done
diff --git a/t/t4301-merge-tree-write-tree.sh b/t/t4301-merge-tree-write-tree.sh
new file mode 100755
index 0000000..eea1990
--- /dev/null
+++ b/t/t4301-merge-tree-write-tree.sh
@@ -0,0 +1,993 @@
+#!/bin/sh
+
+test_description='git merge-tree --write-tree'
+
+. ./test-lib.sh
+
+# This test is ort-specific
+if test "$GIT_TEST_MERGE_ALGORITHM" != "ort"
+then
+ skip_all="GIT_TEST_MERGE_ALGORITHM != ort"
+ test_done
+fi
+
+test_expect_success setup '
+ test_write_lines 1 2 3 4 5 >numbers &&
+ echo hello >greeting &&
+ echo foo >whatever &&
+ git add numbers greeting whatever &&
+ test_tick &&
+ git commit -m initial &&
+
+ git branch side1 &&
+ git branch side2 &&
+ git branch side3 &&
+ git branch side4 &&
+
+ git checkout side1 &&
+ test_write_lines 1 2 3 4 5 6 >numbers &&
+ echo hi >greeting &&
+ echo bar >whatever &&
+ git add numbers greeting whatever &&
+ test_tick &&
+ git commit -m modify-stuff &&
+
+ git checkout side2 &&
+ test_write_lines 0 1 2 3 4 5 >numbers &&
+ echo yo >greeting &&
+ git rm whatever &&
+ mkdir whatever &&
+ >whatever/empty &&
+ git add numbers greeting whatever/empty &&
+ test_tick &&
+ git commit -m other-modifications &&
+
+ git checkout side3 &&
+ git mv numbers sequence &&
+ test_tick &&
+ git commit -m rename-numbers &&
+
+ git checkout side4 &&
+ test_write_lines 0 1 2 3 4 5 >numbers &&
+ echo yo >greeting &&
+ git add numbers greeting &&
+ test_tick &&
+ git commit -m other-content-modifications &&
+
+ git switch --orphan unrelated &&
+ >something-else &&
+ git add something-else &&
+ test_tick &&
+ git commit -m first-commit
+'
+
+test_expect_success 'Clean merge' '
+ TREE_OID=$(git merge-tree --write-tree side1 side3) &&
+ q_to_tab <<-EOF >expect &&
+ 100644 blob $(git rev-parse side1:greeting)Qgreeting
+ 100644 blob $(git rev-parse side1:numbers)Qsequence
+ 100644 blob $(git rev-parse side1:whatever)Qwhatever
+ EOF
+
+ git ls-tree $TREE_OID >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'Content merge and a few conflicts' '
+ git checkout side1^0 &&
+ test_must_fail git merge side2 &&
+ expected_tree=$(git rev-parse AUTO_MERGE) &&
+
+ # We will redo the merge, while we are still in a conflicted state!
+ git ls-files -u >conflicted-file-info &&
+ test_when_finished "git reset --hard" &&
+
+ test_expect_code 1 git merge-tree --write-tree side1 side2 >RESULT &&
+ actual_tree=$(head -n 1 RESULT) &&
+
+ # Due to differences of e.g. "HEAD" vs "side1", the results will not
+ # exactly match. Dig into individual files.
+
+ # Numbers should have three-way merged cleanly
+ test_write_lines 0 1 2 3 4 5 6 >expect &&
+ git show ${actual_tree}:numbers >actual &&
+ test_cmp expect actual &&
+
+ # whatever and whatever~<branch> should have same HASHES
+ git rev-parse ${expected_tree}:whatever ${expected_tree}:whatever~HEAD >expect &&
+ git rev-parse ${actual_tree}:whatever ${actual_tree}:whatever~side1 >actual &&
+ test_cmp expect actual &&
+
+ # greeting should have a merge conflict
+ git show ${expected_tree}:greeting >tmp &&
+ sed -e s/HEAD/side1/ tmp >expect &&
+ git show ${actual_tree}:greeting >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'Auto resolve conflicts by "ours" strategy option' '
+ git checkout side1^0 &&
+
+ # make sure merge conflict exists
+ test_must_fail git merge side4 &&
+ git merge --abort &&
+
+ git merge -X ours side4 &&
+ git rev-parse HEAD^{tree} >expected &&
+
+ git merge-tree -X ours side1 side4 >actual &&
+
+ test_cmp expected actual
+'
+
+test_expect_success 'Barf on misspelled option, with exit code other than 0 or 1' '
+ # Mis-spell with single "s" instead of double "s"
+ test_expect_code 129 git merge-tree --write-tree --mesages FOOBAR side1 side2 2>expect &&
+
+ grep "error: unknown option.*mesages" expect
+'
+
+test_expect_success 'Barf on too many arguments' '
+ test_expect_code 129 git merge-tree --write-tree side1 side2 invalid 2>expect &&
+
+ grep "^usage: git merge-tree" expect
+'
+
+anonymize_hash() {
+ sed -e "s/[0-9a-f]\{40,\}/HASH/g" "$@"
+}
+
+test_expect_success 'test conflict notices and such' '
+ test_expect_code 1 git merge-tree --write-tree --name-only side1 side2 >out &&
+ anonymize_hash out >actual &&
+
+ # Expected results:
+ # "greeting" should merge with conflicts
+ # "numbers" should merge cleanly
+ # "whatever" has *both* a modify/delete and a file/directory conflict
+ cat <<-EOF >expect &&
+ HASH
+ greeting
+ whatever~side1
+
+ Auto-merging greeting
+ CONFLICT (content): Merge conflict in greeting
+ Auto-merging numbers
+ CONFLICT (file/directory): directory in the way of whatever from side1; moving it to whatever~side1 instead.
+ CONFLICT (modify/delete): whatever~side1 deleted in side2 and modified in side1. Version side1 of whatever~side1 left in tree.
+ EOF
+
+ test_cmp expect actual
+'
+
+# directory rename + content conflict
+# Commit O: foo, olddir/{a,b,c}
+# Commit A: modify foo, newdir/{a,b,c}
+# Commit B: modify foo differently & rename foo -> olddir/bar
+# Expected: CONFLICT(content) for newdir/bar (not olddir/bar or foo)
+
+test_expect_success 'directory rename + content conflict' '
+ # Setup
+ git init dir-rename-and-content &&
+ (
+ cd dir-rename-and-content &&
+ test_write_lines 1 2 3 4 5 >foo &&
+ mkdir olddir &&
+ for i in a b c; do echo $i >olddir/$i || exit 1; done &&
+ git add foo olddir &&
+ git commit -m "original" &&
+
+ git branch O &&
+ git branch A &&
+ git branch B &&
+
+ git checkout A &&
+ test_write_lines 1 2 3 4 5 6 >foo &&
+ git add foo &&
+ git mv olddir newdir &&
+ git commit -m "Modify foo, rename olddir to newdir" &&
+
+ git checkout B &&
+ test_write_lines 1 2 3 4 5 six >foo &&
+ git add foo &&
+ git mv foo olddir/bar &&
+ git commit -m "Modify foo & rename foo -> olddir/bar"
+ ) &&
+ # Testing
+ (
+ cd dir-rename-and-content &&
+
+ test_expect_code 1 \
+ git merge-tree -z A^0 B^0 >out &&
+ echo >>out &&
+ anonymize_hash out >actual &&
+ q_to_tab <<-\EOF | lf_to_nul >expect &&
+ HASH
+ 100644 HASH 1Qnewdir/bar
+ 100644 HASH 2Qnewdir/bar
+ 100644 HASH 3Qnewdir/bar
+ EOF
+
+ q_to_nul <<-EOF >>expect &&
+ Q2Qnewdir/barQolddir/barQCONFLICT (directory rename suggested)QCONFLICT (file location): foo renamed to olddir/bar in B^0, inside a directory that was renamed in A^0, suggesting it should perhaps be moved to newdir/bar.
+ Q1Qnewdir/barQAuto-mergingQAuto-merging newdir/bar
+ Q1Qnewdir/barQCONFLICT (contents)QCONFLICT (content): Merge conflict in newdir/bar
+ Q
+ EOF
+ test_cmp expect actual
+ )
+'
+
+# rename/delete + modify/delete handling
+# Commit O: foo
+# Commit A: modify foo + rename to bar
+# Commit B: delete foo
+# Expected: CONFLICT(rename/delete) + CONFLICT(modify/delete)
+
+test_expect_success 'rename/delete handling' '
+ # Setup
+ git init rename-delete &&
+ (
+ cd rename-delete &&
+ test_write_lines 1 2 3 4 5 >foo &&
+ git add foo &&
+ git commit -m "original" &&
+
+ git branch O &&
+ git branch A &&
+ git branch B &&
+
+ git checkout A &&
+ test_write_lines 1 2 3 4 5 6 >foo &&
+ git add foo &&
+ git mv foo bar &&
+ git commit -m "Modify foo, rename to bar" &&
+
+ git checkout B &&
+ git rm foo &&
+ git commit -m "remove foo"
+ ) &&
+ # Testing
+ (
+ cd rename-delete &&
+
+ test_expect_code 1 \
+ git merge-tree -z A^0 B^0 >out &&
+ echo >>out &&
+ anonymize_hash out >actual &&
+ q_to_tab <<-\EOF | lf_to_nul >expect &&
+ HASH
+ 100644 HASH 1Qbar
+ 100644 HASH 2Qbar
+ EOF
+
+ q_to_nul <<-EOF >>expect &&
+ Q2QbarQfooQCONFLICT (rename/delete)QCONFLICT (rename/delete): foo renamed to bar in A^0, but deleted in B^0.
+ Q1QbarQCONFLICT (modify/delete)QCONFLICT (modify/delete): bar deleted in B^0 and modified in A^0. Version A^0 of bar left in tree.
+ Q
+ EOF
+ test_cmp expect actual
+ )
+'
+
+# rename/add handling
+# Commit O: foo
+# Commit A: modify foo, add different bar
+# Commit B: modify & rename foo->bar
+# Expected: CONFLICT(add/add) [via rename collide] for bar
+
+test_expect_success 'rename/add handling' '
+ # Setup
+ git init rename-add &&
+ (
+ cd rename-add &&
+ test_write_lines original 1 2 3 4 5 >foo &&
+ git add foo &&
+ git commit -m "original" &&
+
+ git branch O &&
+ git branch A &&
+ git branch B &&
+
+ git checkout A &&
+ test_write_lines 1 2 3 4 5 >foo &&
+ echo "different file" >bar &&
+ git add foo bar &&
+ git commit -m "Modify foo, add bar" &&
+
+ git checkout B &&
+ test_write_lines original 1 2 3 4 5 6 >foo &&
+ git add foo &&
+ git mv foo bar &&
+ git commit -m "rename foo to bar"
+ ) &&
+ # Testing
+ (
+ cd rename-add &&
+
+ test_expect_code 1 \
+ git merge-tree -z A^0 B^0 >out &&
+ echo >>out &&
+
+ #
+ # First, check that the bar that appears at stage 3 does not
+ # correspond to an individual blob anywhere in history
+ #
+ hash=$(tr "\0" "\n" <out | head -n 3 | grep 3.bar | cut -f 2 -d " ") &&
+ git rev-list --objects --all >all_blobs &&
+ ! grep $hash all_blobs &&
+
+ #
+ # Second, check anonymized hash output against expectation
+ #
+ anonymize_hash out >actual &&
+ q_to_tab <<-\EOF | lf_to_nul >expect &&
+ HASH
+ 100644 HASH 2Qbar
+ 100644 HASH 3Qbar
+ EOF
+
+ q_to_nul <<-EOF >>expect &&
+ Q1QbarQAuto-mergingQAuto-merging bar
+ Q1QbarQCONFLICT (contents)QCONFLICT (add/add): Merge conflict in bar
+ Q1QfooQAuto-mergingQAuto-merging foo
+ Q
+ EOF
+ test_cmp expect actual
+ )
+'
+
+# rename/add, where add is a mode conflict
+# Commit O: foo
+# Commit A: modify foo, add symlink bar
+# Commit B: modify & rename foo->bar
+# Expected: CONFLICT(distinct modes) for bar
+
+test_expect_success SYMLINKS 'rename/add, where add is a mode conflict' '
+ # Setup
+ git init rename-add-symlink &&
+ (
+ cd rename-add-symlink &&
+ test_write_lines original 1 2 3 4 5 >foo &&
+ git add foo &&
+ git commit -m "original" &&
+
+ git branch O &&
+ git branch A &&
+ git branch B &&
+
+ git checkout A &&
+ test_write_lines 1 2 3 4 5 >foo &&
+ ln -s foo bar &&
+ git add foo bar &&
+ git commit -m "Modify foo, add symlink bar" &&
+
+ git checkout B &&
+ test_write_lines original 1 2 3 4 5 6 >foo &&
+ git add foo &&
+ git mv foo bar &&
+ git commit -m "rename foo to bar"
+ ) &&
+ # Testing
+ (
+ cd rename-add-symlink &&
+
+ test_expect_code 1 \
+ git merge-tree -z A^0 B^0 >out &&
+ echo >>out &&
+
+ #
+ # First, check that the bar that appears at stage 3 does not
+ # correspond to an individual blob anywhere in history
+ #
+ hash=$(tr "\0" "\n" <out | head -n 3 | grep 3.bar | cut -f 2 -d " ") &&
+ git rev-list --objects --all >all_blobs &&
+ ! grep $hash all_blobs &&
+
+ #
+ # Second, check anonymized hash output against expectation
+ #
+ anonymize_hash out >actual &&
+ q_to_tab <<-\EOF | lf_to_nul >expect &&
+ HASH
+ 120000 HASH 2Qbar
+ 100644 HASH 3Qbar~B^0
+ EOF
+
+ q_to_nul <<-EOF >>expect &&
+ Q2QbarQbar~B^0QCONFLICT (distinct modes)QCONFLICT (distinct types): bar had different types on each side; renamed one of them so each can be recorded somewhere.
+ Q1QfooQAuto-mergingQAuto-merging foo
+ Q
+ EOF
+ test_cmp expect actual
+ )
+'
+
+# rename/rename(1to2) + content conflict handling
+# Commit O: foo
+# Commit A: modify foo & rename to bar
+# Commit B: modify foo & rename to baz
+# Expected: CONFLICT(rename/rename)
+
+test_expect_success 'rename/rename + content conflict' '
+ # Setup
+ git init rr-plus-content &&
+ (
+ cd rr-plus-content &&
+ test_write_lines 1 2 3 4 5 >foo &&
+ git add foo &&
+ git commit -m "original" &&
+
+ git branch O &&
+ git branch A &&
+ git branch B &&
+
+ git checkout A &&
+ test_write_lines 1 2 3 4 5 six >foo &&
+ git add foo &&
+ git mv foo bar &&
+ git commit -m "Modify foo + rename to bar" &&
+
+ git checkout B &&
+ test_write_lines 1 2 3 4 5 6 >foo &&
+ git add foo &&
+ git mv foo baz &&
+ git commit -m "Modify foo + rename to baz"
+ ) &&
+ # Testing
+ (
+ cd rr-plus-content &&
+
+ test_expect_code 1 \
+ git merge-tree -z A^0 B^0 >out &&
+ echo >>out &&
+ anonymize_hash out >actual &&
+ q_to_tab <<-\EOF | lf_to_nul >expect &&
+ HASH
+ 100644 HASH 2Qbar
+ 100644 HASH 3Qbaz
+ 100644 HASH 1Qfoo
+ EOF
+
+ q_to_nul <<-EOF >>expect &&
+ Q1QfooQAuto-mergingQAuto-merging foo
+ Q3QfooQbarQbazQCONFLICT (rename/rename)QCONFLICT (rename/rename): foo renamed to bar in A^0 and to baz in B^0.
+ Q
+ EOF
+ test_cmp expect actual
+ )
+'
+
+# rename/add/delete
+# Commit O: foo
+# Commit A: rm foo, add different bar
+# Commit B: rename foo->bar
+# Expected: CONFLICT (rename/delete), CONFLICT(add/add) [via rename collide]
+# for bar
+
+test_expect_success 'rename/add/delete conflict' '
+ # Setup
+ git init rad &&
+ (
+ cd rad &&
+ echo "original file" >foo &&
+ git add foo &&
+ git commit -m "original" &&
+
+ git branch O &&
+ git branch A &&
+ git branch B &&
+
+ git checkout A &&
+ git rm foo &&
+ echo "different file" >bar &&
+ git add bar &&
+ git commit -m "Remove foo, add bar" &&
+
+ git checkout B &&
+ git mv foo bar &&
+ git commit -m "rename foo to bar"
+ ) &&
+ # Testing
+ (
+ cd rad &&
+
+ test_expect_code 1 \
+ git merge-tree -z B^0 A^0 >out &&
+ echo >>out &&
+ anonymize_hash out >actual &&
+
+ q_to_tab <<-\EOF | lf_to_nul >expect &&
+ HASH
+ 100644 HASH 2Qbar
+ 100644 HASH 3Qbar
+
+ EOF
+
+ q_to_nul <<-EOF >>expect &&
+ 2QbarQfooQCONFLICT (rename/delete)QCONFLICT (rename/delete): foo renamed to bar in B^0, but deleted in A^0.
+ Q1QbarQAuto-mergingQAuto-merging bar
+ Q1QbarQCONFLICT (contents)QCONFLICT (add/add): Merge conflict in bar
+ Q
+ EOF
+ test_cmp expect actual
+ )
+'
+
+# rename/rename(2to1)/delete/delete
+# Commit O: foo, bar
+# Commit A: rename foo->baz, rm bar
+# Commit B: rename bar->baz, rm foo
+# Expected: 2x CONFLICT (rename/delete), CONFLICT (add/add) via colliding
+# renames for baz
+
+test_expect_success 'rename/rename(2to1)/delete/delete conflict' '
+ # Setup
+ git init rrdd &&
+ (
+ cd rrdd &&
+ echo foo >foo &&
+ echo bar >bar &&
+ git add foo bar &&
+ git commit -m O &&
+
+ git branch O &&
+ git branch A &&
+ git branch B &&
+
+ git checkout A &&
+ git mv foo baz &&
+ git rm bar &&
+ git commit -m "Rename foo, remove bar" &&
+
+ git checkout B &&
+ git mv bar baz &&
+ git rm foo &&
+ git commit -m "Rename bar, remove foo"
+ ) &&
+ # Testing
+ (
+ cd rrdd &&
+
+ test_expect_code 1 \
+ git merge-tree -z A^0 B^0 >out &&
+ echo >>out &&
+ anonymize_hash out >actual &&
+
+ q_to_tab <<-\EOF | lf_to_nul >expect &&
+ HASH
+ 100644 HASH 2Qbaz
+ 100644 HASH 3Qbaz
+
+ EOF
+
+ q_to_nul <<-EOF >>expect &&
+ 2QbazQbarQCONFLICT (rename/delete)QCONFLICT (rename/delete): bar renamed to baz in B^0, but deleted in A^0.
+ Q2QbazQfooQCONFLICT (rename/delete)QCONFLICT (rename/delete): foo renamed to baz in A^0, but deleted in B^0.
+ Q1QbazQAuto-mergingQAuto-merging baz
+ Q1QbazQCONFLICT (contents)QCONFLICT (add/add): Merge conflict in baz
+ Q
+ EOF
+ test_cmp expect actual
+ )
+'
+
+# mod6: chains of rename/rename(1to2) + add/add via colliding renames
+# Commit O: one, three, five
+# Commit A: one->two, three->four, five->six
+# Commit B: one->six, three->two, five->four
+# Expected: three CONFLICT(rename/rename) messages + three CONFLICT(add/add)
+# messages; each path in two of the multi-way merged contents
+# found in two, four, six
+
+test_expect_success 'mod6: chains of rename/rename(1to2) and add/add via colliding renames' '
+ # Setup
+ git init mod6 &&
+ (
+ cd mod6 &&
+ test_seq 11 19 >one &&
+ test_seq 31 39 >three &&
+ test_seq 51 59 >five &&
+ git add . &&
+ test_tick &&
+ git commit -m "O" &&
+
+ git branch O &&
+ git branch A &&
+ git branch B &&
+
+ git checkout A &&
+ test_seq 10 19 >one &&
+ echo 40 >>three &&
+ git add one three &&
+ git mv one two &&
+ git mv three four &&
+ git mv five six &&
+ test_tick &&
+ git commit -m "A" &&
+
+ git checkout B &&
+ echo 20 >>one &&
+ echo forty >>three &&
+ echo 60 >>five &&
+ git add one three five &&
+ git mv one six &&
+ git mv three two &&
+ git mv five four &&
+ test_tick &&
+ git commit -m "B"
+ ) &&
+ # Testing
+ (
+ cd mod6 &&
+
+ test_expect_code 1 \
+ git merge-tree -z A^0 B^0 >out &&
+ echo >>out &&
+
+ #
+ # First, check that some of the hashes that appear as stage
+ # conflict entries do not appear as individual blobs anywhere
+ # in history.
+ #
+ hash1=$(tr "\0" "\n" <out | head | grep 2.four | cut -f 2 -d " ") &&
+ hash2=$(tr "\0" "\n" <out | head | grep 3.two | cut -f 2 -d " ") &&
+ git rev-list --objects --all >all_blobs &&
+ ! grep $hash1 all_blobs &&
+ ! grep $hash2 all_blobs &&
+
+ #
+ # Now compare anonymized hash output with expectation
+ #
+ anonymize_hash out >actual &&
+ q_to_tab <<-\EOF | lf_to_nul >expect &&
+ HASH
+ 100644 HASH 1Qfive
+ 100644 HASH 2Qfour
+ 100644 HASH 3Qfour
+ 100644 HASH 1Qone
+ 100644 HASH 2Qsix
+ 100644 HASH 3Qsix
+ 100644 HASH 1Qthree
+ 100644 HASH 2Qtwo
+ 100644 HASH 3Qtwo
+
+ EOF
+
+ q_to_nul <<-EOF >>expect &&
+ 3QfiveQsixQfourQCONFLICT (rename/rename)QCONFLICT (rename/rename): five renamed to six in A^0 and to four in B^0.
+ Q1QfourQAuto-mergingQAuto-merging four
+ Q1QfourQCONFLICT (contents)QCONFLICT (add/add): Merge conflict in four
+ Q1QoneQAuto-mergingQAuto-merging one
+ Q3QoneQtwoQsixQCONFLICT (rename/rename)QCONFLICT (rename/rename): one renamed to two in A^0 and to six in B^0.
+ Q1QsixQAuto-mergingQAuto-merging six
+ Q1QsixQCONFLICT (contents)QCONFLICT (add/add): Merge conflict in six
+ Q1QthreeQAuto-mergingQAuto-merging three
+ Q3QthreeQfourQtwoQCONFLICT (rename/rename)QCONFLICT (rename/rename): three renamed to four in A^0 and to two in B^0.
+ Q1QtwoQAuto-mergingQAuto-merging two
+ Q1QtwoQCONFLICT (contents)QCONFLICT (add/add): Merge conflict in two
+ Q
+ EOF
+ test_cmp expect actual
+ )
+'
+
+# directory rename + rename/delete + modify/delete + directory/file conflict
+# Commit O: foo, olddir/{a,b,c}
+# Commit A: delete foo, rename olddir/ -> newdir/, add newdir/bar/file
+# Commit B: modify foo & rename foo -> olddir/bar
+# Expected: CONFLICT(content) for newdir/bar (not olddir/bar or foo)
+
+test_expect_success 'directory rename + rename/delete + modify/delete + directory/file conflict' '
+ # Setup
+ git init 4-stacked-conflict &&
+ (
+ cd 4-stacked-conflict &&
+ test_write_lines 1 2 3 4 5 >foo &&
+ mkdir olddir &&
+ for i in a b c; do echo $i >olddir/$i || exit 1; done &&
+ git add foo olddir &&
+ git commit -m "original" &&
+
+ git branch O &&
+ git branch A &&
+ git branch B &&
+
+ git checkout A &&
+ git rm foo &&
+ git mv olddir newdir &&
+ mkdir newdir/bar &&
+ >newdir/bar/file &&
+ git add newdir/bar/file &&
+ git commit -m "rm foo, olddir/ -> newdir/, + newdir/bar/file" &&
+
+ git checkout B &&
+ test_write_lines 1 2 3 4 5 6 >foo &&
+ git add foo &&
+ git mv foo olddir/bar &&
+ git commit -m "Modify foo & rename foo -> olddir/bar"
+ ) &&
+ # Testing
+ (
+ cd 4-stacked-conflict &&
+
+ test_expect_code 1 \
+ git merge-tree -z A^0 B^0 >out &&
+ echo >>out &&
+ anonymize_hash out >actual &&
+
+ q_to_tab <<-\EOF | lf_to_nul >expect &&
+ HASH
+ 100644 HASH 1Qnewdir/bar~B^0
+ 100644 HASH 3Qnewdir/bar~B^0
+ EOF
+
+ q_to_nul <<-EOF >>expect &&
+ Q2Qnewdir/barQolddir/barQCONFLICT (directory rename suggested)QCONFLICT (file location): foo renamed to olddir/bar in B^0, inside a directory that was renamed in A^0, suggesting it should perhaps be moved to newdir/bar.
+ Q2Qnewdir/barQfooQCONFLICT (rename/delete)QCONFLICT (rename/delete): foo renamed to newdir/bar in B^0, but deleted in A^0.
+ Q2Qnewdir/bar~B^0Qnewdir/barQCONFLICT (file/directory)QCONFLICT (file/directory): directory in the way of newdir/bar from B^0; moving it to newdir/bar~B^0 instead.
+ Q1Qnewdir/bar~B^0QCONFLICT (modify/delete)QCONFLICT (modify/delete): newdir/bar~B^0 deleted in A^0 and modified in B^0. Version B^0 of newdir/bar~B^0 left in tree.
+ Q
+ EOF
+ test_cmp expect actual
+ )
+'
+
+for opt in $(git merge-tree --git-completion-helper-all)
+do
+ if test $opt = "--trivial-merge" || test $opt = "--write-tree"
+ then
+ continue
+ fi
+
+ test_expect_success "usage: --trivial-merge is incompatible with $opt" '
+ test_expect_code 128 git merge-tree --trivial-merge $opt side1 side2 side3
+ '
+done
+
+test_expect_success 'Just the conflicted files without the messages' '
+ test_expect_code 1 git merge-tree --write-tree --no-messages --name-only side1 side2 >out &&
+ anonymize_hash out >actual &&
+
+ test_write_lines HASH greeting whatever~side1 >expect &&
+
+ test_cmp expect actual
+'
+
+test_expect_success 'Check conflicted oids and modes without messages' '
+ test_expect_code 1 git merge-tree --write-tree --no-messages side1 side2 >out &&
+ anonymize_hash out >actual &&
+
+ # Compare the basic output format
+ q_to_tab >expect <<-\EOF &&
+ HASH
+ 100644 HASH 1Qgreeting
+ 100644 HASH 2Qgreeting
+ 100644 HASH 3Qgreeting
+ 100644 HASH 1Qwhatever~side1
+ 100644 HASH 2Qwhatever~side1
+ EOF
+
+ test_cmp expect actual &&
+
+ # Check the actual hashes against the `ls-files -u` output too
+ tail -n +2 out | sed -e s/side1/HEAD/ >actual &&
+ test_cmp conflicted-file-info actual
+'
+
+test_expect_success 'NUL terminated conflicted file "lines"' '
+ git checkout -b tweak1 side1 &&
+ test_write_lines zero 1 2 3 4 5 6 >numbers &&
+ git add numbers &&
+ git mv numbers "Αυτά μου φαίνονται κινέζικα" &&
+ git commit -m "Renamed numbers" &&
+
+ test_expect_code 1 git merge-tree --write-tree -z tweak1 side2 >out &&
+ echo >>out &&
+ anonymize_hash out >actual &&
+
+ # Expected results:
+ # "greeting" should merge with conflicts
+ # "whatever" has *both* a modify/delete and a file/directory conflict
+ # "Αυτά μου φαίνονται κινέζικα" should have a conflict
+ echo HASH | lf_to_nul >expect &&
+
+ q_to_tab <<-EOF | lf_to_nul >>expect &&
+ 100644 HASH 1Qgreeting
+ 100644 HASH 2Qgreeting
+ 100644 HASH 3Qgreeting
+ 100644 HASH 1Qwhatever~tweak1
+ 100644 HASH 2Qwhatever~tweak1
+ 100644 HASH 1QΑυτά μου φαίνονται κινέζικα
+ 100644 HASH 2QΑυτά μου φαίνονται κινέζικα
+ 100644 HASH 3QΑυτά μου φαίνονται κινέζικα
+
+ EOF
+
+ q_to_nul <<-EOF >>expect &&
+ 1QgreetingQAuto-mergingQAuto-merging greeting
+ Q1QgreetingQCONFLICT (contents)QCONFLICT (content): Merge conflict in greeting
+ Q2Qwhatever~tweak1QwhateverQCONFLICT (file/directory)QCONFLICT (file/directory): directory in the way of whatever from tweak1; moving it to whatever~tweak1 instead.
+ Q1Qwhatever~tweak1QCONFLICT (modify/delete)QCONFLICT (modify/delete): whatever~tweak1 deleted in side2 and modified in tweak1. Version tweak1 of whatever~tweak1 left in tree.
+ Q1QΑυτά μου φαίνονται κινέζικαQAuto-mergingQAuto-merging Αυτά μου φαίνονται κινέζικα
+ Q1QΑυτά μου φαίνονται κινέζικαQCONFLICT (contents)QCONFLICT (content): Merge conflict in Αυτά μου φαίνονται κινέζικα
+ Q
+ EOF
+
+ test_cmp expect actual
+'
+
+test_expect_success 'error out by default for unrelated histories' '
+ test_expect_code 128 git merge-tree --write-tree side1 unrelated 2>error &&
+
+ grep "refusing to merge unrelated histories" error
+'
+
+test_expect_success 'can override merge of unrelated histories' '
+ git merge-tree --write-tree --allow-unrelated-histories side1 unrelated >tree &&
+ TREE=$(cat tree) &&
+
+ git rev-parse side1:numbers side1:greeting side1:whatever unrelated:something-else >expect &&
+ git rev-parse $TREE:numbers $TREE:greeting $TREE:whatever $TREE:something-else >actual &&
+
+ test_cmp expect actual
+'
+
+test_expect_success SANITY 'merge-ort fails gracefully in a read-only repository' '
+ git init --bare read-only &&
+ git push read-only side1 side2 side3 &&
+ test_when_finished "chmod -R u+w read-only" &&
+ chmod -R a-w read-only &&
+ test_must_fail git -C read-only merge-tree side1 side3 &&
+ test_must_fail git -C read-only merge-tree side1 side2
+'
+
+test_expect_success '--stdin with both a successful and a conflicted merge' '
+ printf "side1 side3\nside1 side2" | git merge-tree --stdin >actual &&
+
+ git checkout side1^0 &&
+ git merge side3 &&
+
+ printf "1\0" >expect &&
+ git rev-parse HEAD^{tree} | lf_to_nul >>expect &&
+ printf "\0" >>expect &&
+
+ git checkout side1^0 &&
+ test_must_fail git merge side2 &&
+ sed s/HEAD/side1/ greeting >tmp &&
+ mv tmp greeting &&
+ git add -u &&
+ git mv whatever~HEAD whatever~side1 &&
+
+ printf "0\0" >>expect &&
+ git write-tree | lf_to_nul >>expect &&
+
+ cat <<-EOF | q_to_tab | lf_to_nul >>expect &&
+ 100644 $(git rev-parse side1~1:greeting) 1Qgreeting
+ 100644 $(git rev-parse side1:greeting) 2Qgreeting
+ 100644 $(git rev-parse side2:greeting) 3Qgreeting
+ 100644 $(git rev-parse side1~1:whatever) 1Qwhatever~side1
+ 100644 $(git rev-parse side1:whatever) 2Qwhatever~side1
+ EOF
+
+ q_to_nul <<-EOF >>expect &&
+ Q1QgreetingQAuto-mergingQAuto-merging greeting
+ Q1QgreetingQCONFLICT (contents)QCONFLICT (content): Merge conflict in greeting
+ Q1QnumbersQAuto-mergingQAuto-merging numbers
+ Q2Qwhatever~side1QwhateverQCONFLICT (file/directory)QCONFLICT (file/directory): directory in the way of whatever from side1; moving it to whatever~side1 instead.
+ Q1Qwhatever~side1QCONFLICT (modify/delete)QCONFLICT (modify/delete): whatever~side1 deleted in side2 and modified in side1. Version side1 of whatever~side1 left in tree.
+ EOF
+
+ printf "\0\0" >>expect &&
+
+ test_cmp expect actual
+'
+
+
+test_expect_success '--merge-base is incompatible with --stdin' '
+ test_must_fail git merge-tree --merge-base=side1 --stdin 2>expect &&
+
+ grep "^fatal: .*merge-base.*stdin.* cannot be used together" expect
+'
+
+# specify merge-base as parent of branch2
+# git merge-tree --write-tree --merge-base=c2 c1 c3
+# Commit c1: add file1
+# Commit c2: add file2 after c1
+# Commit c3: add file3 after c2
+# Expected: add file3, and file2 does NOT appear
+
+test_expect_success 'specify merge-base as parent of branch2' '
+ # Setup
+ test_when_finished "rm -rf base-b2-p" &&
+ git init base-b2-p &&
+ test_commit -C base-b2-p c1 file1 &&
+ test_commit -C base-b2-p c2 file2 &&
+ test_commit -C base-b2-p c3 file3 &&
+
+ # Testing
+ TREE_OID=$(git -C base-b2-p merge-tree --write-tree --merge-base=c2 c1 c3) &&
+
+ q_to_tab <<-EOF >expect &&
+ 100644 blob $(git -C base-b2-p rev-parse c1:file1)Qfile1
+ 100644 blob $(git -C base-b2-p rev-parse c3:file3)Qfile3
+ EOF
+
+ git -C base-b2-p ls-tree $TREE_OID >actual &&
+ test_cmp expect actual
+'
+
+# Since the earlier tests have verified that individual merge-tree calls
+# are doing the right thing, this test case is only used to verify that
+# we can also trigger merges via --stdin, and that when we do we get
+# the same answer as running a bunch of separate merges.
+
+test_expect_success 'check the input format when --stdin is passed' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_commit -C repo c1 &&
+ test_commit -C repo c2 &&
+ test_commit -C repo c3 &&
+ printf "c1 c3\nc2 -- c1 c3\nc2 c3" | git -C repo merge-tree --stdin >actual &&
+
+ printf "1\0" >expect &&
+ git -C repo merge-tree --write-tree -z c1 c3 >>expect &&
+ printf "\0" >>expect &&
+
+ printf "1\0" >>expect &&
+ git -C repo merge-tree --write-tree -z --merge-base=c2 c1 c3 >>expect &&
+ printf "\0" >>expect &&
+
+ printf "1\0" >>expect &&
+ git -C repo merge-tree --write-tree -z c2 c3 >>expect &&
+ printf "\0" >>expect &&
+
+ test_cmp expect actual
+'
+
+test_expect_success '--merge-base with tree OIDs' '
+ git merge-tree --merge-base=side1^ side1 side3 >with-commits &&
+ git merge-tree --merge-base=side1^^{tree} side1^{tree} side3^{tree} >with-trees &&
+ test_cmp with-commits with-trees
+'
+
+test_expect_success 'error out on missing tree objects' '
+ git init --bare missing-tree.git &&
+ git rev-list side3 >list &&
+ git rev-parse side3^: >>list &&
+ git pack-objects missing-tree.git/objects/pack/side3-tree-is-missing <list &&
+ side3=$(git rev-parse side3) &&
+ test_must_fail git --git-dir=missing-tree.git merge-tree $side3^ $side3 >actual 2>err &&
+ test_grep "Could not read $(git rev-parse $side3:)" err &&
+ test_must_be_empty actual
+'
+
+test_expect_success 'error out on missing blob objects' '
+ echo 1 | git hash-object -w --stdin >blob1 &&
+ echo 2 | git hash-object -w --stdin >blob2 &&
+ echo 3 | git hash-object -w --stdin >blob3 &&
+ printf "100644 blob $(cat blob1)\tblob\n" | git mktree >tree1 &&
+ printf "100644 blob $(cat blob2)\tblob\n" | git mktree >tree2 &&
+ printf "100644 blob $(cat blob3)\tblob\n" | git mktree >tree3 &&
+ git init --bare missing-blob.git &&
+ cat blob1 blob3 tree1 tree2 tree3 |
+ git pack-objects missing-blob.git/objects/pack/side1-whatever-is-missing &&
+ test_must_fail git --git-dir=missing-blob.git >actual 2>err \
+ merge-tree --merge-base=$(cat tree1) $(cat tree2) $(cat tree3) &&
+ test_grep "unable to read blob object $(cat blob2)" err &&
+ test_must_be_empty actual
+'
+
+test_expect_success 'error out on missing commits as well' '
+ git init --bare missing-commit.git &&
+ git rev-list --objects side1 side3 >list-including-initial &&
+ grep -v ^$(git rev-parse side1^) <list-including-initial >list &&
+ git pack-objects missing-commit.git/objects/pack/missing-initial <list &&
+ side1=$(git rev-parse side1) &&
+ side3=$(git rev-parse side3) &&
+ test_must_fail git --git-dir=missing-commit.git \
+ merge-tree --allow-unrelated-histories $side1 $side3 >actual &&
+ test_must_be_empty actual
+'
+
+test_done
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 7f8d2ab..72b8d0f 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -24,6 +24,7 @@ commit id embedding:
'
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
SUBSTFORMAT=%H%n
@@ -104,6 +105,18 @@ check_added() {
'
}
+check_mtime() {
+ dir=$1
+ path_in_archive=$2
+ mtime=$3
+
+ test_expect_success " validate mtime of $path_in_archive" '
+ test-tool chmtime --get $dir/$path_in_archive >actual.mtime &&
+ echo $mtime >expect.mtime &&
+ test_cmp expect.mtime actual.mtime
+ '
+}
+
test_expect_success 'setup' '
test_oid_cache <<-EOF
obj sha1:19f9c8273ec45a8938e6999cb59b3ff66739902a
@@ -111,6 +124,16 @@ test_expect_success 'setup' '
EOF
'
+test_expect_success '--list notices extra parameters' '
+ test_must_fail git archive --list blah &&
+ test_must_fail git archive --remote=. --list blah
+'
+
+test_expect_success 'end-of-options is correctly eaten' '
+ git archive --list --end-of-options &&
+ git archive --remote=. --list --end-of-options
+'
+
test_expect_success 'populate workdir' '
mkdir a &&
echo simple textfile >a/a &&
@@ -143,6 +166,7 @@ test_expect_success 'populate workdir' '
test_expect_success \
'add ignored file' \
'echo ignore me >a/ignored &&
+ mkdir .git/info &&
echo ignored export-ignore >.git/info/attributes'
test_expect_success 'add files to repository' '
@@ -157,7 +181,8 @@ test_expect_success 'setup export-subst' '
'
test_expect_success 'create bare clone' '
- git clone --bare . bare.git &&
+ git clone --template= --bare . bare.git &&
+ mkdir bare.git/info &&
cp .git/info/attributes bare.git/info/attributes
'
@@ -170,6 +195,14 @@ test_expect_success 'git archive' '
'
check_tar b
+check_mtime b a/a 1117231200
+
+test_expect_success 'git archive --mtime' '
+ git archive --mtime=2002-02-02T02:02:02-0200 HEAD >with_mtime.tar
+'
+
+check_tar with_mtime
+check_mtime with_mtime a/a 1012622522
test_expect_success 'git archive --prefix=prefix/' '
git archive --prefix=prefix/ HEAD >with_prefix.tar
@@ -235,14 +268,6 @@ test_expect_success 'git archive --remote with configured remote' '
test_cmp_bin b.tar b5-nick.tar
'
-test_expect_success 'validate file modification time' '
- mkdir extract &&
- "$TAR" xf b.tar -C extract a/a &&
- test-tool chmtime --get extract/a/a >b.mtime &&
- echo "1117231200" >expected.mtime &&
- test_cmp expected.mtime b.mtime
-'
-
test_expect_success 'git get-tar-commit-id' '
git get-tar-commit-id <b.tar >actual &&
git rev-parse HEAD >expect &&
@@ -339,21 +364,28 @@ test_expect_success 'only enabled filters are available remotely' '
test_cmp_bin remote.bar config.bar
'
-test_expect_success GZIP 'git archive --format=tgz' '
+test_expect_success 'invalid filter is reported only once' '
+ test_must_fail git -c tar.invalid.command= archive --format=invalid \
+ HEAD >out 2>err &&
+ test_must_be_empty out &&
+ test_line_count = 1 err
+'
+
+test_expect_success 'git archive --format=tgz' '
git archive --format=tgz HEAD >j.tgz
'
-test_expect_success GZIP 'git archive --format=tar.gz' '
+test_expect_success 'git archive --format=tar.gz' '
git archive --format=tar.gz HEAD >j1.tar.gz &&
test_cmp_bin j.tgz j1.tar.gz
'
-test_expect_success GZIP 'infer tgz from .tgz filename' '
+test_expect_success 'infer tgz from .tgz filename' '
git archive --output=j2.tgz HEAD &&
test_cmp_bin j.tgz j2.tgz
'
-test_expect_success GZIP 'infer tgz from .tar.gz filename' '
+test_expect_success 'infer tgz from .tar.gz filename' '
git archive --output=j3.tar.gz HEAD &&
test_cmp_bin j.tgz j3.tar.gz
'
@@ -363,24 +395,40 @@ test_expect_success GZIP 'extract tgz file' '
test_cmp_bin b.tar j.tar
'
-test_expect_success GZIP 'remote tar.gz is allowed by default' '
+test_expect_success 'remote tar.gz is allowed by default' '
git archive --remote=. --format=tar.gz HEAD >remote.tar.gz &&
test_cmp_bin j.tgz remote.tar.gz
'
-test_expect_success GZIP 'remote tar.gz can be disabled' '
+test_expect_success 'remote tar.gz can be disabled' '
git config tar.tar.gz.remote false &&
test_must_fail git archive --remote=. --format=tar.gz HEAD \
>remote.tar.gz
'
+test_expect_success GZIP 'git archive --format=tgz (external gzip)' '
+ test_config tar.tgz.command "gzip -cn" &&
+ git archive --format=tgz HEAD >external_gzip.tgz
+'
+
+test_expect_success GZIP 'git archive --format=tar.gz (external gzip)' '
+ test_config tar.tar.gz.command "gzip -cn" &&
+ git archive --format=tar.gz HEAD >external_gzip.tar.gz &&
+ test_cmp_bin external_gzip.tgz external_gzip.tar.gz
+'
+
+test_expect_success GZIP 'extract tgz file (external gzip)' '
+ gzip -d -c <external_gzip.tgz >external_gzip.tar &&
+ test_cmp_bin b.tar external_gzip.tar
+'
+
test_expect_success 'archive and :(glob)' '
git archive -v HEAD -- ":(glob)**/sh" >/dev/null 2>actual &&
- cat >expect <<EOF &&
-a/
-a/bin/
-a/bin/sh
-EOF
+ cat >expect <<-\EOF &&
+ a/
+ a/bin/
+ a/bin/sh
+ EOF
test_cmp expect actual
'
@@ -388,6 +436,19 @@ test_expect_success 'catch non-matching pathspec' '
test_must_fail git archive -v HEAD -- "*.abc" >/dev/null
'
+test_expect_success 'reject paths outside the current directory' '
+ test_must_fail git -C a/bin archive HEAD .. >/dev/null 2>err &&
+ grep "outside the current directory" err
+'
+
+test_expect_success 'allow pathspecs that resolve to the current directory' '
+ git -C a/bin archive -v HEAD ../bin >/dev/null 2>actual &&
+ cat >expect <<-\EOF &&
+ sh
+ EOF
+ test_cmp expect actual
+'
+
# Pull the size and date of each entry in a tarfile using the system tar.
#
# We'll pull out only the year from the date; that avoids any question of
diff --git a/t/t5001-archive-attr.sh b/t/t5001-archive-attr.sh
index 712ae52..eaf959d 100755
--- a/t/t5001-archive-attr.sh
+++ b/t/t5001-archive-attr.sh
@@ -2,6 +2,8 @@
test_description='git archive attribute tests'
+TEST_CREATE_REPO_NO_TEMPLATE=1
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
SUBSTFORMAT='%H (%h)%n'
@@ -20,6 +22,7 @@ extract_tar_to_dir () {
test_expect_success 'setup' '
echo ignored >ignored &&
+ mkdir .git/info &&
echo ignored export-ignore >>.git/info/attributes &&
git add ignored &&
@@ -30,6 +33,13 @@ test_expect_success 'setup' '
echo ignored-by-tree.d export-ignore >>.gitattributes &&
git add ignored-by-tree ignored-by-tree.d .gitattributes &&
+ mkdir subdir &&
+ >subdir/included &&
+ >subdir/ignored-by-subtree &&
+ >subdir/ignored-by-tree &&
+ echo ignored-by-subtree export-ignore >subdir/.gitattributes &&
+ git add subdir &&
+
echo ignored by worktree >ignored-by-worktree &&
echo ignored-by-worktree export-ignore >.gitattributes &&
git add ignored-by-worktree &&
@@ -46,7 +56,8 @@ test_expect_success 'setup' '
git commit -m. &&
- git clone --bare . bare &&
+ git clone --template= --bare . bare &&
+ mkdir bare/info &&
cp .git/info/attributes bare/info/attributes
'
@@ -89,6 +100,15 @@ test_expect_exists archive-pathspec-wildcard/ignored-by-worktree
test_expect_missing archive-pathspec-wildcard/excluded-by-pathspec.d
test_expect_missing archive-pathspec-wildcard/excluded-by-pathspec.d/file
+test_expect_success 'git -C subdir archive' '
+ git -C subdir archive HEAD >archive-subdir.tar &&
+ extract_tar_to_dir archive-subdir
+'
+
+test_expect_exists archive-subdir/included
+test_expect_missing archive-subdir/ignored-by-subtree
+test_expect_missing archive-subdir/ignored-by-tree
+
test_expect_success 'git archive with worktree attributes' '
git archive --worktree-attributes HEAD >worktree.tar &&
(mkdir worktree && cd worktree && "$TAR" xf -) <worktree.tar
@@ -118,7 +138,7 @@ test_expect_success 'git archive with worktree attributes, bare' '
'
test_expect_missing bare-worktree/ignored
-test_expect_exists bare-worktree/ignored-by-tree
+test_expect_missing bare-worktree/ignored-by-tree
test_expect_exists bare-worktree/ignored-by-worktree
test_expect_success 'export-subst' '
diff --git a/t/t5002-archive-attr-pattern.sh b/t/t5002-archive-attr-pattern.sh
index a66b5ba..78ab75f 100755
--- a/t/t5002-archive-attr-pattern.sh
+++ b/t/t5002-archive-attr-pattern.sh
@@ -3,6 +3,7 @@
test_description='git archive attribute pattern tests'
TEST_PASSES_SANITIZE_LEAK=true
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
test_expect_exists() {
@@ -15,6 +16,7 @@ test_expect_missing() {
test_expect_success 'setup' '
echo ignored >ignored &&
+ mkdir .git/info &&
echo ignored export-ignore >>.git/info/attributes &&
git add ignored &&
@@ -54,7 +56,8 @@ test_expect_success 'setup' '
git commit -m. &&
- git clone --bare . bare &&
+ git clone --template= --bare . bare &&
+ mkdir bare/info &&
cp .git/info/attributes bare/info/attributes
'
diff --git a/t/t5003-archive-zip.sh b/t/t5003-archive-zip.sh
index 3992d08..961c6aa 100755
--- a/t/t5003-archive-zip.sh
+++ b/t/t5003-archive-zip.sh
@@ -2,6 +2,7 @@
test_description='git archive --format=zip test'
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
SUBSTFORMAT=%H%n
@@ -121,6 +122,7 @@ test_expect_success 'prepare file list' '
test_expect_success \
'add ignored file' \
'echo ignore me >a/ignored &&
+ mkdir .git/info &&
echo ignored export-ignore >.git/info/attributes'
test_expect_success 'add files to repository' '
@@ -139,7 +141,8 @@ test_expect_success 'setup export-subst and diff attributes' '
'
test_expect_success 'create bare clone' '
- git clone --bare . bare.git &&
+ git clone --template= --bare . bare.git &&
+ mkdir bare.git/info &&
cp .git/info/attributes bare.git/info/attributes &&
# Recreate our changes to .git/config rather than just copying it, as
# we do not want to clobber core.bare or other settings.
@@ -236,4 +239,38 @@ check_zip with_untracked2
check_added with_untracked2 untracked one/untracked
check_added with_untracked2 untracked two/untracked
+# Test remote archive over HTTP protocol.
+#
+# Note: this should be the last part of this test suite, because
+# by including lib-httpd.sh, the test may end early if httpd tests
+# should not be run.
+#
+. "$TEST_DIRECTORY"/lib-httpd.sh
+start_httpd
+
+test_expect_success "setup for HTTP protocol" '
+ cp -R bare.git "$HTTPD_DOCUMENT_ROOT_PATH/bare.git" &&
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH/bare.git" \
+ config http.uploadpack true &&
+ set_askpass user@host pass@host
+'
+
+setup_askpass_helper
+
+test_expect_success 'remote archive does not work with protocol v1' '
+ test_must_fail git -c protocol.version=1 archive \
+ --remote="$HTTPD_URL/auth/smart/bare.git" \
+ --output=remote-http.zip HEAD >actual 2>&1 &&
+ cat >expect <<-EOF &&
+ fatal: can${SQ}t connect to subservice git-upload-archive
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'archive remote http repository' '
+ git archive --remote="$HTTPD_URL/auth/smart/bare.git" \
+ --output=remote-http.zip HEAD &&
+ test_cmp_bin d.zip remote-http.zip
+'
+
test_done
diff --git a/t/t5004-archive-corner-cases.sh b/t/t5004-archive-corner-cases.sh
index ae508e2..9f2c6da 100755
--- a/t/t5004-archive-corner-cases.sh
+++ b/t/t5004-archive-corner-cases.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='test corner cases of git-archive'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# the 10knuls.tar file is used to test for an empty git generated tar
diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh
index cebad10..c8d0655 100755
--- a/t/t5100-mailinfo.sh
+++ b/t/t5100-mailinfo.sh
@@ -70,7 +70,7 @@ test_expect_success 'respect NULs' '
git mailsplit -d3 -o. "$DATA/nul-plain" &&
test_cmp "$DATA/nul-plain" 001 &&
- (cat 001 | git mailinfo msg patch) &&
+ git mailinfo msg patch <001 &&
test_line_count = 4 patch
'
@@ -201,13 +201,13 @@ test_expect_success 'mailinfo -b double [PATCH]' '
test z"$subj" = z"Subject: message"
'
-test_expect_failure 'mailinfo -b trailing [PATCH]' '
+test_expect_success 'mailinfo -b trailing [PATCH]' '
subj="$(echo "Subject: [other] [PATCH] message" |
git mailinfo -b /dev/null /dev/null)" &&
test z"$subj" = z"Subject: [other] message"
'
-test_expect_failure 'mailinfo -b separated double [PATCH]' '
+test_expect_success 'mailinfo -b separated double [PATCH]' '
subj="$(echo "Subject: [PATCH] [other] [PATCH] message" |
git mailinfo -b /dev/null /dev/null)" &&
test z"$subj" = z"Subject: [other] message"
@@ -268,4 +268,26 @@ test_expect_success 'mailinfo warn CR in base64 encoded email' '
test_must_be_empty quoted-cr/0002.err
'
+test_expect_success 'from line with unterminated quoted string' '
+ echo "From: bob \"unterminated string smith <bob@example.com>" >in &&
+ git mailinfo /dev/null /dev/null <in >actual &&
+ cat >expect <<-\EOF &&
+ Author: bob unterminated string smith
+ Email: bob@example.com
+
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'from line with unterminated comment' '
+ echo "From: bob (unterminated comment smith <bob@example.com>" >in &&
+ git mailinfo /dev/null /dev/null <in >actual &&
+ cat >expect <<-\EOF &&
+ Author: bob (unterminated comment smith
+ Email: bob@example.com
+
+ EOF
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t5100/comment.expect b/t/t5100/comment.expect
index 7228177..bd71956 100644
--- a/t/t5100/comment.expect
+++ b/t/t5100/comment.expect
@@ -1,4 +1,4 @@
-Author: A U Thor (this is (really) a comment (honestly))
+Author: (this is (really) a "comment" (honestly)) A U Thor
Email: somebody@example.com
Subject: testing comments
Date: Sun, 25 May 2008 00:38:18 -0700
diff --git a/t/t5100/comment.in b/t/t5100/comment.in
index c53a192..0b7e903 100644
--- a/t/t5100/comment.in
+++ b/t/t5100/comment.in
@@ -1,5 +1,5 @@
From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001
-From: "A U Thor" <somebody@example.com> (this is \(really\) a comment (honestly))
+From: (this is \(really\) a "comment" (honestly)) "A U Thor" <somebody@example.com>
Date: Sun, 25 May 2008 00:38:18 -0700
Subject: [PATCH] testing comments
diff --git a/t/t5100/msg0002 b/t/t5100/msg0002
index e2546ec..1089382 100644
--- a/t/t5100/msg0002
+++ b/t/t5100/msg0002
@@ -3,7 +3,7 @@ message:
From: Nit Picker <nit.picker@example.net>
Subject: foo is too old
-Message-Id: <nitpicker.12121212@example.net>
+Message-ID: <nitpicker.12121212@example.net>
Hopefully this would fix the problem stated there.
diff --git a/t/t5100/msg0003 b/t/t5100/msg0003
index 1ac6810..3402b53 100644
--- a/t/t5100/msg0003
+++ b/t/t5100/msg0003
@@ -3,7 +3,7 @@ message:
From: Nit Picker <nit.picker@example.net>
Subject: foo is too old
-Message-Id: <nitpicker.12121212@example.net>
+Message-ID: <nitpicker.12121212@example.net>
Hopefully this would fix the problem stated there.
diff --git a/t/t5100/msg0012--message-id b/t/t5100/msg0012--message-id
index 376e26e..4448295 100644
--- a/t/t5100/msg0012--message-id
+++ b/t/t5100/msg0012--message-id
@@ -5,4 +5,4 @@ docutils заменён на python-docutils
python-docutils. Ð’ то Ð²Ñ€ÐµÐ¼Ñ ÐºÐ°Ðº Ñам rest2web не нужен.
Signed-off-by: Dmitriy Blinov <bda@mnsspb.ru>
-Message-Id: <1226501681-24923-1-git-send-email-bda@mnsspb.ru>
+Message-ID: <1226501681-24923-1-git-send-email-bda@mnsspb.ru>
diff --git a/t/t5100/quoted-cr.mbox b/t/t5100/quoted-cr.mbox
index 909021b..a529d4d 100644
--- a/t/t5100/quoted-cr.mbox
+++ b/t/t5100/quoted-cr.mbox
@@ -3,7 +3,7 @@ From: A U Thor <mail@example.com>
To: list@example.org
Subject: [PATCH v2] sample
Date: Mon, 3 Aug 2020 22:40:55 +0700
-Message-Id: <msg-id@example.com>
+Message-ID: <msg-id@example.com>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
@@ -27,7 +27,7 @@ From: A U Thor <mail@example.com>
To: list@example.org
Subject: [PATCH v2] sample
Date: Mon, 3 Aug 2020 22:40:55 +0700
-Message-Id: <msg-id2@example.com>
+Message-ID: <msg-id2@example.com>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
diff --git a/t/t5100/sample.mbox b/t/t5100/sample.mbox
index 6d4d0e4..4a54ee5 100644
--- a/t/t5100/sample.mbox
+++ b/t/t5100/sample.mbox
@@ -35,7 +35,7 @@ message:
From: Nit Picker <nit.picker@example.net>
Subject: foo is too old
-Message-Id: <nitpicker.12121212@example.net>
+Message-ID: <nitpicker.12121212@example.net>
Hopefully this would fix the problem stated there.
@@ -78,7 +78,7 @@ message:
From: Nit Picker <nit.picker@example.net>
Subject: foo is too old
-Message-Id: <nitpicker.12121212@example.net>
+Message-ID: <nitpicker.12121212@example.net>
Hopefully this would fix the problem stated there.
@@ -508,7 +508,7 @@ From bda@mnsspb.ru Wed Nov 12 17:54:41 2008
From: Dmitriy Blinov <bda@mnsspb.ru>
To: navy-patches@dinar.mns.mnsspb.ru
Date: Wed, 12 Nov 2008 17:54:41 +0300
-Message-Id: <1226501681-24923-1-git-send-email-bda@mnsspb.ru>
+Message-ID: <1226501681-24923-1-git-send-email-bda@mnsspb.ru>
X-Mailer: git-send-email 1.5.6.5
MIME-Version: 1.0
Content-Type: text/plain;
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index f8a0f30..61e2be2 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -208,7 +208,7 @@ test_expect_success 'unpack with OFS_DELTA' '
'
test_expect_success 'unpack with OFS_DELTA (core.fsyncmethod=batch)' '
- check_unpack test-3-${packname_3} obj-list "$BATCH_CONFIGURATION"
+ check_unpack test-3-${packname_3} obj-list "$BATCH_CONFIGURATION"
'
test_expect_success 'compare delta flavors' '
@@ -263,97 +263,97 @@ test_expect_success 'survive missing objects/pack directory' '
)
'
-test_expect_success \
- 'verify pack' \
- 'git verify-pack test-1-${packname_1}.idx \
- test-2-${packname_2}.idx \
- test-3-${packname_3}.idx'
-
-test_expect_success \
- 'verify pack -v' \
- 'git verify-pack -v test-1-${packname_1}.idx \
- test-2-${packname_2}.idx \
- test-3-${packname_3}.idx'
-
-test_expect_success \
- 'verify-pack catches mismatched .idx and .pack files' \
- 'cat test-1-${packname_1}.idx >test-3.idx &&
- cat test-2-${packname_2}.pack >test-3.pack &&
- if git verify-pack test-3.idx
- then false
- else :;
- fi'
-
-test_expect_success \
- 'verify-pack catches a corrupted pack signature' \
- 'cat test-1-${packname_1}.pack >test-3.pack &&
- echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=2 &&
- if git verify-pack test-3.idx
- then false
- else :;
- fi'
-
-test_expect_success \
- 'verify-pack catches a corrupted pack version' \
- 'cat test-1-${packname_1}.pack >test-3.pack &&
- echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=7 &&
- if git verify-pack test-3.idx
- then false
- else :;
- fi'
-
-test_expect_success \
- 'verify-pack catches a corrupted type/size of the 1st packed object data' \
- 'cat test-1-${packname_1}.pack >test-3.pack &&
- echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=12 &&
- if git verify-pack test-3.idx
- then false
- else :;
- fi'
-
-test_expect_success \
- 'verify-pack catches a corrupted sum of the index file itself' \
- 'l=$(wc -c <test-3.idx) &&
- l=$(expr $l - 20) &&
- cat test-1-${packname_1}.pack >test-3.pack &&
- printf "%20s" "" | dd of=test-3.idx count=20 bs=1 conv=notrunc seek=$l &&
- if git verify-pack test-3.pack
- then false
- else :;
- fi'
-
-test_expect_success \
- 'build pack index for an existing pack' \
- 'cat test-1-${packname_1}.pack >test-3.pack &&
- git index-pack -o tmp.idx test-3.pack &&
- cmp tmp.idx test-1-${packname_1}.idx &&
-
- git index-pack --promisor=message test-3.pack &&
- cmp test-3.idx test-1-${packname_1}.idx &&
- echo message >expect &&
- test_cmp expect test-3.promisor &&
-
- cat test-2-${packname_2}.pack >test-3.pack &&
- git index-pack -o tmp.idx test-2-${packname_2}.pack &&
- cmp tmp.idx test-2-${packname_2}.idx &&
-
- git index-pack test-3.pack &&
- cmp test-3.idx test-2-${packname_2}.idx &&
-
- cat test-3-${packname_3}.pack >test-3.pack &&
- git index-pack -o tmp.idx test-3-${packname_3}.pack &&
- cmp tmp.idx test-3-${packname_3}.idx &&
-
- git index-pack test-3.pack &&
- cmp test-3.idx test-3-${packname_3}.idx &&
-
- cat test-1-${packname_1}.pack >test-4.pack &&
- rm -f test-4.keep &&
- git index-pack --keep=why test-4.pack &&
- cmp test-1-${packname_1}.idx test-4.idx &&
- test -f test-4.keep &&
-
- :'
+test_expect_success 'verify pack' '
+ git verify-pack test-1-${packname_1}.idx \
+ test-2-${packname_2}.idx \
+ test-3-${packname_3}.idx
+'
+
+test_expect_success 'verify pack -v' '
+ git verify-pack -v test-1-${packname_1}.idx \
+ test-2-${packname_2}.idx \
+ test-3-${packname_3}.idx
+'
+
+test_expect_success 'verify-pack catches mismatched .idx and .pack files' '
+ cat test-1-${packname_1}.idx >test-3.idx &&
+ cat test-2-${packname_2}.pack >test-3.pack &&
+ if git verify-pack test-3.idx
+ then false
+ else :;
+ fi
+'
+
+test_expect_success 'verify-pack catches a corrupted pack signature' '
+ cat test-1-${packname_1}.pack >test-3.pack &&
+ echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=2 &&
+ if git verify-pack test-3.idx
+ then false
+ else :;
+ fi
+'
+
+test_expect_success 'verify-pack catches a corrupted pack version' '
+ cat test-1-${packname_1}.pack >test-3.pack &&
+ echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=7 &&
+ if git verify-pack test-3.idx
+ then false
+ else :;
+ fi
+'
+
+test_expect_success 'verify-pack catches a corrupted type/size of the 1st packed object data' '
+ cat test-1-${packname_1}.pack >test-3.pack &&
+ echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=12 &&
+ if git verify-pack test-3.idx
+ then false
+ else :;
+ fi
+'
+
+test_expect_success 'verify-pack catches a corrupted sum of the index file itself' '
+ l=$(wc -c <test-3.idx) &&
+ l=$(expr $l - 20) &&
+ cat test-1-${packname_1}.pack >test-3.pack &&
+ printf "%20s" "" | dd of=test-3.idx count=20 bs=1 conv=notrunc seek=$l &&
+ if git verify-pack test-3.pack
+ then false
+ else :;
+ fi
+'
+
+test_expect_success 'build pack index for an existing pack' '
+ cat test-1-${packname_1}.pack >test-3.pack &&
+ git index-pack -o tmp.idx test-3.pack &&
+ cmp tmp.idx test-1-${packname_1}.idx &&
+
+ git index-pack --promisor=message test-3.pack &&
+ cmp test-3.idx test-1-${packname_1}.idx &&
+ echo message >expect &&
+ test_cmp expect test-3.promisor &&
+
+ cat test-2-${packname_2}.pack >test-3.pack &&
+ git index-pack -o tmp.idx test-2-${packname_2}.pack &&
+ cmp tmp.idx test-2-${packname_2}.idx &&
+
+ git index-pack test-3.pack &&
+ cmp test-3.idx test-2-${packname_2}.idx &&
+
+ cat test-3-${packname_3}.pack >test-3.pack &&
+ git index-pack -o tmp.idx test-3-${packname_3}.pack &&
+ cmp tmp.idx test-3-${packname_3}.idx &&
+
+ git index-pack test-3.pack &&
+ cmp test-3.idx test-3-${packname_3}.idx &&
+
+ cat test-1-${packname_1}.pack >test-4.pack &&
+ rm -f test-4.keep &&
+ git index-pack --keep=why test-4.pack &&
+ cmp test-1-${packname_1}.idx test-4.idx &&
+ test -f test-4.keep &&
+
+ :
+'
test_expect_success 'unpacking with --strict' '
@@ -441,6 +441,47 @@ test_expect_success 'index-pack with --strict' '
)
'
+test_expect_success 'setup for --strict and --fsck-objects downgrading fsck msgs' '
+ git init strict &&
+ (
+ cd strict &&
+ test_commit first hello &&
+ cat >commit <<-EOF &&
+ tree $(git rev-parse HEAD^{tree})
+ parent $(git rev-parse HEAD)
+ author A U Thor
+ committer A U Thor
+
+ commit: this is a commit with bad emails
+
+ EOF
+ git hash-object --literally -t commit -w --stdin <commit >commit_list &&
+ git pack-objects test <commit_list >pack-name
+ )
+'
+
+test_with_bad_commit () {
+ must_fail_arg="$1" &&
+ must_pass_arg="$2" &&
+ (
+ cd strict &&
+ test_must_fail git index-pack "$must_fail_arg" "test-$(cat pack-name).pack" &&
+ git index-pack "$must_pass_arg" "test-$(cat pack-name).pack"
+ )
+}
+
+test_expect_success 'index-pack with --strict downgrading fsck msgs' '
+ test_with_bad_commit --strict --strict="missingEmail=ignore"
+'
+
+test_expect_success 'index-pack with --fsck-objects downgrading fsck msgs' '
+ test_with_bad_commit --fsck-objects --fsck-objects="missingEmail=ignore"
+'
+
+test_expect_success 'cleanup for --strict and --fsck-objects downgrading fsck msgs' '
+ rm -rf strict
+'
+
test_expect_success 'honor pack.packSizeLimit' '
git config pack.packSizeLimit 3m &&
packname_10=$(git pack-objects test-10 <obj-list) &&
@@ -541,7 +582,7 @@ test_expect_success 'make sure index-pack detects the SHA1 collision' '
(
cd corrupt &&
test_must_fail git index-pack -o ../bad.idx ../test-3.pack 2>msg &&
- test_i18ngrep "SHA1 COLLISION FOUND" msg
+ test_grep "SHA1 COLLISION FOUND" msg
)
'
@@ -549,7 +590,7 @@ test_expect_success 'make sure index-pack detects the SHA1 collision (large blob
(
cd corrupt &&
test_must_fail git -c core.bigfilethreshold=1 index-pack -o ../bad.idx ../test-3.pack 2>msg &&
- test_i18ngrep "SHA1 COLLISION FOUND" msg
+ test_grep "SHA1 COLLISION FOUND" msg
)
'
@@ -589,141 +630,6 @@ test_expect_success 'prefetch objects' '
test_line_count = 1 donelines
'
-test_expect_success 'setup for --stdin-packs tests' '
- git init stdin-packs &&
- (
- cd stdin-packs &&
-
- test_commit A &&
- test_commit B &&
- test_commit C &&
-
- for id in A B C
- do
- git pack-objects .git/objects/pack/pack-$id \
- --incremental --revs <<-EOF || exit 1
- refs/tags/$id
- EOF
- done &&
-
- ls -la .git/objects/pack
- )
-'
-
-test_expect_success '--stdin-packs with excluded packs' '
- (
- cd stdin-packs &&
-
- PACK_A="$(basename .git/objects/pack/pack-A-*.pack)" &&
- PACK_B="$(basename .git/objects/pack/pack-B-*.pack)" &&
- PACK_C="$(basename .git/objects/pack/pack-C-*.pack)" &&
-
- git pack-objects test --stdin-packs <<-EOF &&
- $PACK_A
- ^$PACK_B
- $PACK_C
- EOF
-
- (
- git show-index <$(ls .git/objects/pack/pack-A-*.idx) &&
- git show-index <$(ls .git/objects/pack/pack-C-*.idx)
- ) >expect.raw &&
- git show-index <$(ls test-*.idx) >actual.raw &&
-
- cut -d" " -f2 <expect.raw | sort >expect &&
- cut -d" " -f2 <actual.raw | sort >actual &&
- test_cmp expect actual
- )
-'
-
-test_expect_success '--stdin-packs is incompatible with --filter' '
- (
- cd stdin-packs &&
- test_must_fail git pack-objects --stdin-packs --stdout \
- --filter=blob:none </dev/null 2>err &&
- test_i18ngrep "cannot use --filter with --stdin-packs" err
- )
-'
-
-test_expect_success '--stdin-packs is incompatible with --revs' '
- (
- cd stdin-packs &&
- test_must_fail git pack-objects --stdin-packs --revs out \
- </dev/null 2>err &&
- test_i18ngrep "cannot use internal rev list with --stdin-packs" err
- )
-'
-
-test_expect_success '--stdin-packs with loose objects' '
- (
- cd stdin-packs &&
-
- PACK_A="$(basename .git/objects/pack/pack-A-*.pack)" &&
- PACK_B="$(basename .git/objects/pack/pack-B-*.pack)" &&
- PACK_C="$(basename .git/objects/pack/pack-C-*.pack)" &&
-
- test_commit D && # loose
-
- git pack-objects test2 --stdin-packs --unpacked <<-EOF &&
- $PACK_A
- ^$PACK_B
- $PACK_C
- EOF
-
- (
- git show-index <$(ls .git/objects/pack/pack-A-*.idx) &&
- git show-index <$(ls .git/objects/pack/pack-C-*.idx) &&
- git rev-list --objects --no-object-names \
- refs/tags/C..refs/tags/D
-
- ) >expect.raw &&
- ls -la . &&
- git show-index <$(ls test2-*.idx) >actual.raw &&
-
- cut -d" " -f2 <expect.raw | sort >expect &&
- cut -d" " -f2 <actual.raw | sort >actual &&
- test_cmp expect actual
- )
-'
-
-test_expect_success '--stdin-packs with broken links' '
- (
- cd stdin-packs &&
-
- # make an unreachable object with a bogus parent
- git cat-file -p HEAD >commit &&
- sed "s/$(git rev-parse HEAD^)/$(test_oid zero)/" <commit |
- git hash-object -w -t commit --stdin >in &&
-
- git pack-objects .git/objects/pack/pack-D <in &&
-
- PACK_A="$(basename .git/objects/pack/pack-A-*.pack)" &&
- PACK_B="$(basename .git/objects/pack/pack-B-*.pack)" &&
- PACK_C="$(basename .git/objects/pack/pack-C-*.pack)" &&
- PACK_D="$(basename .git/objects/pack/pack-D-*.pack)" &&
-
- git pack-objects test3 --stdin-packs --unpacked <<-EOF &&
- $PACK_A
- ^$PACK_B
- $PACK_C
- $PACK_D
- EOF
-
- (
- git show-index <$(ls .git/objects/pack/pack-A-*.idx) &&
- git show-index <$(ls .git/objects/pack/pack-C-*.idx) &&
- git show-index <$(ls .git/objects/pack/pack-D-*.idx) &&
- git rev-list --objects --no-object-names \
- refs/tags/C..refs/tags/D
- ) >expect.raw &&
- git show-index <$(ls test3-*.idx) >actual.raw &&
-
- cut -d" " -f2 <expect.raw | sort >expect &&
- cut -d" " -f2 <actual.raw | sort >actual &&
- test_cmp expect actual
- )
-'
-
test_expect_success 'negative window clamps to 0' '
git pack-objects --progress --window=-1 neg-window <obj-list 2>stderr &&
check_deltas stderr = 0
diff --git a/t/t5301-sliding-window.sh b/t/t5301-sliding-window.sh
index 3ccaaeb..226490d 100755
--- a/t/t5301-sliding-window.sh
+++ b/t/t5301-sliding-window.sh
@@ -8,55 +8,55 @@ test_description='mmap sliding window tests'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
-test_expect_success \
- 'setup' \
- 'rm -f .git/index* &&
- for i in a b c
- do
- echo $i >$i &&
- test-tool genrandom "$i" 32768 >>$i &&
- git update-index --add $i || return 1
- done &&
- echo d >d && cat c >>d && git update-index --add d &&
- tree=$(git write-tree) &&
- commit1=$(git commit-tree $tree </dev/null) &&
- git update-ref HEAD $commit1 &&
- git repack -a -d &&
- test "$(git count-objects)" = "0 objects, 0 kilobytes" &&
- pack1=$(ls .git/objects/pack/*.pack) &&
- test -f "$pack1"'
-
-test_expect_success \
- 'verify-pack -v, defaults' \
- 'git verify-pack -v "$pack1"'
-
-test_expect_success \
- 'verify-pack -v, packedGitWindowSize == 1 page' \
- 'git config core.packedGitWindowSize 512 &&
- git verify-pack -v "$pack1"'
-
-test_expect_success \
- 'verify-pack -v, packedGit{WindowSize,Limit} == 1 page' \
- 'git config core.packedGitWindowSize 512 &&
- git config core.packedGitLimit 512 &&
- git verify-pack -v "$pack1"'
-
-test_expect_success \
- 'repack -a -d, packedGit{WindowSize,Limit} == 1 page' \
- 'git config core.packedGitWindowSize 512 &&
- git config core.packedGitLimit 512 &&
- commit2=$(git commit-tree $tree -p $commit1 </dev/null) &&
- git update-ref HEAD $commit2 &&
- git repack -a -d &&
- test "$(git count-objects)" = "0 objects, 0 kilobytes" &&
- pack2=$(ls .git/objects/pack/*.pack) &&
- test -f "$pack2" &&
- test "$pack1" \!= "$pack2"'
-
-test_expect_success \
- 'verify-pack -v, defaults' \
- 'git config --unset core.packedGitWindowSize &&
- git config --unset core.packedGitLimit &&
- git verify-pack -v "$pack2"'
+test_expect_success 'setup' '
+ rm -f .git/index* &&
+ for i in a b c
+ do
+ echo $i >$i &&
+ test-tool genrandom "$i" 32768 >>$i &&
+ git update-index --add $i || return 1
+ done &&
+ echo d >d && cat c >>d && git update-index --add d &&
+ tree=$(git write-tree) &&
+ commit1=$(git commit-tree $tree </dev/null) &&
+ git update-ref HEAD $commit1 &&
+ git repack -a -d &&
+ test "$(git count-objects)" = "0 objects, 0 kilobytes" &&
+ pack1=$(ls .git/objects/pack/*.pack) &&
+ test -f "$pack1"
+'
+
+test_expect_success 'verify-pack -v, defaults' '
+ git verify-pack -v "$pack1"
+'
+
+test_expect_success 'verify-pack -v, packedGitWindowSize == 1 page' '
+ git config core.packedGitWindowSize 512 &&
+ git verify-pack -v "$pack1"
+'
+
+test_expect_success 'verify-pack -v, packedGit{WindowSize,Limit} == 1 page' '
+ git config core.packedGitWindowSize 512 &&
+ git config core.packedGitLimit 512 &&
+ git verify-pack -v "$pack1"
+'
+
+test_expect_success 'repack -a -d, packedGit{WindowSize,Limit} == 1 page' '
+ git config core.packedGitWindowSize 512 &&
+ git config core.packedGitLimit 512 &&
+ commit2=$(git commit-tree $tree -p $commit1 </dev/null) &&
+ git update-ref HEAD $commit2 &&
+ git repack -a -d &&
+ test "$(git count-objects)" = "0 objects, 0 kilobytes" &&
+ pack2=$(ls .git/objects/pack/*.pack) &&
+ test -f "$pack2" &&
+ test "$pack1" \!= "$pack2"
+'
+
+test_expect_success 'verify-pack -v, defaults' '
+ git config --unset core.packedGitWindowSize &&
+ git config --unset core.packedGitLimit &&
+ git verify-pack -v "$pack2"
+'
test_done
diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh
index b0095ab..d88e6f1 100755
--- a/t/t5302-pack-index.sh
+++ b/t/t5302-pack-index.sh
@@ -4,6 +4,8 @@
#
test_description='pack index with 64-bit offsets and object CRC'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -263,7 +265,7 @@ tag guten tag
This is an invalid tag.
EOF
- tag=$(git hash-object -t tag -w --stdin <wrong-tag) &&
+ tag=$(git hash-object -t tag -w --stdin --literally <wrong-tag) &&
pack1=$(echo $tag $sha | git pack-objects tag-test) &&
echo remove tag object &&
thirtyeight=${tag#??} &&
@@ -280,8 +282,8 @@ test_expect_success 'index-pack --fsck-objects also warns upon missing tagger in
test_expect_success 'index-pack -v --stdin produces progress for both phases' '
pack=$(git pack-objects --all pack </dev/null) &&
GIT_PROGRESS_DELAY=0 git index-pack -v --stdin <pack-$pack.pack 2>err &&
- test_i18ngrep "Receiving objects" err &&
- test_i18ngrep "Resolving deltas" err
+ test_grep "Receiving objects" err &&
+ test_grep "Resolving deltas" err
'
test_expect_success 'too-large packs report the breach' '
diff --git a/t/t5303-pack-corruption-resilience.sh b/t/t5303-pack-corruption-resilience.sh
index 41e6dc4..61469ef 100755
--- a/t/t5303-pack-corruption-resilience.sh
+++ b/t/t5303-pack-corruption-resilience.sh
@@ -4,6 +4,8 @@
#
test_description='resilience to pack corruptions with redundant objects'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# Note: the test objects are created with knowledge of their pack encoding
@@ -57,304 +59,304 @@ do_corrupt_object() {
printf '\0' > zero
-test_expect_success \
- 'initial setup validation' \
- 'create_test_files &&
- create_new_pack &&
- git prune-packed &&
- git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- 'create corruption in header of first object' \
- 'do_corrupt_object $blob_1 0 < zero &&
- test_must_fail git cat-file blob $blob_1 > /dev/null &&
- test_must_fail git cat-file blob $blob_2 > /dev/null &&
- test_must_fail git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- '... but having a loose copy allows for full recovery' \
- 'mv ${pack}.idx tmp &&
- git hash-object -t blob -w file_1 &&
- mv tmp ${pack}.idx &&
- git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- '... and loose copy of first delta allows for partial recovery' \
- 'git prune-packed &&
- test_must_fail git cat-file blob $blob_2 > /dev/null &&
- mv ${pack}.idx tmp &&
- git hash-object -t blob -w file_2 &&
- mv tmp ${pack}.idx &&
- test_must_fail git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- 'create corruption in data of first object' \
- 'create_new_pack &&
- git prune-packed &&
- chmod +w ${pack}.pack &&
- perl -i.bak -pe "s/ base /abcdef/" ${pack}.pack &&
- test_must_fail git cat-file blob $blob_1 > /dev/null &&
- test_must_fail git cat-file blob $blob_2 > /dev/null &&
- test_must_fail git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- '... but having a loose copy allows for full recovery' \
- 'mv ${pack}.idx tmp &&
- git hash-object -t blob -w file_1 &&
- mv tmp ${pack}.idx &&
- git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- '... and loose copy of second object allows for partial recovery' \
- 'git prune-packed &&
- test_must_fail git cat-file blob $blob_2 > /dev/null &&
- mv ${pack}.idx tmp &&
- git hash-object -t blob -w file_2 &&
- mv tmp ${pack}.idx &&
- test_must_fail git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- 'create corruption in header of first delta' \
- 'create_new_pack &&
- git prune-packed &&
- do_corrupt_object $blob_2 0 < zero &&
- git cat-file blob $blob_1 > /dev/null &&
- test_must_fail git cat-file blob $blob_2 > /dev/null &&
- test_must_fail git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- '... but having a loose copy allows for full recovery' \
- 'mv ${pack}.idx tmp &&
- git hash-object -t blob -w file_2 &&
- mv tmp ${pack}.idx &&
- git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- '... and then a repack "clears" the corruption' \
- 'do_repack &&
- git prune-packed &&
- git verify-pack ${pack}.pack &&
- git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- 'create corruption in data of first delta' \
- 'create_new_pack &&
- git prune-packed &&
- chmod +w ${pack}.pack &&
- perl -i.bak -pe "s/ delta1 /abcdefgh/" ${pack}.pack &&
- git cat-file blob $blob_1 > /dev/null &&
- test_must_fail git cat-file blob $blob_2 > /dev/null &&
- test_must_fail git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- '... but having a loose copy allows for full recovery' \
- 'mv ${pack}.idx tmp &&
- git hash-object -t blob -w file_2 &&
- mv tmp ${pack}.idx &&
- git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- '... and then a repack "clears" the corruption' \
- 'do_repack &&
- git prune-packed &&
- git verify-pack ${pack}.pack &&
- git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- 'corruption in delta base reference of first delta (OBJ_REF_DELTA)' \
- 'create_new_pack &&
- git prune-packed &&
- do_corrupt_object $blob_2 2 < zero &&
- git cat-file blob $blob_1 > /dev/null &&
- test_must_fail git cat-file blob $blob_2 > /dev/null &&
- test_must_fail git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- '... but having a loose copy allows for full recovery' \
- 'mv ${pack}.idx tmp &&
- git hash-object -t blob -w file_2 &&
- mv tmp ${pack}.idx &&
- git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- '... and then a repack "clears" the corruption' \
- 'do_repack &&
- git prune-packed &&
- git verify-pack ${pack}.pack &&
- git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- 'corruption #0 in delta base reference of first delta (OBJ_OFS_DELTA)' \
- 'create_new_pack --delta-base-offset &&
- git prune-packed &&
- do_corrupt_object $blob_2 2 < zero &&
- git cat-file blob $blob_1 > /dev/null &&
- test_must_fail git cat-file blob $blob_2 > /dev/null &&
- test_must_fail git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- '... but having a loose copy allows for full recovery' \
- 'mv ${pack}.idx tmp &&
- git hash-object -t blob -w file_2 &&
- mv tmp ${pack}.idx &&
- git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- '... and then a repack "clears" the corruption' \
- 'do_repack --delta-base-offset &&
- git prune-packed &&
- git verify-pack ${pack}.pack &&
- git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- 'corruption #1 in delta base reference of first delta (OBJ_OFS_DELTA)' \
- 'create_new_pack --delta-base-offset &&
- git prune-packed &&
- printf "\001" | do_corrupt_object $blob_2 2 &&
- git cat-file blob $blob_1 > /dev/null &&
- test_must_fail git cat-file blob $blob_2 > /dev/null &&
- test_must_fail git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- '... but having a loose copy allows for full recovery' \
- 'mv ${pack}.idx tmp &&
- git hash-object -t blob -w file_2 &&
- mv tmp ${pack}.idx &&
- git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- '... and then a repack "clears" the corruption' \
- 'do_repack --delta-base-offset &&
- git prune-packed &&
- git verify-pack ${pack}.pack &&
- git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- '... and a redundant pack allows for full recovery too' \
- 'do_corrupt_object $blob_2 2 < zero &&
- git cat-file blob $blob_1 > /dev/null &&
- test_must_fail git cat-file blob $blob_2 > /dev/null &&
- test_must_fail git cat-file blob $blob_3 > /dev/null &&
- mv ${pack}.idx tmp &&
- git hash-object -t blob -w file_1 &&
- git hash-object -t blob -w file_2 &&
- printf "$blob_1\n$blob_2\n" | git pack-objects .git/objects/pack/pack &&
- git prune-packed &&
- mv tmp ${pack}.idx &&
- git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- 'corruption of delta base reference pointing to wrong object' \
- 'create_new_pack --delta-base-offset &&
- git prune-packed &&
- printf "\220\033" | do_corrupt_object $blob_3 2 &&
- git cat-file blob $blob_1 >/dev/null &&
- git cat-file blob $blob_2 >/dev/null &&
- test_must_fail git cat-file blob $blob_3 >/dev/null'
-
-test_expect_success \
- '... but having a loose copy allows for full recovery' \
- 'mv ${pack}.idx tmp &&
- git hash-object -t blob -w file_3 &&
- mv tmp ${pack}.idx &&
- git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- '... and then a repack "clears" the corruption' \
- 'do_repack --delta-base-offset --no-reuse-delta &&
- git prune-packed &&
- git verify-pack ${pack}.pack &&
- git cat-file blob $blob_1 > /dev/null &&
- git cat-file blob $blob_2 > /dev/null &&
- git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
- 'corrupting header to have too small output buffer fails unpack' \
- 'create_new_pack &&
- git prune-packed &&
- printf "\262\001" | do_corrupt_object $blob_1 0 &&
- test_must_fail git cat-file blob $blob_1 > /dev/null &&
- test_must_fail git cat-file blob $blob_2 > /dev/null &&
- test_must_fail git cat-file blob $blob_3 > /dev/null'
+test_expect_success 'initial setup validation' '
+ create_test_files &&
+ create_new_pack &&
+ git prune-packed &&
+ git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'create corruption in header of first object' '
+ do_corrupt_object $blob_1 0 < zero &&
+ test_must_fail git cat-file blob $blob_1 > /dev/null &&
+ test_must_fail git cat-file blob $blob_2 > /dev/null &&
+ test_must_fail git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... but having a loose copy allows for full recovery' '
+ mv ${pack}.idx tmp &&
+ git hash-object -t blob -w file_1 &&
+ mv tmp ${pack}.idx &&
+ git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and loose copy of first delta allows for partial recovery' '
+ git prune-packed &&
+ test_must_fail git cat-file blob $blob_2 > /dev/null &&
+ mv ${pack}.idx tmp &&
+ git hash-object -t blob -w file_2 &&
+ mv tmp ${pack}.idx &&
+ test_must_fail git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'create corruption in data of first object' '
+ create_new_pack &&
+ git prune-packed &&
+ chmod +w ${pack}.pack &&
+ perl -i.bak -pe "s/ base /abcdef/" ${pack}.pack &&
+ test_must_fail git cat-file blob $blob_1 > /dev/null &&
+ test_must_fail git cat-file blob $blob_2 > /dev/null &&
+ test_must_fail git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... but having a loose copy allows for full recovery' '
+ mv ${pack}.idx tmp &&
+ git hash-object -t blob -w file_1 &&
+ mv tmp ${pack}.idx &&
+ git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and loose copy of second object allows for partial recovery' '
+ git prune-packed &&
+ test_must_fail git cat-file blob $blob_2 > /dev/null &&
+ mv ${pack}.idx tmp &&
+ git hash-object -t blob -w file_2 &&
+ mv tmp ${pack}.idx &&
+ test_must_fail git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'create corruption in header of first delta' '
+ create_new_pack &&
+ git prune-packed &&
+ do_corrupt_object $blob_2 0 < zero &&
+ git cat-file blob $blob_1 > /dev/null &&
+ test_must_fail git cat-file blob $blob_2 > /dev/null &&
+ test_must_fail git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... but having a loose copy allows for full recovery' '
+ mv ${pack}.idx tmp &&
+ git hash-object -t blob -w file_2 &&
+ mv tmp ${pack}.idx &&
+ git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and then a repack "clears" the corruption' '
+ do_repack &&
+ git prune-packed &&
+ git verify-pack ${pack}.pack &&
+ git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'create corruption in data of first delta' '
+ create_new_pack &&
+ git prune-packed &&
+ chmod +w ${pack}.pack &&
+ perl -i.bak -pe "s/ delta1 /abcdefgh/" ${pack}.pack &&
+ git cat-file blob $blob_1 > /dev/null &&
+ test_must_fail git cat-file blob $blob_2 > /dev/null &&
+ test_must_fail git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... but having a loose copy allows for full recovery' '
+ mv ${pack}.idx tmp &&
+ git hash-object -t blob -w file_2 &&
+ mv tmp ${pack}.idx &&
+ git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and then a repack "clears" the corruption' '
+ do_repack &&
+ git prune-packed &&
+ git verify-pack ${pack}.pack &&
+ git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'corruption in delta base reference of first delta (OBJ_REF_DELTA)' '
+ create_new_pack &&
+ git prune-packed &&
+ do_corrupt_object $blob_2 2 < zero &&
+ git cat-file blob $blob_1 > /dev/null &&
+ test_must_fail git cat-file blob $blob_2 > /dev/null &&
+ test_must_fail git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... but having a loose copy allows for full recovery' '
+ mv ${pack}.idx tmp &&
+ git hash-object -t blob -w file_2 &&
+ mv tmp ${pack}.idx &&
+ git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and then a repack "clears" the corruption' '
+ do_repack &&
+ git prune-packed &&
+ git verify-pack ${pack}.pack &&
+ git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'corruption #0 in delta base reference of first delta (OBJ_OFS_DELTA)' '
+ create_new_pack --delta-base-offset &&
+ git prune-packed &&
+ do_corrupt_object $blob_2 2 < zero &&
+ git cat-file blob $blob_1 > /dev/null &&
+ test_must_fail git cat-file blob $blob_2 > /dev/null &&
+ test_must_fail git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... but having a loose copy allows for full recovery' '
+ mv ${pack}.idx tmp &&
+ git hash-object -t blob -w file_2 &&
+ mv tmp ${pack}.idx &&
+ git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and then a repack "clears" the corruption' '
+ do_repack --delta-base-offset &&
+ git prune-packed &&
+ git verify-pack ${pack}.pack &&
+ git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'corruption #1 in delta base reference of first delta (OBJ_OFS_DELTA)' '
+ create_new_pack --delta-base-offset &&
+ git prune-packed &&
+ printf "\001" | do_corrupt_object $blob_2 2 &&
+ git cat-file blob $blob_1 > /dev/null &&
+ test_must_fail git cat-file blob $blob_2 > /dev/null &&
+ test_must_fail git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... but having a loose copy allows for full recovery' '
+ mv ${pack}.idx tmp &&
+ git hash-object -t blob -w file_2 &&
+ mv tmp ${pack}.idx &&
+ git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and then a repack "clears" the corruption' '
+ do_repack --delta-base-offset &&
+ git prune-packed &&
+ git verify-pack ${pack}.pack &&
+ git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and a redundant pack allows for full recovery too' '
+ do_corrupt_object $blob_2 2 < zero &&
+ git cat-file blob $blob_1 > /dev/null &&
+ test_must_fail git cat-file blob $blob_2 > /dev/null &&
+ test_must_fail git cat-file blob $blob_3 > /dev/null &&
+ mv ${pack}.idx tmp &&
+ git hash-object -t blob -w file_1 &&
+ git hash-object -t blob -w file_2 &&
+ printf "$blob_1\n$blob_2\n" | git pack-objects .git/objects/pack/pack &&
+ git prune-packed &&
+ mv tmp ${pack}.idx &&
+ git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'corruption of delta base reference pointing to wrong object' '
+ create_new_pack --delta-base-offset &&
+ git prune-packed &&
+ printf "\220\033" | do_corrupt_object $blob_3 2 &&
+ git cat-file blob $blob_1 >/dev/null &&
+ git cat-file blob $blob_2 >/dev/null &&
+ test_must_fail git cat-file blob $blob_3 >/dev/null
+'
+
+test_expect_success '... but having a loose copy allows for full recovery' '
+ mv ${pack}.idx tmp &&
+ git hash-object -t blob -w file_3 &&
+ mv tmp ${pack}.idx &&
+ git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and then a repack "clears" the corruption' '
+ do_repack --delta-base-offset --no-reuse-delta &&
+ git prune-packed &&
+ git verify-pack ${pack}.pack &&
+ git cat-file blob $blob_1 > /dev/null &&
+ git cat-file blob $blob_2 > /dev/null &&
+ git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'corrupting header to have too small output buffer fails unpack' '
+ create_new_pack &&
+ git prune-packed &&
+ printf "\262\001" | do_corrupt_object $blob_1 0 &&
+ test_must_fail git cat-file blob $blob_1 > /dev/null &&
+ test_must_fail git cat-file blob $blob_2 > /dev/null &&
+ test_must_fail git cat-file blob $blob_3 > /dev/null
+'
# \0 - empty base
# \1 - one byte in result
# \1 - one literal byte (X)
-test_expect_success \
- 'apply good minimal delta' \
- 'printf "\0\1\1X" > minimal_delta &&
- test-tool delta -p /dev/null minimal_delta /dev/null'
+test_expect_success 'apply good minimal delta' '
+ printf "\0\1\1X" > minimal_delta &&
+ test-tool delta -p /dev/null minimal_delta /dev/null
+'
# \0 - empty base
# \1 - 1 byte in result
# \2 - two literal bytes (one too many)
-test_expect_success \
- 'apply delta with too many literal bytes' \
- 'printf "\0\1\2XX" > too_big_literal &&
- test_must_fail test-tool delta -p /dev/null too_big_literal /dev/null'
+test_expect_success 'apply delta with too many literal bytes' '
+ printf "\0\1\2XX" > too_big_literal &&
+ test_must_fail test-tool delta -p /dev/null too_big_literal /dev/null
+'
# \4 - four bytes in base
# \1 - one byte in result
# \221 - copy, one byte offset, one byte size
# \0 - copy from offset 0
# \2 - copy two bytes (one too many)
-test_expect_success \
- 'apply delta with too many copied bytes' \
- 'printf "\4\1\221\0\2" > too_big_copy &&
- printf base >base &&
- test_must_fail test-tool delta -p base too_big_copy /dev/null'
+test_expect_success 'apply delta with too many copied bytes' '
+ printf "\4\1\221\0\2" > too_big_copy &&
+ printf base >base &&
+ test_must_fail test-tool delta -p base too_big_copy /dev/null
+'
# \0 - empty base
# \2 - two bytes in result
# \2 - two literal bytes (we are short one)
-test_expect_success \
- 'apply delta with too few literal bytes' \
- 'printf "\0\2\2X" > truncated_delta &&
- test_must_fail test-tool delta -p /dev/null truncated_delta /dev/null'
+test_expect_success 'apply delta with too few literal bytes' '
+ printf "\0\2\2X" > truncated_delta &&
+ test_must_fail test-tool delta -p /dev/null truncated_delta /dev/null
+'
# \0 - empty base
# \1 - one byte in result
# \221 - copy, one byte offset, one byte size
# \0 - copy from offset 0
# \1 - copy one byte (we are short one)
-test_expect_success \
- 'apply delta with too few bytes in base' \
- 'printf "\0\1\221\0\1" > truncated_base &&
- test_must_fail test-tool delta -p /dev/null truncated_base /dev/null'
+test_expect_success 'apply delta with too few bytes in base' '
+ printf "\0\1\221\0\1" > truncated_base &&
+ test_must_fail test-tool delta -p /dev/null truncated_base /dev/null
+'
# \4 - four bytes in base
# \2 - two bytes in result
@@ -364,20 +366,20 @@ test_expect_success \
#
# Note that the literal byte is necessary to get past the uninteresting minimum
# delta size check.
-test_expect_success \
- 'apply delta with truncated copy parameters' \
- 'printf "\4\2\1X\221" > truncated_copy_delta &&
- printf base >base &&
- test_must_fail test-tool delta -p base truncated_copy_delta /dev/null'
+test_expect_success 'apply delta with truncated copy parameters' '
+ printf "\4\2\1X\221" > truncated_copy_delta &&
+ printf base >base &&
+ test_must_fail test-tool delta -p base truncated_copy_delta /dev/null
+'
# \0 - empty base
# \1 - one byte in result
# \1 - one literal byte (X)
# \1 - trailing garbage command
-test_expect_success \
- 'apply delta with trailing garbage literal' \
- 'printf "\0\1\1X\1" > tail_garbage_literal &&
- test_must_fail test-tool delta -p /dev/null tail_garbage_literal /dev/null'
+test_expect_success 'apply delta with trailing garbage literal' '
+ printf "\0\1\1X\1" > tail_garbage_literal &&
+ test_must_fail test-tool delta -p /dev/null tail_garbage_literal /dev/null
+'
# \4 - four bytes in base
# \1 - one byte in result
@@ -385,19 +387,19 @@ test_expect_success \
# \221 - copy, one byte offset, one byte size
# \0 - copy from offset 0
# \1 - copy 1 byte
-test_expect_success \
- 'apply delta with trailing garbage copy' \
- 'printf "\4\1\1X\221\0\1" > tail_garbage_copy &&
- printf base >base &&
- test_must_fail test-tool delta -p /dev/null tail_garbage_copy /dev/null'
+test_expect_success 'apply delta with trailing garbage copy' '
+ printf "\4\1\1X\221\0\1" > tail_garbage_copy &&
+ printf base >base &&
+ test_must_fail test-tool delta -p /dev/null tail_garbage_copy /dev/null
+'
# \0 - empty base
# \1 - one byte in result
# \1 - one literal byte (X)
# \0 - bogus opcode
-test_expect_success \
- 'apply delta with trailing garbage opcode' \
- 'printf "\0\1\1X\0" > tail_garbage_opcode &&
- test_must_fail test-tool delta -p /dev/null tail_garbage_opcode /dev/null'
+test_expect_success 'apply delta with trailing garbage opcode' '
+ printf "\0\1\1X\0" > tail_garbage_opcode &&
+ test_must_fail test-tool delta -p /dev/null tail_garbage_opcode /dev/null
+'
test_done
diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh
index 8ae314a..1f1f664 100755
--- a/t/t5304-prune.sh
+++ b/t/t5304-prune.sh
@@ -16,7 +16,7 @@ add_blob() {
before=$(git count-objects | sed "s/ .*//") &&
BLOB=$(echo aleph_0 | git hash-object -w --stdin) &&
BLOB_FILE=.git/objects/$(echo $BLOB | sed "s/^../&\//") &&
- verbose test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
+ test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
test_path_is_file $BLOB_FILE &&
test-tool chmtime =+0 $BLOB_FILE
}
@@ -29,6 +29,14 @@ test_expect_success setup '
git gc
'
+test_expect_success 'bare repo prune is quiet without $GIT_DIR/objects/pack' '
+ git clone -q --shared --template= --bare . bare.git &&
+ rmdir bare.git/objects/pack &&
+ git --git-dir=bare.git prune --no-progress 2>prune.err &&
+ test_must_be_empty prune.err &&
+ rm -r bare.git prune.err
+'
+
test_expect_success 'prune stale packs' '
orig_pack=$(echo .git/objects/pack/*.pack) &&
>.git/objects/tmp_1.pack &&
@@ -43,34 +51,42 @@ test_expect_success 'prune stale packs' '
test_expect_success 'prune --expire' '
add_blob &&
git prune --expire=1.hour.ago &&
- verbose test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
+ test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
test_path_is_file $BLOB_FILE &&
test-tool chmtime =-86500 $BLOB_FILE &&
git prune --expire 1.day &&
- verbose test $before = $(git count-objects | sed "s/ .*//") &&
+ test $before = $(git count-objects | sed "s/ .*//") &&
test_path_is_missing $BLOB_FILE
'
test_expect_success 'gc: implicit prune --expire' '
add_blob &&
test-tool chmtime =-$((2*$week-30)) $BLOB_FILE &&
- git gc &&
- verbose test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
+ git gc --no-cruft &&
+ test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
test_path_is_file $BLOB_FILE &&
test-tool chmtime =-$((2*$week+1)) $BLOB_FILE &&
- git gc &&
- verbose test $before = $(git count-objects | sed "s/ .*//") &&
+ git gc --no-cruft &&
+ test $before = $(git count-objects | sed "s/ .*//") &&
test_path_is_missing $BLOB_FILE
'
test_expect_success 'gc: refuse to start with invalid gc.pruneExpire' '
- git config gc.pruneExpire invalid &&
- test_must_fail git gc
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ >repo/.git/config &&
+ git -C repo config gc.pruneExpire invalid &&
+ cat >expect <<-\EOF &&
+ error: Invalid gc.pruneexpire: '\''invalid'\''
+ fatal: bad config variable '\''gc.pruneexpire'\'' in file '\''.git/config'\'' at line 2
+ EOF
+ test_must_fail git -C repo gc 2>actual &&
+ test_cmp expect actual
'
test_expect_success 'gc: start with ok gc.pruneExpire' '
git config gc.pruneExpire 2.days.ago &&
- git gc
+ git gc --no-cruft
'
test_expect_success 'prune: prune nonsense parameters' '
@@ -121,44 +137,44 @@ test_expect_success 'gc --no-prune' '
add_blob &&
test-tool chmtime =-$((5001*$day)) $BLOB_FILE &&
git config gc.pruneExpire 2.days.ago &&
- git gc --no-prune &&
- verbose test 1 = $(git count-objects | sed "s/ .*//") &&
+ git gc --no-prune --no-cruft &&
+ test 1 = $(git count-objects | sed "s/ .*//") &&
test_path_is_file $BLOB_FILE
'
test_expect_success 'gc respects gc.pruneExpire' '
git config gc.pruneExpire 5002.days.ago &&
- git gc &&
+ git gc --no-cruft &&
test_path_is_file $BLOB_FILE &&
git config gc.pruneExpire 5000.days.ago &&
- git gc &&
+ git gc --no-cruft &&
test_path_is_missing $BLOB_FILE
'
test_expect_success 'gc --prune=<date>' '
add_blob &&
test-tool chmtime =-$((5001*$day)) $BLOB_FILE &&
- git gc --prune=5002.days.ago &&
+ git gc --prune=5002.days.ago --no-cruft &&
test_path_is_file $BLOB_FILE &&
- git gc --prune=5000.days.ago &&
+ git gc --prune=5000.days.ago --no-cruft &&
test_path_is_missing $BLOB_FILE
'
test_expect_success 'gc --prune=never' '
add_blob &&
- git gc --prune=never &&
+ git gc --prune=never --no-cruft &&
test_path_is_file $BLOB_FILE &&
- git gc --prune=now &&
+ git gc --prune=now --no-cruft &&
test_path_is_missing $BLOB_FILE
'
test_expect_success 'gc respects gc.pruneExpire=never' '
git config gc.pruneExpire never &&
add_blob &&
- git gc &&
+ git gc --no-cruft &&
test_path_is_file $BLOB_FILE &&
git config gc.pruneExpire now &&
- git gc &&
+ git gc --no-cruft &&
test_path_is_missing $BLOB_FILE
'
@@ -176,10 +192,10 @@ test_expect_success 'gc: prune old objects after local clone' '
git clone --no-hardlinks . aclone &&
(
cd aclone &&
- verbose test 1 = $(git count-objects | sed "s/ .*//") &&
+ test 1 = $(git count-objects | sed "s/ .*//") &&
test_path_is_file $BLOB_FILE &&
- git gc --prune &&
- verbose test 0 = $(git count-objects | sed "s/ .*//") &&
+ git gc --prune --no-cruft &&
+ test 0 = $(git count-objects | sed "s/ .*//") &&
test_path_is_missing $BLOB_FILE
)
'
@@ -221,7 +237,7 @@ test_expect_success 'clean pack garbage with gc' '
>.git/objects/pack/fake2.keep &&
>.git/objects/pack/fake2.idx &&
>.git/objects/pack/fake3.keep &&
- git gc &&
+ git gc --no-cruft &&
git count-objects -v 2>stderr &&
grep "^warning:" stderr | sort >actual &&
cat >expected <<\EOF &&
@@ -302,10 +318,10 @@ test_expect_success 'prune: handle HEAD reflog in multiple worktrees' '
test_expect_success 'prune: handle expire option correctly' '
test_must_fail git prune --expire 2>error &&
- test_i18ngrep "requires a value" error &&
+ test_grep "requires a value" error &&
test_must_fail git prune --expire=nyah 2>error &&
- test_i18ngrep "malformed expiration" error &&
+ test_grep "malformed expiration" error &&
git prune --no-expire
'
@@ -334,4 +350,18 @@ test_expect_success 'old reachable-from-recent retained with bitmaps' '
test_must_fail git cat-file -e $to_drop
'
+test_expect_success 'gc.recentObjectsHook' '
+ add_blob &&
+ test-tool chmtime =-86500 $BLOB_FILE &&
+
+ write_script precious-objects <<-EOF &&
+ echo $BLOB
+ EOF
+ test_config gc.recentObjectsHook ./precious-objects &&
+
+ git prune --expire=now &&
+
+ git cat-file -p $BLOB
+'
+
test_done
diff --git a/t/t5306-pack-nobase.sh b/t/t5306-pack-nobase.sh
index 51973f4..0d50c6b 100755
--- a/t/t5306-pack-nobase.sh
+++ b/t/t5306-pack-nobase.sh
@@ -6,22 +6,23 @@
test_description='git-pack-object with missing base
'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# Create A-B chain
#
-test_expect_success \
- 'setup base' \
- 'test_write_lines a b c d e f g h i >text &&
- echo side >side &&
- git update-index --add text side &&
- A=$(echo A | git commit-tree $(git write-tree)) &&
+test_expect_success 'setup base' '
+ test_write_lines a b c d e f g h i >text &&
+ echo side >side &&
+ git update-index --add text side &&
+ A=$(echo A | git commit-tree $(git write-tree)) &&
- echo m >>text &&
- git update-index text &&
- B=$(echo B | git commit-tree $(git write-tree) -p $A) &&
- git update-ref HEAD $B
- '
+ echo m >>text &&
+ git update-index text &&
+ B=$(echo B | git commit-tree $(git write-tree) -p $A) &&
+ git update-ref HEAD $B
+'
# Create repository with C whose parent is B.
# Repository contains C, C^{tree}, C:text, B, B^{tree}.
@@ -29,52 +30,49 @@ test_expect_success \
# Repository is missing A (parent of B).
# Repository is missing A:side.
#
-test_expect_success \
- 'setup patch_clone' \
- 'base_objects=$(pwd)/.git/objects &&
- (mkdir patch_clone &&
- cd patch_clone &&
- git init &&
- echo "$base_objects" >.git/objects/info/alternates &&
- echo q >>text &&
- git read-tree $B &&
- git update-index text &&
- git update-ref HEAD $(echo C | git commit-tree $(git write-tree) -p $B) &&
- rm .git/objects/info/alternates &&
+test_expect_success 'setup patch_clone' '
+ base_objects=$(pwd)/.git/objects &&
+ (mkdir patch_clone &&
+ cd patch_clone &&
+ git init &&
+ echo "$base_objects" >.git/objects/info/alternates &&
+ echo q >>text &&
+ git read-tree $B &&
+ git update-index text &&
+ git update-ref HEAD $(echo C | git commit-tree $(git write-tree) -p $B) &&
+ rm .git/objects/info/alternates &&
- git --git-dir=../.git cat-file commit $B |
- git hash-object -t commit -w --stdin &&
+ git --git-dir=../.git cat-file commit $B |
+ git hash-object -t commit -w --stdin &&
- git --git-dir=../.git cat-file tree "$B^{tree}" |
- git hash-object -t tree -w --stdin
- ) &&
- C=$(git --git-dir=patch_clone/.git rev-parse HEAD)
- '
+ git --git-dir=../.git cat-file tree "$B^{tree}" |
+ git hash-object -t tree -w --stdin
+ ) &&
+ C=$(git --git-dir=patch_clone/.git rev-parse HEAD)
+'
# Clone patch_clone indirectly by cloning base and fetching.
#
-test_expect_success \
- 'indirectly clone patch_clone' \
- '(mkdir user_clone &&
- cd user_clone &&
- git init &&
- git pull ../.git &&
- test $(git rev-parse HEAD) = $B &&
+test_expect_success 'indirectly clone patch_clone' '
+ (mkdir user_clone &&
+ cd user_clone &&
+ git init &&
+ git pull ../.git &&
+ test $(git rev-parse HEAD) = $B &&
- git pull ../patch_clone/.git &&
- test $(git rev-parse HEAD) = $C
- )
- '
+ git pull ../patch_clone/.git &&
+ test $(git rev-parse HEAD) = $C
+ )
+'
# Cloning the patch_clone directly should fail.
#
-test_expect_success \
- 'clone of patch_clone is incomplete' \
- '(mkdir user_direct &&
- cd user_direct &&
- git init &&
- test_must_fail git fetch ../patch_clone/.git
- )
- '
+test_expect_success 'clone of patch_clone is incomplete' '
+ (mkdir user_direct &&
+ cd user_direct &&
+ git init &&
+ test_must_fail git fetch ../patch_clone/.git
+ )
+'
test_done
diff --git a/t/t5308-pack-detect-duplicates.sh b/t/t5308-pack-detect-duplicates.sh
index 693b241..655cafa 100755
--- a/t/t5308-pack-detect-duplicates.sh
+++ b/t/t5308-pack-detect-duplicates.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='handling of duplicate objects in incoming packfiles'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-pack.sh
diff --git a/t/t5309-pack-delta-cycles.sh b/t/t5309-pack-delta-cycles.sh
index 55b7876..4e910c5 100755
--- a/t/t5309-pack-delta-cycles.sh
+++ b/t/t5309-pack-delta-cycles.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='test index-pack handling of delta cycles in packfiles'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-pack.sh
diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh
index f775fc1..d7fd713 100755
--- a/t/t5310-pack-bitmaps.sh
+++ b/t/t5310-pack-bitmaps.sh
@@ -9,6 +9,10 @@ test_description='exercise basic bitmap functionality'
# their place.
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
+# Likewise, allow individual tests to control whether or not they use
+# the boundary-based traversal.
+sane_unset GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL
+
objpath () {
echo ".git/objects/$(echo "$1" | sed -e 's|\(..\)|\1/|')"
}
@@ -26,27 +30,448 @@ has_any () {
grep -Ff "$1" "$2"
}
-setup_bitmap_history
+test_bitmap_cases () {
+ writeLookupTable=false
+ for i in "$@"
+ do
+ case "$i" in
+ "pack.writeBitmapLookupTable") writeLookupTable=true;;
+ esac
+ done
+
+ test_expect_success 'setup test repository' '
+ rm -fr * .git &&
+ git init &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"'
+ '
+ setup_bitmap_history
+
+ test_expect_success 'setup writing bitmaps during repack' '
+ git config repack.writeBitmaps true
+ '
+
+ test_expect_success 'full repack creates bitmaps' '
+ GIT_TRACE2_EVENT="$(pwd)/trace" \
+ git repack -ad &&
+ ls .git/objects/pack/ | grep bitmap >output &&
+ test_line_count = 1 output &&
+ grep "\"key\":\"num_selected_commits\",\"value\":\"106\"" trace &&
+ grep "\"key\":\"num_maximal_commits\",\"value\":\"107\"" trace
+ '
+
+ basic_bitmap_tests
+
+ test_expect_success 'pack-objects respects --local (non-local loose)' '
+ git init --bare alt.git &&
+ echo $(pwd)/alt.git/objects >.git/objects/info/alternates &&
+ echo content1 >file1 &&
+ # non-local loose object which is not present in bitmapped pack
+ altblob=$(GIT_DIR=alt.git git hash-object -w file1) &&
+ # non-local loose object which is also present in bitmapped pack
+ git cat-file blob $blob | GIT_DIR=alt.git git hash-object -w --stdin &&
+ git add file1 &&
+ test_tick &&
+ git commit -m commit_file1 &&
+ echo HEAD | git pack-objects --local --stdout --revs >1.pack &&
+ git index-pack 1.pack &&
+ list_packed_objects 1.idx >1.objects &&
+ printf "%s\n" "$altblob" "$blob" >nonlocal-loose &&
+ ! has_any nonlocal-loose 1.objects
+ '
+
+ test_expect_success 'pack-objects respects --honor-pack-keep (local non-bitmapped pack)' '
+ echo content2 >file2 &&
+ blob2=$(git hash-object -w file2) &&
+ git add file2 &&
+ test_tick &&
+ git commit -m commit_file2 &&
+ printf "%s\n" "$blob2" "$bitmaptip" >keepobjects &&
+ pack2=$(git pack-objects pack2 <keepobjects) &&
+ mv pack2-$pack2.* .git/objects/pack/ &&
+ >.git/objects/pack/pack2-$pack2.keep &&
+ rm $(objpath $blob2) &&
+ echo HEAD | git pack-objects --honor-pack-keep --stdout --revs >2a.pack &&
+ git index-pack 2a.pack &&
+ list_packed_objects 2a.idx >2a.objects &&
+ ! has_any keepobjects 2a.objects
+ '
+
+ test_expect_success 'pack-objects respects --local (non-local pack)' '
+ mv .git/objects/pack/pack2-$pack2.* alt.git/objects/pack/ &&
+ echo HEAD | git pack-objects --local --stdout --revs >2b.pack &&
+ git index-pack 2b.pack &&
+ list_packed_objects 2b.idx >2b.objects &&
+ ! has_any keepobjects 2b.objects
+ '
+
+ test_expect_success 'pack-objects respects --honor-pack-keep (local bitmapped pack)' '
+ ls .git/objects/pack/ | grep bitmap >output &&
+ test_line_count = 1 output &&
+ packbitmap=$(basename $(cat output) .bitmap) &&
+ list_packed_objects .git/objects/pack/$packbitmap.idx >packbitmap.objects &&
+ test_when_finished "rm -f .git/objects/pack/$packbitmap.keep" &&
+ >.git/objects/pack/$packbitmap.keep &&
+ echo HEAD | git pack-objects --honor-pack-keep --stdout --revs >3a.pack &&
+ git index-pack 3a.pack &&
+ list_packed_objects 3a.idx >3a.objects &&
+ ! has_any packbitmap.objects 3a.objects
+ '
+
+ test_expect_success 'pack-objects respects --local (non-local bitmapped pack)' '
+ mv .git/objects/pack/$packbitmap.* alt.git/objects/pack/ &&
+ rm -f .git/objects/pack/multi-pack-index &&
+ test_when_finished "mv alt.git/objects/pack/$packbitmap.* .git/objects/pack/" &&
+ echo HEAD | git pack-objects --local --stdout --revs >3b.pack &&
+ git index-pack 3b.pack &&
+ list_packed_objects 3b.idx >3b.objects &&
+ ! has_any packbitmap.objects 3b.objects
+ '
+
+ test_expect_success 'pack-objects to file can use bitmap' '
+ # make sure we still have 1 bitmap index from previous tests
+ ls .git/objects/pack/ | grep bitmap >output &&
+ test_line_count = 1 output &&
+ # verify equivalent packs are generated with/without using bitmap index
+ packasha1=$(git pack-objects --no-use-bitmap-index --all packa </dev/null) &&
+ packbsha1=$(git pack-objects --use-bitmap-index --all packb </dev/null) &&
+ list_packed_objects packa-$packasha1.idx >packa.objects &&
+ list_packed_objects packb-$packbsha1.idx >packb.objects &&
+ test_cmp packa.objects packb.objects
+ '
+
+ test_expect_success 'full repack, reusing previous bitmaps' '
+ git repack -ad &&
+ ls .git/objects/pack/ | grep bitmap >output &&
+ test_line_count = 1 output
+ '
+
+ test_expect_success 'fetch (full bitmap)' '
+ git --git-dir=clone.git fetch origin second:second &&
+ git rev-parse HEAD >expect &&
+ git --git-dir=clone.git rev-parse HEAD >actual &&
+ test_cmp expect actual
+ '
+
+ test_expect_success 'create objects for missing-HAVE tests' '
+ blob=$(echo "missing have" | git hash-object -w --stdin) &&
+ tree=$(printf "100644 blob $blob\tfile\n" | git mktree) &&
+ parent=$(echo parent | git commit-tree $tree) &&
+ commit=$(echo commit | git commit-tree $tree -p $parent) &&
+ cat >revs <<-EOF
+ HEAD
+ ^HEAD^
+ ^$commit
+ EOF
+ '
+
+ test_expect_success 'pack-objects respects --incremental' '
+ cat >revs2 <<-EOF &&
+ HEAD
+ $commit
+ EOF
+ git pack-objects --incremental --stdout --revs <revs2 >4.pack &&
+ git index-pack 4.pack &&
+ list_packed_objects 4.idx >4.objects &&
+ test_line_count = 4 4.objects &&
+ git rev-list --objects $commit >revlist &&
+ cut -d" " -f1 revlist |sort >objects &&
+ test_cmp 4.objects objects
+ '
+
+ test_expect_success 'pack with missing blob' '
+ rm $(objpath $blob) &&
+ git pack-objects --stdout --revs <revs >/dev/null
+ '
+
+ test_expect_success 'pack with missing tree' '
+ rm $(objpath $tree) &&
+ git pack-objects --stdout --revs <revs >/dev/null
+ '
+
+ test_expect_success 'pack with missing parent' '
+ rm $(objpath $parent) &&
+ git pack-objects --stdout --revs <revs >/dev/null
+ '
+
+ test_expect_success JGIT,SHA1 'we can read jgit bitmaps' '
+ git clone --bare . compat-jgit.git &&
+ (
+ cd compat-jgit.git &&
+ rm -f objects/pack/*.bitmap &&
+ jgit gc &&
+ git rev-list --test-bitmap HEAD
+ )
+ '
+
+ test_expect_success JGIT,SHA1 'jgit can read our bitmaps' '
+ git clone --bare . compat-us.git &&
+ (
+ cd compat-us.git &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
+ git repack -adb &&
+ # jgit gc will barf if it does not like our bitmaps
+ jgit gc
+ )
+ '
+
+ test_expect_success 'splitting packs does not generate bogus bitmaps' '
+ test-tool genrandom foo $((1024 * 1024)) >rand &&
+ git add rand &&
+ git commit -m "commit with big file" &&
+ git -c pack.packSizeLimit=500k repack -adb &&
+ git init --bare no-bitmaps.git &&
+ git -C no-bitmaps.git fetch .. HEAD
+ '
+
+ test_expect_success 'set up reusable pack' '
+ rm -f .git/objects/pack/*.keep &&
+ git repack -adb &&
+ reusable_pack () {
+ git for-each-ref --format="%(objectname)" |
+ git pack-objects --delta-base-offset --revs --stdout "$@"
+ }
+ '
+
+ test_expect_success 'pack reuse respects --honor-pack-keep' '
+ test_when_finished "rm -f .git/objects/pack/*.keep" &&
+ for i in .git/objects/pack/*.pack
+ do
+ >${i%.pack}.keep || return 1
+ done &&
+ reusable_pack --honor-pack-keep >empty.pack &&
+ git index-pack empty.pack &&
+ git show-index <empty.idx >actual &&
+ test_must_be_empty actual
+ '
+
+ test_expect_success 'pack reuse respects --local' '
+ mv .git/objects/pack/* alt.git/objects/pack/ &&
+ test_when_finished "mv alt.git/objects/pack/* .git/objects/pack/" &&
+ reusable_pack --local >empty.pack &&
+ git index-pack empty.pack &&
+ git show-index <empty.idx >actual &&
+ test_must_be_empty actual
+ '
+
+ test_expect_success 'pack reuse respects --incremental' '
+ reusable_pack --incremental >empty.pack &&
+ git index-pack empty.pack &&
+ git show-index <empty.idx >actual &&
+ test_must_be_empty actual
+ '
+
+ test_expect_success 'truncated bitmap fails gracefully (ewah)' '
+ test_config pack.writebitmaphashcache false &&
+ test_config pack.writebitmaplookuptable false &&
+ git repack -ad &&
+ git rev-list --use-bitmap-index --count --all >expect &&
+ bitmap=$(ls .git/objects/pack/*.bitmap) &&
+ test_when_finished "rm -f $bitmap" &&
+ test_copy_bytes 256 <$bitmap >$bitmap.tmp &&
+ mv -f $bitmap.tmp $bitmap &&
+ git rev-list --use-bitmap-index --count --all >actual 2>stderr &&
+ test_cmp expect actual &&
+ test_grep corrupt.ewah.bitmap stderr
+ '
+
+ test_expect_success 'truncated bitmap fails gracefully (cache)' '
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
+ git repack -ad &&
+ git rev-list --use-bitmap-index --count --all >expect &&
+ bitmap=$(ls .git/objects/pack/*.bitmap) &&
+ test_when_finished "rm -f $bitmap" &&
+ test_copy_bytes 512 <$bitmap >$bitmap.tmp &&
+ mv -f $bitmap.tmp $bitmap &&
+ git rev-list --use-bitmap-index --count --all >actual 2>stderr &&
+ test_cmp expect actual &&
+ test_grep corrupted.bitmap.index stderr
+ '
+
+ # Create a state of history with these properties:
+ #
+ # - refs that allow a client to fetch some new history, while sharing some old
+ # history with the server; we use branches delta-reuse-old and
+ # delta-reuse-new here
+ #
+ # - the new history contains an object that is stored on the server as a delta
+ # against a base that is in the old history
+ #
+ # - the base object is not immediately reachable from the tip of the old
+ # history; finding it would involve digging down through history we know the
+ # other side has
+ #
+ # This should result in a state where fetching from old->new would not
+ # traditionally reuse the on-disk delta (because we'd have to dig to realize
+ # that the client has it), but we will do so if bitmaps can tell us cheaply
+ # that the other side has it.
+ test_expect_success 'set up thin delta-reuse parent' '
+ # This first commit contains the buried base object.
+ test-tool genrandom delta 16384 >file &&
+ git add file &&
+ git commit -m "delta base" &&
+ base=$(git rev-parse --verify HEAD:file) &&
+
+ # These intermediate commits bury the base back in history.
+ # This becomes the "old" state.
+ for i in 1 2 3 4 5
+ do
+ echo $i >file &&
+ git commit -am "intermediate $i" || return 1
+ done &&
+ git branch delta-reuse-old &&
+
+ # And now our new history has a delta against the buried base. Note
+ # that this must be smaller than the original file, since pack-objects
+ # prefers to create deltas from smaller objects to larger.
+ test-tool genrandom delta 16300 >file &&
+ git commit -am "delta result" &&
+ delta=$(git rev-parse --verify HEAD:file) &&
+ git branch delta-reuse-new &&
+
+ # Repack with bitmaps and double check that we have the expected delta
+ # relationship.
+ git repack -adb &&
+ have_delta $delta $base
+ '
+
+ # Now we can sanity-check the non-bitmap behavior (that the server is not able
+ # to reuse the delta). This isn't strictly something we care about, so this
+ # test could be scrapped in the future. But it makes sure that the next test is
+ # actually triggering the feature we want.
+ #
+ # Note that our tools for working with on-the-wire "thin" packs are limited. So
+ # we actually perform the fetch, retain the resulting pack, and inspect the
+ # result.
+ test_expect_success 'fetch without bitmaps ignores delta against old base' '
+ test_config pack.usebitmaps false &&
+ test_when_finished "rm -rf client.git" &&
+ git init --bare client.git &&
+ (
+ cd client.git &&
+ git config transfer.unpackLimit 1 &&
+ git fetch .. delta-reuse-old:delta-reuse-old &&
+ git fetch .. delta-reuse-new:delta-reuse-new &&
+ have_delta $delta $ZERO_OID
+ )
+ '
+
+ # And do the same for the bitmap case, where we do expect to find the delta.
+ test_expect_success 'fetch with bitmaps can reuse old base' '
+ test_config pack.usebitmaps true &&
+ test_when_finished "rm -rf client.git" &&
+ git init --bare client.git &&
+ (
+ cd client.git &&
+ git config transfer.unpackLimit 1 &&
+ git fetch .. delta-reuse-old:delta-reuse-old &&
+ git fetch .. delta-reuse-new:delta-reuse-new &&
+ have_delta $delta $base
+ )
+ '
+
+ test_expect_success 'pack.preferBitmapTips' '
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
+
+ # create enough commits that not all are receive bitmap
+ # coverage even if they are all at the tip of some reference.
+ test_commit_bulk --message="%s" 103 &&
+
+ git rev-list HEAD >commits.raw &&
+ sort <commits.raw >commits &&
+
+ git log --format="create refs/tags/%s %H" HEAD >refs &&
+ git update-ref --stdin <refs &&
+
+ git repack -adb &&
+ test-tool bitmap list-commits | sort >bitmaps &&
+
+ # remember which commits did not receive bitmaps
+ comm -13 bitmaps commits >before &&
+ test_file_not_empty before &&
+
+ # mark the commits which did not receive bitmaps as preferred,
+ # and generate the bitmap again
+ perl -pe "s{^}{create refs/tags/include/$. }" <before |
+ git update-ref --stdin &&
+ git -c pack.preferBitmapTips=refs/tags/include repack -adb &&
+
+ # finally, check that the commit(s) without bitmap coverage
+ # are not the same ones as before
+ test-tool bitmap list-commits | sort >bitmaps &&
+ comm -13 bitmaps commits >after &&
+
+ ! test_cmp before after
+ )
+ '
+
+ test_expect_success 'pack.preferBitmapTips' '
+ git init repo &&
+ test_when_finished "rm -rf repo" &&
+ (
+ cd repo &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
+ test_commit_bulk --message="%s" 103 &&
+
+ cat >>.git/config <<-\EOF &&
+ [pack]
+ preferBitmapTips
+ EOF
+ cat >expect <<-\EOF &&
+ error: missing value for '\''pack.preferbitmaptips'\''
+ EOF
+ git repack -adb 2>actual &&
+ test_cmp expect actual
+ )
+ '
+
+ test_expect_success 'complains about multiple pack bitmaps' '
+ rm -fr repo &&
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
+
+ test_commit base &&
+
+ git repack -adb &&
+ bitmap="$(ls .git/objects/pack/pack-*.bitmap)" &&
+ mv "$bitmap" "$bitmap.bak" &&
+
+ test_commit other &&
+ git repack -ab &&
+
+ mv "$bitmap.bak" "$bitmap" &&
+
+ find .git/objects/pack -type f -name "*.pack" >packs &&
+ find .git/objects/pack -type f -name "*.bitmap" >bitmaps &&
+ test_line_count = 2 packs &&
+ test_line_count = 2 bitmaps &&
+
+ GIT_TRACE2_EVENT=$(pwd)/trace2.txt git rev-list --use-bitmap-index HEAD &&
+ grep "opened bitmap" trace2.txt &&
+ grep "ignoring extra bitmap" trace2.txt
+ )
+ '
+}
-test_expect_success 'setup writing bitmaps during repack' '
- git config repack.writeBitmaps true
-'
+test_bitmap_cases
-test_expect_success 'full repack creates bitmaps' '
- GIT_TRACE2_EVENT="$(pwd)/trace" \
- git repack -ad &&
- ls .git/objects/pack/ | grep bitmap >output &&
- test_line_count = 1 output &&
- grep "\"key\":\"num_selected_commits\",\"value\":\"106\"" trace &&
- grep "\"key\":\"num_maximal_commits\",\"value\":\"107\"" trace
-'
+GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL=1
+export GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL
-basic_bitmap_tests
+test_bitmap_cases
+
+sane_unset GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL
test_expect_success 'incremental repack fails when bitmaps are requested' '
test_commit more-1 &&
test_must_fail git repack -d 2>err &&
- test_i18ngrep "Incremental repacks are incompatible with bitmap" err
+ test_grep "Incremental repacks are incompatible with bitmap" err
'
test_expect_success 'incremental repack can disable bitmaps' '
@@ -54,219 +479,44 @@ test_expect_success 'incremental repack can disable bitmaps' '
git repack -d --no-write-bitmap-index
'
-test_expect_success 'pack-objects respects --local (non-local loose)' '
- git init --bare alt.git &&
- echo $(pwd)/alt.git/objects >.git/objects/info/alternates &&
- echo content1 >file1 &&
- # non-local loose object which is not present in bitmapped pack
- altblob=$(GIT_DIR=alt.git git hash-object -w file1) &&
- # non-local loose object which is also present in bitmapped pack
- git cat-file blob $blob | GIT_DIR=alt.git git hash-object -w --stdin &&
- git add file1 &&
- test_tick &&
- git commit -m commit_file1 &&
- echo HEAD | git pack-objects --local --stdout --revs >1.pack &&
- git index-pack 1.pack &&
- list_packed_objects 1.idx >1.objects &&
- printf "%s\n" "$altblob" "$blob" >nonlocal-loose &&
- ! has_any nonlocal-loose 1.objects
-'
-
-test_expect_success 'pack-objects respects --honor-pack-keep (local non-bitmapped pack)' '
- echo content2 >file2 &&
- blob2=$(git hash-object -w file2) &&
- git add file2 &&
- test_tick &&
- git commit -m commit_file2 &&
- printf "%s\n" "$blob2" "$bitmaptip" >keepobjects &&
- pack2=$(git pack-objects pack2 <keepobjects) &&
- mv pack2-$pack2.* .git/objects/pack/ &&
- >.git/objects/pack/pack2-$pack2.keep &&
- rm $(objpath $blob2) &&
- echo HEAD | git pack-objects --honor-pack-keep --stdout --revs >2a.pack &&
- git index-pack 2a.pack &&
- list_packed_objects 2a.idx >2a.objects &&
- ! has_any keepobjects 2a.objects
-'
-
-test_expect_success 'pack-objects respects --local (non-local pack)' '
- mv .git/objects/pack/pack2-$pack2.* alt.git/objects/pack/ &&
- echo HEAD | git pack-objects --local --stdout --revs >2b.pack &&
- git index-pack 2b.pack &&
- list_packed_objects 2b.idx >2b.objects &&
- ! has_any keepobjects 2b.objects
-'
-
-test_expect_success 'pack-objects respects --honor-pack-keep (local bitmapped pack)' '
- ls .git/objects/pack/ | grep bitmap >output &&
- test_line_count = 1 output &&
- packbitmap=$(basename $(cat output) .bitmap) &&
- list_packed_objects .git/objects/pack/$packbitmap.idx >packbitmap.objects &&
- test_when_finished "rm -f .git/objects/pack/$packbitmap.keep" &&
- >.git/objects/pack/$packbitmap.keep &&
- echo HEAD | git pack-objects --honor-pack-keep --stdout --revs >3a.pack &&
- git index-pack 3a.pack &&
- list_packed_objects 3a.idx >3a.objects &&
- ! has_any packbitmap.objects 3a.objects
-'
-
-test_expect_success 'pack-objects respects --local (non-local bitmapped pack)' '
- mv .git/objects/pack/$packbitmap.* alt.git/objects/pack/ &&
- rm -f .git/objects/pack/multi-pack-index &&
- test_when_finished "mv alt.git/objects/pack/$packbitmap.* .git/objects/pack/" &&
- echo HEAD | git pack-objects --local --stdout --revs >3b.pack &&
- git index-pack 3b.pack &&
- list_packed_objects 3b.idx >3b.objects &&
- ! has_any packbitmap.objects 3b.objects
-'
-
-test_expect_success 'pack-objects to file can use bitmap' '
- # make sure we still have 1 bitmap index from previous tests
- ls .git/objects/pack/ | grep bitmap >output &&
- test_line_count = 1 output &&
- # verify equivalent packs are generated with/without using bitmap index
- packasha1=$(git pack-objects --no-use-bitmap-index --all packa </dev/null) &&
- packbsha1=$(git pack-objects --use-bitmap-index --all packb </dev/null) &&
- list_packed_objects packa-$packasha1.idx >packa.objects &&
- list_packed_objects packb-$packbsha1.idx >packb.objects &&
- test_cmp packa.objects packb.objects
-'
-
-test_expect_success 'full repack, reusing previous bitmaps' '
- git repack -ad &&
- ls .git/objects/pack/ | grep bitmap >output &&
- test_line_count = 1 output
-'
-
-test_expect_success 'fetch (full bitmap)' '
- git --git-dir=clone.git fetch origin second:second &&
- git rev-parse HEAD >expect &&
- git --git-dir=clone.git rev-parse HEAD >actual &&
- test_cmp expect actual
-'
-
-test_expect_success 'create objects for missing-HAVE tests' '
- blob=$(echo "missing have" | git hash-object -w --stdin) &&
- tree=$(printf "100644 blob $blob\tfile\n" | git mktree) &&
- parent=$(echo parent | git commit-tree $tree) &&
- commit=$(echo commit | git commit-tree $tree -p $parent) &&
- cat >revs <<-EOF
- HEAD
- ^HEAD^
- ^$commit
- EOF
-'
-
-test_expect_success 'pack-objects respects --incremental' '
- cat >revs2 <<-EOF &&
- HEAD
- $commit
- EOF
- git pack-objects --incremental --stdout --revs <revs2 >4.pack &&
- git index-pack 4.pack &&
- list_packed_objects 4.idx >4.objects &&
- test_line_count = 4 4.objects &&
- git rev-list --objects $commit >revlist &&
- cut -d" " -f1 revlist |sort >objects &&
- test_cmp 4.objects objects
-'
+test_expect_success 'boundary-based traversal is used when requested' '
+ git repack -a -d --write-bitmap-index &&
-test_expect_success 'pack with missing blob' '
- rm $(objpath $blob) &&
- git pack-objects --stdout --revs <revs >/dev/null
-'
-
-test_expect_success 'pack with missing tree' '
- rm $(objpath $tree) &&
- git pack-objects --stdout --revs <revs >/dev/null
-'
-
-test_expect_success 'pack with missing parent' '
- rm $(objpath $parent) &&
- git pack-objects --stdout --revs <revs >/dev/null
-'
-
-test_expect_success JGIT,SHA1 'we can read jgit bitmaps' '
- git clone --bare . compat-jgit.git &&
- (
- cd compat-jgit.git &&
- rm -f objects/pack/*.bitmap &&
- jgit gc &&
- git rev-list --test-bitmap HEAD
- )
-'
-
-test_expect_success JGIT,SHA1 'jgit can read our bitmaps' '
- git clone --bare . compat-us.git &&
- (
- cd compat-us.git &&
- git repack -adb &&
- # jgit gc will barf if it does not like our bitmaps
- jgit gc
- )
-'
-
-test_expect_success 'splitting packs does not generate bogus bitmaps' '
- test-tool genrandom foo $((1024 * 1024)) >rand &&
- git add rand &&
- git commit -m "commit with big file" &&
- git -c pack.packSizeLimit=500k repack -adb &&
- git init --bare no-bitmaps.git &&
- git -C no-bitmaps.git fetch .. HEAD
-'
-
-test_expect_success 'set up reusable pack' '
- rm -f .git/objects/pack/*.keep &&
- git repack -adb &&
- reusable_pack () {
- git for-each-ref --format="%(objectname)" |
- git pack-objects --delta-base-offset --revs --stdout "$@"
- }
-'
-
-test_expect_success 'pack reuse respects --honor-pack-keep' '
- test_when_finished "rm -f .git/objects/pack/*.keep" &&
- for i in .git/objects/pack/*.pack
+ for argv in \
+ "git -c pack.useBitmapBoundaryTraversal=true" \
+ "git -c feature.experimental=true" \
+ "GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL=1 git"
do
- >${i%.pack}.keep || return 1
+ eval "GIT_TRACE2_EVENT=1 $argv rev-list --objects \
+ --use-bitmap-index second..other 2>perf" &&
+ grep "\"region_enter\".*\"label\":\"haves/boundary\"" perf ||
+ return 1
done &&
- reusable_pack --honor-pack-keep >empty.pack &&
- git index-pack empty.pack &&
- git show-index <empty.idx >actual &&
- test_must_be_empty actual
-'
-test_expect_success 'pack reuse respects --local' '
- mv .git/objects/pack/* alt.git/objects/pack/ &&
- test_when_finished "mv alt.git/objects/pack/* .git/objects/pack/" &&
- reusable_pack --local >empty.pack &&
- git index-pack empty.pack &&
- git show-index <empty.idx >actual &&
- test_must_be_empty actual
+ for argv in \
+ "git -c pack.useBitmapBoundaryTraversal=false" \
+ "git -c feature.experimental=true -c pack.useBitmapBoundaryTraversal=false" \
+ "GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL=0 git -c pack.useBitmapBoundaryTraversal=true" \
+ "GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL=0 git -c feature.experimental=true"
+ do
+ eval "GIT_TRACE2_EVENT=1 $argv rev-list --objects \
+ --use-bitmap-index second..other 2>perf" &&
+ grep "\"region_enter\".*\"label\":\"haves/classic\"" perf ||
+ return 1
+ done
'
-test_expect_success 'pack reuse respects --incremental' '
- reusable_pack --incremental >empty.pack &&
- git index-pack empty.pack &&
- git show-index <empty.idx >actual &&
- test_must_be_empty actual
-'
+test_bitmap_cases "pack.writeBitmapLookupTable"
-test_expect_success 'truncated bitmap fails gracefully (ewah)' '
- test_config pack.writebitmaphashcache false &&
- git repack -ad &&
- git rev-list --use-bitmap-index --count --all >expect &&
- bitmap=$(ls .git/objects/pack/*.bitmap) &&
- test_when_finished "rm -f $bitmap" &&
- test_copy_bytes 256 <$bitmap >$bitmap.tmp &&
- mv -f $bitmap.tmp $bitmap &&
- git rev-list --use-bitmap-index --count --all >actual 2>stderr &&
- test_cmp expect actual &&
- test_i18ngrep corrupt.ewah.bitmap stderr
+test_expect_success 'verify writing bitmap lookup table when enabled' '
+ GIT_TRACE2_EVENT="$(pwd)/trace2" \
+ git repack -ad &&
+ grep "\"label\":\"writing_lookup_table\"" trace2
'
-test_expect_success 'truncated bitmap fails gracefully (cache)' '
- git repack -ad &&
+test_expect_success 'truncated bitmap fails gracefully (lookup table)' '
+ test_config pack.writebitmaphashcache false &&
+ git repack -adb &&
git rev-list --use-bitmap-index --count --all >expect &&
bitmap=$(ls .git/objects/pack/*.bitmap) &&
test_when_finished "rm -f $bitmap" &&
@@ -274,155 +524,7 @@ test_expect_success 'truncated bitmap fails gracefully (cache)' '
mv -f $bitmap.tmp $bitmap &&
git rev-list --use-bitmap-index --count --all >actual 2>stderr &&
test_cmp expect actual &&
- test_i18ngrep corrupted.bitmap.index stderr
-'
-
-# Create a state of history with these properties:
-#
-# - refs that allow a client to fetch some new history, while sharing some old
-# history with the server; we use branches delta-reuse-old and
-# delta-reuse-new here
-#
-# - the new history contains an object that is stored on the server as a delta
-# against a base that is in the old history
-#
-# - the base object is not immediately reachable from the tip of the old
-# history; finding it would involve digging down through history we know the
-# other side has
-#
-# This should result in a state where fetching from old->new would not
-# traditionally reuse the on-disk delta (because we'd have to dig to realize
-# that the client has it), but we will do so if bitmaps can tell us cheaply
-# that the other side has it.
-test_expect_success 'set up thin delta-reuse parent' '
- # This first commit contains the buried base object.
- test-tool genrandom delta 16384 >file &&
- git add file &&
- git commit -m "delta base" &&
- base=$(git rev-parse --verify HEAD:file) &&
-
- # These intermediate commits bury the base back in history.
- # This becomes the "old" state.
- for i in 1 2 3 4 5
- do
- echo $i >file &&
- git commit -am "intermediate $i" || return 1
- done &&
- git branch delta-reuse-old &&
-
- # And now our new history has a delta against the buried base. Note
- # that this must be smaller than the original file, since pack-objects
- # prefers to create deltas from smaller objects to larger.
- test-tool genrandom delta 16300 >file &&
- git commit -am "delta result" &&
- delta=$(git rev-parse --verify HEAD:file) &&
- git branch delta-reuse-new &&
-
- # Repack with bitmaps and double check that we have the expected delta
- # relationship.
- git repack -adb &&
- have_delta $delta $base
-'
-
-# Now we can sanity-check the non-bitmap behavior (that the server is not able
-# to reuse the delta). This isn't strictly something we care about, so this
-# test could be scrapped in the future. But it makes sure that the next test is
-# actually triggering the feature we want.
-#
-# Note that our tools for working with on-the-wire "thin" packs are limited. So
-# we actually perform the fetch, retain the resulting pack, and inspect the
-# result.
-test_expect_success 'fetch without bitmaps ignores delta against old base' '
- test_config pack.usebitmaps false &&
- test_when_finished "rm -rf client.git" &&
- git init --bare client.git &&
- (
- cd client.git &&
- git config transfer.unpackLimit 1 &&
- git fetch .. delta-reuse-old:delta-reuse-old &&
- git fetch .. delta-reuse-new:delta-reuse-new &&
- have_delta $delta $ZERO_OID
- )
-'
-
-# And do the same for the bitmap case, where we do expect to find the delta.
-test_expect_success 'fetch with bitmaps can reuse old base' '
- test_config pack.usebitmaps true &&
- test_when_finished "rm -rf client.git" &&
- git init --bare client.git &&
- (
- cd client.git &&
- git config transfer.unpackLimit 1 &&
- git fetch .. delta-reuse-old:delta-reuse-old &&
- git fetch .. delta-reuse-new:delta-reuse-new &&
- have_delta $delta $base
- )
-'
-
-test_expect_success 'pack.preferBitmapTips' '
- git init repo &&
- test_when_finished "rm -fr repo" &&
- (
- cd repo &&
-
- # create enough commits that not all are receive bitmap
- # coverage even if they are all at the tip of some reference.
- test_commit_bulk --message="%s" 103 &&
-
- git rev-list HEAD >commits.raw &&
- sort <commits.raw >commits &&
-
- git log --format="create refs/tags/%s %H" HEAD >refs &&
- git update-ref --stdin <refs &&
-
- git repack -adb &&
- test-tool bitmap list-commits | sort >bitmaps &&
-
- # remember which commits did not receive bitmaps
- comm -13 bitmaps commits >before &&
- test_file_not_empty before &&
-
- # mark the commits which did not receive bitmaps as preferred,
- # and generate the bitmap again
- perl -pe "s{^}{create refs/tags/include/$. }" <before |
- git update-ref --stdin &&
- git -c pack.preferBitmapTips=refs/tags/include repack -adb &&
-
- # finally, check that the commit(s) without bitmap coverage
- # are not the same ones as before
- test-tool bitmap list-commits | sort >bitmaps &&
- comm -13 bitmaps commits >after &&
-
- ! test_cmp before after
- )
-'
-
-test_expect_success 'complains about multiple pack bitmaps' '
- rm -fr repo &&
- git init repo &&
- test_when_finished "rm -fr repo" &&
- (
- cd repo &&
-
- test_commit base &&
-
- git repack -adb &&
- bitmap="$(ls .git/objects/pack/pack-*.bitmap)" &&
- mv "$bitmap" "$bitmap.bak" &&
-
- test_commit other &&
- git repack -ab &&
-
- mv "$bitmap.bak" "$bitmap" &&
-
- find .git/objects/pack -type f -name "*.pack" >packs &&
- find .git/objects/pack -type f -name "*.bitmap" >bitmaps &&
- test_line_count = 2 packs &&
- test_line_count = 2 bitmaps &&
-
- git rev-list --use-bitmap-index HEAD 2>err &&
- grep "ignoring extra bitmap file" err
- )
+ test_grep corrupted.bitmap.index stderr
'
test_done
diff --git a/t/t5311-pack-bitmaps-shallow.sh b/t/t5311-pack-bitmaps-shallow.sh
index 872a95d..4fe71fe 100755
--- a/t/t5311-pack-bitmaps-shallow.sh
+++ b/t/t5311-pack-bitmaps-shallow.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='check bitmap operation with shallow repositories'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# We want to create a situation where the shallow, grafted
@@ -17,23 +19,40 @@ test_description='check bitmap operation with shallow repositories'
# the tree for A. But in a shallow one, we've grafted away
# A, and fetching A to B requires that the other side send
# us the tree for file=1.
-test_expect_success 'setup shallow repo' '
- echo 1 >file &&
- git add file &&
- git commit -m orig &&
- echo 2 >file &&
- git commit -a -m update &&
- git clone --no-local --bare --depth=1 . shallow.git &&
- echo 1 >file &&
- git commit -a -m repeat
-'
-
-test_expect_success 'turn on bitmaps in the parent' '
- git repack -adb
-'
-
-test_expect_success 'shallow fetch from bitmapped repo' '
- (cd shallow.git && git fetch)
-'
+test_shallow_bitmaps () {
+ writeLookupTable=false
+
+ for i in "$@"
+ do
+ case $i in
+ "pack.writeBitmapLookupTable") writeLookupTable=true;;
+ esac
+ done
+
+ test_expect_success 'setup shallow repo' '
+ rm -rf * .git &&
+ git init &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
+ echo 1 >file &&
+ git add file &&
+ git commit -m orig &&
+ echo 2 >file &&
+ git commit -a -m update &&
+ git clone --no-local --bare --depth=1 . shallow.git &&
+ echo 1 >file &&
+ git commit -a -m repeat
+ '
+
+ test_expect_success 'turn on bitmaps in the parent' '
+ git repack -adb
+ '
+
+ test_expect_success 'shallow fetch from bitmapped repo' '
+ (cd shallow.git && git fetch)
+ '
+}
+
+test_shallow_bitmaps
+test_shallow_bitmaps "pack.writeBitmapLookupTable"
test_done
diff --git a/t/t5312-prune-corruption.sh b/t/t5312-prune-corruption.sh
index 9d8e249..d8d2e30 100755
--- a/t/t5312-prune-corruption.sh
+++ b/t/t5312-prune-corruption.sh
@@ -14,6 +14,7 @@ what currently happens. If that changes, these tests should be revisited.
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'disable reflogs' '
@@ -110,30 +111,4 @@ test_expect_success 'pack-refs does not silently delete broken loose ref' '
test_cmp expect actual
'
-# we do not want to count on running pack-refs to
-# actually pack it, as it is perfectly reasonable to
-# skip processing a broken ref
-test_expect_success REFFILES 'create packed-refs file with broken ref' '
- rm -f .git/refs/heads/main &&
- cat >.git/packed-refs <<-EOF &&
- $missing refs/heads/main
- $recoverable refs/heads/other
- EOF
- echo $missing >expect &&
- git rev-parse refs/heads/main >actual &&
- test_cmp expect actual
-'
-
-test_expect_success REFFILES 'pack-refs does not silently delete broken packed ref' '
- git pack-refs --all --prune &&
- git rev-parse refs/heads/main >actual &&
- test_cmp expect actual
-'
-
-test_expect_success REFFILES 'pack-refs does not drop broken refs during deletion' '
- git update-ref -d refs/heads/other &&
- git rev-parse refs/heads/main >actual &&
- test_cmp expect actual
-'
-
test_done
diff --git a/t/t5313-pack-bounds-checks.sh b/t/t5313-pack-bounds-checks.sh
index cc4cfaa..ceaa670 100755
--- a/t/t5313-pack-bounds-checks.sh
+++ b/t/t5313-pack-bounds-checks.sh
@@ -59,7 +59,7 @@ test_expect_success 'setup' '
test_expect_success 'set up base packfile and variables' '
# the hash of this content starts with ff, which
# makes some later computations much simpler
- echo $(test_oid oidfff) >file &&
+ test_oid oidfff >file &&
git add file &&
git commit -m base &&
git repack -ad &&
diff --git a/t/t5314-pack-cycle-detection.sh b/t/t5314-pack-cycle-detection.sh
index 0aec861..82734b9 100755
--- a/t/t5314-pack-cycle-detection.sh
+++ b/t/t5314-pack-cycle-detection.sh
@@ -49,9 +49,9 @@ Then no matter which order we start looking at the packs in, we know that we
will always find a delta for "file", because its lookup will always come
immediately after the lookup for "dummy".
'
-. ./test-lib.sh
-
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
# Create a pack containing the tree $1 and blob $1:file, with
# the latter stored as a delta against $2:file.
@@ -63,13 +63,16 @@ immediately after the lookup for "dummy".
# Note that the two variants of "file" must be similar enough to convince git
# to create the delta.
make_pack () {
- {
- printf '%s\n' "-$(git rev-parse $2)"
- printf '%s dummy\n' "$(git rev-parse $1:dummy)"
- printf '%s file\n' "$(git rev-parse $1:file)"
- } |
- git pack-objects --stdout |
- git index-pack --stdin --fix-thin
+ ln1=$(git rev-parse "$2") &&
+ ln2=$(git rev-parse "$1:dummy") &&
+ ln3=$(git rev-parse "$1:file") &&
+ cat >list <<-EOF
+ -$ln1
+ $ln2 dummy
+ $ln3 file
+ EOF
+ git pack-objects --stdout <list >pack &&
+ git index-pack --stdin --fix-thin <pack
}
test_expect_success 'setup' '
diff --git a/t/t5315-pack-objects-compression.sh b/t/t5315-pack-objects-compression.sh
index 8bacd96..c80ea9e 100755
--- a/t/t5315-pack-objects-compression.sh
+++ b/t/t5315-pack-objects-compression.sh
@@ -2,6 +2,7 @@
test_description='pack-object compression configuration'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh
index bb633c9..79552d6 100755
--- a/t/t5317-pack-objects-filter-objects.sh
+++ b/t/t5317-pack-objects-filter-objects.sh
@@ -5,6 +5,7 @@ test_description='git pack-objects using object filtering'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# Test blob:none filter.
@@ -24,8 +25,9 @@ parse_verify_pack_blob_oid () {
}
test_expect_success 'verify blob count in normal packfile' '
- git -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |
- test_parse_ls_files_stage_oids |
+ git -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \
+ >ls_files_result &&
+ test_parse_ls_files_stage_oids <ls_files_result |
sort >expected &&
git -C r1 pack-objects --revs --stdout >all.pack <<-EOF &&
@@ -51,6 +53,14 @@ test_expect_success 'verify blob:none packfile has no blobs' '
! grep blob verify_result
'
+test_expect_success 'verify blob:none packfile without --stdout' '
+ git -C r1 pack-objects --revs --filter=blob:none mypackname >packhash <<-EOF &&
+ HEAD
+ EOF
+ git -C r1 verify-pack -v "mypackname-$(cat packhash).pack" >verify_result &&
+ ! grep blob verify_result
+'
+
test_expect_success 'verify normal and blob:none packfiles have same commits/trees' '
git -C r1 verify-pack -v ../all.pack >verify_result &&
grep -E "commit|tree" verify_result |
@@ -123,8 +133,8 @@ test_expect_success 'setup r2' '
'
test_expect_success 'verify blob count in normal packfile' '
- git -C r2 ls-files -s large.1000 large.10000 |
- test_parse_ls_files_stage_oids |
+ git -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&
+ test_parse_ls_files_stage_oids <ls_files_result |
sort >expected &&
git -C r2 pack-objects --revs --stdout >all.pack <<-EOF &&
@@ -161,8 +171,8 @@ test_expect_success 'verify blob:limit=1000' '
'
test_expect_success 'verify blob:limit=1001' '
- git -C r2 ls-files -s large.1000 |
- test_parse_ls_files_stage_oids |
+ git -C r2 ls-files -s large.1000 >ls_files_result &&
+ test_parse_ls_files_stage_oids <ls_files_result |
sort >expected &&
git -C r2 pack-objects --revs --stdout --filter=blob:limit=1001 >filter.pack <<-EOF &&
@@ -179,8 +189,8 @@ test_expect_success 'verify blob:limit=1001' '
'
test_expect_success 'verify blob:limit=10001' '
- git -C r2 ls-files -s large.1000 large.10000 |
- test_parse_ls_files_stage_oids |
+ git -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&
+ test_parse_ls_files_stage_oids <ls_files_result |
sort >expected &&
git -C r2 pack-objects --revs --stdout --filter=blob:limit=10001 >filter.pack <<-EOF &&
@@ -197,8 +207,8 @@ test_expect_success 'verify blob:limit=10001' '
'
test_expect_success 'verify blob:limit=1k' '
- git -C r2 ls-files -s large.1000 |
- test_parse_ls_files_stage_oids |
+ git -C r2 ls-files -s large.1000 >ls_files_result &&
+ test_parse_ls_files_stage_oids <ls_files_result |
sort >expected &&
git -C r2 pack-objects --revs --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&
@@ -215,8 +225,8 @@ test_expect_success 'verify blob:limit=1k' '
'
test_expect_success 'verify explicitly specifying oversized blob in input' '
- git -C r2 ls-files -s large.1000 large.10000 |
- test_parse_ls_files_stage_oids |
+ git -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&
+ test_parse_ls_files_stage_oids <ls_files_result |
sort >expected &&
echo HEAD >objects &&
@@ -233,8 +243,8 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '
'
test_expect_success 'verify blob:limit=1m' '
- git -C r2 ls-files -s large.1000 large.10000 |
- test_parse_ls_files_stage_oids |
+ git -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&
+ test_parse_ls_files_stage_oids <ls_files_result |
sort >expected &&
git -C r2 pack-objects --revs --stdout --filter=blob:limit=1m >filter.pack <<-EOF &&
@@ -264,6 +274,44 @@ test_expect_success 'verify normal and blob:limit packfiles have same commits/tr
test_cmp expected observed
'
+test_expect_success 'verify small limit and big limit results in small limit' '
+ git -C r2 ls-files -s large.1000 >ls_files_result &&
+ test_parse_ls_files_stage_oids <ls_files_result |
+ sort >expected &&
+
+ git -C r2 pack-objects --revs --stdout --filter=blob:limit=1001 \
+ --filter=blob:limit=10001 >filter.pack <<-EOF &&
+ HEAD
+ EOF
+ git -C r2 index-pack ../filter.pack &&
+
+ git -C r2 verify-pack -v ../filter.pack >verify_result &&
+ grep blob verify_result |
+ parse_verify_pack_blob_oid |
+ sort >observed &&
+
+ test_cmp expected observed
+'
+
+test_expect_success 'verify big limit and small limit results in small limit' '
+ git -C r2 ls-files -s large.1000 >ls_files_result &&
+ test_parse_ls_files_stage_oids <ls_files_result |
+ sort >expected &&
+
+ git -C r2 pack-objects --revs --stdout --filter=blob:limit=10001 \
+ --filter=blob:limit=1001 >filter.pack <<-EOF &&
+ HEAD
+ EOF
+ git -C r2 index-pack ../filter.pack &&
+
+ git -C r2 verify-pack -v ../filter.pack >verify_result &&
+ grep blob verify_result |
+ parse_verify_pack_blob_oid |
+ sort >observed &&
+
+ test_cmp expected observed
+'
+
# Test sparse:path=<path> filter.
# !!!!
# NOTE: sparse:path filter support has been dropped for security reasons,
@@ -289,8 +337,9 @@ test_expect_success 'setup r3' '
'
test_expect_success 'verify blob count in normal packfile' '
- git -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 |
- test_parse_ls_files_stage_oids |
+ git -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 \
+ >ls_files_result &&
+ test_parse_ls_files_stage_oids <ls_files_result |
sort >expected &&
git -C r3 pack-objects --revs --stdout >all.pack <<-EOF &&
@@ -341,8 +390,9 @@ test_expect_success 'setup r4' '
'
test_expect_success 'verify blob count in normal packfile' '
- git -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 |
- test_parse_ls_files_stage_oids |
+ git -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 \
+ >ls_files_result &&
+ test_parse_ls_files_stage_oids <ls_files_result |
sort >expected &&
git -C r4 pack-objects --revs --stdout >all.pack <<-EOF &&
@@ -359,8 +409,8 @@ test_expect_success 'verify blob count in normal packfile' '
'
test_expect_success 'verify sparse:oid=OID' '
- git -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |
- test_parse_ls_files_stage_oids |
+ git -C r4 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&
+ test_parse_ls_files_stage_oids <ls_files_result |
sort >expected &&
git -C r4 ls-files -s pattern >staged &&
@@ -379,8 +429,8 @@ test_expect_success 'verify sparse:oid=OID' '
'
test_expect_success 'verify sparse:oid=oid-ish' '
- git -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |
- test_parse_ls_files_stage_oids |
+ git -C r4 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&
+ test_parse_ls_files_stage_oids <ls_files_result |
sort >expected &&
git -C r4 pack-objects --revs --stdout --filter=sparse:oid=main:pattern >filter.pack <<-EOF &&
@@ -400,11 +450,12 @@ test_expect_success 'verify sparse:oid=oid-ish' '
# This models previously omitted objects that we did not receive.
test_expect_success 'setup r1 - delete loose blobs' '
- git -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |
- test_parse_ls_files_stage_oids |
+ git -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \
+ >ls_files_result &&
+ test_parse_ls_files_stage_oids <ls_files_result |
sort >expected &&
- for id in `cat expected | sed "s|..|&/|"`
+ for id in `sed "s|..|&/|" expected`
do
rm r1/.git/objects/$id || return 1
done
diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh
index db89542..a2b4442 100755
--- a/t/t5318-commit-graph.sh
+++ b/t/t5318-commit-graph.sh
@@ -2,6 +2,7 @@
test_description='commit graph'
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-chunk.sh
GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=0
@@ -12,24 +13,22 @@ test_expect_success 'usage' '
test_expect_success 'usage shown without sub-command' '
test_expect_code 129 git commit-graph 2>err &&
- ! grep error: err
+ grep usage: err
'
test_expect_success 'usage shown with an error on unknown sub-command' '
cat >expect <<-\EOF &&
- error: unrecognized subcommand: unknown
+ error: unknown subcommand: `unknown'\''
EOF
test_expect_code 129 git commit-graph unknown 2>stderr &&
grep error stderr >actual &&
test_cmp expect actual
'
+objdir=".git/objects"
+
test_expect_success 'setup full repo' '
- mkdir full &&
- cd "$TRASH_DIRECTORY/full" &&
- git init &&
- git config core.commitGraph true &&
- objdir=".git/objects"
+ git init full
'
test_expect_success POSIXPERM 'tweak umask for modebit tests' '
@@ -37,31 +36,28 @@ test_expect_success POSIXPERM 'tweak umask for modebit tests' '
'
test_expect_success 'verify graph with no graph file' '
- cd "$TRASH_DIRECTORY/full" &&
- git commit-graph verify
+ git -C full commit-graph verify
'
test_expect_success 'write graph with no packs' '
- cd "$TRASH_DIRECTORY/full" &&
- git commit-graph write --object-dir $objdir &&
- test_path_is_missing $objdir/info/commit-graph
+ git -C full commit-graph write --object-dir $objdir &&
+ test_path_is_missing full/$objdir/info/commit-graph
'
test_expect_success 'exit with correct error on bad input to --stdin-packs' '
- cd "$TRASH_DIRECTORY/full" &&
echo doesnotexist >in &&
- test_expect_code 1 git commit-graph write --stdin-packs <in 2>stderr &&
- test_i18ngrep "error adding pack" stderr
+ test_expect_code 1 git -C full commit-graph write --stdin-packs \
+ <in 2>stderr &&
+ test_grep "error adding pack" stderr
'
test_expect_success 'create commits and repack' '
- cd "$TRASH_DIRECTORY/full" &&
for i in $(test_seq 3)
do
- test_commit $i &&
- git branch commits/$i || return 1
+ test_commit -C full $i &&
+ git -C full branch commits/$i || return 1
done &&
- git repack
+ git -C full repack
'
. "$TEST_DIRECTORY"/lib-commit-graph.sh
@@ -69,117 +65,106 @@ test_expect_success 'create commits and repack' '
graph_git_behavior 'no graph' full commits/3 commits/1
test_expect_success 'exit with correct error on bad input to --stdin-commits' '
- cd "$TRASH_DIRECTORY/full" &&
# invalid, non-hex OID
- echo HEAD >in &&
- test_expect_code 1 git commit-graph write --stdin-commits <in 2>stderr &&
- test_i18ngrep "unexpected non-hex object ID: HEAD" stderr &&
+ echo HEAD | test_expect_code 1 git -C full commit-graph write \
+ --stdin-commits 2>stderr &&
+ test_grep "unexpected non-hex object ID: HEAD" stderr &&
# non-existent OID
- echo $ZERO_OID >in &&
- test_expect_code 1 git commit-graph write --stdin-commits <in 2>stderr &&
- test_i18ngrep "invalid object" stderr &&
+ echo $ZERO_OID | test_expect_code 1 git -C full commit-graph write \
+ --stdin-commits 2>stderr &&
+ test_grep "invalid object" stderr &&
# valid commit and tree OID
- git rev-parse HEAD HEAD^{tree} >in &&
- git commit-graph write --stdin-commits <in &&
- graph_read_expect 3 generation_data
+ git -C full rev-parse HEAD HEAD^{tree} >in &&
+ git -C full commit-graph write --stdin-commits <in &&
+ graph_read_expect -C full 3 generation_data
'
test_expect_success 'write graph' '
- cd "$TRASH_DIRECTORY/full" &&
- git commit-graph write &&
- test_path_is_file $objdir/info/commit-graph &&
- graph_read_expect "3" generation_data
+ git -C full commit-graph write &&
+ test_path_is_file full/$objdir/info/commit-graph &&
+ graph_read_expect -C full 3 generation_data
'
test_expect_success POSIXPERM 'write graph has correct permissions' '
- test_path_is_file $objdir/info/commit-graph &&
+ test_path_is_file full/$objdir/info/commit-graph &&
echo "-r--r--r--" >expect &&
- test_modebits $objdir/info/commit-graph >actual &&
+ test_modebits full/$objdir/info/commit-graph >actual &&
test_cmp expect actual
'
graph_git_behavior 'graph exists' full commits/3 commits/1
test_expect_success 'Add more commits' '
- cd "$TRASH_DIRECTORY/full" &&
- git reset --hard commits/1 &&
+ git -C full reset --hard commits/1 &&
for i in $(test_seq 4 5)
do
- test_commit $i &&
- git branch commits/$i || return 1
+ test_commit -C full $i &&
+ git -C full branch commits/$i || return 1
done &&
- git reset --hard commits/2 &&
+ git -C full reset --hard commits/2 &&
for i in $(test_seq 6 7)
do
- test_commit $i &&
- git branch commits/$i || return 1
+ test_commit -C full $i &&
+ git -C full branch commits/$i || return 1
done &&
- git reset --hard commits/2 &&
- git merge commits/4 &&
- git branch merge/1 &&
- git reset --hard commits/4 &&
- git merge commits/6 &&
- git branch merge/2 &&
- git reset --hard commits/3 &&
- git merge commits/5 commits/7 &&
- git branch merge/3 &&
- git repack
+ git -C full reset --hard commits/2 &&
+ git -C full merge commits/4 &&
+ git -C full branch merge/1 &&
+ git -C full reset --hard commits/4 &&
+ git -C full merge commits/6 &&
+ git -C full branch merge/2 &&
+ git -C full reset --hard commits/3 &&
+ git -C full merge commits/5 commits/7 &&
+ git -C full branch merge/3 &&
+ git -C full repack
'
test_expect_success 'commit-graph write progress off for redirected stderr' '
- cd "$TRASH_DIRECTORY/full" &&
- git commit-graph write 2>err &&
+ git -C full commit-graph write 2>err &&
test_must_be_empty err
'
test_expect_success 'commit-graph write force progress on for stderr' '
- cd "$TRASH_DIRECTORY/full" &&
- GIT_PROGRESS_DELAY=0 git commit-graph write --progress 2>err &&
+ GIT_PROGRESS_DELAY=0 git -C full commit-graph write --progress 2>err &&
test_file_not_empty err
'
test_expect_success 'commit-graph write with the --no-progress option' '
- cd "$TRASH_DIRECTORY/full" &&
- git commit-graph write --no-progress 2>err &&
+ git -C full commit-graph write --no-progress 2>err &&
test_must_be_empty err
'
test_expect_success 'commit-graph write --stdin-commits progress off for redirected stderr' '
- cd "$TRASH_DIRECTORY/full" &&
- git rev-parse commits/5 >in &&
- git commit-graph write --stdin-commits <in 2>err &&
+ git -C full rev-parse commits/5 >in &&
+ git -C full commit-graph write --stdin-commits <in 2>err &&
test_must_be_empty err
'
test_expect_success 'commit-graph write --stdin-commits force progress on for stderr' '
- cd "$TRASH_DIRECTORY/full" &&
- git rev-parse commits/5 >in &&
- GIT_PROGRESS_DELAY=0 git commit-graph write --stdin-commits --progress <in 2>err &&
- test_i18ngrep "Collecting commits from input" err
+ git -C full rev-parse commits/5 >in &&
+ GIT_PROGRESS_DELAY=0 git -C full commit-graph write --stdin-commits \
+ --progress <in 2>err &&
+ test_grep "Collecting commits from input" err
'
test_expect_success 'commit-graph write --stdin-commits with the --no-progress option' '
- cd "$TRASH_DIRECTORY/full" &&
- git rev-parse commits/5 >in &&
- git commit-graph write --stdin-commits --no-progress <in 2>err &&
+ git -C full rev-parse commits/5 >in &&
+ git -C full commit-graph write --stdin-commits --no-progress <in 2>err &&
test_must_be_empty err
'
test_expect_success 'commit-graph verify progress off for redirected stderr' '
- cd "$TRASH_DIRECTORY/full" &&
- git commit-graph verify 2>err &&
+ git -C full commit-graph verify 2>err &&
test_must_be_empty err
'
test_expect_success 'commit-graph verify force progress on for stderr' '
- cd "$TRASH_DIRECTORY/full" &&
- GIT_PROGRESS_DELAY=0 git commit-graph verify --progress 2>err &&
+ GIT_PROGRESS_DELAY=0 git -C full commit-graph verify --progress 2>err &&
test_file_not_empty err
'
test_expect_success 'commit-graph verify with the --no-progress option' '
- cd "$TRASH_DIRECTORY/full" &&
- git commit-graph verify --no-progress 2>err &&
+ git -C full commit-graph verify --no-progress 2>err &&
test_must_be_empty err
'
@@ -194,10 +179,9 @@ test_expect_success 'commit-graph verify with the --no-progress option' '
# 1
test_expect_success 'write graph with merges' '
- cd "$TRASH_DIRECTORY/full" &&
- git commit-graph write &&
- test_path_is_file $objdir/info/commit-graph &&
- graph_read_expect "10" "generation_data extra_edges"
+ git -C full commit-graph write &&
+ test_path_is_file full/$objdir/info/commit-graph &&
+ graph_read_expect -C full 10 "generation_data extra_edges"
'
graph_git_behavior 'merge 1 vs 2' full merge/1 merge/2
@@ -205,12 +189,11 @@ graph_git_behavior 'merge 1 vs 3' full merge/1 merge/3
graph_git_behavior 'merge 2 vs 3' full merge/2 merge/3
test_expect_success 'Add one more commit' '
- cd "$TRASH_DIRECTORY/full" &&
- test_commit 8 &&
- git branch commits/8 &&
- ls $objdir/pack | grep idx >existing-idx &&
- git repack &&
- ls $objdir/pack| grep idx | grep -v -f existing-idx >new-idx
+ test_commit -C full 8 &&
+ git -C full branch commits/8 &&
+ ls full/$objdir/pack | grep idx >existing-idx &&
+ git -C full repack &&
+ ls full/$objdir/pack| grep idx | grep -v -f existing-idx >new-idx
'
# Current graph structure:
@@ -229,114 +212,101 @@ graph_git_behavior 'mixed mode, commit 8 vs merge 1' full commits/8 merge/1
graph_git_behavior 'mixed mode, commit 8 vs merge 2' full commits/8 merge/2
test_expect_success 'write graph with new commit' '
- cd "$TRASH_DIRECTORY/full" &&
- git commit-graph write &&
- test_path_is_file $objdir/info/commit-graph &&
- graph_read_expect "11" "generation_data extra_edges"
+ git -C full commit-graph write &&
+ test_path_is_file full/$objdir/info/commit-graph &&
+ graph_read_expect -C full 11 "generation_data extra_edges"
'
graph_git_behavior 'full graph, commit 8 vs merge 1' full commits/8 merge/1
graph_git_behavior 'full graph, commit 8 vs merge 2' full commits/8 merge/2
test_expect_success 'write graph with nothing new' '
- cd "$TRASH_DIRECTORY/full" &&
- git commit-graph write &&
- test_path_is_file $objdir/info/commit-graph &&
- graph_read_expect "11" "generation_data extra_edges"
+ git -C full commit-graph write &&
+ test_path_is_file full/$objdir/info/commit-graph &&
+ graph_read_expect -C full 11 "generation_data extra_edges"
'
graph_git_behavior 'cleared graph, commit 8 vs merge 1' full commits/8 merge/1
graph_git_behavior 'cleared graph, commit 8 vs merge 2' full commits/8 merge/2
test_expect_success 'build graph from latest pack with closure' '
- cd "$TRASH_DIRECTORY/full" &&
- cat new-idx | git commit-graph write --stdin-packs &&
- test_path_is_file $objdir/info/commit-graph &&
- graph_read_expect "9" "generation_data extra_edges"
+ git -C full commit-graph write --stdin-packs <new-idx &&
+ test_path_is_file full/$objdir/info/commit-graph &&
+ graph_read_expect -C full 9 "generation_data extra_edges"
'
graph_git_behavior 'graph from pack, commit 8 vs merge 1' full commits/8 merge/1
graph_git_behavior 'graph from pack, commit 8 vs merge 2' full commits/8 merge/2
test_expect_success 'build graph from commits with closure' '
- cd "$TRASH_DIRECTORY/full" &&
- git tag -a -m "merge" tag/merge merge/2 &&
- git rev-parse tag/merge >commits-in &&
- git rev-parse merge/1 >>commits-in &&
- cat commits-in | git commit-graph write --stdin-commits &&
- test_path_is_file $objdir/info/commit-graph &&
- graph_read_expect "6" "generation_data"
+ git -C full tag -a -m "merge" tag/merge merge/2 &&
+ git -C full rev-parse tag/merge >commits-in &&
+ git -C full rev-parse merge/1 >>commits-in &&
+ git -C full commit-graph write --stdin-commits <commits-in &&
+ test_path_is_file full/$objdir/info/commit-graph &&
+ graph_read_expect -C full 6 "generation_data"
'
graph_git_behavior 'graph from commits, commit 8 vs merge 1' full commits/8 merge/1
graph_git_behavior 'graph from commits, commit 8 vs merge 2' full commits/8 merge/2
test_expect_success 'build graph from commits with append' '
- cd "$TRASH_DIRECTORY/full" &&
- git rev-parse merge/3 | git commit-graph write --stdin-commits --append &&
- test_path_is_file $objdir/info/commit-graph &&
- graph_read_expect "10" "generation_data extra_edges"
+ git -C full rev-parse merge/3 >in &&
+ git -C full commit-graph write --stdin-commits --append <in &&
+ test_path_is_file full/$objdir/info/commit-graph &&
+ graph_read_expect -C full 10 "generation_data extra_edges"
'
graph_git_behavior 'append graph, commit 8 vs merge 1' full commits/8 merge/1
graph_git_behavior 'append graph, commit 8 vs merge 2' full commits/8 merge/2
test_expect_success 'build graph using --reachable' '
- cd "$TRASH_DIRECTORY/full" &&
- git commit-graph write --reachable &&
- test_path_is_file $objdir/info/commit-graph &&
- graph_read_expect "11" "generation_data extra_edges"
+ git -C full commit-graph write --reachable &&
+ test_path_is_file full/$objdir/info/commit-graph &&
+ graph_read_expect -C full 11 "generation_data extra_edges"
'
graph_git_behavior 'append graph, commit 8 vs merge 1' full commits/8 merge/1
graph_git_behavior 'append graph, commit 8 vs merge 2' full commits/8 merge/2
test_expect_success 'setup bare repo' '
- cd "$TRASH_DIRECTORY" &&
- git clone --bare --no-local full bare &&
- cd bare &&
- git config core.commitGraph true &&
- baredir="./objects"
+ git clone --bare --no-local full bare
'
graph_git_behavior 'bare repo, commit 8 vs merge 1' bare commits/8 merge/1
graph_git_behavior 'bare repo, commit 8 vs merge 2' bare commits/8 merge/2
test_expect_success 'write graph in bare repo' '
- cd "$TRASH_DIRECTORY/bare" &&
- git commit-graph write &&
- test_path_is_file $baredir/info/commit-graph &&
- graph_read_expect "11" "generation_data extra_edges"
+ git -C bare commit-graph write &&
+ test_path_is_file bare/objects/info/commit-graph &&
+ graph_read_expect -C bare 11 "generation_data extra_edges"
'
graph_git_behavior 'bare repo with graph, commit 8 vs merge 1' bare commits/8 merge/1
graph_git_behavior 'bare repo with graph, commit 8 vs merge 2' bare commits/8 merge/2
test_expect_success 'perform fast-forward merge in full repo' '
- cd "$TRASH_DIRECTORY/full" &&
- git checkout -b merge-5-to-8 commits/5 &&
- git merge commits/8 &&
- git show-ref -s merge-5-to-8 >output &&
- git show-ref -s commits/8 >expect &&
+ git -C full checkout -b merge-5-to-8 commits/5 &&
+ git -C full merge commits/8 &&
+ git -C full show-ref -s merge-5-to-8 >output &&
+ git -C full show-ref -s commits/8 >expect &&
test_cmp expect output
'
test_expect_success 'check that gc computes commit-graph' '
- cd "$TRASH_DIRECTORY/full" &&
- git commit --allow-empty -m "blank" &&
- git commit-graph write --reachable &&
- cp $objdir/info/commit-graph commit-graph-before-gc &&
- git reset --hard HEAD~1 &&
- git config gc.writeCommitGraph true &&
- git gc &&
- cp $objdir/info/commit-graph commit-graph-after-gc &&
+ test_commit -C full --no-tag blank &&
+ git -C full commit-graph write --reachable &&
+ cp full/$objdir/info/commit-graph commit-graph-before-gc &&
+ git -C full reset --hard HEAD~1 &&
+ test_config -C full gc.writeCommitGraph true &&
+ git -C full gc &&
+ cp full/$objdir/info/commit-graph commit-graph-after-gc &&
! test_cmp_bin commit-graph-before-gc commit-graph-after-gc &&
- git commit-graph write --reachable &&
- test_cmp_bin commit-graph-after-gc $objdir/info/commit-graph
+ git -C full commit-graph write --reachable &&
+ test_cmp_bin commit-graph-after-gc full/$objdir/info/commit-graph
'
test_expect_success 'replace-objects invalidates commit-graph' '
- cd "$TRASH_DIRECTORY" &&
test_when_finished rm -rf replace &&
git clone full replace &&
(
@@ -359,15 +329,15 @@ test_expect_success 'replace-objects invalidates commit-graph' '
'
test_expect_success 'commit grafts invalidate commit-graph' '
- cd "$TRASH_DIRECTORY" &&
test_when_finished rm -rf graft &&
- git clone full graft &&
+ git clone --template= full graft &&
(
cd graft &&
git commit-graph write --reachable &&
test_path_is_file .git/objects/info/commit-graph &&
H1=$(git rev-parse --verify HEAD~1) &&
H3=$(git rev-parse --verify HEAD~3) &&
+ mkdir .git/info &&
echo "$H1 $H3" >.git/info/grafts &&
git -c core.commitGraph=false log >expect &&
git -c core.commitGraph=true log >actual &&
@@ -383,7 +353,6 @@ test_expect_success 'commit grafts invalidate commit-graph' '
'
test_expect_success 'replace-objects invalidates commit-graph' '
- cd "$TRASH_DIRECTORY" &&
test_when_finished rm -rf shallow &&
git clone --depth 2 "file://$TRASH_DIRECTORY/full" shallow &&
(
@@ -415,35 +384,36 @@ test_expect_success 'warn on improper hash version' '
cd sha1 &&
mv ../cg-sha256 .git/objects/info/commit-graph &&
git log -1 2>err &&
- test_i18ngrep "commit-graph hash version 2 does not match version 1" err
+ test_grep "commit-graph hash version 2 does not match version 1" err
) &&
(
cd sha256 &&
mv ../cg-sha1 .git/objects/info/commit-graph &&
git log -1 2>err &&
- test_i18ngrep "commit-graph hash version 1 does not match version 2" err
+ test_grep "commit-graph hash version 1 does not match version 2" err
)
'
test_expect_success TIME_IS_64BIT,TIME_T_IS_64BIT 'lower layers have overflow chunk' '
- cd "$TRASH_DIRECTORY/full" &&
UNIX_EPOCH_ZERO="@0 +0000" &&
FUTURE_DATE="@4147483646 +0000" &&
- rm -f .git/objects/info/commit-graph &&
- test_commit --date "$FUTURE_DATE" future-1 &&
- test_commit --date "$UNIX_EPOCH_ZERO" old-1 &&
- git commit-graph write --reachable &&
- test_commit --date "$FUTURE_DATE" future-2 &&
- test_commit --date "$UNIX_EPOCH_ZERO" old-2 &&
- git commit-graph write --reachable --split=no-merge &&
- test_commit extra &&
- git commit-graph write --reachable --split=no-merge &&
- git commit-graph write --reachable &&
- graph_read_expect 16 "generation_data generation_data_overflow extra_edges" &&
- mv .git/objects/info/commit-graph commit-graph-upgraded &&
- git commit-graph write --reachable &&
- graph_read_expect 16 "generation_data generation_data_overflow extra_edges" &&
- test_cmp .git/objects/info/commit-graph commit-graph-upgraded
+ rm -f full/.git/objects/info/commit-graph &&
+ test_commit -C full --date "$FUTURE_DATE" future-1 &&
+ test_commit -C full --date "$UNIX_EPOCH_ZERO" old-1 &&
+ git -C full commit-graph write --reachable &&
+ test_commit -C full --date "$FUTURE_DATE" future-2 &&
+ test_commit -C full --date "$UNIX_EPOCH_ZERO" old-2 &&
+ git -C full commit-graph write --reachable --split=no-merge &&
+ test_commit -C full extra &&
+ git -C full commit-graph write --reachable --split=no-merge &&
+ git -C full commit-graph write --reachable &&
+ graph_read_expect -C full 16 \
+ "generation_data generation_data_overflow extra_edges" &&
+ mv full/.git/objects/info/commit-graph commit-graph-upgraded &&
+ git -C full commit-graph write --reachable &&
+ graph_read_expect -C full 16 \
+ "generation_data generation_data_overflow extra_edges" &&
+ test_cmp full/.git/objects/info/commit-graph commit-graph-upgraded
'
# the verify tests below expect the commit-graph to contain
@@ -453,10 +423,11 @@ test_expect_success TIME_IS_64BIT,TIME_T_IS_64BIT 'lower layers have overflow ch
# and the tests will likely break.
test_expect_success 'git commit-graph verify' '
- cd "$TRASH_DIRECTORY/full" &&
- git rev-parse commits/8 | git -c commitGraph.generationVersion=1 commit-graph write --stdin-commits &&
- git commit-graph verify >output &&
- graph_read_expect 9 extra_edges 1
+ git -C full rev-parse commits/8 >in &&
+ git -C full -c commitGraph.generationVersion=1 commit-graph write \
+ --stdin-commits <in &&
+ git -C full commit-graph verify >output &&
+ graph_read_expect -C full 9 extra_edges 1
'
NUM_COMMITS=9
@@ -480,39 +451,39 @@ GRAPH_BYTE_FANOUT2=$(($GRAPH_FANOUT_OFFSET + 4 * 255))
GRAPH_OID_LOOKUP_OFFSET=$(($GRAPH_FANOUT_OFFSET + 4 * 256))
GRAPH_BYTE_OID_LOOKUP_ORDER=$(($GRAPH_OID_LOOKUP_OFFSET + $HASH_LEN * 8))
GRAPH_BYTE_OID_LOOKUP_MISSING=$(($GRAPH_OID_LOOKUP_OFFSET + $HASH_LEN * 4 + 10))
+GRAPH_COMMIT_DATA_WIDTH=$(($HASH_LEN + 16))
GRAPH_COMMIT_DATA_OFFSET=$(($GRAPH_OID_LOOKUP_OFFSET + $HASH_LEN * $NUM_COMMITS))
GRAPH_BYTE_COMMIT_TREE=$GRAPH_COMMIT_DATA_OFFSET
GRAPH_BYTE_COMMIT_PARENT=$(($GRAPH_COMMIT_DATA_OFFSET + $HASH_LEN))
GRAPH_BYTE_COMMIT_EXTRA_PARENT=$(($GRAPH_COMMIT_DATA_OFFSET + $HASH_LEN + 4))
GRAPH_BYTE_COMMIT_WRONG_PARENT=$(($GRAPH_COMMIT_DATA_OFFSET + $HASH_LEN + 3))
GRAPH_BYTE_COMMIT_GENERATION=$(($GRAPH_COMMIT_DATA_OFFSET + $HASH_LEN + 11))
+GRAPH_BYTE_COMMIT_GENERATION_LAST=$(($GRAPH_BYTE_COMMIT_GENERATION + $(($NUM_COMMITS - 1)) * $GRAPH_COMMIT_DATA_WIDTH))
GRAPH_BYTE_COMMIT_DATE=$(($GRAPH_COMMIT_DATA_OFFSET + $HASH_LEN + 12))
-GRAPH_COMMIT_DATA_WIDTH=$(($HASH_LEN + 16))
GRAPH_OCTOPUS_DATA_OFFSET=$(($GRAPH_COMMIT_DATA_OFFSET + \
$GRAPH_COMMIT_DATA_WIDTH * $NUM_COMMITS))
GRAPH_BYTE_OCTOPUS=$(($GRAPH_OCTOPUS_DATA_OFFSET + 4))
GRAPH_BYTE_FOOTER=$(($GRAPH_OCTOPUS_DATA_OFFSET + 4 * $NUM_OCTOPUS_EDGES))
corrupt_graph_setup() {
- cd "$TRASH_DIRECTORY/full" &&
- test_when_finished mv commit-graph-backup $objdir/info/commit-graph &&
- cp $objdir/info/commit-graph commit-graph-backup &&
- chmod u+w $objdir/info/commit-graph
+ test_when_finished mv commit-graph-backup full/$objdir/info/commit-graph &&
+ cp full/$objdir/info/commit-graph commit-graph-backup &&
+ chmod u+w full/$objdir/info/commit-graph
}
corrupt_graph_verify() {
grepstr=$1
- test_must_fail git commit-graph verify 2>test_err &&
+ test_must_fail git -C full commit-graph verify 2>test_err &&
grep -v "^+" test_err >err &&
- test_i18ngrep "$grepstr" err &&
+ test_grep "$grepstr" err &&
if test "$2" != "no-copy"
then
- cp $objdir/info/commit-graph commit-graph-pre-write-test
+ cp full/$objdir/info/commit-graph commit-graph-pre-write-test
fi &&
- git status --short &&
- GIT_TEST_COMMIT_GRAPH_DIE_ON_PARSE=true git commit-graph write &&
- chmod u+w $objdir/info/commit-graph &&
- git commit-graph verify
+ git -C full status --short &&
+ GIT_TEST_COMMIT_GRAPH_DIE_ON_PARSE=true git -C full commit-graph write &&
+ chmod u+w full/$objdir/info/commit-graph &&
+ git -C full commit-graph verify
}
# usage: corrupt_graph_and_verify <position> <data> <string> [<zero_pos>]
@@ -526,24 +497,24 @@ corrupt_graph_and_verify() {
data="${2:-\0}"
grepstr=$3
corrupt_graph_setup &&
- orig_size=$(wc -c < $objdir/info/commit-graph) &&
+ orig_size=$(wc -c <full/$objdir/info/commit-graph) &&
zero_pos=${4:-${orig_size}} &&
- printf "$data" | dd of="$objdir/info/commit-graph" bs=1 seek="$pos" conv=notrunc &&
- dd of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" if=/dev/null &&
- test-tool genzeros $(($orig_size - $zero_pos)) >>"$objdir/info/commit-graph" &&
+ printf "$data" | dd of="full/$objdir/info/commit-graph" bs=1 seek="$pos" conv=notrunc &&
+ dd of="full/$objdir/info/commit-graph" bs=1 seek="$zero_pos" if=/dev/null &&
+ test-tool genzeros $(($orig_size - $zero_pos)) >>"full/$objdir/info/commit-graph" &&
corrupt_graph_verify "$grepstr"
}
test_expect_success POSIXPERM,SANITY 'detect permission problem' '
corrupt_graph_setup &&
- chmod 000 $objdir/info/commit-graph &&
+ chmod 000 full/$objdir/info/commit-graph &&
corrupt_graph_verify "Could not open" "no-copy"
'
test_expect_success 'detect too small' '
corrupt_graph_setup &&
- echo "a small graph" >$objdir/info/commit-graph &&
+ echo "a small graph" >full/$objdir/info/commit-graph &&
corrupt_graph_verify "too small"
'
@@ -569,17 +540,17 @@ test_expect_success 'detect low chunk count' '
test_expect_success 'detect missing OID fanout chunk' '
corrupt_graph_and_verify $GRAPH_BYTE_OID_FANOUT_ID "\0" \
- "missing the OID Fanout chunk"
+ "commit-graph required OID fanout chunk missing or corrupted"
'
test_expect_success 'detect missing OID lookup chunk' '
corrupt_graph_and_verify $GRAPH_BYTE_OID_LOOKUP_ID "\0" \
- "missing the OID Lookup chunk"
+ "commit-graph required OID lookup chunk missing or corrupted"
'
test_expect_success 'detect missing commit data chunk' '
corrupt_graph_and_verify $GRAPH_BYTE_COMMIT_DATA_ID "\0" \
- "missing the Commit Data chunk"
+ "commit-graph required commit data chunk missing or corrupted"
'
test_expect_success 'detect incorrect fanout' '
@@ -589,7 +560,7 @@ test_expect_success 'detect incorrect fanout' '
test_expect_success 'detect incorrect fanout final value' '
corrupt_graph_and_verify $GRAPH_BYTE_FANOUT2 "\01" \
- "fanout value"
+ "OID lookup chunk is the wrong size"
'
test_expect_success 'detect incorrect OID order' '
@@ -627,11 +598,6 @@ test_expect_success 'detect incorrect generation number' '
"generation for commit"
'
-test_expect_success 'detect incorrect generation number' '
- corrupt_graph_and_verify $GRAPH_BYTE_COMMIT_GENERATION "\01" \
- "non-zero generation number"
-'
-
test_expect_success 'detect incorrect commit date' '
corrupt_graph_and_verify $GRAPH_BYTE_COMMIT_DATE "\01" \
"commit date"
@@ -653,34 +619,51 @@ test_expect_success 'detect incorrect chunk count' '
$GRAPH_CHUNK_LOOKUP_OFFSET
'
+test_expect_success 'detect mixed generation numbers (non-zero to zero)' '
+ corrupt_graph_and_verify $GRAPH_BYTE_COMMIT_GENERATION_LAST "\0\0\0\0" \
+ "both zero and non-zero generations"
+'
+
+test_expect_success 'detect mixed generation numbers (zero to non-zero)' '
+ corrupt_graph_and_verify $GRAPH_BYTE_COMMIT_GENERATION "\0\0\0\0" \
+ "both zero and non-zero generations"
+'
+
test_expect_success 'git fsck (checks commit-graph when config set to true)' '
- cd "$TRASH_DIRECTORY/full" &&
- git fsck &&
+ git -C full fsck &&
corrupt_graph_and_verify $GRAPH_BYTE_FOOTER "\00" \
"incorrect checksum" &&
- cp commit-graph-pre-write-test $objdir/info/commit-graph &&
- test_must_fail git -c core.commitGraph=true fsck
+ cp commit-graph-pre-write-test full/$objdir/info/commit-graph &&
+ test_must_fail git -C full -c core.commitGraph=true fsck
'
test_expect_success 'git fsck (ignores commit-graph when config set to false)' '
- cd "$TRASH_DIRECTORY/full" &&
- git fsck &&
+ git -C full fsck &&
corrupt_graph_and_verify $GRAPH_BYTE_FOOTER "\00" \
"incorrect checksum" &&
- cp commit-graph-pre-write-test $objdir/info/commit-graph &&
- git -c core.commitGraph=false fsck
+ cp commit-graph-pre-write-test full/$objdir/info/commit-graph &&
+ git -C full -c core.commitGraph=false fsck
'
test_expect_success 'git fsck (checks commit-graph when config unset)' '
- cd "$TRASH_DIRECTORY/full" &&
- test_when_finished "git config core.commitGraph true" &&
+ test_when_finished "git -C full config core.commitGraph true" &&
- git fsck &&
+ git -C full fsck &&
corrupt_graph_and_verify $GRAPH_BYTE_FOOTER "\00" \
"incorrect checksum" &&
- test_unconfig core.commitGraph &&
- cp commit-graph-pre-write-test $objdir/info/commit-graph &&
- test_must_fail git fsck
+ test_unconfig -C full core.commitGraph &&
+ cp commit-graph-pre-write-test full/$objdir/info/commit-graph &&
+ test_must_fail git -C full fsck
+'
+
+test_expect_success 'git fsck shows commit-graph output with --progress' '
+ git -C "$TRASH_DIRECTORY/full" fsck --progress 2>err &&
+ grep "Verifying commits in commit graph" err
+'
+
+test_expect_success 'git fsck suppresses commit-graph output with --no-progress' '
+ git -C "$TRASH_DIRECTORY/full" fsck --no-progress 2>err &&
+ ! grep "Verifying commits in commit graph" err
'
test_expect_success 'setup non-the_repository tests' '
@@ -738,7 +721,7 @@ test_expect_success 'corrupt commit-graph write (broken parent)' '
git commit-tree -p "$broken" -m "good commit" "$empty" >good &&
test_must_fail git commit-graph write --stdin-commits \
<good 2>test_err &&
- test_i18ngrep "unable to parse commit" test_err
+ test_grep "unable to parse commit" test_err
)
'
@@ -759,7 +742,7 @@ test_expect_success 'corrupt commit-graph write (missing tree)' '
git commit-tree -p "$broken" -m "good" "$tree" >good &&
test_must_fail git commit-graph write --stdin-commits \
<good 2>test_err &&
- test_i18ngrep "unable to parse commit" test_err
+ test_grep "unable to parse commit" test_err
)
'
@@ -781,32 +764,33 @@ test_expect_success 'corrupt commit-graph write (missing tree)' '
#
test_expect_success 'set up and verify repo with generation data overflow chunk' '
- objdir=".git/objects" &&
UNIX_EPOCH_ZERO="@0 +0000" &&
FUTURE_DATE="@2147483646 +0000" &&
- cd "$TRASH_DIRECTORY" &&
- mkdir repo &&
- cd repo &&
- git init &&
- test_commit --date "$UNIX_EPOCH_ZERO" 1 &&
- test_commit 2 &&
- test_commit --date "$UNIX_EPOCH_ZERO" 3 &&
- git commit-graph write --reachable &&
- graph_read_expect 3 generation_data &&
- test_commit --date "$FUTURE_DATE" 4 &&
- test_commit 5 &&
- test_commit --date "$UNIX_EPOCH_ZERO" 6 &&
- git branch left &&
- git reset --hard 3 &&
- test_commit 7 &&
- test_commit --date "$FUTURE_DATE" 8 &&
- test_commit 9 &&
- git branch right &&
- git reset --hard 3 &&
- test_merge M left right &&
- git commit-graph write --reachable &&
- graph_read_expect 10 "generation_data generation_data_overflow" &&
- git commit-graph verify
+
+ git init repo &&
+ (
+ cd repo &&
+
+ test_commit --date "$UNIX_EPOCH_ZERO" 1 &&
+ test_commit 2 &&
+ test_commit --date "$UNIX_EPOCH_ZERO" 3 &&
+ git commit-graph write --reachable &&
+ graph_read_expect 3 generation_data &&
+ test_commit --date "$FUTURE_DATE" 4 &&
+ test_commit 5 &&
+ test_commit --date "$UNIX_EPOCH_ZERO" 6 &&
+ git branch left &&
+ git reset --hard 3 &&
+ test_commit 7 &&
+ test_commit --date "$FUTURE_DATE" 8 &&
+ test_commit 9 &&
+ git branch right &&
+ git reset --hard 3 &&
+ test_merge M left right &&
+ git commit-graph write --reachable &&
+ graph_read_expect 10 "generation_data generation_data_overflow" &&
+ git commit-graph verify
+ )
'
graph_git_behavior 'generation data overflow chunk repo' repo left right
@@ -838,4 +822,127 @@ test_expect_success 'overflow during generation version upgrade' '
)
'
+corrupt_chunk () {
+ graph=full/.git/objects/info/commit-graph &&
+ test_when_finished "rm -rf $graph" &&
+ git -C full commit-graph write --reachable &&
+ corrupt_chunk_file $graph "$@"
+}
+
+check_corrupt_chunk () {
+ corrupt_chunk "$@" &&
+ git -C full -c core.commitGraph=false log >expect.out &&
+ git -C full -c core.commitGraph=true log >out 2>err &&
+ test_cmp expect.out out
+}
+
+test_expect_success 'reader notices too-small oid fanout chunk' '
+ # make it big enough that the graph file is plausible,
+ # otherwise we hit an earlier check
+ check_corrupt_chunk OIDF clear $(printf "000000%02x" $(test_seq 250)) &&
+ cat >expect.err <<-\EOF &&
+ error: commit-graph oid fanout chunk is wrong size
+ error: commit-graph required OID fanout chunk missing or corrupted
+ EOF
+ test_cmp expect.err err
+'
+
+test_expect_success 'reader notices fanout/lookup table mismatch' '
+ check_corrupt_chunk OIDF 1020 "FFFFFFFF" &&
+ cat >expect.err <<-\EOF &&
+ error: commit-graph OID lookup chunk is the wrong size
+ error: commit-graph required OID lookup chunk missing or corrupted
+ EOF
+ test_cmp expect.err err
+'
+
+test_expect_success 'reader notices out-of-bounds fanout' '
+ # Rather than try to corrupt a specific hash, we will just
+ # wreck them all. But we cannot just set them all to 0xFFFFFFFF or
+ # similar, as they are used for hi/lo starts in a binary search (so if
+ # they are identical, that indicates that the search should abort
+ # immediately). Instead, we will give them high values that differ by
+ # 2^24, ensuring that any that are used would cause an out-of-bounds
+ # read.
+ check_corrupt_chunk OIDF 0 $(printf "%02x000000" $(test_seq 0 254)) &&
+ cat >expect.err <<-\EOF &&
+ error: commit-graph fanout values out of order
+ error: commit-graph required OID fanout chunk missing or corrupted
+ EOF
+ test_cmp expect.err err
+'
+
+test_expect_success 'reader notices too-small commit data chunk' '
+ check_corrupt_chunk CDAT clear 00000000 &&
+ cat >expect.err <<-\EOF &&
+ error: commit-graph commit data chunk is wrong size
+ error: commit-graph required commit data chunk missing or corrupted
+ EOF
+ test_cmp expect.err err
+'
+
+test_expect_success 'reader notices out-of-bounds extra edge' '
+ check_corrupt_chunk EDGE clear &&
+ cat >expect.err <<-\EOF &&
+ error: commit-graph extra-edges pointer out of bounds
+ EOF
+ test_cmp expect.err err
+'
+
+test_expect_success 'reader notices too-small generations chunk' '
+ check_corrupt_chunk GDA2 clear 00000000 &&
+ cat >expect.err <<-\EOF &&
+ error: commit-graph generations chunk is wrong size
+ EOF
+ test_cmp expect.err err
+'
+
+test_expect_success 'stale commit cannot be parsed when given directly' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit A &&
+ test_commit B &&
+ git commit-graph write --reachable &&
+
+ oid=$(git rev-parse B) &&
+ rm .git/objects/"$(test_oid_to_path "$oid")" &&
+
+ # Verify that it is possible to read the commit from the
+ # commit graph when not being paranoid, ...
+ git rev-list B &&
+ # ... but parsing the commit when double checking that
+ # it actually exists in the object database should fail.
+ test_must_fail env GIT_COMMIT_GRAPH_PARANOIA=true git rev-list -1 B
+ )
+'
+
+test_expect_success 'stale commit cannot be parsed when traversing graph' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+
+ test_commit A &&
+ test_commit B &&
+ test_commit C &&
+ git commit-graph write --reachable &&
+
+ # Corrupt the repository by deleting the intermediate commit
+ # object. Commands should notice that this object is absent and
+ # thus that the repository is corrupt even if the commit graph
+ # exists.
+ oid=$(git rev-parse B) &&
+ rm .git/objects/"$(test_oid_to_path "$oid")" &&
+
+ # Again, we should be able to parse the commit when not
+ # being paranoid about commit graph staleness...
+ git rev-parse HEAD~2 &&
+ # ... but fail when we are paranoid.
+ test_must_fail env GIT_COMMIT_GRAPH_PARANOIA=true git rev-parse HEAD~2 2>error &&
+ grep "error: commit $oid exists in commit-graph but not in the object database" error
+ )
+'
+
test_done
diff --git a/t/t5319-multi-pack-index.sh b/t/t5319-multi-pack-index.sh
index afbe93f..dd09134 100755
--- a/t/t5319-multi-pack-index.sh
+++ b/t/t5319-multi-pack-index.sh
@@ -2,6 +2,7 @@
test_description='multi-pack-indexes'
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-chunk.sh
GIT_TEST_MULTI_PACK_INDEX=0
objdir=.git/objects
@@ -183,6 +184,18 @@ test_expect_success 'write midx with --stdin-packs' '
compare_results_with_midx "mixed mode (one pack + extra)"
+test_expect_success 'write with no objects and preferred pack' '
+ test_when_finished "rm -rf empty" &&
+ git init empty &&
+ test_must_fail git -C empty multi-pack-index write \
+ --stdin-packs --preferred-pack=does-not-exist </dev/null 2>err &&
+ cat >expect <<-EOF &&
+ warning: unknown preferred pack: ${SQ}does-not-exist${SQ}
+ error: no pack files to index.
+ EOF
+ test_cmp expect err
+'
+
test_expect_success 'write progress off for redirected stderr' '
git multi-pack-index --object-dir=$objdir write 2>err &&
test_line_count = 0 err
@@ -267,13 +280,13 @@ test_expect_success 'warn on improper hash version' '
cd sha1 &&
mv ../mpi-sha256 .git/objects/pack/multi-pack-index &&
git log -1 2>err &&
- test_i18ngrep "multi-pack-index hash version 2 does not match version 1" err
+ test_grep "multi-pack-index hash version 2 does not match version 1" err
) &&
(
cd sha256 &&
mv ../mpi-sha1 .git/objects/pack/multi-pack-index &&
git log -1 2>err &&
- test_i18ngrep "multi-pack-index hash version 1 does not match version 2" err
+ test_grep "multi-pack-index hash version 1 does not match version 2" err
)
'
@@ -374,7 +387,7 @@ corrupt_midx_and_verify() {
printf "$DATA" | dd of="$FILE" bs=1 seek="$POS" conv=notrunc &&
test_must_fail $COMMAND 2>test_err &&
grep -v "^+" test_err >err &&
- test_i18ngrep "$GREPSTR" err
+ test_grep "$GREPSTR" err
}
test_expect_success 'verify bad signature' '
@@ -426,7 +439,7 @@ test_expect_success 'verify extended chunk count' '
test_expect_success 'verify missing required chunk' '
corrupt_midx_and_verify $MIDX_BYTE_CHUNK_ID "\01" $objdir \
- "missing required"
+ "required pack-name chunk missing"
'
test_expect_success 'verify invalid chunk offset' '
@@ -473,11 +486,23 @@ test_expect_success 'git-fsck incorrect offset' '
git -c core.multiPackIndex=false fsck
'
+test_expect_success 'git fsck shows MIDX output with --progress' '
+ git fsck --progress 2>err &&
+ grep "Verifying OID order in multi-pack-index" err &&
+ grep "Verifying object offsets" err
+'
+
+test_expect_success 'git fsck suppresses MIDX output with --no-progress' '
+ git fsck --no-progress 2>err &&
+ ! grep "Verifying OID order in multi-pack-index" err &&
+ ! grep "Verifying object offsets" err
+'
+
test_expect_success 'corrupt MIDX is not reused' '
corrupt_midx_and_verify $MIDX_BYTE_OFFSET "\377" $objdir \
"incorrect object offset" &&
git multi-pack-index write 2>err &&
- test_i18ngrep checksum.mismatch err &&
+ test_grep checksum.mismatch err &&
git multi-pack-index verify
'
@@ -784,6 +809,70 @@ test_expect_success 'repack creates a new pack' '
)
'
+test_expect_success 'repack (all) ignores cruft pack' '
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+
+ test_commit base &&
+ test_commit --no-tag unreachable &&
+
+ git reset --hard base &&
+ git reflog expire --all --expire=all &&
+ git repack --cruft -d &&
+
+ git multi-pack-index write &&
+
+ find $objdir/pack | sort >before &&
+ git multi-pack-index repack --batch-size=0 &&
+ find $objdir/pack | sort >after &&
+
+ test_cmp before after
+ )
+'
+
+test_expect_success 'repack (--batch-size) ignores cruft pack' '
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+
+ test_commit_bulk 5 &&
+ test_commit --no-tag unreachable &&
+
+ git reset --hard HEAD^ &&
+ git reflog expire --all --expire=all &&
+ git repack --cruft -d &&
+
+ test_commit four &&
+
+ find $objdir/pack -type f -name "*.pack" | sort >before &&
+ git repack -d &&
+ find $objdir/pack -type f -name "*.pack" | sort >after &&
+
+ pack="$(comm -13 before after)" &&
+ test_file_size "$pack" >sz &&
+ # Set --batch-size to twice the size of the pack created
+ # in the previous step, since this is enough to
+ # accommodate it and the cruft pack.
+ #
+ # This means that the MIDX machinery *could* combine the
+ # new and cruft packs together.
+ #
+ # We ensure that it does not below.
+ batch="$((($(cat sz) * 2)))" &&
+
+ git multi-pack-index write &&
+
+ find $objdir/pack | sort >before &&
+ git multi-pack-index repack --batch-size=$batch &&
+ find $objdir/pack | sort >after &&
+
+ test_cmp before after
+ )
+'
+
test_expect_success 'expire removes repacked packs' '
(
cd dup &&
@@ -847,6 +936,36 @@ test_expect_success 'expire respects .keep files' '
)
'
+test_expect_success 'expiring unreferenced cruft pack retains pack' '
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+
+ test_commit base &&
+ test_commit --no-tag unreachable &&
+ unreachable=$(git rev-parse HEAD) &&
+
+ git reset --hard base &&
+ git reflog expire --all --expire=all &&
+ git repack --cruft -d &&
+ mtimes="$(ls $objdir/pack/pack-*.mtimes)" &&
+
+ echo "base..$unreachable" >in &&
+ pack="$(git pack-objects --revs --delta-base-offset \
+ $objdir/pack/pack <in)" &&
+
+ # Preferring the contents of "$pack" will leave the
+ # cruft pack unreferenced (ie., none of the objects
+ # contained in the cruft pack will have their MIDX copy
+ # selected from the cruft pack).
+ git multi-pack-index write --preferred-pack="pack-$pack.pack" &&
+ git multi-pack-index expire &&
+
+ test_path_is_file "$mtimes"
+ )
+'
+
test_expect_success 'repack --batch-size=0 repacks everything' '
cp -r dup dup2 &&
(
@@ -913,7 +1032,7 @@ test_expect_success 'load reverse index when missing .idx, .pack' '
test_expect_success 'usage shown without sub-command' '
test_expect_code 129 git multi-pack-index 2>err &&
- ! test_i18ngrep "unrecognized subcommand" err
+ ! test_grep "unrecognized subcommand" err
'
test_expect_success 'complains when run outside of a repository' '
@@ -921,4 +1040,170 @@ test_expect_success 'complains when run outside of a repository' '
grep "not a git repository" err
'
+test_expect_success 'repack with delta islands' '
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+
+ test_commit first &&
+ git repack &&
+ test_commit second &&
+ git repack &&
+
+ git multi-pack-index write &&
+ git -c repack.useDeltaIslands=true multi-pack-index repack
+ )
+'
+
+corrupt_chunk () {
+ midx=.git/objects/pack/multi-pack-index &&
+ test_when_finished "rm -rf $midx" &&
+ git repack -ad --write-midx &&
+ corrupt_chunk_file $midx "$@"
+}
+
+test_expect_success 'reader notices too-small oid fanout chunk' '
+ corrupt_chunk OIDF clear 00000000 &&
+ test_must_fail git log 2>err &&
+ cat >expect <<-\EOF &&
+ error: multi-pack-index OID fanout is of the wrong size
+ fatal: multi-pack-index required OID fanout chunk missing or corrupted
+ EOF
+ test_cmp expect err
+'
+
+test_expect_success 'reader notices too-small oid lookup chunk' '
+ corrupt_chunk OIDL clear 00000000 &&
+ test_must_fail git log 2>err &&
+ cat >expect <<-\EOF &&
+ error: multi-pack-index OID lookup chunk is the wrong size
+ fatal: multi-pack-index required OID lookup chunk missing or corrupted
+ EOF
+ test_cmp expect err
+'
+
+test_expect_success 'reader notices too-small pack names chunk' '
+ # There is no NUL to terminate the name here, so the
+ # chunk is too short.
+ corrupt_chunk PNAM clear 70656666 &&
+ test_must_fail git log 2>err &&
+ cat >expect <<-\EOF &&
+ fatal: multi-pack-index pack-name chunk is too short
+ EOF
+ test_cmp expect err
+'
+
+test_expect_success 'reader handles unaligned chunks' '
+ # A 9-byte PNAM means all of the subsequent chunks
+ # will no longer be 4-byte aligned, but it is still
+ # a valid one-pack chunk on its own (it is "foo.pack\0").
+ corrupt_chunk PNAM clear 666f6f2e7061636b00 &&
+ git -c core.multipackindex=false log >expect.out &&
+ git -c core.multipackindex=true log >out 2>err &&
+ test_cmp expect.out out &&
+ cat >expect.err <<-\EOF &&
+ error: chunk id 4f494446 not 4-byte aligned
+ EOF
+ test_cmp expect.err err
+'
+
+test_expect_success 'reader notices too-small object offset chunk' '
+ corrupt_chunk OOFF clear 00000000 &&
+ test_must_fail git log 2>err &&
+ cat >expect <<-\EOF &&
+ error: multi-pack-index object offset chunk is the wrong size
+ fatal: multi-pack-index required object offsets chunk missing or corrupted
+ EOF
+ test_cmp expect err
+'
+
+test_expect_success 'reader bounds-checks large offset table' '
+ # re-use the objects64 dir here to cheaply get access to a midx
+ # with large offsets.
+ git init repo &&
+ test_when_finished "rm -rf repo" &&
+ (
+ cd repo &&
+ (cd ../objects64 && pwd) >.git/objects/info/alternates &&
+ git multi-pack-index --object-dir=../objects64 write &&
+ midx=../objects64/pack/multi-pack-index &&
+ corrupt_chunk_file $midx LOFF clear &&
+ # using only %(objectsize) is important here; see the commit
+ # message for more details
+ test_must_fail git cat-file --batch-all-objects \
+ --batch-check="%(objectsize)" 2>err &&
+ cat >expect <<-\EOF &&
+ fatal: multi-pack-index large offset out of bounds
+ EOF
+ test_cmp expect err
+ )
+'
+
+test_expect_success 'reader notices too-small revindex chunk' '
+ # We only get a revindex with bitmaps (and likewise only
+ # load it when they are asked for).
+ test_config repack.writeBitmaps true &&
+ corrupt_chunk RIDX clear 00000000 &&
+ git -c core.multipackIndex=false rev-list \
+ --all --use-bitmap-index >expect.out &&
+ git -c core.multipackIndex=true rev-list \
+ --all --use-bitmap-index >out 2>err &&
+ test_cmp expect.out out &&
+ cat >expect.err <<-\EOF &&
+ error: multi-pack-index reverse-index chunk is the wrong size
+ warning: multi-pack bitmap is missing required reverse index
+ EOF
+ test_cmp expect.err err
+'
+
+test_expect_success 'reader notices out-of-bounds fanout' '
+ # This is similar to the out-of-bounds fanout test in t5318. The values
+ # in adjacent entries should be large but not identical (they
+ # are used as hi/lo starts for a binary search, which would then abort
+ # immediately).
+ corrupt_chunk OIDF 0 $(printf "%02x000000" $(test_seq 0 254)) &&
+ test_must_fail git log 2>err &&
+ cat >expect <<-\EOF &&
+ error: oid fanout out of order: fanout[254] = fe000000 > 5c = fanout[255]
+ fatal: multi-pack-index required OID fanout chunk missing or corrupted
+ EOF
+ test_cmp expect err
+'
+
+test_expect_success 'bitmapped packs are stored via the BTMP chunk' '
+ test_when_finished "rm -fr repo" &&
+ git init repo &&
+ (
+ cd repo &&
+
+ for i in 1 2 3 4 5
+ do
+ test_commit "$i" &&
+ git repack -d || return 1
+ done &&
+
+ find $objdir/pack -type f -name "*.idx" | xargs -n 1 basename |
+ sort >packs &&
+
+ git multi-pack-index write --stdin-packs <packs &&
+ test_must_fail test-tool read-midx --bitmap $objdir 2>err &&
+ cat >expect <<-\EOF &&
+ error: MIDX does not contain the BTMP chunk
+ EOF
+ test_cmp expect err &&
+
+ git multi-pack-index write --stdin-packs --bitmap \
+ --preferred-pack="$(head -n1 <packs)" <packs &&
+ test-tool read-midx --bitmap $objdir >actual &&
+ for i in $(test_seq $(wc -l <packs))
+ do
+ sed -ne "${i}s/\.idx$/\.pack/p" packs &&
+ echo " bitmap_pos: $((($i - 1) * 3))" &&
+ echo " bitmap_nr: 3" || return 1
+ done >expect &&
+ test_cmp expect actual
+ )
+'
+
test_done
diff --git a/t/t5320-delta-islands.sh b/t/t5320-delta-islands.sh
index 124d476..4063633 100755
--- a/t/t5320-delta-islands.sh
+++ b/t/t5320-delta-islands.sh
@@ -134,7 +134,7 @@ test_expect_success 'island core places core objects first' '
repack -adfi &&
git verify-pack -v .git/objects/pack/*.pack |
cut -d" " -f1 |
- egrep "$root|$two" >actual &&
+ grep -E "$root|$two" >actual &&
test_cmp expect actual
'
diff --git a/t/t5321-pack-large-objects.sh b/t/t5321-pack-large-objects.sh
index 8a56d98..70770fe 100755
--- a/t/t5321-pack-large-objects.sh
+++ b/t/t5321-pack-large-objects.sh
@@ -6,6 +6,8 @@
test_description='git pack-object with "large" deltas
'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-pack.sh
diff --git a/t/t5324-split-commit-graph.sh b/t/t5324-split-commit-graph.sh
index 669ddc6..281266f 100755
--- a/t/t5324-split-commit-graph.sh
+++ b/t/t5324-split-commit-graph.sh
@@ -1,7 +1,10 @@
#!/bin/sh
test_description='split commit graph'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-chunk.sh
GIT_TEST_COMMIT_GRAPH=0
GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=0
@@ -281,7 +284,33 @@ test_expect_success 'verify hashes along chain, even in shallow' '
corrupt_file "$base_file" $(test_oid shallow) "\01" &&
test_must_fail git commit-graph verify --shallow 2>test_err &&
grep -v "^+" test_err >err &&
- test_i18ngrep "incorrect checksum" err
+ test_grep "incorrect checksum" err
+ )
+'
+
+test_expect_success 'verify notices chain slice which is bogus (base)' '
+ git clone --no-hardlinks . verify-chain-bogus-base &&
+ (
+ cd verify-chain-bogus-base &&
+ git commit-graph verify &&
+ base_file=$graphdir/graph-$(sed -n 1p $graphdir/commit-graph-chain).graph &&
+ echo "garbage" >$base_file &&
+ test_must_fail git commit-graph verify 2>test_err &&
+ grep -v "^+" test_err >err &&
+ grep "commit-graph file is too small" err
+ )
+'
+
+test_expect_success 'verify notices chain slice which is bogus (tip)' '
+ git clone --no-hardlinks . verify-chain-bogus-tip &&
+ (
+ cd verify-chain-bogus-tip &&
+ git commit-graph verify &&
+ tip_file=$graphdir/graph-$(sed -n 2p $graphdir/commit-graph-chain).graph &&
+ echo "garbage" >$tip_file &&
+ test_must_fail git commit-graph verify 2>test_err &&
+ grep -v "^+" test_err >err &&
+ grep "commit-graph file is too small" err
)
'
@@ -291,11 +320,11 @@ test_expect_success 'verify --shallow does not check base contents' '
cd verify-shallow &&
git commit-graph verify &&
base_file=$graphdir/graph-$(head -n 1 $graphdir/commit-graph-chain).graph &&
- corrupt_file "$base_file" 1000 "\01" &&
+ corrupt_file "$base_file" 1500 "\01" &&
git commit-graph verify --shallow &&
test_must_fail git commit-graph verify 2>test_err &&
grep -v "^+" test_err >err &&
- test_i18ngrep "incorrect checksum" err
+ test_grep "incorrect checksum" err
)
'
@@ -306,24 +335,51 @@ test_expect_success 'warn on base graph chunk incorrect' '
git commit-graph verify &&
base_file=$graphdir/graph-$(tail -n 1 $graphdir/commit-graph-chain).graph &&
corrupt_file "$base_file" $(test_oid base) "\01" &&
- git commit-graph verify --shallow 2>test_err &&
+ test_must_fail git commit-graph verify --shallow 2>test_err &&
+ grep -v "^+" test_err >err &&
+ test_grep "commit-graph chain does not match" err
+ )
+'
+
+test_expect_success 'verify after commit-graph-chain corruption (base)' '
+ git clone --no-hardlinks . verify-chain-base &&
+ (
+ cd verify-chain-base &&
+ corrupt_file "$graphdir/commit-graph-chain" 30 "G" &&
+ test_must_fail git commit-graph verify 2>test_err &&
+ grep -v "^+" test_err >err &&
+ test_grep "invalid commit-graph chain" err &&
+ corrupt_file "$graphdir/commit-graph-chain" 30 "A" &&
+ test_must_fail git commit-graph verify 2>test_err &&
grep -v "^+" test_err >err &&
- test_i18ngrep "commit-graph chain does not match" err
+ test_grep "unable to find all commit-graph files" err
)
'
-test_expect_success 'verify after commit-graph-chain corruption' '
- git clone --no-hardlinks . verify-chain &&
+test_expect_success 'verify after commit-graph-chain corruption (tip)' '
+ git clone --no-hardlinks . verify-chain-tip &&
(
- cd verify-chain &&
- corrupt_file "$graphdir/commit-graph-chain" 60 "G" &&
- git commit-graph verify 2>test_err &&
+ cd verify-chain-tip &&
+ corrupt_file "$graphdir/commit-graph-chain" 70 "G" &&
+ test_must_fail git commit-graph verify 2>test_err &&
grep -v "^+" test_err >err &&
- test_i18ngrep "invalid commit-graph chain" err &&
- corrupt_file "$graphdir/commit-graph-chain" 60 "A" &&
- git commit-graph verify 2>test_err &&
+ test_grep "invalid commit-graph chain" err &&
+ corrupt_file "$graphdir/commit-graph-chain" 70 "A" &&
+ test_must_fail git commit-graph verify 2>test_err &&
grep -v "^+" test_err >err &&
- test_i18ngrep "unable to find all commit-graph files" err
+ test_grep "unable to find all commit-graph files" err
+ )
+'
+
+test_expect_success 'verify notices too-short chain file' '
+ git clone --no-hardlinks . verify-chain-short &&
+ (
+ cd verify-chain-short &&
+ git commit-graph verify &&
+ echo "garbage" >$graphdir/commit-graph-chain &&
+ test_must_fail git commit-graph verify 2>test_err &&
+ grep -v "^+" test_err >err &&
+ grep "commit-graph chain file too small" err
)
'
@@ -338,10 +394,23 @@ test_expect_success 'verify across alternates' '
test_commit extra &&
git commit-graph write --reachable --split &&
tip_file=$graphdir/graph-$(tail -n 1 $graphdir/commit-graph-chain).graph &&
- corrupt_file "$tip_file" 100 "\01" &&
+ corrupt_file "$tip_file" 1500 "\01" &&
test_must_fail git commit-graph verify --shallow 2>test_err &&
grep -v "^+" test_err >err &&
- test_i18ngrep "commit-graph has incorrect fanout value" err
+ test_grep "incorrect checksum" err
+ )
+'
+
+test_expect_success 'reader bounds-checks base-graph chunk' '
+ git clone --no-hardlinks . corrupt-base-chunk &&
+ (
+ cd corrupt-base-chunk &&
+ tip_file=$graphdir/graph-$(tail -n 1 $graphdir/commit-graph-chain).graph &&
+ corrupt_chunk_file "$tip_file" BASE clear 01020304 &&
+ git -c core.commitGraph=false log >expect.out &&
+ git -c core.commitGraph=true log >out 2>err &&
+ test_cmp expect.out out &&
+ grep "commit-graph base graphs chunk is too small" err
)
'
@@ -351,8 +420,9 @@ test_expect_success 'add octopus merge' '
git branch merge/octopus &&
git commit-graph write --reachable --split &&
git commit-graph verify --progress 2>err &&
- test_line_count = 3 err &&
- test_i18ngrep ! warning err &&
+ test_line_count = 1 err &&
+ grep "Verifying commits in commit graph: 100% (18/18)" err &&
+ test_grep ! warning err &&
test_line_count = 3 $graphdir/commit-graph-chain
'
@@ -454,7 +524,7 @@ test_expect_success 'prevent regression for duplicate commits across layers' '
git init dup &&
git -C dup commit --allow-empty -m one &&
git -C dup -c core.commitGraph=false commit-graph write --split=no-merge --reachable 2>err &&
- test_i18ngrep "attempting to write a commit-graph" err &&
+ test_grep "attempting to write a commit-graph" err &&
git -C dup commit-graph write --split=no-merge --reachable &&
git -C dup commit --allow-empty -m two &&
git -C dup commit-graph write --split=no-merge --reachable &&
diff --git a/t/t5325-reverse-index.sh b/t/t5325-reverse-index.sh
index d042d26..431a603 100755
--- a/t/t5325-reverse-index.sh
+++ b/t/t5325-reverse-index.sh
@@ -1,17 +1,20 @@
#!/bin/sh
test_description='on-disk reverse index'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# The below tests want control over the 'pack.writeReverseIndex' setting
# themselves to assert various combinations of it with other options.
-sane_unset GIT_TEST_WRITE_REV_INDEX
+sane_unset GIT_TEST_NO_WRITE_REV_INDEX
packdir=.git/objects/pack
test_expect_success 'setup' '
test_commit base &&
+ test_config pack.writeReverseIndex false &&
pack=$(git pack-objects --all $packdir/pack) &&
rev=$packdir/pack-$pack.rev &&
@@ -94,6 +97,17 @@ test_expect_success 'reverse index is not generated when available on disk' '
--batch-check="%(objectsize:disk)" <tip
'
+test_expect_success 'reverse index is ignored when pack.readReverseIndex is false' '
+ test_index_pack true &&
+ test_path_is_file $rev &&
+
+ test_config pack.readReverseIndex false &&
+
+ git rev-parse HEAD >tip &&
+ GIT_TEST_REV_INDEX_DIE_ON_DISK=1 git cat-file \
+ --batch-check="%(objectsize:disk)" <tip
+'
+
test_expect_success 'revindex in-memory vs on-disk' '
git init repo &&
test_when_finished "rm -fr repo" &&
@@ -117,4 +131,78 @@ test_expect_success 'revindex in-memory vs on-disk' '
test_cmp on-disk in-core
)
'
+
+test_expect_success 'fsck succeeds on good rev-index' '
+ test_when_finished rm -fr repo &&
+ git init repo &&
+ (
+ cd repo &&
+
+ test_commit commit &&
+ git -c pack.writeReverseIndex=true repack -ad &&
+ git fsck 2>err &&
+ test_must_be_empty err
+ )
+'
+
+test_expect_success 'set up rev-index corruption tests' '
+ git init corrupt &&
+ (
+ cd corrupt &&
+
+ test_commit commit &&
+ git -c pack.writeReverseIndex=true repack -ad &&
+
+ revfile=$(ls .git/objects/pack/pack-*.rev) &&
+ chmod a+w $revfile &&
+ cp $revfile $revfile.bak
+ )
+'
+
+corrupt_rev_and_verify () {
+ (
+ pos="$1" &&
+ value="$2" &&
+ error="$3" &&
+
+ cd corrupt &&
+ revfile=$(ls .git/objects/pack/pack-*.rev) &&
+
+ # Reset to original rev-file.
+ cp $revfile.bak $revfile &&
+
+ printf "$value" | dd of=$revfile bs=1 seek="$pos" conv=notrunc &&
+ test_must_fail git fsck 2>err &&
+ grep "$error" err
+ )
+}
+
+test_expect_success 'fsck catches invalid checksum' '
+ revfile=$(ls corrupt/.git/objects/pack/pack-*.rev) &&
+ orig_size=$(wc -c <$revfile) &&
+ hashpos=$((orig_size - 10)) &&
+ corrupt_rev_and_verify $hashpos bogus \
+ "invalid checksum"
+'
+
+test_expect_success 'fsck catches invalid row position' '
+ corrupt_rev_and_verify 14 "\07" \
+ "invalid rev-index position"
+'
+
+test_expect_success 'fsck catches invalid header: magic number' '
+ corrupt_rev_and_verify 1 "\07" \
+ "reverse-index file .* has unknown signature"
+'
+
+test_expect_success 'fsck catches invalid header: version' '
+ corrupt_rev_and_verify 7 "\02" \
+ "reverse-index file .* has unsupported version"
+'
+
+test_expect_success 'fsck catches invalid header: hash function' '
+ corrupt_rev_and_verify 11 "\03" \
+ "reverse-index file .* has unsupported hash id"
+'
+
test_done
diff --git a/t/t5326-multi-pack-bitmaps.sh b/t/t5326-multi-pack-bitmaps.sh
index 4fe5741..70d1b58 100755
--- a/t/t5326-multi-pack-bitmaps.sh
+++ b/t/t5326-multi-pack-bitmaps.sh
@@ -15,17 +15,24 @@ GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
sane_unset GIT_TEST_MIDX_WRITE_REV
sane_unset GIT_TEST_MIDX_READ_RIDX
-midx_bitmap_core
-
bitmap_reuse_tests() {
from=$1
to=$2
+ writeLookupTable=false
+
+ for i in $3-${$#}
+ do
+ case $i in
+ "pack.writeBitmapLookupTable") writeLookupTable=true;;
+ esac
+ done
test_expect_success "setup pack reuse tests ($from -> $to)" '
rm -fr repo &&
git init repo &&
(
cd repo &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
test_commit_bulk 16 &&
git tag old-tip &&
@@ -43,6 +50,7 @@ bitmap_reuse_tests() {
test_expect_success "build bitmap from existing ($from -> $to)" '
(
cd repo &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
test_commit_bulk --id=further 16 &&
git tag new-tip &&
@@ -59,6 +67,7 @@ bitmap_reuse_tests() {
test_expect_success "verify resulting bitmaps ($from -> $to)" '
(
cd repo &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
git for-each-ref &&
git rev-list --test-bitmap refs/tags/old-tip &&
git rev-list --test-bitmap refs/tags/new-tip
@@ -66,244 +75,441 @@ bitmap_reuse_tests() {
'
}
-bitmap_reuse_tests 'pack' 'MIDX'
-bitmap_reuse_tests 'MIDX' 'pack'
-bitmap_reuse_tests 'MIDX' 'MIDX'
+test_midx_bitmap_cases () {
+ writeLookupTable=false
+ writeBitmapLookupTable=
+
+ for i in "$@"
+ do
+ case $i in
+ "pack.writeBitmapLookupTable")
+ writeLookupTable=true
+ writeBitmapLookupTable="$i"
+ ;;
+ esac
+ done
+
+ test_expect_success 'setup test_repository' '
+ rm -rf * .git &&
+ git init &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"'
+ '
-test_expect_success 'missing object closure fails gracefully' '
- rm -fr repo &&
- git init repo &&
- test_when_finished "rm -fr repo" &&
- (
- cd repo &&
+ midx_bitmap_core
- test_commit loose &&
- test_commit packed &&
+ bitmap_reuse_tests 'pack' 'MIDX' "$writeBitmapLookupTable"
+ bitmap_reuse_tests 'MIDX' 'pack' "$writeBitmapLookupTable"
+ bitmap_reuse_tests 'MIDX' 'MIDX' "$writeBitmapLookupTable"
- # Do not pass "--revs"; we want a pack without the "loose"
- # commit.
- git pack-objects $objdir/pack/pack <<-EOF &&
- $(git rev-parse packed)
- EOF
+ test_expect_success 'missing object closure fails gracefully' '
+ rm -fr repo &&
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
- test_must_fail git multi-pack-index write --bitmap 2>err &&
- grep "doesn.t have full closure" err &&
- test_path_is_missing $midx
- )
-'
+ test_commit loose &&
+ test_commit packed &&
-midx_bitmap_partial_tests
+ # Do not pass "--revs"; we want a pack without the "loose"
+ # commit.
+ git pack-objects $objdir/pack/pack <<-EOF &&
+ $(git rev-parse packed)
+ EOF
-test_expect_success 'removing a MIDX clears stale bitmaps' '
- rm -fr repo &&
- git init repo &&
- test_when_finished "rm -fr repo" &&
- (
- cd repo &&
- test_commit base &&
- git repack &&
- git multi-pack-index write --bitmap &&
+ test_must_fail git multi-pack-index write --bitmap 2>err &&
+ grep "doesn.t have full closure" err &&
+ test_path_is_missing $midx
+ )
+ '
- # Write a MIDX and bitmap; remove the MIDX but leave the bitmap.
- stale_bitmap=$midx-$(midx_checksum $objdir).bitmap &&
- rm $midx &&
+ midx_bitmap_partial_tests
- # Then write a new MIDX.
- test_commit new &&
- git repack &&
- git multi-pack-index write --bitmap &&
+ test_expect_success 'removing a MIDX clears stale bitmaps' '
+ rm -fr repo &&
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
+ test_commit base &&
+ git repack &&
+ git multi-pack-index write --bitmap &&
+
+ # Write a MIDX and bitmap; remove the MIDX but leave the bitmap.
+ stale_bitmap=$midx-$(midx_checksum $objdir).bitmap &&
+ rm $midx &&
+
+ # Then write a new MIDX.
+ test_commit new &&
+ git repack &&
+ git multi-pack-index write --bitmap &&
+
+ test_path_is_file $midx &&
+ test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
+ test_path_is_missing $stale_bitmap
+ )
+ '
- test_path_is_file $midx &&
- test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
- test_path_is_missing $stale_bitmap
- )
-'
+ test_expect_success 'pack.preferBitmapTips' '
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
-test_expect_success 'pack.preferBitmapTips' '
- git init repo &&
- test_when_finished "rm -fr repo" &&
- (
- cd repo &&
+ test_commit_bulk --message="%s" 103 &&
- test_commit_bulk --message="%s" 103 &&
+ git log --format="%H" >commits.raw &&
+ sort <commits.raw >commits &&
- git log --format="%H" >commits.raw &&
- sort <commits.raw >commits &&
+ git log --format="create refs/tags/%s %H" HEAD >refs &&
+ git update-ref --stdin <refs &&
- git log --format="create refs/tags/%s %H" HEAD >refs &&
- git update-ref --stdin <refs &&
+ git multi-pack-index write --bitmap &&
+ test_path_is_file $midx &&
+ test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
- git multi-pack-index write --bitmap &&
- test_path_is_file $midx &&
- test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
+ test-tool bitmap list-commits | sort >bitmaps &&
+ comm -13 bitmaps commits >before &&
+ test_line_count = 1 before &&
- test-tool bitmap list-commits | sort >bitmaps &&
- comm -13 bitmaps commits >before &&
- test_line_count = 1 before &&
+ perl -ne "printf(\"create refs/tags/include/%d \", $.); print" \
+ <before | git update-ref --stdin &&
- perl -ne "printf(\"create refs/tags/include/%d \", $.); print" \
- <before | git update-ref --stdin &&
+ rm -fr $midx-$(midx_checksum $objdir).bitmap &&
+ rm -fr $midx &&
- rm -fr $midx-$(midx_checksum $objdir).bitmap &&
- rm -fr $midx &&
+ git -c pack.preferBitmapTips=refs/tags/include \
+ multi-pack-index write --bitmap &&
+ test-tool bitmap list-commits | sort >bitmaps &&
+ comm -13 bitmaps commits >after &&
- git -c pack.preferBitmapTips=refs/tags/include \
- multi-pack-index write --bitmap &&
- test-tool bitmap list-commits | sort >bitmaps &&
- comm -13 bitmaps commits >after &&
+ ! test_cmp before after
+ )
+ '
- ! test_cmp before after
- )
-'
+ test_expect_success 'writing a bitmap with --refs-snapshot' '
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
-test_expect_success 'writing a bitmap with --refs-snapshot' '
- git init repo &&
- test_when_finished "rm -fr repo" &&
- (
- cd repo &&
+ test_commit one &&
+ test_commit two &&
- test_commit one &&
- test_commit two &&
+ git rev-parse one >snapshot &&
- git rev-parse one >snapshot &&
+ git repack -ad &&
- git repack -ad &&
+ # First, write a MIDX which see both refs/tags/one and
+ # refs/tags/two (causing both of those commits to receive
+ # bitmaps).
+ git multi-pack-index write --bitmap &&
- # First, write a MIDX which see both refs/tags/one and
- # refs/tags/two (causing both of those commits to receive
- # bitmaps).
- git multi-pack-index write --bitmap &&
+ test_path_is_file $midx &&
+ test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
- test_path_is_file $midx &&
- test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
+ test-tool bitmap list-commits | sort >bitmaps &&
+ grep "$(git rev-parse one)" bitmaps &&
+ grep "$(git rev-parse two)" bitmaps &&
- test-tool bitmap list-commits | sort >bitmaps &&
- grep "$(git rev-parse one)" bitmaps &&
- grep "$(git rev-parse two)" bitmaps &&
+ rm -fr $midx-$(midx_checksum $objdir).bitmap &&
+ rm -fr $midx &&
- rm -fr $midx-$(midx_checksum $objdir).bitmap &&
- rm -fr $midx &&
+ # Then again, but with a refs snapshot which only sees
+ # refs/tags/one.
+ git multi-pack-index write --bitmap --refs-snapshot=snapshot &&
- # Then again, but with a refs snapshot which only sees
- # refs/tags/one.
- git multi-pack-index write --bitmap --refs-snapshot=snapshot &&
+ test_path_is_file $midx &&
+ test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
- test_path_is_file $midx &&
- test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
+ test-tool bitmap list-commits | sort >bitmaps &&
+ grep "$(git rev-parse one)" bitmaps &&
+ ! grep "$(git rev-parse two)" bitmaps
+ )
+ '
- test-tool bitmap list-commits | sort >bitmaps &&
- grep "$(git rev-parse one)" bitmaps &&
- ! grep "$(git rev-parse two)" bitmaps
- )
-'
+ test_expect_success 'write a bitmap with --refs-snapshot (preferred tips)' '
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
-test_expect_success 'write a bitmap with --refs-snapshot (preferred tips)' '
- git init repo &&
- test_when_finished "rm -fr repo" &&
- (
- cd repo &&
+ test_commit_bulk --message="%s" 103 &&
- test_commit_bulk --message="%s" 103 &&
+ git log --format="%H" >commits.raw &&
+ sort <commits.raw >commits &&
- git log --format="%H" >commits.raw &&
- sort <commits.raw >commits &&
+ git log --format="create refs/tags/%s %H" HEAD >refs &&
+ git update-ref --stdin <refs &&
- git log --format="create refs/tags/%s %H" HEAD >refs &&
- git update-ref --stdin <refs &&
+ git multi-pack-index write --bitmap &&
+ test_path_is_file $midx &&
+ test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
- git multi-pack-index write --bitmap &&
- test_path_is_file $midx &&
- test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
+ test-tool bitmap list-commits | sort >bitmaps &&
+ comm -13 bitmaps commits >before &&
+ test_line_count = 1 before &&
+
+ (
+ grep -vf before commits.raw &&
+ # mark missing commits as preferred
+ sed "s/^/+/" before
+ ) >snapshot &&
+
+ rm -fr $midx-$(midx_checksum $objdir).bitmap &&
+ rm -fr $midx &&
+
+ git multi-pack-index write --bitmap --refs-snapshot=snapshot &&
+ test-tool bitmap list-commits | sort >bitmaps &&
+ comm -13 bitmaps commits >after &&
- test-tool bitmap list-commits | sort >bitmaps &&
- comm -13 bitmaps commits >before &&
- test_line_count = 1 before &&
+ ! test_cmp before after
+ )
+ '
+ test_expect_success 'hash-cache values are propagated from pack bitmaps' '
+ rm -fr repo &&
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
(
- grep -vf before commits.raw &&
- # mark missing commits as preferred
- sed "s/^/+/" before
- ) >snapshot &&
+ cd repo &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
- rm -fr $midx-$(midx_checksum $objdir).bitmap &&
- rm -fr $midx &&
+ test_commit base &&
+ test_commit base2 &&
+ git repack -adb &&
- git multi-pack-index write --bitmap --refs-snapshot=snapshot &&
- test-tool bitmap list-commits | sort >bitmaps &&
- comm -13 bitmaps commits >after &&
+ test-tool bitmap dump-hashes >pack.raw &&
+ test_file_not_empty pack.raw &&
+ sort pack.raw >pack.hashes &&
- ! test_cmp before after
- )
-'
+ test_commit new &&
+ git repack &&
+ git multi-pack-index write --bitmap &&
+
+ test-tool bitmap dump-hashes >midx.raw &&
+ sort midx.raw >midx.hashes &&
-test_expect_success 'hash-cache values are propagated from pack bitmaps' '
+ # ensure that every namehash in the pack bitmap can be found in
+ # the midx bitmap (i.e., that there are no oid-namehash pairs
+ # unique to the pack bitmap).
+ comm -23 pack.hashes midx.hashes >dropped.hashes &&
+ test_must_be_empty dropped.hashes
+ )
+ '
+
+ test_expect_success 'no .bitmap is written without any objects' '
+ rm -fr repo &&
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
+
+ empty="$(git pack-objects $objdir/pack/pack </dev/null)" &&
+ cat >packs <<-EOF &&
+ pack-$empty.idx
+ EOF
+
+ git multi-pack-index write --bitmap --stdin-packs \
+ <packs 2>err &&
+
+ grep "bitmap without any objects" err &&
+
+ test_path_is_file $midx &&
+ test_path_is_missing $midx-$(midx_checksum $objdir).bitmap
+ )
+ '
+
+ test_expect_success 'graceful fallback when missing reverse index' '
+ rm -fr repo &&
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
+
+ test_commit base &&
+
+ # write a pack and MIDX bitmap containing base
+ git repack -adb &&
+ git multi-pack-index write --bitmap &&
+
+ GIT_TEST_MIDX_READ_RIDX=0 \
+ git rev-list --use-bitmap-index HEAD 2>err &&
+ ! grep "ignoring extra bitmap file" err
+ )
+ '
+}
+
+test_midx_bitmap_cases
+
+test_midx_bitmap_cases "pack.writeBitmapLookupTable"
+
+test_expect_success 'multi-pack-index write writes lookup table if enabled' '
rm -fr repo &&
git init repo &&
test_when_finished "rm -fr repo" &&
(
cd repo &&
+ test_commit base &&
+ git config pack.writeBitmapLookupTable true &&
+ git repack -ad &&
+ GIT_TRACE2_EVENT="$(pwd)/trace" \
+ git multi-pack-index write --bitmap &&
+ grep "\"label\":\"writing_lookup_table\"" trace
+ )
+'
+
+test_expect_success 'preferred pack change with existing MIDX bitmap' '
+ git init preferred-pack-with-existing &&
+ (
+ cd preferred-pack-with-existing &&
test_commit base &&
- test_commit base2 &&
- git repack -adb &&
+ test_commit other &&
- test-tool bitmap dump-hashes >pack.raw &&
- test_file_not_empty pack.raw &&
- sort pack.raw >pack.hashes &&
+ git rev-list --objects --no-object-names base >p1.objects &&
+ git rev-list --objects --no-object-names other >p2.objects &&
- test_commit new &&
- git repack &&
- git multi-pack-index write --bitmap &&
+ p1="$(git pack-objects "$objdir/pack/pack" \
+ --delta-base-offset <p1.objects)" &&
+ p2="$(git pack-objects "$objdir/pack/pack" \
+ --delta-base-offset <p2.objects)" &&
- test-tool bitmap dump-hashes >midx.raw &&
- sort midx.raw >midx.hashes &&
+ # Generate a MIDX containing the first two packs,
+ # marking p1 as preferred, and ensure that it can be
+ # successfully cloned.
+ git multi-pack-index write --bitmap \
+ --preferred-pack="pack-$p1.pack" &&
+ test_path_is_file $midx &&
+ test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
+ git clone --no-local . clone1 &&
- # ensure that every namehash in the pack bitmap can be found in
- # the midx bitmap (i.e., that there are no oid-namehash pairs
- # unique to the pack bitmap).
- comm -23 pack.hashes midx.hashes >dropped.hashes &&
- test_must_be_empty dropped.hashes
+ # Then generate a new pack which sorts ahead of any
+ # existing pack (by tweaking the pack prefix).
+ test_commit foo &&
+ git pack-objects --all --unpacked $objdir/pack/pack0 &&
+
+ # Generate a new MIDX which changes the preferred pack
+ # to a pack contained in the existing MIDX.
+ git multi-pack-index write --bitmap \
+ --preferred-pack="pack-$p2.pack" &&
+ test_path_is_file $midx &&
+ test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
+
+ # When the above circumstances are met, the preferred
+ # pack should change appropriately and clones should
+ # (still) succeed.
+ git clone --no-local . clone2
)
'
-test_expect_success 'no .bitmap is written without any objects' '
+test_expect_success 'tagged commits are selected for bitmapping' '
rm -fr repo &&
git init repo &&
test_when_finished "rm -fr repo" &&
(
cd repo &&
- empty="$(git pack-objects $objdir/pack/pack </dev/null)" &&
- cat >packs <<-EOF &&
- pack-$empty.idx
- EOF
+ test_commit --annotate base &&
+ git repack -d &&
- git multi-pack-index write --bitmap --stdin-packs \
- <packs 2>err &&
+ # Remove refs/heads/main which points at the commit directly,
+ # leaving only a reference to the annotated tag.
+ git branch -M main &&
+ git checkout base &&
+ git branch -d main &&
- grep "bitmap without any objects" err &&
+ git multi-pack-index write --bitmap &&
- test_path_is_file $midx &&
- test_path_is_missing $midx-$(midx_checksum $objdir).bitmap
+ git rev-parse HEAD >want &&
+ test-tool bitmap list-commits >actual &&
+ grep $(cat want) actual
)
'
-test_expect_success 'graceful fallback when missing reverse index' '
- rm -fr repo &&
- git init repo &&
- test_when_finished "rm -fr repo" &&
+corrupt_file () {
+ chmod a+w "$1" &&
+ printf "bogus" | dd of="$1" bs=1 seek="12" conv=notrunc
+}
+
+test_expect_success 'git fsck correctly identifies good and bad bitmaps' '
+ git init valid &&
+ test_when_finished rm -rf valid &&
+
+ test_commit_bulk 20 &&
+ git repack -adbf &&
+
+ # Move pack-bitmap aside so it is not deleted
+ # in next repack.
+ packbitmap=$(ls .git/objects/pack/pack-*.bitmap) &&
+ mv "$packbitmap" "$packbitmap.bak" &&
+
+ test_commit_bulk 10 &&
+ git repack -b --write-midx &&
+ midxbitmap=$(ls .git/objects/pack/multi-pack-index-*.bitmap) &&
+
+ # Copy MIDX bitmap to backup. Copy pack bitmap from backup.
+ cp "$midxbitmap" "$midxbitmap.bak" &&
+ cp "$packbitmap.bak" "$packbitmap" &&
+
+ # fsck works at first
+ git fsck 2>err &&
+ test_must_be_empty err &&
+
+ corrupt_file "$packbitmap" &&
+ test_must_fail git fsck 2>err &&
+ grep "bitmap file '\''$packbitmap'\'' has invalid checksum" err &&
+
+ cp "$packbitmap.bak" "$packbitmap" &&
+ corrupt_file "$midxbitmap" &&
+ test_must_fail git fsck 2>err &&
+ grep "bitmap file '\''$midxbitmap'\'' has invalid checksum" err &&
+
+ corrupt_file "$packbitmap" &&
+ test_must_fail git fsck 2>err &&
+ grep "bitmap file '\''$midxbitmap'\'' has invalid checksum" err &&
+ grep "bitmap file '\''$packbitmap'\'' has invalid checksum" err
+'
+
+test_expect_success 'corrupt MIDX with bitmap causes fallback' '
+ git init corrupt-midx-bitmap &&
(
- cd repo &&
+ cd corrupt-midx-bitmap &&
- test_commit base &&
+ test_commit first &&
+ git repack -d &&
+ test_commit second &&
+ git repack -d &&
- # write a pack and MIDX bitmap containing base
- git repack -adb &&
git multi-pack-index write --bitmap &&
+ checksum=$(midx_checksum $objdir) &&
+ for f in $midx $midx-$checksum.bitmap
+ do
+ mv $f $f.bak || return 1
+ done &&
- GIT_TEST_MIDX_READ_RIDX=0 \
- git rev-list --use-bitmap-index HEAD 2>err &&
- ! grep "ignoring extra bitmap file" err
+ # pack everything together, invalidating the MIDX
+ git repack -ad &&
+ # then restore the now-stale MIDX
+ for f in $midx $midx-$checksum.bitmap
+ do
+ mv $f.bak $f || return 1
+ done &&
+
+ git rev-list --count --objects --use-bitmap-index HEAD >out 2>err &&
+ # should attempt opening the broken pack twice (once
+ # from the attempt to load it via the stale bitmap, and
+ # again when attempting to load it from the stale MIDX)
+ # before falling back to the non-MIDX case
+ test 2 -eq $(grep -c "could not open pack" err) &&
+ test 6 -eq $(cat out)
)
'
diff --git a/t/t5327-multi-pack-bitmaps-rev.sh b/t/t5327-multi-pack-bitmaps-rev.sh
index d30ba63..e65e311 100755
--- a/t/t5327-multi-pack-bitmaps-rev.sh
+++ b/t/t5327-multi-pack-bitmaps-rev.sh
@@ -17,7 +17,27 @@ GIT_TEST_MIDX_READ_RIDX=0
export GIT_TEST_MIDX_WRITE_REV
export GIT_TEST_MIDX_READ_RIDX
-midx_bitmap_core rev
-midx_bitmap_partial_tests rev
+test_midx_bitmap_rev () {
+ writeLookupTable=false
+
+ for i in "$@"
+ do
+ case $i in
+ "pack.writeBitmapLookupTable") writeLookupTable=true;;
+ esac
+ done
+
+ test_expect_success 'setup bitmap config' '
+ rm -rf * .git &&
+ git init &&
+ git config pack.writeBitmapLookupTable '"$writeLookupTable"'
+ '
+
+ midx_bitmap_core rev
+ midx_bitmap_partial_tests rev
+}
+
+test_midx_bitmap_rev
+test_midx_bitmap_rev "pack.writeBitmapLookupTable"
test_done
diff --git a/t/t5328-commit-graph-64bit-time.sh b/t/t5328-commit-graph-64bit-time.sh
index 093f0c0..fc6a242 100755
--- a/t/t5328-commit-graph-64bit-time.sh
+++ b/t/t5328-commit-graph-64bit-time.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='commit graph with 64-bit timestamps'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
if ! test_have_prereq TIME_IS_64BIT || ! test_have_prereq TIME_T_IS_64BIT
@@ -10,6 +12,7 @@ then
fi
. "$TEST_DIRECTORY"/lib-commit-graph.sh
+. "$TEST_DIRECTORY/lib-chunk.sh"
UNIX_EPOCH_ZERO="@0 +0000"
FUTURE_DATE="@4147483646 +0000"
@@ -37,30 +40,48 @@ test_expect_success 'lower layers have overflow chunk' '
graph_git_behavior 'overflow' '' HEAD~2 HEAD
test_expect_success 'set up and verify repo with generation data overflow chunk' '
- mkdir repo &&
- cd repo &&
- git init &&
- test_commit --date "$UNIX_EPOCH_ZERO" 1 &&
- test_commit 2 &&
- test_commit --date "$UNIX_EPOCH_ZERO" 3 &&
- git commit-graph write --reachable &&
- graph_read_expect 3 generation_data &&
- test_commit --date "$FUTURE_DATE" 4 &&
- test_commit 5 &&
- test_commit --date "$UNIX_EPOCH_ZERO" 6 &&
- git branch left &&
- git reset --hard 3 &&
- test_commit 7 &&
- test_commit --date "$FUTURE_DATE" 8 &&
- test_commit 9 &&
- git branch right &&
- git reset --hard 3 &&
- test_merge M left right &&
- git commit-graph write --reachable &&
- graph_read_expect 10 "generation_data generation_data_overflow" &&
- git commit-graph verify
+ git init repo &&
+ (
+ cd repo &&
+ test_commit --date "$UNIX_EPOCH_ZERO" 1 &&
+ test_commit 2 &&
+ test_commit --date "$UNIX_EPOCH_ZERO" 3 &&
+ git commit-graph write --reachable &&
+ graph_read_expect 3 generation_data &&
+ test_commit --date "$FUTURE_DATE" 4 &&
+ test_commit 5 &&
+ test_commit --date "$UNIX_EPOCH_ZERO" 6 &&
+ git branch left &&
+ git reset --hard 3 &&
+ test_commit 7 &&
+ test_commit --date "$FUTURE_DATE" 8 &&
+ test_commit 9 &&
+ git branch right &&
+ git reset --hard 3 &&
+ test_merge M left right &&
+ git commit-graph write --reachable &&
+ graph_read_expect 10 "generation_data generation_data_overflow" &&
+ git commit-graph verify
+ )
'
graph_git_behavior 'overflow 2' repo left right
+test_expect_success 'single commit with generation data exceeding UINT32_MAX' '
+ git init repo-uint32-max &&
+ test_commit -C repo-uint32-max --date "@4294967297 +0000" 1 &&
+ git -C repo-uint32-max commit-graph write --reachable &&
+ graph_read_expect -C repo-uint32-max 1 "generation_data" &&
+ git -C repo-uint32-max commit-graph verify
+'
+
+test_expect_success 'reader notices out-of-bounds generation overflow' '
+ graph=.git/objects/info/commit-graph &&
+ test_when_finished "rm -rf $graph" &&
+ git commit-graph write --reachable &&
+ corrupt_chunk_file $graph GDO2 clear &&
+ test_must_fail git log 2>err &&
+ grep "commit-graph overflow generation data is too small" err
+'
+
test_done
diff --git a/t/t5329-pack-objects-cruft.sh b/t/t5329-pack-objects-cruft.sh
index 8968f7a..fc5fedb 100755
--- a/t/t5329-pack-objects-cruft.sh
+++ b/t/t5329-pack-objects-cruft.sh
@@ -29,7 +29,8 @@ basic_cruft_pack_tests () {
while read oid
do
path="$objdir/$(test_oid_to_path "$oid")" &&
- printf "%s %d\n" "$oid" "$(test-tool chmtime --get "$path")"
+ printf "%s %d\n" "$oid" "$(test-tool chmtime --get "$path")" ||
+ echo "object list generation failed for $oid"
done |
sort -k1
) >expect &&
@@ -232,7 +233,7 @@ test_expect_success 'cruft tags rescue tagged objects' '
while read oid
do
test-tool chmtime -1000 \
- "$objdir/$(test_oid_to_path $oid)"
+ "$objdir/$(test_oid_to_path $oid)" || exit 1
done <objects &&
test-tool chmtime -500 \
@@ -272,7 +273,7 @@ test_expect_success 'cruft commits rescue parents, trees' '
while read object
do
test-tool chmtime -1000 \
- "$objdir/$(test_oid_to_path $object)"
+ "$objdir/$(test_oid_to_path $object)" || exit 1
done <objects &&
test-tool chmtime +500 "$objdir/$(test_oid_to_path \
$(git rev-parse HEAD))" &&
@@ -345,7 +346,7 @@ test_expect_success 'expired objects are pruned' '
while read object
do
test-tool chmtime -1000 \
- "$objdir/$(test_oid_to_path $object)"
+ "$objdir/$(test_oid_to_path $object)" || exit 1
done <objects &&
keep="$(basename "$(ls $packdir/pack-*.pack)")" &&
@@ -572,23 +573,54 @@ test_expect_success 'cruft repack with no reachable objects' '
)
'
-test_expect_success 'cruft repack ignores --max-pack-size' '
+write_blob () {
+ test-tool genrandom "$@" >in &&
+ git hash-object -w -t blob in
+}
+
+find_pack () {
+ for idx in $(ls $packdir/pack-*.idx)
+ do
+ git show-index <$idx >out &&
+ if grep -q "$1" out
+ then
+ echo $idx
+ fi || return 1
+ done
+}
+
+test_expect_success 'cruft repack with --max-pack-size' '
git init max-pack-size &&
(
cd max-pack-size &&
test_commit base &&
+
# two cruft objects which exceed the maximum pack size
- test-tool genrandom foo 1048576 | git hash-object --stdin -w &&
- test-tool genrandom bar 1048576 | git hash-object --stdin -w &&
+ foo=$(write_blob foo 1048576) &&
+ bar=$(write_blob bar 1048576) &&
+ test-tool chmtime --get -1000 \
+ "$objdir/$(test_oid_to_path $foo)" >foo.mtime &&
+ test-tool chmtime --get -2000 \
+ "$objdir/$(test_oid_to_path $bar)" >bar.mtime &&
git repack --cruft --max-pack-size=1M &&
find $packdir -name "*.mtimes" >cruft &&
- test_line_count = 1 cruft &&
- test-tool pack-mtimes "$(basename "$(cat cruft)")" >objects &&
- test_line_count = 2 objects
+ test_line_count = 2 cruft &&
+
+ foo_mtimes="$(basename $(find_pack $foo) .idx).mtimes" &&
+ bar_mtimes="$(basename $(find_pack $bar) .idx).mtimes" &&
+ test-tool pack-mtimes $foo_mtimes >foo.actual &&
+ test-tool pack-mtimes $bar_mtimes >bar.actual &&
+
+ echo "$foo $(cat foo.mtime)" >foo.expect &&
+ echo "$bar $(cat bar.mtime)" >bar.expect &&
+
+ test_cmp foo.expect foo.actual &&
+ test_cmp bar.expect bar.actual &&
+ test "$foo_mtimes" != "$bar_mtimes"
)
'
-test_expect_success 'cruft repack ignores pack.packSizeLimit' '
+test_expect_success 'cruft repack with pack.packSizeLimit' '
(
cd max-pack-size &&
# repack everything back together to remove the existing cruft
@@ -598,9 +630,12 @@ test_expect_success 'cruft repack ignores pack.packSizeLimit' '
# ensure the same post condition is met when --max-pack-size
# would otherwise be inferred from the configuration
find $packdir -name "*.mtimes" >cruft &&
- test_line_count = 1 cruft &&
- test-tool pack-mtimes "$(basename "$(cat cruft)")" >objects &&
- test_line_count = 2 objects
+ test_line_count = 2 cruft &&
+ for pack in $(cat cruft)
+ do
+ test-tool pack-mtimes "$(basename $pack)" >objects &&
+ test_line_count = 1 objects || return 1
+ done
)
'
@@ -738,4 +773,175 @@ test_expect_success 'cruft objects are freshend via loose' '
)
'
+test_expect_success 'gc.recentObjectsHook' '
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+
+ # Create a handful of objects.
+ #
+ # - one reachable commit, "base", designated for the reachable
+ # pack
+ # - one unreachable commit, "cruft.discard", which is marked
+ # for deletion
+ # - one unreachable commit, "cruft.old", which would be marked
+ # for deletion, but is rescued as an extra cruft tip
+ # - one unreachable commit, "cruft.new", which is not marked
+ # for deletion
+ test_commit base &&
+ git branch -M main &&
+
+ git checkout --orphan discard &&
+ git rm -fr . &&
+ test_commit --no-tag cruft.discard &&
+
+ git checkout --orphan old &&
+ git rm -fr . &&
+ test_commit --no-tag cruft.old &&
+ cruft_old="$(git rev-parse HEAD)" &&
+
+ git checkout --orphan new &&
+ git rm -fr . &&
+ test_commit --no-tag cruft.new &&
+ cruft_new="$(git rev-parse HEAD)" &&
+
+ git checkout main &&
+ git branch -D discard old new &&
+ git reflog expire --all --expire=all &&
+
+ # mark cruft.old with an mtime that is many minutes
+ # older than the expiration period, and mark cruft.new
+ # with an mtime that is in the future (and thus not
+ # eligible for pruning).
+ test-tool chmtime -2000 "$objdir/$(test_oid_to_path $cruft_old)" &&
+ test-tool chmtime +1000 "$objdir/$(test_oid_to_path $cruft_new)" &&
+
+ # Write the list of cruft objects we expect to
+ # accumulate, which is comprised of everything reachable
+ # from cruft.old and cruft.new, but not cruft.discard.
+ git rev-list --objects --no-object-names \
+ $cruft_old $cruft_new >cruft.raw &&
+ sort cruft.raw >cruft.expect &&
+
+ # Write the script to list extra tips, which are limited
+ # to cruft.old, in this case.
+ write_script extra-tips <<-EOF &&
+ echo $cruft_old
+ EOF
+ git config gc.recentObjectsHook ./extra-tips &&
+
+ git repack --cruft --cruft-expiration=now -d &&
+
+ mtimes="$(ls .git/objects/pack/pack-*.mtimes)" &&
+ git show-index <${mtimes%.mtimes}.idx >cruft &&
+ cut -d" " -f2 cruft | sort >cruft.actual &&
+ test_cmp cruft.expect cruft.actual &&
+
+ # Ensure that the "old" objects are removed after
+ # dropping the gc.recentObjectsHook hook.
+ git config --unset gc.recentObjectsHook &&
+ git repack --cruft --cruft-expiration=now -d &&
+
+ mtimes="$(ls .git/objects/pack/pack-*.mtimes)" &&
+ git show-index <${mtimes%.mtimes}.idx >cruft &&
+ cut -d" " -f2 cruft | sort >cruft.actual &&
+
+ git rev-list --objects --no-object-names $cruft_new >cruft.raw &&
+ cp cruft.expect cruft.old &&
+ sort cruft.raw >cruft.expect &&
+ test_cmp cruft.expect cruft.actual &&
+
+ # ensure objects which are no longer in the cruft pack were
+ # removed from the repository
+ for object in $(comm -13 cruft.expect cruft.old)
+ do
+ test_must_fail git cat-file -t $object || return 1
+ done
+ )
+'
+
+test_expect_success 'multi-valued gc.recentObjectsHook' '
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+
+ test_commit base &&
+ git branch -M main &&
+
+ git checkout --orphan cruft.a &&
+ git rm -fr . &&
+ test_commit --no-tag cruft.a &&
+ cruft_a="$(git rev-parse HEAD)" &&
+
+ git checkout --orphan cruft.b &&
+ git rm -fr . &&
+ test_commit --no-tag cruft.b &&
+ cruft_b="$(git rev-parse HEAD)" &&
+
+ git checkout main &&
+ git branch -D cruft.a cruft.b &&
+ git reflog expire --all --expire=all &&
+
+ echo "echo $cruft_a" | write_script extra-tips.a &&
+ echo "echo $cruft_b" | write_script extra-tips.b &&
+ echo "false" | write_script extra-tips.c &&
+
+ git rev-list --objects --no-object-names $cruft_a $cruft_b \
+ >cruft.raw &&
+ sort cruft.raw >cruft.expect &&
+
+ # ensure that each extra cruft tip is saved by its
+ # respective hook
+ git config --add gc.recentObjectsHook ./extra-tips.a &&
+ git config --add gc.recentObjectsHook ./extra-tips.b &&
+ git repack --cruft --cruft-expiration=now -d &&
+
+ mtimes="$(ls .git/objects/pack/pack-*.mtimes)" &&
+ git show-index <${mtimes%.mtimes}.idx >cruft &&
+ cut -d" " -f2 cruft | sort >cruft.actual &&
+ test_cmp cruft.expect cruft.actual &&
+
+ # ensure that a dirty exit halts cruft pack generation
+ git config --add gc.recentObjectsHook ./extra-tips.c &&
+ test_must_fail git repack --cruft --cruft-expiration=now -d 2>err &&
+ grep "unable to enumerate additional recent objects" err &&
+
+ # and that the existing cruft pack is left alone
+ test_path_is_file "$mtimes"
+ )
+'
+
+test_expect_success 'additional cruft blobs via gc.recentObjectsHook' '
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+
+ test_commit base &&
+
+ blob=$(echo "unreachable" | git hash-object -w --stdin) &&
+
+ # mark the unreachable blob we wrote above as having
+ # aged out of the retention period
+ test-tool chmtime -2000 "$objdir/$(test_oid_to_path $blob)" &&
+
+ # Write the script to list extra tips, which is just the
+ # extra blob as above.
+ write_script extra-tips <<-EOF &&
+ echo $blob
+ EOF
+ git config gc.recentObjectsHook ./extra-tips &&
+
+ git repack --cruft --cruft-expiration=now -d &&
+
+ mtimes="$(ls .git/objects/pack/pack-*.mtimes)" &&
+ git show-index <${mtimes%.mtimes}.idx >cruft &&
+ cut -d" " -f2 cruft >actual &&
+ echo $blob >expect &&
+ test_cmp expect actual
+ )
+'
+
test_done
diff --git a/t/t5330-no-lazy-fetch-with-commit-graph.sh b/t/t5330-no-lazy-fetch-with-commit-graph.sh
index 2cc7fd7..5eb28f0 100755
--- a/t/t5330-no-lazy-fetch-with-commit-graph.sh
+++ b/t/t5330-no-lazy-fetch-with-commit-graph.sh
@@ -2,6 +2,7 @@
test_description='test for no lazy fetch with the commit-graph'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup: prepare a repository with a commit' '
diff --git a/t/t5331-pack-objects-stdin.sh b/t/t5331-pack-objects-stdin.sh
new file mode 100755
index 0000000..2dcf1ee
--- /dev/null
+++ b/t/t5331-pack-objects-stdin.sh
@@ -0,0 +1,240 @@
+#!/bin/sh
+
+test_description='pack-objects --stdin'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+packed_objects () {
+ git show-index <"$1" >tmp-object-list &&
+ cut -d' ' -f2 tmp-object-list | sort &&
+ rm tmp-object-list
+ }
+
+test_expect_success 'setup for --stdin-packs tests' '
+ git init stdin-packs &&
+ (
+ cd stdin-packs &&
+
+ test_commit A &&
+ test_commit B &&
+ test_commit C &&
+
+ for id in A B C
+ do
+ git pack-objects .git/objects/pack/pack-$id \
+ --incremental --revs <<-EOF || exit 1
+ refs/tags/$id
+ EOF
+ done &&
+
+ ls -la .git/objects/pack
+ )
+'
+
+test_expect_success '--stdin-packs with excluded packs' '
+ (
+ cd stdin-packs &&
+
+ PACK_A="$(basename .git/objects/pack/pack-A-*.pack)" &&
+ PACK_B="$(basename .git/objects/pack/pack-B-*.pack)" &&
+ PACK_C="$(basename .git/objects/pack/pack-C-*.pack)" &&
+
+ git pack-objects test --stdin-packs <<-EOF &&
+ $PACK_A
+ ^$PACK_B
+ $PACK_C
+ EOF
+
+ (
+ git show-index <$(ls .git/objects/pack/pack-A-*.idx) &&
+ git show-index <$(ls .git/objects/pack/pack-C-*.idx)
+ ) >expect.raw &&
+ git show-index <$(ls test-*.idx) >actual.raw &&
+
+ cut -d" " -f2 <expect.raw | sort >expect &&
+ cut -d" " -f2 <actual.raw | sort >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success '--stdin-packs is incompatible with --filter' '
+ (
+ cd stdin-packs &&
+ test_must_fail git pack-objects --stdin-packs --stdout \
+ --filter=blob:none </dev/null 2>err &&
+ test_grep "cannot use --filter with --stdin-packs" err
+ )
+'
+
+test_expect_success '--stdin-packs is incompatible with --revs' '
+ (
+ cd stdin-packs &&
+ test_must_fail git pack-objects --stdin-packs --revs out \
+ </dev/null 2>err &&
+ test_grep "cannot use internal rev list with --stdin-packs" err
+ )
+'
+
+test_expect_success '--stdin-packs with loose objects' '
+ (
+ cd stdin-packs &&
+
+ PACK_A="$(basename .git/objects/pack/pack-A-*.pack)" &&
+ PACK_B="$(basename .git/objects/pack/pack-B-*.pack)" &&
+ PACK_C="$(basename .git/objects/pack/pack-C-*.pack)" &&
+
+ test_commit D && # loose
+
+ git pack-objects test2 --stdin-packs --unpacked <<-EOF &&
+ $PACK_A
+ ^$PACK_B
+ $PACK_C
+ EOF
+
+ (
+ git show-index <$(ls .git/objects/pack/pack-A-*.idx) &&
+ git show-index <$(ls .git/objects/pack/pack-C-*.idx) &&
+ git rev-list --objects --no-object-names \
+ refs/tags/C..refs/tags/D
+
+ ) >expect.raw &&
+ ls -la . &&
+ git show-index <$(ls test2-*.idx) >actual.raw &&
+
+ cut -d" " -f2 <expect.raw | sort >expect &&
+ cut -d" " -f2 <actual.raw | sort >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success '--stdin-packs with broken links' '
+ (
+ cd stdin-packs &&
+
+ # make an unreachable object with a bogus parent
+ git cat-file -p HEAD >commit &&
+ sed "s/$(git rev-parse HEAD^)/$(test_oid zero)/" <commit |
+ git hash-object -w -t commit --stdin >in &&
+
+ git pack-objects .git/objects/pack/pack-D <in &&
+
+ PACK_A="$(basename .git/objects/pack/pack-A-*.pack)" &&
+ PACK_B="$(basename .git/objects/pack/pack-B-*.pack)" &&
+ PACK_C="$(basename .git/objects/pack/pack-C-*.pack)" &&
+ PACK_D="$(basename .git/objects/pack/pack-D-*.pack)" &&
+
+ git pack-objects test3 --stdin-packs --unpacked <<-EOF &&
+ $PACK_A
+ ^$PACK_B
+ $PACK_C
+ $PACK_D
+ EOF
+
+ (
+ git show-index <$(ls .git/objects/pack/pack-A-*.idx) &&
+ git show-index <$(ls .git/objects/pack/pack-C-*.idx) &&
+ git show-index <$(ls .git/objects/pack/pack-D-*.idx) &&
+ git rev-list --objects --no-object-names \
+ refs/tags/C..refs/tags/D
+ ) >expect.raw &&
+ git show-index <$(ls test3-*.idx) >actual.raw &&
+
+ cut -d" " -f2 <expect.raw | sort >expect &&
+ cut -d" " -f2 <actual.raw | sort >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'pack-objects --stdin with duplicate packfile' '
+ test_when_finished "rm -fr repo" &&
+
+ git init repo &&
+ (
+ cd repo &&
+ test_commit "commit" &&
+ git repack -ad &&
+
+ {
+ basename .git/objects/pack/pack-*.pack &&
+ basename .git/objects/pack/pack-*.pack
+ } >packfiles &&
+
+ git pack-objects --stdin-packs generated-pack <packfiles &&
+ packed_objects .git/objects/pack/pack-*.idx >expect &&
+ packed_objects generated-pack-*.idx >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'pack-objects --stdin with same packfile excluded and included' '
+ test_when_finished "rm -fr repo" &&
+
+ git init repo &&
+ (
+ cd repo &&
+ test_commit "commit" &&
+ git repack -ad &&
+
+ {
+ basename .git/objects/pack/pack-*.pack &&
+ printf "^%s\n" "$(basename .git/objects/pack/pack-*.pack)"
+ } >packfiles &&
+
+ git pack-objects --stdin-packs generated-pack <packfiles &&
+ packed_objects generated-pack-*.idx >packed-objects &&
+ test_must_be_empty packed-objects
+ )
+'
+
+test_expect_success 'pack-objects --stdin with packfiles from alternate object database' '
+ test_when_finished "rm -fr shared member" &&
+
+ # Set up a shared repository with a single packfile.
+ git init shared &&
+ test_commit -C shared "shared-objects" &&
+ git -C shared repack -ad &&
+ basename shared/.git/objects/pack/pack-*.pack >packfile &&
+
+ # Set up a repository that is connected to the shared repository. This
+ # repository has no objects on its own, but we still expect to be able
+ # to pack objects from its alternate.
+ git clone --shared shared member &&
+ git -C member pack-objects --stdin-packs generated-pack <packfile &&
+ test_cmp shared/.git/objects/pack/pack-*.pack member/generated-pack-*.pack
+'
+
+test_expect_success 'pack-objects --stdin with packfiles from main and alternate object database' '
+ test_when_finished "rm -fr shared member" &&
+
+ # Set up a shared repository with a single packfile.
+ git init shared &&
+ test_commit -C shared "shared-commit" &&
+ git -C shared repack -ad &&
+
+ # Set up a repository that is connected to the shared repository. This
+ # repository has a second packfile so that we can verify that it is
+ # possible to write packs that include packfiles from different object
+ # databases.
+ git clone --shared shared member &&
+ test_commit -C member "local-commit" &&
+ git -C member repack -dl &&
+
+ {
+ basename shared/.git/objects/pack/pack-*.pack &&
+ basename member/.git/objects/pack/pack-*.pack
+ } >packfiles &&
+
+ {
+ packed_objects shared/.git/objects/pack/pack-*.idx &&
+ packed_objects member/.git/objects/pack/pack-*.idx
+ } | sort >expected-objects &&
+
+ git -C member pack-objects --stdin-packs generated-pack <packfiles &&
+ packed_objects member/generated-pack-*.idx >actual-objects &&
+ test_cmp expected-objects actual-objects
+'
+
+test_done
diff --git a/t/t5332-multi-pack-reuse.sh b/t/t5332-multi-pack-reuse.sh
new file mode 100755
index 0000000..3c20738
--- /dev/null
+++ b/t/t5332-multi-pack-reuse.sh
@@ -0,0 +1,207 @@
+#!/bin/sh
+
+test_description='pack-objects multi-pack reuse'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-bitmap.sh
+
+objdir=.git/objects
+packdir=$objdir/pack
+
+test_pack_reused () {
+ test_trace2_data pack-objects pack-reused "$1"
+}
+
+test_packs_reused () {
+ test_trace2_data pack-objects packs-reused "$1"
+}
+
+
+# pack_position <object> </path/to/pack.idx
+pack_position () {
+ git show-index >objects &&
+ grep "$1" objects | cut -d" " -f1
+}
+
+# test_pack_objects_reused_all <pack-reused> <packs-reused>
+test_pack_objects_reused_all () {
+ : >trace2.txt &&
+ GIT_TRACE2_EVENT="$PWD/trace2.txt" \
+ git pack-objects --stdout --revs --all --delta-base-offset \
+ >/dev/null &&
+
+ test_pack_reused "$1" <trace2.txt &&
+ test_packs_reused "$2" <trace2.txt
+}
+
+# test_pack_objects_reused <pack-reused> <packs-reused>
+test_pack_objects_reused () {
+ : >trace2.txt &&
+ GIT_TRACE2_EVENT="$PWD/trace2.txt" \
+ git pack-objects --stdout --revs >/dev/null &&
+
+ test_pack_reused "$1" <trace2.txt &&
+ test_packs_reused "$2" <trace2.txt
+}
+
+test_expect_success 'preferred pack is reused for single-pack reuse' '
+ test_config pack.allowPackReuse single &&
+
+ for i in A B
+ do
+ test_commit "$i" &&
+ git repack -d || return 1
+ done &&
+
+ git multi-pack-index write --bitmap &&
+
+ test_pack_objects_reused_all 3 1
+'
+
+test_expect_success 'multi-pack reuse is disabled by default' '
+ test_pack_objects_reused_all 3 1
+'
+
+test_expect_success 'feature.experimental implies multi-pack reuse' '
+ test_config feature.experimental true &&
+
+ test_pack_objects_reused_all 6 2
+'
+
+test_expect_success 'multi-pack reuse can be disabled with feature.experimental' '
+ test_config feature.experimental true &&
+ test_config pack.allowPackReuse single &&
+
+ test_pack_objects_reused_all 3 1
+'
+
+test_expect_success 'enable multi-pack reuse' '
+ git config pack.allowPackReuse multi
+'
+
+test_expect_success 'reuse all objects from subset of bitmapped packs' '
+ test_commit C &&
+ git repack -d &&
+
+ git multi-pack-index write --bitmap &&
+
+ cat >in <<-EOF &&
+ $(git rev-parse C)
+ ^$(git rev-parse A)
+ EOF
+
+ test_pack_objects_reused 6 2 <in
+'
+
+test_expect_success 'reuse all objects from all packs' '
+ test_pack_objects_reused_all 9 3
+'
+
+test_expect_success 'reuse objects from first pack with middle gap' '
+ for i in D E F
+ do
+ test_commit "$i" || return 1
+ done &&
+
+ # Set "pack.window" to zero to ensure that we do not create any
+ # deltas, which could alter the amount of pack reuse we perform
+ # (if, for e.g., we are not sending one or more bases).
+ D="$(git -c pack.window=0 pack-objects --all --unpacked $packdir/pack)" &&
+
+ d_pos="$(pack_position $(git rev-parse D) <$packdir/pack-$D.idx)" &&
+ e_pos="$(pack_position $(git rev-parse E) <$packdir/pack-$D.idx)" &&
+ f_pos="$(pack_position $(git rev-parse F) <$packdir/pack-$D.idx)" &&
+
+ # commits F, E, and D, should appear in that order at the
+ # beginning of the pack
+ test $f_pos -lt $e_pos &&
+ test $e_pos -lt $d_pos &&
+
+ # Ensure that the pack we are constructing sorts ahead of any
+ # other packs in lexical/bitmap order by choosing it as the
+ # preferred pack.
+ git multi-pack-index write --bitmap --preferred-pack="pack-$D.idx" &&
+
+ cat >in <<-EOF &&
+ $(git rev-parse E)
+ ^$(git rev-parse D)
+ EOF
+
+ test_pack_objects_reused 3 1 <in
+'
+
+test_expect_success 'reuse objects from middle pack with middle gap' '
+ rm -fr $packdir/multi-pack-index* &&
+
+ # Ensure that the pack we are constructing sort into any
+ # position *but* the first one, by choosing a different pack as
+ # the preferred one.
+ git multi-pack-index write --bitmap --preferred-pack="pack-$A.idx" &&
+
+ cat >in <<-EOF &&
+ $(git rev-parse E)
+ ^$(git rev-parse D)
+ EOF
+
+ test_pack_objects_reused 3 1 <in
+'
+
+test_expect_success 'omit delta with uninteresting base (same pack)' '
+ git repack -adk &&
+
+ test_seq 32 >f &&
+ git add f &&
+ test_tick &&
+ git commit -m "delta" &&
+ delta="$(git rev-parse HEAD)" &&
+
+ test_seq 64 >f &&
+ test_tick &&
+ git commit -a -m "base" &&
+ base="$(git rev-parse HEAD)" &&
+
+ test_commit other &&
+
+ git repack -d &&
+
+ have_delta "$(git rev-parse $delta:f)" "$(git rev-parse $base:f)" &&
+
+ git multi-pack-index write --bitmap &&
+
+ cat >in <<-EOF &&
+ $(git rev-parse other)
+ ^$base
+ EOF
+
+ # We can only reuse the 3 objects corresponding to "other" from
+ # the latest pack.
+ #
+ # This is because even though we want "delta", we do not want
+ # "base", meaning that we have to inflate the delta/base-pair
+ # corresponding to the blob in commit "delta", which bypasses
+ # the pack-reuse mechanism.
+ #
+ # The remaining objects from the other pack are similarly not
+ # reused because their objects are on the uninteresting side of
+ # the query.
+ test_pack_objects_reused 3 1 <in
+'
+
+test_expect_success 'omit delta from uninteresting base (cross pack)' '
+ cat >in <<-EOF &&
+ $(git rev-parse $base)
+ ^$(git rev-parse $delta)
+ EOF
+
+ P="$(git pack-objects --revs $packdir/pack <in)" &&
+
+ git multi-pack-index write --bitmap --preferred-pack="pack-$P.idx" &&
+
+ packs_nr="$(find $packdir -type f -name "pack-*.pack" | wc -l)" &&
+ objects_nr="$(git rev-list --count --all --objects)" &&
+
+ test_pack_objects_reused_all $(($objects_nr - 1)) $packs_nr
+'
+
+test_done
diff --git a/t/t5351-unpack-large-objects.sh b/t/t5351-unpack-large-objects.sh
new file mode 100755
index 0000000..43cbcd5
--- /dev/null
+++ b/t/t5351-unpack-large-objects.sh
@@ -0,0 +1,103 @@
+#!/bin/sh
+#
+# Copyright (c) 2022 Han Xin
+#
+
+test_description='git unpack-objects with large objects'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+prepare_dest () {
+ test_when_finished "rm -rf dest.git" &&
+ git init --bare dest.git &&
+ git -C dest.git config core.bigFileThreshold "$1"
+}
+
+test_expect_success "create large objects (1.5 MB) and PACK" '
+ test-tool genrandom foo 1500000 >big-blob &&
+ test_commit --append foo big-blob &&
+ test-tool genrandom bar 1500000 >big-blob &&
+ test_commit --append bar big-blob &&
+ PACK=$(echo HEAD | git pack-objects --revs pack) &&
+ git verify-pack -v pack-$PACK.pack >out &&
+ sed -n -e "s/^\([0-9a-f][0-9a-f]*\).*\(commit\|tree\|blob\).*/\1/p" \
+ <out >obj-list
+'
+
+test_expect_success 'set memory limitation to 1MB' '
+ GIT_ALLOC_LIMIT=1m &&
+ export GIT_ALLOC_LIMIT
+'
+
+test_expect_success 'unpack-objects failed under memory limitation' '
+ prepare_dest 2m &&
+ test_must_fail git -C dest.git unpack-objects <pack-$PACK.pack 2>err &&
+ grep "fatal: attempting to allocate" err
+'
+
+test_expect_success 'unpack-objects works with memory limitation in dry-run mode' '
+ prepare_dest 2m &&
+ git -C dest.git unpack-objects -n <pack-$PACK.pack &&
+ test_stdout_line_count = 0 find dest.git/objects -type f &&
+ test_dir_is_empty dest.git/objects/pack
+'
+
+test_expect_success 'unpack big object in stream' '
+ prepare_dest 1m &&
+ git -C dest.git unpack-objects <pack-$PACK.pack &&
+ test_dir_is_empty dest.git/objects/pack
+'
+
+check_fsync_events () {
+ local trace="$1" &&
+ shift &&
+
+ cat >expect &&
+ sed -n \
+ -e '/^{"event":"counter",.*"category":"fsync",/ {
+ s/.*"category":"fsync",//;
+ s/}$//;
+ p;
+ }' \
+ <"$trace" >actual &&
+ test_cmp expect actual
+}
+
+BATCH_CONFIGURATION='-c core.fsync=loose-object -c core.fsyncmethod=batch'
+
+test_expect_success 'unpack big object in stream (core.fsyncmethod=batch)' '
+ prepare_dest 1m &&
+ GIT_TRACE2_EVENT="$(pwd)/trace2.txt" \
+ GIT_TEST_FSYNC=true \
+ git -C dest.git $BATCH_CONFIGURATION unpack-objects <pack-$PACK.pack &&
+ if grep "core.fsyncMethod = batch is unsupported" trace2.txt
+ then
+ flush_count=7
+ else
+ flush_count=1
+ fi &&
+ check_fsync_events trace2.txt <<-EOF &&
+ "name":"writeout-only","count":6
+ "name":"hardware-flush","count":$flush_count
+ EOF
+
+ test_dir_is_empty dest.git/objects/pack &&
+ git -C dest.git cat-file --batch-check="%(objectname)" <obj-list >current &&
+ cmp obj-list current
+'
+
+test_expect_success 'do not unpack existing large objects' '
+ prepare_dest 1m &&
+ git -C dest.git index-pack --stdin <pack-$PACK.pack &&
+ git -C dest.git unpack-objects <pack-$PACK.pack &&
+
+ # The destination came up with the exact same pack...
+ DEST_PACK=$(echo dest.git/objects/pack/pack-*.pack) &&
+ cmp pack-$PACK.pack $DEST_PACK &&
+
+ # ...and wrote no loose objects
+ test_stdout_line_count = 0 find dest.git/objects -type f ! -name "pack-*"
+'
+
+test_done
diff --git a/t/t5401-update-hooks.sh b/t/t5401-update-hooks.sh
index 001b7a1..d8cadee 100755
--- a/t/t5401-update-hooks.sh
+++ b/t/t5401-update-hooks.sh
@@ -123,7 +123,7 @@ remote: STDOUT post-update
remote: STDERR post-update
EOF
test_expect_success 'send-pack stderr contains hook messages' '
- grep ^remote: send.err | sed "s/ *\$//" >actual &&
+ sed -n "/^remote:/s/ *\$//p" send.err >actual &&
test_cmp expect actual
'
@@ -133,10 +133,8 @@ test_expect_success 'pre-receive hook that forgets to read its input' '
EOF
rm -f victim.git/hooks/update victim.git/hooks/post-update &&
- for v in $(test_seq 100 999)
- do
- git branch branch_$v main || return
- done &&
+ printf "create refs/heads/branch_%d main\n" $(test_seq 100 999) >input &&
+ git update-ref --stdin <input &&
git push ./victim.git "+refs/heads/*:refs/heads/*"
'
diff --git a/t/t5402-post-merge-hook.sh b/t/t5402-post-merge-hook.sh
index 915af2d..46ebdfb 100755
--- a/t/t5402-post-merge-hook.sh
+++ b/t/t5402-post-merge-hook.sh
@@ -7,6 +7,7 @@ test_description='Test the post-merge hook.'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t5403-post-checkout-hook.sh b/t/t5403-post-checkout-hook.sh
index 978f240..cfaae54 100755
--- a/t/t5403-post-checkout-hook.sh
+++ b/t/t5403-post-checkout-hook.sh
@@ -7,6 +7,7 @@ test_description='Test the post-checkout hook.'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t5404-tracking-branches.sh b/t/t5404-tracking-branches.sh
index cc07889..51737ee 100755
--- a/t/t5404-tracking-branches.sh
+++ b/t/t5404-tracking-branches.sh
@@ -5,6 +5,7 @@ test_description='tracking branch update checks for git push'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
diff --git a/t/t5405-send-pack-rewind.sh b/t/t5405-send-pack-rewind.sh
index 11f0323..1686ac1 100755
--- a/t/t5405-send-pack-rewind.sh
+++ b/t/t5405-send-pack-rewind.sh
@@ -5,6 +5,7 @@ test_description='forced push to replace commit we do not have'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t5406-remote-rejects.sh b/t/t5406-remote-rejects.sh
index dcbeb42..d6a9946 100755
--- a/t/t5406-remote-rejects.sh
+++ b/t/t5406-remote-rejects.sh
@@ -2,6 +2,7 @@
test_description='remote push rejects are reported by client'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
diff --git a/t/t5407-post-rewrite-hook.sh b/t/t5407-post-rewrite-hook.sh
index 5f3ff05..ad7f8c6 100755
--- a/t/t5407-post-rewrite-hook.sh
+++ b/t/t5407-post-rewrite-hook.sh
@@ -17,6 +17,12 @@ test_expect_success 'setup' '
git checkout A^0 &&
test_commit E bar E &&
test_commit F foo F &&
+ git checkout B &&
+ git merge E &&
+ git tag merge-E &&
+ test_commit G G &&
+ test_commit H H &&
+ test_commit I I &&
git checkout main &&
test_hook --setup post-rewrite <<-EOF
@@ -173,6 +179,48 @@ test_fail_interactive_rebase () {
)
}
+test_expect_success 'git rebase with failed pick' '
+ clear_hook_input &&
+ cat >todo <<-\EOF &&
+ exec >bar
+ merge -C merge-E E
+ exec >G
+ pick G
+ exec >H 2>I
+ pick H
+ fixup I
+ EOF
+
+ (
+ set_replace_editor todo &&
+ test_must_fail git rebase -i D D 2>err
+ ) &&
+ grep "would be overwritten" err &&
+ rm bar &&
+
+ test_must_fail git rebase --continue 2>err &&
+ grep "would be overwritten" err &&
+ rm G &&
+
+ test_must_fail git rebase --continue 2>err &&
+ grep "would be overwritten" err &&
+ rm H &&
+
+ test_must_fail git rebase --continue 2>err &&
+ grep "would be overwritten" err &&
+ rm I &&
+
+ git rebase --continue &&
+ echo rebase >expected.args &&
+ cat >expected.data <<-EOF &&
+ $(git rev-parse merge-E) $(git rev-parse HEAD~2)
+ $(git rev-parse G) $(git rev-parse HEAD~1)
+ $(git rev-parse H) $(git rev-parse HEAD)
+ $(git rev-parse I) $(git rev-parse HEAD)
+ EOF
+ verify_hook_input
+'
+
test_expect_success 'git rebase -i (unchanged)' '
git reset --hard D &&
clear_hook_input &&
diff --git a/t/t5411/test-0026-push-options.sh b/t/t5411/test-0026-push-options.sh
index 6dfc7b1..510fff3 100644
--- a/t/t5411/test-0026-push-options.sh
+++ b/t/t5411/test-0026-push-options.sh
@@ -18,7 +18,7 @@ test_expect_success "proc-receive: not support push options ($PROTOCOL)" '
HEAD:refs/for/main/topic \
>out-$test_count 2>&1 &&
make_user_friendly_and_stable_output <out-$test_count >actual &&
- test_i18ngrep "fatal: the receiving end does not support push options" \
+ test_grep "fatal: the receiving end does not support push options" \
actual &&
test_cmp_refs -C "$upstream" <<-EOF
diff --git a/t/t5411/test-0027-push-options--porcelain.sh b/t/t5411/test-0027-push-options--porcelain.sh
index 768880b..9435457 100644
--- a/t/t5411/test-0027-push-options--porcelain.sh
+++ b/t/t5411/test-0027-push-options--porcelain.sh
@@ -19,7 +19,7 @@ test_expect_success "proc-receive: not support push options ($PROTOCOL/porcelain
HEAD:refs/for/main/topic \
>out-$test_count 2>&1 &&
make_user_friendly_and_stable_output <out-$test_count >actual &&
- test_i18ngrep "fatal: the receiving end does not support push options" \
+ test_grep "fatal: the receiving end does not support push options" \
actual &&
test_cmp_refs -C "$upstream" <<-EOF
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index ee6d2dd..1bc15a3 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -132,13 +132,18 @@ test_expect_success 'single branch object count' '
'
test_expect_success 'single given branch clone' '
- git clone --single-branch --branch A "file://$(pwd)/." branch-a &&
- test_must_fail git --git-dir=branch-a/.git rev-parse origin/B
+ GIT_TRACE2_EVENT="$(pwd)/branch-a/trace2_event" \
+ git clone --single-branch --branch A "file://$(pwd)/." branch-a &&
+ test_must_fail git --git-dir=branch-a/.git rev-parse origin/B &&
+ grep \"fetch-info\".*\"haves\":0 branch-a/trace2_event &&
+ grep \"fetch-info\".*\"wants\":1 branch-a/trace2_event
'
test_expect_success 'clone shallow depth 1' '
- git clone --no-single-branch --depth 1 "file://$(pwd)/." shallow0 &&
- test "$(git --git-dir=shallow0/.git rev-list --count HEAD)" = 1
+ GIT_TRACE2_EVENT="$(pwd)/shallow0/trace2_event" \
+ git clone --no-single-branch --depth 1 "file://$(pwd)/." shallow0 &&
+ test "$(git --git-dir=shallow0/.git rev-list --count HEAD)" = 1 &&
+ grep \"fetch-info\".*\"depth\":1 shallow0/trace2_event
'
test_expect_success 'clone shallow depth 1 with fsck' '
@@ -235,7 +240,10 @@ test_expect_success 'add two more (part 2)' '
test_expect_success 'deepening pull in shallow repo' '
(
cd shallow &&
- git pull --depth 4 .. B
+ GIT_TRACE2_EVENT="$(pwd)/trace2_event" \
+ git pull --depth 4 .. B &&
+ grep \"fetch-info\".*\"depth\":4 trace2_event &&
+ grep \"fetch-info\".*\"shallows\":2 trace2_event
)
'
@@ -306,9 +314,12 @@ test_expect_success 'fetch --depth --no-shallow' '
test_expect_success 'turn shallow to complete repository' '
(
cd shallow &&
- git fetch --unshallow &&
+ GIT_TRACE2_EVENT="$(pwd)/trace2_event" \
+ git fetch --unshallow &&
! test -f .git/shallow &&
- git fsck --full
+ git fsck --full &&
+ grep \"fetch-info\".*\"shallows\":2 trace2_event &&
+ grep \"fetch-info\".*\"depth\":2147483647 trace2_event
)
'
@@ -403,10 +414,11 @@ test_expect_success 'in_vain not triggered before first ACK' '
test_commit -C myserver bar &&
git -C myclient fetch --progress origin 2>log &&
- test_i18ngrep "remote: Total 3 " log
+ test_grep "remote: Total 3 " log
'
test_expect_success 'in_vain resetted upon ACK' '
+ test_when_finished rm -f log trace2 &&
rm -rf myserver myclient &&
git init myserver &&
@@ -432,8 +444,9 @@ test_expect_success 'in_vain resetted upon ACK' '
# first. The 256th commit is common between the client and the server,
# and should reset in_vain. This allows negotiation to continue until
# the client reports that first_anotherbranch_commit is common.
- git -C myclient fetch --progress origin main 2>log &&
- test_i18ngrep "Total 3 " log
+ GIT_TRACE2_EVENT="$(pwd)/trace2" git -C myclient fetch --progress origin main 2>log &&
+ grep \"key\":\"total_rounds\",\"value\":\"6\" trace2 &&
+ test_grep "Total 3 " log
'
test_expect_success 'fetch in shallow repo unreachable shallow objects' '
@@ -457,7 +470,7 @@ test_expect_success 'fetch creating new shallow root' '
git fetch --depth=1 --progress 2>actual &&
# This should fetch only the empty commit, no tree or
# blob objects
- test_i18ngrep "remote: Total 1" actual
+ test_grep "remote: Total 1" actual
)
'
@@ -692,7 +705,7 @@ test_expect_success 'fetch-pack cannot fetch a raw sha1 that is not advertised a
# unadvertised objects, so restrict this test to v0.
test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -C client fetch-pack ../server \
$(git -C server rev-parse refs/heads/main^) 2>err &&
- test_i18ngrep "Server does not allow request for unadvertised object" err
+ test_grep "Server does not allow request for unadvertised object" err
'
check_prot_path () {
@@ -824,13 +837,15 @@ test_expect_success 'clone shallow since ...' '
'
test_expect_success 'fetch shallow since ...' '
- git -C shallow11 fetch --shallow-since "200000000 +0700" origin &&
+ GIT_TRACE2_EVENT=$(pwd)/shallow11/trace2_event \
+ git -C shallow11 fetch --shallow-since "200000000 +0700" origin &&
git -C shallow11 log --pretty=tformat:%s origin/main >actual &&
cat >expected <<-\EOF &&
three
two
EOF
- test_cmp expected actual
+ test_cmp expected actual &&
+ grep \"fetch-info\".*\"deepen-since\":true shallow11/trace2_event
'
test_expect_success 'clone shallow since selects no commits' '
@@ -985,13 +1000,16 @@ test_expect_success 'filtering by size' '
test_config -C server uploadpack.allowfilter 1 &&
test_create_repo client &&
- git -C client fetch-pack --filter=blob:limit=0 ../server HEAD &&
+ GIT_TRACE2_EVENT=$(pwd)/client/trace2_event \
+ git -C client fetch-pack --filter=blob:limit=0 ../server HEAD &&
# Ensure that object is not inadvertently fetched
commit=$(git -C server rev-parse HEAD) &&
blob=$(git hash-object server/one.t) &&
git -C client rev-list --objects --missing=allow-any "$commit" >oids &&
- ! grep "$blob" oids
+ ! grep "$blob" oids &&
+
+ grep \"fetch-info\".*\"filter\":\"blob:limit\" client/trace2_event
'
test_expect_success 'filtering by size has no effect if support for it is not advertised' '
@@ -1008,7 +1026,7 @@ test_expect_success 'filtering by size has no effect if support for it is not ad
git -C client rev-list --objects --missing=allow-any "$commit" >oids &&
grep "$blob" oids &&
- test_i18ngrep "filtering not recognized by server" err
+ test_grep "filtering not recognized by server" err
'
fetch_filter_blob_limit_zero () {
diff --git a/t/t5502-quickfetch.sh b/t/t5502-quickfetch.sh
index b160f8b..7b3ff21 100755
--- a/t/t5502-quickfetch.sh
+++ b/t/t5502-quickfetch.sh
@@ -5,6 +5,7 @@ test_description='test quickfetch from local'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh
index 195fc64..5ebbaa4 100755
--- a/t/t5503-tagfollow.sh
+++ b/t/t5503-tagfollow.sh
@@ -5,6 +5,7 @@ test_description='test automatic tag following'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# End state of the repository:
diff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh
index b0b795a..138e677 100755
--- a/t/t5504-fetch-receive-strict.sh
+++ b/t/t5504-fetch-receive-strict.sh
@@ -4,6 +4,7 @@ test_description='fetch/receive strict mode'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup and inject "corrupt or missing" object' '
@@ -138,12 +139,12 @@ This commit object intentionally broken
EOF
test_expect_success 'setup bogus commit' '
- commit="$(git hash-object -t commit -w --stdin <bogus-commit)"
+ commit="$(git hash-object --literally -t commit -w --stdin <bogus-commit)"
'
test_expect_success 'fsck with no skipList input' '
test_must_fail git fsck 2>err &&
- test_i18ngrep "missingEmail" err
+ test_grep "missingEmail" err
'
test_expect_success 'setup sorted and unsorted skipLists' '
@@ -168,9 +169,9 @@ 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=does-not-exist -c fsck.missingEmail=ignore fsck 2>err &&
- test_i18ngrep "could not open.*: does-not-exist" 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_i18ngrep "invalid object name: \[core\]" err
+ test_grep "invalid object name: \[core\]" err
'
test_expect_success 'fsck with other accepted skipList input (comments & empty lines)' '
@@ -179,14 +180,14 @@ test_expect_success 'fsck with other accepted skipList input (comments & empty l
$(test_oid 001)
EOF
test_must_fail git -c fsck.skipList=SKIP.with-comment fsck 2>err-with-comment &&
- test_i18ngrep "missingEmail" err-with-comment &&
+ test_grep "missingEmail" err-with-comment &&
cat >SKIP.with-empty-line <<-EOF &&
$(test_oid 001)
$(test_oid 002)
EOF
test_must_fail git -c fsck.skipList=SKIP.with-empty-line fsck 2>err-with-empty-line &&
- test_i18ngrep "missingEmail" err-with-empty-line
+ test_grep "missingEmail" err-with-empty-line
'
test_expect_success 'fsck no garbage output from comments & empty lines errors' '
@@ -197,7 +198,7 @@ test_expect_success 'fsck no garbage output from comments & empty lines errors'
test_expect_success 'fsck with invalid abbreviated skipList input' '
echo $commit | test_copy_bytes 20 >SKIP.abbreviated &&
test_must_fail git -c fsck.skipList=SKIP.abbreviated fsck 2>err-abbreviated &&
- test_i18ngrep "^fatal: invalid object name: " err-abbreviated
+ test_grep "^fatal: invalid object name: " err-abbreviated
'
test_expect_success 'fsck with exhaustive accepted skipList input (various types of comments etc.)' '
@@ -230,10 +231,10 @@ test_expect_success 'push with receive.fsck.skipList' '
test_must_fail git push --porcelain dst bogus &&
git --git-dir=dst/.git config receive.fsck.skipList does-not-exist &&
test_must_fail git push --porcelain dst bogus 2>err &&
- test_i18ngrep "could not open.*: does-not-exist" err &&
+ 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_i18ngrep "invalid object name: \[core\]" err &&
+ test_grep "invalid object name: \[core\]" err &&
git --git-dir=dst/.git config receive.fsck.skipList SKIP &&
git push --porcelain dst bogus
@@ -259,10 +260,10 @@ test_expect_success 'fetch with fetch.fsck.skipList' '
test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec &&
git --git-dir=dst/.git config fetch.fsck.skipList does-not-exist &&
test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec 2>err &&
- test_i18ngrep "could not open.*: does-not-exist" err &&
+ 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_i18ngrep "invalid object name: \[core\]" err &&
+ test_grep "invalid object name: \[core\]" err &&
git --git-dir=dst/.git config fetch.fsck.skipList dst/.git/SKIP &&
git --git-dir=dst/.git fetch "file://$(pwd)" $refspec
@@ -270,7 +271,7 @@ test_expect_success 'fetch with fetch.fsck.skipList' '
test_expect_success 'fsck.<unknownmsg-id> dies' '
test_must_fail git -c fsck.whatEver=ignore fsck 2>err &&
- test_i18ngrep "Unhandled message id: whatever" err
+ test_grep "Unhandled message id: whatever" err
'
test_expect_success 'push with receive.fsck.missingEmail=warn' '
@@ -292,7 +293,7 @@ test_expect_success 'push with receive.fsck.missingEmail=warn' '
receive.fsck.missingEmail warn &&
git push --porcelain dst bogus >act 2>&1 &&
grep "missingEmail" act &&
- test_i18ngrep "skipping unknown msg id.*whatever" act &&
+ test_grep "skipping unknown msg id.*whatever" act &&
git --git-dir=dst/.git branch -D bogus &&
git --git-dir=dst/.git config --add \
receive.fsck.missingEmail ignore &&
@@ -320,7 +321,7 @@ test_expect_success 'fetch with fetch.fsck.missingEmail=warn' '
fetch.fsck.missingEmail warn &&
git --git-dir=dst/.git fetch "file://$(pwd)" $refspec >act 2>&1 &&
grep "missingEmail" act &&
- test_i18ngrep "Skipping unknown msg id.*whatever" act &&
+ test_grep "Skipping unknown msg id.*whatever" act &&
rm -rf dst &&
git init dst &&
git --git-dir=dst/.git config fetch.fsckobjects true &&
@@ -352,4 +353,21 @@ test_expect_success \
grep "Cannot demote unterminatedheader" act
'
+test_expect_success 'badFilemode is not a strict error' '
+ git init --bare badmode.git &&
+ tree=$(
+ cd badmode.git &&
+ blob=$(echo blob | git hash-object -w --stdin | hex2oct) &&
+ printf "123456 foo\0${blob}" |
+ git hash-object -t tree --stdin -w --literally
+ ) &&
+
+ rm -rf dst.git &&
+ git init --bare dst.git &&
+ git -C dst.git config transfer.fsckObjects true &&
+
+ git -C badmode.git push ../dst.git $tree:refs/tags/tree 2>err &&
+ grep "$tree: badFilemode" err
+'
+
test_done
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index fff14e1..7789ff1 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -241,6 +241,26 @@ test_expect_success 'add invalid foreign_vcs remote' '
test_cmp expect actual
'
+test_expect_success 'without subcommand' '
+ echo origin >expect &&
+ git -C test remote >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'without subcommand accepts -v' '
+ cat >expect <<-EOF &&
+ origin $(pwd)/one (fetch)
+ origin $(pwd)/one (push)
+ EOF
+ git -C test remote -v >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'without subcommand does not take arguments' '
+ test_expect_code 129 git -C test remote origin 2>err &&
+ grep "^error: unknown subcommand:" err
+'
+
cat >test/expect <<EOF
* remote origin
Fetch URL: $(pwd)/one
@@ -302,6 +322,52 @@ test_expect_success 'show' '
)
'
+cat >expect <<EOF
+* remote origin
+ Fetch URL: $(pwd)/one
+ Push URL: $(pwd)/one
+ HEAD branch: main
+ Remote branches:
+ main skipped
+ side tracked
+ Local branches configured for 'git pull':
+ ahead merges with remote main
+ main merges with remote main
+ Local refs configured for 'git push':
+ main pushes to main (local out of date)
+ main pushes to upstream (create)
+EOF
+
+test_expect_success 'show with negative refspecs' '
+ test_when_finished "git -C test config --unset-all --fixed-value remote.origin.fetch ^refs/heads/main" &&
+ git -C test config --add remote.origin.fetch ^refs/heads/main &&
+ git -C test remote show origin >output &&
+ test_cmp expect output
+'
+
+cat >expect <<EOF
+* remote origin
+ Fetch URL: $(pwd)/one
+ Push URL: $(pwd)/one
+ HEAD branch: main
+ Remote branches:
+ main new (next fetch will store in remotes/origin)
+ side stale (use 'git remote prune' to remove)
+ Local branches configured for 'git pull':
+ ahead merges with remote main
+ main merges with remote main
+ Local refs configured for 'git push':
+ main pushes to main (local out of date)
+ main pushes to upstream (create)
+EOF
+
+test_expect_failure 'show stale with negative refspecs' '
+ test_when_finished "git -C test config --unset-all --fixed-value remote.origin.fetch ^refs/heads/side" &&
+ git -C test config --add remote.origin.fetch ^refs/heads/side &&
+ git -C test remote show origin >output &&
+ test_cmp expect output
+'
+
cat >test/expect <<EOF
* remote origin
Fetch URL: $(pwd)/one
@@ -836,6 +902,17 @@ test_expect_success 'rename a remote renames repo remote.pushDefault but keeps g
)
'
+test_expect_success 'rename handles remote without fetch refspec' '
+ git clone --bare one no-refspec.git &&
+ # confirm assumption that bare clone does not create refspec
+ test_expect_code 5 \
+ git -C no-refspec.git config --unset-all remote.origin.fetch &&
+ git -C no-refspec.git config remote.origin.url >expect &&
+ git -C no-refspec.git remote rename origin foo &&
+ git -C no-refspec.git config remote.foo.url >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'rename does not update a non-default fetch refspec' '
git clone one four.one &&
(
@@ -957,11 +1034,12 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '
'
test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '
- git clone one six &&
+ git clone --template= one six &&
origin_url=$(pwd)/one &&
(
cd six &&
git remote rm origin &&
+ mkdir .git/branches &&
echo "$origin_url#main" >.git/branches/origin &&
git remote rename origin origin &&
test_path_is_missing .git/branches/origin &&
@@ -972,10 +1050,11 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '
'
test_expect_success 'migrate a remote from named file in $GIT_DIR/branches (2)' '
- git clone one seven &&
+ git clone --template= one seven &&
(
cd seven &&
git remote rm origin &&
+ mkdir .git/branches &&
echo "quux#foom" > .git/branches/origin &&
git remote rename origin origin &&
test_path_is_missing .git/branches/origin &&
@@ -996,7 +1075,7 @@ test_expect_success 'remote prune to cause a dangling symref' '
cd eight &&
git remote prune origin
) >err 2>&1 &&
- test_i18ngrep "has become dangling" err &&
+ test_grep "has become dangling" err &&
: And the dangling symref will not cause other annoying errors &&
(
@@ -1008,7 +1087,7 @@ test_expect_success 'remote prune to cause a dangling symref' '
cd eight &&
test_must_fail git branch nomore origin
) 2>err &&
- test_i18ngrep "dangling symref" err
+ test_grep "dangling symref" err
'
test_expect_success 'show empty remote' '
@@ -1340,7 +1419,7 @@ test_expect_success 'extra args: setup' '
test_extra_arg () {
test_expect_success "extra args: $*" "
test_must_fail git remote $* bogus_extra_arg 2>actual &&
- test_i18ngrep '^usage:' actual
+ test_grep '^usage:' actual
"
}
@@ -1374,12 +1453,12 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
oid=$(git rev-parse some-tag^{$type})
fi &&
test_must_fail git push origin $oid:dst 2>err &&
- test_i18ngrep "error: The destination you" err &&
- test_i18ngrep "hint: Did you mean" err &&
+ test_grep "error: The destination you" err &&
+ test_grep "hint: Did you mean" err &&
test_must_fail git -c advice.pushUnqualifiedRefName=false \
push origin $oid:dst 2>err &&
- test_i18ngrep "error: The destination you" err &&
- test_i18ngrep ! "hint: Did you mean" err ||
+ test_grep "error: The destination you" err &&
+ test_grep ! "hint: Did you mean" err ||
exit 1
done
)
@@ -1400,16 +1479,16 @@ test_expect_success 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and
git fetch --no-tags two &&
test_must_fail git push origin refs/remotes/two/another:dst 2>err &&
- test_i18ngrep "error: The destination you" err &&
+ test_grep "error: The destination you" err &&
test_must_fail git push origin refs/remotes/tags-from-two/my-tag:dst-tag 2>err &&
- test_i18ngrep "error: The destination you" err &&
+ test_grep "error: The destination you" err &&
test_must_fail git push origin refs/remotes/trees-from-two/my-head-tree:dst-tree 2>err &&
- test_i18ngrep "error: The destination you" err &&
+ test_grep "error: The destination you" err &&
test_must_fail git push origin refs/remotes/blobs-from-two/my-file-blob:dst-blob 2>err &&
- test_i18ngrep "error: The destination you" err
+ test_grep "error: The destination you" err
)
'
diff --git a/t/t5506-remote-groups.sh b/t/t5506-remote-groups.sh
index 5bac03e..0e17617 100755
--- a/t/t5506-remote-groups.sh
+++ b/t/t5506-remote-groups.sh
@@ -99,4 +99,13 @@ test_expect_success 'updating remote name updates that remote' '
! repo_fetched two
'
+test_expect_success 'updating group in parallel with a duplicate remote does not fail (fetch)' '
+ mark fetch-group-duplicate &&
+ update_repo one &&
+ git config --add remotes.duplicate one &&
+ git config --add remotes.duplicate one &&
+ git -c fetch.parallel=2 remote update duplicate &&
+ repo_fetched one
+'
+
test_done
diff --git a/t/t5507-remote-environment.sh b/t/t5507-remote-environment.sh
index e614929..c6a6957 100755
--- a/t/t5507-remote-environment.sh
+++ b/t/t5507-remote-environment.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='check environment showed to remote side of transports'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'set up "remote" push situation' '
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index b45879a..33d34d5 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -169,6 +169,7 @@ test_expect_success REFFILES 'fetch --prune fails to delete branches' '
git clone . prune-fail &&
cd prune-fail &&
git update-ref refs/remotes/origin/extrabranch main &&
+ git pack-refs --all &&
: this will prevent --prune from locking packed-refs for deleting refs, but adding loose refs still succeeds &&
>.git/packed-refs.new &&
@@ -415,9 +416,9 @@ test_expect_success 'fetch uses remote ref names to describe new refs' '
(
cd descriptive &&
git fetch o 2>actual &&
- test_i18ngrep "new branch.* -> refs/crazyheads/descriptive-branch$" actual &&
- test_i18ngrep "new tag.* -> descriptive-tag$" actual &&
- test_i18ngrep "new ref.* -> crazy$" actual
+ test_grep "new branch.* -> refs/crazyheads/descriptive-branch$" actual &&
+ test_grep "new tag.* -> descriptive-tag$" actual &&
+ test_grep "new ref.* -> crazy$" actual
) &&
git checkout main
'
@@ -790,6 +791,7 @@ test_expect_success 'fetch.writeCommitGraph' '
'
test_expect_success 'fetch.writeCommitGraph with submodules' '
+ test_config_global protocol.file.allow always &&
git clone dups super &&
(
cd super &&
@@ -801,10 +803,19 @@ test_expect_success 'fetch.writeCommitGraph with submodules' '
cd super-clone &&
rm -rf .git/objects/info &&
git -c fetch.writeCommitGraph=true fetch origin &&
- test_path_is_file .git/objects/info/commit-graphs/commit-graph-chain
+ test_path_is_file .git/objects/info/commit-graphs/commit-graph-chain &&
+ git -c fetch.writeCommitGraph=true fetch --recurse-submodules origin
)
'
+# fetches from first configured url
+test_expect_success 'fetch from multiple configured URLs in single remote' '
+ git init url1 &&
+ git remote add multipleurls url1 &&
+ git remote set-url --add multipleurls url2 &&
+ git fetch multipleurls
+'
+
# configured prune tests
set_config_tristate () {
@@ -1104,63 +1115,65 @@ test_expect_success 'fetching with auto-gc does not lock up' '
git config gc.autoPackLimit 1 &&
git config gc.autoDetach false &&
GIT_ASK_YESNO="$D/askyesno" git fetch --verbose >fetch.out 2>&1 &&
- test_i18ngrep "Auto packing the repository" fetch.out &&
+ test_grep "Auto packing the repository" fetch.out &&
! grep "Should I try again" fetch.out
)
'
-test_expect_success 'fetch aligned output' '
- git clone . full-output &&
- test_commit looooooooooooong-tag &&
- (
- cd full-output &&
- git -c fetch.output=full fetch origin >actual 2>&1 &&
- grep -e "->" actual | cut -c 22- >../actual
- ) &&
- cat >expect <<-\EOF &&
- main -> origin/main
- looooooooooooong-tag -> looooooooooooong-tag
- EOF
- test_cmp expect actual
-'
+for section in fetch transfer
+do
+ test_expect_success "$section.hideRefs affects connectivity check" '
+ GIT_TRACE="$PWD"/trace git -c $section.hideRefs=refs -c \
+ $section.hideRefs="!refs/tags/" fetch &&
+ grep "git rev-list .*--exclude-hidden=fetch" trace
+ '
+done
+
+test_expect_success 'prepare source branch' '
+ echo one >onebranch &&
+ git checkout --orphan onebranch &&
+ git rm --cached -r . &&
+ git add onebranch &&
+ git commit -m onebranch &&
+ git rev-list --objects onebranch -- >actual &&
+ # 3 objects should be created, at least ...
+ test 3 -le $(wc -l <actual)
+'
+
+validate_store_type () {
+ git -C dest count-objects -v >actual &&
+ case "$store_type" in
+ packed)
+ grep "^count: 0$" actual ;;
+ loose)
+ grep "^packs: 0$" actual ;;
+ esac || {
+ echo "store_type is $store_type"
+ cat actual
+ false
+ }
+}
-test_expect_success 'fetch compact output' '
- git clone . compact &&
- test_commit extraaa &&
- (
- cd compact &&
- git -c fetch.output=compact fetch origin >actual 2>&1 &&
- grep -e "->" actual | cut -c 22- >../actual
- ) &&
- cat >expect <<-\EOF &&
- main -> origin/*
- extraaa -> *
- EOF
- test_cmp expect actual
-'
+test_unpack_limit () {
+ store_type=$1
-test_expect_success '--no-show-forced-updates' '
- mkdir forced-updates &&
- (
- cd forced-updates &&
- git init &&
- test_commit 1 &&
- test_commit 2
- ) &&
- git clone forced-updates forced-update-clone &&
- git clone forced-updates no-forced-update-clone &&
- git -C forced-updates reset --hard HEAD~1 &&
- (
- cd forced-update-clone &&
- git fetch --show-forced-updates origin 2>output &&
- test_i18ngrep "(forced update)" output
- ) &&
- (
- cd no-forced-update-clone &&
- git fetch --no-show-forced-updates origin 2>output &&
- test_i18ngrep ! "(forced update)" output
- )
-'
+ case "$store_type" in
+ packed) fetch_limit=1 transfer_limit=10000 ;;
+ loose) fetch_limit=10000 transfer_limit=1 ;;
+ esac
+
+ test_expect_success "fetch trumps transfer limit" '
+ rm -fr dest &&
+ git --bare init dest &&
+ git -C dest config fetch.unpacklimit $fetch_limit &&
+ git -C dest config transfer.unpacklimit $transfer_limit &&
+ git -C dest fetch .. onebranch &&
+ validate_store_type
+ '
+}
+
+test_unpack_limit packed
+test_unpack_limit loose
setup_negotiation_tip () {
SERVER="$1"
diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh
index 20d063f..5dbe107 100755
--- a/t/t5512-ls-remote.sh
+++ b/t/t5512-ls-remote.sh
@@ -15,6 +15,19 @@ generate_references () {
done
}
+test_expect_success 'set up fake upload-pack' '
+ # This can be used to simulate an upload-pack that just shows the
+ # contents of the "input" file (prepared with the test-tool pkt-line
+ # helper), and does not do any negotiation (since ls-remote does not
+ # need it).
+ write_script cat-input <<-\EOF
+ # send our initial advertisement/response
+ cat input
+ # soak up the flush packet from the client
+ cat
+ EOF
+'
+
test_expect_success 'dies when no remote found' '
test_must_fail git ls-remote
'
@@ -231,22 +244,25 @@ test_expect_success 'protocol v2 supports hiderefs' '
test_expect_success 'ls-remote --symref' '
git fetch origin &&
- echo "ref: refs/heads/main HEAD" >expect &&
+ echo "ref: refs/heads/main HEAD" >expect.v2 &&
generate_references \
HEAD \
- refs/heads/main >>expect &&
+ refs/heads/main >>expect.v2 &&
+ echo "ref: refs/remotes/origin/main refs/remotes/origin/HEAD" >>expect.v2 &&
oid=$(git rev-parse HEAD) &&
- echo "$oid refs/remotes/origin/HEAD" >>expect &&
+ echo "$oid refs/remotes/origin/HEAD" >>expect.v2 &&
generate_references \
refs/remotes/origin/main \
refs/tags/mark \
refs/tags/mark1.1 \
refs/tags/mark1.10 \
- refs/tags/mark1.2 >>expect &&
- # Protocol v2 supports sending symrefs for refs other than HEAD, so use
- # protocol v0 here.
- GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref >actual &&
- test_cmp expect actual
+ refs/tags/mark1.2 >>expect.v2 &&
+ # v0 does not show non-HEAD symrefs
+ grep -v "ref: refs/remotes" <expect.v2 >expect.v0 &&
+ git -c protocol.version=0 ls-remote --symref >actual.v0 &&
+ test_cmp expect.v0 actual.v0 &&
+ git -c protocol.version=2 ls-remote --symref >actual.v2 &&
+ test_cmp expect.v2 actual.v2
'
test_expect_success 'ls-remote with filtered symref (refname)' '
@@ -255,76 +271,41 @@ test_expect_success 'ls-remote with filtered symref (refname)' '
ref: refs/heads/main HEAD
$rev HEAD
EOF
- # Protocol v2 supports sending symrefs for refs other than HEAD, so use
- # protocol v0 here.
- GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref . HEAD >actual &&
+ git ls-remote --symref . HEAD >actual &&
test_cmp expect actual
'
-test_expect_failure 'ls-remote with filtered symref (--heads)' '
+test_expect_success 'ls-remote with filtered symref (--heads)' '
git symbolic-ref refs/heads/foo refs/tags/mark &&
- cat >expect <<-EOF &&
+ cat >expect.v2 <<-EOF &&
ref: refs/tags/mark refs/heads/foo
$rev refs/heads/foo
$rev refs/heads/main
EOF
- # Protocol v2 supports sending symrefs for refs other than HEAD, so use
- # protocol v0 here.
- GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref --heads . >actual &&
- test_cmp expect actual
+ grep -v "^ref: refs/tags/" <expect.v2 >expect.v0 &&
+ git -c protocol.version=0 ls-remote --symref --heads . >actual.v0 &&
+ test_cmp expect.v0 actual.v0 &&
+ git -c protocol.version=2 ls-remote --symref --heads . >actual.v2 &&
+ test_cmp expect.v2 actual.v2
'
-test_expect_success 'ls-remote --symref omits filtered-out matches' '
- cat >expect <<-EOF &&
- $rev refs/heads/foo
- $rev refs/heads/main
+test_expect_success 'indicate no refs in v0 standards-compliant empty remote' '
+ # Git does not produce an output like this, but it does match the
+ # standard and is produced by other implementations like JGit. So
+ # hard-code the case we care about.
+ #
+ # The actual capabilities do not matter; there are none that would
+ # change how ls-remote behaves.
+ oid=0000000000000000000000000000000000000000 &&
+ test-tool pkt-line pack >input.q <<-EOF &&
+ $oid capabilities^{}Qcaps-go-here
+ 0000
EOF
- # Protocol v2 supports sending symrefs for refs other than HEAD, so use
- # protocol v0 here.
- GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref --heads . >actual &&
- test_cmp expect actual &&
- GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref . "refs/heads/*" >actual &&
- test_cmp expect actual
-'
-
-test_lazy_prereq GIT_DAEMON '
- test_bool_env GIT_TEST_GIT_DAEMON true
-'
+ q_to_nul <input.q >input &&
-# This test spawns a daemon, so run it only if the user would be OK with
-# testing with git-daemon.
-test_expect_success PIPE,JGIT,GIT_DAEMON 'indicate no refs in standards-compliant empty remote' '
- test_set_port JGIT_DAEMON_PORT &&
- JGIT_DAEMON_PID= &&
- git init --bare empty.git &&
- >empty.git/git-daemon-export-ok &&
- mkfifo jgit_daemon_output &&
- {
- jgit daemon --port="$JGIT_DAEMON_PORT" . >jgit_daemon_output &
- JGIT_DAEMON_PID=$!
- } &&
- test_when_finished kill "$JGIT_DAEMON_PID" &&
- {
- read line &&
- case $line in
- Exporting*)
- ;;
- *)
- echo "Expected: Exporting" &&
- false;;
- esac &&
- read line &&
- case $line in
- "Listening on"*)
- ;;
- *)
- echo "Expected: Listening on" &&
- false;;
- esac
- } <jgit_daemon_output &&
# --exit-code asks the command to exit with 2 when no
# matching refs are found.
- test_expect_code 2 git ls-remote --exit-code git://localhost:$JGIT_DAEMON_PORT/empty.git
+ test_expect_code 2 git ls-remote --exit-code --upload-pack=./cat-input .
'
test_expect_success 'ls-remote works outside repository' '
@@ -339,14 +320,14 @@ test_expect_success 'ls-remote works outside repository' '
test_expect_success 'ls-remote --sort fails gracefully outside repository' '
# Use a sort key that requires access to the referenced objects.
nongit test_must_fail git ls-remote --sort=authordate "$TRASH_DIRECTORY" 2>err &&
- test_i18ngrep "^fatal: not a git repository, but the field '\''authordate'\'' requires access to object data" err
+ test_grep "^fatal: not a git repository, but the field '\''authordate'\'' requires access to object data" err
'
test_expect_success 'ls-remote patterns work with all protocol versions' '
git for-each-ref --format="%(objectname) %(refname)" \
refs/heads/main refs/remotes/origin/main >expect &&
- git -c protocol.version=1 ls-remote . main >actual.v1 &&
- test_cmp expect actual.v1 &&
+ git -c protocol.version=0 ls-remote . main >actual.v0 &&
+ test_cmp expect actual.v0 &&
git -c protocol.version=2 ls-remote . main >actual.v2 &&
test_cmp expect actual.v2
'
@@ -354,10 +335,49 @@ test_expect_success 'ls-remote patterns work with all protocol versions' '
test_expect_success 'ls-remote prefixes work with all protocol versions' '
git for-each-ref --format="%(objectname) %(refname)" \
refs/heads/ refs/tags/ >expect &&
- git -c protocol.version=1 ls-remote --heads --tags . >actual.v1 &&
- test_cmp expect actual.v1 &&
+ git -c protocol.version=0 ls-remote --heads --tags . >actual.v0 &&
+ test_cmp expect actual.v0 &&
git -c protocol.version=2 ls-remote --heads --tags . >actual.v2 &&
test_cmp expect actual.v2
'
+test_expect_success 'v0 clients can handle multiple symrefs' '
+ # Modern versions of Git will not return multiple symref capabilities
+ # for v0, so we have to hard-code the response. Note that we will
+ # always use both v0 and object-format=sha1 here, as the hard-coded
+ # response reflects a server that only supports those.
+ oid=1234567890123456789012345678901234567890 &&
+ symrefs="symref=refs/remotes/origin/HEAD:refs/remotes/origin/main" &&
+ symrefs="$symrefs symref=HEAD:refs/heads/main" &&
+
+ # Likewise we want to make sure our parser is not fooled by the string
+ # "symref" appearing as part of an earlier cap. But there is no way to
+ # do that via upload-pack, as arbitrary strings can appear only in a
+ # "symref" value itself (where we skip past the values as a whole)
+ # and "agent" (which always appears after "symref", so putting our
+ # parser in a confused state is less interesting).
+ caps="some other caps including a-fake-symref-cap" &&
+
+ test-tool pkt-line pack >input.q <<-EOF &&
+ $oid HEADQ$caps $symrefs
+ $oid refs/heads/main
+ $oid refs/remotes/origin/HEAD
+ $oid refs/remotes/origin/main
+ 0000
+ EOF
+ q_to_nul <input.q >input &&
+
+ cat >expect <<-EOF &&
+ ref: refs/heads/main HEAD
+ $oid HEAD
+ $oid refs/heads/main
+ ref: refs/remotes/origin/main refs/remotes/origin/HEAD
+ $oid refs/remotes/origin/HEAD
+ $oid refs/remotes/origin/main
+ EOF
+
+ git ls-remote --symref --upload-pack=./cat-input . >actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t5514-fetch-multiple.sh b/t/t5514-fetch-multiple.sh
index 511ba3b..25772c8 100755
--- a/t/t5514-fetch-multiple.sh
+++ b/t/t5514-fetch-multiple.sh
@@ -24,6 +24,15 @@ setup_repository () {
)
}
+setup_test_clone () {
+ test_dir="$1" &&
+ git clone one "$test_dir" &&
+ for r in one two three
+ do
+ git -C "$test_dir" remote add "$r" "../$r" || return 1
+ done
+}
+
test_expect_success setup '
setup_repository one &&
setup_repository two &&
@@ -58,6 +67,13 @@ test_expect_success 'git fetch --all' '
test_cmp expect output)
'
+test_expect_success 'git fetch --all --no-write-fetch-head' '
+ (cd test &&
+ rm -f .git/FETCH_HEAD &&
+ git fetch --all --no-write-fetch-head &&
+ test_path_is_missing .git/FETCH_HEAD)
+'
+
test_expect_success 'git fetch --all should continue if a remote has errors' '
(git clone one test2 &&
cd test2 &&
@@ -193,8 +209,165 @@ test_expect_success 'parallel' '
test_must_fail env GIT_TRACE="$PWD/trace" \
git fetch --jobs=2 --multiple one two 2>err &&
grep "preparing to run up to 2 tasks" trace &&
- test_i18ngrep "could not fetch .one.*128" err &&
- test_i18ngrep "could not fetch .two.*128" err
+ test_grep "could not fetch .one.*128" err &&
+ test_grep "could not fetch .two.*128" err
+'
+
+test_expect_success 'git fetch --multiple --jobs=0 picks a default' '
+ (cd test &&
+ git fetch --multiple --jobs=0)
+'
+
+create_fetch_all_expect () {
+ cat >expect <<-\EOF
+ one/main
+ one/side
+ origin/HEAD -> origin/main
+ origin/main
+ origin/side
+ three/another
+ three/main
+ three/side
+ two/another
+ two/main
+ two/side
+ EOF
+}
+
+for fetch_all in true false
+do
+ test_expect_success "git fetch --all (works with fetch.all = $fetch_all)" '
+ test_dir="test_fetch_all_$fetch_all" &&
+ setup_test_clone "$test_dir" &&
+ (
+ cd "$test_dir" &&
+ git config fetch.all $fetch_all &&
+ git fetch --all &&
+ create_fetch_all_expect &&
+ git branch -r >actual &&
+ test_cmp expect actual
+ )
+ '
+done
+
+test_expect_success 'git fetch (fetch all remotes with fetch.all = true)' '
+ setup_test_clone test9 &&
+ (
+ cd test9 &&
+ git config fetch.all true &&
+ git fetch &&
+ git branch -r >actual &&
+ create_fetch_all_expect &&
+ test_cmp expect actual
+ )
+'
+
+create_fetch_one_expect () {
+ cat >expect <<-\EOF
+ one/main
+ one/side
+ origin/HEAD -> origin/main
+ origin/main
+ origin/side
+ EOF
+}
+
+test_expect_success 'git fetch one (explicit remote overrides fetch.all)' '
+ setup_test_clone test10 &&
+ (
+ cd test10 &&
+ git config fetch.all true &&
+ git fetch one &&
+ create_fetch_one_expect &&
+ git branch -r >actual &&
+ test_cmp expect actual
+ )
+'
+
+create_fetch_two_as_origin_expect () {
+ cat >expect <<-\EOF
+ origin/HEAD -> origin/main
+ origin/another
+ origin/main
+ origin/side
+ EOF
+}
+
+test_expect_success 'git config fetch.all false (fetch only default remote)' '
+ setup_test_clone test11 &&
+ (
+ cd test11 &&
+ git config fetch.all false &&
+ git remote set-url origin ../two &&
+ git fetch &&
+ create_fetch_two_as_origin_expect &&
+ git branch -r >actual &&
+ test_cmp expect actual
+ )
+'
+
+for fetch_all in true false
+do
+ test_expect_success "git fetch --no-all (fetch only default remote with fetch.all = $fetch_all)" '
+ test_dir="test_no_all_fetch_all_$fetch_all" &&
+ setup_test_clone "$test_dir" &&
+ (
+ cd "$test_dir" &&
+ git config fetch.all $fetch_all &&
+ git remote set-url origin ../two &&
+ git fetch --no-all &&
+ create_fetch_two_as_origin_expect &&
+ git branch -r >actual &&
+ test_cmp expect actual
+ )
+ '
+done
+
+test_expect_success 'git fetch --no-all (fetch only default remote without fetch.all)' '
+ setup_test_clone test12 &&
+ (
+ cd test12 &&
+ git config --unset-all fetch.all || true &&
+ git remote set-url origin ../two &&
+ git fetch --no-all &&
+ create_fetch_two_as_origin_expect &&
+ git branch -r >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'git fetch --all --no-all (fetch only default remote)' '
+ setup_test_clone test13 &&
+ (
+ cd test13 &&
+ git remote set-url origin ../two &&
+ git fetch --all --no-all &&
+ create_fetch_two_as_origin_expect &&
+ git branch -r >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'git fetch --no-all one (fetch only explicit remote)' '
+ setup_test_clone test14 &&
+ (
+ cd test14 &&
+ git fetch --no-all one &&
+ create_fetch_one_expect &&
+ git branch -r >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'git fetch --no-all --all (fetch all remotes)' '
+ setup_test_clone test15 &&
+ (
+ cd test15 &&
+ git fetch --no-all --all &&
+ create_fetch_all_expect &&
+ git branch -r >actual &&
+ test_cmp expect actual
+ )
'
test_done
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 541adbb..2e7c0e1 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -18,6 +18,7 @@ This test checks the following functionality:
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
D=$(pwd)
@@ -26,7 +27,8 @@ mk_empty () {
repo_name="$1"
test_when_finished "rm -rf \"$repo_name\"" &&
test_path_is_missing "$repo_name" &&
- git init "$repo_name" &&
+ git init --template= "$repo_name" &&
+ mkdir "$repo_name"/.git/hooks &&
git -C "$repo_name" config receive.denyCurrentBranch warn
}
@@ -78,7 +80,7 @@ mk_test_with_hooks() {
mk_child() {
test_when_finished "rm -rf \"$2\"" &&
- git clone "$1" "$2"
+ git clone --template= "$1" "$2"
}
check_push_result () {
@@ -118,6 +120,17 @@ test_expect_success setup '
'
+for cmd in push fetch
+do
+ for opt in ipv4 ipv6
+ do
+ test_expect_success "reject 'git $cmd --no-$opt'" '
+ test_must_fail git $cmd --no-$opt 2>err &&
+ grep "unknown option .no-$opt" err
+ '
+ done
+done
+
test_expect_success 'fetch without wildcard' '
mk_empty testrepo &&
(
@@ -198,7 +211,10 @@ test_expect_success 'push with negotiation' '
test_commit -C testrepo unrelated_commit &&
git -C testrepo config receive.hideRefs refs/remotes/origin/first_commit &&
test_when_finished "rm event" &&
- GIT_TRACE2_EVENT="$(pwd)/event" git -c protocol.version=2 -c push.negotiate=1 push testrepo refs/heads/main:refs/remotes/origin/main &&
+ GIT_TRACE2_EVENT="$(pwd)/event" \
+ git -c protocol.version=2 -c push.negotiate=1 \
+ push testrepo refs/heads/main:refs/remotes/origin/main &&
+ grep \"key\":\"total_rounds\",\"value\":\"1\" event &&
grep_wrote 2 event # 1 commit, 1 tree
'
@@ -211,18 +227,22 @@ test_expect_success 'push with negotiation proceeds anyway even if negotiation f
GIT_TEST_PROTOCOL_VERSION=0 GIT_TRACE2_EVENT="$(pwd)/event" \
git -c push.negotiate=1 push testrepo refs/heads/main:refs/remotes/origin/main 2>err &&
grep_wrote 5 event && # 2 commits, 2 trees, 1 blob
- test_i18ngrep "push negotiation failed" err
+ test_grep "push negotiation failed" err
'
test_expect_success 'push with negotiation does not attempt to fetch submodules' '
mk_empty submodule_upstream &&
test_commit -C submodule_upstream submodule_commit &&
+ test_config_global protocol.file.allow always &&
git submodule add ./submodule_upstream submodule &&
mk_empty testrepo &&
git push testrepo $the_first_commit:refs/remotes/origin/first_commit &&
test_commit -C testrepo unrelated_commit &&
git -C testrepo config receive.hideRefs refs/remotes/origin/first_commit &&
- git -c submodule.recurse=true -c protocol.version=2 -c push.negotiate=1 push testrepo refs/heads/main:refs/remotes/origin/main 2>err &&
+ GIT_TRACE2_EVENT="$(pwd)/event" git -c submodule.recurse=true \
+ -c protocol.version=2 -c push.negotiate=1 \
+ push testrepo refs/heads/main:refs/remotes/origin/main 2>err &&
+ grep \"key\":\"total_rounds\",\"value\":\"1\" event &&
! grep "Fetching submodule" err
'
@@ -392,6 +412,11 @@ test_expect_success 'push with ambiguity' '
'
+test_expect_success 'push with onelevel ref' '
+ mk_test testrepo heads/main &&
+ test_must_fail git push testrepo HEAD:refs/onelevel
+'
+
test_expect_success 'push with colon-less refspec (1)' '
mk_test testrepo heads/frotz tags/frotz &&
@@ -889,6 +914,13 @@ test_expect_success 'push --delete refuses empty string' '
test_must_fail git push testrepo --delete ""
'
+test_expect_success 'push --delete onelevel refspecs' '
+ mk_test testrepo heads/main &&
+ git -C testrepo update-ref refs/onelevel refs/heads/main &&
+ git push testrepo --delete refs/onelevel &&
+ test_must_fail git -C testrepo rev-parse --verify refs/onelevel
+'
+
test_expect_success 'warn on push to HEAD of non-bare repository' '
mk_test testrepo heads/main &&
(
@@ -937,6 +969,7 @@ test_expect_success 'fetch with branches' '
mk_empty testrepo &&
git branch second $the_first_commit &&
git checkout second &&
+ mkdir testrepo/.git/branches &&
echo ".." > testrepo/.git/branches/branch1 &&
(
cd testrepo &&
@@ -950,6 +983,7 @@ test_expect_success 'fetch with branches' '
test_expect_success 'fetch with branches containing #' '
mk_empty testrepo &&
+ mkdir testrepo/.git/branches &&
echo "..#second" > testrepo/.git/branches/branch2 &&
(
cd testrepo &&
@@ -964,7 +998,11 @@ test_expect_success 'fetch with branches containing #' '
test_expect_success 'push with branches' '
mk_empty testrepo &&
git checkout second &&
+
+ test_when_finished "rm -rf .git/branches" &&
+ mkdir .git/branches &&
echo "testrepo" > .git/branches/branch1 &&
+
git push branch1 &&
(
cd testrepo &&
@@ -976,7 +1014,11 @@ test_expect_success 'push with branches' '
test_expect_success 'push with branches containing #' '
mk_empty testrepo &&
+
+ test_when_finished "rm -rf .git/branches" &&
+ mkdir .git/branches &&
echo "testrepo#branch3" > .git/branches/branch2 &&
+
git push branch2 &&
(
cd testrepo &&
@@ -1225,7 +1267,7 @@ test_expect_success 'fetch exact SHA1' '
# fetching the hidden object should fail by default
test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 \
git fetch -v ../testrepo $the_commit:refs/heads/copy 2>err &&
- test_i18ngrep "Server does not allow request for unadvertised object" err &&
+ test_grep "Server does not allow request for unadvertised object" err &&
test_must_fail git rev-parse --verify refs/heads/copy &&
# the server side can allow it to succeed
@@ -1327,7 +1369,7 @@ do
git fetch ../testrepo/.git $SHA1_3 2>err &&
# ideally we would insist this be on a "remote error:"
# line, but it is racy; see the commit message
- test_i18ngrep "not our ref.*$SHA1_3\$" err
+ test_grep "not our ref.*$SHA1_3\$" err
)
'
done
@@ -1365,7 +1407,7 @@ test_expect_success 'peeled advertisements are not considered ref tips' '
oid=$(git -C testrepo rev-parse mytag^{commit}) &&
test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 \
git fetch testrepo $oid 2>err &&
- test_i18ngrep "Server does not allow request for unadvertised object" err
+ test_grep "Server does not allow request for unadvertised object" err
'
test_expect_success 'pushing a specific ref applies remote.$name.push as refmap' '
@@ -1834,35 +1876,26 @@ test_expect_success 'refuse to push a hidden ref, and make sure do not pollute t
test_dir_is_empty testrepo/.git/objects/pack
'
-test_expect_success LIBCURL 'fetch warns or fails when using username:password' '
- message="URL '\''https://username:<redacted>@localhost/'\'' uses plaintext credentials" &&
- test_must_fail git -c transfer.credentialsInUrl=allow fetch https://username:password@localhost 2>err &&
- ! grep "$message" err &&
-
- test_must_fail git -c transfer.credentialsInUrl=warn fetch https://username:password@localhost 2>err &&
- grep "warning: $message" err >warnings &&
- test_line_count = 3 warnings &&
-
- test_must_fail git -c transfer.credentialsInUrl=die fetch https://username:password@localhost 2>err &&
- grep "fatal: $message" err >warnings &&
- test_line_count = 1 warnings &&
-
- test_must_fail git -c transfer.credentialsInUrl=die fetch https://username:@localhost 2>err &&
- grep "fatal: $message" err >warnings &&
- test_line_count = 1 warnings
-'
-
-
-test_expect_success LIBCURL 'push warns or fails when using username:password' '
- message="URL '\''https://username:<redacted>@localhost/'\'' uses plaintext credentials" &&
- test_must_fail git -c transfer.credentialsInUrl=allow push https://username:password@localhost 2>err &&
- ! grep "$message" err &&
-
- test_must_fail git -c transfer.credentialsInUrl=warn push https://username:password@localhost 2>err &&
- grep "warning: $message" err >warnings &&
- test_must_fail git -c transfer.credentialsInUrl=die push https://username:password@localhost 2>err &&
- grep "fatal: $message" err >warnings &&
- test_line_count = 1 warnings
+test_expect_success 'push with config push.useBitmaps' '
+ mk_test testrepo heads/main &&
+ git checkout main &&
+ test_unconfig push.useBitmaps &&
+ GIT_TRACE2_EVENT="$PWD/default" \
+ git push --quiet testrepo main:test &&
+ test_subcommand git pack-objects --all-progress-implied --revs --stdout \
+ --thin --delta-base-offset -q <default &&
+
+ test_config push.useBitmaps true &&
+ GIT_TRACE2_EVENT="$PWD/true" \
+ git push --quiet testrepo main:test2 &&
+ test_subcommand git pack-objects --all-progress-implied --revs --stdout \
+ --thin --delta-base-offset -q <true &&
+
+ test_config push.useBitmaps false &&
+ GIT_TRACE2_EVENT="$PWD/false" \
+ git push --quiet testrepo main:test3 &&
+ test_subcommand git pack-objects --all-progress-implied --revs --stdout \
+ --thin --delta-base-offset -q --no-use-bitmap-index <false
'
test_done
diff --git a/t/t5517-push-mirror.sh b/t/t5517-push-mirror.sh
index a448e16..6d4944a 100755
--- a/t/t5517-push-mirror.sh
+++ b/t/t5517-push-mirror.sh
@@ -5,6 +5,7 @@ test_description='pushing to a mirror repository'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
D=$(pwd)
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 0818080..47534f1 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -31,7 +31,7 @@ test_pull_autostash_fail () {
echo dirty >new_file &&
git add new_file &&
test_must_fail git pull "$@" . copy 2>err &&
- test_i18ngrep -E "uncommitted changes.|overwritten by merge:" err
+ test_grep -E "uncommitted changes.|overwritten by merge:" err
}
test_expect_success setup '
@@ -151,7 +151,7 @@ test_expect_success 'fail if wildcard spec does not match any refs' '
echo file >expect &&
test_cmp expect file &&
test_must_fail git pull . "refs/nonexisting1/*:refs/nonexisting2/*" 2>err &&
- test_i18ngrep "no candidates for merging" err &&
+ test_grep "no candidates for merging" err &&
test_cmp expect file
'
@@ -164,7 +164,7 @@ test_expect_success 'fail if no branches specified with non-default remote' '
test_cmp expect file &&
test_config branch.test.remote origin &&
test_must_fail git pull test_remote 2>err &&
- test_i18ngrep "specify a branch on the command line" err &&
+ test_grep "specify a branch on the command line" err &&
test_cmp expect file
'
@@ -176,7 +176,7 @@ test_expect_success 'fail if not on a branch' '
echo file >expect &&
test_cmp expect file &&
test_must_fail git pull 2>err &&
- test_i18ngrep "not currently on a branch" err &&
+ test_grep "not currently on a branch" err &&
test_cmp expect file
'
@@ -189,7 +189,7 @@ test_expect_success 'fail if no configuration for current branch' '
echo file >expect &&
test_cmp expect file &&
test_must_fail git pull 2>err &&
- test_i18ngrep "no tracking information" err &&
+ test_grep "no tracking information" err &&
test_cmp expect file
'
@@ -202,7 +202,7 @@ test_expect_success 'pull --all: fail if no configuration for current branch' '
echo file >expect &&
test_cmp expect file &&
test_must_fail git pull --all 2>err &&
- test_i18ngrep "There is no tracking information" err &&
+ test_grep "There is no tracking information" err &&
test_cmp expect file
'
@@ -214,10 +214,27 @@ test_expect_success 'fail if upstream branch does not exist' '
echo file >expect &&
test_cmp expect file &&
test_must_fail git pull 2>err &&
- test_i18ngrep "no such ref was fetched" err &&
+ test_grep "no such ref was fetched" err &&
test_cmp expect file
'
+test_expect_success 'fetch upstream branch even if refspec excludes it' '
+ # the branch names are not important here except that
+ # the first one must not be a prefix of the second,
+ # since otherwise the ref-prefix protocol extension
+ # would match both
+ git branch in-refspec HEAD^ &&
+ git branch not-in-refspec HEAD &&
+ git init -b in-refspec downstream &&
+ git -C downstream remote add -t in-refspec origin "file://$(pwd)/.git" &&
+ git -C downstream config branch.in-refspec.remote origin &&
+ git -C downstream config branch.in-refspec.merge refs/heads/not-in-refspec &&
+ git -C downstream pull &&
+ git rev-parse --verify not-in-refspec >expect &&
+ git -C downstream rev-parse --verify HEAD >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'fail if the index has unresolved entries' '
git checkout -b third second^ &&
test_when_finished "git checkout -f copy && git branch -D third" &&
@@ -231,13 +248,13 @@ test_expect_success 'fail if the index has unresolved entries' '
test_file_not_empty unmerged &&
cp file expected &&
test_must_fail git pull . second 2>err &&
- test_i18ngrep "Pulling is not possible because you have unmerged files." err &&
+ test_grep "Pulling is not possible because you have unmerged files." err &&
test_cmp expected file &&
git add file &&
git ls-files -u >unmerged &&
test_must_be_empty unmerged &&
test_must_fail git pull . second 2>err &&
- test_i18ngrep "You have not concluded your merge" err &&
+ test_grep "You have not concluded your merge" err &&
test_cmp expected file
'
@@ -247,7 +264,7 @@ test_expect_success 'fast-forwards working tree if branch head is updated' '
echo file >expect &&
test_cmp expect file &&
git pull . second:third 2>err &&
- test_i18ngrep "fetch updated the current branch head" err &&
+ test_grep "fetch updated the current branch head" err &&
echo modified >expect &&
test_cmp expect file &&
test_cmp_rev third second
@@ -260,7 +277,7 @@ test_expect_success 'fast-forward fails with conflicting work tree' '
test_cmp expect file &&
echo conflict >file &&
test_must_fail git pull . second:third 2>err &&
- test_i18ngrep "Cannot fast-forward your working tree" err &&
+ test_grep "Cannot fast-forward your working tree" err &&
echo conflict >expect &&
test_cmp expect file &&
test_cmp_rev third second
@@ -358,7 +375,7 @@ test_expect_success '--rebase with conflicts shows advice' '
test_tick &&
git commit -m "Create conflict" seq.txt &&
test_must_fail git pull --rebase . seq 2>err >out &&
- test_i18ngrep "Resolve all conflicts manually" err
+ test_grep "Resolve all conflicts manually" err
'
test_expect_success 'failed --rebase shows advice' '
@@ -372,14 +389,14 @@ test_expect_success 'failed --rebase shows advice' '
git checkout -f -b fails-to-rebase HEAD^ &&
test_commit v2-without-cr file "2" file2-lf &&
test_must_fail git pull --rebase . diverging 2>err >out &&
- test_i18ngrep "Resolve all conflicts manually" err
+ test_grep "Resolve all conflicts manually" err
'
test_expect_success '--rebase fails with multiple branches' '
git reset --hard before-rebase &&
test_must_fail git pull --rebase . copy main 2>err &&
test_cmp_rev HEAD before-rebase &&
- test_i18ngrep "Cannot rebase onto multiple branches" err &&
+ test_grep "Cannot rebase onto multiple branches" err &&
echo modified >expect &&
git show HEAD:file >actual &&
test_cmp expect actual
@@ -503,7 +520,7 @@ test_expect_success 'pull --rebase warns on --verify-signatures' '
echo new >expect &&
git show HEAD:file2 >actual &&
test_cmp expect actual &&
- test_i18ngrep "ignoring --verify-signatures for rebase" err
+ test_grep "ignoring --verify-signatures for rebase" err
'
test_expect_success 'pull --rebase does not warn on --no-verify-signatures' '
@@ -513,7 +530,7 @@ test_expect_success 'pull --rebase does not warn on --no-verify-signatures' '
echo new >expect &&
git show HEAD:file2 >actual &&
test_cmp expect actual &&
- test_i18ngrep ! "verify-signatures" err
+ test_grep ! "verify-signatures" err
'
# add a feature branch, keep-merge, that is merged into main, so the
@@ -723,7 +740,7 @@ test_expect_success 'pull --rebase fails on unborn branch with staged changes' '
test_cmp expect actual &&
git show :staged-file >actual &&
test_cmp expect actual &&
- test_i18ngrep "unborn branch with changes added to the index" err
+ test_grep "unborn branch with changes added to the index" err
)
'
diff --git a/t/t5521-pull-options.sh b/t/t5521-pull-options.sh
index 264de29..db00c43 100755
--- a/t/t5521-pull-options.sh
+++ b/t/t5521-pull-options.sh
@@ -5,6 +5,7 @@ test_description='pull options'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -93,7 +94,7 @@ test_expect_success 'git pull --no-write-fetch-head fails' '
(cd clonedwfh && git init &&
test_expect_code 129 git pull --no-write-fetch-head "../parent" >out 2>err &&
test_must_be_empty out &&
- test_i18ngrep "no-write-fetch-head" err)
+ test_grep "no-write-fetch-head" err)
'
test_expect_success 'git pull --force' '
@@ -142,7 +143,7 @@ test_expect_success 'git pull --dry-run' '
cd clonedry &&
git pull --dry-run ../parent &&
test_path_is_missing .git/FETCH_HEAD &&
- test_path_is_missing .git/refs/heads/main &&
+ test_ref_missing refs/heads/main &&
test_path_is_missing .git/index &&
test_path_is_missing file
)
@@ -156,7 +157,7 @@ test_expect_success 'git pull --all --dry-run' '
git remote add origin ../parent &&
git pull --all --dry-run &&
test_path_is_missing .git/FETCH_HEAD &&
- test_path_is_missing .git/refs/remotes/origin/main &&
+ test_ref_missing refs/remotes/origin/main &&
test_path_is_missing .git/index &&
test_path_is_missing file
)
diff --git a/t/t5522-pull-symlink.sh b/t/t5522-pull-symlink.sh
index bcff460..cc5496e 100755
--- a/t/t5522-pull-symlink.sh
+++ b/t/t5522-pull-symlink.sh
@@ -2,6 +2,7 @@
test_description='pulling from symlinked subdir'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# The scenario we are building:
@@ -78,7 +79,9 @@ test_expect_success SYMLINKS 'pushing from symlinked subdir' '
git commit -m push ./file &&
git push
) &&
- test push = $(git show HEAD:subdir/file)
+ echo push >expect &&
+ git show HEAD:subdir/file >actual &&
+ test_cmp expect actual
'
test_done
diff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh
index fdb4292..1f859ad 100755
--- a/t/t5523-push-upstream.sh
+++ b/t/t5523-push-upstream.sh
@@ -4,6 +4,7 @@ test_description='push with --set-upstream'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-terminal.sh
@@ -60,12 +61,20 @@ test_expect_success 'push -u :topic_2' '
check_config topic_2 upstream refs/heads/other2
'
-test_expect_success 'push -u --all' '
+test_expect_success 'push -u --all(the same behavior with--branches)' '
git branch all1 &&
git branch all2 &&
git push -u --all &&
check_config all1 upstream refs/heads/all1 &&
- check_config all2 upstream refs/heads/all2
+ check_config all2 upstream refs/heads/all2 &&
+ git config --get-regexp branch.all* > expect &&
+ git config --remove-section branch.all1 &&
+ git config --remove-section branch.all2 &&
+ git push -u --branches &&
+ check_config all1 upstream refs/heads/all1 &&
+ check_config all2 upstream refs/heads/all2 &&
+ git config --get-regexp branch.all* > actual &&
+ test_cmp expect actual
'
test_expect_success 'push -u HEAD' '
@@ -78,7 +87,7 @@ test_expect_success TTY 'progress messages go to tty' '
ensure_fresh_upstream &&
test_terminal git push -u upstream main >out 2>err &&
- test_i18ngrep "Writing objects" err
+ test_grep "Writing objects" err
'
test_expect_success 'progress messages do not go to non-tty' '
@@ -86,7 +95,7 @@ test_expect_success 'progress messages do not go to non-tty' '
# skip progress messages, since stderr is non-tty
git push -u upstream main >out 2>err &&
- test_i18ngrep ! "Writing objects" err
+ test_grep ! "Writing objects" err
'
test_expect_success 'progress messages go to non-tty (forced)' '
@@ -94,22 +103,22 @@ test_expect_success 'progress messages go to non-tty (forced)' '
# force progress messages to stderr, even though it is non-tty
git push -u --progress upstream main >out 2>err &&
- test_i18ngrep "Writing objects" err
+ test_grep "Writing objects" err
'
test_expect_success TTY 'push -q suppresses progress' '
ensure_fresh_upstream &&
test_terminal git push -u -q upstream main >out 2>err &&
- test_i18ngrep ! "Writing objects" err
+ test_grep ! "Writing objects" err
'
test_expect_success TTY 'push --no-progress suppresses progress' '
ensure_fresh_upstream &&
test_terminal git push -u --no-progress upstream main >out 2>err &&
- test_i18ngrep ! "Unpacking objects" err &&
- test_i18ngrep ! "Writing objects" err
+ test_grep ! "Unpacking objects" err &&
+ test_grep ! "Writing objects" err
'
test_expect_success TTY 'quiet push' '
diff --git a/t/t5524-pull-msg.sh b/t/t5524-pull-msg.sh
index b2be360..56716e2 100755
--- a/t/t5524-pull-msg.sh
+++ b/t/t5524-pull-msg.sh
@@ -2,6 +2,7 @@
test_description='git pull message generation'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
dollar='$Dollar'
diff --git a/t/t5525-fetch-tagopt.sh b/t/t5525-fetch-tagopt.sh
index 45815f7..3a28f1d 100755
--- a/t/t5525-fetch-tagopt.sh
+++ b/t/t5525-fetch-tagopt.sh
@@ -2,6 +2,7 @@
test_description='tagopt variable affects "git fetch" and is overridden by commandline.'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
setup_clone () {
diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
index a301b56..5e56620 100755
--- a/t/t5526-fetch-submodules.sh
+++ b/t/t5526-fetch-submodules.sh
@@ -127,6 +127,7 @@ verify_fetch_result () {
}
test_expect_success setup '
+ git config --global protocol.file.allow always &&
mkdir deepsubmodule &&
(
cd deepsubmodule &&
@@ -166,6 +167,19 @@ test_expect_success "fetch --recurse-submodules recurses into submodules" '
verify_fetch_result actual.err
'
+test_expect_success "fetch --recurse-submodules honors --no-write-fetch-head" '
+ (
+ cd downstream &&
+ git submodule foreach --recursive \
+ sh -c "cd \"\$(git rev-parse --git-dir)\" && rm -f FETCH_HEAD" &&
+
+ git fetch --recurse-submodules --no-write-fetch-head &&
+
+ git submodule foreach --recursive \
+ sh -c "cd \"\$(git rev-parse --git-dir)\" && ! test -f FETCH_HEAD"
+ )
+'
+
test_expect_success "submodule.recurse option triggers recursive fetch" '
add_submodule_commits &&
(
@@ -177,6 +191,7 @@ test_expect_success "submodule.recurse option triggers recursive fetch" '
'
test_expect_success "fetch --recurse-submodules -j2 has the same output behaviour" '
+ test_when_finished "rm -f trace.out" &&
add_submodule_commits &&
(
cd downstream &&
@@ -704,17 +719,30 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' works also without .git
test_expect_success 'fetching submodules respects parallel settings' '
git config fetch.recurseSubmodules true &&
+ test_when_finished "rm -f downstream/trace.out" &&
(
cd downstream &&
GIT_TRACE=$(pwd)/trace.out git fetch &&
grep "1 tasks" trace.out &&
+ >trace.out &&
+
GIT_TRACE=$(pwd)/trace.out git fetch --jobs 7 &&
grep "7 tasks" trace.out &&
+ >trace.out &&
+
git config submodule.fetchJobs 8 &&
GIT_TRACE=$(pwd)/trace.out git fetch &&
grep "8 tasks" trace.out &&
+ >trace.out &&
+
GIT_TRACE=$(pwd)/trace.out git fetch --jobs 9 &&
- grep "9 tasks" trace.out
+ grep "9 tasks" trace.out &&
+ >trace.out &&
+
+ GIT_TRACE=$(pwd)/trace.out git -c submodule.fetchJobs=0 fetch &&
+ grep "preparing to run up to [0-9]* tasks" trace.out &&
+ ! grep "up to 0 tasks" trace.out &&
+ >trace.out
)
'
@@ -743,7 +771,7 @@ test_expect_success 'fetching submodule into a broken repository' '
git -C dst fetch --recurse-submodules &&
# Break the receiving submodule
- rm -f dst/sub/.git/HEAD &&
+ rm -r dst/sub/.git/objects &&
# NOTE: without the fix the following tests will recurse forever!
# They should terminate with an error.
@@ -1152,4 +1180,17 @@ test_expect_success 'fetch --all with --recurse-submodules with multiple' '
test_line_count = 2 fetch-subs
'
+test_expect_success "fetch --all with --no-recurse-submodules only fetches superproject" '
+ test_when_finished "rm -rf src_clone" &&
+
+ git clone --recurse-submodules src src_clone &&
+ (
+ cd src_clone &&
+ git remote add secondary ../src &&
+ git config submodule.recurse true &&
+ git fetch --all --no-recurse-submodules 2>../fetch-log
+ ) &&
+ ! grep "Fetching submodule" fetch-log
+'
+
test_done
diff --git a/t/t5527-fetch-odd-refs.sh b/t/t5527-fetch-odd-refs.sh
index e2770e4..98ece27 100755
--- a/t/t5527-fetch-odd-refs.sh
+++ b/t/t5527-fetch-odd-refs.sh
@@ -4,6 +4,7 @@ test_description='test fetching of oddly-named refs'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# afterwards we will have:
diff --git a/t/t5528-push-default.sh b/t/t5528-push-default.sh
index 284e20f..14f7ece 100755
--- a/t/t5528-push-default.sh
+++ b/t/t5528-push-default.sh
@@ -179,7 +179,7 @@ test_expect_success 'push from/to new branch succeeds with simple if push.autoSe
test_expect_success '"matching" fails if none match' '
git init --bare empty &&
test_must_fail git push empty : 2>actual &&
- test_i18ngrep "Perhaps you should specify a branch" actual
+ test_grep "Perhaps you should specify a branch" actual
'
test_expect_success 'push ambiguously named branch with upstream, matching and simple' '
diff --git a/t/t5529-push-errors.sh b/t/t5529-push-errors.sh
index ce85fd3..0247137 100755
--- a/t/t5529-push-errors.sh
+++ b/t/t5529-push-errors.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='detect some push errors early (before contacting remote)'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup commits' '
diff --git a/t/t5530-upload-pack-error.sh b/t/t5530-upload-pack-error.sh
index 7c1460e..7172780 100755
--- a/t/t5530-upload-pack-error.sh
+++ b/t/t5530-upload-pack-error.sh
@@ -2,6 +2,7 @@
test_description='errors in upload-pack'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
D=$(pwd)
@@ -35,8 +36,8 @@ test_expect_success 'upload-pack fails due to error in pack-objects packing' '
printf "%04xwant %s\n00000009done\n0000" \
$(($hexsz + 10)) $head >input &&
test_must_fail git upload-pack . <input >/dev/null 2>output.err &&
- test_i18ngrep "unable to read" output.err &&
- test_i18ngrep "pack-objects died" output.err
+ test_grep "unable to read" output.err &&
+ test_grep "pack-objects died" output.err
'
test_expect_success 'corrupt repo differently' '
diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh
index 3f58b51..f3fff55 100755
--- a/t/t5531-deep-submodule-push.sh
+++ b/t/t5531-deep-submodule-push.sh
@@ -311,7 +311,7 @@ test_expect_success 'submodule entry pointing at a tag is error' '
git -C work commit -m "bad commit" &&
test_when_finished "git -C work reset --hard HEAD^" &&
test_must_fail git -C work push --recurse-submodules=on-demand ../pub.git main 2>err &&
- test_i18ngrep "is a tag, not a commit" err
+ test_grep "is a tag, not a commit" err
'
test_expect_success 'push fails if recurse submodules option passed as yes' '
@@ -512,6 +512,56 @@ test_expect_success 'push only unpushed submodules recursively' '
test_cmp expected_pub actual_pub
'
+setup_subsub () {
+ git init upstream &&
+ git init upstream/sub &&
+ git init upstream/sub/deepsub &&
+ test_commit -C upstream/sub/deepsub innermost &&
+ git -C upstream/sub submodule add ./deepsub deepsub &&
+ git -C upstream/sub commit -m middle &&
+ git -C upstream submodule add ./sub sub &&
+ git -C upstream commit -m outermost &&
+
+ git -c protocol.file.allow=always clone --recurse-submodules upstream downstream &&
+ git -C downstream/sub/deepsub checkout -b downstream-branch &&
+ git -C downstream/sub checkout -b downstream-branch &&
+ git -C downstream checkout -b downstream-branch
+}
+
+new_downstream_commits () {
+ test_commit -C downstream/sub/deepsub new-innermost &&
+ git -C downstream/sub add deepsub &&
+ git -C downstream/sub commit -m new-middle &&
+ git -C downstream add sub &&
+ git -C downstream commit -m new-outermost
+}
+
+test_expect_success 'push with push.recurseSubmodules=only on superproject' '
+ test_when_finished rm -rf upstream downstream &&
+ setup_subsub &&
+ new_downstream_commits &&
+ git -C downstream config push.recurseSubmodules only &&
+ git -C downstream push origin downstream-branch &&
+
+ test_must_fail git -C upstream rev-parse refs/heads/downstream-branch &&
+ git -C upstream/sub rev-parse refs/heads/downstream-branch &&
+ test_must_fail git -C upstream/sub/deepsub rev-parse refs/heads/downstream-branch
+'
+
+test_expect_success 'push with push.recurseSubmodules=only on superproject and top-level submodule' '
+ test_when_finished rm -rf upstream downstream &&
+ setup_subsub &&
+ new_downstream_commits &&
+ git -C downstream config push.recurseSubmodules only &&
+ git -C downstream/sub config push.recurseSubmodules only &&
+ git -C downstream push origin downstream-branch 2> err &&
+
+ test_must_fail git -C upstream rev-parse refs/heads/downstream-branch &&
+ git -C upstream/sub rev-parse refs/heads/downstream-branch &&
+ git -C upstream/sub/deepsub rev-parse refs/heads/downstream-branch &&
+ grep "recursing into submodule with push.recurseSubmodules=only; using on-demand instead" err
+'
+
test_expect_success 'push propagating the remotes name to a submodule' '
git -C work remote add origin ../pub.git &&
git -C work remote add pub ../pub.git &&
diff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh
index 7c0a148..c91a62b 100755
--- a/t/t5534-push-signed.sh
+++ b/t/t5534-push-signed.sh
@@ -68,13 +68,13 @@ test_expect_success 'talking with a receiver without push certificate support' '
test_expect_success 'push --signed fails with a receiver without push certificate support' '
prepare_dst &&
test_must_fail git push --signed dst noop ff +noff 2>err &&
- test_i18ngrep "the receiving end does not support" err
+ test_grep "the receiving end does not support" err
'
test_expect_success 'push --signed=1 is accepted' '
prepare_dst &&
test_must_fail git push --signed=1 dst noop ff +noff 2>err &&
- test_i18ngrep "the receiving end does not support" err
+ test_grep "the receiving end does not support" err
'
test_expect_success GPG 'no certificate for a signed push with no update' '
@@ -303,7 +303,7 @@ test_expect_success GPGSM 'fail without key and heed user.signingkey x509' '
EOF
sed -n -e "s/^nonce /NONCE=/p" -e "/^$/q" dst/push-cert
) >expect.in &&
- key=$(cat "${GNUPGHOME}/trustlist.txt" | cut -d" " -f1 | tr -d ":") &&
+ key=$(cut -d" " -f1 <"${GNUPGHOME}/trustlist.txt" | tr -d ":") &&
sed -e "s/^KEY=/KEY=${key}/" expect.in >expect &&
noop=$(git rev-parse noop) &&
@@ -378,7 +378,7 @@ test_expect_success GPG 'failed atomic push does not execute GPG' '
--signed --atomic --porcelain \
dst noop ff noff >out 2>err &&
- test_i18ngrep ! "gpg failed to sign" err &&
+ test_grep ! "gpg failed to sign" err &&
cat >expect <<-EOF &&
To dst
= refs/heads/noop:refs/heads/noop [up to date]
diff --git a/t/t5536-fetch-conflicts.sh b/t/t5536-fetch-conflicts.sh
index 91f28c2..23bf696 100755
--- a/t/t5536-fetch-conflicts.sh
+++ b/t/t5536-fetch-conflicts.sh
@@ -40,7 +40,7 @@ test_expect_success 'fetch conflict: config vs. config' '
"+refs/heads/branch2:refs/remotes/origin/branch1" && (
cd ccc &&
test_must_fail git fetch origin 2>error &&
- test_i18ngrep "fatal: Cannot fetch both refs/heads/branch1 and refs/heads/branch2 to refs/remotes/origin/branch1" error
+ test_grep "fatal: Cannot fetch both refs/heads/branch1 and refs/heads/branch2 to refs/remotes/origin/branch1" error
)
'
@@ -67,7 +67,7 @@ test_expect_success 'fetch conflict: arg vs. arg' '
test_must_fail git fetch origin \
refs/heads/*:refs/remotes/origin/* \
refs/heads/branch2:refs/remotes/origin/branch1 2>error &&
- test_i18ngrep "fatal: Cannot fetch both refs/heads/branch1 and refs/heads/branch2 to refs/remotes/origin/branch1" error
+ test_grep "fatal: Cannot fetch both refs/heads/branch1 and refs/heads/branch2 to refs/remotes/origin/branch1" error
)
'
@@ -78,8 +78,8 @@ test_expect_success 'fetch conflict: criss-cross args' '
git fetch origin \
refs/heads/branch1:refs/remotes/origin/branch2 \
refs/heads/branch2:refs/remotes/origin/branch1 2>error &&
- test_i18ngrep "warning: refs/remotes/origin/branch1 usually tracks refs/heads/branch1, not refs/heads/branch2" error &&
- test_i18ngrep "warning: refs/remotes/origin/branch2 usually tracks refs/heads/branch2, not refs/heads/branch1" error
+ test_grep "warning: refs/remotes/origin/branch1 usually tracks refs/heads/branch1, not refs/heads/branch2" error &&
+ test_grep "warning: refs/remotes/origin/branch2 usually tracks refs/heads/branch2, not refs/heads/branch1" error
)
'
diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh
index 10e9a7f..37f7547 100755
--- a/t/t5537-fetch-shallow.sh
+++ b/t/t5537-fetch-shallow.sh
@@ -162,6 +162,8 @@ test_expect_success 'fetch --update-shallow' '
'
test_expect_success 'fetch --update-shallow into a repo with submodules' '
+ test_config_global protocol.file.allow always &&
+
git init a-submodule &&
test_commit -C a-submodule foo &&
@@ -175,7 +177,8 @@ test_expect_success 'fetch --update-shallow into a repo with submodules' '
test_expect_success 'fetch --update-shallow a commit that is also a shallow point into a repo with submodules' '
test_when_finished "rm -rf repo-with-sub" &&
git init repo-with-sub &&
- git -C repo-with-sub submodule add ../a-submodule a-submodule &&
+ git -c protocol.file.allow=always -C repo-with-sub \
+ submodule add ../a-submodule a-submodule &&
git -C repo-with-sub commit -m "added submodule" &&
SHALLOW=$(cat shallow/.git/shallow) &&
diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh
index 2f09ff4..71428f3 100755
--- a/t/t5541-http-push-smart.sh
+++ b/t/t5541-http-push-smart.sh
@@ -36,28 +36,6 @@ test_expect_success 'setup remote repository' '
setup_askpass_helper
-cat >exp <<EOF
-GET /smart/test_repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
-POST /smart/test_repo.git/git-upload-pack HTTP/1.1 200
-EOF
-test_expect_success 'no empty path components' '
- # Clear the log, so that it does not affect the "used receive-pack
- # service" test which reads the log too.
- test_when_finished ">\"\$HTTPD_ROOT_PATH\"/access.log" &&
-
- # In the URL, add a trailing slash, and see if git appends yet another
- # slash.
- cd "$ROOT_PATH" &&
- git clone $HTTPD_URL/smart/test_repo.git/ test_repo_clone &&
-
- # NEEDSWORK: If the overspecification of the expected result is reduced, we
- # might be able to run this test in all protocol versions.
- if test "$GIT_TEST_PROTOCOL_VERSION" = 0
- then
- check_access_log exp
- fi
-'
-
test_expect_success 'clone remote repository' '
rm -rf test_repo_clone &&
git clone $HTTPD_URL/smart/test_repo.git test_repo_clone &&
@@ -67,6 +45,10 @@ test_expect_success 'clone remote repository' '
'
test_expect_success 'push to remote repository (standard)' '
+ # Clear the log, so that the "used receive-pack service" test below
+ # sees just what we did here.
+ >"$HTTPD_ROOT_PATH"/access.log &&
+
cd "$ROOT_PATH"/test_repo_clone &&
: >path2 &&
git add path2 &&
@@ -80,6 +62,34 @@ test_expect_success 'push to remote repository (standard)' '
test $HEAD = $(git rev-parse --verify HEAD))
'
+test_expect_success 'used receive-pack service' '
+ cat >exp <<-\EOF &&
+ GET /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200
+ POST /smart/test_repo.git/git-receive-pack HTTP/1.1 200
+ EOF
+
+ check_access_log exp
+'
+
+test_expect_success 'push to remote repository (standard) with sending Accept-Language' '
+ cat >exp <<-\EOF &&
+ => Send header: Accept-Language: ko-KR, *;q=0.9
+ => Send header: Accept-Language: ko-KR, *;q=0.9
+ EOF
+
+ cd "$ROOT_PATH"/test_repo_clone &&
+ : >path_lang &&
+ git add path_lang &&
+ test_tick &&
+ git commit -m path_lang &&
+ HEAD=$(git rev-parse --verify HEAD) &&
+ GIT_TRACE_CURL=true LANGUAGE="ko_KR.UTF-8" git push -v -v 2>err &&
+ ! grep "Expect: 100-continue" err &&
+
+ grep "=> Send header: Accept-Language:" err >err.language &&
+ test_cmp exp err.language
+'
+
test_expect_success 'push already up-to-date' '
git push
'
@@ -122,28 +132,6 @@ test_expect_success 'rejected update prints status' '
'
rm -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/hooks/update"
-cat >exp <<EOF
-GET /smart/test_repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
-POST /smart/test_repo.git/git-upload-pack HTTP/1.1 200
-GET /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200
-POST /smart/test_repo.git/git-receive-pack HTTP/1.1 200
-GET /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200
-GET /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200
-POST /smart/test_repo.git/git-receive-pack HTTP/1.1 200
-GET /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200
-POST /smart/test_repo.git/git-receive-pack HTTP/1.1 200
-GET /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200
-POST /smart/test_repo.git/git-receive-pack HTTP/1.1 200
-EOF
-test_expect_success 'used receive-pack service' '
- # NEEDSWORK: If the overspecification of the expected result is reduced, we
- # might be able to run this test in all protocol versions.
- if test "$GIT_TEST_PROTOCOL_VERSION" = 0
- then
- check_access_log exp
- fi
-'
-
test_http_push_nonff "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git \
"$ROOT_PATH"/test_repo_clone main success
@@ -165,7 +153,7 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he
'
test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: our output' '
- test_i18ngrep "Updates were rejected because" \
+ test_grep "Updates were rejected because" \
output
'
@@ -244,8 +232,9 @@ test_expect_success 'push --atomic fails on server-side errors' '
test_config -C "$d" http.receivepack true &&
up="$HTTPD_URL"/smart/atomic-branches.git &&
- # break ref updates for other on the remote site
- mkdir "$d/refs/heads/other.lock" &&
+ # Create d/f conflict to break ref updates for other on the remote site.
+ git -C "$d" update-ref -d refs/heads/other &&
+ git -C "$d" update-ref refs/heads/other/conflict HEAD &&
# add the new commit to other
git branch -f other collateral &&
@@ -253,18 +242,9 @@ test_expect_success 'push --atomic fails on server-side errors' '
# --atomic should cause entire push to be rejected
test_must_fail git push --atomic "$up" atomic other 2>output &&
- # the new branch should not have been created upstream
- test_must_fail git -C "$d" show-ref --verify refs/heads/atomic &&
-
- # upstream should still reflect atomic2, the last thing we pushed
- # successfully
- git rev-parse atomic2 >expected &&
- # ...to other.
- git -C "$d" rev-parse refs/heads/other >actual &&
- test_cmp expected actual &&
-
- # the new branch should not have been created upstream
+ # The atomic and other branches should not be created upstream.
test_must_fail git -C "$d" show-ref --verify refs/heads/atomic &&
+ test_must_fail git -C "$d" show-ref --verify refs/heads/other &&
# the failed refs should be indicated to the user
grep "^ ! .*rejected.* other -> other .*atomic transaction failed" output &&
@@ -309,7 +289,7 @@ test_expect_success TTY 'push shows progress when stderr is a tty' '
cd "$ROOT_PATH"/test_repo_clone &&
test_commit noisy &&
test_terminal git push >output 2>&1 &&
- test_i18ngrep "^Writing objects" output
+ test_grep "^Writing objects" output
'
test_expect_success TTY 'push --quiet silences status and progress' '
@@ -323,16 +303,16 @@ test_expect_success TTY 'push --no-progress silences progress but not status' '
cd "$ROOT_PATH"/test_repo_clone &&
test_commit no-progress &&
test_terminal git push --no-progress >output 2>&1 &&
- test_i18ngrep "^To http" output &&
- test_i18ngrep ! "^Writing objects" output
+ test_grep "^To http" output &&
+ test_grep ! "^Writing objects" output
'
test_expect_success 'push --progress shows progress to non-tty' '
cd "$ROOT_PATH"/test_repo_clone &&
test_commit progress &&
git push --progress >output 2>&1 &&
- test_i18ngrep "^To http" output &&
- test_i18ngrep "^Writing objects" output
+ test_grep "^To http" output &&
+ test_grep "^Writing objects" output
'
test_expect_success 'http push gives sane defaults to reflog' '
@@ -501,10 +481,10 @@ test_expect_success 'colorize errors/hints' '
-c color.push=always \
push origin origin/main^:main 2>act &&
test_decode_color <act >decoded &&
- test_i18ngrep "<RED>.*rejected.*<RESET>" decoded &&
- test_i18ngrep "<RED>error: failed to push some refs" decoded &&
- test_i18ngrep "<YELLOW>hint: " decoded &&
- test_i18ngrep ! "^hint: " decoded
+ test_grep "<RED>.*rejected.*<RESET>" decoded &&
+ test_grep "<RED>error: failed to push some refs" decoded &&
+ test_grep "<YELLOW>hint: " decoded &&
+ test_grep ! "^hint: " decoded
'
test_expect_success 'report error server does not provide ref status' '
diff --git a/t/t5543-atomic-push.sh b/t/t5543-atomic-push.sh
index 7043112..04b47ad 100755
--- a/t/t5543-atomic-push.sh
+++ b/t/t5543-atomic-push.sh
@@ -117,7 +117,10 @@ test_expect_success 'atomic push fails if one branch fails' '
test_commit five &&
git checkout main &&
test_commit six &&
- test_must_fail git push --atomic --all up
+ test_must_fail git push --atomic --all up >output-all 2>&1 &&
+ # --all and --branches have the same behavior when be combined with --atomic
+ test_must_fail git push --atomic --branches up >output-branches 2>&1 &&
+ test_cmp output-all output-branches
) &&
test_refs main HEAD@{7} &&
test_refs second HEAD@{4}
diff --git a/t/t5544-pack-objects-hook.sh b/t/t5544-pack-objects-hook.sh
index dd5f44d..1a9e14b 100755
--- a/t/t5544-pack-objects-hook.sh
+++ b/t/t5544-pack-objects-hook.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='test custom script in place of pack-objects'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'create some history to fetch' '
@@ -56,7 +58,12 @@ test_expect_success 'hook does not run from repo config' '
! grep "hook running" stderr &&
test_path_is_missing .git/hook.args &&
test_path_is_missing .git/hook.stdin &&
- test_path_is_missing .git/hook.stdout
+ test_path_is_missing .git/hook.stdout &&
+
+ # check that global config is used instead
+ test_config_global uploadpack.packObjectsHook ./hook &&
+ git clone --no-local . dst2.git 2>stderr &&
+ grep "hook running" stderr
'
test_expect_success 'hook works with partial clone' '
diff --git a/t/t5545-push-options.sh b/t/t5545-push-options.sh
index 2142283..fb13549 100755
--- a/t/t5545-push-options.sh
+++ b/t/t5545-push-options.sh
@@ -119,6 +119,7 @@ test_expect_success 'push options and submodules' '
test_commit -C parent one &&
git -C parent push --mirror up &&
+ test_config_global protocol.file.allow always &&
git -C parent submodule add ../upstream workbench &&
git -C parent/workbench remote add up ../../upstream &&
git -C parent commit -m "add submodule" &&
@@ -251,7 +252,7 @@ test_expect_success 'push option denied properly by http server' '
mk_http_pair false &&
test_commit -C test_http_clone one &&
test_must_fail git -C test_http_clone push --push-option=asdf origin main 2>actual &&
- test_i18ngrep "the receiving end does not support push options" actual &&
+ test_grep "the receiving end does not support push options" actual &&
git -C test_http_clone push origin main
'
diff --git a/t/t5546-receive-limits.sh b/t/t5546-receive-limits.sh
index 0b0e987..9fc9ba5 100755
--- a/t/t5546-receive-limits.sh
+++ b/t/t5546-receive-limits.sh
@@ -1,16 +1,34 @@
#!/bin/sh
test_description='check receive input limits'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# Let's run tests with different unpack limits: 1 and 10000
# When the limit is 1, `git receive-pack` will call `git index-pack`.
# When the limit is 10000, `git receive-pack` will call `git unpack-objects`.
+validate_store_type () {
+ git -C dest count-objects -v >actual &&
+ case "$store_type" in
+ index)
+ grep "^count: 0$" actual ;;
+ unpack)
+ grep "^packs: 0$" actual ;;
+ esac || {
+ echo "store_type is $store_type"
+ cat actual
+ false;
+ }
+}
+
test_pack_input_limit () {
- case "$1" in
- index) unpack_limit=1 ;;
- unpack) unpack_limit=10000 ;;
+ store_type=$1
+
+ case "$store_type" in
+ index) unpack_limit=1 other_limit=10000 ;;
+ unpack) unpack_limit=10000 other_limit=1 ;;
esac
test_expect_success 'prepare destination repository' '
@@ -41,6 +59,19 @@ test_pack_input_limit () {
git --git-dir=dest config receive.maxInputSize 0 &&
git push dest HEAD
'
+
+ test_expect_success 'prepare destination repository (once more)' '
+ rm -fr dest &&
+ git --bare init dest
+ '
+
+ test_expect_success 'receive trumps transfer' '
+ git --git-dir=dest config receive.unpacklimit "$unpack_limit" &&
+ git --git-dir=dest config transfer.unpacklimit "$other_limit" &&
+ git push dest HEAD &&
+ validate_store_type
+ '
+
}
test_expect_success "create known-size (1024 bytes) commit" '
diff --git a/t/t5547-push-quarantine.sh b/t/t5547-push-quarantine.sh
index 1876fb3..9f899b8 100755
--- a/t/t5547-push-quarantine.sh
+++ b/t/t5547-push-quarantine.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='check quarantine of objects during push'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'create picky dest repo' '
diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh
index f0d9cd5..4c3b327 100755
--- a/t/t5550-http-fetch-dumb.sh
+++ b/t/t5550-http-fetch-dumb.sh
@@ -66,11 +66,11 @@ test_expect_success 'create empty remote repository' '
setup_post_update_server_info_hook "$HTTPD_DOCUMENT_ROOT_PATH/empty.git"
'
-test_expect_success 'empty dumb HTTP repository has default hash algorithm' '
+test_expect_success 'empty dumb HTTP repository falls back to SHA1' '
test_when_finished "rm -fr clone-empty" &&
git clone $HTTPD_URL/dumb/empty.git clone-empty &&
git -C clone-empty rev-parse --show-object-format >empty-format &&
- test "$(cat empty-format)" = "$(test_oid algo)"
+ test "$(cat empty-format)" = sha1
'
setup_askpass_helper
@@ -234,7 +234,7 @@ test_expect_success 'http-fetch --packfile' '
--index-pack-arg=--keep \
"$HTTPD_URL"/dumb/repo_pack.git/$p >out &&
- grep "^keep.[0-9a-f]\{16,\}$" out &&
+ grep -E "^keep.[0-9a-f]{16,}$" out &&
cut -c6- out >packhash &&
# Ensure that the expected files are generated
@@ -369,14 +369,14 @@ ja;q=0.95, zh;q=0.94, sv;q=0.93, pt;q=0.92, nb;q=0.91, *;q=0.90" \
ko_KR.EUC-KR:en_US.UTF-8:fr_CA:de.UTF-8@euro:sr@latin:ja:zh:sv:pt:nb
'
-test_expect_success 'git client does not send an empty Accept-Language' '
+test_expect_success 'git client send an empty Accept-Language' '
GIT_TRACE_CURL=true LANGUAGE= git ls-remote "$HTTPD_URL/dumb/repo.git" 2>stderr &&
! grep "^=> Send header: Accept-Language:" stderr
'
test_expect_success 'remote-http complains cleanly about malformed urls' '
test_must_fail git remote-http http::/example.com/repo.git 2>stderr &&
- test_i18ngrep "url has no scheme" stderr
+ test_grep "url has no scheme" stderr
'
# NEEDSWORK: Writing commands to git-remote-curl can race against the latter
@@ -385,7 +385,7 @@ test_expect_success 'remote-http complains cleanly about malformed urls' '
test_expect_success 'remote-http complains cleanly about empty scheme' '
test_must_fail ok=sigpipe git ls-remote \
http::${HTTPD_URL#http}/dumb/repo.git 2>stderr &&
- test_i18ngrep "url has no scheme" stderr
+ test_grep "url has no scheme" stderr
'
test_expect_success 'redirects can be forbidden/allowed' '
@@ -397,7 +397,7 @@ test_expect_success 'redirects can be forbidden/allowed' '
test_expect_success 'redirects are reported to stderr' '
# just look for a snippet of the redirected-to URL
- test_i18ngrep /dumb/ stderr
+ test_grep /dumb/ stderr
'
test_expect_success 'non-initial redirects can be forbidden' '
@@ -422,7 +422,8 @@ test_expect_success 'set up evil alternates scheme' '
sha1=$(git -C "$victim" rev-parse HEAD) &&
evil=$HTTPD_DOCUMENT_ROOT_PATH/evil.git &&
- git init --bare "$evil" &&
+ git init --template= --bare "$evil" &&
+ mkdir "$evil/info" &&
# do this by hand to avoid object existence check
printf "%s\\t%s\\n" $sha1 refs/heads/main >"$evil/info/refs"
'
@@ -465,7 +466,7 @@ test_expect_success 'can redirect through non-"info/refs?service=git-upload-pack
test_expect_success 'print HTTP error when any intermediate redirect throws error' '
test_must_fail git clone "$HTTPD_URL/redir-to/502" 2> stderr &&
- test_i18ngrep "unable to access.*/redir-to/502" stderr
+ test_grep "unable to access.*/redir-to/502" stderr
'
test_expect_success 'fetching via http alternates works' '
diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh
index b9351a7..a623a10 100755
--- a/t/t5551-http-fetch-smart.sh
+++ b/t/t5551-http-fetch-smart.sh
@@ -1,13 +1,19 @@
#!/bin/sh
-test_description='test smart fetching over http via http-backend'
+: ${HTTP_PROTO:=HTTP/1.1}
+test_description="test smart fetching over http via http-backend ($HTTP_PROTO)"
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-httpd.sh
+test "$HTTP_PROTO" = "HTTP/2" && enable_http2
start_httpd
+test_expect_success HTTP2 'enable client-side http/2' '
+ git config --global http.version HTTP/2
+'
+
test_expect_success 'setup repository' '
git config push.default matching &&
echo content >file &&
@@ -27,32 +33,71 @@ test_expect_success 'create http-accessible bare repository' '
setup_askpass_helper
test_expect_success 'clone http repository' '
- cat >exp <<-\EOF &&
- > GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1
- > Accept: */*
- > Accept-Encoding: ENCODINGS
- > Pragma: no-cache
- < HTTP/1.1 200 OK
- < Pragma: no-cache
- < Cache-Control: no-cache, max-age=0, must-revalidate
- < Content-Type: application/x-git-upload-pack-advertisement
- > POST /smart/repo.git/git-upload-pack HTTP/1.1
- > Accept-Encoding: ENCODINGS
- > Content-Type: application/x-git-upload-pack-request
- > Accept: application/x-git-upload-pack-result
- > Content-Length: xxx
- < HTTP/1.1 200 OK
- < Pragma: no-cache
- < Cache-Control: no-cache, max-age=0, must-revalidate
- < Content-Type: application/x-git-upload-pack-result
+ if test_have_prereq HTTP2 && test "$HTTPD_PROTO" = "https"
+ then
+ # ALPN lets us immediately use HTTP/2; likewise, POSTs with
+ # bodies can use it because they do not need to upgrade
+ INITIAL_PROTO=HTTP/2
+ else
+ # either we are not using HTTP/2, or the initial
+ # request is sent via HTTP/1.1 and asks for upgrade
+ INITIAL_PROTO=HTTP/1.1
+ fi &&
+
+ cat >exp.raw <<-EOF &&
+ > GET /smart/repo.git/info/refs?service=git-upload-pack $INITIAL_PROTO
+ > accept: */*
+ > accept-encoding: ENCODINGS
+ > accept-language: ko-KR, *;q=0.9
+ > pragma: no-cache
+ {V2} > git-protocol: version=2
+ < $HTTP_PROTO 200 OK
+ < pragma: no-cache
+ < cache-control: no-cache, max-age=0, must-revalidate
+ < content-type: application/x-git-upload-pack-advertisement
+ > POST /smart/repo.git/git-upload-pack $INITIAL_PROTO
+ > accept-encoding: ENCODINGS
+ > content-type: application/x-git-upload-pack-request
+ > accept: application/x-git-upload-pack-result
+ > accept-language: ko-KR, *;q=0.9
+ {V2} > git-protocol: version=2
+ > content-length: xxx
+ < $INITIAL_PROTO 200 OK
+ < pragma: no-cache
+ < cache-control: no-cache, max-age=0, must-revalidate
+ < content-type: application/x-git-upload-pack-result
+ {V2} > POST /smart/repo.git/git-upload-pack $INITIAL_PROTO
+ {V2} > accept-encoding: ENCODINGS
+ {V2} > content-type: application/x-git-upload-pack-request
+ {V2} > accept: application/x-git-upload-pack-result
+ {V2} > accept-language: ko-KR, *;q=0.9
+ {V2} > git-protocol: version=2
+ {V2} > content-length: xxx
+ {V2} < $INITIAL_PROTO 200 OK
+ {V2} < pragma: no-cache
+ {V2} < cache-control: no-cache, max-age=0, must-revalidate
+ {V2} < content-type: application/x-git-upload-pack-result
EOF
- GIT_TRACE_CURL=true GIT_TEST_PROTOCOL_VERSION=0 \
+
+ if test "$GIT_TEST_PROTOCOL_VERSION" = 0
+ then
+ sed "/^{V2}/d" <exp.raw >exp
+ else
+ sed "s/^{V2} //" <exp.raw >exp
+ fi &&
+
+ GIT_TRACE_CURL=true LANGUAGE="ko_KR.UTF-8" \
git clone --quiet $HTTPD_URL/smart/repo.git clone 2>err &&
test_cmp file clone/file &&
tr '\''\015'\'' Q <err |
+ perl -pe '\''
+ s/(Send|Recv) header: ([A-Za-z0-9-]+):/
+ "$1 header: " . lc($2) . ":"
+ /e;
+ '\'' |
sed -e "
s/Q\$//
- /^[*] /d
+ /^[^<=]/d
/^== Info:/d
/^=> Send header, /d
/^=> Send header:$/d
@@ -62,6 +107,8 @@ test_expect_success 'clone http repository' '
s/= Recv header://
/^<= Recv data/d
/^=> Send data/d
+ /^<= Recv SSL data/d
+ /^=> Send SSL data/d
/^$/d
/^< $/d
@@ -69,33 +116,35 @@ test_expect_success 'clone http repository' '
s/^/> /
}
- /^> User-Agent: /d
- /^> Host: /d
+ /^< HTTP/ {
+ s/200$/200 OK/
+ }
+ /^< HTTP\\/1.1 101/d
+ /^[><] connection: /d
+ /^[><] upgrade: /d
+ /^> http2-settings: /d
+
+ /^> user-agent: /d
+ /^> host: /d
/^> POST /,$ {
/^> Accept: [*]\\/[*]/d
}
- s/^> Content-Length: .*/> Content-Length: xxx/
+ s/^> content-length: .*/> content-length: xxx/
/^> 00..want /d
/^> 00.*done/d
- /^< Server: /d
- /^< Expires: /d
- /^< Date: /d
- /^< Content-Length: /d
- /^< Transfer-Encoding: /d
+ /^< server: /d
+ /^< expires: /d
+ /^< date: /d
+ /^< content-length: /d
+ /^< transfer-encoding: /d
" >actual &&
- # NEEDSWORK: If the overspecification of the expected result is reduced, we
- # might be able to run this test in all protocol versions.
- if test "$GIT_TEST_PROTOCOL_VERSION" = 0
- then
- sed -e "s/^> Accept-Encoding: .*/> Accept-Encoding: ENCODINGS/" \
- actual >actual.smudged &&
- test_cmp exp actual.smudged &&
+ sed -e "s/^> accept-encoding: .*/> accept-encoding: ENCODINGS/" \
+ actual >actual.smudged &&
+ test_cmp exp actual.smudged &&
- grep "Accept-Encoding:.*gzip" actual >actual.gzip &&
- test_line_count = 2 actual.gzip
- fi
+ grep "accept-encoding:.*gzip" actual >actual.gzip
'
test_expect_success 'fetch changes via http' '
@@ -107,19 +156,9 @@ test_expect_success 'fetch changes via http' '
'
test_expect_success 'used upload-pack service' '
- cat >exp <<-\EOF &&
- GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
- POST /smart/repo.git/git-upload-pack HTTP/1.1 200
- GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
- POST /smart/repo.git/git-upload-pack HTTP/1.1 200
- EOF
-
- # NEEDSWORK: If the overspecification of the expected result is reduced, we
- # might be able to run this test in all protocol versions.
- if test "$GIT_TEST_PROTOCOL_VERSION" = 0
- then
- check_access_log exp
- fi
+ strip_access_log >log &&
+ grep "GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/[0-9.]* 200" log &&
+ grep "POST /smart/repo.git/git-upload-pack HTTP/[0-9.]* 200" log
'
test_expect_success 'follow redirects (301)' '
@@ -175,8 +214,8 @@ test_expect_success 'no-op half-auth fetch does not require a password' '
# This is not possible with protocol v2, since both objects and refs
# are obtained from the "git-upload-pack" path. A solution to this is
# to teach the server and client to be able to inline ls-refs requests
- # as an Extra Parameter (see pack-protocol.txt), so that "info/refs"
- # can serve refs, just like it does in protocol v0.
+ # as an Extra Parameter (see "git help gitformat-pack-protocol"), so that
+ # "info/refs" can serve refs, just like it does in protocol v0.
GIT_TEST_PROTOCOL_VERSION=0 git --git-dir=half-auth fetch &&
expect_askpass none
'
@@ -236,7 +275,7 @@ test_expect_success 'GIT_SMART_HTTP can disable smart http' '
test_expect_success 'invalid Content-Type rejected' '
test_must_fail git clone $HTTPD_URL/broken_smart/repo.git 2>actual &&
- test_i18ngrep "not valid:" actual
+ test_grep "not valid:" actual
'
test_expect_success 'create namespaced refs' '
@@ -268,21 +307,23 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set
127.0.0.1 FALSE /smart_cookies/ FALSE 0 othername othervalue
EOF
sort >expect_cookies.txt <<-\EOF &&
-
127.0.0.1 FALSE /smart_cookies/ FALSE 0 othername othervalue
+ 127.0.0.1 FALSE /smart_cookies/repo.git/ FALSE 0 name value
127.0.0.1 FALSE /smart_cookies/repo.git/info/ FALSE 0 name value
EOF
git config http.cookiefile cookies.txt &&
git config http.savecookies true &&
- git ls-remote $HTTPD_URL/smart_cookies/repo.git main &&
- # NEEDSWORK: If the overspecification of the expected result is reduced, we
- # might be able to run this test in all protocol versions.
- if test "$GIT_TEST_PROTOCOL_VERSION" = 0
- then
- tail -3 cookies.txt | sort >cookies_tail.txt &&
- test_cmp expect_cookies.txt cookies_tail.txt
- fi
+ test_when_finished "
+ git --git-dir=\"\$HTTPD_DOCUMENT_ROOT_PATH/repo.git\" \
+ tag -d cookie-tag
+ " &&
+ git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" \
+ tag -m "foo" cookie-tag &&
+ git fetch $HTTPD_URL/smart_cookies/repo.git cookie-tag &&
+
+ grep "^[^#]" cookies.txt | sort >cookies_stripped.txt &&
+ test_cmp expect_cookies.txt cookies_stripped.txt
'
test_expect_success 'transfer.hiderefs works over smart-http' '
@@ -318,7 +359,9 @@ create_tags () {
# now assign tags to all the dangling commits we created above
tag=$(perl -e "print \"bla\" x 30") &&
- sed -e "s|^:\([^ ]*\) \(.*\)$|\2 refs/tags/$tag-\1|" <marks >>packed-refs
+ sed -e "s|^:\([^ ]*\) \(.*\)$|create refs/tags/$tag-\1 \2|" <marks >input &&
+ git update-ref --stdin <input &&
+ rm input
}
test_expect_success 'create 2,000 tags in the repo' '
@@ -341,7 +384,10 @@ test_expect_success CMDLINE_LIMIT \
test_expect_success 'large fetch-pack requests can be sent using chunked encoding' '
GIT_TRACE_CURL=true git -c http.postbuffer=65536 \
clone --bare "$HTTPD_URL/smart/repo.git" split.git 2>err &&
- grep "^=> Send header: Transfer-Encoding: chunked" err
+ {
+ test_have_prereq HTTP2 ||
+ grep "^=> Send header: Transfer-Encoding: chunked" err
+ }
'
test_expect_success 'test allowreachablesha1inwant' '
@@ -514,7 +560,7 @@ test_expect_success 'GIT_TRACE_CURL_NO_DATA prevents data from being traced' '
test_expect_success 'server-side error detected' '
test_must_fail git clone $HTTPD_URL/error_smart/repo.git 2>actual &&
- test_i18ngrep "server-side error" actual
+ test_grep "server-side error" actual
'
test_expect_success 'http auth remembers successful credentials' '
@@ -567,6 +613,33 @@ test_expect_success 'client falls back from v2 to v0 to match server' '
grep symref=HEAD:refs/heads/ trace
'
+test_expect_success 'create empty http-accessible SHA-256 repository' '
+ mkdir "$HTTPD_DOCUMENT_ROOT_PATH/sha256.git" &&
+ (cd "$HTTPD_DOCUMENT_ROOT_PATH/sha256.git" &&
+ git --bare init --object-format=sha256
+ )
+'
+
+test_expect_success 'clone empty SHA-256 repository with protocol v2' '
+ rm -fr sha256 &&
+ echo sha256 >expected &&
+ git -c protocol.version=2 clone "$HTTPD_URL/smart/sha256.git" &&
+ git -C sha256 rev-parse --show-object-format >actual &&
+ test_cmp actual expected &&
+ git ls-remote "$HTTPD_URL/smart/sha256.git" >actual &&
+ test_must_be_empty actual
+'
+
+test_expect_success 'clone empty SHA-256 repository with protocol v0' '
+ rm -fr sha256 &&
+ echo sha256 >expected &&
+ GIT_TRACE=1 GIT_TRACE_PACKET=1 git -c protocol.version=0 clone "$HTTPD_URL/smart/sha256.git" &&
+ git -C sha256 rev-parse --show-object-format >actual &&
+ test_cmp actual expected &&
+ git ls-remote "$HTTPD_URL/smart/sha256.git" >actual &&
+ test_must_be_empty actual
+'
+
test_expect_success 'passing hostname resolution information works' '
BOGUS_HOST=gitbogusexamplehost.invalid &&
BOGUS_HTTPD_URL=$HTTPD_PROTO://$BOGUS_HOST:$LIB_HTTPD_PORT &&
@@ -574,4 +647,108 @@ test_expect_success 'passing hostname resolution information works' '
git -c "http.curloptResolve=$BOGUS_HOST:$LIB_HTTPD_PORT:127.0.0.1" ls-remote "$BOGUS_HTTPD_URL/smart/repo.git" >/dev/null
'
+# here user%40host is the URL-encoded version of user@host,
+# which is our intentionally-odd username to catch parsing errors
+url_user=$HTTPD_URL_USER/auth/smart/repo.git
+url_userpass=$HTTPD_URL_USER_PASS/auth/smart/repo.git
+url_userblank=$HTTPD_PROTO://user%40host:@$HTTPD_DEST/auth/smart/repo.git
+message="URL .*:<redacted>@.* uses plaintext credentials"
+
+test_expect_success 'clone warns or fails when using username:password' '
+ test_when_finished "rm -rf attempt*" &&
+
+ git -c transfer.credentialsInUrl=allow \
+ clone $url_userpass attempt1 2>err &&
+ ! grep "$message" err &&
+
+ git -c transfer.credentialsInUrl=warn \
+ clone $url_userpass attempt2 2>err &&
+ grep "warning: $message" err >warnings &&
+ test_line_count -ge 1 warnings &&
+
+ test_must_fail git -c transfer.credentialsInUrl=die \
+ clone $url_userpass attempt3 2>err &&
+ grep "fatal: $message" err >warnings &&
+ test_line_count -ge 1 warnings &&
+
+ test_must_fail git -c transfer.credentialsInUrl=die \
+ clone $url_userblank attempt4 2>err &&
+ grep "fatal: $message" err >warnings &&
+ test_line_count -ge 1 warnings
+'
+
+test_expect_success 'clone does not detect username:password when it is https://username@domain:port/' '
+ test_when_finished "rm -rf attempt1" &&
+
+ # we are relying on lib-httpd for url construction, so document our
+ # assumptions
+ case "$HTTPD_URL_USER" in
+ *:[0-9]*) : ok ;;
+ *) BUG "httpd url does not have port: $HTTPD_URL_USER"
+ esac &&
+
+ git -c transfer.credentialsInUrl=warn clone $url_user attempt1 2>err &&
+ ! grep "uses plaintext credentials" err
+'
+
+test_expect_success 'fetch warns or fails when using username:password' '
+ git -c transfer.credentialsInUrl=allow fetch $url_userpass 2>err &&
+ ! grep "$message" err &&
+
+ git -c transfer.credentialsInUrl=warn fetch $url_userpass 2>err &&
+ grep "warning: $message" err >warnings &&
+ test_line_count -ge 1 warnings &&
+
+ test_must_fail git -c transfer.credentialsInUrl=die \
+ fetch $url_userpass 2>err &&
+ grep "fatal: $message" err >warnings &&
+ test_line_count -ge 1 warnings &&
+
+ test_must_fail git -c transfer.credentialsInUrl=die \
+ fetch $url_userblank 2>err &&
+ grep "fatal: $message" err >warnings &&
+ test_line_count -ge 1 warnings
+'
+
+
+test_expect_success 'push warns or fails when using username:password' '
+ git -c transfer.credentialsInUrl=allow push $url_userpass 2>err &&
+ ! grep "$message" err &&
+
+ git -c transfer.credentialsInUrl=warn push $url_userpass 2>err &&
+ grep "warning: $message" err >warnings &&
+
+ test_must_fail git -c transfer.credentialsInUrl=die \
+ push $url_userpass 2>err &&
+ grep "fatal: $message" err >warnings &&
+ test_line_count -ge 1 warnings
+'
+
+test_expect_success 'no empty path components' '
+ # In the URL, add a trailing slash, and see if git appends yet another
+ # slash.
+ git clone $HTTPD_URL/smart/repo.git/ clone-with-slash &&
+
+ strip_access_log >log &&
+ ! grep "//" log
+'
+
+test_expect_success 'tag following always works over v0 http' '
+ upstream=$HTTPD_DOCUMENT_ROOT_PATH/tags &&
+ git init "$upstream" &&
+ (
+ cd "$upstream" &&
+ git commit --allow-empty -m base &&
+ git tag not-annotated &&
+ git tag -m foo annotated
+ ) &&
+ git init tags &&
+ git -C tags -c protocol.version=0 \
+ fetch --depth 1 $HTTPD_URL/smart/tags \
+ refs/tags/annotated:refs/tags/annotated &&
+ git -C "$upstream" for-each-ref refs/tags >expect &&
+ git -C tags for-each-ref >actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t5552-skipping-fetch-negotiator.sh b/t/t5552-skipping-fetch-negotiator.sh
index 165427d..b55a9f6 100755
--- a/t/t5552-skipping-fetch-negotiator.sh
+++ b/t/t5552-skipping-fetch-negotiator.sh
@@ -3,6 +3,22 @@
test_description='test skipping fetch negotiator'
. ./test-lib.sh
+test_expect_success 'fetch.negotiationalgorithm config' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ cat >repo/.git/config <<-\EOF &&
+ [fetch]
+ negotiationAlgorithm
+ EOF
+ cat >expect <<-\EOF &&
+ error: missing value for '\''fetch.negotiationalgorithm'\''
+ fatal: bad config variable '\''fetch.negotiationalgorithm'\'' in file '\''.git/config'\'' at line 2
+ EOF
+ test_expect_code 128 git -C repo fetch >out 2>actual &&
+ test_must_be_empty out &&
+ test_cmp expect actual
+'
+
have_sent () {
while test "$#" -ne 0
do
diff --git a/t/t5554-noop-fetch-negotiator.sh b/t/t5554-noop-fetch-negotiator.sh
index 2ac7b58..06991e8 100755
--- a/t/t5554-noop-fetch-negotiator.sh
+++ b/t/t5554-noop-fetch-negotiator.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='test noop fetch negotiator'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'noop negotiator does not emit any "have"' '
diff --git a/t/t5555-http-smart-common.sh b/t/t5555-http-smart-common.sh
index b1cfe8b..3dcb334 100755
--- a/t/t5555-http-smart-common.sh
+++ b/t/t5555-http-smart-common.sh
@@ -131,7 +131,6 @@ test_expect_success 'git upload-pack --advertise-refs: v2' '
fetch=shallow wait-for-done
server-option
object-format=$(test_oid algo)
- object-info
0000
EOF
diff --git a/t/t5557-http-get.sh b/t/t5557-http-get.sh
new file mode 100755
index 0000000..76a4bbd
--- /dev/null
+++ b/t/t5557-http-get.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+test_description='test downloading a file by URL'
+
+TEST_PASSES_SANITIZE_LEAK=true
+
+. ./test-lib.sh
+
+. "$TEST_DIRECTORY"/lib-httpd.sh
+start_httpd
+
+test_expect_success 'get by URL: 404' '
+ test_when_finished "rm -f file.temp" &&
+ url="$HTTPD_URL/none.txt" &&
+ cat >input <<-EOF &&
+ capabilities
+ get $url file1
+ EOF
+
+ test_must_fail git remote-http $url <input 2>err &&
+ test_path_is_missing file1 &&
+ grep "failed to download file at URL" err
+'
+
+test_expect_success 'get by URL: 200' '
+ echo data >"$HTTPD_DOCUMENT_ROOT_PATH/exists.txt" &&
+
+ url="$HTTPD_URL/exists.txt" &&
+ cat >input <<-EOF &&
+ capabilities
+ get $url file2
+
+ EOF
+
+ git remote-http $url <input &&
+ test_cmp "$HTTPD_DOCUMENT_ROOT_PATH/exists.txt" file2
+'
+
+test_done
diff --git a/t/t5558-clone-bundle-uri.sh b/t/t5558-clone-bundle-uri.sh
new file mode 100755
index 0000000..1ca5f74
--- /dev/null
+++ b/t/t5558-clone-bundle-uri.sh
@@ -0,0 +1,1076 @@
+#!/bin/sh
+
+test_description='test fetching bundles with --bundle-uri'
+
+. ./test-lib.sh
+
+test_expect_success 'fail to clone from non-existent file' '
+ test_when_finished rm -rf test &&
+ git clone --bundle-uri="$(pwd)/does-not-exist" . test 2>err &&
+ grep "failed to download bundle from URI" err
+'
+
+test_expect_success 'fail to clone from non-bundle file' '
+ test_when_finished rm -rf test &&
+ echo bogus >bogus &&
+ git clone --bundle-uri="$(pwd)/bogus" . test 2>err &&
+ grep "is not a bundle" err
+'
+
+test_expect_success 'create bundle' '
+ git init clone-from &&
+ git -C clone-from checkout -b topic &&
+ test_commit -C clone-from A &&
+ test_commit -C clone-from B &&
+ git -C clone-from bundle create B.bundle topic
+'
+
+test_expect_success 'clone with path bundle' '
+ git clone --bundle-uri="clone-from/B.bundle" \
+ clone-from clone-path &&
+ git -C clone-path rev-parse refs/bundles/topic >actual &&
+ git -C clone-from rev-parse topic >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'clone with path bundle and non-default hash' '
+ test_when_finished "rm -rf clone-path-non-default-hash" &&
+ GIT_DEFAULT_HASH=sha256 git clone --bundle-uri="clone-from/B.bundle" \
+ clone-from clone-path-non-default-hash &&
+ git -C clone-path-non-default-hash rev-parse refs/bundles/topic >actual &&
+ git -C clone-from rev-parse topic >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'clone with file:// bundle' '
+ git clone --bundle-uri="file://$(pwd)/clone-from/B.bundle" \
+ clone-from clone-file &&
+ git -C clone-file rev-parse refs/bundles/topic >actual &&
+ git -C clone-from rev-parse topic >expect &&
+ test_cmp expect actual
+'
+
+# To get interesting tests for bundle lists, we need to construct a
+# somewhat-interesting commit history.
+#
+# ---------------- bundle-4
+#
+# 4
+# / \
+# ----|---|------- bundle-3
+# | |
+# | 3
+# | |
+# ----|---|------- bundle-2
+# | |
+# 2 |
+# | |
+# ----|---|------- bundle-1
+# \ /
+# 1
+# |
+# (previous commits)
+test_expect_success 'construct incremental bundle list' '
+ (
+ cd clone-from &&
+ git checkout -b base &&
+ test_commit 1 &&
+ git checkout -b left &&
+ test_commit 2 &&
+ git checkout -b right base &&
+ test_commit 3 &&
+ git checkout -b merge left &&
+ git merge right -m "4" &&
+
+ git bundle create bundle-1.bundle base &&
+ git bundle create bundle-2.bundle base..left &&
+ git bundle create bundle-3.bundle base..right &&
+ git bundle create bundle-4.bundle merge --not left right
+ )
+'
+
+test_expect_success 'clone bundle list (file, no heuristic)' '
+ cat >bundle-list <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+
+ [bundle "bundle-1"]
+ uri = file://$(pwd)/clone-from/bundle-1.bundle
+
+ [bundle "bundle-2"]
+ uri = file://$(pwd)/clone-from/bundle-2.bundle
+
+ [bundle "bundle-3"]
+ uri = file://$(pwd)/clone-from/bundle-3.bundle
+
+ [bundle "bundle-4"]
+ uri = file://$(pwd)/clone-from/bundle-4.bundle
+ EOF
+
+ git clone --bundle-uri="file://$(pwd)/bundle-list" \
+ clone-from clone-list-file 2>err &&
+ ! grep "Repository lacks these prerequisite commits" err &&
+
+ git -C clone-from for-each-ref --format="%(objectname)" >oids &&
+ git -C clone-list-file cat-file --batch-check <oids &&
+
+ git -C clone-list-file for-each-ref --format="%(refname)" >refs &&
+ grep "refs/bundles/" refs >actual &&
+ cat >expect <<-\EOF &&
+ refs/bundles/base
+ refs/bundles/left
+ refs/bundles/merge
+ refs/bundles/right
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'clone bundle list (file, all mode, some failures)' '
+ cat >bundle-list <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+
+ # Does not exist. Should be skipped.
+ [bundle "bundle-0"]
+ uri = file://$(pwd)/clone-from/bundle-0.bundle
+
+ [bundle "bundle-1"]
+ uri = file://$(pwd)/clone-from/bundle-1.bundle
+
+ [bundle "bundle-2"]
+ uri = file://$(pwd)/clone-from/bundle-2.bundle
+
+ # No bundle-3 means bundle-4 will not apply.
+
+ [bundle "bundle-4"]
+ uri = file://$(pwd)/clone-from/bundle-4.bundle
+
+ # Does not exist. Should be skipped.
+ [bundle "bundle-5"]
+ uri = file://$(pwd)/clone-from/bundle-5.bundle
+ EOF
+
+ GIT_TRACE2_PERF=1 \
+ git clone --bundle-uri="file://$(pwd)/bundle-list" \
+ clone-from clone-all-some 2>err &&
+ ! grep "Repository lacks these prerequisite commits" err &&
+ ! grep "fatal" err &&
+ grep "warning: failed to download bundle from URI" err &&
+
+ git -C clone-from for-each-ref --format="%(objectname)" >oids &&
+ git -C clone-all-some cat-file --batch-check <oids &&
+
+ git -C clone-all-some for-each-ref --format="%(refname)" >refs &&
+ grep "refs/bundles/" refs >actual &&
+ cat >expect <<-\EOF &&
+ refs/bundles/base
+ refs/bundles/left
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'clone bundle list (file, all mode, all failures)' '
+ cat >bundle-list <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+
+ # Does not exist. Should be skipped.
+ [bundle "bundle-0"]
+ uri = file://$(pwd)/clone-from/bundle-0.bundle
+
+ # Does not exist. Should be skipped.
+ [bundle "bundle-5"]
+ uri = file://$(pwd)/clone-from/bundle-5.bundle
+ EOF
+
+ git clone --bundle-uri="file://$(pwd)/bundle-list" \
+ clone-from clone-all-fail 2>err &&
+ ! grep "Repository lacks these prerequisite commits" err &&
+ ! grep "fatal" err &&
+ grep "warning: failed to download bundle from URI" err &&
+
+ git -C clone-from for-each-ref --format="%(objectname)" >oids &&
+ git -C clone-all-fail cat-file --batch-check <oids &&
+
+ git -C clone-all-fail for-each-ref --format="%(refname)" >refs &&
+ ! grep "refs/bundles/" refs
+'
+
+test_expect_success 'clone bundle list (file, any mode)' '
+ cat >bundle-list <<-EOF &&
+ [bundle]
+ version = 1
+ mode = any
+
+ # Does not exist. Should be skipped.
+ [bundle "bundle-0"]
+ uri = file://$(pwd)/clone-from/bundle-0.bundle
+
+ [bundle "bundle-1"]
+ uri = file://$(pwd)/clone-from/bundle-1.bundle
+
+ # Does not exist. Should be skipped.
+ [bundle "bundle-5"]
+ uri = file://$(pwd)/clone-from/bundle-5.bundle
+ EOF
+
+ git clone --bundle-uri="file://$(pwd)/bundle-list" \
+ clone-from clone-any-file 2>err &&
+ ! grep "Repository lacks these prerequisite commits" err &&
+
+ git -C clone-from for-each-ref --format="%(objectname)" >oids &&
+ git -C clone-any-file cat-file --batch-check <oids &&
+
+ git -C clone-any-file for-each-ref --format="%(refname)" >refs &&
+ grep "refs/bundles/" refs >actual &&
+ cat >expect <<-\EOF &&
+ refs/bundles/base
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'clone bundle list (file, any mode, all failures)' '
+ cat >bundle-list <<-EOF &&
+ [bundle]
+ version = 1
+ mode = any
+
+ # Does not exist. Should be skipped.
+ [bundle "bundle-0"]
+ uri = $HTTPD_URL/bundle-0.bundle
+
+ # Does not exist. Should be skipped.
+ [bundle "bundle-5"]
+ uri = $HTTPD_URL/bundle-5.bundle
+ EOF
+
+ git clone --bundle-uri="file://$(pwd)/bundle-list" \
+ clone-from clone-any-fail 2>err &&
+ ! grep "fatal" err &&
+ grep "warning: failed to download bundle from URI" err &&
+
+ git -C clone-from for-each-ref --format="%(objectname)" >oids &&
+ git -C clone-any-fail cat-file --batch-check <oids &&
+
+ git -C clone-any-fail for-each-ref --format="%(refname)" >refs &&
+ ! grep "refs/bundles/" refs
+'
+
+#########################################################################
+# HTTP tests begin here
+
+. "$TEST_DIRECTORY"/lib-httpd.sh
+start_httpd
+
+test_expect_success 'fail to fetch from non-existent HTTP URL' '
+ test_when_finished rm -rf test &&
+ git clone --bundle-uri="$HTTPD_URL/does-not-exist" . test 2>err &&
+ grep "failed to download bundle from URI" err
+'
+
+test_expect_success 'fail to fetch from non-bundle HTTP URL' '
+ test_when_finished rm -rf test &&
+ echo bogus >"$HTTPD_DOCUMENT_ROOT_PATH/bogus" &&
+ git clone --bundle-uri="$HTTPD_URL/bogus" . test 2>err &&
+ grep "is not a bundle" err
+'
+
+test_expect_success 'clone HTTP bundle' '
+ cp clone-from/B.bundle "$HTTPD_DOCUMENT_ROOT_PATH/B.bundle" &&
+
+ git clone --no-local --mirror clone-from \
+ "$HTTPD_DOCUMENT_ROOT_PATH/fetch.git" &&
+
+ git clone --bundle-uri="$HTTPD_URL/B.bundle" \
+ "$HTTPD_URL/smart/fetch.git" clone-http &&
+ git -C clone-http rev-parse refs/bundles/topic >actual &&
+ git -C clone-from rev-parse topic >expect &&
+ test_cmp expect actual &&
+
+ test_config -C clone-http log.excludedecoration refs/bundle/
+'
+
+test_expect_success 'clone HTTP bundle with non-default hash' '
+ test_when_finished "rm -rf clone-http-non-default-hash" &&
+ GIT_DEFAULT_HASH=sha256 git clone --bundle-uri="$HTTPD_URL/B.bundle" \
+ "$HTTPD_URL/smart/fetch.git" clone-http-non-default-hash &&
+ git -C clone-http-non-default-hash rev-parse refs/bundles/topic >actual &&
+ git -C clone-from rev-parse topic >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'clone bundle list (HTTP, no heuristic)' '
+ test_when_finished rm -f trace*.txt &&
+
+ cp clone-from/bundle-*.bundle "$HTTPD_DOCUMENT_ROOT_PATH/" &&
+ cat >"$HTTPD_DOCUMENT_ROOT_PATH/bundle-list" <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+
+ [bundle "bundle-1"]
+ uri = $HTTPD_URL/bundle-1.bundle
+
+ [bundle "bundle-2"]
+ uri = $HTTPD_URL/bundle-2.bundle
+
+ [bundle "bundle-3"]
+ uri = $HTTPD_URL/bundle-3.bundle
+
+ [bundle "bundle-4"]
+ uri = $HTTPD_URL/bundle-4.bundle
+ EOF
+
+ GIT_TRACE2_EVENT="$(pwd)/trace-clone.txt" \
+ git clone --bundle-uri="$HTTPD_URL/bundle-list" \
+ clone-from clone-list-http 2>err &&
+ ! grep "Repository lacks these prerequisite commits" err &&
+
+ git -C clone-from for-each-ref --format="%(objectname)" >oids &&
+ git -C clone-list-http cat-file --batch-check <oids &&
+
+ cat >expect <<-EOF &&
+ $HTTPD_URL/bundle-1.bundle
+ $HTTPD_URL/bundle-2.bundle
+ $HTTPD_URL/bundle-3.bundle
+ $HTTPD_URL/bundle-4.bundle
+ $HTTPD_URL/bundle-list
+ EOF
+
+ # Sort the list, since the order is not well-defined
+ # without a heuristic.
+ test_remote_https_urls <trace-clone.txt | sort >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'clone bundle list (HTTP, any mode)' '
+ cp clone-from/bundle-*.bundle "$HTTPD_DOCUMENT_ROOT_PATH/" &&
+ cat >"$HTTPD_DOCUMENT_ROOT_PATH/bundle-list" <<-EOF &&
+ [bundle]
+ version = 1
+ mode = any
+
+ # Does not exist. Should be skipped.
+ [bundle "bundle-0"]
+ uri = $HTTPD_URL/bundle-0.bundle
+
+ [bundle "bundle-1"]
+ uri = $HTTPD_URL/bundle-1.bundle
+
+ # Does not exist. Should be skipped.
+ [bundle "bundle-5"]
+ uri = $HTTPD_URL/bundle-5.bundle
+ EOF
+
+ git clone --bundle-uri="$HTTPD_URL/bundle-list" \
+ clone-from clone-any-http 2>err &&
+ ! grep "fatal" err &&
+ grep "warning: failed to download bundle from URI" err &&
+
+ git -C clone-from for-each-ref --format="%(objectname)" >oids &&
+ git -C clone-any-http cat-file --batch-check <oids &&
+
+ git -C clone-list-file for-each-ref --format="%(refname)" >refs &&
+ grep "refs/bundles/" refs >actual &&
+ cat >expect <<-\EOF &&
+ refs/bundles/base
+ refs/bundles/left
+ refs/bundles/merge
+ refs/bundles/right
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'clone bundle list (http, creationToken)' '
+ test_when_finished rm -f trace*.txt &&
+
+ cp clone-from/bundle-*.bundle "$HTTPD_DOCUMENT_ROOT_PATH/" &&
+ cat >"$HTTPD_DOCUMENT_ROOT_PATH/bundle-list" <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+
+ [bundle "bundle-1"]
+ uri = bundle-1.bundle
+ creationToken = 1
+
+ [bundle "bundle-2"]
+ uri = bundle-2.bundle
+ creationToken = 2
+
+ [bundle "bundle-3"]
+ uri = bundle-3.bundle
+ creationToken = 3
+
+ [bundle "bundle-4"]
+ uri = bundle-4.bundle
+ creationToken = 4
+ EOF
+
+ GIT_TRACE2_EVENT="$(pwd)/trace-clone.txt" git \
+ clone --bundle-uri="$HTTPD_URL/bundle-list" \
+ "$HTTPD_URL/smart/fetch.git" clone-list-http-2 &&
+
+ git -C clone-from for-each-ref --format="%(objectname)" >oids &&
+ git -C clone-list-http-2 cat-file --batch-check <oids &&
+
+ cat >expect <<-EOF &&
+ $HTTPD_URL/bundle-list
+ $HTTPD_URL/bundle-4.bundle
+ $HTTPD_URL/bundle-3.bundle
+ $HTTPD_URL/bundle-2.bundle
+ $HTTPD_URL/bundle-1.bundle
+ EOF
+
+ test_remote_https_urls <trace-clone.txt >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'clone incomplete bundle list (http, creationToken)' '
+ test_when_finished rm -f trace*.txt &&
+
+ cp clone-from/bundle-*.bundle "$HTTPD_DOCUMENT_ROOT_PATH/" &&
+ cat >"$HTTPD_DOCUMENT_ROOT_PATH/bundle-list" <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+
+ [bundle "bundle-1"]
+ uri = bundle-1.bundle
+ creationToken = 1
+ EOF
+
+ GIT_TRACE2_EVENT=$(pwd)/trace-clone.txt \
+ git clone --bundle-uri="$HTTPD_URL/bundle-list" \
+ --single-branch --branch=base --no-tags \
+ "$HTTPD_URL/smart/fetch.git" clone-token-http &&
+
+ test_cmp_config -C clone-token-http "$HTTPD_URL/bundle-list" fetch.bundleuri &&
+ test_cmp_config -C clone-token-http 1 fetch.bundlecreationtoken &&
+
+ cat >expect <<-EOF &&
+ $HTTPD_URL/bundle-list
+ $HTTPD_URL/bundle-1.bundle
+ EOF
+
+ test_remote_https_urls <trace-clone.txt >actual &&
+ test_cmp expect actual &&
+
+ # We now have only one bundle ref.
+ git -C clone-token-http for-each-ref --format="%(refname)" "refs/bundles/*" >refs &&
+ cat >expect <<-\EOF &&
+ refs/bundles/base
+ EOF
+ test_cmp expect refs &&
+
+ # Add remaining bundles, exercising the "deepening" strategy
+ # for downloading via the creationToken heurisitc.
+ cat >>"$HTTPD_DOCUMENT_ROOT_PATH/bundle-list" <<-EOF &&
+ [bundle "bundle-2"]
+ uri = bundle-2.bundle
+ creationToken = 2
+
+ [bundle "bundle-3"]
+ uri = bundle-3.bundle
+ creationToken = 3
+
+ [bundle "bundle-4"]
+ uri = bundle-4.bundle
+ creationToken = 4
+ EOF
+
+ GIT_TRACE2_EVENT="$(pwd)/trace1.txt" \
+ git -C clone-token-http fetch origin --no-tags \
+ refs/heads/merge:refs/heads/merge &&
+ test_cmp_config -C clone-token-http 4 fetch.bundlecreationtoken &&
+
+ cat >expect <<-EOF &&
+ $HTTPD_URL/bundle-list
+ $HTTPD_URL/bundle-4.bundle
+ $HTTPD_URL/bundle-3.bundle
+ $HTTPD_URL/bundle-2.bundle
+ EOF
+
+ test_remote_https_urls <trace1.txt >actual &&
+ test_cmp expect actual &&
+
+ # We now have all bundle refs.
+ git -C clone-token-http for-each-ref --format="%(refname)" "refs/bundles/*" >refs &&
+
+ cat >expect <<-\EOF &&
+ refs/bundles/base
+ refs/bundles/left
+ refs/bundles/merge
+ refs/bundles/right
+ EOF
+ test_cmp expect refs
+'
+
+test_expect_success 'http clone with bundle.heuristic creates fetch.bundleURI' '
+ test_when_finished rm -rf fetch-http-4 trace*.txt &&
+
+ cat >"$HTTPD_DOCUMENT_ROOT_PATH/bundle-list" <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+
+ [bundle "bundle-1"]
+ uri = bundle-1.bundle
+ creationToken = 1
+ EOF
+
+ GIT_TRACE2_EVENT="$(pwd)/trace-clone.txt" \
+ git clone --single-branch --branch=base \
+ --bundle-uri="$HTTPD_URL/bundle-list" \
+ "$HTTPD_URL/smart/fetch.git" fetch-http-4 &&
+
+ test_cmp_config -C fetch-http-4 "$HTTPD_URL/bundle-list" fetch.bundleuri &&
+ test_cmp_config -C fetch-http-4 1 fetch.bundlecreationtoken &&
+
+ cat >expect <<-EOF &&
+ $HTTPD_URL/bundle-list
+ $HTTPD_URL/bundle-1.bundle
+ EOF
+
+ test_remote_https_urls <trace-clone.txt >actual &&
+ test_cmp expect actual &&
+
+ # only received base ref from bundle-1
+ git -C fetch-http-4 for-each-ref --format="%(refname)" "refs/bundles/*" >refs &&
+ cat >expect <<-\EOF &&
+ refs/bundles/base
+ EOF
+ test_cmp expect refs &&
+
+ cat >>"$HTTPD_DOCUMENT_ROOT_PATH/bundle-list" <<-EOF &&
+ [bundle "bundle-2"]
+ uri = bundle-2.bundle
+ creationToken = 2
+ EOF
+
+ # Fetch the objects for bundle-2 _and_ bundle-3.
+ GIT_TRACE2_EVENT="$(pwd)/trace1.txt" \
+ git -C fetch-http-4 fetch origin --no-tags \
+ refs/heads/left:refs/heads/left \
+ refs/heads/right:refs/heads/right &&
+ test_cmp_config -C fetch-http-4 2 fetch.bundlecreationtoken &&
+
+ cat >expect <<-EOF &&
+ $HTTPD_URL/bundle-list
+ $HTTPD_URL/bundle-2.bundle
+ EOF
+
+ test_remote_https_urls <trace1.txt >actual &&
+ test_cmp expect actual &&
+
+ # received left from bundle-2
+ git -C fetch-http-4 for-each-ref --format="%(refname)" "refs/bundles/*" >refs &&
+ cat >expect <<-\EOF &&
+ refs/bundles/base
+ refs/bundles/left
+ EOF
+ test_cmp expect refs &&
+
+ # No-op fetch
+ GIT_TRACE2_EVENT="$(pwd)/trace1b.txt" \
+ git -C fetch-http-4 fetch origin --no-tags \
+ refs/heads/left:refs/heads/left \
+ refs/heads/right:refs/heads/right &&
+
+ cat >expect <<-EOF &&
+ $HTTPD_URL/bundle-list
+ EOF
+ test_remote_https_urls <trace1b.txt >actual &&
+ test_cmp expect actual &&
+
+ cat >>"$HTTPD_DOCUMENT_ROOT_PATH/bundle-list" <<-EOF &&
+ [bundle "bundle-3"]
+ uri = bundle-3.bundle
+ creationToken = 3
+
+ [bundle "bundle-4"]
+ uri = bundle-4.bundle
+ creationToken = 4
+ EOF
+
+ # This fetch should skip bundle-3.bundle, since its objects are
+ # already local (we have the requisite commits for bundle-4.bundle).
+ GIT_TRACE2_EVENT="$(pwd)/trace2.txt" \
+ git -C fetch-http-4 fetch origin --no-tags \
+ refs/heads/merge:refs/heads/merge &&
+ test_cmp_config -C fetch-http-4 4 fetch.bundlecreationtoken &&
+
+ cat >expect <<-EOF &&
+ $HTTPD_URL/bundle-list
+ $HTTPD_URL/bundle-4.bundle
+ EOF
+
+ test_remote_https_urls <trace2.txt >actual &&
+ test_cmp expect actual &&
+
+ # received merge ref from bundle-4, but right is missing
+ # because we did not download bundle-3.
+ git -C fetch-http-4 for-each-ref --format="%(refname)" "refs/bundles/*" >refs &&
+
+ cat >expect <<-\EOF &&
+ refs/bundles/base
+ refs/bundles/left
+ refs/bundles/merge
+ EOF
+ test_cmp expect refs &&
+
+ # No-op fetch
+ GIT_TRACE2_EVENT="$(pwd)/trace2b.txt" \
+ git -C fetch-http-4 fetch origin &&
+
+ cat >expect <<-EOF &&
+ $HTTPD_URL/bundle-list
+ EOF
+ test_remote_https_urls <trace2b.txt >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'creationToken heuristic with failed downloads (clone)' '
+ test_when_finished rm -rf download-* trace*.txt &&
+
+ # Case 1: base bundle does not exist, nothing can unbundle
+ cat >"$HTTPD_DOCUMENT_ROOT_PATH/bundle-list" <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+
+ [bundle "bundle-1"]
+ uri = fake.bundle
+ creationToken = 1
+
+ [bundle "bundle-2"]
+ uri = bundle-2.bundle
+ creationToken = 2
+
+ [bundle "bundle-3"]
+ uri = bundle-3.bundle
+ creationToken = 3
+
+ [bundle "bundle-4"]
+ uri = bundle-4.bundle
+ creationToken = 4
+ EOF
+
+ GIT_TRACE2_EVENT="$(pwd)/trace-clone-1.txt" \
+ git clone --single-branch --branch=base \
+ --bundle-uri="$HTTPD_URL/bundle-list" \
+ "$HTTPD_URL/smart/fetch.git" download-1 &&
+
+ # Bundle failure does not set these configs.
+ test_must_fail git -C download-1 config fetch.bundleuri &&
+ test_must_fail git -C download-1 config fetch.bundlecreationtoken &&
+
+ cat >expect <<-EOF &&
+ $HTTPD_URL/bundle-list
+ $HTTPD_URL/bundle-4.bundle
+ $HTTPD_URL/bundle-3.bundle
+ $HTTPD_URL/bundle-2.bundle
+ $HTTPD_URL/fake.bundle
+ EOF
+ test_remote_https_urls <trace-clone-1.txt >actual &&
+ test_cmp expect actual &&
+
+ # All bundles failed to unbundle
+ git -C download-1 for-each-ref --format="%(refname)" "refs/bundles/*" >refs &&
+ test_must_be_empty refs &&
+
+ # Case 2: middle bundle does not exist, only two bundles can unbundle
+ cat >"$HTTPD_DOCUMENT_ROOT_PATH/bundle-list" <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+
+ [bundle "bundle-1"]
+ uri = bundle-1.bundle
+ creationToken = 1
+
+ [bundle "bundle-2"]
+ uri = fake.bundle
+ creationToken = 2
+
+ [bundle "bundle-3"]
+ uri = bundle-3.bundle
+ creationToken = 3
+
+ [bundle "bundle-4"]
+ uri = bundle-4.bundle
+ creationToken = 4
+ EOF
+
+ GIT_TRACE2_EVENT="$(pwd)/trace-clone-2.txt" \
+ git clone --single-branch --branch=base \
+ --bundle-uri="$HTTPD_URL/bundle-list" \
+ "$HTTPD_URL/smart/fetch.git" download-2 &&
+
+ # Bundle failure does not set these configs.
+ test_must_fail git -C download-2 config fetch.bundleuri &&
+ test_must_fail git -C download-2 config fetch.bundlecreationtoken &&
+
+ cat >expect <<-EOF &&
+ $HTTPD_URL/bundle-list
+ $HTTPD_URL/bundle-4.bundle
+ $HTTPD_URL/bundle-3.bundle
+ $HTTPD_URL/fake.bundle
+ $HTTPD_URL/bundle-1.bundle
+ EOF
+ test_remote_https_urls <trace-clone-2.txt >actual &&
+ test_cmp expect actual &&
+
+ # bundle-1 and bundle-3 could unbundle, but bundle-4 could not
+ git -C download-2 for-each-ref --format="%(refname)" "refs/bundles/*" >refs &&
+ cat >expect <<-EOF &&
+ refs/bundles/base
+ refs/bundles/right
+ EOF
+ test_cmp expect refs &&
+
+ # Case 3: top bundle does not exist, rest unbundle fine.
+ cat >"$HTTPD_DOCUMENT_ROOT_PATH/bundle-list" <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+
+ [bundle "bundle-1"]
+ uri = bundle-1.bundle
+ creationToken = 1
+
+ [bundle "bundle-2"]
+ uri = bundle-2.bundle
+ creationToken = 2
+
+ [bundle "bundle-3"]
+ uri = bundle-3.bundle
+ creationToken = 3
+
+ [bundle "bundle-4"]
+ uri = fake.bundle
+ creationToken = 4
+ EOF
+
+ GIT_TRACE2_EVENT="$(pwd)/trace-clone-3.txt" \
+ git clone --single-branch --branch=base \
+ --bundle-uri="$HTTPD_URL/bundle-list" \
+ "$HTTPD_URL/smart/fetch.git" download-3 &&
+
+ # As long as we have continguous successful downloads,
+ # we _do_ set these configs.
+ test_cmp_config -C download-3 "$HTTPD_URL/bundle-list" fetch.bundleuri &&
+ test_cmp_config -C download-3 3 fetch.bundlecreationtoken &&
+
+ cat >expect <<-EOF &&
+ $HTTPD_URL/bundle-list
+ $HTTPD_URL/fake.bundle
+ $HTTPD_URL/bundle-3.bundle
+ $HTTPD_URL/bundle-2.bundle
+ $HTTPD_URL/bundle-1.bundle
+ EOF
+ test_remote_https_urls <trace-clone-3.txt >actual &&
+ test_cmp expect actual &&
+
+ # fake.bundle did not unbundle, but the others did.
+ git -C download-3 for-each-ref --format="%(refname)" "refs/bundles/*" >refs &&
+ cat >expect <<-EOF &&
+ refs/bundles/base
+ refs/bundles/left
+ refs/bundles/right
+ EOF
+ test_cmp expect refs
+'
+
+# Expand the bundle list to include other interesting shapes, specifically
+# interesting for use when fetching from a previous state.
+#
+# ---------------- bundle-7
+# 7
+# _/|\_
+# ---/--|--\------ bundle-6
+# 5 | 6
+# --|---|---|----- bundle-4
+# | 4 |
+# | / \ /
+# --|-|---|/------ bundle-3 (the client will be caught up to this point.)
+# \ | 3
+# ---\|---|------- bundle-2
+# 2 |
+# ----|---|------- bundle-1
+# \ /
+# 1
+# |
+# (previous commits)
+test_expect_success 'expand incremental bundle list' '
+ (
+ cd clone-from &&
+ git checkout -b lefter left &&
+ test_commit 5 &&
+ git checkout -b righter right &&
+ test_commit 6 &&
+ git checkout -b top lefter &&
+ git merge -m "7" merge righter &&
+
+ git bundle create bundle-6.bundle lefter righter --not left right &&
+ git bundle create bundle-7.bundle top --not lefter merge righter &&
+
+ cp bundle-*.bundle "$HTTPD_DOCUMENT_ROOT_PATH/"
+ ) &&
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH/fetch.git" fetch origin +refs/heads/*:refs/heads/*
+'
+
+test_expect_success 'creationToken heuristic with failed downloads (fetch)' '
+ test_when_finished rm -rf download-* trace*.txt &&
+
+ cat >"$HTTPD_DOCUMENT_ROOT_PATH/bundle-list" <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+
+ [bundle "bundle-1"]
+ uri = bundle-1.bundle
+ creationToken = 1
+
+ [bundle "bundle-2"]
+ uri = bundle-2.bundle
+ creationToken = 2
+
+ [bundle "bundle-3"]
+ uri = bundle-3.bundle
+ creationToken = 3
+ EOF
+
+ git clone --single-branch --branch=left \
+ --bundle-uri="$HTTPD_URL/bundle-list" \
+ "$HTTPD_URL/smart/fetch.git" fetch-base &&
+ test_cmp_config -C fetch-base "$HTTPD_URL/bundle-list" fetch.bundleURI &&
+ test_cmp_config -C fetch-base 3 fetch.bundleCreationToken &&
+
+ # Case 1: all bundles exist: successful unbundling of all bundles
+ cat >"$HTTPD_DOCUMENT_ROOT_PATH/bundle-list" <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+
+ [bundle "bundle-1"]
+ uri = bundle-1.bundle
+ creationToken = 1
+
+ [bundle "bundle-2"]
+ uri = bundle-2.bundle
+ creationToken = 2
+
+ [bundle "bundle-3"]
+ uri = bundle-3.bundle
+ creationToken = 3
+
+ [bundle "bundle-4"]
+ uri = bundle-4.bundle
+ creationToken = 4
+
+ [bundle "bundle-6"]
+ uri = bundle-6.bundle
+ creationToken = 6
+
+ [bundle "bundle-7"]
+ uri = bundle-7.bundle
+ creationToken = 7
+ EOF
+
+ cp -r fetch-base fetch-1 &&
+ GIT_TRACE2_EVENT="$(pwd)/trace-fetch-1.txt" \
+ git -C fetch-1 fetch origin &&
+ test_cmp_config -C fetch-1 7 fetch.bundlecreationtoken &&
+
+ cat >expect <<-EOF &&
+ $HTTPD_URL/bundle-list
+ $HTTPD_URL/bundle-7.bundle
+ $HTTPD_URL/bundle-6.bundle
+ $HTTPD_URL/bundle-4.bundle
+ EOF
+ test_remote_https_urls <trace-fetch-1.txt >actual &&
+ test_cmp expect actual &&
+
+ # Check which bundles have unbundled by refs
+ git -C fetch-1 for-each-ref --format="%(refname)" "refs/bundles/*" >refs &&
+ cat >expect <<-EOF &&
+ refs/bundles/base
+ refs/bundles/left
+ refs/bundles/lefter
+ refs/bundles/merge
+ refs/bundles/right
+ refs/bundles/righter
+ refs/bundles/top
+ EOF
+ test_cmp expect refs &&
+
+ # Case 2: middle bundle does not exist, only bundle-4 can unbundle
+ cat >"$HTTPD_DOCUMENT_ROOT_PATH/bundle-list" <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+
+ [bundle "bundle-1"]
+ uri = bundle-1.bundle
+ creationToken = 1
+
+ [bundle "bundle-2"]
+ uri = bundle-2.bundle
+ creationToken = 2
+
+ [bundle "bundle-3"]
+ uri = bundle-3.bundle
+ creationToken = 3
+
+ [bundle "bundle-4"]
+ uri = bundle-4.bundle
+ creationToken = 4
+
+ [bundle "bundle-6"]
+ uri = fake.bundle
+ creationToken = 6
+
+ [bundle "bundle-7"]
+ uri = bundle-7.bundle
+ creationToken = 7
+ EOF
+
+ cp -r fetch-base fetch-2 &&
+ GIT_TRACE2_EVENT="$(pwd)/trace-fetch-2.txt" \
+ git -C fetch-2 fetch origin &&
+
+ # Since bundle-7 fails to unbundle, do not update creation token.
+ test_cmp_config -C fetch-2 3 fetch.bundlecreationtoken &&
+
+ cat >expect <<-EOF &&
+ $HTTPD_URL/bundle-list
+ $HTTPD_URL/bundle-7.bundle
+ $HTTPD_URL/fake.bundle
+ $HTTPD_URL/bundle-4.bundle
+ EOF
+ test_remote_https_urls <trace-fetch-2.txt >actual &&
+ test_cmp expect actual &&
+
+ # Check which bundles have unbundled by refs
+ git -C fetch-2 for-each-ref --format="%(refname)" "refs/bundles/*" >refs &&
+ cat >expect <<-EOF &&
+ refs/bundles/base
+ refs/bundles/left
+ refs/bundles/merge
+ refs/bundles/right
+ EOF
+ test_cmp expect refs &&
+
+ # Case 3: top bundle does not exist, rest unbundle fine.
+ cat >"$HTTPD_DOCUMENT_ROOT_PATH/bundle-list" <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+
+ [bundle "bundle-1"]
+ uri = bundle-1.bundle
+ creationToken = 1
+
+ [bundle "bundle-2"]
+ uri = bundle-2.bundle
+ creationToken = 2
+
+ [bundle "bundle-3"]
+ uri = bundle-3.bundle
+ creationToken = 3
+
+ [bundle "bundle-4"]
+ uri = bundle-4.bundle
+ creationToken = 4
+
+ [bundle "bundle-6"]
+ uri = bundle-6.bundle
+ creationToken = 6
+
+ [bundle "bundle-7"]
+ uri = fake.bundle
+ creationToken = 7
+ EOF
+
+ cp -r fetch-base fetch-3 &&
+ GIT_TRACE2_EVENT="$(pwd)/trace-fetch-3.txt" \
+ git -C fetch-3 fetch origin &&
+
+ # As long as we have continguous successful downloads,
+ # we _do_ set the maximum creation token.
+ test_cmp_config -C fetch-3 6 fetch.bundlecreationtoken &&
+
+ # NOTE: the fetch skips bundle-4 since bundle-6 successfully
+ # unbundles itself and bundle-7 failed to download.
+ cat >expect <<-EOF &&
+ $HTTPD_URL/bundle-list
+ $HTTPD_URL/fake.bundle
+ $HTTPD_URL/bundle-6.bundle
+ EOF
+ test_remote_https_urls <trace-fetch-3.txt >actual &&
+ test_cmp expect actual &&
+
+ # Check which bundles have unbundled by refs
+ git -C fetch-3 for-each-ref --format="%(refname)" "refs/bundles/*" >refs &&
+ cat >expect <<-EOF &&
+ refs/bundles/base
+ refs/bundles/left
+ refs/bundles/lefter
+ refs/bundles/right
+ refs/bundles/righter
+ EOF
+ test_cmp expect refs
+'
+
+test_expect_success 'bundles are downloaded once during fetch --all' '
+ test_when_finished rm -rf download-* trace*.txt fetch-mult &&
+
+ cat >"$HTTPD_DOCUMENT_ROOT_PATH/bundle-list" <<-EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+
+ [bundle "bundle-1"]
+ uri = bundle-1.bundle
+ creationToken = 1
+
+ [bundle "bundle-2"]
+ uri = bundle-2.bundle
+ creationToken = 2
+
+ [bundle "bundle-3"]
+ uri = bundle-3.bundle
+ creationToken = 3
+ EOF
+
+ git clone --single-branch --branch=left \
+ --bundle-uri="$HTTPD_URL/bundle-list" \
+ "$HTTPD_URL/smart/fetch.git" fetch-mult &&
+ git -C fetch-mult remote add dup1 "$HTTPD_URL/smart/fetch.git" &&
+ git -C fetch-mult remote add dup2 "$HTTPD_URL/smart/fetch.git" &&
+
+ GIT_TRACE2_EVENT="$(pwd)/trace-mult.txt" \
+ git -C fetch-mult fetch --all &&
+ grep "\"child_start\".*\"git-remote-https\",\"$HTTPD_URL/bundle-list\"" \
+ trace-mult.txt >bundle-fetches &&
+ test_line_count = 1 bundle-fetches
+'
+# Do not add tests here unless they use the HTTP server, as they will
+# not run unless the HTTP dependencies exist.
+
+test_done
diff --git a/t/t5559-http-fetch-smart-http2.sh b/t/t5559-http-fetch-smart-http2.sh
new file mode 100755
index 0000000..54aa9d3
--- /dev/null
+++ b/t/t5559-http-fetch-smart-http2.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+HTTP_PROTO=HTTP/2
+LIB_HTTPD_SSL=1
+. ./t5551-http-fetch-smart.sh
diff --git a/t/t5560-http-backend-noserver.sh b/t/t5560-http-backend-noserver.sh
index d30cf4f..f75068d 100755
--- a/t/t5560-http-backend-noserver.sh
+++ b/t/t5560-http-backend-noserver.sh
@@ -4,6 +4,7 @@ test_description='test git-http-backend-noserver'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
HTTPD_DOCUMENT_ROOT_PATH="$TRASH_DIRECTORY"
diff --git a/t/t5561-http-backend.sh b/t/t5561-http-backend.sh
index 9c57d84..e1d3b8c 100755
--- a/t/t5561-http-backend.sh
+++ b/t/t5561-http-backend.sh
@@ -4,6 +4,7 @@ test_description='test git-http-backend'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-httpd.sh
diff --git a/t/t5562-http-backend-content-length.sh b/t/t5562-http-backend-content-length.sh
index b68ec22..7ee9858 100755
--- a/t/t5562-http-backend-content-length.sh
+++ b/t/t5562-http-backend-content-length.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='test git-http-backend respects CONTENT_LENGTH'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_lazy_prereq GZIP 'gzip --version'
diff --git a/t/t5562/invoke-with-content-length.pl b/t/t5562/invoke-with-content-length.pl
index 718dd9b..9babb9a 100644
--- a/t/t5562/invoke-with-content-length.pl
+++ b/t/t5562/invoke-with-content-length.pl
@@ -1,4 +1,4 @@
-use 5.008;
+use 5.008001;
use strict;
use warnings;
diff --git a/t/t5563-simple-http-auth.sh b/t/t5563-simple-http-auth.sh
new file mode 100755
index 0000000..ab8a721
--- /dev/null
+++ b/t/t5563-simple-http-auth.sh
@@ -0,0 +1,329 @@
+#!/bin/sh
+
+test_description='test http auth header and credential helper interop'
+
+. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-httpd.sh
+
+enable_cgipassauth
+if ! test_have_prereq CGIPASSAUTH
+then
+ skip_all="no CGIPassAuth support"
+ test_done
+fi
+start_httpd
+
+test_expect_success 'setup_credential_helper' '
+ mkdir "$TRASH_DIRECTORY/bin" &&
+ PATH=$PATH:"$TRASH_DIRECTORY/bin" &&
+ export PATH &&
+
+ CREDENTIAL_HELPER="$TRASH_DIRECTORY/bin/git-credential-test-helper" &&
+ write_script "$CREDENTIAL_HELPER" <<-\EOF
+ cmd=$1
+ teefile=$cmd-query.cred
+ catfile=$cmd-reply.cred
+ sed -n -e "/^$/q" -e "p" >>$teefile
+ if test "$cmd" = "get"
+ then
+ cat $catfile
+ fi
+ EOF
+'
+
+set_credential_reply () {
+ cat >"$TRASH_DIRECTORY/$1-reply.cred"
+}
+
+expect_credential_query () {
+ cat >"$TRASH_DIRECTORY/$1-expect.cred" &&
+ test_cmp "$TRASH_DIRECTORY/$1-expect.cred" \
+ "$TRASH_DIRECTORY/$1-query.cred"
+}
+
+per_test_cleanup () {
+ rm -f *.cred &&
+ rm -f "$HTTPD_ROOT_PATH"/custom-auth.valid \
+ "$HTTPD_ROOT_PATH"/custom-auth.challenge
+}
+
+test_expect_success 'setup repository' '
+ test_commit foo &&
+ git init --bare "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
+ git push --mirror "$HTTPD_DOCUMENT_ROOT_PATH/repo.git"
+'
+
+test_expect_success 'access using basic auth' '
+ test_when_finished "per_test_cleanup" &&
+
+ set_credential_reply get <<-EOF &&
+ username=alice
+ password=secret-passwd
+ EOF
+
+ # Basic base64(alice:secret-passwd)
+ cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
+ Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
+ EOF
+
+ cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
+ WWW-Authenticate: Basic realm="example.com"
+ EOF
+
+ test_config_global credential.helper test-helper &&
+ git ls-remote "$HTTPD_URL/custom_auth/repo.git" &&
+
+ expect_credential_query get <<-EOF &&
+ protocol=http
+ host=$HTTPD_DEST
+ wwwauth[]=Basic realm="example.com"
+ EOF
+
+ expect_credential_query store <<-EOF
+ protocol=http
+ host=$HTTPD_DEST
+ username=alice
+ password=secret-passwd
+ EOF
+'
+
+test_expect_success 'access using basic auth invalid credentials' '
+ test_when_finished "per_test_cleanup" &&
+
+ set_credential_reply get <<-EOF &&
+ username=baduser
+ password=wrong-passwd
+ EOF
+
+ # Basic base64(alice:secret-passwd)
+ cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
+ Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
+ EOF
+
+ cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
+ WWW-Authenticate: Basic realm="example.com"
+ EOF
+
+ test_config_global credential.helper test-helper &&
+ test_must_fail git ls-remote "$HTTPD_URL/custom_auth/repo.git" &&
+
+ expect_credential_query get <<-EOF &&
+ protocol=http
+ host=$HTTPD_DEST
+ wwwauth[]=Basic realm="example.com"
+ EOF
+
+ expect_credential_query erase <<-EOF
+ protocol=http
+ host=$HTTPD_DEST
+ username=baduser
+ password=wrong-passwd
+ wwwauth[]=Basic realm="example.com"
+ EOF
+'
+
+test_expect_success 'access using basic auth with extra challenges' '
+ test_when_finished "per_test_cleanup" &&
+
+ set_credential_reply get <<-EOF &&
+ username=alice
+ password=secret-passwd
+ EOF
+
+ # Basic base64(alice:secret-passwd)
+ cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
+ Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
+ EOF
+
+ cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
+ WWW-Authenticate: FooBar param1="value1" param2="value2"
+ WWW-Authenticate: Bearer authorize_uri="id.example.com" p=1 q=0
+ WWW-Authenticate: Basic realm="example.com"
+ EOF
+
+ test_config_global credential.helper test-helper &&
+ git ls-remote "$HTTPD_URL/custom_auth/repo.git" &&
+
+ expect_credential_query get <<-EOF &&
+ protocol=http
+ host=$HTTPD_DEST
+ wwwauth[]=FooBar param1="value1" param2="value2"
+ wwwauth[]=Bearer authorize_uri="id.example.com" p=1 q=0
+ wwwauth[]=Basic realm="example.com"
+ EOF
+
+ expect_credential_query store <<-EOF
+ protocol=http
+ host=$HTTPD_DEST
+ username=alice
+ password=secret-passwd
+ EOF
+'
+
+test_expect_success 'access using basic auth mixed-case wwwauth header name' '
+ test_when_finished "per_test_cleanup" &&
+
+ set_credential_reply get <<-EOF &&
+ username=alice
+ password=secret-passwd
+ EOF
+
+ # Basic base64(alice:secret-passwd)
+ cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
+ Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
+ EOF
+
+ cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
+ www-authenticate: foobar param1="value1" param2="value2"
+ WWW-AUTHENTICATE: BEARER authorize_uri="id.example.com" p=1 q=0
+ WwW-aUtHeNtIcAtE: baSiC realm="example.com"
+ EOF
+
+ test_config_global credential.helper test-helper &&
+ git ls-remote "$HTTPD_URL/custom_auth/repo.git" &&
+
+ expect_credential_query get <<-EOF &&
+ protocol=http
+ host=$HTTPD_DEST
+ wwwauth[]=foobar param1="value1" param2="value2"
+ wwwauth[]=BEARER authorize_uri="id.example.com" p=1 q=0
+ wwwauth[]=baSiC realm="example.com"
+ EOF
+
+ expect_credential_query store <<-EOF
+ protocol=http
+ host=$HTTPD_DEST
+ username=alice
+ password=secret-passwd
+ EOF
+'
+
+test_expect_success 'access using basic auth with wwwauth header continuations' '
+ test_when_finished "per_test_cleanup" &&
+
+ set_credential_reply get <<-EOF &&
+ username=alice
+ password=secret-passwd
+ EOF
+
+ # Basic base64(alice:secret-passwd)
+ cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
+ Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
+ EOF
+
+ # Note that leading and trailing whitespace is important to correctly
+ # simulate a continuation/folded header.
+ cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
+ WWW-Authenticate: FooBar param1="value1"
+ param2="value2"
+ WWW-Authenticate: Bearer authorize_uri="id.example.com"
+ p=1
+ q=0
+ WWW-Authenticate: Basic realm="example.com"
+ EOF
+
+ test_config_global credential.helper test-helper &&
+ git ls-remote "$HTTPD_URL/custom_auth/repo.git" &&
+
+ expect_credential_query get <<-EOF &&
+ protocol=http
+ host=$HTTPD_DEST
+ wwwauth[]=FooBar param1="value1" param2="value2"
+ wwwauth[]=Bearer authorize_uri="id.example.com" p=1 q=0
+ wwwauth[]=Basic realm="example.com"
+ EOF
+
+ expect_credential_query store <<-EOF
+ protocol=http
+ host=$HTTPD_DEST
+ username=alice
+ password=secret-passwd
+ EOF
+'
+
+test_expect_success 'access using basic auth with wwwauth header empty continuations' '
+ test_when_finished "per_test_cleanup" &&
+
+ set_credential_reply get <<-EOF &&
+ username=alice
+ password=secret-passwd
+ EOF
+
+ # Basic base64(alice:secret-passwd)
+ cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
+ Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
+ EOF
+
+ CHALLENGE="$HTTPD_ROOT_PATH/custom-auth.challenge" &&
+
+ # Note that leading and trailing whitespace is important to correctly
+ # simulate a continuation/folded header.
+ printf "WWW-Authenticate: FooBar param1=\"value1\"\r\n" >"$CHALLENGE" &&
+ printf " \r\n" >>"$CHALLENGE" &&
+ printf " param2=\"value2\"\r\n" >>"$CHALLENGE" &&
+ printf "WWW-Authenticate: Bearer authorize_uri=\"id.example.com\"\r\n" >>"$CHALLENGE" &&
+ printf " p=1\r\n" >>"$CHALLENGE" &&
+ printf " \r\n" >>"$CHALLENGE" &&
+ printf " q=0\r\n" >>"$CHALLENGE" &&
+ printf "WWW-Authenticate: Basic realm=\"example.com\"\r\n" >>"$CHALLENGE" &&
+
+ test_config_global credential.helper test-helper &&
+ git ls-remote "$HTTPD_URL/custom_auth/repo.git" &&
+
+ expect_credential_query get <<-EOF &&
+ protocol=http
+ host=$HTTPD_DEST
+ wwwauth[]=FooBar param1="value1" param2="value2"
+ wwwauth[]=Bearer authorize_uri="id.example.com" p=1 q=0
+ wwwauth[]=Basic realm="example.com"
+ EOF
+
+ expect_credential_query store <<-EOF
+ protocol=http
+ host=$HTTPD_DEST
+ username=alice
+ password=secret-passwd
+ EOF
+'
+
+test_expect_success 'access using basic auth with wwwauth header mixed line-endings' '
+ test_when_finished "per_test_cleanup" &&
+
+ set_credential_reply get <<-EOF &&
+ username=alice
+ password=secret-passwd
+ EOF
+
+ # Basic base64(alice:secret-passwd)
+ cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
+ Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
+ EOF
+
+ CHALLENGE="$HTTPD_ROOT_PATH/custom-auth.challenge" &&
+
+ # Note that leading and trailing whitespace is important to correctly
+ # simulate a continuation/folded header.
+ printf "WWW-Authenticate: FooBar param1=\"value1\"\r\n" >"$CHALLENGE" &&
+ printf " \r\n" >>"$CHALLENGE" &&
+ printf "\tparam2=\"value2\"\r\n" >>"$CHALLENGE" &&
+ printf "WWW-Authenticate: Basic realm=\"example.com\"" >>"$CHALLENGE" &&
+
+ test_config_global credential.helper test-helper &&
+ git ls-remote "$HTTPD_URL/custom_auth/repo.git" &&
+
+ expect_credential_query get <<-EOF &&
+ protocol=http
+ host=$HTTPD_DEST
+ wwwauth[]=FooBar param1="value1" param2="value2"
+ wwwauth[]=Basic realm="example.com"
+ EOF
+
+ expect_credential_query store <<-EOF
+ protocol=http
+ host=$HTTPD_DEST
+ username=alice
+ password=secret-passwd
+ EOF
+'
+
+test_done
diff --git a/t/t5564-http-proxy.sh b/t/t5564-http-proxy.sh
new file mode 100755
index 0000000..9da5134
--- /dev/null
+++ b/t/t5564-http-proxy.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+test_description="test fetching through http proxy"
+
+. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-httpd.sh
+
+LIB_HTTPD_PROXY=1
+start_httpd
+
+test_expect_success 'setup repository' '
+ test_commit foo &&
+ git init --bare "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
+ git push --mirror "$HTTPD_DOCUMENT_ROOT_PATH/repo.git"
+'
+
+setup_askpass_helper
+
+# sanity check that our test setup is correctly using proxy
+test_expect_success 'proxy requires password' '
+ test_config_global http.proxy $HTTPD_DEST &&
+ test_must_fail git clone $HTTPD_URL/smart/repo.git 2>err &&
+ grep "error.*407" err
+'
+
+test_expect_success 'clone through proxy with auth' '
+ test_when_finished "rm -rf clone" &&
+ test_config_global http.proxy http://proxuser:proxpass@$HTTPD_DEST &&
+ GIT_TRACE_CURL=$PWD/trace git clone $HTTPD_URL/smart/repo.git clone &&
+ grep -i "Proxy-Authorization: Basic <redacted>" trace
+'
+
+test_expect_success 'clone can prompt for proxy password' '
+ test_when_finished "rm -rf clone" &&
+ test_config_global http.proxy http://proxuser@$HTTPD_DEST &&
+ set_askpass nobody proxpass &&
+ GIT_TRACE_CURL=$PWD/trace git clone $HTTPD_URL/smart/repo.git clone &&
+ expect_askpass pass proxuser
+'
+
+test_done
diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh
index 1131503..f9a9bf9 100755
--- a/t/t5570-git-daemon.sh
+++ b/t/t5570-git-daemon.sh
@@ -10,9 +10,9 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
start_git_daemon
check_verbose_connect () {
- test_i18ngrep -F "Looking up 127.0.0.1 ..." stderr &&
- test_i18ngrep -F "Connecting to 127.0.0.1 (port " stderr &&
- test_i18ngrep -F "done." stderr
+ test_grep -F "Looking up 127.0.0.1 ..." stderr &&
+ test_grep -F "Connecting to 127.0.0.1 (port " stderr &&
+ test_grep -F "done." stderr
}
test_expect_success 'setup repository' '
@@ -108,7 +108,7 @@ test_expect_success 'fetch notices corrupt idx' '
test_expect_success 'client refuses to ask for repo with newline' '
test_must_fail git clone "$GIT_DAEMON_URL/repo$LF.git" dst 2>stderr &&
- test_i18ngrep newline.is.forbidden stderr
+ test_grep newline.is.forbidden stderr
'
test_remote_error()
@@ -148,7 +148,7 @@ test_remote_error()
fi
test_must_fail git "$cmd" "$GIT_DAEMON_URL/$repo" "$@" 2>output &&
- test_i18ngrep "fatal: remote error: $msg: /$repo" output &&
+ test_grep "fatal: remote error: $msg: /$repo" output &&
ret=$?
chmod +x "$GIT_DAEMON_DOCUMENT_ROOT_PATH/repo.git"
(exit $ret)
diff --git a/t/t5571-pre-push-hook.sh b/t/t5571-pre-push-hook.sh
index a11b20e..448134c 100755
--- a/t/t5571-pre-push-hook.sh
+++ b/t/t5571-pre-push-hook.sh
@@ -4,6 +4,7 @@ test_description='check pre-push hooks'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
diff --git a/t/t5572-pull-submodule.sh b/t/t5572-pull-submodule.sh
index a35396f..5174452 100755
--- a/t/t5572-pull-submodule.sh
+++ b/t/t5572-pull-submodule.sh
@@ -52,6 +52,10 @@ then
fi
test_submodule_switch_func "git_pull_noff"
+test_expect_success 'setup' '
+ git config --global protocol.file.allow always
+'
+
test_expect_success 'pull --recurse-submodule setup' '
test_create_repo child &&
test_commit -C child bar &&
@@ -117,7 +121,7 @@ test_expect_success "fetch.recurseSubmodules option triggers recursive fetch (bu
sub_oid=$(git -C child rev-parse HEAD) &&
git -C super/sub cat-file -e $sub_oid &&
# Check that the submodule worktree did not update
- ! test_path_is_file super/sub/merge_strategy_5.t
+ test_path_is_missing super/sub/merge_strategy_5.t
'
test_expect_success "fetch.recurseSubmodules takes precedence over submodule.recurse" '
@@ -130,7 +134,7 @@ test_expect_success "fetch.recurseSubmodules takes precedence over submodule.rec
sub_oid=$(git -C child rev-parse HEAD) &&
git -C super/sub cat-file -e $sub_oid &&
# Check that the submodule worktree did not update
- ! test_path_is_file super/sub/merge_strategy_6.t
+ test_path_is_missing super/sub/merge_strategy_6.t
'
test_expect_success 'pull --rebase --recurse-submodules (remote superproject submodule changes, local submodule changes)' '
@@ -173,7 +177,7 @@ test_expect_success 'pull --rebase --recurse-submodules fails if both sides reco
# submodule itself, but the merge strategy in submodules
# does not support rebase:
test_must_fail git -C super pull --rebase --recurse-submodules 2>err &&
- test_i18ngrep "locally recorded submodule modifications" err
+ test_grep "locally recorded submodule modifications" err
'
test_expect_success 'pull --rebase --recurse-submodules (no submodule changes, no fork-point)' '
diff --git a/t/t5573-pull-verify-signatures.sh b/t/t5573-pull-verify-signatures.sh
index a53dd85..ab05f38 100755
--- a/t/t5573-pull-verify-signatures.sh
+++ b/t/t5573-pull-verify-signatures.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='pull signature verification tests'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY/lib-gpg.sh"
@@ -45,46 +47,46 @@ test_expect_success GPG 'create repositories with signed commits' '
test_expect_success GPG 'pull unsigned commit with --verify-signatures' '
test_when_finished "git reset --hard && git checkout initial" &&
test_must_fail git pull --ff-only --verify-signatures unsigned 2>pullerror &&
- test_i18ngrep "does not have a GPG signature" pullerror
+ test_grep "does not have a GPG signature" pullerror
'
test_expect_success GPG 'pull commit with bad signature with --verify-signatures' '
test_when_finished "git reset --hard && git checkout initial" &&
test_must_fail git pull --ff-only --verify-signatures bad 2>pullerror &&
- test_i18ngrep "has a bad GPG signature" pullerror
+ test_grep "has a bad GPG signature" pullerror
'
test_expect_success GPG 'pull commit with untrusted signature with --verify-signatures' '
test_when_finished "git reset --hard && git checkout initial" &&
test_must_fail git pull --ff-only --verify-signatures untrusted 2>pullerror &&
- test_i18ngrep "has an untrusted GPG signature" pullerror
+ test_grep "has an untrusted GPG signature" pullerror
'
test_expect_success GPG 'pull commit with untrusted signature with --verify-signatures and minTrustLevel=ultimate' '
test_when_finished "git reset --hard && git checkout initial" &&
test_config gpg.minTrustLevel ultimate &&
test_must_fail git pull --ff-only --verify-signatures untrusted 2>pullerror &&
- test_i18ngrep "has an untrusted GPG signature" pullerror
+ test_grep "has an untrusted GPG signature" pullerror
'
test_expect_success GPG 'pull commit with untrusted signature with --verify-signatures and minTrustLevel=marginal' '
test_when_finished "git reset --hard && git checkout initial" &&
test_config gpg.minTrustLevel marginal &&
test_must_fail git pull --ff-only --verify-signatures untrusted 2>pullerror &&
- test_i18ngrep "has an untrusted GPG signature" pullerror
+ test_grep "has an untrusted GPG signature" pullerror
'
test_expect_success GPG 'pull commit with untrusted signature with --verify-signatures and minTrustLevel=undefined' '
test_when_finished "git reset --hard && git checkout initial" &&
test_config gpg.minTrustLevel undefined &&
git pull --ff-only --verify-signatures untrusted >pulloutput &&
- test_i18ngrep "has a good GPG signature" pulloutput
+ test_grep "has a good GPG signature" pulloutput
'
test_expect_success GPG 'pull signed commit with --verify-signatures' '
test_when_finished "git reset --hard && git checkout initial" &&
git pull --verify-signatures signed >pulloutput &&
- test_i18ngrep "has a good GPG signature" pulloutput
+ test_grep "has a good GPG signature" pulloutput
'
test_expect_success GPG 'pull commit with bad signature without verification' '
@@ -104,7 +106,7 @@ test_expect_success GPG 'pull unsigned commit into unborn branch' '
git init empty-repo &&
test_must_fail \
git -C empty-repo pull --verify-signatures .. 2>pullerror &&
- test_i18ngrep "does not have a GPG signature" pullerror
+ test_grep "does not have a GPG signature" pullerror
'
test_expect_success GPG 'pull commit into unborn branch with bad signature and --verify-signatures' '
@@ -112,7 +114,7 @@ test_expect_success GPG 'pull commit into unborn branch with bad signature and -
git init empty-repo &&
test_must_fail \
git -C empty-repo pull --ff-only --verify-signatures ../bad 2>pullerror &&
- test_i18ngrep "has a bad GPG signature" pullerror
+ test_grep "has a bad GPG signature" pullerror
'
test_expect_success GPG 'pull commit into unborn branch with untrusted signature and --verify-signatures' '
@@ -120,7 +122,7 @@ test_expect_success GPG 'pull commit into unborn branch with untrusted signature
git init empty-repo &&
test_must_fail \
git -C empty-repo pull --ff-only --verify-signatures ../untrusted 2>pullerror &&
- test_i18ngrep "has an untrusted GPG signature" pullerror
+ test_grep "has an untrusted GPG signature" pullerror
'
test_expect_success GPG 'pull commit into unborn branch with untrusted signature and --verify-signatures and minTrustLevel=ultimate' '
@@ -129,7 +131,7 @@ test_expect_success GPG 'pull commit into unborn branch with untrusted signature
test_config_global gpg.minTrustLevel ultimate &&
test_must_fail \
git -C empty-repo pull --ff-only --verify-signatures ../untrusted 2>pullerror &&
- test_i18ngrep "has an untrusted GPG signature" pullerror
+ test_grep "has an untrusted GPG signature" pullerror
'
test_expect_success GPG 'pull commit into unborn branch with untrusted signature and --verify-signatures and minTrustLevel=marginal' '
@@ -138,7 +140,7 @@ test_expect_success GPG 'pull commit into unborn branch with untrusted signature
test_config_global gpg.minTrustLevel marginal &&
test_must_fail \
git -C empty-repo pull --ff-only --verify-signatures ../untrusted 2>pullerror &&
- test_i18ngrep "has an untrusted GPG signature" pullerror
+ test_grep "has an untrusted GPG signature" pullerror
'
test_expect_success GPG 'pull commit into unborn branch with untrusted signature and --verify-signatures and minTrustLevel=undefined' '
@@ -146,7 +148,7 @@ test_expect_success GPG 'pull commit into unborn branch with untrusted signature
git init empty-repo &&
test_config_global gpg.minTrustLevel undefined &&
git -C empty-repo pull --ff-only --verify-signatures ../untrusted >pulloutput &&
- test_i18ngrep "has a good GPG signature" pulloutput
+ test_grep "has a good GPG signature" pulloutput
'
test_done
diff --git a/t/t5574-fetch-output.sh b/t/t5574-fetch-output.sh
new file mode 100755
index 0000000..5883839
--- /dev/null
+++ b/t/t5574-fetch-output.sh
@@ -0,0 +1,304 @@
+#!/bin/sh
+
+test_description='git fetch output format'
+
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+. ./test-lib.sh
+
+test_expect_success 'fetch with invalid output format configuration' '
+ test_when_finished "rm -rf clone" &&
+ git clone . clone &&
+
+ test_must_fail git -C clone -c fetch.output fetch origin 2>actual.err &&
+ cat >expect <<-EOF &&
+ error: missing value for ${SQ}fetch.output${SQ}
+ fatal: unable to parse ${SQ}fetch.output${SQ} from command-line config
+ EOF
+ test_cmp expect actual.err &&
+
+ test_must_fail git -C clone -c fetch.output= fetch origin 2>actual.err &&
+ cat >expect <<-EOF &&
+ fatal: invalid value for ${SQ}fetch.output${SQ}: ${SQ}${SQ}
+ EOF
+ test_cmp expect actual.err &&
+
+ test_must_fail git -C clone -c fetch.output=garbage fetch origin 2>actual.err &&
+ cat >expect <<-EOF &&
+ fatal: invalid value for ${SQ}fetch.output${SQ}: ${SQ}garbage${SQ}
+ EOF
+ test_cmp expect actual.err
+'
+
+test_expect_success 'fetch aligned output' '
+ git clone . full-output &&
+ test_commit looooooooooooong-tag &&
+ (
+ cd full-output &&
+ git -c fetch.output=full fetch origin >actual 2>&1 &&
+ grep -e "->" actual | cut -c 22- >../actual
+ ) &&
+ cat >expect <<-\EOF &&
+ main -> origin/main
+ looooooooooooong-tag -> looooooooooooong-tag
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'fetch compact output' '
+ git clone . compact &&
+ test_commit extraaa &&
+ (
+ cd compact &&
+ git -c fetch.output=compact fetch origin >actual 2>&1 &&
+ grep -e "->" actual | cut -c 22- >../actual
+ ) &&
+ cat >expect <<-\EOF &&
+ main -> origin/*
+ extraaa -> *
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'setup for fetch porcelain output' '
+ # Set up a bunch of references that we can use to demonstrate different
+ # kinds of flag symbols in the output format.
+ test_commit commit-for-porcelain-output &&
+ MAIN_OLD=$(git rev-parse HEAD) &&
+ git branch "fast-forward" &&
+ git branch "deleted-branch" &&
+ git checkout -b force-updated &&
+ test_commit --no-tag force-update-old &&
+ FORCE_UPDATED_OLD=$(git rev-parse HEAD) &&
+ git checkout main &&
+
+ # Backup to preseed.git
+ git clone --mirror . preseed.git &&
+
+ # Continue changing our local references.
+ git branch new-branch &&
+ git branch -d deleted-branch &&
+ git checkout fast-forward &&
+ test_commit --no-tag fast-forward-new &&
+ FAST_FORWARD_NEW=$(git rev-parse HEAD) &&
+ git checkout force-updated &&
+ git reset --hard HEAD~ &&
+ test_commit --no-tag force-update-new &&
+ FORCE_UPDATED_NEW=$(git rev-parse HEAD)
+'
+
+for opt in "" "--atomic"
+do
+ test_expect_success "fetch porcelain output ${opt:+(atomic)}" '
+ test_when_finished "rm -rf porcelain" &&
+
+ # Clone and pre-seed the repositories. We fetch references into two
+ # namespaces so that we can test that rejected and force-updated
+ # references are reported properly.
+ refspecs="refs/heads/*:refs/unforced/* +refs/heads/*:refs/forced/*" &&
+ git clone preseed.git porcelain &&
+ git -C porcelain fetch origin $opt $refspecs &&
+
+ cat >expect <<-EOF &&
+ - $MAIN_OLD $ZERO_OID refs/forced/deleted-branch
+ - $MAIN_OLD $ZERO_OID refs/unforced/deleted-branch
+ $MAIN_OLD $FAST_FORWARD_NEW refs/unforced/fast-forward
+ ! $FORCE_UPDATED_OLD $FORCE_UPDATED_NEW refs/unforced/force-updated
+ * $ZERO_OID $MAIN_OLD refs/unforced/new-branch
+ $MAIN_OLD $FAST_FORWARD_NEW refs/forced/fast-forward
+ + $FORCE_UPDATED_OLD $FORCE_UPDATED_NEW refs/forced/force-updated
+ * $ZERO_OID $MAIN_OLD refs/forced/new-branch
+ $MAIN_OLD $FAST_FORWARD_NEW refs/remotes/origin/fast-forward
+ + $FORCE_UPDATED_OLD $FORCE_UPDATED_NEW refs/remotes/origin/force-updated
+ * $ZERO_OID $MAIN_OLD refs/remotes/origin/new-branch
+ EOF
+
+ # Change the URL of the repository to fetch different references.
+ git -C porcelain remote set-url origin .. &&
+
+ # Execute a dry-run fetch first. We do this to assert that the dry-run
+ # and non-dry-run fetches produces the same output. Execution of the
+ # fetch is expected to fail as we have a rejected reference update.
+ test_must_fail git -C porcelain fetch $opt \
+ --porcelain --dry-run --prune origin $refspecs >actual &&
+ test_cmp expect actual &&
+
+ # And now we perform a non-dry-run fetch.
+ test_must_fail git -C porcelain fetch $opt \
+ --porcelain --prune origin $refspecs >actual 2>stderr &&
+ test_cmp expect actual &&
+ test_must_be_empty stderr
+ '
+done
+
+test_expect_success 'fetch porcelain with multiple remotes' '
+ test_when_finished "rm -rf porcelain" &&
+
+ git switch --create multiple-remotes &&
+ git clone . porcelain &&
+ git -C porcelain remote add second-remote "$PWD" &&
+ git -C porcelain fetch second-remote &&
+
+ test_commit --no-tag multi-commit &&
+ old_commit=$(git rev-parse HEAD~) &&
+ new_commit=$(git rev-parse HEAD) &&
+
+ cat >expect <<-EOF &&
+ $old_commit $new_commit refs/remotes/origin/multiple-remotes
+ $old_commit $new_commit refs/remotes/second-remote/multiple-remotes
+ EOF
+
+ git -C porcelain fetch --porcelain --all >actual 2>stderr &&
+ test_cmp expect actual &&
+ test_must_be_empty stderr
+'
+
+test_expect_success 'fetch porcelain refuses to work with submodules' '
+ test_when_finished "rm -rf porcelain" &&
+
+ cat >expect <<-EOF &&
+ fatal: options ${SQ}--porcelain${SQ} and ${SQ}--recurse-submodules${SQ} cannot be used together
+ EOF
+
+ git init porcelain &&
+ test_must_fail git -C porcelain fetch --porcelain --recurse-submodules=yes 2>stderr &&
+ test_cmp expect stderr &&
+
+ test_must_fail git -C porcelain fetch --porcelain --recurse-submodules=on-demand 2>stderr &&
+ test_cmp expect stderr
+'
+
+test_expect_success 'fetch porcelain overrides fetch.output config' '
+ test_when_finished "rm -rf porcelain" &&
+
+ git switch --create config-override &&
+ git clone . porcelain &&
+ test_commit new-commit &&
+ old_commit=$(git rev-parse HEAD~) &&
+ new_commit=$(git rev-parse HEAD) &&
+
+ cat >expect <<-EOF &&
+ $old_commit $new_commit refs/remotes/origin/config-override
+ * $ZERO_OID $new_commit refs/tags/new-commit
+ EOF
+
+ git -C porcelain -c fetch.output=compact fetch --porcelain >stdout 2>stderr &&
+ test_must_be_empty stderr &&
+ test_cmp expect stdout
+'
+
+test_expect_success 'fetch --no-porcelain overrides previous --porcelain' '
+ test_when_finished "rm -rf no-porcelain" &&
+
+ git switch --create no-porcelain &&
+ git clone . no-porcelain &&
+ test_commit --no-tag no-porcelain &&
+ old_commit=$(git rev-parse --short HEAD~) &&
+ new_commit=$(git rev-parse --short HEAD) &&
+
+ cat >expect <<-EOF &&
+ From $(test-tool path-utils real_path .)/.
+ $old_commit..$new_commit no-porcelain -> origin/no-porcelain
+ EOF
+
+ git -C no-porcelain fetch --porcelain --no-porcelain >stdout 2>stderr &&
+ test_cmp expect stderr &&
+ test_must_be_empty stdout
+'
+
+test_expect_success 'fetch output with HEAD' '
+ test_when_finished "rm -rf head" &&
+ git clone . head &&
+
+ git -C head fetch --dry-run origin HEAD >actual.out 2>actual.err &&
+ cat >expect <<-EOF &&
+ From $(test-tool path-utils real_path .)/.
+ * branch HEAD -> FETCH_HEAD
+ EOF
+ test_must_be_empty actual.out &&
+ test_cmp expect actual.err &&
+
+ git -C head fetch origin HEAD >actual.out 2>actual.err &&
+ test_must_be_empty actual.out &&
+ test_cmp expect actual.err &&
+
+ git -C head fetch --dry-run origin HEAD:foo >actual.out 2>actual.err &&
+ cat >expect <<-EOF &&
+ From $(test-tool path-utils real_path .)/.
+ * [new ref] HEAD -> foo
+ EOF
+ test_must_be_empty actual.out &&
+ test_cmp expect actual.err &&
+
+ git -C head fetch origin HEAD:foo >actual.out 2>actual.err &&
+ test_must_be_empty actual.out &&
+ test_cmp expect actual.err
+'
+
+test_expect_success 'fetch porcelain output with HEAD' '
+ test_when_finished "rm -rf head" &&
+ git clone . head &&
+ COMMIT_ID=$(git rev-parse HEAD) &&
+
+ git -C head fetch --porcelain --dry-run origin HEAD >actual &&
+ cat >expect <<-EOF &&
+ * $ZERO_OID $COMMIT_ID FETCH_HEAD
+ EOF
+ test_cmp expect actual &&
+
+ git -C head fetch --porcelain origin HEAD >actual &&
+ test_cmp expect actual &&
+
+ git -C head fetch --porcelain --dry-run origin HEAD:foo >actual &&
+ cat >expect <<-EOF &&
+ * $ZERO_OID $COMMIT_ID refs/heads/foo
+ EOF
+ test_cmp expect actual &&
+
+ git -C head fetch --porcelain origin HEAD:foo >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'fetch output with object ID' '
+ test_when_finished "rm -rf object-id" &&
+ git clone . object-id &&
+ commit=$(git rev-parse HEAD) &&
+
+ git -C object-id fetch --dry-run origin $commit:object-id >actual.out 2>actual.err &&
+ cat >expect <<-EOF &&
+ From $(test-tool path-utils real_path .)/.
+ * [new ref] $commit -> object-id
+ EOF
+ test_must_be_empty actual.out &&
+ test_cmp expect actual.err &&
+
+ git -C object-id fetch origin $commit:object-id >actual.out 2>actual.err &&
+ test_must_be_empty actual.out &&
+ test_cmp expect actual.err
+'
+
+test_expect_success '--no-show-forced-updates' '
+ mkdir forced-updates &&
+ (
+ cd forced-updates &&
+ git init &&
+ test_commit 1 &&
+ test_commit 2
+ ) &&
+ git clone forced-updates forced-update-clone &&
+ git clone forced-updates no-forced-update-clone &&
+ git -C forced-updates reset --hard HEAD~1 &&
+ (
+ cd forced-update-clone &&
+ git fetch --show-forced-updates origin 2>output &&
+ test_grep "(forced update)" output
+ ) &&
+ (
+ cd no-forced-update-clone &&
+ git fetch --no-show-forced-updates origin 2>output &&
+ test_grep ! "(forced update)" output
+ )
+'
+
+test_done
diff --git a/t/t5580-unc-paths.sh b/t/t5580-unc-paths.sh
index cd7604f..d7537a1 100755
--- a/t/t5580-unc-paths.sh
+++ b/t/t5580-unc-paths.sh
@@ -75,7 +75,7 @@ test_expect_success push '
test_expect_success MINGW 'remote nick cannot contain backslashes' '
BACKSLASHED="$(winpwd | tr / \\\\)" &&
git ls-remote "$BACKSLASHED" 2>err &&
- test_i18ngrep ! "unable to access" err
+ test_grep ! "unable to access" err
'
test_expect_success 'unc alternates' '
diff --git a/t/t5583-push-branches.sh b/t/t5583-push-branches.sh
new file mode 100755
index 0000000..320f49c
--- /dev/null
+++ b/t/t5583-push-branches.sh
@@ -0,0 +1,116 @@
+#!/bin/sh
+
+test_description='check the consisitency of behavior of --all and --branches'
+
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+delete_refs() {
+ dir=$1
+ shift
+ rm -rf deletes
+ for arg in $*
+ do
+ echo "delete ${arg}" >>deletes
+ done
+ git -C $dir update-ref --stdin < deletes
+}
+
+test_expect_success 'setup bare remote' '
+ git init --bare remote-1 &&
+ git -C remote-1 config gc.auto 0 &&
+ test_commit one &&
+ git push remote-1 HEAD
+'
+
+test_expect_success 'setup different types of references' '
+ cat >refs <<-EOF &&
+ update refs/heads/branch-1 HEAD
+ update refs/heads/branch-2 HEAD
+ EOF
+
+ git tag -a -m "annotated" annotated-1 HEAD &&
+ git tag -a -m "annotated" annotated-2 HEAD &&
+ git update-ref --stdin < refs
+'
+
+test_expect_success '--all and --branches have the same behavior' '
+ test_when_finished "delete_refs remote-1 \
+ refs/heads/branch-1 \
+ refs/heads/branch-2" &&
+ git push remote-1 --all &&
+ commit=$(git rev-parse HEAD) &&
+ cat >expect <<-EOF &&
+ $commit refs/heads/branch-1
+ $commit refs/heads/branch-2
+ $commit refs/heads/main
+ EOF
+
+ git -C remote-1 show-ref --heads >actual.all &&
+ delete_refs remote-1 refs/heads/branch-1 refs/heads/branch-2 &&
+ git push remote-1 --branches &&
+ git -C remote-1 show-ref --heads >actual.branches &&
+ test_cmp actual.all actual.branches &&
+ test_cmp expect actual.all
+'
+
+test_expect_success '--all or --branches can not be combined with refspecs' '
+ test_must_fail git push remote-1 --all main >actual.all 2>&1 &&
+ test_must_fail git push remote-1 --branches main >actual.branches 2>&1 &&
+ test_cmp actual.all actual.branches &&
+ grep "be combined with refspecs" actual.all
+'
+
+test_expect_success '--all or --branches can not be combined with --mirror' '
+ test_must_fail git push remote-1 --all --mirror >actual.all 2>&1 &&
+ test_must_fail git push remote-1 --branches --mirror >actual.branches 2>&1 &&
+ test_cmp actual.all actual.branches &&
+ grep "cannot be used together" actual.all
+'
+
+test_expect_success '--all or --branches can not be combined with --tags' '
+ test_must_fail git push remote-1 --all --tags >actual.all 2>&1 &&
+ test_must_fail git push remote-1 --branches --tags >actual.branches 2>&1 &&
+ test_cmp actual.all actual.branches &&
+ grep "cannot be used together" actual.all
+'
+
+
+test_expect_success '--all or --branches can not be combined with --delete' '
+ test_must_fail git push remote-1 --all --delete >actual.all 2>&1 &&
+ test_must_fail git push remote-1 --branches --delete >actual.branches 2>&1 &&
+ test_cmp actual.all actual.branches &&
+ grep "cannot be used together" actual.all
+'
+
+test_expect_success '--all or --branches combines with --follow-tags have same behavior' '
+ test_when_finished "delete_refs remote-1 \
+ refs/heads/branch-1 \
+ refs/heads/branch-2 \
+ refs/tags/annotated-1 \
+ refs/tags/annotated-2" &&
+ git push remote-1 --all --follow-tags &&
+ git -C remote-1 show-ref > actual.all &&
+ cat >expect <<-EOF &&
+ $commit refs/heads/branch-1
+ $commit refs/heads/branch-2
+ $commit refs/heads/main
+ $(git rev-parse annotated-1) refs/tags/annotated-1
+ $(git rev-parse annotated-2) refs/tags/annotated-2
+ EOF
+
+ delete_refs remote-1 \
+ refs/heads/branch-1 \
+ refs/heads/branch-2 \
+ refs/tags/annotated-1 \
+ refs/tags/annotated-2 &&
+ git push remote-1 --branches --follow-tags &&
+ git -C remote-1 show-ref >actual.branches &&
+ test_cmp actual.all actual.branches &&
+ test_cmp expect actual.all
+'
+
+test_done
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index cf3be05..ca43185 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -71,29 +71,6 @@ test_expect_success 'clone respects GIT_WORK_TREE' '
'
-test_expect_success LIBCURL 'clone warns or fails when using username:password' '
- message="URL '\''https://username:<redacted>@localhost/'\'' uses plaintext credentials" &&
- test_must_fail git -c transfer.credentialsInUrl=allow clone https://username:password@localhost attempt1 2>err &&
- ! grep "$message" err &&
-
- test_must_fail git -c transfer.credentialsInUrl=warn clone https://username:password@localhost attempt2 2>err &&
- grep "warning: $message" err >warnings &&
- test_line_count = 2 warnings &&
-
- test_must_fail git -c transfer.credentialsInUrl=die clone https://username:password@localhost attempt3 2>err &&
- grep "fatal: $message" err >warnings &&
- test_line_count = 1 warnings &&
-
- test_must_fail git -c transfer.credentialsInUrl=die clone https://username:@localhost attempt3 2>err &&
- grep "fatal: $message" err >warnings &&
- test_line_count = 1 warnings
-'
-
-test_expect_success LIBCURL 'clone does not detect username:password when it is https://username@domain:port/' '
- test_must_fail git -c transfer.credentialsInUrl=warn clone https://username@localhost:8080 attempt3 2>err &&
- ! grep "uses plaintext credentials" err
-'
-
test_expect_success 'clone from hooks' '
test_create_repo r0 &&
@@ -180,6 +157,23 @@ test_expect_success 'clone --mirror does not repeat tags' '
'
+test_expect_success 'clone with files ref format' '
+ test_when_finished "rm -rf ref-storage" &&
+ git clone --ref-format=files --mirror src ref-storage &&
+ echo files >expect &&
+ git -C ref-storage rev-parse --show-ref-format >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'clone with garbage ref format' '
+ cat >expect <<-EOF &&
+ fatal: unknown ref storage format ${SQ}garbage${SQ}
+ EOF
+ test_must_fail git clone --ref-format=garbage --mirror src ref-storage 2>err &&
+ test_cmp expect err &&
+ test_path_is_missing ref-storage
+'
+
test_expect_success 'clone to destination with trailing /' '
git clone src target-1/ &&
@@ -653,7 +647,7 @@ test_expect_success 'clone on case-insensitive fs' '
test_expect_success CASE_INSENSITIVE_FS 'colliding file detection' '
grep X icasefs/warning &&
grep x icasefs/warning &&
- test_i18ngrep "the following paths have collided" icasefs/warning
+ test_grep "the following paths have collided" icasefs/warning
'
test_expect_success 'clone with GIT_DEFAULT_HASH' '
@@ -719,7 +713,7 @@ test_expect_success 'partial clone: warn if server does not support object filte
git clone --filter=blob:limit=0 "file://$(pwd)/server" client 2> err &&
- test_i18ngrep "filtering not recognized by server" err
+ test_grep "filtering not recognized by server" err
'
test_expect_success 'batch missing blob request during checkout' '
@@ -743,7 +737,11 @@ test_expect_success 'batch missing blob request during checkout' '
# Ensure that there is only one negotiation by checking that there is
# only "done" line sent. ("done" marks the end of negotiation.)
- GIT_TRACE_PACKET="$(pwd)/trace" git -C client checkout HEAD^ &&
+ GIT_TRACE_PACKET="$(pwd)/trace" \
+ GIT_TRACE2_EVENT="$(pwd)/trace2_event" \
+ git -C client -c trace2.eventNesting=5 checkout HEAD^ &&
+ grep \"key\":\"total_rounds\",\"value\":\"1\" trace2_event >trace_lines &&
+ test_line_count = 1 trace_lines &&
grep "fetch> done" trace >done_lines &&
test_line_count = 1 done_lines
'
@@ -763,6 +761,7 @@ test_expect_success 'batch missing blob request does not inadvertently try to fe
echo aa >server/a &&
echo bb >server/b &&
# Also add a gitlink pointing to an arbitrary repository
+ test_config_global protocol.file.allow always &&
git -C server submodule add "$(pwd)/repo_for_submodule" c &&
git -C server add a b c &&
git -C server commit -m x &&
@@ -777,6 +776,18 @@ test_expect_success 'batch missing blob request does not inadvertently try to fe
. "$TEST_DIRECTORY"/lib-httpd.sh
start_httpd
+test_expect_success 'clone with includeIf' '
+ test_when_finished "rm -rf repo \"$HTTPD_DOCUMENT_ROOT_PATH/repo.git\"" &&
+ git clone --bare --no-local src "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
+
+ test_when_finished "rm \"$HOME\"/.gitconfig" &&
+ cat >"$HOME"/.gitconfig <<-EOF &&
+ [includeIf "onbranch:something"]
+ path = /does/not/exist.inc
+ EOF
+ git clone $HTTPD_URL/smart/repo.git repo
+'
+
test_expect_success 'partial clone using HTTP' '
partial_clone "$HTTPD_DOCUMENT_ROOT_PATH/server" "$HTTPD_URL/smart/server"
'
@@ -785,11 +796,116 @@ test_expect_success 'reject cloning shallow repository using HTTP' '
test_when_finished "rm -rf repo" &&
git clone --bare --no-local --depth=1 src "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
test_must_fail git -c protocol.version=2 clone --reject-shallow $HTTPD_URL/smart/repo.git repo 2>err &&
- test_i18ngrep -e "source repository is shallow, reject to clone." err &&
+ test_grep -e "source repository is shallow, reject to clone." err &&
git clone --no-reject-shallow $HTTPD_URL/smart/repo.git repo
'
+test_expect_success 'auto-discover bundle URI from HTTP clone' '
+ test_when_finished rm -rf trace.txt repo2 "$HTTPD_DOCUMENT_ROOT_PATH/repo2.git" &&
+ git -C src bundle create "$HTTPD_DOCUMENT_ROOT_PATH/everything.bundle" --all &&
+ git clone --bare --no-local src "$HTTPD_DOCUMENT_ROOT_PATH/repo2.git" &&
+
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH/repo2.git" config \
+ uploadpack.advertiseBundleURIs true &&
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH/repo2.git" config \
+ bundle.version 1 &&
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH/repo2.git" config \
+ bundle.mode all &&
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH/repo2.git" config \
+ bundle.everything.uri "$HTTPD_URL/everything.bundle" &&
+
+ GIT_TRACE2_EVENT="$(pwd)/trace.txt" \
+ git -c protocol.version=2 \
+ -c transfer.bundleURI=true clone \
+ $HTTPD_URL/smart/repo2.git repo2 &&
+ cat >pattern <<-EOF &&
+ "event":"child_start".*"argv":\["git-remote-https","$HTTPD_URL/everything.bundle"\]
+ EOF
+ grep -f pattern trace.txt
+'
+
+test_expect_success 'auto-discover multiple bundles from HTTP clone' '
+ test_when_finished rm -rf trace.txt repo3 "$HTTPD_DOCUMENT_ROOT_PATH/repo3.git" &&
+
+ test_commit -C src new &&
+ git -C src bundle create "$HTTPD_DOCUMENT_ROOT_PATH/new.bundle" HEAD~1..HEAD &&
+ git clone --bare --no-local src "$HTTPD_DOCUMENT_ROOT_PATH/repo3.git" &&
+
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH/repo3.git" config \
+ uploadpack.advertiseBundleURIs true &&
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH/repo3.git" config \
+ bundle.version 1 &&
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH/repo3.git" config \
+ bundle.mode all &&
+
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH/repo3.git" config \
+ bundle.everything.uri "$HTTPD_URL/everything.bundle" &&
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH/repo3.git" config \
+ bundle.new.uri "$HTTPD_URL/new.bundle" &&
+
+ GIT_TRACE2_EVENT="$(pwd)/trace.txt" \
+ git -c protocol.version=2 \
+ -c transfer.bundleURI=true clone \
+ $HTTPD_URL/smart/repo3.git repo3 &&
+
+ # We should fetch _both_ bundles
+ cat >pattern <<-EOF &&
+ "event":"child_start".*"argv":\["git-remote-https","$HTTPD_URL/everything.bundle"\]
+ EOF
+ grep -f pattern trace.txt &&
+ cat >pattern <<-EOF &&
+ "event":"child_start".*"argv":\["git-remote-https","$HTTPD_URL/new.bundle"\]
+ EOF
+ grep -f pattern trace.txt
+'
+
+test_expect_success 'auto-discover multiple bundles from HTTP clone: creationToken heuristic' '
+ test_when_finished rm -rf "$HTTPD_DOCUMENT_ROOT_PATH/repo4.git" &&
+ test_when_finished rm -rf clone-heuristic trace*.txt &&
+
+ test_commit -C src newest &&
+ git -C src bundle create "$HTTPD_DOCUMENT_ROOT_PATH/newest.bundle" HEAD~1..HEAD &&
+ git clone --bare --no-local src "$HTTPD_DOCUMENT_ROOT_PATH/repo4.git" &&
+
+ cat >>"$HTTPD_DOCUMENT_ROOT_PATH/repo4.git/config" <<-EOF &&
+ [uploadPack]
+ advertiseBundleURIs = true
+
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+
+ [bundle "everything"]
+ uri = $HTTPD_URL/everything.bundle
+ creationtoken = 1
+
+ [bundle "new"]
+ uri = $HTTPD_URL/new.bundle
+ creationtoken = 2
+
+ [bundle "newest"]
+ uri = $HTTPD_URL/newest.bundle
+ creationtoken = 3
+ EOF
+
+ GIT_TRACE2_EVENT="$(pwd)/trace-clone.txt" \
+ git -c protocol.version=2 \
+ -c transfer.bundleURI=true clone \
+ "$HTTPD_URL/smart/repo4.git" clone-heuristic &&
+
+ cat >expect <<-EOF &&
+ $HTTPD_URL/newest.bundle
+ $HTTPD_URL/new.bundle
+ $HTTPD_URL/everything.bundle
+ EOF
+
+ # We should fetch all bundles in the expected order.
+ test_remote_https_urls <trace-clone.txt >actual &&
+ test_cmp expect actual
+'
+
# DO NOT add non-httpd-specific tests here, because the last part of this
# test script is only executed when httpd is available and enabled.
diff --git a/t/t5604-clone-reference.sh b/t/t5604-clone-reference.sh
index 24340e6..9b32db8 100755
--- a/t/t5604-clone-reference.sh
+++ b/t/t5604-clone-reference.sh
@@ -7,6 +7,7 @@ test_description='test clone --reference'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
base_dir=$(pwd)
@@ -303,8 +304,6 @@ test_expect_success SYMLINKS 'setup repo with manually symlinked or unknown file
ln -s ../an-object $obj &&
cd ../ &&
- find . -type f | sort >../../../T.objects-files.raw &&
- find . -type l | sort >../../../T.objects-symlinks.raw &&
echo unknown_content >unknown_file
) &&
git -C T fsck &&
@@ -313,19 +312,27 @@ test_expect_success SYMLINKS 'setup repo with manually symlinked or unknown file
test_expect_success SYMLINKS 'clone repo with symlinked or unknown files at objects/' '
- for option in --local --no-hardlinks --shared --dissociate
+ # None of these options work when cloning locally, since T has
+ # symlinks in its `$GIT_DIR/objects` directory
+ for option in --local --no-hardlinks --dissociate
do
- git clone $option T T$option || return 1 &&
- git -C T$option fsck || return 1 &&
- git -C T$option rev-list --all --objects >T$option.objects &&
- test_cmp T.objects T$option.objects &&
- (
- cd T$option/.git/objects &&
- find . -type f | sort >../../../T$option.objects-files.raw &&
- find . -type l | sort >../../../T$option.objects-symlinks.raw
- )
+ test_must_fail git clone $option T T$option 2>err || return 1 &&
+ test_grep "symlink.*exists" err || return 1
done &&
+ # But `--shared` clones should still work, even when specifying
+ # a local path *and* that repository has symlinks present in its
+ # `$GIT_DIR/objects` directory.
+ git clone --shared T T--shared &&
+ git -C T--shared fsck &&
+ git -C T--shared rev-list --all --objects >T--shared.objects &&
+ test_cmp T.objects T--shared.objects &&
+ (
+ cd T--shared/.git/objects &&
+ find . -type f | sort >../../../T--shared.objects-files.raw &&
+ find . -type l | sort >../../../T--shared.objects-symlinks.raw
+ ) &&
+
for raw in $(ls T*.raw)
do
sed -e "s!/../!/Y/!; s![0-9a-f]\{38,\}!Z!" -e "/commit-graph/d" \
@@ -333,29 +340,25 @@ test_expect_success SYMLINKS 'clone repo with symlinked or unknown files at obje
sort $raw.de-sha-1 >$raw.de-sha || return 1
done &&
- cat >expected-files <<-EOF &&
- ./Y/Z
- ./Y/Z
- ./Y/Z
- ./a-loose-dir/Z
- ./an-object
- ./info/packs
- ./pack/pack-Z.idx
- ./pack/pack-Z.pack
- ./packs/pack-Z.idx
- ./packs/pack-Z.pack
- ./unknown_file
- EOF
-
- for option in --local --no-hardlinks --dissociate
- do
- test_cmp expected-files T$option.objects-files.raw.de-sha || return 1 &&
- test_must_be_empty T$option.objects-symlinks.raw.de-sha || return 1
- done &&
-
echo ./info/alternates >expected-files &&
test_cmp expected-files T--shared.objects-files.raw &&
test_must_be_empty T--shared.objects-symlinks.raw
'
+test_expect_success SYMLINKS 'clone repo with symlinked objects directory' '
+ test_when_finished "rm -fr sensitive malicious" &&
+
+ mkdir -p sensitive &&
+ echo "secret" >sensitive/file &&
+
+ git init malicious &&
+ rm -fr malicious/.git/objects &&
+ ln -s "$(pwd)/sensitive" ./malicious/.git/objects &&
+
+ test_must_fail git clone --local malicious clone 2>err &&
+
+ test_path_is_missing clone &&
+ grep "is a symlink, refusing to clone with --local" err
+'
+
test_done
diff --git a/t/t5605-clone-local.sh b/t/t5605-clone-local.sh
index 38b850c..a305586 100755
--- a/t/t5605-clone-local.sh
+++ b/t/t5605-clone-local.sh
@@ -15,8 +15,12 @@ test_expect_success 'preparing origin repository' '
: >file && git add . && git commit -m1 &&
git clone --bare . a.git &&
git clone --bare . x &&
- test "$(cd a.git && git config --bool core.bare)" = true &&
- test "$(cd x && git config --bool core.bare)" = true &&
+ echo true >expect &&
+ git -C a.git config --bool core.bare >actual &&
+ test_cmp expect actual &&
+ echo true >expect &&
+ git -C x config --bool core.bare >actual &&
+ test_cmp expect actual &&
git bundle create b1.bundle --all &&
git bundle create b2.bundle main &&
mkdir dir &&
@@ -29,7 +33,9 @@ test_expect_success 'preparing origin repository' '
test_expect_success 'local clone without .git suffix' '
git clone -l -s a b &&
(cd b &&
- test "$(git config --bool core.bare)" = false &&
+ echo false >expect &&
+ git config --bool core.bare >actual &&
+ test_cmp expect actual &&
git fetch)
'
@@ -59,11 +65,11 @@ test_expect_success 'Even without -l, local will make a hardlink' '
'
test_expect_success 'local clone of repo with nonexistent ref in HEAD' '
- echo "ref: refs/heads/nonexistent" > a.git/HEAD &&
+ git -C a.git symbolic-ref HEAD refs/heads/nonexistent &&
git clone a d &&
(cd d &&
git fetch &&
- test ! -e .git/refs/remotes/origin/HEAD)
+ test_ref_missing refs/remotes/origin/HEAD)
'
test_expect_success 'bundle clone without .bundle suffix' '
@@ -151,7 +157,7 @@ test_expect_success 'cloning locally respects "-u" for fetching refs' '
test_must_fail git clone --bare -u false a should_not_work.git
'
-test_expect_success 'local clone from repo with corrupt refs fails gracefully' '
+test_expect_success REFFILES 'local clone from repo with corrupt refs fails gracefully' '
git init corrupt &&
test_commit -C corrupt one &&
echo a >corrupt/.git/refs/heads/topic &&
diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh
index 8f676d6..e93e0d0 100755
--- a/t/t5606-clone-options.sh
+++ b/t/t5606-clone-options.sh
@@ -4,6 +4,7 @@ test_description='basic clone options'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -38,15 +39,16 @@ test_expect_success 'clone -o' '
test_expect_success 'rejects invalid -o/--origin' '
test_must_fail git clone -o "bad...name" parent clone-bad-name 2>err &&
- test_i18ngrep "'\''bad...name'\'' is not a valid remote name" err
+ test_grep "'\''bad...name'\'' is not a valid remote name" err
'
-test_expect_success 'disallows --bare with --origin' '
+test_expect_success 'clone --bare -o' '
- test_must_fail git clone -o foo --bare parent clone-bare-o 2>err &&
- test_debug "cat err" &&
- test_i18ngrep -e "options .--bare. and .--origin foo. cannot be used together" err
+ git clone -o foo --bare parent clone-bare-o &&
+ (cd parent && pwd) >expect &&
+ git -C clone-bare-o config remote.foo.url >actual &&
+ test_cmp expect actual
'
@@ -54,14 +56,22 @@ test_expect_success 'disallows --bare with --separate-git-dir' '
test_must_fail git clone --bare --separate-git-dir dot-git-destiation parent clone-bare-sgd 2>err &&
test_debug "cat err" &&
- test_i18ngrep -e "options .--bare. and .--separate-git-dir. cannot be used together" err
+ test_grep -e "options .--bare. and .--separate-git-dir. cannot be used together" err
+
+'
+test_expect_success 'disallows --bundle-uri with shallow options' '
+ for option in --depth=1 --shallow-since=01-01-2000 --shallow-exclude=HEAD
+ do
+ test_must_fail git clone --bundle-uri=bundle $option from to 2>err &&
+ grep "bundle-uri.* cannot be used together" err || return 1
+ done
'
test_expect_success 'reject cloning shallow repository' '
test_when_finished "rm -rf repo" &&
test_must_fail git clone --reject-shallow shallow-repo out 2>err &&
- test_i18ngrep -e "source repository is shallow, reject to clone." err &&
+ test_grep -e "source repository is shallow, reject to clone." err &&
git clone --no-reject-shallow shallow-repo repo
'
@@ -69,7 +79,7 @@ test_expect_success 'reject cloning shallow repository' '
test_expect_success 'reject cloning non-local shallow repository' '
test_when_finished "rm -rf repo" &&
test_must_fail git clone --reject-shallow --no-local shallow-repo out 2>err &&
- test_i18ngrep -e "source repository is shallow, reject to clone." err &&
+ test_grep -e "source repository is shallow, reject to clone." err &&
git clone --no-reject-shallow --no-local shallow-repo repo
'
@@ -110,6 +120,16 @@ test_expect_success 'prefers -c config over --template config' '
'
+test_expect_success 'ignore --template config for core.bare' '
+
+ template="$TRASH_DIRECTORY/template-with-bare-config" &&
+ mkdir "$template" &&
+ git config --file "$template/config" core.bare true &&
+ git clone "--template=$template" parent clone-bare-config &&
+ test "$(git -C clone-bare-config config --local core.bare)" = "false" &&
+ test_path_is_missing clone-bare-config/HEAD
+'
+
test_expect_success 'prefers config "clone.defaultRemoteName" over default' '
test_config_global clone.defaultRemoteName from_config &&
@@ -129,7 +149,7 @@ test_expect_success 'redirected clone does not show progress' '
git clone "file://$(pwd)/parent" clone-redirected >out 2>err &&
! grep % err &&
- test_i18ngrep ! "Checking connectivity" err
+ test_grep ! "Checking connectivity" err
'
diff --git a/t/t5607-clone-bundle.sh b/t/t5607-clone-bundle.sh
index 51705aa..0d1e92d 100755
--- a/t/t5607-clone-bundle.sh
+++ b/t/t5607-clone-bundle.sh
@@ -24,7 +24,7 @@ test_expect_success 'setup' '
test_expect_success '"verify" needs a worktree' '
git bundle create tip.bundle -1 main &&
nongit test_must_fail git bundle verify ../tip.bundle 2>err &&
- test_i18ngrep "need a repository" err
+ test_grep "need a repository" err
'
test_expect_success 'annotated tags can be excluded by rev-list options' '
@@ -166,7 +166,7 @@ test_expect_success 'git bundle v3 rejects unknown capabilities' '
@unknown=silly
EOF
test_must_fail git bundle verify new 2>output &&
- test_i18ngrep "unknown capability .unknown=silly." output
+ test_grep "unknown capability .unknown=silly." output
'
test_done
diff --git a/t/t5610-clone-detached.sh b/t/t5610-clone-detached.sh
index a7ec21e..022ed3d 100755
--- a/t/t5610-clone-detached.sh
+++ b/t/t5610-clone-detached.sh
@@ -4,6 +4,7 @@ test_description='test cloning a repository with detached HEAD'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
head_is_detached() {
diff --git a/t/t5611-clone-config.sh b/t/t5611-clone-config.sh
index 4b38772..298d4be 100755
--- a/t/t5611-clone-config.sh
+++ b/t/t5611-clone-config.sh
@@ -4,6 +4,7 @@ test_description='tests for git clone -c key=value'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'clone -c sets config in cloned repo' '
@@ -102,7 +103,7 @@ test_expect_success 'set up shallow repository' '
test_expect_success 'clone.rejectshallow=true should reject cloning shallow repo' '
test_when_finished "rm -rf out" &&
test_must_fail git -c clone.rejectshallow=true clone --no-local shallow-repo out 2>err &&
- test_i18ngrep -e "source repository is shallow, reject to clone." err &&
+ test_grep -e "source repository is shallow, reject to clone." err &&
git -c clone.rejectshallow=false clone --no-local shallow-repo out
'
@@ -110,7 +111,7 @@ test_expect_success 'clone.rejectshallow=true should reject cloning shallow repo
test_expect_success 'option --[no-]reject-shallow override clone.rejectshallow config' '
test_when_finished "rm -rf out" &&
test_must_fail git -c clone.rejectshallow=false clone --reject-shallow --no-local shallow-repo out 2>err &&
- test_i18ngrep -e "source repository is shallow, reject to clone." err &&
+ test_grep -e "source repository is shallow, reject to clone." err &&
git -c clone.rejectshallow=true clone --no-reject-shallow --no-local shallow-repo out
'
diff --git a/t/t5613-info-alternate.sh b/t/t5613-info-alternate.sh
index 895f46b..7708cba 100755
--- a/t/t5613-info-alternate.sh
+++ b/t/t5613-info-alternate.sh
@@ -4,6 +4,8 @@
#
test_description='test transitive info/alternate entries'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'preparing first repository' '
diff --git a/t/t5614-clone-submodules-shallow.sh b/t/t5614-clone-submodules-shallow.sh
index 5504b51..c2a2bb4 100755
--- a/t/t5614-clone-submodules-shallow.sh
+++ b/t/t5614-clone-submodules-shallow.sh
@@ -2,6 +2,7 @@
test_description='Test shallow cloning of repos with submodules'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
pwd=$(pwd)
@@ -24,6 +25,7 @@ test_expect_success 'setup' '
test_expect_success 'nonshallow clone implies nonshallow submodule' '
test_when_finished "rm -rf super_clone" &&
+ test_config_global protocol.file.allow always &&
git clone --recurse-submodules "file://$pwd/." super_clone &&
git -C super_clone log --oneline >lines &&
test_line_count = 3 lines &&
@@ -33,6 +35,7 @@ test_expect_success 'nonshallow clone implies nonshallow submodule' '
test_expect_success 'shallow clone with shallow submodule' '
test_when_finished "rm -rf super_clone" &&
+ test_config_global protocol.file.allow always &&
git clone --recurse-submodules --depth 2 --shallow-submodules "file://$pwd/." super_clone &&
git -C super_clone log --oneline >lines &&
test_line_count = 2 lines &&
@@ -42,6 +45,7 @@ test_expect_success 'shallow clone with shallow submodule' '
test_expect_success 'shallow clone does not imply shallow submodule' '
test_when_finished "rm -rf super_clone" &&
+ test_config_global protocol.file.allow always &&
git clone --recurse-submodules --depth 2 "file://$pwd/." super_clone &&
git -C super_clone log --oneline >lines &&
test_line_count = 2 lines &&
@@ -51,6 +55,7 @@ test_expect_success 'shallow clone does not imply shallow submodule' '
test_expect_success 'shallow clone with non shallow submodule' '
test_when_finished "rm -rf super_clone" &&
+ test_config_global protocol.file.allow always &&
git clone --recurse-submodules --depth 2 --no-shallow-submodules "file://$pwd/." super_clone &&
git -C super_clone log --oneline >lines &&
test_line_count = 2 lines &&
@@ -60,6 +65,7 @@ test_expect_success 'shallow clone with non shallow submodule' '
test_expect_success 'non shallow clone with shallow submodule' '
test_when_finished "rm -rf super_clone" &&
+ test_config_global protocol.file.allow always &&
git clone --recurse-submodules --no-local --shallow-submodules "file://$pwd/." super_clone &&
git -C super_clone log --oneline >lines &&
test_line_count = 3 lines &&
@@ -69,6 +75,7 @@ test_expect_success 'non shallow clone with shallow submodule' '
test_expect_success 'clone follows shallow recommendation' '
test_when_finished "rm -rf super_clone" &&
+ test_config_global protocol.file.allow always &&
git config -f .gitmodules submodule.sub.shallow true &&
git add .gitmodules &&
git commit -m "recommend shallow for sub" &&
@@ -87,6 +94,7 @@ test_expect_success 'clone follows shallow recommendation' '
test_expect_success 'get unshallow recommended shallow submodule' '
test_when_finished "rm -rf super_clone" &&
+ test_config_global protocol.file.allow always &&
git clone --no-local "file://$pwd/." super_clone &&
(
cd super_clone &&
@@ -103,6 +111,7 @@ test_expect_success 'get unshallow recommended shallow submodule' '
test_expect_success 'clone follows non shallow recommendation' '
test_when_finished "rm -rf super_clone" &&
+ test_config_global protocol.file.allow always &&
git config -f .gitmodules submodule.sub.shallow false &&
git add .gitmodules &&
git commit -m "recommend non shallow for sub" &&
diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh
index 4a3778d..2da7291 100755
--- a/t/t5616-partial-clone.sh
+++ b/t/t5616-partial-clone.sh
@@ -49,6 +49,13 @@ test_expect_success 'do partial clone 1' '
test "$(git -C pc1 config --local remote.origin.partialclonefilter)" = "blob:none"
'
+test_expect_success 'rev-list --missing=allow-promisor on partial clone' '
+ git -C pc1 rev-list --objects --missing=allow-promisor HEAD >actual &&
+ git -C pc1 rev-list --objects --missing=print HEAD >expect.raw &&
+ grep -v "^?" expect.raw >expect &&
+ test_cmp expect actual
+'
+
test_expect_success 'verify that .promisor file contains refs fetched' '
ls pc1/.git/objects/pack/pack-*.promisor >promisorlist &&
test_line_count = 1 promisorlist &&
@@ -250,8 +257,10 @@ test_expect_success 'partial clone with transfer.fsckobjects=1 works with submod
test_commit -C submodule mycommit &&
test_create_repo src_with_sub &&
- test_config -C src_with_sub uploadpack.allowfilter 1 &&
- test_config -C src_with_sub uploadpack.allowanysha1inwant 1 &&
+ git -C src_with_sub config uploadpack.allowfilter 1 &&
+ git -C src_with_sub config uploadpack.allowanysha1inwant 1 &&
+
+ test_config_global protocol.file.allow always &&
git -C src_with_sub submodule add "file://$(pwd)/submodule" mysub &&
git -C src_with_sub commit -m "commit with submodule" &&
@@ -261,6 +270,12 @@ test_expect_success 'partial clone with transfer.fsckobjects=1 works with submod
test_when_finished rm -rf dst
'
+test_expect_success 'lazily fetched .gitmodules works' '
+ git clone --filter="blob:none" --no-checkout "file://$(pwd)/src_with_sub" dst &&
+ git -C dst fetch &&
+ test_when_finished rm -rf dst
+'
+
test_expect_success 'partial clone with transfer.fsckobjects=1 uses index-pack --fsck-objects' '
git init src &&
test_commit -C src x &&
@@ -338,14 +353,14 @@ test_expect_success 'upload-pack complains of bogus filter config' '
test_must_fail git \
-c uploadpackfilter.tree.maxdepth \
upload-pack . >/dev/null 2>err &&
- test_i18ngrep "unable to parse.*tree.maxdepth" err
+ test_grep "unable to parse.*tree.maxdepth" err
'
test_expect_success 'upload-pack fails banned object filters' '
test_config -C srv.bare uploadpackfilter.blob:none.allow false &&
test_must_fail ok=sigpipe git clone --no-checkout --filter=blob:none \
"file://$(pwd)/srv.bare" pc3 2>err &&
- test_i18ngrep "filter '\''blob:none'\'' not supported" err
+ test_grep "filter '\''blob:none'\'' not supported" err
'
test_expect_success 'upload-pack fails banned combine object filters' '
@@ -355,14 +370,14 @@ test_expect_success 'upload-pack fails banned combine object filters' '
test_config -C srv.bare uploadpackfilter.blob:none.allow false &&
test_must_fail ok=sigpipe git clone --no-checkout --filter=tree:1 \
--filter=blob:none "file://$(pwd)/srv.bare" pc3 2>err &&
- test_i18ngrep "filter '\''blob:none'\'' not supported" err
+ test_grep "filter '\''blob:none'\'' not supported" err
'
test_expect_success 'upload-pack fails banned object filters with fallback' '
test_config -C srv.bare uploadpackfilter.allow false &&
test_must_fail ok=sigpipe git clone --no-checkout --filter=blob:none \
"file://$(pwd)/srv.bare" pc3 2>err &&
- test_i18ngrep "filter '\''blob:none'\'' not supported" err
+ test_grep "filter '\''blob:none'\'' not supported" err
'
test_expect_success 'upload-pack limits tree depth filters' '
@@ -371,7 +386,7 @@ test_expect_success 'upload-pack limits tree depth filters' '
test_config -C srv.bare uploadpackfilter.tree.maxDepth 0 &&
test_must_fail ok=sigpipe git clone --no-checkout --filter=tree:1 \
"file://$(pwd)/srv.bare" pc3 2>err &&
- test_i18ngrep "tree filter allows max depth 0, but got 1" err &&
+ test_grep "tree filter allows max depth 0, but got 1" err &&
git clone --no-checkout --filter=tree:0 "file://$(pwd)/srv.bare" pc4 &&
@@ -379,7 +394,7 @@ test_expect_success 'upload-pack limits tree depth filters' '
git clone --no-checkout --filter=tree:5 "file://$(pwd)/srv.bare" pc5 &&
test_must_fail ok=sigpipe git clone --no-checkout --filter=tree:6 \
"file://$(pwd)/srv.bare" pc6 2>err &&
- test_i18ngrep "tree filter allows max depth 5, but got 6" err
+ test_grep "tree filter allows max depth 5, but got 6" err
'
test_expect_success 'partial clone fetches blobs pointed to by refs even if normally filtered out' '
@@ -444,11 +459,11 @@ test_expect_success 'partial clone with unresolvable sparse filter fails cleanly
test_must_fail git clone --no-local --bare \
--filter=sparse:oid=main:no-such-name \
sparse-src dst.git 2>err &&
- test_i18ngrep "unable to access sparse blob in .main:no-such-name" err &&
+ test_grep "unable to access sparse blob in .main:no-such-name" err &&
test_must_fail git clone --no-local --bare \
--filter=sparse:oid=main \
sparse-src dst.git 2>err &&
- test_i18ngrep "unable to parse sparse filter data in" err
+ test_grep "unable to parse sparse filter data in" err
'
setup_triangle () {
@@ -478,8 +493,8 @@ setup_triangle () {
TREE_HASH=$(git -C server rev-parse HEAD~1^{tree}) &&
git -C promisor-remote fetch --keep "file://$(pwd)/server" "$TREE_HASH" &&
git -C promisor-remote count-objects -v >object-count &&
- test_i18ngrep "count: 0" object-count &&
- test_i18ngrep "in-pack: 2" object-count &&
+ test_grep "count: 0" object-count &&
+ test_grep "in-pack: 2" object-count &&
# Set it as the promisor remote of client. Thus, whenever
# the client lazy fetches, the lazy fetch will succeed only if it is
@@ -635,6 +650,49 @@ test_expect_success 'repack does not loosen promisor objects' '
grep "loosen_unused_packed_objects/loosened:0" trace
'
+test_expect_success 'lazy-fetch in submodule succeeds' '
+ # setup
+ test_config_global protocol.file.allow always &&
+
+ test_when_finished "rm -rf src-sub" &&
+ git init src-sub &&
+ git -C src-sub config uploadpack.allowfilter 1 &&
+ git -C src-sub config uploadpack.allowanysha1inwant 1 &&
+
+ # This blob must be missing in the subsequent commit.
+ echo foo >src-sub/file &&
+ git -C src-sub add file &&
+ git -C src-sub commit -m "submodule one" &&
+ SUB_ONE=$(git -C src-sub rev-parse HEAD) &&
+
+ echo bar >src-sub/file &&
+ git -C src-sub add file &&
+ git -C src-sub commit -m "submodule two" &&
+ SUB_TWO=$(git -C src-sub rev-parse HEAD) &&
+
+ test_when_finished "rm -rf src-super" &&
+ git init src-super &&
+ git -C src-super config uploadpack.allowfilter 1 &&
+ git -C src-super config uploadpack.allowanysha1inwant 1 &&
+ git -C src-super submodule add ../src-sub src-sub &&
+
+ git -C src-super/src-sub checkout $SUB_ONE &&
+ git -C src-super add src-sub &&
+ git -C src-super commit -m "superproject one" &&
+
+ git -C src-super/src-sub checkout $SUB_TWO &&
+ git -C src-super add src-sub &&
+ git -C src-super commit -m "superproject two" &&
+
+ # the fetch
+ test_when_finished "rm -rf client" &&
+ git clone --filter=blob:none --also-filter-submodules \
+ --recurse-submodules "file://$(pwd)/src-super" client &&
+
+ # Trigger lazy-fetch from the superproject
+ git -C client restore --recurse-submodules --source=HEAD^ :/
+'
+
. "$TEST_DIRECTORY"/lib-httpd.sh
start_httpd
@@ -690,7 +748,7 @@ test_expect_success 'upon cloning, check that all refs point to objects' '
test_must_fail git -c protocol.version=2 clone \
--filter=blob:none $HTTPD_URL/one_time_perl/server repo 2>err &&
- test_i18ngrep "did not send all necessary objects" err &&
+ test_grep "did not send all necessary objects" err &&
# Ensure that the one-time-perl script was used.
! test -e "$HTTPD_ROOT_PATH/one-time-perl"
diff --git a/t/t5617-clone-submodules-remote.sh b/t/t5617-clone-submodules-remote.sh
index ca8f800..5a4d793 100755
--- a/t/t5617-clone-submodules-remote.sh
+++ b/t/t5617-clone-submodules-remote.sh
@@ -5,11 +5,13 @@ test_description='Test cloning repos with submodules using remote-tracking branc
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
pwd=$(pwd)
test_expect_success 'setup' '
+ git config --global protocol.file.allow always &&
git checkout -b main &&
test_commit commit1 &&
mkdir sub &&
diff --git a/t/t5618-alternate-refs.sh b/t/t5618-alternate-refs.sh
index 3353216..f905db0 100755
--- a/t/t5618-alternate-refs.sh
+++ b/t/t5618-alternate-refs.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='test handling of --alternate-refs traversal'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# Avoid test_commit because we want a specific and known set of refs:
diff --git a/t/t5619-clone-local-ambiguous-transport.sh b/t/t5619-clone-local-ambiguous-transport.sh
new file mode 100755
index 0000000..cce62bf
--- /dev/null
+++ b/t/t5619-clone-local-ambiguous-transport.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+test_description='test local clone with ambiguous transport'
+
+. ./test-lib.sh
+. "$TEST_DIRECTORY/lib-httpd.sh"
+
+if ! test_have_prereq SYMLINKS
+then
+ skip_all='skipping test, symlink support unavailable'
+ test_done
+fi
+
+start_httpd
+
+REPO="$HTTPD_DOCUMENT_ROOT_PATH/sub.git"
+URI="$HTTPD_URL/dumb/sub.git"
+
+test_expect_success 'setup' '
+ mkdir -p sensitive &&
+ echo "secret" >sensitive/secret &&
+
+ git init --bare "$REPO" &&
+ test_commit_bulk -C "$REPO" --ref=main 1 &&
+
+ git -C "$REPO" update-ref HEAD main &&
+ git -C "$REPO" update-server-info &&
+
+ git init malicious &&
+ (
+ cd malicious &&
+
+ git submodule add "$URI" &&
+
+ mkdir -p repo/refs &&
+ touch repo/refs/.gitkeep &&
+ printf "ref: refs/heads/a" >repo/HEAD &&
+ ln -s "$(cd .. && pwd)/sensitive" repo/objects &&
+
+ mkdir -p "$HTTPD_URL/dumb" &&
+ ln -s "../../../.git/modules/sub/../../../repo/" "$URI" &&
+
+ git add . &&
+ git commit -m "initial commit"
+ ) &&
+
+ # Delete all of the references in our malicious submodule to
+ # avoid the client attempting to checkout any objects (which
+ # will be missing, and thus will cause the clone to fail before
+ # we can trigger the exploit).
+ git -C "$REPO" for-each-ref --format="delete %(refname)" >in &&
+ git -C "$REPO" update-ref --stdin <in &&
+ git -C "$REPO" update-server-info
+'
+
+test_expect_success 'ambiguous transport does not lead to arbitrary file-inclusion' '
+ git clone malicious clone &&
+ test_must_fail git -C clone submodule update --init 2>err &&
+
+ test_path_is_missing clone/.git/modules/sub/objects/secret &&
+ # We would actually expect "transport .file. not allowed" here,
+ # but due to quirks of the URL detection in Git, we mis-parse
+ # the absolute path as a bogus URL and die before that step.
+ #
+ # This works for now, and if we ever fix the URL detection, it
+ # is OK to change this to detect the transport error.
+ grep "protocol .* is not supported" err
+'
+
+test_done
diff --git a/t/t5700-protocol-v1.sh b/t/t5700-protocol-v1.sh
index 6c8d4c6..a73b4d4 100755
--- a/t/t5700-protocol-v1.sh
+++ b/t/t5700-protocol-v1.sh
@@ -244,15 +244,28 @@ test_expect_success 'push with ssh:// using protocol v1' '
grep "push< version 1" log
'
+test_expect_success 'clone propagates object-format from empty repo' '
+ test_when_finished "rm -fr src256 dst256" &&
+
+ echo sha256 >expect &&
+ git init --object-format=sha256 src256 &&
+ git clone --no-local src256 dst256 &&
+ git -C dst256 rev-parse --show-object-format >actual &&
+
+ test_cmp expect actual
+'
+
# Test protocol v1 with 'http://' transport
#
. "$TEST_DIRECTORY"/lib-httpd.sh
start_httpd
-test_expect_success 'create repo to be served by http:// transport' '
+test_expect_success 'create repos to be served by http:// transport' '
git init "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" &&
git -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" config http.receivepack true &&
- test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" one
+ test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" one &&
+ git init --object-format=sha256 "$HTTPD_DOCUMENT_ROOT_PATH/sha256" &&
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH/sha256" config http.receivepack true
'
test_expect_success 'clone with http:// using protocol v1' '
@@ -269,6 +282,20 @@ test_expect_success 'clone with http:// using protocol v1' '
grep "git< version 1" log
'
+test_expect_success 'clone with http:// using protocol v1 with empty SHA-256 repo' '
+ GIT_TRACE_PACKET=1 GIT_TRACE_CURL=1 git -c protocol.version=1 \
+ clone "$HTTPD_URL/smart/sha256" sha256 2>log &&
+
+ echo sha256 >expect &&
+ git -C sha256 rev-parse --show-object-format >actual &&
+ test_cmp expect actual &&
+
+ # Client requested to use protocol v1
+ grep "Git-Protocol: version=1" log &&
+ # Server responded using protocol v1
+ grep "git< version 1" log
+'
+
test_expect_success 'fetch with http:// using protocol v1' '
test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" two &&
diff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh
index 1896f67..c48830d 100755
--- a/t/t5701-git-serve.sh
+++ b/t/t5701-git-serve.sh
@@ -13,16 +13,18 @@ test_expect_success 'test capability advertisement' '
wrong_algo sha1:sha256
wrong_algo sha256:sha1
EOF
- cat >expect <<-EOF &&
+ cat >expect.base <<-EOF &&
version 2
agent=git/$(git version | cut -d" " -f3)
ls-refs=unborn
fetch=shallow wait-for-done
server-option
object-format=$(test_oid algo)
- object-info
+ EOF
+ cat >expect.trailer <<-EOF &&
0000
EOF
+ cat expect.base expect.trailer >expect &&
GIT_TEST_SIDEBAND_ALL=0 test-tool serve-v2 \
--advertise-capabilities >out &&
@@ -49,7 +51,7 @@ test_expect_success 'request invalid capability' '
0000
EOF
test_must_fail test-tool serve-v2 --stateless-rpc 2>err <in &&
- test_i18ngrep "unknown capability" err
+ test_grep "unknown capability" err
'
test_expect_success 'request with no command' '
@@ -59,7 +61,7 @@ test_expect_success 'request with no command' '
0000
EOF
test_must_fail test-tool serve-v2 --stateless-rpc 2>err <in &&
- test_i18ngrep "no command requested" err
+ test_grep "no command requested" err
'
test_expect_success 'request invalid command' '
@@ -70,7 +72,7 @@ test_expect_success 'request invalid command' '
0000
EOF
test_must_fail test-tool serve-v2 --stateless-rpc 2>err <in &&
- test_i18ngrep "invalid command" err
+ test_grep "invalid command" err
'
test_expect_success 'request capability as command' '
@@ -112,7 +114,7 @@ test_expect_success 'wrong object-format' '
0000
EOF
test_must_fail test-tool serve-v2 --stateless-rpc 2>err <in &&
- test_i18ngrep "mismatched object format" err
+ test_grep "mismatched object format" err
'
# Test the basics of ls-refs
@@ -320,6 +322,8 @@ test_expect_success 'unexpected lines are not allowed in fetch request' '
# Test the basics of object-info
#
test_expect_success 'basics of object-info' '
+ test_config transfer.advertiseObjectInfo true &&
+
test-tool pkt-line pack >in <<-EOF &&
command=object-info
object-format=$(test_oid algo)
@@ -342,4 +346,60 @@ test_expect_success 'basics of object-info' '
test_cmp expect actual
'
+test_expect_success 'test capability advertisement with uploadpack.advertiseBundleURIs' '
+ test_config uploadpack.advertiseBundleURIs true &&
+
+ cat >expect.extra <<-EOF &&
+ bundle-uri
+ EOF
+ cat expect.base \
+ expect.extra \
+ expect.trailer >expect &&
+
+ GIT_TEST_SIDEBAND_ALL=0 test-tool serve-v2 \
+ --advertise-capabilities >out &&
+ test-tool pkt-line unpack <out >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'basics of bundle-uri: dies if not enabled' '
+ test-tool pkt-line pack >in <<-EOF &&
+ command=bundle-uri
+ 0000
+ EOF
+
+ cat >err.expect <<-\EOF &&
+ fatal: invalid command '"'"'bundle-uri'"'"'
+ EOF
+
+ cat >expect <<-\EOF &&
+ ERR serve: invalid command '"'"'bundle-uri'"'"'
+ EOF
+
+ test_must_fail test-tool serve-v2 --stateless-rpc <in >out 2>err.actual &&
+ test_cmp err.expect err.actual &&
+ test_must_be_empty out
+'
+
+test_expect_success 'object-info missing from capabilities when disabled' '
+ test_config transfer.advertiseObjectInfo false &&
+
+ GIT_TEST_SIDEBAND_ALL=0 test-tool serve-v2 \
+ --advertise-capabilities >out &&
+ test-tool pkt-line unpack <out >actual &&
+
+ ! grep object.info actual
+'
+
+test_expect_success 'object-info commands rejected when disabled' '
+ test_config transfer.advertiseObjectInfo false &&
+
+ test-tool pkt-line pack >in <<-EOF &&
+ command=object-info
+ EOF
+
+ test_must_fail test-tool serve-v2 --stateless-rpc <in 2>err &&
+ grep invalid.command err
+'
+
test_done
diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh
index 5d42a35..1ef540f 100755
--- a/t/t5702-protocol-v2.sh
+++ b/t/t5702-protocol-v2.sh
@@ -189,8 +189,8 @@ test_expect_success 'warn if using server-option with ls-remote with legacy prot
test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -c protocol.version=0 \
ls-remote -o hello -o world "file://$(pwd)/file_parent" main 2>err &&
- test_i18ngrep "see protocol.version in" err &&
- test_i18ngrep "server options require protocol version 2 or later" err
+ test_grep "see protocol.version in" err &&
+ test_grep "server options require protocol version 2 or later" err
'
test_expect_success 'clone with file:// using protocol v2' '
@@ -221,7 +221,9 @@ test_expect_success 'clone of empty repo propagates name of default branch' '
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
git -c init.defaultBranch=main -c protocol.version=2 \
clone "file://$(pwd)/file_empty_parent" file_empty_child &&
- grep "refs/heads/mydefaultbranch" file_empty_child/.git/HEAD
+ echo refs/heads/mydefaultbranch >expect &&
+ git -C file_empty_child symbolic-ref HEAD >actual &&
+ test_cmp expect actual
'
test_expect_success '...but not if explicitly forbidden by config' '
@@ -234,7 +236,9 @@ test_expect_success '...but not if explicitly forbidden by config' '
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
git -c init.defaultBranch=main -c protocol.version=2 \
clone "file://$(pwd)/file_empty_parent" file_empty_child &&
- ! grep "refs/heads/mydefaultbranch" file_empty_child/.git/HEAD
+ echo refs/heads/main >expect &&
+ git -C file_empty_child symbolic-ref HEAD >actual &&
+ test_cmp expect actual
'
test_expect_success 'bare clone propagates empty default branch' '
@@ -247,7 +251,9 @@ test_expect_success 'bare clone propagates empty default branch' '
git -c init.defaultBranch=main -c protocol.version=2 \
clone --bare \
"file://$(pwd)/file_empty_parent" file_empty_child.git &&
- grep "refs/heads/mydefaultbranch" file_empty_child.git/HEAD
+ echo "refs/heads/mydefaultbranch" >expect &&
+ git -C file_empty_child.git symbolic-ref HEAD >actual &&
+ test_cmp expect actual
'
test_expect_success 'clone propagates unborn HEAD from non-empty repo' '
@@ -265,10 +271,23 @@ test_expect_success 'clone propagates unborn HEAD from non-empty repo' '
git -c init.defaultBranch=main -c protocol.version=2 \
clone "file://$(pwd)/file_unborn_parent" \
file_unborn_child 2>stderr &&
- grep "refs/heads/mydefaultbranch" file_unborn_child/.git/HEAD &&
+ echo "refs/heads/mydefaultbranch" >expect &&
+ git -C file_unborn_child symbolic-ref HEAD >actual &&
+ test_cmp expect actual &&
grep "warning: remote HEAD refers to nonexistent ref" stderr
'
+test_expect_success 'clone propagates object-format from empty repo' '
+ test_when_finished "rm -fr src256 dst256" &&
+
+ echo sha256 >expect &&
+ git init --object-format=sha256 src256 &&
+ git clone src256 dst256 &&
+ git -C dst256 rev-parse --show-object-format >actual &&
+
+ test_cmp expect actual
+'
+
test_expect_success 'bare clone propagates unborn HEAD from non-empty repo' '
test_when_finished "rm -rf file_unborn_parent file_unborn_child.git" &&
@@ -284,7 +303,9 @@ test_expect_success 'bare clone propagates unborn HEAD from non-empty repo' '
git -c init.defaultBranch=main -c protocol.version=2 \
clone --bare "file://$(pwd)/file_unborn_parent" \
file_unborn_child.git 2>stderr &&
- grep "refs/heads/mydefaultbranch" file_unborn_child.git/HEAD &&
+ echo "refs/heads/mydefaultbranch" >expect &&
+ git -C file_unborn_child.git symbolic-ref HEAD >actual &&
+ test_cmp expect actual &&
! grep "warning:" stderr
'
@@ -304,7 +325,9 @@ test_expect_success 'defaulted HEAD uses remote branch if available' '
git -c init.defaultBranch=branchwithstuff -c protocol.version=2 \
clone "file://$(pwd)/file_unborn_parent" \
file_unborn_child 2>stderr &&
- grep "refs/heads/branchwithstuff" file_unborn_child/.git/HEAD &&
+ echo "refs/heads/branchwithstuff" >expect &&
+ git -C file_unborn_child symbolic-ref HEAD >actual &&
+ test_cmp expect actual &&
test_path_is_file file_unborn_child/stuff.t &&
! grep "warning:" stderr
'
@@ -366,8 +389,8 @@ test_expect_success 'warn if using server-option with fetch with legacy protocol
test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -C temp_child -c protocol.version=0 \
fetch -o hello -o world "file://$(pwd)/file_parent" main 2>err &&
- test_i18ngrep "see protocol.version in" err &&
- test_i18ngrep "server options require protocol version 2 or later" err
+ test_grep "see protocol.version in" err &&
+ test_grep "server options require protocol version 2 or later" err
'
test_expect_success 'server-options are sent when cloning' '
@@ -388,8 +411,8 @@ test_expect_success 'warn if using server-option with clone with legacy protocol
clone --server-option=hello --server-option=world \
"file://$(pwd)/file_parent" myclone 2>err &&
- test_i18ngrep "see protocol.version in" err &&
- test_i18ngrep "server options require protocol version 2 or later" err
+ test_grep "see protocol.version in" err &&
+ test_grep "server options require protocol version 2 or later" err
'
test_expect_success 'upload-pack respects config using protocol v2' '
@@ -484,7 +507,7 @@ test_expect_success 'partial clone warns if filter is not advertised' '
git -C server config uploadpack.allowfilter 0 &&
git -c protocol.version=2 \
clone --filter=blob:none "file://$(pwd)/server" client 2>err &&
- test_i18ngrep "filtering not recognized by server, ignoring" err
+ test_grep "filtering not recognized by server, ignoring" err
'
test_expect_success 'even with handcrafted request, filter does not work if not advertised' '
@@ -725,7 +748,53 @@ test_expect_success 'file:// --negotiate-only with protocol v0' '
--negotiate-only \
--negotiation-tip=$(git -C client rev-parse HEAD) \
origin 2>err &&
- test_i18ngrep "negotiate-only requires protocol v2" err
+ test_grep "negotiate-only requires protocol v2" err
+'
+
+test_expect_success 'push with custom path does not request v2' '
+ rm -f env.trace &&
+ git -C client push \
+ --receive-pack="env >../env.trace; git-receive-pack" \
+ origin HEAD:refs/heads/custom-push-test &&
+ test_path_is_file env.trace &&
+ ! grep ^GIT_PROTOCOL env.trace
+'
+
+test_expect_success 'fetch with custom path does request v2' '
+ rm -f env.trace &&
+ git -C client fetch \
+ --upload-pack="env >../env.trace; git-upload-pack" \
+ origin HEAD &&
+ grep ^GIT_PROTOCOL=version=2 env.trace
+'
+
+test_expect_success 'archive with custom path does not request v2' '
+ rm -f env.trace &&
+ git -C client archive \
+ --exec="env >../env.trace; git-upload-archive" \
+ --remote=origin \
+ HEAD >/dev/null &&
+ test_path_is_file env.trace &&
+ ! grep ^GIT_PROTOCOL env.trace
+'
+
+test_expect_success 'reject client packfile-uris if not advertised' '
+ {
+ packetize command=fetch &&
+ packetize object-format=$(test_oid algo) &&
+ printf 0001 &&
+ packetize packfile-uris https &&
+ packetize done &&
+ printf 0000
+ } >input &&
+ test_must_fail env GIT_PROTOCOL=version=2 \
+ git upload-pack client <input &&
+ test_must_fail env GIT_PROTOCOL=version=2 \
+ git -c uploadpack.blobpackfileuri \
+ upload-pack client <input &&
+ GIT_PROTOCOL=version=2 \
+ git -c uploadpack.blobpackfileuri=anything \
+ upload-pack client <input
'
# Test protocol v2 with 'http://' transport
@@ -771,7 +840,7 @@ test_expect_success 'clone repository with http:// using protocol v2 with incomp
# Server responded using protocol v2
grep "git< version 2" log &&
# Client reported appropriate failure
- test_i18ngrep "bytes of length header were received" err
+ test_grep "bytes of length header were received" err
'
test_expect_success 'clone repository with http:// using protocol v2 with incomplete pktline body' '
@@ -788,7 +857,7 @@ test_expect_success 'clone repository with http:// using protocol v2 with incomp
# Server responded using protocol v2
grep "git< version 2" log &&
# Client reported appropriate failure
- test_i18ngrep "bytes of body are still expected" err
+ test_grep "bytes of body are still expected" err
'
test_expect_success 'clone with http:// using protocol v2 and invalid parameters' '
@@ -935,7 +1004,7 @@ test_expect_success 'when server sends "ready", expect DELIM' '
test_must_fail git -C http_child -c protocol.version=2 \
fetch "$HTTPD_URL/one_time_perl/http_parent" 2> err &&
- test_i18ngrep "expected packfile to be sent after .ready." err
+ test_grep "expected packfile to be sent after .ready." err
'
test_expect_success 'when server does not send "ready", expect FLUSH' '
@@ -963,7 +1032,7 @@ test_expect_success 'when server does not send "ready", expect FLUSH' '
fetch "$HTTPD_URL/one_time_perl/http_parent" 2> err &&
grep "fetch< .*acknowledgments" log &&
! grep "fetch< .*ready" log &&
- test_i18ngrep "expected no other sections to be sent after no .ready." err
+ test_grep "expected no other sections to be sent after no .ready." err
'
configure_exclusion () {
@@ -1001,7 +1070,7 @@ test_expect_success 'part of packfile response provided as URI' '
do
git verify-pack --object-format=$(test_oid algo) --verbose $idx >out &&
{
- grep "^[0-9a-f]\{16,\} " out || :
+ grep -E "^[0-9a-f]{16,} " out || :
} >out.objectlist &&
if test_line_count = 1 out.objectlist
then
@@ -1073,7 +1142,7 @@ test_expect_success 'fetching with valid packfile URI but invalid hash fails' '
git -c protocol.version=2 \
-c fetch.uriprotocols=http,https \
clone "$HTTPD_URL/smart/http_parent" http_child 2>err &&
- test_i18ngrep "pack downloaded from.*does not match expected hash" err
+ test_grep "pack downloaded from.*does not match expected hash" err
'
test_expect_success 'packfile-uri with transfer.fsckobjects' '
@@ -1114,7 +1183,7 @@ test_expect_success 'packfile-uri with transfer.fsckobjects fails on bad object'
This commit object intentionally broken
EOF
- BOGUS=$(git -C "$P" hash-object -t commit -w --stdin <bogus-commit) &&
+ BOGUS=$(git -C "$P" hash-object -t commit -w --stdin --literally <bogus-commit) &&
git -C "$P" branch bogus-branch "$BOGUS" &&
echo my-blob >"$P/my-blob" &&
@@ -1127,7 +1196,7 @@ test_expect_success 'packfile-uri with transfer.fsckobjects fails on bad object'
test_must_fail git -c protocol.version=2 -c transfer.fsckobjects=1 \
-c fetch.uriprotocols=http,https \
clone "$HTTPD_URL/smart/http_parent" http_child 2>error &&
- test_i18ngrep "invalid author/committer line - missing email" error
+ test_grep "invalid author/committer line - missing email" error
'
test_expect_success 'packfile-uri with transfer.fsckobjects succeeds when .gitmodules is separate from tree' '
@@ -1175,7 +1244,7 @@ test_expect_success 'packfile-uri with transfer.fsckobjects fails when .gitmodul
test_must_fail git -c protocol.version=2 -c transfer.fsckobjects=1 \
-c fetch.uriprotocols=http,https \
clone "$HTTPD_URL/smart/http_parent" http_child 2>err &&
- test_i18ngrep "disallowed submodule name" err
+ test_grep "disallowed submodule name" err
'
test_expect_success 'packfile-uri path redacted in trace' '
@@ -1258,7 +1327,7 @@ test_expect_success 'http:// --negotiate-only without wait-for-done support' '
--negotiate-only \
--negotiation-tip=$(git -C client rev-parse HEAD) \
origin 2>err &&
- test_i18ngrep "server does not support wait-for-done" err
+ test_grep "server does not support wait-for-done" err
'
test_expect_success 'http:// --negotiate-only with protocol v0' '
@@ -1272,7 +1341,7 @@ test_expect_success 'http:// --negotiate-only with protocol v0' '
--negotiate-only \
--negotiation-tip=$(git -C client rev-parse HEAD) \
origin 2>err &&
- test_i18ngrep "negotiate-only requires protocol v2" err
+ test_grep "negotiate-only requires protocol v2" err
'
# DO NOT add non-httpd-specific tests here, because the last part of this
diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
index 9d6cd7d..1910971 100755
--- a/t/t5703-upload-pack-ref-in-want.sh
+++ b/t/t5703-upload-pack-ref-in-want.sh
@@ -229,14 +229,16 @@ test_expect_success 'setup repos for fetching with ref-in-want tests' '
'
test_expect_success 'fetching with exact OID' '
- test_when_finished "rm -f log" &&
+ test_when_finished "rm -f log trace2" &&
rm -rf local &&
cp -r "$LOCAL_PRISTINE" local &&
oid=$(git -C "$REPO" rev-parse d) &&
- GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin \
+ GIT_TRACE_PACKET="$(pwd)/log" GIT_TRACE2_EVENT="$(pwd)/trace2" \
+ git -C local fetch origin \
"$oid":refs/heads/actual &&
+ grep \"key\":\"total_rounds\",\"value\":\"2\" trace2 &&
git -C "$REPO" rev-parse "d" >expected &&
git -C local rev-parse refs/heads/actual >actual &&
test_cmp expected actual &&
@@ -482,7 +484,7 @@ test_expect_success 'server is initially ahead - no ref in want' '
cp -r "$LOCAL_PRISTINE" local &&
inconsistency main $(test_oid numeric) &&
test_must_fail git -C local fetch 2>err &&
- test_i18ngrep "fatal: remote error: upload-pack: not our ref" err
+ test_grep "fatal: remote error: upload-pack: not our ref" err
'
test_expect_success 'server is initially ahead - ref in want' '
@@ -528,7 +530,7 @@ test_expect_success 'server loses a ref - ref in want' '
echo "s/main/rain/" >"$HTTPD_ROOT_PATH/one-time-perl" &&
test_must_fail git -C local fetch 2>err &&
- test_i18ngrep "fatal: remote error: unknown ref refs/heads/rain" err
+ test_grep "fatal: remote error: unknown ref refs/heads/rain" err
'
# DO NOT add non-httpd-specific tests here, because the last part of this
diff --git a/t/t5704-protocol-violations.sh b/t/t5704-protocol-violations.sh
index ae1a00a..11be64f 100755
--- a/t/t5704-protocol-violations.sh
+++ b/t/t5704-protocol-violations.sh
@@ -18,7 +18,7 @@ test_expect_success 'extra delim packet in v2 ls-refs args' '
} >input &&
test_must_fail env GIT_PROTOCOL=version=2 \
git upload-pack . <input 2>err &&
- test_i18ngrep "expected flush after ls-refs arguments" err
+ test_grep "expected flush after ls-refs arguments" err
'
test_expect_success 'extra delim packet in v2 fetch args' '
@@ -31,7 +31,7 @@ test_expect_success 'extra delim packet in v2 fetch args' '
} >input &&
test_must_fail env GIT_PROTOCOL=version=2 \
git upload-pack . <input 2>err &&
- test_i18ngrep "expected flush after fetch arguments" err
+ test_grep "expected flush after fetch arguments" err
'
test_expect_success 'bogus symref in v0 capabilities' '
diff --git a/t/t5705-session-id-in-capabilities.sh b/t/t5705-session-id-in-capabilities.sh
index ed38c76..b8a722e 100755
--- a/t/t5705-session-id-in-capabilities.sh
+++ b/t/t5705-session-id-in-capabilities.sh
@@ -2,6 +2,7 @@
test_description='session ID in capabilities'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
REPO="$(pwd)/repo"
diff --git a/t/t5730-protocol-v2-bundle-uri-file.sh b/t/t5730-protocol-v2-bundle-uri-file.sh
new file mode 100755
index 0000000..37bdb72
--- /dev/null
+++ b/t/t5730-protocol-v2-bundle-uri-file.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+test_description="Test bundle-uri with protocol v2 and 'file://' transport"
+
+TEST_NO_CREATE_REPO=1
+
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+. ./test-lib.sh
+
+# Test protocol v2 with 'file://' transport
+#
+BUNDLE_URI_PROTOCOL=file
+. "$TEST_DIRECTORY"/lib-bundle-uri-protocol.sh
+
+test_done
diff --git a/t/t5731-protocol-v2-bundle-uri-git.sh b/t/t5731-protocol-v2-bundle-uri-git.sh
new file mode 100755
index 0000000..8add1b3
--- /dev/null
+++ b/t/t5731-protocol-v2-bundle-uri-git.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+test_description="Test bundle-uri with protocol v2 and 'git://' transport"
+
+TEST_NO_CREATE_REPO=1
+
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+. ./test-lib.sh
+
+# Test protocol v2 with 'git://' transport
+#
+BUNDLE_URI_PROTOCOL=git
+. "$TEST_DIRECTORY"/lib-bundle-uri-protocol.sh
+
+test_done
diff --git a/t/t5732-protocol-v2-bundle-uri-http.sh b/t/t5732-protocol-v2-bundle-uri-http.sh
new file mode 100755
index 0000000..129daa0
--- /dev/null
+++ b/t/t5732-protocol-v2-bundle-uri-http.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+test_description="Test bundle-uri with protocol v2 and 'http://' transport"
+
+TEST_NO_CREATE_REPO=1
+
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+. ./test-lib.sh
+
+# Test protocol v2 with 'http://' transport
+#
+BUNDLE_URI_PROTOCOL=http
+. "$TEST_DIRECTORY"/lib-bundle-uri-protocol.sh
+
+test_done
diff --git a/t/t5750-bundle-uri-parse.sh b/t/t5750-bundle-uri-parse.sh
new file mode 100755
index 0000000..81bdf58
--- /dev/null
+++ b/t/t5750-bundle-uri-parse.sh
@@ -0,0 +1,290 @@
+#!/bin/sh
+
+test_description="Test bundle-uri bundle_uri_parse_line()"
+
+TEST_NO_CREATE_REPO=1
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+test_expect_success 'bundle_uri_parse_line() just URIs' '
+ cat >in <<-\EOF &&
+ bundle.one.uri=http://example.com/bundle.bdl
+ bundle.two.uri=https://example.com/bundle.bdl
+ bundle.three.uri=file:///usr/share/git/bundle.bdl
+ EOF
+
+ cat >expect <<-\EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ [bundle "one"]
+ uri = http://example.com/bundle.bdl
+ [bundle "two"]
+ uri = https://example.com/bundle.bdl
+ [bundle "three"]
+ uri = file:///usr/share/git/bundle.bdl
+ EOF
+
+ test-tool bundle-uri parse-key-values in >actual 2>err &&
+ test_must_be_empty err &&
+ test_cmp_config_output expect actual
+'
+
+test_expect_success 'bundle_uri_parse_line(): relative URIs' '
+ cat >in <<-\EOF &&
+ bundle.one.uri=bundle.bdl
+ bundle.two.uri=../bundle.bdl
+ bundle.three.uri=sub/dir/bundle.bdl
+ EOF
+
+ cat >expect <<-\EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ [bundle "one"]
+ uri = <uri>/bundle.bdl
+ [bundle "two"]
+ uri = bundle.bdl
+ [bundle "three"]
+ uri = <uri>/sub/dir/bundle.bdl
+ EOF
+
+ test-tool bundle-uri parse-key-values in >actual 2>err &&
+ test_must_be_empty err &&
+ test_cmp_config_output expect actual
+'
+
+test_expect_success 'bundle_uri_parse_line(): relative URIs and parent paths' '
+ cat >in <<-\EOF &&
+ bundle.one.uri=bundle.bdl
+ bundle.two.uri=../bundle.bdl
+ bundle.three.uri=../../bundle.bdl
+ EOF
+
+ cat >expect <<-\EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ [bundle "one"]
+ uri = <uri>/bundle.bdl
+ [bundle "two"]
+ uri = bundle.bdl
+ [bundle "three"]
+ uri = <uri>/../bundle.bdl
+ EOF
+
+ # TODO: We would prefer if parsing a bundle list would not cause
+ # a die() and instead would give a warning and allow the rest of
+ # a Git command to continue. This test_must_fail is necessary for
+ # now until the interface for relative_url() allows for reporting
+ # an error instead of die()ing.
+ test_must_fail test-tool bundle-uri parse-key-values in >actual 2>err &&
+ grep "fatal: cannot strip one component off url" err
+'
+
+test_expect_success 'bundle_uri_parse_line() parsing edge cases: empty key or value' '
+ cat >in <<-\EOF &&
+ =bogus-value
+ bogus-key=
+ EOF
+
+ cat >err.expect <<-EOF &&
+ error: bundle-uri: line has empty key or value
+ error: bad line: '\''=bogus-value'\''
+ error: bundle-uri: line has empty key or value
+ error: bad line: '\''bogus-key='\''
+ EOF
+
+ cat >expect <<-\EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ EOF
+
+ test_must_fail test-tool bundle-uri parse-key-values in >actual 2>err &&
+ test_cmp err.expect err &&
+ test_cmp_config_output expect actual
+'
+
+test_expect_success 'bundle_uri_parse_line() parsing edge cases: empty lines' '
+ cat >in <<-\EOF &&
+ bundle.one.uri=http://example.com/bundle.bdl
+
+ bundle.two.uri=https://example.com/bundle.bdl
+
+ bundle.three.uri=file:///usr/share/git/bundle.bdl
+ EOF
+
+ cat >err.expect <<-\EOF &&
+ error: bundle-uri: got an empty line
+ error: bad line: '\'''\''
+ error: bundle-uri: got an empty line
+ error: bad line: '\'''\''
+ EOF
+
+ # We fail, but try to continue parsing regardless
+ cat >expect <<-\EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ [bundle "one"]
+ uri = http://example.com/bundle.bdl
+ [bundle "two"]
+ uri = https://example.com/bundle.bdl
+ [bundle "three"]
+ uri = file:///usr/share/git/bundle.bdl
+ EOF
+
+ test_must_fail test-tool bundle-uri parse-key-values in >actual 2>err &&
+ test_cmp err.expect err &&
+ test_cmp_config_output expect actual
+'
+
+test_expect_success 'bundle_uri_parse_line() parsing edge cases: duplicate lines' '
+ cat >in <<-\EOF &&
+ bundle.one.uri=http://example.com/bundle.bdl
+ bundle.two.uri=https://example.com/bundle.bdl
+ bundle.one.uri=https://example.com/bundle-2.bdl
+ bundle.three.uri=file:///usr/share/git/bundle.bdl
+ EOF
+
+ cat >err.expect <<-\EOF &&
+ error: bad line: '\''bundle.one.uri=https://example.com/bundle-2.bdl'\''
+ EOF
+
+ # We fail, but try to continue parsing regardless
+ cat >expect <<-\EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ [bundle "one"]
+ uri = http://example.com/bundle.bdl
+ [bundle "two"]
+ uri = https://example.com/bundle.bdl
+ [bundle "three"]
+ uri = file:///usr/share/git/bundle.bdl
+ EOF
+
+ test_must_fail test-tool bundle-uri parse-key-values in >actual 2>err &&
+ test_cmp err.expect err &&
+ test_cmp_config_output expect actual
+'
+
+test_expect_success 'parse config format: just URIs' '
+ cat >expect <<-\EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ [bundle "one"]
+ uri = http://example.com/bundle.bdl
+ [bundle "two"]
+ uri = https://example.com/bundle.bdl
+ [bundle "three"]
+ uri = file:///usr/share/git/bundle.bdl
+ EOF
+
+ test-tool bundle-uri parse-config expect >actual 2>err &&
+ test_must_be_empty err &&
+ test_cmp_config_output expect actual
+'
+
+test_expect_success 'parse config format: relative URIs' '
+ cat >in <<-\EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ [bundle "one"]
+ uri = bundle.bdl
+ [bundle "two"]
+ uri = ../bundle.bdl
+ [bundle "three"]
+ uri = sub/dir/bundle.bdl
+ EOF
+
+ cat >expect <<-\EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ [bundle "one"]
+ uri = <uri>/bundle.bdl
+ [bundle "two"]
+ uri = bundle.bdl
+ [bundle "three"]
+ uri = <uri>/sub/dir/bundle.bdl
+ EOF
+
+ test-tool bundle-uri parse-config in >actual 2>err &&
+ test_must_be_empty err &&
+ test_cmp_config_output expect actual
+'
+
+test_expect_success 'parse config format edge cases: empty key or value' '
+ cat >in1 <<-\EOF &&
+ = bogus-value
+ EOF
+
+ cat >err1 <<-EOF &&
+ error: bad config line 1 in file in1
+ EOF
+
+ cat >expect <<-\EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ EOF
+
+ test_must_fail test-tool bundle-uri parse-config in1 >actual 2>err &&
+ test_cmp err1 err &&
+ test_cmp_config_output expect actual &&
+
+ cat >in2 <<-\EOF &&
+ bogus-key =
+ EOF
+
+ cat >err2 <<-EOF &&
+ error: bad config line 1 in file in2
+ EOF
+
+ test_must_fail test-tool bundle-uri parse-config in2 >actual 2>err &&
+ test_cmp err2 err &&
+ test_cmp_config_output expect actual
+'
+
+test_expect_success 'parse config format: creationToken heuristic' '
+ cat >expect <<-\EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+ [bundle "one"]
+ uri = http://example.com/bundle.bdl
+ creationToken = 123456
+ [bundle "two"]
+ uri = https://example.com/bundle.bdl
+ creationToken = 12345678901234567890
+ [bundle "three"]
+ uri = file:///usr/share/git/bundle.bdl
+ creationToken = 1
+ EOF
+
+ test-tool bundle-uri parse-config expect >actual 2>err &&
+ test_must_be_empty err &&
+ test_cmp_config_output expect actual
+'
+
+test_expect_success 'parse config format edge cases: creationToken heuristic' '
+ cat >expect <<-\EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+ [bundle "one"]
+ uri = http://example.com/bundle.bdl
+ creationToken = bogus
+ EOF
+
+ test-tool bundle-uri parse-config expect >actual 2>err &&
+ grep "could not parse bundle list key creationToken with value '\''bogus'\''" err
+'
+
+test_done
diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh
index d386076..4e0a77f 100755
--- a/t/t5801-remote-helpers.sh
+++ b/t/t5801-remote-helpers.sh
@@ -137,7 +137,7 @@ test_expect_success 'forced push' '
test_expect_success 'cloning without refspec' '
GIT_REMOTE_TESTGIT_NOREFSPEC=1 \
git clone "testgit::${PWD}/server" local2 2>error &&
- test_i18ngrep "this remote helper should implement refspec capability" error &&
+ test_grep "this remote helper should implement refspec capability" error &&
compare_refs local2 HEAD server HEAD
'
@@ -145,7 +145,7 @@ test_expect_success 'pulling without refspecs' '
(cd local2 &&
git reset --hard &&
GIT_REMOTE_TESTGIT_NOREFSPEC=1 git pull 2>../error) &&
- test_i18ngrep "this remote helper should implement refspec capability" error &&
+ test_grep "this remote helper should implement refspec capability" error &&
compare_refs local2 HEAD server HEAD
'
@@ -157,7 +157,7 @@ test_expect_success 'pushing without refspecs' '
GIT_REMOTE_TESTGIT_NOREFSPEC=1 &&
export GIT_REMOTE_TESTGIT_NOREFSPEC &&
test_must_fail git push 2>../error) &&
- test_i18ngrep "remote-helper doesn.t support push; refspec needed" error
+ test_grep "remote-helper doesn.t support push; refspec needed" error
'
test_expect_success 'pulling without marks' '
@@ -256,7 +256,7 @@ clean_mark () {
test_expect_success 'proper failure checks for fetching' '
(cd local &&
test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git fetch 2>error &&
- test_i18ngrep -q "error while running fast-import" error
+ test_grep -q "error while running fast-import" error
)
'
diff --git a/t/t5801/git-remote-testgit b/t/t5801/git-remote-testgit
index 1544d6d..c5b10f5 100755
--- a/t/t5801/git-remote-testgit
+++ b/t/t5801/git-remote-testgit
@@ -12,6 +12,11 @@ url=$2
dir="$GIT_DIR/testgit/$alias"
+if ! git rev-parse --is-inside-git-dir
+then
+ exit 1
+fi
+
h_refspec="refs/heads/*:refs/testgit/$alias/heads/*"
t_refspec="refs/tags/*:refs/testgit/$alias/tags/*"
@@ -25,6 +30,7 @@ GIT_DIR="$url/.git"
export GIT_DIR
force=
+object_format=
mkdir -p "$dir"
@@ -56,7 +62,8 @@ do
echo
;;
list)
- echo ":object-format $(git rev-parse --show-object-format=storage)"
+ test -n "$object_format" &&
+ echo ":object-format $(git rev-parse --show-object-format=storage)"
git for-each-ref --format='? %(refname)' 'refs/heads/' 'refs/tags/'
head=$(git symbolic-ref HEAD)
echo "@$head HEAD"
diff --git a/t/t5810-proto-disable-local.sh b/t/t5810-proto-disable-local.sh
index c1ef99b..8626102 100755
--- a/t/t5810-proto-disable-local.sh
+++ b/t/t5810-proto-disable-local.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='test disabling of local paths in clone/fetch'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY/lib-proto-disable.sh"
diff --git a/t/t5811-proto-disable-git.sh b/t/t5811-proto-disable-git.sh
index 8ac6b2a..ed773e7 100755
--- a/t/t5811-proto-disable-git.sh
+++ b/t/t5811-proto-disable-git.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='test disabling of git-over-tcp in clone/fetch'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY/lib-proto-disable.sh"
. "$TEST_DIRECTORY/lib-git-daemon.sh"
diff --git a/t/t5812-proto-disable-http.sh b/t/t5812-proto-disable-http.sh
index d8da5f5..769c717 100755
--- a/t/t5812-proto-disable-http.sh
+++ b/t/t5812-proto-disable-http.sh
@@ -20,7 +20,7 @@ test_expect_success 'http(s) transport respects GIT_ALLOW_PROTOCOL' '
test_must_fail env GIT_ALLOW_PROTOCOL=http:https \
GIT_SMART_HTTP=0 \
git clone "$HTTPD_URL/ftp-redir/repo.git" 2>stderr &&
- test_i18ngrep -E "(ftp.*disabled|your curl version is too old)" stderr
+ test_grep -E "(ftp.*disabled|your curl version is too old)" stderr
'
test_expect_success 'curl limits redirects' '
diff --git a/t/t5813-proto-disable-ssh.sh b/t/t5813-proto-disable-ssh.sh
index 3f084ee..2e975dc 100755
--- a/t/t5813-proto-disable-ssh.sh
+++ b/t/t5813-proto-disable-ssh.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='test disabling of git-over-ssh in clone/fetch'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY/lib-proto-disable.sh"
diff --git a/t/t6000-rev-list-misc.sh b/t/t6000-rev-list-misc.sh
index 12def7b..6289a2e 100755
--- a/t/t6000-rev-list-misc.sh
+++ b/t/t6000-rev-list-misc.sh
@@ -169,4 +169,17 @@ test_expect_success 'rev-list --count --objects' '
test_line_count = $count actual
'
+test_expect_success 'rev-list --unpacked' '
+ git repack -ad &&
+ test_commit unpacked &&
+
+ git rev-list --objects --no-object-names unpacked^.. >expect.raw &&
+ sort expect.raw >expect &&
+
+ git rev-list --all --objects --unpacked --no-object-names >actual.raw &&
+ sort actual.raw >actual &&
+
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t6001-rev-list-graft.sh b/t/t6001-rev-list-graft.sh
index 7294147..73a2465 100755
--- a/t/t6001-rev-list-graft.sh
+++ b/t/t6001-rev-list-graft.sh
@@ -99,6 +99,7 @@ do
"
test_expect_success 'with grafts' "
+ mkdir -p .git/info &&
echo '$B0 $A2' >.git/info/grafts &&
check $type $B2 -- $B2 $B1 $B0 $A2 $A1 $A0
"
@@ -117,10 +118,10 @@ done
test_expect_success 'show advice that grafts are deprecated' '
git show HEAD 2>err &&
- test_i18ngrep "git replace" err &&
+ test_grep "git replace" err &&
test_config advice.graftFileDeprecated false &&
git show HEAD 2>err &&
- test_i18ngrep ! "git replace" err
+ test_grep ! "git replace" err
'
test_done
diff --git a/t/t6003-rev-list-topo-order.sh b/t/t6003-rev-list-topo-order.sh
index 1f7d7dd..5cf2cee 100755
--- a/t/t6003-rev-list-topo-order.sh
+++ b/t/t6003-rev-list-topo-order.sh
@@ -326,19 +326,16 @@ a2
c3
EOF
-#
-# this test fails on --topo-order - a fix is required
-#
-#test_output_expect_success '--max-age=c3, --topo-order' "git rev-list --topo-order --max-age=$(commit_date c3) l5" <<EOF
-#l5
-#l4
-#l3
-#a4
-#c3
-#b4
-#a3
-#a2
-#EOF
+test_output_expect_success '--max-age=c3, --topo-order' "git rev-list --topo-order --max-age=$(commit_date c3) l5" <<EOF
+l5
+l4
+l3
+a4
+c3
+b4
+a3
+a2
+EOF
test_output_expect_success 'one specified head reachable from another a4, c3, --topo-order' "list_duplicates git rev-list --topo-order a4 c3" <<EOF
EOF
diff --git a/t/t6005-rev-list-count.sh b/t/t6005-rev-list-count.sh
index 0729f80..ee0306a 100755
--- a/t/t6005-rev-list-count.sh
+++ b/t/t6005-rev-list-count.sh
@@ -18,20 +18,34 @@ test_expect_success 'no options' '
'
test_expect_success '--max-count' '
+ test_must_fail git rev-list --max-count=1q HEAD 2>error &&
+ grep "not an integer" error &&
+
test_stdout_line_count = 0 git rev-list HEAD --max-count=0 &&
test_stdout_line_count = 3 git rev-list HEAD --max-count=3 &&
test_stdout_line_count = 5 git rev-list HEAD --max-count=5 &&
- test_stdout_line_count = 5 git rev-list HEAD --max-count=10
+ test_stdout_line_count = 5 git rev-list HEAD --max-count=10 &&
+ test_stdout_line_count = 5 git rev-list HEAD --max-count=-1
'
test_expect_success '--max-count all forms' '
+ test_must_fail git rev-list -1q HEAD 2>error &&
+ grep "not an integer" error &&
+ test_must_fail git rev-list --1 HEAD &&
+ test_must_fail git rev-list -n 1q HEAD 2>error &&
+ grep "not an integer" error &&
+
test_stdout_line_count = 1 git rev-list HEAD --max-count=1 &&
test_stdout_line_count = 1 git rev-list HEAD -1 &&
test_stdout_line_count = 1 git rev-list HEAD -n1 &&
- test_stdout_line_count = 1 git rev-list HEAD -n 1
+ test_stdout_line_count = 1 git rev-list HEAD -n 1 &&
+ test_stdout_line_count = 5 git rev-list HEAD -n -1
'
test_expect_success '--skip' '
+ test_must_fail git rev-list --skip 1q HEAD 2>error &&
+ grep "not an integer" error &&
+
test_stdout_line_count = 5 git rev-list HEAD --skip=0 &&
test_stdout_line_count = 2 git rev-list HEAD --skip=3 &&
test_stdout_line_count = 0 git rev-list HEAD --skip=5 &&
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh
index 41d0ca0..573eb97 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -493,7 +493,7 @@ test_expect_success 'empty email' '
test_tick &&
C=$(GIT_AUTHOR_EMAIL= git commit-tree HEAD^{tree} </dev/null) &&
A=$(git show --pretty=format:%an,%ae,%ad%n -s $C) &&
- verbose test "$A" = "$GIT_AUTHOR_NAME,,Thu Apr 7 15:14:13 2005 -0700"
+ test "$A" = "$GIT_AUTHOR_NAME,,Thu Apr 7 15:14:13 2005 -0700"
'
test_expect_success 'del LF before empty (1)' '
diff --git a/t/t6008-rev-list-submodule.sh b/t/t6008-rev-list-submodule.sh
index 3153a0d..2cdef6f 100755
--- a/t/t6008-rev-list-submodule.sh
+++ b/t/t6008-rev-list-submodule.sh
@@ -8,6 +8,7 @@ test_description='git rev-list involving submodules that this repo has'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -26,7 +27,7 @@ test_expect_success 'setup' '
: > super-file &&
git add super-file &&
- git submodule add "$(pwd)" sub &&
+ git -c protocol.file.allow=always submodule add "$(pwd)" sub &&
git symbolic-ref HEAD refs/heads/super &&
test_tick &&
git commit -m super-initial &&
diff --git a/t/t6009-rev-list-parent.sh b/t/t6009-rev-list-parent.sh
index 5a67bbc..91db8fa 100755
--- a/t/t6009-rev-list-parent.sh
+++ b/t/t6009-rev-list-parent.sh
@@ -5,6 +5,7 @@ test_description='ancestor culling and limiting by parent number'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
check_revlist () {
@@ -62,6 +63,17 @@ test_expect_success 'setup roots, merges and octopuses' '
git checkout main
'
+test_expect_success 'parse --max-parents & --min-parents' '
+ test_must_fail git rev-list --max-parents=1q HEAD 2>error &&
+ grep "not an integer" error &&
+
+ test_must_fail git rev-list --min-parents=1q HEAD 2>error &&
+ grep "not an integer" error &&
+
+ git rev-list --max-parents=1 --min-parents=1 HEAD &&
+ git rev-list --max-parents=-1 --min-parents=-1 HEAD
+'
+
test_expect_success 'rev-list roots' '
check_revlist "--max-parents=0" one five
diff --git a/t/t6011-rev-list-with-bad-commit.sh b/t/t6011-rev-list-with-bad-commit.sh
index bad02cf..b2e422c 100755
--- a/t/t6011-rev-list-with-bad-commit.sh
+++ b/t/t6011-rev-list-with-bad-commit.sh
@@ -2,6 +2,7 @@
test_description='git rev-list should notice bad commits'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# Note:
diff --git a/t/t6014-rev-list-all.sh b/t/t6014-rev-list-all.sh
index c9bedd2..16b8bd1 100755
--- a/t/t6014-rev-list-all.sh
+++ b/t/t6014-rev-list-all.sh
@@ -2,6 +2,7 @@
test_description='--all includes detached HEADs'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
diff --git a/t/t6017-rev-list-stdin.sh b/t/t6017-rev-list-stdin.sh
index 0516251..4821b90 100755
--- a/t/t6017-rev-list-stdin.sh
+++ b/t/t6017-rev-list-stdin.sh
@@ -48,7 +48,9 @@ test_expect_success setup '
git add file-$i &&
test_tick &&
git commit -m side-$i || exit
- done
+ done &&
+
+ git update-ref refs/heads/-dashed-branch HEAD
)
'
@@ -60,6 +62,13 @@ check side-1 ^side-7 -- file-2
check side-3 ^side-4 -- file-3
check side-3 ^side-2
check side-3 ^side-2 -- file-1
+check --all
+check --all --not --branches
+check --glob=refs/heads
+check --glob=refs/heads --
+check --glob=refs/heads -- file-1
+check --end-of-options -dashed-branch
+check --all --not refs/heads/main
test_expect_success 'not only --stdin' '
cat >expect <<-EOF &&
@@ -78,4 +87,65 @@ test_expect_success 'not only --stdin' '
test_cmp expect actual
'
+test_expect_success 'pseudo-opt with missing value' '
+ cat >input <<-EOF &&
+ --glob
+ refs/heads
+ EOF
+
+ cat >expect <<-EOF &&
+ fatal: Option ${SQ}--glob${SQ} requires a value
+ EOF
+
+ test_must_fail git rev-list --stdin <input 2>error &&
+ test_cmp expect error
+'
+
+test_expect_success 'pseudo-opt with invalid value' '
+ cat >input <<-EOF &&
+ --no-walk=garbage
+ EOF
+
+ cat >expect <<-EOF &&
+ error: invalid argument to --no-walk
+ fatal: invalid option ${SQ}--no-walk=garbage${SQ} in --stdin mode
+ EOF
+
+ test_must_fail git rev-list --stdin <input 2>error &&
+ test_cmp expect error
+'
+
+test_expect_success 'unknown option without --end-of-options' '
+ cat >input <<-EOF &&
+ -dashed-branch
+ EOF
+
+ cat >expect <<-EOF &&
+ fatal: invalid option ${SQ}-dashed-branch${SQ} in --stdin mode
+ EOF
+
+ test_must_fail git rev-list --stdin <input 2>error &&
+ test_cmp expect error
+'
+
+test_expect_success '--not on command line does not influence revisions read via --stdin' '
+ cat >input <<-EOF &&
+ refs/heads/main
+ EOF
+ git rev-list refs/heads/main >expect &&
+
+ git rev-list refs/heads/main --not --stdin <input >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success '--not via stdin does not influence revisions from command line' '
+ cat >input <<-EOF &&
+ --not
+ EOF
+ git rev-list refs/heads/main >expect &&
+
+ git rev-list refs/heads/main --stdin refs/heads/main <input >actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t6018-rev-list-glob.sh b/t/t6018-rev-list-glob.sh
index e1abc5c..3b181f7 100755
--- a/t/t6018-rev-list-glob.sh
+++ b/t/t6018-rev-list-glob.sh
@@ -187,6 +187,44 @@ test_expect_success 'rev-parse --exclude=ref with --remotes=glob' '
compare rev-parse "--exclude=upstream/x --remotes=upstream/*" "upstream/one upstream/two"
'
+for section in fetch receive uploadpack
+do
+ test_expect_success "rev-parse --exclude-hidden=$section with --all" '
+ compare "-c transfer.hideRefs=refs/remotes/ rev-parse" "--branches --tags" "--exclude-hidden=$section --all"
+ '
+
+ test_expect_success "rev-parse --exclude-hidden=$section with --all" '
+ compare "-c transfer.hideRefs=refs/heads/subspace/ rev-parse" "--exclude=refs/heads/subspace/* --all" "--exclude-hidden=$section --all"
+ '
+
+ test_expect_success "rev-parse --exclude-hidden=$section with --glob" '
+ compare "-c transfer.hideRefs=refs/heads/subspace/ rev-parse" "--exclude=refs/heads/subspace/* --glob=refs/heads/*" "--exclude-hidden=$section --glob=refs/heads/*"
+ '
+
+ test_expect_success "rev-parse --exclude-hidden=$section can be passed once per pseudo-ref" '
+ compare "-c transfer.hideRefs=refs/remotes/ rev-parse" "--branches --tags --branches --tags" "--exclude-hidden=$section --all --exclude-hidden=$section --all"
+ '
+
+ test_expect_success "rev-parse --exclude-hidden=$section can only be passed once per pseudo-ref" '
+ echo "fatal: --exclude-hidden= passed more than once" >expected &&
+ test_must_fail git rev-parse --exclude-hidden=$section --exclude-hidden=$section 2>err &&
+ test_cmp expected err
+ '
+
+ for pseudoopt in branches tags remotes
+ do
+ test_expect_success "rev-parse --exclude-hidden=$section fails with --$pseudoopt" '
+ test_must_fail git rev-parse --exclude-hidden=$section --$pseudoopt 2>err &&
+ test_grep "error: options .--exclude-hidden. and .--$pseudoopt. cannot be used together" err
+ '
+
+ test_expect_success "rev-parse --exclude-hidden=$section fails with --$pseudoopt=pattern" '
+ test_must_fail git rev-parse --exclude-hidden=$section --$pseudoopt=pattern 2>err &&
+ test_grep "error: options .--exclude-hidden. and .--$pseudoopt. cannot be used together" err
+ '
+ done
+done
+
test_expect_success 'rev-list --exclude=glob with --branches=glob' '
compare rev-list "--exclude=subspace-* --branches=sub*" "subspace/one subspace/two"
'
diff --git a/t/t6019-rev-list-ancestry-path.sh b/t/t6019-rev-list-ancestry-path.sh
index af57a04..738da23 100755
--- a/t/t6019-rev-list-ancestry-path.sh
+++ b/t/t6019-rev-list-ancestry-path.sh
@@ -8,8 +8,13 @@ test_description='--ancestry-path'
# / \
# A-------K---------------L--M
#
-# D..M == E F G H I J K L M
-# --ancestry-path D..M == E F H I J L M
+# D..M == E F G H I J K L M
+# --ancestry-path D..M == E F H I J L M
+# --ancestry-path=F D..M == E F J L M
+# --ancestry-path=G D..M == G H I J L M
+# --ancestry-path=H D..M == E G H I J L M
+# --ancestry-path=K D..M == K L M
+# --ancestry-path=K --ancestry-path=F D..M == E F J K L M
#
# D..M -- M.t == M
# --ancestry-path D..M -- M.t == M
@@ -50,73 +55,41 @@ test_expect_success setup '
test_commit M
'
-test_expect_success 'rev-list D..M' '
- test_write_lines E F G H I J K L M >expect &&
- git rev-list --format=%s D..M |
- sed -e "/^commit /d" |
- sort >actual &&
- test_cmp expect actual
-'
-
-test_expect_success 'rev-list --ancestry-path D..M' '
- test_write_lines E F H I J L M >expect &&
- git rev-list --ancestry-path --format=%s D..M |
- sed -e "/^commit /d" |
- sort >actual &&
- test_cmp expect actual
-'
-
-test_expect_success 'rev-list D..M -- M.t' '
- echo M >expect &&
- git rev-list --format=%s D..M -- M.t |
- sed -e "/^commit /d" >actual &&
- test_cmp expect actual
-'
-
-test_expect_success 'rev-list --ancestry-path D..M -- M.t' '
- echo M >expect &&
- git rev-list --ancestry-path --format=%s D..M -- M.t |
- sed -e "/^commit /d" >actual &&
- test_cmp expect actual
-'
+test_ancestry () {
+ args=$1
+ expected=$2
+ test_expect_success "log $args" "
+ test_write_lines $expected >expect &&
+ git log --format=%s $args >raw &&
+
+ if test -n \"$expected\"
+ then
+ sort raw >actual &&
+ test_cmp expect actual
+ else
+ test_must_be_empty raw
+ fi
+ "
+}
-test_expect_success 'rev-list F...I' '
- test_write_lines F G H I >expect &&
- git rev-list --format=%s F...I |
- sed -e "/^commit /d" |
- sort >actual &&
- test_cmp expect actual
-'
+test_ancestry "D..M" "E F G H I J K L M"
-test_expect_success 'rev-list --ancestry-path F...I' '
- test_write_lines F H I >expect &&
- git rev-list --ancestry-path --format=%s F...I |
- sed -e "/^commit /d" |
- sort >actual &&
- test_cmp expect actual
-'
+test_ancestry "--ancestry-path D..M" "E F H I J L M"
+test_ancestry "--ancestry-path=F D..M" "E F J L M"
+test_ancestry "--ancestry-path=G D..M" "G H I J L M"
+test_ancestry "--ancestry-path=H D..M" "E G H I J L M"
+test_ancestry "--ancestry-path=K D..M" "K L M"
+test_ancestry "--ancestry-path=F --ancestry-path=K D..M" "E F J K L M"
-# G.t is dropped in an "-s ours" merge
-test_expect_success 'rev-list G..M -- G.t' '
- git rev-list --format=%s G..M -- G.t |
- sed -e "/^commit /d" >actual &&
- test_must_be_empty actual
-'
+test_ancestry "D..M -- M.t" "M"
+test_ancestry "--ancestry-path D..M -- M.t" "M"
-test_expect_success 'rev-list --ancestry-path G..M -- G.t' '
- echo L >expect &&
- git rev-list --ancestry-path --format=%s G..M -- G.t |
- sed -e "/^commit /d" >actual &&
- test_cmp expect actual
-'
+test_ancestry "F...I" "F G H I"
+test_ancestry "--ancestry-path F...I" "F H I"
-test_expect_success 'rev-list --ancestry-path --simplify-merges G^..M -- G.t' '
- test_write_lines G L >expect &&
- git rev-list --ancestry-path --simplify-merges --format=%s G^..M -- G.t |
- sed -e "/^commit /d" |
- sort >actual &&
- test_cmp expect actual
-'
+test_ancestry "G..M -- G.t" ""
+test_ancestry "--ancestry-path G..M -- G.t" "L"
+test_ancestry "--ancestry-path --simplify-merges G^..M -- G.t" "G L"
# b---bc
# / \ /
diff --git a/t/t6020-bundle-misc.sh b/t/t6020-bundle-misc.sh
index 8332051..3e6bcbf 100755
--- a/t/t6020-bundle-misc.sh
+++ b/t/t6020-bundle-misc.sh
@@ -10,6 +10,14 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-bundle.sh
+. "$TEST_DIRECTORY"/lib-terminal.sh
+
+for cmd in create verify list-heads unbundle
+do
+ test_expect_success "usage: git bundle $cmd needs an argument" '
+ test_expect_code 129 git bundle $cmd
+ '
+done
# Create a commit or tag and set the variable with the object ID.
test_commit_setvar () {
@@ -559,4 +567,88 @@ test_expect_success 'cloning from filtered bundle has useful error' '
grep "cannot clone from filtered bundle" err
'
+test_expect_success 'verify catches unreachable, broken prerequisites' '
+ test_when_finished rm -rf clone-from clone-to &&
+ git init clone-from &&
+ (
+ cd clone-from &&
+ git checkout -b base &&
+ test_commit A &&
+ git checkout -b tip &&
+ git commit --allow-empty -m "will drop by shallow" &&
+ git commit --allow-empty -m "will keep by shallow" &&
+ git commit --allow-empty -m "for bundle, not clone" &&
+ git bundle create tip.bundle tip~1..tip &&
+ git reset --hard HEAD~1 &&
+ git checkout base
+ ) &&
+ BAD_OID=$(git -C clone-from rev-parse tip~1) &&
+ TIP_OID=$(git -C clone-from rev-parse tip) &&
+ git clone --depth=1 --no-single-branch \
+ "file://$(pwd)/clone-from" clone-to &&
+ (
+ cd clone-to &&
+
+ # Set up broken history by removing shallow markers
+ git update-ref -d refs/remotes/origin/tip &&
+ rm .git/shallow &&
+
+ # Verify should fail
+ test_must_fail git bundle verify \
+ ../clone-from/tip.bundle 2>err &&
+ grep "some prerequisite commits .* are not connected" err &&
+ test_line_count = 1 err &&
+
+ # Unbundling should fail
+ test_must_fail git bundle unbundle \
+ ../clone-from/tip.bundle 2>err &&
+ grep "some prerequisite commits .* are not connected" err &&
+ test_line_count = 1 err
+ )
+'
+
+test_expect_success 'bundle progress includes write phase' '
+ GIT_PROGRESS_DELAY=0 \
+ git bundle create --progress out.bundle --all 2>err &&
+ grep 'Writing' err
+'
+
+test_expect_success TTY 'create --quiet disables all bundle progress' '
+ test_terminal env GIT_PROGRESS_DELAY=0 \
+ git bundle create --quiet out.bundle --all 2>err &&
+ test_must_be_empty err
+'
+
+test_expect_success 'bundle progress with --no-quiet' '
+ GIT_PROGRESS_DELAY=0 \
+ git bundle create --no-quiet out.bundle --all 2>err &&
+ grep "%" err
+'
+
+test_expect_success 'read bundle over stdin' '
+ git bundle create some.bundle HEAD &&
+
+ git bundle verify - <some.bundle 2>err &&
+ grep "<stdin> is okay" err &&
+
+ git bundle list-heads some.bundle >expect &&
+ git bundle list-heads - <some.bundle >actual &&
+ test_cmp expect actual &&
+
+ git bundle unbundle some.bundle >expect &&
+ git bundle unbundle - <some.bundle >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'send a bundle to standard output' '
+ git bundle create - --all HEAD >bundle-one &&
+ mkdir -p down &&
+ git -C down bundle create - --all HEAD >bundle-two &&
+ git bundle verify bundle-one &&
+ git bundle verify bundle-two &&
+ git ls-remote bundle-one >expect &&
+ git ls-remote bundle-two >actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t6021-rev-list-exclude-hidden.sh b/t/t6021-rev-list-exclude-hidden.sh
new file mode 100755
index 0000000..51df021
--- /dev/null
+++ b/t/t6021-rev-list-exclude-hidden.sh
@@ -0,0 +1,164 @@
+#!/bin/sh
+
+test_description='git rev-list --exclude-hidden test'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+ test_commit_bulk --id=commit --ref=refs/heads/branch 1 &&
+ COMMIT=$(git rev-parse refs/heads/branch) &&
+ test_commit_bulk --id=tag --ref=refs/tags/lightweight 1 &&
+ TAG=$(git rev-parse refs/tags/lightweight) &&
+ test_commit_bulk --id=hidden --ref=refs/hidden/commit 1 &&
+ HIDDEN=$(git rev-parse refs/hidden/commit) &&
+ test_commit_bulk --id=namespace --ref=refs/namespaces/namespace/refs/namespaced/commit 1 &&
+ NAMESPACE=$(git rev-parse refs/namespaces/namespace/refs/namespaced/commit)
+'
+
+test_expect_success 'invalid section' '
+ echo "fatal: unsupported section for hidden refs: unsupported" >expected &&
+ test_must_fail git rev-list --exclude-hidden=unsupported 2>err &&
+ test_cmp expected err
+'
+
+for section in fetch receive uploadpack
+do
+ test_expect_success "$section: passed multiple times" '
+ echo "fatal: --exclude-hidden= passed more than once" >expected &&
+ test_must_fail git rev-list --exclude-hidden=$section --exclude-hidden=$section 2>err &&
+ test_cmp expected err
+ '
+
+ test_expect_success "$section: without hiddenRefs" '
+ git rev-list --exclude-hidden=$section --all >out &&
+ cat >expected <<-EOF &&
+ $NAMESPACE
+ $HIDDEN
+ $TAG
+ $COMMIT
+ EOF
+ test_cmp expected out
+ '
+
+ test_expect_success "$section: hidden via transfer.hideRefs" '
+ git -c transfer.hideRefs=refs/hidden/ rev-list --exclude-hidden=$section --all >out &&
+ cat >expected <<-EOF &&
+ $NAMESPACE
+ $TAG
+ $COMMIT
+ EOF
+ test_cmp expected out
+ '
+
+ test_expect_success "$section: hidden via $section.hideRefs" '
+ git -c $section.hideRefs=refs/hidden/ rev-list --exclude-hidden=$section --all >out &&
+ cat >expected <<-EOF &&
+ $NAMESPACE
+ $TAG
+ $COMMIT
+ EOF
+ test_cmp expected out
+ '
+
+ test_expect_success "$section: respects both transfer.hideRefs and $section.hideRefs" '
+ git -c transfer.hideRefs=refs/tags/ -c $section.hideRefs=refs/hidden/ rev-list --exclude-hidden=$section --all >out &&
+ cat >expected <<-EOF &&
+ $NAMESPACE
+ $COMMIT
+ EOF
+ test_cmp expected out
+ '
+
+ test_expect_success "$section: negation without hidden refs marks everything as uninteresting" '
+ git rev-list --all --exclude-hidden=$section --not --all >out &&
+ test_must_be_empty out
+ '
+
+ test_expect_success "$section: negation with hidden refs marks them as interesting" '
+ git -c transfer.hideRefs=refs/hidden/ rev-list --all --exclude-hidden=$section --not --all >out &&
+ cat >expected <<-EOF &&
+ $HIDDEN
+ EOF
+ test_cmp expected out
+ '
+
+ test_expect_success "$section: hidden refs and excludes work together" '
+ git -c transfer.hideRefs=refs/hidden/ rev-list --exclude=refs/tags/* --exclude-hidden=$section --all >out &&
+ cat >expected <<-EOF &&
+ $NAMESPACE
+ $COMMIT
+ EOF
+ test_cmp expected out
+ '
+
+ test_expect_success "$section: excluded hidden refs get reset" '
+ git -c transfer.hideRefs=refs/ rev-list --exclude-hidden=$section --all --all >out &&
+ cat >expected <<-EOF &&
+ $NAMESPACE
+ $HIDDEN
+ $TAG
+ $COMMIT
+ EOF
+ test_cmp expected out
+ '
+
+ test_expect_success "$section: excluded hidden refs can be used with multiple pseudo-refs" '
+ git -c transfer.hideRefs=refs/ rev-list --exclude-hidden=$section --all --exclude-hidden=$section --all >out &&
+ test_must_be_empty out
+ '
+
+ test_expect_success "$section: works with --glob" '
+ git -c transfer.hideRefs=refs/hidden/ rev-list --exclude-hidden=$section --glob=refs/h* >out &&
+ cat >expected <<-EOF &&
+ $COMMIT
+ EOF
+ test_cmp expected out
+ '
+
+ test_expect_success "$section: operates on stripped refs by default" '
+ GIT_NAMESPACE=namespace git -c transfer.hideRefs=refs/namespaced/ rev-list --exclude-hidden=$section --all >out &&
+ cat >expected <<-EOF &&
+ $HIDDEN
+ $TAG
+ $COMMIT
+ EOF
+ test_cmp expected out
+ '
+
+ test_expect_success "$section: does not hide namespace by default" '
+ GIT_NAMESPACE=namespace git -c transfer.hideRefs=refs/namespaces/namespace/ rev-list --exclude-hidden=$section --all >out &&
+ cat >expected <<-EOF &&
+ $NAMESPACE
+ $HIDDEN
+ $TAG
+ $COMMIT
+ EOF
+ test_cmp expected out
+ '
+
+ test_expect_success "$section: can operate on unstripped refs" '
+ GIT_NAMESPACE=namespace git -c transfer.hideRefs=^refs/namespaces/namespace/ rev-list --exclude-hidden=$section --all >out &&
+ cat >expected <<-EOF &&
+ $HIDDEN
+ $TAG
+ $COMMIT
+ EOF
+ test_cmp expected out
+ '
+
+ for pseudoopt in remotes branches tags
+ do
+ test_expect_success "$section: fails with --$pseudoopt" '
+ test_must_fail git rev-list --exclude-hidden=$section --$pseudoopt 2>err &&
+ test_grep "error: options .--exclude-hidden. and .--$pseudoopt. cannot be used together" err
+ '
+
+ test_expect_success "$section: fails with --$pseudoopt=pattern" '
+ test_must_fail git rev-list --exclude-hidden=$section --$pseudoopt=pattern 2>err &&
+ test_grep "error: options .--exclude-hidden. and .--$pseudoopt. cannot be used together" err
+ '
+ done
+done
+
+test_done
diff --git a/t/t6022-rev-list-missing.sh b/t/t6022-rev-list-missing.sh
new file mode 100755
index 0000000..127180e
--- /dev/null
+++ b/t/t6022-rev-list-missing.sh
@@ -0,0 +1,149 @@
+#!/bin/sh
+
+test_description='handling of missing objects in rev-list'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+# We setup the repository with two commits, this way HEAD is always
+# available and we can hide commit 1.
+test_expect_success 'create repository and alternate directory' '
+ test_commit 1 &&
+ test_commit 2 &&
+ test_commit 3 &&
+ git tag -m "tag message" annot_tag HEAD~1 &&
+ git tag regul_tag HEAD~1 &&
+ git branch a_branch HEAD~1
+'
+
+# We manually corrupt the repository, which means that the commit-graph may
+# contain references to already-deleted objects. We thus need to enable
+# commit-graph paranoia to not returned these deleted commits from the graph.
+GIT_COMMIT_GRAPH_PARANOIA=true
+export GIT_COMMIT_GRAPH_PARANOIA
+
+for obj in "HEAD~1" "HEAD~1^{tree}" "HEAD:1.t"
+do
+ test_expect_success "rev-list --missing=error fails with missing object $obj" '
+ oid="$(git rev-parse $obj)" &&
+ path=".git/objects/$(test_oid_to_path $oid)" &&
+
+ mv "$path" "$path.hidden" &&
+ test_when_finished "mv $path.hidden $path" &&
+
+ test_must_fail git rev-list --missing=error --objects \
+ --no-object-names HEAD
+ '
+done
+
+for obj in "HEAD~1" "HEAD~1^{tree}" "HEAD:1.t"
+do
+ for action in "allow-any" "print"
+ do
+ test_expect_success "rev-list --missing=$action with missing $obj" '
+ oid="$(git rev-parse $obj)" &&
+ path=".git/objects/$(test_oid_to_path $oid)" &&
+
+ # Before the object is made missing, we use rev-list to
+ # get the expected oids.
+ git rev-list --objects --no-object-names \
+ HEAD ^$obj >expect.raw &&
+
+ # Blobs are shared by all commits, so even though a commit/tree
+ # might be skipped, its blob must be accounted for.
+ if test $obj != "HEAD:1.t"
+ then
+ echo $(git rev-parse HEAD:1.t) >>expect.raw &&
+ echo $(git rev-parse HEAD:2.t) >>expect.raw
+ fi &&
+
+ mv "$path" "$path.hidden" &&
+ test_when_finished "mv $path.hidden $path" &&
+
+ git rev-list --missing=$action --objects --no-object-names \
+ HEAD >actual.raw &&
+
+ # When the action is to print, we should also add the missing
+ # oid to the expect list.
+ case $action in
+ allow-any)
+ ;;
+ print)
+ grep ?$oid actual.raw &&
+ echo ?$oid >>expect.raw
+ ;;
+ esac &&
+
+ sort actual.raw >actual &&
+ sort expect.raw >expect &&
+ test_cmp expect actual
+ '
+ done
+done
+
+for missing_tip in "annot_tag" "regul_tag" "a_branch" "HEAD~1" "HEAD~1^{tree}" "HEAD:1.t"
+do
+ # We want to check that things work when both
+ # - all the tips passed are missing (case existing_tip = ""), and
+ # - there is one missing tip and one existing tip (case existing_tip = "HEAD")
+ for existing_tip in "" "HEAD"
+ do
+ for action in "allow-any" "print"
+ do
+ test_expect_success "--missing=$action with tip '$missing_tip' missing and tip '$existing_tip'" '
+ # Before the object is made missing, we use rev-list to
+ # get the expected oids.
+ if test "$existing_tip" = "HEAD"
+ then
+ git rev-list --objects --no-object-names \
+ HEAD ^$missing_tip >expect.raw
+ else
+ >expect.raw
+ fi &&
+
+ # Blobs are shared by all commits, so even though a commit/tree
+ # might be skipped, its blob must be accounted for.
+ if test "$existing_tip" = "HEAD" && test $missing_tip != "HEAD:1.t"
+ then
+ echo $(git rev-parse HEAD:1.t) >>expect.raw &&
+ echo $(git rev-parse HEAD:2.t) >>expect.raw
+ fi &&
+
+ missing_oid="$(git rev-parse $missing_tip)" &&
+
+ if test "$missing_tip" = "annot_tag"
+ then
+ oid="$(git rev-parse $missing_tip^{commit})" &&
+ echo "$missing_oid" >>expect.raw
+ else
+ oid="$missing_oid"
+ fi &&
+
+ path=".git/objects/$(test_oid_to_path $oid)" &&
+
+ mv "$path" "$path.hidden" &&
+ test_when_finished "mv $path.hidden $path" &&
+
+ git rev-list --missing=$action --objects --no-object-names \
+ $missing_oid $existing_tip >actual.raw &&
+
+ # When the action is to print, we should also add the missing
+ # oid to the expect list.
+ case $action in
+ allow-any)
+ ;;
+ print)
+ grep ?$oid actual.raw &&
+ echo ?$oid >>expect.raw
+ ;;
+ esac &&
+
+ sort actual.raw >actual &&
+ sort expect.raw >expect &&
+ test_cmp expect actual
+ '
+ done
+ done
+done
+
+test_done
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 83931d4..cdc0270 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -34,6 +34,36 @@ HASH2=
HASH3=
HASH4=
+test_bisect_usage () {
+ local code="$1" &&
+ shift &&
+ cat >expect &&
+ test_expect_code $code "$@" >out 2>actual &&
+ test_must_be_empty out &&
+ test_cmp expect actual
+}
+
+test_expect_success 'bisect usage' "
+ test_bisect_usage 1 git bisect reset extra1 extra2 <<-\EOF &&
+ error: 'git bisect reset' requires either no argument or a commit
+ EOF
+ test_bisect_usage 1 git bisect terms extra1 extra2 <<-\EOF &&
+ error: 'git bisect terms' requires 0 or 1 argument
+ EOF
+ test_bisect_usage 1 git bisect next extra1 <<-\EOF &&
+ error: 'git bisect next' requires 0 arguments
+ EOF
+ test_bisect_usage 1 git bisect log extra1 <<-\EOF &&
+ error: We are not bisecting.
+ EOF
+ test_bisect_usage 1 git bisect replay <<-\EOF &&
+ error: no logfile given
+ EOF
+ test_bisect_usage 1 git bisect run <<-\EOF
+ error: 'git bisect run' failed: no command provided.
+ EOF
+"
+
test_expect_success 'set up basic repo with 1 file (hello) and 4 commits' '
add_line_into_file "1: Hello World" hello &&
HASH1=$(git rev-parse --verify HEAD) &&
@@ -92,6 +122,29 @@ test_expect_success 'bisect start without -- takes unknown arg as pathspec' '
grep bar ".git/BISECT_NAMES"
'
+test_expect_success 'bisect reset: back in a branch checked out also elsewhere' '
+ echo "shared" > branch.expect &&
+ test_bisect_reset() {
+ git -C $1 bisect start &&
+ git -C $1 bisect good $HASH1 &&
+ git -C $1 bisect bad $HASH3 &&
+ git -C $1 bisect reset &&
+ git -C $1 branch --show-current > branch.output &&
+ cmp branch.expect branch.output
+ } &&
+ test_when_finished "
+ git worktree remove wt1 &&
+ git worktree remove wt2 &&
+ git branch -d shared
+ " &&
+ git worktree add wt1 -b shared &&
+ git worktree add wt2 -f shared &&
+ # we test in both worktrees to ensure that works
+ # as expected with "first" and "next" worktrees
+ test_bisect_reset wt1 &&
+ test_bisect_reset wt2
+'
+
test_expect_success 'bisect reset: back in the main branch' '
git bisect reset &&
echo "* main" > branch.expect &&
@@ -117,6 +170,12 @@ test_expect_success 'bisect reset when not bisecting' '
cmp branch.expect branch.output
'
+test_expect_success 'bisect reset cleans up even when not bisecting' '
+ echo garbage >.git/BISECT_LOG &&
+ git bisect reset &&
+ test_path_is_missing .git/BISECT_LOG
+'
+
test_expect_success 'bisect reset removes packed refs' '
git bisect reset &&
git bisect start &&
@@ -167,7 +226,7 @@ test_expect_success 'bisect start: existing ".git/BISECT_START" not modified if
cp .git/BISECT_START saved &&
test_must_fail git bisect start $HASH4 foo -- &&
git branch > branch.output &&
- test_i18ngrep "* (no branch, bisect started on other)" branch.output > /dev/null &&
+ test_grep "* (no branch, bisect started on other)" branch.output > /dev/null &&
test_cmp saved .git/BISECT_START
'
test_expect_success 'bisect start: no ".git/BISECT_START" if mistaken rev' '
@@ -252,6 +311,124 @@ test_expect_success 'bisect skip: with commit both bad and skipped' '
grep $HASH4 my_bisect_log.txt
'
+test_bisect_run_args () {
+ test_when_finished "rm -f run.sh actual" &&
+ >actual &&
+ cat >expect.args &&
+ cat <&6 >expect.out &&
+ cat <&7 >expect.err &&
+ write_script run.sh <<-\EOF &&
+ while test $# != 0
+ do
+ echo "<$1>" &&
+ shift
+ done >actual.args
+ EOF
+
+ test_when_finished "git bisect reset" &&
+ git bisect start &&
+ git bisect good $HASH1 &&
+ git bisect bad $HASH4 &&
+ git bisect run ./run.sh $@ >actual.out.raw 2>actual.err &&
+ # Prune just the log output
+ sed -n \
+ -e '/^Author:/d' \
+ -e '/^Date:/d' \
+ -e '/^$/d' \
+ -e '/^commit /d' \
+ -e '/^ /d' \
+ -e 'p' \
+ <actual.out.raw >actual.out &&
+ test_cmp expect.out actual.out &&
+ test_cmp expect.err actual.err &&
+ test_cmp expect.args actual.args
+}
+
+test_expect_success 'git bisect run: args, stdout and stderr with no arguments' "
+ test_bisect_run_args <<-'EOF_ARGS' 6<<-EOF_OUT 7<<-'EOF_ERR'
+ EOF_ARGS
+ running './run.sh'
+ $HASH4 is the first bad commit
+ bisect found first bad commit
+ EOF_OUT
+ EOF_ERR
+"
+
+test_expect_success 'git bisect run: args, stdout and stderr: "--" argument' "
+ test_bisect_run_args -- <<-'EOF_ARGS' 6<<-EOF_OUT 7<<-'EOF_ERR'
+ <-->
+ EOF_ARGS
+ running './run.sh' '--'
+ $HASH4 is the first bad commit
+ bisect found first bad commit
+ EOF_OUT
+ EOF_ERR
+"
+
+test_expect_success 'git bisect run: args, stdout and stderr: "--log foo --no-log bar" arguments' "
+ test_bisect_run_args --log foo --no-log bar <<-'EOF_ARGS' 6<<-EOF_OUT 7<<-'EOF_ERR'
+ <--log>
+ <foo>
+ <--no-log>
+ <bar>
+ EOF_ARGS
+ running './run.sh' '--log' 'foo' '--no-log' 'bar'
+ $HASH4 is the first bad commit
+ bisect found first bad commit
+ EOF_OUT
+ EOF_ERR
+"
+
+test_expect_success 'git bisect run: args, stdout and stderr: "--bisect-start" argument' "
+ test_bisect_run_args --bisect-start <<-'EOF_ARGS' 6<<-EOF_OUT 7<<-'EOF_ERR'
+ <--bisect-start>
+ EOF_ARGS
+ running './run.sh' '--bisect-start'
+ $HASH4 is the first bad commit
+ bisect found first bad commit
+ EOF_OUT
+ EOF_ERR
+"
+
+test_expect_success 'git bisect run: negative exit code' "
+ write_script fail.sh <<-'EOF' &&
+ exit 255
+ EOF
+ cat <<-'EOF' >expect &&
+ bisect run failed: exit code -1 from './fail.sh' is < 0 or >= 128
+ EOF
+ test_when_finished 'git bisect reset' &&
+ git bisect start &&
+ git bisect good $HASH1 &&
+ git bisect bad $HASH4 &&
+ ! git bisect run ./fail.sh 2>err &&
+ sed -En 's/.*(bisect.*code) (-?[0-9]+) (from.*)/\1 -1 \3/p' err >actual &&
+ test_cmp expect actual
+"
+
+test_expect_success 'git bisect run: unable to verify on good' "
+ write_script fail.sh <<-'EOF' &&
+ head=\$(git rev-parse --verify HEAD)
+ good=\$(git rev-parse --verify $HASH1)
+ if test "\$head" = "\$good"
+ then
+ exit 255
+ else
+ exit 127
+ fi
+ EOF
+ cat <<-'EOF' >expect &&
+ unable to verify './fail.sh' on good revision
+ EOF
+ test_when_finished 'git bisect reset' &&
+ git bisect start &&
+ git bisect good $HASH1 &&
+ git bisect bad $HASH4 &&
+ ! git bisect run ./fail.sh 2>err &&
+ sed -n 's/.*\(unable to verify.*\)/\1/p' err >actual &&
+ test_cmp expect actual
+"
+
# We want to automatically find the commit that
# added "Another" into hello.
test_expect_success '"git bisect run" simple case' '
@@ -266,6 +443,16 @@ test_expect_success '"git bisect run" simple case' '
git bisect reset
'
+# We want to make sure no arguments has been eaten
+test_expect_success '"git bisect run" simple case' '
+ git bisect start &&
+ git bisect good $HASH1 &&
+ git bisect bad $HASH4 &&
+ git bisect run printf "%s %s\n" reset --bisect-skip >my_bisect_log.txt &&
+ grep -e "reset --bisect-skip" my_bisect_log.txt &&
+ git bisect reset
+'
+
# We want to automatically find the commit that
# added "Ciao" into hello.
test_expect_success '"git bisect run" with more complex "git bisect start"' '
@@ -407,7 +594,7 @@ test_expect_success 'bisect starting with a detached HEAD' '
test_expect_success 'bisect errors out if bad and good are mistaken' '
git bisect reset &&
test_must_fail git bisect start $HASH2 $HASH4 2> rev_list_error &&
- test_i18ngrep "mistook good and bad" rev_list_error &&
+ test_grep "mistook good and bad" rev_list_error &&
git bisect reset
'
@@ -449,7 +636,7 @@ test_expect_success 'side branch creation' '
test_expect_success 'good merge base when good and bad are siblings' '
git bisect start "$HASH7" "$SIDE_HASH7" > my_bisect_log.txt &&
- test_i18ngrep "merge base must be tested" my_bisect_log.txt &&
+ test_grep "merge base must be tested" my_bisect_log.txt &&
grep $HASH4 my_bisect_log.txt &&
git bisect good > my_bisect_log.txt &&
! grep "merge base must be tested" my_bisect_log.txt &&
@@ -458,7 +645,7 @@ test_expect_success 'good merge base when good and bad are siblings' '
'
test_expect_success 'skipped merge base when good and bad are siblings' '
git bisect start "$SIDE_HASH7" "$HASH7" > my_bisect_log.txt &&
- test_i18ngrep "merge base must be tested" my_bisect_log.txt &&
+ test_grep "merge base must be tested" my_bisect_log.txt &&
grep $HASH4 my_bisect_log.txt &&
git bisect skip > my_bisect_log.txt 2>&1 &&
grep "warning" my_bisect_log.txt &&
@@ -468,11 +655,11 @@ test_expect_success 'skipped merge base when good and bad are siblings' '
test_expect_success 'bad merge base when good and bad are siblings' '
git bisect start "$HASH7" HEAD > my_bisect_log.txt &&
- test_i18ngrep "merge base must be tested" my_bisect_log.txt &&
+ test_grep "merge base must be tested" my_bisect_log.txt &&
grep $HASH4 my_bisect_log.txt &&
test_must_fail git bisect bad > my_bisect_log.txt 2>&1 &&
- test_i18ngrep "merge base $HASH4 is bad" my_bisect_log.txt &&
- test_i18ngrep "fixed between $HASH4 and \[$SIDE_HASH7\]" my_bisect_log.txt &&
+ test_grep "merge base $HASH4 is bad" my_bisect_log.txt &&
+ test_grep "fixed between $HASH4 and \[$SIDE_HASH7\]" my_bisect_log.txt &&
git bisect reset
'
@@ -523,9 +710,9 @@ test_expect_success '"git bisect run --first-parent" simple case' '
test_expect_success 'good merge bases when good and bad are siblings' '
git bisect start "$B_HASH" "$A_HASH" > my_bisect_log.txt &&
- test_i18ngrep "merge base must be tested" my_bisect_log.txt &&
+ test_grep "merge base must be tested" my_bisect_log.txt &&
git bisect good > my_bisect_log2.txt &&
- test_i18ngrep "merge base must be tested" my_bisect_log2.txt &&
+ test_grep "merge base must be tested" my_bisect_log2.txt &&
{
{
grep "$SIDE_HASH5" my_bisect_log.txt &&
@@ -540,14 +727,14 @@ test_expect_success 'good merge bases when good and bad are siblings' '
test_expect_success 'optimized merge base checks' '
git bisect start "$HASH7" "$SIDE_HASH7" > my_bisect_log.txt &&
- test_i18ngrep "merge base must be tested" my_bisect_log.txt &&
+ test_grep "merge base must be tested" my_bisect_log.txt &&
grep "$HASH4" my_bisect_log.txt &&
git bisect good > my_bisect_log2.txt &&
test -f ".git/BISECT_ANCESTORS_OK" &&
test "$HASH6" = $(git rev-parse --verify HEAD) &&
git bisect bad &&
git bisect good "$A_HASH" > my_bisect_log4.txt &&
- test_i18ngrep "merge base must be tested" my_bisect_log4.txt &&
+ test_grep "merge base must be tested" my_bisect_log4.txt &&
test_path_is_missing ".git/BISECT_ANCESTORS_OK"
'
@@ -625,7 +812,7 @@ test_expect_success 'skipping away from skipped commit' '
test_expect_success 'erroring out when using bad path arguments' '
test_must_fail git bisect start $PARA_HASH7 $HASH1 -- foobar 2> error.txt &&
- test_i18ngrep "bad path arguments" error.txt
+ test_grep "bad path arguments" error.txt
'
test_expect_success 'test bisection on bare repo - --no-checkout specified' '
@@ -691,7 +878,7 @@ test_expect_success 'broken branch creation' '
echo "" > expected.ok
cat > expected.missing-tree.default <<EOF
-fatal: unable to read tree $deleted
+fatal: unable to read tree ($deleted)
EOF
test_expect_success 'bisect fails if tree is broken on start commit' '
@@ -900,6 +1087,16 @@ test_expect_success 'bisect start with one term1 and term2' '
git bisect reset
'
+test_expect_success 'bogus command does not start bisect' '
+ git bisect reset &&
+ test_must_fail git bisect --bisect-terms 1 2 2>out &&
+ ! grep "You need to start" out &&
+ test_must_fail git bisect --bisect-terms 2>out &&
+ ! grep "You need to start" out &&
+ grep "git bisect.*visualize" out &&
+ git bisect reset
+'
+
test_expect_success 'bisect replay with term1 and term2' '
git bisect replay log_to_replay.txt >bisect_result &&
grep "$HASH2 is the first term1 commit" bisect_result &&
@@ -985,12 +1182,11 @@ test_expect_success 'git bisect reset cleans bisection state properly' '
git bisect bad $HASH4 &&
git bisect reset &&
test -z "$(git for-each-ref "refs/bisect/*")" &&
- test_path_is_missing ".git/BISECT_EXPECTED_REV" &&
+ test_ref_missing BISECT_EXPECTED_REV &&
test_path_is_missing ".git/BISECT_ANCESTORS_OK" &&
test_path_is_missing ".git/BISECT_LOG" &&
test_path_is_missing ".git/BISECT_RUN" &&
test_path_is_missing ".git/BISECT_TERMS" &&
- test_path_is_missing ".git/head-name" &&
test_path_is_missing ".git/BISECT_HEAD" &&
test_path_is_missing ".git/BISECT_START"
'
@@ -1053,4 +1249,14 @@ test_expect_success 'bisect state output with bad commit' '
grep -F "waiting for good commit(s), bad commit known" output
'
+test_expect_success 'verify correct error message' '
+ git bisect reset &&
+ git bisect start $HASH4 $HASH1 &&
+ write_script test_script.sh <<-\EOF &&
+ rm .git/BISECT*
+ EOF
+ test_must_fail git bisect run ./test_script.sh 2>error &&
+ grep "git bisect good.*exited with error code" error
+'
+
test_done
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh
index a313849..acc281c 100755
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
@@ -5,6 +5,7 @@ test_description='remote tracking stats'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
advance () {
@@ -82,13 +83,13 @@ test_expect_success 'checkout (diverged from upstream)' '
(
cd test && git checkout b1
) >actual &&
- test_i18ngrep "have 1 and 1 different" actual
+ test_grep "have 1 and 1 different" actual
'
test_expect_success 'checkout with local tracked branch' '
git checkout main &&
git checkout follower >actual &&
- test_i18ngrep "is ahead of" actual
+ test_grep "is ahead of" actual
'
test_expect_success 'checkout (upstream is gone)' '
@@ -96,14 +97,14 @@ test_expect_success 'checkout (upstream is gone)' '
cd test &&
git checkout b5
) >actual &&
- test_i18ngrep "is based on .*, but the upstream is gone." actual
+ test_grep "is based on .*, but the upstream is gone." actual
'
test_expect_success 'checkout (up-to-date with upstream)' '
(
cd test && git checkout b6
) >actual &&
- test_i18ngrep "Your branch is up to date with .origin/main" actual
+ test_grep "Your branch is up to date with .origin/main" actual
'
test_expect_success 'status (diverged from upstream)' '
@@ -113,7 +114,7 @@ test_expect_success 'status (diverged from upstream)' '
# reports nothing to commit
test_must_fail git commit --dry-run
) >actual &&
- test_i18ngrep "have 1 and 1 different" actual
+ test_grep "have 1 and 1 different" actual
'
test_expect_success 'status (upstream is gone)' '
@@ -123,7 +124,7 @@ test_expect_success 'status (upstream is gone)' '
# reports nothing to commit
test_must_fail git commit --dry-run
) >actual &&
- test_i18ngrep "is based on .*, but the upstream is gone." actual
+ test_grep "is based on .*, but the upstream is gone." actual
'
test_expect_success 'status (up-to-date with upstream)' '
@@ -133,7 +134,7 @@ test_expect_success 'status (up-to-date with upstream)' '
# reports nothing to commit
test_must_fail git commit --dry-run
) >actual &&
- test_i18ngrep "Your branch is up to date with .origin/main" actual
+ test_grep "Your branch is up to date with .origin/main" actual
'
cat >expect <<\EOF
@@ -252,7 +253,7 @@ test_expect_success 'fail to track lightweight tags' '
git checkout main &&
git tag light &&
test_must_fail git branch --track lighttrack light >actual &&
- test_i18ngrep ! "set up to track" actual &&
+ test_grep ! "set up to track" actual &&
test_must_fail git checkout lighttrack
'
@@ -260,7 +261,7 @@ test_expect_success 'fail to track annotated tags' '
git checkout main &&
git tag -m heavy heavy &&
test_must_fail git branch --track heavytrack heavy >actual &&
- test_i18ngrep ! "set up to track" actual &&
+ test_grep ! "set up to track" actual &&
test_must_fail git checkout heavytrack
'
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index 2500acc..c6e9b33 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -44,7 +44,7 @@ commit_peeling_shows_parents ()
_parent_number=$(( $_parent_number + 1 ))
done &&
test_must_fail git rev-parse --verify $_commit^$_parent_number 2>err &&
- test_i18ngrep "Needed a single revision" err
+ test_grep "Needed a single revision" err
}
commit_has_parents ()
@@ -62,59 +62,59 @@ HASH6=
HASH7=
test_expect_success 'set up buggy branch' '
- echo "line 1" >>hello &&
- echo "line 2" >>hello &&
- echo "line 3" >>hello &&
- echo "line 4" >>hello &&
- add_and_commit_file hello "4 lines" &&
- HASH1=$(git rev-parse --verify HEAD) &&
- echo "line BUG" >>hello &&
- echo "line 6" >>hello &&
- echo "line 7" >>hello &&
- echo "line 8" >>hello &&
- add_and_commit_file hello "4 more lines with a BUG" &&
- HASH2=$(git rev-parse --verify HEAD) &&
- echo "line 9" >>hello &&
- echo "line 10" >>hello &&
- add_and_commit_file hello "2 more lines" &&
- HASH3=$(git rev-parse --verify HEAD) &&
- echo "line 11" >>hello &&
- add_and_commit_file hello "1 more line" &&
- HASH4=$(git rev-parse --verify HEAD) &&
- sed -e "s/BUG/5/" hello >hello.new &&
- mv hello.new hello &&
- add_and_commit_file hello "BUG fixed" &&
- HASH5=$(git rev-parse --verify HEAD) &&
- echo "line 12" >>hello &&
- echo "line 13" >>hello &&
- add_and_commit_file hello "2 more lines" &&
- HASH6=$(git rev-parse --verify HEAD) &&
- echo "line 14" >>hello &&
- echo "line 15" >>hello &&
- echo "line 16" >>hello &&
- add_and_commit_file hello "again 3 more lines" &&
- HASH7=$(git rev-parse --verify HEAD)
+ echo "line 1" >>hello &&
+ echo "line 2" >>hello &&
+ echo "line 3" >>hello &&
+ echo "line 4" >>hello &&
+ add_and_commit_file hello "4 lines" &&
+ HASH1=$(git rev-parse --verify HEAD) &&
+ echo "line BUG" >>hello &&
+ echo "line 6" >>hello &&
+ echo "line 7" >>hello &&
+ echo "line 8" >>hello &&
+ add_and_commit_file hello "4 more lines with a BUG" &&
+ HASH2=$(git rev-parse --verify HEAD) &&
+ echo "line 9" >>hello &&
+ echo "line 10" >>hello &&
+ add_and_commit_file hello "2 more lines" &&
+ HASH3=$(git rev-parse --verify HEAD) &&
+ echo "line 11" >>hello &&
+ add_and_commit_file hello "1 more line" &&
+ HASH4=$(git rev-parse --verify HEAD) &&
+ sed -e "s/BUG/5/" hello >hello.new &&
+ mv hello.new hello &&
+ add_and_commit_file hello "BUG fixed" &&
+ HASH5=$(git rev-parse --verify HEAD) &&
+ echo "line 12" >>hello &&
+ echo "line 13" >>hello &&
+ add_and_commit_file hello "2 more lines" &&
+ HASH6=$(git rev-parse --verify HEAD) &&
+ echo "line 14" >>hello &&
+ echo "line 15" >>hello &&
+ echo "line 16" >>hello &&
+ add_and_commit_file hello "again 3 more lines" &&
+ HASH7=$(git rev-parse --verify HEAD)
'
test_expect_success 'replace the author' '
- git cat-file commit $HASH2 | grep "author A U Thor" &&
- R=$(git cat-file commit $HASH2 | sed -e "s/A U/O/" | git hash-object -t commit --stdin -w) &&
- git cat-file commit $R | grep "author O Thor" &&
- git update-ref refs/replace/$HASH2 $R &&
- git show HEAD~5 | grep "O Thor" &&
- git show $HASH2 | grep "O Thor"
+ git cat-file commit $HASH2 | grep "author A U Thor" &&
+ R=$(git cat-file commit $HASH2 | sed -e "s/A U/O/" | git hash-object -t commit --stdin -w) &&
+ git cat-file commit $R | grep "author O Thor" &&
+ git update-ref refs/replace/$HASH2 $R &&
+ git show HEAD~5 | grep "O Thor" &&
+ git show $HASH2 | grep "O Thor"
'
test_expect_success 'test --no-replace-objects option' '
- git cat-file commit $HASH2 | grep "author O Thor" &&
- git --no-replace-objects cat-file commit $HASH2 | grep "author A U Thor" &&
- git show $HASH2 | grep "O Thor" &&
- git --no-replace-objects show $HASH2 | grep "A U Thor"
+ git cat-file commit $HASH2 | grep "author O Thor" &&
+ git --no-replace-objects cat-file commit $HASH2 | grep "author A U Thor" &&
+ git show $HASH2 | grep "O Thor" &&
+ git --no-replace-objects show $HASH2 | grep "A U Thor"
'
test_expect_success 'test GIT_NO_REPLACE_OBJECTS env variable' '
- GIT_NO_REPLACE_OBJECTS=1 git cat-file commit $HASH2 | grep "author A U Thor" &&
- GIT_NO_REPLACE_OBJECTS=1 git show $HASH2 | grep "A U Thor"
+ GIT_NO_REPLACE_OBJECTS=1 git cat-file commit $HASH2 | grep "author A U Thor" &&
+ GIT_NO_REPLACE_OBJECTS=1 git show $HASH2 | grep "A U Thor"
'
test_expect_success 'test core.usereplacerefs config option' '
@@ -132,64 +132,64 @@ tagger T A Gger <> 0 +0000
EOF
test_expect_success 'tag replaced commit' '
- git update-ref refs/tags/mytag $(git mktag <tag.sig)
+ git update-ref refs/tags/mytag $(git mktag <tag.sig)
'
test_expect_success '"git fsck" works' '
- git fsck main >fsck_main.out &&
- test_i18ngrep "dangling commit $R" fsck_main.out &&
- test_i18ngrep "dangling tag $(git show-ref -s refs/tags/mytag)" fsck_main.out &&
- test -z "$(git fsck)"
+ git fsck main >fsck_main.out &&
+ test_grep "dangling commit $R" fsck_main.out &&
+ test_grep "dangling tag $(git show-ref -s refs/tags/mytag)" fsck_main.out &&
+ test -z "$(git fsck)"
'
test_expect_success 'repack, clone and fetch work' '
- git repack -a -d &&
- git clone --no-hardlinks . clone_dir &&
- (
- cd clone_dir &&
- git show HEAD~5 | grep "A U Thor" &&
- git show $HASH2 | grep "A U Thor" &&
- git cat-file commit $R &&
- git repack -a -d &&
- test_must_fail git cat-file commit $R &&
- git fetch ../ "refs/replace/*:refs/replace/*" &&
- git show HEAD~5 | grep "O Thor" &&
- git show $HASH2 | grep "O Thor" &&
- git cat-file commit $R
- )
+ git repack -a -d &&
+ git clone --no-hardlinks . clone_dir &&
+ (
+ cd clone_dir &&
+ git show HEAD~5 | grep "A U Thor" &&
+ git show $HASH2 | grep "A U Thor" &&
+ git cat-file commit $R &&
+ git repack -a -d &&
+ test_must_fail git cat-file commit $R &&
+ git fetch ../ "refs/replace/*:refs/replace/*" &&
+ git show HEAD~5 | grep "O Thor" &&
+ git show $HASH2 | grep "O Thor" &&
+ git cat-file commit $R
+ )
'
test_expect_success '"git replace" listing and deleting' '
- test "$HASH2" = "$(git replace -l)" &&
- test "$HASH2" = "$(git replace)" &&
- aa=${HASH2%??????????????????????????????????????} &&
- test "$HASH2" = "$(git replace --list "$aa*")" &&
- test_must_fail git replace -d $R &&
- test_must_fail git replace --delete &&
- test_must_fail git replace -l -d $HASH2 &&
- git replace -d $HASH2 &&
- git show $HASH2 | grep "A U Thor" &&
- test -z "$(git replace -l)"
+ test "$HASH2" = "$(git replace -l)" &&
+ test "$HASH2" = "$(git replace)" &&
+ aa=${HASH2%??????????????????????????????????????} &&
+ test "$HASH2" = "$(git replace --list "$aa*")" &&
+ test_must_fail git replace -d $R &&
+ test_must_fail git replace --delete &&
+ test_must_fail git replace -l -d $HASH2 &&
+ git replace -d $HASH2 &&
+ git show $HASH2 | grep "A U Thor" &&
+ test -z "$(git replace -l)"
'
test_expect_success '"git replace" replacing' '
- git replace $HASH2 $R &&
- git show $HASH2 | grep "O Thor" &&
- test_must_fail git replace $HASH2 $R &&
- git replace -f $HASH2 $R &&
- test_must_fail git replace -f &&
- test "$HASH2" = "$(git replace)"
+ git replace $HASH2 $R &&
+ git show $HASH2 | grep "O Thor" &&
+ test_must_fail git replace $HASH2 $R &&
+ git replace -f $HASH2 $R &&
+ test_must_fail git replace -f &&
+ test "$HASH2" = "$(git replace)"
'
test_expect_success '"git replace" resolves sha1' '
- SHORTHASH2=$(git rev-parse --short=8 $HASH2) &&
- git replace -d $SHORTHASH2 &&
- git replace $SHORTHASH2 $R &&
- git show $HASH2 | grep "O Thor" &&
- test_must_fail git replace $HASH2 $R &&
- git replace -f $HASH2 $R &&
- test_must_fail git replace --force &&
- test "$HASH2" = "$(git replace)"
+ SHORTHASH2=$(git rev-parse --short=8 $HASH2) &&
+ git replace -d $SHORTHASH2 &&
+ git replace $SHORTHASH2 $R &&
+ git show $HASH2 | grep "O Thor" &&
+ test_must_fail git replace $HASH2 $R &&
+ git replace -f $HASH2 $R &&
+ test_must_fail git replace --force &&
+ test "$HASH2" = "$(git replace)"
'
# This creates a side branch where the bug in H2
@@ -207,79 +207,79 @@ test_expect_success '"git replace" resolves sha1' '
# Then we replace H6 with P6.
#
test_expect_success 'create parallel branch without the bug' '
- git replace -d $HASH2 &&
- git show $HASH2 | grep "A U Thor" &&
- git checkout $HASH1 &&
- git cherry-pick $HASH2 &&
- git show $HASH5 | git apply &&
- git commit --amend -m "hello: 4 more lines WITHOUT the bug" hello &&
- PARA2=$(git rev-parse --verify HEAD) &&
- git cherry-pick $HASH3 &&
- PARA3=$(git rev-parse --verify HEAD) &&
- git cherry-pick $HASH4 &&
- PARA4=$(git rev-parse --verify HEAD) &&
- git cherry-pick $HASH6 &&
- PARA6=$(git rev-parse --verify HEAD) &&
- git replace $HASH6 $PARA6 &&
- git checkout main &&
- cur=$(git rev-parse --verify HEAD) &&
- test "$cur" = "$HASH7" &&
- git log --pretty=oneline | grep $PARA2 &&
- git remote add cloned ./clone_dir
+ git replace -d $HASH2 &&
+ git show $HASH2 | grep "A U Thor" &&
+ git checkout $HASH1 &&
+ git cherry-pick $HASH2 &&
+ git show $HASH5 | git apply &&
+ git commit --amend -m "hello: 4 more lines WITHOUT the bug" hello &&
+ PARA2=$(git rev-parse --verify HEAD) &&
+ git cherry-pick $HASH3 &&
+ PARA3=$(git rev-parse --verify HEAD) &&
+ git cherry-pick $HASH4 &&
+ PARA4=$(git rev-parse --verify HEAD) &&
+ git cherry-pick $HASH6 &&
+ PARA6=$(git rev-parse --verify HEAD) &&
+ git replace $HASH6 $PARA6 &&
+ git checkout main &&
+ cur=$(git rev-parse --verify HEAD) &&
+ test "$cur" = "$HASH7" &&
+ git log --pretty=oneline | grep $PARA2 &&
+ git remote add cloned ./clone_dir
'
test_expect_success 'push to cloned repo' '
- git push cloned $HASH6^:refs/heads/parallel &&
- (
- cd clone_dir &&
- git checkout parallel &&
- git log --pretty=oneline | grep $PARA2
- )
+ git push cloned $HASH6^:refs/heads/parallel &&
+ (
+ cd clone_dir &&
+ git checkout parallel &&
+ git log --pretty=oneline | grep $PARA2
+ )
'
test_expect_success 'push branch with replacement' '
- git cat-file commit $PARA3 | grep "author A U Thor" &&
- S=$(git cat-file commit $PARA3 | sed -e "s/A U/O/" | git hash-object -t commit --stdin -w) &&
- git cat-file commit $S | grep "author O Thor" &&
- git replace $PARA3 $S &&
- git show $HASH6~2 | grep "O Thor" &&
- git show $PARA3 | grep "O Thor" &&
- git push cloned $HASH6^:refs/heads/parallel2 &&
- (
- cd clone_dir &&
- git checkout parallel2 &&
- git log --pretty=oneline | grep $PARA3 &&
- git show $PARA3 | grep "A U Thor"
- )
+ git cat-file commit $PARA3 | grep "author A U Thor" &&
+ S=$(git cat-file commit $PARA3 | sed -e "s/A U/O/" | git hash-object -t commit --stdin -w) &&
+ git cat-file commit $S | grep "author O Thor" &&
+ git replace $PARA3 $S &&
+ git show $HASH6~2 | grep "O Thor" &&
+ git show $PARA3 | grep "O Thor" &&
+ git push cloned $HASH6^:refs/heads/parallel2 &&
+ (
+ cd clone_dir &&
+ git checkout parallel2 &&
+ git log --pretty=oneline | grep $PARA3 &&
+ git show $PARA3 | grep "A U Thor"
+ )
'
test_expect_success 'fetch branch with replacement' '
- git branch tofetch $HASH6 &&
- (
- cd clone_dir &&
- git fetch origin refs/heads/tofetch:refs/heads/parallel3 &&
- git log --pretty=oneline parallel3 >output.txt &&
- ! grep $PARA3 output.txt &&
- git show $PARA3 >para3.txt &&
- grep "A U Thor" para3.txt &&
- git fetch origin "refs/replace/*:refs/replace/*" &&
- git log --pretty=oneline parallel3 >output.txt &&
- grep $PARA3 output.txt &&
- git show $PARA3 >para3.txt &&
- grep "O Thor" para3.txt
- )
+ git branch tofetch $HASH6 &&
+ (
+ cd clone_dir &&
+ git fetch origin refs/heads/tofetch:refs/heads/parallel3 &&
+ git log --pretty=oneline parallel3 >output.txt &&
+ ! grep $PARA3 output.txt &&
+ git show $PARA3 >para3.txt &&
+ grep "A U Thor" para3.txt &&
+ git fetch origin "refs/replace/*:refs/replace/*" &&
+ git log --pretty=oneline parallel3 >output.txt &&
+ grep $PARA3 output.txt &&
+ git show $PARA3 >para3.txt &&
+ grep "O Thor" para3.txt
+ )
'
test_expect_success 'bisect and replacements' '
- git bisect start $HASH7 $HASH1 &&
- test "$PARA3" = "$(git rev-parse --verify HEAD)" &&
- git bisect reset &&
- GIT_NO_REPLACE_OBJECTS=1 git bisect start $HASH7 $HASH1 &&
- test "$HASH4" = "$(git rev-parse --verify HEAD)" &&
- git bisect reset &&
- git --no-replace-objects bisect start $HASH7 $HASH1 &&
- test "$HASH4" = "$(git rev-parse --verify HEAD)" &&
- git bisect reset
+ git bisect start $HASH7 $HASH1 &&
+ test "$PARA3" = "$(git rev-parse --verify HEAD)" &&
+ git bisect reset &&
+ GIT_NO_REPLACE_OBJECTS=1 git bisect start $HASH7 $HASH1 &&
+ test "$HASH4" = "$(git rev-parse --verify HEAD)" &&
+ git bisect reset &&
+ git --no-replace-objects bisect start $HASH7 $HASH1 &&
+ test "$HASH4" = "$(git rev-parse --verify HEAD)" &&
+ git bisect reset
'
test_expect_success 'index-pack and replacements' '
@@ -490,9 +490,9 @@ test_expect_success '--convert-graft-file' '
$(git rev-parse HEAD^^ HEAD^ HEAD^^ HEAD^2) \
>.git/info/grafts &&
git status 2>stderr &&
- test_i18ngrep "hint:.*grafts is deprecated" stderr &&
+ test_grep "hint:.*grafts is deprecated" stderr &&
git replace --convert-graft-file 2>stderr &&
- test_i18ngrep ! "hint:.*grafts is deprecated" stderr &&
+ test_grep ! "hint:.*grafts is deprecated" stderr &&
test_path_is_missing .git/info/grafts &&
: verify that the history is now "grafted" &&
@@ -503,8 +503,8 @@ test_expect_success '--convert-graft-file' '
test_when_finished "rm -f .git/info/grafts" &&
echo $EMPTY_BLOB $EMPTY_TREE >.git/info/grafts &&
test_must_fail git replace --convert-graft-file 2>err &&
- test_i18ngrep "$EMPTY_BLOB $EMPTY_TREE" err &&
- test_i18ngrep "$EMPTY_BLOB $EMPTY_TREE" .git/info/grafts
+ test_grep "$EMPTY_BLOB $EMPTY_TREE" err &&
+ test_grep "$EMPTY_BLOB $EMPTY_TREE" .git/info/grafts
'
test_done
diff --git a/t/t6060-merge-index.sh b/t/t6060-merge-index.sh
index ed449ab..1a8b64c 100755
--- a/t/t6060-merge-index.sh
+++ b/t/t6060-merge-index.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='basic git merge-index / git-merge-one-file tests'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup diverging branches' '
diff --git a/t/t6101-rev-parse-parents.sh b/t/t6101-rev-parse-parents.sh
index a3a41c7..d20723d 100755
--- a/t/t6101-rev-parse-parents.sh
+++ b/t/t6101-rev-parse-parents.sh
@@ -9,6 +9,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
TEST_PASSES_SANITIZE_LEAK=true
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
test_cmp_rev_output () {
@@ -26,6 +27,7 @@ test_expect_success 'setup' '
git merge -m next --allow-unrelated-histories start2 &&
test_commit final &&
+ mkdir .git/info &&
test_seq 40 |
while read i
do
diff --git a/t/t6102-rev-list-unexpected-objects.sh b/t/t6102-rev-list-unexpected-objects.sh
index cf0195e..5d28507 100755
--- a/t/t6102-rev-list-unexpected-objects.sh
+++ b/t/t6102-rev-list-unexpected-objects.sh
@@ -17,7 +17,7 @@ test_expect_success 'setup unexpected non-blob entry' '
broken_tree="$(git hash-object -w --literally -t tree broken-tree)"
'
-test_expect_success !SANITIZE_LEAK 'TODO (should fail!): traverse unexpected non-blob entry (lone)' '
+test_expect_success 'TODO (should fail!): traverse unexpected non-blob entry (lone)' '
sed "s/Z$//" >expect <<-EOF &&
$broken_tree Z
$tree foo
@@ -28,7 +28,7 @@ test_expect_success !SANITIZE_LEAK 'TODO (should fail!): traverse unexpected non
test_expect_success 'traverse unexpected non-blob entry (seen)' '
test_must_fail git rev-list --objects $tree $broken_tree >output 2>&1 &&
- test_i18ngrep "is not a blob" output
+ test_grep "is not a blob" output
'
test_expect_success 'setup unexpected non-tree entry' '
@@ -42,7 +42,7 @@ test_expect_success 'traverse unexpected non-tree entry (lone)' '
test_expect_success 'traverse unexpected non-tree entry (seen)' '
test_must_fail git rev-list --objects $blob $broken_tree >output 2>&1 &&
- test_i18ngrep "is not a tree" output
+ test_grep "is not a tree" output
'
test_expect_success 'setup unexpected non-commit parent' '
@@ -54,13 +54,13 @@ test_expect_success 'setup unexpected non-commit parent' '
test_expect_success 'traverse unexpected non-commit parent (lone)' '
test_must_fail git rev-list --objects $broken_commit >output 2>&1 &&
- test_i18ngrep "not a commit" output
+ test_grep "not a commit" output
'
test_expect_success 'traverse unexpected non-commit parent (seen)' '
test_must_fail git rev-list --objects $blob $broken_commit \
>output 2>&1 &&
- test_i18ngrep "not a commit" output
+ test_grep "not a commit" output
'
test_expect_success 'setup unexpected non-tree root' '
@@ -76,7 +76,7 @@ test_expect_success 'traverse unexpected non-tree root (lone)' '
test_expect_success 'traverse unexpected non-tree root (seen)' '
test_must_fail git rev-list --objects $blob $broken_commit \
>output 2>&1 &&
- test_i18ngrep "not a tree" output
+ test_grep "not a tree" output
'
test_expect_success 'setup unexpected non-commit tag' '
@@ -93,7 +93,7 @@ test_expect_success 'traverse unexpected non-commit tag (lone)' '
test_expect_success 'traverse unexpected non-commit tag (seen)' '
test_must_fail git rev-list --objects $blob $tag >output 2>&1 &&
- test_i18ngrep "not a commit" output
+ test_grep "not a commit" output
'
test_expect_success 'setup unexpected non-tree tag' '
@@ -110,7 +110,7 @@ test_expect_success 'traverse unexpected non-tree tag (lone)' '
test_expect_success 'traverse unexpected non-tree tag (seen)' '
test_must_fail git rev-list --objects $blob $tag >output 2>&1 &&
- test_i18ngrep "not a tree" output
+ test_grep "not a tree" output
'
test_expect_success 'setup unexpected non-blob tag' '
@@ -121,13 +121,13 @@ test_expect_success 'setup unexpected non-blob tag' '
tag=$(git hash-object -w --literally -t tag broken-tag)
'
-test_expect_success !SANITIZE_LEAK 'TODO (should fail!): traverse unexpected non-blob tag (lone)' '
- git rev-list --objects $tag
+test_expect_success 'traverse unexpected non-blob tag (lone)' '
+ test_must_fail git rev-list --objects $tag
'
test_expect_success 'traverse unexpected non-blob tag (seen)' '
test_must_fail git rev-list --objects $commit $tag >output 2>&1 &&
- test_i18ngrep "not a blob" output
+ test_grep "not a blob" output
'
test_done
diff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh
index 8d9d660..43e1afd 100755
--- a/t/t6112-rev-list-filters-objects.sh
+++ b/t/t6112-rev-list-filters-objects.sh
@@ -457,7 +457,7 @@ expect_invalid_filter_spec () {
test_must_fail git -C r3 rev-list --objects --filter="$spec" HEAD \
>actual 2>actual_stderr &&
test_must_be_empty actual &&
- test_i18ngrep "$err" actual_stderr
+ test_grep "$err" actual_stderr
}
test_expect_success 'combine:... while URL-encoding things that should not be' '
@@ -670,7 +670,7 @@ test_expect_success 'rev-list W/ --missing=print' '
awk -f print_2.awk ls_files_result |
sort >expected &&
- for id in `cat expected | sed "s|..|&/|"`
+ for id in `sed "s|..|&/|" expected`
do
rm r1/.git/objects/$id || return 1
done &&
diff --git a/t/t6113-rev-list-bitmap-filters.sh b/t/t6113-rev-list-bitmap-filters.sh
index 4d8e091..a9656a1 100755
--- a/t/t6113-rev-list-bitmap-filters.sh
+++ b/t/t6113-rev-list-bitmap-filters.sh
@@ -1,9 +1,12 @@
#!/bin/sh
test_description='rev-list combining bitmaps and filters'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-bitmap.sh
+
test_expect_success 'set up bitmapped repo' '
# one commit will have bitmaps, the other will not
test_commit one &&
@@ -141,4 +144,17 @@ test_expect_success 'combine filter with --filter-provided-objects' '
done <objects
'
+test_expect_success 'bitmap traversal with --unpacked' '
+ git repack -adb &&
+ test_commit unpacked &&
+
+ git rev-list --objects --no-object-names unpacked^.. >expect.raw &&
+ sort expect.raw >expect &&
+
+ git rev-list --use-bitmap-index --objects --all --unpacked >actual.raw &&
+ sort actual.raw >actual &&
+
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t6115-rev-list-du.sh b/t/t6115-rev-list-du.sh
index b4aef32..c0cfda6 100755
--- a/t/t6115-rev-list-du.sh
+++ b/t/t6115-rev-list-du.sh
@@ -48,4 +48,33 @@ check_du HEAD
check_du --objects HEAD
check_du --objects HEAD^..HEAD
+test_expect_success 'setup for --unpacked tests' '
+ git repack -adb &&
+ test_commit unpacked
+'
+
+check_du --all --objects --unpacked
+
+# As mentioned above, don't use hardcode sizes as actual size, but use the
+# output from git cat-file.
+test_expect_success 'rev-list --disk-usage=human' '
+ git rev-list --objects HEAD --disk-usage=human >actual &&
+ disk_usage_slow --objects HEAD >actual_size &&
+ grep "$(cat actual_size) bytes" actual
+'
+
+test_expect_success 'rev-list --disk-usage=human with bitmaps' '
+ git rev-list --objects HEAD --use-bitmap-index --disk-usage=human >actual &&
+ disk_usage_slow --objects HEAD >actual_size &&
+ grep "$(cat actual_size) bytes" actual
+'
+
+test_expect_success 'rev-list use --disk-usage unproperly' '
+ test_must_fail git rev-list --objects HEAD --disk-usage=typo 2>err &&
+ cat >expect <<-\EOF &&
+ fatal: invalid value for '\''--disk-usage=<format>'\'': '\''typo'\'', the only allowed format is '\''human'\''
+ EOF
+ test_cmp err expect
+'
+
test_done
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index 9a35e78..e78315d 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -85,6 +85,7 @@ check_describe e-1-gHASH --tags HEAD^^
check_describe c-2-gHASH --tags HEAD^^2
check_describe B --tags HEAD^^2^
check_describe e --tags HEAD^^^
+check_describe e --tags --exact-match HEAD^^^
check_describe heads/main --all HEAD
check_describe tags/c-6-gHASH --all HEAD^
@@ -96,6 +97,13 @@ check_describe A-3-gHASH --long HEAD^^2
check_describe c-7-gHASH --tags
check_describe e-3-gHASH --first-parent --tags
+check_describe c-7-gHASH --tags --no-exact-match HEAD
+check_describe e-3-gHASH --first-parent --tags --no-exact-match HEAD
+
+test_expect_success '--exact-match failure' '
+ test_must_fail git describe --exact-match HEAD 2>err
+'
+
test_expect_success 'describe --contains defaults to HEAD without commit-ish' '
echo "A^0" >expect &&
git checkout A &&
@@ -384,7 +392,7 @@ test_expect_success 'describe directly tagged blob' '
test_expect_success 'describe tag object' '
git tag test-blob-1 -a -m msg unique-file:file &&
test_must_fail git describe test-blob-1 2>actual &&
- test_i18ngrep "fatal: test-blob-1 is neither a commit nor blob" actual
+ test_grep "fatal: test-blob-1 is neither a commit nor blob" actual
'
test_expect_success ULIMIT_STACK_SIZE 'name-rev works in a deep repo' '
@@ -657,4 +665,10 @@ test_expect_success 'setup: describe commits with disjoint bases 2' '
check_describe -C disjoint2 "B-3-gHASH" 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
+'
+
+check_describe newer-tag-older-commit~1 --contains unique-file~2
+
test_done
diff --git a/t/t6134-pathspec-in-submodule.sh b/t/t6134-pathspec-in-submodule.sh
index 0f1cb49..16ce4cf 100755
--- a/t/t6134-pathspec-in-submodule.sh
+++ b/t/t6134-pathspec-in-submodule.sh
@@ -2,6 +2,7 @@
test_description='test case exclude pathspec'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup a submodule' '
@@ -9,7 +10,7 @@ test_expect_success 'setup a submodule' '
: >pretzel/a &&
git -C pretzel add a &&
git -C pretzel commit -m "add a file" -- a &&
- git submodule add ./pretzel sub &&
+ git -c protocol.file.allow=always submodule add ./pretzel sub &&
git commit -a -m "add submodule" &&
git submodule deinit --all
'
@@ -26,7 +27,7 @@ test_expect_success 'error message for path inside submodule' '
test_expect_success 'error message for path inside submodule from within submodule' '
test_must_fail git -C sub add . 2>actual &&
- test_i18ngrep "in unpopulated submodule" actual
+ test_grep "in unpopulated submodule" actual
'
test_done
diff --git a/t/t6135-pathspec-with-attrs.sh b/t/t6135-pathspec-with-attrs.sh
index 457cc16..120dcd7 100755
--- a/t/t6135-pathspec-with-attrs.sh
+++ b/t/t6135-pathspec-with-attrs.sh
@@ -64,11 +64,24 @@ test_expect_success 'setup .gitattributes' '
fileSetLabel label
fileValue label=foo
fileWrongLabel label☺
+ newFileA* labelA
+ newFileB* labelB
EOF
- git add .gitattributes &&
+ echo fileSetLabel label1 >sub/.gitattributes &&
+ git add .gitattributes sub/.gitattributes &&
git commit -m "add attributes"
'
+test_expect_success 'setup .gitignore' '
+ cat <<-\EOF >.gitignore &&
+ actual
+ expect
+ pathspec_file
+ EOF
+ git add .gitignore &&
+ git commit -m "add gitignore"
+'
+
test_expect_success 'check specific set attr' '
cat <<-\EOF >expect &&
fileSetLabel
@@ -78,7 +91,17 @@ test_expect_success 'check specific set attr' '
test_cmp expect actual
'
-test_expect_success 'check specific set attr (2)' '
+test_expect_success 'check set attr with pathspec pattern' '
+ echo sub/fileSetLabel >expect &&
+
+ git ls-files ":(attr:label)sub" >actual &&
+ test_cmp expect actual &&
+
+ git ls-files ":(attr:label)sub/" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'check specific set attr in tree-ish' '
cat <<-\EOF >expect &&
HEAD:fileSetLabel
HEAD:sub/fileSetLabel
@@ -87,6 +110,16 @@ test_expect_success 'check specific set attr (2)' '
test_cmp expect actual
'
+test_expect_success 'check specific set attr with pathspec pattern in tree-ish' '
+ echo HEAD:sub/fileSetLabel >expect &&
+
+ git grep -l content HEAD ":(attr:label)sub" >actual &&
+ test_cmp expect actual &&
+
+ git grep -l content HEAD ":(attr:label)sub/" >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'check specific unset attr' '
cat <<-\EOF >expect &&
fileUnsetLabel
@@ -129,6 +162,7 @@ test_expect_success 'check specific value attr (2)' '
test_expect_success 'check unspecified attr' '
cat <<-\EOF >expect &&
.gitattributes
+ .gitignore
fileA
fileAB
fileAC
@@ -137,6 +171,7 @@ test_expect_success 'check unspecified attr' '
fileC
fileNoLabel
fileWrongLabel
+ sub/.gitattributes
sub/fileA
sub/fileAB
sub/fileAC
@@ -153,6 +188,7 @@ test_expect_success 'check unspecified attr' '
test_expect_success 'check unspecified attr (2)' '
cat <<-\EOF >expect &&
HEAD:.gitattributes
+ HEAD:.gitignore
HEAD:fileA
HEAD:fileAB
HEAD:fileAC
@@ -161,6 +197,7 @@ test_expect_success 'check unspecified attr (2)' '
HEAD:fileC
HEAD:fileNoLabel
HEAD:fileWrongLabel
+ HEAD:sub/.gitattributes
HEAD:sub/fileA
HEAD:sub/fileAB
HEAD:sub/fileAC
@@ -177,9 +214,11 @@ test_expect_success 'check unspecified attr (2)' '
test_expect_success 'check multiple unspecified attr' '
cat <<-\EOF >expect &&
.gitattributes
+ .gitignore
fileC
fileNoLabel
fileWrongLabel
+ sub/.gitattributes
sub/fileC
sub/fileNoLabel
sub/fileWrongLabel
@@ -212,17 +251,100 @@ test_expect_success 'check label excluding other labels' '
test_expect_success 'fail on multiple attr specifiers in one pathspec item' '
test_must_fail git ls-files . ":(attr:labelB,attr:labelC)" 2>actual &&
- test_i18ngrep "Only one" actual
+ test_grep "Only one" actual
'
-test_expect_success 'fail if attr magic is used places not implemented' '
+test_expect_success 'fail if attr magic is used in places not implemented' '
# The main purpose of this test is to check that we actually fail
# when you attempt to use attr magic in commands that do not implement
- # attr magic. This test does not advocate git-add to stay that way,
- # though, but git-add is convenient as it has its own internal pathspec
- # parsing.
- test_must_fail git add ":(attr:labelB)" 2>actual &&
- test_i18ngrep "magic not supported" actual
+ # attr magic. This test does not advocate check-ignore to stay that way.
+ # When you teach the command to grok the pathspec, you need to find
+ # another command to replace it for the test.
+ test_must_fail git check-ignore ":(attr:labelB)" 2>actual &&
+ test_grep "magic not supported" actual
+'
+
+test_expect_success 'check that attr magic works for git stash push' '
+ cat <<-\EOF >expect &&
+ A sub/newFileA-foo
+ EOF
+ >sub/newFileA-foo &&
+ >sub/newFileB-foo &&
+ git stash push --include-untracked -- ":(exclude,attr:labelB)" &&
+ git stash show --include-untracked --name-status >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'check that attr magic works for git add --all' '
+ cat <<-\EOF >expect &&
+ sub/newFileA-foo
+ EOF
+ >sub/newFileA-foo &&
+ >sub/newFileB-foo &&
+ git add --all ":(exclude,attr:labelB)" &&
+ git diff --name-only --cached >actual &&
+ git restore -W -S . &&
+ test_cmp expect actual
+'
+
+test_expect_success 'check that attr magic works for git add -u' '
+ cat <<-\EOF >expect &&
+ sub/fileA
+ EOF
+ >sub/newFileA-foo &&
+ >sub/newFileB-foo &&
+ >sub/fileA &&
+ >sub/fileB &&
+ git add -u ":(exclude,attr:labelB)" &&
+ git diff --name-only --cached >actual &&
+ git restore -S -W . && rm sub/new* &&
+ test_cmp expect actual
+'
+
+test_expect_success 'check that attr magic works for git add <path>' '
+ cat <<-\EOF >expect &&
+ fileA
+ fileB
+ sub/fileA
+ EOF
+ >fileA &&
+ >fileB &&
+ >sub/fileA &&
+ >sub/fileB &&
+ git add ":(exclude,attr:labelB)sub/*" &&
+ git diff --name-only --cached >actual &&
+ git restore -S -W . &&
+ test_cmp expect actual
+'
+
+test_expect_success 'check that attr magic works for git -add .' '
+ cat <<-\EOF >expect &&
+ sub/fileA
+ EOF
+ >fileA &&
+ >fileB &&
+ >sub/fileA &&
+ >sub/fileB &&
+ cd sub &&
+ git add . ":(exclude,attr:labelB)" &&
+ cd .. &&
+ git diff --name-only --cached >actual &&
+ git restore -S -W . &&
+ test_cmp expect actual
+'
+
+test_expect_success 'check that attr magic works for git add --pathspec-from-file' '
+ cat <<-\EOF >pathspec_file &&
+ :(exclude,attr:labelB)
+ EOF
+ cat <<-\EOF >expect &&
+ sub/newFileA-foo
+ EOF
+ >sub/newFileA-foo &&
+ >sub/newFileB-foo &&
+ git add --all --pathspec-from-file=pathspec_file &&
+ git diff --name-only --cached >actual &&
+ test_cmp expect actual
'
test_expect_success 'abort on giving invalid label on the command line' '
@@ -245,12 +367,57 @@ test_expect_success 'check attribute list' '
test_expect_success 'backslash cannot be the last character' '
test_must_fail git ls-files ":(attr:label=foo\\ labelA=bar)" 2>actual &&
- test_i18ngrep "not allowed as last character in attr value" actual
+ test_grep "not allowed as last character in attr value" actual
'
test_expect_success 'backslash cannot be used as a value' '
test_must_fail git ls-files ":(attr:label=f\\\oo)" 2>actual &&
- test_i18ngrep "for value matching" actual
+ test_grep "for value matching" actual
+'
+
+test_expect_success 'reading from .gitattributes in a subdirectory (1)' '
+ git ls-files ":(attr:label1)" >actual &&
+ test_write_lines "sub/fileSetLabel" >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'reading from .gitattributes in a subdirectory (2)' '
+ git ls-files ":(attr:label1)sub" >actual &&
+ test_write_lines "sub/fileSetLabel" >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'reading from .gitattributes in a subdirectory (3)' '
+ git ls-files ":(attr:label1)sub/" >actual &&
+ test_write_lines "sub/fileSetLabel" >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success POSIXPERM 'pathspec with builtin_objectmode attr can be used' '
+ >mode_exec_file_1 &&
+
+ git status -s ":(attr:builtin_objectmode=100644)mode_exec_*" >actual &&
+ echo ?? mode_exec_file_1 >expect &&
+ test_cmp expect actual &&
+
+ git add mode_exec_file_1 &&
+ chmod +x mode_exec_file_1 &&
+ git status -s ":(attr:builtin_objectmode=100755)mode_exec_*" >actual &&
+ echo AM mode_exec_file_1 >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success POSIXPERM 'builtin_objectmode attr can be excluded' '
+ >mode_1_regular &&
+ >mode_1_exec &&
+ chmod +x mode_1_exec &&
+ git status -s ":(exclude,attr:builtin_objectmode=100644)" "mode_1_*" >actual &&
+ echo ?? mode_1_exec >expect &&
+ test_cmp expect actual &&
+
+ git status -s ":(exclude,attr:builtin_objectmode=100755)" "mode_1_*" >actual &&
+ echo ?? mode_1_regular >expect &&
+ test_cmp expect actual
'
test_done
diff --git a/t/t6136-pathspec-in-bare.sh b/t/t6136-pathspec-in-bare.sh
index ae8b537..2db37a6 100755
--- a/t/t6136-pathspec-in-bare.sh
+++ b/t/t6136-pathspec-in-bare.sh
@@ -15,11 +15,11 @@ test_expect_success 'log and ls-files in a bare repository' '
cd bare &&
test_must_fail git log -- .. >out 2>err &&
test_must_be_empty out &&
- test_i18ngrep "outside repository" err &&
+ test_grep "outside repository" err &&
test_must_fail git ls-files -- .. >out 2>err &&
test_must_be_empty out &&
- test_i18ngrep "outside repository" err
+ test_grep "outside repository" err
)
'
@@ -28,11 +28,11 @@ test_expect_success 'log and ls-files in .git directory' '
cd .git &&
test_must_fail git log -- .. >out 2>err &&
test_must_be_empty out &&
- test_i18ngrep "outside repository" err &&
+ test_grep "outside repository" err &&
test_must_fail git ls-files -- .. >out 2>err &&
test_must_be_empty out &&
- test_i18ngrep "outside repository" err
+ test_grep "outside repository" err
)
'
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index dcaab72..eb6c820 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -6,6 +6,7 @@
test_description='for-each-ref test'
. ./test-lib.sh
+GNUPGHOME_NOT_USED=$GNUPGHOME
. "$TEST_DIRECTORY"/lib-gpg.sh
. "$TEST_DIRECTORY"/lib-terminal.sh
@@ -19,11 +20,19 @@ setdate_and_increment () {
export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
}
+test_object_file_size () {
+ oid=$(git rev-parse "$1")
+ path=".git/objects/$(test_oid_to_path $oid)"
+ test_file_size "$path"
+}
+
test_expect_success setup '
- test_oid_cache <<-EOF &&
- disklen sha1:138
- disklen sha256:154
+ # setup .mailmap
+ cat >.mailmap <<-EOF &&
+ A Thor <athor@example.com> A U Thor <author@example.com>
+ C Mitter <cmitter@example.com> C O Mitter <committer@example.com>
EOF
+
setdate_and_increment &&
echo "Using $datestamp" > one &&
git add one &&
@@ -40,25 +49,29 @@ test_expect_success setup '
git config push.default current
'
-test_atom() {
+test_atom () {
case "$1" in
head) ref=refs/heads/main ;;
tag) ref=refs/tags/testtag ;;
sym) ref=refs/heads/sym ;;
*) ref=$1 ;;
esac
+ format=$2
+ test_do=test_expect_${4:-success}
+
printf '%s\n' "$3" >expected
- test_expect_${4:-success} $PREREQ "basic atom: $1 $2" "
- git for-each-ref --format='%($2)' $ref >actual &&
+ $test_do $PREREQ "basic atom: $ref $format" '
+ git for-each-ref --format="%($format)" "$ref" >actual &&
sanitize_pgp <actual >actual.clean &&
test_cmp expected actual.clean
- "
+ '
+
# Automatically test "contents:size" atom after testing "contents"
- if test "$2" = "contents"
+ if test "$format" = "contents"
then
# for commit leg, $3 is changed there
expect=$(printf '%s' "$3" | wc -c)
- test_expect_${4:-success} $PREREQ "basic atom: $1 contents:size" '
+ $test_do $PREREQ "basic atom: $ref contents:size" '
type=$(git cat-file -t "$ref") &&
case $type in
tag)
@@ -82,7 +95,6 @@ test_atom() {
}
hexlen=$(test_oid hexsz)
-disklen=$(test_oid disklen)
test_atom head refname refs/heads/main
test_atom head refname: refs/heads/main
@@ -117,7 +129,7 @@ test_atom head push:strip=1 remotes/myfork/main
test_atom head push:strip=-1 main
test_atom head objecttype commit
test_atom head objectsize $((131 + hexlen))
-test_atom head objectsize:disk $disklen
+test_atom head objectsize:disk $(test_object_file_size refs/heads/main)
test_atom head deltabase $ZERO_OID
test_atom head objectname $(git rev-parse refs/heads/main)
test_atom head objectname:short $(git rev-parse --short refs/heads/main)
@@ -140,15 +152,31 @@ test_atom head '*objectname' ''
test_atom head '*objecttype' ''
test_atom head author 'A U Thor <author@example.com> 1151968724 +0200'
test_atom head authorname 'A U Thor'
+test_atom head authorname:mailmap 'A Thor'
test_atom head authoremail '<author@example.com>'
test_atom head authoremail:trim 'author@example.com'
test_atom head authoremail:localpart 'author'
+test_atom head authoremail:trim,localpart 'author'
+test_atom head authoremail:mailmap '<athor@example.com>'
+test_atom head authoremail:mailmap,trim 'athor@example.com'
+test_atom head authoremail:trim,mailmap 'athor@example.com'
+test_atom head authoremail:mailmap,localpart 'athor'
+test_atom head authoremail:localpart,mailmap 'athor'
+test_atom head authoremail:mailmap,trim,localpart,mailmap,trim 'athor'
test_atom head authordate 'Tue Jul 4 01:18:44 2006 +0200'
test_atom head committer 'C O Mitter <committer@example.com> 1151968723 +0200'
test_atom head committername 'C O Mitter'
+test_atom head committername:mailmap 'C Mitter'
test_atom head committeremail '<committer@example.com>'
test_atom head committeremail:trim 'committer@example.com'
test_atom head committeremail:localpart 'committer'
+test_atom head committeremail:localpart,trim 'committer'
+test_atom head committeremail:mailmap '<cmitter@example.com>'
+test_atom head committeremail:mailmap,trim 'cmitter@example.com'
+test_atom head committeremail:trim,mailmap 'cmitter@example.com'
+test_atom head committeremail:mailmap,localpart 'cmitter'
+test_atom head committeremail:localpart,mailmap 'cmitter'
+test_atom head committeremail:trim,mailmap,trim,trim,localpart 'cmitter'
test_atom head committerdate 'Tue Jul 4 01:18:43 2006 +0200'
test_atom head tag ''
test_atom head tagger ''
@@ -175,8 +203,8 @@ test_atom tag upstream ''
test_atom tag push ''
test_atom tag objecttype tag
test_atom tag objectsize $((114 + hexlen))
-test_atom tag objectsize:disk $disklen
-test_atom tag '*objectsize:disk' $disklen
+test_atom tag objectsize:disk $(test_object_file_size refs/tags/testtag)
+test_atom tag '*objectsize:disk' $(test_object_file_size refs/heads/main)
test_atom tag deltabase $ZERO_OID
test_atom tag '*deltabase' $ZERO_OID
test_atom tag objectname $(git rev-parse refs/tags/testtag)
@@ -198,22 +226,46 @@ test_atom tag '*objectname' $(git rev-parse refs/tags/testtag^{})
test_atom tag '*objecttype' 'commit'
test_atom tag author ''
test_atom tag authorname ''
+test_atom tag authorname:mailmap ''
test_atom tag authoremail ''
test_atom tag authoremail:trim ''
test_atom tag authoremail:localpart ''
+test_atom tag authoremail:trim,localpart ''
+test_atom tag authoremail:mailmap ''
+test_atom tag authoremail:mailmap,trim ''
+test_atom tag authoremail:trim,mailmap ''
+test_atom tag authoremail:mailmap,localpart ''
+test_atom tag authoremail:localpart,mailmap ''
+test_atom tag authoremail:mailmap,trim,localpart,mailmap,trim ''
test_atom tag authordate ''
test_atom tag committer ''
test_atom tag committername ''
+test_atom tag committername:mailmap ''
test_atom tag committeremail ''
test_atom tag committeremail:trim ''
test_atom tag committeremail:localpart ''
+test_atom tag committeremail:localpart,trim ''
+test_atom tag committeremail:mailmap ''
+test_atom tag committeremail:mailmap,trim ''
+test_atom tag committeremail:trim,mailmap ''
+test_atom tag committeremail:mailmap,localpart ''
+test_atom tag committeremail:localpart,mailmap ''
+test_atom tag committeremail:trim,mailmap,trim,trim,localpart ''
test_atom tag committerdate ''
test_atom tag tag 'testtag'
test_atom tag tagger 'C O Mitter <committer@example.com> 1151968725 +0200'
test_atom tag taggername 'C O Mitter'
+test_atom tag taggername:mailmap 'C Mitter'
test_atom tag taggeremail '<committer@example.com>'
test_atom tag taggeremail:trim 'committer@example.com'
test_atom tag taggeremail:localpart 'committer'
+test_atom tag taggeremail:trim,localpart 'committer'
+test_atom tag taggeremail:mailmap '<cmitter@example.com>'
+test_atom tag taggeremail:mailmap,trim 'cmitter@example.com'
+test_atom tag taggeremail:trim,mailmap 'cmitter@example.com'
+test_atom tag taggeremail:mailmap,localpart 'cmitter'
+test_atom tag taggeremail:localpart,mailmap 'cmitter'
+test_atom tag taggeremail:trim,mailmap,trim,localpart,localpart 'cmitter'
test_atom tag taggerdate 'Tue Jul 4 01:18:45 2006 +0200'
test_atom tag creator 'C O Mitter <committer@example.com> 1151968725 +0200'
test_atom tag creatordate 'Tue Jul 4 01:18:45 2006 +0200'
@@ -266,6 +318,66 @@ test_expect_success 'arguments to %(objectname:short=) must be positive integers
test_must_fail git for-each-ref --format="%(objectname:short=foo)"
'
+test_bad_atom () {
+ case "$1" in
+ head) ref=refs/heads/main ;;
+ tag) ref=refs/tags/testtag ;;
+ sym) ref=refs/heads/sym ;;
+ *) ref=$1 ;;
+ esac
+ format=$2
+ test_do=test_expect_${4:-success}
+
+ printf '%s\n' "$3" >expect
+ $test_do $PREREQ "err basic atom: $ref $format" '
+ test_must_fail git for-each-ref \
+ --format="%($format)" "$ref" 2>error &&
+ test_cmp expect error
+ '
+}
+
+test_bad_atom head 'authoremail:foo' \
+ 'fatal: unrecognized %(authoremail) argument: foo'
+
+test_bad_atom head 'authoremail:mailmap,trim,bar' \
+ 'fatal: unrecognized %(authoremail) argument: bar'
+
+test_bad_atom head 'authoremail:trim,' \
+ 'fatal: unrecognized %(authoremail) argument: '
+
+test_bad_atom head 'authoremail:mailmaptrim' \
+ 'fatal: unrecognized %(authoremail) argument: trim'
+
+test_bad_atom head 'committeremail: ' \
+ 'fatal: unrecognized %(committeremail) argument: '
+
+test_bad_atom head 'committeremail: trim,foo' \
+ 'fatal: unrecognized %(committeremail) argument: trim,foo'
+
+test_bad_atom head 'committeremail:mailmap,localpart ' \
+ 'fatal: unrecognized %(committeremail) argument: '
+
+test_bad_atom head 'committeremail:trim_localpart' \
+ 'fatal: unrecognized %(committeremail) argument: _localpart'
+
+test_bad_atom head 'committeremail:localpart,,,trim' \
+ 'fatal: unrecognized %(committeremail) argument: ,,trim'
+
+test_bad_atom tag 'taggeremail:mailmap,trim, foo ' \
+ 'fatal: unrecognized %(taggeremail) argument: foo '
+
+test_bad_atom tag 'taggeremail:trim,localpart,' \
+ 'fatal: unrecognized %(taggeremail) argument: '
+
+test_bad_atom tag 'taggeremail:mailmap;localpart trim' \
+ 'fatal: unrecognized %(taggeremail) argument: ;localpart trim'
+
+test_bad_atom tag 'taggeremail:localpart trim' \
+ 'fatal: unrecognized %(taggeremail) argument: trim'
+
+test_bad_atom tag 'taggeremail:mailmap,mailmap,trim,qux,localpart,trim' \
+ 'fatal: unrecognized %(taggeremail) argument: qux,localpart,trim'
+
test_date () {
f=$1 &&
committer_date=$2 &&
@@ -448,6 +560,41 @@ test_expect_success 'exercise glob patterns with prefixes' '
'
cat >expected <<\EOF
+refs/tags/bar
+refs/tags/baz
+refs/tags/testtag
+EOF
+
+test_expect_success 'exercise patterns with prefix exclusions' '
+ for tag in foo/one foo/two foo/three bar baz
+ do
+ git tag "$tag" || return 1
+ done &&
+ test_when_finished "git tag -d foo/one foo/two foo/three bar baz" &&
+ git for-each-ref --format="%(refname)" \
+ refs/tags/ --exclude=refs/tags/foo >actual &&
+ test_cmp expected actual
+'
+
+cat >expected <<\EOF
+refs/tags/bar
+refs/tags/baz
+refs/tags/foo/one
+refs/tags/testtag
+EOF
+
+test_expect_success 'exercise patterns with pattern exclusions' '
+ for tag in foo/one foo/two foo/three bar baz
+ do
+ git tag "$tag" || return 1
+ done &&
+ test_when_finished "git tag -d foo/one foo/two foo/three bar baz" &&
+ git for-each-ref --format="%(refname)" \
+ refs/tags/ --exclude="refs/tags/foo/t*" >actual &&
+ test_cmp expected actual
+'
+
+cat >expected <<\EOF
'refs/heads/main'
'refs/remotes/origin/main'
'refs/tags/testtag'
@@ -561,6 +708,144 @@ test_expect_success 'color.ui=always does not override tty check' '
test_cmp expected.bare actual
'
+test_expect_success 'setup for describe atom tests' '
+ git init -b master describe-repo &&
+ (
+ cd describe-repo &&
+
+ test_commit --no-tag one &&
+ git tag tagone &&
+
+ test_commit --no-tag two &&
+ git tag -a -m "tag two" tagtwo
+ )
+'
+
+test_expect_success 'describe atom vs git describe' '
+ (
+ cd describe-repo &&
+
+ git for-each-ref --format="%(objectname)" \
+ refs/tags/ >obj &&
+ while read hash
+ do
+ if desc=$(git describe $hash)
+ then
+ : >expect-contains-good
+ else
+ : >expect-contains-bad
+ fi &&
+ echo "$hash $desc" || return 1
+ done <obj >expect &&
+ test_path_exists expect-contains-good &&
+ test_path_exists expect-contains-bad &&
+
+ git for-each-ref --format="%(objectname) %(describe)" \
+ refs/tags/ >actual 2>err &&
+ test_cmp expect actual &&
+ test_must_be_empty err
+ )
+'
+
+test_expect_success 'describe:tags vs describe --tags' '
+ (
+ cd describe-repo &&
+ git describe --tags >expect &&
+ git for-each-ref --format="%(describe:tags)" \
+ refs/heads/master >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'describe:abbrev=... vs describe --abbrev=...' '
+ (
+ cd describe-repo &&
+
+ # Case 1: We have commits between HEAD and the most
+ # recent tag reachable from it
+ test_commit --no-tag file &&
+ git describe --abbrev=14 >expect &&
+ git for-each-ref --format="%(describe:abbrev=14)" \
+ refs/heads/master >actual &&
+ test_cmp expect actual &&
+
+ # Make sure the hash used is atleast 14 digits long
+ sed -e "s/^.*-g\([0-9a-f]*\)$/\1/" <actual >hexpart &&
+ test 15 -le $(wc -c <hexpart) &&
+
+ # Case 2: We have a tag at HEAD, describe directly gives
+ # the name of the tag
+ git tag -a -m tagged tagname &&
+ git describe --abbrev=14 >expect &&
+ git for-each-ref --format="%(describe:abbrev=14)" \
+ refs/heads/master >actual &&
+ test_cmp expect actual &&
+ test tagname = $(cat actual)
+ )
+'
+
+test_expect_success 'describe:match=... vs describe --match ...' '
+ (
+ cd describe-repo &&
+ git tag -a -m "tag foo" tag-foo &&
+ git describe --match "*-foo" >expect &&
+ git for-each-ref --format="%(describe:match="*-foo")" \
+ refs/heads/master >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'describe:exclude:... vs describe --exclude ...' '
+ (
+ cd describe-repo &&
+ git tag -a -m "tag bar" tag-bar &&
+ git describe --exclude "*-bar" >expect &&
+ git for-each-ref --format="%(describe:exclude="*-bar")" \
+ refs/heads/master >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'deref with describe atom' '
+ (
+ cd describe-repo &&
+ cat >expect <<-\EOF &&
+
+ tagname
+ tagname
+ tagname
+
+ tagtwo
+ EOF
+ git for-each-ref --format="%(*describe)" >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'err on bad describe atom arg' '
+ (
+ cd describe-repo &&
+
+ # The bad arg is the only arg passed to describe atom
+ cat >expect <<-\EOF &&
+ fatal: unrecognized %(describe) argument: baz
+ EOF
+ test_must_fail git for-each-ref --format="%(describe:baz)" \
+ refs/heads/master 2>actual &&
+ test_cmp expect actual &&
+
+ # The bad arg is in the middle of the option string
+ # passed to the describe atom
+ cat >expect <<-\EOF &&
+ fatal: unrecognized %(describe) argument: qux=1,abbrev=14
+ EOF
+ test_must_fail git for-each-ref \
+ --format="%(describe:tags,qux=1,abbrev=14)" \
+ ref/heads/master 2>actual &&
+ test_cmp expect actual
+ )
+'
+
cat >expected <<\EOF
heads/main
tags/main
@@ -606,7 +891,7 @@ test_expect_success 'create tag without tagger' '
git tag -a -m "Broken tag" taggerless &&
git tag -f taggerless $(git cat-file tag taggerless |
sed -e "/^tagger /d" |
- git hash-object --stdin -w -t tag)
+ git hash-object --literally --stdin -w -t tag)
'
test_atom refs/tags/taggerless type 'commit'
@@ -843,16 +1128,16 @@ test_expect_success 'Verify sorts with raw' '
test_expect_success 'Verify sorts with raw:size' '
cat >expected <<-EOF &&
refs/myblobs/blob8
- refs/myblobs/first
refs/myblobs/blob7
- refs/heads/main
refs/myblobs/blob4
refs/myblobs/blob1
refs/myblobs/blob2
refs/myblobs/blob3
refs/myblobs/blob5
refs/myblobs/blob6
+ refs/myblobs/first
refs/mytrees/first
+ refs/heads/main
EOF
git for-each-ref --format="%(refname)" --sort=raw:size \
refs/heads/main refs/myblobs/ refs/mytrees/first >actual &&
@@ -964,6 +1249,17 @@ test_expect_success 'for-each-ref --format compare with cat-file --batch' '
test_cmp expected actual
'
+test_expect_success 'verify sorts with contents:size' '
+ cat >expect <<-\EOF &&
+ refs/heads/main
+ refs/heads/newtag
+ refs/heads/ambiguous
+ EOF
+ git for-each-ref --format="%(refname)" \
+ --sort=contents:size refs/heads/ >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'set up multiple-sort tags' '
for when in 100000 200000
do
@@ -1039,6 +1335,73 @@ test_expect_success '--no-sort cancels the previous sort keys' '
test_cmp expected actual
'
+test_expect_success '--no-sort without subsequent --sort prints expected refs' '
+ cat >expected <<-\EOF &&
+ refs/tags/multi-ref1-100000-user1
+ refs/tags/multi-ref1-100000-user2
+ refs/tags/multi-ref1-200000-user1
+ refs/tags/multi-ref1-200000-user2
+ refs/tags/multi-ref2-100000-user1
+ refs/tags/multi-ref2-100000-user2
+ refs/tags/multi-ref2-200000-user1
+ refs/tags/multi-ref2-200000-user2
+ EOF
+
+ # Sort the results with `sort` for a consistent comparison against
+ # expected
+ git for-each-ref \
+ --format="%(refname)" \
+ --no-sort \
+ "refs/tags/multi-*" | sort >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'set up custom date sorting' '
+ # Dates:
+ # - Wed Feb 07 2024 21:34:20 +0000
+ # - Tue Dec 14 1999 00:05:22 +0000
+ # - Fri Jun 04 2021 11:26:51 +0000
+ # - Mon Jan 22 2007 16:44:01 GMT+0000
+ i=1 &&
+ for when in 1707341660 945129922 1622806011 1169484241
+ do
+ GIT_COMMITTER_DATE="@$when +0000" \
+ GIT_COMMITTER_EMAIL="user@example.com" \
+ git tag -m "tag $when" custom-dates-$i &&
+ i=$(($i+1)) || return 1
+ done
+'
+
+test_expect_success 'sort by date defaults to full timestamp' '
+ cat >expected <<-\EOF &&
+ 945129922 refs/tags/custom-dates-2
+ 1169484241 refs/tags/custom-dates-4
+ 1622806011 refs/tags/custom-dates-3
+ 1707341660 refs/tags/custom-dates-1
+ EOF
+
+ git for-each-ref \
+ --format="%(creatordate:unix) %(refname)" \
+ --sort=creatordate \
+ "refs/tags/custom-dates-*" >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'sort by custom date format' '
+ cat >expected <<-\EOF &&
+ 00:05:22 refs/tags/custom-dates-2
+ 11:26:51 refs/tags/custom-dates-3
+ 16:44:01 refs/tags/custom-dates-4
+ 21:34:20 refs/tags/custom-dates-1
+ EOF
+
+ git for-each-ref \
+ --format="%(creatordate:format:%H:%M:%S) %(refname)" \
+ --sort="creatordate:format:%H:%M:%S" \
+ "refs/tags/custom-dates-*" >actual &&
+ test_cmp expected actual
+'
+
test_expect_success 'do not dereference NULL upon %(HEAD) on unborn branch' '
test_when_finished "git checkout main" &&
git for-each-ref --format="%(HEAD) %(refname:short)" refs/heads/ >actual &&
@@ -1242,6 +1605,24 @@ test_expect_success 'basic atom: rest must fail' '
test_must_fail git for-each-ref --format="%(rest)" refs/heads/main
'
+test_expect_success 'HEAD atom does not take arguments' '
+ test_must_fail git for-each-ref --format="%(HEAD:foo)" 2>err &&
+ echo "fatal: %(HEAD) does not take arguments" >expect &&
+ test_cmp expect err
+'
+
+test_expect_success 'subject atom rejects unknown arguments' '
+ test_must_fail git for-each-ref --format="%(subject:foo)" 2>err &&
+ echo "fatal: unrecognized %(subject) argument: foo" >expect &&
+ test_cmp expect err
+'
+
+test_expect_success 'refname atom rejects unknown arguments' '
+ test_must_fail git for-each-ref --format="%(refname:foo)" 2>err &&
+ echo "fatal: unrecognized %(refname) argument: foo" >expect &&
+ test_cmp expect err
+'
+
test_expect_success 'trailer parsing not fooled by --- line' '
git commit --allow-empty -F - <<-\EOF &&
this is the subject
@@ -1356,6 +1737,14 @@ test_expect_success 'for-each-ref --ignore-case ignores case' '
test_cmp expect actual
'
+test_expect_success 'for-each-ref --omit-empty works' '
+ git for-each-ref --format="%(refname)" >actual &&
+ test_line_count -gt 1 actual &&
+ git for-each-ref --format="%(if:equals=refs/heads/main)%(refname)%(then)%(refname)%(end)" --omit-empty >actual &&
+ echo refs/heads/main >expect &&
+ test_cmp expect actual
+'
+
test_expect_success 'for-each-ref --ignore-case works on multiple sort keys' '
# name refs numerically to avoid case-insensitive filesystem conflicts
nr=0 &&
@@ -1406,4 +1795,304 @@ test_expect_success 'for-each-ref reports broken tags' '
refs/tags/broken-tag-*
'
+test_expect_success 'set up tag with signature and no blank lines' '
+ git tag -F - fake-sig-no-blanks <<-\EOF
+ this is the subject
+ -----BEGIN PGP SIGNATURE-----
+ not a real signature, but we just care about the
+ subject/body parsing. It is important here that
+ there are no blank lines in the signature.
+ -----END PGP SIGNATURE-----
+ EOF
+'
+
+test_atom refs/tags/fake-sig-no-blanks contents:subject 'this is the subject'
+test_atom refs/tags/fake-sig-no-blanks contents:body ''
+test_atom refs/tags/fake-sig-no-blanks contents:signature "$sig"
+
+test_expect_success 'set up tag with CRLF signature' '
+ append_cr <<-\EOF |
+ this is the subject
+ -----BEGIN PGP SIGNATURE-----
+
+ not a real signature, but we just care about
+ the subject/body parsing. It is important here
+ that there is a blank line separating this
+ from the signature header.
+ -----END PGP SIGNATURE-----
+ EOF
+ git tag -F - --cleanup=verbatim fake-sig-crlf
+'
+
+test_atom refs/tags/fake-sig-crlf contents:subject 'this is the subject'
+test_atom refs/tags/fake-sig-crlf contents:body ''
+
+# CRLF is retained in the signature, so we have to pass our expected value
+# through append_cr. But test_atom requires a shell string, which means command
+# substitution, and the shell will strip trailing newlines from the output of
+# the substitution. Hack around it by adding and then removing a dummy line.
+sig_crlf="$(printf "%s" "$sig" | append_cr; echo dummy)"
+sig_crlf=${sig_crlf%dummy}
+test_atom refs/tags/fake-sig-crlf contents:signature "$sig_crlf"
+
+test_expect_success 'git for-each-ref --stdin: empty' '
+ >in &&
+ git for-each-ref --format="%(refname)" --stdin <in >actual &&
+ git for-each-ref --format="%(refname)" >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'git for-each-ref --stdin: fails if extra args' '
+ >in &&
+ test_must_fail git for-each-ref --format="%(refname)" \
+ --stdin refs/heads/extra <in 2>err &&
+ grep "unknown arguments supplied with --stdin" err
+'
+
+test_expect_success 'git for-each-ref --stdin: matches' '
+ cat >in <<-EOF &&
+ refs/tags/multi*
+ refs/heads/amb*
+ EOF
+
+ cat >expect <<-EOF &&
+ refs/heads/ambiguous
+ refs/tags/multi-ref1-100000-user1
+ refs/tags/multi-ref1-100000-user2
+ refs/tags/multi-ref1-200000-user1
+ refs/tags/multi-ref1-200000-user2
+ refs/tags/multi-ref2-100000-user1
+ refs/tags/multi-ref2-100000-user2
+ refs/tags/multi-ref2-200000-user1
+ refs/tags/multi-ref2-200000-user2
+ refs/tags/multiline
+ EOF
+
+ git for-each-ref --format="%(refname)" --stdin <in >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'git for-each-ref with non-existing refs' '
+ cat >in <<-EOF &&
+ refs/heads/this-ref-does-not-exist
+ refs/tags/bogus
+ EOF
+
+ git for-each-ref --format="%(refname)" --stdin <in >actual &&
+ test_must_be_empty actual &&
+
+ xargs git for-each-ref --format="%(refname)" <in >actual &&
+ test_must_be_empty actual
+'
+
+test_expect_success 'git for-each-ref with nested tags' '
+ git tag -am "Normal tag" nested/base HEAD &&
+ git tag -am "Nested tag" nested/nest1 refs/tags/nested/base &&
+ git tag -am "Double nested tag" nested/nest2 refs/tags/nested/nest1 &&
+
+ head_oid="$(git rev-parse HEAD)" &&
+ base_tag_oid="$(git rev-parse refs/tags/nested/base)" &&
+ nest1_tag_oid="$(git rev-parse refs/tags/nested/nest1)" &&
+ nest2_tag_oid="$(git rev-parse refs/tags/nested/nest2)" &&
+
+ cat >expect <<-EOF &&
+ refs/tags/nested/base $base_tag_oid tag $head_oid commit
+ refs/tags/nested/nest1 $nest1_tag_oid tag $head_oid commit
+ refs/tags/nested/nest2 $nest2_tag_oid tag $head_oid commit
+ EOF
+
+ git for-each-ref \
+ --format="%(refname) %(objectname) %(objecttype) %(*objectname) %(*objecttype)" \
+ refs/tags/nested/ >actual &&
+ test_cmp expect actual
+'
+
+GRADE_FORMAT="%(signature:grade)%0a%(signature:key)%0a%(signature:signer)%0a%(signature:fingerprint)%0a%(signature:primarykeyfingerprint)"
+TRUSTLEVEL_FORMAT="%(signature:trustlevel)%0a%(signature:key)%0a%(signature:signer)%0a%(signature:fingerprint)%0a%(signature:primarykeyfingerprint)"
+
+test_expect_success GPG 'setup for signature atom using gpg' '
+ git checkout -b signed &&
+
+ test_when_finished "test_unconfig commit.gpgSign" &&
+
+ echo "1" >file &&
+ git add file &&
+ test_tick &&
+ git commit -S -m "file: 1" &&
+ git tag first-signed &&
+
+ echo "2" >file &&
+ test_tick &&
+ git commit -a -m "file: 2" &&
+ git tag second-unsigned &&
+
+ git config commit.gpgSign 1 &&
+ echo "3" >file &&
+ test_tick &&
+ git commit -a --no-gpg-sign -m "file: 3" &&
+ git tag third-unsigned &&
+
+ test_tick &&
+ git rebase -f HEAD^^ && git tag second-signed HEAD^ &&
+ git tag third-signed &&
+
+ echo "4" >file &&
+ test_tick &&
+ git commit -a -SB7227189 -m "file: 4" &&
+ git tag fourth-signed &&
+
+ echo "5" >file &&
+ test_tick &&
+ git commit -a --no-gpg-sign -m "file: 5" &&
+ git tag fifth-unsigned &&
+
+ echo "6" >file &&
+ test_tick &&
+ git commit -a --no-gpg-sign -m "file: 6" &&
+
+ test_tick &&
+ git rebase -f HEAD^^ &&
+ git tag fifth-signed HEAD^ &&
+ git tag sixth-signed &&
+
+ echo "7" >file &&
+ test_tick &&
+ git commit -a --no-gpg-sign -m "file: 7" &&
+ git tag seventh-unsigned
+'
+
+test_expect_success GPGSSH 'setup for signature atom using ssh' '
+ test_when_finished "test_unconfig gpg.format user.signingkey" &&
+
+ test_config gpg.format ssh &&
+ test_config user.signingkey "${GPGSSH_KEY_PRIMARY}" &&
+ echo "8" >file &&
+ test_tick &&
+ git add file &&
+ git commit -S -m "file: 8" &&
+ git tag eighth-signed-ssh
+'
+
+test_expect_success GPG2 'bare signature atom' '
+ git verify-commit first-signed 2>expect &&
+ echo >>expect &&
+ git for-each-ref refs/tags/first-signed \
+ --format="%(signature)" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success GPG 'show good signature with custom format' '
+ git verify-commit first-signed &&
+ cat >expect <<-\EOF &&
+ G
+ 13B6F51ECDDE430D
+ C O Mitter <committer@example.com>
+ 73D758744BE721698EC54E8713B6F51ECDDE430D
+ 73D758744BE721698EC54E8713B6F51ECDDE430D
+ EOF
+ git for-each-ref refs/tags/first-signed \
+ --format="$GRADE_FORMAT" >actual &&
+ test_cmp expect actual
+'
+test_expect_success GPGSSH 'show good signature with custom format
+ with ssh' '
+ test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" &&
+ FINGERPRINT=$(ssh-keygen -lf "${GPGSSH_KEY_PRIMARY}" | awk "{print \$2;}") &&
+ cat >expect.tmpl <<-\EOF &&
+ G
+ FINGERPRINT
+ principal with number 1
+ FINGERPRINT
+
+ EOF
+ sed "s|FINGERPRINT|$FINGERPRINT|g" expect.tmpl >expect &&
+ git for-each-ref refs/tags/eighth-signed-ssh \
+ --format="$GRADE_FORMAT" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success GPG 'signature atom with grade option and bad signature' '
+ git cat-file commit third-signed >raw &&
+ sed -e "s/^file: 3/file: 3 forged/" raw >forged1 &&
+ FORGED1=$(git hash-object -w -t commit forged1) &&
+ git update-ref refs/tags/third-signed "$FORGED1" &&
+ test_must_fail git verify-commit "$FORGED1" &&
+
+ cat >expect <<-\EOF &&
+ B
+ 13B6F51ECDDE430D
+ C O Mitter <committer@example.com>
+
+
+ EOF
+ git for-each-ref refs/tags/third-signed \
+ --format="$GRADE_FORMAT" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success GPG 'show untrusted signature with custom format' '
+ cat >expect <<-\EOF &&
+ U
+ 65A0EEA02E30CAD7
+ Eris Discordia <discord@example.net>
+ F8364A59E07FFE9F4D63005A65A0EEA02E30CAD7
+ D4BE22311AD3131E5EDA29A461092E85B7227189
+ EOF
+ git for-each-ref refs/tags/fourth-signed \
+ --format="$GRADE_FORMAT" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success GPG 'show untrusted signature with undefined trust level' '
+ cat >expect <<-\EOF &&
+ undefined
+ 65A0EEA02E30CAD7
+ Eris Discordia <discord@example.net>
+ F8364A59E07FFE9F4D63005A65A0EEA02E30CAD7
+ D4BE22311AD3131E5EDA29A461092E85B7227189
+ EOF
+ git for-each-ref refs/tags/fourth-signed \
+ --format="$TRUSTLEVEL_FORMAT" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success GPG 'show untrusted signature with ultimate trust level' '
+ cat >expect <<-\EOF &&
+ ultimate
+ 13B6F51ECDDE430D
+ C O Mitter <committer@example.com>
+ 73D758744BE721698EC54E8713B6F51ECDDE430D
+ 73D758744BE721698EC54E8713B6F51ECDDE430D
+ EOF
+ git for-each-ref refs/tags/sixth-signed \
+ --format="$TRUSTLEVEL_FORMAT" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success GPG 'show unknown signature with custom format' '
+ cat >expect <<-\EOF &&
+ E
+ 13B6F51ECDDE430D
+
+
+
+ EOF
+ GNUPGHOME="$GNUPGHOME_NOT_USED" git for-each-ref \
+ refs/tags/sixth-signed --format="$GRADE_FORMAT" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success GPG 'show lack of signature with custom format' '
+ cat >expect <<-\EOF &&
+ N
+
+
+
+
+ EOF
+ git for-each-ref refs/tags/seventh-unsigned \
+ --format="$GRADE_FORMAT" >actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t6301-for-each-ref-errors.sh b/t/t6301-for-each-ref-errors.sh
index 40edf9d..83b8a19 100755
--- a/t/t6301-for-each-ref-errors.sh
+++ b/t/t6301-for-each-ref-errors.sh
@@ -2,6 +2,7 @@
test_description='for-each-ref errors for broken refs'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
ZEROS=$ZERO_OID
@@ -14,7 +15,7 @@ test_expect_success setup '
git for-each-ref --format="%(objectname) %(refname)" >brief-list
'
-test_expect_success 'Broken refs are reported correctly' '
+test_expect_success REFFILES 'Broken refs are reported correctly' '
r=refs/heads/bogus &&
: >.git/$r &&
test_when_finished "rm -f .git/$r" &&
@@ -24,7 +25,7 @@ test_expect_success 'Broken refs are reported correctly' '
test_cmp broken-err err
'
-test_expect_success 'NULL_SHA1 refs are reported correctly' '
+test_expect_success REFFILES 'NULL_SHA1 refs are reported correctly' '
r=refs/heads/zeros &&
echo $ZEROS >.git/$r &&
test_when_finished "rm -f .git/$r" &&
@@ -38,19 +39,32 @@ test_expect_success 'NULL_SHA1 refs are reported correctly' '
'
test_expect_success 'Missing objects are reported correctly' '
- r=refs/heads/missing &&
- echo $MISSING >.git/$r &&
- test_when_finished "rm -f .git/$r" &&
- echo "fatal: missing object $MISSING for $r" >missing-err &&
+ test_when_finished "git update-ref -d refs/heads/missing" &&
+ test-tool ref-store main update-ref msg refs/heads/missing "$MISSING" "$ZERO_OID" REF_SKIP_OID_VERIFICATION &&
+ echo "fatal: missing object $MISSING for refs/heads/missing" >missing-err &&
test_must_fail git for-each-ref 2>err &&
test_cmp missing-err err &&
(
cat brief-list &&
- echo "$MISSING $r"
+ echo "$MISSING refs/heads/missing"
) | sort -k 2 >missing-brief-expected &&
git for-each-ref --format="%(objectname) %(refname)" >brief-out 2>brief-err &&
test_cmp missing-brief-expected brief-out &&
test_must_be_empty brief-err
'
+test_expect_success 'ahead-behind requires an argument' '
+ test_must_fail git for-each-ref \
+ --format="%(ahead-behind)" 2>err &&
+ echo "fatal: expected format: %(ahead-behind:<committish>)" >expect &&
+ test_cmp expect err
+'
+
+test_expect_success 'missing ahead-behind base' '
+ test_must_fail git for-each-ref \
+ --format="%(ahead-behind:refs/heads/missing)" 2>err &&
+ echo "fatal: failed to find '\''refs/heads/missing'\''" >expect &&
+ test_cmp expect err
+'
+
test_done
diff --git a/t/t6302-for-each-ref-filter.sh b/t/t6302-for-each-ref-filter.sh
index 1ce5f49..948f1bb 100755
--- a/t/t6302-for-each-ref-filter.sh
+++ b/t/t6302-for-each-ref-filter.sh
@@ -31,6 +31,37 @@ test_expect_success 'setup some history and refs' '
git update-ref refs/odd/spot main
'
+test_expect_success '--include-root-refs pattern prints pseudorefs' '
+ cat >expect <<-\EOF &&
+ HEAD
+ ORIG_HEAD
+ refs/heads/main
+ refs/heads/side
+ refs/odd/spot
+ refs/tags/annotated-tag
+ refs/tags/doubly-annotated-tag
+ refs/tags/doubly-signed-tag
+ refs/tags/four
+ refs/tags/one
+ refs/tags/signed-tag
+ refs/tags/three
+ refs/tags/two
+ EOF
+ git update-ref ORIG_HEAD main &&
+ git for-each-ref --format="%(refname)" --include-root-refs >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success '--include-root-refs with other patterns' '
+ cat >expect <<-\EOF &&
+ HEAD
+ ORIG_HEAD
+ EOF
+ git update-ref ORIG_HEAD main &&
+ git for-each-ref --format="%(refname)" --include-root-refs "*HEAD" >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'filtering with --points-at' '
cat >expect <<-\EOF &&
refs/heads/main
@@ -45,6 +76,8 @@ test_expect_success 'check signed tags with --points-at' '
sed -e "s/Z$//" >expect <<-\EOF &&
refs/heads/side Z
refs/tags/annotated-tag four
+ refs/tags/doubly-annotated-tag four
+ refs/tags/doubly-signed-tag four
refs/tags/four Z
refs/tags/signed-tag four
EOF
diff --git a/t/t6400-merge-df.sh b/t/t6400-merge-df.sh
index 57a67cf..3de4ef6 100755
--- a/t/t6400-merge-df.sh
+++ b/t/t6400-merge-df.sh
@@ -126,7 +126,7 @@ test_expect_success 'Simple merge in repo with interesting pathnames' '
# foo/bar-2/baz
# The fact that foo/bar-2 appears between foo/bar and foo/bar/baz
# can trip up some codepaths, and is the point of this test.
- test_create_repo name-ordering &&
+ git init name-ordering &&
(
cd name-ordering &&
diff --git a/t/t6401-merge-criss-cross.sh b/t/t6401-merge-criss-cross.sh
index 9d5e992..1962310 100755
--- a/t/t6401-merge-criss-cross.sh
+++ b/t/t6401-merge-criss-cross.sh
@@ -8,6 +8,8 @@
test_description='Test criss-cross merge'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'prepare repository' '
diff --git a/t/t6402-merge-rename.sh b/t/t6402-merge-rename.sh
index 3a32b1a..2738b50 100755
--- a/t/t6402-merge-rename.sh
+++ b/t/t6402-merge-rename.sh
@@ -210,7 +210,7 @@ test_expect_success 'updated working tree file should prevent the merge' '
echo >>M one line addition &&
cat M >M.saved &&
git update-index M &&
- test_expect_code 128 git pull --no-rebase . yellow &&
+ test_expect_code 2 git pull --no-rebase . yellow &&
test_cmp M M.saved &&
rm -f M.saved
'
@@ -311,13 +311,13 @@ test_expect_success 'Rename+D/F conflict; renamed file merges but dir in way' '
git checkout -q renamed-file-has-no-conflicts^0 &&
test_must_fail git merge --strategy=recursive dir-in-way >output &&
- test_i18ngrep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
- test_i18ngrep "Auto-merging dir" output &&
+ test_grep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
+ test_grep "Auto-merging dir" output &&
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
- test_i18ngrep "moving it to dir~HEAD instead" output
+ test_grep "moving it to dir~HEAD instead" output
else
- test_i18ngrep "Adding as dir~HEAD instead" output
+ test_grep "Adding as dir~HEAD instead" output
fi &&
test_stdout_line_count = 3 git ls-files -u &&
@@ -338,13 +338,13 @@ test_expect_success 'Same as previous, but merged other way' '
test_must_fail git merge --strategy=recursive renamed-file-has-no-conflicts >output 2>errors &&
! grep "error: refusing to lose untracked file at" errors &&
- test_i18ngrep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
- test_i18ngrep "Auto-merging dir" output &&
+ test_grep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
+ test_grep "Auto-merging dir" output &&
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
- test_i18ngrep "moving it to dir~renamed-file-has-no-conflicts instead" output
+ test_grep "moving it to dir~renamed-file-has-no-conflicts instead" output
else
- test_i18ngrep "Adding as dir~renamed-file-has-no-conflicts instead" output
+ test_grep "Adding as dir~renamed-file-has-no-conflicts instead" output
fi &&
test_stdout_line_count = 3 git ls-files -u &&
diff --git a/t/t6403-merge-file.sh b/t/t6403-merge-file.sh
index 2f421d9..fb872c5 100755
--- a/t/t6403-merge-file.sh
+++ b/t/t6403-merge-file.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='RCS merge replacement: merge-file'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -54,7 +56,67 @@ test_expect_success 'setup' '
deduxit me super semitas jusitiae,
EOF
- printf "propter nomen suum." >>new4.txt
+ printf "propter nomen suum." >>new4.txt &&
+
+ cat >base.c <<-\EOF &&
+ int f(int x, int y)
+ {
+ if (x == 0)
+ {
+ return y;
+ }
+ return x;
+ }
+
+ int g(size_t u)
+ {
+ while (u < 30)
+ {
+ u++;
+ }
+ return u;
+ }
+ EOF
+
+ cat >ours.c <<-\EOF &&
+ int g(size_t u)
+ {
+ while (u < 30)
+ {
+ u++;
+ }
+ return u;
+ }
+
+ int h(int x, int y, int z)
+ {
+ if (z == 0)
+ {
+ return x;
+ }
+ return y;
+ }
+ EOF
+
+ cat >theirs.c <<-\EOF
+ int f(int x, int y)
+ {
+ if (x == 0)
+ {
+ return y;
+ }
+ return x;
+ }
+
+ int g(size_t u)
+ {
+ while (u > 34)
+ {
+ u--;
+ }
+ return u;
+ }
+ EOF
'
test_expect_success 'merge with no changes' '
@@ -63,11 +125,30 @@ test_expect_success 'merge with no changes' '
test_cmp test.txt orig.txt
'
+test_expect_success 'merge with no changes with --object-id' '
+ git add orig.txt &&
+ git merge-file -p --object-id :orig.txt :orig.txt :orig.txt >actual &&
+ test_cmp actual orig.txt
+'
+
test_expect_success "merge without conflict" '
cp new1.txt test.txt &&
git merge-file test.txt orig.txt new2.txt
'
+test_expect_success 'merge without conflict with --object-id' '
+ git add orig.txt new2.txt &&
+ git merge-file --object-id :orig.txt :orig.txt :new2.txt >actual &&
+ git rev-parse :new2.txt >expected &&
+ test_cmp actual expected
+'
+
+test_expect_success 'can accept object ID with --object-id' '
+ git merge-file --object-id $(test_oid empty_blob) $(test_oid empty_blob) :new2.txt >actual &&
+ git rev-parse :new2.txt >expected &&
+ test_cmp actual expected
+'
+
test_expect_success 'works in subdirectory' '
mkdir dir &&
cp new1.txt dir/a.txt &&
@@ -136,6 +217,31 @@ test_expect_success "expected conflict markers" '
test_cmp expect.txt test.txt
'
+test_expect_success "merge with conflicts with --object-id" '
+ git add backup.txt orig.txt new3.txt &&
+ test_must_fail git merge-file -p --object-id :backup.txt :orig.txt :new3.txt >actual &&
+ sed -e "s/<< test.txt/<< :backup.txt/" \
+ -e "s/>> new3.txt/>> :new3.txt/" \
+ expect.txt >expect &&
+ test_cmp expect actual &&
+ test_must_fail git merge-file --object-id :backup.txt :orig.txt :new3.txt >oid &&
+ git cat-file blob "$(cat oid)" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success "merge with conflicts with --object-id with labels" '
+ git add backup.txt orig.txt new3.txt &&
+ test_must_fail git merge-file -p --object-id \
+ -L test.txt -L orig.txt -L new3.txt \
+ :backup.txt :orig.txt :new3.txt >actual &&
+ test_cmp expect.txt actual &&
+ test_must_fail git merge-file --object-id \
+ -L test.txt -L orig.txt -L new3.txt \
+ :backup.txt :orig.txt :new3.txt >oid &&
+ git cat-file blob "$(cat oid)" >actual &&
+ test_cmp expect.txt actual
+'
+
test_expect_success "merge conflicting with --ours" '
cp backup.txt test.txt &&
@@ -254,6 +360,14 @@ test_expect_success 'binary files cannot be merged' '
grep "Cannot merge binary files" merge.err
'
+test_expect_success 'binary files cannot be merged with --object-id' '
+ cp "$TEST_DIRECTORY"/test-binary-1.png . &&
+ git add orig.txt new1.txt test-binary-1.png &&
+ test_must_fail git merge-file --object-id \
+ :orig.txt :test-binary-1.png :new1.txt 2> merge.err &&
+ grep "Cannot merge binary files" merge.err
+'
+
test_expect_success 'MERGE_ZEALOUS simplifies non-conflicts' '
sed -e "s/deerit.\$/deerit;/" -e "s/me;\$/me./" <new5.txt >new6.txt &&
sed -e "s/deerit.\$/deerit,/" -e "s/me;\$/me,/" <new5.txt >new7.txt &&
@@ -387,4 +501,72 @@ test_expect_success 'conflict sections match existing line endings' '
test $(tr "\015" Q <nolf.txt | grep "^[<=>].*Q$" | wc -l) = 0
'
+test_expect_success '--object-id fails without repository' '
+ empty="$(test_oid empty_blob)" &&
+ nongit test_must_fail git merge-file --object-id $empty $empty $empty 2>err &&
+ grep "not a git repository" err
+'
+
+test_expect_success 'merging C files with "myers" diff algorithm creates some spurious conflicts' '
+ cat >expect.c <<-\EOF &&
+ int g(size_t u)
+ {
+ while (u < 30)
+ {
+ u++;
+ }
+ return u;
+ }
+
+ int h(int x, int y, int z)
+ {
+ <<<<<<< ours.c
+ if (z == 0)
+ ||||||| base.c
+ while (u < 30)
+ =======
+ while (u > 34)
+ >>>>>>> theirs.c
+ {
+ <<<<<<< ours.c
+ return x;
+ ||||||| base.c
+ u++;
+ =======
+ u--;
+ >>>>>>> theirs.c
+ }
+ return y;
+ }
+ EOF
+
+ test_must_fail git merge-file -p --diff3 --diff-algorithm myers ours.c base.c theirs.c >myers_output.c &&
+ test_cmp expect.c myers_output.c
+'
+
+test_expect_success 'merging C files with "histogram" diff algorithm avoids some spurious conflicts' '
+ cat >expect.c <<-\EOF &&
+ int g(size_t u)
+ {
+ while (u > 34)
+ {
+ u--;
+ }
+ return u;
+ }
+
+ int h(int x, int y, int z)
+ {
+ if (z == 0)
+ {
+ return x;
+ }
+ return y;
+ }
+ EOF
+
+ git merge-file -p --diff3 --diff-algorithm histogram ours.c base.c theirs.c >histogram_output.c &&
+ test_cmp expect.c histogram_output.c
+'
+
test_done
diff --git a/t/t6404-recursive-merge.sh b/t/t6404-recursive-merge.sh
index b8735c6..3621551 100755
--- a/t/t6404-recursive-merge.sh
+++ b/t/t6404-recursive-merge.sh
@@ -4,6 +4,7 @@ test_description='Test merge without common ancestors'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# This scenario is based on a real-world repository of Shawn Pearce.
diff --git a/t/t6405-merge-symlinks.sh b/t/t6405-merge-symlinks.sh
index 7435fce..29e2b25 100755
--- a/t/t6405-merge-symlinks.sh
+++ b/t/t6405-merge-symlinks.sh
@@ -11,6 +11,7 @@ if core.symlinks is false.'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
diff --git a/t/t6406-merge-attr.sh b/t/t6406-merge-attr.sh
index 99abefd..156a1ef 100755
--- a/t/t6406-merge-attr.sh
+++ b/t/t6406-merge-attr.sh
@@ -8,6 +8,7 @@ test_description='per path merge controlled by merge attribute'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
@@ -41,11 +42,15 @@ test_expect_success setup '
#!/bin/sh
orig="$1" ours="$2" theirs="$3" exit="$4" path=$5
+ orig_name="$6" our_name="$7" their_name="$8"
(
echo "orig is $orig"
echo "ours is $ours"
echo "theirs is $theirs"
echo "path is $path"
+ echo "orig_name is $orig_name"
+ echo "our_name is $our_name"
+ echo "their_name is $their_name"
echo "=== orig ==="
cat "$orig"
echo "=== ours ==="
@@ -55,6 +60,12 @@ test_expect_success setup '
) >"$ours+"
cat "$ours+" >"$ours"
rm -f "$ours+"
+
+ if test -f ./please-abort
+ then
+ echo >>./please-abort killing myself
+ kill -9 $$
+ fi
exit "$exit"
EOF
chmod +x ./custom-merge
@@ -114,7 +125,7 @@ test_expect_success 'custom merge backend' '
git reset --hard anchor &&
git config --replace-all \
- merge.custom.driver "./custom-merge %O %A %B 0 %P" &&
+ merge.custom.driver "./custom-merge %O %A %B 0 %P %S %X %Y" &&
git config --replace-all \
merge.custom.name "custom merge driver for testing" &&
@@ -125,7 +136,8 @@ test_expect_success 'custom merge backend' '
o=$(git unpack-file main^:text) &&
a=$(git unpack-file side^:text) &&
b=$(git unpack-file main:text) &&
- sh -c "./custom-merge $o $a $b 0 text" &&
+ base_revid=$(git rev-parse --short main^) &&
+ sh -c "./custom-merge $o $a $b 0 text $base_revid HEAD main" &&
sed -e 1,3d $a >check-2 &&
cmp check-1 check-2 &&
rm -f $o $a $b
@@ -135,7 +147,7 @@ test_expect_success 'custom merge backend' '
git reset --hard anchor &&
git config --replace-all \
- merge.custom.driver "./custom-merge %O %A %B 1 %P" &&
+ merge.custom.driver "./custom-merge %O %A %B 1 %P %S %X %Y" &&
git config --replace-all \
merge.custom.name "custom merge driver for testing" &&
@@ -152,7 +164,8 @@ test_expect_success 'custom merge backend' '
o=$(git unpack-file main^:text) &&
a=$(git unpack-file anchor:text) &&
b=$(git unpack-file main:text) &&
- sh -c "./custom-merge $o $a $b 0 text" &&
+ base_revid=$(git rev-parse --short main^) &&
+ sh -c "./custom-merge $o $a $b 0 text $base_revid HEAD main" &&
sed -e 1,3d $a >check-2 &&
cmp check-1 check-2 &&
sed -e 1,3d -e 4q $a >check-3 &&
@@ -161,9 +174,27 @@ test_expect_success 'custom merge backend' '
rm -f $o $a $b
'
+test_expect_success !WINDOWS 'custom merge driver that is killed with a signal' '
+ test_when_finished "rm -f output please-abort" &&
+
+ git reset --hard anchor &&
+ git config --replace-all \
+ merge.custom.driver "./custom-merge %O %A %B 0 %P %S %X %Y" &&
+ git config --replace-all \
+ merge.custom.name "custom merge driver for testing" &&
+
+ >./please-abort &&
+ echo "* merge=custom" >.gitattributes &&
+ test_must_fail git merge main 2>err &&
+ grep "^error: failed to execute internal merge" err &&
+ git ls-files -u >output &&
+ git diff --name-only HEAD >>output &&
+ test_must_be_empty output
+'
+
test_expect_success 'up-to-date merge without common ancestor' '
- test_create_repo repo1 &&
- test_create_repo repo2 &&
+ git init repo1 &&
+ git init repo2 &&
test_tick &&
(
cd repo1 &&
diff --git a/t/t6408-merge-up-to-date.sh b/t/t6408-merge-up-to-date.sh
index 7763c1b..8a1ba6d 100755
--- a/t/t6408-merge-up-to-date.sh
+++ b/t/t6408-merge-up-to-date.sh
@@ -2,6 +2,7 @@
test_description='merge fast-forward and up to date'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t6411-merge-filemode.sh b/t/t6411-merge-filemode.sh
index 6ae2489..b618272 100755
--- a/t/t6411-merge-filemode.sh
+++ b/t/t6411-merge-filemode.sh
@@ -4,6 +4,7 @@ test_description='merge: handle file mode'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'set up mode change in one branch' '
diff --git a/t/t6413-merge-crlf.sh b/t/t6413-merge-crlf.sh
index affea25..647ea1e 100755
--- a/t/t6413-merge-crlf.sh
+++ b/t/t6413-merge-crlf.sh
@@ -11,6 +11,7 @@ test_description='merge conflict in crlf repo
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
@@ -33,14 +34,14 @@ test_expect_success setup '
test_expect_success 'Check "ours" is CRLF' '
git reset --hard initial &&
git merge side -s ours &&
- cat file | remove_cr | append_cr >file.temp &&
+ remove_cr <file | append_cr >file.temp &&
test_cmp file file.temp
'
test_expect_success 'Check that conflict file is CRLF' '
git reset --hard a &&
test_must_fail git merge side &&
- cat file | remove_cr | append_cr >file.temp &&
+ remove_cr <file | append_cr >file.temp &&
test_cmp file file.temp
'
diff --git a/t/t6415-merge-dir-to-symlink.sh b/t/t6415-merge-dir-to-symlink.sh
index 2655e29..ae00492 100755
--- a/t/t6415-merge-dir-to-symlink.sh
+++ b/t/t6415-merge-dir-to-symlink.sh
@@ -4,6 +4,7 @@ test_description='merging when a directory was replaced with a symlink'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'create a commit where dir a/b changed to symlink' '
diff --git a/t/t6416-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh
index 690c848..5f414ab 100755
--- a/t/t6416-recursive-corner-cases.sh
+++ b/t/t6416-recursive-corner-cases.sh
@@ -5,6 +5,7 @@ test_description='recursive merge corner cases involving criss-cross merges'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-merge.sh
@@ -19,7 +20,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
#
test_expect_success 'setup basic criss-cross + rename with no modifications' '
- test_create_repo basic-rename &&
+ git init basic-rename &&
(
cd basic-rename &&
@@ -85,7 +86,7 @@ test_expect_success 'merge simple rename+criss-cross with no modifications' '
#
test_expect_success 'setup criss-cross + rename merges with basic modification' '
- test_create_repo rename-modify &&
+ git init rename-modify &&
(
cd rename-modify &&
@@ -160,7 +161,7 @@ test_expect_success 'merge criss-cross + rename merges with basic modification'
#
test_expect_success 'setup differently handled merges of rename/add conflict' '
- test_create_repo rename-add &&
+ git init rename-add &&
(
cd rename-add &&
@@ -324,7 +325,7 @@ test_expect_success 'git detects differently handled merges conflict, swapped' '
# Merging commits D & E should result in modify/delete conflict.
test_expect_success 'setup criss-cross + modify/delete resolved differently' '
- test_create_repo modify-delete &&
+ git init modify-delete &&
(
cd modify-delete &&
@@ -499,7 +500,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete, rev
#
test_expect_success 'setup differently handled merges of directory/file conflict' '
- test_create_repo directory-file &&
+ git init directory-file &&
(
cd directory-file &&
@@ -867,7 +868,7 @@ test_expect_failure 'merge of D2 & E4 merges a2s & reports conflict for a/file'
# but that may cancel out at the final merge stage".
test_expect_success 'setup rename/rename(1to2)/modify followed by what looks like rename/rename(2to1)/modify' '
- test_create_repo rename-squared-squared &&
+ git init rename-squared-squared &&
(
cd rename-squared-squared &&
@@ -944,7 +945,7 @@ test_expect_success 'handle rename/rename(1to2)/modify followed by what looks li
# content merge handled.
test_expect_success 'setup criss-cross + rename/rename/add-source + modify/modify' '
- test_create_repo rename-rename-add-source &&
+ git init rename-rename-add-source &&
(
cd rename-rename-add-source &&
@@ -1032,7 +1033,7 @@ test_expect_failure 'detect rename/rename/add-source for virtual merge-base' '
# base of B & C needs to not delete B:c for that to work, though...
test_expect_success 'setup criss-cross+rename/rename/add-dest + simple modify' '
- test_create_repo rename-rename-add-dest &&
+ git init rename-rename-add-dest &&
(
cd rename-rename-add-dest &&
@@ -1111,7 +1112,7 @@ test_expect_success 'virtual merge base handles rename/rename(1to2)/add-dest' '
# git detect it?
test_expect_success 'setup symlink modify/modify' '
- test_create_repo symlink-modify-modify &&
+ git init symlink-modify-modify &&
(
cd symlink-modify-modify &&
@@ -1178,7 +1179,7 @@ test_expect_merge_algorithm failure success 'check symlink modify/modify' '
# git detect it?
test_expect_success 'setup symlink add/add' '
- test_create_repo symlink-add-add &&
+ git init symlink-add-add &&
(
cd symlink-add-add &&
@@ -1244,11 +1245,11 @@ test_expect_merge_algorithm failure success 'check symlink add/add' '
# git detect it?
test_expect_success 'setup submodule modify/modify' '
- test_create_repo submodule-modify-modify &&
+ git init submodule-modify-modify &&
(
cd submodule-modify-modify &&
- test_create_repo submod &&
+ git init submod &&
(
cd submod &&
touch file-A &&
@@ -1332,11 +1333,11 @@ test_expect_merge_algorithm failure success 'check submodule modify/modify' '
# git detect it?
test_expect_success 'setup submodule add/add' '
- test_create_repo submodule-add-add &&
+ git init submodule-add-add &&
(
cd submodule-add-add &&
- test_create_repo submod &&
+ git init submod &&
(
cd submod &&
touch file-A &&
@@ -1419,11 +1420,11 @@ test_expect_merge_algorithm failure success 'check submodule add/add' '
# This is an obvious add/add conflict for 'path'. Can git detect it?
test_expect_success 'setup conflicting entry types (submodule vs symlink)' '
- test_create_repo submodule-symlink-add-add &&
+ git init submodule-symlink-add-add &&
(
cd submodule-symlink-add-add &&
- test_create_repo path &&
+ git init path &&
(
cd path &&
touch file-B &&
@@ -1494,7 +1495,7 @@ test_expect_merge_algorithm failure success 'check conflicting entry types (subm
# This is an obvious add/add mode conflict. Can git detect it?
test_expect_success 'setup conflicting modes for regular file' '
- test_create_repo regular-file-mode-conflict &&
+ git init regular-file-mode-conflict &&
(
cd regular-file-mode-conflict &&
@@ -1571,7 +1572,7 @@ test_expect_failure 'check conflicting modes for regular file' '
# to ensure that we handle it as well as practical.
test_expect_success 'setup nested conflicts' '
- test_create_repo nested_conflicts &&
+ git init nested_conflicts &&
(
cd nested_conflicts &&
@@ -1757,7 +1758,7 @@ test_expect_success 'check nested conflicts' '
# have three levels of conflict markers. Can we distinguish all three?
test_expect_success 'setup virtual merge base with nested conflicts' '
- test_create_repo virtual_merge_base_has_nested_conflicts &&
+ git init virtual_merge_base_has_nested_conflicts &&
(
cd virtual_merge_base_has_nested_conflicts &&
diff --git a/t/t6417-merge-ours-theirs.sh b/t/t6417-merge-ours-theirs.sh
index 62d1406..482b73a 100755
--- a/t/t6417-merge-ours-theirs.sh
+++ b/t/t6417-merge-ours-theirs.sh
@@ -4,6 +4,7 @@ test_description='Merge-recursive ours and theirs variants'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t6418-merge-text-auto.sh b/t/t6418-merge-text-auto.sh
index 41288a6..48a62cb 100755
--- a/t/t6418-merge-text-auto.sh
+++ b/t/t6418-merge-text-auto.sh
@@ -15,6 +15,7 @@ test_description='CRLF merge conflict across text=auto change
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b
diff --git a/t/t6421-merge-partial-clone.sh b/t/t6421-merge-partial-clone.sh
index 36bcd7c3..711b709 100755
--- a/t/t6421-merge-partial-clone.sh
+++ b/t/t6421-merge-partial-clone.sh
@@ -31,7 +31,7 @@ test_description="limiting blob downloads when merging with partial clones"
test_setup_repo () {
test -d server && return
- test_create_repo server &&
+ git init server &&
(
cd server &&
@@ -155,7 +155,7 @@ test_setup_repo () {
# Commit A:
# (Rename leap->jump, rename basename/ -> basename/subdir/, rename dir/
# -> folder/, move e into newsubdir, add newfile.rs, remove f, modify
-# both both Makefiles and jumps)
+# both Makefiles and jumps)
# general/{jump1_A, jump2_A}
# basename/subdir/{numbers_A, sequence_A, values_A}
# folder/subdir/{a,b,c,d,Makefile_TOP_A}
@@ -343,7 +343,7 @@ test_expect_merge_algorithm failure success 'Objects downloaded when a directory
# Commit A:
# (Rename leap->jump, rename basename/ -> basename/subdir/, rename dir/
# -> folder/, move e into newsubdir, add newfile.rs, remove f, modify
-# both both Makefiles and jumps)
+# both Makefiles and jumps)
# general/{jump1_A, jump2_A}
# basename/subdir/{numbers_A, sequence_A, values_A}
# folder/subdir/{a,b,c,d,Makefile_TOP_A}
diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index bf4ce3c..80d7b5e 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -6,11 +6,12 @@ test_description="recursive merge corner cases w/ renames but not criss-crosses"
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-merge.sh
test_setup_rename_delete_untracked () {
- test_create_repo rename-delete-untracked &&
+ git init rename-delete-untracked &&
(
cd rename-delete-untracked &&
@@ -55,7 +56,7 @@ test_expect_success "Does git preserve Gollum's precious artifact?" '
# We should be able to merge B & C cleanly
test_setup_rename_modify_add_source () {
- test_create_repo rename-modify-add-source &&
+ git init rename-modify-add-source &&
(
cd rename-modify-add-source &&
@@ -95,7 +96,7 @@ test_expect_failure 'rename/modify/add-source conflict resolvable' '
'
test_setup_break_detection_1 () {
- test_create_repo break-detection-1 &&
+ git init break-detection-1 &&
(
cd break-detection-1 &&
@@ -143,7 +144,7 @@ test_expect_failure 'conflict caused if rename not detected' '
'
test_setup_break_detection_2 () {
- test_create_repo break-detection-2 &&
+ git init break-detection-2 &&
(
cd break-detection-2 &&
@@ -191,7 +192,7 @@ test_expect_failure 'missed conflict if rename not detected' '
# Commit C: rename a->b, add unrelated a
test_setup_break_detection_3 () {
- test_create_repo break-detection-3 &&
+ git init break-detection-3 &&
(
cd break-detection-3 &&
@@ -267,7 +268,7 @@ test_expect_failure 'detect rename/add-source and preserve all data, merge other
'
test_setup_rename_directory () {
- test_create_repo rename-directory-$1 &&
+ git init rename-directory-$1 &&
(
cd rename-directory-$1 &&
@@ -385,7 +386,7 @@ test_expect_success 'rename/directory conflict + content merge conflict' '
'
test_setup_rename_directory_2 () {
- test_create_repo rename-directory-2 &&
+ git init rename-directory-2 &&
(
cd rename-directory-2 &&
@@ -444,7 +445,7 @@ test_expect_success 'disappearing dir in rename/directory conflict handled' '
# Commit B: modify a, add different b
test_setup_rename_with_content_merge_and_add () {
- test_create_repo rename-with-content-merge-and-add-$1 &&
+ git init rename-with-content-merge-and-add-$1 &&
(
cd rename-with-content-merge-and-add-$1 &&
@@ -475,7 +476,7 @@ test_expect_success 'handle rename-with-content-merge vs. add' '
git checkout A^0 &&
test_must_fail git merge -s recursive B^0 >out &&
- test_i18ngrep "CONFLICT (.*/add)" out &&
+ test_grep "CONFLICT (.*/add)" out &&
git ls-files -s >out &&
test_line_count = 2 out &&
@@ -521,7 +522,7 @@ test_expect_success 'handle rename-with-content-merge vs. add, merge other way'
git checkout B^0 &&
test_must_fail git merge -s recursive A^0 >out &&
- test_i18ngrep "CONFLICT (.*/add)" out &&
+ test_grep "CONFLICT (.*/add)" out &&
git ls-files -s >out &&
test_line_count = 2 out &&
@@ -569,7 +570,7 @@ test_expect_success 'handle rename-with-content-merge vs. add, merge other way'
# * Nothing else should be present. Is anything?
test_setup_rename_rename_2to1 () {
- test_create_repo rename-rename-2to1 &&
+ git init rename-rename-2to1 &&
(
cd rename-rename-2to1 &&
@@ -601,7 +602,7 @@ test_expect_success 'handle rename/rename (2to1) conflict correctly' '
git checkout B^0 &&
test_must_fail git merge -s recursive C^0 >out &&
- test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
+ test_grep "CONFLICT (\(.*\)/\1)" out &&
git ls-files -s >out &&
test_line_count = 2 out &&
@@ -641,7 +642,7 @@ test_expect_success 'handle rename/rename (2to1) conflict correctly' '
# Commit B: rename a->b
# Commit C: rename a->c
test_setup_rename_rename_1to2 () {
- test_create_repo rename-rename-1to2 &&
+ git init rename-rename-1to2 &&
(
cd rename-rename-1to2 &&
@@ -699,7 +700,7 @@ test_expect_success 'merge has correct working tree contents' '
# Merging of B & C should NOT be clean; there's a rename/rename conflict
test_setup_rename_rename_1to2_add_source_1 () {
- test_create_repo rename-rename-1to2-add-source-1 &&
+ git init rename-rename-1to2-add-source-1 &&
(
cd rename-rename-1to2-add-source-1 &&
@@ -747,7 +748,7 @@ test_expect_failure 'detect conflict with rename/rename(1to2)/add-source merge'
'
test_setup_rename_rename_1to2_add_source_2 () {
- test_create_repo rename-rename-1to2-add-source-2 &&
+ git init rename-rename-1to2-add-source-2 &&
(
cd rename-rename-1to2-add-source-2 &&
@@ -793,7 +794,7 @@ test_expect_failure 'rename/rename/add-source still tracks new a file' '
'
test_setup_rename_rename_1to2_add_dest () {
- test_create_repo rename-rename-1to2-add-dest &&
+ git init rename-rename-1to2-add-dest &&
(
cd rename-rename-1to2-add-dest &&
@@ -873,7 +874,7 @@ test_expect_success 'rename/rename/add-dest merge still knows about conflicting
# Expected: CONFLICT (rename/add/delete), two-way merged bar
test_setup_rad () {
- test_create_repo rad &&
+ git init rad &&
(
cd rad &&
echo "original file" >foo &&
@@ -913,8 +914,8 @@ test_expect_merge_algorithm failure success 'rad-check: rename/add/delete confli
# be flexible in the type of console output message(s) reported
# for this particular case; we will be more stringent about the
# contents of the index and working directory.
- test_i18ngrep "CONFLICT (.*/add)" out &&
- test_i18ngrep "CONFLICT (rename.*/delete)" out &&
+ test_grep "CONFLICT (.*/add)" out &&
+ test_grep "CONFLICT (rename.*/delete)" out &&
test_must_be_empty err &&
git ls-files -s >file_count &&
@@ -945,7 +946,7 @@ test_expect_merge_algorithm failure success 'rad-check: rename/add/delete confli
# Expected: CONFLICT (rename/rename/delete/delete), two-way merged baz
test_setup_rrdd () {
- test_create_repo rrdd &&
+ git init rrdd &&
(
cd rrdd &&
echo foo >foo &&
@@ -987,8 +988,8 @@ test_expect_merge_algorithm failure success 'rrdd-check: rename/rename(2to1)/del
# be flexible in the type of console output message(s) reported
# for this particular case; we will be more stringent about the
# contents of the index and working directory.
- test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
- test_i18ngrep "CONFLICT (rename.*delete)" out &&
+ test_grep "CONFLICT (\(.*\)/\1)" out &&
+ test_grep "CONFLICT (rename.*delete)" out &&
test_must_be_empty err &&
git ls-files -s >file_count &&
@@ -1021,7 +1022,7 @@ test_expect_merge_algorithm failure success 'rrdd-check: rename/rename(2to1)/del
# multi-way merged contents found in two, four, six
test_setup_mod6 () {
- test_create_repo mod6 &&
+ git init mod6 &&
(
cd mod6 &&
test_seq 11 19 >one &&
@@ -1067,7 +1068,7 @@ test_expect_merge_algorithm failure success 'mod6-check: chains of rename/rename
test_must_fail git merge -s recursive B^0 >out 2>err &&
- test_i18ngrep "CONFLICT (rename/rename)" out &&
+ test_grep "CONFLICT (rename/rename)" out &&
test_must_be_empty err &&
git ls-files -s >file_count &&
@@ -1158,8 +1159,7 @@ test_conflicts_with_adds_and_renames() {
# 4) There should not be any three~* files in the working
# tree
test_setup_collision_conflict () {
- #test_expect_success "setup simple $sideL/$sideR conflict" '
- test_create_repo simple_${sideL}_${sideR} &&
+ git init simple_${sideL}_${sideR} &&
(
cd simple_${sideL}_${sideR} &&
@@ -1235,7 +1235,6 @@ test_conflicts_with_adds_and_renames() {
fi &&
test_tick && git commit -m R
)
- #'
}
test_expect_success "check simple $sideL/$sideR conflict" '
@@ -1307,7 +1306,7 @@ test_conflicts_with_adds_and_renames add add
# So, we have four different conflicting files that all end up at path
# 'three'.
test_setup_nested_conflicts_from_rename_rename () {
- test_create_repo nested_conflicts_from_rename_rename &&
+ git init nested_conflicts_from_rename_rename &&
(
cd nested_conflicts_from_rename_rename &&
@@ -1416,7 +1415,7 @@ test_expect_success 'check nested conflicts from rename/rename(2to1)' '
# Expected: CONFLICT(rename/rename) message, three unstaged entries in the
# index, and contents of orig-[AB] at path orig-[AB]
test_setup_rename_rename_1_to_2_binary () {
- test_create_repo rename_rename_1_to_2_binary &&
+ git init rename_rename_1_to_2_binary &&
(
cd rename_rename_1_to_2_binary &&
diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh
index 99baf77..88d1cf2 100755
--- a/t/t6423-merge-rename-directories.sh
+++ b/t/t6423-merge-rename-directories.sh
@@ -40,7 +40,7 @@ test_description="recursive merge with directory renames"
# Expected: y/{b,c,d,e/f}
test_setup_1a () {
- test_create_repo 1a &&
+ git init 1a &&
(
cd 1a &&
@@ -106,7 +106,7 @@ test_expect_success '1a: Simple directory rename detection' '
# Expected: y/{b,c,d,e}
test_setup_1b () {
- test_create_repo 1b &&
+ git init 1b &&
(
cd 1b &&
@@ -169,7 +169,7 @@ test_expect_success '1b: Merge a directory with another' '
# Expected: y/{b,c,d} (because x/d -> z/d -> y/d)
test_setup_1c () {
- test_create_repo 1c &&
+ git init 1c &&
(
cd 1c &&
@@ -232,7 +232,7 @@ test_expect_success '1c: Transitive renaming' '
# y/wham_1 & z/wham_2 should too...giving us a conflict.
test_setup_1d () {
- test_create_repo 1d &&
+ git init 1d &&
(
cd 1d &&
@@ -276,7 +276,7 @@ test_expect_success '1d: Directory renames cause a rename/rename(2to1) conflict'
git checkout A^0 &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
- test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
+ test_grep "CONFLICT (\(.*\)/\1)" out &&
git ls-files -s >out &&
test_line_count = 8 out &&
@@ -328,7 +328,7 @@ test_expect_success '1d: Directory renames cause a rename/rename(2to1) conflict'
# Expected: y/{newb,newc,d}
test_setup_1e () {
- test_create_repo 1e &&
+ git init 1e &&
(
cd 1e &&
@@ -387,7 +387,7 @@ test_expect_success '1e: Renamed directory, with all files being renamed too' '
# Expected: y/{b,c}, x/{d,e,f,g}
test_setup_1f () {
- test_create_repo 1f &&
+ git init 1f &&
(
cd 1f &&
@@ -476,7 +476,7 @@ test_expect_success '1f: Split a directory into two other directories' '
# Commit B: z/{b,c,d}
# Expected: y/b, w/c, z/d, with warning about z/ -> (y/ vs. w/) conflict
test_setup_2a () {
- test_create_repo 2a &&
+ git init 2a &&
(
cd 2a &&
@@ -515,7 +515,7 @@ test_expect_success '2a: Directory split into two on one side, with equal number
git checkout A^0 &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
- test_i18ngrep "CONFLICT.*directory rename split" out &&
+ test_grep "CONFLICT.*directory rename split" out &&
git ls-files -s >out &&
test_line_count = 3 out &&
@@ -538,7 +538,7 @@ test_expect_success '2a: Directory split into two on one side, with equal number
# Commit B: z/{b,c}, x/d
# Expected: y/b, w/c, x/d; No warning about z/ -> (y/ vs. w/) conflict
test_setup_2b () {
- test_create_repo 2b &&
+ git init 2b &&
(
cd 2b &&
@@ -591,7 +591,7 @@ test_expect_success '2b: Directory split into two on one side, with equal number
git rev-parse >expect \
O:z/b O:z/c B:x/d &&
test_cmp expect actual &&
- test_i18ngrep ! "CONFLICT.*directory rename split" out
+ test_grep ! "CONFLICT.*directory rename split" out
)
'
@@ -620,7 +620,7 @@ test_expect_success '2b: Directory split into two on one side, with equal number
# Commit B: y/{b,c}, x/d
# Expected: y/{b,c}, x/d
test_setup_3a () {
- test_create_repo 3a &&
+ git init 3a &&
(
cd 3a &&
@@ -684,7 +684,7 @@ test_expect_success '3a: Avoid implicit rename if involved as source on other si
# end up with CONFLICT:(z/d -> y/d vs. x/d vs. w/d), i.e. a
# rename/rename/rename(1to3) conflict, which is just weird.
test_setup_3b () {
- test_create_repo 3b &&
+ git init 3b &&
(
cd 3b &&
@@ -726,8 +726,8 @@ test_expect_success '3b: Avoid implicit rename if involved as source on current
git checkout A^0 &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
- test_i18ngrep CONFLICT.*rename/rename.*z/d.*x/d.*w/d out &&
- test_i18ngrep ! CONFLICT.*rename/rename.*y/d out &&
+ test_grep CONFLICT.*rename/rename.*z/d.*x/d.*w/d out &&
+ test_grep ! CONFLICT.*rename/rename.*y/d out &&
git ls-files -s >out &&
test_line_count = 5 out &&
@@ -807,7 +807,7 @@ test_expect_success '3b: Avoid implicit rename if involved as source on current
# NOTE: Even though most files from z moved to y, we don't want f to follow.
test_setup_4a () {
- test_create_repo 4a &&
+ git init 4a &&
(
cd 4a &&
@@ -896,7 +896,7 @@ test_expect_success '4a: Directory split, with original directory still present'
# index.
test_setup_5a () {
- test_create_repo 5a &&
+ git init 5a &&
(
cd 5a &&
@@ -938,7 +938,7 @@ test_expect_success '5a: Merge directories, other side adds files to original an
git checkout A^0 &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
- test_i18ngrep "CONFLICT.*implicit dir rename" out &&
+ test_grep "CONFLICT.*implicit dir rename" out &&
git ls-files -s >out &&
test_line_count = 6 out &&
@@ -971,7 +971,7 @@ test_expect_success '5a: Merge directories, other side adds files to original an
# back to git behavior without the directory rename detection.
test_setup_5b () {
- test_create_repo 5b &&
+ git init 5b &&
(
cd 5b &&
@@ -1013,7 +1013,7 @@ test_expect_success '5b: Rename/delete in order to get add/add/add conflict' '
git checkout A^0 &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
- test_i18ngrep "CONFLICT (add/add).* y/d" out &&
+ test_grep "CONFLICT (add/add).* y/d" out &&
git ls-files -s >out &&
test_line_count = 5 out &&
@@ -1048,7 +1048,7 @@ test_expect_success '5b: Rename/delete in order to get add/add/add conflict' '
# though, because it doesn't have anything in the way.
test_setup_5c () {
- test_create_repo 5c &&
+ git init 5c &&
(
cd 5c &&
@@ -1094,8 +1094,8 @@ test_expect_success '5c: Transitive rename would cause rename/rename/rename/add/
git checkout A^0 &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
- test_i18ngrep "CONFLICT (rename/rename).*x/d.*w/d.*z/d" out &&
- test_i18ngrep "CONFLICT (add/add).* y/d" out &&
+ test_grep "CONFLICT (rename/rename).*x/d.*w/d.*z/d" out &&
+ test_grep "CONFLICT (add/add).* y/d" out &&
git ls-files -s >out &&
test_line_count = 9 out &&
@@ -1138,7 +1138,7 @@ test_expect_success '5c: Transitive rename would cause rename/rename/rename/add/
# directory rename detection for z/f -> y/f.
test_setup_5d () {
- test_create_repo 5d &&
+ git init 5d &&
(
cd 5d &&
@@ -1179,7 +1179,7 @@ test_expect_success '5d: Directory/file/file conflict due to directory rename' '
git checkout A^0 &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
- test_i18ngrep "CONFLICT (file/directory).*y/d" out &&
+ test_grep "CONFLICT (file/directory).*y/d" out &&
git ls-files -s >out &&
test_line_count = 6 out &&
@@ -1239,7 +1239,7 @@ test_expect_success '5d: Directory/file/file conflict due to directory rename' '
# it is also involved in a rename/delete conflict.
test_setup_6a () {
- test_create_repo 6a &&
+ git init 6a &&
(
cd 6a &&
@@ -1278,7 +1278,7 @@ test_expect_success '6a: Tricky rename/delete' '
git checkout A^0 &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
- test_i18ngrep "CONFLICT (rename/delete).*z/c.*y/c" out &&
+ test_grep "CONFLICT (rename/delete).*z/c.*y/c" out &&
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
@@ -1337,7 +1337,7 @@ test_expect_success '6a: Tricky rename/delete' '
# the behavior on testcases 6b2 and 8e, and introduced this 6b1 testcase.
test_setup_6b1 () {
- test_create_repo 6b1 &&
+ git init 6b1 &&
(
cd 6b1 &&
@@ -1415,7 +1415,7 @@ test_expect_merge_algorithm failure success '6b1: Same renames done on both side
# the z/ -> y/ rename.
test_setup_6b2 () {
- test_create_repo 6b2 &&
+ git init 6b2 &&
(
cd 6b2 &&
@@ -1479,7 +1479,7 @@ test_expect_merge_algorithm failure success '6b2: Same rename done on both sides
# "accidentally detect a rename" and give us y/{b,c,d}.
test_setup_6c () {
- test_create_repo 6c &&
+ git init 6c &&
(
cd 6c &&
@@ -1542,7 +1542,7 @@ test_expect_success '6c: Rename only done on same side' '
# doesn't "accidentally detect a rename" and give us y/{b,c,d}.
test_setup_6d () {
- test_create_repo 6d &&
+ git init 6d &&
(
cd 6d &&
@@ -1605,7 +1605,7 @@ test_expect_success '6d: We do not always want transitive renaming' '
# add/add conflict on y/d_1 vs y/d_2.
test_setup_6e () {
- test_create_repo 6e &&
+ git init 6e &&
(
cd 6e &&
@@ -1700,7 +1700,7 @@ test_expect_success '6e: Add/add from one side' '
# NOTE: There's a rename of z/ here, y/ has more renames, so z/d -> y/d.
test_setup_7a () {
- test_create_repo 7a &&
+ git init 7a &&
(
cd 7a &&
@@ -1740,8 +1740,8 @@ test_expect_success '7a: rename-dir vs. rename-dir (NOT split evenly) PLUS add-o
git checkout A^0 &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
- test_i18ngrep "CONFLICT (rename/rename).*z/b.*y/b.*w/b" out &&
- test_i18ngrep "CONFLICT (rename/rename).*z/c.*y/c.*x/c" out &&
+ test_grep "CONFLICT (rename/rename).*z/b.*y/b.*w/b" out &&
+ test_grep "CONFLICT (rename/rename).*z/c.*y/c.*x/c" out &&
git ls-files -s >out &&
test_line_count = 7 out &&
@@ -1772,7 +1772,7 @@ test_expect_success '7a: rename-dir vs. rename-dir (NOT split evenly) PLUS add-o
# Expected: y/{b,c}, CONFLICT(rename/rename(2to1): x/d_1, w/d_2 -> y_d)
test_setup_7b () {
- test_create_repo 7b &&
+ git init 7b &&
(
cd 7b &&
@@ -1813,7 +1813,7 @@ test_expect_success '7b: rename/rename(2to1), but only due to transitive rename'
git checkout A^0 &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
- test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
+ test_grep "CONFLICT (\(.*\)/\1)" out &&
git ls-files -s >out &&
test_line_count = 4 out &&
@@ -1861,7 +1861,7 @@ test_expect_success '7b: rename/rename(2to1), but only due to transitive rename'
# nor CONFLiCT x/d -> w/d vs. y/d vs. z/d)
test_setup_7c () {
- test_create_repo 7c &&
+ git init 7c &&
(
cd 7c &&
@@ -1900,7 +1900,7 @@ test_expect_success '7c: rename/rename(1to...2or3); transitive rename may add co
git checkout A^0 &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
- test_i18ngrep "CONFLICT (rename/rename).*x/d.*w/d.*y/d" out &&
+ test_grep "CONFLICT (rename/rename).*x/d.*w/d.*y/d" out &&
git ls-files -s >out &&
test_line_count = 5 out &&
@@ -1926,7 +1926,7 @@ test_expect_success '7c: rename/rename(1to...2or3); transitive rename may add co
# NOTE: z->y so NOT CONFLICT(delete x/d vs rename to z/d)
test_setup_7d () {
- test_create_repo 7d &&
+ git init 7d &&
(
cd 7d &&
@@ -1965,7 +1965,7 @@ test_expect_success '7d: transitive rename involved in rename/delete; how is it
git checkout A^0 &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
- test_i18ngrep "CONFLICT (rename/delete).*x/d.*y/d" out &&
+ test_grep "CONFLICT (rename/delete).*x/d.*y/d" out &&
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
@@ -2027,7 +2027,7 @@ test_expect_success '7d: transitive rename involved in rename/delete; how is it
# how it's resolved.
test_setup_7e () {
- test_create_repo 7e &&
+ git init 7e &&
(
cd 7e &&
@@ -2071,7 +2071,7 @@ test_expect_success '7e: transitive rename in rename/delete AND dirs in the way'
git checkout A^0 &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
- test_i18ngrep "CONFLICT (rename/delete).*x/d.*y/d" out &&
+ test_grep "CONFLICT (rename/delete).*x/d.*y/d" out &&
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
@@ -2137,7 +2137,7 @@ test_expect_success '7e: transitive rename in rename/delete AND dirs in the way'
# we potentially could.
test_setup_8a () {
- test_create_repo 8a &&
+ git init 8a &&
(
cd 8a &&
@@ -2216,7 +2216,7 @@ test_expect_success '8a: Dual-directory rename, one into the others way' '
# e_1 and e_2.
test_setup_8b () {
- test_create_repo 8b &&
+ git init 8b &&
(
cd 8b &&
@@ -2290,7 +2290,7 @@ test_expect_success '8b: Dual-directory rename, one into the others way, with co
# notes in 8d.
test_setup_8c () {
- test_create_repo 8c &&
+ git init 8c &&
(
cd 8c &&
@@ -2330,7 +2330,7 @@ test_expect_success '8c: modify/delete or rename+modify/delete' '
git checkout A^0 &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
- test_i18ngrep "CONFLICT (modify/delete).* z/d" out &&
+ test_grep "CONFLICT (modify/delete).* z/d" out &&
git ls-files -s >out &&
test_line_count = 5 out &&
@@ -2370,7 +2370,7 @@ test_expect_success '8c: modify/delete or rename+modify/delete' '
# differently.
test_setup_8d () {
- test_create_repo 8d &&
+ git init 8d &&
(
cd 8d &&
@@ -2453,7 +2453,7 @@ test_expect_success '8d: rename/delete...or not?' '
# the behavior, and predict it without computing as many details.
test_setup_8e () {
- test_create_repo 8e &&
+ git init 8e &&
(
cd 8e &&
@@ -2491,8 +2491,8 @@ test_expect_success '8e: Both sides rename, one side adds to original directory'
git checkout A^0 &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
- test_i18ngrep CONFLICT.*rename/rename.*z/c.*y/c.*w/c out &&
- test_i18ngrep CONFLICT.*rename/rename.*z/b.*y/b.*w/b out &&
+ test_grep CONFLICT.*rename/rename.*z/c.*y/c.*w/c out &&
+ test_grep CONFLICT.*rename/rename.*z/b.*y/b.*w/b out &&
git ls-files -s >out &&
test_line_count = 7 out &&
@@ -2537,7 +2537,7 @@ test_expect_success '8e: Both sides rename, one side adds to original directory'
# of that could take the new file in commit B at z/i to x/w/i or x/i.
test_setup_9a () {
- test_create_repo 9a &&
+ git init 9a &&
(
cd 9a &&
@@ -2609,7 +2609,7 @@ test_expect_success '9a: Inner renamed directory within outer renamed directory'
# Expected: y/{b,c,d_merged}
test_setup_9b () {
- test_create_repo 9b &&
+ git init 9b &&
(
cd 9b &&
@@ -2697,7 +2697,7 @@ test_expect_success '9b: Transitive rename with content merge' '
# history for any implicit directory renames.
test_setup_9c () {
- test_create_repo 9c &&
+ git init 9c &&
(
cd 9c &&
@@ -2741,7 +2741,7 @@ test_expect_success '9c: Doubly transitive rename?' '
git checkout A^0 &&
git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
- test_i18ngrep "WARNING: Avoiding applying x -> z rename to x/f" out &&
+ test_grep "WARNING: Avoiding applying x -> z rename to x/f" out &&
git ls-files -s >out &&
test_line_count = 6 out &&
@@ -2786,7 +2786,7 @@ test_expect_success '9c: Doubly transitive rename?' '
# testcases and simplifies things for the user.
test_setup_9d () {
- test_create_repo 9d &&
+ git init 9d &&
(
cd 9d &&
@@ -2830,10 +2830,10 @@ test_expect_success '9d: N-way transitive rename?' '
git checkout A^0 &&
git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
- test_i18ngrep "WARNING: Avoiding applying z -> y rename to z/t" out &&
- test_i18ngrep "WARNING: Avoiding applying y -> x rename to y/a" out &&
- test_i18ngrep "WARNING: Avoiding applying x -> w rename to x/b" out &&
- test_i18ngrep "WARNING: Avoiding applying w -> v rename to w/c" out &&
+ test_grep "WARNING: Avoiding applying z -> y rename to z/t" out &&
+ test_grep "WARNING: Avoiding applying y -> x rename to y/a" out &&
+ test_grep "WARNING: Avoiding applying x -> w rename to x/b" out &&
+ test_grep "WARNING: Avoiding applying w -> v rename to w/c" out &&
git ls-files -s >out &&
test_line_count = 7 out &&
@@ -2861,7 +2861,7 @@ test_expect_success '9d: N-way transitive rename?' '
# dir1/yo, dir2/yo, dir3/yo, dirN/yo
test_setup_9e () {
- test_create_repo 9e &&
+ git init 9e &&
(
cd 9e &&
@@ -2954,7 +2954,7 @@ test_expect_success '9e: N-to-1 whammo' '
# Expected: priority/{a,b}/$more_files, priority/c
test_setup_9f () {
- test_create_repo 9f &&
+ git init 9f &&
(
cd 9f &&
@@ -3027,7 +3027,7 @@ test_expect_success '9f: Renamed directory that only contained immediate subdirs
# viewpoint...
test_setup_9g () {
- test_create_repo 9g &&
+ git init 9g &&
(
cd 9g &&
@@ -3096,7 +3096,7 @@ test_expect_failure '9g: Renamed directory that only contained immediate subdirs
# NOTE: If we applied the z/ -> y/ rename to z/d, then we'd end up with
# a rename/rename(1to2) conflict (z/d -> y/d vs. x/d)
test_setup_9h () {
- test_create_repo 9h &&
+ git init 9h &&
(
cd 9h &&
@@ -3177,7 +3177,7 @@ test_expect_success '9h: Avoid dir rename on merely modified path' '
# ERROR_MSG(untracked working tree files would be overwritten by merge)
test_setup_10a () {
- test_create_repo 10a &&
+ git init 10a &&
(
cd 10a &&
@@ -3215,7 +3215,7 @@ test_expect_success '10a: Overwrite untracked with normal rename/delete' '
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
test_path_is_missing .git/MERGE_HEAD &&
- test_i18ngrep "The following untracked working tree files would be overwritten by merge" err &&
+ test_grep "The following untracked working tree files would be overwritten by merge" err &&
git ls-files -s >out &&
test_line_count = 1 out &&
@@ -3243,7 +3243,7 @@ test_expect_success '10a: Overwrite untracked with normal rename/delete' '
# ERROR_MSG(refusing to lose untracked file at 'y/d')
test_setup_10b () {
- test_create_repo 10b &&
+ git init 10b &&
(
cd 10b &&
@@ -3287,7 +3287,7 @@ test_expect_success '10b: Overwrite untracked with dir rename + delete' '
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
test_path_is_missing .git/MERGE_HEAD &&
- test_i18ngrep "error: The following untracked working tree files would be overwritten by merge" err &&
+ test_grep "error: The following untracked working tree files would be overwritten by merge" err &&
git ls-files -s >out &&
test_line_count = 1 out &&
@@ -3296,8 +3296,8 @@ test_expect_success '10b: Overwrite untracked with dir rename + delete' '
git ls-files -o >out &&
test_line_count = 5 out
else
- test_i18ngrep "CONFLICT (rename/delete).*Version B\^0 of y/d left in tree at y/d~B\^0" out &&
- test_i18ngrep "Error: Refusing to lose untracked file at y/e; writing to y/e~B\^0 instead" out &&
+ test_grep "CONFLICT (rename/delete).*Version B\^0 of y/d left in tree at y/d~B\^0" out &&
+ test_grep "Error: Refusing to lose untracked file at y/e; writing to y/e~B\^0 instead" out &&
git ls-files -s >out &&
test_line_count = 3 out &&
@@ -3334,7 +3334,7 @@ test_expect_success '10b: Overwrite untracked with dir rename + delete' '
# ERROR_MSG(Refusing to lose untracked file at y/c)
test_setup_10c () {
- test_create_repo 10c_$1 &&
+ git init 10c_$1 &&
(
cd 10c_$1 &&
@@ -3377,7 +3377,7 @@ test_expect_success '10c1: Overwrite untracked with dir rename/rename(1to2)' '
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
test_path_is_missing .git/MERGE_HEAD &&
- test_i18ngrep "error: The following untracked working tree files would be overwritten by merge" err &&
+ test_grep "error: The following untracked working tree files would be overwritten by merge" err &&
git ls-files -s >out &&
test_line_count = 4 out &&
@@ -3386,8 +3386,8 @@ test_expect_success '10c1: Overwrite untracked with dir rename/rename(1to2)' '
git ls-files -o >out &&
test_line_count = 3 out
else
- test_i18ngrep "CONFLICT (rename/rename)" out &&
- test_i18ngrep "Refusing to lose untracked file at y/c; adding as y/c~B\^0 instead" out &&
+ test_grep "CONFLICT (rename/rename)" out &&
+ test_grep "Refusing to lose untracked file at y/c; adding as y/c~B\^0 instead" out &&
git ls-files -s >out &&
test_line_count = 6 out &&
@@ -3428,7 +3428,7 @@ test_expect_success '10c2: Overwrite untracked with dir rename/rename(1to2), oth
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
test_path_is_missing .git/MERGE_HEAD &&
- test_i18ngrep "error: The following untracked working tree files would be overwritten by merge" err &&
+ test_grep "error: The following untracked working tree files would be overwritten by merge" err &&
git ls-files -s >out &&
test_line_count = 4 out &&
@@ -3437,8 +3437,8 @@ test_expect_success '10c2: Overwrite untracked with dir rename/rename(1to2), oth
git ls-files -o >out &&
test_line_count = 3 out
else
- test_i18ngrep "CONFLICT (rename/rename)" out &&
- test_i18ngrep "Refusing to lose untracked file at y/c; adding as y/c~HEAD instead" out &&
+ test_grep "CONFLICT (rename/rename)" out &&
+ test_grep "Refusing to lose untracked file at y/c; adding as y/c~HEAD instead" out &&
git ls-files -s >out &&
test_line_count = 6 out &&
@@ -3472,7 +3472,7 @@ test_expect_success '10c2: Overwrite untracked with dir rename/rename(1to2), oth
# ERROR_MSG(Refusing to lose untracked file at y/wham)
test_setup_10d () {
- test_create_repo 10d &&
+ git init 10d &&
(
cd 10d &&
@@ -3517,7 +3517,7 @@ test_expect_success '10d: Delete untracked with dir rename/rename(2to1)' '
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
test_path_is_missing .git/MERGE_HEAD &&
- test_i18ngrep "error: The following untracked working tree files would be overwritten by merge" err &&
+ test_grep "error: The following untracked working tree files would be overwritten by merge" err &&
git ls-files -s >out &&
test_line_count = 6 out &&
@@ -3526,8 +3526,8 @@ test_expect_success '10d: Delete untracked with dir rename/rename(2to1)' '
git ls-files -o >out &&
test_line_count = 3 out
else
- test_i18ngrep "CONFLICT (rename/rename)" out &&
- test_i18ngrep "Refusing to lose untracked file at y/wham" out &&
+ test_grep "CONFLICT (rename/rename)" out &&
+ test_grep "Refusing to lose untracked file at y/wham" out &&
git ls-files -s >out &&
test_line_count = 6 out &&
@@ -3568,7 +3568,7 @@ test_expect_success '10d: Delete untracked with dir rename/rename(2to1)' '
# Expected: y/{a,b,c} + untracked z/c
test_setup_10e () {
- test_create_repo 10e &&
+ git init 10e &&
(
cd 10e &&
@@ -3606,7 +3606,7 @@ test_expect_merge_algorithm failure success '10e: Does git complain about untrac
echo random >z/c &&
git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
- test_i18ngrep ! "following untracked working tree files would be overwritten by merge" err &&
+ test_grep ! "following untracked working tree files would be overwritten by merge" err &&
git ls-files -s >out &&
test_line_count = 3 out &&
@@ -3650,7 +3650,7 @@ test_expect_merge_algorithm failure success '10e: Does git complain about untrac
# z/c with uncommitted mods on top of A:z/c_v1
test_setup_11a () {
- test_create_repo 11a &&
+ git init 11a &&
(
cd 11a &&
@@ -3690,9 +3690,9 @@ test_expect_success '11a: Avoid losing dirty contents with simple rename' '
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
test_path_is_missing .git/MERGE_HEAD &&
- test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+ test_grep "error: Your local changes to the following files would be overwritten by merge" err
else
- test_i18ngrep "Refusing to lose dirty file at z/c" out &&
+ test_grep "Refusing to lose dirty file at z/c" out &&
git ls-files -s >out &&
test_line_count = 2 out &&
@@ -3728,7 +3728,7 @@ test_expect_success '11a: Avoid losing dirty contents with simple rename' '
test_setup_11b () {
- test_create_repo 11b &&
+ git init 11b &&
(
cd 11b &&
@@ -3770,10 +3770,10 @@ test_expect_success '11b: Avoid losing dirty file involved in directory rename'
then
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
test_path_is_missing .git/MERGE_HEAD &&
- test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+ test_grep "error: Your local changes to the following files would be overwritten by merge" err
else
git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
- test_i18ngrep "Refusing to lose dirty file at z/c" out &&
+ test_grep "Refusing to lose dirty file at z/c" out &&
git ls-files -s >out &&
test_line_count = 3 out &&
@@ -3810,7 +3810,7 @@ test_expect_success '11b: Avoid losing dirty file involved in directory rename'
# y/c left untouched (still has uncommitted mods)
test_setup_11c () {
- test_create_repo 11c &&
+ git init 11c &&
(
cd 11c &&
@@ -3853,9 +3853,9 @@ test_expect_success '11c: Avoid losing not-uptodate with rename + D/F conflict'
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
test_path_is_missing .git/MERGE_HEAD &&
- test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+ test_grep "error: Your local changes to the following files would be overwritten by merge" err
else
- test_i18ngrep "following files would be overwritten by merge" err
+ test_grep "following files would be overwritten by merge" err
fi &&
grep -q stuff y/c &&
@@ -3883,7 +3883,7 @@ test_expect_success '11c: Avoid losing not-uptodate with rename + D/F conflict'
# y/{a,c~HEAD,c/d}, x/b, now-untracked z/c_v1 with uncommitted mods
test_setup_11d () {
- test_create_repo 11d &&
+ git init 11d &&
(
cd 11d &&
@@ -3927,9 +3927,9 @@ test_expect_success '11d: Avoid losing not-uptodate with rename + D/F conflict'
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
test_path_is_missing .git/MERGE_HEAD &&
- test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+ test_grep "error: Your local changes to the following files would be overwritten by merge" err
else
- test_i18ngrep "Refusing to lose dirty file at z/c" out &&
+ test_grep "Refusing to lose dirty file at z/c" out &&
git ls-files -s >out &&
test_line_count = 4 out &&
@@ -3968,7 +3968,7 @@ test_expect_success '11d: Avoid losing not-uptodate with rename + D/F conflict'
# y/c has dirty file from before merge
test_setup_11e () {
- test_create_repo 11e &&
+ git init 11e &&
(
cd 11e &&
@@ -4013,10 +4013,10 @@ test_expect_success '11e: Avoid deleting not-uptodate with dir rename/rename(1to
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
test_path_is_missing .git/MERGE_HEAD &&
- test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+ test_grep "error: Your local changes to the following files would be overwritten by merge" err
else
- test_i18ngrep "CONFLICT (rename/rename)" out &&
- test_i18ngrep "Refusing to lose dirty file at y/c" out &&
+ test_grep "CONFLICT (rename/rename)" out &&
+ test_grep "Refusing to lose dirty file at y/c" out &&
git ls-files -s >out &&
test_line_count = 7 out &&
@@ -4060,7 +4060,7 @@ test_expect_success '11e: Avoid deleting not-uptodate with dir rename/rename(1to
# ERROR_MSG(Refusing to lose dirty file at y/wham)
test_setup_11f () {
- test_create_repo 11f &&
+ git init 11f &&
(
cd 11f &&
@@ -4102,10 +4102,10 @@ test_expect_success '11f: Avoid deleting not-uptodate with dir rename/rename(2to
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
test_path_is_missing .git/MERGE_HEAD &&
- test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+ test_grep "error: Your local changes to the following files would be overwritten by merge" err
else
- test_i18ngrep "CONFLICT (rename/rename)" out &&
- test_i18ngrep "Refusing to lose dirty file at y/wham" out &&
+ test_grep "CONFLICT (rename/rename)" out &&
+ test_grep "Refusing to lose dirty file at y/wham" out &&
git ls-files -s >out &&
test_line_count = 4 out &&
@@ -4155,7 +4155,7 @@ test_expect_success '11f: Avoid deleting not-uptodate with dir rename/rename(2to
# Expected: node1/{leaf1,leaf2,leaf5,node2/{leaf3,leaf4,leaf6}}
test_setup_12a () {
- test_create_repo 12a &&
+ git init 12a &&
(
cd 12a &&
@@ -4238,7 +4238,7 @@ test_expect_success '12a: Moving one directory hierarchy into another' '
# node2/node1/{leaf1, leaf2}
test_setup_12b1 () {
- test_create_repo 12b1 &&
+ git init 12b1 &&
(
cd 12b1 &&
@@ -4327,7 +4327,7 @@ test_expect_merge_algorithm failure success '12b1: Moving two directory hierarch
# even simple rules give weird results when given weird inputs.
test_setup_12b2 () {
- test_create_repo 12b2 &&
+ git init 12b2 &&
(
cd 12b2 &&
@@ -4402,7 +4402,7 @@ test_expect_success '12b2: Moving two directory hierarchies into each other' '
# each side of the merge.
test_setup_12c1 () {
- test_create_repo 12c1 &&
+ git init 12c1 &&
(
cd 12c1 &&
@@ -4492,7 +4492,7 @@ test_expect_merge_algorithm failure success '12c1: Moving one directory hierarch
# on each side of the merge.
test_setup_12c2 () {
- test_create_repo 12c2 &&
+ git init 12c2 &&
(
cd 12c2 &&
@@ -4584,7 +4584,7 @@ test_expect_success '12c2: Moving one directory hierarchy into another w/ conten
# Expected: subdir/foo, bar
test_setup_12d () {
- test_create_repo 12d &&
+ git init 12d &&
(
cd 12d &&
@@ -4642,7 +4642,7 @@ test_expect_success '12d: Rename/merge subdir into the root, variant 1' '
# Expected: foo, bar
test_setup_12e () {
- test_create_repo 12e &&
+ git init 12e &&
(
cd 12e &&
@@ -4743,7 +4743,7 @@ test_expect_success '12e: Rename/merge subdir into the root, variant 2' '
# pick and re-applying them in the subsequent one.
test_setup_12f () {
- test_create_repo 12f &&
+ git init 12f &&
(
cd 12f &&
@@ -4902,7 +4902,7 @@ test_expect_merge_algorithm failure success '12f: Trivial directory resolve, cac
# Expected: newfile_{merged}, newdir/{a_B,b_B,c_A}
test_setup_12g () {
- test_create_repo 12g &&
+ git init 12g &&
(
cd 12g &&
@@ -4973,7 +4973,7 @@ test_expect_success '12g: Testcase with two kinds of "relevant" renames' '
# Expected: newdir/{alpha_2, b}
test_setup_12h () {
- test_create_repo 12h &&
+ git init 12h &&
(
cd 12h &&
@@ -5032,7 +5032,7 @@ test_expect_failure '12h: renaming a file within a renamed directory' '
# source/bar vs. source/subdir/bar
test_setup_12i () {
- test_create_repo 12i &&
+ git init 12i &&
(
cd 12i &&
@@ -5090,7 +5090,7 @@ test_expect_success '12i: Directory rename causes rename-to-self' '
# Expected: {foo, bar, baz_2}, with conflicts on bar vs. subdir/bar
test_setup_12j () {
- test_create_repo 12j &&
+ git init 12j &&
(
cd 12j &&
@@ -5148,7 +5148,7 @@ test_expect_success '12j: Directory rename to root causes rename-to-self' '
# Expected: dirA/{foo, bar, baz_2}, with conflicts on dirA/bar vs. dirB/bar
test_setup_12k () {
- test_create_repo 12k &&
+ git init 12k &&
(
cd 12k &&
@@ -5218,7 +5218,7 @@ test_expect_success '12k: Directory rename with sibling causes rename-to-self' '
# is needed for there to be a sub1/ -> sub3/ rename.
test_setup_12l () {
- test_create_repo 12l_$1 &&
+ git init 12l_$1 &&
(
cd 12l_$1 &&
@@ -5304,6 +5304,62 @@ test_expect_merge_algorithm failure success '12l (A into B): Rename into each ot
)
'
+# Testcase 12m, Directory rename, plus change of parent dir to symlink
+# Commit O: dir/subdir/file
+# Commit A: renamed-dir/subdir/file
+# Commit B: dir/subdir
+# In words:
+# A: dir/subdir/ -> renamed-dir/subdir
+# B: delete dir/subdir/file, add dir/subdir as symlink
+#
+# Expected: CONFLICT (rename/delete): renamed-dir/subdir/file,
+# CONFLICT (file location): renamed-dir/subdir vs. dir/subdir
+# CONFLICT (directory/file): renamed-dir/subdir symlink has
+# renamed-dir/subdir in the way
+
+test_setup_12m () {
+ git init 12m &&
+ (
+ cd 12m &&
+
+ mkdir -p dir/subdir &&
+ echo 1 >dir/subdir/file &&
+ git add . &&
+ git commit -m "O" &&
+
+ git branch O &&
+ git branch A &&
+ git branch B &&
+
+ git switch A &&
+ git mv dir/ renamed-dir/ &&
+ git add . &&
+ git commit -m "A" &&
+
+ git switch B &&
+ git rm dir/subdir/file &&
+ mkdir dir &&
+ ln -s /dev/null dir/subdir &&
+ git add . &&
+ git commit -m "B"
+ )
+}
+
+test_expect_merge_algorithm failure success '12m: Change parent of renamed-dir to symlink on other side' '
+ test_setup_12m &&
+ (
+ cd 12m &&
+
+ git checkout -q A^0 &&
+
+ test_must_fail git -c merge.directoryRenames=conflict merge -s recursive B^0 &&
+
+ test_stdout_line_count = 3 git ls-files -s &&
+ test_stdout_line_count = 2 ls -1 renamed-dir &&
+ test_path_is_missing dir
+ )
+'
+
###########################################################################
# SECTION 13: Checking informational and conflict messages
#
@@ -5322,7 +5378,7 @@ test_expect_merge_algorithm failure success '12l (A into B): Rename into each ot
# Expected: y/{b,c,d,e/f}, with notices/conflicts for both y/d and y/e/f
test_setup_13a () {
- test_create_repo 13a_$1 &&
+ git init 13a_$1 &&
(
cd 13a_$1 &&
@@ -5361,8 +5417,8 @@ test_expect_success '13a(conflict): messages for newly added files' '
test_must_fail git merge -s recursive B^0 >out 2>err &&
- test_i18ngrep CONFLICT..file.location.*z/e/f.added.in.B^0.*y/e/f out &&
- test_i18ngrep CONFLICT..file.location.*z/d.added.in.B^0.*y/d out &&
+ test_grep CONFLICT..file.location.*z/e/f.added.in.B^0.*y/e/f out &&
+ test_grep CONFLICT..file.location.*z/d.added.in.B^0.*y/d out &&
git ls-files >paths &&
! grep z/ paths &&
@@ -5385,8 +5441,8 @@ test_expect_success '13a(info): messages for newly added files' '
git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
- test_i18ngrep Path.updated:.*z/e/f.added.in.B^0.*y/e/f out &&
- test_i18ngrep Path.updated:.*z/d.added.in.B^0.*y/d out &&
+ test_grep Path.updated:.*z/e/f.added.in.B^0.*y/e/f out &&
+ test_grep Path.updated:.*z/d.added.in.B^0.*y/d out &&
git ls-files >paths &&
! grep z/ paths &&
@@ -5409,7 +5465,7 @@ test_expect_success '13a(info): messages for newly added files' '
# one about content, and one about file location
test_setup_13b () {
- test_create_repo 13b_$1 &&
+ git init 13b_$1 &&
(
cd 13b_$1 &&
@@ -5451,8 +5507,8 @@ test_expect_success '13b(conflict): messages for transitive rename with conflict
test_must_fail git merge -s recursive B^0 >out 2>err &&
- test_i18ngrep CONFLICT.*content.*Merge.conflict.in.y/d out &&
- test_i18ngrep CONFLICT..file.location.*x/d.renamed.to.z/d.*moved.to.y/d out &&
+ test_grep CONFLICT.*content.*Merge.conflict.in.y/d out &&
+ test_grep CONFLICT..file.location.*x/d.renamed.to.z/d.*moved.to.y/d out &&
git ls-files >paths &&
! grep z/ paths &&
@@ -5473,8 +5529,8 @@ test_expect_success '13b(info): messages for transitive rename with conflicted c
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
- test_i18ngrep CONFLICT.*content.*Merge.conflict.in.y/d out &&
- test_i18ngrep Path.updated:.*x/d.renamed.to.z/d.in.B^0.*moving.it.to.y/d out &&
+ test_grep CONFLICT.*content.*Merge.conflict.in.y/d out &&
+ test_grep Path.updated:.*x/d.renamed.to.z/d.in.B^0.*moving.it.to.y/d out &&
git ls-files >paths &&
! grep z/ paths &&
@@ -5496,7 +5552,7 @@ test_expect_success '13b(info): messages for transitive rename with conflicted c
# shown in testcase 13d.
test_setup_13c () {
- test_create_repo 13c_$1 &&
+ git init 13c_$1 &&
(
cd 13c_$1 &&
@@ -5537,7 +5593,7 @@ test_expect_success '13c(conflict): messages for rename/rename(1to1) via transit
test_must_fail git merge -s recursive B^0 >out 2>err &&
- test_i18ngrep CONFLICT..file.location.*x/d.renamed.to.z/d.*moved.to.y/d out &&
+ test_grep CONFLICT..file.location.*x/d.renamed.to.z/d.*moved.to.y/d out &&
git ls-files >paths &&
! grep z/ paths &&
@@ -5558,7 +5614,7 @@ test_expect_success '13c(info): messages for rename/rename(1to1) via transitive
git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
- test_i18ngrep Path.updated:.*x/d.renamed.to.z/d.in.B^0.*moving.it.to.y/d out &&
+ test_grep Path.updated:.*x/d.renamed.to.z/d.in.B^0.*moving.it.to.y/d out &&
git ls-files >paths &&
! grep z/ paths &&
@@ -5584,7 +5640,7 @@ test_expect_success '13c(info): messages for rename/rename(1to1) via transitive
# No conflict in where a/y ends up, so put it in d/y.
test_setup_13d () {
- test_create_repo 13d_$1 &&
+ git init 13d_$1 &&
(
cd 13d_$1 &&
@@ -5626,8 +5682,8 @@ test_expect_success '13d(conflict): messages for rename/rename(1to1) via dual tr
test_must_fail git merge -s recursive B^0 >out 2>err &&
- test_i18ngrep CONFLICT..file.location.*a/y.renamed.to.b/y.*moved.to.d/y out &&
- test_i18ngrep CONFLICT..file.location.*a/y.renamed.to.c/y.*moved.to.d/y out &&
+ test_grep CONFLICT..file.location.*a/y.renamed.to.b/y.*moved.to.d/y out &&
+ test_grep CONFLICT..file.location.*a/y.renamed.to.c/y.*moved.to.d/y out &&
git ls-files >paths &&
! grep b/ paths &&
@@ -5650,8 +5706,8 @@ test_expect_success '13d(info): messages for rename/rename(1to1) via dual transi
git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
- test_i18ngrep Path.updated.*a/y.renamed.to.b/y.*moving.it.to.d/y out &&
- test_i18ngrep Path.updated.*a/y.renamed.to.c/y.*moving.it.to.d/y out &&
+ test_grep Path.updated.*a/y.renamed.to.b/y.*moving.it.to.d/y out &&
+ test_grep Path.updated.*a/y.renamed.to.c/y.*moving.it.to.d/y out &&
git ls-files >paths &&
! grep b/ paths &&
@@ -5710,7 +5766,7 @@ test_expect_success '13d(info): messages for rename/rename(1to1) via dual transi
# least avoids hitting a BUG().
#
test_setup_13e () {
- test_create_repo 13e &&
+ git init 13e &&
(
cd 13e &&
@@ -5765,9 +5821,9 @@ test_expect_success '13e: directory rename detection in recursive case' '
git -c merge.directoryRenames=conflict merge -s recursive C^0 >out 2>err &&
- test_i18ngrep ! CONFLICT out &&
- test_i18ngrep ! BUG: err &&
- test_i18ngrep ! core.dumped err &&
+ test_grep ! CONFLICT out &&
+ test_grep ! BUG: err &&
+ test_grep ! core.dumped err &&
test_must_be_empty err &&
git ls-files >paths &&
diff --git a/t/t6424-merge-unrelated-index-changes.sh b/t/t6424-merge-unrelated-index-changes.sh
index b6e424a..7677c5f 100755
--- a/t/t6424-merge-unrelated-index-changes.sh
+++ b/t/t6424-merge-unrelated-index-changes.sh
@@ -114,6 +114,39 @@ test_expect_success 'resolve, non-trivial' '
test_path_is_missing .git/MERGE_HEAD
'
+test_expect_success 'resolve, trivial, related file removed' '
+ git reset --hard &&
+ git checkout B^0 &&
+
+ git rm a &&
+ test_path_is_missing a &&
+
+ test_must_fail git merge -s resolve C^0 &&
+
+ test_path_is_missing a &&
+ test_path_is_missing .git/MERGE_HEAD
+'
+
+test_expect_success 'resolve, non-trivial, related file removed' '
+ git reset --hard &&
+ git checkout B^0 &&
+
+ git rm a &&
+ test_path_is_missing a &&
+
+ # We also ask for recursive in order to turn off the "allow_trivial"
+ # setting in builtin/merge.c, and ensure that resolve really does
+ # correctly fail the merge (I guess this also tests that recursive
+ # correctly fails the merge, but the main thing we are attempting
+ # to test here is resolve and are just using the side effect of
+ # adding recursive to ensure that resolve is actually tested rather
+ # than the trivial merge codepath)
+ test_must_fail git merge -s resolve -s recursive D^0 &&
+
+ test_path_is_missing a &&
+ test_path_is_missing .git/MERGE_HEAD
+'
+
test_expect_success 'recursive' '
git reset --hard &&
git checkout B^0 &&
@@ -145,7 +178,7 @@ test_expect_success 'merge-recursive, when index==head but head!=HEAD' '
test_when_finished "git clean -fd" && # Do not leave untracked around
# Merge B & F, with B as "head"
git merge-recursive A -- B F > out &&
- test_i18ngrep "Already up to date" out
+ test_grep "Already up to date" out
'
test_expect_success 'recursive, when file has staged changes not matching HEAD nor what a merge would give' '
@@ -161,7 +194,7 @@ test_expect_success 'recursive, when file has staged changes not matching HEAD n
test_must_fail git merge -s recursive E^0 2>err &&
git rev-parse --verify :subdir/a >actual &&
test_cmp expect actual &&
- test_i18ngrep "changes to the following files would be overwritten" err
+ test_grep "changes to the following files would be overwritten" err
'
test_expect_success 'recursive, when file has staged changes matching what a merge would give' '
@@ -177,7 +210,7 @@ test_expect_success 'recursive, when file has staged changes matching what a mer
test_must_fail git merge -s recursive E^0 2>err &&
git rev-parse --verify :subdir/a >actual &&
test_cmp expect actual &&
- test_i18ngrep "changes to the following files would be overwritten" err
+ test_grep "changes to the following files would be overwritten" err
'
test_expect_success 'octopus, unrelated file touched' '
@@ -242,4 +275,36 @@ test_expect_success 'subtree' '
test_path_is_missing .git/MERGE_HEAD
'
+test_expect_success 'avoid failure due to stat-dirty files' '
+ git reset --hard &&
+ git checkout B^0 &&
+
+ # Make "a" be stat-dirty
+ test-tool chmtime =+1 a &&
+
+ # stat-dirty file should not prevent stash creation in builtin/merge.c
+ git merge -s resolve -s recursive D^0
+'
+
+test_expect_success 'with multiple strategies, recursive or ort failure do not early abort' '
+ git reset --hard &&
+ git checkout B^0 &&
+
+ test_seq 0 10 >a &&
+ git add a &&
+ git rev-parse :a >expect &&
+
+ sane_unset GIT_TEST_MERGE_ALGORITHM &&
+ test_must_fail git merge -s recursive -s ort -s octopus C^0 >output 2>&1 &&
+
+ grep "Trying merge strategy recursive..." output &&
+ grep "Trying merge strategy ort..." output &&
+ grep "Trying merge strategy octopus..." output &&
+ grep "No merge strategy handled the merge." output &&
+
+ # Changes to "a" should remain staged
+ git rev-parse :a >actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t6425-merge-rename-delete.sh b/t/t6425-merge-rename-delete.sh
index 459b431..b95b064 100755
--- a/t/t6425-merge-rename-delete.sh
+++ b/t/t6425-merge-rename-delete.sh
@@ -4,6 +4,7 @@ test_description='Merge-recursive rename/delete conflict message'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'rename/delete' '
@@ -20,8 +21,8 @@ test_expect_success 'rename/delete' '
git commit -m "delete" &&
test_must_fail git merge --strategy=recursive rename >output &&
- test_i18ngrep "CONFLICT (rename/delete): A.* renamed .*to B.* in rename" output &&
- test_i18ngrep "CONFLICT (rename/delete): A.*deleted in HEAD." output
+ test_grep "CONFLICT (rename/delete): A.* renamed .*to B.* in rename" output &&
+ test_grep "CONFLICT (rename/delete): A.*deleted in HEAD." output
'
test_done
diff --git a/t/t6426-merge-skip-unneeded-updates.sh b/t/t6426-merge-skip-unneeded-updates.sh
index 7b5f1c1..b059475 100755
--- a/t/t6426-merge-skip-unneeded-updates.sh
+++ b/t/t6426-merge-skip-unneeded-updates.sh
@@ -38,7 +38,7 @@ test_description="merge cases"
# Expected: b_2
test_setup_1a () {
- test_create_repo 1a_$1 &&
+ git init 1a_$1 &&
(
cd 1a_$1 &&
@@ -136,7 +136,7 @@ test_expect_success '1a-R: Modify(A)/Modify(B), change on B subset of A' '
# Expected: c_2
test_setup_2a () {
- test_create_repo 2a_$1 &&
+ git init 2a_$1 &&
(
cd 2a_$1 &&
@@ -229,7 +229,7 @@ test_expect_success '2a-R: Modify/rename, merge into rename side' '
# Expected: c_2
test_setup_2b () {
- test_create_repo 2b_$1 &&
+ git init 2b_$1 &&
(
cd 2b_$1 &&
@@ -336,7 +336,7 @@ test_expect_success '2b-R: Rename+Mod(A)/Mod(B), B mods subset of A' '
# not make that particular mistake.
test_setup_2c () {
- test_create_repo 2c &&
+ git init 2c &&
(
cd 2c &&
@@ -375,45 +375,33 @@ test_expect_success '2c: Modify b & add c VS rename b->c' '
export GIT_MERGE_VERBOSITY &&
test_must_fail git merge -s recursive B^0 >out 2>err &&
- test_i18ngrep "CONFLICT (.*/add):" out &&
+ test_grep "CONFLICT (.*/add):" out &&
test_must_be_empty err &&
- # Make sure c WAS updated
+ git ls-files -s >index_files &&
+ test_line_count = 2 index_files &&
+
+ # Ensure b was removed
+ test_path_is_missing b &&
+
+ # Make sure c WAS updated...
test-tool chmtime --get c >new-mtime &&
- test $(cat old-mtime) -lt $(cat new-mtime)
-
- # FIXME: rename/add conflicts are horribly broken right now;
- # when I get back to my patch series fixing it and
- # rename/rename(2to1) conflicts to bring them in line with
- # how add/add conflicts behave, then checks like the below
- # could be added. But that patch series is waiting until
- # the rename-directory-detection series lands, which this
- # is part of. And in the mean time, I do not want to further
- # enforce broken behavior. So for now, the main test is the
- # one above that err is an empty file.
-
- #git ls-files -s >index_files &&
- #test_line_count = 2 index_files &&
-
- #git rev-parse >actual :2:c :3:c &&
- #git rev-parse >expect A:b A:c &&
- #test_cmp expect actual &&
-
- #git cat-file -p A:b >>merged &&
- #git cat-file -p A:c >>merge-me &&
- #>empty &&
- #test_must_fail git merge-file \
- # -L "Temporary merge branch 1" \
- # -L "" \
- # -L "Temporary merge branch 2" \
- # merged empty merge-me &&
- #sed -e "s/^\([<=>]\)/\1\1\1/" merged >merged-internal &&
-
- #git hash-object c >actual &&
- #git hash-object merged-internal >expect &&
- #test_cmp expect actual &&
-
- #test_path_is_missing b
+ test $(cat old-mtime) -lt $(cat new-mtime) &&
+
+ # ...and has correct index entries and working tree contents
+ git rev-parse >actual :2:c :3:c &&
+ git rev-parse >expect A:c A:b &&
+ test_cmp expect actual &&
+
+ git cat-file -p A:b >>merge-me &&
+ git cat-file -p A:c >>merged &&
+ >empty &&
+ test_must_fail git merge-file \
+ -L "HEAD" \
+ -L "" \
+ -L "B^0" \
+ merged empty merge-me &&
+ test_cmp merged c
)
'
@@ -437,7 +425,7 @@ test_expect_success '2c: Modify b & add c VS rename b->c' '
# Expected: bar/{bq_2, whatever}
test_setup_3a () {
- test_create_repo 3a_$1 &&
+ git init 3a_$1 &&
(
cd 3a_$1 &&
@@ -537,7 +525,7 @@ test_expect_success '3a-R: bq_1->foo/bq_2 on A, foo/->bar/ on B' '
# Expected: bar/{bq_2, whatever}
test_setup_3b () {
- test_create_repo 3b_$1 &&
+ git init 3b_$1 &&
(
cd 3b_$1 &&
@@ -642,7 +630,7 @@ test_expect_success '3b-R: bq_1->foo/bq_2 on A, foo/->bar/ on B' '
# Expected: b_2 for merge, b_4 in working copy
test_setup_4a () {
- test_create_repo 4a &&
+ git init 4a &&
(
cd 4a &&
@@ -714,7 +702,7 @@ test_expect_merge_algorithm failure success '4a: Change on A, change on B subset
# Expected: c_2
test_setup_4b () {
- test_create_repo 4b &&
+ git init 4b &&
(
cd 4b &&
diff --git a/t/t6427-diff3-conflict-markers.sh b/t/t6427-diff3-conflict-markers.sh
index a9ee4cb..dd5fe6a 100755
--- a/t/t6427-diff3-conflict-markers.sh
+++ b/t/t6427-diff3-conflict-markers.sh
@@ -19,7 +19,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
#
test_expect_success 'setup no merge base' '
- test_create_repo no_merge_base &&
+ git init no_merge_base &&
(
cd no_merge_base &&
@@ -55,7 +55,7 @@ test_expect_success 'check no merge base' '
#
test_expect_success 'setup unique merge base' '
- test_create_repo unique_merge_base &&
+ git init unique_merge_base &&
(
cd unique_merge_base &&
@@ -116,7 +116,7 @@ test_expect_success 'check unique merge base' '
#
test_expect_success 'setup multiple merge bases' '
- test_create_repo multiple_merge_bases &&
+ git init multiple_merge_bases &&
(
cd multiple_merge_bases &&
@@ -190,7 +190,7 @@ test_expect_success 'check multiple merge bases' '
'
test_expect_success 'rebase --merge describes parent of commit being picked' '
- test_create_repo rebase &&
+ git init rebase &&
(
cd rebase &&
test_commit base file &&
@@ -212,7 +212,7 @@ test_expect_success 'rebase --apply describes fake ancestor base' '
'
test_setup_zdiff3 () {
- test_create_repo zdiff3 &&
+ git init zdiff3 &&
(
cd zdiff3 &&
diff --git a/t/t6428-merge-conflicts-sparse.sh b/t/t6428-merge-conflicts-sparse.sh
index 064be1b..9919c3f 100755
--- a/t/t6428-merge-conflicts-sparse.sh
+++ b/t/t6428-merge-conflicts-sparse.sh
@@ -29,7 +29,7 @@ test_description="merge cases"
# Testcase basic, conflicting changes in 'numerals'
test_setup_numerals () {
- test_create_repo numerals_$1 &&
+ git init numerals_$1 &&
(
cd numerals_$1 &&
diff --git a/t/t6429-merge-sequence-rename-caching.sh b/t/t6429-merge-sequence-rename-caching.sh
index e1ce919..0f39ed0 100755
--- a/t/t6429-merge-sequence-rename-caching.sh
+++ b/t/t6429-merge-sequence-rename-caching.sh
@@ -35,7 +35,7 @@ test_description="remember regular & dir renames in sequence of merges"
# preventing us from finding new renames.
#
test_expect_success 'caching renames does not preclude finding new ones' '
- test_create_repo caching-renames-and-new-renames &&
+ git init caching-renames-and-new-renames &&
(
cd caching-renames-and-new-renames &&
@@ -71,8 +71,9 @@ test_expect_success 'caching renames does not preclude finding new ones' '
git switch upstream &&
- test-tool fast-rebase --onto HEAD upstream~1 topic &&
- #git cherry-pick upstream~1..topic
+ git replay --onto HEAD upstream~1..topic >out &&
+ git update-ref --stdin <out &&
+ git checkout topic &&
git ls-files >tracked-files &&
test_line_count = 2 tracked-files &&
@@ -106,7 +107,7 @@ test_expect_success 'caching renames does not preclude finding new ones' '
# should be able to only run rename detection on the upstream side one
# time.)
test_expect_success 'cherry-pick both a commit and its immediate revert' '
- test_create_repo pick-commit-and-its-immediate-revert &&
+ git init pick-commit-and-its-immediate-revert &&
(
cd pick-commit-and-its-immediate-revert &&
@@ -140,8 +141,9 @@ test_expect_success 'cherry-pick both a commit and its immediate revert' '
GIT_TRACE2_PERF="$(pwd)/trace.output" &&
export GIT_TRACE2_PERF &&
- test-tool fast-rebase --onto HEAD upstream~1 topic &&
- #git cherry-pick upstream~1..topic &&
+ git replay --onto HEAD upstream~1..topic >out &&
+ git update-ref --stdin <out &&
+ git checkout topic &&
grep region_enter.*diffcore_rename trace.output >calls &&
test_line_count = 1 calls
@@ -162,7 +164,7 @@ test_expect_success 'cherry-pick both a commit and its immediate revert' '
# could cause a spurious rename/add conflict.
#
test_expect_success 'rename same file identically, then reintroduce it' '
- test_create_repo rename-rename-1to1-then-add-old-filename &&
+ git init rename-rename-1to1-then-add-old-filename &&
(
cd rename-rename-1to1-then-add-old-filename &&
@@ -199,8 +201,9 @@ test_expect_success 'rename same file identically, then reintroduce it' '
GIT_TRACE2_PERF="$(pwd)/trace.output" &&
export GIT_TRACE2_PERF &&
- test-tool fast-rebase --onto HEAD upstream~1 topic &&
- #git cherry-pick upstream~1..topic &&
+ git replay --onto HEAD upstream~1..topic >out &&
+ git update-ref --stdin <out &&
+ git checkout topic &&
git ls-files >tracked &&
test_line_count = 2 tracked &&
@@ -229,7 +232,7 @@ test_expect_success 'rename same file identically, then reintroduce it' '
# cached, the directory rename could put newfile in the wrong directory.
#
test_expect_success 'rename same file identically, then add file to old dir' '
- test_create_repo rename-rename-1to1-then-add-file-to-old-dir &&
+ git init rename-rename-1to1-then-add-file-to-old-dir &&
(
cd rename-rename-1to1-then-add-file-to-old-dir &&
@@ -276,8 +279,9 @@ test_expect_success 'rename same file identically, then add file to old dir' '
GIT_TRACE2_PERF="$(pwd)/trace.output" &&
export GIT_TRACE2_PERF &&
- test-tool fast-rebase --onto HEAD upstream~1 topic &&
- #git cherry-pick upstream~1..topic &&
+ git replay --onto HEAD upstream~1..topic >out &&
+ git update-ref --stdin <out &&
+ git checkout topic &&
git ls-files >tracked &&
test_line_count = 4 tracked &&
@@ -311,7 +315,7 @@ test_expect_success 'rename same file identically, then add file to old dir' '
# should avoid the need to re-detect upstream renames.)
#
test_expect_success 'cached dir rename does not prevent noticing later conflict' '
- test_create_repo dir-rename-cache-not-occluding-later-conflict &&
+ git init dir-rename-cache-not-occluding-later-conflict &&
(
cd dir-rename-cache-not-occluding-later-conflict &&
@@ -353,10 +357,7 @@ test_expect_success 'cached dir rename does not prevent noticing later conflict'
GIT_TRACE2_PERF="$(pwd)/trace.output" &&
export GIT_TRACE2_PERF &&
- test_must_fail test-tool fast-rebase --onto HEAD upstream~1 topic >output &&
- #git cherry-pick upstream..topic &&
-
- grep CONFLICT..rename/rename output &&
+ test_must_fail git replay --onto HEAD upstream~1..topic >output &&
grep region_enter.*diffcore_rename trace.output >calls &&
test_line_count = 2 calls
@@ -365,7 +366,7 @@ test_expect_success 'cached dir rename does not prevent noticing later conflict'
# Helper for the next two tests
test_setup_upstream_rename () {
- test_create_repo $1 &&
+ git init $1 &&
(
cd $1 &&
@@ -455,8 +456,9 @@ test_expect_success 'dir rename unneeded, then add new file to old dir' '
GIT_TRACE2_PERF="$(pwd)/trace.output" &&
export GIT_TRACE2_PERF &&
- test-tool fast-rebase --onto HEAD upstream~1 topic &&
- #git cherry-pick upstream..topic &&
+ git replay --onto HEAD upstream~1..topic >out &&
+ git update-ref --stdin <out &&
+ git checkout topic &&
grep region_enter.*diffcore_rename trace.output >calls &&
test_line_count = 2 calls &&
@@ -521,8 +523,9 @@ test_expect_success 'dir rename unneeded, then rename existing file into old dir
GIT_TRACE2_PERF="$(pwd)/trace.output" &&
export GIT_TRACE2_PERF &&
- test-tool fast-rebase --onto HEAD upstream~1 topic &&
- #git cherry-pick upstream..topic &&
+ git replay --onto HEAD upstream~1..topic >out &&
+ git update-ref --stdin <out &&
+ git checkout topic &&
grep region_enter.*diffcore_rename trace.output >calls &&
test_line_count = 3 calls &&
@@ -537,7 +540,7 @@ test_expect_success 'dir rename unneeded, then rename existing file into old dir
# Helper for the next two tests
test_setup_topic_rename () {
- test_create_repo $1 &&
+ git init $1 &&
(
cd $1 &&
@@ -623,8 +626,9 @@ test_expect_success 'caching renames only on upstream side, part 1' '
GIT_TRACE2_PERF="$(pwd)/trace.output" &&
export GIT_TRACE2_PERF &&
- test-tool fast-rebase --onto HEAD upstream~1 topic &&
- #git cherry-pick upstream..topic &&
+ git replay --onto HEAD upstream~1..topic >out &&
+ git update-ref --stdin <out &&
+ git checkout topic &&
grep region_enter.*diffcore_rename trace.output >calls &&
test_line_count = 1 calls &&
@@ -681,8 +685,9 @@ test_expect_success 'caching renames only on upstream side, part 2' '
GIT_TRACE2_PERF="$(pwd)/trace.output" &&
export GIT_TRACE2_PERF &&
- test-tool fast-rebase --onto HEAD upstream~1 topic &&
- #git cherry-pick upstream..topic &&
+ git replay --onto HEAD upstream~1..topic >out &&
+ git update-ref --stdin <out &&
+ git checkout topic &&
grep region_enter.*diffcore_rename trace.output >calls &&
test_line_count = 2 calls &&
@@ -725,7 +730,7 @@ test_expect_success 'avoid assuming we detected renames' '
mkdir unrelated &&
for i in $(test_seq 1 10)
do
- >unrelated/$i
+ >unrelated/$i || exit 1
done &&
test_seq 2 10 >numbers &&
test_seq 12 20 >values &&
diff --git a/t/t6430-merge-recursive.sh b/t/t6430-merge-recursive.sh
index 07067bb..ca15e6d 100755
--- a/t/t6430-merge-recursive.sh
+++ b/t/t6430-merge-recursive.sh
@@ -308,13 +308,13 @@ test_expect_success 'fail if the index has unresolved entries' '
test_must_fail git merge "$c5" &&
test_must_fail git merge "$c5" 2> out &&
- test_i18ngrep "not possible because you have unmerged files" out &&
+ test_grep "not possible because you have unmerged files" out &&
git add -u &&
test_must_fail git merge "$c5" 2> out &&
- test_i18ngrep "You have not concluded your merge" out &&
+ test_grep "You have not concluded your merge" out &&
rm -f .git/MERGE_HEAD &&
test_must_fail git merge "$c5" 2> out &&
- test_i18ngrep "Your local changes to the following files would be overwritten by merge:" out
+ test_grep "Your local changes to the following files would be overwritten by merge:" out
'
test_expect_success 'merge-recursive remove conflict' '
@@ -713,7 +713,7 @@ test_expect_success 'merge-recursive remembers the names of all base trees' '
test_must_fail git -c merge.verbosity=5 merge-recursive $(cat trees) -- $c1 $c3 >out &&
# ...but make sure it fails in the expected way
- test_i18ngrep CONFLICT.*rename/rename out &&
+ test_grep CONFLICT.*rename/rename out &&
# merge-recursive prints in reverse order, but we do not care
sort <trees >expect &&
diff --git a/t/t6431-merge-criscross.sh b/t/t6431-merge-criscross.sh
index 3824756..3fe14cd 100755
--- a/t/t6431-merge-criscross.sh
+++ b/t/t6431-merge-criscross.sh
@@ -2,6 +2,7 @@
test_description='merge-recursive backend test'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# A <- create some files
diff --git a/t/t6433-merge-toplevel.sh b/t/t6433-merge-toplevel.sh
index b160314..ed7866d 100755
--- a/t/t6433-merge-toplevel.sh
+++ b/t/t6433-merge-toplevel.sh
@@ -5,6 +5,7 @@ test_description='"git merge" top-level frontend'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
t3033_reset () {
@@ -151,7 +152,7 @@ test_expect_success 'refuse two-project merge by default, quit before --autostas
echo change >>one.t &&
git diff >expect &&
test_must_fail git merge --autostash five 2>err &&
- test_i18ngrep ! "stash" err &&
+ test_grep ! "stash" err &&
git diff >actual &&
test_cmp expect actual
'
@@ -169,7 +170,7 @@ test_expect_success 'two-project merge with --allow-unrelated-histories with --a
echo change >>one.t &&
git diff one.t >expect &&
git merge --allow-unrelated-histories --autostash five 2>err &&
- test_i18ngrep "Applied autostash." err &&
+ test_grep "Applied autostash." err &&
git diff one.t >actual &&
test_cmp expect actual
'
diff --git a/t/t6435-merge-sparse.sh b/t/t6435-merge-sparse.sh
index 74562e1..78628fb 100755
--- a/t/t6435-merge-sparse.sh
+++ b/t/t6435-merge-sparse.sh
@@ -2,6 +2,8 @@
test_description='merge with sparse files'
+TEST_CREATE_REPO_NO_TEMPLATE=1
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# test_file $filename $content
@@ -26,6 +28,7 @@ test_expect_success 'setup' '
git rm modify_delete &&
test_commit_this ours &&
git config core.sparseCheckout true &&
+ mkdir .git/info &&
echo "/checked-out" >.git/info/sparse-checkout &&
git reset --hard &&
test_must_fail git merge theirs
diff --git a/t/t6436-merge-overwrite.sh b/t/t6436-merge-overwrite.sh
index c0b7bd7..4f43764 100755
--- a/t/t6436-merge-overwrite.sh
+++ b/t/t6436-merge-overwrite.sh
@@ -104,12 +104,12 @@ test_expect_success 'will not overwrite unstaged changes in renamed file' '
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
test_must_fail git merge c1a >out 2>err &&
- test_i18ngrep "would be overwritten by merge" err &&
+ test_grep "would be overwritten by merge" err &&
test_cmp important other.c &&
test_path_is_missing .git/MERGE_HEAD
else
test_must_fail git merge c1a >out &&
- test_i18ngrep "Refusing to lose dirty file at other.c" out &&
+ test_grep "Refusing to lose dirty file at other.c" out &&
test_path_is_file other.c~HEAD &&
test $(git hash-object other.c~HEAD) = $(git rev-parse c1a:c1.c) &&
test_cmp important other.c
diff --git a/t/t6437-submodule-merge.sh b/t/t6437-submodule-merge.sh
index 178413c..7a3f1cb 100755
--- a/t/t6437-submodule-merge.sh
+++ b/t/t6437-submodule-merge.sh
@@ -8,6 +8,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB=1
export GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-merge.sh
@@ -103,8 +104,25 @@ test_expect_success 'setup for merge search' '
echo "file-c" > file-c &&
git add file-c &&
git commit -m "sub-c") &&
- git commit -a -m "c" &&
+ git commit -a -m "c")
+'
+test_expect_success 'merging should conflict for non fast-forward' '
+ test_when_finished "git -C merge-search reset --hard" &&
+ (cd merge-search &&
+ git checkout -b test-nonforward-a b &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_must_fail git merge c 2>actual &&
+ sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
+ grep "$sub_expect" actual
+ else
+ test_must_fail git merge c 2> actual
+ fi)
+'
+
+test_expect_success 'finish setup for merge-search' '
+ (cd merge-search &&
git checkout -b d a &&
(cd sub &&
git checkout -b sub-d sub-b &&
@@ -129,14 +147,16 @@ test_expect_success 'merge with one side as a fast-forward of the other' '
test_cmp expect actual)
'
-test_expect_success 'merging should conflict for non fast-forward' '
+test_expect_success 'merging should conflict for non fast-forward (resolution exists)' '
(cd merge-search &&
- git checkout -b test-nonforward b &&
+ git checkout -b test-nonforward-b b &&
(cd sub &&
- git rev-parse sub-d > ../expect) &&
+ git rev-parse --short sub-d > ../expect) &&
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
- test_must_fail git merge c >actual
+ test_must_fail git merge c >actual 2>sub-actual &&
+ sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
+ grep "$sub_expect" sub-actual
else
test_must_fail git merge c 2> actual
fi &&
@@ -161,7 +181,9 @@ test_expect_success 'merging should fail for ambiguous common parent' '
) &&
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
- test_must_fail git merge c >actual
+ test_must_fail git merge c >actual 2>sub-actual &&
+ sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
+ grep "$sub_expect" sub-actual
else
test_must_fail git merge c 2> actual
fi &&
@@ -205,7 +227,12 @@ test_expect_success 'merging should fail for changes that are backwards' '
git commit -a -m "f" &&
git checkout -b test-backward e &&
- test_must_fail git merge f)
+ test_must_fail git merge f 2>actual &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-d)" &&
+ grep "$sub_expect" actual
+ fi)
'
@@ -310,7 +337,7 @@ test_expect_success 'recursive merge with submodule' '
# Expected: path/ is submodule and file contents for B's path are somewhere
test_expect_success 'setup file/submodule conflict' '
- test_create_repo file-submodule &&
+ git init file-submodule &&
(
cd file-submodule &&
@@ -325,7 +352,7 @@ test_expect_success 'setup file/submodule conflict' '
git commit -m B &&
git checkout A &&
- test_create_repo path &&
+ git init path &&
test_commit -C path world &&
git submodule add ./path &&
git commit -m A
@@ -385,7 +412,7 @@ test_expect_success 'file/submodule conflict; merge --abort works afterward' '
# under the submodule to be treated as untracked or in the way.
test_expect_success 'setup directory/submodule conflict' '
- test_create_repo directory-submodule &&
+ git init directory-submodule &&
(
cd directory-submodule &&
@@ -408,7 +435,7 @@ test_expect_success 'setup directory/submodule conflict' '
git commit -m B2 &&
git checkout A &&
- test_create_repo path &&
+ git init path &&
test_commit -C path hello world &&
git submodule add ./path &&
git commit -m A
@@ -453,7 +480,7 @@ test_expect_merge_algorithm failure success !FAIL_PREREQS 'directory/submodule c
# We do not want files within the submodule to prevent the
# merge from starting; we should not be writing to such paths
# anyway.
- test_i18ngrep ! "refusing to lose untracked file at" err
+ test_grep ! "refusing to lose untracked file at" err
)
'
@@ -476,4 +503,44 @@ test_expect_failure 'directory/submodule conflict; merge --abort works afterward
)
'
+# Setup:
+# - Submodule has 2 commits: a and b
+# - Superproject branch 'a' adds and commits submodule pointing to 'commit a'
+# - Superproject branch 'b' adds and commits submodule pointing to 'commit b'
+# If these two branches are now merged, there is no merge base
+test_expect_success 'setup for null merge base' '
+ mkdir no-merge-base &&
+ (cd no-merge-base &&
+ git init &&
+ mkdir sub &&
+ (cd sub &&
+ git init &&
+ echo "file-a" > file-a &&
+ git add file-a &&
+ git commit -m "commit a") &&
+ git commit --allow-empty -m init &&
+ git branch init &&
+ git checkout -b a init &&
+ git add sub &&
+ git commit -m "a" &&
+ git switch main &&
+ (cd sub &&
+ echo "file-b" > file-b &&
+ git add file-b &&
+ git commit -m "commit b"))
+'
+
+test_expect_success 'merging should fail with no merge base' '
+ (cd no-merge-base &&
+ git checkout -b b init &&
+ git add sub &&
+ git commit -m "b" &&
+ test_must_fail git merge a 2>actual &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short HEAD^1)" &&
+ grep "$sub_expect" actual
+ fi)
+'
+
test_done
diff --git a/t/t6439-merge-co-error-msgs.sh b/t/t6439-merge-co-error-msgs.sh
index 5bfb027..0cbec57 100755
--- a/t/t6439-merge-co-error-msgs.sh
+++ b/t/t6439-merge-co-error-msgs.sh
@@ -5,6 +5,7 @@ test_description='unpack-trees error messages'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
@@ -47,6 +48,7 @@ test_expect_success 'untracked files overwritten by merge (fast and non-fast for
export GIT_MERGE_VERBOSITY &&
test_must_fail git merge branch 2>out2
) &&
+ echo "Merge with strategy ${GIT_TEST_MERGE_ALGORITHM:-ort} failed." >>expect &&
test_cmp out2 expect &&
git reset --hard HEAD^
'
diff --git a/t/t6500-gc.sh b/t/t6500-gc.sh
index cd6c533..43d4017 100755
--- a/t/t6500-gc.sh
+++ b/t/t6500-gc.sh
@@ -11,23 +11,7 @@ test_expect_success 'setup' '
# behavior, make sure we always pack everything to one pack by
# default
git config gc.bigPackThreshold 2g &&
-
- # These are simply values which, when hashed as a blob with a newline,
- # produce a hash where the first byte is 0x17 in their respective
- # algorithms.
- test_oid_cache <<-EOF
- obj1 sha1:263
- obj1 sha256:34
-
- obj2 sha1:410
- obj2 sha256:174
-
- obj3 sha1:523
- obj3 sha256:313
-
- obj4 sha1:790
- obj4 sha256:481
- EOF
+ test_oid_init
'
test_expect_success 'gc empty repository' '
@@ -41,7 +25,7 @@ test_expect_success 'gc does not leave behind pid file' '
test_expect_success 'gc --gobbledegook' '
test_expect_code 129 git gc --nonsense 2>err &&
- test_i18ngrep "[Uu]sage: git gc" err
+ test_grep "[Uu]sage: git gc" err
'
test_expect_success 'gc -h with invalid configuration' '
@@ -52,7 +36,7 @@ test_expect_success 'gc -h with invalid configuration' '
echo "[gc] pruneexpire = CORRUPT" >>.git/config &&
test_expect_code 129 git gc -h >usage 2>&1
) &&
- test_i18ngrep "[Uu]sage" broken/usage
+ test_grep "[Uu]sage" broken/usage
'
test_expect_success 'gc is not aborted due to a stale symref' '
@@ -114,8 +98,8 @@ test_expect_success 'pre-auto-gc hook can stop auto gc' '
# We need to create two object whose sha1s start with 17
# since this is what git gc counts. As it happens, these
# two blobs will do so.
- test_commit "$(test_oid obj1)" &&
- test_commit "$(test_oid obj2)" &&
+ test_commit "$(test_oid blob17_1)" &&
+ test_commit "$(test_oid blob17_2)" &&
git gc --auto >../out.actual 2>../err.actual
) &&
@@ -146,16 +130,16 @@ test_expect_success 'auto gc with too many loose objects does not attempt to cre
# We need to create two object whose sha1s start with 17
# since this is what git gc counts. As it happens, these
# two blobs will do so.
- test_commit "$(test_oid obj1)" &&
- test_commit "$(test_oid obj2)" &&
+ test_commit "$(test_oid blob17_1)" &&
+ test_commit "$(test_oid blob17_2)" &&
# Our first gc will create a pack; our second will create a second pack
git gc --auto &&
ls .git/objects/pack/pack-*.pack | sort >existing_packs &&
- test_commit "$(test_oid obj3)" &&
- test_commit "$(test_oid obj4)" &&
+ test_commit "$(test_oid blob17_3)" &&
+ test_commit "$(test_oid blob17_4)" &&
git gc --auto 2>err &&
- test_i18ngrep ! "^warning:" err &&
+ test_grep ! "^warning:" err &&
ls .git/objects/pack/pack-*.pack | sort >post_packs &&
comm -1 -3 existing_packs post_packs >new &&
comm -2 -3 existing_packs post_packs >del &&
@@ -166,15 +150,15 @@ test_expect_success 'auto gc with too many loose objects does not attempt to cre
test_expect_success 'gc --no-quiet' '
GIT_PROGRESS_DELAY=0 git -c gc.writeCommitGraph=true gc --no-quiet >stdout 2>stderr &&
test_must_be_empty stdout &&
- test_i18ngrep "Computing commit graph generation numbers" stderr
+ test_grep "Computing commit graph generation numbers" stderr
'
test_expect_success TTY 'with TTY: gc --no-quiet' '
test_terminal env GIT_PROGRESS_DELAY=0 \
git -c gc.writeCommitGraph=true gc --no-quiet >stdout 2>stderr &&
test_must_be_empty stdout &&
- test_i18ngrep "Enumerating objects" stderr &&
- test_i18ngrep "Computing commit graph generation numbers" stderr
+ test_grep "Enumerating objects" stderr &&
+ test_grep "Computing commit graph generation numbers" stderr
'
test_expect_success 'gc --quiet' '
@@ -202,6 +186,158 @@ test_expect_success 'one of gc.reflogExpire{Unreachable,}=never does not skip "e
grep -E "^trace: (built-in|exec|run_command): git reflog expire --" trace.out
'
+test_expect_success 'gc.repackFilter launches repack with a filter' '
+ git clone --no-local --bare . bare.git &&
+
+ git -C bare.git -c gc.cruftPacks=false gc &&
+ test_stdout_line_count = 1 ls bare.git/objects/pack/*.pack &&
+
+ GIT_TRACE=$(pwd)/trace.out git -C bare.git -c gc.repackFilter=blob:none \
+ -c repack.writeBitmaps=false -c gc.cruftPacks=false gc &&
+ test_stdout_line_count = 2 ls bare.git/objects/pack/*.pack &&
+ grep -E "^trace: (built-in|exec|run_command): git repack .* --filter=blob:none ?.*" trace.out
+'
+
+test_expect_success 'gc.repackFilterTo store filtered out objects' '
+ test_when_finished "rm -rf bare.git filtered.git" &&
+
+ git init --bare filtered.git &&
+ git -C bare.git -c gc.repackFilter=blob:none \
+ -c gc.repackFilterTo=../filtered.git/objects/pack/pack \
+ -c repack.writeBitmaps=false -c gc.cruftPacks=false gc &&
+
+ test_stdout_line_count = 1 ls bare.git/objects/pack/*.pack &&
+ test_stdout_line_count = 1 ls filtered.git/objects/pack/*.pack
+'
+
+prepare_cruft_history () {
+ test_commit base &&
+
+ test_commit --no-tag foo &&
+ test_commit --no-tag bar &&
+ git reset HEAD^^
+}
+
+assert_no_cruft_packs () {
+ find .git/objects/pack -name "*.mtimes" >mtimes &&
+ test_must_be_empty mtimes
+}
+
+for argv in \
+ "gc" \
+ "-c gc.cruftPacks=true gc" \
+ "-c gc.cruftPacks=false gc --cruft"
+do
+ test_expect_success "git $argv generates a cruft pack" '
+ test_when_finished "rm -fr repo" &&
+ git init repo &&
+ (
+ cd repo &&
+
+ prepare_cruft_history &&
+ git $argv &&
+
+ find .git/objects/pack -name "*.mtimes" >mtimes &&
+ sed -e 's/\.mtimes$/\.pack/g' mtimes >packs &&
+
+ test_file_not_empty packs &&
+ while read pack
+ do
+ test_path_is_file "$pack" || return 1
+ done <packs
+ )
+ '
+done
+
+for argv in \
+ "gc --no-cruft" \
+ "-c gc.cruftPacks=false gc" \
+ "-c gc.cruftPacks=true gc --no-cruft"
+do
+ test_expect_success "git $argv does not generate a cruft pack" '
+ test_when_finished "rm -fr repo" &&
+ git init repo &&
+ (
+ cd repo &&
+
+ prepare_cruft_history &&
+ git $argv &&
+
+ assert_no_cruft_packs
+ )
+ '
+done
+
+test_expect_success '--keep-largest-pack ignores cruft packs' '
+ test_when_finished "rm -fr repo" &&
+ git init repo &&
+ (
+ cd repo &&
+
+ # Generate a pack for reachable objects (of which there
+ # are 3), and one for unreachable objects (of which
+ # there are 6).
+ prepare_cruft_history &&
+ git gc --cruft &&
+
+ mtimes="$(find .git/objects/pack -type f -name "pack-*.mtimes")" &&
+ sz="$(test_file_size "${mtimes%.mtimes}.pack")" &&
+
+ # Ensure that the cruft pack gets removed (due to
+ # `--prune=now`) despite it being the largest pack.
+ git -c gc.bigPackThreshold=$sz gc --cruft --prune=now &&
+
+ assert_no_cruft_packs
+ )
+'
+
+test_expect_success 'gc.bigPackThreshold ignores cruft packs' '
+ test_when_finished "rm -fr repo" &&
+ git init repo &&
+ (
+ cd repo &&
+
+ # Generate a pack for reachable objects (of which there
+ # are 3), and one for unreachable objects (of which
+ # there are 6).
+ prepare_cruft_history &&
+ git gc --cruft &&
+
+ # Ensure that the cruft pack gets removed (due to
+ # `--prune=now`) despite it being the largest pack.
+ git gc --cruft --prune=now --keep-largest-pack &&
+
+ assert_no_cruft_packs
+ )
+'
+
+cruft_max_size_opts="git repack -d -l --cruft --cruft-expiration=2.weeks.ago"
+
+test_expect_success 'setup for --max-cruft-size tests' '
+ git init cruft--max-size &&
+ (
+ cd cruft--max-size &&
+ prepare_cruft_history
+ )
+'
+
+test_expect_success '--max-cruft-size sets appropriate repack options' '
+ GIT_TRACE2_EVENT=$(pwd)/trace2.txt git -C cruft--max-size \
+ gc --cruft --max-cruft-size=1M &&
+ test_subcommand $cruft_max_size_opts --max-cruft-size=1048576 <trace2.txt
+'
+
+test_expect_success 'gc.maxCruftSize sets appropriate repack options' '
+ GIT_TRACE2_EVENT=$(pwd)/trace2.txt \
+ git -C cruft--max-size -c gc.maxCruftSize=2M gc --cruft &&
+ test_subcommand $cruft_max_size_opts --max-cruft-size=2097152 <trace2.txt &&
+
+ GIT_TRACE2_EVENT=$(pwd)/trace2.txt \
+ git -C cruft--max-size -c gc.maxCruftSize=2M gc --cruft \
+ --max-cruft-size=3M &&
+ test_subcommand $cruft_max_size_opts --max-cruft-size=3145728 <trace2.txt
+'
+
run_and_wait_for_auto_gc () {
# We read stdout from gc for the side effect of waiting until the
# background gc process exits, closing its fd 9. Furthermore, the
@@ -220,7 +356,7 @@ test_expect_success 'background auto gc does not run if gc.log is present and re
test_config gc.autodetach true &&
echo fleem >.git/gc.log &&
git gc --auto 2>err &&
- test_i18ngrep "^warning:" err &&
+ test_grep "^warning:" err &&
test_config gc.logexpiry 5.days &&
test-tool chmtime =-345600 .git/gc.log &&
git gc --auto &&
diff --git a/t/t6501-freshen-objects.sh b/t/t6501-freshen-objects.sh
index 1066245..4521508 100755
--- a/t/t6501-freshen-objects.sh
+++ b/t/t6501-freshen-objects.sh
@@ -28,6 +28,7 @@ test_description='check pruning of dependent objects'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# We care about reachability, so we do not want to use
@@ -100,7 +101,7 @@ do
'
test_expect_success "simultaneous gc ($title)" '
- git gc --prune=12.hours.ago
+ git gc --no-cruft --prune=12.hours.ago
'
test_expect_success "finish writing out commit ($title)" '
@@ -130,7 +131,7 @@ do
'
test_expect_success "simultaneous gc ($title)" '
- git gc --prune=12.hours.ago
+ git gc --no-cruft --prune=12.hours.ago
'
# tree should have been refreshed by write-tree
@@ -150,8 +151,8 @@ test_expect_success 'do not complain about existing broken links (commit)' '
some message
EOF
commit=$(git hash-object -t commit -w broken-commit) &&
- git gc -q 2>stderr &&
- verbose git cat-file -e $commit &&
+ git gc --no-cruft -q 2>stderr &&
+ git cat-file -e $commit &&
test_must_be_empty stderr
'
@@ -160,7 +161,7 @@ test_expect_success 'do not complain about existing broken links (tree)' '
100644 blob $(test_oid 003) foo
EOF
tree=$(git mktree --missing <broken-tree) &&
- git gc -q 2>stderr &&
+ git gc --no-cruft -q 2>stderr &&
git cat-file -e $tree &&
test_must_be_empty stderr
'
@@ -175,7 +176,7 @@ test_expect_success 'do not complain about existing broken links (tag)' '
this is a broken tag
EOF
tag=$(git hash-object -t tag -w broken-tag) &&
- git gc -q 2>stderr &&
+ git gc --no-cruft -q 2>stderr &&
git cat-file -e $tag &&
test_must_be_empty stderr
'
diff --git a/t/t6600-test-reach.sh b/t/t6600-test-reach.sh
index 338a9c4..b330945 100755
--- a/t/t6600-test-reach.sh
+++ b/t/t6600-test-reach.sh
@@ -443,4 +443,173 @@ test_expect_success 'get_reachable_subset:none' '
test_all_modes get_reachable_subset
'
+test_expect_success 'for-each-ref ahead-behind:linear' '
+ cat >input <<-\EOF &&
+ refs/heads/commit-1-1
+ refs/heads/commit-1-3
+ refs/heads/commit-1-5
+ refs/heads/commit-1-8
+ EOF
+ cat >expect <<-\EOF &&
+ refs/heads/commit-1-1 0 8
+ refs/heads/commit-1-3 0 6
+ refs/heads/commit-1-5 0 4
+ refs/heads/commit-1-8 0 1
+ EOF
+ run_all_modes git for-each-ref \
+ --format="%(refname) %(ahead-behind:commit-1-9)" --stdin
+'
+
+test_expect_success 'for-each-ref ahead-behind:all' '
+ cat >input <<-\EOF &&
+ refs/heads/commit-1-1
+ refs/heads/commit-2-4
+ refs/heads/commit-4-2
+ refs/heads/commit-4-4
+ EOF
+ cat >expect <<-\EOF &&
+ refs/heads/commit-1-1 0 24
+ refs/heads/commit-2-4 0 17
+ refs/heads/commit-4-2 0 17
+ refs/heads/commit-4-4 0 9
+ EOF
+ run_all_modes git for-each-ref \
+ --format="%(refname) %(ahead-behind:commit-5-5)" --stdin
+'
+
+test_expect_success 'for-each-ref ahead-behind:some' '
+ cat >input <<-\EOF &&
+ refs/heads/commit-1-1
+ refs/heads/commit-5-3
+ refs/heads/commit-4-8
+ refs/heads/commit-9-9
+ EOF
+ cat >expect <<-\EOF &&
+ refs/heads/commit-1-1 0 53
+ refs/heads/commit-4-8 8 30
+ refs/heads/commit-5-3 0 39
+ refs/heads/commit-9-9 27 0
+ EOF
+ run_all_modes git for-each-ref \
+ --format="%(refname) %(ahead-behind:commit-9-6)" --stdin
+'
+
+test_expect_success 'for-each-ref ahead-behind:some, multibase' '
+ cat >input <<-\EOF &&
+ refs/heads/commit-1-1
+ refs/heads/commit-5-3
+ refs/heads/commit-7-8
+ refs/heads/commit-4-8
+ refs/heads/commit-9-9
+ EOF
+ cat >expect <<-\EOF &&
+ refs/heads/commit-1-1 0 53 0 53
+ refs/heads/commit-4-8 8 30 0 22
+ refs/heads/commit-5-3 0 39 0 39
+ refs/heads/commit-7-8 14 12 8 6
+ refs/heads/commit-9-9 27 0 27 0
+ EOF
+ run_all_modes git for-each-ref \
+ --format="%(refname) %(ahead-behind:commit-9-6) %(ahead-behind:commit-6-9)" \
+ --stdin
+'
+
+test_expect_success 'for-each-ref ahead-behind:none' '
+ cat >input <<-\EOF &&
+ refs/heads/commit-7-5
+ refs/heads/commit-4-8
+ refs/heads/commit-9-9
+ EOF
+ cat >expect <<-\EOF &&
+ refs/heads/commit-4-8 16 16
+ refs/heads/commit-7-5 7 4
+ refs/heads/commit-9-9 49 0
+ EOF
+ run_all_modes git for-each-ref \
+ --format="%(refname) %(ahead-behind:commit-8-4)" --stdin
+'
+
+test_expect_success 'for-each-ref merged:linear' '
+ cat >input <<-\EOF &&
+ refs/heads/commit-1-1
+ refs/heads/commit-1-3
+ refs/heads/commit-1-5
+ refs/heads/commit-1-8
+ refs/heads/commit-2-1
+ refs/heads/commit-5-1
+ refs/heads/commit-9-1
+ EOF
+ cat >expect <<-\EOF &&
+ refs/heads/commit-1-1
+ refs/heads/commit-1-3
+ refs/heads/commit-1-5
+ refs/heads/commit-1-8
+ EOF
+ run_all_modes git for-each-ref --merged=commit-1-9 \
+ --format="%(refname)" --stdin
+'
+
+test_expect_success 'for-each-ref merged:all' '
+ cat >input <<-\EOF &&
+ refs/heads/commit-1-1
+ refs/heads/commit-2-4
+ refs/heads/commit-4-2
+ refs/heads/commit-4-4
+ EOF
+ cat >expect <<-\EOF &&
+ refs/heads/commit-1-1
+ refs/heads/commit-2-4
+ refs/heads/commit-4-2
+ refs/heads/commit-4-4
+ EOF
+ run_all_modes git for-each-ref --merged=commit-5-5 \
+ --format="%(refname)" --stdin
+'
+
+test_expect_success 'for-each-ref ahead-behind:some' '
+ cat >input <<-\EOF &&
+ refs/heads/commit-1-1
+ refs/heads/commit-5-3
+ refs/heads/commit-4-8
+ refs/heads/commit-9-9
+ EOF
+ cat >expect <<-\EOF &&
+ refs/heads/commit-1-1
+ refs/heads/commit-5-3
+ EOF
+ run_all_modes git for-each-ref --merged=commit-9-6 \
+ --format="%(refname)" --stdin
+'
+
+test_expect_success 'for-each-ref merged:some, multibase' '
+ cat >input <<-\EOF &&
+ refs/heads/commit-1-1
+ refs/heads/commit-5-3
+ refs/heads/commit-7-8
+ refs/heads/commit-4-8
+ refs/heads/commit-9-9
+ EOF
+ cat >expect <<-\EOF &&
+ refs/heads/commit-1-1
+ refs/heads/commit-4-8
+ refs/heads/commit-5-3
+ EOF
+ run_all_modes git for-each-ref \
+ --merged=commit-5-8 \
+ --merged=commit-8-5 \
+ --format="%(refname)" \
+ --stdin
+'
+
+test_expect_success 'for-each-ref merged:none' '
+ cat >input <<-\EOF &&
+ refs/heads/commit-7-5
+ refs/heads/commit-4-8
+ refs/heads/commit-9-9
+ EOF
+ >expect &&
+ run_all_modes git for-each-ref --merged=commit-8-4 \
+ --format="%(refname)" --stdin
+'
+
test_done
diff --git a/t/t6700-tree-depth.sh b/t/t6700-tree-depth.sh
new file mode 100755
index 0000000..9e70a7c
--- /dev/null
+++ b/t/t6700-tree-depth.sh
@@ -0,0 +1,95 @@
+#!/bin/sh
+
+test_description='handling of deep trees in various commands'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+# We'll test against two depths here: a small one that will let us check the
+# behavior of the config setting easily, and a large one that should be
+# forbidden by default. Testing the default depth will let us know whether our
+# default is enough to prevent segfaults on systems that run the tests.
+small_depth=50
+big_depth=4100
+
+small_ok="-c core.maxtreedepth=$small_depth"
+small_no="-c core.maxtreedepth=$((small_depth-1))"
+
+# usage: mkdeep <name> <depth>
+# Create a tag <name> containing a file whose path has depth <depth>.
+#
+# We'll use fast-import here for two reasons:
+#
+# 1. It's faster than creating $big_depth tree objects.
+#
+# 2. As we tighten tree limits, it's more likely to allow large sizes
+# than trying to stuff a deep path into the index.
+mkdeep () {
+ {
+ echo "commit refs/tags/$1" &&
+ echo "committer foo <foo@example.com> 1234 -0000" &&
+ echo "data <<EOF" &&
+ echo "the commit message" &&
+ echo "EOF" &&
+
+ printf 'M 100644 inline ' &&
+ i=0 &&
+ while test $i -lt $2
+ do
+ printf 'a/'
+ i=$((i+1))
+ done &&
+ echo "file" &&
+
+ echo "data <<EOF" &&
+ echo "the file contents" &&
+ echo "EOF" &&
+ echo
+ } | git fast-import
+}
+
+test_expect_success 'create small tree' '
+ mkdeep small $small_depth
+'
+
+test_expect_success 'create big tree' '
+ mkdeep big $big_depth
+'
+
+test_expect_success 'limit recursion of git-archive' '
+ git $small_ok archive small >/dev/null &&
+ test_must_fail git $small_no archive small >/dev/null
+'
+
+test_expect_success 'default limit for git-archive fails gracefully' '
+ test_must_fail git archive big >/dev/null
+'
+
+test_expect_success 'limit recursion of ls-tree -r' '
+ git $small_ok ls-tree -r small &&
+ test_must_fail git $small_no ls-tree -r small
+'
+
+test_expect_success 'default limit for ls-tree fails gracefully' '
+ test_must_fail git ls-tree -r big >/dev/null
+'
+
+test_expect_success 'limit recursion of rev-list --objects' '
+ git $small_ok rev-list --objects small >/dev/null &&
+ test_must_fail git $small_no rev-list --objects small >/dev/null
+'
+
+test_expect_success 'default limit for rev-list fails gracefully' '
+ test_must_fail git rev-list --objects big >/dev/null
+'
+
+test_expect_success 'limit recursion of diff-tree -r' '
+ git $small_ok diff-tree -r $EMPTY_TREE small &&
+ test_must_fail git $small_no diff-tree -r $EMPTY_TREE small
+'
+
+test_expect_success 'default limit for diff-tree fails gracefully' '
+ test_must_fail git diff-tree -r $EMPTY_TREE big
+'
+
+test_done
diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh
index a402908..879a6dc 100755
--- a/t/t7001-mv.sh
+++ b/t/t7001-mv.sh
@@ -4,6 +4,10 @@ test_description='git mv in subdirs'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-diff-data.sh
+index_at_path () {
+ git ls-files --format='%(objectmode) %(objectname) %(stage)' "$@"
+}
+
test_expect_success 'mv -f refreshes updated index entry' '
echo test >bar &&
git add bar &&
@@ -60,8 +64,8 @@ test_expect_success 'checking the commit' '
test_expect_success 'mv --dry-run does not move file' '
git mv -n path0/COPYING MOVED &&
- test -f path0/COPYING &&
- test ! -f MOVED
+ test_path_is_file path0/COPYING &&
+ test_path_is_missing MOVED
'
test_expect_success 'checking -k on non-existing file' '
@@ -71,25 +75,25 @@ test_expect_success 'checking -k on non-existing file' '
test_expect_success 'checking -k on untracked file' '
>untracked1 &&
git mv -k untracked1 path0 &&
- test -f untracked1 &&
- test ! -f path0/untracked1
+ test_path_is_file untracked1 &&
+ test_path_is_missing path0/untracked1
'
test_expect_success 'checking -k on multiple untracked files' '
>untracked2 &&
git mv -k untracked1 untracked2 path0 &&
- test -f untracked1 &&
- test -f untracked2 &&
- test ! -f path0/untracked1 &&
- test ! -f path0/untracked2
+ test_path_is_file untracked1 &&
+ test_path_is_file untracked2 &&
+ test_path_is_missing path0/untracked1 &&
+ test_path_is_missing path0/untracked2
'
test_expect_success 'checking -f on untracked file with existing target' '
>path0/untracked1 &&
test_must_fail git mv -f untracked1 path0 &&
- test ! -f .git/index.lock &&
- test -f untracked1 &&
- test -f path0/untracked1
+ test_path_is_missing .git/index.lock &&
+ test_path_is_file untracked1 &&
+ test_path_is_file path0/untracked1
'
# clean up the mess in case bad things happen
@@ -170,6 +174,13 @@ test_expect_success 'do not move directory over existing directory' '
test_must_fail git mv path2 path0
'
+test_expect_success 'rename directory to non-existing directory' '
+ mkdir dir-a &&
+ >dir-a/f &&
+ git add dir-a &&
+ git mv dir-a non-existing-dir
+'
+
test_expect_success 'move into "."' '
git mv path1/path2/ .
'
@@ -187,7 +198,8 @@ test_expect_success "Michael Cassar's test case" '
git mv papers/unsorted/Thesis.pdf papers/all-papers/moo-blah.pdf &&
T=$(git write-tree) &&
- git ls-tree -r $T | verbose grep partA/outline.txt
+ git ls-tree -r $T >out &&
+ grep partA/outline.txt out
'
rm -fr papers partA path?
@@ -215,8 +227,8 @@ test_expect_success 'absolute pathname' '
git add sub/file &&
git mv sub "$(pwd)/in" &&
- ! test -d sub &&
- test -d in &&
+ test_path_is_missing sub &&
+ test_path_is_dir in &&
git ls-files --error-unmatch in/file
)
'
@@ -234,8 +246,8 @@ test_expect_success 'absolute pathname outside should fail' '
git add sub/file &&
test_must_fail git mv sub "$out/out" &&
- test -d sub &&
- ! test -d ../in &&
+ test_path_is_dir sub &&
+ test_path_is_missing ../in &&
git ls-files --error-unmatch sub/file
)
'
@@ -260,12 +272,12 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' '
git init &&
echo 1 >dirty &&
git add dirty &&
- entry="$(git ls-files --stage dirty | cut -f 1)" &&
+ entry="$(index_at_path dirty)" &&
git mv dirty dirty2 &&
- test "$entry" = "$(git ls-files --stage dirty2 | cut -f 1)" &&
+ test "$entry" = "$(index_at_path dirty2)" &&
echo 2 >dirty2 &&
git mv dirty2 dirty &&
- test "$entry" = "$(git ls-files --stage dirty | cut -f 1)"
+ test "$entry" = "$(index_at_path dirty)"
'
rm -f dirty dirty2
@@ -284,7 +296,7 @@ test_expect_success 'git mv error on conflicted file' '
EOF
test_must_fail git mv conflict newname 2>actual &&
- test_i18ngrep "conflicted" actual
+ test_grep "conflicted" actual
'
test_expect_success 'git mv should overwrite symlink to a file' '
@@ -295,8 +307,8 @@ test_expect_success 'git mv should overwrite symlink to a file' '
git add moved &&
test_must_fail git mv moved symlink &&
git mv -f moved symlink &&
- ! test -e moved &&
- test -f symlink &&
+ test_path_is_missing moved &&
+ test_path_is_file symlink &&
test "$(cat symlink)" = 1 &&
git update-index --refresh &&
git diff-files --quiet
@@ -312,18 +324,19 @@ test_expect_success 'git mv should overwrite file with a symlink' '
git add moved &&
test_must_fail git mv symlink moved &&
git mv -f symlink moved &&
- ! test -e symlink &&
+ test_path_is_missing symlink &&
git update-index --refresh &&
git diff-files --quiet
'
test_expect_success SYMLINKS 'check moved symlink' '
- test -h moved
+ test_path_is_symlink moved
'
rm -f moved symlink
test_expect_success 'setup submodule' '
+ test_config_global protocol.file.allow always &&
git commit -m initial &&
git reset --hard &&
git submodule add ./. sub &&
@@ -341,7 +354,7 @@ test_expect_success 'git mv cannot move a submodule in a file' '
'
test_expect_success 'git mv moves a submodule with a .git directory and no .gitmodules' '
- entry="$(git ls-files --stage sub | cut -f 1)" &&
+ entry="$(index_at_path sub)" &&
git rm .gitmodules &&
(
cd sub &&
@@ -351,8 +364,8 @@ test_expect_success 'git mv moves a submodule with a .git directory and no .gitm
) &&
mkdir mod &&
git mv sub mod/sub &&
- ! test -e sub &&
- test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
+ test_path_is_missing sub &&
+ test "$entry" = "$(index_at_path mod/sub)" &&
git -C mod/sub status &&
git update-index --refresh &&
git diff-files --quiet
@@ -362,7 +375,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and .gitmodu
rm -rf mod &&
git reset --hard &&
git submodule update &&
- entry="$(git ls-files --stage sub | cut -f 1)" &&
+ entry="$(index_at_path sub)" &&
(
cd sub &&
rm -f .git &&
@@ -371,8 +384,8 @@ test_expect_success 'git mv moves a submodule with a .git directory and .gitmodu
) &&
mkdir mod &&
git mv sub mod/sub &&
- ! test -e sub &&
- test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
+ test_path_is_missing sub &&
+ test "$entry" = "$(index_at_path mod/sub)" &&
git -C mod/sub status &&
echo mod/sub >expected &&
git config -f .gitmodules submodule.sub.path >actual &&
@@ -385,11 +398,11 @@ test_expect_success 'git mv moves a submodule with gitfile' '
rm -rf mod &&
git reset --hard &&
git submodule update &&
- entry="$(git ls-files --stage sub | cut -f 1)" &&
+ entry="$(index_at_path sub)" &&
mkdir mod &&
git -C mod mv ../sub/ . &&
- ! test -e sub &&
- test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
+ test_path_is_missing sub &&
+ test "$entry" = "$(index_at_path mod/sub)" &&
git -C mod/sub status &&
echo mod/sub >expected &&
git config -f .gitmodules submodule.sub.path >actual &&
@@ -403,12 +416,12 @@ test_expect_success 'mv does not complain when no .gitmodules file is found' '
git reset --hard &&
git submodule update &&
git rm .gitmodules &&
- entry="$(git ls-files --stage sub | cut -f 1)" &&
+ entry="$(index_at_path sub)" &&
mkdir mod &&
git mv sub mod/sub 2>actual.err &&
test_must_be_empty actual.err &&
- ! test -e sub &&
- test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
+ test_path_is_missing sub &&
+ test "$entry" = "$(index_at_path mod/sub)" &&
git -C mod/sub status &&
git update-index --refresh &&
git diff-files --quiet
@@ -419,17 +432,17 @@ test_expect_success 'mv will error out on a modified .gitmodules file unless sta
git reset --hard &&
git submodule update &&
git config -f .gitmodules foo.bar true &&
- entry="$(git ls-files --stage sub | cut -f 1)" &&
+ entry="$(index_at_path sub)" &&
mkdir mod &&
test_must_fail git mv sub mod/sub 2>actual.err &&
- test -s actual.err &&
- test -e sub &&
+ test_file_not_empty actual.err &&
+ test_path_exists sub &&
git diff-files --quiet -- sub &&
git add .gitmodules &&
git mv sub mod/sub 2>actual.err &&
test_must_be_empty actual.err &&
- ! test -e sub &&
- test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
+ test_path_is_missing sub &&
+ test "$entry" = "$(index_at_path mod/sub)" &&
git -C mod/sub status &&
git update-index --refresh &&
git diff-files --quiet
@@ -441,13 +454,13 @@ test_expect_success 'mv issues a warning when section is not found in .gitmodule
git submodule update &&
git config -f .gitmodules --remove-section submodule.sub &&
git add .gitmodules &&
- entry="$(git ls-files --stage sub | cut -f 1)" &&
+ entry="$(index_at_path sub)" &&
echo "warning: Could not find section in .gitmodules where path=sub" >expect.err &&
mkdir mod &&
git mv sub mod/sub 2>actual.err &&
test_cmp expect.err actual.err &&
- ! test -e sub &&
- test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
+ test_path_is_missing sub &&
+ test "$entry" = "$(index_at_path mod/sub)" &&
git -C mod/sub status &&
git update-index --refresh &&
git diff-files --quiet
@@ -459,7 +472,7 @@ test_expect_success 'mv --dry-run does not touch the submodule or .gitmodules' '
git submodule update &&
mkdir mod &&
git mv -n sub mod/sub 2>actual.err &&
- test -f sub/.git &&
+ test_path_is_file sub/.git &&
git diff-index --exit-code HEAD &&
git update-index --refresh &&
git diff-files --quiet -- sub .gitmodules
@@ -469,14 +482,14 @@ test_expect_success 'checking out a commit before submodule moved needs manual u
git mv sub sub2 &&
git commit -m "moved sub to sub2" &&
git checkout -q HEAD^ 2>actual &&
- test_i18ngrep "^warning: unable to rmdir '\''sub2'\'':" actual &&
+ test_grep "^warning: unable to rmdir '\''sub2'\'':" actual &&
git status -s sub2 >actual &&
echo "?? sub2/" >expected &&
test_cmp expected actual &&
- ! test -f sub/.git &&
- test -f sub2/.git &&
+ test_path_is_missing sub/.git &&
+ test_path_is_file sub2/.git &&
git submodule update &&
- test -f sub/.git &&
+ test_path_is_file sub/.git &&
rm -rf sub2 &&
git diff-index --exit-code HEAD &&
git update-index --refresh &&
@@ -509,6 +522,7 @@ test_expect_success 'moving a submodule in nested directories' '
'
test_expect_success 'moving nested submodules' '
+ test_config_global protocol.file.allow always &&
git commit -am "cleanup commit" &&
mkdir sub_nested_nested &&
(
diff --git a/t/t7002-mv-sparse-checkout.sh b/t/t7002-mv-sparse-checkout.sh
index f0f7cbf..26582ae 100755
--- a/t/t7002-mv-sparse-checkout.sh
+++ b/t/t7002-mv-sparse-checkout.sh
@@ -4,6 +4,18 @@ test_description='git mv in sparse working trees'
. ./test-lib.sh
+setup_sparse_checkout () {
+ mkdir folder1 &&
+ touch folder1/file1 &&
+ git add folder1 &&
+ git sparse-checkout set --cone sub
+}
+
+cleanup_sparse_checkout () {
+ git sparse-checkout disable &&
+ git reset --hard
+}
+
test_expect_success 'setup' "
mkdir -p sub/dir sub/dir2 &&
touch a b c sub/d sub/dir/e sub/dir2/e &&
@@ -16,12 +28,25 @@ test_expect_success 'setup' "
updated in the index:
EOF
- cat >sparse_hint <<-EOF
+ cat >sparse_hint <<-EOF &&
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\"
EOF
+
+ cat >dirty_error_header <<-EOF &&
+ The following paths have been moved outside the
+ sparse-checkout definition but are not sparse due to local
+ modifications.
+ EOF
+
+ cat >dirty_hint <<-EOF
+ 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\"
+ EOF
"
test_expect_success 'mv refuses to move sparse-to-sparse' '
@@ -196,6 +221,7 @@ test_expect_success 'can move files to non-sparse dir' '
'
test_expect_success 'refuse to move file to non-skip-worktree sparse path' '
+ test_when_finished "cleanup_sparse_checkout" &&
git reset --hard &&
git sparse-checkout init --no-cone &&
git sparse-checkout set a !/x y/ !x/y/z &&
@@ -206,4 +232,286 @@ test_expect_success 'refuse to move file to non-skip-worktree sparse path' '
test_cmp expect stderr
'
+test_expect_success 'refuse to move out-of-cone directory without --sparse' '
+ test_when_finished "cleanup_sparse_checkout" &&
+ setup_sparse_checkout &&
+
+ test_must_fail git mv folder1 sub 2>stderr &&
+ cat sparse_error_header >expect &&
+ echo folder1/file1 >>expect &&
+ cat sparse_hint >>expect &&
+ test_cmp expect stderr
+'
+
+test_expect_success 'can move out-of-cone directory with --sparse' '
+ test_when_finished "cleanup_sparse_checkout" &&
+ setup_sparse_checkout &&
+
+ git mv --sparse folder1 sub 2>stderr &&
+ test_must_be_empty stderr &&
+
+ test_path_is_dir sub/folder1 &&
+ test_path_is_file sub/folder1/file1
+'
+
+test_expect_success 'refuse to move out-of-cone file without --sparse' '
+ test_when_finished "cleanup_sparse_checkout" &&
+ setup_sparse_checkout &&
+
+ test_must_fail git mv folder1/file1 sub 2>stderr &&
+ cat sparse_error_header >expect &&
+ echo folder1/file1 >>expect &&
+ cat sparse_hint >>expect &&
+ test_cmp expect stderr
+'
+
+test_expect_success 'can move out-of-cone file with --sparse' '
+ test_when_finished "cleanup_sparse_checkout" &&
+ setup_sparse_checkout &&
+
+ git mv --sparse folder1/file1 sub 2>stderr &&
+ test_must_be_empty stderr &&
+
+ test_path_is_file sub/file1
+'
+
+test_expect_success 'refuse to move sparse file to existing destination' '
+ test_when_finished "cleanup_sparse_checkout" &&
+ mkdir folder1 &&
+ touch folder1/file1 &&
+ touch sub/file1 &&
+ git add folder1 sub/file1 &&
+ git sparse-checkout set --cone sub &&
+
+ test_must_fail git mv --sparse folder1/file1 sub 2>stderr &&
+ echo "fatal: destination exists, source=folder1/file1, destination=sub/file1" >expect &&
+ test_cmp expect stderr
+'
+
+test_expect_success 'move sparse file to existing destination with --force and --sparse' '
+ test_when_finished "cleanup_sparse_checkout" &&
+ mkdir folder1 &&
+ touch folder1/file1 &&
+ touch sub/file1 &&
+ echo "overwrite" >folder1/file1 &&
+ git add folder1 sub/file1 &&
+ git sparse-checkout set --cone sub &&
+
+ git mv --sparse --force folder1/file1 sub 2>stderr &&
+ test_must_be_empty stderr &&
+ echo "overwrite" >expect &&
+ test_cmp expect sub/file1
+'
+
+test_expect_success 'move clean path from in-cone to out-of-cone' '
+ test_when_finished "cleanup_sparse_checkout" &&
+ setup_sparse_checkout &&
+
+ test_must_fail git mv sub/d folder1 2>stderr &&
+ cat sparse_error_header >expect &&
+ echo "folder1/d" >>expect &&
+ cat sparse_hint >>expect &&
+ test_cmp expect stderr &&
+
+ git mv --sparse sub/d folder1 2>stderr &&
+ test_must_be_empty stderr &&
+
+ test_path_is_missing sub/d &&
+ test_path_is_missing folder1/d &&
+ git ls-files -t >actual &&
+ ! grep "^H sub/d\$" actual &&
+ grep "S folder1/d" actual
+'
+
+test_expect_success 'move clean path from in-cone to out-of-cone overwrite' '
+ test_when_finished "cleanup_sparse_checkout" &&
+ setup_sparse_checkout &&
+ echo "sub/file1 overwrite" >sub/file1 &&
+ git add sub/file1 &&
+
+ test_must_fail git mv sub/file1 folder1 2>stderr &&
+ cat sparse_error_header >expect &&
+ echo "folder1/file1" >>expect &&
+ cat sparse_hint >>expect &&
+ test_cmp expect stderr &&
+
+ test_must_fail git mv --sparse sub/file1 folder1 2>stderr &&
+ echo "fatal: destination exists in the index, source=sub/file1, destination=folder1/file1" \
+ >expect &&
+ test_cmp expect stderr &&
+
+ git mv --sparse -f sub/file1 folder1 2>stderr &&
+ test_must_be_empty stderr &&
+
+ test_path_is_missing sub/file1 &&
+ test_path_is_missing folder1/file1 &&
+ git ls-files -t >actual &&
+ ! grep "H sub/file1" actual &&
+ grep "S folder1/file1" actual &&
+
+ # compare file content before move and after move
+ echo "sub/file1 overwrite" >expect &&
+ git ls-files -s -- folder1/file1 | awk "{print \$2}" >oid &&
+ git cat-file blob $(cat oid) >actual &&
+ test_cmp expect actual
+'
+
+# This test is testing the same behavior as the
+# "move clean path from in-cone to out-of-cone overwrite" above.
+# The only difference is the <destination> changes from "folder1" to "folder1/file1"
+test_expect_success 'move clean path from in-cone to out-of-cone file overwrite' '
+ test_when_finished "cleanup_sparse_checkout" &&
+ setup_sparse_checkout &&
+ echo "sub/file1 overwrite" >sub/file1 &&
+ git add sub/file1 &&
+
+ test_must_fail git mv sub/file1 folder1/file1 2>stderr &&
+ cat sparse_error_header >expect &&
+ echo "folder1/file1" >>expect &&
+ cat sparse_hint >>expect &&
+ test_cmp expect stderr &&
+
+ test_must_fail git mv --sparse sub/file1 folder1/file1 2>stderr &&
+ echo "fatal: destination exists in the index, source=sub/file1, destination=folder1/file1" \
+ >expect &&
+ test_cmp expect stderr &&
+
+ git mv --sparse -f sub/file1 folder1/file1 2>stderr &&
+ test_must_be_empty stderr &&
+
+ test_path_is_missing sub/file1 &&
+ test_path_is_missing folder1/file1 &&
+ git ls-files -t >actual &&
+ ! grep "H sub/file1" actual &&
+ grep "S folder1/file1" actual &&
+
+ # compare file content before move and after move
+ echo "sub/file1 overwrite" >expect &&
+ git ls-files -s -- folder1/file1 | awk "{print \$2}" >oid &&
+ git cat-file blob $(cat oid) >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'move directory with one of the files overwrite' '
+ test_when_finished "cleanup_sparse_checkout" &&
+ mkdir -p folder1/dir &&
+ touch folder1/dir/file1 &&
+ git add folder1 &&
+ git sparse-checkout set --cone sub &&
+
+ echo test >sub/dir/file1 &&
+ git add sub/dir/file1 &&
+
+ test_must_fail git mv sub/dir folder1 2>stderr &&
+ cat sparse_error_header >expect &&
+ echo "folder1/dir/e" >>expect &&
+ echo "folder1/dir/file1" >>expect &&
+ cat sparse_hint >>expect &&
+ test_cmp expect stderr &&
+
+ test_must_fail git mv --sparse sub/dir folder1 2>stderr &&
+ echo "fatal: destination exists in the index, source=sub/dir/file1, destination=folder1/dir/file1" \
+ >expect &&
+ test_cmp expect stderr &&
+
+ git mv --sparse -f sub/dir folder1 2>stderr &&
+ test_must_be_empty stderr &&
+
+ test_path_is_missing sub/dir/file1 &&
+ test_path_is_missing sub/dir/e &&
+ test_path_is_missing folder1/file1 &&
+ git ls-files -t >actual &&
+ ! grep "H sub/dir/file1" actual &&
+ ! grep "H sub/dir/e" actual &&
+ grep "S folder1/dir/file1" actual &&
+
+ # compare file content before move and after move
+ echo test >expect &&
+ git ls-files -s -- folder1/dir/file1 | awk "{print \$2}" >oid &&
+ git cat-file blob $(cat oid) >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'move dirty path from in-cone to out-of-cone' '
+ test_when_finished "cleanup_sparse_checkout" &&
+ setup_sparse_checkout &&
+ echo "modified" >>sub/d &&
+
+ test_must_fail git mv sub/d folder1 2>stderr &&
+ cat sparse_error_header >expect &&
+ echo "folder1/d" >>expect &&
+ cat sparse_hint >>expect &&
+ test_cmp expect stderr &&
+
+ git mv --sparse sub/d folder1 2>stderr &&
+ cat dirty_error_header >expect &&
+ echo "folder1/d" >>expect &&
+ cat dirty_hint >>expect &&
+ test_cmp expect stderr &&
+
+ test_path_is_missing sub/d &&
+ test_path_is_file folder1/d &&
+ git ls-files -t >actual &&
+ ! grep "^H sub/d\$" actual &&
+ grep "H folder1/d" actual
+'
+
+test_expect_success 'move dir from in-cone to out-of-cone' '
+ test_when_finished "cleanup_sparse_checkout" &&
+ setup_sparse_checkout &&
+ mkdir sub/dir/deep &&
+
+ test_must_fail git mv sub/dir folder1 2>stderr &&
+ cat sparse_error_header >expect &&
+ echo "folder1/dir/e" >>expect &&
+ cat sparse_hint >>expect &&
+ test_cmp expect stderr &&
+
+ git mv --sparse sub/dir folder1 2>stderr &&
+ test_must_be_empty stderr &&
+
+ test_path_is_missing sub/dir &&
+ test_path_is_missing folder1 &&
+ git ls-files -t >actual &&
+ ! grep "H sub/dir/e" actual &&
+ grep "S folder1/dir/e" actual
+'
+
+test_expect_success 'move partially-dirty dir from in-cone to out-of-cone' '
+ test_when_finished "cleanup_sparse_checkout" &&
+ setup_sparse_checkout &&
+ mkdir sub/dir/deep &&
+ touch sub/dir/e2 sub/dir/e3 &&
+ git add sub/dir/e2 sub/dir/e3 &&
+ echo "modified" >>sub/dir/e2 &&
+ echo "modified" >>sub/dir/e3 &&
+
+ test_must_fail git mv sub/dir folder1 2>stderr &&
+ cat sparse_error_header >expect &&
+ echo "folder1/dir/e" >>expect &&
+ echo "folder1/dir/e2" >>expect &&
+ echo "folder1/dir/e3" >>expect &&
+ cat sparse_hint >>expect &&
+ test_cmp expect stderr &&
+
+ git mv --sparse sub/dir folder1 2>stderr &&
+ cat dirty_error_header >expect &&
+ echo "folder1/dir/e2" >>expect &&
+ echo "folder1/dir/e3" >>expect &&
+ cat dirty_hint >>expect &&
+ test_cmp expect stderr &&
+
+ test_path_is_missing sub/dir &&
+ test_path_is_missing folder1/dir/e &&
+ test_path_is_file folder1/dir/e2 &&
+ test_path_is_file folder1/dir/e3 &&
+ git ls-files -t >actual &&
+ ! grep "H sub/dir/e" actual &&
+ ! grep "H sub/dir/e2" actual &&
+ ! grep "H sub/dir/e3" actual &&
+ grep "S folder1/dir/e" actual &&
+ grep "H folder1/dir/e2" actual &&
+ grep "H folder1/dir/e3" actual
+'
+
test_done
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index e18a218..5ab4d41 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -49,7 +49,7 @@ test_expect_success 'result is really identical' '
test_expect_success 'rewrite bare repository identically' '
(git config core.bare true && cd .git &&
git filter-branch branch > filter-output 2>&1 &&
- ! fgrep fatal filter-output)
+ ! grep fatal filter-output)
'
git config core.bare false
test_expect_success 'result is really identical' '
@@ -396,10 +396,7 @@ test_expect_success '--prune-empty is able to prune entire branch' '
git branch prune-entire B &&
git filter-branch -f --prune-empty --index-filter "git update-index --remove A.t B.t" prune-entire &&
test_must_fail git rev-parse refs/heads/prune-entire &&
- if test_have_prereq REFFILES
- then
- test_must_fail git reflog exists refs/heads/prune-entire
- fi
+ test_must_fail git reflog exists refs/heads/prune-entire
'
test_expect_success '--remap-to-ancestor with filename filters' '
@@ -506,7 +503,7 @@ test_expect_success 'rewrite repository including refs that point at non-commit
git tag -a -m "tag to a tree" treetag $new_tree &&
git reset --hard HEAD &&
git filter-branch -f -- --all >filter-output 2>&1 &&
- ! fgrep fatal filter-output
+ ! grep fatal filter-output
'
test_expect_success 'filter-branch handles ref deletion' '
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 9aa1660..696866d 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -792,6 +792,34 @@ test_expect_success 'annotations for blobs are empty' '
test_cmp expect actual
'
+# Run this before doing any signing, so the test has the same results
+# regardless of the GPG prereq.
+test_expect_success 'git tag --format with ahead-behind' '
+ test_when_finished git reset --hard tag-one-line &&
+ git commit --allow-empty -m "left" &&
+ git tag -a -m left tag-left &&
+ git reset --hard HEAD~1 &&
+ git commit --allow-empty -m "right" &&
+ git tag -a -m left tag-right &&
+
+ # Use " !" at the end to demonstrate whitespace
+ # around empty ahead-behind token for tag-blob.
+ cat >expect <<-EOF &&
+ refs/tags/tag-blob !
+ refs/tags/tag-left 1 1 !
+ refs/tags/tag-lines 0 1 !
+ refs/tags/tag-one-line 0 1 !
+ refs/tags/tag-right 0 0 !
+ refs/tags/tag-zero-lines 0 1 !
+ EOF
+ git tag -l --format="%(refname) %(ahead-behind:HEAD) !" >actual 2>err &&
+ grep "refs/tags/tag" actual >actual.focus &&
+ test_cmp expect actual.focus &&
+
+ # Error reported for tags that point to non-commits.
+ grep "error: object [0-9a-f]* is a blob, not a commit" err
+'
+
# trying to verify annotated non-signed tags:
test_expect_success GPG \
@@ -1749,10 +1777,10 @@ test_expect_success '--points-at finds annotated tags of tags' '
'
test_expect_success 'recursive tagging should give advice' '
- sed -e "s/|$//" <<-EOF >expect &&
+ cat >expect <<-EOF &&
hint: You have created a nested tag. The object referred to by your new tag is
hint: already a tag. If you meant to tag the object that it points to, use:
- hint: |
+ hint:
hint: git tag -f nested annotated-v4.0^{}
hint: Disable this message with "git config advice.nestedTag false"
EOF
@@ -1834,6 +1862,51 @@ test_expect_success 'option override configured sort' '
test_cmp expect actual
'
+test_expect_success '--no-sort cancels config sort keys' '
+ test_config tag.sort "-refname" &&
+
+ # objecttype is identical for all of them, so sort falls back on
+ # default (ascending refname)
+ git tag -l \
+ --no-sort \
+ --sort="objecttype" \
+ "foo*" >actual &&
+ cat >expect <<-\EOF &&
+ foo1.10
+ foo1.3
+ foo1.6
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success '--no-sort cancels command line sort keys' '
+ # objecttype is identical for all of them, so sort falls back on
+ # default (ascending refname)
+ git tag -l \
+ --sort="-refname" \
+ --no-sort \
+ --sort="objecttype" \
+ "foo*" >actual &&
+ cat >expect <<-\EOF &&
+ foo1.10
+ foo1.3
+ foo1.6
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success '--no-sort without subsequent --sort prints expected tags' '
+ # Sort the results with `sort` for a consistent comparison against
+ # expected
+ git tag -l --no-sort "foo*" | sort >actual &&
+ cat >expect <<-\EOF &&
+ foo1.10
+ foo1.3
+ foo1.6
+ EOF
+ test_cmp expect actual
+'
+
test_expect_success 'invalid sort parameter on command line' '
test_must_fail git tag -l --sort=notvalid "foo*" >actual
'
@@ -1843,6 +1916,23 @@ test_expect_success 'invalid sort parameter in configuratoin' '
test_must_fail git tag -l "foo*"
'
+test_expect_success 'version sort handles empty value for versionsort.{prereleaseSuffix,suffix}' '
+ cp .git/config .git/config.orig &&
+ test_when_finished mv .git/config.orig .git/config &&
+
+ cat >>.git/config <<-\EOF &&
+ [versionsort]
+ prereleaseSuffix
+ suffix
+ EOF
+ cat >expect <<-\EOF &&
+ error: missing value for '\''versionsort.suffix'\''
+ error: missing value for '\''versionsort.prereleasesuffix'\''
+ EOF
+ git tag -l --sort=version:refname 2>actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'version sort with prerelease reordering' '
test_config versionsort.prereleaseSuffix -rc &&
git tag foo1.6-rc1 &&
@@ -2001,6 +2091,22 @@ test_expect_success '--format should list tags as per format given' '
test_cmp expect actual
'
+test_expect_success '--format --omit-empty works' '
+ cat >expect <<-\EOF &&
+ refname : refs/tags/v1.0
+
+ refname : refs/tags/v1.1.3
+ EOF
+ git tag -l --format="%(if:notequals=refs/tags/v1.0.1)%(refname)%(then)refname : %(refname)%(end)" "v1*" >actual &&
+ test_cmp expect actual &&
+ cat >expect <<-\EOF &&
+ refname : refs/tags/v1.0
+ refname : refs/tags/v1.1.3
+ EOF
+ git tag -l --omit-empty --format="%(if:notequals=refs/tags/v1.0.1)%(refname)%(then)refname : %(refname)%(end)" "v1*" >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'git tag -l with --format="%(rest)" must fail' '
test_must_fail git tag -l --format="%(rest)" "v1*"
'
@@ -2127,4 +2233,23 @@ test_expect_success 'Does --[no-]contains stop at commits? Yes!' '
test_cmp expected actual
'
+test_expect_success 'If tag is created then tag message file is unlinked' '
+ test_when_finished "git tag -d foo" &&
+ write_script fakeeditor <<-\EOF &&
+ echo Message >.git/TAG_EDITMSG
+ EOF
+ GIT_EDITOR=./fakeeditor git tag -a foo &&
+ test_path_is_missing .git/TAG_EDITMSG
+'
+
+test_expect_success 'If tag cannot be created then tag message file is not unlinked' '
+ test_when_finished "git tag -d foo/bar && rm .git/TAG_EDITMSG" &&
+ write_script fakeeditor <<-\EOF &&
+ echo Message >.git/TAG_EDITMSG
+ EOF
+ git tag foo/bar &&
+ test_must_fail env GIT_EDITOR=./fakeeditor git tag -a foo &&
+ test_path_exists .git/TAG_EDITMSG
+'
+
test_done
diff --git a/t/t7007-show.sh b/t/t7007-show.sh
index d6cc69e..f908a4d 100755
--- a/t/t7007-show.sh
+++ b/t/t7007-show.sh
@@ -2,6 +2,7 @@
test_description='git show'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t7030-verify-tag.sh b/t/t7030-verify-tag.sh
index 10faa64..6f526c3 100755
--- a/t/t7030-verify-tag.sh
+++ b/t/t7030-verify-tag.sh
@@ -115,7 +115,7 @@ test_expect_success GPGSM 'verify and show signatures x509 with high minTrustLev
test_expect_success GPG 'detect fudged signature' '
git cat-file tag seventh-signed >raw &&
- sed -e "/^tag / s/seventh/7th forged/" raw >forged1 &&
+ sed -e "/^tag / s/seventh/7th-forged/" raw >forged1 &&
git hash-object -w -t tag forged1 >forged1.tag &&
test_must_fail git verify-tag $(cat forged1.tag) 2>actual1 &&
grep "BAD signature from" actual1 &&
diff --git a/t/t7031-verify-tag-signed-ssh.sh b/t/t7031-verify-tag-signed-ssh.sh
index 1cb36b9..20913b3 100755
--- a/t/t7031-verify-tag-signed-ssh.sh
+++ b/t/t7031-verify-tag-signed-ssh.sh
@@ -125,7 +125,7 @@ test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'verify-tag failes with tag date ou
test_expect_success GPGSSH 'detect fudged ssh signature' '
test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" &&
git cat-file tag seventh-signed >raw &&
- sed -e "/^tag / s/seventh/7th forged/" raw >forged1 &&
+ sed -e "/^tag / s/seventh/7th-forged/" raw >forged1 &&
git hash-object -w -t tag forged1 >forged1.tag &&
test_must_fail git verify-tag $(cat forged1.tag) 2>actual1 &&
grep "${GPGSSH_BAD_SIGNATURE}" actual1 &&
@@ -200,4 +200,14 @@ test_expect_success GPGSSH 'verifying a forged tag with --format should fail sil
test_must_be_empty actual-forged
'
+test_expect_success GPGSSH 'rev-list --format=%G' '
+ test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" &&
+ git rev-list -1 --format="%G? %H" sixth-signed >actual &&
+ cat >expect <<-EOF &&
+ commit $(git rev-parse sixth-signed^0)
+ G $(git rev-parse sixth-signed^0)
+ EOF
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh
index 0f4344c..aaeb4a5 100755
--- a/t/t7060-wtstatus.sh
+++ b/t/t7060-wtstatus.sh
@@ -5,6 +5,7 @@ test_description='basic work tree status reporting'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
diff --git a/t/t7062-wtstatus-ignorecase.sh b/t/t7062-wtstatus-ignorecase.sh
index 73709db..caf372a 100755
--- a/t/t7062-wtstatus-ignorecase.sh
+++ b/t/t7062-wtstatus-ignorecase.sh
@@ -2,6 +2,7 @@
test_description='git-status with core.ignorecase=true'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'status with hash collisions' '
diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh
index c1f0d95..8929ef4 100755
--- a/t/t7063-status-untracked-cache.sh
+++ b/t/t7063-status-untracked-cache.sh
@@ -86,7 +86,7 @@ test_expect_success 'core.untrackedCache is unset' '
'
test_expect_success 'setup' '
- git init worktree &&
+ git init --template= worktree &&
cd worktree &&
mkdir done dtwo dthree &&
touch one two three done/one dtwo/two dthree/three &&
@@ -94,6 +94,7 @@ test_expect_success 'setup' '
test-tool chmtime =-300 done dtwo dthree &&
test-tool chmtime =-300 . &&
git add one two done/one &&
+ mkdir .git/info &&
: >.git/info/exclude &&
git update-index --untracked-cache &&
test_oid_cache <<-EOF
diff --git a/t/t7064-wtstatus-pv2.sh b/t/t7064-wtstatus-pv2.sh
index 20a0d2a..11884d2 100755
--- a/t/t7064-wtstatus-pv2.sh
+++ b/t/t7064-wtstatus-pv2.sh
@@ -473,6 +473,7 @@ test_expect_success 'create and add submodule, submodule appears clean (A. S...)
git checkout initial-branch &&
git clone . sub_repo &&
git clone . super_repo &&
+ test_config_global protocol.file.allow always &&
( cd super_repo &&
git submodule add ../sub_repo sub1 &&
diff --git a/t/t7101-reset-empty-subdirs.sh b/t/t7101-reset-empty-subdirs.sh
index 638bb04..89cf98b 100755
--- a/t/t7101-reset-empty-subdirs.sh
+++ b/t/t7101-reset-empty-subdirs.sh
@@ -10,57 +10,57 @@ TEST_PASSES_SANITIZE_LEAK=true
. "$TEST_DIRECTORY"/lib-diff-data.sh
test_expect_success 'creating initial files' '
- mkdir path0 &&
- COPYING_test_data >path0/COPYING &&
- git add path0/COPYING &&
- git commit -m add -a
+ mkdir path0 &&
+ COPYING_test_data >path0/COPYING &&
+ git add path0/COPYING &&
+ git commit -m add -a
'
test_expect_success 'creating second files' '
- mkdir path1 &&
- mkdir path1/path2 &&
- COPYING_test_data >path1/path2/COPYING &&
- COPYING_test_data >path1/COPYING &&
- COPYING_test_data >COPYING &&
- COPYING_test_data >path0/COPYING-TOO &&
- git add path1/path2/COPYING &&
- git add path1/COPYING &&
- git add COPYING &&
- git add path0/COPYING-TOO &&
- git commit -m change -a
+ mkdir path1 &&
+ mkdir path1/path2 &&
+ COPYING_test_data >path1/path2/COPYING &&
+ COPYING_test_data >path1/COPYING &&
+ COPYING_test_data >COPYING &&
+ COPYING_test_data >path0/COPYING-TOO &&
+ git add path1/path2/COPYING &&
+ git add path1/COPYING &&
+ git add COPYING &&
+ git add path0/COPYING-TOO &&
+ git commit -m change -a
'
test_expect_success 'resetting tree HEAD^' '
- git reset --hard HEAD^
+ git reset --hard HEAD^
'
test_expect_success 'checking initial files exist after rewind' '
- test -d path0 &&
- test -f path0/COPYING
+ test -d path0 &&
+ test -f path0/COPYING
'
test_expect_success 'checking lack of path1/path2/COPYING' '
- ! test -f path1/path2/COPYING
+ ! test -f path1/path2/COPYING
'
test_expect_success 'checking lack of path1/COPYING' '
- ! test -f path1/COPYING
+ ! test -f path1/COPYING
'
test_expect_success 'checking lack of COPYING' '
- ! test -f COPYING
+ ! test -f COPYING
'
test_expect_success 'checking checking lack of path1/COPYING-TOO' '
- ! test -f path0/COPYING-TOO
+ ! test -f path0/COPYING-TOO
'
test_expect_success 'checking lack of path1/path2' '
- ! test -d path1/path2
+ ! test -d path1/path2
'
test_expect_success 'checking lack of path1' '
- ! test -d path1
+ ! test -d path1
'
test_done
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
index 22477f3..62d9f84 100755
--- a/t/t7102-reset.sh
+++ b/t/t7102-reset.sh
@@ -71,6 +71,16 @@ check_changes () {
done | test_cmp .cat_expect -
}
+# no negated form for various type of resets
+for opt in soft mixed hard merge keep
+do
+ test_expect_success "no 'git reset --no-$opt'" '
+ test_when_finished "rm -f err" &&
+ test_must_fail git reset --no-$opt 2>err &&
+ grep "error: unknown option .no-$opt." err
+ '
+done
+
test_expect_success 'reset --hard message' '
hex=$(git log -1 --format="%h") &&
git reset --hard >.actual &&
@@ -606,4 +616,12 @@ test_expect_success 'reset --mixed sets up work tree' '
test_must_be_empty actual
'
+test_expect_success 'reset handles --end-of-options' '
+ git update-ref refs/heads/--foo HEAD^ &&
+ git log -1 --format=%s refs/heads/--foo >expect &&
+ git reset --hard --end-of-options --foo &&
+ git log -1 --format=%s HEAD >actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t7103-reset-bare.sh b/t/t7103-reset-bare.sh
index a60153f..18bbd99 100755
--- a/t/t7103-reset-bare.sh
+++ b/t/t7103-reset-bare.sh
@@ -63,7 +63,7 @@ test_expect_success '"mixed" reset is not allowed in bare' '
test_must_fail git reset --mixed HEAD^
'
-test_expect_success !SANITIZE_LEAK '"soft" reset is allowed in bare' '
+test_expect_success '"soft" reset is allowed in bare' '
git reset --soft HEAD^ &&
git show --pretty=format:%s >out &&
echo one >expect &&
diff --git a/t/t7105-reset-patch.sh b/t/t7105-reset-patch.sh
index fc2a6cf..f4f3b7a 100755
--- a/t/t7105-reset-patch.sh
+++ b/t/t7105-reset-patch.sh
@@ -1,9 +1,11 @@
#!/bin/sh
test_description='git reset --patch'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./lib-patch-mode.sh
-test_expect_success PERL 'setup' '
+test_expect_success 'setup' '
mkdir dir &&
echo parent > dir/foo &&
echo dummy > bar &&
@@ -17,42 +19,46 @@ test_expect_success PERL 'setup' '
# note: bar sorts before foo, so the first 'n' is always to skip 'bar'
-test_expect_success PERL 'saying "n" does nothing' '
+test_expect_success 'saying "n" does nothing' '
set_and_save_state dir/foo work work &&
test_write_lines n n | git reset -p &&
verify_saved_state dir/foo &&
verify_saved_state bar
'
-test_expect_success PERL 'git reset -p' '
- test_write_lines n y | git reset -p >output &&
- verify_state dir/foo work head &&
- verify_saved_state bar &&
- test_i18ngrep "Unstage" output
-'
-
-test_expect_success PERL 'git reset -p HEAD^' '
+for opt in "HEAD" "@" ""
+do
+ test_expect_success "git reset -p $opt" '
+ set_and_save_state dir/foo work work &&
+ test_write_lines n y | git reset -p $opt >output &&
+ verify_state dir/foo work head &&
+ verify_saved_state bar &&
+ test_grep "Unstage" output
+ '
+done
+
+test_expect_success 'git reset -p HEAD^' '
test_write_lines n y | git reset -p HEAD^ >output &&
verify_state dir/foo work parent &&
verify_saved_state bar &&
- test_i18ngrep "Apply" output
+ test_grep "Apply" output
'
-test_expect_success PERL 'git reset -p HEAD^^{tree}' '
+test_expect_success 'git reset -p HEAD^^{tree}' '
test_write_lines n y | git reset -p HEAD^^{tree} >output &&
verify_state dir/foo work parent &&
verify_saved_state bar &&
- test_i18ngrep "Apply" output
+ test_grep "Apply" output
'
-test_expect_success PERL 'git reset -p HEAD^:dir/foo (blob fails)' '
+test_expect_success 'git reset -p HEAD^:dir/foo (blob fails)' '
set_and_save_state dir/foo work work &&
test_must_fail git reset -p HEAD^:dir/foo &&
verify_saved_state dir/foo &&
verify_saved_state bar
'
-test_expect_success PERL 'git reset -p aaaaaaaa (unknown fails)' '
+test_expect_success 'git reset -p aaaaaaaa (unknown fails)' '
set_and_save_state dir/foo work work &&
test_must_fail git reset -p aaaaaaaa &&
verify_saved_state dir/foo &&
@@ -64,27 +70,27 @@ test_expect_success PERL 'git reset -p aaaaaaaa (unknown fails)' '
# dir/foo. There's always an extra 'n' to reject edits to dir/foo in
# the failure case (and thus get out of the loop).
-test_expect_success PERL 'git reset -p dir' '
+test_expect_success 'git reset -p dir' '
set_state dir/foo work work &&
test_write_lines y n | git reset -p dir &&
verify_state dir/foo work head &&
verify_saved_state bar
'
-test_expect_success PERL 'git reset -p -- foo (inside dir)' '
+test_expect_success 'git reset -p -- foo (inside dir)' '
set_state dir/foo work work &&
test_write_lines y n | (cd dir && git reset -p -- foo) &&
verify_state dir/foo work head &&
verify_saved_state bar
'
-test_expect_success PERL 'git reset -p HEAD^ -- dir' '
+test_expect_success 'git reset -p HEAD^ -- dir' '
test_write_lines y n | git reset -p HEAD^ -- dir &&
verify_state dir/foo work parent &&
verify_saved_state bar
'
-test_expect_success PERL 'none of this moved HEAD' '
+test_expect_success 'none of this moved HEAD' '
verify_saved_head
'
diff --git a/t/t7106-reset-unborn-branch.sh b/t/t7106-reset-unborn-branch.sh
index ecb85c3..88d1c8a 100755
--- a/t/t7106-reset-unborn-branch.sh
+++ b/t/t7106-reset-unborn-branch.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='git reset should work on unborn branch'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -32,7 +34,7 @@ test_expect_success 'reset $file' '
test_cmp expect actual
'
-test_expect_success PERL 'reset -p' '
+test_expect_success 'reset -p' '
rm .git/index &&
git add a &&
echo y >yes &&
@@ -40,7 +42,7 @@ test_expect_success PERL 'reset -p' '
git ls-files >actual &&
test_must_be_empty actual &&
- test_i18ngrep "Unstage" output
+ test_grep "Unstage" output
'
test_expect_success 'reset --soft is a no-op' '
diff --git a/t/t7107-reset-pathspec-file.sh b/t/t7107-reset-pathspec-file.sh
index 523efbe..020db20 100755
--- a/t/t7107-reset-pathspec-file.sh
+++ b/t/t7107-reset-pathspec-file.sh
@@ -2,6 +2,7 @@
test_description='reset --pathspec-from-file'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_tick
@@ -160,19 +161,19 @@ test_expect_success 'error conditions' '
git rm fileA.t &&
test_must_fail git reset --pathspec-from-file=list --patch 2>err &&
- test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err &&
+ test_grep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err &&
test_must_fail git reset --pathspec-from-file=list -- fileA.t 2>err &&
- test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
+ test_grep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
test_must_fail git reset --pathspec-file-nul 2>err &&
- test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
+ test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
test_must_fail git reset --soft --pathspec-from-file=list 2>err &&
- test_i18ngrep -e "fatal: Cannot do soft reset with paths" err &&
+ test_grep -e "fatal: Cannot do soft reset with paths" err &&
test_must_fail git reset --hard --pathspec-from-file=list 2>err &&
- test_i18ngrep -e "fatal: Cannot do hard reset with paths" err
+ test_grep -e "fatal: Cannot do hard reset with paths" err
'
test_done
diff --git a/t/t7110-reset-merge.sh b/t/t7110-reset-merge.sh
index 3d62e10..7ee180f 100755
--- a/t/t7110-reset-merge.sh
+++ b/t/t7110-reset-merge.sh
@@ -5,20 +5,21 @@
test_description='Tests for "git reset" with "--merge" and "--keep" options'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
- printf "line %d\n" 1 2 3 >file1 &&
- cat file1 >file2 &&
- git add file1 file2 &&
- test_tick &&
- git commit -m "Initial commit" &&
- git tag initial &&
- echo line 4 >>file1 &&
- cat file1 >file2 &&
- test_tick &&
- git commit -m "add line 4 to file1" file1 &&
- git tag second
+ printf "line %d\n" 1 2 3 >file1 &&
+ cat file1 >file2 &&
+ git add file1 file2 &&
+ test_tick &&
+ git commit -m "Initial commit" &&
+ git tag initial &&
+ echo line 4 >>file1 &&
+ cat file1 >file2 &&
+ test_tick &&
+ git commit -m "add line 4 to file1" file1 &&
+ git tag second
'
# The next test will test the following:
@@ -28,19 +29,19 @@ test_expect_success setup '
# file1: C C C D --merge D D D
# file2: C D D D --merge C D D
test_expect_success 'reset --merge is ok with changes in file it does not touch' '
- git reset --merge HEAD^ &&
- ! grep 4 file1 &&
- grep 4 file2 &&
- test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
- test -z "$(git diff --cached)"
+ git reset --merge HEAD^ &&
+ ! grep 4 file1 &&
+ grep 4 file2 &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
+ test -z "$(git diff --cached)"
'
test_expect_success 'reset --merge is ok when switching back' '
- git reset --merge second &&
- grep 4 file1 &&
- grep 4 file2 &&
- test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
- test -z "$(git diff --cached)"
+ git reset --merge second &&
+ grep 4 file1 &&
+ grep 4 file2 &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
+ test -z "$(git diff --cached)"
'
# The next test will test the following:
@@ -50,21 +51,21 @@ test_expect_success 'reset --merge is ok when switching back' '
# file1: C C C D --keep D D D
# file2: C D D D --keep C D D
test_expect_success 'reset --keep is ok with changes in file it does not touch' '
- git reset --hard second &&
- cat file1 >file2 &&
- git reset --keep HEAD^ &&
- ! grep 4 file1 &&
- grep 4 file2 &&
- test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
- test -z "$(git diff --cached)"
+ git reset --hard second &&
+ cat file1 >file2 &&
+ git reset --keep HEAD^ &&
+ ! grep 4 file1 &&
+ grep 4 file2 &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
+ test -z "$(git diff --cached)"
'
test_expect_success 'reset --keep is ok when switching back' '
- git reset --keep second &&
- grep 4 file1 &&
- grep 4 file2 &&
- test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
- test -z "$(git diff --cached)"
+ git reset --keep second &&
+ grep 4 file1 &&
+ grep 4 file2 &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
+ test -z "$(git diff --cached)"
'
# The next test will test the following:
@@ -74,28 +75,28 @@ test_expect_success 'reset --keep is ok when switching back' '
# file1: B B C D --merge D D D
# file2: C D D D --merge C D D
test_expect_success 'reset --merge discards changes added to index (1)' '
- git reset --hard second &&
- cat file1 >file2 &&
- echo "line 5" >> file1 &&
- git add file1 &&
- git reset --merge HEAD^ &&
- ! grep 4 file1 &&
- ! grep 5 file1 &&
- grep 4 file2 &&
- test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
- test -z "$(git diff --cached)"
+ git reset --hard second &&
+ cat file1 >file2 &&
+ echo "line 5" >> file1 &&
+ git add file1 &&
+ git reset --merge HEAD^ &&
+ ! grep 4 file1 &&
+ ! grep 5 file1 &&
+ grep 4 file2 &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
+ test -z "$(git diff --cached)"
'
test_expect_success 'reset --merge is ok again when switching back (1)' '
- git reset --hard initial &&
- echo "line 5" >> file2 &&
- git add file2 &&
- git reset --merge second &&
- ! grep 4 file2 &&
- ! grep 5 file1 &&
- grep 4 file1 &&
- test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
- test -z "$(git diff --cached)"
+ git reset --hard initial &&
+ echo "line 5" >> file2 &&
+ git add file2 &&
+ git reset --merge second &&
+ ! grep 4 file2 &&
+ ! grep 5 file1 &&
+ grep 4 file1 &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
+ test -z "$(git diff --cached)"
'
# The next test will test the following:
@@ -104,10 +105,10 @@ test_expect_success 'reset --merge is ok again when switching back (1)' '
# ----------------------------------------------------
# file1: B B C D --keep (disallowed)
test_expect_success 'reset --keep fails with changes in index in files it touches' '
- git reset --hard second &&
- echo "line 5" >> file1 &&
- git add file1 &&
- test_must_fail git reset --keep HEAD^
+ git reset --hard second &&
+ echo "line 5" >> file1 &&
+ git add file1 &&
+ test_must_fail git reset --keep HEAD^
'
# The next test will test the following:
@@ -117,23 +118,23 @@ test_expect_success 'reset --keep fails with changes in index in files it touche
# file1: C C C D --merge D D D
# file2: C C D D --merge D D D
test_expect_success 'reset --merge discards changes added to index (2)' '
- git reset --hard second &&
- echo "line 4" >> file2 &&
- git add file2 &&
- git reset --merge HEAD^ &&
- ! grep 4 file2 &&
- test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
- test -z "$(git diff)" &&
- test -z "$(git diff --cached)"
+ git reset --hard second &&
+ echo "line 4" >> file2 &&
+ git add file2 &&
+ git reset --merge HEAD^ &&
+ ! grep 4 file2 &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
+ test -z "$(git diff)" &&
+ test -z "$(git diff --cached)"
'
test_expect_success 'reset --merge is ok again when switching back (2)' '
- git reset --hard initial &&
- git reset --merge second &&
- ! grep 4 file2 &&
- grep 4 file1 &&
- test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
- test -z "$(git diff --cached)"
+ git reset --hard initial &&
+ git reset --merge second &&
+ ! grep 4 file2 &&
+ grep 4 file1 &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
+ test -z "$(git diff --cached)"
'
# The next test will test the following:
@@ -143,21 +144,21 @@ test_expect_success 'reset --merge is ok again when switching back (2)' '
# file1: C C C D --keep D D D
# file2: C C D D --keep C D D
test_expect_success 'reset --keep keeps changes it does not touch' '
- git reset --hard second &&
- echo "line 4" >> file2 &&
- git add file2 &&
- git reset --keep HEAD^ &&
- grep 4 file2 &&
- test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
- test -z "$(git diff --cached)"
+ git reset --hard second &&
+ echo "line 4" >> file2 &&
+ git add file2 &&
+ git reset --keep HEAD^ &&
+ grep 4 file2 &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
+ test -z "$(git diff --cached)"
'
test_expect_success 'reset --keep keeps changes when switching back' '
- git reset --keep second &&
- grep 4 file2 &&
- grep 4 file1 &&
- test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
- test -z "$(git diff --cached)"
+ git reset --keep second &&
+ grep 4 file2 &&
+ grep 4 file1 &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
+ test -z "$(git diff --cached)"
'
# The next test will test the following:
@@ -166,14 +167,14 @@ test_expect_success 'reset --keep keeps changes when switching back' '
# ----------------------------------------------------
# file1: A B B C --merge (disallowed)
test_expect_success 'reset --merge fails with changes in file it touches' '
- git reset --hard second &&
- echo "line 5" >> file1 &&
- test_tick &&
- git commit -m "add line 5" file1 &&
- sed -e "s/line 1/changed line 1/" <file1 >file3 &&
- mv file3 file1 &&
- test_must_fail git reset --merge HEAD^ 2>err.log &&
- grep file1 err.log | grep "not uptodate"
+ git reset --hard second &&
+ echo "line 5" >> file1 &&
+ test_tick &&
+ git commit -m "add line 5" file1 &&
+ sed -e "s/line 1/changed line 1/" <file1 >file3 &&
+ mv file3 file1 &&
+ test_must_fail git reset --merge HEAD^ 2>err.log &&
+ grep file1 err.log | grep "not uptodate"
'
# The next test will test the following:
@@ -182,36 +183,36 @@ test_expect_success 'reset --merge fails with changes in file it touches' '
# ----------------------------------------------------
# file1: A B B C --keep (disallowed)
test_expect_success 'reset --keep fails with changes in file it touches' '
- git reset --hard second &&
- echo "line 5" >> file1 &&
- test_tick &&
- git commit -m "add line 5" file1 &&
- sed -e "s/line 1/changed line 1/" <file1 >file3 &&
- mv file3 file1 &&
- test_must_fail git reset --keep HEAD^ 2>err.log &&
- grep file1 err.log | grep "not uptodate"
+ git reset --hard second &&
+ echo "line 5" >> file1 &&
+ test_tick &&
+ git commit -m "add line 5" file1 &&
+ sed -e "s/line 1/changed line 1/" <file1 >file3 &&
+ mv file3 file1 &&
+ test_must_fail git reset --keep HEAD^ 2>err.log &&
+ grep file1 err.log | grep "not uptodate"
'
test_expect_success 'setup 3 different branches' '
- git reset --hard second &&
- git branch branch1 &&
- git branch branch2 &&
- git branch branch3 &&
- git checkout branch1 &&
- echo "line 5 in branch1" >> file1 &&
- test_tick &&
- git commit -a -m "change in branch1" &&
- git checkout branch2 &&
- echo "line 5 in branch2" >> file1 &&
- test_tick &&
- git commit -a -m "change in branch2" &&
- git tag third &&
- git checkout branch3 &&
- echo a new file >file3 &&
- rm -f file1 &&
- git add file3 &&
- test_tick &&
- git commit -a -m "change in branch3"
+ git reset --hard second &&
+ git branch branch1 &&
+ git branch branch2 &&
+ git branch branch3 &&
+ git checkout branch1 &&
+ echo "line 5 in branch1" >> file1 &&
+ test_tick &&
+ git commit -a -m "change in branch1" &&
+ git checkout branch2 &&
+ echo "line 5 in branch2" >> file1 &&
+ test_tick &&
+ git commit -a -m "change in branch2" &&
+ git tag third &&
+ git checkout branch3 &&
+ echo a new file >file3 &&
+ rm -f file1 &&
+ git add file3 &&
+ test_tick &&
+ git commit -a -m "change in branch3"
'
# The next test will test the following:
@@ -220,12 +221,12 @@ test_expect_success 'setup 3 different branches' '
# ----------------------------------------------------
# file1: X U B C --merge C C C
test_expect_success '"reset --merge HEAD^" is ok with pending merge' '
- git checkout third &&
- test_must_fail git merge branch1 &&
- git reset --merge HEAD^ &&
- test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
- test -z "$(git diff --cached)" &&
- test -z "$(git diff)"
+ git checkout third &&
+ test_must_fail git merge branch1 &&
+ git reset --merge HEAD^ &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
+ test -z "$(git diff --cached)" &&
+ test -z "$(git diff)"
'
# The next test will test the following:
@@ -234,10 +235,10 @@ test_expect_success '"reset --merge HEAD^" is ok with pending merge' '
# ----------------------------------------------------
# file1: X U B C --keep (disallowed)
test_expect_success '"reset --keep HEAD^" fails with pending merge' '
- git reset --hard third &&
- test_must_fail git merge branch1 &&
- test_must_fail git reset --keep HEAD^ 2>err.log &&
- test_i18ngrep "middle of a merge" err.log
+ git reset --hard third &&
+ test_must_fail git merge branch1 &&
+ test_must_fail git reset --keep HEAD^ 2>err.log &&
+ test_grep "middle of a merge" err.log
'
# The next test will test the following:
@@ -246,12 +247,12 @@ test_expect_success '"reset --keep HEAD^" fails with pending merge' '
# ----------------------------------------------------
# file1: X U B B --merge B B B
test_expect_success '"reset --merge HEAD" is ok with pending merge' '
- git reset --hard third &&
- test_must_fail git merge branch1 &&
- git reset --merge HEAD &&
- test "$(git rev-parse HEAD)" = "$(git rev-parse third)" &&
- test -z "$(git diff --cached)" &&
- test -z "$(git diff)"
+ git reset --hard third &&
+ test_must_fail git merge branch1 &&
+ git reset --merge HEAD &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse third)" &&
+ test -z "$(git diff --cached)" &&
+ test -z "$(git diff)"
'
# The next test will test the following:
@@ -260,36 +261,36 @@ test_expect_success '"reset --merge HEAD" is ok with pending merge' '
# ----------------------------------------------------
# file1: X U B B --keep (disallowed)
test_expect_success '"reset --keep HEAD" fails with pending merge' '
- git reset --hard third &&
- test_must_fail git merge branch1 &&
- test_must_fail git reset --keep HEAD 2>err.log &&
- test_i18ngrep "middle of a merge" err.log
+ git reset --hard third &&
+ test_must_fail git merge branch1 &&
+ test_must_fail git reset --keep HEAD 2>err.log &&
+ test_grep "middle of a merge" err.log
'
test_expect_success '--merge is ok with added/deleted merge' '
- git reset --hard third &&
- rm -f file2 &&
- test_must_fail git merge branch3 &&
- ! test -f file2 &&
- test -f file3 &&
- git diff --exit-code file3 &&
- git diff --exit-code branch3 file3 &&
- git reset --merge HEAD &&
- ! test -f file3 &&
- ! test -f file2 &&
- git diff --exit-code --cached
+ git reset --hard third &&
+ rm -f file2 &&
+ test_must_fail git merge branch3 &&
+ ! test -f file2 &&
+ test -f file3 &&
+ git diff --exit-code file3 &&
+ git diff --exit-code branch3 file3 &&
+ git reset --merge HEAD &&
+ ! test -f file3 &&
+ ! test -f file2 &&
+ git diff --exit-code --cached
'
test_expect_success '--keep fails with added/deleted merge' '
- git reset --hard third &&
- rm -f file2 &&
- test_must_fail git merge branch3 &&
- ! test -f file2 &&
- test -f file3 &&
- git diff --exit-code file3 &&
- git diff --exit-code branch3 file3 &&
- test_must_fail git reset --keep HEAD 2>err.log &&
- test_i18ngrep "middle of a merge" err.log
+ git reset --hard third &&
+ rm -f file2 &&
+ test_must_fail git merge branch3 &&
+ ! test -f file2 &&
+ test -f file3 &&
+ git diff --exit-code file3 &&
+ git diff --exit-code branch3 file3 &&
+ test_must_fail git reset --keep HEAD 2>err.log &&
+ test_grep "middle of a merge" err.log
'
test_done
diff --git a/t/t7111-reset-table.sh b/t/t7111-reset-table.sh
index ce421ad..01b7c35 100755
--- a/t/t7111-reset-table.sh
+++ b/t/t7111-reset-table.sh
@@ -5,13 +5,14 @@
test_description='Tests to check that "reset" options follow a known table'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'creating initial commits' '
- test_commit E file1 &&
- test_commit D file1 &&
- test_commit C file1
+ test_commit E file1 &&
+ test_commit D file1 &&
+ test_commit C file1
'
while read W1 I1 H1 T opt W2 I2 H2
@@ -73,13 +74,13 @@ B C C C keep B C C
EOF
test_expect_success 'setting up branches to test with unmerged entries' '
- git reset --hard C &&
- git branch branch1 &&
- git branch branch2 &&
- git checkout branch1 &&
- test_commit B1 file1 &&
- git checkout branch2 &&
- test_commit B file1
+ git reset --hard C &&
+ git branch branch1 &&
+ git branch branch2 &&
+ git checkout branch1 &&
+ test_commit B1 file1 &&
+ git checkout branch2 &&
+ test_commit B file1
'
while read W1 I1 H1 T opt W2 I2 H2
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 61ad47b..42352dc 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -217,7 +217,7 @@ test_expect_success 'switch to another branch while carrying a deletion' '
git rm two &&
test_must_fail git checkout simple 2>errs &&
- test_i18ngrep overwritten errs &&
+ test_grep overwritten errs &&
test_must_fail git read-tree --quiet -m -u HEAD simple 2>errs &&
test_must_be_empty errs
@@ -229,7 +229,7 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '
git checkout -f renamer &&
git clean -f &&
git checkout renamer^ 2>messages &&
- test_i18ngrep "HEAD is now at $rev" messages &&
+ test_grep "HEAD is now at $rev" messages &&
test_line_count = 1 messages &&
H=$(git rev-parse --verify HEAD) &&
M=$(git show-ref -s --verify refs/heads/main) &&
@@ -372,75 +372,75 @@ test_expect_success 'checkout specific path while in subdirectory' '
'
test_expect_success 'checkout w/--track sets up tracking' '
- git config branch.autosetupmerge false &&
- git checkout main &&
- git checkout --track -b track1 &&
- test "$(git config branch.track1.remote)" &&
- test "$(git config branch.track1.merge)"
+ git config branch.autosetupmerge false &&
+ git checkout main &&
+ git checkout --track -b track1 &&
+ test "$(git config branch.track1.remote)" &&
+ test "$(git config branch.track1.merge)"
'
test_expect_success 'checkout w/autosetupmerge=always sets up tracking' '
- test_when_finished git config branch.autosetupmerge false &&
- git config branch.autosetupmerge always &&
- git checkout main &&
- git checkout -b track2 &&
- test "$(git config branch.track2.remote)" &&
- test "$(git config branch.track2.merge)"
+ test_when_finished git config branch.autosetupmerge false &&
+ git config branch.autosetupmerge always &&
+ git checkout main &&
+ git checkout -b track2 &&
+ test "$(git config branch.track2.remote)" &&
+ test "$(git config branch.track2.merge)"
'
test_expect_success 'checkout w/--track from non-branch HEAD fails' '
- git checkout main^0 &&
- test_must_fail git symbolic-ref HEAD &&
- test_must_fail git checkout --track -b track &&
- test_must_fail git rev-parse --verify track &&
- test_must_fail git symbolic-ref HEAD &&
- test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
+ git checkout main^0 &&
+ test_must_fail git symbolic-ref HEAD &&
+ test_must_fail git checkout --track -b track &&
+ test_must_fail git rev-parse --verify track &&
+ test_must_fail git symbolic-ref HEAD &&
+ test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
'
test_expect_success 'checkout w/--track from tag fails' '
- git checkout main^0 &&
- test_must_fail git symbolic-ref HEAD &&
- test_must_fail git checkout --track -b track frotz &&
- test_must_fail git rev-parse --verify track &&
- test_must_fail git symbolic-ref HEAD &&
- test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
+ git checkout main^0 &&
+ test_must_fail git symbolic-ref HEAD &&
+ test_must_fail git checkout --track -b track frotz &&
+ test_must_fail git rev-parse --verify track &&
+ test_must_fail git symbolic-ref HEAD &&
+ test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
'
test_expect_success 'detach a symbolic link HEAD' '
- git checkout main &&
- git config --bool core.prefersymlinkrefs yes &&
- git checkout side &&
- git checkout main &&
- it=$(git symbolic-ref HEAD) &&
- test "z$it" = zrefs/heads/main &&
- here=$(git rev-parse --verify refs/heads/main) &&
- git checkout side^ &&
- test "z$(git rev-parse --verify refs/heads/main)" = "z$here"
+ git checkout main &&
+ git config --bool core.prefersymlinkrefs yes &&
+ git checkout side &&
+ git checkout main &&
+ it=$(git symbolic-ref HEAD) &&
+ test "z$it" = zrefs/heads/main &&
+ here=$(git rev-parse --verify refs/heads/main) &&
+ git checkout side^ &&
+ test "z$(git rev-parse --verify refs/heads/main)" = "z$here"
'
test_expect_success 'checkout with --track fakes a sensible -b <name>' '
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" &&
- git update-ref refs/remotes/origin/koala/bear renamer &&
+ git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" &&
+ git update-ref refs/remotes/origin/koala/bear renamer &&
- git checkout --track origin/koala/bear &&
- test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
- test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
+ git checkout --track origin/koala/bear &&
+ test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
- git checkout main && git branch -D koala/bear &&
+ git checkout main && git branch -D koala/bear &&
- git checkout --track refs/remotes/origin/koala/bear &&
- test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
- test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
+ git checkout --track refs/remotes/origin/koala/bear &&
+ test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
- git checkout main && git branch -D koala/bear &&
+ git checkout main && git branch -D koala/bear &&
- git checkout --track remotes/origin/koala/bear &&
- test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
- test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)"
+ git checkout --track remotes/origin/koala/bear &&
+ test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)"
'
test_expect_success 'checkout with --track, but without -b, fails with too short tracked name' '
- test_must_fail git checkout --track renamer
+ test_must_fail git checkout --track renamer
'
setup_conflicting_index () {
@@ -497,6 +497,11 @@ test_expect_success 'checkout unmerged stage' '
test ztheirside = "z$(cat file)"
'
+test_expect_success 'checkout path with --merge from tree-ish is a no-no' '
+ setup_conflicting_index &&
+ test_must_fail git checkout -m HEAD -- file
+'
+
test_expect_success 'checkout with --merge' '
setup_conflicting_index &&
echo "none of the above" >sample &&
@@ -517,6 +522,48 @@ test_expect_success 'checkout with --merge' '
test_cmp merged file
'
+test_expect_success 'checkout -m works after (mistaken) resolution' '
+ setup_conflicting_index &&
+ echo "none of the above" >sample &&
+ cat sample >fild &&
+ cat sample >file &&
+ cat sample >filf &&
+ # resolve to something
+ git add file &&
+ git checkout --merge -- fild file filf &&
+ {
+ echo "<<<<<<< ours" &&
+ echo ourside &&
+ echo "=======" &&
+ echo theirside &&
+ echo ">>>>>>> theirs"
+ } >merged &&
+ test_cmp expect fild &&
+ test_cmp expect filf &&
+ test_cmp merged file
+'
+
+test_expect_success 'checkout -m works after (mistaken) resolution to remove' '
+ setup_conflicting_index &&
+ echo "none of the above" >sample &&
+ cat sample >fild &&
+ cat sample >file &&
+ cat sample >filf &&
+ # resolve to remove
+ git rm file &&
+ git checkout --merge -- fild file filf &&
+ {
+ echo "<<<<<<< ours" &&
+ echo ourside &&
+ echo "=======" &&
+ echo theirside &&
+ echo ">>>>>>> theirs"
+ } >merged &&
+ test_cmp expect fild &&
+ test_cmp expect filf &&
+ test_cmp merged file
+'
+
test_expect_success 'checkout with --merge, in diff3 -m style' '
git config merge.conflictstyle diff3 &&
setup_conflicting_index &&
@@ -584,6 +631,72 @@ test_expect_success 'checkout --conflict=diff3' '
test_cmp merged file
'
+test_expect_success 'checkout --conflict=diff3 --no-conflict does not merge' '
+ setup_conflicting_index &&
+ echo "none of the above" >expect &&
+ cat expect >fild &&
+ cat expect >file &&
+ test_must_fail git checkout --conflict=diff3 --no-conflict -- fild file 2>err &&
+ test_cmp expect file &&
+ test_cmp expect fild &&
+ echo "error: path ${SQ}file${SQ} is unmerged" >expect &&
+ test_cmp expect err
+'
+
+test_expect_success 'checkout --conflict=diff3 --no-merge does not merge' '
+ setup_conflicting_index &&
+ echo "none of the above" >expect &&
+ cat expect >fild &&
+ cat expect >file &&
+ test_must_fail git checkout --conflict=diff3 --no-merge -- fild file 2>err &&
+ test_cmp expect file &&
+ test_cmp expect fild &&
+ echo "error: path ${SQ}file${SQ} is unmerged" >expect &&
+ test_cmp expect err
+'
+
+test_expect_success 'checkout --no-merge --conflict=diff3 does merge' '
+ setup_conflicting_index &&
+ echo "none of the above" >fild &&
+ echo "none of the above" >file &&
+ git checkout --no-merge --conflict=diff3 -- fild file &&
+ echo "ourside" >expect &&
+ test_cmp expect fild &&
+ cat >expect <<-\EOF &&
+ <<<<<<< ours
+ ourside
+ ||||||| base
+ original
+ =======
+ theirside
+ >>>>>>> theirs
+ EOF
+ test_cmp expect file
+'
+
+test_expect_success 'checkout --merge --conflict=diff3 --no-conflict does merge' '
+ setup_conflicting_index &&
+ echo "none of the above" >fild &&
+ echo "none of the above" >file &&
+ git checkout --merge --conflict=diff3 --no-conflict -- fild file &&
+ echo "ourside" >expect &&
+ test_cmp expect fild &&
+ cat >expect <<-\EOF &&
+ <<<<<<< ours
+ ourside
+ =======
+ theirside
+ >>>>>>> theirs
+ EOF
+ test_cmp expect file
+'
+
+test_expect_success 'checkout with invalid conflict style' '
+ test_must_fail git checkout --conflict=bad 2>actual -- file &&
+ echo "error: unknown conflict style ${SQ}bad${SQ}" >expect &&
+ test_cmp expect actual
+'
+
test_expect_success 'failing checkout -b should not break working tree' '
git clean -fd && # Remove untracked files in the way
git reset --hard main &&
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index 0399701..0aae0de 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -5,6 +5,7 @@
test_description='git clean basic tests'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
git config clean.requireForce no
@@ -120,7 +121,7 @@ test_expect_success 'git clean with relative prefix' '
grep part3 |
sed -n -e "s|^Would remove ||p"
) &&
- verbose test "$would_clean" = ../src/part3.c
+ test "$would_clean" = ../src/part3.c
'
test_expect_success 'git clean with absolute path' '
@@ -133,7 +134,7 @@ test_expect_success 'git clean with absolute path' '
grep part3 |
sed -n -e "s|^Would remove ||p"
) &&
- verbose test "$would_clean" = ../src/part3.c
+ test "$would_clean" = ../src/part3.c
'
test_expect_success 'git clean with out of work tree relative path' '
@@ -407,6 +408,12 @@ test_expect_success 'clean.requireForce and -f' '
'
+test_expect_success 'clean.requireForce and --interactive' '
+ git clean --interactive </dev/null >output 2>error &&
+ test_grep ! "requireForce is true and" error &&
+ test_grep "\*\*\* Commands \*\*\*" output
+'
+
test_expect_success 'core.excludesfile' '
echo excludes >excludes &&
@@ -480,6 +487,7 @@ test_expect_success 'should not clean submodules' '
git init &&
test_commit msg hello.world
) &&
+ test_config_global protocol.file.allow always &&
git submodule add ./repo/.git sub1 &&
git commit -m "sub1" &&
git branch before_sub2 &&
@@ -516,8 +524,12 @@ test_expect_success 'nested (empty) git should be kept' '
git init empty_repo &&
mkdir to_clean &&
>to_clean/should_clean.this &&
+ # Note that we put the expect file in the .git directory so that it
+ # does not get cleaned.
+ find empty_repo | sort >.git/expect &&
git clean -f -d &&
- test_path_is_file empty_repo/.git/HEAD &&
+ find empty_repo | sort >actual &&
+ test_cmp .git/expect actual &&
test_path_is_missing to_clean
'
@@ -558,10 +570,10 @@ test_expect_success 'giving path in nested git work tree will NOT remove it' '
mkdir -p bar/baz &&
test_commit msg bar/baz/hello.world
) &&
+ find repo | sort >expect &&
git clean -f -d repo/bar/baz &&
- test_path_is_file repo/.git/HEAD &&
- test_path_is_dir repo/bar/ &&
- test_path_is_file repo/bar/baz/hello.world
+ find repo | sort >actual &&
+ test_cmp expect actual
'
test_expect_success 'giving path to nested .git will not remove it' '
@@ -572,10 +584,10 @@ test_expect_success 'giving path to nested .git will not remove it' '
git init &&
test_commit msg hello.world
) &&
+ find repo | sort >expect &&
git clean -f -d repo/.git &&
- test_path_is_file repo/.git/HEAD &&
- test_path_is_dir repo/.git/refs &&
- test_path_is_dir repo/.git/objects &&
+ find repo | sort >actual &&
+ test_cmp expect actual &&
test_path_is_dir untracked/
'
@@ -587,9 +599,10 @@ test_expect_success 'giving path to nested .git/ will NOT remove contents' '
git init &&
test_commit msg hello.world
) &&
+ find repo | sort >expect &&
git clean -f -d repo/.git/ &&
- test_path_is_dir repo/.git &&
- test_path_is_file repo/.git/HEAD &&
+ find repo | sort >actual &&
+ test_cmp expect actual &&
test_path_is_dir untracked/
'
@@ -734,7 +747,7 @@ test_expect_success MINGW 'handle clean & core.longpaths = false nicely' '
test_must_fail git clean -xdf 2>.git/err &&
# grepping for a strerror string is unportable but it is OK here with
# MINGW prereq
- test_i18ngrep "too long" .git/err
+ test_grep "too long" .git/err
'
test_expect_success 'clean untracked paths by pathspec' '
diff --git a/t/t7301-clean-interactive.sh b/t/t7301-clean-interactive.sh
index a07e8b8..4afe53c 100755
--- a/t/t7301-clean-interactive.sh
+++ b/t/t7301-clean-interactive.sh
@@ -2,6 +2,7 @@
test_description='git clean -i basic tests'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-terminal.sh
@@ -24,18 +25,18 @@ test_expect_success 'git clean -i (c: clean hotkey)' '
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so &&
echo c | git clean -i &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test ! -f a.out &&
- test -f docs/manual.txt &&
- test ! -f src/part3.c &&
- test ! -f src/part3.h &&
- test ! -f src/part4.c &&
- test ! -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_missing a.out &&
+ test_path_is_file docs/manual.txt &&
+ test_path_is_missing src/part3.c &&
+ test_path_is_missing src/part3.h &&
+ test_path_is_missing src/part4.c &&
+ test_path_is_missing src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -45,18 +46,18 @@ test_expect_success 'git clean -i (cl: clean prefix)' '
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so &&
echo cl | git clean -i &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test ! -f a.out &&
- test -f docs/manual.txt &&
- test ! -f src/part3.c &&
- test ! -f src/part3.h &&
- test ! -f src/part4.c &&
- test ! -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_missing a.out &&
+ test_path_is_file docs/manual.txt &&
+ test_path_is_missing src/part3.c &&
+ test_path_is_missing src/part3.h &&
+ test_path_is_missing src/part4.c &&
+ test_path_is_missing src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -66,18 +67,18 @@ test_expect_success 'git clean -i (quit)' '
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so &&
echo quit | git clean -i &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test -f a.out &&
- test -f docs/manual.txt &&
- test -f src/part3.c &&
- test -f src/part3.h &&
- test -f src/part4.c &&
- test -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_file a.out &&
+ test_path_is_file docs/manual.txt &&
+ test_path_is_file src/part3.c &&
+ test_path_is_file src/part3.h &&
+ test_path_is_file src/part4.c &&
+ test_path_is_file src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -87,18 +88,18 @@ test_expect_success 'git clean -i (Ctrl+D)' '
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so &&
echo "\04" | git clean -i &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test -f a.out &&
- test -f docs/manual.txt &&
- test -f src/part3.c &&
- test -f src/part3.h &&
- test -f src/part4.c &&
- test -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_file a.out &&
+ test_path_is_file docs/manual.txt &&
+ test_path_is_file src/part3.c &&
+ test_path_is_file src/part3.h &&
+ test_path_is_file src/part4.c &&
+ test_path_is_file src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -109,18 +110,18 @@ test_expect_success 'git clean -id (filter all)' '
docs/manual.txt obj.o build/lib.so &&
test_write_lines f "*" "" c |
git clean -id &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test -f a.out &&
- test -f docs/manual.txt &&
- test -f src/part3.c &&
- test -f src/part3.h &&
- test -f src/part4.c &&
- test -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_file a.out &&
+ test_path_is_file docs/manual.txt &&
+ test_path_is_file src/part3.c &&
+ test_path_is_file src/part3.h &&
+ test_path_is_file src/part4.c &&
+ test_path_is_file src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -131,18 +132,18 @@ test_expect_success 'git clean -id (filter patterns)' '
docs/manual.txt obj.o build/lib.so &&
test_write_lines f "part3.* *.out" "" c |
git clean -id &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test -f a.out &&
- test ! -f docs/manual.txt &&
- test -f src/part3.c &&
- test -f src/part3.h &&
- test ! -f src/part4.c &&
- test ! -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_file a.out &&
+ test_path_is_missing docs/manual.txt &&
+ test_path_is_file src/part3.c &&
+ test_path_is_file src/part3.h &&
+ test_path_is_missing src/part4.c &&
+ test_path_is_missing src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -153,18 +154,18 @@ test_expect_success 'git clean -id (filter patterns 2)' '
docs/manual.txt obj.o build/lib.so &&
test_write_lines f "* !*.out" "" c |
git clean -id &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test ! -f a.out &&
- test -f docs/manual.txt &&
- test -f src/part3.c &&
- test -f src/part3.h &&
- test -f src/part4.c &&
- test -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_missing a.out &&
+ test_path_is_file docs/manual.txt &&
+ test_path_is_file src/part3.c &&
+ test_path_is_file src/part3.h &&
+ test_path_is_file src/part4.c &&
+ test_path_is_file src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -175,18 +176,18 @@ test_expect_success 'git clean -id (select - all)' '
docs/manual.txt obj.o build/lib.so &&
test_write_lines s "*" "" c |
git clean -id &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test ! -f a.out &&
- test ! -f docs/manual.txt &&
- test ! -f src/part3.c &&
- test ! -f src/part3.h &&
- test ! -f src/part4.c &&
- test ! -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_missing a.out &&
+ test_path_is_missing docs/manual.txt &&
+ test_path_is_missing src/part3.c &&
+ test_path_is_missing src/part3.h &&
+ test_path_is_missing src/part4.c &&
+ test_path_is_missing src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -197,18 +198,18 @@ test_expect_success 'git clean -id (select - none)' '
docs/manual.txt obj.o build/lib.so &&
test_write_lines s "" c |
git clean -id &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test -f a.out &&
- test -f docs/manual.txt &&
- test -f src/part3.c &&
- test -f src/part3.h &&
- test -f src/part4.c &&
- test -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_file a.out &&
+ test_path_is_file docs/manual.txt &&
+ test_path_is_file src/part3.c &&
+ test_path_is_file src/part3.h &&
+ test_path_is_file src/part4.c &&
+ test_path_is_file src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -219,18 +220,18 @@ test_expect_success 'git clean -id (select - number)' '
docs/manual.txt obj.o build/lib.so &&
test_write_lines s 3 "" c |
git clean -id &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test -f a.out &&
- test -f docs/manual.txt &&
- test ! -f src/part3.c &&
- test -f src/part3.h &&
- test -f src/part4.c &&
- test -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_file a.out &&
+ test_path_is_file docs/manual.txt &&
+ test_path_is_missing src/part3.c &&
+ test_path_is_file src/part3.h &&
+ test_path_is_file src/part4.c &&
+ test_path_is_file src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -241,18 +242,18 @@ test_expect_success 'git clean -id (select - number 2)' '
docs/manual.txt obj.o build/lib.so &&
test_write_lines s "2 3" 5 "" c |
git clean -id &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test -f a.out &&
- test ! -f docs/manual.txt &&
- test ! -f src/part3.c &&
- test -f src/part3.h &&
- test ! -f src/part4.c &&
- test -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_file a.out &&
+ test_path_is_missing docs/manual.txt &&
+ test_path_is_missing src/part3.c &&
+ test_path_is_file src/part3.h &&
+ test_path_is_missing src/part4.c &&
+ test_path_is_file src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -263,18 +264,18 @@ test_expect_success 'git clean -id (select - number 3)' '
docs/manual.txt obj.o build/lib.so &&
test_write_lines s "3,4 5" "" c |
git clean -id &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test -f a.out &&
- test -f docs/manual.txt &&
- test ! -f src/part3.c &&
- test ! -f src/part3.h &&
- test ! -f src/part4.c &&
- test -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_file a.out &&
+ test_path_is_file docs/manual.txt &&
+ test_path_is_missing src/part3.c &&
+ test_path_is_missing src/part3.h &&
+ test_path_is_missing src/part4.c &&
+ test_path_is_file src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -284,11 +285,11 @@ test_expect_success 'git clean -id (select - filenames)' '
touch a.out foo.txt bar.txt baz.txt &&
test_write_lines s "a.out fo ba bar" "" c |
git clean -id &&
- test -f Makefile &&
- test ! -f a.out &&
- test ! -f foo.txt &&
- test ! -f bar.txt &&
- test -f baz.txt &&
+ test_path_is_file Makefile &&
+ test_path_is_missing a.out &&
+ test_path_is_missing foo.txt &&
+ test_path_is_missing bar.txt &&
+ test_path_is_file baz.txt &&
rm baz.txt
'
@@ -300,18 +301,18 @@ test_expect_success 'git clean -id (select - range)' '
docs/manual.txt obj.o build/lib.so &&
test_write_lines s "1,3-4" 2 "" c |
git clean -id &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test ! -f a.out &&
- test ! -f src/part3.c &&
- test ! -f src/part3.h &&
- test -f src/part4.c &&
- test -f src/part4.h &&
- test ! -f docs/manual.txt &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_missing a.out &&
+ test_path_is_missing src/part3.c &&
+ test_path_is_missing src/part3.h &&
+ test_path_is_file src/part4.c &&
+ test_path_is_file src/part4.h &&
+ test_path_is_missing docs/manual.txt &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -322,18 +323,18 @@ test_expect_success 'git clean -id (select - range 2)' '
docs/manual.txt obj.o build/lib.so &&
test_write_lines s "4- 1" "" c |
git clean -id &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test ! -f a.out &&
- test -f docs/manual.txt &&
- test -f src/part3.c &&
- test ! -f src/part3.h &&
- test ! -f src/part4.c &&
- test ! -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_missing a.out &&
+ test_path_is_file docs/manual.txt &&
+ test_path_is_file src/part3.c &&
+ test_path_is_missing src/part3.h &&
+ test_path_is_missing src/part4.c &&
+ test_path_is_missing src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -344,18 +345,18 @@ test_expect_success 'git clean -id (inverse select)' '
docs/manual.txt obj.o build/lib.so &&
test_write_lines s "*" "-5- 1 -2" "" c |
git clean -id &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test ! -f a.out &&
- test -f docs/manual.txt &&
- test ! -f src/part3.c &&
- test ! -f src/part3.h &&
- test -f src/part4.c &&
- test -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_missing a.out &&
+ test_path_is_file docs/manual.txt &&
+ test_path_is_missing src/part3.c &&
+ test_path_is_missing src/part3.h &&
+ test_path_is_file src/part4.c &&
+ test_path_is_file src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -366,18 +367,18 @@ test_expect_success 'git clean -id (ask)' '
docs/manual.txt obj.o build/lib.so &&
test_write_lines a Y y no yes bad "" |
git clean -id &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test ! -f a.out &&
- test ! -f docs/manual.txt &&
- test -f src/part3.c &&
- test ! -f src/part3.h &&
- test -f src/part4.c &&
- test -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_missing a.out &&
+ test_path_is_missing docs/manual.txt &&
+ test_path_is_file src/part3.c &&
+ test_path_is_missing src/part3.h &&
+ test_path_is_file src/part4.c &&
+ test_path_is_file src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -388,18 +389,18 @@ test_expect_success 'git clean -id (ask - Ctrl+D)' '
docs/manual.txt obj.o build/lib.so &&
test_write_lines a Y no yes "\04" |
git clean -id &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test ! -f a.out &&
- test -f docs/manual.txt &&
- test ! -f src/part3.c &&
- test -f src/part3.h &&
- test -f src/part4.c &&
- test -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_missing a.out &&
+ test_path_is_file docs/manual.txt &&
+ test_path_is_missing src/part3.c &&
+ test_path_is_file src/part3.h &&
+ test_path_is_file src/part4.c &&
+ test_path_is_file src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -411,18 +412,18 @@ test_expect_success 'git clean -id with prefix and path (filter)' '
(cd build/ &&
test_write_lines f docs "*.h" "" c |
git clean -id ..) &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test ! -f a.out &&
- test -f docs/manual.txt &&
- test ! -f src/part3.c &&
- test -f src/part3.h &&
- test ! -f src/part4.c &&
- test -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_missing a.out &&
+ test_path_is_file docs/manual.txt &&
+ test_path_is_missing src/part3.c &&
+ test_path_is_file src/part3.h &&
+ test_path_is_missing src/part4.c &&
+ test_path_is_file src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -434,18 +435,18 @@ test_expect_success 'git clean -id with prefix and path (select by name)' '
(cd build/ &&
test_write_lines s ../docs/ ../src/part3.c ../src/part4.c "" c |
git clean -id ..) &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test -f a.out &&
- test ! -f docs/manual.txt &&
- test ! -f src/part3.c &&
- test -f src/part3.h &&
- test ! -f src/part4.c &&
- test -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_file a.out &&
+ test_path_is_missing docs/manual.txt &&
+ test_path_is_missing src/part3.c &&
+ test_path_is_file src/part3.h &&
+ test_path_is_missing src/part4.c &&
+ test_path_is_file src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
@@ -457,18 +458,18 @@ test_expect_success 'git clean -id with prefix and path (ask)' '
(cd build/ &&
test_write_lines a Y y no yes bad "" |
git clean -id ..) &&
- test -f Makefile &&
- test -f README &&
- test -f src/part1.c &&
- test -f src/part2.c &&
- test ! -f a.out &&
- test ! -f docs/manual.txt &&
- test -f src/part3.c &&
- test ! -f src/part3.h &&
- test -f src/part4.c &&
- test -f src/part4.h &&
- test -f obj.o &&
- test -f build/lib.so
+ test_path_is_file Makefile &&
+ test_path_is_file README &&
+ test_path_is_file src/part1.c &&
+ test_path_is_file src/part2.c &&
+ test_path_is_missing a.out &&
+ test_path_is_missing docs/manual.txt &&
+ test_path_is_file src/part3.c &&
+ test_path_is_missing src/part3.h &&
+ test_path_is_file src/part4.c &&
+ test_path_is_file src/part4.h &&
+ test_path_is_file obj.o &&
+ test_path_is_file build/lib.so
'
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index e7cec2e..5c4a89d 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -14,6 +14,36 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
+test_expect_success 'setup - enable local submodules' '
+ git config --global protocol.file.allow always
+'
+
+test_expect_success 'submodule usage: -h' '
+ git submodule -h >out 2>err &&
+ grep "^usage: git submodule" out &&
+ test_must_be_empty err
+'
+
+test_expect_success 'submodule usage: --recursive' '
+ test_expect_code 1 git submodule --recursive >out 2>err &&
+ grep "^usage: git submodule" err &&
+ test_must_be_empty out
+'
+
+test_expect_success 'submodule usage: status --' '
+ test_expect_code 1 git submodule -- &&
+ test_expect_code 1 git submodule --end-of-options
+'
+
+for opt in '--quiet' '--cached'
+do
+ test_expect_success "submodule usage: status $opt" '
+ git submodule $opt &&
+ git submodule status $opt &&
+ git submodule $opt status
+ '
+done
+
test_expect_success 'submodule deinit works on empty repository' '
git submodule deinit --all
'
@@ -30,7 +60,7 @@ test_expect_success 'submodule init aborts on missing .gitmodules file' '
git update-index --add --cacheinfo 160000,$(git rev-parse HEAD),sub &&
# missing the .gitmodules file here
test_must_fail git submodule init 2>actual &&
- test_i18ngrep "No url found for submodule path" actual
+ test_grep "No url found for submodule path" actual
'
test_expect_success 'submodule update aborts on missing .gitmodules file' '
@@ -38,7 +68,7 @@ test_expect_success 'submodule update aborts on missing .gitmodules file' '
git update-index --add --cacheinfo 160000,$(git rev-parse HEAD),sub &&
# missing the .gitmodules file here
git submodule update sub 2>actual &&
- test_i18ngrep "Submodule path .sub. not initialized" actual
+ test_grep "Submodule path .sub. not initialized" actual
'
test_expect_success 'submodule update aborts on missing gitmodules url' '
@@ -70,7 +100,7 @@ test_expect_success 'status should ignore inner git repo when not added' '
) &&
test_must_fail git submodule status inner 2>output.err &&
rm -fr inner &&
- test_i18ngrep "^error: .*did not match any file(s) known to git" output.err
+ test_grep "^error: .*did not match any file(s) known to git" output.err
'
test_expect_success 'setup - repository in init subdirectory' '
@@ -152,6 +182,11 @@ test_expect_success 'submodule add' '
test_must_be_empty untracked
'
+test_expect_success !WINDOWS 'submodule add (absolute path)' '
+ test_when_finished "git reset --hard" &&
+ git submodule add "$submodurl" "$submodurl/add-abs"
+'
+
test_expect_success 'setup parent and one repository' '
test_create_repo parent &&
test_commit -C parent one
@@ -161,7 +196,7 @@ test_expect_success 'redirected submodule add does not show progress' '
git -C addtest submodule add "file://$submodurl/parent" submod-redirected \
2>err &&
! grep % err &&
- test_i18ngrep ! "Checking connectivity" err
+ test_grep ! "Checking connectivity" err
'
test_expect_success 'redirected submodule add --progress does show progress' '
@@ -177,8 +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: Turn this message off by running
- hint: "git config advice.addIgnoredFile false"
+ hint: Disable this message with "git config advice.addIgnoredFile false"
EOF
# Does not use test_commit due to the ignore
echo "*" > .gitignore &&
@@ -228,7 +262,7 @@ test_expect_success 'submodule add relays add --dry-run stderr' '
cd addtest &&
: >.git/index.lock &&
! git submodule add "$submodurl" sub-while-locked 2>output.err &&
- test_i18ngrep "^fatal: .*index\.lock" output.err &&
+ test_grep "^fatal: .*index\.lock" output.err &&
test_path_is_missing sub-while-locked
)
'
@@ -370,7 +404,7 @@ test_expect_success 'submodule add in subdirectory with relative path should fai
cd addtest/sub &&
test_must_fail git submodule add ../../ submod3 2>../../output.err
) &&
- test_i18ngrep toplevel output.err
+ test_grep toplevel output.err
'
test_expect_success 'setup - add an example entry to .gitmodules' '
@@ -451,7 +485,7 @@ test_expect_success 'status should still be "missing" after initializing' '
test_failure_with_unknown_submodule () {
test_must_fail git submodule $1 no-such-submodule 2>output.err &&
- test_i18ngrep "^error: .*no-such-submodule" output.err
+ test_grep "^error: .*no-such-submodule" output.err
}
test_expect_success 'init should fail with unknown submodule' '
@@ -544,6 +578,16 @@ test_expect_success 'status should be "modified" after submodule commit' '
grep "^+$rev2" list
'
+test_expect_success '"submodule --cached" command forms should be identical' '
+ git submodule status --cached >expect &&
+
+ git submodule --cached >actual &&
+ test_cmp expect actual &&
+
+ git submodule --cached status >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'the --cached sha1 should be rev1' '
git submodule --cached status >list &&
grep "^+$rev1" list
@@ -599,7 +643,7 @@ test_expect_success 'update --init' '
test_must_fail git config submodule.example.url &&
git submodule update init 2> update.out &&
- test_i18ngrep "not initialized" update.out &&
+ test_grep "not initialized" update.out &&
test_must_fail git rev-parse --resolve-git-dir init/.git &&
git submodule update --init init &&
@@ -616,7 +660,7 @@ test_expect_success 'update --init from subdirectory' '
(
cd sub &&
git submodule update ../init 2>update.out &&
- test_i18ngrep "not initialized" update.out &&
+ test_grep "not initialized" update.out &&
test_must_fail git rev-parse --resolve-git-dir ../init/.git &&
git submodule update --init ../init
@@ -1076,7 +1120,7 @@ test_expect_success 'submodule deinit from subdirectory' '
cd sub &&
git submodule deinit ../init >../output
) &&
- test_i18ngrep "\\.\\./init" output &&
+ test_grep "\\.\\./init" output &&
test -z "$(git config --get-regexp "submodule\.example\.")" &&
test -n "$(git config --get-regexp "submodule\.example2\.")" &&
test -f example2/.git &&
@@ -1091,8 +1135,8 @@ test_expect_success 'submodule deinit . deinits all initialized submodules' '
git submodule deinit . >actual &&
test -z "$(git config --get-regexp "submodule\.example\.")" &&
test -z "$(git config --get-regexp "submodule\.example2\.")" &&
- test_i18ngrep "Cleared directory .init" actual &&
- test_i18ngrep "Cleared directory .example2" actual &&
+ test_grep "Cleared directory .init" actual &&
+ test_grep "Cleared directory .example2" actual &&
rmdir init example2
'
@@ -1104,8 +1148,8 @@ test_expect_success 'submodule deinit --all deinits all initialized submodules'
git submodule deinit --all >actual &&
test -z "$(git config --get-regexp "submodule\.example\.")" &&
test -z "$(git config --get-regexp "submodule\.example2\.")" &&
- test_i18ngrep "Cleared directory .init" actual &&
- test_i18ngrep "Cleared directory .example2" actual &&
+ test_grep "Cleared directory .init" actual &&
+ test_grep "Cleared directory .example2" actual &&
rmdir init example2
'
@@ -1115,8 +1159,8 @@ test_expect_success 'submodule deinit deinits a submodule when its work tree is
git submodule deinit init example2 >actual &&
test -z "$(git config --get-regexp "submodule\.example\.")" &&
test -z "$(git config --get-regexp "submodule\.example2\.")" &&
- test_i18ngrep ! "Cleared directory .init" actual &&
- test_i18ngrep "Cleared directory .example2" actual &&
+ test_grep ! "Cleared directory .init" actual &&
+ test_grep "Cleared directory .example2" actual &&
rmdir init
'
@@ -1128,7 +1172,7 @@ test_expect_success 'submodule deinit fails when the submodule contains modifica
test -f example2/.git &&
git submodule deinit -f init >actual &&
test -z "$(git config --get-regexp "submodule\.example\.")" &&
- test_i18ngrep "Cleared directory .init" actual &&
+ test_grep "Cleared directory .init" actual &&
rmdir init
'
@@ -1140,7 +1184,7 @@ test_expect_success 'submodule deinit fails when the submodule contains untracke
test -f example2/.git &&
git submodule deinit -f init >actual &&
test -z "$(git config --get-regexp "submodule\.example\.")" &&
- test_i18ngrep "Cleared directory .init" actual &&
+ test_grep "Cleared directory .init" actual &&
rmdir init
'
@@ -1155,30 +1199,30 @@ test_expect_success 'submodule deinit fails when the submodule HEAD does not mat
test -f example2/.git &&
git submodule deinit -f init >actual &&
test -z "$(git config --get-regexp "submodule\.example\.")" &&
- test_i18ngrep "Cleared directory .init" actual &&
+ test_grep "Cleared directory .init" actual &&
rmdir init
'
test_expect_success 'submodule deinit is silent when used on an uninitialized submodule' '
git submodule update --init &&
git submodule deinit init >actual &&
- test_i18ngrep "Submodule .example. (.*) unregistered for path .init" actual &&
- test_i18ngrep "Cleared directory .init" actual &&
+ test_grep "Submodule .example. (.*) unregistered for path .init" actual &&
+ test_grep "Cleared directory .init" actual &&
git submodule deinit init >actual &&
- test_i18ngrep ! "Submodule .example. (.*) unregistered for path .init" actual &&
- test_i18ngrep "Cleared directory .init" actual &&
+ test_grep ! "Submodule .example. (.*) unregistered for path .init" actual &&
+ test_grep "Cleared directory .init" actual &&
git submodule deinit . >actual &&
- test_i18ngrep ! "Submodule .example. (.*) unregistered for path .init" actual &&
- test_i18ngrep "Submodule .example2. (.*) unregistered for path .example2" actual &&
- test_i18ngrep "Cleared directory .init" actual &&
+ test_grep ! "Submodule .example. (.*) unregistered for path .init" actual &&
+ test_grep "Submodule .example2. (.*) unregistered for path .example2" actual &&
+ test_grep "Cleared directory .init" actual &&
git submodule deinit . >actual &&
- test_i18ngrep ! "Submodule .example. (.*) unregistered for path .init" actual &&
- test_i18ngrep ! "Submodule .example2. (.*) unregistered for path .example2" actual &&
- test_i18ngrep "Cleared directory .init" actual &&
+ test_grep ! "Submodule .example. (.*) unregistered for path .init" actual &&
+ test_grep ! "Submodule .example2. (.*) unregistered for path .example2" actual &&
+ test_grep "Cleared directory .init" actual &&
git submodule deinit --all >actual &&
- test_i18ngrep ! "Submodule .example. (.*) unregistered for path .init" actual &&
- test_i18ngrep ! "Submodule .example2. (.*) unregistered for path .example2" actual &&
- test_i18ngrep "Cleared directory .init" actual &&
+ test_grep ! "Submodule .example. (.*) unregistered for path .init" actual &&
+ test_grep ! "Submodule .example2. (.*) unregistered for path .example2" actual &&
+ test_grep "Cleared directory .init" actual &&
rmdir init example2
'
@@ -1224,31 +1268,6 @@ test_expect_success 'submodule add clone shallow submodule' '
)
'
-test_expect_success 'submodule helper list is not confused by common prefixes' '
- mkdir -p dir1/b &&
- (
- cd dir1/b &&
- git init &&
- echo hi >testfile2 &&
- git add . &&
- git commit -m "test1"
- ) &&
- mkdir -p dir2/b &&
- (
- cd dir2/b &&
- git init &&
- echo hello >testfile1 &&
- git add . &&
- git commit -m "test2"
- ) &&
- git submodule add /dir1/b dir1/b &&
- git submodule add /dir2/b dir2/b &&
- git commit -m "first submodule commit" &&
- git submodule--helper list dir1/b | cut -f 2 >actual &&
- echo "dir1/b" >expect &&
- test_cmp expect actual
-'
-
test_expect_success 'setup superproject with submodules' '
git init sub1 &&
test_commit -C sub1 test &&
@@ -1331,6 +1350,22 @@ test_expect_success 'clone active submodule without submodule url set' '
)
'
+test_expect_success 'update submodules without url set in .gitconfig' '
+ test_when_finished "rm -rf multisuper_clone" &&
+ git clone file://"$pwd"/multisuper multisuper_clone &&
+
+ git -C multisuper_clone submodule init &&
+ for s in sub0 sub1 sub2 sub3
+ do
+ key=submodule.$s.url &&
+ git -C multisuper_clone config --local --unset $key &&
+ git -C multisuper_clone config --file .gitmodules --unset $key || return 1
+ done &&
+
+ test_must_fail git -C multisuper_clone submodule update 2>err &&
+ grep "cannot clone submodule .sub[0-3]. without a URL" err
+'
+
test_expect_success 'clone --recurse-submodules with a pathspec works' '
test_when_finished "rm -rf multisuper_clone" &&
cat >expected <<-\EOF &&
diff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh
index 9c3cc4c..542b333 100755
--- a/t/t7401-submodule-summary.sh
+++ b/t/t7401-submodule-summary.sh
@@ -17,6 +17,7 @@ This test script tries to verify the sanity of summary subcommand of git submodu
# various reasons, one of them being that there are lots of commands taking place
# outside of 'test_expect_success' block, which is no longer in good-style.
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
add_file () {
diff --git a/t/t7402-submodule-rebase.sh b/t/t7402-submodule-rebase.sh
index 8e32f19..aa2fdc3 100755
--- a/t/t7402-submodule-rebase.sh
+++ b/t/t7402-submodule-rebase.sh
@@ -5,6 +5,7 @@
test_description='Test rebasing, stashing, etc. with submodules'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
@@ -55,12 +56,15 @@ chmod a+x fake-editor.sh
test_expect_success 'interactive rebase with a dirty submodule' '
- test submodule = $(git diff --name-only) &&
+ echo submodule >expect &&
+ git diff --name-only >actual &&
+ test_cmp expect actual &&
HEAD=$(git rev-parse HEAD) &&
GIT_EDITOR="\"$(pwd)/fake-editor.sh\"" EDITOR_TEXT="pick $HEAD" \
git rebase -i HEAD^ &&
- test submodule = $(git diff --name-only)
-
+ echo submodule >expect &&
+ git diff --name-only >actual &&
+ test_cmp expect actual
'
test_expect_success 'rebase with dirty file and submodule fails' '
@@ -82,11 +86,19 @@ test_expect_success 'stash with a dirty submodule' '
CURRENT=$(cd submodule && git rev-parse HEAD) &&
git stash &&
test new != $(cat file) &&
- test submodule = $(git diff --name-only) &&
- test $CURRENT = $(cd submodule && git rev-parse HEAD) &&
+ echo submodule >expect &&
+ git diff --name-only >actual &&
+ test_cmp expect actual &&
+
+ echo "$CURRENT" >expect &&
+ git -C submodule rev-parse HEAD >actual &&
+ test_cmp expect actual &&
+
git stash apply &&
test new = $(cat file) &&
- test $CURRENT = $(cd submodule && git rev-parse HEAD)
+ echo "$CURRENT" >expect &&
+ git -C submodule rev-parse HEAD >actual &&
+ test_cmp expect actual
'
@@ -104,7 +116,7 @@ test_expect_success 'rebasing submodule that should conflict' '
test_tick &&
git commit -m fourth &&
- test_must_fail git rebase --onto HEAD^^ HEAD^ HEAD^0 &&
+ test_must_fail git rebase --onto HEAD^^ HEAD^ HEAD^0 2>actual_output &&
git ls-files -s submodule >actual &&
(
cd submodule &&
@@ -112,7 +124,12 @@ test_expect_success 'rebasing submodule that should conflict' '
echo "160000 $(git rev-parse HEAD^^) 2 submodule" &&
echo "160000 $(git rev-parse HEAD) 3 submodule"
) >expect &&
- test_cmp expect actual
+ test_cmp expect actual &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ sub_expect="go to submodule (submodule), and either merge commit $(git -C submodule rev-parse --short HEAD^0)" &&
+ grep "$sub_expect" actual_output
+ fi
'
test_done
diff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh
index 7d2ac33..19b6135 100755
--- a/t/t7403-submodule-sync.sh
+++ b/t/t7403-submodule-sync.sh
@@ -11,9 +11,12 @@ These tests exercise the "git submodule sync" subcommand.
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
+ git config --global protocol.file.allow always &&
+
echo file >file &&
git add file &&
test_tick &&
@@ -160,7 +163,7 @@ test_expect_success '"git submodule sync" should update submodule URLs - subdire
cd sub &&
git submodule sync >../../output
) &&
- test_i18ngrep "\\.\\./submodule" output &&
+ test_grep "\\.\\./submodule" output &&
test -d "$(
cd super-clone/submodule &&
git config remote.origin.url
@@ -191,7 +194,7 @@ test_expect_success '"git submodule sync --recursive" should update all submodul
cd sub &&
git submodule sync --recursive >../../output
) &&
- test_i18ngrep "\\.\\./submodule/sub-submodule" output &&
+ test_grep "\\.\\./submodule/sub-submodule" output &&
test -d "$(
cd super-clone/submodule &&
git config remote.origin.url
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index 43f779d..8491b8c 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -25,6 +25,7 @@ compare_head()
test_expect_success 'setup a submodule tree' '
+ git config --global protocol.file.allow always &&
echo file > file &&
git add file &&
test_tick &&
@@ -769,7 +770,7 @@ test_expect_success 'submodule update continues after recursive checkout error'
echo "" > file
)
) &&
- test_must_fail git submodule update --recursive &&
+ test_expect_code 1 git submodule update --recursive &&
(cd submodule2 &&
git rev-parse --verify HEAD >../actual
) &&
@@ -944,7 +945,7 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re
git clone super_update_r super_update_r2 &&
(cd super_update_r2 &&
git submodule update --init --recursive >actual &&
- test_i18ngrep "Submodule path .submodule/subsubmodule.: checked out" actual &&
+ test_grep "Submodule path .submodule/subsubmodule.: checked out" actual &&
(cd submodule/subsubmodule &&
git log > ../../expected
) &&
@@ -1024,7 +1025,7 @@ test_expect_success 'submodule update clone shallow submodule outside of depth'
# unadvertised objects, so restrict this test to v0.
test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 \
git submodule update --init --depth=1 2>actual &&
- test_i18ngrep "Direct fetching of that commit failed." actual &&
+ test_grep "Direct fetching of that commit failed." actual &&
git -C ../submodule config uploadpack.allowReachableSHA1InWant true &&
git submodule update --init --depth=1 >actual &&
git -C submodule log --oneline >out &&
@@ -1038,7 +1039,7 @@ test_expect_success 'submodule update --recursive drops module name before recur
git checkout HEAD^
) &&
git submodule update --recursive deeper/submodule >actual &&
- test_i18ngrep "Submodule path .deeper/submodule/subsubmodule.: checked out" actual
+ test_grep "Submodule path .deeper/submodule/subsubmodule.: checked out" actual
)
'
@@ -1074,7 +1075,7 @@ test_expect_success 'submodule update --quiet passes quietness to merge/rebase'
git submodule update --rebase --quiet >out 2>err &&
test_must_be_empty out &&
test_must_be_empty err &&
- git submodule update --rebase -v >out 2>err &&
+ git submodule update --rebase >out 2>err &&
test_file_not_empty out &&
test_must_be_empty err
)
@@ -1116,4 +1117,89 @@ test_expect_success 'submodule update --filter sets partial clone settings' '
test_cmp_config -C super-filter/submodule blob:none remote.origin.partialclonefilter
'
+# NEEDSWORK: Clean up the tests so that we can reuse the test setup.
+# Don't reuse the existing repos because the earlier tests have
+# intentionally disruptive configurations.
+test_expect_success 'setup clean recursive superproject' '
+ git init bottom &&
+ test_commit -C bottom "bottom" &&
+ git init middle &&
+ git -C middle submodule add ../bottom bottom &&
+ git -C middle commit -m "middle" &&
+ git init top &&
+ git -C top submodule add ../middle middle &&
+ git -C top commit -m "top" &&
+ git clone --recurse-submodules top top-clean
+'
+
+test_expect_success 'submodule update should skip unmerged submodules' '
+ test_when_finished "rm -fr top-cloned" &&
+ cp -r top-clean top-cloned &&
+
+ # Create an upstream commit in each repo, starting with bottom
+ test_commit -C bottom upstream_commit &&
+ # Create middle commit
+ git -C middle/bottom fetch &&
+ git -C middle/bottom checkout -f FETCH_HEAD &&
+ git -C middle add bottom &&
+ git -C middle commit -m "upstream_commit" &&
+ # Create top commit
+ git -C top/middle fetch &&
+ git -C top/middle checkout -f FETCH_HEAD &&
+ git -C top add middle &&
+ git -C top commit -m "upstream_commit" &&
+
+ # Create a downstream conflict
+ test_commit -C top-cloned/middle/bottom downstream_commit &&
+ git -C top-cloned/middle add bottom &&
+ git -C top-cloned/middle commit -m "downstream_commit" &&
+ git -C top-cloned/middle fetch --recurse-submodules origin &&
+ test_must_fail git -C top-cloned/middle merge origin/main &&
+
+ # Make the update of "middle" a no-op, otherwise we error out
+ # because of its unmerged state
+ test_config -C top-cloned submodule.middle.update !true &&
+ git -C top-cloned submodule update --recursive 2>actual.err &&
+ cat >expect.err <<-\EOF &&
+ Skipping unmerged submodule middle/bottom
+ EOF
+ test_cmp expect.err actual.err
+'
+
+test_expect_success 'submodule update --recursive skip submodules with strategy=none' '
+ test_when_finished "rm -fr top-cloned" &&
+ cp -r top-clean top-cloned &&
+
+ test_commit -C top-cloned/middle/bottom downstream_commit &&
+ git -C top-cloned/middle config submodule.bottom.update none &&
+ git -C top-cloned submodule update --recursive 2>actual.err &&
+ cat >expect.err <<-\EOF &&
+ Skipping submodule '\''middle/bottom'\''
+ EOF
+ test_cmp expect.err actual.err
+'
+
+add_submodule_commit_and_validate () {
+ HASH=$(git rev-parse HEAD) &&
+ git update-index --add --cacheinfo 160000,$HASH,sub &&
+ git commit -m "create submodule" &&
+ echo "160000 commit $HASH sub" >expect &&
+ git ls-tree HEAD -- sub >actual &&
+ test_cmp expect actual
+}
+
+test_expect_success 'commit with staged submodule change' '
+ add_submodule_commit_and_validate
+'
+
+test_expect_success 'commit with staged submodule change with ignoreSubmodules dirty' '
+ test_config diff.ignoreSubmodules dirty &&
+ add_submodule_commit_and_validate
+'
+
+test_expect_success 'commit with staged submodule change with ignoreSubmodules all' '
+ test_config diff.ignoreSubmodules all &&
+ add_submodule_commit_and_validate
+'
+
test_done
diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
index e2f110b..8d7b234 100755
--- a/t/t7407-submodule-foreach.sh
+++ b/t/t7407-submodule-foreach.sh
@@ -16,6 +16,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
test_expect_success 'setup a submodule tree' '
+ git config --global protocol.file.allow always &&
echo file > file &&
git add file &&
test_tick &&
@@ -153,6 +154,11 @@ test_expect_success 'use "submodule foreach" to checkout 2nd level submodule' '
)
'
+test_expect_success 'usage: foreach -- --not-an-option' '
+ test_expect_code 1 git submodule foreach -- --not-an-option &&
+ test_expect_code 1 git -C clone2 submodule foreach -- --not-an-option
+'
+
test_expect_success 'use "foreach --recursive" to checkout all submodules' '
(
cd clone2 &&
diff --git a/t/t7408-submodule-reference.sh b/t/t7408-submodule-reference.sh
index c3a4545..d6040e0 100755
--- a/t/t7408-submodule-reference.sh
+++ b/t/t7408-submodule-reference.sh
@@ -17,6 +17,10 @@ test_alternate_is_used () {
test_cmp expect actual
}
+test_expect_success 'setup' '
+ git config --global protocol.file.allow always
+'
+
test_expect_success 'preparing first repository' '
test_create_repo A &&
(
diff --git a/t/t7409-submodule-detached-work-tree.sh b/t/t7409-submodule-detached-work-tree.sh
index e17ac81..574a6fc 100755
--- a/t/t7409-submodule-detached-work-tree.sh
+++ b/t/t7409-submodule-detached-work-tree.sh
@@ -13,8 +13,13 @@ TEST_NO_CREATE_REPO=1
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
+test_expect_success 'setup' '
+ git config --global protocol.file.allow always
+'
+
test_expect_success 'submodule on detached working tree' '
git init --bare remote &&
test_create_repo bundle1 &&
diff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh
index ad28e93..31271f8 100755
--- a/t/t7411-submodule-config.sh
+++ b/t/t7411-submodule-config.sh
@@ -12,6 +12,9 @@ from the database and from the worktree works.
TEST_NO_CREATE_REPO=1
. ./test-lib.sh
+test_expect_success 'setup' '
+ git config --global protocol.file.allow always
+'
test_expect_success 'submodule config cache setup' '
mkdir submodule &&
(cd submodule &&
@@ -42,7 +45,7 @@ test_expect_success 'configuration parsing with error' '
(
cd repo &&
test_must_fail test-tool submodule-config "" s 2>actual &&
- test_i18ngrep "bad config" actual
+ test_grep "bad config" actual
)
'
@@ -98,7 +101,7 @@ test_expect_success 'error in history of one submodule config lets continue, std
>actual \
2>actual_stderr &&
test_cmp expect_error actual &&
- test_i18ngrep "submodule-blob $sha1:.gitmodules" actual_stderr >/dev/null
+ test_grep "submodule-blob $sha1:.gitmodules" actual_stderr >/dev/null
)
'
@@ -134,44 +137,44 @@ test_expect_success 'error in history in fetchrecursesubmodule lets continue' '
)
'
-test_expect_success 'reading submodules config from the working tree with "submodule--helper config"' '
+test_expect_success 'reading submodules config from the working tree' '
(cd super &&
echo "../submodule" >expect &&
- git submodule--helper config submodule.submodule.url >actual &&
+ test-tool submodule config-list submodule.submodule.url >actual &&
test_cmp expect actual
)
'
-test_expect_success 'unsetting submodules config from the working tree with "submodule--helper config --unset"' '
+test_expect_success 'unsetting submodules config from the working tree' '
(cd super &&
- git submodule--helper config --unset submodule.submodule.url &&
- git submodule--helper config submodule.submodule.url >actual &&
+ test-tool submodule config-unset submodule.submodule.url &&
+ test-tool submodule config-list submodule.submodule.url >actual &&
test_must_be_empty actual
)
'
-test_expect_success 'writing submodules config with "submodule--helper config"' '
+test_expect_success 'writing submodules config' '
(cd super &&
echo "new_url" >expect &&
- git submodule--helper config submodule.submodule.url "new_url" &&
- git submodule--helper config submodule.submodule.url >actual &&
+ test-tool submodule config-set submodule.submodule.url "new_url" &&
+ test-tool submodule config-list submodule.submodule.url >actual &&
test_cmp expect actual
)
'
-test_expect_success 'overwriting unstaged submodules config with "submodule--helper config"' '
+test_expect_success 'overwriting unstaged submodules config' '
test_when_finished "git -C super checkout .gitmodules" &&
(cd super &&
echo "newer_url" >expect &&
- git submodule--helper config submodule.submodule.url "newer_url" &&
- git submodule--helper config submodule.submodule.url >actual &&
+ test-tool submodule config-set submodule.submodule.url "newer_url" &&
+ test-tool submodule config-list submodule.submodule.url >actual &&
test_cmp expect actual
)
'
test_expect_success 'writeable .gitmodules when it is in the working tree' '
- git -C super submodule--helper config --check-writeable
+ test-tool -C super submodule config-writeable
'
test_expect_success 'writeable .gitmodules when it is nowhere in the repository' '
@@ -180,7 +183,7 @@ test_expect_success 'writeable .gitmodules when it is nowhere in the repository'
(cd super &&
git rm .gitmodules &&
git commit -m "remove .gitmodules from the current branch" &&
- git submodule--helper config --check-writeable
+ test-tool submodule config-writeable
)
'
@@ -188,7 +191,7 @@ test_expect_success 'non-writeable .gitmodules when it is in the index but not i
test_when_finished "git -C super checkout .gitmodules" &&
(cd super &&
rm -f .gitmodules &&
- test_must_fail git submodule--helper config --check-writeable
+ test_must_fail test-tool submodule config-writeable
)
'
@@ -197,7 +200,7 @@ test_expect_success 'non-writeable .gitmodules when it is in the current branch
test_when_finished "git -C super reset --hard $ORIG" &&
(cd super &&
git rm .gitmodules &&
- test_must_fail git submodule--helper config --check-writeable
+ test_must_fail test-tool submodule config-writeable
)
'
@@ -205,11 +208,11 @@ test_expect_success 'reading submodules config from the index when .gitmodules i
ORIG=$(git -C super rev-parse HEAD) &&
test_when_finished "git -C super reset --hard $ORIG" &&
(cd super &&
- git submodule--helper config submodule.submodule.url "staged_url" &&
+ test-tool submodule config-set submodule.submodule.url "staged_url" &&
git add .gitmodules &&
rm -f .gitmodules &&
echo "staged_url" >expect &&
- git submodule--helper config submodule.submodule.url >actual &&
+ test-tool submodule config-list submodule.submodule.url >actual &&
test_cmp expect actual
)
'
@@ -220,7 +223,7 @@ test_expect_success 'reading submodules config from the current branch when .git
(cd super &&
git rm .gitmodules &&
echo "../submodule" >expect &&
- git submodule--helper config submodule.submodule.url >actual &&
+ test-tool submodule config-list submodule.submodule.url >actual &&
test_cmp expect actual
)
'
diff --git a/t/t7412-submodule-absorbgitdirs.sh b/t/t7412-submodule-absorbgitdirs.sh
index 1cfa150..f778321 100755
--- a/t/t7412-submodule-absorbgitdirs.sh
+++ b/t/t7412-submodule-absorbgitdirs.sh
@@ -6,9 +6,11 @@ This test verifies that `git submodue absorbgitdirs` moves a submodules git
directory into the superproject.
'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup a real submodule' '
+ cwd="$(pwd)" &&
git init sub1 &&
test_commit -C sub1 first &&
git submodule add ./sub1 &&
@@ -17,13 +19,21 @@ test_expect_success 'setup a real submodule' '
'
test_expect_success 'absorb the git dir' '
+ >expect &&
+ >actual &&
>expect.1 &&
>expect.2 &&
>actual.1 &&
>actual.2 &&
git status >expect.1 &&
git -C sub1 rev-parse HEAD >expect.2 &&
- git submodule absorbgitdirs &&
+ cat >expect <<-EOF &&
+ Migrating git directory of '\''sub1'\'' from
+ '\''$cwd/sub1/.git'\'' to
+ '\''$cwd/.git/modules/sub1'\''
+ EOF
+ git submodule absorbgitdirs 2>actual &&
+ test_cmp expect actual &&
git fsck &&
test -f sub1/.git &&
test -d .git/modules/sub1 &&
@@ -36,7 +46,8 @@ test_expect_success 'absorb the git dir' '
test_expect_success 'absorbing does not fail for deinitialized submodules' '
test_when_finished "git submodule update --init" &&
git submodule deinit --all &&
- git submodule absorbgitdirs &&
+ git submodule absorbgitdirs 2>err &&
+ test_must_be_empty err &&
test -d .git/modules/sub1 &&
test -d sub1 &&
! test -e sub1/.git
@@ -55,7 +66,13 @@ test_expect_success 'setup nested submodule' '
test_expect_success 'absorb the git dir in a nested submodule' '
git status >expect.1 &&
git -C sub1/nested rev-parse HEAD >expect.2 &&
- git submodule absorbgitdirs &&
+ cat >expect <<-EOF &&
+ Migrating git directory of '\''sub1/nested'\'' from
+ '\''$cwd/sub1/nested/.git'\'' to
+ '\''$cwd/.git/modules/sub1/modules/nested'\''
+ EOF
+ git submodule absorbgitdirs 2>actual &&
+ test_cmp expect actual &&
test -f sub1/nested/.git &&
test -d .git/modules/sub1/modules/nested &&
git status >actual.1 &&
@@ -86,7 +103,13 @@ test_expect_success 're-setup nested submodule' '
test_expect_success 'absorb the git dir in a nested submodule' '
git status >expect.1 &&
git -C sub1/nested rev-parse HEAD >expect.2 &&
- git submodule absorbgitdirs &&
+ cat >expect <<-EOF &&
+ Migrating git directory of '\''sub1'\'' from
+ '\''$cwd/sub1/.git'\'' to
+ '\''$cwd/.git/modules/sub1'\''
+ EOF
+ git submodule absorbgitdirs 2>actual &&
+ test_cmp expect actual &&
test -f sub1/.git &&
test -f sub1/nested/.git &&
test -d .git/modules/sub1/modules/nested &&
@@ -96,6 +119,27 @@ test_expect_success 'absorb the git dir in a nested submodule' '
test_cmp expect.2 actual.2
'
+test_expect_success 'absorb the git dir outside of primary worktree' '
+ test_when_finished "rm -rf repo-bare.git" &&
+ git clone --bare . repo-bare.git &&
+ test_when_finished "rm -rf repo-wt" &&
+ git -C repo-bare.git worktree add ../repo-wt &&
+
+ test_when_finished "rm -f .gitconfig" &&
+ test_config_global protocol.file.allow always &&
+ git -C repo-wt submodule update --init &&
+ git init repo-wt/sub2 &&
+ test_commit -C repo-wt/sub2 A &&
+ git -C repo-wt submodule add ./sub2 sub2 &&
+ cat >expect <<-EOF &&
+ Migrating git directory of '\''sub2'\'' from
+ '\''$cwd/repo-wt/sub2/.git'\'' to
+ '\''$cwd/repo-bare.git/worktrees/repo-wt/modules/sub2'\''
+ EOF
+ git -C repo-wt submodule absorbgitdirs 2>actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'setup a gitlink with missing .gitmodules entry' '
git init sub2 &&
test_commit -C sub2 first &&
@@ -106,7 +150,11 @@ test_expect_success 'setup a gitlink with missing .gitmodules entry' '
test_expect_success 'absorbing the git dir fails for incomplete submodules' '
git status >expect.1 &&
git -C sub2 rev-parse HEAD >expect.2 &&
- test_must_fail git submodule absorbgitdirs &&
+ cat >expect <<-\EOF &&
+ fatal: could not lookup name for submodule '\''sub2'\''
+ EOF
+ test_must_fail git submodule absorbgitdirs 2>actual &&
+ test_cmp expect actual &&
git -C sub2 fsck &&
test -d sub2/.git &&
git status >actual &&
@@ -126,8 +174,11 @@ test_expect_success 'setup a submodule with multiple worktrees' '
'
test_expect_success 'absorbing fails for a submodule with multiple worktrees' '
- test_must_fail git submodule absorbgitdirs sub3 2>error &&
- test_i18ngrep "not supported" error
+ cat >expect <<-\EOF &&
+ fatal: could not lookup name for submodule '\''sub2'\''
+ EOF
+ test_must_fail git submodule absorbgitdirs 2>actual &&
+ test_cmp expect actual
'
test_done
diff --git a/t/t7413-submodule-is-active.sh b/t/t7413-submodule-is-active.sh
index c8e7e98..887d181 100755
--- a/t/t7413-submodule-is-active.sh
+++ b/t/t7413-submodule-is-active.sh
@@ -1,14 +1,19 @@
#!/bin/sh
-test_description='Test submodule--helper is-active
+test_description='Test with test-tool submodule is-active
-This test verifies that `git submodue--helper is-active` correctly identifies
+This test verifies that `test-tool submodule is-active` correctly identifies
submodules which are "active" and interesting to the user.
+
+This is a unit test of the submodule.c is_submodule_active() function,
+which is also indirectly tested elsewhere.
'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
+ git config --global protocol.file.allow always &&
git init sub &&
test_commit -C sub initial &&
git init super &&
@@ -25,13 +30,13 @@ test_expect_success 'setup' '
'
test_expect_success 'is-active works with urls' '
- git -C super submodule--helper is-active sub1 &&
- git -C super submodule--helper is-active sub2 &&
+ test-tool -C super submodule is-active sub1 &&
+ test-tool -C super submodule is-active sub2 &&
git -C super config --unset submodule.sub1.URL &&
- test_must_fail git -C super submodule--helper is-active sub1 &&
+ test_must_fail test-tool -C super submodule is-active sub1 &&
git -C super config submodule.sub1.URL ../sub &&
- git -C super submodule--helper is-active sub1
+ test-tool -C super submodule is-active sub1
'
test_expect_success 'is-active works with submodule.<name>.active config' '
@@ -39,11 +44,27 @@ test_expect_success 'is-active works with submodule.<name>.active config' '
test_when_finished "git -C super config submodule.sub1.URL ../sub" &&
git -C super config --bool submodule.sub1.active "false" &&
- test_must_fail git -C super submodule--helper is-active sub1 &&
+ test_must_fail test-tool -C super submodule is-active sub1 &&
git -C super config --bool submodule.sub1.active "true" &&
git -C super config --unset submodule.sub1.URL &&
- git -C super submodule--helper is-active sub1
+ test-tool -C super submodule is-active sub1
+'
+
+test_expect_success 'is-active handles submodule.active config missing a value' '
+ cp super/.git/config super/.git/config.orig &&
+ test_when_finished mv super/.git/config.orig super/.git/config &&
+
+ cat >>super/.git/config <<-\EOF &&
+ [submodule]
+ active
+ EOF
+
+ cat >expect <<-\EOF &&
+ error: missing value for '\''submodule.active'\''
+ EOF
+ test-tool -C super submodule is-active sub1 2>actual &&
+ test_cmp expect actual
'
test_expect_success 'is-active works with basic submodule.active config' '
@@ -53,17 +74,17 @@ test_expect_success 'is-active works with basic submodule.active config' '
git -C super config --add submodule.active "." &&
git -C super config --unset submodule.sub1.URL &&
- git -C super submodule--helper is-active sub1 &&
- git -C super submodule--helper is-active sub2
+ test-tool -C super submodule is-active sub1 &&
+ test-tool -C super submodule is-active sub2
'
test_expect_success 'is-active correctly works with paths that are not submodules' '
test_when_finished "git -C super config --unset-all submodule.active" &&
- test_must_fail git -C super submodule--helper is-active not-a-submodule &&
+ test_must_fail test-tool -C super submodule is-active not-a-submodule &&
git -C super config --add submodule.active "." &&
- test_must_fail git -C super submodule--helper is-active not-a-submodule
+ test_must_fail test-tool -C super submodule is-active not-a-submodule
'
test_expect_success 'is-active works with exclusions in submodule.active config' '
@@ -72,8 +93,8 @@ test_expect_success 'is-active works with exclusions in submodule.active config'
git -C super config --add submodule.active "." &&
git -C super config --add submodule.active ":(exclude)sub1" &&
- test_must_fail git -C super submodule--helper is-active sub1 &&
- git -C super submodule--helper is-active sub2
+ test_must_fail test-tool -C super submodule is-active sub1 &&
+ test-tool -C super submodule is-active sub2
'
test_expect_success 'is-active with submodule.active and submodule.<name>.active' '
@@ -85,8 +106,8 @@ test_expect_success 'is-active with submodule.active and submodule.<name>.active
git -C super config --bool submodule.sub1.active "false" &&
git -C super config --bool submodule.sub2.active "true" &&
- test_must_fail git -C super submodule--helper is-active sub1 &&
- git -C super submodule--helper is-active sub2
+ test_must_fail test-tool -C super submodule is-active sub1 &&
+ test-tool -C super submodule is-active sub2
'
test_expect_success 'is-active, submodule.active and submodule add' '
diff --git a/t/t7414-submodule-mistakes.sh b/t/t7414-submodule-mistakes.sh
index f2e7df5..24f30e3 100755
--- a/t/t7414-submodule-mistakes.sh
+++ b/t/t7414-submodule-mistakes.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='handling of common mistakes people may make with submodules'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'create embedded repository' '
@@ -11,13 +13,13 @@ test_expect_success 'create embedded repository' '
test_expect_success 'git-add on embedded repository warns' '
test_when_finished "git rm --cached -f embed" &&
git add embed 2>stderr &&
- test_i18ngrep warning stderr
+ test_grep warning stderr
'
test_expect_success '--no-warn-embedded-repo suppresses warning' '
test_when_finished "git rm --cached -f embed" &&
git add --no-warn-embedded-repo embed 2>stderr &&
- test_i18ngrep ! warning stderr
+ test_grep ! warning stderr
'
test_expect_success 'no warning when updating entry' '
@@ -25,13 +27,14 @@ test_expect_success 'no warning when updating entry' '
git add embed &&
git -C embed commit --allow-empty -m two &&
git add embed 2>stderr &&
- test_i18ngrep ! warning stderr
+ test_grep ! warning stderr
'
test_expect_success 'submodule add does not warn' '
test_when_finished "git rm -rf submodule .gitmodules" &&
- git submodule add ./embed submodule 2>stderr &&
- test_i18ngrep ! warning stderr
+ git -c protocol.file.allow=always \
+ submodule add ./embed submodule 2>stderr &&
+ test_grep ! warning stderr
'
test_done
diff --git a/t/t7416-submodule-dash-url.sh b/t/t7416-submodule-dash-url.sh
index d21dc8b..2ab566e 100755
--- a/t/t7416-submodule-dash-url.sh
+++ b/t/t7416-submodule-dash-url.sh
@@ -1,8 +1,14 @@
#!/bin/sh
test_description='check handling of disallowed .gitmodule urls'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
+test_expect_success 'setup' '
+ git config --global protocol.file.allow always
+'
+
test_expect_success 'create submodule with protected dash in url' '
git init upstream &&
git -C upstream commit --allow-empty -m base &&
@@ -35,7 +41,7 @@ test_expect_success 'remove ./ protection from .gitmodules url' '
test_expect_success 'clone rejects unprotected dash' '
test_when_finished "rm -rf dst" &&
test_must_fail git clone --recurse-submodules . dst 2>err &&
- test_i18ngrep ignoring err
+ test_grep ignoring err
'
test_expect_success 'fsck rejects unprotected dash' '
@@ -57,7 +63,7 @@ test_expect_success 'trailing backslash is handled correctly' '
mv .new .gitmodules &&
git commit -am "Add testmodule" &&
test_must_fail git clone --verbose --recurse-submodules . dolly 2>err &&
- test_i18ngrep ! "unknown option" err
+ test_grep ! "unknown option" err
'
test_expect_success 'fsck rejects missing URL scheme' '
diff --git a/t/t7417-submodule-path-url.sh b/t/t7417-submodule-path-url.sh
index f0f6b9f..5e3051d 100755
--- a/t/t7417-submodule-path-url.sh
+++ b/t/t7417-submodule-path-url.sh
@@ -6,6 +6,10 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
+test_expect_success 'setup' '
+ git config --global protocol.file.allow always
+'
+
test_expect_success 'create submodule with dash in path' '
git init upstream &&
git -C upstream commit --allow-empty -m base &&
@@ -17,7 +21,7 @@ test_expect_success 'create submodule with dash in path' '
test_expect_success 'clone rejects unprotected dash' '
test_when_finished "rm -rf dst" &&
git clone --recurse-submodules . dst 2>err &&
- test_i18ngrep ignoring err
+ test_grep ignoring err
'
test_expect_success 'fsck rejects unprotected dash' '
@@ -42,7 +46,7 @@ test_expect_success MINGW 'submodule paths disallows trailing spaces' '
git -C super update-ref refs/heads/main $commit &&
test_must_fail git clone --recurse-submodules super dst 2>err &&
- test_i18ngrep "sub " err
+ test_grep "sub " err
'
test_done
diff --git a/t/t7418-submodule-sparse-gitmodules.sh b/t/t7418-submodule-sparse-gitmodules.sh
index f87e524..dde11ec 100755
--- a/t/t7418-submodule-sparse-gitmodules.sh
+++ b/t/t7418-submodule-sparse-gitmodules.sh
@@ -17,6 +17,10 @@ export GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB
. ./test-lib.sh
+test_expect_success 'setup' '
+ git config --global protocol.file.allow always
+'
+
test_expect_success 'sparse checkout setup which hides .gitmodules' '
git init upstream &&
git init submodule &&
@@ -31,8 +35,9 @@ test_expect_success 'sparse checkout setup which hides .gitmodules' '
test_tick &&
git commit -m "Add submodule"
) &&
- git clone upstream super &&
+ git clone --template= upstream super &&
(cd super &&
+ mkdir .git/info &&
cat >.git/info/sparse-checkout <<-\EOF &&
/*
!/.gitmodules
@@ -45,12 +50,12 @@ test_expect_success 'sparse checkout setup which hides .gitmodules' '
test_expect_success 'reading gitmodules config file when it is not checked out' '
echo "../submodule" >expect &&
- git -C super submodule--helper config submodule.submodule.url >actual &&
+ test-tool -C super submodule config-list submodule.submodule.url >actual &&
test_cmp expect actual
'
test_expect_success 'not writing gitmodules config file when it is not checked out' '
- test_must_fail git -C super submodule--helper config submodule.submodule.url newurl &&
+ test_must_fail test-tool -C super submodule config-set submodule.submodule.url newurl &&
test_path_is_missing super/.gitmodules
'
diff --git a/t/t7419-submodule-set-branch.sh b/t/t7419-submodule-set-branch.sh
index 3b925c3..a5d1bc5 100755
--- a/t/t7419-submodule-set-branch.sh
+++ b/t/t7419-submodule-set-branch.sh
@@ -9,9 +9,18 @@ This test verifies that the set-branch subcommand of git-submodule is working
as expected.
'
+TEST_PASSES_SANITIZE_LEAK=true
TEST_NO_CREATE_REPO=1
+
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./test-lib.sh
+test_expect_success 'setup' '
+ git config --global protocol.file.allow always
+'
+
test_expect_success 'submodule config cache setup' '
mkdir submodule &&
(cd submodule &&
@@ -22,26 +31,28 @@ test_expect_success 'submodule config cache setup' '
git checkout -b topic &&
echo b >a &&
git add . &&
- git commit -mb
+ git commit -mb &&
+ git checkout main
) &&
mkdir super &&
(cd super &&
git init &&
git submodule add ../submodule &&
- git commit -m "add submodule"
+ git submodule add --name thename ../submodule thepath &&
+ git commit -m "add submodules"
)
'
test_expect_success 'ensure submodule branch is unset' '
(cd super &&
- ! grep branch .gitmodules
+ test_cmp_config "" -f .gitmodules --default "" submodule.submodule.branch
)
'
test_expect_success 'test submodule set-branch --branch' '
(cd super &&
git submodule set-branch --branch topic submodule &&
- grep "branch = topic" .gitmodules &&
+ test_cmp_config topic -f .gitmodules submodule.submodule.branch &&
git submodule update --remote &&
cat <<-\EOF >expect &&
b
@@ -52,13 +63,12 @@ test_expect_success 'test submodule set-branch --branch' '
'
test_expect_success 'test submodule set-branch --default' '
- test_commit -C submodule c &&
(cd super &&
git submodule set-branch --default submodule &&
- ! grep branch .gitmodules &&
+ test_cmp_config "" -f .gitmodules --default "" submodule.submodule.branch &&
git submodule update --remote &&
cat <<-\EOF >expect &&
- c
+ a
EOF
git -C submodule show -s --pretty=%s >actual &&
test_cmp expect actual
@@ -66,10 +76,9 @@ test_expect_success 'test submodule set-branch --default' '
'
test_expect_success 'test submodule set-branch -b' '
- test_commit -C submodule b &&
(cd super &&
git submodule set-branch -b topic submodule &&
- grep "branch = topic" .gitmodules &&
+ test_cmp_config topic -f .gitmodules submodule.submodule.branch &&
git submodule update --remote &&
cat <<-\EOF >expect &&
b
@@ -80,17 +89,43 @@ test_expect_success 'test submodule set-branch -b' '
'
test_expect_success 'test submodule set-branch -d' '
- test_commit -C submodule d &&
(cd super &&
git submodule set-branch -d submodule &&
- ! grep branch .gitmodules &&
+ test_cmp_config "" -f .gitmodules --default "" submodule.submodule.branch &&
git submodule update --remote &&
cat <<-\EOF >expect &&
- d
+ a
EOF
git -C submodule show -s --pretty=%s >actual &&
test_cmp expect actual
)
'
+test_expect_success 'test submodule set-branch --branch with named submodule' '
+ (cd super &&
+ git submodule set-branch --branch topic thepath &&
+ test_cmp_config topic -f .gitmodules submodule.thename.branch &&
+ test_cmp_config "" -f .gitmodules --default "" submodule.thepath.branch &&
+ git submodule update --remote &&
+ cat <<-\EOF >expect &&
+ b
+ EOF
+ git -C thepath show -s --pretty=%s >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'test submodule set-branch --default with named submodule' '
+ (cd super &&
+ git submodule set-branch --default thepath &&
+ test_cmp_config "" -f .gitmodules --default "" submodule.thename.branch &&
+ git submodule update --remote &&
+ cat <<-\EOF >expect &&
+ a
+ EOF
+ git -C thepath show -s --pretty=%s >actual &&
+ test_cmp expect actual
+ )
+'
+
test_done
diff --git a/t/t7420-submodule-set-url.sh b/t/t7420-submodule-set-url.sh
index ef0cb6e..bf7f15e 100755
--- a/t/t7420-submodule-set-url.sh
+++ b/t/t7420-submodule-set-url.sh
@@ -12,6 +12,10 @@ as expected.
TEST_NO_CREATE_REPO=1
. ./test-lib.sh
+test_expect_success 'setup' '
+ git config --global protocol.file.allow always
+'
+
test_expect_success 'submodule config cache setup' '
mkdir submodule &&
(
@@ -21,17 +25,26 @@ test_expect_success 'submodule config cache setup' '
git add file &&
git commit -ma
) &&
+ mkdir namedsubmodule &&
+ (
+ cd namedsubmodule &&
+ git init &&
+ echo 1 >file &&
+ git add file &&
+ git commit -m1
+ ) &&
mkdir super &&
(
cd super &&
git init &&
git submodule add ../submodule &&
- git commit -m "add submodule"
+ git submodule add --name thename ../namedsubmodule thepath &&
+ git commit -m "add submodules"
)
'
test_expect_success 'test submodule set-url' '
- # add a commit and move the submodule (change the url)
+ # add commits and move the submodules (change the urls)
(
cd submodule &&
echo b >>file &&
@@ -40,15 +53,28 @@ test_expect_success 'test submodule set-url' '
) &&
mv submodule newsubmodule &&
+ (
+ cd namedsubmodule &&
+ echo 2 >>file &&
+ git add file &&
+ git commit -m2
+ ) &&
+ mv namedsubmodule newnamedsubmodule &&
+
git -C newsubmodule show >expect &&
+ git -C newnamedsubmodule show >>expect &&
(
cd super &&
test_must_fail git submodule update --remote &&
git submodule set-url submodule ../newsubmodule &&
- grep -F "url = ../newsubmodule" .gitmodules &&
+ test_cmp_config ../newsubmodule -f .gitmodules submodule.submodule.url &&
+ git submodule set-url thepath ../newnamedsubmodule &&
+ test_cmp_config ../newnamedsubmodule -f .gitmodules submodule.thename.url &&
+ test_cmp_config "" -f .gitmodules --default "" submodule.thepath.url &&
git submodule update --remote
) &&
git -C super/submodule show >actual &&
+ git -C super/thepath show >>actual &&
test_cmp expect actual
'
diff --git a/t/t7421-submodule-summary-add.sh b/t/t7421-submodule-summary-add.sh
index b070f13..ce64d8b 100755
--- a/t/t7421-submodule-summary-add.sh
+++ b/t/t7421-submodule-summary-add.sh
@@ -12,6 +12,10 @@ while making sure to add submodules using `git submodule add` instead of
. ./test-lib.sh
+test_expect_success 'setup' '
+ git config --global protocol.file.allow always
+'
+
test_expect_success 'summary test environment setup' '
git init sm &&
test_commit -C sm "add file" file file-content file-tag &&
diff --git a/t/t7422-submodule-output.sh b/t/t7422-submodule-output.sh
new file mode 100755
index 0000000..ab946ec
--- /dev/null
+++ b/t/t7422-submodule-output.sh
@@ -0,0 +1,170 @@
+#!/bin/sh
+
+test_description='submodule --cached, --quiet etc. output'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-t3100.sh
+
+setup_sub () {
+ local d="$1" &&
+ shift &&
+ git $@ clone . "$d" &&
+ git $@ submodule add ./"$d"
+}
+
+normalize_status () {
+ sed -e 's/-g[0-9a-f]*/-gHASH/'
+}
+
+test_expect_success 'setup' '
+ test_commit A &&
+ test_commit B &&
+ setup_sub S &&
+ setup_sub S.D &&
+ setup_sub S.C &&
+ setup_sub S.C.D &&
+ setup_sub X &&
+ git add S* &&
+ test_commit C &&
+
+ # recursive in X/
+ git -C X pull &&
+ GIT_ALLOW_PROTOCOL=file git -C X submodule update --init &&
+
+ # dirty
+ for d in S.D X/S.D
+ do
+ echo dirty >"$d"/A.t || return 1
+ done &&
+
+ # commit (for --cached)
+ for d in S.C* X/S.C*
+ do
+ git -C "$d" reset --hard A || return 1
+ done &&
+
+ # dirty
+ for d in S*.D X/S*.D
+ do
+ echo dirty >"$d/C2.t" || return 1
+ done &&
+
+ for ref in A B C
+ do
+ # Not different with SHA-1 and SHA-256, just (ab)using
+ # test_oid_cache as a variable bag to avoid using
+ # $(git rev-parse ...).
+ oid=$(git rev-parse $ref) &&
+ test_oid_cache <<-EOF || return 1
+ $ref sha1:$oid
+ $ref sha256:$oid
+ EOF
+ done
+'
+
+for opts in "" "status"
+do
+ test_expect_success "git submodule $opts" '
+ sed -e "s/^>//" >expect <<-EOF &&
+ > $(test_oid B) S (B)
+ >+$(test_oid A) S.C (A)
+ >+$(test_oid A) S.C.D (A)
+ > $(test_oid B) S.D (B)
+ >+$(test_oid C) X (C)
+ EOF
+ git submodule $opts >actual.raw &&
+ normalize_status <actual.raw >actual &&
+ test_cmp expect actual
+ '
+done
+
+for opts in \
+ "status --recursive"
+do
+ test_expect_success "git submodule $opts" '
+ sed -e "s/^>//" >expect <<-EOF &&
+ > $(test_oid B) S (B)
+ >+$(test_oid A) S.C (A)
+ >+$(test_oid A) S.C.D (A)
+ > $(test_oid B) S.D (B)
+ >+$(test_oid C) X (C)
+ > $(test_oid B) X/S (B)
+ >+$(test_oid A) X/S.C (A)
+ >+$(test_oid A) X/S.C.D (A)
+ > $(test_oid B) X/S.D (B)
+ > $(test_oid B) X/X (B)
+ EOF
+ git submodule $opts >actual.raw &&
+ normalize_status <actual.raw >actual &&
+ test_cmp expect actual
+ '
+done
+
+for opts in \
+ "--quiet" \
+ "--quiet status" \
+ "status --quiet"
+do
+ test_expect_success "git submodule $opts" '
+ git submodule $opts >out &&
+ test_must_be_empty out
+ '
+done
+
+for opts in \
+ "--cached" \
+ "--cached status" \
+ "status --cached"
+do
+ test_expect_success "git submodule $opts" '
+ sed -e "s/^>//" >expect <<-EOF &&
+ > $(test_oid B) S (B)
+ >+$(test_oid B) S.C (B)
+ >+$(test_oid B) S.C.D (B)
+ > $(test_oid B) S.D (B)
+ >+$(test_oid B) X (B)
+ EOF
+ git submodule $opts >actual.raw &&
+ normalize_status <actual.raw >actual &&
+ test_cmp expect actual
+ '
+done
+
+for opts in \
+ "--cached --quiet" \
+ "--cached --quiet status" \
+ "--cached status --quiet" \
+ "--quiet status --cached" \
+ "status --cached --quiet"
+do
+ test_expect_success "git submodule $opts" '
+ git submodule $opts >out &&
+ test_must_be_empty out
+ '
+done
+
+for opts in \
+ "status --cached --recursive" \
+ "--cached status --recursive"
+do
+ test_expect_success "git submodule $opts" '
+ sed -e "s/^>//" >expect <<-EOF &&
+ > $(test_oid B) S (B)
+ >+$(test_oid B) S.C (B)
+ >+$(test_oid B) S.C.D (B)
+ > $(test_oid B) S.D (B)
+ >+$(test_oid B) X (B)
+ > $(test_oid B) X/S (B)
+ >+$(test_oid B) X/S.C (B)
+ >+$(test_oid B) X/S.C.D (B)
+ > $(test_oid B) X/S.D (B)
+ > $(test_oid B) X/X (B)
+ EOF
+ git submodule $opts >actual.raw &&
+ normalize_status <actual.raw >actual &&
+ test_cmp expect actual
+ '
+done
+
+test_done
diff --git a/t/t7450-bad-git-dotfiles.sh b/t/t7450-bad-git-dotfiles.sh
index 41706c1..46d4fb0 100755
--- a/t/t7450-bad-git-dotfiles.sh
+++ b/t/t7450-bad-git-dotfiles.sh
@@ -12,16 +12,22 @@ Such as:
- symlinked .gitmodules, etc
'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-pack.sh
+test_expect_success 'setup' '
+ git config --global protocol.file.allow always
+'
+
test_expect_success 'check names' '
cat >expect <<-\EOF &&
valid
valid/with/paths
EOF
- git submodule--helper check-name >actual <<-\EOF &&
+ test-tool submodule check-name >actual <<-\EOF &&
valid
valid/with/paths
@@ -39,6 +45,32 @@ test_expect_success 'check names' '
test_cmp expect actual
'
+test_expect_success 'check urls' '
+ cat >expect <<-\EOF &&
+ ./bar/baz/foo.git
+ https://example.com/foo.git
+ http://example.com:80/deeper/foo.git
+ EOF
+
+ test-tool submodule check-url >actual <<-\EOF &&
+ ./bar/baz/foo.git
+ https://example.com/foo.git
+ http://example.com:80/deeper/foo.git
+ -a./foo
+ ../../..//test/foo.git
+ ../../../../../:localhost:8080/foo.git
+ ..\../.\../:example.com/foo.git
+ ./%0ahost=example.com/foo.git
+ https://one.example.com/evil?%0ahost=two.example.com
+ https:///example.com/foo.git
+ http://example.com:test/foo.git
+ https::example.com/foo.git
+ http:::example.com/foo.git
+ EOF
+
+ test_cmp expect actual
+'
+
test_expect_success 'create innocent subrepo' '
git init innocent &&
git -C innocent commit --allow-empty -m foo
@@ -232,7 +264,7 @@ test_expect_success 'fsck detects non-blob .gitmodules' '
git ls-tree HEAD | sed s/subdir/.gitmodules/ | git mktree &&
test_must_fail git fsck 2>output &&
- test_i18ngrep gitmodulesBlob output
+ test_grep gitmodulesBlob output
)
'
@@ -246,8 +278,8 @@ test_expect_success 'fsck detects corrupt .gitmodules' '
git commit -m "broken gitmodules" &&
git fsck 2>output &&
- test_i18ngrep gitmodulesParse output &&
- test_i18ngrep ! "bad config" output
+ test_grep gitmodulesParse output &&
+ test_grep ! "bad config" output
)
'
@@ -269,7 +301,7 @@ test_expect_success WINDOWS 'prevent git~1 squatting on Windows' '
hash="$(echo x | git hash-object -w --stdin)" &&
test_must_fail git update-index --add \
--cacheinfo 160000,$rev,d\\a 2>err &&
- test_i18ngrep "Invalid path" err &&
+ test_grep "Invalid path" err &&
git -c core.protectNTFS=false update-index --add \
--cacheinfo 100644,$modules,.gitmodules \
--cacheinfo 160000,$rev,c \
@@ -283,7 +315,7 @@ test_expect_success WINDOWS 'prevent git~1 squatting on Windows' '
then
test_must_fail git -c core.protectNTFS=false \
clone --recurse-submodules squatting squatting-clone 2>err &&
- test_i18ngrep -e "directory not empty" -e "not an empty directory" err &&
+ test_grep -e "directory not empty" -e "not an empty directory" err &&
! grep gitdir squatting-clone/d/a/git~2
fi
'
@@ -308,7 +340,7 @@ test_expect_success 'git dirs of sibling submodules must not be nested' '
git commit -m nested
) &&
test_must_fail git clone --recurse-submodules nested clone 2>err &&
- test_i18ngrep "is inside git dir" err
+ test_grep "is inside git dir" err
'
test_done
diff --git a/t/t7500-commit-template-squash-signoff.sh b/t/t7500-commit-template-squash-signoff.sh
index 5fcaa0b..4dca8d9 100755
--- a/t/t7500-commit-template-squash-signoff.sh
+++ b/t/t7500-commit-template-squash-signoff.sh
@@ -555,7 +555,7 @@ test_expect_success 'commit without staging files fails and displays hints' '
git commit -m initial &&
echo "changes" >>file &&
test_must_fail git commit -m update >actual &&
- test_i18ngrep "no changes added to commit (use \"git add\" and/or \"git commit -a\")" actual
+ test_grep "no changes added to commit (use \"git add\" and/or \"git commit -a\")" actual
'
test_done
diff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh
index fb5417d..cc12f99 100755
--- a/t/t7501-commit-basic-functionality.sh
+++ b/t/t7501-commit-basic-functionality.sh
@@ -3,8 +3,7 @@
# Copyright (c) 2007 Kristian Høgsberg <krh@redhat.com>
#
-# FIXME: Test the various index usages, -i and -o, test reflog,
-# signoff
+# FIXME: Test the various index usages, test reflog
test_description='git commit'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
@@ -21,7 +20,7 @@ test_expect_success 'initial status' '
echo bongo bongo >file &&
git add file &&
git status >actual &&
- test_i18ngrep "No commits yet" actual
+ test_grep "No commits yet" actual
'
test_expect_success 'fail initial amend' '
@@ -92,6 +91,20 @@ test_expect_success '--long fails with nothing to commit' '
test_must_fail git commit -m initial --long
'
+test_expect_success 'fail to commit untracked file (even with --include/--only)' '
+ echo content >baz &&
+ error="error: pathspec .baz. did not match any file(s) known to git" &&
+
+ test_must_fail git commit -m "baz" baz 2>err &&
+ test_grep -e "$error" err &&
+
+ test_must_fail git commit --only -m "baz" baz 2>err &&
+ test_grep -e "$error" err &&
+
+ test_must_fail git commit --include -m "baz" baz 2>err &&
+ test_grep -e "$error" err
+'
+
test_expect_success 'setup: non-initial commit' '
echo bongo bongo bongo >file &&
git commit -m next -a
@@ -117,6 +130,51 @@ test_expect_success '--long with stuff to commit returns ok' '
git commit -m next -a --long
'
+for opt in "" "-o" "--only"
+do
+ test_expect_success 'exclude additional staged changes when given pathspec' '
+ echo content >>file &&
+ echo content >>baz &&
+ git add baz &&
+ git commit $opt -m "file" file &&
+
+ git diff --name-only >actual &&
+ test_must_be_empty actual &&
+
+ test_write_lines baz >expect &&
+ git diff --name-only --cached >actual &&
+ test_cmp expect actual &&
+
+ test_write_lines file >expect &&
+ git diff --name-only HEAD^ HEAD >actual &&
+ test_cmp expect actual
+ '
+done
+
+test_expect_success '-i/--include includes staged changes' '
+ echo content >>file &&
+ echo content >>baz &&
+ git add file &&
+
+ # baz is in the index, therefore, it will be committed
+ git commit --include -m "file and baz" baz &&
+
+ git diff --name-only HEAD >remaining &&
+ test_must_be_empty remaining &&
+
+ test_write_lines baz file >expect &&
+ git diff --name-only HEAD^ HEAD >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success '--include and --only do not mix' '
+ test_when_finished "git reset --hard" &&
+ echo content >>file &&
+ echo content >>baz &&
+ test_must_fail git commit --include --only -m "file baz" file baz 2>actual &&
+ test_grep -e "fatal: options .-i/--include. and .-o/--only. cannot be used together" actual
+'
+
test_expect_success 'commit message from non-existing file' '
echo more bongo: bongo bongo bongo bongo >file &&
test_must_fail git commit -F gah -a
@@ -141,7 +199,7 @@ test_expect_success 'template "emptyness" check does not kick in with -F' '
test_expect_success 'template "emptyness" check' '
git checkout HEAD file && echo >>file && git add file &&
test_must_fail git commit -t file 2>err &&
- test_i18ngrep "did not edit" err
+ test_grep "did not edit" err
'
test_expect_success 'setup: commit message from file' '
@@ -389,6 +447,28 @@ test_expect_success 'amend commit to fix date' '
'
+test_expect_success 'amend commit to add signoff' '
+
+ test_commit "msg" file content &&
+ git commit --amend --signoff &&
+ test_commit_message HEAD <<-EOF
+ msg
+
+ Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>
+ EOF
+'
+
+test_expect_success 'amend does not add signoff if it already exists' '
+
+ test_commit --signoff "tenor" file newcontent &&
+ git commit --amend --signoff &&
+ test_commit_message HEAD <<-EOF
+ tenor
+
+ Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>
+ EOF
+'
+
test_expect_success 'commit mentions forced date in output' '
git commit --amend --date=2010-01-02T03:04:05 >output &&
grep "Date: *Sat Jan 2 03:04:05 2010" output
@@ -671,7 +751,7 @@ test_expect_success 'commit a file whose name is a dash' '
git add ./- &&
test_tick &&
git commit -m "add dash" >output </dev/null &&
- test_i18ngrep " changed, 5 insertions" output
+ test_grep " changed, 5 insertions" output
'
test_expect_success '--only works on to-be-born branch' '
diff --git a/t/t7502-commit-porcelain.sh b/t/t7502-commit-porcelain.sh
index 38a532d..b37e201 100755
--- a/t/t7502-commit-porcelain.sh
+++ b/t/t7502-commit-porcelain.sh
@@ -466,6 +466,43 @@ test_expect_success 'commit --trailer with -c and command' '
test_cmp expected actual
'
+test_expect_success 'commit --trailer not confused by --- separator' '
+ cat >msg <<-\EOF &&
+ subject
+
+ body with dashes
+ ---
+ in it
+ EOF
+ git commit --allow-empty --trailer="my-trailer: value" -F msg &&
+ {
+ cat msg &&
+ echo &&
+ echo "my-trailer: value"
+ } >expected &&
+ git cat-file commit HEAD >commit.msg &&
+ sed -e "1,/^\$/d" commit.msg >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'commit --trailer with --verbose' '
+ cat >msg <<-\EOF &&
+ subject
+
+ body
+ EOF
+ GIT_EDITOR=: git commit --edit -F msg --allow-empty \
+ --trailer="my-trailer: value" --verbose &&
+ {
+ cat msg &&
+ echo &&
+ echo "my-trailer: value"
+ } >expected &&
+ git cat-file commit HEAD >commit.msg &&
+ sed -e "1,/^\$/d" commit.msg >actual &&
+ test_cmp expected actual
+'
+
test_expect_success 'multiple -m' '
>negative &&
@@ -687,18 +724,23 @@ test_expect_success 'cleanup commit message (whitespace config, -m)' '
test_expect_success 'message shows author when it is not equal to committer' '
echo >>negative &&
git commit -e -m "sample" -a &&
- test_i18ngrep \
+ test_grep \
"^# Author: *A U Thor <author@example.com>\$" \
.git/COMMIT_EDITMSG
'
test_expect_success 'message shows date when it is explicitly set' '
git commit --allow-empty -e -m foo --date="2010-01-02T03:04:05" &&
- test_i18ngrep \
+ test_grep \
"^# Date: *Sat Jan 2 03:04:05 2010 +0000" \
.git/COMMIT_EDITMSG
'
+test_expect_success 'message does not have multiple scissors lines' '
+ git commit --cleanup=scissors -v --allow-empty -e -m foo &&
+ test $(grep -c -e "--- >8 ---" .git/COMMIT_EDITMSG) -eq 1
+'
+
test_expect_success AUTOIDENT 'message shows committer when it is automatic' '
echo >>negative &&
@@ -709,7 +751,7 @@ test_expect_success AUTOIDENT 'message shows committer when it is automatic' '
) &&
# the ident is calculated from the system, so we cannot
# check the actual value, only that it is there
- test_i18ngrep "^# Committer: " .git/COMMIT_EDITMSG
+ test_grep "^# Committer: " .git/COMMIT_EDITMSG
'
write_script .git/FAKE_EDITOR <<EOF
@@ -841,9 +883,9 @@ try_commit () {
GIT_EDITOR=.git/FAKE_EDITOR git commit -a $* $use_template &&
case "$use_template" in
'')
- test_i18ngrep ! "^## Custom template" .git/COMMIT_EDITMSG ;;
+ test_grep ! "^## Custom template" .git/COMMIT_EDITMSG ;;
*)
- test_i18ngrep "^## Custom template" .git/COMMIT_EDITMSG ;;
+ test_grep "^## Custom template" .git/COMMIT_EDITMSG ;;
esac
}
@@ -851,53 +893,53 @@ try_commit_status_combo () {
test_expect_success 'commit' '
try_commit "" &&
- test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+ test_grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --status' '
try_commit --status &&
- test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+ test_grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --no-status' '
try_commit --no-status &&
- test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
+ test_grep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit with commit.status = yes' '
test_config commit.status yes &&
try_commit "" &&
- test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+ test_grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit with commit.status = no' '
test_config commit.status no &&
try_commit "" &&
- test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
+ test_grep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --status with commit.status = yes' '
test_config commit.status yes &&
try_commit --status &&
- test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+ test_grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --no-status with commit.status = yes' '
test_config commit.status yes &&
try_commit --no-status &&
- test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
+ test_grep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --status with commit.status = no' '
test_config commit.status no &&
try_commit --status &&
- test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+ test_grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --no-status with commit.status = no' '
test_config commit.status no &&
try_commit --no-status &&
- test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
+ test_grep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
}
@@ -911,13 +953,13 @@ try_commit_status_combo
test_expect_success 'commit --status with custom comment character' '
test_config core.commentchar ";" &&
try_commit --status &&
- test_i18ngrep "^; Changes to be committed:" .git/COMMIT_EDITMSG
+ test_grep "^; Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'switch core.commentchar' '
test_commit "#foo" foo &&
GIT_EDITOR=.git/FAKE_EDITOR git -c core.commentChar=auto commit --amend &&
- test_i18ngrep "^; Changes to be committed:" .git/COMMIT_EDITMSG
+ test_grep "^; Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'switch core.commentchar but out of options' '
diff --git a/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh b/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
index ad1eb64..aa004b7 100755
--- a/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
+++ b/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
@@ -5,6 +5,7 @@ test_description='pre-commit and pre-merge-commit hooks'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'root commit' '
diff --git a/t/t7504-commit-msg-hook.sh b/t/t7504-commit-msg-hook.sh
index a39de8c..d125522 100755
--- a/t/t7504-commit-msg-hook.sh
+++ b/t/t7504-commit-msg-hook.sh
@@ -5,6 +5,7 @@ test_description='commit-msg hook'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'with no hook' '
@@ -101,7 +102,9 @@ test_expect_success 'setup: commit-msg hook that always fails' '
'
commit_msg_is () {
- test "$(git log --pretty=format:%s%b -1)" = "$1"
+ printf "%s" "$1" >expect &&
+ git log --pretty=format:%s%b -1 >actual &&
+ test_cmp expect actual
}
test_expect_success 'with failing hook' '
diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
index 3fcb447..46566d5 100755
--- a/t/t7506-status-submodule.sh
+++ b/t/t7506-status-submodule.sh
@@ -2,6 +2,7 @@
test_description='git status for submodule'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_create_repo_with_commit () {
@@ -36,19 +37,19 @@ test_expect_success 'setup' '
test_expect_success 'status clean' '
git status >output &&
- test_i18ngrep "nothing to commit" output
+ test_grep "nothing to commit" output
'
test_expect_success 'commit --dry-run -a clean' '
test_must_fail git commit --dry-run -a >output &&
- test_i18ngrep "nothing to commit" output
+ test_grep "nothing to commit" output
'
test_expect_success 'status with modified file in submodule' '
(cd sub && git reset --hard) &&
echo "changed" >sub/foo &&
git status >output &&
- test_i18ngrep "modified: sub (modified content)" output
+ test_grep "modified: sub (modified content)" output
'
test_expect_success 'status with modified file in submodule (porcelain)' '
@@ -72,7 +73,7 @@ test_expect_success 'status with modified file in submodule (short)' '
test_expect_success 'status with added file in submodule' '
(cd sub && git reset --hard && echo >foo && git add foo) &&
git status >output &&
- test_i18ngrep "modified: sub (modified content)" output
+ test_grep "modified: sub (modified content)" output
'
test_expect_success 'status with added file in submodule (porcelain)' '
@@ -95,12 +96,12 @@ test_expect_success 'status with untracked file in submodule' '
(cd sub && git reset --hard) &&
echo "content" >sub/new-file &&
git status >output &&
- test_i18ngrep "modified: sub (untracked content)" output
+ test_grep "modified: sub (untracked content)" output
'
test_expect_success 'status -uno with untracked file in submodule' '
git status -uno >output &&
- test_i18ngrep "^nothing to commit" output
+ test_grep "^nothing to commit" output
'
test_expect_success 'status with untracked file in submodule (porcelain)' '
@@ -121,7 +122,7 @@ test_expect_success 'status with added and untracked file in submodule' '
(cd sub && git reset --hard && echo >foo && git add foo) &&
echo "content" >sub/new-file &&
git status >output &&
- test_i18ngrep "modified: sub (modified content, untracked content)" output
+ test_grep "modified: sub (modified content, untracked content)" output
'
test_expect_success 'status with added and untracked file in submodule (porcelain)' '
@@ -139,7 +140,7 @@ test_expect_success 'status with modified file in modified submodule' '
(cd sub && echo "next change" >foo && git commit -m "next change" foo) &&
echo "changed" >sub/foo &&
git status >output &&
- test_i18ngrep "modified: sub (new commits, modified content)" output
+ test_grep "modified: sub (new commits, modified content)" output
'
test_expect_success 'status with modified file in modified submodule (porcelain)' '
@@ -154,7 +155,7 @@ test_expect_success 'status with modified file in modified submodule (porcelain)
test_expect_success 'status with added file in modified submodule' '
(cd sub && git reset --hard && echo >foo && git add foo) &&
git status >output &&
- test_i18ngrep "modified: sub (new commits, modified content)" output
+ test_grep "modified: sub (new commits, modified content)" output
'
test_expect_success 'status with added file in modified submodule (porcelain)' '
@@ -169,7 +170,7 @@ test_expect_success 'status with untracked file in modified submodule' '
(cd sub && git reset --hard) &&
echo "content" >sub/new-file &&
git status >output &&
- test_i18ngrep "modified: sub (new commits, untracked content)" output
+ test_grep "modified: sub (new commits, untracked content)" output
'
test_expect_success 'status with untracked file in modified submodule (porcelain)' '
@@ -183,7 +184,7 @@ test_expect_success 'status with added and untracked file in modified submodule'
(cd sub && git reset --hard && echo >foo && git add foo) &&
echo "content" >sub/new-file &&
git status >output &&
- test_i18ngrep "modified: sub (new commits, modified content, untracked content)" output
+ test_grep "modified: sub (new commits, modified content, untracked content)" output
'
test_expect_success 'status with added and untracked file in modified submodule (porcelain)' '
@@ -208,7 +209,7 @@ test_expect_success 'setup .git file for sub' '
test_expect_success 'status with added file in modified submodule with .git file' '
(cd sub && git reset --hard && echo >foo && git add foo) &&
git status >output &&
- test_i18ngrep "modified: sub (new commits, modified content)" output
+ test_grep "modified: sub (new commits, modified content)" output
'
test_expect_success 'status with a lot of untracked files in the submodule' '
@@ -233,12 +234,12 @@ test_expect_success 'rm submodule contents' '
test_expect_success 'status clean (empty submodule dir)' '
git status >output &&
- test_i18ngrep "nothing to commit" output
+ test_grep "nothing to commit" output
'
test_expect_success 'status -a clean (empty submodule dir)' '
test_must_fail git commit --dry-run -a >output &&
- test_i18ngrep "nothing to commit" output
+ test_grep "nothing to commit" output
'
cat >status_expect <<\EOF
@@ -251,6 +252,7 @@ test_expect_success 'status with merge conflict in .gitmodules' '
test_create_repo_with_commit sub1 &&
test_tick &&
test_create_repo_with_commit sub2 &&
+ test_config_global protocol.file.allow always &&
(
cd super &&
prev=$(git rev-parse HEAD) &&
@@ -326,6 +328,7 @@ test_expect_success 'diff --submodule with merge conflict in .gitmodules' '
# sub2 will have an untracked file
# sub3 will have an untracked repository
test_expect_success 'setup superproject with untracked file in nested submodule' '
+ test_config_global protocol.file.allow always &&
(
cd super &&
git clean -dfx &&
diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh
index ed2653d..4c7db19 100755
--- a/t/t7507-commit-verbose.sh
+++ b/t/t7507-commit-verbose.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='verbose commit template'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
write_script "check-for-diff" <<\EOF &&
@@ -74,6 +76,7 @@ test_expect_success 'diff in message is retained with -v' '
test_expect_success 'submodule log is stripped out too with -v' '
git config diff.submodule log &&
+ test_config_global protocol.file.allow always &&
git submodule add ./. sub &&
git commit -m "sub added" &&
(
@@ -86,7 +89,7 @@ test_expect_success 'submodule log is stripped out too with -v' '
export GIT_EDITOR &&
test_must_fail git commit -a -v 2>err
) &&
- test_i18ngrep "Aborting commit due to empty commit message." err
+ test_grep "Aborting commit due to empty commit message." err
'
test_expect_success 'verbose diff is stripped out with set core.commentChar' '
@@ -95,7 +98,17 @@ test_expect_success 'verbose diff is stripped out with set core.commentChar' '
export GIT_EDITOR &&
test_must_fail git -c core.commentchar=";" commit -a -v 2>err
) &&
- test_i18ngrep "Aborting commit due to empty commit message." err
+ test_grep "Aborting commit due to empty commit message." err
+'
+
+test_expect_success 'verbose diff is stripped with multi-byte comment char' '
+ (
+ GIT_EDITOR=cat &&
+ export GIT_EDITOR &&
+ test_must_fail git -c core.commentchar="foo>" commit -a -v >out 2>err
+ ) &&
+ grep "^foo> " out &&
+ test_grep "Aborting commit due to empty commit message." err
'
test_expect_success 'status does not verbose without --verbose' '
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 2b7ef6c..773383f 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -5,6 +5,7 @@
test_description='git status'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-terminal.sh
@@ -18,7 +19,7 @@ test_expect_success 'status -h in broken repository' '
echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
test_expect_code 129 git status -h >usage 2>&1
) &&
- test_i18ngrep "[Uu]sage" broken/usage
+ test_grep "[Uu]sage" broken/usage
'
test_expect_success 'commit -h in broken repository' '
@@ -30,7 +31,7 @@ test_expect_success 'commit -h in broken repository' '
echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
test_expect_code 129 git commit -h >usage 2>&1
) &&
- test_i18ngrep "[Uu]sage" broken/usage
+ test_grep "[Uu]sage" broken/usage
'
test_expect_success 'create upstream branch' '
@@ -71,7 +72,7 @@ test_expect_success 'setup' '
'
test_expect_success 'status (1)' '
- test_i18ngrep "use \"git rm --cached <file>\.\.\.\" to unstage" output
+ test_grep "use \"git rm --cached <file>\.\.\.\" to unstage" output
'
strip_comments () {
@@ -91,7 +92,7 @@ test_expect_success 'status --column' '
# On branch main
# Your branch and '\''upstream'\'' have diverged,
# and have 1 and 2 different commits each, respectively.
-# (use "git pull" to merge the remote branch into yours)
+# (use "git pull" if you want to integrate the remote branch with yours)
#
# Changes to be committed:
# (use "git restore --staged <file>..." to unstage)
@@ -122,7 +123,7 @@ cat >expect <<\EOF
# On branch main
# Your branch and 'upstream' have diverged,
# and have 1 and 2 different commits each, respectively.
-# (use "git pull" to merge the remote branch into yours)
+# (use "git pull" if you want to integrate the remote branch with yours)
#
# Changes to be committed:
# (use "git restore --staged <file>..." to unstage)
@@ -269,7 +270,7 @@ test_expect_success 'status with gitignore' '
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 1 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
+ (use "git pull" if you want to integrate the remote branch with yours)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
@@ -334,7 +335,7 @@ test_expect_success 'status with gitignore (nothing untracked)' '
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 1 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
+ (use "git pull" if you want to integrate the remote branch with yours)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
@@ -404,7 +405,7 @@ test_expect_success 'status -uno' '
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 1 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
+ (use "git pull" if you want to integrate the remote branch with yours)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
@@ -418,14 +419,19 @@ Changes not staged for commit:
Untracked files not listed (use -u option to show untracked files)
EOF
git status -uno >output &&
+ test_cmp expect output &&
+ git status -ufalse >output &&
test_cmp expect output
'
-test_expect_success 'status (status.showUntrackedFiles no)' '
- test_config status.showuntrackedfiles no &&
- git status >output &&
- test_cmp expect output
-'
+for no in no false 0
+do
+ test_expect_success "status (status.showUntrackedFiles $no)" '
+ test_config status.showuntrackedfiles "$no" &&
+ git status >output &&
+ test_cmp expect output
+ '
+done
test_expect_success 'status -uno (advice.statusHints false)' '
cat >expect <<EOF &&
@@ -466,7 +472,7 @@ test_expect_success 'status -unormal' '
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 1 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
+ (use "git pull" if you want to integrate the remote branch with yours)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
@@ -487,14 +493,21 @@ Untracked files:
EOF
git status -unormal >output &&
+ test_cmp expect output &&
+ git status -utrue >output &&
+ test_cmp expect output &&
+ git status -uyes >output &&
test_cmp expect output
'
-test_expect_success 'status (status.showUntrackedFiles normal)' '
- test_config status.showuntrackedfiles normal &&
- git status >output &&
- test_cmp expect output
-'
+for normal in normal true 1
+do
+ test_expect_success "status (status.showUntrackedFiles $normal)" '
+ test_config status.showuntrackedfiles $normal &&
+ git status >output &&
+ test_cmp expect output
+ '
+done
cat >expect <<EOF
M dir1/modified
@@ -521,7 +534,7 @@ test_expect_success 'status -uall' '
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 1 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
+ (use "git pull" if you want to integrate the remote branch with yours)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
@@ -581,7 +594,7 @@ test_expect_success 'status with relative paths' '
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 1 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
+ (use "git pull" if you want to integrate the remote branch with yours)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
@@ -649,7 +662,7 @@ test_expect_success TTY 'status with color.ui' '
On branch <GREEN>main<RESET>
Your branch and '\''upstream'\'' have diverged,
and have 1 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
+ (use "git pull" if you want to integrate the remote branch with yours)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
@@ -772,7 +785,7 @@ test_expect_success 'status without relative paths' '
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 1 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
+ (use "git pull" if you want to integrate the remote branch with yours)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
@@ -846,7 +859,6 @@ test_expect_success 'dry-run of partial commit excluding new file in index' '
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 1 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
@@ -900,7 +912,7 @@ test_expect_success 'status submodule summary is disabled by default' '
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 1 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
+ (use "git pull" if you want to integrate the remote branch with yours)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
@@ -957,7 +969,7 @@ test_expect_success 'status submodule summary' '
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 1 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
+ (use "git pull" if you want to integrate the remote branch with yours)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
@@ -1012,11 +1024,11 @@ test_expect_success 'status -s submodule summary' '
'
test_expect_success 'status submodule summary (clean submodule): commit' '
- cat >expect <<EOF &&
+ cat >expect-status <<EOF &&
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 2 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
+ (use "git pull" if you want to integrate the remote branch with yours)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
@@ -1032,12 +1044,13 @@ Untracked files:
no changes added to commit (use "git add" and/or "git commit -a")
EOF
+ sed "/git pull/d" expect-status > expect-commit &&
git commit -m "commit submodule" &&
git config status.submodulesummary 10 &&
test_must_fail git commit --dry-run >output &&
- test_cmp expect output &&
+ test_cmp expect-commit output &&
git status >output &&
- test_cmp expect output
+ test_cmp expect-status output
'
cat >expect <<EOF
@@ -1064,7 +1077,6 @@ test_expect_success 'commit --dry-run submodule summary (--amend)' '
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 2 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
Changes to be committed:
(use "git restore --source=HEAD^1 --staged <file>..." to unstage)
@@ -1116,7 +1128,7 @@ test_expect_success '--ignore-submodules=untracked suppresses submodules with un
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 2 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
+ (use "git pull" if you want to integrate the remote branch with yours)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
@@ -1225,7 +1237,7 @@ test_expect_success "--ignore-submodules=untracked doesn't suppress submodules w
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 2 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
+ (use "git pull" if you want to integrate the remote branch with yours)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
@@ -1282,7 +1294,7 @@ test_expect_success "--ignore-submodules=untracked doesn't suppress submodule su
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 2 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
+ (use "git pull" if you want to integrate the remote branch with yours)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
@@ -1363,7 +1375,7 @@ cat > expect << EOF
; On branch main
; Your branch and 'upstream' have diverged,
; and have 2 and 2 different commits each, respectively.
-; (use "git pull" to merge the remote branch into yours)
+; (use "git pull" if you want to integrate the remote branch with yours)
;
; Changes to be committed:
; (use "git restore --staged <file>..." to unstage)
@@ -1403,7 +1415,9 @@ test_expect_success "status (core.commentchar with submodule summary)" '
test_expect_success "status (core.commentchar with two chars with submodule summary)" '
test_config core.commentchar ";;" &&
- test_must_fail git -c status.displayCommentPrefix=true status
+ sed "s/^/;/" <expect >expect.double &&
+ git -c status.displayCommentPrefix=true status >output &&
+ test_cmp expect.double output
'
test_expect_success "--ignore-submodules=all suppresses submodule summary" '
@@ -1411,7 +1425,7 @@ test_expect_success "--ignore-submodules=all suppresses submodule summary" '
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 2 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
+ (use "git pull" if you want to integrate the remote branch with yours)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
@@ -1437,7 +1451,7 @@ test_expect_success '.gitmodules ignore=all suppresses unstaged submodule summar
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 2 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
+ (use "git pull" if you want to integrate the remote branch with yours)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
@@ -1519,8 +1533,8 @@ test_expect_success '"status.branch=true" weaker than "--no-branch"' '
'
test_expect_success '"status.branch=true" weaker than "--porcelain"' '
- git -c status.branch=true status --porcelain >actual &&
- test_cmp expected_nobranch actual
+ git -c status.branch=true status --porcelain >actual &&
+ test_cmp expected_nobranch actual
'
test_expect_success '"status.branch=false" same as "--no-branch"' '
@@ -1542,12 +1556,12 @@ test_expect_success 'git commit will commit a staged but ignored submodule' '
git config --add -f .gitmodules submodule.subname.path sm &&
git config --add submodule.subname.ignore all &&
git status -s --ignore-submodules=dirty >output &&
- test_i18ngrep "^M. sm" output &&
+ test_grep "^M. sm" output &&
GIT_EDITOR="echo hello >>\"\$1\"" &&
export GIT_EDITOR &&
git commit -uno &&
git status -s --ignore-submodules=dirty >output &&
- test_i18ngrep ! "^M. sm" output
+ test_grep ! "^M. sm" output
'
test_expect_success 'git commit --dry-run will show a staged but ignored submodule' '
@@ -1557,7 +1571,6 @@ test_expect_success 'git commit --dry-run will show a staged but ignored submodu
On branch main
Your branch and '\''upstream'\'' have diverged,
and have 2 and 2 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
@@ -1573,13 +1586,13 @@ EOF
git commit -uno --dry-run >output &&
test_cmp expect output &&
git status -s --ignore-submodules=dirty >output &&
- test_i18ngrep "^M. sm" output
+ test_grep "^M. sm" output
'
test_expect_success 'git commit -m will commit a staged but ignored submodule' '
git commit -uno -m message &&
git status -s --ignore-submodules=dirty >output &&
- test_i18ngrep ! "^M. sm" output &&
+ test_grep ! "^M. sm" output &&
git config --remove-section submodule.subname &&
git config -f .gitmodules --remove-section submodule.subname
'
@@ -1592,7 +1605,7 @@ test_expect_success 'show stash info with "--show-stash"' '
git stash &&
git status >expected_default &&
git status --show-stash >expected_with_stash &&
- test_i18ngrep "^Your stash currently has 1 entry$" expected_with_stash
+ test_grep "^Your stash currently has 1 entry$" expected_with_stash
'
test_expect_success 'no stash info with "--show-stash --no-show-stash"' '
@@ -1619,14 +1632,14 @@ test_expect_success 'no additional info if no stash entries' '
test_expect_success '"No commits yet" should be noted in status output' '
git checkout --orphan empty-branch-1 &&
git status >output &&
- test_i18ngrep "No commits yet" output
+ test_grep "No commits yet" output
'
test_expect_success '"No commits yet" should not be noted in status output' '
git checkout --orphan empty-branch-2 &&
test_commit test-commit-1 &&
git status >output &&
- test_i18ngrep ! "No commits yet" output
+ test_grep ! "No commits yet" output
'
test_expect_success '"Initial commit" should be noted in commit template' '
@@ -1634,7 +1647,7 @@ test_expect_success '"Initial commit" should be noted in commit template' '
touch to_be_committed_1 &&
git add to_be_committed_1 &&
git commit --dry-run >output &&
- test_i18ngrep "Initial commit" output
+ test_grep "Initial commit" output
'
test_expect_success '"Initial commit" should not be noted in commit template' '
@@ -1643,7 +1656,7 @@ test_expect_success '"Initial commit" should not be noted in commit template' '
touch to_be_committed_2 &&
git add to_be_committed_2 &&
git commit --dry-run >output &&
- test_i18ngrep ! "Initial commit" output
+ test_grep ! "Initial commit" output
'
test_expect_success '--no-optional-locks prevents index update' '
@@ -1676,4 +1689,90 @@ test_expect_success 'racy timestamps will be fixed for dirty worktree' '
! test_is_magic_mtime .git/index
'
+test_expect_success 'setup slow status advice' '
+ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main git init slowstatus &&
+ (
+ cd slowstatus &&
+ cat >.gitignore <<-\EOF &&
+ /actual
+ /expected
+ /out
+ EOF
+ git add .gitignore &&
+ git commit -m "Add .gitignore" &&
+ git config advice.statusuoption true
+ )
+'
+
+test_expect_success 'slow status advice when core.untrackedCache and fsmonitor are unset' '
+ (
+ cd slowstatus &&
+ git config core.untrackedCache false &&
+ git config core.fsmonitor false &&
+ GIT_TEST_UF_DELAY_WARNING=1 git status >actual &&
+ cat >expected <<-\EOF &&
+ On branch main
+
+ It took 3.25 seconds to enumerate untracked files.
+ See '\''git help status'\'' for information on how to improve this.
+
+ nothing to commit, working tree clean
+ EOF
+ test_cmp expected actual
+ )
+'
+
+test_expect_success 'slow status advice when core.untrackedCache true, but not fsmonitor' '
+ (
+ cd slowstatus &&
+ git config core.untrackedCache true &&
+ git config core.fsmonitor false &&
+ GIT_TEST_UF_DELAY_WARNING=1 git status >actual &&
+ cat >expected <<-\EOF &&
+ On branch main
+
+ It took 3.25 seconds to enumerate untracked files.
+ See '\''git help status'\'' for information on how to improve this.
+
+ nothing to commit, working tree clean
+ EOF
+ test_cmp expected actual
+ )
+'
+
+test_expect_success 'slow status advice when core.untrackedCache true, and fsmonitor' '
+ (
+ cd slowstatus &&
+ git config core.untrackedCache true &&
+ git config core.fsmonitor true &&
+ GIT_TEST_UF_DELAY_WARNING=1 git status >actual &&
+ cat >expected <<-\EOF &&
+ On branch main
+
+ It took 3.25 seconds to enumerate untracked files,
+ but the results were cached, and subsequent runs may be faster.
+ See '\''git help status'\'' for information on how to improve this.
+
+ nothing to commit, working tree clean
+ EOF
+ test_cmp expected actual
+ )
+'
+
+test_expect_success EXPENSIVE 'status does not re-read unchanged 4 or 8 GiB file' '
+ (
+ mkdir large-file &&
+ cd large-file &&
+ # Files are 2 GiB, 4 GiB, and 8 GiB sparse files.
+ test-tool truncate file-a 0x080000000 &&
+ test-tool truncate file-b 0x100000000 &&
+ test-tool truncate file-c 0x200000000 &&
+ # This will be slow.
+ git add file-a file-b file-c &&
+ git commit -m "add large files" &&
+ git diff-index HEAD file-a file-b file-c >actual &&
+ test_must_be_empty actual
+ )
+'
+
test_done
diff --git a/t/t7509-commit-authorship.sh b/t/t7509-commit-authorship.sh
index 21c668f..fd8c8f8 100755
--- a/t/t7509-commit-authorship.sh
+++ b/t/t7509-commit-authorship.sh
@@ -99,20 +99,20 @@ test_expect_success '--amend option with empty author' '
echo "Empty author test" >>foo &&
test_tick &&
test_must_fail git commit -a -m "empty author" --amend 2>err &&
- test_i18ngrep "empty ident" err
+ test_grep "empty ident" err
'
test_expect_success '--amend option with missing author' '
git cat-file commit Initial >tmp &&
sed "s/author [^<]* </author </" tmp >malformed &&
- sha=$(git hash-object -t commit -w malformed) &&
+ sha=$(git hash-object --literally -t commit -w malformed) &&
test_when_finished "remove_object $sha" &&
git checkout $sha &&
test_when_finished "git checkout Initial" &&
echo "Missing author test" >>foo &&
test_tick &&
test_must_fail git commit -a -m "malformed author" --amend 2>err &&
- test_i18ngrep "empty ident" err
+ test_grep "empty ident" err
'
test_expect_success '--reset-author makes the commit ours even with --amend option' '
diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh
index 8593b7e..0d2dd29 100755
--- a/t/t7510-signed-commit.sh
+++ b/t/t7510-signed-commit.sh
@@ -202,7 +202,7 @@ test_expect_success GPG 'detect fudged signature with NUL' '
git cat-file commit seventh-signed >raw &&
cat raw >forged2 &&
echo Qwik | tr "Q" "\000" >>forged2 &&
- git hash-object -w -t commit forged2 >forged2.commit &&
+ git hash-object --literally -w -t commit forged2 >forged2.commit &&
test_must_fail git verify-commit $(cat forged2.commit) &&
git show --pretty=short --show-signature $(cat forged2.commit) >actual2 &&
grep "BAD signature from" actual2 &&
@@ -218,87 +218,101 @@ test_expect_success GPG 'amending already signed commit' '
! grep "BAD signature from" actual
'
+test_expect_success GPG2 'bare signature' '
+ git verify-commit fifth-signed 2>expect &&
+ echo >>expect &&
+ git log -1 --format="%GG" fifth-signed >actual &&
+ test_cmp expect actual
+'
+
test_expect_success GPG 'show good signature with custom format' '
cat >expect <<-\EOF &&
G
+ ultimate
13B6F51ECDDE430D
C O Mitter <committer@example.com>
73D758744BE721698EC54E8713B6F51ECDDE430D
73D758744BE721698EC54E8713B6F51ECDDE430D
EOF
- git log -1 --format="%G?%n%GK%n%GS%n%GF%n%GP" sixth-signed >actual &&
+ git log -1 --format="%G?%n%GT%n%GK%n%GS%n%GF%n%GP" sixth-signed >actual &&
test_cmp expect actual
'
test_expect_success GPG 'show bad signature with custom format' '
cat >expect <<-\EOF &&
B
+ undefined
13B6F51ECDDE430D
C O Mitter <committer@example.com>
EOF
- git log -1 --format="%G?%n%GK%n%GS%n%GF%n%GP" $(cat forged1.commit) >actual &&
+ git log -1 --format="%G?%n%GT%n%GK%n%GS%n%GF%n%GP" $(cat forged1.commit) >actual &&
test_cmp expect actual
'
test_expect_success GPG 'show untrusted signature with custom format' '
cat >expect <<-\EOF &&
U
+ undefined
65A0EEA02E30CAD7
Eris Discordia <discord@example.net>
F8364A59E07FFE9F4D63005A65A0EEA02E30CAD7
D4BE22311AD3131E5EDA29A461092E85B7227189
EOF
- git log -1 --format="%G?%n%GK%n%GS%n%GF%n%GP" eighth-signed-alt >actual &&
+ git log -1 --format="%G?%n%GT%n%GK%n%GS%n%GF%n%GP" eighth-signed-alt >actual &&
test_cmp expect actual
'
test_expect_success GPG 'show untrusted signature with undefined trust level' '
cat >expect <<-\EOF &&
+ U
undefined
65A0EEA02E30CAD7
Eris Discordia <discord@example.net>
F8364A59E07FFE9F4D63005A65A0EEA02E30CAD7
D4BE22311AD3131E5EDA29A461092E85B7227189
EOF
- git log -1 --format="%GT%n%GK%n%GS%n%GF%n%GP" eighth-signed-alt >actual &&
+ git log -1 --format="%G?%n%GT%n%GK%n%GS%n%GF%n%GP" eighth-signed-alt >actual &&
test_cmp expect actual
'
test_expect_success GPG 'show untrusted signature with ultimate trust level' '
cat >expect <<-\EOF &&
+ G
ultimate
13B6F51ECDDE430D
C O Mitter <committer@example.com>
73D758744BE721698EC54E8713B6F51ECDDE430D
73D758744BE721698EC54E8713B6F51ECDDE430D
EOF
- git log -1 --format="%GT%n%GK%n%GS%n%GF%n%GP" sixth-signed >actual &&
+ git log -1 --format="%G?%n%GT%n%GK%n%GS%n%GF%n%GP" sixth-signed >actual &&
test_cmp expect actual
'
test_expect_success GPG 'show unknown signature with custom format' '
cat >expect <<-\EOF &&
E
+ undefined
65A0EEA02E30CAD7
EOF
- GNUPGHOME="$GNUPGHOME_NOT_USED" git log -1 --format="%G?%n%GK%n%GS%n%GF%n%GP" eighth-signed-alt >actual &&
+ GNUPGHOME="$GNUPGHOME_NOT_USED" git log -1 --format="%G?%n%GT%n%GK%n%GS%n%GF%n%GP" eighth-signed-alt >actual &&
test_cmp expect actual
'
test_expect_success GPG 'show lack of signature with custom format' '
cat >expect <<-\EOF &&
N
+ undefined
EOF
- git log -1 --format="%G?%n%GK%n%GS%n%GF%n%GP" seventh-unsigned >actual &&
+ git log -1 --format="%G?%n%GT%n%GK%n%GS%n%GF%n%GP" seventh-unsigned >actual &&
test_cmp expect actual
'
@@ -387,4 +401,48 @@ test_expect_success GPG 'verify-commit verifies multiply signed commits' '
! grep "BAD signature from" actual
'
+test_expect_success 'custom `gpg.program`' '
+ write_script fake-gpg <<-\EOF &&
+ args="$*"
+
+ # skip uninteresting options
+ while case "$1" in
+ --status-fd=*|--keyid-format=*) ;; # skip
+ *) break;;
+ esac; do shift; done
+
+ case "$1" in
+ -bsau)
+ test -z "$LET_GPG_PROGRAM_FAIL" || {
+ echo "zOMG signing failed!" >&2
+ exit 1
+ }
+ cat >sign.file
+ echo "[GNUPG:] SIG_CREATED $args" >&2
+ echo "-----BEGIN PGP MESSAGE-----"
+ echo "$args"
+ echo "-----END PGP MESSAGE-----"
+ ;;
+ --verify)
+ cat "$2" >verify.file
+ exit 0
+ ;;
+ *)
+ echo "Unhandled args: $*" >&2
+ exit 1
+ ;;
+ esac
+ EOF
+
+ test_config gpg.program "$(pwd)/fake-gpg" &&
+ git commit -S --allow-empty -m signed-commit &&
+ test_path_exists sign.file &&
+ git show --show-signature &&
+ test_path_exists verify.file &&
+
+ test_must_fail env LET_GPG_PROGRAM_FAIL=1 \
+ git commit -S --allow-empty -m must-fail 2>err &&
+ grep zOMG err
+'
+
test_done
diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 2f16d57..802f8f7 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -692,6 +692,34 @@ EOF
'
+test_expect_success 'status when bisecting while rebasing' '
+ git reset --hard main &&
+ test_when_finished "git rebase --abort" &&
+ ONTO=$(git rev-parse --short HEAD^) &&
+ FAKE_LINES="break" git rebase -i HEAD^ &&
+ test_when_finished "git checkout -" &&
+ git checkout -b bisect_while_rebasing &&
+ test_when_finished "git bisect reset" &&
+ git bisect start &&
+ cat >expected <<EOF &&
+On branch bisect_while_rebasing
+Last command done (1 command done):
+ break
+No commands remaining.
+You are currently editing a commit while rebasing branch '\''bisect'\'' on '\''$ONTO'\''.
+ (use "git commit --amend" to amend the current commit)
+ (use "git rebase --continue" once you are satisfied with your changes)
+
+You are currently bisecting, started from branch '\''bisect_while_rebasing'\''.
+ (use "git bisect reset" to get back to the original branch)
+
+nothing to commit (use -u to show untracked files)
+EOF
+ git status --untracked-files=no >actual &&
+ test_cmp expected actual
+'
+
+
test_expect_success 'status when rebase --apply conflicts with statushints disabled' '
git reset --hard main &&
git checkout -b statushints_disabled &&
@@ -774,6 +802,28 @@ EOF
test_cmp expected actual
'
+test_expect_success 'status when cherry-picking multiple commits' '
+ git reset --hard cherry_branch &&
+ test_when_finished "git cherry-pick --abort" &&
+ test_must_fail git cherry-pick cherry_branch_second one_cherry &&
+ TO_CHERRY_PICK=$(git rev-parse --short CHERRY_PICK_HEAD) &&
+ cat >expected <<EOF &&
+On branch cherry_branch
+You are currently cherry-picking commit $TO_CHERRY_PICK.
+ (fix conflicts and run "git cherry-pick --continue")
+ (use "git cherry-pick --skip" to skip this patch)
+ (use "git cherry-pick --abort" to cancel the cherry-pick operation)
+
+Unmerged paths:
+ (use "git add <file>..." to mark resolution)
+ both modified: main.txt
+
+no changes added to commit (use "git add" and/or "git commit -a")
+EOF
+ git status --untracked-files=no >actual &&
+ test_cmp expected actual
+'
+
test_expect_success 'status when cherry-picking after committing conflict resolution' '
git reset --hard cherry_branch &&
test_when_finished "git cherry-pick --abort" &&
diff --git a/t/t7513-interpret-trailers.sh b/t/t7513-interpret-trailers.sh
index 97f1090..3d3e13c 100755
--- a/t/t7513-interpret-trailers.sh
+++ b/t/t7513-interpret-trailers.sh
@@ -489,7 +489,7 @@ test_expect_success 'multiline field treated as atomic for neighbor check' '
'
test_expect_success 'with config setup' '
- git config trailer.ack.key "Acked-by: " &&
+ test_config trailer.ack.key "Acked-by: " &&
cat >expected <<-\EOF &&
Acked-by: Peff
@@ -503,8 +503,8 @@ test_expect_success 'with config setup' '
'
test_expect_success 'with config setup and ":=" as separators' '
- git config trailer.separators ":=" &&
- git config trailer.ack.key "Acked-by= " &&
+ test_config trailer.separators ":=" &&
+ test_config trailer.ack.key "Acked-by= " &&
cat >expected <<-\EOF &&
Acked-by= Peff
@@ -518,7 +518,7 @@ test_expect_success 'with config setup and ":=" as separators' '
'
test_expect_success 'with config setup and "%" as separators' '
- git config trailer.separators "%" &&
+ test_config trailer.separators "%" &&
cat >expected <<-\EOF &&
bug% 42
@@ -532,6 +532,7 @@ test_expect_success 'with config setup and "%" as separators' '
'
test_expect_success 'with "%" as separators and a message with trailers' '
+ test_config trailer.separators "%" &&
cat >special_message <<-\EOF &&
Special Message
@@ -553,8 +554,8 @@ test_expect_success 'with "%" as separators and a message with trailers' '
'
test_expect_success 'with config setup and ":=#" as separators' '
- git config trailer.separators ":=#" &&
- git config trailer.bug.key "Bug #" &&
+ test_config trailer.separators ":=#" &&
+ test_config trailer.bug.key "Bug #" &&
cat >expected <<-\EOF &&
Bug #42
@@ -581,6 +582,8 @@ test_expect_success 'with basic patch' '
'
test_expect_success 'with commit complex message as argument' '
+ test_config trailer.separators ":=" &&
+ test_config trailer.ack.key "Acked-by= " &&
cat complex_message_body complex_message_trailers >complex_message &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
@@ -594,6 +597,8 @@ test_expect_success 'with commit complex message as argument' '
'
test_expect_success 'with 2 files arguments' '
+ test_config trailer.separators ":=" &&
+ test_config trailer.ack.key "Acked-by= " &&
cat basic_message >>expected &&
echo >>expected &&
cat basic_patch >>expected &&
@@ -677,6 +682,9 @@ test_expect_success 'with message that has an old style conflict block' '
'
test_expect_success 'with commit complex message and trailer args' '
+ test_config trailer.separators ":=#" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.bug.key "Bug #" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Fixes: Z
@@ -692,6 +700,9 @@ test_expect_success 'with commit complex message and trailer args' '
'
test_expect_success 'with complex patch, args and --trim-empty' '
+ test_config trailer.separators ":=#" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.bug.key "Bug #" &&
cat complex_message >complex_patch &&
cat basic_patch >>complex_patch &&
cat complex_message_body >expected &&
@@ -746,7 +757,10 @@ test_expect_success POSIXPERM,SANITY "in-place editing doesn't clobber original
'
test_expect_success 'using "where = before"' '
- git config trailer.bug.where "before" &&
+ test_config trailer.separators ":=#" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -762,7 +776,9 @@ test_expect_success 'using "where = before"' '
'
test_expect_success 'overriding configuration with "--where after"' '
- git config trailer.ack.where "before" &&
+ test_config trailer.separators ":=" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "before" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Fixes: Z
@@ -776,7 +792,12 @@ test_expect_success 'overriding configuration with "--where after"' '
test_cmp expected actual
'
-test_expect_success 'using "where = before" with "--no-where"' '
+test_expect_success 'using "--where after" with "--no-where"' '
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "before" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -791,8 +812,59 @@ test_expect_success 'using "where = before" with "--no-where"' '
test_cmp expected actual
'
+# Check whether using "--no-where" clears out only the "--where after", such
+# that we still use the configuration in trailer.where (which is different from
+# the hardcoded default (in WHERE_END) assuming the absence of .gitconfig).
+# Here, the "start" setting of trailer.where is respected, so the new "Acked-by"
+# and "Bug" trailers are placed at the beginning, and not at the end which is
+# the harcoded default.
+test_expect_success 'using "--where after" with "--no-where" defaults to configuration' '
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.separators ":=#" &&
+ test_config trailer.where "start" &&
+ cat complex_message_body >expected &&
+ sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
+ Bug #42
+ Acked-by= Peff
+ Fixes: Z
+ Acked-by= Z
+ Reviewed-by: Z
+ Signed-off-by: Z
+ EOF
+ git interpret-trailers --where after --no-where --trailer "ack: Peff" \
+ --trailer "bug: 42" complex_message >actual &&
+ test_cmp expected actual
+'
+
+# The "--where after" will only get respected for the trailer that came
+# immediately after it. For the next trailer (Bug #42), we default to using the
+# hardcoded WHERE_END because we don't have any "trailer.where" or
+# "trailer.bug.where" configured.
+test_expect_success 'using "--no-where" defaults to harcoded default if nothing configured' '
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.separators ":=#" &&
+ cat complex_message_body >expected &&
+ sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
+ Fixes: Z
+ Acked-by= Z
+ Acked-by= Peff
+ Reviewed-by: Z
+ Signed-off-by: Z
+ Bug #42
+ EOF
+ git interpret-trailers --where after --trailer "ack: Peff" --no-where \
+ --trailer "bug: 42" complex_message >actual &&
+ test_cmp expected actual
+'
+
test_expect_success 'using "where = after"' '
- git config trailer.ack.where "after" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -808,8 +880,11 @@ test_expect_success 'using "where = after"' '
'
test_expect_success 'using "where = end"' '
- git config trailer.review.key "Reviewed-by" &&
- git config trailer.review.where "end" &&
+ test_config trailer.review.key "Reviewed-by" &&
+ test_config trailer.review.where "end" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.separators ":=" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Fixes: Z
@@ -827,8 +902,11 @@ test_expect_success 'using "where = end"' '
'
test_expect_success 'using "where = start"' '
- git config trailer.review.key "Reviewed-by" &&
- git config trailer.review.where "start" &&
+ test_config trailer.review.key "Reviewed-by" &&
+ test_config trailer.review.where "start" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.separators ":=" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Reviewed-by: Johannes
@@ -846,8 +924,13 @@ test_expect_success 'using "where = start"' '
'
test_expect_success 'using "where = before" for a token in the middle of the message' '
- git config trailer.review.key "Reviewed-by:" &&
- git config trailer.review.where "before" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.review.where "before" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -864,6 +947,12 @@ test_expect_success 'using "where = before" for a token in the middle of the mes
'
test_expect_success 'using "where = before" and --trim-empty' '
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
cat >>expected <<-\EOF &&
Bug #46
@@ -878,6 +967,13 @@ test_expect_success 'using "where = before" and --trim-empty' '
'
test_expect_success 'the default is "ifExists = addIfDifferentNeighbor"' '
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.review.where "before" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -896,7 +992,13 @@ test_expect_success 'the default is "ifExists = addIfDifferentNeighbor"' '
'
test_expect_success 'default "ifExists" is now "addIfDifferent"' '
- git config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -914,8 +1016,14 @@ test_expect_success 'default "ifExists" is now "addIfDifferent"' '
'
test_expect_success 'using "ifExists = addIfDifferent" with "where = end"' '
- git config trailer.ack.ifExists "addIfDifferent" &&
- git config trailer.ack.where "end" &&
+ test_config trailer.ack.ifExists "addIfDifferent" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "end" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -932,8 +1040,14 @@ test_expect_success 'using "ifExists = addIfDifferent" with "where = end"' '
'
test_expect_success 'using "ifExists = addIfDifferent" with "where = before"' '
- git config trailer.ack.ifExists "addIfDifferent" &&
- git config trailer.ack.where "before" &&
+ test_config trailer.ack.ifExists "addIfDifferent" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "before" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -950,8 +1064,14 @@ test_expect_success 'using "ifExists = addIfDifferent" with "where = before"' '
'
test_expect_success 'using "ifExists = addIfDifferentNeighbor" with "where = end"' '
- git config trailer.ack.ifExists "addIfDifferentNeighbor" &&
- git config trailer.ack.where "end" &&
+ test_config trailer.ack.ifExists "addIfDifferentNeighbor" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "end" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -973,8 +1093,14 @@ test_expect_success 'using "ifExists = addIfDifferentNeighbor" with "where = end
'
test_expect_success 'using "ifExists = addIfDifferentNeighbor" with "where = after"' '
- git config trailer.ack.ifExists "addIfDifferentNeighbor" &&
- git config trailer.ack.where "after" &&
+ test_config trailer.ack.ifExists "addIfDifferentNeighbor" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -995,7 +1121,11 @@ test_expect_success 'using "ifExists = addIfDifferentNeighbor" with "where = af
'
test_expect_success 'using "ifExists = addIfDifferentNeighbor" and --trim-empty' '
- git config trailer.ack.ifExists "addIfDifferentNeighbor" &&
+ test_config trailer.ack.ifExists "addIfDifferentNeighbor" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
cat >>expected <<-\EOF &&
Bug #42
@@ -1011,8 +1141,14 @@ test_expect_success 'using "ifExists = addIfDifferentNeighbor" and --trim-empty'
'
test_expect_success 'using "ifExists = add" with "where = end"' '
- git config trailer.ack.ifExists "add" &&
- git config trailer.ack.where "end" &&
+ test_config trailer.ack.ifExists "add" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "end" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -1036,8 +1172,14 @@ test_expect_success 'using "ifExists = add" with "where = end"' '
'
test_expect_success 'using "ifExists = add" with "where = after"' '
- git config trailer.ack.ifExists "add" &&
- git config trailer.ack.where "after" &&
+ test_config trailer.ack.ifExists "add" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -1058,8 +1200,15 @@ test_expect_success 'using "ifExists = add" with "where = after"' '
'
test_expect_success 'overriding configuration with "--if-exists replace"' '
- git config trailer.fix.key "Fixes: " &&
- git config trailer.fix.ifExists "add" &&
+ test_config trailer.fix.key "Fixes: " &&
+ test_config trailer.fix.ifExists "add" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.review.where "before" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -1074,9 +1223,66 @@ test_expect_success 'overriding configuration with "--if-exists replace"' '
test_cmp expected actual
'
+# "trailer.ifexists" is set to "doNothing", so using "--no-if-exists" defaults
+# to this "doNothing" behavior. So the "Fixes: 53" trailer does not get added.
+test_expect_success 'using "--if-exists replace" with "--no-if-exists" defaults to configuration' '
+ test_config trailer.ifexists "doNothing" &&
+ cat complex_message_body >expected &&
+ sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
+ Fixes: Z
+ Acked-by: Z
+ Reviewed-by: Z
+ Signed-off-by: Z
+ EOF
+ git interpret-trailers --if-exists replace --no-if-exists --trailer "Fixes: 53" \
+ <complex_message >actual &&
+ test_cmp expected actual
+'
+
+# No "ifexists" configuration is set, so using "--no-if-exists" makes it default
+# to addIfDifferentNeighbor. Because we do have a different neighbor "Fixes: 53"
+# (because it got added by overriding with "--if-exists replace" earlier in the
+# arguments list), we add "Signed-off-by: addme".
+test_expect_success 'using "--no-if-exists" defaults to hardcoded default if nothing configured' '
+ cat complex_message_body >expected &&
+ sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
+ Acked-by: Z
+ Reviewed-by: Z
+ Signed-off-by: Z
+ Fixes: 53
+ Signed-off-by: addme
+ EOF
+ git interpret-trailers --if-exists replace --trailer "Fixes: 53" --no-if-exists \
+ --trailer "Signed-off-by: addme" <complex_message >actual &&
+ test_cmp expected actual
+'
+
+# The second "Fixes: 53" trailer is discarded, because the "--no-if-exists" here
+# makes us default to addIfDifferentNeighbor, and we already added the "Fixes:
+# 53" trailer earlier in the argument list.
+test_expect_success 'using "--no-if-exists" defaults to hardcoded default if nothing configured (no addition)' '
+ cat complex_message_body >expected &&
+ sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
+ Acked-by: Z
+ Reviewed-by: Z
+ Signed-off-by: Z
+ Fixes: 53
+ EOF
+ git interpret-trailers --if-exists replace --trailer "Fixes: 53" --no-if-exists \
+ --trailer "Fixes: 53" <complex_message >actual &&
+ test_cmp expected actual
+'
+
test_expect_success 'using "ifExists = replace"' '
- git config trailer.fix.key "Fixes: " &&
- git config trailer.fix.ifExists "replace" &&
+ test_config trailer.fix.key "Fixes: " &&
+ test_config trailer.fix.ifExists "replace" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -1095,7 +1301,16 @@ test_expect_success 'using "ifExists = replace"' '
'
test_expect_success 'using "ifExists = replace" with "where = after"' '
- git config trailer.fix.where "after" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.fix.key "Fixes: " &&
+ test_config trailer.fix.ifExists "replace" &&
+ test_config trailer.fix.where "after" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -1114,7 +1329,15 @@ test_expect_success 'using "ifExists = replace" with "where = after"' '
'
test_expect_success 'using "ifExists = doNothing"' '
- git config trailer.fix.ifExists "doNothing" &&
+ test_config trailer.fix.ifExists "doNothing" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.fix.key "Fixes: " &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -1133,8 +1356,17 @@ test_expect_success 'using "ifExists = doNothing"' '
'
test_expect_success 'the default is "ifMissing = add"' '
- git config trailer.cc.key "Cc: " &&
- git config trailer.cc.where "before" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.cc.key "Cc: " &&
+ test_config trailer.cc.where "before" &&
+ test_config trailer.fix.key "Fixes: " &&
+ test_config trailer.fix.ifExists "doNothing" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -1154,7 +1386,14 @@ test_expect_success 'the default is "ifMissing = add"' '
'
test_expect_success 'overriding configuration with "--if-missing doNothing"' '
- git config trailer.ifmissing "add" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.fix.key "Fixes: " &&
+ test_config trailer.fix.ifExists "doNothing" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.ifmissing "add" &&
+ test_config trailer.separators ":=" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Fixes: Z
@@ -1173,7 +1412,13 @@ test_expect_success 'overriding configuration with "--if-missing doNothing"' '
'
test_expect_success 'when default "ifMissing" is "doNothing"' '
- git config trailer.ifmissing "doNothing" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.fix.ifExists "doNothing" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.ifmissing "doNothing" &&
+ test_config trailer.separators ":=" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Fixes: Z
@@ -1187,14 +1432,21 @@ test_expect_success 'when default "ifMissing" is "doNothing"' '
--trailer "cc=Linus" --trailer "ack: Junio" \
--trailer "fix=22" --trailer "bug: 42" --trailer "ack: Peff" \
<complex_message >actual &&
- test_cmp expected actual &&
- git config trailer.ifmissing "add"
+ test_cmp expected actual
'
test_expect_success 'using "ifMissing = add" with "where = end"' '
- git config trailer.cc.key "Cc: " &&
- git config trailer.cc.where "end" &&
- git config trailer.cc.ifMissing "add" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.cc.key "Cc: " &&
+ test_config trailer.cc.ifMissing "add" &&
+ test_config trailer.cc.where "end" &&
+ test_config trailer.fix.ifExists "doNothing" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -1214,9 +1466,17 @@ test_expect_success 'using "ifMissing = add" with "where = end"' '
'
test_expect_success 'using "ifMissing = add" with "where = before"' '
- git config trailer.cc.key "Cc: " &&
- git config trailer.cc.where "before" &&
- git config trailer.cc.ifMissing "add" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.cc.key "Cc: " &&
+ test_config trailer.cc.ifMissing "add" &&
+ test_config trailer.cc.where "before" &&
+ test_config trailer.fix.ifExists "doNothing" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Cc: Linus
@@ -1236,7 +1496,15 @@ test_expect_success 'using "ifMissing = add" with "where = before"' '
'
test_expect_success 'using "ifMissing = doNothing"' '
- git config trailer.cc.ifMissing "doNothing" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.cc.ifMissing "doNothing" &&
+ test_config trailer.fix.ifExists "doNothing" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -1254,9 +1522,50 @@ test_expect_success 'using "ifMissing = doNothing"' '
test_cmp expected actual
'
+# Ignore the "IgnoredTrailer" because of "--if-missing doNothing", but also
+# ignore the "StillIgnoredTrailer" because we set "trailer.ifMissing" to
+# "doNothing" in configuration.
+test_expect_success 'using "--no-if-missing" defaults to configuration' '
+ test_config trailer.ifMissing "doNothing" &&
+ cat complex_message_body >expected &&
+ sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
+ Fixes: Z
+ Acked-by: Z
+ Reviewed-by: Z
+ Signed-off-by: Z
+ EOF
+ git interpret-trailers --if-missing doNothing --trailer "IgnoredTrailer: ignoreme" --no-if-missing \
+ --trailer "StillIgnoredTrailer: ignoreme" <complex_message >actual &&
+ test_cmp expected actual
+'
+
+# Add the "AddedTrailer" because the "--no-if-missing" clears the "--if-missing
+# doNothing" from earlier in the argument list.
+test_expect_success 'using "--no-if-missing" defaults to hardcoded default if nothing configured' '
+ cat complex_message_body >expected &&
+ sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
+ Fixes: Z
+ Acked-by: Z
+ Reviewed-by: Z
+ Signed-off-by: Z
+ AddedTrailer: addme
+ EOF
+ git interpret-trailers --if-missing doNothing --trailer "IgnoredTrailer: ignoreme" --no-if-missing \
+ --trailer "AddedTrailer: addme" <complex_message >actual &&
+ test_cmp expected actual
+'
+
test_expect_success 'default "where" is now "after"' '
git config trailer.where "after" &&
- git config --unset trailer.ack.where &&
+ test_config trailer.ack.ifExists "add" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.ack.where "after" &&
+ test_config trailer.bug.key "Bug #" &&
+ test_config trailer.bug.where "before" &&
+ test_config trailer.fix.ifExists "doNothing" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=#" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Bug #42
@@ -1280,10 +1589,15 @@ test_expect_success 'default "where" is now "after"' '
'
test_expect_success 'with simple command' '
- git config trailer.sign.key "Signed-off-by: " &&
- git config trailer.sign.where "after" &&
- git config trailer.sign.ifExists "addIfDifferentNeighbor" &&
- git config trailer.sign.command "echo \"A U Thor <author@example.com>\"" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.fix.ifExists "doNothing" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.sign.command "echo \"A U Thor <author@example.com>\"" &&
+ test_config trailer.sign.key "Signed-off-by: " &&
+ test_config trailer.sign.ifExists "addIfDifferentNeighbor" &&
+ test_config trailer.sign.where "after" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Fixes: Z
@@ -1298,8 +1612,14 @@ test_expect_success 'with simple command' '
'
test_expect_success 'with command using committer information' '
- git config trailer.sign.ifExists "addIfDifferent" &&
- git config trailer.sign.command "echo \"\$GIT_COMMITTER_NAME <\$GIT_COMMITTER_EMAIL>\"" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.fix.ifExists "doNothing" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.sign.command "echo \"\$GIT_COMMITTER_NAME <\$GIT_COMMITTER_EMAIL>\"" &&
+ test_config trailer.sign.key "Signed-off-by: " &&
+ test_config trailer.sign.ifExists "addIfDifferent" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Fixes: Z
@@ -1314,10 +1634,15 @@ test_expect_success 'with command using committer information' '
'
test_expect_success 'with command using author information' '
- git config trailer.sign.key "Signed-off-by: " &&
- git config trailer.sign.where "after" &&
- git config trailer.sign.ifExists "addIfDifferentNeighbor" &&
- git config trailer.sign.command "echo \"\$GIT_AUTHOR_NAME <\$GIT_AUTHOR_EMAIL>\"" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.fix.ifExists "doNothing" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.sign.command "echo \"\$GIT_AUTHOR_NAME <\$GIT_AUTHOR_EMAIL>\"" &&
+ test_config trailer.sign.key "Signed-off-by: " &&
+ test_config trailer.sign.ifExists "addIfDifferentNeighbor" &&
+ test_config trailer.sign.where "after" &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
Fixes: Z
@@ -1338,12 +1663,19 @@ test_expect_success 'setup a commit' '
'
test_expect_success 'cmd takes precedence over command' '
- test_when_finished "git config --unset trailer.fix.cmd" &&
- git config trailer.fix.ifExists "replace" &&
- git config trailer.fix.cmd "test -n \"\$1\" && git log -1 --oneline --format=\"%h (%aN)\" \
- --abbrev-commit --abbrev=14 \"\$1\" || true" &&
- git config trailer.fix.command "git log -1 --oneline --format=\"%h (%s)\" \
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.fix.command "git log -1 --oneline --format=\"%h (%s)\" \
--abbrev-commit --abbrev=14 \$ARG" &&
+ test_config trailer.fix.cmd "test -n \"\$1\" && git log -1 --oneline --format=\"%h (%aN)\" \
+ --abbrev-commit --abbrev=14 \"\$1\" || true" &&
+ test_config trailer.fix.key "Fixes: " &&
+ test_config trailer.fix.ifExists "replace" &&
+ test_config trailer.fix.where "after" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.sign.command "echo \"\$GIT_AUTHOR_NAME <\$GIT_AUTHOR_EMAIL>\"" &&
+ test_config trailer.sign.key "Signed-off-by: " &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=" &&
FIXED=$(git log -1 --oneline --format="%h (%aN)" --abbrev-commit --abbrev=14 HEAD) &&
cat complex_message_body >expected2 &&
sed -e "s/ Z\$/ /" >>expected2 <<-EOF &&
@@ -1359,8 +1691,16 @@ test_expect_success 'cmd takes precedence over command' '
'
test_expect_success 'with command using $ARG' '
- git config trailer.fix.ifExists "replace" &&
- git config trailer.fix.command "git log -1 --oneline --format=\"%h (%s)\" --abbrev-commit --abbrev=14 \$ARG" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.fix.command "git log -1 --oneline --format=\"%h (%s)\" --abbrev-commit --abbrev=14 \$ARG" &&
+ test_config trailer.fix.key "Fixes: " &&
+ test_config trailer.fix.ifExists "replace" &&
+ test_config trailer.fix.where "after" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.sign.command "echo \"\$GIT_AUTHOR_NAME <\$GIT_AUTHOR_EMAIL>\"" &&
+ test_config trailer.sign.key "Signed-off-by: " &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=" &&
FIXED=$(git log -1 --oneline --format="%h (%s)" --abbrev-commit --abbrev=14 HEAD) &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-EOF &&
@@ -1376,8 +1716,16 @@ test_expect_success 'with command using $ARG' '
'
test_expect_success 'with failing command using $ARG' '
- git config trailer.fix.ifExists "replace" &&
- git config trailer.fix.command "false \$ARG" &&
+ test_config trailer.ack.key "Acked-by= " &&
+ test_config trailer.fix.command "false \$ARG" &&
+ test_config trailer.fix.key "Fixes: " &&
+ test_config trailer.fix.ifExists "replace" &&
+ test_config trailer.fix.where "after" &&
+ test_config trailer.review.key "Reviewed-by:" &&
+ test_config trailer.sign.command "echo \"\$GIT_AUTHOR_NAME <\$GIT_AUTHOR_EMAIL>\"" &&
+ test_config trailer.sign.key "Signed-off-by: " &&
+ test_config trailer.ifexists "addIfDifferent" &&
+ test_config trailer.separators ":=" &&
cat complex_message_body >expected &&
sed -e "s/ Z\$/ /" >>expected <<-EOF &&
Fixes: Z
@@ -1392,7 +1740,9 @@ test_expect_success 'with failing command using $ARG' '
'
test_expect_success 'with empty tokens' '
- git config --unset trailer.fix.command &&
+ test_config trailer.sign.command "echo \"\$GIT_AUTHOR_NAME <\$GIT_AUTHOR_EMAIL>\"" &&
+ test_config trailer.sign.key "Signed-off-by: " &&
+ test_config trailer.ifexists "addIfDifferent" &&
cat >expected <<-EOF &&
Signed-off-by: A U Thor <author@example.com>
@@ -1403,7 +1753,8 @@ test_expect_success 'with empty tokens' '
'
test_expect_success 'with command but no key' '
- git config --unset trailer.sign.key &&
+ test_config trailer.sign.command "echo \"\$GIT_AUTHOR_NAME <\$GIT_AUTHOR_EMAIL>\"" &&
+ test_config trailer.ifexists "addIfDifferent" &&
cat >expected <<-EOF &&
sign: A U Thor <author@example.com>
@@ -1414,7 +1765,9 @@ test_expect_success 'with command but no key' '
'
test_expect_success 'with no command and no key' '
- git config --unset trailer.review.key &&
+ test_config trailer.review.where "before" &&
+ test_config trailer.sign.command "echo \"\$GIT_AUTHOR_NAME <\$GIT_AUTHOR_EMAIL>\"" &&
+ test_config trailer.ifexists "addIfDifferent" &&
cat >expected <<-EOF &&
review: Junio
@@ -1426,6 +1779,8 @@ test_expect_success 'with no command and no key' '
'
test_expect_success 'with cut line' '
+ test_config trailer.review.where "before" &&
+ test_config trailer.sign.command "echo \"\$GIT_AUTHOR_NAME <\$GIT_AUTHOR_EMAIL>\"" &&
cat >expected <<-\EOF &&
my subject
@@ -1443,7 +1798,8 @@ test_expect_success 'with cut line' '
'
test_expect_success 'only trailers' '
- git config trailer.sign.command "echo config-value" &&
+ test_config trailer.sign.command "echo config-value" &&
+ test_config trailer.ifexists "addIfDifferent" &&
cat >expected <<-\EOF &&
existing: existing-value
sign: config-value
@@ -1462,7 +1818,7 @@ test_expect_success 'only trailers' '
'
test_expect_success 'only-trailers omits non-trailer in middle of block' '
- git config trailer.sign.command "echo config-value" &&
+ test_config trailer.sign.command "echo config-value" &&
cat >expected <<-\EOF &&
Signed-off-by: nobody <nobody@nowhere>
Signed-off-by: somebody <somebody@somewhere>
@@ -1482,7 +1838,7 @@ test_expect_success 'only-trailers omits non-trailer in middle of block' '
'
test_expect_success 'only input' '
- git config trailer.sign.command "echo config-value" &&
+ test_config trailer.sign.command "echo config-value" &&
cat >expected <<-\EOF &&
existing: existing-value
EOF
@@ -1560,4 +1916,37 @@ test_expect_success 'suppress --- handling' '
test_cmp expected actual
'
+test_expect_success 'suppressing --- does not disable cut-line handling' '
+ echo "real-trailer: before the cut" >expected &&
+
+ git interpret-trailers --parse --no-divider >actual <<-\EOF &&
+ subject
+
+ This input has a cut-line in it; we should stop parsing when we see it
+ and consider only trailers before that line.
+
+ real-trailer: before the cut
+
+ # ------------------------ >8 ------------------------
+ # Nothing below this line counts as part of the commit message.
+ not-a-trailer: too late
+ EOF
+
+ test_cmp expected actual
+'
+
+test_expect_success 'handling of --- lines in conjunction with cut-lines' '
+ echo "my-trailer: here" >expected &&
+
+ git interpret-trailers --parse >actual <<-\EOF &&
+ subject
+
+ my-trailer: here
+ ---
+ # ------------------------ >8 ------------------------
+ EOF
+
+ test_cmp expected actual
+'
+
test_done
diff --git a/t/t7514-commit-patch.sh b/t/t7514-commit-patch.sh
index 998a210..b4de10a 100755
--- a/t/t7514-commit-patch.sh
+++ b/t/t7514-commit-patch.sh
@@ -3,12 +3,6 @@
test_description='hunk edit with "commit -p -m"'
. ./test-lib.sh
-if ! test_have_prereq PERL
-then
- skip_all="skipping '$test_description' tests, perl not available"
- test_done
-fi
-
test_expect_success 'setup (initial)' '
echo line1 >file &&
git add file &&
diff --git a/t/t7516-commit-races.sh b/t/t7516-commit-races.sh
index f2ce14e..bb95f09 100755
--- a/t/t7516-commit-races.sh
+++ b/t/t7516-commit-races.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='git commit races'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'race to create orphan commit' '
@@ -10,7 +12,8 @@ test_expect_success 'race to create orphan commit' '
test_must_fail env EDITOR=./hare-editor git commit --allow-empty -m tortoise -e &&
git show -s --pretty=format:%s >subject &&
grep hare subject &&
- test -z "$(git show -s --pretty=format:%P)"
+ git show -s --pretty=format:%P >out &&
+ test_must_be_empty out
'
test_expect_success 'race to create non-orphan commit' '
diff --git a/t/t7517-per-repo-email.sh b/t/t7517-per-repo-email.sh
index 163ae80..efc6496 100755
--- a/t/t7517-per-repo-email.sh
+++ b/t/t7517-per-repo-email.sh
@@ -9,6 +9,7 @@ test_description='per-repo forced setting of email address'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup a likely user.useConfigOnly use case' '
diff --git a/t/t7518-ident-corner-cases.sh b/t/t7518-ident-corner-cases.sh
index fffdb6f..b37de0a 100755
--- a/t/t7518-ident-corner-cases.sh
+++ b/t/t7518-ident-corner-cases.sh
@@ -15,15 +15,24 @@ test_expect_success 'empty name and missing email' '
sane_unset GIT_AUTHOR_EMAIL &&
GIT_AUTHOR_NAME= &&
test_must_fail git commit --allow-empty -m foo 2>err &&
- test_i18ngrep ! "(null)" err
+ test_grep ! "(null)" err
)
'
test_expect_success 'commit rejects all-crud name' '
- test_must_fail env GIT_AUTHOR_NAME=" .;<>" \
+ test_must_fail env GIT_AUTHOR_NAME=" ,;<>" \
git commit --allow-empty -m foo
'
+test_expect_success 'commit does not strip trailing dot' '
+ author_name="Pat Doe Jr." &&
+ env GIT_AUTHOR_NAME="$author_name" \
+ git commit --allow-empty -m foo &&
+ git log -1 --format=%an >actual &&
+ echo "$author_name" >expected &&
+ test_cmp actual expected
+'
+
# We must test the actual error message here, as an unwanted
# auto-detection could fail for other reasons.
test_expect_success 'empty configured name does not auto-detect' '
@@ -31,8 +40,8 @@ test_expect_success 'empty configured name does not auto-detect' '
sane_unset GIT_AUTHOR_NAME &&
test_must_fail \
git -c user.name= commit --allow-empty -m foo 2>err &&
- test_i18ngrep "empty ident name" err &&
- test_i18ngrep "Author identity unknown" err
+ test_grep "empty ident name" err &&
+ test_grep "Author identity unknown" err
)
'
@@ -41,8 +50,8 @@ test_expect_success 'empty configured name does not auto-detect for committer' '
sane_unset GIT_COMMITTER_NAME &&
test_must_fail \
git -c user.name= commit --allow-empty -m foo 2>err &&
- test_i18ngrep "empty ident name" err &&
- test_i18ngrep "Committer identity unknown" err
+ test_grep "empty ident name" err &&
+ test_grep "Committer identity unknown" err
)
'
diff --git a/t/t7519-status-fsmonitor.sh b/t/t7519-status-fsmonitor.sh
index 8348e3a..7ee69ec 100755
--- a/t/t7519-status-fsmonitor.sh
+++ b/t/t7519-status-fsmonitor.sh
@@ -322,14 +322,14 @@ do
rm -f marker &&
git status >actual &&
test_path_is_file marker &&
- test_i18ngrep ! "Changes not staged for commit:" actual &&
+ test_grep ! "Changes not staged for commit:" actual &&
if test $uc_val = true
then
- test_i18ngrep ! "Untracked files:" actual
+ test_grep ! "Untracked files:" actual
fi &&
if test $uc_val = false
then
- test_i18ngrep "Untracked files:" actual
+ test_grep "Untracked files:" actual
fi &&
rm -f marker
'
diff --git a/t/t7520-ignored-hook-warning.sh b/t/t7520-ignored-hook-warning.sh
index dc57526..3b63c34 100755
--- a/t/t7520-ignored-hook-warning.sh
+++ b/t/t7520-ignored-hook-warning.sh
@@ -2,6 +2,7 @@
test_description='ignored hook warning'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
@@ -12,27 +13,27 @@ test_expect_success setup '
test_expect_success 'no warning if hook is not ignored' '
git commit --allow-empty -m "more" 2>message &&
- test_i18ngrep ! -e "hook was ignored" message
+ test_grep ! -e "hook was ignored" message
'
test_expect_success POSIXPERM 'warning if hook is ignored' '
test_hook --disable pre-commit &&
git commit --allow-empty -m "even more" 2>message &&
- test_i18ngrep -e "hook was ignored" message
+ test_grep -e "hook was ignored" message
'
test_expect_success POSIXPERM 'no warning if advice.ignoredHook set to false' '
test_config advice.ignoredHook false &&
test_hook --disable pre-commit &&
git commit --allow-empty -m "even more" 2>message &&
- test_i18ngrep ! -e "hook was ignored" message
+ test_grep ! -e "hook was ignored" message
'
test_expect_success 'no warning if unset advice.ignoredHook and hook removed' '
test_hook --remove pre-commit &&
test_unconfig advice.ignoredHook &&
git commit --allow-empty -m "even more" 2>message &&
- test_i18ngrep ! -e "hook was ignored" message
+ test_grep ! -e "hook was ignored" message
'
test_done
diff --git a/t/t7525-status-rename.sh b/t/t7525-status-rename.sh
index 22bf5c7..a9210d3 100755
--- a/t/t7525-status-rename.sh
+++ b/t/t7525-status-rename.sh
@@ -21,81 +21,81 @@ test_expect_success 'setup' '
test_expect_success 'status no-options' '
git status >actual &&
- test_i18ngrep "renamed:" actual
+ test_grep "renamed:" actual
'
test_expect_success 'status --no-renames' '
git status --no-renames >actual &&
- test_i18ngrep "deleted:" actual &&
- test_i18ngrep "new file:" actual
+ test_grep "deleted:" actual &&
+ test_grep "new file:" actual
'
test_expect_success 'status.renames inherits from diff.renames false' '
git -c diff.renames=false status >actual &&
- test_i18ngrep "deleted:" actual &&
- test_i18ngrep "new file:" actual
+ test_grep "deleted:" actual &&
+ test_grep "new file:" actual
'
test_expect_success 'status.renames inherits from diff.renames true' '
git -c diff.renames=true status >actual &&
- test_i18ngrep "renamed:" actual
+ test_grep "renamed:" actual
'
test_expect_success 'status.renames overrides diff.renames false' '
git -c diff.renames=true -c status.renames=false status >actual &&
- test_i18ngrep "deleted:" actual &&
- test_i18ngrep "new file:" actual
+ test_grep "deleted:" actual &&
+ test_grep "new file:" actual
'
test_expect_success 'status.renames overrides from diff.renames true' '
git -c diff.renames=false -c status.renames=true status >actual &&
- test_i18ngrep "renamed:" actual
+ test_grep "renamed:" actual
'
test_expect_success 'status status.renames=false' '
git -c status.renames=false status >actual &&
- test_i18ngrep "deleted:" actual &&
- test_i18ngrep "new file:" actual
+ test_grep "deleted:" actual &&
+ test_grep "new file:" actual
'
test_expect_success 'status status.renames=true' '
git -c status.renames=true status >actual &&
- test_i18ngrep "renamed:" actual
+ test_grep "renamed:" actual
'
test_expect_success 'commit honors status.renames=false' '
git -c status.renames=false commit --dry-run >actual &&
- test_i18ngrep "deleted:" actual &&
- test_i18ngrep "new file:" actual
+ test_grep "deleted:" actual &&
+ test_grep "new file:" actual
'
test_expect_success 'commit honors status.renames=true' '
git -c status.renames=true commit --dry-run >actual &&
- test_i18ngrep "renamed:" actual
+ test_grep "renamed:" actual
'
test_expect_success 'status config overridden' '
git -c status.renames=true status --no-renames >actual &&
- test_i18ngrep "deleted:" actual &&
- test_i18ngrep "new file:" actual
+ test_grep "deleted:" actual &&
+ test_grep "new file:" actual
'
test_expect_success 'status score=100%' '
git status -M=100% >actual &&
- test_i18ngrep "deleted:" actual &&
- test_i18ngrep "new file:" actual &&
+ test_grep "deleted:" actual &&
+ test_grep "new file:" actual &&
git status --find-renames=100% >actual &&
- test_i18ngrep "deleted:" actual &&
- test_i18ngrep "new file:" actual
+ test_grep "deleted:" actual &&
+ test_grep "new file:" actual
'
test_expect_success 'status score=01%' '
git status -M=01% >actual &&
- test_i18ngrep "renamed:" actual &&
+ test_grep "renamed:" actual &&
git status --find-renames=01% >actual &&
- test_i18ngrep "renamed:" actual
+ test_grep "renamed:" actual
'
test_expect_success 'copies not overridden by find-renames' '
@@ -103,12 +103,12 @@ test_expect_success 'copies not overridden by find-renames' '
git add copy &&
git -c status.renames=copies status -M=01% >actual &&
- test_i18ngrep "copied:" actual &&
- test_i18ngrep "renamed:" actual &&
+ test_grep "copied:" actual &&
+ test_grep "renamed:" actual &&
git -c status.renames=copies status --find-renames=01% >actual &&
- test_i18ngrep "copied:" actual &&
- test_i18ngrep "renamed:" actual
+ test_grep "copied:" actual &&
+ test_grep "renamed:" actual
'
test_done
diff --git a/t/t7526-commit-pathspec-file.sh b/t/t7526-commit-pathspec-file.sh
index ad011bb..c97c550 100755
--- a/t/t7526-commit-pathspec-file.sh
+++ b/t/t7526-commit-pathspec-file.sh
@@ -141,25 +141,25 @@ test_expect_success 'error conditions' '
>empty_list &&
test_must_fail git commit --pathspec-from-file=list --interactive -m "Commit" 2>err &&
- test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err &&
+ test_grep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err &&
test_must_fail git commit --pathspec-from-file=list --patch -m "Commit" 2>err &&
- test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err &&
+ test_grep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err &&
test_must_fail git commit --pathspec-from-file=list --all -m "Commit" 2>err &&
- test_i18ngrep -e "options .--pathspec-from-file. and .-a. cannot be used together" err &&
+ test_grep -e "options .--pathspec-from-file. and .-a. cannot be used together" err &&
test_must_fail git commit --pathspec-from-file=list -m "Commit" -- fileA.t 2>err &&
- test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
+ test_grep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err &&
test_must_fail git commit --pathspec-file-nul -m "Commit" 2>err &&
- test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
+ test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&
test_must_fail git commit --pathspec-from-file=empty_list --include -m "Commit" 2>err &&
- test_i18ngrep -e "No paths with --include/--only does not make sense." err &&
+ test_grep -e "No paths with --include/--only does not make sense." err &&
test_must_fail git commit --pathspec-from-file=empty_list --only -m "Commit" 2>err &&
- test_i18ngrep -e "No paths with --include/--only does not make sense." err
+ test_grep -e "No paths with --include/--only does not make sense." err
'
test_done
diff --git a/t/t7527-builtin-fsmonitor.sh b/t/t7527-builtin-fsmonitor.sh
index 56c0dff..730f3c7 100755
--- a/t/t7527-builtin-fsmonitor.sh
+++ b/t/t7527-builtin-fsmonitor.sh
@@ -809,10 +809,19 @@ my_match_and_clean () {
status --porcelain=v2 >actual.without &&
test_cmp actual.with actual.without &&
+ git -C super --no-optional-locks diff-index --name-status HEAD >actual.with &&
+ git -C super --no-optional-locks -c core.fsmonitor=false \
+ diff-index --name-status HEAD >actual.without &&
+ test_cmp actual.with actual.without &&
+
git -C super/dir_1/dir_2/sub reset --hard &&
git -C super/dir_1/dir_2/sub clean -d -f
}
+test_expect_success 'submodule setup' '
+ git config --global protocol.file.allow always
+'
+
test_expect_success 'submodule always visited' '
test_when_finished "git -C super fsmonitor--daemon stop; \
rm -rf super; \
@@ -862,27 +871,9 @@ test_expect_success 'submodule always visited' '
# the submodule, and someone does a `git submodule absorbgitdirs`
# in the super, Git will recursively invoke `git submodule--helper`
# to do the work and this may try to read the index. This will
-# try to start the daemon in the submodule *and* pass (either
-# directly or via inheritance) the `--super-prefix` arg to the
-# `git fsmonitor--daemon start` command inside the submodule.
-# This causes a warning because fsmonitor--daemon does take that
-# global arg (see the table in git.c)
-#
-# This causes a warning when trying to start the daemon that is
-# somewhat confusing. It does not seem to hurt anything because
-# the fsmonitor code maps the query failure into a trivial response
-# and does the work anyway.
-#
-# It would be nice to silence the warning, however.
-
-have_t2_error_event () {
- log=$1
- msg="fsmonitor--daemon doesnQt support --super-prefix" &&
+# try to start the daemon in the submodule.
- tr '\047' Q <$1 | grep -e "$msg"
-}
-
-test_expect_success "stray submodule super-prefix warning" '
+test_expect_success "submodule absorbgitdirs implicitly starts daemon" '
test_when_finished "rm -rf super; \
rm -rf sub; \
rm super-sub.trace" &&
@@ -900,21 +891,31 @@ test_expect_success "stray submodule super-prefix warning" '
test_path_is_dir super/dir_1/dir_2/sub/.git &&
+ cwd="$(cd super && pwd)" &&
+ cat >expect <<-EOF &&
+ Migrating git directory of '\''dir_1/dir_2/sub'\'' from
+ '\''$cwd/dir_1/dir_2/sub/.git'\'' to
+ '\''$cwd/.git/modules/dir_1/dir_2/sub'\''
+ EOF
GIT_TRACE2_EVENT="$PWD/super-sub.trace" \
- git -C super submodule absorbgitdirs &&
+ git -C super submodule absorbgitdirs >out 2>actual &&
+ test_cmp expect actual &&
+ test_must_be_empty out &&
- ! have_t2_error_event super-sub.trace
+ # Confirm that the trace2 log contains a record of the
+ # daemon starting.
+ test_subcommand git fsmonitor--daemon start <super-sub.trace
'
# On a case-insensitive file system, confirm that the daemon
# notices when the .git directory is moved/renamed/deleted
-# regardless of how it is spelled in the the FS event.
+# regardless of how it is spelled in the FS event.
# That is, does the FS event receive the spelling of the
# operation or does it receive the spelling preserved with
# the file/directory.
#
test_expect_success CASE_INSENSITIVE_FS 'case insensitive+preserving' '
-# test_when_finished "stop_daemon_delete_repo test_insensitive" &&
+ test_when_finished "stop_daemon_delete_repo test_insensitive" &&
git init test_insensitive &&
@@ -926,8 +927,8 @@ test_expect_success CASE_INSENSITIVE_FS 'case insensitive+preserving' '
test_path_is_dir test_insensitive/.git &&
test_path_is_dir test_insensitive/.GIT &&
- # Rename .git using an alternate spelling to verify that that
- # daemon detects it and automatically shuts down.
+ # Rename .git using an alternate spelling to verify that
+ # the daemon detects it and automatically shuts down.
mv test_insensitive/.GIT test_insensitive/.FOO &&
# See [1] above.
@@ -939,9 +940,9 @@ test_expect_success CASE_INSENSITIVE_FS 'case insensitive+preserving' '
# directories and files that we touched. We may or may not get a
# trailing slash on modified directories.
#
- egrep "^event: abc/?$" ./insensitive.trace &&
- egrep "^event: abc/def/?$" ./insensitive.trace &&
- egrep "^event: abc/def/xyz$" ./insensitive.trace
+ grep -E "^event: abc/?$" ./insensitive.trace &&
+ grep -E "^event: abc/def/?$" ./insensitive.trace &&
+ grep -E "^event: abc/def/xyz$" ./insensitive.trace
'
# The variable "unicode_debug" is defined in the following library
@@ -977,26 +978,286 @@ test_expect_success !UNICODE_COMPOSITION_SENSITIVE 'Unicode nfc/nfd' '
mkdir test_unicode/nfd &&
mkdir test_unicode/nfd/d_${utf8_nfd} &&
- git -C test_unicode fsmonitor--daemon stop &&
+ test-tool -C test_unicode fsmonitor-client query --token 0 &&
if test_have_prereq UNICODE_NFC_PRESERVED
then
# We should have seen NFC event from OS.
# We should not have synthesized an NFD event.
- egrep "^event: nfc/c_${utf8_nfc}/?$" ./unicode.trace &&
- egrep -v "^event: nfc/c_${utf8_nfd}/?$" ./unicode.trace
+ grep -E "^event: nfc/c_${utf8_nfc}/?$" ./unicode.trace &&
+ grep -E -v "^event: nfc/c_${utf8_nfd}/?$" ./unicode.trace
else
# We should have seen NFD event from OS.
# We should have synthesized an NFC event.
- egrep "^event: nfc/c_${utf8_nfd}/?$" ./unicode.trace &&
- egrep "^event: nfc/c_${utf8_nfc}/?$" ./unicode.trace
+ grep -E "^event: nfc/c_${utf8_nfd}/?$" ./unicode.trace &&
+ grep -E "^event: nfc/c_${utf8_nfc}/?$" ./unicode.trace
fi &&
# We assume UNICODE_NFD_PRESERVED.
# We should have seen explicit NFD from OS.
# We should have synthesized an NFC event.
- egrep "^event: nfd/d_${utf8_nfd}/?$" ./unicode.trace &&
- egrep "^event: nfd/d_${utf8_nfc}/?$" ./unicode.trace
+ grep -E "^event: nfd/d_${utf8_nfd}/?$" ./unicode.trace &&
+ grep -E "^event: nfd/d_${utf8_nfc}/?$" ./unicode.trace
+'
+
+test_expect_success 'split-index and FSMonitor work well together' '
+ git init split-index &&
+ test_when_finished "git -C \"$PWD/split-index\" \
+ fsmonitor--daemon stop" &&
+ (
+ cd split-index &&
+ git config core.splitIndex true &&
+ # force split-index in most cases
+ git config splitIndex.maxPercentChange 99 &&
+ git config core.fsmonitor true &&
+
+ # Create the following commit topology:
+ #
+ # * merge three
+ # |\
+ # | * three
+ # * | merge two
+ # |\|
+ # | * two
+ # * | one
+ # |/
+ # * 5a5efd7 initial
+
+ test_commit initial &&
+ test_commit two &&
+ test_commit three &&
+ git reset --hard initial &&
+ test_commit one &&
+ test_tick &&
+ git merge two &&
+ test_tick &&
+ git merge three &&
+
+ git rebase --force-rebase -r one
+ )
+'
+
+# The FSMonitor daemon reports the OBSERVED pathname of modified files
+# and thus contains the OBSERVED spelling on case-insensitive file
+# systems. The daemon does not (and should not) load the .git/index
+# file and therefore does not know the expected case-spelling. Since
+# it is possible for the user to create files/subdirectories with the
+# incorrect case, a modified file event for a tracked will not have
+# the EXPECTED case. This can cause `index_name_pos()` to incorrectly
+# report that the file is untracked. This causes the client to fail to
+# mark the file as possibly dirty (keeping the CE_FSMONITOR_VALID bit
+# set) so that `git status` will avoid inspecting it and thus not
+# present in the status output.
+#
+# The setup is a little contrived.
+#
+test_expect_success CASE_INSENSITIVE_FS 'fsmonitor subdir case wrong on disk' '
+ test_when_finished "stop_daemon_delete_repo subdir_case_wrong" &&
+
+ git init subdir_case_wrong &&
+ (
+ cd subdir_case_wrong &&
+ echo x >AAA &&
+ echo x >BBB &&
+
+ mkdir dir1 &&
+ echo x >dir1/file1 &&
+ mkdir dir1/dir2 &&
+ echo x >dir1/dir2/file2 &&
+ mkdir dir1/dir2/dir3 &&
+ echo x >dir1/dir2/dir3/file3 &&
+
+ echo x >yyy &&
+ echo x >zzz &&
+ git add . &&
+ git commit -m "data" &&
+
+ # This will cause "dir1/" and everything under it
+ # to be deleted.
+ git sparse-checkout set --cone --sparse-index &&
+
+ # Create dir2 with the wrong case and then let Git
+ # repopulate dir3 -- it will not correct the spelling
+ # of dir2.
+ mkdir dir1 &&
+ mkdir dir1/DIR2 &&
+ git sparse-checkout add dir1/dir2/dir3
+ ) &&
+
+ start_daemon -C subdir_case_wrong --tf "$PWD/subdir_case_wrong.trace" &&
+
+ # Enable FSMonitor in the client. Run enough commands for
+ # the .git/index to sync up with the daemon with everything
+ # marked clean.
+ git -C subdir_case_wrong config core.fsmonitor true &&
+ git -C subdir_case_wrong update-index --fsmonitor &&
+ git -C subdir_case_wrong status &&
+
+ # Make some files dirty so that FSMonitor gets FSEvents for
+ # each of them.
+ echo xx >>subdir_case_wrong/AAA &&
+ echo xx >>subdir_case_wrong/dir1/DIR2/dir3/file3 &&
+ echo xx >>subdir_case_wrong/zzz &&
+
+ GIT_TRACE_FSMONITOR="$PWD/subdir_case_wrong.log" \
+ git -C subdir_case_wrong --no-optional-locks status --short \
+ >"$PWD/subdir_case_wrong.out" &&
+
+ # "git status" should have gotten file events for each of
+ # the 3 files.
+ #
+ # "dir2" should be in the observed case on disk.
+ grep "fsmonitor_refresh_callback" \
+ <"$PWD/subdir_case_wrong.log" \
+ >"$PWD/subdir_case_wrong.log1" &&
+
+ grep -q "AAA.*pos 0" "$PWD/subdir_case_wrong.log1" &&
+ grep -q "zzz.*pos 6" "$PWD/subdir_case_wrong.log1" &&
+
+ grep -q "dir1/DIR2/dir3/file3.*pos -3" "$PWD/subdir_case_wrong.log1" &&
+
+ # Verify that we get a mapping event to correct the case.
+ grep -q "MAP:.*dir1/DIR2/dir3/file3.*dir1/dir2/dir3/file3" \
+ "$PWD/subdir_case_wrong.log1" &&
+
+ # The refresh-callbacks should have caused "git status" to clear
+ # the CE_FSMONITOR_VALID bit on each of those files and caused
+ # the worktree scan to visit them and mark them as modified.
+ grep -q " M AAA" "$PWD/subdir_case_wrong.out" &&
+ grep -q " M zzz" "$PWD/subdir_case_wrong.out" &&
+ grep -q " M dir1/dir2/dir3/file3" "$PWD/subdir_case_wrong.out"
+'
+
+test_expect_success CASE_INSENSITIVE_FS 'fsmonitor file case wrong on disk' '
+ test_when_finished "stop_daemon_delete_repo file_case_wrong" &&
+
+ git init file_case_wrong &&
+ (
+ cd file_case_wrong &&
+ echo x >AAA &&
+ echo x >BBB &&
+
+ mkdir dir1 &&
+ mkdir dir1/dir2 &&
+ mkdir dir1/dir2/dir3 &&
+ echo x >dir1/dir2/dir3/FILE-3-B &&
+ echo x >dir1/dir2/dir3/XXXX-3-X &&
+ echo x >dir1/dir2/dir3/file-3-a &&
+ echo x >dir1/dir2/dir3/yyyy-3-y &&
+ mkdir dir1/dir2/dir4 &&
+ echo x >dir1/dir2/dir4/FILE-4-A &&
+ echo x >dir1/dir2/dir4/XXXX-4-X &&
+ echo x >dir1/dir2/dir4/file-4-b &&
+ echo x >dir1/dir2/dir4/yyyy-4-y &&
+
+ echo x >yyy &&
+ echo x >zzz &&
+ git add . &&
+ git commit -m "data"
+ ) &&
+
+ start_daemon -C file_case_wrong --tf "$PWD/file_case_wrong.trace" &&
+
+ # Enable FSMonitor in the client. Run enough commands for
+ # the .git/index to sync up with the daemon with everything
+ # marked clean.
+ git -C file_case_wrong config core.fsmonitor true &&
+ git -C file_case_wrong update-index --fsmonitor &&
+ git -C file_case_wrong status &&
+
+ # Make some files dirty so that FSMonitor gets FSEvents for
+ # each of them.
+ echo xx >>file_case_wrong/AAA &&
+ echo xx >>file_case_wrong/zzz &&
+
+ # Rename some files so that FSMonitor sees a create and delete
+ # FSEvent for each. (A simple "mv foo FOO" is not portable
+ # between macOS and Windows. It works on both platforms, but makes
+ # the test messy, since (1) one platform updates "ctime" on the
+ # moved file and one does not and (2) it causes a directory event
+ # on one platform and not on the other which causes additional
+ # scanning during "git status" which causes a "H" vs "h" discrepancy
+ # in "git ls-files -f".) So old-school it and move it out of the
+ # way and copy it to the case-incorrect name so that we get fresh
+ # "ctime" and "mtime" values.
+
+ mv file_case_wrong/dir1/dir2/dir3/file-3-a file_case_wrong/dir1/dir2/dir3/ORIG &&
+ cp file_case_wrong/dir1/dir2/dir3/ORIG file_case_wrong/dir1/dir2/dir3/FILE-3-A &&
+ rm file_case_wrong/dir1/dir2/dir3/ORIG &&
+ mv file_case_wrong/dir1/dir2/dir4/FILE-4-A file_case_wrong/dir1/dir2/dir4/ORIG &&
+ cp file_case_wrong/dir1/dir2/dir4/ORIG file_case_wrong/dir1/dir2/dir4/file-4-a &&
+ rm file_case_wrong/dir1/dir2/dir4/ORIG &&
+
+ # Run status enough times to fully sync.
+ #
+ # The first instance should get the create and delete FSEvents
+ # for each pair. Status should update the index with a new FSM
+ # token (so the next invocation will not see data for these
+ # events).
+
+ GIT_TRACE_FSMONITOR="$PWD/file_case_wrong-try1.log" \
+ git -C file_case_wrong status --short \
+ >"$PWD/file_case_wrong-try1.out" &&
+ grep -q "fsmonitor_refresh_callback.*FILE-3-A.*pos -3" "$PWD/file_case_wrong-try1.log" &&
+ grep -q "fsmonitor_refresh_callback.*file-3-a.*pos 4" "$PWD/file_case_wrong-try1.log" &&
+ grep -q "fsmonitor_refresh_callback.*FILE-4-A.*pos 6" "$PWD/file_case_wrong-try1.log" &&
+ grep -q "fsmonitor_refresh_callback.*file-4-a.*pos -9" "$PWD/file_case_wrong-try1.log" &&
+
+ # FSM refresh will have invalidated the FSM bit and cause a regular
+ # (real) scan of these tracked files, so they should have "H" status.
+ # (We will not see a "h" status until the next refresh (on the next
+ # command).)
+
+ git -C file_case_wrong ls-files -f >"$PWD/file_case_wrong-lsf1.out" &&
+ grep -q "H dir1/dir2/dir3/file-3-a" "$PWD/file_case_wrong-lsf1.out" &&
+ grep -q "H dir1/dir2/dir4/FILE-4-A" "$PWD/file_case_wrong-lsf1.out" &&
+
+
+ # Try the status again. We assume that the above status command
+ # advanced the token so that the next one will not see those events.
+
+ GIT_TRACE_FSMONITOR="$PWD/file_case_wrong-try2.log" \
+ git -C file_case_wrong status --short \
+ >"$PWD/file_case_wrong-try2.out" &&
+ ! grep -q "fsmonitor_refresh_callback.*FILE-3-A.*pos" "$PWD/file_case_wrong-try2.log" &&
+ ! grep -q "fsmonitor_refresh_callback.*file-3-a.*pos" "$PWD/file_case_wrong-try2.log" &&
+ ! grep -q "fsmonitor_refresh_callback.*FILE-4-A.*pos" "$PWD/file_case_wrong-try2.log" &&
+ ! grep -q "fsmonitor_refresh_callback.*file-4-a.*pos" "$PWD/file_case_wrong-try2.log" &&
+
+ # FSM refresh saw nothing, so it will mark all files as valid,
+ # so they should now have "h" status.
+
+ git -C file_case_wrong ls-files -f >"$PWD/file_case_wrong-lsf2.out" &&
+ grep -q "h dir1/dir2/dir3/file-3-a" "$PWD/file_case_wrong-lsf2.out" &&
+ grep -q "h dir1/dir2/dir4/FILE-4-A" "$PWD/file_case_wrong-lsf2.out" &&
+
+
+ # We now have files with clean content, but with case-incorrect
+ # file names. Modify them to see if status properly reports
+ # them.
+
+ echo xx >>file_case_wrong/dir1/dir2/dir3/FILE-3-A &&
+ echo xx >>file_case_wrong/dir1/dir2/dir4/file-4-a &&
+
+ GIT_TRACE_FSMONITOR="$PWD/file_case_wrong-try3.log" \
+ git -C file_case_wrong --no-optional-locks status --short \
+ >"$PWD/file_case_wrong-try3.out" &&
+
+ # Verify that we get a mapping event to correct the case.
+ grep -q "fsmonitor_refresh_callback MAP:.*dir1/dir2/dir3/FILE-3-A.*dir1/dir2/dir3/file-3-a" \
+ "$PWD/file_case_wrong-try3.log" &&
+ grep -q "fsmonitor_refresh_callback MAP:.*dir1/dir2/dir4/file-4-a.*dir1/dir2/dir4/FILE-4-A" \
+ "$PWD/file_case_wrong-try3.log" &&
+
+ # FSEvents are in observed case.
+ grep -q "fsmonitor_refresh_callback.*FILE-3-A.*pos -3" "$PWD/file_case_wrong-try3.log" &&
+ grep -q "fsmonitor_refresh_callback.*file-4-a.*pos -9" "$PWD/file_case_wrong-try3.log" &&
+
+ # The refresh-callbacks should have caused "git status" to clear
+ # the CE_FSMONITOR_VALID bit on each of those files and caused
+ # the worktree scan to visit them and mark them as modified.
+ grep -q " M dir1/dir2/dir3/file-3-a" "$PWD/file_case_wrong-try3.out" &&
+ grep -q " M dir1/dir2/dir4/FILE-4-A" "$PWD/file_case_wrong-try3.out"
'
test_done
diff --git a/t/t7528-signed-commit-ssh.sh b/t/t7528-signed-commit-ssh.sh
index f47e995..065f780 100755
--- a/t/t7528-signed-commit-ssh.sh
+++ b/t/t7528-signed-commit-ssh.sh
@@ -270,7 +270,7 @@ test_expect_success GPGSSH 'detect fudged signature with NUL' '
git cat-file commit seventh-signed >raw &&
cat raw >forged2 &&
echo Qwik | tr "Q" "\000" >>forged2 &&
- git hash-object -w -t commit forged2 >forged2.commit &&
+ git hash-object --literally -w -t commit forged2 >forged2.commit &&
test_must_fail git verify-commit $(cat forged2.commit) &&
git show --pretty=short --show-signature $(cat forged2.commit) >actual2 &&
grep "${GPGSSH_BAD_SIGNATURE}" actual2 &&
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index f0f6fda..e5ff073 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -105,7 +105,7 @@ verify_mergeheads () {
test_write_lines "$@" >mergehead.expected &&
while read sha1 rest
do
- git rev-parse $sha1
+ git rev-parse $sha1 || return 1
done <.git/MERGE_HEAD >mergehead.actual &&
test_cmp mergehead.expected mergehead.actual
}
@@ -175,7 +175,7 @@ test_expect_success 'merge -h with invalid index' '
>.git/index &&
test_expect_code 129 git merge -h 2>usage
) &&
- test_i18ngrep "[Uu]sage: git merge" broken/usage
+ test_grep "[Uu]sage: git merge" broken/usage
'
test_expect_success 'reject non-strategy with a git-merge-foo name' '
@@ -255,6 +255,15 @@ test_expect_success 'merge --squash c3 with c7' '
test_cmp expect actual
'
+test_expect_success 'merge --squash --autostash conflict does not attempt to apply autostash' '
+ git reset --hard c3 &&
+ >unrelated &&
+ git add unrelated &&
+ test_must_fail git merge --squash c7 --autostash >out 2>err &&
+ ! grep "Applying autostash resulted in conflicts." err &&
+ grep "When finished, apply stashed changes with \`git stash pop\`" out
+'
+
test_expect_success 'merge c3 with c7 with commit.cleanup = scissors' '
git config commit.cleanup scissors &&
git reset --hard c3 &&
@@ -630,41 +639,41 @@ test_expect_success 'merge log message' '
test_debug 'git log --graph --decorate --oneline --all'
test_expect_success 'merge c1 with c0, c2, c0, and c1' '
- git reset --hard c1 &&
- test_tick &&
- git merge c0 c2 c0 c1 &&
- verify_merge file result.1-5 &&
- verify_parents $c1 $c2
+ git reset --hard c1 &&
+ test_tick &&
+ git merge c0 c2 c0 c1 &&
+ verify_merge file result.1-5 &&
+ verify_parents $c1 $c2
'
test_debug 'git log --graph --decorate --oneline --all'
test_expect_success 'merge c1 with c0, c2, c0, and c1' '
- git reset --hard c1 &&
- test_tick &&
- git merge c0 c2 c0 c1 &&
- verify_merge file result.1-5 &&
- verify_parents $c1 $c2
+ git reset --hard c1 &&
+ test_tick &&
+ git merge c0 c2 c0 c1 &&
+ verify_merge file result.1-5 &&
+ verify_parents $c1 $c2
'
test_debug 'git log --graph --decorate --oneline --all'
test_expect_success 'merge c1 with c1 and c2' '
- git reset --hard c1 &&
- test_tick &&
- git merge c1 c2 &&
- verify_merge file result.1-5 &&
- verify_parents $c1 $c2
+ git reset --hard c1 &&
+ test_tick &&
+ git merge c1 c2 &&
+ verify_merge file result.1-5 &&
+ verify_parents $c1 $c2
'
test_debug 'git log --graph --decorate --oneline --all'
test_expect_success 'merge fast-forward in a dirty tree' '
- git reset --hard c0 &&
- mv file file1 &&
- cat file1 >file &&
- rm -f file1 &&
- git merge c2
+ git reset --hard c0 &&
+ mv file file1 &&
+ cat file1 >file &&
+ rm -f file1 &&
+ git merge c2
'
test_debug 'git log --graph --decorate --oneline --all'
@@ -672,7 +681,7 @@ test_debug 'git log --graph --decorate --oneline --all'
test_expect_success 'in-index merge' '
git reset --hard c0 &&
git merge --no-ff -s resolve c1 >out &&
- test_i18ngrep "Wonderful." out &&
+ test_grep "Wonderful." out &&
verify_parents $c0 $c1
'
@@ -688,7 +697,7 @@ test_expect_success 'merge with --autostash' '
git reset --hard c1 &&
git merge-file file file.orig file.9 &&
git merge --autostash c2 2>err &&
- test_i18ngrep "Applied autostash." err &&
+ test_grep "Applied autostash." err &&
git show HEAD:file >merge-result &&
test_cmp result.1-5 merge-result &&
test_cmp result.1-5-9 file
@@ -699,7 +708,7 @@ test_expect_success 'merge with merge.autoStash' '
git reset --hard c1 &&
git merge-file file file.orig file.9 &&
git merge c2 2>err &&
- test_i18ngrep "Applied autostash." err &&
+ test_grep "Applied autostash." err &&
git show HEAD:file >merge-result &&
test_cmp result.1-5 merge-result &&
test_cmp result.1-5-9 file
@@ -709,7 +718,7 @@ test_expect_success 'fast-forward merge with --autostash' '
git reset --hard c0 &&
git merge-file file file.orig file.5 &&
git merge --autostash c1 2>err &&
- test_i18ngrep "Applied autostash." err &&
+ test_grep "Applied autostash." err &&
test_cmp result.1-5 file
'
@@ -719,7 +728,7 @@ test_expect_success 'failed fast-forward merge with --autostash' '
cp file.5 other &&
test_when_finished "rm other" &&
test_must_fail git merge --autostash c1 2>err &&
- test_i18ngrep "Applied autostash." err &&
+ test_grep "Applied autostash." err &&
test_cmp file.5 file
'
@@ -727,7 +736,7 @@ test_expect_success 'octopus merge with --autostash' '
git reset --hard c1 &&
git merge-file file file.orig file.3 &&
git merge --autostash c2 c3 2>err &&
- test_i18ngrep "Applied autostash." err &&
+ test_grep "Applied autostash." err &&
git show HEAD:file >merge-result &&
test_cmp result.1-5-9 merge-result &&
test_cmp result.1-3-5-9 file
@@ -737,7 +746,7 @@ test_expect_success 'failed merge (exit 2) with --autostash' '
git reset --hard c1 &&
git merge-file file file.orig file.5 &&
test_must_fail git merge -s recursive --autostash c2 c3 2>err &&
- test_i18ngrep "Applied autostash." err &&
+ test_grep "Applied autostash." err &&
test_cmp result.1-5 file
'
@@ -746,7 +755,7 @@ test_expect_success 'conflicted merge with --autostash, --abort restores stash'
cp file.1 file &&
test_must_fail git merge --autostash c7 &&
git merge --abort 2>err &&
- test_i18ngrep "Applied autostash." err &&
+ test_grep "Applied autostash." err &&
test_cmp file.1 file
'
@@ -758,7 +767,7 @@ test_expect_success 'completed merge (git commit) with --no-commit and --autosta
git stash show -p MERGE_AUTOSTASH >actual &&
test_cmp expect actual &&
git commit 2>err &&
- test_i18ngrep "Applied autostash." err &&
+ test_grep "Applied autostash." err &&
git show HEAD:file >merge-result &&
test_cmp result.1-5 merge-result &&
test_cmp result.1-5-9 file
@@ -772,7 +781,7 @@ test_expect_success 'completed merge (git merge --continue) with --no-commit and
git stash show -p MERGE_AUTOSTASH >actual &&
test_cmp expect actual &&
git merge --continue 2>err &&
- test_i18ngrep "Applied autostash." err &&
+ test_grep "Applied autostash." err &&
git show HEAD:file >merge-result &&
test_cmp result.1-5 merge-result &&
test_cmp result.1-5-9 file
@@ -786,7 +795,7 @@ test_expect_success 'aborted merge (merge --abort) with --no-commit and --autost
git stash show -p MERGE_AUTOSTASH >actual &&
test_cmp expect actual &&
git merge --abort 2>err &&
- test_i18ngrep "Applied autostash." err &&
+ test_grep "Applied autostash." err &&
git diff >actual &&
test_cmp expect actual
'
@@ -799,7 +808,7 @@ test_expect_success 'aborted merge (reset --hard) with --no-commit and --autosta
git stash show -p MERGE_AUTOSTASH >actual &&
test_cmp expect actual &&
git reset --hard 2>err &&
- test_i18ngrep "Autostash exists; creating a new stash entry." err &&
+ test_grep "Autostash exists; creating a new stash entry." err &&
git diff --exit-code
'
@@ -812,7 +821,7 @@ test_expect_success 'quit merge with --no-commit and --autostash' '
test_cmp expect actual &&
git diff HEAD >expect &&
git merge --quit 2>err &&
- test_i18ngrep "Autostash exists; creating a new stash entry." err &&
+ test_grep "Autostash exists; creating a new stash entry." err &&
git diff HEAD >actual &&
test_cmp expect actual
'
@@ -823,7 +832,7 @@ test_expect_success 'merge with conflicted --autostash changes' '
git diff >expect &&
test_when_finished "test_might_fail git stash drop" &&
git merge --autostash c3 2>err &&
- test_i18ngrep "Applying autostash resulted in conflicts." err &&
+ test_grep "Applying autostash resulted in conflicts." err &&
git show HEAD:file >merge-result &&
test_cmp result.1-9 merge-result &&
git stash show -p >actual &&
diff --git a/t/t7601-merge-pull-config.sh b/t/t7601-merge-pull-config.sh
index bd238d8..a94387a 100755
--- a/t/t7601-merge-pull-config.sh
+++ b/t/t7601-merge-pull-config.sh
@@ -30,117 +30,117 @@ test_expect_success 'setup' '
test_expect_success 'pull.rebase not set, ff possible' '
git reset --hard c0 &&
git pull . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_expect_success 'pull.rebase not set and pull.ff=true' '
git reset --hard c0 &&
test_config pull.ff true &&
git pull . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_expect_success 'pull.rebase not set and pull.ff=false' '
git reset --hard c0 &&
test_config pull.ff false &&
git pull . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_expect_success 'pull.rebase not set and pull.ff=only' '
git reset --hard c0 &&
test_config pull.ff only &&
git pull . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_expect_success 'pull.rebase not set and --rebase given' '
git reset --hard c0 &&
git pull --rebase . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_expect_success 'pull.rebase not set and --no-rebase given' '
git reset --hard c0 &&
git pull --no-rebase . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_expect_success 'pull.rebase not set and --ff given' '
git reset --hard c0 &&
git pull --ff . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_expect_success 'pull.rebase not set and --no-ff given' '
git reset --hard c0 &&
git pull --no-ff . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_expect_success 'pull.rebase not set and --ff-only given' '
git reset --hard c0 &&
git pull --ff-only . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_expect_success 'pull.rebase not set (not-fast-forward)' '
git reset --hard c2 &&
test_must_fail git -c color.advice=always pull . c1 2>err &&
test_decode_color <err >decoded &&
- test_i18ngrep "<YELLOW>hint: " decoded &&
- test_i18ngrep "You have divergent branches" decoded
+ test_grep "<YELLOW>hint: " decoded &&
+ test_grep "You have divergent branches" decoded
'
test_expect_success 'pull.rebase not set and pull.ff=true (not-fast-forward)' '
git reset --hard c2 &&
test_config pull.ff true &&
git pull . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_expect_success 'pull.rebase not set and pull.ff=false (not-fast-forward)' '
git reset --hard c2 &&
test_config pull.ff false &&
git pull . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_expect_success 'pull.rebase not set and pull.ff=only (not-fast-forward)' '
git reset --hard c2 &&
test_config pull.ff only &&
test_must_fail git pull . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_expect_success 'pull.rebase not set and --rebase given (not-fast-forward)' '
git reset --hard c2 &&
git pull --rebase . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_expect_success 'pull.rebase not set and --no-rebase given (not-fast-forward)' '
git reset --hard c2 &&
git pull --no-rebase . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_expect_success 'pull.rebase not set and --ff given (not-fast-forward)' '
git reset --hard c2 &&
git pull --ff . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_expect_success 'pull.rebase not set and --no-ff given (not-fast-forward)' '
git reset --hard c2 &&
git pull --no-ff . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_expect_success 'pull.rebase not set and --ff-only given (not-fast-forward)' '
git reset --hard c2 &&
test_must_fail git pull --ff-only . c1 2>err &&
- test_i18ngrep ! "You have divergent branches" err
+ test_grep ! "You have divergent branches" err
'
test_does_rebase () {
@@ -202,7 +202,7 @@ test_falls_back_to_full_merge () {
test_attempts_fast_forward () {
git reset --hard c2 &&
test_must_fail git "$@" . c1 2>err &&
- test_i18ngrep "Not possible to fast-forward, aborting" err
+ test_grep "Not possible to fast-forward, aborting" err
}
#
@@ -328,34 +328,34 @@ test_expect_success 'pull.rebase=false and --ff, ff not possible' '
test_expect_success 'Multiple heads warns about inability to fast forward' '
git reset --hard c1 &&
test_must_fail git pull . c2 c3 2>err &&
- test_i18ngrep "You have divergent branches" err
+ test_grep "You have divergent branches" err
'
test_expect_success 'Multiple can never be fast forwarded' '
git reset --hard c0 &&
test_must_fail git -c pull.ff=only pull . c1 c2 c3 2>err &&
- test_i18ngrep ! "You have divergent branches" err &&
+ test_grep ! "You have divergent branches" err &&
# In addition to calling out "cannot fast-forward", we very much
# want the "multiple branches" piece to be called out to users.
- test_i18ngrep "Cannot fast-forward to multiple branches" err
+ test_grep "Cannot fast-forward to multiple branches" err
'
test_expect_success 'Cannot rebase with multiple heads' '
git reset --hard c0 &&
test_must_fail git -c pull.rebase=true pull . c1 c2 c3 2>err &&
- test_i18ngrep ! "You have divergent branches" err &&
- test_i18ngrep "Cannot rebase onto multiple branches." err
+ test_grep ! "You have divergent branches" err &&
+ test_grep "Cannot rebase onto multiple branches." err
'
test_expect_success 'merge c1 with c2' '
git reset --hard c1 &&
- test -f c0.c &&
- test -f c1.c &&
- test ! -f c2.c &&
- test ! -f c3.c &&
+ test_path_is_file c0.c &&
+ test_path_is_file c1.c &&
+ test_path_is_missing c2.c &&
+ test_path_is_missing c3.c &&
git merge c2 &&
- test -f c1.c &&
- test -f c2.c
+ test_path_is_file c1.c &&
+ test_path_is_file c2.c
'
test_expect_success 'fast-forward pull succeeds with "true" in pull.ff' '
@@ -411,8 +411,8 @@ test_expect_success 'merge c1 with c2 (ours in pull.twohead)' '
git reset --hard c1 &&
git config pull.twohead ours &&
git merge c2 &&
- test -f c1.c &&
- ! test -f c2.c
+ test_path_is_file c1.c &&
+ test_path_is_missing c2.c
'
test_expect_success 'merge c1 with c2 and c3 (recursive in pull.octopus)' '
@@ -431,10 +431,10 @@ test_expect_success 'merge c1 with c2 and c3 (recursive and octopus in pull.octo
test "$(git rev-parse c2)" = "$(git rev-parse HEAD^2)" &&
test "$(git rev-parse c3)" = "$(git rev-parse HEAD^3)" &&
git diff --exit-code &&
- test -f c0.c &&
- test -f c1.c &&
- test -f c2.c &&
- test -f c3.c
+ test_path_is_file c0.c &&
+ test_path_is_file c1.c &&
+ test_path_is_file c2.c &&
+ test_path_is_file c3.c
'
conflict_count()
diff --git a/t/t7602-merge-octopus-many.sh b/t/t7602-merge-octopus-many.sh
index ff085b0..3669d33 100755
--- a/t/t7602-merge-octopus-many.sh
+++ b/t/t7602-merge-octopus-many.sh
@@ -4,6 +4,7 @@ test_description='git merge
Testing octopus merge with more than 25 refs.'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
diff --git a/t/t7603-merge-reduce-heads.sh b/t/t7603-merge-reduce-heads.sh
index 4887ca7..0e85b21 100755
--- a/t/t7603-merge-reduce-heads.sh
+++ b/t/t7603-merge-reduce-heads.sh
@@ -4,6 +4,7 @@ test_description='git merge
Testing octopus merge when reducing parents to independent branches.'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# 0 - 1
diff --git a/t/t7605-merge-resolve.sh b/t/t7605-merge-resolve.sh
index 5d56c38..62d935d 100755
--- a/t/t7605-merge-resolve.sh
+++ b/t/t7605-merge-resolve.sh
@@ -4,6 +4,7 @@ test_description='git merge
Testing the resolve strategy.'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
diff --git a/t/t7607-merge-state.sh b/t/t7607-merge-state.sh
new file mode 100755
index 0000000..9001674
--- /dev/null
+++ b/t/t7607-merge-state.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+test_description="Test that merge state is as expected after failed merge"
+
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+test_expect_success 'Ensure we restore original state if no merge strategy handles it' '
+ test_commit --no-tag "Initial" base base &&
+
+ for b in branch1 branch2 branch3
+ do
+ git checkout -b $b main &&
+ test_commit --no-tag "Change on $b" base $b || return 1
+ done &&
+
+ git checkout branch1 &&
+ # This is a merge that octopus cannot handle. Note, that it does not
+ # just hit conflicts, it completely fails and says that it cannot
+ # handle this type of merge.
+ test_expect_code 2 git merge branch2 branch3 >output 2>&1 &&
+ grep "fatal: merge program failed" output &&
+ grep "Should not be doing an octopus" output &&
+
+ # Make sure we did not leave stray changes around when no appropriate
+ # merge strategy was found
+ git diff --exit-code --name-status &&
+ test_path_is_missing .git/MERGE_HEAD
+'
+
+test_done
diff --git a/t/t7608-merge-messages.sh b/t/t7608-merge-messages.sh
index 0b908ab..2179938 100755
--- a/t/t7608-merge-messages.sh
+++ b/t/t7608-merge-messages.sh
@@ -4,6 +4,7 @@ test_description='test auto-generated merge messages'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
check_oneline() {
diff --git a/t/t7609-mergetool--lib.sh b/t/t7609-mergetool--lib.sh
index 330d6d6..8b1c3bd 100755
--- a/t/t7609-mergetool--lib.sh
+++ b/t/t7609-mergetool--lib.sh
@@ -4,6 +4,7 @@ test_description='git mergetool
Testing basic merge tools options'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'mergetool --tool=vimdiff creates the expected layout' '
diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh
index 8cc6472..22b3a85 100755
--- a/t/t7610-mergetool.sh
+++ b/t/t7610-mergetool.sh
@@ -33,7 +33,7 @@ test_expect_success 'setup' '
git add foo &&
git commit -m "Add foo"
) &&
- git submodule add git://example.com/submod submod &&
+ git submodule add file:///dev/null submod &&
git add file1 "spaced name" file1[1-4] subdir/file3 .gitmodules submod &&
git commit -m "add initial versions" &&
@@ -614,7 +614,7 @@ test_expect_success 'submodule in subdirectory' '
)
) &&
test_when_finished "rm -rf subdir/subdir_module" &&
- git submodule add git://example.com/subsubmodule subdir/subdir_module &&
+ git submodule add file:///dev/null subdir/subdir_module &&
git add subdir/subdir_module &&
git commit -m "add submodule in subdirectory" &&
@@ -860,4 +860,42 @@ test_expect_success 'mergetool hideResolved' '
git commit -m "test resolved with mergetool"
'
+test_expect_success 'mergetool with guiDefault' '
+ test_config merge.guitool myguitool &&
+ test_config mergetool.myguitool.cmd "(printf \"gui \" && cat \"\$REMOTE\") >\"\$MERGED\"" &&
+ test_config mergetool.myguitool.trustExitCode true &&
+ test_when_finished "git reset --hard" &&
+ git checkout -b test$test_count branch1 &&
+ git submodule update -N &&
+ test_must_fail git merge main &&
+
+ test_config mergetool.guiDefault auto &&
+ DISPLAY=SOMETHING && export DISPLAY &&
+ yes "" | git mergetool both &&
+ yes "" | git mergetool file1 file1 &&
+
+ DISPLAY= && export DISPLAY &&
+ yes "" | git mergetool file2 "spaced name" &&
+
+ test_config mergetool.guiDefault true &&
+ yes "" | git mergetool subdir/file3 &&
+
+ yes "d" | git mergetool file11 &&
+ yes "d" | git mergetool file12 &&
+ yes "l" | git mergetool submod &&
+
+ echo "gui main updated" >expect &&
+ test_cmp expect file1 &&
+
+ echo "main new" >expect &&
+ test_cmp expect file2 &&
+
+ echo "gui main new sub" >expect &&
+ test_cmp expect subdir/file3 &&
+
+ echo "branch1 submodule" >expect &&
+ test_cmp expect submod/bar &&
+ git commit -m "branch1 resolved with mergetool"
+'
+
test_done
diff --git a/t/t7611-merge-abort.sh b/t/t7611-merge-abort.sh
index c0e9425..d6975ca 100755
--- a/t/t7611-merge-abort.sh
+++ b/t/t7611-merge-abort.sh
@@ -50,7 +50,7 @@ pre_merge_head="$(git rev-parse HEAD)"
test_expect_success 'fails without MERGE_HEAD (unstarted merge)' '
test_must_fail git merge --abort 2>output &&
- test_i18ngrep MERGE_HEAD output
+ test_grep MERGE_HEAD output
'
test_expect_success 'fails without MERGE_HEAD (unstarted merge): .git/MERGE_HEAD sanity' '
@@ -64,7 +64,7 @@ test_expect_success 'fails without MERGE_HEAD (completed merge)' '
# Merge successfully completed
post_merge_head="$(git rev-parse HEAD)" &&
test_must_fail git merge --abort 2>output &&
- test_i18ngrep MERGE_HEAD output
+ test_grep MERGE_HEAD output
'
test_expect_success 'fails without MERGE_HEAD (completed merge): .git/MERGE_HEAD sanity' '
diff --git a/t/t7612-merge-verify-signatures.sh b/t/t7612-merge-verify-signatures.sh
index 61330f7..84ddb56 100755
--- a/t/t7612-merge-verify-signatures.sh
+++ b/t/t7612-merge-verify-signatures.sh
@@ -4,6 +4,7 @@ test_description='merge signature verification tests'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY/lib-gpg.sh"
@@ -40,54 +41,54 @@ test_expect_success GPG 'create signed commits' '
test_expect_success GPG 'merge unsigned commit with verification' '
test_when_finished "git reset --hard && git checkout initial" &&
test_must_fail git merge --ff-only --verify-signatures side-unsigned 2>mergeerror &&
- test_i18ngrep "does not have a GPG signature" mergeerror
+ test_grep "does not have a GPG signature" mergeerror
'
test_expect_success GPG 'merge unsigned commit with merge.verifySignatures=true' '
test_when_finished "git reset --hard && git checkout initial" &&
test_config merge.verifySignatures true &&
test_must_fail git merge --ff-only side-unsigned 2>mergeerror &&
- test_i18ngrep "does not have a GPG signature" mergeerror
+ test_grep "does not have a GPG signature" mergeerror
'
test_expect_success GPG 'merge commit with bad signature with verification' '
test_when_finished "git reset --hard && git checkout initial" &&
test_must_fail git merge --ff-only --verify-signatures $(cat forged.commit) 2>mergeerror &&
- test_i18ngrep "has a bad GPG signature" mergeerror
+ test_grep "has a bad GPG signature" mergeerror
'
test_expect_success GPG 'merge commit with bad signature with merge.verifySignatures=true' '
test_when_finished "git reset --hard && git checkout initial" &&
test_config merge.verifySignatures true &&
test_must_fail git merge --ff-only $(cat forged.commit) 2>mergeerror &&
- test_i18ngrep "has a bad GPG signature" mergeerror
+ test_grep "has a bad GPG signature" mergeerror
'
test_expect_success GPG 'merge commit with untrusted signature with verification' '
test_when_finished "git reset --hard && git checkout initial" &&
test_must_fail git merge --ff-only --verify-signatures side-untrusted 2>mergeerror &&
- test_i18ngrep "has an untrusted GPG signature" mergeerror
+ test_grep "has an untrusted GPG signature" mergeerror
'
test_expect_success GPG 'merge commit with untrusted signature with verification and high minTrustLevel' '
test_when_finished "git reset --hard && git checkout initial" &&
test_config gpg.minTrustLevel marginal &&
test_must_fail git merge --ff-only --verify-signatures side-untrusted 2>mergeerror &&
- test_i18ngrep "has an untrusted GPG signature" mergeerror
+ test_grep "has an untrusted GPG signature" mergeerror
'
test_expect_success GPG 'merge commit with untrusted signature with verification and low minTrustLevel' '
test_when_finished "git reset --hard && git checkout initial" &&
test_config gpg.minTrustLevel undefined &&
git merge --ff-only --verify-signatures side-untrusted >mergeoutput &&
- test_i18ngrep "has a good GPG signature" mergeoutput
+ test_grep "has a good GPG signature" mergeoutput
'
test_expect_success GPG 'merge commit with untrusted signature with merge.verifySignatures=true' '
test_when_finished "git reset --hard && git checkout initial" &&
test_config merge.verifySignatures true &&
test_must_fail git merge --ff-only side-untrusted 2>mergeerror &&
- test_i18ngrep "has an untrusted GPG signature" mergeerror
+ test_grep "has an untrusted GPG signature" mergeerror
'
test_expect_success GPG 'merge commit with untrusted signature with merge.verifySignatures=true and minTrustLevel' '
@@ -95,20 +96,20 @@ test_expect_success GPG 'merge commit with untrusted signature with merge.verify
test_config merge.verifySignatures true &&
test_config gpg.minTrustLevel marginal &&
test_must_fail git merge --ff-only side-untrusted 2>mergeerror &&
- test_i18ngrep "has an untrusted GPG signature" mergeerror
+ test_grep "has an untrusted GPG signature" mergeerror
'
test_expect_success GPG 'merge signed commit with verification' '
test_when_finished "git reset --hard && git checkout initial" &&
git merge --verbose --ff-only --verify-signatures side-signed >mergeoutput &&
- test_i18ngrep "has a good GPG signature" mergeoutput
+ test_grep "has a good GPG signature" mergeoutput
'
test_expect_success GPG 'merge signed commit with merge.verifySignatures=true' '
test_when_finished "git reset --hard && git checkout initial" &&
test_config merge.verifySignatures true &&
git merge --verbose --ff-only side-signed >mergeoutput &&
- test_i18ngrep "has a good GPG signature" mergeoutput
+ test_grep "has a good GPG signature" mergeoutput
'
test_expect_success GPG 'merge commit with bad signature without verification' '
@@ -132,7 +133,7 @@ test_expect_success GPG 'merge unsigned commit into unborn branch' '
test_when_finished "git checkout initial" &&
git checkout --orphan unborn &&
test_must_fail git merge --verify-signatures side-unsigned 2>mergeerror &&
- test_i18ngrep "does not have a GPG signature" mergeerror
+ test_grep "does not have a GPG signature" mergeerror
'
test_done
diff --git a/t/t7614-merge-signoff.sh b/t/t7614-merge-signoff.sh
index fee258d..cf96a35 100755
--- a/t/t7614-merge-signoff.sh
+++ b/t/t7614-merge-signoff.sh
@@ -8,6 +8,7 @@ This test runs git merge --signoff and makes sure that it works.
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# Setup test files
diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh
index ca45c4c..127efe9 100755
--- a/t/t7700-repack.sh
+++ b/t/t7700-repack.sh
@@ -10,6 +10,10 @@ test_description='git repack works correctly'
commit_and_pack () {
test_commit "$@" 1>&2 &&
incrpackid=$(git pack-objects --all --unpacked --incremental .git/objects/pack/pack </dev/null) &&
+ # Remove any loose object(s) created by test_commit, since they have
+ # already been packed. Leaving these around can create subtly different
+ # packs with `pack-objects`'s `--unpacked` option.
+ git prune-packed 1>&2 &&
echo pack-${incrpackid}.pack
}
@@ -90,6 +94,39 @@ test_expect_success 'loose objects in alternate ODB are not repacked' '
test_has_duplicate_object false
'
+test_expect_success SYMLINKS '--local keeps packs when alternate is objectdir ' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ test_commit -C repo A &&
+ (
+ cd repo &&
+ git repack -a &&
+ ls .git/objects/pack/*.pack >../expect &&
+ ln -s objects .git/alt_objects &&
+ echo "$(pwd)/.git/alt_objects" >.git/objects/info/alternates &&
+ git repack -a -d -l &&
+ ls .git/objects/pack/*.pack >../actual
+ ) &&
+ test_cmp expect actual
+'
+
+test_expect_success '--local disables writing bitmaps when connected to alternate ODB' '
+ test_when_finished "rm -rf shared member" &&
+
+ git init shared &&
+ git clone --shared shared member &&
+ (
+ cd member &&
+ test_commit "object" &&
+ GIT_TEST_MULTI_PACK_INDEX=0 git repack -Adl --write-bitmap-index 2>err &&
+ cat >expect <<-EOF &&
+ warning: disabling bitmap writing, as some objects are not being packed
+ EOF
+ test_cmp expect err &&
+ test_path_is_missing .git/objects/pack-*.bitmap
+ )
+'
+
test_expect_success 'packed obs in alt ODB are repacked even when local repo is packless' '
mkdir alt_objects/pack &&
mv .git/objects/pack/* alt_objects/pack &&
@@ -176,6 +213,8 @@ test_expect_success 'repack --keep-pack' '
test_create_repo keep-pack &&
(
cd keep-pack &&
+ # avoid producing different packs due to delta/base choices
+ git config pack.window 0 &&
P1=$(commit_and_pack 1) &&
P2=$(commit_and_pack 2) &&
P3=$(commit_and_pack 3) &&
@@ -187,10 +226,61 @@ test_expect_success 'repack --keep-pack' '
grep -q $P1 new-counts &&
grep -q $P4 new-counts &&
test_line_count = 3 new-counts &&
+ git fsck &&
+
+ P5=$(commit_and_pack --no-tag 5) &&
+ git reset --hard HEAD^ &&
+ git reflog expire --all --expire=all &&
+ rm -f ".git/objects/pack/${P5%.pack}.idx" &&
+ rm -f ".git/objects/info/commit-graph" &&
+ for from in $(find .git/objects/pack -type f -name "${P5%.pack}.*")
+ do
+ to="$(dirname "$from")/.tmp-1234-$(basename "$from")" &&
+ mv "$from" "$to" || return 1
+ done &&
+
+ # A .idx file without a .pack should not stop us from
+ # repacking what we can.
+ touch .git/objects/pack/pack-does-not-exist.idx &&
+
+ git repack --cruft -d --keep-pack $P1 --keep-pack $P4 &&
+
+ ls .git/objects/pack/*.pack >newer-counts &&
+ test_cmp new-counts newer-counts &&
git fsck
)
'
+test_expect_success 'repacking fails when missing .pack actually means missing objects' '
+ test_create_repo idx-without-pack &&
+ (
+ cd idx-without-pack &&
+
+ # Avoid producing different packs due to delta/base choices
+ git config pack.window 0 &&
+ P1=$(commit_and_pack 1) &&
+ P2=$(commit_and_pack 2) &&
+ P3=$(commit_and_pack 3) &&
+ P4=$(commit_and_pack 4) &&
+ ls .git/objects/pack/*.pack >old-counts &&
+ test_line_count = 4 old-counts &&
+
+ # Remove one .pack file
+ rm .git/objects/pack/$P2 &&
+
+ ls .git/objects/pack/*.pack >before-pack-dir &&
+
+ test_must_fail git fsck &&
+ test_must_fail env GIT_COMMIT_GRAPH_PARANOIA=true git repack --cruft -d 2>err &&
+ grep "bad object" err &&
+
+ # Before failing, the repack did not modify the
+ # pack directory.
+ ls .git/objects/pack/*.pack >after-pack-dir &&
+ test_cmp before-pack-dir after-pack-dir
+ )
+'
+
test_expect_success 'bitmaps are created by default in bare repos' '
git clone --bare .git bare.git &&
rm -f bare.git/objects/pack/*.bitmap &&
@@ -237,6 +327,203 @@ test_expect_success 'auto-bitmaps do not complain if unavailable' '
test_must_be_empty actual
'
+test_expect_success 'repacking with a filter works' '
+ git -C bare.git repack -a -d &&
+ test_stdout_line_count = 1 ls bare.git/objects/pack/*.pack &&
+ git -C bare.git -c repack.writebitmaps=false repack -a -d --filter=blob:none &&
+ test_stdout_line_count = 2 ls bare.git/objects/pack/*.pack &&
+ commit_pack=$(test-tool -C bare.git find-pack -c 1 HEAD) &&
+ blob_pack=$(test-tool -C bare.git find-pack -c 1 HEAD:file1) &&
+ test "$commit_pack" != "$blob_pack" &&
+ tree_pack=$(test-tool -C bare.git find-pack -c 1 HEAD^{tree}) &&
+ test "$tree_pack" = "$commit_pack" &&
+ blob_pack2=$(test-tool -C bare.git find-pack -c 1 HEAD:file2) &&
+ test "$blob_pack2" = "$blob_pack"
+'
+
+test_expect_success '--filter fails with --write-bitmap-index' '
+ test_must_fail \
+ env GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
+ git -C bare.git repack -a -d --write-bitmap-index --filter=blob:none
+'
+
+test_expect_success 'repacking with two filters works' '
+ git init two-filters &&
+ (
+ cd two-filters &&
+ mkdir subdir &&
+ test_commit foo &&
+ test_commit subdir_bar subdir/bar &&
+ test_commit subdir_baz subdir/baz
+ ) &&
+ git clone --no-local --bare two-filters two-filters.git &&
+ (
+ cd two-filters.git &&
+ test_stdout_line_count = 1 ls objects/pack/*.pack &&
+ git -c repack.writebitmaps=false repack -a -d \
+ --filter=blob:none --filter=tree:1 &&
+ test_stdout_line_count = 2 ls objects/pack/*.pack &&
+ commit_pack=$(test-tool find-pack -c 1 HEAD) &&
+ blob_pack=$(test-tool find-pack -c 1 HEAD:foo.t) &&
+ root_tree_pack=$(test-tool find-pack -c 1 HEAD^{tree}) &&
+ subdir_tree_hash=$(git ls-tree --object-only HEAD -- subdir) &&
+ subdir_tree_pack=$(test-tool find-pack -c 1 "$subdir_tree_hash") &&
+
+ # Root tree and subdir tree are not in the same packfiles
+ test "$commit_pack" != "$blob_pack" &&
+ test "$commit_pack" = "$root_tree_pack" &&
+ test "$blob_pack" = "$subdir_tree_pack"
+ )
+'
+
+prepare_for_keep_packs () {
+ git init keep-packs &&
+ (
+ cd keep-packs &&
+ test_commit foo &&
+ test_commit bar
+ ) &&
+ git clone --no-local --bare keep-packs keep-packs.git &&
+ (
+ cd keep-packs.git &&
+
+ # Create two packs
+ # The first pack will contain all of the objects except one blob
+ git rev-list --objects --all >objs &&
+ grep -v "bar.t" objs | git pack-objects pack &&
+ # The second pack will contain the excluded object and be kept
+ packid=$(grep "bar.t" objs | git pack-objects pack) &&
+ >pack-$packid.keep &&
+
+ # Replace the existing pack with the 2 new ones
+ rm -f objects/pack/pack* &&
+ mv pack-* objects/pack/
+ )
+}
+
+test_expect_success '--filter works with .keep packs' '
+ prepare_for_keep_packs &&
+ (
+ cd keep-packs.git &&
+
+ foo_pack=$(test-tool find-pack -c 1 HEAD:foo.t) &&
+ bar_pack=$(test-tool find-pack -c 1 HEAD:bar.t) &&
+ head_pack=$(test-tool find-pack -c 1 HEAD) &&
+
+ test "$foo_pack" != "$bar_pack" &&
+ test "$foo_pack" = "$head_pack" &&
+
+ git -c repack.writebitmaps=false repack -a -d --filter=blob:none &&
+
+ foo_pack_1=$(test-tool find-pack -c 1 HEAD:foo.t) &&
+ bar_pack_1=$(test-tool find-pack -c 1 HEAD:bar.t) &&
+ head_pack_1=$(test-tool find-pack -c 1 HEAD) &&
+
+ # Object bar is still only in the old .keep pack
+ test "$foo_pack_1" != "$foo_pack" &&
+ test "$bar_pack_1" = "$bar_pack" &&
+ test "$head_pack_1" != "$head_pack" &&
+
+ test "$foo_pack_1" != "$bar_pack_1" &&
+ test "$foo_pack_1" != "$head_pack_1" &&
+ test "$bar_pack_1" != "$head_pack_1"
+ )
+'
+
+test_expect_success '--filter works with --pack-kept-objects and .keep packs' '
+ rm -rf keep-packs keep-packs.git &&
+ prepare_for_keep_packs &&
+ (
+ cd keep-packs.git &&
+
+ foo_pack=$(test-tool find-pack -c 1 HEAD:foo.t) &&
+ bar_pack=$(test-tool find-pack -c 1 HEAD:bar.t) &&
+ head_pack=$(test-tool find-pack -c 1 HEAD) &&
+
+ test "$foo_pack" != "$bar_pack" &&
+ test "$foo_pack" = "$head_pack" &&
+
+ git -c repack.writebitmaps=false repack -a -d --filter=blob:none \
+ --pack-kept-objects &&
+
+ foo_pack_1=$(test-tool find-pack -c 1 HEAD:foo.t) &&
+ test-tool find-pack -c 2 HEAD:bar.t >bar_pack_1 &&
+ head_pack_1=$(test-tool find-pack -c 1 HEAD) &&
+
+ test "$foo_pack_1" != "$foo_pack" &&
+ test "$foo_pack_1" != "$bar_pack" &&
+ test "$head_pack_1" != "$head_pack" &&
+
+ # Object bar is in both the old .keep pack and the new
+ # pack that contained the filtered out objects
+ grep "$bar_pack" bar_pack_1 &&
+ grep "$foo_pack_1" bar_pack_1 &&
+ test "$foo_pack_1" != "$head_pack_1"
+ )
+'
+
+test_expect_success '--filter-to stores filtered out objects' '
+ git -C bare.git repack -a -d &&
+ test_stdout_line_count = 1 ls bare.git/objects/pack/*.pack &&
+
+ git init --bare filtered.git &&
+ git -C bare.git -c repack.writebitmaps=false repack -a -d \
+ --filter=blob:none \
+ --filter-to=../filtered.git/objects/pack/pack &&
+ test_stdout_line_count = 1 ls bare.git/objects/pack/pack-*.pack &&
+ test_stdout_line_count = 1 ls filtered.git/objects/pack/pack-*.pack &&
+
+ commit_pack=$(test-tool -C bare.git find-pack -c 1 HEAD) &&
+ blob_pack=$(test-tool -C bare.git find-pack -c 0 HEAD:file1) &&
+ blob_hash=$(git -C bare.git rev-parse HEAD:file1) &&
+ test -n "$blob_hash" &&
+ blob_pack=$(test-tool -C filtered.git find-pack -c 1 $blob_hash) &&
+
+ echo $(pwd)/filtered.git/objects >bare.git/objects/info/alternates &&
+ blob_pack=$(test-tool -C bare.git find-pack -c 1 HEAD:file1) &&
+ blob_content=$(git -C bare.git show $blob_hash) &&
+ test "$blob_content" = "content1"
+'
+
+test_expect_success '--filter works with --max-pack-size' '
+ rm -rf filtered.git &&
+ git init --bare filtered.git &&
+ git init max-pack-size &&
+ (
+ cd max-pack-size &&
+ test_commit base &&
+ # two blobs which exceed the maximum pack size
+ test-tool genrandom foo 1048576 >foo &&
+ git hash-object -w foo &&
+ test-tool genrandom bar 1048576 >bar &&
+ git hash-object -w bar &&
+ git add foo bar &&
+ git commit -m "adding foo and bar"
+ ) &&
+ git clone --no-local --bare max-pack-size max-pack-size.git &&
+ (
+ cd max-pack-size.git &&
+ git -c repack.writebitmaps=false repack -a -d --filter=blob:none \
+ --max-pack-size=1M \
+ --filter-to=../filtered.git/objects/pack/pack &&
+ echo $(cd .. && pwd)/filtered.git/objects >objects/info/alternates &&
+
+ # Check that the 3 blobs are in different packfiles in filtered.git
+ test_stdout_line_count = 3 ls ../filtered.git/objects/pack/pack-*.pack &&
+ test_stdout_line_count = 1 ls objects/pack/pack-*.pack &&
+ foo_pack=$(test-tool find-pack -c 1 HEAD:foo) &&
+ bar_pack=$(test-tool find-pack -c 1 HEAD:bar) &&
+ base_pack=$(test-tool find-pack -c 1 HEAD:base.t) &&
+ test "$foo_pack" != "$bar_pack" &&
+ test "$foo_pack" != "$base_pack" &&
+ test "$bar_pack" != "$base_pack" &&
+ for pack in "$foo_pack" "$bar_pack" "$base_pack"
+ do
+ case "$foo_pack" in */filtered.git/objects/pack/*) true ;; *) return 1 ;; esac
+ done
+ )
+'
+
objdir=.git/objects
midx=$objdir/pack/multi-pack-index
@@ -342,6 +629,7 @@ test_expect_success '--write-midx with preferred bitmap tips' '
git log --format="create refs/tags/%s/%s %H" HEAD >refs &&
git update-ref --stdin <refs &&
+ GIT_TEST_MULTI_PACK_INDEX=0 \
git repack --write-midx --write-bitmap-index &&
test_path_is_file $midx &&
test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
@@ -426,12 +714,74 @@ test_expect_success '--write-midx -b packs non-kept objects' '
)
'
+test_expect_success '--write-midx removes stale pack-based bitmaps' '
+ rm -fr repo &&
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+ test_commit base &&
+ GIT_TEST_MULTI_PACK_INDEX=0 git repack -Ab &&
+
+ pack_bitmap=$(ls $objdir/pack/pack-*.bitmap) &&
+ test_path_is_file "$pack_bitmap" &&
+
+ test_commit tip &&
+ GIT_TEST_MULTI_PACK_INDEX=0 git repack -bm &&
+
+ test_path_is_file $midx &&
+ test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
+ test_path_is_missing $pack_bitmap
+ )
+'
+
+test_expect_success '--write-midx with --pack-kept-objects' '
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+
+ test_commit one &&
+ test_commit two &&
+
+ one="$(echo "one" | git pack-objects --revs $objdir/pack/pack)" &&
+ two="$(echo "one..two" | git pack-objects --revs $objdir/pack/pack)" &&
+
+ keep="$objdir/pack/pack-$one.keep" &&
+ touch "$keep" &&
+
+ GIT_TEST_MULTI_PACK_INDEX=0 \
+ git repack --write-midx --write-bitmap-index --geometric=2 -d \
+ --pack-kept-objects &&
+
+ test_path_is_file $keep &&
+ test_path_is_file $midx &&
+ test_path_is_file $midx-$(midx_checksum $objdir).bitmap
+ )
+'
+
test_expect_success TTY '--quiet disables progress' '
test_terminal env GIT_PROGRESS_DELAY=0 \
git -C midx repack -ad --quiet --write-midx 2>stderr &&
test_must_be_empty stderr
'
+test_expect_success 'clean up .tmp-* packs on error' '
+ test_must_fail ok=sigpipe git \
+ -c repack.cruftwindow=bogus \
+ repack -ad --cruft &&
+ find $objdir/pack -name '.tmp-*' >tmpfiles &&
+ test_must_be_empty tmpfiles
+'
+
+test_expect_success 'repack -ad cleans up old .tmp-* packs' '
+ git rev-parse HEAD >input &&
+ git pack-objects $objdir/pack/.tmp-1234 <input &&
+ git repack -ad &&
+ find $objdir/pack -name '.tmp-*' >tmpfiles &&
+ test_must_be_empty tmpfiles
+'
+
test_expect_success 'setup for update-server-info' '
git init update-server-info &&
test_commit -C update-server-info message
diff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh
index 937f89e..fe6c3e7 100755
--- a/t/t7701-repack-unpack-unreachable.sh
+++ b/t/t7701-repack-unpack-unreachable.sh
@@ -5,6 +5,7 @@ test_description='git repack works correctly'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
fsha1=
@@ -35,7 +36,7 @@ test_expect_success '-A with -d option leaves unreachable objects unpacked' '
git repack -A -d -l &&
# verify objects are packed in repository
test 3 = $(git verify-pack -v -- .git/objects/pack/*.idx |
- egrep "^($fsha1|$csha1|$tsha1) " |
+ grep -E "^($fsha1|$csha1|$tsha1) " |
sort | uniq | wc -l) &&
git show $fsha1 &&
git show $csha1 &&
@@ -49,7 +50,7 @@ test_expect_success '-A with -d option leaves unreachable objects unpacked' '
git repack -A -d -l &&
# verify objects are retained unpacked
test 0 = $(git verify-pack -v -- .git/objects/pack/*.idx |
- egrep "^($fsha1|$csha1|$tsha1) " |
+ grep -E "^($fsha1|$csha1|$tsha1) " |
sort | uniq | wc -l) &&
git show $fsha1 &&
git show $csha1 &&
@@ -112,6 +113,48 @@ test_expect_success 'do not bother loosening old objects' '
test_must_fail git cat-file -p $obj2
'
+test_expect_success 'gc.recentObjectsHook' '
+ obj1=$(echo one | git hash-object -w --stdin) &&
+ obj2=$(echo two | git hash-object -w --stdin) &&
+ obj3=$(echo three | git hash-object -w --stdin) &&
+ pack1=$(echo $obj1 | git pack-objects .git/objects/pack/pack) &&
+ pack2=$(echo $obj2 | git pack-objects .git/objects/pack/pack) &&
+ pack3=$(echo $obj3 | git pack-objects .git/objects/pack/pack) &&
+ git prune-packed &&
+
+ git cat-file -p $obj1 &&
+ git cat-file -p $obj2 &&
+ git cat-file -p $obj3 &&
+
+ # make an unreachable annotated tag object to ensure we rescue objects
+ # which are reachable from non-pruned unreachable objects
+ obj2_tag="$(git mktag <<-EOF
+ object $obj2
+ type blob
+ tag obj2-tag
+ tagger T A Gger <tagger@example.com> 1234567890 -0000
+ EOF
+ )" &&
+
+ obj2_tag_pack="$(echo $obj2_tag | git pack-objects .git/objects/pack/pack)" &&
+ git prune-packed &&
+
+ write_script precious-objects <<-EOF &&
+ echo $obj2_tag
+ EOF
+ git config gc.recentObjectsHook ./precious-objects &&
+
+ test-tool chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&
+ test-tool chmtime =-86400 .git/objects/pack/pack-$pack3.pack &&
+ test-tool chmtime =-86400 .git/objects/pack/pack-$obj2_tag_pack.pack &&
+ git repack -A -d --unpack-unreachable=1.hour.ago &&
+
+ git cat-file -p $obj1 &&
+ git cat-file -p $obj2 &&
+ git cat-file -p $obj2_tag &&
+ test_must_fail git cat-file -p $obj3
+'
+
test_expect_success 'keep packed objects found only in index' '
echo my-unique-content >file &&
git add file &&
diff --git a/t/t7703-repack-geometric.sh b/t/t7703-repack-geometric.sh
index da87f8b..9fc1626 100755
--- a/t/t7703-repack-geometric.sh
+++ b/t/t7703-repack-geometric.sh
@@ -10,6 +10,12 @@ objdir=.git/objects
packdir=$objdir/pack
midx=$objdir/pack/multi-pack-index
+packed_objects () {
+ git show-index <"$1" >tmp-object-list &&
+ cut -d' ' -f2 tmp-object-list | sort &&
+ rm tmp-object-list
+ }
+
test_expect_success '--geometric with no packs' '
git init geometric &&
test_when_finished "rm -fr geometric" &&
@@ -17,7 +23,7 @@ test_expect_success '--geometric with no packs' '
cd geometric &&
git repack --write-midx --geometric 2 >out &&
- test_i18ngrep "Nothing new to pack" out
+ test_grep "Nothing new to pack" out
)
'
@@ -32,7 +38,7 @@ test_expect_success '--geometric with one pack' '
git repack --geometric 2 >out &&
- test_i18ngrep "Nothing new to pack" out
+ test_grep "Nothing new to pack" out
)
'
@@ -176,8 +182,12 @@ test_expect_success '--geometric ignores kept packs' '
# be repacked, too.
git repack --geometric 2 -d --pack-kept-objects &&
+ # After repacking, two packs remain: one new one (containing the
+ # objects in both the .keep and non-kept pack), and the .keep
+ # pack (since `--pack-kept-objects -d` does not actually delete
+ # the kept pack).
find $objdir/pack -name "*.pack" >after &&
- test_line_count = 1 after
+ test_line_count = 2 after
)
'
@@ -277,4 +287,162 @@ test_expect_success '--geometric with pack.packSizeLimit' '
)
'
+test_expect_success '--geometric --write-midx with packfiles in main and alternate ODB' '
+ test_when_finished "rm -fr shared member" &&
+
+ # Create a shared repository that will serve as the alternate object
+ # database for the member linked to it. It has got some objects on its
+ # own that are packed into a single packfile.
+ git init shared &&
+ test_commit -C shared common-object &&
+ git -C shared repack -ad &&
+
+ # We create member so that its alternates file points to the shared
+ # repository. We then create a commit in it so that git-repack(1) has
+ # something to repack.
+ # of the shared object database.
+ git clone --shared shared member &&
+ test_commit -C member unique-object &&
+ git -C member repack --geometric=2 --write-midx 2>err &&
+ test_must_be_empty err &&
+
+ # We should see that a new packfile was generated.
+ find shared/.git/objects/pack -type f -name "*.pack" >packs &&
+ test_line_count = 1 packs &&
+
+ # We should also see a multi-pack-index. This multi-pack-index should
+ # never refer to any packfiles in the alternate object database.
+ test_path_is_file member/.git/objects/pack/multi-pack-index &&
+ test-tool read-midx member/.git/objects >packs.midx &&
+ grep "^pack-.*\.idx$" packs.midx | sort >actual &&
+ basename member/.git/objects/pack/pack-*.idx >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success '--geometric --with-midx with no local objects' '
+ test_when_finished "rm -fr shared member" &&
+
+ # Create a repository with a single packfile that acts as alternate
+ # object database.
+ git init shared &&
+ test_commit -C shared "shared-objects" &&
+ git -C shared repack -ad &&
+
+ # Create a second repository linked to the first one and perform a
+ # geometric repack on it.
+ git clone --shared shared member &&
+ git -C member repack --geometric 2 --write-midx 2>err &&
+ test_must_be_empty err &&
+
+ # Assert that we wrote neither a new packfile nor a multi-pack-index.
+ # We should not have a packfile because the single packfile in the
+ # alternate object database does not invalidate the geometric sequence.
+ # And we should not have a multi-pack-index because these only index
+ # local packfiles, and there are none.
+ test_dir_is_empty member/$packdir
+'
+
+test_expect_success '--geometric with same pack in main and alternate ODB' '
+ test_when_finished "rm -fr shared member" &&
+
+ # Create a repository with a single packfile that acts as alternate
+ # object database.
+ git init shared &&
+ test_commit -C shared "shared-objects" &&
+ git -C shared repack -ad &&
+
+ # We create the member repository as an exact copy so that it has the
+ # same packfile.
+ cp -r shared member &&
+ test-tool path-utils real_path shared/.git/objects >member/.git/objects/info/alternates &&
+ find shared/.git/objects -type f >expected-files &&
+
+ # Verify that we can repack objects as expected without observing any
+ # error. Having the same packfile in both ODBs used to cause an error
+ # in git-pack-objects(1).
+ git -C member repack --geometric 2 2>err &&
+ test_must_be_empty err &&
+ # Nothing should have changed.
+ find shared/.git/objects -type f >actual-files &&
+ test_cmp expected-files actual-files
+'
+
+test_expect_success '--geometric -l with non-intact geometric sequence across ODBs' '
+ test_when_finished "rm -fr shared member" &&
+
+ git init shared &&
+ test_commit_bulk -C shared --start=1 1 &&
+
+ git clone --shared shared member &&
+ test_commit_bulk -C member --start=2 1 &&
+
+ # Verify that our assumptions actually hold: both generated packfiles
+ # should have three objects and should be non-equal.
+ packed_objects shared/.git/objects/pack/pack-*.idx >shared-objects &&
+ packed_objects member/.git/objects/pack/pack-*.idx >member-objects &&
+ test_line_count = 3 shared-objects &&
+ test_line_count = 3 member-objects &&
+ ! test_cmp shared-objects member-objects &&
+
+ # Perform the geometric repack. With `-l`, we should only see the local
+ # packfile and thus arrive at the conclusion that the geometric
+ # sequence is intact. We thus expect no changes.
+ #
+ # Note that we are tweaking mtimes of the packfiles so that we can
+ # verify they did not change. This is done in order to detect the case
+ # where we do repack objects, but the resulting packfile is the same.
+ test-tool chmtime --verbose =0 member/.git/objects/pack/* >expected-member-packs &&
+ git -C member repack --geometric=2 -l -d &&
+ test-tool chmtime --verbose member/.git/objects/pack/* >actual-member-packs &&
+ test_cmp expected-member-packs actual-member-packs &&
+
+ {
+ packed_objects shared/.git/objects/pack/pack-*.idx &&
+ packed_objects member/.git/objects/pack/pack-*.idx
+ } | sort >expected-objects &&
+
+ # On the other hand, when doing a non-local geometric repack we should
+ # see both packfiles and thus repack them. We expect that the shared
+ # object database was not changed.
+ test-tool chmtime --verbose =0 shared/.git/objects/pack/* >expected-shared-packs &&
+ git -C member repack --geometric=2 -d &&
+ test-tool chmtime --verbose shared/.git/objects/pack/* >actual-shared-packs &&
+ test_cmp expected-shared-packs actual-shared-packs &&
+
+ # Furthermore, we expect that the member repository now has a single
+ # packfile that contains the combined shared and non-shared objects.
+ ls member/.git/objects/pack/pack-*.idx >actual &&
+ test_line_count = 1 actual &&
+ packed_objects member/.git/objects/pack/pack-*.idx >actual-objects &&
+ test_line_count = 6 actual-objects &&
+ test_cmp expected-objects actual-objects
+'
+
+test_expect_success '--geometric -l disables writing bitmaps with non-local packfiles' '
+ test_when_finished "rm -fr shared member" &&
+
+ git init shared &&
+ test_commit_bulk -C shared --start=1 1 &&
+
+ git clone --shared shared member &&
+ test_commit_bulk -C member --start=2 1 &&
+
+ # When performing a geometric repack with `-l` while connected to an
+ # alternate object database that has a packfile we do not have full
+ # coverage of objects. As a result, we expect that writing the bitmap
+ # will be disabled.
+ git -C member repack -l --geometric=2 --write-midx --write-bitmap-index 2>err &&
+ cat >expect <<-EOF &&
+ warning: disabling bitmap writing, as some objects are not being packed
+ EOF
+ test_cmp expect err &&
+ test_path_is_missing member/.git/objects/pack/multi-pack-index-*.bitmap &&
+
+ # On the other hand, when we repack without `-l`, we should see that
+ # the bitmap gets created.
+ git -C member repack --geometric=2 --write-midx --write-bitmap-index 2>err &&
+ test_must_be_empty err &&
+ test_path_is_file member/.git/objects/pack/multi-pack-index-*.bitmap
+'
+
test_done
diff --git a/t/t7704-repack-cruft.sh b/t/t7704-repack-cruft.sh
new file mode 100755
index 0000000..71e1ef3
--- /dev/null
+++ b/t/t7704-repack-cruft.sh
@@ -0,0 +1,414 @@
+#!/bin/sh
+
+test_description='git repack works correctly'
+
+. ./test-lib.sh
+
+objdir=.git/objects
+packdir=$objdir/pack
+
+test_expect_success '--expire-to stores pruned objects (now)' '
+ git init expire-to-now &&
+ (
+ cd expire-to-now &&
+
+ git branch -M main &&
+
+ test_commit base &&
+
+ git checkout -b cruft &&
+ test_commit --no-tag cruft &&
+
+ git rev-list --objects --no-object-names main..cruft >moved.raw &&
+ sort moved.raw >moved.want &&
+
+ git rev-list --all --objects --no-object-names >expect.raw &&
+ sort expect.raw >expect &&
+
+ git checkout main &&
+ git branch -D cruft &&
+ git reflog expire --all --expire=all &&
+
+ git init --bare expired.git &&
+ git repack -d \
+ --cruft --cruft-expiration="now" \
+ --expire-to="expired.git/objects/pack/pack" &&
+
+ expired="$(ls expired.git/objects/pack/pack-*.idx)" &&
+ test_path_is_file "${expired%.idx}.mtimes" &&
+
+ # Since the `--cruft-expiration` is "now", the effective
+ # behavior is to move _all_ unreachable objects out to
+ # the location in `--expire-to`.
+ git show-index <$expired >expired.raw &&
+ cut -d" " -f2 expired.raw | sort >expired.objects &&
+ git rev-list --all --objects --no-object-names \
+ >remaining.objects &&
+
+ # ...in other words, the combined contents of this
+ # repository and expired.git should be the same as the
+ # set of objects we started with.
+ sort expired.objects remaining.objects >actual &&
+ test_cmp expect actual &&
+
+ # The "moved" objects (i.e., those in expired.git)
+ # should be the same as the cruft objects which were
+ # expired in the previous step.
+ test_cmp moved.want expired.objects
+ )
+'
+
+test_expect_success '--expire-to stores pruned objects (5.minutes.ago)' '
+ git init expire-to-5.minutes.ago &&
+ (
+ cd expire-to-5.minutes.ago &&
+
+ git branch -M main &&
+
+ test_commit base &&
+
+ # Create two classes of unreachable objects, one which
+ # is older than 5 minutes (stale), and another which is
+ # newer (recent).
+ for kind in stale recent
+ do
+ git checkout -b $kind main &&
+ test_commit --no-tag $kind || return 1
+ done &&
+
+ git rev-list --objects --no-object-names main..stale >in &&
+ stale="$(git pack-objects $objdir/pack/pack <in)" &&
+ mtime="$(test-tool chmtime --get =-600 $objdir/pack/pack-$stale.pack)" &&
+
+ # expect holds the set of objects we expect to find in
+ # this repository after repacking
+ git rev-list --objects --no-object-names recent >expect.raw &&
+ sort expect.raw >expect &&
+
+ # moved.want holds the set of objects we expect to find
+ # in expired.git
+ git rev-list --objects --no-object-names main..stale >out &&
+ sort out >moved.want &&
+
+ git checkout main &&
+ git branch -D stale recent &&
+ git reflog expire --all --expire=all &&
+ git prune-packed &&
+
+ git init --bare expired.git &&
+ git repack -d \
+ --cruft --cruft-expiration=5.minutes.ago \
+ --expire-to="expired.git/objects/pack/pack" &&
+
+ # Some of the remaining objects in this repository are
+ # unreachable, so use `cat-file --batch-all-objects`
+ # instead of `rev-list` to get their names
+ git cat-file --batch-all-objects --batch-check="%(objectname)" \
+ >remaining.objects &&
+ sort remaining.objects >actual &&
+ test_cmp expect actual &&
+
+ (
+ cd expired.git &&
+
+ expired="$(ls objects/pack/pack-*.mtimes)" &&
+ test-tool pack-mtimes $(basename $expired) >out &&
+ cut -d" " -f1 out | sort >../moved.got &&
+
+ # Ensure that there are as many objects with the
+ # expected mtime as were moved to expired.git.
+ #
+ # In other words, ensure that the recorded
+ # mtimes of any moved objects was written
+ # correctly.
+ grep " $mtime$" out >matching &&
+ test_line_count = $(wc -l <../moved.want) matching
+ ) &&
+ test_cmp moved.want moved.got
+ )
+'
+
+generate_random_blob() {
+ test-tool genrandom "$@" >blob &&
+ git hash-object -w -t blob blob &&
+ rm blob
+}
+
+pack_random_blob () {
+ generate_random_blob "$@" &&
+ git repack -d -q >/dev/null
+}
+
+generate_cruft_pack () {
+ pack_random_blob "$@" >/dev/null &&
+
+ ls $packdir/pack-*.pack | xargs -n 1 basename >in &&
+ pack="$(git pack-objects --cruft $packdir/pack <in)" &&
+ git prune-packed &&
+
+ echo "$packdir/pack-$pack.mtimes"
+}
+
+test_expect_success '--max-cruft-size creates new packs when above threshold' '
+ git init max-cruft-size-large &&
+ (
+ cd max-cruft-size-large &&
+ test_commit base &&
+
+ foo="$(pack_random_blob foo $((1*1024*1024)))" &&
+ git repack --cruft -d &&
+ cruft_foo="$(ls $packdir/pack-*.mtimes)" &&
+
+ bar="$(pack_random_blob bar $((1*1024*1024)))" &&
+ git repack --cruft -d --max-cruft-size=1M &&
+ cruft_bar="$(ls $packdir/pack-*.mtimes | grep -v $cruft_foo)" &&
+
+ test-tool pack-mtimes $(basename "$cruft_foo") >foo.objects &&
+ test-tool pack-mtimes $(basename "$cruft_bar") >bar.objects &&
+
+ grep "^$foo" foo.objects &&
+ test_line_count = 1 foo.objects &&
+ grep "^$bar" bar.objects &&
+ test_line_count = 1 bar.objects
+ )
+'
+
+test_expect_success '--max-cruft-size combines existing packs when below threshold' '
+ git init max-cruft-size-small &&
+ (
+ cd max-cruft-size-small &&
+ test_commit base &&
+
+ foo="$(pack_random_blob foo $((1*1024*1024)))" &&
+ git repack --cruft -d &&
+
+ bar="$(pack_random_blob bar $((1*1024*1024)))" &&
+ git repack --cruft -d --max-cruft-size=10M &&
+
+ cruft=$(ls $packdir/pack-*.mtimes) &&
+ test-tool pack-mtimes $(basename "$cruft") >cruft.objects &&
+
+ grep "^$foo" cruft.objects &&
+ grep "^$bar" cruft.objects &&
+ test_line_count = 2 cruft.objects
+ )
+'
+
+test_expect_success '--max-cruft-size combines smaller packs first' '
+ git init max-cruft-size-consume-small &&
+ (
+ cd max-cruft-size-consume-small &&
+
+ test_commit base &&
+ git repack -ad &&
+
+ cruft_foo="$(generate_cruft_pack foo 524288)" && # 0.5 MiB
+ cruft_bar="$(generate_cruft_pack bar 524288)" && # 0.5 MiB
+ cruft_baz="$(generate_cruft_pack baz 1048576)" && # 1.0 MiB
+ cruft_quux="$(generate_cruft_pack quux 1572864)" && # 1.5 MiB
+
+ test-tool pack-mtimes "$(basename $cruft_foo)" >expect.raw &&
+ test-tool pack-mtimes "$(basename $cruft_bar)" >>expect.raw &&
+ sort expect.raw >expect.objects &&
+
+ # repacking with `--max-cruft-size=2M` should combine
+ # both 0.5 MiB packs together, instead of, say, one of
+ # the 0.5 MiB packs with the 1.0 MiB pack
+ ls $packdir/pack-*.mtimes | sort >cruft.before &&
+ git repack -d --cruft --max-cruft-size=2M &&
+ ls $packdir/pack-*.mtimes | sort >cruft.after &&
+
+ comm -13 cruft.before cruft.after >cruft.new &&
+ comm -23 cruft.before cruft.after >cruft.removed &&
+
+ test_line_count = 1 cruft.new &&
+ test_line_count = 2 cruft.removed &&
+
+ # the two smaller packs should be rolled up first
+ printf "%s\n" $cruft_foo $cruft_bar | sort >expect.removed &&
+ test_cmp expect.removed cruft.removed &&
+
+ # ...and contain the set of objects rolled up
+ test-tool pack-mtimes "$(basename $(cat cruft.new))" >actual.raw &&
+ sort actual.raw >actual.objects &&
+
+ test_cmp expect.objects actual.objects
+ )
+'
+
+test_expect_success 'setup --max-cruft-size with freshened objects' '
+ git init max-cruft-size-freshen &&
+ (
+ cd max-cruft-size-freshen &&
+
+ test_commit base &&
+ git repack -ad &&
+
+ foo="$(generate_random_blob foo 64)" &&
+ test-tool chmtime --get -10000 \
+ "$objdir/$(test_oid_to_path "$foo")" >foo.mtime &&
+
+ git repack --cruft -d &&
+
+ cruft="$(ls $packdir/pack-*.mtimes)" &&
+ test-tool pack-mtimes "$(basename $cruft)" >actual &&
+ echo "$foo $(cat foo.mtime)" >expect &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success '--max-cruft-size with freshened objects (loose)' '
+ (
+ cd max-cruft-size-freshen &&
+
+ # regenerate the object, setting its mtime to be more recent
+ foo="$(generate_random_blob foo 64)" &&
+ test-tool chmtime --get -100 \
+ "$objdir/$(test_oid_to_path "$foo")" >foo.mtime &&
+
+ git repack --cruft -d &&
+
+ cruft="$(ls $packdir/pack-*.mtimes)" &&
+ test-tool pack-mtimes "$(basename $cruft)" >actual &&
+ echo "$foo $(cat foo.mtime)" >expect &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success '--max-cruft-size with freshened objects (packed)' '
+ (
+ cd max-cruft-size-freshen &&
+
+ # regenerate the object and store it in a packfile,
+ # setting its mtime to be more recent
+ #
+ # store it alongside another cruft object so that we
+ # do not create an identical copy of the existing
+ # cruft pack (which contains $foo).
+ foo="$(generate_random_blob foo 64)" &&
+ bar="$(generate_random_blob bar 64)" &&
+ foo_pack="$(printf "%s\n" $foo $bar | git pack-objects $packdir/pack)" &&
+ git prune-packed &&
+
+ test-tool chmtime --get -10 \
+ "$packdir/pack-$foo_pack.pack" >foo.mtime &&
+
+ git repack --cruft -d &&
+
+ cruft="$(ls $packdir/pack-*.mtimes)" &&
+ test-tool pack-mtimes "$(basename $cruft)" >actual &&
+ echo "$foo $(cat foo.mtime)" >expect.raw &&
+ echo "$bar $(cat foo.mtime)" >>expect.raw &&
+ sort expect.raw >expect &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success '--max-cruft-size with pruning' '
+ git init max-cruft-size-prune &&
+ (
+ cd max-cruft-size-prune &&
+
+ test_commit base &&
+ foo="$(generate_random_blob foo $((1024*1024)))" &&
+ bar="$(generate_random_blob bar $((1024*1024)))" &&
+ baz="$(generate_random_blob baz $((1024*1024)))" &&
+
+ test-tool chmtime -10000 "$objdir/$(test_oid_to_path "$foo")" &&
+
+ git repack -d --cruft --max-cruft-size=1M &&
+
+ # backdate the mtimes of all cruft packs to validate
+ # that they were rewritten as a result of pruning
+ ls $packdir/pack-*.mtimes | sort >cruft.before &&
+ for cruft in $(cat cruft.before)
+ do
+ mtime="$(test-tool chmtime --get -10000 "$cruft")" &&
+ echo $cruft $mtime >>mtimes || return 1
+ done &&
+
+ # repack (and prune) with a --max-cruft-size to ensure
+ # that we appropriately split the resulting set of packs
+ git repack -d --cruft --max-cruft-size=1M \
+ --cruft-expiration=10.seconds.ago &&
+ ls $packdir/pack-*.mtimes | sort >cruft.after &&
+
+ for cruft in $(cat cruft.after)
+ do
+ old_mtime="$(grep $cruft mtimes | cut -d" " -f2)" &&
+ new_mtime="$(test-tool chmtime --get $cruft)" &&
+ test $old_mtime -lt $new_mtime || return 1
+ done &&
+
+ test_line_count = 3 cruft.before &&
+ test_line_count = 2 cruft.after &&
+ test_must_fail git cat-file -e $foo &&
+ git cat-file -e $bar &&
+ git cat-file -e $baz
+ )
+'
+
+test_expect_success '--max-cruft-size ignores non-local packs' '
+ repo="max-cruft-size-non-local" &&
+ git init $repo &&
+ (
+ cd $repo &&
+ test_commit base &&
+ generate_random_blob foo 64 &&
+ git repack --cruft -d
+ ) &&
+
+ git clone --reference=$repo $repo $repo-alt &&
+ (
+ cd $repo-alt &&
+
+ test_commit other &&
+ generate_random_blob bar 64 &&
+
+ # ensure that we do not attempt to pick up packs from
+ # the non-alternated repository, which would result in a
+ # crash
+ git repack --cruft --max-cruft-size=1M -d
+ )
+'
+
+test_expect_success 'reachable packs are preferred over cruft ones' '
+ repo="cruft-preferred-packs" &&
+ git init "$repo" &&
+ (
+ cd "$repo" &&
+
+ # This test needs to exercise careful control over when a MIDX
+ # is and is not written. Unset the corresponding TEST variable
+ # accordingly.
+ sane_unset GIT_TEST_MULTI_PACK_INDEX &&
+
+ test_commit base &&
+ test_commit --no-tag cruft &&
+
+ non_cruft="$(echo base | git pack-objects --revs $packdir/pack)" &&
+ # Write a cruft pack which both (a) sorts ahead of the non-cruft
+ # pack in lexical order, and (b) has an older mtime to appease
+ # the MIDX preferred pack selection routine.
+ cruft="$(echo pack-$non_cruft.pack | git pack-objects --cruft $packdir/pack-A)" &&
+ test-tool chmtime -1000 $packdir/pack-A-$cruft.pack &&
+
+ test_commit other &&
+ git repack -d &&
+
+ git repack --geometric 2 -d --write-midx --write-bitmap-index &&
+
+ # After repacking, there are two packs left: one reachable one
+ # (which is the result of combining both of the existing two
+ # non-cruft packs), and one cruft pack.
+ find .git/objects/pack -type f -name "*.pack" >packs &&
+ test_line_count = 2 packs &&
+
+ # Make sure that the pack we just wrote is marked as preferred,
+ # not the cruft one.
+ pack="$(test-tool read-midx --preferred-pack $objdir)" &&
+ test_path_is_missing "$packdir/$(basename "$pack" ".idx").mtimes"
+ )
+'
+
+test_done
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 0964562..cc917b2 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -28,14 +28,14 @@ prompt_given ()
test_expect_success 'basic usage requires no repo' '
test_expect_code 129 git difftool -h >output &&
- test_i18ngrep ^usage: output &&
+ test_grep ^usage: output &&
# create a ceiling directory to prevent Git from finding a repo
mkdir -p not/repo &&
test_when_finished rm -r not &&
test_expect_code 129 \
env GIT_CEILING_DIRECTORIES="$(pwd)/not" \
git -C not/repo difftool -h >output &&
- test_i18ngrep ^usage: output
+ test_grep ^usage: output
'
# Create a file on main and change it on branch
@@ -91,67 +91,128 @@ test_expect_success 'difftool forwards arguments to diff' '
rm for-diff
'
-test_expect_success 'difftool ignores exit code' '
- test_config difftool.error.cmd false &&
- git difftool -y -t error branch
-'
+for opt in '' '--dir-diff'
+do
+ test_expect_success "difftool ${opt:-without options} ignores exit code" '
+ test_config difftool.error.cmd false &&
+ git difftool ${opt} -y -t error branch
+ '
+
+ test_expect_success "difftool ${opt:-without options} forwards exit code with --trust-exit-code" '
+ test_config difftool.error.cmd false &&
+ test_must_fail git difftool ${opt} -y --trust-exit-code -t error branch
+ '
+
+ test_expect_success "difftool ${opt:-without options} forwards exit code with --trust-exit-code for built-ins" '
+ test_config difftool.vimdiff.path false &&
+ test_must_fail git difftool ${opt} -y --trust-exit-code -t vimdiff branch
+ '
+
+ test_expect_success "difftool ${opt:-without options} honors difftool.trustExitCode = true" '
+ test_config difftool.error.cmd false &&
+ test_config difftool.trustExitCode true &&
+ test_must_fail git difftool ${opt} -y -t error branch
+ '
+
+ test_expect_success "difftool ${opt:-without options} honors difftool.trustExitCode = false" '
+ test_config difftool.error.cmd false &&
+ test_config difftool.trustExitCode false &&
+ git difftool ${opt} -y -t error branch
+ '
+
+ test_expect_success "difftool ${opt:-without options} ignores exit code with --no-trust-exit-code" '
+ test_config difftool.error.cmd false &&
+ test_config difftool.trustExitCode true &&
+ git difftool ${opt} -y --no-trust-exit-code -t error branch
+ '
+
+ test_expect_success "difftool ${opt:-without options} stops on error with --trust-exit-code" '
+ test_when_finished "rm -f for-diff .git/fail-right-file" &&
+ test_when_finished "git reset -- for-diff" &&
+ write_script .git/fail-right-file <<-\EOF &&
+ echo failed
+ exit 1
+ EOF
+ >for-diff &&
+ git add for-diff &&
+ test_must_fail git difftool ${opt} -y --trust-exit-code \
+ --extcmd .git/fail-right-file branch >actual &&
+ test_line_count = 1 actual
+ '
+
+ test_expect_success "difftool ${opt:-without options} honors exit status if command not found" '
+ test_config difftool.nonexistent.cmd i-dont-exist &&
+ test_config difftool.trustExitCode false &&
+ if test "${opt}" = --dir-diff
+ then
+ expected_code=127
+ else
+ expected_code=128
+ fi &&
+ test_expect_code ${expected_code} git difftool ${opt} -y -t nonexistent branch
+ '
+done
-test_expect_success 'difftool forwards exit code with --trust-exit-code' '
- test_config difftool.error.cmd false &&
- test_must_fail git difftool -y --trust-exit-code -t error branch
-'
+test_expect_success 'difftool honors --gui' '
+ difftool_test_setup &&
+ test_config merge.tool bogus-tool &&
+ test_config diff.tool bogus-tool &&
+ test_config diff.guitool test-tool &&
-test_expect_success 'difftool forwards exit code with --trust-exit-code for built-ins' '
- test_config difftool.vimdiff.path false &&
- test_must_fail git difftool -y --trust-exit-code -t vimdiff branch
+ echo branch >expect &&
+ git difftool --no-prompt --gui branch >actual &&
+ test_cmp expect actual
'
-test_expect_success 'difftool honors difftool.trustExitCode = true' '
- test_config difftool.error.cmd false &&
- test_config difftool.trustExitCode true &&
- test_must_fail git difftool -y -t error branch
-'
+test_expect_success 'difftool with guiDefault auto selects gui tool when there is DISPLAY' '
+ difftool_test_setup &&
+ test_config merge.tool bogus-tool &&
+ test_config diff.tool bogus-tool &&
+ test_config diff.guitool test-tool &&
+ test_config difftool.guiDefault auto &&
+ DISPLAY=SOMETHING && export DISPLAY &&
-test_expect_success 'difftool honors difftool.trustExitCode = false' '
- test_config difftool.error.cmd false &&
- test_config difftool.trustExitCode false &&
- git difftool -y -t error branch
+ echo branch >expect &&
+ git difftool --no-prompt branch >actual &&
+ test_cmp expect actual
'
+test_expect_success 'difftool with guiDefault auto selects regular tool when no DISPLAY' '
+ difftool_test_setup &&
+ test_config diff.guitool bogus-tool &&
+ test_config diff.tool test-tool &&
+ test_config difftool.guiDefault Auto &&
+ DISPLAY= && export DISPLAY &&
-test_expect_success 'difftool ignores exit code with --no-trust-exit-code' '
- test_config difftool.error.cmd false &&
- test_config difftool.trustExitCode true &&
- git difftool -y --no-trust-exit-code -t error branch
+ echo branch >expect &&
+ git difftool --no-prompt branch >actual &&
+ test_cmp expect actual
'
-test_expect_success 'difftool stops on error with --trust-exit-code' '
- test_when_finished "rm -f for-diff .git/fail-right-file" &&
- test_when_finished "git reset -- for-diff" &&
- write_script .git/fail-right-file <<-\EOF &&
- echo failed
- exit 1
- EOF
- >for-diff &&
- git add for-diff &&
- test_must_fail git difftool -y --trust-exit-code \
- --extcmd .git/fail-right-file branch >actual &&
- test_line_count = 1 actual
-'
+test_expect_success 'difftool with guiDefault true selects gui tool' '
+ difftool_test_setup &&
+ test_config diff.tool bogus-tool &&
+ test_config diff.guitool test-tool &&
+ test_config difftool.guiDefault true &&
+
+ DISPLAY= && export DISPLAY &&
+ echo branch >expect &&
+ git difftool --no-prompt branch >actual &&
+ test_cmp expect actual &&
-test_expect_success 'difftool honors exit status if command not found' '
- test_config difftool.nonexistent.cmd i-dont-exist &&
- test_config difftool.trustExitCode false &&
- test_must_fail git difftool -y -t nonexistent branch
+ DISPLAY=Something && export DISPLAY &&
+ echo branch >expect &&
+ git difftool --no-prompt branch >actual &&
+ test_cmp expect actual
'
-test_expect_success 'difftool honors --gui' '
+test_expect_success 'difftool --no-gui trumps config guiDefault' '
difftool_test_setup &&
- test_config merge.tool bogus-tool &&
- test_config diff.tool bogus-tool &&
- test_config diff.guitool test-tool &&
+ test_config diff.guitool bogus-tool &&
+ test_config diff.tool test-tool &&
+ test_config difftool.guiDefault true &&
echo branch >expect &&
- git difftool --no-prompt --gui branch >actual &&
+ git difftool --no-prompt --no-gui branch >actual &&
test_cmp expect actual
'
@@ -636,6 +697,7 @@ test_expect_success 'difftool --no-symlinks detects conflict ' '
test_expect_success 'difftool properly honors gitlink and core.worktree' '
test_when_finished rm -rf submod/ule &&
+ test_config_global protocol.file.allow always &&
git submodule add ./. submod/ule &&
test_config -C submod/ule diff.tool checktrees &&
test_config -C submod/ule difftool.checktrees.cmd '\''
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 6935601..875dcfd 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -18,6 +18,9 @@ test_invalid_grep_expression() {
'
}
+LC_ALL=en_US.UTF-8 test-tool regex '^.$' '¿' &&
+ test_set_prereq MB_REGEX
+
cat >hello.c <<EOF
#include <assert.h>
#include <stdio.h>
@@ -77,6 +80,7 @@ test_expect_success setup '
# Say hello.
function hello() {
echo "Hello world."
+ echo "Hello again."
} # hello
# Still a no-op.
@@ -87,6 +91,10 @@ test_expect_success setup '
echo unusual >"\"unusual\" pathname" &&
echo unusual >"t/nested \"unusual\" pathname"
fi &&
+ if test_have_prereq MB_REGEX
+ then
+ echo "¿" >reverse-question-mark
+ fi &&
git add . &&
test_tick &&
git commit -m initial
@@ -568,6 +576,14 @@ do
'
done
+test_expect_success MB_REGEX 'grep exactly one char in single-char multibyte file' '
+ LC_ALL=en_US.UTF-8 git grep "^.$" reverse-question-mark
+'
+
+test_expect_success MB_REGEX 'grep two chars in single-char multibyte file' '
+ LC_ALL=en_US.UTF-8 test_expect_code 1 git grep ".." reverse-question-mark
+'
+
cat >expected <<EOF
file
EOF
@@ -595,6 +611,92 @@ test_expect_success 'grep --files-without-match --quiet' '
test_must_be_empty actual
'
+test_expect_success 'grep --max-count 0 (must exit with non-zero)' '
+ test_must_fail git grep --max-count 0 foo >actual &&
+ test_must_be_empty actual
+'
+
+test_expect_success 'grep --max-count 3' '
+ cat >expected <<-EOF &&
+ file:foo mmap bar
+ file:foo_mmap bar
+ file:foo_mmap bar mmap
+ EOF
+ git grep --max-count 3 foo >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'grep --max-count -1 (no limit)' '
+ cat >expected <<-EOF &&
+ file:foo mmap bar
+ file:foo_mmap bar
+ file:foo_mmap bar mmap
+ file:foo mmap bar_mmap
+ file:foo_mmap bar mmap baz
+ EOF
+ git grep --max-count -1 foo >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'grep --max-count 1 --context 2' '
+ cat >expected <<-EOF &&
+ file-foo mmap bar
+ file:foo_mmap bar
+ file-foo_mmap bar mmap
+ EOF
+ git grep --max-count 1 --context 1 foo_mmap >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'grep --max-count 1 --show-function' '
+ cat >expected <<-EOF &&
+ hello.ps1=function hello() {
+ hello.ps1: echo "Hello world."
+ EOF
+ git grep --max-count 1 --show-function Hello hello.ps1 >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'grep --max-count 2 --show-function' '
+ cat >expected <<-EOF &&
+ hello.ps1=function hello() {
+ hello.ps1: echo "Hello world."
+ hello.ps1: echo "Hello again."
+ EOF
+ git grep --max-count 2 --show-function Hello hello.ps1 >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'grep --max-count 1 --count' '
+ cat >expected <<-EOF &&
+ hello.ps1:1
+ EOF
+ git grep --max-count 1 --count Hello hello.ps1 >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'grep --max-count 1 (multiple files)' '
+ cat >expected <<-EOF &&
+ hello.c:#include <stdio.h>
+ hello.ps1:# No-op.
+ EOF
+ git grep --max-count 1 -e o -- hello.\* >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'grep --max-count 1 --context 1 (multiple files)' '
+ cat >expected <<-EOF &&
+ hello.c-#include <assert.h>
+ hello.c:#include <stdio.h>
+ hello.c-
+ --
+ hello.ps1:# No-op.
+ hello.ps1-function dummy() {}
+ EOF
+ git grep --max-count 1 --context 1 -e o -- hello.\* >actual &&
+ test_cmp expected actual
+'
+
cat >expected <<EOF
file:foo mmap bar_mmap
EOF
@@ -706,6 +808,19 @@ test_expect_success 'grep -f, ignore empty lines, read patterns from stdin' '
test_cmp expected actual
'
+test_expect_success 'grep -f, use cwd relative file' '
+ test_when_finished "git rm -f sub/dir/file" &&
+ mkdir -p sub/dir &&
+ echo hit >sub/dir/file &&
+ git add sub/dir/file &&
+ echo hit >sub/dir/pattern &&
+ echo miss >pattern &&
+ (
+ cd sub/dir && git grep -f pattern file
+ ) &&
+ git -C sub/dir grep -f pattern file
+'
+
cat >expected <<EOF
y:y yy
--
@@ -899,7 +1014,9 @@ test_expect_success 'log --committer does not search in timestamp' '
test_expect_success 'grep with CE_VALID file' '
git update-index --assume-unchanged t/t &&
rm t/t &&
- test "$(git grep test)" = "t/t:test" &&
+ echo "t/t:test" >expect &&
+ git grep test >actual &&
+ test_cmp expect actual &&
git update-index --no-assume-unchanged t/t &&
git checkout t/t
'
@@ -1130,6 +1247,33 @@ test_expect_success 'outside of git repository with fallbackToNoIndex' '
)
'
+test_expect_success 'no repository with path outside $cwd' '
+ test_when_finished rm -fr non &&
+ rm -fr non &&
+ mkdir -p non/git/sub non/tig &&
+ (
+ GIT_CEILING_DIRECTORIES="$(pwd)/non" &&
+ export GIT_CEILING_DIRECTORIES &&
+ cd non/git &&
+ test_expect_code 128 git grep --no-index search .. 2>error &&
+ grep "is outside the directory tree" error
+ ) &&
+ (
+ GIT_CEILING_DIRECTORIES="$(pwd)/non" &&
+ export GIT_CEILING_DIRECTORIES &&
+ cd non/git &&
+ test_expect_code 128 git grep --no-index search ../tig 2>error &&
+ grep "is outside the directory tree" error
+ ) &&
+ (
+ GIT_CEILING_DIRECTORIES="$(pwd)/non" &&
+ export GIT_CEILING_DIRECTORIES &&
+ cd non/git &&
+ test_expect_code 128 git grep --no-index search ../non 2>error &&
+ grep "no such path in the working tree" error
+ )
+'
+
test_expect_success 'inside git repository but with --no-index' '
rm -fr is &&
mkdir -p is/git/sub &&
@@ -1282,7 +1426,7 @@ test_expect_success 'grep --no-index pattern -- path' '
test_expect_success 'grep --no-index complains of revs' '
test_must_fail git grep --no-index o main -- 2>err &&
- test_i18ngrep "cannot be used with revs" err
+ test_grep "cannot be used with revs" err
'
test_expect_success 'grep --no-index prefers paths to revs' '
@@ -1295,7 +1439,7 @@ test_expect_success 'grep --no-index prefers paths to revs' '
test_expect_success 'grep --no-index does not "diagnose" revs' '
test_must_fail git grep --no-index o :1:hello.c 2>err &&
- test_i18ngrep ! -i "did you mean" err
+ test_grep ! -i "did you mean" err
'
cat >expected <<EOF
diff --git a/t/t7811-grep-open.sh b/t/t7811-grep-open.sh
index 1dd0714..fe38d88 100755
--- a/t/t7811-grep-open.sh
+++ b/t/t7811-grep-open.sh
@@ -63,7 +63,7 @@ test_expect_success SIMPLEPAGER 'git grep -O' '
test_expect_success 'git grep -O --cached' '
test_must_fail git grep --cached -O GREP_PATTERN >out 2>msg &&
- test_i18ngrep open-files-in-pager msg
+ test_grep open-files-in-pager msg
'
test_expect_success 'git grep -O --no-index' '
diff --git a/t/t7812-grep-icase-non-ascii.sh b/t/t7812-grep-icase-non-ascii.sh
index ac7be54..31c66b6 100755
--- a/t/t7812-grep-icase-non-ascii.sh
+++ b/t/t7812-grep-icase-non-ascii.sh
@@ -2,6 +2,7 @@
test_description='grep icase on non-English locales'
+TEST_PASSES_SANITIZE_LEAK=true
. ./lib-gettext.sh
doalarm () {
diff --git a/t/t7814-grep-recurse-submodules.sh b/t/t7814-grep-recurse-submodules.sh
index a4476dc..167fe66 100755
--- a/t/t7814-grep-recurse-submodules.sh
+++ b/t/t7814-grep-recurse-submodules.sh
@@ -6,6 +6,7 @@ This test verifies the recurse-submodules feature correctly greps across
submodules.
'
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB=1
@@ -196,6 +197,7 @@ test_expect_success !MINGW 'grep recurse submodule colon in name' '
git -C "su:b" commit -m "add fi:le" &&
test_tick &&
+ test_config_global protocol.file.allow always &&
git -C parent submodule add "../su:b" "su:b" &&
git -C parent commit -m "add submodule" &&
test_tick &&
@@ -230,6 +232,7 @@ test_expect_success 'grep history with moved submoules' '
git -C sub commit -m "add file" &&
test_tick &&
+ test_config_global protocol.file.allow always &&
git -C parent submodule add ../sub dir/sub &&
git -C parent commit -m "add submodule" &&
test_tick &&
@@ -274,6 +277,7 @@ test_expect_success 'grep using relative path' '
mkdir parent/src &&
echo "(1|2)d(3|4)" >parent/src/file2 &&
git -C parent add src/file2 &&
+ test_config_global protocol.file.allow always &&
git -C parent submodule add ../sub &&
git -C parent commit -m "add files and submodule" &&
test_tick &&
@@ -316,6 +320,7 @@ test_expect_success 'grep from a subdir' '
mkdir parent/src &&
echo "(1|2)d(3|4)" >parent/src/file &&
git -C parent add src/file &&
+ test_config_global protocol.file.allow always &&
git -C parent submodule add ../sub src/sub &&
git -C parent submodule add ../sub sub &&
git -C parent commit -m "add files and submodules" &&
@@ -343,7 +348,7 @@ test_incompatible_with_recurse_submodules ()
{
test_expect_success "--recurse-submodules and $1 are incompatible" "
test_must_fail git grep -e. --recurse-submodules $1 2>actual &&
- test_i18ngrep 'not supported with --recurse-submodules' actual
+ test_grep 'not supported with --recurse-submodules' actual
"
}
@@ -471,8 +476,10 @@ test_expect_failure 'grep --textconv: superproject .gitattributes (from index) d
test_expect_failure 'grep --textconv: superproject .git/info/attributes does not affect submodules' '
reset_and_clean &&
test_config_global diff.d2x.textconv "sed -e \"s/d/x/\"" &&
- super_attr="$(git rev-parse --git-path info/attributes)" &&
+ super_info="$(git rev-parse --git-path info)" &&
+ super_attr="$super_info/attributes" &&
test_when_finished "rm -f \"$super_attr\"" &&
+ mkdir "$super_info" &&
echo "a diff=d2x" >"$super_attr" &&
cat >expect <<-\EOF &&
@@ -516,7 +523,8 @@ test_expect_failure 'grep --textconv correctly reads submodule .git/info/attribu
reset_and_clean &&
test_config_global diff.d2x.textconv "sed -e \"s/d/x/\"" &&
- submodule_attr="$(git -C submodule rev-parse --path-format=absolute --git-path info/attributes)" &&
+ submodule_info="$(git -C submodule rev-parse --path-format=absolute --git-path info)" &&
+ submodule_attr="$submodule_info/attributes" &&
test_when_finished "rm -f \"$submodule_attr\"" &&
echo "a diff=d2x" >"$submodule_attr" &&
@@ -546,6 +554,7 @@ test_expect_failure 'grep saves textconv cache in the appropriate repository' '
test_expect_success 'grep partially-cloned submodule' '
# Set up clean superproject and submodule for partial cloning.
+ test_config_global protocol.file.allow always &&
git init super &&
git init super/sub &&
(
@@ -585,4 +594,44 @@ test_expect_success 'grep partially-cloned submodule' '
)
'
+test_expect_success 'check scope of core.useReplaceRefs' '
+ git init base &&
+ git init base/sub &&
+
+ echo A >base/a &&
+ echo B >base/b &&
+ echo C >base/sub/c &&
+ echo D >base/sub/d &&
+
+ git -C base/sub add c d &&
+ git -C base/sub commit -m "Add files" &&
+
+ git -C base submodule add ./sub &&
+ git -C base add a b sub &&
+ git -C base commit -m "Add files and submodule" &&
+
+ A=$(git -C base rev-parse HEAD:a) &&
+ B=$(git -C base rev-parse HEAD:b) &&
+ C=$(git -C base/sub rev-parse HEAD:c) &&
+ D=$(git -C base/sub rev-parse HEAD:d) &&
+
+ git -C base replace $A $B &&
+ git -C base/sub replace $C $D &&
+
+ test_must_fail git -C base grep --cached --recurse-submodules A &&
+ test_must_fail git -C base grep --cached --recurse-submodules C &&
+
+ git -C base config core.useReplaceRefs false &&
+ git -C base grep --recurse-submodules A &&
+ test_must_fail git -C base grep --cached --recurse-submodules C &&
+
+ git -C base/sub config core.useReplaceRefs false &&
+ git -C base grep --cached --recurse-submodules A &&
+ git -C base grep --cached --recurse-submodules C &&
+
+ git -C base config --unset core.useReplaceRefs &&
+ test_must_fail git -C base grep --cached --recurse-submodules A &&
+ git -C base grep --cached --recurse-submodules C
+'
+
test_done
diff --git a/t/t7816-grep-binary-pattern.sh b/t/t7816-grep-binary-pattern.sh
index fdb2355..4353be5 100755
--- a/t/t7816-grep-binary-pattern.sh
+++ b/t/t7816-grep-binary-pattern.sh
@@ -26,7 +26,7 @@ nul_match_internal () {
>stderr &&
printf '$pattern' | q_to_nul >f &&
test_must_fail env LC_ALL=\"$lc_all\" git grep $extra_flags -f f $flags a 2>stderr &&
- test_i18ngrep ! 'This is only supported with -P under PCRE v2' stderr
+ test_grep ! 'This is only supported with -P under PCRE v2' stderr
"
elif test "$matches" = P
then
@@ -34,7 +34,7 @@ nul_match_internal () {
>stderr &&
printf '$pattern' | q_to_nul >f &&
test_must_fail env LC_ALL=\"$lc_all\" git grep -f f $flags a 2>stderr &&
- test_i18ngrep 'This is only supported with -P under PCRE v2' stderr
+ test_grep 'This is only supported with -P under PCRE v2' stderr
"
else
test_expect_success "PANIC: Test framework error. Unknown matches value $matches" 'false'
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index 74aa638..0943dfa 100755
--- a/t/t7900-maintenance.sh
+++ b/t/t7900-maintenance.sh
@@ -32,12 +32,14 @@ test_systemd_analyze_verify () {
}
test_expect_success 'help text' '
- test_expect_code 129 git maintenance -h 2>err &&
- test_i18ngrep "usage: git maintenance <subcommand>" err &&
- test_expect_code 128 git maintenance barf 2>err &&
- test_i18ngrep "invalid subcommand: barf" err &&
+ test_expect_code 129 git maintenance -h >actual &&
+ test_grep "usage: git maintenance <subcommand>" actual &&
+ test_expect_code 129 git maintenance barf 2>err &&
+ test_grep "unknown subcommand: \`barf'\''" err &&
+ test_grep "usage: git maintenance" err &&
test_expect_code 129 git maintenance 2>err &&
- test_i18ngrep "usage: git maintenance" err
+ test_grep "error: need a subcommand" err &&
+ test_grep "usage: git maintenance" err
'
test_expect_success 'run [--auto|--quiet]' '
@@ -65,6 +67,51 @@ test_expect_success 'maintenance.auto config option' '
test_subcommand ! git maintenance run --auto --quiet <false
'
+test_expect_success 'register uses XDG_CONFIG_HOME config if it exists' '
+ test_when_finished rm -r .config/git/config &&
+ (
+ XDG_CONFIG_HOME=.config &&
+ export XDG_CONFIG_HOME &&
+ mkdir -p $XDG_CONFIG_HOME/git &&
+ >$XDG_CONFIG_HOME/git/config &&
+ git maintenance register &&
+ git config --file=$XDG_CONFIG_HOME/git/config --get maintenance.repo >actual &&
+ pwd >expect &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'register does not need XDG_CONFIG_HOME config to exist' '
+ test_when_finished git maintenance unregister &&
+ test_path_is_missing $XDG_CONFIG_HOME/git/config &&
+ git maintenance register &&
+ git config --global --get maintenance.repo >actual &&
+ pwd >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'unregister uses XDG_CONFIG_HOME config if it exists' '
+ test_when_finished rm -r .config/git/config &&
+ (
+ XDG_CONFIG_HOME=.config &&
+ export XDG_CONFIG_HOME &&
+ mkdir -p $XDG_CONFIG_HOME/git &&
+ >$XDG_CONFIG_HOME/git/config &&
+ git maintenance register &&
+ git maintenance unregister &&
+ test_must_fail git config --file=$XDG_CONFIG_HOME/git/config --get maintenance.repo >actual &&
+ test_must_be_empty actual
+ )
+'
+
+test_expect_success 'unregister does not need XDG_CONFIG_HOME config to exist' '
+ test_path_is_missing $XDG_CONFIG_HOME/git/config &&
+ git maintenance register &&
+ git maintenance unregister &&
+ test_must_fail git config --global --get maintenance.repo >actual &&
+ test_must_be_empty actual
+'
+
test_expect_success 'maintenance.<task>.enabled' '
git config maintenance.gc.enabled false &&
git config maintenance.commit-graph.enabled true &&
@@ -129,12 +176,12 @@ test_expect_success 'commit-graph auto condition' '
test_expect_success 'run --task=bogus' '
test_must_fail git maintenance run --task=bogus 2>err &&
- test_i18ngrep "is not a valid task" err
+ test_grep "is not a valid task" err
'
test_expect_success 'run --task duplicate' '
test_must_fail git maintenance run --task=gc --task=gc 2>err &&
- test_i18ngrep "cannot be selected multiple times" err
+ test_grep "cannot be selected multiple times" err
'
test_expect_success 'run --task=prefetch with no remotes' '
@@ -155,14 +202,14 @@ test_expect_success 'prefetch multiple remotes' '
fetchargs="--prefetch --prune --no-tags --no-write-fetch-head --recurse-submodules=no --quiet" &&
test_subcommand git fetch remote1 $fetchargs <run-prefetch.txt &&
test_subcommand git fetch remote2 $fetchargs <run-prefetch.txt &&
- test_path_is_missing .git/refs/remotes &&
+ git for-each-ref refs/remotes >actual &&
+ test_must_be_empty actual &&
git log prefetch/remotes/remote1/one &&
git log prefetch/remotes/remote2/two &&
git fetch --all &&
test_cmp_rev refs/remotes/remote1/one refs/prefetch/remotes/remote1/one &&
test_cmp_rev refs/remotes/remote2/two refs/prefetch/remotes/remote2/two &&
- test_cmp_config refs/prefetch/ log.excludedecoration &&
git log --oneline --decorate --all >log &&
! grep "prefetch" log &&
@@ -173,26 +220,6 @@ test_expect_success 'prefetch multiple remotes' '
test_subcommand git fetch remote2 $fetchargs <skip-remote1.txt
'
-test_expect_success 'prefetch and existing log.excludeDecoration values' '
- git config --unset-all log.excludeDecoration &&
- git config log.excludeDecoration refs/remotes/remote1/ &&
- git maintenance run --task=prefetch &&
-
- git config --get-all log.excludeDecoration >out &&
- grep refs/remotes/remote1/ out &&
- grep refs/prefetch/ out &&
-
- git log --oneline --decorate --all >log &&
- ! grep "prefetch" log &&
- ! grep "remote1" log &&
- grep "remote2" log &&
-
- # a second run does not change the config
- git maintenance run --task=prefetch &&
- git log --oneline --decorate --all >log2 &&
- test_cmp log log2
-'
-
test_expect_success 'loose-objects task' '
# Repack everything so we know the state of the object dir
git repack -adk &&
@@ -396,12 +423,12 @@ test_expect_success 'pack-refs task' '
test_expect_success '--auto and --schedule incompatible' '
test_must_fail git maintenance run --auto --schedule=daily 2>err &&
- test_i18ngrep "at most one" err
+ test_grep "at most one" err
'
test_expect_success 'invalid --schedule value' '
test_must_fail git maintenance run --schedule=annually 2>err &&
- test_i18ngrep "unrecognized --schedule" err
+ test_grep "unrecognized --schedule" err
'
test_expect_success '--schedule inheritance weekly -> daily -> hourly' '
@@ -499,6 +526,11 @@ test_expect_success 'maintenance.strategy inheritance' '
test_expect_success 'register and unregister' '
test_when_finished git config --global --unset-all maintenance.repo &&
+
+ test_must_fail git maintenance unregister 2>err &&
+ grep "is not registered" err &&
+ git maintenance unregister --force &&
+
git config --global --add maintenance.repo /existing1 &&
git config --global --add maintenance.repo /existing2 &&
git config --global --get-all maintenance.repo >before &&
@@ -512,7 +544,68 @@ test_expect_success 'register and unregister' '
git maintenance unregister &&
git config --global --get-all maintenance.repo >actual &&
- test_cmp before actual
+ test_cmp before actual &&
+
+ git config --file ./other --add maintenance.repo /existing1 &&
+ git config --file ./other --add maintenance.repo /existing2 &&
+ git config --file ./other --get-all maintenance.repo >before &&
+
+ git maintenance register --config-file ./other &&
+ test_cmp_config false maintenance.auto &&
+ git config --file ./other --get-all maintenance.repo >between &&
+ cp before expect &&
+ pwd >>expect &&
+ test_cmp expect between &&
+
+ git maintenance unregister --config-file ./other &&
+ git config --file ./other --get-all maintenance.repo >actual &&
+ test_cmp before actual &&
+
+ test_must_fail git maintenance unregister 2>err &&
+ grep "is not registered" err &&
+ git maintenance unregister --force &&
+
+ test_must_fail git maintenance unregister --config-file ./other 2>err &&
+ grep "is not registered" err &&
+ git maintenance unregister --config-file ./other --force
+'
+
+test_expect_success 'register with no value for maintenance.repo' '
+ cp .git/config .git/config.orig &&
+ test_when_finished mv .git/config.orig .git/config &&
+
+ cat >>.git/config <<-\EOF &&
+ [maintenance]
+ repo
+ EOF
+ cat >expect <<-\EOF &&
+ error: missing value for '\''maintenance.repo'\''
+ EOF
+ git maintenance register 2>actual &&
+ test_cmp expect actual &&
+ git config maintenance.repo
+'
+
+test_expect_success 'unregister with no value for maintenance.repo' '
+ cp .git/config .git/config.orig &&
+ test_when_finished mv .git/config.orig .git/config &&
+
+ cat >>.git/config <<-\EOF &&
+ [maintenance]
+ repo
+ EOF
+ cat >expect <<-\EOF &&
+ error: missing value for '\''maintenance.repo'\''
+ EOF
+ test_expect_code 128 git maintenance unregister 2>actual.raw &&
+ grep ^error actual.raw >actual &&
+ test_cmp expect actual &&
+ git config maintenance.repo &&
+
+ git maintenance unregister --force 2>actual.raw &&
+ grep ^error actual.raw >actual &&
+ test_cmp expect actual &&
+ git config maintenance.repo
'
test_expect_success !MINGW 'register and unregister with regex metacharacters' '
@@ -529,15 +622,15 @@ test_expect_success !MINGW 'register and unregister with regex metacharacters' '
test_expect_success 'start --scheduler=<scheduler>' '
test_expect_code 129 git maintenance start --scheduler=foo 2>err &&
- test_i18ngrep "unrecognized --scheduler argument" err &&
+ test_grep "unrecognized --scheduler argument" err &&
test_expect_code 129 git maintenance start --no-scheduler 2>err &&
- test_i18ngrep "unknown option" err &&
+ test_grep "unknown option" err &&
test_expect_code 128 \
env GIT_TEST_MAINT_SCHEDULER="launchctl:true,schtasks:true" \
git maintenance start --scheduler=crontab 2>err &&
- test_i18ngrep "fatal: crontab scheduler is not available" err
+ test_grep "fatal: crontab scheduler is not available" err
'
test_expect_success 'start from empty cron table' '
@@ -697,7 +790,15 @@ test_expect_success 'start and stop Linux/systemd maintenance' '
# start registers the repo
git config --get --global --fixed-value maintenance.repo "$(pwd)" &&
- test_systemd_analyze_verify "systemd/user/git-maintenance@.service" &&
+ for schedule in hourly daily weekly
+ do
+ test_path_is_file "systemd/user/git-maintenance@$schedule.timer" || return 1
+ done &&
+ test_path_is_file "systemd/user/git-maintenance@.service" &&
+
+ test_systemd_analyze_verify "systemd/user/git-maintenance@hourly.service" &&
+ test_systemd_analyze_verify "systemd/user/git-maintenance@daily.service" &&
+ test_systemd_analyze_verify "systemd/user/git-maintenance@weekly.service" &&
printf -- "--user enable --now git-maintenance@%s.timer\n" hourly daily weekly >expect &&
test_cmp expect args &&
@@ -708,7 +809,10 @@ test_expect_success 'start and stop Linux/systemd maintenance' '
# stop does not unregister the repo
git config --get --global --fixed-value maintenance.repo "$(pwd)" &&
- test_path_is_missing "systemd/user/git-maintenance@.timer" &&
+ for schedule in hourly daily weekly
+ do
+ test_path_is_missing "systemd/user/git-maintenance@$schedule.timer" || return 1
+ done &&
test_path_is_missing "systemd/user/git-maintenance@.service" &&
printf -- "--user disable --now git-maintenance@%s.timer\n" hourly daily weekly >expect &&
@@ -791,4 +895,17 @@ test_expect_success 'register and unregister bare repo' '
)
'
+test_expect_success 'failed schedule prevents config change' '
+ git init --bare failcase &&
+
+ for scheduler in crontab launchctl schtasks systemctl
+ do
+ GIT_TEST_MAINT_SCHEDULER="$scheduler:false" &&
+ export GIT_TEST_MAINT_SCHEDULER &&
+ test_must_fail \
+ git -C failcase maintenance start &&
+ test_must_fail git -C failcase config maintenance.auto || return 1
+ done
+'
+
test_done
diff --git a/t/t8001-annotate.sh b/t/t8001-annotate.sh
index a536a62..d7167f5 100755
--- a/t/t8001-annotate.sh
+++ b/t/t8001-annotate.sh
@@ -4,6 +4,7 @@ test_description='git annotate'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
PROG='git annotate'
diff --git a/t/t8002-blame.sh b/t/t8002-blame.sh
index ee4fdd8..0147de3 100755
--- a/t/t8002-blame.sh
+++ b/t/t8002-blame.sh
@@ -4,6 +4,7 @@ test_description='git blame'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
PROG='git blame -c'
diff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh
index d751d48..7312655 100755
--- a/t/t8003-blame-corner-cases.sh
+++ b/t/t8003-blame-corner-cases.sh
@@ -201,13 +201,13 @@ committer David Reiss <dreiss@facebook.com> 1234567890 +0000
some message
EOF
- COMMIT=$(git hash-object -t commit -w badcommit) &&
+ COMMIT=$(git hash-object --literally -t commit -w badcommit) &&
git --no-pager blame $COMMIT -- uno >/dev/null
'
test_expect_success 'blame -L with invalid start' '
test_must_fail git blame -L5 tres 2>errors &&
- test_i18ngrep "has only 2 lines" errors
+ test_grep "has only 2 lines" errors
'
test_expect_success 'blame -L with invalid end' '
diff --git a/t/t8007-cat-file-textconv.sh b/t/t8007-cat-file-textconv.sh
index b067983..c8266f1 100755
--- a/t/t8007-cat-file-textconv.sh
+++ b/t/t8007-cat-file-textconv.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='git cat-file textconv support'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
cat >helper <<'EOF'
diff --git a/t/t8010-cat-file-filters.sh b/t/t8010-cat-file-filters.sh
index 31de4b6..eb64b76 100755
--- a/t/t8010-cat-file-filters.sh
+++ b/t/t8010-cat-file-filters.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='git cat-file filters support'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup ' '
@@ -41,7 +43,7 @@ test_expect_success 'cat-file --textconv --path=<path> works' '
sha1=$(git rev-parse -q --verify HEAD:world.txt) &&
test_config diff.txt.textconv "tr A-Za-z N-ZA-Mn-za-m <" &&
git cat-file --textconv --path=hello.txt $sha1 >rot13 &&
- test uryyb = "$(cat rot13 | remove_cr)"
+ test uryyb = "$(remove_cr <rot13)"
'
test_expect_success '--path=<path> complains without --textconv/--filters' '
diff --git a/t/t8012-blame-colors.sh b/t/t8012-blame-colors.sh
index 90c75db..c3a5f6d 100755
--- a/t/t8012-blame-colors.sh
+++ b/t/t8012-blame-colors.sh
@@ -4,6 +4,7 @@ test_description='colored git blame'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
PROG='git blame -c'
diff --git a/t/t8013-blame-ignore-revs.sh b/t/t8013-blame-ignore-revs.sh
index b18633d..dbfbd86 100755
--- a/t/t8013-blame-ignore-revs.sh
+++ b/t/t8013-blame-ignore-revs.sh
@@ -25,11 +25,11 @@ test_expect_success setup '
git blame --line-porcelain file >blame_raw &&
- grep -E "^[0-9a-f]+ [0-9]+ 1" blame_raw | sed -e "s/ .*//" >actual &&
+ sed -ne "/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p" blame_raw >actual &&
git rev-parse X >expect &&
test_cmp expect actual &&
- grep -E "^[0-9a-f]+ [0-9]+ 2" blame_raw | sed -e "s/ .*//" >actual &&
+ sed -ne "/^[0-9a-f][0-9a-f]* [0-9][0-9]* 2/s/ .*//p" blame_raw >actual &&
git rev-parse X >expect &&
test_cmp expect actual
'
@@ -53,11 +53,11 @@ do
test_expect_success "ignore_rev_changing_lines ($I)" '
git blame --line-porcelain --ignore-rev $I file >blame_raw &&
- grep -E "^[0-9a-f]+ [0-9]+ 1" blame_raw | sed -e "s/ .*//" >actual &&
+ sed -ne "/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p" blame_raw >actual &&
git rev-parse A >expect &&
test_cmp expect actual &&
- grep -E "^[0-9a-f]+ [0-9]+ 2" blame_raw | sed -e "s/ .*//" >actual &&
+ sed -ne "/^[0-9a-f][0-9a-f]* [0-9][0-9]* 2/s/ .*//p" blame_raw >actual &&
git rev-parse B >expect &&
test_cmp expect actual
'
@@ -79,10 +79,10 @@ test_expect_success ignore_rev_adding_unblamable_lines '
git rev-parse Y >expect &&
git blame --line-porcelain file --ignore-rev Y >blame_raw &&
- grep -E "^[0-9a-f]+ [0-9]+ 3" blame_raw | sed -e "s/ .*//" >actual &&
+ sed -ne "/^[0-9a-f][0-9a-f]* [0-9][0-9]* 3/s/ .*//p" blame_raw >actual &&
test_cmp expect actual &&
- grep -E "^[0-9a-f]+ [0-9]+ 4" blame_raw | sed -e "s/ .*//" >actual &&
+ sed -ne "/^[0-9a-f][0-9a-f]* [0-9][0-9]* 4/s/ .*//p" blame_raw >actual &&
test_cmp expect actual
'
@@ -92,11 +92,11 @@ test_expect_success ignore_revs_from_files '
git rev-parse Y >ignore_y &&
git blame --line-porcelain file --ignore-revs-file ignore_x --ignore-revs-file ignore_y >blame_raw &&
- grep -E "^[0-9a-f]+ [0-9]+ 1" blame_raw | sed -e "s/ .*//" >actual &&
+ sed -ne "/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p" blame_raw >actual &&
git rev-parse A >expect &&
test_cmp expect actual &&
- grep -E "^[0-9a-f]+ [0-9]+ 2" blame_raw | sed -e "s/ .*//" >actual &&
+ sed -ne "/^[0-9a-f][0-9a-f]* [0-9][0-9]* 2/s/ .*//p" blame_raw >actual &&
git rev-parse B >expect &&
test_cmp expect actual
'
@@ -106,11 +106,11 @@ test_expect_success ignore_revs_from_configs_and_files '
git config --add blame.ignoreRevsFile ignore_x &&
git blame --line-porcelain file --ignore-revs-file ignore_y >blame_raw &&
- grep -E "^[0-9a-f]+ [0-9]+ 1" blame_raw | sed -e "s/ .*//" >actual &&
+ sed -ne "/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p" blame_raw >actual &&
git rev-parse A >expect &&
test_cmp expect actual &&
- grep -E "^[0-9a-f]+ [0-9]+ 2" blame_raw | sed -e "s/ .*//" >actual &&
+ sed -ne "/^[0-9a-f][0-9a-f]* [0-9][0-9]* 2/s/ .*//p" blame_raw >actual &&
git rev-parse B >expect &&
test_cmp expect actual
'
@@ -121,22 +121,22 @@ test_expect_success override_ignore_revs_file '
git blame --line-porcelain file --ignore-revs-file "" --ignore-revs-file ignore_y >blame_raw &&
git rev-parse X >expect &&
- grep -E "^[0-9a-f]+ [0-9]+ 1" blame_raw | sed -e "s/ .*//" >actual &&
+ sed -ne "/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p" blame_raw >actual &&
test_cmp expect actual &&
- grep -E "^[0-9a-f]+ [0-9]+ 2" blame_raw | sed -e "s/ .*//" >actual &&
+ sed -ne "/^[0-9a-f][0-9a-f]* [0-9][0-9]* 2/s/ .*//p" blame_raw >actual &&
test_cmp expect actual
'
test_expect_success bad_files_and_revs '
test_must_fail git blame file --ignore-rev NOREV 2>err &&
- test_i18ngrep "cannot find revision NOREV to ignore" err &&
+ test_grep "cannot find revision NOREV to ignore" err &&
test_must_fail git blame file --ignore-revs-file NOFILE 2>err &&
- test_i18ngrep "could not open.*: NOFILE" err &&
+ test_grep "could not open.*: NOFILE" err &&
echo NOREV >ignore_norev &&
test_must_fail git blame file --ignore-revs-file ignore_norev 2>err &&
- test_i18ngrep "invalid object name: NOREV" err
+ test_grep "invalid object name: NOREV" err
'
# For ignored revs that have added 'unblamable' lines, mark those lines with a
@@ -279,11 +279,11 @@ test_expect_success ignore_merge '
test_merge M B &&
git blame --line-porcelain file --ignore-rev M >blame_raw &&
- grep -E "^[0-9a-f]+ [0-9]+ 1" blame_raw | sed -e "s/ .*//" >actual &&
+ sed -ne "/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p" blame_raw >actual &&
git rev-parse B >expect &&
test_cmp expect actual &&
- grep -E "^[0-9a-f]+ [0-9]+ 9" blame_raw | sed -e "s/ .*//" >actual &&
+ sed -ne "/^[0-9a-f][0-9a-f]* [0-9][0-9]* 9/s/ .*//p" blame_raw >actual &&
git rev-parse C >expect &&
test_cmp expect actual
'
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 01c74b8..5a77100 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -12,7 +12,7 @@ PREREQ="PERL"
replace_variable_fields () {
sed -e "s/^\(Date:\).*/\1 DATE-STRING/" \
- -e "s/^\(Message-Id:\).*/\1 MESSAGE-ID-STRING/" \
+ -e "s/^\(Message-ID:\).*/\1 MESSAGE-ID-STRING/" \
-e "s/^\(X-Mailer:\).*/\1 X-MAILER-STRING/"
}
@@ -47,7 +47,7 @@ clean_fake_sendmail () {
test_expect_success $PREREQ 'Extract patches' '
patches=$(git format-patch -s --cc="One <one@example.com>" --cc=two@example.com -n HEAD^1) &&
- threaded_patches=$(git format-patch -o threaded -s --in-reply-to="format" HEAD^1)
+ threaded_patches=$(git format-patch -o threaded --thread=shallow -s --in-reply-to="format" HEAD^1)
'
# Test no confirm early to ensure remaining tests will not hang
@@ -61,8 +61,8 @@ test_no_confirm () {
--smtp-server="$(pwd)/fake.sendmail" \
$@ \
$patches >stdout &&
- ! grep "Send this email" stdout &&
- >no_confirm_okay
+ ! grep "Send this email" stdout &&
+ >no_confirm_okay
}
# Exit immediately to prevent hang if a no-confirm test fails
@@ -225,7 +225,7 @@ Cc: cc@example.com,
two@example.com
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
-Message-Id: MESSAGE-ID-STRING
+Message-ID: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING
In-Reply-To: <unique-message-id@example.com>
References: <unique-message-id@example.com>
@@ -337,13 +337,14 @@ test_expect_success $PREREQ 'Show all headers' '
test_expect_success $PREREQ 'Prompting works' '
clean_fake_sendmail &&
(echo "to@example.com" &&
- echo ""
+ echo "my-message-id@example.com"
) | GIT_SEND_EMAIL_NOTTY=1 git send-email \
--smtp-server="$(pwd)/fake.sendmail" \
$patches \
2>errors &&
grep "^From: A U Thor <author@example.com>\$" msgtxt1 &&
- grep "^To: to@example.com\$" msgtxt1
+ grep "^To: to@example.com\$" msgtxt1 &&
+ grep "^In-Reply-To: <my-message-id@example.com>" msgtxt1
'
test_expect_success $PREREQ,AUTOIDENT 'implicit ident is allowed' '
@@ -370,17 +371,20 @@ test_expect_success $PREREQ,!AUTOIDENT 'broken implicit ident aborts send-email'
--smtp-server="$(pwd)/fake.sendmail" \
--to=to@example.com \
$patches </dev/null 2>errors &&
- test_i18ngrep "tell me who you are" errors
+ test_grep "tell me who you are" errors
)
'
-test_expect_success $PREREQ 'setup tocmd and cccmd scripts' '
+test_expect_success $PREREQ 'setup cmd scripts' '
write_script tocmd-sed <<-\EOF &&
sed -n -e "s/^tocmd--//p" "$1"
EOF
- write_script cccmd-sed <<-\EOF
+ write_script cccmd-sed <<-\EOF &&
sed -n -e "s/^cccmd--//p" "$1"
EOF
+ write_script headercmd-sed <<-\EOF
+ sed -n -e "s/^headercmd--//p" "$1"
+ EOF
'
test_expect_success $PREREQ 'tocmd works' '
@@ -410,6 +414,70 @@ test_expect_success $PREREQ 'cccmd works' '
grep "^ cccmd@example.com" msgtxt1
'
+test_expect_success $PREREQ 'headercmd works' '
+ clean_fake_sendmail &&
+ cp $patches headercmd.patch &&
+ echo "headercmd--X-Debbugs-CC: dummy@example.com" >>headercmd.patch &&
+ git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --header-cmd=./headercmd-sed \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ headercmd.patch \
+ &&
+ grep "^X-Debbugs-CC: dummy@example.com" msgtxt1
+'
+
+test_expect_success $PREREQ '--no-header-cmd works' '
+ clean_fake_sendmail &&
+ cp $patches headercmd.patch &&
+ echo "headercmd--X-Debbugs-CC: dummy@example.com" >>headercmd.patch &&
+ git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --header-cmd=./headercmd-sed \
+ --no-header-cmd \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ headercmd.patch \
+ &&
+ ! grep "^X-Debbugs-CC: dummy@example.com" msgtxt1
+'
+
+test_expect_success $PREREQ 'multiline fields are correctly unfolded' '
+ clean_fake_sendmail &&
+ cp $patches headercmd.patch &&
+ write_script headercmd-multiline <<-\EOF &&
+ echo "X-Debbugs-CC: someone@example.com
+FoldedField: This is a tale
+ best told using
+ multiple lines."
+ EOF
+ git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --header-cmd=./headercmd-multiline \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ headercmd.patch &&
+ grep "^FoldedField: This is a tale best told using multiple lines.$" msgtxt1
+'
+
+# Blank lines in the middle of the output of a command are invalid.
+test_expect_success $PREREQ 'malform output reported on blank lines in command output' '
+ clean_fake_sendmail &&
+ cp $patches headercmd.patch &&
+ write_script headercmd-malformed-output <<-\EOF &&
+ echo "X-Debbugs-CC: someone@example.com
+
+SomeOtherField: someone-else@example.com"
+ EOF
+ ! git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --header-cmd=./headercmd-malformed-output \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ headercmd.patch
+'
+
test_expect_success $PREREQ 'reject long lines' '
z8=zzzzzzzz &&
z64=$z8$z8$z8$z8$z8$z8$z8$z8 &&
@@ -540,7 +608,7 @@ test_expect_success $PREREQ "--validate respects relative core.hooksPath path" '
test_path_is_file my-hooks.ran &&
cat >expect <<-EOF &&
fatal: longline.patch: rejected by sendemail-validate hook
- fatal: command '"'"'git hook run --ignore-missing sendemail-validate -- <patch>'"'"' died with exit code 1
+ fatal: command '"'"'git hook run --ignore-missing sendemail-validate -- <patch> <header>'"'"' died with exit code 1
warning: no patches were sent
EOF
test_cmp expect actual
@@ -559,12 +627,68 @@ test_expect_success $PREREQ "--validate respects absolute core.hooksPath path" '
test_path_is_file my-hooks.ran &&
cat >expect <<-EOF &&
fatal: longline.patch: rejected by sendemail-validate hook
- fatal: command '"'"'git hook run --ignore-missing sendemail-validate -- <patch>'"'"' died with exit code 1
+ fatal: command '"'"'git hook run --ignore-missing sendemail-validate -- <patch> <header>'"'"' died with exit code 1
+ warning: no patches were sent
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success $PREREQ "--validate hook supports multiple addresses in arguments" '
+ hooks_path="$(pwd)/my-hooks" &&
+ test_config core.hooksPath "$hooks_path" &&
+ test_when_finished "rm my-hooks.ran" &&
+ test_must_fail git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com,abc@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ --validate \
+ longline.patch 2>actual &&
+ test_path_is_file my-hooks.ran &&
+ cat >expect <<-EOF &&
+ fatal: longline.patch: rejected by sendemail-validate hook
+ fatal: command '"'"'git hook run --ignore-missing sendemail-validate -- <patch> <header>'"'"' died with exit code 1
warning: no patches were sent
EOF
test_cmp expect actual
'
+test_expect_success $PREREQ "--validate hook supports header argument" '
+ write_script my-hooks/sendemail-validate <<-\EOF &&
+ if test "$#" -ge 2
+ then
+ grep "X-test-header: v1.0" "$2"
+ else
+ echo "No header arg passed"
+ exit 1
+ fi
+ EOF
+ test_config core.hooksPath "my-hooks" &&
+ rm -fr outdir &&
+ git format-patch \
+ --add-header="X-test-header: v1.0" \
+ -n HEAD^1 -o outdir &&
+ git send-email \
+ --dry-run \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ --validate \
+ outdir/000?-*.patch
+'
+
+test_expect_success $PREREQ 'clear message-id before parsing a new message' '
+ clean_fake_sendmail &&
+ echo true | write_script my-hooks/sendemail-validate &&
+ test_config core.hooksPath my-hooks &&
+ git send-email --validate --to=recipient@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ $patches $threaded_patches &&
+ id0=$(grep "^Message-ID: " $threaded_patches) &&
+ id1=$(grep "^Message-ID: " msgtxt1) &&
+ id2=$(grep "^Message-ID: " msgtxt2) &&
+ test "z$id0" = "z$id2" &&
+ test "z$id1" != "z$id2"
+'
+
for enc in 7bit 8bit quoted-printable base64
do
test_expect_success $PREREQ "--transfer-encoding=$enc produces correct header" '
@@ -617,7 +741,7 @@ test_expect_success $PREREQ 'In-Reply-To without --chain-reply-to' '
sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt1 >actual &&
test_cmp expect actual &&
# Second and subsequent messages are replies to the first one
- sed -n -e "s/^Message-Id: *\(.*\)/\1/p" msgtxt1 >expect &&
+ sed -n -e "s/^Message-ID: *\(.*\)/\1/p" msgtxt1 >expect &&
sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt2 >actual &&
test_cmp expect actual &&
sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt3 >actual &&
@@ -637,10 +761,10 @@ test_expect_success $PREREQ 'In-Reply-To with --chain-reply-to' '
2>errors &&
sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt1 >actual &&
test_cmp expect actual &&
- sed -n -e "s/^Message-Id: *\(.*\)/\1/p" msgtxt1 >expect &&
+ sed -n -e "s/^Message-ID: *\(.*\)/\1/p" msgtxt1 >expect &&
sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt2 >actual &&
test_cmp expect actual &&
- sed -n -e "s/^Message-Id: *\(.*\)/\1/p" msgtxt2 >expect &&
+ sed -n -e "s/^Message-ID: *\(.*\)/\1/p" msgtxt2 >expect &&
sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt3 >actual &&
test_cmp expect actual
'
@@ -713,7 +837,7 @@ Cc: cc@example.com,
two@example.com
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
-Message-Id: MESSAGE-ID-STRING
+Message-ID: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
@@ -759,7 +883,7 @@ Cc: A <author@example.com>,
two@example.com
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
-Message-Id: MESSAGE-ID-STRING
+Message-ID: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
@@ -796,7 +920,7 @@ Cc: A <author@example.com>,
C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
-Message-Id: MESSAGE-ID-STRING
+Message-ID: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
@@ -824,7 +948,7 @@ From: Example <from@example.com>
To: to@example.com
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
-Message-Id: MESSAGE-ID-STRING
+Message-ID: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
@@ -860,7 +984,7 @@ Cc: A <author@example.com>,
cc-cmd@example.com
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
-Message-Id: MESSAGE-ID-STRING
+Message-ID: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
@@ -893,7 +1017,7 @@ Cc: A <author@example.com>,
two@example.com
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
-Message-Id: MESSAGE-ID-STRING
+Message-ID: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
@@ -926,7 +1050,7 @@ Cc: A <author@example.com>,
two@example.com
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
-Message-Id: MESSAGE-ID-STRING
+Message-ID: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
@@ -963,7 +1087,7 @@ Cc: A <author@example.com>,
C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
-Message-Id: MESSAGE-ID-STRING
+Message-ID: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
@@ -993,7 +1117,7 @@ Cc: A <author@example.com>,
C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
-Message-Id: MESSAGE-ID-STRING
+Message-ID: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
@@ -1478,7 +1602,7 @@ test_expect_success $PREREQ 'To headers from files reset each patch' '
test_expect_success $PREREQ 'setup expect' '
cat >email-using-8bit <<\EOF
From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
-Message-Id: <bogus-message-id@example.com>
+Message-ID: <bogus-message-id@example.com>
From: author@example.com
Date: Sat, 12 Jun 2010 15:53:58 +0200
Subject: subject goes here
@@ -1519,7 +1643,7 @@ test_expect_success $PREREQ 'asks about and fixes 8bit encodings' '
grep "do not declare a Content-Transfer-Encoding" stdout &&
grep email-using-8bit stdout &&
grep "Which 8bit encoding" stdout &&
- egrep "Content|MIME" msgtxt1 >actual &&
+ grep -E "Content|MIME" msgtxt1 >actual &&
test_cmp content-type-decl actual
'
@@ -1530,7 +1654,7 @@ test_expect_success $PREREQ 'sendemail.8bitEncoding works' '
git send-email --from=author@example.com --to=nobody@example.com \
--smtp-server="$(pwd)/fake.sendmail" \
email-using-8bit >stdout &&
- egrep "Content|MIME" msgtxt1 >actual &&
+ grep -E "Content|MIME" msgtxt1 >actual &&
test_cmp content-type-decl actual
'
@@ -1545,7 +1669,7 @@ test_expect_success $PREREQ 'sendemail.8bitEncoding in .git/config overrides --g
git send-email --from=author@example.com --to=nobody@example.com \
--smtp-server="$(pwd)/fake.sendmail" \
email-using-8bit >stdout &&
- egrep "Content|MIME" msgtxt1 >actual &&
+ grep -E "Content|MIME" msgtxt1 >actual &&
test_cmp content-type-decl actual
'
@@ -1557,14 +1681,14 @@ test_expect_success $PREREQ '--8bit-encoding overrides sendemail.8bitEncoding' '
--smtp-server="$(pwd)/fake.sendmail" \
--8bit-encoding=UTF-8 \
email-using-8bit >stdout &&
- egrep "Content|MIME" msgtxt1 >actual &&
+ grep -E "Content|MIME" msgtxt1 >actual &&
test_cmp content-type-decl actual
'
test_expect_success $PREREQ 'setup expect' '
cat >email-using-8bit <<-\EOF
From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
- Message-Id: <bogus-message-id@example.com>
+ Message-ID: <bogus-message-id@example.com>
From: author@example.com
Date: Sat, 12 Jun 2010 15:53:58 +0200
Subject: Dieser Betreff enthält auch einen Umlaut!
@@ -1593,7 +1717,7 @@ test_expect_success $PREREQ '--8bit-encoding also treats subject' '
test_expect_success $PREREQ 'setup expect' '
cat >email-using-8bit <<-\EOF
From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
- Message-Id: <bogus-message-id@example.com>
+ Message-ID: <bogus-message-id@example.com>
From: A U Thor <author@example.com>
Date: Sat, 12 Jun 2010 15:53:58 +0200
Content-Type: text/plain; charset=UTF-8
@@ -1674,7 +1798,7 @@ test_expect_success $PREREQ '8-bit and sendemail.transferencoding=base64' '
test_expect_success $PREREQ 'setup expect' '
cat >email-using-qp <<-\EOF
From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
- Message-Id: <bogus-message-id@example.com>
+ Message-ID: <bogus-message-id@example.com>
From: A U Thor <author@example.com>
Date: Sat, 12 Jun 2010 15:53:58 +0200
MIME-Version: 1.0
@@ -1700,7 +1824,7 @@ test_expect_success $PREREQ 'convert from quoted-printable to base64' '
test_expect_success $PREREQ 'setup expect' "
tr -d '\\015' | tr '%' '\\015' >email-using-crlf <<EOF
From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
-Message-Id: <bogus-message-id@example.com>
+Message-ID: <bogus-message-id@example.com>
From: A U Thor <author@example.com>
Date: Sat, 12 Jun 2010 15:53:58 +0200
Content-Type: text/plain; charset=UTF-8
@@ -1957,7 +2081,7 @@ test_expect_success $PREREQ 'aliases and sendemail.identity' '
-c sendemail.aliasesfile=default-aliases \
-c sendemail.cloud.aliasesfile=cloud-aliases \
send-email -1 2>stderr &&
- test_i18ngrep "cloud-aliases" stderr
+ test_grep "cloud-aliases" stderr
'
test_sendmail_aliases () {
@@ -2322,10 +2446,41 @@ test_expect_success $PREREQ 'invoke hook' '
--to=nobody@example.com \
--smtp-server="$(pwd)/../fake.sendmail" \
../another.patch 2>err &&
- test_i18ngrep "rejected by sendemail-validate hook" err
+ test_grep "rejected by sendemail-validate hook" err
)
'
+expected_file_counter_output () {
+ total=$1
+ count=0
+ while test $count -ne $total
+ do
+ count=$((count + 1)) &&
+ echo "$count/$total" || return
+ done
+}
+
+test_expect_success $PREREQ '--validate hook allows counting of messages' '
+ test_when_finished "rm -rf my-hooks.log" &&
+ test_config core.hooksPath "my-hooks" &&
+ mkdir -p my-hooks &&
+
+ write_script my-hooks/sendemail-validate <<-\EOF &&
+ num=$GIT_SENDEMAIL_FILE_COUNTER &&
+ tot=$GIT_SENDEMAIL_FILE_TOTAL &&
+ echo "$num/$tot" >>my-hooks.log || exit 1
+ EOF
+
+ >my-hooks.log &&
+ expected_file_counter_output 4 >expect &&
+ git send-email \
+ --from="Example <from@example.com>" \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ --validate -3 --cover-letter --force &&
+ test_cmp expect my-hooks.log
+'
+
test_expect_success $PREREQ 'test that send-email works outside a repo' '
nongit git send-email \
--from="Example <nobody@example.com>" \
@@ -2334,6 +2489,12 @@ test_expect_success $PREREQ 'test that send-email works outside a repo' '
"$(pwd)/0001-add-main.patch"
'
+test_expect_success $PREREQ 'send-email relays -v 3 to format-patch' '
+ test_when_finished "rm -f out" &&
+ git send-email --dry-run -v 3 -1 >out &&
+ grep "PATCH v3" out
+'
+
test_expect_success $PREREQ 'test that sendmail config is rejected' '
test_config sendmail.program sendmail &&
test_must_fail git send-email \
@@ -2341,7 +2502,7 @@ test_expect_success $PREREQ 'test that sendmail config is rejected' '
--to=nobody@example.com \
--smtp-server="$(pwd)/fake.sendmail" \
HEAD^ 2>err &&
- test_i18ngrep "found configuration options for '"'"sendmail"'"'" err
+ test_grep "found configuration options for '"'"sendmail"'"'" err
'
test_expect_success $PREREQ 'test that sendmail config rejection is specific' '
@@ -2363,4 +2524,45 @@ test_expect_success $PREREQ 'test forbidSendmailVariables behavior override' '
HEAD^
'
+test_expect_success $PREREQ '--compose handles lowercase headers' '
+ write_script fake-editor <<-\EOF &&
+ sed "s/^From:.*/from: edited-from@example.com/i" "$1" >"$1.tmp" &&
+ mv "$1.tmp" "$1"
+ EOF
+ clean_fake_sendmail &&
+ git send-email \
+ --compose \
+ --from="Example <from@example.com>" \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ HEAD^ &&
+ grep "From: edited-from@example.com" msgtxt1
+'
+
+test_expect_success $PREREQ '--compose handles to headers' '
+ write_script fake-editor <<-\EOF &&
+ sed "s/^To: .*/&, edited-to@example.com/" <"$1" >"$1.tmp" &&
+ echo this is the body >>"$1.tmp" &&
+ mv "$1.tmp" "$1"
+ EOF
+ clean_fake_sendmail &&
+ GIT_SEND_EMAIL_NOTTY=1 \
+ git send-email \
+ --compose \
+ --from="Example <from@example.com>" \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ HEAD^ &&
+ # Check both that the cover letter used our modified "to" line,
+ # but also that it was picked up for the patch.
+ q_to_tab >expect <<-\EOF &&
+ To: nobody@example.com,
+ Qedited-to@example.com
+ EOF
+ grep -A1 "^To:" msgtxt1 >msgtxt1.to &&
+ test_cmp expect msgtxt1.to &&
+ grep -A1 "^To:" msgtxt2 >msgtxt2.to &&
+ test_cmp expect msgtxt2.to
+'
+
test_done
diff --git a/t/t9002-column.sh b/t/t9002-column.sh
index 6d3dbde..d5b98e6 100755
--- a/t/t9002-column.sh
+++ b/t/t9002-column.sh
@@ -1,6 +1,7 @@
#!/bin/sh
test_description='git column'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -195,4 +196,15 @@ EOF
test_cmp expected actual
'
+test_expect_success 'padding must be non-negative' '
+ cat >input <<\EOF &&
+1 2 3 4 5 6
+EOF
+ cat >expected <<\EOF &&
+fatal: --padding must be non-negative
+EOF
+ test_must_fail git column --mode=column --padding=-1 <input >actual 2>&1 &&
+ test_cmp expected actual
+'
+
test_done
diff --git a/t/t9003-help-autocorrect.sh b/t/t9003-help-autocorrect.sh
index f00deaf..14a704d 100755
--- a/t/t9003-help-autocorrect.sh
+++ b/t/t9003-help-autocorrect.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='help.autocorrect finding a match'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -60,4 +62,10 @@ test_expect_success 'autocorrect can be declined altogether' '
test_line_count = 1 actual
'
+test_expect_success 'autocorrect works in work tree created from bare repo' '
+ git clone --bare . bare.git &&
+ git -C bare.git worktree add ../worktree &&
+ git -C worktree -c help.autocorrect=immediate stauts
+'
+
test_done
diff --git a/t/t9004-example.sh b/t/t9004-example.sh
index 7e8894a..590aab0 100755
--- a/t/t9004-example.sh
+++ b/t/t9004-example.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='check that example code compiles and runs'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'decorate' '
diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh
index 7c5b847..af28b01 100755
--- a/t/t9100-git-svn-basic.sh
+++ b/t/t9100-git-svn-basic.sh
@@ -8,7 +8,6 @@ test_description='git svn basic tests'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
-TEST_FAILS_SANITIZE_LEAK=true
. ./lib-git-svn.sh
prepare_utf8_locale
@@ -22,7 +21,7 @@ test_expect_success 'git svn help works anywhere' '
'
test_expect_success \
- 'initialize git svn' '
+ 'initialize git svn' '
mkdir import &&
(
cd import &&
@@ -39,9 +38,9 @@ test_expect_success \
rm -rf import &&
git svn init "$svnrepo"'
-test_expect_success \
- 'import an SVN revision into git' \
- 'git svn fetch'
+test_expect_success 'import an SVN revision into git' '
+ git svn fetch
+'
test_expect_success "checkout from svn" 'svn co "$svnrepo" "$SVN_TREE"'
@@ -234,27 +233,26 @@ test_expect_success POSIXPERM,SYMLINKS "$name" '
'
test_expect_success 'exit if remote refs are ambigious' '
- git config --add svn-remote.svn.fetch \
+ git config --add svn-remote.svn.fetch \
bar:refs/remotes/git-svn &&
test_must_fail git svn migrate
'
test_expect_success 'exit if init-ing a would clobber a URL' '
- svnadmin create "${PWD}/svnrepo2" &&
- svn mkdir -m "mkdir bar" "${svnrepo}2/bar" &&
- git config --unset svn-remote.svn.fetch \
+ svnadmin create "${PWD}/svnrepo2" &&
+ svn mkdir -m "mkdir bar" "${svnrepo}2/bar" &&
+ git config --unset svn-remote.svn.fetch \
"^bar:refs/remotes/git-svn$" &&
test_must_fail git svn init "${svnrepo}2/bar"
'
-test_expect_success \
- 'init allows us to connect to another directory in the same repo' '
- git svn init --minimize-url -i bar "$svnrepo/bar" &&
- git config --get svn-remote.svn.fetch \
- "^bar:refs/remotes/bar$" &&
- git config --get svn-remote.svn.fetch \
- "^:refs/remotes/git-svn$"
- '
+test_expect_success 'init allows us to connect to another directory in the same repo' '
+ git svn init --minimize-url -i bar "$svnrepo/bar" &&
+ git config --get svn-remote.svn.fetch \
+ "^bar:refs/remotes/bar$" &&
+ git config --get svn-remote.svn.fetch \
+ "^:refs/remotes/git-svn$"
+'
test_expect_success 'dcommit $rev does not clobber current branch' '
git svn fetch -i bar &&
diff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh
index d043e80..52046e6 100755
--- a/t/t9101-git-svn-props.sh
+++ b/t/t9101-git-svn-props.sh
@@ -5,7 +5,6 @@
test_description='git svn property tests'
-TEST_FAILS_SANITIZE_LEAK=true
. ./lib-git-svn.sh
mkdir import
diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh
index 5cf2ef4..b5845e2 100755
--- a/t/t9104-git-svn-follow-parent.sh
+++ b/t/t9104-git-svn-follow-parent.sh
@@ -5,7 +5,6 @@
test_description='git svn fetching'
-TEST_FAILS_SANITIZE_LEAK=true
. ./lib-git-svn.sh
test_expect_success 'initialize repo' '
@@ -42,51 +41,51 @@ test_expect_success 'init and fetch a moved directory' '
'
test_expect_success 'init and fetch from one svn-remote' '
- git config svn-remote.svn.url "$svnrepo" &&
- git config --add svn-remote.svn.fetch \
- trunk:refs/remotes/svn/trunk &&
- git config --add svn-remote.svn.fetch \
- thunk:refs/remotes/svn/thunk &&
- git svn fetch -i svn/thunk &&
+ git config svn-remote.svn.url "$svnrepo" &&
+ git config --add svn-remote.svn.fetch \
+ trunk:refs/remotes/svn/trunk &&
+ git config --add svn-remote.svn.fetch \
+ thunk:refs/remotes/svn/thunk &&
+ git svn fetch -i svn/thunk &&
test "$(git rev-parse --verify refs/remotes/svn/trunk)" \
- = "$(git rev-parse --verify refs/remotes/svn/thunk~1)" &&
+ = "$(git rev-parse --verify refs/remotes/svn/thunk~1)" &&
git cat-file blob refs/remotes/svn/thunk:readme >actual &&
test "$(sed -n -e "3p" actual)" = goodbye
- '
+'
test_expect_success 'follow deleted parent' '
- (svn_cmd cp -m "resurrecting trunk as junk" \
- "$svnrepo"/trunk@2 "$svnrepo"/junk ||
- svn cp -m "resurrecting trunk as junk" \
- -r2 "$svnrepo"/trunk "$svnrepo"/junk) &&
- git config --add svn-remote.svn.fetch \
- junk:refs/remotes/svn/junk &&
- git svn fetch -i svn/thunk &&
- git svn fetch -i svn/junk &&
+ (svn_cmd cp -m "resurrecting trunk as junk" \
+ "$svnrepo"/trunk@2 "$svnrepo"/junk ||
+ svn cp -m "resurrecting trunk as junk" \
+ -r2 "$svnrepo"/trunk "$svnrepo"/junk) &&
+ git config --add svn-remote.svn.fetch \
+ junk:refs/remotes/svn/junk &&
+ git svn fetch -i svn/thunk &&
+ git svn fetch -i svn/junk &&
test -z "$(git diff svn/junk svn/trunk)" &&
test "$(git merge-base svn/junk svn/trunk)" \
- = "$(git rev-parse svn/trunk)"
- '
+ = "$(git rev-parse svn/trunk)"
+'
test_expect_success 'follow larger parent' '
- mkdir -p import/trunk/thunk/bump/thud &&
- echo hi > import/trunk/thunk/bump/thud/file &&
- svn import -m "import a larger parent" import "$svnrepo"/larger-parent &&
- svn cp -m "hi" "$svnrepo"/larger-parent "$svnrepo"/another-larger &&
- git svn init --minimize-url -i larger \
- "$svnrepo"/larger-parent/trunk/thunk/bump/thud &&
- git svn fetch -i larger &&
+ mkdir -p import/trunk/thunk/bump/thud &&
+ echo hi > import/trunk/thunk/bump/thud/file &&
+ svn import -m "import a larger parent" import "$svnrepo"/larger-parent &&
+ svn cp -m "hi" "$svnrepo"/larger-parent "$svnrepo"/another-larger &&
+ git svn init --minimize-url -i larger \
+ "$svnrepo"/larger-parent/trunk/thunk/bump/thud &&
+ git svn fetch -i larger &&
git svn init --minimize-url -i larger-parent \
- "$svnrepo"/another-larger/trunk/thunk/bump/thud &&
+ "$svnrepo"/another-larger/trunk/thunk/bump/thud &&
git svn fetch -i larger-parent &&
- git rev-parse --verify refs/remotes/larger &&
- git rev-parse --verify \
- refs/remotes/larger-parent &&
+ git rev-parse --verify refs/remotes/larger &&
+ git rev-parse --verify \
+ refs/remotes/larger-parent &&
test "$(git merge-base \
refs/remotes/larger-parent \
refs/remotes/larger)" = \
- "$(git rev-parse refs/remotes/larger)"
- '
+ "$(git rev-parse refs/remotes/larger)"
+'
test_expect_success 'follow higher-level parent' '
svn mkdir -m "follow higher-level parent" "$svnrepo"/blob &&
diff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh
index 3cab0b9..bca496c 100755
--- a/t/t9106-git-svn-commit-diff-clobber.sh
+++ b/t/t9106-git-svn-commit-diff-clobber.sh
@@ -3,7 +3,6 @@
# Copyright (c) 2006 Eric Wong
test_description='git svn commit-diff clobber'
-TEST_FAILS_SANITIZE_LEAK=true
. ./lib-git-svn.sh
test_expect_success 'initialize repo' '
diff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh
index 32317d6..e06538b 100755
--- a/t/t9114-git-svn-dcommit-merge.sh
+++ b/t/t9114-git-svn-dcommit-merge.sh
@@ -27,7 +27,7 @@ cat << EOF
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
EOF
}
diff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh
index 419f055..743fbe1 100755
--- a/t/t9115-git-svn-dcommit-funky-renames.sh
+++ b/t/t9115-git-svn-dcommit-funky-renames.sh
@@ -5,7 +5,6 @@
test_description='git svn dcommit can commit renames of files with ugly names'
-TEST_FAILS_SANITIZE_LEAK=true
. ./lib-git-svn.sh
test_expect_success 'load repository with strange names' '
diff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh
index 62de819..3b038c3 100755
--- a/t/t9117-git-svn-init-clone.sh
+++ b/t/t9117-git-svn-init-clone.sh
@@ -17,32 +17,32 @@ test_expect_success 'setup svnrepo' '
test_expect_success 'basic clone' '
test ! -d trunk &&
git svn clone "$svnrepo"/project/trunk &&
- test -d trunk/.git/svn &&
- test -e trunk/foo &&
+ test_path_is_dir trunk/.git/svn &&
+ test_path_exists trunk/foo &&
rm -rf trunk
'
test_expect_success 'clone to target directory' '
test ! -d target &&
git svn clone "$svnrepo"/project/trunk target &&
- test -d target/.git/svn &&
- test -e target/foo &&
+ test_path_is_dir target/.git/svn &&
+ test_path_exists target/foo &&
rm -rf target
'
test_expect_success 'clone with --stdlayout' '
test ! -d project &&
git svn clone -s "$svnrepo"/project &&
- test -d project/.git/svn &&
- test -e project/foo &&
+ test_path_is_dir project/.git/svn &&
+ test_path_exists project/foo &&
rm -rf project
'
test_expect_success 'clone to target directory with --stdlayout' '
test ! -d target &&
git svn clone -s "$svnrepo"/project target &&
- test -d target/.git/svn &&
- test -e target/foo &&
+ test_path_is_dir target/.git/svn &&
+ test_path_exists target/foo &&
rm -rf target
'
diff --git a/t/t9118-git-svn-funky-branch-names.sh b/t/t9118-git-svn-funky-branch-names.sh
index a159ff9..d3261e3 100755
--- a/t/t9118-git-svn-funky-branch-names.sh
+++ b/t/t9118-git-svn-funky-branch-names.sh
@@ -38,7 +38,7 @@ test_expect_success 'setup svnrepo' '
# SVN 1.7 will truncate "not-a%40{0]" to just "not-a".
# Look at what SVN wound up naming the branch and use that.
# Be sure to escape the @ if it shows up.
-non_reflog=$(svn_cmd ls "$svnrepo/pr ject/branches" | grep not-a | sed 's/\///' | sed 's/@/%40/')
+non_reflog=$(svn_cmd ls "$svnrepo/pr ject/branches" | sed -ne '/not-a/ { s/\///; s/@/%40/; p }')
test_expect_success 'test clone with funky branch names' '
git svn clone -s "$svnrepo/pr ject" project &&
diff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh
index 8201c3e..088d1c5 100755
--- a/t/t9119-git-svn-info.sh
+++ b/t/t9119-git-svn-info.sh
@@ -28,7 +28,7 @@ test_cmp_info () {
rm -f tmp.expect tmp.actual
}
-quoted_svnrepo="$(echo $svnrepo | sed 's/ /%20/')"
+quoted_svnrepo="$(echo $svnrepo | test_uri_escape)"
test_expect_success 'setup repository and import' '
mkdir info &&
diff --git a/t/t9122-git-svn-author.sh b/t/t9122-git-svn-author.sh
index 527ba3d..0fc289a 100755
--- a/t/t9122-git-svn-author.sh
+++ b/t/t9122-git-svn-author.sh
@@ -2,7 +2,6 @@
test_description='git svn authorship'
-TEST_FAILS_SANITIZE_LEAK=true
. ./lib-git-svn.sh
test_expect_success 'setup svn repository' '
diff --git a/t/t9132-git-svn-broken-symlink.sh b/t/t9132-git-svn-broken-symlink.sh
index 4d8d058..aeceffa 100755
--- a/t/t9132-git-svn-broken-symlink.sh
+++ b/t/t9132-git-svn-broken-symlink.sh
@@ -2,7 +2,6 @@
test_description='test that git handles an svn repository with empty symlinks'
-TEST_FAILS_SANITIZE_LEAK=true
. ./lib-git-svn.sh
test_expect_success 'load svn dumpfile' '
svnadmin load "$rawsvnrepo" <<EOF
diff --git a/t/t9133-git-svn-nested-git-repo.sh b/t/t9133-git-svn-nested-git-repo.sh
index f894860..8ca2467 100755
--- a/t/t9133-git-svn-nested-git-repo.sh
+++ b/t/t9133-git-svn-nested-git-repo.sh
@@ -11,7 +11,7 @@ test_expect_success 'setup repo with a git repo inside it' '
(
cd s &&
git init &&
- test -f .git/HEAD &&
+ git symbolic-ref HEAD &&
> .git/a &&
echo a > a &&
svn_cmd add .git a &&
@@ -35,7 +35,7 @@ test_expect_success 'SVN-side change outside of .git' '
echo b >> a &&
svn_cmd commit -m "SVN-side change outside of .git" &&
svn_cmd up &&
- svn_cmd log -v | fgrep "SVN-side change outside of .git"
+ svn_cmd log -v | grep -F "SVN-side change outside of .git"
)
'
@@ -59,7 +59,7 @@ test_expect_success 'SVN-side change inside of .git' '
svn_cmd add --force .git &&
svn_cmd commit -m "SVN-side change inside of .git" &&
svn_cmd up &&
- svn_cmd log -v | fgrep "SVN-side change inside of .git"
+ svn_cmd log -v | grep -F "SVN-side change inside of .git"
)
'
@@ -82,7 +82,7 @@ test_expect_success 'SVN-side change in and out of .git' '
git commit -m "add a inside an SVN repo" &&
svn_cmd commit -m "SVN-side change in and out of .git" &&
svn_cmd up &&
- svn_cmd log -v | fgrep "SVN-side change in and out of .git"
+ svn_cmd log -v | grep -F "SVN-side change in and out of .git"
)
'
diff --git a/t/t9134-git-svn-ignore-paths.sh b/t/t9134-git-svn-ignore-paths.sh
index 4a77eb9..3188400 100755
--- a/t/t9134-git-svn-ignore-paths.sh
+++ b/t/t9134-git-svn-ignore-paths.sh
@@ -43,7 +43,7 @@ test_expect_success 'init+fetch an SVN repository with ignored www directory' '
test_expect_success 'verify ignore-paths config saved by clone' '
(
cd g &&
- git config --get svn-remote.svn.ignore-paths | fgrep "www"
+ git config --get svn-remote.svn.ignore-paths | grep www
)
'
@@ -53,7 +53,7 @@ test_expect_success 'SVN-side change outside of www' '
echo b >> qqq/test_qqq.txt &&
svn_cmd commit -m "SVN-side change outside of www" &&
svn_cmd up &&
- svn_cmd log -v | fgrep "SVN-side change outside of www"
+ svn_cmd log -v | grep "SVN-side change outside of www"
)
'
@@ -85,7 +85,7 @@ test_expect_success 'SVN-side change inside of ignored www' '
echo zaq >> www/test_www.txt &&
svn_cmd commit -m "SVN-side change inside of www/test_www.txt" &&
svn_cmd up &&
- svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt"
+ svn_cmd log -v | grep -F "SVN-side change inside of www/test_www.txt"
)
'
@@ -118,7 +118,7 @@ test_expect_success 'SVN-side change in and out of ignored www' '
echo ygg >> qqq/test_qqq.txt &&
svn_cmd commit -m "SVN-side change in and out of ignored www" &&
svn_cmd up &&
- svn_cmd log -v | fgrep "SVN-side change in and out of ignored www"
+ svn_cmd log -v | grep "SVN-side change in and out of ignored www"
)
'
diff --git a/t/t9140-git-svn-reset.sh b/t/t9140-git-svn-reset.sh
index e855904..a420b2a 100755
--- a/t/t9140-git-svn-reset.sh
+++ b/t/t9140-git-svn-reset.sh
@@ -43,7 +43,7 @@ test_expect_success 'fetch fails on modified hidden file' '
git svn find-rev refs/remotes/git-svn > ../expect &&
test_must_fail git svn fetch 2> ../errors &&
git svn find-rev refs/remotes/git-svn > ../expect2 ) &&
- fgrep "not found in commit" errors &&
+ grep "not found in commit" errors &&
test_cmp expect expect2
'
@@ -59,7 +59,7 @@ test_expect_success 'refetch succeeds not ignoring any files' '
( cd g &&
git svn fetch &&
git svn rebase &&
- fgrep "mod hidden" hid/hid.txt
+ grep "mod hidden" hid/hid.txt
)
'
diff --git a/t/t9146-git-svn-empty-dirs.sh b/t/t9146-git-svn-empty-dirs.sh
index 79c26ed..926ac81 100755
--- a/t/t9146-git-svn-empty-dirs.sh
+++ b/t/t9146-git-svn-empty-dirs.sh
@@ -4,7 +4,6 @@
test_description='git svn creates empty directories'
-TEST_FAILS_SANITIZE_LEAK=true
. ./lib-git-svn.sh
test_expect_success 'initialize repo' '
@@ -21,11 +20,7 @@ test_expect_success 'empty directories exist' '
cd cloned &&
for i in a b c d d/e d/e/f "weird file name"
do
- if ! test -d "$i"
- then
- echo >&2 "$i does not exist" &&
- exit 1
- fi
+ test_path_is_dir "$i" || exit 1
done
)
'
@@ -38,11 +33,7 @@ test_expect_success 'option automkdirs set to false' '
git svn fetch &&
for i in a b c d d/e d/e/f "weird file name"
do
- if test -d "$i"
- then
- echo >&2 "$i exists" &&
- exit 1
- fi
+ test_path_is_missing "$i" || exit 1
done
)
'
@@ -53,7 +44,7 @@ test_expect_success 'more emptiness' '
test_expect_success 'git svn rebase creates empty directory' '
( cd cloned && git svn rebase ) &&
- test -d cloned/"! !"
+ test_path_is_dir cloned/"! !"
'
test_expect_success 'git svn mkdirs recreates empty directories' '
@@ -63,11 +54,7 @@ test_expect_success 'git svn mkdirs recreates empty directories' '
git svn mkdirs &&
for i in a b c d d/e d/e/f "weird file name" "! !"
do
- if ! test -d "$i"
- then
- echo >&2 "$i does not exist" &&
- exit 1
- fi
+ test_path_is_dir "$i" || exit 1
done
)
'
@@ -79,25 +66,13 @@ test_expect_success 'git svn mkdirs -r works' '
git svn mkdirs -r7 &&
for i in a b c d d/e d/e/f "weird file name"
do
- if ! test -d "$i"
- then
- echo >&2 "$i does not exist" &&
- exit 1
- fi
+ test_path_is_dir "$i" || exit 1
done &&
- if test -d "! !"
- then
- echo >&2 "$i should not exist" &&
- exit 1
- fi &&
+ test_path_is_missing "! !" || exit 1 &&
git svn mkdirs -r8 &&
- if ! test -d "! !"
- then
- echo >&2 "$i not exist" &&
- exit 1
- fi
+ test_path_is_dir "! !" || exit 1
)
'
@@ -115,11 +90,7 @@ test_expect_success 'empty directories in trunk exist' '
cd trunk &&
for i in a "weird file name"
do
- if ! test -d "$i"
- then
- echo >&2 "$i does not exist" &&
- exit 1
- fi
+ test_path_is_dir "$i" || exit 1
done
)
'
@@ -130,7 +101,7 @@ test_expect_success 'remove a top-level directory from svn' '
test_expect_success 'removed top-level directory does not exist' '
git svn clone "$svnrepo" removed &&
- test ! -e removed/d
+ test_path_is_missing removed/d
'
unhandled=.git/svn/refs/remotes/git-svn/unhandled.log
@@ -144,15 +115,11 @@ test_expect_success 'git svn gc-ed files work' '
svn_cmd mkdir -m gz "$svnrepo"/gz &&
git reset --hard $(git rev-list HEAD | tail -1) &&
git svn rebase &&
- test -f "$unhandled".gz &&
- test -f "$unhandled" &&
+ test_path_is_file "$unhandled".gz &&
+ test_path_is_file "$unhandled" &&
for i in a b c "weird file name" gz "! !"
do
- if ! test -d "$i"
- then
- echo >&2 "$i does not exist" &&
- exit 1
- fi
+ test_path_is_dir "$i" || exit 1
done
fi
)
diff --git a/t/t9147-git-svn-include-paths.sh b/t/t9147-git-svn-include-paths.sh
index 257fc8f..63fa0b6 100755
--- a/t/t9147-git-svn-include-paths.sh
+++ b/t/t9147-git-svn-include-paths.sh
@@ -45,7 +45,7 @@ test_expect_success 'init+fetch an SVN repository with included qqq directory' '
test_expect_success 'verify include-paths config saved by clone' '
(
cd g &&
- git config --get svn-remote.svn.include-paths | fgrep "qqq"
+ git config --get svn-remote.svn.include-paths | grep qqq
)
'
@@ -55,7 +55,7 @@ test_expect_success 'SVN-side change outside of www' '
echo b >> qqq/test_qqq.txt &&
svn_cmd commit -m "SVN-side change outside of www" &&
svn_cmd up &&
- svn_cmd log -v | fgrep "SVN-side change outside of www"
+ svn_cmd log -v | grep "SVN-side change outside of www"
)
'
@@ -87,7 +87,7 @@ test_expect_success 'SVN-side change inside of ignored www' '
echo zaq >> www/test_www.txt &&
svn_cmd commit -m "SVN-side change inside of www/test_www.txt" &&
svn_cmd up &&
- svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt"
+ svn_cmd log -v | grep "SVN-side change inside of www/test_www.txt"
)
'
@@ -120,7 +120,7 @@ test_expect_success 'SVN-side change in and out of included qqq' '
echo ygg >> qqq/test_qqq.txt &&
svn_cmd commit -m "SVN-side change in and out of ignored www" &&
svn_cmd up &&
- svn_cmd log -v | fgrep "SVN-side change in and out of ignored www"
+ svn_cmd log -v | grep "SVN-side change in and out of ignored www"
)
'
diff --git a/t/t9148-git-svn-propset.sh b/t/t9148-git-svn-propset.sh
index 6cc76a0..aebb289 100755
--- a/t/t9148-git-svn-propset.sh
+++ b/t/t9148-git-svn-propset.sh
@@ -5,7 +5,6 @@
test_description='git svn propset tests'
-TEST_FAILS_SANITIZE_LEAK=true
. ./lib-git-svn.sh
test_expect_success 'setup propset via import' '
diff --git a/t/t9160-git-svn-preserve-empty-dirs.sh b/t/t9160-git-svn-preserve-empty-dirs.sh
index 9cf7a14..36c6b1a 100755
--- a/t/t9160-git-svn-preserve-empty-dirs.sh
+++ b/t/t9160-git-svn-preserve-empty-dirs.sh
@@ -9,7 +9,6 @@ This test uses git to clone a Subversion repository that contains empty
directories, and checks that corresponding directories are created in the
local Git repository with placeholder files.'
-TEST_FAILS_SANITIZE_LEAK=true
. ./lib-git-svn.sh
GIT_REPO=git-svn-repo
diff --git a/t/t9162-git-svn-dcommit-interactive.sh b/t/t9162-git-svn-dcommit-interactive.sh
index e2aa8ed..b3ce033 100755
--- a/t/t9162-git-svn-dcommit-interactive.sh
+++ b/t/t9162-git-svn-dcommit-interactive.sh
@@ -4,7 +4,6 @@
test_description='git svn dcommit --interactive series'
-TEST_FAILS_SANITIZE_LEAK=true
. ./lib-git-svn.sh
test_expect_success 'initialize repo' '
diff --git a/t/t9164-git-svn-dcommit-concurrent.sh b/t/t9164-git-svn-dcommit-concurrent.sh
index 1465156..d1dec89 100755
--- a/t/t9164-git-svn-dcommit-concurrent.sh
+++ b/t/t9164-git-svn-dcommit-concurrent.sh
@@ -5,7 +5,6 @@
test_description='concurrent git svn dcommit'
-TEST_FAILS_SANITIZE_LEAK=true
. ./lib-git-svn.sh
@@ -47,6 +46,14 @@ setup_hook()
"passed to setup_hook" >&2 ; return 1; }
echo "cnt=$skip_revs" > "$hook_type-counter"
rm -f "$rawsvnrepo/hooks/"*-commit # drop previous hooks
+
+ # Subversion hooks run with an empty environment by default. We thus
+ # need to propagate PATH so that we can find executables.
+ cat >"$rawsvnrepo/conf/hooks-env" <<-EOF
+ [default]
+ PATH = ${PATH}
+ EOF
+
hook="$rawsvnrepo/hooks/$hook_type"
cat > "$hook" <<- 'EOF1'
#!/bin/sh
@@ -64,7 +71,6 @@ EOF1
if [ "$hook_type" = "pre-commit" ]; then
echo "echo 'commit disallowed' >&2; exit 1" >>"$hook"
else
- echo "PATH=\"$PATH\"; export PATH" >>"$hook"
echo "svnconf=\"$svnconf\"" >>"$hook"
cat >>"$hook" <<- 'EOF2'
cd work-auto-commits.svn
diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
index c5946cb..a44eabf 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -50,56 +50,56 @@ check_entries () {
fi
}
-test_expect_success \
- 'New file' \
- 'mkdir A B C D E F &&
- echo hello1 >A/newfile1.txt &&
- echo hello2 >B/newfile2.txt &&
- cp "$TEST_DIRECTORY"/test-binary-1.png C/newfile3.png &&
- cp "$TEST_DIRECTORY"/test-binary-1.png D/newfile4.png &&
- git add A/newfile1.txt &&
- git add B/newfile2.txt &&
- git add C/newfile3.png &&
- git add D/newfile4.png &&
- git commit -a -m "Test: New file" &&
- id=$(git rev-list --max-count=1 HEAD) &&
- (cd "$CVSWORK" &&
- git cvsexportcommit -c $id &&
- check_entries A "newfile1.txt/1.1/" &&
- check_entries B "newfile2.txt/1.1/" &&
- check_entries C "newfile3.png/1.1/-kb" &&
- check_entries D "newfile4.png/1.1/-kb" &&
- test_cmp A/newfile1.txt ../A/newfile1.txt &&
- test_cmp B/newfile2.txt ../B/newfile2.txt &&
- test_cmp C/newfile3.png ../C/newfile3.png &&
- test_cmp D/newfile4.png ../D/newfile4.png
- )'
+test_expect_success 'New file' '
+ mkdir A B C D E F &&
+ echo hello1 >A/newfile1.txt &&
+ echo hello2 >B/newfile2.txt &&
+ cp "$TEST_DIRECTORY"/test-binary-1.png C/newfile3.png &&
+ cp "$TEST_DIRECTORY"/test-binary-1.png D/newfile4.png &&
+ git add A/newfile1.txt &&
+ git add B/newfile2.txt &&
+ git add C/newfile3.png &&
+ git add D/newfile4.png &&
+ git commit -a -m "Test: New file" &&
+ id=$(git rev-list --max-count=1 HEAD) &&
+ (cd "$CVSWORK" &&
+ git cvsexportcommit -c $id &&
+ check_entries A "newfile1.txt/1.1/" &&
+ check_entries B "newfile2.txt/1.1/" &&
+ check_entries C "newfile3.png/1.1/-kb" &&
+ check_entries D "newfile4.png/1.1/-kb" &&
+ test_cmp A/newfile1.txt ../A/newfile1.txt &&
+ test_cmp B/newfile2.txt ../B/newfile2.txt &&
+ test_cmp C/newfile3.png ../C/newfile3.png &&
+ test_cmp D/newfile4.png ../D/newfile4.png
+ )
+'
-test_expect_success \
- 'Remove two files, add two and update two' \
- 'echo Hello1 >>A/newfile1.txt &&
- rm -f B/newfile2.txt &&
- rm -f C/newfile3.png &&
- echo Hello5 >E/newfile5.txt &&
- cp "$TEST_DIRECTORY"/test-binary-2.png D/newfile4.png &&
- cp "$TEST_DIRECTORY"/test-binary-1.png F/newfile6.png &&
- git add E/newfile5.txt &&
- git add F/newfile6.png &&
- git commit -a -m "Test: Remove, add and update" &&
- id=$(git rev-list --max-count=1 HEAD) &&
- (cd "$CVSWORK" &&
- git cvsexportcommit -c $id &&
- check_entries A "newfile1.txt/1.2/" &&
- check_entries B "" &&
- check_entries C "" &&
- check_entries D "newfile4.png/1.2/-kb" &&
- check_entries E "newfile5.txt/1.1/" &&
- check_entries F "newfile6.png/1.1/-kb" &&
- test_cmp A/newfile1.txt ../A/newfile1.txt &&
- test_cmp D/newfile4.png ../D/newfile4.png &&
- test_cmp E/newfile5.txt ../E/newfile5.txt &&
- test_cmp F/newfile6.png ../F/newfile6.png
- )'
+test_expect_success 'Remove two files, add two and update two' '
+ echo Hello1 >>A/newfile1.txt &&
+ rm -f B/newfile2.txt &&
+ rm -f C/newfile3.png &&
+ echo Hello5 >E/newfile5.txt &&
+ cp "$TEST_DIRECTORY"/test-binary-2.png D/newfile4.png &&
+ cp "$TEST_DIRECTORY"/test-binary-1.png F/newfile6.png &&
+ git add E/newfile5.txt &&
+ git add F/newfile6.png &&
+ git commit -a -m "Test: Remove, add and update" &&
+ id=$(git rev-list --max-count=1 HEAD) &&
+ (cd "$CVSWORK" &&
+ git cvsexportcommit -c $id &&
+ check_entries A "newfile1.txt/1.2/" &&
+ check_entries B "" &&
+ check_entries C "" &&
+ check_entries D "newfile4.png/1.2/-kb" &&
+ check_entries E "newfile5.txt/1.1/" &&
+ check_entries F "newfile6.png/1.1/-kb" &&
+ test_cmp A/newfile1.txt ../A/newfile1.txt &&
+ test_cmp D/newfile4.png ../D/newfile4.png &&
+ test_cmp E/newfile5.txt ../E/newfile5.txt &&
+ test_cmp F/newfile6.png ../F/newfile6.png
+ )
+'
# Should fail (but only on the git cvsexportcommit stage)
test_expect_success \
@@ -129,67 +129,67 @@ test_expect_success \
# This test is here because a patch for only binary files will
# fail with gnu patch, so cvsexportcommit must handle that.
-test_expect_success \
- 'Remove only binary files' \
- 'git reset --hard HEAD^^ &&
- rm -f D/newfile4.png &&
- git commit -a -m "test: remove only a binary file" &&
- id=$(git rev-list --max-count=1 HEAD) &&
- (cd "$CVSWORK" &&
- git cvsexportcommit -c $id &&
- check_entries A "newfile1.txt/1.2/" &&
- check_entries B "" &&
- check_entries C "" &&
- check_entries D "" &&
- check_entries E "newfile5.txt/1.1/" &&
- check_entries F "newfile6.png/1.1/-kb" &&
- test_cmp A/newfile1.txt ../A/newfile1.txt &&
- test_cmp E/newfile5.txt ../E/newfile5.txt &&
- test_cmp F/newfile6.png ../F/newfile6.png
- )'
+test_expect_success 'Remove only binary files' '
+ git reset --hard HEAD^^ &&
+ rm -f D/newfile4.png &&
+ git commit -a -m "test: remove only a binary file" &&
+ id=$(git rev-list --max-count=1 HEAD) &&
+ (cd "$CVSWORK" &&
+ git cvsexportcommit -c $id &&
+ check_entries A "newfile1.txt/1.2/" &&
+ check_entries B "" &&
+ check_entries C "" &&
+ check_entries D "" &&
+ check_entries E "newfile5.txt/1.1/" &&
+ check_entries F "newfile6.png/1.1/-kb" &&
+ test_cmp A/newfile1.txt ../A/newfile1.txt &&
+ test_cmp E/newfile5.txt ../E/newfile5.txt &&
+ test_cmp F/newfile6.png ../F/newfile6.png
+ )
+'
-test_expect_success \
- 'Remove only a text file' \
- 'rm -f A/newfile1.txt &&
- git commit -a -m "test: remove only a binary file" &&
- id=$(git rev-list --max-count=1 HEAD) &&
- (cd "$CVSWORK" &&
- git cvsexportcommit -c $id &&
- check_entries A "" &&
- check_entries B "" &&
- check_entries C "" &&
- check_entries D "" &&
- check_entries E "newfile5.txt/1.1/" &&
- check_entries F "newfile6.png/1.1/-kb" &&
- test_cmp E/newfile5.txt ../E/newfile5.txt &&
- test_cmp F/newfile6.png ../F/newfile6.png
- )'
+test_expect_success 'Remove only a text file' '
+ rm -f A/newfile1.txt &&
+ git commit -a -m "test: remove only a binary file" &&
+ id=$(git rev-list --max-count=1 HEAD) &&
+ (cd "$CVSWORK" &&
+ git cvsexportcommit -c $id &&
+ check_entries A "" &&
+ check_entries B "" &&
+ check_entries C "" &&
+ check_entries D "" &&
+ check_entries E "newfile5.txt/1.1/" &&
+ check_entries F "newfile6.png/1.1/-kb" &&
+ test_cmp E/newfile5.txt ../E/newfile5.txt &&
+ test_cmp F/newfile6.png ../F/newfile6.png
+ )
+'
-test_expect_success \
- 'New file with spaces in file name' \
- 'mkdir "G g" &&
- echo ok then >"G g/with spaces.txt" &&
- git add "G g/with spaces.txt" && \
- cp "$TEST_DIRECTORY"/test-binary-1.png "G g/with spaces.png" && \
- git add "G g/with spaces.png" &&
- git commit -a -m "With spaces" &&
- id=$(git rev-list --max-count=1 HEAD) &&
- (cd "$CVSWORK" &&
- git cvsexportcommit -c $id &&
- check_entries "G g" "with spaces.png/1.1/-kb|with spaces.txt/1.1/"
- )'
+test_expect_success 'New file with spaces in file name' '
+ mkdir "G g" &&
+ echo ok then >"G g/with spaces.txt" &&
+ git add "G g/with spaces.txt" && \
+ cp "$TEST_DIRECTORY"/test-binary-1.png "G g/with spaces.png" && \
+ git add "G g/with spaces.png" &&
+ git commit -a -m "With spaces" &&
+ id=$(git rev-list --max-count=1 HEAD) &&
+ (cd "$CVSWORK" &&
+ git cvsexportcommit -c $id &&
+ check_entries "G g" "with spaces.png/1.1/-kb|with spaces.txt/1.1/"
+ )
+'
-test_expect_success \
- 'Update file with spaces in file name' \
- 'echo Ok then >>"G g/with spaces.txt" &&
- cat "$TEST_DIRECTORY"/test-binary-1.png >>"G g/with spaces.png" && \
- git add "G g/with spaces.png" &&
- git commit -a -m "Update with spaces" &&
- id=$(git rev-list --max-count=1 HEAD) &&
- (cd "$CVSWORK" &&
- git cvsexportcommit -c $id &&
- check_entries "G g" "with spaces.png/1.2/-kb|with spaces.txt/1.2/"
- )'
+test_expect_success 'Update file with spaces in file name' '
+ echo Ok then >>"G g/with spaces.txt" &&
+ cat "$TEST_DIRECTORY"/test-binary-1.png >>"G g/with spaces.png" && \
+ git add "G g/with spaces.png" &&
+ git commit -a -m "Update with spaces" &&
+ id=$(git rev-list --max-count=1 HEAD) &&
+ (cd "$CVSWORK" &&
+ git cvsexportcommit -c $id &&
+ check_entries "G g" "with spaces.png/1.2/-kb|with spaces.txt/1.2/"
+ )
+'
# Some filesystems mangle pathnames with UTF-8 characters --
# check and skip
@@ -202,68 +202,68 @@ if p="Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö" &&
then
# This test contains UTF-8 characters
-test_expect_success !MINGW \
- 'File with non-ascii file name' \
- 'mkdir -p Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö &&
- echo Foo >Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
- git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
- cp "$TEST_DIRECTORY"/test-binary-1.png Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
- git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
- git commit -a -m "Går det så går det" && \
- id=$(git rev-list --max-count=1 HEAD) &&
- (cd "$CVSWORK" &&
- git cvsexportcommit -v -c $id &&
- check_entries \
- "Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö" \
- "gårdetsågårdet.png/1.1/-kb|gårdetsågårdet.txt/1.1/"
- )'
+test_expect_success !MINGW 'File with non-ascii file name' '
+ mkdir -p Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö &&
+ echo Foo >Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
+ git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
+ cp "$TEST_DIRECTORY"/test-binary-1.png Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
+ git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
+ git commit -a -m "Går det så går det" && \
+ id=$(git rev-list --max-count=1 HEAD) &&
+ (cd "$CVSWORK" &&
+ git cvsexportcommit -v -c $id &&
+ check_entries \
+ "Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö" \
+ "gårdetsågårdet.png/1.1/-kb|gårdetsågårdet.txt/1.1/"
+ )
+'
fi
rm -fr tst
-test_expect_success \
- 'Mismatching patch should fail' \
- 'date >>"E/newfile5.txt" &&
- git add "E/newfile5.txt" &&
- git commit -a -m "Update one" &&
- date >>"E/newfile5.txt" &&
- git add "E/newfile5.txt" &&
- git commit -a -m "Update two" &&
- id=$(git rev-list --max-count=1 HEAD) &&
- (cd "$CVSWORK" &&
- test_must_fail git cvsexportcommit -c $id
- )'
-
-test_expect_success FILEMODE \
- 'Retain execute bit' \
- 'mkdir G &&
- echo executeon >G/on &&
- chmod +x G/on &&
- echo executeoff >G/off &&
- git add G/on &&
- git add G/off &&
- git commit -a -m "Execute test" &&
- (cd "$CVSWORK" &&
- git cvsexportcommit -c HEAD &&
- test -x G/on &&
- ! test -x G/off
- )'
+test_expect_success 'Mismatching patch should fail' '
+ date >>"E/newfile5.txt" &&
+ git add "E/newfile5.txt" &&
+ git commit -a -m "Update one" &&
+ date >>"E/newfile5.txt" &&
+ git add "E/newfile5.txt" &&
+ git commit -a -m "Update two" &&
+ id=$(git rev-list --max-count=1 HEAD) &&
+ (cd "$CVSWORK" &&
+ test_must_fail git cvsexportcommit -c $id
+ )
+'
+
+test_expect_success FILEMODE 'Retain execute bit' '
+ mkdir G &&
+ echo executeon >G/on &&
+ chmod +x G/on &&
+ echo executeoff >G/off &&
+ git add G/on &&
+ git add G/off &&
+ git commit -a -m "Execute test" &&
+ (cd "$CVSWORK" &&
+ git cvsexportcommit -c HEAD &&
+ test -x G/on &&
+ ! test -x G/off
+ )
+'
test_expect_success '-w option should work with relative GIT_DIR' '
- mkdir W &&
- echo foobar >W/file1.txt &&
- echo bazzle >W/file2.txt &&
- git add W/file1.txt &&
- git add W/file2.txt &&
- git commit -m "More updates" &&
- id=$(git rev-list --max-count=1 HEAD) &&
- (cd "$GIT_DIR" &&
- GIT_DIR=. git cvsexportcommit -w "$CVSWORK" -c $id &&
- check_entries "$CVSWORK/W" "file1.txt/1.1/|file2.txt/1.1/" &&
- test_cmp "$CVSWORK/W/file1.txt" ../W/file1.txt &&
- test_cmp "$CVSWORK/W/file2.txt" ../W/file2.txt
- )
+ mkdir W &&
+ echo foobar >W/file1.txt &&
+ echo bazzle >W/file2.txt &&
+ git add W/file1.txt &&
+ git add W/file2.txt &&
+ git commit -m "More updates" &&
+ id=$(git rev-list --max-count=1 HEAD) &&
+ (cd "$GIT_DIR" &&
+ GIT_DIR=. git cvsexportcommit -w "$CVSWORK" -c $id &&
+ check_entries "$CVSWORK/W" "file1.txt/1.1/|file2.txt/1.1/" &&
+ test_cmp "$CVSWORK/W/file1.txt" ../W/file1.txt &&
+ test_cmp "$CVSWORK/W/file2.txt" ../W/file2.txt
+ )
'
test_expect_success 'check files before directories' '
@@ -290,21 +290,20 @@ test_expect_success 'check files before directories' '
'
test_expect_success 're-commit a removed filename which remains in CVS attic' '
-
- (cd "$CVSWORK" &&
- echo >attic_gremlin &&
- cvs -Q add attic_gremlin &&
- cvs -Q ci -m "added attic_gremlin" &&
- rm attic_gremlin &&
- cvs -Q rm attic_gremlin &&
- cvs -Q ci -m "removed attic_gremlin") &&
-
- echo > attic_gremlin &&
- git add attic_gremlin &&
- git commit -m "Added attic_gremlin" &&
+ (cd "$CVSWORK" &&
+ echo >attic_gremlin &&
+ cvs -Q add attic_gremlin &&
+ cvs -Q ci -m "added attic_gremlin" &&
+ rm attic_gremlin &&
+ cvs -Q rm attic_gremlin &&
+ cvs -Q ci -m "removed attic_gremlin") &&
+
+ echo > attic_gremlin &&
+ git add attic_gremlin &&
+ git commit -m "Added attic_gremlin" &&
git cvsexportcommit -w "$CVSWORK" -c HEAD &&
- (cd "$CVSWORK" && cvs -Q update -d) &&
- test -f "$CVSWORK/attic_gremlin"
+ (cd "$CVSWORK" && cvs -Q update -d) &&
+ test -f "$CVSWORK/attic_gremlin"
'
# the state of the CVS sandbox may be indeterminate for ' space'
diff --git a/t/t9210-scalar.sh b/t/t9210-scalar.sh
new file mode 100755
index 0000000..428339e
--- /dev/null
+++ b/t/t9210-scalar.sh
@@ -0,0 +1,241 @@
+#!/bin/sh
+
+test_description='test the `scalar` command'
+
+. ./test-lib.sh
+
+GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab cron.txt,launchctl:true,schtasks:true"
+export GIT_TEST_MAINT_SCHEDULER
+
+test_expect_success 'scalar shows a usage' '
+ test_expect_code 129 scalar -h
+'
+
+test_expect_success 'scalar invoked on enlistment root' '
+ test_when_finished rm -rf test src deeper &&
+
+ for enlistment_root in test src deeper/test
+ do
+ git init ${enlistment_root}/src &&
+
+ # Register
+ scalar register ${enlistment_root} &&
+ scalar list >out &&
+ grep "$(pwd)/${enlistment_root}/src\$" out &&
+
+ # Delete (including enlistment root)
+ scalar delete $enlistment_root &&
+ test_path_is_missing $enlistment_root &&
+ scalar list >out &&
+ ! grep "^$(pwd)/${enlistment_root}/src\$" out || return 1
+ done
+'
+
+test_expect_success 'scalar invoked on enlistment src repo' '
+ test_when_finished rm -rf test src deeper &&
+
+ for enlistment_root in test src deeper/test
+ do
+ git init ${enlistment_root}/src &&
+
+ # Register
+ scalar register ${enlistment_root}/src &&
+ scalar list >out &&
+ grep "$(pwd)/${enlistment_root}/src\$" out &&
+
+ # Delete (will not include enlistment root)
+ scalar delete ${enlistment_root}/src &&
+ test_path_is_dir $enlistment_root &&
+ scalar list >out &&
+ ! grep "^$(pwd)/${enlistment_root}/src\$" out || return 1
+ done
+'
+
+test_expect_success 'scalar invoked when enlistment root and repo are the same' '
+ test_when_finished rm -rf test src deeper &&
+
+ for enlistment_root in test src deeper/test
+ do
+ git init ${enlistment_root} &&
+
+ # Register
+ scalar register ${enlistment_root} &&
+ scalar list >out &&
+ grep "$(pwd)/${enlistment_root}\$" out &&
+
+ # Delete (will not include enlistment root)
+ scalar delete ${enlistment_root} &&
+ test_path_is_missing $enlistment_root &&
+ scalar list >out &&
+ ! grep "^$(pwd)/${enlistment_root}\$" out &&
+
+ # Make sure we did not accidentally delete the trash dir
+ test_path_is_dir "$TRASH_DIRECTORY" || return 1
+ done
+'
+
+test_expect_success 'scalar repo search respects GIT_CEILING_DIRECTORIES' '
+ test_when_finished rm -rf test &&
+
+ git init test/src &&
+ mkdir -p test/src/deep &&
+ GIT_CEILING_DIRECTORIES="$(pwd)/test/src" &&
+ ! scalar register test/src/deep 2>err &&
+ grep "not a git repository" err
+'
+
+test_expect_success 'scalar enlistments need a worktree' '
+ test_when_finished rm -rf bare test &&
+
+ git init --bare bare/src &&
+ ! scalar register bare/src 2>err &&
+ grep "Scalar enlistments require a worktree" err &&
+
+ git init test/src &&
+ ! scalar register test/src/.git 2>err &&
+ grep "Scalar enlistments require a worktree" err
+'
+
+test_expect_success FSMONITOR_DAEMON 'scalar register starts fsmon daemon' '
+ git init test/src &&
+ test_must_fail git -C test/src fsmonitor--daemon status &&
+ scalar register test/src &&
+ git -C test/src fsmonitor--daemon status &&
+ test_cmp_config -C test/src true core.fsmonitor
+'
+
+test_expect_success 'scalar register warns when background maintenance fails' '
+ git init register-repo &&
+ GIT_TEST_MAINT_SCHEDULER="crontab:false,launchctl:false,schtasks:false" \
+ scalar register register-repo 2>err &&
+ grep "could not turn on maintenance" err
+'
+
+test_expect_success 'scalar unregister' '
+ git init vanish/src &&
+ scalar register vanish/src &&
+ git config --get --global --fixed-value \
+ maintenance.repo "$(pwd)/vanish/src" &&
+ scalar list >scalar.repos &&
+ grep -F "$(pwd)/vanish/src" scalar.repos &&
+ rm -rf vanish/src/.git &&
+ scalar unregister vanish &&
+ test_must_fail git config --get --global --fixed-value \
+ maintenance.repo "$(pwd)/vanish/src" &&
+ scalar list >scalar.repos &&
+ ! grep -F "$(pwd)/vanish/src" scalar.repos &&
+
+ # scalar unregister should be idempotent
+ scalar unregister vanish
+'
+
+test_expect_success 'set up repository to clone' '
+ test_commit first &&
+ test_commit second &&
+ test_commit third &&
+ git switch -c parallel first &&
+ mkdir -p 1/2 &&
+ test_commit 1/2/3 &&
+ git config uploadPack.allowFilter true &&
+ git config uploadPack.allowAnySHA1InWant true
+'
+
+test_expect_success 'scalar clone' '
+ second=$(git rev-parse --verify second:second.t) &&
+ scalar clone "file://$(pwd)" cloned --single-branch &&
+ (
+ cd cloned/src &&
+
+ git config --get --global --fixed-value maintenance.repo \
+ "$(pwd)" &&
+
+ git for-each-ref --format="%(refname)" refs/remotes/origin/ >actual &&
+ echo "refs/remotes/origin/parallel" >expect &&
+ test_cmp expect actual &&
+
+ test_path_is_missing 1/2 &&
+
+ # This relies on the fact that the presence of "--missing"
+ # on the command line forces lazy fetching off before
+ # "$second^{blob}" gets parsed. Without "^{blob}", a
+ # bare object name "$second" is taken into the queue and
+ # the command may not fail with a fixed "rev-list --missing".
+ test_must_fail git rev-list --missing=print "$second^{blob}" -- &&
+
+ git rev-list $second &&
+ git cat-file blob $second >actual &&
+ echo "second" >expect &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'scalar reconfigure' '
+ git init one/src &&
+ scalar register one &&
+ git -C one/src config core.preloadIndex false &&
+ scalar reconfigure one &&
+ test true = "$(git -C one/src config core.preloadIndex)" &&
+ git -C one/src config core.preloadIndex false &&
+ scalar reconfigure -a &&
+ test true = "$(git -C one/src config core.preloadIndex)"
+'
+
+test_expect_success '`reconfigure -a` removes stale config entries' '
+ git init stale/src &&
+ scalar register stale &&
+ scalar list >scalar.repos &&
+ grep stale scalar.repos &&
+
+ grep -v stale scalar.repos >expect &&
+
+ rm -rf stale &&
+ scalar reconfigure -a &&
+ scalar list >scalar.repos &&
+ test_cmp expect scalar.repos
+'
+
+test_expect_success 'scalar delete without enlistment shows a usage' '
+ test_expect_code 129 scalar delete
+'
+
+test_expect_success 'scalar delete with enlistment' '
+ scalar delete cloned &&
+ test_path_is_missing cloned
+'
+
+test_expect_success 'scalar supports -c/-C' '
+ test_when_finished "scalar delete sub" &&
+ git init sub &&
+ scalar -C sub -c status.aheadBehind=bogus register &&
+ test -z "$(git -C sub config --local status.aheadBehind)" &&
+ test true = "$(git -C sub config core.preloadIndex)"
+'
+
+test_expect_success '`scalar [...] <dir>` errors out when dir is missing' '
+ ! scalar run config cloned 2>err &&
+ grep "cloned. does not exist" err
+'
+
+SQ="'"
+test_expect_success UNZIP 'scalar diagnose' '
+ scalar clone "file://$(pwd)" cloned --single-branch &&
+ git repack &&
+ echo "$(pwd)/.git/objects/" >>cloned/src/.git/objects/info/alternates &&
+ test_commit -C cloned/src loose &&
+ scalar diagnose cloned >out 2>err &&
+ grep "Available space" out &&
+ sed -n "s/.*$SQ\\(.*\\.zip\\)$SQ.*/\\1/p" <err >zip_path &&
+ zip_path=$(cat zip_path) &&
+ test -n "$zip_path" &&
+ "$GIT_UNZIP" -v "$zip_path" &&
+ folder=${zip_path%.zip} &&
+ test_path_is_missing "$folder" &&
+ "$GIT_UNZIP" -p "$zip_path" diagnostics.log >out &&
+ test_file_not_empty out &&
+ "$GIT_UNZIP" -p "$zip_path" packs-local.txt >out &&
+ grep "$(pwd)/.git/objects" out &&
+ "$GIT_UNZIP" -p "$zip_path" objects-local.txt >out &&
+ grep "^Total: [1-9]" out
+'
+
+test_done
diff --git a/t/t9211-scalar-clone.sh b/t/t9211-scalar-clone.sh
new file mode 100755
index 0000000..7869f45
--- /dev/null
+++ b/t/t9211-scalar-clone.sh
@@ -0,0 +1,195 @@
+#!/bin/sh
+
+test_description='test the `scalar clone` subcommand'
+
+. ./test-lib.sh
+. "${TEST_DIRECTORY}/lib-terminal.sh"
+
+GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab cron.txt,launchctl:true,schtasks:true"
+export GIT_TEST_MAINT_SCHEDULER
+
+test_expect_success 'set up repository to clone' '
+ rm -rf .git &&
+ git init to-clone &&
+ (
+ cd to-clone &&
+ git branch -m base &&
+
+ test_commit first &&
+ test_commit second &&
+ test_commit third &&
+
+ git switch -c parallel first &&
+ mkdir -p 1/2 &&
+ test_commit 1/2/3 &&
+
+ git switch base &&
+
+ # By default, permit
+ git config uploadpack.allowfilter true &&
+ git config uploadpack.allowanysha1inwant true
+ )
+'
+
+cleanup_clone () {
+ rm -rf "$1"
+}
+
+test_expect_success 'creates content in enlistment root' '
+ enlistment=cloned &&
+
+ scalar clone "file://$(pwd)/to-clone" $enlistment &&
+ ls -A $enlistment >enlistment-root &&
+ test_line_count = 1 enlistment-root &&
+ test_path_is_dir $enlistment/src &&
+ test_path_is_dir $enlistment/src/.git &&
+
+ cleanup_clone $enlistment
+'
+
+test_expect_success 'with spaces' '
+ enlistment="cloned with space" &&
+
+ scalar clone "file://$(pwd)/to-clone" "$enlistment" &&
+ test_path_is_dir "$enlistment" &&
+ test_path_is_dir "$enlistment/src" &&
+ test_path_is_dir "$enlistment/src/.git" &&
+
+ cleanup_clone "$enlistment"
+'
+
+test_expect_success 'partial clone if supported by server' '
+ enlistment=partial-clone &&
+
+ scalar clone "file://$(pwd)/to-clone" $enlistment &&
+
+ (
+ cd $enlistment/src &&
+
+ # Two promisor packs: one for refs, the other for blobs
+ ls .git/objects/pack/pack-*.promisor >promisorlist &&
+ test_line_count = 2 promisorlist
+ ) &&
+
+ cleanup_clone $enlistment
+'
+
+test_expect_success 'fall back on full clone if partial unsupported' '
+ enlistment=no-partial-support &&
+
+ test_config -C to-clone uploadpack.allowfilter false &&
+ test_config -C to-clone uploadpack.allowanysha1inwant false &&
+
+ scalar clone "file://$(pwd)/to-clone" $enlistment 2>err &&
+ grep "filtering not recognized by server, ignoring" err &&
+
+ (
+ cd $enlistment/src &&
+
+ # Still get a refs promisor file, but none for blobs
+ ls .git/objects/pack/pack-*.promisor >promisorlist &&
+ test_line_count = 1 promisorlist
+ ) &&
+
+ cleanup_clone $enlistment
+'
+
+test_expect_success 'initializes sparse-checkout by default' '
+ enlistment=sparse &&
+
+ scalar clone "file://$(pwd)/to-clone" $enlistment &&
+ (
+ cd $enlistment/src &&
+ test_cmp_config true core.sparseCheckout &&
+ test_cmp_config true core.sparseCheckoutCone
+ ) &&
+
+ cleanup_clone $enlistment
+'
+
+test_expect_success '--full-clone does not create sparse-checkout' '
+ enlistment=full-clone &&
+
+ scalar clone --full-clone "file://$(pwd)/to-clone" $enlistment &&
+ (
+ cd $enlistment/src &&
+ test_cmp_config "" --default "" core.sparseCheckout &&
+ test_cmp_config "" --default "" core.sparseCheckoutCone
+ ) &&
+
+ cleanup_clone $enlistment
+'
+
+test_expect_success '--single-branch clones HEAD only' '
+ enlistment=single-branch &&
+
+ scalar clone --single-branch "file://$(pwd)/to-clone" $enlistment &&
+ (
+ cd $enlistment/src &&
+ git for-each-ref refs/remotes/origin >out &&
+ test_line_count = 1 out &&
+ grep "refs/remotes/origin/base" out
+ ) &&
+
+ cleanup_clone $enlistment
+'
+
+test_expect_success '--no-single-branch clones all branches' '
+ enlistment=no-single-branch &&
+
+ scalar clone --no-single-branch "file://$(pwd)/to-clone" $enlistment &&
+ (
+ cd $enlistment/src &&
+ git for-each-ref refs/remotes/origin >out &&
+ test_line_count = 2 out &&
+ grep "refs/remotes/origin/base" out &&
+ grep "refs/remotes/origin/parallel" out
+ ) &&
+
+ cleanup_clone $enlistment
+'
+
+test_expect_success TTY 'progress with tty' '
+ enlistment=progress1 &&
+
+ test_config -C to-clone uploadpack.allowfilter true &&
+ test_config -C to-clone uploadpack.allowanysha1inwant true &&
+
+ test_terminal env GIT_PROGRESS_DELAY=0 \
+ scalar clone "file://$(pwd)/to-clone" "$enlistment" 2>stderr &&
+ grep "Enumerating objects" stderr >actual &&
+ test_line_count = 2 actual &&
+ cleanup_clone $enlistment
+'
+
+test_expect_success 'progress without tty' '
+ enlistment=progress2 &&
+
+ test_config -C to-clone uploadpack.allowfilter true &&
+ test_config -C to-clone uploadpack.allowanysha1inwant true &&
+
+ GIT_PROGRESS_DELAY=0 scalar clone "file://$(pwd)/to-clone" "$enlistment" 2>stderr &&
+ ! grep "Enumerating objects" stderr &&
+ ! grep "Updating files" stderr &&
+ cleanup_clone $enlistment
+'
+
+test_expect_success 'scalar clone warns when background maintenance fails' '
+ GIT_TEST_MAINT_SCHEDULER="crontab:false,launchctl:false,schtasks:false" \
+ scalar clone "file://$(pwd)/to-clone" maint-fail 2>err &&
+ grep "could not turn on maintenance" err
+'
+
+test_expect_success '`scalar clone --no-src`' '
+ scalar clone --src "file://$(pwd)/to-clone" with-src &&
+ scalar clone --no-src "file://$(pwd)/to-clone" without-src &&
+
+ test_path_is_dir with-src/src &&
+ test_path_is_missing without-src/src &&
+
+ (cd with-src/src && ls ?*) >with &&
+ (cd without-src && ls ?*) >without &&
+ test_cmp with without
+'
+
+test_done
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index aa55b41..60e30fe 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -388,9 +388,7 @@ test_expect_success 'B: accept branch name "TEMP_TAG"' '
INPUT_END
- test_when_finished "rm -f .git/TEMP_TAG
- git gc
- git prune" &&
+ test_when_finished "rm -f .git/TEMP_TAG && git gc --prune=now" &&
git fast-import <input &&
test $(test-tool ref-store main resolve-ref TEMP_TAG 0 | cut -f1 -d " " ) != "$ZERO_OID" &&
test $(git rev-parse main) = $(git rev-parse TEMP_TAG^)
@@ -406,8 +404,7 @@ test_expect_success 'B: accept empty committer' '
INPUT_END
test_when_finished "git update-ref -d refs/heads/empty-committer-1
- git gc
- git prune" &&
+ git gc --prune=now" &&
git fast-import <input &&
out=$(git fsck) &&
echo "$out" &&
@@ -452,8 +449,7 @@ test_expect_success 'B: accept and fixup committer with no name' '
INPUT_END
test_when_finished "git update-ref -d refs/heads/empty-committer-2
- git gc
- git prune" &&
+ git gc --prune=now" &&
git fast-import <input &&
out=$(git fsck) &&
echo "$out" &&
@@ -990,7 +986,7 @@ test_expect_success 'L: nested tree copy does not corrupt deltas' '
test_when_finished "git update-ref -d refs/heads/L2" &&
git fast-import <input &&
git ls-tree L2 g/b/ >tmp &&
- cat tmp | cut -f 2 >actual &&
+ cut -f 2 <tmp >actual &&
test_cmp expect actual &&
git fsck $(git rev-parse L2)
'
@@ -1778,8 +1774,7 @@ test_expect_success 'P: verbatim SHA gitlinks' '
INPUT_END
git branch -D sub &&
- git gc &&
- git prune &&
+ git gc --prune=now &&
git fast-import <input &&
test $(git rev-parse --verify subuse2) = $(git rev-parse --verify subuse1)
'
@@ -2012,12 +2007,11 @@ test_expect_success 'Q: verify first notes commit' '
'
test_expect_success 'Q: verify first notes tree' '
- cat >expect.unsorted <<-EOF &&
+ sort >expect <<-EOF &&
100644 blob $commit1
100644 blob $commit2
100644 blob $commit3
EOF
- cat expect.unsorted | sort >expect &&
git cat-file -p refs/notes/foobar~2^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
test_cmp expect actual
'
@@ -2053,12 +2047,11 @@ test_expect_success 'Q: verify second notes commit' '
'
test_expect_success 'Q: verify second notes tree' '
- cat >expect.unsorted <<-EOF &&
+ sort >expect <<-EOF &&
100644 blob $commit1
100644 blob $commit2
100644 blob $commit3
EOF
- cat expect.unsorted | sort >expect &&
git cat-file -p refs/notes/foobar^^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
test_cmp expect actual
'
@@ -2093,10 +2086,9 @@ test_expect_success 'Q: verify third notes commit' '
'
test_expect_success 'Q: verify third notes tree' '
- cat >expect.unsorted <<-EOF &&
+ sort >expect <<-EOF &&
100644 blob $commit1
EOF
- cat expect.unsorted | sort >expect &&
git cat-file -p refs/notes/foobar2^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
test_cmp expect actual
'
@@ -2120,10 +2112,9 @@ test_expect_success 'Q: verify fourth notes commit' '
'
test_expect_success 'Q: verify fourth notes tree' '
- cat >expect.unsorted <<-EOF &&
+ sort >expect <<-EOF &&
100644 blob $commit2
EOF
- cat expect.unsorted | sort >expect &&
git cat-file -p refs/notes/foobar^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
test_cmp expect actual
'
@@ -2884,7 +2875,7 @@ test_expect_success 'S: filemodify with garbage after mark must fail' '
COMMIT
M 100644 :403x hello.c
EOF
- test_i18ngrep "space after mark" err
+ test_grep "space after mark" err
'
# inline is misspelled; fast-import thinks it is some unknown dataref
@@ -2900,7 +2891,7 @@ test_expect_success 'S: filemodify with garbage after inline must fail' '
inline
BLOB
EOF
- test_i18ngrep "nvalid dataref" err
+ test_grep "nvalid dataref" err
'
test_expect_success 'S: filemodify with garbage after sha1 must fail' '
@@ -2913,7 +2904,7 @@ test_expect_success 'S: filemodify with garbage after sha1 must fail' '
COMMIT
M 100644 ${sha1}x hello.c
EOF
- test_i18ngrep "space after SHA1" err
+ test_grep "space after SHA1" err
'
#
@@ -2928,7 +2919,7 @@ test_expect_success 'S: notemodify with garbage after mark dataref must fail' '
COMMIT
N :202x :302
EOF
- test_i18ngrep "space after mark" err
+ test_grep "space after mark" err
'
test_expect_success 'S: notemodify with garbage after inline dataref must fail' '
@@ -2943,7 +2934,7 @@ test_expect_success 'S: notemodify with garbage after inline dataref must fail'
note blob
BLOB
EOF
- test_i18ngrep "nvalid dataref" err
+ test_grep "nvalid dataref" err
'
test_expect_success 'S: notemodify with garbage after sha1 dataref must fail' '
@@ -2956,7 +2947,7 @@ test_expect_success 'S: notemodify with garbage after sha1 dataref must fail' '
COMMIT
N ${sha1}x :302
EOF
- test_i18ngrep "space after SHA1" err
+ test_grep "space after SHA1" err
'
#
@@ -2971,7 +2962,7 @@ test_expect_success 'S: notemodify with garbage after mark commit-ish must fail'
COMMIT
N :202 :302x
EOF
- test_i18ngrep "after mark" err
+ test_grep "after mark" err
'
#
@@ -3004,7 +2995,7 @@ test_expect_success 'S: from with garbage after mark must fail' '
EOF
# now evaluate the error
- test_i18ngrep "after mark" err
+ test_grep "after mark" err
'
@@ -3023,7 +3014,7 @@ test_expect_success 'S: merge with garbage after mark must fail' '
merge :303x
M 100644 :403 hello.c
EOF
- test_i18ngrep "after mark" err
+ test_grep "after mark" err
'
#
@@ -3038,7 +3029,7 @@ test_expect_success 'S: tag with garbage after mark must fail' '
tag S
TAG
EOF
- test_i18ngrep "after mark" err
+ test_grep "after mark" err
'
#
@@ -3048,7 +3039,7 @@ test_expect_success 'S: cat-blob with garbage after mark must fail' '
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
cat-blob :403x
EOF
- test_i18ngrep "after mark" err
+ test_grep "after mark" err
'
#
@@ -3058,7 +3049,7 @@ test_expect_success 'S: ls with garbage after mark must fail' '
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
ls :302x hello.c
EOF
- test_i18ngrep "space after mark" err
+ test_grep "space after mark" err
'
test_expect_success 'S: ls with garbage after sha1 must fail' '
@@ -3066,7 +3057,7 @@ test_expect_success 'S: ls with garbage after sha1 must fail' '
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
ls ${sha1}x hello.c
EOF
- test_i18ngrep "space after tree-ish" err
+ test_grep "space after tree-ish" err
'
###
diff --git a/t/t9301-fast-import-notes.sh b/t/t9301-fast-import-notes.sh
index 1ae4d7c..5841322 100755
--- a/t/t9301-fast-import-notes.sh
+++ b/t/t9301-fast-import-notes.sh
@@ -7,6 +7,7 @@ test_description='test git fast-import of notes objects'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
diff --git a/t/t9304-fast-import-marks.sh b/t/t9304-fast-import-marks.sh
index bed01c9..410a871 100755
--- a/t/t9304-fast-import-marks.sh
+++ b/t/t9304-fast-import-marks.sh
@@ -25,6 +25,7 @@ test_expect_success 'import with large marks file' '
'
test_expect_success 'setup dump with submodule' '
+ test_config_global protocol.file.allow always &&
git submodule add "$PWD" sub &&
git commit -m "add submodule" &&
git fast-export HEAD >dump
@@ -48,4 +49,33 @@ test_expect_success 'import with submodule mapping' '
test_cmp expect actual
'
+test_expect_success 'paths adjusted for relative subdir' '
+ git init deep-dst &&
+ mkdir deep-dst/subdir &&
+ >deep-dst/subdir/empty-marks &&
+ git -C deep-dst/subdir fast-import \
+ --rewrite-submodules-from=sub:../../from \
+ --rewrite-submodules-to=sub:../../to \
+ --import-marks=empty-marks \
+ --export-marks=exported-marks \
+ --export-pack-edges=exported-edges \
+ <dump &&
+ # we do not bother checking resulting repo; we just care that nothing
+ # complained about failing to open files for reading, and that files
+ # for writing were created in the expected spot
+ test_path_is_file deep-dst/subdir/exported-marks &&
+ test_path_is_file deep-dst/subdir/exported-edges
+'
+
+test_expect_success 'relative marks are not affected by subdir' '
+ git init deep-relative &&
+ mkdir deep-relative/subdir &&
+ git -C deep-relative/subdir fast-import \
+ --relative-marks \
+ --export-marks=exported-marks \
+ <dump &&
+ test_path_is_missing deep-relative/subdir/exported-marks &&
+ test_path_is_file deep-relative/.git/info/fast-import/exported-marks
+'
+
test_done
diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh
index fc99703..1eb035e 100755
--- a/t/t9350-fast-export.sh
+++ b/t/t9350-fast-export.sh
@@ -236,7 +236,7 @@ EOF
test_expect_success 'set up faked signed tag' '
- cat signed-tag-import | git fast-import
+ git fast-import <signed-tag-import
'
@@ -268,6 +268,7 @@ test_expect_success 'signed-tags=warn-strip' '
test_expect_success 'setup submodule' '
+ test_config_global protocol.file.allow always &&
git checkout -f main &&
mkdir sub &&
(
@@ -293,6 +294,7 @@ test_expect_success 'setup submodule' '
test_expect_success 'submodule fast-export | fast-import' '
+ test_config_global protocol.file.allow always &&
SUBENT1=$(git ls-tree main^ sub) &&
SUBENT2=$(git ls-tree main sub) &&
rm -rf new &&
@@ -371,7 +373,7 @@ EOF
test_expect_success 'cope with tagger-less tags' '
- TAG=$(git hash-object -t tag -w tag-content) &&
+ TAG=$(git hash-object --literally -t tag -w tag-content) &&
git update-ref refs/tags/sonnenschein $TAG &&
git fast-export -C -C --signed-tags=strip --all > output &&
test $(grep -c "^tag " output) = 4 &&
@@ -535,7 +537,7 @@ test_expect_success 'full-tree re-shows unmodified files' '
test_expect_success 'set-up a few more tags for tag export tests' '
git checkout -f main &&
- HEAD_TREE=$(git show -s --pretty=raw HEAD | grep tree | sed "s/tree //") &&
+ HEAD_TREE=$(git show -s --pretty=raw HEAD | sed -n "/tree/s/tree //p") &&
git tag tree_tag -m "tagging a tree" $HEAD_TREE &&
git tag -a tree_tag-obj -m "tagging a tree" $HEAD_TREE &&
git tag tag-obj_tag -m "tagging a tag" tree_tag-obj &&
@@ -789,4 +791,14 @@ test_expect_success 'fast-export --first-parent outputs all revisions output by
)
'
+test_expect_success 'fast-export handles --end-of-options' '
+ git update-ref refs/heads/nodash HEAD &&
+ git update-ref refs/heads/--dashes HEAD &&
+ git fast-export --end-of-options nodash >expect &&
+ git fast-export --end-of-options --dashes >actual.raw &&
+ # fix up lines which mention the ref for comparison
+ sed s/--dashes/nodash/ <actual.raw >actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t9351-fast-export-anonymize.sh b/t/t9351-fast-export-anonymize.sh
index 77047e2..156a647 100755
--- a/t/t9351-fast-export-anonymize.sh
+++ b/t/t9351-fast-export-anonymize.sh
@@ -25,6 +25,7 @@ test_expect_success 'setup simple repo' '
test_expect_success 'export anonymized stream' '
git fast-export --anonymize --all \
--anonymize-map=retain-me \
+ --anonymize-map=xyzzy:should-not-appear \
--anonymize-map=xyzzy:custom-name \
--anonymize-map=other \
>stream
@@ -41,6 +42,7 @@ test_expect_success 'stream omits path names' '
test_expect_success 'stream contains user-specified names' '
grep retain-me stream &&
+ ! grep should-not-appear stream &&
grep custom-name stream
'
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index 379b19f..e499c7f 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -66,10 +66,11 @@ test_expect_success 'setup' '
# note that cvs doesn't accept absolute pathnames
# as argument to co -d
-test_expect_success 'basic checkout' \
- 'GIT_CONFIG="$git_config" cvs -Q co -d cvswork main &&
- test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))" = "empty/1.1/" &&
- test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | sed -ne \$p))" = "secondrootfile/1.1/"'
+test_expect_success 'basic checkout' '
+ GIT_CONFIG="$git_config" cvs -Q co -d cvswork main &&
+ test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))" = "empty/1.1/" &&
+ test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | sed -ne \$p))" = "secondrootfile/1.1/"
+'
#------------------------
# PSERVER AUTHENTICATION
@@ -115,35 +116,40 @@ Ah<Z:yZZ30 e
END VERIFICATION REQUEST
EOF
-test_expect_success 'pserver authentication' \
- 'cat request-anonymous | git-cvsserver pserver >log 2>&1 &&
- sed -ne \$p log | grep "^I LOVE YOU\$"'
+test_expect_success 'pserver authentication' '
+ git-cvsserver pserver <request-anonymous >log 2>&1 &&
+ sed -ne \$p log | grep "^I LOVE YOU\$"
+'
-test_expect_success 'pserver authentication failure (non-anonymous user)' \
- 'if cat request-git | git-cvsserver pserver >log 2>&1
- then
- false
- else
- true
- fi &&
- sed -ne \$p log | grep "^I HATE YOU\$"'
+test_expect_success 'pserver authentication failure (non-anonymous user)' '
+ if git-cvsserver pserver <request-git >log 2>&1
+ then
+ false
+ else
+ true
+ fi &&
+ sed -ne \$p log | grep "^I HATE YOU\$"
+'
-test_expect_success 'pserver authentication success (non-anonymous user with password)' \
- 'cat login-git-ok | git-cvsserver pserver >log 2>&1 &&
- sed -ne \$p log | grep "^I LOVE YOU\$"'
+test_expect_success 'pserver authentication success (non-anonymous user with password)' '
+ git-cvsserver pserver <login-git-ok >log 2>&1 &&
+ sed -ne \$p log | grep "^I LOVE YOU\$"
+'
-test_expect_success 'pserver authentication (login)' \
- 'cat login-anonymous | git-cvsserver pserver >log 2>&1 &&
- sed -ne \$p log | grep "^I LOVE YOU\$"'
+test_expect_success 'pserver authentication (login)' '
+ git-cvsserver pserver <login-anonymous >log 2>&1 &&
+ sed -ne \$p log | grep "^I LOVE YOU\$"
+'
-test_expect_success 'pserver authentication failure (login/non-anonymous user)' \
- 'if cat login-git | git-cvsserver pserver >log 2>&1
- then
- false
- else
- true
- fi &&
- sed -ne \$p log | grep "^I HATE YOU\$"'
+test_expect_success 'pserver authentication failure (login/non-anonymous user)' '
+ if git-cvsserver pserver <login-git >log 2>&1
+ then
+ false
+ else
+ true
+ fi &&
+ sed -ne \$p log | grep "^I HATE YOU\$"
+'
# misuse pserver authentication for testing of req_Root
@@ -165,36 +171,38 @@ END AUTH REQUEST
Root $WORKDIR
EOF
-test_expect_success 'req_Root failure (relative pathname)' \
- 'if cat request-relative | git-cvsserver pserver >log 2>&1
- then
- echo unexpected success
- false
- else
- true
- fi &&
- tail log | grep "^error 1 Root must be an absolute pathname$"'
+test_expect_success 'req_Root failure (relative pathname)' '
+ if git-cvsserver pserver <request-relative >log 2>&1
+ then
+ echo unexpected success
+ false
+ else
+ true
+ fi &&
+ tail log | grep "^error 1 Root must be an absolute pathname$"
+'
-test_expect_success 'req_Root failure (conflicting roots)' \
- 'cat request-conflict | git-cvsserver pserver >log 2>&1 &&
- tail log | grep "^error 1 Conflicting roots specified$"'
+test_expect_success 'req_Root failure (conflicting roots)' '
+ git-cvsserver pserver <request-conflict >log 2>&1 &&
+ tail log | grep "^error 1 Conflicting roots specified$"
+'
-test_expect_success 'req_Root (strict paths)' \
- 'cat request-anonymous | git-cvsserver --strict-paths pserver "$SERVERDIR" >log 2>&1 &&
- sed -ne \$p log | grep "^I LOVE YOU\$"'
+test_expect_success 'req_Root (strict paths)' '
+ git-cvsserver --strict-paths pserver "$SERVERDIR" <request-anonymous >log 2>&1 &&
+ sed -ne \$p log | grep "^I LOVE YOU\$"
+'
test_expect_success 'req_Root failure (strict-paths)' '
- ! cat request-anonymous |
- git-cvsserver --strict-paths pserver "$WORKDIR" >log 2>&1
+ ! git-cvsserver --strict-paths pserver "$WORKDIR" <request-anonymous >log 2>&1
'
-test_expect_success 'req_Root (w/o strict-paths)' \
- 'cat request-anonymous | git-cvsserver pserver "$WORKDIR/" >log 2>&1 &&
- sed -ne \$p log | grep "^I LOVE YOU\$"'
+test_expect_success 'req_Root (w/o strict-paths)' '
+ git-cvsserver pserver "$WORKDIR/" <request-anonymous >log 2>&1 &&
+ sed -ne \$p log | grep "^I LOVE YOU\$"
+'
test_expect_success 'req_Root failure (w/o strict-paths)' '
- ! cat request-anonymous |
- git-cvsserver pserver "$WORKDIR/gitcvs" >log 2>&1
+ ! git-cvsserver pserver "$WORKDIR/gitcvs" <request-anonymous >log 2>&1
'
cat >request-base <<EOF
@@ -206,27 +214,29 @@ END AUTH REQUEST
Root /gitcvs.git
EOF
-test_expect_success 'req_Root (base-path)' \
- 'cat request-base | git-cvsserver --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 &&
- sed -ne \$p log | grep "^I LOVE YOU\$"'
+test_expect_success 'req_Root (base-path)' '
+ git-cvsserver --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" <request-base >log 2>&1 &&
+ sed -ne \$p log | grep "^I LOVE YOU\$"
+'
test_expect_success 'req_Root failure (base-path)' '
- ! cat request-anonymous |
- git-cvsserver --strict-paths --base-path "$WORKDIR" pserver "$SERVERDIR" >log 2>&1
+ ! git-cvsserver --strict-paths --base-path "$WORKDIR" pserver "$SERVERDIR" <request-anonymous >log 2>&1
'
GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false || exit 1
-test_expect_success 'req_Root (export-all)' \
- 'cat request-anonymous | git-cvsserver --export-all pserver "$WORKDIR" >log 2>&1 &&
- sed -ne \$p log | grep "^I LOVE YOU\$"'
+test_expect_success 'req_Root (export-all)' '
+ git-cvsserver --export-all pserver "$WORKDIR" <request-anonymous >log 2>&1 &&
+ sed -ne \$p log | grep "^I LOVE YOU\$"
+'
-test_expect_success 'req_Root failure (export-all w/o directory list)' \
- '! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)'
+test_expect_success 'req_Root failure (export-all w/o directory list)' '
+ ! (git-cvsserver --export-all pserver <request-anonymous >log 2>&1 || false)'
-test_expect_success 'req_Root (everything together)' \
- 'cat request-base | git-cvsserver --export-all --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 &&
- sed -ne \$p log | grep "^I LOVE YOU\$"'
+test_expect_success 'req_Root (everything together)' '
+ git-cvsserver --export-all --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" <request-base >log 2>&1 &&
+ sed -ne \$p log | grep "^I LOVE YOU\$"
+'
GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true || exit 1
@@ -247,45 +257,49 @@ test_expect_success 'gitcvs.enabled = false' \
test ! -d cvswork2'
rm -fr cvswork2
-test_expect_success 'gitcvs.ext.enabled = true' \
- 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
- GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
- GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
- test_cmp cvswork cvswork2'
+test_expect_success 'gitcvs.ext.enabled = true' '
+ GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
+ GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
+ GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
+ test_cmp cvswork cvswork2
+'
rm -fr cvswork2
-test_expect_success 'gitcvs.ext.enabled = false' \
- 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled false &&
- GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
- if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1
- then
- echo unexpected cvs success
- false
- else
- true
- fi &&
- grep "GITCVS emulation disabled" cvs.log &&
- test ! -d cvswork2'
+test_expect_success 'gitcvs.ext.enabled = false' '
+ GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled false &&
+ GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
+ if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1
+ then
+ echo unexpected cvs success
+ false
+ else
+ true
+ fi &&
+ grep "GITCVS emulation disabled" cvs.log &&
+ test ! -d cvswork2
+'
rm -fr cvswork2
-test_expect_success 'gitcvs.dbname' \
- 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
- GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite &&
- GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
- test_cmp cvswork cvswork2 &&
- test -f "$SERVERDIR/gitcvs.ext.main.sqlite" &&
- cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs.ext.main.sqlite"'
+test_expect_success 'gitcvs.dbname' '
+ GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
+ GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite &&
+ GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
+ test_cmp cvswork cvswork2 &&
+ test -f "$SERVERDIR/gitcvs.ext.main.sqlite" &&
+ cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs.ext.main.sqlite"
+'
rm -fr cvswork2
-test_expect_success 'gitcvs.ext.dbname' \
- 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
- GIT_DIR="$SERVERDIR" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
- GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
- GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
- test_cmp cvswork cvswork2 &&
- test -f "$SERVERDIR/gitcvs1.ext.main.sqlite" &&
- test ! -f "$SERVERDIR/gitcvs2.ext.main.sqlite" &&
- cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs1.ext.main.sqlite"'
+test_expect_success 'gitcvs.ext.dbname' '
+ GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
+ GIT_DIR="$SERVERDIR" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
+ GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
+ GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
+ test_cmp cvswork cvswork2 &&
+ test -f "$SERVERDIR/gitcvs1.ext.main.sqlite" &&
+ test ! -f "$SERVERDIR/gitcvs2.ext.main.sqlite" &&
+ cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs1.ext.main.sqlite"
+'
#------------
@@ -299,109 +313,115 @@ GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log" ||
exit 1
-test_expect_success 'cvs update (create new file)' \
- 'echo testfile1 >testfile1 &&
- git add testfile1 &&
- git commit -q -m "Add testfile1" &&
- git push gitcvs.git >/dev/null &&
- cd cvswork &&
- GIT_CONFIG="$git_config" cvs -Q update &&
- test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.1/" &&
- test_cmp testfile1 ../testfile1'
+test_expect_success 'cvs update (create new file)' '
+ echo testfile1 >testfile1 &&
+ git add testfile1 &&
+ git commit -q -m "Add testfile1" &&
+ git push gitcvs.git >/dev/null &&
+ cd cvswork &&
+ GIT_CONFIG="$git_config" cvs -Q update &&
+ test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.1/" &&
+ test_cmp testfile1 ../testfile1
+'
cd "$WORKDIR"
-test_expect_success 'cvs update (update existing file)' \
- 'echo line 2 >>testfile1 &&
- git add testfile1 &&
- git commit -q -m "Append to testfile1" &&
- git push gitcvs.git >/dev/null &&
- cd cvswork &&
- GIT_CONFIG="$git_config" cvs -Q update &&
- test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.2/" &&
- test_cmp testfile1 ../testfile1'
+test_expect_success 'cvs update (update existing file)' '
+ echo line 2 >>testfile1 &&
+ git add testfile1 &&
+ git commit -q -m "Append to testfile1" &&
+ git push gitcvs.git >/dev/null &&
+ cd cvswork &&
+ GIT_CONFIG="$git_config" cvs -Q update &&
+ test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.2/" &&
+ test_cmp testfile1 ../testfile1
+'
cd "$WORKDIR"
#TODO: cvsserver doesn't support update w/o -d
test_expect_failure "cvs update w/o -d doesn't create subdir (TODO)" '
- mkdir test &&
- echo >test/empty &&
- git add test &&
- git commit -q -m "Single Subdirectory" &&
- git push gitcvs.git >/dev/null &&
- cd cvswork &&
- GIT_CONFIG="$git_config" cvs -Q update &&
- test ! -d test
+ mkdir test &&
+ echo >test/empty &&
+ git add test &&
+ git commit -q -m "Single Subdirectory" &&
+ git push gitcvs.git >/dev/null &&
+ cd cvswork &&
+ GIT_CONFIG="$git_config" cvs -Q update &&
+ test ! -d test
'
cd "$WORKDIR"
-test_expect_success 'cvs update (subdirectories)' \
- '(for dir in A A/B A/B/C A/D E; do
- mkdir $dir &&
- echo "test file in $dir" >"$dir/file_in_$(echo $dir|sed -e "s#/# #g")" &&
- git add $dir || exit 1
- done) &&
- git commit -q -m "deep sub directory structure" &&
- git push gitcvs.git >/dev/null &&
- cd cvswork &&
- GIT_CONFIG="$git_config" cvs -Q update -d &&
- (for dir in A A/B A/B/C A/D E; do
- filename="file_in_$(echo $dir|sed -e "s#/# #g")" &&
- if test "$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))" = "$filename/1.1/" &&
- test_cmp "$dir/$filename" "../$dir/$filename"; then
- :
- else
- exit 1
- fi
- done)'
+test_expect_success 'cvs update (subdirectories)' '
+ (for dir in A A/B A/B/C A/D E; do
+ mkdir $dir &&
+ echo "test file in $dir" >"$dir/file_in_$(echo $dir|sed -e "s#/# #g")" &&
+ git add $dir || exit 1
+ done) &&
+ git commit -q -m "deep sub directory structure" &&
+ git push gitcvs.git >/dev/null &&
+ cd cvswork &&
+ GIT_CONFIG="$git_config" cvs -Q update -d &&
+ (for dir in A A/B A/B/C A/D E; do
+ filename="file_in_$(echo $dir|sed -e "s#/# #g")" &&
+ if test "$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))" = "$filename/1.1/" &&
+ test_cmp "$dir/$filename" "../$dir/$filename"; then
+ :
+ else
+ exit 1
+ fi
+ done)
+'
cd "$WORKDIR"
-test_expect_success 'cvs update (delete file)' \
- 'git rm testfile1 &&
- git commit -q -m "Remove testfile1" &&
- git push gitcvs.git >/dev/null &&
- cd cvswork &&
- GIT_CONFIG="$git_config" cvs -Q update &&
- test -z "$(grep testfile1 CVS/Entries)" &&
- test ! -f testfile1'
+test_expect_success 'cvs update (delete file)' '
+ git rm testfile1 &&
+ git commit -q -m "Remove testfile1" &&
+ git push gitcvs.git >/dev/null &&
+ cd cvswork &&
+ GIT_CONFIG="$git_config" cvs -Q update &&
+ test -z "$(grep testfile1 CVS/Entries)" &&
+ test ! -f testfile1
+'
cd "$WORKDIR"
-test_expect_success 'cvs update (re-add deleted file)' \
- 'echo readded testfile >testfile1 &&
- git add testfile1 &&
- git commit -q -m "Re-Add testfile1" &&
- git push gitcvs.git >/dev/null &&
- cd cvswork &&
- GIT_CONFIG="$git_config" cvs -Q update &&
- test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" &&
- test_cmp testfile1 ../testfile1'
+test_expect_success 'cvs update (re-add deleted file)' '
+ echo readded testfile >testfile1 &&
+ git add testfile1 &&
+ git commit -q -m "Re-Add testfile1" &&
+ git push gitcvs.git >/dev/null &&
+ cd cvswork &&
+ GIT_CONFIG="$git_config" cvs -Q update &&
+ test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" &&
+ test_cmp testfile1 ../testfile1
+'
cd "$WORKDIR"
-test_expect_success 'cvs update (merge)' \
- 'echo Line 0 >expected &&
- for i in 1 2 3 4 5 6 7
- do
- echo Line $i >>merge &&
- echo Line $i >>expected || return 1
- done &&
- echo Line 8 >>expected &&
- git add merge &&
- git commit -q -m "Merge test (pre-merge)" &&
- git push gitcvs.git >/dev/null &&
- cd cvswork &&
- GIT_CONFIG="$git_config" cvs -Q update &&
- test "$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))" = "merge/1.1/" &&
- test_cmp merge ../merge &&
- ( echo Line 0 && cat merge ) >merge.tmp &&
- mv merge.tmp merge &&
- cd "$WORKDIR" &&
- echo Line 8 >>merge &&
- git add merge &&
- git commit -q -m "Merge test (merge)" &&
- git push gitcvs.git >/dev/null &&
- cd cvswork &&
- sleep 1 && touch merge &&
- GIT_CONFIG="$git_config" cvs -Q update &&
- test_cmp merge ../expected'
+test_expect_success 'cvs update (merge)' '
+ echo Line 0 >expected &&
+ for i in 1 2 3 4 5 6 7
+ do
+ echo Line $i >>merge &&
+ echo Line $i >>expected || return 1
+ done &&
+ echo Line 8 >>expected &&
+ git add merge &&
+ git commit -q -m "Merge test (pre-merge)" &&
+ git push gitcvs.git >/dev/null &&
+ cd cvswork &&
+ GIT_CONFIG="$git_config" cvs -Q update &&
+ test "$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))" = "merge/1.1/" &&
+ test_cmp merge ../merge &&
+ ( echo Line 0 && cat merge ) >merge.tmp &&
+ mv merge.tmp merge &&
+ cd "$WORKDIR" &&
+ echo Line 8 >>merge &&
+ git add merge &&
+ git commit -q -m "Merge test (merge)" &&
+ git push gitcvs.git >/dev/null &&
+ cd cvswork &&
+ sleep 1 && touch merge &&
+ GIT_CONFIG="$git_config" cvs -Q update &&
+ test_cmp merge ../expected
+'
cd "$WORKDIR"
@@ -418,55 +438,58 @@ do
echo Line $i >>expected.C
done
-test_expect_success 'cvs update (conflict merge)' \
- '( echo LINE 0 && cat merge ) >merge.tmp &&
- mv merge.tmp merge &&
- git add merge &&
- git commit -q -m "Merge test (conflict)" &&
- git push gitcvs.git >/dev/null &&
- cd cvswork &&
- GIT_CONFIG="$git_config" cvs -Q update &&
- test_cmp merge ../expected.C'
+test_expect_success 'cvs update (conflict merge)' '
+ ( echo LINE 0 && cat merge ) >merge.tmp &&
+ mv merge.tmp merge &&
+ git add merge &&
+ git commit -q -m "Merge test (conflict)" &&
+ git push gitcvs.git >/dev/null &&
+ cd cvswork &&
+ GIT_CONFIG="$git_config" cvs -Q update &&
+ test_cmp merge ../expected.C
+'
cd "$WORKDIR"
-test_expect_success 'cvs update (-C)' \
- 'cd cvswork &&
- GIT_CONFIG="$git_config" cvs -Q update -C &&
- test_cmp merge ../merge'
+test_expect_success 'cvs update (-C)' '
+ cd cvswork &&
+ GIT_CONFIG="$git_config" cvs -Q update -C &&
+ test_cmp merge ../merge
+'
cd "$WORKDIR"
-test_expect_success 'cvs update (merge no-op)' \
- 'echo Line 9 >>merge &&
- cp merge cvswork/merge &&
- git add merge &&
- git commit -q -m "Merge test (no-op)" &&
- git push gitcvs.git >/dev/null &&
- cd cvswork &&
- sleep 1 && touch merge &&
- GIT_CONFIG="$git_config" cvs -Q update &&
- test_cmp merge ../merge'
+test_expect_success 'cvs update (merge no-op)' '
+ echo Line 9 >>merge &&
+ cp merge cvswork/merge &&
+ git add merge &&
+ git commit -q -m "Merge test (no-op)" &&
+ git push gitcvs.git >/dev/null &&
+ cd cvswork &&
+ sleep 1 && touch merge &&
+ GIT_CONFIG="$git_config" cvs -Q update &&
+ test_cmp merge ../merge
+'
cd "$WORKDIR"
test_expect_success 'cvs update (-p)' '
- touch really-empty &&
- echo Line 1 > no-lf &&
- printf "Line 2" >> no-lf &&
- git add really-empty no-lf &&
- git commit -q -m "Update -p test" &&
- git push gitcvs.git >/dev/null &&
- cd cvswork &&
- GIT_CONFIG="$git_config" cvs update &&
- for i in merge no-lf empty really-empty; do
- GIT_CONFIG="$git_config" cvs update -p "$i" >$i.out &&
- test_cmp $i.out ../$i || return 1
- done
+ touch really-empty &&
+ echo Line 1 > no-lf &&
+ printf "Line 2" >> no-lf &&
+ git add really-empty no-lf &&
+ git commit -q -m "Update -p test" &&
+ git push gitcvs.git >/dev/null &&
+ cd cvswork &&
+ GIT_CONFIG="$git_config" cvs update &&
+ for i in merge no-lf empty really-empty; do
+ GIT_CONFIG="$git_config" cvs update -p "$i" >$i.out &&
+ test_cmp $i.out ../$i || return 1
+ done
'
cd "$WORKDIR"
test_expect_success 'cvs update (module list supports packed refs)' '
- GIT_DIR="$SERVERDIR" git pack-refs --all &&
- GIT_CONFIG="$git_config" cvs -n up -d 2> out &&
- grep "cvs update: New directory \`main'\''" < out
+ GIT_DIR="$SERVERDIR" git pack-refs --all &&
+ GIT_CONFIG="$git_config" cvs -n up -d 2> out &&
+ grep "cvs update: New directory \`main'\''" < out
'
#------------
@@ -475,30 +498,30 @@ test_expect_success 'cvs update (module list supports packed refs)' '
cd "$WORKDIR"
test_expect_success 'cvs status' '
- mkdir status.dir &&
- echo Line > status.dir/status.file &&
- echo Line > status.file &&
- git add status.dir status.file &&
- git commit -q -m "Status test" &&
- git push gitcvs.git >/dev/null &&
- cd cvswork &&
- GIT_CONFIG="$git_config" cvs update &&
- GIT_CONFIG="$git_config" cvs status | grep "^File: status.file" >../out &&
- test_line_count = 2 ../out
+ mkdir status.dir &&
+ echo Line > status.dir/status.file &&
+ echo Line > status.file &&
+ git add status.dir status.file &&
+ git commit -q -m "Status test" &&
+ git push gitcvs.git >/dev/null &&
+ cd cvswork &&
+ GIT_CONFIG="$git_config" cvs update &&
+ GIT_CONFIG="$git_config" cvs status | grep "^File: status.file" >../out &&
+ test_line_count = 2 ../out
'
cd "$WORKDIR"
test_expect_success 'cvs status (nonrecursive)' '
- cd cvswork &&
- GIT_CONFIG="$git_config" cvs status -l | grep "^File: status.file" >../out &&
- test_line_count = 1 ../out
+ cd cvswork &&
+ GIT_CONFIG="$git_config" cvs status -l | grep "^File: status.file" >../out &&
+ test_line_count = 1 ../out
'
cd "$WORKDIR"
test_expect_success 'cvs status (no subdirs in header)' '
- cd cvswork &&
- GIT_CONFIG="$git_config" cvs status | grep ^File: >../out &&
- ! grep / <../out
+ cd cvswork &&
+ GIT_CONFIG="$git_config" cvs status | grep ^File: >../out &&
+ ! grep / <../out
'
#------------
@@ -507,9 +530,9 @@ test_expect_success 'cvs status (no subdirs in header)' '
cd "$WORKDIR"
test_expect_success 'cvs co -c (shows module database)' '
- GIT_CONFIG="$git_config" cvs co -c > out &&
- grep "^main[ ][ ]*main$" <out &&
- ! grep -v "^main[ ][ ]*main$" <out
+ GIT_CONFIG="$git_config" cvs co -c > out &&
+ grep "^main[ ][ ]*main$" <out &&
+ ! grep -v "^main[ ][ ]*main$" <out
'
#------------
@@ -575,11 +598,11 @@ expectStat="$?"
cd "$WORKDIR"
test_expect_success 'cvs log' '
- cd cvswork &&
- test x"$expectStat" = x"0" &&
- GIT_CONFIG="$git_config" cvs log merge >../out &&
- sed -e "s%2[0-9][0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]%__DATE__%" ../out > ../actual &&
- test_cmp ../expect ../actual
+ cd cvswork &&
+ test x"$expectStat" = x"0" &&
+ GIT_CONFIG="$git_config" cvs log merge >../out &&
+sed -e "s%2[0-9][0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]%__DATE__%" ../out > ../actual &&
+ test_cmp ../expect ../actual
'
#------------
@@ -588,11 +611,11 @@ test_expect_success 'cvs log' '
cd "$WORKDIR"
test_expect_success 'cvs annotate' '
- cd cvswork &&
- GIT_CONFIG="$git_config" cvs annotate merge >../out &&
- sed -e "s/ .*//" ../out >../actual &&
- printf "1.%d\n" 3 1 1 1 1 1 1 1 2 4 >../expect &&
- test_cmp ../expect ../actual
+ cd cvswork &&
+ GIT_CONFIG="$git_config" cvs annotate merge >../out &&
+ sed -e "s/ .*//" ../out >../actual &&
+ printf "1.%d\n" 3 1 1 1 1 1 1 1 2 4 >../expect &&
+ test_cmp ../expect ../actual
'
#------------
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index 0333065..7679780 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -627,6 +627,7 @@ test_expect_success \
test_expect_success 'setup' '
version=$(git config core.repositoryformatversion) &&
algo=$(test_might_fail git config extensions.objectformat) &&
+ refstorage=$(test_might_fail git config extensions.refstorage) &&
cat >.git/config <<-\EOF &&
# testing noval and alternate separator
[gitweb]
@@ -637,6 +638,10 @@ test_expect_success 'setup' '
if test -n "$algo"
then
git config extensions.objectformat "$algo"
+ fi &&
+ if test -n "$refstorage"
+ then
+ git config extensions.refstorage "$refstorage"
fi
'
diff --git a/t/t9700-perl-git.sh b/t/t9700-perl-git.sh
index 102c133..ccc8212 100755
--- a/t/t9700-perl-git.sh
+++ b/t/t9700-perl-git.sh
@@ -4,57 +4,53 @@
#
test_description='perl interface (Git.pm)'
-. ./test-lib.sh
-if ! test_have_prereq PERL; then
- skip_all='skipping perl interface tests, perl not available'
- test_done
-fi
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-perl.sh
-perl -MTest::More -e 0 2>/dev/null || {
- skip_all="Perl Test::More unavailable, skipping test"
- test_done
-}
+skip_all_if_no_Test_More
# set up test repository
-test_expect_success \
- 'set up test repository' \
- 'echo "test file 1" > file1 &&
- echo "test file 2" > file2 &&
- mkdir directory1 &&
- echo "in directory1" >> directory1/file &&
- mkdir directory2 &&
- echo "in directory2" >> directory2/file &&
- git add . &&
- git commit -m "first commit" &&
-
- echo "new file in subdir 2" > directory2/file2 &&
- git add . &&
- git commit -m "commit in directory2" &&
-
- echo "changed file 1" > file1 &&
- git commit -a -m "second commit" &&
-
- git config --add color.test.slot1 green &&
- git config --add test.string value &&
- git config --add test.dupstring value1 &&
- git config --add test.dupstring value2 &&
- git config --add test.booltrue true &&
- git config --add test.boolfalse no &&
- git config --add test.boolother other &&
- git config --add test.int 2k &&
- git config --add test.path "~/foo" &&
- git config --add test.pathexpanded "$HOME/foo" &&
- git config --add test.pathmulti foo &&
- git config --add test.pathmulti bar
- '
-
-# The external test will outputs its own plan
-test_external_has_tap=1
-
-test_external_without_stderr \
- 'Perl API' \
- perl "$TEST_DIRECTORY"/t9700/test.pl
+test_expect_success 'set up test repository' '
+ echo "test file 1" >file1 &&
+ echo "test file 2" >file2 &&
+ mkdir directory1 &&
+ echo "in directory1" >>directory1/file &&
+ mkdir directory2 &&
+ echo "in directory2" >>directory2/file &&
+ git add . &&
+ git commit -m "first commit" &&
+
+ echo "new file in subdir 2" >directory2/file2 &&
+ git add . &&
+ git commit -m "commit in directory2" &&
+
+ echo "changed file 1" >file1 &&
+ git commit -a -m "second commit" &&
+
+ git config --add color.test.slot1 green &&
+ git config --add test.string value &&
+ git config --add test.dupstring value1 &&
+ git config --add test.dupstring value2 &&
+ git config --add test.booltrue true &&
+ git config --add test.boolfalse no &&
+ git config --add test.boolother other &&
+ git config --add test.int 2k &&
+ git config --add test.path "~/foo" &&
+ git config --add test.pathexpanded "$HOME/foo" &&
+ git config --add test.pathmulti foo &&
+ git config --add test.pathmulti bar
+'
+
+test_expect_success 'set up bare repository' '
+ git init --bare bare.git
+'
+
+test_expect_success 'use t9700/test.pl to test Git.pm' '
+ "$PERL_PATH" "$TEST_DIRECTORY"/t9700/test.pl 2>stderr &&
+ test_must_be_empty stderr
+'
test_done
diff --git a/t/t9700/test.pl b/t/t9700/test.pl
index e046f7d..d8e8548 100755
--- a/t/t9700/test.pl
+++ b/t/t9700/test.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use lib (split(/:/, $ENV{GITPERLLIB}));
-use 5.008;
+use 5.008001;
use warnings;
use strict;
@@ -30,6 +30,18 @@ BEGIN { use_ok('Git') }
# set up
our $abs_repo_dir = cwd();
ok(our $r = Git->repository(Directory => "."), "open repository");
+{
+ local $ENV{GIT_TEST_ASSUME_DIFFERENT_OWNER} = 1;
+ my $failed;
+
+ $failed = eval { Git->repository(Directory => $abs_repo_dir) };
+ ok(!$failed, "reject unsafe non-bare repository");
+ like($@, qr/not a git repository/i, "unsafe error message");
+
+ $failed = eval { Git->repository(Directory => "$abs_repo_dir/bare.git") };
+ ok(!$failed, "reject unsafe bare repository");
+ like($@, qr/not a git repository/i, "unsafe error message");
+}
# config
is($r->config("test.string"), "value", "config scalar: string");
diff --git a/t/t9800-git-p4-basic.sh b/t/t9800-git-p4-basic.sh
index dc88d0e..53af8e3 100755
--- a/t/t9800-git-p4-basic.sh
+++ b/t/t9800-git-p4-basic.sh
@@ -54,7 +54,7 @@ test_expect_success 'git p4 sync uninitialized repo' '
(
cd "$git" &&
test_must_fail git p4 sync 2>errs &&
- test_i18ngrep "Perhaps you never did" errs
+ test_grep "Perhaps you never did" errs
)
'
@@ -86,7 +86,7 @@ test_expect_success 'git p4 sync existing branch without changes' '
test_commit head &&
git p4 sync --branch=depot //depot@all &&
git p4 sync --branch=refs/remotes/p4/depot >out &&
- test_i18ngrep "No changes to import!" out
+ test_grep "No changes to import!" out
)
'
@@ -101,7 +101,7 @@ test_expect_success 'git p4 sync existing branch with relative name' '
test_commit head &&
git p4 sync --branch=branch1 //depot@all &&
git p4 sync --branch=p4/branch1 >out &&
- test_i18ngrep "No changes to import!" out
+ test_grep "No changes to import!" out
)
'
@@ -116,7 +116,7 @@ test_expect_success 'git p4 sync existing branch with nested path' '
test_commit head &&
git p4 sync --branch=p4/some/path //depot@all &&
git p4 sync --branch=some/path >out &&
- test_i18ngrep "No changes to import!" out
+ test_grep "No changes to import!" out
)
'
@@ -131,7 +131,7 @@ test_expect_success 'git p4 sync branch explicit ref without p4 in path' '
test_commit head &&
git p4 sync --branch=refs/remotes/someremote/depot //depot@all &&
git p4 sync --branch=refs/remotes/someremote/depot >out &&
- test_i18ngrep "No changes to import!" out
+ test_grep "No changes to import!" out
)
'
@@ -143,7 +143,7 @@ test_expect_success 'git p4 sync nonexistent ref' '
test_commit head &&
git p4 sync --branch=depot //depot@all &&
test_must_fail git p4 sync --branch=depot2 2>errs &&
- test_i18ngrep "Perhaps you never did" errs
+ test_grep "Perhaps you never did" errs
)
'
@@ -155,7 +155,7 @@ test_expect_success 'git p4 sync existing non-p4-imported ref' '
test_commit head &&
git p4 sync --branch=depot //depot@all &&
test_must_fail git p4 sync --branch=refs/heads/master 2>errs &&
- test_i18ngrep "Perhaps you never did" errs
+ test_grep "Perhaps you never did" errs
)
'
@@ -290,7 +290,7 @@ test_expect_success 'exit when p4 fails to produce marshaled output' '
export PATH &&
test_expect_code 1 git p4 clone --dest="$git" //depot >errs 2>&1
) &&
- test_i18ngrep ! Traceback errs
+ test_grep ! Traceback errs
'
# Hide a file from p4d, make sure we catch its complaint. This won't fail in
@@ -301,7 +301,7 @@ test_expect_success 'exit gracefully for p4 server errors' '
mv "$db"/depot/file1,v "$db"/depot/file1,v,hidden &&
test_when_finished cleanup_git &&
test_expect_code 1 git p4 clone --dest="$git" //depot@1 >out 2>err &&
- test_i18ngrep "Error from p4 print" err
+ test_grep "Error from p4 print" err
'
test_expect_success 'clone --bare should make a bare repository' '
@@ -330,7 +330,7 @@ test_expect_success 'initial import time from top change time' '
test_when_finished cleanup_git &&
(
cd "$git" &&
- gittime=$(git show -s --raw --pretty=format:%at HEAD) &&
+ gittime=$(git show -s --pretty=format:%at HEAD) &&
echo $p4time $gittime &&
test $p4time = $gittime
)
diff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh
index 759a14f..c598011 100755
--- a/t/t9801-git-p4-branch.sh
+++ b/t/t9801-git-p4-branch.sh
@@ -135,7 +135,7 @@ test_expect_success 'sync specific detected branch' '
(
cd "$git" &&
git p4 sync --branch=depot/branch2 >out &&
- test_i18ngrep "No changes to import!" out
+ test_grep "No changes to import!" out
)
'
@@ -466,7 +466,7 @@ test_expect_success 'git p4 clone complex branches with excluded files' '
)
'
-# From a report in http://stackoverflow.com/questions/11893688
+# From a report in https://stackoverflow.com/questions/11893688
# where --use-client-spec caused branch prefixes not to be removed;
# every file in git appeared into a subdirectory of the branch name.
test_expect_success 'use-client-spec detect-branches setup' '
diff --git a/t/t9802-git-p4-filetype.sh b/t/t9802-git-p4-filetype.sh
index 2a6ee2a..bb236cd 100755
--- a/t/t9802-git-p4-filetype.sh
+++ b/t/t9802-git-p4-filetype.sh
@@ -175,7 +175,7 @@ test_expect_success 'keyword file create' '
cp k-text-k k-text-ko &&
p4 add -t text+ko k-text-ko &&
- cat k-text-k | iconv -f ascii -t utf-16 >k-utf16-k &&
+ iconv -f ascii -t utf-16 <k-text-k >k-utf16-k &&
p4 add -t utf16+k k-utf16-k &&
cp k-utf16-k k-utf16-ko &&
diff --git a/t/t9807-git-p4-submit.sh b/t/t9807-git-p4-submit.sh
index 7d4109f..6ae7ced 100755
--- a/t/t9807-git-p4-submit.sh
+++ b/t/t9807-git-p4-submit.sh
@@ -75,7 +75,7 @@ test_expect_success 'submit --dry-run' '
test_commit "dry-run1" &&
test_commit "dry-run2" &&
git p4 submit --dry-run >out &&
- test_i18ngrep "Would apply" out
+ test_grep "Would apply" out
) &&
(
cd "$cli" &&
@@ -99,7 +99,7 @@ test_expect_success 'submit --dry-run --export-labels' '
git commit -m "dry-run2" dry-run2 &&
git tag -m "dry-run-tag1" dry-run-tag1 HEAD^ &&
git p4 submit --dry-run --export-labels >out &&
- test_i18ngrep "Would create p4 label" out
+ test_grep "Would create p4 label" out
) &&
(
cd "$cli" &&
@@ -418,7 +418,7 @@ test_expect_success 'description with Jobs and values on separate lines' '
marshal_dump job0 <change &&
marshal_dump job1 <change
) | sort >jobs &&
- cat jobname1 jobname2 | sort >expected &&
+ sort jobname1 jobname2 >expected &&
test_cmp expected jobs
)
'
@@ -443,7 +443,7 @@ test_expect_success 'description with Jobs section and bogus following text' '
# build a job
make_job $(cat jobname) &&
test_must_fail git p4 submit 2>err &&
- test_i18ngrep "Unknown field name" err
+ test_grep "Unknown field name" err
) &&
(
cd "$cli" &&
@@ -461,9 +461,9 @@ test_expect_success 'submit --prepare-p4-only' '
git add prep-only-add &&
git commit -m "prep only add" &&
git p4 submit --prepare-p4-only >out &&
- test_i18ngrep "prepared for submission" out &&
- test_i18ngrep "must be deleted" out &&
- test_i18ngrep ! "everything below this line is just the diff" out
+ test_grep "prepared for submission" out &&
+ test_grep "must be deleted" out &&
+ test_grep ! "everything below this line is just the diff" out
) &&
(
cd "$cli" &&
diff --git a/t/t9814-git-p4-rename.sh b/t/t9814-git-p4-rename.sh
index 468767c..2a9838f 100755
--- a/t/t9814-git-p4-rename.sh
+++ b/t/t9814-git-p4-rename.sh
@@ -216,7 +216,7 @@ test_expect_success 'detect copies' '
# variable exists, which allows admins to disable the "p4 move" command.
test_lazy_prereq P4D_HAVE_CONFIGURABLE_RUN_MOVE_ALLOW '
p4 configure show run.move.allow >out &&
- egrep ^run.move.allow: out
+ grep -E ^run.move.allow: out
'
# If move can be disabled, turn it off and test p4 move handling
diff --git a/t/t9815-git-p4-submit-fail.sh b/t/t9815-git-p4-submit-fail.sh
index 9779dc0..c766fd1 100755
--- a/t/t9815-git-p4-submit-fail.sh
+++ b/t/t9815-git-p4-submit-fail.sh
@@ -35,7 +35,7 @@ test_expect_success 'conflict on one commit' '
git add file1 &&
git commit -m "line3 in file1 will conflict" &&
test_expect_code 1 git p4 submit >out &&
- test_i18ngrep "No commits applied" out
+ test_grep "No commits applied" out
)
'
@@ -58,7 +58,7 @@ test_expect_success 'conflict on second of two commits' '
git add file1 &&
git commit -m "line4 in file1 will conflict" &&
test_expect_code 1 git p4 submit >out &&
- test_i18ngrep "Applied only the commits" out
+ test_grep "Applied only the commits" out
)
'
@@ -81,7 +81,7 @@ test_expect_success 'conflict on first of two commits, skip' '
# but this commit is okay
test_commit "okay_commit_after_skip" &&
echo s | test_expect_code 1 git p4 submit >out &&
- test_i18ngrep "Applied only the commits" out
+ test_grep "Applied only the commits" out
)
'
@@ -104,7 +104,7 @@ test_expect_success 'conflict on first of two commits, quit' '
# but this commit is okay
test_commit "okay_commit_after_quit" &&
echo q | test_expect_code 1 git p4 submit >out &&
- test_i18ngrep "No commits applied" out
+ test_grep "No commits applied" out
)
'
@@ -144,7 +144,7 @@ test_expect_success 'conflict on first of two commits, --conflict=skip' '
# but this commit is okay
test_commit "okay_commit_after_auto_skip" &&
test_expect_code 1 git p4 submit --conflict=skip >out &&
- test_i18ngrep "Applied only the commits" out
+ test_grep "Applied only the commits" out
)
'
@@ -167,7 +167,7 @@ test_expect_success 'conflict on first of two commits, --conflict=quit' '
# but this commit is okay
test_commit "okay_commit_after_auto_quit" &&
test_expect_code 1 git p4 submit --conflict=quit >out &&
- test_i18ngrep "No commits applied" out
+ test_grep "No commits applied" out
)
'
@@ -417,8 +417,8 @@ test_expect_success 'cleanup chmod after submit cancel' '
! p4 fstat -T action text &&
test_path_is_file text+x &&
! p4 fstat -T action text+x &&
- ls -l text | egrep ^-r-- &&
- ls -l text+x | egrep ^-r-x
+ ls -l text | grep -E ^-r-- &&
+ ls -l text+x | grep -E ^-r-x
)
'
diff --git a/t/t9816-git-p4-locked.sh b/t/t9816-git-p4-locked.sh
index 9328410..5e904ac 100755
--- a/t/t9816-git-p4-locked.sh
+++ b/t/t9816-git-p4-locked.sh
@@ -9,7 +9,7 @@ test_expect_success 'start p4d' '
'
# See
-# http://www.perforce.com/perforce/doc.current/manuals/p4sag/03_superuser.html#1088563
+# https://web.archive.org/web/20150602090517/http://www.perforce.com/perforce/doc.current/manuals/p4sag/chapter.superuser.html#superuser.basic.typemap_locking
# for suggestions on how to configure "sitewide pessimistic locking"
# where only one person can have a file open for edit at a time.
test_expect_success 'init depot' '
diff --git a/t/t9824-git-p4-git-lfs.sh b/t/t9824-git-p4-git-lfs.sh
index a28dbbd..80c8c31 100755
--- a/t/t9824-git-p4-git-lfs.sh
+++ b/t/t9824-git-p4-git-lfs.sh
@@ -17,8 +17,8 @@ test_file_in_lfs () {
sed -n '2,2 p' "$FILE" | grep "^oid " &&
sed -n '3,3 p' "$FILE" | grep "^size " &&
test_line_count = 3 "$FILE" &&
- cat "$FILE" | grep "size $SIZE" &&
- HASH=$(cat "$FILE" | grep "oid sha256:" | sed -e "s/oid sha256://g") &&
+ grep "size $SIZE" "$FILE" &&
+ HASH=$(sed -ne "/oid sha256:/s/oid sha256://gp" "$FILE") &&
LFS_FILE=".git/lfs/objects/$(echo "$HASH" | cut -c1-2)/$(echo "$HASH" | cut -c3-4)/$HASH" &&
echo $EXPECTED_CONTENT >expect &&
test_path_is_file "$FILE" &&
diff --git a/t/t9850-shell.sh b/t/t9850-shell.sh
new file mode 100755
index 0000000..cfc71c3
--- /dev/null
+++ b/t/t9850-shell.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+test_description='git shell tests'
+. ./test-lib.sh
+
+test_expect_success 'shell allows upload-pack' '
+ printf 0000 >input &&
+ git upload-pack . <input >expect &&
+ git shell -c "git-upload-pack $SQ.$SQ" <input >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'shell forbids other commands' '
+ test_must_fail git shell -c "git config foo.bar baz"
+'
+
+test_expect_success 'shell forbids interactive use by default' '
+ test_must_fail git shell
+'
+
+test_expect_success 'shell allows interactive command' '
+ mkdir git-shell-commands &&
+ write_script git-shell-commands/ping <<-\EOF &&
+ echo pong
+ EOF
+ echo pong >expect &&
+ echo ping | git shell >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'shell complains of overlong commands' '
+ perl -e "print \"a\" x 2**12 for (0..2**19)" |
+ test_must_fail git shell 2>err &&
+ grep "too long" err
+'
+
+test_done
diff --git a/t/t9901-git-web--browse.sh b/t/t9901-git-web--browse.sh
index de7152f..19f56e5 100755
--- a/t/t9901-git-web--browse.sh
+++ b/t/t9901-git-web--browse.sh
@@ -5,6 +5,7 @@ test_description='git web--browse basic tests
This test checks that git web--browse can handle various valid URLs.'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_web_browse () {
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 43de868..569cf23 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -5,6 +5,17 @@
test_description='test bash completion'
+# The Bash completion scripts must not print anything to either stdout or
+# stderr, which we try to verify. When tracing is enabled without support for
+# BASH_XTRACEFD this assertion will fail, so we have to mark the test as
+# untraceable with such ancient Bash versions.
+test_untraceable=UnfortunatelyYes
+
+# Override environment and always use master for the default initial branch
+# name for these tests, so that rev completion candidates are as expected.
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./lib-bash.sh
complete ()
@@ -87,9 +98,11 @@ test_completion ()
else
sed -e 's/Z$//' |sort >expected
fi &&
- run_completion "$1" &&
+ run_completion "$1" >"$TRASH_DIRECTORY"/bash-completion-output 2>&1 &&
sort out >out_sorted &&
- test_cmp expected out_sorted
+ test_cmp expected out_sorted &&
+ test_must_be_empty "$TRASH_DIRECTORY"/bash-completion-output &&
+ rm "$TRASH_DIRECTORY"/bash-completion-output
}
# Test __gitcomp.
@@ -405,40 +418,40 @@ test_expect_success '__gitdir - remote as argument' '
test_expect_success '__git_dequote - plain unquoted word' '
__git_dequote unquoted-word &&
- verbose test unquoted-word = "$dequoted_word"
+ test unquoted-word = "$dequoted_word"
'
# input: b\a\c\k\'\\\"s\l\a\s\h\es
# expected: back'\"slashes
test_expect_success '__git_dequote - backslash escaped' '
__git_dequote "b\a\c\k\\'\''\\\\\\\"s\l\a\s\h\es" &&
- verbose test "back'\''\\\"slashes" = "$dequoted_word"
+ test "back'\''\\\"slashes" = "$dequoted_word"
'
# input: sin'gle\' '"quo'ted
# expected: single\ "quoted
test_expect_success '__git_dequote - single quoted' '
__git_dequote "'"sin'gle\\\\' '\\\"quo'ted"'" &&
- verbose test '\''single\ "quoted'\'' = "$dequoted_word"
+ test '\''single\ "quoted'\'' = "$dequoted_word"
'
# input: dou"ble\\" "\"\quot"ed
# expected: double\ "\quoted
test_expect_success '__git_dequote - double quoted' '
__git_dequote '\''dou"ble\\" "\"\quot"ed'\'' &&
- verbose test '\''double\ "\quoted'\'' = "$dequoted_word"
+ test '\''double\ "\quoted'\'' = "$dequoted_word"
'
# input: 'open single quote
test_expect_success '__git_dequote - open single quote' '
__git_dequote "'\''open single quote" &&
- verbose test "open single quote" = "$dequoted_word"
+ test "open single quote" = "$dequoted_word"
'
# input: "open double quote
test_expect_success '__git_dequote - open double quote' '
__git_dequote "\"open double quote" &&
- verbose test "open double quote" = "$dequoted_word"
+ test "open double quote" = "$dequoted_word"
'
@@ -616,7 +629,7 @@ test_expect_success '__git_is_configured_remote' '
test_when_finished "git remote remove remote_2" &&
git remote add remote_2 git://remote_2 &&
(
- verbose __git_is_configured_remote remote_2 &&
+ __git_is_configured_remote remote_2 &&
test_must_fail __git_is_configured_remote non-existent
)
'
@@ -1250,6 +1263,29 @@ test_expect_success '__git_complete_fetch_refspecs - fully qualified & prefix' '
test_cmp expected out
'
+test_expect_success '__git_complete_worktree_paths' '
+ test_when_finished "git worktree remove other_wt" &&
+ git worktree add --orphan other_wt &&
+ run_completion "git worktree remove " &&
+ grep other_wt out
+'
+
+test_expect_success '__git_complete_worktree_paths - not a git repository' '
+ (
+ cd non-repo &&
+ GIT_CEILING_DIRECTORIES="$ROOT" &&
+ export GIT_CEILING_DIRECTORIES &&
+ test_completion "git worktree remove " ""
+ )
+'
+
+test_expect_success '__git_complete_worktree_paths with -C' '
+ test_when_finished "git -C otherrepo worktree remove otherrepo_wt" &&
+ git -C otherrepo worktree add --orphan otherrepo_wt &&
+ run_completion "git -C otherrepo worktree remove " &&
+ grep otherrepo_wt out
+'
+
test_expect_success 'git switch - with no options, complete local branches and unique remote branch names for DWIM logic' '
test_completion "git switch " <<-\EOF
branch-in-other Z
@@ -1259,6 +1295,142 @@ test_expect_success 'git switch - with no options, complete local branches and u
EOF
'
+test_expect_success 'git bisect - when not bisecting, complete only replay and start subcommands' '
+ test_completion "git bisect " <<-\EOF
+ replay Z
+ start Z
+ EOF
+'
+
+test_expect_success 'git bisect - complete options to start subcommand' '
+ test_completion "git bisect start --" <<-\EOF
+ --term-new Z
+ --term-bad Z
+ --term-old Z
+ --term-good Z
+ --no-checkout Z
+ --first-parent Z
+ EOF
+'
+
+test_expect_success 'setup for git-bisect tests requiring a repo' '
+ git init git-bisect &&
+ (
+ cd git-bisect &&
+ echo "initial contents" >file &&
+ git add file &&
+ git commit -am "Initial commit" &&
+ git tag initial &&
+ echo "new line" >>file &&
+ git commit -am "First change" &&
+ echo "another new line" >>file &&
+ git commit -am "Second change" &&
+ git tag final
+ )
+'
+
+test_expect_success 'git bisect - start subcommand arguments before double-dash are completed as revs' '
+ (
+ cd git-bisect &&
+ test_completion "git bisect start " <<-\EOF
+ HEAD Z
+ final Z
+ initial Z
+ master Z
+ EOF
+ )
+'
+
+# Note that these arguments are <pathspec>s, which in practice the fallback
+# completion (not the git completion) later ends up completing as paths.
+test_expect_success 'git bisect - start subcommand arguments after double-dash are not completed' '
+ (
+ cd git-bisect &&
+ test_completion "git bisect start final initial -- " ""
+ )
+'
+
+test_expect_success 'setup for git-bisect tests requiring ongoing bisection' '
+ (
+ cd git-bisect &&
+ git bisect start --term-new=custom_new --term-old=custom_old final initial
+ )
+'
+
+test_expect_success 'git-bisect - when bisecting all subcommands are candidates' '
+ (
+ cd git-bisect &&
+ test_completion "git bisect " <<-\EOF
+ start Z
+ bad Z
+ custom_new Z
+ custom_old Z
+ new Z
+ good Z
+ old Z
+ terms Z
+ skip Z
+ reset Z
+ visualize Z
+ replay Z
+ log Z
+ run Z
+ help Z
+ EOF
+ )
+'
+
+test_expect_success 'git-bisect - options to terms subcommand are candidates' '
+ (
+ cd git-bisect &&
+ test_completion "git bisect terms --" <<-\EOF
+ --term-bad Z
+ --term-good Z
+ --term-new Z
+ --term-old Z
+ EOF
+ )
+'
+
+test_expect_success 'git-bisect - git-log options to visualize subcommand are candidates' '
+ (
+ cd git-bisect &&
+ # The completion used for git-log and here does not complete
+ # every git-log option, so rather than hope to stay in sync
+ # with exactly what it does we will just spot-test here.
+ test_completion "git bisect visualize --sta" <<-\EOF &&
+ --stat Z
+ EOF
+ test_completion "git bisect visualize --summar" <<-\EOF
+ --summary Z
+ EOF
+ )
+'
+
+test_expect_success 'git-bisect - view subcommand is not a candidate' '
+ (
+ cd git-bisect &&
+ test_completion "git bisect vi" <<-\EOF
+ visualize Z
+ EOF
+ )
+'
+
+test_expect_success 'git-bisect - existing view subcommand is recognized and enables completion of git-log options' '
+ (
+ cd git-bisect &&
+ # The completion used for git-log and here does not complete
+ # every git-log option, so rather than hope to stay in sync
+ # with exactly what it does we will just spot-test here.
+ test_completion "git bisect view --sta" <<-\EOF &&
+ --stat Z
+ EOF
+ test_completion "git bisect view --summar" <<-\EOF
+ --summary Z
+ EOF
+ )
+'
+
test_expect_success 'git checkout - completes refs and unique remote branches for DWIM' '
test_completion "git checkout " <<-\EOF
HEAD Z
@@ -1571,7 +1743,7 @@ test_expect_success FUNNYNAMES,!CYGWIN 'cone mode sparse-checkout completes dire
)
'
-test_expect_success 'non-cone mode sparse-checkout uses bash completion' '
+test_expect_success 'non-cone mode sparse-checkout gives rooted paths' '
# reset sparse-checkout repo to non-cone mode
git -C sparse-checkout sparse-checkout disable &&
git -C sparse-checkout sparse-checkout set --no-cone &&
@@ -1581,7 +1753,12 @@ test_expect_success 'non-cone mode sparse-checkout uses bash completion' '
# expected to be empty since we have not configured
# custom completion for non-cone mode
test_completion "git sparse-checkout set f" <<-\EOF
-
+ /folder1/0/1/t.txt Z
+ /folder1/expected Z
+ /folder1/out Z
+ /folder1/out_sorted Z
+ /folder2/0/t.txt Z
+ /folder3/t.txt Z
EOF
)
'
@@ -1622,14 +1799,22 @@ 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
+ test_completion "git switch --track " <<-\EOF &&
+ other/branch-in-other Z
+ other/main-in-other Z
+ EOF
+ test_completion "git switch -t " <<-\EOF
other/branch-in-other Z
other/main-in-other Z
EOF
'
test_expect_success 'git checkout - with --track, complete only remote branches' '
- test_completion "git checkout --track " <<-\EOF
+ test_completion "git checkout --track " <<-\EOF &&
+ other/branch-in-other Z
+ other/main-in-other Z
+ EOF
+ test_completion "git checkout -t " <<-\EOF
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1912,6 +2097,14 @@ test_expect_success 'git checkout - --orphan with branch already provided comple
EOF
'
+test_expect_success 'git restore completes modified files' '
+ test_commit A a.file &&
+ echo B >a.file &&
+ test_completion "git restore a." <<-\EOF
+ a.file
+ EOF
+'
+
test_expect_success 'teardown after ref completion' '
git branch -d matching-branch &&
git tag -d matching-tag &&
@@ -2255,6 +2448,36 @@ test_expect_success 'checkout completes ref names' '
EOF
'
+test_expect_success 'checkout does not match ref names of a different case' '
+ test_completion "git checkout M" ""
+'
+
+test_expect_success 'checkout matches case insensitively with GIT_COMPLETION_IGNORE_CASE' '
+ (
+ GIT_COMPLETION_IGNORE_CASE=1 &&
+ test_completion "git checkout M" <<-\EOF
+ main Z
+ mybranch Z
+ mytag Z
+ EOF
+ )
+'
+
+test_expect_success 'checkout completes pseudo refs' '
+ test_completion "git checkout H" <<-\EOF
+ HEAD Z
+ EOF
+'
+
+test_expect_success 'checkout completes pseudo refs case insensitively with GIT_COMPLETION_IGNORE_CASE' '
+ (
+ GIT_COMPLETION_IGNORE_CASE=1 &&
+ test_completion "git checkout h" <<-\EOF
+ HEAD Z
+ EOF
+ )
+'
+
test_expect_success 'git -C <path> checkout uses the right repo' '
test_completion "git -C subdir -C subsubdir -C .. -C ../otherrepo checkout b" <<-\EOF
branch-in-other Z
@@ -2426,6 +2649,24 @@ test_expect_success 'completion used <cmd> completion for alias: !f() { : git <c
EOF
'
+test_expect_success 'completion used <cmd> completion for alias: !f() { : <cmd> ; ... }' '
+ test_config alias.co "!f() { : checkout ; if ... } f" &&
+ test_completion "git co m" <<-\EOF
+ main Z
+ mybranch Z
+ mytag Z
+ EOF
+'
+
+test_expect_success 'completion used <cmd> completion for alias: !f() { : <cmd>; ... }' '
+ test_config alias.co "!f() { : checkout; if ... } f" &&
+ test_completion "git co m" <<-\EOF
+ main Z
+ mybranch Z
+ mytag Z
+ EOF
+'
+
test_expect_success 'completion without explicit _git_xxx function' '
test_completion "git version --" <<-\EOF
--build-options Z
@@ -2506,6 +2747,35 @@ test_expect_success 'git config - variable name include' '
EOF
'
+test_expect_success 'setup for git config submodule tests' '
+ test_create_repo sub &&
+ test_commit -C sub initial &&
+ git submodule add ./sub
+'
+
+test_expect_success 'git config - variable name - submodule and __git_compute_first_level_config_vars_for_section' '
+ test_completion "git config submodule." <<-\EOF
+ submodule.active Z
+ submodule.alternateErrorStrategy Z
+ submodule.alternateLocation Z
+ submodule.fetchJobs Z
+ submodule.propagateBranches Z
+ submodule.recurse Z
+ submodule.sub.Z
+ EOF
+'
+
+test_expect_success 'git config - variable name - __git_compute_second_level_config_vars_for_section' '
+ test_completion "git config submodule.sub." <<-\EOF
+ submodule.sub.url Z
+ submodule.sub.update Z
+ submodule.sub.branch Z
+ submodule.sub.fetchRecurseSubmodules Z
+ submodule.sub.ignore Z
+ submodule.sub.active Z
+ EOF
+'
+
test_expect_success 'git config - value' '
test_completion "git config color.pager " <<-\EOF
false Z
@@ -2557,6 +2827,20 @@ test_expect_success 'git clone --config= - value' '
EOF
'
+test_expect_success 'git reflog show' '
+ test_when_finished "git checkout - && git branch -d shown" &&
+ git checkout -b shown &&
+ test_completion "git reflog sho" <<-\EOF &&
+ show Z
+ shown Z
+ EOF
+ test_completion "git reflog show sho" "shown " &&
+ test_completion "git reflog shown sho" "shown " &&
+ test_completion "git reflog --unt" "--until=" &&
+ test_completion "git reflog show --unt" "--until=" &&
+ test_completion "git reflog shown --unt" "--until="
+'
+
test_expect_success 'options with value' '
test_completion "git merge -X diff-algorithm=" <<-\EOF
@@ -2566,30 +2850,30 @@ test_expect_success 'options with value' '
test_expect_success 'sourcing the completion script clears cached commands' '
(
__git_compute_all_commands &&
- verbose test -n "$__git_all_commands" &&
+ test -n "$__git_all_commands" &&
. "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&
- verbose test -z "$__git_all_commands"
+ test -z "$__git_all_commands"
)
'
test_expect_success 'sourcing the completion script clears cached merge strategies' '
(
__git_compute_merge_strategies &&
- verbose test -n "$__git_merge_strategies" &&
+ test -n "$__git_merge_strategies" &&
. "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&
- verbose test -z "$__git_merge_strategies"
+ test -z "$__git_merge_strategies"
)
'
test_expect_success 'sourcing the completion script clears cached --options' '
(
__gitcomp_builtin checkout &&
- verbose test -n "$__gitcomp_builtin_checkout" &&
+ test -n "$__gitcomp_builtin_checkout" &&
__gitcomp_builtin notes_edit &&
- verbose test -n "$__gitcomp_builtin_notes_edit" &&
+ test -n "$__gitcomp_builtin_notes_edit" &&
. "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&
- verbose test -z "$__gitcomp_builtin_checkout" &&
- verbose test -z "$__gitcomp_builtin_notes_edit"
+ test -z "$__gitcomp_builtin_checkout" &&
+ test -z "$__gitcomp_builtin_notes_edit"
)
'
@@ -2659,4 +2943,31 @@ test_expect_success '__git_complete' '
test_must_fail __git_complete ga missing
'
+test_expect_success '__git_pseudoref_exists' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ sane_unset __git_repo_path &&
+
+ # HEAD should exist, even if it points to an unborn branch.
+ __git_pseudoref_exists HEAD >output 2>&1 &&
+ test_must_be_empty output &&
+
+ # HEAD points to an existing branch, so it should exist.
+ test_commit A &&
+ __git_pseudoref_exists HEAD >output 2>&1 &&
+ test_must_be_empty output &&
+
+ # CHERRY_PICK_HEAD does not exist, so the existence check should fail.
+ ! __git_pseudoref_exists CHERRY_PICK_HEAD >output 2>&1 &&
+ test_must_be_empty output &&
+
+ # CHERRY_PICK_HEAD points to a commit, so it should exist.
+ git update-ref CHERRY_PICK_HEAD A &&
+ __git_pseudoref_exists CHERRY_PICK_HEAD >output 2>&1 &&
+ test_must_be_empty output
+ )
+'
+
test_done
diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
index 6a30f57..d667dda 100755
--- a/t/t9903-bash-prompt.sh
+++ b/t/t9903-bash-prompt.sh
@@ -13,10 +13,10 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. "$GIT_BUILD_DIR/contrib/completion/git-prompt.sh"
actual="$TRASH_DIRECTORY/actual"
-c_red='\\[\\e[31m\\]'
-c_green='\\[\\e[32m\\]'
-c_lblue='\\[\\e[1;34m\\]'
-c_clear='\\[\\e[0m\\]'
+c_red='\001\e[31m\002'
+c_green='\001\e[32m\002'
+c_lblue='\001\e[1;34m\002'
+c_clear='\001\e[0m\002'
test_expect_success 'setup for prompt tests' '
git init otherrepo &&
@@ -759,4 +759,20 @@ test_expect_success 'prompt - hide if pwd ignored - inside gitdir' '
test_cmp expected "$actual"
'
+test_expect_success 'prompt - conflict indicator' '
+ printf " (main|CONFLICT)" >expected &&
+ echo "stash" >file &&
+ git stash &&
+ test_when_finished "git stash drop" &&
+ echo "commit" >file &&
+ git commit -m "commit" file &&
+ test_when_finished "git reset --hard HEAD~" &&
+ test_must_fail git stash apply &&
+ (
+ GIT_PS1_SHOWCONFLICTSTATE="yes" &&
+ __git_ps1 >"$actual"
+ ) &&
+ test_cmp expected "$actual"
+'
+
test_done
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 8c44856..862d80c 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see http://www.gnu.org/licenses/ .
+# along with this program. If not, see https://www.gnu.org/licenses/ .
# The semantics of the editor variables are that of invoking
# sh -c "$EDITOR \"$@\"" files ...
@@ -32,6 +32,14 @@ test_set_editor () {
export EDITOR
}
+# Like test_set_editor but sets GIT_SEQUENCE_EDITOR instead of EDITOR
+test_set_sequence_editor () {
+ FAKE_SEQUENCE_EDITOR="$1"
+ export FAKE_SEQUENCE_EDITOR
+ GIT_SEQUENCE_EDITOR='"$FAKE_SEQUENCE_EDITOR"'
+ export GIT_SEQUENCE_EDITOR
+}
+
test_decode_color () {
awk '
function name(n) {
@@ -243,6 +251,61 @@ debug () {
done
}
+# Usage: test_ref_exists [options] <ref>
+#
+# -C <dir>:
+# Run all git commands in directory <dir>
+#
+# This helper function checks whether a reference exists. Symrefs or object IDs
+# will not be resolved. Can be used to check references with bad names.
+test_ref_exists () {
+ local indir=
+
+ while test $# != 0
+ do
+ case "$1" in
+ -C)
+ indir="$2"
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+ shift
+ done &&
+
+ indir=${indir:+"$indir"/} &&
+
+ if test "$#" != 1
+ then
+ BUG "expected exactly one reference"
+ fi &&
+
+ git ${indir:+ -C "$indir"} show-ref --exists "$1"
+}
+
+# Behaves the same as test_ref_exists, except that it checks for the absence of
+# a reference. This is preferable to `! test_ref_exists` as this function is
+# able to distinguish actually-missing references from other, generic errors.
+test_ref_missing () {
+ test_ref_exists "$@"
+ case "$?" in
+ 2)
+ # This is the good case.
+ return 0
+ ;;
+ 0)
+ echo >&4 "test_ref_missing: reference exists"
+ return 1
+ ;;
+ *)
+ echo >&4 "test_ref_missing: generic error"
+ return 1
+ ;;
+ esac
+}
+
# Usage: test_commit [options] <message> [<file> [<contents> [<tag>]]]
# -C <dir>:
# Run all git commands in directory <dir>
@@ -273,13 +336,13 @@ debug () {
# <file>, <contents>, and <tag> all default to <message>.
test_commit () {
- notick= &&
- echo=echo &&
- append= &&
- author= &&
- signoff= &&
- indir= &&
- tag=light &&
+ local notick= &&
+ local echo=echo &&
+ local append= &&
+ local author= &&
+ local signoff= &&
+ local indir= &&
+ local tag=light &&
while test $# != 0
do
case "$1" in
@@ -322,7 +385,7 @@ test_commit () {
shift
done &&
indir=${indir:+"$indir"/} &&
- file=${2:-"$1.t"} &&
+ local file="${2:-"$1.t"}" &&
if test -n "$append"
then
$echo "${3-$1}" >>"$indir$file"
@@ -534,8 +597,17 @@ test_config () {
config_dir=$1
shift
fi
- test_when_finished "test_unconfig ${config_dir:+-C '$config_dir'} '$1'" &&
- git ${config_dir:+-C "$config_dir"} config "$@"
+
+ # If --worktree is provided, use it to configure/unconfigure
+ is_worktree=
+ if test "$1" = --worktree
+ then
+ is_worktree=1
+ shift
+ fi
+
+ test_when_finished "test_unconfig ${config_dir:+-C '$config_dir'} ${is_worktree:+--worktree} '$1'" &&
+ git ${config_dir:+-C "$config_dir"} config ${is_worktree:+--worktree} "$@"
}
test_config_global () {
@@ -633,7 +705,7 @@ test_hook () {
# - Explicitly using test_have_prereq.
#
# - Implicitly by specifying the prerequisite tag in the calls to
-# test_expect_{success,failure} and test_external{,_without_stderr}.
+# test_expect_{success,failure}
#
# The single parameter is the prerequisite tag (a simple word, in all
# capital letters by convention).
@@ -835,93 +907,6 @@ test_expect_success () {
test_finish_
}
-# test_external runs external test scripts that provide continuous
-# test output about their progress, and succeeds/fails on
-# zero/non-zero exit code. It outputs the test output on stdout even
-# in non-verbose mode, and announces the external script with "# run
-# <n>: ..." before running it. When providing relative paths, keep in
-# mind that all scripts run in "trash directory".
-# Usage: test_external description command arguments...
-# Example: test_external 'Perl API' perl ../path/to/test.pl
-test_external () {
- test "$#" = 4 && { test_prereq=$1; shift; } || test_prereq=
- test "$#" = 3 ||
- BUG "not 3 or 4 parameters to test_external"
- descr="$1"
- shift
- test_verify_prereq
- export test_prereq
- if ! test_skip "$descr" "$@"
- then
- # Announce the script to reduce confusion about the
- # test output that follows.
- say_color "" "# run $test_count: $descr ($*)"
- # Export TEST_DIRECTORY, TRASH_DIRECTORY and GIT_TEST_LONG
- # to be able to use them in script
- export TEST_DIRECTORY TRASH_DIRECTORY GIT_TEST_LONG
- # Run command; redirect its stderr to &4 as in
- # test_run_, but keep its stdout on our stdout even in
- # non-verbose mode.
- "$@" 2>&4
- if test "$?" = 0
- then
- if test $test_external_has_tap -eq 0; then
- test_ok_ "$descr"
- else
- say_color "" "# test_external test $descr was ok"
- test_success=$(($test_success + 1))
- fi
- else
- if test $test_external_has_tap -eq 0; then
- test_failure_ "$descr" "$@"
- else
- say_color error "# test_external test $descr failed: $@"
- test_failure=$(($test_failure + 1))
- fi
- fi
- fi
-}
-
-# Like test_external, but in addition tests that the command generated
-# no output on stderr.
-test_external_without_stderr () {
- # The temporary file has no (and must have no) security
- # implications.
- tmp=${TMPDIR:-/tmp}
- stderr="$tmp/git-external-stderr.$$.tmp"
- test_external "$@" 4> "$stderr"
- test -f "$stderr" || error "Internal error: $stderr disappeared."
- descr="no stderr: $1"
- shift
- say >&3 "# expecting no stderr from previous command"
- if test ! -s "$stderr"
- then
- rm "$stderr"
-
- if test $test_external_has_tap -eq 0; then
- test_ok_ "$descr"
- else
- say_color "" "# test_external_without_stderr test $descr was ok"
- test_success=$(($test_success + 1))
- fi
- else
- if test "$verbose" = t
- then
- output=$(echo; echo "# Stderr is:"; cat "$stderr")
- else
- output=
- fi
- # rm first in case test_failure exits.
- rm "$stderr"
- if test $test_external_has_tap -eq 0; then
- test_failure_ "$descr" "$@" "$output"
- else
- say_color error "# test_external_without_stderr test $descr failed: $@: $output"
- test_failure=$(($test_failure + 1))
- fi
- fi
-}
-
# debugging-friendly alternatives to "test [-f|-d|-e]"
# The commands test the existence or non-existence of $1
test_path_is_file () {
@@ -980,11 +965,20 @@ test_path_is_symlink () {
fi
}
+test_path_is_executable () {
+ test "$#" -ne 1 && BUG "1 param"
+ if ! test -x "$1"
+ then
+ echo "$1 is not executable"
+ false
+ fi
+}
+
# Check if the directory exists and is empty as expected, barf otherwise.
test_dir_is_empty () {
test "$#" -ne 1 && BUG "1 param"
test_path_is_dir "$1" &&
- if test -n "$(ls -a1 "$1" | egrep -v '^\.\.?$')"
+ if test -n "$(ls -a1 "$1" | grep -E -v '^\.\.?$')"
then
echo "Directory '$1' is not empty, it contains:"
ls -la "$1"
@@ -1008,10 +1002,6 @@ test_path_is_missing () {
then
echo "Path exists:"
ls -ld "$1"
- if test $# -ge 1
- then
- echo "$*"
- fi
false
fi
}
@@ -1107,7 +1097,7 @@ test_must_fail_acceptable () {
fi
case "$1" in
- git|__git*|test-tool|test_terminal)
+ git|__git*|scalar|test-tool|test_terminal)
return 0
;;
*)
@@ -1273,19 +1263,20 @@ test_cmp_bin () {
cmp "$@"
}
-# Wrapper for grep which used to be used for
-# GIT_TEST_GETTEXT_POISON=false. Only here as a shim for other
-# in-flight changes. Should not be used and will be removed soon.
test_i18ngrep () {
+ BUG "do not use test_i18ngrep---use test_grep instead"
+}
+
+test_grep () {
eval "last_arg=\${$#}"
test -f "$last_arg" ||
- BUG "test_i18ngrep requires a file to read as the last parameter"
+ BUG "test_grep requires a file to read as the last parameter"
if test $# -lt 2 ||
{ test "x!" = "x$1" && test $# -lt 3 ; }
then
- BUG "too few parameters to test_i18ngrep"
+ BUG "too few parameters to test_grep"
fi
if test "x!" = "x$1"
@@ -1310,15 +1301,6 @@ test_i18ngrep () {
return 1
}
-# Call any command "$@" but be more verbose about its
-# failure. This is handy for commands like "test" which do
-# not output anything when they fail.
-verbose () {
- "$@" && return 0
- echo >&4 "command failed: $(git rev-parse --sq-quote "$@")"
- return 1
-}
-
# Check if the file expected to be empty is indeed empty, and barfs
# otherwise.
@@ -1365,6 +1347,39 @@ test_cmp_rev () {
fi
}
+# Tests that a commit message matches the expected text
+#
+# Usage: test_commit_message <rev> [-m <msg> | <file>]
+#
+# When using "-m" <msg> will have a line feed appended. If the second
+# argument is omitted then the expected message is read from stdin.
+
+test_commit_message () {
+ local msg_file=expect.msg
+
+ case $# in
+ 3)
+ if test "$2" = "-m"
+ then
+ printf "%s\n" "$3" >"$msg_file"
+ else
+ BUG "Usage: test_commit_message <rev> [-m <message> | <file>]"
+ fi
+ ;;
+ 2)
+ msg_file="$2"
+ ;;
+ 1)
+ cat >"$msg_file"
+ ;;
+ *)
+ BUG "Usage: test_commit_message <rev> [-m <message> | <file>]"
+ ;;
+ esac
+ git show --no-patch --pretty=format:%B "$1" -- >actual.msg &&
+ test_cmp "$msg_file" actual.msg
+}
+
# Compare paths respecting core.ignoreCase
test_cmp_fspath () {
if test "x$1" = "x$2"
@@ -1513,7 +1528,7 @@ test_bool_env () {
BUG "test_bool_env requires two parameters (variable name and default value)"
fi
- git env--helper --type=bool --default="$2" --exit-code "$1"
+ test-tool env-helper --type=bool --default="$2" --exit-code "$1"
ret=$?
case $ret in
0|1) # unset or valid bool value
@@ -1541,72 +1556,6 @@ test_skip_or_die () {
error "$2"
}
-# The following mingw_* functions obey POSIX shell syntax, but are actually
-# bash scripts, and are meant to be used only with bash on Windows.
-
-# A test_cmp function that treats LF and CRLF equal and avoids to fork
-# diff when possible.
-mingw_test_cmp () {
- # Read text into shell variables and compare them. If the results
- # are different, use regular diff to report the difference.
- local test_cmp_a= test_cmp_b=
-
- # When text came from stdin (one argument is '-') we must feed it
- # to diff.
- local stdin_for_diff=
-
- # Since it is difficult to detect the difference between an
- # empty input file and a failure to read the files, we go straight
- # to diff if one of the inputs is empty.
- if test -s "$1" && test -s "$2"
- then
- # regular case: both files non-empty
- mingw_read_file_strip_cr_ test_cmp_a <"$1"
- mingw_read_file_strip_cr_ test_cmp_b <"$2"
- elif test -s "$1" && test "$2" = -
- then
- # read 2nd file from stdin
- mingw_read_file_strip_cr_ test_cmp_a <"$1"
- mingw_read_file_strip_cr_ test_cmp_b
- stdin_for_diff='<<<"$test_cmp_b"'
- elif test "$1" = - && test -s "$2"
- then
- # read 1st file from stdin
- mingw_read_file_strip_cr_ test_cmp_a
- mingw_read_file_strip_cr_ test_cmp_b <"$2"
- stdin_for_diff='<<<"$test_cmp_a"'
- fi
- test -n "$test_cmp_a" &&
- test -n "$test_cmp_b" &&
- test "$test_cmp_a" = "$test_cmp_b" ||
- eval "diff -u \"\$@\" $stdin_for_diff"
-}
-
-# $1 is the name of the shell variable to fill in
-mingw_read_file_strip_cr_ () {
- # Read line-wise using LF as the line separator
- # and use IFS to strip CR.
- local line
- while :
- do
- if IFS=$'\r' read -r -d $'\n' line
- then
- # good
- line=$line$'\n'
- else
- # we get here at EOF, but also if the last line
- # was not terminated by LF; in the latter case,
- # some text was read
- if test -z "$line"
- then
- # EOF, really
- break
- fi
- fi
- eval "$1=\$$1\$line"
- done
-}
-
# Like "env FOO=BAR some-program", but run inside a subshell, which means
# it also works for shell functions (though those functions cannot impact
# the environment outside of the test_env invocation).
@@ -1706,7 +1655,21 @@ test_set_hash () {
# Detect the hash algorithm in use.
test_detect_hash () {
- test_hash_algo="${GIT_TEST_DEFAULT_HASH:-sha1}"
+ case "$GIT_TEST_DEFAULT_HASH" in
+ "sha256")
+ test_hash_algo=sha256
+ test_compat_hash_algo=sha1
+ ;;
+ *)
+ test_hash_algo=sha1
+ test_compat_hash_algo=sha256
+ ;;
+ esac
+}
+
+# Detect the hash algorithm in use.
+test_detect_ref_format () {
+ echo "${GIT_TEST_DEFAULT_REF_FORMAT:-files}"
}
# Load common hash metadata and common placeholder object IDs for use with
@@ -1758,6 +1721,12 @@ test_oid () {
local algo="${test_hash_algo}" &&
case "$1" in
+ --hash=storage)
+ algo="$test_hash_algo" &&
+ shift;;
+ --hash=compat)
+ algo="$test_compat_hash_algo" &&
+ shift;;
--hash=*)
algo="${1#--hash=}" &&
shift;;
@@ -1773,13 +1742,13 @@ test_oid () {
then
BUG "undefined key '$1'"
fi &&
- eval "printf '%s' \"\${$var}\""
+ eval "printf '%s\n' \"\${$var}\""
}
# Insert a slash into an object ID so it can be used to reference a location
# under ".git/objects". For example, "deadbeef..." becomes "de/adbeef..".
test_oid_to_path () {
- local basename=${1#??}
+ local basename="${1#??}"
echo "${1%$basename}/$basename"
}
@@ -1796,7 +1765,7 @@ test_parse_ls_tree_oids () {
# Choose a port number based on the test script's number and store it in
# the given variable name, unless that variable already contains a number.
test_set_port () {
- local var=$1 port
+ local var="$1" port
if test $# -ne 1 || test -z "$var"
then
@@ -1842,6 +1811,13 @@ test_path_is_hidden () {
return 1
}
+# Poor man's URI escaping. Good enough for the test suite whose trash
+# directory has a space in it. See 93c3fcbe4d4 (git-svn: attempt to
+# mimic SVN 1.7 URL canonicalization, 2012-07-28) for prior art.
+test_uri_escape() {
+ sed 's/ /%20/g'
+}
+
# Check that the given command was invoked as part of the
# trace2-format trace on stdin.
#
@@ -1864,7 +1840,7 @@ test_subcommand () {
shift
fi
- local expr=$(printf '"%s",' "$@")
+ local expr="$(printf '"%s",' "$@")"
expr="${expr%,}"
if test -n "$negate"
@@ -1917,6 +1893,28 @@ test_region () {
return 0
}
+# Check that the given data fragment was included as part of the
+# trace2-format trace on stdin.
+#
+# test_trace2_data <category> <key> <value>
+#
+# For example, to look for trace2_data_intmax("pack-objects", repo,
+# "reused", N) in an invocation of "git pack-objects", run:
+#
+# GIT_TRACE2_EVENT="$(pwd)/trace.txt" git pack-objects ... &&
+# test_trace2_data pack-objects reused N <trace2.txt
+test_trace2_data () {
+ grep -e '"category":"'"$1"'","key":"'"$2"'","value":"'"$3"'"'
+}
+
+# Given a GIT_TRACE2_EVENT log over stdin, writes to stdout a list of URLs
+# sent to git-remote-https child processes.
+test_remote_https_urls() {
+ grep -e '"event":"child_start".*"argv":\["git-remote-https",".*"\]' |
+ sed -e 's/{"event":"child_start".*"argv":\["git-remote-https","//g' \
+ -e 's/"\]}//g'
+}
+
# Print the destination of symlink(s) provided as arguments. Basically
# the same as the readlink command, but it's not available everywhere.
test_readlink () {
@@ -1932,7 +1930,7 @@ test_readlink () {
# An optional increment to the magic timestamp may be specified as second
# argument.
test_set_magic_mtime () {
- local inc=${2:-0} &&
+ local inc="${2:-0}" &&
local mtime=$((1234567890 + $inc)) &&
test-tool chmtime =$mtime "$1" &&
test_is_magic_mtime "$1" $inc
@@ -1945,7 +1943,7 @@ test_set_magic_mtime () {
# argument. Usually, this should be the same increment which was used for
# the associated test_set_magic_mtime.
test_is_magic_mtime () {
- local inc=${2:-0} &&
+ local inc="${2:-0}" &&
local mtime=$((1234567890 + $inc)) &&
echo $mtime >.git/test-mtime-expect &&
test-tool chmtime --get "$1" >.git/test-mtime-actual &&
@@ -1955,3 +1953,22 @@ test_is_magic_mtime () {
rm -f .git/test-mtime-actual
return $ret
}
+
+# Given two filenames, parse both using 'git config --list --file'
+# and compare the sorted output of those commands. Useful when
+# wanting to ignore whitespace differences and sorting concerns.
+test_cmp_config_output () {
+ git config --list --file="$1" >config-expect &&
+ git config --list --file="$2" >config-actual &&
+ sort config-expect >sorted-expect &&
+ sort config-actual >sorted-actual &&
+ test_cmp sorted-expect sorted-actual
+}
+
+# Given a filename, extract its trailing hash as a hex string
+test_trailing_hash () {
+ local file="$1" &&
+ tail -c $(test_oid rawsz) "$file" |
+ test-tool hexdump |
+ sed "s/ //g"
+}
diff --git a/t/test-lib-github-workflow-markup.sh b/t/test-lib-github-workflow-markup.sh
index 9c5339c..33405c9 100644
--- a/t/test-lib-github-workflow-markup.sh
+++ b/t/test-lib-github-workflow-markup.sh
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see http://www.gnu.org/licenses/ .
+# along with this program. If not, see https://www.gnu.org/licenses/ .
#
# The idea is for `test-lib.sh` to source this file when run in GitHub
# workflows; these functions will then override (empty) functions
@@ -42,8 +42,8 @@ finalize_test_case_output () {
fixed)
echo >>$github_markup_output "::notice::fixed: $this_test.$test_count $1"
;;
- ok)
- # Exit without printing the "ok" tests
+ ok|broken)
+ # Exit without printing the "ok" or ""broken" tests
return
;;
esac
diff --git a/t/test-lib-junit.sh b/t/test-lib-junit.sh
index 79c31c7..76cbbd3 100644
--- a/t/test-lib-junit.sh
+++ b/t/test-lib-junit.sh
@@ -15,7 +15,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see http://www.gnu.org/licenses/ .
+# along with this program. If not, see https://www.gnu.org/licenses/ .
#
# The idea is for `test-lib.sh` to source this file when the user asks
# for JUnit XML; these functions will then override (empty) functions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 8cabb4d..79d3e0e 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -13,7 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see http://www.gnu.org/licenses/ .
+# along with this program. If not, see https://www.gnu.org/licenses/ .
# Test the binaries we have just built. The tests are kept in
# t/ subdirectory and are run in 'trash directory' subdirectory.
@@ -47,6 +47,16 @@ then
echo "PANIC: Running in a $TEST_DIRECTORY that doesn't end in '/t'?" >&2
exit 1
fi
+if test -f "$GIT_BUILD_DIR/GIT-BUILD-DIR"
+then
+ GIT_BUILD_DIR="$(cat "$GIT_BUILD_DIR/GIT-BUILD-DIR")" || exit 1
+ # On Windows, we must convert Windows paths lest they contain a colon
+ case "$(uname -s)" in
+ *MINGW*)
+ GIT_BUILD_DIR="$(cygpath -au "$GIT_BUILD_DIR")"
+ ;;
+ esac
+fi
# Prepend a string to a VAR using an arbitrary ":" delimiter, not
# adding the delimiter if VAR or VALUE is empty. I.e. a generalized:
@@ -79,6 +89,9 @@ prepend_var LSAN_OPTIONS : $GIT_SAN_OPTIONS
prepend_var LSAN_OPTIONS : fast_unwind_on_malloc=0
export LSAN_OPTIONS
+prepend_var UBSAN_OPTIONS : $GIT_SAN_OPTIONS
+export UBSAN_OPTIONS
+
if test ! -f "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
then
echo >&2 'error: GIT-BUILD-OPTIONS missing (has Git been built?).'
@@ -238,6 +251,9 @@ parse_option () {
;;
esac
;;
+ --invert-exit-code)
+ invert_exit_code=t
+ ;;
*)
echo "error: unknown test option '$opt'" >&2; exit 1 ;;
esac
@@ -302,6 +318,11 @@ TEST_NUMBER="${TEST_NAME%%-*}"
TEST_NUMBER="${TEST_NUMBER#t}"
TEST_RESULTS_DIR="$TEST_OUTPUT_DIRECTORY/test-results"
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_NR_LEAKS_STARTUP=
TRASH_DIRECTORY="trash directory.$TEST_NAME$TEST_STRESS_JOB_SFX"
test -n "$root" && TRASH_DIRECTORY="$root/$TRASH_DIRECTORY"
case "$TRASH_DIRECTORY" in
@@ -309,6 +330,17 @@ 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
@@ -510,6 +542,8 @@ export EDITOR
GIT_DEFAULT_HASH="${GIT_TEST_DEFAULT_HASH:-sha1}"
export GIT_DEFAULT_HASH
+GIT_DEFAULT_REF_FORMAT="${GIT_TEST_DEFAULT_REF_FORMAT:-files}"
+export GIT_DEFAULT_REF_FORMAT
GIT_TEST_MERGE_ALGORITHM="${GIT_TEST_MERGE_ALGORITHM:-ort}"
export GIT_TEST_MERGE_ALGORITHM
@@ -545,9 +579,11 @@ case $GIT_TEST_FSYNC in
esac
# Add libc MALLOC and MALLOC_PERTURB test only if we are not executing
-# the test with valgrind and have not compiled with SANITIZE=address.
+# the test with valgrind and have not compiled with conflict SANITIZE
+# options.
if test -n "$valgrind" ||
test -n "$SANITIZE_ADDRESS" ||
+ test -n "$SANITIZE_LEAK" ||
test -n "$TEST_NO_MALLOC_CHECK"
then
setup_malloc_check () {
@@ -557,14 +593,19 @@ then
: nothing
}
else
+ _USE_GLIBC_TUNABLES=
+ if _GLIBC_VERSION=$(getconf GNU_LIBC_VERSION 2>/dev/null) &&
+ _GLIBC_VERSION=${_GLIBC_VERSION#"glibc "} &&
+ expr 2.34 \<= "$_GLIBC_VERSION" >/dev/null
+ then
+ _USE_GLIBC_TUNABLES=YesPlease
+ fi
setup_malloc_check () {
local g
local t
MALLOC_CHECK_=3 MALLOC_PERTURB_=165
export MALLOC_CHECK_ MALLOC_PERTURB_
- if _GLIBC_VERSION=$(getconf GNU_LIBC_VERSION 2>/dev/null) &&
- _GLIBC_VERSION=${_GLIBC_VERSION#"glibc "} &&
- expr 2.34 \<= "$_GLIBC_VERSION" >/dev/null
+ if test -n "$_USE_GLIBC_TUNABLES"
then
g=
LD_PRELOAD="libc_malloc_debug.so.0"
@@ -610,12 +651,6 @@ u200c=$(printf '\342\200\214')
export _x05 _x35 LF u200c EMPTY_TREE EMPTY_BLOB ZERO_OID OID_REGEX
-# Each test should start with something like this, after copyright notices:
-#
-# test_description='Description of this test...
-# This test checks if command xyzzy does the right thing...
-# '
-# . ./test-lib.sh
test "x$TERM" != "xdumb" && (
test -t 1 &&
tput bold >/dev/null 2>&1 &&
@@ -788,15 +823,31 @@ test_ok_ () {
finalize_test_case_output ok "$@"
}
+_invert_exit_code_failure_end_blurb () {
+ say_color warn "# faked up failures as TODO & now exiting with 0 due to --invert-exit-code"
+}
+
test_failure_ () {
failure_label=$1
test_failure=$(($test_failure + 1))
- say_color error "not ok $test_count - $1"
+ local pfx=""
+ if test -n "$invert_exit_code" # && test -n "$HARNESS_ACTIVE"
+ then
+ pfx="# TODO induced breakage (--invert-exit-code):"
+ fi
+ say_color error "not ok $test_count - ${pfx:+$pfx }$1"
shift
printf '%s\n' "$*" | sed -e 's/^/# /'
if test -n "$immediate"
then
say_color error "1..$test_count"
+ if test -n "$invert_exit_code"
+ then
+ finalize_test_output
+ _invert_exit_code_failure_end_blurb
+ GIT_EXIT_OK=t
+ exit 0
+ fi
_error_exit
fi
finalize_test_case_output failure "$failure_label" "$@"
@@ -804,14 +855,14 @@ test_failure_ () {
test_known_broken_ok_ () {
test_fixed=$(($test_fixed+1))
- say_color error "ok $test_count - $@ # TODO known breakage vanished"
- finalize_test_case_output fixed "$@"
+ say_color error "ok $test_count - $1 # TODO known breakage vanished"
+ finalize_test_case_output fixed "$1"
}
test_known_broken_failure_ () {
test_broken=$(($test_broken+1))
- say_color warn "not ok $test_count - $@ # TODO known breakage"
- finalize_test_case_output broken "$@"
+ say_color warn "not ok $test_count - $1 # TODO known breakage"
+ finalize_test_case_output broken "$1"
}
test_debug () {
@@ -996,10 +1047,7 @@ want_trace () {
# (and we want to make sure we run any cleanup like
# "set +x").
test_eval_inner_ () {
- # Do not add anything extra (including LF) after '$*'
- eval "
- want_trace && trace_level_=$(($trace_level_+1)) && set -x
- $*"
+ eval "$*"
}
test_eval_ () {
@@ -1024,7 +1072,10 @@ test_eval_ () {
# be _inside_ the block to avoid polluting the "set -x" output
#
- test_eval_inner_ "$@" </dev/null >&3 2>&4
+ # Do not add anything extra (including LF) after '$*'
+ test_eval_inner_ </dev/null >&3 2>&4 "
+ want_trace && trace_level_=$(($trace_level_+1)) && set -x
+ $*"
{
test_eval_ret_=$?
if want_trace
@@ -1041,26 +1092,22 @@ test_eval_ () {
return $test_eval_ret_
}
+fail_117 () {
+ return 117
+}
+
test_run_ () {
test_cleanup=:
expecting_failure=$2
if test "${GIT_TEST_CHAIN_LINT:-1}" != 0; then
- # turn off tracing for this test-eval, as it simply creates
- # confusing noise in the "-x" output
- trace_tmp=$trace
- trace=
# 117 is magic because it is unlikely to match the exit
# code of other programs
- if test "OK-117" != "$(test_eval_ "(exit 117) && $1${LF}${LF}echo OK-\$?" 3>&1)" ||
- {
- test "${GIT_TEST_CHAIN_LINT_HARDER:-${GIT_TEST_CHAIN_LINT_HARDER_DEFAULT:-1}}" != 0 &&
- $(printf '%s\n' "$1" | sed -f "$GIT_BUILD_DIR/t/chainlint.sed" | grep -q '?![A-Z][A-Z]*?!')
- }
+ test_eval_inner_ "fail_117 && $1" </dev/null >&3 2>&4
+ if test $? != 117
then
- BUG "broken &&-chain or run-away HERE-DOC: $1"
+ BUG "broken &&-chain: $1"
fi
- trace=$trace_tmp
fi
setup_malloc_check
@@ -1168,9 +1215,67 @@ test_atexit_handler () {
teardown_malloc_check
}
-test_done () {
- GIT_EXIT_OK=t
+sanitize_leak_log_message_ () {
+ local new="$1" &&
+ local old="$2" &&
+ local file="$3" &&
+
+ printf "With SANITIZE=leak at exit we have %d leak logs, but started with %d
+
+This means that we have a blindspot where git is leaking but we're
+losing the exit code somewhere, or not propagating it appropriately
+upwards!
+
+See the logs at \"%s.*\";
+those logs are reproduced below." \
+ "$new" "$old" "$file"
+}
+
+check_test_results_san_file_ () {
+ if test -z "$TEST_RESULTS_SAN_FILE"
+ then
+ return
+ fi &&
+ local old="$TEST_RESULTS_SAN_DIR_NR_LEAKS_STARTUP" &&
+ local new="$(nr_san_dir_leaks_)" &&
+
+ if test $new -le $old
+ then
+ return
+ fi &&
+ local out="$(sanitize_leak_log_message_ "$new" "$old" "$TEST_RESULTS_SAN_FILE")" &&
+ say_color error "$out" &&
+ if test "$old" != 0
+ then
+ echo &&
+ say_color error "The logs include output from past runs to avoid" &&
+ say_color error "that remove 'test-results' between runs."
+ fi &&
+ say_color error "$(cat "$TEST_RESULTS_SAN_FILE".*)" &&
+ if test -n "$passes_sanitize_leak" && test "$test_failure" = 0
+ then
+ say "As TEST_PASSES_SANITIZE_LEAK=true and our logs show we're leaking, exit non-zero!" &&
+ invert_exit_code=t
+ elif test -n "$passes_sanitize_leak"
+ then
+ say "As TEST_PASSES_SANITIZE_LEAK=true and our logs show we're leaking, and we're failing for other reasons too..." &&
+ invert_exit_code=
+ elif test -n "$sanitize_leak_check" && test "$test_failure" = 0
+ then
+ say "As TEST_PASSES_SANITIZE_LEAK=true isn't set the above leak is 'ok' with GIT_TEST_PASSING_SANITIZE_LEAK=check" &&
+ invert_exit_code=
+ elif test -n "$sanitize_leak_check"
+ then
+ say "As TEST_PASSES_SANITIZE_LEAK=true isn't set the above leak is 'ok' with GIT_TEST_PASSING_SANITIZE_LEAK=check" &&
+ invert_exit_code=t
+ else
+ say "With GIT_TEST_SANITIZE_LEAK_LOG=true our logs revealed a memory leak, exit non-zero!" &&
+ invert_exit_code=t
+ fi
+}
+
+test_done () {
# Run the atexit commands _before_ the trash directory is
# removed, so the commands can access pidfiles and socket files.
test_atexit_handler
@@ -1192,6 +1297,11 @@ test_done () {
EOF
fi
+ if test -z "$passes_sanitize_leak" && test_bool_env TEST_PASSES_SANITIZE_LEAK false
+ then
+ BAIL_OUT "Please, set TEST_PASSES_SANITIZE_LEAK before sourcing test-lib.sh"
+ fi
+
if test "$test_fixed" != 0
then
say_color error "# $test_fixed known breakage(s) vanished; please update test(s)"
@@ -1210,28 +1320,32 @@ test_done () {
fi
case "$test_failure" in
0)
- if test $test_external_has_tap -eq 0
+ if test $test_remaining -gt 0
then
- if test $test_remaining -gt 0
- then
- say_color pass "# passed all $msg"
- fi
-
- # Maybe print SKIP message
- test -z "$skip_all" || skip_all="# SKIP $skip_all"
- case "$test_count" in
- 0)
- say "1..$test_count${skip_all:+ $skip_all}"
- ;;
- *)
- test -z "$skip_all" ||
- say_color warn "$skip_all"
- say "1..$test_count"
- ;;
- esac
+ say_color pass "# passed all $msg"
fi
- if test -z "$debug" && test -n "$remove_trash"
+ # Maybe print SKIP message
+ test -z "$skip_all" || skip_all="# SKIP $skip_all"
+ case "$test_count" in
+ 0)
+ say "1..$test_count${skip_all:+ $skip_all}"
+ ;;
+ *)
+ test -z "$skip_all" ||
+ say_color warn "$skip_all"
+ say "1..$test_count"
+ ;;
+ esac
+
+ if test -n "$stress" && test -n "$invert_exit_code"
+ then
+ # We're about to move our "$TRASH_DIRECTORY"
+ # to "$TRASH_DIRECTORY.stress-failed" if
+ # --stress is combined with
+ # --invert-exit-code.
+ say "with --stress and --invert-exit-code we're not removing '$TRASH_DIRECTORY'"
+ elif test -z "$debug" && test -n "$remove_trash"
then
test -d "$TRASH_DIRECTORY" ||
error "Tests passed but trash directory already removed before test cleanup; aborting"
@@ -1244,17 +1358,35 @@ test_done () {
} ||
error "Tests passed but test cleanup failed; aborting"
fi
+
+ check_test_results_san_file_ "$test_failure"
+
+ if test -z "$skip_all" && test -n "$invert_exit_code"
+ then
+ say_color warn "# faking up non-zero exit with --invert-exit-code"
+ GIT_EXIT_OK=t
+ exit 1
+ fi
+
test_at_end_hook_
+ GIT_EXIT_OK=t
exit 0 ;;
*)
- if test $test_external_has_tap -eq 0
+ say_color error "# failed $test_failure among $msg"
+ say "1..$test_count"
+
+ check_test_results_san_file_ "$test_failure"
+
+ if test -n "$invert_exit_code"
then
- say_color error "# failed $test_failure among $msg"
- say "1..$test_count"
+ _invert_exit_code_failure_end_blurb
+ GIT_EXIT_OK=t
+ exit 0
fi
+ GIT_EXIT_OK=t
exit 1 ;;
esac
@@ -1387,14 +1519,12 @@ fi
GITPERLLIB="$GIT_BUILD_DIR"/perl/build/lib
export GITPERLLIB
test -d "$GIT_BUILD_DIR"/templates/blt || {
- error "You haven't built things yet, have you?"
+ BAIL_OUT "You haven't built things yet, have you?"
}
if ! test -x "$GIT_BUILD_DIR"/t/helper/test-tool$X
then
- echo >&2 'You need to build test-tool:'
- echo >&2 'Run "make t/helper/test-tool" in the source (toplevel) directory'
- exit 1
+ BAIL_OUT 'You need to build test-tool; Run "make t/helper/test-tool" in the source (toplevel) directory'
fi
# Are we running this test at all?
@@ -1408,24 +1538,77 @@ then
test_done
fi
-# skip non-whitelisted tests when compiled with SANITIZE=leak
+BAIL_OUT_ENV_NEEDS_SANITIZE_LEAK () {
+ BAIL_OUT "$1 has no effect except when compiled with SANITIZE=leak"
+}
+
if test -n "$SANITIZE_LEAK"
then
- if test_bool_env GIT_TEST_PASSING_SANITIZE_LEAK false
+ # Normalize with test_bool_env
+ passes_sanitize_leak=
+
+ # We need to see TEST_PASSES_SANITIZE_LEAK in "test-tool
+ # env-helper" (via test_bool_env)
+ export TEST_PASSES_SANITIZE_LEAK
+ if test_bool_env TEST_PASSES_SANITIZE_LEAK false
then
- # We need to see it in "git env--helper" (via
- # test_bool_env)
- export TEST_PASSES_SANITIZE_LEAK
+ passes_sanitize_leak=t
+ fi
+
+ if test "$GIT_TEST_PASSING_SANITIZE_LEAK" = "check"
+ then
+ sanitize_leak_check=t
+ if test -n "$invert_exit_code"
+ then
+ BAIL_OUT "cannot use --invert-exit-code under GIT_TEST_PASSING_SANITIZE_LEAK=check"
+ fi
- if ! test_bool_env TEST_PASSES_SANITIZE_LEAK false
+ if test -z "$passes_sanitize_leak"
then
- skip_all="skipping $this_test under GIT_TEST_PASSING_SANITIZE_LEAK=true"
- test_done
+ say "in GIT_TEST_PASSING_SANITIZE_LEAK=check mode, setting --invert-exit-code for TEST_PASSES_SANITIZE_LEAK != true"
+ invert_exit_code=t
fi
+ elif test -z "$passes_sanitize_leak" &&
+ test_bool_env GIT_TEST_PASSING_SANITIZE_LEAK false
+ then
+ skip_all="skipping $this_test under GIT_TEST_PASSING_SANITIZE_LEAK=true"
+ test_done
fi
-elif test_bool_env GIT_TEST_PASSING_SANITIZE_LEAK false
+
+ if test_bool_env GIT_TEST_SANITIZE_LEAK_LOG false
+ then
+ if ! mkdir -p "$TEST_RESULTS_SAN_DIR"
+ then
+ BAIL_OUT "cannot create $TEST_RESULTS_SAN_DIR"
+ fi &&
+ TEST_RESULTS_SAN_FILE="$TEST_RESULTS_SAN_DIR/$TEST_RESULTS_SAN_FILE_PFX"
+
+ # In case "test-results" is left over from a previous
+ # run: Only report if new leaks show up.
+ TEST_RESULTS_SAN_DIR_NR_LEAKS_STARTUP=$(nr_san_dir_leaks_)
+
+ # Don't litter *.leak dirs if there was nothing to report
+ test_atexit "rmdir \"$TEST_RESULTS_SAN_DIR\" 2>/dev/null || :"
+
+ prepend_var LSAN_OPTIONS : dedup_token_length=9999
+ prepend_var LSAN_OPTIONS : log_exe_name=1
+ prepend_var LSAN_OPTIONS : log_path=\"$TEST_RESULTS_SAN_FILE\"
+ export LSAN_OPTIONS
+ fi
+elif test "$GIT_TEST_PASSING_SANITIZE_LEAK" = "check" ||
+ test_bool_env GIT_TEST_PASSING_SANITIZE_LEAK false
+then
+ BAIL_OUT_ENV_NEEDS_SANITIZE_LEAK "GIT_TEST_PASSING_SANITIZE_LEAK=true"
+elif test_bool_env GIT_TEST_SANITIZE_LEAK_LOG false
+then
+ BAIL_OUT_ENV_NEEDS_SANITIZE_LEAK "GIT_TEST_SANITIZE_LEAK_LOG=true"
+fi
+
+if test "${GIT_TEST_CHAIN_LINT:-1}" != 0 &&
+ test "${GIT_TEST_EXT_CHAIN_LINT:-1}" != 0
then
- BAIL_OUT "GIT_TEST_PASSING_SANITIZE_LEAK=true has no effect except when compiled with SANITIZE=leak"
+ "$PERL_PATH" "$TEST_DIRECTORY/chainlint.pl" "$0" ||
+ BUG "lint error (see '?!...!? annotations above)"
fi
# Last-minute variable setup
@@ -1448,15 +1631,15 @@ remove_trash_directory () {
# Test repository
remove_trash_directory "$TRASH_DIRECTORY" || {
- GIT_EXIT_OK=t
- echo >&5 "FATAL: Cannot prepare test area"
- exit 1
+ BAIL_OUT 'cannot prepare test area'
}
remove_trash=t
if test -z "$TEST_NO_CREATE_REPO"
then
- git init "$TRASH_DIRECTORY" >&3 2>&4 ||
+ git init \
+ ${TEST_CREATE_REPO_NO_TEMPLATE:+--template=} \
+ "$TRASH_DIRECTORY" >&3 2>&4 ||
error "cannot run git init"
else
mkdir -p "$TRASH_DIRECTORY"
@@ -1464,7 +1647,7 @@ fi
# Use -P to resolve symlinks in our working directory so that the cwd
# in subprocesses like git equals our $PWD (for pathname comparisons).
-cd -P "$TRASH_DIRECTORY" || exit 1
+cd -P "$TRASH_DIRECTORY" || BAIL_OUT "cannot cd -P to \"$TRASH_DIRECTORY\""
start_test_output "$0"
@@ -1505,7 +1688,7 @@ yes () {
# The GIT_TEST_FAIL_PREREQS code hooks into test_set_prereq(), and
# thus needs to be set up really early, and set an internal variable
# for convenience so the hot test_set_prereq() codepath doesn't need
-# to call "git env--helper" (via test_bool_env). Only do that work
+# to call "test-tool env-helper" (via test_bool_env). Only do that work
# if needed by seeing if GIT_TEST_FAIL_PREREQS is set at all.
GIT_TEST_FAIL_PREREQS_INTERNAL=
if test -n "$GIT_TEST_FAIL_PREREQS"
@@ -1544,7 +1727,7 @@ case $uname_s in
test_set_prereq SED_STRIPS_CR
test_set_prereq GREP_STRIPS_CR
test_set_prereq WINDOWS
- GIT_TEST_CMP=mingw_test_cmp
+ GIT_TEST_CMP="GIT_DIR=/dev/null git diff --no-index --ignore-cr-at-eol --"
;;
*CYGWIN*)
test_set_prereq POSIXPERM
@@ -1569,7 +1752,16 @@ parisc* | hppa*)
;;
esac
-test_set_prereq REFFILES
+case "$GIT_DEFAULT_REF_FORMAT" in
+files)
+ test_set_prereq REFFILES;;
+reftable)
+ test_set_prereq REFTABLE;;
+*)
+ echo 2>&1 "error: unknown ref format $GIT_DEFAULT_REF_FORMAT"
+ exit 1
+ ;;
+esac
( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1
test -z "$NO_CURL" && test_set_prereq LIBCURL
@@ -1760,8 +1952,8 @@ test_lazy_prereq SHA1 '
esac
'
-test_lazy_prereq ADD_I_USE_BUILTIN '
- test_bool_env GIT_TEST_ADD_I_USE_BUILTIN true
+test_lazy_prereq DEFAULT_REPO_FORMAT '
+ test_have_prereq SHA1,REFFILES
'
# Ensure that no test accidentally triggers a Git command
@@ -1770,6 +1962,7 @@ test_lazy_prereq ADD_I_USE_BUILTIN '
# Tests that verify the scheduler integration must set this locally
# to avoid errors.
GIT_TEST_MAINT_SCHEDULER="none:exit 1"
+export GIT_TEST_MAINT_SCHEDULER
# Does this platform support `git fsmonitor--daemon`
#
diff --git a/t/test-terminal.perl b/t/test-terminal.perl
index 1bcf01a..3810e9b 100755
--- a/t/test-terminal.perl
+++ b/t/test-terminal.perl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-use 5.008;
+use 5.008001;
use strict;
use warnings;
use IO::Pty;
diff --git a/t/unit-tests/.gitignore b/t/unit-tests/.gitignore
new file mode 100644
index 0000000..5e56e04
--- /dev/null
+++ b/t/unit-tests/.gitignore
@@ -0,0 +1 @@
+/bin
diff --git a/t/unit-tests/t-basic.c b/t/unit-tests/t-basic.c
new file mode 100644
index 0000000..fda1ae5
--- /dev/null
+++ b/t/unit-tests/t-basic.c
@@ -0,0 +1,95 @@
+#include "test-lib.h"
+
+/*
+ * The purpose of this "unit test" is to verify a few invariants of the unit
+ * test framework itself, as well as to provide examples of output from actually
+ * failing tests. As such, it is intended that this test fails, and thus it
+ * should not be run as part of `make unit-tests`. Instead, we verify it behaves
+ * as expected in the integration test t0080-unit-test-output.sh
+ */
+
+/* Used to store the return value of check_int(). */
+static int check_res;
+
+/* Used to store the return value of TEST(). */
+static int test_res;
+
+static void t_res(int expect)
+{
+ check_int(check_res, ==, expect);
+ check_int(test_res, ==, expect);
+}
+
+static void t_todo(int x)
+{
+ check_res = TEST_TODO(check(x));
+}
+
+static void t_skip(void)
+{
+ check(0);
+ test_skip("missing prerequisite");
+ check(1);
+}
+
+static int do_skip(void)
+{
+ test_skip("missing prerequisite");
+ return 1;
+}
+
+static void t_skip_todo(void)
+{
+ check_res = TEST_TODO(do_skip());
+}
+
+static void t_todo_after_fail(void)
+{
+ check(0);
+ TEST_TODO(check(0));
+}
+
+static void t_fail_after_todo(void)
+{
+ check(1);
+ TEST_TODO(check(0));
+ check(0);
+}
+
+static void t_messages(void)
+{
+ check_str("\thello\\", "there\"\n");
+ check_str("NULL", NULL);
+ check_char('a', ==, '\n');
+ check_char('\\', ==, '\'');
+}
+
+static void t_empty(void)
+{
+ ; /* empty */
+}
+
+int cmd_main(int argc, const char **argv)
+{
+ test_res = TEST(check_res = check_int(1, ==, 1), "passing test");
+ TEST(t_res(1), "passing test and assertion return 1");
+ test_res = TEST(check_res = check_int(1, ==, 2), "failing test");
+ TEST(t_res(0), "failing test and assertion return 0");
+ test_res = TEST(t_todo(0), "passing TEST_TODO()");
+ TEST(t_res(1), "passing TEST_TODO() returns 1");
+ test_res = TEST(t_todo(1), "failing TEST_TODO()");
+ TEST(t_res(0), "failing TEST_TODO() returns 0");
+ test_res = TEST(t_skip(), "test_skip()");
+ TEST(check_int(test_res, ==, 1), "skipped test returns 1");
+ test_res = TEST(t_skip_todo(), "test_skip() inside TEST_TODO()");
+ TEST(t_res(1), "test_skip() inside TEST_TODO() returns 1");
+ test_res = TEST(t_todo_after_fail(), "TEST_TODO() after failing check");
+ TEST(check_int(test_res, ==, 0), "TEST_TODO() after failing check returns 0");
+ test_res = TEST(t_fail_after_todo(), "failing check after TEST_TODO()");
+ TEST(check_int(test_res, ==, 0), "failing check after TEST_TODO() returns 0");
+ TEST(t_messages(), "messages from failing string and char comparison");
+ test_res = TEST(t_empty(), "test with no checks");
+ TEST(check_int(test_res, ==, 0), "test with no checks returns 0");
+
+ return test_done();
+}
diff --git a/t/unit-tests/t-ctype.c b/t/unit-tests/t-ctype.c
new file mode 100644
index 0000000..d6ac1fe
--- /dev/null
+++ b/t/unit-tests/t-ctype.c
@@ -0,0 +1,53 @@
+#include "test-lib.h"
+
+#define TEST_CHAR_CLASS(class, string) do { \
+ size_t len = ARRAY_SIZE(string) - 1 + \
+ BUILD_ASSERT_OR_ZERO(ARRAY_SIZE(string) > 0) + \
+ BUILD_ASSERT_OR_ZERO(sizeof(string[0]) == sizeof(char)); \
+ int skip = test__run_begin(); \
+ if (!skip) { \
+ for (int i = 0; i < 256; i++) { \
+ if (!check_int(class(i), ==, !!memchr(string, i, len)))\
+ test_msg(" i: 0x%02x", i); \
+ } \
+ check(!class(EOF)); \
+ } \
+ test__run_end(!skip, TEST_LOCATION(), #class " works"); \
+} while (0)
+
+#define DIGIT "0123456789"
+#define LOWER "abcdefghijklmnopqrstuvwxyz"
+#define UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+#define PUNCT "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
+#define ASCII \
+ "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" \
+ "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" \
+ "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f" \
+ "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f" \
+ "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f" \
+ "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f" \
+ "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f" \
+ "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+#define CNTRL \
+ "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" \
+ "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" \
+ "\x7f"
+
+int cmd_main(int argc, const char **argv) {
+ TEST_CHAR_CLASS(isspace, " \n\r\t");
+ TEST_CHAR_CLASS(isdigit, DIGIT);
+ TEST_CHAR_CLASS(isalpha, LOWER UPPER);
+ TEST_CHAR_CLASS(isalnum, LOWER UPPER DIGIT);
+ TEST_CHAR_CLASS(is_glob_special, "*?[\\");
+ TEST_CHAR_CLASS(is_regex_special, "$()*+.?[\\^{|");
+ TEST_CHAR_CLASS(is_pathspec_magic, "!\"#%&',-/:;<=>@_`~");
+ TEST_CHAR_CLASS(isascii, ASCII);
+ TEST_CHAR_CLASS(islower, LOWER);
+ TEST_CHAR_CLASS(isupper, UPPER);
+ TEST_CHAR_CLASS(iscntrl, CNTRL);
+ TEST_CHAR_CLASS(ispunct, PUNCT);
+ TEST_CHAR_CLASS(isxdigit, DIGIT "abcdefABCDEF");
+ TEST_CHAR_CLASS(isprint, LOWER UPPER DIGIT PUNCT " ");
+
+ return test_done();
+}
diff --git a/t/unit-tests/t-mem-pool.c b/t/unit-tests/t-mem-pool.c
new file mode 100644
index 0000000..a0d57df
--- /dev/null
+++ b/t/unit-tests/t-mem-pool.c
@@ -0,0 +1,31 @@
+#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, const char **argv)
+{
+ 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
new file mode 100644
index 0000000..7a4e578
--- /dev/null
+++ b/t/unit-tests/t-prio-queue.c
@@ -0,0 +1,91 @@
+#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, const char **argv)
+{
+ 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-strbuf.c b/t/unit-tests/t-strbuf.c
new file mode 100644
index 0000000..de434a4
--- /dev/null
+++ b/t/unit-tests/t-strbuf.c
@@ -0,0 +1,120 @@
+#include "test-lib.h"
+#include "strbuf.h"
+
+/* wrapper that supplies tests with an empty, initialized strbuf */
+static void setup(void (*f)(struct strbuf*, void*), void *data)
+{
+ struct strbuf buf = STRBUF_INIT;
+
+ f(&buf, data);
+ strbuf_release(&buf);
+ check_uint(buf.len, ==, 0);
+ check_uint(buf.alloc, ==, 0);
+}
+
+/* wrapper that supplies tests with a populated, initialized strbuf */
+static void setup_populated(void (*f)(struct strbuf*, void*), char *init_str, void *data)
+{
+ struct strbuf buf = STRBUF_INIT;
+
+ strbuf_addstr(&buf, init_str);
+ check_uint(buf.len, ==, strlen(init_str));
+ f(&buf, data);
+ strbuf_release(&buf);
+ check_uint(buf.len, ==, 0);
+ check_uint(buf.alloc, ==, 0);
+}
+
+static int assert_sane_strbuf(struct strbuf *buf)
+{
+ /* Initialized strbufs should always have a non-NULL buffer */
+ if (!check(!!buf->buf))
+ return 0;
+ /* Buffers should always be NUL-terminated */
+ if (!check_char(buf->buf[buf->len], ==, '\0'))
+ return 0;
+ /*
+ * Freshly-initialized strbufs may not have a dynamically allocated
+ * buffer
+ */
+ if (buf->len == 0 && buf->alloc == 0)
+ return 1;
+ /* alloc must be at least one byte larger than len */
+ return check_uint(buf->len, <, buf->alloc);
+}
+
+static void t_static_init(void)
+{
+ struct strbuf buf = STRBUF_INIT;
+
+ check_uint(buf.len, ==, 0);
+ check_uint(buf.alloc, ==, 0);
+ check_char(buf.buf[0], ==, '\0');
+}
+
+static void t_dynamic_init(void)
+{
+ struct strbuf buf;
+
+ strbuf_init(&buf, 1024);
+ check(assert_sane_strbuf(&buf));
+ check_uint(buf.len, ==, 0);
+ check_uint(buf.alloc, >=, 1024);
+ check_char(buf.buf[0], ==, '\0');
+ strbuf_release(&buf);
+}
+
+static void t_addch(struct strbuf *buf, void *data)
+{
+ const char *p_ch = data;
+ const char ch = *p_ch;
+ size_t orig_alloc = buf->alloc;
+ size_t orig_len = buf->len;
+
+ if (!check(assert_sane_strbuf(buf)))
+ return;
+ strbuf_addch(buf, ch);
+ if (!check(assert_sane_strbuf(buf)))
+ return;
+ if (!(check_uint(buf->len, ==, orig_len + 1) &&
+ check_uint(buf->alloc, >=, orig_alloc)))
+ return; /* avoid de-referencing buf->buf */
+ check_char(buf->buf[buf->len - 1], ==, ch);
+ check_char(buf->buf[buf->len], ==, '\0');
+}
+
+static void t_addstr(struct strbuf *buf, void *data)
+{
+ const char *text = data;
+ size_t len = strlen(text);
+ size_t orig_alloc = buf->alloc;
+ size_t orig_len = buf->len;
+
+ if (!check(assert_sane_strbuf(buf)))
+ return;
+ strbuf_addstr(buf, text);
+ if (!check(assert_sane_strbuf(buf)))
+ return;
+ if (!(check_uint(buf->len, ==, orig_len + len) &&
+ check_uint(buf->alloc, >=, orig_alloc) &&
+ check_uint(buf->alloc, >, orig_len + len) &&
+ check_char(buf->buf[orig_len + len], ==, '\0')))
+ return;
+ check_str(buf->buf + orig_len, text);
+}
+
+int cmd_main(int argc, const char **argv)
+{
+ if (!TEST(t_static_init(), "static initialization works"))
+ test_skip_all("STRBUF_INIT is broken");
+ TEST(t_dynamic_init(), "dynamic initialization works");
+ TEST(setup(t_addch, "a"), "strbuf_addch adds char");
+ TEST(setup(t_addch, ""), "strbuf_addch adds NUL char");
+ TEST(setup_populated(t_addch, "initial value", "a"),
+ "strbuf_addch appends to initial value");
+ TEST(setup(t_addstr, "hello there"), "strbuf_addstr adds string");
+ TEST(setup_populated(t_addstr, "initial value", "hello there"),
+ "strbuf_addstr appends string to initial value");
+
+ return test_done();
+}
diff --git a/t/unit-tests/test-lib.c b/t/unit-tests/test-lib.c
new file mode 100644
index 0000000..66d6980
--- /dev/null
+++ b/t/unit-tests/test-lib.c
@@ -0,0 +1,407 @@
+#include "test-lib.h"
+
+enum result {
+ RESULT_NONE,
+ RESULT_FAILURE,
+ RESULT_SKIP,
+ RESULT_SUCCESS,
+ RESULT_TODO
+};
+
+static struct {
+ enum result result;
+ int count;
+ unsigned failed :1;
+ unsigned lazy_plan :1;
+ unsigned running :1;
+ unsigned skip_all :1;
+ unsigned todo :1;
+} ctx = {
+ .lazy_plan = 1,
+ .result = RESULT_NONE,
+};
+
+/*
+ * Visual C interpolates the absolute Windows path for `__FILE__`,
+ * but we want to see relative paths, as verified by t0080.
+ * There are other compilers that do the same, and are not for
+ * Windows.
+ */
+#include "dir.h"
+
+static const char *make_relative(const char *location)
+{
+ static char prefix[] = __FILE__, buf[PATH_MAX], *p;
+ static size_t prefix_len;
+ static int need_bs_to_fs = -1;
+
+ /* one-time preparation */
+ if (need_bs_to_fs < 0) {
+ size_t len = strlen(prefix);
+ char needle[] = "t\\unit-tests\\test-lib.c";
+ size_t needle_len = strlen(needle);
+
+ if (len < needle_len)
+ die("unexpected prefix '%s'", prefix);
+
+ /*
+ * The path could be relative (t/unit-tests/test-lib.c)
+ * or full (/home/user/git/t/unit-tests/test-lib.c).
+ * Check the slash between "t" and "unit-tests".
+ */
+ prefix_len = len - needle_len;
+ if (prefix[prefix_len + 1] == '/') {
+ /* Oh, we're not Windows */
+ for (size_t i = 0; i < needle_len; i++)
+ if (needle[i] == '\\')
+ needle[i] = '/';
+ need_bs_to_fs = 0;
+ } else {
+ need_bs_to_fs = 1;
+ }
+
+ /*
+ * prefix_len == 0 if the compiler gives paths relative
+ * to the root of the working tree. Otherwise, we want
+ * to see that we did find the needle[] at a directory
+ * boundary. Again we rely on that needle[] begins with
+ * "t" followed by the directory separator.
+ */
+ if (fspathcmp(needle, prefix + prefix_len) ||
+ (prefix_len && prefix[prefix_len - 1] != needle[1]))
+ die("unexpected suffix of '%s'", prefix);
+ }
+
+ /*
+ * Does it not start with the expected prefix?
+ * Return it as-is without making it worse.
+ */
+ if (prefix_len && fspathncmp(location, prefix, prefix_len))
+ return location;
+
+ /*
+ * If we do not need to munge directory separator, we can return
+ * the substring at the tail of the location.
+ */
+ if (!need_bs_to_fs)
+ return location + prefix_len;
+
+ /* convert backslashes to forward slashes */
+ strlcpy(buf, location + prefix_len, sizeof(buf));
+ for (p = buf; *p; p++)
+ if (*p == '\\')
+ *p = '/';
+ return buf;
+}
+
+static void msg_with_prefix(const char *prefix, const char *format, va_list ap)
+{
+ fflush(stderr);
+ if (prefix)
+ fprintf(stdout, "%s", prefix);
+ vprintf(format, ap); /* TODO: handle newlines */
+ putc('\n', stdout);
+ fflush(stdout);
+}
+
+void test_msg(const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ msg_with_prefix("# ", format, ap);
+ va_end(ap);
+}
+
+void test_plan(int count)
+{
+ assert(!ctx.running);
+
+ fflush(stderr);
+ printf("1..%d\n", count);
+ fflush(stdout);
+ ctx.lazy_plan = 0;
+}
+
+int test_done(void)
+{
+ assert(!ctx.running);
+
+ if (ctx.lazy_plan)
+ test_plan(ctx.count);
+
+ return ctx.failed;
+}
+
+void test_skip(const char *format, ...)
+{
+ va_list ap;
+
+ assert(ctx.running);
+
+ ctx.result = RESULT_SKIP;
+ va_start(ap, format);
+ if (format)
+ msg_with_prefix("# skipping test - ", format, ap);
+ va_end(ap);
+}
+
+void test_skip_all(const char *format, ...)
+{
+ va_list ap;
+ const char *prefix;
+
+ if (!ctx.count && ctx.lazy_plan) {
+ /* We have not printed a test plan yet */
+ prefix = "1..0 # SKIP ";
+ ctx.lazy_plan = 0;
+ } else {
+ /* We have already printed a test plan */
+ prefix = "Bail out! # ";
+ ctx.failed = 1;
+ }
+ ctx.skip_all = 1;
+ ctx.result = RESULT_SKIP;
+ va_start(ap, format);
+ msg_with_prefix(prefix, format, ap);
+ va_end(ap);
+}
+
+int test__run_begin(void)
+{
+ assert(!ctx.running);
+
+ ctx.count++;
+ ctx.result = RESULT_NONE;
+ ctx.running = 1;
+
+ return ctx.skip_all;
+}
+
+static void print_description(const char *format, va_list ap)
+{
+ if (format) {
+ fputs(" - ", stdout);
+ vprintf(format, ap);
+ }
+}
+
+int test__run_end(int was_run UNUSED, const char *location, const char *format, ...)
+{
+ va_list ap;
+
+ assert(ctx.running);
+ assert(!ctx.todo);
+
+ fflush(stderr);
+ va_start(ap, format);
+ if (!ctx.skip_all) {
+ switch (ctx.result) {
+ case RESULT_SUCCESS:
+ printf("ok %d", ctx.count);
+ print_description(format, ap);
+ break;
+
+ case RESULT_FAILURE:
+ printf("not ok %d", ctx.count);
+ print_description(format, ap);
+ break;
+
+ case RESULT_TODO:
+ printf("not ok %d", ctx.count);
+ print_description(format, ap);
+ printf(" # TODO");
+ break;
+
+ case RESULT_SKIP:
+ printf("ok %d", ctx.count);
+ print_description(format, ap);
+ printf(" # SKIP");
+ break;
+
+ case RESULT_NONE:
+ test_msg("BUG: test has no checks at %s",
+ make_relative(location));
+ printf("not ok %d", ctx.count);
+ print_description(format, ap);
+ ctx.result = RESULT_FAILURE;
+ break;
+ }
+ }
+ va_end(ap);
+ ctx.running = 0;
+ if (ctx.skip_all)
+ return 1;
+ putc('\n', stdout);
+ fflush(stdout);
+ ctx.failed |= ctx.result == RESULT_FAILURE;
+
+ return ctx.result != RESULT_FAILURE;
+}
+
+static void test_fail(void)
+{
+ assert(ctx.result != RESULT_SKIP);
+
+ ctx.result = RESULT_FAILURE;
+}
+
+static void test_pass(void)
+{
+ assert(ctx.result != RESULT_SKIP);
+
+ if (ctx.result == RESULT_NONE)
+ ctx.result = RESULT_SUCCESS;
+}
+
+static void test_todo(void)
+{
+ assert(ctx.result != RESULT_SKIP);
+
+ if (ctx.result != RESULT_FAILURE)
+ ctx.result = RESULT_TODO;
+}
+
+int test_assert(const char *location, const char *check, int ok)
+{
+ assert(ctx.running);
+
+ if (ctx.result == RESULT_SKIP) {
+ test_msg("skipping check '%s' at %s", check,
+ make_relative(location));
+ return 1;
+ }
+ if (!ctx.todo) {
+ if (ok) {
+ test_pass();
+ } else {
+ test_msg("check \"%s\" failed at %s", check,
+ make_relative(location));
+ test_fail();
+ }
+ }
+
+ return !!ok;
+}
+
+void test__todo_begin(void)
+{
+ assert(ctx.running);
+ assert(!ctx.todo);
+
+ ctx.todo = 1;
+}
+
+int test__todo_end(const char *location, const char *check, int res)
+{
+ assert(ctx.running);
+ assert(ctx.todo);
+
+ ctx.todo = 0;
+ if (ctx.result == RESULT_SKIP)
+ return 1;
+ if (res) {
+ test_msg("todo check '%s' succeeded at %s", check,
+ make_relative(location));
+ test_fail();
+ } else {
+ test_todo();
+ }
+
+ return !res;
+}
+
+int check_bool_loc(const char *loc, const char *check, int ok)
+{
+ return test_assert(loc, check, ok);
+}
+
+union test__tmp test__tmp[2];
+
+int check_int_loc(const char *loc, const char *check, int ok,
+ intmax_t a, intmax_t b)
+{
+ int ret = test_assert(loc, check, ok);
+
+ if (!ret) {
+ test_msg(" left: %"PRIdMAX, a);
+ test_msg(" right: %"PRIdMAX, b);
+ }
+
+ return ret;
+}
+
+int check_uint_loc(const char *loc, const char *check, int ok,
+ uintmax_t a, uintmax_t b)
+{
+ int ret = test_assert(loc, check, ok);
+
+ if (!ret) {
+ test_msg(" left: %"PRIuMAX, a);
+ test_msg(" right: %"PRIuMAX, b);
+ }
+
+ return ret;
+}
+
+static void print_one_char(char ch, char quote)
+{
+ if ((unsigned char)ch < 0x20u || ch == 0x7f) {
+ /* TODO: improve handling of \a, \b, \f ... */
+ printf("\\%03o", (unsigned char)ch);
+ } else {
+ if (ch == '\\' || ch == quote)
+ putc('\\', stdout);
+ putc(ch, stdout);
+ }
+}
+
+static void print_char(const char *prefix, char ch)
+{
+ printf("# %s: '", prefix);
+ print_one_char(ch, '\'');
+ fputs("'\n", stdout);
+}
+
+int check_char_loc(const char *loc, const char *check, int ok, char a, char b)
+{
+ int ret = test_assert(loc, check, ok);
+
+ if (!ret) {
+ fflush(stderr);
+ print_char(" left", a);
+ print_char(" right", b);
+ fflush(stdout);
+ }
+
+ return ret;
+}
+
+static void print_str(const char *prefix, const char *str)
+{
+ printf("# %s: ", prefix);
+ if (!str) {
+ fputs("NULL\n", stdout);
+ } else {
+ putc('"', stdout);
+ while (*str)
+ print_one_char(*str++, '"');
+ fputs("\"\n", stdout);
+ }
+}
+
+int check_str_loc(const char *loc, const char *check,
+ const char *a, const char *b)
+{
+ int ok = (!a && !b) || (a && b && !strcmp(a, b));
+ int ret = test_assert(loc, check, ok);
+
+ if (!ret) {
+ fflush(stderr);
+ print_str(" left", a);
+ print_str(" right", b);
+ fflush(stdout);
+ }
+
+ return ret;
+}
diff --git a/t/unit-tests/test-lib.h b/t/unit-tests/test-lib.h
new file mode 100644
index 0000000..a8f07ae
--- /dev/null
+++ b/t/unit-tests/test-lib.h
@@ -0,0 +1,149 @@
+#ifndef TEST_LIB_H
+#define TEST_LIB_H
+
+#include "git-compat-util.h"
+
+/*
+ * Run a test function, returns 1 if the test succeeds, 0 if it
+ * fails. If test_skip_all() has been called then the test will not be
+ * run. The description for each test should be unique. For example:
+ *
+ * TEST(test_something(arg1, arg2), "something %d %d", arg1, arg2)
+ */
+#define TEST(t, ...) \
+ test__run_end(test__run_begin() ? 0 : (t, 1), \
+ TEST_LOCATION(), __VA_ARGS__)
+
+/*
+ * Print a test plan, should be called before any tests. If the number
+ * of tests is not known in advance test_done() will automatically
+ * print a plan at the end of the test program.
+ */
+void test_plan(int count);
+
+/*
+ * test_done() must be called at the end of main(). It will print the
+ * plan if plan() was not called at the beginning of the test program
+ * and returns the exit code for the test program.
+ */
+int test_done(void);
+
+/* Skip the current test. */
+__attribute__((format (printf, 1, 2)))
+void test_skip(const char *format, ...);
+
+/* Skip all remaining tests. */
+__attribute__((format (printf, 1, 2)))
+void test_skip_all(const char *format, ...);
+
+/* Print a diagnostic message to stdout. */
+__attribute__((format (printf, 1, 2)))
+void test_msg(const char *format, ...);
+
+/*
+ * Test checks are built around test_assert(). checks return 1 on
+ * success, 0 on failure. If any check fails then the test will fail. To
+ * create a custom check define a function that wraps test_assert() and
+ * a macro to wrap that function to provide a source location and
+ * stringified arguments. Custom checks that take pointer arguments
+ * should be careful to check that they are non-NULL before
+ * dereferencing them. For example:
+ *
+ * static int check_oid_loc(const char *loc, const char *check,
+ * struct object_id *a, struct object_id *b)
+ * {
+ * int res = test_assert(loc, check, a && b && oideq(a, b));
+ *
+ * if (!res) {
+ * test_msg(" left: %s", a ? oid_to_hex(a) : "NULL";
+ * test_msg(" right: %s", b ? oid_to_hex(a) : "NULL";
+ *
+ * }
+ * return res;
+ * }
+ *
+ * #define check_oid(a, b) \
+ * check_oid_loc(TEST_LOCATION(), "oideq("#a", "#b")", a, b)
+ */
+int test_assert(const char *location, const char *check, int ok);
+
+/* Helper macro to pass the location to checks */
+#define TEST_LOCATION() TEST__MAKE_LOCATION(__LINE__)
+
+/* Check a boolean condition. */
+#define check(x) \
+ check_bool_loc(TEST_LOCATION(), #x, x)
+int check_bool_loc(const char *loc, const char *check, int ok);
+
+/*
+ * Compare two integers. Prints a message with the two values if the
+ * comparison fails. NB this is not thread safe.
+ */
+#define check_int(a, op, b) \
+ (test__tmp[0].i = (a), test__tmp[1].i = (b), \
+ check_int_loc(TEST_LOCATION(), #a" "#op" "#b, \
+ test__tmp[0].i op test__tmp[1].i, \
+ test__tmp[0].i, test__tmp[1].i))
+int check_int_loc(const char *loc, const char *check, int ok,
+ intmax_t a, intmax_t b);
+
+/*
+ * Compare two unsigned integers. Prints a message with the two values
+ * if the comparison fails. NB this is not thread safe.
+ */
+#define check_uint(a, op, b) \
+ (test__tmp[0].u = (a), test__tmp[1].u = (b), \
+ check_uint_loc(TEST_LOCATION(), #a" "#op" "#b, \
+ test__tmp[0].u op test__tmp[1].u, \
+ test__tmp[0].u, test__tmp[1].u))
+int check_uint_loc(const char *loc, const char *check, int ok,
+ uintmax_t a, uintmax_t b);
+
+/*
+ * Compare two chars. Prints a message with the two values if the
+ * comparison fails. NB this is not thread safe.
+ */
+#define check_char(a, op, b) \
+ (test__tmp[0].c = (a), test__tmp[1].c = (b), \
+ check_char_loc(TEST_LOCATION(), #a" "#op" "#b, \
+ test__tmp[0].c op test__tmp[1].c, \
+ test__tmp[0].c, test__tmp[1].c))
+int check_char_loc(const char *loc, const char *check, int ok,
+ char a, char b);
+
+/* Check whether two strings are equal. */
+#define check_str(a, b) \
+ check_str_loc(TEST_LOCATION(), "!strcmp("#a", "#b")", a, b)
+int check_str_loc(const char *loc, const char *check,
+ const char *a, const char *b);
+
+/*
+ * Wrap a check that is known to fail. If the check succeeds then the
+ * test will fail. Returns 1 if the check fails, 0 if it
+ * succeeds. For example:
+ *
+ * TEST_TODO(check(0));
+ */
+#define TEST_TODO(check) \
+ (test__todo_begin(), test__todo_end(TEST_LOCATION(), #check, check))
+
+/* Private helpers */
+
+#define TEST__STR(x) #x
+#define TEST__MAKE_LOCATION(line) __FILE__ ":" TEST__STR(line)
+
+union test__tmp {
+ intmax_t i;
+ uintmax_t u;
+ char c;
+};
+
+extern union test__tmp test__tmp[2];
+
+int test__run_begin(void);
+__attribute__((format (printf, 3, 4)))
+int test__run_end(int, const char *, const char *, ...);
+void test__todo_begin(void);
+int test__todo_end(const char *, const char *, int);
+
+#endif /* TEST_LIB_H */
diff --git a/t/valgrind/valgrind.sh b/t/valgrind/valgrind.sh
index 669ebaf..3c8ee19 100755
--- a/t/valgrind/valgrind.sh
+++ b/t/valgrind/valgrind.sh
@@ -23,7 +23,7 @@ memcheck)
VALGRIND_MAJOR=$(expr "$VALGRIND_VERSION" : '[^0-9]*\([0-9]*\)')
VALGRIND_MINOR=$(expr "$VALGRIND_VERSION" : '[^0-9]*[0-9]*\.\([0-9]*\)')
test 3 -gt "$VALGRIND_MAJOR" ||
- test 3 -eq "$VALGRIND_MAJOR" -a 4 -gt "$VALGRIND_MINOR" ||
+ { test 3 -eq "$VALGRIND_MAJOR" && test 4 -gt "$VALGRIND_MINOR"; } ||
TOOL_OPTIONS="$TOOL_OPTIONS --track-origins=yes"
;;
*)
diff --git a/tag.c b/tag.c
index dfbcd7f..fc3834d 100644
--- a/tag.c
+++ b/tag.c
@@ -1,11 +1,14 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "environment.h"
#include "tag.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "commit.h"
#include "tree.h"
#include "blob.h"
#include "alloc.h"
#include "gpg-interface.h"
+#include "hex.h"
#include "packfile.h"
const char *tag_type = "tag";
@@ -51,15 +54,15 @@ int gpg_verify_tag(const struct object_id *oid, const char *name_to_report,
return error("%s: cannot verify a non-tag object of type %s.",
name_to_report ?
name_to_report :
- find_unique_abbrev(oid, DEFAULT_ABBREV),
+ repo_find_unique_abbrev(the_repository, oid, DEFAULT_ABBREV),
type_name(type));
- buf = read_object_file(oid, &type, &size);
+ buf = repo_read_object_file(the_repository, oid, &type, &size);
if (!buf)
return error("%s: unable to read file.",
name_to_report ?
name_to_report :
- find_unique_abbrev(oid, DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, oid, DEFAULT_ABBREV));
ret = run_gpg_verify(buf, size, flags);
@@ -216,7 +219,8 @@ int parse_tag(struct tag *item)
if (item->object.parsed)
return 0;
- data = read_object_file(&item->object.oid, &type, &size);
+ data = repo_read_object_file(the_repository, &item->object.oid, &type,
+ &size);
if (!data)
return error("Could not read %s",
oid_to_hex(&item->object.oid));
diff --git a/tempfile.c b/tempfile.c
index 2024c82..ed88cf8 100644
--- a/tempfile.c
+++ b/tempfile.c
@@ -14,16 +14,14 @@
*
* The possible states of a `tempfile` object are as follows:
*
- * - Uninitialized. In this state the object's `on_list` field must be
- * zero but the rest of its contents need not be initialized. As
- * soon as the object is used in any way, it is irrevocably
- * registered in `tempfile_list`, and `on_list` is set.
+ * - Inactive/unallocated. The only way to get a tempfile is via a creation
+ * function like create_tempfile(). Once allocated, the tempfile is on the
+ * global tempfile_list and considered active.
*
* - Active, file open (after `create_tempfile()` or
* `reopen_tempfile()`). In this state:
*
* - the temporary file exists
- * - `active` is set
* - `filename` holds the filename of the temporary file
* - `fd` holds a file descriptor open for writing to it
* - `fp` holds a pointer to an open `FILE` object if and only if
@@ -35,14 +33,8 @@
* `fd` is -1, and `fp` is `NULL`.
*
* - Inactive (after `delete_tempfile()`, `rename_tempfile()`, or a
- * failed attempt to create a temporary file). In this state:
- *
- * - `active` is unset
- * - `filename` is empty (usually, though there are transitory
- * states in which this condition doesn't hold). Client code should
- * *not* rely on the filename being empty in this state.
- * - `fd` is -1 and `fp` is `NULL`
- * - the object is removed from `tempfile_list` (but could be used again)
+ * failed attempt to create a temporary file). The struct is removed from
+ * the global tempfile_list and deallocated.
*
* A temporary file is owned by the process that created it. The
* `tempfile` has an `owner` field that records the owner's PID. This
@@ -50,24 +42,25 @@
* file created by its parent.
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "path.h"
#include "tempfile.h"
#include "sigchain.h"
static VOLATILE_LIST_HEAD(tempfile_list);
-static void remove_template_directory(struct tempfile *tempfile,
+static int remove_template_directory(struct tempfile *tempfile,
int in_signal_handler)
{
- if (tempfile->directorylen > 0 &&
- tempfile->directorylen < tempfile->filename.len &&
- tempfile->filename.buf[tempfile->directorylen] == '/') {
- strbuf_setlen(&tempfile->filename, tempfile->directorylen);
+ if (tempfile->directory) {
if (in_signal_handler)
- rmdir(tempfile->filename.buf);
+ return rmdir(tempfile->directory);
else
- rmdir_or_warn(tempfile->filename.buf);
+ return rmdir_or_warn(tempfile->directory);
}
+
+ return 0;
}
static void remove_tempfiles(int in_signal_handler)
@@ -89,8 +82,6 @@ static void remove_tempfiles(int in_signal_handler)
else
unlink_or_warn(p->filename.buf);
remove_template_directory(p, in_signal_handler);
-
- p->active = 0;
}
}
@@ -111,11 +102,10 @@ static struct tempfile *new_tempfile(void)
struct tempfile *tempfile = xmalloc(sizeof(*tempfile));
tempfile->fd = -1;
tempfile->fp = NULL;
- tempfile->active = 0;
tempfile->owner = 0;
INIT_LIST_HEAD(&tempfile->list);
strbuf_init(&tempfile->filename, 0);
- tempfile->directorylen = 0;
+ tempfile->directory = NULL;
return tempfile;
}
@@ -123,9 +113,6 @@ static void activate_tempfile(struct tempfile *tempfile)
{
static int initialized;
- if (is_tempfile_active(tempfile))
- BUG("activate_tempfile called for active object");
-
if (!initialized) {
sigchain_push_common(remove_tempfiles_on_signal);
atexit(remove_tempfiles_on_exit);
@@ -134,14 +121,13 @@ static void activate_tempfile(struct tempfile *tempfile)
volatile_list_add(&tempfile->list, &tempfile_list);
tempfile->owner = getpid();
- tempfile->active = 1;
}
static void deactivate_tempfile(struct tempfile *tempfile)
{
- tempfile->active = 0;
- strbuf_release(&tempfile->filename);
volatile_list_del(&tempfile->list);
+ strbuf_release(&tempfile->filename);
+ free(tempfile->directory);
free(tempfile);
}
@@ -254,7 +240,7 @@ struct tempfile *mks_tempfile_dt(const char *directory_template,
tempfile = new_tempfile();
strbuf_swap(&tempfile->filename, &sb);
- tempfile->directorylen = directorylen;
+ tempfile->directory = xmemdupz(tempfile->filename.buf, directorylen);
tempfile->fd = fd;
activate_tempfile(tempfile);
return tempfile;
@@ -369,16 +355,19 @@ int rename_tempfile(struct tempfile **tempfile_p, const char *path)
return 0;
}
-void delete_tempfile(struct tempfile **tempfile_p)
+int delete_tempfile(struct tempfile **tempfile_p)
{
struct tempfile *tempfile = *tempfile_p;
+ int err = 0;
if (!is_tempfile_active(tempfile))
- return;
+ return 0;
- close_tempfile_gently(tempfile);
- unlink_or_warn(tempfile->filename.buf);
- remove_template_directory(tempfile, 0);
+ err |= close_tempfile_gently(tempfile);
+ err |= unlink_or_warn(tempfile->filename.buf);
+ err |= remove_template_directory(tempfile, 0);
deactivate_tempfile(tempfile);
*tempfile_p = NULL;
+
+ return err ? -1 : 0;
}
diff --git a/tempfile.h b/tempfile.h
index d7804a2..2d2ae5b 100644
--- a/tempfile.h
+++ b/tempfile.h
@@ -77,12 +77,11 @@
struct tempfile {
volatile struct volatile_list_head list;
- volatile sig_atomic_t active;
volatile int fd;
FILE *volatile fp;
volatile pid_t owner;
struct strbuf filename;
- size_t directorylen;
+ char *directory;
};
/*
@@ -221,7 +220,7 @@ FILE *fdopen_tempfile(struct tempfile *tempfile, const char *mode);
static inline int is_tempfile_active(struct tempfile *tempfile)
{
- return tempfile && tempfile->active;
+ return !!tempfile;
}
/*
@@ -270,7 +269,7 @@ int reopen_tempfile(struct tempfile *tempfile);
* `delete_tempfile()` for a `tempfile` object that has already been
* deleted or renamed.
*/
-void delete_tempfile(struct tempfile **tempfile_p);
+int delete_tempfile(struct tempfile **tempfile_p);
/*
* Close the file descriptor and/or file pointer if they are still
diff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample
index e144712..29ed5ee 100755
--- a/templates/hooks--pre-commit.sample
+++ b/templates/hooks--pre-commit.sample
@@ -28,7 +28,7 @@ if [ "$allownonascii" != "true" ] &&
# Note that the use of brackets around a tr range is ok here, (it's
# even required, for portability to Solaris 10's /usr/bin/tr), since
# the square bracket bytes happen to fall in the designated range.
- test $(git diff --cached --name-only --diff-filter=A -z $against |
+ test $(git diff-index --cached --name-only --diff-filter=A -z $against |
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
then
cat <<\EOF
diff --git a/templates/hooks--sendemail-validate.sample b/templates/hooks--sendemail-validate.sample
new file mode 100755
index 0000000..640bcf8
--- /dev/null
+++ b/templates/hooks--sendemail-validate.sample
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+# An example hook script to validate a patch (and/or patch series) before
+# sending it via email.
+#
+# The hook should exit with non-zero status after issuing an appropriate
+# message if it wants to prevent the email(s) from being sent.
+#
+# To enable this hook, rename this file to "sendemail-validate".
+#
+# By default, it will only check that the patch(es) can be applied on top of
+# the default upstream branch without conflicts in a secondary worktree. After
+# validation (successful or not) of the last patch of a series, the worktree
+# will be deleted.
+#
+# The following config variables can be set to change the default remote and
+# remote ref that are used to apply the patches against:
+#
+# sendemail.validateRemote (default: origin)
+# sendemail.validateRemoteRef (default: HEAD)
+#
+# Replace the TODO placeholders with appropriate checks according to your
+# needs.
+
+validate_cover_letter () {
+ file="$1"
+ # TODO: Replace with appropriate checks (e.g. spell checking).
+ true
+}
+
+validate_patch () {
+ file="$1"
+ # Ensure that the patch applies without conflicts.
+ git am -3 "$file" || return
+ # TODO: Replace with appropriate checks for this patch
+ # (e.g. checkpatch.pl).
+ true
+}
+
+validate_series () {
+ # TODO: Replace with appropriate checks for the whole series
+ # (e.g. quick build, coding style checks, etc.).
+ true
+}
+
+# main -------------------------------------------------------------------------
+
+if test "$GIT_SENDEMAIL_FILE_COUNTER" = 1
+then
+ remote=$(git config --default origin --get sendemail.validateRemote) &&
+ ref=$(git config --default HEAD --get sendemail.validateRemoteRef) &&
+ worktree=$(mktemp --tmpdir -d sendemail-validate.XXXXXXX) &&
+ git worktree add -fd --checkout "$worktree" "refs/remotes/$remote/$ref" &&
+ git config --replace-all sendemail.validateWorktree "$worktree"
+else
+ worktree=$(git config --get sendemail.validateWorktree)
+fi || {
+ echo "sendemail-validate: error: failed to prepare worktree" >&2
+ exit 1
+}
+
+unset GIT_DIR GIT_WORK_TREE
+cd "$worktree" &&
+
+if grep -q "^diff --git " "$1"
+then
+ validate_patch "$1"
+else
+ validate_cover_letter "$1"
+fi &&
+
+if test "$GIT_SENDEMAIL_FILE_COUNTER" = "$GIT_SENDEMAIL_FILE_TOTAL"
+then
+ git config --unset-all sendemail.validateWorktree &&
+ trap 'git worktree remove -ff "$worktree"' EXIT &&
+ validate_series
+fi
diff --git a/thread-utils.c b/thread-utils.c
index 5329845..1f89ffa 100644
--- a/thread-utils.c
+++ b/thread-utils.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "thread-utils.h"
#if defined(hpux) || defined(__hpux) || defined(_hpux)
diff --git a/tmp-objdir.c b/tmp-objdir.c
index adf6033..3509258 100644
--- a/tmp-objdir.c
+++ b/tmp-objdir.c
@@ -1,13 +1,16 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "tmp-objdir.h"
+#include "abspath.h"
#include "chdir-notify.h"
#include "dir.h"
-#include "sigchain.h"
+#include "environment.h"
+#include "object-file.h"
+#include "path.h"
#include "string-list.h"
#include "strbuf.h"
#include "strvec.h"
#include "quote.h"
-#include "object-store.h"
+#include "object-store-ll.h"
struct tmp_objdir {
struct strbuf path;
@@ -18,7 +21,7 @@ struct tmp_objdir {
/*
* Allow only one tmp_objdir at a time in a running process, which simplifies
- * our signal/atexit cleanup routines. It's doubtful callers will ever need
+ * our atexit cleanup routines. It's doubtful callers will ever need
* more than one, and we can expand later if so. You can have many such
* tmp_objdirs simultaneously in many processes, of course.
*/
@@ -31,7 +34,7 @@ static void tmp_objdir_free(struct tmp_objdir *t)
free(t);
}
-static int tmp_objdir_destroy_1(struct tmp_objdir *t, int on_signal)
+int tmp_objdir_destroy(struct tmp_objdir *t)
{
int err;
@@ -41,44 +44,21 @@ static int tmp_objdir_destroy_1(struct tmp_objdir *t, int on_signal)
if (t == the_tmp_objdir)
the_tmp_objdir = NULL;
- if (!on_signal && t->prev_odb)
+ if (t->prev_odb)
restore_primary_odb(t->prev_odb, t->path.buf);
- /*
- * This may use malloc via strbuf_grow(), but we should
- * have pre-grown t->path sufficiently so that this
- * doesn't happen in practice.
- */
err = remove_dir_recursively(&t->path, 0);
- /*
- * When we are cleaning up due to a signal, we won't bother
- * freeing memory; it may cause a deadlock if the signal
- * arrived while libc's allocator lock is held.
- */
- if (!on_signal)
- tmp_objdir_free(t);
+ tmp_objdir_free(t);
return err;
}
-int tmp_objdir_destroy(struct tmp_objdir *t)
-{
- return tmp_objdir_destroy_1(t, 0);
-}
-
static void remove_tmp_objdir(void)
{
tmp_objdir_destroy(the_tmp_objdir);
}
-static void remove_tmp_objdir_on_signal(int signo)
-{
- tmp_objdir_destroy_1(the_tmp_objdir, 1);
- sigchain_pop(signo);
- raise(signo);
-}
-
void tmp_objdir_discard_objects(struct tmp_objdir *t)
{
remove_dir_recursively(&t->path, REMOVE_DIR_KEEP_TOPLEVEL);
@@ -152,14 +132,6 @@ struct tmp_objdir *tmp_objdir_create(const char *prefix)
*/
strbuf_addf(&t->path, "%s/tmp_objdir-%s-XXXXXX", get_object_directory(), prefix);
- /*
- * Grow the strbuf beyond any filename we expect to be placed in it.
- * If tmp_objdir_destroy() is called by a signal handler, then
- * we should be able to use the strbuf to remove files without
- * having to call malloc.
- */
- strbuf_grow(&t->path, 1024);
-
if (!mkdtemp(t->path.buf)) {
/* free, not destroy, as we never touched the filesystem */
tmp_objdir_free(t);
@@ -169,7 +141,6 @@ struct tmp_objdir *tmp_objdir_create(const char *prefix)
the_tmp_objdir = t;
if (!installed_handlers) {
atexit(remove_tmp_objdir);
- sigchain_push_common(remove_tmp_objdir_on_signal);
installed_handlers++;
}
diff --git a/tmp-objdir.h b/tmp-objdir.h
index 76efc7e..237d96b 100644
--- a/tmp-objdir.h
+++ b/tmp-objdir.h
@@ -10,9 +10,11 @@
*
* Example:
*
+ * struct child_process child = CHILD_PROCESS_INIT;
* struct tmp_objdir *t = tmp_objdir_create("incoming");
- * if (!run_command_v_opt_cd_env(cmd, 0, NULL, tmp_objdir_env(t)) &&
- * !tmp_objdir_migrate(t))
+ * strvec_push(&child.args, cmd);
+ * strvec_pushv(&child.env, tmp_objdir_env(t));
+ * if (!run_command(&child)) && !tmp_objdir_migrate(t))
* printf("success!\n");
* else
* die("failed...tmp_objdir will clean up for us");
diff --git a/trace.c b/trace.c
index 794a087..8669ddf 100644
--- a/trace.c
+++ b/trace.c
@@ -18,11 +18,15 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "environment.h"
#include "quote.h"
+#include "setup.h"
+#include "trace.h"
struct trace_key trace_default_key = { "GIT_TRACE", 0, 0, 0 };
struct trace_key trace_perf_key = TRACE_KEY_INIT(PERFORMANCE);
@@ -291,10 +295,9 @@ static const char *quote_crnl(const char *path)
return new_path.buf;
}
-/* FIXME: move prefix to startup_info struct and get rid of this arg */
-void trace_repo_setup(const char *prefix)
+void trace_repo_setup(void)
{
- const char *git_work_tree;
+ const char *git_work_tree, *prefix = startup_info->prefix;
char *cwd;
if (!trace_want(&trace_setup_key))
@@ -305,7 +308,7 @@ void trace_repo_setup(const char *prefix)
if (!(git_work_tree = get_git_work_tree()))
git_work_tree = "(null)";
- if (!prefix)
+ if (!startup_info->prefix)
prefix = "(null)";
trace_printf_key(&trace_setup_key, "setup: git_dir: %s\n", quote_crnl(get_git_dir()));
diff --git a/trace.h b/trace.h
index 4e771f8..d304d55 100644
--- a/trace.h
+++ b/trace.h
@@ -1,7 +1,6 @@
#ifndef TRACE_H
#define TRACE_H
-#include "git-compat-util.h"
#include "strbuf.h"
/**
@@ -93,7 +92,7 @@ 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(const char *prefix);
+void trace_repo_setup(void);
/**
* Checks whether the trace key is enabled. Used to prevent expensive
diff --git a/trace2.c b/trace2.c
index 0c0a11e..f894532 100644
--- a/trace2.c
+++ b/trace2.c
@@ -1,20 +1,23 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
-#include "json-writer.h"
-#include "quote.h"
+#include "repository.h"
#include "run-command.h"
#include "sigchain.h"
#include "thread-utils.h"
-#include "version.h"
+#include "trace.h"
+#include "trace2.h"
#include "trace2/tr2_cfg.h"
#include "trace2/tr2_cmd_name.h"
+#include "trace2/tr2_ctr.h"
#include "trace2/tr2_dst.h"
#include "trace2/tr2_sid.h"
#include "trace2/tr2_sysenv.h"
#include "trace2/tr2_tgt.h"
#include "trace2/tr2_tls.h"
+#include "trace2/tr2_tmr.h"
static int trace2_enabled;
+static int trace2_redact = 1;
static int tr2_next_child_id; /* modify under lock */
static int tr2_next_exec_id; /* modify under lock */
@@ -52,7 +55,7 @@ static struct tr2_tgt *tr2_tgt_builtins[] =
* Force (rather than lazily) initialize any of the requested
* builtin TRACE2 targets at startup (and before we've seen an
* actual TRACE2 event call) so we can see if we need to setup
- * the TR2 and TLS machinery.
+ * private data structures and thread-local storage.
*
* Return the number of builtin targets enabled.
*/
@@ -83,6 +86,39 @@ static void tr2_tgt_disable_builtins(void)
tgt_j->pfn_term();
}
+/*
+ * The signature of this function must match the pfn_timer
+ * method in the targets. (Think of this is an apply operation
+ * across the set of active targets.)
+ */
+static void tr2_tgt_emit_a_timer(const struct tr2_timer_metadata *meta,
+ const struct tr2_timer *timer,
+ int is_final_data)
+{
+ struct tr2_tgt *tgt_j;
+ int j;
+
+ for_each_wanted_builtin (j, tgt_j)
+ if (tgt_j->pfn_timer)
+ tgt_j->pfn_timer(meta, timer, is_final_data);
+}
+
+/*
+ * The signature of this function must match the pfn_counter
+ * method in the targets.
+ */
+static void tr2_tgt_emit_a_counter(const struct tr2_counter_metadata *meta,
+ const struct tr2_counter *counter,
+ int is_final_data)
+{
+ struct tr2_tgt *tgt_j;
+ int j;
+
+ for_each_wanted_builtin (j, tgt_j)
+ if (tgt_j->pfn_counter)
+ tgt_j->pfn_counter(meta, counter, is_final_data);
+}
+
static int tr2main_exit_code;
/*
@@ -110,6 +146,32 @@ static void tr2main_atexit_handler(void)
*/
tr2tls_pop_unwind_self();
+ /*
+ * Some timers want per-thread details. If the main thread
+ * used one of those timers, emit the details now (before
+ * we emit the aggregate timer values).
+ *
+ * Likewise for counters.
+ */
+ tr2_emit_per_thread_timers(tr2_tgt_emit_a_timer);
+ tr2_emit_per_thread_counters(tr2_tgt_emit_a_counter);
+
+ /*
+ * Add stopwatch timer and counter data for the main thread to
+ * the final totals. And then emit the final values.
+ *
+ * Technically, we shouldn't need to hold the lock to update
+ * and output the final_timer_block and final_counter_block
+ * (since all other threads should be dead by now), but it
+ * doesn't hurt anything.
+ */
+ tr2tls_lock();
+ tr2_update_final_timers();
+ tr2_update_final_counters();
+ tr2_emit_final_timers(tr2_tgt_emit_a_timer);
+ tr2_emit_final_counters(tr2_tgt_emit_a_counter);
+ tr2tls_unlock();
+
for_each_wanted_builtin (j, tgt_j)
if (tgt_j->pfn_atexit)
tgt_j->pfn_atexit(us_elapsed_absolute,
@@ -163,6 +225,8 @@ void trace2_initialize_fl(const char *file, int line)
if (!tr2_tgt_want_builtins())
return;
trace2_enabled = 1;
+ if (!git_env_bool("GIT_TRACE2_REDACT", 1))
+ trace2_redact = 0;
tr2_sid_get();
@@ -183,12 +247,93 @@ int trace2_is_enabled(void)
return trace2_enabled;
}
+/*
+ * Redacts an argument, i.e. ensures that no password in
+ * https://user:password@host/-style URLs is logged.
+ *
+ * Returns the original if nothing needed to be redacted.
+ * Returns a pointer that needs to be `free()`d otherwise.
+ */
+static const char *redact_arg(const char *arg)
+{
+ const char *p, *colon;
+ size_t at;
+
+ if (!trace2_redact ||
+ (!skip_prefix(arg, "https://", &p) &&
+ !skip_prefix(arg, "http://", &p)))
+ return arg;
+
+ at = strcspn(p, "@/");
+ if (p[at] != '@')
+ return arg;
+
+ colon = memchr(p, ':', at);
+ if (!colon)
+ return arg;
+
+ return xstrfmt("%.*s:<REDACTED>%s", (int)(colon - arg), arg, p + at);
+}
+
+/*
+ * Redacts arguments in an argument list.
+ *
+ * Returns the original if nothing needed to be redacted.
+ * Otherwise, returns a new array that needs to be released
+ * via `free_redacted_argv()`.
+ */
+static const char **redact_argv(const char **argv)
+{
+ int i, j;
+ const char *redacted = NULL;
+ const char **ret;
+
+ if (!trace2_redact)
+ return argv;
+
+ for (i = 0; argv[i]; i++)
+ if ((redacted = redact_arg(argv[i])) != argv[i])
+ break;
+
+ if (!argv[i])
+ return argv;
+
+ for (j = 0; argv[j]; j++)
+ ; /* keep counting */
+
+ ALLOC_ARRAY(ret, j + 1);
+ ret[j] = NULL;
+
+ for (j = 0; j < i; j++)
+ ret[j] = argv[j];
+ ret[i] = redacted;
+ for (++i; argv[i]; i++) {
+ redacted = redact_arg(argv[i]);
+ ret[i] = redacted ? redacted : argv[i];
+ }
+
+ return ret;
+}
+
+static void free_redacted_argv(const char **redacted, const char **argv)
+{
+ int i;
+
+ if (redacted != argv) {
+ for (i = 0; argv[i]; i++)
+ if (redacted[i] != argv[i])
+ free((void *)redacted[i]);
+ free((void *)redacted);
+ }
+}
+
void trace2_cmd_start_fl(const char *file, int line, const char **argv)
{
struct tr2_tgt *tgt_j;
int j;
uint64_t us_now;
uint64_t us_elapsed_absolute;
+ const char **redacted;
if (!trace2_enabled)
return;
@@ -196,10 +341,14 @@ void trace2_cmd_start_fl(const char *file, int line, const char **argv)
us_now = getnanotime() / 1000;
us_elapsed_absolute = tr2tls_absolute_elapsed(us_now);
+ redacted = redact_argv(argv);
+
for_each_wanted_builtin (j, tgt_j)
if (tgt_j->pfn_start_fl)
tgt_j->pfn_start_fl(file, line, us_elapsed_absolute,
- argv);
+ redacted);
+
+ free_redacted_argv(redacted, argv);
}
void trace2_cmd_exit_fl(const char *file, int line, int code)
@@ -212,7 +361,6 @@ void trace2_cmd_exit_fl(const char *file, int line, int code)
if (!trace2_enabled)
return;
- trace_git_fsync_stats();
trace2_collect_process_info(TRACE2_PROCESS_INFO_EXIT);
tr2main_exit_code = code;
@@ -285,6 +433,9 @@ void trace2_cmd_name_fl(const char *file, int line, const char *name)
for_each_wanted_builtin (j, tgt_j)
if (tgt_j->pfn_command_name_fl)
tgt_j->pfn_command_name_fl(file, line, name, hierarchy);
+
+ trace2_cmd_list_config();
+ trace2_cmd_list_env_vars();
}
void trace2_cmd_mode_fl(const char *file, int line, const char *mode)
@@ -316,17 +467,29 @@ void trace2_cmd_alias_fl(const char *file, int line, const char *alias,
void trace2_cmd_list_config_fl(const char *file, int line)
{
+ static int emitted = 0;
+
if (!trace2_enabled)
return;
+ if (emitted)
+ return;
+ emitted = 1;
+
tr2_cfg_list_config_fl(file, line);
}
void trace2_cmd_list_env_vars_fl(const char *file, int line)
{
+ static int emitted = 0;
+
if (!trace2_enabled)
return;
+ if (emitted)
+ return;
+ emitted = 1;
+
tr2_list_env_vars_fl(file, line);
}
@@ -346,6 +509,7 @@ void trace2_child_start_fl(const char *file, int line,
int j;
uint64_t us_now;
uint64_t us_elapsed_absolute;
+ const char **orig_argv = cmd->args.v;
if (!trace2_enabled)
return;
@@ -356,10 +520,24 @@ void trace2_child_start_fl(const char *file, int line,
cmd->trace2_child_id = tr2tls_locked_increment(&tr2_next_child_id);
cmd->trace2_child_us_start = us_now;
+ /*
+ * The `pfn_child_start_fl` API takes a `struct child_process`
+ * rather than a simple `argv` for the child because some
+ * targets make use of the additional context bits/values. So
+ * temporarily replace the original argv (inside the `strvec`)
+ * with a possibly redacted version.
+ */
+ cmd->args.v = redact_argv(orig_argv);
+
for_each_wanted_builtin (j, tgt_j)
if (tgt_j->pfn_child_start_fl)
tgt_j->pfn_child_start_fl(file, line,
us_elapsed_absolute, cmd);
+
+ if (cmd->args.v != orig_argv) {
+ free_redacted_argv(cmd->args.v, orig_argv);
+ cmd->args.v = orig_argv;
+ }
}
void trace2_child_exit_fl(const char *file, int line, struct child_process *cmd,
@@ -430,6 +608,7 @@ int trace2_exec_fl(const char *file, int line, const char *exe,
int exec_id;
uint64_t us_now;
uint64_t us_elapsed_absolute;
+ const char **redacted;
if (!trace2_enabled)
return -1;
@@ -439,10 +618,14 @@ int trace2_exec_fl(const char *file, int line, const char *exe,
exec_id = tr2tls_locked_increment(&tr2_next_exec_id);
+ redacted = redact_argv(argv);
+
for_each_wanted_builtin (j, tgt_j)
if (tgt_j->pfn_exec_fl)
tgt_j->pfn_exec_fl(file, line, us_elapsed_absolute,
- exec_id, exe, argv);
+ exec_id, exe, redacted);
+
+ free_redacted_argv(redacted, argv);
return exec_id;
}
@@ -466,7 +649,7 @@ void trace2_exec_result_fl(const char *file, int line, int exec_id, int code)
file, line, us_elapsed_absolute, exec_id, code);
}
-void trace2_thread_start_fl(const char *file, int line, const char *thread_name)
+void trace2_thread_start_fl(const char *file, int line, const char *thread_base_name)
{
struct tr2_tgt *tgt_j;
int j;
@@ -488,14 +671,14 @@ void trace2_thread_start_fl(const char *file, int line, const char *thread_name)
*/
trace2_region_enter_printf_fl(file, line, NULL, NULL, NULL,
"thread-proc on main: %s",
- thread_name);
+ thread_base_name);
return;
}
us_now = getnanotime() / 1000;
us_elapsed_absolute = tr2tls_absolute_elapsed(us_now);
- tr2tls_create_self(thread_name, us_now);
+ tr2tls_create_self(thread_base_name, us_now);
for_each_wanted_builtin (j, tgt_j)
if (tgt_j->pfn_thread_start_fl)
@@ -541,6 +724,25 @@ void trace2_thread_exit_fl(const char *file, int line)
tr2tls_pop_unwind_self();
us_elapsed_thread = tr2tls_region_elasped_self(us_now);
+ /*
+ * Some timers want per-thread details. If this thread used
+ * one of those timers, emit the details now.
+ *
+ * Likewise for counters.
+ */
+ tr2_emit_per_thread_timers(tr2_tgt_emit_a_timer);
+ tr2_emit_per_thread_counters(tr2_tgt_emit_a_counter);
+
+ /*
+ * Add stopwatch timer and counter data from the current
+ * (non-main) thread to the final totals. (We'll accumulate
+ * data for the main thread later during "atexit".)
+ */
+ tr2tls_lock();
+ tr2_update_final_timers();
+ tr2_update_final_counters();
+ tr2tls_unlock();
+
for_each_wanted_builtin (j, tgt_j)
if (tgt_j->pfn_thread_exit_fl)
tgt_j->pfn_thread_exit_fl(file, line,
@@ -551,17 +753,23 @@ void trace2_thread_exit_fl(const char *file, int line)
}
void trace2_def_param_fl(const char *file, int line, const char *param,
- const char *value)
+ const char *value, const struct key_value_info *kvi)
{
struct tr2_tgt *tgt_j;
int j;
+ const char *redacted;
if (!trace2_enabled)
return;
+ redacted = redact_arg(value);
+
for_each_wanted_builtin (j, tgt_j)
if (tgt_j->pfn_param_fl)
- tgt_j->pfn_param_fl(file, line, param, value);
+ tgt_j->pfn_param_fl(file, line, param, redacted, kvi);
+
+ if (redacted != value)
+ free((void *)redacted);
}
void trace2_def_repo_fl(const char *file, int line, struct repository *repo)
@@ -795,6 +1003,39 @@ void trace2_printf_fl(const char *file, int line, const char *fmt, ...)
va_end(ap);
}
+void trace2_timer_start(enum trace2_timer_id tid)
+{
+ if (!trace2_enabled)
+ return;
+
+ if (tid < 0 || tid >= TRACE2_NUMBER_OF_TIMERS)
+ BUG("trace2_timer_start: invalid timer id: %d", tid);
+
+ tr2_start_timer(tid);
+}
+
+void trace2_timer_stop(enum trace2_timer_id tid)
+{
+ if (!trace2_enabled)
+ return;
+
+ if (tid < 0 || tid >= TRACE2_NUMBER_OF_TIMERS)
+ BUG("trace2_timer_stop: invalid timer id: %d", tid);
+
+ tr2_stop_timer(tid);
+}
+
+void trace2_counter_add(enum trace2_counter_id cid, uint64_t value)
+{
+ if (!trace2_enabled)
+ return;
+
+ if (cid < 0 || cid >= TRACE2_NUMBER_OF_COUNTERS)
+ BUG("trace2_counter_add: invalid counter id: %d", cid);
+
+ tr2_counter_increment(cid, value);
+}
+
const char *trace2_session_id(void)
{
return tr2_sid_get();
diff --git a/trace2.h b/trace2.h
index 88d906e..1f0669b 100644
--- a/trace2.h
+++ b/trace2.h
@@ -51,6 +51,8 @@ struct json_writer;
* [] trace2_region* -- emit region nesting messages.
* [] trace2_data* -- emit region/thread/repo data messages.
* [] trace2_printf* -- legacy trace[1] messages.
+ * [] trace2_timer* -- stopwatch timers (messages are deferred).
+ * [] trace2_counter* -- global counters (messages are deferred).
*/
/*
@@ -73,8 +75,7 @@ void trace2_initialize_clock(void);
/*
* Initialize TRACE2 tracing facility if any of the builtin TRACE2
* targets are enabled in the system config or the environment.
- * This includes setting up the Trace2 thread local storage (TLS).
- * Emits a 'version' message containing the version of git
+ * This emits a 'version' message containing the version of git
* and the Trace2 protocol.
*
* This function should be called from `main()` as early as possible in
@@ -302,26 +303,29 @@ void trace2_exec_result_fl(const char *file, int line, int exec_id, int code);
/*
* Emit a 'thread_start' event. This must be called from inside the
- * thread-proc to set up the trace2 TLS data for the thread.
+ * thread-proc to allow the thread to create its own thread-local
+ * storage.
*
- * Thread names should be descriptive, like "preload_index".
- * Thread names will be decorated with an instance number automatically.
+ * The thread base name should be descriptive, like "preload_index" or
+ * taken from the thread-proc function. A unique thread name will be
+ * created from the given base name and the thread id automatically.
*/
void trace2_thread_start_fl(const char *file, int line,
- const char *thread_name);
+ const char *thread_base_name);
-#define trace2_thread_start(thread_name) \
- trace2_thread_start_fl(__FILE__, __LINE__, (thread_name))
+#define trace2_thread_start(thread_base_name) \
+ trace2_thread_start_fl(__FILE__, __LINE__, (thread_base_name))
/*
* Emit a 'thread_exit' event. This must be called from inside the
- * thread-proc to report thread-specific data and cleanup TLS data
- * for the thread.
+ * thread-proc so that the thread can access and clean up its
+ * thread-local storage.
*/
void trace2_thread_exit_fl(const char *file, int line);
#define trace2_thread_exit() trace2_thread_exit_fl(__FILE__, __LINE__)
+struct key_value_info;
/*
* Emits a "def_param" message containing a key/value pair.
*
@@ -331,10 +335,10 @@ void trace2_thread_exit_fl(const char *file, int line);
* `core.abbrev`, `status.showUntrackedFiles`, or `--no-ahead-behind`.
*/
void trace2_def_param_fl(const char *file, int line, const char *param,
- const char *value);
+ const char *value, const struct key_value_info *kvi);
-#define trace2_def_param(param, value) \
- trace2_def_param_fl(__FILE__, __LINE__, (param), (value))
+#define trace2_def_param(param, value, kvi) \
+ trace2_def_param_fl(__FILE__, __LINE__, (param), (value), (kvi))
/*
* Tell trace2 about a newly instantiated repo object and assign
@@ -485,6 +489,90 @@ void trace2_printf_fl(const char *file, int line, const char *fmt, ...);
#define trace2_printf(...) trace2_printf_fl(__FILE__, __LINE__, __VA_ARGS__)
/*
+ * Define the set of stopwatch timers.
+ *
+ * We can add more at any time, but they must be defined at compile
+ * time (to avoid the need to dynamically allocate and synchronize
+ * them between different threads).
+ *
+ * These must start at 0 and be contiguous (because we use them
+ * elsewhere as array indexes).
+ *
+ * Any values added to this enum must also be added to the
+ * `tr2_timer_metadata[]` in `trace2/tr2_tmr.c`.
+ */
+enum trace2_timer_id {
+ /*
+ * Define two timers for testing. See `t/helper/test-trace2.c`.
+ * These can be used for ad hoc testing, but should not be used
+ * for permanent analysis code.
+ */
+ TRACE2_TIMER_ID_TEST1 = 0, /* emits summary event only */
+ TRACE2_TIMER_ID_TEST2, /* emits summary and thread events */
+
+ /* Add additional timer definitions before here. */
+ TRACE2_NUMBER_OF_TIMERS
+};
+
+/*
+ * Start/Stop the indicated stopwatch timer in the current thread.
+ *
+ * The time spent by the current thread between the _start and _stop
+ * calls will be added to the thread's partial sum for this timer.
+ *
+ * Timer events are emitted at thread and program exit.
+ *
+ * Note: Since the stopwatch API routines do not generate individual
+ * events, they do not take (file, line) arguments. Similarly, the
+ * category and timer name values are defined at compile-time in the
+ * timer definitions array, so they are not needed here in the API.
+ */
+void trace2_timer_start(enum trace2_timer_id tid);
+void trace2_timer_stop(enum trace2_timer_id tid);
+
+/*
+ * Define the set of global counters.
+ *
+ * We can add more at any time, but they must be defined at compile
+ * time (to avoid the need to dynamically allocate and synchronize
+ * them between different threads).
+ *
+ * These must start at 0 and be contiguous (because we use them
+ * elsewhere as array indexes).
+ *
+ * Any values added to this enum be also be added to the
+ * `tr2_counter_metadata[]` in `trace2/tr2_ctr.c`.
+ */
+enum trace2_counter_id {
+ /*
+ * Define two counters for testing. See `t/helper/test-trace2.c`.
+ * These can be used for ad hoc testing, but should not be used
+ * for permanent analysis code.
+ */
+ TRACE2_COUNTER_ID_TEST1 = 0, /* emits summary event only */
+ TRACE2_COUNTER_ID_TEST2, /* emits summary and thread events */
+
+ TRACE2_COUNTER_ID_PACKED_REFS_JUMPS, /* counts number of jumps */
+
+ /* counts number of fsyncs */
+ TRACE2_COUNTER_ID_FSYNC_WRITEOUT_ONLY,
+ TRACE2_COUNTER_ID_FSYNC_HARDWARE_FLUSH,
+
+ /* Add additional counter definitions before here. */
+ TRACE2_NUMBER_OF_COUNTERS
+};
+
+/*
+ * Increase the named global counter by value.
+ *
+ * Note that this adds `value` to the current thread's partial sum for
+ * this counter (without locking) and that the complete sum is not
+ * available until all threads have exited, so it does not return the
+ * new value of the counter.
+ */
+void trace2_counter_add(enum trace2_counter_id cid, uint64_t value);
+
+/*
* Optional platform-specific code to dump information about the
* current and any parent process(es). This is intended to allow
* post-processors to know who spawned this git instance and anything
diff --git a/trace2/tr2_cfg.c b/trace2/tr2_cfg.c
index ec9ac1a..d96d908 100644
--- a/trace2/tr2_cfg.c
+++ b/trace2/tr2_cfg.c
@@ -1,7 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "strbuf.h"
+#include "trace2.h"
#include "trace2/tr2_cfg.h"
#include "trace2/tr2_sysenv.h"
+#include "wildmatch.h"
static struct strbuf **tr2_cfg_patterns;
static int tr2_cfg_count_patterns;
@@ -97,7 +100,8 @@ struct tr2_cfg_data {
/*
* See if the given config key matches any of our patterns of interest.
*/
-static int tr2_cfg_cb(const char *key, const char *value, void *d)
+static int tr2_cfg_cb(const char *key, const char *value,
+ const struct config_context *ctx, void *d)
{
struct strbuf **s;
struct tr2_cfg_data *data = (struct tr2_cfg_data *)d;
@@ -106,7 +110,8 @@ static int tr2_cfg_cb(const char *key, const char *value, void *d)
struct strbuf *buf = *s;
int wm = wildmatch(buf->buf, key, WM_CASEFOLD);
if (wm == WM_MATCH) {
- trace2_def_param_fl(data->file, data->line, key, value);
+ trace2_def_param_fl(data->file, data->line, key, value,
+ ctx->kvi);
return 0;
}
}
@@ -124,8 +129,10 @@ void tr2_cfg_list_config_fl(const char *file, int line)
void tr2_list_env_vars_fl(const char *file, int line)
{
+ struct key_value_info kvi = KVI_INIT;
struct strbuf **s;
+ kvi_from_param(&kvi);
if (tr2_load_env_vars() <= 0)
return;
@@ -133,15 +140,19 @@ void tr2_list_env_vars_fl(const char *file, int line)
struct strbuf *buf = *s;
const char *val = getenv(buf->buf);
if (val && *val)
- trace2_def_param_fl(file, line, buf->buf, val);
+ trace2_def_param_fl(file, line, buf->buf, val, &kvi);
}
}
void tr2_cfg_set_fl(const char *file, int line, const char *key,
const char *value)
{
+ struct key_value_info kvi = KVI_INIT;
+ struct config_context ctx = {
+ .kvi = &kvi,
+ };
struct tr2_cfg_data data = { file, line };
if (tr2_cfg_load_patterns() > 0)
- tr2_cfg_cb(key, value, &data);
+ tr2_cfg_cb(key, value, &ctx, &data);
}
diff --git a/trace2/tr2_cmd_name.c b/trace2/tr2_cmd_name.c
index dd31320..b7b5a86 100644
--- a/trace2/tr2_cmd_name.c
+++ b/trace2/tr2_cmd_name.c
@@ -1,4 +1,5 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "strbuf.h"
#include "trace2/tr2_cmd_name.h"
#define TR2_ENVVAR_PARENT_NAME "GIT_TRACE2_PARENT_NAME"
diff --git a/trace2/tr2_ctr.c b/trace2/tr2_ctr.c
new file mode 100644
index 0000000..d3a3371
--- /dev/null
+++ b/trace2/tr2_ctr.c
@@ -0,0 +1,115 @@
+#include "git-compat-util.h"
+#include "trace2/tr2_tgt.h"
+#include "trace2/tr2_tls.h"
+#include "trace2/tr2_ctr.h"
+
+/*
+ * A global counter block to aggregrate values from the partial sums
+ * from each thread.
+ */
+static struct tr2_counter_block final_counter_block; /* access under tr2tls_mutex */
+
+/*
+ * Define metadata for each global counter.
+ *
+ * This array must match the "enum trace2_counter_id" and the values
+ * in "struct tr2_counter_block.counter[*]".
+ */
+static struct tr2_counter_metadata tr2_counter_metadata[TRACE2_NUMBER_OF_COUNTERS] = {
+ [TRACE2_COUNTER_ID_TEST1] = {
+ .category = "test",
+ .name = "test1",
+ .want_per_thread_events = 0,
+ },
+ [TRACE2_COUNTER_ID_TEST2] = {
+ .category = "test",
+ .name = "test2",
+ .want_per_thread_events = 1,
+ },
+ [TRACE2_COUNTER_ID_PACKED_REFS_JUMPS] = {
+ .category = "packed-refs",
+ .name = "jumps_made",
+ .want_per_thread_events = 0,
+ },
+ [TRACE2_COUNTER_ID_FSYNC_WRITEOUT_ONLY] = {
+ .category = "fsync",
+ .name = "writeout-only",
+ .want_per_thread_events = 0,
+ },
+ [TRACE2_COUNTER_ID_FSYNC_HARDWARE_FLUSH] = {
+ .category = "fsync",
+ .name = "hardware-flush",
+ .want_per_thread_events = 0,
+ },
+
+ /* Add additional metadata before here. */
+};
+
+void tr2_counter_increment(enum trace2_counter_id cid, uint64_t value)
+{
+ struct tr2tls_thread_ctx *ctx = tr2tls_get_self();
+ struct tr2_counter *c = &ctx->counter_block.counter[cid];
+
+ c->value += value;
+
+ ctx->used_any_counter = 1;
+ if (tr2_counter_metadata[cid].want_per_thread_events)
+ ctx->used_any_per_thread_counter = 1;
+}
+
+void tr2_update_final_counters(void)
+{
+ struct tr2tls_thread_ctx *ctx = tr2tls_get_self();
+ enum trace2_counter_id cid;
+
+ if (!ctx->used_any_counter)
+ return;
+
+ /*
+ * Access `final_counter_block` requires holding `tr2tls_mutex`.
+ * We assume that our caller is holding the lock.
+ */
+
+ for (cid = 0; cid < TRACE2_NUMBER_OF_COUNTERS; cid++) {
+ struct tr2_counter *c_final = &final_counter_block.counter[cid];
+ const struct tr2_counter *c = &ctx->counter_block.counter[cid];
+
+ c_final->value += c->value;
+ }
+}
+
+void tr2_emit_per_thread_counters(tr2_tgt_evt_counter_t *fn_apply)
+{
+ struct tr2tls_thread_ctx *ctx = tr2tls_get_self();
+ enum trace2_counter_id cid;
+
+ if (!ctx->used_any_per_thread_counter)
+ return;
+
+ /*
+ * For each counter, if the counter wants per-thread events
+ * and this thread used it (the value is non-zero), emit it.
+ */
+ for (cid = 0; cid < TRACE2_NUMBER_OF_COUNTERS; cid++)
+ if (tr2_counter_metadata[cid].want_per_thread_events &&
+ ctx->counter_block.counter[cid].value)
+ fn_apply(&tr2_counter_metadata[cid],
+ &ctx->counter_block.counter[cid],
+ 0);
+}
+
+void tr2_emit_final_counters(tr2_tgt_evt_counter_t *fn_apply)
+{
+ enum trace2_counter_id cid;
+
+ /*
+ * Access `final_counter_block` requires holding `tr2tls_mutex`.
+ * We assume that our caller is holding the lock.
+ */
+
+ for (cid = 0; cid < TRACE2_NUMBER_OF_COUNTERS; cid++)
+ if (final_counter_block.counter[cid].value)
+ fn_apply(&tr2_counter_metadata[cid],
+ &final_counter_block.counter[cid],
+ 1);
+}
diff --git a/trace2/tr2_ctr.h b/trace2/tr2_ctr.h
new file mode 100644
index 0000000..a2267ee
--- /dev/null
+++ b/trace2/tr2_ctr.h
@@ -0,0 +1,104 @@
+#ifndef TR2_CTR_H
+#define TR2_CTR_H
+
+#include "trace2.h"
+#include "trace2/tr2_tgt.h"
+
+/*
+ * Define a mechanism to allow global "counters".
+ *
+ * Counters can be used count interesting activity that does not fit
+ * the "region and data" model, such as code called from many
+ * different regions and/or where you want to count a number of items,
+ * but don't have control of when the last item will be processed,
+ * such as counter the number of calls to `lstat()`.
+ *
+ * Counters differ from Trace2 "data" events. Data events are emitted
+ * immediately and are appropriate for documenting loop counters at
+ * the end of a region, for example. Counter values are accumulated
+ * during the program and final counter values are emitted at program
+ * exit.
+ *
+ * To make this model efficient, we define a compile-time fixed set of
+ * counters and counter ids using a fixed size "counter block" array
+ * in thread-local storage. This gives us constant time, lock-free
+ * access to each counter within each thread. This lets us avoid the
+ * complexities of dynamically allocating a counter and sharing that
+ * definition with other threads.
+ *
+ * Each thread uses the counter block in its thread-local storage to
+ * increment partial sums for each counter (without locking). When a
+ * thread exits, those partial sums are (under lock) added to the
+ * global final sum.
+ *
+ * Partial sums for each counter are optionally emitted when a thread
+ * exits.
+ *
+ * Final sums for each counter are emitted between the "exit" and
+ * "atexit" events.
+ *
+ * A parallel "counter metadata" table contains the "category" and
+ * "name" fields for each counter. This eliminates the need to
+ * include those args in the various counter APIs.
+ */
+
+/*
+ * The definition of an individual counter as used by an individual
+ * thread (and later in aggregation).
+ */
+struct tr2_counter {
+ uint64_t value;
+};
+
+/*
+ * Metadata for a counter.
+ */
+struct tr2_counter_metadata {
+ const char *category;
+ const char *name;
+
+ /*
+ * True if we should emit per-thread events for this counter
+ * when individual threads exit.
+ */
+ unsigned int want_per_thread_events:1;
+};
+
+/*
+ * A compile-time fixed block of counters to insert into thread-local
+ * storage. This wrapper is used to avoid quirks of C and the usual
+ * need to pass an array size argument.
+ */
+struct tr2_counter_block {
+ struct tr2_counter counter[TRACE2_NUMBER_OF_COUNTERS];
+};
+
+/*
+ * Private routines used by trace2.c to increment a counter for the
+ * current thread.
+ */
+void tr2_counter_increment(enum trace2_counter_id cid, uint64_t value);
+
+/*
+ * Add the current thread's counter data to the global totals.
+ * This is called during thread-exit.
+ *
+ * Caller must be holding the tr2tls_mutex.
+ */
+void tr2_update_final_counters(void);
+
+/*
+ * Emit per-thread counter data for the current thread.
+ * This is called during thread-exit.
+ */
+void tr2_emit_per_thread_counters(tr2_tgt_evt_counter_t *fn_apply);
+
+/*
+ * Emit global counter values.
+ * This is called during atexit handling.
+ *
+ * Caller must be holding the tr2tls_mutex.
+ */
+void tr2_emit_final_counters(tr2_tgt_evt_counter_t *fn_apply);
+
+#endif /* TR2_CTR_H */
diff --git a/trace2/tr2_dst.c b/trace2/tr2_dst.c
index 8a21dd2..5be892c 100644
--- a/trace2/tr2_dst.c
+++ b/trace2/tr2_dst.c
@@ -1,5 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
#include "sigchain.h"
+#include "strbuf.h"
#include "trace2/tr2_dst.h"
#include "trace2/tr2_sid.h"
#include "trace2/tr2_sysenv.h"
diff --git a/trace2/tr2_sid.c b/trace2/tr2_sid.c
index dc6e75e..09c4ef0 100644
--- a/trace2/tr2_sid.c
+++ b/trace2/tr2_sid.c
@@ -1,4 +1,6 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "hex.h"
+#include "strbuf.h"
#include "trace2/tr2_tbuf.h"
#include "trace2/tr2_sid.h"
diff --git a/trace2/tr2_sysenv.c b/trace2/tr2_sysenv.c
index a380dcf..048cdd5 100644
--- a/trace2/tr2_sysenv.c
+++ b/trace2/tr2_sysenv.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "dir.h"
#include "tr2_sysenv.h"
@@ -57,7 +57,9 @@ static struct tr2_sysenv_entry tr2_sysenv_settings[] = {
};
/* clang-format on */
-static int tr2_sysenv_cb(const char *key, const char *value, void *d)
+static int tr2_sysenv_cb(const char *key, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *d UNUSED)
{
int k;
@@ -66,6 +68,8 @@ static int tr2_sysenv_cb(const char *key, const char *value, void *d)
for (k = 0; k < ARRAY_SIZE(tr2_sysenv_settings); k++) {
if (!strcmp(key, tr2_sysenv_settings[k].git_config_name)) {
+ if (!value)
+ return config_error_nonbool(key);
free(tr2_sysenv_settings[k].value);
tr2_sysenv_settings[k].value = xstrdup(value);
return 0;
diff --git a/trace2/tr2_tbuf.c b/trace2/tr2_tbuf.c
index 2498482..c3b3822 100644
--- a/trace2/tr2_tbuf.c
+++ b/trace2/tr2_tbuf.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "tr2_tbuf.h"
void tr2_tbuf_local_time(struct tr2_tbuf *tb)
diff --git a/trace2/tr2_tgt.h b/trace2/tr2_tgt.h
index 65f94e1..1f626cf 100644
--- a/trace2/tr2_tgt.h
+++ b/trace2/tr2_tgt.h
@@ -4,6 +4,12 @@
struct child_process;
struct repository;
struct json_writer;
+struct tr2_timer_metadata;
+struct tr2_timer;
+struct tr2_counter_metadata;
+struct tr2_counter;
+
+#define NS_TO_SEC(ns) ((double)(ns) / 1.0e9)
/*
* Function prototypes for a TRACE2 "target" vtable.
@@ -63,8 +69,10 @@ typedef void(tr2_tgt_evt_exec_result_fl_t)(const char *file, int line,
uint64_t us_elapsed_absolute,
int exec_id, int code);
+struct key_value_info;
typedef void(tr2_tgt_evt_param_fl_t)(const char *file, int line,
- const char *param, const char *value);
+ const char *param, const char *value,
+ const struct key_value_info *kvi);
typedef void(tr2_tgt_evt_repo_fl_t)(const char *file, int line,
const struct repository *repo);
@@ -96,6 +104,14 @@ typedef void(tr2_tgt_evt_printf_va_fl_t)(const char *file, int line,
uint64_t us_elapsed_absolute,
const char *fmt, va_list ap);
+typedef void(tr2_tgt_evt_timer_t)(const struct tr2_timer_metadata *meta,
+ const struct tr2_timer *timer,
+ int is_final_data);
+
+typedef void(tr2_tgt_evt_counter_t)(const struct tr2_counter_metadata *meta,
+ const struct tr2_counter *counter,
+ int is_final_data);
+
/*
* "vtable" for a TRACE2 target. Use NULL if a target does not want
* to emit that message.
@@ -132,6 +148,8 @@ struct tr2_tgt {
tr2_tgt_evt_data_fl_t *pfn_data_fl;
tr2_tgt_evt_data_json_fl_t *pfn_data_json_fl;
tr2_tgt_evt_printf_va_fl_t *pfn_printf_va_fl;
+ tr2_tgt_evt_timer_t *pfn_timer;
+ tr2_tgt_evt_counter_t *pfn_counter;
};
/* clang-format on */
diff --git a/trace2/tr2_tgt_event.c b/trace2/tr2_tgt_event.c
index c5c8cfb..59910a1 100644
--- a/trace2/tr2_tgt_event.c
+++ b/trace2/tr2_tgt_event.c
@@ -1,6 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "json-writer.h"
+#include "repository.h"
#include "run-command.h"
#include "version.h"
#include "trace2/tr2_dst.h"
@@ -9,6 +10,7 @@
#include "trace2/tr2_sysenv.h"
#include "trace2/tr2_tgt.h"
#include "trace2/tr2_tls.h"
+#include "trace2/tr2_tmr.h"
static struct tr2_dst tr2dst_event = {
.sysenv_var = TR2_SYSENV_EVENT,
@@ -90,7 +92,7 @@ static void event_fmt_prepare(const char *event_name, const char *file,
jw_object_string(jw, "event", event_name);
jw_object_string(jw, "sid", tr2_sid_get());
- jw_object_string(jw, "thread", ctx->thread_name.buf);
+ jw_object_string(jw, "thread", ctx->thread_name);
/*
* In brief mode, only emit <time> on these 2 event types.
@@ -333,7 +335,7 @@ static void fn_alias_fl(const char *file, int line, const char *alias,
}
static void fn_child_start_fl(const char *file, int line,
- uint64_t us_elapsed_absolute,
+ uint64_t us_elapsed_absolute UNUSED,
const struct child_process *cmd)
{
const char *event_name = "child_start";
@@ -365,7 +367,8 @@ static void fn_child_start_fl(const char *file, int line,
}
static void fn_child_exit_fl(const char *file, int line,
- uint64_t us_elapsed_absolute, int cid, int pid,
+ uint64_t us_elapsed_absolute UNUSED,
+ int cid, int pid,
int code, uint64_t us_elapsed_child)
{
const char *event_name = "child_exit";
@@ -386,7 +389,8 @@ static void fn_child_exit_fl(const char *file, int line,
}
static void fn_child_ready_fl(const char *file, int line,
- uint64_t us_elapsed_absolute, int cid, int pid,
+ uint64_t us_elapsed_absolute UNUSED,
+ int cid, int pid,
const char *ready, uint64_t us_elapsed_child)
{
const char *event_name = "child_ready";
@@ -407,7 +411,7 @@ static void fn_child_ready_fl(const char *file, int line,
}
static void fn_thread_start_fl(const char *file, int line,
- uint64_t us_elapsed_absolute)
+ uint64_t us_elapsed_absolute UNUSED)
{
const char *event_name = "thread_start";
struct json_writer jw = JSON_WRITER_INIT;
@@ -421,7 +425,7 @@ static void fn_thread_start_fl(const char *file, int line,
}
static void fn_thread_exit_fl(const char *file, int line,
- uint64_t us_elapsed_absolute,
+ uint64_t us_elapsed_absolute UNUSED,
uint64_t us_elapsed_thread)
{
const char *event_name = "thread_exit";
@@ -437,7 +441,8 @@ static void fn_thread_exit_fl(const char *file, int line,
jw_release(&jw);
}
-static void fn_exec_fl(const char *file, int line, uint64_t us_elapsed_absolute,
+static void fn_exec_fl(const char *file, int line,
+ uint64_t us_elapsed_absolute UNUSED,
int exec_id, const char *exe, const char **argv)
{
const char *event_name = "exec";
@@ -458,8 +463,8 @@ static void fn_exec_fl(const char *file, int line, uint64_t us_elapsed_absolute,
}
static void fn_exec_result_fl(const char *file, int line,
- uint64_t us_elapsed_absolute, int exec_id,
- int code)
+ uint64_t us_elapsed_absolute UNUSED,
+ int exec_id, int code)
{
const char *event_name = "exec_result";
struct json_writer jw = JSON_WRITER_INIT;
@@ -475,13 +480,16 @@ static void fn_exec_result_fl(const char *file, int line,
}
static void fn_param_fl(const char *file, int line, const char *param,
- const char *value)
+ const char *value, const struct key_value_info *kvi)
{
const char *event_name = "def_param";
struct json_writer jw = JSON_WRITER_INIT;
+ enum config_scope scope = kvi->scope;
+ const char *scope_name = config_scope_name(scope);
jw_object_begin(&jw, 0);
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);
jw_end(&jw);
@@ -506,7 +514,7 @@ static void fn_repo_fl(const char *file, int line,
}
static void fn_region_enter_printf_va_fl(const char *file, int line,
- uint64_t us_elapsed_absolute,
+ uint64_t us_elapsed_absolute UNUSED,
const char *category,
const char *label,
const struct repository *repo,
@@ -533,7 +541,7 @@ static void fn_region_enter_printf_va_fl(const char *file, int line,
}
static void fn_region_leave_printf_va_fl(
- const char *file, int line, uint64_t us_elapsed_absolute,
+ const char *file, int line, uint64_t us_elapsed_absolute UNUSED,
uint64_t us_elapsed_region, const char *category, const char *label,
const struct repository *repo, const char *fmt, va_list ap)
{
@@ -614,6 +622,48 @@ static void fn_data_json_fl(const char *file, int line,
}
}
+static void fn_timer(const struct tr2_timer_metadata *meta,
+ const struct tr2_timer *timer,
+ int is_final_data)
+{
+ const char *event_name = is_final_data ? "timer" : "th_timer";
+ struct json_writer jw = JSON_WRITER_INIT;
+ double t_total = NS_TO_SEC(timer->total_ns);
+ double t_min = NS_TO_SEC(timer->min_ns);
+ double t_max = NS_TO_SEC(timer->max_ns);
+
+ jw_object_begin(&jw, 0);
+ event_fmt_prepare(event_name, __FILE__, __LINE__, NULL, &jw);
+ jw_object_string(&jw, "category", meta->category);
+ jw_object_string(&jw, "name", meta->name);
+ jw_object_intmax(&jw, "intervals", timer->interval_count);
+ jw_object_double(&jw, "t_total", 6, t_total);
+ jw_object_double(&jw, "t_min", 6, t_min);
+ jw_object_double(&jw, "t_max", 6, t_max);
+ jw_end(&jw);
+
+ tr2_dst_write_line(&tr2dst_event, &jw.json);
+ jw_release(&jw);
+}
+
+static void fn_counter(const struct tr2_counter_metadata *meta,
+ const struct tr2_counter *counter,
+ int is_final_data)
+{
+ const char *event_name = is_final_data ? "counter" : "th_counter";
+ struct json_writer jw = JSON_WRITER_INIT;
+
+ jw_object_begin(&jw, 0);
+ event_fmt_prepare(event_name, __FILE__, __LINE__, NULL, &jw);
+ jw_object_string(&jw, "category", meta->category);
+ jw_object_string(&jw, "name", meta->name);
+ jw_object_intmax(&jw, "count", counter->value);
+ jw_end(&jw);
+
+ tr2_dst_write_line(&tr2dst_event, &jw.json);
+ jw_release(&jw);
+}
+
struct tr2_tgt tr2_tgt_event = {
.pdst = &tr2dst_event,
@@ -645,4 +695,6 @@ struct tr2_tgt tr2_tgt_event = {
.pfn_data_fl = fn_data_fl,
.pfn_data_json_fl = fn_data_json_fl,
.pfn_printf_va_fl = NULL,
+ .pfn_timer = fn_timer,
+ .pfn_counter = fn_counter,
};
diff --git a/trace2/tr2_tgt_normal.c b/trace2/tr2_tgt_normal.c
index c42fbad..baef48a 100644
--- a/trace2/tr2_tgt_normal.c
+++ b/trace2/tr2_tgt_normal.c
@@ -1,6 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "repository.h"
#include "run-command.h"
+#include "strbuf.h"
#include "quote.h"
#include "version.h"
#include "trace2/tr2_dst.h"
@@ -8,6 +10,7 @@
#include "trace2/tr2_tbuf.h"
#include "trace2/tr2_tgt.h"
#include "trace2/tr2_tls.h"
+#include "trace2/tr2_tmr.h"
static struct tr2_dst tr2dst_normal = {
.sysenv_var = TR2_SYSENV_NORMAL,
@@ -84,7 +87,7 @@ static void fn_version_fl(const char *file, int line)
}
static void fn_start_fl(const char *file, int line,
- uint64_t us_elapsed_absolute, const char **argv)
+ uint64_t us_elapsed_absolute UNUSED, const char **argv)
{
struct strbuf buf_payload = STRBUF_INIT;
@@ -213,7 +216,7 @@ static void fn_alias_fl(const char *file, int line, const char *alias,
}
static void fn_child_start_fl(const char *file, int line,
- uint64_t us_elapsed_absolute,
+ uint64_t us_elapsed_absolute UNUSED,
const struct child_process *cmd)
{
struct strbuf buf_payload = STRBUF_INIT;
@@ -241,7 +244,8 @@ static void fn_child_start_fl(const char *file, int line,
}
static void fn_child_exit_fl(const char *file, int line,
- uint64_t us_elapsed_absolute, int cid, int pid,
+ uint64_t us_elapsed_absolute UNUSED,
+ int cid, int pid,
int code, uint64_t us_elapsed_child)
{
struct strbuf buf_payload = STRBUF_INIT;
@@ -254,7 +258,8 @@ static void fn_child_exit_fl(const char *file, int line,
}
static void fn_child_ready_fl(const char *file, int line,
- uint64_t us_elapsed_absolute, int cid, int pid,
+ uint64_t us_elapsed_absolute UNUSED,
+ int cid, int pid,
const char *ready, uint64_t us_elapsed_child)
{
struct strbuf buf_payload = STRBUF_INIT;
@@ -266,7 +271,8 @@ static void fn_child_ready_fl(const char *file, int line,
strbuf_release(&buf_payload);
}
-static void fn_exec_fl(const char *file, int line, uint64_t us_elapsed_absolute,
+static void fn_exec_fl(const char *file, int line,
+ uint64_t us_elapsed_absolute UNUSED,
int exec_id, const char *exe, const char **argv)
{
struct strbuf buf_payload = STRBUF_INIT;
@@ -282,8 +288,8 @@ static void fn_exec_fl(const char *file, int line, uint64_t us_elapsed_absolute,
}
static void fn_exec_result_fl(const char *file, int line,
- uint64_t us_elapsed_absolute, int exec_id,
- int code)
+ uint64_t us_elapsed_absolute UNUSED,
+ int exec_id, int code)
{
struct strbuf buf_payload = STRBUF_INIT;
@@ -295,11 +301,14 @@ static void fn_exec_result_fl(const char *file, int line,
}
static void fn_param_fl(const char *file, int line, const char *param,
- const char *value)
+ const char *value, const struct key_value_info *kvi)
{
struct strbuf buf_payload = STRBUF_INIT;
+ enum config_scope scope = kvi->scope;
+ const char *scope_name = config_scope_name(scope);
- strbuf_addf(&buf_payload, "def_param %s=%s", param, value);
+ strbuf_addf(&buf_payload, "def_param scope:%s %s=%s", scope_name, param,
+ value);
normal_io_write_fl(file, line, &buf_payload);
strbuf_release(&buf_payload);
}
@@ -316,7 +325,8 @@ static void fn_repo_fl(const char *file, int line,
}
static void fn_printf_va_fl(const char *file, int line,
- uint64_t us_elapsed_absolute, const char *fmt,
+ uint64_t us_elapsed_absolute UNUSED,
+ const char *fmt,
va_list ap)
{
struct strbuf buf_payload = STRBUF_INIT;
@@ -326,6 +336,42 @@ static void fn_printf_va_fl(const char *file, int line,
strbuf_release(&buf_payload);
}
+static void fn_timer(const struct tr2_timer_metadata *meta,
+ const struct tr2_timer *timer,
+ int is_final_data)
+{
+ const char *event_name = is_final_data ? "timer" : "th_timer";
+ struct strbuf buf_payload = STRBUF_INIT;
+ double t_total = NS_TO_SEC(timer->total_ns);
+ double t_min = NS_TO_SEC(timer->min_ns);
+ double t_max = NS_TO_SEC(timer->max_ns);
+
+ strbuf_addf(&buf_payload, ("%s %s/%s"
+ " intervals:%"PRIu64
+ " total:%8.6f min:%8.6f max:%8.6f"),
+ event_name, meta->category, meta->name,
+ timer->interval_count,
+ t_total, t_min, t_max);
+
+ normal_io_write_fl(__FILE__, __LINE__, &buf_payload);
+ strbuf_release(&buf_payload);
+}
+
+static void fn_counter(const struct tr2_counter_metadata *meta,
+ const struct tr2_counter *counter,
+ int is_final_data)
+{
+ const char *event_name = is_final_data ? "counter" : "th_counter";
+ struct strbuf buf_payload = STRBUF_INIT;
+
+ strbuf_addf(&buf_payload, "%s %s/%s value:%"PRIu64,
+ event_name, meta->category, meta->name,
+ counter->value);
+
+ normal_io_write_fl(__FILE__, __LINE__, &buf_payload);
+ strbuf_release(&buf_payload);
+}
+
struct tr2_tgt tr2_tgt_normal = {
.pdst = &tr2dst_normal,
@@ -357,4 +403,6 @@ struct tr2_tgt tr2_tgt_normal = {
.pfn_data_fl = NULL,
.pfn_data_json_fl = NULL,
.pfn_printf_va_fl = fn_printf_va_fl,
+ .pfn_timer = fn_timer,
+ .pfn_counter = fn_counter,
};
diff --git a/trace2/tr2_tgt_perf.c b/trace2/tr2_tgt_perf.c
index a1eff8b..a6f9a8a 100644
--- a/trace2/tr2_tgt_perf.c
+++ b/trace2/tr2_tgt_perf.c
@@ -1,5 +1,6 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "repository.h"
#include "run-command.h"
#include "quote.h"
#include "version.h"
@@ -10,6 +11,7 @@
#include "trace2/tr2_tbuf.h"
#include "trace2/tr2_tgt.h"
#include "trace2/tr2_tls.h"
+#include "trace2/tr2_tmr.h"
static struct tr2_dst tr2dst_perf = {
.sysenv_var = TR2_SYSENV_PERF,
@@ -108,7 +110,7 @@ static void perf_fmt_prepare(const char *event_name,
strbuf_addf(buf, "d%d | ", tr2_sid_depth());
strbuf_addf(buf, "%-*s | %-*s | ", TR2_MAX_THREAD_NAME,
- ctx->thread_name.buf, TR2FMT_PERF_MAX_EVENT_NAME,
+ ctx->thread_name, TR2FMT_PERF_MAX_EVENT_NAME,
event_name);
len = buf->len + TR2FMT_PERF_REPO_WIDTH;
@@ -437,16 +439,21 @@ static void fn_exec_result_fl(const char *file, int line,
}
static void fn_param_fl(const char *file, int line, const char *param,
- const char *value)
+ const char *value, const struct key_value_info *kvi)
{
const char *event_name = "def_param";
struct strbuf buf_payload = STRBUF_INIT;
+ struct strbuf scope_payload = STRBUF_INIT;
+ enum config_scope scope = kvi->scope;
+ const char *scope_name = config_scope_name(scope);
strbuf_addf(&buf_payload, "%s:%s", param, value);
+ strbuf_addf(&scope_payload, "%s:%s", "scope", scope_name);
- perf_io_write_fl(file, line, event_name, NULL, NULL, NULL, NULL,
- &buf_payload);
+ perf_io_write_fl(file, line, event_name, NULL, NULL, NULL,
+ scope_payload.buf, &buf_payload);
strbuf_release(&buf_payload);
+ strbuf_release(&scope_payload);
}
static void fn_repo_fl(const char *file, int line,
@@ -550,6 +557,44 @@ static void fn_printf_va_fl(const char *file, int line,
strbuf_release(&buf_payload);
}
+static void fn_timer(const struct tr2_timer_metadata *meta,
+ const struct tr2_timer *timer,
+ int is_final_data)
+{
+ const char *event_name = is_final_data ? "timer" : "th_timer";
+ struct strbuf buf_payload = STRBUF_INIT;
+ double t_total = NS_TO_SEC(timer->total_ns);
+ double t_min = NS_TO_SEC(timer->min_ns);
+ double t_max = NS_TO_SEC(timer->max_ns);
+
+ strbuf_addf(&buf_payload, ("name:%s"
+ " intervals:%"PRIu64
+ " total:%8.6f min:%8.6f max:%8.6f"),
+ meta->name,
+ timer->interval_count,
+ t_total, t_min, t_max);
+
+ perf_io_write_fl(__FILE__, __LINE__, event_name, NULL, NULL, NULL,
+ meta->category, &buf_payload);
+ strbuf_release(&buf_payload);
+}
+
+static void fn_counter(const struct tr2_counter_metadata *meta,
+ const struct tr2_counter *counter,
+ int is_final_data)
+{
+ const char *event_name = is_final_data ? "counter" : "th_counter";
+ struct strbuf buf_payload = STRBUF_INIT;
+
+ strbuf_addf(&buf_payload, "name:%s value:%"PRIu64,
+ meta->name,
+ counter->value);
+
+ perf_io_write_fl(__FILE__, __LINE__, event_name, NULL, NULL, NULL,
+ meta->category, &buf_payload);
+ strbuf_release(&buf_payload);
+}
+
struct tr2_tgt tr2_tgt_perf = {
.pdst = &tr2dst_perf,
@@ -581,4 +626,6 @@ struct tr2_tgt tr2_tgt_perf = {
.pfn_data_fl = fn_data_fl,
.pfn_data_json_fl = fn_data_json_fl,
.pfn_printf_va_fl = fn_printf_va_fl,
+ .pfn_timer = fn_timer,
+ .pfn_counter = fn_counter,
};
diff --git a/trace2/tr2_tls.c b/trace2/tr2_tls.c
index 7da94ab..4f75392 100644
--- a/trace2/tr2_tls.c
+++ b/trace2/tr2_tls.c
@@ -1,5 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "strbuf.h"
#include "thread-utils.h"
+#include "trace.h"
#include "trace2/tr2_tls.h"
/*
@@ -31,10 +33,11 @@ void tr2tls_start_process_clock(void)
tr2tls_us_start_process = getnanotime() / 1000;
}
-struct tr2tls_thread_ctx *tr2tls_create_self(const char *thread_name,
+struct tr2tls_thread_ctx *tr2tls_create_self(const char *thread_base_name,
uint64_t us_thread_start)
{
struct tr2tls_thread_ctx *ctx = xcalloc(1, sizeof(*ctx));
+ struct strbuf buf = STRBUF_INIT;
/*
* Implicitly "tr2tls_push_self()" to capture the thread's start
@@ -47,12 +50,13 @@ struct tr2tls_thread_ctx *tr2tls_create_self(const char *thread_name,
ctx->thread_id = tr2tls_locked_increment(&tr2_next_thread_id);
- strbuf_init(&ctx->thread_name, 0);
+ strbuf_init(&buf, 0);
if (ctx->thread_id)
- strbuf_addf(&ctx->thread_name, "th%02d:", ctx->thread_id);
- strbuf_addstr(&ctx->thread_name, thread_name);
- if (ctx->thread_name.len > TR2_MAX_THREAD_NAME)
- strbuf_setlen(&ctx->thread_name, TR2_MAX_THREAD_NAME);
+ strbuf_addf(&buf, "th%02d:", ctx->thread_id);
+ strbuf_addstr(&buf, thread_base_name);
+ if (buf.len > TR2_MAX_THREAD_NAME)
+ strbuf_setlen(&buf, TR2_MAX_THREAD_NAME);
+ ctx->thread_name = strbuf_detach(&buf, NULL);
pthread_setspecific(tr2tls_key, ctx);
@@ -69,9 +73,9 @@ struct tr2tls_thread_ctx *tr2tls_get_self(void)
ctx = pthread_getspecific(tr2tls_key);
/*
- * If the thread-proc did not call trace2_thread_start(), we won't
- * have any TLS data associated with the current thread. Fix it
- * here and silently continue.
+ * If the current thread's thread-proc did not call
+ * trace2_thread_start(), then the thread will not have any
+ * thread-local storage. Create it now and silently continue.
*/
if (!ctx)
ctx = tr2tls_create_self("unknown", getnanotime() / 1000);
@@ -95,7 +99,7 @@ void tr2tls_unset_self(void)
pthread_setspecific(tr2tls_key, NULL);
- strbuf_release(&ctx->thread_name);
+ free((char *)ctx->thread_name);
free(ctx->array_us_start);
free(ctx);
}
@@ -113,7 +117,7 @@ void tr2tls_pop_self(void)
struct tr2tls_thread_ctx *ctx = tr2tls_get_self();
if (!ctx->nr_open_regions)
- BUG("no open regions in thread '%s'", ctx->thread_name.buf);
+ BUG("no open regions in thread '%s'", ctx->thread_name);
ctx->nr_open_regions--;
}
@@ -179,3 +183,13 @@ int tr2tls_locked_increment(int *p)
return current_value;
}
+
+void tr2tls_lock(void)
+{
+ pthread_mutex_lock(&tr2tls_mutex);
+}
+
+void tr2tls_unlock(void)
+{
+ pthread_mutex_unlock(&tr2tls_mutex);
+}
diff --git a/trace2/tr2_tls.h b/trace2/tr2_tls.h
index b1e327a..3dfe655 100644
--- a/trace2/tr2_tls.h
+++ b/trace2/tr2_tls.h
@@ -1,7 +1,14 @@
#ifndef TR2_TLS_H
#define TR2_TLS_H
-#include "strbuf.h"
+#include "trace2/tr2_ctr.h"
+#include "trace2/tr2_tmr.h"
+
+/*
+ * Notice: the term "TLS" refers to "thread-local storage" in the
+ * Trace2 source files. This usage is borrowed from GCC and Windows.
+ * There is NO relation to "transport layer security".
+ */
/*
* Arbitry limit for thread names for column alignment.
@@ -9,33 +16,40 @@
#define TR2_MAX_THREAD_NAME (24)
struct tr2tls_thread_ctx {
- struct strbuf thread_name;
+ const char *thread_name;
uint64_t *array_us_start;
- int alloc;
- int nr_open_regions; /* plays role of "nr" in ALLOC_GROW */
+ size_t alloc;
+ size_t nr_open_regions; /* plays role of "nr" in ALLOC_GROW */
int thread_id;
+ struct tr2_timer_block timer_block;
+ struct tr2_counter_block counter_block;
+ unsigned int used_any_timer:1;
+ unsigned int used_any_per_thread_timer:1;
+ unsigned int used_any_counter:1;
+ unsigned int used_any_per_thread_counter:1;
};
/*
- * Create TLS data for the current thread. This gives us a place to
- * put per-thread data, such as thread start time, function nesting
- * and a per-thread label for our messages.
- *
- * We assume the first thread is "main". Other threads are given
- * non-zero thread-ids to help distinguish messages from concurrent
- * threads.
+ * Create thread-local storage for the current thread.
*
- * Truncate the thread name if necessary to help with column alignment
- * in printf-style messages.
+ * The first thread in the process will have:
+ * { .thread_id=0, .thread_name="main" }
+ * Subsequent threads are given a non-zero thread_id and a thread_name
+ * constructed from the id and a thread base name (which is usually just
+ * the name of the thread-proc function). For example:
+ * { .thread_id=10, .thread_name="th10:fsm-listen" }
+ * This helps to identify and distinguish messages from concurrent threads.
+ * The ctx.thread_name field is truncated if necessary to help with column
+ * alignment in printf-style messages.
*
* In this and all following functions the term "self" refers to the
* current thread.
*/
-struct tr2tls_thread_ctx *tr2tls_create_self(const char *thread_name,
+struct tr2tls_thread_ctx *tr2tls_create_self(const char *thread_base_name,
uint64_t us_thread_start);
/*
- * Get our TLS data.
+ * Get the thread-local storage pointer of the current thread.
*/
struct tr2tls_thread_ctx *tr2tls_get_self(void);
@@ -45,7 +59,7 @@ struct tr2tls_thread_ctx *tr2tls_get_self(void);
int tr2tls_is_main_thread(void);
/*
- * Free our TLS data.
+ * Free the current thread's thread-local storage.
*/
void tr2tls_unset_self(void);
@@ -81,12 +95,12 @@ uint64_t tr2tls_region_elasped_self(uint64_t us);
uint64_t tr2tls_absolute_elapsed(uint64_t us);
/*
- * Initialize the tr2 TLS system.
+ * Initialize thread-local storage for Trace2.
*/
void tr2tls_init(void);
/*
- * Free all tr2 TLS resources.
+ * Free all Trace2 thread-local storage resources.
*/
void tr2tls_release(void);
@@ -100,4 +114,10 @@ int tr2tls_locked_increment(int *p);
*/
void tr2tls_start_process_clock(void);
+/*
+ * Explicitly lock/unlock our mutex.
+ */
+void tr2tls_lock(void);
+void tr2tls_unlock(void);
+
#endif /* TR2_TLS_H */
diff --git a/trace2/tr2_tmr.c b/trace2/tr2_tmr.c
new file mode 100644
index 0000000..51f564b
--- /dev/null
+++ b/trace2/tr2_tmr.c
@@ -0,0 +1,182 @@
+#include "git-compat-util.h"
+#include "trace2/tr2_tgt.h"
+#include "trace2/tr2_tls.h"
+#include "trace2/tr2_tmr.h"
+#include "trace.h"
+
+#define MY_MAX(a, b) ((a) > (b) ? (a) : (b))
+#define MY_MIN(a, b) ((a) < (b) ? (a) : (b))
+
+/*
+ * A global timer block to aggregate values from the partial sums from
+ * each thread.
+ */
+static struct tr2_timer_block final_timer_block; /* access under tr2tls_mutex */
+
+/*
+ * Define metadata for each stopwatch timer.
+ *
+ * This array must match "enum trace2_timer_id" and the values
+ * in "struct tr2_timer_block.timer[*]".
+ */
+static struct tr2_timer_metadata tr2_timer_metadata[TRACE2_NUMBER_OF_TIMERS] = {
+ [TRACE2_TIMER_ID_TEST1] = {
+ .category = "test",
+ .name = "test1",
+ .want_per_thread_events = 0,
+ },
+ [TRACE2_TIMER_ID_TEST2] = {
+ .category = "test",
+ .name = "test2",
+ .want_per_thread_events = 1,
+ },
+
+ /* Add additional metadata before here. */
+};
+
+void tr2_start_timer(enum trace2_timer_id tid)
+{
+ struct tr2tls_thread_ctx *ctx = tr2tls_get_self();
+ struct tr2_timer *t = &ctx->timer_block.timer[tid];
+
+ t->recursion_count++;
+ if (t->recursion_count > 1)
+ return; /* ignore recursive starts */
+
+ t->start_ns = getnanotime();
+}
+
+void tr2_stop_timer(enum trace2_timer_id tid)
+{
+ struct tr2tls_thread_ctx *ctx = tr2tls_get_self();
+ struct tr2_timer *t = &ctx->timer_block.timer[tid];
+ uint64_t ns_now;
+ uint64_t ns_interval;
+
+ assert(t->recursion_count > 0);
+
+ t->recursion_count--;
+ if (t->recursion_count)
+ return; /* still in recursive call(s) */
+
+ ns_now = getnanotime();
+ ns_interval = ns_now - t->start_ns;
+
+ t->total_ns += ns_interval;
+
+ /*
+ * min_ns was initialized to zero (in the xcalloc()) rather
+ * than UINT_MAX when the block of timers was allocated,
+ * so we should always set both the min_ns and max_ns values
+ * the first time that the timer is used.
+ */
+ if (!t->interval_count) {
+ t->min_ns = ns_interval;
+ t->max_ns = ns_interval;
+ } else {
+ t->min_ns = MY_MIN(ns_interval, t->min_ns);
+ t->max_ns = MY_MAX(ns_interval, t->max_ns);
+ }
+
+ t->interval_count++;
+
+ ctx->used_any_timer = 1;
+ if (tr2_timer_metadata[tid].want_per_thread_events)
+ ctx->used_any_per_thread_timer = 1;
+}
+
+void tr2_update_final_timers(void)
+{
+ struct tr2tls_thread_ctx *ctx = tr2tls_get_self();
+ enum trace2_timer_id tid;
+
+ if (!ctx->used_any_timer)
+ return;
+
+ /*
+ * Accessing `final_timer_block` requires holding `tr2tls_mutex`.
+ * We assume that our caller is holding the lock.
+ */
+
+ for (tid = 0; tid < TRACE2_NUMBER_OF_TIMERS; tid++) {
+ struct tr2_timer *t_final = &final_timer_block.timer[tid];
+ struct tr2_timer *t = &ctx->timer_block.timer[tid];
+
+ if (t->recursion_count) {
+ /*
+ * The current thread is exiting with
+ * timer[tid] still running.
+ *
+ * Technically, this is a bug, but I'm going
+ * to ignore it.
+ *
+ * I don't think it is worth calling die()
+ * for. I don't think it is worth killing the
+ * process for this bookkeeping error. We
+ * might want to call warning(), but I'm going
+ * to wait on that.
+ *
+ * The downside here is that total_ns won't
+ * include the current open interval (now -
+ * start_ns). I can live with that.
+ */
+ }
+
+ if (!t->interval_count)
+ continue; /* this timer was not used by this thread */
+
+ t_final->total_ns += t->total_ns;
+
+ /*
+ * final_timer_block.timer[tid].min_ns was initialized to
+ * was initialized to zero rather than UINT_MAX, so we should
+ * always set both the min_ns and max_ns values the first time
+ * that we add a partial sum into it.
+ */
+ if (!t_final->interval_count) {
+ t_final->min_ns = t->min_ns;
+ t_final->max_ns = t->max_ns;
+ } else {
+ t_final->min_ns = MY_MIN(t_final->min_ns, t->min_ns);
+ t_final->max_ns = MY_MAX(t_final->max_ns, t->max_ns);
+ }
+
+ t_final->interval_count += t->interval_count;
+ }
+}
+
+void tr2_emit_per_thread_timers(tr2_tgt_evt_timer_t *fn_apply)
+{
+ struct tr2tls_thread_ctx *ctx = tr2tls_get_self();
+ enum trace2_timer_id tid;
+
+ if (!ctx->used_any_per_thread_timer)
+ return;
+
+ /*
+ * For each timer, if the timer wants per-thread events and
+ * this thread used it, emit it.
+ */
+ for (tid = 0; tid < TRACE2_NUMBER_OF_TIMERS; tid++)
+ if (tr2_timer_metadata[tid].want_per_thread_events &&
+ ctx->timer_block.timer[tid].interval_count)
+ fn_apply(&tr2_timer_metadata[tid],
+ &ctx->timer_block.timer[tid],
+ 0);
+}
+
+void tr2_emit_final_timers(tr2_tgt_evt_timer_t *fn_apply)
+{
+ enum trace2_timer_id tid;
+
+ /*
+ * Accessing `final_timer_block` requires holding `tr2tls_mutex`.
+ * We assume that our caller is holding the lock.
+ */
+
+ for (tid = 0; tid < TRACE2_NUMBER_OF_TIMERS; tid++)
+ if (final_timer_block.timer[tid].interval_count)
+ fn_apply(&tr2_timer_metadata[tid],
+ &final_timer_block.timer[tid],
+ 1);
+}
diff --git a/trace2/tr2_tmr.h b/trace2/tr2_tmr.h
new file mode 100644
index 0000000..d575357
--- /dev/null
+++ b/trace2/tr2_tmr.h
@@ -0,0 +1,140 @@
+#ifndef TR2_TMR_H
+#define TR2_TMR_H
+
+#include "trace2.h"
+#include "trace2/tr2_tgt.h"
+
+/*
+ * Define a mechanism to allow "stopwatch" timers.
+ *
+ * Timers can be used to measure "interesting" activity that does not
+ * fit the "region" model, such as code called from many different
+ * regions (like zlib) and/or where data for individual calls are not
+ * interesting or are too numerous to be efficiently logged.
+ *
+ * Timer values are accumulated during program execution and emitted
+ * to the Trace2 logs at program exit.
+ *
+ * To make this model efficient, we define a compile-time fixed set of
+ * timers and timer ids using a "timer block" array in thread-local
+ * storage. This gives us constant time access to each timer within
+ * each thread, since we want start/stop operations to be as fast as
+ * possible. This lets us avoid the complexities of dynamically
+ * allocating a timer on the first use by a thread and/or possibly
+ * sharing that timer definition with other concurrent threads.
+ * However, this does require that we define time the set of timers at
+ * compile time.
+ *
+ * Each thread uses the timer block in its thread-local storage to
+ * compute partial sums for each timer (without locking). When a
+ * thread exits, those partial sums are (under lock) added to the
+ * global final sum.
+ *
+ * Using this "timer block" model costs ~48 bytes per timer per thread
+ * (we have about six uint64 fields per timer). This does increase
+ * the size of the thread-local storage block, but it is allocated (at
+ * thread create time) and not on the thread stack, so I'm not worried
+ * about the size.
+ *
+ * Partial sums for each timer are optionally emitted when a thread
+ * exits.
+ *
+ * Final sums for each timer are emitted between the "exit" and
+ * "atexit" events.
+ *
+ * A parallel "timer metadata" table contains the "category" and "name"
+ * fields for each timer. This eliminates the need to include those
+ * args in the various timer APIs.
+ */
+
+/*
+ * The definition of an individual timer and used by an individual
+ * thread.
+ */
+struct tr2_timer {
+ /*
+ * Total elapsed time for this timer in this thread in nanoseconds.
+ */
+ uint64_t total_ns;
+
+ /*
+ * The maximum and minimum interval values observed for this
+ * timer in this thread.
+ */
+ uint64_t min_ns;
+ uint64_t max_ns;
+
+ /*
+ * The value of the clock when this timer was started in this
+ * thread. (Undefined when the timer is not active in this
+ * thread.)
+ */
+ uint64_t start_ns;
+
+ /*
+ * Number of times that this timer has been started and stopped
+ * in this thread. (Recursive starts are ignored.)
+ */
+ uint64_t interval_count;
+
+ /*
+ * Number of nested starts on the stack in this thread. (We
+ * ignore recursive starts and use this to track the recursive
+ * calls.)
+ */
+ unsigned int recursion_count;
+};
+
+/*
+ * Metadata for a timer.
+ */
+struct tr2_timer_metadata {
+ const char *category;
+ const char *name;
+
+ /*
+ * True if we should emit per-thread events for this timer
+ * when individual threads exit.
+ */
+ unsigned int want_per_thread_events:1;
+};
+
+/*
+ * A compile-time fixed-size block of timers to insert into
+ * thread-local storage. This wrapper is used to avoid quirks
+ * of C and the usual need to pass an array size argument.
+ */
+struct tr2_timer_block {
+ struct tr2_timer timer[TRACE2_NUMBER_OF_TIMERS];
+};
+
+/*
+ * Private routines used by trace2.c to actually start/stop an
+ * individual timer in the current thread.
+ */
+void tr2_start_timer(enum trace2_timer_id tid);
+void tr2_stop_timer(enum trace2_timer_id tid);
+
+/*
+ * Add the current thread's timer data to the global totals.
+ * This is called during thread-exit.
+ *
+ * Caller must be holding the tr2tls_mutex.
+ */
+void tr2_update_final_timers(void);
+
+/*
+ * Emit per-thread timer data for the current thread.
+ * This is called during thread-exit.
+ */
+void tr2_emit_per_thread_timers(tr2_tgt_evt_timer_t *fn_apply);
+
+/*
+ * Emit global total timer values.
+ * This is called during atexit handling.
+ *
+ * Caller must be holding the tr2tls_mutex.
+ */
+void tr2_emit_final_timers(tr2_tgt_evt_timer_t *fn_apply);
+
+#endif /* TR2_TMR_H */
diff --git a/trailer.c b/trailer.c
index d419c20..dc15d85 100644
--- a/trailer.c
+++ b/trailer.c
@@ -1,9 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "string-list.h"
#include "run-command.h"
#include "commit.h"
-#include "tempfile.h"
#include "trailer.h"
#include "list.h"
/*
@@ -143,12 +144,12 @@ static char last_non_space_char(const char *s)
return '\0';
}
-static void print_tok_val(FILE *outfile, const char *tok, const char *val)
+static void print_tok_val(struct strbuf *out, const char *tok, const char *val)
{
char c;
if (!tok) {
- fprintf(outfile, "%s\n", val);
+ strbuf_addf(out, "%s\n", val);
return;
}
@@ -156,21 +157,22 @@ static void print_tok_val(FILE *outfile, const char *tok, const char *val)
if (!c)
return;
if (strchr(separators, c))
- fprintf(outfile, "%s%s\n", tok, val);
+ strbuf_addf(out, "%s%s\n", tok, val);
else
- fprintf(outfile, "%s%c %s\n", tok, separators[0], val);
+ strbuf_addf(out, "%s%c %s\n", tok, separators[0], val);
}
-static void print_all(FILE *outfile, struct list_head *head,
- const struct process_trailer_options *opts)
+void format_trailers(const struct process_trailer_options *opts,
+ struct list_head *trailers,
+ struct strbuf *out)
{
struct list_head *pos;
struct trailer_item *item;
- list_for_each(pos, head) {
+ list_for_each(pos, trailers) {
item = list_entry(pos, struct trailer_item, list);
if ((!opts->trim_empty || strlen(item->value) > 0) &&
(!opts->only_trailers || item->token))
- print_tok_val(outfile, item->token, item->value);
+ print_tok_val(out, item->token, item->value);
}
}
@@ -364,8 +366,8 @@ static int find_same_and_apply_arg(struct list_head *head,
return 0;
}
-static void process_trailers_lists(struct list_head *head,
- struct list_head *arg_head)
+void process_trailers_lists(struct list_head *head,
+ struct list_head *arg_head)
{
struct list_head *pos, *p;
struct arg_item *arg_tok;
@@ -478,7 +480,9 @@ static struct {
{ "ifmissing", TRAILER_IF_MISSING }
};
-static int git_trailer_default_config(const char *conf_key, const char *value, void *cb)
+static int git_trailer_default_config(const char *conf_key, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *cb UNUSED)
{
const char *trailer_item, *variable_name;
@@ -503,13 +507,17 @@ static int git_trailer_default_config(const char *conf_key, const char *value, v
warning(_("unknown value '%s' for key '%s'"),
value, conf_key);
} else if (!strcmp(trailer_item, "separators")) {
+ if (!value)
+ return config_error_nonbool(conf_key);
separators = xstrdup(value);
}
}
return 0;
}
-static int git_trailer_config(const char *conf_key, const char *value, void *cb)
+static int git_trailer_config(const char *conf_key, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *cb UNUSED)
{
const char *trailer_item, *variable_name;
struct arg_item *item;
@@ -545,16 +553,22 @@ static int git_trailer_config(const char *conf_key, const char *value, void *cb)
case TRAILER_KEY:
if (conf->key)
warning(_("more than one %s"), conf_key);
+ if (!value)
+ return config_error_nonbool(conf_key);
conf->key = xstrdup(value);
break;
case TRAILER_COMMAND:
if (conf->command)
warning(_("more than one %s"), conf_key);
+ if (!value)
+ return config_error_nonbool(conf_key);
conf->command = xstrdup(value);
break;
case TRAILER_CMD:
if (conf->cmd)
warning(_("more than one %s"), conf_key);
+ if (!value)
+ return config_error_nonbool(conf_key);
conf->cmd = xstrdup(value);
break;
case TRAILER_WHERE:
@@ -575,7 +589,7 @@ static int git_trailer_config(const char *conf_key, const char *value, void *cb)
return 0;
}
-static void ensure_configured(void)
+void trailer_config_init(void)
{
if (configured)
return;
@@ -705,30 +719,35 @@ static void add_arg_item(struct list_head *arg_head, char *tok, char *val,
list_add_tail(&new_item->list, arg_head);
}
-static void process_command_line_args(struct list_head *arg_head,
- struct list_head *new_trailer_head)
+void parse_trailers_from_config(struct list_head *config_head)
{
struct arg_item *item;
- struct strbuf tok = STRBUF_INIT;
- struct strbuf val = STRBUF_INIT;
- const struct conf_info *conf;
struct list_head *pos;
- /*
- * In command-line arguments, '=' is accepted (in addition to the
- * separators that are defined).
- */
- char *cl_separators = xstrfmt("=%s", separators);
-
/* Add an arg item for each configured trailer with a command */
list_for_each(pos, &conf_head) {
item = list_entry(pos, struct arg_item, list);
if (item->conf.command)
- add_arg_item(arg_head,
+ add_arg_item(config_head,
xstrdup(token_from_item(item, NULL)),
xstrdup(""),
&item->conf, NULL);
}
+}
+
+void parse_trailers_from_command_line_args(struct list_head *arg_head,
+ struct list_head *new_trailer_head)
+{
+ struct strbuf tok = STRBUF_INIT;
+ struct strbuf val = STRBUF_INIT;
+ const struct conf_info *conf;
+ struct list_head *pos;
+
+ /*
+ * In command-line arguments, '=' is accepted (in addition to the
+ * separators that are defined).
+ */
+ char *cl_separators = xstrfmt("=%s", separators);
/* Add an arg item for each trailer on the command line */
list_for_each(pos, new_trailer_head) {
@@ -756,17 +775,6 @@ static void process_command_line_args(struct list_head *arg_head,
free(cl_separators);
}
-static void read_input_file(struct strbuf *sb, const char *file)
-{
- if (file) {
- if (strbuf_read_file(sb, file, 0) < 0)
- die_errno(_("could not read input file '%s'"), file);
- } else {
- if (strbuf_read(sb, fileno(stdin), 0) < 0)
- die_errno(_("could not read from stdin"));
- }
-}
-
static const char *next_line(const char *str)
{
const char *nl = strchrnul(str, '\n');
@@ -798,28 +806,55 @@ static ssize_t last_line(const char *buf, size_t len)
}
/*
- * Return the position of the start of the patch or the length of str if there
- * is no patch in the message.
+ * Find the end of the log message as an offset from the start of the input
+ * (where callers of this function are interested in looking for a trailers
+ * block in the same input). We have to consider two categories of content that
+ * can come at the end of the input which we want to ignore (because they don't
+ * belong in the log message):
+ *
+ * (1) the "patch part" which begins with a "---" divider and has patch
+ * information (like the output of git-format-patch), and
+ *
+ * (2) any trailing comment lines, blank lines like in the output of "git
+ * commit -v", or stuff below the "cut" (scissor) line.
+ *
+ * As a formula, the situation looks like this:
+ *
+ * INPUT = LOG MESSAGE + IGNORED
+ *
+ * where IGNORED can be either of the two categories described above. It may be
+ * that there is nothing to ignore. Now it may be the case that the LOG MESSAGE
+ * contains a trailer block, but that's not the concern of this function.
*/
-static size_t find_patch_start(const char *str)
+static size_t find_end_of_log_message(const char *input, int no_divider)
{
+ size_t end;
const char *s;
- for (s = str; *s; s = next_line(s)) {
- const char *v;
+ /* Assume the naive end of the input is already what we want. */
+ end = strlen(input);
+
+ /* Optionally skip over any patch part ("---" line and below). */
+ if (!no_divider) {
+ for (s = input; *s; s = next_line(s)) {
+ const char *v;
- if (skip_prefix(s, "---", &v) && isspace(*v))
- return s - str;
+ if (skip_prefix(s, "---", &v) && isspace(*v)) {
+ end = s - input;
+ break;
+ }
+ }
}
- return s - str;
+ /* Skip over other ignorable bits. */
+ return end - ignored_log_message_bytes(input, end);
}
/*
* Return the position of the first trailer line or len if there are no
* trailers.
*/
-static size_t find_trailer_start(const char *buf, size_t len)
+static size_t find_trailer_block_start(const char *buf, size_t len)
{
const char *s;
ssize_t end_of_title, l;
@@ -836,7 +871,7 @@ static size_t find_trailer_start(const char *buf, size_t len)
/* The first paragraph is the title and cannot be trailers */
for (s = buf; s < buf + len; s = next_line(s)) {
- if (s[0] == comment_line_char)
+ if (starts_with_mem(s, buf + len - s, comment_line_str))
continue;
if (is_blank_line(s))
break;
@@ -856,7 +891,7 @@ static size_t find_trailer_start(const char *buf, size_t len)
const char **p;
ssize_t separator_pos;
- if (bol[0] == comment_line_char) {
+ if (starts_with_mem(bol, buf + len - bol, comment_line_str)) {
non_trailer_lines += possible_continuation_lines;
possible_continuation_lines = 0;
continue;
@@ -914,12 +949,6 @@ continue_outer_loop:
return len;
}
-/* Return the position of the end of the trailers. */
-static size_t find_trailer_end(const char *buf, size_t len)
-{
- return len - ignore_non_trailer(buf, len);
-}
-
static int ends_with_blank_line(const char *buf, size_t len)
{
ssize_t ll = last_line(buf, len);
@@ -955,29 +984,25 @@ static void unfold_value(struct strbuf *val)
strbuf_release(&out);
}
-static size_t process_input_file(FILE *outfile,
- const char *str,
- struct list_head *head,
- const struct process_trailer_options *opts)
+/*
+ * Parse trailers in "str", populating the trailer info and "head"
+ * linked list structure.
+ */
+void parse_trailers(const struct process_trailer_options *opts,
+ struct trailer_info *info,
+ const char *str,
+ struct list_head *head)
{
- struct trailer_info info;
struct strbuf tok = STRBUF_INIT;
struct strbuf val = STRBUF_INIT;
size_t i;
- trailer_info_get(&info, str, opts);
-
- /* Print lines before the trailers as is */
- if (!opts->only_trailers)
- fwrite(str, 1, info.trailer_start - str, outfile);
-
- if (!opts->only_trailers && !info.blank_line_before_trailer)
- fprintf(outfile, "\n");
+ trailer_info_get(opts, str, info);
- for (i = 0; i < info.trailer_nr; i++) {
+ for (i = 0; i < info->trailer_nr; i++) {
int separator_pos;
- char *trailer = info.trailers[i];
- if (trailer[0] == comment_line_char)
+ char *trailer = info->trailers[i];
+ if (starts_with(trailer, comment_line_str))
continue;
separator_pos = find_separator(trailer, separators);
if (separator_pos >= 1) {
@@ -996,113 +1021,34 @@ static size_t process_input_file(FILE *outfile,
strbuf_detach(&val, NULL));
}
}
-
- trailer_info_release(&info);
-
- return info.trailer_end - str;
}
-static void free_all(struct list_head *head)
+void free_trailers(struct list_head *trailers)
{
struct list_head *pos, *p;
- list_for_each_safe(pos, p, head) {
+ list_for_each_safe(pos, p, trailers) {
list_del(pos);
free_trailer_item(list_entry(pos, struct trailer_item, list));
}
}
-static struct tempfile *trailers_tempfile;
-
-static FILE *create_in_place_tempfile(const char *file)
+void trailer_info_get(const struct process_trailer_options *opts,
+ const char *str,
+ struct trailer_info *info)
{
- struct stat st;
- struct strbuf filename_template = STRBUF_INIT;
- const char *tail;
- FILE *outfile;
-
- if (stat(file, &st))
- die_errno(_("could not stat %s"), file);
- if (!S_ISREG(st.st_mode))
- die(_("file %s is not a regular file"), file);
- if (!(st.st_mode & S_IWUSR))
- die(_("file %s is not writable by user"), file);
-
- /* Create temporary file in the same directory as the original */
- tail = strrchr(file, '/');
- if (tail)
- strbuf_add(&filename_template, file, tail - file + 1);
- strbuf_addstr(&filename_template, "git-interpret-trailers-XXXXXX");
-
- trailers_tempfile = xmks_tempfile_m(filename_template.buf, st.st_mode);
- strbuf_release(&filename_template);
- outfile = fdopen_tempfile(trailers_tempfile, "w");
- if (!outfile)
- die_errno(_("could not open temporary file"));
-
- return outfile;
-}
-
-void process_trailers(const char *file,
- const struct process_trailer_options *opts,
- struct list_head *new_trailer_head)
-{
- LIST_HEAD(head);
- struct strbuf sb = STRBUF_INIT;
- size_t trailer_end;
- FILE *outfile = stdout;
-
- ensure_configured();
-
- read_input_file(&sb, file);
-
- if (opts->in_place)
- outfile = create_in_place_tempfile(file);
-
- /* Print the lines before the trailers */
- trailer_end = process_input_file(outfile, sb.buf, &head, opts);
-
- if (!opts->only_input) {
- LIST_HEAD(arg_head);
- process_command_line_args(&arg_head, new_trailer_head);
- process_trailers_lists(&head, &arg_head);
- }
-
- print_all(outfile, &head, opts);
-
- free_all(&head);
-
- /* Print the lines after the trailers as is */
- if (!opts->only_trailers)
- fwrite(sb.buf + trailer_end, 1, sb.len - trailer_end, outfile);
-
- if (opts->in_place)
- if (rename_tempfile(&trailers_tempfile, file))
- die_errno(_("could not rename temporary file to %s"), file);
-
- strbuf_release(&sb);
-}
-
-void trailer_info_get(struct trailer_info *info, const char *str,
- const struct process_trailer_options *opts)
-{
- int patch_start, trailer_end, trailer_start;
+ size_t end_of_log_message = 0, trailer_block_start = 0;
struct strbuf **trailer_lines, **ptr;
char **trailer_strings = NULL;
size_t nr = 0, alloc = 0;
char **last = NULL;
- ensure_configured();
+ trailer_config_init();
- if (opts->no_divider)
- patch_start = strlen(str);
- else
- patch_start = find_patch_start(str);
-
- trailer_end = find_trailer_end(str, patch_start);
- trailer_start = find_trailer_start(str, trailer_end);
+ end_of_log_message = find_end_of_log_message(str, opts->no_divider);
+ trailer_block_start = find_trailer_block_start(str, end_of_log_message);
- trailer_lines = strbuf_split_buf(str + trailer_start,
- trailer_end - trailer_start,
+ trailer_lines = strbuf_split_buf(str + trailer_block_start,
+ end_of_log_message - trailer_block_start,
'\n',
0);
for (ptr = trailer_lines; *ptr; ptr++) {
@@ -1123,9 +1069,9 @@ void trailer_info_get(struct trailer_info *info, const char *str,
strbuf_list_free(trailer_lines);
info->blank_line_before_trailer = ends_with_blank_line(str,
- trailer_start);
- info->trailer_start = str + trailer_start;
- info->trailer_end = str + trailer_end;
+ trailer_block_start);
+ info->trailer_block_start = trailer_block_start;
+ info->trailer_block_end = end_of_log_message;
info->trailers = trailer_strings;
info->trailer_nr = nr;
}
@@ -1138,22 +1084,13 @@ void trailer_info_release(struct trailer_info *info)
free(info->trailers);
}
-static void format_trailer_info(struct strbuf *out,
+static void format_trailer_info(const struct process_trailer_options *opts,
const struct trailer_info *info,
- const struct process_trailer_options *opts)
+ struct strbuf *out)
{
size_t origlen = out->len;
size_t i;
- /* If we want the whole block untouched, we can take the fast path. */
- if (!opts->only_trailers && !opts->unfold && !opts->filter &&
- !opts->separator && !opts->key_only && !opts->value_only &&
- !opts->key_value_separator) {
- strbuf_add(out, info->trailer_start,
- info->trailer_end - info->trailer_start);
- return;
- }
-
for (i = 0; i < info->trailer_nr; i++) {
char *trailer = info->trailers[i];
ssize_t separator_pos = find_separator(trailer, separators);
@@ -1198,13 +1135,25 @@ static void format_trailer_info(struct strbuf *out,
}
-void format_trailers_from_commit(struct strbuf *out, const char *msg,
- const struct process_trailer_options *opts)
+void format_trailers_from_commit(const struct process_trailer_options *opts,
+ const char *msg,
+ struct strbuf *out)
{
+ LIST_HEAD(trailer_objects);
struct trailer_info info;
- trailer_info_get(&info, msg, opts);
- format_trailer_info(out, &info, opts);
+ parse_trailers(opts, &info, msg, &trailer_objects);
+
+ /* If we want the whole block untouched, we can take the fast path. */
+ if (!opts->only_trailers && !opts->unfold && !opts->filter &&
+ !opts->separator && !opts->key_only && !opts->value_only &&
+ !opts->key_value_separator) {
+ strbuf_add(out, msg + info.trailer_block_start,
+ info.trailer_block_end - info.trailer_block_start);
+ } else
+ format_trailer_info(opts, &info, out);
+
+ free_trailers(&trailer_objects);
trailer_info_release(&info);
}
@@ -1214,14 +1163,14 @@ void trailer_iterator_init(struct trailer_iterator *iter, const char *msg)
strbuf_init(&iter->key, 0);
strbuf_init(&iter->val, 0);
opts.no_divider = 1;
- trailer_info_get(&iter->info, msg, &opts);
- iter->cur = 0;
+ trailer_info_get(&opts, msg, &iter->internal.info);
+ iter->internal.cur = 0;
}
int trailer_iterator_advance(struct trailer_iterator *iter)
{
- while (iter->cur < iter->info.trailer_nr) {
- char *trailer = iter->info.trailers[iter->cur++];
+ while (iter->internal.cur < iter->internal.info.trailer_nr) {
+ char *trailer = iter->internal.info.trailers[iter->internal.cur++];
int separator_pos = find_separator(trailer, separators);
if (separator_pos < 1)
@@ -1231,6 +1180,7 @@ int trailer_iterator_advance(struct trailer_iterator *iter)
strbuf_reset(&iter->val);
parse_trailer(&iter->key, &iter->val, NULL,
trailer, separator_pos);
+ /* Always unfold values during iteration. */
unfold_value(&iter->val);
return 1;
}
@@ -1239,7 +1189,7 @@ int trailer_iterator_advance(struct trailer_iterator *iter)
void trailer_iterator_release(struct trailer_iterator *iter)
{
- trailer_info_release(&iter->info);
+ trailer_info_release(&iter->internal.info);
strbuf_release(&iter->val);
strbuf_release(&iter->key);
}
diff --git a/trailer.h b/trailer.h
index 795d2fc..1d106b6 100644
--- a/trailer.h
+++ b/trailer.h
@@ -32,16 +32,16 @@ int trailer_set_if_missing(enum trailer_if_missing *item, const char *value);
struct trailer_info {
/*
* True if there is a blank line before the location pointed to by
- * trailer_start.
+ * trailer_block_start.
*/
int blank_line_before_trailer;
/*
- * Pointers to the start and end of the trailer block found. If there
- * is no trailer block found, these 2 pointers point to the end of the
- * input string.
+ * Offsets to the trailer block start and end positions in the input
+ * string. If no trailer block is found, these are both set to the
+ * "true" end of the input (find_end_of_log_message()).
*/
- const char *trailer_start, *trailer_end;
+ size_t trailer_block_start, trailer_block_end;
/*
* Array of trailers found.
@@ -81,15 +81,31 @@ struct process_trailer_options {
#define PROCESS_TRAILER_OPTIONS_INIT {0}
-void process_trailers(const char *file,
- const struct process_trailer_options *opts,
- struct list_head *new_trailer_head);
+void parse_trailers_from_config(struct list_head *config_head);
-void trailer_info_get(struct trailer_info *info, const char *str,
- const struct process_trailer_options *opts);
+void parse_trailers_from_command_line_args(struct list_head *arg_head,
+ struct list_head *new_trailer_head);
+
+void process_trailers_lists(struct list_head *head,
+ struct list_head *arg_head);
+
+void parse_trailers(const struct process_trailer_options *,
+ struct trailer_info *,
+ const char *str,
+ struct list_head *head);
+
+void trailer_info_get(const struct process_trailer_options *,
+ const char *str,
+ struct trailer_info *);
void trailer_info_release(struct trailer_info *info);
+void trailer_config_init(void);
+void format_trailers(const struct process_trailer_options *,
+ struct list_head *trailers,
+ struct strbuf *out);
+void free_trailers(struct list_head *);
+
/*
* Format the trailers from the commit msg "msg" into the strbuf "out".
* Note two caveats about "opts":
@@ -101,8 +117,9 @@ void trailer_info_release(struct trailer_info *info);
* only the trailer block itself, even if the "only_trailers" option is not
* set.
*/
-void format_trailers_from_commit(struct strbuf *out, const char *msg,
- const struct process_trailer_options *opts);
+void format_trailers_from_commit(const struct process_trailer_options *opts,
+ const char *msg,
+ struct strbuf *out);
/*
* An interface for iterating over the trailers found in a particular commit
@@ -119,8 +136,10 @@ struct trailer_iterator {
struct strbuf val;
/* private */
- struct trailer_info info;
- size_t cur;
+ struct {
+ struct trailer_info info;
+ size_t cur;
+ } internal;
};
/*
diff --git a/transport-helper.c b/transport-helper.c
index 322c722..8d284b2 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -1,10 +1,13 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "transport.h"
#include "quote.h"
#include "run-command.h"
#include "commit.h"
-#include "diff.h"
-#include "revision.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-name.h"
+#include "repository.h"
#include "remote.h"
#include "string-list.h"
#include "thread-utils.h"
@@ -14,6 +17,7 @@
#include "refspec.h"
#include "transport-internal.h"
#include "protocol.h"
+#include "packfile.h"
static int debug;
@@ -429,6 +433,8 @@ static int fetch_with_fetch(struct transport *transport,
warning(_("%s unexpectedly said: '%s'"), data->name, buf.buf);
}
strbuf_release(&buf);
+
+ reprepare_packed_git(the_repository);
return 0;
}
@@ -623,7 +629,8 @@ static int process_connect_service(struct transport *transport,
ret = run_connect(transport, &cmdbuf);
} else if (data->stateless_connect &&
(get_protocol_version_config() == protocol_v2) &&
- !strcmp("git-upload-pack", name)) {
+ (!strcmp("git-upload-pack", name) ||
+ !strcmp("git-upload-archive", name))) {
strbuf_addf(&cmdbuf, "stateless-connect %s\n", name);
ret = run_connect(transport, &cmdbuf);
if (ret)
@@ -640,6 +647,7 @@ static int process_connect(struct transport *transport,
struct helper_data *data = transport->data;
const char *name;
const char *exec;
+ int ret;
name = for_push ? "git-receive-pack" : "git-upload-pack";
if (for_push)
@@ -647,7 +655,10 @@ static int process_connect(struct transport *transport,
else
exec = data->transport_options.uploadpack;
- return process_connect_service(transport, name, exec);
+ ret = process_connect_service(transport, name, exec);
+ if (ret)
+ do_take_over(transport);
+ return ret;
}
static int connect_helper(struct transport *transport, const char *name,
@@ -657,14 +668,14 @@ static int connect_helper(struct transport *transport, const char *name,
/* Get_helper so connect is inited. */
get_helper(transport);
- if (!data->connect)
- die(_("operation not supported by protocol"));
if (!process_connect_service(transport, name, exec))
die(_("can't connect to subservice %s"), name);
fd[0] = data->helper->out;
fd[1] = data->helper->in;
+
+ do_take_over(transport);
return 0;
}
@@ -679,10 +690,8 @@ static int fetch_refs(struct transport *transport,
get_helper(transport);
- if (process_connect(transport, 0)) {
- do_take_over(transport);
+ if (process_connect(transport, 0))
return transport->vtable->fetch_refs(transport, nr_heads, to_fetch);
- }
/*
* If we reach here, then the server, the client, and/or the transport
@@ -1069,7 +1078,7 @@ static int push_refs_with_export(struct transport *transport,
set_common_push_options(transport, data->name, flags);
if (flags & TRANSPORT_PUSH_FORCE) {
if (set_helper_option(transport, "force", "true") != 0)
- warning(_("helper %s does not support 'force'"), data->name);
+ warning(_("helper %s does not support '--force'"), data->name);
}
helper = get_helper(transport);
@@ -1081,7 +1090,7 @@ static int push_refs_with_export(struct transport *transport,
struct object_id oid;
private = apply_refspecs(&data->rs, ref->name);
- if (private && !get_oid(private, &oid)) {
+ if (private && !repo_get_oid(the_repository, private, &oid)) {
strbuf_addf(&buf, "^%s", private);
string_list_append_nodup(&revlist_args,
strbuf_detach(&buf, NULL));
@@ -1139,10 +1148,8 @@ static int push_refs(struct transport *transport,
{
struct helper_data *data = transport->data;
- if (process_connect(transport, 1)) {
- do_take_over(transport);
+ if (process_connect(transport, 1))
return transport->vtable->push_refs(transport, remote_refs, flags);
- }
if (!remote_refs) {
fprintf(stderr,
@@ -1183,11 +1190,9 @@ static struct ref *get_refs_list(struct transport *transport, int for_push,
{
get_helper(transport);
- if (process_connect(transport, for_push)) {
- do_take_over(transport);
+ if (process_connect(transport, for_push))
return transport->vtable->get_refs_list(transport, for_push,
transport_options);
- }
return get_refs_list_using_list(transport, for_push);
}
@@ -1205,16 +1210,13 @@ static struct ref *get_refs_list_using_list(struct transport *transport,
data->get_refs_list_called = 1;
helper = get_helper(transport);
- if (data->object_format) {
- write_str_in_full(helper->in, "option object-format\n");
- if (recvline(data, &buf) || strcmp(buf.buf, "ok"))
- exit(128);
- }
+ if (data->object_format)
+ set_helper_option(transport, "object-format", "true");
if (data->push && for_push)
- write_str_in_full(helper->in, "list for-push\n");
+ write_constant(helper->in, "list for-push\n");
else
- write_str_in_full(helper->in, "list\n");
+ write_constant(helper->in, "list\n");
while (1) {
char *eov, *eon;
@@ -1267,9 +1269,20 @@ static struct ref *get_refs_list_using_list(struct transport *transport,
return ret;
}
+static int get_bundle_uri(struct transport *transport)
+{
+ get_helper(transport);
+
+ if (process_connect(transport, 0))
+ return transport->vtable->get_bundle_uri(transport);
+
+ return -1;
+}
+
static struct transport_vtable vtable = {
.set_option = set_helper_option,
.get_refs_list = get_refs_list,
+ .get_bundle_uri = get_bundle_uri,
.fetch_refs = fetch_refs,
.push_refs = push_refs,
.connect = connect_helper,
@@ -1286,6 +1299,8 @@ int transport_helper_init(struct transport *transport, const char *name)
if (getenv("GIT_TRANSPORT_HELPER_DEBUG"))
debug = 1;
+ list_objects_filter_init(&data->transport_options.filter_options);
+
transport->data = data;
transport->vtable = &vtable;
transport->smart_options = &(data->transport_options);
diff --git a/transport-internal.h b/transport-internal.h
index c4ca0b7..90ea749 100644
--- a/transport-internal.h
+++ b/transport-internal.h
@@ -27,6 +27,13 @@ struct transport_vtable {
struct transport_ls_refs_options *transport_options);
/**
+ * Populates the remote side's bundle-uri under protocol v2,
+ * if the "bundle-uri" capability was advertised. Returns 0 if
+ * OK, negative values on error.
+ */
+ int (*get_bundle_uri)(struct transport *transport);
+
+ /**
* Fetch the objects for the given refs. Note that this gets
* an array, and should ignore the list structure.
*
diff --git a/transport.c b/transport.c
index b51e991..df518ea 100644
--- a/transport.c
+++ b/transport.c
@@ -1,5 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "advice.h"
#include "config.h"
+#include "environment.h"
+#include "hex.h"
#include "transport.h"
#include "hook.h"
#include "pkt-line.h"
@@ -7,9 +10,8 @@
#include "remote.h"
#include "connect.h"
#include "send-pack.h"
-#include "walker.h"
#include "bundle.h"
-#include "dir.h"
+#include "gettext.h"
#include "refs.h"
#include "refspec.h"
#include "branch.h"
@@ -18,10 +20,12 @@
#include "string-list.h"
#include "oid-array.h"
#include "sigchain.h"
+#include "trace2.h"
#include "transport-internal.h"
#include "protocol.h"
-#include "object-store.h"
+#include "object-name.h"
#include "color.h"
+#include "bundle-uri.h"
static int transport_use_color = -1;
static char transport_colors[][COLOR_MAXLEN] = {
@@ -142,7 +146,7 @@ static void get_refs_from_bundle_inner(struct transport *transport)
static struct ref *get_refs_from_bundle(struct transport *transport,
int for_push,
- struct transport_ls_refs_options *transport_options)
+ struct transport_ls_refs_options *transport_options UNUSED)
{
struct bundle_transport_data *data = transport->data;
struct ref *result = NULL;
@@ -166,7 +170,8 @@ static struct ref *get_refs_from_bundle(struct transport *transport,
}
static int fetch_refs_from_bundle(struct transport *transport,
- int nr_heads, struct ref **to_fetch)
+ int nr_heads UNUSED,
+ struct ref **to_fetch UNUSED)
{
struct bundle_transport_data *data = transport->data;
struct strvec extra_index_pack_args = STRVEC_INIT;
@@ -178,7 +183,7 @@ static int fetch_refs_from_bundle(struct transport *transport,
if (!data->get_refs_from_bundle_called)
get_refs_from_bundle_inner(transport);
ret = unbundle(the_repository, &data->header, data->fd,
- &extra_index_pack_args);
+ &extra_index_pack_args, 0);
transport->hash_algo = data->header.hash_algo;
return ret;
}
@@ -197,7 +202,7 @@ struct git_transport_data {
struct git_transport_options options;
struct child_process *conn;
int fd[2];
- unsigned got_remote_heads : 1;
+ unsigned finished_handshake : 1;
enum protocol_version version;
struct oid_array extra_have;
struct oid_array shallow;
@@ -275,8 +280,12 @@ static int connect_setup(struct transport *transport, int for_push)
}
data->conn = git_connect(data->fd, transport->url,
- for_push ? data->options.receivepack :
- data->options.uploadpack,
+ for_push ?
+ "git-receive-pack" :
+ "git-upload-pack",
+ for_push ?
+ data->options.receivepack :
+ data->options.uploadpack,
flags);
return 0;
@@ -306,7 +315,7 @@ static struct ref *handshake(struct transport *transport, int for_push,
struct git_transport_data *data = transport->data;
struct ref *refs = NULL;
struct packet_reader reader;
- int sid_len;
+ size_t sid_len;
const char *server_sid;
connect_setup(transport, for_push);
@@ -344,7 +353,7 @@ static struct ref *handshake(struct transport *transport, int for_push,
case protocol_unknown_version:
BUG("unknown protocol version");
}
- data->got_remote_heads = 1;
+ data->finished_handshake = 1;
transport->hash_algo = reader.hash_algo;
if (reader.line_peeked)
@@ -359,6 +368,39 @@ static struct ref *get_refs_via_connect(struct transport *transport, int for_pus
return handshake(transport, for_push, options, 1);
}
+static int get_bundle_uri(struct transport *transport)
+{
+ struct git_transport_data *data = transport->data;
+ struct packet_reader reader;
+ int stateless_rpc = transport->stateless_rpc;
+
+ if (!transport->bundles) {
+ CALLOC_ARRAY(transport->bundles, 1);
+ init_bundle_list(transport->bundles);
+ }
+
+ if (!data->finished_handshake) {
+ struct ref *refs = handshake(transport, 0, NULL, 0);
+
+ if (refs)
+ free_refs(refs);
+ }
+
+ /*
+ * "Support" protocol v0 and v2 without bundle-uri support by
+ * silently degrading to a NOOP.
+ */
+ if (!server_supports_v2("bundle-uri"))
+ return 0;
+
+ packet_reader_init(&reader, data->fd[0], NULL, 0,
+ PACKET_READ_CHOMP_NEWLINE |
+ PACKET_READ_GENTLE_ON_EOF);
+
+ return get_remote_bundle_uri(data->fd[1], &reader,
+ transport->bundles, stateless_rpc);
+}
+
static int fetch_refs_via_pack(struct transport *transport,
int nr_heads, struct ref **to_fetch)
{
@@ -386,14 +428,15 @@ static int fetch_refs_via_pack(struct transport *transport,
args.cloning = transport->cloning;
args.update_shallow = data->options.update_shallow;
args.from_promisor = data->options.from_promisor;
- args.filter_options = data->options.filter_options;
+ list_objects_filter_copy(&args.filter_options,
+ &data->options.filter_options);
args.refetch = data->options.refetch;
args.stateless_rpc = transport->stateless_rpc;
args.server_options = transport->server_options;
args.negotiation_tips = data->options.negotiation_tips;
args.reject_shallow_remote = transport->smart_options->reject_shallow;
- if (!data->got_remote_heads) {
+ if (!data->finished_handshake) {
int i;
int must_list_refs = 0;
for (i = 0; i < nr_heads; i++) {
@@ -433,7 +476,7 @@ static int fetch_refs_via_pack(struct transport *transport,
to_fetch, nr_heads, &data->shallow,
&transport->pack_lockfiles, data->version);
- data->got_remote_heads = 0;
+ data->finished_handshake = 0;
data->options.self_contained_and_connected =
args.self_contained_and_connected;
data->options.connectivity_checked = args.connectivity_checked;
@@ -453,6 +496,7 @@ cleanup:
free_refs(refs_tmp);
free_refs(refs);
+ list_objects_filter_release(&args.filter_options);
return ret;
}
@@ -740,7 +784,8 @@ static int print_one_push_status(struct ref *ref, const char *dest, int count,
static int measure_abbrev(const struct object_id *oid, int sofar)
{
char hex[GIT_MAX_HEXSZ + 1];
- int w = find_unique_abbrev_r(hex, oid, DEFAULT_ABBREV);
+ int w = repo_find_unique_abbrev_r(the_repository, hex, oid,
+ DEFAULT_ABBREV);
return (w < sofar) ? sofar : w;
}
@@ -817,7 +862,7 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re
if (transport_color_config() < 0)
return -1;
- if (!data->got_remote_heads)
+ if (!data->finished_handshake)
get_refs_via_connect(transport, 1, NULL);
memset(&args, 0, sizeof(args));
@@ -865,7 +910,7 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re
else
ret = finish_connect(data->conn);
data->conn = NULL;
- data->got_remote_heads = 0;
+ data->finished_handshake = 0;
return ret;
}
@@ -875,7 +920,7 @@ static int connect_git(struct transport *transport, const char *name,
{
struct git_transport_data *data = transport->data;
data->conn = git_connect(data->fd, transport->url,
- executable, 0);
+ name, executable, 0);
fd[0] = data->fd[0];
fd[1] = data->fd[1];
return 0;
@@ -885,7 +930,7 @@ static int disconnect_git(struct transport *transport)
{
struct git_transport_data *data = transport->data;
if (data->conn) {
- if (data->got_remote_heads && !transport->stateless_rpc)
+ if (data->finished_handshake && !transport->stateless_rpc)
packet_flush(data->fd[1]);
close(data->fd[0]);
if (data->fd[1] >= 0)
@@ -893,12 +938,14 @@ static int disconnect_git(struct transport *transport)
finish_connect(data->conn);
}
+ list_objects_filter_release(&data->options.filter_options);
free(data);
return 0;
}
static struct transport_vtable taken_over_vtable = {
.get_refs_list = get_refs_via_connect,
+ .get_bundle_uri = get_bundle_uri,
.fetch_refs = fetch_refs_via_pack,
.push_refs = git_transport_push,
.disconnect = disconnect_git
@@ -918,7 +965,7 @@ void transport_take_over(struct transport *transport,
data->conn = child;
data->fd[0] = data->conn->out;
data->fd[1] = data->conn->in;
- data->got_remote_heads = 0;
+ data->finished_handshake = 0;
transport->data = data;
transport->vtable = &taken_over_vtable;
@@ -1006,8 +1053,7 @@ static enum protocol_allow_config get_protocol_config(const char *type)
if (!strcmp(type, "http") ||
!strcmp(type, "https") ||
!strcmp(type, "git") ||
- !strcmp(type, "ssh") ||
- !strcmp(type, "file"))
+ !strcmp(type, "ssh"))
return PROTOCOL_ALLOW_ALWAYS;
/* known scary; err on the side of caution */
@@ -1052,6 +1098,7 @@ static struct transport_vtable bundle_vtable = {
static struct transport_vtable builtin_smart_vtable = {
.get_refs_list = get_refs_via_connect,
+ .get_bundle_uri = get_bundle_uri,
.fetch_refs = fetch_refs_via_pack,
.push_refs = git_transport_push,
.connect = connect_git,
@@ -1066,6 +1113,9 @@ struct transport *transport_get(struct remote *remote, const char *url)
ret->progress = isatty(2);
string_list_init_dup(&ret->pack_lockfiles);
+ CALLOC_ARRAY(ret->bundles, 1);
+ init_bundle_list(ret->bundles);
+
if (!remote)
BUG("No remote provided to transport_get()");
@@ -1110,12 +1160,13 @@ struct transport *transport_get(struct remote *remote, const char *url)
* will be checked individually in git_connect.
*/
struct git_transport_data *data = xcalloc(1, sizeof(*data));
+ list_objects_filter_init(&data->options.filter_options);
ret->data = data;
ret->vtable = &builtin_smart_vtable;
ret->smart_options = &(data->options);
data->conn = NULL;
- data->got_remote_heads = 0;
+ data->finished_handshake = 0;
} else {
/* Unknown protocol in URL. Pass to external handler. */
int len = external_specification_len(url);
@@ -1416,6 +1467,7 @@ int transport_push(struct repository *r,
if (porcelain && !push_ret)
puts("Done");
else if (!quiet && !ret && !transport_refs_pushed(remote_refs))
+ /* stable plumbing output; do not modify or localize */
fprintf(stderr, "Everything up-to-date\n");
done:
@@ -1479,6 +1531,34 @@ int transport_fetch_refs(struct transport *transport, struct ref *refs)
return rc;
}
+int transport_get_remote_bundle_uri(struct transport *transport)
+{
+ int value = 0;
+ const struct transport_vtable *vtable = transport->vtable;
+
+ /* Check config only once. */
+ if (transport->got_remote_bundle_uri)
+ return 0;
+ transport->got_remote_bundle_uri = 1;
+
+ /*
+ * Don't request bundle-uri from the server unless configured to
+ * do so by the transfer.bundleURI=true config option.
+ */
+ if (git_config_get_bool("transfer.bundleuri", &value) || !value)
+ return 0;
+
+ if (!transport->bundles->baseURI)
+ transport->bundles->baseURI = xstrdup(transport->url);
+
+ if (!vtable->get_bundle_uri)
+ return error(_("bundle-uri operation not supported by protocol"));
+
+ if (vtable->get_bundle_uri(transport) < 0)
+ return error(_("could not retrieve server-advertised bundle-uri list"));
+ return 0;
+}
+
void transport_unlock_pack(struct transport *transport, unsigned int flags)
{
int in_signal_handler = !!(flags & TRANSPORT_UNLOCK_PACK_IN_SIGNAL_HANDLER);
@@ -1509,6 +1589,8 @@ int transport_disconnect(struct transport *transport)
ret = transport->vtable->disconnect(transport);
if (transport->got_remote_refs)
free_refs((void *)transport->remote_refs);
+ clear_bundle_list(transport->bundles);
+ free(transport->bundles);
free(transport);
return ret;
}
diff --git a/transport.h b/transport.h
index b5bf7b3..6393cd9 100644
--- a/transport.h
+++ b/transport.h
@@ -1,7 +1,6 @@
#ifndef TRANSPORT_H
#define TRANSPORT_H
-#include "cache.h"
#include "run-command.h"
#include "remote.h"
#include "list-objects-filter-options.h"
@@ -62,6 +61,7 @@ enum transport_family {
TRANSPORT_FAMILY_IPV6
};
+struct bundle_list;
struct transport {
const struct transport_vtable *vtable;
@@ -76,6 +76,18 @@ struct transport {
*/
unsigned got_remote_refs : 1;
+ /**
+ * Indicates whether we already called get_bundle_uri_list(); set by
+ * transport.c::transport_get_remote_bundle_uri().
+ */
+ unsigned got_remote_bundle_uri : 1;
+
+ /*
+ * The results of "command=bundle-uri", if both sides support
+ * the "bundle-uri" capability.
+ */
+ struct bundle_list *bundles;
+
/*
* Transports that call take-over destroys the data specific to
* the transport type while doing so, and cannot be reused.
@@ -281,6 +293,12 @@ void transport_ls_refs_options_release(struct transport_ls_refs_options *opts);
const struct ref *transport_get_remote_refs(struct transport *transport,
struct transport_ls_refs_options *transport_options);
+/**
+ * Retrieve bundle URI(s) from a remote. Populates "struct
+ * transport"'s "bundle_uri" and "got_remote_bundle_uri".
+ */
+int transport_get_remote_bundle_uri(struct transport *transport);
+
/*
* Fetch the hash algorithm used by a remote.
*
diff --git a/tree-diff.c b/tree-diff.c
index 69031d7..4610777 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -1,10 +1,26 @@
/*
* Helper functions for tree diff generation
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "diff.h"
#include "diffcore.h"
+#include "hash.h"
#include "tree.h"
+#include "tree-walk.h"
+#include "environment.h"
+
+/*
+ * Some mode bits are also used internally for computations.
+ *
+ * They *must* not overlap with any valid modes, and they *must* not be emitted
+ * to outside world - i.e. appear on disk or network. In other words, it's just
+ * temporary fields, which we internally use, but they have to stay in-house.
+ *
+ * ( such approach is valid, as standard S_IF* fits into 16 bits, and in Git
+ * codebase mode is `unsigned int` which is assumed to be at least 32 bits )
+ */
+
+#define S_DIFFTREE_IFXMIN_NEQ 0x80000000
/*
* internal mode marker, saying a tree entry != entry of tp[imin]
@@ -30,7 +46,8 @@
static struct combine_diff_path *ll_diff_tree_paths(
struct combine_diff_path *p, const struct object_id *oid,
const struct object_id **parents_oid, int nparent,
- struct strbuf *base, struct diff_options *opt);
+ struct strbuf *base, struct diff_options *opt,
+ int depth);
static void ll_diff_tree_oid(const struct object_id *old_oid,
const struct object_id *new_oid,
struct strbuf *base, struct diff_options *opt);
@@ -181,7 +198,7 @@ static struct combine_diff_path *path_appendnew(struct combine_diff_path *last,
static struct combine_diff_path *emit_path(struct combine_diff_path *p,
struct strbuf *base, struct diff_options *opt, int nparent,
struct tree_desc *t, struct tree_desc *tp,
- int imin)
+ int imin, int depth)
{
unsigned short mode;
const char *path;
@@ -287,7 +304,8 @@ static struct combine_diff_path *emit_path(struct combine_diff_path *p,
strbuf_add(base, path, pathlen);
strbuf_addch(base, '/');
- p = ll_diff_tree_paths(p, oid, parents_oid, nparent, base, opt);
+ p = ll_diff_tree_paths(p, oid, parents_oid, nparent, base, opt,
+ depth + 1);
FAST_ARRAY_FREE(parents_oid, nparent);
}
@@ -302,7 +320,7 @@ static void skip_uninteresting(struct tree_desc *t, struct strbuf *base,
while (t->size) {
match = tree_entry_interesting(opt->repo->index, &t->entry,
- base, 0, &opt->pathspec);
+ base, &opt->pathspec);
if (match) {
if (match == all_entries_not_interesting)
t->size = 0;
@@ -408,12 +426,16 @@ static inline void update_tp_entries(struct tree_desc *tp, int nparent)
static struct combine_diff_path *ll_diff_tree_paths(
struct combine_diff_path *p, const struct object_id *oid,
const struct object_id **parents_oid, int nparent,
- struct strbuf *base, struct diff_options *opt)
+ struct strbuf *base, struct diff_options *opt,
+ int depth)
{
struct tree_desc t, *tp;
void *ttree, **tptree;
int i;
+ if (depth > max_allowed_tree_depth)
+ die("exceeded maximum allowed tree depth");
+
FAST_ARRAY_ALLOC(tp, nparent);
FAST_ARRAY_ALLOC(tptree, nparent);
@@ -507,7 +529,7 @@ static struct combine_diff_path *ll_diff_tree_paths(
/* D += {δ(t,pi) if pi=p[imin]; "+a" if pi > p[imin]} */
p = emit_path(p, base, opt, nparent,
- &t, tp, imin);
+ &t, tp, imin, depth);
skip_emit_t_tp:
/* t↓, ∀ pi=p[imin] pi↓ */
@@ -519,7 +541,7 @@ static struct combine_diff_path *ll_diff_tree_paths(
else if (cmp < 0) {
/* D += "+t" */
p = emit_path(p, base, opt, nparent,
- &t, /*tp=*/NULL, -1);
+ &t, /*tp=*/NULL, -1, depth);
/* t↓ */
update_tree_entry(&t);
@@ -535,7 +557,7 @@ static struct combine_diff_path *ll_diff_tree_paths(
}
p = emit_path(p, base, opt, nparent,
- /*t=*/NULL, tp, imin);
+ /*t=*/NULL, tp, imin, depth);
skip_emit_tp:
/* ∀ pi=p[imin] pi↓ */
@@ -557,7 +579,7 @@ struct combine_diff_path *diff_tree_paths(
const struct object_id **parents_oid, int nparent,
struct strbuf *base, struct diff_options *opt)
{
- p = ll_diff_tree_paths(p, oid, parents_oid, nparent, base, opt);
+ p = ll_diff_tree_paths(p, oid, parents_oid, nparent, base, opt, 0);
/*
* free pre-allocated last element, if any
diff --git a/tree-walk.c b/tree-walk.c
index 506234b..6565d9a 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -1,40 +1,29 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "tree-walk.h"
#include "dir.h"
-#include "object-store.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "trace2.h"
#include "tree.h"
#include "pathspec.h"
#include "json-writer.h"
-
-static const char *get_mode(const char *str, unsigned int *modep)
-{
- unsigned char c;
- unsigned int mode = 0;
-
- if (*str == ' ')
- return NULL;
-
- while ((c = *str++) != ' ') {
- if (c < '0' || c > '7')
- return NULL;
- mode = (mode << 3) + (c - '0');
- }
- *modep = mode;
- return str;
-}
+#include "environment.h"
static int decode_tree_entry(struct tree_desc *desc, const char *buf, unsigned long size, struct strbuf *err)
{
const char *path;
- unsigned int mode, len;
- const unsigned hashsz = the_hash_algo->rawsz;
+ unsigned int len;
+ uint16_t mode;
+ const unsigned hashsz = desc->algo->rawsz;
if (size < hashsz + 3 || buf[size - (hashsz + 1)]) {
strbuf_addstr(err, _("too-short tree object"));
return -1;
}
- path = get_mode(buf, &mode);
+ path = parse_mode(buf, &mode);
if (!path) {
strbuf_addstr(err, _("malformed mode in tree entry"));
return -1;
@@ -47,34 +36,44 @@ static int decode_tree_entry(struct tree_desc *desc, const char *buf, unsigned l
/* Initialize the descriptor entry */
desc->entry.path = path;
- desc->entry.mode = canon_mode(mode);
+ desc->entry.mode = (desc->flags & TREE_DESC_RAW_MODES) ? mode : canon_mode(mode);
desc->entry.pathlen = len - 1;
- oidread(&desc->entry.oid, (const unsigned char *)path + len);
+ oidread_algop(&desc->entry.oid, (const unsigned char *)path + len,
+ desc->algo);
return 0;
}
-static int init_tree_desc_internal(struct tree_desc *desc, const void *buffer, unsigned long size, struct strbuf *err)
+static int init_tree_desc_internal(struct tree_desc *desc,
+ const struct object_id *oid,
+ const void *buffer, unsigned long size,
+ struct strbuf *err,
+ enum tree_desc_flags flags)
{
+ desc->algo = (oid && oid->algo) ? &hash_algos[oid->algo] : the_hash_algo;
desc->buffer = buffer;
desc->size = size;
+ desc->flags = flags;
if (size)
return decode_tree_entry(desc, buffer, size, err);
return 0;
}
-void init_tree_desc(struct tree_desc *desc, const void *buffer, unsigned long size)
+void init_tree_desc(struct tree_desc *desc, const struct object_id *tree_oid,
+ const void *buffer, unsigned long size)
{
struct strbuf err = STRBUF_INIT;
- if (init_tree_desc_internal(desc, buffer, size, &err))
+ if (init_tree_desc_internal(desc, tree_oid, buffer, size, &err, 0))
die("%s", err.buf);
strbuf_release(&err);
}
-int init_tree_desc_gently(struct tree_desc *desc, const void *buffer, unsigned long size)
+int init_tree_desc_gently(struct tree_desc *desc, const struct object_id *oid,
+ const void *buffer, unsigned long size,
+ enum tree_desc_flags flags)
{
struct strbuf err = STRBUF_INIT;
- int result = init_tree_desc_internal(desc, buffer, size, &err);
+ int result = init_tree_desc_internal(desc, oid, buffer, size, &err, flags);
if (result)
error("%s", err.buf);
strbuf_release(&err);
@@ -91,9 +90,9 @@ void *fill_tree_descriptor(struct repository *r,
if (oid) {
buf = read_object_with_reference(r, oid, OBJ_TREE, &size, NULL);
if (!buf)
- die("unable to read tree %s", oid_to_hex(oid));
+ die(_("unable to read tree (%s)"), oid_to_hex(oid));
}
- init_tree_desc(desc, buf, size);
+ init_tree_desc(desc, oid, buf, size);
return buf;
}
@@ -110,7 +109,7 @@ static void entry_extract(struct tree_desc *t, struct name_entry *a)
static int update_tree_entry_internal(struct tree_desc *desc, struct strbuf *err)
{
const void *buf = desc->buffer;
- const unsigned char *end = (const unsigned char *)desc->entry.path + desc->entry.pathlen + 1 + the_hash_algo->rawsz;
+ const unsigned char *end = (const unsigned char *)desc->entry.path + desc->entry.pathlen + 1 + desc->algo->rawsz;
unsigned long size = desc->size;
unsigned long len = end - (const unsigned char *)buf;
@@ -426,29 +425,32 @@ static inline int prune_traversal(struct index_state *istate,
if (still_interesting < 0)
return still_interesting;
return tree_entry_interesting(istate, e, base,
- 0, info->pathspec);
+ info->pathspec);
}
int traverse_trees(struct index_state *istate,
int n, struct tree_desc *t,
struct traverse_info *info)
{
- int error = 0;
- struct name_entry entry[MAX_TRAVERSE_TREES];
+ int ret = 0;
+ struct name_entry *entry;
int i;
- struct tree_desc_x tx[ARRAY_SIZE(entry)];
+ struct tree_desc_x *tx;
struct strbuf base = STRBUF_INIT;
int interesting = 1;
char *traverse_path;
+ if (traverse_trees_cur_depth > max_allowed_tree_depth)
+ return error("exceeded maximum allowed tree depth");
+
traverse_trees_count++;
traverse_trees_cur_depth++;
if (traverse_trees_cur_depth > traverse_trees_max_depth)
traverse_trees_max_depth = traverse_trees_cur_depth;
- if (n >= ARRAY_SIZE(entry))
- BUG("traverse_trees() called with too many trees (%d)", n);
+ ALLOC_ARRAY(entry, n);
+ ALLOC_ARRAY(tx, n);
for (i = 0; i < n; i++) {
tx[i].d = t[i];
@@ -531,7 +533,7 @@ int traverse_trees(struct index_state *istate,
if (interesting) {
trees_used = info->fn(n, mask, dirmask, entry, info);
if (trees_used < 0) {
- error = trees_used;
+ ret = trees_used;
if (!info->show_all_errors)
break;
}
@@ -543,12 +545,14 @@ int traverse_trees(struct index_state *istate,
}
for (i = 0; i < n; i++)
free_extended_entry(tx + i);
+ free(tx);
+ free(entry);
free(traverse_path);
info->traverse_path = NULL;
strbuf_release(&base);
traverse_trees_cur_depth--;
- return error;
+ return ret;
}
struct dir_state {
@@ -619,7 +623,7 @@ int get_tree_entry(struct repository *r,
retval = -1;
} else {
struct tree_desc t;
- init_tree_desc(&t, tree, size);
+ init_tree_desc(&t, tree_oid, tree, size);
retval = find_tree_entry(r, &t, name, oid, mode);
}
free(tree);
@@ -662,7 +666,7 @@ enum get_oid_result get_tree_entry_follow_symlinks(struct repository *r,
struct tree_desc t;
int follows_remaining = GET_TREE_ENTRY_FOLLOW_SYMLINKS_MAX_LINKS;
- init_tree_desc(&t, NULL, 0UL);
+ init_tree_desc(&t, NULL, NULL, 0UL);
strbuf_addstr(&namebuf, name);
oidcpy(&current_tree_oid, tree_oid);
@@ -698,7 +702,7 @@ enum get_oid_result get_tree_entry_follow_symlinks(struct repository *r,
goto done;
/* descend */
- init_tree_desc(&t, tree, size);
+ init_tree_desc(&t, &current_tree_oid, tree, size);
}
/* Handle symlinks to e.g. a//b by removing leading slashes */
@@ -732,7 +736,7 @@ enum get_oid_result get_tree_entry_follow_symlinks(struct repository *r,
free(parent->tree);
parents_nr--;
parent = &parents[parents_nr - 1];
- init_tree_desc(&t, parent->tree, parent->size);
+ init_tree_desc(&t, &parent->oid, parent->tree, parent->size);
strbuf_remove(&namebuf, 0, remainder ? 3 : 2);
continue;
}
@@ -812,7 +816,7 @@ enum get_oid_result get_tree_entry_follow_symlinks(struct repository *r,
contents_start = contents;
parent = &parents[parents_nr - 1];
- init_tree_desc(&t, parent->tree, parent->size);
+ init_tree_desc(&t, &parent->oid, parent->tree, parent->size);
strbuf_splice(&namebuf, 0, len,
contents_start, link_len);
if (remainder)
@@ -1007,17 +1011,17 @@ static int match_wildcard_base(const struct pathspec_item *item,
/*
* Is a tree entry interesting given the pathspec we have?
*
- * Pre-condition: either baselen == base_offset (i.e. empty path)
+ * Pre-condition: either baselen == 0 (i.e. empty path)
* or base[baselen-1] == '/' (i.e. with trailing slash).
*/
static enum interesting do_match(struct index_state *istate,
const struct name_entry *entry,
- struct strbuf *base, int base_offset,
+ struct strbuf *base,
const struct pathspec *ps,
int exclude)
{
int i;
- int pathlen, baselen = base->len - base_offset;
+ int pathlen, baselen = base->len;
enum interesting never_interesting = ps->has_wildcard ?
entry_not_interesting : all_entries_not_interesting;
@@ -1035,7 +1039,7 @@ static enum interesting do_match(struct index_state *istate,
!(ps->magic & PATHSPEC_MAXDEPTH) ||
ps->max_depth == -1)
return all_entries_interesting;
- return within_depth(base->buf + base_offset, baselen,
+ return within_depth(base->buf, baselen,
!!S_ISDIR(entry->mode),
ps->max_depth) ?
entry_interesting : entry_not_interesting;
@@ -1046,7 +1050,7 @@ static enum interesting do_match(struct index_state *istate,
for (i = ps->nr - 1; i >= 0; i--) {
const struct pathspec_item *item = ps->items+i;
const char *match = item->match;
- const char *base_str = base->buf + base_offset;
+ const char *base_str = base->buf;
int matchlen = item->len, matched = 0;
if ((!exclude && item->magic & PATHSPEC_EXCLUDE) ||
@@ -1139,9 +1143,9 @@ match_wildcards:
strbuf_add(base, entry->path, pathlen);
- if (!git_fnmatch(item, match, base->buf + base_offset,
+ if (!git_fnmatch(item, match, base->buf,
item->nowildcard_len)) {
- strbuf_setlen(base, base_offset + baselen);
+ strbuf_setlen(base, baselen);
goto interesting;
}
@@ -1153,13 +1157,13 @@ match_wildcards:
* be performed in the submodule itself.
*/
if (ps->recurse_submodules && S_ISGITLINK(entry->mode) &&
- !ps_strncmp(item, match, base->buf + base_offset,
+ !ps_strncmp(item, match, base->buf,
item->nowildcard_len)) {
- strbuf_setlen(base, base_offset + baselen);
+ strbuf_setlen(base, baselen);
goto interesting;
}
- strbuf_setlen(base, base_offset + baselen);
+ strbuf_setlen(base, baselen);
/*
* Match all directories. We'll try to match files
@@ -1195,9 +1199,9 @@ interesting:
return entry_interesting;
strbuf_add(base, entry->path, pathlen);
- ret = match_pathspec_attrs(istate, base->buf + base_offset,
- base->len - base_offset, item);
- strbuf_setlen(base, base_offset + baselen);
+ ret = match_pathspec_attrs(istate, base->buf,
+ base->len, item);
+ strbuf_setlen(base, baselen);
if (!ret)
continue;
}
@@ -1209,16 +1213,16 @@ interesting:
/*
* Is a tree entry interesting given the pathspec we have?
*
- * Pre-condition: either baselen == base_offset (i.e. empty path)
+ * Pre-condition: either baselen == 0 (i.e. empty path)
* or base[baselen-1] == '/' (i.e. with trailing slash).
*/
enum interesting tree_entry_interesting(struct index_state *istate,
const struct name_entry *entry,
- struct strbuf *base, int base_offset,
+ struct strbuf *base,
const struct pathspec *ps)
{
enum interesting positive, negative;
- positive = do_match(istate, entry, base, base_offset, ps, 0);
+ positive = do_match(istate, entry, base, ps, 0);
/*
* case | entry | positive | negative | result
@@ -1255,7 +1259,7 @@ enum interesting tree_entry_interesting(struct index_state *istate,
positive <= entry_not_interesting) /* #1, #2, #11, #12 */
return positive;
- negative = do_match(istate, entry, base, base_offset, ps, 1);
+ negative = do_match(istate, entry, base, ps, 1);
/* #8, #18 */
if (positive == all_entries_interesting &&
diff --git a/tree-walk.h b/tree-walk.h
index a505846..0b1067f 100644
--- a/tree-walk.h
+++ b/tree-walk.h
@@ -1,9 +1,10 @@
#ifndef TREE_WALK_H
#define TREE_WALK_H
-#include "cache.h"
+#include "hash-ll.h"
-#define MAX_TRAVERSE_TREES 8
+struct index_state;
+struct repository;
/**
* The tree walking API is used to traverse and inspect trees.
@@ -23,6 +24,7 @@ struct name_entry {
* A semi-opaque data structure used to maintain the current state of the walk.
*/
struct tree_desc {
+ const struct git_hash_algo *algo;
/*
* pointer into the memory representation of the tree. It always
* points at the current entry being visited.
@@ -34,6 +36,11 @@ struct tree_desc {
/* counts the number of bytes left in the `buffer`. */
unsigned int size;
+
+ /* option flags passed via init_tree_desc_gently() */
+ enum tree_desc_flags {
+ TREE_DESC_RAW_MODES = (1 << 0),
+ } flags;
};
/**
@@ -77,9 +84,12 @@ int update_tree_entry_gently(struct tree_desc *);
* size parameters are assumed to be the same as the buffer and size
* members of `struct tree`.
*/
-void init_tree_desc(struct tree_desc *desc, const void *buf, unsigned long size);
+void init_tree_desc(struct tree_desc *desc, const struct object_id *tree_oid,
+ const void *buf, unsigned long size);
-int init_tree_desc_gently(struct tree_desc *desc, const void *buf, unsigned long size);
+int init_tree_desc_gently(struct tree_desc *desc, const struct object_id *oid,
+ const void *buf, unsigned long size,
+ enum tree_desc_flags flags);
/*
* Visit the next entry in a tree. Returns 1 when there are more entries
@@ -215,7 +225,7 @@ enum interesting {
enum interesting tree_entry_interesting(struct index_state *istate,
const struct name_entry *,
- struct strbuf *, int,
+ struct strbuf *,
const struct pathspec *ps);
#endif
diff --git a/tree.c b/tree.c
index 410e3b4..7973d3f 100644
--- a/tree.c
+++ b/tree.c
@@ -1,18 +1,19 @@
-#include "cache.h"
-#include "cache-tree.h"
+#include "git-compat-util.h"
+#include "hex.h"
#include "tree.h"
-#include "object-store.h"
-#include "blob.h"
+#include "object-name.h"
+#include "object-store-ll.h"
#include "commit.h"
-#include "tag.h"
#include "alloc.h"
#include "tree-walk.h"
#include "repository.h"
+#include "environment.h"
const char *tree_type = "tree";
int read_tree_at(struct repository *r,
struct tree *tree, struct strbuf *base,
+ int depth,
const struct pathspec *pathspec,
read_tree_fn_t fn, void *context)
{
@@ -22,15 +23,18 @@ int read_tree_at(struct repository *r,
int len, oldlen = base->len;
enum interesting retval = entry_not_interesting;
+ if (depth > max_allowed_tree_depth)
+ return error("exceeded maximum allowed tree depth");
+
if (parse_tree(tree))
return -1;
- init_tree_desc(&desc, tree->buffer, tree->size);
+ init_tree_desc(&desc, &tree->object.oid, tree->buffer, tree->size);
while (tree_entry(&desc, &entry)) {
if (retval != all_entries_interesting) {
retval = tree_entry_interesting(r->index, &entry,
- base, 0, pathspec);
+ base, pathspec);
if (retval == all_entries_not_interesting)
break;
if (retval == entry_not_interesting)
@@ -58,7 +62,7 @@ int read_tree_at(struct repository *r,
oid_to_hex(&entry.oid),
base->buf, entry.path);
- if (parse_commit(commit))
+ if (repo_parse_commit(r, commit))
die("Invalid commit %s in submodule path %s%s",
oid_to_hex(&entry.oid),
base->buf, entry.path);
@@ -72,7 +76,7 @@ int read_tree_at(struct repository *r,
strbuf_add(base, entry.path, len);
strbuf_addch(base, '/');
retval = read_tree_at(r, lookup_tree(r, &oid),
- base, pathspec,
+ base, depth + 1, pathspec,
fn, context);
strbuf_setlen(base, oldlen);
if (retval)
@@ -87,19 +91,77 @@ int read_tree(struct repository *r,
read_tree_fn_t fn, void *context)
{
struct strbuf sb = STRBUF_INIT;
- int ret = read_tree_at(r, tree, &sb, pathspec, fn, context);
+ int ret = read_tree_at(r, tree, &sb, 0, pathspec, fn, context);
strbuf_release(&sb);
return ret;
}
-int cmp_cache_name_compare(const void *a_, const void *b_)
+int base_name_compare(const char *name1, size_t len1, int mode1,
+ const char *name2, size_t len2, int mode2)
{
- const struct cache_entry *ce1, *ce2;
+ unsigned char c1, c2;
+ size_t len = len1 < len2 ? len1 : len2;
+ int cmp;
+
+ cmp = memcmp(name1, name2, len);
+ if (cmp)
+ return cmp;
+ c1 = name1[len];
+ c2 = name2[len];
+ if (!c1 && S_ISDIR(mode1))
+ c1 = '/';
+ if (!c2 && S_ISDIR(mode2))
+ c2 = '/';
+ return (c1 < c2) ? -1 : (c1 > c2) ? 1 : 0;
+}
- ce1 = *((const struct cache_entry **)a_);
- ce2 = *((const struct cache_entry **)b_);
- return cache_name_stage_compare(ce1->name, ce1->ce_namelen, ce_stage(ce1),
- ce2->name, ce2->ce_namelen, ce_stage(ce2));
+/*
+ * df_name_compare() is identical to base_name_compare(), except it
+ * compares conflicting directory/file entries as equal. Note that
+ * while a directory name compares as equal to a regular file, they
+ * then individually compare _differently_ to a filename that has
+ * a dot after the basename (because '\0' < '.' < '/').
+ *
+ * This is used by routines that want to traverse the git namespace
+ * but then handle conflicting entries together when possible.
+ */
+int df_name_compare(const char *name1, size_t len1, int mode1,
+ const char *name2, size_t len2, int mode2)
+{
+ unsigned char c1, c2;
+ size_t len = len1 < len2 ? len1 : len2;
+ int cmp;
+
+ cmp = memcmp(name1, name2, len);
+ if (cmp)
+ return cmp;
+ /* Directories and files compare equal (same length, same name) */
+ if (len1 == len2)
+ return 0;
+ c1 = name1[len];
+ if (!c1 && S_ISDIR(mode1))
+ c1 = '/';
+ c2 = name2[len];
+ if (!c2 && S_ISDIR(mode2))
+ c2 = '/';
+ if (c1 == '/' && !c2)
+ return 0;
+ if (c2 == '/' && !c1)
+ return 0;
+ return c1 - c2;
+}
+
+int name_compare(const char *name1, size_t len1, const char *name2, size_t len2)
+{
+ size_t min_len = (len1 < len2) ? len1 : len2;
+ int cmp = memcmp(name1, name2, min_len);
+ if (cmp)
+ return cmp;
+ if (len1 < len2)
+ return -1;
+ if (len1 > len2)
+ return 1;
+ return 0;
}
struct tree *lookup_tree(struct repository *r, const struct object_id *oid)
@@ -129,7 +191,8 @@ int parse_tree_gently(struct tree *item, int quiet_on_missing)
if (item->object.parsed)
return 0;
- buffer = read_object_file(&item->object.oid, &type, &size);
+ buffer = repo_read_object_file(the_repository, &item->object.oid,
+ &type, &size);
if (!buffer)
return quiet_on_missing ? -1 :
error("Could not read %s",
diff --git a/tree.h b/tree.h
index 6efff00..cc6ddf5 100644
--- a/tree.h
+++ b/tree.h
@@ -3,6 +3,7 @@
#include "object.h"
+struct pathspec;
struct repository;
struct strbuf;
@@ -28,13 +29,22 @@ void free_tree_buffer(struct tree *tree);
/* Parses and returns the tree in the given ent, chasing tags and commits. */
struct tree *parse_tree_indirect(const struct object_id *oid);
-int cmp_cache_name_compare(const void *a_, const void *b_);
+/*
+ * Functions for comparing pathnames
+ */
+int base_name_compare(const char *name1, size_t len1, int mode1,
+ const char *name2, size_t len2, int mode2);
+int df_name_compare(const char *name1, size_t len1, int mode1,
+ const char *name2, size_t len2, int mode2);
+int name_compare(const char *name1, size_t len1,
+ const char *name2, size_t len2);
#define READ_TREE_RECURSIVE 1
typedef int (*read_tree_fn_t)(const struct object_id *, struct strbuf *, const char *, unsigned int, void *);
int read_tree_at(struct repository *r,
struct tree *tree, struct strbuf *base,
+ int depth,
const struct pathspec *pathspec,
read_tree_fn_t fn, void *context);
diff --git a/unicode-width.h b/unicode-width.h
index 97c851b..be5bf8c 100644
--- a/unicode-width.h
+++ b/unicode-width.h
@@ -94,7 +94,7 @@ static const struct interval zero_width[] = {
{ 0x0E47, 0x0E4E },
{ 0x0EB1, 0x0EB1 },
{ 0x0EB4, 0x0EBC },
-{ 0x0EC8, 0x0ECD },
+{ 0x0EC8, 0x0ECE },
{ 0x0F18, 0x0F19 },
{ 0x0F35, 0x0F35 },
{ 0x0F37, 0x0F37 },
@@ -228,6 +228,7 @@ static const struct interval zero_width[] = {
{ 0x10AE5, 0x10AE6 },
{ 0x10D24, 0x10D27 },
{ 0x10EAB, 0x10EAC },
+{ 0x10EFD, 0x10EFF },
{ 0x10F46, 0x10F50 },
{ 0x10F82, 0x10F85 },
{ 0x11001, 0x11001 },
@@ -252,6 +253,7 @@ static const struct interval zero_width[] = {
{ 0x11234, 0x11234 },
{ 0x11236, 0x11237 },
{ 0x1123E, 0x1123E },
+{ 0x11241, 0x11241 },
{ 0x112DF, 0x112DF },
{ 0x112E3, 0x112EA },
{ 0x11300, 0x11301 },
@@ -313,7 +315,12 @@ static const struct interval zero_width[] = {
{ 0x11D95, 0x11D95 },
{ 0x11D97, 0x11D97 },
{ 0x11EF3, 0x11EF4 },
-{ 0x13430, 0x13438 },
+{ 0x11F00, 0x11F01 },
+{ 0x11F36, 0x11F3A },
+{ 0x11F40, 0x11F40 },
+{ 0x11F42, 0x11F42 },
+{ 0x13430, 0x13440 },
+{ 0x13447, 0x13455 },
{ 0x16AF0, 0x16AF4 },
{ 0x16B30, 0x16B36 },
{ 0x16F4F, 0x16F4F },
@@ -339,9 +346,11 @@ static const struct interval zero_width[] = {
{ 0x1E01B, 0x1E021 },
{ 0x1E023, 0x1E024 },
{ 0x1E026, 0x1E02A },
+{ 0x1E08F, 0x1E08F },
{ 0x1E130, 0x1E136 },
{ 0x1E2AE, 0x1E2AE },
{ 0x1E2EC, 0x1E2EF },
+{ 0x1E4EC, 0x1E4EF },
{ 0x1E8D0, 0x1E8D6 },
{ 0x1E944, 0x1E94A },
{ 0xE0001, 0xE0001 },
@@ -387,14 +396,13 @@ static const struct interval double_width[] = {
{ 0x2E80, 0x2E99 },
{ 0x2E9B, 0x2EF3 },
{ 0x2F00, 0x2FD5 },
-{ 0x2FF0, 0x2FFB },
-{ 0x3000, 0x303E },
+{ 0x2FF0, 0x303E },
{ 0x3041, 0x3096 },
{ 0x3099, 0x30FF },
{ 0x3105, 0x312F },
{ 0x3131, 0x318E },
{ 0x3190, 0x31E3 },
-{ 0x31F0, 0x321E },
+{ 0x31EF, 0x321E },
{ 0x3220, 0x3247 },
{ 0x3250, 0x4DBF },
{ 0x4E00, 0xA48C },
@@ -417,7 +425,9 @@ static const struct interval double_width[] = {
{ 0x1AFF5, 0x1AFFB },
{ 0x1AFFD, 0x1AFFE },
{ 0x1B000, 0x1B122 },
+{ 0x1B132, 0x1B132 },
{ 0x1B150, 0x1B152 },
+{ 0x1B155, 0x1B155 },
{ 0x1B164, 0x1B167 },
{ 0x1B170, 0x1B2FB },
{ 0x1F004, 0x1F004 },
@@ -451,7 +461,7 @@ static const struct interval double_width[] = {
{ 0x1F6CC, 0x1F6CC },
{ 0x1F6D0, 0x1F6D2 },
{ 0x1F6D5, 0x1F6D7 },
-{ 0x1F6DD, 0x1F6DF },
+{ 0x1F6DC, 0x1F6DF },
{ 0x1F6EB, 0x1F6EC },
{ 0x1F6F4, 0x1F6FC },
{ 0x1F7E0, 0x1F7EB },
@@ -459,15 +469,13 @@ static const struct interval double_width[] = {
{ 0x1F90C, 0x1F93A },
{ 0x1F93C, 0x1F945 },
{ 0x1F947, 0x1F9FF },
-{ 0x1FA70, 0x1FA74 },
-{ 0x1FA78, 0x1FA7C },
-{ 0x1FA80, 0x1FA86 },
-{ 0x1FA90, 0x1FAAC },
-{ 0x1FAB0, 0x1FABA },
-{ 0x1FAC0, 0x1FAC5 },
-{ 0x1FAD0, 0x1FAD9 },
-{ 0x1FAE0, 0x1FAE7 },
-{ 0x1FAF0, 0x1FAF6 },
+{ 0x1FA70, 0x1FA7C },
+{ 0x1FA80, 0x1FA88 },
+{ 0x1FA90, 0x1FABD },
+{ 0x1FABF, 0x1FAC5 },
+{ 0x1FACE, 0x1FADB },
+{ 0x1FAE0, 0x1FAE8 },
+{ 0x1FAF0, 0x1FAF8 },
{ 0x20000, 0x2FFFD },
{ 0x30000, 0x3FFFD }
};
diff --git a/unix-socket.c b/unix-socket.c
index e0be1ba..79800d8 100644
--- a/unix-socket.c
+++ b/unix-socket.c
@@ -1,4 +1,5 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "strbuf.h"
#include "unix-socket.h"
#define DEFAULT_UNIX_STREAM_LISTEN_BACKLOG (5)
diff --git a/unix-stream-server.c b/unix-stream-server.c
index efa2a20..22ac237 100644
--- a/unix-stream-server.c
+++ b/unix-stream-server.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "lockfile.h"
#include "unix-socket.h"
#include "unix-stream-server.h"
diff --git a/unpack-trees.c b/unpack-trees.c
index 8a454e0..c2b20b8 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -1,8 +1,13 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "advice.h"
#include "strvec.h"
#include "repository.h"
-#include "config.h"
+#include "parse.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
+#include "name-hash.h"
#include "tree.h"
#include "tree-walk.h"
#include "cache-tree.h"
@@ -10,16 +15,19 @@
#include "progress.h"
#include "refs.h"
#include "attr.h"
+#include "read-cache.h"
#include "split-index.h"
#include "sparse-index.h"
#include "submodule.h"
#include "submodule-config.h"
+#include "symlinks.h"
+#include "trace2.h"
#include "fsmonitor.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "promisor-remote.h"
#include "entry.h"
#include "parallel-checkout.h"
-#include "sparse-index.h"
+#include "setup.h"
/*
* Error messages expected by scripts out of plumbing commands such as
@@ -67,11 +75,11 @@ static const char *unpack_plumbing_errors[NB_UNPACK_TREES_WARNING_TYPES] = {
};
#define ERRORMSG(o,type) \
- ( ((o) && (o)->msgs[(type)]) \
- ? ((o)->msgs[(type)]) \
+ ( ((o) && (o)->internal.msgs[(type)]) \
+ ? ((o)->internal.msgs[(type)]) \
: (unpack_plumbing_errors[(type)]) )
-static const char *super_prefixed(const char *path)
+static const char *super_prefixed(const char *path, const char *super_prefix)
{
/*
* It is necessary and sufficient to have two static buffers
@@ -83,7 +91,6 @@ static const char *super_prefixed(const char *path)
static unsigned idx = ARRAY_SIZE(buf) - 1;
if (super_prefix_len < 0) {
- const char *super_prefix = get_super_prefix();
if (!super_prefix) {
super_prefix_len = 0;
} else {
@@ -110,10 +117,10 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
const char *cmd)
{
int i;
- const char **msgs = opts->msgs;
+ const char **msgs = opts->internal.msgs;
const char *msg;
- strvec_init(&opts->msgs_to_free);
+ strvec_init(&opts->internal.msgs_to_free);
if (!strcmp(cmd, "checkout"))
msg = advice_enabled(ADVICE_COMMIT_BEFORE_MERGE)
@@ -131,7 +138,7 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
"Please commit your changes or stash them before you %s.")
: _("Your local changes to the following files would be overwritten by %s:\n%%s");
msgs[ERROR_WOULD_OVERWRITE] = msgs[ERROR_NOT_UPTODATE_FILE] =
- strvec_pushf(&opts->msgs_to_free, msg, cmd, cmd);
+ strvec_pushf(&opts->internal.msgs_to_free, msg, cmd, cmd);
msgs[ERROR_NOT_UPTODATE_DIR] =
_("Updating the following directories would lose untracked files in them:\n%s");
@@ -155,7 +162,7 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
"Please move or remove them before you %s.")
: _("The following untracked working tree files would be removed by %s:\n%%s");
msgs[ERROR_WOULD_LOSE_UNTRACKED_REMOVED] =
- strvec_pushf(&opts->msgs_to_free, msg, cmd, cmd);
+ strvec_pushf(&opts->internal.msgs_to_free, msg, cmd, cmd);
if (!strcmp(cmd, "checkout"))
msg = advice_enabled(ADVICE_COMMIT_BEFORE_MERGE)
@@ -173,7 +180,7 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
"Please move or remove them before you %s.")
: _("The following untracked working tree files would be overwritten by %s:\n%%s");
msgs[ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN] =
- strvec_pushf(&opts->msgs_to_free, msg, cmd, cmd);
+ strvec_pushf(&opts->internal.msgs_to_free, msg, cmd, cmd);
/*
* Special case: ERROR_BIND_OVERLAP refers to a pair of paths, we
@@ -191,16 +198,16 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
msgs[WARNING_SPARSE_ORPHANED_NOT_OVERWRITTEN] =
_("The following paths were already present and thus not updated despite sparse patterns:\n%s");
- opts->show_all_errors = 1;
+ opts->internal.show_all_errors = 1;
/* rejected paths may not have a static buffer */
- for (i = 0; i < ARRAY_SIZE(opts->unpack_rejects); i++)
- opts->unpack_rejects[i].strdup_strings = 1;
+ for (i = 0; i < ARRAY_SIZE(opts->internal.unpack_rejects); i++)
+ opts->internal.unpack_rejects[i].strdup_strings = 1;
}
void clear_unpack_trees_porcelain(struct unpack_trees_options *opts)
{
- strvec_clear(&opts->msgs_to_free);
- memset(opts->msgs, 0, sizeof(opts->msgs));
+ strvec_clear(&opts->internal.msgs_to_free);
+ memset(opts->internal.msgs, 0, sizeof(opts->internal.msgs));
}
static int do_add_entry(struct unpack_trees_options *o, struct cache_entry *ce,
@@ -212,7 +219,7 @@ static int do_add_entry(struct unpack_trees_options *o, struct cache_entry *ce,
set |= CE_WT_REMOVE;
ce->ce_flags = (ce->ce_flags & ~clear) | set;
- return add_index_entry(&o->result, ce,
+ return add_index_entry(&o->internal.result, ce,
ADD_CACHE_OK_TO_ADD | ADD_CACHE_OK_TO_REPLACE);
}
@@ -220,7 +227,7 @@ static void add_entry(struct unpack_trees_options *o,
const struct cache_entry *ce,
unsigned int set, unsigned int clear)
{
- do_add_entry(o, dup_cache_entry(ce, &o->result), set, clear);
+ do_add_entry(o, dup_cache_entry(ce, &o->internal.result), set, clear);
}
/*
@@ -235,14 +242,15 @@ static int add_rejected_path(struct unpack_trees_options *o,
if (o->quiet)
return -1;
- if (!o->show_all_errors)
- return error(ERRORMSG(o, e), super_prefixed(path));
+ if (!o->internal.show_all_errors)
+ return error(ERRORMSG(o, e), super_prefixed(path,
+ o->super_prefix));
/*
* Otherwise, insert in a list for future display by
* display_(error|warning)_msgs()
*/
- string_list_append(&o->unpack_rejects[e], path);
+ string_list_append(&o->internal.unpack_rejects[e], path);
return -1;
}
@@ -254,7 +262,7 @@ static void display_error_msgs(struct unpack_trees_options *o)
int e;
unsigned error_displayed = 0;
for (e = 0; e < NB_UNPACK_TREES_ERROR_TYPES; e++) {
- struct string_list *rejects = &o->unpack_rejects[e];
+ struct string_list *rejects = &o->internal.unpack_rejects[e];
if (rejects->nr > 0) {
int i;
@@ -263,7 +271,8 @@ static void display_error_msgs(struct unpack_trees_options *o)
error_displayed = 1;
for (i = 0; i < rejects->nr; i++)
strbuf_addf(&path, "\t%s\n", rejects->items[i].string);
- error(ERRORMSG(o, e), super_prefixed(path.buf));
+ error(ERRORMSG(o, e), super_prefixed(path.buf,
+ o->super_prefix));
strbuf_release(&path);
}
string_list_clear(rejects, 0);
@@ -281,7 +290,7 @@ static void display_warning_msgs(struct unpack_trees_options *o)
unsigned warning_displayed = 0;
for (e = NB_UNPACK_TREES_ERROR_TYPES + 1;
e < NB_UNPACK_TREES_WARNING_TYPES; e++) {
- struct string_list *rejects = &o->unpack_rejects[e];
+ struct string_list *rejects = &o->internal.unpack_rejects[e];
if (rejects->nr > 0) {
int i;
@@ -290,7 +299,8 @@ static void display_warning_msgs(struct unpack_trees_options *o)
warning_displayed = 1;
for (i = 0; i < rejects->nr; i++)
strbuf_addf(&path, "\t%s\n", rejects->items[i].string);
- warning(ERRORMSG(o, e), super_prefixed(path.buf));
+ warning(ERRORMSG(o, e), super_prefixed(path.buf,
+ o->super_prefix));
strbuf_release(&path);
}
string_list_clear(rejects, 0);
@@ -312,7 +322,8 @@ static int check_submodule_move_head(const struct cache_entry *ce,
if (o->reset)
flags |= SUBMODULE_MOVE_HEAD_FORCE;
- if (submodule_move_head(ce->name, old_id, new_id, flags))
+ if (submodule_move_head(ce->name, o->super_prefix, old_id, new_id,
+ flags))
return add_rejected_path(o, ERROR_WOULD_LOSE_SUBMODULE, ce->name);
return 0;
}
@@ -415,6 +426,7 @@ static int check_updates(struct unpack_trees_options *o,
int i, pc_workers, pc_threshold;
trace_performance_enter();
+ state.super_prefix = o->super_prefix;
state.force = 1;
state.quiet = 1;
state.refresh_cache = 1;
@@ -445,7 +457,7 @@ static int check_updates(struct unpack_trees_options *o,
if (ce->ce_flags & CE_WT_REMOVE) {
display_progress(progress, ++cnt);
- unlink_entry(ce);
+ unlink_entry(ce, o->super_prefix);
}
}
@@ -455,7 +467,7 @@ static int check_updates(struct unpack_trees_options *o,
if (should_update_submodules())
load_gitmodules_file(index, &state);
- if (has_promisor_remote())
+ if (repo_has_promisor_remote(the_repository))
/*
* Prefetch the objects that are to be checked out in the loop
* below.
@@ -597,13 +609,14 @@ static void mark_ce_used(struct cache_entry *ce, struct unpack_trees_options *o)
{
ce->ce_flags |= CE_UNPACKED;
- if (o->cache_bottom < o->src_index->cache_nr &&
- o->src_index->cache[o->cache_bottom] == ce) {
- int bottom = o->cache_bottom;
+ if (o->internal.cache_bottom < o->src_index->cache_nr &&
+ o->src_index->cache[o->internal.cache_bottom] == ce) {
+ int bottom = o->internal.cache_bottom;
+
while (bottom < o->src_index->cache_nr &&
o->src_index->cache[bottom]->ce_flags & CE_UNPACKED)
bottom++;
- o->cache_bottom = bottom;
+ o->internal.cache_bottom = bottom;
}
}
@@ -649,7 +662,7 @@ static void mark_ce_used_same_name(struct cache_entry *ce,
static struct cache_entry *next_cache_entry(struct unpack_trees_options *o)
{
const struct index_state *index = o->src_index;
- int pos = o->cache_bottom;
+ int pos = o->internal.cache_bottom;
while (pos < index->cache_nr) {
struct cache_entry *ce = index->cache[pos];
@@ -708,7 +721,7 @@ static void restore_cache_bottom(struct traverse_info *info, int bottom)
if (o->diff_index_cached)
return;
- o->cache_bottom = bottom;
+ o->internal.cache_bottom = bottom;
}
static int switch_cache_bottom(struct traverse_info *info)
@@ -718,13 +731,13 @@ static int switch_cache_bottom(struct traverse_info *info)
if (o->diff_index_cached)
return 0;
- ret = o->cache_bottom;
+ ret = o->internal.cache_bottom;
pos = find_cache_pos(info->prev, info->name, info->namelen);
if (pos < -1)
- o->cache_bottom = -2 - pos;
+ o->internal.cache_bottom = -2 - pos;
else if (pos < 0)
- o->cache_bottom = o->src_index->cache_nr;
+ o->internal.cache_bottom = o->src_index->cache_nr;
return ret;
}
@@ -835,7 +848,7 @@ static int traverse_by_cache_tree(int pos, int nr_entries, int nr_names,
mark_ce_used(src[0], o);
}
free(tree_ce);
- if (o->debug_unpack)
+ if (o->internal.debug_unpack)
printf("Unpacked %d entries from %s to %s using cache-tree\n",
nr_entries,
o->src_index->cache[pos]->name,
@@ -851,8 +864,8 @@ static int traverse_trees_recursive(int n, unsigned long dirmask,
struct unpack_trees_options *o = info->data;
int i, ret, bottom;
int nr_buf = 0;
- struct tree_desc t[MAX_UNPACK_TREES];
- void *buf[MAX_UNPACK_TREES];
+ struct tree_desc *t;
+ void **buf;
struct traverse_info newinfo;
struct name_entry *p;
int nr_entries;
@@ -870,9 +883,9 @@ static int traverse_trees_recursive(int n, unsigned long dirmask,
* save and restore cache_bottom anyway to not miss
* unprocessed entries before 'pos'.
*/
- bottom = o->cache_bottom;
+ bottom = o->internal.cache_bottom;
ret = traverse_by_cache_tree(pos, nr_entries, n, info);
- o->cache_bottom = bottom;
+ o->internal.cache_bottom = bottom;
return ret;
}
@@ -889,6 +902,9 @@ static int traverse_trees_recursive(int n, unsigned long dirmask,
newinfo.pathlen = st_add3(newinfo.pathlen, tree_entry_len(p), 1);
newinfo.df_conflicts |= df_conflicts;
+ ALLOC_ARRAY(t, n);
+ ALLOC_ARRAY(buf, n);
+
/*
* Fetch the tree from the ODB for each peer directory in the
* n commits.
@@ -924,6 +940,8 @@ static int traverse_trees_recursive(int n, unsigned long dirmask,
for (i = 0; i < nr_buf; i++)
free(buf[i]);
+ free(buf);
+ free(t);
return ret;
}
@@ -1070,6 +1088,67 @@ static struct cache_entry *create_ce_entry(const struct traverse_info *info,
}
/*
+ * Determine whether the path specified by 'p' should be unpacked as a new
+ * sparse directory in a sparse index. A new sparse directory 'A/':
+ * - must be outside the sparse cone.
+ * - must not already be in the index (i.e., no index entry with name 'A/'
+ * exists).
+ * - must not have any child entries in the index (i.e., no index entry
+ * 'A/<something>' exists).
+ * If 'p' meets the above requirements, return 1; otherwise, return 0.
+ */
+static int entry_is_new_sparse_dir(const struct traverse_info *info,
+ const struct name_entry *p)
+{
+ int res, pos;
+ struct strbuf dirpath = STRBUF_INIT;
+ struct unpack_trees_options *o = info->data;
+
+ if (!S_ISDIR(p->mode))
+ return 0;
+
+ /*
+ * If the path is inside the sparse cone, it can't be a sparse directory.
+ */
+ strbuf_add(&dirpath, info->traverse_path, info->pathlen);
+ strbuf_add(&dirpath, p->path, p->pathlen);
+ strbuf_addch(&dirpath, '/');
+ if (path_in_cone_mode_sparse_checkout(dirpath.buf, o->src_index)) {
+ res = 0;
+ goto cleanup;
+ }
+
+ pos = index_name_pos_sparse(o->src_index, dirpath.buf, dirpath.len);
+ if (pos >= 0) {
+ /* Path is already in the index, not a new sparse dir */
+ res = 0;
+ goto cleanup;
+ }
+
+ /* Where would this sparse dir be inserted into the index? */
+ pos = -pos - 1;
+ if (pos >= o->src_index->cache_nr) {
+ /*
+ * Sparse dir would be inserted at the end of the index, so we
+ * know it has no child entries.
+ */
+ res = 1;
+ goto cleanup;
+ }
+
+ /*
+ * If the dir has child entries in the index, the first would be at the
+ * position the sparse directory would be inserted. If the entry at this
+ * position is inside the dir, not a new sparse dir.
+ */
+ res = strncmp(o->src_index->cache[pos]->name, dirpath.buf, dirpath.len);
+
+cleanup:
+ strbuf_release(&dirpath);
+ return res;
+}
+
+/*
* Note that traverse_by_cache_tree() duplicates some logic in this function
* without actually calling it. If you change the logic here you may need to
* check and change there as well.
@@ -1078,21 +1157,44 @@ static int unpack_single_entry(int n, unsigned long mask,
unsigned long dirmask,
struct cache_entry **src,
const struct name_entry *names,
- const struct traverse_info *info)
+ const struct traverse_info *info,
+ int *is_new_sparse_dir)
{
int i;
struct unpack_trees_options *o = info->data;
unsigned long conflicts = info->df_conflicts | dirmask;
+ const struct name_entry *p = names;
- if (mask == dirmask && !src[0])
- return 0;
+ *is_new_sparse_dir = 0;
+ if (mask == dirmask && !src[0]) {
+ /*
+ * If we're not in a sparse index, we can't unpack a directory
+ * without recursing into it, so we return.
+ */
+ if (!o->src_index->sparse_index)
+ return 0;
+
+ /* Find first entry with a real name (we could use "mask" too) */
+ while (!p->mode)
+ p++;
+
+ /*
+ * If the directory is completely missing from the index but
+ * would otherwise be a sparse directory, we should unpack it.
+ * If not, we'll return and continue recursively traversing the
+ * tree.
+ */
+ *is_new_sparse_dir = entry_is_new_sparse_dir(info, p);
+ if (!*is_new_sparse_dir)
+ return 0;
+ }
/*
- * When we have a sparse directory entry for src[0],
- * then this isn't necessarily a directory-file conflict.
+ * When we are unpacking a sparse directory, then this isn't necessarily
+ * a directory-file conflict.
*/
- if (mask == dirmask && src[0] &&
- S_ISSPARSEDIR(src[0]->ce_mode))
+ if (mask == dirmask &&
+ (*is_new_sparse_dir || (src[0] && S_ISSPARSEDIR(src[0]->ce_mode))))
conflicts = 0;
/*
@@ -1125,8 +1227,8 @@ static int unpack_single_entry(int n, unsigned long mask,
* cache entry from the index aware logic.
*/
src[i + o->merge] = create_ce_entry(info, names + i, stage,
- &o->result, o->merge,
- bit & dirmask);
+ &o->internal.result,
+ o->merge, bit & dirmask);
}
if (o->merge) {
@@ -1150,7 +1252,7 @@ static int unpack_single_entry(int n, unsigned long mask,
static int unpack_failed(struct unpack_trees_options *o, const char *message)
{
- discard_index(&o->result);
+ discard_index(&o->internal.result);
if (!o->quiet && !o->exiting_early) {
if (message)
return error("%s", message);
@@ -1173,7 +1275,7 @@ static int find_cache_pos(struct traverse_info *info,
struct index_state *index = o->src_index;
int pfxlen = info->pathlen;
- for (pos = o->cache_bottom; pos < index->cache_nr; pos++) {
+ for (pos = o->internal.cache_bottom; pos < index->cache_nr; pos++) {
const struct cache_entry *ce = index->cache[pos];
const char *ce_name, *ce_slash;
int cmp, ce_len;
@@ -1184,8 +1286,8 @@ static int find_cache_pos(struct traverse_info *info,
* we can never match it; don't check it
* again.
*/
- if (pos == o->cache_bottom)
- ++o->cache_bottom;
+ if (pos == o->internal.cache_bottom)
+ ++o->internal.cache_bottom;
continue;
}
if (!ce_in_traverse_path(ce, info)) {
@@ -1339,7 +1441,7 @@ static void debug_unpack_callback(int n,
* from the tree walk at the given traverse_info.
*/
static int is_sparse_directory_entry(struct cache_entry *ce,
- struct name_entry *name,
+ const struct name_entry *name,
struct traverse_info *info)
{
if (!ce || !name || !S_ISSPARSEDIR(ce->ce_mode))
@@ -1352,7 +1454,7 @@ static int unpack_sparse_callback(int n, unsigned long mask, unsigned long dirma
{
struct cache_entry *src[MAX_UNPACK_TREES + 1] = { NULL, };
struct unpack_trees_options *o = info->data;
- int ret;
+ int ret, is_new_sparse_dir;
assert(o->merge);
@@ -1363,7 +1465,7 @@ static int unpack_sparse_callback(int n, unsigned long mask, unsigned long dirma
*/
if (!is_null_oid(&names[0].oid)) {
src[0] = create_ce_entry(info, &names[0], 0,
- &o->result, 1,
+ &o->internal.result, 1,
dirmask & (1ul << 0));
src[0]->ce_flags |= (CE_SKIP_WORKTREE | CE_NEW_SKIP_WORKTREE);
}
@@ -1376,7 +1478,7 @@ static int unpack_sparse_callback(int n, unsigned long mask, unsigned long dirma
* "index" tree (i.e., names[0]) and adjust 'names', 'n', 'mask', and
* 'dirmask' accordingly.
*/
- ret = unpack_single_entry(n - 1, mask >> 1, dirmask >> 1, src, names + 1, info);
+ ret = unpack_single_entry(n - 1, mask >> 1, dirmask >> 1, src, names + 1, info, &is_new_sparse_dir);
if (src[0])
discard_cache_entry(src[0]);
@@ -1394,12 +1496,13 @@ static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, str
struct cache_entry *src[MAX_UNPACK_TREES + 1] = { NULL, };
struct unpack_trees_options *o = info->data;
const struct name_entry *p = names;
+ int is_new_sparse_dir;
/* Find first entry with a real name (we could use "mask" too) */
while (!p->mode)
p++;
- if (o->debug_unpack)
+ if (o->internal.debug_unpack)
debug_unpack_callback(n, mask, dirmask, names, info);
/* Are we supposed to look at the index too? */
@@ -1440,7 +1543,7 @@ static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, str
}
}
- if (unpack_single_entry(n, mask, dirmask, src, names, info) < 0)
+ if (unpack_single_entry(n, mask, dirmask, src, names, info, &is_new_sparse_dir))
return -1;
if (o->merge && src[0]) {
@@ -1472,12 +1575,13 @@ static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, str
* in 'mark_ce_used()'
*/
if (!src[0] || !S_ISSPARSEDIR(src[0]->ce_mode))
- o->cache_bottom += matches;
+ o->internal.cache_bottom += matches;
return mask;
}
}
- if (!is_sparse_directory_entry(src[0], names, info) &&
+ if (!is_sparse_directory_entry(src[0], p, info) &&
+ !is_new_sparse_dir &&
traverse_trees_recursive(n, dirmask, mask & ~dirmask,
names, info) < 0) {
return -1;
@@ -1720,7 +1824,7 @@ static void populate_from_existing_patterns(struct unpack_trees_options *o,
if (get_sparse_checkout_patterns(pl) < 0)
o->skip_sparse_checkout = 1;
else
- o->pl = pl;
+ o->internal.pl = pl;
}
static void update_sparsity_for_prefix(const char *prefix,
@@ -1782,8 +1886,12 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
if (len > MAX_UNPACK_TREES)
die("unpack_trees takes at most %d trees", MAX_UNPACK_TREES);
- if (o->dir)
- BUG("o->dir is for internal use only");
+ if (o->internal.dir)
+ BUG("o->internal.dir is for internal use only");
+ if (o->internal.pl)
+ BUG("o->internal.pl is for internal use only");
+ if (o->df_conflict_entry)
+ BUG("o->df_conflict_entry is an output only field");
trace_performance_enter();
trace2_region_enter("unpack_trees", "unpack_trees", the_repository);
@@ -1791,7 +1899,8 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
prepare_repo_settings(repo);
if (repo->settings.command_requires_full_index) {
ensure_full_index(o->src_index);
- ensure_full_index(o->dst_index);
+ if (o->dst_index)
+ ensure_full_index(o->dst_index);
}
if (o->reset == UNPACK_RESET_OVERWRITE_UNTRACKED &&
@@ -1799,9 +1908,9 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
BUG("UNPACK_RESET_OVERWRITE_UNTRACKED incompatible with preserved ignored files");
if (!o->preserve_ignored) {
- o->dir = &dir;
- o->dir->flags |= DIR_SHOW_IGNORED;
- setup_standard_excludes(o->dir);
+ o->internal.dir = &dir;
+ o->internal.dir->flags |= DIR_SHOW_IGNORED;
+ setup_standard_excludes(o->internal.dir);
}
if (o->prefix)
@@ -1809,49 +1918,52 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
if (!core_apply_sparse_checkout || !o->update)
o->skip_sparse_checkout = 1;
- if (!o->skip_sparse_checkout && !o->pl) {
+ if (!o->skip_sparse_checkout) {
memset(&pl, 0, sizeof(pl));
free_pattern_list = 1;
populate_from_existing_patterns(o, &pl);
}
- memset(&o->result, 0, sizeof(o->result));
- o->result.initialized = 1;
- o->result.timestamp.sec = o->src_index->timestamp.sec;
- o->result.timestamp.nsec = o->src_index->timestamp.nsec;
- o->result.version = o->src_index->version;
+ index_state_init(&o->internal.result, o->src_index->repo);
+ o->internal.result.initialized = 1;
+ o->internal.result.timestamp.sec = o->src_index->timestamp.sec;
+ o->internal.result.timestamp.nsec = o->src_index->timestamp.nsec;
+ o->internal.result.version = o->src_index->version;
if (!o->src_index->split_index) {
- o->result.split_index = NULL;
+ o->internal.result.split_index = NULL;
} else if (o->src_index == o->dst_index) {
/*
* o->dst_index (and thus o->src_index) will be discarded
- * and overwritten with o->result at the end of this function,
- * so just use src_index's split_index to avoid having to
- * create a new one.
+ * and overwritten with o->internal.result at the end of
+ * this function, so just use src_index's split_index to
+ * avoid having to create a new one.
*/
- o->result.split_index = o->src_index->split_index;
- o->result.split_index->refcount++;
+ o->internal.result.split_index = o->src_index->split_index;
+ if (o->src_index->cache_changed & SPLIT_INDEX_ORDERED)
+ o->internal.result.cache_changed |= SPLIT_INDEX_ORDERED;
+ o->internal.result.split_index->refcount++;
} else {
- o->result.split_index = init_split_index(&o->result);
+ o->internal.result.split_index =
+ init_split_index(&o->internal.result);
}
- oidcpy(&o->result.oid, &o->src_index->oid);
- o->merge_size = len;
+ oidcpy(&o->internal.result.oid, &o->src_index->oid);
+ o->internal.merge_size = len;
mark_all_ce_unused(o->src_index);
- o->result.fsmonitor_last_update =
+ o->internal.result.fsmonitor_last_update =
xstrdup_or_null(o->src_index->fsmonitor_last_update);
- o->result.fsmonitor_has_run_once = o->src_index->fsmonitor_has_run_once;
+ o->internal.result.fsmonitor_has_run_once = o->src_index->fsmonitor_has_run_once;
if (!o->src_index->initialized &&
!repo->settings.command_requires_full_index &&
- is_sparse_index_allowed(&o->result, 0))
- o->result.sparse_index = 1;
+ is_sparse_index_allowed(&o->internal.result, 0))
+ o->internal.result.sparse_index = 1;
/*
* Sparse checkout loop #1: set NEW_SKIP_WORKTREE on existing entries
*/
if (!o->skip_sparse_checkout)
- mark_new_skip_worktree(o->pl, o->src_index, 0,
+ mark_new_skip_worktree(o->internal.pl, o->src_index, 0,
CE_NEW_SKIP_WORKTREE, o->verbose_update);
if (!dfc)
@@ -1865,7 +1977,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
setup_traverse_info(&info, prefix);
info.fn = unpack_callback;
info.data = o;
- info.show_all_errors = o->show_all_errors;
+ info.show_all_errors = o->internal.show_all_errors;
info.pathspec = o->pathspec;
if (o->prefix) {
@@ -1906,7 +2018,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
}
mark_all_ce_unused(o->src_index);
- if (o->trivial_merges_only && o->nontrivial_merge) {
+ if (o->trivial_merges_only && o->internal.nontrivial_merge) {
ret = unpack_failed(o, "Merge requires file-level merging");
goto done;
}
@@ -1917,13 +2029,13 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
* If they will have NEW_SKIP_WORKTREE, also set CE_SKIP_WORKTREE
* so apply_sparse_checkout() won't attempt to remove it from worktree
*/
- mark_new_skip_worktree(o->pl, &o->result,
+ mark_new_skip_worktree(o->internal.pl, &o->internal.result,
CE_ADDED, CE_SKIP_WORKTREE | CE_NEW_SKIP_WORKTREE,
o->verbose_update);
ret = 0;
- for (i = 0; i < o->result.cache_nr; i++) {
- struct cache_entry *ce = o->result.cache[i];
+ for (i = 0; i < o->internal.result.cache_nr; i++) {
+ struct cache_entry *ce = o->internal.result.cache[i];
/*
* Entries marked with CE_ADDED in merged_entry() do not have
@@ -1937,7 +2049,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
verify_absent(ce, WARNING_SPARSE_ORPHANED_NOT_OVERWRITTEN, o))
ret = 1;
- if (apply_sparse_checkout(&o->result, ce, o))
+ if (apply_sparse_checkout(&o->internal.result, ce, o))
ret = 1;
}
if (ret == 1) {
@@ -1945,45 +2057,47 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
* Inability to sparsify or de-sparsify individual
* paths is not an error, but just a warning.
*/
- if (o->show_all_errors)
+ if (o->internal.show_all_errors)
display_warning_msgs(o);
ret = 0;
}
}
- ret = check_updates(o, &o->result) ? (-2) : 0;
+ ret = check_updates(o, &o->internal.result) ? (-2) : 0;
if (o->dst_index) {
- move_index_extensions(&o->result, o->src_index);
+ move_index_extensions(&o->internal.result, o->src_index);
if (!ret) {
if (git_env_bool("GIT_TEST_CHECK_CACHE_TREE", 0))
- cache_tree_verify(the_repository, &o->result);
- if (!cache_tree_fully_valid(o->result.cache_tree))
- cache_tree_update(&o->result,
+ cache_tree_verify(the_repository,
+ &o->internal.result);
+ if (!o->skip_cache_tree_update &&
+ !cache_tree_fully_valid(o->internal.result.cache_tree))
+ cache_tree_update(&o->internal.result,
WRITE_TREE_SILENT |
WRITE_TREE_REPAIR);
}
- o->result.updated_workdir = 1;
+ o->internal.result.updated_workdir = 1;
discard_index(o->dst_index);
- *o->dst_index = o->result;
+ *o->dst_index = o->internal.result;
} else {
- discard_index(&o->result);
+ discard_index(&o->internal.result);
}
o->src_index = NULL;
done:
if (free_pattern_list)
clear_pattern_list(&pl);
- if (o->dir) {
- dir_clear(o->dir);
- o->dir = NULL;
+ if (o->internal.dir) {
+ dir_clear(o->internal.dir);
+ o->internal.dir = NULL;
}
trace2_region_leave("unpack_trees", "unpack_trees", the_repository);
trace_performance_leave("unpack_trees");
return ret;
return_failed:
- if (o->show_all_errors)
+ if (o->internal.show_all_errors)
display_error_msgs(o);
mark_all_ce_unused(o->src_index);
ret = unpack_failed(o, NULL);
@@ -1998,16 +2112,17 @@ return_failed:
*
* CE_NEW_SKIP_WORKTREE is used internally.
*/
-enum update_sparsity_result update_sparsity(struct unpack_trees_options *o)
+enum update_sparsity_result update_sparsity(struct unpack_trees_options *o,
+ struct pattern_list *pl)
{
enum update_sparsity_result ret = UPDATE_SPARSITY_SUCCESS;
- struct pattern_list pl;
int i;
unsigned old_show_all_errors;
int free_pattern_list = 0;
- old_show_all_errors = o->show_all_errors;
- o->show_all_errors = 1;
+ old_show_all_errors = o->internal.show_all_errors;
+ o->internal.show_all_errors = 1;
+ index_state_init(&o->internal.result, o->src_index->repo);
/* Sanity checks */
if (!o->update || o->index_only || o->skip_sparse_checkout)
@@ -2018,20 +2133,19 @@ enum update_sparsity_result update_sparsity(struct unpack_trees_options *o)
trace_performance_enter();
/* If we weren't given patterns, use the recorded ones */
- if (!o->pl) {
- memset(&pl, 0, sizeof(pl));
+ if (!pl) {
free_pattern_list = 1;
- populate_from_existing_patterns(o, &pl);
- if (o->skip_sparse_checkout)
- goto skip_sparse_checkout;
+ pl = xcalloc(1, sizeof(*pl));
+ populate_from_existing_patterns(o, pl);
}
+ o->internal.pl = pl;
/* Expand sparse directories as needed */
- expand_index(o->src_index, o->pl);
+ expand_index(o->src_index, o->internal.pl);
/* Set NEW_SKIP_WORKTREE on existing entries. */
mark_all_ce_unused(o->src_index);
- mark_new_skip_worktree(o->pl, o->src_index, 0,
+ mark_new_skip_worktree(o->internal.pl, o->src_index, 0,
CE_NEW_SKIP_WORKTREE, o->verbose_update);
/* Then loop over entries and update/remove as needed */
@@ -2051,14 +2165,16 @@ enum update_sparsity_result update_sparsity(struct unpack_trees_options *o)
ret = UPDATE_SPARSITY_WARNINGS;
}
-skip_sparse_checkout:
if (check_updates(o, o->src_index))
ret = UPDATE_SPARSITY_WORKTREE_UPDATE_FAILURES;
display_warning_msgs(o);
- o->show_all_errors = old_show_all_errors;
- if (free_pattern_list)
- clear_pattern_list(&pl);
+ o->internal.show_all_errors = old_show_all_errors;
+ if (free_pattern_list) {
+ clear_pattern_list(pl);
+ free(pl);
+ o->internal.pl = NULL;
+ }
trace_performance_leave("update_sparsity");
return ret;
}
@@ -2153,15 +2269,15 @@ static int verify_uptodate_sparse(const struct cache_entry *ce,
}
/*
- * TODO: We should actually invalidate o->result, not src_index [1].
+ * TODO: We should actually invalidate o->internal.result, not src_index [1].
* But since cache tree and untracked cache both are not copied to
- * o->result until unpacking is complete, we invalidate them on
+ * o->internal.result until unpacking is complete, we invalidate them on
* src_index instead with the assumption that they will be copied to
* dst_index at the end.
*
* [1] src_index->cache_tree is also used in unpack_callback() so if
- * we invalidate o->result, we need to update it to use
- * o->result.cache_tree as well.
+ * we invalidate o->internal.result, we need to update it to use
+ * o->internal.result.cache_tree as well.
*/
static void invalidate_ce_path(const struct cache_entry *ce,
struct unpack_trees_options *o)
@@ -2245,8 +2361,8 @@ static int verify_clean_subdirectory(const struct cache_entry *ce,
pathbuf = xstrfmt("%.*s/", namelen, ce->name);
memset(&d, 0, sizeof(d));
- if (o->dir)
- d.exclude_per_dir = o->dir->exclude_per_dir;
+ if (o->internal.dir)
+ setup_standard_excludes(&d);
i = read_directory(&d, o->src_index, pathbuf, namelen+1, NULL);
dir_clear(&d);
free(pathbuf);
@@ -2300,8 +2416,8 @@ static int check_ok_to_remove(const char *name, int len, int dtype,
if (ignore_case && icase_exists(o, name, len, st))
return 0;
- if (o->dir &&
- is_excluded(o->dir, o->src_index, name, &dtype))
+ if (o->internal.dir &&
+ is_excluded(o->internal.dir, o->src_index, name, &dtype))
/*
* ce->name is explicitly excluded, so it is Ok to
* overwrite it.
@@ -2329,7 +2445,7 @@ static int check_ok_to_remove(const char *name, int len, int dtype,
* delete this path, which is in a subdirectory that
* is being replaced with a blob.
*/
- result = index_file_exists(&o->result, name, len, 0);
+ result = index_file_exists(&o->internal.result, name, len, 0);
if (result) {
if (result->ce_flags & CE_REMOVE)
return 0;
@@ -2430,7 +2546,7 @@ static int merged_entry(const struct cache_entry *ce,
struct unpack_trees_options *o)
{
int update = CE_UPDATE;
- struct cache_entry *merge = dup_cache_entry(ce, &o->result);
+ struct cache_entry *merge = dup_cache_entry(ce, &o->internal.result);
if (!old) {
/*
@@ -2525,7 +2641,7 @@ static int merged_sparse_dir(const struct cache_entry * const *src, int n,
setup_traverse_info(&info, src[0]->name);
info.fn = unpack_sparse_callback;
info.data = o;
- info.show_all_errors = o->show_all_errors;
+ info.show_all_errors = o->internal.show_all_errors;
info.pathspec = o->pathspec;
/* Get the tree descriptors of the sparse directory in each of the merging trees */
@@ -2743,7 +2859,7 @@ int threeway_merge(const struct cache_entry * const *stages,
return -1;
}
- o->nontrivial_merge = 1;
+ o->internal.nontrivial_merge = 1;
/* #2, #3, #4, #6, #7, #9, #10, #11. */
count = 0;
@@ -2784,9 +2900,9 @@ int twoway_merge(const struct cache_entry * const *src,
const struct cache_entry *oldtree = src[1];
const struct cache_entry *newtree = src[2];
- if (o->merge_size != 2)
+ if (o->internal.merge_size != 2)
return error("Cannot do a twoway merge of %d trees",
- o->merge_size);
+ o->internal.merge_size);
if (oldtree == o->df_conflict_entry)
oldtree = NULL;
@@ -2866,14 +2982,14 @@ int bind_merge(const struct cache_entry * const *src,
const struct cache_entry *old = src[0];
const struct cache_entry *a = src[1];
- if (o->merge_size != 1)
+ if (o->internal.merge_size != 1)
return error("Cannot do a bind merge of %d trees",
- o->merge_size);
+ o->internal.merge_size);
if (a && old)
return o->quiet ? -1 :
error(ERRORMSG(o, ERROR_BIND_OVERLAP),
- super_prefixed(a->name),
- super_prefixed(old->name));
+ super_prefixed(a->name, o->super_prefix),
+ super_prefixed(old->name, o->super_prefix));
if (!a)
return keep_entry(old, o);
else
@@ -2892,9 +3008,9 @@ int oneway_merge(const struct cache_entry * const *src,
const struct cache_entry *old = src[0];
const struct cache_entry *a = src[1];
- if (o->merge_size != 1)
+ if (o->internal.merge_size != 1)
return error("Cannot do a oneway merge of %d trees",
- o->merge_size);
+ o->internal.merge_size);
if (!a || a == o->df_conflict_entry)
return deleted_entry(old, old, o);
@@ -2929,12 +3045,12 @@ int stash_worktree_untracked_merge(const struct cache_entry * const *src,
const struct cache_entry *worktree = src[1];
const struct cache_entry *untracked = src[2];
- if (o->merge_size != 2)
- BUG("invalid merge_size: %d", o->merge_size);
+ if (o->internal.merge_size != 2)
+ BUG("invalid merge_size: %d", o->internal.merge_size);
if (worktree && untracked)
return error(_("worktree and untracked commit have duplicate entries: %s"),
- super_prefixed(worktree->name));
+ super_prefixed(worktree->name, o->super_prefix));
return merged_entry(worktree ? worktree : untracked, NULL, o);
}
diff --git a/unpack-trees.h b/unpack-trees.h
index efb9edf..5867e26 100644
--- a/unpack-trees.h
+++ b/unpack-trees.h
@@ -1,12 +1,13 @@
#ifndef UNPACK_TREES_H
#define UNPACK_TREES_H
-#include "cache.h"
+#include "convert.h"
+#include "read-cache-ll.h"
#include "strvec.h"
#include "string-list.h"
#include "tree-walk.h"
-#define MAX_UNPACK_TREES MAX_TRAVERSE_TREES
+#define MAX_UNPACK_TREES 8
struct cache_entry;
struct unpack_trees_options;
@@ -59,45 +60,54 @@ struct unpack_trees_options {
preserve_ignored,
clone,
index_only,
- nontrivial_merge,
trivial_merges_only,
verbose_update,
aggressive,
skip_unmerged,
initial_checkout,
diff_index_cached,
- debug_unpack,
skip_sparse_checkout,
quiet,
exiting_early,
- show_all_errors,
- dry_run;
+ dry_run,
+ skip_cache_tree_update;
enum unpack_trees_reset_type reset;
const char *prefix;
- int cache_bottom;
+ const char *super_prefix;
struct pathspec *pathspec;
merge_fn_t fn;
- const char *msgs[NB_UNPACK_TREES_WARNING_TYPES];
- struct strvec msgs_to_free;
- /*
- * Store error messages in an array, each case
- * corresponding to a error message type
- */
- struct string_list unpack_rejects[NB_UNPACK_TREES_WARNING_TYPES];
int head_idx;
- int merge_size;
- struct cache_entry *df_conflict_entry;
+ struct cache_entry *df_conflict_entry; /* output only */
void *unpack_data;
struct index_state *dst_index;
struct index_state *src_index;
- struct index_state result;
- struct pattern_list *pl; /* for internal use */
- struct dir_struct *dir; /* for internal use only */
struct checkout_metadata meta;
+
+ struct unpack_trees_options_internal {
+ unsigned int nontrivial_merge,
+ show_all_errors,
+ debug_unpack; /* used by read-tree debugging */
+
+ int merge_size; /* used by read-tree debugging */
+ int cache_bottom;
+ const char *msgs[NB_UNPACK_TREES_WARNING_TYPES];
+ struct strvec msgs_to_free;
+
+ /*
+ * Store error messages in an array, each case
+ * corresponding to a error message type
+ */
+ struct string_list unpack_rejects[NB_UNPACK_TREES_WARNING_TYPES];
+
+ struct index_state result;
+
+ struct pattern_list *pl;
+ struct dir_struct *dir;
+ } internal;
};
int unpack_trees(unsigned n, struct tree_desc *t,
@@ -110,7 +120,8 @@ enum update_sparsity_result {
UPDATE_SPARSITY_WORKTREE_UPDATE_FAILURES = -2
};
-enum update_sparsity_result update_sparsity(struct unpack_trees_options *options);
+enum update_sparsity_result update_sparsity(struct unpack_trees_options *options,
+ struct pattern_list *pl);
int verify_uptodate(const struct cache_entry *ce,
struct unpack_trees_options *o);
diff --git a/upload-pack.c b/upload-pack.c
index 3a851b3..902144b 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -1,17 +1,18 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
#include "refs.h"
#include "pkt-line.h"
#include "sideband.h"
#include "repository.h"
-#include "object-store.h"
-#include "tag.h"
+#include "object-store-ll.h"
+#include "oid-array.h"
#include "object.h"
#include "commit.h"
#include "diff.h"
#include "revision.h"
-#include "list-objects.h"
-#include "list-objects-filter.h"
#include "list-objects-filter-options.h"
#include "run-command.h"
#include "connect.h"
@@ -19,14 +20,15 @@
#include "version.h"
#include "string-list.h"
#include "strvec.h"
-#include "prio-queue.h"
+#include "trace2.h"
#include "protocol.h"
-#include "quote.h"
#include "upload-pack.h"
-#include "serve.h"
#include "commit-graph.h"
#include "commit-reach.h"
#include "shallow.h"
+#include "write-or-die.h"
+#include "json-writer.h"
+#include "strmap.h"
/* Remember to update object flag allocation in object.h */
#define THEY_HAVE (1u << 11)
@@ -60,11 +62,11 @@ struct upload_pack_data {
struct string_list symref; /* v0 only */
struct object_array want_obj;
struct object_array have_obj;
- struct oid_array haves; /* v2 only */
- struct string_list wanted_refs; /* v2 only */
+ struct strmap wanted_refs; /* v2 only */
+ struct strvec hidden_refs;
struct object_array shallows;
- struct string_list deepen_not;
+ struct oidset deepen_not;
struct object_array extra_edge_obj;
int depth;
timestamp_t deepen_since;
@@ -111,18 +113,21 @@ struct upload_pack_data {
unsigned done : 1; /* v2 only */
unsigned allow_ref_in_want : 1; /* v2 only */
unsigned allow_sideband_all : 1; /* v2 only */
+ unsigned seen_haves : 1; /* v2 only */
+ unsigned allow_packfile_uris : 1; /* v2 only */
unsigned advertise_sid : 1;
+ unsigned sent_capabilities : 1;
};
static void upload_pack_data_init(struct upload_pack_data *data)
{
struct string_list symref = STRING_LIST_INIT_DUP;
- struct string_list wanted_refs = STRING_LIST_INIT_DUP;
+ struct strmap wanted_refs = STRMAP_INIT;
+ struct strvec hidden_refs = STRVEC_INIT;
struct object_array want_obj = OBJECT_ARRAY_INIT;
struct object_array have_obj = OBJECT_ARRAY_INIT;
- struct oid_array haves = OID_ARRAY_INIT;
struct object_array shallows = OBJECT_ARRAY_INIT;
- struct string_list deepen_not = STRING_LIST_INIT_DUP;
+ struct oidset deepen_not = OID_ARRAY_INIT;
struct string_list uri_protocols = STRING_LIST_INIT_DUP;
struct object_array extra_edge_obj = OBJECT_ARRAY_INIT;
struct string_list allowed_filters = STRING_LIST_INIT_DUP;
@@ -130,9 +135,9 @@ static void upload_pack_data_init(struct upload_pack_data *data)
memset(data, 0, sizeof(*data));
data->symref = symref;
data->wanted_refs = wanted_refs;
+ data->hidden_refs = hidden_refs;
data->want_obj = want_obj;
data->have_obj = have_obj;
- data->haves = haves;
data->shallows = shallows;
data->deepen_not = deepen_not;
data->uri_protocols = uri_protocols;
@@ -141,6 +146,7 @@ static void upload_pack_data_init(struct upload_pack_data *data)
data->allow_filter_fallback = 1;
data->tree_filter_max_depth = ULONG_MAX;
packet_writer_init(&data->writer, 1);
+ list_objects_filter_init(&data->filter_options);
data->keepalive = 5;
data->advertise_sid = 0;
@@ -149,12 +155,12 @@ static void upload_pack_data_init(struct upload_pack_data *data)
static void upload_pack_data_clear(struct upload_pack_data *data)
{
string_list_clear(&data->symref, 1);
- string_list_clear(&data->wanted_refs, 1);
+ strmap_clear(&data->wanted_refs, 1);
+ strvec_clear(&data->hidden_refs);
object_array_clear(&data->want_obj);
object_array_clear(&data->have_obj);
- oid_array_clear(&data->haves);
object_array_clear(&data->shallows);
- string_list_clear(&data->deepen_not, 0);
+ oidset_clear(&data->deepen_not);
object_array_clear(&data->extra_edge_obj);
list_objects_filter_release(&data->filter_options);
string_list_clear(&data->allowed_filters, 0);
@@ -455,7 +461,8 @@ static void create_pack_file(struct upload_pack_data *pack_data,
return;
fail:
- send_client_data(3, abort_msg, sizeof(abort_msg),
+ free(output_state);
+ send_client_data(3, abort_msg, strlen(abort_msg),
pack_data->use_sideband);
die("git upload-pack: %s", abort_msg);
}
@@ -463,7 +470,9 @@ static void create_pack_file(struct upload_pack_data *pack_data,
static int do_got_oid(struct upload_pack_data *data, const struct object_id *oid)
{
int we_knew_they_have = 0;
- struct object *o = parse_object(the_repository, oid);
+ struct object *o = parse_object_with_flags(the_repository, oid,
+ PARSE_OBJECT_SKIP_HASH_CHECK |
+ PARSE_OBJECT_DISCARD_TREE);
if (!o)
die("oops (%s)", oid_to_hex(oid));
@@ -493,8 +502,8 @@ static int got_oid(struct upload_pack_data *data,
{
if (get_oid_hex(hex, oid))
die("git upload-pack: expected SHA1 object, got '%s'", hex);
- if (!has_object_file_with_flags(oid,
- OBJECT_INFO_QUICK | OBJECT_INFO_SKIP_FETCH_OBJECT))
+ if (!repo_has_object_file_with_flags(the_repository, oid,
+ OBJECT_INFO_QUICK | OBJECT_INFO_SKIP_FETCH_OBJECT))
return -1;
return do_got_oid(data, oid);
}
@@ -520,8 +529,6 @@ static int get_common_commits(struct upload_pack_data *data,
int got_other = 0;
int sent_ready = 0;
- save_commit_buffer = 0;
-
for (;;) {
const char *arg;
@@ -588,11 +595,36 @@ static int get_common_commits(struct upload_pack_data *data,
}
}
+static int allow_hidden_refs(enum allow_uor allow_uor)
+{
+ if ((allow_uor & ALLOW_ANY_SHA1) == ALLOW_ANY_SHA1)
+ return 1;
+ return !(allow_uor & (ALLOW_TIP_SHA1 | ALLOW_REACHABLE_SHA1));
+}
+
+static void for_each_namespaced_ref_1(each_ref_fn fn,
+ struct upload_pack_data *data)
+{
+ const char **excludes = NULL;
+ /*
+ * If `data->allow_uor` allows fetching hidden refs, we need to
+ * mark all references (including hidden ones), to check in
+ * `is_our_ref()` below.
+ *
+ * Otherwise, we only care about whether each reference's object
+ * has the OUR_REF bit set or not, so do not need to visit
+ * hidden references.
+ */
+ if (allow_hidden_refs(data->allow_uor))
+ excludes = hidden_refs_to_excludes(&data->hidden_refs);
+
+ for_each_namespaced_ref(excludes, fn, data);
+}
+
+
static int is_our_ref(struct object *o, enum allow_uor allow_uor)
{
- int allow_hidden_ref = (allow_uor &
- (ALLOW_TIP_SHA1 | ALLOW_REACHABLE_SHA1));
- return o->flags & ((allow_hidden_ref ? HIDDEN_REF : 0) | OUR_REF);
+ return o->flags & ((allow_hidden_refs(allow_uor) ? 0 : HIDDEN_REF) | OUR_REF);
}
/*
@@ -763,11 +795,12 @@ error:
for (i = 0; i < data->want_obj.nr; i++) {
struct object *o = data->want_obj.objects[i].item;
if (!is_our_ref(o, data->allow_uor)) {
+ error("git upload-pack: not our ref %s",
+ oid_to_hex(&o->oid));
packet_writer_error(&data->writer,
"upload-pack: not our ref %s",
oid_to_hex(&o->oid));
- die("git upload-pack: not our ref %s",
- oid_to_hex(&o->oid));
+ exit(128);
}
}
}
@@ -840,8 +873,8 @@ static void deepen(struct upload_pack_data *data, int depth)
* Checking for reachable shallows requires that our refs be
* marked with OUR_REF.
*/
- head_ref_namespaced(check_ref, NULL);
- for_each_namespaced_ref(check_ref, NULL);
+ head_ref_namespaced(check_ref, data);
+ for_each_namespaced_ref_1(check_ref, data);
get_reachable_list(data, &reachable_shallows);
result = get_shallow_commits(&reachable_shallows,
@@ -892,12 +925,13 @@ static int send_shallow_list(struct upload_pack_data *data)
strvec_push(&av, "rev-list");
if (data->deepen_since)
strvec_pushf(&av, "--max-age=%"PRItime, data->deepen_since);
- if (data->deepen_not.nr) {
+ if (oidset_size(&data->deepen_not)) {
+ const struct object_id *oid;
+ struct oidset_iter iter;
strvec_push(&av, "--not");
- for (i = 0; i < data->deepen_not.nr; i++) {
- struct string_list_item *s = data->deepen_not.items + i;
- strvec_push(&av, s->string);
- }
+ oidset_iter_init(&data->deepen_not, &iter);
+ while ((oid = oidset_iter_next(&iter)))
+ strvec_push(&av, oid_to_hex(oid));
strvec_push(&av, "--not");
}
for (i = 0; i < data->want_obj.nr; i++) {
@@ -973,7 +1007,7 @@ static int process_deepen_since(const char *line, timestamp_t *deepen_since, int
return 0;
}
-static int process_deepen_not(const char *line, struct string_list *deepen_not, int *deepen_rev_list)
+static int process_deepen_not(const char *line, struct oidset *deepen_not, int *deepen_rev_list)
{
const char *arg;
if (skip_prefix(line, "deepen-not ", &arg)) {
@@ -981,7 +1015,7 @@ static int process_deepen_not(const char *line, struct string_list *deepen_not,
struct object_id oid;
if (expand_ref(the_repository, arg, strlen(arg), &oid, &ref) != 1)
die("git upload-pack: ambiguous deepen-not: %s", line);
- string_list_append(deepen_not, ref);
+ oidset_insert(deepen_not, &oid);
free(ref);
*deepen_rev_list = 1;
return 1;
@@ -1057,7 +1091,7 @@ static void receive_needs(struct upload_pack_data *data,
const char *features;
struct object_id oid_buf;
const char *arg;
- int feature_len;
+ size_t feature_len;
reset_timeout(data->timeout);
if (packet_reader_read(reader) != PACKET_READ_NORMAL)
@@ -1117,7 +1151,9 @@ static void receive_needs(struct upload_pack_data *data,
free(client_sid);
}
- o = parse_object(the_repository, &oid_buf);
+ o = parse_object_with_flags(the_repository, &oid_buf,
+ PARSE_OBJECT_SKIP_HASH_CHECK |
+ PARSE_OBJECT_DISCARD_TREE);
if (!o) {
packet_writer_error(&data->writer,
"upload-pack: not our ref %s",
@@ -1156,11 +1192,11 @@ static void receive_needs(struct upload_pack_data *data,
/* return non-zero if the ref is hidden, otherwise 0 */
static int mark_our_ref(const char *refname, const char *refname_full,
- const struct object_id *oid)
+ const struct object_id *oid, const struct strvec *hidden_refs)
{
struct object *o = lookup_unknown_object(the_repository, oid);
- if (ref_is_hidden(refname, refname_full)) {
+ if (ref_is_hidden(refname, refname_full, hidden_refs)) {
o->flags |= HIDDEN_REF;
return 1;
}
@@ -1169,11 +1205,12 @@ static int mark_our_ref(const char *refname, const char *refname_full,
}
static int check_ref(const char *refname_full, const struct object_id *oid,
- int flag, void *cb_data)
+ int flag UNUSED, void *cb_data)
{
const char *refname = strip_namespace(refname_full);
+ struct upload_pack_data *data = cb_data;
- mark_our_ref(refname, refname_full, oid);
+ mark_our_ref(refname, refname_full, oid, &data->hidden_refs);
return 0;
}
@@ -1192,18 +1229,17 @@ static void format_session_id(struct strbuf *buf, struct upload_pack_data *d) {
strbuf_addf(buf, " session-id=%s", trace2_session_id());
}
-static int send_ref(const char *refname, const struct object_id *oid,
- int flag, void *cb_data)
+static void write_v0_ref(struct upload_pack_data *data,
+ const char *refname, const char *refname_nons,
+ const struct object_id *oid)
{
static const char *capabilities = "multi_ack thin-pack side-band"
" side-band-64k ofs-delta shallow deepen-since deepen-not"
" deepen-relative no-progress include-tag multi_ack_detailed";
- const char *refname_nons = strip_namespace(refname);
struct object_id peeled;
- struct upload_pack_data *data = cb_data;
- if (mark_our_ref(refname_nons, refname, oid))
- return 0;
+ if (mark_our_ref(refname_nons, refname, oid, &data->hidden_refs))
+ return;
if (capabilities) {
struct strbuf symref_info = STRBUF_INIT;
@@ -1226,16 +1262,25 @@ static int send_ref(const char *refname, const struct object_id *oid,
git_user_agent_sanitized());
strbuf_release(&symref_info);
strbuf_release(&session_id);
+ data->sent_capabilities = 1;
} else {
packet_fwrite_fmt(stdout, "%s %s\n", oid_to_hex(oid), refname_nons);
}
capabilities = NULL;
if (!peel_iterated_oid(oid, &peeled))
packet_fwrite_fmt(stdout, "%s %s^{}\n", oid_to_hex(&peeled), refname_nons);
+ return;
+}
+
+static int send_ref(const char *refname, const struct object_id *oid,
+ int flag UNUSED, void *cb_data)
+{
+ write_v0_ref(cb_data, refname, strip_namespace(refname), oid);
return 0;
}
-static int find_symref(const char *refname, const struct object_id *oid,
+static int find_symref(const char *refname,
+ const struct object_id *oid UNUSED,
int flag, void *cb_data)
{
const char *symref_target;
@@ -1252,7 +1297,8 @@ static int find_symref(const char *refname, const struct object_id *oid,
}
static int parse_object_filter_config(const char *var, const char *value,
- struct upload_pack_data *data)
+ const struct key_value_info *kvi,
+ struct upload_pack_data *data)
{
struct strbuf buf = STRBUF_INIT;
const char *sub, *key;
@@ -1279,14 +1325,17 @@ static int parse_object_filter_config(const char *var, const char *value,
}
string_list_insert(&data->allowed_filters, buf.buf)->util =
(void *)(intptr_t)1;
- data->tree_filter_max_depth = git_config_ulong(var, value);
+ data->tree_filter_max_depth = git_config_ulong(var, value,
+ kvi);
}
strbuf_release(&buf);
return 0;
}
-static int upload_pack_config(const char *var, const char *value, void *cb_data)
+static int upload_pack_config(const char *var, const char *value,
+ const struct config_context *ctx,
+ void *cb_data)
{
struct upload_pack_data *data = cb_data;
@@ -1306,7 +1355,7 @@ static int upload_pack_config(const char *var, const char *value, void *cb_data)
else
data->allow_uor &= ~ALLOW_ANY_SHA1;
} else if (!strcmp("uploadpack.keepalive", var)) {
- data->keepalive = git_config_int(var, value);
+ data->keepalive = git_config_int(var, value, ctx->kvi);
if (!data->keepalive)
data->keepalive = -1;
} else if (!strcmp("uploadpack.allowfilter", var)) {
@@ -1315,22 +1364,39 @@ static int upload_pack_config(const char *var, const char *value, void *cb_data)
data->allow_ref_in_want = git_config_bool(var, value);
} else if (!strcmp("uploadpack.allowsidebandall", var)) {
data->allow_sideband_all = git_config_bool(var, value);
+ } else if (!strcmp("uploadpack.blobpackfileuri", var)) {
+ if (value)
+ data->allow_packfile_uris = 1;
} else if (!strcmp("core.precomposeunicode", var)) {
precomposed_unicode = git_config_bool(var, value);
} else if (!strcmp("transfer.advertisesid", var)) {
data->advertise_sid = git_config_bool(var, value);
}
- if (current_config_scope() != CONFIG_SCOPE_LOCAL &&
- current_config_scope() != CONFIG_SCOPE_WORKTREE) {
- if (!strcmp("uploadpack.packobjectshook", var))
- return git_config_string(&data->pack_objects_hook, var, value);
- }
-
- if (parse_object_filter_config(var, value, data) < 0)
+ if (parse_object_filter_config(var, value, ctx->kvi, data) < 0)
return -1;
- return parse_hide_refs_config(var, value, "uploadpack");
+ return parse_hide_refs_config(var, value, "uploadpack", &data->hidden_refs);
+}
+
+static int upload_pack_protected_config(const char *var, const char *value,
+ const struct config_context *ctx UNUSED,
+ void *cb_data)
+{
+ struct upload_pack_data *data = cb_data;
+
+ if (!strcmp("uploadpack.packobjectshook", var))
+ return git_config_string(&data->pack_objects_hook, var, value);
+ return 0;
+}
+
+static void get_upload_pack_config(struct repository *r,
+ struct upload_pack_data *data)
+{
+ repo_config(r, upload_pack_config, data);
+ git_protected_config(upload_pack_protected_config, data);
+
+ data->allow_sideband_all |= git_env_bool("GIT_TEST_SIDEBAND_ALL", 0);
}
void upload_pack(const int advertise_refs, const int stateless_rpc,
@@ -1340,8 +1406,7 @@ void upload_pack(const int advertise_refs, const int stateless_rpc,
struct upload_pack_data data;
upload_pack_data_init(&data);
-
- git_config(upload_pack_config, &data);
+ get_upload_pack_config(the_repository, &data);
data.stateless_rpc = stateless_rpc;
data.timeout = timeout;
@@ -1355,7 +1420,11 @@ void upload_pack(const int advertise_refs, const int stateless_rpc,
if (advertise_refs)
data.no_done = 1;
head_ref_namespaced(send_ref, &data);
- for_each_namespaced_ref(send_ref, &data);
+ for_each_namespaced_ref_1(send_ref, &data);
+ if (!data.sent_capabilities) {
+ const char *refname = "capabilities^{}";
+ write_v0_ref(&data, refname, refname, null_oid());
+ }
/*
* fflush stdout before calling advertise_shallow_grafts because send_ref
* uses stdio.
@@ -1364,8 +1433,8 @@ void upload_pack(const int advertise_refs, const int stateless_rpc,
advertise_shallow_grafts(1);
packet_flush(1);
} else {
- head_ref_namespaced(check_ref, NULL);
- for_each_namespaced_ref(check_ref, NULL);
+ head_ref_namespaced(check_ref, &data);
+ for_each_namespaced_ref_1(check_ref, &data);
}
if (!advertise_refs) {
@@ -1400,18 +1469,15 @@ static int parse_want(struct packet_writer *writer, const char *line,
const char *arg;
if (skip_prefix(line, "want ", &arg)) {
struct object_id oid;
- struct commit *commit;
struct object *o;
if (get_oid_hex(arg, &oid))
die("git upload-pack: protocol error, "
"expected to get oid, not '%s'", line);
- commit = lookup_commit_in_graph(the_repository, &oid);
- if (commit)
- o = &commit->object;
- else
- o = parse_object(the_repository, &oid);
+ o = parse_object_with_flags(the_repository, &oid,
+ PARSE_OBJECT_SKIP_HASH_CHECK |
+ PARSE_OBJECT_DISCARD_TREE);
if (!o) {
packet_writer_error(writer,
@@ -1433,26 +1499,29 @@ static int parse_want(struct packet_writer *writer, const char *line,
}
static int parse_want_ref(struct packet_writer *writer, const char *line,
- struct string_list *wanted_refs,
+ struct strmap *wanted_refs,
+ struct strvec *hidden_refs,
struct object_array *want_obj)
{
const char *refname_nons;
if (skip_prefix(line, "want-ref ", &refname_nons)) {
struct object_id oid;
- struct string_list_item *item;
struct object *o = NULL;
struct strbuf refname = STRBUF_INIT;
strbuf_addf(&refname, "%s%s", get_git_namespace(), refname_nons);
- if (ref_is_hidden(refname_nons, refname.buf) ||
+ if (ref_is_hidden(refname_nons, refname.buf, hidden_refs) ||
read_ref(refname.buf, &oid)) {
packet_writer_error(writer, "unknown ref %s", refname_nons);
die("unknown ref %s", refname_nons);
}
strbuf_release(&refname);
- item = string_list_append(wanted_refs, refname_nons);
- item->util = oiddup(&oid);
+ if (strmap_put(wanted_refs, refname_nons, oiddup(&oid))) {
+ packet_writer_error(writer, "duplicate want-ref %s",
+ refname_nons);
+ die("duplicate want-ref %s", refname_nons);
+ }
if (!starts_with(refname_nons, "refs/tags/")) {
struct commit *commit = lookup_commit_in_graph(the_repository, &oid);
@@ -1474,21 +1543,44 @@ static int parse_want_ref(struct packet_writer *writer, const char *line,
return 0;
}
-static int parse_have(const char *line, struct oid_array *haves)
+static int parse_have(const char *line, struct upload_pack_data *data)
{
const char *arg;
if (skip_prefix(line, "have ", &arg)) {
struct object_id oid;
- if (get_oid_hex(arg, &oid))
- die("git upload-pack: expected SHA1 object, got '%s'", arg);
- oid_array_append(haves, &oid);
+ got_oid(data, arg, &oid);
+ data->seen_haves = 1;
return 1;
}
return 0;
}
+static void trace2_fetch_info(struct upload_pack_data *data)
+{
+ struct json_writer jw = JSON_WRITER_INIT;
+
+ jw_object_begin(&jw, 0);
+ jw_object_intmax(&jw, "haves", data->have_obj.nr);
+ jw_object_intmax(&jw, "wants", data->want_obj.nr);
+ jw_object_intmax(&jw, "want-refs", strmap_get_size(&data->wanted_refs));
+ jw_object_intmax(&jw, "depth", data->depth);
+ jw_object_intmax(&jw, "shallows", data->shallows.nr);
+ jw_object_bool(&jw, "deepen-since", data->deepen_since);
+ jw_object_intmax(&jw, "deepen-not", oidset_size(&data->deepen_not));
+ jw_object_bool(&jw, "deepen-relative", data->deepen_relative);
+ if (data->filter_options.choice)
+ jw_object_string(&jw, "filter", list_object_filter_config_name(data->filter_options.choice));
+ else
+ jw_object_null(&jw, "filter");
+ jw_end(&jw);
+
+ trace2_data_json("upload-pack", the_repository, "fetch-info", &jw);
+
+ jw_release(&jw);
+}
+
static void process_args(struct packet_reader *request,
struct upload_pack_data *data)
{
@@ -1501,10 +1593,10 @@ static void process_args(struct packet_reader *request,
continue;
if (data->allow_ref_in_want &&
parse_want_ref(&data->writer, arg, &data->wanted_refs,
- &data->want_obj))
+ &data->hidden_refs, &data->want_obj))
continue;
/* process have line */
- if (parse_have(arg, &data->haves))
+ if (parse_have(arg, data))
continue;
/* process args like thin-pack */
@@ -1556,14 +1648,17 @@ static void process_args(struct packet_reader *request,
continue;
}
- if ((git_env_bool("GIT_TEST_SIDEBAND_ALL", 0) ||
- data->allow_sideband_all) &&
+ if (data->allow_sideband_all &&
!strcmp(arg, "sideband-all")) {
data->writer.use_sideband = 1;
continue;
}
- if (skip_prefix(arg, "packfile-uris ", &p)) {
+ if (data->allow_packfile_uris &&
+ skip_prefix(arg, "packfile-uris ", &p)) {
+ if (data->uri_protocols.nr)
+ send_err_and_die(data,
+ "multiple packfile-uris lines forbidden");
string_list_split(&data->uri_protocols, p, ',', -1);
continue;
}
@@ -1577,29 +1672,12 @@ static void process_args(struct packet_reader *request,
if (request->status != PACKET_READ_FLUSH)
die(_("expected flush after fetch arguments"));
-}
-static int process_haves(struct upload_pack_data *data, struct oid_array *common)
-{
- int i;
-
- /* Process haves */
- for (i = 0; i < data->haves.nr; i++) {
- const struct object_id *oid = &data->haves.oid[i];
-
- if (!has_object_file_with_flags(oid,
- OBJECT_INFO_QUICK | OBJECT_INFO_SKIP_FETCH_OBJECT))
- continue;
-
- oid_array_append(common, oid);
-
- do_got_oid(data, oid);
- }
-
- return 0;
+ if (trace2_is_enabled())
+ trace2_fetch_info(data);
}
-static int send_acks(struct upload_pack_data *data, struct oid_array *acks)
+static int send_acks(struct upload_pack_data *data, struct object_array *acks)
{
int i;
@@ -1611,7 +1689,7 @@ static int send_acks(struct upload_pack_data *data, struct oid_array *acks)
for (i = 0; i < acks->nr; i++) {
packet_writer_write(&data->writer, "ACK %s\n",
- oid_to_hex(&acks->oid[i]));
+ oid_to_hex(&acks->objects[i].item->oid));
}
if (!data->wait_for_done && ok_to_give_up(data)) {
@@ -1625,13 +1703,11 @@ static int send_acks(struct upload_pack_data *data, struct oid_array *acks)
static int process_haves_and_send_acks(struct upload_pack_data *data)
{
- struct oid_array common = OID_ARRAY_INIT;
int ret = 0;
- process_haves(data, &common);
if (data->done) {
ret = 1;
- } else if (send_acks(data, &common)) {
+ } else if (send_acks(data, &data->have_obj)) {
packet_writer_delim(&data->writer);
ret = 1;
} else {
@@ -1640,24 +1716,23 @@ static int process_haves_and_send_acks(struct upload_pack_data *data)
ret = 0;
}
- oid_array_clear(&data->haves);
- oid_array_clear(&common);
return ret;
}
static void send_wanted_ref_info(struct upload_pack_data *data)
{
- const struct string_list_item *item;
+ struct hashmap_iter iter;
+ const struct strmap_entry *e;
- if (!data->wanted_refs.nr)
+ if (strmap_empty(&data->wanted_refs))
return;
packet_writer_write(&data->writer, "wanted-refs\n");
- for_each_string_list_item(item, &data->wanted_refs) {
+ strmap_for_each_entry(&data->wanted_refs, &iter, e) {
packet_writer_write(&data->writer, "%s %s\n",
- oid_to_hex(item->util),
- item->string);
+ oid_to_hex(e->value),
+ e->key);
}
packet_writer_delim(&data->writer);
@@ -1695,8 +1770,7 @@ int upload_pack_v2(struct repository *r, struct packet_reader *request)
upload_pack_data_init(&data);
data.use_sideband = LARGE_PACKET_MAX;
-
- git_config(upload_pack_config, &data);
+ get_upload_pack_config(r, &data);
while (state != FETCH_DONE) {
switch (state) {
@@ -1712,7 +1786,7 @@ int upload_pack_v2(struct repository *r, struct packet_reader *request)
* they didn't want anything.
*/
state = FETCH_DONE;
- } else if (data.haves.nr) {
+ } else if (data.seen_haves) {
/*
* Request had 'have' lines, so lets ACK them.
*/
@@ -1755,41 +1829,28 @@ int upload_pack_v2(struct repository *r, struct packet_reader *request)
int upload_pack_advertise(struct repository *r,
struct strbuf *value)
{
- if (value) {
- int allow_filter_value;
- int allow_ref_in_want;
- int allow_sideband_all_value;
- char *str = NULL;
+ struct upload_pack_data data;
+
+ upload_pack_data_init(&data);
+ get_upload_pack_config(r, &data);
+ if (value) {
strbuf_addstr(value, "shallow wait-for-done");
- if (!repo_config_get_bool(the_repository,
- "uploadpack.allowfilter",
- &allow_filter_value) &&
- allow_filter_value)
+ if (data.allow_filter)
strbuf_addstr(value, " filter");
- if (!repo_config_get_bool(the_repository,
- "uploadpack.allowrefinwant",
- &allow_ref_in_want) &&
- allow_ref_in_want)
+ if (data.allow_ref_in_want)
strbuf_addstr(value, " ref-in-want");
- if (git_env_bool("GIT_TEST_SIDEBAND_ALL", 0) ||
- (!repo_config_get_bool(the_repository,
- "uploadpack.allowsidebandall",
- &allow_sideband_all_value) &&
- allow_sideband_all_value))
+ if (data.allow_sideband_all)
strbuf_addstr(value, " sideband-all");
- if (!repo_config_get_string(the_repository,
- "uploadpack.blobpackfileuri",
- &str) &&
- str) {
+ if (data.allow_packfile_uris)
strbuf_addstr(value, " packfile-uris");
- free(str);
- }
}
+ upload_pack_data_clear(&data);
+
return 1;
}
diff --git a/url.c b/url.c
index e04bd60..282b124 100644
--- a/url.c
+++ b/url.c
@@ -1,4 +1,6 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "hex-ll.h"
+#include "strbuf.h"
#include "url.h"
int is_urlschemechar(int first_flag, int ch)
diff --git a/urlmatch.c b/urlmatch.c
index b615adc..1d0254a 100644
--- a/urlmatch.c
+++ b/urlmatch.c
@@ -1,4 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "gettext.h"
+#include "hex-ll.h"
+#include "strbuf.h"
#include "urlmatch.h"
#define URL_ALPHA "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
@@ -209,7 +212,7 @@ static char *url_normalize_1(const char *url, struct url_info *out_info, char al
*/
if (!url_len || strchr(":/?#", *url)) {
/* Missing host invalid for all URL schemes except file */
- if (strncmp(norm.buf, "file:", 5)) {
+ if (!starts_with(norm.buf, "file:")) {
if (out_info) {
out_info->url = NULL;
out_info->err = _("missing host and scheme is not 'file:'");
@@ -268,11 +271,11 @@ static char *url_normalize_1(const char *url, struct url_info *out_info, char al
if (url == slash_ptr) {
/* Skip ":" port with no number, it's same as default */
} else if (slash_ptr - url == 2 &&
- !strncmp(norm.buf, "http:", 5) &&
+ starts_with(norm.buf, "http:") &&
!strncmp(url, "80", 2)) {
/* Skip http :80 as it's the default */
} else if (slash_ptr - url == 3 &&
- !strncmp(norm.buf, "https:", 6) &&
+ starts_with(norm.buf, "https:") &&
!strncmp(url, "443", 3)) {
/* Skip https :443 as it's the default */
} else {
@@ -548,7 +551,8 @@ static int cmp_matches(const struct urlmatch_item *a,
return 0;
}
-int urlmatch_config_entry(const char *var, const char *value, void *cb)
+int urlmatch_config_entry(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
struct string_list_item *item;
struct urlmatch_config *collect = cb;
@@ -562,7 +566,7 @@ int urlmatch_config_entry(const char *var, const char *value, void *cb)
if (!skip_prefix(var, collect->section, &key) || *(key++) != '.') {
if (collect->cascade_fn)
- return collect->cascade_fn(var, value, cb);
+ return collect->cascade_fn(var, value, ctx, cb);
return 0; /* not interested */
}
dot = strrchr(key, '.');
@@ -606,7 +610,7 @@ int urlmatch_config_entry(const char *var, const char *value, void *cb)
strbuf_addstr(&synthkey, collect->section);
strbuf_addch(&synthkey, '.');
strbuf_addstr(&synthkey, key);
- retval = collect->collect_fn(synthkey.buf, value, collect->cb);
+ retval = collect->collect_fn(synthkey.buf, value, ctx, collect->cb);
strbuf_release(&synthkey);
return retval;
diff --git a/urlmatch.h b/urlmatch.h
index 9f40b00..5ba85ce 100644
--- a/urlmatch.h
+++ b/urlmatch.h
@@ -2,6 +2,7 @@
#define URL_MATCH_H
#include "string-list.h"
+#include "config.h"
struct url_info {
/* normalized url on success, must be freed, otherwise NULL */
@@ -48,8 +49,8 @@ struct urlmatch_config {
const char *key;
void *cb;
- int (*collect_fn)(const char *var, const char *value, void *cb);
- int (*cascade_fn)(const char *var, const char *value, void *cb);
+ config_fn_t collect_fn;
+ config_fn_t cascade_fn;
/*
* Compare the two matches, the one just discovered and the existing
* best match and return a negative value if the found item is to be
@@ -70,7 +71,8 @@ struct urlmatch_config {
.vars = STRING_LIST_INIT_DUP, \
}
-int urlmatch_config_entry(const char *var, const char *value, void *cb);
+int urlmatch_config_entry(const char *var, const char *value,
+ const struct config_context *ctx, void *cb);
void urlmatch_config_release(struct urlmatch_config *config);
#endif /* URL_MATCH_H */
diff --git a/usage.c b/usage.c
index 5a7c6c3..7a2f780 100644
--- a/usage.c
+++ b/usage.c
@@ -4,7 +4,8 @@
* Copyright (C) Linus Torvalds, 2005
*/
#include "git-compat-util.h"
-#include "cache.h"
+#include "gettext.h"
+#include "trace2.h"
static void vreportf(const char *prefix, const char *err, va_list params)
{
@@ -18,8 +19,11 @@ static void vreportf(const char *prefix, const char *err, va_list params)
}
memcpy(msg, prefix, prefix_len);
p = msg + prefix_len;
- if (vsnprintf(p, pend - p, err, params) < 0)
+ if (vsnprintf(p, pend - p, err, params) < 0) {
+ fprintf(stderr, _("error: unable to format message: %s\n"),
+ err);
*p = '\0'; /* vsnprintf() failed, clip at prefix */
+ }
for (; p != pend - 1 && *p; p++) {
if (iscntrl(*p) && *p != '\t' && *p != '\n')
diff --git a/userdiff.c b/userdiff.c
index 151d9a5..82bc76b 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -1,7 +1,9 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "userdiff.h"
#include "attr.h"
+#include "strbuf.h"
+#include "environment.h"
static struct userdiff_driver *drivers;
static int ndrivers;
@@ -15,6 +17,7 @@ static int drivers_alloc;
.cflags = REG_EXTENDED, \
}, \
.word_regex = wrx "|[^[:space:]]|[\xc0-\xff][\x80-\xbf]+", \
+ .word_regex_multi_byte = wrx "|[^[:space:]]", \
}
#define IPATTERN(lang, rx, wrx) { \
.name = lang, \
@@ -24,6 +27,7 @@ static int drivers_alloc;
.cflags = REG_EXTENDED | REG_ICASE, \
}, \
.word_regex = wrx "|[^[:space:]]|[\xc0-\xff][\x80-\xbf]+", \
+ .word_regex_multi_byte = wrx "|[^[:space:]]", \
}
/*
@@ -86,12 +90,48 @@ PATTERNS("cpp",
"|\\.[0-9][0-9]*([Ee][-+]?[0-9]+)?[fFlL]?"
"|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->\\*?|\\.\\*|<=>"),
PATTERNS("csharp",
- /* Keywords */
- "!^[ \t]*(do|while|for|if|else|instanceof|new|return|switch|case|throw|catch|using)\n"
- /* Methods and constructors */
- "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe|async)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[<>@._[:alnum:]]+[ \t]*\\(.*\\))[ \t]*$\n"
- /* Properties */
- "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[@._[:alnum:]]+)[ \t]*$\n"
+ /*
+ * Jump over reserved keywords which are illegal method names, but which
+ * can be followed by parentheses without special characters in between,
+ * making them look like methods.
+ */
+ "!(^|[ \t]+)" /* Start of line or whitespace. */
+ "(do|while|for|foreach|if|else|new|default|return|switch|case|throw"
+ "|catch|using|lock|fixed)"
+ "([ \t(]+|$)\n" /* Whitespace, "(", or end of line. */
+ /*
+ * Methods/constructors:
+ * The strategy is to identify a minimum of two groups (any combination
+ * of keywords/type/name) before the opening parenthesis, and without
+ * final unexpected characters, normally only used in ordinary statements.
+ */
+ "^[ \t]*" /* Remove leading whitespace. */
+ "(" /* Start chunk header capture. */
+ "(" /* First group. */
+ "[][[:alnum:]@_.]" /* Name. */
+ "(<[][[:alnum:]@_, \t<>]+>)?" /* Optional generic parameters. */
+ ")+"
+ "([ \t]+" /* Subsequent groups, prepended with space. */
+ "([][[:alnum:]@_.](<[][[:alnum:]@_, \t<>]+>)?)+"
+ ")+"
+ "[ \t]*" /* Optional space before parameters start. */
+ "\\(" /* Start of method parameters. */
+ "[^;]*" /* Allow complex parameters, but exclude statements (;). */
+ ")$\n" /* Close chunk header capture. */
+ /*
+ * Properties:
+ * As with methods, expect a minimum of two groups. But, more trivial than
+ * methods, the vast majority of properties long enough to be worth
+ * showing a chunk header for don't include "=:;,()" on the line they are
+ * defined, since they don't have a parameter list.
+ */
+ "^[ \t]*("
+ "([][[:alnum:]@_.](<[][[:alnum:]@_, \t<>]+>)?)+"
+ "([ \t]+"
+ "([][[:alnum:]@_.](<[][[:alnum:]@_, \t<>]+>)?)+"
+ ")+" /* Up to here, same as methods regex. */
+ "[^;=:,()]*" /* Compared to methods, no parameter list allowed. */
+ ")$\n"
/* Type definitions */
"^[ \t]*(((static|public|internal|private|protected|new|unsafe|sealed|abstract|partial)[ \t]+)*(class|enum|interface|struct|record)[ \t]+.*)$\n"
/* Namespace */
@@ -170,8 +210,8 @@ PATTERNS("html",
"[^<>= \t]+"),
PATTERNS("java",
"!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n"
- /* Class, enum, and interface declarations */
- "^[ \t]*(([a-z]+[ \t]+)*(class|enum|interface)[ \t]+[A-Za-z][A-Za-z0-9_$]*[ \t]+.*)$\n"
+ /* Class, enum, interface, and record declarations */
+ "^[ \t]*(([a-z-]+[ \t]+)*(class|enum|interface|record)[ \t]+.*)$\n"
/* Method definitions; note that constructor signatures are not */
/* matched because they are indistinguishable from method calls. */
"^[ \t]*(([A-Za-z_<>&][][?&<>.,A-Za-z_0-9]*[ \t]+)+[A-Za-z_][A-Za-z_0-9]*[ \t]*\\([^;]*)$",
@@ -292,8 +332,8 @@ PATTERNS("scheme",
/* All other words should be delimited by spaces or parentheses */
"|([^][)(}{[ \t])+"),
PATTERNS("tex", "^(\\\\((sub)*section|chapter|part)\\*{0,1}\\{.*)$",
- "\\\\[a-zA-Z@]+|\\\\.|[a-zA-Z0-9\x80-\xff]+"),
-{ "default", NULL, -1, { NULL, 0 } },
+ "\\\\[a-zA-Z@]+|\\\\.|([a-zA-Z0-9]|[^\x01-\x7f])+"),
+{ "default", NULL, NULL, -1, { NULL, 0 } },
};
#undef PATTERNS
#undef IPATTERN
@@ -315,18 +355,37 @@ struct find_by_namelen_data {
};
static int userdiff_find_by_namelen_cb(struct userdiff_driver *driver,
- enum userdiff_driver_type type, void *priv)
+ enum userdiff_driver_type type UNUSED,
+ void *priv)
{
struct find_by_namelen_data *cb_data = priv;
- if (!strncmp(driver->name, cb_data->name, cb_data->len) &&
- !driver->name[cb_data->len]) {
+ if (!xstrncmpz(driver->name, cb_data->name, cb_data->len)) {
cb_data->driver = driver;
return 1; /* tell the caller to stop iterating */
}
return 0;
}
+static int regexec_supports_multi_byte_chars(void)
+{
+ static const char not_space[] = "[^[:space:]]";
+ static const char utf8_multi_byte_char[] = "\xc2\xa3";
+ regex_t re;
+ regmatch_t match;
+ static int result = -1;
+
+ if (result != -1)
+ return result;
+ if (regcomp(&re, not_space, REG_EXTENDED))
+ BUG("invalid regular expression: %s", not_space);
+ result = !regexec(&re, utf8_multi_byte_char, 1, &match, 0) &&
+ match.rm_so == 0 &&
+ match.rm_eo == strlen(utf8_multi_byte_char);
+ regfree(&re);
+ return result;
+}
+
static struct userdiff_driver *userdiff_find_by_namelen(const char *name, size_t len)
{
struct find_by_namelen_data udcbdata = {
@@ -393,6 +452,8 @@ int userdiff_config(const char *k, const char *v)
return parse_bool(&drv->textconv_want_cache, k, v);
if (!strcmp(type, "wordregex"))
return git_config_string(&drv->word_regex, k, v);
+ if (!strcmp(type, "algorithm"))
+ return git_config_string(&drv->algorithm, k, v);
return 0;
}
@@ -400,7 +461,13 @@ int userdiff_config(const char *k, const char *v)
struct userdiff_driver *userdiff_find_by_name(const char *name)
{
int len = strlen(name);
- return userdiff_find_by_namelen(name, len);
+ struct userdiff_driver *driver = userdiff_find_by_namelen(name, len);
+ if (driver && driver->word_regex_multi_byte) {
+ if (regexec_supports_multi_byte_chars())
+ driver->word_regex = driver->word_regex_multi_byte;
+ driver->word_regex_multi_byte = NULL;
+ }
+ return driver;
}
struct userdiff_driver *userdiff_find_by_path(struct index_state *istate,
@@ -429,7 +496,8 @@ struct userdiff_driver *userdiff_get_textconv(struct repository *r,
if (!driver->textconv)
return NULL;
- if (driver->textconv_want_cache && !driver->textconv_cache) {
+ if (driver->textconv_want_cache && !driver->textconv_cache &&
+ have_git_dir()) {
struct notes_cache *c = xmalloc(sizeof(*c));
struct strbuf name = STRBUF_INIT;
diff --git a/userdiff.h b/userdiff.h
index aee91bc..d726804 100644
--- a/userdiff.h
+++ b/userdiff.h
@@ -14,9 +14,11 @@ struct userdiff_funcname {
struct userdiff_driver {
const char *name;
const char *external;
+ const char *algorithm;
int binary;
struct userdiff_funcname funcname;
const char *word_regex;
+ const char *word_regex_multi_byte;
const char *textconv;
struct notes_cache *textconv_cache;
int textconv_want_cache;
diff --git a/utf8.c b/utf8.c
index de4ce5c..6bfaefa 100644
--- a/utf8.c
+++ b/utf8.c
@@ -2,7 +2,7 @@
#include "strbuf.h"
#include "utf8.h"
-/* This code is originally from http://www.cl.cam.ac.uk/~mgk25/ucs/ */
+/* This code is originally from https://www.cl.cam.ac.uk/~mgk25/ucs/ */
static const char utf16_be_bom[] = {'\xFE', '\xFF'};
static const char utf16_le_bom[] = {'\xFF', '\xFE'};
@@ -206,26 +206,34 @@ int utf8_width(const char **start, size_t *remainder_p)
* string, assuming that the string is utf8. Returns strlen() instead
* if the string does not look like a valid utf8 string.
*/
-int utf8_strnwidth(const char *string, int len, int skip_ansi)
+int utf8_strnwidth(const char *string, size_t len, int skip_ansi)
{
- int width = 0;
const char *orig = string;
+ size_t width = 0;
- if (len == -1)
- len = strlen(string);
while (string && string < orig + len) {
- int skip;
+ int glyph_width;
+ size_t skip;
+
while (skip_ansi &&
(skip = display_mode_esc_sequence_len(string)) != 0)
string += skip;
- width += utf8_width(&string, NULL);
+
+ glyph_width = utf8_width(&string, NULL);
+ if (glyph_width > 0)
+ width += glyph_width;
}
- return string ? width : len;
+
+ /*
+ * TODO: fix the interface of this function and `utf8_strwidth()` to
+ * return `size_t` instead of `int`.
+ */
+ return cast_size_t_to_int(string ? width : len);
}
int utf8_strwidth(const char *string)
{
- return utf8_strnwidth(string, -1, 0);
+ return utf8_strnwidth(string, strlen(string), 0);
}
int is_utf8(const char *text)
@@ -357,51 +365,52 @@ void strbuf_add_wrapped_bytes(struct strbuf *buf, const char *data, int len,
void strbuf_utf8_replace(struct strbuf *sb_src, int pos, int width,
const char *subst)
{
- struct strbuf sb_dst = STRBUF_INIT;
- char *src = sb_src->buf;
- char *end = src + sb_src->len;
- char *dst;
- int w = 0, subst_len = 0;
+ const char *src = sb_src->buf, *end = sb_src->buf + sb_src->len;
+ struct strbuf dst;
+ int w = 0;
- if (subst)
- subst_len = strlen(subst);
- strbuf_grow(&sb_dst, sb_src->len + subst_len);
- dst = sb_dst.buf;
+ strbuf_init(&dst, sb_src->len);
while (src < end) {
- char *old;
+ const char *old;
+ int glyph_width;
size_t n;
while ((n = display_mode_esc_sequence_len(src))) {
- memcpy(dst, src, n);
+ strbuf_add(&dst, src, n);
src += n;
- dst += n;
}
if (src >= end)
break;
old = src;
- n = utf8_width((const char**)&src, NULL);
- if (!src) /* broken utf-8, do nothing */
+ glyph_width = utf8_width((const char**)&src, NULL);
+ if (!src) /* broken utf-8, do nothing */
goto out;
- if (n && w >= pos && w < pos + width) {
+
+ /*
+ * In case we see a control character we copy it into the
+ * buffer, but don't add it to the width.
+ */
+ if (glyph_width < 0)
+ glyph_width = 0;
+
+ if (glyph_width && w >= pos && w < pos + width) {
if (subst) {
- memcpy(dst, subst, subst_len);
- dst += subst_len;
+ strbuf_addstr(&dst, subst);
subst = NULL;
}
- w += n;
- continue;
+ } else {
+ strbuf_add(&dst, old, src - old);
}
- memcpy(dst, old, src - old);
- dst += src - old;
- w += n;
+
+ w += glyph_width;
}
- strbuf_setlen(&sb_dst, dst - sb_dst.buf);
- strbuf_swap(sb_src, &sb_dst);
+
+ strbuf_swap(sb_src, &dst);
out:
- strbuf_release(&sb_dst);
+ strbuf_release(&dst);
}
/*
@@ -796,7 +805,7 @@ int skip_utf8_bom(char **text, size_t len)
void strbuf_utf8_align(struct strbuf *buf, align_type position, unsigned int width,
const char *s)
{
- int slen = strlen(s);
+ size_t slen = strlen(s);
int display_len = utf8_strnwidth(s, slen, 0);
int utf8_compensation = slen - display_len;
diff --git a/utf8.h b/utf8.h
index 9a16c86..35df760 100644
--- a/utf8.h
+++ b/utf8.h
@@ -7,7 +7,7 @@ typedef unsigned int ucs_char_t; /* assuming 32bit int */
size_t display_mode_esc_sequence_len(const char *s);
int utf8_width(const char **start, size_t *remainder_p);
-int utf8_strnwidth(const char *string, int len, int skip_ansi);
+int utf8_strnwidth(const char *string, size_t len, int skip_ansi);
int utf8_strwidth(const char *string);
int is_utf8(const char *text);
int is_encoding_utf8(const char *name);
@@ -83,7 +83,7 @@ void strbuf_utf8_align(struct strbuf *buf, align_type position, unsigned int wid
* BOM must not be used [1]. The same applies for the UTF-32 equivalents.
* The function returns true if this rule is violated.
*
- * [1] http://unicode.org/faq/utf_bom.html#bom10
+ * [1] https://unicode.org/faq/utf_bom.html#bom10
*/
int has_prohibited_utf_bom(const char *enc, const char *data, size_t len);
@@ -99,8 +99,8 @@ int has_prohibited_utf_bom(const char *enc, const char *data, size_t len);
* Therefore, strictly requiring a BOM seems to be the safest option for
* content in Git.
*
- * [1] http://unicode.org/faq/utf_bom.html#gen6
- * [2] http://www.unicode.org/versions/Unicode10.0.0/ch03.pdf
+ * [1] https://unicode.org/faq/utf_bom.html#gen6
+ * [2] https://www.unicode.org/versions/Unicode10.0.0/ch03.pdf
* Section 3.10, D98, page 132
* [3] https://encoding.spec.whatwg.org/#utf-16le
*/
diff --git a/versioncmp.c b/versioncmp.c
index 069ee94..45e676c 100644
--- a/versioncmp.c
+++ b/versioncmp.c
@@ -1,6 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
+#include "strbuf.h"
#include "string-list.h"
+#include "versioncmp.h"
/*
* versioncmp(): copied from string/strverscmp.c in glibc commit
@@ -160,15 +162,21 @@ int versioncmp(const char *s1, const char *s2)
}
if (!initialized) {
- const struct string_list *deprecated_prereleases;
+ const char *const newk = "versionsort.suffix";
+ const char *const oldk = "versionsort.prereleasesuffix";
+ const struct string_list *newl;
+ const struct string_list *oldl;
+ int new = git_config_get_string_multi(newk, &newl);
+ int old = git_config_get_string_multi(oldk, &oldl);
+
+ if (!new && !old)
+ warning("ignoring %s because %s is set", oldk, newk);
+ if (!new)
+ prereleases = newl;
+ else if (!old)
+ prereleases = oldl;
+
initialized = 1;
- prereleases = git_config_get_value_multi("versionsort.suffix");
- deprecated_prereleases = git_config_get_value_multi("versionsort.prereleasesuffix");
- if (prereleases) {
- if (deprecated_prereleases)
- warning("ignoring versionsort.prereleasesuffix because versionsort.suffix is set");
- } else
- prereleases = deprecated_prereleases;
}
if (prereleases && swap_prereleases(s1, s2, (const char *) p1 - s1 - 1,
&diff))
diff --git a/versioncmp.h b/versioncmp.h
new file mode 100644
index 0000000..879b510
--- /dev/null
+++ b/versioncmp.h
@@ -0,0 +1,6 @@
+#ifndef VERSIONCMP_H
+#define VERSIONCMP_H
+
+int versioncmp(const char *s1, const char *s2);
+
+#endif /* VERSIONCMP_H */
diff --git a/walker.c b/walker.c
index c5e2921..c0fd632 100644
--- a/walker.c
+++ b/walker.c
@@ -1,8 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "gettext.h"
+#include "hex.h"
#include "walker.h"
#include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
#include "commit.h"
+#include "strbuf.h"
#include "tree.h"
#include "tree-walk.h"
#include "tag.h"
@@ -42,7 +45,7 @@ static int process_tree(struct walker *walker, struct tree *tree)
if (parse_tree(tree))
return -1;
- init_tree_desc(&desc, tree->buffer, tree->size);
+ init_tree_desc(&desc, &tree->object.oid, tree->buffer, tree->size);
while (tree_entry(&desc, &entry)) {
struct object *obj = NULL;
@@ -79,7 +82,7 @@ static int process_commit(struct walker *walker, struct commit *commit)
{
struct commit_list *parents;
- if (parse_commit(commit))
+ if (repo_parse_commit(the_repository, commit))
return -1;
while (complete && complete->item->date >= commit->date) {
@@ -93,7 +96,7 @@ static int process_commit(struct walker *walker, struct commit *commit)
walker_say(walker, "walk %s\n", oid_to_hex(&commit->object.oid));
- if (process(walker, &get_commit_tree(commit)->object))
+ if (process(walker, &repo_get_commit_tree(the_repository, commit)->object))
return -1;
for (parents = commit->parents; parents; parents = parents->next) {
@@ -145,7 +148,7 @@ static int process(struct walker *walker, struct object *obj)
return 0;
obj->flags |= SEEN;
- if (has_object_file(&obj->oid)) {
+ if (repo_has_object_file(the_repository, &obj->oid)) {
/* We already have it, so we should scan it now. */
obj->flags |= TO_SCAN;
}
@@ -215,8 +218,10 @@ static int interpret_target(struct walker *walker, char *target, struct object_i
return -1;
}
-static int mark_complete(const char *path, const struct object_id *oid,
- int flag, void *cb_data)
+static int mark_complete(const char *path UNUSED,
+ const struct object_id *oid,
+ int flag UNUSED,
+ void *cb_data UNUSED)
{
struct commit *commit = lookup_commit_reference_gently(the_repository,
oid, 1);
diff --git a/wildmatch.c b/wildmatch.c
index 7e5a7ea..8ea2914 100644
--- a/wildmatch.c
+++ b/wildmatch.c
@@ -9,11 +9,15 @@
** work differently than '*', and to fix the character-class code.
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "wildmatch.h"
typedef unsigned char uchar;
+/* Internal return values */
+#define WM_ABORT_ALL -1
+#define WM_ABORT_TO_STARSTAR -2
+
/* What character marks an inverted character class? */
#define NEGATE_CLASS '!'
#define NEGATE_CLASS2 '^'
@@ -83,12 +87,12 @@ static int dowild(const uchar *p, const uchar *text, unsigned int flags)
continue;
case '*':
if (*++p == '*') {
- const uchar *prev_p = p - 2;
+ const uchar *prev_p = p;
while (*++p == '*') {}
if (!(flags & WM_PATHNAME))
/* without WM_PATHNAME, '*' == '**' */
match_slash = 1;
- else if ((prev_p < pattern || *prev_p == '/') &&
+ else if ((prev_p - pattern < 2 || *(prev_p - 2) == '/') &&
(*p == '\0' || *p == '/' ||
(p[0] == '\\' && p[1] == '/'))) {
/*
@@ -114,7 +118,7 @@ static int dowild(const uchar *p, const uchar *text, unsigned int flags)
* only if there are no more slash characters. */
if (!match_slash) {
if (strchr((char *)text, '/'))
- return WM_NOMATCH;
+ return WM_ABORT_TO_STARSTAR;
}
return WM_MATCH;
} else if (!match_slash && *p == '/') {
@@ -125,7 +129,7 @@ static int dowild(const uchar *p, const uchar *text, unsigned int flags)
*/
const char *slash = strchr((char*)text, '/');
if (!slash)
- return WM_NOMATCH;
+ return WM_ABORT_ALL;
text = (const uchar*)slash;
/* the slash is consumed by the top-level for loop */
break;
@@ -153,8 +157,12 @@ static int dowild(const uchar *p, const uchar *text, unsigned int flags)
break;
text++;
}
- if (t_ch != p_ch)
- return WM_NOMATCH;
+ if (t_ch != p_ch) {
+ if (match_slash)
+ return WM_ABORT_ALL;
+ else
+ return WM_ABORT_TO_STARSTAR;
+ }
}
if ((matched = dowild(p, text, flags)) != WM_NOMATCH) {
if (!match_slash || matched != WM_ABORT_TO_STARSTAR)
@@ -274,5 +282,6 @@ static int dowild(const uchar *p, const uchar *text, unsigned int flags)
/* Match the "pattern" against the "text" string. */
int wildmatch(const char *pattern, const char *text, unsigned int flags)
{
- return dowild((const uchar*)pattern, (const uchar*)text, flags);
+ int res = dowild((const uchar*)pattern, (const uchar*)text, flags);
+ return res == WM_MATCH ? WM_MATCH : WM_NOMATCH;
}
diff --git a/wildmatch.h b/wildmatch.h
index 5993696..0c890cb 100644
--- a/wildmatch.h
+++ b/wildmatch.h
@@ -6,8 +6,6 @@
#define WM_NOMATCH 1
#define WM_MATCH 0
-#define WM_ABORT_ALL -1
-#define WM_ABORT_TO_STARSTAR -2
int wildmatch(const char *pattern, const char *text, unsigned int flags);
#endif
diff --git a/worktree.c b/worktree.c
index 257ba4c..cf5eea8 100644
--- a/worktree.c
+++ b/worktree.c
@@ -1,24 +1,34 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "environment.h"
+#include "gettext.h"
+#include "path.h"
#include "repository.h"
#include "refs.h"
+#include "setup.h"
#include "strbuf.h"
#include "worktree.h"
#include "dir.h"
#include "wt-status.h"
#include "config.h"
+void free_worktree(struct worktree *worktree)
+{
+ if (!worktree)
+ return;
+ free(worktree->path);
+ free(worktree->id);
+ free(worktree->head_ref);
+ free(worktree->lock_reason);
+ free(worktree->prune_reason);
+ free(worktree);
+}
+
void free_worktrees(struct worktree **worktrees)
{
int i = 0;
-
- for (i = 0; worktrees[i]; i++) {
- free(worktrees[i]->path);
- free(worktrees[i]->id);
- free(worktrees[i]->head_ref);
- free(worktrees[i]->lock_reason);
- free(worktrees[i]->prune_reason);
- free(worktrees[i]);
- }
+ for (i = 0; worktrees[i]; i++)
+ free_worktree(worktrees[i]);
free (worktrees);
}
@@ -46,7 +56,7 @@ static void add_head_info(struct worktree *wt)
/**
* get the main worktree
*/
-static struct worktree *get_main_worktree(void)
+static struct worktree *get_main_worktree(int skip_reading_head)
{
struct worktree *worktree = NULL;
struct strbuf worktree_path = STRBUF_INIT;
@@ -65,11 +75,13 @@ static struct worktree *get_main_worktree(void)
*/
worktree->is_bare = (is_bare_repository_cfg == 1) ||
is_bare_repository();
- add_head_info(worktree);
+ if (!skip_reading_head)
+ add_head_info(worktree);
return worktree;
}
-static struct worktree *get_linked_worktree(const char *id)
+struct worktree *get_linked_worktree(const char *id,
+ int skip_reading_head)
{
struct worktree *worktree = NULL;
struct strbuf path = STRBUF_INIT;
@@ -88,7 +100,8 @@ static struct worktree *get_linked_worktree(const char *id)
CALLOC_ARRAY(worktree, 1);
worktree->path = strbuf_detach(&worktree_path, NULL);
worktree->id = xstrdup(id);
- add_head_info(worktree);
+ if (!skip_reading_head)
+ add_head_info(worktree);
done:
strbuf_release(&path);
@@ -113,7 +126,14 @@ static void mark_current_worktree(struct worktree **worktrees)
free(git_dir);
}
-struct worktree **get_worktrees(void)
+/*
+ * NEEDSWORK: This function exists so that we can look up metadata of a
+ * worktree without trying to access any of its internals like the refdb. It
+ * would be preferable to instead have a corruption-tolerant function for
+ * retrieving worktree metadata that could be used when the worktree is known
+ * to not be in a healthy state, e.g. when creating or repairing it.
+ */
+static struct worktree **get_worktrees_internal(int skip_reading_head)
{
struct worktree **list = NULL;
struct strbuf path = STRBUF_INIT;
@@ -123,7 +143,7 @@ struct worktree **get_worktrees(void)
ALLOC_ARRAY(list, alloc);
- list[counter++] = get_main_worktree();
+ list[counter++] = get_main_worktree(skip_reading_head);
strbuf_addf(&path, "%s/worktrees", get_git_common_dir());
dir = opendir(path.buf);
@@ -132,7 +152,7 @@ struct worktree **get_worktrees(void)
while ((d = readdir_skip_dot_and_dotdot(dir)) != NULL) {
struct worktree *linked = NULL;
- if ((linked = get_linked_worktree(d->d_name))) {
+ if ((linked = get_linked_worktree(d->d_name, skip_reading_head))) {
ALLOC_GROW(list, counter + 1, alloc);
list[counter++] = linked;
}
@@ -146,6 +166,11 @@ struct worktree **get_worktrees(void)
return list;
}
+struct worktree **get_worktrees(void)
+{
+ return get_worktrees_internal(0);
+}
+
const char *get_worktree_git_dir(const struct worktree *wt)
{
if (!wt)
@@ -390,9 +415,9 @@ int is_worktree_being_bisected(const struct worktree *wt,
memset(&state, 0, sizeof(state));
found_bisect = wt_status_check_bisect(wt, &state) &&
- state.branch &&
+ state.bisecting_from &&
skip_prefix(target, "refs/heads/", &target) &&
- !strcmp(state.branch, target);
+ !strcmp(state.bisecting_from, target);
wt_status_state_free_buffers(&state);
return found_bisect;
}
@@ -403,44 +428,43 @@ int is_worktree_being_bisected(const struct worktree *wt,
* bisect). New commands that do similar things should update this
* function as well.
*/
-const struct worktree *find_shared_symref(struct worktree **worktrees,
- const char *symref,
- const char *target)
+int is_shared_symref(const struct worktree *wt, const char *symref,
+ const char *target)
{
- const struct worktree *existing = NULL;
- int i = 0;
+ const char *symref_target;
+ struct ref_store *refs;
+ int flags;
- for (i = 0; worktrees[i]; i++) {
- struct worktree *wt = worktrees[i];
- const char *symref_target;
- struct ref_store *refs;
- int flags;
+ if (wt->is_bare)
+ return 0;
- if (wt->is_bare)
- continue;
+ if (wt->is_detached && !strcmp(symref, "HEAD")) {
+ if (is_worktree_being_rebased(wt, target))
+ return 1;
+ if (is_worktree_being_bisected(wt, target))
+ return 1;
+ }
- if (wt->is_detached && !strcmp(symref, "HEAD")) {
- if (is_worktree_being_rebased(wt, target)) {
- existing = wt;
- break;
- }
- if (is_worktree_being_bisected(wt, target)) {
- existing = wt;
- break;
- }
- }
+ refs = get_worktree_ref_store(wt);
+ symref_target = refs_resolve_ref_unsafe(refs, symref, 0,
+ NULL, &flags);
+ if ((flags & REF_ISSYMREF) &&
+ symref_target && !strcmp(symref_target, target))
+ return 1;
- refs = get_worktree_ref_store(wt);
- symref_target = refs_resolve_ref_unsafe(refs, symref, 0,
- NULL, &flags);
- if ((flags & REF_ISSYMREF) &&
- symref_target && !strcmp(symref_target, target)) {
- existing = wt;
- break;
- }
- }
+ return 0;
+}
+
+const struct worktree *find_shared_symref(struct worktree **worktrees,
+ const char *symref,
+ const char *target)
+{
- return existing;
+ for (int i = 0; worktrees[i]; i++)
+ if (is_shared_symref(worktrees[i], symref, target))
+ return worktrees[i];
+
+ return NULL;
}
int submodule_uses_worktrees(const char *path)
@@ -489,62 +513,17 @@ int submodule_uses_worktrees(const char *path)
return ret;
}
-int parse_worktree_ref(const char *worktree_ref, const char **name,
- int *name_length, const char **ref)
-{
- if (skip_prefix(worktree_ref, "main-worktree/", &worktree_ref)) {
- if (!*worktree_ref)
- return -1;
- if (name)
- *name = NULL;
- if (name_length)
- *name_length = 0;
- if (ref)
- *ref = worktree_ref;
- return 0;
- }
- if (skip_prefix(worktree_ref, "worktrees/", &worktree_ref)) {
- const char *slash = strchr(worktree_ref, '/');
-
- if (!slash || slash == worktree_ref || !slash[1])
- return -1;
- if (name)
- *name = worktree_ref;
- if (name_length)
- *name_length = slash - worktree_ref;
- if (ref)
- *ref = slash + 1;
- return 0;
- }
- return -1;
-}
-
void strbuf_worktree_ref(const struct worktree *wt,
struct strbuf *sb,
const char *refname)
{
- switch (ref_type(refname)) {
- case REF_TYPE_PSEUDOREF:
- case REF_TYPE_PER_WORKTREE:
- if (wt && !wt->is_current) {
- if (is_main_worktree(wt))
- strbuf_addstr(sb, "main-worktree/");
- else
- strbuf_addf(sb, "worktrees/%s/", wt->id);
- }
- break;
-
- case REF_TYPE_MAIN_PSEUDOREF:
- case REF_TYPE_OTHER_PSEUDOREF:
- break;
-
- case REF_TYPE_NORMAL:
- /*
- * For shared refs, don't prefix worktrees/ or
- * main-worktree/. It's not necessary and
- * files-backend.c can't handle it anyway.
- */
- break;
+ if (parse_worktree_ref(refname, NULL, NULL, NULL) ==
+ REF_WORKTREE_CURRENT &&
+ wt && !wt->is_current) {
+ if (is_main_worktree(wt))
+ strbuf_addstr(sb, "main-worktree/");
+ else
+ strbuf_addf(sb, "worktrees/%s/", wt->id);
}
strbuf_addstr(sb, refname);
}
@@ -622,15 +601,17 @@ static void repair_gitfile(struct worktree *wt,
strbuf_release(&dotgit);
}
-static void repair_noop(int iserr, const char *path, const char *msg,
- void *cb_data)
+static void repair_noop(int iserr UNUSED,
+ const char *path UNUSED,
+ const char *msg UNUSED,
+ void *cb_data UNUSED)
{
/* nothing */
}
void repair_worktrees(worktree_repair_fn fn, void *cb_data)
{
- struct worktree **worktrees = get_worktrees();
+ struct worktree **worktrees = get_worktrees_internal(1);
struct worktree **wt = worktrees + 1; /* +1 skips main worktree */
if (!fn)
@@ -826,9 +807,9 @@ int should_prune_worktree(const char *id, struct strbuf *reason, char **wtpath,
static int move_config_setting(const char *key, const char *value,
const char *from_file, const char *to_file)
{
- if (git_config_set_in_file_gently(to_file, key, value))
+ if (git_config_set_in_file_gently(to_file, key, NULL, value))
return error(_("unable to set %s in '%s'"), key, to_file);
- if (git_config_set_in_file_gently(from_file, key, NULL))
+ if (git_config_set_in_file_gently(from_file, key, NULL, NULL))
return error(_("unable to unset %s in '%s'"), key, from_file);
return 0;
}
@@ -846,7 +827,7 @@ int init_worktree_config(struct repository *r)
* If the extension is already enabled, then we can skip the
* upgrade process.
*/
- if (repository_format_worktree_config)
+ if (r->repository_format_worktree_config)
return 0;
if ((res = git_config_set_gently("extensions.worktreeConfig", "true")))
return error(_("failed to set extensions.worktreeConfig setting"));
@@ -875,7 +856,7 @@ int init_worktree_config(struct repository *r)
* Relocate that value to avoid breaking all worktrees with this
* upgrade to worktree config.
*/
- if (!git_configset_get_value(&cs, "core.worktree", &core_worktree)) {
+ if (!git_configset_get_value(&cs, "core.worktree", &core_worktree, NULL)) {
if ((res = move_config_setting("core.worktree", core_worktree,
common_config_file,
main_worktree_file)))
@@ -886,7 +867,7 @@ int init_worktree_config(struct repository *r)
* Ensure that we use worktree config for the remaining lifetime
* of the current process.
*/
- repository_format_worktree_config = 1;
+ r->repository_format_worktree_config = 1;
cleanup:
git_configset_clear(&cs);
diff --git a/worktree.h b/worktree.h
index e9e8399..f14784a 100644
--- a/worktree.h
+++ b/worktree.h
@@ -1,7 +1,6 @@
#ifndef WORKTREE_H
#define WORKTREE_H
-#include "cache.h"
#include "refs.h"
struct strbuf;
@@ -59,6 +58,13 @@ struct worktree *find_worktree(struct worktree **list,
const char *arg);
/*
+ * Look up the worktree corresponding to `id`, or NULL of no such worktree
+ * exists.
+ */
+struct worktree *get_linked_worktree(const char *id,
+ int skip_reading_head);
+
+/*
* Return the worktree corresponding to `path`, or NULL if no such worktree
* exists.
*/
@@ -136,6 +142,11 @@ void repair_worktrees(worktree_repair_fn, void *cb_data);
void repair_worktree_at_path(const char *, worktree_repair_fn, void *cb_data);
/*
+ * Free up the memory for a worktree.
+ */
+void free_worktree(struct worktree *);
+
+/*
* Free up the memory for worktree(s)
*/
void free_worktrees(struct worktree **);
@@ -150,6 +161,12 @@ const struct worktree *find_shared_symref(struct worktree **worktrees,
const char *target);
/*
+ * Returns true if a symref points to a ref in a worktree.
+ */
+int is_shared_symref(const struct worktree *wt,
+ const char *symref, const char *target);
+
+/*
* Similar to head_ref() for all HEADs _except_ one from the current
* worktree, which is covered by head_ref().
*/
@@ -167,16 +184,6 @@ const char *worktree_git_path(const struct worktree *wt,
__attribute__((format (printf, 2, 3)));
/*
- * Parse a worktree ref (i.e. with prefix main-worktree/ or
- * worktrees/) and return the position of the worktree's name and
- * length (or NULL and zero if it's main worktree), and ref.
- *
- * All name, name_length and ref arguments could be NULL.
- */
-int parse_worktree_ref(const char *worktree_ref, const char **name,
- int *name_length, const char **ref);
-
-/*
* Return a refname suitable for access from the current ref store.
*/
void strbuf_worktree_ref(const struct worktree *wt,
diff --git a/wrapper.c b/wrapper.c
index 1c3c970..eeac374 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -1,16 +1,17 @@
/*
* Various trivial helper wrappers around standard functions
*/
-#include "cache.h"
-#include "config.h"
-
-static intmax_t count_fsync_writeout_only;
-static intmax_t count_fsync_hardware_flush;
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "parse.h"
+#include "gettext.h"
+#include "strbuf.h"
+#include "trace2.h"
#ifdef HAVE_RTLGENRANDOM
/* This is required to get access to RtlGenRandom. */
#define SystemFunction036 NTAPI SystemFunction036
-#include <NTSecAPI.h>
+#include <ntsecapi.h>
#undef SystemFunction036
#endif
@@ -161,28 +162,6 @@ void xsetenv(const char *name, const char *value, int overwrite)
die_errno(_("could not setenv '%s'"), name ? name : "(null)");
}
-/*
- * Limit size of IO chunks, because huge chunks only cause pain. OS X
- * 64-bit is buggy, returning EINVAL if len >= INT_MAX; and even in
- * the absence of bugs, large chunks can result in bad latencies when
- * you decide to kill the process.
- *
- * We pick 8 MiB as our default, but if the platform defines SSIZE_MAX
- * that is smaller than that, clip it to SSIZE_MAX, as a call to
- * read(2) or write(2) larger than that is allowed to fail. As the last
- * resort, we allow a port to pass via CFLAGS e.g. "-DMAX_IO_SIZE=value"
- * to override this, if the definition of SSIZE_MAX given by the platform
- * is broken.
- */
-#ifndef MAX_IO_SIZE
-# define MAX_IO_SIZE_DEFAULT (8*1024*1024)
-# if defined(SSIZE_MAX) && (SSIZE_MAX < MAX_IO_SIZE_DEFAULT)
-# define MAX_IO_SIZE SSIZE_MAX
-# else
-# define MAX_IO_SIZE MAX_IO_SIZE_DEFAULT
-# endif
-#endif
-
/**
* xopen() is the same as open(), but it die()s if the open() fails.
*/
@@ -567,7 +546,7 @@ int git_fsync(int fd, enum fsync_action action)
{
switch (action) {
case FSYNC_WRITEOUT_ONLY:
- count_fsync_writeout_only += 1;
+ trace2_counter_add(TRACE2_COUNTER_ID_FSYNC_WRITEOUT_ONLY, 1);
#ifdef __APPLE__
/*
@@ -599,7 +578,7 @@ int git_fsync(int fd, enum fsync_action action)
return -1;
case FSYNC_HARDWARE_FLUSH:
- count_fsync_hardware_flush += 1;
+ trace2_counter_add(TRACE2_COUNTER_ID_FSYNC_HARDWARE_FLUSH, 1);
/*
* On macOS, a special fcntl is required to really flush the
@@ -616,12 +595,6 @@ int git_fsync(int fd, enum fsync_action action)
}
}
-void trace_git_fsync_stats(void)
-{
- trace2_data_intmax("fsync", the_repository, "fsync/writeout-only", count_fsync_writeout_only);
- trace2_data_intmax("fsync", the_repository, "fsync/hardware-flush", count_fsync_hardware_flush);
-}
-
static int warn_if_unremovable(const char *op, const char *file, int rc)
{
int err;
@@ -657,11 +630,6 @@ int rmdir_or_warn(const char *file)
return warn_if_unremovable("rmdir", file, rmdir(file));
}
-int remove_or_warn(unsigned int mode, const char *file)
-{
- return S_ISGITLINK(mode) ? rmdir_or_warn(file) : unlink_or_warn(file);
-}
-
static int access_error_is_ok(int err, unsigned flag)
{
return (is_missing_file_error(err) ||
@@ -844,3 +812,13 @@ int csprng_bytes(void *buf, size_t len)
return 0;
#endif
}
+
+uint32_t git_rand(void)
+{
+ uint32_t result;
+
+ if (csprng_bytes(&result, sizeof(result)) < 0)
+ die(_("unable to get random bytes"));
+
+ return result;
+}
diff --git a/wrapper.h b/wrapper.h
new file mode 100644
index 0000000..1b2b047
--- /dev/null
+++ b/wrapper.h
@@ -0,0 +1,143 @@
+#ifndef WRAPPER_H
+#define WRAPPER_H
+
+char *xstrdup(const char *str);
+void *xmalloc(size_t size);
+void *xmallocz(size_t size);
+void *xmallocz_gently(size_t size);
+void *xmemdupz(const void *data, size_t len);
+char *xstrndup(const char *str, size_t len);
+void *xrealloc(void *ptr, size_t size);
+void *xcalloc(size_t nmemb, size_t size);
+void xsetenv(const char *name, const char *value, int overwrite);
+void *xmmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);
+const char *mmap_os_err(void);
+void *xmmap_gently(void *start, size_t length, int prot, int flags, int fd, off_t offset);
+int xopen(const char *path, int flags, ...);
+ssize_t xread(int fd, void *buf, size_t len);
+ssize_t xwrite(int fd, const void *buf, size_t len);
+ssize_t xpread(int fd, void *buf, size_t len, off_t offset);
+int xdup(int fd);
+FILE *xfopen(const char *path, const char *mode);
+FILE *xfdopen(int fd, const char *mode);
+int xmkstemp(char *temp_filename);
+int xmkstemp_mode(char *temp_filename, int mode);
+char *xgetcwd(void);
+FILE *fopen_for_writing(const char *path);
+FILE *fopen_or_warn(const char *path, const char *mode);
+
+/*
+ * Like strncmp, but only return zero if s is NUL-terminated and exactly len
+ * characters long. If it is not, consider it greater than t.
+ */
+int xstrncmpz(const char *s, const char *t, size_t len);
+
+__attribute__((format (printf, 3, 4)))
+int xsnprintf(char *dst, size_t max, const char *fmt, ...);
+
+int xgethostname(char *buf, size_t len);
+
+/* set default permissions by passing mode arguments to open(2) */
+int git_mkstemps_mode(char *pattern, int suffix_len, int mode);
+int git_mkstemp_mode(char *pattern, int mode);
+
+ssize_t read_in_full(int fd, void *buf, size_t count);
+ssize_t write_in_full(int fd, const void *buf, size_t count);
+ssize_t pread_in_full(int fd, void *buf, size_t count, off_t offset);
+
+static inline ssize_t write_str_in_full(int fd, const char *str)
+{
+ return write_in_full(fd, str, strlen(str));
+}
+
+/**
+ * Open (and truncate) the file at path, write the contents of buf to it,
+ * and close it. Dies if any errors are encountered.
+ */
+void write_file_buf(const char *path, const char *buf, size_t len);
+
+/**
+ * Like write_file_buf(), but format the contents into a buffer first.
+ * Additionally, write_file() will append a newline if one is not already
+ * present, making it convenient to write text files:
+ *
+ * write_file(path, "counter: %d", ctr);
+ */
+__attribute__((format (printf, 2, 3)))
+void write_file(const char *path, const char *fmt, ...);
+
+/* Return 1 if the file is empty or does not exists, 0 otherwise. */
+int is_empty_or_missing_file(const char *filename);
+
+enum fsync_action {
+ FSYNC_WRITEOUT_ONLY,
+ FSYNC_HARDWARE_FLUSH
+};
+
+/*
+ * Issues an fsync against the specified file according to the specified mode.
+ *
+ * FSYNC_WRITEOUT_ONLY attempts to use interfaces available on some operating
+ * systems to flush the OS cache without issuing a flush command to the storage
+ * controller. If those interfaces are unavailable, the function fails with
+ * ENOSYS.
+ *
+ * FSYNC_HARDWARE_FLUSH does an OS writeout and hardware flush to ensure that
+ * changes are durable. It is not expected to fail.
+ */
+int git_fsync(int fd, enum fsync_action action);
+
+/*
+ * Preserves errno, prints a message, but gives no warning for ENOENT.
+ * Returns 0 on success, which includes trying to unlink an object that does
+ * not exist.
+ */
+int unlink_or_warn(const char *path);
+ /*
+ * Tries to unlink file. Returns 0 if unlink succeeded
+ * or the file already didn't exist. Returns -1 and
+ * appends a message to err suitable for
+ * 'error("%s", err->buf)' on error.
+ */
+int unlink_or_msg(const char *file, struct strbuf *err);
+/*
+ * Preserves errno, prints a message, but gives no warning for ENOENT.
+ * Returns 0 on success, which includes trying to remove a directory that does
+ * not exist.
+ */
+int rmdir_or_warn(const char *path);
+
+/*
+ * Call access(2), but warn for any error except "missing file"
+ * (ENOENT or ENOTDIR).
+ */
+#define ACCESS_EACCES_OK (1U << 0)
+int access_or_warn(const char *path, int mode, unsigned flag);
+int access_or_die(const char *path, int mode, unsigned flag);
+
+/* Warn on an inaccessible file if errno indicates this is an error */
+int warn_on_fopen_errors(const char *path);
+
+/*
+ * Open with O_NOFOLLOW, or equivalent. Note that the fallback equivalent
+ * may be racy. Do not use this as protection against an attacker who can
+ * simultaneously create paths.
+ */
+int open_nofollow(const char *path, int flags);
+
+void sleep_millisec(int millisec);
+
+/*
+ * Generate len bytes from the system cryptographically secure PRNG.
+ * Returns 0 on success and -1 on error, setting errno. The inability to
+ * satisfy the full request is an error.
+ */
+int csprng_bytes(void *buf, size_t len);
+
+/*
+ * Returns a random uint32_t, uniformly distributed across all possible
+ * values.
+ */
+uint32_t git_rand(void);
+
+#endif /* WRAPPER_H */
diff --git a/write-or-die.c b/write-or-die.c
index c4fd91b..01a9a51 100644
--- a/write-or-die.c
+++ b/write-or-die.c
@@ -1,6 +1,7 @@
-#include "cache.h"
-#include "config.h"
+#include "git-compat-util.h"
+#include "parse.h"
#include "run-command.h"
+#include "write-or-die.h"
/*
* Some cases use stdio, but want to flush after the write
@@ -17,22 +18,20 @@
*/
void maybe_flush_or_die(FILE *f, const char *desc)
{
- static int skip_stdout_flush = -1;
- struct stat st;
- char *cp;
-
if (f == stdout) {
- if (skip_stdout_flush < 0) {
- cp = getenv("GIT_FLUSH");
- if (cp)
- skip_stdout_flush = (atoi(cp) == 0);
- else if ((fstat(fileno(stdout), &st) == 0) &&
- S_ISREG(st.st_mode))
- skip_stdout_flush = 1;
- else
- skip_stdout_flush = 0;
+ static int force_flush_stdout = -1;
+
+ if (force_flush_stdout < 0) {
+ force_flush_stdout = git_env_bool("GIT_FLUSH", -1);
+ if (force_flush_stdout < 0) {
+ struct stat st;
+ if (fstat(fileno(stdout), &st))
+ force_flush_stdout = 1;
+ else
+ force_flush_stdout = !S_ISREG(st.st_mode);
+ }
}
- if (skip_stdout_flush && !ferror(f))
+ if (!force_flush_stdout && !ferror(f))
return;
}
if (fflush(f)) {
diff --git a/write-or-die.h b/write-or-die.h
new file mode 100644
index 0000000..65a5c42
--- /dev/null
+++ b/write-or-die.h
@@ -0,0 +1,78 @@
+#ifndef WRITE_OR_DIE_H
+#define WRITE_OR_DIE_H
+
+void maybe_flush_or_die(FILE *, const char *);
+__attribute__((format (printf, 2, 3)))
+void fprintf_or_die(FILE *, const char *fmt, ...);
+void fwrite_or_die(FILE *f, const void *buf, size_t count);
+void fflush_or_die(FILE *f);
+void write_or_die(int fd, const void *buf, size_t count);
+
+/*
+ * These values are used to help identify parts of a repository to fsync.
+ * FSYNC_COMPONENT_NONE identifies data that will not be a persistent part of the
+ * repository and so shouldn't be fsynced.
+ */
+enum fsync_component {
+ FSYNC_COMPONENT_NONE,
+ FSYNC_COMPONENT_LOOSE_OBJECT = 1 << 0,
+ FSYNC_COMPONENT_PACK = 1 << 1,
+ FSYNC_COMPONENT_PACK_METADATA = 1 << 2,
+ FSYNC_COMPONENT_COMMIT_GRAPH = 1 << 3,
+ FSYNC_COMPONENT_INDEX = 1 << 4,
+ FSYNC_COMPONENT_REFERENCE = 1 << 5,
+};
+
+#define FSYNC_COMPONENTS_OBJECTS (FSYNC_COMPONENT_LOOSE_OBJECT | \
+ FSYNC_COMPONENT_PACK)
+
+#define FSYNC_COMPONENTS_DERIVED_METADATA (FSYNC_COMPONENT_PACK_METADATA | \
+ FSYNC_COMPONENT_COMMIT_GRAPH)
+
+#define FSYNC_COMPONENTS_DEFAULT ((FSYNC_COMPONENTS_OBJECTS | \
+ FSYNC_COMPONENTS_DERIVED_METADATA) & \
+ ~FSYNC_COMPONENT_LOOSE_OBJECT)
+
+#define FSYNC_COMPONENTS_COMMITTED (FSYNC_COMPONENTS_OBJECTS | \
+ FSYNC_COMPONENT_REFERENCE)
+
+#define FSYNC_COMPONENTS_ADDED (FSYNC_COMPONENTS_COMMITTED | \
+ FSYNC_COMPONENT_INDEX)
+
+#define FSYNC_COMPONENTS_ALL (FSYNC_COMPONENT_LOOSE_OBJECT | \
+ FSYNC_COMPONENT_PACK | \
+ FSYNC_COMPONENT_PACK_METADATA | \
+ FSYNC_COMPONENT_COMMIT_GRAPH | \
+ FSYNC_COMPONENT_INDEX | \
+ FSYNC_COMPONENT_REFERENCE)
+
+#ifndef FSYNC_COMPONENTS_PLATFORM_DEFAULT
+#define FSYNC_COMPONENTS_PLATFORM_DEFAULT FSYNC_COMPONENTS_DEFAULT
+#endif
+
+/* IO helper functions */
+void fsync_or_die(int fd, const char *);
+int fsync_component(enum fsync_component component, int fd);
+void fsync_component_or_die(enum fsync_component component, int fd, const char *msg);
+
+/*
+ * A bitmask indicating which components of the repo should be fsynced.
+ */
+extern enum fsync_component fsync_components;
+extern int fsync_object_files;
+extern int use_fsync;
+
+enum fsync_method {
+ FSYNC_METHOD_FSYNC,
+ FSYNC_METHOD_WRITEOUT_ONLY,
+ FSYNC_METHOD_BATCH,
+};
+
+extern enum fsync_method fsync_method;
+
+static inline int batch_fsync_enabled(enum fsync_component component)
+{
+ return (fsync_components & component) && (fsync_method == FSYNC_METHOD_BATCH);
+}
+
+#endif /* WRITE_OR_DIE_H */
diff --git a/ws.c b/ws.c
index 6e69877..9456e2f 100644
--- a/ws.c
+++ b/ws.c
@@ -3,8 +3,12 @@
*
* Copyright (c) 2007 Junio C Hamano
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "attr.h"
+#include "strbuf.h"
+#include "ws.h"
+
+unsigned whitespace_rule_cfg = WS_DEFAULT_RULE;
static struct whitespace_rule {
const char *rule_name;
@@ -29,6 +33,7 @@ unsigned parse_whitespace_rule(const char *string)
int i;
size_t len;
const char *ep;
+ const char *arg;
int negated = 0;
string = string + strspn(string, ", \t\n\r");
@@ -52,15 +57,15 @@ unsigned parse_whitespace_rule(const char *string)
rule |= whitespace_rule_names[i].rule_bits;
break;
}
- if (strncmp(string, "tabwidth=", 9) == 0) {
- unsigned tabwidth = atoi(string + 9);
+ if (skip_prefix(string, "tabwidth=", &arg)) {
+ unsigned tabwidth = atoi(arg);
if (0 < tabwidth && tabwidth < 0100) {
rule &= ~WS_TAB_WIDTH_MASK;
rule |= tabwidth;
}
else
warning("tabwidth %.*s out of range",
- (int)(len - 9), string + 9);
+ (int)(ep - arg), arg);
}
string = ep;
}
@@ -252,7 +257,7 @@ unsigned ws_check(const char *line, int len, unsigned ws_rule)
return ws_check_emit_1(line, len, ws_rule, NULL, NULL, NULL, NULL);
}
-int ws_blank_line(const char *line, int len, unsigned ws_rule)
+int ws_blank_line(const char *line, int len)
{
/*
* We _might_ want to treat CR differently from other
diff --git a/ws.h b/ws.h
new file mode 100644
index 0000000..5ba676c
--- /dev/null
+++ b/ws.h
@@ -0,0 +1,33 @@
+#ifndef WS_H
+#define WS_H
+
+struct index_state;
+struct strbuf;
+
+/*
+ * whitespace rules.
+ * used by both diff and apply
+ * last two digits are tab width
+ */
+#define WS_BLANK_AT_EOL 0100
+#define WS_SPACE_BEFORE_TAB 0200
+#define WS_INDENT_WITH_NON_TAB 0400
+#define WS_CR_AT_EOL 01000
+#define WS_BLANK_AT_EOF 02000
+#define WS_TAB_IN_INDENT 04000
+#define WS_TRAILING_SPACE (WS_BLANK_AT_EOL|WS_BLANK_AT_EOF)
+#define WS_DEFAULT_RULE (WS_TRAILING_SPACE|WS_SPACE_BEFORE_TAB|8)
+#define WS_TAB_WIDTH_MASK 077
+/* All WS_* -- when extended, adapt diff.c emit_symbol */
+#define WS_RULE_MASK 07777
+extern unsigned whitespace_rule_cfg;
+unsigned whitespace_rule(struct index_state *, const char *);
+unsigned parse_whitespace_rule(const char *);
+unsigned ws_check(const char *line, int len, unsigned ws_rule);
+void ws_check_emit(const char *line, int len, unsigned ws_rule, FILE *stream, const char *set, const char *reset, const char *ws);
+char *whitespace_error_string(unsigned ws);
+void ws_fix_copy(struct strbuf *, const char *, int, unsigned, int *);
+int ws_blank_line(const char *line, int len);
+#define ws_tab_width(rule) ((rule) & WS_TAB_WIDTH_MASK)
+
+#endif /* WS_H */
diff --git a/wt-status.c b/wt-status.c
index 867e3e4..bdfc23e 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1,9 +1,16 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "advice.h"
#include "wt-status.h"
#include "object.h"
#include "dir.h"
#include "commit.h"
#include "diff.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hash.h"
+#include "hex.h"
+#include "object-name.h"
+#include "path.h"
#include "revision.h"
#include "diffcore.h"
#include "quote.h"
@@ -13,13 +20,20 @@
#include "refs.h"
#include "submodule.h"
#include "column.h"
+#include "read-cache.h"
+#include "setup.h"
#include "strbuf.h"
+#include "trace.h"
+#include "trace2.h"
+#include "tree.h"
#include "utf8.h"
#include "worktree.h"
#include "lockfile.h"
#include "sequencer.h"
+#include "fsmonitor-settings.h"
#define AB_DELAY_WARNING_IN_MS (2 * 1000)
+#define UF_DELAY_WARNING_IN_MS (2 * 1000)
static const char cut_line[] =
"------------------------ >8 ------------------------\n";
@@ -56,7 +70,7 @@ static void status_vprintf(struct wt_status *s, int at_bol, const char *color,
strbuf_vaddf(&sb, fmt, ap);
if (!sb.len) {
if (s->display_comment_prefix) {
- strbuf_addch(&sb, comment_line_char);
+ strbuf_addstr(&sb, comment_line_str);
if (!trail)
strbuf_addch(&sb, ' ');
}
@@ -71,7 +85,7 @@ static void status_vprintf(struct wt_status *s, int at_bol, const char *color,
strbuf_reset(&linebuf);
if (at_bol && s->display_comment_prefix) {
- strbuf_addch(&linebuf, comment_line_char);
+ strbuf_addstr(&linebuf, comment_line_str);
if (*line != '\n' && *line != '\t')
strbuf_addch(&linebuf, ' ');
}
@@ -438,7 +452,7 @@ static char short_submodule_status(struct wt_status_change_data *d)
}
static void wt_status_collect_changed_cb(struct diff_queue_struct *q,
- struct diff_options *options,
+ struct diff_options *options UNUSED,
void *data)
{
struct wt_status *s = data;
@@ -525,7 +539,7 @@ static int unmerged_mask(struct index_state *istate, const char *path)
}
static void wt_status_collect_updated_cb(struct diff_queue_struct *q,
- struct diff_options *options,
+ struct diff_options *options UNUSED,
void *data)
{
struct wt_status *s = data;
@@ -661,7 +675,7 @@ static void wt_status_collect_changes_index(struct wt_status *s)
rev.diffopt.flags.recursive = 1;
copy_pathspec(&rev.prune_data, &s->pathspec);
- run_diff_index(&rev, 1);
+ run_diff_index(&rev, DIFF_INDEX_CACHED);
release_revisions(&rev);
}
@@ -725,7 +739,7 @@ static void wt_status_collect_changes_initial(struct wt_status *s)
ps.max_depth = -1;
strbuf_add(&base, ce->name, ce->ce_namelen);
- read_tree_at(istate->repo, tree, &base, &ps,
+ read_tree_at(istate->repo, tree, &base, 0, &ps,
add_file_to_list, s);
continue;
}
@@ -847,6 +861,7 @@ void wt_status_state_free_buffers(struct wt_status_state *state)
FREE_AND_NULL(state->branch);
FREE_AND_NULL(state->onto);
FREE_AND_NULL(state->detached_from);
+ FREE_AND_NULL(state->bisecting_from);
}
static void wt_longstatus_print_unmerged(struct wt_status *s)
@@ -947,9 +962,11 @@ static void wt_longstatus_print_changed(struct wt_status *s)
wt_longstatus_print_trailer(s);
}
-static int stash_count_refs(struct object_id *ooid, struct object_id *noid,
- const char *email, timestamp_t timestamp, int tz,
- const char *message, void *cb_data)
+static int stash_count_refs(struct object_id *ooid UNUSED,
+ struct object_id *noid UNUSED,
+ const char *email UNUSED,
+ timestamp_t timestamp UNUSED, int tz UNUSED,
+ const char *message UNUSED, void *cb_data)
{
int *c = cb_data;
(*c)++;
@@ -1011,7 +1028,7 @@ static void wt_longstatus_print_submodule_summary(struct wt_status *s, int uncom
if (s->display_comment_prefix) {
size_t len;
summary_content = strbuf_detach(&summary, &len);
- strbuf_add_commented_lines(&summary, summary_content, len);
+ strbuf_add_commented_lines(&summary, summary_content, len, comment_line_str);
free(summary_content);
}
@@ -1073,11 +1090,14 @@ size_t wt_status_locate_end(const char *s, size_t len)
const char *p;
struct strbuf pattern = STRBUF_INIT;
- strbuf_addf(&pattern, "\n%c %s", comment_line_char, cut_line);
+ strbuf_addf(&pattern, "\n%s %s", comment_line_str, cut_line);
if (starts_with(s, pattern.buf + 1))
len = 0;
- else if ((p = strstr(s, pattern.buf)))
- len = p - s + 1;
+ else if ((p = strstr(s, pattern.buf))) {
+ size_t newlen = p - s + 1;
+ if (newlen < len)
+ len = newlen;
+ }
strbuf_release(&pattern);
return len;
}
@@ -1086,16 +1106,19 @@ void wt_status_append_cut_line(struct strbuf *buf)
{
const char *explanation = _("Do not modify or remove the line above.\nEverything below it will be ignored.");
- strbuf_commented_addf(buf, "%s", cut_line);
- strbuf_add_commented_lines(buf, explanation, strlen(explanation));
+ strbuf_commented_addf(buf, comment_line_str, "%s", cut_line);
+ strbuf_add_commented_lines(buf, explanation, strlen(explanation), comment_line_str);
}
-void wt_status_add_cut_line(FILE *fp)
+void wt_status_add_cut_line(struct wt_status *s)
{
struct strbuf buf = STRBUF_INIT;
+ if (s->added_cut_line)
+ return;
+ s->added_cut_line = 1;
wt_status_append_cut_line(&buf);
- fputs(buf.buf, fp);
+ fputs(buf.buf, s->fp);
strbuf_release(&buf);
}
@@ -1126,11 +1149,12 @@ static void wt_longstatus_print_verbose(struct wt_status *s)
* file (and even the "auto" setting won't work, since it
* will have checked isatty on stdout). But we then do want
* to insert the scissor line here to reliably remove the
- * diff before committing.
+ * diff before committing, if we didn't already include one
+ * before.
*/
if (s->fp != stdout) {
rev.diffopt.use_color = 0;
- wt_status_add_cut_line(s->fp);
+ wt_status_add_cut_line(s);
}
if (s->verbose > 1 && s->committable) {
/* print_updated() printed a header, so do we */
@@ -1140,7 +1164,7 @@ static void wt_longstatus_print_verbose(struct wt_status *s)
rev.diffopt.a_prefix = "c/";
rev.diffopt.b_prefix = "i/";
} /* else use prefix as per user config */
- run_diff_index(&rev, 1);
+ run_diff_index(&rev, DIFF_INDEX_CACHED);
if (s->verbose > 1 &&
wt_status_check_worktree_changes(s, &dirty_submodules)) {
status_printf_ln(s, c,
@@ -1159,8 +1183,6 @@ static void wt_longstatus_print_tracking(struct wt_status *s)
struct strbuf sb = STRBUF_INIT;
const char *cp, *ep, *branch_name;
struct branch *branch;
- char comment_line_string[3];
- int i;
uint64_t t_begin = 0;
assert(s->branch && !s->is_initial);
@@ -1170,7 +1192,8 @@ static void wt_longstatus_print_tracking(struct wt_status *s)
t_begin = getnanotime();
- if (!format_tracking_info(branch, &sb, s->ahead_behind_flags))
+ if (!format_tracking_info(branch, &sb, s->ahead_behind_flags,
+ !s->commit_template))
return;
if (advice_enabled(ADVICE_STATUS_AHEAD_BEHIND_WARNING) &&
@@ -1184,25 +1207,27 @@ static void wt_longstatus_print_tracking(struct wt_status *s)
}
}
- i = 0;
- if (s->display_comment_prefix) {
- comment_line_string[i++] = comment_line_char;
- comment_line_string[i++] = ' ';
- }
- comment_line_string[i] = '\0';
-
for (cp = sb.buf; (ep = strchr(cp, '\n')) != NULL; cp = ep + 1)
color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s),
- "%s%.*s", comment_line_string,
+ "%s%s%.*s",
+ s->display_comment_prefix ? comment_line_str : "",
+ s->display_comment_prefix ? " " : "",
(int)(ep - cp), cp);
if (s->display_comment_prefix)
- color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "%c",
- comment_line_char);
+ color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "%s",
+ comment_line_str);
else
fputs("\n", s->fp);
strbuf_release(&sb);
}
+static int uf_was_slow(struct wt_status *s)
+{
+ if (getenv("GIT_TEST_UF_DELAY_WARNING"))
+ s->untracked_in_ms = 3250;
+ return UF_DELAY_WARNING_IN_MS < s->untracked_in_ms;
+}
+
static void show_merge_in_progress(struct wt_status *s,
const char *color)
{
@@ -1271,26 +1296,32 @@ static char *read_line_from_git_path(const char *filename)
static int split_commit_in_progress(struct wt_status *s)
{
int split_in_progress = 0;
- char *head, *orig_head, *rebase_amend, *rebase_orig_head;
+ struct object_id head_oid, orig_head_oid;
+ char *rebase_amend, *rebase_orig_head;
+ int head_flags, orig_head_flags;
if ((!s->amend && !s->nowarn && !s->workdir_dirty) ||
!s->branch || strcmp(s->branch, "HEAD"))
return 0;
- head = read_line_from_git_path("HEAD");
- orig_head = read_line_from_git_path("ORIG_HEAD");
+ if (read_ref_full("HEAD", RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
+ &head_oid, &head_flags) ||
+ read_ref_full("ORIG_HEAD", RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
+ &orig_head_oid, &orig_head_flags))
+ return 0;
+ if (head_flags & REF_ISSYMREF || orig_head_flags & REF_ISSYMREF)
+ return 0;
+
rebase_amend = read_line_from_git_path("rebase-merge/amend");
rebase_orig_head = read_line_from_git_path("rebase-merge/orig-head");
- if (!head || !orig_head || !rebase_amend || !rebase_orig_head)
+ if (!rebase_amend || !rebase_orig_head)
; /* fall through, no split in progress */
else if (!strcmp(rebase_amend, rebase_orig_head))
- split_in_progress = !!strcmp(head, rebase_amend);
- else if (strcmp(orig_head, rebase_orig_head))
+ split_in_progress = !!strcmp(oid_to_hex(&head_oid), rebase_amend);
+ else if (strcmp(oid_to_hex(&orig_head_oid), rebase_orig_head))
split_in_progress = 1;
- free(head);
- free(orig_head);
free(rebase_amend);
free(rebase_orig_head);
@@ -1326,7 +1357,7 @@ static void abbrev_oid_in_line(struct strbuf *line)
* it after abbreviation.
*/
strbuf_trim(split[1]);
- if (!get_oid(split[1]->buf, &oid)) {
+ if (!repo_get_oid(the_repository, split[1]->buf, &oid)) {
strbuf_reset(split[1]);
strbuf_add_unique_abbrev(split[1], &oid,
DEFAULT_ABBREV);
@@ -1351,7 +1382,7 @@ static int read_rebase_todolist(const char *fname, struct string_list *lines)
git_path("%s", fname));
}
while (!strbuf_getline_lf(&line, f)) {
- if (line.len && line.buf[0] == comment_line_char)
+ if (starts_with(line.buf, comment_line_str))
continue;
strbuf_trim(&line);
if (!line.len)
@@ -1492,8 +1523,8 @@ static void show_cherry_pick_in_progress(struct wt_status *s,
else
status_printf_ln(s, color,
_("You are currently cherry-picking commit %s."),
- find_unique_abbrev(&s->state.cherry_pick_head_oid,
- DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, &s->state.cherry_pick_head_oid,
+ DEFAULT_ABBREV));
if (s->hints) {
if (has_unmerged(s))
@@ -1522,8 +1553,8 @@ static void show_revert_in_progress(struct wt_status *s,
else
status_printf_ln(s, color,
_("You are currently reverting commit %s."),
- find_unique_abbrev(&s->state.revert_head_oid,
- DEFAULT_ABBREV));
+ repo_find_unique_abbrev(the_repository, &s->state.revert_head_oid,
+ DEFAULT_ABBREV));
if (s->hints) {
if (has_unmerged(s))
status_printf_ln(s, color,
@@ -1545,10 +1576,10 @@ static void show_revert_in_progress(struct wt_status *s,
static void show_bisect_in_progress(struct wt_status *s,
const char *color)
{
- if (s->state.branch)
+ if (s->state.bisecting_from)
status_printf_ln(s, color,
_("You are currently bisecting, started from branch '%s'."),
- s->state.branch);
+ s->state.bisecting_from);
else
status_printf_ln(s, color,
_("You are currently bisecting."));
@@ -1612,8 +1643,10 @@ struct grab_1st_switch_cbdata {
struct object_id noid;
};
-static int grab_1st_switch(struct object_id *ooid, struct object_id *noid,
- const char *email, timestamp_t timestamp, int tz,
+static int grab_1st_switch(struct object_id *ooid UNUSED,
+ struct object_id *noid,
+ const char *email UNUSED,
+ timestamp_t timestamp UNUSED, int tz UNUSED,
const char *message, void *cb_data)
{
struct grab_1st_switch_cbdata *cb = cb_data;
@@ -1651,7 +1684,8 @@ static void wt_status_get_detached_from(struct repository *r,
return;
}
- if (dwim_ref(cb.buf.buf, cb.buf.len, &oid, &ref, 1) == 1 &&
+ if (repo_dwim_ref(r, cb.buf.buf, cb.buf.len, &oid, &ref,
+ 1) == 1 &&
/* oid is a commit? match without further lookup */
(oideq(&cb.noid, &oid) ||
/* perhaps oid is a tag, try to dereference to a commit */
@@ -1663,9 +1697,9 @@ static void wt_status_get_detached_from(struct repository *r,
state->detached_from = xstrdup(from);
} else
state->detached_from =
- xstrdup(find_unique_abbrev(&cb.noid, DEFAULT_ABBREV));
+ xstrdup(repo_find_unique_abbrev(r, &cb.noid, DEFAULT_ABBREV));
oidcpy(&state->detached_oid, &cb.noid);
- state->detached_at = !get_oid("HEAD", &oid) &&
+ state->detached_at = !repo_get_oid(r, "HEAD", &oid) &&
oideq(&oid, &state->detached_oid);
free(ref);
@@ -1706,7 +1740,7 @@ int wt_status_check_bisect(const struct worktree *wt,
if (!stat(worktree_git_path(wt, "BISECT_LOG"), &st)) {
state->bisect_in_progress = 1;
- state->branch = get_branch(wt, "BISECT_START");
+ state->bisecting_from = get_branch(wt, "BISECT_START");
return 1;
}
return 0;
@@ -1756,21 +1790,21 @@ void wt_status_get_state(struct repository *r,
} else if (wt_status_check_rebase(NULL, state)) {
; /* all set */
} else if (refs_ref_exists(get_main_ref_store(r), "CHERRY_PICK_HEAD") &&
- !get_oid("CHERRY_PICK_HEAD", &oid)) {
+ !repo_get_oid(r, "CHERRY_PICK_HEAD", &oid)) {
state->cherry_pick_in_progress = 1;
oidcpy(&state->cherry_pick_head_oid, &oid);
}
wt_status_check_bisect(NULL, state);
if (refs_ref_exists(get_main_ref_store(r), "REVERT_HEAD") &&
- !get_oid("REVERT_HEAD", &oid)) {
+ !repo_get_oid(r, "REVERT_HEAD", &oid)) {
state->revert_in_progress = 1;
oidcpy(&state->revert_head_oid, &oid);
}
if (!sequencer_get_last_command(r, &action)) {
- if (action == REPLAY_PICK) {
+ if (action == REPLAY_PICK && !state->cherry_pick_in_progress) {
state->cherry_pick_in_progress = 1;
oidcpy(&state->cherry_pick_head_oid, null_oid());
- } else {
+ } else if (action == REPLAY_REVERT && !state->revert_in_progress) {
state->revert_in_progress = 1;
oidcpy(&state->revert_head_oid, null_oid());
}
@@ -1810,6 +1844,7 @@ static void wt_longstatus_print(struct wt_status *s)
{
const char *branch_color = color(WT_STATUS_ONBRANCH, s);
const char *branch_status_color = color(WT_STATUS_HEADER, s);
+ enum fsmonitor_mode fsm_mode = fsm_settings__get_mode(s->repo);
if (s->branch) {
const char *on_what = _("On branch ");
@@ -1866,13 +1901,21 @@ static void wt_longstatus_print(struct wt_status *s)
wt_longstatus_print_other(s, &s->untracked, _("Untracked files"), "add");
if (s->show_ignored_mode)
wt_longstatus_print_other(s, &s->ignored, _("Ignored files"), "add -f");
- if (advice_enabled(ADVICE_STATUS_U_OPTION) && 2000 < s->untracked_in_ms) {
+ if (advice_enabled(ADVICE_STATUS_U_OPTION) && uf_was_slow(s)) {
status_printf_ln(s, GIT_COLOR_NORMAL, "%s", "");
+ if (fsm_mode > FSMONITOR_MODE_DISABLED) {
+ status_printf_ln(s, GIT_COLOR_NORMAL,
+ _("It took %.2f seconds to enumerate untracked files,\n"
+ "but the results were cached, and subsequent runs may be faster."),
+ s->untracked_in_ms / 1000.0);
+ } else {
+ status_printf_ln(s, GIT_COLOR_NORMAL,
+ _("It took %.2f seconds to enumerate untracked files."),
+ s->untracked_in_ms / 1000.0);
+ }
status_printf_ln(s, GIT_COLOR_NORMAL,
- _("It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
- "may speed it up, but you have to be careful not to forget to add\n"
- "new files yourself (see 'git help status')."),
- s->untracked_in_ms / 1000.0);
+ _("See 'git help status' for information on how to improve this."));
+ status_printf_ln(s, GIT_COLOR_NORMAL, "%s", "");
}
} else if (s->committable)
status_printf_ln(s, GIT_COLOR_NORMAL, _("Untracked files not listed%s"),
@@ -2544,8 +2587,8 @@ int has_unstaged_changes(struct repository *r, int ignore_submodules)
}
rev_info.diffopt.flags.quick = 1;
diff_setup_done(&rev_info.diffopt);
- result = run_diff_files(&rev_info, 0);
- result = diff_result_code(&rev_info.diffopt, result);
+ run_diff_files(&rev_info, 0);
+ result = diff_result_code(&rev_info.diffopt);
release_revisions(&rev_info);
return result;
}
@@ -2578,8 +2621,8 @@ int has_uncommitted_changes(struct repository *r,
}
diff_setup_done(&rev_info.diffopt);
- result = run_diff_index(&rev_info, 1);
- result = diff_result_code(&rev_info.diffopt, result);
+ run_diff_index(&rev_info, DIFF_INDEX_CACHED);
+ result = diff_result_code(&rev_info.diffopt);
release_revisions(&rev_info);
return result;
}
@@ -2619,8 +2662,12 @@ int require_clean_work_tree(struct repository *r,
}
if (err) {
- if (hint)
+ if (hint) {
+ if (!*hint)
+ BUG("empty hint passed to require_clean_work_tree();"
+ " use NULL instead");
error("%s", hint);
+ }
if (!gently)
exit(128);
}
diff --git a/wt-status.h b/wt-status.h
index ab9cc9d..4e377ce 100644
--- a/wt-status.h
+++ b/wt-status.h
@@ -23,7 +23,8 @@ enum color_wt_status {
};
enum untracked_status_type {
- SHOW_NO_UNTRACKED_FILES,
+ SHOW_UNTRACKED_FILES_ERROR = -1,
+ SHOW_NO_UNTRACKED_FILES = 0,
SHOW_NORMAL_UNTRACKED_FILES,
SHOW_ALL_UNTRACKED_FILES
};
@@ -94,6 +95,7 @@ struct wt_status_state {
char *branch;
char *onto;
char *detached_from;
+ char *bisecting_from;
struct object_id detached_oid;
struct object_id revert_head_oid;
struct object_id cherry_pick_head_oid;
@@ -129,6 +131,7 @@ struct wt_status {
int rename_score;
int rename_limit;
enum wt_status_format status_format;
+ unsigned char added_cut_line; /* boolean */
struct wt_status_state state;
struct object_id oid_commit; /* when not Initial */
@@ -146,7 +149,7 @@ struct wt_status {
size_t wt_status_locate_end(const char *s, size_t len);
void wt_status_append_cut_line(struct strbuf *buf);
-void wt_status_add_cut_line(FILE *fp);
+void wt_status_add_cut_line(struct wt_status *s);
void wt_status_prepare(struct repository *r, struct wt_status *s);
void wt_status_print(struct wt_status *s);
void wt_status_collect(struct wt_status *s);
diff --git a/xdiff-interface.c b/xdiff-interface.c
index e87950d..16ed8ac 100644
--- a/xdiff-interface.c
+++ b/xdiff-interface.c
@@ -1,11 +1,12 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "gettext.h"
#include "config.h"
-#include "object-store.h"
+#include "hex.h"
+#include "object-store-ll.h"
+#include "strbuf.h"
#include "xdiff-interface.h"
#include "xdiff/xtypes.h"
#include "xdiff/xdiffi.h"
-#include "xdiff/xemit.h"
-#include "xdiff/xmacros.h"
#include "xdiff/xutils.h"
struct xdiff_emit_state {
@@ -183,7 +184,7 @@ void read_mmblob(mmfile_t *ptr, const struct object_id *oid)
return;
}
- ptr->ptr = read_object_file(oid, &type, &size);
+ ptr->ptr = repo_read_object_file(the_repository, oid, &type, &size);
if (!ptr->ptr || type != OBJ_BLOB)
die("unable to read blob object %s", oid_to_hex(oid));
ptr->size = size;
@@ -304,27 +305,35 @@ int xdiff_compare_lines(const char *l1, long s1,
return xdl_recmatch(l1, s1, l2, s2, flags);
}
+int parse_conflict_style_name(const char *value)
+{
+ if (!strcmp(value, "diff3"))
+ return XDL_MERGE_DIFF3;
+ else if (!strcmp(value, "zdiff3"))
+ return XDL_MERGE_ZEALOUS_DIFF3;
+ else if (!strcmp(value, "merge"))
+ return 0;
+ /*
+ * Please update _git_checkout() in git-completion.bash when
+ * you add new merge config
+ */
+ else
+ return -1;
+}
+
int git_xmerge_style = -1;
-int git_xmerge_config(const char *var, const char *value, void *cb)
+int git_xmerge_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
if (!strcmp(var, "merge.conflictstyle")) {
if (!value)
- die("'%s' is not a boolean", var);
- if (!strcmp(value, "diff3"))
- git_xmerge_style = XDL_MERGE_DIFF3;
- else if (!strcmp(value, "zdiff3"))
- git_xmerge_style = XDL_MERGE_ZEALOUS_DIFF3;
- else if (!strcmp(value, "merge"))
- git_xmerge_style = 0;
- /*
- * Please update _git_checkout() in
- * git-completion.bash when you add new merge config
- */
- else
- die("unknown style '%s' given for '%s'",
- value, var);
+ return config_error_nonbool(var);
+ git_xmerge_style = parse_conflict_style_name(value);
+ if (git_xmerge_style == -1)
+ return error(_("unknown style '%s' given for '%s'"),
+ value, var);
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, ctx, cb);
}
diff --git a/xdiff-interface.h b/xdiff-interface.h
index 4301a7e..3853716 100644
--- a/xdiff-interface.h
+++ b/xdiff-interface.h
@@ -1,7 +1,7 @@
#ifndef XDIFF_INTERFACE_H
#define XDIFF_INTERFACE_H
-#include "cache.h"
+#include "hash-ll.h"
#include "xdiff/xdiff.h"
/*
@@ -50,7 +50,10 @@ int buffer_is_binary(const char *ptr, unsigned long size);
void xdiff_set_find_func(xdemitconf_t *xecfg, const char *line, int cflags);
void xdiff_clear_find_func(xdemitconf_t *xecfg);
-int git_xmerge_config(const char *var, const char *value, void *cb);
+struct config_context;
+int parse_conflict_style_name(const char *value);
+int git_xmerge_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb);
extern int git_xmerge_style;
/*
diff --git a/xdiff/xdiff.h b/xdiff/xdiff.h
index 72e25a9..bb56b23 100644
--- a/xdiff/xdiff.h
+++ b/xdiff/xdiff.h
@@ -120,6 +120,7 @@ typedef struct s_bdiffparam {
#define xdl_malloc(x) xmalloc(x)
+#define xdl_calloc(n, sz) xcalloc(n, sz)
#define xdl_free(ptr) free(ptr)
#define xdl_realloc(ptr,x) xrealloc(ptr,x)
diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c
index 758410c..344c2df 100644
--- a/xdiff/xdiffi.c
+++ b/xdiff/xdiffi.c
@@ -321,12 +321,12 @@ int xdl_do_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
return -1;
if (XDF_DIFF_ALG(xpp->flags) == XDF_PATIENCE_DIFF) {
- res = xdl_do_patience_diff(mf1, mf2, xpp, xe);
+ res = xdl_do_patience_diff(xpp, xe);
goto out;
}
if (XDF_DIFF_ALG(xpp->flags) == XDF_HISTOGRAM_DIFF) {
- res = xdl_do_histogram_diff(mf1, mf2, xpp, xe);
+ res = xdl_do_histogram_diff(xpp, xe);
goto out;
}
@@ -337,7 +337,7 @@ int xdl_do_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
* One is to store the forward path and one to store the backward path.
*/
ndiags = xe->xdf1.nreff + xe->xdf2.nreff + 3;
- if (!(kvd = (long *) xdl_malloc((2 * ndiags + 2) * sizeof(long)))) {
+ if (!XDL_ALLOC_ARRAY(kvd, 2 * ndiags + 2)) {
xdl_free_env(xe);
return -1;
@@ -973,7 +973,7 @@ void xdl_free_script(xdchange_t *xscr) {
}
}
-static int xdl_call_hunk_func(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
+static int xdl_call_hunk_func(xdfenv_t *xe UNUSED, xdchange_t *xscr, xdemitcb_t *ecb,
xdemitconf_t const *xecfg)
{
xdchange_t *xch, *xche;
diff --git a/xdiff/xdiffi.h b/xdiff/xdiffi.h
index 8f1c7c8..126c9d8 100644
--- a/xdiff/xdiffi.h
+++ b/xdiff/xdiffi.h
@@ -56,9 +56,7 @@ int xdl_build_script(xdfenv_t *xe, xdchange_t **xscr);
void xdl_free_script(xdchange_t *xscr);
int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
xdemitconf_t const *xecfg);
-int xdl_do_patience_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
- xdfenv_t *env);
-int xdl_do_histogram_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
- xdfenv_t *env);
+int xdl_do_patience_diff(xpparam_t const *xpp, xdfenv_t *env);
+int xdl_do_histogram_diff(xpparam_t const *xpp, xdfenv_t *env);
#endif /* #if !defined(XDIFFI_H) */
diff --git a/xdiff/xemit.c b/xdiff/xemit.c
index c4ccd68..75f0fe4 100644
--- a/xdiff/xemit.c
+++ b/xdiff/xemit.c
@@ -95,7 +95,7 @@ xdchange_t *xdl_get_hunk(xdchange_t **xscr, xdemitconf_t const *xecfg)
}
-static long def_ff(const char *rec, long len, char *buf, long sz, void *priv)
+static long def_ff(const char *rec, long len, char *buf, long sz)
{
if (len > 0 &&
(isalpha((unsigned char)*rec) || /* identifier? */
@@ -117,7 +117,7 @@ static long match_func_rec(xdfile_t *xdf, xdemitconf_t const *xecfg, long ri,
const char *rec;
long len = xdl_get_rec(xdf, ri, &rec);
if (!xecfg->find_func)
- return def_ff(rec, len, buf, sz, xecfg->find_func_priv);
+ return def_ff(rec, len, buf, sz);
return xecfg->find_func(rec, len, buf, sz, xecfg->find_func_priv);
}
diff --git a/xdiff/xhistogram.c b/xdiff/xhistogram.c
index 01decff..16a8fe2 100644
--- a/xdiff/xhistogram.c
+++ b/xdiff/xhistogram.c
@@ -251,7 +251,7 @@ static int find_lcs(xpparam_t const *xpp, xdfenv_t *env,
int line1, int count1, int line2, int count2)
{
int b_ptr;
- int sz, ret = -1;
+ int ret = -1;
struct histindex index;
memset(&index, 0, sizeof(index));
@@ -265,23 +265,16 @@ static int find_lcs(xpparam_t const *xpp, xdfenv_t *env,
index.rcha.head = NULL;
index.table_bits = xdl_hashbits(count1);
- sz = index.records_size = 1 << index.table_bits;
- sz *= sizeof(struct record *);
- if (!(index.records = (struct record **) xdl_malloc(sz)))
+ index.records_size = 1 << index.table_bits;
+ if (!XDL_CALLOC_ARRAY(index.records, index.records_size))
goto cleanup;
- memset(index.records, 0, sz);
- sz = index.line_map_size = count1;
- sz *= sizeof(struct record *);
- if (!(index.line_map = (struct record **) xdl_malloc(sz)))
+ index.line_map_size = count1;
+ if (!XDL_CALLOC_ARRAY(index.line_map, index.line_map_size))
goto cleanup;
- memset(index.line_map, 0, sz);
- sz = index.line_map_size;
- sz *= sizeof(unsigned int);
- if (!(index.next_ptrs = (unsigned int *) xdl_malloc(sz)))
+ if (!XDL_CALLOC_ARRAY(index.next_ptrs, index.line_map_size))
goto cleanup;
- memset(index.next_ptrs, 0, sz);
/* lines / 4 + 1 comes from xprepare.c:xdl_prepare_ctx() */
if (xdl_cha_init(&index.rcha, sizeof(struct record), count1 / 4 + 1) < 0)
@@ -369,8 +362,7 @@ out:
return result;
}
-int xdl_do_histogram_diff(mmfile_t *file1, mmfile_t *file2,
- xpparam_t const *xpp, xdfenv_t *env)
+int xdl_do_histogram_diff(xpparam_t const *xpp, xdfenv_t *env)
{
return histogram_diff(xpp, env,
env->xdf1.dstart + 1, env->xdf1.dend - env->xdf1.dstart + 1,
diff --git a/xdiff/xmacros.h b/xdiff/xmacros.h
index ae4636c..8487bb3 100644
--- a/xdiff/xmacros.h
+++ b/xdiff/xmacros.h
@@ -49,5 +49,23 @@ do { \
((unsigned long) __p[2]) << 16 | ((unsigned long) __p[3]) << 24; \
} while (0)
+/* Allocate an array of nr elements, returns NULL on failure */
+#define XDL_ALLOC_ARRAY(p, nr) \
+ ((p) = SIZE_MAX / sizeof(*(p)) >= (size_t)(nr) \
+ ? xdl_malloc((nr) * sizeof(*(p))) \
+ : NULL)
+
+/* Allocate an array of nr zeroed out elements, returns NULL on failure */
+#define XDL_CALLOC_ARRAY(p, nr) ((p) = xdl_calloc(nr, sizeof(*(p))))
+
+/*
+ * Ensure array p can accommodate at least nr elements, growing the
+ * array and updating alloc (which is the number of allocated
+ * elements) as necessary. Frees p and returns -1 on failure, returns
+ * 0 on success
+ */
+#define XDL_ALLOC_GROW(p, nr, alloc) \
+ (-!((nr) <= (alloc) || \
+ ((p) = xdl_alloc_grow_helper((p), (nr), &(alloc), sizeof(*(p))))))
#endif /* #if !defined(XMACROS_H) */
diff --git a/xdiff/xpatience.c b/xdiff/xpatience.c
index 1a21c6a..a2d8955 100644
--- a/xdiff/xpatience.c
+++ b/xdiff/xpatience.c
@@ -69,7 +69,6 @@ struct hashmap {
} *entries, *first, *last;
/* were common records found? */
unsigned long has_matches;
- mmfile_t *file1, *file2;
xdfenv_t *env;
xpparam_t const *xpp;
};
@@ -139,23 +138,17 @@ static void insert_record(xpparam_t const *xpp, int line, struct hashmap *map,
*
* It is assumed that env has been prepared using xdl_prepare().
*/
-static int fill_hashmap(mmfile_t *file1, mmfile_t *file2,
- xpparam_t const *xpp, xdfenv_t *env,
+static int fill_hashmap(xpparam_t const *xpp, xdfenv_t *env,
struct hashmap *result,
int line1, int count1, int line2, int count2)
{
- result->file1 = file1;
- result->file2 = file2;
result->xpp = xpp;
result->env = env;
/* We know exactly how large we want the hash map */
result->alloc = count1 * 2;
- result->entries = (struct entry *)
- xdl_malloc(result->alloc * sizeof(struct entry));
- if (!result->entries)
+ if (!XDL_CALLOC_ARRAY(result->entries, result->alloc))
return -1;
- memset(result->entries, 0, result->alloc * sizeof(struct entry));
/* First, fill with entries from the first file */
while (count1--)
@@ -200,7 +193,7 @@ static int binary_search(struct entry **sequence, int longest,
*/
static int find_longest_common_sequence(struct hashmap *map, struct entry **res)
{
- struct entry **sequence = xdl_malloc(map->nr * sizeof(struct entry *));
+ struct entry **sequence;
int longest = 0, i;
struct entry *entry;
@@ -211,7 +204,7 @@ static int find_longest_common_sequence(struct hashmap *map, struct entry **res)
*/
int anchor_i = -1;
- if (!sequence)
+ if (!XDL_ALLOC_ARRAY(sequence, map->nr))
return -1;
for (entry = map->first; entry; entry = entry->next) {
@@ -257,8 +250,7 @@ static int match(struct hashmap *map, int line1, int line2)
return record1->ha == record2->ha;
}
-static int patience_diff(mmfile_t *file1, mmfile_t *file2,
- xpparam_t const *xpp, xdfenv_t *env,
+static int patience_diff(xpparam_t const *xpp, xdfenv_t *env,
int line1, int count1, int line2, int count2);
static int walk_common_sequence(struct hashmap *map, struct entry *first,
@@ -289,8 +281,7 @@ static int walk_common_sequence(struct hashmap *map, struct entry *first,
/* Recurse */
if (next1 > line1 || next2 > line2) {
- if (patience_diff(map->file1, map->file2,
- map->xpp, map->env,
+ if (patience_diff(map->xpp, map->env,
line1, next1 - line1,
line2, next2 - line2))
return -1;
@@ -329,8 +320,7 @@ static int fall_back_to_classic_diff(struct hashmap *map,
*
* This function assumes that env was prepared with xdl_prepare_env().
*/
-static int patience_diff(mmfile_t *file1, mmfile_t *file2,
- xpparam_t const *xpp, xdfenv_t *env,
+static int patience_diff(xpparam_t const *xpp, xdfenv_t *env,
int line1, int count1, int line2, int count2)
{
struct hashmap map;
@@ -349,7 +339,7 @@ static int patience_diff(mmfile_t *file1, mmfile_t *file2,
}
memset(&map, 0, sizeof(map));
- if (fill_hashmap(file1, file2, xpp, env, &map,
+ if (fill_hashmap(xpp, env, &map,
line1, count1, line2, count2))
return -1;
@@ -377,9 +367,7 @@ static int patience_diff(mmfile_t *file1, mmfile_t *file2,
return result;
}
-int xdl_do_patience_diff(mmfile_t *file1, mmfile_t *file2,
- xpparam_t const *xpp, xdfenv_t *env)
+int xdl_do_patience_diff(xpparam_t const *xpp, xdfenv_t *env)
{
- return patience_diff(file1, file2, xpp, env,
- 1, env->xdf1.nrec, 1, env->xdf2.nrec);
+ return patience_diff(xpp, env, 1, env->xdf1.nrec, 1, env->xdf2.nrec);
}
diff --git a/xdiff/xprepare.c b/xdiff/xprepare.c
index 1057527..c84549f 100644
--- a/xdiff/xprepare.c
+++ b/xdiff/xprepare.c
@@ -78,15 +78,14 @@ static int xdl_init_classifier(xdlclassifier_t *cf, long size, long flags) {
return -1;
}
- if (!(cf->rchash = (xdlclass_t **) xdl_malloc(cf->hsize * sizeof(xdlclass_t *)))) {
+ if (!XDL_CALLOC_ARRAY(cf->rchash, cf->hsize)) {
xdl_cha_free(&cf->ncha);
return -1;
}
- memset(cf->rchash, 0, cf->hsize * sizeof(xdlclass_t *));
cf->alloc = size;
- if (!(cf->rcrecs = (xdlclass_t **) xdl_malloc(cf->alloc * sizeof(xdlclass_t *)))) {
+ if (!XDL_ALLOC_ARRAY(cf->rcrecs, cf->alloc)) {
xdl_free(cf->rchash);
xdl_cha_free(&cf->ncha);
@@ -112,7 +111,6 @@ static int xdl_classify_record(unsigned int pass, xdlclassifier_t *cf, xrecord_t
long hi;
char const *line;
xdlclass_t *rcrec;
- xdlclass_t **rcrecs;
line = rec->ptr;
hi = (long) XDL_HASHLONG(rec->ha, cf->hbits);
@@ -128,14 +126,8 @@ static int xdl_classify_record(unsigned int pass, xdlclassifier_t *cf, xrecord_t
return -1;
}
rcrec->idx = cf->count++;
- if (cf->count > cf->alloc) {
- cf->alloc *= 2;
- if (!(rcrecs = (xdlclass_t **) xdl_realloc(cf->rcrecs, cf->alloc * sizeof(xdlclass_t *)))) {
-
+ if (XDL_ALLOC_GROW(cf->rcrecs, cf->count, cf->alloc))
return -1;
- }
- cf->rcrecs = rcrecs;
- }
cf->rcrecs[rcrec->idx] = rcrec;
rcrec->line = line;
rcrec->size = rec->size;
@@ -164,7 +156,7 @@ static int xdl_prepare_ctx(unsigned int pass, mmfile_t *mf, long narec, xpparam_
unsigned long hav;
char const *blk, *cur, *top, *prev;
xrecord_t *crec;
- xrecord_t **recs, **rrecs;
+ xrecord_t **recs;
xrecord_t **rhash;
unsigned long *ha;
char *rchg;
@@ -178,26 +170,21 @@ static int xdl_prepare_ctx(unsigned int pass, mmfile_t *mf, long narec, xpparam_
if (xdl_cha_init(&xdf->rcha, sizeof(xrecord_t), narec / 4 + 1) < 0)
goto abort;
- if (!(recs = (xrecord_t **) xdl_malloc(narec * sizeof(xrecord_t *))))
+ if (!XDL_ALLOC_ARRAY(recs, narec))
goto abort;
hbits = xdl_hashbits((unsigned int) narec);
hsize = 1 << hbits;
- if (!(rhash = (xrecord_t **) xdl_malloc(hsize * sizeof(xrecord_t *))))
+ if (!XDL_CALLOC_ARRAY(rhash, hsize))
goto abort;
- memset(rhash, 0, hsize * sizeof(xrecord_t *));
nrec = 0;
if ((cur = blk = xdl_mmfile_first(mf, &bsize))) {
for (top = blk + bsize; cur < top; ) {
prev = cur;
hav = xdl_hash_record(&cur, top, xpp->flags);
- if (nrec >= narec) {
- narec *= 2;
- if (!(rrecs = (xrecord_t **) xdl_realloc(recs, narec * sizeof(xrecord_t *))))
- goto abort;
- recs = rrecs;
- }
+ if (XDL_ALLOC_GROW(recs, nrec + 1, narec))
+ goto abort;
if (!(crec = xdl_cha_alloc(&xdf->rcha)))
goto abort;
crec->ptr = prev;
@@ -209,15 +196,14 @@ static int xdl_prepare_ctx(unsigned int pass, mmfile_t *mf, long narec, xpparam_
}
}
- if (!(rchg = (char *) xdl_malloc((nrec + 2) * sizeof(char))))
+ if (!XDL_CALLOC_ARRAY(rchg, nrec + 2))
goto abort;
- memset(rchg, 0, (nrec + 2) * sizeof(char));
if ((XDF_DIFF_ALG(xpp->flags) != XDF_PATIENCE_DIFF) &&
(XDF_DIFF_ALG(xpp->flags) != XDF_HISTOGRAM_DIFF)) {
- if (!(rindex = xdl_malloc((nrec + 1) * sizeof(*rindex))))
+ if (!XDL_ALLOC_ARRAY(rindex, nrec + 1))
goto abort;
- if (!(ha = xdl_malloc((nrec + 1) * sizeof(*ha))))
+ if (!XDL_ALLOC_ARRAY(ha, nrec + 1))
goto abort;
}
@@ -383,11 +369,8 @@ static int xdl_cleanup_records(xdlclassifier_t *cf, xdfile_t *xdf1, xdfile_t *xd
xdlclass_t *rcrec;
char *dis, *dis1, *dis2;
- if (!(dis = (char *) xdl_malloc(xdf1->nrec + xdf2->nrec + 2))) {
-
+ if (!XDL_CALLOC_ARRAY(dis, xdf1->nrec + xdf2->nrec + 2))
return -1;
- }
- memset(dis, 0, xdf1->nrec + xdf2->nrec + 2);
dis1 = dis;
dis2 = dis1 + xdf1->nrec + 1;
diff --git a/xdiff/xutils.c b/xdiff/xutils.c
index 115b2b1..9e36f24 100644
--- a/xdiff/xutils.c
+++ b/xdiff/xutils.c
@@ -432,3 +432,20 @@ int xdl_fall_back_diff(xdfenv_t *diff_env, xpparam_t const *xpp,
return 0;
}
+
+void* xdl_alloc_grow_helper(void *p, long nr, long *alloc, size_t size)
+{
+ void *tmp = NULL;
+ size_t n = ((LONG_MAX - 16) / 2 >= *alloc) ? 2 * *alloc + 16 : LONG_MAX;
+ if (nr > n)
+ n = nr;
+ if (SIZE_MAX / size >= n)
+ tmp = xdl_realloc(p, n * size);
+ if (tmp) {
+ *alloc = n;
+ } else {
+ xdl_free(p);
+ *alloc = 0;
+ }
+ return tmp;
+}
diff --git a/xdiff/xutils.h b/xdiff/xutils.h
index fba7bae..fd0bba9 100644
--- a/xdiff/xutils.h
+++ b/xdiff/xutils.h
@@ -42,6 +42,7 @@ int xdl_emit_hunk_hdr(long s1, long c1, long s2, long c2,
int xdl_fall_back_diff(xdfenv_t *diff_env, xpparam_t const *xpp,
int line1, int count1, int line2, int count2);
-
+/* Do not call this function, use XDL_ALLOC_GROW instead */
+void* xdl_alloc_grow_helper(void* p, long nr, long* alloc, size_t size);
#endif /* #if !defined(XUTILS_H) */